From 9837e84dc793c1089c9f359eeb69372dc90b09ff Mon Sep 17 00:00:00 2001 From: support Date: Tue, 17 May 2022 10:08:15 +0000 Subject: [PATCH] Built motion from commit 52617d9d.|2.6.10 --- 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 d866a39..d2321d2 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-05-16T09:31:00.710Z", + "time": "2022-05-17T10:00:40.804Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 50f6411..2c6ecad 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-05-16T09:31:00.710Z", + "time": "2022-05-17T10:00:40.804Z", "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 75aa2f8..d9fb178 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 _0xa330=['action','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','VIRTUAL','getDataValue'];(function(_0x33228a,_0x1e459c){var _0x1b754c=function(_0x24f2e7){while(--_0x24f2e7){_0x33228a['push'](_0x33228a['shift']());}};_0x1b754c(++_0x1e459c);}(_0xa330,0xc5));var _0x0a33=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xa330[_0x2d34d6];return _0x1d3d12;};'use strict';var Sequelize=require('sequelize');module[_0x0a33('0x0')]={'name':{'type':Sequelize[_0x0a33('0x1')],'get':function(_0x359188){return this[_0x0a33('0x2')](_0x0a33('0x3'));}},'action':{'type':Sequelize[_0x0a33('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x0a33('0x5'),_0x0a33('0x6'),_0x0a33('0x7'),_0x0a33('0x8'),_0x0a33('0x9'),_0x0a33('0xa'),_0x0a33('0xb'),_0x0a33('0xc')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x0a33('0xd')},'data1':{'type':Sequelize[_0x0a33('0x4')](0x1000),'comment':_0x0a33('0xe')},'data2':{'type':Sequelize[_0x0a33('0x4')](0x1000),'comment':_0x0a33('0xf')},'data3':{'type':Sequelize[_0x0a33('0x4')](0x1000),'comment':_0x0a33('0x10')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x0a33('0x4')](0x1000),'comments':_0x0a33('0x11')},'data6':{'type':Sequelize['STRING'],'comments':_0x0a33('0x12')},'data7':{'type':Sequelize[_0x0a33('0x13')],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x5382=['exports','getDataValue','action','STRING','contactManager','jscripty','urlForward','browser','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]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize'];(function(_0x406695,_0xb7c09c){var _0x58d9ee=function(_0x5cee97){while(--_0x5cee97){_0x406695['push'](_0x406695['shift']());}};_0x58d9ee(++_0xb7c09c);}(_0x5382,0xcf));var _0x2538=function(_0x9982ed,_0x58ec07){_0x9982ed=_0x9982ed-0x0;var _0x468c75=_0x5382[_0x9982ed];return _0x468c75;};'use strict';var Sequelize=require(_0x2538('0x0'));module[_0x2538('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1fa084){return this[_0x2538('0x2')](_0x2538('0x3'));}},'action':{'type':Sequelize[_0x2538('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2538('0x5'),'integration','motionbar',_0x2538('0x6'),_0x2538('0x7'),_0x2538('0x8'),'bot',_0x2538('0x9')]],'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[_0x2538('0x4')](0x1000),'comment':_0x2538('0xa')},'data2':{'type':Sequelize[_0x2538('0x4')](0x1000),'comment':_0x2538('0xb')},'data3':{'type':Sequelize[_0x2538('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x2538('0x4')](0x1000),'comments':_0x2538('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x2538('0xd')},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x2538('0xe')],'comments':_0x2538('0xf')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c39fbf7..53a5384 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 _0x46cb=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','body','find','catch','destroy','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring'];(function(_0x1abcff,_0x1e5f3b){var _0x4c9f20=function(_0x5e5e4a){while(--_0x5e5e4a){_0x1abcff['push'](_0x1abcff['shift']());}};_0x4c9f20(++_0x1e5f3b);}(_0x46cb,0x84));var _0xb46c=function(_0x598a6f,_0x263c42){_0x598a6f=_0x598a6f-0x0;var _0x47c368=_0x46cb[_0x598a6f];return _0x47c368;};'use strict';var emlformat=require(_0xb46c('0x0'));var rimraf=require(_0xb46c('0x1'));var zipdir=require(_0xb46c('0x2'));var jsonpatch=require(_0xb46c('0x3'));var rp=require('request-promise');var moment=require(_0xb46c('0x4'));var BPromise=require(_0xb46c('0x5'));var Mustache=require(_0xb46c('0x6'));var util=require(_0xb46c('0x7'));var path=require('path');var sox=require(_0xb46c('0x8'));var csv=require(_0xb46c('0x9'));var ejs=require(_0xb46c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb46c('0xb'));var squel=require('squel');var crypto=require(_0xb46c('0xc'));var jsforce=require(_0xb46c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb46c('0xe'));var Papa=require(_0xb46c('0xf'));var Redis=require(_0xb46c('0x10'));var authService=require(_0xb46c('0x11'));var qs=require(_0xb46c('0x12'));var as=require(_0xb46c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46c('0x14'))(_0xb46c('0x15'));var utils=require(_0xb46c('0x16'));var config=require(_0xb46c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb46c('0x18'))['db'];function respondWithStatusCode(_0x3059da,_0x1dd251){_0x1dd251=_0x1dd251||0xcc;return function(_0x4a3399){if(_0x4a3399){return _0x3059da[_0xb46c('0x19')](_0x1dd251);}return _0x3059da[_0xb46c('0x1a')](_0x1dd251)['end']();};}function respondWithResult(_0x18f1d0,_0x213f4a){_0x213f4a=_0x213f4a||0xc8;return function(_0x967278){if(_0x967278){return _0x18f1d0[_0xb46c('0x1a')](_0x213f4a)[_0xb46c('0x1b')](_0x967278);}};}function respondWithFilteredResult(_0x45c3e1,_0x172bb8){return function(_0x5d431b){if(_0x5d431b){var _0xe4261a=typeof _0x172bb8[_0xb46c('0x1c')]===_0xb46c('0x1d')&&typeof _0x172bb8[_0xb46c('0x1e')]===_0xb46c('0x1d');var _0x2437a0=_0x5d431b['count'];var _0x572860=_0xe4261a?0x0:_0x172bb8[_0xb46c('0x1c')];var _0x4c7ef6=_0xe4261a?_0x5d431b[_0xb46c('0x1f')]:_0x172bb8[_0xb46c('0x1c')]+_0x172bb8[_0xb46c('0x1e')];var _0x32ade3;if(_0x4c7ef6>=_0x2437a0){_0x4c7ef6=_0x2437a0;_0x32ade3=0xc8;}else{_0x32ade3=0xce;}_0x45c3e1['status'](_0x32ade3);return _0x45c3e1[_0xb46c('0x20')]('Content-Range',_0x572860+'-'+_0x4c7ef6+'/'+_0x2437a0)['json'](_0x5d431b);}return null;};}function patchUpdates(_0x87d31d){return function(_0x1b8c8d){try{jsonpatch[_0xb46c('0x21')](_0x1b8c8d,_0x87d31d,!![]);}catch(_0x43ae7c){return BPromise[_0xb46c('0x22')](_0x43ae7c);}return _0x1b8c8d[_0xb46c('0x23')]();};}function saveUpdates(_0x5f3cfb,_0x4d68b1){return function(_0x184038){if(_0x184038){return _0x184038[_0xb46c('0x24')](_0x5f3cfb)[_0xb46c('0x25')](function(_0x11b121){return _0x11b121;});}return null;};}function removeEntity(_0x1e40ed,_0x2b4412){return function(_0x8d71cd){if(_0x8d71cd){return _0x8d71cd['destroy']()[_0xb46c('0x25')](function(){_0x1e40ed[_0xb46c('0x1a')](0xcc)[_0xb46c('0x26')]();});}};}function handleEntityNotFound(_0x47960b,_0x4e822a){return function(_0x20fc36){if(!_0x20fc36){_0x47960b[_0xb46c('0x19')](0x194);}return _0x20fc36;};}function handleError(_0x3ff2a6,_0x2585c6){_0x2585c6=_0x2585c6||0x1f4;return function(_0x463a71){logger[_0xb46c('0x27')](_0x463a71[_0xb46c('0x28')]);if(_0x463a71[_0xb46c('0x29')]){delete _0x463a71[_0xb46c('0x29')];}_0x3ff2a6[_0xb46c('0x1a')](_0x2585c6)[_0xb46c('0x2a')](_0x463a71);};}exports[_0xb46c('0x24')]=function(_0x4220a9,_0x2c8956){if(_0x4220a9[_0xb46c('0x2b')]['id']){delete _0x4220a9[_0xb46c('0x2b')]['id'];}return db['Action'][_0xb46c('0x2c')]({'where':{'id':_0x4220a9['params']['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x2c8956,null))['then'](saveUpdates(_0x4220a9['body'],null))[_0xb46c('0x25')](respondWithResult(_0x2c8956,null))[_0xb46c('0x2d')](handleError(_0x2c8956,null));};exports[_0xb46c('0x2e')]=function(_0x1a358f,_0x59adf2){return db[_0xb46c('0x2f')][_0xb46c('0x2c')]({'where':{'id':_0x1a358f[_0xb46c('0x30')]['id']}})['then'](handleEntityNotFound(_0x59adf2,null))[_0xb46c('0x25')](removeEntity(_0x59adf2,null))['catch'](handleError(_0x59adf2,null));}; \ No newline at end of file +var _0x8644=['status','offset','undefined','count','limit','set','json','save','update','destroy','then','end','error','stack','name','send','body','Action','find','params','catch','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x8644,0x79));var _0x4864=function(_0x49237d,_0xbe0b7f){_0x49237d=_0x49237d-0x0;var _0x487149=_0x8644[_0x49237d];return _0x487149;};'use strict';var emlformat=require(_0x4864('0x0'));var rimraf=require(_0x4864('0x1'));var zipdir=require(_0x4864('0x2'));var jsonpatch=require(_0x4864('0x3'));var rp=require(_0x4864('0x4'));var moment=require(_0x4864('0x5'));var BPromise=require(_0x4864('0x6'));var Mustache=require(_0x4864('0x7'));var util=require(_0x4864('0x8'));var path=require(_0x4864('0x9'));var sox=require(_0x4864('0xa'));var csv=require(_0x4864('0xb'));var ejs=require(_0x4864('0xc'));var fs=require('fs');var fs_extra=require(_0x4864('0xd'));var _=require(_0x4864('0xe'));var squel=require(_0x4864('0xf'));var crypto=require(_0x4864('0x10'));var jsforce=require(_0x4864('0x11'));var deskjs=require(_0x4864('0x12'));var toCsv=require(_0x4864('0xb'));var querystring=require('querystring');var Papa=require(_0x4864('0x13'));var Redis=require('ioredis');var authService=require(_0x4864('0x14'));var qs=require(_0x4864('0x15'));var as=require(_0x4864('0x16'));var hardwareService=require(_0x4864('0x17'));var logger=require(_0x4864('0x18'))(_0x4864('0x19'));var utils=require('../../config/utils');var config=require(_0x4864('0x1a'));var licenseUtil=require(_0x4864('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20b4cd,_0x14948d){_0x14948d=_0x14948d||0xcc;return function(_0x20a5e9){if(_0x20a5e9){return _0x20b4cd[_0x4864('0x1c')](_0x14948d);}return _0x20b4cd[_0x4864('0x1d')](_0x14948d)['end']();};}function respondWithResult(_0x272975,_0x510655){_0x510655=_0x510655||0xc8;return function(_0x45c0f6){if(_0x45c0f6){return _0x272975['status'](_0x510655)['json'](_0x45c0f6);}};}function respondWithFilteredResult(_0xbbe9bd,_0x3744a1){return function(_0x1d231a){if(_0x1d231a){var _0x390ece=typeof _0x3744a1[_0x4864('0x1e')]===_0x4864('0x1f')&&typeof _0x3744a1['limit']===_0x4864('0x1f');var _0x12855c=_0x1d231a[_0x4864('0x20')];var _0x42f261=_0x390ece?0x0:_0x3744a1[_0x4864('0x1e')];var _0x4f546c=_0x390ece?_0x1d231a[_0x4864('0x20')]:_0x3744a1['offset']+_0x3744a1[_0x4864('0x21')];var _0x40fe8;if(_0x4f546c>=_0x12855c){_0x4f546c=_0x12855c;_0x40fe8=0xc8;}else{_0x40fe8=0xce;}_0xbbe9bd['status'](_0x40fe8);return _0xbbe9bd[_0x4864('0x22')]('Content-Range',_0x42f261+'-'+_0x4f546c+'/'+_0x12855c)[_0x4864('0x23')](_0x1d231a);}return null;};}function patchUpdates(_0x49e094){return function(_0x5e3ad5){try{jsonpatch['apply'](_0x5e3ad5,_0x49e094,!![]);}catch(_0x11a0d8){return BPromise['reject'](_0x11a0d8);}return _0x5e3ad5[_0x4864('0x24')]();};}function saveUpdates(_0x36180c,_0x4db4c9){return function(_0x2b0a35){if(_0x2b0a35){return _0x2b0a35[_0x4864('0x25')](_0x36180c)['then'](function(_0x10e5f4){return _0x10e5f4;});}return null;};}function removeEntity(_0x2c225b,_0x449d67){return function(_0xf22d7d){if(_0xf22d7d){return _0xf22d7d[_0x4864('0x26')]()[_0x4864('0x27')](function(){_0x2c225b[_0x4864('0x1d')](0xcc)[_0x4864('0x28')]();});}};}function handleEntityNotFound(_0x1156cc,_0x46ea83){return function(_0x2ed108){if(!_0x2ed108){_0x1156cc[_0x4864('0x1c')](0x194);}return _0x2ed108;};}function handleError(_0x378880,_0x456afb){_0x456afb=_0x456afb||0x1f4;return function(_0x4a9d5c){logger[_0x4864('0x29')](_0x4a9d5c[_0x4864('0x2a')]);if(_0x4a9d5c['name']){delete _0x4a9d5c[_0x4864('0x2b')];}_0x378880['status'](_0x456afb)[_0x4864('0x2c')](_0x4a9d5c);};}exports[_0x4864('0x25')]=function(_0x10ec32,_0x2817c3){if(_0x10ec32[_0x4864('0x2d')]['id']){delete _0x10ec32[_0x4864('0x2d')]['id'];}return db[_0x4864('0x2e')][_0x4864('0x2f')]({'where':{'id':_0x10ec32[_0x4864('0x30')]['id']}})[_0x4864('0x27')](handleEntityNotFound(_0x2817c3,null))['then'](saveUpdates(_0x10ec32[_0x4864('0x2d')],null))['then'](respondWithResult(_0x2817c3,null))[_0x4864('0x31')](handleError(_0x2817c3,null));};exports['destroy']=function(_0x38a6b5,_0x14e381){return db[_0x4864('0x2e')][_0x4864('0x2f')]({'where':{'id':_0x38a6b5[_0x4864('0x30')]['id']}})[_0x4864('0x27')](handleEntityNotFound(_0x14e381,null))[_0x4864('0x27')](removeEntity(_0x14e381,null))[_0x4864('0x31')](handleError(_0x14e381,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 25c9d71..cf8ba35 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 _0xa57f=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','Action','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa57f,0x77));var _0xfa57=function(_0x2225ed,_0x4cd999){_0x2225ed=_0x2225ed-0x0;var _0x42f7c8=_0xa57f[_0x2225ed];return _0x42f7c8;};'use strict';var _=require('lodash');var util=require(_0xfa57('0x0'));var logger=require(_0xfa57('0x1'))(_0xfa57('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfa57('0x3'));var fs=require('fs');var path=require(_0xfa57('0x4'));var rimraf=require(_0xfa57('0x5'));var config=require(_0xfa57('0x6'));var attributes=require('./action.attributes');module[_0xfa57('0x7')]=function(_0x54699d,_0x2ea796){return _0x54699d[_0xfa57('0x8')](_0xfa57('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x307f=['util','../../config/logger','api','bluebird','path','../../config/environment','./action.attributes','exports','define','Action','tools_actions','lodash'];(function(_0x1317ed,_0x57217d){var _0xbaeca=function(_0x24e517){while(--_0x24e517){_0x1317ed['push'](_0x1317ed['shift']());}};_0xbaeca(++_0x57217d);}(_0x307f,0x1af));var _0xf307=function(_0x50bdbf,_0x548c38){_0x50bdbf=_0x50bdbf-0x0;var _0x385a89=_0x307f[_0x50bdbf];return _0x385a89;};'use strict';var _=require(_0xf307('0x0'));var util=require(_0xf307('0x1'));var logger=require(_0xf307('0x2'))(_0xf307('0x3'));var moment=require('moment');var BPromise=require(_0xf307('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf307('0x5'));var rimraf=require('rimraf');var config=require(_0xf307('0x6'));var attributes=require(_0xf307('0x7'));module[_0xf307('0x8')]=function(_0x33b49b,_0x5447f2){return _0x33b49b[_0xf307('0x9')](_0xf307('0xa'),attributes,{'tableName':_0xf307('0xb'),'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 66441d7..8c7d030 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x577f23,_0x3113fb){var _0x285a05=function(_0x4cf77c){while(--_0x4cf77c){_0x577f23['push'](_0x577f23['shift']());}};_0x285a05(++_0x3113fb);}(_0x326f,0xd1));var _0xf326=function(_0x1be683,_0x206384){_0x1be683=_0x1be683-0x0;var _0x1e155e=_0x326f[_0x1be683];return _0x1e155e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x38ea79,_0xc8a557){_0x38ea79=_0x38ea79-0x0;var _0x42ddbf=_0x1cb9[_0x38ea79];return _0x42ddbf;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index f556788..a70e1de 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 _0xcd7f=['put','/:id','isAuthenticated','update','destroy','exports','path','connect-timeout','../../components/auth/service','../../config/environment'];(function(_0x50a330,_0x2e003c){var _0x475636=function(_0x1ce9ab){while(--_0x1ce9ab){_0x50a330['push'](_0x50a330['shift']());}};_0x475636(++_0x2e003c);}(_0xcd7f,0x11e));var _0xfcd7=function(_0x4ea0e5,_0x2410c0){_0x4ea0e5=_0x4ea0e5-0x0;var _0x20e920=_0xcd7f[_0x4ea0e5];return _0x20e920;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfcd7('0x0'));var timeout=require(_0xfcd7('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfcd7('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xfcd7('0x3'));var controller=require('./action.controller');router[_0xfcd7('0x4')](_0xfcd7('0x5'),auth[_0xfcd7('0x6')](),controller[_0xfcd7('0x7')]);router['delete'](_0xfcd7('0x5'),auth['isAuthenticated'](),controller[_0xfcd7('0x8')]);module[_0xfcd7('0x9')]=router; \ No newline at end of file +var _0xa920=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x1df961,_0x3e63a4){var _0x2038d5=function(_0x228dd4){while(--_0x228dd4){_0x1df961['push'](_0x1df961['shift']());}};_0x2038d5(++_0x3e63a4);}(_0xa920,0x19f));var _0x0a92=function(_0x2f6563,_0x313edb){_0x2f6563=_0x2f6563-0x0;var _0x3d3749=_0xa920[_0x2f6563];return _0x3d3749;};'use strict';var multer=require(_0x0a92('0x0'));var util=require(_0x0a92('0x1'));var path=require(_0x0a92('0x2'));var timeout=require(_0x0a92('0x3'));var express=require(_0x0a92('0x4'));var router=express[_0x0a92('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0a92('0x6'));var config=require(_0x0a92('0x7'));var controller=require(_0x0a92('0x8'));router[_0x0a92('0x9')](_0x0a92('0xa'),auth[_0x0a92('0xb')](),controller[_0x0a92('0xc')]);router[_0x0a92('0xd')](_0x0a92('0xa'),auth['isAuthenticated'](),controller[_0x0a92('0xe')]);module[_0x0a92('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index fd8dd6b..8dfe89a 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 _0x7c09=['exports','STRING','TEXT'];(function(_0x4f5740,_0x4f1c62){var _0x309591=function(_0x180093){while(--_0x180093){_0x4f5740['push'](_0x4f5740['shift']());}};_0x309591(++_0x4f1c62);}(_0x7c09,0x102));var _0x97c0=function(_0xfbb5fa,_0x261915){_0xfbb5fa=_0xfbb5fa-0x0;var _0x487ae1=_0x7c09[_0xfbb5fa];return _0x487ae1;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file +var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x545d36,_0x45c4b1){var _0x53b683=function(_0x211f84){while(--_0x211f84){_0x545d36['push'](_0x545d36['shift']());}};_0x53b683(++_0x45c4b1);}(_0xac9d,0x14d));var _0xdac9=function(_0x3727ae,_0x165f88){_0x3727ae=_0x3727ae-0x0;var _0x1c3f01=_0xac9d[_0x3727ae];return _0x1c3f01;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 28d2644..696f453 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 _0x40ed=['web','fullPath','%s-%s.%s','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','Limited\x20Query:','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','sendStatus','stack','name','index','map','AnalyticCustomReport','fieldName','type','key','query','model','intersection','fields','length','attributes','hasOwnProperty','sort','where','filters','filter','merge','options','includeAll','include','catch','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','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)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','order','orderBy','DESC','alias','joins','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join','SUM(%s)','AVG(%s)','operator','groupBy','output'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x40ed,0xb3));var _0xd40e=function(_0x541543,_0x52fbe8){_0x541543=_0x541543-0x0;var _0x2b29ec=_0x40ed[_0x541543];return _0x2b29ec;};'use strict';var emlformat=require(_0xd40e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd40e('0x1'));var rp=require('request-promise');var moment=require(_0xd40e('0x2'));var BPromise=require(_0xd40e('0x3'));var Mustache=require(_0xd40e('0x4'));var util=require(_0xd40e('0x5'));var path=require(_0xd40e('0x6'));var sox=require(_0xd40e('0x7'));var csv=require(_0xd40e('0x8'));var ejs=require(_0xd40e('0x9'));var fs=require('fs');var fs_extra=require(_0xd40e('0xa'));var _=require(_0xd40e('0xb'));var squel=require(_0xd40e('0xc'));var crypto=require(_0xd40e('0xd'));var jsforce=require(_0xd40e('0xe'));var deskjs=require(_0xd40e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd40e('0x10'));var Redis=require(_0xd40e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd40e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd40e('0x13'));var logger=require(_0xd40e('0x14'))('api');var utils=require(_0xd40e('0x15'));var config=require(_0xd40e('0x16'));var licenseUtil=require(_0xd40e('0x17'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x440d63,_0x19c041){_0x19c041=_0x19c041||0xcc;return function(_0x49fb4f){if(_0x49fb4f){return _0x440d63['sendStatus'](_0x19c041);}return _0x440d63[_0xd40e('0x18')](_0x19c041)['end']();};}function respondWithResult(_0x4eee6e,_0x2da6e6){_0x2da6e6=_0x2da6e6||0xc8;return function(_0x5bcbe0){if(_0x5bcbe0){return _0x4eee6e[_0xd40e('0x18')](_0x2da6e6)[_0xd40e('0x19')](_0x5bcbe0);}};}function respondWithFilteredResult(_0x4c1913,_0x4cf2c6){return function(_0xf86301){if(_0xf86301){var _0x2b9abb=typeof _0x4cf2c6[_0xd40e('0x1a')]==='undefined'&&typeof _0x4cf2c6[_0xd40e('0x1b')]===_0xd40e('0x1c');var _0xd7e26f=_0xf86301[_0xd40e('0x1d')];var _0x496134=_0x2b9abb?0x0:_0x4cf2c6[_0xd40e('0x1a')];var _0x2cf4ab=_0x2b9abb?_0xf86301['count']:_0x4cf2c6[_0xd40e('0x1a')]+_0x4cf2c6[_0xd40e('0x1b')];var _0xcfe8c4;if(_0x2cf4ab>=_0xd7e26f){_0x2cf4ab=_0xd7e26f;_0xcfe8c4=0xc8;}else{_0xcfe8c4=0xce;}_0x4c1913[_0xd40e('0x18')](_0xcfe8c4);return _0x4c1913[_0xd40e('0x1e')](_0xd40e('0x1f'),_0x496134+'-'+_0x2cf4ab+'/'+_0xd7e26f)[_0xd40e('0x19')](_0xf86301);}return null;};}function patchUpdates(_0x2cc0d7){return function(_0x146faa){try{jsonpatch[_0xd40e('0x20')](_0x146faa,_0x2cc0d7,!![]);}catch(_0x19246a){return BPromise[_0xd40e('0x21')](_0x19246a);}return _0x146faa[_0xd40e('0x22')]();};}function saveUpdates(_0x17ab2f,_0xb0b760){return function(_0x3e7b8a){if(_0x3e7b8a){return _0x3e7b8a['update'](_0x17ab2f)[_0xd40e('0x23')](function(_0x26b5b3){return _0x26b5b3;});}return null;};}function removeEntity(_0x452973,_0x1ede0a){return function(_0x4a12e3){if(_0x4a12e3){return _0x4a12e3[_0xd40e('0x24')]()[_0xd40e('0x23')](function(){var _0x39894c=_0x4a12e3[_0xd40e('0x25')]({'plain':!![]});var _0xf10281=_0xd40e('0x26');return db[_0xd40e('0x27')][_0xd40e('0x24')]({'where':{'type':_0xf10281,'resourceId':_0x39894c['id']}})[_0xd40e('0x23')](function(){return _0x4a12e3;});})[_0xd40e('0x23')](function(){_0x452973[_0xd40e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a332d,_0x11f68b){return function(_0xb1d601){if(!_0xb1d601){_0x3a332d[_0xd40e('0x28')](0x194);}return _0xb1d601;};}function handleError(_0x20ccd4,_0x7f34b9){_0x7f34b9=_0x7f34b9||0x1f4;return function(_0x37c3dc){logger['error'](_0x37c3dc[_0xd40e('0x29')]);if(_0x37c3dc['name']){delete _0x37c3dc[_0xd40e('0x2a')];}_0x20ccd4['status'](_0x7f34b9)['send'](_0x37c3dc);};}exports[_0xd40e('0x2b')]=function(_0x42f525,_0x4d9870){var _0x301d61={},_0x594963={},_0x9287de={'count':0x0,'rows':[]};var _0x314805=_[_0xd40e('0x2c')](db[_0xd40e('0x2d')]['rawAttributes'],function(_0x4b8fba){return{'name':_0x4b8fba[_0xd40e('0x2e')],'type':_0x4b8fba[_0xd40e('0x2f')][_0xd40e('0x30')]};});_0x594963['model']=_[_0xd40e('0x2c')](_0x314805,'name');_0x594963[_0xd40e('0x31')]=_['keys'](_0x42f525[_0xd40e('0x31')]);_0x594963['filters']=_['intersection'](_0x594963[_0xd40e('0x32')],_0x594963[_0xd40e('0x31')]);_0x301d61['attributes']=_[_0xd40e('0x33')](_0x594963[_0xd40e('0x32')],qs[_0xd40e('0x34')](_0x42f525[_0xd40e('0x31')][_0xd40e('0x34')]));_0x301d61['attributes']=_0x301d61['attributes'][_0xd40e('0x35')]?_0x301d61[_0xd40e('0x36')]:_0x594963[_0xd40e('0x32')];if(!_0x42f525[_0xd40e('0x31')][_0xd40e('0x37')]('nolimit')){_0x301d61['limit']=qs['limit'](_0x42f525[_0xd40e('0x31')][_0xd40e('0x1b')]);_0x301d61[_0xd40e('0x1a')]=qs['offset'](_0x42f525[_0xd40e('0x31')]['offset']);}_0x301d61['order']=qs[_0xd40e('0x38')](_0x42f525['query']['sort']);_0x301d61[_0xd40e('0x39')]=qs[_0xd40e('0x3a')](_['pick'](_0x42f525[_0xd40e('0x31')],_0x594963[_0xd40e('0x3a')]),_0x314805);if(_0x42f525['query'][_0xd40e('0x3b')]){_0x301d61['where']=_[_0xd40e('0x3c')](_0x301d61['where'],{'$or':_[_0xd40e('0x2c')](_0x314805,function(_0x2121c8){if(_0x2121c8[_0xd40e('0x2f')]!=='VIRTUAL'){var _0x50c344={};_0x50c344[_0x2121c8[_0xd40e('0x2a')]]={'$like':'%'+_0x42f525[_0xd40e('0x31')]['filter']+'%'};return _0x50c344;}})});}_0x301d61=_[_0xd40e('0x3c')]({},_0x301d61,_0x42f525[_0xd40e('0x3d')]);var _0x6946fd={'where':_0x301d61['where']};return db[_0xd40e('0x2d')][_0xd40e('0x1d')](_0x6946fd)[_0xd40e('0x23')](function(_0x102ecc){_0x9287de[_0xd40e('0x1d')]=_0x102ecc;if(_0x42f525['query'][_0xd40e('0x3e')]){_0x301d61[_0xd40e('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x301d61);})['then'](function(_0x573e0a){_0x9287de['rows']=_0x573e0a;return _0x9287de;})['then'](respondWithFilteredResult(_0x4d9870,_0x301d61))[_0xd40e('0x40')](handleError(_0x4d9870,null));};exports['show']=function(_0x156725,_0x41c472){var _0x376a93={'raw':![],'where':{'id':_0x156725[_0xd40e('0x41')]['id']}},_0x4d5323={};_0x4d5323[_0xd40e('0x32')]=_['keys'](db[_0xd40e('0x2d')]['rawAttributes']);_0x4d5323[_0xd40e('0x31')]=_[_0xd40e('0x42')](_0x156725[_0xd40e('0x31')]);_0x4d5323[_0xd40e('0x3a')]=_[_0xd40e('0x33')](_0x4d5323['model'],_0x4d5323['query']);_0x376a93['attributes']=_['intersection'](_0x4d5323[_0xd40e('0x32')],qs[_0xd40e('0x34')](_0x156725['query'][_0xd40e('0x34')]));_0x376a93['attributes']=_0x376a93[_0xd40e('0x36')][_0xd40e('0x35')]?_0x376a93[_0xd40e('0x36')]:_0x4d5323['model'];if(_0x156725[_0xd40e('0x31')][_0xd40e('0x3e')]){_0x376a93['include']=[{'all':!![]}];}_0x376a93=_['merge']({},_0x376a93,_0x156725[_0xd40e('0x3d')]);return db[_0xd40e('0x2d')]['find'](_0x376a93)['then'](handleEntityNotFound(_0x41c472,null))['then'](respondWithResult(_0x41c472,null))[_0xd40e('0x40')](handleError(_0x41c472,null));};exports[_0xd40e('0x43')]=function(_0x3c1512,_0x25090d){return db['AnalyticCustomReport'][_0xd40e('0x43')](_0x3c1512[_0xd40e('0x44')],{})[_0xd40e('0x23')](function(_0x130e5c){var _0x55c577=_0x3c1512['user'][_0xd40e('0x25')]({'plain':!![]});if(!_0x55c577)throw new Error(_0xd40e('0x45'));if(_0x55c577[_0xd40e('0x46')]===_0xd40e('0x47')){var _0x1bec51=_0x130e5c[_0xd40e('0x25')]({'plain':!![]});var _0x1599b4=_0xd40e('0x48');return db[_0xd40e('0x49')][_0xd40e('0x4a')]({'where':{'name':_0x1599b4,'userProfileId':_0x55c577['userProfileId']},'raw':!![]})['then'](function(_0x5a2e5b){if(_0x5a2e5b&&_0x5a2e5b[_0xd40e('0x4b')]===0x0){return db[_0xd40e('0x27')][_0xd40e('0x43')]({'name':_0x1bec51[_0xd40e('0x2a')],'resourceId':_0x1bec51['id'],'type':_0xd40e('0x26'),'sectionId':_0x5a2e5b['id']},{})['then'](function(){return _0x130e5c;});}else{return _0x130e5c;}})['catch'](function(_0x6e4f7e){logger[_0xd40e('0x4c')](_0xd40e('0x4d'),_0x6e4f7e);throw _0x6e4f7e;});}return _0x130e5c;})['then'](respondWithResult(_0x25090d,0xc9))['catch'](handleError(_0x25090d,null));};exports['update']=function(_0x2bbb9c,_0x311ff9){if(_0x2bbb9c['body']['id']){delete _0x2bbb9c[_0xd40e('0x44')]['id'];}return db[_0xd40e('0x2d')][_0xd40e('0x4a')]({'where':{'id':_0x2bbb9c[_0xd40e('0x41')]['id']}})[_0xd40e('0x23')](handleEntityNotFound(_0x311ff9,null))['then'](saveUpdates(_0x2bbb9c[_0xd40e('0x44')],null))[_0xd40e('0x23')](respondWithResult(_0x311ff9,null))['catch'](handleError(_0x311ff9,null));};exports[_0xd40e('0x24')]=function(_0x4c4b8c,_0x4736b0){return db['AnalyticCustomReport'][_0xd40e('0x4a')]({'where':{'id':_0x4c4b8c[_0xd40e('0x41')]['id']}})[_0xd40e('0x23')](handleEntityNotFound(_0x4736b0,null))[_0xd40e('0x23')](removeEntity(_0x4736b0,null))['catch'](handleError(_0x4736b0,null));};exports[_0xd40e('0x4e')]=function(_0x562cad,_0x919256){var _0x32ed24=0xa;var _0x525f3e=[_0xd40e('0x4f'),_0xd40e('0x50'),'right_join',_0xd40e('0x51')];var _0x5f1c99={'SUM':'SUM(%s)','COUNT':_0xd40e('0x52'),'COUNT DISTINCT':_0xd40e('0x53'),'MAX':_0xd40e('0x54'),'MIN':_0xd40e('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd40e('0x56'),'GROUP_CONCAT ASC':_0xd40e('0x57'),'GROUP_CONCAT DESC':_0xd40e('0x58')};var _0x2ee27f={'SEC_TO_TIME':_0xd40e('0x59'),'DATE':_0xd40e('0x5a'),'HOUR':_0xd40e('0x5b'),'ROUND':_0xd40e('0x5c'),'UNIX_TIMESTAMP':_0xd40e('0x5d')};var _0x39ff5c=function(_0x2658b2){return!_[_0xd40e('0x5e')]([_0xd40e('0x5f'),_0xd40e('0x60'),_0xd40e('0x61'),_0xd40e('0x62')],_0x2658b2);};var _0x2a4051=function(_0x39271d){if(!_0x39271d||!_0x39271d[_0xd40e('0x63')]['length']){return'';}for(var _0x31099a='(',_0x3e3e9b=0x0;_0x3e3e9b<_0x39271d['rules'][_0xd40e('0x35')];_0x3e3e9b+=0x1){_0x3e3e9b>0x0&&(_0x31099a+='\x20'+_0x39271d['operator']+'\x20');_0x31099a+=_0x39271d[_0xd40e('0x63')][_0x3e3e9b][_0xd40e('0x64')]?_0x2a4051(_0x39271d[_0xd40e('0x63')][_0x3e3e9b]['group']):_0x39271d['rules'][_0x3e3e9b][_0xd40e('0x65')]+'\x20'+_0x39271d[_0xd40e('0x63')][_0x3e3e9b]['condition']+(_0x39ff5c(_0x39271d[_0xd40e('0x63')][_0x3e3e9b][_0xd40e('0x66')])?'\x20'+_0x39271d[_0xd40e('0x63')][_0x3e3e9b][_0xd40e('0x67')]:'');}return _0x31099a+')';};var _0x2baa31={'where':{'id':_0x562cad['params']['id']}},_0x54d9a0,_0xd62340,_0x181a4a,_0x24ccc6,_0x2196e8;_0x2baa31=_['merge']({},_0x2baa31,_0x562cad[_0xd40e('0x3d')]);return db[_0xd40e('0x2d')]['find'](_0x2baa31)[_0xd40e('0x23')](function(_0x3e598b){if(_0x3e598b){_0x54d9a0=_0x3e598b;return _0x3e598b[_0xd40e('0x68')]();}return null;})[_0xd40e('0x23')](function(_0x14f709){if(_0x14f709){if(!_0x14f709[_0xd40e('0x35')]){throw new db[(_0xd40e('0x69'))][(_0xd40e('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xd62340=_0x14f709;return db[_0xd40e('0x6b')][_0xd40e('0x6c')]({'raw':!![]});}return null;})[_0xd40e('0x23')](function(_0x138bc9){if(_0x138bc9){_0x181a4a=_[_0xd40e('0x6d')](_0x138bc9,'id');var _0x500427;var _0x3453e9=squel[_0xd40e('0x6e')]();_0x3453e9[_0xd40e('0x6f')](_0x54d9a0[_0xd40e('0x70')]);for(var _0x46f980=0x0;_0x46f980<_0xd62340[_0xd40e('0x35')];_0x46f980+=0x1){_0x500427=_0xd62340[_0x46f980]['MetricId']?_0x181a4a[_0xd62340[_0x46f980][_0xd40e('0x71')]][_0xd40e('0x72')]:_0xd62340[_0x46f980][_0xd40e('0x65')];_0x500427=_0xd62340[_0x46f980][_0xd40e('0x73')]?_[_0xd40e('0x74')](_0x5f1c99[_0xd62340[_0x46f980][_0xd40e('0x73')]],'%s',_0x500427):_0x500427;_0x500427=_0xd62340[_0x46f980][_0xd40e('0x75')]?_['replace'](_0x2ee27f[_0xd62340[_0x46f980][_0xd40e('0x75')]],'%s',_0x500427):_0x500427;if(_0xd62340[_0x46f980]['groupBy']){_0x3453e9[_0xd40e('0x64')](_0x500427);}_0xd62340[_0x46f980]['orderBy']&&_0x3453e9[_0xd40e('0x76')](_0x500427,_0xd62340[_0x46f980][_0xd40e('0x77')]===_0xd40e('0x78')?![]:!![]);_0x3453e9[_0xd40e('0x65')](_0x500427,_0xd62340[_0x46f980][_0xd40e('0x79')]||_0x500427);}if(_0x54d9a0[_0xd40e('0x7a')]){_0x54d9a0[_0xd40e('0x7a')]=JSON['parse'](_0x54d9a0[_0xd40e('0x7a')]);for(var _0x58b0cb=0x0;_0x58b0cb<_0x54d9a0['joins'][_0xd40e('0x35')];_0x58b0cb+=0x1){if(_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb][_0xd40e('0x2f')]&&_[_0xd40e('0x5e')](_0x525f3e,_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb]['type'])&&_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb]['parentKey']&&_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb]['foreignTable']&&_0x54d9a0['joins'][_0x58b0cb][_0xd40e('0x7b')]){_0x3453e9[_0x54d9a0['joins'][_0x58b0cb]['type']](_0x54d9a0['joins'][_0x58b0cb][_0xd40e('0x7c')],null,util['format'](_0xd40e('0x7d'),_0x54d9a0[_0xd40e('0x70')],_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb][_0xd40e('0x7e')],_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb]['foreignTable'],_0x54d9a0[_0xd40e('0x7a')][_0x58b0cb][_0xd40e('0x7b')]));}}}if(_0x54d9a0[_0xd40e('0x7f')]){_0x54d9a0[_0xd40e('0x7f')]=JSON[_0xd40e('0x80')](_0x54d9a0[_0xd40e('0x7f')]);_0x3453e9[_0xd40e('0x39')](_0x2a4051(_0x54d9a0[_0xd40e('0x7f')][_0xd40e('0x64')]));}_0x2196e8=_0x3453e9[_0xd40e('0x81')]();_0x3453e9[_0xd40e('0x1b')](_0x32ed24);_0x3453e9[_0xd40e('0x1a')](0x0);logger[_0xd40e('0x82')]('Limited\x20Query:',_0x3453e9[_0xd40e('0x83')]());return dbH['sequelize'][_0xd40e('0x31')](_0x3453e9[_0xd40e('0x83')](),{'type':dbH[_0xd40e('0x84')][_0xd40e('0x85')][_0xd40e('0x86')]});}})['then'](respondWithResult(_0x919256,null))[_0xd40e('0x40')](handleError(_0x919256,null));};function runReport(_0x2c08c9,_0x47b67f,_0x56e920){var _0x421d65=_0x47b67f[_0xd40e('0x2a')];var _0x58c7d3=0xa;var _0x461da7=[_0xd40e('0x4f'),_0xd40e('0x50'),_0xd40e('0x87'),_0xd40e('0x51')];var _0x5929a4={'SUM':_0xd40e('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd40e('0x53'),'MAX':_0xd40e('0x54'),'MIN':'MIN(%s)','AVG':_0xd40e('0x89'),'GROUP_CONCAT':_0xd40e('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd40e('0x58')};var _0x1f471d={'SEC_TO_TIME':_0xd40e('0x59'),'DATE':_0xd40e('0x5a'),'HOUR':_0xd40e('0x5b'),'ROUND':_0xd40e('0x5c'),'UNIX_TIMESTAMP':_0xd40e('0x5d')};var _0x469e4d=function(_0x4b4601){return!_[_0xd40e('0x5e')]([_0xd40e('0x5f'),_0xd40e('0x60'),_0xd40e('0x61'),'IS\x20NOT\x20EMPTY'],_0x4b4601);};var _0x297b77=function(_0x4f905d){if(!_0x4f905d||!_0x4f905d['rules']['length']){return'';}for(var _0x1751ac='(',_0x245a3c=0x0;_0x245a3c<_0x4f905d[_0xd40e('0x63')]['length'];_0x245a3c+=0x1){_0x245a3c>0x0&&(_0x1751ac+='\x20'+_0x4f905d[_0xd40e('0x8a')]+'\x20');_0x1751ac+=_0x4f905d[_0xd40e('0x63')][_0x245a3c]['group']?_0x297b77(_0x4f905d[_0xd40e('0x63')][_0x245a3c]['group']):_0x4f905d['rules'][_0x245a3c][_0xd40e('0x65')]+'\x20'+_0x4f905d['rules'][_0x245a3c][_0xd40e('0x66')]+(_0x469e4d(_0x4f905d['rules'][_0x245a3c][_0xd40e('0x66')])?'\x20'+_0x4f905d[_0xd40e('0x63')][_0x245a3c][_0xd40e('0x67')]:'');}return _0x1751ac+')';};var _0xc5de86={'where':{'id':_0x2c08c9['id']}},_0x48e2af,_0x85fdd4,_0x2874df,_0x1b1260,_0x17090d;_0xc5de86=_['merge']({},_0xc5de86,_0x56e920);return db[_0xd40e('0x2d')][_0xd40e('0x4a')](_0xc5de86)[_0xd40e('0x23')](function(_0x534008){if(_0x534008){_0x48e2af=_0x534008;return _0x534008[_0xd40e('0x68')]();}return null;})[_0xd40e('0x23')](function(_0x4eebf2){if(_0x4eebf2){if(!_0x4eebf2['length']){throw new db[(_0xd40e('0x69'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x85fdd4=_0x4eebf2;return db[_0xd40e('0x6b')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xf2d938){if(_0xf2d938){_0x2874df=_[_0xd40e('0x6d')](_0xf2d938,'id');var _0x5017e5;var _0x6f0a=squel['select']();_0x6f0a[_0xd40e('0x6f')](_0x48e2af[_0xd40e('0x70')]);for(var _0x592e79=0x0;_0x592e79<_0x85fdd4[_0xd40e('0x35')];_0x592e79+=0x1){_0x5017e5=_0x85fdd4[_0x592e79]['MetricId']?_0x2874df[_0x85fdd4[_0x592e79][_0xd40e('0x71')]][_0xd40e('0x72')]:_0x85fdd4[_0x592e79][_0xd40e('0x65')];_0x5017e5=_0x85fdd4[_0x592e79][_0xd40e('0x73')]?_[_0xd40e('0x74')](_0x5929a4[_0x85fdd4[_0x592e79][_0xd40e('0x73')]],'%s',_0x5017e5):_0x5017e5;_0x5017e5=_0x85fdd4[_0x592e79][_0xd40e('0x75')]?_[_0xd40e('0x74')](_0x1f471d[_0x85fdd4[_0x592e79][_0xd40e('0x75')]],'%s',_0x5017e5):_0x5017e5;if(_0x85fdd4[_0x592e79][_0xd40e('0x8b')]){_0x6f0a[_0xd40e('0x64')](_0x5017e5);}_0x85fdd4[_0x592e79][_0xd40e('0x77')]&&_0x6f0a[_0xd40e('0x76')](_0x5017e5,_0x85fdd4[_0x592e79][_0xd40e('0x77')]==='DESC'?![]:!![]);_0x6f0a[_0xd40e('0x65')](_0x5017e5,_0x85fdd4[_0x592e79][_0xd40e('0x79')]||_0x5017e5);}if(_0x48e2af[_0xd40e('0x7a')]){_0x48e2af['joins']=JSON[_0xd40e('0x80')](_0x48e2af[_0xd40e('0x7a')]);for(var _0x35fa6e=0x0;_0x35fa6e<_0x48e2af['joins'][_0xd40e('0x35')];_0x35fa6e+=0x1){if(_0x48e2af['joins'][_0x35fa6e]['type']&&_[_0xd40e('0x5e')](_0x461da7,_0x48e2af['joins'][_0x35fa6e][_0xd40e('0x2f')])&&_0x48e2af['joins'][_0x35fa6e]['parentKey']&&_0x48e2af['joins'][_0x35fa6e][_0xd40e('0x7c')]&&_0x48e2af[_0xd40e('0x7a')][_0x35fa6e][_0xd40e('0x7b')]){_0x6f0a[_0x48e2af['joins'][_0x35fa6e][_0xd40e('0x2f')]](_0x48e2af[_0xd40e('0x7a')][_0x35fa6e][_0xd40e('0x7c')],null,util['format'](_0xd40e('0x7d'),_0x48e2af[_0xd40e('0x70')],_0x48e2af[_0xd40e('0x7a')][_0x35fa6e][_0xd40e('0x7e')],_0x48e2af[_0xd40e('0x7a')][_0x35fa6e][_0xd40e('0x7c')],_0x48e2af['joins'][_0x35fa6e][_0xd40e('0x7b')]));}}}if(_0x48e2af[_0xd40e('0x7f')]){_0x48e2af['conditions']=JSON[_0xd40e('0x80')](_0x48e2af[_0xd40e('0x7f')]);_0x6f0a['where'](_0x297b77(_0x48e2af[_0xd40e('0x7f')]['group']));}_0x17090d=_0x6f0a[_0xd40e('0x81')]();_0x6f0a[_0xd40e('0x1b')](_0x58c7d3);_0x6f0a[_0xd40e('0x1a')](0x0);return;}})[_0xd40e('0x23')](function(){if(_0x47b67f[_0xd40e('0x8c')]===_0xd40e('0x8d')){return null;}var _0x4ac2af=_[_0xd40e('0x3c')](_0x47b67f,{'name':_0x47b67f[_0xd40e('0x8e')]||_0x47b67f[_0xd40e('0x2a')]||_0x48e2af[_0xd40e('0x2a')],'basename':_0x421d65,'savename':util[_0xd40e('0x75')](_0xd40e('0x8f'),_0x47b67f[_0xd40e('0x2a')]||_0x48e2af[_0xd40e('0x2a')],require('randomstring')['generate'](0x4),_0x47b67f[_0xd40e('0x8c')]||'csv'),'reportId':_0x48e2af['id'],'reportType':_0xd40e('0x90')});return db[_0xd40e('0x91')][_0xd40e('0x43')](_0x4ac2af,{'raw':!![]});})['then'](function(_0x2ec181){if(_0x48e2af[_0xd40e('0x70')]===_0xd40e('0x92')){_0x17090d[_0xd40e('0x39')](_0x48e2af[_0xd40e('0x70')]+_0xd40e('0x93'),_0x47b67f['startDate'],_0x47b67f['endDate']);}else{_0x17090d['where'](_0x48e2af[_0xd40e('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x47b67f[_0xd40e('0x94')],_0x47b67f[_0xd40e('0x95')]);}if(_0x2ec181){logger['info'](_0xd40e('0x96'),_0x17090d[_0xd40e('0x83')]());require('child_process')[_0xd40e('0x97')](path[_0xd40e('0x4f')](__dirname,_0xd40e('0x98'),_0x2ec181[_0xd40e('0x8c')]),[_0x2ec181['id'],_0x17090d[_0xd40e('0x83')](),path[_0xd40e('0x4f')](__dirname,_0xd40e('0x99'),_0x2ec181[_0xd40e('0x9a')]),_0x421d65]);return _0x2ec181;}else{var _0x204ca9=squel[_0xd40e('0x6e')]();_0x204ca9[_0xd40e('0x6f')]('('+_0x17090d[_0xd40e('0x83')]()+')',_0xd40e('0x9b'));_0x204ca9[_0xd40e('0x65')](_0xd40e('0x9c'),_0xd40e('0x1d'));_0x17090d[_0xd40e('0x1b')](_0x47b67f[_0xd40e('0x1b')]||_0x58c7d3);_0x17090d[_0xd40e('0x1a')](_0x47b67f[_0xd40e('0x1a')]||0x0);return dbH[_0xd40e('0x84')][_0xd40e('0x31')](_0x204ca9[_0xd40e('0x83')](),{'type':dbH['sequelize'][_0xd40e('0x85')][_0xd40e('0x86')]})[_0xd40e('0x23')](function(_0x33d4cd){if(!_0x33d4cd[_0xd40e('0x35')]){_0x1b1260=0x0;}else{_0x1b1260=_0x33d4cd[0x0][_0xd40e('0x1d')]||0x0;}return dbH[_0xd40e('0x84')][_0xd40e('0x31')](_0x17090d[_0xd40e('0x83')](),{'type':dbH[_0xd40e('0x84')][_0xd40e('0x85')][_0xd40e('0x86')]});})[_0xd40e('0x23')](function(_0x4e9c7c){return{'rows':_0x4e9c7c||[],'count':_0x1b1260};});}});}exports[_0xd40e('0x9d')]=function(_0x1a0d2a,_0x3ec158){return runReport(_0x1a0d2a[_0xd40e('0x41')],_0x1a0d2a[_0xd40e('0x31')],_0x1a0d2a[_0xd40e('0x3d')])[_0xd40e('0x23')](respondWithResult(_0x3ec158,null))[_0xd40e('0x40')](handleError(_0x3ec158,null));};exports[_0xd40e('0x9e')]=runReport;exports[_0xd40e('0x31')]=function(_0x3b96ac,_0x554b6d){var _0x201380=0xa;var _0x57633b=[_0xd40e('0x4f'),_0xd40e('0x50'),_0xd40e('0x87'),_0xd40e('0x51')];var _0x5d2dce={'SUM':_0xd40e('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd40e('0x53'),'MAX':_0xd40e('0x54'),'MIN':'MIN(%s)','AVG':_0xd40e('0x89'),'GROUP_CONCAT':_0xd40e('0x56'),'GROUP_CONCAT ASC':_0xd40e('0x57'),'GROUP_CONCAT DESC':_0xd40e('0x58')};var _0x447416={'SEC_TO_TIME':_0xd40e('0x59'),'DATE':'DATE(%s)','HOUR':_0xd40e('0x5b'),'ROUND':_0xd40e('0x5c'),'UNIX_TIMESTAMP':_0xd40e('0x5d')};var _0x46bce5=function(_0x558f5c){return!_[_0xd40e('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xd40e('0x61'),'IS\x20NOT\x20EMPTY'],_0x558f5c);};var _0x14a9f3=function(_0xc10aad){if(!_0xc10aad||!_0xc10aad[_0xd40e('0x63')][_0xd40e('0x35')]){return'';}for(var _0x3fb24c='(',_0x26d6fa=0x0;_0x26d6fa<_0xc10aad[_0xd40e('0x63')]['length'];_0x26d6fa+=0x1){_0x26d6fa>0x0&&(_0x3fb24c+='\x20'+_0xc10aad[_0xd40e('0x8a')]+'\x20');_0x3fb24c+=_0xc10aad['rules'][_0x26d6fa][_0xd40e('0x64')]?_0x14a9f3(_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x64')]):_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x65')]+'\x20'+_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x66')]+(_0x46bce5(_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x66')])?'\x20'+_0xc10aad[_0xd40e('0x63')][_0x26d6fa][_0xd40e('0x67')]:'');}return _0x3fb24c+')';};var _0x84385a={'where':{'id':_0x3b96ac[_0xd40e('0x41')]['id']}},_0x3e38bf,_0x3f0d46,_0x236b78,_0x12f3b5,_0x3e8577;_0x84385a=_[_0xd40e('0x3c')]({},_0x84385a,_0x3b96ac[_0xd40e('0x3d')]);return db[_0xd40e('0x2d')][_0xd40e('0x4a')](_0x84385a)[_0xd40e('0x23')](function(_0x26ae2a){if(_0x26ae2a){_0x3e38bf=_0x26ae2a;return _0x26ae2a[_0xd40e('0x68')]();}return null;})['then'](function(_0x5abd99){if(_0x5abd99){if(!_0x5abd99[_0xd40e('0x35')]){throw new db['Sequelize'][(_0xd40e('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3f0d46=_0x5abd99;return db[_0xd40e('0x6b')][_0xd40e('0x6c')]({'raw':!![]});}return null;})['then'](function(_0x484e2b){if(_0x484e2b){_0x236b78=_['keyBy'](_0x484e2b,'id');var _0x13f5db;var _0x652338=squel[_0xd40e('0x6e')]();_0x652338[_0xd40e('0x6f')](_0x3e38bf['table']);for(var _0x581728=0x0;_0x581728<_0x3f0d46[_0xd40e('0x35')];_0x581728+=0x1){_0x13f5db=_0x3f0d46[_0x581728][_0xd40e('0x71')]?_0x236b78[_0x3f0d46[_0x581728]['MetricId']]['metric']:_0x3f0d46[_0x581728][_0xd40e('0x65')];_0x13f5db=_0x3f0d46[_0x581728][_0xd40e('0x73')]?_[_0xd40e('0x74')](_0x5d2dce[_0x3f0d46[_0x581728][_0xd40e('0x73')]],'%s',_0x13f5db):_0x13f5db;_0x13f5db=_0x3f0d46[_0x581728][_0xd40e('0x75')]?_['replace'](_0x447416[_0x3f0d46[_0x581728][_0xd40e('0x75')]],'%s',_0x13f5db):_0x13f5db;if(_0x3f0d46[_0x581728][_0xd40e('0x8b')]){_0x652338['group'](_0x13f5db);}_0x3f0d46[_0x581728][_0xd40e('0x77')]&&_0x652338[_0xd40e('0x76')](_0x13f5db,_0x3f0d46[_0x581728][_0xd40e('0x77')]===_0xd40e('0x78')?![]:!![]);_0x652338[_0xd40e('0x65')](_0x13f5db,_0x3f0d46[_0x581728]['alias']||_0x13f5db);}if(_0x3e38bf[_0xd40e('0x7a')]){_0x3e38bf[_0xd40e('0x7a')]=JSON[_0xd40e('0x80')](_0x3e38bf[_0xd40e('0x7a')]);for(var _0x54e91a=0x0;_0x54e91a<_0x3e38bf['joins'][_0xd40e('0x35')];_0x54e91a+=0x1){if(_0x3e38bf['joins'][_0x54e91a]['type']&&_[_0xd40e('0x5e')](_0x57633b,_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x2f')])&&_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7e')]&&_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7c')]&&_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7b')]){_0x652338[_0x3e38bf['joins'][_0x54e91a]['type']](_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7c')],null,util[_0xd40e('0x75')]('%s.%s\x20=\x20%s.%s',_0x3e38bf[_0xd40e('0x70')],_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7e')],_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7c')],_0x3e38bf[_0xd40e('0x7a')][_0x54e91a][_0xd40e('0x7b')]));}}}if(_0x3e38bf['conditions']){_0x3e38bf[_0xd40e('0x7f')]=JSON[_0xd40e('0x80')](_0x3e38bf['conditions']);_0x652338[_0xd40e('0x39')](_0x14a9f3(_0x3e38bf[_0xd40e('0x7f')][_0xd40e('0x64')]));}_0x3e8577=_0x652338[_0xd40e('0x81')]();_0x652338[_0xd40e('0x1b')](_0x201380);_0x652338['offset'](0x0);logger[_0xd40e('0x82')](_0xd40e('0x9f'),_0x652338[_0xd40e('0x83')]());return dbH[_0xd40e('0x84')][_0xd40e('0x31')](_0x652338[_0xd40e('0x83')](),{'type':dbH[_0xd40e('0x84')][_0xd40e('0x85')][_0xd40e('0x86')]});}})[_0xd40e('0x23')](function(){return{'sql':_0x3e8577[_0xd40e('0x83')]()};})[_0xd40e('0x23')](respondWithResult(_0x554b6d,null))['catch'](handleError(_0x554b6d,null));}; \ No newline at end of file +var _0x0c78=['../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','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\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','keyBy','select','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignKey','foreignTable','table','conditions','clone','debug','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','ROUND(%s)','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','order','%s.%s\x20=\x20%s.%s','output','web','fullPath','generate','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','metric','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x25b430,_0x342119){var _0x32d9e3=function(_0x5960bd){while(--_0x5960bd){_0x25b430['push'](_0x25b430['shift']());}};_0x32d9e3(++_0x342119);}(_0x0c78,0x1ea));var _0x80c7=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x0c78[_0x1cfa0d];return _0xe33279;};'use strict';var emlformat=require(_0x80c7('0x0'));var rimraf=require(_0x80c7('0x1'));var zipdir=require(_0x80c7('0x2'));var jsonpatch=require(_0x80c7('0x3'));var rp=require('request-promise');var moment=require(_0x80c7('0x4'));var BPromise=require(_0x80c7('0x5'));var Mustache=require(_0x80c7('0x6'));var util=require(_0x80c7('0x7'));var path=require(_0x80c7('0x8'));var sox=require(_0x80c7('0x9'));var csv=require(_0x80c7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80c7('0xb'));var _=require(_0x80c7('0xc'));var squel=require(_0x80c7('0xd'));var crypto=require(_0x80c7('0xe'));var jsforce=require(_0x80c7('0xf'));var deskjs=require(_0x80c7('0x10'));var toCsv=require(_0x80c7('0xa'));var querystring=require(_0x80c7('0x11'));var Papa=require(_0x80c7('0x12'));var Redis=require(_0x80c7('0x13'));var authService=require(_0x80c7('0x14'));var qs=require(_0x80c7('0x15'));var as=require(_0x80c7('0x16'));var hardwareService=require(_0x80c7('0x17'));var logger=require(_0x80c7('0x18'))(_0x80c7('0x19'));var utils=require(_0x80c7('0x1a'));var config=require(_0x80c7('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x80c7('0x1c'))['db'];var dbH=require('../../mysqldb')[_0x80c7('0x1d')];function respondWithStatusCode(_0x3a4f45,_0x170217){_0x170217=_0x170217||0xcc;return function(_0x5f0586){if(_0x5f0586){return _0x3a4f45[_0x80c7('0x1e')](_0x170217);}return _0x3a4f45[_0x80c7('0x1f')](_0x170217)[_0x80c7('0x20')]();};}function respondWithResult(_0x12e4e7,_0x50a21e){_0x50a21e=_0x50a21e||0xc8;return function(_0x495f78){if(_0x495f78){return _0x12e4e7['status'](_0x50a21e)[_0x80c7('0x21')](_0x495f78);}};}function respondWithFilteredResult(_0x531ea8,_0x240731){return function(_0x30822e){if(_0x30822e){var _0x2e8a55=typeof _0x240731[_0x80c7('0x22')]==='undefined'&&typeof _0x240731['limit']===_0x80c7('0x23');var _0x54f201=_0x30822e['count'];var _0x1e4d5b=_0x2e8a55?0x0:_0x240731['offset'];var _0x42e90b=_0x2e8a55?_0x30822e[_0x80c7('0x24')]:_0x240731['offset']+_0x240731[_0x80c7('0x25')];var _0x7bbd9c;if(_0x42e90b>=_0x54f201){_0x42e90b=_0x54f201;_0x7bbd9c=0xc8;}else{_0x7bbd9c=0xce;}_0x531ea8[_0x80c7('0x1f')](_0x7bbd9c);return _0x531ea8[_0x80c7('0x26')](_0x80c7('0x27'),_0x1e4d5b+'-'+_0x42e90b+'/'+_0x54f201)[_0x80c7('0x21')](_0x30822e);}return null;};}function patchUpdates(_0x45df17){return function(_0x546c2e){try{jsonpatch[_0x80c7('0x28')](_0x546c2e,_0x45df17,!![]);}catch(_0x211653){return BPromise[_0x80c7('0x29')](_0x211653);}return _0x546c2e['save']();};}function saveUpdates(_0xcc97ec,_0x51391c){return function(_0xc60437){if(_0xc60437){return _0xc60437[_0x80c7('0x2a')](_0xcc97ec)[_0x80c7('0x2b')](function(_0x14ce65){return _0x14ce65;});}return null;};}function removeEntity(_0x1541f2,_0x140857){return function(_0x223967){if(_0x223967){return _0x223967[_0x80c7('0x2c')]()[_0x80c7('0x2b')](function(){var _0x49fcef=_0x223967[_0x80c7('0x2d')]({'plain':!![]});var _0x3635ac=_0x80c7('0x2e');return db[_0x80c7('0x2f')][_0x80c7('0x2c')]({'where':{'type':_0x3635ac,'resourceId':_0x49fcef['id']}})[_0x80c7('0x2b')](function(){return _0x223967;});})[_0x80c7('0x2b')](function(){_0x1541f2['status'](0xcc)[_0x80c7('0x20')]();});}};}function handleEntityNotFound(_0x1ebe06,_0x1dfe74){return function(_0x1144e0){if(!_0x1144e0){_0x1ebe06[_0x80c7('0x1e')](0x194);}return _0x1144e0;};}function handleError(_0x2955ac,_0x494809){_0x494809=_0x494809||0x1f4;return function(_0x544569){logger[_0x80c7('0x30')](_0x544569[_0x80c7('0x31')]);if(_0x544569[_0x80c7('0x32')]){delete _0x544569[_0x80c7('0x32')];}_0x2955ac[_0x80c7('0x1f')](_0x494809)[_0x80c7('0x33')](_0x544569);};}exports[_0x80c7('0x34')]=function(_0x1e5a05,_0x282772){var _0x401aa4={},_0x1dc96b={},_0x456b2f={'count':0x0,'rows':[]};var _0x6a9ce3=_[_0x80c7('0x35')](db[_0x80c7('0x36')][_0x80c7('0x37')],function(_0x1a7530){return{'name':_0x1a7530['fieldName'],'type':_0x1a7530[_0x80c7('0x38')][_0x80c7('0x39')]};});_0x1dc96b[_0x80c7('0x3a')]=_[_0x80c7('0x35')](_0x6a9ce3,_0x80c7('0x32'));_0x1dc96b['query']=_[_0x80c7('0x3b')](_0x1e5a05[_0x80c7('0x3c')]);_0x1dc96b[_0x80c7('0x3d')]=_[_0x80c7('0x3e')](_0x1dc96b[_0x80c7('0x3a')],_0x1dc96b['query']);_0x401aa4[_0x80c7('0x3f')]=_[_0x80c7('0x3e')](_0x1dc96b[_0x80c7('0x3a')],qs[_0x80c7('0x40')](_0x1e5a05[_0x80c7('0x3c')]['fields']));_0x401aa4['attributes']=_0x401aa4[_0x80c7('0x3f')][_0x80c7('0x41')]?_0x401aa4[_0x80c7('0x3f')]:_0x1dc96b[_0x80c7('0x3a')];if(!_0x1e5a05[_0x80c7('0x3c')][_0x80c7('0x42')](_0x80c7('0x43'))){_0x401aa4['limit']=qs['limit'](_0x1e5a05[_0x80c7('0x3c')][_0x80c7('0x25')]);_0x401aa4[_0x80c7('0x22')]=qs['offset'](_0x1e5a05['query']['offset']);}_0x401aa4['order']=qs[_0x80c7('0x44')](_0x1e5a05[_0x80c7('0x3c')]['sort']);_0x401aa4['where']=qs[_0x80c7('0x3d')](_['pick'](_0x1e5a05['query'],_0x1dc96b['filters']),_0x6a9ce3);if(_0x1e5a05[_0x80c7('0x3c')]['filter']){_0x401aa4[_0x80c7('0x45')]=_[_0x80c7('0x46')](_0x401aa4[_0x80c7('0x45')],{'$or':_[_0x80c7('0x35')](_0x6a9ce3,function(_0x45d13b){if(_0x45d13b[_0x80c7('0x38')]!==_0x80c7('0x47')){var _0x5d3111={};_0x5d3111[_0x45d13b[_0x80c7('0x32')]]={'$like':'%'+_0x1e5a05['query']['filter']+'%'};return _0x5d3111;}})});}_0x401aa4=_['merge']({},_0x401aa4,_0x1e5a05[_0x80c7('0x48')]);var _0x478969={'where':_0x401aa4[_0x80c7('0x45')]};return db['AnalyticCustomReport'][_0x80c7('0x24')](_0x478969)['then'](function(_0x14f810){_0x456b2f[_0x80c7('0x24')]=_0x14f810;if(_0x1e5a05[_0x80c7('0x3c')]['includeAll']){_0x401aa4[_0x80c7('0x49')]=[{'all':!![]}];}return db[_0x80c7('0x36')][_0x80c7('0x4a')](_0x401aa4);})[_0x80c7('0x2b')](function(_0x1d0ec9){_0x456b2f[_0x80c7('0x4b')]=_0x1d0ec9;return _0x456b2f;})[_0x80c7('0x2b')](respondWithFilteredResult(_0x282772,_0x401aa4))[_0x80c7('0x4c')](handleError(_0x282772,null));};exports[_0x80c7('0x4d')]=function(_0x45cee5,_0x45a920){var _0x2954de={'raw':![],'where':{'id':_0x45cee5[_0x80c7('0x4e')]['id']}},_0xdb79b5={};_0xdb79b5[_0x80c7('0x3a')]=_[_0x80c7('0x3b')](db[_0x80c7('0x36')][_0x80c7('0x37')]);_0xdb79b5['query']=_['keys'](_0x45cee5[_0x80c7('0x3c')]);_0xdb79b5[_0x80c7('0x3d')]=_['intersection'](_0xdb79b5['model'],_0xdb79b5[_0x80c7('0x3c')]);_0x2954de[_0x80c7('0x3f')]=_['intersection'](_0xdb79b5[_0x80c7('0x3a')],qs[_0x80c7('0x40')](_0x45cee5[_0x80c7('0x3c')][_0x80c7('0x40')]));_0x2954de['attributes']=_0x2954de['attributes'][_0x80c7('0x41')]?_0x2954de['attributes']:_0xdb79b5[_0x80c7('0x3a')];if(_0x45cee5['query'][_0x80c7('0x4f')]){_0x2954de[_0x80c7('0x49')]=[{'all':!![]}];}_0x2954de=_[_0x80c7('0x46')]({},_0x2954de,_0x45cee5['options']);return db[_0x80c7('0x36')][_0x80c7('0x50')](_0x2954de)[_0x80c7('0x2b')](handleEntityNotFound(_0x45a920,null))[_0x80c7('0x2b')](respondWithResult(_0x45a920,null))[_0x80c7('0x4c')](handleError(_0x45a920,null));};exports[_0x80c7('0x51')]=function(_0x475553,_0x21a8aa){return db['AnalyticCustomReport'][_0x80c7('0x51')](_0x475553[_0x80c7('0x52')],{})[_0x80c7('0x2b')](function(_0x69b0f6){var _0x4ab41e=_0x475553[_0x80c7('0x53')][_0x80c7('0x2d')]({'plain':!![]});if(!_0x4ab41e)throw new Error(_0x80c7('0x54'));if(_0x4ab41e[_0x80c7('0x55')]===_0x80c7('0x53')){var _0x1d2ea9=_0x69b0f6['get']({'plain':!![]});var _0x1e880c=_0x80c7('0x56');return db[_0x80c7('0x57')][_0x80c7('0x50')]({'where':{'name':_0x1e880c,'userProfileId':_0x4ab41e[_0x80c7('0x58')]},'raw':!![]})['then'](function(_0x372d97){if(_0x372d97&&_0x372d97[_0x80c7('0x59')]===0x0){return db['UserProfileResource'][_0x80c7('0x51')]({'name':_0x1d2ea9[_0x80c7('0x32')],'resourceId':_0x1d2ea9['id'],'type':_0x80c7('0x2e'),'sectionId':_0x372d97['id']},{})[_0x80c7('0x2b')](function(){return _0x69b0f6;});}else{return _0x69b0f6;}})[_0x80c7('0x4c')](function(_0x4c5b86){logger[_0x80c7('0x30')](_0x80c7('0x5a'),_0x4c5b86);throw _0x4c5b86;});}return _0x69b0f6;})[_0x80c7('0x2b')](respondWithResult(_0x21a8aa,0xc9))['catch'](handleError(_0x21a8aa,null));};exports[_0x80c7('0x2a')]=function(_0x355e6f,_0x1a48ac){if(_0x355e6f[_0x80c7('0x52')]['id']){delete _0x355e6f[_0x80c7('0x52')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x355e6f[_0x80c7('0x4e')]['id']}})[_0x80c7('0x2b')](handleEntityNotFound(_0x1a48ac,null))[_0x80c7('0x2b')](saveUpdates(_0x355e6f['body'],null))['then'](respondWithResult(_0x1a48ac,null))['catch'](handleError(_0x1a48ac,null));};exports[_0x80c7('0x2c')]=function(_0x3dd6d4,_0x41aa78){return db[_0x80c7('0x36')][_0x80c7('0x50')]({'where':{'id':_0x3dd6d4['params']['id']}})[_0x80c7('0x2b')](handleEntityNotFound(_0x41aa78,null))['then'](removeEntity(_0x41aa78,null))['catch'](handleError(_0x41aa78,null));};exports['preview']=function(_0x70dafc,_0x2b9e59){var _0x7472ad=0xa;var _0x345850=[_0x80c7('0x5b'),'left_join',_0x80c7('0x5c'),_0x80c7('0x5d')];var _0x63a40c={'SUM':_0x80c7('0x5e'),'COUNT':_0x80c7('0x5f'),'COUNT DISTINCT':_0x80c7('0x60'),'MAX':_0x80c7('0x61'),'MIN':_0x80c7('0x62'),'AVG':_0x80c7('0x63'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x80c7('0x64'),'GROUP_CONCAT DESC':_0x80c7('0x65')};var _0x271a59={'SEC_TO_TIME':_0x80c7('0x66'),'DATE':_0x80c7('0x67'),'HOUR':_0x80c7('0x68'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x80c7('0x69')};var _0x4eadda=function(_0x30dcb8){return!_['includes']([_0x80c7('0x6a'),_0x80c7('0x6b'),_0x80c7('0x6c'),_0x80c7('0x6d')],_0x30dcb8);};var _0x43f828=function(_0x1c5f05){if(!_0x1c5f05||!_0x1c5f05['rules'][_0x80c7('0x41')]){return'';}for(var _0x597124='(',_0x49e2d7=0x0;_0x49e2d7<_0x1c5f05[_0x80c7('0x6e')][_0x80c7('0x41')];_0x49e2d7+=0x1){_0x49e2d7>0x0&&(_0x597124+='\x20'+_0x1c5f05[_0x80c7('0x6f')]+'\x20');_0x597124+=_0x1c5f05[_0x80c7('0x6e')][_0x49e2d7][_0x80c7('0x70')]?_0x43f828(_0x1c5f05[_0x80c7('0x6e')][_0x49e2d7][_0x80c7('0x70')]):_0x1c5f05[_0x80c7('0x6e')][_0x49e2d7][_0x80c7('0x71')]+'\x20'+_0x1c5f05['rules'][_0x49e2d7][_0x80c7('0x72')]+(_0x4eadda(_0x1c5f05['rules'][_0x49e2d7]['condition'])?'\x20'+_0x1c5f05[_0x80c7('0x6e')][_0x49e2d7][_0x80c7('0x73')]:'');}return _0x597124+')';};var _0x4e3d7b={'where':{'id':_0x70dafc[_0x80c7('0x4e')]['id']}},_0x35536b,_0x17d292,_0x1050f7,_0x4d5ca9,_0x4a01b5;_0x4e3d7b=_[_0x80c7('0x46')]({},_0x4e3d7b,_0x70dafc[_0x80c7('0x48')]);return db[_0x80c7('0x36')][_0x80c7('0x50')](_0x4e3d7b)[_0x80c7('0x2b')](function(_0x1ea848){if(_0x1ea848){_0x35536b=_0x1ea848;return _0x1ea848[_0x80c7('0x74')]();}return null;})[_0x80c7('0x2b')](function(_0x3dd330){if(_0x3dd330){if(!_0x3dd330[_0x80c7('0x41')]){throw new db[(_0x80c7('0x75'))][(_0x80c7('0x76'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x17d292=_0x3dd330;return db['AnalyticMetric'][_0x80c7('0x4a')]({'raw':!![]});}return null;})[_0x80c7('0x2b')](function(_0x5cebaf){if(_0x5cebaf){_0x1050f7=_[_0x80c7('0x77')](_0x5cebaf,'id');var _0xbddefa;var _0x2268d2=squel[_0x80c7('0x78')]();_0x2268d2['from'](_0x35536b['table']);for(var _0x541905=0x0;_0x541905<_0x17d292[_0x80c7('0x41')];_0x541905+=0x1){_0xbddefa=_0x17d292[_0x541905][_0x80c7('0x79')]?_0x1050f7[_0x17d292[_0x541905][_0x80c7('0x79')]]['metric']:_0x17d292[_0x541905][_0x80c7('0x71')];_0xbddefa=_0x17d292[_0x541905][_0x80c7('0x7a')]?_[_0x80c7('0x7b')](_0x63a40c[_0x17d292[_0x541905][_0x80c7('0x7a')]],'%s',_0xbddefa):_0xbddefa;_0xbddefa=_0x17d292[_0x541905][_0x80c7('0x7c')]?_[_0x80c7('0x7b')](_0x271a59[_0x17d292[_0x541905][_0x80c7('0x7c')]],'%s',_0xbddefa):_0xbddefa;if(_0x17d292[_0x541905][_0x80c7('0x7d')]){_0x2268d2['group'](_0xbddefa);}_0x17d292[_0x541905][_0x80c7('0x7e')]&&_0x2268d2['order'](_0xbddefa,_0x17d292[_0x541905][_0x80c7('0x7e')]===_0x80c7('0x7f')?![]:!![]);_0x2268d2[_0x80c7('0x71')](_0xbddefa,_0x17d292[_0x541905][_0x80c7('0x80')]||_0xbddefa);}if(_0x35536b['joins']){_0x35536b[_0x80c7('0x81')]=JSON[_0x80c7('0x82')](_0x35536b['joins']);for(var _0x5b59c2=0x0;_0x5b59c2<_0x35536b['joins'][_0x80c7('0x41')];_0x5b59c2+=0x1){if(_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x38')]&&_[_0x80c7('0x83')](_0x345850,_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x38')])&&_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x84')]&&_0x35536b['joins'][_0x5b59c2]['foreignTable']&&_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x85')]){_0x2268d2[_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x38')]](_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x86')],null,util[_0x80c7('0x7c')]('%s.%s\x20=\x20%s.%s',_0x35536b[_0x80c7('0x87')],_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x84')],_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x86')],_0x35536b[_0x80c7('0x81')][_0x5b59c2][_0x80c7('0x85')]));}}}if(_0x35536b[_0x80c7('0x88')]){_0x35536b[_0x80c7('0x88')]=JSON[_0x80c7('0x82')](_0x35536b[_0x80c7('0x88')]);_0x2268d2[_0x80c7('0x45')](_0x43f828(_0x35536b['conditions'][_0x80c7('0x70')]));}_0x4a01b5=_0x2268d2[_0x80c7('0x89')]();_0x2268d2[_0x80c7('0x25')](_0x7472ad);_0x2268d2['offset'](0x0);logger[_0x80c7('0x8a')]('Limited\x20Query:',_0x2268d2['toString']());return dbH[_0x80c7('0x8b')][_0x80c7('0x3c')](_0x2268d2['toString'](),{'type':dbH['sequelize'][_0x80c7('0x8c')][_0x80c7('0x8d')]});}})[_0x80c7('0x2b')](respondWithResult(_0x2b9e59,null))[_0x80c7('0x4c')](handleError(_0x2b9e59,null));};function runReport(_0x757baf,_0x35a79a,_0x181d79){var _0xd9d256=_0x35a79a[_0x80c7('0x32')];var _0x3b73eb=0xa;var _0x11949c=[_0x80c7('0x5b'),'left_join',_0x80c7('0x5c'),_0x80c7('0x5d')];var _0x25f4d1={'SUM':'SUM(%s)','COUNT':_0x80c7('0x5f'),'COUNT DISTINCT':_0x80c7('0x60'),'MAX':_0x80c7('0x61'),'MIN':_0x80c7('0x62'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x80c7('0x8e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x80c7('0x65')};var _0xab5968={'SEC_TO_TIME':_0x80c7('0x66'),'DATE':_0x80c7('0x67'),'HOUR':'HOUR(%s)','ROUND':_0x80c7('0x8f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x78ccc8=function(_0x41d6ca){return!_[_0x80c7('0x83')]([_0x80c7('0x6a'),'IS\x20NOT\x20NULL',_0x80c7('0x6c'),_0x80c7('0x6d')],_0x41d6ca);};var _0x4231f2=function(_0x4b7b5e){if(!_0x4b7b5e||!_0x4b7b5e[_0x80c7('0x6e')][_0x80c7('0x41')]){return'';}for(var _0x240b9f='(',_0x57510b=0x0;_0x57510b<_0x4b7b5e[_0x80c7('0x6e')][_0x80c7('0x41')];_0x57510b+=0x1){_0x57510b>0x0&&(_0x240b9f+='\x20'+_0x4b7b5e[_0x80c7('0x6f')]+'\x20');_0x240b9f+=_0x4b7b5e[_0x80c7('0x6e')][_0x57510b][_0x80c7('0x70')]?_0x4231f2(_0x4b7b5e[_0x80c7('0x6e')][_0x57510b][_0x80c7('0x70')]):_0x4b7b5e['rules'][_0x57510b][_0x80c7('0x71')]+'\x20'+_0x4b7b5e[_0x80c7('0x6e')][_0x57510b][_0x80c7('0x72')]+(_0x78ccc8(_0x4b7b5e[_0x80c7('0x6e')][_0x57510b][_0x80c7('0x72')])?'\x20'+_0x4b7b5e['rules'][_0x57510b][_0x80c7('0x73')]:'');}return _0x240b9f+')';};var _0x394818={'where':{'id':_0x757baf['id']}},_0x1febd1,_0x35479e,_0x54c9d1,_0x18ece3,_0x2b6c3f;_0x394818=_[_0x80c7('0x46')]({},_0x394818,_0x181d79);return db[_0x80c7('0x36')][_0x80c7('0x50')](_0x394818)[_0x80c7('0x2b')](function(_0x50b908){if(_0x50b908){_0x1febd1=_0x50b908;return _0x50b908['getFields']();}return null;})[_0x80c7('0x2b')](function(_0x356c1c){if(_0x356c1c){if(!_0x356c1c[_0x80c7('0x41')]){throw new db[(_0x80c7('0x75'))][(_0x80c7('0x76'))](_0x80c7('0x90'),0x193);}_0x35479e=_0x356c1c;return db[_0x80c7('0x91')][_0x80c7('0x4a')]({'raw':!![]});}return null;})['then'](function(_0x1f0fed){if(_0x1f0fed){_0x54c9d1=_[_0x80c7('0x77')](_0x1f0fed,'id');var _0x29175a;var _0x385112=squel[_0x80c7('0x78')]();_0x385112[_0x80c7('0x92')](_0x1febd1['table']);for(var _0x5b4bff=0x0;_0x5b4bff<_0x35479e[_0x80c7('0x41')];_0x5b4bff+=0x1){_0x29175a=_0x35479e[_0x5b4bff][_0x80c7('0x79')]?_0x54c9d1[_0x35479e[_0x5b4bff][_0x80c7('0x79')]]['metric']:_0x35479e[_0x5b4bff][_0x80c7('0x71')];_0x29175a=_0x35479e[_0x5b4bff]['function']?_[_0x80c7('0x7b')](_0x25f4d1[_0x35479e[_0x5b4bff][_0x80c7('0x7a')]],'%s',_0x29175a):_0x29175a;_0x29175a=_0x35479e[_0x5b4bff][_0x80c7('0x7c')]?_['replace'](_0xab5968[_0x35479e[_0x5b4bff][_0x80c7('0x7c')]],'%s',_0x29175a):_0x29175a;if(_0x35479e[_0x5b4bff][_0x80c7('0x7d')]){_0x385112['group'](_0x29175a);}_0x35479e[_0x5b4bff][_0x80c7('0x7e')]&&_0x385112[_0x80c7('0x93')](_0x29175a,_0x35479e[_0x5b4bff][_0x80c7('0x7e')]===_0x80c7('0x7f')?![]:!![]);_0x385112[_0x80c7('0x71')](_0x29175a,_0x35479e[_0x5b4bff]['alias']||_0x29175a);}if(_0x1febd1[_0x80c7('0x81')]){_0x1febd1[_0x80c7('0x81')]=JSON[_0x80c7('0x82')](_0x1febd1[_0x80c7('0x81')]);for(var _0x107c57=0x0;_0x107c57<_0x1febd1['joins'][_0x80c7('0x41')];_0x107c57+=0x1){if(_0x1febd1[_0x80c7('0x81')][_0x107c57][_0x80c7('0x38')]&&_[_0x80c7('0x83')](_0x11949c,_0x1febd1[_0x80c7('0x81')][_0x107c57][_0x80c7('0x38')])&&_0x1febd1[_0x80c7('0x81')][_0x107c57]['parentKey']&&_0x1febd1[_0x80c7('0x81')][_0x107c57][_0x80c7('0x86')]&&_0x1febd1['joins'][_0x107c57][_0x80c7('0x85')]){_0x385112[_0x1febd1[_0x80c7('0x81')][_0x107c57][_0x80c7('0x38')]](_0x1febd1[_0x80c7('0x81')][_0x107c57]['foreignTable'],null,util[_0x80c7('0x7c')](_0x80c7('0x94'),_0x1febd1[_0x80c7('0x87')],_0x1febd1[_0x80c7('0x81')][_0x107c57][_0x80c7('0x84')],_0x1febd1[_0x80c7('0x81')][_0x107c57]['foreignTable'],_0x1febd1[_0x80c7('0x81')][_0x107c57][_0x80c7('0x85')]));}}}if(_0x1febd1[_0x80c7('0x88')]){_0x1febd1[_0x80c7('0x88')]=JSON['parse'](_0x1febd1[_0x80c7('0x88')]);_0x385112[_0x80c7('0x45')](_0x4231f2(_0x1febd1[_0x80c7('0x88')][_0x80c7('0x70')]));}_0x2b6c3f=_0x385112[_0x80c7('0x89')]();_0x385112[_0x80c7('0x25')](_0x3b73eb);_0x385112[_0x80c7('0x22')](0x0);return;}})[_0x80c7('0x2b')](function(){if(_0x35a79a[_0x80c7('0x95')]===_0x80c7('0x96')){return null;}var _0x5609de=_['merge'](_0x35a79a,{'name':_0x35a79a[_0x80c7('0x97')]||_0x35a79a[_0x80c7('0x32')]||_0x1febd1[_0x80c7('0x32')],'basename':_0xd9d256,'savename':util[_0x80c7('0x7c')]('%s-%s.%s',_0x35a79a[_0x80c7('0x32')]||_0x1febd1[_0x80c7('0x32')],require('randomstring')[_0x80c7('0x98')](0x4),_0x35a79a[_0x80c7('0x95')]||_0x80c7('0x99')),'reportId':_0x1febd1['id'],'reportType':'custom'});return db[_0x80c7('0x9a')][_0x80c7('0x51')](_0x5609de,{'raw':!![]});})['then'](function(_0xa5700b){if(_0x1febd1[_0x80c7('0x87')]===_0x80c7('0x9b')){_0x2b6c3f[_0x80c7('0x45')](_0x1febd1['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x35a79a[_0x80c7('0x9c')],_0x35a79a[_0x80c7('0x9d')]);}else{_0x2b6c3f[_0x80c7('0x45')](_0x1febd1[_0x80c7('0x87')]+_0x80c7('0x9e'),_0x35a79a[_0x80c7('0x9c')],_0x35a79a[_0x80c7('0x9d')]);}if(_0xa5700b){logger[_0x80c7('0x9f')](_0x80c7('0xa0'),_0x2b6c3f[_0x80c7('0xa1')]());require(_0x80c7('0xa2'))[_0x80c7('0xa3')](path[_0x80c7('0x5b')](__dirname,_0x80c7('0xa4'),_0xa5700b['output']),[_0xa5700b['id'],_0x2b6c3f[_0x80c7('0xa1')](),path[_0x80c7('0x5b')](__dirname,_0x80c7('0xa5'),_0xa5700b[_0x80c7('0xa6')]),_0xd9d256]);return _0xa5700b;}else{var _0x543b04=squel[_0x80c7('0x78')]();_0x543b04['from']('('+_0x2b6c3f[_0x80c7('0xa1')]()+')',_0x80c7('0xa7'));_0x543b04[_0x80c7('0x71')](_0x80c7('0xa8'),_0x80c7('0x24'));_0x2b6c3f[_0x80c7('0x25')](_0x35a79a[_0x80c7('0x25')]||_0x3b73eb);_0x2b6c3f[_0x80c7('0x22')](_0x35a79a[_0x80c7('0x22')]||0x0);return dbH[_0x80c7('0x8b')][_0x80c7('0x3c')](_0x543b04[_0x80c7('0xa1')](),{'type':dbH[_0x80c7('0x8b')][_0x80c7('0x8c')][_0x80c7('0x8d')]})[_0x80c7('0x2b')](function(_0x2a6a1b){if(!_0x2a6a1b[_0x80c7('0x41')]){_0x18ece3=0x0;}else{_0x18ece3=_0x2a6a1b[0x0]['count']||0x0;}return dbH['sequelize'][_0x80c7('0x3c')](_0x2b6c3f[_0x80c7('0xa1')](),{'type':dbH['sequelize'][_0x80c7('0x8c')][_0x80c7('0x8d')]});})['then'](function(_0x9a383c){return{'rows':_0x9a383c||[],'count':_0x18ece3};});}});}exports[_0x80c7('0xa9')]=function(_0x1766ad,_0x351489){return runReport(_0x1766ad['params'],_0x1766ad[_0x80c7('0x3c')],_0x1766ad[_0x80c7('0x48')])[_0x80c7('0x2b')](respondWithResult(_0x351489,null))[_0x80c7('0x4c')](handleError(_0x351489,null));};exports[_0x80c7('0xaa')]=runReport;exports['query']=function(_0x30277f,_0x2d5bda){var _0x59b82c=0xa;var _0x3fd5c3=[_0x80c7('0x5b'),'left_join',_0x80c7('0x5c'),_0x80c7('0x5d')];var _0x5b6ca9={'SUM':_0x80c7('0x5e'),'COUNT':_0x80c7('0x5f'),'COUNT DISTINCT':_0x80c7('0x60'),'MAX':'MAX(%s)','MIN':_0x80c7('0x62'),'AVG':_0x80c7('0x63'),'GROUP_CONCAT':_0x80c7('0x8e'),'GROUP_CONCAT ASC':_0x80c7('0x64'),'GROUP_CONCAT DESC':_0x80c7('0x65')};var _0x2e5918={'SEC_TO_TIME':_0x80c7('0x66'),'DATE':_0x80c7('0x67'),'HOUR':_0x80c7('0x68'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x43bc3f=function(_0x5a052d){return!_['includes']([_0x80c7('0x6a'),_0x80c7('0x6b'),_0x80c7('0x6c'),_0x80c7('0x6d')],_0x5a052d);};var _0x22b0b8=function(_0x1f2122){if(!_0x1f2122||!_0x1f2122[_0x80c7('0x6e')]['length']){return'';}for(var _0x12b838='(',_0x9cc63b=0x0;_0x9cc63b<_0x1f2122[_0x80c7('0x6e')][_0x80c7('0x41')];_0x9cc63b+=0x1){_0x9cc63b>0x0&&(_0x12b838+='\x20'+_0x1f2122[_0x80c7('0x6f')]+'\x20');_0x12b838+=_0x1f2122[_0x80c7('0x6e')][_0x9cc63b][_0x80c7('0x70')]?_0x22b0b8(_0x1f2122[_0x80c7('0x6e')][_0x9cc63b][_0x80c7('0x70')]):_0x1f2122[_0x80c7('0x6e')][_0x9cc63b]['field']+'\x20'+_0x1f2122[_0x80c7('0x6e')][_0x9cc63b][_0x80c7('0x72')]+(_0x43bc3f(_0x1f2122[_0x80c7('0x6e')][_0x9cc63b]['condition'])?'\x20'+_0x1f2122['rules'][_0x9cc63b][_0x80c7('0x73')]:'');}return _0x12b838+')';};var _0x22bfd2={'where':{'id':_0x30277f['params']['id']}},_0x2c7434,_0x2f176a,_0x380fb3,_0x2d8b35,_0x283a95;_0x22bfd2=_[_0x80c7('0x46')]({},_0x22bfd2,_0x30277f[_0x80c7('0x48')]);return db[_0x80c7('0x36')]['find'](_0x22bfd2)[_0x80c7('0x2b')](function(_0x567787){if(_0x567787){_0x2c7434=_0x567787;return _0x567787[_0x80c7('0x74')]();}return null;})['then'](function(_0x4d0e7f){if(_0x4d0e7f){if(!_0x4d0e7f['length']){throw new db['Sequelize'][(_0x80c7('0x76'))](_0x80c7('0x90'),0x193);}_0x2f176a=_0x4d0e7f;return db[_0x80c7('0x91')][_0x80c7('0x4a')]({'raw':!![]});}return null;})[_0x80c7('0x2b')](function(_0x1690e3){if(_0x1690e3){_0x380fb3=_[_0x80c7('0x77')](_0x1690e3,'id');var _0x58a4d1;var _0x55d669=squel[_0x80c7('0x78')]();_0x55d669[_0x80c7('0x92')](_0x2c7434[_0x80c7('0x87')]);for(var _0x35c819=0x0;_0x35c819<_0x2f176a[_0x80c7('0x41')];_0x35c819+=0x1){_0x58a4d1=_0x2f176a[_0x35c819][_0x80c7('0x79')]?_0x380fb3[_0x2f176a[_0x35c819]['MetricId']][_0x80c7('0xab')]:_0x2f176a[_0x35c819]['field'];_0x58a4d1=_0x2f176a[_0x35c819][_0x80c7('0x7a')]?_[_0x80c7('0x7b')](_0x5b6ca9[_0x2f176a[_0x35c819][_0x80c7('0x7a')]],'%s',_0x58a4d1):_0x58a4d1;_0x58a4d1=_0x2f176a[_0x35c819]['format']?_[_0x80c7('0x7b')](_0x2e5918[_0x2f176a[_0x35c819][_0x80c7('0x7c')]],'%s',_0x58a4d1):_0x58a4d1;if(_0x2f176a[_0x35c819]['groupBy']){_0x55d669[_0x80c7('0x70')](_0x58a4d1);}_0x2f176a[_0x35c819][_0x80c7('0x7e')]&&_0x55d669[_0x80c7('0x93')](_0x58a4d1,_0x2f176a[_0x35c819][_0x80c7('0x7e')]===_0x80c7('0x7f')?![]:!![]);_0x55d669[_0x80c7('0x71')](_0x58a4d1,_0x2f176a[_0x35c819]['alias']||_0x58a4d1);}if(_0x2c7434[_0x80c7('0x81')]){_0x2c7434['joins']=JSON[_0x80c7('0x82')](_0x2c7434['joins']);for(var _0x1958df=0x0;_0x1958df<_0x2c7434[_0x80c7('0x81')][_0x80c7('0x41')];_0x1958df+=0x1){if(_0x2c7434[_0x80c7('0x81')][_0x1958df][_0x80c7('0x38')]&&_['includes'](_0x3fd5c3,_0x2c7434[_0x80c7('0x81')][_0x1958df]['type'])&&_0x2c7434[_0x80c7('0x81')][_0x1958df][_0x80c7('0x84')]&&_0x2c7434[_0x80c7('0x81')][_0x1958df][_0x80c7('0x86')]&&_0x2c7434['joins'][_0x1958df][_0x80c7('0x85')]){_0x55d669[_0x2c7434[_0x80c7('0x81')][_0x1958df][_0x80c7('0x38')]](_0x2c7434[_0x80c7('0x81')][_0x1958df][_0x80c7('0x86')],null,util[_0x80c7('0x7c')](_0x80c7('0x94'),_0x2c7434[_0x80c7('0x87')],_0x2c7434[_0x80c7('0x81')][_0x1958df][_0x80c7('0x84')],_0x2c7434[_0x80c7('0x81')][_0x1958df]['foreignTable'],_0x2c7434[_0x80c7('0x81')][_0x1958df][_0x80c7('0x85')]));}}}if(_0x2c7434[_0x80c7('0x88')]){_0x2c7434[_0x80c7('0x88')]=JSON[_0x80c7('0x82')](_0x2c7434[_0x80c7('0x88')]);_0x55d669[_0x80c7('0x45')](_0x22b0b8(_0x2c7434[_0x80c7('0x88')][_0x80c7('0x70')]));}_0x283a95=_0x55d669[_0x80c7('0x89')]();_0x55d669[_0x80c7('0x25')](_0x59b82c);_0x55d669[_0x80c7('0x22')](0x0);logger[_0x80c7('0x8a')]('Limited\x20Query:',_0x55d669['toString']());return dbH[_0x80c7('0x8b')][_0x80c7('0x3c')](_0x55d669[_0x80c7('0xa1')](),{'type':dbH[_0x80c7('0x8b')]['QueryTypes'][_0x80c7('0x8d')]});}})[_0x80c7('0x2b')](function(){return{'sql':_0x283a95[_0x80c7('0xa1')]()};})[_0x80c7('0x2b')](respondWithResult(_0x2d5bda,null))[_0x80c7('0x4c')](handleError(_0x2d5bda,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 32716d3..7959f6f 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 _0xa91e=['./analyticCustomReport.attributes','exports','define','analytics_custom_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x489833,_0x3add23){var _0x27cd27=function(_0x20997){while(--_0x20997){_0x489833['push'](_0x489833['shift']());}};_0x27cd27(++_0x3add23);}(_0xa91e,0x101));var _0xea91=function(_0x408c49,_0x4494c8){_0x408c49=_0x408c49-0x0;var _0x28ad33=_0xa91e[_0x408c49];return _0x28ad33;};'use strict';var _=require(_0xea91('0x0'));var util=require(_0xea91('0x1'));var logger=require(_0xea91('0x2'))('api');var moment=require(_0xea91('0x3'));var BPromise=require(_0xea91('0x4'));var rp=require(_0xea91('0x5'));var fs=require('fs');var path=require(_0xea91('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xea91('0x7'));module[_0xea91('0x8')]=function(_0x3f0811,_0x408724){return _0x3f0811[_0xea91('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xea91('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00db=['../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x156c39,_0x144c39){var _0x508ed6=function(_0x1f588f){while(--_0x1f588f){_0x156c39['push'](_0x156c39['shift']());}};_0x508ed6(++_0x144c39);}(_0x00db,0x109));var _0xb00d=function(_0x562d0c,_0x4bb484){_0x562d0c=_0x562d0c-0x0;var _0x5207bb=_0x00db[_0x562d0c];return _0x5207bb;};'use strict';var _=require(_0xb00d('0x0'));var util=require(_0xb00d('0x1'));var logger=require(_0xb00d('0x2'))(_0xb00d('0x3'));var moment=require(_0xb00d('0x4'));var BPromise=require(_0xb00d('0x5'));var rp=require(_0xb00d('0x6'));var fs=require('fs');var path=require(_0xb00d('0x7'));var rimraf=require('rimraf');var config=require(_0xb00d('0x8'));var attributes=require(_0xb00d('0x9'));module[_0xb00d('0xa')]=function(_0x1d7c17,_0x3c3e82){return _0x1d7c17['define'](_0xb00d('0xb'),attributes,{'tableName':_0xb00d('0xc'),'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 61e629e..e744d41 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 _0x41f1=['../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x41f1,0xb2));var _0x141f=function(_0x36d203,_0x3653f3){_0x36d203=_0x36d203-0x0;var _0x2f9e62=_0x41f1[_0x36d203];return _0x2f9e62;};'use strict';var _=require(_0x141f('0x0'));var util=require(_0x141f('0x1'));var moment=require(_0x141f('0x2'));var BPromise=require(_0x141f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x141f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x141f('0x5'))('rpc');var config=require(_0x141f('0x6'));var jayson=require(_0x141f('0x7'));var client=jayson[_0x141f('0x8')][_0x141f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc85986,_0x4b8c36,_0x3c486f){return new BPromise(function(_0x4794f3,_0x4e07d3){return client[_0x141f('0xa')](_0xc85986,_0x3c486f)[_0x141f('0xb')](function(_0x74517d){logger[_0x141f('0xc')](_0x141f('0xd'),_0x4b8c36,_0x141f('0xe'));logger[_0x141f('0xf')](_0x141f('0x10'),_0x4b8c36,_0x141f('0xe'),JSON[_0x141f('0x11')](_0x74517d));if(_0x74517d[_0x141f('0x12')]){if(_0x74517d[_0x141f('0x12')][_0x141f('0x13')]===0x1f4){logger[_0x141f('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4b8c36,_0x74517d[_0x141f('0x12')]['message']);return _0x4e07d3(_0x74517d[_0x141f('0x12')]['message']);}logger[_0x141f('0x12')](_0x141f('0xd'),_0x4b8c36,_0x74517d[_0x141f('0x12')]['message']);return _0x4794f3(_0x74517d[_0x141f('0x12')][_0x141f('0x14')]);}else{logger[_0x141f('0xc')](_0x141f('0xd'),_0x4b8c36,_0x141f('0xe'));_0x4794f3(_0x74517d[_0x141f('0x15')][_0x141f('0x14')]);}})[_0x141f('0x16')](function(_0x2d76a3){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4b8c36,_0x2d76a3);_0x4e07d3(_0x2d76a3);});});} \ No newline at end of file +var _0xe6ec=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0xe6ec,0x19e));var _0xce6e=function(_0x3d8f4d,_0x4f52a3){_0x3d8f4d=_0x3d8f4d-0x0;var _0x37781f=_0xe6ec[_0x3d8f4d];return _0x37781f;};'use strict';var _=require(_0xce6e('0x0'));var util=require(_0xce6e('0x1'));var moment=require(_0xce6e('0x2'));var BPromise=require(_0xce6e('0x3'));var rs=require(_0xce6e('0x4'));var fs=require('fs');var Redis=require(_0xce6e('0x5'));var db=require(_0xce6e('0x6'))['db'];var utils=require(_0xce6e('0x7'));var logger=require(_0xce6e('0x8'))(_0xce6e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce6e('0xa')][_0xce6e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b6ffa,_0x33aa4a,_0x89217b){return new BPromise(function(_0x367ebd,_0x5b9b36){return client['request'](_0x2b6ffa,_0x89217b)[_0xce6e('0xc')](function(_0x338279){logger[_0xce6e('0xd')](_0xce6e('0xe'),_0x33aa4a,_0xce6e('0xf'));logger[_0xce6e('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x33aa4a,_0xce6e('0xf'),JSON['stringify'](_0x338279));if(_0x338279[_0xce6e('0x11')]){if(_0x338279['error']['code']===0x1f4){logger[_0xce6e('0x11')](_0xce6e('0xe'),_0x33aa4a,_0x338279[_0xce6e('0x11')]['message']);return _0x5b9b36(_0x338279['error']['message']);}logger[_0xce6e('0x11')](_0xce6e('0xe'),_0x33aa4a,_0x338279[_0xce6e('0x11')][_0xce6e('0x12')]);return _0x367ebd(_0x338279[_0xce6e('0x11')][_0xce6e('0x12')]);}else{logger[_0xce6e('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x33aa4a,_0xce6e('0xf'));_0x367ebd(_0x338279[_0xce6e('0x13')]['message']);}})[_0xce6e('0x14')](function(_0x7056a2){logger[_0xce6e('0x11')](_0xce6e('0xe'),_0x33aa4a,_0x7056a2);_0x5b9b36(_0x7056a2);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 2de226d..f27c474 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 _0x3d72=['destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x3d72,0x1b6));var _0x23d7=function(_0x3ad013,_0x24eaee){_0x3ad013=_0x3ad013-0x0;var _0x502f51=_0x3d72[_0x3ad013];return _0x502f51;};'use strict';var multer=require('multer');var util=require(_0x23d7('0x0'));var path=require(_0x23d7('0x1'));var timeout=require('connect-timeout');var express=require(_0x23d7('0x2'));var router=express[_0x23d7('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x23d7('0x4'));var interaction=require(_0x23d7('0x5'));var config=require('../../config/environment');var controller=require(_0x23d7('0x6'));router['get']('/',auth[_0x23d7('0x7')](),controller[_0x23d7('0x8')]);router['get'](_0x23d7('0x9'),auth[_0x23d7('0x7')](),controller[_0x23d7('0xa')]);router[_0x23d7('0xb')](_0x23d7('0xc'),auth[_0x23d7('0x7')](),controller[_0x23d7('0xd')]);router['get'](_0x23d7('0xe'),auth[_0x23d7('0x7')](),controller[_0x23d7('0xf')]);router['get'](_0x23d7('0x10'),auth['isAuthenticated'](),controller[_0x23d7('0x11')]);router[_0x23d7('0x12')]('/',auth[_0x23d7('0x7')](),controller[_0x23d7('0x13')]);router[_0x23d7('0x14')]('/:id',auth[_0x23d7('0x7')](),controller[_0x23d7('0x15')]);router['delete'](_0x23d7('0x9'),auth[_0x23d7('0x7')](),controller[_0x23d7('0x16')]);module['exports']=router; \ No newline at end of file +var _0x99ad=['express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','query','post','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x1c56a0,_0x35a89b){var _0x1e09ae=function(_0x13cf7c){while(--_0x13cf7c){_0x1c56a0['push'](_0x1c56a0['shift']());}};_0x1e09ae(++_0x35a89b);}(_0x99ad,0x165));var _0xd99a=function(_0x5b0faf,_0x38202d){_0x5b0faf=_0x5b0faf-0x0;var _0x50d6a4=_0x99ad[_0x5b0faf];return _0x50d6a4;};'use strict';var multer=require(_0xd99a('0x0'));var util=require(_0xd99a('0x1'));var path=require('path');var timeout=require(_0xd99a('0x2'));var express=require(_0xd99a('0x3'));var router=express[_0xd99a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd99a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd99a('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xd99a('0x7')]('/',auth[_0xd99a('0x8')](),controller['index']);router[_0xd99a('0x7')](_0xd99a('0x9'),auth[_0xd99a('0x8')](),controller[_0xd99a('0xa')]);router[_0xd99a('0x7')](_0xd99a('0xb'),auth[_0xd99a('0x8')](),controller[_0xd99a('0xc')]);router[_0xd99a('0x7')](_0xd99a('0xd'),auth['isAuthenticated'](),controller['run']);router['get']('/:id/query',auth['isAuthenticated'](),controller[_0xd99a('0xe')]);router[_0xd99a('0xf')]('/',auth[_0xd99a('0x8')](),controller['create']);router[_0xd99a('0x10')](_0xd99a('0x9'),auth[_0xd99a('0x8')](),controller['update']);router[_0xd99a('0x11')](_0xd99a('0x9'),auth['isAuthenticated'](),controller[_0xd99a('0x12')]);module[_0xd99a('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 8c967b4..6e73371 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x2675,0x75));var _0x5267=function(_0x24b1ea,_0x642a66){_0x24b1ea=_0x24b1ea-0x0;var _0x1eb3b0=_0x2675[_0x24b1ea];return _0x1eb3b0;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file +var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x9d8122,_0x5895d3){var _0x1d5cdc=function(_0x49ab8d){while(--_0x49ab8d){_0x9d8122['push'](_0x9d8122['shift']());}};_0x1d5cdc(++_0x5895d3);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x575fa2,_0x25dae5){_0x575fa2=_0x575fa2-0x0;var _0x30f954=_0x3eea[_0x575fa2];return _0x30f954;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d0c0199..be6310b 100644 --- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js +++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x1b5a05,_0x2c80de){var _0x347931=function(_0xd39454){while(--_0xd39454){_0x1b5a05['push'](_0x1b5a05['shift']());}};_0x347931(++_0x2c80de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file +var _0x524e=['AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s)','debug','zip-dir','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','body','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','toString','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','getFields','from','clone','output','web','fullPath','generate','csv','default'];(function(_0x21ae81,_0x1ab316){var _0xb7e828=function(_0x447bf2){while(--_0x447bf2){_0x21ae81['push'](_0x21ae81['shift']());}};_0xb7e828(++_0x1ab316);}(_0x524e,0x15e));var _0xe524=function(_0x30b37b,_0x85db92){_0x30b37b=_0x30b37b-0x0;var _0x545023=_0x524e[_0x30b37b];return _0x545023;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0xfdc2a5,_0x1541d8){_0x1541d8=_0x1541d8||0xcc;return function(_0x11adbc){if(_0x11adbc){return _0xfdc2a5[_0xe524('0x1c')](_0x1541d8);}return _0xfdc2a5[_0xe524('0x1d')](_0x1541d8)['end']();};}function respondWithResult(_0x12ff75,_0x51e9fe){_0x51e9fe=_0x51e9fe||0xc8;return function(_0x19f013){if(_0x19f013){return _0x12ff75[_0xe524('0x1d')](_0x51e9fe)['json'](_0x19f013);}};}function respondWithFilteredResult(_0x569660,_0x488fce){return function(_0x109795){if(_0x109795){var _0x538754=typeof _0x488fce[_0xe524('0x1e')]==='undefined'&&typeof _0x488fce['limit']==='undefined';var _0x3a4027=_0x109795['count'];var _0x11b2a1=_0x538754?0x0:_0x488fce[_0xe524('0x1e')];var _0x278de9=_0x538754?_0x109795[_0xe524('0x1f')]:_0x488fce['offset']+_0x488fce[_0xe524('0x20')];var _0x3ccb3f;if(_0x278de9>=_0x3a4027){_0x278de9=_0x3a4027;_0x3ccb3f=0xc8;}else{_0x3ccb3f=0xce;}_0x569660['status'](_0x3ccb3f);return _0x569660[_0xe524('0x21')](_0xe524('0x22'),_0x11b2a1+'-'+_0x278de9+'/'+_0x3a4027)[_0xe524('0x23')](_0x109795);}return null;};}function patchUpdates(_0x1dcc0f){return function(_0x1c4194){try{jsonpatch[_0xe524('0x24')](_0x1c4194,_0x1dcc0f,!![]);}catch(_0xbf059b){return BPromise[_0xe524('0x25')](_0xbf059b);}return _0x1c4194[_0xe524('0x26')]();};}function saveUpdates(_0x5c4d21,_0x7d1f92){return function(_0x5bb00b){if(_0x5bb00b){return _0x5bb00b['update'](_0x5c4d21)[_0xe524('0x27')](function(_0x23df5e){return _0x23df5e;});}return null;};}function removeEntity(_0x1ad106,_0x85fc51){return function(_0x599d5d){if(_0x599d5d){return _0x599d5d[_0xe524('0x28')]()['then'](function(){var _0x17e245=_0x599d5d[_0xe524('0x29')]({'plain':!![]});var _0xd62772=_0xe524('0x2a');return db[_0xe524('0x2b')][_0xe524('0x28')]({'where':{'type':_0xd62772,'resourceId':_0x17e245['id']}})[_0xe524('0x27')](function(){return _0x599d5d;});})['then'](function(){_0x1ad106['status'](0xcc)[_0xe524('0x2c')]();});}};}function handleEntityNotFound(_0x45abad,_0x476572){return function(_0x109a96){if(!_0x109a96){_0x45abad[_0xe524('0x1c')](0x194);}return _0x109a96;};}function handleError(_0x5405e4,_0x52f140){_0x52f140=_0x52f140||0x1f4;return function(_0x4b1ff){logger[_0xe524('0x2d')](_0x4b1ff[_0xe524('0x2e')]);if(_0x4b1ff[_0xe524('0x2f')]){delete _0x4b1ff[_0xe524('0x2f')];}_0x5405e4['status'](_0x52f140)[_0xe524('0x30')](_0x4b1ff);};}exports[_0xe524('0x31')]=function(_0x4a4e15,_0x5b7ded){var _0x20688e={},_0x376324={},_0x5b2fc3={'count':0x0,'rows':[]};var _0x31d4a7=_['map'](db[_0xe524('0x32')]['rawAttributes'],function(_0x315e56){return{'name':_0x315e56[_0xe524('0x33')],'type':_0x315e56[_0xe524('0x34')]['key']};});_0x376324[_0xe524('0x35')]=_['map'](_0x31d4a7,_0xe524('0x2f'));_0x376324[_0xe524('0x36')]=_[_0xe524('0x37')](_0x4a4e15['query']);_0x376324[_0xe524('0x38')]=_[_0xe524('0x39')](_0x376324['model'],_0x376324[_0xe524('0x36')]);_0x20688e[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x376324[_0xe524('0x35')],qs['fields'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3b')]));_0x20688e[_0xe524('0x3a')]=_0x20688e[_0xe524('0x3a')][_0xe524('0x3c')]?_0x20688e[_0xe524('0x3a')]:_0x376324[_0xe524('0x35')];if(!_0x4a4e15[_0xe524('0x36')]['hasOwnProperty'](_0xe524('0x3d'))){_0x20688e['limit']=qs[_0xe524('0x20')](_0x4a4e15[_0xe524('0x36')]['limit']);_0x20688e[_0xe524('0x1e')]=qs['offset'](_0x4a4e15[_0xe524('0x36')][_0xe524('0x1e')]);}_0x20688e[_0xe524('0x3e')]=qs[_0xe524('0x3f')](_0x4a4e15[_0xe524('0x36')][_0xe524('0x3f')]);_0x20688e[_0xe524('0x40')]=qs[_0xe524('0x38')](_['pick'](_0x4a4e15[_0xe524('0x36')],_0x376324[_0xe524('0x38')]),_0x31d4a7);if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x41')]){_0x20688e[_0xe524('0x40')]=_[_0xe524('0x42')](_0x20688e[_0xe524('0x40')],{'$or':_[_0xe524('0x43')](_0x31d4a7,function(_0x5d3ea1){if(_0x5d3ea1[_0xe524('0x34')]!==_0xe524('0x44')){var _0x2e4a13={};_0x2e4a13[_0x5d3ea1['name']]={'$like':'%'+_0x4a4e15[_0xe524('0x36')]['filter']+'%'};return _0x2e4a13;}})});}_0x20688e=_[_0xe524('0x42')]({},_0x20688e,_0x4a4e15[_0xe524('0x45')]);var _0x43c314={'where':_0x20688e[_0xe524('0x40')]};return db[_0xe524('0x32')][_0xe524('0x1f')](_0x43c314)[_0xe524('0x27')](function(_0x52cd0e){_0x5b2fc3[_0xe524('0x1f')]=_0x52cd0e;if(_0x4a4e15[_0xe524('0x36')][_0xe524('0x46')]){_0x20688e[_0xe524('0x47')]=[{'all':!![]}];}return db[_0xe524('0x32')][_0xe524('0x48')](_0x20688e);})['then'](function(_0xb694b9){_0x5b2fc3[_0xe524('0x49')]=_0xb694b9;return _0x5b2fc3;})[_0xe524('0x27')](respondWithFilteredResult(_0x5b7ded,_0x20688e))['catch'](handleError(_0x5b7ded,null));};exports[_0xe524('0x4a')]=function(_0x5209dc,_0x4e5d99){var _0x2b9b3b={'raw':!![],'where':{'id':_0x5209dc['params']['id']}},_0x33906d={};_0x33906d[_0xe524('0x35')]=_[_0xe524('0x37')](db[_0xe524('0x32')][_0xe524('0x4b')]);_0x33906d['query']=_['keys'](_0x5209dc[_0xe524('0x36')]);_0x33906d[_0xe524('0x38')]=_['intersection'](_0x33906d[_0xe524('0x35')],_0x33906d['query']);_0x2b9b3b[_0xe524('0x3a')]=_[_0xe524('0x39')](_0x33906d[_0xe524('0x35')],qs[_0xe524('0x3b')](_0x5209dc[_0xe524('0x36')][_0xe524('0x3b')]));_0x2b9b3b[_0xe524('0x3a')]=_0x2b9b3b[_0xe524('0x3a')][_0xe524('0x3c')]?_0x2b9b3b[_0xe524('0x3a')]:_0x33906d[_0xe524('0x35')];if(_0x5209dc[_0xe524('0x36')][_0xe524('0x46')]){_0x2b9b3b[_0xe524('0x47')]=[{'all':!![]}];}_0x2b9b3b=_[_0xe524('0x42')]({},_0x2b9b3b,_0x5209dc['options']);return db[_0xe524('0x32')]['find'](_0x2b9b3b)['then'](handleEntityNotFound(_0x4e5d99,null))[_0xe524('0x27')](respondWithResult(_0x4e5d99,null))['catch'](handleError(_0x4e5d99,null));};exports[_0xe524('0x4c')]=function(_0x15d7ee,_0x561107){return db[_0xe524('0x32')]['create'](_0x15d7ee['body'],{})[_0xe524('0x27')](function(_0x1e5687){var _0x203e71=_0x15d7ee['user']['get']({'plain':!![]});if(!_0x203e71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x203e71['role']==='user'){var _0x5477ca=_0x1e5687[_0xe524('0x29')]({'plain':!![]});var _0x2ce5c0='Reports';return db[_0xe524('0x4d')][_0xe524('0x4e')]({'where':{'name':_0x2ce5c0,'userProfileId':_0x203e71[_0xe524('0x4f')]},'raw':!![]})[_0xe524('0x27')](function(_0x2fa143){if(_0x2fa143&&_0x2fa143['autoAssociation']===0x0){return db[_0xe524('0x2b')][_0xe524('0x4c')]({'name':_0x5477ca[_0xe524('0x2f')],'resourceId':_0x5477ca['id'],'type':'DefaultReports','sectionId':_0x2fa143['id']},{})[_0xe524('0x27')](function(){return _0x1e5687;});}else{return _0x1e5687;}})['catch'](function(_0x12e5d0){logger[_0xe524('0x2d')](_0xe524('0x50'),_0x12e5d0);throw _0x12e5d0;});}return _0x1e5687;})[_0xe524('0x27')](respondWithResult(_0x561107,0xc9))[_0xe524('0x51')](handleError(_0x561107,null));};exports[_0xe524('0x52')]=function(_0x1cec31,_0x374450){if(_0x1cec31[_0xe524('0x53')]['id']){delete _0x1cec31[_0xe524('0x53')]['id'];}return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x1cec31['params']['id']}})['then'](handleEntityNotFound(_0x374450,null))['then'](saveUpdates(_0x1cec31[_0xe524('0x53')],null))[_0xe524('0x27')](respondWithResult(_0x374450,null))[_0xe524('0x51')](handleError(_0x374450,null));};exports[_0xe524('0x28')]=function(_0x45fb0d,_0xef3d2f){return db[_0xe524('0x32')][_0xe524('0x4e')]({'where':{'id':_0x45fb0d[_0xe524('0x54')]['id']}})[_0xe524('0x27')](handleEntityNotFound(_0xef3d2f,null))[_0xe524('0x27')](removeEntity(_0xef3d2f,null))['catch'](handleError(_0xef3d2f,null));};exports[_0xe524('0x55')]=function(_0x1f0567,_0x4a5f4a){var _0x53da86=0xa;var _0x54adbd=['join',_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x8a2c00={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':_0xe524('0x5a'),'MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x582fbb={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x4f58ff=function(_0x5d0507){return!_[_0xe524('0x63')]([_0xe524('0x64'),_0xe524('0x65'),_0xe524('0x66'),_0xe524('0x67')],_0x5d0507);};var _0x474ed4=function(_0x5135f0){if(!_0x5135f0||!_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0xc3ccfd='(',_0x5d3b9c=0x0;_0x5d3b9c<_0x5135f0[_0xe524('0x68')][_0xe524('0x3c')];_0x5d3b9c+=0x1){_0x5d3b9c>0x0&&(_0xc3ccfd+='\x20'+_0x5135f0[_0xe524('0x69')]+'\x20');_0xc3ccfd+=_0x5135f0['rules'][_0x5d3b9c]['group']?_0x474ed4(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6a')]):_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6b')]+'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c]['condition']+(_0x4f58ff(_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6c')])?'\x20'+_0x5135f0[_0xe524('0x68')][_0x5d3b9c][_0xe524('0x6d')]:'');}return _0xc3ccfd+')';};var _0x3ce098={'where':{'id':_0x1f0567[_0xe524('0x54')]['id']}},_0x22d06a,_0x35e6b2,_0x1e4b32,_0x27c55c,_0x7e5992;_0x3ce098=_['merge']({},_0x3ce098,_0x1f0567[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x3ce098)[_0xe524('0x27')](function(_0xeec885){if(_0xeec885){_0x22d06a=_0xeec885;return _0xeec885['getFields']();}return null;})[_0xe524('0x27')](function(_0x2341cf){if(_0x2341cf){if(!_0x2341cf[_0xe524('0x3c')]){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x35e6b2=_0x2341cf;return db[_0xe524('0x71')]['findAll']({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x245501){if(_0x245501){_0x1e4b32=_[_0xe524('0x72')](_0x245501,'id');var _0xce15f5;var _0x5ec07c=squel[_0xe524('0x73')]();_0x5ec07c['from'](_0x22d06a[_0xe524('0x74')]);for(var _0x2a88e2=0x0;_0x2a88e2<_0x35e6b2[_0xe524('0x3c')];_0x2a88e2+=0x1){_0xce15f5=_0x35e6b2[_0x2a88e2]['MetricId']?_0x1e4b32[_0x35e6b2[_0x2a88e2][_0xe524('0x75')]][_0xe524('0x76')]:_0x35e6b2[_0x2a88e2][_0xe524('0x6b')];_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x77')]?_[_0xe524('0x78')](_0x8a2c00[_0x35e6b2[_0x2a88e2]['function']],'%s',_0xce15f5):_0xce15f5;_0xce15f5=_0x35e6b2[_0x2a88e2][_0xe524('0x79')]?_[_0xe524('0x78')](_0x582fbb[_0x35e6b2[_0x2a88e2][_0xe524('0x79')]],'%s',_0xce15f5):_0xce15f5;if(_0x35e6b2[_0x2a88e2][_0xe524('0x7a')]){_0x5ec07c[_0xe524('0x6a')](_0xce15f5);}_0x35e6b2[_0x2a88e2]['orderBy']&&_0x5ec07c[_0xe524('0x3e')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7b')]===_0xe524('0x7c')?![]:!![]);_0x5ec07c[_0xe524('0x6b')](_0xce15f5,_0x35e6b2[_0x2a88e2][_0xe524('0x7d')]||_0xce15f5);}if(_0x22d06a[_0xe524('0x7e')]){_0x22d06a['joins']=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x7e')]);for(var _0x1beaa2=0x0;_0x1beaa2<_0x22d06a['joins'][_0xe524('0x3c')];_0x1beaa2+=0x1){if(_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['type']&&_[_0xe524('0x63')](_0x54adbd,_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')])&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')]&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2]['foreignTable']&&_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]){_0x5ec07c[_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x34')]](_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x22d06a[_0xe524('0x74')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x80')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x82')],_0x22d06a[_0xe524('0x7e')][_0x1beaa2][_0xe524('0x81')]));}}}if(_0x22d06a['conditions']){_0x22d06a[_0xe524('0x84')]=JSON[_0xe524('0x7f')](_0x22d06a[_0xe524('0x84')]);_0x5ec07c['where'](_0x474ed4(_0x22d06a[_0xe524('0x84')][_0xe524('0x6a')]));}_0x7e5992=_0x5ec07c['clone']();_0x5ec07c['limit'](_0x53da86);_0x5ec07c[_0xe524('0x1e')](0x0);logger['debug'](_0xe524('0x85'),_0x5ec07c['toString']());return dbH[_0xe524('0x86')][_0xe524('0x36')](_0x5ec07c[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')]['QueryTypes']['SELECT']});}})[_0xe524('0x27')](respondWithResult(_0x4a5f4a,null))[_0xe524('0x51')](handleError(_0x4a5f4a,null));};function runReport(_0x50eb96,_0x45c287,_0x449842){var _0x1f3ed1=_0x45c287['name'];var _0x19b063=0xa;var _0x140a4e=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x54385f={'SUM':'SUM(%s)','COUNT':_0xe524('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':_0xe524('0x5c'),'AVG':_0xe524('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1681c5={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':_0xe524('0x60'),'ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x50f5e3=function(_0x11298c){return!_[_0xe524('0x63')]([_0xe524('0x64'),'IS\x20NOT\x20NULL',_0xe524('0x66'),_0xe524('0x67')],_0x11298c);};var _0x5603d0=function(_0x2712ac){if(!_0x2712ac||!_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')]){return'';}for(var _0x32c9f6='(',_0x58d29e=0x0;_0x58d29e<_0x2712ac[_0xe524('0x68')][_0xe524('0x3c')];_0x58d29e+=0x1){_0x58d29e>0x0&&(_0x32c9f6+='\x20'+_0x2712ac[_0xe524('0x69')]+'\x20');_0x32c9f6+=_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]?_0x5603d0(_0x2712ac['rules'][_0x58d29e][_0xe524('0x6a')]):_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6b')]+'\x20'+_0x2712ac['rules'][_0x58d29e][_0xe524('0x6c')]+(_0x50f5e3(_0x2712ac[_0xe524('0x68')][_0x58d29e][_0xe524('0x6c')])?'\x20'+_0x2712ac['rules'][_0x58d29e]['value']:'');}return _0x32c9f6+')';};var _0x334164={'where':{'id':_0x50eb96['id']}},_0x512572,_0x903e24,_0x4964c3,_0x2dc3f5,_0x246c62;_0x334164=_['merge']({},_0x334164,_0x449842);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x334164)['then'](function(_0x482b72){if(_0x482b72){_0x512572=_0x482b72;return _0x482b72[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x1b3e03){if(_0x1b3e03){if(!_0x1b3e03['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x903e24=_0x1b3e03;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x57501c){if(_0x57501c){_0x4964c3=_[_0xe524('0x72')](_0x57501c,'id');var _0x3a2834;var _0x4c7f45=squel['select']();_0x4c7f45[_0xe524('0x8c')](_0x512572[_0xe524('0x74')]);for(var _0x41f842=0x0;_0x41f842<_0x903e24[_0xe524('0x3c')];_0x41f842+=0x1){_0x3a2834=_0x903e24[_0x41f842]['MetricId']?_0x4964c3[_0x903e24[_0x41f842][_0xe524('0x75')]][_0xe524('0x76')]:_0x903e24[_0x41f842]['field'];_0x3a2834=_0x903e24[_0x41f842]['function']?_[_0xe524('0x78')](_0x54385f[_0x903e24[_0x41f842][_0xe524('0x77')]],'%s',_0x3a2834):_0x3a2834;_0x3a2834=_0x903e24[_0x41f842][_0xe524('0x79')]?_[_0xe524('0x78')](_0x1681c5[_0x903e24[_0x41f842][_0xe524('0x79')]],'%s',_0x3a2834):_0x3a2834;if(_0x903e24[_0x41f842][_0xe524('0x7a')]){_0x4c7f45['group'](_0x3a2834);}_0x903e24[_0x41f842]['orderBy']&&_0x4c7f45[_0xe524('0x3e')](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x4c7f45['field'](_0x3a2834,_0x903e24[_0x41f842][_0xe524('0x7d')]||_0x3a2834);}if(_0x512572[_0xe524('0x7e')]){_0x512572[_0xe524('0x7e')]=JSON[_0xe524('0x7f')](_0x512572[_0xe524('0x7e')]);for(var _0xa820a1=0x0;_0xa820a1<_0x512572['joins']['length'];_0xa820a1+=0x1){if(_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x140a4e,_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x34')])&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x80')]&&_0x512572[_0xe524('0x7e')][_0xa820a1]['foreignTable']&&_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]){_0x4c7f45[_0x512572[_0xe524('0x7e')][_0xa820a1]['type']](_0x512572['joins'][_0xa820a1][_0xe524('0x82')],null,util[_0xe524('0x79')](_0xe524('0x83'),_0x512572[_0xe524('0x74')],_0x512572['joins'][_0xa820a1][_0xe524('0x80')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x82')],_0x512572[_0xe524('0x7e')][_0xa820a1][_0xe524('0x81')]));}}}if(_0x512572['conditions']){_0x512572[_0xe524('0x84')]=JSON['parse'](_0x512572[_0xe524('0x84')]);_0x4c7f45[_0xe524('0x40')](_0x5603d0(_0x512572['conditions'][_0xe524('0x6a')]));}_0x246c62=_0x4c7f45[_0xe524('0x8d')]();_0x4c7f45['limit'](_0x19b063);_0x4c7f45[_0xe524('0x1e')](0x0);return;}})['then'](function(){if(_0x45c287[_0xe524('0x8e')]===_0xe524('0x8f')){return null;}var _0x1be681=_[_0xe524('0x42')](_0x45c287,{'name':_0x45c287[_0xe524('0x90')]||_0x45c287[_0xe524('0x2f')]||_0x512572[_0xe524('0x2f')],'basename':_0x1f3ed1,'savename':util[_0xe524('0x79')]('%s-%s.%s',_0x45c287[_0xe524('0x2f')]||_0x512572['name'],require('randomstring')[_0xe524('0x91')](0x4),_0x45c287['output']||_0xe524('0x92')),'reportId':_0x512572['id'],'reportType':_0xe524('0x93')});return db[_0xe524('0x94')][_0xe524('0x4c')](_0x1be681,{'raw':!![]});})[_0xe524('0x27')](function(_0x26c802){if(_0x512572['table']==='cdr'){_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x95'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}else{_0x246c62[_0xe524('0x40')](_0x512572[_0xe524('0x74')]+_0xe524('0x98'),_0x45c287[_0xe524('0x96')],_0x45c287[_0xe524('0x97')]);}if(_0x26c802){logger['info'](_0xe524('0x99'),_0x246c62[_0xe524('0x87')]());require(_0xe524('0x9a'))[_0xe524('0x9b')](path[_0xe524('0x88')](__dirname,_0xe524('0x9c'),_0x26c802['output']),[_0x26c802['id'],_0x246c62[_0xe524('0x87')](),path[_0xe524('0x88')](__dirname,_0xe524('0x9d'),_0x26c802[_0xe524('0x9e')]),_0x1f3ed1]);return _0x26c802;}else{var _0x84bbd7=squel[_0xe524('0x73')]();_0x84bbd7[_0xe524('0x8c')]('('+_0x246c62[_0xe524('0x87')]()+')','countTable');_0x84bbd7['field']('COUNT(*)',_0xe524('0x1f'));_0x246c62[_0xe524('0x20')](_0x45c287['limit']||_0x19b063);_0x246c62[_0xe524('0x1e')](_0x45c287[_0xe524('0x1e')]||0x0);return dbH['sequelize'][_0xe524('0x36')](_0x84bbd7[_0xe524('0x87')](),{'type':dbH['sequelize'][_0xe524('0x9f')][_0xe524('0xa0')]})[_0xe524('0x27')](function(_0x542182){if(!_0x542182[_0xe524('0x3c')]){_0x2dc3f5=0x0;}else{_0x2dc3f5=_0x542182[0x0][_0xe524('0x1f')]||0x0;}return dbH[_0xe524('0x86')]['query'](_0x246c62[_0xe524('0x87')](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});})['then'](function(_0x5e6a3d){return{'rows':_0x5e6a3d||[],'count':_0x2dc3f5};});}});}exports[_0xe524('0xa1')]=function(_0x33d066,_0x3ea495){return runReport(_0x33d066[_0xe524('0x54')],_0x33d066[_0xe524('0x36')],_0x33d066[_0xe524('0x45')])[_0xe524('0x27')](respondWithResult(_0x3ea495,null))[_0xe524('0x51')](handleError(_0x3ea495,null));};exports[_0xe524('0xa2')]=runReport;exports[_0xe524('0x36')]=function(_0x4505de,_0x292f14){var _0x2d24c1=0xa;var _0x483307=[_0xe524('0x88'),_0xe524('0x56'),_0xe524('0x57'),_0xe524('0x58')];var _0x280022={'SUM':_0xe524('0xa3'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xe524('0x5b'),'MIN':'MIN(%s)','AVG':_0xe524('0x89'),'GROUP_CONCAT':_0xe524('0xa4'),'GROUP_CONCAT ASC':_0xe524('0x8a'),'GROUP_CONCAT DESC':_0xe524('0x5d')};var _0x46d6da={'SEC_TO_TIME':_0xe524('0x5e'),'DATE':_0xe524('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xe524('0x61'),'UNIX_TIMESTAMP':_0xe524('0x62')};var _0x39998a=function(_0x107de8){return!_['includes']([_0xe524('0x64'),_0xe524('0x65'),'IS\x20EMPTY',_0xe524('0x67')],_0x107de8);};var _0x458e14=function(_0x4e0886){if(!_0x4e0886||!_0x4e0886['rules'][_0xe524('0x3c')]){return'';}for(var _0x3639cf='(',_0x575c14=0x0;_0x575c14<_0x4e0886['rules'][_0xe524('0x3c')];_0x575c14+=0x1){_0x575c14>0x0&&(_0x3639cf+='\x20'+_0x4e0886['operator']+'\x20');_0x3639cf+=_0x4e0886['rules'][_0x575c14]['group']?_0x458e14(_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6a')]):_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6b')]+'\x20'+_0x4e0886['rules'][_0x575c14]['condition']+(_0x39998a(_0x4e0886['rules'][_0x575c14][_0xe524('0x6c')])?'\x20'+_0x4e0886[_0xe524('0x68')][_0x575c14][_0xe524('0x6d')]:'');}return _0x3639cf+')';};var _0x289720={'where':{'id':_0x4505de[_0xe524('0x54')]['id']}},_0x3fb45c,_0x3362fe,_0x119684,_0x19e4fd,_0x4b4349;_0x289720=_[_0xe524('0x42')]({},_0x289720,_0x4505de[_0xe524('0x45')]);return db[_0xe524('0x32')][_0xe524('0x4e')](_0x289720)[_0xe524('0x27')](function(_0x404a49){if(_0x404a49){_0x3fb45c=_0x404a49;return _0x404a49[_0xe524('0x8b')]();}return null;})[_0xe524('0x27')](function(_0x8e8087){if(_0x8e8087){if(!_0x8e8087['length']){throw new db[(_0xe524('0x6e'))][(_0xe524('0x6f'))](_0xe524('0x70'),0x193);}_0x3362fe=_0x8e8087;return db[_0xe524('0x71')][_0xe524('0x48')]({'raw':!![]});}return null;})[_0xe524('0x27')](function(_0x113a54){if(_0x113a54){_0x119684=_[_0xe524('0x72')](_0x113a54,'id');var _0x4ebca4;var _0x40043c=squel[_0xe524('0x73')]();_0x40043c[_0xe524('0x8c')](_0x3fb45c[_0xe524('0x74')]);for(var _0x19a773=0x0;_0x19a773<_0x3362fe[_0xe524('0x3c')];_0x19a773+=0x1){_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x75')]?_0x119684[_0x3362fe[_0x19a773][_0xe524('0x75')]][_0xe524('0x76')]:_0x3362fe[_0x19a773][_0xe524('0x6b')];_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x77')]?_[_0xe524('0x78')](_0x280022[_0x3362fe[_0x19a773]['function']],'%s',_0x4ebca4):_0x4ebca4;_0x4ebca4=_0x3362fe[_0x19a773][_0xe524('0x79')]?_[_0xe524('0x78')](_0x46d6da[_0x3362fe[_0x19a773][_0xe524('0x79')]],'%s',_0x4ebca4):_0x4ebca4;if(_0x3362fe[_0x19a773]['groupBy']){_0x40043c['group'](_0x4ebca4);}_0x3362fe[_0x19a773][_0xe524('0x7b')]&&_0x40043c[_0xe524('0x3e')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7b')]==='DESC'?![]:!![]);_0x40043c[_0xe524('0x6b')](_0x4ebca4,_0x3362fe[_0x19a773][_0xe524('0x7d')]||_0x4ebca4);}if(_0x3fb45c[_0xe524('0x7e')]){_0x3fb45c['joins']=JSON['parse'](_0x3fb45c[_0xe524('0x7e')]);for(var _0x2a85e5=0x0;_0x2a85e5<_0x3fb45c[_0xe524('0x7e')]['length'];_0x2a85e5+=0x1){if(_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]&&_[_0xe524('0x63')](_0x483307,_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')])&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')]&&_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')]&&_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]){_0x40043c[_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x34')]](_0x3fb45c['joins'][_0x2a85e5][_0xe524('0x82')],null,util[_0xe524('0x79')]('%s.%s\x20=\x20%s.%s',_0x3fb45c[_0xe524('0x74')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x80')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x82')],_0x3fb45c[_0xe524('0x7e')][_0x2a85e5][_0xe524('0x81')]));}}}if(_0x3fb45c[_0xe524('0x84')]){_0x3fb45c[_0xe524('0x84')]=JSON['parse'](_0x3fb45c['conditions']);_0x40043c[_0xe524('0x40')](_0x458e14(_0x3fb45c[_0xe524('0x84')][_0xe524('0x6a')]));}_0x4b4349=_0x40043c[_0xe524('0x8d')]();_0x40043c[_0xe524('0x20')](_0x2d24c1);_0x40043c[_0xe524('0x1e')](0x0);logger[_0xe524('0xa5')]('Limited\x20Query:',_0x40043c['toString']());return dbH[_0xe524('0x86')]['query'](_0x40043c['toString'](),{'type':dbH[_0xe524('0x86')][_0xe524('0x9f')][_0xe524('0xa0')]});}})[_0xe524('0x27')](function(){return{'sql':_0x4b4349[_0xe524('0x87')]()};})[_0xe524('0x27')](respondWithResult(_0x292f14,null))['catch'](handleError(_0x292f14,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 3af6ec9..5d605a3 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 _0xbee7=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xbee7,0xc3));var _0x7bee=function(_0x117bdb,_0x44a377){_0x117bdb=_0x117bdb-0x0;var _0x14cffa=_0xbee7[_0x117bdb];return _0x14cffa;};'use strict';var _=require(_0x7bee('0x0'));var util=require(_0x7bee('0x1'));var logger=require(_0x7bee('0x2'))(_0x7bee('0x3'));var moment=require(_0x7bee('0x4'));var BPromise=require(_0x7bee('0x5'));var rp=require(_0x7bee('0x6'));var fs=require('fs');var path=require(_0x7bee('0x7'));var rimraf=require(_0x7bee('0x8'));var config=require(_0x7bee('0x9'));var attributes=require(_0x7bee('0xa'));module[_0x7bee('0xb')]=function(_0x43c57f,_0x3acc28){return _0x43c57f[_0x7bee('0xc')](_0x7bee('0xd'),attributes,{'tableName':_0x7bee('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e1b=['./analyticDefaultReport.attributes','exports','analytics_default_reports','lodash','util','api','moment','request-promise','path','../../config/environment'];(function(_0x45977c,_0x7eaed0){var _0x399413=function(_0x41cc76){while(--_0x41cc76){_0x45977c['push'](_0x45977c['shift']());}};_0x399413(++_0x7eaed0);}(_0x6e1b,0x1ed));var _0xb6e1=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x6e1b[_0x440917];return _0x5e906b;};'use strict';var _=require(_0xb6e1('0x0'));var util=require(_0xb6e1('0x1'));var logger=require('../../config/logger')(_0xb6e1('0x2'));var moment=require(_0xb6e1('0x3'));var BPromise=require('bluebird');var rp=require(_0xb6e1('0x4'));var fs=require('fs');var path=require(_0xb6e1('0x5'));var rimraf=require('rimraf');var config=require(_0xb6e1('0x6'));var attributes=require(_0xb6e1('0x7'));module[_0xb6e1('0x8')]=function(_0x1970d1,_0x370486){return _0x1970d1['define']('AnalyticDefaultReport',attributes,{'tableName':_0xb6e1('0x9'),'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 55ff1ee..89f5c72 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 _0x8ec7=['info','catch','util','bluebird','randomstring','rpc','../../config/environment','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message'];(function(_0x39aade,_0x1389ca){var _0x4a601c=function(_0x1f3949){while(--_0x1f3949){_0x39aade['push'](_0x39aade['shift']());}};_0x4a601c(++_0x1389ca);}(_0x8ec7,0x188));var _0x78ec=function(_0x49bdc4,_0x1e2507){_0x49bdc4=_0x49bdc4-0x0;var _0x1f7437=_0x8ec7[_0x49bdc4];return _0x1f7437;};'use strict';var _=require('lodash');var util=require(_0x78ec('0x0'));var moment=require('moment');var BPromise=require(_0x78ec('0x1'));var rs=require(_0x78ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78ec('0x3'));var config=require(_0x78ec('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x579f49,_0x476192,_0x2829a7){return new BPromise(function(_0x5903a1,_0x3be7f8){return client[_0x78ec('0x5')](_0x579f49,_0x2829a7)[_0x78ec('0x6')](function(_0x4446c8){logger['info'](_0x78ec('0x7'),_0x476192,_0x78ec('0x8'));logger['debug']('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x476192,'request\x20sent',JSON[_0x78ec('0x9')](_0x4446c8));if(_0x4446c8['error']){if(_0x4446c8['error'][_0x78ec('0xa')]===0x1f4){logger[_0x78ec('0xb')](_0x78ec('0x7'),_0x476192,_0x4446c8[_0x78ec('0xb')]['message']);return _0x3be7f8(_0x4446c8['error'][_0x78ec('0xc')]);}logger[_0x78ec('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x476192,_0x4446c8[_0x78ec('0xb')][_0x78ec('0xc')]);return _0x5903a1(_0x4446c8[_0x78ec('0xb')][_0x78ec('0xc')]);}else{logger[_0x78ec('0xd')](_0x78ec('0x7'),_0x476192,_0x78ec('0x8'));_0x5903a1(_0x4446c8['result'][_0x78ec('0xc')]);}})[_0x78ec('0xe')](function(_0x52ad13){logger[_0x78ec('0xb')](_0x78ec('0x7'),_0x476192,_0x52ad13);_0x3be7f8(_0x52ad13);});});} \ No newline at end of file +var _0x5d4f=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5b157d,_0x3cf94f){var _0x4c3288=function(_0x2856a0){while(--_0x2856a0){_0x5b157d['push'](_0x5b157d['shift']());}};_0x4c3288(++_0x3cf94f);}(_0x5d4f,0x117));var _0xf5d4=function(_0x1501e6,_0x4f9218){_0x1501e6=_0x1501e6-0x0;var _0x3b7199=_0x5d4f[_0x1501e6];return _0x3b7199;};'use strict';var _=require(_0xf5d4('0x0'));var util=require(_0xf5d4('0x1'));var moment=require(_0xf5d4('0x2'));var BPromise=require(_0xf5d4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf5d4('0x4'));var db=require(_0xf5d4('0x5'))['db'];var utils=require(_0xf5d4('0x6'));var logger=require('../../config/logger')(_0xf5d4('0x7'));var config=require(_0xf5d4('0x8'));var jayson=require(_0xf5d4('0x9'));var client=jayson[_0xf5d4('0xa')][_0xf5d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38fa79,_0x61386c,_0x550e6b){return new BPromise(function(_0x2b879f,_0x51be85){return client['request'](_0x38fa79,_0x550e6b)[_0xf5d4('0xc')](function(_0x280b01){logger[_0xf5d4('0xd')](_0xf5d4('0xe'),_0x61386c,'request\x20sent');logger[_0xf5d4('0xf')](_0xf5d4('0x10'),_0x61386c,_0xf5d4('0x11'),JSON[_0xf5d4('0x12')](_0x280b01));if(_0x280b01[_0xf5d4('0x13')]){if(_0x280b01['error']['code']===0x1f4){logger[_0xf5d4('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x61386c,_0x280b01[_0xf5d4('0x13')][_0xf5d4('0x14')]);return _0x51be85(_0x280b01[_0xf5d4('0x13')][_0xf5d4('0x14')]);}logger[_0xf5d4('0x13')](_0xf5d4('0xe'),_0x61386c,_0x280b01[_0xf5d4('0x13')][_0xf5d4('0x14')]);return _0x2b879f(_0x280b01[_0xf5d4('0x13')][_0xf5d4('0x14')]);}else{logger[_0xf5d4('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x61386c,_0xf5d4('0x11'));_0x2b879f(_0x280b01[_0xf5d4('0x15')]['message']);}})[_0xf5d4('0x16')](function(_0x4051f5){logger['error'](_0xf5d4('0xe'),_0x61386c,_0x4051f5);_0x51be85(_0x4051f5);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 9ae9283..956d80b 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 _0x44e9=['isAuthenticated','index','get','/:id','show','preview','/:id/run','run','/:id/query','query','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x2855e6,_0xffa5d3){var _0x18b463=function(_0x94273b){while(--_0x94273b){_0x2855e6['push'](_0x2855e6['shift']());}};_0x18b463(++_0xffa5d3);}(_0x44e9,0xf1));var _0x944e=function(_0x392c41,_0x3478fe){_0x392c41=_0x392c41-0x0;var _0x3ccc2f=_0x44e9[_0x392c41];return _0x3ccc2f;};'use strict';var multer=require(_0x944e('0x0'));var util=require(_0x944e('0x1'));var path=require(_0x944e('0x2'));var timeout=require(_0x944e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x944e('0x4'));var auth=require(_0x944e('0x5'));var interaction=require(_0x944e('0x6'));var config=require(_0x944e('0x7'));var controller=require(_0x944e('0x8'));router['get']('/',auth[_0x944e('0x9')](),controller[_0x944e('0xa')]);router[_0x944e('0xb')](_0x944e('0xc'),auth['isAuthenticated'](),controller[_0x944e('0xd')]);router['get']('/:id/preview',auth[_0x944e('0x9')](),controller[_0x944e('0xe')]);router[_0x944e('0xb')](_0x944e('0xf'),auth[_0x944e('0x9')](),controller[_0x944e('0x10')]);router[_0x944e('0xb')](_0x944e('0x11'),auth['isAuthenticated'](),controller[_0x944e('0x12')]);router[_0x944e('0x13')]('/',auth[_0x944e('0x9')](),controller[_0x944e('0x14')]);router[_0x944e('0x15')](_0x944e('0xc'),auth[_0x944e('0x9')](),controller['update']);router[_0x944e('0x16')](_0x944e('0xc'),auth[_0x944e('0x9')](),controller[_0x944e('0x17')]);module[_0x944e('0x18')]=router; \ No newline at end of file +var _0xf4e6=['post','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0xf4e6,0xd5));var _0x6f4e=function(_0x4914ad,_0x551a18){_0x4914ad=_0x4914ad-0x0;var _0x3cd61f=_0xf4e6[_0x4914ad];return _0x3cd61f;};'use strict';var multer=require('multer');var util=require(_0x6f4e('0x0'));var path=require(_0x6f4e('0x1'));var timeout=require(_0x6f4e('0x2'));var express=require('express');var router=express[_0x6f4e('0x3')]();var fs_extra=require(_0x6f4e('0x4'));var auth=require(_0x6f4e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6f4e('0x6'));var controller=require(_0x6f4e('0x7'));router[_0x6f4e('0x8')]('/',auth[_0x6f4e('0x9')](),controller[_0x6f4e('0xa')]);router[_0x6f4e('0x8')](_0x6f4e('0xb'),auth[_0x6f4e('0x9')](),controller['show']);router['get'](_0x6f4e('0xc'),auth['isAuthenticated'](),controller[_0x6f4e('0xd')]);router['get'](_0x6f4e('0xe'),auth[_0x6f4e('0x9')](),controller[_0x6f4e('0xf')]);router[_0x6f4e('0x8')]('/:id/query',auth[_0x6f4e('0x9')](),controller[_0x6f4e('0x10')]);router[_0x6f4e('0x11')]('/',auth[_0x6f4e('0x9')](),controller['create']);router[_0x6f4e('0x12')](_0x6f4e('0xb'),auth['isAuthenticated'](),controller[_0x6f4e('0x13')]);router[_0x6f4e('0x14')](_0x6f4e('0xb'),auth[_0x6f4e('0x9')](),controller[_0x6f4e('0x15')]);module[_0x6f4e('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 309c5cf..ad5dd49 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 _0x11cd=['pdf','xlsx','csv','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM'];(function(_0x32c586,_0x235e02){var _0x241395=function(_0xf85597){while(--_0xf85597){_0x32c586['push'](_0x32c586['shift']());}};_0x241395(++_0x235e02);}(_0x11cd,0x188));var _0xd11c=function(_0x14b33b,_0x330de8){_0x14b33b=_0x14b33b-0x0;var _0x27f151=_0x11cd[_0x14b33b];return _0x27f151;};'use strict';var Sequelize=require(_0xd11c('0x0'));var moment=require(_0xd11c('0x1'));module['exports']={'name':{'type':Sequelize[_0xd11c('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xd11c('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xd11c('0x3')]('csv',_0xd11c('0x4'),_0xd11c('0x5')),'allowNull':![],'defaultValue':_0xd11c('0x6')},'savename':{'type':Sequelize[_0xd11c('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd11c('0x7')]},'endDate':{'type':Sequelize[_0xd11c('0x7')]},'status':{'type':Sequelize[_0xd11c('0x2')],'defaultValue':_0xd11c('0x8')},'type':{'type':Sequelize[_0xd11c('0x3')](_0xd11c('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0xd11c('0x9')},'reportId':{'type':Sequelize[_0xd11c('0xa')](0xb)[_0xd11c('0xb')]},'reportType':{'type':Sequelize[_0xd11c('0x2')]}}; \ No newline at end of file +var _0xb78a=['INTEGER','moment','exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb78a,0x9b));var _0xab78=function(_0x2f42d3,_0x362e7a){_0x2f42d3=_0x2f42d3-0x0;var _0x25a67e=_0xb78a[_0x2f42d3];return _0x25a67e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xab78('0x0'));module[_0xab78('0x1')]={'name':{'type':Sequelize[_0xab78('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xab78('0x3')](_0xab78('0x4'),_0xab78('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0xab78('0x4')},'savename':{'type':Sequelize[_0xab78('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xab78('0x6')]},'endDate':{'type':Sequelize[_0xab78('0x6')]},'status':{'type':Sequelize[_0xab78('0x2')],'defaultValue':_0xab78('0x7')},'type':{'type':Sequelize['ENUM'](_0xab78('0x8'),_0xab78('0x9')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xab78('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 701f565..1f52966 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 _0xdc9d=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','rows','show','params','rawAttributes','include','catch','create','user','userProfileId','autoAssociation','body','find','basename','savename','output','existsSync','root','ValidationError','Report\x20not\x20found\x20or\x20empty','download','join','server/files/reports','format','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','key','model','query','keys','filters','intersection','attributes'];(function(_0x5aad7d,_0x13ba89){var _0x2defb1=function(_0x345622){while(--_0x345622){_0x5aad7d['push'](_0x5aad7d['shift']());}};_0x2defb1(++_0x13ba89);}(_0xdc9d,0xe2));var _0xddc9=function(_0x4071b7,_0x4ff0ac){_0x4071b7=_0x4071b7-0x0;var _0x58701c=_0xdc9d[_0x4071b7];return _0x58701c;};'use strict';var emlformat=require(_0xddc9('0x0'));var rimraf=require(_0xddc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xddc9('0x2'));var rp=require(_0xddc9('0x3'));var moment=require(_0xddc9('0x4'));var BPromise=require(_0xddc9('0x5'));var Mustache=require('mustache');var util=require(_0xddc9('0x6'));var path=require(_0xddc9('0x7'));var sox=require(_0xddc9('0x8'));var csv=require(_0xddc9('0x9'));var ejs=require(_0xddc9('0xa'));var fs=require('fs');var fs_extra=require(_0xddc9('0xb'));var _=require(_0xddc9('0xc'));var squel=require('squel');var crypto=require(_0xddc9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xddc9('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddc9('0xf'));var Redis=require(_0xddc9('0x10'));var authService=require(_0xddc9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddc9('0x12'));var logger=require(_0xddc9('0x13'))(_0xddc9('0x14'));var utils=require(_0xddc9('0x15'));var config=require(_0xddc9('0x16'));var licenseUtil=require(_0xddc9('0x17'));var db=require(_0xddc9('0x18'))['db'];function respondWithStatusCode(_0x400c77,_0x7219cc){_0x7219cc=_0x7219cc||0xcc;return function(_0x24ea24){if(_0x24ea24){return _0x400c77[_0xddc9('0x19')](_0x7219cc);}return _0x400c77['status'](_0x7219cc)[_0xddc9('0x1a')]();};}function respondWithResult(_0x323f3f,_0x29cd62){_0x29cd62=_0x29cd62||0xc8;return function(_0x16b790){if(_0x16b790){return _0x323f3f[_0xddc9('0x1b')](_0x29cd62)[_0xddc9('0x1c')](_0x16b790);}};}function respondWithFilteredResult(_0x3a1ba3,_0x5a4950){return function(_0x3befdd){if(_0x3befdd){var _0x11c9ef=typeof _0x5a4950['offset']===_0xddc9('0x1d')&&typeof _0x5a4950['limit']===_0xddc9('0x1d');var _0x505493=_0x3befdd[_0xddc9('0x1e')];var _0xbc2a4c=_0x11c9ef?0x0:_0x5a4950[_0xddc9('0x1f')];var _0x1c362a=_0x11c9ef?_0x3befdd[_0xddc9('0x1e')]:_0x5a4950[_0xddc9('0x1f')]+_0x5a4950[_0xddc9('0x20')];var _0x548dcf;if(_0x1c362a>=_0x505493){_0x1c362a=_0x505493;_0x548dcf=0xc8;}else{_0x548dcf=0xce;}_0x3a1ba3[_0xddc9('0x1b')](_0x548dcf);return _0x3a1ba3['set']('Content-Range',_0xbc2a4c+'-'+_0x1c362a+'/'+_0x505493)[_0xddc9('0x1c')](_0x3befdd);}return null;};}function patchUpdates(_0x3de9e1){return function(_0x49cbd8){try{jsonpatch[_0xddc9('0x21')](_0x49cbd8,_0x3de9e1,!![]);}catch(_0x15877d){return BPromise[_0xddc9('0x22')](_0x15877d);}return _0x49cbd8[_0xddc9('0x23')]();};}function saveUpdates(_0x422c16,_0x3af325){return function(_0x178ece){if(_0x178ece){return _0x178ece[_0xddc9('0x24')](_0x422c16)[_0xddc9('0x25')](function(_0x52b4c0){return _0x52b4c0;});}return null;};}function removeEntity(_0x5561ae,_0x171c3c){return function(_0x1a2c60){if(_0x1a2c60){return _0x1a2c60[_0xddc9('0x26')]()['then'](function(){var _0x5d334a=_0x1a2c60[_0xddc9('0x27')]({'plain':!![]});var _0x187aa9=_0xddc9('0x28');return db[_0xddc9('0x29')][_0xddc9('0x26')]({'where':{'type':_0x187aa9,'resourceId':_0x5d334a['id']}})[_0xddc9('0x25')](function(){return _0x1a2c60;});})['then'](function(){_0x5561ae[_0xddc9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c1a1d,_0xdfc394){return function(_0x393522){if(!_0x393522){_0x4c1a1d['sendStatus'](0x194);}return _0x393522;};}function handleError(_0x132ee5,_0x2beb39){_0x2beb39=_0x2beb39||0x1f4;return function(_0x4001c5){logger[_0xddc9('0x2a')](_0x4001c5[_0xddc9('0x2b')]);if(_0x4001c5[_0xddc9('0x2c')]){delete _0x4001c5[_0xddc9('0x2c')];}_0x132ee5['status'](_0x2beb39)[_0xddc9('0x2d')](_0x4001c5);};}exports[_0xddc9('0x2e')]=function(_0x5e55f2,_0x5cc0dc){var _0x3fe148={},_0xa65af={},_0x47666e={'count':0x0,'rows':[]};var _0x41e097=_[_0xddc9('0x2f')](db[_0xddc9('0x30')]['rawAttributes'],function(_0x477eda){return{'name':_0x477eda['fieldName'],'type':_0x477eda['type'][_0xddc9('0x31')]};});_0xa65af[_0xddc9('0x32')]=_[_0xddc9('0x2f')](_0x41e097,_0xddc9('0x2c'));_0xa65af[_0xddc9('0x33')]=_[_0xddc9('0x34')](_0x5e55f2[_0xddc9('0x33')]);_0xa65af[_0xddc9('0x35')]=_[_0xddc9('0x36')](_0xa65af[_0xddc9('0x32')],_0xa65af['query']);_0x3fe148[_0xddc9('0x37')]=_['intersection'](_0xa65af['model'],qs[_0xddc9('0x38')](_0x5e55f2[_0xddc9('0x33')][_0xddc9('0x38')]));_0x3fe148['attributes']=_0x3fe148[_0xddc9('0x37')][_0xddc9('0x39')]?_0x3fe148[_0xddc9('0x37')]:_0xa65af[_0xddc9('0x32')];if(!_0x5e55f2['query'][_0xddc9('0x3a')](_0xddc9('0x3b'))){_0x3fe148[_0xddc9('0x20')]=qs['limit'](_0x5e55f2[_0xddc9('0x33')][_0xddc9('0x20')]);_0x3fe148[_0xddc9('0x1f')]=qs['offset'](_0x5e55f2[_0xddc9('0x33')][_0xddc9('0x1f')]);}_0x3fe148[_0xddc9('0x3c')]=qs[_0xddc9('0x3d')](_0x5e55f2['query'][_0xddc9('0x3d')]);_0x3fe148[_0xddc9('0x3e')]=qs[_0xddc9('0x35')](_[_0xddc9('0x3f')](_0x5e55f2[_0xddc9('0x33')],_0xa65af[_0xddc9('0x35')]),_0x41e097);if(_0x5e55f2[_0xddc9('0x33')][_0xddc9('0x40')]){_0x3fe148[_0xddc9('0x3e')]=_[_0xddc9('0x41')](_0x3fe148[_0xddc9('0x3e')],{'$or':_[_0xddc9('0x2f')](_0x41e097,function(_0x33ba7d){if(_0x33ba7d[_0xddc9('0x42')]!=='VIRTUAL'){var _0x228873={};_0x228873[_0x33ba7d[_0xddc9('0x2c')]]={'$like':'%'+_0x5e55f2['query']['filter']+'%'};return _0x228873;}})});}_0x3fe148=_[_0xddc9('0x41')]({},_0x3fe148,_0x5e55f2[_0xddc9('0x43')]);var _0x21debd={'where':_0x3fe148[_0xddc9('0x3e')]};return db['AnalyticExtractedReport'][_0xddc9('0x1e')](_0x21debd)[_0xddc9('0x25')](function(_0x4808d9){_0x47666e['count']=_0x4808d9;if(_0x5e55f2['query'][_0xddc9('0x44')]){_0x3fe148['include']=[{'all':!![]}];}return db[_0xddc9('0x30')]['findAll'](_0x3fe148);})[_0xddc9('0x25')](function(_0x1aa919){_0x47666e[_0xddc9('0x45')]=_0x1aa919;return _0x47666e;})[_0xddc9('0x25')](respondWithFilteredResult(_0x5cc0dc,_0x3fe148))['catch'](handleError(_0x5cc0dc,null));};exports[_0xddc9('0x46')]=function(_0x4dfbd3,_0x29c7d5){var _0xc6ddc8={'raw':!![],'where':{'id':_0x4dfbd3[_0xddc9('0x47')]['id']}},_0x2e2dce={};_0x2e2dce[_0xddc9('0x32')]=_[_0xddc9('0x34')](db['AnalyticExtractedReport'][_0xddc9('0x48')]);_0x2e2dce[_0xddc9('0x33')]=_[_0xddc9('0x34')](_0x4dfbd3[_0xddc9('0x33')]);_0x2e2dce['filters']=_[_0xddc9('0x36')](_0x2e2dce['model'],_0x2e2dce[_0xddc9('0x33')]);_0xc6ddc8[_0xddc9('0x37')]=_[_0xddc9('0x36')](_0x2e2dce['model'],qs[_0xddc9('0x38')](_0x4dfbd3['query'][_0xddc9('0x38')]));_0xc6ddc8[_0xddc9('0x37')]=_0xc6ddc8[_0xddc9('0x37')]['length']?_0xc6ddc8['attributes']:_0x2e2dce[_0xddc9('0x32')];if(_0x4dfbd3[_0xddc9('0x33')][_0xddc9('0x44')]){_0xc6ddc8[_0xddc9('0x49')]=[{'all':!![]}];}_0xc6ddc8=_['merge']({},_0xc6ddc8,_0x4dfbd3[_0xddc9('0x43')]);return db[_0xddc9('0x30')]['find'](_0xc6ddc8)['then'](handleEntityNotFound(_0x29c7d5,null))[_0xddc9('0x25')](respondWithResult(_0x29c7d5,null))[_0xddc9('0x4a')](handleError(_0x29c7d5,null));};exports['create']=function(_0x57b2c4,_0x386144){return db[_0xddc9('0x30')][_0xddc9('0x4b')](_0x57b2c4['body'],{})[_0xddc9('0x25')](function(_0x45394e){var _0x432d8c=_0x57b2c4[_0xddc9('0x4c')]['get']({'plain':!![]});if(!_0x432d8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x432d8c['role']===_0xddc9('0x4c')){var _0x25eb41=_0x45394e[_0xddc9('0x27')]({'plain':!![]});var _0x1179bd=_0xddc9('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1179bd,'userProfileId':_0x432d8c[_0xddc9('0x4d')]},'raw':!![]})[_0xddc9('0x25')](function(_0x56743e){if(_0x56743e&&_0x56743e[_0xddc9('0x4e')]===0x0){return db[_0xddc9('0x29')]['create']({'name':_0x25eb41[_0xddc9('0x2c')],'resourceId':_0x25eb41['id'],'type':_0x56743e[_0xddc9('0x2c')],'sectionId':_0x56743e['id']},{})[_0xddc9('0x25')](function(){return _0x45394e;});}else{return _0x45394e;}})[_0xddc9('0x4a')](function(_0x3a1e3f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a1e3f);throw _0x3a1e3f;});}return _0x45394e;})[_0xddc9('0x25')](respondWithResult(_0x386144,0xc9))[_0xddc9('0x4a')](handleError(_0x386144,null));};exports[_0xddc9('0x24')]=function(_0xf9ca12,_0x1446e0){if(_0xf9ca12[_0xddc9('0x4f')]['id']){delete _0xf9ca12[_0xddc9('0x4f')]['id'];}return db[_0xddc9('0x30')]['find']({'where':{'id':_0xf9ca12[_0xddc9('0x47')]['id']}})[_0xddc9('0x25')](handleEntityNotFound(_0x1446e0,null))[_0xddc9('0x25')](saveUpdates(_0xf9ca12[_0xddc9('0x4f')],null))[_0xddc9('0x25')](respondWithResult(_0x1446e0,null))[_0xddc9('0x4a')](handleError(_0x1446e0,null));};exports['destroy']=function(_0x367c34,_0x30d535){return db[_0xddc9('0x30')]['find']({'where':{'id':_0x367c34[_0xddc9('0x47')]['id']}})[_0xddc9('0x25')](handleEntityNotFound(_0x30d535,null))[_0xddc9('0x25')](removeEntity(_0x30d535,null))[_0xddc9('0x4a')](handleError(_0x30d535,null));};exports['download']=function(_0x24e4dd,_0x2841ac,_0x5c8ed8){return db[_0xddc9('0x30')][_0xddc9('0x50')]({'where':{'id':_0x24e4dd['params']['id']},'attributes':[_0xddc9('0x2c'),_0xddc9('0x51'),_0xddc9('0x52'),_0xddc9('0x53')],'raw':!![]})[_0xddc9('0x25')](handleEntityNotFound(_0x2841ac,null))[_0xddc9('0x25')](function(_0xa96e4a){if(_0xa96e4a){if(!fs[_0xddc9('0x54')](path['join'](config[_0xddc9('0x55')],'server/files/reports',_0xa96e4a['savename']))){throw new db['Sequelize'][(_0xddc9('0x56'))](_0xddc9('0x57'));}if(_0x24e4dd['query']['exists']){return _0x2841ac['sendStatus'](0xc8);}return _0x2841ac[_0xddc9('0x58')](path[_0xddc9('0x59')](config[_0xddc9('0x55')],_0xddc9('0x5a'),_0xa96e4a[_0xddc9('0x52')]),util[_0xddc9('0x5b')](_0xddc9('0x5c'),_0xa96e4a[_0xddc9('0x51')]||_0xa96e4a[_0xddc9('0x2c')],_0xa96e4a[_0xddc9('0x53')][_0xddc9('0x5d')]()));}})[_0xddc9('0x4a')](handleError(_0x2841ac,null));}; \ No newline at end of file +var _0xc337=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','offset','undefined','count','limit','Content-Range','apply','reject','save','update','get','UserProfileResource','then','error','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','merge','options','include','AnalyticExtractedReport','findAll','rows','show','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','destroy','download','basename','output','existsSync','server/files/reports','savename','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','join','root','%s.%s','toLowerCase','eml-format','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse'];(function(_0x1e9a13,_0x4422d4){var _0x34f6ec=function(_0xd29eea){while(--_0xd29eea){_0x1e9a13['push'](_0x1e9a13['shift']());}};_0x34f6ec(++_0x4422d4);}(_0xc337,0x1b6));var _0x7c33=function(_0x2912d0,_0x9fa7d0){_0x2912d0=_0x2912d0-0x0;var _0x153483=_0xc337[_0x2912d0];return _0x153483;};'use strict';var emlformat=require(_0x7c33('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7c33('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7c33('0x2'));var util=require(_0x7c33('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x7c33('0x4'));var ejs=require(_0x7c33('0x5'));var fs=require('fs');var fs_extra=require(_0x7c33('0x6'));var _=require(_0x7c33('0x7'));var squel=require(_0x7c33('0x8'));var crypto=require(_0x7c33('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c33('0xa'));var Papa=require(_0x7c33('0xb'));var Redis=require(_0x7c33('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7c33('0xd'));var as=require(_0x7c33('0xe'));var hardwareService=require(_0x7c33('0xf'));var logger=require(_0x7c33('0x10'))(_0x7c33('0x11'));var utils=require('../../config/utils');var config=require(_0x7c33('0x12'));var licenseUtil=require(_0x7c33('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x311b42,_0x4762bf){_0x4762bf=_0x4762bf||0xcc;return function(_0x294284){if(_0x294284){return _0x311b42['sendStatus'](_0x4762bf);}return _0x311b42[_0x7c33('0x14')](_0x4762bf)[_0x7c33('0x15')]();};}function respondWithResult(_0x562294,_0x474c7e){_0x474c7e=_0x474c7e||0xc8;return function(_0x494062){if(_0x494062){return _0x562294[_0x7c33('0x14')](_0x474c7e)['json'](_0x494062);}};}function respondWithFilteredResult(_0x201679,_0x10e8d5){return function(_0x3f18c4){if(_0x3f18c4){var _0x46ac84=typeof _0x10e8d5[_0x7c33('0x16')]===_0x7c33('0x17')&&typeof _0x10e8d5['limit']===_0x7c33('0x17');var _0x292c5b=_0x3f18c4[_0x7c33('0x18')];var _0x36ef2d=_0x46ac84?0x0:_0x10e8d5[_0x7c33('0x16')];var _0x19c6ff=_0x46ac84?_0x3f18c4['count']:_0x10e8d5[_0x7c33('0x16')]+_0x10e8d5[_0x7c33('0x19')];var _0x11a71a;if(_0x19c6ff>=_0x292c5b){_0x19c6ff=_0x292c5b;_0x11a71a=0xc8;}else{_0x11a71a=0xce;}_0x201679[_0x7c33('0x14')](_0x11a71a);return _0x201679['set'](_0x7c33('0x1a'),_0x36ef2d+'-'+_0x19c6ff+'/'+_0x292c5b)['json'](_0x3f18c4);}return null;};}function patchUpdates(_0x3f082f){return function(_0x4aec17){try{jsonpatch[_0x7c33('0x1b')](_0x4aec17,_0x3f082f,!![]);}catch(_0x267007){return BPromise[_0x7c33('0x1c')](_0x267007);}return _0x4aec17[_0x7c33('0x1d')]();};}function saveUpdates(_0x371fc0,_0x26908b){return function(_0x3a5cfd){if(_0x3a5cfd){return _0x3a5cfd[_0x7c33('0x1e')](_0x371fc0)['then'](function(_0x3f21f9){return _0x3f21f9;});}return null;};}function removeEntity(_0x2a26e5,_0x483d36){return function(_0x1fb685){if(_0x1fb685){return _0x1fb685['destroy']()['then'](function(){var _0x4626ce=_0x1fb685[_0x7c33('0x1f')]({'plain':!![]});var _0x468af5='ExtractedReports';return db[_0x7c33('0x20')]['destroy']({'where':{'type':_0x468af5,'resourceId':_0x4626ce['id']}})['then'](function(){return _0x1fb685;});})[_0x7c33('0x21')](function(){_0x2a26e5['status'](0xcc)[_0x7c33('0x15')]();});}};}function handleEntityNotFound(_0x45fff3,_0x1db7cb){return function(_0x194c2c){if(!_0x194c2c){_0x45fff3['sendStatus'](0x194);}return _0x194c2c;};}function handleError(_0x53a131,_0x184a00){_0x184a00=_0x184a00||0x1f4;return function(_0x2bcf58){logger[_0x7c33('0x22')](_0x2bcf58['stack']);if(_0x2bcf58[_0x7c33('0x23')]){delete _0x2bcf58[_0x7c33('0x23')];}_0x53a131[_0x7c33('0x14')](_0x184a00)[_0x7c33('0x24')](_0x2bcf58);};}exports[_0x7c33('0x25')]=function(_0x151c41,_0xf64946){var _0x2fc885={},_0x45ef86={},_0x233f74={'count':0x0,'rows':[]};var _0x4dea20=_[_0x7c33('0x26')](db['AnalyticExtractedReport'][_0x7c33('0x27')],function(_0x34ae59){return{'name':_0x34ae59[_0x7c33('0x28')],'type':_0x34ae59['type']['key']};});_0x45ef86[_0x7c33('0x29')]=_[_0x7c33('0x26')](_0x4dea20,_0x7c33('0x23'));_0x45ef86[_0x7c33('0x2a')]=_[_0x7c33('0x2b')](_0x151c41['query']);_0x45ef86[_0x7c33('0x2c')]=_[_0x7c33('0x2d')](_0x45ef86[_0x7c33('0x29')],_0x45ef86[_0x7c33('0x2a')]);_0x2fc885[_0x7c33('0x2e')]=_[_0x7c33('0x2d')](_0x45ef86[_0x7c33('0x29')],qs[_0x7c33('0x2f')](_0x151c41[_0x7c33('0x2a')]['fields']));_0x2fc885[_0x7c33('0x2e')]=_0x2fc885[_0x7c33('0x2e')][_0x7c33('0x30')]?_0x2fc885[_0x7c33('0x2e')]:_0x45ef86['model'];if(!_0x151c41['query'][_0x7c33('0x31')](_0x7c33('0x32'))){_0x2fc885[_0x7c33('0x19')]=qs[_0x7c33('0x19')](_0x151c41[_0x7c33('0x2a')][_0x7c33('0x19')]);_0x2fc885[_0x7c33('0x16')]=qs[_0x7c33('0x16')](_0x151c41[_0x7c33('0x2a')][_0x7c33('0x16')]);}_0x2fc885[_0x7c33('0x33')]=qs[_0x7c33('0x34')](_0x151c41[_0x7c33('0x2a')]['sort']);_0x2fc885[_0x7c33('0x35')]=qs[_0x7c33('0x2c')](_['pick'](_0x151c41[_0x7c33('0x2a')],_0x45ef86['filters']),_0x4dea20);if(_0x151c41[_0x7c33('0x2a')]['filter']){_0x2fc885[_0x7c33('0x35')]=_['merge'](_0x2fc885['where'],{'$or':_[_0x7c33('0x26')](_0x4dea20,function(_0x323de6){if(_0x323de6['type']!==_0x7c33('0x36')){var _0x55fd41={};_0x55fd41[_0x323de6[_0x7c33('0x23')]]={'$like':'%'+_0x151c41[_0x7c33('0x2a')]['filter']+'%'};return _0x55fd41;}})});}_0x2fc885=_[_0x7c33('0x37')]({},_0x2fc885,_0x151c41[_0x7c33('0x38')]);var _0x407cbb={'where':_0x2fc885[_0x7c33('0x35')]};return db['AnalyticExtractedReport'][_0x7c33('0x18')](_0x407cbb)[_0x7c33('0x21')](function(_0x18e296){_0x233f74[_0x7c33('0x18')]=_0x18e296;if(_0x151c41[_0x7c33('0x2a')]['includeAll']){_0x2fc885[_0x7c33('0x39')]=[{'all':!![]}];}return db[_0x7c33('0x3a')][_0x7c33('0x3b')](_0x2fc885);})[_0x7c33('0x21')](function(_0x861c){_0x233f74[_0x7c33('0x3c')]=_0x861c;return _0x233f74;})[_0x7c33('0x21')](respondWithFilteredResult(_0xf64946,_0x2fc885))['catch'](handleError(_0xf64946,null));};exports[_0x7c33('0x3d')]=function(_0x235e14,_0x577cc5){var _0x35a8bc={'raw':!![],'where':{'id':_0x235e14['params']['id']}},_0x42940d={};_0x42940d[_0x7c33('0x29')]=_[_0x7c33('0x2b')](db['AnalyticExtractedReport'][_0x7c33('0x27')]);_0x42940d['query']=_['keys'](_0x235e14['query']);_0x42940d[_0x7c33('0x2c')]=_[_0x7c33('0x2d')](_0x42940d['model'],_0x42940d[_0x7c33('0x2a')]);_0x35a8bc['attributes']=_['intersection'](_0x42940d[_0x7c33('0x29')],qs[_0x7c33('0x2f')](_0x235e14['query']['fields']));_0x35a8bc['attributes']=_0x35a8bc[_0x7c33('0x2e')][_0x7c33('0x30')]?_0x35a8bc[_0x7c33('0x2e')]:_0x42940d['model'];if(_0x235e14[_0x7c33('0x2a')][_0x7c33('0x3e')]){_0x35a8bc[_0x7c33('0x39')]=[{'all':!![]}];}_0x35a8bc=_[_0x7c33('0x37')]({},_0x35a8bc,_0x235e14[_0x7c33('0x38')]);return db['AnalyticExtractedReport']['find'](_0x35a8bc)['then'](handleEntityNotFound(_0x577cc5,null))[_0x7c33('0x21')](respondWithResult(_0x577cc5,null))[_0x7c33('0x3f')](handleError(_0x577cc5,null));};exports[_0x7c33('0x40')]=function(_0x59c76e,_0x1bb673){return db[_0x7c33('0x3a')][_0x7c33('0x40')](_0x59c76e[_0x7c33('0x41')],{})[_0x7c33('0x21')](function(_0x3dcc7d){var _0xeb9584=_0x59c76e[_0x7c33('0x42')]['get']({'plain':!![]});if(!_0xeb9584)throw new Error(_0x7c33('0x43'));if(_0xeb9584[_0x7c33('0x44')]===_0x7c33('0x42')){var _0xf21f0e=_0x3dcc7d[_0x7c33('0x1f')]({'plain':!![]});var _0x5be194=_0x7c33('0x45');return db[_0x7c33('0x46')]['find']({'where':{'name':_0x5be194,'userProfileId':_0xeb9584['userProfileId']},'raw':!![]})[_0x7c33('0x21')](function(_0x5a4f81){if(_0x5a4f81&&_0x5a4f81[_0x7c33('0x47')]===0x0){return db['UserProfileResource'][_0x7c33('0x40')]({'name':_0xf21f0e[_0x7c33('0x23')],'resourceId':_0xf21f0e['id'],'type':_0x5a4f81[_0x7c33('0x23')],'sectionId':_0x5a4f81['id']},{})[_0x7c33('0x21')](function(){return _0x3dcc7d;});}else{return _0x3dcc7d;}})[_0x7c33('0x3f')](function(_0x454916){logger[_0x7c33('0x22')](_0x7c33('0x48'),_0x454916);throw _0x454916;});}return _0x3dcc7d;})[_0x7c33('0x21')](respondWithResult(_0x1bb673,0xc9))['catch'](handleError(_0x1bb673,null));};exports[_0x7c33('0x1e')]=function(_0x57cc9f,_0x54a991){if(_0x57cc9f[_0x7c33('0x41')]['id']){delete _0x57cc9f[_0x7c33('0x41')]['id'];}return db[_0x7c33('0x3a')][_0x7c33('0x49')]({'where':{'id':_0x57cc9f[_0x7c33('0x4a')]['id']}})[_0x7c33('0x21')](handleEntityNotFound(_0x54a991,null))[_0x7c33('0x21')](saveUpdates(_0x57cc9f['body'],null))[_0x7c33('0x21')](respondWithResult(_0x54a991,null))[_0x7c33('0x3f')](handleError(_0x54a991,null));};exports[_0x7c33('0x4b')]=function(_0x1e5206,_0x5dc9c9){return db[_0x7c33('0x3a')][_0x7c33('0x49')]({'where':{'id':_0x1e5206[_0x7c33('0x4a')]['id']}})[_0x7c33('0x21')](handleEntityNotFound(_0x5dc9c9,null))[_0x7c33('0x21')](removeEntity(_0x5dc9c9,null))['catch'](handleError(_0x5dc9c9,null));};exports[_0x7c33('0x4c')]=function(_0x3c9e31,_0x1aab77,_0x5ad0fb){return db[_0x7c33('0x3a')][_0x7c33('0x49')]({'where':{'id':_0x3c9e31['params']['id']},'attributes':['name',_0x7c33('0x4d'),'savename',_0x7c33('0x4e')],'raw':!![]})[_0x7c33('0x21')](handleEntityNotFound(_0x1aab77,null))['then'](function(_0x50824d){if(_0x50824d){if(!fs[_0x7c33('0x4f')](path['join'](config['root'],_0x7c33('0x50'),_0x50824d[_0x7c33('0x51')]))){throw new db[(_0x7c33('0x52'))]['ValidationError'](_0x7c33('0x53'));}if(_0x3c9e31['query'][_0x7c33('0x54')]){return _0x1aab77[_0x7c33('0x55')](0xc8);}return _0x1aab77[_0x7c33('0x4c')](path[_0x7c33('0x56')](config[_0x7c33('0x57')],_0x7c33('0x50'),_0x50824d[_0x7c33('0x51')]),util['format'](_0x7c33('0x58'),_0x50824d[_0x7c33('0x4d')]||_0x50824d['name'],_0x50824d['output'][_0x7c33('0x59')]()));}})[_0x7c33('0x3f')](handleError(_0x1aab77,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7595110..0f2550f 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 _0xb7e8=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x845897,_0x42ef70){var _0x2d70c8=function(_0x32a33b){while(--_0x32a33b){_0x845897['push'](_0x845897['shift']());}};_0x2d70c8(++_0x42ef70);}(_0xb7e8,0x73));var _0x8b7e=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0xb7e8[_0x339129];return _0x1570df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8b7e('0x0'))(_0x8b7e('0x1'));var moment=require('moment');var BPromise=require(_0x8b7e('0x2'));var rp=require(_0x8b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7e('0x4'));var config=require(_0x8b7e('0x5'));var attributes=require(_0x8b7e('0x6'));module[_0x8b7e('0x7')]=function(_0x1a3e07,_0x3618db){return _0x1a3e07[_0x8b7e('0x8')](_0x8b7e('0x9'),attributes,{'tableName':_0x8b7e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12e7=['request-promise','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0xe589c,_0x36ea7b){var _0x5baddb=function(_0x23fdfa){while(--_0x23fdfa){_0xe589c['push'](_0xe589c['shift']());}};_0x5baddb(++_0x36ea7b);}(_0x12e7,0x15b));var _0x712e=function(_0x431968,_0x30ad56){_0x431968=_0x431968-0x0;var _0x14cebc=_0x12e7[_0x431968];return _0x14cebc;};'use strict';var _=require(_0x712e('0x0'));var util=require('util');var logger=require(_0x712e('0x1'))(_0x712e('0x2'));var moment=require(_0x712e('0x3'));var BPromise=require(_0x712e('0x4'));var rp=require(_0x712e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x712e('0x6'));module[_0x712e('0x7')]=function(_0xff9c94,_0x3a70c1){return _0xff9c94[_0x712e('0x8')](_0x712e('0x9'),attributes,{'tableName':_0x712e('0xa'),'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 5943f9b..dfc6857 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 _0xec00=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5e9d2b,_0x2fb28c){var _0x2200e6=function(_0x18f0c8){while(--_0x18f0c8){_0x5e9d2b['push'](_0x5e9d2b['shift']());}};_0x2200e6(++_0x2fb28c);}(_0xec00,0x10b));var _0x0ec0=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0xec00[_0xf91841];return _0x4b9c44;};'use strict';var _=require(_0x0ec0('0x0'));var util=require(_0x0ec0('0x1'));var moment=require(_0x0ec0('0x2'));var BPromise=require(_0x0ec0('0x3'));var rs=require(_0x0ec0('0x4'));var fs=require('fs');var Redis=require(_0x0ec0('0x5'));var db=require(_0x0ec0('0x6'))['db'];var utils=require(_0x0ec0('0x7'));var logger=require(_0x0ec0('0x8'))('rpc');var config=require(_0x0ec0('0x9'));var jayson=require(_0x0ec0('0xa'));var client=jayson[_0x0ec0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4079dd,_0x273624,_0x4e4ab6){return new BPromise(function(_0x25d01c,_0x441e34){return client[_0x0ec0('0xc')](_0x4079dd,_0x4e4ab6)['then'](function(_0x1ecba3){logger[_0x0ec0('0xd')](_0x0ec0('0xe'),_0x273624,_0x0ec0('0xf'));logger['debug'](_0x0ec0('0x10'),_0x273624,_0x0ec0('0xf'),JSON['stringify'](_0x1ecba3));if(_0x1ecba3['error']){if(_0x1ecba3[_0x0ec0('0x11')][_0x0ec0('0x12')]===0x1f4){logger[_0x0ec0('0x11')](_0x0ec0('0xe'),_0x273624,_0x1ecba3[_0x0ec0('0x11')][_0x0ec0('0x13')]);return _0x441e34(_0x1ecba3[_0x0ec0('0x11')][_0x0ec0('0x13')]);}logger[_0x0ec0('0x11')](_0x0ec0('0xe'),_0x273624,_0x1ecba3['error'][_0x0ec0('0x13')]);return _0x25d01c(_0x1ecba3[_0x0ec0('0x11')][_0x0ec0('0x13')]);}else{logger[_0x0ec0('0xd')](_0x0ec0('0xe'),_0x273624,_0x0ec0('0xf'));_0x25d01c(_0x1ecba3[_0x0ec0('0x14')][_0x0ec0('0x13')]);}})[_0x0ec0('0x15')](function(_0x1ad1f7){logger[_0x0ec0('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x273624,_0x1ad1f7);_0x441e34(_0x1ad1f7);});});} \ No newline at end of file +var _0x40ca=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x35bbc5,_0x174849){var _0x23a02c=function(_0x1b02ca){while(--_0x1b02ca){_0x35bbc5['push'](_0x35bbc5['shift']());}};_0x23a02c(++_0x174849);}(_0x40ca,0x14e));var _0xa40c=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x40ca[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0xa40c('0x0'));var util=require(_0xa40c('0x1'));var moment=require(_0xa40c('0x2'));var BPromise=require('bluebird');var rs=require(_0xa40c('0x3'));var fs=require('fs');var Redis=require(_0xa40c('0x4'));var db=require(_0xa40c('0x5'))['db'];var utils=require(_0xa40c('0x6'));var logger=require(_0xa40c('0x7'))(_0xa40c('0x8'));var config=require(_0xa40c('0x9'));var jayson=require(_0xa40c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5db280,_0x3d70dc,_0xd2ea42){return new BPromise(function(_0x37ac51,_0x2b7d9c){return client[_0xa40c('0xb')](_0x5db280,_0xd2ea42)[_0xa40c('0xc')](function(_0x477263){logger[_0xa40c('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3d70dc,'request\x20sent');logger[_0xa40c('0xe')](_0xa40c('0xf'),_0x3d70dc,_0xa40c('0x10'),JSON[_0xa40c('0x11')](_0x477263));if(_0x477263[_0xa40c('0x12')]){if(_0x477263[_0xa40c('0x12')][_0xa40c('0x13')]===0x1f4){logger['error'](_0xa40c('0x14'),_0x3d70dc,_0x477263[_0xa40c('0x12')]['message']);return _0x2b7d9c(_0x477263['error']['message']);}logger[_0xa40c('0x12')](_0xa40c('0x14'),_0x3d70dc,_0x477263['error'][_0xa40c('0x15')]);return _0x37ac51(_0x477263['error'][_0xa40c('0x15')]);}else{logger[_0xa40c('0xd')](_0xa40c('0x14'),_0x3d70dc,_0xa40c('0x10'));_0x37ac51(_0x477263[_0xa40c('0x16')]['message']);}})[_0xa40c('0x17')](function(_0xb5e802){logger[_0xa40c('0x12')](_0xa40c('0x14'),_0x3d70dc,_0xb5e802);_0x2b7d9c(_0xb5e802);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 2b96591..a769030 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 _0x98ca=['connect-timeout','express','Router','fs-extra','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','put','update','delete','destroy','multer','util'];(function(_0x1bff41,_0x386880){var _0x4db66b=function(_0x5aa7b6){while(--_0x5aa7b6){_0x1bff41['push'](_0x1bff41['shift']());}};_0x4db66b(++_0x386880);}(_0x98ca,0x102));var _0xa98c=function(_0x6c5fe5,_0x5d1f36){_0x6c5fe5=_0x6c5fe5-0x0;var _0x170401=_0x98ca[_0x6c5fe5];return _0x170401;};'use strict';var multer=require(_0xa98c('0x0'));var util=require(_0xa98c('0x1'));var path=require('path');var timeout=require(_0xa98c('0x2'));var express=require(_0xa98c('0x3'));var router=express[_0xa98c('0x4')]();var fs_extra=require(_0xa98c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa98c('0x6'));var controller=require(_0xa98c('0x7'));router[_0xa98c('0x8')]('/',auth[_0xa98c('0x9')](),controller[_0xa98c('0xa')]);router['get'](_0xa98c('0xb'),auth[_0xa98c('0x9')](),controller[_0xa98c('0xc')]);router[_0xa98c('0x8')](_0xa98c('0xd'),auth['isAuthenticated'](),controller[_0xa98c('0xe')]);router[_0xa98c('0xf')]('/',auth[_0xa98c('0x9')](),controller['create']);router[_0xa98c('0x10')](_0xa98c('0xb'),auth['isAuthenticated'](),controller[_0xa98c('0x11')]);router[_0xa98c('0x12')]('/:id',auth[_0xa98c('0x9')](),controller[_0xa98c('0x13')]);module['exports']=router; \ No newline at end of file +var _0xc61c=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','update'];(function(_0x42539c,_0x2113af){var _0x259de0=function(_0x3707e8){while(--_0x3707e8){_0x42539c['push'](_0x42539c['shift']());}};_0x259de0(++_0x2113af);}(_0xc61c,0xa1));var _0xcc61=function(_0x3b6d93,_0x39edc1){_0x3b6d93=_0x3b6d93-0x0;var _0x29859e=_0xc61c[_0x3b6d93];return _0x29859e;};'use strict';var multer=require(_0xcc61('0x0'));var util=require('util');var path=require(_0xcc61('0x1'));var timeout=require(_0xcc61('0x2'));var express=require(_0xcc61('0x3'));var router=express[_0xcc61('0x4')]();var fs_extra=require(_0xcc61('0x5'));var auth=require(_0xcc61('0x6'));var interaction=require(_0xcc61('0x7'));var config=require(_0xcc61('0x8'));var controller=require(_0xcc61('0x9'));router[_0xcc61('0xa')]('/',auth[_0xcc61('0xb')](),controller[_0xcc61('0xc')]);router['get'](_0xcc61('0xd'),auth[_0xcc61('0xb')](),controller[_0xcc61('0xe')]);router[_0xcc61('0xa')](_0xcc61('0xf'),auth['isAuthenticated'](),controller[_0xcc61('0x10')]);router[_0xcc61('0x11')]('/',auth[_0xcc61('0xb')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcc61('0x12')]);router['delete']('/:id',auth[_0xcc61('0xb')](),controller[_0xcc61('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 2bb4058..82895f7 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 _0x030e=['TEXT','STRING','BOOLEAN','exports'];(function(_0x379d47,_0x37cdca){var _0x59fc7f=function(_0x102ff9){while(--_0x102ff9){_0x379d47['push'](_0x379d47['shift']());}};_0x59fc7f(++_0x37cdca);}(_0x030e,0x197));var _0xe030=function(_0x224a17,_0x5c19a6){_0x224a17=_0x224a17-0x0;var _0x14d95a=_0x030e[_0x224a17];return _0x14d95a;};'use strict';var Sequelize=require('sequelize');module[_0xe030('0x0')]={'field':{'type':Sequelize[_0xe030('0x1')]},'alias':{'type':Sequelize[_0xe030('0x2')]},'function':{'type':Sequelize[_0xe030('0x2')]},'format':{'type':Sequelize[_0xe030('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xe030('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x6cfa=['sequelize','exports','STRING','BOOLEAN'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x6cfa,0xec));var _0xa6cf=function(_0x1fdff9,_0x4c4bf4){_0x1fdff9=_0x1fdff9-0x0;var _0x3d1b6e=_0x6cfa[_0x1fdff9];return _0x3d1b6e;};'use strict';var Sequelize=require(_0xa6cf('0x0'));module[_0xa6cf('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xa6cf('0x2')]},'function':{'type':Sequelize[_0xa6cf('0x2')]},'format':{'type':Sequelize[_0xa6cf('0x2')]},'groupBy':{'type':Sequelize[_0xa6cf('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xa6cf('0x2')]},'custom':{'type':Sequelize[_0xa6cf('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 7284174..d7efc96 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 _0x6799=['destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','bulkCreate','find','bulkDestroy','ids','addFields','sequelize','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update'];(function(_0x339539,_0x101ac7){var _0x2d0d1f=function(_0x4bb0cc){while(--_0x4bb0cc){_0x339539['push'](_0x339539['shift']());}};_0x2d0d1f(++_0x101ac7);}(_0x6799,0x11d));var _0x9679=function(_0x32afa7,_0x2df41b){_0x32afa7=_0x32afa7-0x0;var _0x1b40e6=_0x6799[_0x32afa7];return _0x1b40e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9679('0x0'));var zipdir=require(_0x9679('0x1'));var jsonpatch=require(_0x9679('0x2'));var rp=require(_0x9679('0x3'));var moment=require(_0x9679('0x4'));var BPromise=require(_0x9679('0x5'));var Mustache=require(_0x9679('0x6'));var util=require(_0x9679('0x7'));var path=require(_0x9679('0x8'));var sox=require(_0x9679('0x9'));var csv=require(_0x9679('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9679('0xb'));var _=require(_0x9679('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9679('0xd'));var toCsv=require(_0x9679('0xa'));var querystring=require('querystring');var Papa=require(_0x9679('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9679('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9679('0x10'))(_0x9679('0x11'));var utils=require(_0x9679('0x12'));var config=require(_0x9679('0x13'));var licenseUtil=require(_0x9679('0x14'));var db=require(_0x9679('0x15'))['db'];function respondWithStatusCode(_0x383274,_0x16918e){_0x16918e=_0x16918e||0xcc;return function(_0xa28acc){if(_0xa28acc){return _0x383274[_0x9679('0x16')](_0x16918e);}return _0x383274[_0x9679('0x17')](_0x16918e)[_0x9679('0x18')]();};}function respondWithResult(_0x50d3af,_0x230eba){_0x230eba=_0x230eba||0xc8;return function(_0x341ef8){if(_0x341ef8){return _0x50d3af[_0x9679('0x17')](_0x230eba)['json'](_0x341ef8);}};}function respondWithFilteredResult(_0x3d5e97,_0x10c00d){return function(_0x2758b5){if(_0x2758b5){var _0x3d75df=typeof _0x10c00d[_0x9679('0x19')]==='undefined'&&typeof _0x10c00d['limit']===_0x9679('0x1a');var _0x56e6af=_0x2758b5[_0x9679('0x1b')];var _0x53ce22=_0x3d75df?0x0:_0x10c00d['offset'];var _0x682aab=_0x3d75df?_0x2758b5['count']:_0x10c00d['offset']+_0x10c00d[_0x9679('0x1c')];var _0x125cb4;if(_0x682aab>=_0x56e6af){_0x682aab=_0x56e6af;_0x125cb4=0xc8;}else{_0x125cb4=0xce;}_0x3d5e97[_0x9679('0x17')](_0x125cb4);return _0x3d5e97[_0x9679('0x1d')]('Content-Range',_0x53ce22+'-'+_0x682aab+'/'+_0x56e6af)[_0x9679('0x1e')](_0x2758b5);}return null;};}function patchUpdates(_0x3e3e17){return function(_0x35cae7){try{jsonpatch[_0x9679('0x1f')](_0x35cae7,_0x3e3e17,!![]);}catch(_0x2a5914){return BPromise[_0x9679('0x20')](_0x2a5914);}return _0x35cae7[_0x9679('0x21')]();};}function saveUpdates(_0x3175f6,_0x3f7151){return function(_0x5e28ea){if(_0x5e28ea){return _0x5e28ea[_0x9679('0x22')](_0x3175f6)['then'](function(_0x3e14cb){return _0x3e14cb;});}return null;};}function removeEntity(_0x524643,_0xeda395){return function(_0x532cba){if(_0x532cba){return _0x532cba[_0x9679('0x23')]()[_0x9679('0x24')](function(){_0x524643[_0x9679('0x17')](0xcc)[_0x9679('0x18')]();});}};}function handleEntityNotFound(_0xdad08c,_0x32946b){return function(_0x5cf8da){if(!_0x5cf8da){_0xdad08c[_0x9679('0x16')](0x194);}return _0x5cf8da;};}function handleError(_0x2b7657,_0x411a7a){_0x411a7a=_0x411a7a||0x1f4;return function(_0x5b80d5){logger[_0x9679('0x25')](_0x5b80d5[_0x9679('0x26')]);if(_0x5b80d5['name']){delete _0x5b80d5[_0x9679('0x27')];}_0x2b7657[_0x9679('0x17')](_0x411a7a)[_0x9679('0x28')](_0x5b80d5);};}exports[_0x9679('0x29')]=function(_0x33fdd8,_0x31e8fa){var _0x248110={},_0x4ee84b={},_0x5b7c32={'count':0x0,'rows':[]};var _0x5a30a6=_[_0x9679('0x2a')](db[_0x9679('0x2b')][_0x9679('0x2c')],function(_0x3d4fcb){return{'name':_0x3d4fcb['fieldName'],'type':_0x3d4fcb[_0x9679('0x2d')][_0x9679('0x2e')]};});_0x4ee84b[_0x9679('0x2f')]=_[_0x9679('0x2a')](_0x5a30a6,'name');_0x4ee84b[_0x9679('0x30')]=_[_0x9679('0x31')](_0x33fdd8[_0x9679('0x30')]);_0x4ee84b['filters']=_['intersection'](_0x4ee84b[_0x9679('0x2f')],_0x4ee84b[_0x9679('0x30')]);_0x248110[_0x9679('0x32')]=_[_0x9679('0x33')](_0x4ee84b[_0x9679('0x2f')],qs[_0x9679('0x34')](_0x33fdd8[_0x9679('0x30')]['fields']));_0x248110[_0x9679('0x32')]=_0x248110[_0x9679('0x32')][_0x9679('0x35')]?_0x248110[_0x9679('0x32')]:_0x4ee84b['model'];if(!_0x33fdd8[_0x9679('0x30')][_0x9679('0x36')]('nolimit')){_0x248110[_0x9679('0x1c')]=qs[_0x9679('0x1c')](_0x33fdd8['query'][_0x9679('0x1c')]);_0x248110['offset']=qs[_0x9679('0x19')](_0x33fdd8[_0x9679('0x30')][_0x9679('0x19')]);}_0x248110[_0x9679('0x37')]=qs[_0x9679('0x38')](_0x33fdd8[_0x9679('0x30')][_0x9679('0x38')]);_0x248110[_0x9679('0x39')]=qs[_0x9679('0x3a')](_[_0x9679('0x3b')](_0x33fdd8[_0x9679('0x30')],_0x4ee84b[_0x9679('0x3a')]),_0x5a30a6);if(_0x33fdd8['query'][_0x9679('0x3c')]){_0x248110['where']=_[_0x9679('0x3d')](_0x248110[_0x9679('0x39')],{'$or':_[_0x9679('0x2a')](_0x5a30a6,function(_0x4c0b48){if(_0x4c0b48[_0x9679('0x2d')]!==_0x9679('0x3e')){var _0x41751a={};_0x41751a[_0x4c0b48['name']]={'$like':'%'+_0x33fdd8[_0x9679('0x30')][_0x9679('0x3c')]+'%'};return _0x41751a;}})});}_0x248110=_[_0x9679('0x3d')]({},_0x248110,_0x33fdd8[_0x9679('0x3f')]);var _0x13535a={'where':_0x248110[_0x9679('0x39')]};return db[_0x9679('0x2b')][_0x9679('0x1b')](_0x13535a)[_0x9679('0x24')](function(_0x2acb5a){_0x5b7c32['count']=_0x2acb5a;if(_0x33fdd8['query'][_0x9679('0x40')]){_0x248110['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9679('0x41')](_0x248110);})['then'](function(_0x105da7){_0x5b7c32[_0x9679('0x42')]=_0x105da7;return _0x5b7c32;})[_0x9679('0x24')](respondWithFilteredResult(_0x31e8fa,_0x248110))[_0x9679('0x43')](handleError(_0x31e8fa,null));};exports[_0x9679('0x44')]=function(_0x3b8f8b,_0x29c0f8){var _0x3d06d2={'raw':![],'where':{'id':_0x3b8f8b[_0x9679('0x45')]['id']}},_0x4a7ba7={};_0x4a7ba7['model']=_[_0x9679('0x31')](db['AnalyticFieldReport'][_0x9679('0x2c')]);_0x4a7ba7['query']=_[_0x9679('0x31')](_0x3b8f8b[_0x9679('0x30')]);_0x4a7ba7[_0x9679('0x3a')]=_['intersection'](_0x4a7ba7[_0x9679('0x2f')],_0x4a7ba7[_0x9679('0x30')]);_0x3d06d2[_0x9679('0x32')]=_[_0x9679('0x33')](_0x4a7ba7[_0x9679('0x2f')],qs[_0x9679('0x34')](_0x3b8f8b['query'][_0x9679('0x34')]));_0x3d06d2[_0x9679('0x32')]=_0x3d06d2[_0x9679('0x32')][_0x9679('0x35')]?_0x3d06d2['attributes']:_0x4a7ba7[_0x9679('0x2f')];if(_0x3b8f8b[_0x9679('0x30')]['includeAll']){_0x3d06d2[_0x9679('0x46')]=[{'all':!![]}];}_0x3d06d2=_[_0x9679('0x3d')]({},_0x3d06d2,_0x3b8f8b[_0x9679('0x3f')]);return db[_0x9679('0x2b')]['find'](_0x3d06d2)[_0x9679('0x24')](handleEntityNotFound(_0x29c0f8,null))[_0x9679('0x24')](respondWithResult(_0x29c0f8,null))[_0x9679('0x43')](handleError(_0x29c0f8,null));};exports[_0x9679('0x47')]=function(_0x18d918,_0x4b85c3){return db[_0x9679('0x2b')][_0x9679('0x47')](_0x18d918[_0x9679('0x48')],{})['then'](respondWithResult(_0x4b85c3,0xc9))['catch'](handleError(_0x4b85c3,null));};exports[_0x9679('0x49')]=function(_0x347105,_0x3c2f98){return db['AnalyticFieldReport'][_0x9679('0x49')](_0x347105[_0x9679('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3c2f98,0xc9))[_0x9679('0x43')](handleError(_0x3c2f98,null));};exports[_0x9679('0x22')]=function(_0xc80470,_0x39932e){if(_0xc80470[_0x9679('0x48')]['id']){delete _0xc80470['body']['id'];}return db['AnalyticFieldReport'][_0x9679('0x4a')]({'where':{'id':_0xc80470[_0x9679('0x45')]['id']}})[_0x9679('0x24')](handleEntityNotFound(_0x39932e,null))[_0x9679('0x24')](saveUpdates(_0xc80470['body'],null))[_0x9679('0x24')](respondWithResult(_0x39932e,null))[_0x9679('0x43')](handleError(_0x39932e,null));};exports[_0x9679('0x23')]=function(_0x11e442,_0x4bf4d3){return db[_0x9679('0x2b')][_0x9679('0x4a')]({'where':{'id':_0x11e442['params']['id']}})[_0x9679('0x24')](handleEntityNotFound(_0x4bf4d3,null))[_0x9679('0x24')](removeEntity(_0x4bf4d3,null))[_0x9679('0x43')](handleError(_0x4bf4d3,null));};exports[_0x9679('0x4b')]=function(_0x21276e,_0x69c184){return db[_0x9679('0x2b')][_0x9679('0x23')]({'where':{'id':_0x21276e[_0x9679('0x30')][_0x9679('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0x9679('0x24')](respondWithResult(_0x69c184,0xcc))['catch'](handleError(_0x69c184,null));};exports[_0x9679('0x4d')]=function(_0x4b156a,_0x42062a,_0xd66e9a){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4b156a['params']['id']}})[_0x9679('0x24')](handleEntityNotFound(_0x42062a,null))[_0x9679('0x24')](function(_0x1220c9){if(_0x1220c9){return db[_0x9679('0x4e')][_0x9679('0x4f')](function(_0x3c4d4a){return db[_0x9679('0x2b')][_0x9679('0x23')]({'where':{'CustomReportId':_0x4b156a['params']['id']},'transaction':_0x3c4d4a})[_0x9679('0x24')](function(_0x37073b){var _0x1a361a=_['map'](_0x4b156a[_0x9679('0x48')],function(_0x5284d8){delete _0x5284d8['id'];_0x5284d8['CustomReportId']=_0x4b156a[_0x9679('0x45')]['id'];return _0x5284d8;});return db[_0x9679('0x2b')]['bulkCreate'](_0x1a361a,{'transaction':_0x3c4d4a});});})[_0x9679('0x24')](function(){return db[_0x9679('0x2b')][_0x9679('0x41')]({'where':{'CustomReportId':_0x4b156a[_0x9679('0x45')]['id']}});});}})[_0x9679('0x24')](respondWithResult(_0x42062a,null))[_0x9679('0x43')](handleError(_0x42062a,null));}; \ No newline at end of file +var _0x3797=['map','query','keys','intersection','attributes','fields','hasOwnProperty','sort','filters','filter','where','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','stack','name','send','index','AnalyticFieldReport','fieldName','model'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x3797,0x1ef));var _0x7379=function(_0x4b0406,_0x42c4d9){_0x4b0406=_0x4b0406-0x0;var _0x58ccd9=_0x3797[_0x4b0406];return _0x58ccd9;};'use strict';var emlformat=require(_0x7379('0x0'));var rimraf=require(_0x7379('0x1'));var zipdir=require(_0x7379('0x2'));var jsonpatch=require(_0x7379('0x3'));var rp=require(_0x7379('0x4'));var moment=require(_0x7379('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7379('0x6'));var util=require('util');var path=require(_0x7379('0x7'));var sox=require(_0x7379('0x8'));var csv=require(_0x7379('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7379('0xa'));var _=require(_0x7379('0xb'));var squel=require(_0x7379('0xc'));var crypto=require('crypto');var jsforce=require(_0x7379('0xd'));var deskjs=require(_0x7379('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7379('0xf'));var Papa=require(_0x7379('0x10'));var Redis=require('ioredis');var authService=require(_0x7379('0x11'));var qs=require(_0x7379('0x12'));var as=require(_0x7379('0x13'));var hardwareService=require(_0x7379('0x14'));var logger=require('../../config/logger')(_0x7379('0x15'));var utils=require(_0x7379('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7379('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496764,_0x397539){_0x397539=_0x397539||0xcc;return function(_0x528fb1){if(_0x528fb1){return _0x496764['sendStatus'](_0x397539);}return _0x496764['status'](_0x397539)[_0x7379('0x18')]();};}function respondWithResult(_0x4dcf1e,_0x2673b5){_0x2673b5=_0x2673b5||0xc8;return function(_0x2ff08f){if(_0x2ff08f){return _0x4dcf1e[_0x7379('0x19')](_0x2673b5)[_0x7379('0x1a')](_0x2ff08f);}};}function respondWithFilteredResult(_0x62b48,_0x2dce7c){return function(_0x4ee270){if(_0x4ee270){var _0x338aa0=typeof _0x2dce7c[_0x7379('0x1b')]===_0x7379('0x1c')&&typeof _0x2dce7c[_0x7379('0x1d')]===_0x7379('0x1c');var _0x35ae10=_0x4ee270[_0x7379('0x1e')];var _0x5c38a6=_0x338aa0?0x0:_0x2dce7c['offset'];var _0xb13419=_0x338aa0?_0x4ee270[_0x7379('0x1e')]:_0x2dce7c['offset']+_0x2dce7c[_0x7379('0x1d')];var _0x494d16;if(_0xb13419>=_0x35ae10){_0xb13419=_0x35ae10;_0x494d16=0xc8;}else{_0x494d16=0xce;}_0x62b48[_0x7379('0x19')](_0x494d16);return _0x62b48[_0x7379('0x1f')](_0x7379('0x20'),_0x5c38a6+'-'+_0xb13419+'/'+_0x35ae10)[_0x7379('0x1a')](_0x4ee270);}return null;};}function patchUpdates(_0x5dea18){return function(_0x275513){try{jsonpatch['apply'](_0x275513,_0x5dea18,!![]);}catch(_0xee75ff){return BPromise['reject'](_0xee75ff);}return _0x275513[_0x7379('0x21')]();};}function saveUpdates(_0x13c9f8,_0x3e7786){return function(_0x3b6ca3){if(_0x3b6ca3){return _0x3b6ca3[_0x7379('0x22')](_0x13c9f8)[_0x7379('0x23')](function(_0x49e1f8){return _0x49e1f8;});}return null;};}function removeEntity(_0x2a31f7,_0x44473e){return function(_0x34207f){if(_0x34207f){return _0x34207f[_0x7379('0x24')]()['then'](function(){_0x2a31f7['status'](0xcc)[_0x7379('0x18')]();});}};}function handleEntityNotFound(_0x2c4a4b,_0x3733f7){return function(_0x12ce04){if(!_0x12ce04){_0x2c4a4b['sendStatus'](0x194);}return _0x12ce04;};}function handleError(_0x8b0b5b,_0x1eda32){_0x1eda32=_0x1eda32||0x1f4;return function(_0x4c8ac7){logger['error'](_0x4c8ac7[_0x7379('0x25')]);if(_0x4c8ac7[_0x7379('0x26')]){delete _0x4c8ac7['name'];}_0x8b0b5b[_0x7379('0x19')](_0x1eda32)[_0x7379('0x27')](_0x4c8ac7);};}exports[_0x7379('0x28')]=function(_0x49cbf1,_0x35f2e4){var _0x4cb5ba={},_0x5b054a={},_0x5a3b3c={'count':0x0,'rows':[]};var _0xb7a841=_['map'](db[_0x7379('0x29')]['rawAttributes'],function(_0x153479){return{'name':_0x153479[_0x7379('0x2a')],'type':_0x153479['type']['key']};});_0x5b054a[_0x7379('0x2b')]=_[_0x7379('0x2c')](_0xb7a841,'name');_0x5b054a[_0x7379('0x2d')]=_[_0x7379('0x2e')](_0x49cbf1[_0x7379('0x2d')]);_0x5b054a['filters']=_[_0x7379('0x2f')](_0x5b054a[_0x7379('0x2b')],_0x5b054a[_0x7379('0x2d')]);_0x4cb5ba[_0x7379('0x30')]=_['intersection'](_0x5b054a['model'],qs[_0x7379('0x31')](_0x49cbf1[_0x7379('0x2d')]['fields']));_0x4cb5ba['attributes']=_0x4cb5ba[_0x7379('0x30')]['length']?_0x4cb5ba[_0x7379('0x30')]:_0x5b054a['model'];if(!_0x49cbf1[_0x7379('0x2d')][_0x7379('0x32')]('nolimit')){_0x4cb5ba['limit']=qs[_0x7379('0x1d')](_0x49cbf1['query'][_0x7379('0x1d')]);_0x4cb5ba[_0x7379('0x1b')]=qs['offset'](_0x49cbf1[_0x7379('0x2d')]['offset']);}_0x4cb5ba['order']=qs['sort'](_0x49cbf1[_0x7379('0x2d')][_0x7379('0x33')]);_0x4cb5ba['where']=qs[_0x7379('0x34')](_['pick'](_0x49cbf1[_0x7379('0x2d')],_0x5b054a[_0x7379('0x34')]),_0xb7a841);if(_0x49cbf1[_0x7379('0x2d')][_0x7379('0x35')]){_0x4cb5ba[_0x7379('0x36')]=_[_0x7379('0x37')](_0x4cb5ba[_0x7379('0x36')],{'$or':_[_0x7379('0x2c')](_0xb7a841,function(_0x5a84c3){if(_0x5a84c3[_0x7379('0x38')]!==_0x7379('0x39')){var _0x4287a7={};_0x4287a7[_0x5a84c3[_0x7379('0x26')]]={'$like':'%'+_0x49cbf1[_0x7379('0x2d')][_0x7379('0x35')]+'%'};return _0x4287a7;}})});}_0x4cb5ba=_[_0x7379('0x37')]({},_0x4cb5ba,_0x49cbf1[_0x7379('0x3a')]);var _0x4bd5a2={'where':_0x4cb5ba[_0x7379('0x36')]};return db[_0x7379('0x29')][_0x7379('0x1e')](_0x4bd5a2)[_0x7379('0x23')](function(_0xdc9427){_0x5a3b3c['count']=_0xdc9427;if(_0x49cbf1[_0x7379('0x2d')]['includeAll']){_0x4cb5ba[_0x7379('0x3b')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x7379('0x3c')](_0x4cb5ba);})[_0x7379('0x23')](function(_0x46b860){_0x5a3b3c[_0x7379('0x3d')]=_0x46b860;return _0x5a3b3c;})['then'](respondWithFilteredResult(_0x35f2e4,_0x4cb5ba))[_0x7379('0x3e')](handleError(_0x35f2e4,null));};exports[_0x7379('0x3f')]=function(_0x4c474b,_0x24b86f){var _0x358554={'raw':![],'where':{'id':_0x4c474b['params']['id']}},_0x524342={};_0x524342[_0x7379('0x2b')]=_[_0x7379('0x2e')](db[_0x7379('0x29')][_0x7379('0x40')]);_0x524342[_0x7379('0x2d')]=_[_0x7379('0x2e')](_0x4c474b[_0x7379('0x2d')]);_0x524342[_0x7379('0x34')]=_[_0x7379('0x2f')](_0x524342[_0x7379('0x2b')],_0x524342[_0x7379('0x2d')]);_0x358554['attributes']=_[_0x7379('0x2f')](_0x524342['model'],qs[_0x7379('0x31')](_0x4c474b[_0x7379('0x2d')][_0x7379('0x31')]));_0x358554[_0x7379('0x30')]=_0x358554[_0x7379('0x30')][_0x7379('0x41')]?_0x358554['attributes']:_0x524342[_0x7379('0x2b')];if(_0x4c474b[_0x7379('0x2d')]['includeAll']){_0x358554[_0x7379('0x3b')]=[{'all':!![]}];}_0x358554=_[_0x7379('0x37')]({},_0x358554,_0x4c474b['options']);return db[_0x7379('0x29')][_0x7379('0x42')](_0x358554)['then'](handleEntityNotFound(_0x24b86f,null))[_0x7379('0x23')](respondWithResult(_0x24b86f,null))[_0x7379('0x3e')](handleError(_0x24b86f,null));};exports[_0x7379('0x43')]=function(_0x160d4b,_0x3e9b93){return db[_0x7379('0x29')][_0x7379('0x43')](_0x160d4b[_0x7379('0x44')],{})['then'](respondWithResult(_0x3e9b93,0xc9))[_0x7379('0x3e')](handleError(_0x3e9b93,null));};exports[_0x7379('0x45')]=function(_0x491157,_0xcf08e5){return db[_0x7379('0x29')]['bulkCreate'](_0x491157[_0x7379('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xcf08e5,0xc9))[_0x7379('0x3e')](handleError(_0xcf08e5,null));};exports[_0x7379('0x22')]=function(_0x110e55,_0x50ea2f){if(_0x110e55[_0x7379('0x44')]['id']){delete _0x110e55['body']['id'];}return db['AnalyticFieldReport'][_0x7379('0x42')]({'where':{'id':_0x110e55['params']['id']}})[_0x7379('0x23')](handleEntityNotFound(_0x50ea2f,null))[_0x7379('0x23')](saveUpdates(_0x110e55['body'],null))[_0x7379('0x23')](respondWithResult(_0x50ea2f,null))[_0x7379('0x3e')](handleError(_0x50ea2f,null));};exports['destroy']=function(_0x399154,_0x34cbae){return db['AnalyticFieldReport']['find']({'where':{'id':_0x399154[_0x7379('0x46')]['id']}})[_0x7379('0x23')](handleEntityNotFound(_0x34cbae,null))[_0x7379('0x23')](removeEntity(_0x34cbae,null))[_0x7379('0x3e')](handleError(_0x34cbae,null));};exports[_0x7379('0x47')]=function(_0x52663e,_0x5e0038){return db[_0x7379('0x29')][_0x7379('0x24')]({'where':{'id':_0x52663e['query'][_0x7379('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x7379('0x23')](respondWithResult(_0x5e0038,0xcc))[_0x7379('0x3e')](handleError(_0x5e0038,null));};exports[_0x7379('0x49')]=function(_0x2c8375,_0x369be2,_0x51aad0){return db['AnalyticCustomReport'][_0x7379('0x4a')]({'where':{'id':_0x2c8375[_0x7379('0x46')]['id']}})[_0x7379('0x23')](handleEntityNotFound(_0x369be2,null))['then'](function(_0x295924){if(_0x295924){return db[_0x7379('0x4b')]['transaction'](function(_0x1378d3){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x2c8375[_0x7379('0x46')]['id']},'transaction':_0x1378d3})[_0x7379('0x23')](function(_0x249da9){var _0x59a868=_[_0x7379('0x2c')](_0x2c8375[_0x7379('0x44')],function(_0x87c446){delete _0x87c446['id'];_0x87c446[_0x7379('0x4c')]=_0x2c8375[_0x7379('0x46')]['id'];return _0x87c446;});return db['AnalyticFieldReport'][_0x7379('0x45')](_0x59a868,{'transaction':_0x1378d3});});})[_0x7379('0x23')](function(){return db[_0x7379('0x29')][_0x7379('0x3c')]({'where':{'CustomReportId':_0x2c8375[_0x7379('0x46')]['id']}});});}})[_0x7379('0x23')](respondWithResult(_0x369be2,null))[_0x7379('0x3e')](handleError(_0x369be2,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 430a34f..e14be26 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 _0x0d83=['path','rimraf','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xfaec4e,_0x1ba854){var _0xfcfa4d=function(_0x59bdca){while(--_0x59bdca){_0xfaec4e['push'](_0xfaec4e['shift']());}};_0xfcfa4d(++_0x1ba854);}(_0x0d83,0x102));var _0x30d8=function(_0x47c43a,_0x4f91ae){_0x47c43a=_0x47c43a-0x0;var _0x179b1a=_0x0d83[_0x47c43a];return _0x179b1a;};'use strict';var _=require(_0x30d8('0x0'));var util=require(_0x30d8('0x1'));var logger=require(_0x30d8('0x2'))(_0x30d8('0x3'));var moment=require('moment');var BPromise=require(_0x30d8('0x4'));var rp=require(_0x30d8('0x5'));var fs=require('fs');var path=require(_0x30d8('0x6'));var rimraf=require(_0x30d8('0x7'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x30d8('0x8')]=function(_0x439bc3,_0x219840){return _0x439bc3['define'](_0x30d8('0x9'),attributes,{'tableName':_0x30d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1ae=['bluebird','path','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','lodash','util','../../config/logger','api','moment'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xb1ae,0x11d));var _0xeb1a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ae[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xeb1a('0x0'));var util=require(_0xeb1a('0x1'));var logger=require(_0xeb1a('0x2'))(_0xeb1a('0x3'));var moment=require(_0xeb1a('0x4'));var BPromise=require(_0xeb1a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb1a('0x6'));var rimraf=require('rimraf');var config=require(_0xeb1a('0x7'));var attributes=require(_0xeb1a('0x8'));module['exports']=function(_0x17bb97,_0x261639){return _0x17bb97['define'](_0xeb1a('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 17fd22b..2981dbb 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 _0xf710=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xcf9a6c,_0x2ebc18){var _0x470bef=function(_0xff63cb){while(--_0xff63cb){_0xcf9a6c['push'](_0xcf9a6c['shift']());}};_0x470bef(++_0x2ebc18);}(_0xf710,0x176));var _0x0f71=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xf710[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x0f71('0x0'));var util=require(_0x0f71('0x1'));var moment=require(_0x0f71('0x2'));var BPromise=require(_0x0f71('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f71('0x4'));var db=require(_0x0f71('0x5'))['db'];var utils=require(_0x0f71('0x6'));var logger=require(_0x0f71('0x7'))('rpc');var config=require(_0x0f71('0x8'));var jayson=require(_0x0f71('0x9'));var client=jayson[_0x0f71('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45db18,_0x2d1251,_0x5e9ea1){return new BPromise(function(_0x487d02,_0x5b5ba6){return client[_0x0f71('0xb')](_0x45db18,_0x5e9ea1)[_0x0f71('0xc')](function(_0x3f8f18){logger[_0x0f71('0xd')](_0x0f71('0xe'),_0x2d1251,_0x0f71('0xf'));logger['debug'](_0x0f71('0x10'),_0x2d1251,'request\x20sent',JSON[_0x0f71('0x11')](_0x3f8f18));if(_0x3f8f18['error']){if(_0x3f8f18[_0x0f71('0x12')][_0x0f71('0x13')]===0x1f4){logger[_0x0f71('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d1251,_0x3f8f18[_0x0f71('0x12')][_0x0f71('0x14')]);return _0x5b5ba6(_0x3f8f18[_0x0f71('0x12')][_0x0f71('0x14')]);}logger[_0x0f71('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d1251,_0x3f8f18[_0x0f71('0x12')]['message']);return _0x487d02(_0x3f8f18['error'][_0x0f71('0x14')]);}else{logger[_0x0f71('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d1251,_0x0f71('0xf'));_0x487d02(_0x3f8f18[_0x0f71('0x15')][_0x0f71('0x14')]);}})['catch'](function(_0x77483c){logger[_0x0f71('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2d1251,_0x77483c);_0x5b5ba6(_0x77483c);});});} \ No newline at end of file +var _0xd933=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd933,0x191));var _0x3d93=function(_0x2e06be,_0x2c5c9d){_0x2e06be=_0x2e06be-0x0;var _0x1a798a=_0xd933[_0x2e06be];return _0x1a798a;};'use strict';var _=require(_0x3d93('0x0'));var util=require(_0x3d93('0x1'));var moment=require(_0x3d93('0x2'));var BPromise=require(_0x3d93('0x3'));var rs=require(_0x3d93('0x4'));var fs=require('fs');var Redis=require(_0x3d93('0x5'));var db=require(_0x3d93('0x6'))['db'];var utils=require(_0x3d93('0x7'));var logger=require(_0x3d93('0x8'))(_0x3d93('0x9'));var config=require(_0x3d93('0xa'));var jayson=require(_0x3d93('0xb'));var client=jayson[_0x3d93('0xc')][_0x3d93('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2156af,_0x2c9542,_0x1c2809){return new BPromise(function(_0x6775f7,_0x23614b){return client[_0x3d93('0xe')](_0x2156af,_0x1c2809)[_0x3d93('0xf')](function(_0x31eb2e){logger[_0x3d93('0x10')](_0x3d93('0x11'),_0x2c9542,_0x3d93('0x12'));logger[_0x3d93('0x13')](_0x3d93('0x14'),_0x2c9542,_0x3d93('0x12'),JSON[_0x3d93('0x15')](_0x31eb2e));if(_0x31eb2e[_0x3d93('0x16')]){if(_0x31eb2e[_0x3d93('0x16')][_0x3d93('0x17')]===0x1f4){logger[_0x3d93('0x16')](_0x3d93('0x11'),_0x2c9542,_0x31eb2e[_0x3d93('0x16')]['message']);return _0x23614b(_0x31eb2e[_0x3d93('0x16')][_0x3d93('0x18')]);}logger[_0x3d93('0x16')](_0x3d93('0x11'),_0x2c9542,_0x31eb2e[_0x3d93('0x16')][_0x3d93('0x18')]);return _0x6775f7(_0x31eb2e[_0x3d93('0x16')][_0x3d93('0x18')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2c9542,_0x3d93('0x12'));_0x6775f7(_0x31eb2e[_0x3d93('0x19')][_0x3d93('0x18')]);}})[_0x3d93('0x1a')](function(_0x1d82c3){logger['error'](_0x3d93('0x11'),_0x2c9542,_0x1d82c3);_0x23614b(_0x1d82c3);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 0739457..1749a3d 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(_0x6619a,_0x12ef52){var _0x283279=function(_0x28e321){while(--_0x28e321){_0x6619a['push'](_0x6619a['shift']());}};_0x283279(++_0x12ef52);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x57c560,_0x17d821){var _0x33f2fa=function(_0x3845f3){while(--_0x3845f3){_0x57c560['push'](_0x57c560['shift']());}};_0x33f2fa(++_0x17d821);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 84e9bb2..7617fd7 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 _0x6a55=['sequelize','STRING','name','TEXT'];(function(_0x2cd921,_0x49bfcb){var _0x5ee39d=function(_0x4a80af){while(--_0x4a80af){_0x2cd921['push'](_0x2cd921['shift']());}};_0x5ee39d(++_0x49bfcb);}(_0x6a55,0x154));var _0x56a5=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0x6a55[_0x21cb7f];return _0x5a079a;};'use strict';var Sequelize=require(_0x56a5('0x0'));module['exports']={'name':{'type':Sequelize[_0x56a5('0x1')],'allowNull':![],'unique':_0x56a5('0x2')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x56a5('0x3')]},'description':{'type':Sequelize[_0x56a5('0x1')]}}; \ No newline at end of file +var _0x7d13=['exports','name','TEXT','STRING'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0x7d13,0x6c));var _0x37d1=function(_0x805a46,_0x56913a){_0x805a46=_0x805a46-0x0;var _0x3be5f1=_0x7d13[_0x805a46];return _0x3be5f1;};'use strict';var Sequelize=require('sequelize');module[_0x37d1('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x37d1('0x1')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x37d1('0x2')]},'description':{'type':Sequelize[_0x37d1('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index b5ab2f6..a199385 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x10d56d,_0x4679f2){_0x10d56d=_0x10d56d-0x0;var _0x41253a=_0x1cb9[_0x10d56d];return _0x41253a;};'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'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file +var _0x7217=['Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','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/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x1b4fc2,_0x286cac){var _0x1ff986=function(_0x49b3ad){while(--_0x49b3ad){_0x1b4fc2['push'](_0x1b4fc2['shift']());}};_0x1ff986(++_0x286cac);}(_0x7217,0x19e));var _0x7721=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x7217[_0x298ed3];return _0x5aad28;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){var _0x216f20=_0x395b15[_0x7721('0x2b')]({'plain':!![]});var _0x125564=_0x7721('0x2c');return db[_0x7721('0x2d')][_0x7721('0x2a')]({'where':{'type':_0x125564,'resourceId':_0x216f20['id']}})[_0x7721('0x29')](function(){return _0x395b15;});})[_0x7721('0x29')](function(){_0x1caad8[_0x7721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ddf,_0x5b0551){return function(_0x499b87){if(!_0x499b87){_0x258ddf[_0x7721('0x2e')](0x194);}return _0x499b87;};}function handleError(_0x343c19,_0x53c904){_0x53c904=_0x53c904||0x1f4;return function(_0x158d98){logger[_0x7721('0x2f')](_0x158d98[_0x7721('0x30')]);if(_0x158d98[_0x7721('0x31')]){delete _0x158d98[_0x7721('0x31')];}_0x343c19['status'](_0x53c904)[_0x7721('0x32')](_0x158d98);};}exports[_0x7721('0x33')]=function(_0x497f9f,_0x4a25c9){var _0xfde9ec={},_0x220bbf={},_0x48f329={'count':0x0,'rows':[]};var _0x46f772=_[_0x7721('0x34')](db[_0x7721('0x35')]['rawAttributes'],function(_0x3d9a32){return{'name':_0x3d9a32[_0x7721('0x36')],'type':_0x3d9a32[_0x7721('0x37')][_0x7721('0x38')]};});_0x220bbf[_0x7721('0x39')]=_['map'](_0x46f772,_0x7721('0x31'));_0x220bbf[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0x497f9f['query']);_0x220bbf[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x220bbf['model'],_0x220bbf[_0x7721('0x3a')]);_0xfde9ec['attributes']=_[_0x7721('0x3d')](_0x220bbf[_0x7721('0x39')],qs[_0x7721('0x3e')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x3e')]));_0xfde9ec[_0x7721('0x3f')]=_0xfde9ec[_0x7721('0x3f')][_0x7721('0x40')]?_0xfde9ec[_0x7721('0x3f')]:_0x220bbf[_0x7721('0x39')];if(!_0x497f9f[_0x7721('0x3a')]['hasOwnProperty'](_0x7721('0x41'))){_0xfde9ec['limit']=qs[_0x7721('0x21')](_0x497f9f[_0x7721('0x3a')][_0x7721('0x21')]);_0xfde9ec[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x497f9f[_0x7721('0x3a')]['offset']);}_0xfde9ec['order']=qs['sort'](_0x497f9f['query'][_0x7721('0x42')]);_0xfde9ec[_0x7721('0x43')]=qs[_0x7721('0x3c')](_[_0x7721('0x44')](_0x497f9f['query'],_0x220bbf[_0x7721('0x3c')]),_0x46f772);if(_0x497f9f['query'][_0x7721('0x45')]){_0xfde9ec[_0x7721('0x43')]=_['merge'](_0xfde9ec[_0x7721('0x43')],{'$or':_[_0x7721('0x34')](_0x46f772,function(_0x4e77ff){if(_0x4e77ff['type']!==_0x7721('0x46')){var _0xfc4dc4={};_0xfc4dc4[_0x4e77ff[_0x7721('0x31')]]={'$like':'%'+_0x497f9f[_0x7721('0x3a')]['filter']+'%'};return _0xfc4dc4;}})});}_0xfde9ec=_[_0x7721('0x47')]({},_0xfde9ec,_0x497f9f[_0x7721('0x48')]);var _0x40ce8c={'where':_0xfde9ec[_0x7721('0x43')]};return db[_0x7721('0x35')]['count'](_0x40ce8c)[_0x7721('0x29')](function(_0x4a2c28){_0x48f329[_0x7721('0x22')]=_0x4a2c28;if(_0x497f9f['query'][_0x7721('0x49')]){_0xfde9ec[_0x7721('0x4a')]=[{'all':!![]}];}return db[_0x7721('0x35')]['findAll'](_0xfde9ec);})[_0x7721('0x29')](function(_0x11d853){_0x48f329[_0x7721('0x4b')]=_0x11d853;return _0x48f329;})['then'](respondWithFilteredResult(_0x4a25c9,_0xfde9ec))[_0x7721('0x4c')](handleError(_0x4a25c9,null));};exports[_0x7721('0x4d')]=function(_0xdb3033,_0x2d5f35){var _0x135dbc={'raw':!![],'where':{'id':_0xdb3033[_0x7721('0x4e')]['id']}},_0x57d09b={};_0x57d09b['model']=_['keys'](db[_0x7721('0x35')][_0x7721('0x4f')]);_0x57d09b[_0x7721('0x3a')]=_[_0x7721('0x3b')](_0xdb3033[_0x7721('0x3a')]);_0x57d09b[_0x7721('0x3c')]=_[_0x7721('0x3d')](_0x57d09b[_0x7721('0x39')],_0x57d09b[_0x7721('0x3a')]);_0x135dbc[_0x7721('0x3f')]=_['intersection'](_0x57d09b['model'],qs[_0x7721('0x3e')](_0xdb3033[_0x7721('0x3a')][_0x7721('0x3e')]));_0x135dbc[_0x7721('0x3f')]=_0x135dbc['attributes'][_0x7721('0x40')]?_0x135dbc[_0x7721('0x3f')]:_0x57d09b['model'];if(_0xdb3033[_0x7721('0x3a')]['includeAll']){_0x135dbc[_0x7721('0x4a')]=[{'all':!![]}];}_0x135dbc=_['merge']({},_0x135dbc,_0xdb3033[_0x7721('0x48')]);return db[_0x7721('0x35')][_0x7721('0x50')](_0x135dbc)['then'](handleEntityNotFound(_0x2d5f35,null))[_0x7721('0x29')](respondWithResult(_0x2d5f35,null))[_0x7721('0x4c')](handleError(_0x2d5f35,null));};exports['create']=function(_0x223d93,_0x1196c2){return db[_0x7721('0x35')]['create'](_0x223d93[_0x7721('0x51')],{})['then'](function(_0xdb1ca8){var _0x310549=_0x223d93[_0x7721('0x52')][_0x7721('0x2b')]({'plain':!![]});if(!_0x310549)throw new Error(_0x7721('0x53'));if(_0x310549[_0x7721('0x54')]===_0x7721('0x52')){var _0x7fbb73=_0xdb1ca8[_0x7721('0x2b')]({'plain':!![]});var _0x3386aa=_0x7721('0x2c');return db[_0x7721('0x55')][_0x7721('0x50')]({'where':{'name':_0x3386aa,'userProfileId':_0x310549[_0x7721('0x56')]},'raw':!![]})[_0x7721('0x29')](function(_0x5b741d){if(_0x5b741d&&_0x5b741d[_0x7721('0x57')]===0x0){return db[_0x7721('0x2d')][_0x7721('0x58')]({'name':_0x7fbb73[_0x7721('0x31')],'resourceId':_0x7fbb73['id'],'type':_0x5b741d[_0x7721('0x31')],'sectionId':_0x5b741d['id']},{})[_0x7721('0x29')](function(){return _0xdb1ca8;});}else{return _0xdb1ca8;}})[_0x7721('0x4c')](function(_0x57484c){logger[_0x7721('0x2f')](_0x7721('0x59'),_0x57484c);throw _0x57484c;});}return _0xdb1ca8;})[_0x7721('0x29')](respondWithResult(_0x1196c2,0xc9))[_0x7721('0x4c')](handleError(_0x1196c2,null));};exports[_0x7721('0x28')]=function(_0x9c0d4,_0x7fbd6c){if(_0x9c0d4[_0x7721('0x51')]['id']){delete _0x9c0d4[_0x7721('0x51')]['id'];}return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x9c0d4['params']['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x7fbd6c,null))[_0x7721('0x29')](saveUpdates(_0x9c0d4[_0x7721('0x51')],null))[_0x7721('0x29')](respondWithResult(_0x7fbd6c,null))[_0x7721('0x4c')](handleError(_0x7fbd6c,null));};exports[_0x7721('0x2a')]=function(_0x41644f,_0x36fe6f){return db[_0x7721('0x35')][_0x7721('0x50')]({'where':{'id':_0x41644f[_0x7721('0x4e')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x36fe6f,null))[_0x7721('0x29')](removeEntity(_0x36fe6f,null))[_0x7721('0x4c')](handleError(_0x36fe6f,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 6b04dbc..0a8facb 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 _0x86b8=['moment','request-promise','path','rimraf','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x72069b,_0x5b4ca9){var _0x54f5d3=function(_0x22cbfb){while(--_0x22cbfb){_0x72069b['push'](_0x72069b['shift']());}};_0x54f5d3(++_0x5b4ca9);}(_0x86b8,0x15d));var _0x886b=function(_0x37cfa3,_0x3394ec){_0x37cfa3=_0x37cfa3-0x0;var _0x4bfa5c=_0x86b8[_0x37cfa3];return _0x4bfa5c;};'use strict';var _=require(_0x886b('0x0'));var util=require(_0x886b('0x1'));var logger=require(_0x886b('0x2'))('api');var moment=require(_0x886b('0x3'));var BPromise=require('bluebird');var rp=require(_0x886b('0x4'));var fs=require('fs');var path=require(_0x886b('0x5'));var rimraf=require(_0x886b('0x6'));var config=require('../../config/environment');var attributes=require(_0x886b('0x7'));module['exports']=function(_0x5b5ff5,_0x2c32bc){return _0x5b5ff5[_0x886b('0x8')](_0x886b('0x9'),attributes,{'tableName':_0x886b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2484=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','lodash'];(function(_0xe0e845,_0x8107bf){var _0x13cfce=function(_0x2fd3fd){while(--_0x2fd3fd){_0xe0e845['push'](_0xe0e845['shift']());}};_0x13cfce(++_0x8107bf);}(_0x2484,0x178));var _0x4248=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0x2484[_0x5b87ce];return _0x597aa7;};'use strict';var _=require(_0x4248('0x0'));var util=require(_0x4248('0x1'));var logger=require('../../config/logger')(_0x4248('0x2'));var moment=require(_0x4248('0x3'));var BPromise=require(_0x4248('0x4'));var rp=require(_0x4248('0x5'));var fs=require('fs');var path=require(_0x4248('0x6'));var rimraf=require(_0x4248('0x7'));var config=require(_0x4248('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x4248('0x9')]=function(_0x2d220,_0x43e730){return _0x2d220[_0x4248('0xa')](_0x4248('0xb'),attributes,{'tableName':_0x4248('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 d2b4e79..1c10f0f 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 _0x61ed=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x10e0f,_0x1aa508){var _0x1e0536=function(_0xa1ebe7){while(--_0xa1ebe7){_0x10e0f['push'](_0x10e0f['shift']());}};_0x1e0536(++_0x1aa508);}(_0x61ed,0xd2));var _0xd61e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x61ed[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xd61e('0x0'));var util=require('util');var moment=require(_0xd61e('0x1'));var BPromise=require(_0xd61e('0x2'));var rs=require(_0xd61e('0x3'));var fs=require('fs');var Redis=require(_0xd61e('0x4'));var db=require(_0xd61e('0x5'))['db'];var utils=require(_0xd61e('0x6'));var logger=require('../../config/logger')(_0xd61e('0x7'));var config=require(_0xd61e('0x8'));var jayson=require(_0xd61e('0x9'));var client=jayson['client'][_0xd61e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fb90a,_0x43da59,_0x47604d){return new BPromise(function(_0x1a5691,_0x80f8b7){return client['request'](_0x4fb90a,_0x47604d)['then'](function(_0xbf82a9){logger['info'](_0xd61e('0xb'),_0x43da59,_0xd61e('0xc'));logger[_0xd61e('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x43da59,'request\x20sent',JSON[_0xd61e('0xe')](_0xbf82a9));if(_0xbf82a9[_0xd61e('0xf')]){if(_0xbf82a9['error']['code']===0x1f4){logger[_0xd61e('0xf')](_0xd61e('0xb'),_0x43da59,_0xbf82a9[_0xd61e('0xf')][_0xd61e('0x10')]);return _0x80f8b7(_0xbf82a9[_0xd61e('0xf')][_0xd61e('0x10')]);}logger[_0xd61e('0xf')](_0xd61e('0xb'),_0x43da59,_0xbf82a9['error'][_0xd61e('0x10')]);return _0x1a5691(_0xbf82a9[_0xd61e('0xf')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x43da59,_0xd61e('0xc'));_0x1a5691(_0xbf82a9[_0xd61e('0x11')]['message']);}})[_0xd61e('0x12')](function(_0x3cff0b){logger[_0xd61e('0xf')](_0xd61e('0xb'),_0x43da59,_0x3cff0b);_0x80f8b7(_0x3cff0b);});});} \ No newline at end of file +var _0x99fb=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x99fb,0x1f3));var _0xb99f=function(_0x34e0d8,_0x1fe723){_0x34e0d8=_0x34e0d8-0x0;var _0x599523=_0x99fb[_0x34e0d8];return _0x599523;};'use strict';var _=require('lodash');var util=require(_0xb99f('0x0'));var moment=require(_0xb99f('0x1'));var BPromise=require(_0xb99f('0x2'));var rs=require(_0xb99f('0x3'));var fs=require('fs');var Redis=require(_0xb99f('0x4'));var db=require(_0xb99f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb99f('0x6'))(_0xb99f('0x7'));var config=require(_0xb99f('0x8'));var jayson=require(_0xb99f('0x9'));var client=jayson[_0xb99f('0xa')][_0xb99f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fc451,_0x3f93c5,_0x30bb0e){return new BPromise(function(_0x2b2682,_0x20df68){return client[_0xb99f('0xc')](_0x1fc451,_0x30bb0e)['then'](function(_0x35f451){logger[_0xb99f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3f93c5,_0xb99f('0xe'));logger[_0xb99f('0xf')](_0xb99f('0x10'),_0x3f93c5,'request\x20sent',JSON[_0xb99f('0x11')](_0x35f451));if(_0x35f451[_0xb99f('0x12')]){if(_0x35f451[_0xb99f('0x12')]['code']===0x1f4){logger[_0xb99f('0x12')](_0xb99f('0x13'),_0x3f93c5,_0x35f451['error'][_0xb99f('0x14')]);return _0x20df68(_0x35f451[_0xb99f('0x12')][_0xb99f('0x14')]);}logger[_0xb99f('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x3f93c5,_0x35f451[_0xb99f('0x12')][_0xb99f('0x14')]);return _0x2b2682(_0x35f451['error'][_0xb99f('0x14')]);}else{logger[_0xb99f('0xd')]('AnalyticMetric,\x20%s,\x20%s',_0x3f93c5,_0xb99f('0xe'));_0x2b2682(_0x35f451[_0xb99f('0x15')][_0xb99f('0x14')]);}})[_0xb99f('0x16')](function(_0x32de80){logger['error'](_0xb99f('0x13'),_0x3f93c5,_0x32de80);_0x20df68(_0x32de80);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 5a7f681..38dd22f 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 _0x277c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','create','put','/:id','update','destroy','exports','multer','path','connect-timeout'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x277c,0x153));var _0xc277=function(_0x4565c5,_0x5b944c){_0x4565c5=_0x4565c5-0x0;var _0x1a5484=_0x277c[_0x4565c5];return _0x1a5484;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['post']('/',auth[_0xc277('0x9')](),controller[_0xc277('0xc')]);router[_0xc277('0xd')](_0xc277('0xe'),auth[_0xc277('0x9')](),controller[_0xc277('0xf')]);router['delete']('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);module[_0xc277('0x11')]=router; \ No newline at end of file +var _0x4a80=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x4a80,0xbe));var _0x04a8=function(_0x151e4f,_0x45b100){_0x151e4f=_0x151e4f-0x0;var _0x3a7128=_0x4a80[_0x151e4f];return _0x3a7128;};'use strict';var multer=require(_0x04a8('0x0'));var util=require('util');var path=require(_0x04a8('0x1'));var timeout=require(_0x04a8('0x2'));var express=require('express');var router=express[_0x04a8('0x3')]();var fs_extra=require(_0x04a8('0x4'));var auth=require(_0x04a8('0x5'));var interaction=require(_0x04a8('0x6'));var config=require(_0x04a8('0x7'));var controller=require(_0x04a8('0x8'));router[_0x04a8('0x9')]('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0xb')]);router[_0x04a8('0x9')]('/:id',auth[_0x04a8('0xa')](),controller[_0x04a8('0xc')]);router[_0x04a8('0xd')]('/',auth[_0x04a8('0xa')](),controller[_0x04a8('0xe')]);router[_0x04a8('0xf')](_0x04a8('0x10'),auth[_0x04a8('0xa')](),controller[_0x04a8('0x11')]);router[_0x04a8('0x12')]('/:id',auth[_0x04a8('0xa')](),controller[_0x04a8('0x13')]);module[_0x04a8('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 1e9fee2..e25c012 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 _0xe16b=['TEXT','exports'];(function(_0x56a309,_0x4edef0){var _0x39f130=function(_0x437978){while(--_0x437978){_0x56a309['push'](_0x56a309['shift']());}};_0x39f130(++_0x4edef0);}(_0xe16b,0x155));var _0xbe16=function(_0x43f4c8,_0x22a037){_0x43f4c8=_0x43f4c8-0x0;var _0x3a2e0c=_0xe16b[_0x43f4c8];return _0x3a2e0c;};'use strict';var Sequelize=require('sequelize');module[_0xbe16('0x0')]={'tree':{'type':Sequelize[_0xbe16('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xc5de=['exports'];(function(_0x2e6c8d,_0x17c7ef){var _0x259c0f=function(_0x97387a){while(--_0x97387a){_0x2e6c8d['push'](_0x2e6c8d['shift']());}};_0x259c0f(++_0x17c7ef);}(_0xc5de,0x154));var _0xec5d=function(_0x863e9e,_0x5854b0){_0x863e9e=_0x863e9e-0x0;var _0x24fa60=_0xc5de[_0x863e9e];return _0x24fa60;};'use strict';var Sequelize=require('sequelize');module[_0xec5d('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 89e8a06..6cfc8ed 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 _0xb0ad=['zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','fieldName','type','key','model','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','body','rimraf'];(function(_0x3b6652,_0x32486d){var _0x14d39f=function(_0x3a595a){while(--_0x3a595a){_0x3b6652['push'](_0x3b6652['shift']());}};_0x14d39f(++_0x32486d);}(_0xb0ad,0x99));var _0xdb0a=function(_0x2ff72b,_0x8f2059){_0x2ff72b=_0x2ff72b-0x0;var _0x1b0854=_0xb0ad[_0x2ff72b];return _0x1b0854;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb0a('0x0'));var zipdir=require(_0xdb0a('0x1'));var jsonpatch=require(_0xdb0a('0x2'));var rp=require('request-promise');var moment=require(_0xdb0a('0x3'));var BPromise=require(_0xdb0a('0x4'));var Mustache=require(_0xdb0a('0x5'));var util=require(_0xdb0a('0x6'));var path=require('path');var sox=require(_0xdb0a('0x7'));var csv=require(_0xdb0a('0x8'));var ejs=require(_0xdb0a('0x9'));var fs=require('fs');var fs_extra=require(_0xdb0a('0xa'));var _=require(_0xdb0a('0xb'));var squel=require(_0xdb0a('0xc'));var crypto=require(_0xdb0a('0xd'));var jsforce=require(_0xdb0a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdb0a('0xf'));var Redis=require(_0xdb0a('0x10'));var authService=require(_0xdb0a('0x11'));var qs=require(_0xdb0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb0a('0x13'));var logger=require(_0xdb0a('0x14'))(_0xdb0a('0x15'));var utils=require(_0xdb0a('0x16'));var config=require(_0xdb0a('0x17'));var licenseUtil=require(_0xdb0a('0x18'));var db=require(_0xdb0a('0x19'))['db'];function respondWithStatusCode(_0x465ca5,_0xe2dc0b){_0xe2dc0b=_0xe2dc0b||0xcc;return function(_0x1917fd){if(_0x1917fd){return _0x465ca5[_0xdb0a('0x1a')](_0xe2dc0b);}return _0x465ca5['status'](_0xe2dc0b)[_0xdb0a('0x1b')]();};}function respondWithResult(_0x2fb2f3,_0x3677b0){_0x3677b0=_0x3677b0||0xc8;return function(_0xa75ecc){if(_0xa75ecc){return _0x2fb2f3[_0xdb0a('0x1c')](_0x3677b0)[_0xdb0a('0x1d')](_0xa75ecc);}};}function respondWithFilteredResult(_0xd77d58,_0x3c904a){return function(_0xc171f0){if(_0xc171f0){var _0x1cda7e=typeof _0x3c904a[_0xdb0a('0x1e')]===_0xdb0a('0x1f')&&typeof _0x3c904a[_0xdb0a('0x20')]===_0xdb0a('0x1f');var _0x13e51b=_0xc171f0[_0xdb0a('0x21')];var _0x4d05a3=_0x1cda7e?0x0:_0x3c904a[_0xdb0a('0x1e')];var _0x3d51b7=_0x1cda7e?_0xc171f0['count']:_0x3c904a[_0xdb0a('0x1e')]+_0x3c904a[_0xdb0a('0x20')];var _0xa2e185;if(_0x3d51b7>=_0x13e51b){_0x3d51b7=_0x13e51b;_0xa2e185=0xc8;}else{_0xa2e185=0xce;}_0xd77d58[_0xdb0a('0x1c')](_0xa2e185);return _0xd77d58[_0xdb0a('0x22')](_0xdb0a('0x23'),_0x4d05a3+'-'+_0x3d51b7+'/'+_0x13e51b)['json'](_0xc171f0);}return null;};}function patchUpdates(_0x4b1f65){return function(_0x9a242e){try{jsonpatch[_0xdb0a('0x24')](_0x9a242e,_0x4b1f65,!![]);}catch(_0x35424b){return BPromise[_0xdb0a('0x25')](_0x35424b);}return _0x9a242e[_0xdb0a('0x26')]();};}function saveUpdates(_0x16355d,_0x1ad4cd){return function(_0x45eaa7){if(_0x45eaa7){return _0x45eaa7[_0xdb0a('0x27')](_0x16355d)[_0xdb0a('0x28')](function(_0xfc85fd){return _0xfc85fd;});}return null;};}function removeEntity(_0x68b9dc,_0x27abaa){return function(_0x7f7a82){if(_0x7f7a82){return _0x7f7a82[_0xdb0a('0x29')]()['then'](function(){_0x68b9dc[_0xdb0a('0x1c')](0xcc)[_0xdb0a('0x1b')]();});}};}function handleEntityNotFound(_0x205cb3,_0x10a4b6){return function(_0x5aac2f){if(!_0x5aac2f){_0x205cb3[_0xdb0a('0x1a')](0x194);}return _0x5aac2f;};}function handleError(_0x376f7b,_0xe4024){_0xe4024=_0xe4024||0x1f4;return function(_0x1aa11a){logger[_0xdb0a('0x2a')](_0x1aa11a[_0xdb0a('0x2b')]);if(_0x1aa11a[_0xdb0a('0x2c')]){delete _0x1aa11a[_0xdb0a('0x2c')];}_0x376f7b[_0xdb0a('0x1c')](_0xe4024)[_0xdb0a('0x2d')](_0x1aa11a);};}exports[_0xdb0a('0x2e')]=function(_0x527136,_0x8fb45c){var _0x41c34b={},_0xc2de0f={},_0x43d70e={'count':0x0,'rows':[]};var _0x23fa46=_[_0xdb0a('0x2f')](db[_0xdb0a('0x30')]['rawAttributes'],function(_0x65d5cf){return{'name':_0x65d5cf[_0xdb0a('0x31')],'type':_0x65d5cf[_0xdb0a('0x32')][_0xdb0a('0x33')]};});_0xc2de0f[_0xdb0a('0x34')]=_[_0xdb0a('0x2f')](_0x23fa46,'name');_0xc2de0f['query']=_['keys'](_0x527136['query']);_0xc2de0f[_0xdb0a('0x35')]=_[_0xdb0a('0x36')](_0xc2de0f[_0xdb0a('0x34')],_0xc2de0f['query']);_0x41c34b[_0xdb0a('0x37')]=_[_0xdb0a('0x36')](_0xc2de0f[_0xdb0a('0x34')],qs[_0xdb0a('0x38')](_0x527136[_0xdb0a('0x39')][_0xdb0a('0x38')]));_0x41c34b[_0xdb0a('0x37')]=_0x41c34b[_0xdb0a('0x37')]['length']?_0x41c34b[_0xdb0a('0x37')]:_0xc2de0f['model'];if(!_0x527136[_0xdb0a('0x39')][_0xdb0a('0x3a')](_0xdb0a('0x3b'))){_0x41c34b[_0xdb0a('0x20')]=qs[_0xdb0a('0x20')](_0x527136[_0xdb0a('0x39')]['limit']);_0x41c34b[_0xdb0a('0x1e')]=qs[_0xdb0a('0x1e')](_0x527136['query'][_0xdb0a('0x1e')]);}_0x41c34b[_0xdb0a('0x3c')]=qs['sort'](_0x527136[_0xdb0a('0x39')][_0xdb0a('0x3d')]);_0x41c34b['where']=qs[_0xdb0a('0x35')](_['pick'](_0x527136[_0xdb0a('0x39')],_0xc2de0f[_0xdb0a('0x35')]),_0x23fa46);if(_0x527136[_0xdb0a('0x39')]['filter']){_0x41c34b['where']=_[_0xdb0a('0x3e')](_0x41c34b[_0xdb0a('0x3f')],{'$or':_['map'](_0x23fa46,function(_0x38aa17){if(_0x38aa17[_0xdb0a('0x32')]!==_0xdb0a('0x40')){var _0x1e3046={};_0x1e3046[_0x38aa17[_0xdb0a('0x2c')]]={'$like':'%'+_0x527136[_0xdb0a('0x39')][_0xdb0a('0x41')]+'%'};return _0x1e3046;}})});}_0x41c34b=_['merge']({},_0x41c34b,_0x527136[_0xdb0a('0x42')]);var _0x220816={'where':_0x41c34b[_0xdb0a('0x3f')]};return db[_0xdb0a('0x30')]['count'](_0x220816)[_0xdb0a('0x28')](function(_0x63f5a1){_0x43d70e[_0xdb0a('0x21')]=_0x63f5a1;if(_0x527136[_0xdb0a('0x39')]['includeAll']){_0x41c34b[_0xdb0a('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport']['findAll'](_0x41c34b);})['then'](function(_0xb76f4c){_0x43d70e[_0xdb0a('0x44')]=_0xb76f4c;return _0x43d70e;})[_0xdb0a('0x28')](respondWithFilteredResult(_0x8fb45c,_0x41c34b))[_0xdb0a('0x45')](handleError(_0x8fb45c,null));};exports[_0xdb0a('0x46')]=function(_0x2495a7,_0x1cacae){var _0x2a20c1={'raw':!![],'where':{'id':_0x2495a7[_0xdb0a('0x47')]['id']}},_0x15d5eb={};_0x15d5eb[_0xdb0a('0x34')]=_[_0xdb0a('0x48')](db['AnalyticTreeReport'][_0xdb0a('0x49')]);_0x15d5eb[_0xdb0a('0x39')]=_[_0xdb0a('0x48')](_0x2495a7[_0xdb0a('0x39')]);_0x15d5eb[_0xdb0a('0x35')]=_['intersection'](_0x15d5eb[_0xdb0a('0x34')],_0x15d5eb[_0xdb0a('0x39')]);_0x2a20c1[_0xdb0a('0x37')]=_[_0xdb0a('0x36')](_0x15d5eb[_0xdb0a('0x34')],qs[_0xdb0a('0x38')](_0x2495a7[_0xdb0a('0x39')][_0xdb0a('0x38')]));_0x2a20c1[_0xdb0a('0x37')]=_0x2a20c1[_0xdb0a('0x37')]['length']?_0x2a20c1['attributes']:_0x15d5eb[_0xdb0a('0x34')];if(_0x2495a7['query'][_0xdb0a('0x4a')]){_0x2a20c1['include']=[{'all':!![]}];}_0x2a20c1=_[_0xdb0a('0x3e')]({},_0x2a20c1,_0x2495a7[_0xdb0a('0x42')]);return db[_0xdb0a('0x30')][_0xdb0a('0x4b')](_0x2a20c1)['then'](handleEntityNotFound(_0x1cacae,null))[_0xdb0a('0x28')](respondWithResult(_0x1cacae,null))['catch'](handleError(_0x1cacae,null));};exports['create']=function(_0x1b0d87,_0x4ecaaa){return db[_0xdb0a('0x30')]['create'](_0x1b0d87[_0xdb0a('0x4c')],{})['then'](respondWithResult(_0x4ecaaa,0xc9))[_0xdb0a('0x45')](handleError(_0x4ecaaa,null));};exports[_0xdb0a('0x27')]=function(_0x121d8b,_0x11ebfb){if(_0x121d8b[_0xdb0a('0x4c')]['id']){delete _0x121d8b['body']['id'];}return db[_0xdb0a('0x30')][_0xdb0a('0x4b')]({'where':{'id':_0x121d8b[_0xdb0a('0x47')]['id']}})['then'](handleEntityNotFound(_0x11ebfb,null))[_0xdb0a('0x28')](saveUpdates(_0x121d8b[_0xdb0a('0x4c')],null))[_0xdb0a('0x28')](respondWithResult(_0x11ebfb,null))[_0xdb0a('0x45')](handleError(_0x11ebfb,null));};exports[_0xdb0a('0x29')]=function(_0x27ef8d,_0x98fd76){return db[_0xdb0a('0x30')][_0xdb0a('0x4b')]({'where':{'id':_0x27ef8d['params']['id']}})[_0xdb0a('0x28')](handleEntityNotFound(_0x98fd76,null))[_0xdb0a('0x28')](removeEntity(_0x98fd76,null))[_0xdb0a('0x45')](handleError(_0x98fd76,null));}; \ No newline at end of file +var _0x3480=['then','sendStatus','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','model','find','create','body','destroy','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','set','apply','save','update'];(function(_0x27b8f5,_0x1e5ddf){var _0x5a3de2=function(_0x39d9aa){while(--_0x39d9aa){_0x27b8f5['push'](_0x27b8f5['shift']());}};_0x5a3de2(++_0x1e5ddf);}(_0x3480,0x103));var _0x0348=function(_0x47d47f,_0x4ba23b){_0x47d47f=_0x47d47f-0x0;var _0x2a1758=_0x3480[_0x47d47f];return _0x2a1758;};'use strict';var emlformat=require(_0x0348('0x0'));var rimraf=require(_0x0348('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0348('0x2'));var moment=require(_0x0348('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0348('0x4'));var util=require(_0x0348('0x5'));var path=require(_0x0348('0x6'));var sox=require(_0x0348('0x7'));var csv=require('to-csv');var ejs=require(_0x0348('0x8'));var fs=require('fs');var fs_extra=require(_0x0348('0x9'));var _=require('lodash');var squel=require(_0x0348('0xa'));var crypto=require(_0x0348('0xb'));var jsforce=require(_0x0348('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0348('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0348('0xe'));var as=require(_0x0348('0xf'));var hardwareService=require(_0x0348('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x0348('0x11'));var config=require(_0x0348('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0348('0x13'))['db'];function respondWithStatusCode(_0x3ab060,_0x55f9cd){_0x55f9cd=_0x55f9cd||0xcc;return function(_0x2571cd){if(_0x2571cd){return _0x3ab060['sendStatus'](_0x55f9cd);}return _0x3ab060[_0x0348('0x14')](_0x55f9cd)[_0x0348('0x15')]();};}function respondWithResult(_0x234387,_0x567b1b){_0x567b1b=_0x567b1b||0xc8;return function(_0x3f52bc){if(_0x3f52bc){return _0x234387[_0x0348('0x14')](_0x567b1b)[_0x0348('0x16')](_0x3f52bc);}};}function respondWithFilteredResult(_0x308ca5,_0x1565e1){return function(_0x38a9c4){if(_0x38a9c4){var _0x2e89a2=typeof _0x1565e1[_0x0348('0x17')]===_0x0348('0x18')&&typeof _0x1565e1['limit']==='undefined';var _0x2d7d30=_0x38a9c4['count'];var _0x1de655=_0x2e89a2?0x0:_0x1565e1[_0x0348('0x17')];var _0x384784=_0x2e89a2?_0x38a9c4['count']:_0x1565e1[_0x0348('0x17')]+_0x1565e1['limit'];var _0x521210;if(_0x384784>=_0x2d7d30){_0x384784=_0x2d7d30;_0x521210=0xc8;}else{_0x521210=0xce;}_0x308ca5[_0x0348('0x14')](_0x521210);return _0x308ca5[_0x0348('0x19')]('Content-Range',_0x1de655+'-'+_0x384784+'/'+_0x2d7d30)['json'](_0x38a9c4);}return null;};}function patchUpdates(_0x5de64b){return function(_0x1a4402){try{jsonpatch[_0x0348('0x1a')](_0x1a4402,_0x5de64b,!![]);}catch(_0xa9baef){return BPromise['reject'](_0xa9baef);}return _0x1a4402[_0x0348('0x1b')]();};}function saveUpdates(_0x11fd40,_0x3d3032){return function(_0x2dd5f5){if(_0x2dd5f5){return _0x2dd5f5[_0x0348('0x1c')](_0x11fd40)['then'](function(_0x2e857d){return _0x2e857d;});}return null;};}function removeEntity(_0x2fadde,_0x408d2d){return function(_0x4dc513){if(_0x4dc513){return _0x4dc513['destroy']()[_0x0348('0x1d')](function(){_0x2fadde['status'](0xcc)[_0x0348('0x15')]();});}};}function handleEntityNotFound(_0x1f8a1c,_0x4fc7a0){return function(_0x529cc7){if(!_0x529cc7){_0x1f8a1c[_0x0348('0x1e')](0x194);}return _0x529cc7;};}function handleError(_0x2d72cd,_0x382b61){_0x382b61=_0x382b61||0x1f4;return function(_0x24bb60){logger[_0x0348('0x1f')](_0x24bb60[_0x0348('0x20')]);if(_0x24bb60['name']){delete _0x24bb60[_0x0348('0x21')];}_0x2d72cd[_0x0348('0x14')](_0x382b61)[_0x0348('0x22')](_0x24bb60);};}exports['index']=function(_0x2e2447,_0x57bab4){var _0x5e2021={},_0x5e8c9e={},_0x3fc2a8={'count':0x0,'rows':[]};var _0x41cff7=_[_0x0348('0x23')](db[_0x0348('0x24')][_0x0348('0x25')],function(_0xffa7bc){return{'name':_0xffa7bc[_0x0348('0x26')],'type':_0xffa7bc[_0x0348('0x27')][_0x0348('0x28')]};});_0x5e8c9e['model']=_[_0x0348('0x23')](_0x41cff7,'name');_0x5e8c9e[_0x0348('0x29')]=_[_0x0348('0x2a')](_0x2e2447[_0x0348('0x29')]);_0x5e8c9e[_0x0348('0x2b')]=_[_0x0348('0x2c')](_0x5e8c9e['model'],_0x5e8c9e[_0x0348('0x29')]);_0x5e2021[_0x0348('0x2d')]=_[_0x0348('0x2c')](_0x5e8c9e['model'],qs[_0x0348('0x2e')](_0x2e2447[_0x0348('0x29')]['fields']));_0x5e2021['attributes']=_0x5e2021[_0x0348('0x2d')][_0x0348('0x2f')]?_0x5e2021[_0x0348('0x2d')]:_0x5e8c9e['model'];if(!_0x2e2447[_0x0348('0x29')][_0x0348('0x30')](_0x0348('0x31'))){_0x5e2021[_0x0348('0x32')]=qs[_0x0348('0x32')](_0x2e2447[_0x0348('0x29')]['limit']);_0x5e2021[_0x0348('0x17')]=qs['offset'](_0x2e2447['query']['offset']);}_0x5e2021[_0x0348('0x33')]=qs[_0x0348('0x34')](_0x2e2447[_0x0348('0x29')]['sort']);_0x5e2021[_0x0348('0x35')]=qs[_0x0348('0x2b')](_[_0x0348('0x36')](_0x2e2447['query'],_0x5e8c9e[_0x0348('0x2b')]),_0x41cff7);if(_0x2e2447[_0x0348('0x29')][_0x0348('0x37')]){_0x5e2021[_0x0348('0x35')]=_[_0x0348('0x38')](_0x5e2021[_0x0348('0x35')],{'$or':_[_0x0348('0x23')](_0x41cff7,function(_0x3bd37f){if(_0x3bd37f[_0x0348('0x27')]!==_0x0348('0x39')){var _0x5c1b63={};_0x5c1b63[_0x3bd37f[_0x0348('0x21')]]={'$like':'%'+_0x2e2447['query'][_0x0348('0x37')]+'%'};return _0x5c1b63;}})});}_0x5e2021=_[_0x0348('0x38')]({},_0x5e2021,_0x2e2447[_0x0348('0x3a')]);var _0x3b4ddc={'where':_0x5e2021[_0x0348('0x35')]};return db[_0x0348('0x24')][_0x0348('0x3b')](_0x3b4ddc)['then'](function(_0x3754dc){_0x3fc2a8['count']=_0x3754dc;if(_0x2e2447[_0x0348('0x29')][_0x0348('0x3c')]){_0x5e2021[_0x0348('0x3d')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0348('0x3e')](_0x5e2021);})[_0x0348('0x1d')](function(_0x273cd9){_0x3fc2a8[_0x0348('0x3f')]=_0x273cd9;return _0x3fc2a8;})[_0x0348('0x1d')](respondWithFilteredResult(_0x57bab4,_0x5e2021))[_0x0348('0x40')](handleError(_0x57bab4,null));};exports[_0x0348('0x41')]=function(_0x58c521,_0x5f0fd2){var _0xa50eef={'raw':!![],'where':{'id':_0x58c521[_0x0348('0x42')]['id']}},_0x1c6598={};_0x1c6598[_0x0348('0x43')]=_[_0x0348('0x2a')](db[_0x0348('0x24')][_0x0348('0x25')]);_0x1c6598[_0x0348('0x29')]=_['keys'](_0x58c521[_0x0348('0x29')]);_0x1c6598[_0x0348('0x2b')]=_[_0x0348('0x2c')](_0x1c6598['model'],_0x1c6598[_0x0348('0x29')]);_0xa50eef[_0x0348('0x2d')]=_[_0x0348('0x2c')](_0x1c6598[_0x0348('0x43')],qs[_0x0348('0x2e')](_0x58c521[_0x0348('0x29')][_0x0348('0x2e')]));_0xa50eef[_0x0348('0x2d')]=_0xa50eef[_0x0348('0x2d')][_0x0348('0x2f')]?_0xa50eef['attributes']:_0x1c6598[_0x0348('0x43')];if(_0x58c521[_0x0348('0x29')][_0x0348('0x3c')]){_0xa50eef['include']=[{'all':!![]}];}_0xa50eef=_[_0x0348('0x38')]({},_0xa50eef,_0x58c521['options']);return db[_0x0348('0x24')][_0x0348('0x44')](_0xa50eef)[_0x0348('0x1d')](handleEntityNotFound(_0x5f0fd2,null))[_0x0348('0x1d')](respondWithResult(_0x5f0fd2,null))[_0x0348('0x40')](handleError(_0x5f0fd2,null));};exports[_0x0348('0x45')]=function(_0x4717b2,_0x5286bf){return db[_0x0348('0x24')]['create'](_0x4717b2['body'],{})[_0x0348('0x1d')](respondWithResult(_0x5286bf,0xc9))['catch'](handleError(_0x5286bf,null));};exports[_0x0348('0x1c')]=function(_0x5956be,_0x18c9ba){if(_0x5956be[_0x0348('0x46')]['id']){delete _0x5956be[_0x0348('0x46')]['id'];}return db[_0x0348('0x24')][_0x0348('0x44')]({'where':{'id':_0x5956be[_0x0348('0x42')]['id']}})[_0x0348('0x1d')](handleEntityNotFound(_0x18c9ba,null))[_0x0348('0x1d')](saveUpdates(_0x5956be[_0x0348('0x46')],null))['then'](respondWithResult(_0x18c9ba,null))['catch'](handleError(_0x18c9ba,null));};exports[_0x0348('0x47')]=function(_0xa181b9,_0x4e6b26){return db[_0x0348('0x24')][_0x0348('0x44')]({'where':{'id':_0xa181b9[_0x0348('0x42')]['id']}})[_0x0348('0x1d')](handleEntityNotFound(_0x4e6b26,null))['then'](removeEntity(_0x4e6b26,null))[_0x0348('0x40')](handleError(_0x4e6b26,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index ab0607b..dc70539 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 _0xa80f=['bluebird','request-promise','../../config/environment','define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa80f,0x1dc));var _0xfa80=function(_0x1817b0,_0x3aaaa1){_0x1817b0=_0x1817b0-0x0;var _0x5c10e6=_0xa80f[_0x1817b0];return _0x5c10e6;};'use strict';var _=require(_0xfa80('0x0'));var util=require('util');var logger=require(_0xfa80('0x1'))(_0xfa80('0x2'));var moment=require(_0xfa80('0x3'));var BPromise=require(_0xfa80('0x4'));var rp=require(_0xfa80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfa80('0x6'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x3137b5,_0x31c07f){return _0x3137b5[_0xfa80('0x7')](_0xfa80('0x8'),attributes,{'tableName':_0xfa80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa29c=['./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','api','rimraf','../../config/environment'];(function(_0x42279a,_0x25148b){var _0xb6a697=function(_0x1f180f){while(--_0x1f180f){_0x42279a['push'](_0x42279a['shift']());}};_0xb6a697(++_0x25148b);}(_0xa29c,0x1cf));var _0xca29=function(_0x339aa7,_0x41f0f7){_0x339aa7=_0x339aa7-0x0;var _0xa6c2bc=_0xa29c[_0x339aa7];return _0xa6c2bc;};'use strict';var _=require(_0xca29('0x0'));var util=require(_0xca29('0x1'));var logger=require('../../config/logger')(_0xca29('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(_0xca29('0x3'));var config=require(_0xca29('0x4'));var attributes=require(_0xca29('0x5'));module[_0xca29('0x6')]=function(_0x311e23,_0x4f9c22){return _0x311e23[_0xca29('0x7')](_0xca29('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index a3a65b0..6e81948 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1ce0c8,_0x1bf13a){var _0x194f0d=function(_0x275093){while(--_0x275093){_0x1ce0c8['push'](_0x1ce0c8['shift']());}};_0x194f0d(++_0x1bf13a);}(_0xadb5,0xad));var _0x5adb=function(_0x1ebb6c,_0x1c02fd){_0x1ebb6c=_0x1ebb6c-0x0;var _0x23ff5c=_0xadb5[_0x1ebb6c];return _0x23ff5c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3637ab,_0x1cd181){var _0x5581d8=function(_0x57bd23){while(--_0x57bd23){_0x3637ab['push'](_0x3637ab['shift']());}};_0x5581d8(++_0x1cd181);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1e6c9f,_0x5529c2){_0x1e6c9f=_0x1e6c9f-0x0;var _0x4ef527=_0x5f2f[_0x1e6c9f];return _0x4ef527;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c68d363..4719a66 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 _0x9ccc=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','create','update','delete','destroy'];(function(_0x186961,_0x20370e){var _0x350de8=function(_0xe98f13){while(--_0xe98f13){_0x186961['push'](_0x186961['shift']());}};_0x350de8(++_0x20370e);}(_0x9ccc,0x121));var _0xc9cc=function(_0x44efbc,_0x2e4836){_0x44efbc=_0x44efbc-0x0;var _0xf45590=_0x9ccc[_0x44efbc];return _0xf45590;};'use strict';var multer=require(_0xc9cc('0x0'));var util=require(_0xc9cc('0x1'));var path=require(_0xc9cc('0x2'));var timeout=require(_0xc9cc('0x3'));var express=require(_0xc9cc('0x4'));var router=express['Router']();var fs_extra=require(_0xc9cc('0x5'));var auth=require(_0xc9cc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc9cc('0x7'));var controller=require(_0xc9cc('0x8'));router['get']('/',auth[_0xc9cc('0x9')](),controller[_0xc9cc('0xa')]);router[_0xc9cc('0xb')](_0xc9cc('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xc9cc('0x9')](),controller[_0xc9cc('0xd')]);router['put']('/:id',auth[_0xc9cc('0x9')](),controller[_0xc9cc('0xe')]);router[_0xc9cc('0xf')](_0xc9cc('0xc'),auth[_0xc9cc('0x9')](),controller[_0xc9cc('0x10')]);module[_0xc9cc('0x11')]=router; \ No newline at end of file +var _0x65e9=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','post'];(function(_0x16a5f8,_0x1b0607){var _0x25943e=function(_0x5c5ae2){while(--_0x5c5ae2){_0x16a5f8['push'](_0x16a5f8['shift']());}};_0x25943e(++_0x1b0607);}(_0x65e9,0x137));var _0x965e=function(_0x2e4aa8,_0x38f60c){_0x2e4aa8=_0x2e4aa8-0x0;var _0x454e2c=_0x65e9[_0x2e4aa8];return _0x454e2c;};'use strict';var multer=require(_0x965e('0x0'));var util=require(_0x965e('0x1'));var path=require(_0x965e('0x2'));var timeout=require(_0x965e('0x3'));var express=require(_0x965e('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(_0x965e('0x5'));var controller=require(_0x965e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x965e('0x7')]);router[_0x965e('0x8')](_0x965e('0x9'),auth[_0x965e('0xa')](),controller['show']);router[_0x965e('0xb')]('/',auth['isAuthenticated'](),controller[_0x965e('0xc')]);router[_0x965e('0xd')](_0x965e('0x9'),auth[_0x965e('0xa')](),controller[_0x965e('0xe')]);router[_0x965e('0xf')](_0x965e('0x9'),auth[_0x965e('0xa')](),controller[_0x965e('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index f69ae3c..ea7a7bb 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 _0x0e35=['exports','STRING','sequelize'];(function(_0x539d47,_0x2c363a){var _0x1364fc=function(_0xfca11a){while(--_0xfca11a){_0x539d47['push'](_0x539d47['shift']());}};_0x1364fc(++_0x2c363a);}(_0x0e35,0xc2));var _0x50e3=function(_0x2c621d,_0x1e7ba6){_0x2c621d=_0x2c621d-0x0;var _0x482ada=_0x0e35[_0x2c621d];return _0x482ada;};'use strict';var Sequelize=require(_0x50e3('0x0'));module[_0x50e3('0x1')]={'name':{'type':Sequelize[_0x50e3('0x2')]},'basename':{'type':Sequelize[_0x50e3('0x2')]},'type':{'type':Sequelize[_0x50e3('0x2')]}}; \ No newline at end of file +var _0xb4e6=['sequelize','STRING'];(function(_0x4f7987,_0x3af1f3){var _0x1becb2=function(_0x541562){while(--_0x541562){_0x4f7987['push'](_0x4f7987['shift']());}};_0x1becb2(++_0x3af1f3);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x42020e,_0x4b92fb){_0x42020e=_0x42020e-0x0;var _0x561551=_0xb4e6[_0x42020e];return _0x561551;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b4e('0x1')]},'basename':{'type':Sequelize[_0x6b4e('0x1')]},'type':{'type':Sequelize[_0x6b4e('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 2d3ccbd..4af7b91 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 _0xa96f=['set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','Attachment','findAll','rows','catch','show','params','find','clone','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','download','findOne','ChatOfflineMessageId','join','root','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xa96f,0x142));var _0xfa96=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0xa96f[_0x4ca333];return _0x13b2e1;};'use strict';var emlformat=require(_0xfa96('0x0'));var rimraf=require(_0xfa96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa96('0x2'));var rp=require(_0xfa96('0x3'));var moment=require(_0xfa96('0x4'));var BPromise=require(_0xfa96('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfa96('0x6'));var sox=require(_0xfa96('0x7'));var csv=require('to-csv');var ejs=require(_0xfa96('0x8'));var fs=require('fs');var fs_extra=require(_0xfa96('0x9'));var _=require('lodash');var squel=require(_0xfa96('0xa'));var crypto=require(_0xfa96('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfa96('0xc'));var toCsv=require(_0xfa96('0xd'));var querystring=require('querystring');var Papa=require(_0xfa96('0xe'));var Redis=require(_0xfa96('0xf'));var authService=require(_0xfa96('0x10'));var qs=require(_0xfa96('0x11'));var as=require(_0xfa96('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa96('0x13'))(_0xfa96('0x14'));var utils=require('../../config/utils');var config=require(_0xfa96('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfa96('0x16'))['db'];function respondWithStatusCode(_0x1151f7,_0x65ebb0){_0x65ebb0=_0x65ebb0||0xcc;return function(_0x267054){if(_0x267054){return _0x1151f7[_0xfa96('0x17')](_0x65ebb0);}return _0x1151f7['status'](_0x65ebb0)['end']();};}function respondWithResult(_0x2f0a8e,_0x246c61){_0x246c61=_0x246c61||0xc8;return function(_0x142cd3){if(_0x142cd3){return _0x2f0a8e[_0xfa96('0x18')](_0x246c61)[_0xfa96('0x19')](_0x142cd3);}};}function respondWithFilteredResult(_0x23ef55,_0x325ffe){return function(_0x40aba7){if(_0x40aba7){var _0x1394af=typeof _0x325ffe[_0xfa96('0x1a')]===_0xfa96('0x1b')&&typeof _0x325ffe[_0xfa96('0x1c')]==='undefined';var _0x3cf43d=_0x40aba7[_0xfa96('0x1d')];var _0x4902c7=_0x1394af?0x0:_0x325ffe[_0xfa96('0x1a')];var _0x208808=_0x1394af?_0x40aba7[_0xfa96('0x1d')]:_0x325ffe['offset']+_0x325ffe[_0xfa96('0x1c')];var _0x3c293a;if(_0x208808>=_0x3cf43d){_0x208808=_0x3cf43d;_0x3c293a=0xc8;}else{_0x3c293a=0xce;}_0x23ef55['status'](_0x3c293a);return _0x23ef55[_0xfa96('0x1e')](_0xfa96('0x1f'),_0x4902c7+'-'+_0x208808+'/'+_0x3cf43d)[_0xfa96('0x19')](_0x40aba7);}return null;};}function patchUpdates(_0x20cb96){return function(_0x10e707){try{jsonpatch[_0xfa96('0x20')](_0x10e707,_0x20cb96,!![]);}catch(_0x23ec3d){return BPromise[_0xfa96('0x21')](_0x23ec3d);}return _0x10e707[_0xfa96('0x22')]();};}function saveUpdates(_0x6ccf35,_0x3c2f84){return function(_0x5e139d){if(_0x5e139d){return _0x5e139d[_0xfa96('0x23')](_0x6ccf35)['then'](function(_0x4a2dd9){return _0x4a2dd9;});}return null;};}function removeEntity(_0x638e6c,_0x25899e){return function(_0x23211c){if(_0x23211c){return _0x23211c[_0xfa96('0x24')]()['then'](function(){_0x638e6c[_0xfa96('0x18')](0xcc)[_0xfa96('0x25')]();});}};}function handleEntityNotFound(_0x4cbc92,_0x56e0eb){return function(_0xa67841){if(!_0xa67841){_0x4cbc92[_0xfa96('0x17')](0x194);}return _0xa67841;};}function handleError(_0x1232c9,_0x2035bf){_0x2035bf=_0x2035bf||0x1f4;return function(_0x27be01){logger[_0xfa96('0x26')](_0x27be01[_0xfa96('0x27')]);if(_0x27be01[_0xfa96('0x28')]){delete _0x27be01[_0xfa96('0x28')];}_0x1232c9['status'](_0x2035bf)['send'](_0x27be01);};}exports[_0xfa96('0x29')]=function(_0x3c3e1f,_0xff14f5){var _0x43d9da={},_0x582274={},_0x5df60d={'count':0x0,'rows':[]};var _0x3c4ed1=_['map'](db['Attachment'][_0xfa96('0x2a')],function(_0x2a12f0){return{'name':_0x2a12f0[_0xfa96('0x2b')],'type':_0x2a12f0[_0xfa96('0x2c')]['key']};});_0x582274[_0xfa96('0x2d')]=_[_0xfa96('0x2e')](_0x3c4ed1,_0xfa96('0x28'));_0x582274['query']=_[_0xfa96('0x2f')](_0x3c3e1f[_0xfa96('0x30')]);_0x582274[_0xfa96('0x31')]=_[_0xfa96('0x32')](_0x582274[_0xfa96('0x2d')],_0x582274[_0xfa96('0x30')]);_0x43d9da[_0xfa96('0x33')]=_[_0xfa96('0x32')](_0x582274['model'],qs[_0xfa96('0x34')](_0x3c3e1f['query'][_0xfa96('0x34')]));_0x43d9da['attributes']=_0x43d9da['attributes'][_0xfa96('0x35')]?_0x43d9da[_0xfa96('0x33')]:_0x582274[_0xfa96('0x2d')];if(!_0x3c3e1f['query'][_0xfa96('0x36')]('nolimit')){_0x43d9da['limit']=qs[_0xfa96('0x1c')](_0x3c3e1f[_0xfa96('0x30')][_0xfa96('0x1c')]);_0x43d9da[_0xfa96('0x1a')]=qs[_0xfa96('0x1a')](_0x3c3e1f[_0xfa96('0x30')][_0xfa96('0x1a')]);}_0x43d9da['order']=qs['sort'](_0x3c3e1f['query']['sort']);_0x43d9da['where']=qs[_0xfa96('0x31')](_[_0xfa96('0x37')](_0x3c3e1f['query'],_0x582274['filters']),_0x3c4ed1);if(_0x3c3e1f['query'][_0xfa96('0x38')]){_0x43d9da[_0xfa96('0x39')]=_[_0xfa96('0x3a')](_0x43d9da[_0xfa96('0x39')],{'$or':_[_0xfa96('0x2e')](_0x3c4ed1,function(_0x1f10d2){if(_0x1f10d2['type']!==_0xfa96('0x3b')){var _0x170fee={};_0x170fee[_0x1f10d2[_0xfa96('0x28')]]={'$like':'%'+_0x3c3e1f[_0xfa96('0x30')][_0xfa96('0x38')]+'%'};return _0x170fee;}})});}_0x43d9da=_[_0xfa96('0x3a')]({},_0x43d9da,_0x3c3e1f[_0xfa96('0x3c')]);var _0x684b98={'where':_0x43d9da['where']};return db['Attachment']['count'](_0x684b98)[_0xfa96('0x3d')](function(_0x5b0a1b){_0x5df60d[_0xfa96('0x1d')]=_0x5b0a1b;if(_0x3c3e1f[_0xfa96('0x30')][_0xfa96('0x3e')]){_0x43d9da[_0xfa96('0x3f')]=[{'all':!![]}];}return db[_0xfa96('0x40')][_0xfa96('0x41')](_0x43d9da);})[_0xfa96('0x3d')](function(_0x474b1a){_0x5df60d[_0xfa96('0x42')]=_0x474b1a;return _0x5df60d;})['then'](respondWithFilteredResult(_0xff14f5,_0x43d9da))[_0xfa96('0x43')](handleError(_0xff14f5,null));};exports[_0xfa96('0x44')]=function(_0x54d136,_0x375b48){var _0x38d8d8={'raw':!![],'where':{'id':_0x54d136[_0xfa96('0x45')]['id']}},_0x217109={};_0x217109[_0xfa96('0x2d')]=_[_0xfa96('0x2f')](db['Attachment'][_0xfa96('0x2a')]);_0x217109[_0xfa96('0x30')]=_[_0xfa96('0x2f')](_0x54d136[_0xfa96('0x30')]);_0x217109[_0xfa96('0x31')]=_[_0xfa96('0x32')](_0x217109[_0xfa96('0x2d')],_0x217109[_0xfa96('0x30')]);_0x38d8d8[_0xfa96('0x33')]=_[_0xfa96('0x32')](_0x217109[_0xfa96('0x2d')],qs[_0xfa96('0x34')](_0x54d136['query'][_0xfa96('0x34')]));_0x38d8d8[_0xfa96('0x33')]=_0x38d8d8['attributes'][_0xfa96('0x35')]?_0x38d8d8['attributes']:_0x217109[_0xfa96('0x2d')];if(_0x54d136[_0xfa96('0x30')]['includeAll']){_0x38d8d8['include']=[{'all':!![]}];}_0x38d8d8=_[_0xfa96('0x3a')]({},_0x38d8d8,_0x54d136[_0xfa96('0x3c')]);return db[_0xfa96('0x40')][_0xfa96('0x46')](_0x38d8d8)[_0xfa96('0x3d')](handleEntityNotFound(_0x375b48,null))[_0xfa96('0x3d')](respondWithResult(_0x375b48,null))[_0xfa96('0x43')](handleError(_0x375b48,null));};exports[_0xfa96('0x47')]=function(_0x148f44,_0x1fb7af){var _0x5ba98d={'where':{'id':_0x148f44[_0xfa96('0x45')]['id']}},_0x8b38ff={};_0x8b38ff[_0xfa96('0x2d')]=_[_0xfa96('0x2f')](db[_0xfa96('0x40')][_0xfa96('0x2a')]);_0x5ba98d[_0xfa96('0x33')]=_[_0xfa96('0x32')](_0x8b38ff['model'],qs[_0xfa96('0x34')](_0x148f44['query'][_0xfa96('0x34')]));_0x5ba98d[_0xfa96('0x33')]=_0x5ba98d[_0xfa96('0x33')]['length']?_0x5ba98d[_0xfa96('0x33')]:_0x8b38ff['model'];if(_0x148f44[_0xfa96('0x30')][_0xfa96('0x3e')]){_0x5ba98d[_0xfa96('0x3f')]=[{'all':!![]}];}_0x5ba98d=_[_0xfa96('0x3a')]({},_0x5ba98d,_0x148f44[_0xfa96('0x3c')]);return db[_0xfa96('0x40')][_0xfa96('0x46')](_0x5ba98d)[_0xfa96('0x3d')](handleEntityNotFound(_0x1fb7af,null))[_0xfa96('0x3d')](function(_0x459dd6){if(_0x459dd6){var _0x300f5a=_0x459dd6[_0xfa96('0x48')]({'plain':!![]});_0x300f5a=qs[_0xfa96('0x49')](_0x300f5a,['id',_0xfa96('0x4a'),_0xfa96('0x4b')]);_0x148f44['body']=_[_0xfa96('0x49')](_0x148f44[_0xfa96('0x4c')],['id','createdAt','updatedAt']);return db[_0xfa96('0x40')][_0xfa96('0x4d')](_[_0xfa96('0x3a')](_0x300f5a,_0x148f44[_0xfa96('0x4c')]),{'include':_0x148f44[_0xfa96('0x30')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xfa96('0x3d')](respondWithResult(_0x1fb7af,0xc9))[_0xfa96('0x43')](handleError(_0x1fb7af,null));};exports[_0xfa96('0x23')]=function(_0x4c99e8,_0x7cd0ef){if(_0x4c99e8['body']['id']){delete _0x4c99e8['body']['id'];}return db['Attachment'][_0xfa96('0x46')]({'where':{'id':_0x4c99e8[_0xfa96('0x45')]['id']}})['then'](handleEntityNotFound(_0x7cd0ef,null))['then'](saveUpdates(_0x4c99e8[_0xfa96('0x4c')],null))[_0xfa96('0x3d')](respondWithResult(_0x7cd0ef,null))[_0xfa96('0x43')](handleError(_0x7cd0ef,null));};exports['destroy']=function(_0x2911e7,_0x308b81){return db[_0xfa96('0x40')]['find']({'where':{'id':_0x2911e7[_0xfa96('0x45')]['id']}})[_0xfa96('0x3d')](handleEntityNotFound(_0x308b81,null))['then'](removeEntity(_0x308b81,null))[_0xfa96('0x43')](handleError(_0x308b81,null));};exports[_0xfa96('0x4d')]=function(_0x187464,_0x3d19fd,_0xee46aa){_0x187464[_0xfa96('0x4c')][_0xfa96('0x28')]=_0x187464[_0xfa96('0x4e')][_0xfa96('0x4f')];_0x187464[_0xfa96('0x4c')][_0xfa96('0x50')]=_0x187464[_0xfa96('0x4e')][_0xfa96('0x51')];_0x187464[_0xfa96('0x4c')]['type']=_0x187464['file']['mimetype'];return db[_0xfa96('0x40')]['create'](_0x187464[_0xfa96('0x4c')])[_0xfa96('0x3d')](respondWithResult(_0x3d19fd,0xc9))[_0xfa96('0x43')](handleError(_0x3d19fd,null));};exports[_0xfa96('0x52')]=function(_0x1320be,_0x14bfed,_0x185463){return db[_0xfa96('0x40')][_0xfa96('0x53')]({'where':{'id':_0x1320be['params']['id']},'raw':!![]})[_0xfa96('0x3d')](handleEntityNotFound(_0x14bfed,null))['then'](function(_0x39fc89){if(_0x39fc89){var _0x4bb9d9=_0x39fc89[_0xfa96('0x54')]!==null;var _0x59570d=path[_0xfa96('0x55')](config[_0xfa96('0x56')],'server/files/attachments/');if(_0x4bb9d9){_0x59570d=path[_0xfa96('0x55')](_0x59570d,_0xfa96('0x57'));}var _0xf263cb=path[_0xfa96('0x55')](_0x59570d,_0x39fc89['basename']);return _0x14bfed[_0xfa96('0x52')](_0xf263cb);}})[_0xfa96('0x43')](handleError(_0x14bfed,null));}; \ No newline at end of file +var _0x9f37=['sort','where','pick','merge','VIRTUAL','filter','include','findAll','show','rawAttributes','keys','length','options','find','catch','clone','params','get','omit','createdAt','body','create','includeAll','destroy','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','save','update','then','error','stack','name','send','index','map','Attachment','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x1f9fb5,_0x3e7ce8){var _0xac1c28=function(_0x4826b9){while(--_0x4826b9){_0x1f9fb5['push'](_0x1f9fb5['shift']());}};_0xac1c28(++_0x3e7ce8);}(_0x9f37,0x1d6));var _0x79f3=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x9f37[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x79f3('0x0'));var jsonpatch=require(_0x79f3('0x1'));var rp=require(_0x79f3('0x2'));var moment=require(_0x79f3('0x3'));var BPromise=require(_0x79f3('0x4'));var Mustache=require(_0x79f3('0x5'));var util=require(_0x79f3('0x6'));var path=require(_0x79f3('0x7'));var sox=require(_0x79f3('0x8'));var csv=require('to-csv');var ejs=require(_0x79f3('0x9'));var fs=require('fs');var fs_extra=require(_0x79f3('0xa'));var _=require(_0x79f3('0xb'));var squel=require(_0x79f3('0xc'));var crypto=require(_0x79f3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79f3('0xe'));var toCsv=require(_0x79f3('0xf'));var querystring=require('querystring');var Papa=require(_0x79f3('0x10'));var Redis=require(_0x79f3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x79f3('0x12'))(_0x79f3('0x13'));var utils=require(_0x79f3('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x79f3('0x15'))['db'];function respondWithStatusCode(_0x2245c4,_0x556cb9){_0x556cb9=_0x556cb9||0xcc;return function(_0x15220e){if(_0x15220e){return _0x2245c4[_0x79f3('0x16')](_0x556cb9);}return _0x2245c4[_0x79f3('0x17')](_0x556cb9)[_0x79f3('0x18')]();};}function respondWithResult(_0x55c005,_0x2492e3){_0x2492e3=_0x2492e3||0xc8;return function(_0x59f069){if(_0x59f069){return _0x55c005[_0x79f3('0x17')](_0x2492e3)[_0x79f3('0x19')](_0x59f069);}};}function respondWithFilteredResult(_0x5d08cc,_0x16db52){return function(_0x4dd72c){if(_0x4dd72c){var _0x58286a=typeof _0x16db52['offset']===_0x79f3('0x1a')&&typeof _0x16db52[_0x79f3('0x1b')]===_0x79f3('0x1a');var _0x43323a=_0x4dd72c['count'];var _0x5b082e=_0x58286a?0x0:_0x16db52['offset'];var _0x4dd41a=_0x58286a?_0x4dd72c[_0x79f3('0x1c')]:_0x16db52[_0x79f3('0x1d')]+_0x16db52[_0x79f3('0x1b')];var _0x13c22b;if(_0x4dd41a>=_0x43323a){_0x4dd41a=_0x43323a;_0x13c22b=0xc8;}else{_0x13c22b=0xce;}_0x5d08cc[_0x79f3('0x17')](_0x13c22b);return _0x5d08cc['set']('Content-Range',_0x5b082e+'-'+_0x4dd41a+'/'+_0x43323a)[_0x79f3('0x19')](_0x4dd72c);}return null;};}function patchUpdates(_0x175bdd){return function(_0x500090){try{jsonpatch[_0x79f3('0x1e')](_0x500090,_0x175bdd,!![]);}catch(_0xbc41a2){return BPromise['reject'](_0xbc41a2);}return _0x500090[_0x79f3('0x1f')]();};}function saveUpdates(_0x5c2dc5,_0x1a43aa){return function(_0x210998){if(_0x210998){return _0x210998[_0x79f3('0x20')](_0x5c2dc5)[_0x79f3('0x21')](function(_0x4098c9){return _0x4098c9;});}return null;};}function removeEntity(_0xfb71bf,_0x3be2ac){return function(_0x2c0723){if(_0x2c0723){return _0x2c0723['destroy']()['then'](function(){_0xfb71bf['status'](0xcc)[_0x79f3('0x18')]();});}};}function handleEntityNotFound(_0x54eb22,_0x40ddd8){return function(_0x263efe){if(!_0x263efe){_0x54eb22[_0x79f3('0x16')](0x194);}return _0x263efe;};}function handleError(_0x3cab8f,_0x38af41){_0x38af41=_0x38af41||0x1f4;return function(_0x2e757a){logger[_0x79f3('0x22')](_0x2e757a[_0x79f3('0x23')]);if(_0x2e757a[_0x79f3('0x24')]){delete _0x2e757a[_0x79f3('0x24')];}_0x3cab8f[_0x79f3('0x17')](_0x38af41)[_0x79f3('0x25')](_0x2e757a);};}exports[_0x79f3('0x26')]=function(_0x3cca3f,_0xf19594){var _0x44981d={},_0x123592={},_0x45922c={'count':0x0,'rows':[]};var _0x2065f4=_[_0x79f3('0x27')](db[_0x79f3('0x28')]['rawAttributes'],function(_0xd2de16){return{'name':_0xd2de16[_0x79f3('0x29')],'type':_0xd2de16[_0x79f3('0x2a')]['key']};});_0x123592[_0x79f3('0x2b')]=_['map'](_0x2065f4,_0x79f3('0x24'));_0x123592[_0x79f3('0x2c')]=_['keys'](_0x3cca3f['query']);_0x123592[_0x79f3('0x2d')]=_[_0x79f3('0x2e')](_0x123592[_0x79f3('0x2b')],_0x123592[_0x79f3('0x2c')]);_0x44981d[_0x79f3('0x2f')]=_[_0x79f3('0x2e')](_0x123592[_0x79f3('0x2b')],qs['fields'](_0x3cca3f[_0x79f3('0x2c')][_0x79f3('0x30')]));_0x44981d[_0x79f3('0x2f')]=_0x44981d[_0x79f3('0x2f')]['length']?_0x44981d[_0x79f3('0x2f')]:_0x123592['model'];if(!_0x3cca3f['query'][_0x79f3('0x31')](_0x79f3('0x32'))){_0x44981d[_0x79f3('0x1b')]=qs[_0x79f3('0x1b')](_0x3cca3f[_0x79f3('0x2c')]['limit']);_0x44981d['offset']=qs[_0x79f3('0x1d')](_0x3cca3f[_0x79f3('0x2c')][_0x79f3('0x1d')]);}_0x44981d[_0x79f3('0x33')]=qs[_0x79f3('0x34')](_0x3cca3f[_0x79f3('0x2c')]['sort']);_0x44981d[_0x79f3('0x35')]=qs[_0x79f3('0x2d')](_[_0x79f3('0x36')](_0x3cca3f[_0x79f3('0x2c')],_0x123592[_0x79f3('0x2d')]),_0x2065f4);if(_0x3cca3f[_0x79f3('0x2c')]['filter']){_0x44981d[_0x79f3('0x35')]=_[_0x79f3('0x37')](_0x44981d[_0x79f3('0x35')],{'$or':_[_0x79f3('0x27')](_0x2065f4,function(_0xb96e63){if(_0xb96e63[_0x79f3('0x2a')]!==_0x79f3('0x38')){var _0x56127c={};_0x56127c[_0xb96e63[_0x79f3('0x24')]]={'$like':'%'+_0x3cca3f[_0x79f3('0x2c')][_0x79f3('0x39')]+'%'};return _0x56127c;}})});}_0x44981d=_[_0x79f3('0x37')]({},_0x44981d,_0x3cca3f['options']);var _0x2cbb8c={'where':_0x44981d[_0x79f3('0x35')]};return db['Attachment'][_0x79f3('0x1c')](_0x2cbb8c)['then'](function(_0x37585b){_0x45922c[_0x79f3('0x1c')]=_0x37585b;if(_0x3cca3f[_0x79f3('0x2c')]['includeAll']){_0x44981d[_0x79f3('0x3a')]=[{'all':!![]}];}return db['Attachment'][_0x79f3('0x3b')](_0x44981d);})[_0x79f3('0x21')](function(_0x214fbc){_0x45922c['rows']=_0x214fbc;return _0x45922c;})[_0x79f3('0x21')](respondWithFilteredResult(_0xf19594,_0x44981d))['catch'](handleError(_0xf19594,null));};exports[_0x79f3('0x3c')]=function(_0x3303a4,_0x79ac2b){var _0x3cdd08={'raw':!![],'where':{'id':_0x3303a4['params']['id']}},_0x2e09dc={};_0x2e09dc[_0x79f3('0x2b')]=_['keys'](db[_0x79f3('0x28')][_0x79f3('0x3d')]);_0x2e09dc[_0x79f3('0x2c')]=_[_0x79f3('0x3e')](_0x3303a4[_0x79f3('0x2c')]);_0x2e09dc[_0x79f3('0x2d')]=_[_0x79f3('0x2e')](_0x2e09dc[_0x79f3('0x2b')],_0x2e09dc[_0x79f3('0x2c')]);_0x3cdd08[_0x79f3('0x2f')]=_[_0x79f3('0x2e')](_0x2e09dc[_0x79f3('0x2b')],qs[_0x79f3('0x30')](_0x3303a4[_0x79f3('0x2c')]['fields']));_0x3cdd08[_0x79f3('0x2f')]=_0x3cdd08[_0x79f3('0x2f')][_0x79f3('0x3f')]?_0x3cdd08[_0x79f3('0x2f')]:_0x2e09dc[_0x79f3('0x2b')];if(_0x3303a4[_0x79f3('0x2c')]['includeAll']){_0x3cdd08[_0x79f3('0x3a')]=[{'all':!![]}];}_0x3cdd08=_[_0x79f3('0x37')]({},_0x3cdd08,_0x3303a4[_0x79f3('0x40')]);return db['Attachment'][_0x79f3('0x41')](_0x3cdd08)[_0x79f3('0x21')](handleEntityNotFound(_0x79ac2b,null))[_0x79f3('0x21')](respondWithResult(_0x79ac2b,null))[_0x79f3('0x42')](handleError(_0x79ac2b,null));};exports[_0x79f3('0x43')]=function(_0x3f5005,_0x2ab16d){var _0x3b7ff4={'where':{'id':_0x3f5005[_0x79f3('0x44')]['id']}},_0x191979={};_0x191979['model']=_[_0x79f3('0x3e')](db['Attachment'][_0x79f3('0x3d')]);_0x3b7ff4[_0x79f3('0x2f')]=_[_0x79f3('0x2e')](_0x191979['model'],qs[_0x79f3('0x30')](_0x3f5005[_0x79f3('0x2c')][_0x79f3('0x30')]));_0x3b7ff4['attributes']=_0x3b7ff4['attributes'][_0x79f3('0x3f')]?_0x3b7ff4['attributes']:_0x191979['model'];if(_0x3f5005['query']['includeAll']){_0x3b7ff4[_0x79f3('0x3a')]=[{'all':!![]}];}_0x3b7ff4=_[_0x79f3('0x37')]({},_0x3b7ff4,_0x3f5005[_0x79f3('0x40')]);return db[_0x79f3('0x28')][_0x79f3('0x41')](_0x3b7ff4)['then'](handleEntityNotFound(_0x2ab16d,null))[_0x79f3('0x21')](function(_0x5ae46a){if(_0x5ae46a){var _0x397b80=_0x5ae46a[_0x79f3('0x45')]({'plain':!![]});_0x397b80=qs[_0x79f3('0x46')](_0x397b80,['id',_0x79f3('0x47'),'updatedAt']);_0x3f5005[_0x79f3('0x48')]=_['omit'](_0x3f5005['body'],['id','createdAt','updatedAt']);return db[_0x79f3('0x28')][_0x79f3('0x49')](_[_0x79f3('0x37')](_0x397b80,_0x3f5005['body']),{'include':_0x3f5005[_0x79f3('0x2c')][_0x79f3('0x4a')]?[{'all':!![]}]:undefined});}})[_0x79f3('0x21')](respondWithResult(_0x2ab16d,0xc9))['catch'](handleError(_0x2ab16d,null));};exports['update']=function(_0x152c9e,_0x48be9c){if(_0x152c9e[_0x79f3('0x48')]['id']){delete _0x152c9e[_0x79f3('0x48')]['id'];}return db['Attachment'][_0x79f3('0x41')]({'where':{'id':_0x152c9e[_0x79f3('0x44')]['id']}})[_0x79f3('0x21')](handleEntityNotFound(_0x48be9c,null))[_0x79f3('0x21')](saveUpdates(_0x152c9e[_0x79f3('0x48')],null))[_0x79f3('0x21')](respondWithResult(_0x48be9c,null))['catch'](handleError(_0x48be9c,null));};exports[_0x79f3('0x4b')]=function(_0x5d3b65,_0x395cde){return db[_0x79f3('0x28')]['find']({'where':{'id':_0x5d3b65[_0x79f3('0x44')]['id']}})['then'](handleEntityNotFound(_0x395cde,null))['then'](removeEntity(_0x395cde,null))[_0x79f3('0x42')](handleError(_0x395cde,null));};exports[_0x79f3('0x49')]=function(_0x293c89,_0x1639c7,_0x1292eb){_0x293c89['body']['name']=_0x293c89[_0x79f3('0x4c')][_0x79f3('0x4d')];_0x293c89[_0x79f3('0x48')][_0x79f3('0x4e')]=_0x293c89[_0x79f3('0x4c')][_0x79f3('0x4f')];_0x293c89['body']['type']=_0x293c89['file'][_0x79f3('0x50')];return db[_0x79f3('0x28')][_0x79f3('0x49')](_0x293c89[_0x79f3('0x48')])['then'](respondWithResult(_0x1639c7,0xc9))[_0x79f3('0x42')](handleError(_0x1639c7,null));};exports['download']=function(_0x574106,_0x123545,_0x647682){return db[_0x79f3('0x28')]['findOne']({'where':{'id':_0x574106['params']['id']},'raw':!![]})[_0x79f3('0x21')](handleEntityNotFound(_0x123545,null))[_0x79f3('0x21')](function(_0x17ca4c){if(_0x17ca4c){var _0x230073=_0x17ca4c[_0x79f3('0x51')]!==null;var _0xd220b7=path[_0x79f3('0x52')](config[_0x79f3('0x53')],_0x79f3('0x54'));if(_0x230073){_0xd220b7=path[_0x79f3('0x52')](_0xd220b7,_0x79f3('0x55'));}var _0x59b1eb=path[_0x79f3('0x52')](_0xd220b7,_0x17ca4c[_0x79f3('0x4e')]);return _0x123545[_0x79f3('0x56')](_0x59b1eb);}})[_0x79f3('0x42')](handleError(_0x123545,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 71d19e4..c6f4a23 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 _0x020f=['exports','Attachment','attachments','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x020f,0x14d));var _0xf020=function(_0x59b912,_0x16b82d){_0x59b912=_0x59b912-0x0;var _0x4f2226=_0x020f[_0x59b912];return _0x4f2226;};'use strict';var _=require('lodash');var util=require(_0xf020('0x0'));var logger=require(_0xf020('0x1'))(_0xf020('0x2'));var moment=require(_0xf020('0x3'));var BPromise=require('bluebird');var rp=require(_0xf020('0x4'));var fs=require('fs');var path=require(_0xf020('0x5'));var rimraf=require(_0xf020('0x6'));var config=require(_0xf020('0x7'));var attributes=require('./attachment.attributes');module[_0xf020('0x8')]=function(_0x1b65c9,_0x4b119e){return _0x1b65c9['define'](_0xf020('0x9'),attributes,{'tableName':_0xf020('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d7e=['./attachment.attributes','exports','define','Attachment','attachments','lodash','util','moment','bluebird','path','../../config/environment'];(function(_0x359103,_0x10f8a6){var _0x50f8cd=function(_0xc3c9e0){while(--_0xc3c9e0){_0x359103['push'](_0x359103['shift']());}};_0x50f8cd(++_0x10f8a6);}(_0x8d7e,0x186));var _0xe8d7=function(_0x5493fb,_0x2250cd){_0x5493fb=_0x5493fb-0x0;var _0x4ecef8=_0x8d7e[_0x5493fb];return _0x4ecef8;};'use strict';var _=require(_0xe8d7('0x0'));var util=require(_0xe8d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe8d7('0x2'));var BPromise=require(_0xe8d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8d7('0x4'));var rimraf=require('rimraf');var config=require(_0xe8d7('0x5'));var attributes=require(_0xe8d7('0x6'));module[_0xe8d7('0x7')]=function(_0x3085da,_0x1209c2){return _0x3085da[_0xe8d7('0x8')](_0xe8d7('0x9'),attributes,{'tableName':_0xe8d7('0xa'),'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 0894348..05ff377 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 _0x1752=['error','message','result','catch','CreateAttachment','Attachment','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent'];(function(_0x3c6678,_0x5b7a3a){var _0x4cdff2=function(_0x3c761b){while(--_0x3c761b){_0x3c6678['push'](_0x3c6678['shift']());}};_0x4cdff2(++_0x5b7a3a);}(_0x1752,0xa5));var _0x2175=function(_0x1ccc56,_0x26d7c1){_0x1ccc56=_0x1ccc56-0x0;var _0xf831ab=_0x1752[_0x1ccc56];return _0xf831ab;};'use strict';var _=require('lodash');var util=require(_0x2175('0x0'));var moment=require(_0x2175('0x1'));var BPromise=require(_0x2175('0x2'));var rs=require(_0x2175('0x3'));var fs=require('fs');var Redis=require(_0x2175('0x4'));var db=require(_0x2175('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2175('0x6'))(_0x2175('0x7'));var config=require(_0x2175('0x8'));var jayson=require(_0x2175('0x9'));var client=jayson[_0x2175('0xa')][_0x2175('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19ca87,_0x1bd937,_0x339e4d){return new BPromise(function(_0x672ff1,_0x516ccc){return client[_0x2175('0xc')](_0x19ca87,_0x339e4d)[_0x2175('0xd')](function(_0x407a71){logger[_0x2175('0xe')](_0x2175('0xf'),_0x1bd937,'request\x20sent');logger['debug']('Attachment,\x20%s,\x20%s,\x20%s',_0x1bd937,_0x2175('0x10'),JSON['stringify'](_0x407a71));if(_0x407a71['error']){if(_0x407a71['error']['code']===0x1f4){logger[_0x2175('0x11')]('Attachment,\x20%s,\x20%s',_0x1bd937,_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);return _0x516ccc(_0x407a71['error'][_0x2175('0x12')]);}logger[_0x2175('0x11')](_0x2175('0xf'),_0x1bd937,_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);return _0x672ff1(_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);}else{logger[_0x2175('0xe')]('Attachment,\x20%s,\x20%s',_0x1bd937,'request\x20sent');_0x672ff1(_0x407a71[_0x2175('0x13')][_0x2175('0x12')]);}})[_0x2175('0x14')](function(_0x4e7cf1){logger['error']('Attachment,\x20%s,\x20%s',_0x1bd937,_0x4e7cf1);_0x516ccc(_0x4e7cf1);});});}exports[_0x2175('0x15')]=function(_0x377586){var _0x4cb089=this;return new Promise(function(_0x53576c,_0x405fb1){return db[_0x2175('0x16')][_0x2175('0x17')](_0x377586['body'],{'raw':_0x377586[_0x2175('0x18')]?_0x377586['options'][_0x2175('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x37818a){logger['info']('CreateAttachment',_0x377586);logger['debug'](_0x2175('0x15'),_0x377586,JSON['stringify'](_0x37818a));_0x53576c(_0x37818a);})[_0x2175('0x14')](function(_0x46ea57){logger[_0x2175('0x11')](_0x2175('0x15'),_0x46ea57[_0x2175('0x12')],_0x377586);_0x405fb1(_0x4cb089[_0x2175('0x11')](0x1f4,_0x46ea57['message']));});});}; \ No newline at end of file +var _0x8f37=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','raw','then'];(function(_0x35a761,_0x5f4d8a){var _0x356ea5=function(_0x349e92){while(--_0x349e92){_0x35a761['push'](_0x35a761['shift']());}};_0x356ea5(++_0x5f4d8a);}(_0x8f37,0x190));var _0x78f3=function(_0x2f8c90,_0x4f4e92){_0x2f8c90=_0x2f8c90-0x0;var _0x4ddd42=_0x8f37[_0x2f8c90];return _0x4ddd42;};'use strict';var _=require(_0x78f3('0x0'));var util=require(_0x78f3('0x1'));var moment=require(_0x78f3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78f3('0x3'));var db=require(_0x78f3('0x4'))['db'];var utils=require(_0x78f3('0x5'));var logger=require('../../config/logger')(_0x78f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x78f3('0x7'));var client=jayson['client'][_0x78f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc185,_0x492dc7,_0x58bd73){return new BPromise(function(_0x55e353,_0x35d861){return client[_0x78f3('0x9')](_0x3dc185,_0x58bd73)['then'](function(_0x20c081){logger[_0x78f3('0xa')](_0x78f3('0xb'),_0x492dc7,_0x78f3('0xc'));logger[_0x78f3('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x492dc7,_0x78f3('0xc'),JSON[_0x78f3('0xe')](_0x20c081));if(_0x20c081['error']){if(_0x20c081[_0x78f3('0xf')][_0x78f3('0x10')]===0x1f4){logger[_0x78f3('0xf')]('Attachment,\x20%s,\x20%s',_0x492dc7,_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);return _0x35d861(_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);}logger[_0x78f3('0xf')](_0x78f3('0xb'),_0x492dc7,_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);return _0x55e353(_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);}else{logger[_0x78f3('0xa')](_0x78f3('0xb'),_0x492dc7,_0x78f3('0xc'));_0x55e353(_0x20c081[_0x78f3('0x12')][_0x78f3('0x11')]);}})[_0x78f3('0x13')](function(_0x39adfc){logger[_0x78f3('0xf')](_0x78f3('0xb'),_0x492dc7,_0x39adfc);_0x35d861(_0x39adfc);});});}exports[_0x78f3('0x14')]=function(_0x3c76d2){var _0x1c25f2=this;return new Promise(function(_0x225176,_0x4a5db4){return db[_0x78f3('0x15')][_0x78f3('0x16')](_0x3c76d2['body'],{'raw':_0x3c76d2['options']?_0x3c76d2['options'][_0x78f3('0x17')]===undefined?!![]:![]:!![]})[_0x78f3('0x18')](function(_0x31621a){logger[_0x78f3('0xa')](_0x78f3('0x14'),_0x3c76d2);logger['debug'](_0x78f3('0x14'),_0x3c76d2,JSON[_0x78f3('0xe')](_0x31621a));_0x225176(_0x31621a);})[_0x78f3('0x13')](function(_0x3f623f){logger[_0x78f3('0xf')](_0x78f3('0x14'),_0x3f623f[_0x78f3('0x11')],_0x3c76d2);_0x4a5db4(_0x1c25f2[_0x78f3('0xf')](0x1f4,_0x3f623f[_0x78f3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index f48adaf..9f6cbe4 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 _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x321e04,_0x10d235){var _0x44f9c0=function(_0x12fda8){while(--_0x12fda8){_0x321e04['push'](_0x321e04['shift']());}};_0x44f9c0(++_0x10d235);}(_0x5f2f,0x73));var _0xf5f2=function(_0x297d0c,_0x37be75){_0x297d0c=_0x297d0c-0x0;var _0x540053=_0x5f2f[_0x297d0c];return _0x540053;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x2014d9,_0x2a2fab){var _0x13687c=function(_0x29357e){while(--_0x29357e){_0x2014d9['push'](_0x2014d9['shift']());}};_0x13687c(++_0x2a2fab);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49e354,_0x46886b){_0x49e354=_0x49e354-0x0;var _0x29665a=_0x5f2f[_0x49e354];return _0x29665a;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index 0a6a661..04b98c4 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 _0x78ba=['../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','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:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','agent','domain','add','minutes','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','activedirectory2','bluebird','util'];(function(_0x299bc8,_0x43d635){var _0xf6846c=function(_0x4763ec){while(--_0x4763ec){_0x299bc8['push'](_0x299bc8['shift']());}};_0xf6846c(++_0x43d635);}(_0x78ba,0x19a));var _0xa78b=function(_0x3a9ec7,_0x325adb){_0x3a9ec7=_0x3a9ec7-0x0;var _0x3aca73=_0x78ba[_0x3a9ec7];return _0x3aca73;};'use strict';var passport=require(_0xa78b('0x0'));var LocalStrategy=require(_0xa78b('0x1'))[_0xa78b('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xa78b('0x3'));var BPromise=require(_0xa78b('0x4'));var util=require(_0xa78b('0x5'));var db=require(_0xa78b('0x6'))['db'];var authService=require(_0xa78b('0x7'));var utils=require(_0xa78b('0x8'));var config=require(_0xa78b('0x9'));var logger=require(_0xa78b('0xa'))(_0xa78b('0xb'));function isActiveDirectoryConfigured(_0x399593){var _0x5d0fac=![];if(typeof _0x399593[_0xa78b('0xc')]!==_0xa78b('0xd')){_0x5d0fac=_0x399593[_0xa78b('0xc')][_0xa78b('0xe')]&&_0x399593[_0xa78b('0xc')][_0xa78b('0xf')]&&_0x399593[_0xa78b('0xc')]['domain'];}return _0x5d0fac;}function adAuthenticate(_0x495fe3,_0x5df609,_0x4fd99a){return new BPromise(function(_0x526723,_0x5c24e1){try{var _0x182668=new ActiveDirectory(_0x495fe3);_0x182668[_0xa78b('0x10')](_0x5df609,_0x4fd99a,function(_0x3bc9f7,_0x26ca4d){if(_0x3bc9f7){logger['error'](_0xa78b('0x11'),_0x5df609,util[_0xa78b('0x12')](_0x3bc9f7,{'showHidden':![],'depth':null}));_0x5c24e1(_0xa78b('0x13'));}else if(!_0x26ca4d){logger[_0xa78b('0x14')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x5df609);_0x5c24e1(_0xa78b('0x13'));}else{_0x526723(_0x26ca4d);}});}catch(_0x3d2596){_0x5c24e1(_0x3d2596);}});}function ActiveDirectoryAuthenticate(_0x2a3dfd,_0x45706d,_0x597bf0,_0x1a2481){var _0xf2e215,_0x524d39;if(!isActiveDirectoryConfigured(config)){logger[_0xa78b('0x14')](_0xa78b('0x15'),_0x45706d);return _0x1a2481(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xa78b('0x16')][_0xa78b('0x17')]({'where':{'id':0x1},'attributes':[_0xa78b('0x18'),'blockDuration'],'raw':!![]})[_0xa78b('0x19')](function(_0xd6fc03){_0xf2e215=_0xd6fc03;if(!_0xf2e215['adSsoEnabled']){logger[_0xa78b('0x14')](_0xa78b('0x1a'),_0x45706d);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x2a3dfd['findOne']({'attributes':['id',_0xa78b('0x1b'),_0xa78b('0x1c'),_0xa78b('0x1d'),_0xa78b('0x1e'),_0xa78b('0x1f'),'blocked',_0xa78b('0x20'),_0xa78b('0x21')],'where':{'name':_0x45706d,'role':{'$or':[_0xa78b('0x22'),'user',_0xa78b('0x23')]},'adSsoEnabled':!![]}});})[_0xa78b('0x19')](function(_0x2f560d){if(!_0x2f560d||_0x2f560d&&_0x2f560d[_0xa78b('0x1b')]!==_0x45706d){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x524d39=_0x2f560d;var _0x28fff6=_0x524d39[_0xa78b('0x1b')]+'@'+config[_0xa78b('0xc')][_0xa78b('0x24')];return adAuthenticate(config[_0xa78b('0xc')],_0x28fff6,_0x597bf0);})['then'](function(_0x558ec0){if(_0x524d39[_0xa78b('0x1f')]){throw new Error(_0xa78b('0x13'));}if(_0xf2e215['blockDuration']>0x0){if(_0x524d39['blocked']){if(moment(_0x524d39['blockedAt'])[_0xa78b('0x25')](_0xf2e215['blockDuration'],_0xa78b('0x26'))>moment()){throw new Error(_0xa78b('0x13'));}return utils[_0xa78b('0x27')](_0x524d39,0x0,![],null)[_0xa78b('0x19')](function(){return utils[_0xa78b('0x28')](_0x524d39);})[_0xa78b('0x19')](function(){return _0x1a2481(null,_0x524d39);});}else{return utils['getLicense'](_0x524d39)['then'](function(){return _0x1a2481(null,_0x524d39);});}}else{return utils['getLicense'](_0x524d39)[_0xa78b('0x19')](function(){return _0x1a2481(null,_0x524d39);});}})[_0xa78b('0x29')](function(_0x813a49){return _0x1a2481(null,![],_0x813a49);});}function handleError(_0x1b47f6,_0x31ecc2,_0x2d7f09){return _0x1b47f6[_0xa78b('0x2a')](_0x31ecc2||0x1f4)[_0xa78b('0x2b')]({'message':_0x2d7f09?_0x2d7f09[_0xa78b('0x2c')]||_0x2d7f09:''});}exports[_0xa78b('0x2d')]=function(_0x4a0a33,_0xccd60b,_0x362830){passport['authenticate'](_0xa78b('0x2e'),function(_0x4588de,_0x229996,_0x224505){var _0x4a1e00=_0x4588de||_0x224505;if(_0x4a1e00){return handleError(_0xccd60b,0x191,_0x4a1e00);}if(!_0x229996){return handleError(_0xccd60b,0x194,{'message':_0xa78b('0x2f')});}else{var _0x254c21={'payload':{'id':_0x229996['id'],'role':_0x229996[_0xa78b('0x1e')]},'options':{'expiresIn':0x15180}};return authService[_0xa78b('0x30')](_0x254c21)['then'](function(_0x5a1fb6){_0xccd60b[_0xa78b('0x31')]({'id':_0x229996['id'],'token':_0x5a1fb6,'statusCall':'','isAlreadyLogged':_0x229996[_0xa78b('0x21')]});});}})(_0x4a0a33,_0xccd60b,_0x362830);};passport[_0xa78b('0x32')](_0xa78b('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0xa78b('0x1c')},function(_0x4379e8,_0x57df4d,_0x53a776){return ActiveDirectoryAuthenticate(db[_0xa78b('0x33')],_0x4379e8,_0x57df4d,_0x53a776);})); \ No newline at end of file +var _0xf9f0=['role','disabled','blocked','blockedAt','admin','user','name','add','minutes','getLicense','catch','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','ad-login','passport-local','Strategy','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','adSsoEnabled','blockDuration','then','findOne','password'];(function(_0x161f73,_0x23eb4f){var _0x5a6e00=function(_0x46465b){while(--_0x46465b){_0x161f73['push'](_0x161f73['shift']());}};_0x5a6e00(++_0x23eb4f);}(_0xf9f0,0xeb));var _0x0f9f=function(_0x3476f8,_0x20b980){_0x3476f8=_0x3476f8-0x0;var _0x429efd=_0xf9f0[_0x3476f8];return _0x429efd;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x0f9f('0x0'))[_0x0f9f('0x1')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x0f9f('0x2'));var util=require(_0x0f9f('0x3'));var db=require('../../mysqldb')['db'];var authService=require(_0x0f9f('0x4'));var utils=require(_0x0f9f('0x5'));var config=require(_0x0f9f('0x6'));var logger=require(_0x0f9f('0x7'))(_0x0f9f('0x8'));function isActiveDirectoryConfigured(_0x1f1336){var _0x1e6917=![];if(typeof _0x1f1336[_0x0f9f('0x9')]!==_0x0f9f('0xa')){_0x1e6917=_0x1f1336[_0x0f9f('0x9')][_0x0f9f('0xb')]&&_0x1f1336[_0x0f9f('0x9')]['url']&&_0x1f1336[_0x0f9f('0x9')][_0x0f9f('0xc')];}return _0x1e6917;}function adAuthenticate(_0x28b701,_0x3e93a1,_0x3bbfd5){return new BPromise(function(_0x494ebb,_0xcaff2d){try{var _0x855342=new ActiveDirectory(_0x28b701);_0x855342[_0x0f9f('0xd')](_0x3e93a1,_0x3bbfd5,function(_0x3c6b3e,_0x5c3ac5){if(_0x3c6b3e){logger[_0x0f9f('0xe')](_0x0f9f('0xf'),_0x3e93a1,util['inspect'](_0x3c6b3e,{'showHidden':![],'depth':null}));_0xcaff2d('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x5c3ac5){logger['error'](_0x0f9f('0x10'),_0x3e93a1);_0xcaff2d(_0x0f9f('0x11'));}else{_0x494ebb(_0x5c3ac5);}});}catch(_0x58ae04){_0xcaff2d(_0x58ae04);}});}function ActiveDirectoryAuthenticate(_0xb8376,_0x29b8eb,_0x207b8f,_0x125b2c){var _0x839d14,_0x950976;if(!isActiveDirectoryConfigured(config)){logger[_0x0f9f('0xe')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x29b8eb);return _0x125b2c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x0f9f('0x12'),_0x0f9f('0x13')],'raw':!![]})[_0x0f9f('0x14')](function(_0xae4110){_0x839d14=_0xae4110;if(!_0x839d14[_0x0f9f('0x12')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x29b8eb);throw new Error(_0x0f9f('0x11'));}return _0xb8376[_0x0f9f('0x15')]({'attributes':['id','name',_0x0f9f('0x16'),'salt',_0x0f9f('0x17'),_0x0f9f('0x18'),_0x0f9f('0x19'),_0x0f9f('0x1a'),'online'],'where':{'name':_0x29b8eb,'role':{'$or':[_0x0f9f('0x1b'),_0x0f9f('0x1c'),'agent']},'adSsoEnabled':!![]}});})[_0x0f9f('0x14')](function(_0x266d14){if(!_0x266d14||_0x266d14&&_0x266d14[_0x0f9f('0x1d')]!==_0x29b8eb){throw new Error(_0x0f9f('0x11'));}_0x950976=_0x266d14;var _0x17c032=_0x950976[_0x0f9f('0x1d')]+'@'+config['activedirectory'][_0x0f9f('0xc')];return adAuthenticate(config[_0x0f9f('0x9')],_0x17c032,_0x207b8f);})['then'](function(_0x153275){if(_0x950976[_0x0f9f('0x18')]){throw new Error(_0x0f9f('0x11'));}if(_0x839d14['blockDuration']>0x0){if(_0x950976['blocked']){if(moment(_0x950976[_0x0f9f('0x1a')])[_0x0f9f('0x1e')](_0x839d14['blockDuration'],_0x0f9f('0x1f'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x950976,0x0,![],null)[_0x0f9f('0x14')](function(){return utils[_0x0f9f('0x20')](_0x950976);})[_0x0f9f('0x14')](function(){return _0x125b2c(null,_0x950976);});}else{return utils[_0x0f9f('0x20')](_0x950976)[_0x0f9f('0x14')](function(){return _0x125b2c(null,_0x950976);});}}else{return utils['getLicense'](_0x950976)[_0x0f9f('0x14')](function(){return _0x125b2c(null,_0x950976);});}})[_0x0f9f('0x21')](function(_0x5576f3){return _0x125b2c(null,![],_0x5576f3);});}function handleError(_0x4ac7da,_0x25186c,_0x554d9a){return _0x4ac7da[_0x0f9f('0x22')](_0x25186c||0x1f4)[_0x0f9f('0x23')]({'message':_0x554d9a?_0x554d9a[_0x0f9f('0x24')]||_0x554d9a:''});}exports[_0x0f9f('0x25')]=function(_0x168d76,_0xb5d14f,_0x523eb2){passport['authenticate']('ad-login',function(_0x57a08a,_0x51470c,_0x58c25f){var _0x30bd67=_0x57a08a||_0x58c25f;if(_0x30bd67){return handleError(_0xb5d14f,0x191,_0x30bd67);}if(!_0x51470c){return handleError(_0xb5d14f,0x194,{'message':_0x0f9f('0x26')});}else{var _0x5d58ac={'payload':{'id':_0x51470c['id'],'role':_0x51470c[_0x0f9f('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0x0f9f('0x27')](_0x5d58ac)['then'](function(_0x56e071){_0xb5d14f[_0x0f9f('0x28')]({'id':_0x51470c['id'],'token':_0x56e071,'statusCall':'','isAlreadyLogged':_0x51470c['online']});});}})(_0x168d76,_0xb5d14f,_0x523eb2);};passport[_0x0f9f('0x29')](_0x0f9f('0x2a'),new LocalStrategy({'usernameField':_0x0f9f('0x1d'),'passwordField':_0x0f9f('0x16')},function(_0x4d78b4,_0x1f98a9,_0x5a4758){return ActiveDirectoryAuthenticate(db['User'],_0x4d78b4,_0x1f98a9,_0x5a4758);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 334fb82..3bbcb26 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 _0xa50d=['express','Router','./authActiveDirectory.controller','login'];(function(_0x253cdb,_0x142a36){var _0x1ae7f4=function(_0x476a82){while(--_0x476a82){_0x253cdb['push'](_0x253cdb['shift']());}};_0x1ae7f4(++_0x142a36);}(_0xa50d,0x1ec));var _0xda50=function(_0x53e32a,_0x3c7964){_0x53e32a=_0x53e32a-0x0;var _0x15a8bf=_0xa50d[_0x53e32a];return _0x15a8bf;};'use strict';var express=require(_0xda50('0x0'));var router=express[_0xda50('0x1')]();var controller=require(_0xda50('0x2'));router['post']('/',controller[_0xda50('0x3')]);module['exports']=router; \ No newline at end of file +var _0x9161=['express','./authActiveDirectory.controller','post','login'];(function(_0x5236d5,_0x63192b){var _0x33208e=function(_0x3c9bd9){while(--_0x3c9bd9){_0x5236d5['push'](_0x5236d5['shift']());}};_0x33208e(++_0x63192b);}(_0x9161,0x11c));var _0x1916=function(_0x5acac0,_0x52f4ce){_0x5acac0=_0x5acac0-0x0;var _0x3e29fb=_0x9161[_0x5acac0];return _0x3e29fb;};'use strict';var express=require(_0x1916('0x0'));var router=express['Router']();var controller=require(_0x1916('0x1'));router[_0x1916('0x2')]('/',controller[_0x1916('0x3')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 958917c..5242b68 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(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x7a54,0x106));var _0x47a5=function(_0x3a3a5f,_0x4ea757){_0x3a3a5f=_0x3a3a5f-0x0;var _0x545227=_0x7a54[_0x3a3a5f];return _0x545227;};'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(_0x5864f3,_0x1f5a94){var _0x2feb81=function(_0x115967){while(--_0x115967){_0x5864f3['push'](_0x5864f3['shift']());}};_0x2feb81(++_0x1f5a94);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index cb5d93f..47c00f6 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 _0x6e12=['passport','Router','./authGoogle.controller','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie','exports','express'];(function(_0x18be7e,_0x32fd6c){var _0x44139b=function(_0x219c43){while(--_0x219c43){_0x18be7e['push'](_0x18be7e['shift']());}};_0x44139b(++_0x32fd6c);}(_0x6e12,0x154));var _0x26e1=function(_0x40376f,_0x53f0e8){_0x40376f=_0x40376f-0x0;var _0x2db0e4=_0x6e12[_0x40376f];return _0x2db0e4;};'use strict';var express=require(_0x26e1('0x0'));var passport=require(_0x26e1('0x1'));var router=express[_0x26e1('0x2')]();var controller=require(_0x26e1('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x26e1('0x4'));router[_0x26e1('0x5')]('/',controller[_0x26e1('0x6')]);router['get']('/callback',controller[_0x26e1('0x7')],authService[_0x26e1('0x8')],userController[_0x26e1('0x6')],authService[_0x26e1('0x9')]);module[_0x26e1('0xa')]=router; \ No newline at end of file +var _0x4534=['exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','get','login','isMiddleware','setTokenCookie'];(function(_0x247ef7,_0x2aab81){var _0x12d326=function(_0x2d0ce2){while(--_0x2d0ce2){_0x247ef7['push'](_0x247ef7['shift']());}};_0x12d326(++_0x2aab81);}(_0x4534,0x141));var _0x4453=function(_0x505d12,_0x4a5d2b){_0x505d12=_0x505d12-0x0;var _0x56793b=_0x4534[_0x505d12];return _0x56793b;};'use strict';var express=require(_0x4453('0x0'));var passport=require(_0x4453('0x1'));var router=express[_0x4453('0x2')]();var controller=require(_0x4453('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0x4453('0x4'));router[_0x4453('0x5')]('/',controller[_0x4453('0x6')]);router[_0x4453('0x5')]('/callback',controller['callback'],authService[_0x4453('0x7')],userController[_0x4453('0x6')],authService[_0x4453('0x8')]);module[_0x4453('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 6774cb3..993d54a 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 _0x9815=['blockDuration','add','minutes','clearBlockUser','getLicense','MailAccount','find','email','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','Smtp','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','host','/reset/','Reset\x20Email\x20sent!','catch','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','passport','passport-local','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','blocked','blockedAt','loginAttempts','user','agent','name','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9815,0x1cc));var _0x5981=function(_0x49c3e2,_0x1dcade){_0x49c3e2=_0x49c3e2-0x0;var _0x3cafda=_0x9815[_0x49c3e2];return _0x3cafda;};'use strict';var util=require('util');var passport=require(_0x5981('0x0'));var LocalStrategy=require(_0x5981('0x1'))['Strategy'];var jayson=require(_0x5981('0x2'));var _=require(_0x5981('0x3'));var rs=require(_0x5981('0x4'));var moment=require('moment');var db=require(_0x5981('0x5'))['db'];var authService=require(_0x5981('0x6'));var utils=require(_0x5981('0x7'));var client=jayson[_0x5981('0x8')][_0x5981('0x9')]({'port':0x232b});function localAuthenticate(_0x2490da,_0x1003cb,_0x5e3eea,_0x4b251a){var _0x4c1231,_0x336c0a;return db[_0x5981('0xa')][_0x5981('0xb')]({'where':{'id':0x1},'attributes':[_0x5981('0xc'),'blockDuration'],'raw':!![]})[_0x5981('0xd')](function(_0x3a500e){_0x4c1231=_0x3a500e;return _0x2490da[_0x5981('0xb')]({'attributes':['id','name',_0x5981('0xe'),_0x5981('0xf'),_0x5981('0x10'),'disabled',_0x5981('0x11'),_0x5981('0x12'),_0x5981('0x13')],'where':{'name':_0x1003cb,'role':{'$or':['admin',_0x5981('0x14'),_0x5981('0x15')]}}});})[_0x5981('0xd')](function(_0x5b1707){if(!_0x5b1707||_0x5b1707&&_0x5b1707[_0x5981('0x16')]!==_0x1003cb){throw new Error(_0x5981('0x17'));}else{_0x336c0a=_0x5b1707;return _0x336c0a;}})[_0x5981('0xd')](function(){_0x336c0a[_0x5981('0x18')](_0x5e3eea,function(_0x556c84,_0x1e3af9){var _0x12d603=_0x336c0a[_0x5981('0x13')]+0x1;if(_0x556c84){return _0x4b251a(_0x556c84);}else if(!_0x1e3af9){if(_0x336c0a[_0x5981('0x19')]){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else if(_0x4c1231[_0x5981('0xc')]>0x0){if(_0x336c0a[_0x5981('0x11')]){if(_0x4c1231[_0x5981('0x1a')]>0x0){if(moment(_0x336c0a[_0x5981('0x12')])[_0x5981('0x1b')](_0x4c1231[_0x5981('0x1a')],_0x5981('0x1c'))>moment()){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else{return utils[_0x5981('0x1d')](_0x336c0a,_0x12d603,![],null)[_0x5981('0xd')](function(){return _0x4b251a(null,![],{'message':_0x5981('0x17')});});}}else{return _0x4b251a(null,![],{'message':_0x5981('0x17')});}}else{if(_0x12d603>=_0x4c1231[_0x5981('0xc')]){return utils['clearBlockUser'](_0x336c0a,0x0,!![],moment())[_0x5981('0xd')](function(){return _0x4b251a(null,![],{'message':_0x5981('0x17')});});}else{return utils['clearBlockUser'](_0x336c0a,_0x12d603,![],null)['then'](function(){return _0x4b251a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x4b251a(null,![],{'message':_0x5981('0x17')});}}else{if(_0x336c0a['disabled']){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else if(_0x4c1231[_0x5981('0xc')]>0x0){if(_0x336c0a[_0x5981('0x11')]){if(_0x4c1231[_0x5981('0x1a')]>0x0){if(moment(_0x336c0a[_0x5981('0x12')])[_0x5981('0x1b')](_0x4c1231[_0x5981('0x1a')],_0x5981('0x1c'))>moment()){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else{return utils[_0x5981('0x1d')](_0x336c0a,0x0,![],null)[_0x5981('0xd')](function(){return utils[_0x5981('0x1e')](_0x336c0a);})[_0x5981('0xd')](function(){return _0x4b251a(null,_0x336c0a);});}}else{return _0x4b251a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x5981('0x1d')](_0x336c0a,0x0,![],null)[_0x5981('0xd')](function(){return utils[_0x5981('0x1e')](_0x336c0a);})[_0x5981('0xd')](function(){return _0x4b251a(null,_0x336c0a);})['catch'](function(_0x5eee9c){return _0x4b251a(null,![],_0x5eee9c);});}}else{if(_0x336c0a[_0x5981('0x11')]){return _0x4b251a(null,![],{'message':_0x5981('0x17')});}else{return utils[_0x5981('0x1e')](_0x336c0a)[_0x5981('0xd')](function(){return _0x4b251a(null,_0x336c0a);});}}}});})['catch'](function(_0x3f1c49){return _0x4b251a(null,![],_0x3f1c49);});}function sendServiceMail(_0x413d2a){return db[_0x5981('0x1f')][_0x5981('0x20')]({'where':{'service':!![]},'attributes':['id',_0x5981('0x16'),_0x5981('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0x5981('0x22')],'as':'CloudProvider'}]}]})[_0x5981('0xd')](function(_0x5565a4){if(!_0x5565a4){throw new Error(_0x5981('0x23'));}var _0x270318=_0x5565a4[_0x5981('0x24')]();var _0x3319fd={'account':_0x270318,'message':_[_0x5981('0x25')]({'from':util[_0x5981('0x26')](_0x5981('0x27'),_0x5565a4[_0x5981('0x16')],_0x5565a4[_0x5981('0x21')]||_0x5565a4[_0x5981('0x28')][_0x5981('0x14')])},_0x413d2a)};return client[_0x5981('0x29')]('SendMail',_0x3319fd);})[_0x5981('0xd')](function(_0x5330bb){if(_0x5330bb[_0x5981('0x2a')]){throw new Error(util[_0x5981('0x26')](_0x5981('0x2b'),_0x5330bb[_0x5981('0x2a')]['message']||JSON['stringify'](_0x5330bb['error'])));}return!![];});}function handleError(_0x2da7c3,_0x2a6275,_0x517e91){return _0x2da7c3[_0x5981('0x2c')](_0x2a6275||0x1f4)[_0x5981('0x2d')]({'message':_0x517e91?_0x517e91['message']||_0x517e91:''});}exports[_0x5981('0x2e')]=function(_0x2e200a,_0xe57a89,_0x416031){passport[_0x5981('0x18')](_0x5981('0x2f'),function(_0x837a64,_0x3866c4,_0x1161a9){var _0x288a1f=_0x837a64||_0x1161a9;if(_0x288a1f){return handleError(_0xe57a89,0x191,_0x288a1f);}if(!_0x3866c4){return handleError(_0xe57a89,0x194,{'message':_0x5981('0x30')});}else{var _0x21ba15={'payload':{'id':_0x3866c4['id'],'role':_0x3866c4[_0x5981('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x5981('0x31')](_0x21ba15)[_0x5981('0xd')](function(_0x5b1228){_0xe57a89[_0x5981('0x32')]({'id':_0x3866c4['id'],'token':_0x5b1228,'statusCall':'','isAlreadyLogged':_0x3866c4[_0x5981('0x33')]});});}})(_0x2e200a,_0xe57a89,_0x416031);};exports[_0x5981('0x34')]=function(_0x5395e8,_0xeb3024){if(!_0x5395e8['body']['email']){return handleError(_0xeb3024,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x749e55=rs[_0x5981('0x35')]();_0x5395e8[_0x5981('0x36')]['email']=_0x5395e8[_0x5981('0x36')]['email'][_0x5981('0x37')]()[_0x5981('0x38')]();var _0x12e1e5;return db[_0x5981('0xa')][_0x5981('0xb')]({'where':{'id':0x1},'attributes':[_0x5981('0xc'),'blockDuration'],'raw':!![]})[_0x5981('0xd')](function(_0x2d18e0){_0x12e1e5=_0x2d18e0;return db[_0x5981('0x39')][_0x5981('0x20')]({'where':{'email':_0x5395e8[_0x5981('0x36')][_0x5981('0x21')]}});})[_0x5981('0xd')](function(_0x59e9be){if(!_0x59e9be){throw new Error(_0x5981('0x3a'));}if(_0x59e9be['disabled']){throw new Error(_0x5981('0x3b'));}if(_0x59e9be[_0x5981('0x11')]){if(moment(_0x59e9be['blockedAt'])[_0x5981('0x1b')](_0x12e1e5[_0x5981('0x1a')],'minutes')>moment()){throw new Error(_0x5981('0x3c'));}else{_0x59e9be[_0x5981('0x11')]=![];_0x59e9be[_0x5981('0x12')]=null;}}_0x59e9be[_0x5981('0x3d')]=_0x749e55;_0x59e9be[_0x5981('0x3e')]=Date[_0x5981('0x3f')]()+0x36ee80;return _0x59e9be[_0x5981('0x40')]();})[_0x5981('0xd')](function(){return sendServiceMail({'to':_0x5395e8['body'][_0x5981('0x21')],'subject':_0x5981('0x41'),'text':_0x5981('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x5395e8[_0x5981('0x43')][_0x5981('0x44')]+_0x5981('0x45')+_0x749e55+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x5981('0xd')](function(){_0xeb3024[_0x5981('0x2c')](0xc8)[_0x5981('0x2d')]({'message':_0x5981('0x46')});})[_0x5981('0x47')](function(_0x1efbb6){return handleError(_0xeb3024,0x1f4,_0x1efbb6);});};exports['reset']=function(_0x554097,_0x2b3cf0){return db[_0x5981('0x39')][_0x5981('0x20')]({'where':{'resetPasswordToken':_0x554097['params'][_0x5981('0x48')],'resetPasswordExpires':{'$gt':Date[_0x5981('0x3f')]()}}})[_0x5981('0xd')](function(_0x495c47){if(!_0x495c47){throw new Error(_0x5981('0x49'));}return db[_0x5981('0xa')][_0x5981('0xb')]({'attributes':['id',_0x5981('0x4a'),_0x5981('0x4b'),_0x5981('0x4c')]})[_0x5981('0xd')](function(_0x5cdfda){if(_0x5cdfda[_0x5981('0x4a')])authService[_0x5981('0x4d')](_0x554097[_0x5981('0x36')][_0x5981('0xe')]);if(!_0x5cdfda['enforcePasswordHistory']||!_0x495c47[_0x5981('0x4e')])return _0x495c47;authService[_0x5981('0x4f')](_0x554097['body'][_0x5981('0xe')],_0x495c47['previousPasswords'],_0x5cdfda[_0x5981('0x4c')]);return _0x495c47;})[_0x5981('0xd')](function(){_0x495c47['password']=_0x554097['body'][_0x5981('0xe')];_0x495c47[_0x5981('0x3d')]=null;_0x495c47[_0x5981('0x3e')]=null;return _0x495c47[_0x5981('0x40')]();});})[_0x5981('0xd')](function(){_0x2b3cf0[_0x5981('0x2c')](0xc8)['send']({'message':'Password\x20reset!'});})[_0x5981('0x47')](function(_0x33e35a){return handleError(_0x2b3cf0,0x1f4,_0x33e35a);});};passport[_0x5981('0x50')](_0x5981('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x5981('0xe')},function(_0x5774cc,_0x7027f8,_0x3e28da){return localAuthenticate(db[_0x5981('0x39')],_0x5774cc,_0x7027f8,_0x3e28da);})); \ No newline at end of file +var _0xe072=['allowedLoginAttempts','blockDuration','then','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','message','stringify','error','status','send','local-login','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','password','Password\x20reset!','use','util','passport','passport-local','jayson/promise','../../config/utils','client','http','Setting','findOne'];(function(_0x2aac37,_0x8bbcf6){var _0x27ac09=function(_0x16bb57){while(--_0x16bb57){_0x2aac37['push'](_0x2aac37['shift']());}};_0x27ac09(++_0x8bbcf6);}(_0xe072,0x173));var _0x2e07=function(_0x574b49,_0x549855){_0x574b49=_0x574b49-0x0;var _0x5cfe5c=_0xe072[_0x574b49];return _0x5cfe5c;};'use strict';var util=require(_0x2e07('0x0'));var passport=require(_0x2e07('0x1'));var LocalStrategy=require(_0x2e07('0x2'))['Strategy'];var jayson=require(_0x2e07('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x2e07('0x4'));var client=jayson[_0x2e07('0x5')][_0x2e07('0x6')]({'port':0x232b});function localAuthenticate(_0x13bb23,_0x3160d9,_0x20ff0b,_0x391068){var _0x40c4f2,_0xfd0b63;return db[_0x2e07('0x7')][_0x2e07('0x8')]({'where':{'id':0x1},'attributes':[_0x2e07('0x9'),_0x2e07('0xa')],'raw':!![]})[_0x2e07('0xb')](function(_0x5bb739){_0x40c4f2=_0x5bb739;return _0x13bb23['findOne']({'attributes':['id',_0x2e07('0xc'),'password',_0x2e07('0xd'),_0x2e07('0xe'),_0x2e07('0xf'),_0x2e07('0x10'),_0x2e07('0x11'),_0x2e07('0x12')],'where':{'name':_0x3160d9,'role':{'$or':[_0x2e07('0x13'),_0x2e07('0x14'),'agent']}}});})[_0x2e07('0xb')](function(_0x14ac64){if(!_0x14ac64||_0x14ac64&&_0x14ac64[_0x2e07('0xc')]!==_0x3160d9){throw new Error(_0x2e07('0x15'));}else{_0xfd0b63=_0x14ac64;return _0xfd0b63;}})[_0x2e07('0xb')](function(){_0xfd0b63[_0x2e07('0x16')](_0x20ff0b,function(_0xe62a6,_0x5abcaf){var _0x40f268=_0xfd0b63[_0x2e07('0x12')]+0x1;if(_0xe62a6){return _0x391068(_0xe62a6);}else if(!_0x5abcaf){if(_0xfd0b63[_0x2e07('0xf')]){return _0x391068(null,![],{'message':_0x2e07('0x15')});}else if(_0x40c4f2[_0x2e07('0x9')]>0x0){if(_0xfd0b63[_0x2e07('0x10')]){if(_0x40c4f2['blockDuration']>0x0){if(moment(_0xfd0b63[_0x2e07('0x11')])[_0x2e07('0x17')](_0x40c4f2[_0x2e07('0xa')],'minutes')>moment()){return _0x391068(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0xfd0b63,_0x40f268,![],null)[_0x2e07('0xb')](function(){return _0x391068(null,![],{'message':_0x2e07('0x15')});});}}else{return _0x391068(null,![],{'message':_0x2e07('0x15')});}}else{if(_0x40f268>=_0x40c4f2['allowedLoginAttempts']){return utils[_0x2e07('0x18')](_0xfd0b63,0x0,!![],moment())[_0x2e07('0xb')](function(){return _0x391068(null,![],{'message':_0x2e07('0x15')});});}else{return utils['clearBlockUser'](_0xfd0b63,_0x40f268,![],null)['then'](function(){return _0x391068(null,![],{'message':_0x2e07('0x15')});});}}}else{return _0x391068(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xfd0b63[_0x2e07('0xf')]){return _0x391068(null,![],{'message':_0x2e07('0x15')});}else if(_0x40c4f2[_0x2e07('0x9')]>0x0){if(_0xfd0b63[_0x2e07('0x10')]){if(_0x40c4f2[_0x2e07('0xa')]>0x0){if(moment(_0xfd0b63[_0x2e07('0x11')])[_0x2e07('0x17')](_0x40c4f2[_0x2e07('0xa')],_0x2e07('0x19'))>moment()){return _0x391068(null,![],{'message':_0x2e07('0x15')});}else{return utils[_0x2e07('0x18')](_0xfd0b63,0x0,![],null)[_0x2e07('0xb')](function(){return utils[_0x2e07('0x1a')](_0xfd0b63);})[_0x2e07('0xb')](function(){return _0x391068(null,_0xfd0b63);});}}else{return _0x391068(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x2e07('0x18')](_0xfd0b63,0x0,![],null)['then'](function(){return utils[_0x2e07('0x1a')](_0xfd0b63);})['then'](function(){return _0x391068(null,_0xfd0b63);})['catch'](function(_0x53e5f3){return _0x391068(null,![],_0x53e5f3);});}}else{if(_0xfd0b63['blocked']){return _0x391068(null,![],{'message':_0x2e07('0x15')});}else{return utils['getLicense'](_0xfd0b63)[_0x2e07('0xb')](function(){return _0x391068(null,_0xfd0b63);});}}}});})[_0x2e07('0x1b')](function(_0x257150){return _0x391068(null,![],_0x257150);});}function sendServiceMail(_0x12465c){return db['MailAccount'][_0x2e07('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x2e07('0xc'),_0x2e07('0x1d')],'include':[{'model':db[_0x2e07('0x1e')],'as':_0x2e07('0x1f'),'include':[{'model':db[_0x2e07('0x20')],'as':_0x2e07('0x20')}]}]})[_0x2e07('0xb')](function(_0x993a79){if(!_0x993a79){throw new Error(_0x2e07('0x21'));}var _0x45c4fb=_0x993a79[_0x2e07('0x22')]();var _0x2aa482={'account':_0x45c4fb,'message':_[_0x2e07('0x23')]({'from':util[_0x2e07('0x24')](_0x2e07('0x25'),_0x993a79[_0x2e07('0xc')],_0x993a79[_0x2e07('0x1d')]||_0x993a79[_0x2e07('0x1f')][_0x2e07('0x14')])},_0x12465c)};return client[_0x2e07('0x26')]('SendMail',_0x2aa482);})['then'](function(_0x4bc8fc){if(_0x4bc8fc['error']){throw new Error(util[_0x2e07('0x24')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4bc8fc['error'][_0x2e07('0x27')]||JSON[_0x2e07('0x28')](_0x4bc8fc[_0x2e07('0x29')])));}return!![];});}function handleError(_0x5abac6,_0x1f26ab,_0x4f2bc7){return _0x5abac6[_0x2e07('0x2a')](_0x1f26ab||0x1f4)[_0x2e07('0x2b')]({'message':_0x4f2bc7?_0x4f2bc7[_0x2e07('0x27')]||_0x4f2bc7:''});}exports['login']=function(_0x50502d,_0x78cd6f,_0x95134){passport['authenticate'](_0x2e07('0x2c'),function(_0x3b41cb,_0x4c03bd,_0x50fef8){var _0x5cf7cb=_0x3b41cb||_0x50fef8;if(_0x5cf7cb){return handleError(_0x78cd6f,0x191,_0x5cf7cb);}if(!_0x4c03bd){return handleError(_0x78cd6f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x1ed4b8={'payload':{'id':_0x4c03bd['id'],'role':_0x4c03bd[_0x2e07('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x2e07('0x2d')](_0x1ed4b8)[_0x2e07('0xb')](function(_0x41ca69){_0x78cd6f[_0x2e07('0x2e')]({'id':_0x4c03bd['id'],'token':_0x41ca69,'statusCall':'','isAlreadyLogged':_0x4c03bd[_0x2e07('0x2f')]});});}})(_0x50502d,_0x78cd6f,_0x95134);};exports[_0x2e07('0x30')]=function(_0x349d84,_0x4c53f5){if(!_0x349d84[_0x2e07('0x31')][_0x2e07('0x1d')]){return handleError(_0x4c53f5,0x1f4,{'message':_0x2e07('0x32')});}var _0x1f6079=rs[_0x2e07('0x33')]();_0x349d84['body'][_0x2e07('0x1d')]=_0x349d84[_0x2e07('0x31')]['email'][_0x2e07('0x34')]()[_0x2e07('0x35')]();var _0x4615b1;return db[_0x2e07('0x7')][_0x2e07('0x8')]({'where':{'id':0x1},'attributes':[_0x2e07('0x9'),_0x2e07('0xa')],'raw':!![]})[_0x2e07('0xb')](function(_0x322bd9){_0x4615b1=_0x322bd9;return db[_0x2e07('0x36')][_0x2e07('0x1c')]({'where':{'email':_0x349d84['body']['email']}});})['then'](function(_0x3796d8){if(!_0x3796d8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3796d8[_0x2e07('0xf')]){throw new Error(_0x2e07('0x37'));}if(_0x3796d8[_0x2e07('0x10')]){if(moment(_0x3796d8['blockedAt'])[_0x2e07('0x17')](_0x4615b1[_0x2e07('0xa')],_0x2e07('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x3796d8['blocked']=![];_0x3796d8[_0x2e07('0x11')]=null;}}_0x3796d8[_0x2e07('0x38')]=_0x1f6079;_0x3796d8[_0x2e07('0x39')]=Date[_0x2e07('0x3a')]()+0x36ee80;return _0x3796d8[_0x2e07('0x3b')]();})['then'](function(){return sendServiceMail({'to':_0x349d84[_0x2e07('0x31')]['email'],'subject':_0x2e07('0x3c'),'text':_0x2e07('0x3d')+_0x2e07('0x3e')+_0x2e07('0x3f')+_0x349d84['headers'][_0x2e07('0x40')]+_0x2e07('0x41')+_0x1f6079+'\x0a\x0a'+_0x2e07('0x42')});})[_0x2e07('0xb')](function(){_0x4c53f5['status'](0xc8)[_0x2e07('0x2b')]({'message':_0x2e07('0x43')});})[_0x2e07('0x1b')](function(_0x3d0d92){return handleError(_0x4c53f5,0x1f4,_0x3d0d92);});};exports[_0x2e07('0x44')]=function(_0x40138b,_0xbe6f9c){return db[_0x2e07('0x36')][_0x2e07('0x1c')]({'where':{'resetPasswordToken':_0x40138b['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x2e07('0x3a')]()}}})[_0x2e07('0xb')](function(_0x4c7384){if(!_0x4c7384){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x2e07('0x7')][_0x2e07('0x8')]({'attributes':['id',_0x2e07('0x45'),_0x2e07('0x46'),_0x2e07('0x47')]})[_0x2e07('0xb')](function(_0x4576d2){if(_0x4576d2[_0x2e07('0x45')])authService['validatePasswordPattern'](_0x40138b[_0x2e07('0x31')]['password']);if(!_0x4576d2[_0x2e07('0x46')]||!_0x4c7384['previousPasswords'])return _0x4c7384;authService[_0x2e07('0x48')](_0x40138b[_0x2e07('0x31')][_0x2e07('0x49')],_0x4c7384['previousPasswords'],_0x4576d2[_0x2e07('0x47')]);return _0x4c7384;})[_0x2e07('0xb')](function(){_0x4c7384['password']=_0x40138b[_0x2e07('0x31')][_0x2e07('0x49')];_0x4c7384['resetPasswordToken']=null;_0x4c7384['resetPasswordExpires']=null;return _0x4c7384[_0x2e07('0x3b')]();});})['then'](function(){_0xbe6f9c[_0x2e07('0x2a')](0xc8)[_0x2e07('0x2b')]({'message':_0x2e07('0x4a')});})['catch'](function(_0x3bb0b0){return handleError(_0xbe6f9c,0x1f4,_0x3bb0b0);});};passport[_0x2e07('0x4b')](_0x2e07('0x2c'),new LocalStrategy({'usernameField':_0x2e07('0xc'),'passwordField':'password'},function(_0x3922db,_0xe794a3,_0x49ea89){return localAuthenticate(db[_0x2e07('0x36')],_0x3922db,_0xe794a3,_0x49ea89);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 574a780..80c452a 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 _0x20e8=['/forgot','forgot','/reset/:token','reset','exports','express','./authLocal.controller','post','login'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x20e8,0xdd));var _0x820e=function(_0xd37cdd,_0x3ae26a){_0xd37cdd=_0xd37cdd-0x0;var _0x5f47d2=_0x20e8[_0xd37cdd];return _0x5f47d2;};'use strict';var express=require(_0x820e('0x0'));var router=express['Router']();var controller=require(_0x820e('0x1'));router[_0x820e('0x2')]('/',controller[_0x820e('0x3')]);router[_0x820e('0x2')](_0x820e('0x4'),controller[_0x820e('0x5')]);router[_0x820e('0x2')](_0x820e('0x6'),controller[_0x820e('0x7')]);module[_0x820e('0x8')]=router; \ No newline at end of file +var _0xdcd7=['/reset/:token','reset','exports','express','./authLocal.controller','post','login','/forgot','forgot'];(function(_0x3c2b23,_0x2a4035){var _0x33dd88=function(_0x1266f1){while(--_0x1266f1){_0x3c2b23['push'](_0x3c2b23['shift']());}};_0x33dd88(++_0x2a4035);}(_0xdcd7,0x111));var _0x7dcd=function(_0x798784,_0x303ff7){_0x798784=_0x798784-0x0;var _0x1a4b5d=_0xdcd7[_0x798784];return _0x1a4b5d;};'use strict';var express=require(_0x7dcd('0x0'));var router=express['Router']();var controller=require(_0x7dcd('0x1'));router[_0x7dcd('0x2')]('/',controller[_0x7dcd('0x3')]);router['post'](_0x7dcd('0x4'),controller[_0x7dcd('0x5')]);router['post'](_0x7dcd('0x6'),controller[_0x7dcd('0x7')]);module[_0x7dcd('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 6316dc9..fde24e1 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 _0x3ebb=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x11c235,_0x48e6ad){var _0x21d8ba=function(_0x3dc758){while(--_0x3dc758){_0x11c235['push'](_0x11c235['shift']());}};_0x21d8ba(++_0x48e6ad);}(_0x3ebb,0xcb));var _0xb3eb=function(_0x30a561,_0x22ed97){_0x30a561=_0x30a561-0x0;var _0x18ee3a=_0x3ebb[_0x30a561];return _0x18ee3a;};'use strict';var Sequelize=require(_0xb3eb('0x0'));module[_0xb3eb('0x1')]={'name':{'type':Sequelize[_0xb3eb('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb3eb('0x2')]},'description':{'type':Sequelize[_0xb3eb('0x2')]},'status':{'type':Sequelize[_0xb3eb('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb3eb('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x602b=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0xfae60f,_0x3d55bd){var _0x5dda8d=function(_0x2f25fe){while(--_0x2f25fe){_0xfae60f['push'](_0xfae60f['shift']());}};_0x5dda8d(++_0x3d55bd);}(_0x602b,0x6a));var _0xb602=function(_0x4827c8,_0x3b4047){_0x4827c8=_0x4827c8-0x0;var _0x5f104e=_0x602b[_0x4827c8];return _0x5f104e;};'use strict';var Sequelize=require(_0xb602('0x0'));module[_0xb602('0x1')]={'name':{'type':Sequelize[_0xb602('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb602('0x2')]},'description':{'type':Sequelize[_0xb602('0x2')]},'status':{'type':Sequelize[_0xb602('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb602('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index f51e518..5ce67fa 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 _0x6f0c=['sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','Automation','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','update','addConditions','Condition','omit','ids','findOne','pick','options','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb'];(function(_0x5e6750,_0x1b6aa4){var _0x16dd66=function(_0x35e55d){while(--_0x35e55d){_0x5e6750['push'](_0x5e6750['shift']());}};_0x16dd66(++_0x1b6aa4);}(_0x6f0c,0x1e1));var _0xc6f0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f0c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc6f0('0x0'));var rimraf=require(_0xc6f0('0x1'));var zipdir=require(_0xc6f0('0x2'));var jsonpatch=require(_0xc6f0('0x3'));var rp=require(_0xc6f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc6f0('0x5'));var path=require(_0xc6f0('0x6'));var sox=require(_0xc6f0('0x7'));var csv=require(_0xc6f0('0x8'));var ejs=require(_0xc6f0('0x9'));var fs=require('fs');var fs_extra=require(_0xc6f0('0xa'));var _=require(_0xc6f0('0xb'));var squel=require(_0xc6f0('0xc'));var crypto=require(_0xc6f0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc6f0('0xe'));var toCsv=require(_0xc6f0('0x8'));var querystring=require(_0xc6f0('0xf'));var Papa=require(_0xc6f0('0x10'));var Redis=require('ioredis');var authService=require(_0xc6f0('0x11'));var qs=require(_0xc6f0('0x12'));var as=require(_0xc6f0('0x13'));var hardwareService=require(_0xc6f0('0x14'));var logger=require('../../config/logger')(_0xc6f0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6f0('0x16'))['db'];function respondWithStatusCode(_0x5ed0f3,_0x2088f4){_0x2088f4=_0x2088f4||0xcc;return function(_0x4adf25){if(_0x4adf25){return _0x5ed0f3[_0xc6f0('0x17')](_0x2088f4);}return _0x5ed0f3[_0xc6f0('0x18')](_0x2088f4)[_0xc6f0('0x19')]();};}function respondWithResult(_0x37951f,_0x588c47){_0x588c47=_0x588c47||0xc8;return function(_0x5b7fd8){if(_0x5b7fd8){return _0x37951f['status'](_0x588c47)[_0xc6f0('0x1a')](_0x5b7fd8);}};}function respondWithFilteredResult(_0x33c926,_0x53aacb){return function(_0x539c4d){if(_0x539c4d){var _0x4a68f7=typeof _0x53aacb[_0xc6f0('0x1b')]==='undefined'&&typeof _0x53aacb[_0xc6f0('0x1c')]==='undefined';var _0x450408=_0x539c4d[_0xc6f0('0x1d')];var _0x41112b=_0x4a68f7?0x0:_0x53aacb[_0xc6f0('0x1b')];var _0x52d9eb=_0x4a68f7?_0x539c4d[_0xc6f0('0x1d')]:_0x53aacb[_0xc6f0('0x1b')]+_0x53aacb[_0xc6f0('0x1c')];var _0x7b48c0;if(_0x52d9eb>=_0x450408){_0x52d9eb=_0x450408;_0x7b48c0=0xc8;}else{_0x7b48c0=0xce;}_0x33c926['status'](_0x7b48c0);return _0x33c926[_0xc6f0('0x1e')](_0xc6f0('0x1f'),_0x41112b+'-'+_0x52d9eb+'/'+_0x450408)['json'](_0x539c4d);}return null;};}function patchUpdates(_0x3ad29e){return function(_0x87a395){try{jsonpatch[_0xc6f0('0x20')](_0x87a395,_0x3ad29e,!![]);}catch(_0x14445e){return BPromise[_0xc6f0('0x21')](_0x14445e);}return _0x87a395[_0xc6f0('0x22')]();};}function saveUpdates(_0x3e72fb,_0x3857bb){return function(_0x567bfc){if(_0x567bfc){return _0x567bfc['update'](_0x3e72fb)[_0xc6f0('0x23')](function(_0x47d31e){return _0x47d31e;});}return null;};}function removeEntity(_0x28c8f6,_0x4be188){return function(_0x472465){if(_0x472465){return _0x472465[_0xc6f0('0x24')]()[_0xc6f0('0x23')](function(){_0x28c8f6[_0xc6f0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dc128,_0x5f0d37){return function(_0x3e4796){if(!_0x3e4796){_0x5dc128[_0xc6f0('0x17')](0x194);}return _0x3e4796;};}function handleError(_0x445fa0,_0x3385ab){_0x3385ab=_0x3385ab||0x1f4;return function(_0x42f205){logger[_0xc6f0('0x25')](_0x42f205[_0xc6f0('0x26')]);if(_0x42f205[_0xc6f0('0x27')]){delete _0x42f205['name'];}_0x445fa0['status'](_0x3385ab)[_0xc6f0('0x28')](_0x42f205);};}exports[_0xc6f0('0x29')]=function(_0xddb3a4,_0x49ab36){var _0x1ce4de={},_0x1cd5ce={},_0x1c616f={'count':0x0,'rows':[]};var _0x20f82b=_[_0xc6f0('0x2a')](db['Automation']['rawAttributes'],function(_0xb97884){return{'name':_0xb97884[_0xc6f0('0x2b')],'type':_0xb97884[_0xc6f0('0x2c')]['key']};});_0x1cd5ce['model']=_['map'](_0x20f82b,'name');_0x1cd5ce[_0xc6f0('0x2d')]=_[_0xc6f0('0x2e')](_0xddb3a4[_0xc6f0('0x2d')]);_0x1cd5ce[_0xc6f0('0x2f')]=_[_0xc6f0('0x30')](_0x1cd5ce[_0xc6f0('0x31')],_0x1cd5ce['query']);_0x1ce4de[_0xc6f0('0x32')]=_['intersection'](_0x1cd5ce[_0xc6f0('0x31')],qs[_0xc6f0('0x33')](_0xddb3a4[_0xc6f0('0x2d')]['fields']));_0x1ce4de[_0xc6f0('0x32')]=_0x1ce4de['attributes'][_0xc6f0('0x34')]?_0x1ce4de['attributes']:_0x1cd5ce[_0xc6f0('0x31')];if(!_0xddb3a4[_0xc6f0('0x2d')][_0xc6f0('0x35')](_0xc6f0('0x36'))){_0x1ce4de[_0xc6f0('0x1c')]=qs[_0xc6f0('0x1c')](_0xddb3a4[_0xc6f0('0x2d')][_0xc6f0('0x1c')]);_0x1ce4de[_0xc6f0('0x1b')]=qs[_0xc6f0('0x1b')](_0xddb3a4['query'][_0xc6f0('0x1b')]);}_0x1ce4de[_0xc6f0('0x37')]=qs['sort'](_0xddb3a4[_0xc6f0('0x2d')][_0xc6f0('0x38')]);_0x1ce4de[_0xc6f0('0x39')]=qs[_0xc6f0('0x2f')](_['pick'](_0xddb3a4[_0xc6f0('0x2d')],_0x1cd5ce[_0xc6f0('0x2f')]),_0x20f82b);if(_0xddb3a4[_0xc6f0('0x2d')][_0xc6f0('0x3a')]){_0x1ce4de[_0xc6f0('0x39')]=_['merge'](_0x1ce4de['where'],{'$or':_[_0xc6f0('0x2a')](_0x20f82b,function(_0x40a26f){if(_0x40a26f[_0xc6f0('0x2c')]!==_0xc6f0('0x3b')){var _0x1e818d={};_0x1e818d[_0x40a26f['name']]={'$like':'%'+_0xddb3a4['query'][_0xc6f0('0x3a')]+'%'};return _0x1e818d;}})});}_0x1ce4de=_[_0xc6f0('0x3c')]({},_0x1ce4de,_0xddb3a4['options']);var _0x2840a8={'where':_0x1ce4de['where']};return db[_0xc6f0('0x3d')][_0xc6f0('0x1d')](_0x2840a8)[_0xc6f0('0x23')](function(_0x5e5775){_0x1c616f[_0xc6f0('0x1d')]=_0x5e5775;if(_0xddb3a4['query']['includeAll']){_0x1ce4de[_0xc6f0('0x3e')]=[{'all':!![]}];}return db['Automation'][_0xc6f0('0x3f')](_0x1ce4de);})[_0xc6f0('0x23')](function(_0x18536b){_0x1c616f[_0xc6f0('0x40')]=_0x18536b;return _0x1c616f;})[_0xc6f0('0x23')](respondWithFilteredResult(_0x49ab36,_0x1ce4de))[_0xc6f0('0x41')](handleError(_0x49ab36,null));};exports[_0xc6f0('0x42')]=function(_0x5d5efb,_0x2630a6){var _0x4df59d={'raw':![],'where':{'id':_0x5d5efb[_0xc6f0('0x43')]['id']}},_0x2ab5c5={};_0x2ab5c5[_0xc6f0('0x31')]=_[_0xc6f0('0x2e')](db[_0xc6f0('0x3d')][_0xc6f0('0x44')]);_0x2ab5c5[_0xc6f0('0x2d')]=_[_0xc6f0('0x2e')](_0x5d5efb[_0xc6f0('0x2d')]);_0x2ab5c5[_0xc6f0('0x2f')]=_[_0xc6f0('0x30')](_0x2ab5c5[_0xc6f0('0x31')],_0x2ab5c5[_0xc6f0('0x2d')]);_0x4df59d[_0xc6f0('0x32')]=_[_0xc6f0('0x30')](_0x2ab5c5[_0xc6f0('0x31')],qs[_0xc6f0('0x33')](_0x5d5efb[_0xc6f0('0x2d')]['fields']));_0x4df59d[_0xc6f0('0x32')]=_0x4df59d[_0xc6f0('0x32')][_0xc6f0('0x34')]?_0x4df59d[_0xc6f0('0x32')]:_0x2ab5c5[_0xc6f0('0x31')];if(_0x5d5efb[_0xc6f0('0x2d')][_0xc6f0('0x45')]){_0x4df59d[_0xc6f0('0x3e')]=[{'all':!![]}];}_0x4df59d=_[_0xc6f0('0x3c')]({},_0x4df59d,_0x5d5efb['options']);return db[_0xc6f0('0x3d')][_0xc6f0('0x46')](_0x4df59d)[_0xc6f0('0x23')](handleEntityNotFound(_0x2630a6,null))[_0xc6f0('0x23')](respondWithResult(_0x2630a6,null))[_0xc6f0('0x41')](handleError(_0x2630a6,null));};exports[_0xc6f0('0x47')]=function(_0x2f3d6a,_0xc29ea3){return db[_0xc6f0('0x3d')][_0xc6f0('0x47')](_0x2f3d6a[_0xc6f0('0x48')],{})['then'](respondWithResult(_0xc29ea3,0xc9))['catch'](handleError(_0xc29ea3,null));};exports[_0xc6f0('0x49')]=function(_0x2f4364,_0x4e1f03){if(_0x2f4364[_0xc6f0('0x48')]['id']){delete _0x2f4364[_0xc6f0('0x48')]['id'];}return db[_0xc6f0('0x3d')]['find']({'where':{'id':_0x2f4364[_0xc6f0('0x43')]['id']}})['then'](handleEntityNotFound(_0x4e1f03,null))['then'](saveUpdates(_0x2f4364[_0xc6f0('0x48')],null))[_0xc6f0('0x23')](respondWithResult(_0x4e1f03,null))[_0xc6f0('0x41')](handleError(_0x4e1f03,null));};exports[_0xc6f0('0x24')]=function(_0x19316b,_0x2f89ff){return db[_0xc6f0('0x3d')][_0xc6f0('0x46')]({'where':{'id':_0x19316b['params']['id']}})['then'](handleEntityNotFound(_0x2f89ff,null))[_0xc6f0('0x23')](removeEntity(_0x2f89ff,null))[_0xc6f0('0x41')](handleError(_0x2f89ff,null));};exports[_0xc6f0('0x4a')]=function(_0x1135df,_0x209c6d,_0x4ca655){return db[_0xc6f0('0x4b')][_0xc6f0('0x46')]({'where':{'id':_0x1135df[_0xc6f0('0x43')]['id']}})['then'](handleEntityNotFound(_0x209c6d,null))[_0xc6f0('0x23')](function(_0x588ea5){if(_0x588ea5){return _0x588ea5[_0xc6f0('0x4a')](_0x1135df[_0xc6f0('0x48')]['ids'],_[_0xc6f0('0x4c')](_0x1135df[_0xc6f0('0x48')],[_0xc6f0('0x4d'),'id'])||{});}})[_0xc6f0('0x23')](respondWithResult(_0x209c6d,null))[_0xc6f0('0x41')](handleError(_0x209c6d,null));};exports['getConditions']=function(_0x2a8785,_0x4e324c,_0xb63646){var _0x1414a9={};var _0x41ed72={};var _0x3f1e91;var _0x4d45a2;return db[_0xc6f0('0x3d')][_0xc6f0('0x4e')]({'where':{'id':_0x2a8785[_0xc6f0('0x43')]['id']}})[_0xc6f0('0x23')](handleEntityNotFound(_0x4e324c,null))[_0xc6f0('0x23')](function(_0x505a9b){if(_0x505a9b){_0x3f1e91=_0x505a9b;_0x41ed72['model']=_[_0xc6f0('0x2e')](db[_0xc6f0('0x4b')][_0xc6f0('0x44')]);_0x41ed72[_0xc6f0('0x2d')]=_[_0xc6f0('0x2e')](_0x2a8785['query']);_0x41ed72['filters']=_[_0xc6f0('0x30')](_0x41ed72[_0xc6f0('0x31')],_0x41ed72[_0xc6f0('0x2d')]);_0x1414a9[_0xc6f0('0x32')]=_[_0xc6f0('0x30')](_0x41ed72[_0xc6f0('0x31')],qs[_0xc6f0('0x33')](_0x2a8785['query']['fields']));_0x1414a9[_0xc6f0('0x32')]=_0x1414a9[_0xc6f0('0x32')]['length']?_0x1414a9[_0xc6f0('0x32')]:_0x41ed72[_0xc6f0('0x31')];_0x1414a9[_0xc6f0('0x37')]=qs[_0xc6f0('0x38')](_0x2a8785[_0xc6f0('0x2d')][_0xc6f0('0x38')]);_0x1414a9[_0xc6f0('0x39')]=qs[_0xc6f0('0x2f')](_[_0xc6f0('0x4f')](_0x2a8785[_0xc6f0('0x2d')],_0x41ed72[_0xc6f0('0x2f')]));if(_0x2a8785['query']['filter']){_0x1414a9[_0xc6f0('0x39')]=_[_0xc6f0('0x3c')](_0x1414a9[_0xc6f0('0x39')],{'$or':_['map'](_0x1414a9[_0xc6f0('0x32')],function(_0x28f2cc){var _0x308742={};_0x308742[_0x28f2cc]={'$like':'%'+_0x2a8785[_0xc6f0('0x2d')][_0xc6f0('0x3a')]+'%'};return _0x308742;})});}_0x1414a9=_[_0xc6f0('0x3c')]({},_0x1414a9,_0x2a8785[_0xc6f0('0x50')]);return _0x3f1e91['getConditions'](_0x1414a9);}})[_0xc6f0('0x23')](function(_0x5b5c89){if(_0x5b5c89){_0x4d45a2=_0x5b5c89['length'];if(!_0x2a8785['query'][_0xc6f0('0x35')](_0xc6f0('0x36'))){_0x1414a9[_0xc6f0('0x1c')]=qs['limit'](_0x2a8785['query']['limit']);_0x1414a9[_0xc6f0('0x1b')]=qs[_0xc6f0('0x1b')](_0x2a8785['query'][_0xc6f0('0x1b')]);}return _0x3f1e91['getConditions'](_0x1414a9);}})['then'](function(_0x18e530){if(_0x18e530){return _0x18e530?{'count':_0x4d45a2,'rows':_0x18e530}:null;}})[_0xc6f0('0x23')](respondWithResult(_0x4e324c,null))[_0xc6f0('0x41')](handleError(_0x4e324c,null));};exports['addActions']=function(_0x33181e,_0x1986ed,_0xaa63f6){return db[_0xc6f0('0x51')][_0xc6f0('0x46')]({'where':{'id':_0x33181e['params']['id']}})[_0xc6f0('0x23')](handleEntityNotFound(_0x1986ed,null))[_0xc6f0('0x23')](function(_0x4bf5a5){if(_0x4bf5a5){return _0x4bf5a5[_0xc6f0('0x52')](_0x33181e[_0xc6f0('0x48')][_0xc6f0('0x4d')],_[_0xc6f0('0x4c')](_0x33181e['body'],[_0xc6f0('0x4d'),'id'])||{});}})[_0xc6f0('0x23')](respondWithResult(_0x1986ed,null))[_0xc6f0('0x41')](handleError(_0x1986ed,null));};exports[_0xc6f0('0x53')]=function(_0x2e2b1a,_0x19f674,_0xacda7c){var _0x52bdbf={};var _0xcc9b14={};var _0x50b648;var _0x57cf84;return db[_0xc6f0('0x3d')][_0xc6f0('0x4e')]({'where':{'id':_0x2e2b1a[_0xc6f0('0x43')]['id']}})[_0xc6f0('0x23')](handleEntityNotFound(_0x19f674,null))[_0xc6f0('0x23')](function(_0x2cf501){if(_0x2cf501){_0x50b648=_0x2cf501;_0xcc9b14[_0xc6f0('0x31')]=_[_0xc6f0('0x2e')](db[_0xc6f0('0x51')][_0xc6f0('0x44')]);_0xcc9b14[_0xc6f0('0x2d')]=_['keys'](_0x2e2b1a['query']);_0xcc9b14['filters']=_[_0xc6f0('0x30')](_0xcc9b14[_0xc6f0('0x31')],_0xcc9b14['query']);_0x52bdbf[_0xc6f0('0x32')]=_[_0xc6f0('0x30')](_0xcc9b14[_0xc6f0('0x31')],qs[_0xc6f0('0x33')](_0x2e2b1a['query'][_0xc6f0('0x33')]));_0x52bdbf[_0xc6f0('0x32')]=_0x52bdbf[_0xc6f0('0x32')][_0xc6f0('0x34')]?_0x52bdbf[_0xc6f0('0x32')]:_0xcc9b14[_0xc6f0('0x31')];_0x52bdbf['order']=qs[_0xc6f0('0x38')](_0x2e2b1a[_0xc6f0('0x2d')]['sort']);_0x52bdbf['where']=qs[_0xc6f0('0x2f')](_['pick'](_0x2e2b1a[_0xc6f0('0x2d')],_0xcc9b14[_0xc6f0('0x2f')]));if(_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x3a')]){_0x52bdbf[_0xc6f0('0x39')]=_['merge'](_0x52bdbf['where'],{'$or':_[_0xc6f0('0x2a')](_0x52bdbf[_0xc6f0('0x32')],function(_0x2d9115){var _0x59cb13={};_0x59cb13[_0x2d9115]={'$like':'%'+_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x3a')]+'%'};return _0x59cb13;})});}_0x52bdbf=_[_0xc6f0('0x3c')]({},_0x52bdbf,_0x2e2b1a[_0xc6f0('0x50')]);return _0x50b648[_0xc6f0('0x53')](_0x52bdbf);}})[_0xc6f0('0x23')](function(_0x5a9e37){if(_0x5a9e37){_0x57cf84=_0x5a9e37[_0xc6f0('0x34')];if(!_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x35')](_0xc6f0('0x36'))){_0x52bdbf[_0xc6f0('0x1c')]=qs['limit'](_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x1c')]);_0x52bdbf[_0xc6f0('0x1b')]=qs[_0xc6f0('0x1b')](_0x2e2b1a[_0xc6f0('0x2d')][_0xc6f0('0x1b')]);}return _0x50b648[_0xc6f0('0x53')](_0x52bdbf);}})[_0xc6f0('0x23')](function(_0x225475){if(_0x225475){return _0x225475?{'count':_0x57cf84,'rows':_0x225475}:null;}})[_0xc6f0('0x23')](respondWithResult(_0x19f674,null))['catch'](handleError(_0x19f674,null));}; \ No newline at end of file +var _0x97ec=['pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','addConditions','Condition','ids','getConditions','findOne','options','hasOwnProperty','addActions','Action','omit','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','end','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where'];(function(_0x510501,_0x2468c2){var _0x1f22ea=function(_0x2e6ccd){while(--_0x2e6ccd){_0x510501['push'](_0x510501['shift']());}};_0x1f22ea(++_0x2468c2);}(_0x97ec,0x6d));var _0xc97e=function(_0x5742a6,_0x133889){_0x5742a6=_0x5742a6-0x0;var _0x42d528=_0x97ec[_0x5742a6];return _0x42d528;};'use strict';var emlformat=require(_0xc97e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc97e('0x1'));var rp=require(_0xc97e('0x2'));var moment=require(_0xc97e('0x3'));var BPromise=require(_0xc97e('0x4'));var Mustache=require(_0xc97e('0x5'));var util=require(_0xc97e('0x6'));var path=require(_0xc97e('0x7'));var sox=require(_0xc97e('0x8'));var csv=require(_0xc97e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc97e('0xa'));var _=require(_0xc97e('0xb'));var squel=require(_0xc97e('0xc'));var crypto=require(_0xc97e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc97e('0xe'));var toCsv=require(_0xc97e('0x9'));var querystring=require(_0xc97e('0xf'));var Papa=require(_0xc97e('0x10'));var Redis=require('ioredis');var authService=require(_0xc97e('0x11'));var qs=require(_0xc97e('0x12'));var as=require(_0xc97e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc97e('0x14'))('api');var utils=require(_0xc97e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc97e('0x16'));var db=require(_0xc97e('0x17'))['db'];function respondWithStatusCode(_0x5543c0,_0x4e2d71){_0x4e2d71=_0x4e2d71||0xcc;return function(_0x2de008){if(_0x2de008){return _0x5543c0[_0xc97e('0x18')](_0x4e2d71);}return _0x5543c0['status'](_0x4e2d71)['end']();};}function respondWithResult(_0x1a074a,_0x25da99){_0x25da99=_0x25da99||0xc8;return function(_0x2f5143){if(_0x2f5143){return _0x1a074a[_0xc97e('0x19')](_0x25da99)['json'](_0x2f5143);}};}function respondWithFilteredResult(_0x4cccc5,_0x346b6d){return function(_0x354f25){if(_0x354f25){var _0x462d70=typeof _0x346b6d['offset']==='undefined'&&typeof _0x346b6d[_0xc97e('0x1a')]===_0xc97e('0x1b');var _0x5ab5bc=_0x354f25[_0xc97e('0x1c')];var _0xb84954=_0x462d70?0x0:_0x346b6d[_0xc97e('0x1d')];var _0x5de5c3=_0x462d70?_0x354f25[_0xc97e('0x1c')]:_0x346b6d[_0xc97e('0x1d')]+_0x346b6d[_0xc97e('0x1a')];var _0x3182d4;if(_0x5de5c3>=_0x5ab5bc){_0x5de5c3=_0x5ab5bc;_0x3182d4=0xc8;}else{_0x3182d4=0xce;}_0x4cccc5['status'](_0x3182d4);return _0x4cccc5['set'](_0xc97e('0x1e'),_0xb84954+'-'+_0x5de5c3+'/'+_0x5ab5bc)['json'](_0x354f25);}return null;};}function patchUpdates(_0x45ad7c){return function(_0x3bd3b5){try{jsonpatch[_0xc97e('0x1f')](_0x3bd3b5,_0x45ad7c,!![]);}catch(_0x11e8ec){return BPromise[_0xc97e('0x20')](_0x11e8ec);}return _0x3bd3b5['save']();};}function saveUpdates(_0x45e3df,_0x23b025){return function(_0x282c65){if(_0x282c65){return _0x282c65[_0xc97e('0x21')](_0x45e3df)[_0xc97e('0x22')](function(_0x34a47d){return _0x34a47d;});}return null;};}function removeEntity(_0x4cb3dc,_0x3d5e97){return function(_0x3e75e6){if(_0x3e75e6){return _0x3e75e6[_0xc97e('0x23')]()[_0xc97e('0x22')](function(){_0x4cb3dc['status'](0xcc)[_0xc97e('0x24')]();});}};}function handleEntityNotFound(_0x3667bf,_0xe74e76){return function(_0x459237){if(!_0x459237){_0x3667bf['sendStatus'](0x194);}return _0x459237;};}function handleError(_0x510e5f,_0x4b0e55){_0x4b0e55=_0x4b0e55||0x1f4;return function(_0x4dfc17){logger['error'](_0x4dfc17['stack']);if(_0x4dfc17['name']){delete _0x4dfc17[_0xc97e('0x25')];}_0x510e5f['status'](_0x4b0e55)[_0xc97e('0x26')](_0x4dfc17);};}exports[_0xc97e('0x27')]=function(_0x212a83,_0xa22a77){var _0x7251e3={},_0x436b79={},_0x56d793={'count':0x0,'rows':[]};var _0x43a27c=_[_0xc97e('0x28')](db[_0xc97e('0x29')][_0xc97e('0x2a')],function(_0x157745){return{'name':_0x157745[_0xc97e('0x2b')],'type':_0x157745[_0xc97e('0x2c')][_0xc97e('0x2d')]};});_0x436b79[_0xc97e('0x2e')]=_[_0xc97e('0x28')](_0x43a27c,'name');_0x436b79[_0xc97e('0x2f')]=_['keys'](_0x212a83[_0xc97e('0x2f')]);_0x436b79[_0xc97e('0x30')]=_['intersection'](_0x436b79[_0xc97e('0x2e')],_0x436b79[_0xc97e('0x2f')]);_0x7251e3[_0xc97e('0x31')]=_[_0xc97e('0x32')](_0x436b79[_0xc97e('0x2e')],qs[_0xc97e('0x33')](_0x212a83[_0xc97e('0x2f')]['fields']));_0x7251e3[_0xc97e('0x31')]=_0x7251e3[_0xc97e('0x31')][_0xc97e('0x34')]?_0x7251e3[_0xc97e('0x31')]:_0x436b79[_0xc97e('0x2e')];if(!_0x212a83[_0xc97e('0x2f')]['hasOwnProperty'](_0xc97e('0x35'))){_0x7251e3[_0xc97e('0x1a')]=qs[_0xc97e('0x1a')](_0x212a83[_0xc97e('0x2f')][_0xc97e('0x1a')]);_0x7251e3['offset']=qs['offset'](_0x212a83[_0xc97e('0x2f')][_0xc97e('0x1d')]);}_0x7251e3[_0xc97e('0x36')]=qs[_0xc97e('0x37')](_0x212a83[_0xc97e('0x2f')][_0xc97e('0x37')]);_0x7251e3[_0xc97e('0x38')]=qs['filters'](_[_0xc97e('0x39')](_0x212a83[_0xc97e('0x2f')],_0x436b79[_0xc97e('0x30')]),_0x43a27c);if(_0x212a83[_0xc97e('0x2f')][_0xc97e('0x3a')]){_0x7251e3[_0xc97e('0x38')]=_[_0xc97e('0x3b')](_0x7251e3[_0xc97e('0x38')],{'$or':_[_0xc97e('0x28')](_0x43a27c,function(_0x25d6b0){if(_0x25d6b0['type']!==_0xc97e('0x3c')){var _0x203d3e={};_0x203d3e[_0x25d6b0[_0xc97e('0x25')]]={'$like':'%'+_0x212a83[_0xc97e('0x2f')][_0xc97e('0x3a')]+'%'};return _0x203d3e;}})});}_0x7251e3=_[_0xc97e('0x3b')]({},_0x7251e3,_0x212a83['options']);var _0x56eb42={'where':_0x7251e3['where']};return db[_0xc97e('0x29')][_0xc97e('0x1c')](_0x56eb42)[_0xc97e('0x22')](function(_0x3e3ef3){_0x56d793[_0xc97e('0x1c')]=_0x3e3ef3;if(_0x212a83[_0xc97e('0x2f')][_0xc97e('0x3d')]){_0x7251e3[_0xc97e('0x3e')]=[{'all':!![]}];}return db[_0xc97e('0x29')][_0xc97e('0x3f')](_0x7251e3);})[_0xc97e('0x22')](function(_0x221269){_0x56d793[_0xc97e('0x40')]=_0x221269;return _0x56d793;})[_0xc97e('0x22')](respondWithFilteredResult(_0xa22a77,_0x7251e3))[_0xc97e('0x41')](handleError(_0xa22a77,null));};exports[_0xc97e('0x42')]=function(_0x248e41,_0x50227a){var _0x43ab36={'raw':![],'where':{'id':_0x248e41['params']['id']}},_0x1ecf79={};_0x1ecf79['model']=_[_0xc97e('0x43')](db[_0xc97e('0x29')][_0xc97e('0x2a')]);_0x1ecf79[_0xc97e('0x2f')]=_['keys'](_0x248e41[_0xc97e('0x2f')]);_0x1ecf79[_0xc97e('0x30')]=_[_0xc97e('0x32')](_0x1ecf79[_0xc97e('0x2e')],_0x1ecf79[_0xc97e('0x2f')]);_0x43ab36[_0xc97e('0x31')]=_[_0xc97e('0x32')](_0x1ecf79[_0xc97e('0x2e')],qs[_0xc97e('0x33')](_0x248e41[_0xc97e('0x2f')][_0xc97e('0x33')]));_0x43ab36[_0xc97e('0x31')]=_0x43ab36['attributes'][_0xc97e('0x34')]?_0x43ab36[_0xc97e('0x31')]:_0x1ecf79[_0xc97e('0x2e')];if(_0x248e41['query']['includeAll']){_0x43ab36['include']=[{'all':!![]}];}_0x43ab36=_[_0xc97e('0x3b')]({},_0x43ab36,_0x248e41['options']);return db[_0xc97e('0x29')][_0xc97e('0x44')](_0x43ab36)[_0xc97e('0x22')](handleEntityNotFound(_0x50227a,null))[_0xc97e('0x22')](respondWithResult(_0x50227a,null))['catch'](handleError(_0x50227a,null));};exports[_0xc97e('0x45')]=function(_0x229133,_0x59b72f){return db['Automation']['create'](_0x229133[_0xc97e('0x46')],{})[_0xc97e('0x22')](respondWithResult(_0x59b72f,0xc9))[_0xc97e('0x41')](handleError(_0x59b72f,null));};exports[_0xc97e('0x21')]=function(_0x17a6f3,_0x4fa580){if(_0x17a6f3['body']['id']){delete _0x17a6f3[_0xc97e('0x46')]['id'];}return db[_0xc97e('0x29')][_0xc97e('0x44')]({'where':{'id':_0x17a6f3[_0xc97e('0x47')]['id']}})['then'](handleEntityNotFound(_0x4fa580,null))[_0xc97e('0x22')](saveUpdates(_0x17a6f3['body'],null))[_0xc97e('0x22')](respondWithResult(_0x4fa580,null))[_0xc97e('0x41')](handleError(_0x4fa580,null));};exports[_0xc97e('0x23')]=function(_0xe9370b,_0x236615){return db[_0xc97e('0x29')][_0xc97e('0x44')]({'where':{'id':_0xe9370b[_0xc97e('0x47')]['id']}})['then'](handleEntityNotFound(_0x236615,null))[_0xc97e('0x22')](removeEntity(_0x236615,null))[_0xc97e('0x41')](handleError(_0x236615,null));};exports[_0xc97e('0x48')]=function(_0x645796,_0x23f75d,_0x53b912){return db[_0xc97e('0x49')][_0xc97e('0x44')]({'where':{'id':_0x645796[_0xc97e('0x47')]['id']}})[_0xc97e('0x22')](handleEntityNotFound(_0x23f75d,null))[_0xc97e('0x22')](function(_0x5360e0){if(_0x5360e0){return _0x5360e0[_0xc97e('0x48')](_0x645796[_0xc97e('0x46')][_0xc97e('0x4a')],_['omit'](_0x645796[_0xc97e('0x46')],[_0xc97e('0x4a'),'id'])||{});}})[_0xc97e('0x22')](respondWithResult(_0x23f75d,null))[_0xc97e('0x41')](handleError(_0x23f75d,null));};exports[_0xc97e('0x4b')]=function(_0x40a524,_0x1e8c23,_0x1b80ac){var _0x24e7f6={};var _0x283581={};var _0x1383fd;var _0x39a767;return db[_0xc97e('0x29')][_0xc97e('0x4c')]({'where':{'id':_0x40a524[_0xc97e('0x47')]['id']}})[_0xc97e('0x22')](handleEntityNotFound(_0x1e8c23,null))[_0xc97e('0x22')](function(_0x5a1f42){if(_0x5a1f42){_0x1383fd=_0x5a1f42;_0x283581[_0xc97e('0x2e')]=_[_0xc97e('0x43')](db[_0xc97e('0x49')][_0xc97e('0x2a')]);_0x283581[_0xc97e('0x2f')]=_['keys'](_0x40a524[_0xc97e('0x2f')]);_0x283581[_0xc97e('0x30')]=_['intersection'](_0x283581[_0xc97e('0x2e')],_0x283581[_0xc97e('0x2f')]);_0x24e7f6[_0xc97e('0x31')]=_['intersection'](_0x283581[_0xc97e('0x2e')],qs[_0xc97e('0x33')](_0x40a524[_0xc97e('0x2f')]['fields']));_0x24e7f6['attributes']=_0x24e7f6[_0xc97e('0x31')][_0xc97e('0x34')]?_0x24e7f6['attributes']:_0x283581[_0xc97e('0x2e')];_0x24e7f6[_0xc97e('0x36')]=qs[_0xc97e('0x37')](_0x40a524['query'][_0xc97e('0x37')]);_0x24e7f6[_0xc97e('0x38')]=qs[_0xc97e('0x30')](_[_0xc97e('0x39')](_0x40a524[_0xc97e('0x2f')],_0x283581[_0xc97e('0x30')]));if(_0x40a524['query'][_0xc97e('0x3a')]){_0x24e7f6[_0xc97e('0x38')]=_[_0xc97e('0x3b')](_0x24e7f6['where'],{'$or':_['map'](_0x24e7f6[_0xc97e('0x31')],function(_0x481662){var _0x4b7e8b={};_0x4b7e8b[_0x481662]={'$like':'%'+_0x40a524[_0xc97e('0x2f')][_0xc97e('0x3a')]+'%'};return _0x4b7e8b;})});}_0x24e7f6=_['merge']({},_0x24e7f6,_0x40a524[_0xc97e('0x4d')]);return _0x1383fd[_0xc97e('0x4b')](_0x24e7f6);}})[_0xc97e('0x22')](function(_0x3363ea){if(_0x3363ea){_0x39a767=_0x3363ea[_0xc97e('0x34')];if(!_0x40a524['query'][_0xc97e('0x4e')](_0xc97e('0x35'))){_0x24e7f6[_0xc97e('0x1a')]=qs['limit'](_0x40a524[_0xc97e('0x2f')]['limit']);_0x24e7f6[_0xc97e('0x1d')]=qs[_0xc97e('0x1d')](_0x40a524[_0xc97e('0x2f')][_0xc97e('0x1d')]);}return _0x1383fd[_0xc97e('0x4b')](_0x24e7f6);}})['then'](function(_0xdbe808){if(_0xdbe808){return _0xdbe808?{'count':_0x39a767,'rows':_0xdbe808}:null;}})[_0xc97e('0x22')](respondWithResult(_0x1e8c23,null))['catch'](handleError(_0x1e8c23,null));};exports[_0xc97e('0x4f')]=function(_0x3ba7e8,_0x54b2d1,_0x485bcc){return db[_0xc97e('0x50')][_0xc97e('0x44')]({'where':{'id':_0x3ba7e8[_0xc97e('0x47')]['id']}})['then'](handleEntityNotFound(_0x54b2d1,null))[_0xc97e('0x22')](function(_0x37e32c){if(_0x37e32c){return _0x37e32c['addActions'](_0x3ba7e8[_0xc97e('0x46')][_0xc97e('0x4a')],_[_0xc97e('0x51')](_0x3ba7e8[_0xc97e('0x46')],[_0xc97e('0x4a'),'id'])||{});}})[_0xc97e('0x22')](respondWithResult(_0x54b2d1,null))[_0xc97e('0x41')](handleError(_0x54b2d1,null));};exports[_0xc97e('0x52')]=function(_0x42b45e,_0x51b076,_0x3125fb){var _0x2964d4={};var _0x35e353={};var _0x4066e9;var _0x1c0ca2;return db[_0xc97e('0x29')][_0xc97e('0x4c')]({'where':{'id':_0x42b45e[_0xc97e('0x47')]['id']}})['then'](handleEntityNotFound(_0x51b076,null))['then'](function(_0x220e48){if(_0x220e48){_0x4066e9=_0x220e48;_0x35e353['model']=_[_0xc97e('0x43')](db[_0xc97e('0x50')][_0xc97e('0x2a')]);_0x35e353[_0xc97e('0x2f')]=_['keys'](_0x42b45e[_0xc97e('0x2f')]);_0x35e353[_0xc97e('0x30')]=_['intersection'](_0x35e353['model'],_0x35e353[_0xc97e('0x2f')]);_0x2964d4[_0xc97e('0x31')]=_[_0xc97e('0x32')](_0x35e353[_0xc97e('0x2e')],qs[_0xc97e('0x33')](_0x42b45e[_0xc97e('0x2f')]['fields']));_0x2964d4[_0xc97e('0x31')]=_0x2964d4[_0xc97e('0x31')][_0xc97e('0x34')]?_0x2964d4[_0xc97e('0x31')]:_0x35e353[_0xc97e('0x2e')];_0x2964d4['order']=qs[_0xc97e('0x37')](_0x42b45e[_0xc97e('0x2f')]['sort']);_0x2964d4[_0xc97e('0x38')]=qs[_0xc97e('0x30')](_[_0xc97e('0x39')](_0x42b45e[_0xc97e('0x2f')],_0x35e353['filters']));if(_0x42b45e[_0xc97e('0x2f')][_0xc97e('0x3a')]){_0x2964d4['where']=_[_0xc97e('0x3b')](_0x2964d4[_0xc97e('0x38')],{'$or':_['map'](_0x2964d4[_0xc97e('0x31')],function(_0x3ae611){var _0x41b384={};_0x41b384[_0x3ae611]={'$like':'%'+_0x42b45e['query'][_0xc97e('0x3a')]+'%'};return _0x41b384;})});}_0x2964d4=_[_0xc97e('0x3b')]({},_0x2964d4,_0x42b45e['options']);return _0x4066e9[_0xc97e('0x52')](_0x2964d4);}})[_0xc97e('0x22')](function(_0x3074a9){if(_0x3074a9){_0x1c0ca2=_0x3074a9[_0xc97e('0x34')];if(!_0x42b45e[_0xc97e('0x2f')][_0xc97e('0x4e')](_0xc97e('0x35'))){_0x2964d4[_0xc97e('0x1a')]=qs[_0xc97e('0x1a')](_0x42b45e['query'][_0xc97e('0x1a')]);_0x2964d4[_0xc97e('0x1d')]=qs[_0xc97e('0x1d')](_0x42b45e['query'][_0xc97e('0x1d')]);}return _0x4066e9['getActions'](_0x2964d4);}})[_0xc97e('0x22')](function(_0x1deff6){if(_0x1deff6){return _0x1deff6?{'count':_0x1c0ca2,'rows':_0x1deff6}:null;}})[_0xc97e('0x22')](respondWithResult(_0x51b076,null))['catch'](handleError(_0x51b076,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index b19efc8..a785470 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 _0x309c=['../../config/environment','./automation.attributes','define','Automation','tools_automations','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x309c,0x9b));var _0xc309=function(_0x47f9c3,_0x139d6e){_0x47f9c3=_0x47f9c3-0x0;var _0x29a3aa=_0x309c[_0x47f9c3];return _0x29a3aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc309('0x0'))('api');var moment=require(_0xc309('0x1'));var BPromise=require(_0xc309('0x2'));var rp=require(_0xc309('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc309('0x4'));var config=require(_0xc309('0x5'));var attributes=require(_0xc309('0x6'));module['exports']=function(_0x43cb57,_0x4dd6c1){return _0x43cb57[_0xc309('0x7')](_0xc309('0x8'),attributes,{'tableName':_0xc309('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x624f=['util','../../config/logger','moment','bluebird','request-promise','rimraf','exports','Automation','tools_automations'];(function(_0x1daeaa,_0x297e73){var _0x2a6032=function(_0x11897b){while(--_0x11897b){_0x1daeaa['push'](_0x1daeaa['shift']());}};_0x2a6032(++_0x297e73);}(_0x624f,0x1c2));var _0xf624=function(_0x476c85,_0x541895){_0x476c85=_0x476c85-0x0;var _0xc8f22a=_0x624f[_0x476c85];return _0xc8f22a;};'use strict';var _=require('lodash');var util=require(_0xf624('0x0'));var logger=require(_0xf624('0x1'))('api');var moment=require(_0xf624('0x2'));var BPromise=require(_0xf624('0x3'));var rp=require(_0xf624('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf624('0x5'));var config=require('../../config/environment');var attributes=require('./automation.attributes');module[_0xf624('0x6')]=function(_0x114a20,_0x5a5ca5){return _0x114a20['define'](_0xf624('0x7'),attributes,{'tableName':_0xf624('0x8'),'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 ea88740..6ad9781 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 _0x4af8=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','Automation,\x20%s,\x20%s','result','catch','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x7b4bd8,_0x383ae8){var _0x1b70ce=function(_0x597000){while(--_0x597000){_0x7b4bd8['push'](_0x7b4bd8['shift']());}};_0x1b70ce(++_0x383ae8);}(_0x4af8,0x1ad));var _0x84af=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0x4af8[_0x1eda20];return _0x31b953;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84af('0x0'));var fs=require('fs');var Redis=require(_0x84af('0x1'));var db=require(_0x84af('0x2'))['db'];var utils=require(_0x84af('0x3'));var logger=require('../../config/logger')(_0x84af('0x4'));var config=require(_0x84af('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x84af('0x6')][_0x84af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x550ee6,_0x422c5b,_0x294bc8){return new BPromise(function(_0x483ecc,_0x5b5e45){return client[_0x84af('0x8')](_0x550ee6,_0x294bc8)[_0x84af('0x9')](function(_0x479e1b){logger[_0x84af('0xa')]('Automation,\x20%s,\x20%s',_0x422c5b,_0x84af('0xb'));logger[_0x84af('0xc')](_0x84af('0xd'),_0x422c5b,_0x84af('0xb'),JSON['stringify'](_0x479e1b));if(_0x479e1b[_0x84af('0xe')]){if(_0x479e1b['error'][_0x84af('0xf')]===0x1f4){logger[_0x84af('0xe')]('Automation,\x20%s,\x20%s',_0x422c5b,_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);return _0x5b5e45(_0x479e1b[_0x84af('0xe')][_0x84af('0x10')]);}logger['error'](_0x84af('0x11'),_0x422c5b,_0x479e1b['error'][_0x84af('0x10')]);return _0x483ecc(_0x479e1b[_0x84af('0xe')]['message']);}else{logger[_0x84af('0xa')](_0x84af('0x11'),_0x422c5b,'request\x20sent');_0x483ecc(_0x479e1b[_0x84af('0x12')]['message']);}})[_0x84af('0x13')](function(_0x33baf1){logger['error']('Automation,\x20%s,\x20%s',_0x422c5b,_0x33baf1);_0x5b5e45(_0x33baf1);});});} \ No newline at end of file +var _0xd983=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x434b80,_0x1e25cd){var _0x155c16=function(_0x2169cf){while(--_0x2169cf){_0x434b80['push'](_0x434b80['shift']());}};_0x155c16(++_0x1e25cd);}(_0xd983,0x1df));var _0x3d98=function(_0x1c0fe3,_0x4bc5ee){_0x1c0fe3=_0x1c0fe3-0x0;var _0x3061aa=_0xd983[_0x1c0fe3];return _0x3061aa;};'use strict';var _=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var moment=require(_0x3d98('0x2'));var BPromise=require(_0x3d98('0x3'));var rs=require(_0x3d98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d98('0x5'));var logger=require(_0x3d98('0x6'))(_0x3d98('0x7'));var config=require(_0x3d98('0x8'));var jayson=require(_0x3d98('0x9'));var client=jayson[_0x3d98('0xa')][_0x3d98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5452ef,_0x3f5c17,_0x270312){return new BPromise(function(_0xd1051d,_0x216a00){return client[_0x3d98('0xc')](_0x5452ef,_0x270312)[_0x3d98('0xd')](function(_0x274a9f){logger[_0x3d98('0xe')](_0x3d98('0xf'),_0x3f5c17,'request\x20sent');logger['debug'](_0x3d98('0x10'),_0x3f5c17,_0x3d98('0x11'),JSON[_0x3d98('0x12')](_0x274a9f));if(_0x274a9f[_0x3d98('0x13')]){if(_0x274a9f['error']['code']===0x1f4){logger[_0x3d98('0x13')](_0x3d98('0xf'),_0x3f5c17,_0x274a9f[_0x3d98('0x13')][_0x3d98('0x14')]);return _0x216a00(_0x274a9f['error'][_0x3d98('0x14')]);}logger[_0x3d98('0x13')]('Automation,\x20%s,\x20%s',_0x3f5c17,_0x274a9f[_0x3d98('0x13')]['message']);return _0xd1051d(_0x274a9f[_0x3d98('0x13')]['message']);}else{logger['info'](_0x3d98('0xf'),_0x3f5c17,_0x3d98('0x11'));_0xd1051d(_0x274a9f[_0x3d98('0x15')]['message']);}})[_0x3d98('0x16')](function(_0x372f29){logger['error'](_0x3d98('0xf'),_0x3f5c17,_0x372f29);_0x216a00(_0x372f29);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5158733..0919644 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 _0x7b47=['./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','/:id/actions','getActions','post','create','addConditions','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x19f074,_0x208bb3){var _0xe1a2ec=function(_0x3163cb){while(--_0x3163cb){_0x19f074['push'](_0x19f074['shift']());}};_0xe1a2ec(++_0x208bb3);}(_0x7b47,0x118));var _0x77b4=function(_0xc3ef36,_0x34dfa1){_0xc3ef36=_0xc3ef36-0x0;var _0x16b8e8=_0x7b47[_0xc3ef36];return _0x16b8e8;};'use strict';var multer=require('multer');var util=require(_0x77b4('0x0'));var path=require('path');var timeout=require(_0x77b4('0x1'));var express=require(_0x77b4('0x2'));var router=express[_0x77b4('0x3')]();var fs_extra=require(_0x77b4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x77b4('0x5'));var config=require('../../config/environment');var controller=require(_0x77b4('0x6'));router[_0x77b4('0x7')]('/',auth[_0x77b4('0x8')](),controller[_0x77b4('0x9')]);router[_0x77b4('0x7')](_0x77b4('0xa'),auth[_0x77b4('0x8')](),controller['show']);router[_0x77b4('0x7')](_0x77b4('0xb'),auth[_0x77b4('0x8')](),controller['getConditions']);router[_0x77b4('0x7')](_0x77b4('0xc'),auth[_0x77b4('0x8')](),controller[_0x77b4('0xd')]);router[_0x77b4('0xe')]('/',auth[_0x77b4('0x8')](),controller[_0x77b4('0xf')]);router[_0x77b4('0xe')](_0x77b4('0xb'),auth['isAuthenticated'](),controller[_0x77b4('0x10')]);router[_0x77b4('0xe')](_0x77b4('0xc'),auth[_0x77b4('0x8')](),controller['addActions']);router[_0x77b4('0x11')](_0x77b4('0xa'),auth[_0x77b4('0x8')](),controller[_0x77b4('0x12')]);router[_0x77b4('0x13')](_0x77b4('0xa'),auth[_0x77b4('0x8')](),controller[_0x77b4('0x14')]);module[_0x77b4('0x15')]=router; \ No newline at end of file +var _0xf5a7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','isAuthenticated','show','getConditions','getActions','post','/:id/conditions','addConditions','/:id/actions','addActions','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x3aa1c7,_0x345b06){var _0x3c1bb0=function(_0xfef58f){while(--_0xfef58f){_0x3aa1c7['push'](_0x3aa1c7['shift']());}};_0x3c1bb0(++_0x345b06);}(_0xf5a7,0x133));var _0x7f5a=function(_0x1df653,_0x28ec94){_0x1df653=_0x1df653-0x0;var _0x3ae43c=_0xf5a7[_0x1df653];return _0x3ae43c;};'use strict';var multer=require(_0x7f5a('0x0'));var util=require(_0x7f5a('0x1'));var path=require('path');var timeout=require(_0x7f5a('0x2'));var express=require(_0x7f5a('0x3'));var router=express[_0x7f5a('0x4')]();var fs_extra=require(_0x7f5a('0x5'));var auth=require(_0x7f5a('0x6'));var interaction=require(_0x7f5a('0x7'));var config=require(_0x7f5a('0x8'));var controller=require(_0x7f5a('0x9'));router[_0x7f5a('0xa')]('/',auth['isAuthenticated'](),controller[_0x7f5a('0xb')]);router[_0x7f5a('0xa')]('/:id',auth[_0x7f5a('0xc')](),controller[_0x7f5a('0xd')]);router[_0x7f5a('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x7f5a('0xe')]);router[_0x7f5a('0xa')]('/:id/actions',auth['isAuthenticated'](),controller[_0x7f5a('0xf')]);router[_0x7f5a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7f5a('0x10')](_0x7f5a('0x11'),auth[_0x7f5a('0xc')](),controller[_0x7f5a('0x12')]);router[_0x7f5a('0x10')](_0x7f5a('0x13'),auth['isAuthenticated'](),controller[_0x7f5a('0x14')]);router[_0x7f5a('0x15')](_0x7f5a('0x16'),auth[_0x7f5a('0xc')](),controller[_0x7f5a('0x17')]);router[_0x7f5a('0x18')](_0x7f5a('0x16'),auth[_0x7f5a('0xc')](),controller['destroy']);module[_0x7f5a('0x19')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 5cb5c7a..64add0f 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 _0x7e08=['Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED'];(function(_0x2bf888,_0x374f0b){var _0x3038d6=function(_0xe1b6d9){while(--_0xe1b6d9){_0x2bf888['push'](_0x2bf888['shift']());}};_0x3038d6(++_0x374f0b);}(_0x7e08,0xcc));var _0x87e0=function(_0x5a8432,_0x213916){_0x5a8432=_0x5a8432-0x0;var _0x2cadb0=_0x7e08[_0x5a8432];return _0x2cadb0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x87e0('0x0')],'unique':_0x87e0('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x87e0('0x2')),'allowNull':![],'defaultValue':_0x87e0('0x2')},'description':{'type':Sequelize[_0x87e0('0x0')]},'active':{'type':Sequelize[_0x87e0('0x3')],'defaultValue':0x0,'comment':_0x87e0('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x87e0('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x87e0('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x87e0('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x87e0('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x87e0('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0x9')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'comment':_0x87e0('0xa')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0xb')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x87e0('0x0')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x87e0('0x0')],'defaultValue':_0x87e0('0xc')},'dialCheckDuplicateType':{'type':Sequelize[_0x87e0('0xd')](_0x87e0('0xe'),_0x87e0('0xf'),_0x87e0('0x10')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x87e0('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x87e0('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x87e0('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x87e0('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x87e0('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x87e0('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x87e0('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x87e0('0x8')](0x9)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x87e0('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x87e0('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x87e0('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x87e0('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x87e0('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x87e0('0x1a'),_0x87e0('0x1b')),'defaultValue':_0x87e0('0x1a')},'dialPrefix':{'type':Sequelize[_0x87e0('0x0')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x87e0('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x87e0('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x87e0('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x87e0('0x8')](0x3)[_0x87e0('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x87e0('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x6257=['Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','ENUM','DESC','ASC','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6257,0x1d4));var _0x7625=function(_0xa10279,_0x10c119){_0xa10279=_0xa10279-0x0;var _0x261ac0=_0x6257[_0xa10279];return _0x261ac0;};'use strict';var Sequelize=require(_0x7625('0x0'));module['exports']={'name':{'type':Sequelize[_0x7625('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x7625('0x2')),'allowNull':![],'defaultValue':_0x7625('0x2')},'description':{'type':Sequelize[_0x7625('0x1')]},'active':{'type':Sequelize[_0x7625('0x3')],'defaultValue':0x0,'comment':_0x7625('0x4')},'limitCalls':{'type':Sequelize[_0x7625('0x5')](0x4)[_0x7625('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x7625('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x7625('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7625('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7625('0x8')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7625('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7625('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x7625('0x5')](0x5)[_0x7625('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x7625('0x5')](0x3)[_0x7625('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x7625('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7625('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7625('0xa')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7625('0x5')](0x3)[_0x7625('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7625('0xb')},'dialTimezone':{'type':Sequelize[_0x7625('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x7625('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x7625('0xc'),'never',_0x7625('0xd')),'defaultValue':_0x7625('0xc')},'dialAMDActive':{'type':Sequelize[_0x7625('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x7625('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x7625('0xe')},'dialAMDGreeting':{'type':Sequelize[_0x7625('0x5')](0x9)[_0x7625('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x7625('0xf')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7625('0x5')](0x9)[_0x7625('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7625('0x5')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7625('0x10')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7625('0x11')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7625('0x12')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x7625('0x5')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7625('0x13')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7625('0x5')](0x5)[_0x7625('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7625('0x5')](0x9)[_0x7625('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7625('0x14')},'dialOrderByScheduledAt':{'type':Sequelize[_0x7625('0x15')](_0x7625('0x16'),_0x7625('0x17')),'defaultValue':_0x7625('0x16')},'dialPrefix':{'type':Sequelize[_0x7625('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x7625('0x5')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7625('0x5')](0x3)[_0x7625('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x7625('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7625('0x18')},'dialDropMaxRetry':{'type':Sequelize[_0x7625('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7625('0x19')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7625('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7625('0x5')](0x3)[_0x7625('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7625('0x1a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x7625('0x5')](0x5)[_0x7625('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7625('0x1b')},'dialMachineMaxRetry':{'type':Sequelize[_0x7625('0x5')](0x3)[_0x7625('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7625('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7625('0x1c')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x7625('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7625('0x1d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7625('0x5')](0x5)[_0x7625('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7625('0x1e')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index f7694bd..5679455 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 _0xf150=['undefined','limit','count','set','Content-Range','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','name','send','index','map','Campaign','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','omit','createdAt','updatedAt','autoAssociation','update','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset'];(function(_0x2c9c70,_0x4ab4cb){var _0x3546bf=function(_0x318108){while(--_0x318108){_0x2c9c70['push'](_0x2c9c70['shift']());}};_0x3546bf(++_0x4ab4cb);}(_0xf150,0x106));var _0x0f15=function(_0x5a1321,_0x1de7b0){_0x5a1321=_0x5a1321-0x0;var _0x126ffe=_0xf150[_0x5a1321];return _0x126ffe;};'use strict';var emlformat=require(_0x0f15('0x0'));var rimraf=require(_0x0f15('0x1'));var zipdir=require(_0x0f15('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f15('0x3'));var moment=require(_0x0f15('0x4'));var BPromise=require(_0x0f15('0x5'));var Mustache=require(_0x0f15('0x6'));var util=require(_0x0f15('0x7'));var path=require(_0x0f15('0x8'));var sox=require(_0x0f15('0x9'));var csv=require(_0x0f15('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f15('0xb'));var squel=require(_0x0f15('0xc'));var crypto=require(_0x0f15('0xd'));var jsforce=require(_0x0f15('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0f15('0xa'));var querystring=require('querystring');var Papa=require(_0x0f15('0xf'));var Redis=require(_0x0f15('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f15('0x11'));var hardwareService=require(_0x0f15('0x12'));var logger=require(_0x0f15('0x13'))('api');var utils=require(_0x0f15('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0f15('0x15'))['db'];function respondWithStatusCode(_0x2d9cc1,_0x3146d2){_0x3146d2=_0x3146d2||0xcc;return function(_0x446cce){if(_0x446cce){return _0x2d9cc1['sendStatus'](_0x3146d2);}return _0x2d9cc1[_0x0f15('0x16')](_0x3146d2)[_0x0f15('0x17')]();};}function respondWithResult(_0x47060d,_0x4a54ea){_0x4a54ea=_0x4a54ea||0xc8;return function(_0x5ab21b){if(_0x5ab21b){return _0x47060d['status'](_0x4a54ea)[_0x0f15('0x18')](_0x5ab21b);}};}function respondWithFilteredResult(_0x33b604,_0x48138c){return function(_0x5827a9){if(_0x5827a9){var _0x46d54b=typeof _0x48138c[_0x0f15('0x19')]===_0x0f15('0x1a')&&typeof _0x48138c[_0x0f15('0x1b')]===_0x0f15('0x1a');var _0x1657e2=_0x5827a9[_0x0f15('0x1c')];var _0x47fb13=_0x46d54b?0x0:_0x48138c[_0x0f15('0x19')];var _0xae2a06=_0x46d54b?_0x5827a9['count']:_0x48138c[_0x0f15('0x19')]+_0x48138c['limit'];var _0x40e739;if(_0xae2a06>=_0x1657e2){_0xae2a06=_0x1657e2;_0x40e739=0xc8;}else{_0x40e739=0xce;}_0x33b604['status'](_0x40e739);return _0x33b604[_0x0f15('0x1d')](_0x0f15('0x1e'),_0x47fb13+'-'+_0xae2a06+'/'+_0x1657e2)['json'](_0x5827a9);}return null;};}function patchUpdates(_0x45b7ed){return function(_0x2b10fd){try{jsonpatch['apply'](_0x2b10fd,_0x45b7ed,!![]);}catch(_0x179c70){return BPromise['reject'](_0x179c70);}return _0x2b10fd['save']();};}function saveUpdates(_0x8e5c1,_0x5d5adf){return function(_0x55a9d8){if(_0x55a9d8){return _0x55a9d8['update'](_0x8e5c1)[_0x0f15('0x1f')](function(_0x179c15){return _0x179c15;});}return null;};}function removeEntity(_0x349de2,_0x2ace21){return function(_0x159ba6){if(_0x159ba6){return _0x159ba6[_0x0f15('0x20')]()[_0x0f15('0x1f')](function(){var _0x26008e=_0x159ba6[_0x0f15('0x21')]({'plain':!![]});var _0x5c9187=_0x0f15('0x22');return db[_0x0f15('0x23')][_0x0f15('0x20')]({'where':{'type':_0x5c9187,'resourceId':_0x26008e['id']}})['then'](function(){return _0x159ba6;});})[_0x0f15('0x1f')](function(){_0x349de2[_0x0f15('0x16')](0xcc)[_0x0f15('0x17')]();});}};}function handleEntityNotFound(_0x23b58e,_0x262a11){return function(_0x455139){if(!_0x455139){_0x23b58e[_0x0f15('0x24')](0x194);}return _0x455139;};}function handleError(_0x1940dd,_0xdc54c3){_0xdc54c3=_0xdc54c3||0x1f4;return function(_0xcc9776){logger[_0x0f15('0x25')](_0xcc9776['stack']);if(_0xcc9776[_0x0f15('0x26')]){delete _0xcc9776[_0x0f15('0x26')];}_0x1940dd[_0x0f15('0x16')](_0xdc54c3)[_0x0f15('0x27')](_0xcc9776);};}exports[_0x0f15('0x28')]=function(_0x38759a,_0x552c80){var _0xa3177c={},_0x57ea7c={},_0x12fea1={'count':0x0,'rows':[]};var _0x32a284=_[_0x0f15('0x29')](db[_0x0f15('0x2a')]['rawAttributes'],function(_0x56d7ff){return{'name':_0x56d7ff['fieldName'],'type':_0x56d7ff[_0x0f15('0x2b')][_0x0f15('0x2c')]};});_0x57ea7c['model']=_[_0x0f15('0x29')](_0x32a284,_0x0f15('0x26'));_0x57ea7c[_0x0f15('0x2d')]=_['keys'](_0x38759a[_0x0f15('0x2d')]);_0x57ea7c[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x57ea7c[_0x0f15('0x30')],_0x57ea7c['query']);_0xa3177c['attributes']=_[_0x0f15('0x2f')](_0x57ea7c[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x38759a[_0x0f15('0x2d')][_0x0f15('0x31')]));_0xa3177c[_0x0f15('0x32')]=_0xa3177c[_0x0f15('0x32')][_0x0f15('0x33')]?_0xa3177c[_0x0f15('0x32')]:_0x57ea7c[_0x0f15('0x30')];if(!_0x38759a[_0x0f15('0x2d')][_0x0f15('0x34')](_0x0f15('0x35'))){_0xa3177c['limit']=qs[_0x0f15('0x1b')](_0x38759a['query']['limit']);_0xa3177c[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0x38759a['query'][_0x0f15('0x19')]);}_0xa3177c['order']=qs['sort'](_0x38759a['query'][_0x0f15('0x36')]);_0xa3177c[_0x0f15('0x37')]=qs[_0x0f15('0x2e')](_[_0x0f15('0x38')](_0x38759a[_0x0f15('0x2d')],_0x57ea7c[_0x0f15('0x2e')]),_0x32a284);if(_0x38759a['query'][_0x0f15('0x39')]){_0xa3177c[_0x0f15('0x37')]=_[_0x0f15('0x3a')](_0xa3177c[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x32a284,function(_0x4e21f4){if(_0x4e21f4[_0x0f15('0x2b')]!==_0x0f15('0x3b')){var _0x3fe0c0={};_0x3fe0c0[_0x4e21f4[_0x0f15('0x26')]]={'$like':'%'+_0x38759a['query']['filter']+'%'};return _0x3fe0c0;}})});}_0xa3177c=_[_0x0f15('0x3a')]({},_0xa3177c,_0x38759a[_0x0f15('0x3c')]);var _0x12ba44={'where':_0xa3177c['where']};return db[_0x0f15('0x2a')][_0x0f15('0x1c')](_0x12ba44)[_0x0f15('0x1f')](function(_0x15cc38){_0x12fea1['count']=_0x15cc38;if(_0x38759a[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0xa3177c[_0x0f15('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0x0f15('0x3f')](_0xa3177c);})[_0x0f15('0x1f')](function(_0x1f80a4){_0x12fea1[_0x0f15('0x40')]=_0x1f80a4;return _0x12fea1;})[_0x0f15('0x1f')](respondWithFilteredResult(_0x552c80,_0xa3177c))[_0x0f15('0x41')](handleError(_0x552c80,null));};exports[_0x0f15('0x42')]=function(_0x203255,_0x3348c2){var _0x3cdf3={'raw':![],'where':{'id':_0x203255[_0x0f15('0x43')]['id']}},_0x5ae190={};_0x5ae190[_0x0f15('0x30')]=_['keys'](db[_0x0f15('0x2a')][_0x0f15('0x44')]);_0x5ae190['query']=_['keys'](_0x203255[_0x0f15('0x2d')]);_0x5ae190[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x5ae190['model'],_0x5ae190['query']);_0x3cdf3[_0x0f15('0x32')]=_[_0x0f15('0x2f')](_0x5ae190[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x203255[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x3cdf3[_0x0f15('0x32')]=_0x3cdf3['attributes'][_0x0f15('0x33')]?_0x3cdf3[_0x0f15('0x32')]:_0x5ae190[_0x0f15('0x30')];if(_0x203255['query']['includeAll']){_0x3cdf3[_0x0f15('0x3e')]=[{'all':!![]}];}_0x3cdf3=_['merge']({},_0x3cdf3,_0x203255[_0x0f15('0x3c')]);return db['Campaign'][_0x0f15('0x45')](_0x3cdf3)[_0x0f15('0x1f')](handleEntityNotFound(_0x3348c2,null))[_0x0f15('0x1f')](respondWithResult(_0x3348c2,null))[_0x0f15('0x41')](handleError(_0x3348c2,null));};exports[_0x0f15('0x46')]=function(_0x40e051,_0x5ec882){return db[_0x0f15('0x2a')][_0x0f15('0x46')](_0x40e051[_0x0f15('0x47')],{})['then'](function(_0x4de6d9){var _0x505882=_0x40e051[_0x0f15('0x48')][_0x0f15('0x21')]({'plain':!![]});if(!_0x505882)throw new Error(_0x0f15('0x49'));if(_0x505882[_0x0f15('0x4a')]===_0x0f15('0x48')){var _0x21a6a7=_0x4de6d9[_0x0f15('0x21')]({'plain':!![]});var _0x406eda='IvrCampaigns';return db[_0x0f15('0x4b')]['find']({'where':{'name':_0x406eda,'userProfileId':_0x505882[_0x0f15('0x4c')]},'raw':!![]})[_0x0f15('0x1f')](function(_0x1301b2){if(_0x1301b2&&_0x1301b2['autoAssociation']===0x0){return db['UserProfileResource'][_0x0f15('0x46')]({'name':_0x21a6a7[_0x0f15('0x26')],'resourceId':_0x21a6a7['id'],'type':_0x1301b2[_0x0f15('0x26')],'sectionId':_0x1301b2['id']},{})[_0x0f15('0x1f')](function(){return _0x4de6d9;});}else{return _0x4de6d9;}})['catch'](function(_0x5156d0){logger[_0x0f15('0x25')](_0x0f15('0x4d'),_0x5156d0);throw _0x5156d0;});}return _0x4de6d9;})[_0x0f15('0x1f')](respondWithResult(_0x5ec882,0xc9))[_0x0f15('0x41')](handleError(_0x5ec882,null));};exports[_0x0f15('0x4e')]=function(_0x1a1a39,_0x3d4eb0){var _0x354719={'where':{'id':_0x1a1a39[_0x0f15('0x43')]['id']}},_0x362d9b={};_0x362d9b['model']=_[_0x0f15('0x4f')](db['Campaign'][_0x0f15('0x44')]);_0x354719['attributes']=_[_0x0f15('0x2f')](_0x362d9b['model'],qs[_0x0f15('0x31')](_0x1a1a39[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x354719[_0x0f15('0x32')]=_0x354719[_0x0f15('0x32')][_0x0f15('0x33')]?_0x354719[_0x0f15('0x32')]:_0x362d9b[_0x0f15('0x30')];if(_0x1a1a39[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0x354719[_0x0f15('0x3e')]=[{'all':!![]}];}_0x354719=_[_0x0f15('0x3a')]({},_0x354719,_0x1a1a39[_0x0f15('0x3c')]);return db[_0x0f15('0x2a')]['find'](_0x354719)['then'](handleEntityNotFound(_0x3d4eb0,null))[_0x0f15('0x1f')](function(_0x5f7b10){if(_0x5f7b10){var _0x509b42=_0x5f7b10[_0x0f15('0x21')]({'plain':!![]});_0x509b42=qs[_0x0f15('0x50')](_0x509b42,['id',_0x0f15('0x51'),_0x0f15('0x52')]);_0x1a1a39[_0x0f15('0x47')]=_[_0x0f15('0x50')](_0x1a1a39[_0x0f15('0x47')],['id',_0x0f15('0x51'),_0x0f15('0x52')]);return db[_0x0f15('0x2a')][_0x0f15('0x46')](_['merge'](_0x509b42,_0x1a1a39[_0x0f15('0x47')]),{'include':_0x1a1a39[_0x0f15('0x2d')][_0x0f15('0x3d')]?[{'all':!![]}]:undefined})[_0x0f15('0x1f')](function(_0x425a9c){var _0x272977=_0x1a1a39[_0x0f15('0x48')][_0x0f15('0x21')]({'plain':!![]});if(!_0x272977)throw new Error(_0x0f15('0x49'));if(_0x272977['role']==='user'){var _0x48eb5a=_0x425a9c['get']({'plain':!![]});var _0x54dfd8='IvrCampaigns';return db[_0x0f15('0x4b')][_0x0f15('0x45')]({'where':{'name':_0x54dfd8,'userProfileId':_0x272977[_0x0f15('0x4c')]},'raw':!![]})[_0x0f15('0x1f')](function(_0x26341a){if(_0x26341a&&_0x26341a[_0x0f15('0x53')]===0x0){return db[_0x0f15('0x23')][_0x0f15('0x46')]({'name':_0x48eb5a['name'],'resourceId':_0x48eb5a['id'],'type':_0x26341a[_0x0f15('0x26')],'sectionId':_0x26341a['id']},{})[_0x0f15('0x1f')](function(){return _0x425a9c;});}else{return _0x425a9c;}})[_0x0f15('0x41')](function(_0x3c8960){logger[_0x0f15('0x25')](_0x0f15('0x4d'),_0x3c8960);throw _0x3c8960;});}return _0x425a9c;});}})[_0x0f15('0x1f')](respondWithResult(_0x3d4eb0,0xc9))[_0x0f15('0x41')](handleError(_0x3d4eb0,null));};exports[_0x0f15('0x54')]=function(_0x5374d0,_0x113531){if(_0x5374d0['body']['id']){delete _0x5374d0[_0x0f15('0x47')]['id'];}return db[_0x0f15('0x2a')]['find']({'where':{'id':_0x5374d0[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x113531,null))[_0x0f15('0x1f')](saveUpdates(_0x5374d0[_0x0f15('0x47')],null))['then'](respondWithResult(_0x113531,null))['catch'](handleError(_0x113531,null));};exports[_0x0f15('0x20')]=function(_0x2395c6,_0x1ded63){return db['Campaign'][_0x0f15('0x45')]({'where':{'id':_0x2395c6[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x1ded63,null))[_0x0f15('0x1f')](removeEntity(_0x1ded63,null))[_0x0f15('0x41')](handleError(_0x1ded63,null));};exports['getHoppers']=function(_0x1b4b64,_0x51ad6d,_0x30b3f2){var _0xc17fee={'raw':!![],'where':{}};var _0x2d8a39={};var _0x46cb18={'count':0x0,'rows':[]};return db['Campaign'][_0x0f15('0x55')]({'where':{'id':_0x1b4b64[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x51ad6d,null))[_0x0f15('0x1f')](function(_0x4408e){if(_0x4408e){_0x2d8a39[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db[_0x0f15('0x56')][_0x0f15('0x44')]);_0x2d8a39[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0x1b4b64[_0x0f15('0x2d')]);_0x2d8a39[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x2d8a39[_0x0f15('0x30')],_0x2d8a39['query']);_0xc17fee[_0x0f15('0x32')]=_[_0x0f15('0x2f')](_0x2d8a39[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x1b4b64['query'][_0x0f15('0x31')]));_0xc17fee['attributes']=_0xc17fee[_0x0f15('0x32')][_0x0f15('0x33')]?_0xc17fee[_0x0f15('0x32')]:_0x2d8a39[_0x0f15('0x30')];if(!_0x1b4b64['query'][_0x0f15('0x34')](_0x0f15('0x35'))){_0xc17fee[_0x0f15('0x1b')]=qs[_0x0f15('0x1b')](_0x1b4b64[_0x0f15('0x2d')]['limit']);_0xc17fee[_0x0f15('0x19')]=qs['offset'](_0x1b4b64['query'][_0x0f15('0x19')]);}_0xc17fee['order']=qs[_0x0f15('0x36')](_0x1b4b64['query'][_0x0f15('0x36')]);_0xc17fee[_0x0f15('0x37')]=qs[_0x0f15('0x2e')](_[_0x0f15('0x38')](_0x1b4b64[_0x0f15('0x2d')],_0x2d8a39['filters']));_0xc17fee[_0x0f15('0x37')][_0x0f15('0x57')]=_0x4408e['id'];if(_0x1b4b64[_0x0f15('0x2d')][_0x0f15('0x39')]){_0xc17fee['where']=_[_0x0f15('0x3a')](_0xc17fee[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0xc17fee[_0x0f15('0x32')],function(_0x537f80){var _0x370c04={};_0x370c04[_0x537f80]={'$like':'%'+_0x1b4b64[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x370c04;})});}_0xc17fee=_[_0x0f15('0x3a')]({},_0xc17fee,_0x1b4b64[_0x0f15('0x3c')]);return db[_0x0f15('0x56')][_0x0f15('0x1c')]({'where':_0xc17fee[_0x0f15('0x37')]})[_0x0f15('0x1f')](function(_0x51082a){_0x46cb18['count']=_0x51082a;if(_0x1b4b64[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0xc17fee[_0x0f15('0x3e')]=[{'all':!![]}];}return db[_0x0f15('0x56')]['findAll'](_0xc17fee);})[_0x0f15('0x1f')](function(_0x2b0fd6){_0x46cb18[_0x0f15('0x40')]=_0x2b0fd6;return _0x46cb18;});}})[_0x0f15('0x1f')](respondWithFilteredResult(_0x51ad6d,_0xc17fee))['catch'](handleError(_0x51ad6d,null));};exports[_0x0f15('0x58')]=function(_0xad1b45,_0x388c62,_0x1319fd){var _0x1e198c={'raw':!![],'where':{}};var _0x26ee7b={};var _0x22ac0e={'count':0x0,'rows':[]};return db[_0x0f15('0x2a')][_0x0f15('0x55')]({'where':{'id':_0xad1b45[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x388c62,null))[_0x0f15('0x1f')](function(_0x24cd99){if(_0x24cd99){_0x26ee7b['model']=_['keys'](db[_0x0f15('0x59')]['rawAttributes']);_0x26ee7b[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0xad1b45['query']);_0x26ee7b[_0x0f15('0x2e')]=_['intersection'](_0x26ee7b['model'],_0x26ee7b[_0x0f15('0x2d')]);_0x1e198c[_0x0f15('0x32')]=_[_0x0f15('0x2f')](_0x26ee7b[_0x0f15('0x30')],qs['fields'](_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x1e198c[_0x0f15('0x32')]=_0x1e198c[_0x0f15('0x32')]['length']?_0x1e198c[_0x0f15('0x32')]:_0x26ee7b[_0x0f15('0x30')];if(!_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x34')](_0x0f15('0x35'))){_0x1e198c[_0x0f15('0x1b')]=qs['limit'](_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x1b')]);_0x1e198c[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0xad1b45['query']['offset']);}_0x1e198c[_0x0f15('0x5a')]=qs[_0x0f15('0x36')](_0xad1b45['query'][_0x0f15('0x36')]);_0x1e198c[_0x0f15('0x37')]=qs['filters'](_['pick'](_0xad1b45[_0x0f15('0x2d')],_0x26ee7b[_0x0f15('0x2e')]));_0x1e198c[_0x0f15('0x37')]['CampaignId']=_0x24cd99['id'];if(_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x39')]){_0x1e198c[_0x0f15('0x37')]=_[_0x0f15('0x3a')](_0x1e198c[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x1e198c[_0x0f15('0x32')],function(_0x1166ef){var _0x467368={};_0x467368[_0x1166ef]={'$like':'%'+_0xad1b45[_0x0f15('0x2d')]['filter']+'%'};return _0x467368;})});}_0x1e198c=_['merge']({},_0x1e198c,_0xad1b45[_0x0f15('0x3c')]);return db[_0x0f15('0x59')]['count']({'where':_0x1e198c[_0x0f15('0x37')]})[_0x0f15('0x1f')](function(_0x33861b){_0x22ac0e[_0x0f15('0x1c')]=_0x33861b;if(_0xad1b45[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0x1e198c[_0x0f15('0x3e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0f15('0x3f')](_0x1e198c);})[_0x0f15('0x1f')](function(_0x55ee1e){_0x22ac0e[_0x0f15('0x40')]=_0x55ee1e;return _0x22ac0e;});}})[_0x0f15('0x1f')](respondWithFilteredResult(_0x388c62,_0x1e198c))[_0x0f15('0x41')](handleError(_0x388c62,null));};exports['getHopperFinals']=function(_0x3e5ab0,_0xf82f66,_0x331300){var _0x2571e8={'raw':!![],'where':{}};var _0x1c2ed7={};var _0x5ad3c5={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3e5ab0[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0xf82f66,null))['then'](function(_0x52bea2){if(_0x52bea2){_0x1c2ed7[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db['CmHopperFinal']['rawAttributes']);_0x1c2ed7[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0x3e5ab0[_0x0f15('0x2d')]);_0x1c2ed7[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x1c2ed7[_0x0f15('0x30')],_0x1c2ed7['query']);_0x2571e8['attributes']=_['intersection'](_0x1c2ed7[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x3e5ab0[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x2571e8['attributes']=_0x2571e8[_0x0f15('0x32')]['length']?_0x2571e8['attributes']:_0x1c2ed7[_0x0f15('0x30')];if(!_0x3e5ab0['query'][_0x0f15('0x34')](_0x0f15('0x35'))){_0x2571e8[_0x0f15('0x1b')]=qs[_0x0f15('0x1b')](_0x3e5ab0[_0x0f15('0x2d')]['limit']);_0x2571e8[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0x3e5ab0[_0x0f15('0x2d')][_0x0f15('0x19')]);}_0x2571e8['order']=qs[_0x0f15('0x36')](_0x3e5ab0['query'][_0x0f15('0x36')]);_0x2571e8[_0x0f15('0x37')]=qs['filters'](_[_0x0f15('0x38')](_0x3e5ab0[_0x0f15('0x2d')],_0x1c2ed7['filters']));_0x2571e8[_0x0f15('0x37')][_0x0f15('0x57')]=_0x52bea2['id'];if(_0x3e5ab0[_0x0f15('0x2d')]['filter']){_0x2571e8[_0x0f15('0x37')]=_[_0x0f15('0x3a')](_0x2571e8[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x2571e8[_0x0f15('0x32')],function(_0x69aca7){var _0x9f511c={};_0x9f511c[_0x69aca7]={'$like':'%'+_0x3e5ab0[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x9f511c;})});}_0x2571e8=_[_0x0f15('0x3a')]({},_0x2571e8,_0x3e5ab0[_0x0f15('0x3c')]);return db[_0x0f15('0x5b')][_0x0f15('0x1c')]({'where':_0x2571e8[_0x0f15('0x37')]})['then'](function(_0x4a68a8){_0x5ad3c5[_0x0f15('0x1c')]=_0x4a68a8;if(_0x3e5ab0['query'][_0x0f15('0x3d')]){_0x2571e8[_0x0f15('0x3e')]=[{'all':!![]}];}return db[_0x0f15('0x5b')][_0x0f15('0x3f')](_0x2571e8);})['then'](function(_0x352f5d){_0x5ad3c5['rows']=_0x352f5d;return _0x5ad3c5;});}})[_0x0f15('0x1f')](respondWithFilteredResult(_0xf82f66,_0x2571e8))[_0x0f15('0x41')](handleError(_0xf82f66,null));};exports[_0x0f15('0x5c')]=function(_0xc8d0cb,_0x198650,_0x50f2ea){var _0x4286d6={'raw':!![],'where':{}};var _0x26a1b2={};var _0x3ec85d={'count':0x0,'rows':[]};return db[_0x0f15('0x2a')]['findOne']({'where':{'id':_0xc8d0cb[_0x0f15('0x43')]['id']}})['then'](handleEntityNotFound(_0x198650,null))[_0x0f15('0x1f')](function(_0x21bce5){if(_0x21bce5){_0x26a1b2[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db[_0x0f15('0x5d')]['rawAttributes']);_0x26a1b2[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0xc8d0cb[_0x0f15('0x2d')]);_0x26a1b2[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x26a1b2['model'],_0x26a1b2[_0x0f15('0x2d')]);_0x4286d6['attributes']=_[_0x0f15('0x2f')](_0x26a1b2[_0x0f15('0x30')],qs['fields'](_0xc8d0cb['query'][_0x0f15('0x31')]));_0x4286d6[_0x0f15('0x32')]=_0x4286d6['attributes']['length']?_0x4286d6[_0x0f15('0x32')]:_0x26a1b2['model'];if(!_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x34')](_0x0f15('0x35'))){_0x4286d6[_0x0f15('0x1b')]=qs[_0x0f15('0x1b')](_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x1b')]);_0x4286d6['offset']=qs[_0x0f15('0x19')](_0xc8d0cb[_0x0f15('0x2d')]['offset']);}_0x4286d6[_0x0f15('0x5a')]=qs[_0x0f15('0x36')](_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x36')]);_0x4286d6['where']=qs[_0x0f15('0x2e')](_['pick'](_0xc8d0cb[_0x0f15('0x2d')],_0x26a1b2[_0x0f15('0x2e')]));_0x4286d6[_0x0f15('0x37')][_0x0f15('0x57')]=_0x21bce5['id'];if(_0xc8d0cb[_0x0f15('0x2d')]['filter']){_0x4286d6['where']=_['merge'](_0x4286d6[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x4286d6[_0x0f15('0x32')],function(_0x1b6554){var _0x3789a5={};_0x3789a5[_0x1b6554]={'$like':'%'+_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x3789a5;})});}_0x4286d6=_['merge']({},_0x4286d6,_0xc8d0cb[_0x0f15('0x3c')]);return db[_0x0f15('0x5d')][_0x0f15('0x1c')]({'where':_0x4286d6[_0x0f15('0x37')]})[_0x0f15('0x1f')](function(_0x3f3608){_0x3ec85d[_0x0f15('0x1c')]=_0x3f3608;if(_0xc8d0cb[_0x0f15('0x2d')][_0x0f15('0x3d')]){_0x4286d6[_0x0f15('0x3e')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x4286d6);})[_0x0f15('0x1f')](function(_0x279ac5){_0x3ec85d[_0x0f15('0x40')]=_0x279ac5;return _0x3ec85d;});}})[_0x0f15('0x1f')](respondWithFilteredResult(_0x198650,_0x4286d6))[_0x0f15('0x41')](handleError(_0x198650,null));};exports['getLists']=function(_0x40e1e4,_0x45db14,_0x2f1969){var _0x33b2f2={};var _0x2b72a7={};var _0x3c0387;var _0x20b219;return db[_0x0f15('0x2a')][_0x0f15('0x55')]({'where':{'id':_0x40e1e4[_0x0f15('0x43')]['id']}})['then'](handleEntityNotFound(_0x45db14,null))[_0x0f15('0x1f')](function(_0x21deec){if(_0x21deec){_0x3c0387=_0x21deec;_0x2b72a7[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db[_0x0f15('0x5e')]['rawAttributes']);_0x2b72a7[_0x0f15('0x2d')]=_[_0x0f15('0x4f')](_0x40e1e4[_0x0f15('0x2d')]);_0x2b72a7[_0x0f15('0x2e')]=_['intersection'](_0x2b72a7[_0x0f15('0x30')],_0x2b72a7[_0x0f15('0x2d')]);_0x33b2f2[_0x0f15('0x32')]=_['intersection'](_0x2b72a7[_0x0f15('0x30')],qs[_0x0f15('0x31')](_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x31')]));_0x33b2f2['attributes']=_0x33b2f2['attributes'][_0x0f15('0x33')]?_0x33b2f2[_0x0f15('0x32')]:_0x2b72a7['model'];_0x33b2f2['order']=qs[_0x0f15('0x36')](_0x40e1e4['query'][_0x0f15('0x36')]);_0x33b2f2[_0x0f15('0x37')]=qs[_0x0f15('0x2e')](_[_0x0f15('0x38')](_0x40e1e4[_0x0f15('0x2d')],_0x2b72a7[_0x0f15('0x2e')]));if(_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x39')]){_0x33b2f2[_0x0f15('0x37')]=_[_0x0f15('0x3a')](_0x33b2f2[_0x0f15('0x37')],{'$or':_[_0x0f15('0x29')](_0x33b2f2[_0x0f15('0x32')],function(_0x21e48c){var _0x587cde={};_0x587cde[_0x21e48c]={'$like':'%'+_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x587cde;})});}_0x33b2f2=_[_0x0f15('0x3a')]({},_0x33b2f2,_0x40e1e4[_0x0f15('0x3c')]);return _0x3c0387['getLists'](_0x33b2f2);}})[_0x0f15('0x1f')](function(_0x1a3352){if(_0x1a3352){_0x20b219=_0x1a3352[_0x0f15('0x33')];if(!_0x40e1e4[_0x0f15('0x2d')]['hasOwnProperty']('nolimit')){_0x33b2f2['limit']=qs[_0x0f15('0x1b')](_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x1b')]);_0x33b2f2[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0x40e1e4[_0x0f15('0x2d')][_0x0f15('0x19')]);}return _0x3c0387['getLists'](_0x33b2f2);}})[_0x0f15('0x1f')](function(_0x3442d6){if(_0x3442d6){return _0x3442d6?{'count':_0x20b219,'rows':_0x3442d6}:null;}})[_0x0f15('0x1f')](respondWithResult(_0x45db14,null))[_0x0f15('0x41')](handleError(_0x45db14,null));};exports[_0x0f15('0x5f')]=function(_0x4b3747,_0x2da705,_0x62a577){var _0x38bd84,_0xadcce8;var _0x1ec4fb=[];var _0x4ea4a3=moment()['format'](_0x0f15('0x60'));return db['Campaign'][_0x0f15('0x45')]({'where':{'id':_0x4b3747['params']['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x2da705,null))[_0x0f15('0x1f')](function(_0x284d9a){if(_0x284d9a){_0xadcce8=_0x284d9a;return _0x284d9a[_0x0f15('0x5f')](_0x4b3747[_0x0f15('0x47')][_0x0f15('0x61')],_['omit'](_0x4b3747['body'],['ids','id'])||{});}return null;})[_0x0f15('0x62')](function(_0x342516){var _0x30c890;var _0x3d985c;_0x38bd84=_0x342516||[];var _0x2382ab=[];if(_0x342516){for(var _0x54bdc6=0x0;_0x54bdc6<_0x342516['length'];_0x54bdc6+=0x1){var _0x1f2a6f=_0x342516[_0x54bdc6][_0x0f15('0x21')]({'plain':!![]});_0xadcce8[_0x0f15('0x63')]=_0x4b3747[_0x0f15('0x47')][_0x0f15('0x63')]?_0x4b3747[_0x0f15('0x47')][_0x0f15('0x63')]:_0xadcce8[_0x0f15('0x63')];switch(_0xadcce8[_0x0f15('0x63')]){case'always':_0x30c890=squel[_0x0f15('0x64')]()[_0x0f15('0x65')](_0x0f15('0x66'))[_0x0f15('0x67')]([_0x0f15('0x68'),'scheduledAt',_0x0f15('0x69'),_0x0f15('0x6a'),'CampaignId',_0x0f15('0x51'),_0x0f15('0x52')],squel[_0x0f15('0x6b')]()[_0x0f15('0x6c')]('phone',_0x0f15('0x68'))[_0x0f15('0x6c')](_0x0f15('0x6d'),_0x0f15('0x6e'))[_0x0f15('0x6c')]('id','ContactId')[_0x0f15('0x6c')](_0x1f2a6f[_0x0f15('0x6f')][_0x0f15('0x70')](),_0x0f15('0x6a'))['field'](_0x4b3747[_0x0f15('0x43')]['id']['toString'](),'CampaignId')[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x51'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x52'))[_0x0f15('0x71')](_0x0f15('0x72'))[_0x0f15('0x37')](_0x0f15('0x73'))[_0x0f15('0x37')]('ListId\x20=\x20?',_0x1f2a6f['CmListId'][_0x0f15('0x70')]())[_0x0f15('0x37')]('phone\x20IS\x20NOT\x20NULL')[_0x0f15('0x37')](_0x0f15('0x74'),squel['select']()[_0x0f15('0x6c')](_0x0f15('0x75'))[_0x0f15('0x71')](_0x0f15('0x76'))[_0x0f15('0x37')](_0x0f15('0x77'),_0x4b3747[_0x0f15('0x43')]['id'][_0x0f15('0x70')]()))['where'](_0x0f15('0x74'),squel[_0x0f15('0x6b')]()[_0x0f15('0x6c')](_0x0f15('0x78'))[_0x0f15('0x71')](_0x0f15('0x66'))[_0x0f15('0x37')]('CampaignId\x20=\x20?',_0x4b3747[_0x0f15('0x43')]['id'][_0x0f15('0x70')]())))[_0x0f15('0x70')]();break;case _0x0f15('0x79'):_0x30c890=squel[_0x0f15('0x64')]()[_0x0f15('0x65')]('cm_hopper')[_0x0f15('0x67')]([_0x0f15('0x68'),_0x0f15('0x6e'),_0x0f15('0x69'),_0x0f15('0x6a'),_0x0f15('0x57'),'createdAt',_0x0f15('0x52')],squel[_0x0f15('0x6b')]()[_0x0f15('0x6c')]('phone',_0x0f15('0x68'))['field'](_0x0f15('0x6d'),'scheduledAt')[_0x0f15('0x6c')]('id',_0x0f15('0x69'))['field'](_0x1f2a6f[_0x0f15('0x6f')]['toString'](),'ListId')[_0x0f15('0x6c')](_0x4b3747[_0x0f15('0x43')]['id'][_0x0f15('0x70')](),_0x0f15('0x57'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x51'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x52'))[_0x0f15('0x71')](_0x0f15('0x72'))[_0x0f15('0x37')]('deletedAt\x20IS\x20NULL')[_0x0f15('0x37')](_0x0f15('0x7a'),_0x1f2a6f['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x0f15('0x37')](_0x0f15('0x74'),squel[_0x0f15('0x6b')]()[_0x0f15('0x6c')](_0x0f15('0x78'))['from'](_0x0f15('0x66'))[_0x0f15('0x37')](_0x0f15('0x77'),_0x4b3747['params']['id'][_0x0f15('0x70')]())))[_0x0f15('0x70')]();break;default:_0x30c890=squel[_0x0f15('0x64')]()[_0x0f15('0x65')](_0x0f15('0x66'))[_0x0f15('0x67')]([_0x0f15('0x68'),_0x0f15('0x6e'),'ContactId',_0x0f15('0x6a'),_0x0f15('0x57'),_0x0f15('0x51'),_0x0f15('0x52')],squel['select']()[_0x0f15('0x6c')](_0x0f15('0x68'),'phone')[_0x0f15('0x6c')](_0x0f15('0x6d'),_0x0f15('0x6e'))[_0x0f15('0x6c')]('id',_0x0f15('0x69'))['field'](_0x1f2a6f[_0x0f15('0x6f')][_0x0f15('0x70')](),_0x0f15('0x6a'))[_0x0f15('0x6c')](_0x4b3747[_0x0f15('0x43')]['id'][_0x0f15('0x70')](),_0x0f15('0x57'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27','createdAt')[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27','updatedAt')[_0x0f15('0x71')](_0x0f15('0x72'))[_0x0f15('0x37')](_0x0f15('0x73'))[_0x0f15('0x37')](_0x0f15('0x7a'),_0x1f2a6f[_0x0f15('0x6f')][_0x0f15('0x70')]())['where'](_0x0f15('0x7b')))[_0x0f15('0x70')]();}_0x3d985c=squel[_0x0f15('0x64')]()['into']('cm_hopper_additional_phones')['fromQuery']([_0x0f15('0x7c'),_0x0f15('0x6e'),_0x0f15('0x68'),'OrderBy',_0x0f15('0x51'),_0x0f15('0x52')],squel[_0x0f15('0x6b')]()['field'](_0x0f15('0x7d'),'id')[_0x0f15('0x6c')](_0x0f15('0x6d'),_0x0f15('0x6e'))[_0x0f15('0x6c')](_0x0f15('0x7e'),_0x0f15('0x68'))[_0x0f15('0x6c')](_0x0f15('0x7f'),_0x0f15('0x80'))['field']('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x51'))[_0x0f15('0x6c')]('\x27'+_0x4ea4a3+'\x27',_0x0f15('0x52'))[_0x0f15('0x71')](_0x0f15('0x81'),'ci')[_0x0f15('0x82')]('cm_hopper','h',_0x0f15('0x83'))[_0x0f15('0x37')](_0x0f15('0x84'),_0x1f2a6f[_0x0f15('0x6f')]['toString']())[_0x0f15('0x37')](_0x0f15('0x85'),_0x4b3747[_0x0f15('0x43')]['id']['toString']())[_0x0f15('0x37')](_0x0f15('0x86'),_0x4ea4a3))[_0x0f15('0x70')]();_0x2382ab[_0x0f15('0x87')](db['sequelize'][_0x0f15('0x2d')](_0x30c890));_0x1ec4fb[_0x0f15('0x87')](db[_0x0f15('0x88')][_0x0f15('0x2d')](_0x3d985c));}return BPromise[_0x0f15('0x89')](_0x2382ab);}})[_0x0f15('0x1f')](function(){return BPromise[_0x0f15('0x89')](_0x1ec4fb);})[_0x0f15('0x1f')](function(){return _0x38bd84;})[_0x0f15('0x1f')](respondWithResult(_0x2da705,null))[_0x0f15('0x41')](handleError(_0x2da705,null));};exports[_0x0f15('0x8a')]=function(_0x5e1ec9,_0x4a291e,_0x361b46){return db[_0x0f15('0x2a')][_0x0f15('0x45')]({'where':{'id':_0x5e1ec9[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x4a291e,null))['then'](function(_0x593b4a){if(_0x593b4a){return _0x593b4a[_0x0f15('0x8a')](_0x5e1ec9[_0x0f15('0x2d')][_0x0f15('0x61')]);}})[_0x0f15('0x1f')](function(_0x42e655){if(_0x42e655){return db[_0x0f15('0x56')][_0x0f15('0x20')]({'where':{'ListId':_0x5e1ec9[_0x0f15('0x2d')]['ids'],'CampaignId':_0x5e1ec9[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](function(){return _0x42e655;});}})[_0x0f15('0x1f')](respondWithStatusCode(_0x4a291e,null))[_0x0f15('0x41')](handleError(_0x4a291e,null));};exports[_0x0f15('0x8b')]=function(_0x2d7b10,_0x4c5fce,_0x18d4a0){var _0x4cdf30={};var _0x31b1be={};var _0x32f15b;var _0x181426;return db['Campaign']['findOne']({'where':{'id':_0x2d7b10[_0x0f15('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c5fce,null))[_0x0f15('0x1f')](function(_0x9e1991){if(_0x9e1991){_0x32f15b=_0x9e1991;_0x31b1be[_0x0f15('0x30')]=_[_0x0f15('0x4f')](db['CmList'][_0x0f15('0x44')]);_0x31b1be['query']=_['keys'](_0x2d7b10[_0x0f15('0x2d')]);_0x31b1be[_0x0f15('0x2e')]=_[_0x0f15('0x2f')](_0x31b1be[_0x0f15('0x30')],_0x31b1be[_0x0f15('0x2d')]);_0x4cdf30['attributes']=_['intersection'](_0x31b1be['model'],qs['fields'](_0x2d7b10['query'][_0x0f15('0x31')]));_0x4cdf30['attributes']=_0x4cdf30[_0x0f15('0x32')]['length']?_0x4cdf30[_0x0f15('0x32')]:_0x31b1be[_0x0f15('0x30')];_0x4cdf30['order']=qs[_0x0f15('0x36')](_0x2d7b10['query'][_0x0f15('0x36')]);_0x4cdf30[_0x0f15('0x37')]=qs[_0x0f15('0x2e')](_['pick'](_0x2d7b10[_0x0f15('0x2d')],_0x31b1be[_0x0f15('0x2e')]));if(_0x2d7b10[_0x0f15('0x2d')]['filter']){_0x4cdf30[_0x0f15('0x37')]=_['merge'](_0x4cdf30['where'],{'$or':_[_0x0f15('0x29')](_0x4cdf30[_0x0f15('0x32')],function(_0x3e68a6){var _0x43024f={};_0x43024f[_0x3e68a6]={'$like':'%'+_0x2d7b10[_0x0f15('0x2d')][_0x0f15('0x39')]+'%'};return _0x43024f;})});}_0x4cdf30=_[_0x0f15('0x3a')]({},_0x4cdf30,_0x2d7b10[_0x0f15('0x3c')]);return _0x32f15b[_0x0f15('0x8b')](_0x4cdf30);}})['then'](function(_0xf4d29b){if(_0xf4d29b){_0x181426=_0xf4d29b[_0x0f15('0x33')];if(!_0x2d7b10[_0x0f15('0x2d')][_0x0f15('0x34')](_0x0f15('0x35'))){_0x4cdf30[_0x0f15('0x1b')]=qs[_0x0f15('0x1b')](_0x2d7b10[_0x0f15('0x2d')][_0x0f15('0x1b')]);_0x4cdf30[_0x0f15('0x19')]=qs[_0x0f15('0x19')](_0x2d7b10['query'][_0x0f15('0x19')]);}return _0x32f15b['getBlackLists'](_0x4cdf30);}})[_0x0f15('0x1f')](function(_0x5e4c0e){if(_0x5e4c0e){return _0x5e4c0e?{'count':_0x181426,'rows':_0x5e4c0e}:null;}})['then'](respondWithResult(_0x4c5fce,null))['catch'](handleError(_0x4c5fce,null));};exports[_0x0f15('0x8c')]=function(_0x76969a,_0x5488b7,_0x3d0fa2){var _0x1aefa1,_0x4ed614;var _0x52dc22=[];var _0x13af67=moment()[_0x0f15('0x8d')](_0x0f15('0x60'));return db[_0x0f15('0x2a')][_0x0f15('0x45')]({'where':{'id':_0x76969a['params']['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x5488b7,null))[_0x0f15('0x1f')](function(_0x3f051f){if(_0x3f051f){_0x4ed614=_0x3f051f;return _0x3f051f[_0x0f15('0x8c')](_0x76969a['body'][_0x0f15('0x61')],_[_0x0f15('0x50')](_0x76969a[_0x0f15('0x47')],[_0x0f15('0x61'),'id'])||{});}return null;})[_0x0f15('0x62')](function(_0x51e994){var _0x4f85ec;var _0x2ec92a;_0x1aefa1=_0x51e994||[];var _0x2996bd=[];if(_0x51e994){for(var _0x36d9c0=0x0;_0x36d9c0<_0x51e994['length'];_0x36d9c0+=0x1){var _0x23c9c6=_0x51e994[_0x36d9c0][_0x0f15('0x21')]({'plain':!![]});_0x4f85ec=squel[_0x0f15('0x64')]()[_0x0f15('0x65')](_0x0f15('0x8e'))[_0x0f15('0x67')]([_0x0f15('0x68'),_0x0f15('0x69'),_0x0f15('0x6a'),_0x0f15('0x57'),_0x0f15('0x51'),_0x0f15('0x52')],squel[_0x0f15('0x6b')]()['field'](_0x0f15('0x68'),'phone')[_0x0f15('0x6c')]('id',_0x0f15('0x69'))['field'](_0x23c9c6[_0x0f15('0x6f')][_0x0f15('0x70')](),'ListId')['field'](_0x76969a[_0x0f15('0x43')]['id'][_0x0f15('0x70')](),_0x0f15('0x57'))[_0x0f15('0x6c')](_0x0f15('0x6d'),'createdAt')[_0x0f15('0x6c')](_0x0f15('0x6d'),_0x0f15('0x52'))['from']('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x0f15('0x37')]('ListId\x20=\x20?',_0x23c9c6[_0x0f15('0x6f')][_0x0f15('0x70')]())[_0x0f15('0x37')](_0x0f15('0x7b')))['toString']();_0x2996bd[_0x0f15('0x87')](db[_0x0f15('0x88')][_0x0f15('0x2d')](_0x4f85ec));}return BPromise[_0x0f15('0x89')](_0x2996bd);}})[_0x0f15('0x1f')](function(){return _0x1aefa1;})[_0x0f15('0x1f')](respondWithResult(_0x5488b7,null))[_0x0f15('0x41')](handleError(_0x5488b7,null));};exports[_0x0f15('0x8f')]=function(_0x625c73,_0x5f0f4b,_0x589af0){return db[_0x0f15('0x2a')]['find']({'where':{'id':_0x625c73[_0x0f15('0x43')]['id']}})[_0x0f15('0x1f')](handleEntityNotFound(_0x5f0f4b,null))[_0x0f15('0x1f')](function(_0x28662c){if(_0x28662c){return _0x28662c[_0x0f15('0x8f')](_0x625c73['query'][_0x0f15('0x61')]);}})[_0x0f15('0x1f')](function(_0xd86a3){if(_0xd86a3){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x625c73[_0x0f15('0x2d')][_0x0f15('0x61')],'CampaignId':_0x625c73['params']['id']}})[_0x0f15('0x1f')](function(){return _0xd86a3;});}})['then'](respondWithStatusCode(_0x5f0f4b,null))[_0x0f15('0x41')](handleError(_0x5f0f4b,null));}; \ No newline at end of file +var _0x76d2=['Campaign','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','create','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','update','getHoppers','CmHopper','CampaignId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','ListId','select','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','cm_hopper','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','destroy','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','then','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map'];(function(_0x2d58ca,_0x436139){var _0x12bf32=function(_0x4c0f85){while(--_0x4c0f85){_0x2d58ca['push'](_0x2d58ca['shift']());}};_0x12bf32(++_0x436139);}(_0x76d2,0xf8));var _0x276d=function(_0x1a9651,_0x46e9b7){_0x1a9651=_0x1a9651-0x0;var _0x905474=_0x76d2[_0x1a9651];return _0x905474;};'use strict';var emlformat=require(_0x276d('0x0'));var rimraf=require(_0x276d('0x1'));var zipdir=require(_0x276d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x276d('0x3'));var moment=require(_0x276d('0x4'));var BPromise=require(_0x276d('0x5'));var Mustache=require(_0x276d('0x6'));var util=require('util');var path=require('path');var sox=require(_0x276d('0x7'));var csv=require(_0x276d('0x8'));var ejs=require(_0x276d('0x9'));var fs=require('fs');var fs_extra=require(_0x276d('0xa'));var _=require(_0x276d('0xb'));var squel=require(_0x276d('0xc'));var crypto=require(_0x276d('0xd'));var jsforce=require(_0x276d('0xe'));var deskjs=require(_0x276d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x276d('0x10'));var Redis=require(_0x276d('0x11'));var authService=require(_0x276d('0x12'));var qs=require(_0x276d('0x13'));var as=require(_0x276d('0x14'));var hardwareService=require(_0x276d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x276d('0x16'));var config=require(_0x276d('0x17'));var licenseUtil=require(_0x276d('0x18'));var db=require(_0x276d('0x19'))['db'];function respondWithStatusCode(_0x2e107c,_0x2e4374){_0x2e4374=_0x2e4374||0xcc;return function(_0x4b9f5f){if(_0x4b9f5f){return _0x2e107c['sendStatus'](_0x2e4374);}return _0x2e107c[_0x276d('0x1a')](_0x2e4374)[_0x276d('0x1b')]();};}function respondWithResult(_0x3bdd13,_0x377540){_0x377540=_0x377540||0xc8;return function(_0x3166a2){if(_0x3166a2){return _0x3bdd13[_0x276d('0x1a')](_0x377540)[_0x276d('0x1c')](_0x3166a2);}};}function respondWithFilteredResult(_0x2c309f,_0x5b23b7){return function(_0x2165c6){if(_0x2165c6){var _0x43efeb=typeof _0x5b23b7['offset']==='undefined'&&typeof _0x5b23b7[_0x276d('0x1d')]===_0x276d('0x1e');var _0x4d9859=_0x2165c6[_0x276d('0x1f')];var _0x5d96cb=_0x43efeb?0x0:_0x5b23b7['offset'];var _0xb75b36=_0x43efeb?_0x2165c6['count']:_0x5b23b7[_0x276d('0x20')]+_0x5b23b7[_0x276d('0x1d')];var _0x42d335;if(_0xb75b36>=_0x4d9859){_0xb75b36=_0x4d9859;_0x42d335=0xc8;}else{_0x42d335=0xce;}_0x2c309f[_0x276d('0x1a')](_0x42d335);return _0x2c309f['set'](_0x276d('0x21'),_0x5d96cb+'-'+_0xb75b36+'/'+_0x4d9859)[_0x276d('0x1c')](_0x2165c6);}return null;};}function patchUpdates(_0x54565b){return function(_0x5e8fee){try{jsonpatch[_0x276d('0x22')](_0x5e8fee,_0x54565b,!![]);}catch(_0xead902){return BPromise['reject'](_0xead902);}return _0x5e8fee[_0x276d('0x23')]();};}function saveUpdates(_0x1f3545,_0x57d4b7){return function(_0x284160){if(_0x284160){return _0x284160['update'](_0x1f3545)[_0x276d('0x24')](function(_0x152195){return _0x152195;});}return null;};}function removeEntity(_0x5f0561,_0x476671){return function(_0x3edb3b){if(_0x3edb3b){return _0x3edb3b['destroy']()['then'](function(){var _0x991d5d=_0x3edb3b[_0x276d('0x25')]({'plain':!![]});var _0x121e75=_0x276d('0x26');return db[_0x276d('0x27')]['destroy']({'where':{'type':_0x121e75,'resourceId':_0x991d5d['id']}})[_0x276d('0x24')](function(){return _0x3edb3b;});})['then'](function(){_0x5f0561[_0x276d('0x1a')](0xcc)[_0x276d('0x1b')]();});}};}function handleEntityNotFound(_0x54c37c,_0xaa77c7){return function(_0x596248){if(!_0x596248){_0x54c37c['sendStatus'](0x194);}return _0x596248;};}function handleError(_0x5dec41,_0x235509){_0x235509=_0x235509||0x1f4;return function(_0x3226f5){logger[_0x276d('0x28')](_0x3226f5[_0x276d('0x29')]);if(_0x3226f5['name']){delete _0x3226f5[_0x276d('0x2a')];}_0x5dec41[_0x276d('0x1a')](_0x235509)[_0x276d('0x2b')](_0x3226f5);};}exports[_0x276d('0x2c')]=function(_0x29755c,_0x251135){var _0x1102f7={},_0x4b9966={},_0x168406={'count':0x0,'rows':[]};var _0x3fb13b=_[_0x276d('0x2d')](db[_0x276d('0x2e')][_0x276d('0x2f')],function(_0x335372){return{'name':_0x335372[_0x276d('0x30')],'type':_0x335372['type'][_0x276d('0x31')]};});_0x4b9966[_0x276d('0x32')]=_[_0x276d('0x2d')](_0x3fb13b,_0x276d('0x2a'));_0x4b9966['query']=_[_0x276d('0x33')](_0x29755c['query']);_0x4b9966[_0x276d('0x34')]=_[_0x276d('0x35')](_0x4b9966[_0x276d('0x32')],_0x4b9966[_0x276d('0x36')]);_0x1102f7[_0x276d('0x37')]=_[_0x276d('0x35')](_0x4b9966[_0x276d('0x32')],qs[_0x276d('0x38')](_0x29755c['query']['fields']));_0x1102f7[_0x276d('0x37')]=_0x1102f7['attributes'][_0x276d('0x39')]?_0x1102f7[_0x276d('0x37')]:_0x4b9966[_0x276d('0x32')];if(!_0x29755c[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x1102f7[_0x276d('0x1d')]=qs['limit'](_0x29755c['query'][_0x276d('0x1d')]);_0x1102f7[_0x276d('0x20')]=qs['offset'](_0x29755c['query'][_0x276d('0x20')]);}_0x1102f7[_0x276d('0x3c')]=qs['sort'](_0x29755c[_0x276d('0x36')][_0x276d('0x3d')]);_0x1102f7[_0x276d('0x3e')]=qs[_0x276d('0x34')](_[_0x276d('0x3f')](_0x29755c[_0x276d('0x36')],_0x4b9966['filters']),_0x3fb13b);if(_0x29755c[_0x276d('0x36')][_0x276d('0x40')]){_0x1102f7['where']=_['merge'](_0x1102f7['where'],{'$or':_[_0x276d('0x2d')](_0x3fb13b,function(_0x4b9c99){if(_0x4b9c99['type']!=='VIRTUAL'){var _0x1390fa={};_0x1390fa[_0x4b9c99[_0x276d('0x2a')]]={'$like':'%'+_0x29755c[_0x276d('0x36')][_0x276d('0x40')]+'%'};return _0x1390fa;}})});}_0x1102f7=_[_0x276d('0x41')]({},_0x1102f7,_0x29755c[_0x276d('0x42')]);var _0xb5c0c7={'where':_0x1102f7[_0x276d('0x3e')]};return db[_0x276d('0x2e')][_0x276d('0x1f')](_0xb5c0c7)[_0x276d('0x24')](function(_0x117f0f){_0x168406[_0x276d('0x1f')]=_0x117f0f;if(_0x29755c[_0x276d('0x36')]['includeAll']){_0x1102f7[_0x276d('0x43')]=[{'all':!![]}];}return db[_0x276d('0x2e')][_0x276d('0x44')](_0x1102f7);})[_0x276d('0x24')](function(_0x8ef582){_0x168406[_0x276d('0x45')]=_0x8ef582;return _0x168406;})[_0x276d('0x24')](respondWithFilteredResult(_0x251135,_0x1102f7))[_0x276d('0x46')](handleError(_0x251135,null));};exports[_0x276d('0x47')]=function(_0x5d780e,_0x32513e){var _0x3173a4={'raw':![],'where':{'id':_0x5d780e[_0x276d('0x48')]['id']}},_0x318402={};_0x318402['model']=_[_0x276d('0x33')](db[_0x276d('0x2e')][_0x276d('0x2f')]);_0x318402[_0x276d('0x36')]=_[_0x276d('0x33')](_0x5d780e[_0x276d('0x36')]);_0x318402['filters']=_[_0x276d('0x35')](_0x318402['model'],_0x318402[_0x276d('0x36')]);_0x3173a4[_0x276d('0x37')]=_['intersection'](_0x318402[_0x276d('0x32')],qs[_0x276d('0x38')](_0x5d780e['query'][_0x276d('0x38')]));_0x3173a4[_0x276d('0x37')]=_0x3173a4['attributes'][_0x276d('0x39')]?_0x3173a4[_0x276d('0x37')]:_0x318402[_0x276d('0x32')];if(_0x5d780e[_0x276d('0x36')][_0x276d('0x49')]){_0x3173a4['include']=[{'all':!![]}];}_0x3173a4=_[_0x276d('0x41')]({},_0x3173a4,_0x5d780e[_0x276d('0x42')]);return db[_0x276d('0x2e')]['find'](_0x3173a4)[_0x276d('0x24')](handleEntityNotFound(_0x32513e,null))[_0x276d('0x24')](respondWithResult(_0x32513e,null))[_0x276d('0x46')](handleError(_0x32513e,null));};exports['create']=function(_0x28659a,_0x1642d7){return db[_0x276d('0x2e')][_0x276d('0x4a')](_0x28659a['body'],{})['then'](function(_0x44f825){var _0x27ed2a=_0x28659a[_0x276d('0x4b')][_0x276d('0x25')]({'plain':!![]});if(!_0x27ed2a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x27ed2a[_0x276d('0x4c')]==='user'){var _0x5d07e1=_0x44f825['get']({'plain':!![]});var _0x525c45=_0x276d('0x26');return db[_0x276d('0x4d')][_0x276d('0x4e')]({'where':{'name':_0x525c45,'userProfileId':_0x27ed2a['userProfileId']},'raw':!![]})['then'](function(_0x50b77e){if(_0x50b77e&&_0x50b77e[_0x276d('0x4f')]===0x0){return db[_0x276d('0x27')][_0x276d('0x4a')]({'name':_0x5d07e1[_0x276d('0x2a')],'resourceId':_0x5d07e1['id'],'type':_0x50b77e['name'],'sectionId':_0x50b77e['id']},{})['then'](function(){return _0x44f825;});}else{return _0x44f825;}})['catch'](function(_0x21d079){logger[_0x276d('0x28')](_0x276d('0x50'),_0x21d079);throw _0x21d079;});}return _0x44f825;})[_0x276d('0x24')](respondWithResult(_0x1642d7,0xc9))['catch'](handleError(_0x1642d7,null));};exports[_0x276d('0x51')]=function(_0x2be3ef,_0x3298d1){var _0x3702e5={'where':{'id':_0x2be3ef[_0x276d('0x48')]['id']}},_0x2d2373={};_0x2d2373[_0x276d('0x32')]=_[_0x276d('0x33')](db['Campaign']['rawAttributes']);_0x3702e5[_0x276d('0x37')]=_['intersection'](_0x2d2373[_0x276d('0x32')],qs[_0x276d('0x38')](_0x2be3ef[_0x276d('0x36')][_0x276d('0x38')]));_0x3702e5[_0x276d('0x37')]=_0x3702e5['attributes'][_0x276d('0x39')]?_0x3702e5[_0x276d('0x37')]:_0x2d2373[_0x276d('0x32')];if(_0x2be3ef[_0x276d('0x36')][_0x276d('0x49')]){_0x3702e5['include']=[{'all':!![]}];}_0x3702e5=_[_0x276d('0x41')]({},_0x3702e5,_0x2be3ef[_0x276d('0x42')]);return db['Campaign'][_0x276d('0x4e')](_0x3702e5)[_0x276d('0x24')](handleEntityNotFound(_0x3298d1,null))['then'](function(_0x347f21){if(_0x347f21){var _0x22cf48=_0x347f21[_0x276d('0x25')]({'plain':!![]});_0x22cf48=qs[_0x276d('0x52')](_0x22cf48,['id',_0x276d('0x53'),_0x276d('0x54')]);_0x2be3ef[_0x276d('0x55')]=_[_0x276d('0x52')](_0x2be3ef[_0x276d('0x55')],['id',_0x276d('0x53'),_0x276d('0x54')]);return db[_0x276d('0x2e')][_0x276d('0x4a')](_['merge'](_0x22cf48,_0x2be3ef[_0x276d('0x55')]),{'include':_0x2be3ef[_0x276d('0x36')][_0x276d('0x49')]?[{'all':!![]}]:undefined})[_0x276d('0x24')](function(_0x4876f4){var _0x51d8f2=_0x2be3ef['user'][_0x276d('0x25')]({'plain':!![]});if(!_0x51d8f2)throw new Error(_0x276d('0x56'));if(_0x51d8f2[_0x276d('0x4c')]===_0x276d('0x4b')){var _0x48001f=_0x4876f4[_0x276d('0x25')]({'plain':!![]});var _0x3fd2f5=_0x276d('0x26');return db[_0x276d('0x4d')][_0x276d('0x4e')]({'where':{'name':_0x3fd2f5,'userProfileId':_0x51d8f2[_0x276d('0x57')]},'raw':!![]})[_0x276d('0x24')](function(_0x357a8c){if(_0x357a8c&&_0x357a8c[_0x276d('0x4f')]===0x0){return db[_0x276d('0x27')][_0x276d('0x4a')]({'name':_0x48001f[_0x276d('0x2a')],'resourceId':_0x48001f['id'],'type':_0x357a8c[_0x276d('0x2a')],'sectionId':_0x357a8c['id']},{})[_0x276d('0x24')](function(){return _0x4876f4;});}else{return _0x4876f4;}})['catch'](function(_0x3653ab){logger[_0x276d('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3653ab);throw _0x3653ab;});}return _0x4876f4;});}})[_0x276d('0x24')](respondWithResult(_0x3298d1,0xc9))[_0x276d('0x46')](handleError(_0x3298d1,null));};exports[_0x276d('0x58')]=function(_0x5db132,_0xc5446b){if(_0x5db132[_0x276d('0x55')]['id']){delete _0x5db132[_0x276d('0x55')]['id'];}return db[_0x276d('0x2e')][_0x276d('0x4e')]({'where':{'id':_0x5db132[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0xc5446b,null))[_0x276d('0x24')](saveUpdates(_0x5db132['body'],null))[_0x276d('0x24')](respondWithResult(_0xc5446b,null))['catch'](handleError(_0xc5446b,null));};exports['destroy']=function(_0x1dcdce,_0x2dd008){return db[_0x276d('0x2e')][_0x276d('0x4e')]({'where':{'id':_0x1dcdce['params']['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x2dd008,null))[_0x276d('0x24')](removeEntity(_0x2dd008,null))[_0x276d('0x46')](handleError(_0x2dd008,null));};exports[_0x276d('0x59')]=function(_0x3e314a,_0x62fa2a,_0x156fac){var _0x2763bc={'raw':!![],'where':{}};var _0x3d2220={};var _0x196257={'count':0x0,'rows':[]};return db[_0x276d('0x2e')]['findOne']({'where':{'id':_0x3e314a[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x62fa2a,null))[_0x276d('0x24')](function(_0x34d77c){if(_0x34d77c){_0x3d2220[_0x276d('0x32')]=_[_0x276d('0x33')](db[_0x276d('0x5a')][_0x276d('0x2f')]);_0x3d2220[_0x276d('0x36')]=_['keys'](_0x3e314a[_0x276d('0x36')]);_0x3d2220[_0x276d('0x34')]=_[_0x276d('0x35')](_0x3d2220[_0x276d('0x32')],_0x3d2220[_0x276d('0x36')]);_0x2763bc[_0x276d('0x37')]=_['intersection'](_0x3d2220[_0x276d('0x32')],qs[_0x276d('0x38')](_0x3e314a[_0x276d('0x36')][_0x276d('0x38')]));_0x2763bc[_0x276d('0x37')]=_0x2763bc['attributes'][_0x276d('0x39')]?_0x2763bc['attributes']:_0x3d2220['model'];if(!_0x3e314a[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x2763bc[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x3e314a[_0x276d('0x36')][_0x276d('0x1d')]);_0x2763bc[_0x276d('0x20')]=qs[_0x276d('0x20')](_0x3e314a[_0x276d('0x36')][_0x276d('0x20')]);}_0x2763bc[_0x276d('0x3c')]=qs[_0x276d('0x3d')](_0x3e314a['query'][_0x276d('0x3d')]);_0x2763bc[_0x276d('0x3e')]=qs[_0x276d('0x34')](_[_0x276d('0x3f')](_0x3e314a[_0x276d('0x36')],_0x3d2220[_0x276d('0x34')]));_0x2763bc[_0x276d('0x3e')][_0x276d('0x5b')]=_0x34d77c['id'];if(_0x3e314a['query']['filter']){_0x2763bc[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x2763bc[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x2763bc[_0x276d('0x37')],function(_0x49ca7a){var _0x5265e8={};_0x5265e8[_0x49ca7a]={'$like':'%'+_0x3e314a[_0x276d('0x36')]['filter']+'%'};return _0x5265e8;})});}_0x2763bc=_[_0x276d('0x41')]({},_0x2763bc,_0x3e314a[_0x276d('0x42')]);return db[_0x276d('0x5a')]['count']({'where':_0x2763bc[_0x276d('0x3e')]})['then'](function(_0x2bfb5d){_0x196257['count']=_0x2bfb5d;if(_0x3e314a['query']['includeAll']){_0x2763bc[_0x276d('0x43')]=[{'all':!![]}];}return db[_0x276d('0x5a')][_0x276d('0x44')](_0x2763bc);})[_0x276d('0x24')](function(_0x1a1957){_0x196257[_0x276d('0x45')]=_0x1a1957;return _0x196257;});}})[_0x276d('0x24')](respondWithFilteredResult(_0x62fa2a,_0x2763bc))[_0x276d('0x46')](handleError(_0x62fa2a,null));};exports[_0x276d('0x5c')]=function(_0x5a1524,_0x35252d,_0x5c839b){var _0x2ae16a={'raw':!![],'where':{}};var _0xc8ebb6={};var _0x326752={'count':0x0,'rows':[]};return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x5a1524['params']['id']}})['then'](handleEntityNotFound(_0x35252d,null))[_0x276d('0x24')](function(_0x56e6d8){if(_0x56e6d8){_0xc8ebb6[_0x276d('0x32')]=_[_0x276d('0x33')](db[_0x276d('0x5e')][_0x276d('0x2f')]);_0xc8ebb6['query']=_['keys'](_0x5a1524[_0x276d('0x36')]);_0xc8ebb6['filters']=_[_0x276d('0x35')](_0xc8ebb6[_0x276d('0x32')],_0xc8ebb6['query']);_0x2ae16a[_0x276d('0x37')]=_['intersection'](_0xc8ebb6['model'],qs[_0x276d('0x38')](_0x5a1524['query'][_0x276d('0x38')]));_0x2ae16a[_0x276d('0x37')]=_0x2ae16a['attributes'][_0x276d('0x39')]?_0x2ae16a[_0x276d('0x37')]:_0xc8ebb6['model'];if(!_0x5a1524[_0x276d('0x36')]['hasOwnProperty'](_0x276d('0x3b'))){_0x2ae16a[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x5a1524[_0x276d('0x36')][_0x276d('0x1d')]);_0x2ae16a['offset']=qs['offset'](_0x5a1524[_0x276d('0x36')][_0x276d('0x20')]);}_0x2ae16a[_0x276d('0x3c')]=qs[_0x276d('0x3d')](_0x5a1524[_0x276d('0x36')][_0x276d('0x3d')]);_0x2ae16a[_0x276d('0x3e')]=qs[_0x276d('0x34')](_[_0x276d('0x3f')](_0x5a1524[_0x276d('0x36')],_0xc8ebb6[_0x276d('0x34')]));_0x2ae16a[_0x276d('0x3e')]['CampaignId']=_0x56e6d8['id'];if(_0x5a1524['query'][_0x276d('0x40')]){_0x2ae16a[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x2ae16a['where'],{'$or':_['map'](_0x2ae16a[_0x276d('0x37')],function(_0x3ae14d){var _0x577857={};_0x577857[_0x3ae14d]={'$like':'%'+_0x5a1524[_0x276d('0x36')]['filter']+'%'};return _0x577857;})});}_0x2ae16a=_[_0x276d('0x41')]({},_0x2ae16a,_0x5a1524[_0x276d('0x42')]);return db['CmHopperHistory'][_0x276d('0x1f')]({'where':_0x2ae16a[_0x276d('0x3e')]})[_0x276d('0x24')](function(_0x2a4acf){_0x326752[_0x276d('0x1f')]=_0x2a4acf;if(_0x5a1524[_0x276d('0x36')][_0x276d('0x49')]){_0x2ae16a[_0x276d('0x43')]=[{'all':!![]}];}return db[_0x276d('0x5e')][_0x276d('0x44')](_0x2ae16a);})[_0x276d('0x24')](function(_0x43ec7f){_0x326752[_0x276d('0x45')]=_0x43ec7f;return _0x326752;});}})[_0x276d('0x24')](respondWithFilteredResult(_0x35252d,_0x2ae16a))[_0x276d('0x46')](handleError(_0x35252d,null));};exports[_0x276d('0x5f')]=function(_0x4b611d,_0xd47cb2,_0x582207){var _0x337a31={'raw':!![],'where':{}};var _0xd4729d={};var _0x32e162={'count':0x0,'rows':[]};return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x4b611d['params']['id']}})['then'](handleEntityNotFound(_0xd47cb2,null))['then'](function(_0x320c50){if(_0x320c50){_0xd4729d['model']=_[_0x276d('0x33')](db[_0x276d('0x60')][_0x276d('0x2f')]);_0xd4729d[_0x276d('0x36')]=_[_0x276d('0x33')](_0x4b611d[_0x276d('0x36')]);_0xd4729d['filters']=_[_0x276d('0x35')](_0xd4729d[_0x276d('0x32')],_0xd4729d[_0x276d('0x36')]);_0x337a31[_0x276d('0x37')]=_[_0x276d('0x35')](_0xd4729d['model'],qs[_0x276d('0x38')](_0x4b611d[_0x276d('0x36')]['fields']));_0x337a31[_0x276d('0x37')]=_0x337a31[_0x276d('0x37')][_0x276d('0x39')]?_0x337a31[_0x276d('0x37')]:_0xd4729d[_0x276d('0x32')];if(!_0x4b611d[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x337a31[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x4b611d['query']['limit']);_0x337a31[_0x276d('0x20')]=qs[_0x276d('0x20')](_0x4b611d[_0x276d('0x36')]['offset']);}_0x337a31['order']=qs[_0x276d('0x3d')](_0x4b611d[_0x276d('0x36')][_0x276d('0x3d')]);_0x337a31[_0x276d('0x3e')]=qs[_0x276d('0x34')](_['pick'](_0x4b611d['query'],_0xd4729d['filters']));_0x337a31['where'][_0x276d('0x5b')]=_0x320c50['id'];if(_0x4b611d[_0x276d('0x36')]['filter']){_0x337a31[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x337a31[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x337a31[_0x276d('0x37')],function(_0x13a594){var _0x2d48f7={};_0x2d48f7[_0x13a594]={'$like':'%'+_0x4b611d['query'][_0x276d('0x40')]+'%'};return _0x2d48f7;})});}_0x337a31=_[_0x276d('0x41')]({},_0x337a31,_0x4b611d['options']);return db[_0x276d('0x60')][_0x276d('0x1f')]({'where':_0x337a31[_0x276d('0x3e')]})[_0x276d('0x24')](function(_0x2926de){_0x32e162['count']=_0x2926de;if(_0x4b611d[_0x276d('0x36')]['includeAll']){_0x337a31[_0x276d('0x43')]=[{'all':!![]}];}return db[_0x276d('0x60')][_0x276d('0x44')](_0x337a31);})['then'](function(_0x56f273){_0x32e162[_0x276d('0x45')]=_0x56f273;return _0x32e162;});}})[_0x276d('0x24')](respondWithFilteredResult(_0xd47cb2,_0x337a31))[_0x276d('0x46')](handleError(_0xd47cb2,null));};exports[_0x276d('0x61')]=function(_0x344608,_0x585eba,_0x5d261b){var _0x58ecdc={'raw':!![],'where':{}};var _0x2ac194={};var _0x5823ff={'count':0x0,'rows':[]};return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x344608['params']['id']}})['then'](handleEntityNotFound(_0x585eba,null))['then'](function(_0x11c1a5){if(_0x11c1a5){_0x2ac194[_0x276d('0x32')]=_['keys'](db[_0x276d('0x62')][_0x276d('0x2f')]);_0x2ac194[_0x276d('0x36')]=_[_0x276d('0x33')](_0x344608[_0x276d('0x36')]);_0x2ac194[_0x276d('0x34')]=_[_0x276d('0x35')](_0x2ac194[_0x276d('0x32')],_0x2ac194[_0x276d('0x36')]);_0x58ecdc[_0x276d('0x37')]=_[_0x276d('0x35')](_0x2ac194[_0x276d('0x32')],qs[_0x276d('0x38')](_0x344608[_0x276d('0x36')]['fields']));_0x58ecdc[_0x276d('0x37')]=_0x58ecdc[_0x276d('0x37')][_0x276d('0x39')]?_0x58ecdc[_0x276d('0x37')]:_0x2ac194[_0x276d('0x32')];if(!_0x344608[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x58ecdc['limit']=qs['limit'](_0x344608[_0x276d('0x36')][_0x276d('0x1d')]);_0x58ecdc[_0x276d('0x20')]=qs['offset'](_0x344608[_0x276d('0x36')]['offset']);}_0x58ecdc[_0x276d('0x3c')]=qs[_0x276d('0x3d')](_0x344608[_0x276d('0x36')]['sort']);_0x58ecdc[_0x276d('0x3e')]=qs[_0x276d('0x34')](_[_0x276d('0x3f')](_0x344608[_0x276d('0x36')],_0x2ac194[_0x276d('0x34')]));_0x58ecdc[_0x276d('0x3e')][_0x276d('0x5b')]=_0x11c1a5['id'];if(_0x344608['query'][_0x276d('0x40')]){_0x58ecdc[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x58ecdc[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x58ecdc[_0x276d('0x37')],function(_0x3e8a71){var _0x1e44df={};_0x1e44df[_0x3e8a71]={'$like':'%'+_0x344608[_0x276d('0x36')][_0x276d('0x40')]+'%'};return _0x1e44df;})});}_0x58ecdc=_[_0x276d('0x41')]({},_0x58ecdc,_0x344608[_0x276d('0x42')]);return db[_0x276d('0x62')]['count']({'where':_0x58ecdc['where']})[_0x276d('0x24')](function(_0x463c7a){_0x5823ff['count']=_0x463c7a;if(_0x344608['query'][_0x276d('0x49')]){_0x58ecdc['include']=[{'all':!![]}];}return db[_0x276d('0x62')][_0x276d('0x44')](_0x58ecdc);})[_0x276d('0x24')](function(_0x5cd43a){_0x5823ff[_0x276d('0x45')]=_0x5cd43a;return _0x5823ff;});}})[_0x276d('0x24')](respondWithFilteredResult(_0x585eba,_0x58ecdc))[_0x276d('0x46')](handleError(_0x585eba,null));};exports[_0x276d('0x63')]=function(_0x25d497,_0x2b630b,_0x3ed51e){var _0x46b542={};var _0xd70176={};var _0x42437a;var _0x472ab9;return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x25d497[_0x276d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b630b,null))[_0x276d('0x24')](function(_0x1466fc){if(_0x1466fc){_0x42437a=_0x1466fc;_0xd70176[_0x276d('0x32')]=_[_0x276d('0x33')](db[_0x276d('0x64')][_0x276d('0x2f')]);_0xd70176[_0x276d('0x36')]=_[_0x276d('0x33')](_0x25d497[_0x276d('0x36')]);_0xd70176[_0x276d('0x34')]=_['intersection'](_0xd70176['model'],_0xd70176[_0x276d('0x36')]);_0x46b542['attributes']=_[_0x276d('0x35')](_0xd70176[_0x276d('0x32')],qs['fields'](_0x25d497[_0x276d('0x36')]['fields']));_0x46b542[_0x276d('0x37')]=_0x46b542[_0x276d('0x37')][_0x276d('0x39')]?_0x46b542['attributes']:_0xd70176[_0x276d('0x32')];_0x46b542[_0x276d('0x3c')]=qs['sort'](_0x25d497['query']['sort']);_0x46b542[_0x276d('0x3e')]=qs['filters'](_[_0x276d('0x3f')](_0x25d497['query'],_0xd70176['filters']));if(_0x25d497['query']['filter']){_0x46b542[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x46b542[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x46b542[_0x276d('0x37')],function(_0x2a112a){var _0xa76923={};_0xa76923[_0x2a112a]={'$like':'%'+_0x25d497[_0x276d('0x36')]['filter']+'%'};return _0xa76923;})});}_0x46b542=_['merge']({},_0x46b542,_0x25d497[_0x276d('0x42')]);return _0x42437a[_0x276d('0x63')](_0x46b542);}})['then'](function(_0x194abc){if(_0x194abc){_0x472ab9=_0x194abc[_0x276d('0x39')];if(!_0x25d497[_0x276d('0x36')][_0x276d('0x3a')](_0x276d('0x3b'))){_0x46b542['limit']=qs[_0x276d('0x1d')](_0x25d497['query'][_0x276d('0x1d')]);_0x46b542[_0x276d('0x20')]=qs[_0x276d('0x20')](_0x25d497[_0x276d('0x36')][_0x276d('0x20')]);}return _0x42437a[_0x276d('0x63')](_0x46b542);}})[_0x276d('0x24')](function(_0x48cdcf){if(_0x48cdcf){return _0x48cdcf?{'count':_0x472ab9,'rows':_0x48cdcf}:null;}})[_0x276d('0x24')](respondWithResult(_0x2b630b,null))['catch'](handleError(_0x2b630b,null));};exports[_0x276d('0x65')]=function(_0x2e74fe,_0x2f5c86,_0x182fc0){var _0x3d3935,_0x1c49a9;var _0x5157cd=[];var _0x18326f=moment()[_0x276d('0x66')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x276d('0x2e')]['find']({'where':{'id':_0x2e74fe[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x2f5c86,null))['then'](function(_0x497088){if(_0x497088){_0x1c49a9=_0x497088;return _0x497088['addLists'](_0x2e74fe[_0x276d('0x55')][_0x276d('0x67')],_['omit'](_0x2e74fe[_0x276d('0x55')],[_0x276d('0x67'),'id'])||{});}return null;})['spread'](function(_0x3f8add){var _0x1eaed3;var _0xfdbcc9;_0x3d3935=_0x3f8add||[];var _0x47ee70=[];if(_0x3f8add){for(var _0x5c3f62=0x0;_0x5c3f62<_0x3f8add['length'];_0x5c3f62+=0x1){var _0x2c4bd3=_0x3f8add[_0x5c3f62][_0x276d('0x25')]({'plain':!![]});_0x1c49a9[_0x276d('0x68')]=_0x2e74fe[_0x276d('0x55')][_0x276d('0x68')]?_0x2e74fe[_0x276d('0x55')][_0x276d('0x68')]:_0x1c49a9[_0x276d('0x68')];switch(_0x1c49a9[_0x276d('0x68')]){case _0x276d('0x69'):_0x1eaed3=squel[_0x276d('0x6a')]()[_0x276d('0x6b')]('cm_hopper')[_0x276d('0x6c')]([_0x276d('0x6d'),'scheduledAt',_0x276d('0x6e'),_0x276d('0x6f'),'CampaignId',_0x276d('0x53'),_0x276d('0x54')],squel[_0x276d('0x70')]()[_0x276d('0x71')](_0x276d('0x6d'),_0x276d('0x6d'))[_0x276d('0x71')](_0x276d('0x72'),'scheduledAt')[_0x276d('0x71')]('id',_0x276d('0x6e'))['field'](_0x2c4bd3[_0x276d('0x73')]['toString'](),_0x276d('0x6f'))[_0x276d('0x71')](_0x2e74fe[_0x276d('0x48')]['id'][_0x276d('0x74')](),'CampaignId')[_0x276d('0x71')]('\x27'+_0x18326f+'\x27',_0x276d('0x53'))['field']('\x27'+_0x18326f+'\x27',_0x276d('0x54'))['from'](_0x276d('0x75'))[_0x276d('0x3e')](_0x276d('0x76'))[_0x276d('0x3e')](_0x276d('0x77'),_0x2c4bd3[_0x276d('0x73')][_0x276d('0x74')]())[_0x276d('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x276d('0x78'),squel['select']()[_0x276d('0x71')](_0x276d('0x79'))[_0x276d('0x7a')](_0x276d('0x7b'))[_0x276d('0x3e')](_0x276d('0x7c'),_0x2e74fe['params']['id'][_0x276d('0x74')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x276d('0x70')]()['field'](_0x276d('0x7d'))['from']('cm_hopper')[_0x276d('0x3e')](_0x276d('0x7c'),_0x2e74fe['params']['id'][_0x276d('0x74')]())))[_0x276d('0x74')]();break;case _0x276d('0x7e'):_0x1eaed3=squel[_0x276d('0x6a')]()[_0x276d('0x6b')]('cm_hopper')['fromQuery']([_0x276d('0x6d'),_0x276d('0x7f'),_0x276d('0x6e'),_0x276d('0x6f'),'CampaignId',_0x276d('0x53'),_0x276d('0x54')],squel['select']()['field'](_0x276d('0x6d'),'phone')[_0x276d('0x71')](_0x276d('0x72'),_0x276d('0x7f'))[_0x276d('0x71')]('id',_0x276d('0x6e'))[_0x276d('0x71')](_0x2c4bd3['CmListId'][_0x276d('0x74')](),_0x276d('0x6f'))[_0x276d('0x71')](_0x2e74fe['params']['id'][_0x276d('0x74')](),'CampaignId')['field']('\x27'+_0x18326f+'\x27',_0x276d('0x53'))['field']('\x27'+_0x18326f+'\x27',_0x276d('0x54'))[_0x276d('0x7a')](_0x276d('0x75'))[_0x276d('0x3e')]('deletedAt\x20IS\x20NULL')['where'](_0x276d('0x77'),_0x2c4bd3[_0x276d('0x73')]['toString']())[_0x276d('0x3e')]('phone\x20IS\x20NOT\x20NULL')['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x276d('0x70')]()['field'](_0x276d('0x7d'))[_0x276d('0x7a')]('cm_hopper')[_0x276d('0x3e')](_0x276d('0x7c'),_0x2e74fe[_0x276d('0x48')]['id'][_0x276d('0x74')]())))[_0x276d('0x74')]();break;default:_0x1eaed3=squel[_0x276d('0x6a')]()['into'](_0x276d('0x80'))[_0x276d('0x6c')](['phone','scheduledAt',_0x276d('0x6e'),_0x276d('0x6f'),_0x276d('0x5b'),_0x276d('0x53'),_0x276d('0x54')],squel[_0x276d('0x70')]()[_0x276d('0x71')]('phone',_0x276d('0x6d'))[_0x276d('0x71')](_0x276d('0x72'),_0x276d('0x7f'))['field']('id','ContactId')[_0x276d('0x71')](_0x2c4bd3['CmListId'][_0x276d('0x74')](),_0x276d('0x6f'))[_0x276d('0x71')](_0x2e74fe[_0x276d('0x48')]['id'][_0x276d('0x74')](),_0x276d('0x5b'))[_0x276d('0x71')]('\x27'+_0x18326f+'\x27',_0x276d('0x53'))[_0x276d('0x71')]('\x27'+_0x18326f+'\x27','updatedAt')[_0x276d('0x7a')](_0x276d('0x75'))[_0x276d('0x3e')](_0x276d('0x76'))[_0x276d('0x3e')](_0x276d('0x77'),_0x2c4bd3[_0x276d('0x73')][_0x276d('0x74')]())[_0x276d('0x3e')](_0x276d('0x81')))['toString']();}_0xfdbcc9=squel[_0x276d('0x6a')]()[_0x276d('0x6b')](_0x276d('0x82'))[_0x276d('0x6c')](['cmHopperId','scheduledAt','phone',_0x276d('0x83'),_0x276d('0x53'),_0x276d('0x54')],squel[_0x276d('0x70')]()[_0x276d('0x71')]('h.id','id')[_0x276d('0x71')]('NOW()',_0x276d('0x7f'))['field'](_0x276d('0x84'),'phone')['field'](_0x276d('0x85'),_0x276d('0x83'))[_0x276d('0x71')]('\x27'+_0x18326f+'\x27','createdAt')[_0x276d('0x71')]('\x27'+_0x18326f+'\x27',_0x276d('0x54'))[_0x276d('0x7a')]('cm_contact_has_items','ci')[_0x276d('0x86')](_0x276d('0x80'),'h',_0x276d('0x87'))['where']('h.ListId\x20=\x20?',_0x2c4bd3[_0x276d('0x73')][_0x276d('0x74')]())['where']('h.CampaignId=?',_0x2e74fe[_0x276d('0x48')]['id'][_0x276d('0x74')]())[_0x276d('0x3e')](_0x276d('0x88'),_0x18326f))[_0x276d('0x74')]();_0x47ee70[_0x276d('0x89')](db[_0x276d('0x8a')]['query'](_0x1eaed3));_0x5157cd[_0x276d('0x89')](db['sequelize'][_0x276d('0x36')](_0xfdbcc9));}return BPromise[_0x276d('0x8b')](_0x47ee70);}})[_0x276d('0x24')](function(){return BPromise[_0x276d('0x8b')](_0x5157cd);})[_0x276d('0x24')](function(){return _0x3d3935;})[_0x276d('0x24')](respondWithResult(_0x2f5c86,null))[_0x276d('0x46')](handleError(_0x2f5c86,null));};exports[_0x276d('0x8c')]=function(_0x4bce23,_0x1694f6,_0x420116){return db[_0x276d('0x2e')][_0x276d('0x4e')]({'where':{'id':_0x4bce23[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x1694f6,null))[_0x276d('0x24')](function(_0x418b5d){if(_0x418b5d){return _0x418b5d[_0x276d('0x8c')](_0x4bce23[_0x276d('0x36')][_0x276d('0x67')]);}})[_0x276d('0x24')](function(_0x155ef3){if(_0x155ef3){return db[_0x276d('0x5a')][_0x276d('0x8d')]({'where':{'ListId':_0x4bce23[_0x276d('0x36')][_0x276d('0x67')],'CampaignId':_0x4bce23[_0x276d('0x48')]['id']}})[_0x276d('0x24')](function(){return _0x155ef3;});}})[_0x276d('0x24')](respondWithStatusCode(_0x1694f6,null))[_0x276d('0x46')](handleError(_0x1694f6,null));};exports['getBlackLists']=function(_0x2d78b7,_0x24ceb3,_0x386b55){var _0x4b3db8={};var _0x2d649c={};var _0x1163f8;var _0x49553f;return db[_0x276d('0x2e')][_0x276d('0x5d')]({'where':{'id':_0x2d78b7['params']['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x24ceb3,null))[_0x276d('0x24')](function(_0x39ce5c){if(_0x39ce5c){_0x1163f8=_0x39ce5c;_0x2d649c['model']=_[_0x276d('0x33')](db[_0x276d('0x64')][_0x276d('0x2f')]);_0x2d649c[_0x276d('0x36')]=_[_0x276d('0x33')](_0x2d78b7['query']);_0x2d649c[_0x276d('0x34')]=_[_0x276d('0x35')](_0x2d649c[_0x276d('0x32')],_0x2d649c[_0x276d('0x36')]);_0x4b3db8[_0x276d('0x37')]=_[_0x276d('0x35')](_0x2d649c[_0x276d('0x32')],qs[_0x276d('0x38')](_0x2d78b7[_0x276d('0x36')][_0x276d('0x38')]));_0x4b3db8[_0x276d('0x37')]=_0x4b3db8[_0x276d('0x37')][_0x276d('0x39')]?_0x4b3db8['attributes']:_0x2d649c[_0x276d('0x32')];_0x4b3db8['order']=qs[_0x276d('0x3d')](_0x2d78b7[_0x276d('0x36')][_0x276d('0x3d')]);_0x4b3db8['where']=qs[_0x276d('0x34')](_['pick'](_0x2d78b7['query'],_0x2d649c[_0x276d('0x34')]));if(_0x2d78b7['query'][_0x276d('0x40')]){_0x4b3db8[_0x276d('0x3e')]=_[_0x276d('0x41')](_0x4b3db8[_0x276d('0x3e')],{'$or':_[_0x276d('0x2d')](_0x4b3db8[_0x276d('0x37')],function(_0xfe7ec7){var _0x3689da={};_0x3689da[_0xfe7ec7]={'$like':'%'+_0x2d78b7[_0x276d('0x36')][_0x276d('0x40')]+'%'};return _0x3689da;})});}_0x4b3db8=_[_0x276d('0x41')]({},_0x4b3db8,_0x2d78b7[_0x276d('0x42')]);return _0x1163f8[_0x276d('0x8e')](_0x4b3db8);}})[_0x276d('0x24')](function(_0x133139){if(_0x133139){_0x49553f=_0x133139[_0x276d('0x39')];if(!_0x2d78b7[_0x276d('0x36')]['hasOwnProperty'](_0x276d('0x3b'))){_0x4b3db8[_0x276d('0x1d')]=qs[_0x276d('0x1d')](_0x2d78b7[_0x276d('0x36')][_0x276d('0x1d')]);_0x4b3db8[_0x276d('0x20')]=qs[_0x276d('0x20')](_0x2d78b7[_0x276d('0x36')]['offset']);}return _0x1163f8['getBlackLists'](_0x4b3db8);}})[_0x276d('0x24')](function(_0xac7aff){if(_0xac7aff){return _0xac7aff?{'count':_0x49553f,'rows':_0xac7aff}:null;}})[_0x276d('0x24')](respondWithResult(_0x24ceb3,null))['catch'](handleError(_0x24ceb3,null));};exports[_0x276d('0x8f')]=function(_0x5c6eda,_0x1dd8dd,_0x3e4df2){var _0x505ba4,_0x41e08c;var _0x1d2081=[];var _0x540bdc=moment()[_0x276d('0x66')](_0x276d('0x90'));return db[_0x276d('0x2e')]['find']({'where':{'id':_0x5c6eda[_0x276d('0x48')]['id']}})[_0x276d('0x24')](handleEntityNotFound(_0x1dd8dd,null))[_0x276d('0x24')](function(_0x546134){if(_0x546134){_0x41e08c=_0x546134;return _0x546134[_0x276d('0x8f')](_0x5c6eda['body'][_0x276d('0x67')],_[_0x276d('0x52')](_0x5c6eda[_0x276d('0x55')],['ids','id'])||{});}return null;})[_0x276d('0x91')](function(_0x3dd699){var _0x1d64b3;var _0x35944c;_0x505ba4=_0x3dd699||[];var _0xed2e5f=[];if(_0x3dd699){for(var _0x4b0354=0x0;_0x4b0354<_0x3dd699['length'];_0x4b0354+=0x1){var _0x5e5df1=_0x3dd699[_0x4b0354][_0x276d('0x25')]({'plain':!![]});_0x1d64b3=squel[_0x276d('0x6a')]()['into'](_0x276d('0x92'))[_0x276d('0x6c')]([_0x276d('0x6d'),_0x276d('0x6e'),'ListId',_0x276d('0x5b'),_0x276d('0x53'),'updatedAt'],squel[_0x276d('0x70')]()[_0x276d('0x71')]('phone',_0x276d('0x6d'))[_0x276d('0x71')]('id',_0x276d('0x6e'))[_0x276d('0x71')](_0x5e5df1['CmListId'][_0x276d('0x74')](),_0x276d('0x6f'))['field'](_0x5c6eda['params']['id'][_0x276d('0x74')](),_0x276d('0x5b'))['field']('NOW()','createdAt')[_0x276d('0x71')](_0x276d('0x72'),_0x276d('0x54'))[_0x276d('0x7a')](_0x276d('0x75'))[_0x276d('0x3e')]('deletedAt\x20IS\x20NULL')[_0x276d('0x3e')](_0x276d('0x77'),_0x5e5df1['CmListId']['toString']())[_0x276d('0x3e')](_0x276d('0x81')))[_0x276d('0x74')]();_0xed2e5f[_0x276d('0x89')](db[_0x276d('0x8a')]['query'](_0x1d64b3));}return BPromise[_0x276d('0x8b')](_0xed2e5f);}})['then'](function(){return _0x505ba4;})[_0x276d('0x24')](respondWithResult(_0x1dd8dd,null))[_0x276d('0x46')](handleError(_0x1dd8dd,null));};exports['removeBlackLists']=function(_0x394524,_0x245298,_0x42a6f6){return db[_0x276d('0x2e')][_0x276d('0x4e')]({'where':{'id':_0x394524[_0x276d('0x48')]['id']}})['then'](handleEntityNotFound(_0x245298,null))['then'](function(_0x46cd07){if(_0x46cd07){return _0x46cd07['removeBlackLists'](_0x394524[_0x276d('0x36')][_0x276d('0x67')]);}})[_0x276d('0x24')](function(_0x186ce0){if(_0x186ce0){return db[_0x276d('0x62')][_0x276d('0x8d')]({'where':{'ListId':_0x394524['query'][_0x276d('0x67')],'CampaignId':_0x394524[_0x276d('0x48')]['id']}})[_0x276d('0x24')](function(){return _0x186ce0;});}})['then'](respondWithStatusCode(_0x245298,null))[_0x276d('0x46')](handleError(_0x245298,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 030bd8e..fbf4f91 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(_0x3bf8c3,_0x374e06){var _0x2b381c=function(_0x2bcfd2){while(--_0x2bcfd2){_0x3bf8c3['push'](_0x3bf8c3['shift']());}};_0x2b381c(++_0x374e06);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6ee2,_0x2cca13){_0x5e6ee2=_0x5e6ee2-0x0;var _0x5c6e59=_0x7a54[_0x5e6ee2];return _0x5c6e59;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x280c2e,_0x335764){var _0x249a00=function(_0x387feb){while(--_0x387feb){_0x280c2e['push'](_0x280c2e['shift']());}};_0x249a00(++_0x335764);}(_0x7a54,0x106));var _0x47a5=function(_0x2091f7,_0x2c5e33){_0x2091f7=_0x2091f7-0x0;var _0x5be3be=_0x7a54[_0x2091f7];return _0x5be3be;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index bd4b30d..9b882da 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 _0xf403=['debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Campaign,\x20%s,\x20%s','message','result','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0xf403,0x1d3));var _0x3f40=function(_0x519623,_0x201512){_0x519623=_0x519623-0x0;var _0x295909=_0xf403[_0x519623];return _0x295909;};'use strict';var _=require(_0x3f40('0x0'));var util=require('util');var moment=require(_0x3f40('0x1'));var BPromise=require(_0x3f40('0x2'));var rs=require(_0x3f40('0x3'));var fs=require('fs');var Redis=require(_0x3f40('0x4'));var db=require(_0x3f40('0x5'))['db'];var utils=require(_0x3f40('0x6'));var logger=require(_0x3f40('0x7'))(_0x3f40('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3f40('0x9')][_0x3f40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24fb9e,_0x1f21fa,_0x5878f9){return new BPromise(function(_0x1dffe8,_0x4c1694){return client['request'](_0x24fb9e,_0x5878f9)[_0x3f40('0xb')](function(_0xb4a314){logger[_0x3f40('0xc')]('Campaign,\x20%s,\x20%s',_0x1f21fa,'request\x20sent');logger[_0x3f40('0xd')](_0x3f40('0xe'),_0x1f21fa,_0x3f40('0xf'),JSON['stringify'](_0xb4a314));if(_0xb4a314[_0x3f40('0x10')]){if(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x11')]===0x1f4){logger['error'](_0x3f40('0x12'),_0x1f21fa,_0xb4a314['error'][_0x3f40('0x13')]);return _0x4c1694(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);}logger[_0x3f40('0x10')]('Campaign,\x20%s,\x20%s',_0x1f21fa,_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);return _0x1dffe8(_0xb4a314[_0x3f40('0x10')][_0x3f40('0x13')]);}else{logger[_0x3f40('0xc')]('Campaign,\x20%s,\x20%s',_0x1f21fa,_0x3f40('0xf'));_0x1dffe8(_0xb4a314[_0x3f40('0x14')]['message']);}})['catch'](function(_0x54f596){logger[_0x3f40('0x10')](_0x3f40('0x12'),_0x1f21fa,_0x54f596);_0x4c1694(_0x54f596);});});}exports[_0x3f40('0x15')]=function(_0x131e55){var _0x374644=this;return new Promise(function(_0x5b4ebc,_0x2639ef){return db[_0x3f40('0x16')][_0x3f40('0x17')]({'raw':_0x131e55[_0x3f40('0x18')]?_0x131e55[_0x3f40('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x131e55[_0x3f40('0x18')]?_0x131e55['options'][_0x3f40('0x19')]||null:null,'attributes':_0x131e55[_0x3f40('0x18')]?_0x131e55[_0x3f40('0x18')][_0x3f40('0x1a')]||null:null,'limit':_0x131e55[_0x3f40('0x18')]?_0x131e55['options'][_0x3f40('0x1b')]||null:null,'include':_0x131e55[_0x3f40('0x18')]?_0x131e55[_0x3f40('0x18')][_0x3f40('0x1c')]?_[_0x3f40('0x1d')](_0x131e55[_0x3f40('0x18')]['include'],function(_0x31fc91){return{'model':db[_0x31fc91[_0x3f40('0x1e')]],'as':_0x31fc91['as'],'attributes':_0x31fc91[_0x3f40('0x1a')],'include':_0x31fc91['include']?_[_0x3f40('0x1d')](_0x31fc91['include'],function(_0x37b47e){return{'model':db[_0x37b47e['model']],'as':_0x37b47e['as'],'attributes':_0x37b47e['attributes'],'include':_0x37b47e['include']?_[_0x3f40('0x1d')](_0x37b47e[_0x3f40('0x1c')],function(_0x140044){return{'model':db[_0x140044[_0x3f40('0x1e')]],'as':_0x140044['as'],'attributes':_0x140044['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f40('0xb')](function(_0x47ec1c){logger[_0x3f40('0xc')](_0x3f40('0x15'),_0x131e55);logger[_0x3f40('0xd')]('GetCampaign',_0x131e55,JSON[_0x3f40('0x1f')](_0x47ec1c));_0x5b4ebc(_0x47ec1c);})['catch'](function(_0x1cab5c){logger['error']('GetCampaign',_0x1cab5c[_0x3f40('0x13')],_0x131e55);_0x2639ef(_0x374644[_0x3f40('0x10')](0x1f4,_0x1cab5c[_0x3f40('0x13')]));});});}; \ No newline at end of file +var _0x21a3=['include','model','GetCampaign','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Campaign','findAll','options','raw','where','attributes','limit','map'];(function(_0x30707b,_0x433066){var _0x1d4108=function(_0x21d849){while(--_0x21d849){_0x30707b['push'](_0x30707b['shift']());}};_0x1d4108(++_0x433066);}(_0x21a3,0x66));var _0x321a=function(_0xf1b134,_0xb399dd){_0xf1b134=_0xf1b134-0x0;var _0x139dbb=_0x21a3[_0xf1b134];return _0x139dbb;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Campaign,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['GetCampaign']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')]({'raw':_0x5b1810[_0x321a('0x18')]?_0x5b1810['options'][_0x321a('0x19')]===undefined?!![]:![]:!![],'where':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1a')]||null:null,'attributes':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1b')]||null:null,'limit':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')][_0x321a('0x1c')]||null:null,'include':_0x5b1810[_0x321a('0x18')]?_0x5b1810[_0x321a('0x18')]['include']?_[_0x321a('0x1d')](_0x5b1810[_0x321a('0x18')][_0x321a('0x1e')],function(_0x5ae154){return{'model':db[_0x5ae154[_0x321a('0x1f')]],'as':_0x5ae154['as'],'attributes':_0x5ae154[_0x321a('0x1b')],'include':_0x5ae154['include']?_['map'](_0x5ae154[_0x321a('0x1e')],function(_0x5a66c2){return{'model':db[_0x5a66c2[_0x321a('0x1f')]],'as':_0x5a66c2['as'],'attributes':_0x5a66c2[_0x321a('0x1b')],'include':_0x5a66c2[_0x321a('0x1e')]?_[_0x321a('0x1d')](_0x5a66c2[_0x321a('0x1e')],function(_0xdce138){return{'model':db[_0xdce138['model']],'as':_0xdce138['as'],'attributes':_0xdce138['attributes']};}):[]};}):[]};}):[]:[]})[_0x321a('0xc')](function(_0x105216){logger[_0x321a('0xd')]('GetCampaign',_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x20'),_0x5b1810,JSON[_0x321a('0x12')](_0x105216));_0x35fd6f(_0x105216);})['catch'](function(_0x8a09bb){logger[_0x321a('0x13')](_0x321a('0x20'),_0x8a09bb[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x8a09bb[_0x321a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index c2c58f7..6e8e4b5 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 _0x994b=['/:id','destroy','removeLists','removeBlackLists','exports','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/hoppers','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','create','/:id/clone','addLists','addBlackLists','put','update','delete'];(function(_0x58a7b5,_0x4469bb){var _0x35c14c=function(_0x6fdbf1){while(--_0x6fdbf1){_0x58a7b5['push'](_0x58a7b5['shift']());}};_0x35c14c(++_0x4469bb);}(_0x994b,0x198));var _0xb994=function(_0x5ee73b,_0x282c4c){_0x5ee73b=_0x5ee73b-0x0;var _0x22948a=_0x994b[_0x5ee73b];return _0x22948a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb994('0x0'));var express=require(_0xb994('0x1'));var router=express['Router']();var fs_extra=require(_0xb994('0x2'));var auth=require(_0xb994('0x3'));var interaction=require(_0xb994('0x4'));var config=require(_0xb994('0x5'));var controller=require('./campaign.controller');router[_0xb994('0x6')]('/',auth['isAuthenticated'](),controller[_0xb994('0x7')]);router[_0xb994('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xb994('0x8')]);router[_0xb994('0x6')](_0xb994('0x9'),auth[_0xb994('0xa')](),controller['getHoppers']);router[_0xb994('0x6')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xb994('0xb')]);router[_0xb994('0x6')](_0xb994('0xc'),auth[_0xb994('0xa')](),controller[_0xb994('0xd')]);router[_0xb994('0x6')](_0xb994('0xe'),auth['isAuthenticated'](),controller[_0xb994('0xf')]);router[_0xb994('0x6')](_0xb994('0x10'),auth[_0xb994('0xa')](),controller[_0xb994('0x11')]);router[_0xb994('0x6')](_0xb994('0x12'),auth[_0xb994('0xa')](),controller['getBlackLists']);router['post']('/',auth[_0xb994('0xa')](),controller[_0xb994('0x13')]);router['post'](_0xb994('0x14'),auth[_0xb994('0xa')](),controller['clone']);router['post'](_0xb994('0x10'),auth[_0xb994('0xa')](),controller[_0xb994('0x15')]);router['post']('/:id/blacklists',auth[_0xb994('0xa')](),controller[_0xb994('0x16')]);router[_0xb994('0x17')]('/:id',auth[_0xb994('0xa')](),controller[_0xb994('0x18')]);router[_0xb994('0x19')](_0xb994('0x1a'),auth[_0xb994('0xa')](),controller[_0xb994('0x1b')]);router[_0xb994('0x19')](_0xb994('0x10'),auth['isAuthenticated'](),controller[_0xb994('0x1c')]);router[_0xb994('0x19')](_0xb994('0x12'),auth[_0xb994('0xa')](),controller[_0xb994('0x1d')]);module[_0xb994('0x1e')]=router; \ No newline at end of file +var _0x86e4=['index','/:id','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','delete','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x86e4,0x149));var _0x486e=function(_0x59c683,_0x209444){_0x59c683=_0x59c683-0x0;var _0x47251b=_0x86e4[_0x59c683];return _0x47251b;};'use strict';var multer=require(_0x486e('0x0'));var util=require(_0x486e('0x1'));var path=require(_0x486e('0x2'));var timeout=require(_0x486e('0x3'));var express=require(_0x486e('0x4'));var router=express[_0x486e('0x5')]();var fs_extra=require(_0x486e('0x6'));var auth=require(_0x486e('0x7'));var interaction=require(_0x486e('0x8'));var config=require(_0x486e('0x9'));var controller=require(_0x486e('0xa'));router[_0x486e('0xb')]('/',auth[_0x486e('0xc')](),controller[_0x486e('0xd')]);router['get'](_0x486e('0xe'),auth[_0x486e('0xc')](),controller[_0x486e('0xf')]);router['get'](_0x486e('0x10'),auth[_0x486e('0xc')](),controller[_0x486e('0x11')]);router['get']('/:id/hopper_histories',auth[_0x486e('0xc')](),controller[_0x486e('0x12')]);router['get'](_0x486e('0x13'),auth[_0x486e('0xc')](),controller[_0x486e('0x14')]);router['get'](_0x486e('0x15'),auth[_0x486e('0xc')](),controller[_0x486e('0x16')]);router[_0x486e('0xb')](_0x486e('0x17'),auth[_0x486e('0xc')](),controller[_0x486e('0x18')]);router[_0x486e('0xb')]('/:id/blacklists',auth[_0x486e('0xc')](),controller[_0x486e('0x19')]);router[_0x486e('0x1a')]('/',auth[_0x486e('0xc')](),controller['create']);router['post'](_0x486e('0x1b'),auth[_0x486e('0xc')](),controller[_0x486e('0x1c')]);router[_0x486e('0x1a')](_0x486e('0x17'),auth[_0x486e('0xc')](),controller[_0x486e('0x1d')]);router[_0x486e('0x1a')]('/:id/blacklists',auth[_0x486e('0xc')](),controller[_0x486e('0x1e')]);router[_0x486e('0x1f')](_0x486e('0xe'),auth['isAuthenticated'](),controller[_0x486e('0x20')]);router['delete']('/:id',auth[_0x486e('0xc')](),controller[_0x486e('0x21')]);router[_0x486e('0x22')]('/:id/lists',auth['isAuthenticated'](),controller[_0x486e('0x23')]);router[_0x486e('0x22')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x486e('0x24')]);module[_0x486e('0x25')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 4631e98..28ea308 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 _0xf19c=['TEXT','STRING','VIRTUAL','key','sequelize','exports'];(function(_0x3c2060,_0x446ca5){var _0x5eb6cc=function(_0x480d68){while(--_0x480d68){_0x3c2060['push'](_0x3c2060['shift']());}};_0x5eb6cc(++_0x446ca5);}(_0xf19c,0x196));var _0xcf19=function(_0x1d0fbb,_0x40fb97){_0x1d0fbb=_0x1d0fbb-0x0;var _0x2235bb=_0xf19c[_0x1d0fbb];return _0x2235bb;};'use strict';var Sequelize=require(_0xcf19('0x0'));module[_0xcf19('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xcf19('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xcf19('0x3')]},'name':{'type':Sequelize[_0xcf19('0x4')],'get':function(){return this['getDataValue'](_0xcf19('0x5'));}}}; \ No newline at end of file +var _0x7a23=['VIRTUAL','getDataValue','key','STRING'];(function(_0x509171,_0xf16fca){var _0x1dd544=function(_0x45820){while(--_0x45820){_0x509171['push'](_0x509171['shift']());}};_0x1dd544(++_0xf16fca);}(_0x7a23,0x187));var _0x37a2=function(_0x3df316,_0x541115){_0x3df316=_0x3df316-0x0;var _0x46dd61=_0x7a23[_0x3df316];return _0x46dd61;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x37a2('0x0')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x37a2('0x1')],'get':function(){return this[_0x37a2('0x2')](_0x37a2('0x3'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 05ae3ea..670586b 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 _0xf972=['The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','send','index','map','CannedAnswer','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','keys','update','params','create','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','ValidationError'];(function(_0x1530f3,_0x2540ad){var _0x1d32bb=function(_0x2ddc8e){while(--_0x2ddc8e){_0x1530f3['push'](_0x1530f3['shift']());}};_0x1d32bb(++_0x2540ad);}(_0xf972,0x180));var _0x2f97=function(_0x33e564,_0x4edab3){_0x33e564=_0x33e564-0x0;var _0x18c12e=_0xf972[_0x33e564];return _0x18c12e;};'use strict';var emlformat=require(_0x2f97('0x0'));var rimraf=require(_0x2f97('0x1'));var zipdir=require(_0x2f97('0x2'));var jsonpatch=require(_0x2f97('0x3'));var rp=require(_0x2f97('0x4'));var moment=require(_0x2f97('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2f97('0x6'));var util=require(_0x2f97('0x7'));var path=require(_0x2f97('0x8'));var sox=require(_0x2f97('0x9'));var csv=require(_0x2f97('0xa'));var ejs=require(_0x2f97('0xb'));var fs=require('fs');var fs_extra=require(_0x2f97('0xc'));var _=require(_0x2f97('0xd'));var squel=require(_0x2f97('0xe'));var crypto=require(_0x2f97('0xf'));var jsforce=require(_0x2f97('0x10'));var deskjs=require(_0x2f97('0x11'));var toCsv=require(_0x2f97('0xa'));var querystring=require(_0x2f97('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2f97('0x13'));var qs=require(_0x2f97('0x14'));var as=require(_0x2f97('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f97('0x16'))(_0x2f97('0x17'));var utils=require(_0x2f97('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2f97('0x19'));var db=require(_0x2f97('0x1a'))['db'];function respondWithStatusCode(_0x186e07,_0x57bdf9){_0x57bdf9=_0x57bdf9||0xcc;return function(_0x5d9215){if(_0x5d9215){return _0x186e07[_0x2f97('0x1b')](_0x57bdf9);}return _0x186e07[_0x2f97('0x1c')](_0x57bdf9)[_0x2f97('0x1d')]();};}function respondWithResult(_0x1b6ce3,_0x5aed95){_0x5aed95=_0x5aed95||0xc8;return function(_0x500b42){if(_0x500b42){return _0x1b6ce3['status'](_0x5aed95)['json'](_0x500b42);}};}function respondWithFilteredResult(_0x27f4a9,_0x3586de){return function(_0x8bacb1){if(_0x8bacb1){var _0x336147=typeof _0x3586de[_0x2f97('0x1e')]===_0x2f97('0x1f')&&typeof _0x3586de[_0x2f97('0x20')]===_0x2f97('0x1f');var _0xccfd1=_0x8bacb1['count'];var _0x193fbc=_0x336147?0x0:_0x3586de[_0x2f97('0x1e')];var _0x526364=_0x336147?_0x8bacb1[_0x2f97('0x21')]:_0x3586de[_0x2f97('0x1e')]+_0x3586de['limit'];var _0x12b141;if(_0x526364>=_0xccfd1){_0x526364=_0xccfd1;_0x12b141=0xc8;}else{_0x12b141=0xce;}_0x27f4a9['status'](_0x12b141);return _0x27f4a9[_0x2f97('0x22')](_0x2f97('0x23'),_0x193fbc+'-'+_0x526364+'/'+_0xccfd1)[_0x2f97('0x24')](_0x8bacb1);}return null;};}function patchUpdates(_0x583a53){return function(_0x3fd520){try{jsonpatch[_0x2f97('0x25')](_0x3fd520,_0x583a53,!![]);}catch(_0xddb628){return BPromise[_0x2f97('0x26')](_0xddb628);}return _0x3fd520[_0x2f97('0x27')]();};}function saveUpdates(_0x37dffd,_0x541728){return function(_0x11f445){if(_0x11f445){return _0x11f445['update'](_0x37dffd)[_0x2f97('0x28')](function(_0x37f5fe){return _0x37f5fe;});}return null;};}function removeEntity(_0x5b4fa2,_0x4bed38){return function(_0xd37982){if(_0xd37982){return _0xd37982[_0x2f97('0x29')]()[_0x2f97('0x28')](function(){var _0x499472=_0xd37982[_0x2f97('0x2a')]({'plain':!![]});var _0x31c37f=_0x2f97('0x2b');return db[_0x2f97('0x2c')][_0x2f97('0x29')]({'where':{'type':_0x31c37f,'resourceId':_0x499472['id']}})[_0x2f97('0x28')](function(){return _0xd37982;});})[_0x2f97('0x28')](function(){_0x5b4fa2[_0x2f97('0x1c')](0xcc)[_0x2f97('0x1d')]();});}};}function handleEntityNotFound(_0x31bf65,_0x1c7cbc){return function(_0xc34815){if(!_0xc34815){_0x31bf65[_0x2f97('0x1b')](0x194);}return _0xc34815;};}function handleError(_0x47cfe6,_0x1b4100){_0x1b4100=_0x1b4100||0x1f4;return function(_0x2a3fa2){logger['error'](_0x2a3fa2[_0x2f97('0x2d')]);if(_0x2a3fa2['name']){delete _0x2a3fa2['name'];}_0x47cfe6[_0x2f97('0x1c')](_0x1b4100)[_0x2f97('0x2e')](_0x2a3fa2);};}exports[_0x2f97('0x2f')]=function(_0x2807d7,_0x1719db){var _0x316518={},_0x367999={},_0x4b7e6e={'count':0x0,'rows':[]};var _0x139df8=_[_0x2f97('0x30')](db[_0x2f97('0x31')][_0x2f97('0x32')],function(_0x50e7be){return{'name':_0x50e7be[_0x2f97('0x33')],'type':_0x50e7be['type'][_0x2f97('0x34')]};});_0x367999[_0x2f97('0x35')]=_[_0x2f97('0x30')](_0x139df8,_0x2f97('0x36'));_0x367999[_0x2f97('0x37')]=_['keys'](_0x2807d7[_0x2f97('0x37')]);_0x367999[_0x2f97('0x38')]=_[_0x2f97('0x39')](_0x367999[_0x2f97('0x35')],_0x367999[_0x2f97('0x37')]);_0x316518[_0x2f97('0x3a')]=_[_0x2f97('0x39')](_0x367999[_0x2f97('0x35')],qs[_0x2f97('0x3b')](_0x2807d7[_0x2f97('0x37')][_0x2f97('0x3b')]));_0x316518[_0x2f97('0x3a')]=_0x316518['attributes'][_0x2f97('0x3c')]?_0x316518[_0x2f97('0x3a')]:_0x367999[_0x2f97('0x35')];if(!_0x2807d7[_0x2f97('0x37')][_0x2f97('0x3d')](_0x2f97('0x3e'))){_0x316518[_0x2f97('0x20')]=qs[_0x2f97('0x20')](_0x2807d7[_0x2f97('0x37')]['limit']);_0x316518['offset']=qs[_0x2f97('0x1e')](_0x2807d7[_0x2f97('0x37')]['offset']);}_0x316518[_0x2f97('0x3f')]=qs[_0x2f97('0x40')](_0x2807d7[_0x2f97('0x37')]['sort']);_0x316518[_0x2f97('0x41')]=qs[_0x2f97('0x38')](_[_0x2f97('0x42')](_0x2807d7[_0x2f97('0x37')],_0x367999[_0x2f97('0x38')]),_0x139df8);if(_0x2807d7[_0x2f97('0x37')][_0x2f97('0x43')]){_0x316518['where']=_[_0x2f97('0x44')](_0x316518[_0x2f97('0x41')],{'$or':[{'key':{'$like':'%'+_0x2807d7[_0x2f97('0x37')][_0x2f97('0x43')]+'%'}},{'value':{'$like':'%'+_0x2807d7[_0x2f97('0x37')][_0x2f97('0x43')]+'%'}}]});}_0x316518=_[_0x2f97('0x44')]({},_0x316518,_0x2807d7[_0x2f97('0x45')]);var _0x517ceb={'where':_0x316518[_0x2f97('0x41')]};return db['CannedAnswer'][_0x2f97('0x21')](_0x517ceb)[_0x2f97('0x28')](function(_0x228c57){_0x4b7e6e[_0x2f97('0x21')]=_0x228c57;if(_0x2807d7['query'][_0x2f97('0x46')]){_0x316518[_0x2f97('0x47')]=[{'all':!![]}];}return db[_0x2f97('0x31')][_0x2f97('0x48')](_0x316518);})[_0x2f97('0x28')](function(_0x2ba80e){_0x4b7e6e[_0x2f97('0x49')]=_0x2ba80e;return _0x4b7e6e;})[_0x2f97('0x28')](respondWithFilteredResult(_0x1719db,_0x316518))[_0x2f97('0x4a')](handleError(_0x1719db,null));};exports['show']=function(_0x423d04,_0x75bf98){var _0x4cd005={'raw':!![],'where':{'id':_0x423d04['params']['id']}},_0x3cc17f={};_0x3cc17f[_0x2f97('0x35')]=_[_0x2f97('0x4b')](db[_0x2f97('0x31')][_0x2f97('0x32')]);_0x3cc17f['query']=_['keys'](_0x423d04[_0x2f97('0x37')]);_0x3cc17f[_0x2f97('0x38')]=_[_0x2f97('0x39')](_0x3cc17f['model'],_0x3cc17f['query']);_0x4cd005[_0x2f97('0x3a')]=_[_0x2f97('0x39')](_0x3cc17f[_0x2f97('0x35')],qs['fields'](_0x423d04[_0x2f97('0x37')][_0x2f97('0x3b')]));_0x4cd005[_0x2f97('0x3a')]=_0x4cd005[_0x2f97('0x3a')][_0x2f97('0x3c')]?_0x4cd005[_0x2f97('0x3a')]:_0x3cc17f[_0x2f97('0x35')];if(_0x423d04[_0x2f97('0x37')]['includeAll']){_0x4cd005[_0x2f97('0x47')]=[{'all':!![]}];}_0x4cd005=_['merge']({},_0x4cd005,_0x423d04[_0x2f97('0x45')]);return db['CannedAnswer']['find'](_0x4cd005)[_0x2f97('0x28')](handleEntityNotFound(_0x75bf98,null))['then'](respondWithResult(_0x75bf98,null))[_0x2f97('0x4a')](handleError(_0x75bf98,null));};exports[_0x2f97('0x4c')]=function(_0xe108cb,_0x2d44fc){if(_0xe108cb['body']['id']){delete _0xe108cb['body']['id'];}return db[_0x2f97('0x31')]['find']({'where':{'id':_0xe108cb[_0x2f97('0x4d')]['id']}})[_0x2f97('0x28')](handleEntityNotFound(_0x2d44fc,null))[_0x2f97('0x28')](saveUpdates(_0xe108cb['body'],null))[_0x2f97('0x28')](respondWithResult(_0x2d44fc,null))['catch'](handleError(_0x2d44fc,null));};exports[_0x2f97('0x29')]=function(_0x4979c1,_0x42ed3d){return db[_0x2f97('0x31')]['find']({'where':{'id':_0x4979c1[_0x2f97('0x4d')]['id']}})['then'](handleEntityNotFound(_0x42ed3d,null))['then'](removeEntity(_0x42ed3d,null))[_0x2f97('0x4a')](handleError(_0x42ed3d,null));};exports[_0x2f97('0x4e')]=function(_0x4916f8,_0x4ce908){var _0x5ab061={'key':_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x34')]};if(_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x50')]){_0x5ab061[_0x2f97('0x50')]=_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x50')];}else if(_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x51')]){_0x5ab061[_0x2f97('0x51')]=_0x4916f8['body'][_0x2f97('0x51')];}else if(_0x4916f8[_0x2f97('0x4f')]['OpenchannelAccountId']){_0x5ab061[_0x2f97('0x52')]=_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x52')];}else if(_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x53')]){_0x5ab061['ChatWebsiteId']=_0x4916f8[_0x2f97('0x4f')][_0x2f97('0x53')];}return db[_0x2f97('0x31')][_0x2f97('0x54')]({'where':_0x5ab061})['then'](function(_0x561fb4){if(_0x561fb4){throw new db['Sequelize'][(_0x2f97('0x55'))](_0x2f97('0x56'));}return db['CannedAnswer'][_0x2f97('0x4e')](_0x4916f8['body']);})['then'](function(_0x27f359){var _0x5a9207=_0x4916f8[_0x2f97('0x57')][_0x2f97('0x2a')]({'plain':!![]});if(!_0x5a9207)throw new Error(_0x2f97('0x58'));if(_0x5a9207[_0x2f97('0x59')]===_0x2f97('0x57')){var _0x1bd0a2=_0x27f359[_0x2f97('0x2a')]({'plain':!![]});return db[_0x2f97('0x5a')][_0x2f97('0x54')]({'where':{'name':'CannedAnswers','userProfileId':_0x5a9207['userProfileId']},'raw':!![]})[_0x2f97('0x28')](function(_0x201612){if(_0x201612&&_0x201612[_0x2f97('0x5b')]===0x0){return db[_0x2f97('0x2c')][_0x2f97('0x4e')]({'name':_0x1bd0a2[_0x2f97('0x36')],'resourceId':_0x1bd0a2['id'],'type':_0x201612[_0x2f97('0x36')],'sectionId':_0x201612['id']},{})[_0x2f97('0x28')](function(){return _0x27f359;});}else{return _0x27f359;}})[_0x2f97('0x4a')](function(_0x21f17d){logger[_0x2f97('0x5c')](_0x2f97('0x5d'),_0x21f17d);throw _0x21f17d;});}return _0x27f359;})[_0x2f97('0x28')](respondWithResult(_0x4ce908,0xc9))['catch'](handleError(_0x4ce908,null));}; \ No newline at end of file +var _0xb40c=['role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','offset','limit','undefined','count','status','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','error','stack','send','map','CannedAnswer','rawAttributes','type','key','name','keys','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','filter','merge','options','rows','show','params','includeAll','include','find','catch','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user'];(function(_0x47099e,_0x3d9881){var _0x5a26c6=function(_0x11e099){while(--_0x11e099){_0x47099e['push'](_0x47099e['shift']());}};_0x5a26c6(++_0x3d9881);}(_0xb40c,0x16d));var _0xcb40=function(_0x3e8e78,_0x2d217b){_0x3e8e78=_0x3e8e78-0x0;var _0x435ad6=_0xb40c[_0x3e8e78];return _0x435ad6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcb40('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb40('0x1'));var moment=require(_0xcb40('0x2'));var BPromise=require(_0xcb40('0x3'));var Mustache=require(_0xcb40('0x4'));var util=require('util');var path=require('path');var sox=require(_0xcb40('0x5'));var csv=require(_0xcb40('0x6'));var ejs=require(_0xcb40('0x7'));var fs=require('fs');var fs_extra=require(_0xcb40('0x8'));var _=require(_0xcb40('0x9'));var squel=require(_0xcb40('0xa'));var crypto=require(_0xcb40('0xb'));var jsforce=require(_0xcb40('0xc'));var deskjs=require(_0xcb40('0xd'));var toCsv=require('to-csv');var querystring=require(_0xcb40('0xe'));var Papa=require(_0xcb40('0xf'));var Redis=require(_0xcb40('0x10'));var authService=require(_0xcb40('0x11'));var qs=require(_0xcb40('0x12'));var as=require(_0xcb40('0x13'));var hardwareService=require(_0xcb40('0x14'));var logger=require(_0xcb40('0x15'))(_0xcb40('0x16'));var utils=require(_0xcb40('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb40('0x18'))['db'];function respondWithStatusCode(_0x3534b2,_0x50d503){_0x50d503=_0x50d503||0xcc;return function(_0x26867f){if(_0x26867f){return _0x3534b2[_0xcb40('0x19')](_0x50d503);}return _0x3534b2['status'](_0x50d503)[_0xcb40('0x1a')]();};}function respondWithResult(_0x516a5e,_0x55d8ae){_0x55d8ae=_0x55d8ae||0xc8;return function(_0x4ad785){if(_0x4ad785){return _0x516a5e['status'](_0x55d8ae)['json'](_0x4ad785);}};}function respondWithFilteredResult(_0x349408,_0x3d83a8){return function(_0x46c854){if(_0x46c854){var _0x3596b9=typeof _0x3d83a8[_0xcb40('0x1b')]==='undefined'&&typeof _0x3d83a8[_0xcb40('0x1c')]===_0xcb40('0x1d');var _0x1d16be=_0x46c854[_0xcb40('0x1e')];var _0x99a2fe=_0x3596b9?0x0:_0x3d83a8[_0xcb40('0x1b')];var _0x1e2f10=_0x3596b9?_0x46c854['count']:_0x3d83a8[_0xcb40('0x1b')]+_0x3d83a8[_0xcb40('0x1c')];var _0x15e798;if(_0x1e2f10>=_0x1d16be){_0x1e2f10=_0x1d16be;_0x15e798=0xc8;}else{_0x15e798=0xce;}_0x349408[_0xcb40('0x1f')](_0x15e798);return _0x349408[_0xcb40('0x20')](_0xcb40('0x21'),_0x99a2fe+'-'+_0x1e2f10+'/'+_0x1d16be)[_0xcb40('0x22')](_0x46c854);}return null;};}function patchUpdates(_0x5069f1){return function(_0x382c17){try{jsonpatch[_0xcb40('0x23')](_0x382c17,_0x5069f1,!![]);}catch(_0x3fa6c7){return BPromise[_0xcb40('0x24')](_0x3fa6c7);}return _0x382c17[_0xcb40('0x25')]();};}function saveUpdates(_0x2e212c,_0x4aafec){return function(_0x223a01){if(_0x223a01){return _0x223a01[_0xcb40('0x26')](_0x2e212c)['then'](function(_0x3a44b3){return _0x3a44b3;});}return null;};}function removeEntity(_0x414880,_0xc8b79f){return function(_0x1eceaa){if(_0x1eceaa){return _0x1eceaa[_0xcb40('0x27')]()[_0xcb40('0x28')](function(){var _0x482ff6=_0x1eceaa[_0xcb40('0x29')]({'plain':!![]});var _0xd15ee4='CannedAnswers';return db[_0xcb40('0x2a')][_0xcb40('0x27')]({'where':{'type':_0xd15ee4,'resourceId':_0x482ff6['id']}})['then'](function(){return _0x1eceaa;});})[_0xcb40('0x28')](function(){_0x414880[_0xcb40('0x1f')](0xcc)[_0xcb40('0x1a')]();});}};}function handleEntityNotFound(_0x4725f1,_0x5b4e66){return function(_0x329d59){if(!_0x329d59){_0x4725f1[_0xcb40('0x19')](0x194);}return _0x329d59;};}function handleError(_0xc80dd,_0x449670){_0x449670=_0x449670||0x1f4;return function(_0xd15f98){logger[_0xcb40('0x2b')](_0xd15f98[_0xcb40('0x2c')]);if(_0xd15f98['name']){delete _0xd15f98['name'];}_0xc80dd[_0xcb40('0x1f')](_0x449670)[_0xcb40('0x2d')](_0xd15f98);};}exports['index']=function(_0x292bbe,_0x32c476){var _0x59b0a5={},_0x11fb9b={},_0x31a749={'count':0x0,'rows':[]};var _0x3a16ec=_[_0xcb40('0x2e')](db[_0xcb40('0x2f')][_0xcb40('0x30')],function(_0x161bd6){return{'name':_0x161bd6['fieldName'],'type':_0x161bd6[_0xcb40('0x31')][_0xcb40('0x32')]};});_0x11fb9b['model']=_[_0xcb40('0x2e')](_0x3a16ec,_0xcb40('0x33'));_0x11fb9b['query']=_[_0xcb40('0x34')](_0x292bbe['query']);_0x11fb9b[_0xcb40('0x35')]=_[_0xcb40('0x36')](_0x11fb9b[_0xcb40('0x37')],_0x11fb9b[_0xcb40('0x38')]);_0x59b0a5['attributes']=_[_0xcb40('0x36')](_0x11fb9b[_0xcb40('0x37')],qs[_0xcb40('0x39')](_0x292bbe[_0xcb40('0x38')]['fields']));_0x59b0a5[_0xcb40('0x3a')]=_0x59b0a5[_0xcb40('0x3a')][_0xcb40('0x3b')]?_0x59b0a5[_0xcb40('0x3a')]:_0x11fb9b[_0xcb40('0x37')];if(!_0x292bbe[_0xcb40('0x38')][_0xcb40('0x3c')](_0xcb40('0x3d'))){_0x59b0a5[_0xcb40('0x1c')]=qs[_0xcb40('0x1c')](_0x292bbe[_0xcb40('0x38')][_0xcb40('0x1c')]);_0x59b0a5[_0xcb40('0x1b')]=qs[_0xcb40('0x1b')](_0x292bbe[_0xcb40('0x38')][_0xcb40('0x1b')]);}_0x59b0a5[_0xcb40('0x3e')]=qs[_0xcb40('0x3f')](_0x292bbe[_0xcb40('0x38')][_0xcb40('0x3f')]);_0x59b0a5['where']=qs[_0xcb40('0x35')](_[_0xcb40('0x40')](_0x292bbe[_0xcb40('0x38')],_0x11fb9b[_0xcb40('0x35')]),_0x3a16ec);if(_0x292bbe[_0xcb40('0x38')]['filter']){_0x59b0a5[_0xcb40('0x41')]=_['merge'](_0x59b0a5[_0xcb40('0x41')],{'$or':[{'key':{'$like':'%'+_0x292bbe['query'][_0xcb40('0x42')]+'%'}},{'value':{'$like':'%'+_0x292bbe[_0xcb40('0x38')][_0xcb40('0x42')]+'%'}}]});}_0x59b0a5=_[_0xcb40('0x43')]({},_0x59b0a5,_0x292bbe[_0xcb40('0x44')]);var _0x5b05a7={'where':_0x59b0a5[_0xcb40('0x41')]};return db['CannedAnswer'][_0xcb40('0x1e')](_0x5b05a7)[_0xcb40('0x28')](function(_0x264cbf){_0x31a749[_0xcb40('0x1e')]=_0x264cbf;if(_0x292bbe[_0xcb40('0x38')]['includeAll']){_0x59b0a5['include']=[{'all':!![]}];}return db[_0xcb40('0x2f')]['findAll'](_0x59b0a5);})[_0xcb40('0x28')](function(_0x2341c1){_0x31a749[_0xcb40('0x45')]=_0x2341c1;return _0x31a749;})[_0xcb40('0x28')](respondWithFilteredResult(_0x32c476,_0x59b0a5))['catch'](handleError(_0x32c476,null));};exports[_0xcb40('0x46')]=function(_0x56e99a,_0x28cea1){var _0x37dc7a={'raw':!![],'where':{'id':_0x56e99a[_0xcb40('0x47')]['id']}},_0xd5086f={};_0xd5086f[_0xcb40('0x37')]=_[_0xcb40('0x34')](db[_0xcb40('0x2f')][_0xcb40('0x30')]);_0xd5086f['query']=_[_0xcb40('0x34')](_0x56e99a[_0xcb40('0x38')]);_0xd5086f[_0xcb40('0x35')]=_[_0xcb40('0x36')](_0xd5086f[_0xcb40('0x37')],_0xd5086f['query']);_0x37dc7a[_0xcb40('0x3a')]=_[_0xcb40('0x36')](_0xd5086f['model'],qs['fields'](_0x56e99a[_0xcb40('0x38')][_0xcb40('0x39')]));_0x37dc7a[_0xcb40('0x3a')]=_0x37dc7a[_0xcb40('0x3a')][_0xcb40('0x3b')]?_0x37dc7a['attributes']:_0xd5086f[_0xcb40('0x37')];if(_0x56e99a['query'][_0xcb40('0x48')]){_0x37dc7a[_0xcb40('0x49')]=[{'all':!![]}];}_0x37dc7a=_[_0xcb40('0x43')]({},_0x37dc7a,_0x56e99a['options']);return db[_0xcb40('0x2f')][_0xcb40('0x4a')](_0x37dc7a)[_0xcb40('0x28')](handleEntityNotFound(_0x28cea1,null))[_0xcb40('0x28')](respondWithResult(_0x28cea1,null))[_0xcb40('0x4b')](handleError(_0x28cea1,null));};exports[_0xcb40('0x26')]=function(_0x55cd8e,_0xb99035){if(_0x55cd8e[_0xcb40('0x4c')]['id']){delete _0x55cd8e[_0xcb40('0x4c')]['id'];}return db['CannedAnswer'][_0xcb40('0x4a')]({'where':{'id':_0x55cd8e[_0xcb40('0x47')]['id']}})[_0xcb40('0x28')](handleEntityNotFound(_0xb99035,null))[_0xcb40('0x28')](saveUpdates(_0x55cd8e[_0xcb40('0x4c')],null))[_0xcb40('0x28')](respondWithResult(_0xb99035,null))[_0xcb40('0x4b')](handleError(_0xb99035,null));};exports['destroy']=function(_0x5e7b7c,_0x5f32f2){return db[_0xcb40('0x2f')]['find']({'where':{'id':_0x5e7b7c[_0xcb40('0x47')]['id']}})['then'](handleEntityNotFound(_0x5f32f2,null))['then'](removeEntity(_0x5f32f2,null))[_0xcb40('0x4b')](handleError(_0x5f32f2,null));};exports['create']=function(_0x4c2a08,_0x23acaf){var _0x39c01d={'key':_0x4c2a08[_0xcb40('0x4c')][_0xcb40('0x32')]};if(_0x4c2a08['body']['MailAccountId']){_0x39c01d[_0xcb40('0x4d')]=_0x4c2a08['body'][_0xcb40('0x4d')];}else if(_0x4c2a08[_0xcb40('0x4c')][_0xcb40('0x4e')]){_0x39c01d[_0xcb40('0x4e')]=_0x4c2a08[_0xcb40('0x4c')][_0xcb40('0x4e')];}else if(_0x4c2a08[_0xcb40('0x4c')][_0xcb40('0x4f')]){_0x39c01d[_0xcb40('0x4f')]=_0x4c2a08[_0xcb40('0x4c')][_0xcb40('0x4f')];}else if(_0x4c2a08[_0xcb40('0x4c')]['ChatWebsiteId']){_0x39c01d[_0xcb40('0x50')]=_0x4c2a08[_0xcb40('0x4c')][_0xcb40('0x50')];}return db[_0xcb40('0x2f')]['find']({'where':_0x39c01d})[_0xcb40('0x28')](function(_0x135d31){if(_0x135d31){throw new db[(_0xcb40('0x51'))]['ValidationError'](_0xcb40('0x52'));}return db[_0xcb40('0x2f')][_0xcb40('0x53')](_0x4c2a08[_0xcb40('0x4c')]);})[_0xcb40('0x28')](function(_0x109737){var _0x7a8df1=_0x4c2a08[_0xcb40('0x54')][_0xcb40('0x29')]({'plain':!![]});if(!_0x7a8df1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7a8df1[_0xcb40('0x55')]===_0xcb40('0x54')){var _0x3183c6=_0x109737[_0xcb40('0x29')]({'plain':!![]});return db[_0xcb40('0x56')][_0xcb40('0x4a')]({'where':{'name':_0xcb40('0x57'),'userProfileId':_0x7a8df1[_0xcb40('0x58')]},'raw':!![]})['then'](function(_0x31acdd){if(_0x31acdd&&_0x31acdd[_0xcb40('0x59')]===0x0){return db[_0xcb40('0x2a')][_0xcb40('0x53')]({'name':_0x3183c6['name'],'resourceId':_0x3183c6['id'],'type':_0x31acdd['name'],'sectionId':_0x31acdd['id']},{})[_0xcb40('0x28')](function(){return _0x109737;});}else{return _0x109737;}})[_0xcb40('0x4b')](function(_0x565550){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x565550);throw _0x565550;});}return _0x109737;})[_0xcb40('0x28')](respondWithResult(_0x23acaf,0xc9))['catch'](handleError(_0x23acaf,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index a526c9c..0d79ced 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 _0xb861=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x55276f,_0x19a1d5){var _0x238cb8=function(_0x12c9b1){while(--_0x12c9b1){_0x55276f['push'](_0x55276f['shift']());}};_0x238cb8(++_0x19a1d5);}(_0xb861,0x9c));var _0x1b86=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0xb861[_0x868b7c];return _0x21683c;};'use strict';var _=require(_0x1b86('0x0'));var util=require(_0x1b86('0x1'));var logger=require(_0x1b86('0x2'))('api');var moment=require(_0x1b86('0x3'));var BPromise=require(_0x1b86('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b86('0x5'));var rimraf=require(_0x1b86('0x6'));var config=require(_0x1b86('0x7'));var attributes=require(_0x1b86('0x8'));module['exports']=function(_0x13191c,_0x274531){return _0x13191c[_0x1b86('0x9')](_0x1b86('0xa'),attributes,{'tableName':_0x1b86('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1b86('0xc')});}; \ No newline at end of file +var _0x0444=['../../config/environment','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x476034,_0x392c3b){var _0x5ac058=function(_0x8eb267){while(--_0x8eb267){_0x476034['push'](_0x476034['shift']());}};_0x5ac058(++_0x392c3b);}(_0x0444,0xbd));var _0x4044=function(_0x42f8a0,_0x238975){_0x42f8a0=_0x42f8a0-0x0;var _0x1c6142=_0x0444[_0x42f8a0];return _0x1c6142;};'use strict';var _=require(_0x4044('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4044('0x1'));var moment=require(_0x4044('0x2'));var BPromise=require(_0x4044('0x3'));var rp=require(_0x4044('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4044('0x5'));var config=require(_0x4044('0x6'));var attributes=require(_0x4044('0x7'));module[_0x4044('0x8')]=function(_0x14b919,_0x4acfb2){return _0x14b919[_0x4044('0x9')]('CannedAnswer',attributes,{'tableName':_0x4044('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4044('0xb'),'collate':_0x4044('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index cae42df..383772c 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(_0x53c71b,_0x4584d3){var _0x3cfbc2=function(_0x1901cb){while(--_0x1901cb){_0x53c71b['push'](_0x53c71b['shift']());}};_0x3cfbc2(++_0x4584d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x2e5858,_0x4d3916){var _0xdd483b=function(_0x261103){while(--_0x261103){_0x2e5858['push'](_0x2e5858['shift']());}};_0xdd483b(++_0x4d3916);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 87de7f2..8248c34 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 _0x3c17=['../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x3c17,0xfc));var _0x73c1=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x3c17[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x73c1('0x0'));var util=require(_0x73c1('0x1'));var path=require(_0x73c1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x73c1('0x3'));var interaction=require(_0x73c1('0x4'));var config=require('../../config/environment');var controller=require(_0x73c1('0x5'));router[_0x73c1('0x6')]('/',auth[_0x73c1('0x7')](),controller[_0x73c1('0x8')]);router['get'](_0x73c1('0x9'),auth[_0x73c1('0x7')](),controller['show']);router[_0x73c1('0xa')]('/',auth[_0x73c1('0x7')](),controller[_0x73c1('0xb')]);router[_0x73c1('0xc')]('/:id',auth[_0x73c1('0x7')](),controller[_0x73c1('0xd')]);router[_0x73c1('0xe')](_0x73c1('0x9'),auth[_0x73c1('0x7')](),controller[_0x73c1('0xf')]);module[_0x73c1('0x10')]=router; \ No newline at end of file +var _0xa995=['isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x576f03,_0x2f7bed){var _0x5da5b6=function(_0x1264a1){while(--_0x1264a1){_0x576f03['push'](_0x576f03['shift']());}};_0x5da5b6(++_0x2f7bed);}(_0xa995,0x1d1));var _0x5a99=function(_0x410f5c,_0x4c3367){_0x410f5c=_0x410f5c-0x0;var _0x139d66=_0xa995[_0x410f5c];return _0x139d66;};'use strict';var multer=require(_0x5a99('0x0'));var util=require(_0x5a99('0x1'));var path=require(_0x5a99('0x2'));var timeout=require(_0x5a99('0x3'));var express=require(_0x5a99('0x4'));var router=express['Router']();var fs_extra=require(_0x5a99('0x5'));var auth=require(_0x5a99('0x6'));var interaction=require(_0x5a99('0x7'));var config=require(_0x5a99('0x8'));var controller=require('./cannedAnswer.controller');router[_0x5a99('0x9')]('/',auth[_0x5a99('0xa')](),controller[_0x5a99('0xb')]);router['get'](_0x5a99('0xc'),auth[_0x5a99('0xa')](),controller[_0x5a99('0xd')]);router['post']('/',auth[_0x5a99('0xa')](),controller[_0x5a99('0xe')]);router['put'](_0x5a99('0xc'),auth['isAuthenticated'](),controller[_0x5a99('0xf')]);router[_0x5a99('0x10')](_0x5a99('0xc'),auth[_0x5a99('0xa')](),controller[_0x5a99('0x11')]);module[_0x5a99('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 1722faa..b69553c 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 _0x520e=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x33c637,_0x597c26){var _0x14aa20=function(_0x32a8b5){while(--_0x32a8b5){_0x33c637['push'](_0x33c637['shift']());}};_0x14aa20(++_0x597c26);}(_0x520e,0x90));var _0xe520=function(_0x4dbba7,_0x34d6d1){_0x4dbba7=_0x4dbba7-0x0;var _0x43ef83=_0x520e[_0x4dbba7];return _0x43ef83;};'use strict';var Sequelize=require(_0xe520('0x0'));module[_0xe520('0x1')]={'calldate':{'type':Sequelize[_0xe520('0x2')],'allowNull':![],'defaultValue':_0xe520('0x3')},'clid':{'type':Sequelize[_0xe520('0x4')]},'src':{'type':Sequelize[_0xe520('0x4')]},'dst':{'type':Sequelize[_0xe520('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe520('0x4')]},'dstchannel':{'type':Sequelize[_0xe520('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe520('0x4')]},'duration':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe520('0x4')]},'amaflags':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe520('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe520('0x4')]},'linkedid':{'type':Sequelize[_0xe520('0x4')]},'sequence':{'type':Sequelize[_0xe520('0x4')]},'peeraccount':{'type':Sequelize[_0xe520('0x4')]},'type':{'type':Sequelize[_0xe520('0x4')]},'tag':{'type':Sequelize[_0xe520('0x4')]}}; \ No newline at end of file +var _0xdf71=['INTEGER','sequelize','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x1a2830,_0x539a1d){var _0x109684=function(_0x3b04d8){while(--_0x3b04d8){_0x1a2830['push'](_0x1a2830['shift']());}};_0x109684(++_0x539a1d);}(_0xdf71,0x1d2));var _0x1df7=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0xdf71[_0xc20f22];return _0x1535d5;};'use strict';var Sequelize=require(_0x1df7('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x1df7('0x1')],'allowNull':![],'defaultValue':_0x1df7('0x2')},'clid':{'type':Sequelize[_0x1df7('0x3')]},'src':{'type':Sequelize[_0x1df7('0x3')]},'dst':{'type':Sequelize[_0x1df7('0x3')]},'dcontext':{'type':Sequelize[_0x1df7('0x3')]},'channel':{'type':Sequelize[_0x1df7('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x1df7('0x3')]},'lastdata':{'type':Sequelize[_0x1df7('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1df7('0x3')]},'amaflags':{'type':Sequelize[_0x1df7('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x1df7('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x1df7('0x3')]},'sequence':{'type':Sequelize[_0x1df7('0x3')]},'peeraccount':{'type':Sequelize[_0x1df7('0x3')]},'type':{'type':Sequelize[_0x1df7('0x3')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 60d17a8..ef37207 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 _0xe132=['model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','end','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key'];(function(_0x48b5e0,_0xb3826){var _0x4287ea=function(_0x14519e){while(--_0x14519e){_0x48b5e0['push'](_0x48b5e0['shift']());}};_0x4287ea(++_0xb3826);}(_0xe132,0x162));var _0x2e13=function(_0x13bf6e,_0x5751dd){_0x13bf6e=_0x13bf6e-0x0;var _0x546a7d=_0xe132[_0x13bf6e];return _0x546a7d;};'use strict';var emlformat=require(_0x2e13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2e13('0x1'));var jsonpatch=require(_0x2e13('0x2'));var rp=require(_0x2e13('0x3'));var moment=require(_0x2e13('0x4'));var BPromise=require(_0x2e13('0x5'));var Mustache=require('mustache');var util=require(_0x2e13('0x6'));var path=require(_0x2e13('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2e13('0x8'));var fs=require('fs');var fs_extra=require(_0x2e13('0x9'));var _=require(_0x2e13('0xa'));var squel=require(_0x2e13('0xb'));var crypto=require(_0x2e13('0xc'));var jsforce=require(_0x2e13('0xd'));var deskjs=require(_0x2e13('0xe'));var toCsv=require(_0x2e13('0xf'));var querystring=require(_0x2e13('0x10'));var Papa=require(_0x2e13('0x11'));var Redis=require('ioredis');var authService=require(_0x2e13('0x12'));var qs=require(_0x2e13('0x13'));var as=require(_0x2e13('0x14'));var hardwareService=require(_0x2e13('0x15'));var logger=require(_0x2e13('0x16'))(_0x2e13('0x17'));var utils=require(_0x2e13('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2e13('0x19'));var db=require(_0x2e13('0x1a'))['db'];function respondWithStatusCode(_0x320303,_0x299dd3){_0x299dd3=_0x299dd3||0xcc;return function(_0x424e58){if(_0x424e58){return _0x320303[_0x2e13('0x1b')](_0x299dd3);}return _0x320303[_0x2e13('0x1c')](_0x299dd3)['end']();};}function respondWithResult(_0xb70eb8,_0xea6c20){_0xea6c20=_0xea6c20||0xc8;return function(_0xfaca18){if(_0xfaca18){return _0xb70eb8['status'](_0xea6c20)[_0x2e13('0x1d')](_0xfaca18);}};}function respondWithFilteredResult(_0x2a58e5,_0x433bbd){return function(_0x5e96a5){if(_0x5e96a5){var _0xd25628=typeof _0x433bbd[_0x2e13('0x1e')]===_0x2e13('0x1f')&&typeof _0x433bbd['limit']==='undefined';var _0x2a3007=_0x5e96a5[_0x2e13('0x20')];var _0x336a10=_0xd25628?0x0:_0x433bbd[_0x2e13('0x1e')];var _0x399ce2=_0xd25628?_0x5e96a5[_0x2e13('0x20')]:_0x433bbd[_0x2e13('0x1e')]+_0x433bbd[_0x2e13('0x21')];var _0x4ae5e5;if(_0x399ce2>=_0x2a3007){_0x399ce2=_0x2a3007;_0x4ae5e5=0xc8;}else{_0x4ae5e5=0xce;}_0x2a58e5[_0x2e13('0x1c')](_0x4ae5e5);return _0x2a58e5[_0x2e13('0x22')](_0x2e13('0x23'),_0x336a10+'-'+_0x399ce2+'/'+_0x2a3007)[_0x2e13('0x1d')](_0x5e96a5);}return null;};}function patchUpdates(_0x479013){return function(_0x5d6938){try{jsonpatch[_0x2e13('0x24')](_0x5d6938,_0x479013,!![]);}catch(_0x1a05a4){return BPromise['reject'](_0x1a05a4);}return _0x5d6938['save']();};}function saveUpdates(_0x584040,_0x30f744){return function(_0x2b55a7){if(_0x2b55a7){return _0x2b55a7[_0x2e13('0x25')](_0x584040)[_0x2e13('0x26')](function(_0x17b453){return _0x17b453;});}return null;};}function removeEntity(_0x2416b3,_0x5ce58b){return function(_0x1482fc){if(_0x1482fc){return _0x1482fc[_0x2e13('0x27')]()[_0x2e13('0x26')](function(){_0x2416b3[_0x2e13('0x1c')](0xcc)[_0x2e13('0x28')]();});}};}function handleEntityNotFound(_0x3e5c24,_0x5cad4b){return function(_0x341ae7){if(!_0x341ae7){_0x3e5c24[_0x2e13('0x1b')](0x194);}return _0x341ae7;};}function handleError(_0x57aab0,_0x538984){_0x538984=_0x538984||0x1f4;return function(_0x15c555){logger[_0x2e13('0x29')](_0x15c555[_0x2e13('0x2a')]);if(_0x15c555['name']){delete _0x15c555[_0x2e13('0x2b')];}_0x57aab0[_0x2e13('0x1c')](_0x538984)[_0x2e13('0x2c')](_0x15c555);};}exports[_0x2e13('0x2d')]=function(_0x2c6e04,_0x428289){var _0x103867={},_0x19ee97={},_0x31f448={'count':0x0,'rows':[]};var _0x6e09d9=_[_0x2e13('0x2e')](db[_0x2e13('0x2f')][_0x2e13('0x30')],function(_0x28e2bf){return{'name':_0x28e2bf[_0x2e13('0x31')],'type':_0x28e2bf['type'][_0x2e13('0x32')]};});_0x19ee97[_0x2e13('0x33')]=_[_0x2e13('0x2e')](_0x6e09d9,'name');_0x19ee97['query']=_[_0x2e13('0x34')](_0x2c6e04[_0x2e13('0x35')]);_0x19ee97[_0x2e13('0x36')]=_[_0x2e13('0x37')](_0x19ee97[_0x2e13('0x33')],_0x19ee97[_0x2e13('0x35')]);_0x103867['attributes']=_['intersection'](_0x19ee97[_0x2e13('0x33')],qs[_0x2e13('0x38')](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x38')]));_0x103867[_0x2e13('0x39')]=_0x103867[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x103867[_0x2e13('0x39')]:_0x19ee97['model'];if(!_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3b')](_0x2e13('0x3c'))){_0x103867[_0x2e13('0x21')]=qs[_0x2e13('0x21')](_0x2c6e04['query'][_0x2e13('0x21')]);_0x103867[_0x2e13('0x1e')]=qs['offset'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x1e')]);}_0x103867[_0x2e13('0x3d')]=qs['sort'](_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x3e')]);_0x103867['where']=qs[_0x2e13('0x36')](_[_0x2e13('0x3f')](_0x2c6e04['query'],_0x19ee97[_0x2e13('0x36')]),_0x6e09d9);if(_0x2c6e04['query'][_0x2e13('0x40')]){_0x103867[_0x2e13('0x41')]=_['merge'](_0x103867[_0x2e13('0x41')],{'$or':_[_0x2e13('0x2e')](_0x6e09d9,function(_0x3839b9){if(_0x3839b9[_0x2e13('0x42')]!==_0x2e13('0x43')){var _0x778214={};_0x778214[_0x3839b9[_0x2e13('0x2b')]]={'$like':'%'+_0x2c6e04[_0x2e13('0x35')][_0x2e13('0x40')]+'%'};return _0x778214;}})});}_0x103867=_[_0x2e13('0x44')]({},_0x103867,_0x2c6e04['options']);var _0x24ebb6={'where':_0x103867[_0x2e13('0x41')]};return db[_0x2e13('0x2f')][_0x2e13('0x20')](_0x24ebb6)[_0x2e13('0x26')](function(_0x4b23ca){_0x31f448[_0x2e13('0x20')]=_0x4b23ca;if(_0x2c6e04['query'][_0x2e13('0x45')]){_0x103867[_0x2e13('0x46')]=[{'all':!![]}];}return db['Cdr'][_0x2e13('0x47')](_0x103867);})['then'](function(_0x73f6a2){_0x31f448[_0x2e13('0x48')]=_0x73f6a2;return _0x31f448;})[_0x2e13('0x26')](respondWithFilteredResult(_0x428289,_0x103867))[_0x2e13('0x49')](handleError(_0x428289,null));};exports[_0x2e13('0x4a')]=function(_0x52b1a0,_0x425c97){var _0x499a56={'raw':!![],'where':{'id':_0x52b1a0[_0x2e13('0x4b')]['id']}},_0x10a1ab={};_0x10a1ab[_0x2e13('0x33')]=_[_0x2e13('0x34')](db[_0x2e13('0x2f')][_0x2e13('0x30')]);_0x10a1ab['query']=_['keys'](_0x52b1a0[_0x2e13('0x35')]);_0x10a1ab[_0x2e13('0x36')]=_['intersection'](_0x10a1ab[_0x2e13('0x33')],_0x10a1ab[_0x2e13('0x35')]);_0x499a56[_0x2e13('0x39')]=_['intersection'](_0x10a1ab['model'],qs[_0x2e13('0x38')](_0x52b1a0['query']['fields']));_0x499a56[_0x2e13('0x39')]=_0x499a56[_0x2e13('0x39')][_0x2e13('0x3a')]?_0x499a56['attributes']:_0x10a1ab[_0x2e13('0x33')];if(_0x52b1a0[_0x2e13('0x35')][_0x2e13('0x45')]){_0x499a56[_0x2e13('0x46')]=[{'all':!![]}];}_0x499a56=_['merge']({},_0x499a56,_0x52b1a0[_0x2e13('0x4c')]);return db['Cdr'][_0x2e13('0x4d')](_0x499a56)[_0x2e13('0x26')](handleEntityNotFound(_0x425c97,null))[_0x2e13('0x26')](respondWithResult(_0x425c97,null))[_0x2e13('0x49')](handleError(_0x425c97,null));};exports[_0x2e13('0x4e')]=function(_0x3be877,_0x961af7){return db[_0x2e13('0x2f')][_0x2e13('0x4e')](_0x3be877[_0x2e13('0x4f')],{})['then'](respondWithResult(_0x961af7,0xc9))[_0x2e13('0x49')](handleError(_0x961af7,null));};exports[_0x2e13('0x25')]=function(_0x4780b7,_0x1d13ec){if(_0x4780b7[_0x2e13('0x4f')]['id']){delete _0x4780b7[_0x2e13('0x4f')]['id'];}return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x4780b7[_0x2e13('0x4b')]['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0x1d13ec,null))[_0x2e13('0x26')](saveUpdates(_0x4780b7[_0x2e13('0x4f')],null))['then'](respondWithResult(_0x1d13ec,null))[_0x2e13('0x49')](handleError(_0x1d13ec,null));};exports[_0x2e13('0x27')]=function(_0x39cef0,_0xf40f35){return db[_0x2e13('0x2f')][_0x2e13('0x4d')]({'where':{'id':_0x39cef0['params']['id']}})[_0x2e13('0x26')](handleEntityNotFound(_0xf40f35,null))[_0x2e13('0x26')](removeEntity(_0xf40f35,null))[_0x2e13('0x49')](handleError(_0xf40f35,null));};exports[_0x2e13('0x50')]=function(_0x2a9587,_0x13b4f4){return db[_0x2e13('0x2f')]['describe']()[_0x2e13('0x26')](respondWithResult(_0x13b4f4,null))[_0x2e13('0x49')](handleError(_0x13b4f4,null));}; \ No newline at end of file +var _0x5fd1=['fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','Cdr','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs'];(function(_0x60e184,_0xa63867){var _0x4291e1=function(_0x511615){while(--_0x511615){_0x60e184['push'](_0x60e184['shift']());}};_0x4291e1(++_0xa63867);}(_0x5fd1,0x155));var _0x15fd=function(_0x437e80,_0x3434e1){_0x437e80=_0x437e80-0x0;var _0x5d603b=_0x5fd1[_0x437e80];return _0x5d603b;};'use strict';var emlformat=require(_0x15fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x15fd('0x1'));var jsonpatch=require(_0x15fd('0x2'));var rp=require(_0x15fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x15fd('0x4'));var util=require(_0x15fd('0x5'));var path=require(_0x15fd('0x6'));var sox=require('sox');var csv=require(_0x15fd('0x7'));var ejs=require(_0x15fd('0x8'));var fs=require('fs');var fs_extra=require(_0x15fd('0x9'));var _=require(_0x15fd('0xa'));var squel=require(_0x15fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x15fd('0xc'));var deskjs=require(_0x15fd('0xd'));var toCsv=require(_0x15fd('0x7'));var querystring=require('querystring');var Papa=require(_0x15fd('0xe'));var Redis=require('ioredis');var authService=require(_0x15fd('0xf'));var qs=require(_0x15fd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15fd('0x11'));var utils=require(_0x15fd('0x12'));var config=require(_0x15fd('0x13'));var licenseUtil=require(_0x15fd('0x14'));var db=require(_0x15fd('0x15'))['db'];function respondWithStatusCode(_0x2e18ec,_0x346ab1){_0x346ab1=_0x346ab1||0xcc;return function(_0x2660db){if(_0x2660db){return _0x2e18ec[_0x15fd('0x16')](_0x346ab1);}return _0x2e18ec['status'](_0x346ab1)['end']();};}function respondWithResult(_0x5784a3,_0x3fda60){_0x3fda60=_0x3fda60||0xc8;return function(_0x135a15){if(_0x135a15){return _0x5784a3[_0x15fd('0x17')](_0x3fda60)[_0x15fd('0x18')](_0x135a15);}};}function respondWithFilteredResult(_0x44eae6,_0x2ffa03){return function(_0x2c5375){if(_0x2c5375){var _0x44a63a=typeof _0x2ffa03['offset']==='undefined'&&typeof _0x2ffa03[_0x15fd('0x19')]==='undefined';var _0x7afe9c=_0x2c5375['count'];var _0x917fe4=_0x44a63a?0x0:_0x2ffa03[_0x15fd('0x1a')];var _0x855bae=_0x44a63a?_0x2c5375['count']:_0x2ffa03[_0x15fd('0x1a')]+_0x2ffa03[_0x15fd('0x19')];var _0x8b7b9e;if(_0x855bae>=_0x7afe9c){_0x855bae=_0x7afe9c;_0x8b7b9e=0xc8;}else{_0x8b7b9e=0xce;}_0x44eae6[_0x15fd('0x17')](_0x8b7b9e);return _0x44eae6[_0x15fd('0x1b')](_0x15fd('0x1c'),_0x917fe4+'-'+_0x855bae+'/'+_0x7afe9c)[_0x15fd('0x18')](_0x2c5375);}return null;};}function patchUpdates(_0x2f46f1){return function(_0x1b8b9f){try{jsonpatch[_0x15fd('0x1d')](_0x1b8b9f,_0x2f46f1,!![]);}catch(_0x3ff307){return BPromise['reject'](_0x3ff307);}return _0x1b8b9f['save']();};}function saveUpdates(_0x293d7b,_0x36b21e){return function(_0x252a1c){if(_0x252a1c){return _0x252a1c[_0x15fd('0x1e')](_0x293d7b)[_0x15fd('0x1f')](function(_0x11496a){return _0x11496a;});}return null;};}function removeEntity(_0x2073da,_0x50d493){return function(_0x40d43){if(_0x40d43){return _0x40d43[_0x15fd('0x20')]()[_0x15fd('0x1f')](function(){_0x2073da['status'](0xcc)[_0x15fd('0x21')]();});}};}function handleEntityNotFound(_0x49062f,_0x3d1835){return function(_0x1fc24f){if(!_0x1fc24f){_0x49062f[_0x15fd('0x16')](0x194);}return _0x1fc24f;};}function handleError(_0x4c9708,_0x16b87c){_0x16b87c=_0x16b87c||0x1f4;return function(_0x1cbf2c){logger[_0x15fd('0x22')](_0x1cbf2c['stack']);if(_0x1cbf2c[_0x15fd('0x23')]){delete _0x1cbf2c['name'];}_0x4c9708[_0x15fd('0x17')](_0x16b87c)[_0x15fd('0x24')](_0x1cbf2c);};}exports[_0x15fd('0x25')]=function(_0x27d2c4,_0x233ed3){var _0x6c213b={},_0x218034={},_0xe650a3={'count':0x0,'rows':[]};var _0x4590a1=_[_0x15fd('0x26')](db[_0x15fd('0x27')]['rawAttributes'],function(_0x47c22c){return{'name':_0x47c22c[_0x15fd('0x28')],'type':_0x47c22c['type'][_0x15fd('0x29')]};});_0x218034[_0x15fd('0x2a')]=_['map'](_0x4590a1,_0x15fd('0x23'));_0x218034[_0x15fd('0x2b')]=_['keys'](_0x27d2c4[_0x15fd('0x2b')]);_0x218034[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x218034[_0x15fd('0x2a')],_0x218034[_0x15fd('0x2b')]);_0x6c213b[_0x15fd('0x2e')]=_['intersection'](_0x218034[_0x15fd('0x2a')],qs[_0x15fd('0x2f')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x2f')]));_0x6c213b['attributes']=_0x6c213b[_0x15fd('0x2e')][_0x15fd('0x30')]?_0x6c213b[_0x15fd('0x2e')]:_0x218034[_0x15fd('0x2a')];if(!_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x31')]('nolimit')){_0x6c213b[_0x15fd('0x19')]=qs[_0x15fd('0x19')](_0x27d2c4['query'][_0x15fd('0x19')]);_0x6c213b[_0x15fd('0x1a')]=qs[_0x15fd('0x1a')](_0x27d2c4['query'][_0x15fd('0x1a')]);}_0x6c213b[_0x15fd('0x32')]=qs[_0x15fd('0x33')](_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x33')]);_0x6c213b[_0x15fd('0x34')]=qs['filters'](_['pick'](_0x27d2c4['query'],_0x218034[_0x15fd('0x2c')]),_0x4590a1);if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x35')]){_0x6c213b['where']=_['merge'](_0x6c213b[_0x15fd('0x34')],{'$or':_['map'](_0x4590a1,function(_0x4f1c84){if(_0x4f1c84['type']!==_0x15fd('0x36')){var _0x10702c={};_0x10702c[_0x4f1c84[_0x15fd('0x23')]]={'$like':'%'+_0x27d2c4['query'][_0x15fd('0x35')]+'%'};return _0x10702c;}})});}_0x6c213b=_[_0x15fd('0x37')]({},_0x6c213b,_0x27d2c4[_0x15fd('0x38')]);var _0x5beb6e={'where':_0x6c213b[_0x15fd('0x34')]};return db[_0x15fd('0x27')][_0x15fd('0x39')](_0x5beb6e)[_0x15fd('0x1f')](function(_0x2e8b0a){_0xe650a3[_0x15fd('0x39')]=_0x2e8b0a;if(_0x27d2c4[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x6c213b[_0x15fd('0x3b')]=[{'all':!![]}];}return db['Cdr'][_0x15fd('0x3c')](_0x6c213b);})[_0x15fd('0x1f')](function(_0x180433){_0xe650a3[_0x15fd('0x3d')]=_0x180433;return _0xe650a3;})[_0x15fd('0x1f')](respondWithFilteredResult(_0x233ed3,_0x6c213b))[_0x15fd('0x3e')](handleError(_0x233ed3,null));};exports[_0x15fd('0x3f')]=function(_0xda4ca2,_0x343ce6){var _0x104eef={'raw':!![],'where':{'id':_0xda4ca2[_0x15fd('0x40')]['id']}},_0x2eb6b6={};_0x2eb6b6[_0x15fd('0x2a')]=_[_0x15fd('0x41')](db[_0x15fd('0x27')]['rawAttributes']);_0x2eb6b6[_0x15fd('0x2b')]=_[_0x15fd('0x41')](_0xda4ca2[_0x15fd('0x2b')]);_0x2eb6b6[_0x15fd('0x2c')]=_[_0x15fd('0x2d')](_0x2eb6b6[_0x15fd('0x2a')],_0x2eb6b6[_0x15fd('0x2b')]);_0x104eef[_0x15fd('0x2e')]=_['intersection'](_0x2eb6b6['model'],qs[_0x15fd('0x2f')](_0xda4ca2['query'][_0x15fd('0x2f')]));_0x104eef[_0x15fd('0x2e')]=_0x104eef['attributes'][_0x15fd('0x30')]?_0x104eef[_0x15fd('0x2e')]:_0x2eb6b6[_0x15fd('0x2a')];if(_0xda4ca2[_0x15fd('0x2b')][_0x15fd('0x3a')]){_0x104eef[_0x15fd('0x3b')]=[{'all':!![]}];}_0x104eef=_['merge']({},_0x104eef,_0xda4ca2[_0x15fd('0x38')]);return db[_0x15fd('0x27')][_0x15fd('0x42')](_0x104eef)[_0x15fd('0x1f')](handleEntityNotFound(_0x343ce6,null))[_0x15fd('0x1f')](respondWithResult(_0x343ce6,null))[_0x15fd('0x3e')](handleError(_0x343ce6,null));};exports[_0x15fd('0x43')]=function(_0xffc5dc,_0x24cb44){return db[_0x15fd('0x27')][_0x15fd('0x43')](_0xffc5dc[_0x15fd('0x44')],{})['then'](respondWithResult(_0x24cb44,0xc9))[_0x15fd('0x3e')](handleError(_0x24cb44,null));};exports['update']=function(_0x284f51,_0x34c250){if(_0x284f51[_0x15fd('0x44')]['id']){delete _0x284f51['body']['id'];}return db[_0x15fd('0x27')][_0x15fd('0x42')]({'where':{'id':_0x284f51[_0x15fd('0x40')]['id']}})[_0x15fd('0x1f')](handleEntityNotFound(_0x34c250,null))['then'](saveUpdates(_0x284f51[_0x15fd('0x44')],null))[_0x15fd('0x1f')](respondWithResult(_0x34c250,null))[_0x15fd('0x3e')](handleError(_0x34c250,null));};exports[_0x15fd('0x20')]=function(_0x4b6827,_0x56c6be){return db[_0x15fd('0x27')]['find']({'where':{'id':_0x4b6827['params']['id']}})['then'](handleEntityNotFound(_0x56c6be,null))[_0x15fd('0x1f')](removeEntity(_0x56c6be,null))[_0x15fd('0x3e')](handleError(_0x56c6be,null));};exports[_0x15fd('0x45')]=function(_0x10cf04,_0x292174){return db[_0x15fd('0x27')]['describe']()[_0x15fd('0x1f')](respondWithResult(_0x292174,null))[_0x15fd('0x3e')](handleError(_0x292174,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 288bf76..4fbad72 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5a4a1f,_0x3f90b6){var _0x43db26=function(_0x2824f5){while(--_0x2824f5){_0x5a4a1f['push'](_0x5a4a1f['shift']());}};_0x43db26(++_0x3f90b6);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0xb86618,_0x379810){var _0x446e27=function(_0x457d5b){while(--_0x457d5b){_0xb86618['push'](_0xb86618['shift']());}};_0x446e27(++_0x379810);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 88a528d..a42c63e 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 _0x136b=['Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info'];(function(_0x50e40b,_0x338d17){var _0x2608b7=function(_0x4ded5e){while(--_0x4ded5e){_0x50e40b['push'](_0x50e40b['shift']());}};_0x2608b7(++_0x338d17);}(_0x136b,0xe5));var _0xb136=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x136b[_0x521929];return _0x632436;};'use strict';var _=require('lodash');var util=require(_0xb136('0x0'));var moment=require('moment');var BPromise=require(_0xb136('0x1'));var rs=require(_0xb136('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb136('0x3'))['db'];var utils=require(_0xb136('0x4'));var logger=require('../../config/logger')(_0xb136('0x5'));var config=require(_0xb136('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb136('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f7963,_0x48b747,_0x3222ab){return new BPromise(function(_0x39d57d,_0x1aa303){return client[_0xb136('0x8')](_0x4f7963,_0x3222ab)[_0xb136('0x9')](function(_0x29ff77){logger[_0xb136('0xa')](_0xb136('0xb'),_0x48b747,_0xb136('0xc'));logger[_0xb136('0xd')](_0xb136('0xe'),_0x48b747,_0xb136('0xc'),JSON[_0xb136('0xf')](_0x29ff77));if(_0x29ff77[_0xb136('0x10')]){if(_0x29ff77[_0xb136('0x10')][_0xb136('0x11')]===0x1f4){logger['error'](_0xb136('0xb'),_0x48b747,_0x29ff77[_0xb136('0x10')]['message']);return _0x1aa303(_0x29ff77[_0xb136('0x10')][_0xb136('0x12')]);}logger[_0xb136('0x10')]('Cdr,\x20%s,\x20%s',_0x48b747,_0x29ff77[_0xb136('0x10')][_0xb136('0x12')]);return _0x39d57d(_0x29ff77[_0xb136('0x10')][_0xb136('0x12')]);}else{logger[_0xb136('0xa')]('Cdr,\x20%s,\x20%s',_0x48b747,'request\x20sent');_0x39d57d(_0x29ff77[_0xb136('0x13')][_0xb136('0x12')]);}})['catch'](function(_0x365079){logger[_0xb136('0x10')](_0xb136('0xb'),_0x48b747,_0x365079);_0x1aa303(_0x365079);});});} \ No newline at end of file +var _0x8bce=['then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x43cba5,_0x4a2f83){var _0x359d1a=function(_0x888a02){while(--_0x888a02){_0x43cba5['push'](_0x43cba5['shift']());}};_0x359d1a(++_0x4a2f83);}(_0x8bce,0x78));var _0xe8bc=function(_0x5f5be3,_0x5bec6e){_0x5f5be3=_0x5f5be3-0x0;var _0xbb0d5e=_0x8bce[_0x5f5be3];return _0xbb0d5e;};'use strict';var _=require(_0xe8bc('0x0'));var util=require('util');var moment=require(_0xe8bc('0x1'));var BPromise=require(_0xe8bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe8bc('0x3'));var db=require(_0xe8bc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8bc('0x5'))(_0xe8bc('0x6'));var config=require(_0xe8bc('0x7'));var jayson=require(_0xe8bc('0x8'));var client=jayson[_0xe8bc('0x9')][_0xe8bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52960c,_0x3927ba,_0xceda8d){return new BPromise(function(_0x1c69ee,_0x2f3d4d){return client[_0xe8bc('0xb')](_0x52960c,_0xceda8d)[_0xe8bc('0xc')](function(_0x264091){logger[_0xe8bc('0xd')](_0xe8bc('0xe'),_0x3927ba,_0xe8bc('0xf'));logger[_0xe8bc('0x10')](_0xe8bc('0x11'),_0x3927ba,_0xe8bc('0xf'),JSON['stringify'](_0x264091));if(_0x264091[_0xe8bc('0x12')]){if(_0x264091[_0xe8bc('0x12')][_0xe8bc('0x13')]===0x1f4){logger[_0xe8bc('0x12')](_0xe8bc('0xe'),_0x3927ba,_0x264091['error'][_0xe8bc('0x14')]);return _0x2f3d4d(_0x264091[_0xe8bc('0x12')]['message']);}logger[_0xe8bc('0x12')]('Cdr,\x20%s,\x20%s',_0x3927ba,_0x264091[_0xe8bc('0x12')][_0xe8bc('0x14')]);return _0x1c69ee(_0x264091[_0xe8bc('0x12')]['message']);}else{logger['info'](_0xe8bc('0xe'),_0x3927ba,_0xe8bc('0xf'));_0x1c69ee(_0x264091[_0xe8bc('0x15')]['message']);}})['catch'](function(_0x2c5e09){logger[_0xe8bc('0x12')](_0xe8bc('0xe'),_0x3927ba,_0x2c5e09);_0x2f3d4d(_0x2c5e09);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index a362249..85db509 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(_0x566667,_0x3f99c2){var _0x277136=function(_0x129ea0){while(--_0x129ea0){_0x566667['push'](_0x566667['shift']());}};_0x277136(++_0x3f99c2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x158e6c,_0xaab4ed){var _0x3c26db=function(_0x3c57dd){while(--_0x3c57dd){_0x158e6c['push'](_0x158e6c['shift']());}};_0x3c26db(++_0xaab4ed);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 11d7793..beb2f07 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 _0xd060=['exports','STRING','noop','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd060,0x117));var _0x0d06=function(_0x4a2dbe,_0x4557db){_0x4a2dbe=_0x4a2dbe-0x0;var _0xdd1cad=_0xd060[_0x4a2dbe];return _0xdd1cad;};'use strict';var Sequelize=require(_0x0d06('0x0'));module[_0x0d06('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0d06('0x2')],'allowNull':![],'defaultValue':_0x0d06('0x3')},'appdata':{'type':Sequelize[_0x0d06('0x4')]()},'description':{'type':Sequelize[_0x0d06('0x2')]},'interval':{'type':Sequelize[_0x0d06('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x7cec=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x7cec,0x116));var _0xc7ce=function(_0xd9db83,_0x4b8efe){_0xd9db83=_0xd9db83-0x0;var _0xcc2cb=_0x7cec[_0xd9db83];return _0xcc2cb;};'use strict';var Sequelize=require(_0xc7ce('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc7ce('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc7ce('0x2')],'allowNull':![],'defaultValue':_0xc7ce('0x3')},'appdata':{'type':Sequelize[_0xc7ce('0x4')]()},'description':{'type':Sequelize[_0xc7ce('0x2')]},'interval':{'type':Sequelize[_0xc7ce('0x2')],'defaultValue':_0xc7ce('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 1a8fb81..ec6ca9b 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 _0x2572=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','limit','offset','count','set','Content-Range','json','apply','update','then','destroy','error','name','send','params','model','keys','ChatApplication','rawAttributes','query','intersection','fields','attributes','length','include','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x53d415,_0x253c03){var _0x325d61=function(_0x5a44b2){while(--_0x5a44b2){_0x53d415['push'](_0x53d415['shift']());}};_0x325d61(++_0x253c03);}(_0x2572,0x110));var _0x2257=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x2572[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0x2257('0x0'));var rimraf=require(_0x2257('0x1'));var zipdir=require(_0x2257('0x2'));var jsonpatch=require(_0x2257('0x3'));var rp=require(_0x2257('0x4'));var moment=require(_0x2257('0x5'));var BPromise=require(_0x2257('0x6'));var Mustache=require(_0x2257('0x7'));var util=require(_0x2257('0x8'));var path=require('path');var sox=require(_0x2257('0x9'));var csv=require(_0x2257('0xa'));var ejs=require(_0x2257('0xb'));var fs=require('fs');var fs_extra=require(_0x2257('0xc'));var _=require(_0x2257('0xd'));var squel=require(_0x2257('0xe'));var crypto=require(_0x2257('0xf'));var jsforce=require(_0x2257('0x10'));var deskjs=require(_0x2257('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2257('0x12'));var Papa=require(_0x2257('0x13'));var Redis=require('ioredis');var authService=require(_0x2257('0x14'));var qs=require(_0x2257('0x15'));var as=require(_0x2257('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2257('0x17'))(_0x2257('0x18'));var utils=require(_0x2257('0x19'));var config=require(_0x2257('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2257('0x1b'))['db'];function respondWithStatusCode(_0x5131bd,_0x578d2f){_0x578d2f=_0x578d2f||0xcc;return function(_0x7f8b71){if(_0x7f8b71){return _0x5131bd[_0x2257('0x1c')](_0x578d2f);}return _0x5131bd[_0x2257('0x1d')](_0x578d2f)[_0x2257('0x1e')]();};}function respondWithResult(_0x2e610e,_0x32fdfe){_0x32fdfe=_0x32fdfe||0xc8;return function(_0x1738a3){if(_0x1738a3){return _0x2e610e['status'](_0x32fdfe)['json'](_0x1738a3);}};}function respondWithFilteredResult(_0x3578db,_0x45efee){return function(_0x2b4102){if(_0x2b4102){var _0x156d68=typeof _0x45efee['offset']==='undefined'&&typeof _0x45efee[_0x2257('0x1f')]==='undefined';var _0x4cd932=_0x2b4102['count'];var _0x31c8c6=_0x156d68?0x0:_0x45efee[_0x2257('0x20')];var _0x31e8d0=_0x156d68?_0x2b4102[_0x2257('0x21')]:_0x45efee[_0x2257('0x20')]+_0x45efee[_0x2257('0x1f')];var _0x36224b;if(_0x31e8d0>=_0x4cd932){_0x31e8d0=_0x4cd932;_0x36224b=0xc8;}else{_0x36224b=0xce;}_0x3578db[_0x2257('0x1d')](_0x36224b);return _0x3578db[_0x2257('0x22')](_0x2257('0x23'),_0x31c8c6+'-'+_0x31e8d0+'/'+_0x4cd932)[_0x2257('0x24')](_0x2b4102);}return null;};}function patchUpdates(_0x263108){return function(_0x482240){try{jsonpatch[_0x2257('0x25')](_0x482240,_0x263108,!![]);}catch(_0x2e3d19){return BPromise['reject'](_0x2e3d19);}return _0x482240['save']();};}function saveUpdates(_0x56e513,_0x5ae577){return function(_0x31cd98){if(_0x31cd98){return _0x31cd98[_0x2257('0x26')](_0x56e513)[_0x2257('0x27')](function(_0x2a1aa7){return _0x2a1aa7;});}return null;};}function removeEntity(_0x137d53,_0x1e220c){return function(_0x1549aa){if(_0x1549aa){return _0x1549aa[_0x2257('0x28')]()[_0x2257('0x27')](function(){_0x137d53[_0x2257('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ab173,_0x227155){return function(_0x58e30d){if(!_0x58e30d){_0x3ab173[_0x2257('0x1c')](0x194);}return _0x58e30d;};}function handleError(_0x1590a6,_0x4e0eaf){_0x4e0eaf=_0x4e0eaf||0x1f4;return function(_0x1c1a76){logger[_0x2257('0x29')](_0x1c1a76['stack']);if(_0x1c1a76[_0x2257('0x2a')]){delete _0x1c1a76[_0x2257('0x2a')];}_0x1590a6[_0x2257('0x1d')](_0x4e0eaf)[_0x2257('0x2b')](_0x1c1a76);};}exports['show']=function(_0x8b9b1b,_0x8952ad){var _0x508cad={'raw':!![],'where':{'id':_0x8b9b1b[_0x2257('0x2c')]['id']}},_0x38e581={};_0x38e581[_0x2257('0x2d')]=_[_0x2257('0x2e')](db[_0x2257('0x2f')][_0x2257('0x30')]);_0x38e581[_0x2257('0x31')]=_[_0x2257('0x2e')](_0x8b9b1b[_0x2257('0x31')]);_0x38e581['filters']=_[_0x2257('0x32')](_0x38e581[_0x2257('0x2d')],_0x38e581['query']);_0x508cad['attributes']=_[_0x2257('0x32')](_0x38e581[_0x2257('0x2d')],qs[_0x2257('0x33')](_0x8b9b1b[_0x2257('0x31')][_0x2257('0x33')]));_0x508cad[_0x2257('0x34')]=_0x508cad['attributes'][_0x2257('0x35')]?_0x508cad[_0x2257('0x34')]:_0x38e581[_0x2257('0x2d')];if(_0x8b9b1b[_0x2257('0x31')]['includeAll']){_0x508cad[_0x2257('0x36')]=[{'all':!![]}];}_0x508cad=_['merge']({},_0x508cad,_0x8b9b1b['options']);return db[_0x2257('0x2f')][_0x2257('0x37')](_0x508cad)[_0x2257('0x27')](handleEntityNotFound(_0x8952ad,null))[_0x2257('0x27')](respondWithResult(_0x8952ad,null))[_0x2257('0x38')](handleError(_0x8952ad,null));};exports[_0x2257('0x26')]=function(_0x1d088c,_0x283d55){if(_0x1d088c[_0x2257('0x39')]['id']){delete _0x1d088c[_0x2257('0x39')]['id'];}return db[_0x2257('0x2f')][_0x2257('0x37')]({'where':{'id':_0x1d088c[_0x2257('0x2c')]['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x283d55,null))['then'](saveUpdates(_0x1d088c[_0x2257('0x39')],null))[_0x2257('0x27')](respondWithResult(_0x283d55,null))[_0x2257('0x38')](handleError(_0x283d55,null));};exports[_0x2257('0x28')]=function(_0x24edea,_0x4fd5e5){return db[_0x2257('0x2f')][_0x2257('0x37')]({'where':{'id':_0x24edea[_0x2257('0x2c')]['id']}})[_0x2257('0x27')](handleEntityNotFound(_0x4fd5e5,null))[_0x2257('0x27')](removeEntity(_0x4fd5e5,null))[_0x2257('0x38')](handleError(_0x4fd5e5,null));}; \ No newline at end of file +var _0xa664=['bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','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','send','show','params','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','body','catch','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa664,0x132));var _0x4a66=function(_0x50c14d,_0xad9031){_0x50c14d=_0x50c14d-0x0;var _0x49b11f=_0xa664[_0x50c14d];return _0x49b11f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a66('0x0'));var zipdir=require(_0x4a66('0x1'));var jsonpatch=require(_0x4a66('0x2'));var rp=require(_0x4a66('0x3'));var moment=require('moment');var BPromise=require(_0x4a66('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a66('0x5'));var sox=require(_0x4a66('0x6'));var csv=require(_0x4a66('0x7'));var ejs=require(_0x4a66('0x8'));var fs=require('fs');var fs_extra=require(_0x4a66('0x9'));var _=require(_0x4a66('0xa'));var squel=require(_0x4a66('0xb'));var crypto=require('crypto');var jsforce=require(_0x4a66('0xc'));var deskjs=require(_0x4a66('0xd'));var toCsv=require(_0x4a66('0x7'));var querystring=require(_0x4a66('0xe'));var Papa=require('papaparse');var Redis=require(_0x4a66('0xf'));var authService=require(_0x4a66('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4a66('0x11'));var hardwareService=require(_0x4a66('0x12'));var logger=require(_0x4a66('0x13'))(_0x4a66('0x14'));var utils=require(_0x4a66('0x15'));var config=require(_0x4a66('0x16'));var licenseUtil=require(_0x4a66('0x17'));var db=require(_0x4a66('0x18'))['db'];function respondWithStatusCode(_0x3d5431,_0x46e373){_0x46e373=_0x46e373||0xcc;return function(_0x177bf1){if(_0x177bf1){return _0x3d5431[_0x4a66('0x19')](_0x46e373);}return _0x3d5431[_0x4a66('0x1a')](_0x46e373)[_0x4a66('0x1b')]();};}function respondWithResult(_0x409921,_0x11fa94){_0x11fa94=_0x11fa94||0xc8;return function(_0x11f34f){if(_0x11f34f){return _0x409921['status'](_0x11fa94)[_0x4a66('0x1c')](_0x11f34f);}};}function respondWithFilteredResult(_0x26d34f,_0x128c8e){return function(_0x4208f9){if(_0x4208f9){var _0x199ddf=typeof _0x128c8e[_0x4a66('0x1d')]===_0x4a66('0x1e')&&typeof _0x128c8e[_0x4a66('0x1f')]==='undefined';var _0x2d04da=_0x4208f9[_0x4a66('0x20')];var _0x3e8805=_0x199ddf?0x0:_0x128c8e[_0x4a66('0x1d')];var _0x509aaf=_0x199ddf?_0x4208f9[_0x4a66('0x20')]:_0x128c8e[_0x4a66('0x1d')]+_0x128c8e[_0x4a66('0x1f')];var _0x569ebd;if(_0x509aaf>=_0x2d04da){_0x509aaf=_0x2d04da;_0x569ebd=0xc8;}else{_0x569ebd=0xce;}_0x26d34f['status'](_0x569ebd);return _0x26d34f[_0x4a66('0x21')](_0x4a66('0x22'),_0x3e8805+'-'+_0x509aaf+'/'+_0x2d04da)[_0x4a66('0x1c')](_0x4208f9);}return null;};}function patchUpdates(_0x4c78e1){return function(_0x5de482){try{jsonpatch[_0x4a66('0x23')](_0x5de482,_0x4c78e1,!![]);}catch(_0x566fc8){return BPromise[_0x4a66('0x24')](_0x566fc8);}return _0x5de482[_0x4a66('0x25')]();};}function saveUpdates(_0x18ec8e,_0x3d649d){return function(_0x451f4e){if(_0x451f4e){return _0x451f4e[_0x4a66('0x26')](_0x18ec8e)[_0x4a66('0x27')](function(_0x2c0a0d){return _0x2c0a0d;});}return null;};}function removeEntity(_0x10274a,_0x3052cc){return function(_0xad793e){if(_0xad793e){return _0xad793e[_0x4a66('0x28')]()[_0x4a66('0x27')](function(){_0x10274a[_0x4a66('0x1a')](0xcc)[_0x4a66('0x1b')]();});}};}function handleEntityNotFound(_0x5206d0,_0x2a9ba1){return function(_0x4d58c){if(!_0x4d58c){_0x5206d0['sendStatus'](0x194);}return _0x4d58c;};}function handleError(_0x1417a3,_0x3cb2c4){_0x3cb2c4=_0x3cb2c4||0x1f4;return function(_0x47184e){logger[_0x4a66('0x29')](_0x47184e[_0x4a66('0x2a')]);if(_0x47184e['name']){delete _0x47184e['name'];}_0x1417a3[_0x4a66('0x1a')](_0x3cb2c4)[_0x4a66('0x2b')](_0x47184e);};}exports[_0x4a66('0x2c')]=function(_0x257485,_0xa81e68){var _0x80782e={'raw':!![],'where':{'id':_0x257485[_0x4a66('0x2d')]['id']}},_0x1412f1={};_0x1412f1[_0x4a66('0x2e')]=_[_0x4a66('0x2f')](db[_0x4a66('0x30')][_0x4a66('0x31')]);_0x1412f1['query']=_['keys'](_0x257485[_0x4a66('0x32')]);_0x1412f1['filters']=_[_0x4a66('0x33')](_0x1412f1[_0x4a66('0x2e')],_0x1412f1[_0x4a66('0x32')]);_0x80782e[_0x4a66('0x34')]=_['intersection'](_0x1412f1[_0x4a66('0x2e')],qs[_0x4a66('0x35')](_0x257485[_0x4a66('0x32')][_0x4a66('0x35')]));_0x80782e['attributes']=_0x80782e['attributes'][_0x4a66('0x36')]?_0x80782e[_0x4a66('0x34')]:_0x1412f1[_0x4a66('0x2e')];if(_0x257485[_0x4a66('0x32')][_0x4a66('0x37')]){_0x80782e[_0x4a66('0x38')]=[{'all':!![]}];}_0x80782e=_[_0x4a66('0x39')]({},_0x80782e,_0x257485[_0x4a66('0x3a')]);return db[_0x4a66('0x30')][_0x4a66('0x3b')](_0x80782e)['then'](handleEntityNotFound(_0xa81e68,null))['then'](respondWithResult(_0xa81e68,null))['catch'](handleError(_0xa81e68,null));};exports[_0x4a66('0x26')]=function(_0x30a8df,_0x46177a){if(_0x30a8df[_0x4a66('0x3c')]['id']){delete _0x30a8df[_0x4a66('0x3c')]['id'];}return db['ChatApplication'][_0x4a66('0x3b')]({'where':{'id':_0x30a8df['params']['id']}})['then'](handleEntityNotFound(_0x46177a,null))[_0x4a66('0x27')](saveUpdates(_0x30a8df[_0x4a66('0x3c')],null))[_0x4a66('0x27')](respondWithResult(_0x46177a,null))[_0x4a66('0x3d')](handleError(_0x46177a,null));};exports['destroy']=function(_0x1ef7ff,_0x57ed4e){return db[_0x4a66('0x30')][_0x4a66('0x3b')]({'where':{'id':_0x1ef7ff[_0x4a66('0x2d')]['id']}})[_0x4a66('0x27')](handleEntityNotFound(_0x57ed4e,null))[_0x4a66('0x27')](removeEntity(_0x57ed4e,null))[_0x4a66('0x3d')](handleError(_0x57ed4e,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 14a94bb..195e64b 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 _0x296f=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','chat_applications','utf8mb4','lodash','util'];(function(_0xf9431c,_0x4754b5){var _0x53fc33=function(_0x50ac6c){while(--_0x50ac6c){_0xf9431c['push'](_0xf9431c['shift']());}};_0x53fc33(++_0x4754b5);}(_0x296f,0xf0));var _0xf296=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0x296f[_0x45c262];return _0x4f2ba6;};'use strict';var _=require(_0xf296('0x0'));var util=require(_0xf296('0x1'));var logger=require(_0xf296('0x2'))(_0xf296('0x3'));var moment=require(_0xf296('0x4'));var BPromise=require(_0xf296('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf296('0x6'));var config=require(_0xf296('0x7'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x4c9620,_0x41a1b3){return _0x4c9620[_0xf296('0x8')]('ChatApplication',attributes,{'tableName':_0xf296('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf296('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7250=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','ChatApplication','chat_applications'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7250,0x1b1));var _0x0725=function(_0x5653c4,_0x149d40){_0x5653c4=_0x5653c4-0x0;var _0x4dc527=_0x7250[_0x5653c4];return _0x4dc527;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var logger=require('../../config/logger')(_0x0725('0x2'));var moment=require(_0x0725('0x3'));var BPromise=require(_0x0725('0x4'));var rp=require(_0x0725('0x5'));var fs=require('fs');var path=require(_0x0725('0x6'));var rimraf=require(_0x0725('0x7'));var config=require('../../config/environment');var attributes=require(_0x0725('0x8'));module['exports']=function(_0x4e8c6c,_0xa32c3f){return _0x4e8c6c['define'](_0x0725('0x9'),attributes,{'tableName':_0x0725('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0725('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 06d1318..894b668 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 _0x73b1=['request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ChatApplication,\x20%s,\x20%s','debug'];(function(_0x5ca5b4,_0xde6b66){var _0x1294d9=function(_0x543a84){while(--_0x543a84){_0x5ca5b4['push'](_0x5ca5b4['shift']());}};_0x1294d9(++_0xde6b66);}(_0x73b1,0xd8));var _0x173b=function(_0x35fc6b,_0x29dc0e){_0x35fc6b=_0x35fc6b-0x0;var _0x135553=_0x73b1[_0x35fc6b];return _0x135553;};'use strict';var _=require(_0x173b('0x0'));var util=require('util');var moment=require(_0x173b('0x1'));var BPromise=require('bluebird');var rs=require(_0x173b('0x2'));var fs=require('fs');var Redis=require(_0x173b('0x3'));var db=require(_0x173b('0x4'))['db'];var utils=require(_0x173b('0x5'));var logger=require(_0x173b('0x6'))('rpc');var config=require(_0x173b('0x7'));var jayson=require(_0x173b('0x8'));var client=jayson[_0x173b('0x9')][_0x173b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x281759,_0x5b042b,_0x32f94a){return new BPromise(function(_0x2509c5,_0x16945d){return client[_0x173b('0xb')](_0x281759,_0x32f94a)['then'](function(_0x3ade8b){logger[_0x173b('0xc')](_0x173b('0xd'),_0x5b042b,'request\x20sent');logger[_0x173b('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5b042b,_0x173b('0xf'),JSON['stringify'](_0x3ade8b));if(_0x3ade8b[_0x173b('0x10')]){if(_0x3ade8b[_0x173b('0x10')][_0x173b('0x11')]===0x1f4){logger[_0x173b('0x10')](_0x173b('0xd'),_0x5b042b,_0x3ade8b['error'][_0x173b('0x12')]);return _0x16945d(_0x3ade8b['error'][_0x173b('0x12')]);}logger[_0x173b('0x10')]('ChatApplication,\x20%s,\x20%s',_0x5b042b,_0x3ade8b[_0x173b('0x10')][_0x173b('0x12')]);return _0x2509c5(_0x3ade8b[_0x173b('0x10')]['message']);}else{logger[_0x173b('0xc')](_0x173b('0xd'),_0x5b042b,_0x173b('0xf'));_0x2509c5(_0x3ade8b[_0x173b('0x13')]['message']);}})[_0x173b('0x14')](function(_0x47eba9){logger[_0x173b('0x10')](_0x173b('0xd'),_0x5b042b,_0x47eba9);_0x16945d(_0x47eba9);});});} \ No newline at end of file +var _0x98d5=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatApplication,\x20%s,\x20%s'];(function(_0x23d766,_0x147078){var _0x4ff5b5=function(_0x3258c7){while(--_0x3258c7){_0x23d766['push'](_0x23d766['shift']());}};_0x4ff5b5(++_0x147078);}(_0x98d5,0x197));var _0x598d=function(_0x429c2f,_0x5efe5){_0x429c2f=_0x429c2f-0x0;var _0xa6a978=_0x98d5[_0x429c2f];return _0xa6a978;};'use strict';var _=require(_0x598d('0x0'));var util=require(_0x598d('0x1'));var moment=require('moment');var BPromise=require(_0x598d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x598d('0x3'))['db'];var utils=require(_0x598d('0x4'));var logger=require(_0x598d('0x5'))(_0x598d('0x6'));var config=require(_0x598d('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x598d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e365e,_0x7fb811,_0x40aecf){return new BPromise(function(_0x40e78c,_0x4ee58d){return client[_0x598d('0x9')](_0x3e365e,_0x40aecf)[_0x598d('0xa')](function(_0x4b5bfd){logger[_0x598d('0xb')](_0x598d('0xc'),_0x7fb811,'request\x20sent');logger[_0x598d('0xd')](_0x598d('0xe'),_0x7fb811,'request\x20sent',JSON['stringify'](_0x4b5bfd));if(_0x4b5bfd['error']){if(_0x4b5bfd['error'][_0x598d('0xf')]===0x1f4){logger[_0x598d('0x10')](_0x598d('0xc'),_0x7fb811,_0x4b5bfd[_0x598d('0x10')][_0x598d('0x11')]);return _0x4ee58d(_0x4b5bfd[_0x598d('0x10')]['message']);}logger[_0x598d('0x10')](_0x598d('0xc'),_0x7fb811,_0x4b5bfd['error'][_0x598d('0x11')]);return _0x40e78c(_0x4b5bfd[_0x598d('0x10')]['message']);}else{logger[_0x598d('0xb')](_0x598d('0xc'),_0x7fb811,_0x598d('0x12'));_0x40e78c(_0x4b5bfd[_0x598d('0x13')][_0x598d('0x11')]);}})[_0x598d('0x14')](function(_0x3d2d2c){logger[_0x598d('0x10')](_0x598d('0xc'),_0x7fb811,_0x3d2d2c);_0x4ee58d(_0x3d2d2c);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 7c65414..b70e6a8 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 _0xd51e=['express','Router','../../components/auth/service','../../components/interaction/service','./chatApplication.controller','get','isAuthenticated','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4a2246,_0x4244c1){var _0x8855e8=function(_0x30dc2d){while(--_0x30dc2d){_0x4a2246['push'](_0x4a2246['shift']());}};_0x8855e8(++_0x4244c1);}(_0xd51e,0x11c));var _0xed51=function(_0x25d9dd,_0x4bf73a){_0x25d9dd=_0x25d9dd-0x0;var _0x27fb38=_0xd51e[_0x25d9dd];return _0x27fb38;};'use strict';var multer=require(_0xed51('0x0'));var util=require(_0xed51('0x1'));var path=require(_0xed51('0x2'));var timeout=require(_0xed51('0x3'));var express=require(_0xed51('0x4'));var router=express[_0xed51('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed51('0x6'));var interaction=require(_0xed51('0x7'));var config=require('../../config/environment');var controller=require(_0xed51('0x8'));router[_0xed51('0x9')]('/:id',auth[_0xed51('0xa')](),controller['show']);router[_0xed51('0xb')](_0xed51('0xc'),auth[_0xed51('0xa')](),controller['update']);router[_0xed51('0xd')]('/:id',auth[_0xed51('0xa')](),controller[_0xed51('0xe')]);module[_0xed51('0xf')]=router; \ No newline at end of file +var _0xd278=['isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','./chatApplication.controller','get'];(function(_0x4b355c,_0x5078cf){var _0x4bf29a=function(_0x1237d5){while(--_0x1237d5){_0x4b355c['push'](_0x4b355c['shift']());}};_0x4bf29a(++_0x5078cf);}(_0xd278,0x198));var _0x8d27=function(_0x4a50f5,_0x59b73a){_0x4a50f5=_0x4a50f5-0x0;var _0x24283d=_0xd278[_0x4a50f5];return _0x24283d;};'use strict';var multer=require(_0x8d27('0x0'));var util=require('util');var path=require(_0x8d27('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d27('0x2'));var router=express[_0x8d27('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8d27('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8d27('0x5'));var controller=require(_0x8d27('0x6'));router[_0x8d27('0x7')]('/:id',auth[_0x8d27('0x8')](),controller[_0x8d27('0x9')]);router[_0x8d27('0xa')](_0x8d27('0xb'),auth[_0x8d27('0x8')](),controller[_0x8d27('0xc')]);router[_0x8d27('0xd')](_0x8d27('0xb'),auth[_0x8d27('0x8')](),controller[_0x8d27('0xe')]);module[_0x8d27('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 56f4471..ebe3b23 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 _0x717b=['BOOLEAN','STRING'];(function(_0x4cbad3,_0xf08e47){var _0x5b26f6=function(_0x1ecb5d){while(--_0x1ecb5d){_0x4cbad3['push'](_0x4cbad3['shift']());}};_0x5b26f6(++_0xf08e47);}(_0x717b,0x111));var _0xb717=function(_0x2a27d9,_0x478fef){_0x2a27d9=_0x2a27d9-0x0;var _0xa4b646=_0x717b[_0x2a27d9];return _0xa4b646;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb717('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb717('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf163=['sequelize','STRING','BOOLEAN'];(function(_0x1c6089,_0x3816e2){var _0x4d97c1=function(_0x3e631b){while(--_0x3e631b){_0x1c6089['push'](_0x1c6089['shift']());}};_0x4d97c1(++_0x3816e2);}(_0xf163,0x129));var _0x3f16=function(_0x3cc9d9,_0x69ed38){_0x3cc9d9=_0x3cc9d9-0x0;var _0x1a425d=_0xf163[_0x3cc9d9];return _0x1a425d;};'use strict';var Sequelize=require(_0x3f16('0x0'));module['exports']={'name':{'type':Sequelize[_0x3f16('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3f16('0x1')]},'write':{'type':Sequelize[_0x3f16('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index e74b066..76032e9 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 _0xa823=['index','map','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','type','merge','options','ChatGroup','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','addMessage','getMessages','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xa823,0x1c6));var _0x3a82=function(_0x5a0585,_0x4d8839){_0x5a0585=_0x5a0585-0x0;var _0x46010c=_0xa823[_0x5a0585];return _0x46010c;};'use strict';var emlformat=require(_0x3a82('0x0'));var rimraf=require(_0x3a82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a82('0x2'));var rp=require(_0x3a82('0x3'));var moment=require(_0x3a82('0x4'));var BPromise=require(_0x3a82('0x5'));var Mustache=require(_0x3a82('0x6'));var util=require(_0x3a82('0x7'));var path=require('path');var sox=require(_0x3a82('0x8'));var csv=require(_0x3a82('0x9'));var ejs=require(_0x3a82('0xa'));var fs=require('fs');var fs_extra=require(_0x3a82('0xb'));var _=require(_0x3a82('0xc'));var squel=require(_0x3a82('0xd'));var crypto=require(_0x3a82('0xe'));var jsforce=require(_0x3a82('0xf'));var deskjs=require(_0x3a82('0x10'));var toCsv=require(_0x3a82('0x9'));var querystring=require(_0x3a82('0x11'));var Papa=require(_0x3a82('0x12'));var Redis=require(_0x3a82('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x3a82('0x14'));var as=require(_0x3a82('0x15'));var hardwareService=require(_0x3a82('0x16'));var logger=require(_0x3a82('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x3a82('0x18'));var licenseUtil=require(_0x3a82('0x19'));var db=require(_0x3a82('0x1a'))['db'];config['redis']=_[_0x3a82('0x1b')](config[_0x3a82('0x1c')],{'host':_0x3a82('0x1d'),'port':0x18eb});var socket=require(_0x3a82('0x1e'))(new Redis(config[_0x3a82('0x1c')]));require(_0x3a82('0x1f'))[_0x3a82('0x20')](socket);function respondWithStatusCode(_0x310557,_0x1e92dc){_0x1e92dc=_0x1e92dc||0xcc;return function(_0x2512ce){if(_0x2512ce){return _0x310557[_0x3a82('0x21')](_0x1e92dc);}return _0x310557['status'](_0x1e92dc)[_0x3a82('0x22')]();};}function respondWithResult(_0x26f212,_0x40d838){_0x40d838=_0x40d838||0xc8;return function(_0x5d225c){if(_0x5d225c){return _0x26f212[_0x3a82('0x23')](_0x40d838)['json'](_0x5d225c);}};}function respondWithFilteredResult(_0x24f805,_0x45e867){return function(_0x57e499){if(_0x57e499){var _0x10f088=typeof _0x45e867['offset']===_0x3a82('0x24')&&typeof _0x45e867[_0x3a82('0x25')]===_0x3a82('0x24');var _0xa02da3=_0x57e499[_0x3a82('0x26')];var _0x17acf6=_0x10f088?0x0:_0x45e867[_0x3a82('0x27')];var _0x39eced=_0x10f088?_0x57e499['count']:_0x45e867[_0x3a82('0x27')]+_0x45e867[_0x3a82('0x25')];var _0x57f47e;if(_0x39eced>=_0xa02da3){_0x39eced=_0xa02da3;_0x57f47e=0xc8;}else{_0x57f47e=0xce;}_0x24f805[_0x3a82('0x23')](_0x57f47e);return _0x24f805[_0x3a82('0x28')](_0x3a82('0x29'),_0x17acf6+'-'+_0x39eced+'/'+_0xa02da3)['json'](_0x57e499);}return null;};}function patchUpdates(_0x3e33a6){return function(_0xc88d90){try{jsonpatch[_0x3a82('0x2a')](_0xc88d90,_0x3e33a6,!![]);}catch(_0x5eb662){return BPromise[_0x3a82('0x2b')](_0x5eb662);}return _0xc88d90[_0x3a82('0x2c')]();};}function saveUpdates(_0x40aa88,_0x25d47d){return function(_0x521433){if(_0x521433){return _0x521433[_0x3a82('0x2d')](_0x40aa88)['then'](function(_0xdcc239){return _0xdcc239;});}return null;};}function removeEntity(_0x38f51e,_0x44f505){return function(_0x4e864a){if(_0x4e864a){return _0x4e864a['destroy']()[_0x3a82('0x2e')](function(){_0x38f51e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x380adb,_0x3505ff){return function(_0x145d76){if(!_0x145d76){_0x380adb[_0x3a82('0x21')](0x194);}return _0x145d76;};}function handleError(_0x4a8941,_0x468ac7){_0x468ac7=_0x468ac7||0x1f4;return function(_0x29405e){logger[_0x3a82('0x2f')](_0x29405e[_0x3a82('0x30')]);if(_0x29405e[_0x3a82('0x31')]){delete _0x29405e['name'];}_0x4a8941[_0x3a82('0x23')](_0x468ac7)[_0x3a82('0x32')](_0x29405e);};}exports[_0x3a82('0x33')]=function(_0x2f4772,_0x309369){var _0x2ea10b={},_0x15f2e2={},_0x535c75={'count':0x0,'rows':[]};var _0x496d71=_[_0x3a82('0x34')](db['ChatGroup'][_0x3a82('0x35')],function(_0x264882){return{'name':_0x264882['fieldName'],'type':_0x264882['type'][_0x3a82('0x36')]};});_0x15f2e2[_0x3a82('0x37')]=_[_0x3a82('0x34')](_0x496d71,_0x3a82('0x31'));_0x15f2e2[_0x3a82('0x38')]=_[_0x3a82('0x39')](_0x2f4772[_0x3a82('0x38')]);_0x15f2e2['filters']=_['intersection'](_0x15f2e2[_0x3a82('0x37')],_0x15f2e2[_0x3a82('0x38')]);_0x2ea10b[_0x3a82('0x3a')]=_[_0x3a82('0x3b')](_0x15f2e2['model'],qs['fields'](_0x2f4772['query'][_0x3a82('0x3c')]));_0x2ea10b[_0x3a82('0x3a')]=_0x2ea10b[_0x3a82('0x3a')][_0x3a82('0x3d')]?_0x2ea10b['attributes']:_0x15f2e2[_0x3a82('0x37')];if(!_0x2f4772[_0x3a82('0x38')]['hasOwnProperty'](_0x3a82('0x3e'))){_0x2ea10b['limit']=qs[_0x3a82('0x25')](_0x2f4772[_0x3a82('0x38')][_0x3a82('0x25')]);_0x2ea10b['offset']=qs[_0x3a82('0x27')](_0x2f4772[_0x3a82('0x38')][_0x3a82('0x27')]);}_0x2ea10b[_0x3a82('0x3f')]=qs['sort'](_0x2f4772[_0x3a82('0x38')][_0x3a82('0x40')]);_0x2ea10b[_0x3a82('0x41')]=qs[_0x3a82('0x42')](_[_0x3a82('0x43')](_0x2f4772[_0x3a82('0x38')],_0x15f2e2[_0x3a82('0x42')]),_0x496d71);if(_0x2f4772['query'][_0x3a82('0x44')]){_0x2ea10b[_0x3a82('0x41')]=_['merge'](_0x2ea10b[_0x3a82('0x41')],{'$or':_[_0x3a82('0x34')](_0x496d71,function(_0x48f9de){if(_0x48f9de[_0x3a82('0x45')]!=='VIRTUAL'){var _0x2cfb66={};_0x2cfb66[_0x48f9de[_0x3a82('0x31')]]={'$like':'%'+_0x2f4772[_0x3a82('0x38')]['filter']+'%'};return _0x2cfb66;}})});}_0x2ea10b=_[_0x3a82('0x46')]({},_0x2ea10b,_0x2f4772[_0x3a82('0x47')]);var _0x2eb349={'where':_0x2ea10b[_0x3a82('0x41')]};return db[_0x3a82('0x48')]['count'](_0x2eb349)[_0x3a82('0x2e')](function(_0x59c7f0){_0x535c75[_0x3a82('0x26')]=_0x59c7f0;if(_0x2f4772[_0x3a82('0x38')][_0x3a82('0x49')]){_0x2ea10b['include']=[{'all':!![]}];}return db[_0x3a82('0x48')][_0x3a82('0x4a')](_0x2ea10b);})[_0x3a82('0x2e')](function(_0x5251f6){_0x535c75[_0x3a82('0x4b')]=_0x5251f6;return _0x535c75;})[_0x3a82('0x2e')](respondWithFilteredResult(_0x309369,_0x2ea10b))[_0x3a82('0x4c')](handleError(_0x309369,null));};exports[_0x3a82('0x4d')]=function(_0x38ed85,_0x4eab6b){var _0x12f90a={'raw':!![],'where':{'id':_0x38ed85[_0x3a82('0x4e')]['id']}},_0x333443={};_0x333443[_0x3a82('0x37')]=_[_0x3a82('0x39')](db[_0x3a82('0x48')]['rawAttributes']);_0x333443[_0x3a82('0x38')]=_[_0x3a82('0x39')](_0x38ed85[_0x3a82('0x38')]);_0x333443[_0x3a82('0x42')]=_[_0x3a82('0x3b')](_0x333443['model'],_0x333443['query']);_0x12f90a[_0x3a82('0x3a')]=_[_0x3a82('0x3b')](_0x333443[_0x3a82('0x37')],qs[_0x3a82('0x3c')](_0x38ed85[_0x3a82('0x38')][_0x3a82('0x3c')]));_0x12f90a[_0x3a82('0x3a')]=_0x12f90a[_0x3a82('0x3a')][_0x3a82('0x3d')]?_0x12f90a[_0x3a82('0x3a')]:_0x333443[_0x3a82('0x37')];if(_0x38ed85[_0x3a82('0x38')][_0x3a82('0x49')]){_0x12f90a[_0x3a82('0x4f')]=[{'all':!![]}];}_0x12f90a=_['merge']({},_0x12f90a,_0x38ed85[_0x3a82('0x47')]);return db[_0x3a82('0x48')][_0x3a82('0x50')](_0x12f90a)[_0x3a82('0x2e')](handleEntityNotFound(_0x4eab6b,null))['then'](respondWithResult(_0x4eab6b,null))['catch'](handleError(_0x4eab6b,null));};exports[_0x3a82('0x51')]=function(_0x96309c,_0x410a05){return db['ChatGroup'][_0x3a82('0x51')](_0x96309c[_0x3a82('0x52')],{})[_0x3a82('0x2e')](respondWithResult(_0x410a05,0xc9))[_0x3a82('0x4c')](handleError(_0x410a05,null));};exports[_0x3a82('0x2d')]=function(_0x592da4,_0x4f166b){if(_0x592da4['body']['id']){delete _0x592da4['body']['id'];}return db[_0x3a82('0x48')][_0x3a82('0x50')]({'where':{'id':_0x592da4[_0x3a82('0x4e')]['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0x4f166b,null))[_0x3a82('0x2e')](saveUpdates(_0x592da4[_0x3a82('0x52')],null))[_0x3a82('0x2e')](respondWithResult(_0x4f166b,null))['catch'](handleError(_0x4f166b,null));};exports[_0x3a82('0x53')]=function(_0x292835,_0x2e9d54){return db['ChatGroup'][_0x3a82('0x50')]({'where':{'id':_0x292835[_0x3a82('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2e9d54,null))['then'](removeEntity(_0x2e9d54,null))[_0x3a82('0x4c')](handleError(_0x2e9d54,null));};exports[_0x3a82('0x54')]=function(_0x333d5e,_0x868fd7){return db[_0x3a82('0x48')][_0x3a82('0x54')]()[_0x3a82('0x2e')](respondWithResult(_0x868fd7,null))['catch'](handleError(_0x868fd7,null));};exports['getUnread']=function(_0x11a6f4,_0x14b0ed,_0x344027){return db[_0x3a82('0x55')][_0x3a82('0x26')]({'where':{'ChatGroupId':_0x11a6f4[_0x3a82('0x4e')]['id'],'ToId':_0x11a6f4[_0x3a82('0x56')]['id'],'read':![]}})[_0x3a82('0x2e')](function(_0x5149a1){return{'id':_[_0x3a82('0x57')](_0x11a6f4[_0x3a82('0x4e')]['id']),'count':_0x5149a1};})['then'](respondWithResult(_0x14b0ed,null))['catch'](handleError(_0x14b0ed,null));};exports[_0x3a82('0x58')]=function(_0x28266b,_0x2a1fa0,_0x2438cf){return db['ChatGroup'][_0x3a82('0x50')]({'where':{'id':_0x28266b[_0x3a82('0x4e')]['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0x2a1fa0,null))[_0x3a82('0x2e')](function(_0x382e49){if(_0x382e49){return _0x382e49[_0x3a82('0x58')](_0x28266b[_0x3a82('0x52')][_0x3a82('0x59')],_[_0x3a82('0x5a')](_0x28266b['body'],['ids','id'])||{});}})[_0x3a82('0x2e')](respondWithResult(_0x2a1fa0,null))[_0x3a82('0x4c')](handleError(_0x2a1fa0,null));};exports[_0x3a82('0x5b')]=function(_0x5962f8,_0xbcac10,_0x1f7f0c){var _0x130d9c={};var _0x217704={};var _0x114a57;var _0x4a26aa;return db['ChatGroup'][_0x3a82('0x5c')]({'where':{'id':_0x5962f8['params']['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0xbcac10,null))['then'](function(_0x4fd7fa){if(_0x4fd7fa){_0x114a57=_0x4fd7fa;_0x217704[_0x3a82('0x37')]=_[_0x3a82('0x39')](db[_0x3a82('0x5d')][_0x3a82('0x35')]);_0x217704['query']=_[_0x3a82('0x39')](_0x5962f8[_0x3a82('0x38')]);_0x217704[_0x3a82('0x42')]=_[_0x3a82('0x3b')](_0x217704[_0x3a82('0x37')],_0x217704['query']);_0x130d9c[_0x3a82('0x3a')]=_[_0x3a82('0x3b')](_0x217704[_0x3a82('0x37')],qs[_0x3a82('0x3c')](_0x5962f8[_0x3a82('0x38')][_0x3a82('0x3c')]));_0x130d9c[_0x3a82('0x3a')]=_0x130d9c['attributes'][_0x3a82('0x3d')]?_0x130d9c[_0x3a82('0x3a')]:_0x217704[_0x3a82('0x37')];_0x130d9c[_0x3a82('0x3f')]=qs[_0x3a82('0x40')](_0x5962f8[_0x3a82('0x38')][_0x3a82('0x40')]);_0x130d9c[_0x3a82('0x41')]=qs[_0x3a82('0x42')](_[_0x3a82('0x43')](_0x5962f8[_0x3a82('0x38')],_0x217704[_0x3a82('0x42')]));if(_0x5962f8[_0x3a82('0x38')][_0x3a82('0x44')]){_0x130d9c['where']=_[_0x3a82('0x46')](_0x130d9c[_0x3a82('0x41')],{'$or':_['map'](_0x130d9c[_0x3a82('0x3a')],function(_0x2921c9){var _0x22af61={};_0x22af61[_0x2921c9]={'$like':'%'+_0x5962f8[_0x3a82('0x38')][_0x3a82('0x44')]+'%'};return _0x22af61;})});}_0x130d9c=_['merge']({},_0x130d9c,_0x5962f8[_0x3a82('0x47')]);return _0x114a57[_0x3a82('0x5b')](_0x130d9c);}})['then'](function(_0x2c3222){if(_0x2c3222){_0x4a26aa=_0x2c3222['length'];if(!_0x5962f8[_0x3a82('0x38')][_0x3a82('0x5e')](_0x3a82('0x3e'))){_0x130d9c['limit']=qs[_0x3a82('0x25')](_0x5962f8[_0x3a82('0x38')]['limit']);_0x130d9c['offset']=qs[_0x3a82('0x27')](_0x5962f8[_0x3a82('0x38')][_0x3a82('0x27')]);}return _0x114a57[_0x3a82('0x5b')](_0x130d9c);}})['then'](function(_0x12dbf4){if(_0x12dbf4){return _0x12dbf4?{'count':_0x4a26aa,'rows':_0x12dbf4}:null;}})[_0x3a82('0x2e')](respondWithResult(_0xbcac10,null))[_0x3a82('0x4c')](handleError(_0xbcac10,null));};exports['removeMembers']=function(_0x5d475d,_0x2fc29e,_0x35f2a8){return db[_0x3a82('0x48')]['find']({'where':{'id':_0x5d475d[_0x3a82('0x4e')]['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0x2fc29e,null))[_0x3a82('0x2e')](function(_0x455f58){if(_0x455f58){return _0x455f58[_0x3a82('0x5f')](_0x5d475d['query'][_0x3a82('0x59')]);}})[_0x3a82('0x2e')](respondWithStatusCode(_0x2fc29e,null))['catch'](handleError(_0x2fc29e,null));};exports[_0x3a82('0x60')]=function(_0x4d43d7,_0x1b2c13,_0x5fd544){if(_0x4d43d7['body']['id']){delete _0x4d43d7['body']['id'];}return db[_0x3a82('0x48')][_0x3a82('0x50')]({'where':{'id':_0x4d43d7[_0x3a82('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1b2c13,null))[_0x3a82('0x2e')](function(_0x58468e){if(_0x58468e){_0x4d43d7[_0x3a82('0x52')]['ChatGroupId']=_0x58468e['id'];return db[_0x3a82('0x55')][_0x3a82('0x51')](_0x4d43d7[_0x3a82('0x52')]);}})['then'](respondWithResult(_0x1b2c13,null))[_0x3a82('0x4c')](handleError(_0x1b2c13,null));};exports[_0x3a82('0x61')]=function(_0x83e067,_0x5948f9,_0x40bc98){var _0x322318={};var _0x20966={};var _0x22c888;var _0x1d9908;return db[_0x3a82('0x48')][_0x3a82('0x5c')]({'where':{'id':_0x83e067[_0x3a82('0x4e')]['id']}})[_0x3a82('0x2e')](handleEntityNotFound(_0x5948f9,null))[_0x3a82('0x2e')](function(_0x96f62a){if(_0x96f62a){_0x22c888=_0x96f62a;_0x20966['model']=_['keys'](db[_0x3a82('0x55')][_0x3a82('0x35')]);_0x20966[_0x3a82('0x38')]=_[_0x3a82('0x39')](_0x83e067['query']);_0x20966[_0x3a82('0x42')]=_[_0x3a82('0x3b')](_0x20966[_0x3a82('0x37')],_0x20966['query']);_0x322318['attributes']=_[_0x3a82('0x3b')](_0x20966[_0x3a82('0x37')],qs[_0x3a82('0x3c')](_0x83e067[_0x3a82('0x38')][_0x3a82('0x3c')]));_0x322318[_0x3a82('0x3a')]=_0x322318['attributes'][_0x3a82('0x3d')]?_0x322318[_0x3a82('0x3a')]:_0x20966[_0x3a82('0x37')];_0x322318[_0x3a82('0x3f')]=qs[_0x3a82('0x40')](_0x83e067['query'][_0x3a82('0x40')]);_0x322318[_0x3a82('0x41')]=qs[_0x3a82('0x42')](_[_0x3a82('0x43')](_0x83e067[_0x3a82('0x38')],_0x20966[_0x3a82('0x42')]));if(_0x83e067[_0x3a82('0x38')][_0x3a82('0x44')]){_0x322318['where']=_[_0x3a82('0x46')](_0x322318[_0x3a82('0x41')],{'$or':_[_0x3a82('0x34')](_0x322318[_0x3a82('0x3a')],function(_0x1c0cd7){var _0x2a2f93={};_0x2a2f93[_0x1c0cd7]={'$like':'%'+_0x83e067['query']['filter']+'%'};return _0x2a2f93;})});}if(_0x83e067[_0x3a82('0x38')]['$gte']){var _0x3e8ad3=_0x83e067[_0x3a82('0x38')]['$gte'][_0x3a82('0x62')](',');var _0x5a2105={};_0x5a2105[_0x3e8ad3[0x0]]={'$gte':moment(_0x3e8ad3[0x1])[_0x3a82('0x63')](_0x3a82('0x64'))};_0x322318[_0x3a82('0x41')]=_[_0x3a82('0x46')](_0x322318[_0x3a82('0x41')],_0x5a2105);}_0x322318=_[_0x3a82('0x46')]({},_0x322318,_0x83e067[_0x3a82('0x47')]);return _0x22c888['getMessages'](_0x322318);}})[_0x3a82('0x2e')](function(_0x55dc7b){if(_0x55dc7b){_0x1d9908=_0x55dc7b[_0x3a82('0x3d')];if(!_0x83e067['query'][_0x3a82('0x5e')](_0x3a82('0x3e'))){_0x322318[_0x3a82('0x25')]=qs[_0x3a82('0x25')](_0x83e067['query'][_0x3a82('0x25')]);_0x322318[_0x3a82('0x27')]=qs[_0x3a82('0x27')](_0x83e067[_0x3a82('0x38')][_0x3a82('0x27')]);}return _0x22c888[_0x3a82('0x61')](_0x322318);}})['then'](function(_0x5798a3){if(_0x5798a3){return _0x5798a3?{'count':_0x1d9908,'rows':_0x5798a3}:null;}})[_0x3a82('0x2e')](respondWithResult(_0x5948f9,null))[_0x3a82('0x4c')](handleError(_0x5948f9,null));}; \ No newline at end of file +var _0x1491=['create','body','update','describe','getUnread','toInteger','addMembers','find','ids','omit','getMembers','findOne','removeMembers','addMessage','getMessages','ChatInternalMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection'];(function(_0x93ee4,_0x3f7007){var _0x196916=function(_0x9a98b6){while(--_0x9a98b6){_0x93ee4['push'](_0x93ee4['shift']());}};_0x196916(++_0x3f7007);}(_0x1491,0x76));var _0x1149=function(_0x2bf470,_0x4a620a){_0x2bf470=_0x2bf470-0x0;var _0x226559=_0x1491[_0x2bf470];return _0x226559;};'use strict';var emlformat=require(_0x1149('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1149('0x1'));var jsonpatch=require(_0x1149('0x2'));var rp=require(_0x1149('0x3'));var moment=require(_0x1149('0x4'));var BPromise=require(_0x1149('0x5'));var Mustache=require(_0x1149('0x6'));var util=require('util');var path=require(_0x1149('0x7'));var sox=require('sox');var csv=require(_0x1149('0x8'));var ejs=require(_0x1149('0x9'));var fs=require('fs');var fs_extra=require(_0x1149('0xa'));var _=require(_0x1149('0xb'));var squel=require(_0x1149('0xc'));var crypto=require('crypto');var jsforce=require(_0x1149('0xd'));var deskjs=require(_0x1149('0xe'));var toCsv=require(_0x1149('0x8'));var querystring=require('querystring');var Papa=require(_0x1149('0xf'));var Redis=require(_0x1149('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1149('0x11'));var hardwareService=require(_0x1149('0x12'));var logger=require(_0x1149('0x13'))(_0x1149('0x14'));var utils=require('../../config/utils');var config=require(_0x1149('0x15'));var licenseUtil=require(_0x1149('0x16'));var db=require('../../mysqldb')['db'];config[_0x1149('0x17')]=_[_0x1149('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1149('0x19'))(new Redis(config['redis']));require(_0x1149('0x1a'))[_0x1149('0x1b')](socket);function respondWithStatusCode(_0x3d16c7,_0x177a3c){_0x177a3c=_0x177a3c||0xcc;return function(_0x3b1b0a){if(_0x3b1b0a){return _0x3d16c7[_0x1149('0x1c')](_0x177a3c);}return _0x3d16c7[_0x1149('0x1d')](_0x177a3c)[_0x1149('0x1e')]();};}function respondWithResult(_0x34a0ae,_0x55a014){_0x55a014=_0x55a014||0xc8;return function(_0x19e79f){if(_0x19e79f){return _0x34a0ae[_0x1149('0x1d')](_0x55a014)[_0x1149('0x1f')](_0x19e79f);}};}function respondWithFilteredResult(_0x59f3a3,_0x412c0d){return function(_0xbd1107){if(_0xbd1107){var _0x2b481d=typeof _0x412c0d[_0x1149('0x20')]===_0x1149('0x21')&&typeof _0x412c0d[_0x1149('0x22')]===_0x1149('0x21');var _0x21af20=_0xbd1107[_0x1149('0x23')];var _0x13c7de=_0x2b481d?0x0:_0x412c0d[_0x1149('0x20')];var _0x385727=_0x2b481d?_0xbd1107[_0x1149('0x23')]:_0x412c0d['offset']+_0x412c0d[_0x1149('0x22')];var _0x11065c;if(_0x385727>=_0x21af20){_0x385727=_0x21af20;_0x11065c=0xc8;}else{_0x11065c=0xce;}_0x59f3a3[_0x1149('0x1d')](_0x11065c);return _0x59f3a3[_0x1149('0x24')](_0x1149('0x25'),_0x13c7de+'-'+_0x385727+'/'+_0x21af20)[_0x1149('0x1f')](_0xbd1107);}return null;};}function patchUpdates(_0x57efef){return function(_0x4e51ba){try{jsonpatch[_0x1149('0x26')](_0x4e51ba,_0x57efef,!![]);}catch(_0x5a39af){return BPromise[_0x1149('0x27')](_0x5a39af);}return _0x4e51ba[_0x1149('0x28')]();};}function saveUpdates(_0x2c3e6a,_0x2d8620){return function(_0x1d6b16){if(_0x1d6b16){return _0x1d6b16['update'](_0x2c3e6a)[_0x1149('0x29')](function(_0x56deab){return _0x56deab;});}return null;};}function removeEntity(_0x3a3528,_0x74791a){return function(_0x1bb547){if(_0x1bb547){return _0x1bb547[_0x1149('0x2a')]()['then'](function(){_0x3a3528[_0x1149('0x1d')](0xcc)[_0x1149('0x1e')]();});}};}function handleEntityNotFound(_0x502644,_0x22a9dc){return function(_0x554f4c){if(!_0x554f4c){_0x502644['sendStatus'](0x194);}return _0x554f4c;};}function handleError(_0x3a8cd4,_0x2e3033){_0x2e3033=_0x2e3033||0x1f4;return function(_0x665cb1){logger[_0x1149('0x2b')](_0x665cb1[_0x1149('0x2c')]);if(_0x665cb1['name']){delete _0x665cb1[_0x1149('0x2d')];}_0x3a8cd4['status'](_0x2e3033)[_0x1149('0x2e')](_0x665cb1);};}exports[_0x1149('0x2f')]=function(_0x304de5,_0x1d14ee){var _0x545795={},_0x1afa0a={},_0x5e3f32={'count':0x0,'rows':[]};var _0x3c59b2=_['map'](db[_0x1149('0x30')][_0x1149('0x31')],function(_0x50e5cf){return{'name':_0x50e5cf[_0x1149('0x32')],'type':_0x50e5cf[_0x1149('0x33')][_0x1149('0x34')]};});_0x1afa0a[_0x1149('0x35')]=_[_0x1149('0x36')](_0x3c59b2,'name');_0x1afa0a[_0x1149('0x37')]=_[_0x1149('0x38')](_0x304de5[_0x1149('0x37')]);_0x1afa0a[_0x1149('0x39')]=_['intersection'](_0x1afa0a[_0x1149('0x35')],_0x1afa0a[_0x1149('0x37')]);_0x545795[_0x1149('0x3a')]=_['intersection'](_0x1afa0a['model'],qs[_0x1149('0x3b')](_0x304de5[_0x1149('0x37')][_0x1149('0x3b')]));_0x545795[_0x1149('0x3a')]=_0x545795[_0x1149('0x3a')][_0x1149('0x3c')]?_0x545795[_0x1149('0x3a')]:_0x1afa0a[_0x1149('0x35')];if(!_0x304de5[_0x1149('0x37')]['hasOwnProperty'](_0x1149('0x3d'))){_0x545795[_0x1149('0x22')]=qs[_0x1149('0x22')](_0x304de5[_0x1149('0x37')]['limit']);_0x545795[_0x1149('0x20')]=qs['offset'](_0x304de5[_0x1149('0x37')][_0x1149('0x20')]);}_0x545795[_0x1149('0x3e')]=qs[_0x1149('0x3f')](_0x304de5[_0x1149('0x37')][_0x1149('0x3f')]);_0x545795[_0x1149('0x40')]=qs['filters'](_[_0x1149('0x41')](_0x304de5[_0x1149('0x37')],_0x1afa0a[_0x1149('0x39')]),_0x3c59b2);if(_0x304de5[_0x1149('0x37')][_0x1149('0x42')]){_0x545795[_0x1149('0x40')]=_[_0x1149('0x43')](_0x545795[_0x1149('0x40')],{'$or':_[_0x1149('0x36')](_0x3c59b2,function(_0x1f67b1){if(_0x1f67b1[_0x1149('0x33')]!==_0x1149('0x44')){var _0xf354d1={};_0xf354d1[_0x1f67b1['name']]={'$like':'%'+_0x304de5[_0x1149('0x37')][_0x1149('0x42')]+'%'};return _0xf354d1;}})});}_0x545795=_[_0x1149('0x43')]({},_0x545795,_0x304de5[_0x1149('0x45')]);var _0x2e8a96={'where':_0x545795['where']};return db[_0x1149('0x30')]['count'](_0x2e8a96)[_0x1149('0x29')](function(_0x129f06){_0x5e3f32['count']=_0x129f06;if(_0x304de5[_0x1149('0x37')][_0x1149('0x46')]){_0x545795[_0x1149('0x47')]=[{'all':!![]}];}return db['ChatGroup'][_0x1149('0x48')](_0x545795);})[_0x1149('0x29')](function(_0x5785e9){_0x5e3f32[_0x1149('0x49')]=_0x5785e9;return _0x5e3f32;})[_0x1149('0x29')](respondWithFilteredResult(_0x1d14ee,_0x545795))[_0x1149('0x4a')](handleError(_0x1d14ee,null));};exports[_0x1149('0x4b')]=function(_0x4fcd62,_0x8d48fd){var _0x386225={'raw':!![],'where':{'id':_0x4fcd62[_0x1149('0x4c')]['id']}},_0x4e2952={};_0x4e2952['model']=_[_0x1149('0x38')](db[_0x1149('0x30')]['rawAttributes']);_0x4e2952[_0x1149('0x37')]=_[_0x1149('0x38')](_0x4fcd62[_0x1149('0x37')]);_0x4e2952['filters']=_[_0x1149('0x4d')](_0x4e2952[_0x1149('0x35')],_0x4e2952[_0x1149('0x37')]);_0x386225[_0x1149('0x3a')]=_[_0x1149('0x4d')](_0x4e2952[_0x1149('0x35')],qs[_0x1149('0x3b')](_0x4fcd62[_0x1149('0x37')][_0x1149('0x3b')]));_0x386225[_0x1149('0x3a')]=_0x386225['attributes'][_0x1149('0x3c')]?_0x386225[_0x1149('0x3a')]:_0x4e2952[_0x1149('0x35')];if(_0x4fcd62[_0x1149('0x37')][_0x1149('0x46')]){_0x386225['include']=[{'all':!![]}];}_0x386225=_[_0x1149('0x43')]({},_0x386225,_0x4fcd62[_0x1149('0x45')]);return db[_0x1149('0x30')]['find'](_0x386225)[_0x1149('0x29')](handleEntityNotFound(_0x8d48fd,null))[_0x1149('0x29')](respondWithResult(_0x8d48fd,null))[_0x1149('0x4a')](handleError(_0x8d48fd,null));};exports[_0x1149('0x4e')]=function(_0x5618e6,_0x59d800){return db[_0x1149('0x30')]['create'](_0x5618e6[_0x1149('0x4f')],{})['then'](respondWithResult(_0x59d800,0xc9))['catch'](handleError(_0x59d800,null));};exports[_0x1149('0x50')]=function(_0x56dce6,_0x56e509){if(_0x56dce6[_0x1149('0x4f')]['id']){delete _0x56dce6[_0x1149('0x4f')]['id'];}return db[_0x1149('0x30')]['find']({'where':{'id':_0x56dce6[_0x1149('0x4c')]['id']}})[_0x1149('0x29')](handleEntityNotFound(_0x56e509,null))['then'](saveUpdates(_0x56dce6[_0x1149('0x4f')],null))['then'](respondWithResult(_0x56e509,null))[_0x1149('0x4a')](handleError(_0x56e509,null));};exports[_0x1149('0x2a')]=function(_0x43d52c,_0x5351b0){return db['ChatGroup']['find']({'where':{'id':_0x43d52c[_0x1149('0x4c')]['id']}})[_0x1149('0x29')](handleEntityNotFound(_0x5351b0,null))[_0x1149('0x29')](removeEntity(_0x5351b0,null))[_0x1149('0x4a')](handleError(_0x5351b0,null));};exports[_0x1149('0x51')]=function(_0x45a326,_0x45aa54){return db[_0x1149('0x30')][_0x1149('0x51')]()[_0x1149('0x29')](respondWithResult(_0x45aa54,null))[_0x1149('0x4a')](handleError(_0x45aa54,null));};exports[_0x1149('0x52')]=function(_0x42e050,_0x1b21f1,_0x2d6c22){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x42e050['params']['id'],'ToId':_0x42e050['user']['id'],'read':![]}})[_0x1149('0x29')](function(_0x8f72a8){return{'id':_[_0x1149('0x53')](_0x42e050[_0x1149('0x4c')]['id']),'count':_0x8f72a8};})[_0x1149('0x29')](respondWithResult(_0x1b21f1,null))[_0x1149('0x4a')](handleError(_0x1b21f1,null));};exports[_0x1149('0x54')]=function(_0x2148aa,_0x41cf32,_0xf91b30){return db[_0x1149('0x30')][_0x1149('0x55')]({'where':{'id':_0x2148aa[_0x1149('0x4c')]['id']}})[_0x1149('0x29')](handleEntityNotFound(_0x41cf32,null))['then'](function(_0x3400ce){if(_0x3400ce){return _0x3400ce[_0x1149('0x54')](_0x2148aa['body'][_0x1149('0x56')],_[_0x1149('0x57')](_0x2148aa[_0x1149('0x4f')],[_0x1149('0x56'),'id'])||{});}})['then'](respondWithResult(_0x41cf32,null))[_0x1149('0x4a')](handleError(_0x41cf32,null));};exports[_0x1149('0x58')]=function(_0x300960,_0x30599e,_0x31277c){var _0x49a01b={};var _0x32184e={};var _0x599b34;var _0x4af316;return db['ChatGroup'][_0x1149('0x59')]({'where':{'id':_0x300960[_0x1149('0x4c')]['id']}})[_0x1149('0x29')](handleEntityNotFound(_0x30599e,null))['then'](function(_0x473688){if(_0x473688){_0x599b34=_0x473688;_0x32184e[_0x1149('0x35')]=_['keys'](db['User'][_0x1149('0x31')]);_0x32184e[_0x1149('0x37')]=_['keys'](_0x300960[_0x1149('0x37')]);_0x32184e[_0x1149('0x39')]=_['intersection'](_0x32184e['model'],_0x32184e[_0x1149('0x37')]);_0x49a01b[_0x1149('0x3a')]=_[_0x1149('0x4d')](_0x32184e['model'],qs['fields'](_0x300960[_0x1149('0x37')][_0x1149('0x3b')]));_0x49a01b[_0x1149('0x3a')]=_0x49a01b[_0x1149('0x3a')]['length']?_0x49a01b[_0x1149('0x3a')]:_0x32184e[_0x1149('0x35')];_0x49a01b['order']=qs['sort'](_0x300960[_0x1149('0x37')][_0x1149('0x3f')]);_0x49a01b[_0x1149('0x40')]=qs['filters'](_[_0x1149('0x41')](_0x300960[_0x1149('0x37')],_0x32184e[_0x1149('0x39')]));if(_0x300960['query'][_0x1149('0x42')]){_0x49a01b[_0x1149('0x40')]=_[_0x1149('0x43')](_0x49a01b['where'],{'$or':_[_0x1149('0x36')](_0x49a01b['attributes'],function(_0x37ce46){var _0x224a34={};_0x224a34[_0x37ce46]={'$like':'%'+_0x300960['query'][_0x1149('0x42')]+'%'};return _0x224a34;})});}_0x49a01b=_['merge']({},_0x49a01b,_0x300960['options']);return _0x599b34[_0x1149('0x58')](_0x49a01b);}})[_0x1149('0x29')](function(_0x1728ae){if(_0x1728ae){_0x4af316=_0x1728ae[_0x1149('0x3c')];if(!_0x300960[_0x1149('0x37')]['hasOwnProperty'](_0x1149('0x3d'))){_0x49a01b['limit']=qs['limit'](_0x300960[_0x1149('0x37')][_0x1149('0x22')]);_0x49a01b[_0x1149('0x20')]=qs['offset'](_0x300960[_0x1149('0x37')][_0x1149('0x20')]);}return _0x599b34[_0x1149('0x58')](_0x49a01b);}})['then'](function(_0x4d9973){if(_0x4d9973){return _0x4d9973?{'count':_0x4af316,'rows':_0x4d9973}:null;}})[_0x1149('0x29')](respondWithResult(_0x30599e,null))[_0x1149('0x4a')](handleError(_0x30599e,null));};exports[_0x1149('0x5a')]=function(_0x2614e9,_0x292ff9,_0x319919){return db[_0x1149('0x30')]['find']({'where':{'id':_0x2614e9['params']['id']}})[_0x1149('0x29')](handleEntityNotFound(_0x292ff9,null))[_0x1149('0x29')](function(_0x45d90d){if(_0x45d90d){return _0x45d90d[_0x1149('0x5a')](_0x2614e9[_0x1149('0x37')][_0x1149('0x56')]);}})[_0x1149('0x29')](respondWithStatusCode(_0x292ff9,null))[_0x1149('0x4a')](handleError(_0x292ff9,null));};exports[_0x1149('0x5b')]=function(_0x4c6db8,_0x17d4e2,_0x5537f6){if(_0x4c6db8[_0x1149('0x4f')]['id']){delete _0x4c6db8[_0x1149('0x4f')]['id'];}return db[_0x1149('0x30')][_0x1149('0x55')]({'where':{'id':_0x4c6db8[_0x1149('0x4c')]['id']}})['then'](handleEntityNotFound(_0x17d4e2,null))[_0x1149('0x29')](function(_0xf139b3){if(_0xf139b3){_0x4c6db8['body']['ChatGroupId']=_0xf139b3['id'];return db['ChatInternalMessage'][_0x1149('0x4e')](_0x4c6db8[_0x1149('0x4f')]);}})['then'](respondWithResult(_0x17d4e2,null))[_0x1149('0x4a')](handleError(_0x17d4e2,null));};exports[_0x1149('0x5c')]=function(_0x2ba96f,_0x454e4c,_0x4bb1cd){var _0x47d2f1={};var _0x425530={};var _0x538fc6;var _0x355056;return db[_0x1149('0x30')]['findOne']({'where':{'id':_0x2ba96f[_0x1149('0x4c')]['id']}})[_0x1149('0x29')](handleEntityNotFound(_0x454e4c,null))['then'](function(_0x656113){if(_0x656113){_0x538fc6=_0x656113;_0x425530[_0x1149('0x35')]=_[_0x1149('0x38')](db[_0x1149('0x5d')][_0x1149('0x31')]);_0x425530[_0x1149('0x37')]=_[_0x1149('0x38')](_0x2ba96f['query']);_0x425530[_0x1149('0x39')]=_['intersection'](_0x425530[_0x1149('0x35')],_0x425530[_0x1149('0x37')]);_0x47d2f1['attributes']=_['intersection'](_0x425530[_0x1149('0x35')],qs[_0x1149('0x3b')](_0x2ba96f[_0x1149('0x37')][_0x1149('0x3b')]));_0x47d2f1[_0x1149('0x3a')]=_0x47d2f1[_0x1149('0x3a')][_0x1149('0x3c')]?_0x47d2f1[_0x1149('0x3a')]:_0x425530[_0x1149('0x35')];_0x47d2f1[_0x1149('0x3e')]=qs[_0x1149('0x3f')](_0x2ba96f[_0x1149('0x37')][_0x1149('0x3f')]);_0x47d2f1[_0x1149('0x40')]=qs[_0x1149('0x39')](_['pick'](_0x2ba96f[_0x1149('0x37')],_0x425530[_0x1149('0x39')]));if(_0x2ba96f['query'][_0x1149('0x42')]){_0x47d2f1[_0x1149('0x40')]=_['merge'](_0x47d2f1[_0x1149('0x40')],{'$or':_[_0x1149('0x36')](_0x47d2f1[_0x1149('0x3a')],function(_0x2d81e3){var _0x2148a9={};_0x2148a9[_0x2d81e3]={'$like':'%'+_0x2ba96f['query'][_0x1149('0x42')]+'%'};return _0x2148a9;})});}if(_0x2ba96f['query']['$gte']){var _0x4fa56f=_0x2ba96f[_0x1149('0x37')]['$gte'][_0x1149('0x5e')](',');var _0x2b766f={};_0x2b766f[_0x4fa56f[0x0]]={'$gte':moment(_0x4fa56f[0x1])[_0x1149('0x5f')](_0x1149('0x60'))};_0x47d2f1[_0x1149('0x40')]=_[_0x1149('0x43')](_0x47d2f1['where'],_0x2b766f);}_0x47d2f1=_[_0x1149('0x43')]({},_0x47d2f1,_0x2ba96f['options']);return _0x538fc6[_0x1149('0x5c')](_0x47d2f1);}})[_0x1149('0x29')](function(_0x7fec3a){if(_0x7fec3a){_0x355056=_0x7fec3a['length'];if(!_0x2ba96f[_0x1149('0x37')][_0x1149('0x61')]('nolimit')){_0x47d2f1[_0x1149('0x22')]=qs['limit'](_0x2ba96f[_0x1149('0x37')][_0x1149('0x22')]);_0x47d2f1[_0x1149('0x20')]=qs['offset'](_0x2ba96f[_0x1149('0x37')][_0x1149('0x20')]);}return _0x538fc6[_0x1149('0x5c')](_0x47d2f1);}})[_0x1149('0x29')](function(_0x3f1bd6){if(_0x3f1bd6){return _0x3f1bd6?{'count':_0x355056,'rows':_0x3f1bd6}:null;}})[_0x1149('0x29')](respondWithResult(_0x454e4c,null))['catch'](handleError(_0x454e4c,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 8089a48..b49dda2 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 _0x7df7=['events','../../mysqldb','save','emit','hasOwnProperty','hook','exports'];(function(_0x12af14,_0x135bc5){var _0x100286=function(_0x49ba84){while(--_0x49ba84){_0x12af14['push'](_0x12af14['shift']());}};_0x100286(++_0x135bc5);}(_0x7df7,0x1b9));var _0x77df=function(_0x62d2a,_0x487183){_0x62d2a=_0x62d2a-0x0;var _0x1591c2=_0x7df7[_0x62d2a];return _0x1591c2;};'use strict';var EventEmitter=require(_0x77df('0x0'));var ChatGroup=require(_0x77df('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x77df('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x285d75){return function(_0x5b091b,_0x1c65b7,_0x4719d9){ChatGroupEvents[_0x77df('0x3')](_0x285d75+':'+_0x5b091b['id'],_0x5b091b);ChatGroupEvents[_0x77df('0x3')](_0x285d75,_0x5b091b);_0x4719d9(null);};}for(var e in events){if(events[_0x77df('0x4')](e)){var event=events[e];ChatGroup[_0x77df('0x5')](e,emitEvent(event));}}module[_0x77df('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x0075=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update'];(function(_0x3077c7,_0x486647){var _0xceb15a=function(_0x25de21){while(--_0x25de21){_0x3077c7['push'](_0x3077c7['shift']());}};_0xceb15a(++_0x486647);}(_0x0075,0x150));var _0x5007=function(_0x447a41,_0x5ec7e4){_0x447a41=_0x447a41-0x0;var _0x327c50=_0x0075[_0x447a41];return _0x327c50;};'use strict';var EventEmitter=require(_0x5007('0x0'));var ChatGroup=require(_0x5007('0x1'))['db'][_0x5007('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5007('0x3')](0x0);var events={'afterCreate':_0x5007('0x4'),'afterUpdate':_0x5007('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3d4e8a){return function(_0x32aefa,_0x4587c1,_0x90dd8b){ChatGroupEvents['emit'](_0x3d4e8a+':'+_0x32aefa['id'],_0x32aefa);ChatGroupEvents[_0x5007('0x6')](_0x3d4e8a,_0x32aefa);_0x90dd8b(null);};}for(var e in events){if(events[_0x5007('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x5007('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 945e690..8f0f469 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 _0x013d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','util'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x013d,0x83));var _0xd013=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x013d[_0x349148];return _0x2f2b0f;};'use strict';var _=require('lodash');var util=require(_0xd013('0x0'));var logger=require('../../config/logger')(_0xd013('0x1'));var moment=require('moment');var BPromise=require(_0xd013('0x2'));var rp=require(_0xd013('0x3'));var fs=require('fs');var path=require(_0xd013('0x4'));var rimraf=require(_0xd013('0x5'));var config=require(_0xd013('0x6'));var attributes=require(_0xd013('0x7'));module[_0xd013('0x8')]=function(_0x46a9dc,_0x910a50){return _0x46a9dc[_0xd013('0x9')]('ChatGroup',attributes,{'tableName':_0xd013('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdf2b=['ChatGroup','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','define'];(function(_0xab5658,_0x97965f){var _0x4a45fc=function(_0xecf1bd){while(--_0xecf1bd){_0xab5658['push'](_0xab5658['shift']());}};_0x4a45fc(++_0x97965f);}(_0xdf2b,0xb1));var _0xbdf2=function(_0x273275,_0x12bcf9){_0x273275=_0x273275-0x0;var _0x3088bf=_0xdf2b[_0x273275];return _0x3088bf;};'use strict';var _=require(_0xbdf2('0x0'));var util=require(_0xbdf2('0x1'));var logger=require(_0xbdf2('0x2'))('api');var moment=require(_0xbdf2('0x3'));var BPromise=require(_0xbdf2('0x4'));var rp=require(_0xbdf2('0x5'));var fs=require('fs');var path=require(_0xbdf2('0x6'));var rimraf=require('rimraf');var config=require(_0xbdf2('0x7'));var attributes=require(_0xbdf2('0x8'));module['exports']=function(_0x1830e4,_0x5bd857){return _0x1830e4[_0xbdf2('0x9')](_0xbdf2('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 b762ae3..137148d 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 _0x8403=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2fa300,_0x2303bb){var _0x3efb0a=function(_0x58dc71){while(--_0x58dc71){_0x2fa300['push'](_0x2fa300['shift']());}};_0x3efb0a(++_0x2303bb);}(_0x8403,0x1a5));var _0x3840=function(_0x3ab768,_0x3ff75c){_0x3ab768=_0x3ab768-0x0;var _0x1c2137=_0x8403[_0x3ab768];return _0x1c2137;};'use strict';var _=require(_0x3840('0x0'));var util=require(_0x3840('0x1'));var moment=require(_0x3840('0x2'));var BPromise=require(_0x3840('0x3'));var rs=require(_0x3840('0x4'));var fs=require('fs');var Redis=require(_0x3840('0x5'));var db=require(_0x3840('0x6'))['db'];var utils=require(_0x3840('0x7'));var logger=require(_0x3840('0x8'))('rpc');var config=require(_0x3840('0x9'));var jayson=require(_0x3840('0xa'));var client=jayson[_0x3840('0xb')][_0x3840('0xc')]({'port':0x232a});config[_0x3840('0xd')]=_[_0x3840('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3840('0xf'))(new Redis(config[_0x3840('0xd')]));require(_0x3840('0x10'))['register'](socket);function respondWithRpcPromise(_0x485084,_0x30ba1a,_0x3d2002){return new BPromise(function(_0x24da73,_0x129b36){return client[_0x3840('0x11')](_0x485084,_0x3d2002)[_0x3840('0x12')](function(_0x11b330){logger[_0x3840('0x13')](_0x3840('0x14'),_0x30ba1a,_0x3840('0x15'));logger['debug'](_0x3840('0x16'),_0x30ba1a,_0x3840('0x15'),JSON[_0x3840('0x17')](_0x11b330));if(_0x11b330['error']){if(_0x11b330[_0x3840('0x18')][_0x3840('0x19')]===0x1f4){logger['error'](_0x3840('0x14'),_0x30ba1a,_0x11b330[_0x3840('0x18')][_0x3840('0x1a')]);return _0x129b36(_0x11b330[_0x3840('0x18')][_0x3840('0x1a')]);}logger[_0x3840('0x18')](_0x3840('0x14'),_0x30ba1a,_0x11b330[_0x3840('0x18')][_0x3840('0x1a')]);return _0x24da73(_0x11b330[_0x3840('0x18')][_0x3840('0x1a')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x30ba1a,_0x3840('0x15'));_0x24da73(_0x11b330['result'][_0x3840('0x1a')]);}})[_0x3840('0x1b')](function(_0x4a6f6e){logger['error'](_0x3840('0x14'),_0x30ba1a,_0x4a6f6e);_0x129b36(_0x4a6f6e);});});} \ No newline at end of file +var _0xfbdb=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x22c4cf,_0x39b89d){var _0x1c5a3f=function(_0x47bc02){while(--_0x47bc02){_0x22c4cf['push'](_0x22c4cf['shift']());}};_0x1c5a3f(++_0x39b89d);}(_0xfbdb,0x1ba));var _0xbfbd=function(_0x1cf181,_0x2586af){_0x1cf181=_0x1cf181-0x0;var _0x304304=_0xfbdb[_0x1cf181];return _0x304304;};'use strict';var _=require(_0xbfbd('0x0'));var util=require('util');var moment=require(_0xbfbd('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfbd('0x2'));var fs=require('fs');var Redis=require(_0xbfbd('0x3'));var db=require(_0xbfbd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfbd('0x5'))(_0xbfbd('0x6'));var config=require(_0xbfbd('0x7'));var jayson=require(_0xbfbd('0x8'));var client=jayson[_0xbfbd('0x9')][_0xbfbd('0xa')]({'port':0x232a});config[_0xbfbd('0xb')]=_[_0xbfbd('0xc')](config[_0xbfbd('0xb')],{'host':_0xbfbd('0xd'),'port':0x18eb});var socket=require(_0xbfbd('0xe'))(new Redis(config['redis']));require(_0xbfbd('0xf'))[_0xbfbd('0x10')](socket);function respondWithRpcPromise(_0x3c30b9,_0x59fcb0,_0x38baab){return new BPromise(function(_0x1d15fe,_0x30dca7){return client[_0xbfbd('0x11')](_0x3c30b9,_0x38baab)['then'](function(_0x5cd1ad){logger[_0xbfbd('0x12')](_0xbfbd('0x13'),_0x59fcb0,_0xbfbd('0x14'));logger[_0xbfbd('0x15')](_0xbfbd('0x16'),_0x59fcb0,_0xbfbd('0x14'),JSON['stringify'](_0x5cd1ad));if(_0x5cd1ad['error']){if(_0x5cd1ad['error'][_0xbfbd('0x17')]===0x1f4){logger['error'](_0xbfbd('0x13'),_0x59fcb0,_0x5cd1ad[_0xbfbd('0x18')]['message']);return _0x30dca7(_0x5cd1ad[_0xbfbd('0x18')][_0xbfbd('0x19')]);}logger[_0xbfbd('0x18')](_0xbfbd('0x13'),_0x59fcb0,_0x5cd1ad[_0xbfbd('0x18')]['message']);return _0x1d15fe(_0x5cd1ad[_0xbfbd('0x18')][_0xbfbd('0x19')]);}else{logger[_0xbfbd('0x12')](_0xbfbd('0x13'),_0x59fcb0,_0xbfbd('0x14'));_0x1d15fe(_0x5cd1ad[_0xbfbd('0x1a')][_0xbfbd('0x19')]);}})[_0xbfbd('0x1b')](function(_0x15aee7){logger[_0xbfbd('0x18')](_0xbfbd('0x13'),_0x59fcb0,_0x15aee7);_0x30dca7(_0x15aee7);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b168396..64fb383 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 _0xe42c=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x2d4158,_0x336010){var _0x2b93eb=function(_0x28efc3){while(--_0x28efc3){_0x2d4158['push'](_0x2d4158['shift']());}};_0x2b93eb(++_0x336010);}(_0xe42c,0x149));var _0xce42=function(_0x1fc02e,_0x1a7391){_0x1fc02e=_0x1fc02e-0x0;var _0x1875e9=_0xe42c[_0x1fc02e];return _0x1875e9;};'use strict';var ChatGroupEvents=require(_0xce42('0x0'));var events=[_0xce42('0x1'),_0xce42('0x2'),_0xce42('0x3')];function createListener(_0x467c4f,_0x28066c){return function(_0x18c4a3){_0x28066c[_0xce42('0x4')](_0x467c4f,_0x18c4a3);};}function removeListener(_0x474e7e,_0x5a93d5){return function(){ChatGroupEvents[_0xce42('0x5')](_0x474e7e,_0x5a93d5);};}exports[_0xce42('0x6')]=function(_0x1c727a){for(var _0x2b25bf=0x0,_0x1cb98b=events[_0xce42('0x7')];_0x2b25bf<_0x1cb98b;_0x2b25bf++){var _0x442644=events[_0x2b25bf];var _0xf0dde5=createListener(_0xce42('0x8')+_0x442644,_0x1c727a);ChatGroupEvents['on'](_0x442644,_0xf0dde5);}}; \ No newline at end of file +var _0xe159=['removeListener','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x2a10ad,_0x4f6fc6){var _0x4a2578=function(_0x3e3e2c){while(--_0x3e3e2c){_0x2a10ad['push'](_0x2a10ad['shift']());}};_0x4a2578(++_0x4f6fc6);}(_0xe159,0x18b));var _0x9e15=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xe159[_0x3ab51d];return _0x29a04e;};'use strict';var ChatGroupEvents=require(_0x9e15('0x0'));var events=[_0x9e15('0x1'),_0x9e15('0x2'),_0x9e15('0x3')];function createListener(_0x135081,_0x36d12c){return function(_0x27dab1){_0x36d12c[_0x9e15('0x4')](_0x135081,_0x27dab1);};}function removeListener(_0x38bedb,_0x2def29){return function(){ChatGroupEvents[_0x9e15('0x5')](_0x38bedb,_0x2def29);};}exports['register']=function(_0x49d82c){for(var _0x517049=0x0,_0x3a5149=events[_0x9e15('0x6')];_0x517049<_0x3a5149;_0x517049++){var _0x17f21e=events[_0x517049];var _0x30c14e=createListener(_0x9e15('0x7')+_0x17f21e,_0x49d82c);ChatGroupEvents['on'](_0x17f21e,_0x30c14e);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index f73b4d9..b405503 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 _0xf60b=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36a224,_0x63b472){var _0x4de1d9=function(_0x3db956){while(--_0x3db956){_0x36a224['push'](_0x36a224['shift']());}};_0x4de1d9(++_0x63b472);}(_0xf60b,0xda));var _0xbf60=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0xf60b[_0x1c0991];return _0x5034de;};'use strict';var multer=require(_0xbf60('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbf60('0x1'));var express=require(_0xbf60('0x2'));var router=express[_0xbf60('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf60('0x4'));var interaction=require(_0xbf60('0x5'));var config=require(_0xbf60('0x6'));var controller=require('./chatGroup.controller');router[_0xbf60('0x7')]('/',auth['isAuthenticated'](),controller[_0xbf60('0x8')]);router[_0xbf60('0x7')](_0xbf60('0x9'),auth[_0xbf60('0xa')](),controller[_0xbf60('0xb')]);router['get'](_0xbf60('0xc'),auth[_0xbf60('0xa')](),controller[_0xbf60('0xd')]);router[_0xbf60('0x7')]('/:id/unread',auth[_0xbf60('0xa')](),controller['getUnread']);router['get'](_0xbf60('0xe'),auth[_0xbf60('0xa')](),controller[_0xbf60('0xf')]);router['get'](_0xbf60('0x10'),auth[_0xbf60('0xa')](),controller['getMessages']);router[_0xbf60('0x11')]('/',auth[_0xbf60('0xa')](),controller[_0xbf60('0x12')]);router[_0xbf60('0x11')](_0xbf60('0xe'),auth[_0xbf60('0xa')](),controller[_0xbf60('0x13')]);router[_0xbf60('0x11')](_0xbf60('0x10'),auth['isAuthenticated'](),controller[_0xbf60('0x14')]);router['put'](_0xbf60('0xc'),auth[_0xbf60('0xa')](),controller[_0xbf60('0x15')]);router[_0xbf60('0x16')](_0xbf60('0xc'),auth[_0xbf60('0xa')](),controller[_0xbf60('0x17')]);router[_0xbf60('0x16')](_0xbf60('0xe'),auth[_0xbf60('0xa')](),controller['removeMembers']);module[_0xbf60('0x18')]=router; \ No newline at end of file +var _0x7db2=['/describe','/:id','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','update','delete','removeMembers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x7db2,0x15f));var _0x27db=function(_0x13dff6,_0x1f41ee){_0x13dff6=_0x13dff6-0x0;var _0x2729e7=_0x7db2[_0x13dff6];return _0x2729e7;};'use strict';var multer=require('multer');var util=require(_0x27db('0x0'));var path=require(_0x27db('0x1'));var timeout=require(_0x27db('0x2'));var express=require(_0x27db('0x3'));var router=express[_0x27db('0x4')]();var fs_extra=require(_0x27db('0x5'));var auth=require(_0x27db('0x6'));var interaction=require(_0x27db('0x7'));var config=require(_0x27db('0x8'));var controller=require(_0x27db('0x9'));router[_0x27db('0xa')]('/',auth[_0x27db('0xb')](),controller[_0x27db('0xc')]);router['get'](_0x27db('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x27db('0xa')](_0x27db('0xe'),auth[_0x27db('0xb')](),controller['show']);router[_0x27db('0xa')]('/:id/unread',auth[_0x27db('0xb')](),controller['getUnread']);router['get'](_0x27db('0xf'),auth[_0x27db('0xb')](),controller[_0x27db('0x10')]);router[_0x27db('0xa')](_0x27db('0x11'),auth[_0x27db('0xb')](),controller[_0x27db('0x12')]);router[_0x27db('0x13')]('/',auth[_0x27db('0xb')](),controller[_0x27db('0x14')]);router['post'](_0x27db('0xf'),auth['isAuthenticated'](),controller[_0x27db('0x15')]);router[_0x27db('0x13')]('/:id/messages',auth['isAuthenticated'](),controller[_0x27db('0x16')]);router[_0x27db('0x17')](_0x27db('0xe'),auth[_0x27db('0xb')](),controller[_0x27db('0x18')]);router[_0x27db('0x19')](_0x27db('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x27db('0x19')](_0x27db('0xf'),auth['isAuthenticated'](),controller[_0x27db('0x1a')]);module[_0x27db('0x1b')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 928ba0a..641a738 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 _0x7af2=['out','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','STRING','DATE'];(function(_0xbf54aa,_0x242ccf){var _0x5a7478=function(_0x3eb1d1){while(--_0x3eb1d1){_0xbf54aa['push'](_0xbf54aa['shift']());}};_0x5a7478(++_0x242ccf);}(_0x7af2,0x119));var _0x27af=function(_0x22d6f8,_0x4bbab4){_0x22d6f8=_0x22d6f8-0x0;var _0xdff824=_0x7af2[_0x22d6f8];return _0xdff824;};'use strict';var Sequelize=require('sequelize');module[_0x27af('0x0')]={'closed':{'type':Sequelize[_0x27af('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x27af('0x2')]},'ratingType':{'type':Sequelize[_0x27af('0x3')]('star',_0x27af('0x4')),'defaultValue':_0x27af('0x5')},'ratingMessage':{'type':Sequelize[_0x27af('0x6')]},'pathTranscript':{'type':Sequelize[_0x27af('0x6')]},'mailTranscript':{'type':Sequelize[_0x27af('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x27af('0x8')]},'disposition':{'type':Sequelize[_0x27af('0x7')]},'secondDisposition':{'type':Sequelize[_0x27af('0x7')]},'thirdDisposition':{'type':Sequelize[_0x27af('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x27af('0x7')]},'browserVersion':{'type':Sequelize[_0x27af('0x7')]},'osName':{'type':Sequelize[_0x27af('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x27af('0x7')]},'deviceVendor':{'type':Sequelize[_0x27af('0x7')]},'deviceType':{'type':Sequelize[_0x27af('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x27af('0x7')]},'formData':{'type':Sequelize['TEXT']('long')},'read1stAt':{'type':Sequelize[_0x27af('0x8')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x27af('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x27af('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x27af('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x152f=['sequelize','exports','BOOLEAN','INTEGER','ENUM','thumb','star','TEXT','DATE','STRING','long','out'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x152f,0x144));var _0xf152=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x152f[_0x4bb66f];return _0xf2772f;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'closed':{'type':Sequelize[_0xf152('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf152('0x3')]},'ratingType':{'type':Sequelize[_0xf152('0x4')]('star',_0xf152('0x5')),'defaultValue':_0xf152('0x6')},'ratingMessage':{'type':Sequelize[_0xf152('0x7')]},'pathTranscript':{'type':Sequelize[_0xf152('0x7')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf152('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf152('0x9')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf152('0x9')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xf152('0x9')]},'osVersion':{'type':Sequelize[_0xf152('0x9')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xf152('0x9')]},'deviceType':{'type':Sequelize[_0xf152('0x9')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xf152('0x9')]},'formData':{'type':Sequelize[_0xf152('0x7')](_0xf152('0xa'))},'read1stAt':{'type':Sequelize[_0xf152('0x8')]},'lastMsgAt':{'type':Sequelize[_0xf152('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xf152('0x4')]('in',_0xf152('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf152('0x9')]},'customerPort':{'type':Sequelize[_0xf152('0x9')]},'vidaooSessionId':{'type':Sequelize[_0xf152('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0xf152('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 a2b294f..b9e2b04 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 _0x3ea5=['agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','intersection','hasOwnProperty','nolimit','order','sort','where','filters','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','includeAgent','push','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','firstName','lastName','attachments','createdAt','read','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','referer','customerPort','tail','existsSync','createReadStream','pipe','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','send','body','contact','agent','account','index','map','ChatInteraction','rawAttributes','fieldName','getOptions','user','catch','show','params','model','keys','query','attributes','fields','length','includeAll','include','merge','options','find','create','describe','createVidaooSession','ChatWebsite','findOne','ChatWebsiteId','vidaooApiKey','vidaooTopic','vidaooNote','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','Sequelize','Interaction\x20already\x20assigned','update','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','type','Attachment','attachmentDownload','closed','attachId','join','root','server/files/attachments/','offline-chat/','basename','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','User','CmContact','Messages','%s%d','agentAlias','UserId','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias'];(function(_0x491faf,_0x60487e){var _0x10090d=function(_0x594c84){while(--_0x594c84){_0x491faf['push'](_0x491faf['shift']());}};_0x10090d(++_0x60487e);}(_0x3ea5,0x1f3));var _0x53ea=function(_0xaac72c,_0x5d943f){_0xaac72c=_0xaac72c-0x0;var _0x1e7923=_0x3ea5[_0xaac72c];return _0x1e7923;};'use strict';var rimraf=require(_0x53ea('0x0'));var zipdir=require(_0x53ea('0x1'));var rp=require('request-promise');var moment=require(_0x53ea('0x2'));var BPromise=require(_0x53ea('0x3'));var Mustache=require(_0x53ea('0x4'));var util=require(_0x53ea('0x5'));var path=require(_0x53ea('0x6'));var ejs=require(_0x53ea('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x53ea('0x8'));var interaction=require(_0x53ea('0x9'));var qs=require(_0x53ea('0xa'));var pdf=require(_0x53ea('0xb'));var logger=require(_0x53ea('0xc'))(_0x53ea('0xd'));var config=require('../../config/environment');var db=require(_0x53ea('0xe'))['db'];config[_0x53ea('0xf')]=_[_0x53ea('0x10')](config[_0x53ea('0xf')],{'host':_0x53ea('0x11'),'port':0x18eb});var socket=require(_0x53ea('0x12'))(new Redis(config[_0x53ea('0xf')]));require(_0x53ea('0x13'))[_0x53ea('0x14')](socket);var jayson=require(_0x53ea('0x15'));var client=jayson[_0x53ea('0x16')]['http']({'port':0x232b});var client9004=jayson[_0x53ea('0x16')][_0x53ea('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x15d15f,_0x3d7fe6,_0x396f9b,_0x3738e9){return new BPromise(function(_0x2fa6ef,_0x5ee29d){var _0x42fce1=_0x3738e9||client;return _0x42fce1['request'](_0x15d15f,_0x396f9b)[_0x53ea('0x18')](function(_0x57fda6){logger[_0x53ea('0x19')](_0x53ea('0x1a'),_0x3d7fe6,_0x53ea('0x1b'));logger[_0x53ea('0x1c')](_0x53ea('0x1d'),_0x3d7fe6,_0x53ea('0x1b'),JSON[_0x53ea('0x1e')](_0x57fda6));if(_0x57fda6[_0x53ea('0x1f')]){if(_0x57fda6[_0x53ea('0x1f')][_0x53ea('0x20')]===0x1f4){logger[_0x53ea('0x1f')]('ChatInteraction,\x20%s,\x20%s',_0x3d7fe6,_0x57fda6[_0x53ea('0x1f')][_0x53ea('0x21')]);return _0x5ee29d(_0x57fda6['error'][_0x53ea('0x21')]);}logger[_0x53ea('0x1f')](_0x53ea('0x1a'),_0x3d7fe6,_0x57fda6[_0x53ea('0x1f')][_0x53ea('0x21')]);return _0x2fa6ef(_0x57fda6[_0x53ea('0x1f')]['message']);}else{logger['info'](_0x53ea('0x1a'),_0x3d7fe6,_0x53ea('0x1b'));_0x2fa6ef(_0x57fda6[_0x53ea('0x22')]['message']);}})['catch'](function(_0x4d8406){logger[_0x53ea('0x1f')](_0x53ea('0x1a'),_0x3d7fe6,_0x4d8406);_0x5ee29d(_0x4d8406);});});}function respondWithStatusCode(_0x2ea8f8,_0x178bbe){_0x178bbe=_0x178bbe||0xcc;return function(_0xdec1e5){if(_0xdec1e5){return _0x2ea8f8[_0x53ea('0x23')](_0x178bbe);}return _0x2ea8f8[_0x53ea('0x24')](_0x178bbe)[_0x53ea('0x25')]();};}function respondWithResult(_0x1f35a6,_0x3a2d16){_0x3a2d16=_0x3a2d16||0xc8;return function(_0x49eb43){if(_0x49eb43){return _0x1f35a6[_0x53ea('0x24')](_0x3a2d16)[_0x53ea('0x26')](_0x49eb43);}};}function respondWithFilteredResult(_0x3652be,_0x5813ca){return function(_0x3de18e){if(_0x3de18e){var _0xac9162=typeof _0x5813ca[_0x53ea('0x27')]===_0x53ea('0x28')&&typeof _0x5813ca[_0x53ea('0x29')]===_0x53ea('0x28');var _0x29be2f=_0x3de18e[_0x53ea('0x2a')];var _0x148c67=_0xac9162?0x0:_0x5813ca[_0x53ea('0x27')];var _0x112243=_0xac9162?_0x3de18e[_0x53ea('0x2a')]:_0x5813ca[_0x53ea('0x27')]+_0x5813ca[_0x53ea('0x29')];var _0x9112d7;if(_0x112243>=_0x29be2f){_0x112243=_0x29be2f;_0x9112d7=0xc8;}else{_0x9112d7=0xce;}_0x3652be['status'](_0x9112d7);return _0x3652be[_0x53ea('0x2b')](_0x53ea('0x2c'),_0x148c67+'-'+_0x112243+'/'+_0x29be2f)[_0x53ea('0x26')](_0x3de18e);}return null;};}function saveUpdates(_0x4c7609){return function(_0x59e42c){if(_0x59e42c){return _0x59e42c['update'](_0x4c7609)[_0x53ea('0x18')](function(_0x43d6db){return _0x43d6db;});}return null;};}function removeEntity(_0x3c6d72){return function(_0x166755){if(_0x166755){return _0x166755[_0x53ea('0x2d')]()['then'](function(){_0x3c6d72[_0x53ea('0x24')](0xcc)[_0x53ea('0x25')]();});}};}function handleEntityNotFound(_0x69c5d6){return function(_0x229848){if(!_0x229848){_0x69c5d6[_0x53ea('0x23')](0x194);}return _0x229848;};}function handleError(_0x3933a4,_0x27a64e){_0x27a64e=_0x27a64e||0x1f4;return function(_0x5f19c6){logger[_0x53ea('0x1f')](_0x5f19c6[_0x53ea('0x2e')]);if(_0x5f19c6[_0x53ea('0x2f')]){delete _0x5f19c6[_0x53ea('0x2f')];}_0x3933a4['status'](_0x27a64e)[_0x53ea('0x30')](_0x5f19c6);};}function getMustacheRender(_0x264bda,_0x56ed2b){return Mustache['render'](_0x264bda,_['merge'](_0x56ed2b[_0x53ea('0x31')],{'contact':_0x56ed2b[_0x53ea('0x32')],'message':_0x56ed2b[_0x53ea('0x21')],'agent':_0x56ed2b[_0x53ea('0x33')],'interaction':_0x56ed2b['interaction'],'account':_0x56ed2b[_0x53ea('0x34')]}))||'';}exports[_0x53ea('0x35')]=function(_0x396feb,_0x297468){var _0x388ccc={};var _0x1ef520=_[_0x53ea('0x36')](db[_0x53ea('0x37')][_0x53ea('0x38')],function(_0x513024){return{'name':_0x513024[_0x53ea('0x39')],'type':_0x513024['type']['key']};});_0x388ccc=qs[_0x53ea('0x3a')](_0x1ef520,_0x396feb);return interaction['findAll']('chat',_0x396feb['query'],_0x396feb[_0x53ea('0x3b')],_0x388ccc,_0x1ef520)[_0x53ea('0x18')](respondWithFilteredResult(_0x297468,_0x388ccc))[_0x53ea('0x3c')](handleError(_0x297468,null));};exports[_0x53ea('0x3d')]=function(_0x38a7e9,_0x157644){var _0x54e2d2={'raw':![],'where':{'id':_0x38a7e9[_0x53ea('0x3e')]['id']}},_0x1eee8b={};_0x1eee8b[_0x53ea('0x3f')]=_[_0x53ea('0x40')](db[_0x53ea('0x37')][_0x53ea('0x38')]);_0x1eee8b[_0x53ea('0x41')]=_['keys'](_0x38a7e9[_0x53ea('0x41')]);_0x1eee8b['filters']=_['intersection'](_0x1eee8b[_0x53ea('0x3f')],_0x1eee8b[_0x53ea('0x41')]);_0x54e2d2[_0x53ea('0x42')]=_['intersection'](_0x1eee8b['model'],qs[_0x53ea('0x43')](_0x38a7e9['query'][_0x53ea('0x43')]));_0x54e2d2[_0x53ea('0x42')]=_0x54e2d2['attributes'][_0x53ea('0x44')]?_0x54e2d2[_0x53ea('0x42')]:_0x1eee8b[_0x53ea('0x3f')];if(_0x38a7e9[_0x53ea('0x41')][_0x53ea('0x45')]){_0x54e2d2[_0x53ea('0x46')]=[{'all':!![]}];}_0x54e2d2=_[_0x53ea('0x47')]({},_0x54e2d2,_0x38a7e9[_0x53ea('0x48')]);return db[_0x53ea('0x37')][_0x53ea('0x49')](_0x54e2d2)['then'](handleEntityNotFound(_0x157644,null))[_0x53ea('0x18')](respondWithResult(_0x157644,null))[_0x53ea('0x3c')](handleError(_0x157644,null));};exports['create']=function(_0x47a71b,_0x1ad256){return db[_0x53ea('0x37')][_0x53ea('0x4a')](_0x47a71b[_0x53ea('0x31')],{})[_0x53ea('0x18')](respondWithResult(_0x1ad256,0xc9))[_0x53ea('0x3c')](handleError(_0x1ad256,null));};exports['update']=function(_0x78e813,_0x13fb7c){if(_0x78e813[_0x53ea('0x31')]['id']){delete _0x78e813[_0x53ea('0x31')]['id'];}return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x78e813['params']['id']}})['then'](handleEntityNotFound(_0x13fb7c,null))[_0x53ea('0x18')](saveUpdates(_0x78e813[_0x53ea('0x31')],null))[_0x53ea('0x18')](respondWithResult(_0x13fb7c,null))[_0x53ea('0x3c')](handleError(_0x13fb7c,null));};exports[_0x53ea('0x2d')]=function(_0x1a68fb,_0x4bd9da){return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x1a68fb[_0x53ea('0x3e')]['id']}})[_0x53ea('0x18')](handleEntityNotFound(_0x4bd9da,null))['then'](removeEntity(_0x4bd9da,null))[_0x53ea('0x3c')](handleError(_0x4bd9da,null));};exports[_0x53ea('0x4b')]=function(_0x437dcd,_0xa8f3b7){return db[_0x53ea('0x37')][_0x53ea('0x4b')]()[_0x53ea('0x18')](respondWithResult(_0xa8f3b7,null))['catch'](handleError(_0xa8f3b7,null));};exports[_0x53ea('0x4c')]=function(_0x5d3b6d,_0x1fe553){var _0x3603b9=_0x5d3b6d['params']['id'];var _0x35d287;var _0x4b8b5c;var _0x1515a0;return db[_0x53ea('0x37')]['findOne']({'where':{'id':_0x3603b9}})[_0x53ea('0x18')](function(_0xca55e3){_0x35d287=_0xca55e3;return db[_0x53ea('0x4d')][_0x53ea('0x4e')]({'where':{'id':_0xca55e3[_0x53ea('0x4f')]},'attributes':['id',_0x53ea('0x50'),'vidaooEscalation',_0x53ea('0x51'),_0x53ea('0x52'),'vidaooMetadata'],'raw':!![]});})[_0x53ea('0x18')](function(_0x44c2bd){if(_0x44c2bd&&_0x44c2bd[_0x53ea('0x50')]&&_0x44c2bd[_0x53ea('0x53')]){_0x4b8b5c=_0x44c2bd;var _0x515256={'interaction':{'id':_0x3603b9},'agent':{'id':_0x5d3b6d[_0x53ea('0x3b')]['id'],'name':_0x5d3b6d[_0x53ea('0x3b')][_0x53ea('0x2f')],'fullname':_0x5d3b6d[_0x53ea('0x3b')][_0x53ea('0x54')],'email':_0x5d3b6d[_0x53ea('0x3b')][_0x53ea('0x55')]},'contact':_0x5d3b6d[_0x53ea('0x31')]['contact'],'account':_0x5d3b6d[_0x53ea('0x31')][_0x53ea('0x34')]};var _0x28d2bd={'rejectUnauthorized':![],'method':_0x53ea('0x56'),'url':_0x53ea('0x57'),'headers':{'X-APIKEY':_0x44c2bd[_0x53ea('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5d3b6d['user'][_0x53ea('0x55')]],'buttons':null,'topic':_0x4b8b5c[_0x53ea('0x51')],'note':_[_0x53ea('0x58')](_0x4b8b5c[_0x53ea('0x52')])?null:getMustacheRender(_0x4b8b5c['vidaooNote'],_0x515256),'metadata':null},'redirect':_0x53ea('0x59'),'json':!![]};try{if(!_[_0x53ea('0x58')](_0x4b8b5c[_0x53ea('0x5a')])){var _0x4f6db5=getMustacheRender(_0x4b8b5c['vidaooMetadata'],_0x515256);var _0x34a1bc=JSON['parse'](_0x4f6db5);_0x28d2bd[_0x53ea('0x31')]['metadata']=_0x34a1bc;}}catch(_0x2572ad){throw new db['Sequelize'][(_0x53ea('0x5b'))](_0x53ea('0x5c'));}return rp(_0x28d2bd);}else{throw new db['Sequelize'][(_0x53ea('0x5b'))](_0x53ea('0x5d'));}})[_0x53ea('0x18')](function(_0xd9df0a){_0x1515a0=_0xd9df0a;if(_0x1515a0['id']){var _0x5d8cca={'body':_0x1515a0['join_url'],'ChatWebsiteId':_0x4b8b5c['id'],'ChatInteractionId':_0x35d287['id'],'direction':_0x53ea('0x5e'),'UserId':_0x5d3b6d[_0x53ea('0x3b')]['id']};return db[_0x53ea('0x5f')][_0x53ea('0x4a')](_0x5d8cca,{});}else{throw new db['Sequelize'][(_0x53ea('0x5b'))](_0x53ea('0x60'));}})[_0x53ea('0x18')](function(){return _0x35d287[_0x53ea('0x61')]({'vidaooSessionId':_0x1515a0['id']});})[_0x53ea('0x18')](respondWithResult(_0x1fe553,null))[_0x53ea('0x3c')](handleError(_0x1fe553,null));};exports[_0x53ea('0x62')]=function(_0x50b2cd,_0x2ed55b){if(_0x50b2cd[_0x53ea('0x31')]['id']){delete _0x50b2cd['body']['id'];}return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x50b2cd[_0x53ea('0x3e')]['id']},'include':[{'model':db['CmContact'],'as':_0x53ea('0x63')}]})[_0x53ea('0x18')](handleEntityNotFound(_0x2ed55b,null))[_0x53ea('0x18')](saveUpdates(_0x50b2cd[_0x53ea('0x31')],null))['then'](respondWithResult(_0x2ed55b,null))[_0x53ea('0x3c')](handleError(_0x2ed55b,null));};exports['abandon']=function(_0x1b0acb,_0x7614de){if(_0x1b0acb['body']['id']){delete _0x1b0acb[_0x53ea('0x31')]['id'];}return db['ChatInteraction'][_0x53ea('0x49')]({'where':{'id':_0x1b0acb['params']['id']}})[_0x53ea('0x18')](function(_0x475bae){if(!_0x475bae){logger['error'](_0x53ea('0x64'),'abandon',0x194,'entity\x20not\x20found');_0x7614de[_0x53ea('0x23')](0x194);}else{if(_0x475bae['UserId']){throw new db[(_0x53ea('0x65'))][(_0x53ea('0x5b'))](_0x53ea('0x66'));}}return _0x475bae;})['then'](function(_0x1c1647){if(_0x1c1647){return _0x1c1647[_0x53ea('0x67')]({'closed':_0x1b0acb['body']['closed'],'disposition':_0x1b0acb[_0x53ea('0x31')][_0x53ea('0x68')]})[_0x53ea('0x18')](function(_0x361bcb){return _0x361bcb;});}})[_0x53ea('0x18')](function(){return respondWithRpcPromise(_0x53ea('0x69'),_0x53ea('0x6a'),_0x1b0acb[_0x53ea('0x31')],client9004);})[_0x53ea('0x18')](respondWithResult(_0x7614de,null))[_0x53ea('0x3c')](handleError(_0x7614de,null));};exports[_0x53ea('0x6b')]=function(_0x406774,_0x4efb65){_0x406774['body'][_0x53ea('0x2f')]=_0x406774[_0x53ea('0x6c')][_0x53ea('0x6d')];_0x406774['body']['basename']=_0x406774[_0x53ea('0x6c')]['filename'];_0x406774[_0x53ea('0x31')][_0x53ea('0x6e')]=_0x406774['file']['mimetype'];return db[_0x53ea('0x6f')][_0x53ea('0x4a')](_0x406774[_0x53ea('0x31')])['then'](respondWithResult(_0x4efb65,0xc9))[_0x53ea('0x3c')](handleError(_0x4efb65,null));};exports[_0x53ea('0x70')]=function(_0x50ebdd,_0x478124){return db[_0x53ea('0x37')][_0x53ea('0x4e')]({'where':{'id':_0x50ebdd[_0x53ea('0x3e')]['id']},'raw':!![]})[_0x53ea('0x18')](handleEntityNotFound(_0x478124,null))[_0x53ea('0x18')](function(_0x332144){if(_0x332144){if(_0x332144[_0x53ea('0x71')]){return _0x478124[_0x53ea('0x24')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db['Attachment']['findOne']({'where':{'id':_0x50ebdd['query'][_0x53ea('0x72')]},'raw':!![]})[_0x53ea('0x18')](handleEntityNotFound(_0x478124,null));}})[_0x53ea('0x18')](function(_0x10b728){if(_0x10b728){var _0x4d309d=_0x10b728['ChatOfflineMessageId']!==null;var _0x517c8a=path[_0x53ea('0x73')](config[_0x53ea('0x74')],_0x53ea('0x75'));if(_0x4d309d){_0x517c8a=path['join'](_0x517c8a,_0x53ea('0x76'));}var _0x34f0a2=path['join'](_0x517c8a,_0x10b728[_0x53ea('0x77')]);return _0x478124['download'](_0x34f0a2);}})[_0x53ea('0x3c')](handleError(_0x478124,null));};exports[_0x53ea('0x78')]=function(_0x340450,_0x2e6df1){var _0x2bc850=null;var _0x21bbac=null;var _0xb510df=null;if(_0x340450[_0x53ea('0x31')]['id']){delete _0x340450[_0x53ea('0x31')]['id'];}if(_0x340450[_0x53ea('0x31')][_0x53ea('0x79')]){_0xb510df=path['join'](config[_0x53ea('0x74')],_0x53ea('0x7a'),util[_0x53ea('0x7b')](_0x53ea('0x7c'),Date[_0x53ea('0x7d')]()));_0x340450['body'][_0x53ea('0x7e')]=_0xb510df;}return db['ChatInteraction'][_0x53ea('0x49')]({'where':{'id':_0x340450['params']['id']},'include':[{'model':db[_0x53ea('0x5f')],'as':'Messages','include':[{'model':db[_0x53ea('0x7f')],'as':_0x53ea('0x7f')}]}]})['then'](handleEntityNotFound(_0x2e6df1,null))[_0x53ea('0x18')](saveUpdates(_0x340450['body'],null))[_0x53ea('0x18')](function(_0x4218f5){if(_0x4218f5){_0x2bc850=_0x4218f5;return db[_0x53ea('0x4d')][_0x53ea('0x49')]({'where':{'id':_0x2bc850[_0x53ea('0x4f')]}});}})['then'](function(_0x119532){if(_0x119532){_0x21bbac=_0x119532;return db[_0x53ea('0x80')]['find']({'where':{'id':_0x2bc850['ContactId']}});}})[_0x53ea('0x18')](function(_0x310eaf){if(_0x310eaf){if(_0xb510df){var _0x3ea7b2=null;for(var _0x10156e=0x1;_0x10156e<_0x2bc850[_0x53ea('0x81')][_0x53ea('0x44')];++_0x10156e){_0x3ea7b2=_0x2bc850[_0x53ea('0x81')][_0x10156e];var _0x39c1bf=_0x3ea7b2['UserId']?util[_0x53ea('0x7b')](_0x53ea('0x82'),_0x21bbac[_0x53ea('0x83')],_0x3ea7b2[_0x53ea('0x84')]):_0x53ea('0x85');var _0x4777fc=_0x340450[_0x53ea('0x31')][_0x53ea('0x86')]||util[_0x53ea('0x7b')]('%s%d',_0x53ea('0x87'),_0x3ea7b2['ContactId']);switch(_0x21bbac[_0x53ea('0x88')]){case _0x53ea('0x89'):_0x39c1bf=_0x3ea7b2[_0x53ea('0x84')]?util[_0x53ea('0x7b')](_0x53ea('0x82'),_0x21bbac[_0x53ea('0x83')],_0x3ea7b2[_0x53ea('0x84')]):_0x53ea('0x85');break;case _0x53ea('0x8a'):_0x39c1bf=_0x3ea7b2['UserId']?_0x3ea7b2[_0x53ea('0x7f')][_0x53ea('0x8b')]||_0x3ea7b2['User'][_0x53ea('0x54')]:_0x53ea('0x85');break;case _0x53ea('0x8c'):_0x39c1bf=_0x3ea7b2['UserId']?_0x3ea7b2[_0x53ea('0x7f')][_0x53ea('0x54')]:_0x53ea('0x85');break;default:_0x39c1bf=_0x3ea7b2['UserId']?util['format'](_0x53ea('0x82'),_0x21bbac[_0x53ea('0x83')],_0x3ea7b2[_0x53ea('0x84')]):_0x53ea('0x85');}var _0x27dc98=util['format'](_0x53ea('0x8d'),moment(_0x3ea7b2['createdAt'])['format'](_0x53ea('0x8e')),_0x3ea7b2[_0x53ea('0x8f')]==='in'?_0x4777fc:_0x39c1bf,_0x3ea7b2[_0x53ea('0x31')]);if(!_0x3ea7b2[_0x53ea('0x90')]){fs[_0x53ea('0x91')](_0xb510df,_0x27dc98);}}return db[_0x53ea('0x92')][_0x53ea('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x53ea('0x93')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x53ea('0x94')],'as':_0x53ea('0x94'),'raw':!![]}]}]});}}})[_0x53ea('0x18')](function(_0x58f0c3){if(!_0x58f0c3||!_0x58f0c3[_0x53ea('0x95')]||!_0x340450[_0x53ea('0x31')])return _0x2bc850;var _0x397828=_0x58f0c3[_0x53ea('0x96')]();return respondWithRpcPromise(_0x53ea('0x97'),_0x53ea('0x98'),{'account':_0x397828,'message':{'from':util['format'](_0x53ea('0x99'),_0x58f0c3[_0x53ea('0x2f')],_0x58f0c3['email']||_0x58f0c3['Smtp'][_0x53ea('0x3b')]),'to':_0x340450[_0x53ea('0x31')]['mailTranscript'],'subject':_0x53ea('0x9a'),'text':util[_0x53ea('0x7b')](_0x53ea('0x9b'),_0x340450[_0x53ea('0x31')]['mailTranscript']),'attachments':[{'path':_0xb510df}]}})[_0x53ea('0x18')](function(){return _0x2bc850;})[_0x53ea('0x3c')](function(_0x1bb151){logger[_0x53ea('0x1f')](_0x1bb151);});})[_0x53ea('0x18')](respondWithStatusCode(_0x2e6df1,0xc8))[_0x53ea('0x3c')](handleError(_0x2e6df1,null));};exports[_0x53ea('0x9c')]=function(_0x1cdd1d,_0x49f589){return db[_0x53ea('0x5f')][_0x53ea('0x49')]({'where':{'id':_0x1cdd1d[_0x53ea('0x3e')]['id']}})['then'](handleEntityNotFound(_0x49f589,null))[_0x53ea('0x18')](function(_0x2af03b){if(_0x2af03b){return _0x2af03b[_0x53ea('0x9c')](_0x1cdd1d[_0x53ea('0x31')][_0x53ea('0x9d')],_[_0x53ea('0x9e')](_0x1cdd1d['body'],[_0x53ea('0x9d'),'id'])||{});}})[_0x53ea('0x18')](respondWithResult(_0x49f589,null))[_0x53ea('0x3c')](handleError(_0x49f589,null));};exports[_0x53ea('0x9f')]=function(_0x477964,_0x535a06){var _0x53e6ae={'raw':![],'where':{}};var _0x24008b={};var _0x5909d4={'count':0x0,'rows':[]};return db[_0x53ea('0x37')]['findOne']({'where':{'id':_0x477964[_0x53ea('0x3e')]['id']}})[_0x53ea('0x18')](handleEntityNotFound(_0x535a06,null))['then'](function(_0x4016c8){if(_0x4016c8){_0x24008b[_0x53ea('0x3f')]=_[_0x53ea('0x40')](db['ChatMessage'][_0x53ea('0x38')]);_0x24008b[_0x53ea('0x41')]=_['keys'](_0x477964['query']);_0x24008b['filters']=_[_0x53ea('0xa0')](_0x24008b[_0x53ea('0x3f')],_0x24008b[_0x53ea('0x41')]);_0x53e6ae[_0x53ea('0x42')]=_['intersection'](_0x24008b[_0x53ea('0x3f')],qs[_0x53ea('0x43')](_0x477964['query']['fields']));_0x53e6ae[_0x53ea('0x42')]=_0x53e6ae['attributes']['length']?_0x53e6ae[_0x53ea('0x42')]:_0x24008b[_0x53ea('0x3f')];if(!_0x477964[_0x53ea('0x41')][_0x53ea('0xa1')](_0x53ea('0xa2'))){_0x53e6ae['limit']=qs[_0x53ea('0x29')](_0x477964[_0x53ea('0x41')]['limit']);_0x53e6ae[_0x53ea('0x27')]=qs[_0x53ea('0x27')](_0x477964[_0x53ea('0x41')][_0x53ea('0x27')]);}_0x53e6ae[_0x53ea('0xa3')]=qs[_0x53ea('0xa4')](_0x477964[_0x53ea('0x41')][_0x53ea('0xa4')]);_0x53e6ae[_0x53ea('0xa5')]=qs['filters'](_['pick'](_0x477964['query'],_0x24008b[_0x53ea('0xa6')]));_0x53e6ae[_0x53ea('0xa5')]['ChatInteractionId']=_0x4016c8['id'];if(_0x477964[_0x53ea('0x41')][_0x53ea('0xa7')]){_0x53e6ae[_0x53ea('0xa5')]=_['merge'](_0x53e6ae[_0x53ea('0xa5')],{'$or':_[_0x53ea('0x36')](_0x53e6ae[_0x53ea('0x42')],function(_0x25c17a){var _0x1da591={};_0x1da591[_0x25c17a]={'$like':'%'+_0x477964['query']['filter']+'%'};return _0x1da591;})});}if(_0x477964[_0x53ea('0x41')][_0x53ea('0xa8')]){var _0x224438=_0x477964[_0x53ea('0x41')][_0x53ea('0xa8')]['split'](',');var _0x3a7485={};_0x3a7485[_0x224438[0x0]]={'$gte':moment(_0x224438[0x1])['format'](_0x53ea('0xa9'))};_0x53e6ae['where']=_[_0x53ea('0x47')](_0x53e6ae[_0x53ea('0xa5')],_0x3a7485);}_0x53e6ae=_[_0x53ea('0x47')]({},_0x53e6ae,_0x477964[_0x53ea('0x48')]);return db['ChatMessage'][_0x53ea('0x2a')]({'where':_0x53e6ae[_0x53ea('0xa5')]})['then'](function(_0x4d1aa5){_0x5909d4[_0x53ea('0x2a')]=_0x4d1aa5;if(_0x477964[_0x53ea('0x41')]['includeAll']){_0x53e6ae[_0x53ea('0x46')]=[{'all':!![]}];}return db[_0x53ea('0x5f')][_0x53ea('0xaa')](_0x53e6ae);})[_0x53ea('0x18')](function(_0x500903){_0x5909d4[_0x53ea('0xab')]=_0x500903;return _0x5909d4;});}})[_0x53ea('0x18')](respondWithFilteredResult(_0x535a06,_0x53e6ae))['catch'](handleError(_0x535a06,null));};exports[_0x53ea('0xac')]=function(_0x459599,_0x1fc9cd){var _0x154aac={'where':{}},_0xc4586b={},_0x5be87d={'count':0x0,'rows':[]};return db[_0x53ea('0x37')][_0x53ea('0x4e')]({'where':{'id':_0x459599[_0x53ea('0x3e')]['id']}})[_0x53ea('0x18')](handleEntityNotFound(_0x1fc9cd,null))['then'](function(_0x25f912){if(_0x25f912){_0xc4586b[_0x53ea('0x3f')]=_[_0x53ea('0x40')](db[_0x53ea('0x5f')][_0x53ea('0x38')]);_0xc4586b[_0x53ea('0x41')]=_[_0x53ea('0x40')](_0x459599['query']);_0xc4586b[_0x53ea('0xa6')]=_[_0x53ea('0xa0')](_0xc4586b[_0x53ea('0x3f')],_0xc4586b[_0x53ea('0x41')]);_0x154aac['attributes']=_['intersection'](_0xc4586b[_0x53ea('0x3f')],qs[_0x53ea('0x43')](_0x459599[_0x53ea('0x41')][_0x53ea('0x43')]));_0x154aac[_0x53ea('0x42')]=_0x154aac[_0x53ea('0x42')]['length']?_0x154aac[_0x53ea('0x42')]:_0xc4586b[_0x53ea('0x3f')];if(!_0x459599[_0x53ea('0x41')][_0x53ea('0xa1')]('nolimit')){_0x154aac[_0x53ea('0x29')]=qs[_0x53ea('0x29')](_0x459599[_0x53ea('0x41')][_0x53ea('0x29')]);_0x154aac[_0x53ea('0x27')]=qs[_0x53ea('0x27')](_0x459599['query'][_0x53ea('0x27')]);}_0x154aac[_0x53ea('0xa3')]=qs[_0x53ea('0xa4')](_0x459599['query'][_0x53ea('0xa4')]);_0x154aac[_0x53ea('0xa5')]=qs['filters'](_[_0x53ea('0xad')](_0x459599['query'],_0xc4586b[_0x53ea('0xa6')]));_0x154aac[_0x53ea('0xa5')]['ChatInteractionId']=_0x25f912['id'];if(_0x459599['query'][_0x53ea('0xa7')]){_0x154aac['where']=_[_0x53ea('0x47')](_0x154aac[_0x53ea('0xa5')],{'$or':_['map'](_0x154aac[_0x53ea('0x42')],function(_0x459b0c){var _0x15ca15={};_0x15ca15[_0x459b0c]={'$like':'%'+_0x459599[_0x53ea('0x41')][_0x53ea('0xa7')]+'%'};return _0x15ca15;})});}_0x154aac[_0x53ea('0xa5')][_0x53ea('0x90')]=![];if(_0x459599[_0x53ea('0x41')]['id']){_0x154aac[_0x53ea('0xa5')]['id']={'$gt':_0x459599[_0x53ea('0x41')]['id']};}_0x154aac=_[_0x53ea('0x47')]({},_0x154aac,_0x459599['options']);return db[_0x53ea('0x5f')]['count']({'where':_0x154aac[_0x53ea('0xa5')]})[_0x53ea('0x18')](function(_0x44e3f0){_0x5be87d[_0x53ea('0x2a')]=_0x44e3f0;_0x154aac['include']=[];if(_0x459599['query'][_0x53ea('0xae')]){_0x154aac[_0x53ea('0x46')][_0x53ea('0xaf')]({'model':db[_0x53ea('0x7f')],'as':'User','attributes':['id',_0x53ea('0x54'),_0x53ea('0x8b')]});}if(_0x459599[_0x53ea('0x41')][_0x53ea('0x45')]){_0x154aac[_0x53ea('0x46')]=[{'all':!![]}];}return db[_0x53ea('0x5f')][_0x53ea('0xaa')](_0x154aac);})[_0x53ea('0x18')](function(_0x2cdfc0){_0x5be87d[_0x53ea('0xab')]=_0x2cdfc0;return _0x5be87d;});}})[_0x53ea('0x18')](respondWithFilteredResult(_0x1fc9cd,_0x154aac))[_0x53ea('0x3c')](handleError(_0x1fc9cd,null));};exports['addTags']=function(_0x190c98,_0x2e9090){return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x190c98[_0x53ea('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2e9090,null))['then'](function(_0x4e1292){if(_0x4e1292){return _0x4e1292['setTags'](_0x190c98[_0x53ea('0x31')][_0x53ea('0x9d')],_[_0x53ea('0x9e')](_0x190c98[_0x53ea('0x31')],[_0x53ea('0x9d'),'id'])||{})[_0x53ea('0xb0')](function(){return db[_0x53ea('0xb1')][_0x53ea('0xaa')]({'attributes':['id','name',_0x53ea('0xb2')],'where':{'id':_0x190c98[_0x53ea('0x31')]['ids']}});})[_0x53ea('0x18')](function(_0x5f2f8f){socket[_0x53ea('0xb3')](_0x53ea('0xb4'),{'id':Number(_0x190c98[_0x53ea('0x3e')]['id']),'tags':_0x5f2f8f||[]});return{'id':Number(_0x190c98[_0x53ea('0x3e')]['id']),'tags':_0x5f2f8f||[]};});}})[_0x53ea('0x18')](respondWithResult(_0x2e9090,null))[_0x53ea('0x3c')](handleError(_0x2e9090,null));};exports[_0x53ea('0xb5')]=function(_0x3ef2b7,_0x1ccb05){return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x3ef2b7[_0x53ea('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1ccb05,null))[_0x53ea('0x18')](function(_0x20af70){if(_0x20af70){return _0x20af70[_0x53ea('0xb5')](_0x3ef2b7[_0x53ea('0x41')][_0x53ea('0x9d')]);}})['then'](respondWithStatusCode(_0x1ccb05,null))[_0x53ea('0x3c')](handleError(_0x1ccb05,null));};exports[_0x53ea('0xb6')]=function(_0x514bcf,_0x5eb1e1){var _0xa324f=moment()['unix']()[_0x53ea('0xb7')]();var _0x902ac5=path[_0x53ea('0x73')](config[_0x53ea('0x74')],_0x53ea('0xb8'),_0x53ea('0xb9'),_0x53ea('0xba'));var _0x2f8a35=path[_0x53ea('0x73')](config[_0x53ea('0x74')],_0x53ea('0xb8'),_0x53ea('0xb9'),'attachments');var _0x36bdbf=path[_0x53ea('0x73')](_0x902ac5,_0xa324f);var _0x1f728e=util[_0x53ea('0x7b')]('transcript-%d-%s.zip',_0x514bcf[_0x53ea('0x3e')]['id'],_0xa324f);var _0x4c2f35=path[_0x53ea('0x73')](_0x902ac5,_0x1f728e);var _0xa2226=[];_0xa2226[_0x53ea('0xaf')]({'model':db[_0x53ea('0x7f')],'as':_0x53ea('0x7f'),'attributes':['id',_0x53ea('0x54')],'raw':!![]});_0xa2226['push']({'model':db['CmContact'],'as':_0x53ea('0x63'),'attributes':['id',_0x53ea('0xbb'),_0x53ea('0xbc')],'raw':!![]});if(_0x514bcf[_0x53ea('0x41')][_0x53ea('0xbd')]){_0xa2226[_0x53ea('0xaf')]({'model':db[_0x53ea('0x6f')],'as':_0x53ea('0x6f'),'raw':!![]});}var _0x49c8b0=[{'model':db['ChatMessage'],'as':_0x53ea('0x81'),'attributes':['id','body',_0x53ea('0xbe'),_0x53ea('0x8f'),'secret',_0x53ea('0xbf')],'include':_0xa2226}];_0x49c8b0['push']({'model':db[_0x53ea('0x4d')],'as':_0x53ea('0xc0'),'attributes':['id','name']});_0x49c8b0[_0x53ea('0xaf')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x53ea('0x37')][_0x53ea('0x49')]({'where':{'id':_0x514bcf[_0x53ea('0x3e')]['id']},'include':_0x49c8b0})[_0x53ea('0x18')](handleEntityNotFound(_0x5eb1e1,null))[_0x53ea('0x18')](function(_0x3b2408){if(_0x3b2408){var _0x295d71=_0x3b2408[_0x53ea('0xc1')]({'plain':!![]});fs[_0x53ea('0xc2')](_0x36bdbf);var _0x5a3f3b={'channel':_0x53ea('0xc3'),'account':_0x295d71[_0x53ea('0xc0')]['name'],'agent':_0x295d71[_0x53ea('0xc4')]?_0x295d71[_0x53ea('0xc4')][_0x53ea('0x54')]:_0x53ea('0xc5'),'createdAt':moment(_0x295d71[_0x53ea('0xbe')])[_0x53ea('0x7b')](_0x53ea('0xa9'))[_0x53ea('0xb7')](),'closedAt':_0x295d71['closed']?moment(_0x295d71[_0x53ea('0xc6')])[_0x53ea('0x7b')](_0x53ea('0xa9'))[_0x53ea('0xb7')]():'','disposition':_0x295d71[_0x53ea('0x68')],'chatInfo':{'browser':_0x295d71['browserName'],'os':_0x295d71['osName'],'referer':_0x295d71[_0x53ea('0xc7')],'customerIp':_0x295d71['customerIp'],'customerPort':_0x295d71[_0x53ea('0xc8')]?_0x295d71['customerPort']:_0x53ea('0xc5')},'messages':_(_0x295d71['Messages'])[_0x53ea('0xc9')]()[_0x53ea('0xa7')]({'secret':![]})[_0x53ea('0x36')](function(_0x1e340d){if(_0x1e340d[_0x53ea('0x6f')]){var _0x3bab6c=path[_0x53ea('0x73')](_0x2f8a35,_0x1e340d[_0x53ea('0x6f')]['basename']);if(fs[_0x53ea('0xca')](_0x3bab6c)){fs[_0x53ea('0xcb')](_0x3bab6c)[_0x53ea('0xcc')](fs['createWriteStream'](path[_0x53ea('0x73')](_0x36bdbf,_0x1e340d[_0x53ea('0x6f')][_0x53ea('0x77')])));}}return{'date':moment(_0x1e340d[_0x53ea('0xbe')])[_0x53ea('0x7b')](_0x53ea('0xa9'))[_0x53ea('0xb7')](),'sender':_0x1e340d[_0x53ea('0x8f')]==='out'?_0x1e340d[_0x53ea('0x7f')]?_0x1e340d[_0x53ea('0x7f')][_0x53ea('0x54')]:_0x53ea('0x85'):_0x1e340d[_0x53ea('0x63')][_0x53ea('0xbb')]+(_0x1e340d['Contact']['lastName']?'\x20'+_0x1e340d[_0x53ea('0x63')][_0x53ea('0xbc')]:''),'body':_0x1e340d['Attachment']?_0x1e340d[_0x53ea('0x6f')][_0x53ea('0x77')]:_0x1e340d[_0x53ea('0x31')],'direction':_0x1e340d['direction']===_0x53ea('0x5e')?'A':'C','secret':_0x1e340d[_0x53ea('0x90')],'read':_0x1e340d['read'],'attachment':_0x1e340d[_0x53ea('0x6f')]};})[_0x53ea('0xcd')]()};return ejs[_0x53ea('0xce')](path[_0x53ea('0x73')](config[_0x53ea('0x74')],_0x53ea('0xb8'),'views',_0x53ea('0xcf')),{'interaction':_0x5a3f3b})[_0x53ea('0x18')](function(_0x499fb1){var _0x32c690=path[_0x53ea('0x73')](_0x36bdbf,_0x53ea('0xd0')+_0x295d71['id']+'-'+_0xa324f+_0x53ea('0xd1'));var _0x569d9f={'path':_0x32c690,'channel':_0x53ea('0xc3'),'interactionId':_0x295d71['id']};return pdf[_0x53ea('0xd2')](_0x499fb1,_0x569d9f);})[_0x53ea('0x18')](function(){return new Promise(function(_0x48167e,_0x5350d1){zipdir(_0x36bdbf,{'saveTo':_0x4c2f35},function(_0x28817b,_0x3a3248){if(_0x28817b)return _0x5350d1(_0x28817b);return _0x48167e(_0x3a3248);});})[_0x53ea('0x18')](function(){return new BPromise(function(_0x5283c7,_0x14a310){rimraf(_0x36bdbf,function(_0x1caa9a){if(_0x1caa9a)_0x14a310(_0x1caa9a);return _0x5283c7();});});})['then'](function(){return _0x5eb1e1['download'](_0x4c2f35,_0x1f728e,function(_0x183dc7){if(_0x183dc7){logger[_0x53ea('0x1f')](_0x53ea('0xd3'),_0x183dc7);}else{fs[_0x53ea('0xd4')](_0x4c2f35);}});});});}else{return _0x5eb1e1[_0x53ea('0x23')](0xc8);}})[_0x53ea('0x3c')](handleError(_0x5eb1e1,null));}; \ No newline at end of file +var _0xea51=['MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','order','sort','where','ChatInteractionId','filter','$gte','includeAll','findAll','rows','getMyMessages','hasOwnProperty','includeAgent','push','addTags','setTags','spread','Tag','emit','removeTags','download','unix','toString','server','files','attachments','transcript-%d-%s.zip','Contact','firstName','createdAt','read','ChatWebsite','Account','Owner','get','mkdirSync','Chat','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','browserName','osName','customerIp','customerPort','tail','basename','createReadStream','pipe','createWriteStream','lastName','out','value','views','downloadInteraction.ejs','.pdf','err','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','stack','name','send','render','merge','body','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','type','key','getOptions','chat','query','user','params','model','keys','filters','intersection','attributes','fields','include','options','create','update','find','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooMetadata','Error\x20in\x20conversion\x20vidaooMetadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','updateAttributes','customUpdate','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','attachmentDownload','Unauthorized','Attachment','join','root','server/files/attachments/','offline-chat/','close','mailTranscript','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','CmContact','ContactId','length','format','agentAlias','customer','%s%d','agentIdentifier','website_alias','System','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount'];(function(_0x5d938d,_0x1a8445){var _0x1c2413=function(_0x8322f7){while(--_0x8322f7){_0x5d938d['push'](_0x5d938d['shift']());}};_0x1c2413(++_0x1a8445);}(_0xea51,0x115));var _0x1ea5=function(_0x1dae6b,_0x27d01a){_0x1dae6b=_0x1dae6b-0x0;var _0x23f925=_0xea51[_0x1dae6b];return _0x23f925;};'use strict';var rimraf=require(_0x1ea5('0x0'));var zipdir=require('zip-dir');var rp=require(_0x1ea5('0x1'));var moment=require(_0x1ea5('0x2'));var BPromise=require(_0x1ea5('0x3'));var Mustache=require(_0x1ea5('0x4'));var util=require(_0x1ea5('0x5'));var path=require(_0x1ea5('0x6'));var ejs=require(_0x1ea5('0x7'));var fs=require('fs');var _=require(_0x1ea5('0x8'));var Redis=require(_0x1ea5('0x9'));var interaction=require(_0x1ea5('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x1ea5('0xb'));var logger=require(_0x1ea5('0xc'))(_0x1ea5('0xd'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1ea5('0xe')]=_[_0x1ea5('0xf')](config[_0x1ea5('0xe')],{'host':_0x1ea5('0x10'),'port':0x18eb});var socket=require(_0x1ea5('0x11'))(new Redis(config['redis']));require(_0x1ea5('0x12'))[_0x1ea5('0x13')](socket);var jayson=require(_0x1ea5('0x14'));var client=jayson[_0x1ea5('0x15')][_0x1ea5('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x1ea5('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x1b38ef,_0x53b8e3,_0x24070b,_0x12d719){return new BPromise(function(_0x47a615,_0x5734c6){var _0x5a70b4=_0x12d719||client;return _0x5a70b4['request'](_0x1b38ef,_0x24070b)[_0x1ea5('0x17')](function(_0x575901){logger[_0x1ea5('0x18')](_0x1ea5('0x19'),_0x53b8e3,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x53b8e3,_0x1ea5('0x1a'),JSON[_0x1ea5('0x1b')](_0x575901));if(_0x575901[_0x1ea5('0x1c')]){if(_0x575901[_0x1ea5('0x1c')]['code']===0x1f4){logger[_0x1ea5('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x53b8e3,_0x575901[_0x1ea5('0x1c')][_0x1ea5('0x1d')]);return _0x5734c6(_0x575901['error'][_0x1ea5('0x1d')]);}logger[_0x1ea5('0x1c')](_0x1ea5('0x19'),_0x53b8e3,_0x575901['error'][_0x1ea5('0x1d')]);return _0x47a615(_0x575901[_0x1ea5('0x1c')][_0x1ea5('0x1d')]);}else{logger[_0x1ea5('0x18')](_0x1ea5('0x19'),_0x53b8e3,'request\x20sent');_0x47a615(_0x575901[_0x1ea5('0x1e')]['message']);}})[_0x1ea5('0x1f')](function(_0x2a83e3){logger[_0x1ea5('0x1c')](_0x1ea5('0x19'),_0x53b8e3,_0x2a83e3);_0x5734c6(_0x2a83e3);});});}function respondWithStatusCode(_0x6ed6d,_0x5dccf9){_0x5dccf9=_0x5dccf9||0xcc;return function(_0x53f961){if(_0x53f961){return _0x6ed6d[_0x1ea5('0x20')](_0x5dccf9);}return _0x6ed6d[_0x1ea5('0x21')](_0x5dccf9)[_0x1ea5('0x22')]();};}function respondWithResult(_0xe5319d,_0xfe263e){_0xfe263e=_0xfe263e||0xc8;return function(_0x5860b7){if(_0x5860b7){return _0xe5319d[_0x1ea5('0x21')](_0xfe263e)[_0x1ea5('0x23')](_0x5860b7);}};}function respondWithFilteredResult(_0xb0331c,_0x47012b){return function(_0x426aa8){if(_0x426aa8){var _0x7ee075=typeof _0x47012b[_0x1ea5('0x24')]===_0x1ea5('0x25')&&typeof _0x47012b[_0x1ea5('0x26')]===_0x1ea5('0x25');var _0x2eb78e=_0x426aa8['count'];var _0x7c6c5a=_0x7ee075?0x0:_0x47012b['offset'];var _0x3c2aa8=_0x7ee075?_0x426aa8[_0x1ea5('0x27')]:_0x47012b[_0x1ea5('0x24')]+_0x47012b[_0x1ea5('0x26')];var _0x188a0e;if(_0x3c2aa8>=_0x2eb78e){_0x3c2aa8=_0x2eb78e;_0x188a0e=0xc8;}else{_0x188a0e=0xce;}_0xb0331c[_0x1ea5('0x21')](_0x188a0e);return _0xb0331c['set'](_0x1ea5('0x28'),_0x7c6c5a+'-'+_0x3c2aa8+'/'+_0x2eb78e)[_0x1ea5('0x23')](_0x426aa8);}return null;};}function saveUpdates(_0xa61e88){return function(_0x84a5a2){if(_0x84a5a2){return _0x84a5a2['update'](_0xa61e88)['then'](function(_0x2e6973){return _0x2e6973;});}return null;};}function removeEntity(_0x2b78bf){return function(_0x1dbb8b){if(_0x1dbb8b){return _0x1dbb8b['destroy']()[_0x1ea5('0x17')](function(){_0x2b78bf['status'](0xcc)[_0x1ea5('0x22')]();});}};}function handleEntityNotFound(_0x4e014c){return function(_0x30fe53){if(!_0x30fe53){_0x4e014c[_0x1ea5('0x20')](0x194);}return _0x30fe53;};}function handleError(_0x5eb51f,_0x5bab3c){_0x5bab3c=_0x5bab3c||0x1f4;return function(_0x214b5e){logger[_0x1ea5('0x1c')](_0x214b5e[_0x1ea5('0x29')]);if(_0x214b5e['name']){delete _0x214b5e[_0x1ea5('0x2a')];}_0x5eb51f[_0x1ea5('0x21')](_0x5bab3c)[_0x1ea5('0x2b')](_0x214b5e);};}function getMustacheRender(_0x5256d7,_0x3070c7){return Mustache[_0x1ea5('0x2c')](_0x5256d7,_[_0x1ea5('0x2d')](_0x3070c7[_0x1ea5('0x2e')],{'contact':_0x3070c7[_0x1ea5('0x2f')],'message':_0x3070c7[_0x1ea5('0x1d')],'agent':_0x3070c7[_0x1ea5('0x30')],'interaction':_0x3070c7[_0x1ea5('0x31')],'account':_0x3070c7[_0x1ea5('0x32')]}))||'';}exports['index']=function(_0x5dcd0d,_0x19d299){var _0x311fab={};var _0x42da52=_[_0x1ea5('0x33')](db[_0x1ea5('0x34')][_0x1ea5('0x35')],function(_0x445b5d){return{'name':_0x445b5d['fieldName'],'type':_0x445b5d[_0x1ea5('0x36')][_0x1ea5('0x37')]};});_0x311fab=qs[_0x1ea5('0x38')](_0x42da52,_0x5dcd0d);return interaction['findAll'](_0x1ea5('0x39'),_0x5dcd0d[_0x1ea5('0x3a')],_0x5dcd0d[_0x1ea5('0x3b')],_0x311fab,_0x42da52)['then'](respondWithFilteredResult(_0x19d299,_0x311fab))['catch'](handleError(_0x19d299,null));};exports['show']=function(_0xe2e490,_0x3c9e5f){var _0x33479c={'raw':![],'where':{'id':_0xe2e490[_0x1ea5('0x3c')]['id']}},_0x160e8b={};_0x160e8b[_0x1ea5('0x3d')]=_[_0x1ea5('0x3e')](db[_0x1ea5('0x34')][_0x1ea5('0x35')]);_0x160e8b[_0x1ea5('0x3a')]=_[_0x1ea5('0x3e')](_0xe2e490[_0x1ea5('0x3a')]);_0x160e8b[_0x1ea5('0x3f')]=_[_0x1ea5('0x40')](_0x160e8b[_0x1ea5('0x3d')],_0x160e8b[_0x1ea5('0x3a')]);_0x33479c[_0x1ea5('0x41')]=_[_0x1ea5('0x40')](_0x160e8b['model'],qs[_0x1ea5('0x42')](_0xe2e490[_0x1ea5('0x3a')][_0x1ea5('0x42')]));_0x33479c[_0x1ea5('0x41')]=_0x33479c[_0x1ea5('0x41')]['length']?_0x33479c[_0x1ea5('0x41')]:_0x160e8b[_0x1ea5('0x3d')];if(_0xe2e490['query']['includeAll']){_0x33479c[_0x1ea5('0x43')]=[{'all':!![]}];}_0x33479c=_[_0x1ea5('0x2d')]({},_0x33479c,_0xe2e490[_0x1ea5('0x44')]);return db[_0x1ea5('0x34')]['find'](_0x33479c)['then'](handleEntityNotFound(_0x3c9e5f,null))['then'](respondWithResult(_0x3c9e5f,null))['catch'](handleError(_0x3c9e5f,null));};exports[_0x1ea5('0x45')]=function(_0x2cc173,_0x1065ea){return db[_0x1ea5('0x34')][_0x1ea5('0x45')](_0x2cc173[_0x1ea5('0x2e')],{})[_0x1ea5('0x17')](respondWithResult(_0x1065ea,0xc9))[_0x1ea5('0x1f')](handleError(_0x1065ea,null));};exports[_0x1ea5('0x46')]=function(_0x3d4ef0,_0x47ce96){if(_0x3d4ef0[_0x1ea5('0x2e')]['id']){delete _0x3d4ef0['body']['id'];}return db[_0x1ea5('0x34')][_0x1ea5('0x47')]({'where':{'id':_0x3d4ef0[_0x1ea5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x47ce96,null))[_0x1ea5('0x17')](saveUpdates(_0x3d4ef0[_0x1ea5('0x2e')],null))[_0x1ea5('0x17')](respondWithResult(_0x47ce96,null))[_0x1ea5('0x1f')](handleError(_0x47ce96,null));};exports['destroy']=function(_0x247244,_0x48e93a){return db[_0x1ea5('0x34')][_0x1ea5('0x47')]({'where':{'id':_0x247244[_0x1ea5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x48e93a,null))[_0x1ea5('0x17')](removeEntity(_0x48e93a,null))[_0x1ea5('0x1f')](handleError(_0x48e93a,null));};exports['describe']=function(_0x49705a,_0x136e7b){return db[_0x1ea5('0x34')][_0x1ea5('0x48')]()['then'](respondWithResult(_0x136e7b,null))[_0x1ea5('0x1f')](handleError(_0x136e7b,null));};exports[_0x1ea5('0x49')]=function(_0x259287,_0x329cbd){var _0xe2889a=_0x259287['params']['id'];var _0x52ddad;var _0x3c5d5a;var _0x362d54;return db[_0x1ea5('0x34')]['findOne']({'where':{'id':_0xe2889a}})[_0x1ea5('0x17')](function(_0x1beea1){_0x52ddad=_0x1beea1;return db['ChatWebsite'][_0x1ea5('0x4a')]({'where':{'id':_0x1beea1[_0x1ea5('0x4b')]},'attributes':['id',_0x1ea5('0x4c'),_0x1ea5('0x4d'),_0x1ea5('0x4e'),_0x1ea5('0x4f'),'vidaooMetadata'],'raw':!![]});})[_0x1ea5('0x17')](function(_0x284feb){if(_0x284feb&&_0x284feb[_0x1ea5('0x4c')]&&_0x284feb['vidaooEscalation']){_0x3c5d5a=_0x284feb;var _0x5290f4={'interaction':{'id':_0xe2889a},'agent':{'id':_0x259287[_0x1ea5('0x3b')]['id'],'name':_0x259287[_0x1ea5('0x3b')]['name'],'fullname':_0x259287['user'][_0x1ea5('0x50')],'email':_0x259287[_0x1ea5('0x3b')][_0x1ea5('0x51')]},'contact':_0x259287[_0x1ea5('0x2e')][_0x1ea5('0x2f')],'account':_0x259287[_0x1ea5('0x2e')][_0x1ea5('0x32')]};var _0x515006={'rejectUnauthorized':![],'method':_0x1ea5('0x52'),'url':_0x1ea5('0x53'),'headers':{'X-APIKEY':_0x284feb[_0x1ea5('0x4c')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x259287[_0x1ea5('0x3b')]['email']],'buttons':null,'topic':_0x3c5d5a[_0x1ea5('0x4e')],'note':_[_0x1ea5('0x54')](_0x3c5d5a['vidaooNote'])?null:getMustacheRender(_0x3c5d5a[_0x1ea5('0x4f')],_0x5290f4),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3c5d5a[_0x1ea5('0x55')])){var _0x366201=getMustacheRender(_0x3c5d5a['vidaooMetadata'],_0x5290f4);var _0x2571a2=JSON['parse'](_0x366201);_0x515006['body']['metadata']=_0x2571a2;}}catch(_0x3df2b0){throw new db['Sequelize']['ValidationError'](_0x1ea5('0x56'));}return rp(_0x515006);}else{throw new db[(_0x1ea5('0x57'))][(_0x1ea5('0x58'))](_0x1ea5('0x59'));}})[_0x1ea5('0x17')](function(_0x28ee44){_0x362d54=_0x28ee44;if(_0x362d54['id']){var _0x14f7b={'body':_0x362d54[_0x1ea5('0x5a')],'ChatWebsiteId':_0x3c5d5a['id'],'ChatInteractionId':_0x52ddad['id'],'direction':'out','UserId':_0x259287['user']['id']};return db['ChatMessage'][_0x1ea5('0x45')](_0x14f7b,{});}else{throw new db[(_0x1ea5('0x57'))][(_0x1ea5('0x58'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})['then'](function(){return _0x52ddad[_0x1ea5('0x5b')]({'vidaooSessionId':_0x362d54['id']});})[_0x1ea5('0x17')](respondWithResult(_0x329cbd,null))[_0x1ea5('0x1f')](handleError(_0x329cbd,null));};exports[_0x1ea5('0x5c')]=function(_0x18d551,_0x16f7df){if(_0x18d551['body']['id']){delete _0x18d551[_0x1ea5('0x2e')]['id'];}return db[_0x1ea5('0x34')][_0x1ea5('0x47')]({'where':{'id':_0x18d551[_0x1ea5('0x3c')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x1ea5('0x17')](handleEntityNotFound(_0x16f7df,null))[_0x1ea5('0x17')](saveUpdates(_0x18d551['body'],null))['then'](respondWithResult(_0x16f7df,null))[_0x1ea5('0x1f')](handleError(_0x16f7df,null));};exports['abandon']=function(_0x3fb499,_0x58275){if(_0x3fb499['body']['id']){delete _0x3fb499[_0x1ea5('0x2e')]['id'];}return db[_0x1ea5('0x34')][_0x1ea5('0x47')]({'where':{'id':_0x3fb499['params']['id']}})['then'](function(_0x151afc){if(!_0x151afc){logger[_0x1ea5('0x1c')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x1ea5('0x5d'),0x194,_0x1ea5('0x5e'));_0x58275[_0x1ea5('0x20')](0x194);}else{if(_0x151afc[_0x1ea5('0x5f')]){throw new db[(_0x1ea5('0x57'))][(_0x1ea5('0x58'))](_0x1ea5('0x60'));}}return _0x151afc;})[_0x1ea5('0x17')](function(_0x5dfaa7){if(_0x5dfaa7){return _0x5dfaa7['update']({'closed':_0x3fb499[_0x1ea5('0x2e')][_0x1ea5('0x61')],'disposition':_0x3fb499['body'][_0x1ea5('0x62')]})[_0x1ea5('0x17')](function(_0x4718e9){return _0x4718e9;});}})[_0x1ea5('0x17')](function(){return respondWithRpcPromise(_0x1ea5('0x63'),_0x1ea5('0x5d'),_0x3fb499[_0x1ea5('0x2e')],client9004);})[_0x1ea5('0x17')](respondWithResult(_0x58275,null))[_0x1ea5('0x1f')](handleError(_0x58275,null));};exports[_0x1ea5('0x64')]=function(_0x5dc668,_0x2c5364){_0x5dc668['body'][_0x1ea5('0x2a')]=_0x5dc668[_0x1ea5('0x65')][_0x1ea5('0x66')];_0x5dc668['body']['basename']=_0x5dc668[_0x1ea5('0x65')][_0x1ea5('0x67')];_0x5dc668[_0x1ea5('0x2e')][_0x1ea5('0x36')]=_0x5dc668['file'][_0x1ea5('0x68')];return db['Attachment']['create'](_0x5dc668[_0x1ea5('0x2e')])['then'](respondWithResult(_0x2c5364,0xc9))[_0x1ea5('0x1f')](handleError(_0x2c5364,null));};exports[_0x1ea5('0x69')]=function(_0x50828d,_0x14c4e9){return db[_0x1ea5('0x34')][_0x1ea5('0x4a')]({'where':{'id':_0x50828d['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x14c4e9,null))[_0x1ea5('0x17')](function(_0x371905){if(_0x371905){if(_0x371905[_0x1ea5('0x61')]){return _0x14c4e9['status'](0x193)[_0x1ea5('0x23')]({'status':0x193,'message':_0x1ea5('0x6a')});}return db[_0x1ea5('0x6b')]['findOne']({'where':{'id':_0x50828d[_0x1ea5('0x3a')]['attachId']},'raw':!![]})[_0x1ea5('0x17')](handleEntityNotFound(_0x14c4e9,null));}})['then'](function(_0x5c029c){if(_0x5c029c){var _0x2ed3b5=_0x5c029c['ChatOfflineMessageId']!==null;var _0x460257=path[_0x1ea5('0x6c')](config[_0x1ea5('0x6d')],_0x1ea5('0x6e'));if(_0x2ed3b5){_0x460257=path[_0x1ea5('0x6c')](_0x460257,_0x1ea5('0x6f'));}var _0x5afe22=path[_0x1ea5('0x6c')](_0x460257,_0x5c029c['basename']);return _0x14c4e9['download'](_0x5afe22);}})[_0x1ea5('0x1f')](handleError(_0x14c4e9,null));};exports[_0x1ea5('0x70')]=function(_0x51481c,_0x4d5837){var _0x2966e6=null;var _0x642721=null;var _0x45f011=null;if(_0x51481c[_0x1ea5('0x2e')]['id']){delete _0x51481c[_0x1ea5('0x2e')]['id'];}if(_0x51481c[_0x1ea5('0x2e')][_0x1ea5('0x71')]){_0x45f011=path[_0x1ea5('0x6c')](config['root'],'server/files/chat/upload/',util['format'](_0x1ea5('0x72'),Date[_0x1ea5('0x73')]()));_0x51481c['body'][_0x1ea5('0x74')]=_0x45f011;}return db['ChatInteraction']['find']({'where':{'id':_0x51481c['params']['id']},'include':[{'model':db[_0x1ea5('0x75')],'as':_0x1ea5('0x76'),'include':[{'model':db[_0x1ea5('0x77')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x4d5837,null))[_0x1ea5('0x17')](saveUpdates(_0x51481c['body'],null))[_0x1ea5('0x17')](function(_0x2be9ed){if(_0x2be9ed){_0x2966e6=_0x2be9ed;return db['ChatWebsite'][_0x1ea5('0x47')]({'where':{'id':_0x2966e6[_0x1ea5('0x4b')]}});}})['then'](function(_0x51c300){if(_0x51c300){_0x642721=_0x51c300;return db[_0x1ea5('0x78')][_0x1ea5('0x47')]({'where':{'id':_0x2966e6[_0x1ea5('0x79')]}});}})[_0x1ea5('0x17')](function(_0x4a8e96){if(_0x4a8e96){if(_0x45f011){var _0x27861a=null;for(var _0x1b60b8=0x1;_0x1b60b8<_0x2966e6['Messages'][_0x1ea5('0x7a')];++_0x1b60b8){_0x27861a=_0x2966e6[_0x1ea5('0x76')][_0x1b60b8];var _0x22fa5a=_0x27861a['UserId']?util[_0x1ea5('0x7b')]('%s%d',_0x642721[_0x1ea5('0x7c')],_0x27861a['UserId']):'System';var _0x2de9eb=_0x51481c[_0x1ea5('0x2e')][_0x1ea5('0x7d')]||util[_0x1ea5('0x7b')](_0x1ea5('0x7e'),'Visitor',_0x27861a[_0x1ea5('0x79')]);switch(_0x642721[_0x1ea5('0x7f')]){case _0x1ea5('0x80'):_0x22fa5a=_0x27861a[_0x1ea5('0x5f')]?util['format'](_0x1ea5('0x7e'),_0x642721[_0x1ea5('0x7c')],_0x27861a[_0x1ea5('0x5f')]):_0x1ea5('0x81');break;case'agent_alias':_0x22fa5a=_0x27861a['UserId']?_0x27861a['User'][_0x1ea5('0x82')]||_0x27861a['User'][_0x1ea5('0x50')]:_0x1ea5('0x81');break;case'agent_fullname':_0x22fa5a=_0x27861a[_0x1ea5('0x5f')]?_0x27861a[_0x1ea5('0x77')][_0x1ea5('0x50')]:_0x1ea5('0x81');break;default:_0x22fa5a=_0x27861a[_0x1ea5('0x5f')]?util[_0x1ea5('0x7b')]('%s%d',_0x642721[_0x1ea5('0x7c')],_0x27861a[_0x1ea5('0x5f')]):'System';}var _0x24e60f=util[_0x1ea5('0x7b')](_0x1ea5('0x83'),moment(_0x27861a['createdAt'])['format'](_0x1ea5('0x84')),_0x27861a[_0x1ea5('0x85')]==='in'?_0x2de9eb:_0x22fa5a,_0x27861a[_0x1ea5('0x2e')]);if(!_0x27861a[_0x1ea5('0x86')]){fs[_0x1ea5('0x87')](_0x45f011,_0x24e60f);}}return db[_0x1ea5('0x88')][_0x1ea5('0x4a')]({'where':{'service':!![]},'include':[{'model':db[_0x1ea5('0x89')],'as':_0x1ea5('0x8a'),'raw':!![],'include':[{'model':db[_0x1ea5('0x8b')],'as':_0x1ea5('0x8b'),'raw':!![]}]}]});}}})[_0x1ea5('0x17')](function(_0x273354){if(!_0x273354||!_0x273354[_0x1ea5('0x8a')]||!_0x51481c[_0x1ea5('0x2e')])return _0x2966e6;var _0x2781ce=_0x273354[_0x1ea5('0x8c')]();return respondWithRpcPromise(_0x1ea5('0x8d'),_0x1ea5('0x8e'),{'account':_0x2781ce,'message':{'from':util[_0x1ea5('0x7b')](_0x1ea5('0x8f'),_0x273354['name'],_0x273354[_0x1ea5('0x51')]||_0x273354[_0x1ea5('0x8a')][_0x1ea5('0x3b')]),'to':_0x51481c[_0x1ea5('0x2e')][_0x1ea5('0x71')],'subject':_0x1ea5('0x90'),'text':util['format'](_0x1ea5('0x91'),_0x51481c[_0x1ea5('0x2e')][_0x1ea5('0x71')]),'attachments':[{'path':_0x45f011}]}})[_0x1ea5('0x17')](function(){return _0x2966e6;})[_0x1ea5('0x1f')](function(_0x5e54e7){logger['error'](_0x5e54e7);});})[_0x1ea5('0x17')](respondWithStatusCode(_0x4d5837,0xc8))[_0x1ea5('0x1f')](handleError(_0x4d5837,null));};exports[_0x1ea5('0x92')]=function(_0x58a1b6,_0x3a80db){return db[_0x1ea5('0x75')][_0x1ea5('0x47')]({'where':{'id':_0x58a1b6[_0x1ea5('0x3c')]['id']}})[_0x1ea5('0x17')](handleEntityNotFound(_0x3a80db,null))[_0x1ea5('0x17')](function(_0x2294a5){if(_0x2294a5){return _0x2294a5[_0x1ea5('0x92')](_0x58a1b6[_0x1ea5('0x2e')][_0x1ea5('0x93')],_[_0x1ea5('0x94')](_0x58a1b6[_0x1ea5('0x2e')],['ids','id'])||{});}})[_0x1ea5('0x17')](respondWithResult(_0x3a80db,null))[_0x1ea5('0x1f')](handleError(_0x3a80db,null));};exports[_0x1ea5('0x95')]=function(_0x688fcd,_0x564d71){var _0x23e50b={'raw':![],'where':{}};var _0x4d0b87={};var _0x54fd8f={'count':0x0,'rows':[]};return db[_0x1ea5('0x34')][_0x1ea5('0x4a')]({'where':{'id':_0x688fcd[_0x1ea5('0x3c')]['id']}})[_0x1ea5('0x17')](handleEntityNotFound(_0x564d71,null))[_0x1ea5('0x17')](function(_0x3cb262){if(_0x3cb262){_0x4d0b87[_0x1ea5('0x3d')]=_[_0x1ea5('0x3e')](db['ChatMessage']['rawAttributes']);_0x4d0b87[_0x1ea5('0x3a')]=_['keys'](_0x688fcd[_0x1ea5('0x3a')]);_0x4d0b87[_0x1ea5('0x3f')]=_[_0x1ea5('0x40')](_0x4d0b87[_0x1ea5('0x3d')],_0x4d0b87[_0x1ea5('0x3a')]);_0x23e50b[_0x1ea5('0x41')]=_[_0x1ea5('0x40')](_0x4d0b87[_0x1ea5('0x3d')],qs[_0x1ea5('0x42')](_0x688fcd[_0x1ea5('0x3a')][_0x1ea5('0x42')]));_0x23e50b[_0x1ea5('0x41')]=_0x23e50b[_0x1ea5('0x41')][_0x1ea5('0x7a')]?_0x23e50b[_0x1ea5('0x41')]:_0x4d0b87[_0x1ea5('0x3d')];if(!_0x688fcd['query']['hasOwnProperty'](_0x1ea5('0x96'))){_0x23e50b[_0x1ea5('0x26')]=qs[_0x1ea5('0x26')](_0x688fcd[_0x1ea5('0x3a')]['limit']);_0x23e50b[_0x1ea5('0x24')]=qs['offset'](_0x688fcd[_0x1ea5('0x3a')][_0x1ea5('0x24')]);}_0x23e50b[_0x1ea5('0x97')]=qs[_0x1ea5('0x98')](_0x688fcd['query']['sort']);_0x23e50b[_0x1ea5('0x99')]=qs[_0x1ea5('0x3f')](_['pick'](_0x688fcd[_0x1ea5('0x3a')],_0x4d0b87[_0x1ea5('0x3f')]));_0x23e50b[_0x1ea5('0x99')][_0x1ea5('0x9a')]=_0x3cb262['id'];if(_0x688fcd[_0x1ea5('0x3a')][_0x1ea5('0x9b')]){_0x23e50b[_0x1ea5('0x99')]=_[_0x1ea5('0x2d')](_0x23e50b[_0x1ea5('0x99')],{'$or':_['map'](_0x23e50b['attributes'],function(_0x3106b2){var _0x404c0f={};_0x404c0f[_0x3106b2]={'$like':'%'+_0x688fcd[_0x1ea5('0x3a')][_0x1ea5('0x9b')]+'%'};return _0x404c0f;})});}if(_0x688fcd[_0x1ea5('0x3a')][_0x1ea5('0x9c')]){var _0x1b3d9f=_0x688fcd[_0x1ea5('0x3a')]['$gte']['split'](',');var _0x5c82a9={};_0x5c82a9[_0x1b3d9f[0x0]]={'$gte':moment(_0x1b3d9f[0x1])[_0x1ea5('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x23e50b[_0x1ea5('0x99')]=_[_0x1ea5('0x2d')](_0x23e50b[_0x1ea5('0x99')],_0x5c82a9);}_0x23e50b=_['merge']({},_0x23e50b,_0x688fcd[_0x1ea5('0x44')]);return db[_0x1ea5('0x75')][_0x1ea5('0x27')]({'where':_0x23e50b[_0x1ea5('0x99')]})[_0x1ea5('0x17')](function(_0x21a90c){_0x54fd8f[_0x1ea5('0x27')]=_0x21a90c;if(_0x688fcd[_0x1ea5('0x3a')][_0x1ea5('0x9d')]){_0x23e50b['include']=[{'all':!![]}];}return db['ChatMessage'][_0x1ea5('0x9e')](_0x23e50b);})[_0x1ea5('0x17')](function(_0x28dd3f){_0x54fd8f[_0x1ea5('0x9f')]=_0x28dd3f;return _0x54fd8f;});}})[_0x1ea5('0x17')](respondWithFilteredResult(_0x564d71,_0x23e50b))[_0x1ea5('0x1f')](handleError(_0x564d71,null));};exports[_0x1ea5('0xa0')]=function(_0x532e7a,_0xdd9a19){var _0x8e6259={'where':{}},_0x16252b={},_0x4b03b3={'count':0x0,'rows':[]};return db[_0x1ea5('0x34')]['findOne']({'where':{'id':_0x532e7a['params']['id']}})[_0x1ea5('0x17')](handleEntityNotFound(_0xdd9a19,null))[_0x1ea5('0x17')](function(_0x5a0f4f){if(_0x5a0f4f){_0x16252b[_0x1ea5('0x3d')]=_[_0x1ea5('0x3e')](db[_0x1ea5('0x75')][_0x1ea5('0x35')]);_0x16252b[_0x1ea5('0x3a')]=_['keys'](_0x532e7a[_0x1ea5('0x3a')]);_0x16252b['filters']=_[_0x1ea5('0x40')](_0x16252b['model'],_0x16252b[_0x1ea5('0x3a')]);_0x8e6259[_0x1ea5('0x41')]=_[_0x1ea5('0x40')](_0x16252b[_0x1ea5('0x3d')],qs[_0x1ea5('0x42')](_0x532e7a[_0x1ea5('0x3a')][_0x1ea5('0x42')]));_0x8e6259[_0x1ea5('0x41')]=_0x8e6259[_0x1ea5('0x41')]['length']?_0x8e6259[_0x1ea5('0x41')]:_0x16252b[_0x1ea5('0x3d')];if(!_0x532e7a['query'][_0x1ea5('0xa1')](_0x1ea5('0x96'))){_0x8e6259[_0x1ea5('0x26')]=qs['limit'](_0x532e7a[_0x1ea5('0x3a')][_0x1ea5('0x26')]);_0x8e6259[_0x1ea5('0x24')]=qs[_0x1ea5('0x24')](_0x532e7a[_0x1ea5('0x3a')][_0x1ea5('0x24')]);}_0x8e6259[_0x1ea5('0x97')]=qs[_0x1ea5('0x98')](_0x532e7a[_0x1ea5('0x3a')][_0x1ea5('0x98')]);_0x8e6259[_0x1ea5('0x99')]=qs[_0x1ea5('0x3f')](_['pick'](_0x532e7a['query'],_0x16252b[_0x1ea5('0x3f')]));_0x8e6259[_0x1ea5('0x99')][_0x1ea5('0x9a')]=_0x5a0f4f['id'];if(_0x532e7a[_0x1ea5('0x3a')][_0x1ea5('0x9b')]){_0x8e6259[_0x1ea5('0x99')]=_[_0x1ea5('0x2d')](_0x8e6259['where'],{'$or':_[_0x1ea5('0x33')](_0x8e6259[_0x1ea5('0x41')],function(_0x2efbea){var _0x79f45e={};_0x79f45e[_0x2efbea]={'$like':'%'+_0x532e7a['query'][_0x1ea5('0x9b')]+'%'};return _0x79f45e;})});}_0x8e6259[_0x1ea5('0x99')]['secret']=![];if(_0x532e7a[_0x1ea5('0x3a')]['id']){_0x8e6259[_0x1ea5('0x99')]['id']={'$gt':_0x532e7a['query']['id']};}_0x8e6259=_[_0x1ea5('0x2d')]({},_0x8e6259,_0x532e7a[_0x1ea5('0x44')]);return db[_0x1ea5('0x75')][_0x1ea5('0x27')]({'where':_0x8e6259['where']})[_0x1ea5('0x17')](function(_0xcfaa0d){_0x4b03b3[_0x1ea5('0x27')]=_0xcfaa0d;_0x8e6259[_0x1ea5('0x43')]=[];if(_0x532e7a[_0x1ea5('0x3a')][_0x1ea5('0xa2')]){_0x8e6259['include'][_0x1ea5('0xa3')]({'model':db[_0x1ea5('0x77')],'as':_0x1ea5('0x77'),'attributes':['id',_0x1ea5('0x50'),'alias']});}if(_0x532e7a[_0x1ea5('0x3a')][_0x1ea5('0x9d')]){_0x8e6259[_0x1ea5('0x43')]=[{'all':!![]}];}return db[_0x1ea5('0x75')][_0x1ea5('0x9e')](_0x8e6259);})[_0x1ea5('0x17')](function(_0x165cfb){_0x4b03b3[_0x1ea5('0x9f')]=_0x165cfb;return _0x4b03b3;});}})[_0x1ea5('0x17')](respondWithFilteredResult(_0xdd9a19,_0x8e6259))[_0x1ea5('0x1f')](handleError(_0xdd9a19,null));};exports[_0x1ea5('0xa4')]=function(_0x411a5c,_0x55dab){return db[_0x1ea5('0x34')][_0x1ea5('0x47')]({'where':{'id':_0x411a5c['params']['id']}})[_0x1ea5('0x17')](handleEntityNotFound(_0x55dab,null))[_0x1ea5('0x17')](function(_0x5836eb){if(_0x5836eb){return _0x5836eb[_0x1ea5('0xa5')](_0x411a5c[_0x1ea5('0x2e')][_0x1ea5('0x93')],_[_0x1ea5('0x94')](_0x411a5c['body'],[_0x1ea5('0x93'),'id'])||{})[_0x1ea5('0xa6')](function(){return db[_0x1ea5('0xa7')]['findAll']({'attributes':['id',_0x1ea5('0x2a'),'color'],'where':{'id':_0x411a5c[_0x1ea5('0x2e')][_0x1ea5('0x93')]}});})[_0x1ea5('0x17')](function(_0xabc4df){socket[_0x1ea5('0xa8')]('chatInteractionTags:save',{'id':Number(_0x411a5c[_0x1ea5('0x3c')]['id']),'tags':_0xabc4df||[]});return{'id':Number(_0x411a5c[_0x1ea5('0x3c')]['id']),'tags':_0xabc4df||[]};});}})[_0x1ea5('0x17')](respondWithResult(_0x55dab,null))[_0x1ea5('0x1f')](handleError(_0x55dab,null));};exports[_0x1ea5('0xa9')]=function(_0x16c64f,_0x331a06){return db[_0x1ea5('0x34')][_0x1ea5('0x47')]({'where':{'id':_0x16c64f[_0x1ea5('0x3c')]['id']}})['then'](handleEntityNotFound(_0x331a06,null))[_0x1ea5('0x17')](function(_0x560ec7){if(_0x560ec7){return _0x560ec7[_0x1ea5('0xa9')](_0x16c64f[_0x1ea5('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x331a06,null))[_0x1ea5('0x1f')](handleError(_0x331a06,null));};exports[_0x1ea5('0xaa')]=function(_0x549bf1,_0x564bba){var _0x138310=moment()[_0x1ea5('0xab')]()[_0x1ea5('0xac')]();var _0x97b769=path['join'](config[_0x1ea5('0x6d')],_0x1ea5('0xad'),_0x1ea5('0xae'),'tmp');var _0x2fe6fe=path[_0x1ea5('0x6c')](config[_0x1ea5('0x6d')],_0x1ea5('0xad'),_0x1ea5('0xae'),_0x1ea5('0xaf'));var _0x52e5ee=path[_0x1ea5('0x6c')](_0x97b769,_0x138310);var _0x4a44f6=util[_0x1ea5('0x7b')](_0x1ea5('0xb0'),_0x549bf1[_0x1ea5('0x3c')]['id'],_0x138310);var _0x34997d=path[_0x1ea5('0x6c')](_0x97b769,_0x4a44f6);var _0x2fc88f=[];_0x2fc88f[_0x1ea5('0xa3')]({'model':db[_0x1ea5('0x77')],'as':'User','attributes':['id',_0x1ea5('0x50')],'raw':!![]});_0x2fc88f['push']({'model':db[_0x1ea5('0x78')],'as':_0x1ea5('0xb1'),'attributes':['id',_0x1ea5('0xb2'),'lastName'],'raw':!![]});if(_0x549bf1[_0x1ea5('0x3a')]['attachments']){_0x2fc88f['push']({'model':db[_0x1ea5('0x6b')],'as':_0x1ea5('0x6b'),'raw':!![]});}var _0x50f533=[{'model':db[_0x1ea5('0x75')],'as':_0x1ea5('0x76'),'attributes':['id',_0x1ea5('0x2e'),_0x1ea5('0xb3'),_0x1ea5('0x85'),'secret',_0x1ea5('0xb4')],'include':_0x2fc88f}];_0x50f533[_0x1ea5('0xa3')]({'model':db[_0x1ea5('0xb5')],'as':_0x1ea5('0xb6'),'attributes':['id',_0x1ea5('0x2a')]});_0x50f533[_0x1ea5('0xa3')]({'model':db[_0x1ea5('0x77')],'as':_0x1ea5('0xb7'),'attributes':['id',_0x1ea5('0x50')]});return db['ChatInteraction'][_0x1ea5('0x47')]({'where':{'id':_0x549bf1[_0x1ea5('0x3c')]['id']},'include':_0x50f533})[_0x1ea5('0x17')](handleEntityNotFound(_0x564bba,null))[_0x1ea5('0x17')](function(_0x233bc9){if(_0x233bc9){var _0x30fe0b=_0x233bc9[_0x1ea5('0xb8')]({'plain':!![]});fs[_0x1ea5('0xb9')](_0x52e5ee);var _0x1de340={'channel':_0x1ea5('0xba'),'account':_0x30fe0b[_0x1ea5('0xb6')][_0x1ea5('0x2a')],'agent':_0x30fe0b[_0x1ea5('0xb7')]?_0x30fe0b[_0x1ea5('0xb7')][_0x1ea5('0x50')]:_0x1ea5('0xbb'),'createdAt':moment(_0x30fe0b['createdAt'])['format'](_0x1ea5('0xbc'))['toString'](),'closedAt':_0x30fe0b[_0x1ea5('0x61')]?moment(_0x30fe0b[_0x1ea5('0xbd')])[_0x1ea5('0x7b')](_0x1ea5('0xbc'))[_0x1ea5('0xac')]():'','disposition':_0x30fe0b[_0x1ea5('0x62')],'chatInfo':{'browser':_0x30fe0b[_0x1ea5('0xbe')],'os':_0x30fe0b[_0x1ea5('0xbf')],'referer':_0x30fe0b['referer'],'customerIp':_0x30fe0b[_0x1ea5('0xc0')],'customerPort':_0x30fe0b[_0x1ea5('0xc1')]?_0x30fe0b['customerPort']:_0x1ea5('0xbb')},'messages':_(_0x30fe0b[_0x1ea5('0x76')])[_0x1ea5('0xc2')]()[_0x1ea5('0x9b')]({'secret':![]})['map'](function(_0x320174){if(_0x320174[_0x1ea5('0x6b')]){var _0x5d784f=path[_0x1ea5('0x6c')](_0x2fe6fe,_0x320174[_0x1ea5('0x6b')][_0x1ea5('0xc3')]);if(fs['existsSync'](_0x5d784f)){fs[_0x1ea5('0xc4')](_0x5d784f)[_0x1ea5('0xc5')](fs[_0x1ea5('0xc6')](path[_0x1ea5('0x6c')](_0x52e5ee,_0x320174[_0x1ea5('0x6b')][_0x1ea5('0xc3')])));}}return{'date':moment(_0x320174[_0x1ea5('0xb3')])[_0x1ea5('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1ea5('0xac')](),'sender':_0x320174[_0x1ea5('0x85')]==='out'?_0x320174['User']?_0x320174['User']['fullname']:_0x1ea5('0x81'):_0x320174[_0x1ea5('0xb1')][_0x1ea5('0xb2')]+(_0x320174['Contact'][_0x1ea5('0xc7')]?'\x20'+_0x320174[_0x1ea5('0xb1')][_0x1ea5('0xc7')]:''),'body':_0x320174[_0x1ea5('0x6b')]?_0x320174[_0x1ea5('0x6b')]['basename']:_0x320174[_0x1ea5('0x2e')],'direction':_0x320174[_0x1ea5('0x85')]===_0x1ea5('0xc8')?'A':'C','secret':_0x320174[_0x1ea5('0x86')],'read':_0x320174[_0x1ea5('0xb4')],'attachment':_0x320174[_0x1ea5('0x6b')]};})[_0x1ea5('0xc9')]()};return ejs['renderFile'](path['join'](config[_0x1ea5('0x6d')],_0x1ea5('0xad'),_0x1ea5('0xca'),_0x1ea5('0xcb')),{'interaction':_0x1de340})[_0x1ea5('0x17')](function(_0x3d9257){var _0x2c29ec=path[_0x1ea5('0x6c')](_0x52e5ee,'transcript-'+_0x30fe0b['id']+'-'+_0x138310+_0x1ea5('0xcc'));var _0x8ea1e8={'path':_0x2c29ec,'channel':_0x1ea5('0xba'),'interactionId':_0x30fe0b['id']};return pdf['createPdfFromHTML'](_0x3d9257,_0x8ea1e8);})['then'](function(){return new Promise(function(_0x3084d5,_0x21b4ba){zipdir(_0x52e5ee,{'saveTo':_0x34997d},function(_0x56d5d0,_0x171c6a){if(_0x56d5d0)return _0x21b4ba(_0x56d5d0);return _0x3084d5(_0x171c6a);});})[_0x1ea5('0x17')](function(){return new BPromise(function(_0x51ba9c,_0x32adc6){rimraf(_0x52e5ee,function(_0x322a3c){if(_0x322a3c)_0x32adc6(_0x322a3c);return _0x51ba9c();});});})[_0x1ea5('0x17')](function(){return _0x564bba[_0x1ea5('0xaa')](_0x34997d,_0x4a44f6,function(_0x14aa7f){if(_0x14aa7f){logger[_0x1ea5('0x1c')](_0x1ea5('0xcd'),_0x14aa7f);}else{fs[_0x1ea5('0xce')](_0x34997d);}});});});}else{return _0x564bba[_0x1ea5('0x20')](0xc8);}})[_0x1ea5('0x1f')](handleError(_0x564bba,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 305ec26..2185334 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 _0x03d1=['../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','emit','hasOwnProperty','exports','events'];(function(_0x327d5a,_0x16bba0){var _0x49d8ff=function(_0x214620){while(--_0x214620){_0x327d5a['push'](_0x327d5a['shift']());}};_0x49d8ff(++_0x16bba0);}(_0x03d1,0x1d0));var _0x103d=function(_0x5bbf42,_0x492f04){_0x5bbf42=_0x5bbf42-0x0;var _0x5ae1fd=_0x03d1[_0x5bbf42];return _0x5ae1fd;};'use strict';var EventEmitter=require(_0x103d('0x0'));var ChatInteraction=require(_0x103d('0x1'))['db'][_0x103d('0x2')];var ChatMessage=require(_0x103d('0x1'))['db'][_0x103d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x103d('0x4'),'afterUpdate':_0x103d('0x5'),'afterDestroy':_0x103d('0x6')};function emitEvent(_0x501fe0){return function(_0x4fd7be,_0x373874,_0xae16e2){_0x4fd7be[_0x103d('0x7')]({'attributes':['id'],'raw':!![]})[_0x103d('0x8')](function(_0xe4fe28){_0x4fd7be[_0x103d('0x9')]('Users',_0xe4fe28[_0x103d('0xa')](function(_0x3aa24e){return{'id':_0x3aa24e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4fd7be['id'],'direction':'in','read':![]},'raw':!![]});})[_0x103d('0x8')](function(_0x1cb177){_0x4fd7be[_0x103d('0x9')](_0x103d('0xb'),_0x1cb177['length']);ChatInteractionEvents[_0x103d('0xc')](_0x501fe0+':'+_0x4fd7be['id'],_0x4fd7be);ChatInteractionEvents[_0x103d('0xc')](_0x501fe0,_0x4fd7be);_0xae16e2(null);})['catch'](_0xae16e2(null));};}for(var e in events){if(events[_0x103d('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x103d('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x2cd2=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x58fd59,_0x4bf2f6){var _0x3fddde=function(_0x54070b){while(--_0x54070b){_0x58fd59['push'](_0x58fd59['shift']());}};_0x3fddde(++_0x4bf2f6);}(_0x2cd2,0x14d));var _0x22cd=function(_0x5cec03,_0x1df2f0){_0x5cec03=_0x5cec03-0x0;var _0x5258e1=_0x2cd2[_0x5cec03];return _0x5258e1;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x22cd('0x0'))['db'][_0x22cd('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x22cd('0x2')](0x0);var events={'afterCreate':_0x22cd('0x3'),'afterUpdate':_0x22cd('0x4'),'afterDestroy':_0x22cd('0x5')};function emitEvent(_0x1349de){return function(_0x44bc4c,_0x1a6285,_0x47a65e){_0x44bc4c[_0x22cd('0x6')]({'attributes':['id'],'raw':!![]})[_0x22cd('0x7')](function(_0x333680){_0x44bc4c[_0x22cd('0x8')](_0x22cd('0x9'),_0x333680[_0x22cd('0xa')](function(_0x2657dc){return{'id':_0x2657dc['id']};}));return ChatMessage[_0x22cd('0xb')]({'where':{'ChatInteractionId':_0x44bc4c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5b6b2e){_0x44bc4c[_0x22cd('0x8')](_0x22cd('0xc'),_0x5b6b2e[_0x22cd('0xd')]);ChatInteractionEvents[_0x22cd('0xe')](_0x1349de+':'+_0x44bc4c['id'],_0x44bc4c);ChatInteractionEvents[_0x22cd('0xe')](_0x1349de,_0x44bc4c);_0x47a65e(null);})[_0x22cd('0xf')](_0x47a65e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x22cd('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 299ef12..fea654b 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 _0x15cd=['closedAt','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','ChatInteraction','chat_interactions','closed'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x15cd,0x193));var _0xd15c=function(_0x4a30b7,_0x3dabc8){_0x4a30b7=_0x4a30b7-0x0;var _0xe48f3c=_0x15cd[_0x4a30b7];return _0xe48f3c;};'use strict';var _=require('lodash');var util=require(_0xd15c('0x0'));var logger=require(_0xd15c('0x1'))(_0xd15c('0x2'));var moment=require(_0xd15c('0x3'));var BPromise=require(_0xd15c('0x4'));var rp=require(_0xd15c('0x5'));var fs=require('fs');var path=require(_0xd15c('0x6'));var rimraf=require(_0xd15c('0x7'));var config=require(_0xd15c('0x8'));var attributes=require(_0xd15c('0x9'));module['exports']=function(_0x5c9dc1,_0xc4d508){return _0x5c9dc1['define'](_0xd15c('0xa'),attributes,{'tableName':_0xd15c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e7f73,_0x104e67,_0x3b5002){if(_0x5e7f73['changed'](_0xd15c('0xc'))){_0x5e7f73[_0xd15c('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3b5002(null,_0x5e7f73);}},'charset':_0xd15c('0xe'),'collate':_0xd15c('0xf')});}; \ No newline at end of file +var _0xe728=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x8dc04d,_0xaa7559){var _0x2f5f28=function(_0xdd2d1d){while(--_0xdd2d1d){_0x8dc04d['push'](_0x8dc04d['shift']());}};_0x2f5f28(++_0xaa7559);}(_0xe728,0xd7));var _0x8e72=function(_0x19f4c8,_0x177330){_0x19f4c8=_0x19f4c8-0x0;var _0x2a12de=_0xe728[_0x19f4c8];return _0x2a12de;};'use strict';var _=require(_0x8e72('0x0'));var util=require(_0x8e72('0x1'));var logger=require(_0x8e72('0x2'))(_0x8e72('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8e72('0x4'));var fs=require('fs');var path=require(_0x8e72('0x5'));var rimraf=require(_0x8e72('0x6'));var config=require(_0x8e72('0x7'));var attributes=require(_0x8e72('0x8'));module[_0x8e72('0x9')]=function(_0x48831a,_0x54cadc){return _0x48831a['define'](_0x8e72('0xa'),attributes,{'tableName':_0x8e72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2dac5b,_0x453e56,_0x254f14){if(_0x2dac5b[_0x8e72('0xc')]('closed')){_0x2dac5b[_0x8e72('0xd')]=moment()[_0x8e72('0xe')](_0x8e72('0xf'));}_0x254f14(null,_0x2dac5b);}},'charset':_0x8e72('0x10'),'collate':_0x8e72('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 907a90b..c3d3a36 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 _0x26bb=['update','options','raw','where','UpdateChatInteraction','AddTagsToChatInteraction','ChatInteraction','find','addTags','body','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x26bb,0x1a7));var _0xb26b=function(_0x46672d,_0x359677){_0x46672d=_0x46672d-0x0;var _0x4294d5=_0x26bb[_0x46672d];return _0x4294d5;};'use strict';var _=require(_0xb26b('0x0'));var util=require(_0xb26b('0x1'));var moment=require(_0xb26b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb26b('0x3'));var fs=require('fs');var Redis=require(_0xb26b('0x4'));var db=require(_0xb26b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb26b('0x6'))('rpc');var config=require(_0xb26b('0x7'));var jayson=require(_0xb26b('0x8'));var client=jayson[_0xb26b('0x9')][_0xb26b('0xa')]({'port':0x232a});config[_0xb26b('0xb')]=_[_0xb26b('0xc')](config[_0xb26b('0xb')],{'host':_0xb26b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb26b('0xb')]));require('./chatInteraction.socket')[_0xb26b('0xe')](socket);function respondWithRpcPromise(_0x1ac10d,_0x414731,_0x42216f){return new BPromise(function(_0x9628d3,_0x242129){return client[_0xb26b('0xf')](_0x1ac10d,_0x42216f)[_0xb26b('0x10')](function(_0x3af66b){logger[_0xb26b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x414731,'request\x20sent');logger[_0xb26b('0x12')](_0xb26b('0x13'),_0x414731,_0xb26b('0x14'),JSON[_0xb26b('0x15')](_0x3af66b));if(_0x3af66b[_0xb26b('0x16')]){if(_0x3af66b['error'][_0xb26b('0x17')]===0x1f4){logger[_0xb26b('0x16')](_0xb26b('0x18'),_0x414731,_0x3af66b[_0xb26b('0x16')][_0xb26b('0x19')]);return _0x242129(_0x3af66b[_0xb26b('0x16')][_0xb26b('0x19')]);}logger[_0xb26b('0x16')](_0xb26b('0x18'),_0x414731,_0x3af66b[_0xb26b('0x16')]['message']);return _0x9628d3(_0x3af66b[_0xb26b('0x16')]['message']);}else{logger[_0xb26b('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x414731,'request\x20sent');_0x9628d3(_0x3af66b[_0xb26b('0x1a')]['message']);}})[_0xb26b('0x1b')](function(_0x5b4378){logger[_0xb26b('0x16')](_0xb26b('0x18'),_0x414731,_0x5b4378);_0x242129(_0x5b4378);});});}exports['UpdateChatInteraction']=function(_0x548898){var _0x331495=this;return new Promise(function(_0x379336,_0xa5257c){return db['ChatInteraction'][_0xb26b('0x1c')](_0x548898['body'],{'raw':_0x548898[_0xb26b('0x1d')]?_0x548898[_0xb26b('0x1d')][_0xb26b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x548898['options']?_0x548898['options'][_0xb26b('0x1f')]||null:null,'attributes':_0x548898['options']?_0x548898[_0xb26b('0x1d')]['attributes']||null:null,'limit':_0x548898[_0xb26b('0x1d')]?_0x548898[_0xb26b('0x1d')]['limit']||null:null})[_0xb26b('0x10')](function(_0x34eb9f){logger['info'](_0xb26b('0x20'),_0x548898);logger[_0xb26b('0x12')](_0xb26b('0x20'),_0x548898,JSON[_0xb26b('0x15')](_0x34eb9f));_0x379336(_0x34eb9f);})[_0xb26b('0x1b')](function(_0x1df2ee){logger[_0xb26b('0x16')]('UpdateChatInteraction',_0x1df2ee['message'],_0x548898);_0xa5257c(_0x331495[_0xb26b('0x16')](0x1f4,_0x1df2ee[_0xb26b('0x19')]));});});};exports[_0xb26b('0x21')]=function(_0x2e6388){return new Promise(function(_0x56e9f4,_0xd4cc6e){return db[_0xb26b('0x22')][_0xb26b('0x23')]({'where':_0x2e6388['options']?_0x2e6388[_0xb26b('0x1d')][_0xb26b('0x1f')]||null:null})[_0xb26b('0x10')](function(_0x226a9a){if(_0x226a9a){return _0x226a9a[_0xb26b('0x24')](_0x2e6388[_0xb26b('0x25')]['ids'],_['omit'](_0x2e6388['body'],[_0xb26b('0x26'),'id'])||{});}})[_0xb26b('0x27')](function(_0x286bec){logger[_0xb26b('0x11')](_0xb26b('0x28'),_0x2e6388);logger[_0xb26b('0x12')](_0xb26b('0x28'),_0x2e6388,JSON[_0xb26b('0x15')](_0x286bec));_0x56e9f4(_0x286bec);})['catch'](function(_0x42a46e){logger[_0xb26b('0x16')](_0xb26b('0x28'),_0x42a46e[_0xb26b('0x19')],_0x2e6388);_0xd4cc6e(_this[_0xb26b('0x16')](0x1f4,_0x42a46e[_0xb26b('0x19')]));});});}; \ No newline at end of file +var _0xd526=['register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','debug','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInteraction.socket'];(function(_0x57bb55,_0x604eda){var _0x230133=function(_0x3a8cf2){while(--_0x3a8cf2){_0x57bb55['push'](_0x57bb55['shift']());}};_0x230133(++_0x604eda);}(_0xd526,0x10b));var _0x6d52=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd526[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x6d52('0x0'));var util=require(_0x6d52('0x1'));var moment=require('moment');var BPromise=require(_0x6d52('0x2'));var rs=require(_0x6d52('0x3'));var fs=require('fs');var Redis=require(_0x6d52('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d52('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d52('0x6'));var jayson=require(_0x6d52('0x7'));var client=jayson[_0x6d52('0x8')][_0x6d52('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x6d52('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d52('0xb'))(new Redis(config[_0x6d52('0xa')]));require(_0x6d52('0xc'))[_0x6d52('0xd')](socket);function respondWithRpcPromise(_0x110996,_0x100c78,_0x505963){return new BPromise(function(_0x153b71,_0x5c8e78){return client['request'](_0x110996,_0x505963)[_0x6d52('0xe')](function(_0x5b31f6){logger[_0x6d52('0xf')](_0x6d52('0x10'),_0x100c78,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x100c78,_0x6d52('0x11'),JSON[_0x6d52('0x12')](_0x5b31f6));if(_0x5b31f6['error']){if(_0x5b31f6[_0x6d52('0x13')][_0x6d52('0x14')]===0x1f4){logger['error'](_0x6d52('0x10'),_0x100c78,_0x5b31f6[_0x6d52('0x13')][_0x6d52('0x15')]);return _0x5c8e78(_0x5b31f6[_0x6d52('0x13')][_0x6d52('0x15')]);}logger[_0x6d52('0x13')](_0x6d52('0x10'),_0x100c78,_0x5b31f6[_0x6d52('0x13')][_0x6d52('0x15')]);return _0x153b71(_0x5b31f6['error']['message']);}else{logger['info'](_0x6d52('0x10'),_0x100c78,_0x6d52('0x11'));_0x153b71(_0x5b31f6['result']['message']);}})[_0x6d52('0x16')](function(_0x47e0d7){logger[_0x6d52('0x13')](_0x6d52('0x10'),_0x100c78,_0x47e0d7);_0x5c8e78(_0x47e0d7);});});}exports['UpdateChatInteraction']=function(_0x47c0e6){var _0x1dd6bf=this;return new Promise(function(_0x3de0ba,_0x19b6c1){return db[_0x6d52('0x17')][_0x6d52('0x18')](_0x47c0e6[_0x6d52('0x19')],{'raw':_0x47c0e6[_0x6d52('0x1a')]?_0x47c0e6[_0x6d52('0x1a')][_0x6d52('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47c0e6[_0x6d52('0x1a')]?_0x47c0e6[_0x6d52('0x1a')][_0x6d52('0x1c')]||null:null,'attributes':_0x47c0e6[_0x6d52('0x1a')]?_0x47c0e6[_0x6d52('0x1a')][_0x6d52('0x1d')]||null:null,'limit':_0x47c0e6[_0x6d52('0x1a')]?_0x47c0e6[_0x6d52('0x1a')][_0x6d52('0x1e')]||null:null})[_0x6d52('0xe')](function(_0x4a0627){logger['info'](_0x6d52('0x1f'),_0x47c0e6);logger['debug'](_0x6d52('0x1f'),_0x47c0e6,JSON[_0x6d52('0x12')](_0x4a0627));_0x3de0ba(_0x4a0627);})[_0x6d52('0x16')](function(_0x386a48){logger[_0x6d52('0x13')]('UpdateChatInteraction',_0x386a48[_0x6d52('0x15')],_0x47c0e6);_0x19b6c1(_0x1dd6bf['error'](0x1f4,_0x386a48[_0x6d52('0x15')]));});});};exports[_0x6d52('0x20')]=function(_0x35631d){return new Promise(function(_0x507c60,_0x34d9cc){return db['ChatInteraction'][_0x6d52('0x21')]({'where':_0x35631d[_0x6d52('0x1a')]?_0x35631d[_0x6d52('0x1a')][_0x6d52('0x1c')]||null:null})['then'](function(_0x194ee1){if(_0x194ee1){return _0x194ee1[_0x6d52('0x22')](_0x35631d[_0x6d52('0x19')][_0x6d52('0x23')],_[_0x6d52('0x24')](_0x35631d['body'],['ids','id'])||{});}})[_0x6d52('0x25')](function(_0x1ed5ab){logger[_0x6d52('0xf')](_0x6d52('0x26'),_0x35631d);logger[_0x6d52('0x27')]('AddTags',_0x35631d,JSON[_0x6d52('0x12')](_0x1ed5ab));_0x507c60(_0x1ed5ab);})[_0x6d52('0x16')](function(_0x479cb1){logger[_0x6d52('0x13')]('AddTags',_0x479cb1[_0x6d52('0x15')],_0x35631d);_0x34d9cc(_this[_0x6d52('0x13')](0x1f4,_0x479cb1[_0x6d52('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0ed11f3..f8979e7 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 _0x21d4=['emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0xd4d8ef,_0x59f96d){var _0x26a687=function(_0xaf8c26){while(--_0xaf8c26){_0xd4d8ef['push'](_0xd4d8ef['shift']());}};_0x26a687(++_0x59f96d);}(_0x21d4,0x14d));var _0x421d=function(_0x475941,_0x1bdf17){_0x475941=_0x475941-0x0;var _0x3ccc75=_0x21d4[_0x475941];return _0x3ccc75;};'use strict';var ChatInteractionEvents=require(_0x421d('0x0'));var events=[_0x421d('0x1'),'remove',_0x421d('0x2')];function createListener(_0x242c4b,_0x115465){return function(_0x26ec2d){_0x115465[_0x421d('0x3')](_0x242c4b,_0x26ec2d);};}function removeListener(_0x377e4c,_0x5c8686){return function(){ChatInteractionEvents[_0x421d('0x4')](_0x377e4c,_0x5c8686);};}exports[_0x421d('0x5')]=function(_0x324d54){for(var _0x128afb=0x0,_0x2f52ea=events[_0x421d('0x6')];_0x128afb<_0x2f52ea;_0x128afb++){var _0x1cdb5f=events[_0x128afb];var _0x4e24a2=createListener(_0x421d('0x7')+_0x1cdb5f,_0x324d54);ChatInteractionEvents['on'](_0x1cdb5f,_0x4e24a2);}}; \ No newline at end of file +var _0x7631=['remove','emit','removeListener','chatInteraction:','./chatInteraction.events'];(function(_0xb092ec,_0x15c1d9){var _0x20e1e9=function(_0x184ea3){while(--_0x184ea3){_0xb092ec['push'](_0xb092ec['shift']());}};_0x20e1e9(++_0x15c1d9);}(_0x7631,0x108));var _0x1763=function(_0xd66c4f,_0x279897){_0xd66c4f=_0xd66c4f-0x0;var _0x1bca1d=_0x7631[_0xd66c4f];return _0x1bca1d;};'use strict';var ChatInteractionEvents=require(_0x1763('0x0'));var events=['save',_0x1763('0x1'),'update'];function createListener(_0x212e82,_0x2f67a9){return function(_0x33dbae){_0x2f67a9[_0x1763('0x2')](_0x212e82,_0x33dbae);};}function removeListener(_0x10a8a7,_0x14ea03){return function(){ChatInteractionEvents[_0x1763('0x3')](_0x10a8a7,_0x14ea03);};}exports['register']=function(_0x54a088){for(var _0x27c584=0x0,_0x419496=events['length'];_0x27c584<_0x419496;_0x27c584++){var _0x56a7bf=events[_0x27c584];var _0x3acf0a=createListener(_0x1763('0x4')+_0x56a7bf,_0x54a088);ChatInteractionEvents['on'](_0x56a7bf,_0x3acf0a);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index a73086b..ceea4a2 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 _0x69fb=['abandon','/:id/close','delete','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','single','attachmentUpload','tracked','chatinteraction:addtags','addTags','put','chat','chatinteraction:update','update','/:id/custom_update','/:id/abandon'];(function(_0x16a5f3,_0x57fddc){var _0x184742=function(_0x4efd0e){while(--_0x4efd0e){_0x16a5f3['push'](_0x16a5f3['shift']());}};_0x184742(++_0x57fddc);}(_0x69fb,0x95));var _0xb69f=function(_0x57b1a3,_0x1da974){_0x57b1a3=_0x57b1a3-0x0;var _0x54b8a6=_0x69fb[_0x57b1a3];return _0x54b8a6;};'use strict';var multer=require(_0xb69f('0x0'));var util=require(_0xb69f('0x1'));var path=require(_0xb69f('0x2'));var timeout=require(_0xb69f('0x3'));var express=require(_0xb69f('0x4'));var router=express[_0xb69f('0x5')]();var fs_extra=require(_0xb69f('0x6'));var auth=require(_0xb69f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb69f('0x8'));var controller=require('./chatInteraction.controller');router[_0xb69f('0x9')]('/',auth[_0xb69f('0xa')](),controller[_0xb69f('0xb')]);router[_0xb69f('0x9')](_0xb69f('0xc'),auth[_0xb69f('0xa')](),controller[_0xb69f('0xd')]);router[_0xb69f('0x9')](_0xb69f('0xe'),auth[_0xb69f('0xf')](),controller[_0xb69f('0x10')]);router[_0xb69f('0x9')](_0xb69f('0x11'),auth[_0xb69f('0xf')](),controller[_0xb69f('0x12')]);router[_0xb69f('0x9')](_0xb69f('0x13'),auth[_0xb69f('0xa')](),controller[_0xb69f('0x14')]);router[_0xb69f('0x9')](_0xb69f('0x15'),auth[_0xb69f('0xf')](),controller['getMyMessages']);router[_0xb69f('0x9')](_0xb69f('0x16'),auth['isAuthenticated'](),controller[_0xb69f('0x17')]);router[_0xb69f('0x18')]('/',auth[_0xb69f('0xa')](),controller['create']);router[_0xb69f('0x18')](_0xb69f('0x19'),auth[_0xb69f('0xa')](),controller[_0xb69f('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x482a08,_0x55bede,_0x320d0a){_0x320d0a(null,path[_0xb69f('0x1b')](config[_0xb69f('0x1c')],'server/files/attachments/'));},'filename':function(_0x3c2337,_0x249cff,_0x324c61){_0x324c61(null,util[_0xb69f('0x1d')](_0xb69f('0x1e'),Date[_0xb69f('0x1f')](),_0x249cff['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb69f('0x18')]('/:id/attachment_upload',upload[_0xb69f('0x20')]('file'),controller[_0xb69f('0x21')]);router[_0xb69f('0x18')](_0xb69f('0x13'),auth[_0xb69f('0xf')](),controller['addMessage']);router[_0xb69f('0x18')]('/:id/tags',auth[_0xb69f('0xa')](),interaction[_0xb69f('0x22')]('chat',_0xb69f('0x23')),controller[_0xb69f('0x24')]);router[_0xb69f('0x25')](_0xb69f('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0xb69f('0x26'),_0xb69f('0x27')),controller[_0xb69f('0x28')]);router['put'](_0xb69f('0x29'),controller['customUpdate']);router[_0xb69f('0x25')](_0xb69f('0x2a'),auth[_0xb69f('0xf')](),controller[_0xb69f('0x2b')]);router[_0xb69f('0x25')](_0xb69f('0x2c'),controller['close']);router[_0xb69f('0x2d')](_0xb69f('0xe'),auth[_0xb69f('0xa')](),interaction[_0xb69f('0x22')](_0xb69f('0x26'),'chatinteraction:destroy'),controller[_0xb69f('0x2e')]);router[_0xb69f('0x2d')]('/:id/tags',auth['isAuthenticated'](),controller[_0xb69f('0x2f')]);module['exports']=router; \ No newline at end of file +var _0x1baa=['tracked','chat','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','delete','destroy','removeTags','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/download','post','create','createVidaooSession','diskStorage','join','root','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0x1baa,0x114));var _0xa1ba=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1baa[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0xa1ba('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa1ba('0x1'));var router=express[_0xa1ba('0x2')]();var fs_extra=require(_0xa1ba('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa1ba('0x4'));var config=require(_0xa1ba('0x5'));var controller=require('./chatInteraction.controller');router[_0xa1ba('0x6')]('/',auth[_0xa1ba('0x7')](),controller['index']);router[_0xa1ba('0x6')](_0xa1ba('0x8'),auth[_0xa1ba('0x7')](),controller['describe']);router[_0xa1ba('0x6')](_0xa1ba('0x9'),auth[_0xa1ba('0xa')](),controller[_0xa1ba('0xb')]);router[_0xa1ba('0x6')](_0xa1ba('0xc'),auth['isChatInteractionAuthorized'](),controller[_0xa1ba('0xd')]);router[_0xa1ba('0x6')](_0xa1ba('0xe'),auth[_0xa1ba('0x7')](),controller[_0xa1ba('0xf')]);router[_0xa1ba('0x6')]('/:id/my_messages',auth[_0xa1ba('0xa')](),controller['getMyMessages']);router[_0xa1ba('0x6')](_0xa1ba('0x10'),auth[_0xa1ba('0x7')](),controller['download']);router[_0xa1ba('0x11')]('/',auth[_0xa1ba('0x7')](),controller[_0xa1ba('0x12')]);router['post']('/:id/vidaoo',auth[_0xa1ba('0x7')](),controller[_0xa1ba('0x13')]);var upload=multer({'storage':multer[_0xa1ba('0x14')]({'destination':function(_0x3395d4,_0x292b0c,_0x39ecc3){_0x39ecc3(null,path[_0xa1ba('0x15')](config[_0xa1ba('0x16')],'server/files/attachments/'));},'filename':function(_0x59e02d,_0x1243c1,_0x45f899){_0x45f899(null,util[_0xa1ba('0x17')](_0xa1ba('0x18'),Date['now'](),_0x1243c1[_0xa1ba('0x19')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa1ba('0x11')](_0xa1ba('0x1a'),upload[_0xa1ba('0x1b')](_0xa1ba('0x1c')),controller[_0xa1ba('0x1d')]);router[_0xa1ba('0x11')](_0xa1ba('0xe'),auth[_0xa1ba('0xa')](),controller[_0xa1ba('0x1e')]);router[_0xa1ba('0x11')](_0xa1ba('0x1f'),auth[_0xa1ba('0x7')](),interaction[_0xa1ba('0x20')](_0xa1ba('0x21'),'chatinteraction:addtags'),controller['addTags']);router['put'](_0xa1ba('0x9'),auth[_0xa1ba('0x7')](),interaction['tracked']('chat','chatinteraction:update'),controller['update']);router[_0xa1ba('0x22')](_0xa1ba('0x23'),controller[_0xa1ba('0x24')]);router[_0xa1ba('0x22')](_0xa1ba('0x25'),auth[_0xa1ba('0xa')](),controller[_0xa1ba('0x26')]);router[_0xa1ba('0x22')](_0xa1ba('0x27'),controller['close']);router[_0xa1ba('0x28')](_0xa1ba('0x9'),auth[_0xa1ba('0x7')](),interaction[_0xa1ba('0x20')](_0xa1ba('0x21'),'chatinteraction:destroy'),controller[_0xa1ba('0x29')]);router[_0xa1ba('0x28')](_0xa1ba('0x1f'),auth[_0xa1ba('0x7')](),controller[_0xa1ba('0x2a')]);module[_0xa1ba('0x2b')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 6a37d66..2a946ec 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 _0x8bff=['TEXT','medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x378c8a,_0x102f13){var _0x221dec=function(_0x44fa56){while(--_0x44fa56){_0x378c8a['push'](_0x378c8a['shift']());}};_0x221dec(++_0x102f13);}(_0x8bff,0xc4));var _0xf8bf=function(_0x161c43,_0x421946){_0x161c43=_0x161c43-0x0;var _0x936761=_0x8bff[_0x161c43];return _0x936761;};'use strict';var Sequelize=require(_0xf8bf('0x0'));module[_0xf8bf('0x1')]={'body':{'type':Sequelize[_0xf8bf('0x2')](_0xf8bf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf8bf('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf8bf('0x5')]}}; \ No newline at end of file +var _0xaa68=['exports','TEXT','medium','BOOLEAN','sequelize'];(function(_0x2fc3ae,_0x42da14){var _0x26175b=function(_0x57fec6){while(--_0x57fec6){_0x2fc3ae['push'](_0x2fc3ae['shift']());}};_0x26175b(++_0x42da14);}(_0xaa68,0x14e));var _0x8aa6=function(_0x5b6c8a,_0x23c1b0){_0x5b6c8a=_0x5b6c8a-0x0;var _0x56ce5e=_0xaa68[_0x5b6c8a];return _0x56ce5e;};'use strict';var Sequelize=require(_0x8aa6('0x0'));module[_0x8aa6('0x1')]={'body':{'type':Sequelize[_0x8aa6('0x2')](_0x8aa6('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8aa6('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 96d5aef..987c47a 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 _0x9d7b=['./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ChatInternalMessage','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','merge','options','find','create','body','destroy','describe','get','messages','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','push','ToId','all','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','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'];(function(_0x266f2c,_0x16e1a7){var _0x161e37=function(_0x238377){while(--_0x238377){_0x266f2c['push'](_0x266f2c['shift']());}};_0x161e37(++_0x16e1a7);}(_0x9d7b,0x19a));var _0xb9d7=function(_0x46ea96,_0x2ada2a){_0x46ea96=_0x46ea96-0x0;var _0x23be1a=_0x9d7b[_0x46ea96];return _0x23be1a;};'use strict';var emlformat=require(_0xb9d7('0x0'));var rimraf=require(_0xb9d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9d7('0x2'));var rp=require(_0xb9d7('0x3'));var moment=require('moment');var BPromise=require(_0xb9d7('0x4'));var Mustache=require(_0xb9d7('0x5'));var util=require(_0xb9d7('0x6'));var path=require(_0xb9d7('0x7'));var sox=require(_0xb9d7('0x8'));var csv=require(_0xb9d7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9d7('0xa'));var _=require(_0xb9d7('0xb'));var squel=require(_0xb9d7('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb9d7('0xd'));var toCsv=require(_0xb9d7('0x9'));var querystring=require(_0xb9d7('0xe'));var Papa=require(_0xb9d7('0xf'));var Redis=require(_0xb9d7('0x10'));var authService=require(_0xb9d7('0x11'));var qs=require(_0xb9d7('0x12'));var as=require(_0xb9d7('0x13'));var hardwareService=require(_0xb9d7('0x14'));var logger=require(_0xb9d7('0x15'))('api');var utils=require(_0xb9d7('0x16'));var config=require(_0xb9d7('0x17'));var licenseUtil=require(_0xb9d7('0x18'));var db=require(_0xb9d7('0x19'))['db'];config[_0xb9d7('0x1a')]=_[_0xb9d7('0x1b')](config[_0xb9d7('0x1a')],{'host':_0xb9d7('0x1c'),'port':0x18eb});var socket=require(_0xb9d7('0x1d'))(new Redis(config[_0xb9d7('0x1a')]));require(_0xb9d7('0x1e'))[_0xb9d7('0x1f')](socket);function respondWithStatusCode(_0x37b69f,_0x305f93){_0x305f93=_0x305f93||0xcc;return function(_0x193d8c){if(_0x193d8c){return _0x37b69f[_0xb9d7('0x20')](_0x305f93);}return _0x37b69f['status'](_0x305f93)[_0xb9d7('0x21')]();};}function respondWithResult(_0x2bb1af,_0x1f65b1){_0x1f65b1=_0x1f65b1||0xc8;return function(_0x3bcd01){if(_0x3bcd01){return _0x2bb1af[_0xb9d7('0x22')](_0x1f65b1)[_0xb9d7('0x23')](_0x3bcd01);}};}function respondWithFilteredResult(_0x29b97a,_0x208740){return function(_0x207610){if(_0x207610){var _0x45b249=typeof _0x208740[_0xb9d7('0x24')]===_0xb9d7('0x25')&&typeof _0x208740[_0xb9d7('0x26')]===_0xb9d7('0x25');var _0x3cfe33=_0x207610['count'];var _0x3c3130=_0x45b249?0x0:_0x208740[_0xb9d7('0x24')];var _0x5bbadc=_0x45b249?_0x207610[_0xb9d7('0x27')]:_0x208740[_0xb9d7('0x24')]+_0x208740[_0xb9d7('0x26')];var _0x3d3a40;if(_0x5bbadc>=_0x3cfe33){_0x5bbadc=_0x3cfe33;_0x3d3a40=0xc8;}else{_0x3d3a40=0xce;}_0x29b97a[_0xb9d7('0x22')](_0x3d3a40);return _0x29b97a[_0xb9d7('0x28')](_0xb9d7('0x29'),_0x3c3130+'-'+_0x5bbadc+'/'+_0x3cfe33)[_0xb9d7('0x23')](_0x207610);}return null;};}function patchUpdates(_0x244c51){return function(_0x504e03){try{jsonpatch[_0xb9d7('0x2a')](_0x504e03,_0x244c51,!![]);}catch(_0x204490){return BPromise['reject'](_0x204490);}return _0x504e03[_0xb9d7('0x2b')]();};}function saveUpdates(_0x4014ac,_0x59b762){return function(_0x27ab0){if(_0x27ab0){return _0x27ab0[_0xb9d7('0x2c')](_0x4014ac)[_0xb9d7('0x2d')](function(_0x1794f2){return _0x1794f2;});}return null;};}function removeEntity(_0x5d0bee,_0x4e5770){return function(_0x4af258){if(_0x4af258){return _0x4af258['destroy']()['then'](function(){_0x5d0bee[_0xb9d7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b0bca,_0x13eb6b){return function(_0x5c7d43){if(!_0x5c7d43){_0x5b0bca[_0xb9d7('0x20')](0x194);}return _0x5c7d43;};}function handleError(_0x1e5e41,_0x4a340a){_0x4a340a=_0x4a340a||0x1f4;return function(_0x160055){logger[_0xb9d7('0x2e')](_0x160055[_0xb9d7('0x2f')]);if(_0x160055[_0xb9d7('0x30')]){delete _0x160055['name'];}_0x1e5e41['status'](_0x4a340a)[_0xb9d7('0x31')](_0x160055);};}exports[_0xb9d7('0x32')]=function(_0x5945c5,_0x232123){var _0x29574c={},_0x42051a={},_0x45152={'count':0x0,'rows':[]};var _0x543e1e=_[_0xb9d7('0x33')](db[_0xb9d7('0x34')]['rawAttributes'],function(_0x53ce0e){return{'name':_0x53ce0e['fieldName'],'type':_0x53ce0e[_0xb9d7('0x35')]['key']};});_0x42051a[_0xb9d7('0x36')]=_[_0xb9d7('0x33')](_0x543e1e,'name');_0x42051a[_0xb9d7('0x37')]=_[_0xb9d7('0x38')](_0x5945c5['query']);_0x42051a[_0xb9d7('0x39')]=_[_0xb9d7('0x3a')](_0x42051a[_0xb9d7('0x36')],_0x42051a[_0xb9d7('0x37')]);_0x29574c['attributes']=_[_0xb9d7('0x3a')](_0x42051a['model'],qs[_0xb9d7('0x3b')](_0x5945c5[_0xb9d7('0x37')]['fields']));_0x29574c[_0xb9d7('0x3c')]=_0x29574c[_0xb9d7('0x3c')][_0xb9d7('0x3d')]?_0x29574c[_0xb9d7('0x3c')]:_0x42051a[_0xb9d7('0x36')];if(!_0x5945c5[_0xb9d7('0x37')][_0xb9d7('0x3e')](_0xb9d7('0x3f'))){_0x29574c[_0xb9d7('0x26')]=qs[_0xb9d7('0x26')](_0x5945c5['query'][_0xb9d7('0x26')]);_0x29574c[_0xb9d7('0x24')]=qs[_0xb9d7('0x24')](_0x5945c5['query'][_0xb9d7('0x24')]);}_0x29574c[_0xb9d7('0x40')]=qs[_0xb9d7('0x41')](_0x5945c5[_0xb9d7('0x37')]['sort']);_0x29574c[_0xb9d7('0x42')]=qs[_0xb9d7('0x39')](_[_0xb9d7('0x43')](_0x5945c5['query'],_0x42051a['filters']),_0x543e1e);if(_0x5945c5[_0xb9d7('0x37')][_0xb9d7('0x44')]){_0x29574c[_0xb9d7('0x42')]=_['merge'](_0x29574c['where'],{'$or':_[_0xb9d7('0x33')](_0x543e1e,function(_0x1a609e){if(_0x1a609e['type']!==_0xb9d7('0x45')){var _0x52755b={};_0x52755b[_0x1a609e[_0xb9d7('0x30')]]={'$like':'%'+_0x5945c5[_0xb9d7('0x37')][_0xb9d7('0x44')]+'%'};return _0x52755b;}})});}_0x29574c=_['merge']({},_0x29574c,_0x5945c5['options']);var _0x4a8e0a={'where':_0x29574c[_0xb9d7('0x42')]};return db[_0xb9d7('0x34')][_0xb9d7('0x27')](_0x4a8e0a)[_0xb9d7('0x2d')](function(_0x32bee7){_0x45152[_0xb9d7('0x27')]=_0x32bee7;if(_0x5945c5[_0xb9d7('0x37')]['includeAll']){_0x29574c[_0xb9d7('0x46')]=[{'all':!![]}];}return db[_0xb9d7('0x34')][_0xb9d7('0x47')](_0x29574c);})[_0xb9d7('0x2d')](function(_0x3f6f76){_0x45152[_0xb9d7('0x48')]=_0x3f6f76;return _0x45152;})[_0xb9d7('0x2d')](respondWithFilteredResult(_0x232123,_0x29574c))[_0xb9d7('0x49')](handleError(_0x232123,null));};exports[_0xb9d7('0x4a')]=function(_0x5321e7,_0x51b06e){var _0x526bc6={'raw':!![],'where':{'id':_0x5321e7[_0xb9d7('0x4b')]['id']}},_0x412abe={};_0x412abe[_0xb9d7('0x36')]=_['keys'](db[_0xb9d7('0x34')][_0xb9d7('0x4c')]);_0x412abe[_0xb9d7('0x37')]=_[_0xb9d7('0x38')](_0x5321e7['query']);_0x412abe['filters']=_[_0xb9d7('0x3a')](_0x412abe[_0xb9d7('0x36')],_0x412abe[_0xb9d7('0x37')]);_0x526bc6[_0xb9d7('0x3c')]=_[_0xb9d7('0x3a')](_0x412abe[_0xb9d7('0x36')],qs[_0xb9d7('0x3b')](_0x5321e7[_0xb9d7('0x37')][_0xb9d7('0x3b')]));_0x526bc6[_0xb9d7('0x3c')]=_0x526bc6[_0xb9d7('0x3c')][_0xb9d7('0x3d')]?_0x526bc6[_0xb9d7('0x3c')]:_0x412abe['model'];if(_0x5321e7['query']['includeAll']){_0x526bc6['include']=[{'all':!![]}];}_0x526bc6=_[_0xb9d7('0x4d')]({},_0x526bc6,_0x5321e7[_0xb9d7('0x4e')]);return db[_0xb9d7('0x34')][_0xb9d7('0x4f')](_0x526bc6)[_0xb9d7('0x2d')](handleEntityNotFound(_0x51b06e,null))[_0xb9d7('0x2d')](respondWithResult(_0x51b06e,null))[_0xb9d7('0x49')](handleError(_0x51b06e,null));};exports[_0xb9d7('0x50')]=function(_0x1dc346,_0x2aa9f6){return db[_0xb9d7('0x34')][_0xb9d7('0x50')](_0x1dc346[_0xb9d7('0x51')],{})[_0xb9d7('0x2d')](respondWithResult(_0x2aa9f6,0xc9))[_0xb9d7('0x49')](handleError(_0x2aa9f6,null));};exports[_0xb9d7('0x2c')]=function(_0x3fc7e5,_0x3e8a92){if(_0x3fc7e5[_0xb9d7('0x51')]['id']){delete _0x3fc7e5['body']['id'];}return db[_0xb9d7('0x34')]['find']({'where':{'id':_0x3fc7e5[_0xb9d7('0x4b')]['id']}})[_0xb9d7('0x2d')](handleEntityNotFound(_0x3e8a92,null))[_0xb9d7('0x2d')](saveUpdates(_0x3fc7e5[_0xb9d7('0x51')],null))['then'](respondWithResult(_0x3e8a92,null))['catch'](handleError(_0x3e8a92,null));};exports[_0xb9d7('0x52')]=function(_0x1e6eb6,_0x191e0d){return db[_0xb9d7('0x34')][_0xb9d7('0x4f')]({'where':{'id':_0x1e6eb6[_0xb9d7('0x4b')]['id']}})[_0xb9d7('0x2d')](handleEntityNotFound(_0x191e0d,null))[_0xb9d7('0x2d')](removeEntity(_0x191e0d,null))['catch'](handleError(_0x191e0d,null));};exports['describe']=function(_0x3bb5fb,_0x1d5679){return db[_0xb9d7('0x34')][_0xb9d7('0x53')]()[_0xb9d7('0x2d')](respondWithResult(_0x1d5679,null))['catch'](handleError(_0x1d5679,null));};function wrapUser(_0x240031){return function(_0x541f47){var _0x5de417=_0x240031[_0xb9d7('0x54')]({'plain':!![]});_0x5de417[_0xb9d7('0x55')]=[];if(_0x541f47){_0x5de417['lastMessageAt']=_0x541f47['createdAt'];_0x5de417[_0xb9d7('0x56')]=_0x541f47;}else{_0x5de417['lastMessageAt']=moment(0x0)[_0xb9d7('0x57')](_0xb9d7('0x58'));_0x5de417[_0xb9d7('0x56')]={};}return _0x5de417;};}exports[_0xb9d7('0x59')]=function(_0x17f72e,_0x5585e3,_0x392215){var _0xb9b66=[];return db[_0xb9d7('0x5a')][_0xb9d7('0x47')]({'where':{'role':['agent',_0xb9d7('0x5b'),_0xb9d7('0x5c')]},'attributes':['id',_0xb9d7('0x5d'),'name',_0xb9d7('0x5e'),'userpic',_0xb9d7('0x5f'),'online',_0xb9d7('0x60'),_0xb9d7('0x61'),_0xb9d7('0x62')],'order':qs[_0xb9d7('0x41')](_0xb9d7('0x63')),'include':[{'model':db[_0xb9d7('0x64')],'as':'VoiceQueues','attributes':['id',_0xb9d7('0x30'),_0xb9d7('0x35')],'through':{'attributes':[]}}]})[_0xb9d7('0x2d')](function(_0x5c269a){if(_0x5c269a){var _0x2af106=_0x17f72e[_0xb9d7('0x5c')][_0xb9d7('0x54')]({'plain':!![]});if(!_0x2af106)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2af106[_0xb9d7('0x5e')]===_0xb9d7('0x5c')){return db[_0xb9d7('0x65')][_0xb9d7('0x4f')]({'where':{'name':_0xb9d7('0x66'),'userProfileId':_0x2af106[_0xb9d7('0x67')]},'raw':!![]})[_0xb9d7('0x2d')](function(_0x4bda25){if(_0x4bda25){if(_0x4bda25[_0xb9d7('0x68')]===0x0){return db[_0xb9d7('0x69')][_0xb9d7('0x47')]({'where':{'sectionId':_0x4bda25['id']},'raw':!![]})[_0xb9d7('0x2d')](function(_0x150373){var _0x3e2b43=[];if(_['isEmpty'](_0x150373)){_0x3e2b43=_[_0xb9d7('0x44')](_0x5c269a,function(_0x7da95d){if(_0x7da95d[_0xb9d7('0x5e')]!==_0xb9d7('0x6a')){return _0x7da95d;}});return _0x3e2b43;}else{for(var _0x5e2c6b=0x0;_0x5e2c6b<_0x5c269a[_0xb9d7('0x3d')];_0x5e2c6b++){var _0x2d1e9f=_0x5c269a[_0x5e2c6b];if(_0x2d1e9f[_0xb9d7('0x5e')]===_0xb9d7('0x6a')){var _0x41fcc3=_[_0xb9d7('0x4f')](_0x150373,function(_0x5d3c63){return _0x5d3c63['resourceId']===_0x2d1e9f['id'];});if(_0x41fcc3)_0x3e2b43['push'](_0x2d1e9f);}else{_0x3e2b43[_0xb9d7('0x6b')](_0x2d1e9f);}}return _0x3e2b43;}});}else{return _0x5c269a;}}else{var _0x2f7b90=_[_0xb9d7('0x44')](_0x5c269a,function(_0x20b828){if(_0x20b828['role']!==_0xb9d7('0x6a')){return _0x20b828;}});return _0x2f7b90;}});}else{return _0x5c269a;}}})['then'](function(_0x590bfc){var _0x16670e=[];if(_0x590bfc){_0xb9b66=_0x590bfc;for(var _0x555d17=0x0;_0x555d17<_0x590bfc[_0xb9d7('0x3d')];_0x555d17+=0x1){_0xb9b66[_0x555d17][_0xb9d7('0x55')]=[];_0x16670e[_0xb9d7('0x6b')](db[_0xb9d7('0x34')]['find']({'where':{'FromId':[_0x17f72e[_0xb9d7('0x5c')]['id'],_0x590bfc[_0x555d17]['id']],'ToId':[_0x17f72e[_0xb9d7('0x5c')]['id'],_0x590bfc[_0x555d17]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0xb9d7('0x6c'),'read',_0xb9d7('0x51')],'order':qs[_0xb9d7('0x41')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x590bfc[_0x555d17])));}return BPromise[_0xb9d7('0x6d')](_0x16670e);}return[];})[_0xb9d7('0x2d')](function(_0x466510){return{'rows':_0x466510,'count':_0x466510[_0xb9d7('0x3d')]};})[_0xb9d7('0x2d')](respondWithResult(_0x5585e3,null))[_0xb9d7('0x49')](handleError(_0x5585e3,null));}; \ No newline at end of file +var _0x0aaf=['options','then','includeAll','include','ChatInternalMessage','catch','params','keys','rawAttributes','find','create','body','describe','get','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','findAll','agent','admin','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','all','eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','./chatInternalMessage.socket','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','type','VIRTUAL','filter'];(function(_0x6622a2,_0x401a17){var _0x52252e=function(_0x339759){while(--_0x339759){_0x6622a2['push'](_0x6622a2['shift']());}};_0x52252e(++_0x401a17);}(_0x0aaf,0x9c));var _0xf0aa=function(_0x348b29,_0x3be5e9){_0x348b29=_0x348b29-0x0;var _0xc260c5=_0x0aaf[_0x348b29];return _0xc260c5;};'use strict';var emlformat=require(_0xf0aa('0x0'));var rimraf=require(_0xf0aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0aa('0x2'));var Mustache=require(_0xf0aa('0x3'));var util=require(_0xf0aa('0x4'));var path=require('path');var sox=require(_0xf0aa('0x5'));var csv=require(_0xf0aa('0x6'));var ejs=require(_0xf0aa('0x7'));var fs=require('fs');var fs_extra=require(_0xf0aa('0x8'));var _=require(_0xf0aa('0x9'));var squel=require(_0xf0aa('0xa'));var crypto=require(_0xf0aa('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf0aa('0x6'));var querystring=require('querystring');var Papa=require(_0xf0aa('0xc'));var Redis=require('ioredis');var authService=require(_0xf0aa('0xd'));var qs=require(_0xf0aa('0xe'));var as=require(_0xf0aa('0xf'));var hardwareService=require(_0xf0aa('0x10'));var logger=require(_0xf0aa('0x11'))(_0xf0aa('0x12'));var utils=require(_0xf0aa('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xf0aa('0x14'));var db=require('../../mysqldb')['db'];config[_0xf0aa('0x15')]=_[_0xf0aa('0x16')](config['redis'],{'host':_0xf0aa('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf0aa('0x18'))['register'](socket);function respondWithStatusCode(_0x2340c6,_0x15fd6e){_0x15fd6e=_0x15fd6e||0xcc;return function(_0x4f7800){if(_0x4f7800){return _0x2340c6['sendStatus'](_0x15fd6e);}return _0x2340c6[_0xf0aa('0x19')](_0x15fd6e)[_0xf0aa('0x1a')]();};}function respondWithResult(_0x19ff0f,_0x5f54e4){_0x5f54e4=_0x5f54e4||0xc8;return function(_0x5cf5d0){if(_0x5cf5d0){return _0x19ff0f[_0xf0aa('0x19')](_0x5f54e4)['json'](_0x5cf5d0);}};}function respondWithFilteredResult(_0x26b58f,_0xf6099){return function(_0x3477e4){if(_0x3477e4){var _0x5a4e39=typeof _0xf6099[_0xf0aa('0x1b')]===_0xf0aa('0x1c')&&typeof _0xf6099[_0xf0aa('0x1d')]===_0xf0aa('0x1c');var _0x31a0a9=_0x3477e4[_0xf0aa('0x1e')];var _0x3cd567=_0x5a4e39?0x0:_0xf6099[_0xf0aa('0x1b')];var _0x319694=_0x5a4e39?_0x3477e4[_0xf0aa('0x1e')]:_0xf6099['offset']+_0xf6099['limit'];var _0x20aaf4;if(_0x319694>=_0x31a0a9){_0x319694=_0x31a0a9;_0x20aaf4=0xc8;}else{_0x20aaf4=0xce;}_0x26b58f[_0xf0aa('0x19')](_0x20aaf4);return _0x26b58f[_0xf0aa('0x1f')](_0xf0aa('0x20'),_0x3cd567+'-'+_0x319694+'/'+_0x31a0a9)['json'](_0x3477e4);}return null;};}function patchUpdates(_0x418b5c){return function(_0x33d138){try{jsonpatch[_0xf0aa('0x21')](_0x33d138,_0x418b5c,!![]);}catch(_0x2f7aba){return BPromise[_0xf0aa('0x22')](_0x2f7aba);}return _0x33d138[_0xf0aa('0x23')]();};}function saveUpdates(_0x47d1db,_0x5afe9b){return function(_0x298c45){if(_0x298c45){return _0x298c45['update'](_0x47d1db)['then'](function(_0x325120){return _0x325120;});}return null;};}function removeEntity(_0x4d83d3,_0x3007c0){return function(_0x16766b){if(_0x16766b){return _0x16766b[_0xf0aa('0x24')]()['then'](function(){_0x4d83d3[_0xf0aa('0x19')](0xcc)[_0xf0aa('0x1a')]();});}};}function handleEntityNotFound(_0x5bd1fe,_0x26d674){return function(_0x513c69){if(!_0x513c69){_0x5bd1fe[_0xf0aa('0x25')](0x194);}return _0x513c69;};}function handleError(_0x43a571,_0x45a430){_0x45a430=_0x45a430||0x1f4;return function(_0x2ed480){logger['error'](_0x2ed480[_0xf0aa('0x26')]);if(_0x2ed480[_0xf0aa('0x27')]){delete _0x2ed480[_0xf0aa('0x27')];}_0x43a571['status'](_0x45a430)[_0xf0aa('0x28')](_0x2ed480);};}exports[_0xf0aa('0x29')]=function(_0x1927b1,_0x2e1c23){var _0x441b84={},_0x3973ac={},_0x583e72={'count':0x0,'rows':[]};var _0x2aa2fc=_[_0xf0aa('0x2a')](db['ChatInternalMessage']['rawAttributes'],function(_0x92ed8b){return{'name':_0x92ed8b[_0xf0aa('0x2b')],'type':_0x92ed8b['type']['key']};});_0x3973ac[_0xf0aa('0x2c')]=_[_0xf0aa('0x2a')](_0x2aa2fc,_0xf0aa('0x27'));_0x3973ac[_0xf0aa('0x2d')]=_['keys'](_0x1927b1[_0xf0aa('0x2d')]);_0x3973ac[_0xf0aa('0x2e')]=_[_0xf0aa('0x2f')](_0x3973ac['model'],_0x3973ac[_0xf0aa('0x2d')]);_0x441b84[_0xf0aa('0x30')]=_['intersection'](_0x3973ac['model'],qs['fields'](_0x1927b1[_0xf0aa('0x2d')][_0xf0aa('0x31')]));_0x441b84[_0xf0aa('0x30')]=_0x441b84[_0xf0aa('0x30')][_0xf0aa('0x32')]?_0x441b84[_0xf0aa('0x30')]:_0x3973ac[_0xf0aa('0x2c')];if(!_0x1927b1[_0xf0aa('0x2d')][_0xf0aa('0x33')](_0xf0aa('0x34'))){_0x441b84[_0xf0aa('0x1d')]=qs['limit'](_0x1927b1[_0xf0aa('0x2d')][_0xf0aa('0x1d')]);_0x441b84['offset']=qs[_0xf0aa('0x1b')](_0x1927b1['query']['offset']);}_0x441b84['order']=qs[_0xf0aa('0x35')](_0x1927b1[_0xf0aa('0x2d')][_0xf0aa('0x35')]);_0x441b84['where']=qs[_0xf0aa('0x2e')](_[_0xf0aa('0x36')](_0x1927b1['query'],_0x3973ac['filters']),_0x2aa2fc);if(_0x1927b1[_0xf0aa('0x2d')]['filter']){_0x441b84['where']=_[_0xf0aa('0x37')](_0x441b84[_0xf0aa('0x38')],{'$or':_[_0xf0aa('0x2a')](_0x2aa2fc,function(_0x2c7cf7){if(_0x2c7cf7[_0xf0aa('0x39')]!==_0xf0aa('0x3a')){var _0x2439aa={};_0x2439aa[_0x2c7cf7[_0xf0aa('0x27')]]={'$like':'%'+_0x1927b1[_0xf0aa('0x2d')][_0xf0aa('0x3b')]+'%'};return _0x2439aa;}})});}_0x441b84=_[_0xf0aa('0x37')]({},_0x441b84,_0x1927b1[_0xf0aa('0x3c')]);var _0xb69886={'where':_0x441b84['where']};return db['ChatInternalMessage'][_0xf0aa('0x1e')](_0xb69886)[_0xf0aa('0x3d')](function(_0x243480){_0x583e72['count']=_0x243480;if(_0x1927b1[_0xf0aa('0x2d')][_0xf0aa('0x3e')]){_0x441b84[_0xf0aa('0x3f')]=[{'all':!![]}];}return db[_0xf0aa('0x40')]['findAll'](_0x441b84);})[_0xf0aa('0x3d')](function(_0x163172){_0x583e72['rows']=_0x163172;return _0x583e72;})['then'](respondWithFilteredResult(_0x2e1c23,_0x441b84))[_0xf0aa('0x41')](handleError(_0x2e1c23,null));};exports['show']=function(_0xafeb32,_0x5127c7){var _0x1d6d55={'raw':!![],'where':{'id':_0xafeb32[_0xf0aa('0x42')]['id']}},_0x493ff5={};_0x493ff5['model']=_[_0xf0aa('0x43')](db[_0xf0aa('0x40')][_0xf0aa('0x44')]);_0x493ff5['query']=_[_0xf0aa('0x43')](_0xafeb32[_0xf0aa('0x2d')]);_0x493ff5['filters']=_[_0xf0aa('0x2f')](_0x493ff5[_0xf0aa('0x2c')],_0x493ff5[_0xf0aa('0x2d')]);_0x1d6d55['attributes']=_[_0xf0aa('0x2f')](_0x493ff5[_0xf0aa('0x2c')],qs[_0xf0aa('0x31')](_0xafeb32['query'][_0xf0aa('0x31')]));_0x1d6d55[_0xf0aa('0x30')]=_0x1d6d55[_0xf0aa('0x30')][_0xf0aa('0x32')]?_0x1d6d55[_0xf0aa('0x30')]:_0x493ff5[_0xf0aa('0x2c')];if(_0xafeb32[_0xf0aa('0x2d')][_0xf0aa('0x3e')]){_0x1d6d55[_0xf0aa('0x3f')]=[{'all':!![]}];}_0x1d6d55=_[_0xf0aa('0x37')]({},_0x1d6d55,_0xafeb32[_0xf0aa('0x3c')]);return db['ChatInternalMessage'][_0xf0aa('0x45')](_0x1d6d55)[_0xf0aa('0x3d')](handleEntityNotFound(_0x5127c7,null))[_0xf0aa('0x3d')](respondWithResult(_0x5127c7,null))[_0xf0aa('0x41')](handleError(_0x5127c7,null));};exports[_0xf0aa('0x46')]=function(_0x133234,_0x15ee56){return db[_0xf0aa('0x40')]['create'](_0x133234[_0xf0aa('0x47')],{})[_0xf0aa('0x3d')](respondWithResult(_0x15ee56,0xc9))[_0xf0aa('0x41')](handleError(_0x15ee56,null));};exports['update']=function(_0x3fb41f,_0x294423){if(_0x3fb41f['body']['id']){delete _0x3fb41f['body']['id'];}return db[_0xf0aa('0x40')][_0xf0aa('0x45')]({'where':{'id':_0x3fb41f[_0xf0aa('0x42')]['id']}})[_0xf0aa('0x3d')](handleEntityNotFound(_0x294423,null))[_0xf0aa('0x3d')](saveUpdates(_0x3fb41f['body'],null))[_0xf0aa('0x3d')](respondWithResult(_0x294423,null))[_0xf0aa('0x41')](handleError(_0x294423,null));};exports['destroy']=function(_0x61331f,_0xedc262){return db['ChatInternalMessage'][_0xf0aa('0x45')]({'where':{'id':_0x61331f[_0xf0aa('0x42')]['id']}})['then'](handleEntityNotFound(_0xedc262,null))[_0xf0aa('0x3d')](removeEntity(_0xedc262,null))[_0xf0aa('0x41')](handleError(_0xedc262,null));};exports[_0xf0aa('0x48')]=function(_0x516459,_0xb12f8e){return db['ChatInternalMessage'][_0xf0aa('0x48')]()[_0xf0aa('0x3d')](respondWithResult(_0xb12f8e,null))[_0xf0aa('0x41')](handleError(_0xb12f8e,null));};function wrapUser(_0x1b8a19){return function(_0x9bc1e4){var _0x56c995=_0x1b8a19[_0xf0aa('0x49')]({'plain':!![]});_0x56c995['messages']=[];if(_0x9bc1e4){_0x56c995['lastMessageAt']=_0x9bc1e4[_0xf0aa('0x4a')];_0x56c995[_0xf0aa('0x4b')]=_0x9bc1e4;}else{_0x56c995[_0xf0aa('0x4c')]=moment(0x0)[_0xf0aa('0x4d')](_0xf0aa('0x4e'));_0x56c995[_0xf0aa('0x4b')]={};}return _0x56c995;};}exports[_0xf0aa('0x4f')]=function(_0x557080,_0x4489ac,_0x358838){var _0x1dabed=[];return db[_0xf0aa('0x50')][_0xf0aa('0x51')]({'where':{'role':[_0xf0aa('0x52'),_0xf0aa('0x53'),'user']},'attributes':['id',_0xf0aa('0x54'),_0xf0aa('0x27'),_0xf0aa('0x55'),_0xf0aa('0x56'),'internal',_0xf0aa('0x57'),_0xf0aa('0x58'),_0xf0aa('0x59'),_0xf0aa('0x5a')],'order':qs[_0xf0aa('0x35')](_0xf0aa('0x5b')),'include':[{'model':db[_0xf0aa('0x5c')],'as':'VoiceQueues','attributes':['id',_0xf0aa('0x27'),_0xf0aa('0x39')],'through':{'attributes':[]}}]})[_0xf0aa('0x3d')](function(_0x18837b){if(_0x18837b){var _0x18af02=_0x557080['user'][_0xf0aa('0x49')]({'plain':!![]});if(!_0x18af02)throw new Error(_0xf0aa('0x5d'));if(_0x18af02[_0xf0aa('0x55')]===_0xf0aa('0x5e')){return db[_0xf0aa('0x5f')]['find']({'where':{'name':_0xf0aa('0x60'),'userProfileId':_0x18af02[_0xf0aa('0x61')]},'raw':!![]})['then'](function(_0x729fa2){if(_0x729fa2){if(_0x729fa2[_0xf0aa('0x62')]===0x0){return db[_0xf0aa('0x63')]['findAll']({'where':{'sectionId':_0x729fa2['id']},'raw':!![]})[_0xf0aa('0x3d')](function(_0x1ee1f9){var _0x36d857=[];if(_[_0xf0aa('0x64')](_0x1ee1f9)){_0x36d857=_[_0xf0aa('0x3b')](_0x18837b,function(_0x2afa08){if(_0x2afa08[_0xf0aa('0x55')]!==_0xf0aa('0x52')){return _0x2afa08;}});return _0x36d857;}else{for(var _0x5a3212=0x0;_0x5a3212<_0x18837b[_0xf0aa('0x32')];_0x5a3212++){var _0x3401b4=_0x18837b[_0x5a3212];if(_0x3401b4[_0xf0aa('0x55')]===_0xf0aa('0x52')){var _0x4d21d7=_[_0xf0aa('0x45')](_0x1ee1f9,function(_0x58b0ef){return _0x58b0ef[_0xf0aa('0x65')]===_0x3401b4['id'];});if(_0x4d21d7)_0x36d857[_0xf0aa('0x66')](_0x3401b4);}else{_0x36d857[_0xf0aa('0x66')](_0x3401b4);}}return _0x36d857;}});}else{return _0x18837b;}}else{var _0x3c6dd9=_[_0xf0aa('0x3b')](_0x18837b,function(_0x59a833){if(_0x59a833['role']!==_0xf0aa('0x52')){return _0x59a833;}});return _0x3c6dd9;}});}else{return _0x18837b;}}})[_0xf0aa('0x3d')](function(_0x481219){var _0x4dbfd9=[];if(_0x481219){_0x1dabed=_0x481219;for(var _0x5eae4b=0x0;_0x5eae4b<_0x481219[_0xf0aa('0x32')];_0x5eae4b+=0x1){_0x1dabed[_0x5eae4b][_0xf0aa('0x67')]=[];_0x4dbfd9[_0xf0aa('0x66')](db[_0xf0aa('0x40')][_0xf0aa('0x45')]({'where':{'FromId':[_0x557080[_0xf0aa('0x5e')]['id'],_0x481219[_0x5eae4b]['id']],'ToId':[_0x557080[_0xf0aa('0x5e')]['id'],_0x481219[_0x5eae4b]['id']],'ChatGroupId':null},'attributes':['id',_0xf0aa('0x4a'),_0xf0aa('0x68'),_0xf0aa('0x69'),_0xf0aa('0x6a'),_0xf0aa('0x47')],'order':qs[_0xf0aa('0x35')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf0aa('0x3d')](wrapUser(_0x481219[_0x5eae4b])));}return BPromise[_0xf0aa('0x6b')](_0x4dbfd9);}return[];})['then'](function(_0x1f3608){return{'rows':_0x1f3608,'count':_0x1f3608[_0xf0aa('0x32')]};})[_0xf0aa('0x3d')](respondWithResult(_0x4489ac,null))[_0xf0aa('0x41')](handleError(_0x4489ac,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 408dd75..6ab3f8b 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 _0x35e4=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x15425a,_0x311d63){var _0x326c57=function(_0x57a452){while(--_0x57a452){_0x15425a['push'](_0x15425a['shift']());}};_0x326c57(++_0x311d63);}(_0x35e4,0x9f));var _0x435e=function(_0xa35f37,_0x26cde4){_0xa35f37=_0xa35f37-0x0;var _0x9ad5aa=_0x35e4[_0xa35f37];return _0x9ad5aa;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x435e('0x0'))['db'][_0x435e('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x435e('0x2')](0x0);var events={'afterCreate':_0x435e('0x3'),'afterUpdate':_0x435e('0x4'),'afterDestroy':_0x435e('0x5')};function emitEvent(_0x57939e){return function(_0x421228,_0x59e056,_0x3e9787){ChatInternalMessageEvents[_0x435e('0x6')](_0x57939e+':'+_0x421228['id'],_0x421228);ChatInternalMessageEvents[_0x435e('0x6')](_0x57939e,_0x421228);_0x3e9787(null);};}for(var e in events){if(events[_0x435e('0x7')](e)){var event=events[e];ChatInternalMessage[_0x435e('0x8')](e,emitEvent(event));}}module[_0x435e('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x315f=['update','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x315f,0x1f4));var _0xf315=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x315f[_0x4629ed];return _0x52ca04;};'use strict';var EventEmitter=require(_0xf315('0x0'));var ChatInternalMessage=require(_0xf315('0x1'))['db'][_0xf315('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xf315('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf315('0x4'),'afterDestroy':'remove'};function emitEvent(_0x151127){return function(_0x2e228d,_0x554fa6,_0x43e4bf){ChatInternalMessageEvents[_0xf315('0x5')](_0x151127+':'+_0x2e228d['id'],_0x2e228d);ChatInternalMessageEvents['emit'](_0x151127,_0x2e228d);_0x43e4bf(null);};}for(var e in events){if(events[_0xf315('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xf315('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 3c291e6..43af0ed 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 _0xa11b=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x48c989,_0x489c25){var _0x16c57c=function(_0x44975c){while(--_0x44975c){_0x48c989['push'](_0x48c989['shift']());}};_0x16c57c(++_0x489c25);}(_0xa11b,0x1d8));var _0xba11=function(_0x4a1382,_0x5271ff){_0x4a1382=_0x4a1382-0x0;var _0x179b9b=_0xa11b[_0x4a1382];return _0x179b9b;};'use strict';var _=require(_0xba11('0x0'));var util=require(_0xba11('0x1'));var logger=require(_0xba11('0x2'))('api');var moment=require(_0xba11('0x3'));var BPromise=require(_0xba11('0x4'));var rp=require(_0xba11('0x5'));var fs=require('fs');var path=require(_0xba11('0x6'));var rimraf=require('rimraf');var config=require(_0xba11('0x7'));var attributes=require(_0xba11('0x8'));module[_0xba11('0x9')]=function(_0x274314,_0x2ce405){return _0x274314[_0xba11('0xa')](_0xba11('0xb'),attributes,{'tableName':_0xba11('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba11('0xd'),'collate':_0xba11('0xe')});}; \ No newline at end of file +var _0xa21c=['lodash','util','../../config/logger','api','request-promise','path','rimraf','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci'];(function(_0x131498,_0x48dcb0){var _0x2ecf6d=function(_0x2a1d44){while(--_0x2a1d44){_0x131498['push'](_0x131498['shift']());}};_0x2ecf6d(++_0x48dcb0);}(_0xa21c,0x11e));var _0xca21=function(_0x4e4fc6,_0x2b80e6){_0x4e4fc6=_0x4e4fc6-0x0;var _0x2873a3=_0xa21c[_0x4e4fc6];return _0x2873a3;};'use strict';var _=require(_0xca21('0x0'));var util=require(_0xca21('0x1'));var logger=require(_0xca21('0x2'))(_0xca21('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xca21('0x4'));var fs=require('fs');var path=require(_0xca21('0x5'));var rimraf=require(_0xca21('0x6'));var config=require('../../config/environment');var attributes=require(_0xca21('0x7'));module[_0xca21('0x8')]=function(_0x6bb9a4,_0x2932c5){return _0x6bb9a4[_0xca21('0x9')](_0xca21('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca21('0xb'),'collate':_0xca21('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a77b3b5..81c7d2a 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 _0x8ea8=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x1c49a1,_0x112b7d){var _0x4dfd7d=function(_0x59e401){while(--_0x59e401){_0x1c49a1['push'](_0x1c49a1['shift']());}};_0x4dfd7d(++_0x112b7d);}(_0x8ea8,0xca));var _0x88ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x88ea('0x0'));var moment=require('moment');var BPromise=require(_0x88ea('0x1'));var rs=require(_0x88ea('0x2'));var fs=require('fs');var Redis=require(_0x88ea('0x3'));var db=require(_0x88ea('0x4'))['db'];var utils=require(_0x88ea('0x5'));var logger=require('../../config/logger')(_0x88ea('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88ea('0x7')][_0x88ea('0x8')]({'port':0x232a});config[_0x88ea('0x9')]=_[_0x88ea('0xa')](config['redis'],{'host':_0x88ea('0xb'),'port':0x18eb});var socket=require(_0x88ea('0xc'))(new Redis(config[_0x88ea('0x9')]));require(_0x88ea('0xd'))[_0x88ea('0xe')](socket);function respondWithRpcPromise(_0x494b33,_0x1cdab9,_0x515aa0){return new BPromise(function(_0x1a3865,_0x512459){return client[_0x88ea('0xf')](_0x494b33,_0x515aa0)[_0x88ea('0x10')](function(_0x13918e){logger[_0x88ea('0x11')](_0x88ea('0x12'),_0x1cdab9,_0x88ea('0x13'));logger[_0x88ea('0x14')](_0x88ea('0x15'),_0x1cdab9,_0x88ea('0x13'),JSON[_0x88ea('0x16')](_0x13918e));if(_0x13918e[_0x88ea('0x17')]){if(_0x13918e[_0x88ea('0x17')][_0x88ea('0x18')]===0x1f4){logger['error'](_0x88ea('0x12'),_0x1cdab9,_0x13918e['error'][_0x88ea('0x19')]);return _0x512459(_0x13918e['error'][_0x88ea('0x19')]);}logger[_0x88ea('0x17')](_0x88ea('0x12'),_0x1cdab9,_0x13918e[_0x88ea('0x17')][_0x88ea('0x19')]);return _0x1a3865(_0x13918e['error'][_0x88ea('0x19')]);}else{logger[_0x88ea('0x11')](_0x88ea('0x12'),_0x1cdab9,_0x88ea('0x13'));_0x1a3865(_0x13918e[_0x88ea('0x1a')][_0x88ea('0x19')]);}})['catch'](function(_0x39f3b7){logger[_0x88ea('0x17')](_0x88ea('0x12'),_0x1cdab9,_0x39f3b7);_0x512459(_0x39f3b7);});});} \ No newline at end of file +var _0xb51e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x310926,_0x226e01){var _0x205927=function(_0x330d81){while(--_0x330d81){_0x310926['push'](_0x310926['shift']());}};_0x205927(++_0x226e01);}(_0xb51e,0x12f));var _0xeb51=function(_0x535621,_0x2c1d14){_0x535621=_0x535621-0x0;var _0x150f77=_0xb51e[_0x535621];return _0x150f77;};'use strict';var _=require(_0xeb51('0x0'));var util=require(_0xeb51('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeb51('0x2'));var fs=require('fs');var Redis=require(_0xeb51('0x3'));var db=require(_0xeb51('0x4'))['db'];var utils=require(_0xeb51('0x5'));var logger=require(_0xeb51('0x6'))(_0xeb51('0x7'));var config=require(_0xeb51('0x8'));var jayson=require(_0xeb51('0x9'));var client=jayson[_0xeb51('0xa')]['http']({'port':0x232a});config[_0xeb51('0xb')]=_['defaults'](config[_0xeb51('0xb')],{'host':_0xeb51('0xc'),'port':0x18eb});var socket=require(_0xeb51('0xd'))(new Redis(config[_0xeb51('0xb')]));require(_0xeb51('0xe'))['register'](socket);function respondWithRpcPromise(_0x2df2aa,_0x195590,_0x25b76d){return new BPromise(function(_0x5b07e8,_0x3e3616){return client[_0xeb51('0xf')](_0x2df2aa,_0x25b76d)[_0xeb51('0x10')](function(_0x109062){logger[_0xeb51('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x195590,'request\x20sent');logger[_0xeb51('0x12')](_0xeb51('0x13'),_0x195590,_0xeb51('0x14'),JSON[_0xeb51('0x15')](_0x109062));if(_0x109062[_0xeb51('0x16')]){if(_0x109062[_0xeb51('0x16')][_0xeb51('0x17')]===0x1f4){logger[_0xeb51('0x16')](_0xeb51('0x18'),_0x195590,_0x109062[_0xeb51('0x16')]['message']);return _0x3e3616(_0x109062[_0xeb51('0x16')][_0xeb51('0x19')]);}logger[_0xeb51('0x16')](_0xeb51('0x18'),_0x195590,_0x109062[_0xeb51('0x16')][_0xeb51('0x19')]);return _0x5b07e8(_0x109062[_0xeb51('0x16')][_0xeb51('0x19')]);}else{logger[_0xeb51('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x195590,_0xeb51('0x14'));_0x5b07e8(_0x109062[_0xeb51('0x1a')][_0xeb51('0x19')]);}})[_0xeb51('0x1b')](function(_0x3f237b){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x195590,_0x3f237b);_0x3e3616(_0x3f237b);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 61f3653..3bb17f4 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 _0x656e=['remove','update','emit','removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save'];(function(_0x498107,_0x4359b4){var _0x107c7c=function(_0x12097d){while(--_0x12097d){_0x498107['push'](_0x498107['shift']());}};_0x107c7c(++_0x4359b4);}(_0x656e,0x17e));var _0xe656=function(_0x2e5011,_0x2ed248){_0x2e5011=_0x2e5011-0x0;var _0x4fed64=_0x656e[_0x2e5011];return _0x4fed64;};'use strict';var ChatInternalMessageEvents=require(_0xe656('0x0'));var events=[_0xe656('0x1'),_0xe656('0x2'),_0xe656('0x3')];function createListener(_0x49d47a,_0x36709b){return function(_0x28988a){_0x36709b[_0xe656('0x4')](_0x49d47a,_0x28988a);};}function removeListener(_0x1d5c24,_0x48650d){return function(){ChatInternalMessageEvents[_0xe656('0x5')](_0x1d5c24,_0x48650d);};}exports[_0xe656('0x6')]=function(_0x216c69){for(var _0x1a4d14=0x0,_0x3f0c33=events['length'];_0x1a4d14<_0x3f0c33;_0x1a4d14++){var _0x117c71=events[_0x1a4d14];var _0x41ee33=createListener(_0xe656('0x7')+_0x117c71,_0x216c69);ChatInternalMessageEvents['on'](_0x117c71,_0x41ee33);}}; \ No newline at end of file +var _0x871c=['remove','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x496afa,_0xa3ca10){var _0x358938=function(_0x52dcf0){while(--_0x52dcf0){_0x496afa['push'](_0x496afa['shift']());}};_0x358938(++_0xa3ca10);}(_0x871c,0x187));var _0xc871=function(_0x58fcbd,_0x19be1c){_0x58fcbd=_0x58fcbd-0x0;var _0x12b8fa=_0x871c[_0x58fcbd];return _0x12b8fa;};'use strict';var ChatInternalMessageEvents=require(_0xc871('0x0'));var events=['save',_0xc871('0x1'),_0xc871('0x2')];function createListener(_0x44f1f5,_0x19e43a){return function(_0x128ef8){_0x19e43a[_0xc871('0x3')](_0x44f1f5,_0x128ef8);};}function removeListener(_0x17e055,_0x58f7c0){return function(){ChatInternalMessageEvents[_0xc871('0x4')](_0x17e055,_0x58f7c0);};}exports[_0xc871('0x5')]=function(_0x170947){for(var _0x50e139=0x0,_0xf5cbeb=events[_0xc871('0x6')];_0x50e139<_0xf5cbeb;_0x50e139++){var _0x5de0c7=events[_0x50e139];var _0x30c94c=createListener(_0xc871('0x7')+_0x5de0c7,_0x170947);ChatInternalMessageEvents['on'](_0x5de0c7,_0x30c94c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f1de49d..6d11122 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 _0xb31e=['get','/describe','describe','isAuthenticated','getUsers','show','create','put','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller'];(function(_0x9bca53,_0x59b4f8){var _0x3894bc=function(_0x1ae67d){while(--_0x1ae67d){_0x9bca53['push'](_0x9bca53['shift']());}};_0x3894bc(++_0x59b4f8);}(_0xb31e,0x186));var _0xeb31=function(_0xb437bb,_0x30631d){_0xb437bb=_0xb437bb-0x0;var _0x1bc5ec=_0xb31e[_0xb437bb];return _0x1bc5ec;};'use strict';var multer=require(_0xeb31('0x0'));var util=require(_0xeb31('0x1'));var path=require(_0xeb31('0x2'));var timeout=require(_0xeb31('0x3'));var express=require(_0xeb31('0x4'));var router=express[_0xeb31('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeb31('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeb31('0x7'));var controller=require(_0xeb31('0x8'));router[_0xeb31('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xeb31('0xa'),auth['isAuthenticated'](),controller[_0xeb31('0xb')]);router['get']('/users',auth[_0xeb31('0xc')](),controller[_0xeb31('0xd')]);router[_0xeb31('0x9')]('/:id',auth[_0xeb31('0xc')](),controller[_0xeb31('0xe')]);router['post']('/',auth[_0xeb31('0xc')](),controller[_0xeb31('0xf')]);router[_0xeb31('0x10')](_0xeb31('0x11'),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xeb31('0x12')]=router; \ No newline at end of file +var _0xf07a=['/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','describe','/users'];(function(_0x2f1c82,_0x32c8df){var _0x28be01=function(_0x5bf674){while(--_0x5bf674){_0x2f1c82['push'](_0x2f1c82['shift']());}};_0x28be01(++_0x32c8df);}(_0xf07a,0x86));var _0xaf07=function(_0x54f978,_0x3a6b7e){_0x54f978=_0x54f978-0x0;var _0x5d40b3=_0xf07a[_0x54f978];return _0x5d40b3;};'use strict';var multer=require(_0xaf07('0x0'));var util=require(_0xaf07('0x1'));var path=require('path');var timeout=require(_0xaf07('0x2'));var express=require(_0xaf07('0x3'));var router=express[_0xaf07('0x4')]();var fs_extra=require(_0xaf07('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf07('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xaf07('0x7')]('/',auth['isAuthenticated'](),controller[_0xaf07('0x8')]);router['get'](_0xaf07('0x9'),auth[_0xaf07('0xa')](),controller[_0xaf07('0xb')]);router[_0xaf07('0x7')](_0xaf07('0xc'),auth[_0xaf07('0xa')](),controller['getUsers']);router[_0xaf07('0x7')](_0xaf07('0xd'),auth[_0xaf07('0xa')](),controller[_0xaf07('0xe')]);router[_0xaf07('0xf')]('/',auth['isAuthenticated'](),controller[_0xaf07('0x10')]);router[_0xaf07('0x11')](_0xaf07('0xd'),controller[_0xaf07('0x12')]);router[_0xaf07('0x13')](_0xaf07('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xaf07('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 160c216..65a5875 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 _0x9a2d=['out','DATE','STRING','TEXT','BOOLEAN','ENUM'];(function(_0x1593a7,_0x2b7304){var _0x1aaa80=function(_0x14cb95){while(--_0x14cb95){_0x1593a7['push'](_0x1593a7['shift']());}};_0x1aaa80(++_0x2b7304);}(_0x9a2d,0x123));var _0xd9a2=function(_0x19d64d,_0x4ee42e){_0x19d64d=_0x19d64d-0x0;var _0x560c5a=_0x9a2d[_0x19d64d];return _0x560c5a;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd9a2('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd9a2('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd9a2('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9a2('0x2')]('in',_0xd9a2('0x3')),'defaultValue':_0xd9a2('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd9a2('0x4')]},'providerName':{'type':Sequelize[_0xd9a2('0x5')]},'providerResponse':{'type':Sequelize[_0xd9a2('0x0')]}}; \ No newline at end of file +var _0x235b=['out','STRING','TEXT','sequelize','medium','BOOLEAN','ENUM'];(function(_0x47f9ae,_0x17ac6e){var _0x2f6688=function(_0x47e43b){while(--_0x47e43b){_0x47f9ae['push'](_0x47f9ae['shift']());}};_0x2f6688(++_0x17ac6e);}(_0x235b,0x1ed));var _0xb235=function(_0x50f9dc,_0x604357){_0x50f9dc=_0x50f9dc-0x0;var _0x538279=_0x235b[_0x50f9dc];return _0x538279;};'use strict';var Sequelize=require(_0xb235('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xb235('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb235('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb235('0x3')]('in',_0xb235('0x4')),'defaultValue':_0xb235('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb235('0x5')]},'providerResponse':{'type':Sequelize[_0xb235('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index df34f6f..c3af249 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 _0xb5d8=['read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','chat','interaction','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','email','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','end','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','find','create','body','update','destroy','describe','../../config/logger','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil'];(function(_0xfd08aa,_0x7aacdb){var _0x1b177d=function(_0x191215){while(--_0x191215){_0xfd08aa['push'](_0xfd08aa['shift']());}};_0x1b177d(++_0x7aacdb);}(_0xb5d8,0x1a8));var _0x8b5d=function(_0x24d3bf,_0x342400){_0x24d3bf=_0x24d3bf-0x0;var _0x11bd65=_0xb5d8[_0x24d3bf];return _0x11bd65;};'use strict';var emlformat=require(_0x8b5d('0x0'));var rimraf=require(_0x8b5d('0x1'));var zipdir=require(_0x8b5d('0x2'));var jsonpatch=require(_0x8b5d('0x3'));var rp=require(_0x8b5d('0x4'));var moment=require(_0x8b5d('0x5'));var BPromise=require(_0x8b5d('0x6'));var Mustache=require('mustache');var util=require(_0x8b5d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x8b5d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b5d('0x9'));var _=require('lodash');var squel=require(_0x8b5d('0xa'));var crypto=require('crypto');var jsforce=require(_0x8b5d('0xb'));var deskjs=require(_0x8b5d('0xc'));var toCsv=require(_0x8b5d('0x8'));var querystring=require(_0x8b5d('0xd'));var Papa=require(_0x8b5d('0xe'));var Redis=require(_0x8b5d('0xf'));var authService=require(_0x8b5d('0x10'));var qs=require(_0x8b5d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b5d('0x12'));var logger=require('../../config/logger')(_0x8b5d('0x13'));var utils=require(_0x8b5d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8b5d('0x15'));var db=require(_0x8b5d('0x16'))['db'];config[_0x8b5d('0x17')]=_[_0x8b5d('0x18')](config[_0x8b5d('0x17')],{'host':_0x8b5d('0x19'),'port':0x18eb});var socket=require(_0x8b5d('0x1a'))(new Redis(config[_0x8b5d('0x17')]));require(_0x8b5d('0x1b'))[_0x8b5d('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8b5d('0x1d')][_0x8b5d('0x1e')]({'port':0x232c});var client9002=jayson[_0x8b5d('0x1d')][_0x8b5d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0xebb7e5,_0x3d0899,_0xc86920,_0x47faf2){return new BPromise(function(_0x554572,_0x553f05){var _0x1b50de=_0x47faf2||client;return _0x1b50de[_0x8b5d('0x1f')](_0xebb7e5,_0xc86920)['then'](function(_0x21c263){logger[_0x8b5d('0x20')](_0x8b5d('0x21'),_0x3d0899,_0x8b5d('0x22'));logger[_0x8b5d('0x23')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3d0899,_0x8b5d('0x22'),JSON[_0x8b5d('0x24')](_0x21c263));if(_0x21c263[_0x8b5d('0x25')]){if(_0x21c263[_0x8b5d('0x25')][_0x8b5d('0x26')]===0x1f4){logger[_0x8b5d('0x25')](_0x8b5d('0x21'),_0x3d0899,_0x21c263[_0x8b5d('0x25')][_0x8b5d('0x27')]);return _0x553f05(_0x21c263[_0x8b5d('0x25')][_0x8b5d('0x27')]);}logger['error'](_0x8b5d('0x21'),_0x3d0899,_0x21c263[_0x8b5d('0x25')]['message']);return _0x554572(_0x21c263['error']['message']);}else{logger[_0x8b5d('0x20')](_0x8b5d('0x21'),_0x3d0899,_0x8b5d('0x22'));_0x554572(_0x21c263[_0x8b5d('0x28')][_0x8b5d('0x27')]);}})[_0x8b5d('0x29')](function(_0x172064){logger['error'](_0x8b5d('0x21'),_0x3d0899,_0x172064);_0x553f05(_0x172064);});});}function respondWithStatusCode(_0x317978,_0x345c53){_0x345c53=_0x345c53||0xcc;return function(_0x47812f){if(_0x47812f){return _0x317978[_0x8b5d('0x2a')](_0x345c53);}return _0x317978[_0x8b5d('0x2b')](_0x345c53)['end']();};}function respondWithResult(_0x435036,_0x429133){_0x429133=_0x429133||0xc8;return function(_0xb585d1){if(_0xb585d1){return _0x435036[_0x8b5d('0x2b')](_0x429133)[_0x8b5d('0x2c')](_0xb585d1);}};}function respondWithFilteredResult(_0x481f37,_0x137fcd){return function(_0x494cc8){if(_0x494cc8){var _0x5d71f2=typeof _0x137fcd[_0x8b5d('0x2d')]==='undefined'&&typeof _0x137fcd[_0x8b5d('0x2e')]===_0x8b5d('0x2f');var _0x5b106d=_0x494cc8[_0x8b5d('0x30')];var _0xd98181=_0x5d71f2?0x0:_0x137fcd[_0x8b5d('0x2d')];var _0x4129fc=_0x5d71f2?_0x494cc8[_0x8b5d('0x30')]:_0x137fcd['offset']+_0x137fcd[_0x8b5d('0x2e')];var _0x25f2c8;if(_0x4129fc>=_0x5b106d){_0x4129fc=_0x5b106d;_0x25f2c8=0xc8;}else{_0x25f2c8=0xce;}_0x481f37[_0x8b5d('0x2b')](_0x25f2c8);return _0x481f37[_0x8b5d('0x31')](_0x8b5d('0x32'),_0xd98181+'-'+_0x4129fc+'/'+_0x5b106d)[_0x8b5d('0x2c')](_0x494cc8);}return null;};}function patchUpdates(_0x2aa7ee){return function(_0x8a5ecb){try{jsonpatch['apply'](_0x8a5ecb,_0x2aa7ee,!![]);}catch(_0x1154ed){return BPromise[_0x8b5d('0x33')](_0x1154ed);}return _0x8a5ecb[_0x8b5d('0x34')]();};}function saveUpdates(_0x4effbf,_0x2fbabf){return function(_0x49a351){if(_0x49a351){return _0x49a351['update'](_0x4effbf)['then'](function(_0x2712b7){return _0x2712b7;});}return null;};}function removeEntity(_0x259c4b,_0x35d39e){return function(_0x2c05fa){if(_0x2c05fa){return _0x2c05fa['destroy']()[_0x8b5d('0x35')](function(){_0x259c4b[_0x8b5d('0x2b')](0xcc)[_0x8b5d('0x36')]();});}};}function handleEntityNotFound(_0x488450,_0x38d671){return function(_0x5b5f99){if(!_0x5b5f99){_0x488450[_0x8b5d('0x2a')](0x194);}return _0x5b5f99;};}function handleError(_0x1142cf,_0x49c933){_0x49c933=_0x49c933||0x1f4;return function(_0x339eaf){logger[_0x8b5d('0x25')](_0x339eaf['stack']);if(_0x339eaf[_0x8b5d('0x37')]){delete _0x339eaf[_0x8b5d('0x37')];}_0x1142cf[_0x8b5d('0x2b')](_0x49c933)[_0x8b5d('0x38')](_0x339eaf);};}exports[_0x8b5d('0x39')]=function(_0x5e79db,_0x3505d4){var _0x2b172f={},_0x133501={},_0x383eb6={'count':0x0,'rows':[]};var _0x1633d9=_[_0x8b5d('0x3a')](db[_0x8b5d('0x3b')][_0x8b5d('0x3c')],function(_0x2a16ac){return{'name':_0x2a16ac[_0x8b5d('0x3d')],'type':_0x2a16ac[_0x8b5d('0x3e')][_0x8b5d('0x3f')]};});_0x133501['model']=_[_0x8b5d('0x3a')](_0x1633d9,_0x8b5d('0x37'));_0x133501[_0x8b5d('0x40')]=_[_0x8b5d('0x41')](_0x5e79db[_0x8b5d('0x40')]);_0x133501['filters']=_[_0x8b5d('0x42')](_0x133501[_0x8b5d('0x43')],_0x133501[_0x8b5d('0x40')]);_0x2b172f[_0x8b5d('0x44')]=_['intersection'](_0x133501['model'],qs[_0x8b5d('0x45')](_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x45')]));_0x2b172f['attributes']=_0x2b172f[_0x8b5d('0x44')]['length']?_0x2b172f[_0x8b5d('0x44')]:_0x133501['model'];if(!_0x5e79db[_0x8b5d('0x40')]['hasOwnProperty']('nolimit')){_0x2b172f[_0x8b5d('0x2e')]=qs[_0x8b5d('0x2e')](_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x2e')]);_0x2b172f[_0x8b5d('0x2d')]=qs[_0x8b5d('0x2d')](_0x5e79db[_0x8b5d('0x40')]['offset']);}_0x2b172f[_0x8b5d('0x46')]=qs[_0x8b5d('0x47')](_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x47')]);_0x2b172f[_0x8b5d('0x48')]=qs[_0x8b5d('0x49')](_[_0x8b5d('0x4a')](_0x5e79db['query'],_0x133501[_0x8b5d('0x49')]),_0x1633d9);if(_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x4b')]){_0x2b172f[_0x8b5d('0x48')]=_['merge'](_0x2b172f[_0x8b5d('0x48')],{'$or':_[_0x8b5d('0x3a')](_0x1633d9,function(_0x47f370){if(_0x47f370[_0x8b5d('0x3e')]!==_0x8b5d('0x4c')){var _0x4e7cd1={};_0x4e7cd1[_0x47f370[_0x8b5d('0x37')]]={'$like':'%'+_0x5e79db[_0x8b5d('0x40')][_0x8b5d('0x4b')]+'%'};return _0x4e7cd1;}})});}_0x2b172f=_[_0x8b5d('0x4d')]({},_0x2b172f,_0x5e79db[_0x8b5d('0x4e')]);var _0x3c7921={'where':_0x2b172f['where']};return db[_0x8b5d('0x3b')][_0x8b5d('0x30')](_0x3c7921)[_0x8b5d('0x35')](function(_0x3b8576){_0x383eb6[_0x8b5d('0x30')]=_0x3b8576;if(_0x5e79db['query'][_0x8b5d('0x4f')]){_0x2b172f[_0x8b5d('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x8b5d('0x51')](_0x2b172f);})[_0x8b5d('0x35')](function(_0x56e1c7){_0x383eb6['rows']=_0x56e1c7;return _0x383eb6;})[_0x8b5d('0x35')](respondWithFilteredResult(_0x3505d4,_0x2b172f))[_0x8b5d('0x29')](handleError(_0x3505d4,null));};exports[_0x8b5d('0x52')]=function(_0x5d1213,_0x155bae){var _0x2defe1={'raw':!![],'where':{'id':_0x5d1213[_0x8b5d('0x53')]['id']}},_0x598c75={};_0x598c75['model']=_['keys'](db[_0x8b5d('0x3b')][_0x8b5d('0x3c')]);_0x598c75[_0x8b5d('0x40')]=_['keys'](_0x5d1213[_0x8b5d('0x40')]);_0x598c75['filters']=_[_0x8b5d('0x42')](_0x598c75[_0x8b5d('0x43')],_0x598c75['query']);_0x2defe1[_0x8b5d('0x44')]=_['intersection'](_0x598c75[_0x8b5d('0x43')],qs[_0x8b5d('0x45')](_0x5d1213['query'][_0x8b5d('0x45')]));_0x2defe1[_0x8b5d('0x44')]=_0x2defe1[_0x8b5d('0x44')][_0x8b5d('0x54')]?_0x2defe1[_0x8b5d('0x44')]:_0x598c75['model'];if(_0x5d1213[_0x8b5d('0x40')][_0x8b5d('0x4f')]){_0x2defe1[_0x8b5d('0x50')]=[{'all':!![]}];}_0x2defe1=_[_0x8b5d('0x4d')]({},_0x2defe1,_0x5d1213['options']);return db[_0x8b5d('0x3b')][_0x8b5d('0x55')](_0x2defe1)[_0x8b5d('0x35')](handleEntityNotFound(_0x155bae,null))[_0x8b5d('0x35')](respondWithResult(_0x155bae,null))['catch'](handleError(_0x155bae,null));};exports[_0x8b5d('0x56')]=function(_0x13ad71,_0xb3a873){return db[_0x8b5d('0x3b')][_0x8b5d('0x56')](_0x13ad71[_0x8b5d('0x57')],{})[_0x8b5d('0x35')](respondWithResult(_0xb3a873,0xc9))['catch'](handleError(_0xb3a873,null));};exports[_0x8b5d('0x58')]=function(_0x3c0009,_0x109107){if(_0x3c0009['body']['id']){delete _0x3c0009['body']['id'];}return db[_0x8b5d('0x3b')]['find']({'where':{'id':_0x3c0009[_0x8b5d('0x53')]['id']}})[_0x8b5d('0x35')](handleEntityNotFound(_0x109107,null))['then'](saveUpdates(_0x3c0009[_0x8b5d('0x57')],null))[_0x8b5d('0x35')](respondWithResult(_0x109107,null))[_0x8b5d('0x29')](handleError(_0x109107,null));};exports[_0x8b5d('0x59')]=function(_0x51915d,_0xee710a){return db[_0x8b5d('0x3b')][_0x8b5d('0x55')]({'where':{'id':_0x51915d[_0x8b5d('0x53')]['id']}})['then'](handleEntityNotFound(_0xee710a,null))[_0x8b5d('0x35')](removeEntity(_0xee710a,null))[_0x8b5d('0x29')](handleError(_0xee710a,null));};exports[_0x8b5d('0x5a')]=function(_0x21a94a,_0x1d8bfc){return db[_0x8b5d('0x3b')][_0x8b5d('0x5a')]()['then'](respondWithResult(_0x1d8bfc,null))['catch'](handleError(_0x1d8bfc,null));};var interaction_log=require(_0x8b5d('0x5b'))('chat-interactions');exports[_0x8b5d('0x5c')]=function(_0x5801cc,_0x2f810d,_0x355694){var _0x400afc={'agent':{},'channel':'chat'};if(_0x5801cc[_0x8b5d('0x57')]['id']){delete _0x5801cc['body']['id'];}_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x5d')]=!![];_0x5801cc['body'][_0x8b5d('0x5e')]=moment()[_0x8b5d('0x5f')](_0x8b5d('0x60'));_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x61')]=_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x61')]||_0x5801cc[_0x8b5d('0x62')]['id'];_0x400afc[_0x8b5d('0x63')]['id']=_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x61')];return db[_0x8b5d('0x3b')][_0x8b5d('0x55')]({'where':{'id':_0x5801cc[_0x8b5d('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2f810d,null))[_0x8b5d('0x35')](saveUpdates(_0x5801cc['body'],null))['then'](function(_0x1d40c0){if(_0x1d40c0){_0x400afc[_0x8b5d('0x27')]=_0x1d40c0[_0x8b5d('0x64')]({'plain':!![]});return db[_0x8b5d('0x65')]['find']({'where':{'id':_0x1d40c0[_0x8b5d('0x66')]}});}return null;})[_0x8b5d('0x35')](handleEntityNotFound(_0x2f810d,null))[_0x8b5d('0x35')](function(_0x4a1cee){if(_0x4a1cee){return _0x4a1cee['update']({'UserId':_0x5801cc['body']['UserId'],'read1stAt':_[_0x8b5d('0x67')](_0x4a1cee[_0x8b5d('0x68')])?moment()[_0x8b5d('0x5f')](_0x8b5d('0x60')):undefined});}return null;})[_0x8b5d('0x35')](function(_0xc8fdf2){if(_0xc8fdf2){_0x400afc['interaction']=_0xc8fdf2[_0x8b5d('0x64')]({'plain':!![]});interaction_log[_0x8b5d('0x20')](_0x8b5d('0x69'),_0x5801cc[_0x8b5d('0x62')]['id'],_0x5801cc[_0x8b5d('0x62')][_0x8b5d('0x37')],_0x5801cc[_0x8b5d('0x62')][_0x8b5d('0x6a')],_0x400afc['interaction']['id'],_0x5801cc[_0x8b5d('0x57')]?JSON[_0x8b5d('0x24')](_0x5801cc['body']):_0x8b5d('0x6b'));return respondWithRpcPromise(_0x8b5d('0x6c'),_0x8b5d('0x6d'),_0x400afc);}return null;})['then'](function(_0x13b402){var _0x5c96ff='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13b402[_0x8b5d('0x27')][_0x8b5d('0x6e')];return db['sequelize']['query'](_0x5c96ff,{'type':db[_0x8b5d('0x6f')][_0x8b5d('0x70')][_0x8b5d('0x71')],'raw':!![]})[_0x8b5d('0x35')](function(_0x48b523){return _0x48b523;});})[_0x8b5d('0x35')](function(_0x457f6a){if(_0x457f6a){_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x72')]=_0x457f6a[0x0];if(!_0x5801cc[_0x8b5d('0x57')][_0x8b5d('0x61')])return;return db[_0x8b5d('0x73')][_0x8b5d('0x55')]({'where':{'id':_0x5801cc['body']['UserId'],'role':_0x8b5d('0x63')},'attributes':['id',_0x8b5d('0x37'),_0x8b5d('0x74'),'email',_0x8b5d('0x75')],'raw':!![]});}return null;})[_0x8b5d('0x35')](function(_0x294dec){if(!_0x294dec)return null;_0x400afc['message']['agent']=_0x294dec;return _0x400afc;})['then'](function(_0x8313be){if(_0x8313be){if(_0x5801cc[_0x8b5d('0x57')]['manual']){_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x76')]=util[_0x8b5d('0x5f')]('SIP/%s',_0x5801cc[_0x8b5d('0x62')][_0x8b5d('0x37')]);_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x77')]=_0x400afc['channel'];_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x78')]=_0x400afc[_0x8b5d('0x77')];_0x400afc[_0x8b5d('0x27')][_0x8b5d('0x79')]=_0x8b5d('0x5c');return respondWithRpcPromise(_0x8b5d('0x7a'),_0x8b5d('0x7a'),{'event':_0x8b5d('0x7b'),'message':_[_0x8b5d('0x4d')](_0x400afc[_0x8b5d('0x27')],JSON['parse'](_0x400afc['interaction'][_0x8b5d('0x7c')]))},client9002)[_0x8b5d('0x35')](function(){return _0x400afc;});}return _0x400afc;}return null;})['then'](respondWithResult(_0x2f810d,null))[_0x8b5d('0x29')](handleError(_0x2f810d,null));};var interaction_log=require('../../config/logger')(_0x8b5d('0x7d'));exports[_0x8b5d('0x33')]=function(_0x1414f0,_0x581f1f,_0x51b704){var _0x230f45={'agent':{},'channel':_0x8b5d('0x7e')};if(_0x1414f0[_0x8b5d('0x57')]['id']){delete _0x1414f0[_0x8b5d('0x57')]['id'];}_0x1414f0[_0x8b5d('0x57')][_0x8b5d('0x61')]=_0x1414f0[_0x8b5d('0x57')]['UserId']||_0x1414f0[_0x8b5d('0x62')]['id'];_0x230f45[_0x8b5d('0x63')]['id']=_0x1414f0['body']['UserId'];return db[_0x8b5d('0x3b')][_0x8b5d('0x55')]({'where':{'id':_0x1414f0[_0x8b5d('0x53')]['id'],'UserId':null}})[_0x8b5d('0x35')](handleEntityNotFound(_0x581f1f,null))['then'](function(_0x58131e){if(_0x58131e){_0x230f45[_0x8b5d('0x27')]=_0x58131e[_0x8b5d('0x64')]({'plain':!![]});return db[_0x8b5d('0x65')][_0x8b5d('0x55')]({'where':{'id':_0x58131e['ChatInteractionId']}});}return null;})[_0x8b5d('0x35')](handleEntityNotFound(_0x581f1f,null))[_0x8b5d('0x35')](function(_0x428f31){if(_0x428f31){_0x230f45[_0x8b5d('0x7f')]=_0x428f31['get']({'plain':!![]});interaction_log[_0x8b5d('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1414f0['user']['id'],_0x1414f0[_0x8b5d('0x62')][_0x8b5d('0x37')],_0x1414f0[_0x8b5d('0x62')][_0x8b5d('0x6a')],_0x230f45[_0x8b5d('0x7f')]['id'],_0x1414f0[_0x8b5d('0x57')]?JSON[_0x8b5d('0x24')](_0x1414f0['body']):'null');return respondWithRpcPromise(_0x8b5d('0x80'),'rejectMessage',_0x230f45);}return null;})[_0x8b5d('0x35')](function(_0x4fcc64){var _0x3e8501=_0x8b5d('0x81')+_0x4fcc64['message'][_0x8b5d('0x6e')];return db['sequelize'][_0x8b5d('0x40')](_0x3e8501,{'type':db[_0x8b5d('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x8b5d('0x35')](function(_0x683b7f){return _0x683b7f;});})[_0x8b5d('0x35')](function(_0x10c437){if(_0x10c437){_0x230f45[_0x8b5d('0x27')][_0x8b5d('0x72')]=_0x10c437[0x0];if(!_0x1414f0[_0x8b5d('0x57')]['UserId'])return;return db[_0x8b5d('0x73')]['find']({'where':{'id':_0x1414f0[_0x8b5d('0x57')][_0x8b5d('0x61')],'role':_0x8b5d('0x63')},'attributes':['id',_0x8b5d('0x37'),_0x8b5d('0x74'),_0x8b5d('0x82'),'internal'],'raw':!![]});}return null;})[_0x8b5d('0x35')](function(_0x5b9ca0){if(!_0x5b9ca0)return null;_0x230f45['message'][_0x8b5d('0x63')]=_0x5b9ca0;return _0x230f45;})[_0x8b5d('0x35')](function(_0x15a661){if(_0x15a661){_0x15a661[_0x8b5d('0x27')][_0x8b5d('0x76')]=util['format']('SIP/%s',_0x1414f0['user']['name']);_0x15a661[_0x8b5d('0x27')][_0x8b5d('0x77')]=_0x230f45[_0x8b5d('0x77')];_0x15a661[_0x8b5d('0x27')]['motionChannel']=_0x230f45[_0x8b5d('0x77')];_0x15a661['message'][_0x8b5d('0x79')]=_0x8b5d('0x33');respondWithRpcPromise(_0x8b5d('0x7a'),_0x8b5d('0x7a'),{'event':_0x8b5d('0x83'),'message':_[_0x8b5d('0x4d')](_0x230f45[_0x8b5d('0x27')],JSON['parse'](_0x230f45[_0x8b5d('0x7f')][_0x8b5d('0x7c')]))},client9002);return _0x230f45;}return null;})[_0x8b5d('0x35')](respondWithResult(_0x581f1f,null))['catch'](handleError(_0x581f1f,null));}; \ No newline at end of file +var _0xa283=['describe','chat-interactions','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','get','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','interface','channel','event','accept','EventManager','acceptmessage','parse','formData','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SIP/%s','motionChannel','rejectmessage','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','stack','name','index','ChatMessage','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','show','keys','includeAll','find','create','body','params'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xa283,0x1a8));var _0x3a28=function(_0x110cd3,_0x35cb58){_0x110cd3=_0x110cd3-0x0;var _0x120f5e=_0xa283[_0x110cd3];return _0x120f5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3a28('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3a28('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3a28('0x2'));var util=require(_0x3a28('0x3'));var path=require(_0x3a28('0x4'));var sox=require(_0x3a28('0x5'));var csv=require(_0x3a28('0x6'));var ejs=require(_0x3a28('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a28('0x8'));var squel=require(_0x3a28('0x9'));var crypto=require(_0x3a28('0xa'));var jsforce=require(_0x3a28('0xb'));var deskjs=require(_0x3a28('0xc'));var toCsv=require(_0x3a28('0x6'));var querystring=require('querystring');var Papa=require(_0x3a28('0xd'));var Redis=require(_0x3a28('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3a28('0xf'));var hardwareService=require(_0x3a28('0x10'));var logger=require(_0x3a28('0x11'))('api');var utils=require(_0x3a28('0x12'));var config=require(_0x3a28('0x13'));var licenseUtil=require(_0x3a28('0x14'));var db=require(_0x3a28('0x15'))['db'];config[_0x3a28('0x16')]=_[_0x3a28('0x17')](config[_0x3a28('0x16')],{'host':_0x3a28('0x18'),'port':0x18eb});var socket=require(_0x3a28('0x19'))(new Redis(config[_0x3a28('0x16')]));require(_0x3a28('0x1a'))[_0x3a28('0x1b')](socket);var jayson=require(_0x3a28('0x1c'));var client=jayson[_0x3a28('0x1d')][_0x3a28('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x3a28('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x19fbdc,_0x39a21e,_0x9c8abf,_0x52c241){return new BPromise(function(_0x36a89b,_0x5abf93){var _0x4134a8=_0x52c241||client;return _0x4134a8['request'](_0x19fbdc,_0x9c8abf)[_0x3a28('0x1f')](function(_0x28d1ef){logger['info'](_0x3a28('0x20'),_0x39a21e,_0x3a28('0x21'));logger[_0x3a28('0x22')](_0x3a28('0x23'),_0x39a21e,'request\x20sent',JSON[_0x3a28('0x24')](_0x28d1ef));if(_0x28d1ef[_0x3a28('0x25')]){if(_0x28d1ef[_0x3a28('0x25')][_0x3a28('0x26')]===0x1f4){logger[_0x3a28('0x25')]('ChatMessage,\x20%s,\x20%s',_0x39a21e,_0x28d1ef[_0x3a28('0x25')][_0x3a28('0x27')]);return _0x5abf93(_0x28d1ef['error'][_0x3a28('0x27')]);}logger['error'](_0x3a28('0x20'),_0x39a21e,_0x28d1ef[_0x3a28('0x25')][_0x3a28('0x27')]);return _0x36a89b(_0x28d1ef[_0x3a28('0x25')]['message']);}else{logger[_0x3a28('0x28')](_0x3a28('0x20'),_0x39a21e,'request\x20sent');_0x36a89b(_0x28d1ef[_0x3a28('0x29')][_0x3a28('0x27')]);}})[_0x3a28('0x2a')](function(_0x103a9b){logger['error'](_0x3a28('0x20'),_0x39a21e,_0x103a9b);_0x5abf93(_0x103a9b);});});}function respondWithStatusCode(_0x5c0d35,_0x338f36){_0x338f36=_0x338f36||0xcc;return function(_0x36de30){if(_0x36de30){return _0x5c0d35[_0x3a28('0x2b')](_0x338f36);}return _0x5c0d35[_0x3a28('0x2c')](_0x338f36)[_0x3a28('0x2d')]();};}function respondWithResult(_0x4d3fb3,_0x208e23){_0x208e23=_0x208e23||0xc8;return function(_0x28ce3d){if(_0x28ce3d){return _0x4d3fb3[_0x3a28('0x2c')](_0x208e23)[_0x3a28('0x2e')](_0x28ce3d);}};}function respondWithFilteredResult(_0x326dfd,_0x1347c9){return function(_0x9669c8){if(_0x9669c8){var _0xeb6a1f=typeof _0x1347c9[_0x3a28('0x2f')]==='undefined'&&typeof _0x1347c9['limit']===_0x3a28('0x30');var _0x4aabc=_0x9669c8[_0x3a28('0x31')];var _0x26d78e=_0xeb6a1f?0x0:_0x1347c9[_0x3a28('0x2f')];var _0x51fc72=_0xeb6a1f?_0x9669c8[_0x3a28('0x31')]:_0x1347c9[_0x3a28('0x2f')]+_0x1347c9[_0x3a28('0x32')];var _0x58db79;if(_0x51fc72>=_0x4aabc){_0x51fc72=_0x4aabc;_0x58db79=0xc8;}else{_0x58db79=0xce;}_0x326dfd[_0x3a28('0x2c')](_0x58db79);return _0x326dfd[_0x3a28('0x33')](_0x3a28('0x34'),_0x26d78e+'-'+_0x51fc72+'/'+_0x4aabc)['json'](_0x9669c8);}return null;};}function patchUpdates(_0x181158){return function(_0x5d0eae){try{jsonpatch[_0x3a28('0x35')](_0x5d0eae,_0x181158,!![]);}catch(_0x596878){return BPromise[_0x3a28('0x36')](_0x596878);}return _0x5d0eae['save']();};}function saveUpdates(_0x48d2dc,_0x1832ae){return function(_0x218868){if(_0x218868){return _0x218868[_0x3a28('0x37')](_0x48d2dc)[_0x3a28('0x1f')](function(_0x4b6638){return _0x4b6638;});}return null;};}function removeEntity(_0x4a9201,_0x5a4c24){return function(_0x4c818a){if(_0x4c818a){return _0x4c818a[_0x3a28('0x38')]()['then'](function(){_0x4a9201[_0x3a28('0x2c')](0xcc)[_0x3a28('0x2d')]();});}};}function handleEntityNotFound(_0x2dfc54,_0x2cdad5){return function(_0x47926f){if(!_0x47926f){_0x2dfc54[_0x3a28('0x2b')](0x194);}return _0x47926f;};}function handleError(_0x31a1f4,_0x59de78){_0x59de78=_0x59de78||0x1f4;return function(_0x4df896){logger['error'](_0x4df896[_0x3a28('0x39')]);if(_0x4df896[_0x3a28('0x3a')]){delete _0x4df896[_0x3a28('0x3a')];}_0x31a1f4['status'](_0x59de78)['send'](_0x4df896);};}exports[_0x3a28('0x3b')]=function(_0x4945f0,_0x1edb93){var _0x5a6f96={},_0x158538={},_0x51a408={'count':0x0,'rows':[]};var _0x3d2d39=_['map'](db[_0x3a28('0x3c')][_0x3a28('0x3d')],function(_0x2c6c6d){return{'name':_0x2c6c6d['fieldName'],'type':_0x2c6c6d[_0x3a28('0x3e')][_0x3a28('0x3f')]};});_0x158538[_0x3a28('0x40')]=_['map'](_0x3d2d39,_0x3a28('0x3a'));_0x158538['query']=_['keys'](_0x4945f0[_0x3a28('0x41')]);_0x158538[_0x3a28('0x42')]=_[_0x3a28('0x43')](_0x158538[_0x3a28('0x40')],_0x158538[_0x3a28('0x41')]);_0x5a6f96['attributes']=_[_0x3a28('0x43')](_0x158538[_0x3a28('0x40')],qs[_0x3a28('0x44')](_0x4945f0[_0x3a28('0x41')][_0x3a28('0x44')]));_0x5a6f96[_0x3a28('0x45')]=_0x5a6f96[_0x3a28('0x45')][_0x3a28('0x46')]?_0x5a6f96[_0x3a28('0x45')]:_0x158538['model'];if(!_0x4945f0['query'][_0x3a28('0x47')](_0x3a28('0x48'))){_0x5a6f96[_0x3a28('0x32')]=qs[_0x3a28('0x32')](_0x4945f0['query'][_0x3a28('0x32')]);_0x5a6f96[_0x3a28('0x2f')]=qs['offset'](_0x4945f0[_0x3a28('0x41')][_0x3a28('0x2f')]);}_0x5a6f96[_0x3a28('0x49')]=qs[_0x3a28('0x4a')](_0x4945f0[_0x3a28('0x41')]['sort']);_0x5a6f96[_0x3a28('0x4b')]=qs[_0x3a28('0x42')](_['pick'](_0x4945f0[_0x3a28('0x41')],_0x158538[_0x3a28('0x42')]),_0x3d2d39);if(_0x4945f0[_0x3a28('0x41')][_0x3a28('0x4c')]){_0x5a6f96[_0x3a28('0x4b')]=_['merge'](_0x5a6f96[_0x3a28('0x4b')],{'$or':_['map'](_0x3d2d39,function(_0x1fdaec){if(_0x1fdaec['type']!=='VIRTUAL'){var _0x44c692={};_0x44c692[_0x1fdaec[_0x3a28('0x3a')]]={'$like':'%'+_0x4945f0['query']['filter']+'%'};return _0x44c692;}})});}_0x5a6f96=_[_0x3a28('0x4d')]({},_0x5a6f96,_0x4945f0[_0x3a28('0x4e')]);var _0x4bdb4b={'where':_0x5a6f96[_0x3a28('0x4b')]};return db[_0x3a28('0x3c')]['count'](_0x4bdb4b)[_0x3a28('0x1f')](function(_0x303752){_0x51a408[_0x3a28('0x31')]=_0x303752;if(_0x4945f0[_0x3a28('0x41')]['includeAll']){_0x5a6f96[_0x3a28('0x4f')]=[{'all':!![]}];}return db[_0x3a28('0x3c')][_0x3a28('0x50')](_0x5a6f96);})[_0x3a28('0x1f')](function(_0x4b02f3){_0x51a408['rows']=_0x4b02f3;return _0x51a408;})['then'](respondWithFilteredResult(_0x1edb93,_0x5a6f96))[_0x3a28('0x2a')](handleError(_0x1edb93,null));};exports[_0x3a28('0x51')]=function(_0x1e4c0a,_0x15598e){var _0x4aa515={'raw':!![],'where':{'id':_0x1e4c0a['params']['id']}},_0x25c856={};_0x25c856[_0x3a28('0x40')]=_[_0x3a28('0x52')](db[_0x3a28('0x3c')]['rawAttributes']);_0x25c856[_0x3a28('0x41')]=_[_0x3a28('0x52')](_0x1e4c0a[_0x3a28('0x41')]);_0x25c856['filters']=_[_0x3a28('0x43')](_0x25c856['model'],_0x25c856[_0x3a28('0x41')]);_0x4aa515['attributes']=_[_0x3a28('0x43')](_0x25c856[_0x3a28('0x40')],qs[_0x3a28('0x44')](_0x1e4c0a[_0x3a28('0x41')][_0x3a28('0x44')]));_0x4aa515[_0x3a28('0x45')]=_0x4aa515[_0x3a28('0x45')][_0x3a28('0x46')]?_0x4aa515['attributes']:_0x25c856[_0x3a28('0x40')];if(_0x1e4c0a[_0x3a28('0x41')][_0x3a28('0x53')]){_0x4aa515[_0x3a28('0x4f')]=[{'all':!![]}];}_0x4aa515=_['merge']({},_0x4aa515,_0x1e4c0a[_0x3a28('0x4e')]);return db[_0x3a28('0x3c')][_0x3a28('0x54')](_0x4aa515)[_0x3a28('0x1f')](handleEntityNotFound(_0x15598e,null))[_0x3a28('0x1f')](respondWithResult(_0x15598e,null))['catch'](handleError(_0x15598e,null));};exports[_0x3a28('0x55')]=function(_0x2f5cb7,_0x2f0710){return db[_0x3a28('0x3c')]['create'](_0x2f5cb7['body'],{})['then'](respondWithResult(_0x2f0710,0xc9))['catch'](handleError(_0x2f0710,null));};exports['update']=function(_0x40d2e2,_0x2b8e66){if(_0x40d2e2[_0x3a28('0x56')]['id']){delete _0x40d2e2[_0x3a28('0x56')]['id'];}return db[_0x3a28('0x3c')][_0x3a28('0x54')]({'where':{'id':_0x40d2e2['params']['id']}})['then'](handleEntityNotFound(_0x2b8e66,null))['then'](saveUpdates(_0x40d2e2['body'],null))[_0x3a28('0x1f')](respondWithResult(_0x2b8e66,null))[_0x3a28('0x2a')](handleError(_0x2b8e66,null));};exports['destroy']=function(_0x9256bb,_0x12b8eb){return db[_0x3a28('0x3c')][_0x3a28('0x54')]({'where':{'id':_0x9256bb[_0x3a28('0x57')]['id']}})[_0x3a28('0x1f')](handleEntityNotFound(_0x12b8eb,null))[_0x3a28('0x1f')](removeEntity(_0x12b8eb,null))[_0x3a28('0x2a')](handleError(_0x12b8eb,null));};exports[_0x3a28('0x58')]=function(_0x230f31,_0x345349){return db['ChatMessage'][_0x3a28('0x58')]()[_0x3a28('0x1f')](respondWithResult(_0x345349,null))[_0x3a28('0x2a')](handleError(_0x345349,null));};var interaction_log=require(_0x3a28('0x11'))(_0x3a28('0x59'));exports['accept']=function(_0x34be7d,_0x28ef32,_0x1abf28){var _0x46e2ba={'agent':{},'channel':_0x3a28('0x5a')};if(_0x34be7d[_0x3a28('0x56')]['id']){delete _0x34be7d[_0x3a28('0x56')]['id'];}_0x34be7d['body']['read']=!![];_0x34be7d[_0x3a28('0x56')]['readAt']=moment()[_0x3a28('0x5b')](_0x3a28('0x5c'));_0x34be7d[_0x3a28('0x56')][_0x3a28('0x5d')]=_0x34be7d[_0x3a28('0x56')][_0x3a28('0x5d')]||_0x34be7d[_0x3a28('0x5e')]['id'];_0x46e2ba[_0x3a28('0x5f')]['id']=_0x34be7d[_0x3a28('0x56')][_0x3a28('0x5d')];return db[_0x3a28('0x3c')]['find']({'where':{'id':_0x34be7d[_0x3a28('0x57')]['id'],'UserId':null}})[_0x3a28('0x1f')](handleEntityNotFound(_0x28ef32,null))[_0x3a28('0x1f')](saveUpdates(_0x34be7d[_0x3a28('0x56')],null))[_0x3a28('0x1f')](function(_0x1038d2){if(_0x1038d2){_0x46e2ba[_0x3a28('0x27')]=_0x1038d2['get']({'plain':!![]});return db[_0x3a28('0x60')][_0x3a28('0x54')]({'where':{'id':_0x1038d2[_0x3a28('0x61')]}});}return null;})[_0x3a28('0x1f')](handleEntityNotFound(_0x28ef32,null))[_0x3a28('0x1f')](function(_0xf0fc06){if(_0xf0fc06){return _0xf0fc06['update']({'UserId':_0x34be7d[_0x3a28('0x56')][_0x3a28('0x5d')],'read1stAt':_[_0x3a28('0x62')](_0xf0fc06[_0x3a28('0x63')])?moment()[_0x3a28('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x98819b){if(_0x98819b){_0x46e2ba[_0x3a28('0x64')]=_0x98819b[_0x3a28('0x65')]({'plain':!![]});interaction_log[_0x3a28('0x28')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x34be7d[_0x3a28('0x5e')]['id'],_0x34be7d[_0x3a28('0x5e')]['name'],_0x34be7d[_0x3a28('0x5e')][_0x3a28('0x66')],_0x46e2ba[_0x3a28('0x64')]['id'],_0x34be7d[_0x3a28('0x56')]?JSON[_0x3a28('0x24')](_0x34be7d[_0x3a28('0x56')]):_0x3a28('0x67'));return respondWithRpcPromise(_0x3a28('0x68'),_0x3a28('0x69'),_0x46e2ba);}return null;})['then'](function(_0x355b1b){var _0x3501b7='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x355b1b[_0x3a28('0x27')][_0x3a28('0x6a')];return db[_0x3a28('0x6b')][_0x3a28('0x41')](_0x3501b7,{'type':db[_0x3a28('0x6c')][_0x3a28('0x6d')]['SELECT'],'raw':!![]})[_0x3a28('0x1f')](function(_0x225032){return _0x225032;});})[_0x3a28('0x1f')](function(_0x2940e8){if(_0x2940e8){_0x46e2ba[_0x3a28('0x27')][_0x3a28('0x6e')]=_0x2940e8[0x0];if(!_0x34be7d['body'][_0x3a28('0x5d')])return;return db[_0x3a28('0x6f')][_0x3a28('0x54')]({'where':{'id':_0x34be7d[_0x3a28('0x56')][_0x3a28('0x5d')],'role':_0x3a28('0x5f')},'attributes':['id','name',_0x3a28('0x70'),_0x3a28('0x71'),_0x3a28('0x72')],'raw':!![]});}return null;})['then'](function(_0x375347){if(!_0x375347)return null;_0x46e2ba[_0x3a28('0x27')][_0x3a28('0x5f')]=_0x375347;return _0x46e2ba;})[_0x3a28('0x1f')](function(_0x201a8b){if(_0x201a8b){if(_0x34be7d[_0x3a28('0x56')]['manual']){_0x46e2ba[_0x3a28('0x27')][_0x3a28('0x73')]=util[_0x3a28('0x5b')]('SIP/%s',_0x34be7d['user'][_0x3a28('0x3a')]);_0x46e2ba['message'][_0x3a28('0x74')]=_0x46e2ba[_0x3a28('0x74')];_0x46e2ba[_0x3a28('0x27')]['motionChannel']=_0x46e2ba[_0x3a28('0x74')];_0x46e2ba[_0x3a28('0x27')][_0x3a28('0x75')]=_0x3a28('0x76');return respondWithRpcPromise(_0x3a28('0x77'),_0x3a28('0x77'),{'event':_0x3a28('0x78'),'message':_[_0x3a28('0x4d')](_0x46e2ba[_0x3a28('0x27')],JSON[_0x3a28('0x79')](_0x46e2ba['interaction'][_0x3a28('0x7a')]))},client9002)[_0x3a28('0x1f')](function(){return _0x46e2ba;});}return _0x46e2ba;}return null;})[_0x3a28('0x1f')](respondWithResult(_0x28ef32,null))[_0x3a28('0x2a')](handleError(_0x28ef32,null));};var interaction_log=require(_0x3a28('0x11'))(_0x3a28('0x59'));exports[_0x3a28('0x36')]=function(_0x501921,_0x12fa24,_0x3beaf7){var _0x204a2f={'agent':{},'channel':_0x3a28('0x5a')};if(_0x501921[_0x3a28('0x56')]['id']){delete _0x501921[_0x3a28('0x56')]['id'];}_0x501921[_0x3a28('0x56')][_0x3a28('0x5d')]=_0x501921[_0x3a28('0x56')][_0x3a28('0x5d')]||_0x501921['user']['id'];_0x204a2f[_0x3a28('0x5f')]['id']=_0x501921[_0x3a28('0x56')]['UserId'];return db[_0x3a28('0x3c')][_0x3a28('0x54')]({'where':{'id':_0x501921[_0x3a28('0x57')]['id'],'UserId':null}})[_0x3a28('0x1f')](handleEntityNotFound(_0x12fa24,null))[_0x3a28('0x1f')](function(_0x12a466){if(_0x12a466){_0x204a2f[_0x3a28('0x27')]=_0x12a466[_0x3a28('0x65')]({'plain':!![]});return db[_0x3a28('0x60')][_0x3a28('0x54')]({'where':{'id':_0x12a466[_0x3a28('0x61')]}});}return null;})[_0x3a28('0x1f')](handleEntityNotFound(_0x12fa24,null))[_0x3a28('0x1f')](function(_0x2079a1){if(_0x2079a1){_0x204a2f['interaction']=_0x2079a1[_0x3a28('0x65')]({'plain':!![]});interaction_log[_0x3a28('0x28')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x501921[_0x3a28('0x5e')]['id'],_0x501921[_0x3a28('0x5e')][_0x3a28('0x3a')],_0x501921[_0x3a28('0x5e')]['role'],_0x204a2f['interaction']['id'],_0x501921[_0x3a28('0x56')]?JSON[_0x3a28('0x24')](_0x501921[_0x3a28('0x56')]):'null');return respondWithRpcPromise(_0x3a28('0x7b'),'rejectMessage',_0x204a2f);}return null;})['then'](function(_0x3167e9){var _0xf0f2ca=_0x3a28('0x7c')+_0x3167e9[_0x3a28('0x27')][_0x3a28('0x6a')];return db[_0x3a28('0x6b')][_0x3a28('0x41')](_0xf0f2ca,{'type':db[_0x3a28('0x6c')][_0x3a28('0x6d')]['SELECT'],'raw':!![]})[_0x3a28('0x1f')](function(_0x35cf3b){return _0x35cf3b;});})[_0x3a28('0x1f')](function(_0x20d1c0){if(_0x20d1c0){_0x204a2f[_0x3a28('0x27')][_0x3a28('0x6e')]=_0x20d1c0[0x0];if(!_0x501921[_0x3a28('0x56')][_0x3a28('0x5d')])return;return db[_0x3a28('0x6f')][_0x3a28('0x54')]({'where':{'id':_0x501921[_0x3a28('0x56')][_0x3a28('0x5d')],'role':_0x3a28('0x5f')},'attributes':['id','name',_0x3a28('0x70'),_0x3a28('0x71'),'internal'],'raw':!![]});}return null;})[_0x3a28('0x1f')](function(_0x5b5862){if(!_0x5b5862)return null;_0x204a2f[_0x3a28('0x27')][_0x3a28('0x5f')]=_0x5b5862;return _0x204a2f;})[_0x3a28('0x1f')](function(_0x2e8d2c){if(_0x2e8d2c){_0x2e8d2c[_0x3a28('0x27')]['interface']=util[_0x3a28('0x5b')](_0x3a28('0x7d'),_0x501921[_0x3a28('0x5e')][_0x3a28('0x3a')]);_0x2e8d2c[_0x3a28('0x27')][_0x3a28('0x74')]=_0x204a2f[_0x3a28('0x74')];_0x2e8d2c[_0x3a28('0x27')][_0x3a28('0x7e')]=_0x204a2f['channel'];_0x2e8d2c['message'][_0x3a28('0x75')]=_0x3a28('0x36');respondWithRpcPromise(_0x3a28('0x77'),'EventManager',{'event':_0x3a28('0x7f'),'message':_[_0x3a28('0x4d')](_0x204a2f[_0x3a28('0x27')],JSON['parse'](_0x204a2f[_0x3a28('0x64')]['formData']))},client9002);return _0x204a2f;}return null;})[_0x3a28('0x1f')](respondWithResult(_0x12fa24,null))[_0x3a28('0x2a')](handleError(_0x12fa24,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 3d271fb..c6a8649 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 _0xdfaa=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x42d525,_0x1247cb){var _0x7f0c3c=function(_0x5016f1){while(--_0x5016f1){_0x42d525['push'](_0x42d525['shift']());}};_0x7f0c3c(++_0x1247cb);}(_0xdfaa,0x1ad));var _0xadfa=function(_0x418bda,_0x1da79c){_0x418bda=_0x418bda-0x0;var _0x14ee24=_0xdfaa[_0x418bda];return _0x14ee24;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xadfa('0x0'))['db'][_0xadfa('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xadfa('0x2')](0x0);var events={'afterCreate':_0xadfa('0x3'),'afterUpdate':_0xadfa('0x4'),'afterDestroy':_0xadfa('0x5')};function emitEvent(_0x480e64){return function(_0xc6f73e,_0x2abff7,_0x2f3933){ChatMessageEvents['emit'](_0x480e64+':'+_0xc6f73e['id'],_0xc6f73e);ChatMessageEvents[_0xadfa('0x6')](_0x480e64,_0xc6f73e);_0x2f3933(null);};}for(var e in events){if(events[_0xadfa('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xadfa('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xf553=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','ChatMessage'];(function(_0x76a7ae,_0x490d47){var _0x12eeb4=function(_0x237f15){while(--_0x237f15){_0x76a7ae['push'](_0x76a7ae['shift']());}};_0x12eeb4(++_0x490d47);}(_0xf553,0x116));var _0x3f55=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0xf553[_0x420513];return _0x1b44ec;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x3f55('0x0'))['db'][_0x3f55('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3f55('0x2')](0x0);var events={'afterCreate':_0x3f55('0x3'),'afterUpdate':_0x3f55('0x4'),'afterDestroy':_0x3f55('0x5')};function emitEvent(_0x37a368){return function(_0xc68ae7,_0x5919cb,_0x5678ce){ChatMessageEvents[_0x3f55('0x6')](_0x37a368+':'+_0xc68ae7['id'],_0xc68ae7);ChatMessageEvents['emit'](_0x37a368,_0xc68ae7);_0x5678ce(null);};}for(var e in events){if(events[_0x3f55('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index e0117e9..ed6338b 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 _0x6a9d=['toLowerCase','out','isNil','UserId','ChatInteraction','ChatInteractionId','createdAt','catch','utf8mb4','api','moment','bluebird','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction'];(function(_0x4ca0de,_0x77e8e3){var _0x149378=function(_0x137f90){while(--_0x137f90){_0x4ca0de['push'](_0x4ca0de['shift']());}};_0x149378(++_0x77e8e3);}(_0x6a9d,0x111));var _0xd6a9=function(_0x5b85d7,_0x57260a){_0x5b85d7=_0x5b85d7-0x0;var _0x1dd5d5=_0x6a9d[_0x5b85d7];return _0x1dd5d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd6a9('0x0'));var moment=require(_0xd6a9('0x1'));var BPromise=require(_0xd6a9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd6a9('0x3'));var rimraf=require(_0xd6a9('0x4'));var config=require(_0xd6a9('0x5'));var attributes=require(_0xd6a9('0x6'));module['exports']=function(_0x21228e,_0x2462cb){return _0x21228e[_0xd6a9('0x7')](_0xd6a9('0x8'),attributes,{'tableName':_0xd6a9('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xd6a9('0xa')],'type':_0xd6a9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36bdda,_0x204ada,_0x28a869){var _0x1c6cb2=_0x21228e[_0xd6a9('0xc')];var _0x1d8048=_0x36bdda[_0xd6a9('0xd')]({'plain':!![]});if(_0x1d8048[_0xd6a9('0xe')][_0xd6a9('0xf')]()==='in'||_0x1d8048[_0xd6a9('0xe')]['toLowerCase']()===_0xd6a9('0x10')&&!_0x1d8048['secret']&&!_[_0xd6a9('0x11')](_0x1d8048[_0xd6a9('0x12')])){_0x1c6cb2[_0xd6a9('0x13')]['findOne']({'where':{'id':_0x1d8048[_0xd6a9('0x14')]}})['then'](function(_0x2e70ff){if(_0x2e70ff){_0x2e70ff['update']({'lastMsgAt':_0x1d8048[_0xd6a9('0x15')],'lastMsgDirection':_0x1d8048[_0xd6a9('0xe')][_0xd6a9('0xf')]()});}})[_0xd6a9('0x16')](function(_0x4c383b){console['error'](_0x4c383b);});}_0x28a869();}},'charset':_0xd6a9('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3da6=['createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','exports','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3da6,0x17a));var _0x63da=function(_0x4390b5,_0x3d5732){_0x4390b5=_0x4390b5-0x0;var _0x40466f=_0x3da6[_0x4390b5];return _0x40466f;};'use strict';var _=require(_0x63da('0x0'));var util=require('util');var logger=require(_0x63da('0x1'))(_0x63da('0x2'));var moment=require('moment');var BPromise=require(_0x63da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63da('0x4'));var rimraf=require(_0x63da('0x5'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0x63da('0x6')]=function(_0x390e89,_0xfe4d0){return _0x390e89['define'](_0x63da('0x7'),attributes,{'tableName':_0x63da('0x8'),'paranoid':![],'indexes':[{'name':_0x63da('0x9'),'fields':['body'],'type':_0x63da('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bdce1,_0x3104a9,_0xbdb04d){var _0x4c917f=_0x390e89[_0x63da('0xb')];var _0x33ed06=_0x1bdce1[_0x63da('0xc')]({'plain':!![]});if(_0x33ed06[_0x63da('0xd')][_0x63da('0xe')]()==='in'||_0x33ed06[_0x63da('0xd')][_0x63da('0xe')]()===_0x63da('0xf')&&!_0x33ed06[_0x63da('0x10')]&&!_[_0x63da('0x11')](_0x33ed06[_0x63da('0x12')])){_0x4c917f['ChatInteraction'][_0x63da('0x13')]({'where':{'id':_0x33ed06['ChatInteractionId']}})[_0x63da('0x14')](function(_0x12804c){if(_0x12804c){_0x12804c[_0x63da('0x15')]({'lastMsgAt':_0x33ed06[_0x63da('0x16')],'lastMsgDirection':_0x33ed06[_0x63da('0xd')]['toLowerCase']()});}})['catch'](function(_0xc1e02f){console['error'](_0xc1e02f);});}_0xbdb04d();}},'charset':_0x63da('0x17'),'collate':_0x63da('0x18')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index c612cc6..11e0942 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 _0x3f46=['ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CreateChatMessage','ChatMessage','body','options','raw','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug'];(function(_0x36aaba,_0x403929){var _0x52e01a=function(_0x31fcd5){while(--_0x31fcd5){_0x36aaba['push'](_0x36aaba['shift']());}};_0x52e01a(++_0x403929);}(_0x3f46,0xac));var _0x63f4=function(_0xb50c0a,_0x583cf3){_0xb50c0a=_0xb50c0a-0x0;var _0x168fb8=_0x3f46[_0xb50c0a];return _0x168fb8;};'use strict';var _=require('lodash');var util=require(_0x63f4('0x0'));var moment=require(_0x63f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x63f4('0x2'));var fs=require('fs');var Redis=require(_0x63f4('0x3'));var db=require(_0x63f4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x63f4('0x5'))(_0x63f4('0x6'));var config=require('../../config/environment');var jayson=require(_0x63f4('0x7'));var client=jayson[_0x63f4('0x8')][_0x63f4('0x9')]({'port':0x232a});config[_0x63f4('0xa')]=_['defaults'](config['redis'],{'host':_0x63f4('0xb'),'port':0x18eb});var socket=require(_0x63f4('0xc'))(new Redis(config[_0x63f4('0xa')]));require(_0x63f4('0xd'))[_0x63f4('0xe')](socket);function respondWithRpcPromise(_0x263929,_0xfba268,_0x544d12){return new BPromise(function(_0x467487,_0x170789){return client[_0x63f4('0xf')](_0x263929,_0x544d12)[_0x63f4('0x10')](function(_0x3b8dbd){logger[_0x63f4('0x11')](_0x63f4('0x12'),_0xfba268,'request\x20sent');logger[_0x63f4('0x13')](_0x63f4('0x14'),_0xfba268,_0x63f4('0x15'),JSON[_0x63f4('0x16')](_0x3b8dbd));if(_0x3b8dbd[_0x63f4('0x17')]){if(_0x3b8dbd[_0x63f4('0x17')][_0x63f4('0x18')]===0x1f4){logger[_0x63f4('0x17')](_0x63f4('0x12'),_0xfba268,_0x3b8dbd[_0x63f4('0x17')][_0x63f4('0x19')]);return _0x170789(_0x3b8dbd[_0x63f4('0x17')][_0x63f4('0x19')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0xfba268,_0x3b8dbd[_0x63f4('0x17')]['message']);return _0x467487(_0x3b8dbd[_0x63f4('0x17')]['message']);}else{logger['info'](_0x63f4('0x12'),_0xfba268,_0x63f4('0x15'));_0x467487(_0x3b8dbd['result']['message']);}})['catch'](function(_0xa234b5){logger[_0x63f4('0x17')](_0x63f4('0x12'),_0xfba268,_0xa234b5);_0x170789(_0xa234b5);});});}exports[_0x63f4('0x1a')]=function(_0x264d6){var _0x7135ec=this;return new Promise(function(_0x1fa4ba,_0x2b2f36){return db[_0x63f4('0x1b')]['create'](_0x264d6[_0x63f4('0x1c')],{'raw':_0x264d6['options']?_0x264d6[_0x63f4('0x1d')][_0x63f4('0x1e')]===undefined?!![]:![]:!![]})[_0x63f4('0x10')](function(_0x25a831){logger[_0x63f4('0x11')](_0x63f4('0x1a'),_0x264d6);logger[_0x63f4('0x13')](_0x63f4('0x1a'),_0x264d6,JSON['stringify'](_0x25a831));_0x1fa4ba(_0x25a831);})[_0x63f4('0x1f')](function(_0x5cb31f){logger[_0x63f4('0x17')](_0x63f4('0x1a'),_0x5cb31f['message'],_0x264d6);_0x2b2f36(_0x7135ec[_0x63f4('0x17')](0x1f4,_0x5cb31f[_0x63f4('0x19')]));});});}; \ No newline at end of file +var _0xdeac=['CreateChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xdeac,0xfa));var _0xcdea=function(_0x3d2d4a,_0xc15155){_0x3d2d4a=_0x3d2d4a-0x0;var _0x3c31b9=_0xdeac[_0x3d2d4a];return _0x3c31b9;};'use strict';var _=require(_0xcdea('0x0'));var util=require(_0xcdea('0x1'));var moment=require(_0xcdea('0x2'));var BPromise=require(_0xcdea('0x3'));var rs=require(_0xcdea('0x4'));var fs=require('fs');var Redis=require(_0xcdea('0x5'));var db=require(_0xcdea('0x6'))['db'];var utils=require(_0xcdea('0x7'));var logger=require(_0xcdea('0x8'))(_0xcdea('0x9'));var config=require('../../config/environment');var jayson=require(_0xcdea('0xa'));var client=jayson[_0xcdea('0xb')][_0xcdea('0xc')]({'port':0x232a});config['redis']=_[_0xcdea('0xd')](config['redis'],{'host':_0xcdea('0xe'),'port':0x18eb});var socket=require(_0xcdea('0xf'))(new Redis(config['redis']));require(_0xcdea('0x10'))[_0xcdea('0x11')](socket);function respondWithRpcPromise(_0x264530,_0x8bcdf,_0x54da96){return new BPromise(function(_0x3c7f13,_0x422195){return client['request'](_0x264530,_0x54da96)[_0xcdea('0x12')](function(_0x5c8c21){logger[_0xcdea('0x13')](_0xcdea('0x14'),_0x8bcdf,_0xcdea('0x15'));logger[_0xcdea('0x16')](_0xcdea('0x17'),_0x8bcdf,'request\x20sent',JSON[_0xcdea('0x18')](_0x5c8c21));if(_0x5c8c21[_0xcdea('0x19')]){if(_0x5c8c21[_0xcdea('0x19')][_0xcdea('0x1a')]===0x1f4){logger[_0xcdea('0x19')](_0xcdea('0x14'),_0x8bcdf,_0x5c8c21[_0xcdea('0x19')][_0xcdea('0x1b')]);return _0x422195(_0x5c8c21['error'][_0xcdea('0x1b')]);}logger[_0xcdea('0x19')]('ChatMessage,\x20%s,\x20%s',_0x8bcdf,_0x5c8c21['error'][_0xcdea('0x1b')]);return _0x3c7f13(_0x5c8c21['error'][_0xcdea('0x1b')]);}else{logger[_0xcdea('0x13')](_0xcdea('0x14'),_0x8bcdf,'request\x20sent');_0x3c7f13(_0x5c8c21[_0xcdea('0x1c')]['message']);}})[_0xcdea('0x1d')](function(_0x419e25){logger[_0xcdea('0x19')](_0xcdea('0x14'),_0x8bcdf,_0x419e25);_0x422195(_0x419e25);});});}exports[_0xcdea('0x1e')]=function(_0x1b3d09){var _0x29ddea=this;return new Promise(function(_0x2b7ad8,_0x4ab343){return db['ChatMessage'][_0xcdea('0x1f')](_0x1b3d09[_0xcdea('0x20')],{'raw':_0x1b3d09[_0xcdea('0x21')]?_0x1b3d09[_0xcdea('0x21')][_0xcdea('0x22')]===undefined?!![]:![]:!![]})[_0xcdea('0x12')](function(_0x4dae4a){logger[_0xcdea('0x13')]('CreateChatMessage',_0x1b3d09);logger['debug'](_0xcdea('0x1e'),_0x1b3d09,JSON[_0xcdea('0x18')](_0x4dae4a));_0x2b7ad8(_0x4dae4a);})[_0xcdea('0x1d')](function(_0x5b5b13){logger['error']('CreateChatMessage',_0x5b5b13[_0xcdea('0x1b')],_0x1b3d09);_0x4ab343(_0x29ddea[_0xcdea('0x19')](0x1f4,_0x5b5b13['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index c5a989d..7befa9c 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 _0xab86=['remove','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0x1f3cf1,_0x528a06){var _0x3820da=function(_0x55a04d){while(--_0x55a04d){_0x1f3cf1['push'](_0x1f3cf1['shift']());}};_0x3820da(++_0x528a06);}(_0xab86,0x13e));var _0x6ab8=function(_0x1fb08e,_0x21b8eb){_0x1fb08e=_0x1fb08e-0x0;var _0x570d0c=_0xab86[_0x1fb08e];return _0x570d0c;};'use strict';var ChatMessageEvents=require(_0x6ab8('0x0'));var events=[_0x6ab8('0x1'),_0x6ab8('0x2'),'update'];function createListener(_0x548007,_0xfa522f){return function(_0x4bcc45){_0xfa522f[_0x6ab8('0x3')](_0x548007,_0x4bcc45);};}function removeListener(_0x48cb6a,_0xf27ba7){return function(){ChatMessageEvents[_0x6ab8('0x4')](_0x48cb6a,_0xf27ba7);};}exports[_0x6ab8('0x5')]=function(_0x154d17){for(var _0x6f41f=0x0,_0x265771=events[_0x6ab8('0x6')];_0x6f41f<_0x265771;_0x6f41f++){var _0x2a452=events[_0x6f41f];var _0x363c5e=createListener(_0x6ab8('0x7')+_0x2a452,_0x154d17);ChatMessageEvents['on'](_0x2a452,_0x363c5e);}}; \ No newline at end of file +var _0xbcba=['length','./chatMessage.events','save','update','emit','register'];(function(_0xb81e1d,_0x2cb83c){var _0x5944e9=function(_0x1d70b0){while(--_0x1d70b0){_0xb81e1d['push'](_0xb81e1d['shift']());}};_0x5944e9(++_0x2cb83c);}(_0xbcba,0x6d));var _0xabcb=function(_0x99717,_0x52c0bc){_0x99717=_0x99717-0x0;var _0x11ff12=_0xbcba[_0x99717];return _0x11ff12;};'use strict';var ChatMessageEvents=require(_0xabcb('0x0'));var events=[_0xabcb('0x1'),'remove',_0xabcb('0x2')];function createListener(_0x2c9ee7,_0x2034d2){return function(_0xcbe337){_0x2034d2[_0xabcb('0x3')](_0x2c9ee7,_0xcbe337);};}function removeListener(_0x3e3b9b,_0x5e10df){return function(){ChatMessageEvents['removeListener'](_0x3e3b9b,_0x5e10df);};}exports[_0xabcb('0x4')]=function(_0x1290b2){for(var _0x5c706e=0x0,_0x5322e7=events[_0xabcb('0x5')];_0x5c706e<_0x5322e7;_0x5c706e++){var _0x192b36=events[_0x5c706e];var _0x5e693d=createListener('chatMessage:'+_0x192b36,_0x1290b2);ChatMessageEvents['on'](_0x192b36,_0x5e693d);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 301476b..7319a02 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 _0x2c9e=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe','get','/:id','show','post','tracked','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x5037fc,_0x2361f9){var _0x7e718b=function(_0x37bcbc){while(--_0x37bcbc){_0x5037fc['push'](_0x5037fc['shift']());}};_0x7e718b(++_0x2361f9);}(_0x2c9e,0x17a));var _0xe2c9=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2c9e[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0xe2c9('0x0'));var path=require(_0xe2c9('0x1'));var timeout=require(_0xe2c9('0x2'));var express=require(_0xe2c9('0x3'));var router=express['Router']();var fs_extra=require(_0xe2c9('0x4'));var auth=require(_0xe2c9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe2c9('0x6'));var controller=require(_0xe2c9('0x7'));router['get']('/',auth[_0xe2c9('0x8')](),controller[_0xe2c9('0x9')]);router['get'](_0xe2c9('0xa'),auth[_0xe2c9('0x8')](),controller['describe']);router[_0xe2c9('0xb')](_0xe2c9('0xc'),auth[_0xe2c9('0x8')](),controller[_0xe2c9('0xd')]);router[_0xe2c9('0xe')]('/',auth[_0xe2c9('0x8')](),interaction[_0xe2c9('0xf')](_0xe2c9('0x10'),_0xe2c9('0x11')),controller['create']);router[_0xe2c9('0x12')](_0xe2c9('0xc'),controller[_0xe2c9('0x13')]);router[_0xe2c9('0x12')](_0xe2c9('0x14'),auth[_0xe2c9('0x8')](),controller[_0xe2c9('0x15')]);router[_0xe2c9('0x12')](_0xe2c9('0x16'),auth[_0xe2c9('0x8')](),controller[_0xe2c9('0x17')]);router[_0xe2c9('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xe2c9('0x19')]);module[_0xe2c9('0x1a')]=router; \ No newline at end of file +var _0x7fdd=['/describe','describe','show','post','tracked','chat','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatMessage.controller','isAuthenticated','index','get'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x7fdd,0x1c0));var _0xd7fd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7fdd[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xd7fd('0x0'));var util=require('util');var path=require(_0xd7fd('0x1'));var timeout=require(_0xd7fd('0x2'));var express=require(_0xd7fd('0x3'));var router=express[_0xd7fd('0x4')]();var fs_extra=require(_0xd7fd('0x5'));var auth=require(_0xd7fd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd7fd('0x7'));router['get']('/',auth[_0xd7fd('0x8')](),controller[_0xd7fd('0x9')]);router[_0xd7fd('0xa')](_0xd7fd('0xb'),auth['isAuthenticated'](),controller[_0xd7fd('0xc')]);router[_0xd7fd('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd7fd('0xd')]);router[_0xd7fd('0xe')]('/',auth[_0xd7fd('0x8')](),interaction[_0xd7fd('0xf')](_0xd7fd('0x10'),'chatmessage:create'),controller[_0xd7fd('0x11')]);router[_0xd7fd('0x12')]('/:id',controller[_0xd7fd('0x13')]);router[_0xd7fd('0x12')](_0xd7fd('0x14'),auth[_0xd7fd('0x8')](),controller[_0xd7fd('0x15')]);router[_0xd7fd('0x12')](_0xd7fd('0x16'),auth['isAuthenticated'](),controller[_0xd7fd('0x17')]);router[_0xd7fd('0x18')]('/:id',auth[_0xd7fd('0x8')](),controller[_0xd7fd('0x19')]);module[_0xd7fd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 8327ae0..b7c44c9 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 _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x17ad16,_0x5dd802){var _0x24a8b5=function(_0x1ecc4a){while(--_0x1ecc4a){_0x17ad16['push'](_0x17ad16['shift']());}};_0x24a8b5(++_0x5dd802);}(_0x5f2f,0x73));var _0xf5f2=function(_0x548cd9,_0x39a9d4){_0x548cd9=_0x548cd9-0x0;var _0x228451=_0x5f2f[_0x548cd9];return _0x228451;};'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 +var _0xadb5=['medium','TEXT','exports'];(function(_0x8e4585,_0x474a7f){var _0x4ab2b6=function(_0x5bc739){while(--_0x5bc739){_0x8e4585['push'](_0x8e4585['shift']());}};_0x4ab2b6(++_0x474a7f);}(_0xadb5,0xad));var _0x5adb=function(_0x2a435d,_0x59462a){_0x2a435d=_0x2a435d-0x0;var _0x59735e=_0xadb5[_0x2a435d];return _0x59735e;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 7b0a5c0..cbecf17 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x7a54,0x106));var _0x47a5=function(_0x5b2516,_0x10579a){_0x5b2516=_0x5b2516-0x0;var _0x78a6f3=_0x7a54[_0x5b2516];return _0x78a6f3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xda56fc,_0x3693bd){var _0x2f8f3f=function(_0x7d4817){while(--_0x7d4817){_0xda56fc['push'](_0xda56fc['shift']());}};_0x2f8f3f(++_0x3693bd);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 42126b6..0748cac 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 _0x4569=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x2f408b,_0xbfdb00){var _0x38d16f=function(_0x5a45cc){while(--_0x5a45cc){_0x2f408b['push'](_0x2f408b['shift']());}};_0x38d16f(++_0xbfdb00);}(_0x4569,0xed));var _0x9456=function(_0x56f052,_0x3256b4){_0x56f052=_0x56f052-0x0;var _0x28d3d1=_0x4569[_0x56f052];return _0x28d3d1;};'use strict';var EventEmitter=require(_0x9456('0x0'));var ChatOfflineMessage=require(_0x9456('0x1'))['db'][_0x9456('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9456('0x3')](0x0);var events={'afterCreate':_0x9456('0x4'),'afterUpdate':_0x9456('0x5'),'afterDestroy':_0x9456('0x6')};function emitEvent(_0x2dd08c){return function(_0x5f084d,_0x3a0796,_0x289107){ChatOfflineMessageEvents[_0x9456('0x7')](_0x2dd08c+':'+_0x5f084d['id'],_0x5f084d);ChatOfflineMessageEvents['emit'](_0x2dd08c,_0x5f084d);_0x289107(null);};}for(var e in events){if(events[_0x9456('0x8')](e)){var event=events[e];ChatOfflineMessage[_0x9456('0x9')](e,emitEvent(event));}}module[_0x9456('0xa')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x54f3=['remove','emit','hook','exports','events','../../mysqldb','ChatOfflineMessage','save'];(function(_0x4413d0,_0x17891e){var _0x448742=function(_0x4e310d){while(--_0x4e310d){_0x4413d0['push'](_0x4413d0['shift']());}};_0x448742(++_0x17891e);}(_0x54f3,0xec));var _0x354f=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x54f3[_0x5d6456];return _0x4d66c1;};'use strict';var EventEmitter=require(_0x354f('0x0'));var ChatOfflineMessage=require(_0x354f('0x1'))['db'][_0x354f('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x354f('0x3'),'afterUpdate':'update','afterDestroy':_0x354f('0x4')};function emitEvent(_0xa2db9f){return function(_0x48f384,_0x7fd3ef,_0x556bfa){ChatOfflineMessageEvents[_0x354f('0x5')](_0xa2db9f+':'+_0x48f384['id'],_0x48f384);ChatOfflineMessageEvents[_0x354f('0x5')](_0xa2db9f,_0x48f384);_0x556bfa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x354f('0x6')](e,emitEvent(event));}}module[_0x354f('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 81ab42e..405336c 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 _0x374d=['define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports'];(function(_0xa4f636,_0xaca1b6){var _0x37e02a=function(_0x49bd47){while(--_0x49bd47){_0xa4f636['push'](_0xa4f636['shift']());}};_0x37e02a(++_0xaca1b6);}(_0x374d,0xd7));var _0xd374=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x374d[_0xa1e3e3];return _0xc980e9;};'use strict';var attributes=require(_0xd374('0x0'));module[_0xd374('0x1')]=function(_0x1ff0dc){return _0x1ff0dc[_0xd374('0x2')](_0xd374('0x3'),attributes,{'tableName':_0xd374('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd374('0x5'),'collate':_0xd374('0x6')});}; \ No newline at end of file +var _0x7f16=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0x5c737c,_0x57be0c){var _0x1b197b=function(_0x2d2a01){while(--_0x2d2a01){_0x5c737c['push'](_0x5c737c['shift']());}};_0x1b197b(++_0x57be0c);}(_0x7f16,0x129));var _0x67f1=function(_0x380c7f,_0x234003){_0x380c7f=_0x380c7f-0x0;var _0x57f3c2=_0x7f16[_0x380c7f];return _0x57f3c2;};'use strict';var attributes=require(_0x67f1('0x0'));module[_0x67f1('0x1')]=function(_0x349e08){return _0x349e08[_0x67f1('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0x67f1('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x67f1('0x4'),'collate':_0x67f1('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 1b456a1..e684a9a 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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x7b8f0e,_0x43c018){var _0x539030=function(_0x65161c){while(--_0x65161c){_0x7b8f0e['push'](_0x7b8f0e['shift']());}};_0x539030(++_0x43c018);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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']('ChatOfflineMessage,\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 _0xcd2a=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x51cf0e,_0x2267b0){var _0x351a93=function(_0x262532){while(--_0x262532){_0x51cf0e['push'](_0x51cf0e['shift']());}};_0x351a93(++_0x2267b0);}(_0xcd2a,0x1d7));var _0xacd2=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0xcd2a[_0x405385];return _0x43837b;};'use strict';var _=require(_0xacd2('0x0'));var util=require('util');var moment=require(_0xacd2('0x1'));var BPromise=require('bluebird');var rs=require(_0xacd2('0x2'));var fs=require('fs');var Redis=require(_0xacd2('0x3'));var db=require(_0xacd2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xacd2('0x5'))(_0xacd2('0x6'));var config=require(_0xacd2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xacd2('0x8')][_0xacd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4294f7,_0x5cfa9b,_0x5ce9e2){return new BPromise(function(_0x35755d,_0x1b96db){return client['request'](_0x4294f7,_0x5ce9e2)[_0xacd2('0xa')](function(_0x1aad1a){logger['info'](_0xacd2('0xb'),_0x5cfa9b,_0xacd2('0xc'));logger[_0xacd2('0xd')](_0xacd2('0xe'),_0x5cfa9b,_0xacd2('0xc'),JSON[_0xacd2('0xf')](_0x1aad1a));if(_0x1aad1a['error']){if(_0x1aad1a[_0xacd2('0x10')][_0xacd2('0x11')]===0x1f4){logger[_0xacd2('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5cfa9b,_0x1aad1a[_0xacd2('0x10')][_0xacd2('0x12')]);return _0x1b96db(_0x1aad1a[_0xacd2('0x10')][_0xacd2('0x12')]);}logger[_0xacd2('0x10')](_0xacd2('0xb'),_0x5cfa9b,_0x1aad1a['error'][_0xacd2('0x12')]);return _0x35755d(_0x1aad1a['error'][_0xacd2('0x12')]);}else{logger[_0xacd2('0x13')](_0xacd2('0xb'),_0x5cfa9b,_0xacd2('0xc'));_0x35755d(_0x1aad1a[_0xacd2('0x14')][_0xacd2('0x12')]);}})['catch'](function(_0x5e0206){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x5cfa9b,_0x5e0206);_0x1b96db(_0x5e0206);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 24f8124..24e274c 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 _0xa9e3=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy'];(function(_0x307a0c,_0x548aa1){var _0x41269c=function(_0x54134a){while(--_0x54134a){_0x307a0c['push'](_0x307a0c['shift']());}};_0x41269c(++_0x548aa1);}(_0xa9e3,0xf1));var _0x3a9e=function(_0x18553d,_0x2133ab){_0x18553d=_0x18553d-0x0;var _0x2e0f22=_0xa9e3[_0x18553d];return _0x2e0f22;};'use strict';var multer=require(_0x3a9e('0x0'));var util=require(_0x3a9e('0x1'));var path=require(_0x3a9e('0x2'));var timeout=require(_0x3a9e('0x3'));var express=require('express');var router=express[_0x3a9e('0x4')]();var fs_extra=require(_0x3a9e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3a9e('0x6'));var config=require('../../config/environment');var controller=require(_0x3a9e('0x7'));router[_0x3a9e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3a9e('0x8')](_0x3a9e('0x9'),auth[_0x3a9e('0xa')](),controller[_0x3a9e('0xb')]);router[_0x3a9e('0x8')](_0x3a9e('0xc'),auth['isAuthenticated'](),controller[_0x3a9e('0xd')]);router[_0x3a9e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3a9e('0xf')](_0x3a9e('0xc'),auth[_0x3a9e('0xa')](),controller[_0x3a9e('0x10')]);router[_0x3a9e('0x11')](_0x3a9e('0xc'),auth[_0x3a9e('0xa')](),controller[_0x3a9e('0x12')]);module[_0x3a9e('0x13')]=router; \ No newline at end of file +var _0x1971=['/describe','describe','/:id','show','post','create','put','update','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x55e73b,_0x2d1040){var _0x10c6bc=function(_0x1bceee){while(--_0x1bceee){_0x55e73b['push'](_0x55e73b['shift']());}};_0x10c6bc(++_0x2d1040);}(_0x1971,0x198));var _0x1197=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x1971[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x1197('0x0'));var util=require('util');var path=require(_0x1197('0x1'));var timeout=require(_0x1197('0x2'));var express=require(_0x1197('0x3'));var router=express['Router']();var fs_extra=require(_0x1197('0x4'));var auth=require(_0x1197('0x5'));var interaction=require(_0x1197('0x6'));var config=require(_0x1197('0x7'));var controller=require(_0x1197('0x8'));router[_0x1197('0x9')]('/',auth[_0x1197('0xa')](),controller[_0x1197('0xb')]);router['get'](_0x1197('0xc'),auth[_0x1197('0xa')](),controller[_0x1197('0xd')]);router[_0x1197('0x9')](_0x1197('0xe'),auth[_0x1197('0xa')](),controller[_0x1197('0xf')]);router[_0x1197('0x10')]('/',auth[_0x1197('0xa')](),controller[_0x1197('0x11')]);router[_0x1197('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x1197('0x13')]);router['delete'](_0x1197('0xe'),auth[_0x1197('0xa')](),controller['destroy']);module[_0x1197('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 1b3ef2d..546f6a1 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 _0x68cc=['sequelize','exports','STRING','ENUM','timeout','mouseOver','INTEGER'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x68cc,0xe7));var _0xc68c=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x68cc[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0xc68c('0x0'));module[_0xc68c('0x1')]={'name':{'type':Sequelize[_0xc68c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc68c('0x3')]('mouseOver',_0xc68c('0x4')),'defaultValue':_0xc68c('0x5')},'selector':{'type':Sequelize[_0xc68c('0x2')]},'timeout':{'type':Sequelize[_0xc68c('0x6')]}}; \ No newline at end of file +var _0x9986=['mouseOver','sequelize','exports','STRING','ENUM','timeout'];(function(_0xdcfd9c,_0x4588e4){var _0x48e652=function(_0x4c3777){while(--_0x4c3777){_0xdcfd9c['push'](_0xdcfd9c['shift']());}};_0x48e652(++_0x4588e4);}(_0x9986,0x115));var _0x6998=function(_0x394550,_0x2bb482){_0x394550=_0x394550-0x0;var _0x3aabd8=_0x9986[_0x394550];return _0x3aabd8;};'use strict';var Sequelize=require(_0x6998('0x0'));module[_0x6998('0x1')]={'name':{'type':Sequelize[_0x6998('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6998('0x3')]('mouseOver',_0x6998('0x4')),'defaultValue':_0x6998('0x5')},'selector':{'type':Sequelize[_0x6998('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index af95edf..ee823c9 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 _0x8917=['../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','sendStatus','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x167dc3,_0xca04f5){var _0x211e11=function(_0x556fcc){while(--_0x556fcc){_0x167dc3['push'](_0x167dc3['shift']());}};_0x211e11(++_0xca04f5);}(_0x8917,0x1d7));var _0x7891=function(_0x4e321d,_0x262567){_0x4e321d=_0x4e321d-0x0;var _0x102521=_0x8917[_0x4e321d];return _0x102521;};'use strict';var emlformat=require(_0x7891('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7891('0x1'));var jsonpatch=require(_0x7891('0x2'));var rp=require(_0x7891('0x3'));var moment=require(_0x7891('0x4'));var BPromise=require(_0x7891('0x5'));var Mustache=require(_0x7891('0x6'));var util=require(_0x7891('0x7'));var path=require(_0x7891('0x8'));var sox=require(_0x7891('0x9'));var csv=require('to-csv');var ejs=require(_0x7891('0xa'));var fs=require('fs');var fs_extra=require(_0x7891('0xb'));var _=require(_0x7891('0xc'));var squel=require(_0x7891('0xd'));var crypto=require(_0x7891('0xe'));var jsforce=require(_0x7891('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7891('0x10'));var querystring=require('querystring');var Papa=require(_0x7891('0x11'));var Redis=require(_0x7891('0x12'));var authService=require(_0x7891('0x13'));var qs=require(_0x7891('0x14'));var as=require(_0x7891('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7891('0x16'))(_0x7891('0x17'));var utils=require(_0x7891('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7891('0x19'));var db=require(_0x7891('0x1a'))['db'];function respondWithStatusCode(_0x1a1dbc,_0x31692f){_0x31692f=_0x31692f||0xcc;return function(_0x1b481e){if(_0x1b481e){return _0x1a1dbc['sendStatus'](_0x31692f);}return _0x1a1dbc[_0x7891('0x1b')](_0x31692f)[_0x7891('0x1c')]();};}function respondWithResult(_0x2517f1,_0xc56bc0){_0xc56bc0=_0xc56bc0||0xc8;return function(_0x71e75c){if(_0x71e75c){return _0x2517f1[_0x7891('0x1b')](_0xc56bc0)['json'](_0x71e75c);}};}function respondWithFilteredResult(_0x1fa45b,_0x21a74f){return function(_0x5bfe12){if(_0x5bfe12){var _0x23286b=typeof _0x21a74f[_0x7891('0x1d')]==='undefined'&&typeof _0x21a74f[_0x7891('0x1e')]===_0x7891('0x1f');var _0x250f65=_0x5bfe12[_0x7891('0x20')];var _0x9ff8c2=_0x23286b?0x0:_0x21a74f[_0x7891('0x1d')];var _0x457f50=_0x23286b?_0x5bfe12[_0x7891('0x20')]:_0x21a74f[_0x7891('0x1d')]+_0x21a74f[_0x7891('0x1e')];var _0x20da1e;if(_0x457f50>=_0x250f65){_0x457f50=_0x250f65;_0x20da1e=0xc8;}else{_0x20da1e=0xce;}_0x1fa45b['status'](_0x20da1e);return _0x1fa45b['set'](_0x7891('0x21'),_0x9ff8c2+'-'+_0x457f50+'/'+_0x250f65)[_0x7891('0x22')](_0x5bfe12);}return null;};}function patchUpdates(_0x30b2ae){return function(_0x4c76fe){try{jsonpatch['apply'](_0x4c76fe,_0x30b2ae,!![]);}catch(_0x19a628){return BPromise[_0x7891('0x23')](_0x19a628);}return _0x4c76fe[_0x7891('0x24')]();};}function saveUpdates(_0x36f66a,_0x155a97){return function(_0xf09f20){if(_0xf09f20){return _0xf09f20[_0x7891('0x25')](_0x36f66a)['then'](function(_0x28a917){return _0x28a917;});}return null;};}function removeEntity(_0xab091c,_0x27f2e0){return function(_0x2de356){if(_0x2de356){return _0x2de356[_0x7891('0x26')]()[_0x7891('0x27')](function(){_0xab091c[_0x7891('0x1b')](0xcc)[_0x7891('0x1c')]();});}};}function handleEntityNotFound(_0x24372f,_0x2acda5){return function(_0x55108b){if(!_0x55108b){_0x24372f[_0x7891('0x28')](0x194);}return _0x55108b;};}function handleError(_0x369740,_0x397d03){_0x397d03=_0x397d03||0x1f4;return function(_0x12ed70){logger['error'](_0x12ed70[_0x7891('0x29')]);if(_0x12ed70['name']){delete _0x12ed70[_0x7891('0x2a')];}_0x369740[_0x7891('0x1b')](_0x397d03)[_0x7891('0x2b')](_0x12ed70);};}exports['show']=function(_0x4009f8,_0x1a6bef){var _0x44442f={'raw':!![],'where':{'id':_0x4009f8[_0x7891('0x2c')]['id']}},_0x263f13={};_0x263f13[_0x7891('0x2d')]=_[_0x7891('0x2e')](db['ChatProactiveAction'][_0x7891('0x2f')]);_0x263f13['query']=_[_0x7891('0x2e')](_0x4009f8[_0x7891('0x30')]);_0x263f13[_0x7891('0x31')]=_[_0x7891('0x32')](_0x263f13[_0x7891('0x2d')],_0x263f13[_0x7891('0x30')]);_0x44442f[_0x7891('0x33')]=_['intersection'](_0x263f13[_0x7891('0x2d')],qs[_0x7891('0x34')](_0x4009f8[_0x7891('0x30')][_0x7891('0x34')]));_0x44442f[_0x7891('0x33')]=_0x44442f[_0x7891('0x33')][_0x7891('0x35')]?_0x44442f['attributes']:_0x263f13['model'];if(_0x4009f8['query']['includeAll']){_0x44442f[_0x7891('0x36')]=[{'all':!![]}];}_0x44442f=_[_0x7891('0x37')]({},_0x44442f,_0x4009f8[_0x7891('0x38')]);return db[_0x7891('0x39')][_0x7891('0x3a')](_0x44442f)[_0x7891('0x27')](handleEntityNotFound(_0x1a6bef,null))['then'](respondWithResult(_0x1a6bef,null))[_0x7891('0x3b')](handleError(_0x1a6bef,null));};exports[_0x7891('0x3c')]=function(_0x19e258,_0x2c1c67){return db[_0x7891('0x39')][_0x7891('0x3c')](_0x19e258[_0x7891('0x3d')],{})['then'](respondWithResult(_0x2c1c67,0xc9))[_0x7891('0x3b')](handleError(_0x2c1c67,null));};exports['update']=function(_0x16ca6d,_0x5ba995){if(_0x16ca6d[_0x7891('0x3d')]['id']){delete _0x16ca6d[_0x7891('0x3d')]['id'];}return db[_0x7891('0x39')][_0x7891('0x3a')]({'where':{'id':_0x16ca6d[_0x7891('0x2c')]['id']}})['then'](handleEntityNotFound(_0x5ba995,null))[_0x7891('0x27')](saveUpdates(_0x16ca6d[_0x7891('0x3d')],null))[_0x7891('0x27')](respondWithResult(_0x5ba995,null))[_0x7891('0x3b')](handleError(_0x5ba995,null));};exports[_0x7891('0x26')]=function(_0x516d5c,_0x4e63ee){return db['ChatProactiveAction'][_0x7891('0x3a')]({'where':{'id':_0x516d5c[_0x7891('0x2c')]['id']}})[_0x7891('0x27')](handleEntityNotFound(_0x4e63ee,null))[_0x7891('0x27')](removeEntity(_0x4e63ee,null))[_0x7891('0x3b')](handleError(_0x4e63ee,null));}; \ No newline at end of file +var _0xbfe8=['attributes','fields','length','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','params','destroy','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','reject','update','then','sendStatus','error','stack','name','send','show','model','keys','rawAttributes','query','filters','intersection'];(function(_0x35387d,_0x1ba72f){var _0x3aba56=function(_0x42cd08){while(--_0x42cd08){_0x35387d['push'](_0x35387d['shift']());}};_0x3aba56(++_0x1ba72f);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x5e5957,_0xbfaefc){_0x5e5957=_0x5e5957-0x0;var _0x15b47e=_0xbfe8[_0x5e5957];return _0x15b47e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8bfe('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8bfe('0x1'));var rp=require(_0x8bfe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8bfe('0x3'));var util=require(_0x8bfe('0x4'));var path=require('path');var sox=require(_0x8bfe('0x5'));var csv=require(_0x8bfe('0x6'));var ejs=require(_0x8bfe('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8bfe('0x8'));var squel=require(_0x8bfe('0x9'));var crypto=require(_0x8bfe('0xa'));var jsforce=require(_0x8bfe('0xb'));var deskjs=require(_0x8bfe('0xc'));var toCsv=require(_0x8bfe('0x6'));var querystring=require(_0x8bfe('0xd'));var Papa=require(_0x8bfe('0xe'));var Redis=require(_0x8bfe('0xf'));var authService=require(_0x8bfe('0x10'));var qs=require(_0x8bfe('0x11'));var as=require(_0x8bfe('0x12'));var hardwareService=require(_0x8bfe('0x13'));var logger=require(_0x8bfe('0x14'))(_0x8bfe('0x15'));var utils=require('../../config/utils');var config=require(_0x8bfe('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bfe('0x17'))['db'];function respondWithStatusCode(_0x2f479d,_0x22a131){_0x22a131=_0x22a131||0xcc;return function(_0x5ba48c){if(_0x5ba48c){return _0x2f479d['sendStatus'](_0x22a131);}return _0x2f479d[_0x8bfe('0x18')](_0x22a131)[_0x8bfe('0x19')]();};}function respondWithResult(_0x22737f,_0x36fd25){_0x36fd25=_0x36fd25||0xc8;return function(_0x46c8e3){if(_0x46c8e3){return _0x22737f['status'](_0x36fd25)[_0x8bfe('0x1a')](_0x46c8e3);}};}function respondWithFilteredResult(_0x5520d7,_0x55914b){return function(_0x778f01){if(_0x778f01){var _0xe57cb1=typeof _0x55914b[_0x8bfe('0x1b')]==='undefined'&&typeof _0x55914b['limit']===_0x8bfe('0x1c');var _0x5019ba=_0x778f01['count'];var _0x2e7c29=_0xe57cb1?0x0:_0x55914b[_0x8bfe('0x1b')];var _0x5d8bf1=_0xe57cb1?_0x778f01[_0x8bfe('0x1d')]:_0x55914b[_0x8bfe('0x1b')]+_0x55914b[_0x8bfe('0x1e')];var _0x3b0837;if(_0x5d8bf1>=_0x5019ba){_0x5d8bf1=_0x5019ba;_0x3b0837=0xc8;}else{_0x3b0837=0xce;}_0x5520d7['status'](_0x3b0837);return _0x5520d7[_0x8bfe('0x1f')]('Content-Range',_0x2e7c29+'-'+_0x5d8bf1+'/'+_0x5019ba)[_0x8bfe('0x1a')](_0x778f01);}return null;};}function patchUpdates(_0x3f8050){return function(_0x3c6e7b){try{jsonpatch['apply'](_0x3c6e7b,_0x3f8050,!![]);}catch(_0x55af8c){return BPromise[_0x8bfe('0x20')](_0x55af8c);}return _0x3c6e7b['save']();};}function saveUpdates(_0x55f5bc,_0xef5e81){return function(_0x5397fb){if(_0x5397fb){return _0x5397fb[_0x8bfe('0x21')](_0x55f5bc)['then'](function(_0x34043a){return _0x34043a;});}return null;};}function removeEntity(_0x19058e,_0x42a93f){return function(_0x260dd9){if(_0x260dd9){return _0x260dd9['destroy']()[_0x8bfe('0x22')](function(){_0x19058e[_0x8bfe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f73d0,_0x1789f7){return function(_0x46526f){if(!_0x46526f){_0x2f73d0[_0x8bfe('0x23')](0x194);}return _0x46526f;};}function handleError(_0x2dc8d5,_0x91271f){_0x91271f=_0x91271f||0x1f4;return function(_0x4fcb3a){logger[_0x8bfe('0x24')](_0x4fcb3a[_0x8bfe('0x25')]);if(_0x4fcb3a[_0x8bfe('0x26')]){delete _0x4fcb3a[_0x8bfe('0x26')];}_0x2dc8d5[_0x8bfe('0x18')](_0x91271f)[_0x8bfe('0x27')](_0x4fcb3a);};}exports[_0x8bfe('0x28')]=function(_0x2cbfb3,_0x15fccc){var _0x2b47c6={'raw':!![],'where':{'id':_0x2cbfb3['params']['id']}},_0x3c6a3c={};_0x3c6a3c[_0x8bfe('0x29')]=_[_0x8bfe('0x2a')](db['ChatProactiveAction'][_0x8bfe('0x2b')]);_0x3c6a3c[_0x8bfe('0x2c')]=_[_0x8bfe('0x2a')](_0x2cbfb3['query']);_0x3c6a3c[_0x8bfe('0x2d')]=_[_0x8bfe('0x2e')](_0x3c6a3c['model'],_0x3c6a3c['query']);_0x2b47c6[_0x8bfe('0x2f')]=_[_0x8bfe('0x2e')](_0x3c6a3c[_0x8bfe('0x29')],qs[_0x8bfe('0x30')](_0x2cbfb3[_0x8bfe('0x2c')][_0x8bfe('0x30')]));_0x2b47c6[_0x8bfe('0x2f')]=_0x2b47c6[_0x8bfe('0x2f')][_0x8bfe('0x31')]?_0x2b47c6[_0x8bfe('0x2f')]:_0x3c6a3c['model'];if(_0x2cbfb3['query'][_0x8bfe('0x32')]){_0x2b47c6[_0x8bfe('0x33')]=[{'all':!![]}];}_0x2b47c6=_[_0x8bfe('0x34')]({},_0x2b47c6,_0x2cbfb3[_0x8bfe('0x35')]);return db[_0x8bfe('0x36')][_0x8bfe('0x37')](_0x2b47c6)[_0x8bfe('0x22')](handleEntityNotFound(_0x15fccc,null))['then'](respondWithResult(_0x15fccc,null))[_0x8bfe('0x38')](handleError(_0x15fccc,null));};exports[_0x8bfe('0x39')]=function(_0x4f35ba,_0x2e73ab){return db[_0x8bfe('0x36')][_0x8bfe('0x39')](_0x4f35ba[_0x8bfe('0x3a')],{})[_0x8bfe('0x22')](respondWithResult(_0x2e73ab,0xc9))['catch'](handleError(_0x2e73ab,null));};exports[_0x8bfe('0x21')]=function(_0x506e50,_0x5a90b9){if(_0x506e50['body']['id']){delete _0x506e50['body']['id'];}return db[_0x8bfe('0x36')][_0x8bfe('0x37')]({'where':{'id':_0x506e50[_0x8bfe('0x3b')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x5a90b9,null))[_0x8bfe('0x22')](saveUpdates(_0x506e50[_0x8bfe('0x3a')],null))[_0x8bfe('0x22')](respondWithResult(_0x5a90b9,null))['catch'](handleError(_0x5a90b9,null));};exports[_0x8bfe('0x3c')]=function(_0x5ca84b,_0x5c5801){return db['ChatProactiveAction'][_0x8bfe('0x37')]({'where':{'id':_0x5ca84b[_0x8bfe('0x3b')]['id']}})[_0x8bfe('0x22')](handleEntityNotFound(_0x5c5801,null))[_0x8bfe('0x22')](removeEntity(_0x5c5801,null))[_0x8bfe('0x38')](handleError(_0x5c5801,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 0b1cd60..e498495 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 _0x37d3=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','../../config/logger'];(function(_0xa31177,_0x2ca0b1){var _0x3969a0=function(_0x29f315){while(--_0x29f315){_0xa31177['push'](_0xa31177['shift']());}};_0x3969a0(++_0x2ca0b1);}(_0x37d3,0xf0));var _0x337d=function(_0x505eb5,_0x195087){_0x505eb5=_0x505eb5-0x0;var _0x17cd53=_0x37d3[_0x505eb5];return _0x17cd53;};'use strict';var _=require(_0x337d('0x0'));var util=require('util');var logger=require(_0x337d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x337d('0x2'));var rp=require(_0x337d('0x3'));var fs=require('fs');var path=require(_0x337d('0x4'));var rimraf=require(_0x337d('0x5'));var config=require(_0x337d('0x6'));var attributes=require(_0x337d('0x7'));module[_0x337d('0x8')]=function(_0x3603f9,_0x266835){return _0x3603f9['define'](_0x337d('0x9'),attributes,{'tableName':_0x337d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68b4=['exports','define','chat_proactive_actions','lodash','util','api','moment','bluebird','request-promise','./chatProactiveAction.attributes'];(function(_0xc10d6f,_0x7ad78){var _0x441a9e=function(_0x1c7c3f){while(--_0x1c7c3f){_0xc10d6f['push'](_0xc10d6f['shift']());}};_0x441a9e(++_0x7ad78);}(_0x68b4,0x67));var _0x468b=function(_0x10767d,_0x2b448c){_0x10767d=_0x10767d-0x0;var _0x1eeb35=_0x68b4[_0x10767d];return _0x1eeb35;};'use strict';var _=require(_0x468b('0x0'));var util=require(_0x468b('0x1'));var logger=require('../../config/logger')(_0x468b('0x2'));var moment=require(_0x468b('0x3'));var BPromise=require(_0x468b('0x4'));var rp=require(_0x468b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x468b('0x6'));module[_0x468b('0x7')]=function(_0x517df8,_0x2dd41f){return _0x517df8[_0x468b('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x468b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index b8480e9..a330abd 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 _0x4309=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2fd419,_0x366bda){var _0x5f9ebf=function(_0x5a1544){while(--_0x5a1544){_0x2fd419['push'](_0x2fd419['shift']());}};_0x5f9ebf(++_0x366bda);}(_0x4309,0x1f3));var _0x9430=function(_0xf0e2bd,_0x2e38e5){_0xf0e2bd=_0xf0e2bd-0x0;var _0x57ddaa=_0x4309[_0xf0e2bd];return _0x57ddaa;};'use strict';var _=require('lodash');var util=require(_0x9430('0x0'));var moment=require(_0x9430('0x1'));var BPromise=require(_0x9430('0x2'));var rs=require(_0x9430('0x3'));var fs=require('fs');var Redis=require(_0x9430('0x4'));var db=require(_0x9430('0x5'))['db'];var utils=require(_0x9430('0x6'));var logger=require(_0x9430('0x7'))(_0x9430('0x8'));var config=require(_0x9430('0x9'));var jayson=require(_0x9430('0xa'));var client=jayson[_0x9430('0xb')][_0x9430('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4be11d,_0x48a5c1,_0x182f7c){return new BPromise(function(_0x31cd40,_0x414be9){return client['request'](_0x4be11d,_0x182f7c)[_0x9430('0xd')](function(_0x209e67){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x48a5c1,'request\x20sent');logger[_0x9430('0xe')](_0x9430('0xf'),_0x48a5c1,_0x9430('0x10'),JSON['stringify'](_0x209e67));if(_0x209e67['error']){if(_0x209e67[_0x9430('0x11')][_0x9430('0x12')]===0x1f4){logger[_0x9430('0x11')](_0x9430('0x13'),_0x48a5c1,_0x209e67['error'][_0x9430('0x14')]);return _0x414be9(_0x209e67['error']['message']);}logger['error'](_0x9430('0x13'),_0x48a5c1,_0x209e67[_0x9430('0x11')][_0x9430('0x14')]);return _0x31cd40(_0x209e67[_0x9430('0x11')][_0x9430('0x14')]);}else{logger[_0x9430('0x15')](_0x9430('0x13'),_0x48a5c1,_0x9430('0x10'));_0x31cd40(_0x209e67[_0x9430('0x16')]['message']);}})[_0x9430('0x17')](function(_0x330465){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x48a5c1,_0x330465);_0x414be9(_0x330465);});});} \ No newline at end of file +var _0xb0c0=['info','ChatProactiveAction,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','client','http','request'];(function(_0x3acf94,_0x1e857b){var _0xe192f8=function(_0x2572ae){while(--_0x2572ae){_0x3acf94['push'](_0x3acf94['shift']());}};_0xe192f8(++_0x1e857b);}(_0xb0c0,0xc4));var _0x0b0c=function(_0x35175a,_0x29ed4a){_0x35175a=_0x35175a-0x0;var _0x24bf33=_0xb0c0[_0x35175a];return _0x24bf33;};'use strict';var _=require('lodash');var util=require(_0x0b0c('0x0'));var moment=require('moment');var BPromise=require(_0x0b0c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b0c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0b0c('0x3'));var logger=require(_0x0b0c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0b0c('0x5')][_0x0b0c('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xa09a71,_0x578614,_0x222ded){return new BPromise(function(_0x510ba6,_0x5bf137){return client[_0x0b0c('0x7')](_0xa09a71,_0x222ded)['then'](function(_0x4e4bd1){logger[_0x0b0c('0x8')](_0x0b0c('0x9'),_0x578614,'request\x20sent');logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x578614,'request\x20sent',JSON[_0x0b0c('0xa')](_0x4e4bd1));if(_0x4e4bd1['error']){if(_0x4e4bd1['error'][_0x0b0c('0xb')]===0x1f4){logger[_0x0b0c('0xc')](_0x0b0c('0x9'),_0x578614,_0x4e4bd1[_0x0b0c('0xc')]['message']);return _0x5bf137(_0x4e4bd1[_0x0b0c('0xc')][_0x0b0c('0xd')]);}logger[_0x0b0c('0xc')](_0x0b0c('0x9'),_0x578614,_0x4e4bd1[_0x0b0c('0xc')]['message']);return _0x510ba6(_0x4e4bd1['error'][_0x0b0c('0xd')]);}else{logger[_0x0b0c('0x8')](_0x0b0c('0x9'),_0x578614,_0x0b0c('0xe'));_0x510ba6(_0x4e4bd1[_0x0b0c('0xf')]['message']);}})[_0x0b0c('0x10')](function(_0x4a3c05){logger[_0x0b0c('0xc')](_0x0b0c('0x9'),_0x578614,_0x4a3c05);_0x5bf137(_0x4a3c05);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 5fc5743..2d8c79a 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 _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show','isAuthenticated','create','put'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xabce,0x103));var _0xeabc=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xabce[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0xeabc('0x8'),auth['isAuthenticated'](),controller[_0xeabc('0x9')]);router['post']('/',auth[_0xeabc('0xa')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/:id',auth[_0xeabc('0xa')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0x8'),auth[_0xeabc('0xa')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router; \ No newline at end of file +var _0x5d17=['create','put','/:id','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','show','post'];(function(_0x4420ff,_0x482500){var _0x319aa0=function(_0x256897){while(--_0x256897){_0x4420ff['push'](_0x4420ff['shift']());}};_0x319aa0(++_0x482500);}(_0x5d17,0x114));var _0x75d1=function(_0x42d1c8,_0xc13c44){_0x42d1c8=_0x42d1c8-0x0;var _0x22f990=_0x5d17[_0x42d1c8];return _0x22f990;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/:id',auth[_0x75d1('0x9')](),controller[_0x75d1('0xa')]);router[_0x75d1('0xb')]('/',auth[_0x75d1('0x9')](),controller[_0x75d1('0xc')]);router[_0x75d1('0xd')](_0x75d1('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x75d1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x75d1('0x10')]);module[_0x75d1('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 28f4b46..d7ca9a8 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 _0x850c=['INTEGER','ENUM','beepall','exports','STRING','name'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x850c,0x1b3));var _0xc850=function(_0x2cc21e,_0x5c649e){_0x2cc21e=_0x2cc21e-0x0;var _0x5c0ce0=_0x850c[_0x2cc21e];return _0x5c0ce0;};'use strict';var Sequelize=require('sequelize');module[_0xc850('0x0')]={'name':{'type':Sequelize[_0xc850('0x1')],'unique':_0xc850('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc850('0x1')]},'timeout':{'type':Sequelize[_0xc850('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc850('0x4')]('rrmemory',_0xc850('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x7b69=['name','beepall','exports','STRING'];(function(_0xe4d35a,_0x4bd94d){var _0x249363=function(_0x3da3fe){while(--_0x3da3fe){_0xe4d35a['push'](_0xe4d35a['shift']());}};_0x249363(++_0x4bd94d);}(_0x7b69,0xb2));var _0x97b6=function(_0x437a0e,_0x45d781){_0x437a0e=_0x437a0e-0x0;var _0xa393fd=_0x7b69[_0x437a0e];return _0xa393fd;};'use strict';var Sequelize=require('sequelize');module[_0x97b6('0x0')]={'name':{'type':Sequelize[_0x97b6('0x1')],'unique':_0x97b6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x97b6('0x3'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index b965313..31e8a8a 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 _0xa2ce=['include','findAll','rows','show','params','length','merge','find','create','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','UserId','agent','updatedAt','createdAt','format','SIP','chatPause','getTeams','ids','Team','online','voicePause','interface','transaction','addTeams','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Agents','select','field','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','every','TeamId','includes','all','union','value','removeAgents','addAgents','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','get','ChatQueues','UserProfileResource','destroy','name','send','index','map','ChatQueue','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll'];(function(_0x138230,_0x540929){var _0x2a290e=function(_0x4b62ec){while(--_0x4b62ec){_0x138230['push'](_0x138230['shift']());}};_0x2a290e(++_0x540929);}(_0xa2ce,0xd1));var _0xea2c=function(_0x4c04c0,_0x19ee1a){_0x4c04c0=_0x4c04c0-0x0;var _0x3f7818=_0xa2ce[_0x4c04c0];return _0x3f7818;};'use strict';var emlformat=require(_0xea2c('0x0'));var rimraf=require(_0xea2c('0x1'));var zipdir=require(_0xea2c('0x2'));var jsonpatch=require(_0xea2c('0x3'));var rp=require(_0xea2c('0x4'));var moment=require(_0xea2c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xea2c('0x6'));var util=require('util');var path=require(_0xea2c('0x7'));var sox=require(_0xea2c('0x8'));var csv=require(_0xea2c('0x9'));var ejs=require(_0xea2c('0xa'));var fs=require('fs');var fs_extra=require(_0xea2c('0xb'));var _=require(_0xea2c('0xc'));var squel=require(_0xea2c('0xd'));var crypto=require('crypto');var jsforce=require(_0xea2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xea2c('0x9'));var querystring=require(_0xea2c('0xf'));var Papa=require(_0xea2c('0x10'));var Redis=require('ioredis');var authService=require(_0xea2c('0x11'));var qs=require(_0xea2c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea2c('0x13'));var logger=require(_0xea2c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xea2c('0x15'));var licenseUtil=require(_0xea2c('0x16'));var db=require(_0xea2c('0x17'))['db'];config[_0xea2c('0x18')]=_[_0xea2c('0x19')](config[_0xea2c('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xea2c('0x1a'))(new Redis(config[_0xea2c('0x18')]));require('./chatQueue.socket')[_0xea2c('0x1b')](socket);var jayson=require(_0xea2c('0x1c'));var client=jayson[_0xea2c('0x1d')][_0xea2c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2f2912,_0x266279,_0x1c8167,_0xb133de){return new BPromise(function(_0x1202ac,_0x35b60e){var _0x12e9eb=_0xb133de||client;return _0x12e9eb['request'](_0x2f2912,_0x1c8167)['then'](function(_0x479b40){logger[_0xea2c('0x1f')](_0xea2c('0x20'),_0x266279,_0xea2c('0x21'));logger[_0xea2c('0x22')](_0xea2c('0x23'),_0x266279,_0xea2c('0x21'),JSON[_0xea2c('0x24')](_0x479b40));if(_0x479b40['error']){if(_0x479b40[_0xea2c('0x25')][_0xea2c('0x26')]===0x1f4){logger[_0xea2c('0x25')](_0xea2c('0x20'),_0x266279,_0x479b40[_0xea2c('0x25')][_0xea2c('0x27')]);return _0x35b60e(_0x479b40[_0xea2c('0x25')][_0xea2c('0x27')]);}logger[_0xea2c('0x25')](_0xea2c('0x20'),_0x266279,_0x479b40['error']['message']);return _0x1202ac(_0x479b40[_0xea2c('0x25')][_0xea2c('0x27')]);}else{logger[_0xea2c('0x1f')](_0xea2c('0x20'),_0x266279,'request\x20sent');_0x1202ac(_0x479b40[_0xea2c('0x28')][_0xea2c('0x27')]);}})[_0xea2c('0x29')](function(_0x25ad15){logger[_0xea2c('0x25')](_0xea2c('0x20'),_0x266279,_0x25ad15);_0x35b60e(_0x25ad15);});});}function respondWithStatusCode(_0x437cbc,_0x53dd67){_0x53dd67=_0x53dd67||0xcc;return function(_0x3aec14){if(_0x3aec14){return _0x437cbc[_0xea2c('0x2a')](_0x53dd67);}return _0x437cbc[_0xea2c('0x2b')](_0x53dd67)[_0xea2c('0x2c')]();};}function respondWithResult(_0x18c896,_0x4162cb){_0x4162cb=_0x4162cb||0xc8;return function(_0x57424f){if(_0x57424f){return _0x18c896[_0xea2c('0x2b')](_0x4162cb)[_0xea2c('0x2d')](_0x57424f);}};}function respondWithFilteredResult(_0xf119e0,_0x56b828){return function(_0x209248){if(_0x209248){var _0x45e0a2=typeof _0x56b828[_0xea2c('0x2e')]==='undefined'&&typeof _0x56b828[_0xea2c('0x2f')]===_0xea2c('0x30');var _0x56a282=_0x209248[_0xea2c('0x31')];var _0x277aa4=_0x45e0a2?0x0:_0x56b828[_0xea2c('0x2e')];var _0x46af70=_0x45e0a2?_0x209248[_0xea2c('0x31')]:_0x56b828['offset']+_0x56b828[_0xea2c('0x2f')];var _0x160bac;if(_0x46af70>=_0x56a282){_0x46af70=_0x56a282;_0x160bac=0xc8;}else{_0x160bac=0xce;}_0xf119e0[_0xea2c('0x2b')](_0x160bac);return _0xf119e0[_0xea2c('0x32')](_0xea2c('0x33'),_0x277aa4+'-'+_0x46af70+'/'+_0x56a282)['json'](_0x209248);}return null;};}function patchUpdates(_0x2f5d29){return function(_0x27c839){try{jsonpatch[_0xea2c('0x34')](_0x27c839,_0x2f5d29,!![]);}catch(_0x4d3878){return BPromise['reject'](_0x4d3878);}return _0x27c839[_0xea2c('0x35')]();};}function saveUpdates(_0x4eeae5,_0x5db364){return function(_0x5e5cf8){if(_0x5e5cf8){return _0x5e5cf8[_0xea2c('0x36')](_0x4eeae5)['then'](function(_0x1bf33d){return _0x1bf33d;});}return null;};}function removeEntity(_0x3d88de,_0x592796){return function(_0xc562ec){if(_0xc562ec){return _0xc562ec['destroy']()[_0xea2c('0x37')](function(){var _0x4b4307=_0xc562ec[_0xea2c('0x38')]({'plain':!![]});var _0x1a591d=_0xea2c('0x39');return db[_0xea2c('0x3a')][_0xea2c('0x3b')]({'where':{'type':_0x1a591d,'resourceId':_0x4b4307['id']}})[_0xea2c('0x37')](function(){return _0xc562ec;});})[_0xea2c('0x37')](function(){_0x3d88de['status'](0xcc)[_0xea2c('0x2c')]();});}};}function handleEntityNotFound(_0x4e459e,_0x3a1025){return function(_0xc234f7){if(!_0xc234f7){_0x4e459e[_0xea2c('0x2a')](0x194);}return _0xc234f7;};}function handleError(_0x3d2f8f,_0x3d73d5){_0x3d73d5=_0x3d73d5||0x1f4;return function(_0x2888e9){logger[_0xea2c('0x25')](_0x2888e9['stack']);if(_0x2888e9[_0xea2c('0x3c')]){delete _0x2888e9[_0xea2c('0x3c')];}_0x3d2f8f[_0xea2c('0x2b')](_0x3d73d5)[_0xea2c('0x3d')](_0x2888e9);};}exports[_0xea2c('0x3e')]=function(_0x31a9a2,_0x397702){var _0x179ea0={},_0x1e8721={},_0x2b3f4b={'count':0x0,'rows':[]};var _0x2d8fbc=_[_0xea2c('0x3f')](db[_0xea2c('0x40')][_0xea2c('0x41')],function(_0x39fb85){return{'name':_0x39fb85[_0xea2c('0x42')],'type':_0x39fb85['type']['key']};});_0x1e8721['model']=_['map'](_0x2d8fbc,'name');_0x1e8721[_0xea2c('0x43')]=_[_0xea2c('0x44')](_0x31a9a2[_0xea2c('0x43')]);_0x1e8721[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x1e8721[_0xea2c('0x47')],_0x1e8721['query']);_0x179ea0[_0xea2c('0x48')]=_[_0xea2c('0x46')](_0x1e8721[_0xea2c('0x47')],qs[_0xea2c('0x49')](_0x31a9a2[_0xea2c('0x43')][_0xea2c('0x49')]));_0x179ea0[_0xea2c('0x48')]=_0x179ea0[_0xea2c('0x48')]['length']?_0x179ea0['attributes']:_0x1e8721[_0xea2c('0x47')];if(!_0x31a9a2[_0xea2c('0x43')][_0xea2c('0x4a')](_0xea2c('0x4b'))){_0x179ea0[_0xea2c('0x2f')]=qs[_0xea2c('0x2f')](_0x31a9a2['query'][_0xea2c('0x2f')]);_0x179ea0['offset']=qs[_0xea2c('0x2e')](_0x31a9a2['query'][_0xea2c('0x2e')]);}_0x179ea0[_0xea2c('0x4c')]=qs[_0xea2c('0x4d')](_0x31a9a2[_0xea2c('0x43')]['sort']);_0x179ea0['where']=qs[_0xea2c('0x45')](_[_0xea2c('0x4e')](_0x31a9a2['query'],_0x1e8721[_0xea2c('0x45')]),_0x2d8fbc);if(_0x31a9a2['query'][_0xea2c('0x4f')]){_0x179ea0[_0xea2c('0x50')]=_['merge'](_0x179ea0[_0xea2c('0x50')],{'$or':_[_0xea2c('0x3f')](_0x2d8fbc,function(_0x21eef1){if(_0x21eef1[_0xea2c('0x51')]!==_0xea2c('0x52')){var _0x44dccc={};_0x44dccc[_0x21eef1[_0xea2c('0x3c')]]={'$like':'%'+_0x31a9a2[_0xea2c('0x43')][_0xea2c('0x4f')]+'%'};return _0x44dccc;}})});}_0x179ea0=_['merge']({},_0x179ea0,_0x31a9a2[_0xea2c('0x53')]);var _0x3a09c4={'where':_0x179ea0[_0xea2c('0x50')]};return db[_0xea2c('0x40')][_0xea2c('0x31')](_0x3a09c4)[_0xea2c('0x37')](function(_0x4dda2a){_0x2b3f4b[_0xea2c('0x31')]=_0x4dda2a;if(_0x31a9a2['query'][_0xea2c('0x54')]){_0x179ea0[_0xea2c('0x55')]=[{'all':!![]}];}return db[_0xea2c('0x40')][_0xea2c('0x56')](_0x179ea0);})[_0xea2c('0x37')](function(_0x12f83e){_0x2b3f4b[_0xea2c('0x57')]=_0x12f83e;return _0x2b3f4b;})[_0xea2c('0x37')](respondWithFilteredResult(_0x397702,_0x179ea0))[_0xea2c('0x29')](handleError(_0x397702,null));};exports[_0xea2c('0x58')]=function(_0x7e8e15,_0x1b5ab2){var _0x2cac1d={'raw':!![],'where':{'id':_0x7e8e15[_0xea2c('0x59')]['id']}},_0x2c4be3={};_0x2c4be3[_0xea2c('0x47')]=_[_0xea2c('0x44')](db['ChatQueue'][_0xea2c('0x41')]);_0x2c4be3['query']=_[_0xea2c('0x44')](_0x7e8e15[_0xea2c('0x43')]);_0x2c4be3[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x2c4be3['model'],_0x2c4be3['query']);_0x2cac1d['attributes']=_[_0xea2c('0x46')](_0x2c4be3[_0xea2c('0x47')],qs['fields'](_0x7e8e15[_0xea2c('0x43')][_0xea2c('0x49')]));_0x2cac1d[_0xea2c('0x48')]=_0x2cac1d[_0xea2c('0x48')][_0xea2c('0x5a')]?_0x2cac1d[_0xea2c('0x48')]:_0x2c4be3[_0xea2c('0x47')];if(_0x7e8e15[_0xea2c('0x43')]['includeAll']){_0x2cac1d['include']=[{'all':!![]}];}_0x2cac1d=_[_0xea2c('0x5b')]({},_0x2cac1d,_0x7e8e15[_0xea2c('0x53')]);return db['ChatQueue'][_0xea2c('0x5c')](_0x2cac1d)['then'](handleEntityNotFound(_0x1b5ab2,null))[_0xea2c('0x37')](respondWithResult(_0x1b5ab2,null))[_0xea2c('0x29')](handleError(_0x1b5ab2,null));};exports[_0xea2c('0x5d')]=function(_0x3d6c32,_0x1aa58c){return db[_0xea2c('0x40')][_0xea2c('0x5d')](_0x3d6c32['body'],{})[_0xea2c('0x37')](function(_0x500057){var _0x2b1a99=_0x3d6c32['user']['get']({'plain':!![]});if(!_0x2b1a99)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b1a99[_0xea2c('0x5e')]===_0xea2c('0x5f')){var _0x23dd2b=_0x500057[_0xea2c('0x38')]({'plain':!![]});var _0x1623dd=_0xea2c('0x39');return db[_0xea2c('0x60')][_0xea2c('0x5c')]({'where':{'name':_0x1623dd,'userProfileId':_0x2b1a99['userProfileId']},'raw':!![]})[_0xea2c('0x37')](function(_0x68185c){if(_0x68185c&&_0x68185c[_0xea2c('0x61')]===0x0){return db[_0xea2c('0x3a')][_0xea2c('0x5d')]({'name':_0x23dd2b[_0xea2c('0x3c')],'resourceId':_0x23dd2b['id'],'type':_0x68185c['name'],'sectionId':_0x68185c['id']},{})[_0xea2c('0x37')](function(){return _0x500057;});}else{return _0x500057;}})['catch'](function(_0x3aa5b2){logger[_0xea2c('0x25')](_0xea2c('0x62'),_0x3aa5b2);throw _0x3aa5b2;});}return _0x500057;})['then'](respondWithResult(_0x1aa58c,0xc9))[_0xea2c('0x29')](handleError(_0x1aa58c,null));};exports[_0xea2c('0x36')]=function(_0x2bd56e,_0x138bef){if(_0x2bd56e[_0xea2c('0x63')]['id']){delete _0x2bd56e[_0xea2c('0x63')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x2bd56e['params']['id']}})['then'](handleEntityNotFound(_0x138bef,null))[_0xea2c('0x37')](saveUpdates(_0x2bd56e[_0xea2c('0x63')],null))[_0xea2c('0x37')](respondWithResult(_0x138bef,null))[_0xea2c('0x29')](handleError(_0x138bef,null));};exports[_0xea2c('0x3b')]=function(_0x2eaf5f,_0x4152dc){return db[_0xea2c('0x40')]['find']({'where':{'id':_0x2eaf5f[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x4152dc,null))[_0xea2c('0x37')](removeEntity(_0x4152dc,null))[_0xea2c('0x29')](handleError(_0x4152dc,null));};exports[_0xea2c('0x64')]=function(_0x3d7cb1,_0x1edd37){return db['ChatQueue'][_0xea2c('0x64')]()[_0xea2c('0x37')](respondWithResult(_0x1edd37,null))[_0xea2c('0x29')](handleError(_0x1edd37,null));};exports[_0xea2c('0x65')]=function(_0x192f72,_0x294ebd,_0x50cbb9){var _0x20e5f1={'raw':!![],'where':{}},_0x48cc62={},_0x3acaab;return db[_0xea2c('0x40')][_0xea2c('0x66')]({'where':{'id':_0x192f72['params']['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x294ebd,null))[_0xea2c('0x37')](function(_0x510f62){if(_0x510f62){_0x3acaab=_0x510f62['get']({'plain':!![]});_0x48cc62[_0xea2c('0x47')]=_[_0xea2c('0x44')](db[_0xea2c('0x67')]['rawAttributes']);_0x48cc62[_0xea2c('0x43')]=_[_0xea2c('0x44')](_0x192f72[_0xea2c('0x43')]);_0x48cc62[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x48cc62['model'],_0x48cc62[_0xea2c('0x43')]);_0x20e5f1['attributes']=_['intersection'](_0x48cc62[_0xea2c('0x47')],qs['fields'](_0x192f72[_0xea2c('0x43')]['fields']));_0x20e5f1[_0xea2c('0x48')]=_0x20e5f1[_0xea2c('0x48')]['length']?_0x20e5f1[_0xea2c('0x48')]:_0x48cc62[_0xea2c('0x47')];if(!_0x192f72[_0xea2c('0x43')][_0xea2c('0x4a')]('nolimit')){_0x20e5f1[_0xea2c('0x2f')]=qs[_0xea2c('0x2f')](_0x192f72[_0xea2c('0x43')][_0xea2c('0x2f')]);_0x20e5f1['offset']=qs['offset'](_0x192f72[_0xea2c('0x43')][_0xea2c('0x2e')]);}_0x20e5f1[_0xea2c('0x4c')]=qs[_0xea2c('0x4d')](_0x192f72['query'][_0xea2c('0x4d')]);_0x20e5f1['where']=qs['filters'](_['pick'](_0x192f72['query'],_0x48cc62['filters']));_0x20e5f1[_0xea2c('0x50')][_0xea2c('0x68')]=_0x510f62['id'];if(_0x192f72[_0xea2c('0x43')]['filter']){_0x20e5f1[_0xea2c('0x50')]=_['merge'](_0x20e5f1[_0xea2c('0x50')],{'$or':_[_0xea2c('0x3f')](_0x20e5f1[_0xea2c('0x48')],function(_0x1d4c88){var _0x29cba6={};_0x29cba6[_0x1d4c88]={'$like':'%'+_0x192f72[_0xea2c('0x43')][_0xea2c('0x4f')]+'%'};return _0x29cba6;})});}_0x20e5f1=_[_0xea2c('0x5b')]({},_0x20e5f1,_0x192f72[_0xea2c('0x53')]);return db[_0xea2c('0x67')][_0xea2c('0x56')](_0x20e5f1);}})[_0xea2c('0x37')](function(_0xd1283d){if(_0xd1283d){return db[_0xea2c('0x69')]['findAndCountAll']({'where':{'id':_[_0xea2c('0x3f')](_0xd1283d,_0xea2c('0x6a')),'role':_0xea2c('0x6b')},'attributes':['id',_0xea2c('0x3c'),'chatPause',_0xea2c('0x6c'),_0xea2c('0x6d')]});}})[_0xea2c('0x37')](function(_0x7c0f91){if(_0x7c0f91){return{'count':_0x7c0f91[_0xea2c('0x31')],'rows':_[_0xea2c('0x3f')](_0x7c0f91[_0xea2c('0x57')],function(_0x2eb63f){return{'membername':_0x2eb63f[_0xea2c('0x3c')],'UserId':_0x2eb63f['id'],'queue_name':_0x3acaab[_0xea2c('0x3c')],'ChatQueueId':_0x3acaab['id'],'interface':util[_0xea2c('0x6e')]('%s/%s',_0xea2c('0x6f'),_0x2eb63f[_0xea2c('0x3c')]),'penalty':0x0,'paused':_0x2eb63f[_0xea2c('0x70')],'createdAt':_0x2eb63f['createdAt'],'updatedAt':_0x2eb63f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xea2c('0x37')](respondWithFilteredResult(_0x294ebd,_0x20e5f1))[_0xea2c('0x29')](handleError(_0x294ebd,null));};exports[_0xea2c('0x71')]=function(_0x195ff7,_0x324ea3,_0x3ca63b){var _0x4aa542={};var _0x30c181={};var _0x4c464e;var _0x5a2dc6;return db[_0xea2c('0x40')][_0xea2c('0x66')]({'where':{'id':_0x195ff7[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x324ea3,null))[_0xea2c('0x37')](function(_0x19164e){if(_0x19164e){_0x4c464e=_0x19164e;_0x30c181['model']=_[_0xea2c('0x44')](db['Team'][_0xea2c('0x41')]);_0x30c181[_0xea2c('0x43')]=_[_0xea2c('0x44')](_0x195ff7[_0xea2c('0x43')]);_0x30c181[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x30c181[_0xea2c('0x47')],_0x30c181[_0xea2c('0x43')]);_0x4aa542[_0xea2c('0x48')]=_[_0xea2c('0x46')](_0x30c181[_0xea2c('0x47')],qs[_0xea2c('0x49')](_0x195ff7[_0xea2c('0x43')][_0xea2c('0x49')]));_0x4aa542[_0xea2c('0x48')]=_0x4aa542[_0xea2c('0x48')]['length']?_0x4aa542['attributes']:_0x30c181[_0xea2c('0x47')];_0x4aa542[_0xea2c('0x4c')]=qs[_0xea2c('0x4d')](_0x195ff7['query'][_0xea2c('0x4d')]);_0x4aa542[_0xea2c('0x50')]=qs[_0xea2c('0x45')](_[_0xea2c('0x4e')](_0x195ff7[_0xea2c('0x43')],_0x30c181[_0xea2c('0x45')]));if(_0x195ff7[_0xea2c('0x43')][_0xea2c('0x4f')]){_0x4aa542['where']=_[_0xea2c('0x5b')](_0x4aa542[_0xea2c('0x50')],{'$or':_[_0xea2c('0x3f')](_0x4aa542['attributes'],function(_0x536f06){var _0x294633={};_0x294633[_0x536f06]={'$like':'%'+_0x195ff7[_0xea2c('0x43')]['filter']+'%'};return _0x294633;})});}_0x4aa542=_[_0xea2c('0x5b')]({},_0x4aa542,_0x195ff7[_0xea2c('0x53')]);return _0x4c464e[_0xea2c('0x71')](_0x4aa542);}})[_0xea2c('0x37')](function(_0x1dd6d2){if(_0x1dd6d2){_0x5a2dc6=_0x1dd6d2['length'];if(!_0x195ff7[_0xea2c('0x43')][_0xea2c('0x4a')]('nolimit')){_0x4aa542['limit']=qs['limit'](_0x195ff7[_0xea2c('0x43')][_0xea2c('0x2f')]);_0x4aa542[_0xea2c('0x2e')]=qs[_0xea2c('0x2e')](_0x195ff7[_0xea2c('0x43')][_0xea2c('0x2e')]);}return _0x4c464e[_0xea2c('0x71')](_0x4aa542);}})[_0xea2c('0x37')](function(_0x19ebee){if(_0x19ebee){return _0x19ebee?{'count':_0x5a2dc6,'rows':_0x19ebee}:null;}})['then'](respondWithResult(_0x324ea3,null))[_0xea2c('0x29')](handleError(_0x324ea3,null));};exports['addTeams']=function(_0x4f7b27,_0x2d612a,_0xd96850){var _0x3a6421=_0x4f7b27[_0xea2c('0x63')][_0xea2c('0x72')];return db[_0xea2c('0x73')]['findAll']({'where':{'id':_0x3a6421},'attributes':['id'],'include':[{'model':db[_0xea2c('0x69')],'as':'Agents','attributes':['id',_0xea2c('0x3c'),_0xea2c('0x74'),_0xea2c('0x75'),_0xea2c('0x76')],'raw':!![]}]})[_0xea2c('0x37')](function(_0x39e14f){if(_0x39e14f){var _0xd5dc8c=_['flatMap'](_0x39e14f,function(_0x4fe1ec){var _0xd97616=_0x4fe1ec[_0xea2c('0x38')]({'plain':!![]});return _0xd97616['Agents'];});return db['ChatQueue'][_0xea2c('0x5c')]({'where':{'id':_0x4f7b27[_0xea2c('0x59')]['id']}})['then'](function(_0x3ee3d2){return db['sequelize'][_0xea2c('0x77')](function(_0x553bd9){return _0x3ee3d2[_0xea2c('0x78')](_0x3a6421,{'transaction':_0x553bd9})[_0xea2c('0x37')](function(){return BPromise['each'](_0xd5dc8c,function(_0x44d580){return db[_0xea2c('0x67')][_0xea2c('0x79')]({'where':{'UserId':_0x44d580['id'],'ChatQueueId':_0x4f7b27[_0xea2c('0x59')]['id']},'transaction':_0x553bd9});});})[_0xea2c('0x37')](function(){_0xd5dc8c[_0xea2c('0x7a')](function(_0x2f7f37){socket[_0xea2c('0x7b')](_0xea2c('0x7c'),{'UserId':_0x2f7f37['id'],'ChatQueueId':_0x3ee3d2['id']});});});});});}})[_0xea2c('0x37')](respondWithStatusCode(_0x2d612a,null))[_0xea2c('0x29')](handleError(_0x2d612a,null));};exports[_0xea2c('0x7d')]=function(_0x2d14b2,_0x192006,_0x2464fb){return db[_0xea2c('0x73')]['findAll']({'where':{'id':_0x2d14b2['query'][_0xea2c('0x72')]},'attributes':['id'],'include':[{'model':db[_0xea2c('0x69')],'as':_0xea2c('0x7e'),'attributes':['id'],'raw':!![]}]})[_0xea2c('0x37')](handleEntityNotFound(_0x192006,null))[_0xea2c('0x37')](function(_0x1bffeb){var _0xaf15b4=_['map'](_0x1bffeb,'id');var _0x596a8c=[];var _0xd81ac9=[];var _0x308157=squel[_0xea2c('0x7f')]();_0x308157[_0xea2c('0x80')]('tq.TeamId')[_0xea2c('0x81')](_0xea2c('0x82'),'tq')['join'](_0xea2c('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xea2c('0x50')](_0xea2c('0x84'),_0x2d14b2[_0xea2c('0x59')]['id']);for(var _0x25c708=0x0;_0x25c708<_0x1bffeb[_0xea2c('0x5a')];_0x25c708+=0x1){let _0x5ee0eb=_0x1bffeb[_0x25c708];for(var _0x326d1d=0x0;_0x326d1d<_0x5ee0eb[_0xea2c('0x7e')][_0xea2c('0x5a')];_0x326d1d+=0x1){let _0x3b32d0=_0x5ee0eb[_0xea2c('0x7e')][_0x326d1d];var _0x1a58c4=_0x308157[_0xea2c('0x85')]();_0x1a58c4['where'](_0xea2c('0x86'),_0x3b32d0['id']);_0xd81ac9[_0xea2c('0x87')](db[_0xea2c('0x88')]['query'](_0x1a58c4['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xea2c('0x37')](function(_0x7375dd){if(_0x7375dd['length']===0x1){return _0x3b32d0['id'];}else{var _0x4ac335=_[_0xea2c('0x89')](_['map'](_0x7375dd,_0xea2c('0x8a')),function(_0x4c584a){return _[_0xea2c('0x8b')](_0xaf15b4,_0x4c584a);});if(_0x4ac335){return _0x3b32d0['id'];}}}));}}return BPromise[_0xea2c('0x8c')](_0xd81ac9)[_0xea2c('0x37')](function(_0x1e9ac3){_0x596a8c=_(_0x596a8c)[_0xea2c('0x8d')](_0x1e9ac3)['compact']()[_0xea2c('0x8e')]();return db[_0xea2c('0x40')][_0xea2c('0x5c')]({'where':{'id':_0x2d14b2[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](function(_0x2a2b9f){return db[_0xea2c('0x88')][_0xea2c('0x77')](function(_0x182cbc){return _0x2a2b9f[_0xea2c('0x7d')](_0x2d14b2[_0xea2c('0x43')][_0xea2c('0x72')],{'transaction':_0x182cbc})[_0xea2c('0x37')](function(){if(!_['isEmpty'](_0x596a8c)){return _0x2a2b9f[_0xea2c('0x8f')](_0x596a8c,{'transaction':_0x182cbc});}})['then'](function(){_0x596a8c[_0xea2c('0x7a')](function(_0x26a141){socket['emit']('userChatQueue:remove',{'UserId':_0x26a141,'ChatQueueId':_0x2a2b9f['id']});});});});});});})[_0xea2c('0x37')](respondWithStatusCode(_0x192006,null))[_0xea2c('0x29')](handleError(_0x192006,null));};exports[_0xea2c('0x90')]=function(_0x572a59,_0x1b4e73,_0x44eb71){return db['ChatQueue'][_0xea2c('0x5c')]({'where':{'id':_0x572a59[_0xea2c('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b4e73,null))[_0xea2c('0x37')](function(_0x128a55){if(_0x128a55){return _0x128a55[_0xea2c('0x90')](_0x572a59['body'][_0xea2c('0x72')],_['omit'](_0x572a59[_0xea2c('0x63')],[_0xea2c('0x72'),'id'])||{})['spread'](function(_0x46867e){for(var _0x29a6e9=0x0;_0x29a6e9<_0x572a59[_0xea2c('0x63')]['ids'][_0xea2c('0x5a')];_0x29a6e9+=0x1){socket[_0xea2c('0x7b')]('userChatQueue:save',{'UserId':Number(_0x572a59['body'][_0xea2c('0x72')][_0x29a6e9]),'ChatQueueId':Number(_0x572a59['params']['id'])});}return _0x46867e;});}})[_0xea2c('0x37')](respondWithResult(_0x1b4e73,null))[_0xea2c('0x29')](handleError(_0x1b4e73,null));};exports[_0xea2c('0x8f')]=function(_0x5aa52f,_0x22f5ae,_0x1ba35b){return db[_0xea2c('0x40')]['find']({'where':{'id':_0x5aa52f[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x22f5ae,null))['then'](function(_0x58bb10){if(_0x58bb10){return _0x58bb10[_0xea2c('0x8f')](_0x5aa52f[_0xea2c('0x43')][_0xea2c('0x72')])[_0xea2c('0x37')](function(){if(_['isArray'](_0x5aa52f[_0xea2c('0x43')]['ids'])){for(var _0x14120c=0x0;_0x14120c<_0x5aa52f['query'][_0xea2c('0x72')][_0xea2c('0x5a')];_0x14120c+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x5aa52f[_0xea2c('0x43')]['ids'][_0x14120c]),'ChatQueueId':Number(_0x5aa52f['params']['id'])});}}else{socket[_0xea2c('0x7b')](_0xea2c('0x91'),{'UserId':Number(_0x5aa52f[_0xea2c('0x43')][_0xea2c('0x72')]),'ChatQueueId':Number(_0x5aa52f['params']['id'])});}});}})['then'](respondWithStatusCode(_0x22f5ae,null))['catch'](handleError(_0x22f5ae,null));};exports[_0xea2c('0x92')]=function(_0x506184,_0x3337b2,_0x55b2fc){var _0x2f4d87={};var _0x471993={};var _0x25baad;var _0x59c50c;return db[_0xea2c('0x40')][_0xea2c('0x66')]({'where':{'id':_0x506184[_0xea2c('0x59')]['id']}})[_0xea2c('0x37')](handleEntityNotFound(_0x3337b2,null))[_0xea2c('0x37')](function(_0x3e6da6){if(_0x3e6da6){_0x25baad=_0x3e6da6;_0x471993['model']=_[_0xea2c('0x44')](db[_0xea2c('0x69')][_0xea2c('0x41')]);_0x471993[_0xea2c('0x43')]=_[_0xea2c('0x44')](_0x506184['query']);_0x471993[_0xea2c('0x45')]=_[_0xea2c('0x46')](_0x471993['model'],_0x471993[_0xea2c('0x43')]);_0x2f4d87['attributes']=_[_0xea2c('0x46')](_0x471993[_0xea2c('0x47')],qs['fields'](_0x506184[_0xea2c('0x43')][_0xea2c('0x49')]));_0x2f4d87['attributes']=_0x2f4d87[_0xea2c('0x48')][_0xea2c('0x5a')]?_0x2f4d87[_0xea2c('0x48')]:_0x471993[_0xea2c('0x47')];_0x2f4d87['order']=qs[_0xea2c('0x4d')](_0x506184[_0xea2c('0x43')][_0xea2c('0x4d')]);_0x2f4d87[_0xea2c('0x50')]=qs[_0xea2c('0x45')](_['pick'](_0x506184[_0xea2c('0x43')],_0x471993[_0xea2c('0x45')]));if(_0x506184[_0xea2c('0x43')][_0xea2c('0x4f')]){_0x2f4d87[_0xea2c('0x50')]=_[_0xea2c('0x5b')](_0x2f4d87['where'],{'$or':_[_0xea2c('0x3f')](_0x2f4d87[_0xea2c('0x48')],function(_0x30975e){var _0x145598={};_0x145598[_0x30975e]={'$like':'%'+_0x506184[_0xea2c('0x43')][_0xea2c('0x4f')]+'%'};return _0x145598;})});}_0x2f4d87=_['merge']({},_0x2f4d87,_0x506184['options']);return _0x25baad[_0xea2c('0x92')](_0x2f4d87);}})[_0xea2c('0x37')](function(_0x120fea){if(_0x120fea){_0x59c50c=_0x120fea['length'];if(!_0x506184[_0xea2c('0x43')][_0xea2c('0x4a')](_0xea2c('0x4b'))){_0x2f4d87[_0xea2c('0x2f')]=qs[_0xea2c('0x2f')](_0x506184[_0xea2c('0x43')][_0xea2c('0x2f')]);_0x2f4d87[_0xea2c('0x2e')]=qs['offset'](_0x506184[_0xea2c('0x43')][_0xea2c('0x2e')]);}return _0x25baad[_0xea2c('0x92')](_0x2f4d87);}})['then'](function(_0x38100c){if(_0x38100c){return _0x38100c?{'count':_0x59c50c,'rows':_0x38100c}:null;}})[_0xea2c('0x37')](respondWithResult(_0x3337b2,null))[_0xea2c('0x29')](handleError(_0x3337b2,null));}; \ No newline at end of file +var _0x6073=['socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','send','index','map','key','model','name','keys','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','where','merge','options','ChatQueue','count','includeAll','include','findAll','rows','catch','show','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','findOne','UserChatQueue','rawAttributes','pick','ChatQueueId','filter','updatedAt','createdAt','format','SIP','chatPause','getTeams','Team','nolimit','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost'];(function(_0x388854,_0x5bc29d){var _0x3d7656=function(_0x2df368){while(--_0x2df368){_0x388854['push'](_0x388854['shift']());}};_0x3d7656(++_0x5bc29d);}(_0x6073,0x7d));var _0x3607=function(_0x47f9ea,_0x4ec3d2){_0x47f9ea=_0x47f9ea-0x0;var _0x43d80b=_0x6073[_0x47f9ea];return _0x43d80b;};'use strict';var emlformat=require(_0x3607('0x0'));var rimraf=require(_0x3607('0x1'));var zipdir=require(_0x3607('0x2'));var jsonpatch=require(_0x3607('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3607('0x4'));var util=require(_0x3607('0x5'));var path=require(_0x3607('0x6'));var sox=require(_0x3607('0x7'));var csv=require(_0x3607('0x8'));var ejs=require(_0x3607('0x9'));var fs=require('fs');var fs_extra=require(_0x3607('0xa'));var _=require(_0x3607('0xb'));var squel=require(_0x3607('0xc'));var crypto=require(_0x3607('0xd'));var jsforce=require(_0x3607('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3607('0xf'));var Redis=require(_0x3607('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3607('0x11'));var as=require(_0x3607('0x12'));var hardwareService=require(_0x3607('0x13'));var logger=require(_0x3607('0x14'))('api');var utils=require(_0x3607('0x15'));var config=require(_0x3607('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3607('0x17'))['db'];config['redis']=_[_0x3607('0x18')](config[_0x3607('0x19')],{'host':_0x3607('0x1a'),'port':0x18eb});var socket=require(_0x3607('0x1b'))(new Redis(config[_0x3607('0x19')]));require(_0x3607('0x1c'))[_0x3607('0x1d')](socket);var jayson=require(_0x3607('0x1e'));var client=jayson[_0x3607('0x1f')][_0x3607('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x30b852,_0x51d4eb,_0x834e82,_0xc62459){return new BPromise(function(_0x5c67c,_0x40091d){var _0x55c637=_0xc62459||client;return _0x55c637[_0x3607('0x21')](_0x30b852,_0x834e82)['then'](function(_0x29346c){logger[_0x3607('0x22')](_0x3607('0x23'),_0x51d4eb,_0x3607('0x24'));logger['debug'](_0x3607('0x25'),_0x51d4eb,_0x3607('0x24'),JSON[_0x3607('0x26')](_0x29346c));if(_0x29346c[_0x3607('0x27')]){if(_0x29346c[_0x3607('0x27')][_0x3607('0x28')]===0x1f4){logger[_0x3607('0x27')]('ChatQueue,\x20%s,\x20%s',_0x51d4eb,_0x29346c[_0x3607('0x27')][_0x3607('0x29')]);return _0x40091d(_0x29346c[_0x3607('0x27')]['message']);}logger[_0x3607('0x27')](_0x3607('0x23'),_0x51d4eb,_0x29346c[_0x3607('0x27')]['message']);return _0x5c67c(_0x29346c[_0x3607('0x27')]['message']);}else{logger[_0x3607('0x22')](_0x3607('0x23'),_0x51d4eb,_0x3607('0x24'));_0x5c67c(_0x29346c['result']['message']);}})['catch'](function(_0x18a258){logger[_0x3607('0x27')]('ChatQueue,\x20%s,\x20%s',_0x51d4eb,_0x18a258);_0x40091d(_0x18a258);});});}function respondWithStatusCode(_0x33bb07,_0x49b6a4){_0x49b6a4=_0x49b6a4||0xcc;return function(_0x4f6b9e){if(_0x4f6b9e){return _0x33bb07['sendStatus'](_0x49b6a4);}return _0x33bb07[_0x3607('0x2a')](_0x49b6a4)[_0x3607('0x2b')]();};}function respondWithResult(_0x56455d,_0x41a962){_0x41a962=_0x41a962||0xc8;return function(_0x3dcfc4){if(_0x3dcfc4){return _0x56455d[_0x3607('0x2a')](_0x41a962)[_0x3607('0x2c')](_0x3dcfc4);}};}function respondWithFilteredResult(_0x324e37,_0x588446){return function(_0x5a157f){if(_0x5a157f){var _0x1b07d9=typeof _0x588446[_0x3607('0x2d')]===_0x3607('0x2e')&&typeof _0x588446[_0x3607('0x2f')]===_0x3607('0x2e');var _0x3101b4=_0x5a157f['count'];var _0x502133=_0x1b07d9?0x0:_0x588446[_0x3607('0x2d')];var _0x64db45=_0x1b07d9?_0x5a157f['count']:_0x588446['offset']+_0x588446['limit'];var _0xb870b9;if(_0x64db45>=_0x3101b4){_0x64db45=_0x3101b4;_0xb870b9=0xc8;}else{_0xb870b9=0xce;}_0x324e37[_0x3607('0x2a')](_0xb870b9);return _0x324e37[_0x3607('0x30')](_0x3607('0x31'),_0x502133+'-'+_0x64db45+'/'+_0x3101b4)[_0x3607('0x2c')](_0x5a157f);}return null;};}function patchUpdates(_0x421e81){return function(_0x5235c6){try{jsonpatch[_0x3607('0x32')](_0x5235c6,_0x421e81,!![]);}catch(_0x382c25){return BPromise[_0x3607('0x33')](_0x382c25);}return _0x5235c6[_0x3607('0x34')]();};}function saveUpdates(_0x37d928,_0x532e40){return function(_0x5bdd0a){if(_0x5bdd0a){return _0x5bdd0a[_0x3607('0x35')](_0x37d928)[_0x3607('0x36')](function(_0x3051ab){return _0x3051ab;});}return null;};}function removeEntity(_0x59ea5f,_0x2c5a31){return function(_0x585422){if(_0x585422){return _0x585422[_0x3607('0x37')]()['then'](function(){var _0x5decad=_0x585422[_0x3607('0x38')]({'plain':!![]});var _0x1d55a7=_0x3607('0x39');return db[_0x3607('0x3a')][_0x3607('0x37')]({'where':{'type':_0x1d55a7,'resourceId':_0x5decad['id']}})[_0x3607('0x36')](function(){return _0x585422;});})[_0x3607('0x36')](function(){_0x59ea5f[_0x3607('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2828a4,_0xbd30d0){return function(_0x33ad10){if(!_0x33ad10){_0x2828a4[_0x3607('0x3b')](0x194);}return _0x33ad10;};}function handleError(_0xb276a1,_0x129827){_0x129827=_0x129827||0x1f4;return function(_0x16fd5b){logger[_0x3607('0x27')](_0x16fd5b[_0x3607('0x3c')]);if(_0x16fd5b['name']){delete _0x16fd5b['name'];}_0xb276a1[_0x3607('0x2a')](_0x129827)[_0x3607('0x3d')](_0x16fd5b);};}exports[_0x3607('0x3e')]=function(_0x4ee259,_0x2b91fb){var _0x1f04ce={},_0x15142e={},_0x648e7c={'count':0x0,'rows':[]};var _0x20c4d0=_[_0x3607('0x3f')](db['ChatQueue']['rawAttributes'],function(_0x415703){return{'name':_0x415703['fieldName'],'type':_0x415703['type'][_0x3607('0x40')]};});_0x15142e[_0x3607('0x41')]=_['map'](_0x20c4d0,_0x3607('0x42'));_0x15142e['query']=_[_0x3607('0x43')](_0x4ee259[_0x3607('0x44')]);_0x15142e['filters']=_['intersection'](_0x15142e[_0x3607('0x41')],_0x15142e[_0x3607('0x44')]);_0x1f04ce[_0x3607('0x45')]=_[_0x3607('0x46')](_0x15142e[_0x3607('0x41')],qs[_0x3607('0x47')](_0x4ee259[_0x3607('0x44')]['fields']));_0x1f04ce[_0x3607('0x45')]=_0x1f04ce['attributes'][_0x3607('0x48')]?_0x1f04ce[_0x3607('0x45')]:_0x15142e[_0x3607('0x41')];if(!_0x4ee259[_0x3607('0x44')][_0x3607('0x49')]('nolimit')){_0x1f04ce['limit']=qs[_0x3607('0x2f')](_0x4ee259[_0x3607('0x44')]['limit']);_0x1f04ce[_0x3607('0x2d')]=qs[_0x3607('0x2d')](_0x4ee259['query'][_0x3607('0x2d')]);}_0x1f04ce[_0x3607('0x4a')]=qs[_0x3607('0x4b')](_0x4ee259[_0x3607('0x44')]['sort']);_0x1f04ce['where']=qs[_0x3607('0x4c')](_['pick'](_0x4ee259['query'],_0x15142e[_0x3607('0x4c')]),_0x20c4d0);if(_0x4ee259[_0x3607('0x44')]['filter']){_0x1f04ce[_0x3607('0x4d')]=_[_0x3607('0x4e')](_0x1f04ce[_0x3607('0x4d')],{'$or':_[_0x3607('0x3f')](_0x20c4d0,function(_0x353782){if(_0x353782['type']!=='VIRTUAL'){var _0x595c8c={};_0x595c8c[_0x353782['name']]={'$like':'%'+_0x4ee259[_0x3607('0x44')]['filter']+'%'};return _0x595c8c;}})});}_0x1f04ce=_[_0x3607('0x4e')]({},_0x1f04ce,_0x4ee259[_0x3607('0x4f')]);var _0x351b2b={'where':_0x1f04ce[_0x3607('0x4d')]};return db[_0x3607('0x50')][_0x3607('0x51')](_0x351b2b)[_0x3607('0x36')](function(_0x27d4e0){_0x648e7c[_0x3607('0x51')]=_0x27d4e0;if(_0x4ee259[_0x3607('0x44')][_0x3607('0x52')]){_0x1f04ce[_0x3607('0x53')]=[{'all':!![]}];}return db[_0x3607('0x50')][_0x3607('0x54')](_0x1f04ce);})[_0x3607('0x36')](function(_0x46904b){_0x648e7c[_0x3607('0x55')]=_0x46904b;return _0x648e7c;})[_0x3607('0x36')](respondWithFilteredResult(_0x2b91fb,_0x1f04ce))[_0x3607('0x56')](handleError(_0x2b91fb,null));};exports[_0x3607('0x57')]=function(_0x3f0345,_0x5af441){var _0x522be2={'raw':!![],'where':{'id':_0x3f0345['params']['id']}},_0x4ab527={};_0x4ab527[_0x3607('0x41')]=_[_0x3607('0x43')](db[_0x3607('0x50')]['rawAttributes']);_0x4ab527['query']=_[_0x3607('0x43')](_0x3f0345[_0x3607('0x44')]);_0x4ab527[_0x3607('0x4c')]=_[_0x3607('0x46')](_0x4ab527[_0x3607('0x41')],_0x4ab527[_0x3607('0x44')]);_0x522be2[_0x3607('0x45')]=_['intersection'](_0x4ab527[_0x3607('0x41')],qs[_0x3607('0x47')](_0x3f0345[_0x3607('0x44')]['fields']));_0x522be2[_0x3607('0x45')]=_0x522be2[_0x3607('0x45')][_0x3607('0x48')]?_0x522be2[_0x3607('0x45')]:_0x4ab527[_0x3607('0x41')];if(_0x3f0345[_0x3607('0x44')][_0x3607('0x52')]){_0x522be2[_0x3607('0x53')]=[{'all':!![]}];}_0x522be2=_[_0x3607('0x4e')]({},_0x522be2,_0x3f0345[_0x3607('0x4f')]);return db['ChatQueue'][_0x3607('0x58')](_0x522be2)[_0x3607('0x36')](handleEntityNotFound(_0x5af441,null))['then'](respondWithResult(_0x5af441,null))[_0x3607('0x56')](handleError(_0x5af441,null));};exports[_0x3607('0x59')]=function(_0x37a8a7,_0x147b20){return db['ChatQueue'][_0x3607('0x59')](_0x37a8a7[_0x3607('0x5a')],{})[_0x3607('0x36')](function(_0x4f85be){var _0x4d896a=_0x37a8a7[_0x3607('0x5b')][_0x3607('0x38')]({'plain':!![]});if(!_0x4d896a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d896a[_0x3607('0x5c')]===_0x3607('0x5b')){var _0x476352=_0x4f85be['get']({'plain':!![]});var _0x16eeed=_0x3607('0x39');return db[_0x3607('0x5d')][_0x3607('0x58')]({'where':{'name':_0x16eeed,'userProfileId':_0x4d896a[_0x3607('0x5e')]},'raw':!![]})[_0x3607('0x36')](function(_0x566671){if(_0x566671&&_0x566671[_0x3607('0x5f')]===0x0){return db[_0x3607('0x3a')]['create']({'name':_0x476352[_0x3607('0x42')],'resourceId':_0x476352['id'],'type':_0x566671[_0x3607('0x42')],'sectionId':_0x566671['id']},{})[_0x3607('0x36')](function(){return _0x4f85be;});}else{return _0x4f85be;}})[_0x3607('0x56')](function(_0x474f75){logger[_0x3607('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x474f75);throw _0x474f75;});}return _0x4f85be;})['then'](respondWithResult(_0x147b20,0xc9))[_0x3607('0x56')](handleError(_0x147b20,null));};exports[_0x3607('0x35')]=function(_0x2f9c0f,_0x211927){if(_0x2f9c0f[_0x3607('0x5a')]['id']){delete _0x2f9c0f[_0x3607('0x5a')]['id'];}return db[_0x3607('0x50')]['find']({'where':{'id':_0x2f9c0f[_0x3607('0x60')]['id']}})[_0x3607('0x36')](handleEntityNotFound(_0x211927,null))[_0x3607('0x36')](saveUpdates(_0x2f9c0f[_0x3607('0x5a')],null))[_0x3607('0x36')](respondWithResult(_0x211927,null))[_0x3607('0x56')](handleError(_0x211927,null));};exports['destroy']=function(_0x37f584,_0x1ee026){return db[_0x3607('0x50')][_0x3607('0x58')]({'where':{'id':_0x37f584[_0x3607('0x60')]['id']}})[_0x3607('0x36')](handleEntityNotFound(_0x1ee026,null))[_0x3607('0x36')](removeEntity(_0x1ee026,null))[_0x3607('0x56')](handleError(_0x1ee026,null));};exports[_0x3607('0x61')]=function(_0x1520cd,_0xcb73c5){return db[_0x3607('0x50')][_0x3607('0x61')]()[_0x3607('0x36')](respondWithResult(_0xcb73c5,null))[_0x3607('0x56')](handleError(_0xcb73c5,null));};exports['getMembers']=function(_0x3a00b7,_0x3bad72,_0x39b59b){var _0x4b6faa={'raw':!![],'where':{}},_0x178159={},_0x188819;return db[_0x3607('0x50')][_0x3607('0x62')]({'where':{'id':_0x3a00b7['params']['id']}})[_0x3607('0x36')](handleEntityNotFound(_0x3bad72,null))[_0x3607('0x36')](function(_0x2f4112){if(_0x2f4112){_0x188819=_0x2f4112[_0x3607('0x38')]({'plain':!![]});_0x178159[_0x3607('0x41')]=_[_0x3607('0x43')](db[_0x3607('0x63')][_0x3607('0x64')]);_0x178159[_0x3607('0x44')]=_['keys'](_0x3a00b7['query']);_0x178159[_0x3607('0x4c')]=_[_0x3607('0x46')](_0x178159[_0x3607('0x41')],_0x178159[_0x3607('0x44')]);_0x4b6faa[_0x3607('0x45')]=_[_0x3607('0x46')](_0x178159[_0x3607('0x41')],qs['fields'](_0x3a00b7['query']['fields']));_0x4b6faa['attributes']=_0x4b6faa[_0x3607('0x45')][_0x3607('0x48')]?_0x4b6faa[_0x3607('0x45')]:_0x178159[_0x3607('0x41')];if(!_0x3a00b7[_0x3607('0x44')][_0x3607('0x49')]('nolimit')){_0x4b6faa[_0x3607('0x2f')]=qs[_0x3607('0x2f')](_0x3a00b7[_0x3607('0x44')][_0x3607('0x2f')]);_0x4b6faa['offset']=qs[_0x3607('0x2d')](_0x3a00b7[_0x3607('0x44')][_0x3607('0x2d')]);}_0x4b6faa[_0x3607('0x4a')]=qs['sort'](_0x3a00b7[_0x3607('0x44')][_0x3607('0x4b')]);_0x4b6faa['where']=qs[_0x3607('0x4c')](_[_0x3607('0x65')](_0x3a00b7[_0x3607('0x44')],_0x178159[_0x3607('0x4c')]));_0x4b6faa['where'][_0x3607('0x66')]=_0x2f4112['id'];if(_0x3a00b7['query']['filter']){_0x4b6faa[_0x3607('0x4d')]=_['merge'](_0x4b6faa[_0x3607('0x4d')],{'$or':_[_0x3607('0x3f')](_0x4b6faa[_0x3607('0x45')],function(_0x416055){var _0x46591b={};_0x46591b[_0x416055]={'$like':'%'+_0x3a00b7['query'][_0x3607('0x67')]+'%'};return _0x46591b;})});}_0x4b6faa=_[_0x3607('0x4e')]({},_0x4b6faa,_0x3a00b7[_0x3607('0x4f')]);return db[_0x3607('0x63')][_0x3607('0x54')](_0x4b6faa);}})[_0x3607('0x36')](function(_0x52de51){if(_0x52de51){return db['User']['findAndCountAll']({'where':{'id':_[_0x3607('0x3f')](_0x52de51,'UserId'),'role':'agent'},'attributes':['id',_0x3607('0x42'),'chatPause',_0x3607('0x68'),_0x3607('0x69')]});}})[_0x3607('0x36')](function(_0x11a8a5){if(_0x11a8a5){return{'count':_0x11a8a5[_0x3607('0x51')],'rows':_[_0x3607('0x3f')](_0x11a8a5[_0x3607('0x55')],function(_0x53cf0f){return{'membername':_0x53cf0f[_0x3607('0x42')],'UserId':_0x53cf0f['id'],'queue_name':_0x188819[_0x3607('0x42')],'ChatQueueId':_0x188819['id'],'interface':util[_0x3607('0x6a')]('%s/%s',_0x3607('0x6b'),_0x53cf0f[_0x3607('0x42')]),'penalty':0x0,'paused':_0x53cf0f[_0x3607('0x6c')],'createdAt':_0x53cf0f[_0x3607('0x69')],'updatedAt':_0x53cf0f[_0x3607('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x3607('0x36')](respondWithFilteredResult(_0x3bad72,_0x4b6faa))[_0x3607('0x56')](handleError(_0x3bad72,null));};exports[_0x3607('0x6d')]=function(_0x2d6cf1,_0x5ecc7c,_0x3c57f6){var _0x554e03={};var _0x392f09={};var _0x442131;var _0x1435a0;return db[_0x3607('0x50')]['findOne']({'where':{'id':_0x2d6cf1[_0x3607('0x60')]['id']}})[_0x3607('0x36')](handleEntityNotFound(_0x5ecc7c,null))[_0x3607('0x36')](function(_0x6603f4){if(_0x6603f4){_0x442131=_0x6603f4;_0x392f09[_0x3607('0x41')]=_[_0x3607('0x43')](db[_0x3607('0x6e')][_0x3607('0x64')]);_0x392f09['query']=_['keys'](_0x2d6cf1[_0x3607('0x44')]);_0x392f09[_0x3607('0x4c')]=_[_0x3607('0x46')](_0x392f09[_0x3607('0x41')],_0x392f09[_0x3607('0x44')]);_0x554e03[_0x3607('0x45')]=_[_0x3607('0x46')](_0x392f09[_0x3607('0x41')],qs[_0x3607('0x47')](_0x2d6cf1['query'][_0x3607('0x47')]));_0x554e03[_0x3607('0x45')]=_0x554e03[_0x3607('0x45')][_0x3607('0x48')]?_0x554e03[_0x3607('0x45')]:_0x392f09[_0x3607('0x41')];_0x554e03[_0x3607('0x4a')]=qs[_0x3607('0x4b')](_0x2d6cf1[_0x3607('0x44')][_0x3607('0x4b')]);_0x554e03[_0x3607('0x4d')]=qs[_0x3607('0x4c')](_[_0x3607('0x65')](_0x2d6cf1[_0x3607('0x44')],_0x392f09['filters']));if(_0x2d6cf1[_0x3607('0x44')]['filter']){_0x554e03[_0x3607('0x4d')]=_[_0x3607('0x4e')](_0x554e03[_0x3607('0x4d')],{'$or':_[_0x3607('0x3f')](_0x554e03[_0x3607('0x45')],function(_0x505737){var _0x19d878={};_0x19d878[_0x505737]={'$like':'%'+_0x2d6cf1['query'][_0x3607('0x67')]+'%'};return _0x19d878;})});}_0x554e03=_['merge']({},_0x554e03,_0x2d6cf1[_0x3607('0x4f')]);return _0x442131[_0x3607('0x6d')](_0x554e03);}})[_0x3607('0x36')](function(_0x3f20b6){if(_0x3f20b6){_0x1435a0=_0x3f20b6[_0x3607('0x48')];if(!_0x2d6cf1[_0x3607('0x44')]['hasOwnProperty'](_0x3607('0x6f'))){_0x554e03[_0x3607('0x2f')]=qs['limit'](_0x2d6cf1[_0x3607('0x44')][_0x3607('0x2f')]);_0x554e03[_0x3607('0x2d')]=qs[_0x3607('0x2d')](_0x2d6cf1[_0x3607('0x44')]['offset']);}return _0x442131[_0x3607('0x6d')](_0x554e03);}})[_0x3607('0x36')](function(_0x4f29d2){if(_0x4f29d2){return _0x4f29d2?{'count':_0x1435a0,'rows':_0x4f29d2}:null;}})[_0x3607('0x36')](respondWithResult(_0x5ecc7c,null))[_0x3607('0x56')](handleError(_0x5ecc7c,null));};exports[_0x3607('0x70')]=function(_0x41e5ae,_0x37ee32,_0x2671e5){var _0x308469=_0x41e5ae['body'][_0x3607('0x71')];return db[_0x3607('0x6e')]['findAll']({'where':{'id':_0x308469},'attributes':['id'],'include':[{'model':db[_0x3607('0x72')],'as':_0x3607('0x73'),'attributes':['id',_0x3607('0x42'),_0x3607('0x74'),'voicePause',_0x3607('0x75')],'raw':!![]}]})['then'](function(_0x33701d){if(_0x33701d){var _0x5be05a=_[_0x3607('0x76')](_0x33701d,function(_0x3b62db){var _0x4a7de3=_0x3b62db[_0x3607('0x38')]({'plain':!![]});return _0x4a7de3[_0x3607('0x73')];});return db[_0x3607('0x50')][_0x3607('0x58')]({'where':{'id':_0x41e5ae[_0x3607('0x60')]['id']}})[_0x3607('0x36')](function(_0x5d8696){return db[_0x3607('0x77')][_0x3607('0x78')](function(_0x32164a){return _0x5d8696[_0x3607('0x70')](_0x308469,{'transaction':_0x32164a})[_0x3607('0x36')](function(){return BPromise[_0x3607('0x79')](_0x5be05a,function(_0xe6fb57){return db['UserChatQueue'][_0x3607('0x7a')]({'where':{'UserId':_0xe6fb57['id'],'ChatQueueId':_0x41e5ae['params']['id']},'transaction':_0x32164a});});})[_0x3607('0x36')](function(){_0x5be05a[_0x3607('0x7b')](function(_0x1ac030){socket[_0x3607('0x7c')]('userChatQueue:save',{'UserId':_0x1ac030['id'],'ChatQueueId':_0x5d8696['id']});});});});});}})['then'](respondWithStatusCode(_0x37ee32,null))['catch'](handleError(_0x37ee32,null));};exports['removeTeams']=function(_0x429b98,_0x2ad9fc,_0x14b2d4){return db[_0x3607('0x6e')][_0x3607('0x54')]({'where':{'id':_0x429b98[_0x3607('0x44')][_0x3607('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3607('0x73'),'attributes':['id'],'raw':!![]}]})[_0x3607('0x36')](handleEntityNotFound(_0x2ad9fc,null))[_0x3607('0x36')](function(_0x527ade){var _0x567d19=_[_0x3607('0x3f')](_0x527ade,'id');var _0x1fc383=[];var _0x5da358=[];var _0x33029d=squel[_0x3607('0x7d')]();_0x33029d[_0x3607('0x7e')]('tq.TeamId')[_0x3607('0x7f')](_0x3607('0x80'),'tq')[_0x3607('0x81')](_0x3607('0x82'),'ut',_0x3607('0x83'))[_0x3607('0x4d')](_0x3607('0x84'),_0x429b98[_0x3607('0x60')]['id']);for(var _0x198279=0x0;_0x198279<_0x527ade[_0x3607('0x48')];_0x198279+=0x1){let _0x2000e3=_0x527ade[_0x198279];for(var _0x1732cd=0x0;_0x1732cd<_0x2000e3[_0x3607('0x73')]['length'];_0x1732cd+=0x1){let _0x242743=_0x2000e3[_0x3607('0x73')][_0x1732cd];var _0x54ac13=_0x33029d['clone']();_0x54ac13[_0x3607('0x4d')](_0x3607('0x85'),_0x242743['id']);_0x5da358[_0x3607('0x86')](db[_0x3607('0x77')][_0x3607('0x44')](_0x54ac13[_0x3607('0x87')](),{'type':db['sequelize'][_0x3607('0x88')][_0x3607('0x89')]})[_0x3607('0x36')](function(_0x26f364){if(_0x26f364[_0x3607('0x48')]===0x1){return _0x242743['id'];}else{var _0x4e0cf4=_[_0x3607('0x8a')](_[_0x3607('0x3f')](_0x26f364,'TeamId'),function(_0x378e05){return _[_0x3607('0x8b')](_0x567d19,_0x378e05);});if(_0x4e0cf4){return _0x242743['id'];}}}));}}return BPromise['all'](_0x5da358)[_0x3607('0x36')](function(_0x46abdd){_0x1fc383=_(_0x1fc383)[_0x3607('0x8c')](_0x46abdd)[_0x3607('0x8d')]()[_0x3607('0x8e')]();return db['ChatQueue'][_0x3607('0x58')]({'where':{'id':_0x429b98[_0x3607('0x60')]['id']}})[_0x3607('0x36')](function(_0x29f6d3){return db['sequelize']['transaction'](function(_0xbff4a9){return _0x29f6d3[_0x3607('0x8f')](_0x429b98[_0x3607('0x44')][_0x3607('0x71')],{'transaction':_0xbff4a9})[_0x3607('0x36')](function(){if(!_[_0x3607('0x90')](_0x1fc383)){return _0x29f6d3[_0x3607('0x91')](_0x1fc383,{'transaction':_0xbff4a9});}})[_0x3607('0x36')](function(){_0x1fc383['forEach'](function(_0x21c7a1){socket['emit'](_0x3607('0x92'),{'UserId':_0x21c7a1,'ChatQueueId':_0x29f6d3['id']});});});});});});})[_0x3607('0x36')](respondWithStatusCode(_0x2ad9fc,null))[_0x3607('0x56')](handleError(_0x2ad9fc,null));};exports[_0x3607('0x93')]=function(_0x908649,_0x2ff03d,_0x17b733){return db[_0x3607('0x50')][_0x3607('0x58')]({'where':{'id':_0x908649[_0x3607('0x60')]['id']}})['then'](handleEntityNotFound(_0x2ff03d,null))[_0x3607('0x36')](function(_0x33d9f4){if(_0x33d9f4){return _0x33d9f4[_0x3607('0x93')](_0x908649[_0x3607('0x5a')]['ids'],_[_0x3607('0x94')](_0x908649[_0x3607('0x5a')],[_0x3607('0x71'),'id'])||{})[_0x3607('0x95')](function(_0x5f2da0){for(var _0x485435=0x0;_0x485435<_0x908649[_0x3607('0x5a')]['ids']['length'];_0x485435+=0x1){socket[_0x3607('0x7c')]('userChatQueue:save',{'UserId':Number(_0x908649[_0x3607('0x5a')]['ids'][_0x485435]),'ChatQueueId':Number(_0x908649['params']['id'])});}return _0x5f2da0;});}})[_0x3607('0x36')](respondWithResult(_0x2ff03d,null))[_0x3607('0x56')](handleError(_0x2ff03d,null));};exports[_0x3607('0x91')]=function(_0x5ba155,_0x1e9538,_0x156f83){return db[_0x3607('0x50')]['find']({'where':{'id':_0x5ba155[_0x3607('0x60')]['id']}})[_0x3607('0x36')](handleEntityNotFound(_0x1e9538,null))[_0x3607('0x36')](function(_0x3040bf){if(_0x3040bf){return _0x3040bf[_0x3607('0x91')](_0x5ba155[_0x3607('0x44')]['ids'])['then'](function(){if(_[_0x3607('0x96')](_0x5ba155[_0x3607('0x44')]['ids'])){for(var _0x11dde2=0x0;_0x11dde2<_0x5ba155[_0x3607('0x44')][_0x3607('0x71')][_0x3607('0x48')];_0x11dde2+=0x1){socket[_0x3607('0x7c')](_0x3607('0x92'),{'UserId':Number(_0x5ba155[_0x3607('0x44')][_0x3607('0x71')][_0x11dde2]),'ChatQueueId':Number(_0x5ba155[_0x3607('0x60')]['id'])});}}else{socket[_0x3607('0x7c')](_0x3607('0x92'),{'UserId':Number(_0x5ba155['query'][_0x3607('0x71')]),'ChatQueueId':Number(_0x5ba155['params']['id'])});}});}})[_0x3607('0x36')](respondWithStatusCode(_0x1e9538,null))[_0x3607('0x56')](handleError(_0x1e9538,null));};exports[_0x3607('0x97')]=function(_0x52d52f,_0x26b7db,_0x146e13){var _0x1e416f={};var _0x28a3c2={};var _0x48453a;var _0x251451;return db['ChatQueue'][_0x3607('0x62')]({'where':{'id':_0x52d52f['params']['id']}})['then'](handleEntityNotFound(_0x26b7db,null))['then'](function(_0x48f9a1){if(_0x48f9a1){_0x48453a=_0x48f9a1;_0x28a3c2[_0x3607('0x41')]=_[_0x3607('0x43')](db[_0x3607('0x72')][_0x3607('0x64')]);_0x28a3c2[_0x3607('0x44')]=_['keys'](_0x52d52f[_0x3607('0x44')]);_0x28a3c2['filters']=_['intersection'](_0x28a3c2[_0x3607('0x41')],_0x28a3c2[_0x3607('0x44')]);_0x1e416f[_0x3607('0x45')]=_[_0x3607('0x46')](_0x28a3c2[_0x3607('0x41')],qs[_0x3607('0x47')](_0x52d52f['query'][_0x3607('0x47')]));_0x1e416f[_0x3607('0x45')]=_0x1e416f['attributes'][_0x3607('0x48')]?_0x1e416f[_0x3607('0x45')]:_0x28a3c2['model'];_0x1e416f[_0x3607('0x4a')]=qs['sort'](_0x52d52f[_0x3607('0x44')][_0x3607('0x4b')]);_0x1e416f[_0x3607('0x4d')]=qs[_0x3607('0x4c')](_[_0x3607('0x65')](_0x52d52f[_0x3607('0x44')],_0x28a3c2[_0x3607('0x4c')]));if(_0x52d52f[_0x3607('0x44')][_0x3607('0x67')]){_0x1e416f[_0x3607('0x4d')]=_['merge'](_0x1e416f[_0x3607('0x4d')],{'$or':_['map'](_0x1e416f[_0x3607('0x45')],function(_0x11dd34){var _0x3acfee={};_0x3acfee[_0x11dd34]={'$like':'%'+_0x52d52f['query']['filter']+'%'};return _0x3acfee;})});}_0x1e416f=_[_0x3607('0x4e')]({},_0x1e416f,_0x52d52f[_0x3607('0x4f')]);return _0x48453a['getAgents'](_0x1e416f);}})[_0x3607('0x36')](function(_0x3be829){if(_0x3be829){_0x251451=_0x3be829[_0x3607('0x48')];if(!_0x52d52f[_0x3607('0x44')][_0x3607('0x49')](_0x3607('0x6f'))){_0x1e416f[_0x3607('0x2f')]=qs[_0x3607('0x2f')](_0x52d52f[_0x3607('0x44')][_0x3607('0x2f')]);_0x1e416f[_0x3607('0x2d')]=qs[_0x3607('0x2d')](_0x52d52f[_0x3607('0x44')]['offset']);}return _0x48453a['getAgents'](_0x1e416f);}})[_0x3607('0x36')](function(_0x725954){if(_0x725954){return _0x725954?{'count':_0x251451,'rows':_0x725954}:null;}})[_0x3607('0x36')](respondWithResult(_0x26b7db,null))[_0x3607('0x56')](handleError(_0x26b7db,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 9c9ef94..42b8de5 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 _0x01ab=['events','../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x7eab53,_0x2b8714){var _0xe489d=function(_0x63d657){while(--_0x63d657){_0x7eab53['push'](_0x7eab53['shift']());}};_0xe489d(++_0x2b8714);}(_0x01ab,0xaa));var _0xb01a=function(_0x241c21,_0x11b64b){_0x241c21=_0x241c21-0x0;var _0x1ffb9e=_0x01ab[_0x241c21];return _0x1ffb9e;};'use strict';var EventEmitter=require(_0xb01a('0x0'));var ChatQueue=require(_0xb01a('0x1'))['db'][_0xb01a('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb01a('0x3'),'afterUpdate':_0xb01a('0x4'),'afterDestroy':_0xb01a('0x5')};function emitEvent(_0x296e28){return function(_0x1b642d,_0x3974ea,_0xe75b33){ChatQueueEvents[_0xb01a('0x6')](_0x296e28+':'+_0x1b642d['id'],_0x1b642d);ChatQueueEvents[_0xb01a('0x6')](_0x296e28,_0x1b642d);_0xe75b33(null);};}for(var e in events){if(events[_0xb01a('0x7')](e)){var event=events[e];ChatQueue[_0xb01a('0x8')](e,emitEvent(event));}}module[_0xb01a('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xb584=['exports','../../mysqldb','ChatQueue','save','update','emit','hasOwnProperty','hook'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0xb584,0x91));var _0x4b58=function(_0x37580d,_0x10bbb2){_0x37580d=_0x37580d-0x0;var _0x5d3886=_0xb584[_0x37580d];return _0x5d3886;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4b58('0x0'))['db'][_0x4b58('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4b58('0x2'),'afterUpdate':_0x4b58('0x3'),'afterDestroy':'remove'};function emitEvent(_0x552a5c){return function(_0x29f392,_0x11b1bf,_0x3d6733){ChatQueueEvents[_0x4b58('0x4')](_0x552a5c+':'+_0x29f392['id'],_0x29f392);ChatQueueEvents[_0x4b58('0x4')](_0x552a5c,_0x29f392);_0x3d6733(null);};}for(var e in events){if(events[_0x4b58('0x5')](e)){var event=events[e];ChatQueue[_0x4b58('0x6')](e,emitEvent(event));}}module[_0x4b58('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index c5885a3..f68e998 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 _0x7c0d=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x2f3d9f,_0x376b82){var _0x2e28d0=function(_0x521731){while(--_0x521731){_0x2f3d9f['push'](_0x2f3d9f['shift']());}};_0x2e28d0(++_0x376b82);}(_0x7c0d,0x11e));var _0xd7c0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7c0d[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd7c0('0x0'));var util=require('util');var logger=require(_0xd7c0('0x1'))(_0xd7c0('0x2'));var moment=require(_0xd7c0('0x3'));var BPromise=require(_0xd7c0('0x4'));var rp=require(_0xd7c0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7c0('0x6'));var config=require('../../config/environment');var attributes=require(_0xd7c0('0x7'));module[_0xd7c0('0x8')]=function(_0x2ffc46,_0x4f73f8){return _0x2ffc46[_0xd7c0('0x9')](_0xd7c0('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe839=['util','moment','bluebird','request-promise','rimraf','./chatQueue.attributes','exports','ChatQueue','lodash'];(function(_0x5df61d,_0x158640){var _0x24cc4c=function(_0x2de006){while(--_0x2de006){_0x5df61d['push'](_0x5df61d['shift']());}};_0x24cc4c(++_0x158640);}(_0xe839,0x143));var _0x9e83=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0xe839[_0x59f0dc];return _0x5b5445;};'use strict';var _=require(_0x9e83('0x0'));var util=require(_0x9e83('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9e83('0x2'));var BPromise=require(_0x9e83('0x3'));var rp=require(_0x9e83('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e83('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e83('0x6'));module[_0x9e83('0x7')]=function(_0x4fc4a6,_0x109786){return _0x4fc4a6['define'](_0x9e83('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 b8a1458..b0252c1 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 _0x6c9c=['client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','attributes','map','then','ShowChatQueue','find','model','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x6c9c,0x12a));var _0xc6c9=function(_0xff721f,_0x2cb568){_0xff721f=_0xff721f-0x0;var _0x15ec8e=_0x6c9c[_0xff721f];return _0x15ec8e;};'use strict';var _=require(_0xc6c9('0x0'));var util=require(_0xc6c9('0x1'));var moment=require('moment');var BPromise=require(_0xc6c9('0x2'));var rs=require(_0xc6c9('0x3'));var fs=require('fs');var Redis=require(_0xc6c9('0x4'));var db=require(_0xc6c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6c9('0x6'))(_0xc6c9('0x7'));var config=require(_0xc6c9('0x8'));var jayson=require(_0xc6c9('0x9'));var client=jayson[_0xc6c9('0xa')][_0xc6c9('0xb')]({'port':0x232a});config[_0xc6c9('0xc')]=_[_0xc6c9('0xd')](config[_0xc6c9('0xc')],{'host':_0xc6c9('0xe'),'port':0x18eb});var socket=require(_0xc6c9('0xf'))(new Redis(config[_0xc6c9('0xc')]));require(_0xc6c9('0x10'))[_0xc6c9('0x11')](socket);function respondWithRpcPromise(_0x2fb627,_0x10a3d4,_0x190435){return new BPromise(function(_0x239e72,_0x577848){return client[_0xc6c9('0x12')](_0x2fb627,_0x190435)['then'](function(_0x5aac6b){logger['info'](_0xc6c9('0x13'),_0x10a3d4,_0xc6c9('0x14'));logger[_0xc6c9('0x15')](_0xc6c9('0x16'),_0x10a3d4,_0xc6c9('0x14'),JSON[_0xc6c9('0x17')](_0x5aac6b));if(_0x5aac6b['error']){if(_0x5aac6b['error'][_0xc6c9('0x18')]===0x1f4){logger[_0xc6c9('0x19')](_0xc6c9('0x13'),_0x10a3d4,_0x5aac6b[_0xc6c9('0x19')][_0xc6c9('0x1a')]);return _0x577848(_0x5aac6b[_0xc6c9('0x19')]['message']);}logger[_0xc6c9('0x19')](_0xc6c9('0x13'),_0x10a3d4,_0x5aac6b[_0xc6c9('0x19')][_0xc6c9('0x1a')]);return _0x239e72(_0x5aac6b[_0xc6c9('0x19')][_0xc6c9('0x1a')]);}else{logger[_0xc6c9('0x1b')](_0xc6c9('0x13'),_0x10a3d4,_0xc6c9('0x14'));_0x239e72(_0x5aac6b[_0xc6c9('0x1c')][_0xc6c9('0x1a')]);}})['catch'](function(_0x5e5dd0){logger[_0xc6c9('0x19')](_0xc6c9('0x13'),_0x10a3d4,_0x5e5dd0);_0x577848(_0x5e5dd0);});});}exports[_0xc6c9('0x1d')]=function(_0x5153c3){var _0x49a9bd=this;return new Promise(function(_0x5617c7,_0x5f0733){return db[_0xc6c9('0x1e')][_0xc6c9('0x1f')]({'raw':_0x5153c3[_0xc6c9('0x20')]?_0x5153c3[_0xc6c9('0x20')][_0xc6c9('0x21')]===undefined?!![]:![]:!![],'where':_0x5153c3['options']?_0x5153c3[_0xc6c9('0x20')][_0xc6c9('0x22')]||null:null,'attributes':_0x5153c3['options']?_0x5153c3['options']['attributes']||null:null,'limit':_0x5153c3[_0xc6c9('0x20')]?_0x5153c3[_0xc6c9('0x20')][_0xc6c9('0x23')]||null:null,'include':_0x5153c3[_0xc6c9('0x20')]?_0x5153c3[_0xc6c9('0x20')]['include']?_['map'](_0x5153c3[_0xc6c9('0x20')][_0xc6c9('0x24')],function(_0x3ab712){return{'model':db[_0x3ab712['model']],'as':_0x3ab712['as'],'attributes':_0x3ab712[_0xc6c9('0x25')],'include':_0x3ab712[_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x3ab712['include'],function(_0x4ee416){return{'model':db[_0x4ee416['model']],'as':_0x4ee416['as'],'attributes':_0x4ee416[_0xc6c9('0x25')],'include':_0x4ee416[_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x4ee416[_0xc6c9('0x24')],function(_0x460fb5){return{'model':db[_0x460fb5['model']],'as':_0x460fb5['as'],'attributes':_0x460fb5[_0xc6c9('0x25')]};}):[]};}):[]};}):[]:[]})[_0xc6c9('0x27')](function(_0x5a6848){logger[_0xc6c9('0x1b')](_0xc6c9('0x1d'),_0x5153c3);logger[_0xc6c9('0x15')](_0xc6c9('0x1d'),_0x5153c3,JSON[_0xc6c9('0x17')](_0x5a6848));_0x5617c7(_0x5a6848);})['catch'](function(_0x31e08c){logger[_0xc6c9('0x19')](_0xc6c9('0x1d'),_0x31e08c['message'],_0x5153c3);_0x5f0733(_0x49a9bd[_0xc6c9('0x19')](0x1f4,_0x31e08c[_0xc6c9('0x1a')]));});});};exports[_0xc6c9('0x28')]=function(_0x3e1ea8){var _0x465f9c=this;return new Promise(function(_0x39cb25,_0x1b6fd7){return db[_0xc6c9('0x1e')][_0xc6c9('0x29')]({'raw':_0x3e1ea8[_0xc6c9('0x20')]?_0x3e1ea8['options'][_0xc6c9('0x21')]===undefined?!![]:![]:!![],'where':_0x3e1ea8['options']?_0x3e1ea8[_0xc6c9('0x20')]['where']||null:null,'attributes':_0x3e1ea8['options']?_0x3e1ea8[_0xc6c9('0x20')][_0xc6c9('0x25')]||null:null,'include':_0x3e1ea8[_0xc6c9('0x20')]?_0x3e1ea8['options'][_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x3e1ea8[_0xc6c9('0x20')][_0xc6c9('0x24')],function(_0x34dcc1){return{'model':db[_0x34dcc1['model']],'as':_0x34dcc1['as'],'attributes':_0x34dcc1[_0xc6c9('0x25')],'include':_0x34dcc1[_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x34dcc1['include'],function(_0x2e3b2c){return{'model':db[_0x2e3b2c[_0xc6c9('0x2a')]],'as':_0x2e3b2c['as'],'attributes':_0x2e3b2c[_0xc6c9('0x25')],'include':_0x2e3b2c[_0xc6c9('0x24')]?_[_0xc6c9('0x26')](_0x2e3b2c[_0xc6c9('0x24')],function(_0x375576){return{'model':db[_0x375576[_0xc6c9('0x2a')]],'as':_0x375576['as'],'attributes':_0x375576[_0xc6c9('0x25')]};}):[]};}):[]};}):[]:[]})[_0xc6c9('0x27')](function(_0x126785){logger['info'](_0xc6c9('0x28'),_0x3e1ea8);logger[_0xc6c9('0x15')](_0xc6c9('0x28'),_0x3e1ea8,JSON[_0xc6c9('0x17')](_0x126785));_0x39cb25(_0x126785);})[_0xc6c9('0x2b')](function(_0xfc8f67){logger[_0xc6c9('0x19')](_0xc6c9('0x28'),_0xfc8f67['message'],_0x3e1ea8);_0x1b6fd7(_0x465f9c[_0xc6c9('0x19')](0x1f4,_0xfc8f67['message']));});});}; \ No newline at end of file +var _0x0993=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetChatQueue','findAll','options','raw','attributes','limit','include','ShowChatQueue','find','where','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request'];(function(_0x9aacf6,_0x2fc689){var _0x36d4ea=function(_0x1fd49b){while(--_0x1fd49b){_0x9aacf6['push'](_0x9aacf6['shift']());}};_0x36d4ea(++_0x2fc689);}(_0x0993,0x81));var _0x3099=function(_0x4f85d6,_0x4a6847){_0x4f85d6=_0x4f85d6-0x0;var _0x2ffcc3=_0x0993[_0x4f85d6];return _0x2ffcc3;};'use strict';var _=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var moment=require(_0x3099('0x2'));var BPromise=require(_0x3099('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3099('0x4'));var db=require(_0x3099('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3099('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3099('0x7'));var client=jayson[_0x3099('0x8')][_0x3099('0x9')]({'port':0x232a});config[_0x3099('0xa')]=_[_0x3099('0xb')](config[_0x3099('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3099('0xc'))(new Redis(config[_0x3099('0xa')]));require(_0x3099('0xd'))['register'](socket);function respondWithRpcPromise(_0x42541f,_0x1851ac,_0x119a10){return new BPromise(function(_0x19e29f,_0x151257){return client[_0x3099('0xe')](_0x42541f,_0x119a10)[_0x3099('0xf')](function(_0xd89d1f){logger[_0x3099('0x10')](_0x3099('0x11'),_0x1851ac,_0x3099('0x12'));logger[_0x3099('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x1851ac,_0x3099('0x12'),JSON[_0x3099('0x14')](_0xd89d1f));if(_0xd89d1f[_0x3099('0x15')]){if(_0xd89d1f[_0x3099('0x15')]['code']===0x1f4){logger[_0x3099('0x15')](_0x3099('0x11'),_0x1851ac,_0xd89d1f[_0x3099('0x15')][_0x3099('0x16')]);return _0x151257(_0xd89d1f[_0x3099('0x15')][_0x3099('0x16')]);}logger['error'](_0x3099('0x11'),_0x1851ac,_0xd89d1f['error'][_0x3099('0x16')]);return _0x19e29f(_0xd89d1f['error']['message']);}else{logger[_0x3099('0x10')]('ChatQueue,\x20%s,\x20%s',_0x1851ac,_0x3099('0x12'));_0x19e29f(_0xd89d1f['result'][_0x3099('0x16')]);}})[_0x3099('0x17')](function(_0xb44433){logger[_0x3099('0x15')](_0x3099('0x11'),_0x1851ac,_0xb44433);_0x151257(_0xb44433);});});}exports[_0x3099('0x18')]=function(_0x2632bd){var _0xeddbf=this;return new Promise(function(_0x5a2150,_0x2224a5){return db['ChatQueue'][_0x3099('0x19')]({'raw':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')][_0x3099('0x1b')]===undefined?!![]:![]:!![],'where':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')]['where']||null:null,'attributes':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')][_0x3099('0x1c')]||null:null,'limit':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')][_0x3099('0x1d')]||null:null,'include':_0x2632bd[_0x3099('0x1a')]?_0x2632bd[_0x3099('0x1a')][_0x3099('0x1e')]?_['map'](_0x2632bd['options']['include'],function(_0x1b5c53){return{'model':db[_0x1b5c53['model']],'as':_0x1b5c53['as'],'attributes':_0x1b5c53['attributes'],'include':_0x1b5c53[_0x3099('0x1e')]?_['map'](_0x1b5c53[_0x3099('0x1e')],function(_0x4154b8){return{'model':db[_0x4154b8['model']],'as':_0x4154b8['as'],'attributes':_0x4154b8[_0x3099('0x1c')],'include':_0x4154b8[_0x3099('0x1e')]?_['map'](_0x4154b8[_0x3099('0x1e')],function(_0x4f3678){return{'model':db[_0x4f3678['model']],'as':_0x4f3678['as'],'attributes':_0x4f3678[_0x3099('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3099('0xf')](function(_0x1d77ed){logger[_0x3099('0x10')]('GetChatQueue',_0x2632bd);logger[_0x3099('0x13')](_0x3099('0x18'),_0x2632bd,JSON[_0x3099('0x14')](_0x1d77ed));_0x5a2150(_0x1d77ed);})[_0x3099('0x17')](function(_0x5a8912){logger[_0x3099('0x15')]('GetChatQueue',_0x5a8912[_0x3099('0x16')],_0x2632bd);_0x2224a5(_0xeddbf[_0x3099('0x15')](0x1f4,_0x5a8912[_0x3099('0x16')]));});});};exports[_0x3099('0x1f')]=function(_0x4c98c5){var _0x2786ac=this;return new Promise(function(_0x4d6563,_0x44e36e){return db['ChatQueue'][_0x3099('0x20')]({'raw':_0x4c98c5[_0x3099('0x1a')]?_0x4c98c5[_0x3099('0x1a')][_0x3099('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c98c5['options']?_0x4c98c5[_0x3099('0x1a')][_0x3099('0x21')]||null:null,'attributes':_0x4c98c5[_0x3099('0x1a')]?_0x4c98c5[_0x3099('0x1a')][_0x3099('0x1c')]||null:null,'include':_0x4c98c5[_0x3099('0x1a')]?_0x4c98c5[_0x3099('0x1a')][_0x3099('0x1e')]?_[_0x3099('0x22')](_0x4c98c5[_0x3099('0x1a')][_0x3099('0x1e')],function(_0x522284){return{'model':db[_0x522284[_0x3099('0x23')]],'as':_0x522284['as'],'attributes':_0x522284['attributes'],'include':_0x522284[_0x3099('0x1e')]?_[_0x3099('0x22')](_0x522284[_0x3099('0x1e')],function(_0x1dd4f1){return{'model':db[_0x1dd4f1[_0x3099('0x23')]],'as':_0x1dd4f1['as'],'attributes':_0x1dd4f1[_0x3099('0x1c')],'include':_0x1dd4f1[_0x3099('0x1e')]?_[_0x3099('0x22')](_0x1dd4f1['include'],function(_0x29594d){return{'model':db[_0x29594d[_0x3099('0x23')]],'as':_0x29594d['as'],'attributes':_0x29594d[_0x3099('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x33f270){logger[_0x3099('0x10')](_0x3099('0x1f'),_0x4c98c5);logger[_0x3099('0x13')](_0x3099('0x1f'),_0x4c98c5,JSON['stringify'](_0x33f270));_0x4d6563(_0x33f270);})['catch'](function(_0x3035be){logger[_0x3099('0x15')]('ShowChatQueue',_0x3035be['message'],_0x4c98c5);_0x44e36e(_0x2786ac[_0x3099('0x15')](0x1f4,_0x3035be['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 64e71b2..bf407fc 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 _0x5178=['remove','update','register','length','save'];(function(_0x40031e,_0x531329){var _0xa2664e=function(_0x2171b3){while(--_0x2171b3){_0x40031e['push'](_0x40031e['shift']());}};_0xa2664e(++_0x531329);}(_0x5178,0x171));var _0x8517=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5178[_0x618414];return _0x21c19a;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x8517('0x0'),_0x8517('0x1'),_0x8517('0x2')];function createListener(_0x2dc28f,_0x38d5b3){return function(_0x5e0a44){_0x38d5b3['emit'](_0x2dc28f,_0x5e0a44);};}function removeListener(_0x3ed6a5,_0x221184){return function(){ChatQueueEvents['removeListener'](_0x3ed6a5,_0x221184);};}exports[_0x8517('0x3')]=function(_0x58ed7e){for(var _0x13ba05=0x0,_0x45498e=events[_0x8517('0x4')];_0x13ba05<_0x45498e;_0x13ba05++){var _0x10f918=events[_0x13ba05];var _0x25146d=createListener('chatQueue:'+_0x10f918,_0x58ed7e);ChatQueueEvents['on'](_0x10f918,_0x25146d);}}; \ No newline at end of file +var _0xda55=['chatQueue:','./chatQueue.events','save','emit','removeListener','length'];(function(_0xb7979c,_0x51daec){var _0x42482d=function(_0x1f9ae3){while(--_0x1f9ae3){_0xb7979c['push'](_0xb7979c['shift']());}};_0x42482d(++_0x51daec);}(_0xda55,0x6d));var _0x5da5=function(_0x43455e,_0x46eb8b){_0x43455e=_0x43455e-0x0;var _0x2801cc=_0xda55[_0x43455e];return _0x2801cc;};'use strict';var ChatQueueEvents=require(_0x5da5('0x0'));var events=[_0x5da5('0x1'),'remove','update'];function createListener(_0x13ecbc,_0x240a49){return function(_0x26a443){_0x240a49[_0x5da5('0x2')](_0x13ecbc,_0x26a443);};}function removeListener(_0x1c3afd,_0x5da254){return function(){ChatQueueEvents[_0x5da5('0x3')](_0x1c3afd,_0x5da254);};}exports['register']=function(_0x356a37){for(var _0x58e7b3=0x0,_0x2fd877=events[_0x5da5('0x4')];_0x58e7b3<_0x2fd877;_0x58e7b3++){var _0x71b187=events[_0x58e7b3];var _0x46290d=createListener(_0x5da5('0x5')+_0x71b187,_0x356a37);ChatQueueEvents['on'](_0x71b187,_0x46290d);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 4755ff5..b294819 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 _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x46d947,_0x511391){var _0x793b7a=function(_0x5a4dae){while(--_0x5a4dae){_0x46d947['push'](_0x46d947['shift']());}};_0x793b7a(++_0x511391);}(_0xe14b,0x93));var _0xbe14=function(_0x6a513a,_0x4353ff){_0x6a513a=_0x6a513a-0x0;var _0x1ad61e=_0xe14b[_0x6a513a];return _0x1ad61e;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x37a073,_0x2fa6f7){var _0x4ca35f=function(_0x43e99e){while(--_0x43e99e){_0x37a073['push'](_0x37a073['shift']());}};_0x4ca35f(++_0x2fa6f7);}(_0x814b,0x1a2));var _0xb814=function(_0x2859f2,_0x1e3102){_0x2859f2=_0x2859f2-0x0;var _0x4974cd=_0x814b[_0x2859f2];return _0x4974cd;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 0f078a5..d23ea34 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 _0x6a2f=['DATE','sequelize','exports','STRING'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x6a2f,0xc1));var _0xf6a2=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x6a2f[_0x95942];return _0x6d7f81;};'use strict';var moment=require('moment');var Sequelize=require(_0xf6a2('0x0'));module[_0xf6a2('0x1')]={'uniqueid':{'type':Sequelize[_0xf6a2('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf6a2('0x2')]},'joinAt':{'type':Sequelize[_0xf6a2('0x3')]},'leaveAt':{'type':Sequelize[_0xf6a2('0x3')]},'acceptAt':{'type':Sequelize[_0xf6a2('0x3')]},'exitAt':{'type':Sequelize[_0xf6a2('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x40d9=['DATE','sequelize','exports','STRING'];(function(_0x51aeea,_0x3b9058){var _0x1e23e3=function(_0x369d65){while(--_0x369d65){_0x51aeea['push'](_0x51aeea['shift']());}};_0x1e23e3(++_0x3b9058);}(_0x40d9,0xa1));var _0x940d=function(_0x1716b0,_0xa59a04){_0x1716b0=_0x1716b0-0x0;var _0x594068=_0x40d9[_0x1716b0];return _0x594068;};'use strict';var moment=require('moment');var Sequelize=require(_0x940d('0x0'));module[_0x940d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x940d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x940d('0x3')]},'acceptAt':{'type':Sequelize[_0x940d('0x3')]},'exitAt':{'type':Sequelize[_0x940d('0x3')]},'reason':{'type':Sequelize[_0x940d('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index b9a8692..ad35e54 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 _0x7412=['moment','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','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','undefined','limit','count','offset','set','apply','reject','update','destroy','error','stack','name','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','catch','show','params','fields','find','create','body','describe','eml-format','fast-json-patch'];(function(_0x3c4d52,_0x22a489){var _0x435bd3=function(_0x5f03bc){while(--_0x5f03bc){_0x3c4d52['push'](_0x3c4d52['shift']());}};_0x435bd3(++_0x22a489);}(_0x7412,0x161));var _0x2741=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x7412[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0x2741('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2741('0x1'));var rp=require('request-promise');var moment=require(_0x2741('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2741('0x3'));var fs=require('fs');var fs_extra=require(_0x2741('0x4'));var _=require(_0x2741('0x5'));var squel=require('squel');var crypto=require(_0x2741('0x6'));var jsforce=require(_0x2741('0x7'));var deskjs=require(_0x2741('0x8'));var toCsv=require(_0x2741('0x9'));var querystring=require('querystring');var Papa=require(_0x2741('0xa'));var Redis=require(_0x2741('0xb'));var authService=require(_0x2741('0xc'));var qs=require(_0x2741('0xd'));var as=require(_0x2741('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2741('0xf'))(_0x2741('0x10'));var utils=require(_0x2741('0x11'));var config=require(_0x2741('0x12'));var licenseUtil=require(_0x2741('0x13'));var db=require(_0x2741('0x14'))['db'];function respondWithStatusCode(_0x1f70d6,_0x431309){_0x431309=_0x431309||0xcc;return function(_0x5115e9){if(_0x5115e9){return _0x1f70d6[_0x2741('0x15')](_0x431309);}return _0x1f70d6[_0x2741('0x16')](_0x431309)[_0x2741('0x17')]();};}function respondWithResult(_0x4347d5,_0x494073){_0x494073=_0x494073||0xc8;return function(_0xc535ee){if(_0xc535ee){return _0x4347d5[_0x2741('0x16')](_0x494073)[_0x2741('0x18')](_0xc535ee);}};}function respondWithFilteredResult(_0x39bcb6,_0x56a04c){return function(_0x1f7ef5){if(_0x1f7ef5){var _0x27eacd=typeof _0x56a04c['offset']===_0x2741('0x19')&&typeof _0x56a04c[_0x2741('0x1a')]==='undefined';var _0x482f99=_0x1f7ef5[_0x2741('0x1b')];var _0x8fb51f=_0x27eacd?0x0:_0x56a04c[_0x2741('0x1c')];var _0x27feb7=_0x27eacd?_0x1f7ef5[_0x2741('0x1b')]:_0x56a04c[_0x2741('0x1c')]+_0x56a04c[_0x2741('0x1a')];var _0x22d0d7;if(_0x27feb7>=_0x482f99){_0x27feb7=_0x482f99;_0x22d0d7=0xc8;}else{_0x22d0d7=0xce;}_0x39bcb6['status'](_0x22d0d7);return _0x39bcb6[_0x2741('0x1d')]('Content-Range',_0x8fb51f+'-'+_0x27feb7+'/'+_0x482f99)[_0x2741('0x18')](_0x1f7ef5);}return null;};}function patchUpdates(_0x592e7c){return function(_0x556142){try{jsonpatch[_0x2741('0x1e')](_0x556142,_0x592e7c,!![]);}catch(_0x826ce1){return BPromise[_0x2741('0x1f')](_0x826ce1);}return _0x556142['save']();};}function saveUpdates(_0x2bab85,_0xf6861e){return function(_0x462c1e){if(_0x462c1e){return _0x462c1e[_0x2741('0x20')](_0x2bab85)['then'](function(_0x398aeb){return _0x398aeb;});}return null;};}function removeEntity(_0x1dd0ef,_0x5e54fb){return function(_0x5c0054){if(_0x5c0054){return _0x5c0054[_0x2741('0x21')]()['then'](function(){_0x1dd0ef['status'](0xcc)[_0x2741('0x17')]();});}};}function handleEntityNotFound(_0x4d09c9,_0x52f2ab){return function(_0x23cb80){if(!_0x23cb80){_0x4d09c9[_0x2741('0x15')](0x194);}return _0x23cb80;};}function handleError(_0x1e95d8,_0x40bfd5){_0x40bfd5=_0x40bfd5||0x1f4;return function(_0x53aab8){logger[_0x2741('0x22')](_0x53aab8[_0x2741('0x23')]);if(_0x53aab8['name']){delete _0x53aab8[_0x2741('0x24')];}_0x1e95d8[_0x2741('0x16')](_0x40bfd5)['send'](_0x53aab8);};}exports[_0x2741('0x25')]=function(_0x5398bf,_0x1ed9ac){var _0x57b16d={},_0x1440e5={},_0x53ad58={'count':0x0,'rows':[]};var _0x358d06=_[_0x2741('0x26')](db[_0x2741('0x27')][_0x2741('0x28')],function(_0xe1239f){return{'name':_0xe1239f[_0x2741('0x29')],'type':_0xe1239f[_0x2741('0x2a')][_0x2741('0x2b')]};});_0x1440e5[_0x2741('0x2c')]=_[_0x2741('0x26')](_0x358d06,_0x2741('0x24'));_0x1440e5['query']=_[_0x2741('0x2d')](_0x5398bf[_0x2741('0x2e')]);_0x1440e5[_0x2741('0x2f')]=_[_0x2741('0x30')](_0x1440e5[_0x2741('0x2c')],_0x1440e5[_0x2741('0x2e')]);_0x57b16d['attributes']=_[_0x2741('0x30')](_0x1440e5['model'],qs['fields'](_0x5398bf[_0x2741('0x2e')]['fields']));_0x57b16d[_0x2741('0x31')]=_0x57b16d[_0x2741('0x31')][_0x2741('0x32')]?_0x57b16d['attributes']:_0x1440e5[_0x2741('0x2c')];if(!_0x5398bf['query'][_0x2741('0x33')](_0x2741('0x34'))){_0x57b16d[_0x2741('0x1a')]=qs['limit'](_0x5398bf['query'][_0x2741('0x1a')]);_0x57b16d[_0x2741('0x1c')]=qs[_0x2741('0x1c')](_0x5398bf[_0x2741('0x2e')][_0x2741('0x1c')]);}_0x57b16d['order']=qs[_0x2741('0x35')](_0x5398bf['query'][_0x2741('0x35')]);_0x57b16d[_0x2741('0x36')]=qs[_0x2741('0x2f')](_[_0x2741('0x37')](_0x5398bf['query'],_0x1440e5[_0x2741('0x2f')]),_0x358d06);if(_0x5398bf[_0x2741('0x2e')][_0x2741('0x38')]){_0x57b16d[_0x2741('0x36')]=_[_0x2741('0x39')](_0x57b16d['where'],{'$or':_[_0x2741('0x26')](_0x358d06,function(_0x1b1d5a){if(_0x1b1d5a[_0x2741('0x2a')]!==_0x2741('0x3a')){var _0x57b3e0={};_0x57b3e0[_0x1b1d5a[_0x2741('0x24')]]={'$like':'%'+_0x5398bf[_0x2741('0x2e')][_0x2741('0x38')]+'%'};return _0x57b3e0;}})});}_0x57b16d=_[_0x2741('0x39')]({},_0x57b16d,_0x5398bf[_0x2741('0x3b')]);var _0x5a5734={'where':_0x57b16d['where']};return db['ChatQueueReport']['count'](_0x5a5734)[_0x2741('0x3c')](function(_0x3781f3){_0x53ad58[_0x2741('0x1b')]=_0x3781f3;if(_0x5398bf[_0x2741('0x2e')][_0x2741('0x3d')]){_0x57b16d[_0x2741('0x3e')]=[{'all':!![]}];}return db[_0x2741('0x27')]['findAll'](_0x57b16d);})[_0x2741('0x3c')](function(_0x3f7301){_0x53ad58['rows']=_0x3f7301;return _0x53ad58;})[_0x2741('0x3c')](respondWithFilteredResult(_0x1ed9ac,_0x57b16d))[_0x2741('0x3f')](handleError(_0x1ed9ac,null));};exports[_0x2741('0x40')]=function(_0x106b26,_0x1ac4c2){var _0x4dc9fa={'raw':!![],'where':{'id':_0x106b26[_0x2741('0x41')]['id']}},_0x35c218={};_0x35c218['model']=_[_0x2741('0x2d')](db[_0x2741('0x27')]['rawAttributes']);_0x35c218[_0x2741('0x2e')]=_['keys'](_0x106b26[_0x2741('0x2e')]);_0x35c218['filters']=_[_0x2741('0x30')](_0x35c218['model'],_0x35c218[_0x2741('0x2e')]);_0x4dc9fa[_0x2741('0x31')]=_[_0x2741('0x30')](_0x35c218[_0x2741('0x2c')],qs[_0x2741('0x42')](_0x106b26[_0x2741('0x2e')][_0x2741('0x42')]));_0x4dc9fa['attributes']=_0x4dc9fa[_0x2741('0x31')][_0x2741('0x32')]?_0x4dc9fa[_0x2741('0x31')]:_0x35c218[_0x2741('0x2c')];if(_0x106b26[_0x2741('0x2e')][_0x2741('0x3d')]){_0x4dc9fa[_0x2741('0x3e')]=[{'all':!![]}];}_0x4dc9fa=_[_0x2741('0x39')]({},_0x4dc9fa,_0x106b26[_0x2741('0x3b')]);return db[_0x2741('0x27')][_0x2741('0x43')](_0x4dc9fa)[_0x2741('0x3c')](handleEntityNotFound(_0x1ac4c2,null))[_0x2741('0x3c')](respondWithResult(_0x1ac4c2,null))['catch'](handleError(_0x1ac4c2,null));};exports[_0x2741('0x44')]=function(_0x514842,_0x2f653b){return db[_0x2741('0x27')]['create'](_0x514842[_0x2741('0x45')],{})[_0x2741('0x3c')](respondWithResult(_0x2f653b,0xc9))[_0x2741('0x3f')](handleError(_0x2f653b,null));};exports['update']=function(_0x1eed59,_0x3342e5){if(_0x1eed59[_0x2741('0x45')]['id']){delete _0x1eed59['body']['id'];}return db['ChatQueueReport'][_0x2741('0x43')]({'where':{'id':_0x1eed59[_0x2741('0x41')]['id']}})['then'](handleEntityNotFound(_0x3342e5,null))[_0x2741('0x3c')](saveUpdates(_0x1eed59['body'],null))[_0x2741('0x3c')](respondWithResult(_0x3342e5,null))[_0x2741('0x3f')](handleError(_0x3342e5,null));};exports[_0x2741('0x21')]=function(_0x38a43f,_0x35ba3a){return db[_0x2741('0x27')][_0x2741('0x43')]({'where':{'id':_0x38a43f[_0x2741('0x41')]['id']}})[_0x2741('0x3c')](handleEntityNotFound(_0x35ba3a,null))[_0x2741('0x3c')](removeEntity(_0x35ba3a,null))[_0x2741('0x3f')](handleError(_0x35ba3a,null));};exports[_0x2741('0x46')]=function(_0x453cdc,_0x54e165){return db[_0x2741('0x27')][_0x2741('0x46')]()[_0x2741('0x3c')](respondWithResult(_0x54e165,null))[_0x2741('0x3f')](handleError(_0x54e165,null));}; \ No newline at end of file +var _0x7eff=['util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x51e148,_0x56d02c){var _0x438d7e=function(_0x4633a2){while(--_0x4633a2){_0x51e148['push'](_0x51e148['shift']());}};_0x438d7e(++_0x56d02c);}(_0x7eff,0x162));var _0xf7ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7eff[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7ef('0x0'));var zipdir=require(_0xf7ef('0x1'));var jsonpatch=require(_0xf7ef('0x2'));var rp=require('request-promise');var moment=require(_0xf7ef('0x3'));var BPromise=require(_0xf7ef('0x4'));var Mustache=require(_0xf7ef('0x5'));var util=require(_0xf7ef('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf7ef('0x7'));var ejs=require(_0xf7ef('0x8'));var fs=require('fs');var fs_extra=require(_0xf7ef('0x9'));var _=require(_0xf7ef('0xa'));var squel=require(_0xf7ef('0xb'));var crypto=require(_0xf7ef('0xc'));var jsforce=require(_0xf7ef('0xd'));var deskjs=require(_0xf7ef('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf7ef('0xf'));var Papa=require(_0xf7ef('0x10'));var Redis=require('ioredis');var authService=require(_0xf7ef('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7ef('0x12'));var logger=require('../../config/logger')(_0xf7ef('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf7ef('0x14'))['db'];function respondWithStatusCode(_0x4e45fd,_0x5e6a8e){_0x5e6a8e=_0x5e6a8e||0xcc;return function(_0x56b5d7){if(_0x56b5d7){return _0x4e45fd[_0xf7ef('0x15')](_0x5e6a8e);}return _0x4e45fd[_0xf7ef('0x16')](_0x5e6a8e)[_0xf7ef('0x17')]();};}function respondWithResult(_0xf6e5a0,_0x5d5112){_0x5d5112=_0x5d5112||0xc8;return function(_0x27a4a7){if(_0x27a4a7){return _0xf6e5a0['status'](_0x5d5112)[_0xf7ef('0x18')](_0x27a4a7);}};}function respondWithFilteredResult(_0x35746b,_0x4996b7){return function(_0x39ef6f){if(_0x39ef6f){var _0x4856bd=typeof _0x4996b7[_0xf7ef('0x19')]===_0xf7ef('0x1a')&&typeof _0x4996b7[_0xf7ef('0x1b')]===_0xf7ef('0x1a');var _0x15ad8c=_0x39ef6f[_0xf7ef('0x1c')];var _0x466612=_0x4856bd?0x0:_0x4996b7['offset'];var _0x4fa0c6=_0x4856bd?_0x39ef6f['count']:_0x4996b7[_0xf7ef('0x19')]+_0x4996b7['limit'];var _0x371688;if(_0x4fa0c6>=_0x15ad8c){_0x4fa0c6=_0x15ad8c;_0x371688=0xc8;}else{_0x371688=0xce;}_0x35746b[_0xf7ef('0x16')](_0x371688);return _0x35746b[_0xf7ef('0x1d')](_0xf7ef('0x1e'),_0x466612+'-'+_0x4fa0c6+'/'+_0x15ad8c)[_0xf7ef('0x18')](_0x39ef6f);}return null;};}function patchUpdates(_0x29cbf1){return function(_0x4d1cf0){try{jsonpatch['apply'](_0x4d1cf0,_0x29cbf1,!![]);}catch(_0x578525){return BPromise[_0xf7ef('0x1f')](_0x578525);}return _0x4d1cf0[_0xf7ef('0x20')]();};}function saveUpdates(_0x1a95c6,_0x20c27b){return function(_0x5d70f5){if(_0x5d70f5){return _0x5d70f5['update'](_0x1a95c6)[_0xf7ef('0x21')](function(_0x36c8c8){return _0x36c8c8;});}return null;};}function removeEntity(_0x5e1c75,_0x168da4){return function(_0x39e820){if(_0x39e820){return _0x39e820[_0xf7ef('0x22')]()['then'](function(){_0x5e1c75[_0xf7ef('0x16')](0xcc)[_0xf7ef('0x17')]();});}};}function handleEntityNotFound(_0x47c243,_0x15997a){return function(_0x3ee27d){if(!_0x3ee27d){_0x47c243[_0xf7ef('0x15')](0x194);}return _0x3ee27d;};}function handleError(_0x205aaa,_0x11768b){_0x11768b=_0x11768b||0x1f4;return function(_0xaa0cc4){logger[_0xf7ef('0x23')](_0xaa0cc4[_0xf7ef('0x24')]);if(_0xaa0cc4[_0xf7ef('0x25')]){delete _0xaa0cc4['name'];}_0x205aaa[_0xf7ef('0x16')](_0x11768b)[_0xf7ef('0x26')](_0xaa0cc4);};}exports[_0xf7ef('0x27')]=function(_0x3a9292,_0x49ea57){var _0x392364={},_0x3becba={},_0x486c2a={'count':0x0,'rows':[]};var _0x5e40ac=_[_0xf7ef('0x28')](db['ChatQueueReport'][_0xf7ef('0x29')],function(_0xbd4571){return{'name':_0xbd4571[_0xf7ef('0x2a')],'type':_0xbd4571[_0xf7ef('0x2b')]['key']};});_0x3becba[_0xf7ef('0x2c')]=_[_0xf7ef('0x28')](_0x5e40ac,_0xf7ef('0x25'));_0x3becba['query']=_[_0xf7ef('0x2d')](_0x3a9292[_0xf7ef('0x2e')]);_0x3becba[_0xf7ef('0x2f')]=_[_0xf7ef('0x30')](_0x3becba[_0xf7ef('0x2c')],_0x3becba[_0xf7ef('0x2e')]);_0x392364[_0xf7ef('0x31')]=_[_0xf7ef('0x30')](_0x3becba[_0xf7ef('0x2c')],qs['fields'](_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x32')]));_0x392364[_0xf7ef('0x31')]=_0x392364[_0xf7ef('0x31')][_0xf7ef('0x33')]?_0x392364[_0xf7ef('0x31')]:_0x3becba[_0xf7ef('0x2c')];if(!_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x34')]('nolimit')){_0x392364['limit']=qs[_0xf7ef('0x1b')](_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x1b')]);_0x392364[_0xf7ef('0x19')]=qs[_0xf7ef('0x19')](_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x19')]);}_0x392364[_0xf7ef('0x35')]=qs['sort'](_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x36')]);_0x392364['where']=qs['filters'](_[_0xf7ef('0x37')](_0x3a9292[_0xf7ef('0x2e')],_0x3becba[_0xf7ef('0x2f')]),_0x5e40ac);if(_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x38')]){_0x392364[_0xf7ef('0x39')]=_[_0xf7ef('0x3a')](_0x392364[_0xf7ef('0x39')],{'$or':_['map'](_0x5e40ac,function(_0x55fd01){if(_0x55fd01[_0xf7ef('0x2b')]!=='VIRTUAL'){var _0x300e05={};_0x300e05[_0x55fd01[_0xf7ef('0x25')]]={'$like':'%'+_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x38')]+'%'};return _0x300e05;}})});}_0x392364=_[_0xf7ef('0x3a')]({},_0x392364,_0x3a9292[_0xf7ef('0x3b')]);var _0x2052a9={'where':_0x392364[_0xf7ef('0x39')]};return db[_0xf7ef('0x3c')]['count'](_0x2052a9)[_0xf7ef('0x21')](function(_0x2bad42){_0x486c2a['count']=_0x2bad42;if(_0x3a9292[_0xf7ef('0x2e')][_0xf7ef('0x3d')]){_0x392364[_0xf7ef('0x3e')]=[{'all':!![]}];}return db[_0xf7ef('0x3c')][_0xf7ef('0x3f')](_0x392364);})[_0xf7ef('0x21')](function(_0x2323d7){_0x486c2a[_0xf7ef('0x40')]=_0x2323d7;return _0x486c2a;})[_0xf7ef('0x21')](respondWithFilteredResult(_0x49ea57,_0x392364))[_0xf7ef('0x41')](handleError(_0x49ea57,null));};exports['show']=function(_0x5c54af,_0x58783d){var _0x3a27cd={'raw':!![],'where':{'id':_0x5c54af[_0xf7ef('0x42')]['id']}},_0x540783={};_0x540783[_0xf7ef('0x2c')]=_[_0xf7ef('0x2d')](db['ChatQueueReport'][_0xf7ef('0x29')]);_0x540783['query']=_[_0xf7ef('0x2d')](_0x5c54af[_0xf7ef('0x2e')]);_0x540783[_0xf7ef('0x2f')]=_[_0xf7ef('0x30')](_0x540783[_0xf7ef('0x2c')],_0x540783[_0xf7ef('0x2e')]);_0x3a27cd[_0xf7ef('0x31')]=_[_0xf7ef('0x30')](_0x540783[_0xf7ef('0x2c')],qs[_0xf7ef('0x32')](_0x5c54af[_0xf7ef('0x2e')][_0xf7ef('0x32')]));_0x3a27cd[_0xf7ef('0x31')]=_0x3a27cd[_0xf7ef('0x31')][_0xf7ef('0x33')]?_0x3a27cd[_0xf7ef('0x31')]:_0x540783[_0xf7ef('0x2c')];if(_0x5c54af[_0xf7ef('0x2e')][_0xf7ef('0x3d')]){_0x3a27cd[_0xf7ef('0x3e')]=[{'all':!![]}];}_0x3a27cd=_[_0xf7ef('0x3a')]({},_0x3a27cd,_0x5c54af['options']);return db[_0xf7ef('0x3c')][_0xf7ef('0x43')](_0x3a27cd)[_0xf7ef('0x21')](handleEntityNotFound(_0x58783d,null))['then'](respondWithResult(_0x58783d,null))[_0xf7ef('0x41')](handleError(_0x58783d,null));};exports[_0xf7ef('0x44')]=function(_0x238d5a,_0x442191){return db[_0xf7ef('0x3c')][_0xf7ef('0x44')](_0x238d5a[_0xf7ef('0x45')],{})[_0xf7ef('0x21')](respondWithResult(_0x442191,0xc9))[_0xf7ef('0x41')](handleError(_0x442191,null));};exports[_0xf7ef('0x46')]=function(_0x17584a,_0x5670c8){if(_0x17584a['body']['id']){delete _0x17584a['body']['id'];}return db[_0xf7ef('0x3c')]['find']({'where':{'id':_0x17584a[_0xf7ef('0x42')]['id']}})[_0xf7ef('0x21')](handleEntityNotFound(_0x5670c8,null))[_0xf7ef('0x21')](saveUpdates(_0x17584a[_0xf7ef('0x45')],null))[_0xf7ef('0x21')](respondWithResult(_0x5670c8,null))['catch'](handleError(_0x5670c8,null));};exports['destroy']=function(_0x23c6d8,_0x284dbb){return db[_0xf7ef('0x3c')][_0xf7ef('0x43')]({'where':{'id':_0x23c6d8[_0xf7ef('0x42')]['id']}})['then'](handleEntityNotFound(_0x284dbb,null))[_0xf7ef('0x21')](removeEntity(_0x284dbb,null))[_0xf7ef('0x41')](handleError(_0x284dbb,null));};exports['describe']=function(_0x342da3,_0x3af64f){return db[_0xf7ef('0x3c')][_0xf7ef('0x47')]()[_0xf7ef('0x21')](respondWithResult(_0x3af64f,null))['catch'](handleError(_0x3af64f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 4acfb52..3e24d68 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_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':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xee4b03,_0x59a13e){var _0x61ad9b=function(_0x1f1bcc){while(--_0x1f1bcc){_0xee4b03['push'](_0xee4b03['shift']());}};_0x61ad9b(++_0x59a13e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index f628367..6addf4e 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 _0x5baf=['../../config/logger','../../config/environment','jayson/promise','client','request','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','then','debug','where','limit','UpdateChatQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0x5baf,0xae));var _0xf5ba=function(_0x3806cd,_0x52ca5d){_0x3806cd=_0x3806cd-0x0;var _0x4d61fd=_0x5baf[_0x3806cd];return _0x4d61fd;};'use strict';var _=require(_0xf5ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf5ba('0x1'));var rs=require(_0xf5ba('0x2'));var fs=require('fs');var Redis=require(_0xf5ba('0x3'));var db=require(_0xf5ba('0x4'))['db'];var utils=require(_0xf5ba('0x5'));var logger=require(_0xf5ba('0x6'))('rpc');var config=require(_0xf5ba('0x7'));var jayson=require(_0xf5ba('0x8'));var client=jayson[_0xf5ba('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a4db8,_0x45e669,_0x5deae9){return new BPromise(function(_0x21f0c6,_0x1eac81){return client[_0xf5ba('0xa')](_0x1a4db8,_0x5deae9)['then'](function(_0x29602c){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x45e669,_0xf5ba('0xb'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x45e669,_0xf5ba('0xb'),JSON[_0xf5ba('0xc')](_0x29602c));if(_0x29602c[_0xf5ba('0xd')]){if(_0x29602c['error'][_0xf5ba('0xe')]===0x1f4){logger[_0xf5ba('0xd')](_0xf5ba('0xf'),_0x45e669,_0x29602c['error'][_0xf5ba('0x10')]);return _0x1eac81(_0x29602c[_0xf5ba('0xd')][_0xf5ba('0x10')]);}logger[_0xf5ba('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x45e669,_0x29602c[_0xf5ba('0xd')]['message']);return _0x21f0c6(_0x29602c[_0xf5ba('0xd')][_0xf5ba('0x10')]);}else{logger[_0xf5ba('0x11')](_0xf5ba('0xf'),_0x45e669,_0xf5ba('0xb'));_0x21f0c6(_0x29602c[_0xf5ba('0x12')][_0xf5ba('0x10')]);}})[_0xf5ba('0x13')](function(_0x5ca464){logger[_0xf5ba('0xd')](_0xf5ba('0xf'),_0x45e669,_0x5ca464);_0x1eac81(_0x5ca464);});});}exports[_0xf5ba('0x14')]=function(_0x20d0be){var _0x431e80=this;return new Promise(function(_0x4d74c5,_0x3c6437){return db[_0xf5ba('0x15')]['create'](_0x20d0be[_0xf5ba('0x16')],{'raw':_0x20d0be['options']?_0x20d0be[_0xf5ba('0x17')][_0xf5ba('0x18')]===undefined?!![]:![]:!![]})[_0xf5ba('0x19')](function(_0x2d752d){logger['info'](_0xf5ba('0x14'),_0x20d0be);logger[_0xf5ba('0x1a')](_0xf5ba('0x14'),_0x20d0be,JSON[_0xf5ba('0xc')](_0x2d752d));_0x4d74c5(_0x2d752d);})['catch'](function(_0x62a088){logger[_0xf5ba('0xd')](_0xf5ba('0x14'),_0x62a088[_0xf5ba('0x10')],_0x20d0be);_0x3c6437(_0x431e80['error'](0x1f4,_0x62a088[_0xf5ba('0x10')]));});});};exports['UpdateChatQueueReport']=function(_0x346f4b){var _0x5b146e=this;return new Promise(function(_0x4da369,_0x3ceb0f){return db[_0xf5ba('0x15')]['update'](_0x346f4b[_0xf5ba('0x16')],{'raw':_0x346f4b[_0xf5ba('0x17')]?_0x346f4b[_0xf5ba('0x17')][_0xf5ba('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x346f4b[_0xf5ba('0x17')]?_0x346f4b[_0xf5ba('0x17')][_0xf5ba('0x1b')]||null:null,'attributes':_0x346f4b[_0xf5ba('0x17')]?_0x346f4b['options']['attributes']||null:null,'limit':_0x346f4b['options']?_0x346f4b['options'][_0xf5ba('0x1c')]||null:null})[_0xf5ba('0x19')](function(_0x2af807){logger[_0xf5ba('0x11')]('UpdateChatQueueReport',_0x346f4b);logger[_0xf5ba('0x1a')](_0xf5ba('0x1d'),_0x346f4b,JSON[_0xf5ba('0xc')](_0x2af807));_0x4da369(_0x2af807);})[_0xf5ba('0x13')](function(_0x56e02e){logger[_0xf5ba('0xd')]('UpdateChatQueueReport',_0x56e02e[_0xf5ba('0x10')],_0x346f4b);_0x3ceb0f(_0x5b146e['error'](0x1f4,_0x56e02e[_0xf5ba('0x10')]));});});}; \ No newline at end of file +var _0x5ebe=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','ChatQueueReport','update','attributes','lodash','util','moment','bluebird'];(function(_0x2950f4,_0x174c11){var _0x14b160=function(_0x5d8b3e){while(--_0x5d8b3e){_0x2950f4['push'](_0x2950f4['shift']());}};_0x14b160(++_0x174c11);}(_0x5ebe,0xab));var _0xe5eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5ebe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe5eb('0x0'));var util=require(_0xe5eb('0x1'));var moment=require(_0xe5eb('0x2'));var BPromise=require(_0xe5eb('0x3'));var rs=require(_0xe5eb('0x4'));var fs=require('fs');var Redis=require(_0xe5eb('0x5'));var db=require(_0xe5eb('0x6'))['db'];var utils=require(_0xe5eb('0x7'));var logger=require(_0xe5eb('0x8'))('rpc');var config=require(_0xe5eb('0x9'));var jayson=require(_0xe5eb('0xa'));var client=jayson[_0xe5eb('0xb')][_0xe5eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30fc7b,_0x40545a,_0x138642){return new BPromise(function(_0xed60c2,_0x1fe8ee){return client[_0xe5eb('0xd')](_0x30fc7b,_0x138642)[_0xe5eb('0xe')](function(_0xc095e3){logger[_0xe5eb('0xf')](_0xe5eb('0x10'),_0x40545a,'request\x20sent');logger[_0xe5eb('0x11')](_0xe5eb('0x12'),_0x40545a,_0xe5eb('0x13'),JSON[_0xe5eb('0x14')](_0xc095e3));if(_0xc095e3['error']){if(_0xc095e3[_0xe5eb('0x15')][_0xe5eb('0x16')]===0x1f4){logger[_0xe5eb('0x15')](_0xe5eb('0x10'),_0x40545a,_0xc095e3[_0xe5eb('0x15')][_0xe5eb('0x17')]);return _0x1fe8ee(_0xc095e3[_0xe5eb('0x15')][_0xe5eb('0x17')]);}logger[_0xe5eb('0x15')](_0xe5eb('0x10'),_0x40545a,_0xc095e3[_0xe5eb('0x15')]['message']);return _0xed60c2(_0xc095e3[_0xe5eb('0x15')][_0xe5eb('0x17')]);}else{logger['info'](_0xe5eb('0x10'),_0x40545a,'request\x20sent');_0xed60c2(_0xc095e3[_0xe5eb('0x18')][_0xe5eb('0x17')]);}})[_0xe5eb('0x19')](function(_0x2a2ef2){logger['error'](_0xe5eb('0x10'),_0x40545a,_0x2a2ef2);_0x1fe8ee(_0x2a2ef2);});});}exports[_0xe5eb('0x1a')]=function(_0x555cbf){var _0x182cd=this;return new Promise(function(_0x258262,_0x361467){return db['ChatQueueReport'][_0xe5eb('0x1b')](_0x555cbf[_0xe5eb('0x1c')],{'raw':_0x555cbf[_0xe5eb('0x1d')]?_0x555cbf['options'][_0xe5eb('0x1e')]===undefined?!![]:![]:!![]})[_0xe5eb('0xe')](function(_0x48353f){logger[_0xe5eb('0xf')]('CreateChatQueueReport',_0x555cbf);logger[_0xe5eb('0x11')]('CreateChatQueueReport',_0x555cbf,JSON[_0xe5eb('0x14')](_0x48353f));_0x258262(_0x48353f);})[_0xe5eb('0x19')](function(_0xe56e2){logger[_0xe5eb('0x15')](_0xe5eb('0x1a'),_0xe56e2[_0xe5eb('0x17')],_0x555cbf);_0x361467(_0x182cd[_0xe5eb('0x15')](0x1f4,_0xe56e2[_0xe5eb('0x17')]));});});};exports[_0xe5eb('0x1f')]=function(_0x2d4986){var _0x490bca=this;return new Promise(function(_0x9d24ef,_0x1bab86){return db[_0xe5eb('0x20')][_0xe5eb('0x21')](_0x2d4986[_0xe5eb('0x1c')],{'raw':_0x2d4986[_0xe5eb('0x1d')]?_0x2d4986[_0xe5eb('0x1d')][_0xe5eb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d4986[_0xe5eb('0x1d')]?_0x2d4986[_0xe5eb('0x1d')]['where']||null:null,'attributes':_0x2d4986[_0xe5eb('0x1d')]?_0x2d4986[_0xe5eb('0x1d')][_0xe5eb('0x22')]||null:null,'limit':_0x2d4986[_0xe5eb('0x1d')]?_0x2d4986[_0xe5eb('0x1d')]['limit']||null:null})['then'](function(_0x40f5f3){logger[_0xe5eb('0xf')](_0xe5eb('0x1f'),_0x2d4986);logger[_0xe5eb('0x11')](_0xe5eb('0x1f'),_0x2d4986,JSON[_0xe5eb('0x14')](_0x40f5f3));_0x9d24ef(_0x40f5f3);})[_0xe5eb('0x19')](function(_0xc41e75){logger[_0xe5eb('0x15')](_0xe5eb('0x1f'),_0xc41e75[_0xe5eb('0x17')],_0x2d4986);_0x1bab86(_0x490bca[_0xe5eb('0x15')](0x1f4,_0xc41e75['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 8d5bdfe..55f74cd 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 _0x30ad=['/:id','post','create','put','exports','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe'];(function(_0x46808b,_0x1398c0){var _0x4f04fa=function(_0x295ffe){while(--_0x295ffe){_0x46808b['push'](_0x46808b['shift']());}};_0x4f04fa(++_0x1398c0);}(_0x30ad,0x131));var _0xd30a=function(_0x579d89,_0x5656b2){_0x579d89=_0x579d89-0x0;var _0x4e4522=_0x30ad[_0x579d89];return _0x4e4522;};'use strict';var multer=require(_0xd30a('0x0'));var util=require(_0xd30a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd30a('0x2'));var auth=require(_0xd30a('0x3'));var interaction=require(_0xd30a('0x4'));var config=require(_0xd30a('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0xd30a('0x6')](),controller['index']);router[_0xd30a('0x7')](_0xd30a('0x8'),auth['isAuthenticated'](),controller[_0xd30a('0x9')]);router[_0xd30a('0x7')](_0xd30a('0xa'),auth[_0xd30a('0x6')](),controller['show']);router[_0xd30a('0xb')]('/',auth[_0xd30a('0x6')](),controller[_0xd30a('0xc')]);router[_0xd30a('0xd')](_0xd30a('0xa'),auth[_0xd30a('0x6')](),controller['update']);router['delete'](_0xd30a('0xa'),auth[_0xd30a('0x6')](),controller['destroy']);module[_0xd30a('0xe')]=router; \ No newline at end of file +var _0x8520=['/describe','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get'];(function(_0x13d20a,_0x170ae7){var _0x201686=function(_0x7f4bad){while(--_0x7f4bad){_0x13d20a['push'](_0x13d20a['shift']());}};_0x201686(++_0x170ae7);}(_0x8520,0x183));var _0x0852=function(_0x339aff,_0x583652){_0x339aff=_0x339aff-0x0;var _0x4e788f=_0x8520[_0x339aff];return _0x4e788f;};'use strict';var multer=require(_0x0852('0x0'));var util=require('util');var path=require(_0x0852('0x1'));var timeout=require(_0x0852('0x2'));var express=require(_0x0852('0x3'));var router=express[_0x0852('0x4')]();var fs_extra=require(_0x0852('0x5'));var auth=require(_0x0852('0x6'));var interaction=require(_0x0852('0x7'));var config=require(_0x0852('0x8'));var controller=require(_0x0852('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x0852('0xa')]);router[_0x0852('0xb')](_0x0852('0xc'),auth[_0x0852('0xd')](),controller['describe']);router[_0x0852('0xb')](_0x0852('0xe'),auth[_0x0852('0xd')](),controller[_0x0852('0xf')]);router[_0x0852('0x10')]('/',auth[_0x0852('0xd')](),controller[_0x0852('0x11')]);router['put'](_0x0852('0xe'),auth[_0x0852('0xd')](),controller[_0x0852('0x12')]);router['delete'](_0x0852('0xe'),auth[_0x0852('0xd')](),controller[_0x0852('0x13')]);module[_0x0852('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index fbb1217..bef669b 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x156a0d,_0x3946ce){var _0x98a9ba=function(_0x46c1b2){while(--_0x46c1b2){_0x156a0d['push'](_0x156a0d['shift']());}};_0x98a9ba(++_0x3946ce);}(_0x9bde,0xe1));var _0xe9bd=function(_0x107c0f,_0x2ab67c){_0x107c0f=_0x107c0f-0x0;var _0x1f236a=_0x9bde[_0x107c0f];return _0x1f236a;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x51fe5f,_0x1d8632){var _0x4abce9=function(_0x34afb7){while(--_0x34afb7){_0x51fe5f['push'](_0x51fe5f['shift']());}};_0x4abce9(++_0x1d8632);}(_0x54ef,0x112));var _0xf54e=function(_0x103156,_0x506606){_0x103156=_0x103156-0x0;var _0x40c3f8=_0x54ef[_0x103156];return _0x40c3f8;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index d32f2df..3aaab4f 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 _0x19c5=['params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','options','find','create','body'];(function(_0x407e90,_0x2453cf){var _0x288761=function(_0xb56607){while(--_0xb56607){_0x407e90['push'](_0x407e90['shift']());}};_0x288761(++_0x2453cf);}(_0x19c5,0x126));var _0x519c=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x19c5[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require(_0x519c('0x0'));var rimraf=require(_0x519c('0x1'));var zipdir=require(_0x519c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x519c('0x3'));var moment=require('moment');var BPromise=require(_0x519c('0x4'));var Mustache=require('mustache');var util=require(_0x519c('0x5'));var path=require(_0x519c('0x6'));var sox=require(_0x519c('0x7'));var csv=require('to-csv');var ejs=require(_0x519c('0x8'));var fs=require('fs');var fs_extra=require(_0x519c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x519c('0xa'));var deskjs=require(_0x519c('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x519c('0xc'));var Redis=require(_0x519c('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x519c('0xe'));var hardwareService=require(_0x519c('0xf'));var logger=require(_0x519c('0x10'))(_0x519c('0x11'));var utils=require(_0x519c('0x12'));var config=require(_0x519c('0x13'));var licenseUtil=require(_0x519c('0x14'));var db=require(_0x519c('0x15'))['db'];function respondWithStatusCode(_0x12e65,_0x298cdc){_0x298cdc=_0x298cdc||0xcc;return function(_0x3ce1aa){if(_0x3ce1aa){return _0x12e65['sendStatus'](_0x298cdc);}return _0x12e65['status'](_0x298cdc)[_0x519c('0x16')]();};}function respondWithResult(_0x3f471b,_0x2c7ab6){_0x2c7ab6=_0x2c7ab6||0xc8;return function(_0xbe48bb){if(_0xbe48bb){return _0x3f471b[_0x519c('0x17')](_0x2c7ab6)[_0x519c('0x18')](_0xbe48bb);}};}function respondWithFilteredResult(_0x2e5973,_0x497a33){return function(_0x3d56ae){if(_0x3d56ae){var _0x32a62d=typeof _0x497a33['offset']===_0x519c('0x19')&&typeof _0x497a33[_0x519c('0x1a')]==='undefined';var _0x1ab740=_0x3d56ae[_0x519c('0x1b')];var _0x1539b5=_0x32a62d?0x0:_0x497a33[_0x519c('0x1c')];var _0x154458=_0x32a62d?_0x3d56ae['count']:_0x497a33[_0x519c('0x1c')]+_0x497a33[_0x519c('0x1a')];var _0x4e11e0;if(_0x154458>=_0x1ab740){_0x154458=_0x1ab740;_0x4e11e0=0xc8;}else{_0x4e11e0=0xce;}_0x2e5973[_0x519c('0x17')](_0x4e11e0);return _0x2e5973[_0x519c('0x1d')](_0x519c('0x1e'),_0x1539b5+'-'+_0x154458+'/'+_0x1ab740)['json'](_0x3d56ae);}return null;};}function patchUpdates(_0x3f3571){return function(_0x5689a5){try{jsonpatch[_0x519c('0x1f')](_0x5689a5,_0x3f3571,!![]);}catch(_0xefa893){return BPromise[_0x519c('0x20')](_0xefa893);}return _0x5689a5['save']();};}function saveUpdates(_0xf98019,_0x3bceba){return function(_0x58d3dd){if(_0x58d3dd){return _0x58d3dd[_0x519c('0x21')](_0xf98019)[_0x519c('0x22')](function(_0x36aa98){return _0x36aa98;});}return null;};}function removeEntity(_0x35bf9c,_0x36b0ed){return function(_0x39fe68){if(_0x39fe68){return _0x39fe68[_0x519c('0x23')]()[_0x519c('0x22')](function(){_0x35bf9c['status'](0xcc)[_0x519c('0x16')]();});}};}function handleEntityNotFound(_0x29b0b3,_0x360274){return function(_0x33077a){if(!_0x33077a){_0x29b0b3[_0x519c('0x24')](0x194);}return _0x33077a;};}function handleError(_0x54cfd8,_0x1cc17f){_0x1cc17f=_0x1cc17f||0x1f4;return function(_0x718ffb){logger[_0x519c('0x25')](_0x718ffb[_0x519c('0x26')]);if(_0x718ffb[_0x519c('0x27')]){delete _0x718ffb[_0x519c('0x27')];}_0x54cfd8[_0x519c('0x17')](_0x1cc17f)[_0x519c('0x28')](_0x718ffb);};}exports[_0x519c('0x29')]=function(_0x441ed1,_0x500429){var _0x5eafb1={},_0x5decb9={},_0x4f50ee={'count':0x0,'rows':[]};var _0x7dbc1f=_[_0x519c('0x2a')](db[_0x519c('0x2b')][_0x519c('0x2c')],function(_0x30859b){return{'name':_0x30859b[_0x519c('0x2d')],'type':_0x30859b[_0x519c('0x2e')]['key']};});_0x5decb9[_0x519c('0x2f')]=_['map'](_0x7dbc1f,_0x519c('0x27'));_0x5decb9[_0x519c('0x30')]=_[_0x519c('0x31')](_0x441ed1[_0x519c('0x30')]);_0x5decb9[_0x519c('0x32')]=_[_0x519c('0x33')](_0x5decb9['model'],_0x5decb9[_0x519c('0x30')]);_0x5eafb1[_0x519c('0x34')]=_[_0x519c('0x33')](_0x5decb9[_0x519c('0x2f')],qs[_0x519c('0x35')](_0x441ed1[_0x519c('0x30')][_0x519c('0x35')]));_0x5eafb1['attributes']=_0x5eafb1[_0x519c('0x34')][_0x519c('0x36')]?_0x5eafb1[_0x519c('0x34')]:_0x5decb9[_0x519c('0x2f')];if(!_0x441ed1['query'][_0x519c('0x37')](_0x519c('0x38'))){_0x5eafb1['limit']=qs['limit'](_0x441ed1[_0x519c('0x30')][_0x519c('0x1a')]);_0x5eafb1['offset']=qs['offset'](_0x441ed1['query'][_0x519c('0x1c')]);}_0x5eafb1['order']=qs[_0x519c('0x39')](_0x441ed1[_0x519c('0x30')][_0x519c('0x39')]);_0x5eafb1[_0x519c('0x3a')]=qs[_0x519c('0x32')](_[_0x519c('0x3b')](_0x441ed1[_0x519c('0x30')],_0x5decb9[_0x519c('0x32')]),_0x7dbc1f);if(_0x441ed1[_0x519c('0x30')][_0x519c('0x3c')]){_0x5eafb1[_0x519c('0x3a')]=_[_0x519c('0x3d')](_0x5eafb1[_0x519c('0x3a')],{'$or':_[_0x519c('0x2a')](_0x7dbc1f,function(_0x5962f9){if(_0x5962f9[_0x519c('0x2e')]!=='VIRTUAL'){var _0x5f0a7f={};_0x5f0a7f[_0x5962f9[_0x519c('0x27')]]={'$like':'%'+_0x441ed1[_0x519c('0x30')]['filter']+'%'};return _0x5f0a7f;}})});}_0x5eafb1=_[_0x519c('0x3d')]({},_0x5eafb1,_0x441ed1['options']);var _0x1b5df5={'where':_0x5eafb1['where']};return db[_0x519c('0x2b')][_0x519c('0x1b')](_0x1b5df5)['then'](function(_0xaff238){_0x4f50ee[_0x519c('0x1b')]=_0xaff238;if(_0x441ed1[_0x519c('0x30')][_0x519c('0x3e')]){_0x5eafb1['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x519c('0x3f')](_0x5eafb1);})[_0x519c('0x22')](function(_0x4817fd){_0x4f50ee[_0x519c('0x40')]=_0x4817fd;return _0x4f50ee;})['then'](respondWithFilteredResult(_0x500429,_0x5eafb1))[_0x519c('0x41')](handleError(_0x500429,null));};exports[_0x519c('0x42')]=function(_0x5a155b,_0x301bc1){var _0x32f012={'raw':!![],'where':{'id':_0x5a155b['params']['id']}},_0x152736={};_0x152736[_0x519c('0x2f')]=_[_0x519c('0x31')](db[_0x519c('0x2b')][_0x519c('0x2c')]);_0x152736[_0x519c('0x30')]=_[_0x519c('0x31')](_0x5a155b[_0x519c('0x30')]);_0x152736[_0x519c('0x32')]=_[_0x519c('0x33')](_0x152736[_0x519c('0x2f')],_0x152736[_0x519c('0x30')]);_0x32f012['attributes']=_['intersection'](_0x152736[_0x519c('0x2f')],qs[_0x519c('0x35')](_0x5a155b[_0x519c('0x30')][_0x519c('0x35')]));_0x32f012[_0x519c('0x34')]=_0x32f012[_0x519c('0x34')][_0x519c('0x36')]?_0x32f012[_0x519c('0x34')]:_0x152736[_0x519c('0x2f')];if(_0x5a155b['query']['includeAll']){_0x32f012['include']=[{'all':!![]}];}_0x32f012=_[_0x519c('0x3d')]({},_0x32f012,_0x5a155b[_0x519c('0x43')]);return db[_0x519c('0x2b')][_0x519c('0x44')](_0x32f012)[_0x519c('0x22')](handleEntityNotFound(_0x301bc1,null))[_0x519c('0x22')](respondWithResult(_0x301bc1,null))['catch'](handleError(_0x301bc1,null));};exports[_0x519c('0x45')]=function(_0x91dfa9,_0x4a12ee){return db[_0x519c('0x2b')][_0x519c('0x45')](_0x91dfa9[_0x519c('0x46')],{})[_0x519c('0x22')](respondWithResult(_0x4a12ee,0xc9))[_0x519c('0x41')](handleError(_0x4a12ee,null));};exports[_0x519c('0x21')]=function(_0x5dde54,_0xc175d9){if(_0x5dde54[_0x519c('0x46')]['id']){delete _0x5dde54[_0x519c('0x46')]['id'];}return db[_0x519c('0x2b')][_0x519c('0x44')]({'where':{'id':_0x5dde54['params']['id']}})[_0x519c('0x22')](handleEntityNotFound(_0xc175d9,null))[_0x519c('0x22')](saveUpdates(_0x5dde54['body'],null))[_0x519c('0x22')](respondWithResult(_0xc175d9,null))[_0x519c('0x41')](handleError(_0xc175d9,null));};exports[_0x519c('0x23')]=function(_0x29197f,_0x4de2c0){return db[_0x519c('0x2b')][_0x519c('0x44')]({'where':{'id':_0x29197f[_0x519c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4de2c0,null))['then'](removeEntity(_0x4de2c0,null))[_0x519c('0x41')](handleError(_0x4de2c0,null));};exports[_0x519c('0x48')]=function(_0x55f3ef,_0x22fceb){return db[_0x519c('0x2b')]['describe']()['then'](respondWithResult(_0x22fceb,null))['catch'](handleError(_0x22fceb,null));}; \ No newline at end of file +var _0x2913=['params','keys','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2913,0x13f));var _0x3291=function(_0x414e02,_0xc56f25){_0x414e02=_0x414e02-0x0;var _0x54f894=_0x2913[_0x414e02];return _0x54f894;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3291('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3291('0x1'));var rp=require(_0x3291('0x2'));var moment=require(_0x3291('0x3'));var BPromise=require(_0x3291('0x4'));var Mustache=require(_0x3291('0x5'));var util=require(_0x3291('0x6'));var path=require(_0x3291('0x7'));var sox=require(_0x3291('0x8'));var csv=require(_0x3291('0x9'));var ejs=require(_0x3291('0xa'));var fs=require('fs');var fs_extra=require(_0x3291('0xb'));var _=require(_0x3291('0xc'));var squel=require('squel');var crypto=require(_0x3291('0xd'));var jsforce=require(_0x3291('0xe'));var deskjs=require(_0x3291('0xf'));var toCsv=require(_0x3291('0x9'));var querystring=require(_0x3291('0x10'));var Papa=require(_0x3291('0x11'));var Redis=require(_0x3291('0x12'));var authService=require(_0x3291('0x13'));var qs=require(_0x3291('0x14'));var as=require(_0x3291('0x15'));var hardwareService=require(_0x3291('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x3291('0x17'));var config=require(_0x3291('0x18'));var licenseUtil=require(_0x3291('0x19'));var db=require(_0x3291('0x1a'))['db'];function respondWithStatusCode(_0x97b560,_0x39bd84){_0x39bd84=_0x39bd84||0xcc;return function(_0x161f5f){if(_0x161f5f){return _0x97b560[_0x3291('0x1b')](_0x39bd84);}return _0x97b560[_0x3291('0x1c')](_0x39bd84)[_0x3291('0x1d')]();};}function respondWithResult(_0x2c2c9f,_0x5c3c79){_0x5c3c79=_0x5c3c79||0xc8;return function(_0x48f2d2){if(_0x48f2d2){return _0x2c2c9f['status'](_0x5c3c79)[_0x3291('0x1e')](_0x48f2d2);}};}function respondWithFilteredResult(_0x3a0655,_0x18a70c){return function(_0x15736e){if(_0x15736e){var _0x2e6ccb=typeof _0x18a70c[_0x3291('0x1f')]==='undefined'&&typeof _0x18a70c[_0x3291('0x20')]==='undefined';var _0x524298=_0x15736e['count'];var _0x151987=_0x2e6ccb?0x0:_0x18a70c[_0x3291('0x1f')];var _0x1071eb=_0x2e6ccb?_0x15736e[_0x3291('0x21')]:_0x18a70c[_0x3291('0x1f')]+_0x18a70c[_0x3291('0x20')];var _0x3c0c10;if(_0x1071eb>=_0x524298){_0x1071eb=_0x524298;_0x3c0c10=0xc8;}else{_0x3c0c10=0xce;}_0x3a0655[_0x3291('0x1c')](_0x3c0c10);return _0x3a0655[_0x3291('0x22')](_0x3291('0x23'),_0x151987+'-'+_0x1071eb+'/'+_0x524298)[_0x3291('0x1e')](_0x15736e);}return null;};}function patchUpdates(_0x41c099){return function(_0x489e68){try{jsonpatch[_0x3291('0x24')](_0x489e68,_0x41c099,!![]);}catch(_0x7adc5b){return BPromise[_0x3291('0x25')](_0x7adc5b);}return _0x489e68['save']();};}function saveUpdates(_0x2329b2,_0xa9e256){return function(_0x2949d2){if(_0x2949d2){return _0x2949d2[_0x3291('0x26')](_0x2329b2)[_0x3291('0x27')](function(_0x207718){return _0x207718;});}return null;};}function removeEntity(_0x5168a2,_0xfd9063){return function(_0x294ab5){if(_0x294ab5){return _0x294ab5[_0x3291('0x28')]()[_0x3291('0x27')](function(){_0x5168a2[_0x3291('0x1c')](0xcc)[_0x3291('0x1d')]();});}};}function handleEntityNotFound(_0x2c1f9e,_0x40334c){return function(_0x2e3caf){if(!_0x2e3caf){_0x2c1f9e[_0x3291('0x1b')](0x194);}return _0x2e3caf;};}function handleError(_0x2144b2,_0xe3de30){_0xe3de30=_0xe3de30||0x1f4;return function(_0x34d42a){logger['error'](_0x34d42a[_0x3291('0x29')]);if(_0x34d42a[_0x3291('0x2a')]){delete _0x34d42a[_0x3291('0x2a')];}_0x2144b2['status'](_0xe3de30)[_0x3291('0x2b')](_0x34d42a);};}exports[_0x3291('0x2c')]=function(_0x41ed78,_0x46d55b){var _0x112713={},_0x33dc15={},_0x47c11e={'count':0x0,'rows':[]};var _0x476599=_['map'](db[_0x3291('0x2d')][_0x3291('0x2e')],function(_0xe58b29){return{'name':_0xe58b29[_0x3291('0x2f')],'type':_0xe58b29[_0x3291('0x30')][_0x3291('0x31')]};});_0x33dc15[_0x3291('0x32')]=_[_0x3291('0x33')](_0x476599,_0x3291('0x2a'));_0x33dc15[_0x3291('0x34')]=_['keys'](_0x41ed78[_0x3291('0x34')]);_0x33dc15[_0x3291('0x35')]=_['intersection'](_0x33dc15[_0x3291('0x32')],_0x33dc15['query']);_0x112713[_0x3291('0x36')]=_[_0x3291('0x37')](_0x33dc15[_0x3291('0x32')],qs[_0x3291('0x38')](_0x41ed78[_0x3291('0x34')][_0x3291('0x38')]));_0x112713['attributes']=_0x112713[_0x3291('0x36')][_0x3291('0x39')]?_0x112713[_0x3291('0x36')]:_0x33dc15[_0x3291('0x32')];if(!_0x41ed78[_0x3291('0x34')][_0x3291('0x3a')](_0x3291('0x3b'))){_0x112713[_0x3291('0x20')]=qs[_0x3291('0x20')](_0x41ed78[_0x3291('0x34')][_0x3291('0x20')]);_0x112713[_0x3291('0x1f')]=qs[_0x3291('0x1f')](_0x41ed78[_0x3291('0x34')][_0x3291('0x1f')]);}_0x112713['order']=qs[_0x3291('0x3c')](_0x41ed78['query']['sort']);_0x112713['where']=qs['filters'](_[_0x3291('0x3d')](_0x41ed78[_0x3291('0x34')],_0x33dc15[_0x3291('0x35')]),_0x476599);if(_0x41ed78['query'][_0x3291('0x3e')]){_0x112713[_0x3291('0x3f')]=_[_0x3291('0x40')](_0x112713[_0x3291('0x3f')],{'$or':_[_0x3291('0x33')](_0x476599,function(_0x216d3c){if(_0x216d3c[_0x3291('0x30')]!==_0x3291('0x41')){var _0x1b44a2={};_0x1b44a2[_0x216d3c['name']]={'$like':'%'+_0x41ed78[_0x3291('0x34')][_0x3291('0x3e')]+'%'};return _0x1b44a2;}})});}_0x112713=_[_0x3291('0x40')]({},_0x112713,_0x41ed78[_0x3291('0x42')]);var _0x3e13d5={'where':_0x112713[_0x3291('0x3f')]};return db[_0x3291('0x2d')][_0x3291('0x21')](_0x3e13d5)[_0x3291('0x27')](function(_0x13acfa){_0x47c11e[_0x3291('0x21')]=_0x13acfa;if(_0x41ed78[_0x3291('0x34')][_0x3291('0x43')]){_0x112713['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x3291('0x44')](_0x112713);})[_0x3291('0x27')](function(_0x1ca995){_0x47c11e['rows']=_0x1ca995;return _0x47c11e;})[_0x3291('0x27')](respondWithFilteredResult(_0x46d55b,_0x112713))[_0x3291('0x45')](handleError(_0x46d55b,null));};exports[_0x3291('0x46')]=function(_0x19f08d,_0x37c6ed){var _0x4fce96={'raw':!![],'where':{'id':_0x19f08d[_0x3291('0x47')]['id']}},_0x438be4={};_0x438be4[_0x3291('0x32')]=_['keys'](db[_0x3291('0x2d')]['rawAttributes']);_0x438be4[_0x3291('0x34')]=_[_0x3291('0x48')](_0x19f08d[_0x3291('0x34')]);_0x438be4['filters']=_[_0x3291('0x37')](_0x438be4[_0x3291('0x32')],_0x438be4[_0x3291('0x34')]);_0x4fce96[_0x3291('0x36')]=_[_0x3291('0x37')](_0x438be4[_0x3291('0x32')],qs[_0x3291('0x38')](_0x19f08d[_0x3291('0x34')]['fields']));_0x4fce96[_0x3291('0x36')]=_0x4fce96[_0x3291('0x36')][_0x3291('0x39')]?_0x4fce96[_0x3291('0x36')]:_0x438be4[_0x3291('0x32')];if(_0x19f08d[_0x3291('0x34')][_0x3291('0x43')]){_0x4fce96[_0x3291('0x49')]=[{'all':!![]}];}_0x4fce96=_[_0x3291('0x40')]({},_0x4fce96,_0x19f08d[_0x3291('0x42')]);return db[_0x3291('0x2d')]['find'](_0x4fce96)[_0x3291('0x27')](handleEntityNotFound(_0x37c6ed,null))[_0x3291('0x27')](respondWithResult(_0x37c6ed,null))[_0x3291('0x45')](handleError(_0x37c6ed,null));};exports[_0x3291('0x4a')]=function(_0x487723,_0x48804d){return db[_0x3291('0x2d')][_0x3291('0x4a')](_0x487723[_0x3291('0x4b')],{})['then'](respondWithResult(_0x48804d,0xc9))[_0x3291('0x45')](handleError(_0x48804d,null));};exports['update']=function(_0x2f33d0,_0x35f20a){if(_0x2f33d0[_0x3291('0x4b')]['id']){delete _0x2f33d0['body']['id'];}return db[_0x3291('0x2d')][_0x3291('0x4c')]({'where':{'id':_0x2f33d0[_0x3291('0x47')]['id']}})[_0x3291('0x27')](handleEntityNotFound(_0x35f20a,null))['then'](saveUpdates(_0x2f33d0['body'],null))[_0x3291('0x27')](respondWithResult(_0x35f20a,null))[_0x3291('0x45')](handleError(_0x35f20a,null));};exports[_0x3291('0x28')]=function(_0x320eed,_0x464972){return db[_0x3291('0x2d')][_0x3291('0x4c')]({'where':{'id':_0x320eed[_0x3291('0x47')]['id']}})[_0x3291('0x27')](handleEntityNotFound(_0x464972,null))[_0x3291('0x27')](removeEntity(_0x464972,null))[_0x3291('0x45')](handleError(_0x464972,null));};exports[_0x3291('0x4d')]=function(_0x97596e,_0xd08ebe){return db[_0x3291('0x2d')][_0x3291('0x4d')]()['then'](respondWithResult(_0xd08ebe,null))[_0x3291('0x45')](handleError(_0xd08ebe,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index b877ef1..a47245a 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 _0x7a0f=['ChatTransferReport','report_chat_transfer','uniqueid','api','bluebird','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x2cd29b,_0x2217ab){var _0x1217d8=function(_0x3e59fc){while(--_0x3e59fc){_0x2cd29b['push'](_0x2cd29b['shift']());}};_0x1217d8(++_0x2217ab);}(_0x7a0f,0xd4));var _0xf7a0=function(_0x34cda8,_0x45f93c){_0x34cda8=_0x34cda8-0x0;var _0x241d9c=_0x7a0f[_0x34cda8];return _0x241d9c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf7a0('0x0'));var moment=require('moment');var BPromise=require(_0xf7a0('0x1'));var rp=require(_0xf7a0('0x2'));var fs=require('fs');var path=require(_0xf7a0('0x3'));var rimraf=require('rimraf');var config=require(_0xf7a0('0x4'));var attributes=require(_0xf7a0('0x5'));module[_0xf7a0('0x6')]=function(_0xa96b6a,_0x2a0aaf){return _0xa96b6a[_0xf7a0('0x7')](_0xf7a0('0x8'),attributes,{'tableName':_0xf7a0('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf7a0('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5619=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','exports','define','ChatTransferReport'];(function(_0x51b51,_0x572939){var _0x4c03d3=function(_0x24c95a){while(--_0x24c95a){_0x51b51['push'](_0x51b51['shift']());}};_0x4c03d3(++_0x572939);}(_0x5619,0x140));var _0x9561=function(_0x3aa674,_0x5f1d3f){_0x3aa674=_0x3aa674-0x0;var _0x3cd999=_0x5619[_0x3aa674];return _0x3cd999;};'use strict';var _=require(_0x9561('0x0'));var util=require(_0x9561('0x1'));var logger=require(_0x9561('0x2'))(_0x9561('0x3'));var moment=require('moment');var BPromise=require(_0x9561('0x4'));var rp=require(_0x9561('0x5'));var fs=require('fs');var path=require(_0x9561('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x9561('0x7')]=function(_0x427c69,_0x3a9237){return _0x427c69[_0x9561('0x8')](_0x9561('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x9561('0xa'),'fields':[_0x9561('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index e793376..aa35bff 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 _0x250e=['code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0xa5c51b,_0x4000c0){var _0x8a1da4=function(_0x1c950c){while(--_0x1c950c){_0xa5c51b['push'](_0xa5c51b['shift']());}};_0x8a1da4(++_0x4000c0);}(_0x250e,0x174));var _0xe250=function(_0x179407,_0x3f49c7){_0x179407=_0x179407-0x0;var _0x249c29=_0x250e[_0x179407];return _0x249c29;};'use strict';var _=require('lodash');var util=require(_0xe250('0x0'));var moment=require(_0xe250('0x1'));var BPromise=require(_0xe250('0x2'));var rs=require(_0xe250('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe250('0x4'))['db'];var utils=require(_0xe250('0x5'));var logger=require(_0xe250('0x6'))(_0xe250('0x7'));var config=require(_0xe250('0x8'));var jayson=require(_0xe250('0x9'));var client=jayson['client'][_0xe250('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1feffb,_0x4ea7d6,_0x3e35f0){return new BPromise(function(_0x24281d,_0x58961c){return client[_0xe250('0xb')](_0x1feffb,_0x3e35f0)[_0xe250('0xc')](function(_0x35c0fb){logger[_0xe250('0xd')](_0xe250('0xe'),_0x4ea7d6,_0xe250('0xf'));logger[_0xe250('0x10')](_0xe250('0x11'),_0x4ea7d6,_0xe250('0xf'),JSON['stringify'](_0x35c0fb));if(_0x35c0fb[_0xe250('0x12')]){if(_0x35c0fb['error'][_0xe250('0x13')]===0x1f4){logger[_0xe250('0x12')](_0xe250('0xe'),_0x4ea7d6,_0x35c0fb['error'][_0xe250('0x14')]);return _0x58961c(_0x35c0fb['error'][_0xe250('0x14')]);}logger[_0xe250('0x12')](_0xe250('0xe'),_0x4ea7d6,_0x35c0fb[_0xe250('0x12')][_0xe250('0x14')]);return _0x24281d(_0x35c0fb['error'][_0xe250('0x14')]);}else{logger[_0xe250('0xd')](_0xe250('0xe'),_0x4ea7d6,_0xe250('0xf'));_0x24281d(_0x35c0fb[_0xe250('0x15')][_0xe250('0x14')]);}})[_0xe250('0x16')](function(_0x2bd6a8){logger[_0xe250('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x4ea7d6,_0x2bd6a8);_0x58961c(_0x2bd6a8);});});} \ No newline at end of file +var _0x9792=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0xec7ebb,_0x27b2da){var _0x52d0ed=function(_0x3b0aef){while(--_0x3b0aef){_0xec7ebb['push'](_0xec7ebb['shift']());}};_0x52d0ed(++_0x27b2da);}(_0x9792,0x1a4));var _0x2979=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x9792[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x2979('0x0'));var util=require(_0x2979('0x1'));var moment=require(_0x2979('0x2'));var BPromise=require('bluebird');var rs=require(_0x2979('0x3'));var fs=require('fs');var Redis=require(_0x2979('0x4'));var db=require(_0x2979('0x5'))['db'];var utils=require(_0x2979('0x6'));var logger=require(_0x2979('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2979('0x8'));var client=jayson[_0x2979('0x9')][_0x2979('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30eb86,_0x1d53de,_0x3be250){return new BPromise(function(_0x454c3b,_0x3de87d){return client[_0x2979('0xb')](_0x30eb86,_0x3be250)[_0x2979('0xc')](function(_0x37ced9){logger[_0x2979('0xd')](_0x2979('0xe'),_0x1d53de,_0x2979('0xf'));logger[_0x2979('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x1d53de,_0x2979('0xf'),JSON[_0x2979('0x11')](_0x37ced9));if(_0x37ced9[_0x2979('0x12')]){if(_0x37ced9[_0x2979('0x12')][_0x2979('0x13')]===0x1f4){logger[_0x2979('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x1d53de,_0x37ced9[_0x2979('0x12')]['message']);return _0x3de87d(_0x37ced9[_0x2979('0x12')][_0x2979('0x14')]);}logger[_0x2979('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x1d53de,_0x37ced9[_0x2979('0x12')][_0x2979('0x14')]);return _0x454c3b(_0x37ced9['error'][_0x2979('0x14')]);}else{logger[_0x2979('0xd')](_0x2979('0xe'),_0x1d53de,_0x2979('0xf'));_0x454c3b(_0x37ced9[_0x2979('0x15')][_0x2979('0x14')]);}})['catch'](function(_0x376e4b){logger[_0x2979('0x12')](_0x2979('0xe'),_0x1d53de,_0x376e4b);_0x3de87d(_0x376e4b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 0c2ef46..0b52c2e 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 _0x4341=['get','isAuthenticated','index','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller'];(function(_0x2cb99a,_0x512933){var _0x3a1881=function(_0x305584){while(--_0x305584){_0x2cb99a['push'](_0x2cb99a['shift']());}};_0x3a1881(++_0x512933);}(_0x4341,0x13c));var _0x1434=function(_0x2233be,_0xd10120){_0x2233be=_0x2233be-0x0;var _0x1a6468=_0x4341[_0x2233be];return _0x1a6468;};'use strict';var multer=require(_0x1434('0x0'));var util=require(_0x1434('0x1'));var path=require(_0x1434('0x2'));var timeout=require(_0x1434('0x3'));var express=require('express');var router=express[_0x1434('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1434('0x5'));var config=require(_0x1434('0x6'));var controller=require(_0x1434('0x7'));router[_0x1434('0x8')]('/',auth[_0x1434('0x9')](),controller[_0x1434('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x1434('0xb'),auth[_0x1434('0x9')](),controller[_0x1434('0xc')]);router['post']('/',auth[_0x1434('0x9')](),controller[_0x1434('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1434('0xe')]);router[_0x1434('0xf')](_0x1434('0xb'),auth['isAuthenticated'](),controller[_0x1434('0x10')]);module[_0x1434('0x11')]=router; \ No newline at end of file +var _0x555d=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','create','put','update','delete'];(function(_0x3a194f,_0x4964bf){var _0x43c8de=function(_0x216230){while(--_0x216230){_0x3a194f['push'](_0x3a194f['shift']());}};_0x43c8de(++_0x4964bf);}(_0x555d,0xe6));var _0xd555=function(_0x42d1f8,_0x22e529){_0x42d1f8=_0x42d1f8-0x0;var _0x40d234=_0x555d[_0x42d1f8];return _0x40d234;};'use strict';var multer=require(_0xd555('0x0'));var util=require(_0xd555('0x1'));var path=require(_0xd555('0x2'));var timeout=require(_0xd555('0x3'));var express=require(_0xd555('0x4'));var router=express['Router']();var fs_extra=require(_0xd555('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd555('0x6'));var controller=require('./chatTransferReport.controller');router[_0xd555('0x7')]('/',auth[_0xd555('0x8')](),controller[_0xd555('0x9')]);router[_0xd555('0x7')](_0xd555('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xd555('0x7')](_0xd555('0xb'),auth[_0xd555('0x8')](),controller[_0xd555('0xc')]);router['post']('/',auth[_0xd555('0x8')](),controller[_0xd555('0xd')]);router[_0xd555('0xe')]('/:id',auth[_0xd555('0x8')](),controller[_0xd555('0xf')]);router[_0xd555('0x10')]('/:id',auth[_0xd555('0x8')](),controller[_0xd555('0x11')]);module[_0xd555('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 9c9f0c8..3ea7e21 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 _0xb58b=['alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Chat','Contact\x20us','BOOLEAN','TEXT','Form\x20properly\x20submitted','Type\x20a\x20message','Skip','star','thumb','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Send','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT'];(function(_0x14d63b,_0x30da49){var _0x22fadd=function(_0x44e81d){while(--_0x44e81d){_0x14d63b['push'](_0x14d63b['shift']());}};_0x22fadd(++_0x30da49);}(_0xb58b,0x1f1));var _0xbb58=function(_0x259c3b,_0x493ca0){_0x259c3b=_0x259c3b-0x0;var _0xe0d619=_0xb58b[_0x259c3b];return _0xe0d619;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbb58('0x0'));module[_0xbb58('0x1')]={'name':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xbb58('0x3')},'description':{'type':Sequelize[_0xbb58('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x4')},'key':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xbb58('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xbb58('0x8')]('rounded',_0xbb58('0x9')),'defaultValue':_0xbb58('0xa')},'header_online':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0xc')},'offline_chat_button':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0xd')},'download_transcript':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xbb58('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x11')},'closingMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x12')},'conditionAgreement':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xbb58('0x8')](_0xbb58('0x13'),_0xbb58('0x14')),'defaultValue':_0xbb58('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':function(){return JSON[_0xbb58('0x15')]({'items':[{'type':_0xbb58('0x16'),'variable':null,'config':{'placeholder':_0xbb58('0x17'),'type':'text','required':!![]},'props':{'title':_0xbb58('0x17'),'helpText':''}},{'type':'input','props':{'title':_0xbb58('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb58('0x4'),'type':_0xbb58('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xbb58('0x18')](_0xbb58('0x19'))?JSON[_0xbb58('0x1a')](this[_0xbb58('0x18')](_0xbb58('0x19'))):{};},'set':function(_0x4e0303){return this[_0xbb58('0x1b')](_0xbb58('0x19'),JSON[_0xbb58('0x15')](_0x4e0303));}},'offlineForm':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':function(){return JSON[_0xbb58('0x15')]({'items':[{'type':_0xbb58('0x16'),'props':{'title':_0xbb58('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xbb58('0x4'),'type':_0xbb58('0x4')},'variable':null},{'type':_0xbb58('0x1c'),'config':{'placeholder':_0xbb58('0x1d')},'props':{'title':_0xbb58('0x1d'),'helpText':_0xbb58('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xbb58('0x18')](_0xbb58('0x1f'))?JSON['parse'](this[_0xbb58('0x18')](_0xbb58('0x1f'))):{};},'set':function(_0x12b3eb){return this[_0xbb58('0x1b')](_0xbb58('0x1f'),JSON[_0xbb58('0x15')](_0x12b3eb));}},'token':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':function(){return rs[_0xbb58('0x20')]();}},'autoclose':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xbb58('0x2')]},'forwardOffline':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xbb58('0x2')]},'waitingTitle':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x21')},'waitingMessage':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x23')},'offlineMessageBody':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x24')},'enableUnmanagedNote':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x12')},'sendUnmanaged':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x25')},'enableCustomerAttachment':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xbb58('0xf')]},'showAgentAvatar':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xbb58('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbb58('0x26');}},'notificationSound':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xbb58('0x27')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x29')},'messagesAlignment':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':_0xbb58('0x2a')},'defaultTitle':{'type':Sequelize[_0xbb58('0x2')]},'customerAvatar':{'type':Sequelize[_0xbb58('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xbb58('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xbb58('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbb58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xbb58('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbb58('0x7')],'comment':_0xbb58('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xc29171){if(!_0xc29171)this[_0xbb58('0x1b')](_0xbb58('0x2d'),null);this[_0xbb58('0x1b')](_0xbb58('0x2e'),_0xc29171);}},'vidaooEscalation':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xbb58('0x2')],'allowNull':![],'defaultValue':_0xbb58('0x2f')},'vidaooNote':{'type':Sequelize[_0xbb58('0x2')],'defaultValue':function(){return _0xbb58('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xbb58('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xbb58('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xdace=['Generated\x20by\x20XCALLY\x20Motion','sequelize','exports','STRING','email','Agent','#011F6A','#ffffff','BOOLEAN','squared','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','INTEGER','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Type\x20a\x20message','Skip','Feedback','ENUM','star','thumb','input','name','getDataValue','parse','onlineForm','setDataValue','stringify','textarea','Comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x5d9ceb,_0x1a49f5){var _0x33ce82=function(_0x583915){while(--_0x583915){_0x5d9ceb['push'](_0x5d9ceb['shift']());}};_0x33ce82(++_0x1a49f5);}(_0xdace,0xc5));var _0xedac=function(_0x3825a8,_0x2ce1a2){_0x3825a8=_0x3825a8-0x0;var _0xabc9bc=_0xdace[_0x3825a8];return _0xabc9bc;};'use strict';var Sequelize=require(_0xedac('0x0'));var rs=require('randomstring');module[_0xedac('0x1')]={'name':{'type':Sequelize[_0xedac('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xedac('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xedac('0x2')]},'mapKey':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x3')},'mapKeyOffline':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'email'},'key':{'type':Sequelize[_0xedac('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xedac('0x2')],'allowNull':![],'defaultValue':_0xedac('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xedac('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xedac('0x2')],'allowNull':![],'defaultValue':_0xedac('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xedac('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xedac('0x2')]},'animation':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xedac('0x8')),'defaultValue':_0xedac('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xedac('0xa')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xedac('0xb')},'offline_chat_button':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0xc')},'header_offline':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0xd')},'download_transcript':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xedac('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xedac('0xf')]},'closingQuestion':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x11')},'placeholderMessage':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x12')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0xc')},'skipMessageButton':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x14')},'ratingType':{'type':Sequelize[_0xedac('0x15')](_0xedac('0x16'),_0xedac('0x17')),'defaultValue':_0xedac('0x16')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xedac('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xedac('0x18'),'variable':null,'config':{'placeholder':_0xedac('0x19'),'type':'text','required':!![]},'props':{'title':_0xedac('0x19'),'helpText':''}},{'type':_0xedac('0x18'),'props':{'title':_0xedac('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xedac('0x3'),'type':_0xedac('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xedac('0x1a')]('onlineForm')?JSON[_0xedac('0x1b')](this[_0xedac('0x1a')](_0xedac('0x1c'))):{};},'set':function(_0x41ad8d){return this[_0xedac('0x1d')](_0xedac('0x1c'),JSON[_0xedac('0x1e')](_0x41ad8d));}},'offlineForm':{'type':Sequelize[_0xedac('0xf')],'defaultValue':function(){return JSON[_0xedac('0x1e')]({'items':[{'type':_0xedac('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xedac('0x3'),'type':_0xedac('0x3')},'variable':null},{'type':_0xedac('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0xedac('0x20'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xedac('0x21'))?JSON[_0xedac('0x1b')](this[_0xedac('0x1a')](_0xedac('0x21'))):{};},'set':function(_0x555f1f){return this['setDataValue'](_0xedac('0x21'),JSON[_0xedac('0x1e')](_0x555f1f));}},'token':{'type':Sequelize[_0xedac('0x2')],'defaultValue':function(){return rs[_0xedac('0x22')]();}},'autoclose':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xedac('0x2')]},'waitingTitle':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x23')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xedac('0x24')},'offlineMessageBody':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x25')},'skipUnmanaged':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x13')},'sendUnmanaged':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xedac('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xedac('0x2')]},'notificationTemplate':{'type':Sequelize[_0xedac('0xf')],'defaultValue':function(){return _0xedac('0x26');}},'notificationSound':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xedac('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x28')},'verticalAlignment':{'type':Sequelize[_0xedac('0xe')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x29')},'messagesAlignment':{'type':Sequelize[_0xedac('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0xedac('0x2')]},'customerAvatar':{'type':Sequelize[_0xedac('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xedac('0xe')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xedac('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xedac('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xedac('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xedac('0x2')],'defaultValue':_0xedac('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xedac('0xe')],'comment':_0xedac('0x2c')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xedac('0x2d'),'set':function(_0x2fa832){if(!_0x2fa832)this['setDataValue'](_0xedac('0x2e'),null);this['setDataValue'](_0xedac('0x2f'),_0x2fa832);}},'vidaooEscalation':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xedac('0x2')]},'vidaooTopic':{'type':Sequelize[_0xedac('0x2')],'allowNull':![],'defaultValue':_0xedac('0x30')},'vidaooNote':{'type':Sequelize[_0xedac('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xedac('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xedac('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xedac('0xf')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 2d144ac..8eea934 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 _0x4120=['count','Content-Range','update','destroy','get','ChatWebsites','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','ChatWebsite','includeAll','include','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','sitepic','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','headers','first','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ContactId','interaction','ChatInteraction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','fullname','Tag','color','tag','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','increment','chatLicenseExceeded','all','server/files/chat/iframe.ejs','stringify','connection','remoteAddress','replace','labelText','textColor','hideWhenOffline','IntervalId','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','addAgents','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','limit','undefined'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x4120,0x106));var _0x0412=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4120[_0x5ddb1c];return _0x354adc;};'use strict';var BPromise=require(_0x0412('0x0'));var Mustache=require(_0x0412('0x1'));var util=require(_0x0412('0x2'));var path=require(_0x0412('0x3'));var ejs=require(_0x0412('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0412('0x5'));var querystring=require(_0x0412('0x6'));var Redis=require(_0x0412('0x7'));var qs=require(_0x0412('0x8'));var logger=require(_0x0412('0x9'))(_0x0412('0xa'));var config=require(_0x0412('0xb'));var db=require(_0x0412('0xc'))['db'];config[_0x0412('0xd')]=_[_0x0412('0xe')](config[_0x0412('0xd')],{'host':_0x0412('0xf'),'port':0x18eb});var socket=require(_0x0412('0x10'))(new Redis(config[_0x0412('0xd')]));require(_0x0412('0x11'))[_0x0412('0x12')](socket);var htmlToText=require('html-to-text');var jayson=require(_0x0412('0x13'));var client=jayson[_0x0412('0x14')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});var client9003=jayson[_0x0412('0x14')][_0x0412('0x15')]({'port':0x232b});var client9001=jayson[_0x0412('0x14')][_0x0412('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x51dd7e,_0x2d0ad8,_0x425e19,_0x237cbc){return new BPromise(function(_0xb2dbd,_0x3d927a){var _0x58527a=_0x237cbc||client;return _0x58527a[_0x0412('0x16')](_0x51dd7e,_0x425e19)[_0x0412('0x17')](function(_0x4a2f39){logger[_0x0412('0x18')](_0x0412('0x19'),_0x2d0ad8,_0x0412('0x1a'));logger[_0x0412('0x1b')](_0x0412('0x1c'),_0x2d0ad8,_0x0412('0x1a'),JSON['stringify'](_0x4a2f39));if(_0x4a2f39['error']){if(_0x4a2f39[_0x0412('0x1d')][_0x0412('0x1e')]===0x1f4){logger[_0x0412('0x1d')](_0x0412('0x19'),_0x2d0ad8,_0x4a2f39[_0x0412('0x1d')][_0x0412('0x1f')]);return _0x3d927a(_0x4a2f39[_0x0412('0x1d')]['message']);}logger['error'](_0x0412('0x19'),_0x2d0ad8,_0x4a2f39[_0x0412('0x1d')][_0x0412('0x1f')]);return _0xb2dbd(_0x4a2f39[_0x0412('0x1d')]['message']);}else{logger[_0x0412('0x18')](_0x0412('0x19'),_0x2d0ad8,'request\x20sent');_0xb2dbd(_0x4a2f39[_0x0412('0x20')][_0x0412('0x1f')]);}})[_0x0412('0x21')](function(_0x5682c9){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x2d0ad8,_0x5682c9);_0x3d927a(_0x5682c9);});});}function respondWithStatusCode(_0x406747,_0x3f5cd8){_0x3f5cd8=_0x3f5cd8||0xcc;return function(_0x4f74e2){if(_0x4f74e2){return _0x406747['sendStatus'](_0x3f5cd8);}return _0x406747[_0x0412('0x22')](_0x3f5cd8)[_0x0412('0x23')]();};}function respondWithResult(_0x52109d,_0x6c2fbb){_0x6c2fbb=_0x6c2fbb||0xc8;return function(_0x121dfb){if(_0x121dfb){return _0x52109d[_0x0412('0x22')](_0x6c2fbb)[_0x0412('0x24')](_0x121dfb);}};}function respondWithFilteredResult(_0x378808,_0x25fc74){return function(_0x81f558){if(_0x81f558){var _0x4ac899=typeof _0x25fc74[_0x0412('0x25')]==='undefined'&&typeof _0x25fc74[_0x0412('0x26')]===_0x0412('0x27');var _0x319c5=_0x81f558['count'];var _0x234bd1=_0x4ac899?0x0:_0x25fc74['offset'];var _0x5318b1=_0x4ac899?_0x81f558[_0x0412('0x28')]:_0x25fc74['offset']+_0x25fc74[_0x0412('0x26')];var _0x115ea2;if(_0x5318b1>=_0x319c5){_0x5318b1=_0x319c5;_0x115ea2=0xc8;}else{_0x115ea2=0xce;}_0x378808['status'](_0x115ea2);return _0x378808['set'](_0x0412('0x29'),_0x234bd1+'-'+_0x5318b1+'/'+_0x319c5)[_0x0412('0x24')](_0x81f558);}return null;};}function saveUpdates(_0x1881bc){return function(_0x497d77){if(_0x497d77){return _0x497d77[_0x0412('0x2a')](_0x1881bc)[_0x0412('0x17')](function(_0x12ab77){return _0x12ab77;});}return null;};}function removeEntity(_0x19b83d){return function(_0x39e362){if(_0x39e362){return _0x39e362[_0x0412('0x2b')]()[_0x0412('0x17')](function(){var _0x52dbfc=_0x39e362[_0x0412('0x2c')]({'plain':!![]});var _0x70e3cf=_0x0412('0x2d');return db['UserProfileResource'][_0x0412('0x2b')]({'where':{'type':_0x70e3cf,'resourceId':_0x52dbfc['id']}})[_0x0412('0x17')](function(){return _0x39e362;});})[_0x0412('0x17')](function(){_0x19b83d[_0x0412('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ed552){return function(_0x36e8fc){if(!_0x36e8fc){_0x1ed552[_0x0412('0x2e')](0x194);}return _0x36e8fc;};}function handleError(_0xf55227,_0x494493){_0x494493=_0x494493||0x1f4;return function(_0x58ca71){logger[_0x0412('0x1d')](_0x58ca71[_0x0412('0x2f')]);if(_0x58ca71[_0x0412('0x30')]){delete _0x58ca71[_0x0412('0x30')];}_0xf55227[_0x0412('0x22')](_0x494493)[_0x0412('0x31')](_0x58ca71);};}exports[_0x0412('0x32')]=function(_0xd127bf,_0x47e8ba){var _0x423054={'include':[{'model':db[_0x0412('0x33')],'as':_0x0412('0x34')}]},_0xfd1b7f={},_0xc6f203={'count':0x0,'rows':[]};var _0x5acd2e=_[_0x0412('0x35')](db['ChatWebsite']['rawAttributes'],function(_0x1d620d){return{'name':_0x1d620d[_0x0412('0x36')],'type':_0x1d620d[_0x0412('0x37')][_0x0412('0x38')]};});_0xfd1b7f[_0x0412('0x39')]=_[_0x0412('0x35')](_0x5acd2e,'name');_0xfd1b7f[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0xd127bf[_0x0412('0x3a')]);_0xfd1b7f[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0xfd1b7f[_0x0412('0x39')],_0xfd1b7f['query']);_0x423054[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0xfd1b7f[_0x0412('0x39')],qs[_0x0412('0x3f')](_0xd127bf[_0x0412('0x3a')][_0x0412('0x3f')]));_0x423054['attributes']=_0x423054['attributes'][_0x0412('0x40')]?_0x423054[_0x0412('0x3e')]:_0xfd1b7f[_0x0412('0x39')];if(!_0xd127bf['query'][_0x0412('0x41')](_0x0412('0x42'))){_0x423054[_0x0412('0x26')]=qs['limit'](_0xd127bf[_0x0412('0x3a')]['limit']);_0x423054[_0x0412('0x25')]=qs[_0x0412('0x25')](_0xd127bf[_0x0412('0x3a')]['offset']);}_0x423054[_0x0412('0x43')]=qs['sort'](_0xd127bf[_0x0412('0x3a')][_0x0412('0x44')]);_0x423054['where']=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0xd127bf['query'],_0xfd1b7f[_0x0412('0x3c')]),_0x5acd2e);if(_0xd127bf[_0x0412('0x3a')]['filter']){_0x423054['where']=_[_0x0412('0x46')](_0x423054[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x5acd2e,function(_0x510bb9){if(_0x510bb9['type']!==_0x0412('0x48')){var _0x404dc6={};_0x404dc6[_0x510bb9[_0x0412('0x30')]]={'$like':'%'+_0xd127bf[_0x0412('0x3a')][_0x0412('0x49')]+'%'};return _0x404dc6;}})});}_0x423054=_[_0x0412('0x46')]({},_0x423054,_0xd127bf[_0x0412('0x4a')]);var _0x5aa7e4={'where':_0x423054['where']};return db[_0x0412('0x4b')]['count'](_0x5aa7e4)['then'](function(_0x393b69){_0xc6f203[_0x0412('0x28')]=_0x393b69;if(_0xd127bf[_0x0412('0x3a')][_0x0412('0x4c')]){_0x423054[_0x0412('0x4d')]=[{'all':!![]}];}return db[_0x0412('0x4b')]['findAll'](_0x423054);})[_0x0412('0x17')](function(_0x1f52a8){_0xc6f203['rows']=_0x1f52a8;return _0xc6f203;})[_0x0412('0x17')](respondWithFilteredResult(_0x47e8ba,_0x423054))['catch'](handleError(_0x47e8ba,null));};exports[_0x0412('0x4e')]=function(_0x5737dd,_0x288b09){var _0x2f2ed2={'raw':![],'where':{'id':_0x5737dd[_0x0412('0x4f')]['id']},'include':[{'model':db[_0x0412('0x33')],'as':'mandatoryDispositionPause'}]},_0x2e6601={};_0x2e6601[_0x0412('0x39')]=_[_0x0412('0x3b')](db[_0x0412('0x4b')][_0x0412('0x50')]);_0x2e6601[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0x5737dd['query']);_0x2e6601[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0x2e6601['model'],_0x2e6601[_0x0412('0x3a')]);_0x2f2ed2[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0x2e6601['model'],qs[_0x0412('0x3f')](_0x5737dd[_0x0412('0x3a')][_0x0412('0x3f')]));_0x2f2ed2[_0x0412('0x3e')]=_0x2f2ed2['attributes'][_0x0412('0x40')]?_0x2f2ed2[_0x0412('0x3e')]:_0x2e6601[_0x0412('0x39')];if(_0x5737dd[_0x0412('0x3a')][_0x0412('0x4c')]){_0x2f2ed2['include']=[{'all':!![]}];}_0x2f2ed2=_[_0x0412('0x46')]({},_0x2f2ed2,_0x5737dd['options']);return db[_0x0412('0x4b')][_0x0412('0x51')](_0x2f2ed2)[_0x0412('0x17')](handleEntityNotFound(_0x288b09,null))['then'](respondWithResult(_0x288b09,null))['catch'](handleError(_0x288b09,null));};exports[_0x0412('0x52')]=function(_0x3f7e61,_0x1739fc){return db[_0x0412('0x4b')][_0x0412('0x52')](_0x3f7e61[_0x0412('0x53')],{})[_0x0412('0x17')](function(_0x339c36){var _0x4b7f4e=_0x3f7e61['user'][_0x0412('0x2c')]({'plain':!![]});if(!_0x4b7f4e)throw new Error(_0x0412('0x54'));if(_0x4b7f4e[_0x0412('0x55')]===_0x0412('0x56')){var _0x34151d=_0x339c36[_0x0412('0x2c')]({'plain':!![]});var _0x221381=_0x0412('0x2d');return db[_0x0412('0x57')][_0x0412('0x51')]({'where':{'name':_0x221381,'userProfileId':_0x4b7f4e[_0x0412('0x58')]},'raw':!![]})[_0x0412('0x17')](function(_0x371690){if(_0x371690&&_0x371690[_0x0412('0x59')]===0x0){return db[_0x0412('0x5a')][_0x0412('0x52')]({'name':_0x34151d[_0x0412('0x30')],'resourceId':_0x34151d['id'],'type':_0x371690[_0x0412('0x30')],'sectionId':_0x371690['id']},{})[_0x0412('0x17')](function(){return _0x339c36;});}else{return _0x339c36;}})[_0x0412('0x21')](function(_0xc3b176){logger[_0x0412('0x1d')](_0x0412('0x5b'),_0xc3b176);throw _0xc3b176;});}return _0x339c36;})['then'](respondWithResult(_0x1739fc,0xc9))[_0x0412('0x21')](handleError(_0x1739fc,null));};exports[_0x0412('0x2a')]=function(_0x478336,_0x875b7b){if(_0x478336[_0x0412('0x53')]['id']){delete _0x478336[_0x0412('0x53')]['id'];}return db[_0x0412('0x4b')]['find']({'where':{'id':_0x478336[_0x0412('0x4f')]['id']},'include':[{'model':db[_0x0412('0x33')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x875b7b,null))[_0x0412('0x17')](saveUpdates(_0x478336[_0x0412('0x53')],null))['then'](respondWithResult(_0x875b7b,null))[_0x0412('0x21')](handleError(_0x875b7b,null));};exports[_0x0412('0x2b')]=function(_0x31950c,_0x4a81fc){return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x31950c['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x4a81fc,null))[_0x0412('0x17')](removeEntity(_0x4a81fc,null))['catch'](handleError(_0x4a81fc,null));};exports[_0x0412('0x5c')]=function(_0x392206,_0x50a59a){return db['ChatWebsite'][_0x0412('0x5c')]()[_0x0412('0x17')](respondWithResult(_0x50a59a,null))[_0x0412('0x21')](handleError(_0x50a59a,null));};exports[_0x0412('0x5d')]=function(_0x2a50b,_0x3543d2){if(_0x2a50b[_0x0412('0x53')]['id']){delete _0x2a50b[_0x0412('0x53')]['id'];}return db['ChatWebsite'][_0x0412('0x51')]({'where':{'id':_0x2a50b[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3543d2,null))[_0x0412('0x17')](function(_0x5891f0){if(_0x5891f0){_0x2a50b[_0x0412('0x53')][_0x0412('0x5e')]=_0x5891f0['id'];return db[_0x0412('0x5f')][_0x0412('0x52')](_0x2a50b[_0x0412('0x53')]);}})['then'](respondWithResult(_0x3543d2,null))[_0x0412('0x21')](handleError(_0x3543d2,null));};exports[_0x0412('0x60')]=function(_0x44f845,_0x13ec39){var _0x156f3c={'raw':![],'where':{}};var _0x426cc2={};var _0x3a420d={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0412('0x61')]({'where':{'id':_0x44f845[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x13ec39,null))[_0x0412('0x17')](function(_0x3e47a1){if(_0x3e47a1){_0x426cc2[_0x0412('0x39')]=_[_0x0412('0x3b')](db[_0x0412('0x5f')][_0x0412('0x50')]);_0x426cc2['query']=_[_0x0412('0x3b')](_0x44f845[_0x0412('0x3a')]);_0x426cc2['filters']=_[_0x0412('0x3d')](_0x426cc2[_0x0412('0x39')],_0x426cc2['query']);_0x156f3c[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0x426cc2['model'],qs[_0x0412('0x3f')](_0x44f845['query'][_0x0412('0x3f')]));_0x156f3c['attributes']=_0x156f3c[_0x0412('0x3e')][_0x0412('0x40')]?_0x156f3c[_0x0412('0x3e')]:_0x426cc2[_0x0412('0x39')];if(!_0x44f845['query']['hasOwnProperty'](_0x0412('0x42'))){_0x156f3c['limit']=qs['limit'](_0x44f845[_0x0412('0x3a')]['limit']);_0x156f3c[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x44f845[_0x0412('0x3a')][_0x0412('0x25')]);}_0x156f3c[_0x0412('0x43')]=qs[_0x0412('0x44')](_0x44f845[_0x0412('0x3a')]['sort']);_0x156f3c[_0x0412('0x47')]=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0x44f845[_0x0412('0x3a')],_0x426cc2[_0x0412('0x3c')]));_0x156f3c[_0x0412('0x47')][_0x0412('0x5e')]=_0x3e47a1['id'];if(_0x44f845['query']['filter']){_0x156f3c[_0x0412('0x47')]=_[_0x0412('0x46')](_0x156f3c[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x156f3c[_0x0412('0x3e')],function(_0x4dcb78){var _0x29b7de={};_0x29b7de[_0x4dcb78]={'$like':'%'+_0x44f845[_0x0412('0x3a')][_0x0412('0x49')]+'%'};return _0x29b7de;})});}_0x156f3c=_[_0x0412('0x46')]({},_0x156f3c,_0x44f845[_0x0412('0x4a')]);return db[_0x0412('0x5f')][_0x0412('0x28')]({'where':_0x156f3c['where']})['then'](function(_0x49daf8){_0x3a420d['count']=_0x49daf8;if(_0x44f845[_0x0412('0x3a')][_0x0412('0x4c')]){_0x156f3c[_0x0412('0x4d')]=[{'all':!![]}];}return db[_0x0412('0x5f')][_0x0412('0x62')](_0x156f3c);})[_0x0412('0x17')](function(_0x2d0c3e){_0x3a420d[_0x0412('0x63')]=_0x2d0c3e;return _0x3a420d;});}})[_0x0412('0x17')](respondWithFilteredResult(_0x13ec39,_0x156f3c))[_0x0412('0x21')](handleError(_0x13ec39,null));};exports[_0x0412('0x64')]=function(_0x4a993a,_0x564421){return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x4a993a[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x564421,null))[_0x0412('0x17')](function(_0xe94a5d){if(_0xe94a5d){return _0xe94a5d[_0x0412('0x64')](_0x4a993a['query']['ids']);}})[_0x0412('0x17')](respondWithStatusCode(_0x564421,null))[_0x0412('0x21')](handleError(_0x564421,null));};exports[_0x0412('0x65')]=function(_0x3de0c1,_0x47d8c6){if(_0x3de0c1['body']['id']){delete _0x3de0c1[_0x0412('0x53')]['id'];}return db[_0x0412('0x4b')]['find']({'where':{'id':_0x3de0c1[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x47d8c6,null))[_0x0412('0x17')](function(_0x3a07c8){if(_0x3a07c8){_0x3de0c1['body']['ChatWebsiteId']=_0x3a07c8['id'];return db[_0x0412('0x66')]['create'](_0x3de0c1[_0x0412('0x53')]);}})[_0x0412('0x17')](respondWithResult(_0x47d8c6,null))[_0x0412('0x21')](handleError(_0x47d8c6,null));};exports[_0x0412('0x67')]=function(_0x53bcd2,_0x3af7e6){var _0x5e2b63={'raw':![],'where':{}};var _0x3ddd8b={};var _0x1e6be6={'count':0x0,'rows':[]};return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x53bcd2['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3af7e6,null))['then'](function(_0x14f3d5){if(_0x14f3d5){_0x3ddd8b['model']=_[_0x0412('0x3b')](db['CannedAnswer']['rawAttributes']);_0x3ddd8b['query']=_['keys'](_0x53bcd2['query']);_0x3ddd8b[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0x3ddd8b[_0x0412('0x39')],_0x3ddd8b[_0x0412('0x3a')]);_0x5e2b63['attributes']=_[_0x0412('0x3d')](_0x3ddd8b[_0x0412('0x39')],qs[_0x0412('0x3f')](_0x53bcd2[_0x0412('0x3a')]['fields']));_0x5e2b63[_0x0412('0x3e')]=_0x5e2b63[_0x0412('0x3e')][_0x0412('0x40')]?_0x5e2b63[_0x0412('0x3e')]:_0x3ddd8b[_0x0412('0x39')];if(!_0x53bcd2[_0x0412('0x3a')][_0x0412('0x41')](_0x0412('0x42'))){_0x5e2b63[_0x0412('0x26')]=qs['limit'](_0x53bcd2[_0x0412('0x3a')][_0x0412('0x26')]);_0x5e2b63[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x53bcd2[_0x0412('0x3a')][_0x0412('0x25')]);}_0x5e2b63[_0x0412('0x43')]=qs['sort'](_0x53bcd2['query'][_0x0412('0x44')]);_0x5e2b63[_0x0412('0x47')]=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0x53bcd2[_0x0412('0x3a')],_0x3ddd8b[_0x0412('0x3c')]));_0x5e2b63['where']['ChatWebsiteId']=_0x14f3d5['id'];if(_0x53bcd2['query'][_0x0412('0x49')]){_0x5e2b63[_0x0412('0x47')]=_[_0x0412('0x46')](_0x5e2b63[_0x0412('0x47')],{'$or':_['map'](_0x5e2b63[_0x0412('0x3e')],function(_0x12ff59){var _0x38434b={};_0x38434b[_0x12ff59]={'$like':'%'+_0x53bcd2[_0x0412('0x3a')]['filter']+'%'};return _0x38434b;})});}_0x5e2b63=_[_0x0412('0x46')]({},_0x5e2b63,_0x53bcd2['options']);return db[_0x0412('0x66')][_0x0412('0x28')]({'where':_0x5e2b63[_0x0412('0x47')]})[_0x0412('0x17')](function(_0x35aecc){_0x1e6be6[_0x0412('0x28')]=_0x35aecc;if(_0x53bcd2[_0x0412('0x3a')][_0x0412('0x4c')]){_0x5e2b63[_0x0412('0x4d')]=[{'all':!![]}];}return db[_0x0412('0x66')][_0x0412('0x62')](_0x5e2b63);})[_0x0412('0x17')](function(_0x3d9c90){_0x1e6be6[_0x0412('0x63')]=_0x3d9c90;return _0x1e6be6;});}})[_0x0412('0x17')](respondWithFilteredResult(_0x3af7e6,_0x5e2b63))[_0x0412('0x21')](handleError(_0x3af7e6,null));};exports[_0x0412('0x68')]=function(_0x4228bb,_0x3b15d3){return db['ChatWebsite'][_0x0412('0x51')]({'where':{'id':_0x4228bb[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3b15d3,null))[_0x0412('0x17')](function(_0x476b76){if(_0x476b76){return _0x476b76[_0x0412('0x68')](_0x4228bb[_0x0412('0x3a')][_0x0412('0x69')]);}})[_0x0412('0x17')](respondWithStatusCode(_0x3b15d3,null))['catch'](handleError(_0x3b15d3,null));};exports[_0x0412('0x6a')]=function(_0x30bee2,_0x332183){_0x30bee2[_0x0412('0x53')]['sitepic']=_0x30bee2[_0x0412('0x6b')][_0x0412('0x6c')];return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x30bee2[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x332183,null))[_0x0412('0x17')](saveUpdates(_0x30bee2['body'],null))[_0x0412('0x17')](respondWithResult(_0x332183,null))[_0x0412('0x21')](handleError(_0x332183,null));};exports[_0x0412('0x6d')]=function(_0x2f56de,_0x4a86ba){_0x2f56de['body'][_0x0412('0x6e')]=_0x2f56de['file'][_0x0412('0x6c')];return db[_0x0412('0x4b')]['find']({'where':{'id':_0x2f56de['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x4a86ba,null))['then'](saveUpdates(_0x2f56de[_0x0412('0x53')],null))[_0x0412('0x17')](respondWithResult(_0x4a86ba,null))[_0x0412('0x21')](handleError(_0x4a86ba,null));};exports[_0x0412('0x6f')]=function(_0x4164ce,_0x4642b9){_0x4164ce[_0x0412('0x53')][_0x0412('0x70')]=_0x4164ce[_0x0412('0x6b')][_0x0412('0x6c')];return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x4164ce['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x4642b9,null))['then'](saveUpdates(_0x4164ce[_0x0412('0x53')],null))['then'](respondWithResult(_0x4642b9,null))[_0x0412('0x21')](handleError(_0x4642b9,null));};exports[_0x0412('0x71')]=function(_0x56a594,_0x30c3f2){_0x56a594['body']['systemAvatar']=_0x56a594[_0x0412('0x6b')]['filename'];return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x56a594['params']['id']}})['then'](handleEntityNotFound(_0x30c3f2,null))[_0x0412('0x17')](saveUpdates(_0x56a594[_0x0412('0x53')],null))[_0x0412('0x17')](respondWithResult(_0x30c3f2,null))[_0x0412('0x21')](handleError(_0x30c3f2,null));};exports[_0x0412('0x72')]=function(_0x4f0d26,_0x4d40e1){var _0x4f7629=path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x75'));var _0x4c2442={'where':{'id':_0x4f0d26[_0x0412('0x4f')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x589b03=![];return require(_0x0412('0x76'))[_0x0412('0x77')]()[_0x0412('0x17')](function(_0x1b804f){if(_0x1b804f){_0x589b03=_0x1b804f['custom'];}})[_0x0412('0x17')](function(){return db[_0x0412('0x4b')][_0x0412('0x51')](_0x4c2442);})[_0x0412('0x17')](handleEntityNotFound(_0x4d40e1,null))[_0x0412('0x17')](function(_0x67bb65){if(_0x67bb65){if(!_['isNil'](_0x67bb65[_0x0412('0x78')])){if(fs[_0x0412('0x79')](path[_0x0412('0x73')](config['root'],_0x0412('0x7a'),_0x67bb65[_0x0412('0x78')]))&&_0x589b03){_0x4f7629=path[_0x0412('0x73')](config[_0x0412('0x74')],'server/files/images/logos/',_0x67bb65[_0x0412('0x78')]);}}return _0x4d40e1[_0x0412('0x7b')](_0x4f7629);}})[_0x0412('0x21')](handleError(_0x4d40e1,null));};exports[_0x0412('0x7c')]=function(_0x11d9d4,_0x214cc8){var _0xf92d6=path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x7d'));var _0x21680b={'where':{'id':_0x11d9d4[_0x0412('0x4f')]['id']},'attributes':['id',_0x0412('0x6e')],'raw':!![]};return db[_0x0412('0x4b')][_0x0412('0x51')](_0x21680b)[_0x0412('0x17')](handleEntityNotFound(_0x214cc8,null))[_0x0412('0x17')](function(_0x254883){if(_0x254883){if(!_[_0x0412('0x7e')](_0x254883['agentAvatar'])){if(fs[_0x0412('0x79')](path[_0x0412('0x73')](config['root'],'server/files/images/avatars/',_0x254883[_0x0412('0x6e')]))){_0xf92d6=path[_0x0412('0x73')](config[_0x0412('0x74')],'server/files/images/avatars/',_0x254883['agentAvatar']);}}return _0x214cc8[_0x0412('0x7b')](_0xf92d6);}})[_0x0412('0x21')](handleError(_0x214cc8,null));};exports[_0x0412('0x7f')]=function(_0x586e5b,_0x4e2510){var _0x248e9a=path[_0x0412('0x73')](config[_0x0412('0x74')],'server/files/images/avatars/customer_avatar.png');var _0x201a5c={'where':{'id':_0x586e5b['params']['id']},'attributes':['id',_0x0412('0x70'),_0x0412('0x80')],'raw':!![]};return db['ChatWebsite'][_0x0412('0x51')](_0x201a5c)[_0x0412('0x17')](handleEntityNotFound(_0x4e2510,null))[_0x0412('0x17')](function(_0x3f59f6){if(_0x3f59f6){if(!_[_0x0412('0x7e')](_0x3f59f6[_0x0412('0x70')])){if(fs[_0x0412('0x79')](path[_0x0412('0x73')](config[_0x0412('0x74')],'server/files/images/avatars/',_0x3f59f6[_0x0412('0x70')]))&&_0x3f59f6[_0x0412('0x80')]){_0x248e9a=path['join'](config[_0x0412('0x74')],_0x0412('0x81'),_0x3f59f6['customerAvatar']);}}return _0x4e2510['download'](_0x248e9a);}})[_0x0412('0x21')](handleError(_0x4e2510,null));};exports[_0x0412('0x82')]=function(_0x5590c4,_0x35d151){var _0x41017c=path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x83'));var _0x2c2700={'where':{'id':_0x5590c4[_0x0412('0x4f')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x0412('0x4b')]['find'](_0x2c2700)[_0x0412('0x17')](handleEntityNotFound(_0x35d151,null))[_0x0412('0x17')](function(_0x444984){if(_0x444984){if(!_[_0x0412('0x7e')](_0x444984['systemAvatar'])){if(fs[_0x0412('0x79')](path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x81'),_0x444984[_0x0412('0x84')]))){_0x41017c=path['join'](config['root'],_0x0412('0x81'),_0x444984['systemAvatar']);}}return _0x35d151[_0x0412('0x7b')](_0x41017c);}})['catch'](handleError(_0x35d151,null));};exports[_0x0412('0x85')]=function(_0x24a0ad,_0x14821b){var _0xc1cfcc=require(_0x0412('0x86'));var _0x5152b1=new _0xc1cfcc();var _0x5a0ce3=_0x5152b1[_0x0412('0x87')](_0x24a0ad['headers'][_0x0412('0x88')])['getResult']();var _0x2f5742={'body':_0x24a0ad['body'],'channel':_0x0412('0x89')};var _0x18fb34=[];var _0x3f040e=[];var _0x11ef24={};var _0x3e9d52=![];return db[_0x0412('0x8a')][_0x0412('0x5c')]()[_0x0412('0x17')](function(_0x25628c){if(!_0x25628c){throw new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x8d'));}_0x18fb34=_[_0x0412('0x8e')](_[_0x0412('0x3b')](_0x25628c),[_0x0412('0x8f'),_0x0412('0x90')]);_0x3f040e=_[_0x0412('0x8e')](_[_0x0412('0x3b')](_0x25628c),[_0x0412('0x8f'),'updatedAt','CompanyId','ListId']);if(_0x24a0ad[_0x0412('0x53')]['id']){delete _0x24a0ad['body']['id'];}if(_[_0x0412('0x7e')](_0x24a0ad['body']['from'])){throw new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x91'));}if(_['isNil'](_0x24a0ad[_0x0412('0x53')][_0x0412('0x53')])||_0x24a0ad['body']['body']===''){throw new db['Sequelize']['ValidationError'](_0x0412('0x92'));}if(_[_0x0412('0x7e')](_0x24a0ad[_0x0412('0x53')][_0x0412('0x93')])){throw new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x94')+_0x3f040e);}if(!_[_0x0412('0x95')](_0x3f040e,_0x24a0ad[_0x0412('0x53')]['mapKey'])){throw new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x96')+_0x3f040e);}_0x11ef24[_0x24a0ad['body'][_0x0412('0x93')]]=_0x24a0ad[_0x0412('0x53')][_0x0412('0x97')];})[_0x0412('0x17')](function(){return db[_0x0412('0x4b')]['find']({'where':{'id':_0x24a0ad[_0x0412('0x4f')]['id']},'include':[{'model':db[_0x0412('0x98')],'as':_0x0412('0x99'),'include':[{'model':db['CmContact'],'as':_0x0412('0x9a'),'where':_0x11ef24,'limit':0x1,'order':[[_0x0412('0x90'),_0x0412('0x9b')]]}]},{'model':db[_0x0412('0x9c')],'as':_0x0412('0x9d')}]});})['then'](handleEntityNotFound(_0x14821b,null))[_0x0412('0x17')](function(_0xa330ea){if(_0xa330ea&&_0xa330ea['List']){_0x2f5742[_0x0412('0x9e')]=_0xa330ea;_0x2f5742[_0x0412('0x9f')]=_0xa330ea['Applications'];_0x2f5742['list']=_0xa330ea[_0x0412('0x99')];_0x2f5742[_0x0412('0x9f')]=_[_0x0412('0xa0')](_0x2f5742[_0x0412('0x9f')],[_0x0412('0xa1')],[_0x0412('0xa2')]);if(_0x2f5742['account'][_0x0412('0x9d')]){delete _0x2f5742['account'][_0x0412('0x9d')];}if(_0x2f5742[_0x0412('0x9e')][_0x0412('0x99')]&&_0x2f5742[_0x0412('0x9e')]['List'][_0x0412('0x9a')][_0x0412('0x40')]){return _0x2f5742['account']['List'][_0x0412('0x9a')][0x0];}var _0x473591=_[_0x0412('0xe')](_0x24a0ad[_0x0412('0x53')],{'firstName':_0x24a0ad[_0x0412('0x53')][_0x0412('0x97')],'ListId':_0xa330ea[_0x0412('0xa3')]});_0x473591[_0x24a0ad['body']['mapKey']]=_0x24a0ad[_0x0412('0x53')][_0x0412('0x97')];return db[_0x0412('0x8a')][_0x0412('0x52')](_0x473591,{'fields':_0x18fb34,'raw':!![]});}})[_0x0412('0x17')](handleEntityNotFound(_0x14821b,null))[_0x0412('0x17')](function(_0x1bae97){_0x2f5742[_0x0412('0xa4')]=_0x1bae97;var _0x1906f8=_0x24a0ad[_0x0412('0x53')][_0x0412('0xa5')];if(_0x24a0ad['headers'][_0x0412('0xa6')]){_0x1906f8=_0x24a0ad['headers'][_0x0412('0xa6')];}else if(_0x24a0ad[_0x0412('0xa7')]['x-forwarded-for']){_0x1906f8=_[_0x0412('0xa8')](_0x24a0ad[_0x0412('0xa7')][_0x0412('0xa9')][_0x0412('0xaa')](','));}if(_0x1bae97){var _0x3aad64={'ContactId':_0x1bae97['id'],'ChatWebsiteId':_0x24a0ad['params']['id'],'from':(_0x1bae97[_0x0412('0xab')]||'')+'\x20'+(_0x1bae97[_0x0412('0xac')]||''),'customerIp':_0x1906f8,'customerPort':_0x24a0ad[_0x0412('0xa7')][_0x0412('0xad')]?_0x24a0ad[_0x0412('0xa7')][_0x0412('0xad')]:null,'referer':_0x24a0ad[_0x0412('0x53')][_0x0412('0xae')],'browserName':_0x5a0ce3[_0x0412('0xaf')]['name']&&_0x5a0ce3[_0x0412('0xaf')]['version']?util['format'](_0x0412('0xb0'),_0x5a0ce3[_0x0412('0xaf')][_0x0412('0x30')],_0x5a0ce3[_0x0412('0xaf')][_0x0412('0xb1')]):'unknown','browserVersion':_0x5a0ce3['browser'][_0x0412('0xb1')]||_0x0412('0xb2'),'osName':util[_0x0412('0xb3')](_0x0412('0xb0'),_0x5a0ce3['os'][_0x0412('0x30')],_0x5a0ce3['os'][_0x0412('0xb1')]),'osVersion':_0x5a0ce3['os'][_0x0412('0xb1')],'deviceModel':_0x5a0ce3[_0x0412('0xb4')][_0x0412('0x39')]&&_0x5a0ce3[_0x0412('0xb4')][_0x0412('0xb5')]?util[_0x0412('0xb3')](_0x0412('0xb6'),_0x5a0ce3[_0x0412('0xb4')][_0x0412('0x39')],_0x5a0ce3[_0x0412('0xb4')]['vendor'],_0x5a0ce3[_0x0412('0xb4')][_0x0412('0x37')]):null,'deviceVendor':_0x5a0ce3['device'][_0x0412('0xb5')],'deviceType':_0x5a0ce3[_0x0412('0xb4')][_0x0412('0x37')],'formData':JSON['stringify'](_0x24a0ad[_0x0412('0x53')])};var _0xae22f5={'ChatWebsiteId':_0x24a0ad['params']['id'],'closed':![]};if(_0x24a0ad[_0x0412('0x53')]['threadId']){_0xae22f5[_0x0412('0xb7')]=_0x24a0ad[_0x0412('0x53')][_0x0412('0xb7')];return db['ChatInteraction'][_0x0412('0x51')]({'where':_0xae22f5})[_0x0412('0x17')](function(_0x522092){if(_0x522092){return[_0x522092,![]];}_0x3aad64['threadId']=_0x24a0ad[_0x0412('0x53')][_0x0412('0xb7')];_0x3aad64[_0x0412('0xb8')]=_0x24a0ad['body']['externalUrl'];return db['ChatInteraction'][_0x0412('0x52')](_0x3aad64)[_0x0412('0x17')](function(_0x2ab7f9){return[_0x2ab7f9,!![]];});});}_0xae22f5[_0x0412('0xb9')]=_0x1bae97['id'];if(_0x24a0ad[_0x0412('0x53')][_0x0412('0xba')]&&_0x24a0ad[_0x0412('0x53')][_0x0412('0xba')]['id']){_0xae22f5['id']=_0x24a0ad['body'][_0x0412('0xba')]['id'];return db[_0x0412('0xbb')][_0x0412('0x51')]({'where':_0xae22f5})[_0x0412('0x17')](function(_0x170cbb){if(_0x170cbb){return[_0x170cbb,![]];}return db['ChatInteraction'][_0x0412('0x52')](_0x3aad64)[_0x0412('0x17')](function(_0x1d2581){return[_0x1d2581,!![]];});});}return db[_0x0412('0xbb')][_0x0412('0x52')](_0x3aad64)[_0x0412('0x17')](function(_0x5e6121){return[_0x5e6121,!![]];});}})['spread'](function(_0x1d4b8c,_0x4dfcc0){if(_0x1d4b8c){_0x3e9d52=_0x4dfcc0;if(!_0x4dfcc0){var _0xae3465={'from':(_0x2f5742[_0x0412('0xa4')][_0x0412('0xab')]||'')+'\x20'+(_0x2f5742[_0x0412('0xa4')][_0x0412('0xac')]||'')};if(_0x24a0ad[_0x0412('0x53')][_0x0412('0xb7')]&&_0x24a0ad[_0x0412('0x53')]['messageId']&&_0x24a0ad['body']['threadId']!=_0x24a0ad[_0x0412('0x53')]['messageId']){_0xae3465['threadId']=_0x24a0ad[_0x0412('0x53')][_0x0412('0xbc')];}return _0x1d4b8c[_0x0412('0x2a')](_0xae3465);}else{return _0x1d4b8c;}}})[_0x0412('0x17')](function(_0x3a3617){_0x2f5742[_0x0412('0xba')]=_0x3a3617[_0x0412('0x2c')]({'plain':!![]});_0x2f5742['interaction'][_0x0412('0xbd')]=_0x3e9d52;if(_0x2f5742[_0x0412('0xba')][_0x0412('0xbd')]){if(_0x2f5742[_0x0412('0x9e')][_0x0412('0xbe')]){_0x2f5742[_0x0412('0x9f')][_0x0412('0xbf')]({'id':0x0,'priority':_0x2f5742['applications']['length']+0x1,'app':_0x0412('0xc0'),'appdata':'unmanaged','interval':_0x0412('0xc1')});}}return db[_0x0412('0xc2')][_0x0412('0x52')]({'body':_0x24a0ad['body'][_0x0412('0x53')],'ChatWebsiteId':_0x24a0ad['params']['id'],'ChatInteractionId':_0x3a3617['id'],'direction':'in','ContactId':_0x2f5742['contact']['id'],'AttachmentId':_0x24a0ad[_0x0412('0x53')][_0x0412('0xc3')]});})[_0x0412('0x17')](function(_0x3ab0f4){_0x2f5742[_0x0412('0x1f')]=_0x3ab0f4;if(_0x2f5742['interaction']['UserId']){return db[_0x0412('0xc4')]['find']({'attributes':['id',_0x0412('0x30')],'where':{'id':_0x2f5742['interaction']['UserId']}})['then'](function(_0x36ab38){if(_0x36ab38){_0x2f5742[_0x0412('0x9f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x0412('0xc5'),'appdata':_0x36ab38[_0x0412('0x30')]+','+(_0x2f5742['account'][_0x0412('0xc6')]||0xa),'interval':_0x0412('0xc1')});_0x2f5742[_0x0412('0xc7')]=!![];}return respondWithRpcPromise(_0x0412('0xc8'),_0x0412('0xc9'),_0x2f5742);});}return respondWithRpcPromise(_0x0412('0xc8'),_0x0412('0xc9'),_0x2f5742);})[_0x0412('0x17')](function(_0x1d60ba){respondWithRpcPromise(_0x0412('0xca'),_0x0412('0xca'),{'event':_0x0412('0x85'),'message':_0x1d60ba},client9002);return _0x1d60ba;})[_0x0412('0x17')](respondWithResult(_0x14821b,null))['catch'](handleError(_0x14821b,null));};exports[_0x0412('0xcb')]=function(_0x1cf320,_0x4bfe05){var _0x3cf5c6,_0x52cff8,_0x5a7f11;var _0xbf7421=[];var _0x323a29={};var _0x140b02=_0x1cf320[_0x0412('0xcc')]||[];var _0x2ec01b=[];var _0x55498f;return db['CmContact'][_0x0412('0x5c')]()[_0x0412('0x17')](function(_0x34dbfe){if(!_0x34dbfe){throw new db[(_0x0412('0x8b'))]['ValidationError']('no\x20available\x20attributes');}_0xbf7421=_['difference'](_[_0x0412('0x3b')](_0x34dbfe),[_0x0412('0x8f'),_0x0412('0x90'),'CompanyId',_0x0412('0xa3')]);if(_0x1cf320[_0x0412('0x53')]['id']){delete _0x1cf320[_0x0412('0x53')]['id'];}if(_[_0x0412('0x7e')](_0x1cf320[_0x0412('0x53')][_0x0412('0x97')])){throw _0x4bfe05['status'](0x1f4)[_0x0412('0x31')](new db['Sequelize'][(_0x0412('0x8c'))](_0x0412('0x91')));}if(_[_0x0412('0x7e')](_0x1cf320[_0x0412('0x53')][_0x0412('0x53')])||_0x1cf320[_0x0412('0x53')][_0x0412('0x53')]===''){throw _0x4bfe05['status'](0x1f4)[_0x0412('0x31')](new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0x92')));}if(_[_0x0412('0x7e')](_0x1cf320[_0x0412('0x53')][_0x0412('0xcd')])){throw _0x4bfe05[_0x0412('0x22')](0x1f4)[_0x0412('0x31')](new db[(_0x0412('0x8b'))][(_0x0412('0x8c'))](_0x0412('0xce')+_0xbf7421));}if(!_[_0x0412('0x95')](_0xbf7421,_0x1cf320[_0x0412('0x53')]['mapKeyOffline'])){throw _0x4bfe05[_0x0412('0x22')](0x1f4)['send'](new db[(_0x0412('0x8b'))]['ValidationError'](_0x0412('0xcf')+_0xbf7421));}_0x323a29[_0x1cf320[_0x0412('0x53')][_0x0412('0xcd')]]=_0x1cf320['body'][_0x0412('0x97')];})['then'](function(){return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x1cf320['params']['id']},'include':[{'model':db[_0x0412('0x98')],'as':_0x0412('0x99')},{'model':db[_0x0412('0xd0')],'as':_0x0412('0xd0')}]});})['then'](handleEntityNotFound(_0x4bfe05,null))[_0x0412('0x17')](function(_0x3f4d03){if(_0x3f4d03&&_0x3f4d03[_0x0412('0x99')]){_0x52cff8=_0x3f4d03;var _0x56321d=_[_0x0412('0xe')](_0x1cf320['body'],{'firstName':_0x1cf320[_0x0412('0x53')][_0x0412('0x97')],'phone':_0x1cf320[_0x0412('0x53')]['from'],'ListId':_0x3f4d03[_0x0412('0xa3')]});_0x56321d[_0x1cf320['body'][_0x0412('0xcd')]]=_0x1cf320[_0x0412('0x53')][_0x0412('0x97')];return db['CmContact'][_0x0412('0xd1')]({'where':_0x323a29,'defaults':_0x56321d});}})[_0x0412('0xd2')](function(_0x5e4a9d){if(_0x5e4a9d){_0x5a7f11=_0x5e4a9d;var _0x5b426f=fs[_0x0412('0xd3')](path['join'](config[_0x0412('0x74')],'server/files/templates/chatOfflineMessage.ejs'),_0x0412('0xd4'));var _0xf7f8d5=ejs[_0x0412('0xd5')](_0x5b426f,{'body':_['toPairs'](_0x1cf320['body'][_0x0412('0x53')]),'bodyTitle':_0x52cff8[_0x0412('0xd6')]});return db[_0x0412('0xd7')]['create']({'body':_0xf7f8d5,'plainBody':htmlToText[_0x0412('0xd8')](_0xf7f8d5),'ContactId':_0x5e4a9d['id'],'ChatWebsiteId':_0x52cff8['id']});}})['then'](function(_0x359662){_0x55498f=_0x359662;if(_0x140b02[_0x0412('0x40')]){var _0x2f0ded=_0x140b02['map'](function(_0x263fb1){return{'name':_0x263fb1[_0x0412('0xd9')],'basename':_0x263fb1['filename'],'type':_0x263fb1[_0x0412('0xda')],'ChatOfflineMessageId':_0x359662['id']};});_0x2ec01b=_0x2f0ded[_0x0412('0x35')](_0x225cc3=>{var _0x4ab8e7={'filename':_0x225cc3['name'],'path':path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0xdb'),_0x0412('0xcc'),'attachments',_0x0412('0xdc'),_0x225cc3[_0x0412('0xdd')])};return _0x4ab8e7;});if(!_0x52cff8[_0x0412('0xde')]){return db[_0x0412('0xdf')]['transaction'](function(_0x5ceece){return db[_0x0412('0xe0')][_0x0412('0xe1')](_0x2f0ded,{'transaction':_0x5ceece});});}}})[_0x0412('0x17')](function(){if(_0x55498f){_0x3cf5c6=_0x55498f;return db['MailAccount'][_0x0412('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0x0412('0xe2')],'as':_0x0412('0xe3'),'raw':!![],'include':[{'model':db[_0x0412('0xe4')],'as':_0x0412('0xe4'),'raw':!![]}]}]});}})[_0x0412('0x17')](function(_0x4f8b23){if(_0x4f8b23&&_0x4f8b23[_0x0412('0xe3')]&&_0x52cff8[_0x0412('0xe5')]&&_0x52cff8[_0x0412('0xe6')]){var _0x24e6f7=_0x4f8b23[_0x0412('0xe7')]();return respondWithRpcPromise('SendMail',_0x0412('0xe8'),{'account':_0x24e6f7,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x4f8b23[_0x0412('0x30')],_0x4f8b23[_0x0412('0xe9')]||_0x4f8b23['Smtp']['user']),'to':_0x52cff8['forwardOfflineAddress'],'subject':_0x52cff8[_0x0412('0xea')],'html':_0x3cf5c6['body'],'attachments':_0x2ec01b}},client9003)['then'](function(){return _0x3cf5c6;})[_0x0412('0x21')](function(_0x59170f){logger[_0x0412('0x1d')](_0x59170f);});}})[_0x0412('0x17')](function(){if(_0x52cff8&&_0x52cff8[_0x0412('0xde')]&&_0x52cff8[_0x0412('0xeb')]){var _0x8c99f2=[];if(_0x140b02[_0x0412('0x40')]){_0x8c99f2=_0x140b02[_0x0412('0x35')](function(_0x13fdce){return{'name':_0x13fdce['originalname'],'basename':_0x13fdce[_0x0412('0x6c')],'type':_0x13fdce[_0x0412('0xda')],'ChatOfflineMessageId':_0x55498f['id']};});}var _0x5aa2dd;if(!_[_0x0412('0x7e')](_0x52cff8[_0x0412('0xec')])){var _0x1e8de9=_[_0x0412('0x35')](_0x1cf320[_0x0412('0x53')],function(_0x377979){return _0x377979;});var _0x3116bf=_[_0x0412('0xed')](_0x1e8de9)[0x0];var _0x45bfef=_[_0x0412('0xee')](_0x3116bf,function(_0x52fc0e){return _0x52fc0e;});_0x5aa2dd=_0x45bfef[0x1][_0x52cff8[_0x0412('0xec')]];}var _0x1a8735={'from':_0x5a7f11['email'],'firstName':_0x5a7f11[_0x0412('0xab')],'lastName':_0x5a7f11[_0x0412('0xac')],'mapKey':'email','message':{'from':_0x5a7f11[_0x0412('0xe9')],'to':_0x52cff8[_0x0412('0xd0')]['email'],'cc':'','subject':_[_0x0412('0x7e')](_0x5aa2dd)?_0x52cff8[_0x0412('0xea')]:_0x5aa2dd,'messageId':'','sentAt':new Date(),'attach':_0x8c99f2[_0x0412('0x40')],'attachments':_0x8c99f2,'originChannel':_0x0412('0xef'),'ChatWebsiteId':_0x52cff8['id'],'ChatOfflineMessageId':_0x3cf5c6['id'],'originTo':_0x52cff8[_0x0412('0xd0')][_0x0412('0xe9')]},'body':_0x3cf5c6[_0x0412('0x53')]};var _0x5bf56d={'account':{'id':_0x52cff8[_0x0412('0xeb')]},'body':_0x1a8735,'log':_0x0412('0xf0')};return respondWithRpcPromise(_0x0412('0xf0'),_0x0412('0xf1'),_0x5bf56d,client9001)[_0x0412('0x17')](function(){return _0x3cf5c6;})['catch'](function(_0x4ea6c6){logger[_0x0412('0x1d')](_0x4ea6c6);});}return;})[_0x0412('0x17')](function(){if(_0x3cf5c6){return _0x3cf5c6;}})[_0x0412('0x17')](respondWithResult(_0x4bfe05,null))[_0x0412('0x21')](function(_0x1aa549){logger['error'](_0x0412('0x21'),_0x1aa549);for(var _0x562f06 of _0x140b02){var _0x2f9498=path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0xdb'),_0x0412('0xcc'),'attachments',_0x0412('0xdc'),_0x562f06[_0x0412('0x6c')]);fs_extra[_0x0412('0xf2')](_0x2f9498)['catch'](function(_0x49c378){logger[_0x0412('0x1d')](_0x0412('0xf3'),_0x2f9498,_0x49c378);});}});};exports[_0x0412('0xf4')]=function(_0x4564c4,_0x2b7665){return db[_0x0412('0xbb')][_0x0412('0x51')]({'where':{'id':_0x4564c4[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x2b7665,null))[_0x0412('0x17')](function(_0x3155c2){if(_0x3155c2){return _0x3155c2['addInteraction'](_0x4564c4[_0x0412('0x53')][_0x0412('0x69')],_[_0x0412('0xf5')](_0x4564c4[_0x0412('0x53')],[_0x0412('0x69'),'id'])||{});}})[_0x0412('0x17')](respondWithResult(_0x2b7665,null))[_0x0412('0x21')](handleError(_0x2b7665,null));};exports[_0x0412('0xf6')]=function(_0x1d3e03,_0xa73737){var _0x10fc45={'raw':![],'where':{}};var _0x59676e={};var _0x568e84={'count':0x0,'rows':[]};return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x1d3e03['params']['id']}})['then'](handleEntityNotFound(_0xa73737,null))[_0x0412('0x17')](function(_0x2ab21c){if(_0x2ab21c){_0x59676e[_0x0412('0x39')]=_['keys'](db[_0x0412('0xbb')][_0x0412('0x50')]);_0x59676e[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0x1d3e03[_0x0412('0x3a')]);_0x59676e[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0x59676e['model'],_0x59676e[_0x0412('0x3a')]);_0x10fc45['attributes']=_[_0x0412('0x3d')](_0x59676e[_0x0412('0x39')],qs[_0x0412('0x3f')](_0x1d3e03[_0x0412('0x3a')]['fields']));_0x10fc45['attributes']=_0x10fc45[_0x0412('0x3e')][_0x0412('0x40')]?_0x10fc45[_0x0412('0x3e')]:_0x59676e[_0x0412('0x39')];if(!_0x1d3e03[_0x0412('0x3a')]['hasOwnProperty']('nolimit')){_0x10fc45[_0x0412('0x26')]=qs['limit'](_0x1d3e03['query'][_0x0412('0x26')]);_0x10fc45[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x1d3e03[_0x0412('0x3a')]['offset']);}_0x10fc45['order']=qs[_0x0412('0x44')](_0x1d3e03['query'][_0x0412('0x44')]);_0x10fc45[_0x0412('0x47')]=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0x1d3e03[_0x0412('0x3a')],_0x59676e[_0x0412('0x3c')]));_0x10fc45[_0x0412('0x47')][_0x0412('0x5e')]=_0x2ab21c['id'];if(_0x1d3e03['query'][_0x0412('0x49')]){_0x10fc45[_0x0412('0x47')]=_[_0x0412('0x46')](_0x10fc45[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x10fc45['attributes'],function(_0x14d23f){var _0x73085f={};_0x73085f[_0x14d23f]={'$like':'%'+_0x1d3e03[_0x0412('0x3a')][_0x0412('0x49')]+'%'};return _0x73085f;})});}_0x10fc45=_['merge']({},_0x10fc45,_0x1d3e03[_0x0412('0x4a')]);return db['ChatInteraction'][_0x0412('0x28')]({'where':_0x10fc45[_0x0412('0x47')]})[_0x0412('0x17')](function(_0x18d159){_0x568e84[_0x0412('0x28')]=_0x18d159;if(_0x1d3e03[_0x0412('0x3a')][_0x0412('0x4c')]){_0x10fc45[_0x0412('0x4d')]=[{'model':db[_0x0412('0x8a')],'as':_0x0412('0xf7'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x0412('0xf8'),'internal'],'required':![]},{'model':db[_0x0412('0xf9')],'as':'Tags','attributes':['id',_0x0412('0x30'),_0x0412('0xfa')],'where':_0x1d3e03[_0x0412('0x3a')][_0x0412('0xfb')]?{'id':_0x1d3e03[_0x0412('0x3a')][_0x0412('0xfb')]}:undefined,'required':_0x1d3e03[_0x0412('0x3a')][_0x0412('0xfb')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x10fc45);})[_0x0412('0x17')](function(_0x39b577){_0x568e84[_0x0412('0x63')]=_0x39b577;return _0x568e84;});}})[_0x0412('0x17')](respondWithFilteredResult(_0xa73737,_0x10fc45))[_0x0412('0x21')](handleError(_0xa73737,null));};function iftimePromise(_0x25c27b,_0xf509f5){return respondWithRpcPromise('Command',_0x0412('0xfc'),{'command':_0xf509f5['timezone']?util[_0x0412('0xb3')](_0x0412('0xfd'),_0x25c27b[_0x0412('0xfe')],_0xf509f5[_0x0412('0xff')]):util['format'](_0x0412('0x100'),_0x25c27b[_0x0412('0xfe')])},client9002)[_0x0412('0x17')](function(_0x51bf99){var _0x4ac84e=_0x51bf99&&_0x51bf99['indexOf'](_0x0412('0x101'))>=0x0?!![]:![];logger[_0x0412('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0xf509f5['id'],_0x25c27b['id'],_0x25c27b[_0x0412('0xfe')],_0x4ac84e?_0x0412('0x102'):_0x0412('0x103'),_0xf509f5[_0x0412('0xff')]?_0xf509f5[_0x0412('0xff')]:_0x0412('0x104'));return _0x4ac84e;})[_0x0412('0x21')](function(_0x5c1ff3){logger[_0x0412('0x1d')](_0x0412('0x105'),_0xf509f5['id'],_0x25c27b['id'],_0x25c27b['interval'],util[_0x0412('0x106')](_0x5c1ff3,{'showHidden':![],'depth':null}),_0xf509f5[_0x0412('0xff')]?_0xf509f5[_0x0412('0xff')]:'No\x20timezone');return![];});}exports[_0x0412('0xfc')]=function(_0x51e6b8,_0x33c615){var _0x407ab2=0x0;var _0x1ded51=0x0;var _0x45d314=![];var _0x4f1984;var _0x32376e;return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x51e6b8[_0x0412('0x4f')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x0412('0x107')],'as':_0x0412('0x108'),'attributes':['id',_0x0412('0xfe')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x33c615,null))[_0x0412('0x17')](function(_0x38cce7){if(_0x38cce7){_0x4f1984=_0x38cce7;return _0x38cce7[_0x0412('0x109')]({'raw':!![]});}})[_0x0412('0x17')](function(_0x384d60){if(_0x4f1984){if(_0x384d60){_0x32376e=_0x384d60;}}return require(_0x0412('0x76'))[_0x0412('0x77')]();})[_0x0412('0x17')](function(_0x21cf2b){if(_0x21cf2b){_0x1ded51=_0x21cf2b[_0x0412('0x10a')];_0x45d314=_0x21cf2b[_0x0412('0x10b')];}})[_0x0412('0x17')](function(){return db[_0x0412('0xbb')][_0x0412('0x28')]({'where':{'closed':![]}});})['then'](function(_0x84a226){_0x407ab2=_0x84a226;if(_0x1ded51&&_0x84a226>_0x1ded51){return db[_0x0412('0x10c')]['findOne']({'where':{'id':0x1}})[_0x0412('0x17')](function(_0x2e8fa6){if(_0x2e8fa6){_0x2e8fa6[_0x0412('0x10d')](_0x0412('0x10e'));}});}})[_0x0412('0x17')](function(){if(_0x4f1984[_0x0412('0x107')]&&_0x4f1984[_0x0412('0x107')][_0x0412('0x108')]){var _0x3fa839=[];for(var _0x3b66cb=0x0;_0x3b66cb<_0x4f1984[_0x0412('0x107')][_0x0412('0x108')][_0x0412('0x40')];_0x3b66cb++){var _0x96e60f=_0x4f1984['Interval'][_0x0412('0x108')][_0x3b66cb][_0x0412('0x2c')]({'plain':!![]});_0x3fa839[_0x0412('0xbf')](iftimePromise(_0x96e60f,_0x4f1984));}return BPromise[_0x0412('0x10f')](_0x3fa839)[_0x0412('0x17')](function(_0x12bd3a){return _['some'](_0x12bd3a);});}else{return!![];}})[_0x0412('0x17')](function(_0x380d03){var _0x1cfde6=fs[_0x0412('0xd3')](path[_0x0412('0x73')](config[_0x0412('0x74')],_0x0412('0x110')),_0x0412('0xd4'));var _0x9b45b5={'remote':_0x4f1984['remote'],'query':querystring[_0x0412('0x111')](_[_0x0412('0x46')](_0x4f1984[_0x0412('0x2c')]({'plain':!![]}),{'customerIp':_0x51e6b8[_0x0412('0xa7')]['x-forwarded-for']||_0x51e6b8['headers']['x-real-ip']||_0x51e6b8[_0x0412('0x112')][_0x0412('0x113')]||_0x51e6b8['ip'],'referer':_0x51e6b8[_0x0412('0xa7')][_0x0412('0xae')],'openedInteractions':_0x407ab2,'maxInteractions':_0x1ded51,'virtual':_0x45d314[_0x0412('0x10a')],'online':_0x380d03,'custom':_0x45d314}))[_0x0412('0x114')](/'/g,'\x5c\x27')};_0x33c615[_0x0412('0x31')](ejs[_0x0412('0xd5')](Mustache['render'](_0x1cfde6,_0x9b45b5),{'proactiveActions':_0x32376e,'alignment':_0x4f1984['alignment'],'verticalAlignment':_0x4f1984['verticalAlignment'],'div_color':_0x4f1984[_0x0412('0xfa')],'labelText':_0x4f1984[_0x0412('0x115')],'text_color':_0x4f1984[_0x0412('0x116')],'text_button_color':_0x4f1984['textButtonColor'],'button_color':_0x4f1984['color_button'],'background_color':_0x4f1984['backgroundColor'],'hideWhenOffline':_0x4f1984[_0x0412('0x117')],'interval':_0x4f1984[_0x0412('0x118')]}));})[_0x0412('0x21')](handleError(_0x33c615,null));};exports[_0x0412('0x119')]=function(_0x2e4933,_0x46f54d){var _0x3e6e39=_0x2e4933['params']['id'];var _0x40685b=_0x2e4933[_0x0412('0x53')];var _0x5342b2=0xc8;var _0x29b99a=null;return db[_0x0412('0xdf')][_0x0412('0x11a')]({'isolationLevel':db[_0x0412('0xdf')]['Transaction'][_0x0412('0x11b')][_0x0412('0x11c')]},function(_0x22425c){return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x3e6e39},'transaction':_0x22425c})['then'](function(_0x5245f6){if(_0x5245f6){return db[_0x0412('0x9c')]['destroy']({'where':{'ChatWebsiteId':_0x3e6e39},'transaction':_0x22425c})[_0x0412('0x17')](function(){var _0x248bd8=_[_0x0412('0x35')](_0x40685b,function(_0x43c752){_0x43c752[_0x0412('0x5e')]=_0x3e6e39;return _0x43c752;});return db[_0x0412('0x9c')][_0x0412('0xe1')](_0x248bd8,{'transaction':_0x22425c});});}else{_0x5342b2=0x194;_0x29b99a=[];}});})[_0x0412('0x17')](function(){if(_0x5342b2!==0x194){return db[_0x0412('0x9c')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x3e6e39},'order':_0x0412('0xa1')})['then'](function(_0x5b8bb2){_0x29b99a=_0x5b8bb2;});}})['catch'](function(_0x5cdc79){_0x5342b2=0x1f4;logger[_0x0412('0x1d')](_0x5cdc79['stack']);if(_0x5cdc79['name']){delete _0x5cdc79[_0x0412('0x30')];}_0x29b99a=_0x5cdc79;})[_0x0412('0x11d')](function(){if(_0x29b99a===null){_0x46f54d[_0x0412('0x2e')](_0x5342b2);}else{if(_0x5342b2===0x1f4){_0x46f54d['status'](_0x5342b2)['send'](_0x29b99a);}else{_0x46f54d[_0x0412('0x22')](_0x5342b2)['json'](_0x29b99a);}}});};exports[_0x0412('0x11e')]=function(_0x339178,_0x3a37aa){var _0x51eef4={};var _0xbf4afb={};var _0x5e7883;var _0x565d3d;return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x339178[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3a37aa,null))[_0x0412('0x17')](function(_0x5e154c){if(_0x5e154c){_0x5e7883=_0x5e154c;_0xbf4afb[_0x0412('0x39')]=_['keys'](db[_0x0412('0x9c')][_0x0412('0x50')]);_0xbf4afb['query']=_[_0x0412('0x3b')](_0x339178[_0x0412('0x3a')]);_0xbf4afb['filters']=_['intersection'](_0xbf4afb[_0x0412('0x39')],_0xbf4afb[_0x0412('0x3a')]);_0x51eef4[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0xbf4afb['model'],qs[_0x0412('0x3f')](_0x339178[_0x0412('0x3a')][_0x0412('0x3f')]));_0x51eef4['attributes']=_0x51eef4[_0x0412('0x3e')]['length']?_0x51eef4['attributes']:_0xbf4afb[_0x0412('0x39')];_0x51eef4[_0x0412('0x43')]=qs['sort'](_0x339178[_0x0412('0x3a')]['sort']);_0x51eef4[_0x0412('0x47')]=qs['filters'](_[_0x0412('0x45')](_0x339178[_0x0412('0x3a')],_0xbf4afb['filters']));if(_0x339178[_0x0412('0x3a')]['filter']){_0x51eef4[_0x0412('0x47')]=_['merge'](_0x51eef4[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x51eef4[_0x0412('0x3e')],function(_0x22ddb4){var _0xfad51e={};_0xfad51e[_0x22ddb4]={'$like':'%'+_0x339178[_0x0412('0x3a')]['filter']+'%'};return _0xfad51e;})});}_0x51eef4=_[_0x0412('0x46')]({},_0x51eef4,_0x339178[_0x0412('0x4a')]);return _0x5e7883[_0x0412('0x11e')](_0x51eef4);}})['then'](function(_0x246ffa){if(_0x246ffa){_0x565d3d=_0x246ffa[_0x0412('0x40')];if(!_0x339178[_0x0412('0x3a')][_0x0412('0x41')](_0x0412('0x42'))){_0x51eef4[_0x0412('0x26')]=qs[_0x0412('0x26')](_0x339178[_0x0412('0x3a')][_0x0412('0x26')]);_0x51eef4[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x339178[_0x0412('0x3a')]['offset']);}return _0x5e7883[_0x0412('0x11e')](_0x51eef4);}})[_0x0412('0x17')](function(_0x3cc549){if(_0x3cc549){return _0x3cc549?{'count':_0x565d3d,'rows':_0x3cc549}:null;}})['then'](respondWithResult(_0x3a37aa,null))[_0x0412('0x21')](handleError(_0x3a37aa,null));};exports[_0x0412('0x11f')]=function(_0x93860f,_0x3ca41d){return db[_0x0412('0x120')][_0x0412('0x51')]({'where':{'id':_0x93860f['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x3ca41d,null))[_0x0412('0x17')](function(_0x2004f4){if(_0x2004f4){return _0x2004f4['addProactiveActions'](_0x93860f['body'][_0x0412('0x69')],_['omit'](_0x93860f[_0x0412('0x53')],[_0x0412('0x69'),'id'])||{});}})[_0x0412('0x17')](respondWithResult(_0x3ca41d,null))['catch'](handleError(_0x3ca41d,null));};exports[_0x0412('0x109')]=function(_0x4380c5,_0x47155c){var _0x3ca051={};var _0xf892f3={};var _0x121594;var _0x1dea1c;return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x4380c5[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x47155c,null))[_0x0412('0x17')](function(_0x1a2245){if(_0x1a2245){_0x121594=_0x1a2245;_0xf892f3[_0x0412('0x39')]=_['keys'](db[_0x0412('0x121')][_0x0412('0x50')]);_0xf892f3[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0x4380c5[_0x0412('0x3a')]);_0xf892f3['filters']=_['intersection'](_0xf892f3[_0x0412('0x39')],_0xf892f3[_0x0412('0x3a')]);_0x3ca051[_0x0412('0x3e')]=_['intersection'](_0xf892f3['model'],qs[_0x0412('0x3f')](_0x4380c5['query']['fields']));_0x3ca051[_0x0412('0x3e')]=_0x3ca051['attributes']['length']?_0x3ca051['attributes']:_0xf892f3[_0x0412('0x39')];_0x3ca051[_0x0412('0x43')]=qs[_0x0412('0x44')](_0x4380c5[_0x0412('0x3a')][_0x0412('0x44')]);_0x3ca051[_0x0412('0x47')]=qs['filters'](_[_0x0412('0x45')](_0x4380c5['query'],_0xf892f3[_0x0412('0x3c')]));if(_0x4380c5[_0x0412('0x3a')][_0x0412('0x49')]){_0x3ca051['where']=_['merge'](_0x3ca051[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x3ca051[_0x0412('0x3e')],function(_0x26d8f8){var _0x41b134={};_0x41b134[_0x26d8f8]={'$like':'%'+_0x4380c5[_0x0412('0x3a')][_0x0412('0x49')]+'%'};return _0x41b134;})});}_0x3ca051=_[_0x0412('0x46')]({},_0x3ca051,_0x4380c5[_0x0412('0x4a')]);return _0x121594['getProactiveActions'](_0x3ca051);}})['then'](function(_0x42608c){if(_0x42608c){_0x1dea1c=_0x42608c[_0x0412('0x40')];if(!_0x4380c5['query'][_0x0412('0x41')](_0x0412('0x42'))){_0x3ca051[_0x0412('0x26')]=qs[_0x0412('0x26')](_0x4380c5['query']['limit']);_0x3ca051[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x4380c5[_0x0412('0x3a')][_0x0412('0x25')]);}return _0x121594[_0x0412('0x109')](_0x3ca051);}})[_0x0412('0x17')](function(_0x3f0bb5){if(_0x3f0bb5){return _0x3f0bb5?{'count':_0x1dea1c,'rows':_0x3f0bb5}:null;}})[_0x0412('0x17')](respondWithResult(_0x47155c,null))['catch'](handleError(_0x47155c,null));};exports[_0x0412('0x122')]=function(_0x227840,_0x42f9c7){var _0x1cdb91=_0x227840[_0x0412('0x3a')][_0x0412('0x123')]===_0x0412('0x124')?'offlineForm':_0x0412('0x125');return db[_0x0412('0x4b')][_0x0412('0x51')]({'attributes':['id',_0x1cdb91],'where':{'id':_0x227840[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x42f9c7,null))[_0x0412('0x17')](function(_0x39ec88){if(_0x39ec88){var _0x2f7f58=_0x39ec88[_0x1cdb91];var _0x29f086=_0x2f7f58&&_0x2f7f58[_0x0412('0x126')]?_0x2f7f58[_0x0412('0x126')]:[];_0x42f9c7[_0x0412('0x31')]({'fromKey':_[_0x0412('0x7e')](_0x2f7f58[_0x0412('0x127')])?undefined:_0x2f7f58[_0x0412('0x127')],'count':_0x29f086[_0x0412('0x40')],'rows':_0x29f086});}})[_0x0412('0x21')](handleError(_0x42f9c7,null));};exports['getOfflineMessages']=function(_0x586450,_0x5d8c51){var _0x65ca43={'raw':![],'where':{}};var _0x1e3f2d={};var _0x1256a3={'count':0x0,'rows':[]};return db[_0x0412('0x4b')][_0x0412('0x61')]({'where':{'id':_0x586450[_0x0412('0x4f')]['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x5d8c51,null))[_0x0412('0x17')](function(_0x5d855e){if(_0x5d855e){_0x1e3f2d[_0x0412('0x39')]=_[_0x0412('0x3b')](db[_0x0412('0xd7')]['rawAttributes']);_0x1e3f2d[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0x586450[_0x0412('0x3a')]);_0x1e3f2d['filters']=_['intersection'](_0x1e3f2d[_0x0412('0x39')],_0x1e3f2d[_0x0412('0x3a')]);_0x65ca43['attributes']=_['intersection'](_0x1e3f2d['model'],qs[_0x0412('0x3f')](_0x586450[_0x0412('0x3a')][_0x0412('0x3f')]));_0x65ca43['attributes']=_0x65ca43[_0x0412('0x3e')]['length']?_0x65ca43[_0x0412('0x3e')]:_0x1e3f2d[_0x0412('0x39')];if(!_0x586450[_0x0412('0x3a')][_0x0412('0x41')](_0x0412('0x42'))){_0x65ca43[_0x0412('0x26')]=qs[_0x0412('0x26')](_0x586450[_0x0412('0x3a')][_0x0412('0x26')]);_0x65ca43[_0x0412('0x25')]=qs[_0x0412('0x25')](_0x586450[_0x0412('0x3a')][_0x0412('0x25')]);}_0x65ca43[_0x0412('0x43')]=qs[_0x0412('0x44')](_0x586450['query']['sort']);_0x65ca43[_0x0412('0x47')]=qs[_0x0412('0x3c')](_[_0x0412('0x45')](_0x586450[_0x0412('0x3a')],_0x1e3f2d[_0x0412('0x3c')]));_0x65ca43[_0x0412('0x47')]['ChatWebsiteId']=_0x5d855e['id'];if(_0x586450['query'][_0x0412('0x49')]){_0x65ca43[_0x0412('0x47')]=_[_0x0412('0x46')](_0x65ca43['where'],{'$or':_[_0x0412('0x35')](_0x65ca43[_0x0412('0x3e')],function(_0x52e1bf){var _0x6af435={};_0x6af435[_0x52e1bf]={'$like':'%'+_0x586450['query'][_0x0412('0x49')]+'%'};return _0x6af435;})});}_0x65ca43=_['merge']({},_0x65ca43,_0x586450[_0x0412('0x4a')]);return db[_0x0412('0xd7')][_0x0412('0x28')]({'where':_0x65ca43[_0x0412('0x47')]})[_0x0412('0x17')](function(_0x778324){_0x1256a3['count']=_0x778324;if(_0x586450[_0x0412('0x3a')][_0x0412('0x4c')]){_0x65ca43[_0x0412('0x4d')]=[{'all':!![]}];}else{_0x65ca43[_0x0412('0x4d')]=[{'model':db['CmContact'],'as':_0x0412('0xf7'),'required':![]},{'model':db[_0x0412('0xe0')],'as':'Attachments','required':![]}];}return db[_0x0412('0xd7')][_0x0412('0x62')](_0x65ca43);})[_0x0412('0x17')](function(_0x25e307){_0x1256a3['rows']=_0x25e307;return _0x1256a3;});}})[_0x0412('0x17')](respondWithFilteredResult(_0x5d8c51,_0x65ca43))[_0x0412('0x21')](handleError(_0x5d8c51,null));};exports[_0x0412('0x128')]=function(_0x23b5bd,_0x2686ec){return db[_0x0412('0x4b')][_0x0412('0x51')]({'where':{'id':_0x23b5bd['params']['id']}})['then'](handleEntityNotFound(_0x2686ec,null))['then'](function(_0xc55c0f){if(_0xc55c0f){return _0xc55c0f[_0x0412('0x128')](_0x23b5bd['body'][_0x0412('0x69')],_[_0x0412('0xf5')](_0x23b5bd['body'],['ids','id'])||{})[_0x0412('0xd2')](function(_0x2235be){for(var _0x4ca72f=0x0;_0x4ca72f<_0x23b5bd['body']['ids'][_0x0412('0x40')];_0x4ca72f+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x23b5bd[_0x0412('0x53')][_0x0412('0x69')][_0x4ca72f]),'ChatWebsiteId':Number(_0x23b5bd[_0x0412('0x4f')]['id'])});}return _0x2235be;});}})[_0x0412('0x17')](respondWithResult(_0x2686ec,null))[_0x0412('0x21')](handleError(_0x2686ec,null));};exports[_0x0412('0x129')]=function(_0xad3ee8,_0x1ca879){return db[_0x0412('0x4b')]['find']({'where':{'id':_0xad3ee8['params']['id']}})['then'](handleEntityNotFound(_0x1ca879,null))[_0x0412('0x17')](function(_0x6ff73a){if(_0x6ff73a){return _0x6ff73a['removeAgents'](_0xad3ee8[_0x0412('0x3a')][_0x0412('0x69')])[_0x0412('0x17')](function(){if(_[_0x0412('0x12a')](_0xad3ee8[_0x0412('0x3a')][_0x0412('0x69')])){for(var _0x2fa9e0=0x0;_0x2fa9e0<_0xad3ee8[_0x0412('0x3a')][_0x0412('0x69')][_0x0412('0x40')];_0x2fa9e0+=0x1){socket[_0x0412('0x12b')](_0x0412('0x12c'),{'UserId':Number(_0xad3ee8['query'][_0x0412('0x69')][_0x2fa9e0]),'ChatWebsiteId':Number(_0xad3ee8[_0x0412('0x4f')]['id'])});}}else{socket[_0x0412('0x12b')](_0x0412('0x12c'),{'UserId':Number(_0xad3ee8[_0x0412('0x3a')][_0x0412('0x69')]),'ChatWebsiteId':Number(_0xad3ee8[_0x0412('0x4f')]['id'])});}});}})[_0x0412('0x17')](respondWithStatusCode(_0x1ca879,null))[_0x0412('0x21')](handleError(_0x1ca879,null));};exports[_0x0412('0x12d')]=function(_0xbf4945,_0x2a96cb){var _0x486558={};var _0x310d19={};var _0x120ba2;var _0x4733f6;return db['ChatWebsite']['findOne']({'where':{'id':_0xbf4945['params']['id']}})[_0x0412('0x17')](handleEntityNotFound(_0x2a96cb,null))[_0x0412('0x17')](function(_0x338a0b){if(_0x338a0b){_0x120ba2=_0x338a0b;_0x310d19['model']=_[_0x0412('0x3b')](db['User']['rawAttributes']);_0x310d19[_0x0412('0x3a')]=_[_0x0412('0x3b')](_0xbf4945[_0x0412('0x3a')]);_0x310d19[_0x0412('0x3c')]=_[_0x0412('0x3d')](_0x310d19[_0x0412('0x39')],_0x310d19[_0x0412('0x3a')]);_0x486558[_0x0412('0x3e')]=_[_0x0412('0x3d')](_0x310d19[_0x0412('0x39')],qs[_0x0412('0x3f')](_0xbf4945[_0x0412('0x3a')][_0x0412('0x3f')]));_0x486558[_0x0412('0x3e')]=_0x486558['attributes'][_0x0412('0x40')]?_0x486558['attributes']:_0x310d19[_0x0412('0x39')];_0x486558[_0x0412('0x43')]=qs['sort'](_0xbf4945[_0x0412('0x3a')][_0x0412('0x44')]);_0x486558[_0x0412('0x47')]=qs['filters'](_['pick'](_0xbf4945[_0x0412('0x3a')],_0x310d19[_0x0412('0x3c')]));if(_0xbf4945[_0x0412('0x3a')][_0x0412('0x49')]){_0x486558[_0x0412('0x47')]=_[_0x0412('0x46')](_0x486558[_0x0412('0x47')],{'$or':_[_0x0412('0x35')](_0x486558[_0x0412('0x3e')],function(_0x3d0093){var _0x3ba2c4={};_0x3ba2c4[_0x3d0093]={'$like':'%'+_0xbf4945[_0x0412('0x3a')]['filter']+'%'};return _0x3ba2c4;})});}_0x486558=_[_0x0412('0x46')]({},_0x486558,_0xbf4945[_0x0412('0x4a')]);return _0x120ba2[_0x0412('0x12d')](_0x486558);}})['then'](function(_0xa540d8){if(_0xa540d8){_0x4733f6=_0xa540d8[_0x0412('0x40')];if(!_0xbf4945[_0x0412('0x3a')][_0x0412('0x41')](_0x0412('0x42'))){_0x486558[_0x0412('0x26')]=qs['limit'](_0xbf4945[_0x0412('0x3a')][_0x0412('0x26')]);_0x486558[_0x0412('0x25')]=qs[_0x0412('0x25')](_0xbf4945[_0x0412('0x3a')]['offset']);}return _0x120ba2['getAgents'](_0x486558);}})['then'](function(_0x235ebb){if(_0x235ebb){return _0x235ebb?{'count':_0x4733f6,'rows':_0x235ebb}:null;}})['then'](respondWithResult(_0x2a96cb,null))['catch'](handleError(_0x2a96cb,null));}; \ No newline at end of file +var _0x60fb=['query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','mandatoryDispositionPause','rawAttributes','fields','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','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','pick','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','addAvatar','agentAvatar','file','filename','addCustomerAvatar','addSystemAvatar','join','root','../../config/license/util','custom','isNil','sitepic','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','Sequelize','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','applications','list','priority','asc','account','Contacts','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','type','threadId','externalUrl','ContactId','interaction','ChatInteraction','spread','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','files','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','subjectOffline','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','User','Owner','internal','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','x-real-ip','connection','replace','alignment','verticalAlignment','color','labelText','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','chatProactiveAction','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','isArray','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','./chatWebsite.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','get','ChatWebsites','UserProfileResource','then','send','Pause','map','ChatWebsite','model','name'];(function(_0x3042c5,_0x36cb88){var _0x7cd140=function(_0x4cdcd8){while(--_0x4cdcd8){_0x3042c5['push'](_0x3042c5['shift']());}};_0x7cd140(++_0x36cb88);}(_0x60fb,0xf8));var _0xb60f=function(_0x38576d,_0x527dc7){_0x38576d=_0x38576d-0x0;var _0x32534a=_0x60fb[_0x38576d];return _0x32534a;};'use strict';var BPromise=require(_0xb60f('0x0'));var Mustache=require(_0xb60f('0x1'));var util=require(_0xb60f('0x2'));var path=require(_0xb60f('0x3'));var ejs=require(_0xb60f('0x4'));var fs=require('fs');var fs_extra=require(_0xb60f('0x5'));var _=require('lodash');var querystring=require(_0xb60f('0x6'));var Redis=require(_0xb60f('0x7'));var qs=require(_0xb60f('0x8'));var logger=require('../../config/logger')(_0xb60f('0x9'));var config=require(_0xb60f('0xa'));var db=require(_0xb60f('0xb'))['db'];config[_0xb60f('0xc')]=_['defaults'](config['redis'],{'host':_0xb60f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb60f('0xc')]));require(_0xb60f('0xe'))[_0xb60f('0xf')](socket);var htmlToText=require('html-to-text');var jayson=require(_0xb60f('0x10'));var client=jayson[_0xb60f('0x11')][_0xb60f('0x12')]({'port':0x232c});var client9002=jayson[_0xb60f('0x11')][_0xb60f('0x12')]({'port':0x232a});var client9003=jayson[_0xb60f('0x11')][_0xb60f('0x12')]({'port':0x232b});var client9001=jayson[_0xb60f('0x11')][_0xb60f('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x5d95d5,_0x5ac6cd,_0x884aa4,_0x9856ad){return new BPromise(function(_0x5f5bf0,_0x59e628){var _0x55cc46=_0x9856ad||client;return _0x55cc46[_0xb60f('0x13')](_0x5d95d5,_0x884aa4)['then'](function(_0x2e6043){logger[_0xb60f('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x5ac6cd,_0xb60f('0x15'));logger[_0xb60f('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5ac6cd,_0xb60f('0x15'),JSON[_0xb60f('0x17')](_0x2e6043));if(_0x2e6043['error']){if(_0x2e6043['error'][_0xb60f('0x18')]===0x1f4){logger[_0xb60f('0x19')](_0xb60f('0x1a'),_0x5ac6cd,_0x2e6043[_0xb60f('0x19')]['message']);return _0x59e628(_0x2e6043[_0xb60f('0x19')]['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x5ac6cd,_0x2e6043[_0xb60f('0x19')][_0xb60f('0x1b')]);return _0x5f5bf0(_0x2e6043[_0xb60f('0x19')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5ac6cd,_0xb60f('0x15'));_0x5f5bf0(_0x2e6043[_0xb60f('0x1c')]['message']);}})[_0xb60f('0x1d')](function(_0x3f864a){logger[_0xb60f('0x19')](_0xb60f('0x1a'),_0x5ac6cd,_0x3f864a);_0x59e628(_0x3f864a);});});}function respondWithStatusCode(_0x24b815,_0x36d7cd){_0x36d7cd=_0x36d7cd||0xcc;return function(_0x357af1){if(_0x357af1){return _0x24b815[_0xb60f('0x1e')](_0x36d7cd);}return _0x24b815['status'](_0x36d7cd)[_0xb60f('0x1f')]();};}function respondWithResult(_0xbe14bd,_0x25428e){_0x25428e=_0x25428e||0xc8;return function(_0x4f52de){if(_0x4f52de){return _0xbe14bd[_0xb60f('0x20')](_0x25428e)[_0xb60f('0x21')](_0x4f52de);}};}function respondWithFilteredResult(_0xe38013,_0x3be026){return function(_0x4a9e97){if(_0x4a9e97){var _0x3caca3=typeof _0x3be026[_0xb60f('0x22')]==='undefined'&&typeof _0x3be026['limit']===_0xb60f('0x23');var _0x52eda5=_0x4a9e97[_0xb60f('0x24')];var _0x27bf4b=_0x3caca3?0x0:_0x3be026['offset'];var _0x50aab8=_0x3caca3?_0x4a9e97[_0xb60f('0x24')]:_0x3be026[_0xb60f('0x22')]+_0x3be026[_0xb60f('0x25')];var _0xb10c2f;if(_0x50aab8>=_0x52eda5){_0x50aab8=_0x52eda5;_0xb10c2f=0xc8;}else{_0xb10c2f=0xce;}_0xe38013['status'](_0xb10c2f);return _0xe38013[_0xb60f('0x26')](_0xb60f('0x27'),_0x27bf4b+'-'+_0x50aab8+'/'+_0x52eda5)[_0xb60f('0x21')](_0x4a9e97);}return null;};}function saveUpdates(_0x4a6519){return function(_0x1140fa){if(_0x1140fa){return _0x1140fa[_0xb60f('0x28')](_0x4a6519)['then'](function(_0x3bccee){return _0x3bccee;});}return null;};}function removeEntity(_0x3b6178){return function(_0x2cb602){if(_0x2cb602){return _0x2cb602['destroy']()['then'](function(){var _0x587a56=_0x2cb602[_0xb60f('0x29')]({'plain':!![]});var _0x4c53d0=_0xb60f('0x2a');return db[_0xb60f('0x2b')]['destroy']({'where':{'type':_0x4c53d0,'resourceId':_0x587a56['id']}})[_0xb60f('0x2c')](function(){return _0x2cb602;});})[_0xb60f('0x2c')](function(){_0x3b6178['status'](0xcc)[_0xb60f('0x1f')]();});}};}function handleEntityNotFound(_0x476340){return function(_0x1cd0b4){if(!_0x1cd0b4){_0x476340[_0xb60f('0x1e')](0x194);}return _0x1cd0b4;};}function handleError(_0x3fcf7d,_0x5591e1){_0x5591e1=_0x5591e1||0x1f4;return function(_0x57906d){logger[_0xb60f('0x19')](_0x57906d['stack']);if(_0x57906d['name']){delete _0x57906d['name'];}_0x3fcf7d[_0xb60f('0x20')](_0x5591e1)[_0xb60f('0x2d')](_0x57906d);};}exports['index']=function(_0xc2453,_0x42e867){var _0x58b6c3={'include':[{'model':db[_0xb60f('0x2e')],'as':'mandatoryDispositionPause'}]},_0x197f46={},_0x5d63ec={'count':0x0,'rows':[]};var _0x4b0986=_[_0xb60f('0x2f')](db[_0xb60f('0x30')]['rawAttributes'],function(_0x4fc7cc){return{'name':_0x4fc7cc['fieldName'],'type':_0x4fc7cc['type']['key']};});_0x197f46[_0xb60f('0x31')]=_['map'](_0x4b0986,_0xb60f('0x32'));_0x197f46[_0xb60f('0x33')]=_[_0xb60f('0x34')](_0xc2453[_0xb60f('0x33')]);_0x197f46[_0xb60f('0x35')]=_['intersection'](_0x197f46[_0xb60f('0x31')],_0x197f46[_0xb60f('0x33')]);_0x58b6c3['attributes']=_[_0xb60f('0x36')](_0x197f46[_0xb60f('0x31')],qs['fields'](_0xc2453['query']['fields']));_0x58b6c3['attributes']=_0x58b6c3[_0xb60f('0x37')][_0xb60f('0x38')]?_0x58b6c3['attributes']:_0x197f46[_0xb60f('0x31')];if(!_0xc2453['query'][_0xb60f('0x39')](_0xb60f('0x3a'))){_0x58b6c3['limit']=qs[_0xb60f('0x25')](_0xc2453[_0xb60f('0x33')][_0xb60f('0x25')]);_0x58b6c3['offset']=qs[_0xb60f('0x22')](_0xc2453['query']['offset']);}_0x58b6c3[_0xb60f('0x3b')]=qs[_0xb60f('0x3c')](_0xc2453['query'][_0xb60f('0x3c')]);_0x58b6c3[_0xb60f('0x3d')]=qs[_0xb60f('0x35')](_['pick'](_0xc2453[_0xb60f('0x33')],_0x197f46[_0xb60f('0x35')]),_0x4b0986);if(_0xc2453[_0xb60f('0x33')][_0xb60f('0x3e')]){_0x58b6c3[_0xb60f('0x3d')]=_[_0xb60f('0x3f')](_0x58b6c3[_0xb60f('0x3d')],{'$or':_[_0xb60f('0x2f')](_0x4b0986,function(_0x102227){if(_0x102227['type']!==_0xb60f('0x40')){var _0x271034={};_0x271034[_0x102227[_0xb60f('0x32')]]={'$like':'%'+_0xc2453[_0xb60f('0x33')][_0xb60f('0x3e')]+'%'};return _0x271034;}})});}_0x58b6c3=_[_0xb60f('0x3f')]({},_0x58b6c3,_0xc2453[_0xb60f('0x41')]);var _0x4764f8={'where':_0x58b6c3[_0xb60f('0x3d')]};return db[_0xb60f('0x30')][_0xb60f('0x24')](_0x4764f8)[_0xb60f('0x2c')](function(_0x3e3ae0){_0x5d63ec[_0xb60f('0x24')]=_0x3e3ae0;if(_0xc2453['query'][_0xb60f('0x42')]){_0x58b6c3['include']=[{'all':!![]}];}return db[_0xb60f('0x30')][_0xb60f('0x43')](_0x58b6c3);})[_0xb60f('0x2c')](function(_0x34240b){_0x5d63ec[_0xb60f('0x44')]=_0x34240b;return _0x5d63ec;})[_0xb60f('0x2c')](respondWithFilteredResult(_0x42e867,_0x58b6c3))[_0xb60f('0x1d')](handleError(_0x42e867,null));};exports[_0xb60f('0x45')]=function(_0x470a01,_0xc6b736){var _0x4a0dee={'raw':![],'where':{'id':_0x470a01['params']['id']},'include':[{'model':db[_0xb60f('0x2e')],'as':_0xb60f('0x46')}]},_0x37bfe5={};_0x37bfe5['model']=_[_0xb60f('0x34')](db[_0xb60f('0x30')][_0xb60f('0x47')]);_0x37bfe5[_0xb60f('0x33')]=_[_0xb60f('0x34')](_0x470a01[_0xb60f('0x33')]);_0x37bfe5[_0xb60f('0x35')]=_[_0xb60f('0x36')](_0x37bfe5[_0xb60f('0x31')],_0x37bfe5[_0xb60f('0x33')]);_0x4a0dee[_0xb60f('0x37')]=_[_0xb60f('0x36')](_0x37bfe5[_0xb60f('0x31')],qs['fields'](_0x470a01[_0xb60f('0x33')][_0xb60f('0x48')]));_0x4a0dee['attributes']=_0x4a0dee[_0xb60f('0x37')][_0xb60f('0x38')]?_0x4a0dee[_0xb60f('0x37')]:_0x37bfe5[_0xb60f('0x31')];if(_0x470a01[_0xb60f('0x33')][_0xb60f('0x42')]){_0x4a0dee['include']=[{'all':!![]}];}_0x4a0dee=_[_0xb60f('0x3f')]({},_0x4a0dee,_0x470a01[_0xb60f('0x41')]);return db['ChatWebsite'][_0xb60f('0x49')](_0x4a0dee)[_0xb60f('0x2c')](handleEntityNotFound(_0xc6b736,null))[_0xb60f('0x2c')](respondWithResult(_0xc6b736,null))[_0xb60f('0x1d')](handleError(_0xc6b736,null));};exports[_0xb60f('0x4a')]=function(_0x5b55b5,_0x373c27){return db[_0xb60f('0x30')][_0xb60f('0x4a')](_0x5b55b5[_0xb60f('0x4b')],{})[_0xb60f('0x2c')](function(_0x133bdf){var _0x4761af=_0x5b55b5[_0xb60f('0x4c')][_0xb60f('0x29')]({'plain':!![]});if(!_0x4761af)throw new Error(_0xb60f('0x4d'));if(_0x4761af['role']===_0xb60f('0x4c')){var _0x35e192=_0x133bdf[_0xb60f('0x29')]({'plain':!![]});var _0x371551='ChatWebsites';return db[_0xb60f('0x4e')][_0xb60f('0x49')]({'where':{'name':_0x371551,'userProfileId':_0x4761af[_0xb60f('0x4f')]},'raw':!![]})['then'](function(_0x5d2254){if(_0x5d2254&&_0x5d2254['autoAssociation']===0x0){return db[_0xb60f('0x2b')][_0xb60f('0x4a')]({'name':_0x35e192[_0xb60f('0x32')],'resourceId':_0x35e192['id'],'type':_0x5d2254['name'],'sectionId':_0x5d2254['id']},{})[_0xb60f('0x2c')](function(){return _0x133bdf;});}else{return _0x133bdf;}})[_0xb60f('0x1d')](function(_0x2fae6f){logger[_0xb60f('0x19')](_0xb60f('0x50'),_0x2fae6f);throw _0x2fae6f;});}return _0x133bdf;})[_0xb60f('0x2c')](respondWithResult(_0x373c27,0xc9))[_0xb60f('0x1d')](handleError(_0x373c27,null));};exports[_0xb60f('0x28')]=function(_0x4f15f0,_0x521aba){if(_0x4f15f0['body']['id']){delete _0x4f15f0[_0xb60f('0x4b')]['id'];}return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x4f15f0['params']['id']},'include':[{'model':db[_0xb60f('0x2e')],'as':_0xb60f('0x46')}]})[_0xb60f('0x2c')](handleEntityNotFound(_0x521aba,null))[_0xb60f('0x2c')](saveUpdates(_0x4f15f0['body'],null))[_0xb60f('0x2c')](respondWithResult(_0x521aba,null))[_0xb60f('0x1d')](handleError(_0x521aba,null));};exports['destroy']=function(_0x2e5091,_0x2e1284){return db['ChatWebsite'][_0xb60f('0x49')]({'where':{'id':_0x2e5091[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x2e1284,null))[_0xb60f('0x2c')](removeEntity(_0x2e1284,null))[_0xb60f('0x1d')](handleError(_0x2e1284,null));};exports[_0xb60f('0x52')]=function(_0x3c56e2,_0x31097f){return db[_0xb60f('0x30')][_0xb60f('0x52')]()[_0xb60f('0x2c')](respondWithResult(_0x31097f,null))[_0xb60f('0x1d')](handleError(_0x31097f,null));};exports[_0xb60f('0x53')]=function(_0x48c01a,_0x4fa3ec){if(_0x48c01a['body']['id']){delete _0x48c01a[_0xb60f('0x4b')]['id'];}return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x48c01a[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x4fa3ec,null))[_0xb60f('0x2c')](function(_0x1577bc){if(_0x1577bc){_0x48c01a['body'][_0xb60f('0x54')]=_0x1577bc['id'];return db['Disposition'][_0xb60f('0x4a')](_0x48c01a['body']);}})[_0xb60f('0x2c')](respondWithResult(_0x4fa3ec,null))[_0xb60f('0x1d')](handleError(_0x4fa3ec,null));};exports[_0xb60f('0x55')]=function(_0x1fc11b,_0x4cb049){var _0x1f143d={'raw':![],'where':{}};var _0x5c446a={};var _0x12c1e1={'count':0x0,'rows':[]};return db[_0xb60f('0x30')][_0xb60f('0x56')]({'where':{'id':_0x1fc11b[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x4cb049,null))[_0xb60f('0x2c')](function(_0x15eff2){if(_0x15eff2){_0x5c446a['model']=_[_0xb60f('0x34')](db[_0xb60f('0x57')][_0xb60f('0x47')]);_0x5c446a[_0xb60f('0x33')]=_[_0xb60f('0x34')](_0x1fc11b[_0xb60f('0x33')]);_0x5c446a['filters']=_[_0xb60f('0x36')](_0x5c446a[_0xb60f('0x31')],_0x5c446a[_0xb60f('0x33')]);_0x1f143d[_0xb60f('0x37')]=_[_0xb60f('0x36')](_0x5c446a[_0xb60f('0x31')],qs[_0xb60f('0x48')](_0x1fc11b[_0xb60f('0x33')]['fields']));_0x1f143d['attributes']=_0x1f143d[_0xb60f('0x37')][_0xb60f('0x38')]?_0x1f143d['attributes']:_0x5c446a['model'];if(!_0x1fc11b['query'][_0xb60f('0x39')](_0xb60f('0x3a'))){_0x1f143d[_0xb60f('0x25')]=qs[_0xb60f('0x25')](_0x1fc11b['query'][_0xb60f('0x25')]);_0x1f143d[_0xb60f('0x22')]=qs['offset'](_0x1fc11b[_0xb60f('0x33')]['offset']);}_0x1f143d[_0xb60f('0x3b')]=qs[_0xb60f('0x3c')](_0x1fc11b[_0xb60f('0x33')][_0xb60f('0x3c')]);_0x1f143d[_0xb60f('0x3d')]=qs[_0xb60f('0x35')](_[_0xb60f('0x58')](_0x1fc11b[_0xb60f('0x33')],_0x5c446a[_0xb60f('0x35')]));_0x1f143d[_0xb60f('0x3d')][_0xb60f('0x54')]=_0x15eff2['id'];if(_0x1fc11b[_0xb60f('0x33')][_0xb60f('0x3e')]){_0x1f143d['where']=_['merge'](_0x1f143d['where'],{'$or':_[_0xb60f('0x2f')](_0x1f143d[_0xb60f('0x37')],function(_0x1608aa){var _0x3b7624={};_0x3b7624[_0x1608aa]={'$like':'%'+_0x1fc11b[_0xb60f('0x33')]['filter']+'%'};return _0x3b7624;})});}_0x1f143d=_['merge']({},_0x1f143d,_0x1fc11b[_0xb60f('0x41')]);return db[_0xb60f('0x57')]['count']({'where':_0x1f143d['where']})[_0xb60f('0x2c')](function(_0x1975b2){_0x12c1e1['count']=_0x1975b2;if(_0x1fc11b[_0xb60f('0x33')]['includeAll']){_0x1f143d[_0xb60f('0x59')]=[{'all':!![]}];}return db[_0xb60f('0x57')][_0xb60f('0x43')](_0x1f143d);})[_0xb60f('0x2c')](function(_0x2c3ea4){_0x12c1e1[_0xb60f('0x44')]=_0x2c3ea4;return _0x12c1e1;});}})[_0xb60f('0x2c')](respondWithFilteredResult(_0x4cb049,_0x1f143d))['catch'](handleError(_0x4cb049,null));};exports[_0xb60f('0x5a')]=function(_0x3e8450,_0x58309c){return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x3e8450[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x58309c,null))[_0xb60f('0x2c')](function(_0x17748e){if(_0x17748e){return _0x17748e[_0xb60f('0x5a')](_0x3e8450[_0xb60f('0x33')][_0xb60f('0x5b')]);}})[_0xb60f('0x2c')](respondWithStatusCode(_0x58309c,null))[_0xb60f('0x1d')](handleError(_0x58309c,null));};exports[_0xb60f('0x5c')]=function(_0x2aa8b8,_0x38e8a2){if(_0x2aa8b8[_0xb60f('0x4b')]['id']){delete _0x2aa8b8[_0xb60f('0x4b')]['id'];}return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x2aa8b8[_0xb60f('0x51')]['id']}})['then'](handleEntityNotFound(_0x38e8a2,null))[_0xb60f('0x2c')](function(_0x405d7d){if(_0x405d7d){_0x2aa8b8[_0xb60f('0x4b')][_0xb60f('0x54')]=_0x405d7d['id'];return db[_0xb60f('0x5d')][_0xb60f('0x4a')](_0x2aa8b8[_0xb60f('0x4b')]);}})[_0xb60f('0x2c')](respondWithResult(_0x38e8a2,null))[_0xb60f('0x1d')](handleError(_0x38e8a2,null));};exports[_0xb60f('0x5e')]=function(_0x2883fb,_0xd013ea){var _0xecd425={'raw':![],'where':{}};var _0x4cfea8={};var _0x199cdc={'count':0x0,'rows':[]};return db[_0xb60f('0x30')][_0xb60f('0x56')]({'where':{'id':_0x2883fb[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0xd013ea,null))['then'](function(_0x4e9f05){if(_0x4e9f05){_0x4cfea8[_0xb60f('0x31')]=_['keys'](db[_0xb60f('0x5d')][_0xb60f('0x47')]);_0x4cfea8[_0xb60f('0x33')]=_[_0xb60f('0x34')](_0x2883fb['query']);_0x4cfea8[_0xb60f('0x35')]=_['intersection'](_0x4cfea8[_0xb60f('0x31')],_0x4cfea8[_0xb60f('0x33')]);_0xecd425[_0xb60f('0x37')]=_[_0xb60f('0x36')](_0x4cfea8[_0xb60f('0x31')],qs[_0xb60f('0x48')](_0x2883fb[_0xb60f('0x33')][_0xb60f('0x48')]));_0xecd425[_0xb60f('0x37')]=_0xecd425[_0xb60f('0x37')][_0xb60f('0x38')]?_0xecd425[_0xb60f('0x37')]:_0x4cfea8[_0xb60f('0x31')];if(!_0x2883fb[_0xb60f('0x33')][_0xb60f('0x39')]('nolimit')){_0xecd425['limit']=qs[_0xb60f('0x25')](_0x2883fb[_0xb60f('0x33')]['limit']);_0xecd425[_0xb60f('0x22')]=qs[_0xb60f('0x22')](_0x2883fb[_0xb60f('0x33')][_0xb60f('0x22')]);}_0xecd425[_0xb60f('0x3b')]=qs[_0xb60f('0x3c')](_0x2883fb[_0xb60f('0x33')][_0xb60f('0x3c')]);_0xecd425['where']=qs[_0xb60f('0x35')](_[_0xb60f('0x58')](_0x2883fb[_0xb60f('0x33')],_0x4cfea8[_0xb60f('0x35')]));_0xecd425[_0xb60f('0x3d')][_0xb60f('0x54')]=_0x4e9f05['id'];if(_0x2883fb['query'][_0xb60f('0x3e')]){_0xecd425['where']=_['merge'](_0xecd425[_0xb60f('0x3d')],{'$or':_[_0xb60f('0x2f')](_0xecd425['attributes'],function(_0x15711f){var _0x1e516d={};_0x1e516d[_0x15711f]={'$like':'%'+_0x2883fb[_0xb60f('0x33')][_0xb60f('0x3e')]+'%'};return _0x1e516d;})});}_0xecd425=_[_0xb60f('0x3f')]({},_0xecd425,_0x2883fb[_0xb60f('0x41')]);return db['CannedAnswer'][_0xb60f('0x24')]({'where':_0xecd425[_0xb60f('0x3d')]})[_0xb60f('0x2c')](function(_0x5a6bdb){_0x199cdc[_0xb60f('0x24')]=_0x5a6bdb;if(_0x2883fb['query'][_0xb60f('0x42')]){_0xecd425[_0xb60f('0x59')]=[{'all':!![]}];}return db[_0xb60f('0x5d')]['findAll'](_0xecd425);})['then'](function(_0x14a03e){_0x199cdc[_0xb60f('0x44')]=_0x14a03e;return _0x199cdc;});}})[_0xb60f('0x2c')](respondWithFilteredResult(_0xd013ea,_0xecd425))[_0xb60f('0x1d')](handleError(_0xd013ea,null));};exports[_0xb60f('0x5f')]=function(_0x56204d,_0x1114c0){return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x56204d[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x1114c0,null))[_0xb60f('0x2c')](function(_0x1b0f8a){if(_0x1b0f8a){return _0x1b0f8a[_0xb60f('0x5f')](_0x56204d[_0xb60f('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x1114c0,null))[_0xb60f('0x1d')](handleError(_0x1114c0,null));};exports[_0xb60f('0x60')]=function(_0x36a69a,_0x3d451d){_0x36a69a[_0xb60f('0x4b')]['sitepic']=_0x36a69a['file']['filename'];return db[_0xb60f('0x30')]['find']({'where':{'id':_0x36a69a[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x3d451d,null))['then'](saveUpdates(_0x36a69a[_0xb60f('0x4b')],null))[_0xb60f('0x2c')](respondWithResult(_0x3d451d,null))['catch'](handleError(_0x3d451d,null));};exports[_0xb60f('0x61')]=function(_0x172e57,_0x363ede){_0x172e57[_0xb60f('0x4b')][_0xb60f('0x62')]=_0x172e57[_0xb60f('0x63')][_0xb60f('0x64')];return db['ChatWebsite'][_0xb60f('0x49')]({'where':{'id':_0x172e57[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x363ede,null))['then'](saveUpdates(_0x172e57['body'],null))[_0xb60f('0x2c')](respondWithResult(_0x363ede,null))['catch'](handleError(_0x363ede,null));};exports[_0xb60f('0x65')]=function(_0x206bc8,_0x37caea){_0x206bc8['body']['customerAvatar']=_0x206bc8[_0xb60f('0x63')][_0xb60f('0x64')];return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x206bc8['params']['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x37caea,null))[_0xb60f('0x2c')](saveUpdates(_0x206bc8[_0xb60f('0x4b')],null))[_0xb60f('0x2c')](respondWithResult(_0x37caea,null))[_0xb60f('0x1d')](handleError(_0x37caea,null));};exports[_0xb60f('0x66')]=function(_0x3b5e64,_0x3a1b17){_0x3b5e64[_0xb60f('0x4b')]['systemAvatar']=_0x3b5e64[_0xb60f('0x63')][_0xb60f('0x64')];return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x3b5e64[_0xb60f('0x51')]['id']}})['then'](handleEntityNotFound(_0x3a1b17,null))[_0xb60f('0x2c')](saveUpdates(_0x3b5e64['body'],null))[_0xb60f('0x2c')](respondWithResult(_0x3a1b17,null))[_0xb60f('0x1d')](handleError(_0x3a1b17,null));};exports['getLogo']=function(_0x350e4b,_0x452e2f){var _0x5f0b39=path[_0xb60f('0x67')](config[_0xb60f('0x68')],'server/files/images/logos/default_logo.svg');var _0x349f14={'where':{'id':_0x350e4b[_0xb60f('0x51')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x286bdf=![];return require(_0xb60f('0x69'))['getLicense']()['then'](function(_0x2658c3){if(_0x2658c3){_0x286bdf=_0x2658c3[_0xb60f('0x6a')];}})[_0xb60f('0x2c')](function(){return db[_0xb60f('0x30')]['find'](_0x349f14);})[_0xb60f('0x2c')](handleEntityNotFound(_0x452e2f,null))[_0xb60f('0x2c')](function(_0x3d45e5){if(_0x3d45e5){if(!_[_0xb60f('0x6b')](_0x3d45e5[_0xb60f('0x6c')])){if(fs['existsSync'](path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0x6d'),_0x3d45e5[_0xb60f('0x6c')]))&&_0x286bdf){_0x5f0b39=path[_0xb60f('0x67')](config[_0xb60f('0x68')],'server/files/images/logos/',_0x3d45e5[_0xb60f('0x6c')]);}}return _0x452e2f[_0xb60f('0x6e')](_0x5f0b39);}})[_0xb60f('0x1d')](handleError(_0x452e2f,null));};exports[_0xb60f('0x6f')]=function(_0x509279,_0xedf89e){var _0x5093db=path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0x70'));var _0x468062={'where':{'id':_0x509279[_0xb60f('0x51')]['id']},'attributes':['id',_0xb60f('0x62')],'raw':!![]};return db['ChatWebsite'][_0xb60f('0x49')](_0x468062)[_0xb60f('0x2c')](handleEntityNotFound(_0xedf89e,null))[_0xb60f('0x2c')](function(_0x31882e){if(_0x31882e){if(!_[_0xb60f('0x6b')](_0x31882e[_0xb60f('0x62')])){if(fs['existsSync'](path['join'](config[_0xb60f('0x68')],'server/files/images/avatars/',_0x31882e[_0xb60f('0x62')]))){_0x5093db=path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0x71'),_0x31882e[_0xb60f('0x62')]);}}return _0xedf89e[_0xb60f('0x6e')](_0x5093db);}})[_0xb60f('0x1d')](handleError(_0xedf89e,null));};exports[_0xb60f('0x72')]=function(_0x1810e2,_0x11f076){var _0x42f9a3=path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0x73'));var _0x59566d={'where':{'id':_0x1810e2[_0xb60f('0x51')]['id']},'attributes':['id',_0xb60f('0x74'),_0xb60f('0x75')],'raw':!![]};return db['ChatWebsite'][_0xb60f('0x49')](_0x59566d)[_0xb60f('0x2c')](handleEntityNotFound(_0x11f076,null))['then'](function(_0x3d44ac){if(_0x3d44ac){if(!_['isNil'](_0x3d44ac[_0xb60f('0x74')])){if(fs[_0xb60f('0x76')](path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0x71'),_0x3d44ac[_0xb60f('0x74')]))&&_0x3d44ac['showCustomerAvatar']){_0x42f9a3=path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0x71'),_0x3d44ac[_0xb60f('0x74')]);}}return _0x11f076[_0xb60f('0x6e')](_0x42f9a3);}})['catch'](handleError(_0x11f076,null));};exports[_0xb60f('0x77')]=function(_0x4ec654,_0x5a9409){var _0xc6bd7b=path[_0xb60f('0x67')](config['root'],_0xb60f('0x78'));var _0x567cc7={'where':{'id':_0x4ec654[_0xb60f('0x51')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xb60f('0x30')][_0xb60f('0x49')](_0x567cc7)[_0xb60f('0x2c')](handleEntityNotFound(_0x5a9409,null))[_0xb60f('0x2c')](function(_0x1922d5){if(_0x1922d5){if(!_['isNil'](_0x1922d5[_0xb60f('0x79')])){if(fs['existsSync'](path['join'](config[_0xb60f('0x68')],_0xb60f('0x71'),_0x1922d5[_0xb60f('0x79')]))){_0xc6bd7b=path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0x71'),_0x1922d5['systemAvatar']);}}return _0x5a9409['download'](_0xc6bd7b);}})[_0xb60f('0x1d')](handleError(_0x5a9409,null));};exports[_0xb60f('0x7a')]=function(_0x3c7509,_0x2d0f87){var _0x9f3f81=require(_0xb60f('0x7b'));var _0x598ce1=new _0x9f3f81();var _0x206f28=_0x598ce1[_0xb60f('0x7c')](_0x3c7509[_0xb60f('0x7d')][_0xb60f('0x7e')])[_0xb60f('0x7f')]();var _0x5a5fd8={'body':_0x3c7509[_0xb60f('0x4b')],'channel':_0xb60f('0x80')};var _0x3627e9=[];var _0x48a394=[];var _0x813d05={};var _0x2bdbd9=![];return db[_0xb60f('0x81')]['describe']()[_0xb60f('0x2c')](function(_0x3ef438){if(!_0x3ef438){throw new db['Sequelize'][(_0xb60f('0x82'))](_0xb60f('0x83'));}_0x3627e9=_[_0xb60f('0x84')](_[_0xb60f('0x34')](_0x3ef438),[_0xb60f('0x85'),'updatedAt']);_0x48a394=_[_0xb60f('0x84')](_[_0xb60f('0x34')](_0x3ef438),['createdAt',_0xb60f('0x86'),_0xb60f('0x87'),'ListId']);if(_0x3c7509[_0xb60f('0x4b')]['id']){delete _0x3c7509[_0xb60f('0x4b')]['id'];}if(_[_0xb60f('0x6b')](_0x3c7509['body'][_0xb60f('0x88')])){throw new db['Sequelize'][(_0xb60f('0x82'))](_0xb60f('0x89'));}if(_[_0xb60f('0x6b')](_0x3c7509[_0xb60f('0x4b')][_0xb60f('0x4b')])||_0x3c7509['body'][_0xb60f('0x4b')]===''){throw new db[(_0xb60f('0x8a'))][(_0xb60f('0x82'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb60f('0x6b')](_0x3c7509[_0xb60f('0x4b')]['mapKey'])){throw new db[(_0xb60f('0x8a'))][(_0xb60f('0x82'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x48a394);}if(!_[_0xb60f('0x8b')](_0x48a394,_0x3c7509[_0xb60f('0x4b')][_0xb60f('0x8c')])){throw new db[(_0xb60f('0x8a'))]['ValidationError'](_0xb60f('0x8d')+_0x48a394);}_0x813d05[_0x3c7509[_0xb60f('0x4b')][_0xb60f('0x8c')]]=_0x3c7509['body'][_0xb60f('0x88')];})[_0xb60f('0x2c')](function(){return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x3c7509['params']['id']},'include':[{'model':db[_0xb60f('0x8e')],'as':_0xb60f('0x8f'),'include':[{'model':db[_0xb60f('0x81')],'as':'Contacts','where':_0x813d05,'limit':0x1,'order':[[_0xb60f('0x86'),_0xb60f('0x90')]]}]},{'model':db[_0xb60f('0x91')],'as':_0xb60f('0x92')}]});})[_0xb60f('0x2c')](handleEntityNotFound(_0x2d0f87,null))[_0xb60f('0x2c')](function(_0x50dfe6){if(_0x50dfe6&&_0x50dfe6[_0xb60f('0x8f')]){_0x5a5fd8['account']=_0x50dfe6;_0x5a5fd8[_0xb60f('0x93')]=_0x50dfe6['Applications'];_0x5a5fd8[_0xb60f('0x94')]=_0x50dfe6[_0xb60f('0x8f')];_0x5a5fd8[_0xb60f('0x93')]=_['orderBy'](_0x5a5fd8[_0xb60f('0x93')],[_0xb60f('0x95')],[_0xb60f('0x96')]);if(_0x5a5fd8[_0xb60f('0x97')][_0xb60f('0x92')]){delete _0x5a5fd8[_0xb60f('0x97')]['Applications'];}if(_0x5a5fd8[_0xb60f('0x97')]['List']&&_0x5a5fd8[_0xb60f('0x97')][_0xb60f('0x8f')][_0xb60f('0x98')]['length']){return _0x5a5fd8[_0xb60f('0x97')]['List']['Contacts'][0x0];}var _0x56757e=_['defaults'](_0x3c7509[_0xb60f('0x4b')],{'firstName':_0x3c7509['body']['from'],'ListId':_0x50dfe6[_0xb60f('0x99')]});_0x56757e[_0x3c7509['body'][_0xb60f('0x8c')]]=_0x3c7509[_0xb60f('0x4b')][_0xb60f('0x88')];return db[_0xb60f('0x81')][_0xb60f('0x4a')](_0x56757e,{'fields':_0x3627e9,'raw':!![]});}})[_0xb60f('0x2c')](handleEntityNotFound(_0x2d0f87,null))[_0xb60f('0x2c')](function(_0x28bcaa){_0x5a5fd8[_0xb60f('0x9a')]=_0x28bcaa;var _0x237bb9=_0x3c7509[_0xb60f('0x4b')][_0xb60f('0x9b')];if(_0x3c7509[_0xb60f('0x7d')]['cf-connecting-ip']){_0x237bb9=_0x3c7509[_0xb60f('0x7d')][_0xb60f('0x9c')];}else if(_0x3c7509[_0xb60f('0x7d')][_0xb60f('0x9d')]){_0x237bb9=_[_0xb60f('0x9e')](_0x3c7509[_0xb60f('0x7d')][_0xb60f('0x9d')][_0xb60f('0x9f')](','));}if(_0x28bcaa){var _0x3f3bc1={'ContactId':_0x28bcaa['id'],'ChatWebsiteId':_0x3c7509['params']['id'],'from':(_0x28bcaa[_0xb60f('0xa0')]||'')+'\x20'+(_0x28bcaa[_0xb60f('0xa1')]||''),'customerIp':_0x237bb9,'customerPort':_0x3c7509[_0xb60f('0x7d')][_0xb60f('0xa2')]?_0x3c7509[_0xb60f('0x7d')]['x-real-port']:null,'referer':_0x3c7509[_0xb60f('0x4b')][_0xb60f('0xa3')],'browserName':_0x206f28[_0xb60f('0xa4')]['name']&&_0x206f28[_0xb60f('0xa4')][_0xb60f('0xa5')]?util[_0xb60f('0xa6')](_0xb60f('0xa7'),_0x206f28[_0xb60f('0xa4')][_0xb60f('0x32')],_0x206f28[_0xb60f('0xa4')][_0xb60f('0xa5')]):_0xb60f('0xa8'),'browserVersion':_0x206f28['browser'][_0xb60f('0xa5')]||_0xb60f('0xa8'),'osName':util[_0xb60f('0xa6')](_0xb60f('0xa7'),_0x206f28['os'][_0xb60f('0x32')],_0x206f28['os'][_0xb60f('0xa5')]),'osVersion':_0x206f28['os'][_0xb60f('0xa5')],'deviceModel':_0x206f28[_0xb60f('0xa9')][_0xb60f('0x31')]&&_0x206f28[_0xb60f('0xa9')][_0xb60f('0xaa')]?util[_0xb60f('0xa6')](_0xb60f('0xab'),_0x206f28[_0xb60f('0xa9')][_0xb60f('0x31')],_0x206f28[_0xb60f('0xa9')][_0xb60f('0xaa')],_0x206f28[_0xb60f('0xa9')][_0xb60f('0xac')]):null,'deviceVendor':_0x206f28[_0xb60f('0xa9')]['vendor'],'deviceType':_0x206f28[_0xb60f('0xa9')][_0xb60f('0xac')],'formData':JSON['stringify'](_0x3c7509[_0xb60f('0x4b')])};var _0xe8a8f8={'ChatWebsiteId':_0x3c7509[_0xb60f('0x51')]['id'],'closed':![]};if(_0x3c7509[_0xb60f('0x4b')]['threadId']){_0xe8a8f8[_0xb60f('0xad')]=_0x3c7509[_0xb60f('0x4b')]['threadId'];return db['ChatInteraction'][_0xb60f('0x49')]({'where':_0xe8a8f8})[_0xb60f('0x2c')](function(_0x353086){if(_0x353086){return[_0x353086,![]];}_0x3f3bc1[_0xb60f('0xad')]=_0x3c7509[_0xb60f('0x4b')][_0xb60f('0xad')];_0x3f3bc1[_0xb60f('0xae')]=_0x3c7509['body'][_0xb60f('0xae')];return db['ChatInteraction']['create'](_0x3f3bc1)[_0xb60f('0x2c')](function(_0x5da94c){return[_0x5da94c,!![]];});});}_0xe8a8f8[_0xb60f('0xaf')]=_0x28bcaa['id'];if(_0x3c7509[_0xb60f('0x4b')][_0xb60f('0xb0')]&&_0x3c7509['body'][_0xb60f('0xb0')]['id']){_0xe8a8f8['id']=_0x3c7509[_0xb60f('0x4b')][_0xb60f('0xb0')]['id'];return db[_0xb60f('0xb1')][_0xb60f('0x49')]({'where':_0xe8a8f8})['then'](function(_0x715124){if(_0x715124){return[_0x715124,![]];}return db[_0xb60f('0xb1')][_0xb60f('0x4a')](_0x3f3bc1)[_0xb60f('0x2c')](function(_0x6cd5d3){return[_0x6cd5d3,!![]];});});}return db[_0xb60f('0xb1')]['create'](_0x3f3bc1)[_0xb60f('0x2c')](function(_0x4b8b65){return[_0x4b8b65,!![]];});}})[_0xb60f('0xb2')](function(_0x15db0d,_0x1b7c1f){if(_0x15db0d){_0x2bdbd9=_0x1b7c1f;if(!_0x1b7c1f){var _0x4e3e73={'from':(_0x5a5fd8[_0xb60f('0x9a')][_0xb60f('0xa0')]||'')+'\x20'+(_0x5a5fd8[_0xb60f('0x9a')]['lastName']||'')};if(_0x3c7509[_0xb60f('0x4b')][_0xb60f('0xad')]&&_0x3c7509[_0xb60f('0x4b')]['messageId']&&_0x3c7509[_0xb60f('0x4b')][_0xb60f('0xad')]!=_0x3c7509[_0xb60f('0x4b')][_0xb60f('0xb3')]){_0x4e3e73[_0xb60f('0xad')]=_0x3c7509['body'][_0xb60f('0xb3')];}return _0x15db0d[_0xb60f('0x28')](_0x4e3e73);}else{return _0x15db0d;}}})['then'](function(_0x4620b7){_0x5a5fd8[_0xb60f('0xb0')]=_0x4620b7[_0xb60f('0x29')]({'plain':!![]});_0x5a5fd8[_0xb60f('0xb0')][_0xb60f('0xb4')]=_0x2bdbd9;if(_0x5a5fd8[_0xb60f('0xb0')]['created']){if(_0x5a5fd8[_0xb60f('0x97')][_0xb60f('0xb5')]){_0x5a5fd8[_0xb60f('0x93')][_0xb60f('0xb6')]({'id':0x0,'priority':_0x5a5fd8[_0xb60f('0x93')]['length']+0x1,'app':_0xb60f('0xb7'),'appdata':'unmanaged','interval':_0xb60f('0xb8')});}}return db[_0xb60f('0xb9')]['create']({'body':_0x3c7509[_0xb60f('0x4b')][_0xb60f('0x4b')],'ChatWebsiteId':_0x3c7509[_0xb60f('0x51')]['id'],'ChatInteractionId':_0x4620b7['id'],'direction':'in','ContactId':_0x5a5fd8[_0xb60f('0x9a')]['id'],'AttachmentId':_0x3c7509['body'][_0xb60f('0xba')]});})['then'](function(_0x5128ce){_0x5a5fd8[_0xb60f('0x1b')]=_0x5128ce;if(_0x5a5fd8[_0xb60f('0xb0')][_0xb60f('0xbb')]){return db['User'][_0xb60f('0x49')]({'attributes':['id',_0xb60f('0x32')],'where':{'id':_0x5a5fd8[_0xb60f('0xb0')]['UserId']}})['then'](function(_0x305f24){if(_0x305f24){_0x5a5fd8[_0xb60f('0x93')][_0xb60f('0xbc')]({'id':0x0,'priority':0x0,'app':_0xb60f('0xbd'),'appdata':_0x305f24[_0xb60f('0x32')]+','+(_0x5a5fd8[_0xb60f('0x97')][_0xb60f('0xbe')]||0xa),'interval':_0xb60f('0xb8')});_0x5a5fd8['forcedOwnership']=!![];}return respondWithRpcPromise(_0xb60f('0xbf'),_0xb60f('0xc0'),_0x5a5fd8);});}return respondWithRpcPromise(_0xb60f('0xbf'),_0xb60f('0xc0'),_0x5a5fd8);})[_0xb60f('0x2c')](function(_0xb276cb){respondWithRpcPromise(_0xb60f('0xc1'),_0xb60f('0xc1'),{'event':_0xb60f('0x7a'),'message':_0xb276cb},client9002);return _0xb276cb;})[_0xb60f('0x2c')](respondWithResult(_0x2d0f87,null))[_0xb60f('0x1d')](handleError(_0x2d0f87,null));};exports['offline']=function(_0x1c991c,_0x133f34){var _0x333729,_0x2f9dd8,_0x308901;var _0x3c7eb4=[];var _0x4ffa67={};var _0x2370b8=_0x1c991c[_0xb60f('0xc2')]||[];var _0x57f2c3=[];var _0x1db0fa;return db['CmContact'][_0xb60f('0x52')]()[_0xb60f('0x2c')](function(_0x597094){if(!_0x597094){throw new db[(_0xb60f('0x8a'))][(_0xb60f('0x82'))](_0xb60f('0x83'));}_0x3c7eb4=_[_0xb60f('0x84')](_[_0xb60f('0x34')](_0x597094),[_0xb60f('0x85'),_0xb60f('0x86'),_0xb60f('0x87'),_0xb60f('0x99')]);if(_0x1c991c[_0xb60f('0x4b')]['id']){delete _0x1c991c['body']['id'];}if(_[_0xb60f('0x6b')](_0x1c991c[_0xb60f('0x4b')][_0xb60f('0x88')])){throw _0x133f34['status'](0x1f4)['send'](new db['Sequelize'][(_0xb60f('0x82'))](_0xb60f('0x89')));}if(_[_0xb60f('0x6b')](_0x1c991c[_0xb60f('0x4b')][_0xb60f('0x4b')])||_0x1c991c[_0xb60f('0x4b')][_0xb60f('0x4b')]===''){throw _0x133f34['status'](0x1f4)[_0xb60f('0x2d')](new db['Sequelize'][(_0xb60f('0x82'))](_0xb60f('0xc3')));}if(_[_0xb60f('0x6b')](_0x1c991c[_0xb60f('0x4b')][_0xb60f('0xc4')])){throw _0x133f34[_0xb60f('0x20')](0x1f4)['send'](new db[(_0xb60f('0x8a'))][(_0xb60f('0x82'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c7eb4));}if(!_[_0xb60f('0x8b')](_0x3c7eb4,_0x1c991c[_0xb60f('0x4b')][_0xb60f('0xc4')])){throw _0x133f34[_0xb60f('0x20')](0x1f4)[_0xb60f('0x2d')](new db['Sequelize'][(_0xb60f('0x82'))](_0xb60f('0xc5')+_0x3c7eb4));}_0x4ffa67[_0x1c991c[_0xb60f('0x4b')][_0xb60f('0xc4')]]=_0x1c991c['body']['from'];})[_0xb60f('0x2c')](function(){return db[_0xb60f('0x30')]['find']({'where':{'id':_0x1c991c['params']['id']},'include':[{'model':db[_0xb60f('0x8e')],'as':_0xb60f('0x8f')},{'model':db[_0xb60f('0xc6')],'as':_0xb60f('0xc6')}]});})['then'](handleEntityNotFound(_0x133f34,null))['then'](function(_0x4a1578){if(_0x4a1578&&_0x4a1578[_0xb60f('0x8f')]){_0x2f9dd8=_0x4a1578;var _0x46a26d=_[_0xb60f('0xc7')](_0x1c991c[_0xb60f('0x4b')],{'firstName':_0x1c991c[_0xb60f('0x4b')][_0xb60f('0x88')],'phone':_0x1c991c['body'][_0xb60f('0x88')],'ListId':_0x4a1578['ListId']});_0x46a26d[_0x1c991c[_0xb60f('0x4b')][_0xb60f('0xc4')]]=_0x1c991c[_0xb60f('0x4b')][_0xb60f('0x88')];return db['CmContact'][_0xb60f('0xc8')]({'where':_0x4ffa67,'defaults':_0x46a26d});}})[_0xb60f('0xb2')](function(_0x488505){if(_0x488505){_0x308901=_0x488505;var _0x4ac061=fs[_0xb60f('0xc9')](path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0xca')),'utf8');var _0x4d89f0=ejs[_0xb60f('0xcb')](_0x4ac061,{'body':_[_0xb60f('0xcc')](_0x1c991c[_0xb60f('0x4b')][_0xb60f('0x4b')]),'bodyTitle':_0x2f9dd8[_0xb60f('0xcd')]});return db[_0xb60f('0xce')][_0xb60f('0x4a')]({'body':_0x4d89f0,'plainBody':htmlToText[_0xb60f('0xcf')](_0x4d89f0),'ContactId':_0x488505['id'],'ChatWebsiteId':_0x2f9dd8['id']});}})[_0xb60f('0x2c')](function(_0x3764d5){_0x1db0fa=_0x3764d5;if(_0x2370b8['length']){var _0x2a77a1=_0x2370b8['map'](function(_0x58ecb7){return{'name':_0x58ecb7[_0xb60f('0xd0')],'basename':_0x58ecb7['filename'],'type':_0x58ecb7['mimetype'],'ChatOfflineMessageId':_0x3764d5['id']};});_0x57f2c3=_0x2a77a1['map'](_0x5536fc=>{var _0x4db8fc={'filename':_0x5536fc['name'],'path':path[_0xb60f('0x67')](config['root'],_0xb60f('0xd1'),_0xb60f('0xc2'),_0xb60f('0xd2'),_0xb60f('0xd3'),_0x5536fc['basename'])};return _0x4db8fc;});if(!_0x2f9dd8[_0xb60f('0xd4')]){return db[_0xb60f('0xd5')][_0xb60f('0xd6')](function(_0x2a9c3f){return db['Attachment'][_0xb60f('0xd7')](_0x2a77a1,{'transaction':_0x2a9c3f});});}}})[_0xb60f('0x2c')](function(){if(_0x1db0fa){_0x333729=_0x1db0fa;return db[_0xb60f('0xc6')][_0xb60f('0x56')]({'where':{'service':!![]},'include':[{'model':db[_0xb60f('0xd8')],'as':_0xb60f('0xd9'),'raw':!![],'include':[{'model':db[_0xb60f('0xda')],'as':'CloudProvider','raw':!![]}]}]});}})[_0xb60f('0x2c')](function(_0x4154d6){if(_0x4154d6&&_0x4154d6[_0xb60f('0xd9')]&&_0x2f9dd8['forwardOffline']&&_0x2f9dd8[_0xb60f('0xdb')]){var _0x32697d=_0x4154d6[_0xb60f('0xdc')]();return respondWithRpcPromise(_0xb60f('0xdd'),_0xb60f('0xde'),{'account':_0x32697d,'message':{'from':util[_0xb60f('0xa6')](_0xb60f('0xdf'),_0x4154d6[_0xb60f('0x32')],_0x4154d6[_0xb60f('0xe0')]||_0x4154d6['Smtp'][_0xb60f('0x4c')]),'to':_0x2f9dd8[_0xb60f('0xdb')],'subject':_0x2f9dd8[_0xb60f('0xe1')],'html':_0x333729[_0xb60f('0x4b')],'attachments':_0x57f2c3}},client9003)[_0xb60f('0x2c')](function(){return _0x333729;})[_0xb60f('0x1d')](function(_0x3ddd18){logger[_0xb60f('0x19')](_0x3ddd18);});}})[_0xb60f('0x2c')](function(){if(_0x2f9dd8&&_0x2f9dd8[_0xb60f('0xd4')]&&_0x2f9dd8[_0xb60f('0xe2')]){var _0x2b0ff7=[];if(_0x2370b8[_0xb60f('0x38')]){_0x2b0ff7=_0x2370b8[_0xb60f('0x2f')](function(_0x220732){return{'name':_0x220732[_0xb60f('0xd0')],'basename':_0x220732[_0xb60f('0x64')],'type':_0x220732[_0xb60f('0xe3')],'ChatOfflineMessageId':_0x1db0fa['id']};});}var _0x14436f;if(!_[_0xb60f('0x6b')](_0x2f9dd8['subjectOffline'])){var _0x481e1b=_[_0xb60f('0x2f')](_0x1c991c[_0xb60f('0x4b')],function(_0x24ef11){return _0x24ef11;});var _0x582b2f=_[_0xb60f('0xe4')](_0x481e1b)[0x0];var _0x472843=_['mapValues'](_0x582b2f,function(_0xa2592e){return _0xa2592e;});_0x14436f=_0x472843[0x1][_0x2f9dd8[_0xb60f('0xe5')]];}var _0x51d572={'from':_0x308901[_0xb60f('0xe0')],'firstName':_0x308901[_0xb60f('0xa0')],'lastName':_0x308901[_0xb60f('0xa1')],'mapKey':_0xb60f('0xe0'),'message':{'from':_0x308901[_0xb60f('0xe0')],'to':_0x2f9dd8[_0xb60f('0xc6')][_0xb60f('0xe0')],'cc':'','subject':_[_0xb60f('0x6b')](_0x14436f)?_0x2f9dd8['offlineMessageSubject']:_0x14436f,'messageId':'','sentAt':new Date(),'attach':_0x2b0ff7[_0xb60f('0x38')],'attachments':_0x2b0ff7,'originChannel':_0xb60f('0xe6'),'ChatWebsiteId':_0x2f9dd8['id'],'ChatOfflineMessageId':_0x333729['id'],'originTo':_0x2f9dd8[_0xb60f('0xc6')][_0xb60f('0xe0')]},'body':_0x333729[_0xb60f('0x4b')]};var _0x5790fa={'account':{'id':_0x2f9dd8[_0xb60f('0xe2')]},'body':_0x51d572,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xb60f('0xe7'),'notifyMail',_0x5790fa,client9001)[_0xb60f('0x2c')](function(){return _0x333729;})['catch'](function(_0x87b708){logger[_0xb60f('0x19')](_0x87b708);});}return;})[_0xb60f('0x2c')](function(){if(_0x333729){return _0x333729;}})[_0xb60f('0x2c')](respondWithResult(_0x133f34,null))[_0xb60f('0x1d')](function(_0x68ea7e){logger[_0xb60f('0x19')](_0xb60f('0x1d'),_0x68ea7e);for(var _0x410b0a of _0x2370b8){var _0x3908e6=path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0xd1'),_0xb60f('0xc2'),_0xb60f('0xd2'),_0xb60f('0xd3'),_0x410b0a[_0xb60f('0x64')]);fs_extra[_0xb60f('0xe8')](_0x3908e6)[_0xb60f('0x1d')](function(_0x2090cc){logger[_0xb60f('0x19')](_0xb60f('0xe9'),_0x3908e6,_0x2090cc);});}});};exports[_0xb60f('0xea')]=function(_0x1af5a2,_0x15bef4){return db[_0xb60f('0xb1')][_0xb60f('0x49')]({'where':{'id':_0x1af5a2[_0xb60f('0x51')]['id']}})['then'](handleEntityNotFound(_0x15bef4,null))[_0xb60f('0x2c')](function(_0x1ede2b){if(_0x1ede2b){return _0x1ede2b[_0xb60f('0xea')](_0x1af5a2[_0xb60f('0x4b')][_0xb60f('0x5b')],_['omit'](_0x1af5a2[_0xb60f('0x4b')],[_0xb60f('0x5b'),'id'])||{});}})['then'](respondWithResult(_0x15bef4,null))[_0xb60f('0x1d')](handleError(_0x15bef4,null));};exports[_0xb60f('0xeb')]=function(_0x15abd1,_0x2adedc){var _0x29985b={'raw':![],'where':{}};var _0x3fdc3d={};var _0x6dabeb={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x15abd1['params']['id']}})['then'](handleEntityNotFound(_0x2adedc,null))[_0xb60f('0x2c')](function(_0x3d96b1){if(_0x3d96b1){_0x3fdc3d['model']=_[_0xb60f('0x34')](db[_0xb60f('0xb1')][_0xb60f('0x47')]);_0x3fdc3d[_0xb60f('0x33')]=_[_0xb60f('0x34')](_0x15abd1[_0xb60f('0x33')]);_0x3fdc3d[_0xb60f('0x35')]=_['intersection'](_0x3fdc3d[_0xb60f('0x31')],_0x3fdc3d[_0xb60f('0x33')]);_0x29985b[_0xb60f('0x37')]=_[_0xb60f('0x36')](_0x3fdc3d[_0xb60f('0x31')],qs[_0xb60f('0x48')](_0x15abd1[_0xb60f('0x33')][_0xb60f('0x48')]));_0x29985b[_0xb60f('0x37')]=_0x29985b['attributes']['length']?_0x29985b[_0xb60f('0x37')]:_0x3fdc3d[_0xb60f('0x31')];if(!_0x15abd1[_0xb60f('0x33')][_0xb60f('0x39')](_0xb60f('0x3a'))){_0x29985b[_0xb60f('0x25')]=qs['limit'](_0x15abd1[_0xb60f('0x33')][_0xb60f('0x25')]);_0x29985b[_0xb60f('0x22')]=qs[_0xb60f('0x22')](_0x15abd1[_0xb60f('0x33')][_0xb60f('0x22')]);}_0x29985b[_0xb60f('0x3b')]=qs['sort'](_0x15abd1[_0xb60f('0x33')]['sort']);_0x29985b[_0xb60f('0x3d')]=qs[_0xb60f('0x35')](_['pick'](_0x15abd1[_0xb60f('0x33')],_0x3fdc3d['filters']));_0x29985b[_0xb60f('0x3d')]['ChatWebsiteId']=_0x3d96b1['id'];if(_0x15abd1[_0xb60f('0x33')]['filter']){_0x29985b[_0xb60f('0x3d')]=_[_0xb60f('0x3f')](_0x29985b['where'],{'$or':_[_0xb60f('0x2f')](_0x29985b[_0xb60f('0x37')],function(_0x2b82e7){var _0x4b2814={};_0x4b2814[_0x2b82e7]={'$like':'%'+_0x15abd1[_0xb60f('0x33')]['filter']+'%'};return _0x4b2814;})});}_0x29985b=_[_0xb60f('0x3f')]({},_0x29985b,_0x15abd1['options']);return db[_0xb60f('0xb1')][_0xb60f('0x24')]({'where':_0x29985b[_0xb60f('0x3d')]})['then'](function(_0xd0d26b){_0x6dabeb['count']=_0xd0d26b;if(_0x15abd1['query']['includeAll']){_0x29985b['include']=[{'model':db[_0xb60f('0x81')],'as':_0xb60f('0xec'),'required':![]},{'model':db[_0xb60f('0xed')],'as':_0xb60f('0xee'),'attributes':[_0xb60f('0x32'),'fullname',_0xb60f('0xef')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xb60f('0x32'),'color'],'where':_0x15abd1[_0xb60f('0x33')][_0xb60f('0xf0')]?{'id':_0x15abd1[_0xb60f('0x33')]['tag']}:undefined,'required':_0x15abd1[_0xb60f('0x33')][_0xb60f('0xf0')]?!![]:![]}];}return db[_0xb60f('0xb1')][_0xb60f('0x43')](_0x29985b);})[_0xb60f('0x2c')](function(_0x5e753d){_0x6dabeb[_0xb60f('0x44')]=_0x5e753d;return _0x6dabeb;});}})[_0xb60f('0x2c')](respondWithFilteredResult(_0x2adedc,_0x29985b))[_0xb60f('0x1d')](handleError(_0x2adedc,null));};function iftimePromise(_0x29d222,_0x16adaf){return respondWithRpcPromise(_0xb60f('0xf1'),_0xb60f('0xf2'),{'command':_0x16adaf[_0xb60f('0xf3')]?util[_0xb60f('0xa6')](_0xb60f('0xf4'),_0x29d222[_0xb60f('0xf5')],_0x16adaf[_0xb60f('0xf3')]):util['format'](_0xb60f('0xf6'),_0x29d222[_0xb60f('0xf5')])},client9002)[_0xb60f('0x2c')](function(_0xa08a4b){var _0x52a991=_0xa08a4b&&_0xa08a4b[_0xb60f('0xf7')](_0xb60f('0xf8'))>=0x0?!![]:![];logger[_0xb60f('0x14')](_0xb60f('0xf9'),_0x16adaf['id'],_0x29d222['id'],_0x29d222[_0xb60f('0xf5')],_0x52a991?_0xb60f('0xfa'):_0xb60f('0xfb'),_0x16adaf[_0xb60f('0xf3')]?_0x16adaf[_0xb60f('0xf3')]:_0xb60f('0xfc'));return _0x52a991;})[_0xb60f('0x1d')](function(_0x1d7519){logger[_0xb60f('0x19')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x16adaf['id'],_0x29d222['id'],_0x29d222['interval'],util[_0xb60f('0xfd')](_0x1d7519,{'showHidden':![],'depth':null}),_0x16adaf['timezone']?_0x16adaf['timezone']:'No\x20timezone');return![];});}exports[_0xb60f('0xf2')]=function(_0x1a9d8d,_0x2480b0){var _0x5bd5c7=0x0;var _0x59a610=0x0;var _0xfd77a2=![];var _0x16882d;var _0x53a22e;return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x1a9d8d[_0xb60f('0x51')]['id']},'include':[{'model':db['Interval'],'as':_0xb60f('0xfe'),'include':[{'model':db[_0xb60f('0xfe')],'as':_0xb60f('0xff'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xb60f('0x2c')](handleEntityNotFound(_0x2480b0,null))[_0xb60f('0x2c')](function(_0x480b8f){if(_0x480b8f){_0x16882d=_0x480b8f;return _0x480b8f[_0xb60f('0x100')]({'raw':!![]});}})[_0xb60f('0x2c')](function(_0x65f4aa){if(_0x16882d){if(_0x65f4aa){_0x53a22e=_0x65f4aa;}}return require('../../config/license/util')[_0xb60f('0x101')]();})['then'](function(_0x405691){if(_0x405691){_0x59a610=_0x405691[_0xb60f('0x102')];_0xfd77a2=_0x405691[_0xb60f('0x6a')];}})[_0xb60f('0x2c')](function(){return db[_0xb60f('0xb1')][_0xb60f('0x24')]({'where':{'closed':![]}});})[_0xb60f('0x2c')](function(_0x2074b4){_0x5bd5c7=_0x2074b4;if(_0x59a610&&_0x2074b4>_0x59a610){return db[_0xb60f('0x103')][_0xb60f('0x56')]({'where':{'id':0x1}})[_0xb60f('0x2c')](function(_0x41f8c2){if(_0x41f8c2){_0x41f8c2[_0xb60f('0x104')](_0xb60f('0x105'));}});}})[_0xb60f('0x2c')](function(){if(_0x16882d[_0xb60f('0xfe')]&&_0x16882d[_0xb60f('0xfe')]['Intervals']){var _0x38fc74=[];for(var _0x58dc4b=0x0;_0x58dc4b<_0x16882d[_0xb60f('0xfe')]['Intervals'][_0xb60f('0x38')];_0x58dc4b++){var _0x957a5a=_0x16882d[_0xb60f('0xfe')][_0xb60f('0xff')][_0x58dc4b][_0xb60f('0x29')]({'plain':!![]});_0x38fc74['push'](iftimePromise(_0x957a5a,_0x16882d));}return BPromise[_0xb60f('0x106')](_0x38fc74)[_0xb60f('0x2c')](function(_0x349441){return _[_0xb60f('0x107')](_0x349441);});}else{return!![];}})[_0xb60f('0x2c')](function(_0x1185e8){var _0xb8511f=fs[_0xb60f('0xc9')](path[_0xb60f('0x67')](config[_0xb60f('0x68')],_0xb60f('0x108')),_0xb60f('0x109'));var _0x5cd18a={'remote':_0x16882d['remote'],'query':querystring['stringify'](_[_0xb60f('0x3f')](_0x16882d[_0xb60f('0x29')]({'plain':!![]}),{'customerIp':_0x1a9d8d[_0xb60f('0x7d')][_0xb60f('0x9d')]||_0x1a9d8d[_0xb60f('0x7d')][_0xb60f('0x10a')]||_0x1a9d8d[_0xb60f('0x10b')]['remoteAddress']||_0x1a9d8d['ip'],'referer':_0x1a9d8d[_0xb60f('0x7d')]['referer'],'openedInteractions':_0x5bd5c7,'maxInteractions':_0x59a610,'virtual':_0xfd77a2[_0xb60f('0x102')],'online':_0x1185e8,'custom':_0xfd77a2}))[_0xb60f('0x10c')](/'/g,'\x5c\x27')};_0x2480b0[_0xb60f('0x2d')](ejs[_0xb60f('0xcb')](Mustache[_0xb60f('0xcb')](_0xb8511f,_0x5cd18a),{'proactiveActions':_0x53a22e,'alignment':_0x16882d[_0xb60f('0x10d')],'verticalAlignment':_0x16882d[_0xb60f('0x10e')],'div_color':_0x16882d[_0xb60f('0x10f')],'labelText':_0x16882d[_0xb60f('0x110')],'text_color':_0x16882d['textColor'],'text_button_color':_0x16882d[_0xb60f('0x111')],'button_color':_0x16882d[_0xb60f('0x112')],'background_color':_0x16882d[_0xb60f('0x113')],'hideWhenOffline':_0x16882d[_0xb60f('0x114')],'interval':_0x16882d[_0xb60f('0x115')]}));})[_0xb60f('0x1d')](handleError(_0x2480b0,null));};exports['addApplications']=function(_0x3033,_0x5e311b){var _0x53acb2=_0x3033['params']['id'];var _0x38c57f=_0x3033[_0xb60f('0x4b')];var _0x16099d=0xc8;var _0x411f82=null;return db[_0xb60f('0xd5')][_0xb60f('0xd6')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS'][_0xb60f('0x116')]},function(_0x112295){return db[_0xb60f('0x30')]['findOne']({'where':{'id':_0x53acb2},'transaction':_0x112295})[_0xb60f('0x2c')](function(_0x4a7b0d){if(_0x4a7b0d){return db[_0xb60f('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x53acb2},'transaction':_0x112295})['then'](function(){var _0x4437af=_['map'](_0x38c57f,function(_0x4a9d65){_0x4a9d65[_0xb60f('0x54')]=_0x53acb2;return _0x4a9d65;});return db['ChatApplication'][_0xb60f('0xd7')](_0x4437af,{'transaction':_0x112295});});}else{_0x16099d=0x194;_0x411f82=[];}});})['then'](function(){if(_0x16099d!==0x194){return db[_0xb60f('0x91')][_0xb60f('0x117')]({'where':{'ChatWebsiteId':_0x53acb2},'order':'priority'})[_0xb60f('0x2c')](function(_0x2c71e9){_0x411f82=_0x2c71e9;});}})[_0xb60f('0x1d')](function(_0x998f2){_0x16099d=0x1f4;logger[_0xb60f('0x19')](_0x998f2[_0xb60f('0x118')]);if(_0x998f2[_0xb60f('0x32')]){delete _0x998f2[_0xb60f('0x32')];}_0x411f82=_0x998f2;})[_0xb60f('0x119')](function(){if(_0x411f82===null){_0x5e311b['sendStatus'](_0x16099d);}else{if(_0x16099d===0x1f4){_0x5e311b[_0xb60f('0x20')](_0x16099d)[_0xb60f('0x2d')](_0x411f82);}else{_0x5e311b[_0xb60f('0x20')](_0x16099d)[_0xb60f('0x21')](_0x411f82);}}});};exports[_0xb60f('0x11a')]=function(_0x5f2c18,_0x285d19){var _0x1b36e6={};var _0x1a7516={};var _0x535c42;var _0x4aea82;return db[_0xb60f('0x30')][_0xb60f('0x56')]({'where':{'id':_0x5f2c18[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x285d19,null))[_0xb60f('0x2c')](function(_0x3174ee){if(_0x3174ee){_0x535c42=_0x3174ee;_0x1a7516[_0xb60f('0x31')]=_[_0xb60f('0x34')](db[_0xb60f('0x91')][_0xb60f('0x47')]);_0x1a7516[_0xb60f('0x33')]=_['keys'](_0x5f2c18[_0xb60f('0x33')]);_0x1a7516['filters']=_[_0xb60f('0x36')](_0x1a7516[_0xb60f('0x31')],_0x1a7516[_0xb60f('0x33')]);_0x1b36e6[_0xb60f('0x37')]=_[_0xb60f('0x36')](_0x1a7516[_0xb60f('0x31')],qs['fields'](_0x5f2c18[_0xb60f('0x33')][_0xb60f('0x48')]));_0x1b36e6[_0xb60f('0x37')]=_0x1b36e6[_0xb60f('0x37')]['length']?_0x1b36e6[_0xb60f('0x37')]:_0x1a7516[_0xb60f('0x31')];_0x1b36e6[_0xb60f('0x3b')]=qs['sort'](_0x5f2c18[_0xb60f('0x33')][_0xb60f('0x3c')]);_0x1b36e6[_0xb60f('0x3d')]=qs['filters'](_['pick'](_0x5f2c18[_0xb60f('0x33')],_0x1a7516[_0xb60f('0x35')]));if(_0x5f2c18['query'][_0xb60f('0x3e')]){_0x1b36e6[_0xb60f('0x3d')]=_['merge'](_0x1b36e6[_0xb60f('0x3d')],{'$or':_[_0xb60f('0x2f')](_0x1b36e6[_0xb60f('0x37')],function(_0x3e3e80){var _0x16cc8f={};_0x16cc8f[_0x3e3e80]={'$like':'%'+_0x5f2c18[_0xb60f('0x33')]['filter']+'%'};return _0x16cc8f;})});}_0x1b36e6=_[_0xb60f('0x3f')]({},_0x1b36e6,_0x5f2c18[_0xb60f('0x41')]);return _0x535c42[_0xb60f('0x11a')](_0x1b36e6);}})[_0xb60f('0x2c')](function(_0xc65877){if(_0xc65877){_0x4aea82=_0xc65877[_0xb60f('0x38')];if(!_0x5f2c18['query']['hasOwnProperty'](_0xb60f('0x3a'))){_0x1b36e6['limit']=qs[_0xb60f('0x25')](_0x5f2c18[_0xb60f('0x33')][_0xb60f('0x25')]);_0x1b36e6[_0xb60f('0x22')]=qs[_0xb60f('0x22')](_0x5f2c18[_0xb60f('0x33')]['offset']);}return _0x535c42[_0xb60f('0x11a')](_0x1b36e6);}})[_0xb60f('0x2c')](function(_0x130a63){if(_0x130a63){return _0x130a63?{'count':_0x4aea82,'rows':_0x130a63}:null;}})[_0xb60f('0x2c')](respondWithResult(_0x285d19,null))[_0xb60f('0x1d')](handleError(_0x285d19,null));};exports['addProactiveActions']=function(_0xb26d5,_0x155b62){return db[_0xb60f('0x11b')]['find']({'where':{'id':_0xb26d5[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x155b62,null))[_0xb60f('0x2c')](function(_0x456ead){if(_0x456ead){return _0x456ead['addProactiveActions'](_0xb26d5['body'][_0xb60f('0x5b')],_[_0xb60f('0x11c')](_0xb26d5['body'],[_0xb60f('0x5b'),'id'])||{});}})[_0xb60f('0x2c')](respondWithResult(_0x155b62,null))[_0xb60f('0x1d')](handleError(_0x155b62,null));};exports[_0xb60f('0x100')]=function(_0x21fcea,_0x5b659c){var _0xfba994={};var _0x266c26={};var _0x4ab054;var _0x22c173;return db[_0xb60f('0x30')][_0xb60f('0x56')]({'where':{'id':_0x21fcea[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x5b659c,null))[_0xb60f('0x2c')](function(_0x1b03eb){if(_0x1b03eb){_0x4ab054=_0x1b03eb;_0x266c26[_0xb60f('0x31')]=_[_0xb60f('0x34')](db[_0xb60f('0x11d')][_0xb60f('0x47')]);_0x266c26[_0xb60f('0x33')]=_[_0xb60f('0x34')](_0x21fcea[_0xb60f('0x33')]);_0x266c26[_0xb60f('0x35')]=_[_0xb60f('0x36')](_0x266c26['model'],_0x266c26['query']);_0xfba994[_0xb60f('0x37')]=_[_0xb60f('0x36')](_0x266c26['model'],qs[_0xb60f('0x48')](_0x21fcea[_0xb60f('0x33')][_0xb60f('0x48')]));_0xfba994['attributes']=_0xfba994['attributes'][_0xb60f('0x38')]?_0xfba994['attributes']:_0x266c26['model'];_0xfba994[_0xb60f('0x3b')]=qs[_0xb60f('0x3c')](_0x21fcea[_0xb60f('0x33')][_0xb60f('0x3c')]);_0xfba994['where']=qs[_0xb60f('0x35')](_['pick'](_0x21fcea[_0xb60f('0x33')],_0x266c26[_0xb60f('0x35')]));if(_0x21fcea[_0xb60f('0x33')][_0xb60f('0x3e')]){_0xfba994[_0xb60f('0x3d')]=_[_0xb60f('0x3f')](_0xfba994['where'],{'$or':_[_0xb60f('0x2f')](_0xfba994[_0xb60f('0x37')],function(_0x4c376a){var _0x51b25f={};_0x51b25f[_0x4c376a]={'$like':'%'+_0x21fcea['query'][_0xb60f('0x3e')]+'%'};return _0x51b25f;})});}_0xfba994=_[_0xb60f('0x3f')]({},_0xfba994,_0x21fcea[_0xb60f('0x41')]);return _0x4ab054[_0xb60f('0x100')](_0xfba994);}})['then'](function(_0x1e76fc){if(_0x1e76fc){_0x22c173=_0x1e76fc['length'];if(!_0x21fcea['query'][_0xb60f('0x39')](_0xb60f('0x3a'))){_0xfba994[_0xb60f('0x25')]=qs[_0xb60f('0x25')](_0x21fcea['query'][_0xb60f('0x25')]);_0xfba994[_0xb60f('0x22')]=qs[_0xb60f('0x22')](_0x21fcea['query'][_0xb60f('0x22')]);}return _0x4ab054['getProactiveActions'](_0xfba994);}})[_0xb60f('0x2c')](function(_0xced785){if(_0xced785){return _0xced785?{'count':_0x22c173,'rows':_0xced785}:null;}})[_0xb60f('0x2c')](respondWithResult(_0x5b659c,null))[_0xb60f('0x1d')](handleError(_0x5b659c,null));};exports[_0xb60f('0x11e')]=function(_0x5a27e8,_0x51143d){var _0x2fd265=_0x5a27e8[_0xb60f('0x33')][_0xb60f('0x11f')]===_0xb60f('0x120')?_0xb60f('0x121'):'onlineForm';return db['ChatWebsite'][_0xb60f('0x49')]({'attributes':['id',_0x2fd265],'where':{'id':_0x5a27e8[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x51143d,null))['then'](function(_0x5209d9){if(_0x5209d9){var _0x9b94d4=_0x5209d9[_0x2fd265];var _0x34d65e=_0x9b94d4&&_0x9b94d4[_0xb60f('0x122')]?_0x9b94d4[_0xb60f('0x122')]:[];_0x51143d[_0xb60f('0x2d')]({'fromKey':_[_0xb60f('0x6b')](_0x9b94d4['fromKey'])?undefined:_0x9b94d4[_0xb60f('0x123')],'count':_0x34d65e[_0xb60f('0x38')],'rows':_0x34d65e});}})[_0xb60f('0x1d')](handleError(_0x51143d,null));};exports[_0xb60f('0x124')]=function(_0x1bb7ce,_0x237974){var _0x57c8e3={'raw':![],'where':{}};var _0x18d4c3={};var _0x593408={'count':0x0,'rows':[]};return db[_0xb60f('0x30')][_0xb60f('0x56')]({'where':{'id':_0x1bb7ce[_0xb60f('0x51')]['id']}})['then'](handleEntityNotFound(_0x237974,null))[_0xb60f('0x2c')](function(_0x555b90){if(_0x555b90){_0x18d4c3[_0xb60f('0x31')]=_[_0xb60f('0x34')](db[_0xb60f('0xce')]['rawAttributes']);_0x18d4c3[_0xb60f('0x33')]=_[_0xb60f('0x34')](_0x1bb7ce[_0xb60f('0x33')]);_0x18d4c3['filters']=_[_0xb60f('0x36')](_0x18d4c3['model'],_0x18d4c3[_0xb60f('0x33')]);_0x57c8e3[_0xb60f('0x37')]=_[_0xb60f('0x36')](_0x18d4c3[_0xb60f('0x31')],qs[_0xb60f('0x48')](_0x1bb7ce[_0xb60f('0x33')]['fields']));_0x57c8e3[_0xb60f('0x37')]=_0x57c8e3[_0xb60f('0x37')]['length']?_0x57c8e3[_0xb60f('0x37')]:_0x18d4c3[_0xb60f('0x31')];if(!_0x1bb7ce[_0xb60f('0x33')]['hasOwnProperty'](_0xb60f('0x3a'))){_0x57c8e3[_0xb60f('0x25')]=qs[_0xb60f('0x25')](_0x1bb7ce[_0xb60f('0x33')][_0xb60f('0x25')]);_0x57c8e3[_0xb60f('0x22')]=qs['offset'](_0x1bb7ce['query'][_0xb60f('0x22')]);}_0x57c8e3[_0xb60f('0x3b')]=qs['sort'](_0x1bb7ce[_0xb60f('0x33')][_0xb60f('0x3c')]);_0x57c8e3[_0xb60f('0x3d')]=qs[_0xb60f('0x35')](_[_0xb60f('0x58')](_0x1bb7ce['query'],_0x18d4c3[_0xb60f('0x35')]));_0x57c8e3[_0xb60f('0x3d')]['ChatWebsiteId']=_0x555b90['id'];if(_0x1bb7ce[_0xb60f('0x33')][_0xb60f('0x3e')]){_0x57c8e3['where']=_[_0xb60f('0x3f')](_0x57c8e3[_0xb60f('0x3d')],{'$or':_[_0xb60f('0x2f')](_0x57c8e3[_0xb60f('0x37')],function(_0x45c45c){var _0x454088={};_0x454088[_0x45c45c]={'$like':'%'+_0x1bb7ce[_0xb60f('0x33')][_0xb60f('0x3e')]+'%'};return _0x454088;})});}_0x57c8e3=_[_0xb60f('0x3f')]({},_0x57c8e3,_0x1bb7ce['options']);return db[_0xb60f('0xce')][_0xb60f('0x24')]({'where':_0x57c8e3[_0xb60f('0x3d')]})[_0xb60f('0x2c')](function(_0x3482ab){_0x593408[_0xb60f('0x24')]=_0x3482ab;if(_0x1bb7ce[_0xb60f('0x33')][_0xb60f('0x42')]){_0x57c8e3[_0xb60f('0x59')]=[{'all':!![]}];}else{_0x57c8e3['include']=[{'model':db[_0xb60f('0x81')],'as':_0xb60f('0xec'),'required':![]},{'model':db['Attachment'],'as':_0xb60f('0x125'),'required':![]}];}return db[_0xb60f('0xce')]['findAll'](_0x57c8e3);})[_0xb60f('0x2c')](function(_0x433407){_0x593408['rows']=_0x433407;return _0x593408;});}})[_0xb60f('0x2c')](respondWithFilteredResult(_0x237974,_0x57c8e3))[_0xb60f('0x1d')](handleError(_0x237974,null));};exports[_0xb60f('0x126')]=function(_0x451595,_0x26b85e){return db[_0xb60f('0x30')]['find']({'where':{'id':_0x451595[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x26b85e,null))[_0xb60f('0x2c')](function(_0xe40e3c){if(_0xe40e3c){return _0xe40e3c[_0xb60f('0x126')](_0x451595['body'][_0xb60f('0x5b')],_[_0xb60f('0x11c')](_0x451595[_0xb60f('0x4b')],['ids','id'])||{})[_0xb60f('0xb2')](function(_0x115608){for(var _0x1c6644=0x0;_0x1c6644<_0x451595['body'][_0xb60f('0x5b')][_0xb60f('0x38')];_0x1c6644+=0x1){socket['emit']('userChatWebsite:save',{'UserId':Number(_0x451595['body'][_0xb60f('0x5b')][_0x1c6644]),'ChatWebsiteId':Number(_0x451595[_0xb60f('0x51')]['id'])});}return _0x115608;});}})[_0xb60f('0x2c')](respondWithResult(_0x26b85e,null))[_0xb60f('0x1d')](handleError(_0x26b85e,null));};exports['removeAgents']=function(_0x53da3e,_0x36dfe8){return db[_0xb60f('0x30')][_0xb60f('0x49')]({'where':{'id':_0x53da3e[_0xb60f('0x51')]['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x36dfe8,null))[_0xb60f('0x2c')](function(_0x587032){if(_0x587032){return _0x587032['removeAgents'](_0x53da3e[_0xb60f('0x33')][_0xb60f('0x5b')])['then'](function(){if(_[_0xb60f('0x127')](_0x53da3e['query'][_0xb60f('0x5b')])){for(var _0x35986e=0x0;_0x35986e<_0x53da3e[_0xb60f('0x33')][_0xb60f('0x5b')][_0xb60f('0x38')];_0x35986e+=0x1){socket[_0xb60f('0x128')]('userChatWebsite:remove',{'UserId':Number(_0x53da3e[_0xb60f('0x33')]['ids'][_0x35986e]),'ChatWebsiteId':Number(_0x53da3e['params']['id'])});}}else{socket['emit'](_0xb60f('0x129'),{'UserId':Number(_0x53da3e[_0xb60f('0x33')][_0xb60f('0x5b')]),'ChatWebsiteId':Number(_0x53da3e[_0xb60f('0x51')]['id'])});}});}})[_0xb60f('0x2c')](respondWithStatusCode(_0x36dfe8,null))['catch'](handleError(_0x36dfe8,null));};exports[_0xb60f('0x12a')]=function(_0x582117,_0x25a745){var _0x9d21a6={};var _0xfa7322={};var _0x2af911;var _0x89e29a;return db['ChatWebsite']['findOne']({'where':{'id':_0x582117['params']['id']}})[_0xb60f('0x2c')](handleEntityNotFound(_0x25a745,null))['then'](function(_0x26ca7b){if(_0x26ca7b){_0x2af911=_0x26ca7b;_0xfa7322[_0xb60f('0x31')]=_[_0xb60f('0x34')](db[_0xb60f('0xed')]['rawAttributes']);_0xfa7322[_0xb60f('0x33')]=_[_0xb60f('0x34')](_0x582117['query']);_0xfa7322[_0xb60f('0x35')]=_[_0xb60f('0x36')](_0xfa7322[_0xb60f('0x31')],_0xfa7322['query']);_0x9d21a6['attributes']=_[_0xb60f('0x36')](_0xfa7322[_0xb60f('0x31')],qs[_0xb60f('0x48')](_0x582117[_0xb60f('0x33')][_0xb60f('0x48')]));_0x9d21a6['attributes']=_0x9d21a6['attributes'][_0xb60f('0x38')]?_0x9d21a6[_0xb60f('0x37')]:_0xfa7322[_0xb60f('0x31')];_0x9d21a6[_0xb60f('0x3b')]=qs[_0xb60f('0x3c')](_0x582117[_0xb60f('0x33')][_0xb60f('0x3c')]);_0x9d21a6['where']=qs['filters'](_[_0xb60f('0x58')](_0x582117[_0xb60f('0x33')],_0xfa7322['filters']));if(_0x582117[_0xb60f('0x33')][_0xb60f('0x3e')]){_0x9d21a6[_0xb60f('0x3d')]=_[_0xb60f('0x3f')](_0x9d21a6[_0xb60f('0x3d')],{'$or':_['map'](_0x9d21a6['attributes'],function(_0x7fe680){var _0x217048={};_0x217048[_0x7fe680]={'$like':'%'+_0x582117[_0xb60f('0x33')][_0xb60f('0x3e')]+'%'};return _0x217048;})});}_0x9d21a6=_['merge']({},_0x9d21a6,_0x582117[_0xb60f('0x41')]);return _0x2af911[_0xb60f('0x12a')](_0x9d21a6);}})[_0xb60f('0x2c')](function(_0x4e01ca){if(_0x4e01ca){_0x89e29a=_0x4e01ca[_0xb60f('0x38')];if(!_0x582117[_0xb60f('0x33')][_0xb60f('0x39')](_0xb60f('0x3a'))){_0x9d21a6[_0xb60f('0x25')]=qs['limit'](_0x582117['query'][_0xb60f('0x25')]);_0x9d21a6[_0xb60f('0x22')]=qs[_0xb60f('0x22')](_0x582117[_0xb60f('0x33')][_0xb60f('0x22')]);}return _0x2af911['getAgents'](_0x9d21a6);}})[_0xb60f('0x2c')](function(_0x3e945d){if(_0x3e945d){return _0x3e945d?{'count':_0x89e29a,'rows':_0x3e945d}:null;}})[_0xb60f('0x2c')](respondWithResult(_0x25a745,null))[_0xb60f('0x1d')](handleError(_0x25a745,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index b7d34d3..8daa25a 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 _0x3d6d=['../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0xcd20dc,_0x155eca){var _0xae33d5=function(_0x1add3f){while(--_0x1add3f){_0xcd20dc['push'](_0xcd20dc['shift']());}};_0xae33d5(++_0x155eca);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x3d6d[_0x13187a];return _0x65b85f;};'use strict';var EventEmitter=require(_0xd3d6('0x0'));var ChatWebsite=require(_0xd3d6('0x1'))['db'][_0xd3d6('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd3d6('0x3')](0x0);var events={'afterCreate':_0xd3d6('0x4'),'afterUpdate':_0xd3d6('0x5'),'afterDestroy':_0xd3d6('0x6')};function emitEvent(_0x15e35a){return function(_0x297bd6,_0x3d5e37,_0xee81c0){ChatWebsiteEvents['emit'](_0x15e35a+':'+_0x297bd6['id'],_0x297bd6);ChatWebsiteEvents['emit'](_0x15e35a,_0x297bd6);_0xee81c0(null);};}for(var e in events){if(events[_0xd3d6('0x7')](e)){var event=events[e];ChatWebsite[_0xd3d6('0x8')](e,emitEvent(event));}}module[_0xd3d6('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xeddd=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x44d85d,_0x477ae2){var _0x55f365=function(_0x84b597){while(--_0x84b597){_0x44d85d['push'](_0x44d85d['shift']());}};_0x55f365(++_0x477ae2);}(_0xeddd,0x69));var _0xdedd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xeddd[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0xdedd('0x0'));var ChatWebsite=require(_0xdedd('0x1'))['db'][_0xdedd('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xdedd('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdedd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x10de65){return function(_0xd2ff49,_0x56e22a,_0x37b819){ChatWebsiteEvents[_0xdedd('0x5')](_0x10de65+':'+_0xd2ff49['id'],_0xd2ff49);ChatWebsiteEvents[_0xdedd('0x5')](_0x10de65,_0xd2ff49);_0x37b819(null);};}for(var e in events){if(events[_0xdedd('0x6')](e)){var event=events[e];ChatWebsite[_0xdedd('0x7')](e,emitEvent(event));}}module[_0xdedd('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 5790082..045c761 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 _0x97ac=['bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0xc7f8c1,_0x12576f){var _0x137f57=function(_0x487c50){while(--_0x487c50){_0xc7f8c1['push'](_0xc7f8c1['shift']());}};_0x137f57(++_0x12576f);}(_0x97ac,0xbe));var _0xc97a=function(_0x3ac392,_0x57126b){_0x3ac392=_0x3ac392-0x0;var _0x788ab8=_0x97ac[_0x3ac392];return _0x788ab8;};'use strict';var _=require(_0xc97a('0x0'));var util=require(_0xc97a('0x1'));var logger=require(_0xc97a('0x2'))(_0xc97a('0x3'));var moment=require(_0xc97a('0x4'));var BPromise=require(_0xc97a('0x5'));var rp=require(_0xc97a('0x6'));var fs=require('fs');var path=require(_0xc97a('0x7'));var rimraf=require(_0xc97a('0x8'));var config=require(_0xc97a('0x9'));var attributes=require(_0xc97a('0xa'));module[_0xc97a('0xb')]=function(_0x5eda35,_0x42b436){return _0x5eda35[_0xc97a('0xc')](_0xc97a('0xd'),attributes,{'tableName':_0xc97a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x725d=['define','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x5ee0ee,_0x3ce413){var _0x198093=function(_0x29dcc9){while(--_0x29dcc9){_0x5ee0ee['push'](_0x5ee0ee['shift']());}};_0x198093(++_0x3ce413);}(_0x725d,0x1ec));var _0xd725=function(_0x1deff2,_0x4a9388){_0x1deff2=_0x1deff2-0x0;var _0x5a651c=_0x725d[_0x1deff2];return _0x5a651c;};'use strict';var _=require(_0xd725('0x0'));var util=require(_0xd725('0x1'));var logger=require(_0xd725('0x2'))(_0xd725('0x3'));var moment=require(_0xd725('0x4'));var BPromise=require(_0xd725('0x5'));var rp=require(_0xd725('0x6'));var fs=require('fs');var path=require(_0xd725('0x7'));var rimraf=require(_0xd725('0x8'));var config=require(_0xd725('0x9'));var attributes=require(_0xd725('0xa'));module[_0xd725('0xb')]=function(_0x421ef8,_0x2c7da0){return _0x421ef8[_0xd725('0xc')]('ChatWebsite',attributes,{'tableName':_0xd725('0xd'),'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 4a9a198..728319e 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 _0xef0e=['ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','request\x20sent'];(function(_0x2d7842,_0x5e1932){var _0x35485d=function(_0x56843a){while(--_0x56843a){_0x2d7842['push'](_0x2d7842['shift']());}};_0x35485d(++_0x5e1932);}(_0xef0e,0x129));var _0xeef0=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xef0e[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xeef0('0x0'));var util=require(_0xeef0('0x1'));var moment=require(_0xeef0('0x2'));var BPromise=require(_0xeef0('0x3'));var rs=require(_0xeef0('0x4'));var fs=require('fs');var Redis=require(_0xeef0('0x5'));var db=require(_0xeef0('0x6'))['db'];var utils=require(_0xeef0('0x7'));var logger=require(_0xeef0('0x8'))(_0xeef0('0x9'));var config=require(_0xeef0('0xa'));var jayson=require(_0xeef0('0xb'));var client=jayson['client'][_0xeef0('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xeef0('0xd')],{'host':_0xeef0('0xe'),'port':0x18eb});var socket=require(_0xeef0('0xf'))(new Redis(config['redis']));require(_0xeef0('0x10'))[_0xeef0('0x11')](socket);function respondWithRpcPromise(_0x1f44ca,_0x44f12f,_0x327064){return new BPromise(function(_0x2514ab,_0x4bb600){return client[_0xeef0('0x12')](_0x1f44ca,_0x327064)[_0xeef0('0x13')](function(_0x291b28){logger[_0xeef0('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x44f12f,_0xeef0('0x15'));logger['debug'](_0xeef0('0x16'),_0x44f12f,'request\x20sent',JSON['stringify'](_0x291b28));if(_0x291b28[_0xeef0('0x17')]){if(_0x291b28[_0xeef0('0x17')][_0xeef0('0x18')]===0x1f4){logger[_0xeef0('0x17')](_0xeef0('0x19'),_0x44f12f,_0x291b28[_0xeef0('0x17')]['message']);return _0x4bb600(_0x291b28['error']['message']);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x44f12f,_0x291b28[_0xeef0('0x17')][_0xeef0('0x1a')]);return _0x2514ab(_0x291b28['error'][_0xeef0('0x1a')]);}else{logger['info'](_0xeef0('0x19'),_0x44f12f,_0xeef0('0x15'));_0x2514ab(_0x291b28[_0xeef0('0x1b')][_0xeef0('0x1a')]);}})[_0xeef0('0x1c')](function(_0x4ebc33){logger[_0xeef0('0x17')](_0xeef0('0x19'),_0x44f12f,_0x4ebc33);_0x4bb600(_0x4ebc33);});});} \ No newline at end of file +var _0x924d=['error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x136846,_0xc9ba49){var _0x16e0d2=function(_0x1d7824){while(--_0x1d7824){_0x136846['push'](_0x136846['shift']());}};_0x16e0d2(++_0xc9ba49);}(_0x924d,0x1e5));var _0xd924=function(_0x27b7d2,_0x56c091){_0x27b7d2=_0x27b7d2-0x0;var _0x3ef6be=_0x924d[_0x27b7d2];return _0x3ef6be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd924('0x0'));var BPromise=require(_0xd924('0x1'));var rs=require(_0xd924('0x2'));var fs=require('fs');var Redis=require(_0xd924('0x3'));var db=require(_0xd924('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd924('0x5'))(_0xd924('0x6'));var config=require(_0xd924('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd924('0x8')][_0xd924('0x9')]({'port':0x232a});config[_0xd924('0xa')]=_['defaults'](config[_0xd924('0xa')],{'host':_0xd924('0xb'),'port':0x18eb});var socket=require(_0xd924('0xc'))(new Redis(config[_0xd924('0xa')]));require(_0xd924('0xd'))['register'](socket);function respondWithRpcPromise(_0x5180b3,_0xbb629a,_0x164730){return new BPromise(function(_0x5399a2,_0x53e22a){return client[_0xd924('0xe')](_0x5180b3,_0x164730)[_0xd924('0xf')](function(_0x9bd609){logger[_0xd924('0x10')](_0xd924('0x11'),_0xbb629a,_0xd924('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xbb629a,_0xd924('0x12'),JSON['stringify'](_0x9bd609));if(_0x9bd609[_0xd924('0x13')]){if(_0x9bd609[_0xd924('0x13')][_0xd924('0x14')]===0x1f4){logger[_0xd924('0x13')](_0xd924('0x11'),_0xbb629a,_0x9bd609[_0xd924('0x13')]['message']);return _0x53e22a(_0x9bd609[_0xd924('0x13')]['message']);}logger[_0xd924('0x13')](_0xd924('0x11'),_0xbb629a,_0x9bd609[_0xd924('0x13')][_0xd924('0x15')]);return _0x5399a2(_0x9bd609[_0xd924('0x13')][_0xd924('0x15')]);}else{logger[_0xd924('0x10')](_0xd924('0x11'),_0xbb629a,'request\x20sent');_0x5399a2(_0x9bd609[_0xd924('0x16')][_0xd924('0x15')]);}})[_0xd924('0x17')](function(_0x33d093){logger[_0xd924('0x13')](_0xd924('0x11'),_0xbb629a,_0x33d093);_0x53e22a(_0x33d093);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 876441a..e68254e 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 _0xd032=['./chatWebsite.events','save','remove','chatWebsite:'];(function(_0x250441,_0x4a1f85){var _0x1fbace=function(_0x148356){while(--_0x148356){_0x250441['push'](_0x250441['shift']());}};_0x1fbace(++_0x4a1f85);}(_0xd032,0xf0));var _0x2d03=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xd032[_0x2070da];return _0x4f9fe1;};'use strict';var ChatWebsiteEvents=require(_0x2d03('0x0'));var events=[_0x2d03('0x1'),_0x2d03('0x2'),'update'];function createListener(_0x3b5924,_0x55a9f4){return function(_0x5a0f14){_0x55a9f4['emit'](_0x3b5924,_0x5a0f14);};}function removeListener(_0x1bc5cc,_0x18e738){return function(){ChatWebsiteEvents['removeListener'](_0x1bc5cc,_0x18e738);};}exports['register']=function(_0x7f54ae){for(var _0x3256dd=0x0,_0x3ff60e=events['length'];_0x3256dd<_0x3ff60e;_0x3256dd++){var _0x440605=events[_0x3256dd];var _0x491b57=createListener(_0x2d03('0x3')+_0x440605,_0x7f54ae);ChatWebsiteEvents['on'](_0x440605,_0x491b57);}}; \ No newline at end of file +var _0x0d4e=['./chatWebsite.events','remove','emit','length','chatWebsite:'];(function(_0x14483e,_0x8b1ff0){var _0xa529a2=function(_0x124f68){while(--_0x124f68){_0x14483e['push'](_0x14483e['shift']());}};_0xa529a2(++_0x8b1ff0);}(_0x0d4e,0x1d6));var _0xe0d4=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0d4e[_0x57b54c];return _0x59cc19;};'use strict';var ChatWebsiteEvents=require(_0xe0d4('0x0'));var events=['save',_0xe0d4('0x1'),'update'];function createListener(_0x4a6712,_0x50d1b3){return function(_0x2a5d6e){_0x50d1b3[_0xe0d4('0x2')](_0x4a6712,_0x2a5d6e);};}function removeListener(_0x4184b0,_0xe88038){return function(){ChatWebsiteEvents['removeListener'](_0x4184b0,_0xe88038);};}exports['register']=function(_0x3bc2c5){for(var _0x2abe9e=0x0,_0x325f75=events[_0xe0d4('0x3')];_0x2abe9e<_0x325f75;_0x2abe9e++){var _0x4c5ef6=events[_0x2abe9e];var _0x52d7a6=createListener(_0xe0d4('0x4')+_0x4c5ef6,_0x3bc2c5);ChatWebsiteEvents['on'](_0x4c5ef6,_0x52d7a6);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a378bd0..689e8d6 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 _0xdded=['/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','addAnswer','join','root','server/files/images/logos/','now','originalname','file','addLogo','diskStorage','format','addAvatar','server/files/images/avatars/','single','addCustomerAvatar','notify','server/files','ensureDir','replace','extname','any','offline','addInteraction','addApplications'];(function(_0x35e409,_0x5bcdec){var _0x37e869=function(_0x5a9aed){while(--_0x5a9aed){_0x35e409['push'](_0x35e409['shift']());}};_0x37e869(++_0x5bcdec);}(_0xdded,0x1f4));var _0xddde=function(_0x39e461,_0x85ac0d){_0x39e461=_0x39e461-0x0;var _0x1a9f27=_0xdded[_0x39e461];return _0x1a9f27;};'use strict';var multer=require('multer');var util=require(_0xddde('0x0'));var path=require(_0xddde('0x1'));var timeout=require(_0xddde('0x2'));var express=require('express');var router=express[_0xddde('0x3')]();var fs_extra=require(_0xddde('0x4'));var auth=require(_0xddde('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xddde('0x6'));var controller=require(_0xddde('0x7'));router[_0xddde('0x8')]('/',auth[_0xddde('0x9')](),controller[_0xddde('0xa')]);router[_0xddde('0x8')](_0xddde('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xddde('0xc'),auth['isAuthenticated'](),controller[_0xddde('0xd')]);router[_0xddde('0x8')](_0xddde('0xe'),auth[_0xddde('0x9')](),controller['getDispositions']);router[_0xddde('0x8')](_0xddde('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xddde('0x8')](_0xddde('0x10'),controller[_0xddde('0x11')]);router[_0xddde('0x8')](_0xddde('0x12'),controller[_0xddde('0x13')]);router[_0xddde('0x8')](_0xddde('0x14'),controller['getCustomerAvatar']);router[_0xddde('0x8')]('/:id/system_avatar',controller[_0xddde('0x15')]);router[_0xddde('0x8')](_0xddde('0x16'),auth['isAuthenticated'](),controller[_0xddde('0x17')]);router['get'](_0xddde('0x18'),controller[_0xddde('0x19')]);router[_0xddde('0x8')](_0xddde('0x1a'),auth['isAuthenticated'](),controller[_0xddde('0x1b')]);router[_0xddde('0x8')]('/:id/proactive_actions',auth[_0xddde('0x9')](),controller[_0xddde('0x1c')]);router[_0xddde('0x8')](_0xddde('0x1d'),controller[_0xddde('0x1e')]);router[_0xddde('0x8')](_0xddde('0x1f'),auth[_0xddde('0x9')](),controller[_0xddde('0x20')]);router['get'](_0xddde('0x21'),auth[_0xddde('0x9')](),controller[_0xddde('0x22')]);router[_0xddde('0x23')]('/',auth[_0xddde('0x9')](),controller['create']);router['post'](_0xddde('0xe'),auth[_0xddde('0x9')](),controller[_0xddde('0x24')]);router['post'](_0xddde('0xf'),auth[_0xddde('0x9')](),controller[_0xddde('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x231338,_0x1a00d7,_0x4ce295){_0x4ce295(null,path[_0xddde('0x26')](config[_0xddde('0x27')],_0xddde('0x28')));},'filename':function(_0x395451,_0x18c825,_0x2f54f3){_0x2f54f3(null,util['format']('%s-%s',Date[_0xddde('0x29')](),_0x18c825[_0xddde('0x2a')]));}})});router[_0xddde('0x23')](_0xddde('0x10'),upload['single'](_0xddde('0x2b')),controller[_0xddde('0x2c')]);var upload=multer({'storage':multer[_0xddde('0x2d')]({'destination':function(_0x49c711,_0x2fa2ef,_0x4915d9){_0x4915d9(null,path[_0xddde('0x26')](config[_0xddde('0x27')],'server/files/images/avatars/'));},'filename':function(_0x566dad,_0x20c625,_0x5a7ad1){_0x5a7ad1(null,util[_0xddde('0x2e')]('%s-%s',Date[_0xddde('0x29')](),_0x20c625[_0xddde('0x2a')]));}})});router['post'](_0xddde('0x12'),upload['single'](_0xddde('0x2b')),controller[_0xddde('0x2f')]);var upload=multer({'storage':multer[_0xddde('0x2d')]({'destination':function(_0x43b197,_0x2bbb21,_0x5e900d){_0x5e900d(null,path[_0xddde('0x26')](config['root'],_0xddde('0x30')));},'filename':function(_0xe7ea38,_0x50fb21,_0xc2d98b){_0xc2d98b(null,util[_0xddde('0x2e')]('%s-%s',Date[_0xddde('0x29')](),_0x50fb21[_0xddde('0x2a')]));}})});router['post'](_0xddde('0x14'),upload[_0xddde('0x31')](_0xddde('0x2b')),controller[_0xddde('0x32')]);var upload=multer({'storage':multer[_0xddde('0x2d')]({'destination':function(_0x5a4866,_0x4af352,_0x25b2d7){_0x25b2d7(null,path[_0xddde('0x26')](config[_0xddde('0x27')],'server/files/images/avatars/'));},'filename':function(_0x4b7ea9,_0x4a3c24,_0x5ec35b){_0x5ec35b(null,util[_0xddde('0x2e')]('%s-%s',Date['now'](),_0x4a3c24['originalname']));}})});router[_0xddde('0x23')]('/:id/system_avatar',upload[_0xddde('0x31')](_0xddde('0x2b')),controller['addSystemAvatar']);router[_0xddde('0x23')]('/:id/notify',controller[_0xddde('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0xddde('0x2d')]({'destination':function(_0x50f6d2,_0x5696e8,_0x3a5683){const _0x2b2107=path[_0xddde('0x26')](config[_0xddde('0x27')],_0xddde('0x34'),'attachments','offline-chat');fs_extra[_0xddde('0x35')](_0x2b2107,function(){_0x3a5683(null,_0x2b2107);});},'filename':function(_0x4f827e,_0x731055,_0x188a14){const _0x13f04b=_0x731055[_0xddde('0x2a')][_0xddde('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1997d9=path[_0xddde('0x37')](_0x13f04b);const _0xc5aa18=Date[_0xddde('0x29')]()+'-'+_0x13f04b[_0xddde('0x36')](_0x1997d9,'')+_0x1997d9;_0x188a14(null,_0xc5aa18);}})});router['post']('/:id/offline',offlineUploadMulter[_0xddde('0x38')](),controller[_0xddde('0x39')]);router[_0xddde('0x23')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xddde('0x3a')]);router[_0xddde('0x23')](_0xddde('0x1a'),auth[_0xddde('0x9')](),controller[_0xddde('0x3b')]);router[_0xddde('0x23')](_0xddde('0x3c'),auth[_0xddde('0x9')](),controller[_0xddde('0x3d')]);router[_0xddde('0x23')](_0xddde('0x21'),auth[_0xddde('0x9')](),controller[_0xddde('0x3e')]);router[_0xddde('0x3f')]('/:id',auth[_0xddde('0x9')](),controller[_0xddde('0x40')]);router[_0xddde('0x41')]('/:id',auth[_0xddde('0x9')](),controller[_0xddde('0x42')]);router['delete']('/:id/dispositions',auth[_0xddde('0x9')](),controller[_0xddde('0x43')]);router[_0xddde('0x41')](_0xddde('0xf'),auth['isAuthenticated'](),controller[_0xddde('0x44')]);router[_0xddde('0x41')](_0xddde('0x21'),auth[_0xddde('0x9')](),controller[_0xddde('0x45')]);module['exports']=router; \ No newline at end of file +var _0xa0be=['%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','/:id/avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','offline','/:id/interactions','addInteraction','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/system_avatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','create','addDisposition','post','diskStorage','join','root','server/files/images/logos/','format'];(function(_0x514d7a,_0x4a76cd){var _0x42e333=function(_0x278166){while(--_0x278166){_0x514d7a['push'](_0x514d7a['shift']());}};_0x42e333(++_0x4a76cd);}(_0xa0be,0xfb));var _0xea0b=function(_0x25ca14,_0x36ce01){_0x25ca14=_0x25ca14-0x0;var _0x92f71=_0xa0be[_0x25ca14];return _0x92f71;};'use strict';var multer=require('multer');var util=require(_0xea0b('0x0'));var path=require('path');var timeout=require(_0xea0b('0x1'));var express=require('express');var router=express[_0xea0b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xea0b('0x3'));var interaction=require(_0xea0b('0x4'));var config=require(_0xea0b('0x5'));var controller=require(_0xea0b('0x6'));router[_0xea0b('0x7')]('/',auth[_0xea0b('0x8')](),controller[_0xea0b('0x9')]);router[_0xea0b('0x7')](_0xea0b('0xa'),auth['isAuthenticated'](),controller[_0xea0b('0xb')]);router[_0xea0b('0x7')](_0xea0b('0xc'),auth['isAuthenticated'](),controller[_0xea0b('0xd')]);router[_0xea0b('0x7')](_0xea0b('0xe'),auth[_0xea0b('0x8')](),controller[_0xea0b('0xf')]);router[_0xea0b('0x7')](_0xea0b('0x10'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x11')]);router[_0xea0b('0x7')](_0xea0b('0x12'),controller[_0xea0b('0x13')]);router[_0xea0b('0x7')]('/:id/avatar',controller[_0xea0b('0x14')]);router[_0xea0b('0x7')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0xea0b('0x7')](_0xea0b('0x15'),controller['getSystemAvatar']);router[_0xea0b('0x7')]('/:id/interactions',auth[_0xea0b('0x8')](),controller[_0xea0b('0x16')]);router[_0xea0b('0x7')](_0xea0b('0x17'),controller[_0xea0b('0x18')]);router[_0xea0b('0x7')](_0xea0b('0x19'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x1a')]);router['get'](_0xea0b('0x1b'),auth[_0xea0b('0x8')](),controller['getProactiveActions']);router[_0xea0b('0x7')](_0xea0b('0x1c'),controller[_0xea0b('0x1d')]);router[_0xea0b('0x7')](_0xea0b('0x1e'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x1f')]);router[_0xea0b('0x7')]('/:id/users',auth[_0xea0b('0x8')](),controller[_0xea0b('0x20')]);router['post']('/',auth[_0xea0b('0x8')](),controller[_0xea0b('0x21')]);router['post']('/:id/dispositions',auth[_0xea0b('0x8')](),controller[_0xea0b('0x22')]);router[_0xea0b('0x23')](_0xea0b('0x10'),auth[_0xea0b('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xea0b('0x24')]({'destination':function(_0x5058db,_0x6157e0,_0x32a95b){_0x32a95b(null,path[_0xea0b('0x25')](config[_0xea0b('0x26')],_0xea0b('0x27')));},'filename':function(_0x55c168,_0x370c1c,_0x4d600a){_0x4d600a(null,util[_0xea0b('0x28')](_0xea0b('0x29'),Date[_0xea0b('0x2a')](),_0x370c1c[_0xea0b('0x2b')]));}})});router[_0xea0b('0x23')](_0xea0b('0x12'),upload[_0xea0b('0x2c')](_0xea0b('0x2d')),controller[_0xea0b('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4138ba,_0x4c4330,_0x3ec688){_0x3ec688(null,path[_0xea0b('0x25')](config['root'],_0xea0b('0x2f')));},'filename':function(_0x11e490,_0x1b8ff2,_0xec078){_0xec078(null,util[_0xea0b('0x28')](_0xea0b('0x29'),Date['now'](),_0x1b8ff2[_0xea0b('0x2b')]));}})});router[_0xea0b('0x23')](_0xea0b('0x30'),upload['single'](_0xea0b('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3e0900,_0x37bb5d,_0x233170){_0x233170(null,path[_0xea0b('0x25')](config['root'],_0xea0b('0x2f')));},'filename':function(_0x2b91b3,_0x3a1249,_0x199115){_0x199115(null,util[_0xea0b('0x28')]('%s-%s',Date[_0xea0b('0x2a')](),_0x3a1249[_0xea0b('0x2b')]));}})});router[_0xea0b('0x23')]('/:id/customer_avatar',upload[_0xea0b('0x2c')](_0xea0b('0x2d')),controller[_0xea0b('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x58b931,_0x2f5cb9,_0x3bdfe3){_0x3bdfe3(null,path[_0xea0b('0x25')](config[_0xea0b('0x26')],'server/files/images/avatars/'));},'filename':function(_0x1688f7,_0x1ecd99,_0x478385){_0x478385(null,util[_0xea0b('0x28')](_0xea0b('0x29'),Date[_0xea0b('0x2a')](),_0x1ecd99[_0xea0b('0x2b')]));}})});router['post'](_0xea0b('0x15'),upload[_0xea0b('0x2c')]('file'),controller[_0xea0b('0x32')]);router[_0xea0b('0x23')](_0xea0b('0x33'),controller[_0xea0b('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xea0b('0x24')]({'destination':function(_0x52098e,_0x5038f3,_0x5ccbb1){const _0x4c14bd=path[_0xea0b('0x25')](config[_0xea0b('0x26')],_0xea0b('0x35'),_0xea0b('0x36'),_0xea0b('0x37'));fs_extra['ensureDir'](_0x4c14bd,function(){_0x5ccbb1(null,_0x4c14bd);});},'filename':function(_0x4b7b43,_0x3fb5f5,_0x5afd04){const _0x5a23c7=_0x3fb5f5[_0xea0b('0x2b')][_0xea0b('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x956fa6=path[_0xea0b('0x39')](_0x5a23c7);const _0x211708=Date[_0xea0b('0x2a')]()+'-'+_0x5a23c7[_0xea0b('0x38')](_0x956fa6,'')+_0x956fa6;_0x5afd04(null,_0x211708);}})});router[_0xea0b('0x23')](_0xea0b('0x3a'),offlineUploadMulter['any'](),controller[_0xea0b('0x3b')]);router[_0xea0b('0x23')](_0xea0b('0x3c'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x3d')]);router['post'](_0xea0b('0x19'),auth[_0xea0b('0x8')](),controller['addApplications']);router['post'](_0xea0b('0x1b'),auth['isAuthenticated'](),controller[_0xea0b('0x3e')]);router['post'](_0xea0b('0x3f'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x40')]);router[_0xea0b('0x41')](_0xea0b('0xc'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x42')]);router[_0xea0b('0x43')]('/:id',auth[_0xea0b('0x8')](),controller[_0xea0b('0x44')]);router[_0xea0b('0x43')]('/:id/dispositions',auth[_0xea0b('0x8')](),controller[_0xea0b('0x45')]);router[_0xea0b('0x43')](_0xea0b('0x10'),auth[_0xea0b('0x8')](),controller[_0xea0b('0x46')]);router[_0xea0b('0x43')]('/:id/users',auth[_0xea0b('0x8')](),controller[_0xea0b('0x47')]);module[_0xea0b('0x48')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index a7fca8c..0349012 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 _0x3b73=['isAuthenticated','express','../components/auth/service','../config/environment','Router','env','production','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use'];(function(_0x5b2bbb,_0x569892){var _0x4a6a5e=function(_0x261878){while(--_0x261878){_0x5b2bbb['push'](_0x5b2bbb['shift']());}};_0x4a6a5e(++_0x569892);}(_0x3b73,0xd9));var _0x33b7=function(_0x9abce3,_0x462518){_0x9abce3=_0x9abce3-0x0;var _0x15c3a8=_0x3b73[_0x9abce3];return _0x15c3a8;};var beaverLogger=require('beaver-logger/server');var express=require(_0x33b7('0x0'));var auth=require(_0x33b7('0x1'));var config=require(_0x33b7('0x2'));var router=express[_0x33b7('0x3')]();var isProduction=config[_0x33b7('0x4')]===_0x33b7('0x5')||![];function clientSideLogs(_0x39d988,_0x3fb027,_0x4bf4f3){var _0x4419f2=_0x39d988[_0x33b7('0x6')]['get']('client-side-logger');if(!_0x4419f2){throw new Error(_0x33b7('0x7'));}return beaverLogger[_0x33b7('0x8')]({'uri':_0x33b7('0x9'),'logger':_0x4419f2,'enableCors':!isProduction})(_0x39d988,_0x3fb027,_0x4bf4f3);}router[_0x33b7('0xa')](auth[_0x33b7('0xb')](),clientSideLogs);module['exports']=router; \ No newline at end of file +var _0x383a=['Router','env','production','app','Client-Side\x20logger\x20not\x20found!','/client-logs','use','exports','beaver-logger/server','express','../components/auth/service','../config/environment'];(function(_0x2e883d,_0x270600){var _0x51e4db=function(_0x2b12ac){while(--_0x2b12ac){_0x2e883d['push'](_0x2e883d['shift']());}};_0x51e4db(++_0x270600);}(_0x383a,0xd4));var _0xa383=function(_0x26601e,_0x139a4c){_0x26601e=_0x26601e-0x0;var _0x116282=_0x383a[_0x26601e];return _0x116282;};var beaverLogger=require(_0xa383('0x0'));var express=require(_0xa383('0x1'));var auth=require(_0xa383('0x2'));var config=require(_0xa383('0x3'));var router=express[_0xa383('0x4')]();var isProduction=config[_0xa383('0x5')]===_0xa383('0x6')||![];function clientSideLogs(_0x4624a5,_0x52fca8,_0x4f3ca0){var _0xd7d8da=_0x4624a5[_0xa383('0x7')]['get']('client-side-logger');if(!_0xd7d8da){throw new Error(_0xa383('0x8'));}return beaverLogger['expressEndpoint']({'uri':_0xa383('0x9'),'logger':_0xd7d8da,'enableCors':!isProduction})(_0x4624a5,_0x52fca8,_0x4f3ca0);}router[_0xa383('0xa')](auth['isAuthenticated'](),clientSideLogs);module[_0xa383('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 7738f7b..c6296c7 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 _0xe4d7=['MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Outlook365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0xe4d7,0x84));var _0x7e4d=function(_0x313cbb,_0x800c66){_0x313cbb=_0x313cbb-0x0;var _0x785bc8=_0xe4d7[_0x313cbb];return _0x785bc8;};'use strict';var Sequelize=require(_0x7e4d('0x0'));module['exports']={'name':{'type':Sequelize[_0x7e4d('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x7e4d('0x2'),_0x7e4d('0x3'),_0x7e4d('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7e4d('0x5')](_0x7e4d('0x6'),'Dynamics365')},'data1':{'type':Sequelize[_0x7e4d('0x1')],'comment':_0x7e4d('0x7')},'data2':{'type':Sequelize[_0x7e4d('0x1')],'comment':_0x7e4d('0x8')},'data3':{'type':Sequelize[_0x7e4d('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x7e4d('0x1')],'comment':_0x7e4d('0x9')},'data5':{'type':Sequelize[_0x7e4d('0xa')],'comment':_0x7e4d('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x7e4d('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x7e4d('0xd')}}; \ No newline at end of file +var _0xeb90=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Dynamics365'];(function(_0x27c59c,_0x355b73){var _0x2ed45a=function(_0x3581d8){while(--_0x3581d8){_0x27c59c['push'](_0x27c59c['shift']());}};_0x2ed45a(++_0x355b73);}(_0xeb90,0x19d));var _0x0eb9=function(_0x34aafb,_0x533bc4){_0x34aafb=_0x34aafb-0x0;var _0x446e2f=_0xeb90[_0x34aafb];return _0x446e2f;};'use strict';var Sequelize=require(_0x0eb9('0x0'));module['exports']={'name':{'type':Sequelize[_0x0eb9('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x0eb9('0x2'),_0x0eb9('0x3'),_0x0eb9('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x0eb9('0x5')]('Outlook365',_0x0eb9('0x6'))},'data1':{'type':Sequelize[_0x0eb9('0x1')],'comment':_0x0eb9('0x7')},'data2':{'type':Sequelize[_0x0eb9('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x0eb9('0x1')],'comment':_0x0eb9('0x8')},'data4':{'type':Sequelize[_0x0eb9('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x0eb9('0x9')],'comment':_0x0eb9('0xa')},'data6':{'type':Sequelize[_0x0eb9('0x9')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x0eb9('0xb')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 0939e46..149919e 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 _0x0f1f=['join','find','params','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','from','toString','ascii','id_token','oauth2Claims','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/parsers/qs','../../config/environment','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','json','limit','undefined','count','set','Content-Range','update','then','end','error','stack','name','send','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','map','VIRTUAL','filter','merge','options','rows','service','decryptString','data3','show','includeAll','include','MicrosoftAzure','catch','create','body','Service\x20parameter\x20not\x20specified','values','includes'];(function(_0x467fb9,_0x30f4b4){var _0x4d6499=function(_0x4ff293){while(--_0x4ff293){_0x467fb9['push'](_0x467fb9['shift']());}};_0x4d6499(++_0x30f4b4);}(_0x0f1f,0x1a0));var _0xf0f1=function(_0x1758f1,_0x35446f){_0x1758f1=_0x1758f1-0x0;var _0x173003=_0x0f1f[_0x1758f1];return _0x173003;};'use strict';var _=require(_0xf0f1('0x0'));var Redis=require(_0xf0f1('0x1'));var qs=require(_0xf0f1('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0xf0f1('0x3'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];var oauth=require(_0xf0f1('0x4'));config[_0xf0f1('0x5')]=_['defaults'](config[_0xf0f1('0x5')],{'host':_0xf0f1('0x6'),'port':0x18eb});var socket=require(_0xf0f1('0x7'))(new Redis(config[_0xf0f1('0x5')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x522428,_0x24109e){_0x24109e=_0x24109e||0xcc;return function(_0x91a098){if(_0x91a098){return _0x522428[_0xf0f1('0x8')](_0x24109e);}return _0x522428[_0xf0f1('0x9')](_0x24109e)['end']();};}function respondWithResult(_0x5b245b,_0x5cf839){_0x5cf839=_0x5cf839||0xc8;return function(_0x3dcd64){if(_0x3dcd64){return _0x5b245b[_0xf0f1('0x9')](_0x5cf839)[_0xf0f1('0xa')](_0x3dcd64);}};}function respondWithFilteredResult(_0x39a0fb,_0x2844b8){return function(_0x446e87){if(_0x446e87){var _0x362f39=typeof _0x2844b8['offset']==='undefined'&&typeof _0x2844b8[_0xf0f1('0xb')]===_0xf0f1('0xc');var _0x40e9d4=_0x446e87[_0xf0f1('0xd')];var _0x4eaee8=_0x362f39?0x0:_0x2844b8['offset'];var _0x12efaa=_0x362f39?_0x446e87[_0xf0f1('0xd')]:_0x2844b8['offset']+_0x2844b8[_0xf0f1('0xb')];var _0x51539a;if(_0x12efaa>=_0x40e9d4){_0x12efaa=_0x40e9d4;_0x51539a=0xc8;}else{_0x51539a=0xce;}_0x39a0fb['status'](_0x51539a);return _0x39a0fb[_0xf0f1('0xe')](_0xf0f1('0xf'),_0x4eaee8+'-'+_0x12efaa+'/'+_0x40e9d4)[_0xf0f1('0xa')](_0x446e87);}return null;};}function saveUpdates(_0x3ac7f4){return function(_0xc8df9e){if(_0xc8df9e){return _0xc8df9e[_0xf0f1('0x10')](_0x3ac7f4)[_0xf0f1('0x11')](function(_0x21f6bb){return _0x21f6bb;});}return null;};}function removeEntity(_0x54d690){return function(_0x2be29c){if(_0x2be29c){return _0x2be29c['destroy']()[_0xf0f1('0x11')](function(){_0x54d690[_0xf0f1('0x9')](0xcc)[_0xf0f1('0x12')]();});}};}function handleEntityNotFound(_0x4ecb11){return function(_0xdacdb7){if(!_0xdacdb7){_0x4ecb11[_0xf0f1('0x8')](0x194);}return _0xdacdb7;};}function handleError(_0x26d6e1,_0x41e85b){_0x41e85b=_0x41e85b||0x1f4;return function(_0x58f310){logger[_0xf0f1('0x13')](_0x58f310[_0xf0f1('0x14')]);if(_0x58f310[_0xf0f1('0x15')]){delete _0x58f310['name'];}_0x26d6e1[_0xf0f1('0x9')](_0x41e85b)[_0xf0f1('0x16')](_0x58f310);};}function maskClientSecret(_0x4ba4ae){return _[_0xf0f1('0x17')](_0x4ba4ae['slice'](0x0,0x3),0x14,'*');}exports[_0xf0f1('0x18')]=function(_0xaec399,_0x4f4fd3){var _0x4bc19a={},_0x47390b={},_0x1ad7ad={'count':0x0,'rows':[]};var _0x53e13f=_['map'](db[_0xf0f1('0x19')][_0xf0f1('0x1a')],function(_0x260425){return{'name':_0x260425[_0xf0f1('0x1b')],'type':_0x260425[_0xf0f1('0x1c')][_0xf0f1('0x1d')]};});_0x47390b[_0xf0f1('0x1e')]=_['map'](_0x53e13f,_0xf0f1('0x15'));_0x47390b[_0xf0f1('0x1f')]=_[_0xf0f1('0x20')](_0xaec399[_0xf0f1('0x1f')]);_0x47390b['filters']=_[_0xf0f1('0x21')](_0x47390b[_0xf0f1('0x1e')],_0x47390b[_0xf0f1('0x1f')]);_0x4bc19a['attributes']=_[_0xf0f1('0x21')](_0x47390b[_0xf0f1('0x1e')],qs['fields'](_0xaec399[_0xf0f1('0x1f')][_0xf0f1('0x22')]));_0x4bc19a[_0xf0f1('0x23')]=_0x4bc19a[_0xf0f1('0x23')][_0xf0f1('0x24')]?_0x4bc19a[_0xf0f1('0x23')]:_0x47390b[_0xf0f1('0x1e')];if(!_0xaec399[_0xf0f1('0x1f')][_0xf0f1('0x25')](_0xf0f1('0x26'))){_0x4bc19a['limit']=qs[_0xf0f1('0xb')](_0xaec399['query'][_0xf0f1('0xb')]);_0x4bc19a[_0xf0f1('0x27')]=qs[_0xf0f1('0x27')](_0xaec399['query'][_0xf0f1('0x27')]);}_0x4bc19a[_0xf0f1('0x28')]=qs['sort'](_0xaec399['query'][_0xf0f1('0x29')]);_0x4bc19a[_0xf0f1('0x2a')]=qs[_0xf0f1('0x2b')](_[_0xf0f1('0x2c')](_0xaec399[_0xf0f1('0x1f')],_0x47390b[_0xf0f1('0x2b')]),_0x53e13f);if(_0xaec399[_0xf0f1('0x1f')]['filter']){_0x4bc19a[_0xf0f1('0x2a')]=_['merge'](_0x4bc19a[_0xf0f1('0x2a')],{'$or':_[_0xf0f1('0x2d')](_0x53e13f,function(_0x472cfb){if(_0x472cfb[_0xf0f1('0x1c')]!==_0xf0f1('0x2e')){var _0x378fe9={};_0x378fe9[_0x472cfb['name']]={'$like':'%'+_0xaec399[_0xf0f1('0x1f')][_0xf0f1('0x2f')]+'%'};return _0x378fe9;}})});}_0x4bc19a=_[_0xf0f1('0x30')]({},_0x4bc19a,_0xaec399[_0xf0f1('0x31')]);var _0x2baa97={'where':_0x4bc19a[_0xf0f1('0x2a')]};return db['CloudProvider'][_0xf0f1('0xd')](_0x2baa97)[_0xf0f1('0x11')](function(_0x3ce20b){_0x1ad7ad['count']=_0x3ce20b;if(_0xaec399[_0xf0f1('0x1f')]['includeAll']){_0x4bc19a['include']=[{'all':!![]}];}return db[_0xf0f1('0x19')]['findAll'](_0x4bc19a);})['then'](function(_0x27c21c){_0x1ad7ad[_0xf0f1('0x32')]=_[_0xf0f1('0x2d')](_0x27c21c,function(_0x2db873){if(_0x2db873[_0xf0f1('0x33')]==='MicrosoftAzure'){var _0x22656c=encryptor[_0xf0f1('0x34')](_0x2db873[_0xf0f1('0x35')]);_0x2db873[_0xf0f1('0x35')]=maskClientSecret(_0x22656c);}return _0x2db873;});return _0x1ad7ad;})['then'](respondWithFilteredResult(_0x4f4fd3,_0x4bc19a))['catch'](handleError(_0x4f4fd3,null));};exports[_0xf0f1('0x36')]=function(_0x1106e0,_0x2556c5){var _0x3ff4fc={'raw':!![],'where':{'id':_0x1106e0['params']['id']}},_0x2426fe={};_0x2426fe['model']=_[_0xf0f1('0x20')](db[_0xf0f1('0x19')][_0xf0f1('0x1a')]);_0x2426fe[_0xf0f1('0x1f')]=_[_0xf0f1('0x20')](_0x1106e0[_0xf0f1('0x1f')]);_0x2426fe[_0xf0f1('0x2b')]=_[_0xf0f1('0x21')](_0x2426fe[_0xf0f1('0x1e')],_0x2426fe[_0xf0f1('0x1f')]);_0x3ff4fc[_0xf0f1('0x23')]=_[_0xf0f1('0x21')](_0x2426fe['model'],qs[_0xf0f1('0x22')](_0x1106e0[_0xf0f1('0x1f')]['fields']));_0x3ff4fc[_0xf0f1('0x23')]=_0x3ff4fc[_0xf0f1('0x23')][_0xf0f1('0x24')]?_0x3ff4fc['attributes']:_0x2426fe[_0xf0f1('0x1e')];if(_0x1106e0[_0xf0f1('0x1f')][_0xf0f1('0x37')]){_0x3ff4fc[_0xf0f1('0x38')]=[{'all':!![]}];}_0x3ff4fc=_[_0xf0f1('0x30')]({},_0x3ff4fc,_0x1106e0[_0xf0f1('0x31')]);return db[_0xf0f1('0x19')]['find'](_0x3ff4fc)[_0xf0f1('0x11')](handleEntityNotFound(_0x2556c5,null))[_0xf0f1('0x11')](function(_0x12e16e){if(_0x12e16e[_0xf0f1('0x33')]===_0xf0f1('0x39')){var _0x5b31e9=encryptor[_0xf0f1('0x34')](_0x12e16e[_0xf0f1('0x35')]);_0x12e16e[_0xf0f1('0x35')]=maskClientSecret(_0x5b31e9);}return _0x12e16e;})[_0xf0f1('0x11')](respondWithResult(_0x2556c5,null))[_0xf0f1('0x3a')](handleError(_0x2556c5,null));};exports[_0xf0f1('0x3b')]=function(_0x55c4cf,_0x20c283){if(!_0x55c4cf[_0xf0f1('0x3c')]['name'])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x55c4cf['body'][_0xf0f1('0x33')])throw new Error(_0xf0f1('0x3d'));var _0x302ab5=db['CloudProvider'][_0xf0f1('0x1a')]['service'][_0xf0f1('0x3e')];if(!_0x302ab5[_0xf0f1('0x3f')](_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x33')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x302ab5[_0xf0f1('0x40')](',\x20'));if(_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x33')]===_0xf0f1('0x39')&&_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x35')]){_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x35')]=encryptor['encryptString'](_0x55c4cf[_0xf0f1('0x3c')][_0xf0f1('0x35')]);}return db['CloudProvider'][_0xf0f1('0x3b')](_0x55c4cf['body'],{})['then'](respondWithResult(_0x20c283,0xc9))['catch'](handleError(_0x20c283,null));};exports[_0xf0f1('0x10')]=function(_0x15db7d,_0x46a841){if(_0x15db7d[_0xf0f1('0x3c')]['id']){delete _0x15db7d['body']['id'];}return db[_0xf0f1('0x19')][_0xf0f1('0x41')]({'where':{'id':_0x15db7d[_0xf0f1('0x42')]['id']}})['then'](handleEntityNotFound(_0x46a841,null))[_0xf0f1('0x11')](function(_0x3e4d76){if(_0x3e4d76[_0xf0f1('0x33')]===_0xf0f1('0x39')&&_0x15db7d[_0xf0f1('0x3c')]['data3']){_0x15db7d[_0xf0f1('0x3c')][_0xf0f1('0x35')]=encryptor['encryptString'](_0x15db7d[_0xf0f1('0x3c')][_0xf0f1('0x35')]);}return _0x3e4d76;})[_0xf0f1('0x11')](saveUpdates(_0x15db7d['body'],null))['then'](respondWithResult(_0x46a841,null))[_0xf0f1('0x3a')](handleError(_0x46a841,null));};exports[_0xf0f1('0x43')]=function(_0xa23beb,_0x1619c5){return db[_0xf0f1('0x19')][_0xf0f1('0x41')]({'where':{'id':_0xa23beb[_0xf0f1('0x42')]['id']}})['then'](handleEntityNotFound(_0x1619c5,null))[_0xf0f1('0x11')](removeEntity(_0x1619c5,null))[_0xf0f1('0x3a')](handleError(_0x1619c5,null));};exports[_0xf0f1('0x44')]=function(_0x46868e,_0x462a4a){return db['CloudProvider'][_0xf0f1('0x45')]({'where':{'id':_0x46868e[_0xf0f1('0x42')]['id']},'raw':!![]})['then'](function(_0x32b548){if(!_0x32b548)return _0x462a4a[_0xf0f1('0x8')](0x194);return{'url':oauth[_0xf0f1('0x46')](_0x32b548,_0x46868e[_0xf0f1('0x47')]['id'])};})[_0xf0f1('0x11')](respondWithResult(_0x462a4a,null))[_0xf0f1('0x3a')](handleError(_0x462a4a,null));};exports[_0xf0f1('0x48')]=function(_0x1bfbfe,_0x2a8215){var _0x30c1ac=_0x1bfbfe[_0xf0f1('0x3c')];var _0x3e94fc;var _0x215ac0;if(_0x30c1ac[_0xf0f1('0x13')])throw _0x30c1ac;redis[_0xf0f1('0x49')](_0x30c1ac['state'])[_0xf0f1('0x11')](function(_0x38bab4){if(!_0x38bab4)throw new Error(_0xf0f1('0x4a'));_0x3e94fc=JSON[_0xf0f1('0x4b')](_0x38bab4);var _0x945f5c=Buffer[_0xf0f1('0x4c')](_0x30c1ac['state'],'base64')[_0xf0f1('0x4d')](_0xf0f1('0x4e'));_0x215ac0=JSON[_0xf0f1('0x4b')](_0x945f5c);if(!oauth['isValidIdToken'](_0x30c1ac[_0xf0f1('0x4f')],_0x3e94fc[_0xf0f1('0x50')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0xf0f1('0x51')](_0x30c1ac[_0xf0f1('0x52')]);return oauth[_0xf0f1('0x53')](_0x30c1ac[_0xf0f1('0x54')],_0x3e94fc);})['then'](function(_0x27c71d){_0x3e94fc[_0xf0f1('0x55')]=_0x27c71d[_0xf0f1('0x56')];_0x3e94fc[_0xf0f1('0x57')]=_0x27c71d[_0xf0f1('0x58')];return db[_0xf0f1('0x19')][_0xf0f1('0x10')]({'data5':_0x3e94fc[_0xf0f1('0x55')],'data6':_0x3e94fc[_0xf0f1('0x57')]},{'where':{'id':_0x3e94fc['id']}});})[_0xf0f1('0x11')](function(){oauth[_0xf0f1('0x59')](_0x3e94fc);socket[_0xf0f1('0x5a')](_0xf0f1('0x5b'),{'id':_0x215ac0['id']});return;})[_0xf0f1('0x11')](respondWithStatusCode(_0x2a8215,null))[_0xf0f1('0x3a')](function(_0x1038bb){if(_0x215ac0){socket[_0xf0f1('0x5a')]('microsoftAuthorization:error',{'id':_0x215ac0['id']});}if(!_0x3e94fc){logger[_0xf0f1('0x13')](_0xf0f1('0x5c'),_0x1038bb);return _0x2a8215[_0xf0f1('0x9')](0x1f4)[_0xf0f1('0x16')](_0x1038bb[_0xf0f1('0x5d')]);}logger[_0xf0f1('0x13')](_0xf0f1('0x5e'),_0x3e94fc['id'],JSON[_0xf0f1('0x5f')](_0x1038bb));});}; \ No newline at end of file +var _0x135b=['body','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','from','state','ascii','parse','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','show','params','keys','fields','options','find','catch'];(function(_0x1e3ee9,_0x2b0ffb){var _0x185bb8=function(_0x4c562b){while(--_0x4c562b){_0x1e3ee9['push'](_0x1e3ee9['shift']());}};_0x185bb8(++_0x2b0ffb);}(_0x135b,0x198));var _0xb135=function(_0x1b4e88,_0x392683){_0x1b4e88=_0x1b4e88-0x0;var _0x3e56f7=_0x135b[_0x1b4e88];return _0x3e56f7;};'use strict';var _=require(_0xb135('0x0'));var Redis=require(_0xb135('0x1'));var qs=require(_0xb135('0x2'));var encryptor=require(_0xb135('0x3'));var config=require(_0xb135('0x4'));var logger=require(_0xb135('0x5'))(_0xb135('0x6'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0xb135('0x7')]=_[_0xb135('0x8')](config[_0xb135('0x7')],{'host':_0xb135('0x9'),'port':0x18eb});var socket=require(_0xb135('0xa'))(new Redis(config[_0xb135('0x7')]));var redis=new Redis(config[_0xb135('0x7')]);function respondWithStatusCode(_0x397fa7,_0x1da705){_0x1da705=_0x1da705||0xcc;return function(_0x56899b){if(_0x56899b){return _0x397fa7[_0xb135('0xb')](_0x1da705);}return _0x397fa7[_0xb135('0xc')](_0x1da705)[_0xb135('0xd')]();};}function respondWithResult(_0x5bcbee,_0x30326c){_0x30326c=_0x30326c||0xc8;return function(_0x201f7d){if(_0x201f7d){return _0x5bcbee[_0xb135('0xc')](_0x30326c)['json'](_0x201f7d);}};}function respondWithFilteredResult(_0x478db2,_0x468f47){return function(_0x16382b){if(_0x16382b){var _0x2f87d1=typeof _0x468f47[_0xb135('0xe')]===_0xb135('0xf')&&typeof _0x468f47[_0xb135('0x10')]===_0xb135('0xf');var _0x1e2fea=_0x16382b[_0xb135('0x11')];var _0x45d258=_0x2f87d1?0x0:_0x468f47['offset'];var _0x2ef83e=_0x2f87d1?_0x16382b[_0xb135('0x11')]:_0x468f47[_0xb135('0xe')]+_0x468f47[_0xb135('0x10')];var _0x179e95;if(_0x2ef83e>=_0x1e2fea){_0x2ef83e=_0x1e2fea;_0x179e95=0xc8;}else{_0x179e95=0xce;}_0x478db2['status'](_0x179e95);return _0x478db2['set'](_0xb135('0x12'),_0x45d258+'-'+_0x2ef83e+'/'+_0x1e2fea)['json'](_0x16382b);}return null;};}function saveUpdates(_0x3367a1){return function(_0x1326cd){if(_0x1326cd){return _0x1326cd[_0xb135('0x13')](_0x3367a1)[_0xb135('0x14')](function(_0x1d10f2){return _0x1d10f2;});}return null;};}function removeEntity(_0x557cc5){return function(_0x373199){if(_0x373199){return _0x373199[_0xb135('0x15')]()[_0xb135('0x14')](function(){_0x557cc5['status'](0xcc)[_0xb135('0xd')]();});}};}function handleEntityNotFound(_0x482aa5){return function(_0x1d55ac){if(!_0x1d55ac){_0x482aa5[_0xb135('0xb')](0x194);}return _0x1d55ac;};}function handleError(_0x3a0d8d,_0x134892){_0x134892=_0x134892||0x1f4;return function(_0x26f375){logger[_0xb135('0x16')](_0x26f375[_0xb135('0x17')]);if(_0x26f375[_0xb135('0x18')]){delete _0x26f375['name'];}_0x3a0d8d[_0xb135('0xc')](_0x134892)[_0xb135('0x19')](_0x26f375);};}function maskClientSecret(_0x298700){return _['padEnd'](_0x298700[_0xb135('0x1a')](0x0,0x3),0x14,'*');}exports[_0xb135('0x1b')]=function(_0x6659b2,_0x33a09e){var _0x52588e={},_0x1de102={},_0x2de3e9={'count':0x0,'rows':[]};var _0x4bd47=_[_0xb135('0x1c')](db[_0xb135('0x1d')][_0xb135('0x1e')],function(_0xca84db){return{'name':_0xca84db[_0xb135('0x1f')],'type':_0xca84db[_0xb135('0x20')][_0xb135('0x21')]};});_0x1de102[_0xb135('0x22')]=_[_0xb135('0x1c')](_0x4bd47,_0xb135('0x18'));_0x1de102[_0xb135('0x23')]=_['keys'](_0x6659b2['query']);_0x1de102['filters']=_[_0xb135('0x24')](_0x1de102['model'],_0x1de102[_0xb135('0x23')]);_0x52588e['attributes']=_[_0xb135('0x24')](_0x1de102[_0xb135('0x22')],qs['fields'](_0x6659b2[_0xb135('0x23')]['fields']));_0x52588e[_0xb135('0x25')]=_0x52588e[_0xb135('0x25')][_0xb135('0x26')]?_0x52588e[_0xb135('0x25')]:_0x1de102[_0xb135('0x22')];if(!_0x6659b2[_0xb135('0x23')][_0xb135('0x27')](_0xb135('0x28'))){_0x52588e[_0xb135('0x10')]=qs[_0xb135('0x10')](_0x6659b2[_0xb135('0x23')][_0xb135('0x10')]);_0x52588e[_0xb135('0xe')]=qs[_0xb135('0xe')](_0x6659b2['query'][_0xb135('0xe')]);}_0x52588e['order']=qs[_0xb135('0x29')](_0x6659b2[_0xb135('0x23')]['sort']);_0x52588e['where']=qs[_0xb135('0x2a')](_[_0xb135('0x2b')](_0x6659b2[_0xb135('0x23')],_0x1de102[_0xb135('0x2a')]),_0x4bd47);if(_0x6659b2[_0xb135('0x23')][_0xb135('0x2c')]){_0x52588e[_0xb135('0x2d')]=_[_0xb135('0x2e')](_0x52588e[_0xb135('0x2d')],{'$or':_['map'](_0x4bd47,function(_0x30c2c4){if(_0x30c2c4[_0xb135('0x20')]!=='VIRTUAL'){var _0x34049b={};_0x34049b[_0x30c2c4[_0xb135('0x18')]]={'$like':'%'+_0x6659b2[_0xb135('0x23')][_0xb135('0x2c')]+'%'};return _0x34049b;}})});}_0x52588e=_[_0xb135('0x2e')]({},_0x52588e,_0x6659b2['options']);var _0x44baa5={'where':_0x52588e[_0xb135('0x2d')]};return db[_0xb135('0x1d')]['count'](_0x44baa5)[_0xb135('0x14')](function(_0xb63eae){_0x2de3e9['count']=_0xb63eae;if(_0x6659b2[_0xb135('0x23')][_0xb135('0x2f')]){_0x52588e[_0xb135('0x30')]=[{'all':!![]}];}return db['CloudProvider'][_0xb135('0x31')](_0x52588e);})[_0xb135('0x14')](function(_0x416ad2){_0x2de3e9[_0xb135('0x32')]=_['map'](_0x416ad2,function(_0x7cc561){if(_0x7cc561[_0xb135('0x33')]===_0xb135('0x34')){var _0x550396=encryptor[_0xb135('0x35')](_0x7cc561[_0xb135('0x36')]);_0x7cc561[_0xb135('0x36')]=maskClientSecret(_0x550396);}return _0x7cc561;});return _0x2de3e9;})['then'](respondWithFilteredResult(_0x33a09e,_0x52588e))['catch'](handleError(_0x33a09e,null));};exports[_0xb135('0x37')]=function(_0x2078b9,_0x588a45){var _0x47cefe={'raw':!![],'where':{'id':_0x2078b9[_0xb135('0x38')]['id']}},_0x351e28={};_0x351e28[_0xb135('0x22')]=_['keys'](db['CloudProvider'][_0xb135('0x1e')]);_0x351e28[_0xb135('0x23')]=_[_0xb135('0x39')](_0x2078b9[_0xb135('0x23')]);_0x351e28[_0xb135('0x2a')]=_[_0xb135('0x24')](_0x351e28[_0xb135('0x22')],_0x351e28[_0xb135('0x23')]);_0x47cefe[_0xb135('0x25')]=_['intersection'](_0x351e28[_0xb135('0x22')],qs[_0xb135('0x3a')](_0x2078b9['query'][_0xb135('0x3a')]));_0x47cefe[_0xb135('0x25')]=_0x47cefe[_0xb135('0x25')][_0xb135('0x26')]?_0x47cefe['attributes']:_0x351e28[_0xb135('0x22')];if(_0x2078b9[_0xb135('0x23')][_0xb135('0x2f')]){_0x47cefe['include']=[{'all':!![]}];}_0x47cefe=_[_0xb135('0x2e')]({},_0x47cefe,_0x2078b9[_0xb135('0x3b')]);return db[_0xb135('0x1d')][_0xb135('0x3c')](_0x47cefe)[_0xb135('0x14')](handleEntityNotFound(_0x588a45,null))[_0xb135('0x14')](function(_0x5933de){if(_0x5933de[_0xb135('0x33')]===_0xb135('0x34')){var _0x425e7d=encryptor[_0xb135('0x35')](_0x5933de[_0xb135('0x36')]);_0x5933de[_0xb135('0x36')]=maskClientSecret(_0x425e7d);}return _0x5933de;})[_0xb135('0x14')](respondWithResult(_0x588a45,null))[_0xb135('0x3d')](handleError(_0x588a45,null));};exports['create']=function(_0x6bcf7e,_0x5b104a){if(!_0x6bcf7e['body'][_0xb135('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x6bcf7e[_0xb135('0x3e')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x163c52=db[_0xb135('0x1d')][_0xb135('0x1e')]['service'][_0xb135('0x3f')];if(!_0x163c52['includes'](_0x6bcf7e[_0xb135('0x3e')][_0xb135('0x33')]))throw new Error(_0xb135('0x40')+_0x163c52[_0xb135('0x41')](',\x20'));if(_0x6bcf7e[_0xb135('0x3e')][_0xb135('0x33')]==='MicrosoftAzure'&&_0x6bcf7e['body'][_0xb135('0x36')]){_0x6bcf7e[_0xb135('0x3e')][_0xb135('0x36')]=encryptor[_0xb135('0x42')](_0x6bcf7e[_0xb135('0x3e')][_0xb135('0x36')]);}return db[_0xb135('0x1d')][_0xb135('0x43')](_0x6bcf7e[_0xb135('0x3e')],{})[_0xb135('0x14')](respondWithResult(_0x5b104a,0xc9))[_0xb135('0x3d')](handleError(_0x5b104a,null));};exports[_0xb135('0x13')]=function(_0x514381,_0x417ffa){if(_0x514381['body']['id']){delete _0x514381[_0xb135('0x3e')]['id'];}return db[_0xb135('0x1d')]['find']({'where':{'id':_0x514381[_0xb135('0x38')]['id']}})[_0xb135('0x14')](handleEntityNotFound(_0x417ffa,null))[_0xb135('0x14')](function(_0x11a752){if(_0x11a752[_0xb135('0x33')]===_0xb135('0x34')&&_0x514381['body'][_0xb135('0x36')]){_0x514381[_0xb135('0x3e')][_0xb135('0x36')]=encryptor['encryptString'](_0x514381[_0xb135('0x3e')][_0xb135('0x36')]);}return _0x11a752;})[_0xb135('0x14')](saveUpdates(_0x514381[_0xb135('0x3e')],null))[_0xb135('0x14')](respondWithResult(_0x417ffa,null))[_0xb135('0x3d')](handleError(_0x417ffa,null));};exports[_0xb135('0x15')]=function(_0x5ae396,_0x4e40d7){return db['CloudProvider']['find']({'where':{'id':_0x5ae396[_0xb135('0x38')]['id']}})['then'](handleEntityNotFound(_0x4e40d7,null))['then'](removeEntity(_0x4e40d7,null))['catch'](handleError(_0x4e40d7,null));};exports[_0xb135('0x44')]=function(_0x181c8c,_0x2d0fc5){return db[_0xb135('0x1d')][_0xb135('0x45')]({'where':{'id':_0x181c8c['params']['id']},'raw':!![]})[_0xb135('0x14')](function(_0x26aa32){if(!_0x26aa32)return _0x2d0fc5[_0xb135('0xb')](0x194);return{'url':oauth[_0xb135('0x46')](_0x26aa32,_0x181c8c[_0xb135('0x47')]['id'])};})[_0xb135('0x14')](respondWithResult(_0x2d0fc5,null))[_0xb135('0x3d')](handleError(_0x2d0fc5,null));};exports[_0xb135('0x48')]=function(_0x369d0e,_0x2fdd48){var _0x26cbe8=_0x369d0e[_0xb135('0x3e')];var _0x2fd5cb;var _0x3358f9;if(_0x26cbe8[_0xb135('0x16')])throw _0x26cbe8;redis[_0xb135('0x49')](_0x26cbe8['state'])[_0xb135('0x14')](function(_0x4fdef6){if(!_0x4fdef6)throw new Error(_0xb135('0x4a'));_0x2fd5cb=JSON['parse'](_0x4fdef6);var _0x128382=Buffer[_0xb135('0x4b')](_0x26cbe8[_0xb135('0x4c')],'base64')['toString'](_0xb135('0x4d'));_0x3358f9=JSON[_0xb135('0x4e')](_0x128382);if(!oauth[_0xb135('0x4f')](_0x26cbe8[_0xb135('0x50')],_0x2fd5cb['oauth2Claims']))throw new Error(_0xb135('0x51'));redis[_0xb135('0x52')](_0x26cbe8[_0xb135('0x4c')]);return oauth['getOauth2MicrosoftAccessToken'](_0x26cbe8[_0xb135('0x53')],_0x2fd5cb);})[_0xb135('0x14')](function(_0x18416b){_0x2fd5cb[_0xb135('0x54')]=_0x18416b[_0xb135('0x55')];_0x2fd5cb[_0xb135('0x56')]=_0x18416b['refresh_token'];return db[_0xb135('0x1d')][_0xb135('0x13')]({'data5':_0x2fd5cb[_0xb135('0x54')],'data6':_0x2fd5cb[_0xb135('0x56')]},{'where':{'id':_0x2fd5cb['id']}});})[_0xb135('0x14')](function(){oauth[_0xb135('0x57')](_0x2fd5cb);socket[_0xb135('0x58')](_0xb135('0x59'),{'id':_0x3358f9['id']});return;})['then'](respondWithStatusCode(_0x2fdd48,null))[_0xb135('0x3d')](function(_0x47ebe8){if(_0x3358f9){socket['emit'](_0xb135('0x5a'),{'id':_0x3358f9['id']});}if(!_0x2fd5cb){logger[_0xb135('0x16')]('Invalid\x20authentication\x20state\x20parameter',_0x47ebe8);return _0x2fdd48[_0xb135('0xc')](0x1f4)[_0xb135('0x19')](_0x47ebe8[_0xb135('0x5b')]);}logger[_0xb135('0x16')](_0xb135('0x5c'),_0x2fd5cb['id'],JSON[_0xb135('0x5d')](_0x47ebe8));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index cd9d96c..d5beeb8 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 _0xf07a=['../../config/environment','exports','CloudProvider','cloud_providers','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1e172a,_0x52102b){var _0x96338b=function(_0x307313){while(--_0x307313){_0x1e172a['push'](_0x1e172a['shift']());}};_0x96338b(++_0x52102b);}(_0xf07a,0x86));var _0xaf07=function(_0x5447a8,_0x45c8e9){_0x5447a8=_0x5447a8-0x0;var _0x4c586b=_0xf07a[_0x5447a8];return _0x4c586b;};'use strict';var _=require(_0xaf07('0x0'));var util=require(_0xaf07('0x1'));var logger=require('../../config/logger')(_0xaf07('0x2'));var moment=require(_0xaf07('0x3'));var BPromise=require(_0xaf07('0x4'));var rp=require(_0xaf07('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaf07('0x6'));var attributes=require('./cloudProvider.attributes');module[_0xaf07('0x7')]=function(_0x53d90e,_0x2ae16d){return _0x53d90e['define'](_0xaf07('0x8'),attributes,{'tableName':_0xaf07('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe4e8=['../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4e8,0xd5));var _0x8e4e=function(_0x16c8c8,_0x5f00b3){_0x16c8c8=_0x16c8c8-0x0;var _0x3f5132=_0xe4e8[_0x16c8c8];return _0x3f5132;};'use strict';var _=require(_0x8e4e('0x0'));var util=require(_0x8e4e('0x1'));var logger=require(_0x8e4e('0x2'))(_0x8e4e('0x3'));var moment=require(_0x8e4e('0x4'));var BPromise=require(_0x8e4e('0x5'));var rp=require(_0x8e4e('0x6'));var fs=require('fs');var path=require(_0x8e4e('0x7'));var rimraf=require('rimraf');var config=require(_0x8e4e('0x8'));var attributes=require(_0x8e4e('0x9'));module['exports']=function(_0x31a03f,_0x17adca){return _0x31a03f[_0x8e4e('0xa')](_0x8e4e('0xb'),attributes,{'tableName':_0x8e4e('0xc'),'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 ae71949..152930e 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 _0x7ab2=['login','map','key','oauth2Claims','oauth2/','set','decode','payload','iss','aud','audience','isAfter','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','decryptString','{TENANT_ID}','data5','access_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','replace','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','type','Dynamics365','/.default','join','Outlook365','data7','data2','code','id_token','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','state','nonce'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7ab2,0x76));var _0x27ab=function(_0x162754,_0x511159){_0x162754=_0x162754-0x0;var _0xe8f232=_0x7ab2[_0x162754];return _0xe8f232;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0x27ab('0x0'));var Redis=require(_0x27ab('0x1'));var rp=require(_0x27ab('0x2'));var util=require(_0x27ab('0x3'));var encryptor=require(_0x27ab('0x4'));var config=require('../../config/environment');var logger=require(_0x27ab('0x5'))(_0x27ab('0x6'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x27ab('0x7'))['db'];config[_0x27ab('0x8')]=_[_0x27ab('0x9')](config[_0x27ab('0x8')],{'host':_0x27ab('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x27ab('0xb');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x27ab('0xc'),_0x27ab('0xd'),_0x27ab('0xe'),_0x27ab('0xf'),_0x27ab('0x10'),_0x27ab('0x11')],'Dynamics365':[_0x27ab('0x12'),_0x27ab('0xe')]};var MICROSOFT_AUTH_ENDPOINT=_0x27ab('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x27ab('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5b551c){var _0x3d713e=_['map'](AZURE_AUTH_SCOPES[_0x5b551c['type']]);if(_0x5b551c[_0x27ab('0x15')]===_0x27ab('0x16'))_0x3d713e['push'](_0x5b551c['data7']+_0x27ab('0x17'));return _0x3d713e[_0x27ab('0x18')]('\x20');}function getAccessTokenScope(_0x5795fd){if(_0x5795fd[_0x27ab('0x15')]===_0x27ab('0x19'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x5795fd[_0x27ab('0x15')]==='Dynamics365')return _0x5795fd[_0x27ab('0x1a')]+_0x27ab('0x17');}function generateMicrosoftAuthorizationUrl(_0x2b1e54,_0x3daafe){var _0x3cdbc0=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x2b1e54[_0x27ab('0x1b')]);var _0x3c1719=[_0x27ab('0x1c'),_0x27ab('0x1d')];var _0x5b059a=Buffer['from'](JSON[_0x27ab('0x1e')]({'id':_0x3daafe}))[_0x27ab('0x1f')](_0x27ab('0x20'));var _0x184bf2=crypto[_0x27ab('0x21')](0x10)[_0x27ab('0x1f')](_0x27ab('0x22'));var _0x501046=getAuthorizationScopes(_0x2b1e54);var _0xbd499e=[{'key':_0x27ab('0x23'),'value':_0x2b1e54[_0x27ab('0x24')]},{'key':_0x27ab('0x25'),'value':encodeURIComponent(_0x3c1719[_0x27ab('0x18')]('\x20'))},{'key':_0x27ab('0x26'),'value':_0x2b1e54[_0x27ab('0x27')]},{'key':_0x27ab('0x28'),'value':_0x27ab('0x29')},{'key':'scope','value':encodeURIComponent(_0x501046)},{'key':_0x27ab('0x2a'),'value':_0x5b059a},{'key':_0x27ab('0x2b'),'value':_0x184bf2},{'key':'prompt','value':_0x27ab('0x2c')}];var _0x51e59f=_0x3cdbc0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x27ab('0x2d')](_0xbd499e,function(_0x2cee4f){return _0x2cee4f[_0x27ab('0x2e')]+'='+_0x2cee4f['value'];})[_0x27ab('0x18')]('&');_0x2b1e54[_0x27ab('0x2f')]={'issuer':_0x3cdbc0['replace'](_0x27ab('0x30'),''),'audience':_0x2b1e54[_0x27ab('0x24')],'state':_0x5b059a,'nonce':_0x184bf2};redis[_0x27ab('0x31')](_0x5b059a,JSON[_0x27ab('0x1e')](_0x2b1e54));return _0x51e59f;}function isValidIdToken(_0x4a4fd7,_0x277945){try{var _0x5b0ebc=jwt[_0x27ab('0x32')](_0x4a4fd7,{'complete':!![]});var _0x4f2a04=_0x5b0ebc[_0x27ab('0x33')];if(_0x4f2a04[_0x27ab('0x34')]!==_0x277945['issuer'])return![];if(_0x4f2a04[_0x27ab('0x35')]!==_0x277945[_0x27ab('0x36')])return![];if(_0x4f2a04[_0x27ab('0x2b')]!==_0x277945[_0x27ab('0x2b')])return![];if(moment()[_0x27ab('0x37')](moment[_0x27ab('0x38')](_0x4f2a04['exp'])))return![];return!![];}catch(_0x2be9c4){throw _0x2be9c4;}}function refreshOauth2MicrosoftAccessToken(_0x109eb2){return Promise[_0x27ab('0x39')]()[_0x27ab('0x3a')](function(){if(_0x109eb2[_0x27ab('0x3b')])return _0x109eb2;return db[_0x27ab('0x3c')][_0x27ab('0x3d')]({'where':{'id':_0x109eb2['id']},'raw':!![]});})[_0x27ab('0x3a')](function(_0x180df4){var _0x26bfb7={'grant_type':_0x27ab('0x3e'),'refresh_token':_0x180df4[_0x27ab('0x3f')],'scope':getAccessTokenScope(_0x180df4),'redirect_uri':_0x180df4['data4'],'client_id':_0x180df4[_0x27ab('0x24')],'client_secret':encryptor[_0x27ab('0x40')](_0x180df4[_0x27ab('0x3b')])};var _0x174940={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x27ab('0x41'),_0x180df4[_0x27ab('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x26bfb7,'json':!![]};return rp(_0x174940);})['then'](function(_0x429624){_0x109eb2[_0x27ab('0x42')]=_0x429624[_0x27ab('0x43')];_0x109eb2['data6']=_0x429624['refresh_token'];return db[_0x27ab('0x3c')][_0x27ab('0x44')]({'data5':_0x109eb2['data5'],'data6':_0x109eb2[_0x27ab('0x3f')]},{'where':{'id':_0x109eb2['id']}});})[_0x27ab('0x3a')](function(){return _0x109eb2;})[_0x27ab('0x45')](function(_0x47ddc6){logger[_0x27ab('0x46')](_0x27ab('0x47'),_0x109eb2['id'],_0x47ddc6);});}function getOauth2MicrosoftAccessToken(_0x286542,_0xb5f4e0){var _0xaacbd5={'grant_type':_0x27ab('0x48'),'code':_0x286542,'scope':getAccessTokenScope(_0xb5f4e0),'redirect_uri':_0xb5f4e0[_0x27ab('0x27')],'client_id':_0xb5f4e0[_0x27ab('0x24')],'client_secret':encryptor[_0x27ab('0x40')](_0xb5f4e0[_0x27ab('0x3b')])};var _0x473974={'method':_0x27ab('0x49'),'uri':MICROSOFT_AUTH_URL[_0x27ab('0x4a')](_0x27ab('0x41'),_0xb5f4e0[_0x27ab('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xaacbd5,'json':!![]};return rp(_0x473974);}function startRefreshInterval(_0x738534){var _0x40f7e9=schedule['intervals'];if(_0x40f7e9[_0x738534['id']])clearInterval(_0x40f7e9[_0x738534['id']]);_0x40f7e9[_0x738534['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x738534['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x27ab('0x4b')]=_0x40f7e9;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x27ab('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x27ab('0x3a')](function(_0x242999){var _0xbe3317=_0x242999[_0x27ab('0x2d')](function(_0x77258e){return refreshOauth2MicrosoftAccessToken(_0x77258e)[_0x27ab('0x3a')](function(_0x2260b1){startRefreshInterval(_0x2260b1);});});return Promise[_0x27ab('0x4d')](_0xbe3317);})['catch'](function(_0x36af37){var _0x218682=_0x36af37?util[_0x27ab('0x4e')](_0x36af37,{'showHidden':![],'depth':null}):'';logger[_0x27ab('0x46')](_0x27ab('0x4f'),_0x218682);});}module[_0x27ab('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x0896=['../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','client_id','data1','response_type','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','resolve','then','data3','findOne','refresh_token','decryptString','POST','data5','access_token','data6','CloudProvider','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider'];(function(_0x41a86d,_0x1819bc){var _0x1bf9e9=function(_0x3fda6b){while(--_0x3fda6b){_0x41a86d['push'](_0x41a86d['shift']());}};_0x1bf9e9(++_0x1819bc);}(_0x0896,0x134));var _0x6089=function(_0x23f3dc,_0x53ca6d){_0x23f3dc=_0x23f3dc-0x0;var _0x4370e0=_0x0896[_0x23f3dc];return _0x4370e0;};'use strict';var _=require('lodash');var crypto=require(_0x6089('0x0'));var jwt=require(_0x6089('0x1'));var moment=require('moment');var Redis=require(_0x6089('0x2'));var rp=require('request-promise');var util=require(_0x6089('0x3'));var encryptor=require(_0x6089('0x4'));var config=require(_0x6089('0x5'));var logger=require(_0x6089('0x6'))('api');var schedule=require(_0x6089('0x7'));var db=require(_0x6089('0x8'))['db'];config[_0x6089('0x9')]=_[_0x6089('0xa')](config[_0x6089('0x9')],{'host':_0x6089('0xb'),'port':0x18eb});var redis=new Redis(config[_0x6089('0x9')]);var MICROSOFT_AUTH_URL=_0x6089('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6089('0xd'),_0x6089('0xe'),'email',_0x6089('0xf'),_0x6089('0x10'),_0x6089('0x11'),_0x6089('0x12')],'Dynamics365':[_0x6089('0xd'),_0x6089('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x6089('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x37bc0d){var _0x1fee04=_[_0x6089('0x14')](AZURE_AUTH_SCOPES[_0x37bc0d[_0x6089('0x15')]]);if(_0x37bc0d[_0x6089('0x15')]===_0x6089('0x16'))_0x1fee04['push'](_0x37bc0d[_0x6089('0x17')]+_0x6089('0x18'));return _0x1fee04[_0x6089('0x19')]('\x20');}function getAccessTokenScope(_0x4e84d9){if(_0x4e84d9[_0x6089('0x15')]===_0x6089('0x1a'))return _0x6089('0x10');if(_0x4e84d9[_0x6089('0x15')]===_0x6089('0x16'))return _0x4e84d9[_0x6089('0x17')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x29419a,_0x28a923){var _0x3175bb=MICROSOFT_AUTH_URL[_0x6089('0x1b')](_0x6089('0x1c'),_0x29419a[_0x6089('0x1d')]);var _0x207fc2=[_0x6089('0x1e'),_0x6089('0x1f')];var _0x32170e=Buffer[_0x6089('0x20')](JSON[_0x6089('0x21')]({'id':_0x28a923}))[_0x6089('0x22')](_0x6089('0x23'));var _0x1b62a4=crypto[_0x6089('0x24')](0x10)['toString']('hex');var _0x2544ad=getAuthorizationScopes(_0x29419a);var _0x324a1a=[{'key':_0x6089('0x25'),'value':_0x29419a[_0x6089('0x26')]},{'key':_0x6089('0x27'),'value':encodeURIComponent(_0x207fc2[_0x6089('0x19')]('\x20'))},{'key':_0x6089('0x28'),'value':_0x29419a[_0x6089('0x29')]},{'key':_0x6089('0x2a'),'value':_0x6089('0x2b')},{'key':_0x6089('0x2c'),'value':encodeURIComponent(_0x2544ad)},{'key':_0x6089('0x2d'),'value':_0x32170e},{'key':_0x6089('0x2e'),'value':_0x1b62a4},{'key':_0x6089('0x2f'),'value':'login'}];var _0x48370d=_0x3175bb+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6089('0x14')](_0x324a1a,function(_0x171226){return _0x171226[_0x6089('0x30')]+'='+_0x171226[_0x6089('0x31')];})[_0x6089('0x19')]('&');_0x29419a['oauth2Claims']={'issuer':_0x3175bb[_0x6089('0x1b')](_0x6089('0x32'),''),'audience':_0x29419a[_0x6089('0x26')],'state':_0x32170e,'nonce':_0x1b62a4};redis['set'](_0x32170e,JSON[_0x6089('0x21')](_0x29419a));return _0x48370d;}function isValidIdToken(_0x375e6d,_0x5a62e8){try{var _0x4faafd=jwt[_0x6089('0x33')](_0x375e6d,{'complete':!![]});var _0x4e646f=_0x4faafd[_0x6089('0x34')];if(_0x4e646f[_0x6089('0x35')]!==_0x5a62e8[_0x6089('0x36')])return![];if(_0x4e646f[_0x6089('0x37')]!==_0x5a62e8[_0x6089('0x38')])return![];if(_0x4e646f[_0x6089('0x2e')]!==_0x5a62e8['nonce'])return![];if(moment()[_0x6089('0x39')](moment[_0x6089('0x3a')](_0x4e646f['exp'])))return![];return!![];}catch(_0x67906f){throw _0x67906f;}}function refreshOauth2MicrosoftAccessToken(_0x14a67f){return Promise[_0x6089('0x3b')]()[_0x6089('0x3c')](function(){if(_0x14a67f[_0x6089('0x3d')])return _0x14a67f;return db['CloudProvider'][_0x6089('0x3e')]({'where':{'id':_0x14a67f['id']},'raw':!![]});})[_0x6089('0x3c')](function(_0x36e5cd){var _0x414e67={'grant_type':_0x6089('0x3f'),'refresh_token':_0x36e5cd['data6'],'scope':getAccessTokenScope(_0x36e5cd),'redirect_uri':_0x36e5cd[_0x6089('0x29')],'client_id':_0x36e5cd['data1'],'client_secret':encryptor[_0x6089('0x40')](_0x36e5cd[_0x6089('0x3d')])};var _0x2c6437={'method':_0x6089('0x41'),'uri':MICROSOFT_AUTH_URL[_0x6089('0x1b')](_0x6089('0x1c'),_0x36e5cd[_0x6089('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x414e67,'json':!![]};return rp(_0x2c6437);})[_0x6089('0x3c')](function(_0x133447){_0x14a67f[_0x6089('0x42')]=_0x133447[_0x6089('0x43')];_0x14a67f[_0x6089('0x44')]=_0x133447[_0x6089('0x3f')];return db[_0x6089('0x45')][_0x6089('0x46')]({'data5':_0x14a67f[_0x6089('0x42')],'data6':_0x14a67f[_0x6089('0x44')]},{'where':{'id':_0x14a67f['id']}});})['then'](function(){return _0x14a67f;})['catch'](function(_0x2a8e30){logger[_0x6089('0x47')](_0x6089('0x48'),_0x14a67f['id'],_0x2a8e30);});}function getOauth2MicrosoftAccessToken(_0x22b66b,_0x41eb74){var _0x506037={'grant_type':_0x6089('0x49'),'code':_0x22b66b,'scope':getAccessTokenScope(_0x41eb74),'redirect_uri':_0x41eb74[_0x6089('0x29')],'client_id':_0x41eb74['data1'],'client_secret':encryptor[_0x6089('0x40')](_0x41eb74[_0x6089('0x3d')])};var _0x2b9653={'method':_0x6089('0x41'),'uri':MICROSOFT_AUTH_URL[_0x6089('0x1b')]('{TENANT_ID}',_0x41eb74[_0x6089('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x506037,'json':!![]};return rp(_0x2b9653);}function startRefreshInterval(_0x259377){var _0x26ca4b=schedule[_0x6089('0x4a')];if(_0x26ca4b[_0x259377['id']])clearInterval(_0x26ca4b[_0x259377['id']]);_0x26ca4b[_0x259377['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x259377['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6089('0x4a')]=_0x26ca4b;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x6089('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6089('0x3c')](function(_0x41bb95){var _0x28df48=_0x41bb95[_0x6089('0x14')](function(_0x1b2c12){return refreshOauth2MicrosoftAccessToken(_0x1b2c12)[_0x6089('0x3c')](function(_0x45fbd0){startRefreshInterval(_0x45fbd0);});});return Promise[_0x6089('0x4c')](_0x28df48);})['catch'](function(_0x47e926){var _0x11adf7=_0x47e926?util[_0x6089('0x4d')](_0x47e926,{'showHidden':![],'depth':null}):'';logger['error'](_0x6089('0x4e'),_0x11adf7);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index cb7f2e6..09fdea6 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 _0x1516=['../../config/environment','client','http','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x1516,0xb0));var _0x6151=function(_0x27330b,_0x1383dc){_0x27330b=_0x27330b-0x0;var _0x5d09da=_0x1516[_0x27330b];return _0x5d09da;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x319164,_0x3fa962,_0x46e22f){return new BPromise(function(_0x43513c,_0x44cc85){return client[_0x6151('0xb')](_0x319164,_0x46e22f)[_0x6151('0xc')](function(_0x5c5b55){logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));logger[_0x6151('0xf')](_0x6151('0x10'),_0x3fa962,_0x6151('0xe'),JSON[_0x6151('0x11')](_0x5c5b55));if(_0x5c5b55[_0x6151('0x12')]){if(_0x5c5b55[_0x6151('0x12')][_0x6151('0x13')]===0x1f4){logger['error']('CloudProvider,\x20%s,\x20%s',_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x44cc85(_0x5c5b55[_0x6151('0x12')]['message']);}logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x5c5b55[_0x6151('0x12')][_0x6151('0x14')]);return _0x43513c(_0x5c5b55['error'][_0x6151('0x14')]);}else{logger['info'](_0x6151('0xd'),_0x3fa962,_0x6151('0xe'));_0x43513c(_0x5c5b55[_0x6151('0x15')][_0x6151('0x14')]);}})[_0x6151('0x16')](function(_0x12524a){logger[_0x6151('0x12')](_0x6151('0xd'),_0x3fa962,_0x12524a);_0x44cc85(_0x12524a);});});} \ No newline at end of file +var _0xb366=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x5d23be,_0x3b4f3c){var _0x4d60a9=function(_0x57dce7){while(--_0x57dce7){_0x5d23be['push'](_0x5d23be['shift']());}};_0x4d60a9(++_0x3b4f3c);}(_0xb366,0xa4));var _0x6b36=function(_0x5a74da,_0xb4b3e3){_0x5a74da=_0x5a74da-0x0;var _0x79fbc3=_0xb366[_0x5a74da];return _0x79fbc3;};'use strict';var _=require(_0x6b36('0x0'));var util=require('util');var moment=require(_0x6b36('0x1'));var BPromise=require(_0x6b36('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b36('0x3'));var db=require(_0x6b36('0x4'))['db'];var utils=require(_0x6b36('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6b36('0x6'));var client=jayson[_0x6b36('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3997c0,_0x4fe38c,_0x4c6f4c){return new BPromise(function(_0x301a30,_0xee898a){return client[_0x6b36('0x8')](_0x3997c0,_0x4c6f4c)[_0x6b36('0x9')](function(_0x49c125){logger[_0x6b36('0xa')](_0x6b36('0xb'),_0x4fe38c,'request\x20sent');logger[_0x6b36('0xc')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x4fe38c,_0x6b36('0xd'),JSON[_0x6b36('0xe')](_0x49c125));if(_0x49c125[_0x6b36('0xf')]){if(_0x49c125[_0x6b36('0xf')][_0x6b36('0x10')]===0x1f4){logger[_0x6b36('0xf')]('CloudProvider,\x20%s,\x20%s',_0x4fe38c,_0x49c125[_0x6b36('0xf')][_0x6b36('0x11')]);return _0xee898a(_0x49c125['error'][_0x6b36('0x11')]);}logger['error'](_0x6b36('0xb'),_0x4fe38c,_0x49c125['error']['message']);return _0x301a30(_0x49c125['error'][_0x6b36('0x11')]);}else{logger[_0x6b36('0xa')](_0x6b36('0xb'),_0x4fe38c,'request\x20sent');_0x301a30(_0x49c125[_0x6b36('0x12')]['message']);}})[_0x6b36('0x13')](function(_0xf7b45a){logger[_0x6b36('0xf')]('CloudProvider,\x20%s,\x20%s',_0x4fe38c,_0xf7b45a);_0xee898a(_0xf7b45a);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7f343ed..c7ef6f0 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 _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x47a5bd,_0x508329){var _0x5c2184=function(_0x40ddea){while(--_0x40ddea){_0x47a5bd['push'](_0x47a5bd['shift']());}};_0x5c2184(++_0x508329);}(_0x5f2f,0x73));var _0xf5f2=function(_0xac6102,_0xde290a){_0xac6102=_0xac6102-0x0;var _0x2c444b=_0x5f2f[_0xac6102];return _0x2c444b;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x390f64,_0x26b400){var _0x148962=function(_0x9fd921){while(--_0x9fd921){_0x390f64['push'](_0x390f64['shift']());}};_0x148962(++_0x26b400);}(_0xadb5,0xad));var _0x5adb=function(_0x488c43,_0x43214b){_0x488c43=_0x488c43-0x0;var _0x2dbfca=_0xadb5[_0x488c43];return _0x2dbfca;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 6db649d..2d6c600 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 _0x2188=['name','STRING','sequelize'];(function(_0x4c3515,_0x405fa2){var _0x585d6e=function(_0x2729a6){while(--_0x2729a6){_0x4c3515['push'](_0x4c3515['shift']());}};_0x585d6e(++_0x405fa2);}(_0x2188,0x1d6));var _0x8218=function(_0x4e19d9,_0x490aa0){_0x4e19d9=_0x4e19d9-0x0;var _0x27caa3=_0x2188[_0x4e19d9];return _0x27caa3;};'use strict';var Sequelize=require(_0x8218('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8218('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8218('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x8218('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8218('0x2')]},'type':{'type':Sequelize[_0x8218('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x8218('0x2')]},'country':{'type':Sequelize[_0x8218('0x2')]},'email':{'type':Sequelize[_0x8218('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8218('0x2')]},'sStreet':{'type':Sequelize[_0x8218('0x2')]},'sPostalCode':{'type':Sequelize[_0x8218('0x2')]},'sCity':{'type':Sequelize[_0x8218('0x2')]},'sCountry':{'type':Sequelize[_0x8218('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c86=['name','STRING'];(function(_0x2fd160,_0x53c0d6){var _0x5c2031=function(_0x8ecfa5){while(--_0x8ecfa5){_0x2fd160['push'](_0x2fd160['shift']());}};_0x5c2031(++_0x53c0d6);}(_0x5c86,0x73));var _0x65c8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5c86[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x65c8('0x0')],'unique':_0x65c8('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x65c8('0x0')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x65c8('0x0')]},'phone':{'type':Sequelize[_0x65c8('0x0')]},'fax':{'type':Sequelize[_0x65c8('0x0')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x65c8('0x0')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x65c8('0x0')]},'country':{'type':Sequelize[_0x65c8('0x0')]},'email':{'type':Sequelize[_0x65c8('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x65c8('0x0')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x65c8('0x0')]},'sCity':{'type':Sequelize[_0x65c8('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x65c8('0x0')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 46a3fee..5bd4eda 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 _0x9c7b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','Companies','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','CmCompany','describe','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','getContacts','findOne','CmContact','map'];(function(_0x12a4b4,_0x27a87b){var _0x4f8880=function(_0x1ff658){while(--_0x1ff658){_0x12a4b4['push'](_0x12a4b4['shift']());}};_0x4f8880(++_0x27a87b);}(_0x9c7b,0x108));var _0xb9c7=function(_0x547deb,_0x1dcb7a){_0x547deb=_0x547deb-0x0;var _0x200d00=_0x9c7b[_0x547deb];return _0x200d00;};'use strict';var emlformat=require(_0xb9c7('0x0'));var rimraf=require(_0xb9c7('0x1'));var zipdir=require(_0xb9c7('0x2'));var jsonpatch=require(_0xb9c7('0x3'));var rp=require(_0xb9c7('0x4'));var moment=require('moment');var BPromise=require(_0xb9c7('0x5'));var Mustache=require('mustache');var util=require(_0xb9c7('0x6'));var path=require(_0xb9c7('0x7'));var sox=require(_0xb9c7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb9c7('0x9'));var _=require(_0xb9c7('0xa'));var squel=require(_0xb9c7('0xb'));var crypto=require(_0xb9c7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb9c7('0xd'));var toCsv=require(_0xb9c7('0xe'));var querystring=require(_0xb9c7('0xf'));var Papa=require(_0xb9c7('0x10'));var Redis=require(_0xb9c7('0x11'));var authService=require(_0xb9c7('0x12'));var qs=require(_0xb9c7('0x13'));var as=require(_0xb9c7('0x14'));var hardwareService=require(_0xb9c7('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb9c7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9c7('0x17'))['db'];function respondWithStatusCode(_0x113642,_0x2133c7){_0x2133c7=_0x2133c7||0xcc;return function(_0x1f449e){if(_0x1f449e){return _0x113642['sendStatus'](_0x2133c7);}return _0x113642['status'](_0x2133c7)['end']();};}function respondWithResult(_0x482de,_0x28c446){_0x28c446=_0x28c446||0xc8;return function(_0x2bef81){if(_0x2bef81){return _0x482de[_0xb9c7('0x18')](_0x28c446)[_0xb9c7('0x19')](_0x2bef81);}};}function respondWithFilteredResult(_0x4ff94b,_0x3ce22a){return function(_0x1ec538){if(_0x1ec538){var _0xd74583=typeof _0x3ce22a['offset']==='undefined'&&typeof _0x3ce22a[_0xb9c7('0x1a')]===_0xb9c7('0x1b');var _0x563b84=_0x1ec538[_0xb9c7('0x1c')];var _0x43d6e6=_0xd74583?0x0:_0x3ce22a['offset'];var _0x265877=_0xd74583?_0x1ec538[_0xb9c7('0x1c')]:_0x3ce22a['offset']+_0x3ce22a['limit'];var _0x35c4de;if(_0x265877>=_0x563b84){_0x265877=_0x563b84;_0x35c4de=0xc8;}else{_0x35c4de=0xce;}_0x4ff94b[_0xb9c7('0x18')](_0x35c4de);return _0x4ff94b[_0xb9c7('0x1d')](_0xb9c7('0x1e'),_0x43d6e6+'-'+_0x265877+'/'+_0x563b84)[_0xb9c7('0x19')](_0x1ec538);}return null;};}function patchUpdates(_0x353596){return function(_0x4c05b8){try{jsonpatch[_0xb9c7('0x1f')](_0x4c05b8,_0x353596,!![]);}catch(_0x33d567){return BPromise[_0xb9c7('0x20')](_0x33d567);}return _0x4c05b8[_0xb9c7('0x21')]();};}function saveUpdates(_0x153034,_0x225e81){return function(_0x43bb8e){if(_0x43bb8e){return _0x43bb8e[_0xb9c7('0x22')](_0x153034)[_0xb9c7('0x23')](function(_0x14264e){return _0x14264e;});}return null;};}function removeEntity(_0x27a263,_0x1f5648){return function(_0x5e2b2a){if(_0x5e2b2a){return _0x5e2b2a['destroy']()[_0xb9c7('0x23')](function(){var _0x27010d=_0x5e2b2a['get']({'plain':!![]});var _0x4d31dc=_0xb9c7('0x24');return db[_0xb9c7('0x25')][_0xb9c7('0x26')]({'where':{'type':_0x4d31dc,'resourceId':_0x27010d['id']}})[_0xb9c7('0x23')](function(){return _0x5e2b2a;});})[_0xb9c7('0x23')](function(){_0x27a263['status'](0xcc)[_0xb9c7('0x27')]();});}};}function handleEntityNotFound(_0x31ecbc,_0x1d9b04){return function(_0x3cc68d){if(!_0x3cc68d){_0x31ecbc[_0xb9c7('0x28')](0x194);}return _0x3cc68d;};}function handleError(_0x3d62c3,_0x45e311){_0x45e311=_0x45e311||0x1f4;return function(_0x117b66){logger[_0xb9c7('0x29')](_0x117b66[_0xb9c7('0x2a')]);if(_0x117b66['name']){delete _0x117b66[_0xb9c7('0x2b')];}_0x3d62c3[_0xb9c7('0x18')](_0x45e311)[_0xb9c7('0x2c')](_0x117b66);};}exports['index']=function(_0x32110c,_0x3f4ba1){var _0x23af4a={},_0x4bf3bd={},_0x30129e={'count':0x0,'rows':[]};return db[_0xb9c7('0x2d')][_0xb9c7('0x2e')]()[_0xb9c7('0x23')](function(_0xe4c4b4){_0x4bf3bd[_0xb9c7('0x2f')]=_['keys'](_0xe4c4b4);_0x4bf3bd['query']=_['keys'](_0x32110c[_0xb9c7('0x30')]);_0x4bf3bd[_0xb9c7('0x31')]=_[_0xb9c7('0x32')](_0x4bf3bd[_0xb9c7('0x2f')],_0x4bf3bd[_0xb9c7('0x30')]);_0x23af4a[_0xb9c7('0x33')]=_[_0xb9c7('0x32')](_0x4bf3bd[_0xb9c7('0x2f')],qs[_0xb9c7('0x34')](_0x32110c['query'][_0xb9c7('0x34')]));_0x23af4a[_0xb9c7('0x33')]=_0x23af4a[_0xb9c7('0x33')][_0xb9c7('0x35')]?_0x23af4a[_0xb9c7('0x33')]:_0x4bf3bd[_0xb9c7('0x2f')];if(!_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x36')](_0xb9c7('0x37'))){_0x23af4a[_0xb9c7('0x1a')]=qs['limit'](_0x32110c['query']['limit']);_0x23af4a['offset']=qs['offset'](_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x38')]);}_0x23af4a[_0xb9c7('0x39')]=qs['sort'](_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x3a')]);_0x23af4a[_0xb9c7('0x3b')]=qs[_0xb9c7('0x31')](_[_0xb9c7('0x3c')](_0x32110c[_0xb9c7('0x30')],_0x4bf3bd[_0xb9c7('0x31')]),_0xe4c4b4);if(_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x3d')]){_0x23af4a[_0xb9c7('0x3b')]=_['merge'](_0x23af4a[_0xb9c7('0x3b')],{'$or':_['map'](_0x23af4a[_0xb9c7('0x33')],function(_0x10a7a3){var _0x451608={};_0x451608[_0x10a7a3]={'$like':'%'+_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x3d')]+'%'};return _0x451608;})});}_0x23af4a=_[_0xb9c7('0x3e')]({},_0x23af4a,_0x32110c[_0xb9c7('0x3f')]);var _0x3eb4c1={'where':_0x23af4a[_0xb9c7('0x3b')]};return db[_0xb9c7('0x2d')][_0xb9c7('0x1c')](_0x3eb4c1)[_0xb9c7('0x23')](function(_0x38181f){_0x30129e[_0xb9c7('0x1c')]=_0x38181f;if(_0x32110c[_0xb9c7('0x30')][_0xb9c7('0x40')]){_0x23af4a[_0xb9c7('0x41')]=[{'all':!![]}];}return db[_0xb9c7('0x2d')][_0xb9c7('0x42')](_0x23af4a);})['then'](function(_0x17863c){_0x30129e[_0xb9c7('0x43')]=_0x17863c;return _0x30129e;})[_0xb9c7('0x23')](respondWithFilteredResult(_0x3f4ba1,_0x23af4a))['catch'](handleError(_0x3f4ba1,null));})[_0xb9c7('0x44')](handleError(_0x3f4ba1,null));};exports[_0xb9c7('0x45')]=function(_0x75430d,_0x3c0258){var _0x991ba8={'raw':![],'where':{'id':_0x75430d[_0xb9c7('0x46')]['id']}},_0x1b6b14={};_0x1b6b14[_0xb9c7('0x2f')]=_['keys'](db[_0xb9c7('0x2d')][_0xb9c7('0x47')]);_0x1b6b14[_0xb9c7('0x30')]=_[_0xb9c7('0x48')](_0x75430d[_0xb9c7('0x30')]);_0x1b6b14[_0xb9c7('0x31')]=_[_0xb9c7('0x32')](_0x1b6b14['model'],_0x1b6b14[_0xb9c7('0x30')]);_0x991ba8['attributes']=_[_0xb9c7('0x32')](_0x1b6b14['model'],qs[_0xb9c7('0x34')](_0x75430d[_0xb9c7('0x30')][_0xb9c7('0x34')]));_0x991ba8['attributes']=_0x991ba8[_0xb9c7('0x33')][_0xb9c7('0x35')]?_0x991ba8[_0xb9c7('0x33')]:_0x1b6b14[_0xb9c7('0x2f')];if(_0x75430d[_0xb9c7('0x30')][_0xb9c7('0x40')]){_0x991ba8[_0xb9c7('0x41')]=[{'all':!![]}];}_0x991ba8=_[_0xb9c7('0x3e')]({},_0x991ba8,_0x75430d[_0xb9c7('0x3f')]);return db[_0xb9c7('0x2d')][_0xb9c7('0x49')](_0x991ba8)[_0xb9c7('0x23')](handleEntityNotFound(_0x3c0258,null))['then'](respondWithResult(_0x3c0258,null))['catch'](handleError(_0x3c0258,null));};exports['create']=function(_0x3f24b6,_0x1cc0a0){return db[_0xb9c7('0x2d')][_0xb9c7('0x4a')](_0x3f24b6[_0xb9c7('0x4b')],{})[_0xb9c7('0x23')](function(_0x1af641){var _0x1d43f1=_0x3f24b6['user'][_0xb9c7('0x4c')]({'plain':!![]});if(!_0x1d43f1)throw new Error(_0xb9c7('0x4d'));if(_0x1d43f1[_0xb9c7('0x4e')]==='user'){var _0x343c7c=_0x1af641['get']({'plain':!![]});var _0x553a4e=_0xb9c7('0x24');return db[_0xb9c7('0x4f')][_0xb9c7('0x49')]({'where':{'name':_0x553a4e,'userProfileId':_0x1d43f1[_0xb9c7('0x50')]},'raw':!![]})['then'](function(_0x4ba88a){if(_0x4ba88a&&_0x4ba88a['autoAssociation']===0x0){return db[_0xb9c7('0x25')][_0xb9c7('0x4a')]({'name':_0x343c7c[_0xb9c7('0x2b')],'resourceId':_0x343c7c['id'],'type':_0x4ba88a[_0xb9c7('0x2b')],'sectionId':_0x4ba88a['id']},{})['then'](function(){return _0x1af641;});}else{return _0x1af641;}})['catch'](function(_0x5e9f4d){logger[_0xb9c7('0x29')](_0xb9c7('0x51'),_0x5e9f4d);throw _0x5e9f4d;});}return _0x1af641;})['then'](respondWithResult(_0x1cc0a0,0xc9))[_0xb9c7('0x44')](handleError(_0x1cc0a0,null));};exports[_0xb9c7('0x22')]=function(_0x5ccca0,_0x1148fa){if(_0x5ccca0[_0xb9c7('0x4b')]['id']){delete _0x5ccca0[_0xb9c7('0x4b')]['id'];}return db[_0xb9c7('0x2d')]['find']({'where':{'id':_0x5ccca0[_0xb9c7('0x46')]['id']}})['then'](handleEntityNotFound(_0x1148fa,null))[_0xb9c7('0x23')](saveUpdates(_0x5ccca0[_0xb9c7('0x4b')],null))[_0xb9c7('0x23')](respondWithResult(_0x1148fa,null))['catch'](handleError(_0x1148fa,null));};exports[_0xb9c7('0x26')]=function(_0x231aa3,_0x19b4b2){return db[_0xb9c7('0x2d')][_0xb9c7('0x49')]({'where':{'id':_0x231aa3[_0xb9c7('0x46')]['id']}})[_0xb9c7('0x23')](handleEntityNotFound(_0x19b4b2,null))[_0xb9c7('0x23')](removeEntity(_0x19b4b2,null))['catch'](handleError(_0x19b4b2,null));};exports['describe']=function(_0x21711b,_0x298787){return db[_0xb9c7('0x2d')][_0xb9c7('0x2e')]()[_0xb9c7('0x23')](respondWithResult(_0x298787,null))['catch'](handleError(_0x298787,null));};exports[_0xb9c7('0x52')]=function(_0x3d6dfc,_0x2378bb,_0x5141a1){return db['CmContact'][_0xb9c7('0x49')]({'where':{'id':_0x3d6dfc[_0xb9c7('0x46')]['id']}})[_0xb9c7('0x23')](handleEntityNotFound(_0x2378bb,null))[_0xb9c7('0x23')](function(_0x327b19){if(_0x327b19){return _0x327b19['addContacts'](_0x3d6dfc['body'][_0xb9c7('0x53')],_['omit'](_0x3d6dfc[_0xb9c7('0x4b')],[_0xb9c7('0x53'),'id'])||{});}})[_0xb9c7('0x23')](respondWithResult(_0x2378bb,null))['catch'](handleError(_0x2378bb,null));};exports[_0xb9c7('0x54')]=function(_0x5766ac,_0x278ec1,_0x10926a){var _0x59addd={};var _0xaac992={};var _0x5ad3a1;var _0x38754e;return db['CmCompany'][_0xb9c7('0x55')]({'where':{'id':_0x5766ac['params']['id']}})[_0xb9c7('0x23')](handleEntityNotFound(_0x278ec1,null))[_0xb9c7('0x23')](function(_0x1c2d3f){if(_0x1c2d3f){_0x5ad3a1=_0x1c2d3f;_0xaac992[_0xb9c7('0x2f')]=_[_0xb9c7('0x48')](db[_0xb9c7('0x56')][_0xb9c7('0x47')]);_0xaac992[_0xb9c7('0x30')]=_[_0xb9c7('0x48')](_0x5766ac['query']);_0xaac992['filters']=_[_0xb9c7('0x32')](_0xaac992[_0xb9c7('0x2f')],_0xaac992[_0xb9c7('0x30')]);_0x59addd[_0xb9c7('0x33')]=_[_0xb9c7('0x32')](_0xaac992[_0xb9c7('0x2f')],qs['fields'](_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x34')]));_0x59addd[_0xb9c7('0x33')]=_0x59addd[_0xb9c7('0x33')][_0xb9c7('0x35')]?_0x59addd[_0xb9c7('0x33')]:_0xaac992[_0xb9c7('0x2f')];_0x59addd[_0xb9c7('0x39')]=qs[_0xb9c7('0x3a')](_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x3a')]);_0x59addd[_0xb9c7('0x3b')]=qs['filters'](_[_0xb9c7('0x3c')](_0x5766ac[_0xb9c7('0x30')],_0xaac992['filters']));if(_0x5766ac['query'][_0xb9c7('0x3d')]){_0x59addd[_0xb9c7('0x3b')]=_['merge'](_0x59addd['where'],{'$or':_[_0xb9c7('0x57')](_0x59addd[_0xb9c7('0x33')],function(_0x38a801){var _0x2f50dd={};_0x2f50dd[_0x38a801]={'$like':'%'+_0x5766ac['query'][_0xb9c7('0x3d')]+'%'};return _0x2f50dd;})});}_0x59addd=_['merge']({},_0x59addd,_0x5766ac[_0xb9c7('0x3f')]);return _0x5ad3a1[_0xb9c7('0x54')](_0x59addd);}})[_0xb9c7('0x23')](function(_0x1cf7b2){if(_0x1cf7b2){_0x38754e=_0x1cf7b2[_0xb9c7('0x35')];if(!_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x36')](_0xb9c7('0x37'))){_0x59addd[_0xb9c7('0x1a')]=qs['limit'](_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x1a')]);_0x59addd[_0xb9c7('0x38')]=qs['offset'](_0x5766ac[_0xb9c7('0x30')][_0xb9c7('0x38')]);}return _0x5ad3a1[_0xb9c7('0x54')](_0x59addd);}})[_0xb9c7('0x23')](function(_0x116298){if(_0x116298){return _0x116298?{'count':_0x38754e,'rows':_0x116298}:null;}})[_0xb9c7('0x23')](respondWithResult(_0x278ec1,null))[_0xb9c7('0x44')](handleError(_0x278ec1,null));}; \ No newline at end of file +var _0x20c9=['role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','ids','omit','getContacts','CmContact','pick','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','CmCompany','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x2820fc,_0x481318){var _0x1e1508=function(_0x144d5b){while(--_0x144d5b){_0x2820fc['push'](_0x2820fc['shift']());}};_0x1e1508(++_0x481318);}(_0x20c9,0x163));var _0x920c=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x20c9[_0x504df1];return _0x1063b5;};'use strict';var emlformat=require(_0x920c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x920c('0x1'));var jsonpatch=require(_0x920c('0x2'));var rp=require('request-promise');var moment=require(_0x920c('0x3'));var BPromise=require(_0x920c('0x4'));var Mustache=require(_0x920c('0x5'));var util=require(_0x920c('0x6'));var path=require(_0x920c('0x7'));var sox=require(_0x920c('0x8'));var csv=require('to-csv');var ejs=require(_0x920c('0x9'));var fs=require('fs');var fs_extra=require(_0x920c('0xa'));var _=require('lodash');var squel=require(_0x920c('0xb'));var crypto=require(_0x920c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x920c('0xd'));var toCsv=require(_0x920c('0xe'));var querystring=require(_0x920c('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x920c('0x10'));var qs=require(_0x920c('0x11'));var as=require(_0x920c('0x12'));var hardwareService=require(_0x920c('0x13'));var logger=require(_0x920c('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x920c('0x15'));var db=require(_0x920c('0x16'))['db'];function respondWithStatusCode(_0x5acc9f,_0x5e66c6){_0x5e66c6=_0x5e66c6||0xcc;return function(_0xcd93f9){if(_0xcd93f9){return _0x5acc9f[_0x920c('0x17')](_0x5e66c6);}return _0x5acc9f[_0x920c('0x18')](_0x5e66c6)[_0x920c('0x19')]();};}function respondWithResult(_0x2f45e8,_0x4e770a){_0x4e770a=_0x4e770a||0xc8;return function(_0x12d2a7){if(_0x12d2a7){return _0x2f45e8['status'](_0x4e770a)[_0x920c('0x1a')](_0x12d2a7);}};}function respondWithFilteredResult(_0x22bc2d,_0x5118cd){return function(_0x5588ad){if(_0x5588ad){var _0xbb4dde=typeof _0x5118cd[_0x920c('0x1b')]===_0x920c('0x1c')&&typeof _0x5118cd[_0x920c('0x1d')]===_0x920c('0x1c');var _0x4e2f8b=_0x5588ad[_0x920c('0x1e')];var _0x29e512=_0xbb4dde?0x0:_0x5118cd[_0x920c('0x1b')];var _0x451a95=_0xbb4dde?_0x5588ad[_0x920c('0x1e')]:_0x5118cd[_0x920c('0x1b')]+_0x5118cd[_0x920c('0x1d')];var _0x31d76c;if(_0x451a95>=_0x4e2f8b){_0x451a95=_0x4e2f8b;_0x31d76c=0xc8;}else{_0x31d76c=0xce;}_0x22bc2d['status'](_0x31d76c);return _0x22bc2d['set'](_0x920c('0x1f'),_0x29e512+'-'+_0x451a95+'/'+_0x4e2f8b)[_0x920c('0x1a')](_0x5588ad);}return null;};}function patchUpdates(_0x45c01a){return function(_0x1f8761){try{jsonpatch[_0x920c('0x20')](_0x1f8761,_0x45c01a,!![]);}catch(_0x27e9ec){return BPromise[_0x920c('0x21')](_0x27e9ec);}return _0x1f8761[_0x920c('0x22')]();};}function saveUpdates(_0x563d42,_0x99fa34){return function(_0x531866){if(_0x531866){return _0x531866[_0x920c('0x23')](_0x563d42)[_0x920c('0x24')](function(_0x55f088){return _0x55f088;});}return null;};}function removeEntity(_0x46cb5e,_0x53bd8a){return function(_0xf23862){if(_0xf23862){return _0xf23862['destroy']()[_0x920c('0x24')](function(){var _0x282a67=_0xf23862[_0x920c('0x25')]({'plain':!![]});var _0x44c607='Companies';return db[_0x920c('0x26')][_0x920c('0x27')]({'where':{'type':_0x44c607,'resourceId':_0x282a67['id']}})[_0x920c('0x24')](function(){return _0xf23862;});})['then'](function(){_0x46cb5e['status'](0xcc)[_0x920c('0x19')]();});}};}function handleEntityNotFound(_0x5c809b,_0x25dfb9){return function(_0x17246c){if(!_0x17246c){_0x5c809b[_0x920c('0x17')](0x194);}return _0x17246c;};}function handleError(_0xe4f268,_0xa925c6){_0xa925c6=_0xa925c6||0x1f4;return function(_0x3e622e){logger[_0x920c('0x28')](_0x3e622e[_0x920c('0x29')]);if(_0x3e622e[_0x920c('0x2a')]){delete _0x3e622e[_0x920c('0x2a')];}_0xe4f268[_0x920c('0x18')](_0xa925c6)[_0x920c('0x2b')](_0x3e622e);};}exports['index']=function(_0x251794,_0x40ed64){var _0x5738a5={},_0x79b61c={},_0x1cee08={'count':0x0,'rows':[]};return db[_0x920c('0x2c')][_0x920c('0x2d')]()[_0x920c('0x24')](function(_0x36fe0f){_0x79b61c[_0x920c('0x2e')]=_[_0x920c('0x2f')](_0x36fe0f);_0x79b61c[_0x920c('0x30')]=_[_0x920c('0x2f')](_0x251794[_0x920c('0x30')]);_0x79b61c['filters']=_['intersection'](_0x79b61c['model'],_0x79b61c[_0x920c('0x30')]);_0x5738a5[_0x920c('0x31')]=_[_0x920c('0x32')](_0x79b61c['model'],qs[_0x920c('0x33')](_0x251794['query']['fields']));_0x5738a5[_0x920c('0x31')]=_0x5738a5[_0x920c('0x31')][_0x920c('0x34')]?_0x5738a5[_0x920c('0x31')]:_0x79b61c['model'];if(!_0x251794['query'][_0x920c('0x35')](_0x920c('0x36'))){_0x5738a5['limit']=qs['limit'](_0x251794[_0x920c('0x30')][_0x920c('0x1d')]);_0x5738a5[_0x920c('0x1b')]=qs[_0x920c('0x1b')](_0x251794[_0x920c('0x30')][_0x920c('0x1b')]);}_0x5738a5[_0x920c('0x37')]=qs[_0x920c('0x38')](_0x251794[_0x920c('0x30')][_0x920c('0x38')]);_0x5738a5[_0x920c('0x39')]=qs['filters'](_['pick'](_0x251794[_0x920c('0x30')],_0x79b61c[_0x920c('0x3a')]),_0x36fe0f);if(_0x251794[_0x920c('0x30')][_0x920c('0x3b')]){_0x5738a5['where']=_[_0x920c('0x3c')](_0x5738a5[_0x920c('0x39')],{'$or':_[_0x920c('0x3d')](_0x5738a5['attributes'],function(_0x2ceedf){var _0x40cc1d={};_0x40cc1d[_0x2ceedf]={'$like':'%'+_0x251794[_0x920c('0x30')]['filter']+'%'};return _0x40cc1d;})});}_0x5738a5=_['merge']({},_0x5738a5,_0x251794[_0x920c('0x3e')]);var _0x16a59f={'where':_0x5738a5[_0x920c('0x39')]};return db[_0x920c('0x2c')][_0x920c('0x1e')](_0x16a59f)['then'](function(_0x2014c8){_0x1cee08['count']=_0x2014c8;if(_0x251794[_0x920c('0x30')][_0x920c('0x3f')]){_0x5738a5[_0x920c('0x40')]=[{'all':!![]}];}return db[_0x920c('0x2c')][_0x920c('0x41')](_0x5738a5);})['then'](function(_0x371cc5){_0x1cee08['rows']=_0x371cc5;return _0x1cee08;})[_0x920c('0x24')](respondWithFilteredResult(_0x40ed64,_0x5738a5))[_0x920c('0x42')](handleError(_0x40ed64,null));})[_0x920c('0x42')](handleError(_0x40ed64,null));};exports[_0x920c('0x43')]=function(_0x653dfa,_0x3d3898){var _0x103431={'raw':![],'where':{'id':_0x653dfa[_0x920c('0x44')]['id']}},_0x1f3f78={};_0x1f3f78[_0x920c('0x2e')]=_[_0x920c('0x2f')](db['CmCompany'][_0x920c('0x45')]);_0x1f3f78[_0x920c('0x30')]=_[_0x920c('0x2f')](_0x653dfa[_0x920c('0x30')]);_0x1f3f78[_0x920c('0x3a')]=_[_0x920c('0x32')](_0x1f3f78[_0x920c('0x2e')],_0x1f3f78['query']);_0x103431[_0x920c('0x31')]=_[_0x920c('0x32')](_0x1f3f78[_0x920c('0x2e')],qs[_0x920c('0x33')](_0x653dfa[_0x920c('0x30')]['fields']));_0x103431['attributes']=_0x103431[_0x920c('0x31')][_0x920c('0x34')]?_0x103431['attributes']:_0x1f3f78[_0x920c('0x2e')];if(_0x653dfa['query'][_0x920c('0x3f')]){_0x103431[_0x920c('0x40')]=[{'all':!![]}];}_0x103431=_['merge']({},_0x103431,_0x653dfa[_0x920c('0x3e')]);return db['CmCompany'][_0x920c('0x46')](_0x103431)[_0x920c('0x24')](handleEntityNotFound(_0x3d3898,null))[_0x920c('0x24')](respondWithResult(_0x3d3898,null))[_0x920c('0x42')](handleError(_0x3d3898,null));};exports[_0x920c('0x47')]=function(_0x5bc7a7,_0x36b75b){return db['CmCompany'][_0x920c('0x47')](_0x5bc7a7[_0x920c('0x48')],{})[_0x920c('0x24')](function(_0x70efa1){var _0x50660b=_0x5bc7a7[_0x920c('0x49')][_0x920c('0x25')]({'plain':!![]});if(!_0x50660b)throw new Error(_0x920c('0x4a'));if(_0x50660b[_0x920c('0x4b')]==='user'){var _0x411384=_0x70efa1[_0x920c('0x25')]({'plain':!![]});var _0x31809b=_0x920c('0x4c');return db[_0x920c('0x4d')][_0x920c('0x46')]({'where':{'name':_0x31809b,'userProfileId':_0x50660b[_0x920c('0x4e')]},'raw':!![]})[_0x920c('0x24')](function(_0x21a3a7){if(_0x21a3a7&&_0x21a3a7[_0x920c('0x4f')]===0x0){return db[_0x920c('0x26')][_0x920c('0x47')]({'name':_0x411384[_0x920c('0x2a')],'resourceId':_0x411384['id'],'type':_0x21a3a7[_0x920c('0x2a')],'sectionId':_0x21a3a7['id']},{})['then'](function(){return _0x70efa1;});}else{return _0x70efa1;}})[_0x920c('0x42')](function(_0x3257f3){logger[_0x920c('0x28')](_0x920c('0x50'),_0x3257f3);throw _0x3257f3;});}return _0x70efa1;})[_0x920c('0x24')](respondWithResult(_0x36b75b,0xc9))['catch'](handleError(_0x36b75b,null));};exports[_0x920c('0x23')]=function(_0x24b331,_0x3032e9){if(_0x24b331['body']['id']){delete _0x24b331['body']['id'];}return db[_0x920c('0x2c')]['find']({'where':{'id':_0x24b331[_0x920c('0x44')]['id']}})[_0x920c('0x24')](handleEntityNotFound(_0x3032e9,null))[_0x920c('0x24')](saveUpdates(_0x24b331[_0x920c('0x48')],null))[_0x920c('0x24')](respondWithResult(_0x3032e9,null))[_0x920c('0x42')](handleError(_0x3032e9,null));};exports['destroy']=function(_0x38cc49,_0x5cc1fb){return db[_0x920c('0x2c')][_0x920c('0x46')]({'where':{'id':_0x38cc49[_0x920c('0x44')]['id']}})[_0x920c('0x24')](handleEntityNotFound(_0x5cc1fb,null))[_0x920c('0x24')](removeEntity(_0x5cc1fb,null))['catch'](handleError(_0x5cc1fb,null));};exports[_0x920c('0x2d')]=function(_0x229d29,_0x2b8a05){return db[_0x920c('0x2c')][_0x920c('0x2d')]()['then'](respondWithResult(_0x2b8a05,null))[_0x920c('0x42')](handleError(_0x2b8a05,null));};exports['addContacts']=function(_0x69be80,_0x445e4a,_0x1dab47){return db['CmContact'][_0x920c('0x46')]({'where':{'id':_0x69be80[_0x920c('0x44')]['id']}})['then'](handleEntityNotFound(_0x445e4a,null))[_0x920c('0x24')](function(_0x5dc276){if(_0x5dc276){return _0x5dc276['addContacts'](_0x69be80[_0x920c('0x48')][_0x920c('0x51')],_[_0x920c('0x52')](_0x69be80[_0x920c('0x48')],[_0x920c('0x51'),'id'])||{});}})[_0x920c('0x24')](respondWithResult(_0x445e4a,null))[_0x920c('0x42')](handleError(_0x445e4a,null));};exports[_0x920c('0x53')]=function(_0x5e5611,_0x13eba0,_0x45872a){var _0x37511b={};var _0x377480={};var _0x52582a;var _0x51b825;return db[_0x920c('0x2c')]['findOne']({'where':{'id':_0x5e5611['params']['id']}})[_0x920c('0x24')](handleEntityNotFound(_0x13eba0,null))[_0x920c('0x24')](function(_0x10c260){if(_0x10c260){_0x52582a=_0x10c260;_0x377480['model']=_[_0x920c('0x2f')](db[_0x920c('0x54')]['rawAttributes']);_0x377480[_0x920c('0x30')]=_[_0x920c('0x2f')](_0x5e5611[_0x920c('0x30')]);_0x377480[_0x920c('0x3a')]=_[_0x920c('0x32')](_0x377480[_0x920c('0x2e')],_0x377480['query']);_0x37511b[_0x920c('0x31')]=_['intersection'](_0x377480['model'],qs[_0x920c('0x33')](_0x5e5611['query'][_0x920c('0x33')]));_0x37511b['attributes']=_0x37511b[_0x920c('0x31')][_0x920c('0x34')]?_0x37511b[_0x920c('0x31')]:_0x377480[_0x920c('0x2e')];_0x37511b['order']=qs[_0x920c('0x38')](_0x5e5611[_0x920c('0x30')][_0x920c('0x38')]);_0x37511b[_0x920c('0x39')]=qs[_0x920c('0x3a')](_[_0x920c('0x55')](_0x5e5611[_0x920c('0x30')],_0x377480['filters']));if(_0x5e5611[_0x920c('0x30')]['filter']){_0x37511b['where']=_['merge'](_0x37511b[_0x920c('0x39')],{'$or':_[_0x920c('0x3d')](_0x37511b[_0x920c('0x31')],function(_0x37735b){var _0x3215fd={};_0x3215fd[_0x37735b]={'$like':'%'+_0x5e5611[_0x920c('0x30')]['filter']+'%'};return _0x3215fd;})});}_0x37511b=_['merge']({},_0x37511b,_0x5e5611['options']);return _0x52582a[_0x920c('0x53')](_0x37511b);}})[_0x920c('0x24')](function(_0x464ac0){if(_0x464ac0){_0x51b825=_0x464ac0[_0x920c('0x34')];if(!_0x5e5611[_0x920c('0x30')][_0x920c('0x35')](_0x920c('0x36'))){_0x37511b[_0x920c('0x1d')]=qs[_0x920c('0x1d')](_0x5e5611['query']['limit']);_0x37511b[_0x920c('0x1b')]=qs[_0x920c('0x1b')](_0x5e5611['query'][_0x920c('0x1b')]);}return _0x52582a['getContacts'](_0x37511b);}})[_0x920c('0x24')](function(_0x292938){if(_0x292938){return _0x292938?{'count':_0x51b825,'rows':_0x292938}:null;}})[_0x920c('0x24')](respondWithResult(_0x13eba0,null))[_0x920c('0x42')](handleError(_0x13eba0,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 1ab31fb..93a7363 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 _0xff8a=['path','rimraf','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xff8a,0x125));var _0xaff8=function(_0x4cc7e2,_0x2e0da0){_0x4cc7e2=_0x4cc7e2-0x0;var _0x421758=_0xff8a[_0x4cc7e2];return _0x421758;};'use strict';var _=require(_0xaff8('0x0'));var util=require(_0xaff8('0x1'));var logger=require(_0xaff8('0x2'))(_0xaff8('0x3'));var moment=require('moment');var BPromise=require(_0xaff8('0x4'));var rp=require(_0xaff8('0x5'));var fs=require('fs');var path=require(_0xaff8('0x6'));var rimraf=require(_0xaff8('0x7'));var config=require('../../config/environment');var attributes=require(_0xaff8('0x8'));module[_0xaff8('0x9')]=function(_0x3fc12e,_0x2c0419){return _0x3fc12e[_0xaff8('0xa')](_0xaff8('0xb'),attributes,{'tableName':_0xaff8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x892c=['define','CmCompany','cm_companies','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes'];(function(_0x158173,_0x14c6f1){var _0x130636=function(_0x5b48d4){while(--_0x5b48d4){_0x158173['push'](_0x158173['shift']());}};_0x130636(++_0x14c6f1);}(_0x892c,0x1c6));var _0xc892=function(_0x59af24,_0x201f0e){_0x59af24=_0x59af24-0x0;var _0x5d79d4=_0x892c[_0x59af24];return _0x5d79d4;};'use strict';var _=require(_0xc892('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc892('0x1'));var moment=require(_0xc892('0x2'));var BPromise=require(_0xc892('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc892('0x4'));var rimraf=require(_0xc892('0x5'));var config=require(_0xc892('0x6'));var attributes=require(_0xc892('0x7'));module['exports']=function(_0x53039c,_0x5539bb){return _0x53039c[_0xc892('0x8')](_0xc892('0x9'),attributes,{'tableName':_0xc892('0xa'),'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 6ce9c37..3b49f2f 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 _0x4805=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','util'];(function(_0x254af0,_0x377502){var _0x1334d6=function(_0x39efd1){while(--_0x39efd1){_0x254af0['push'](_0x254af0['shift']());}};_0x1334d6(++_0x377502);}(_0x4805,0x175));var _0x5480=function(_0x40ae49,_0x47c4b7){_0x40ae49=_0x40ae49-0x0;var _0x4a9b15=_0x4805[_0x40ae49];return _0x4a9b15;};'use strict';var _=require('lodash');var util=require(_0x5480('0x0'));var moment=require('moment');var BPromise=require(_0x5480('0x1'));var rs=require(_0x5480('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5480('0x3'))['db'];var utils=require(_0x5480('0x4'));var logger=require('../../config/logger')(_0x5480('0x5'));var config=require(_0x5480('0x6'));var jayson=require(_0x5480('0x7'));var client=jayson[_0x5480('0x8')][_0x5480('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf8bf87,_0x208dd6,_0x228fe9){return new BPromise(function(_0x2a0907,_0x125126){return client[_0x5480('0xa')](_0xf8bf87,_0x228fe9)[_0x5480('0xb')](function(_0x251085){logger[_0x5480('0xc')]('CmCompany,\x20%s,\x20%s',_0x208dd6,_0x5480('0xd'));logger[_0x5480('0xe')](_0x5480('0xf'),_0x208dd6,_0x5480('0xd'),JSON[_0x5480('0x10')](_0x251085));if(_0x251085[_0x5480('0x11')]){if(_0x251085['error'][_0x5480('0x12')]===0x1f4){logger[_0x5480('0x11')](_0x5480('0x13'),_0x208dd6,_0x251085[_0x5480('0x11')][_0x5480('0x14')]);return _0x125126(_0x251085['error'][_0x5480('0x14')]);}logger['error'](_0x5480('0x13'),_0x208dd6,_0x251085['error'][_0x5480('0x14')]);return _0x2a0907(_0x251085[_0x5480('0x11')][_0x5480('0x14')]);}else{logger[_0x5480('0xc')](_0x5480('0x13'),_0x208dd6,_0x5480('0xd'));_0x2a0907(_0x251085[_0x5480('0x15')][_0x5480('0x14')]);}})['catch'](function(_0x1d501b){logger['error']('CmCompany,\x20%s,\x20%s',_0x208dd6,_0x1d501b);_0x125126(_0x1d501b);});});} \ No newline at end of file +var _0xda01=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash'];(function(_0x11c7dd,_0x21161d){var _0x8dbaa=function(_0x47c712){while(--_0x47c712){_0x11c7dd['push'](_0x11c7dd['shift']());}};_0x8dbaa(++_0x21161d);}(_0xda01,0x149));var _0x1da0=function(_0x3ef7e6,_0x35bbde){_0x3ef7e6=_0x3ef7e6-0x0;var _0x64c634=_0xda01[_0x3ef7e6];return _0x64c634;};'use strict';var _=require(_0x1da0('0x0'));var util=require(_0x1da0('0x1'));var moment=require(_0x1da0('0x2'));var BPromise=require(_0x1da0('0x3'));var rs=require(_0x1da0('0x4'));var fs=require('fs');var Redis=require(_0x1da0('0x5'));var db=require(_0x1da0('0x6'))['db'];var utils=require(_0x1da0('0x7'));var logger=require('../../config/logger')(_0x1da0('0x8'));var config=require(_0x1da0('0x9'));var jayson=require(_0x1da0('0xa'));var client=jayson[_0x1da0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x474ecc,_0x1eb622,_0x405d72){return new BPromise(function(_0x376276,_0x4878fa){return client[_0x1da0('0xc')](_0x474ecc,_0x405d72)['then'](function(_0x2cfee7){logger['info'](_0x1da0('0xd'),_0x1eb622,_0x1da0('0xe'));logger[_0x1da0('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x1eb622,'request\x20sent',JSON[_0x1da0('0x10')](_0x2cfee7));if(_0x2cfee7['error']){if(_0x2cfee7[_0x1da0('0x11')]['code']===0x1f4){logger[_0x1da0('0x11')](_0x1da0('0xd'),_0x1eb622,_0x2cfee7[_0x1da0('0x11')]['message']);return _0x4878fa(_0x2cfee7['error'][_0x1da0('0x12')]);}logger[_0x1da0('0x11')](_0x1da0('0xd'),_0x1eb622,_0x2cfee7[_0x1da0('0x11')][_0x1da0('0x12')]);return _0x376276(_0x2cfee7[_0x1da0('0x11')][_0x1da0('0x12')]);}else{logger[_0x1da0('0x13')]('CmCompany,\x20%s,\x20%s',_0x1eb622,'request\x20sent');_0x376276(_0x2cfee7[_0x1da0('0x14')][_0x1da0('0x12')]);}})[_0x1da0('0x15')](function(_0xa166d8){logger[_0x1da0('0x11')](_0x1da0('0xd'),_0x1eb622,_0xa166d8);_0x4878fa(_0xa166d8);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 02bc18e..09835d7 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 _0xbac8=['/:id/contacts','getContacts','post','addContacts','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xbac8,0x1ec));var _0x8bac=function(_0x308ce1,_0x3420c7){_0x308ce1=_0x308ce1-0x0;var _0xdd1bf7=_0xbac8[_0x308ce1];return _0xdd1bf7;};'use strict';var multer=require('multer');var util=require(_0x8bac('0x0'));var path=require(_0x8bac('0x1'));var timeout=require(_0x8bac('0x2'));var express=require(_0x8bac('0x3'));var router=express[_0x8bac('0x4')]();var fs_extra=require(_0x8bac('0x5'));var auth=require(_0x8bac('0x6'));var interaction=require(_0x8bac('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router['get']('/',auth[_0x8bac('0x8')](),controller[_0x8bac('0x9')]);router[_0x8bac('0xa')](_0x8bac('0xb'),auth[_0x8bac('0x8')](),controller['describe']);router[_0x8bac('0xa')](_0x8bac('0xc'),auth[_0x8bac('0x8')](),controller[_0x8bac('0xd')]);router[_0x8bac('0xa')](_0x8bac('0xe'),auth[_0x8bac('0x8')](),controller[_0x8bac('0xf')]);router['post']('/',auth[_0x8bac('0x8')](),controller['create']);router[_0x8bac('0x10')](_0x8bac('0xe'),auth[_0x8bac('0x8')](),controller[_0x8bac('0x11')]);router[_0x8bac('0x12')]('/:id',auth[_0x8bac('0x8')](),controller[_0x8bac('0x13')]);router['delete'](_0x8bac('0xc'),auth['isAuthenticated'](),controller[_0x8bac('0x14')]);module[_0x8bac('0x15')]=router; \ No newline at end of file +var _0x7d58=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','delete'];(function(_0x1f9e96,_0x567642){var _0x3fcf87=function(_0x2a7747){while(--_0x2a7747){_0x1f9e96['push'](_0x1f9e96['shift']());}};_0x3fcf87(++_0x567642);}(_0x7d58,0xde));var _0x87d5=function(_0x533676,_0x2be01c){_0x533676=_0x533676-0x0;var _0x32f7bd=_0x7d58[_0x533676];return _0x32f7bd;};'use strict';var multer=require(_0x87d5('0x0'));var util=require(_0x87d5('0x1'));var path=require(_0x87d5('0x2'));var timeout=require('connect-timeout');var express=require(_0x87d5('0x3'));var router=express[_0x87d5('0x4')]();var fs_extra=require(_0x87d5('0x5'));var auth=require(_0x87d5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x87d5('0x7')]('/',auth[_0x87d5('0x8')](),controller[_0x87d5('0x9')]);router[_0x87d5('0x7')]('/describe',auth[_0x87d5('0x8')](),controller[_0x87d5('0xa')]);router['get'](_0x87d5('0xb'),auth['isAuthenticated'](),controller[_0x87d5('0xc')]);router[_0x87d5('0x7')](_0x87d5('0xd'),auth[_0x87d5('0x8')](),controller[_0x87d5('0xe')]);router[_0x87d5('0xf')]('/',auth[_0x87d5('0x8')](),controller[_0x87d5('0x10')]);router[_0x87d5('0xf')](_0x87d5('0xd'),auth[_0x87d5('0x8')](),controller[_0x87d5('0x11')]);router['put'](_0x87d5('0xb'),auth[_0x87d5('0x8')](),controller[_0x87d5('0x12')]);router[_0x87d5('0x13')](_0x87d5('0xb'),auth['isAuthenticated'](),controller[_0x87d5('0x14')]);module[_0x87d5('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 25f28cb..078e3d1 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 _0x6b2a=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','sequelize','exports'];(function(_0x35cc19,_0x3deb10){var _0x4d0efa=function(_0x5e96d8){while(--_0x5e96d8){_0x35cc19['push'](_0x35cc19['shift']());}};_0x4d0efa(++_0x3deb10);}(_0x6b2a,0x146));var _0xa6b2=function(_0x3bd5fb,_0x1e5220){_0x3bd5fb=_0x3bd5fb-0x0;var _0x4849d4=_0x6b2a[_0x3bd5fb];return _0x4849d4;};'use strict';var _=require('lodash');var Sequelize=require(_0xa6b2('0x0'));module[_0xa6b2('0x1')]={'firstName':{'type':Sequelize[_0xa6b2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xa6b2('0x2')]},'postalCode':{'type':Sequelize[_0xa6b2('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xa6b2('0x2')]},'dateOfBirth':{'type':Sequelize[_0xa6b2('0x2')]},'description':{'type':Sequelize[_0xa6b2('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xa6b2('0x2')]},'fax':{'type':Sequelize[_0xa6b2('0x2')]},'email':{'type':Sequelize[_0xa6b2('0x2')]},'url':{'type':Sequelize[_0xa6b2('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xa6b2('0x2')]},'teams':{'type':Sequelize[_0xa6b2('0x2')]},'viber':{'type':Sequelize[_0xa6b2('0x2')]},'line':{'type':Sequelize[_0xa6b2('0x2')]},'wechat':{'type':Sequelize[_0xa6b2('0x2')]},'telegram':{'type':Sequelize[_0xa6b2('0x2')]},'UserId':{'type':Sequelize[_0xa6b2('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xa6b2('0x2')]},'priority':{'type':Sequelize[_0xa6b2('0x4')](0x2)[_0xa6b2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xa6b2('0x6')],'defaultValue':Sequelize[_0xa6b2('0x7')]},'dialTimezone':{'type':Sequelize[_0xa6b2('0x2')]},'utcOffset':{'type':Sequelize[_0xa6b2('0x4')]}}; \ No newline at end of file +var _0x03de=['INTEGER','DATE','NOW','lodash','exports','STRING'];(function(_0x36e3bd,_0x201c77){var _0xdc68e=function(_0x3691c2){while(--_0x3691c2){_0x36e3bd['push'](_0x36e3bd['shift']());}};_0xdc68e(++_0x201c77);}(_0x03de,0x18f));var _0xe03d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x03de[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe03d('0x0'));var Sequelize=require('sequelize');module[_0xe03d('0x1')]={'firstName':{'type':Sequelize[_0xe03d('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xe03d('0x2')]},'street':{'type':Sequelize[_0xe03d('0x2')]},'postalCode':{'type':Sequelize[_0xe03d('0x2')]},'city':{'type':Sequelize[_0xe03d('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xe03d('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xe03d('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xe03d('0x2')]},'url':{'type':Sequelize[_0xe03d('0x2')]},'facebook':{'type':Sequelize[_0xe03d('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xe03d('0x2')]},'line':{'type':Sequelize[_0xe03d('0x2')]},'wechat':{'type':Sequelize[_0xe03d('0x2')]},'telegram':{'type':Sequelize[_0xe03d('0x2')]},'UserId':{'type':Sequelize[_0xe03d('0x3')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe03d('0x4')],'defaultValue':Sequelize[_0xe03d('0x5')]},'dialTimezone':{'type':Sequelize[_0xe03d('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 8151b41..0037346 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(_0x5c2c7c,_0xa7d3b1){var _0xea7ffe=function(_0x471f17){while(--_0x471f17){_0x5c2c7c['push'](_0x5c2c7c['shift']());}};_0xea7ffe(++_0xa7d3b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 56f8bf9..9ec8a73 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 _0xda8e=['emit','hook','exports','events','../../mysqldb','CmContact','save','update','remove'];(function(_0x520f7e,_0x67518d){var _0x587f49=function(_0x226a93){while(--_0x226a93){_0x520f7e['push'](_0x520f7e['shift']());}};_0x587f49(++_0x67518d);}(_0xda8e,0x174));var _0xeda8=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0xda8e[_0x1e48d3];return _0x2852b1;};'use strict';var EventEmitter=require(_0xeda8('0x0'));var CmContact=require(_0xeda8('0x1'))['db'][_0xeda8('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeda8('0x3'),'afterUpdate':_0xeda8('0x4'),'afterDestroy':_0xeda8('0x5')};function emitEvent(_0x3cec5f){return function(_0x5e1d2,_0x43fcfe,_0x51bdb4){CmContactEvents[_0xeda8('0x6')](_0x3cec5f+':'+_0x5e1d2['id'],_0x5e1d2);CmContactEvents[_0xeda8('0x6')](_0x3cec5f,_0x5e1d2);_0x51bdb4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xeda8('0x7')](e,emitEvent(event));}}module[_0xeda8('0x8')]=CmContactEvents; \ No newline at end of file +var _0x6c56=['CmContact','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x24abb2,_0x2ba59e){var _0x4e59a9=function(_0x1c76a2){while(--_0x1c76a2){_0x24abb2['push'](_0x24abb2['shift']());}};_0x4e59a9(++_0x2ba59e);}(_0x6c56,0x148));var _0x66c5=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0x6c56[_0x4a209a];return _0x4b3c20;};'use strict';var EventEmitter=require(_0x66c5('0x0'));var CmContact=require(_0x66c5('0x1'))['db'][_0x66c5('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x66c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x66c5('0x4'),'afterDestroy':_0x66c5('0x5')};function emitEvent(_0x59b15b){return function(_0x19fffe,_0x4e51a7,_0x12c3d5){CmContactEvents[_0x66c5('0x6')](_0x59b15b+':'+_0x19fffe['id'],_0x19fffe);CmContactEvents[_0x66c5('0x6')](_0x59b15b,_0x19fffe);_0x12c3d5(null);};}for(var e in events){if(events[_0x66c5('0x7')](e)){var event=events[e];CmContact[_0x66c5('0x8')](e,emitEvent(event));}}module[_0x66c5('0x9')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index 3164204..8e66d6e 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 _0x19ec=['CmList','Lists','length','onlyIfOpen','BlackLists','CmHopperBlack','always','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','exports','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','utf8mb4','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','then','isNil','utcOffset','add','CmHopper','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','cmContact','Campaign','timezones','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','dialCheckDuplicateType'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0x19ec,0x13a));var _0xc19e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x19ec[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xc19e('0x0'));var util=require(_0xc19e('0x1'));var logger=require('../../config/logger')(_0xc19e('0x2'));var moment=require(_0xc19e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc19e('0x4'));var fs=require('fs');var path=require(_0xc19e('0x5'));var rimraf=require(_0xc19e('0x6'));var config=require(_0xc19e('0x7'));var shared=require(_0xc19e('0x8'));var attributes=require('./cmContact.attributes');module[_0xc19e('0x9')]=function(_0x1ab753,_0xad33f8){return _0x1ab753['define']('CmContact',attributes,{'tableName':_0xc19e('0xa'),'paranoid':!![],'indexes':[{'name':_0xc19e('0xb'),'fields':['phone']},{'name':_0xc19e('0xc'),'fields':[_0xc19e('0xd'),_0xc19e('0xe'),_0xc19e('0xb'),_0xc19e('0xf'),_0xc19e('0x10'),'email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xc19e('0x11'),'collate':_0xc19e('0x12'),'hooks':{'afterCreate':function(_0xb65c4b,_0xa7bb80,_0x49c3de){var _0x12910d=_0x1ab753[_0xc19e('0x13')];var _0x255254=_0xb65c4b[_0xc19e('0x14')]({'plain':!![]});function _0x22c0be(){return function(_0x2ecc14){logger[_0xc19e('0x15')]('cmContact',_0xc19e('0x16'),util[_0xc19e('0x17')](_0x2ecc14,{'showHidden':![],'depth':null}));};}function _0x145ad1(_0x192b95,_0x302c67){var _0x19d159=_0x302c67[_0xc19e('0x18')]?_0x302c67[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a'));return new BPromise(function(_0x28e979,_0x490c53){if(_['isNil'](_0x302c67[_0xc19e('0x1b')])){_0x28e979({'ret':_0x19d159});}else{_0x12910d['VoiceQueue']['findOne']({'where':{'id':_0x192b95['id']}})[_0xc19e('0x1c')](function(_0x58878f){if(!_[_0xc19e('0x1d')](_0x58878f)){var _0x2b7912=_0x58878f['dialTimezone'];if(!_['isNil'](_0x2b7912)){var _0x3cfde2=shared['timezones'];var _0x1e5b6e=_0x3cfde2[_0x2b7912];var _0x4e1374=_0x3cfde2[_0x302c67[_0xc19e('0x1b')]];if(!_[_0xc19e('0x1d')](_0x1e5b6e)&&!_[_0xc19e('0x1d')](_0x4e1374)){var _0x282dca=_0x1e5b6e['utcOffset']-_0x4e1374[_0xc19e('0x1e')];_0x19d159=_0x302c67[_0xc19e('0x18')]?_0x302c67[_0xc19e('0x18')]:moment();var _0x52edc3=moment(_0x19d159)[_0xc19e('0x1f')](_0x282dca,'minutes');_0x28e979({'ret':_0x52edc3['format'](_0xc19e('0x1a'))});}else _0x28e979({'ret':_0x19d159});}else _0x28e979({'ret':_0x19d159});}else{_0x28e979({'ret':_0x19d159});}});}});return 0xa;}var _0x214402=function(_0xf6a63c){return new BPromise(function(_0x2e1415,_0x406f32){_0x145ad1(_0xf6a63c,_0x255254)[_0xc19e('0x1c')](function(_0x22dec7){_0x255254[_0xc19e('0x18')]=_0x22dec7['ret'];_0x12910d[_0xc19e('0x20')][_0xc19e('0x21')]({'where':{'phone':_0x255254[_0xc19e('0xb')],'VoiceQueueId':_0xf6a63c['id']}})[_0xc19e('0x1c')](function(_0x1ec198){if(!_[_0xc19e('0x1d')](_0x1ec198)){throw new Error(_0xc19e('0x22')+_0x255254[_0xc19e('0xb')]+_0xc19e('0x23')+_0xf6a63c['id']);}return _0x12910d[_0xc19e('0x20')][_0xc19e('0x24')]({'phone':_0x255254['phone'],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'priority':_0x255254[_0xc19e('0x26')]?_0x255254[_0xc19e('0x26')]:0x2,'scheduledat':_0x255254['scheduledat']?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254[_0xc19e('0x27')]:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()[_0xc19e('0x19')](_0xc19e('0x1a')):undefined,'VoiceQueueId':_0xf6a63c['id']});})['catch'](function(_0x3048c6){_0x406f32(_0x3048c6);});});});};var _0x5b8a98=function(_0x51b8ee){return new BPromise(function(_0x593890,_0x251b80){_0x145ad1(_0x51b8ee,_0x255254)['then'](function(_0x1fe5fe){_0x255254[_0xc19e('0x18')]=_0x1fe5fe[_0xc19e('0x28')];_0x12910d['CmHopper'][_0xc19e('0x21')]({'where':{'phone':_0x255254['phone'],'VoiceQueueId':_0x51b8ee['id']}})[_0xc19e('0x1c')](function(_0x38153d){if(!_['isNil'](_0x38153d)){throw new Error(_0xc19e('0x22')+_0x255254[_0xc19e('0xb')]+_0xc19e('0x29')+_0x51b8ee['id']);}return _0x12910d[_0xc19e('0x2a')][_0xc19e('0x21')]({'where':{'calleridnum':_0x255254['phone'],'VoiceQueueId':_0x51b8ee['id']}});})[_0xc19e('0x1c')](function(_0xd82502){if(!_[_0xc19e('0x1d')](_0xd82502)){throw new Error(_0xc19e('0x2b')+_0x255254['phone']+_0xc19e('0x2c')+_0x51b8ee['id']);}return _0x12910d['CmHopper'][_0xc19e('0x24')]({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'priority':_0x255254[_0xc19e('0x26')]?_0x255254['priority']:0x2,'scheduledat':_0x255254[_0xc19e('0x18')]?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254['callbackUniqueid']:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x51b8ee['id']});})['catch'](function(_0x3bbf21){_0x251b80(_0x3bbf21);});});});};function _0x465ca2(){return function(_0x57a5a4){logger[_0xc19e('0x15')](_0xc19e('0x2d'),_0xc19e('0x16'),util[_0xc19e('0x17')](_0x57a5a4,{'showHidden':![],'depth':null}));};}function _0x518131(_0x3284a3,_0x1b2ea0){var _0x132a3b=_0x1b2ea0['scheduledat']?_0x1b2ea0[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a'));return new BPromise(function(_0x1d7434,_0x460038){if(_[_0xc19e('0x1d')](_0x1b2ea0[_0xc19e('0x1b')])){_0x1d7434({'ret':_0x132a3b});}else{_0x12910d[_0xc19e('0x2e')]['findOne']({'where':{'id':_0x3284a3['id']}})[_0xc19e('0x1c')](function(_0x3c466b){if(!_['isNil'](_0x3c466b)){var _0x5e116f=_0x3c466b['dialTimezone'];if(!_[_0xc19e('0x1d')](_0x5e116f)){var _0xb5e8f3=shared[_0xc19e('0x2f')];var _0x10df14=_0xb5e8f3[_0x5e116f];var _0x39f3d5=_0xb5e8f3[_0x1b2ea0['dialTimezone']];if(!_['isNil'](_0x10df14)&&!_[_0xc19e('0x1d')](_0x39f3d5)){var _0x571629=_0x10df14['utcOffset']-_0x39f3d5[_0xc19e('0x1e')];_0x132a3b=_0x1b2ea0[_0xc19e('0x18')]?_0x1b2ea0['scheduledat']:moment();var _0xbb7ca=moment(_0x132a3b)[_0xc19e('0x1f')](_0x571629,_0xc19e('0x30'));_0x1d7434({'ret':_0xbb7ca['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1d7434({'ret':_0x132a3b});}else _0x1d7434({'ret':_0x132a3b});}else{_0x1d7434({'ret':_0x132a3b});}});}});return 0xa;}var _0x28e72c=function(_0x82ac){return new BPromise(function(_0x4d0b21,_0x3b5b9d){_0x518131(_0x82ac,_0x255254)[_0xc19e('0x1c')](function(_0x185231){_0x255254[_0xc19e('0x18')]=_0x185231[_0xc19e('0x28')];_0x12910d['CmHopper'][_0xc19e('0x21')]({'where':{'phone':_0x255254[_0xc19e('0xb')],'CampaignId':_0x82ac['id']}})[_0xc19e('0x1c')](function(_0x1edbd6){if(!_[_0xc19e('0x1d')](_0x1edbd6)){throw new Error(_0xc19e('0x22')+_0x255254[_0xc19e('0xb')]+_0xc19e('0x31')+_0x82ac['id']);}return _0x12910d['CmHopper']['create']({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'priority':_0x255254[_0xc19e('0x26')]?_0x255254['priority']:0x2,'scheduledat':_0x255254['scheduledat']?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'callback':_0x255254['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254['callbackUniqueid']:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()[_0xc19e('0x19')](_0xc19e('0x1a')):undefined,'CampaignId':_0x82ac['id']});})[_0xc19e('0x32')](function(_0x35029f){_0x3b5b9d(_0x35029f);});});});};var _0x1e2256=function(_0x1a55b4){return new BPromise(function(_0x68205d,_0x54d2b3){_0x518131(_0x1a55b4,_0x255254)[_0xc19e('0x1c')](function(_0x3f71c2){_0x255254['scheduledat']=_0x3f71c2[_0xc19e('0x28')];_0x12910d['CmHopper'][_0xc19e('0x21')]({'where':{'phone':_0x255254[_0xc19e('0xb')],'CampaignId':_0x1a55b4['id']}})[_0xc19e('0x1c')](function(_0x4f1c0a){if(!_['isNil'](_0x4f1c0a)){throw new Error(_0xc19e('0x22')+_0x255254['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1a55b4['id']);}return _0x12910d['CmHopperFinal'][_0xc19e('0x21')]({'where':{'calleridnum':_0x255254[_0xc19e('0xb')],'CampaignId':_0x1a55b4['id']}});})[_0xc19e('0x1c')](function(_0x4ac989){if(!_[_0xc19e('0x1d')](_0x4ac989)){throw new Error(_0xc19e('0x2b')+_0x255254[_0xc19e('0xb')]+_0xc19e('0x33')+_0x1a55b4['id']);}return _0x12910d[_0xc19e('0x20')][_0xc19e('0x24')]({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'priority':_0x255254[_0xc19e('0x26')]?_0x255254[_0xc19e('0x26')]:0x2,'scheduledat':_0x255254[_0xc19e('0x18')]?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254[_0xc19e('0x27')]:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()['format'](_0xc19e('0x1a')):undefined,'CampaignId':_0x1a55b4['id']});})[_0xc19e('0x32')](function(_0x51f71f){_0x54d2b3(_0x51f71f);});});});};if(_0x255254['ListId']){_0x12910d[_0xc19e('0x34')][_0xc19e('0x35')]({'where':{'type':_0xc19e('0x36')},'attributes':['id',_0xc19e('0x37'),_0xc19e('0x1b')],'include':[{'model':_0x12910d[_0xc19e('0x38')],'as':_0xc19e('0x39'),'where':{'id':_0x255254[_0xc19e('0x25')]}}]})[_0xc19e('0x1c')](function(_0x1c2314){if(_0x1c2314){var _0x21776c=[];for(var _0x548cf4=0x0,_0xfcab94;_0x548cf4<_0x1c2314[_0xc19e('0x3a')];_0x548cf4+=0x1){_0xfcab94=_0x1c2314[_0x548cf4][_0xc19e('0x14')]({'plain':!![]});switch(_0xfcab94[_0xc19e('0x37')]){case'always':_0x5b8a98(_0xfcab94)[_0xc19e('0x32')](_0x22c0be());break;case _0xc19e('0x3b'):_0x214402(_0xfcab94)['catch'](_0x22c0be());break;default:_0x518131(_0xfcab94,_0x255254)[_0xc19e('0x1c')](function(_0x2f94fe){_0x255254[_0xc19e('0x18')]=_0x2f94fe[_0xc19e('0x28')];_0x12910d[_0xc19e('0x20')][_0xc19e('0x24')]({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'scheduledat':_0x255254[_0xc19e('0x18')]?_0x255254['scheduledat']:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'priority':_0x255254[_0xc19e('0x26')]?_0x255254[_0xc19e('0x26')]:0x2,'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254[_0xc19e('0x27')]:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()[_0xc19e('0x19')](_0xc19e('0x1a')):undefined,'VoiceQueueId':_0xfcab94['id']})[_0xc19e('0x32')](_0x22c0be());});}}}})[_0xc19e('0x1c')](function(){return _0x12910d[_0xc19e('0x34')][_0xc19e('0x35')]({'where':{'type':_0xc19e('0x36')},'attributes':['id'],'include':[{'model':_0x12910d[_0xc19e('0x38')],'as':_0xc19e('0x3c'),'where':{'id':_0x255254[_0xc19e('0x25')]}}]})['then'](function(_0x2142d0){if(_0x2142d0){var _0x262f3a=[];for(var _0xdccbea=0x0,_0x353c4b;_0xdccbea<_0x2142d0[_0xc19e('0x3a')];_0xdccbea+=0x1){_0x353c4b=_0x2142d0[_0xdccbea][_0xc19e('0x14')]({'plain':!![]});_0x12910d[_0xc19e('0x3d')][_0xc19e('0x24')]({'phone':_0x255254[_0xc19e('0xb')],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'VoiceQueueId':_0x353c4b['id']})['catch'](function(_0x56b826){logger[_0xc19e('0x15')]('cmContact,\x20%s,\x20%s','afterCreate',_0x56b826['message']);});}}});})[_0xc19e('0x1c')](function(){return _0x12910d[_0xc19e('0x2e')][_0xc19e('0x35')]({'attributes':['id',_0xc19e('0x37'),_0xc19e('0x1b')],'include':[{'model':_0x12910d['CmList'],'as':_0xc19e('0x39'),'where':{'id':_0x255254[_0xc19e('0x25')]}}]})[_0xc19e('0x1c')](function(_0x1c6944){if(_0x1c6944){var _0x1f2a99=[];for(var _0x498a68=0x0,_0x5b62a9;_0x498a68<_0x1c6944[_0xc19e('0x3a')];_0x498a68+=0x1){_0x5b62a9=_0x1c6944[_0x498a68][_0xc19e('0x14')]({'plain':!![]});switch(_0x5b62a9[_0xc19e('0x37')]){case _0xc19e('0x3e'):_0x1e2256(_0x5b62a9)[_0xc19e('0x32')](_0x465ca2());break;case _0xc19e('0x3b'):_0x28e72c(_0x5b62a9)[_0xc19e('0x32')](_0x465ca2());break;default:_0x12910d[_0xc19e('0x20')][_0xc19e('0x24')]({'phone':_0x255254['phone'],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'scheduledat':_0x255254[_0xc19e('0x18')]?_0x255254[_0xc19e('0x18')]:moment()[_0xc19e('0x19')](_0xc19e('0x1a')),'priority':_0x255254[_0xc19e('0x26')]?_0x255254[_0xc19e('0x26')]:0x2,'callback':_0x255254[_0xc19e('0x27')]?!![]:![],'callbackuniqueid':_0x255254[_0xc19e('0x27')]?_0x255254['callbackUniqueid']:undefined,'callbackat':_0x255254[_0xc19e('0x27')]?moment()[_0xc19e('0x19')](_0xc19e('0x1a')):undefined,'CampaignId':_0x5b62a9['id']})[_0xc19e('0x32')](_0x465ca2());}}}});})[_0xc19e('0x1c')](function(){return _0x12910d[_0xc19e('0x2e')][_0xc19e('0x35')]({'attributes':['id'],'include':[{'model':_0x12910d['CmList'],'as':_0xc19e('0x3c'),'where':{'id':_0x255254[_0xc19e('0x25')]}}]})[_0xc19e('0x1c')](function(_0x412010){if(_0x412010){var _0x26dace=[];for(var _0x94e94a=0x0,_0x33ba23;_0x94e94a<_0x412010[_0xc19e('0x3a')];_0x94e94a+=0x1){_0x33ba23=_0x412010[_0x94e94a][_0xc19e('0x14')]({'plain':!![]});_0x12910d[_0xc19e('0x3d')][_0xc19e('0x24')]({'phone':_0x255254['phone'],'ContactId':_0x255254['id'],'ListId':_0x255254[_0xc19e('0x25')],'CampaignId':_0x33ba23['id']})['catch'](function(_0x5dc263){logger[_0xc19e('0x15')](_0xc19e('0x3f'),_0xc19e('0x16'),_0x5dc263[_0xc19e('0x40')]);});}}});})[_0xc19e('0x1c')](function(){_0x49c3de();})['catch'](function(_0x2c4991){logger[_0xc19e('0x15')](_0xc19e('0x3f'),'afterCreate',_0x2c4991[_0xc19e('0x40')]);_0x49c3de(_0x2c4991);});}else{_0x49c3de(new Error(_0xc19e('0x41')));}},'afterDestroy':function(_0x222655,_0x3697b,_0x1d950a){var _0x370f6a=_0x1ab753[_0xc19e('0x13')];var _0x289465=_0x222655[_0xc19e('0x14')]({'plain':!![]});return _0x370f6a[_0xc19e('0x20')]['findAll']({'raw':!![],'where':{'ListId':_0x289465[_0xc19e('0x25')],'ContactId':_0x289465['id']}})['then'](function(_0x4615d6){if(!_[_0xc19e('0x42')](_0x4615d6)){var _0x11aac5=[];for(var _0x16c0ab=0x0;_0x16c0ab<_0x4615d6[_0xc19e('0x3a')];_0x16c0ab+=0x1){var _0x2d47b0=_0x370f6a[_0xc19e('0x20')][_0xc19e('0x43')]({'where':{'ListId':_0x4615d6[_0x16c0ab][_0xc19e('0x25')],'ContactId':_0x4615d6[_0x16c0ab]['ContactId'],'VoiceQueueId':_0x4615d6[_0x16c0ab][_0xc19e('0x44')],'CampaignId':_0x4615d6[_0x16c0ab][_0xc19e('0x45')]}});_0x11aac5[_0xc19e('0x46')](_0x2d47b0);}return BPromise['all'](_0x11aac5);}})[_0xc19e('0x1c')](function(_0x15cf3e){logger[_0xc19e('0x47')](_0xc19e('0x48'),util[_0xc19e('0x17')](_0x15cf3e,{'showHidden':![],'depth':null}));_0x1d950a();})[_0xc19e('0x32')](function(_0x4aa356){logger[_0xc19e('0x15')](_0xc19e('0x49'),util[_0xc19e('0x17')](_0x4aa356,{'showHidden':![],'depth':null}));_0x1d950a(_0x4aa356);});}}});}; \ No newline at end of file +var _0x1788=['VoiceQueueId','push','all','info','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../config/environment/shared','define','CmContact','phone','fti_cm_contacts','mobile','email','FULLTEXT','utf8mb4_unicode_ci','models','get','cmContact','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','then','timezones','utcOffset','add','minutes','format','ret','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','length','onlyIfOpen','outbound','BlackLists','CmHopperBlack','error','always','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','destroy','ContactId'];(function(_0x3cfacc,_0xc2e1da){var _0x578ed9=function(_0x4ad239){while(--_0x4ad239){_0x3cfacc['push'](_0x3cfacc['shift']());}};_0x578ed9(++_0xc2e1da);}(_0x1788,0x1b4));var _0x8178=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x1788[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x8178('0x0'));var util=require(_0x8178('0x1'));var logger=require(_0x8178('0x2'))('api');var moment=require(_0x8178('0x3'));var BPromise=require(_0x8178('0x4'));var rp=require(_0x8178('0x5'));var fs=require('fs');var path=require(_0x8178('0x6'));var rimraf=require(_0x8178('0x7'));var config=require(_0x8178('0x8'));var shared=require(_0x8178('0x9'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x23106a,_0x3dbf6f){return _0x23106a[_0x8178('0xa')](_0x8178('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x8178('0xc'),'fields':['phone']},{'name':_0x8178('0xd'),'fields':['firstName','lastName',_0x8178('0xc'),_0x8178('0xe'),'fax',_0x8178('0xf')],'type':_0x8178('0x10')}],'timestamps':!![],'charset':'utf8mb4','collate':_0x8178('0x11'),'hooks':{'afterCreate':function(_0x3cd8ee,_0x28339b,_0x130364){var _0x1580e6=_0x23106a[_0x8178('0x12')];var _0x2b5fdd=_0x3cd8ee[_0x8178('0x13')]({'plain':!![]});function _0x4c9f08(){return function(_0x3ee709){logger['error'](_0x8178('0x14'),_0x8178('0x15'),util[_0x8178('0x16')](_0x3ee709,{'showHidden':![],'depth':null}));};}function _0x5f198d(_0x363199,_0xcd2bc9){var _0x146f20=_0xcd2bc9[_0x8178('0x17')]?_0xcd2bc9[_0x8178('0x17')]:moment()['format'](_0x8178('0x18'));return new BPromise(function(_0x245f6c,_0x37860a){if(_[_0x8178('0x19')](_0xcd2bc9[_0x8178('0x1a')])){_0x245f6c({'ret':_0x146f20});}else{_0x1580e6['VoiceQueue']['findOne']({'where':{'id':_0x363199['id']}})[_0x8178('0x1b')](function(_0x7c44ff){if(!_[_0x8178('0x19')](_0x7c44ff)){var _0x1190fb=_0x7c44ff[_0x8178('0x1a')];if(!_[_0x8178('0x19')](_0x1190fb)){var _0x5e96cf=shared[_0x8178('0x1c')];var _0x4acb7b=_0x5e96cf[_0x1190fb];var _0x34da6e=_0x5e96cf[_0xcd2bc9[_0x8178('0x1a')]];if(!_['isNil'](_0x4acb7b)&&!_[_0x8178('0x19')](_0x34da6e)){var _0x4f867e=_0x4acb7b['utcOffset']-_0x34da6e[_0x8178('0x1d')];_0x146f20=_0xcd2bc9[_0x8178('0x17')]?_0xcd2bc9[_0x8178('0x17')]:moment();var _0x7451ca=moment(_0x146f20)[_0x8178('0x1e')](_0x4f867e,_0x8178('0x1f'));_0x245f6c({'ret':_0x7451ca[_0x8178('0x20')](_0x8178('0x18'))});}else _0x245f6c({'ret':_0x146f20});}else _0x245f6c({'ret':_0x146f20});}else{_0x245f6c({'ret':_0x146f20});}});}});return 0xa;}var _0x1388a3=function(_0x20bf09){return new BPromise(function(_0x40ac3f,_0x45629d){_0x5f198d(_0x20bf09,_0x2b5fdd)[_0x8178('0x1b')](function(_0x4204f4){_0x2b5fdd[_0x8178('0x17')]=_0x4204f4[_0x8178('0x21')];_0x1580e6['CmHopper'][_0x8178('0x22')]({'where':{'phone':_0x2b5fdd['phone'],'VoiceQueueId':_0x20bf09['id']}})[_0x8178('0x1b')](function(_0x1035cf){if(!_['isNil'](_0x1035cf)){throw new Error(_0x8178('0x23')+_0x2b5fdd['phone']+_0x8178('0x24')+_0x20bf09['id']);}return _0x1580e6[_0x8178('0x25')][_0x8178('0x26')]({'phone':_0x2b5fdd[_0x8178('0xc')],'ContactId':_0x2b5fdd['id'],'ListId':_0x2b5fdd['ListId'],'priority':_0x2b5fdd[_0x8178('0x27')]?_0x2b5fdd[_0x8178('0x27')]:0x2,'scheduledat':_0x2b5fdd[_0x8178('0x17')]?_0x2b5fdd[_0x8178('0x17')]:moment()['format'](_0x8178('0x18')),'callback':_0x2b5fdd[_0x8178('0x28')]?!![]:![],'callbackuniqueid':_0x2b5fdd[_0x8178('0x28')]?_0x2b5fdd[_0x8178('0x28')]:undefined,'callbackat':_0x2b5fdd[_0x8178('0x28')]?moment()[_0x8178('0x20')](_0x8178('0x18')):undefined,'VoiceQueueId':_0x20bf09['id']});})[_0x8178('0x29')](function(_0x1f9cfa){_0x45629d(_0x1f9cfa);});});});};var _0x462584=function(_0x48b558){return new BPromise(function(_0x10de3a,_0x1c69ad){_0x5f198d(_0x48b558,_0x2b5fdd)[_0x8178('0x1b')](function(_0x11aa3e){_0x2b5fdd[_0x8178('0x17')]=_0x11aa3e[_0x8178('0x21')];_0x1580e6[_0x8178('0x25')]['findOne']({'where':{'phone':_0x2b5fdd[_0x8178('0xc')],'VoiceQueueId':_0x48b558['id']}})['then'](function(_0x347909){if(!_[_0x8178('0x19')](_0x347909)){throw new Error(_0x8178('0x23')+_0x2b5fdd[_0x8178('0xc')]+_0x8178('0x2a')+_0x48b558['id']);}return _0x1580e6[_0x8178('0x2b')][_0x8178('0x22')]({'where':{'calleridnum':_0x2b5fdd[_0x8178('0xc')],'VoiceQueueId':_0x48b558['id']}});})['then'](function(_0x1d53a5){if(!_['isNil'](_0x1d53a5)){throw new Error(_0x8178('0x2c')+_0x2b5fdd[_0x8178('0xc')]+_0x8178('0x2d')+_0x48b558['id']);}return _0x1580e6[_0x8178('0x25')]['create']({'phone':_0x2b5fdd[_0x8178('0xc')],'ContactId':_0x2b5fdd['id'],'ListId':_0x2b5fdd[_0x8178('0x2e')],'priority':_0x2b5fdd[_0x8178('0x27')]?_0x2b5fdd[_0x8178('0x27')]:0x2,'scheduledat':_0x2b5fdd[_0x8178('0x17')]?_0x2b5fdd['scheduledat']:moment()[_0x8178('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x2b5fdd[_0x8178('0x28')]?!![]:![],'callbackuniqueid':_0x2b5fdd['callbackUniqueid']?_0x2b5fdd['callbackUniqueid']:undefined,'callbackat':_0x2b5fdd[_0x8178('0x28')]?moment()[_0x8178('0x20')](_0x8178('0x18')):undefined,'VoiceQueueId':_0x48b558['id']});})[_0x8178('0x29')](function(_0x64d910){_0x1c69ad(_0x64d910);});});});};function _0x47e03c(){return function(_0x1d915a){logger['error'](_0x8178('0x14'),_0x8178('0x15'),util[_0x8178('0x16')](_0x1d915a,{'showHidden':![],'depth':null}));};}function _0x29a831(_0x33a2cd,_0x3f1546){var _0x207607=_0x3f1546[_0x8178('0x17')]?_0x3f1546[_0x8178('0x17')]:moment()[_0x8178('0x20')](_0x8178('0x18'));return new BPromise(function(_0x47ba41,_0x43908b){if(_['isNil'](_0x3f1546[_0x8178('0x1a')])){_0x47ba41({'ret':_0x207607});}else{_0x1580e6[_0x8178('0x2f')]['findOne']({'where':{'id':_0x33a2cd['id']}})[_0x8178('0x1b')](function(_0x13dbbc){if(!_[_0x8178('0x19')](_0x13dbbc)){var _0x4ba96c=_0x13dbbc['dialTimezone'];if(!_['isNil'](_0x4ba96c)){var _0x54f1b2=shared['timezones'];var _0x6b3e23=_0x54f1b2[_0x4ba96c];var _0x52901d=_0x54f1b2[_0x3f1546[_0x8178('0x1a')]];if(!_[_0x8178('0x19')](_0x6b3e23)&&!_[_0x8178('0x19')](_0x52901d)){var _0x5e50f2=_0x6b3e23[_0x8178('0x1d')]-_0x52901d[_0x8178('0x1d')];_0x207607=_0x3f1546[_0x8178('0x17')]?_0x3f1546[_0x8178('0x17')]:moment();var _0x2bfb1f=moment(_0x207607)[_0x8178('0x1e')](_0x5e50f2,_0x8178('0x1f'));_0x47ba41({'ret':_0x2bfb1f[_0x8178('0x20')](_0x8178('0x18'))});}else _0x47ba41({'ret':_0x207607});}else _0x47ba41({'ret':_0x207607});}else{_0x47ba41({'ret':_0x207607});}});}});return 0xa;}var _0x5c6959=function(_0x3fdc90){return new BPromise(function(_0x333eb9,_0xea36c2){_0x29a831(_0x3fdc90,_0x2b5fdd)[_0x8178('0x1b')](function(_0xdfadf){_0x2b5fdd[_0x8178('0x17')]=_0xdfadf[_0x8178('0x21')];_0x1580e6[_0x8178('0x25')][_0x8178('0x22')]({'where':{'phone':_0x2b5fdd['phone'],'CampaignId':_0x3fdc90['id']}})[_0x8178('0x1b')](function(_0x41dbe8){if(!_[_0x8178('0x19')](_0x41dbe8)){throw new Error(_0x8178('0x23')+_0x2b5fdd[_0x8178('0xc')]+_0x8178('0x30')+_0x3fdc90['id']);}return _0x1580e6[_0x8178('0x25')][_0x8178('0x26')]({'phone':_0x2b5fdd[_0x8178('0xc')],'ContactId':_0x2b5fdd['id'],'ListId':_0x2b5fdd['ListId'],'priority':_0x2b5fdd['priority']?_0x2b5fdd[_0x8178('0x27')]:0x2,'scheduledat':_0x2b5fdd['scheduledat']?_0x2b5fdd[_0x8178('0x17')]:moment()[_0x8178('0x20')](_0x8178('0x18')),'callback':_0x2b5fdd[_0x8178('0x28')]?!![]:![],'callbackuniqueid':_0x2b5fdd['callbackUniqueid']?_0x2b5fdd['callbackUniqueid']:undefined,'callbackat':_0x2b5fdd['callbackUniqueid']?moment()[_0x8178('0x20')](_0x8178('0x18')):undefined,'CampaignId':_0x3fdc90['id']});})[_0x8178('0x29')](function(_0x2fecc5){_0xea36c2(_0x2fecc5);});});});};var _0x83ddbe=function(_0x3b4f8f){return new BPromise(function(_0x51e67a,_0x329fa3){_0x29a831(_0x3b4f8f,_0x2b5fdd)[_0x8178('0x1b')](function(_0x4fde9a){_0x2b5fdd[_0x8178('0x17')]=_0x4fde9a[_0x8178('0x21')];_0x1580e6[_0x8178('0x25')][_0x8178('0x22')]({'where':{'phone':_0x2b5fdd['phone'],'CampaignId':_0x3b4f8f['id']}})['then'](function(_0x5d25d0){if(!_[_0x8178('0x19')](_0x5d25d0)){throw new Error(_0x8178('0x23')+_0x2b5fdd['phone']+_0x8178('0x31')+_0x3b4f8f['id']);}return _0x1580e6[_0x8178('0x2b')][_0x8178('0x22')]({'where':{'calleridnum':_0x2b5fdd[_0x8178('0xc')],'CampaignId':_0x3b4f8f['id']}});})[_0x8178('0x1b')](function(_0x58deec){if(!_[_0x8178('0x19')](_0x58deec)){throw new Error(_0x8178('0x2c')+_0x2b5fdd[_0x8178('0xc')]+_0x8178('0x32')+_0x3b4f8f['id']);}return _0x1580e6[_0x8178('0x25')]['create']({'phone':_0x2b5fdd[_0x8178('0xc')],'ContactId':_0x2b5fdd['id'],'ListId':_0x2b5fdd['ListId'],'priority':_0x2b5fdd['priority']?_0x2b5fdd['priority']:0x2,'scheduledat':_0x2b5fdd[_0x8178('0x17')]?_0x2b5fdd[_0x8178('0x17')]:moment()[_0x8178('0x20')](_0x8178('0x18')),'callback':_0x2b5fdd[_0x8178('0x28')]?!![]:![],'callbackuniqueid':_0x2b5fdd['callbackUniqueid']?_0x2b5fdd[_0x8178('0x28')]:undefined,'callbackat':_0x2b5fdd[_0x8178('0x28')]?moment()[_0x8178('0x20')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x3b4f8f['id']});})[_0x8178('0x29')](function(_0x1d04ec){_0x329fa3(_0x1d04ec);});});});};if(_0x2b5fdd['ListId']){_0x1580e6[_0x8178('0x33')][_0x8178('0x34')]({'where':{'type':'outbound'},'attributes':['id',_0x8178('0x35'),_0x8178('0x1a')],'include':[{'model':_0x1580e6[_0x8178('0x36')],'as':_0x8178('0x37'),'where':{'id':_0x2b5fdd[_0x8178('0x2e')]}}]})['then'](function(_0x3a1dce){if(_0x3a1dce){var _0xf72fc3=[];for(var _0x3c84ec=0x0,_0xe5a3b7;_0x3c84ec<_0x3a1dce[_0x8178('0x38')];_0x3c84ec+=0x1){_0xe5a3b7=_0x3a1dce[_0x3c84ec][_0x8178('0x13')]({'plain':!![]});switch(_0xe5a3b7['dialCheckDuplicateType']){case'always':_0x462584(_0xe5a3b7)[_0x8178('0x29')](_0x4c9f08());break;case _0x8178('0x39'):_0x1388a3(_0xe5a3b7)[_0x8178('0x29')](_0x4c9f08());break;default:_0x29a831(_0xe5a3b7,_0x2b5fdd)['then'](function(_0x450cad){_0x2b5fdd['scheduledat']=_0x450cad['ret'];_0x1580e6[_0x8178('0x25')][_0x8178('0x26')]({'phone':_0x2b5fdd[_0x8178('0xc')],'ContactId':_0x2b5fdd['id'],'ListId':_0x2b5fdd[_0x8178('0x2e')],'scheduledat':_0x2b5fdd[_0x8178('0x17')]?_0x2b5fdd[_0x8178('0x17')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x2b5fdd[_0x8178('0x27')]?_0x2b5fdd[_0x8178('0x27')]:0x2,'callback':_0x2b5fdd['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x2b5fdd[_0x8178('0x28')]?_0x2b5fdd[_0x8178('0x28')]:undefined,'callbackat':_0x2b5fdd[_0x8178('0x28')]?moment()[_0x8178('0x20')](_0x8178('0x18')):undefined,'VoiceQueueId':_0xe5a3b7['id']})['catch'](_0x4c9f08());});}}}})[_0x8178('0x1b')](function(){return _0x1580e6['VoiceQueue'][_0x8178('0x34')]({'where':{'type':_0x8178('0x3a')},'attributes':['id'],'include':[{'model':_0x1580e6['CmList'],'as':_0x8178('0x3b'),'where':{'id':_0x2b5fdd[_0x8178('0x2e')]}}]})[_0x8178('0x1b')](function(_0xdec136){if(_0xdec136){var _0x16466b=[];for(var _0x35d9f1=0x0,_0x4c741e;_0x35d9f1<_0xdec136[_0x8178('0x38')];_0x35d9f1+=0x1){_0x4c741e=_0xdec136[_0x35d9f1][_0x8178('0x13')]({'plain':!![]});_0x1580e6[_0x8178('0x3c')][_0x8178('0x26')]({'phone':_0x2b5fdd[_0x8178('0xc')],'ContactId':_0x2b5fdd['id'],'ListId':_0x2b5fdd[_0x8178('0x2e')],'VoiceQueueId':_0x4c741e['id']})[_0x8178('0x29')](function(_0xc4eb2c){logger[_0x8178('0x3d')]('cmContact,\x20%s,\x20%s',_0x8178('0x15'),_0xc4eb2c['message']);});}}});})[_0x8178('0x1b')](function(){return _0x1580e6['Campaign'][_0x8178('0x34')]({'attributes':['id',_0x8178('0x35'),_0x8178('0x1a')],'include':[{'model':_0x1580e6[_0x8178('0x36')],'as':_0x8178('0x37'),'where':{'id':_0x2b5fdd[_0x8178('0x2e')]}}]})[_0x8178('0x1b')](function(_0x3b283f){if(_0x3b283f){var _0x1e5759=[];for(var _0x212434=0x0,_0x3635de;_0x212434<_0x3b283f['length'];_0x212434+=0x1){_0x3635de=_0x3b283f[_0x212434]['get']({'plain':!![]});switch(_0x3635de[_0x8178('0x35')]){case _0x8178('0x3e'):_0x83ddbe(_0x3635de)[_0x8178('0x29')](_0x47e03c());break;case _0x8178('0x39'):_0x5c6959(_0x3635de)[_0x8178('0x29')](_0x47e03c());break;default:_0x1580e6['CmHopper'][_0x8178('0x26')]({'phone':_0x2b5fdd[_0x8178('0xc')],'ContactId':_0x2b5fdd['id'],'ListId':_0x2b5fdd['ListId'],'scheduledat':_0x2b5fdd[_0x8178('0x17')]?_0x2b5fdd['scheduledat']:moment()[_0x8178('0x20')](_0x8178('0x18')),'priority':_0x2b5fdd[_0x8178('0x27')]?_0x2b5fdd[_0x8178('0x27')]:0x2,'callback':_0x2b5fdd[_0x8178('0x28')]?!![]:![],'callbackuniqueid':_0x2b5fdd[_0x8178('0x28')]?_0x2b5fdd[_0x8178('0x28')]:undefined,'callbackat':_0x2b5fdd[_0x8178('0x28')]?moment()[_0x8178('0x20')](_0x8178('0x18')):undefined,'CampaignId':_0x3635de['id']})[_0x8178('0x29')](_0x47e03c());}}}});})[_0x8178('0x1b')](function(){return _0x1580e6[_0x8178('0x2f')]['findAll']({'attributes':['id'],'include':[{'model':_0x1580e6['CmList'],'as':_0x8178('0x3b'),'where':{'id':_0x2b5fdd[_0x8178('0x2e')]}}]})[_0x8178('0x1b')](function(_0x2cf60d){if(_0x2cf60d){var _0x277e47=[];for(var _0x401692=0x0,_0x29a5c2;_0x401692<_0x2cf60d[_0x8178('0x38')];_0x401692+=0x1){_0x29a5c2=_0x2cf60d[_0x401692]['get']({'plain':!![]});_0x1580e6[_0x8178('0x3c')][_0x8178('0x26')]({'phone':_0x2b5fdd[_0x8178('0xc')],'ContactId':_0x2b5fdd['id'],'ListId':_0x2b5fdd[_0x8178('0x2e')],'CampaignId':_0x29a5c2['id']})[_0x8178('0x29')](function(_0x52f609){logger[_0x8178('0x3d')](_0x8178('0x3f'),_0x8178('0x15'),_0x52f609[_0x8178('0x40')]);});}}});})[_0x8178('0x1b')](function(){_0x130364();})[_0x8178('0x29')](function(_0x55c369){logger[_0x8178('0x3d')](_0x8178('0x3f'),_0x8178('0x15'),_0x55c369[_0x8178('0x40')]);_0x130364(_0x55c369);});}else{_0x130364(new Error(_0x8178('0x41')));}},'afterDestroy':function(_0x528363,_0x4e86fc,_0x4439a9){var _0x169214=_0x23106a[_0x8178('0x12')];var _0x275dd6=_0x528363[_0x8178('0x13')]({'plain':!![]});return _0x169214[_0x8178('0x25')][_0x8178('0x34')]({'raw':!![],'where':{'ListId':_0x275dd6[_0x8178('0x2e')],'ContactId':_0x275dd6['id']}})['then'](function(_0x5672c1){if(!_['isEmpty'](_0x5672c1)){var _0x4147ab=[];for(var _0x113a81=0x0;_0x113a81<_0x5672c1[_0x8178('0x38')];_0x113a81+=0x1){var _0x275074=_0x169214[_0x8178('0x25')][_0x8178('0x42')]({'where':{'ListId':_0x5672c1[_0x113a81][_0x8178('0x2e')],'ContactId':_0x5672c1[_0x113a81][_0x8178('0x43')],'VoiceQueueId':_0x5672c1[_0x113a81][_0x8178('0x44')],'CampaignId':_0x5672c1[_0x113a81]['CampaignId']}});_0x4147ab[_0x8178('0x45')](_0x275074);}return BPromise[_0x8178('0x46')](_0x4147ab);}})[_0x8178('0x1b')](function(_0x39c53b){logger[_0x8178('0x47')]('[CmContact][afterDestroy][Succesfull]',util[_0x8178('0x16')](_0x39c53b,{'showHidden':![],'depth':null}));_0x4439a9();})[_0x8178('0x29')](function(_0x7bd109){logger[_0x8178('0x3d')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x7bd109,{'showHidden':![],'depth':null}));_0x4439a9(_0x7bd109);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index 8c8cd95..22cf3b1 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x395d8d,_0xd73b89){var _0x395b35=function(_0x2105af){while(--_0x2105af){_0x395d8d['push'](_0x395d8d['shift']());}};_0x395b35(++_0xd73b89);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x49c311,_0x1dc03a){var _0x230cb6=function(_0x345abd){while(--_0x345abd){_0x49c311['push'](_0x49c311['shift']());}};_0x230cb6(++_0x1dc03a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 6d4b26e..305f8bc 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 _0xde56=['sequelize','INTEGER','STRING','PHONE'];(function(_0x8cd5cc,_0x48185e){var _0x315d95=function(_0x57db22){while(--_0x57db22){_0x8cd5cc['push'](_0x8cd5cc['shift']());}};_0x315d95(++_0x48185e);}(_0xde56,0x144));var _0x6de5=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xde56[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0x6de5('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0x6de5('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0x6de5('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x6de5('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x6de5('0x2')],'defaultValue':_0x6de5('0x3')},'OrderBy':{'type':Sequelize[_0x6de5('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0x6de5('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x65f4=['INTEGER','STRING'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x65f4,0x19a));var _0x465f=function(_0x2fd082,_0x3edb9b){_0x2fd082=_0x2fd082-0x0;var _0x1130d7=_0x65f4[_0x2fd082];return _0x1130d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'CmContactId':{'type':Sequelize[_0x465f('0x0')],'primaryKey':!![]},'item':{'type':Sequelize[_0x465f('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x465f('0x0')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x465f('0x0')],'defaultValue':null},'description':{'type':Sequelize[_0x465f('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 ed6d53a..a69e4cc 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 _0xee61=['sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','UserProfileResource','destroy','error','stack','name','send','map','CmContactHasItem','fieldName','type','key','model','keys','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','rawAttributes','fields','include','find','create','body','get','role','CmContactHasItems','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee61,0x91));var _0x1ee6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xee61[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x1ee6('0x0'));var rimraf=require(_0x1ee6('0x1'));var zipdir=require(_0x1ee6('0x2'));var jsonpatch=require(_0x1ee6('0x3'));var rp=require(_0x1ee6('0x4'));var moment=require(_0x1ee6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1ee6('0x6'));var path=require(_0x1ee6('0x7'));var sox=require(_0x1ee6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ee6('0x9'));var _=require(_0x1ee6('0xa'));var squel=require(_0x1ee6('0xb'));var crypto=require(_0x1ee6('0xc'));var jsforce=require(_0x1ee6('0xd'));var deskjs=require(_0x1ee6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1ee6('0xf'));var Papa=require(_0x1ee6('0x10'));var Redis=require(_0x1ee6('0x11'));var authService=require(_0x1ee6('0x12'));var qs=require(_0x1ee6('0x13'));var as=require(_0x1ee6('0x14'));var hardwareService=require(_0x1ee6('0x15'));var logger=require('../../config/logger')(_0x1ee6('0x16'));var utils=require(_0x1ee6('0x17'));var config=require(_0x1ee6('0x18'));var licenseUtil=require(_0x1ee6('0x19'));var db=require(_0x1ee6('0x1a'))['db'];function respondWithStatusCode(_0xe6d621,_0x3b5a06){_0x3b5a06=_0x3b5a06||0xcc;return function(_0xd3e57a){if(_0xd3e57a){return _0xe6d621[_0x1ee6('0x1b')](_0x3b5a06);}return _0xe6d621[_0x1ee6('0x1c')](_0x3b5a06)[_0x1ee6('0x1d')]();};}function respondWithResult(_0x2361b1,_0xfcdafa){_0xfcdafa=_0xfcdafa||0xc8;return function(_0x14e987){if(_0x14e987){return _0x2361b1[_0x1ee6('0x1c')](_0xfcdafa)[_0x1ee6('0x1e')](_0x14e987);}};}function respondWithFilteredResult(_0x416013,_0x2b1ade){return function(_0x321296){if(_0x321296){var _0x33f3d0=typeof _0x2b1ade[_0x1ee6('0x1f')]===_0x1ee6('0x20')&&typeof _0x2b1ade[_0x1ee6('0x21')]==='undefined';var _0x3ba9d1=_0x321296[_0x1ee6('0x22')];var _0x114b7f=_0x33f3d0?0x0:_0x2b1ade['offset'];var _0x1ce62b=_0x33f3d0?_0x321296[_0x1ee6('0x22')]:_0x2b1ade[_0x1ee6('0x1f')]+_0x2b1ade[_0x1ee6('0x21')];var _0x178206;if(_0x1ce62b>=_0x3ba9d1){_0x1ce62b=_0x3ba9d1;_0x178206=0xc8;}else{_0x178206=0xce;}_0x416013['status'](_0x178206);return _0x416013['set'](_0x1ee6('0x23'),_0x114b7f+'-'+_0x1ce62b+'/'+_0x3ba9d1)[_0x1ee6('0x1e')](_0x321296);}return null;};}function patchUpdates(_0x69e766){return function(_0x2bcf6d){try{jsonpatch[_0x1ee6('0x24')](_0x2bcf6d,_0x69e766,!![]);}catch(_0x2232ab){return BPromise['reject'](_0x2232ab);}return _0x2bcf6d[_0x1ee6('0x25')]();};}function saveUpdates(_0x240b4c,_0x553f7e){return function(_0x4d996a){if(_0x4d996a){return _0x4d996a[_0x1ee6('0x26')](_0x240b4c)[_0x1ee6('0x27')](function(_0x655e1e){return _0x655e1e;});}return null;};}function removeEntity(_0x55bc02,_0x4ea1aa){return function(_0x306853){if(_0x306853){return _0x306853['destroy']()[_0x1ee6('0x27')](function(){var _0x2b52c3=_0x306853['get']({'plain':!![]});var _0xbaf549='CmContactHasItems';return db[_0x1ee6('0x28')][_0x1ee6('0x29')]({'where':{'type':_0xbaf549,'resourceId':_0x2b52c3['id']}})['then'](function(){return _0x306853;});})[_0x1ee6('0x27')](function(){_0x55bc02[_0x1ee6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0e57,_0x4ed7b1){return function(_0x2d5983){if(!_0x2d5983){_0x5d0e57[_0x1ee6('0x1b')](0x194);}return _0x2d5983;};}function handleError(_0x470236,_0x43bf62){_0x43bf62=_0x43bf62||0x1f4;return function(_0x4344b2){logger[_0x1ee6('0x2a')](_0x4344b2[_0x1ee6('0x2b')]);if(_0x4344b2['name']){delete _0x4344b2[_0x1ee6('0x2c')];}_0x470236[_0x1ee6('0x1c')](_0x43bf62)[_0x1ee6('0x2d')](_0x4344b2);};}exports['index']=function(_0x51a501,_0x4d2cde){var _0x43b4f6={},_0xe03559={},_0x5a6260={'count':0x0,'rows':[]};var _0x3715bf=_[_0x1ee6('0x2e')](db[_0x1ee6('0x2f')]['rawAttributes'],function(_0x33e0cd){return{'name':_0x33e0cd[_0x1ee6('0x30')],'type':_0x33e0cd[_0x1ee6('0x31')][_0x1ee6('0x32')]};});_0xe03559[_0x1ee6('0x33')]=_[_0x1ee6('0x2e')](_0x3715bf,_0x1ee6('0x2c'));_0xe03559['query']=_[_0x1ee6('0x34')](_0x51a501[_0x1ee6('0x35')]);_0xe03559['filters']=_['intersection'](_0xe03559[_0x1ee6('0x33')],_0xe03559[_0x1ee6('0x35')]);_0x43b4f6[_0x1ee6('0x36')]=_[_0x1ee6('0x37')](_0xe03559[_0x1ee6('0x33')],qs['fields'](_0x51a501[_0x1ee6('0x35')]['fields']));_0x43b4f6[_0x1ee6('0x36')]=_0x43b4f6[_0x1ee6('0x36')][_0x1ee6('0x38')]?_0x43b4f6[_0x1ee6('0x36')]:_0xe03559['model'];if(!_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x39')](_0x1ee6('0x3a'))){_0x43b4f6[_0x1ee6('0x21')]=qs[_0x1ee6('0x21')](_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x21')]);_0x43b4f6['offset']=qs['offset'](_0x51a501['query'][_0x1ee6('0x1f')]);}_0x43b4f6[_0x1ee6('0x3b')]=qs[_0x1ee6('0x3c')](_0x51a501['query']['sort']);_0x43b4f6[_0x1ee6('0x3d')]=qs[_0x1ee6('0x3e')](_[_0x1ee6('0x3f')](_0x51a501[_0x1ee6('0x35')],_0xe03559[_0x1ee6('0x3e')]),_0x3715bf);if(_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x40')]){_0x43b4f6[_0x1ee6('0x3d')]=_['merge'](_0x43b4f6[_0x1ee6('0x3d')],{'$or':_[_0x1ee6('0x2e')](_0x3715bf,function(_0x1f8e8f){if(_0x1f8e8f['type']!==_0x1ee6('0x41')){var _0x137201={};_0x137201[_0x1f8e8f[_0x1ee6('0x2c')]]={'$like':'%'+_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x40')]+'%'};return _0x137201;}})});}_0x43b4f6=_[_0x1ee6('0x42')]({},_0x43b4f6,_0x51a501[_0x1ee6('0x43')]);var _0xb1b705={'where':_0x43b4f6[_0x1ee6('0x3d')]};return db[_0x1ee6('0x2f')][_0x1ee6('0x22')](_0xb1b705)[_0x1ee6('0x27')](function(_0x1c8d2b){_0x5a6260[_0x1ee6('0x22')]=_0x1c8d2b;if(_0x51a501[_0x1ee6('0x35')][_0x1ee6('0x44')]){_0x43b4f6['include']=[{'all':!![]}];}return db['CmContactHasItem'][_0x1ee6('0x45')](_0x43b4f6);})[_0x1ee6('0x27')](function(_0x13d2a3){_0x5a6260[_0x1ee6('0x46')]=_0x13d2a3;return _0x5a6260;})['then'](respondWithFilteredResult(_0x4d2cde,_0x43b4f6))[_0x1ee6('0x47')](handleError(_0x4d2cde,null));};exports['show']=function(_0x3663dd,_0x281254){var _0x5abb90={'raw':!![],'where':{'id':_0x3663dd[_0x1ee6('0x48')]['id']}},_0x4a7e0d={};_0x4a7e0d[_0x1ee6('0x33')]=_[_0x1ee6('0x34')](db[_0x1ee6('0x2f')][_0x1ee6('0x49')]);_0x4a7e0d[_0x1ee6('0x35')]=_[_0x1ee6('0x34')](_0x3663dd[_0x1ee6('0x35')]);_0x4a7e0d[_0x1ee6('0x3e')]=_['intersection'](_0x4a7e0d[_0x1ee6('0x33')],_0x4a7e0d[_0x1ee6('0x35')]);_0x5abb90[_0x1ee6('0x36')]=_[_0x1ee6('0x37')](_0x4a7e0d[_0x1ee6('0x33')],qs['fields'](_0x3663dd['query'][_0x1ee6('0x4a')]));_0x5abb90[_0x1ee6('0x36')]=_0x5abb90[_0x1ee6('0x36')][_0x1ee6('0x38')]?_0x5abb90[_0x1ee6('0x36')]:_0x4a7e0d['model'];if(_0x3663dd[_0x1ee6('0x35')][_0x1ee6('0x44')]){_0x5abb90[_0x1ee6('0x4b')]=[{'all':!![]}];}_0x5abb90=_[_0x1ee6('0x42')]({},_0x5abb90,_0x3663dd[_0x1ee6('0x43')]);return db[_0x1ee6('0x2f')][_0x1ee6('0x4c')](_0x5abb90)[_0x1ee6('0x27')](handleEntityNotFound(_0x281254,null))[_0x1ee6('0x27')](respondWithResult(_0x281254,null))[_0x1ee6('0x47')](handleError(_0x281254,null));};exports[_0x1ee6('0x4d')]=function(_0x1aa544,_0x4444bc){return db[_0x1ee6('0x2f')]['create'](_0x1aa544[_0x1ee6('0x4e')],{})[_0x1ee6('0x27')](function(_0x637e1c){var _0x3f3032=_0x1aa544['user'][_0x1ee6('0x4f')]({'plain':!![]});if(!_0x3f3032)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f3032[_0x1ee6('0x50')]==='user'){var _0x127ffd=_0x637e1c[_0x1ee6('0x4f')]({'plain':!![]});var _0x55b89a=_0x1ee6('0x51');return db[_0x1ee6('0x52')][_0x1ee6('0x4c')]({'where':{'name':_0x55b89a,'userProfileId':_0x3f3032[_0x1ee6('0x53')]},'raw':!![]})[_0x1ee6('0x27')](function(_0x461a1c){if(_0x461a1c&&_0x461a1c[_0x1ee6('0x54')]===0x0){return db[_0x1ee6('0x28')][_0x1ee6('0x4d')]({'name':_0x127ffd[_0x1ee6('0x2c')],'resourceId':_0x127ffd['id'],'type':_0x461a1c[_0x1ee6('0x2c')],'sectionId':_0x461a1c['id']},{})['then'](function(){return _0x637e1c;});}else{return _0x637e1c;}})[_0x1ee6('0x47')](function(_0x49bf0b){logger[_0x1ee6('0x2a')](_0x1ee6('0x55'),_0x49bf0b);throw _0x49bf0b;});}return _0x637e1c;})[_0x1ee6('0x27')](respondWithResult(_0x4444bc,0xc9))['catch'](handleError(_0x4444bc,null));};exports[_0x1ee6('0x26')]=function(_0x220295,_0x171206){if(_0x220295[_0x1ee6('0x4e')]['id']){delete _0x220295[_0x1ee6('0x4e')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x220295['params']['id']}})[_0x1ee6('0x27')](handleEntityNotFound(_0x171206,null))[_0x1ee6('0x27')](saveUpdates(_0x220295[_0x1ee6('0x4e')],null))[_0x1ee6('0x27')](respondWithResult(_0x171206,null))[_0x1ee6('0x47')](handleError(_0x171206,null));};exports['destroy']=function(_0x27b47e,_0x594612){return db[_0x1ee6('0x2f')][_0x1ee6('0x4c')]({'where':{'id':_0x27b47e[_0x1ee6('0x48')]['id']}})['then'](handleEntityNotFound(_0x594612,null))['then'](removeEntity(_0x594612,null))[_0x1ee6('0x47')](handleError(_0x594612,null));}; \ No newline at end of file +var _0xbf6c=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','fast-json-patch','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/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','CmContactHasItems','UserProfileResource','destroy','error','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x2a6754,_0x277259){var _0x17feda=function(_0x5745be){while(--_0x5745be){_0x2a6754['push'](_0x2a6754['shift']());}};_0x17feda(++_0x277259);}(_0xbf6c,0x10a));var _0xcbf6=function(_0x5597d6,_0x2b2590){_0x5597d6=_0x5597d6-0x0;var _0x53ca23=_0xbf6c[_0x5597d6];return _0x53ca23;};'use strict';var emlformat=require(_0xcbf6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbf6('0x1'));var rp=require('request-promise');var moment=require(_0xcbf6('0x2'));var BPromise=require(_0xcbf6('0x3'));var Mustache=require(_0xcbf6('0x4'));var util=require(_0xcbf6('0x5'));var path=require(_0xcbf6('0x6'));var sox=require(_0xcbf6('0x7'));var csv=require(_0xcbf6('0x8'));var ejs=require(_0xcbf6('0x9'));var fs=require('fs');var fs_extra=require(_0xcbf6('0xa'));var _=require(_0xcbf6('0xb'));var squel=require(_0xcbf6('0xc'));var crypto=require('crypto');var jsforce=require(_0xcbf6('0xd'));var deskjs=require(_0xcbf6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xcbf6('0xf'));var Papa=require(_0xcbf6('0x10'));var Redis=require(_0xcbf6('0x11'));var authService=require(_0xcbf6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcbf6('0x13'));var hardwareService=require(_0xcbf6('0x14'));var logger=require('../../config/logger')(_0xcbf6('0x15'));var utils=require(_0xcbf6('0x16'));var config=require(_0xcbf6('0x17'));var licenseUtil=require(_0xcbf6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x305747,_0x474382){_0x474382=_0x474382||0xcc;return function(_0x257ae6){if(_0x257ae6){return _0x305747[_0xcbf6('0x19')](_0x474382);}return _0x305747[_0xcbf6('0x1a')](_0x474382)[_0xcbf6('0x1b')]();};}function respondWithResult(_0x175188,_0x471d4d){_0x471d4d=_0x471d4d||0xc8;return function(_0x1afc80){if(_0x1afc80){return _0x175188[_0xcbf6('0x1a')](_0x471d4d)[_0xcbf6('0x1c')](_0x1afc80);}};}function respondWithFilteredResult(_0x540217,_0x249981){return function(_0x2272c2){if(_0x2272c2){var _0x4a7dd8=typeof _0x249981[_0xcbf6('0x1d')]===_0xcbf6('0x1e')&&typeof _0x249981[_0xcbf6('0x1f')]===_0xcbf6('0x1e');var _0x23202f=_0x2272c2[_0xcbf6('0x20')];var _0x5771de=_0x4a7dd8?0x0:_0x249981['offset'];var _0x340c82=_0x4a7dd8?_0x2272c2[_0xcbf6('0x20')]:_0x249981['offset']+_0x249981[_0xcbf6('0x1f')];var _0x382753;if(_0x340c82>=_0x23202f){_0x340c82=_0x23202f;_0x382753=0xc8;}else{_0x382753=0xce;}_0x540217[_0xcbf6('0x1a')](_0x382753);return _0x540217[_0xcbf6('0x21')](_0xcbf6('0x22'),_0x5771de+'-'+_0x340c82+'/'+_0x23202f)[_0xcbf6('0x1c')](_0x2272c2);}return null;};}function patchUpdates(_0x44753f){return function(_0x5a22ff){try{jsonpatch[_0xcbf6('0x23')](_0x5a22ff,_0x44753f,!![]);}catch(_0x2c4bce){return BPromise[_0xcbf6('0x24')](_0x2c4bce);}return _0x5a22ff[_0xcbf6('0x25')]();};}function saveUpdates(_0x4137b9,_0x154331){return function(_0x291ddb){if(_0x291ddb){return _0x291ddb['update'](_0x4137b9)['then'](function(_0x320507){return _0x320507;});}return null;};}function removeEntity(_0x1eec60,_0x4bf87b){return function(_0xd8e741){if(_0xd8e741){return _0xd8e741['destroy']()[_0xcbf6('0x26')](function(){var _0xd2df27=_0xd8e741[_0xcbf6('0x27')]({'plain':!![]});var _0x2f8b2b=_0xcbf6('0x28');return db[_0xcbf6('0x29')][_0xcbf6('0x2a')]({'where':{'type':_0x2f8b2b,'resourceId':_0xd2df27['id']}})[_0xcbf6('0x26')](function(){return _0xd8e741;});})[_0xcbf6('0x26')](function(){_0x1eec60['status'](0xcc)[_0xcbf6('0x1b')]();});}};}function handleEntityNotFound(_0x149a5e,_0x161994){return function(_0x1d1694){if(!_0x1d1694){_0x149a5e['sendStatus'](0x194);}return _0x1d1694;};}function handleError(_0x4a5558,_0x4bbcd5){_0x4bbcd5=_0x4bbcd5||0x1f4;return function(_0x5a8591){logger[_0xcbf6('0x2b')](_0x5a8591[_0xcbf6('0x2c')]);if(_0x5a8591[_0xcbf6('0x2d')]){delete _0x5a8591[_0xcbf6('0x2d')];}_0x4a5558[_0xcbf6('0x1a')](_0x4bbcd5)['send'](_0x5a8591);};}exports[_0xcbf6('0x2e')]=function(_0x1a967b,_0x29c8c8){var _0x163b83={},_0x25d549={},_0x802495={'count':0x0,'rows':[]};var _0x3711cb=_[_0xcbf6('0x2f')](db[_0xcbf6('0x30')][_0xcbf6('0x31')],function(_0x43a1e4){return{'name':_0x43a1e4[_0xcbf6('0x32')],'type':_0x43a1e4['type'][_0xcbf6('0x33')]};});_0x25d549[_0xcbf6('0x34')]=_[_0xcbf6('0x2f')](_0x3711cb,'name');_0x25d549[_0xcbf6('0x35')]=_[_0xcbf6('0x36')](_0x1a967b[_0xcbf6('0x35')]);_0x25d549[_0xcbf6('0x37')]=_[_0xcbf6('0x38')](_0x25d549['model'],_0x25d549[_0xcbf6('0x35')]);_0x163b83[_0xcbf6('0x39')]=_[_0xcbf6('0x38')](_0x25d549[_0xcbf6('0x34')],qs['fields'](_0x1a967b[_0xcbf6('0x35')][_0xcbf6('0x3a')]));_0x163b83[_0xcbf6('0x39')]=_0x163b83[_0xcbf6('0x39')][_0xcbf6('0x3b')]?_0x163b83[_0xcbf6('0x39')]:_0x25d549['model'];if(!_0x1a967b[_0xcbf6('0x35')][_0xcbf6('0x3c')]('nolimit')){_0x163b83[_0xcbf6('0x1f')]=qs[_0xcbf6('0x1f')](_0x1a967b[_0xcbf6('0x35')]['limit']);_0x163b83['offset']=qs[_0xcbf6('0x1d')](_0x1a967b[_0xcbf6('0x35')]['offset']);}_0x163b83[_0xcbf6('0x3d')]=qs[_0xcbf6('0x3e')](_0x1a967b[_0xcbf6('0x35')]['sort']);_0x163b83[_0xcbf6('0x3f')]=qs[_0xcbf6('0x37')](_[_0xcbf6('0x40')](_0x1a967b[_0xcbf6('0x35')],_0x25d549[_0xcbf6('0x37')]),_0x3711cb);if(_0x1a967b[_0xcbf6('0x35')][_0xcbf6('0x41')]){_0x163b83['where']=_[_0xcbf6('0x42')](_0x163b83[_0xcbf6('0x3f')],{'$or':_[_0xcbf6('0x2f')](_0x3711cb,function(_0x339383){if(_0x339383[_0xcbf6('0x43')]!=='VIRTUAL'){var _0x314cb4={};_0x314cb4[_0x339383[_0xcbf6('0x2d')]]={'$like':'%'+_0x1a967b[_0xcbf6('0x35')]['filter']+'%'};return _0x314cb4;}})});}_0x163b83=_[_0xcbf6('0x42')]({},_0x163b83,_0x1a967b[_0xcbf6('0x44')]);var _0x2419af={'where':_0x163b83[_0xcbf6('0x3f')]};return db['CmContactHasItem'][_0xcbf6('0x20')](_0x2419af)[_0xcbf6('0x26')](function(_0x5a787e){_0x802495[_0xcbf6('0x20')]=_0x5a787e;if(_0x1a967b[_0xcbf6('0x35')][_0xcbf6('0x45')]){_0x163b83['include']=[{'all':!![]}];}return db[_0xcbf6('0x30')][_0xcbf6('0x46')](_0x163b83);})[_0xcbf6('0x26')](function(_0x3b1710){_0x802495[_0xcbf6('0x47')]=_0x3b1710;return _0x802495;})['then'](respondWithFilteredResult(_0x29c8c8,_0x163b83))[_0xcbf6('0x48')](handleError(_0x29c8c8,null));};exports[_0xcbf6('0x49')]=function(_0x124e10,_0x5defb6){var _0x13a3fc={'raw':!![],'where':{'id':_0x124e10[_0xcbf6('0x4a')]['id']}},_0x43ff21={};_0x43ff21[_0xcbf6('0x34')]=_['keys'](db[_0xcbf6('0x30')][_0xcbf6('0x31')]);_0x43ff21[_0xcbf6('0x35')]=_[_0xcbf6('0x36')](_0x124e10[_0xcbf6('0x35')]);_0x43ff21[_0xcbf6('0x37')]=_[_0xcbf6('0x38')](_0x43ff21[_0xcbf6('0x34')],_0x43ff21[_0xcbf6('0x35')]);_0x13a3fc[_0xcbf6('0x39')]=_['intersection'](_0x43ff21[_0xcbf6('0x34')],qs[_0xcbf6('0x3a')](_0x124e10['query'][_0xcbf6('0x3a')]));_0x13a3fc[_0xcbf6('0x39')]=_0x13a3fc[_0xcbf6('0x39')][_0xcbf6('0x3b')]?_0x13a3fc[_0xcbf6('0x39')]:_0x43ff21[_0xcbf6('0x34')];if(_0x124e10[_0xcbf6('0x35')][_0xcbf6('0x45')]){_0x13a3fc[_0xcbf6('0x4b')]=[{'all':!![]}];}_0x13a3fc=_['merge']({},_0x13a3fc,_0x124e10[_0xcbf6('0x44')]);return db[_0xcbf6('0x30')][_0xcbf6('0x4c')](_0x13a3fc)[_0xcbf6('0x26')](handleEntityNotFound(_0x5defb6,null))[_0xcbf6('0x26')](respondWithResult(_0x5defb6,null))[_0xcbf6('0x48')](handleError(_0x5defb6,null));};exports[_0xcbf6('0x4d')]=function(_0x270397,_0x109df9){return db[_0xcbf6('0x30')]['create'](_0x270397['body'],{})['then'](function(_0x5aff97){var _0x178a50=_0x270397[_0xcbf6('0x4e')][_0xcbf6('0x27')]({'plain':!![]});if(!_0x178a50)throw new Error(_0xcbf6('0x4f'));if(_0x178a50[_0xcbf6('0x50')]===_0xcbf6('0x4e')){var _0x2c4757=_0x5aff97[_0xcbf6('0x27')]({'plain':!![]});var _0x365ebd=_0xcbf6('0x28');return db[_0xcbf6('0x51')]['find']({'where':{'name':_0x365ebd,'userProfileId':_0x178a50[_0xcbf6('0x52')]},'raw':!![]})['then'](function(_0x78b802){if(_0x78b802&&_0x78b802[_0xcbf6('0x53')]===0x0){return db[_0xcbf6('0x29')]['create']({'name':_0x2c4757[_0xcbf6('0x2d')],'resourceId':_0x2c4757['id'],'type':_0x78b802[_0xcbf6('0x2d')],'sectionId':_0x78b802['id']},{})['then'](function(){return _0x5aff97;});}else{return _0x5aff97;}})[_0xcbf6('0x48')](function(_0x3cafc9){logger[_0xcbf6('0x2b')](_0xcbf6('0x54'),_0x3cafc9);throw _0x3cafc9;});}return _0x5aff97;})['then'](respondWithResult(_0x109df9,0xc9))[_0xcbf6('0x48')](handleError(_0x109df9,null));};exports[_0xcbf6('0x55')]=function(_0x23768f,_0x364ff4){if(_0x23768f[_0xcbf6('0x56')]['id']){delete _0x23768f[_0xcbf6('0x56')]['id'];}return db[_0xcbf6('0x30')][_0xcbf6('0x4c')]({'where':{'id':_0x23768f[_0xcbf6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x364ff4,null))[_0xcbf6('0x26')](saveUpdates(_0x23768f[_0xcbf6('0x56')],null))[_0xcbf6('0x26')](respondWithResult(_0x364ff4,null))['catch'](handleError(_0x364ff4,null));};exports[_0xcbf6('0x2a')]=function(_0x9f71ab,_0x37945f){return db[_0xcbf6('0x30')]['find']({'where':{'id':_0x9f71ab[_0xcbf6('0x4a')]['id']}})['then'](handleEntityNotFound(_0x37945f,null))['then'](removeEntity(_0x37945f,null))[_0xcbf6('0x48')](handleError(_0x37945f,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 6835614..bc7c677 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 _0x59d8=['api','moment','bluebird','request-promise','path','exports','define','CmContactHasItem','cm_contact_has_items','lodash'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x59d8,0x95));var _0x859d=function(_0x46800d,_0x588500){_0x46800d=_0x46800d-0x0;var _0x3824cd=_0x59d8[_0x46800d];return _0x3824cd;};'use strict';var _=require(_0x859d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x859d('0x1'));var moment=require(_0x859d('0x2'));var BPromise=require(_0x859d('0x3'));var rp=require(_0x859d('0x4'));var fs=require('fs');var path=require(_0x859d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x859d('0x6')]=function(_0x41d5d0,_0xeb8264){return _0x41d5d0[_0x859d('0x7')](_0x859d('0x8'),attributes,{'tableName':_0x859d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0301=['exports','define','CmContactHasItem','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x30838a,_0x448fe3){var _0x4b3cc3=function(_0x53eff4){while(--_0x53eff4){_0x30838a['push'](_0x30838a['shift']());}};_0x4b3cc3(++_0x448fe3);}(_0x0301,0x157));var _0x1030=function(_0x348db0,_0x103906){_0x348db0=_0x348db0-0x0;var _0x405e55=_0x0301[_0x348db0];return _0x405e55;};'use strict';var _=require('lodash');var util=require(_0x1030('0x0'));var logger=require(_0x1030('0x1'))(_0x1030('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1030('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1030('0x4'));var config=require(_0x1030('0x5'));var attributes=require(_0x1030('0x6'));module[_0x1030('0x7')]=function(_0x5baf4c,_0x5dbad5){return _0x5baf4c[_0x1030('0x8')](_0x1030('0x9'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 231b15e..dec0095 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 _0x85f5=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','code','error','CmContactHasItem,\x20%s,\x20%s','message'];(function(_0x1426c1,_0xd60edc){var _0x5881a2=function(_0x41b337){while(--_0x41b337){_0x1426c1['push'](_0x1426c1['shift']());}};_0x5881a2(++_0xd60edc);}(_0x85f5,0x1d0));var _0x585f=function(_0x2cb1df,_0x4b439c){_0x2cb1df=_0x2cb1df-0x0;var _0x30e674=_0x85f5[_0x2cb1df];return _0x30e674;};'use strict';var _=require(_0x585f('0x0'));var util=require('util');var moment=require(_0x585f('0x1'));var BPromise=require(_0x585f('0x2'));var rs=require(_0x585f('0x3'));var fs=require('fs');var Redis=require(_0x585f('0x4'));var db=require(_0x585f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x585f('0x6'));var jayson=require(_0x585f('0x7'));var client=jayson[_0x585f('0x8')][_0x585f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ede3a,_0x22a02b,_0x7345c8){return new BPromise(function(_0x3a6b8e,_0x30c5b7){return client[_0x585f('0xa')](_0x2ede3a,_0x7345c8)['then'](function(_0x71ace5){logger[_0x585f('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x22a02b,_0x585f('0xc'));logger[_0x585f('0xd')](_0x585f('0xe'),_0x22a02b,_0x585f('0xc'),JSON[_0x585f('0xf')](_0x71ace5));if(_0x71ace5['error']){if(_0x71ace5['error'][_0x585f('0x10')]===0x1f4){logger[_0x585f('0x11')](_0x585f('0x12'),_0x22a02b,_0x71ace5[_0x585f('0x11')][_0x585f('0x13')]);return _0x30c5b7(_0x71ace5[_0x585f('0x11')][_0x585f('0x13')]);}logger[_0x585f('0x11')](_0x585f('0x12'),_0x22a02b,_0x71ace5[_0x585f('0x11')][_0x585f('0x13')]);return _0x3a6b8e(_0x71ace5[_0x585f('0x11')][_0x585f('0x13')]);}else{logger[_0x585f('0xb')](_0x585f('0x12'),_0x22a02b,_0x585f('0xc'));_0x3a6b8e(_0x71ace5[_0x585f('0x14')][_0x585f('0x13')]);}})[_0x585f('0x15')](function(_0x54160b){logger[_0x585f('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x22a02b,_0x54160b);_0x30c5b7(_0x54160b);});});} \ No newline at end of file +var _0xa187=['http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x55be62,_0x1c4d2a){var _0x2a0f80=function(_0x4c9733){while(--_0x4c9733){_0x55be62['push'](_0x55be62['shift']());}};_0x2a0f80(++_0x1c4d2a);}(_0xa187,0x14d));var _0x7a18=function(_0x3ddf16,_0x76f985){_0x3ddf16=_0x3ddf16-0x0;var _0x353de4=_0xa187[_0x3ddf16];return _0x353de4;};'use strict';var _=require(_0x7a18('0x0'));var util=require(_0x7a18('0x1'));var moment=require(_0x7a18('0x2'));var BPromise=require(_0x7a18('0x3'));var rs=require(_0x7a18('0x4'));var fs=require('fs');var Redis=require(_0x7a18('0x5'));var db=require(_0x7a18('0x6'))['db'];var utils=require(_0x7a18('0x7'));var logger=require(_0x7a18('0x8'))(_0x7a18('0x9'));var config=require(_0x7a18('0xa'));var jayson=require(_0x7a18('0xb'));var client=jayson['client'][_0x7a18('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46b522,_0x32371b,_0x579a01){return new BPromise(function(_0x15d1e3,_0x572795){return client[_0x7a18('0xd')](_0x46b522,_0x579a01)['then'](function(_0x6be056){logger[_0x7a18('0xe')](_0x7a18('0xf'),_0x32371b,_0x7a18('0x10'));logger[_0x7a18('0x11')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x32371b,_0x7a18('0x10'),JSON[_0x7a18('0x12')](_0x6be056));if(_0x6be056[_0x7a18('0x13')]){if(_0x6be056[_0x7a18('0x13')][_0x7a18('0x14')]===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x32371b,_0x6be056[_0x7a18('0x13')][_0x7a18('0x15')]);return _0x572795(_0x6be056[_0x7a18('0x13')][_0x7a18('0x15')]);}logger['error'](_0x7a18('0xf'),_0x32371b,_0x6be056[_0x7a18('0x13')][_0x7a18('0x15')]);return _0x15d1e3(_0x6be056['error']['message']);}else{logger[_0x7a18('0xe')](_0x7a18('0xf'),_0x32371b,_0x7a18('0x10'));_0x15d1e3(_0x6be056[_0x7a18('0x16')][_0x7a18('0x15')]);}})['catch'](function(_0x497d76){logger[_0x7a18('0x13')](_0x7a18('0xf'),_0x32371b,_0x497d76);_0x572795(_0x497d76);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 17fdfd5..b50c430 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 _0x6f02=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','/:id'];(function(_0x5f23e5,_0x3a8db7){var _0x32c209=function(_0x4eaa38){while(--_0x4eaa38){_0x5f23e5['push'](_0x5f23e5['shift']());}};_0x32c209(++_0x3a8db7);}(_0x6f02,0xf0));var _0x26f0=function(_0x3e32df,_0x32b6df){_0x3e32df=_0x3e32df-0x0;var _0x5bde2b=_0x6f02[_0x3e32df];return _0x5bde2b;};'use strict';var multer=require(_0x26f0('0x0'));var util=require(_0x26f0('0x1'));var path=require('path');var timeout=require(_0x26f0('0x2'));var express=require(_0x26f0('0x3'));var router=express[_0x26f0('0x4')]();var fs_extra=require(_0x26f0('0x5'));var auth=require(_0x26f0('0x6'));var interaction=require(_0x26f0('0x7'));var config=require(_0x26f0('0x8'));var controller=require(_0x26f0('0x9'));router[_0x26f0('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x26f0('0xa')](_0x26f0('0xb'),auth[_0x26f0('0xc')](),controller[_0x26f0('0xd')]);router[_0x26f0('0xe')]('/',auth['isAuthenticated'](),controller[_0x26f0('0xf')]);router[_0x26f0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x26f0('0x11')]);router[_0x26f0('0x12')](_0x26f0('0xb'),auth[_0x26f0('0xc')](),controller[_0x26f0('0x13')]);module[_0x26f0('0x14')]=router; \ No newline at end of file +var _0x1e7b=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x1e7b,0x12d));var _0xb1e7=function(_0x5562fe,_0x4e809c){_0x5562fe=_0x5562fe-0x0;var _0x1829c7=_0x1e7b[_0x5562fe];return _0x1829c7;};'use strict';var multer=require(_0xb1e7('0x0'));var util=require(_0xb1e7('0x1'));var path=require('path');var timeout=require(_0xb1e7('0x2'));var express=require(_0xb1e7('0x3'));var router=express['Router']();var fs_extra=require(_0xb1e7('0x4'));var auth=require(_0xb1e7('0x5'));var interaction=require(_0xb1e7('0x6'));var config=require(_0xb1e7('0x7'));var controller=require('./cmContactHasItem.controller');router[_0xb1e7('0x8')]('/',auth[_0xb1e7('0x9')](),controller[_0xb1e7('0xa')]);router[_0xb1e7('0x8')](_0xb1e7('0xb'),auth['isAuthenticated'](),controller[_0xb1e7('0xc')]);router[_0xb1e7('0xd')]('/',auth[_0xb1e7('0x9')](),controller[_0xb1e7('0xe')]);router[_0xb1e7('0xf')](_0xb1e7('0xb'),auth[_0xb1e7('0x9')](),controller[_0xb1e7('0x10')]);router[_0xb1e7('0x11')](_0xb1e7('0xb'),auth[_0xb1e7('0x9')](),controller[_0xb1e7('0x12')]);module[_0xb1e7('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 056d81b..6997bfb 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 _0xf532=['TEXT','long','type','select','parse','isArray','setDataValue','values','stringify','BOOLEAN','ENUM','sequelize','lodash','exports','getDataValue','name','STRING'];(function(_0x4af8a5,_0x235b51){var _0x2f73a0=function(_0x62bae6){while(--_0x62bae6){_0x4af8a5['push'](_0x4af8a5['shift']());}};_0x2f73a0(++_0x235b51);}(_0xf532,0x11b));var _0x2f53=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xf532[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0x2f53('0x0'));var _=require(_0x2f53('0x1'));module[_0x2f53('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17e805){return this['getDataValue']('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x15c78b){this['setDataValue']('alias',_0x15c78b?_0x15c78b:this[_0x2f53('0x3')](_0x2f53('0x4')));}},'type':{'type':Sequelize[_0x2f53('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x2f53('0x6')](_0x2f53('0x7')),'get':function(){if(this['getDataValue'](_0x2f53('0x8'))===_0x2f53('0x9')){return JSON[_0x2f53('0xa')](this[_0x2f53('0x3')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0x1bbe0b){if(Array[_0x2f53('0xb')](_0x1bbe0b)){this[_0x2f53('0xc')](_0x2f53('0xd'),JSON[_0x2f53('0xe')](_0x1bbe0b));}else{this[_0x2f53('0xc')](_0x2f53('0xd'),_0x1bbe0b);}}},'required':{'type':Sequelize[_0x2f53('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x2f53('0x10')]('voice')}}; \ No newline at end of file +var _0x3bec=['STRING','setDataValue','name','TEXT','long','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','exports','getDataValue','alias'];(function(_0x1624f1,_0x27651f){var _0x2a78d8=function(_0x6e6f9f){while(--_0x6e6f9f){_0x1624f1['push'](_0x1624f1['shift']());}};_0x2a78d8(++_0x27651f);}(_0x3bec,0x19c));var _0xc3be=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3bec[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc3be('0x0'));var _=require('lodash');module[_0xc3be('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xee795e){return this[_0xc3be('0x2')](_0xc3be('0x3'));}},'alias':{'type':Sequelize[_0xc3be('0x4')],'allowNull':![],'set':function(_0x5da9e3){this[_0xc3be('0x5')](_0xc3be('0x3'),_0x5da9e3?_0x5da9e3:this[_0xc3be('0x2')](_0xc3be('0x6')));}},'type':{'type':Sequelize[_0xc3be('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0xc3be('0x7')](_0xc3be('0x8')),'get':function(){if(this[_0xc3be('0x2')]('type')==='select'){return JSON[_0xc3be('0x9')](this[_0xc3be('0x2')](_0xc3be('0xa')));}else{return this[_0xc3be('0x2')](_0xc3be('0xa'));}},'set':function(_0x2e1238){if(Array[_0xc3be('0xb')](_0x2e1238)){this[_0xc3be('0x5')](_0xc3be('0xa'),JSON[_0xc3be('0xc')](_0x2e1238));}else{this['setDataValue'](_0xc3be('0xa'),_0x2e1238);}}},'required':{'type':Sequelize[_0xc3be('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc3be('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xc3be('0xe')](_0xc3be('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 95ef77c..02b1c97 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 _0x6fd8=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','length','attributes','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','fields','options','update','body','find','params','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x6fd8,0x9d));var _0x86fd=function(_0x108bfc,_0x3b635a){_0x108bfc=_0x108bfc-0x0;var _0x12ca03=_0x6fd8[_0x108bfc];return _0x12ca03;};'use strict';var emlformat=require(_0x86fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86fd('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86fd('0x2'));var BPromise=require(_0x86fd('0x3'));var Mustache=require(_0x86fd('0x4'));var util=require(_0x86fd('0x5'));var path=require(_0x86fd('0x6'));var sox=require('sox');var csv=require(_0x86fd('0x7'));var ejs=require(_0x86fd('0x8'));var fs=require('fs');var fs_extra=require(_0x86fd('0x9'));var _=require('lodash');var squel=require(_0x86fd('0xa'));var crypto=require(_0x86fd('0xb'));var jsforce=require(_0x86fd('0xc'));var deskjs=require(_0x86fd('0xd'));var toCsv=require(_0x86fd('0x7'));var querystring=require(_0x86fd('0xe'));var Papa=require(_0x86fd('0xf'));var Redis=require(_0x86fd('0x10'));var authService=require(_0x86fd('0x11'));var qs=require(_0x86fd('0x12'));var as=require(_0x86fd('0x13'));var hardwareService=require(_0x86fd('0x14'));var logger=require(_0x86fd('0x15'))(_0x86fd('0x16'));var utils=require(_0x86fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x86fd('0x18'));var db=require(_0x86fd('0x19'))['db'];function respondWithStatusCode(_0x3cf119,_0x311e9c){_0x311e9c=_0x311e9c||0xcc;return function(_0x2a71dd){if(_0x2a71dd){return _0x3cf119['sendStatus'](_0x311e9c);}return _0x3cf119[_0x86fd('0x1a')](_0x311e9c)[_0x86fd('0x1b')]();};}function respondWithResult(_0x47c810,_0x2b3410){_0x2b3410=_0x2b3410||0xc8;return function(_0x37dc47){if(_0x37dc47){return _0x47c810[_0x86fd('0x1a')](_0x2b3410)[_0x86fd('0x1c')](_0x37dc47);}};}function respondWithFilteredResult(_0x3d3723,_0x5ee684){return function(_0x3b99c0){if(_0x3b99c0){var _0x1b7e90=typeof _0x5ee684[_0x86fd('0x1d')]===_0x86fd('0x1e')&&typeof _0x5ee684[_0x86fd('0x1f')]===_0x86fd('0x1e');var _0x474ef3=_0x3b99c0['count'];var _0x28a832=_0x1b7e90?0x0:_0x5ee684[_0x86fd('0x1d')];var _0xc591eb=_0x1b7e90?_0x3b99c0[_0x86fd('0x20')]:_0x5ee684[_0x86fd('0x1d')]+_0x5ee684[_0x86fd('0x1f')];var _0x2898f1;if(_0xc591eb>=_0x474ef3){_0xc591eb=_0x474ef3;_0x2898f1=0xc8;}else{_0x2898f1=0xce;}_0x3d3723[_0x86fd('0x1a')](_0x2898f1);return _0x3d3723['set'](_0x86fd('0x21'),_0x28a832+'-'+_0xc591eb+'/'+_0x474ef3)[_0x86fd('0x1c')](_0x3b99c0);}return null;};}function patchUpdates(_0xa7d2dd){return function(_0x5a94ea){try{jsonpatch[_0x86fd('0x22')](_0x5a94ea,_0xa7d2dd,!![]);}catch(_0x441c51){return BPromise[_0x86fd('0x23')](_0x441c51);}return _0x5a94ea[_0x86fd('0x24')]();};}function saveUpdates(_0x1f6dba,_0x1b3cfd){return function(_0x3d37b7){if(_0x3d37b7){return _0x3d37b7['update'](_0x1f6dba)['then'](function(_0x376645){return _0x376645;});}return null;};}function removeEntity(_0x5455c3,_0x1bfdcb){return function(_0x38cd33){if(_0x38cd33){return _0x38cd33['destroy']()[_0x86fd('0x25')](function(){_0x5455c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x390d83,_0x70dbdf){return function(_0x2d9d4d){if(!_0x2d9d4d){_0x390d83[_0x86fd('0x26')](0x194);}return _0x2d9d4d;};}function handleError(_0x450353,_0x130ee3){_0x130ee3=_0x130ee3||0x1f4;return function(_0x4097bc){logger['error'](_0x4097bc[_0x86fd('0x27')]);if(_0x4097bc[_0x86fd('0x28')]){delete _0x4097bc[_0x86fd('0x28')];}_0x450353[_0x86fd('0x1a')](_0x130ee3)[_0x86fd('0x29')](_0x4097bc);};}exports[_0x86fd('0x2a')]=function(_0x40bba9,_0x3124de){var _0x1d5452={},_0xa4bba={},_0x3740ae={'count':0x0,'rows':[]};var _0x51194f=_[_0x86fd('0x2b')](db[_0x86fd('0x2c')][_0x86fd('0x2d')],function(_0x4d6288){return{'name':_0x4d6288[_0x86fd('0x2e')],'type':_0x4d6288[_0x86fd('0x2f')][_0x86fd('0x30')]};});_0xa4bba[_0x86fd('0x31')]=_[_0x86fd('0x32')](_[_0x86fd('0x2b')](_0x51194f,_0x86fd('0x28')),[_0x86fd('0x28')]);_0xa4bba['query']=_['keys'](_0x40bba9[_0x86fd('0x33')]);_0xa4bba[_0x86fd('0x34')]=_[_0x86fd('0x35')](_0xa4bba[_0x86fd('0x31')],_0xa4bba['query']);_0x1d5452['attributes']=_['intersection'](_0xa4bba[_0x86fd('0x31')],qs['fields'](_0x40bba9[_0x86fd('0x33')]['fields']));_0x1d5452['attributes']=_0x1d5452['attributes'][_0x86fd('0x36')]?_0x1d5452[_0x86fd('0x37')]:_0xa4bba['model'];if(!_0x40bba9[_0x86fd('0x33')][_0x86fd('0x38')]('nolimit')){_0x1d5452[_0x86fd('0x1f')]=qs[_0x86fd('0x1f')](_0x40bba9[_0x86fd('0x33')][_0x86fd('0x1f')]);_0x1d5452[_0x86fd('0x1d')]=qs[_0x86fd('0x1d')](_0x40bba9[_0x86fd('0x33')][_0x86fd('0x1d')]);}_0x1d5452[_0x86fd('0x39')]=qs['sort'](_0x40bba9[_0x86fd('0x33')][_0x86fd('0x3a')]);_0x1d5452[_0x86fd('0x3b')]=qs['filters'](_['pick'](_0x40bba9[_0x86fd('0x33')],_0xa4bba[_0x86fd('0x34')]),_0x51194f);if(_0x40bba9[_0x86fd('0x33')][_0x86fd('0x3c')]){_0x1d5452['where']=_[_0x86fd('0x3d')](_0x1d5452['where'],{'$or':_[_0x86fd('0x2b')](_0x51194f,function(_0x3a4b86){if(_0x3a4b86[_0x86fd('0x2f')]!==_0x86fd('0x3e')){var _0x285f58={};_0x285f58[_0x3a4b86[_0x86fd('0x28')]]={'$like':'%'+_0x40bba9['query'][_0x86fd('0x3c')]+'%'};return _0x285f58;}})});}_0x1d5452=_[_0x86fd('0x3d')]({},_0x1d5452,_0x40bba9['options']);var _0x3e7453={'where':_0x1d5452[_0x86fd('0x3b')]};return db['CmCustomField'][_0x86fd('0x20')](_0x3e7453)[_0x86fd('0x25')](function(_0x509b39){_0x3740ae['count']=_0x509b39;if(_0x40bba9['query'][_0x86fd('0x3f')]){_0x1d5452[_0x86fd('0x40')]=[{'all':!![]}];}return db[_0x86fd('0x2c')]['findAll'](_0x1d5452);})['then'](function(_0x231572){_0x3740ae[_0x86fd('0x41')]=_0x231572;return _0x3740ae;})[_0x86fd('0x25')](respondWithFilteredResult(_0x3124de,_0x1d5452))[_0x86fd('0x42')](handleError(_0x3124de,null));};exports[_0x86fd('0x43')]=function(_0x5d9018,_0x405fc1){var _0x42673f={'raw':!![],'where':{'id':_0x5d9018['params']['id']}},_0x98aacb={};_0x98aacb['model']=_[_0x86fd('0x44')](db[_0x86fd('0x2c')]['rawAttributes']);_0x98aacb['query']=_[_0x86fd('0x44')](_0x5d9018[_0x86fd('0x33')]);_0x98aacb[_0x86fd('0x34')]=_[_0x86fd('0x35')](_0x98aacb[_0x86fd('0x31')],_0x98aacb['query']);_0x42673f[_0x86fd('0x37')]=_['intersection'](_0x98aacb['model'],qs[_0x86fd('0x45')](_0x5d9018[_0x86fd('0x33')][_0x86fd('0x45')]));_0x42673f[_0x86fd('0x37')]=_0x42673f[_0x86fd('0x37')][_0x86fd('0x36')]?_0x42673f['attributes']:_0x98aacb[_0x86fd('0x31')];if(_0x5d9018[_0x86fd('0x33')]['includeAll']){_0x42673f[_0x86fd('0x40')]=[{'all':!![]}];}_0x42673f=_['merge']({},_0x42673f,_0x5d9018[_0x86fd('0x46')]);return db[_0x86fd('0x2c')]['find'](_0x42673f)[_0x86fd('0x25')](handleEntityNotFound(_0x405fc1,null))[_0x86fd('0x25')](respondWithResult(_0x405fc1,null))[_0x86fd('0x42')](handleError(_0x405fc1,null));};exports[_0x86fd('0x47')]=function(_0x12afb1,_0x1f8461){if(_0x12afb1[_0x86fd('0x48')]['id']){delete _0x12afb1['body']['id'];}return db[_0x86fd('0x2c')][_0x86fd('0x49')]({'where':{'id':_0x12afb1[_0x86fd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1f8461,null))['then'](saveUpdates(_0x12afb1[_0x86fd('0x48')],null))[_0x86fd('0x25')](respondWithResult(_0x1f8461,null))[_0x86fd('0x42')](handleError(_0x1f8461,null));};exports['destroy']=function(_0x2550d8,_0x161025){return db[_0x86fd('0x2c')]['find']({'where':{'id':_0x2550d8['params']['id']}})[_0x86fd('0x25')](handleEntityNotFound(_0x161025,null))[_0x86fd('0x25')](removeEntity(_0x161025,null))[_0x86fd('0x42')](handleError(_0x161025,null));};exports[_0x86fd('0x4b')]=function(_0x254aac,_0x4d4497){var _0x352c5a;return db[_0x86fd('0x4c')][_0x86fd('0x4d')](function(_0x27e25b){return db[_0x86fd('0x2c')][_0x86fd('0x4b')](_0x254aac['body'],{'transaction':_0x27e25b})[_0x86fd('0x25')](function(_0x1202db){_0x352c5a=_0x1202db;var _0x448909={'type':db[_0x86fd('0x4e')][_0x86fd('0x4f')],'transaction':_0x27e25b};switch(_0x254aac['body'][_0x86fd('0x2f')]){case _0x86fd('0x50'):_0x448909[_0x86fd('0x2f')]=db['Sequelize'][_0x86fd('0x4f')];break;case _0x86fd('0x51'):_0x448909['type']=db[_0x86fd('0x4e')][_0x86fd('0x52')];break;case'switch':_0x448909[_0x86fd('0x2f')]=db[_0x86fd('0x4e')][_0x86fd('0x53')];_0x448909[_0x86fd('0x54')]=![];break;default:}return db['sequelize'][_0x86fd('0x55')][_0x86fd('0x56')](_0x86fd('0x57'),util['format'](_0x86fd('0x58'),_0x352c5a['id']),_0x448909);})[_0x86fd('0x25')](function(){return _0x352c5a;});})[_0x86fd('0x25')](respondWithResult(_0x4d4497,0xc9))[_0x86fd('0x42')](handleError(_0x4d4497,null));}; \ No newline at end of file +var _0xb331=['name','send','map','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','CmCustomField','includeAll','include','rows','catch','show','options','find','body','params','create','sequelize','transaction','TEXT','number','Sequelize','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xb331,0x87));var _0x1b33=function(_0x4d14a0,_0x47627d){_0x4d14a0=_0x4d14a0-0x0;var _0x12e3c7=_0xb331[_0x4d14a0];return _0x12e3c7;};'use strict';var emlformat=require(_0x1b33('0x0'));var rimraf=require(_0x1b33('0x1'));var zipdir=require(_0x1b33('0x2'));var jsonpatch=require(_0x1b33('0x3'));var rp=require(_0x1b33('0x4'));var moment=require(_0x1b33('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b33('0x6'));var util=require(_0x1b33('0x7'));var path=require('path');var sox=require(_0x1b33('0x8'));var csv=require(_0x1b33('0x9'));var ejs=require(_0x1b33('0xa'));var fs=require('fs');var fs_extra=require(_0x1b33('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1b33('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1b33('0xd'));var toCsv=require(_0x1b33('0x9'));var querystring=require(_0x1b33('0xe'));var Papa=require('papaparse');var Redis=require(_0x1b33('0xf'));var authService=require(_0x1b33('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1b33('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b33('0x12'))(_0x1b33('0x13'));var utils=require(_0x1b33('0x14'));var config=require(_0x1b33('0x15'));var licenseUtil=require(_0x1b33('0x16'));var db=require(_0x1b33('0x17'))['db'];function respondWithStatusCode(_0x2552e5,_0x4c0e23){_0x4c0e23=_0x4c0e23||0xcc;return function(_0x2f0182){if(_0x2f0182){return _0x2552e5[_0x1b33('0x18')](_0x4c0e23);}return _0x2552e5[_0x1b33('0x19')](_0x4c0e23)[_0x1b33('0x1a')]();};}function respondWithResult(_0x423f4d,_0x3b09af){_0x3b09af=_0x3b09af||0xc8;return function(_0x29c902){if(_0x29c902){return _0x423f4d[_0x1b33('0x19')](_0x3b09af)['json'](_0x29c902);}};}function respondWithFilteredResult(_0x36ead6,_0x578e45){return function(_0x4efd8c){if(_0x4efd8c){var _0x2dbbfc=typeof _0x578e45[_0x1b33('0x1b')]===_0x1b33('0x1c')&&typeof _0x578e45[_0x1b33('0x1d')]===_0x1b33('0x1c');var _0xc851cf=_0x4efd8c['count'];var _0x10de0e=_0x2dbbfc?0x0:_0x578e45[_0x1b33('0x1b')];var _0x145f33=_0x2dbbfc?_0x4efd8c[_0x1b33('0x1e')]:_0x578e45['offset']+_0x578e45[_0x1b33('0x1d')];var _0x5c8fd8;if(_0x145f33>=_0xc851cf){_0x145f33=_0xc851cf;_0x5c8fd8=0xc8;}else{_0x5c8fd8=0xce;}_0x36ead6[_0x1b33('0x19')](_0x5c8fd8);return _0x36ead6['set'](_0x1b33('0x1f'),_0x10de0e+'-'+_0x145f33+'/'+_0xc851cf)[_0x1b33('0x20')](_0x4efd8c);}return null;};}function patchUpdates(_0x5a170b){return function(_0x1d3563){try{jsonpatch[_0x1b33('0x21')](_0x1d3563,_0x5a170b,!![]);}catch(_0x37ee75){return BPromise[_0x1b33('0x22')](_0x37ee75);}return _0x1d3563[_0x1b33('0x23')]();};}function saveUpdates(_0x260e7e,_0x5a5c32){return function(_0x66a322){if(_0x66a322){return _0x66a322[_0x1b33('0x24')](_0x260e7e)['then'](function(_0x4f918f){return _0x4f918f;});}return null;};}function removeEntity(_0x158747,_0x4d6b17){return function(_0x2417d){if(_0x2417d){return _0x2417d[_0x1b33('0x25')]()[_0x1b33('0x26')](function(){_0x158747[_0x1b33('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f64b1,_0x204733){return function(_0xa3c033){if(!_0xa3c033){_0x4f64b1[_0x1b33('0x18')](0x194);}return _0xa3c033;};}function handleError(_0x2a71bb,_0x442f38){_0x442f38=_0x442f38||0x1f4;return function(_0x5d639e){logger[_0x1b33('0x27')](_0x5d639e[_0x1b33('0x28')]);if(_0x5d639e[_0x1b33('0x29')]){delete _0x5d639e[_0x1b33('0x29')];}_0x2a71bb[_0x1b33('0x19')](_0x442f38)[_0x1b33('0x2a')](_0x5d639e);};}exports['index']=function(_0x3db493,_0x5a6c66){var _0x15b291={},_0x45f5eb={},_0x4e1f4b={'count':0x0,'rows':[]};var _0xeb2107=_[_0x1b33('0x2b')](db['CmCustomField'][_0x1b33('0x2c')],function(_0x5de9e7){return{'name':_0x5de9e7[_0x1b33('0x2d')],'type':_0x5de9e7['type'][_0x1b33('0x2e')]};});_0x45f5eb[_0x1b33('0x2f')]=_[_0x1b33('0x30')](_['map'](_0xeb2107,'name'),['name']);_0x45f5eb[_0x1b33('0x31')]=_[_0x1b33('0x32')](_0x3db493[_0x1b33('0x31')]);_0x45f5eb[_0x1b33('0x33')]=_[_0x1b33('0x34')](_0x45f5eb[_0x1b33('0x2f')],_0x45f5eb[_0x1b33('0x31')]);_0x15b291['attributes']=_[_0x1b33('0x34')](_0x45f5eb[_0x1b33('0x2f')],qs[_0x1b33('0x35')](_0x3db493['query'][_0x1b33('0x35')]));_0x15b291[_0x1b33('0x36')]=_0x15b291[_0x1b33('0x36')][_0x1b33('0x37')]?_0x15b291[_0x1b33('0x36')]:_0x45f5eb[_0x1b33('0x2f')];if(!_0x3db493['query'][_0x1b33('0x38')](_0x1b33('0x39'))){_0x15b291[_0x1b33('0x1d')]=qs[_0x1b33('0x1d')](_0x3db493[_0x1b33('0x31')][_0x1b33('0x1d')]);_0x15b291[_0x1b33('0x1b')]=qs[_0x1b33('0x1b')](_0x3db493['query'][_0x1b33('0x1b')]);}_0x15b291['order']=qs[_0x1b33('0x3a')](_0x3db493['query'][_0x1b33('0x3a')]);_0x15b291[_0x1b33('0x3b')]=qs[_0x1b33('0x33')](_[_0x1b33('0x3c')](_0x3db493[_0x1b33('0x31')],_0x45f5eb[_0x1b33('0x33')]),_0xeb2107);if(_0x3db493[_0x1b33('0x31')][_0x1b33('0x3d')]){_0x15b291['where']=_[_0x1b33('0x3e')](_0x15b291[_0x1b33('0x3b')],{'$or':_['map'](_0xeb2107,function(_0x36d623){if(_0x36d623[_0x1b33('0x3f')]!=='VIRTUAL'){var _0x3b5dca={};_0x3b5dca[_0x36d623[_0x1b33('0x29')]]={'$like':'%'+_0x3db493[_0x1b33('0x31')][_0x1b33('0x3d')]+'%'};return _0x3b5dca;}})});}_0x15b291=_[_0x1b33('0x3e')]({},_0x15b291,_0x3db493['options']);var _0x7ba47a={'where':_0x15b291['where']};return db[_0x1b33('0x40')][_0x1b33('0x1e')](_0x7ba47a)[_0x1b33('0x26')](function(_0x2faede){_0x4e1f4b['count']=_0x2faede;if(_0x3db493[_0x1b33('0x31')][_0x1b33('0x41')]){_0x15b291[_0x1b33('0x42')]=[{'all':!![]}];}return db[_0x1b33('0x40')]['findAll'](_0x15b291);})[_0x1b33('0x26')](function(_0x23bccd){_0x4e1f4b[_0x1b33('0x43')]=_0x23bccd;return _0x4e1f4b;})[_0x1b33('0x26')](respondWithFilteredResult(_0x5a6c66,_0x15b291))[_0x1b33('0x44')](handleError(_0x5a6c66,null));};exports[_0x1b33('0x45')]=function(_0x2d0fa1,_0x23145d){var _0x6571d={'raw':!![],'where':{'id':_0x2d0fa1['params']['id']}},_0x2ce365={};_0x2ce365[_0x1b33('0x2f')]=_['keys'](db[_0x1b33('0x40')]['rawAttributes']);_0x2ce365[_0x1b33('0x31')]=_['keys'](_0x2d0fa1[_0x1b33('0x31')]);_0x2ce365[_0x1b33('0x33')]=_[_0x1b33('0x34')](_0x2ce365[_0x1b33('0x2f')],_0x2ce365[_0x1b33('0x31')]);_0x6571d['attributes']=_[_0x1b33('0x34')](_0x2ce365[_0x1b33('0x2f')],qs['fields'](_0x2d0fa1['query'][_0x1b33('0x35')]));_0x6571d[_0x1b33('0x36')]=_0x6571d[_0x1b33('0x36')]['length']?_0x6571d[_0x1b33('0x36')]:_0x2ce365['model'];if(_0x2d0fa1[_0x1b33('0x31')][_0x1b33('0x41')]){_0x6571d[_0x1b33('0x42')]=[{'all':!![]}];}_0x6571d=_[_0x1b33('0x3e')]({},_0x6571d,_0x2d0fa1[_0x1b33('0x46')]);return db[_0x1b33('0x40')][_0x1b33('0x47')](_0x6571d)[_0x1b33('0x26')](handleEntityNotFound(_0x23145d,null))[_0x1b33('0x26')](respondWithResult(_0x23145d,null))[_0x1b33('0x44')](handleError(_0x23145d,null));};exports['update']=function(_0x46ce4f,_0x3782f2){if(_0x46ce4f[_0x1b33('0x48')]['id']){delete _0x46ce4f['body']['id'];}return db[_0x1b33('0x40')][_0x1b33('0x47')]({'where':{'id':_0x46ce4f[_0x1b33('0x49')]['id']}})[_0x1b33('0x26')](handleEntityNotFound(_0x3782f2,null))[_0x1b33('0x26')](saveUpdates(_0x46ce4f[_0x1b33('0x48')],null))[_0x1b33('0x26')](respondWithResult(_0x3782f2,null))[_0x1b33('0x44')](handleError(_0x3782f2,null));};exports[_0x1b33('0x25')]=function(_0x31c54a,_0x6c4086){return db[_0x1b33('0x40')]['find']({'where':{'id':_0x31c54a[_0x1b33('0x49')]['id']}})[_0x1b33('0x26')](handleEntityNotFound(_0x6c4086,null))[_0x1b33('0x26')](removeEntity(_0x6c4086,null))['catch'](handleError(_0x6c4086,null));};exports[_0x1b33('0x4a')]=function(_0x20989c,_0x2f688b){var _0x2542dd;return db[_0x1b33('0x4b')][_0x1b33('0x4c')](function(_0x1a080b){return db[_0x1b33('0x40')][_0x1b33('0x4a')](_0x20989c[_0x1b33('0x48')],{'transaction':_0x1a080b})['then'](function(_0x378bdb){_0x2542dd=_0x378bdb;var _0x2b1b99={'type':db['Sequelize'][_0x1b33('0x4d')],'transaction':_0x1a080b};switch(_0x20989c[_0x1b33('0x48')][_0x1b33('0x3f')]){case'text':_0x2b1b99[_0x1b33('0x3f')]=db['Sequelize'][_0x1b33('0x4d')];break;case _0x1b33('0x4e'):_0x2b1b99[_0x1b33('0x3f')]=db[_0x1b33('0x4f')][_0x1b33('0x50')];break;case'switch':_0x2b1b99['type']=db[_0x1b33('0x4f')][_0x1b33('0x51')];_0x2b1b99[_0x1b33('0x52')]=![];break;default:}return db[_0x1b33('0x4b')][_0x1b33('0x53')][_0x1b33('0x54')](_0x1b33('0x55'),util[_0x1b33('0x56')](_0x1b33('0x57'),_0x2542dd['id']),_0x2b1b99);})[_0x1b33('0x26')](function(){return _0x2542dd;});})['then'](respondWithResult(_0x2f688b,0xc9))[_0x1b33('0x44')](handleError(_0x2f688b,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 329c600..541edcf 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 _0x5311=['./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4054e7,_0xe59978){var _0x30f9d7=function(_0x1603b3){while(--_0x1603b3){_0x4054e7['push'](_0x4054e7['shift']());}};_0x30f9d7(++_0xe59978);}(_0x5311,0xd0));var _0x1531=function(_0x50ca8b,_0x8e7428){_0x50ca8b=_0x50ca8b-0x0;var _0x43bc78=_0x5311[_0x50ca8b];return _0x43bc78;};'use strict';var _=require(_0x1531('0x0'));var util=require('util');var logger=require(_0x1531('0x1'))('api');var moment=require(_0x1531('0x2'));var BPromise=require(_0x1531('0x3'));var rp=require(_0x1531('0x4'));var fs=require('fs');var path=require(_0x1531('0x5'));var rimraf=require(_0x1531('0x6'));var config=require(_0x1531('0x7'));var attributes=require(_0x1531('0x8'));module[_0x1531('0x9')]=function(_0x52e613,_0x20b505){return _0x52e613[_0x1531('0xa')]('CmCustomField',attributes,{'tableName':_0x1531('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0aa4=['define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports'];(function(_0x26fbfe,_0x3b165b){var _0x3f582d=function(_0x27de3b){while(--_0x27de3b){_0x26fbfe['push'](_0x26fbfe['shift']());}};_0x3f582d(++_0x3b165b);}(_0x0aa4,0x1f1));var _0x40aa=function(_0x56b7df,_0x3e54bd){_0x56b7df=_0x56b7df-0x0;var _0x41a7e1=_0x0aa4[_0x56b7df];return _0x41a7e1;};'use strict';var _=require(_0x40aa('0x0'));var util=require('util');var logger=require(_0x40aa('0x1'))(_0x40aa('0x2'));var moment=require(_0x40aa('0x3'));var BPromise=require(_0x40aa('0x4'));var rp=require(_0x40aa('0x5'));var fs=require('fs');var path=require(_0x40aa('0x6'));var rimraf=require(_0x40aa('0x7'));var config=require('../../config/environment');var attributes=require(_0x40aa('0x8'));module[_0x40aa('0x9')]=function(_0x2fd182,_0x35e004){return _0x2fd182[_0x40aa('0xa')](_0x40aa('0xb'),attributes,{'tableName':_0x40aa('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index cd543a5..e376871 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 _0x19ab=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x460114,_0x3f7aba){var _0x3c681f=function(_0x49a168){while(--_0x49a168){_0x460114['push'](_0x460114['shift']());}};_0x3c681f(++_0x3f7aba);}(_0x19ab,0x74));var _0xb19a=function(_0x12796b,_0xceeb0a){_0x12796b=_0x12796b-0x0;var _0x396fd3=_0x19ab[_0x12796b];return _0x396fd3;};'use strict';var _=require(_0xb19a('0x0'));var util=require(_0xb19a('0x1'));var moment=require(_0xb19a('0x2'));var BPromise=require(_0xb19a('0x3'));var rs=require(_0xb19a('0x4'));var fs=require('fs');var Redis=require(_0xb19a('0x5'));var db=require(_0xb19a('0x6'))['db'];var utils=require(_0xb19a('0x7'));var logger=require(_0xb19a('0x8'))(_0xb19a('0x9'));var config=require(_0xb19a('0xa'));var jayson=require(_0xb19a('0xb'));var client=jayson[_0xb19a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44915e,_0x34f725,_0x298a3b){return new BPromise(function(_0x445b35,_0x29b67c){return client[_0xb19a('0xd')](_0x44915e,_0x298a3b)[_0xb19a('0xe')](function(_0x32fe92){logger[_0xb19a('0xf')](_0xb19a('0x10'),_0x34f725,_0xb19a('0x11'));logger[_0xb19a('0x12')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x34f725,_0xb19a('0x11'),JSON[_0xb19a('0x13')](_0x32fe92));if(_0x32fe92['error']){if(_0x32fe92[_0xb19a('0x14')]['code']===0x1f4){logger[_0xb19a('0x14')]('CmCustomField,\x20%s,\x20%s',_0x34f725,_0x32fe92['error']['message']);return _0x29b67c(_0x32fe92[_0xb19a('0x14')][_0xb19a('0x15')]);}logger[_0xb19a('0x14')]('CmCustomField,\x20%s,\x20%s',_0x34f725,_0x32fe92['error']['message']);return _0x445b35(_0x32fe92[_0xb19a('0x14')][_0xb19a('0x15')]);}else{logger[_0xb19a('0xf')](_0xb19a('0x10'),_0x34f725,_0xb19a('0x11'));_0x445b35(_0x32fe92[_0xb19a('0x16')][_0xb19a('0x15')]);}})[_0xb19a('0x17')](function(_0x3f57ff){logger[_0xb19a('0x14')](_0xb19a('0x10'),_0x34f725,_0x3f57ff);_0x29b67c(_0x3f57ff);});});} \ No newline at end of file +var _0xda9a=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','bluebird'];(function(_0x5723df,_0x2d874a){var _0x137cbb=function(_0x3a6779){while(--_0x3a6779){_0x5723df['push'](_0x5723df['shift']());}};_0x137cbb(++_0x2d874a);}(_0xda9a,0x1a3));var _0xada9=function(_0x3b6652,_0x32486d){_0x3b6652=_0x3b6652-0x0;var _0x14d39f=_0xda9a[_0x3b6652];return _0x14d39f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xada9('0x0'));var rs=require(_0xada9('0x1'));var fs=require('fs');var Redis=require(_0xada9('0x2'));var db=require(_0xada9('0x3'))['db'];var utils=require(_0xada9('0x4'));var logger=require(_0xada9('0x5'))(_0xada9('0x6'));var config=require(_0xada9('0x7'));var jayson=require(_0xada9('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x7240a3,_0x25f3a1,_0xf37fb7){return new BPromise(function(_0x2fd9c8,_0x2dd841){return client['request'](_0x7240a3,_0xf37fb7)[_0xada9('0x9')](function(_0x405200){logger['info'](_0xada9('0xa'),_0x25f3a1,_0xada9('0xb'));logger[_0xada9('0xc')](_0xada9('0xd'),_0x25f3a1,_0xada9('0xb'),JSON[_0xada9('0xe')](_0x405200));if(_0x405200[_0xada9('0xf')]){if(_0x405200[_0xada9('0xf')][_0xada9('0x10')]===0x1f4){logger[_0xada9('0xf')](_0xada9('0xa'),_0x25f3a1,_0x405200[_0xada9('0xf')]['message']);return _0x2dd841(_0x405200[_0xada9('0xf')]['message']);}logger[_0xada9('0xf')](_0xada9('0xa'),_0x25f3a1,_0x405200['error'][_0xada9('0x11')]);return _0x2fd9c8(_0x405200['error'][_0xada9('0x11')]);}else{logger[_0xada9('0x12')](_0xada9('0xa'),_0x25f3a1,'request\x20sent');_0x2fd9c8(_0x405200[_0xada9('0x13')][_0xada9('0x11')]);}})[_0xada9('0x14')](function(_0x52c9d1){logger[_0xada9('0xf')](_0xada9('0xa'),_0x25f3a1,_0x52c9d1);_0x2dd841(_0x52c9d1);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index b78fbeb..6c6659c 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 _0xf849=['fs-extra','./cmCustomField.controller','index','isAuthenticated','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x98ee08,_0x53bbb0){var _0x2b9401=function(_0x3d3f21){while(--_0x3d3f21){_0x98ee08['push'](_0x98ee08['shift']());}};_0x2b9401(++_0x53bbb0);}(_0xf849,0x193));var _0x9f84=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0xf849[_0x422be2];return _0x1b820e;};'use strict';var multer=require(_0x9f84('0x0'));var util=require(_0x9f84('0x1'));var path=require(_0x9f84('0x2'));var timeout=require('connect-timeout');var express=require(_0x9f84('0x3'));var router=express[_0x9f84('0x4')]();var fs_extra=require(_0x9f84('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f84('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f84('0x7')]);router['get']('/:id',auth[_0x9f84('0x8')](),controller['show']);router[_0x9f84('0x9')]('/',auth[_0x9f84('0x8')](),controller[_0x9f84('0xa')]);router[_0x9f84('0xb')](_0x9f84('0xc'),auth[_0x9f84('0x8')](),controller[_0x9f84('0xd')]);router[_0x9f84('0xe')](_0x9f84('0xc'),auth[_0x9f84('0x8')](),controller[_0x9f84('0xf')]);module[_0x9f84('0x10')]=router; \ No newline at end of file +var _0x2e8a=['update','delete','/:id','exports','util','path','express','Router','../../components/auth/service','isAuthenticated','index','get','show','post','put'];(function(_0x452d6a,_0x24c4b0){var _0x512067=function(_0x48aef2){while(--_0x48aef2){_0x452d6a['push'](_0x452d6a['shift']());}};_0x512067(++_0x24c4b0);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x2803dc,_0x1cdaf1){_0x2803dc=_0x2803dc-0x0;var _0x552ae4=_0x2e8a[_0x2803dc];return _0x552ae4;};'use strict';var multer=require('multer');var util=require(_0xa2e8('0x0'));var path=require(_0xa2e8('0x1'));var timeout=require('connect-timeout');var express=require(_0xa2e8('0x2'));var router=express[_0xa2e8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa2e8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router['get']('/',auth[_0xa2e8('0x5')](),controller[_0xa2e8('0x6')]);router[_0xa2e8('0x7')]('/:id',auth[_0xa2e8('0x5')](),controller[_0xa2e8('0x8')]);router[_0xa2e8('0x9')]('/',auth[_0xa2e8('0x5')](),controller['create']);router[_0xa2e8('0xa')]('/:id',auth[_0xa2e8('0x5')](),controller[_0xa2e8('0xb')]);router[_0xa2e8('0xc')](_0xa2e8('0xd'),auth[_0xa2e8('0x5')](),controller['destroy']);module[_0xa2e8('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7e4935b..0216c73 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 _0x75ae=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x9fbe5b,_0xded2ab){var _0x23f73e=function(_0x5c1421){while(--_0x5c1421){_0x9fbe5b['push'](_0x9fbe5b['shift']());}};_0x23f73e(++_0xded2ab);}(_0x75ae,0xa8));var _0xe75a=function(_0x418ee1,_0x1a82de){_0x418ee1=_0x418ee1-0x0;var _0x4aa098=_0x75ae[_0x418ee1];return _0x4aa098;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xe75a('0x0')],'allowNull':![]},'active':{'type':Sequelize[_0xe75a('0x1')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe75a('0x2')],'defaultValue':moment()[_0xe75a('0x3')](_0xe75a('0x4'))},'countbusyretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xe75a('0x1')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe75a('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe75a('0x2')]},'priority':{'type':Sequelize[_0xe75a('0x5')](0x2)[_0xe75a('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe75a('0x1')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe75a('0x5')],'unique':_0xe75a('0x7')},'ListId':{'type':Sequelize[_0xe75a('0x5')],'unique':_0xe75a('0x7')},'UserId':{'type':Sequelize[_0xe75a('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe75a('0x7')},'CampaignId':{'type':Sequelize[_0xe75a('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe75a('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xe75a('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xe75a('0x0')]},'recallmeNotifiedDate':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x69f4=['exports','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue','STRING','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x69f4,0xc7));var _0x469f=function(_0x1c0630,_0x11f37a){_0x1c0630=_0x1c0630-0x0;var _0x1125a3=_0x69f4[_0x1c0630];return _0x1125a3;};'use strict';var moment=require(_0x469f('0x0'));var Sequelize=require('sequelize');module[_0x469f('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x469f('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x469f('0x3')](_0x469f('0x4'))},'countbusyretry':{'type':Sequelize[_0x469f('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x469f('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x469f('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x469f('0x6')]},'priority':{'type':Sequelize[_0x469f('0x5')](0x2)[_0x469f('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x469f('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x469f('0x5')],'unique':_0x469f('0x8')},'ListId':{'type':Sequelize[_0x469f('0x5')],'unique':_0x469f('0x8')},'UserId':{'type':Sequelize[_0x469f('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x469f('0x8')},'CampaignId':{'type':Sequelize[_0x469f('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x469f('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x469f('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x469f('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x469f('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x469f('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x469f('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x469f('0x9')]},'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 0e10a1f..4c72945 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 _0xc492=['$iLike','$overlap','$contained','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','CmHopper','count','include','show','find','body','params','catch','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','CmContact','firstName','isNil','lastName','finally','create','CmHopperAdditionalPhone','end','getPreview','describe','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getPreviewRecall','transaction','CmCompany','getOpenContacts','getVoiceQueues','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/environment','json','offset','undefined','limit','status','set','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','concat','$and','$or','$gte','$lt','$lte','$ne','$not','$between','$notBetween','$notIn','$like'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xc492,0xd7));var _0x2c49=function(_0x32790a,_0x40eb8c){_0x32790a=_0x32790a-0x0;var _0x365aa0=_0xc492[_0x32790a];return _0x365aa0;};'use strict';var moment=require(_0x2c49('0x0'));var _=require(_0x2c49('0x1'));var qs=require(_0x2c49('0x2'));var logger=require('../../config/logger')('api');var shared=require(_0x2c49('0x3'));var db=require('../../mysqldb')['db'];function respondWithResult(_0x4c9b2d,_0x555cba){_0x555cba=_0x555cba||0xc8;return function(_0x1de940){if(_0x1de940){return _0x4c9b2d['status'](_0x555cba)[_0x2c49('0x4')](_0x1de940);}};}function respondWithFilteredResult(_0x499c4e,_0x3ad911){return function(_0x9c10f7){if(_0x9c10f7){var _0x4c76dd=typeof _0x3ad911[_0x2c49('0x5')]===_0x2c49('0x6')&&typeof _0x3ad911[_0x2c49('0x7')]===_0x2c49('0x6');var _0x326287=_0x9c10f7['count'];var _0x3d3e2a=_0x4c76dd?0x0:_0x3ad911['offset'];var _0x493cd2=_0x4c76dd?_0x9c10f7['count']:_0x3ad911['offset']+_0x3ad911[_0x2c49('0x7')];var _0x4d07b6;if(_0x493cd2>=_0x326287){_0x493cd2=_0x326287;_0x4d07b6=0xc8;}else{_0x4d07b6=0xce;}_0x499c4e[_0x2c49('0x8')](_0x4d07b6);return _0x499c4e[_0x2c49('0x9')]('Content-Range',_0x3d3e2a+'-'+_0x493cd2+'/'+_0x326287)[_0x2c49('0x4')](_0x9c10f7);}return null;};}function saveUpdates(_0x1cc78b,_0x19f7d9){return function(_0x1e2210){if(_0x1e2210){return _0x1e2210[_0x2c49('0xa')](_0x1cc78b)[_0x2c49('0xb')](function(_0x560c76){return _0x560c76;});}return null;};}function handleEntityNotFound(_0x2006cf,_0x5af5e7){return function(_0x2eeb10){if(!_0x2eeb10){_0x2006cf[_0x2c49('0xc')](0x194);}return _0x2eeb10;};}function handleError(_0x14f529,_0x561d83){_0x561d83=_0x561d83||0x1f4;return function(_0x19f59b){logger[_0x2c49('0xd')](_0x19f59b[_0x2c49('0xe')]);if(_0x19f59b[_0x2c49('0xf')]){delete _0x19f59b[_0x2c49('0xf')];}_0x14f529[_0x2c49('0x8')](_0x561d83)[_0x2c49('0x10')](_0x19f59b);};}exports[_0x2c49('0x11')]=function(_0x1fe9f8,_0x89bcb){var _0x4f6063={},_0x3001af={},_0x3fe920={'count':0x0,'rows':[]};var _0x3dfb36=_[_0x2c49('0x12')](db['CmHopper'][_0x2c49('0x13')],function(_0x578c07){return{'name':_0x578c07[_0x2c49('0x14')],'type':_0x578c07[_0x2c49('0x15')]['key']};});_0x3001af['model']=_[_0x2c49('0x12')](_0x3dfb36,_0x2c49('0xf'));_0x3001af[_0x2c49('0x16')]=_[_0x2c49('0x17')](_0x1fe9f8[_0x2c49('0x16')]);_0x3001af[_0x2c49('0x18')]=_[_0x2c49('0x19')](_0x3001af[_0x2c49('0x1a')],_0x3001af[_0x2c49('0x16')]);_0x3001af['filters']=_[_0x2c49('0x1b')](_0x3001af[_0x2c49('0x18')],[_0x2c49('0x1c'),_0x2c49('0x1d'),'$gt',_0x2c49('0x1e'),_0x2c49('0x1f'),_0x2c49('0x20'),_0x2c49('0x21'),'$eq',_0x2c49('0x22'),_0x2c49('0x23'),_0x2c49('0x24'),'$in',_0x2c49('0x25'),_0x2c49('0x26'),'$notLike',_0x2c49('0x27'),'$notILike','$like',_0x2c49('0x28'),'$contains',_0x2c49('0x29'),'$any']);_0x4f6063[_0x2c49('0x2a')]=_[_0x2c49('0x19')](_0x3001af[_0x2c49('0x1a')],qs[_0x2c49('0x2b')](_0x1fe9f8[_0x2c49('0x16')][_0x2c49('0x2b')]));_0x4f6063[_0x2c49('0x2a')]=_0x4f6063[_0x2c49('0x2a')][_0x2c49('0x2c')]?_0x4f6063[_0x2c49('0x2a')]:_0x3001af['model'];if(!_0x1fe9f8[_0x2c49('0x16')]['hasOwnProperty'](_0x2c49('0x2d'))){_0x4f6063[_0x2c49('0x7')]=qs[_0x2c49('0x7')](_0x1fe9f8[_0x2c49('0x16')][_0x2c49('0x7')]);_0x4f6063[_0x2c49('0x5')]=qs[_0x2c49('0x5')](_0x1fe9f8[_0x2c49('0x16')][_0x2c49('0x5')]);}_0x4f6063[_0x2c49('0x2e')]=qs[_0x2c49('0x2f')](_0x1fe9f8[_0x2c49('0x16')][_0x2c49('0x2f')]);_0x4f6063[_0x2c49('0x30')]=qs['filters'](_['pick'](_0x1fe9f8[_0x2c49('0x16')],_0x3001af[_0x2c49('0x18')]),_0x3dfb36);if(_0x1fe9f8['query'][_0x2c49('0x31')]){_0x4f6063[_0x2c49('0x30')]=_[_0x2c49('0x32')](_0x4f6063[_0x2c49('0x30')],{'$or':_[_0x2c49('0x12')](_0x3dfb36,function(_0x1df5de){if(_0x1df5de[_0x2c49('0x15')]!==_0x2c49('0x33')){var _0x4ed053={};_0x4ed053[_0x1df5de[_0x2c49('0xf')]]={'$like':'%'+_0x1fe9f8[_0x2c49('0x16')]['filter']+'%'};return _0x4ed053;}})});}_0x4f6063=_[_0x2c49('0x32')]({},_0x4f6063,_0x1fe9f8[_0x2c49('0x34')]);var _0xddfe1a={'where':_0x4f6063['where']};return db[_0x2c49('0x35')][_0x2c49('0x36')](_0xddfe1a)[_0x2c49('0xb')](function(_0x321fa3){_0x3fe920[_0x2c49('0x36')]=_0x321fa3;if(_0x1fe9f8[_0x2c49('0x16')]['includeAll']){_0x4f6063[_0x2c49('0x37')]=[{'all':!![]}];}return db[_0x2c49('0x35')]['findAll'](_0x4f6063);})[_0x2c49('0xb')](function(_0x438486){_0x3fe920['rows']=_0x438486;return _0x3fe920;})[_0x2c49('0xb')](respondWithFilteredResult(_0x89bcb,_0x4f6063))['catch'](handleError(_0x89bcb,null));};exports[_0x2c49('0x38')]=function(_0x47773e,_0x477efc){var _0x5a6822={'raw':!![],'where':{'id':_0x47773e['params']['id']}},_0x472d84={};_0x472d84[_0x2c49('0x1a')]=_[_0x2c49('0x17')](db[_0x2c49('0x35')][_0x2c49('0x13')]);_0x472d84[_0x2c49('0x16')]=_['keys'](_0x47773e[_0x2c49('0x16')]);_0x472d84[_0x2c49('0x18')]=_[_0x2c49('0x19')](_0x472d84[_0x2c49('0x1a')],_0x472d84[_0x2c49('0x16')]);_0x5a6822[_0x2c49('0x2a')]=_[_0x2c49('0x19')](_0x472d84[_0x2c49('0x1a')],qs['fields'](_0x47773e[_0x2c49('0x16')][_0x2c49('0x2b')]));_0x5a6822['attributes']=_0x5a6822[_0x2c49('0x2a')][_0x2c49('0x2c')]?_0x5a6822['attributes']:_0x472d84[_0x2c49('0x1a')];if(_0x47773e['query']['includeAll']){_0x5a6822['include']=[{'all':!![]}];}_0x5a6822=_['merge']({},_0x5a6822,_0x47773e[_0x2c49('0x34')]);return db[_0x2c49('0x35')][_0x2c49('0x39')](_0x5a6822)[_0x2c49('0xb')](handleEntityNotFound(_0x477efc,null))[_0x2c49('0xb')](respondWithResult(_0x477efc,null))['catch'](handleError(_0x477efc,null));};exports['create']=function(_0x5757e5,_0x5ee329){return db[_0x2c49('0x35')]['create'](_0x5757e5[_0x2c49('0x3a')],{})['then'](respondWithResult(_0x5ee329,0xc9))['catch'](handleError(_0x5ee329,null));};exports['update']=function(_0x1d4d7b,_0x51e7e5){if(_0x1d4d7b[_0x2c49('0x3a')]['id']){delete _0x1d4d7b[_0x2c49('0x3a')]['id'];}return db['CmHopper']['find']({'where':{'id':_0x1d4d7b[_0x2c49('0x3b')]['id']}})[_0x2c49('0xb')](handleEntityNotFound(_0x51e7e5,null))[_0x2c49('0xb')](saveUpdates(_0x1d4d7b[_0x2c49('0x3a')],null))[_0x2c49('0xb')](respondWithResult(_0x51e7e5,null))['catch'](handleError(_0x51e7e5,null));};exports['describe']=function(_0x426c8a,_0x2587c6){return db['CmHopper']['describe']()['then'](respondWithResult(_0x2587c6,null))[_0x2c49('0x3c')](handleError(_0x2587c6,null));};exports[_0x2c49('0x3d')]=function(_0x98fc90,_0x55e4cd){var _0xf4c2c2;var _0xea11c4=_0x98fc90[_0x2c49('0x3b')]['id'];return db[_0x2c49('0x35')][_0x2c49('0x39')]({'where':{'id':_0x98fc90[_0x2c49('0x3b')]['id']}})[_0x2c49('0xb')](handleEntityNotFound(_0x55e4cd,null))['then'](function(_0x5f2267){if(_0x5f2267){return _0x5f2267['destroy']()[_0x2c49('0xb')](function(_0x1aa034){return _0x1aa034;});}})['then'](function(_0x1ea344){_0xf4c2c2=_0x1ea344;if(_0x1ea344){if(_0x1ea344[_0x2c49('0x3e')]||_0x1ea344[_0x2c49('0x3f')]){return db[_0x1ea344[_0x2c49('0x3e')]?_0x2c49('0x40'):_0x2c49('0x41')][_0x2c49('0x39')]({'where':{'id':_0x1ea344[_0x2c49('0x3e')]?_0x1ea344[_0x2c49('0x3e')]:_0x1ea344[_0x2c49('0x3f')]},'attributes':['id','name'],'raw':!![]});}}})[_0x2c49('0xb')](function(_0xe026bf){var _0xfcdbaf={};if(_0xe026bf){_['merge'](_0xfcdbaf,_[_0x2c49('0x42')](_0xf4c2c2[_0x2c49('0x43')],['createdAt',_0x2c49('0x44'),'id']));_0xfcdbaf[_0x2c49('0x45')]=0x15;_0xfcdbaf[_0x2c49('0x46')]=_0x2c49('0x47');_0xfcdbaf['campaign']=_0xe026bf[_0x2c49('0xf')];_0xfcdbaf[_0x2c49('0x48')]=_0x98fc90[_0x2c49('0x49')][_0x2c49('0xf')];_0xfcdbaf['UserId']=_0x98fc90[_0x2c49('0x49')]['id'];_0xfcdbaf[_0x2c49('0x47')]=!![];_0xfcdbaf[_0x2c49('0x4a')]=moment()[_0x2c49('0x4b')](_0x2c49('0x4c'));_0xfcdbaf[_0x2c49('0x4d')]=_0xf4c2c2[_0x2c49('0x4e')];_0xfcdbaf[_0x2c49('0x4f')]=_0xf4c2c2[_0x2c49('0x3e')]?'queue':'ivr';return db[_0x2c49('0x50')][_0x2c49('0x39')]({'where':{'id':_0xfcdbaf['ContactId']},'attributes':[_0x2c49('0x51'),'lastName']})[_0x2c49('0xb')](function(_0x32b4fd){if(!_[_0x2c49('0x52')](_0x55e4cd)&&!_[_0x2c49('0x52')](_0x32b4fd[_0x2c49('0x51')])){_0xfcdbaf['calleridname']=_0x32b4fd[_0x2c49('0x51')];if(!_[_0x2c49('0x52')](_0x32b4fd[_0x2c49('0x53')])){_0xfcdbaf['calleridname']+='\x20'+_0x32b4fd[_0x2c49('0x53')];}}})[_0x2c49('0x54')](function(){return db['CmHopperFinal'][_0x2c49('0x55')](_0xfcdbaf);});}})[_0x2c49('0xb')](function(_0x547311){return db[_0x2c49('0x56')]['destroy']({'where':{'CmHopperId':_0xea11c4}});})[_0x2c49('0xb')](function(){return _0x55e4cd[_0x2c49('0x8')](0xcc)[_0x2c49('0x57')]();})[_0x2c49('0x3c')](handleError(_0x55e4cd,null));};exports[_0x2c49('0x58')]=function(_0x144658,_0x4a4a2f){var _0xbc3817=[];return db[_0x2c49('0x50')][_0x2c49('0x59')]()['then'](function(_0x1a71da){_0xbc3817=_['keys'](_0x1a71da);return _0x144658['user']['getVoiceQueues']({'where':{'type':_0x2c49('0x5a'),'dialActive':!![],'dialMethod':_0x2c49('0x5b')},'attributes':['id',_0x2c49('0x5c'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x2c49('0xb')](function(_0x57237c){if(_0x57237c&&_0x57237c['length']){return db['sequelize']['transaction'](function(_0x5ae15e){var _0x127dea={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2c49('0x12')](_0x57237c,'id')},'$or':[{'UserId':null},{'UserId':_0x144658['user']['id']}]};var _0x5f28b7={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x57237c)['filter']([_0x2c49('0x5d'),0x0])[_0x2c49('0x12')]('id')[_0x2c49('0x5e')]()},'$or':[{'UserId':null},{'UserId':_0x144658[_0x2c49('0x49')]['id']}]};var _0x3fd55e={'$or':[_0x127dea,_0x5f28b7]};var _0x4fef4f=[];if(_0x144658[_0x2c49('0x3a')][_0x2c49('0x5f')]&&_0x144658[_0x2c49('0x3a')][_0x2c49('0x5f')]===_0x2c49('0x60')){if(!_[_0x2c49('0x61')](_0x144658[_0x2c49('0x3a')][_0x2c49('0x62')])){_0x3fd55e['id']={'$in':_0x144658[_0x2c49('0x3a')]['hopperIds']};}_0x4fef4f=[[_0x2c49('0x63'),_0x2c49('0x64')],['scheduledAt',_0x57237c[0x0][_0x2c49('0x5c')]===_0x2c49('0x64')?_0x2c49('0x65'):_0x2c49('0x64')],db[_0x2c49('0x66')][_0x2c49('0x67')](_0x2c49('0x68')),['id',_0x2c49('0x65')]];}else{if(!_[_0x2c49('0x61')](_0x144658[_0x2c49('0x3a')][_0x2c49('0x62')])){_0x3fd55e['id']={'$notIn':_0x144658[_0x2c49('0x3a')]['hopperIds']};}_0x4fef4f=[[_0x2c49('0x63'),_0x2c49('0x65')],[_0x2c49('0x69'),_0x57237c[0x0]['dialOrderByScheduledAt']],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x2c49('0x35')][_0x2c49('0x6a')]({'attributes':['id',_0x2c49('0x6b'),_0x2c49('0x4e'),'recallme'],'where':_0x3fd55e,'order':_0x4fef4f,'transaction':_0x5ae15e,'lock':_0x5ae15e[_0x2c49('0x6c')][_0x2c49('0x6d')],'include':[{'model':db[_0x2c49('0x50')],'as':_0x2c49('0x6e'),'attributes':_0xbc3817,'include':[{'model':db['CmCompany'],'as':_0x2c49('0x6f'),'attributes':['id',_0x2c49('0xf')]}]},{'model':db[_0x2c49('0x70')],'as':_0x2c49('0x71'),'attributes':['id','name']},{'model':db[_0x2c49('0x40')],'as':_0x2c49('0x72'),'attributes':['id',_0x2c49('0xf'),_0x2c49('0x73')]}]})['then'](function(_0x7fd1b){if(_0x7fd1b){return _0x7fd1b[_0x2c49('0xa')]({'UserId':_0x144658[_0x2c49('0x49')]['id']},{'transaction':_0x5ae15e});}});});}})[_0x2c49('0xb')](handleEntityNotFound(_0x4a4a2f,null))['then'](respondWithResult(_0x4a4a2f,null))[_0x2c49('0x3c')](handleError(_0x4a4a2f,null));};exports[_0x2c49('0x74')]=function(_0x2df60c,_0x5da8d5,_0x3e7410){var _0x2f0818=[];var _0x2d658c=_0x2df60c[_0x2c49('0x3b')]['id'];var _0x39ce2d=_0x2df60c[_0x2c49('0x49')]['id'];return db[_0x2c49('0x50')][_0x2c49('0x59')]()[_0x2c49('0xb')](function(_0x53b169){_0x2f0818=_[_0x2c49('0x17')](_0x53b169);return db[_0x2c49('0x66')][_0x2c49('0x75')](function(_0x16fd93){const _0xe1417f={'id':_0x2d658c};return db[_0x2c49('0x35')][_0x2c49('0x6a')]({'attributes':['id',_0x2c49('0x6b'),'recallme'],'where':_0xe1417f,'transaction':_0x16fd93,'lock':_0x16fd93[_0x2c49('0x6c')][_0x2c49('0x6d')],'include':[{'model':db[_0x2c49('0x50')],'as':'Contact','attributes':_0x2f0818,'include':[{'model':db[_0x2c49('0x76')],'as':'Company','attributes':['id',_0x2c49('0xf')]}]},{'model':db['CmList'],'as':_0x2c49('0x71'),'attributes':['id',_0x2c49('0xf')]},{'model':db[_0x2c49('0x40')],'as':_0x2c49('0x72'),'attributes':['id',_0x2c49('0xf'),_0x2c49('0x73')]}]})[_0x2c49('0xb')](function(_0x56e8be){if(_0x56e8be){return _0x56e8be[_0x2c49('0xa')]({'UserId':_0x39ce2d},{'transaction':_0x16fd93});}});});})[_0x2c49('0xb')](handleEntityNotFound(_0x5da8d5,null))[_0x2c49('0xb')](respondWithResult(_0x5da8d5,null))[_0x2c49('0x3c')](handleError(_0x5da8d5,null));};exports[_0x2c49('0x77')]=function(_0x19a496,_0x2c5efa){return _0x19a496[_0x2c49('0x49')][_0x2c49('0x78')]({'where':{'type':_0x2c49('0x5a'),'dialActive':!![],'dialMethod':_0x2c49('0x5b')},'attributes':['id'],'raw':!![]})['then'](function(_0x577edb){if(_0x577edb&&_0x577edb[_0x2c49('0x2c')]){return db[_0x2c49('0x35')][_0x2c49('0x36')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c49('0x4b')](_0x2c49('0x4c'))},'VoiceQueueId':{'$in':_[_0x2c49('0x12')](_0x577edb,'id')},'$or':[{'UserId':null},{'UserId':_0x19a496[_0x2c49('0x49')]['id']}]}});}return 0x0;})['then'](function(_0x1ff359){if(!_[_0x2c49('0x52')](_0x1ff359)&&_['isNumber'](_0x1ff359)){return _0x2c5efa[_0x2c49('0x8')](0xc8)[_0x2c49('0x4')]({'contacts':_0x1ff359});}else{logger[_0x2c49('0xd')](_0x2c49('0x79'),_0x2c49('0x77'),0x194,_0x2c49('0x7a'));_0x2c5efa['sendStatus'](0x194);}})['catch'](handleError(_0x2c5efa,null));};exports[_0x2c49('0x7b')]=function(_0x37ccd9,_0x2b30aa){var _0x4cb76b=shared[_0x2c49('0x7c')];var _0x37d09c=[];_[_0x2c49('0x12')](_0x4cb76b,function(_0x2d9a45){_0x37d09c['push']({'id':_0x2d9a45[_0x2c49('0xf')],'name':_0x2d9a45[_0x2c49('0xf')],'utcOffset':_0x2d9a45[_0x2c49('0x7d')]});});return _0x2b30aa[_0x2c49('0x8')](0xc8)[_0x2c49('0x4')]({'tz':_0x37d09c});};exports[_0x2c49('0x7e')]=function(_0x4fcd43,_0x48e935){var _0x1a477f=shared[_0x2c49('0x7c')];var _0x11a53b={};if(!_[_0x2c49('0x52')](_0x1a477f[_0x4fcd43[_0x2c49('0x3a')]['id']]))_0x11a53b=_0x1a477f[_0x4fcd43['body']['id']];return _0x48e935[_0x2c49('0x8')](0xc8)['json'](_0x11a53b);}; \ No newline at end of file +var _0x1670=['scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','getPreviewRecall','findOne','Queue','dialActive','getOpenContacts','getVoiceQueues','CmHopper,\x20%s,\x20%s,\x20%s','timezones','push','utcOffset','getTimezone','moment','lodash','../../config/logger','../../config/environment','../../mysqldb','json','offset','undefined','limit','count','status','set','Content-Range','update','sendStatus','error','stack','name','index','map','CmHopper','rawAttributes','fieldName','type','key','model','query','keys','intersection','filters','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$like','$notLike','$notILike','$contains','$contained','$any','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','then','include','findAll','rows','catch','show','params','includeAll','options','create','body','find','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','UserId','deletedat','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','end','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','user','value','direction','isEmpty','priority','scheduledAt','DESC','ASC','literal','hopperIds','COALESCE(CmHopper.UserId,\x200)\x20DESC'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1670,0x9a));var _0x0167=function(_0x2c8208,_0x3600de){_0x2c8208=_0x2c8208-0x0;var _0x56afa7=_0x1670[_0x2c8208];return _0x56afa7;};'use strict';var moment=require(_0x0167('0x0'));var _=require(_0x0167('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x0167('0x2'))('api');var shared=require(_0x0167('0x3'));var db=require(_0x0167('0x4'))['db'];function respondWithResult(_0x377590,_0x6f87ae){_0x6f87ae=_0x6f87ae||0xc8;return function(_0x5786d8){if(_0x5786d8){return _0x377590['status'](_0x6f87ae)[_0x0167('0x5')](_0x5786d8);}};}function respondWithFilteredResult(_0x1ae650,_0x295e51){return function(_0x3e1507){if(_0x3e1507){var _0x2120f2=typeof _0x295e51[_0x0167('0x6')]===_0x0167('0x7')&&typeof _0x295e51[_0x0167('0x8')]==='undefined';var _0x4c6b78=_0x3e1507[_0x0167('0x9')];var _0x178f5f=_0x2120f2?0x0:_0x295e51[_0x0167('0x6')];var _0x1632d4=_0x2120f2?_0x3e1507[_0x0167('0x9')]:_0x295e51[_0x0167('0x6')]+_0x295e51[_0x0167('0x8')];var _0x194af9;if(_0x1632d4>=_0x4c6b78){_0x1632d4=_0x4c6b78;_0x194af9=0xc8;}else{_0x194af9=0xce;}_0x1ae650[_0x0167('0xa')](_0x194af9);return _0x1ae650[_0x0167('0xb')](_0x0167('0xc'),_0x178f5f+'-'+_0x1632d4+'/'+_0x4c6b78)[_0x0167('0x5')](_0x3e1507);}return null;};}function saveUpdates(_0x34ac02,_0x2ebfa3){return function(_0x570965){if(_0x570965){return _0x570965[_0x0167('0xd')](_0x34ac02)['then'](function(_0x25e5d4){return _0x25e5d4;});}return null;};}function handleEntityNotFound(_0x5eb5f9,_0x7744d1){return function(_0x39e644){if(!_0x39e644){_0x5eb5f9[_0x0167('0xe')](0x194);}return _0x39e644;};}function handleError(_0x57c0e0,_0x50c1a3){_0x50c1a3=_0x50c1a3||0x1f4;return function(_0x547dea){logger[_0x0167('0xf')](_0x547dea[_0x0167('0x10')]);if(_0x547dea['name']){delete _0x547dea[_0x0167('0x11')];}_0x57c0e0['status'](_0x50c1a3)['send'](_0x547dea);};}exports[_0x0167('0x12')]=function(_0x574f04,_0x22f07c){var _0x4c0e4f={},_0x16094a={},_0x2740b5={'count':0x0,'rows':[]};var _0x170207=_[_0x0167('0x13')](db[_0x0167('0x14')][_0x0167('0x15')],function(_0xa384d9){return{'name':_0xa384d9[_0x0167('0x16')],'type':_0xa384d9[_0x0167('0x17')][_0x0167('0x18')]};});_0x16094a[_0x0167('0x19')]=_[_0x0167('0x13')](_0x170207,'name');_0x16094a[_0x0167('0x1a')]=_[_0x0167('0x1b')](_0x574f04[_0x0167('0x1a')]);_0x16094a['filters']=_[_0x0167('0x1c')](_0x16094a[_0x0167('0x19')],_0x16094a[_0x0167('0x1a')]);_0x16094a[_0x0167('0x1d')]=_['concat'](_0x16094a[_0x0167('0x1d')],['$and',_0x0167('0x1e'),_0x0167('0x1f'),_0x0167('0x20'),_0x0167('0x21'),_0x0167('0x22'),_0x0167('0x23'),_0x0167('0x24'),'$not',_0x0167('0x25'),_0x0167('0x26'),_0x0167('0x27'),'$notIn',_0x0167('0x28'),_0x0167('0x29'),'$iLike',_0x0167('0x2a'),_0x0167('0x28'),'$overlap',_0x0167('0x2b'),_0x0167('0x2c'),_0x0167('0x2d')]);_0x4c0e4f['attributes']=_[_0x0167('0x1c')](_0x16094a[_0x0167('0x19')],qs['fields'](_0x574f04['query'][_0x0167('0x2e')]));_0x4c0e4f[_0x0167('0x2f')]=_0x4c0e4f[_0x0167('0x2f')][_0x0167('0x30')]?_0x4c0e4f['attributes']:_0x16094a['model'];if(!_0x574f04[_0x0167('0x1a')]['hasOwnProperty']('nolimit')){_0x4c0e4f[_0x0167('0x8')]=qs[_0x0167('0x8')](_0x574f04[_0x0167('0x1a')][_0x0167('0x8')]);_0x4c0e4f[_0x0167('0x6')]=qs[_0x0167('0x6')](_0x574f04[_0x0167('0x1a')]['offset']);}_0x4c0e4f['order']=qs[_0x0167('0x31')](_0x574f04[_0x0167('0x1a')][_0x0167('0x31')]);_0x4c0e4f[_0x0167('0x32')]=qs[_0x0167('0x1d')](_[_0x0167('0x33')](_0x574f04['query'],_0x16094a[_0x0167('0x1d')]),_0x170207);if(_0x574f04['query']['filter']){_0x4c0e4f[_0x0167('0x32')]=_[_0x0167('0x34')](_0x4c0e4f[_0x0167('0x32')],{'$or':_['map'](_0x170207,function(_0x29355d){if(_0x29355d[_0x0167('0x17')]!==_0x0167('0x35')){var _0xb0cc5c={};_0xb0cc5c[_0x29355d['name']]={'$like':'%'+_0x574f04[_0x0167('0x1a')][_0x0167('0x36')]+'%'};return _0xb0cc5c;}})});}_0x4c0e4f=_[_0x0167('0x34')]({},_0x4c0e4f,_0x574f04['options']);var _0x2ba723={'where':_0x4c0e4f[_0x0167('0x32')]};return db[_0x0167('0x14')][_0x0167('0x9')](_0x2ba723)[_0x0167('0x37')](function(_0x5ef495){_0x2740b5[_0x0167('0x9')]=_0x5ef495;if(_0x574f04[_0x0167('0x1a')]['includeAll']){_0x4c0e4f[_0x0167('0x38')]=[{'all':!![]}];}return db[_0x0167('0x14')][_0x0167('0x39')](_0x4c0e4f);})[_0x0167('0x37')](function(_0x1280b4){_0x2740b5[_0x0167('0x3a')]=_0x1280b4;return _0x2740b5;})['then'](respondWithFilteredResult(_0x22f07c,_0x4c0e4f))[_0x0167('0x3b')](handleError(_0x22f07c,null));};exports[_0x0167('0x3c')]=function(_0x3bf14c,_0x34981a){var _0x49dc4d={'raw':!![],'where':{'id':_0x3bf14c[_0x0167('0x3d')]['id']}},_0x42cfe1={};_0x42cfe1['model']=_[_0x0167('0x1b')](db[_0x0167('0x14')][_0x0167('0x15')]);_0x42cfe1['query']=_[_0x0167('0x1b')](_0x3bf14c[_0x0167('0x1a')]);_0x42cfe1[_0x0167('0x1d')]=_[_0x0167('0x1c')](_0x42cfe1[_0x0167('0x19')],_0x42cfe1[_0x0167('0x1a')]);_0x49dc4d[_0x0167('0x2f')]=_[_0x0167('0x1c')](_0x42cfe1['model'],qs[_0x0167('0x2e')](_0x3bf14c['query'][_0x0167('0x2e')]));_0x49dc4d[_0x0167('0x2f')]=_0x49dc4d[_0x0167('0x2f')]['length']?_0x49dc4d['attributes']:_0x42cfe1['model'];if(_0x3bf14c[_0x0167('0x1a')][_0x0167('0x3e')]){_0x49dc4d[_0x0167('0x38')]=[{'all':!![]}];}_0x49dc4d=_[_0x0167('0x34')]({},_0x49dc4d,_0x3bf14c[_0x0167('0x3f')]);return db[_0x0167('0x14')]['find'](_0x49dc4d)['then'](handleEntityNotFound(_0x34981a,null))['then'](respondWithResult(_0x34981a,null))[_0x0167('0x3b')](handleError(_0x34981a,null));};exports['create']=function(_0x117123,_0x20c350){return db[_0x0167('0x14')][_0x0167('0x40')](_0x117123['body'],{})[_0x0167('0x37')](respondWithResult(_0x20c350,0xc9))[_0x0167('0x3b')](handleError(_0x20c350,null));};exports[_0x0167('0xd')]=function(_0x431cb7,_0x2c910a){if(_0x431cb7[_0x0167('0x41')]['id']){delete _0x431cb7[_0x0167('0x41')]['id'];}return db[_0x0167('0x14')][_0x0167('0x42')]({'where':{'id':_0x431cb7[_0x0167('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2c910a,null))['then'](saveUpdates(_0x431cb7[_0x0167('0x41')],null))['then'](respondWithResult(_0x2c910a,null))[_0x0167('0x3b')](handleError(_0x2c910a,null));};exports['describe']=function(_0x2c3efc,_0x52b720){return db[_0x0167('0x14')][_0x0167('0x43')]()['then'](respondWithResult(_0x52b720,null))['catch'](handleError(_0x52b720,null));};exports['destroy']=function(_0x174a7a,_0x55aaa0){var _0x5e3746;var _0x18d29d=_0x174a7a['params']['id'];return db[_0x0167('0x14')][_0x0167('0x42')]({'where':{'id':_0x174a7a[_0x0167('0x3d')]['id']}})['then'](handleEntityNotFound(_0x55aaa0,null))[_0x0167('0x37')](function(_0x5d1bbd){if(_0x5d1bbd){return _0x5d1bbd['destroy']()['then'](function(_0xecc47d){return _0xecc47d;});}})[_0x0167('0x37')](function(_0x3bb496){_0x5e3746=_0x3bb496;if(_0x3bb496){if(_0x3bb496[_0x0167('0x44')]||_0x3bb496[_0x0167('0x45')]){return db[_0x3bb496['VoiceQueueId']?_0x0167('0x46'):_0x0167('0x47')][_0x0167('0x42')]({'where':{'id':_0x3bb496[_0x0167('0x44')]?_0x3bb496['VoiceQueueId']:_0x3bb496['CampaignId']},'attributes':['id',_0x0167('0x11')],'raw':!![]});}}})['then'](function(_0x3a9e01){var _0x1deb9c={};if(_0x3a9e01){_[_0x0167('0x34')](_0x1deb9c,_[_0x0167('0x48')](_0x5e3746[_0x0167('0x49')],[_0x0167('0x4a'),_0x0167('0x4b'),'id']));_0x1deb9c[_0x0167('0x4c')]=0x15;_0x1deb9c[_0x0167('0x4d')]=_0x0167('0x4e');_0x1deb9c['campaign']=_0x3a9e01['name'];_0x1deb9c[_0x0167('0x4f')]=_0x174a7a['user'][_0x0167('0x11')];_0x1deb9c[_0x0167('0x50')]=_0x174a7a['user']['id'];_0x1deb9c[_0x0167('0x4e')]=!![];_0x1deb9c[_0x0167('0x51')]=moment()['format'](_0x0167('0x52'));_0x1deb9c[_0x0167('0x53')]=_0x5e3746[_0x0167('0x54')];_0x1deb9c[_0x0167('0x55')]=_0x5e3746['VoiceQueueId']?_0x0167('0x56'):_0x0167('0x57');return db[_0x0167('0x58')]['find']({'where':{'id':_0x1deb9c[_0x0167('0x59')]},'attributes':[_0x0167('0x5a'),_0x0167('0x5b')]})[_0x0167('0x37')](function(_0x35ceda){if(!_[_0x0167('0x5c')](_0x55aaa0)&&!_[_0x0167('0x5c')](_0x35ceda[_0x0167('0x5a')])){_0x1deb9c[_0x0167('0x5d')]=_0x35ceda['firstName'];if(!_[_0x0167('0x5c')](_0x35ceda[_0x0167('0x5b')])){_0x1deb9c[_0x0167('0x5d')]+='\x20'+_0x35ceda[_0x0167('0x5b')];}}})[_0x0167('0x5e')](function(){return db[_0x0167('0x5f')]['create'](_0x1deb9c);});}})[_0x0167('0x37')](function(_0x4da582){return db['CmHopperAdditionalPhone']['destroy']({'where':{'CmHopperId':_0x18d29d}});})[_0x0167('0x37')](function(){return _0x55aaa0[_0x0167('0xa')](0xcc)[_0x0167('0x60')]();})[_0x0167('0x3b')](handleError(_0x55aaa0,null));};exports[_0x0167('0x61')]=function(_0x5ad0ba,_0x20140b){var _0x38994f=[];return db['CmContact'][_0x0167('0x43')]()[_0x0167('0x37')](function(_0x3c46a0){_0x38994f=_[_0x0167('0x1b')](_0x3c46a0);return _0x5ad0ba['user']['getVoiceQueues']({'where':{'type':_0x0167('0x62'),'dialActive':!![],'dialMethod':_0x0167('0x63')},'attributes':['id',_0x0167('0x64'),_0x0167('0x65')],'raw':!![]});})[_0x0167('0x37')](function(_0x123df4){if(_0x123df4&&_0x123df4[_0x0167('0x30')]){return db[_0x0167('0x66')][_0x0167('0x67')](function(_0x3b5c80){var _0x5ed240={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x0167('0x68')](_0x0167('0x52'))},'VoiceQueueId':{'$in':_[_0x0167('0x13')](_0x123df4,'id')},'$or':[{'UserId':null},{'UserId':_0x5ad0ba[_0x0167('0x69')]['id']}]};var _0x3b56ec={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x123df4)[_0x0167('0x36')]([_0x0167('0x65'),0x0])['map']('id')[_0x0167('0x6a')]()},'$or':[{'UserId':null},{'UserId':_0x5ad0ba[_0x0167('0x69')]['id']}]};var _0x547538={'$or':[_0x5ed240,_0x3b56ec]};var _0x1c46ce=[];if(_0x5ad0ba['body'][_0x0167('0x6b')]&&_0x5ad0ba[_0x0167('0x41')][_0x0167('0x6b')]==='prev'){if(!_[_0x0167('0x6c')](_0x5ad0ba[_0x0167('0x41')]['hopperIds'])){_0x547538['id']={'$in':_0x5ad0ba[_0x0167('0x41')]['hopperIds']};}_0x1c46ce=[[_0x0167('0x6d'),'ASC'],[_0x0167('0x6e'),_0x123df4[0x0][_0x0167('0x64')]==='ASC'?_0x0167('0x6f'):_0x0167('0x70')],db[_0x0167('0x66')][_0x0167('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x0167('0x6c')](_0x5ad0ba[_0x0167('0x41')][_0x0167('0x72')])){_0x547538['id']={'$notIn':_0x5ad0ba[_0x0167('0x41')]['hopperIds']};}_0x1c46ce=[[_0x0167('0x6d'),'DESC'],[_0x0167('0x6e'),_0x123df4[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0x0167('0x71')](_0x0167('0x73')),['id',_0x0167('0x70')]];}return db[_0x0167('0x14')]['findOne']({'attributes':['id',_0x0167('0x74'),_0x0167('0x54'),_0x0167('0x75')],'where':_0x547538,'order':_0x1c46ce,'transaction':_0x3b5c80,'lock':_0x3b5c80[_0x0167('0x76')][_0x0167('0x77')],'include':[{'model':db[_0x0167('0x58')],'as':_0x0167('0x78'),'attributes':_0x38994f,'include':[{'model':db[_0x0167('0x79')],'as':_0x0167('0x7a'),'attributes':['id','name']}]},{'model':db[_0x0167('0x7b')],'as':'List','attributes':['id',_0x0167('0x11')]},{'model':db[_0x0167('0x46')],'as':'Queue','attributes':['id','name','dialActive']}]})[_0x0167('0x37')](function(_0x383085){if(_0x383085){return _0x383085['update']({'UserId':_0x5ad0ba['user']['id']},{'transaction':_0x3b5c80});}});});}})[_0x0167('0x37')](handleEntityNotFound(_0x20140b,null))[_0x0167('0x37')](respondWithResult(_0x20140b,null))['catch'](handleError(_0x20140b,null));};exports[_0x0167('0x7c')]=function(_0x255f88,_0x19c717,_0x30d32e){var _0x426bf4=[];var _0x3c0bca=_0x255f88['params']['id'];var _0x25b543=_0x255f88[_0x0167('0x69')]['id'];return db['CmContact'][_0x0167('0x43')]()[_0x0167('0x37')](function(_0xa7b06b){_0x426bf4=_[_0x0167('0x1b')](_0xa7b06b);return db[_0x0167('0x66')]['transaction'](function(_0x52bed0){const _0x557693={'id':_0x3c0bca};return db[_0x0167('0x14')][_0x0167('0x7d')]({'attributes':['id',_0x0167('0x74'),_0x0167('0x75')],'where':_0x557693,'transaction':_0x52bed0,'lock':_0x52bed0[_0x0167('0x76')]['UPDATE'],'include':[{'model':db[_0x0167('0x58')],'as':_0x0167('0x78'),'attributes':_0x426bf4,'include':[{'model':db[_0x0167('0x79')],'as':_0x0167('0x7a'),'attributes':['id',_0x0167('0x11')]}]},{'model':db[_0x0167('0x7b')],'as':'List','attributes':['id','name']},{'model':db[_0x0167('0x46')],'as':_0x0167('0x7e'),'attributes':['id','name',_0x0167('0x7f')]}]})[_0x0167('0x37')](function(_0x442e99){if(_0x442e99){return _0x442e99[_0x0167('0xd')]({'UserId':_0x25b543},{'transaction':_0x52bed0});}});});})[_0x0167('0x37')](handleEntityNotFound(_0x19c717,null))[_0x0167('0x37')](respondWithResult(_0x19c717,null))[_0x0167('0x3b')](handleError(_0x19c717,null));};exports[_0x0167('0x80')]=function(_0x4ba0c4,_0x427a7e){return _0x4ba0c4[_0x0167('0x69')][_0x0167('0x81')]({'where':{'type':_0x0167('0x62'),'dialActive':!![],'dialMethod':_0x0167('0x63')},'attributes':['id'],'raw':!![]})[_0x0167('0x37')](function(_0x344120){if(_0x344120&&_0x344120['length']){return db[_0x0167('0x14')][_0x0167('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x0167('0x13')](_0x344120,'id')},'$or':[{'UserId':null},{'UserId':_0x4ba0c4[_0x0167('0x69')]['id']}]}});}return 0x0;})[_0x0167('0x37')](function(_0x11cf46){if(!_['isNil'](_0x11cf46)&&_['isNumber'](_0x11cf46)){return _0x427a7e[_0x0167('0xa')](0xc8)['json']({'contacts':_0x11cf46});}else{logger['error'](_0x0167('0x82'),_0x0167('0x80'),0x194,'entity\x20not\x20found');_0x427a7e['sendStatus'](0x194);}})[_0x0167('0x3b')](handleError(_0x427a7e,null));};exports['getTimezones']=function(_0x1a1eba,_0x19adef){var _0x9980e3=shared[_0x0167('0x83')];var _0x3c5cdf=[];_[_0x0167('0x13')](_0x9980e3,function(_0x189f8a){_0x3c5cdf[_0x0167('0x84')]({'id':_0x189f8a[_0x0167('0x11')],'name':_0x189f8a[_0x0167('0x11')],'utcOffset':_0x189f8a[_0x0167('0x85')]});});return _0x19adef['status'](0xc8)['json']({'tz':_0x3c5cdf});};exports[_0x0167('0x86')]=function(_0x15ad6e,_0x2fb81e){var _0x5b0e7b=shared[_0x0167('0x83')];var _0x6421b0={};if(!_[_0x0167('0x5c')](_0x5b0e7b[_0x15ad6e[_0x0167('0x41')]['id']]))_0x6421b0=_0x5b0e7b[_0x15ad6e[_0x0167('0x41')]['id']];return _0x2fb81e[_0x0167('0xa')](0xc8)['json'](_0x6421b0);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index ad1bbaf..bb5b589 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 _0x7096=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api'];(function(_0x11a274,_0x42184a){var _0x5ac05d=function(_0x5bebf2){while(--_0x5bebf2){_0x11a274['push'](_0x11a274['shift']());}};_0x5ac05d(++_0x42184a);}(_0x7096,0x10c));var _0x6709=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7096[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[{'name':_0x6709('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x6709('0xd')]},{'name':_0x6709('0xe'),'fields':[_0x6709('0xe')]}],'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(_0x21ac84,_0x250f8c){var _0x23204e=function(_0x21ee66){while(--_0x21ee66){_0x21ac84['push'](_0x21ac84['shift']());}};_0x23204e(++_0x250f8c);}(_0xf494,0x1c6));var _0x4f49=function(_0x133956,_0x165339){_0x133956=_0x133956-0x0;var _0x29571a=_0xf494[_0x133956];return _0x29571a;};'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 fef487b..d7367b0 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 _0xc3b1=['update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','findAll','order','LOCK','UPDATE','Contact','keys','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','transaction','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','sequelize','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','describe','GetCmHopperPreview','GetContactByPhone','phone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','\x20MINUTE','name','List','NOW()','lodash','util','bluebird','../../mysqldb','rpc','GetCmHopper','CmHopper','options','raw','where','attributes','limit','map','include','model','then','info','stringify','catch','error','message','find','ShowCmHopper','debug','CreateCmHopper','create','body','UpdateCmHopper'];(function(_0x3afa8a,_0x5f565e){var _0x434238=function(_0xe2bbdc){while(--_0xe2bbdc){_0x3afa8a['push'](_0x3afa8a['shift']());}};_0x434238(++_0x5f565e);}(_0xc3b1,0xcb));var _0x1c3b=function(_0x191216,_0x4027ea){_0x191216=_0x191216-0x0;var _0x17832e=_0xc3b1[_0x191216];return _0x17832e;};'use strict';var _=require(_0x1c3b('0x0'));var util=require(_0x1c3b('0x1'));var moment=require('moment');var BPromise=require(_0x1c3b('0x2'));var db=require(_0x1c3b('0x3'))['db'];var logger=require('../../config/logger')(_0x1c3b('0x4'));exports[_0x1c3b('0x5')]=function(_0x27f16c){var _0x1dfe54=this;return new Promise(function(_0x5ba226,_0x5f9d31){return db[_0x1c3b('0x6')]['findAll']({'raw':_0x27f16c[_0x1c3b('0x7')]?_0x27f16c['options'][_0x1c3b('0x8')]===undefined?!![]:![]:!![],'where':_0x27f16c[_0x1c3b('0x7')]?_0x27f16c['options'][_0x1c3b('0x9')]||null:null,'attributes':_0x27f16c[_0x1c3b('0x7')]?_0x27f16c[_0x1c3b('0x7')][_0x1c3b('0xa')]||null:null,'limit':_0x27f16c['options']?_0x27f16c[_0x1c3b('0x7')][_0x1c3b('0xb')]||null:null,'include':_0x27f16c['options']?_0x27f16c['options']['include']?_[_0x1c3b('0xc')](_0x27f16c[_0x1c3b('0x7')][_0x1c3b('0xd')],function(_0xe0b0bf){return{'model':db[_0xe0b0bf[_0x1c3b('0xe')]],'as':_0xe0b0bf['as'],'attributes':_0xe0b0bf[_0x1c3b('0xa')],'include':_0xe0b0bf['include']?_[_0x1c3b('0xc')](_0xe0b0bf[_0x1c3b('0xd')],function(_0x570b85){return{'model':db[_0x570b85[_0x1c3b('0xe')]],'as':_0x570b85['as'],'attributes':_0x570b85['attributes'],'include':_0x570b85[_0x1c3b('0xd')]?_['map'](_0x570b85['include'],function(_0x1dc402){return{'model':db[_0x1dc402[_0x1c3b('0xe')]],'as':_0x1dc402['as'],'attributes':_0x1dc402[_0x1c3b('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1c3b('0xf')](function(_0x380930){logger[_0x1c3b('0x10')]('GetCmHopper',_0x27f16c);logger['debug'](_0x1c3b('0x5'),_0x27f16c,JSON[_0x1c3b('0x11')](_0x380930));_0x5ba226(_0x380930);})[_0x1c3b('0x12')](function(_0x9129e0){logger[_0x1c3b('0x13')](_0x1c3b('0x5'),_0x9129e0[_0x1c3b('0x14')],_0x27f16c);_0x5f9d31(_0x1dfe54['error'](0x1f4,_0x9129e0[_0x1c3b('0x14')]));});});};exports['ShowCmHopper']=function(_0xe622c){var _0x4305ff=this;return new Promise(function(_0x41136e,_0xd0d9c1){return db[_0x1c3b('0x6')][_0x1c3b('0x15')]({'raw':_0xe622c[_0x1c3b('0x7')]?_0xe622c[_0x1c3b('0x7')][_0x1c3b('0x8')]===undefined?!![]:![]:!![],'where':_0xe622c['options']?_0xe622c[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0xe622c[_0x1c3b('0x7')]?_0xe622c['options'][_0x1c3b('0xa')]||null:null,'include':_0xe622c[_0x1c3b('0x7')]?_0xe622c['options'][_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0xe622c[_0x1c3b('0x7')][_0x1c3b('0xd')],function(_0x182fd7){return{'model':db[_0x182fd7[_0x1c3b('0xe')]],'as':_0x182fd7['as'],'attributes':_0x182fd7[_0x1c3b('0xa')],'include':_0x182fd7[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x182fd7[_0x1c3b('0xd')],function(_0x5da1f8){return{'model':db[_0x5da1f8[_0x1c3b('0xe')]],'as':_0x5da1f8['as'],'attributes':_0x5da1f8['attributes'],'include':_0x5da1f8[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x5da1f8[_0x1c3b('0xd')],function(_0x1588b1){return{'model':db[_0x1588b1[_0x1c3b('0xe')]],'as':_0x1588b1['as'],'attributes':_0x1588b1[_0x1c3b('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1c3b('0xf')](function(_0x14c8f3){logger['info'](_0x1c3b('0x16'),_0xe622c);logger[_0x1c3b('0x17')]('ShowCmHopper',_0xe622c,JSON[_0x1c3b('0x11')](_0x14c8f3));_0x41136e(_0x14c8f3);})[_0x1c3b('0x12')](function(_0x551764){logger[_0x1c3b('0x13')](_0x1c3b('0x16'),_0x551764['message'],_0xe622c);_0xd0d9c1(_0x4305ff[_0x1c3b('0x13')](0x1f4,_0x551764[_0x1c3b('0x14')]));});});};exports[_0x1c3b('0x18')]=function(_0x435be8){var _0x1b8239=this;return new Promise(function(_0x393513,_0x37918b){return db['CmHopper'][_0x1c3b('0x19')](_0x435be8[_0x1c3b('0x1a')],{'raw':_0x435be8[_0x1c3b('0x7')]?_0x435be8['options'][_0x1c3b('0x8')]===undefined?!![]:![]:!![]})[_0x1c3b('0xf')](function(_0x5997af){logger[_0x1c3b('0x10')]('CreateCmHopper',_0x435be8);logger[_0x1c3b('0x17')]('CreateCmHopper',_0x435be8,JSON['stringify'](_0x5997af));_0x393513(_0x5997af);})[_0x1c3b('0x12')](function(_0x1e1dc4){logger['error'](_0x1c3b('0x18'),_0x1e1dc4['message'],_0x435be8);_0x37918b(_0x1b8239[_0x1c3b('0x13')](0x1f4,_0x1e1dc4['message']));});});};exports[_0x1c3b('0x1b')]=function(_0x420f80){var _0x500d95=this;return new Promise(function(_0x21d62d,_0x2c73eb){return db[_0x1c3b('0x6')][_0x1c3b('0x1c')](_0x420f80[_0x1c3b('0x1a')],{'raw':_0x420f80[_0x1c3b('0x7')]?_0x420f80['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x420f80[_0x1c3b('0x7')]?_0x420f80[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0x420f80[_0x1c3b('0x7')]?_0x420f80[_0x1c3b('0x7')][_0x1c3b('0xa')]||null:null,'limit':_0x420f80[_0x1c3b('0x7')]?_0x420f80['options'][_0x1c3b('0xb')]||null:null})[_0x1c3b('0xf')](function(_0x514905){logger[_0x1c3b('0x10')](_0x1c3b('0x1b'),_0x420f80);logger['info'](_0x1c3b('0x1d'),JSON[_0x1c3b('0x11')](_0x420f80[_0x1c3b('0x7')]['where']),_0x420f80[_0x1c3b('0x1a')][_0x1c3b('0x1e')]);logger[_0x1c3b('0x17')](_0x1c3b('0x1b'),_0x420f80,JSON[_0x1c3b('0x11')](_0x514905));_0x21d62d(_0x514905);})[_0x1c3b('0x12')](function(_0x255a00){logger[_0x1c3b('0x13')](_0x1c3b('0x1b'),_0x255a00[_0x1c3b('0x14')],_0x420f80);_0x2c73eb(_0x500d95[_0x1c3b('0x13')](0x1f4,_0x255a00['message']));});});};exports[_0x1c3b('0x1f')]=function(_0x26ed76){var _0x480371=this;return new Promise(function(_0x4c98fb,_0xa5bcf4){return db[_0x1c3b('0x6')][_0x1c3b('0x20')]({'where':_0x26ed76['options']?_0x26ed76[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null})[_0x1c3b('0xf')](function(_0x3d83a3){logger[_0x1c3b('0x10')](_0x1c3b('0x1f'),_0x26ed76);logger['debug'](_0x1c3b('0x1f'),_0x26ed76,JSON[_0x1c3b('0x11')](_0x3d83a3));_0x4c98fb(_0x3d83a3);})[_0x1c3b('0x12')](function(_0x5693b4){logger['error'](_0x1c3b('0x1f'),_0x5693b4['message'],_0x26ed76);_0xa5bcf4(_0x480371['error'](0x1f4,_0x5693b4[_0x1c3b('0x14')]));});});};exports[_0x1c3b('0x21')]=function(_0x2ed742){var _0x39c239=this;return new Promise(function(_0x14b478,_0x4ff5d8){return db[_0x1c3b('0x22')]['describe']()['then'](function(_0x5193a0){return db['sequelize']['transaction'](function(_0x12746a){return db[_0x1c3b('0x6')][_0x1c3b('0x23')]({'where':_0x2ed742['options']?_0x2ed742[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0x2ed742[_0x1c3b('0x7')]?_0x2ed742['options']['attributes']||null:null,'limit':_0x2ed742[_0x1c3b('0x7')]?_0x2ed742[_0x1c3b('0x7')][_0x1c3b('0xb')]||null:null,'order':_0x2ed742['options']?_0x2ed742[_0x1c3b('0x7')][_0x1c3b('0x24')]||null:null,'transaction':_0x12746a,'lock':_0x12746a[_0x1c3b('0x25')][_0x1c3b('0x26')],'include':[{'model':db[_0x1c3b('0x22')],'as':_0x1c3b('0x27'),'attributes':_[_0x1c3b('0x28')](_0x5193a0)},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x1c3b('0x29')]}]})[_0x1c3b('0xf')](function(_0x2ba3e1){var _0xbea2c5=[];var _0x45216f=[];for(var _0x598345=0x0;_0x598345<_0x2ba3e1[_0x1c3b('0x2a')];_0x598345+=0x1){var _0x197d1c=_0x2ba3e1[_0x598345][_0x1c3b('0x2b')];if(_0x197d1c===null){_0xbea2c5[_0x1c3b('0x2c')](_0x2ba3e1[_0x598345][_0x1c3b('0x1c')](_0x2ed742[_0x1c3b('0x1a')],{'transaction':_0x12746a}));}else if(!_0x45216f[_0x1c3b('0x2d')](_0x197d1c)){_0x45216f[_0x1c3b('0x2c')](_0x197d1c);_0xbea2c5['push'](_0x2ba3e1[_0x598345]['update'](_0x2ed742['body'],{'transaction':_0x12746a}));}}return BPromise[_0x1c3b('0x2e')](_0xbea2c5);});})[_0x1c3b('0xf')](function(_0x54fda9){logger[_0x1c3b('0x10')](_0x1c3b('0x21'),_0x2ed742);if(_0x54fda9[_0x1c3b('0x2a')]>0x0){logger[_0x1c3b('0x10')](_0x1c3b('0x2f'),_0x54fda9[0x0]['dataValues']['id'],_0x54fda9[0x0][_0x1c3b('0x30')]['ContactId'],_0x54fda9[0x0][_0x1c3b('0x30')][_0x1c3b('0x1e')]);}logger[_0x1c3b('0x17')]('GetContactDialer',_0x2ed742,JSON['stringify'](_0x54fda9));_0x14b478(_0x54fda9);})[_0x1c3b('0x12')](function(_0x3eb6ce){logger[_0x1c3b('0x13')](_0x1c3b('0x21'),_0x3eb6ce[_0x1c3b('0x14')],_0x2ed742);_0x4ff5d8(_0x39c239[_0x1c3b('0x13')](0x1f4,_0x3eb6ce['message']));});});});};exports[_0x1c3b('0x31')]=function(_0x267517){var _0x50b26e=this;return new Promise(function(_0x576a7d,_0x1aa011){return db['sequelize'][_0x1c3b('0x32')](function(_0xb25adb){return db[_0x1c3b('0x33')][_0x1c3b('0x19')](_0x267517[_0x1c3b('0x1a')],{'raw':_0x267517[_0x1c3b('0x7')]?_0x267517['options']['raw']===undefined?!![]:![]:!![],'transaction':_0xb25adb})[_0x1c3b('0xf')](function(){logger['info'](_0x1c3b('0x34'),JSON[_0x1c3b('0x11')](_0x267517[_0x1c3b('0x7')]['where']),_0x267517[_0x1c3b('0x7')][_0x1c3b('0x9')][_0x1c3b('0x1e')]);return db['CmHopper']['destroy']({'where':_0x267517['options']?_0x267517[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'transaction':_0xb25adb});});})[_0x1c3b('0xf')](function(_0x283432){logger[_0x1c3b('0x10')]('MoveContactManagedDialer',_0x267517);logger[_0x1c3b('0x17')](_0x1c3b('0x31'),_0x267517,JSON['stringify'](_0x283432));_0x576a7d(_0x283432);})[_0x1c3b('0x12')](function(_0x4df5b7){logger[_0x1c3b('0x13')]('MoveContactManagedDialer',_0x4df5b7['message'],_0x267517);_0x1aa011(_0x50b26e[_0x1c3b('0x13')](0x1f4,_0x4df5b7['message']));});});};exports['CountReScheduled']=function(_0x44cf6b){var _0x68685e=this;return new Promise(function(_0x314eec,_0xd3901e){return db[_0x1c3b('0x6')][_0x1c3b('0x23')]({'raw':_0x44cf6b['options']?_0x44cf6b['options'][_0x1c3b('0x8')]===undefined?!![]:![]:!![],'where':_0x44cf6b[_0x1c3b('0x7')]?_0x44cf6b[_0x1c3b('0x7')]['where']||null:null,'attributes':[[db[_0x1c3b('0x35')]['fn']('COUNT',db[_0x1c3b('0x35')]['fn']('IF',db[_0x1c3b('0x35')][_0x1c3b('0x36')](_0x1c3b('0x37')+util[_0x1c3b('0x38')](_0x1c3b('0x39'),moment()[_0x1c3b('0x38')](_0x1c3b('0x3a')))+'\x20,\x201,\x20null'))),_0x1c3b('0x3b')]]})[_0x1c3b('0xf')](function(_0x23d44a){logger['info'](_0x1c3b('0x3c'),_0x44cf6b);logger[_0x1c3b('0x17')]('CountReScheduled',_0x44cf6b,JSON['stringify'](_0x23d44a));_0x314eec(_0x23d44a);})[_0x1c3b('0x12')](function(_0x5b39b0){logger['error'](_0x1c3b('0x3c'),_0x5b39b0[_0x1c3b('0x14')],_0x44cf6b);_0xd3901e(_0x68685e[_0x1c3b('0x13')](0x1f4,_0x5b39b0[_0x1c3b('0x14')]));});});};exports[_0x1c3b('0x3d')]=function(_0x24ec4e){var _0x589777=this;return new Promise(function(_0x8713ca,_0x317a2f){return db[_0x1c3b('0x22')][_0x1c3b('0x3e')]()[_0x1c3b('0xf')](function(){return db[_0x1c3b('0x35')]['transaction'](function(_0x20181e){return db[_0x1c3b('0x6')]['findAll']({'where':_0x24ec4e[_0x1c3b('0x7')]?_0x24ec4e[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0x24ec4e[_0x1c3b('0x7')]?_0x24ec4e[_0x1c3b('0x7')][_0x1c3b('0xa')]||null:null,'limit':0x1,'order':_0x24ec4e[_0x1c3b('0x7')]?_0x24ec4e['options']['order']||null:null,'group':db['CmHopper'][_0x1c3b('0x2b')],'transaction':_0x20181e,'lock':_0x20181e[_0x1c3b('0x25')][_0x1c3b('0x26')],'include':_0x24ec4e['options']?_0x24ec4e[_0x1c3b('0x7')][_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x24ec4e[_0x1c3b('0x7')]['include'],function(_0x2c651f){return{'model':db[_0x2c651f[_0x1c3b('0xe')]],'as':_0x2c651f['as'],'attributes':_0x2c651f[_0x1c3b('0xa')],'include':_0x2c651f[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x2c651f['include'],function(_0x1928e6){return{'model':db[_0x1928e6['model']],'as':_0x1928e6['as'],'attributes':_0x1928e6['attributes'],'include':_0x1928e6[_0x1c3b('0xd')]?_['map'](_0x1928e6[_0x1c3b('0xd')],function(_0x5ecb88){return{'model':db[_0x5ecb88[_0x1c3b('0xe')]],'as':_0x5ecb88['as'],'attributes':_0x5ecb88[_0x1c3b('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1c3b('0xf')](function(_0x27c738){var _0x58d665=[];for(var _0xcbbbd4=0x0;_0xcbbbd4<_0x27c738['length'];_0xcbbbd4+=0x1){_0x58d665[_0x1c3b('0x2c')](_0x27c738[_0xcbbbd4][_0x1c3b('0x1c')](_0x24ec4e[_0x1c3b('0x1a')],{'transaction':_0x20181e}));}return BPromise['all'](_0x58d665);});})[_0x1c3b('0xf')](function(_0x5b4c0e){logger['info'](_0x1c3b('0x3d'),_0x24ec4e);logger[_0x1c3b('0x17')](_0x1c3b('0x3d'),_0x24ec4e,JSON['stringify'](_0x5b4c0e));_0x8713ca(_0x5b4c0e);})[_0x1c3b('0x12')](function(_0x420be8){logger[_0x1c3b('0x13')](_0x1c3b('0x3d'),_0x420be8[_0x1c3b('0x14')],_0x24ec4e);_0x317a2f(_0x589777[_0x1c3b('0x13')](0x1f4,_0x420be8[_0x1c3b('0x14')]));});});});};exports[_0x1c3b('0x3f')]=function(_0x3cada3){var _0x2b4a5f=this;return new Promise(function(_0x46b03a,_0x154195){db[_0x1c3b('0x22')][_0x1c3b('0x3e')]()[_0x1c3b('0xf')](function(_0x42c977){return db['CmHopper'][_0x1c3b('0x23')]({'raw':_0x3cada3[_0x1c3b('0x7')]?_0x3cada3[_0x1c3b('0x7')][_0x1c3b('0x8')]===undefined?!![]:![]:!![],'where':_0x3cada3['options']?_0x3cada3[_0x1c3b('0x7')][_0x1c3b('0x9')]||null:null,'attributes':_0x3cada3[_0x1c3b('0x7')]?_0x3cada3[_0x1c3b('0x7')]['attributes']||null:null,'limit':_0x3cada3[_0x1c3b('0x7')]?_0x3cada3['options'][_0x1c3b('0xb')]||null:null,'include':_0x3cada3[_0x1c3b('0x7')]?_0x3cada3[_0x1c3b('0x7')][_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x3cada3['options']['include'],function(_0x3f0904){return{'model':db[_0x3f0904['model']],'as':_0x3f0904['as'],'attributes':_0x3f0904['as']==='Contact'?_[_0x1c3b('0x28')](_0x42c977):_0x3f0904['attributes'],'include':_0x3f0904[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x3f0904['include'],function(_0x4788e0){return{'model':db[_0x4788e0[_0x1c3b('0xe')]],'as':_0x4788e0['as'],'attributes':_0x4788e0[_0x1c3b('0xa')],'include':_0x4788e0[_0x1c3b('0xd')]?_[_0x1c3b('0xc')](_0x4788e0[_0x1c3b('0xd')],function(_0x4bdb34){return{'model':db[_0x4bdb34['model']],'as':_0x4bdb34['as'],'attributes':_0x4bdb34[_0x1c3b('0xa')]};}):[]};}):[]};}):[]:[]})[_0x1c3b('0xf')](function(_0xa77b31){logger[_0x1c3b('0x10')]('GetCmHopper',_0x3cada3);logger[_0x1c3b('0x17')](_0x1c3b('0x5'),_0x3cada3,JSON[_0x1c3b('0x11')](_0xa77b31));_0x46b03a(_0xa77b31);})[_0x1c3b('0x12')](function(_0x1f615d){logger[_0x1c3b('0x13')](_0x1c3b('0x5'),_0x1f615d[_0x1c3b('0x14')],_0x3cada3);_0x154195(_0x2b4a5f[_0x1c3b('0x13')](0x1f4,_0x1f615d['message']));});});});};exports[_0x1c3b('0x40')]=function(_0x236c33){var _0x3fb928=this;return new Promise(function(_0x4ddf3f,_0x173e1a){return db[_0x1c3b('0x22')]['findOne']({'raw':!![],'where':{'phone':_0x236c33[_0x1c3b('0x7')][_0x1c3b('0x9')][_0x1c3b('0x41')]},'attributes':['id','dialTimezone'],'order':[['id',_0x1c3b('0x42')]]})[_0x1c3b('0xf')](function(_0x23fbf5){logger[_0x1c3b('0x10')](_0x1c3b('0x43'),_0x236c33);logger[_0x1c3b('0x17')](_0x1c3b('0x43'),_0x236c33,JSON[_0x1c3b('0x11')](_0x23fbf5));_0x4ddf3f(_0x23fbf5);})['catch'](function(_0x2f5609){logger[_0x1c3b('0x13')](_0x1c3b('0x43'),_0x2f5609[_0x1c3b('0x14')],_0x236c33);_0x173e1a(_0x3fb928[_0x1c3b('0x13')](0x1f4,_0x2f5609['message']));});});};exports['ResetActiveCalls']=function(_0x544855){var _0x2d9261=this;return new Promise(function(_0x4d1f6c,_0x17db3e){return db[_0x1c3b('0x35')][_0x1c3b('0x32')](function(_0x3a09ed){var _0x45eeae=_0x544855[_0x1c3b('0x7')]&&_0x544855[_0x1c3b('0x7')]['where']?_0x544855['options'][_0x1c3b('0x9')]:{};return db[_0x1c3b('0x6')][_0x1c3b('0x1c')](_0x544855['body'],{'where':_0x45eeae,'transaction':_0x3a09ed})[_0x1c3b('0xf')](function(_0x56afc0){logger[_0x1c3b('0x10')](_0x1c3b('0x44'),_0x544855);logger['debug']('ResetActiveCalls',_0x544855,JSON['stringify'](_0x56afc0));_0x4d1f6c(_0x56afc0);})[_0x1c3b('0x12')](function(_0x221bc4){logger[_0x1c3b('0x13')](_0x1c3b('0x44'),_0x221bc4[_0x1c3b('0x14')],_0x544855);_0x17db3e(_0x2d9261[_0x1c3b('0x13')](0x1f4,_0x221bc4[_0x1c3b('0x14')]));});});});};exports[_0x1c3b('0x45')]=function(_0x18bb0f){var _0x37c23c=this;var _0x5bea42=_0x18bb0f[_0x1c3b('0x1a')]['where'][_0x1c3b('0x46')];var _0x3a90d6=_0x18bb0f[_0x1c3b('0x1a')][_0x1c3b('0x9')][_0x1c3b('0x47')];var _0x1ccca8=_0x18bb0f[_0x1c3b('0x1a')][_0x1c3b('0x9')][_0x1c3b('0x48')];return new Promise(function(_0x473a82,_0x169362){return db[_0x1c3b('0x6')][_0x1c3b('0x23')]({'where':{'voiceQueueId':{'$in':_0x5bea42},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x3a90d6+_0x1c3b('0x49')),'$gt':db[_0x1c3b('0x35')][_0x1c3b('0x36')]('NOW()')}},'UserId':{'$in':_0x1ccca8}},'include':[{'model':db[_0x1c3b('0x22')],'as':_0x1c3b('0x27')},{'model':db['User'],'as':'Agent','attributes':['id',_0x1c3b('0x4a'),_0x1c3b('0x29')]},{'model':db['CmList'],'as':_0x1c3b('0x4b')}]})['then'](function(_0x45a46a){if(_0x45a46a['length']>0x0){return db[_0x1c3b('0x35')][_0x1c3b('0x32')](function(_0x4d85ef){return db[_0x1c3b('0x6')]['update']({'recallmeNotifiedDate':db['sequelize'][_0x1c3b('0x36')](_0x1c3b('0x4c'))},{'where':{'id':{'$in':_['map'](_0x45a46a,'id')}},'transaction':_0x4d85ef})['then'](function(){_0x473a82(_0x45a46a);})[_0x1c3b('0x12')](function(_0x1a9482){logger[_0x1c3b('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x1a9482[_0x1c3b('0x14')],_0x18bb0f);_0x169362(_0x37c23c[_0x1c3b('0x13')](0x1f4,_0x1a9482[_0x1c3b('0x14')]));});})[_0x1c3b('0x12')](function(_0x51c5a5){logger[_0x1c3b('0x13')](_0x1c3b('0x45'),_0x51c5a5[_0x1c3b('0x14')],_0x18bb0f);_0x169362(_0x37c23c[_0x1c3b('0x13')](0x1f4,_0x51c5a5['message']));});}else{_0x473a82(_0x45a46a);}});});}; \ No newline at end of file +var _0xc0fa=['sequelize','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','order','LOCK','length','GetCmHopperPreview','Contact','GetContactByPhone','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','User','voicePause','List','NOW()','CmHopperHandlePreviewRecallNotifications','util','bluebird','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','then','info','stringify','catch','error','message','ShowCmHopper','find','debug','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','describe','transaction','findAll','CmContact','Agent','name','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','GetContactDialer','destroy','MoveContactManagedDialer','COUNT'];(function(_0x1ccca0,_0x3eb2ad){var _0x52d571=function(_0x2bf1a7){while(--_0x2bf1a7){_0x1ccca0['push'](_0x1ccca0['shift']());}};_0x52d571(++_0x3eb2ad);}(_0xc0fa,0xfa));var _0xac0f=function(_0x463a03,_0x13914f){_0x463a03=_0x463a03-0x0;var _0x5baa30=_0xc0fa[_0x463a03];return _0x5baa30;};'use strict';var _=require('lodash');var util=require(_0xac0f('0x0'));var moment=require('moment');var BPromise=require(_0xac0f('0x1'));var db=require(_0xac0f('0x2'))['db'];var logger=require(_0xac0f('0x3'))('rpc');exports[_0xac0f('0x4')]=function(_0x165a27){var _0x22b996=this;return new Promise(function(_0x4ef708,_0x584e15){return db[_0xac0f('0x5')]['findAll']({'raw':_0x165a27['options']?_0x165a27[_0xac0f('0x6')][_0xac0f('0x7')]===undefined?!![]:![]:!![],'where':_0x165a27[_0xac0f('0x6')]?_0x165a27[_0xac0f('0x6')][_0xac0f('0x8')]||null:null,'attributes':_0x165a27['options']?_0x165a27[_0xac0f('0x6')][_0xac0f('0x9')]||null:null,'limit':_0x165a27['options']?_0x165a27[_0xac0f('0x6')][_0xac0f('0xa')]||null:null,'include':_0x165a27[_0xac0f('0x6')]?_0x165a27['options'][_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x165a27[_0xac0f('0x6')][_0xac0f('0xb')],function(_0x32652){return{'model':db[_0x32652[_0xac0f('0xd')]],'as':_0x32652['as'],'attributes':_0x32652['attributes'],'include':_0x32652['include']?_[_0xac0f('0xc')](_0x32652[_0xac0f('0xb')],function(_0x45cccf){return{'model':db[_0x45cccf[_0xac0f('0xd')]],'as':_0x45cccf['as'],'attributes':_0x45cccf['attributes'],'include':_0x45cccf[_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x45cccf[_0xac0f('0xb')],function(_0x5f11f5){return{'model':db[_0x5f11f5['model']],'as':_0x5f11f5['as'],'attributes':_0x5f11f5['attributes']};}):[]};}):[]};}):[]:[]})[_0xac0f('0xe')](function(_0xc5d02a){logger[_0xac0f('0xf')](_0xac0f('0x4'),_0x165a27);logger['debug']('GetCmHopper',_0x165a27,JSON[_0xac0f('0x10')](_0xc5d02a));_0x4ef708(_0xc5d02a);})[_0xac0f('0x11')](function(_0x3bc82c){logger[_0xac0f('0x12')]('GetCmHopper',_0x3bc82c['message'],_0x165a27);_0x584e15(_0x22b996['error'](0x1f4,_0x3bc82c[_0xac0f('0x13')]));});});};exports[_0xac0f('0x14')]=function(_0x1d5281){var _0x7f3c49=this;return new Promise(function(_0x3ab42b,_0x12d935){return db[_0xac0f('0x5')][_0xac0f('0x15')]({'raw':_0x1d5281[_0xac0f('0x6')]?_0x1d5281[_0xac0f('0x6')][_0xac0f('0x7')]===undefined?!![]:![]:!![],'where':_0x1d5281[_0xac0f('0x6')]?_0x1d5281[_0xac0f('0x6')][_0xac0f('0x8')]||null:null,'attributes':_0x1d5281[_0xac0f('0x6')]?_0x1d5281[_0xac0f('0x6')][_0xac0f('0x9')]||null:null,'include':_0x1d5281[_0xac0f('0x6')]?_0x1d5281['options'][_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x1d5281[_0xac0f('0x6')][_0xac0f('0xb')],function(_0x2559b3){return{'model':db[_0x2559b3[_0xac0f('0xd')]],'as':_0x2559b3['as'],'attributes':_0x2559b3['attributes'],'include':_0x2559b3[_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x2559b3[_0xac0f('0xb')],function(_0x30dd53){return{'model':db[_0x30dd53[_0xac0f('0xd')]],'as':_0x30dd53['as'],'attributes':_0x30dd53[_0xac0f('0x9')],'include':_0x30dd53[_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x30dd53[_0xac0f('0xb')],function(_0x4d32ed){return{'model':db[_0x4d32ed['model']],'as':_0x4d32ed['as'],'attributes':_0x4d32ed[_0xac0f('0x9')]};}):[]};}):[]};}):[]:[]})[_0xac0f('0xe')](function(_0x432734){logger['info'](_0xac0f('0x14'),_0x1d5281);logger[_0xac0f('0x16')]('ShowCmHopper',_0x1d5281,JSON[_0xac0f('0x10')](_0x432734));_0x3ab42b(_0x432734);})[_0xac0f('0x11')](function(_0x378424){logger['error'](_0xac0f('0x14'),_0x378424[_0xac0f('0x13')],_0x1d5281);_0x12d935(_0x7f3c49[_0xac0f('0x12')](0x1f4,_0x378424[_0xac0f('0x13')]));});});};exports[_0xac0f('0x17')]=function(_0x26f5af){var _0x4847a7=this;return new Promise(function(_0x356194,_0x49bf75){return db['CmHopper'][_0xac0f('0x18')](_0x26f5af[_0xac0f('0x19')],{'raw':_0x26f5af[_0xac0f('0x6')]?_0x26f5af[_0xac0f('0x6')][_0xac0f('0x7')]===undefined?!![]:![]:!![]})[_0xac0f('0xe')](function(_0x5d9983){logger[_0xac0f('0xf')](_0xac0f('0x17'),_0x26f5af);logger[_0xac0f('0x16')](_0xac0f('0x17'),_0x26f5af,JSON[_0xac0f('0x10')](_0x5d9983));_0x356194(_0x5d9983);})['catch'](function(_0x1f750e){logger[_0xac0f('0x12')](_0xac0f('0x17'),_0x1f750e['message'],_0x26f5af);_0x49bf75(_0x4847a7[_0xac0f('0x12')](0x1f4,_0x1f750e['message']));});});};exports[_0xac0f('0x1a')]=function(_0xab1836){var _0x3f37a0=this;return new Promise(function(_0x15054a,_0x27cd2d){return db[_0xac0f('0x5')][_0xac0f('0x1b')](_0xab1836[_0xac0f('0x19')],{'raw':_0xab1836[_0xac0f('0x6')]?_0xab1836[_0xac0f('0x6')][_0xac0f('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab1836['options']?_0xab1836['options'][_0xac0f('0x8')]||null:null,'attributes':_0xab1836[_0xac0f('0x6')]?_0xab1836[_0xac0f('0x6')][_0xac0f('0x9')]||null:null,'limit':_0xab1836[_0xac0f('0x6')]?_0xab1836[_0xac0f('0x6')][_0xac0f('0xa')]||null:null})[_0xac0f('0xe')](function(_0x4e3ac6){logger[_0xac0f('0xf')](_0xac0f('0x1a'),_0xab1836);logger[_0xac0f('0xf')](_0xac0f('0x1c'),JSON[_0xac0f('0x10')](_0xab1836[_0xac0f('0x6')][_0xac0f('0x8')]),_0xab1836[_0xac0f('0x19')][_0xac0f('0x1d')]);logger[_0xac0f('0x16')](_0xac0f('0x1a'),_0xab1836,JSON[_0xac0f('0x10')](_0x4e3ac6));_0x15054a(_0x4e3ac6);})[_0xac0f('0x11')](function(_0x179642){logger['error']('UpdateCmHopper',_0x179642[_0xac0f('0x13')],_0xab1836);_0x27cd2d(_0x3f37a0[_0xac0f('0x12')](0x1f4,_0x179642[_0xac0f('0x13')]));});});};exports['DestroyCmHopper']=function(_0x1fa886){var _0x17530c=this;return new Promise(function(_0x14f93f,_0x3c37f8){return db[_0xac0f('0x5')]['destroy']({'where':_0x1fa886[_0xac0f('0x6')]?_0x1fa886[_0xac0f('0x6')][_0xac0f('0x8')]||null:null})[_0xac0f('0xe')](function(_0x2e6291){logger['info'](_0xac0f('0x1e'),_0x1fa886);logger[_0xac0f('0x16')](_0xac0f('0x1e'),_0x1fa886,JSON['stringify'](_0x2e6291));_0x14f93f(_0x2e6291);})['catch'](function(_0x178d2f){logger[_0xac0f('0x12')](_0xac0f('0x1e'),_0x178d2f[_0xac0f('0x13')],_0x1fa886);_0x3c37f8(_0x17530c[_0xac0f('0x12')](0x1f4,_0x178d2f['message']));});});};exports['GetContactDialer']=function(_0x13b5e7){var _0x375540=this;return new Promise(function(_0x5d55ce,_0x572db4){return db['CmContact'][_0xac0f('0x1f')]()[_0xac0f('0xe')](function(_0x46b514){return db['sequelize'][_0xac0f('0x20')](function(_0x50aceb){return db['CmHopper'][_0xac0f('0x21')]({'where':_0x13b5e7['options']?_0x13b5e7['options'][_0xac0f('0x8')]||null:null,'attributes':_0x13b5e7[_0xac0f('0x6')]?_0x13b5e7[_0xac0f('0x6')][_0xac0f('0x9')]||null:null,'limit':_0x13b5e7[_0xac0f('0x6')]?_0x13b5e7[_0xac0f('0x6')][_0xac0f('0xa')]||null:null,'order':_0x13b5e7['options']?_0x13b5e7['options']['order']||null:null,'transaction':_0x50aceb,'lock':_0x50aceb['LOCK']['UPDATE'],'include':[{'model':db[_0xac0f('0x22')],'as':'Contact','attributes':_['keys'](_0x46b514)},{'model':db['User'],'as':_0xac0f('0x23'),'attributes':['id',_0xac0f('0x24'),'voicePause']}]})[_0xac0f('0xe')](function(_0x128da7){var _0x355e4f=[];var _0x2b58ee=[];for(var _0x25b67d=0x0;_0x25b67d<_0x128da7['length'];_0x25b67d+=0x1){var _0x5d87cb=_0x128da7[_0x25b67d]['UserId'];if(_0x5d87cb===null){_0x355e4f[_0xac0f('0x25')](_0x128da7[_0x25b67d]['update'](_0x13b5e7[_0xac0f('0x19')],{'transaction':_0x50aceb}));}else if(!_0x2b58ee[_0xac0f('0x26')](_0x5d87cb)){_0x2b58ee['push'](_0x5d87cb);_0x355e4f['push'](_0x128da7[_0x25b67d]['update'](_0x13b5e7[_0xac0f('0x19')],{'transaction':_0x50aceb}));}}return BPromise[_0xac0f('0x27')](_0x355e4f);});})['then'](function(_0xe6778b){logger[_0xac0f('0xf')]('GetContactDialer',_0x13b5e7);if(_0xe6778b['length']>0x0){logger[_0xac0f('0xf')](_0xac0f('0x28'),_0xe6778b[0x0][_0xac0f('0x29')]['id'],_0xe6778b[0x0][_0xac0f('0x29')]['ContactId'],_0xe6778b[0x0]['dataValues'][_0xac0f('0x1d')]);}logger[_0xac0f('0x16')](_0xac0f('0x2a'),_0x13b5e7,JSON[_0xac0f('0x10')](_0xe6778b));_0x5d55ce(_0xe6778b);})[_0xac0f('0x11')](function(_0x27503c){logger[_0xac0f('0x12')](_0xac0f('0x2a'),_0x27503c[_0xac0f('0x13')],_0x13b5e7);_0x572db4(_0x375540[_0xac0f('0x12')](0x1f4,_0x27503c[_0xac0f('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x444ca8){var _0x5afa85=this;return new Promise(function(_0x9a2282,_0xbe3441){return db['sequelize'][_0xac0f('0x20')](function(_0x189cfb){return db['CmHopperFinal'][_0xac0f('0x18')](_0x444ca8[_0xac0f('0x19')],{'raw':_0x444ca8[_0xac0f('0x6')]?_0x444ca8['options'][_0xac0f('0x7')]===undefined?!![]:![]:!![],'transaction':_0x189cfb})[_0xac0f('0xe')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xac0f('0x10')](_0x444ca8[_0xac0f('0x6')][_0xac0f('0x8')]),_0x444ca8[_0xac0f('0x6')]['where'][_0xac0f('0x1d')]);return db[_0xac0f('0x5')][_0xac0f('0x2b')]({'where':_0x444ca8[_0xac0f('0x6')]?_0x444ca8['options']['where']||null:null,'transaction':_0x189cfb});});})[_0xac0f('0xe')](function(_0x58e63e){logger['info'](_0xac0f('0x2c'),_0x444ca8);logger[_0xac0f('0x16')](_0xac0f('0x2c'),_0x444ca8,JSON['stringify'](_0x58e63e));_0x9a2282(_0x58e63e);})[_0xac0f('0x11')](function(_0x2b9182){logger[_0xac0f('0x12')]('MoveContactManagedDialer',_0x2b9182[_0xac0f('0x13')],_0x444ca8);_0xbe3441(_0x5afa85['error'](0x1f4,_0x2b9182[_0xac0f('0x13')]));});});};exports['CountReScheduled']=function(_0xd434cb){var _0x1e79d8=this;return new Promise(function(_0x21571d,_0x2b546d){return db[_0xac0f('0x5')]['findAll']({'raw':_0xd434cb[_0xac0f('0x6')]?_0xd434cb['options'][_0xac0f('0x7')]===undefined?!![]:![]:!![],'where':_0xd434cb[_0xac0f('0x6')]?_0xd434cb[_0xac0f('0x6')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xac0f('0x2d'),db['sequelize']['fn']('IF',db[_0xac0f('0x2e')][_0xac0f('0x2f')](_0xac0f('0x30')+util['format'](_0xac0f('0x31'),moment()[_0xac0f('0x32')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xac0f('0x33')))),_0xac0f('0x34')]]})[_0xac0f('0xe')](function(_0x517e70){logger[_0xac0f('0xf')](_0xac0f('0x35'),_0xd434cb);logger['debug'](_0xac0f('0x35'),_0xd434cb,JSON[_0xac0f('0x10')](_0x517e70));_0x21571d(_0x517e70);})[_0xac0f('0x11')](function(_0x5e2afa){logger[_0xac0f('0x12')](_0xac0f('0x35'),_0x5e2afa['message'],_0xd434cb);_0x2b546d(_0x1e79d8['error'](0x1f4,_0x5e2afa[_0xac0f('0x13')]));});});};exports[_0xac0f('0x36')]=function(_0x3486cf){var _0xca3ae0=this;return new Promise(function(_0x44c493,_0x117e5e){return db[_0xac0f('0x22')][_0xac0f('0x1f')]()[_0xac0f('0xe')](function(){return db[_0xac0f('0x2e')]['transaction'](function(_0x48eac2){return db[_0xac0f('0x5')][_0xac0f('0x21')]({'where':_0x3486cf[_0xac0f('0x6')]?_0x3486cf['options'][_0xac0f('0x8')]||null:null,'attributes':_0x3486cf[_0xac0f('0x6')]?_0x3486cf[_0xac0f('0x6')][_0xac0f('0x9')]||null:null,'limit':0x1,'order':_0x3486cf[_0xac0f('0x6')]?_0x3486cf[_0xac0f('0x6')][_0xac0f('0x37')]||null:null,'group':db[_0xac0f('0x5')]['UserId'],'transaction':_0x48eac2,'lock':_0x48eac2[_0xac0f('0x38')]['UPDATE'],'include':_0x3486cf[_0xac0f('0x6')]?_0x3486cf[_0xac0f('0x6')][_0xac0f('0xb')]?_['map'](_0x3486cf[_0xac0f('0x6')]['include'],function(_0x3caace){return{'model':db[_0x3caace[_0xac0f('0xd')]],'as':_0x3caace['as'],'attributes':_0x3caace['attributes'],'include':_0x3caace[_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x3caace[_0xac0f('0xb')],function(_0x4a2b7e){return{'model':db[_0x4a2b7e[_0xac0f('0xd')]],'as':_0x4a2b7e['as'],'attributes':_0x4a2b7e['attributes'],'include':_0x4a2b7e[_0xac0f('0xb')]?_['map'](_0x4a2b7e[_0xac0f('0xb')],function(_0x4950b9){return{'model':db[_0x4950b9[_0xac0f('0xd')]],'as':_0x4950b9['as'],'attributes':_0x4950b9['attributes']};}):[]};}):[]};}):[]:[]})[_0xac0f('0xe')](function(_0xf94619){var _0x5eeb2c=[];for(var _0xdcd38b=0x0;_0xdcd38b<_0xf94619[_0xac0f('0x39')];_0xdcd38b+=0x1){_0x5eeb2c[_0xac0f('0x25')](_0xf94619[_0xdcd38b][_0xac0f('0x1b')](_0x3486cf[_0xac0f('0x19')],{'transaction':_0x48eac2}));}return BPromise[_0xac0f('0x27')](_0x5eeb2c);});})['then'](function(_0x285b9a){logger['info']('GetContactRecallMe',_0x3486cf);logger['debug'](_0xac0f('0x36'),_0x3486cf,JSON[_0xac0f('0x10')](_0x285b9a));_0x44c493(_0x285b9a);})[_0xac0f('0x11')](function(_0x33d18b){logger[_0xac0f('0x12')](_0xac0f('0x36'),_0x33d18b[_0xac0f('0x13')],_0x3486cf);_0x117e5e(_0xca3ae0[_0xac0f('0x12')](0x1f4,_0x33d18b[_0xac0f('0x13')]));});});});};exports[_0xac0f('0x3a')]=function(_0x52c1cb){var _0x4e698c=this;return new Promise(function(_0x1137c0,_0x14adf2){db[_0xac0f('0x22')]['describe']()['then'](function(_0x4a22d6){return db['CmHopper'][_0xac0f('0x21')]({'raw':_0x52c1cb[_0xac0f('0x6')]?_0x52c1cb['options'][_0xac0f('0x7')]===undefined?!![]:![]:!![],'where':_0x52c1cb[_0xac0f('0x6')]?_0x52c1cb[_0xac0f('0x6')][_0xac0f('0x8')]||null:null,'attributes':_0x52c1cb['options']?_0x52c1cb[_0xac0f('0x6')][_0xac0f('0x9')]||null:null,'limit':_0x52c1cb[_0xac0f('0x6')]?_0x52c1cb['options'][_0xac0f('0xa')]||null:null,'include':_0x52c1cb[_0xac0f('0x6')]?_0x52c1cb[_0xac0f('0x6')][_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x52c1cb[_0xac0f('0x6')]['include'],function(_0x112ffe){return{'model':db[_0x112ffe[_0xac0f('0xd')]],'as':_0x112ffe['as'],'attributes':_0x112ffe['as']===_0xac0f('0x3b')?_['keys'](_0x4a22d6):_0x112ffe['attributes'],'include':_0x112ffe[_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x112ffe[_0xac0f('0xb')],function(_0x3372f1){return{'model':db[_0x3372f1[_0xac0f('0xd')]],'as':_0x3372f1['as'],'attributes':_0x3372f1[_0xac0f('0x9')],'include':_0x3372f1[_0xac0f('0xb')]?_[_0xac0f('0xc')](_0x3372f1[_0xac0f('0xb')],function(_0xb0c70d){return{'model':db[_0xb0c70d[_0xac0f('0xd')]],'as':_0xb0c70d['as'],'attributes':_0xb0c70d['attributes']};}):[]};}):[]};}):[]:[]})[_0xac0f('0xe')](function(_0x595610){logger[_0xac0f('0xf')](_0xac0f('0x4'),_0x52c1cb);logger[_0xac0f('0x16')](_0xac0f('0x4'),_0x52c1cb,JSON['stringify'](_0x595610));_0x1137c0(_0x595610);})['catch'](function(_0x3ae44c){logger[_0xac0f('0x12')](_0xac0f('0x4'),_0x3ae44c[_0xac0f('0x13')],_0x52c1cb);_0x14adf2(_0x4e698c[_0xac0f('0x12')](0x1f4,_0x3ae44c['message']));});});});};exports[_0xac0f('0x3c')]=function(_0x6717e5){var _0x223e0a=this;return new Promise(function(_0x145bf3,_0xcaa1e4){return db[_0xac0f('0x22')]['findOne']({'raw':!![],'where':{'phone':_0x6717e5[_0xac0f('0x6')][_0xac0f('0x8')][_0xac0f('0x3d')]},'attributes':['id',_0xac0f('0x3e')],'order':[['id',_0xac0f('0x3f')]]})['then'](function(_0x181886){logger[_0xac0f('0xf')]('getContactByPhone',_0x6717e5);logger[_0xac0f('0x16')](_0xac0f('0x40'),_0x6717e5,JSON['stringify'](_0x181886));_0x145bf3(_0x181886);})['catch'](function(_0xad2ac6){logger[_0xac0f('0x12')](_0xac0f('0x40'),_0xad2ac6['message'],_0x6717e5);_0xcaa1e4(_0x223e0a[_0xac0f('0x12')](0x1f4,_0xad2ac6[_0xac0f('0x13')]));});});};exports[_0xac0f('0x41')]=function(_0xf19616){var _0x468536=this;return new Promise(function(_0x46ffa7,_0x5bbf46){return db[_0xac0f('0x2e')]['transaction'](function(_0x2d18f3){var _0x3af094=_0xf19616[_0xac0f('0x6')]&&_0xf19616[_0xac0f('0x6')]['where']?_0xf19616[_0xac0f('0x6')][_0xac0f('0x8')]:{};return db['CmHopper'][_0xac0f('0x1b')](_0xf19616[_0xac0f('0x19')],{'where':_0x3af094,'transaction':_0x2d18f3})[_0xac0f('0xe')](function(_0x5b73b6){logger['info'](_0xac0f('0x41'),_0xf19616);logger['debug'](_0xac0f('0x41'),_0xf19616,JSON['stringify'](_0x5b73b6));_0x46ffa7(_0x5b73b6);})[_0xac0f('0x11')](function(_0x49d6ad){logger['error'](_0xac0f('0x41'),_0x49d6ad[_0xac0f('0x13')],_0xf19616);_0x5bbf46(_0x468536[_0xac0f('0x12')](0x1f4,_0x49d6ad['message']));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x2c21cf){var _0x6de3b1=this;var _0x4cdbf2=_0x2c21cf[_0xac0f('0x19')][_0xac0f('0x8')]['voiceQueueIds'];var _0x20aa67=_0x2c21cf['body']['where']['interval'];var _0x1f1c58=_0x2c21cf[_0xac0f('0x19')][_0xac0f('0x8')][_0xac0f('0x42')];return new Promise(function(_0x497154,_0x285196){return db[_0xac0f('0x5')][_0xac0f('0x21')]({'where':{'voiceQueueId':{'$in':_0x4cdbf2},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xac0f('0x2f')](_0xac0f('0x43')+_0x20aa67+_0xac0f('0x44')),'$gt':db[_0xac0f('0x2e')][_0xac0f('0x2f')]('NOW()')}},'UserId':{'$in':_0x1f1c58}},'include':[{'model':db['CmContact'],'as':_0xac0f('0x3b')},{'model':db[_0xac0f('0x45')],'as':_0xac0f('0x23'),'attributes':['id',_0xac0f('0x24'),_0xac0f('0x46')]},{'model':db['CmList'],'as':_0xac0f('0x47')}]})[_0xac0f('0xe')](function(_0x594126){if(_0x594126[_0xac0f('0x39')]>0x0){return db['sequelize'][_0xac0f('0x20')](function(_0x4b1403){return db[_0xac0f('0x5')][_0xac0f('0x1b')]({'recallmeNotifiedDate':db[_0xac0f('0x2e')][_0xac0f('0x2f')](_0xac0f('0x48'))},{'where':{'id':{'$in':_['map'](_0x594126,'id')}},'transaction':_0x4b1403})[_0xac0f('0xe')](function(){_0x497154(_0x594126);})[_0xac0f('0x11')](function(_0x441359){logger[_0xac0f('0x12')]('CmHopperHandlePreviewRecallNotifications',_0x441359[_0xac0f('0x13')],_0x2c21cf);_0x285196(_0x6de3b1[_0xac0f('0x12')](0x1f4,_0x441359['message']));});})[_0xac0f('0x11')](function(_0x2170bf){logger[_0xac0f('0x12')](_0xac0f('0x49'),_0x2170bf[_0xac0f('0x13')],_0x2c21cf);_0x285196(_0x6de3b1['error'](0x1f4,_0x2170bf[_0xac0f('0x13')]));});}else{_0x497154(_0x594126);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 41d4fb2..835594f 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 _0x9f20=['/describe','describe','/opencontacts','getOpenContacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index'];(function(_0x18fec8,_0x31d0cd){var _0x5e400c=function(_0x1f3bc0){while(--_0x1f3bc0){_0x18fec8['push'](_0x18fec8['shift']());}};_0x5e400c(++_0x31d0cd);}(_0x9f20,0x17f));var _0x09f2=function(_0x2c22b5,_0x4e38a2){_0x2c22b5=_0x2c22b5-0x0;var _0x1728eb=_0x9f20[_0x2c22b5];return _0x1728eb;};'use strict';var express=require(_0x09f2('0x0'));var router=express[_0x09f2('0x1')]();var auth=require(_0x09f2('0x2'));var controller=require(_0x09f2('0x3'));router[_0x09f2('0x4')]('/',auth[_0x09f2('0x5')](),controller[_0x09f2('0x6')]);router[_0x09f2('0x4')](_0x09f2('0x7'),auth[_0x09f2('0x5')](),controller[_0x09f2('0x8')]);router['get'](_0x09f2('0x9'),auth[_0x09f2('0x5')](),controller[_0x09f2('0xa')]);router[_0x09f2('0x4')](_0x09f2('0xb'),auth[_0x09f2('0x5')](),controller['getTimezones']);router['get'](_0x09f2('0xc'),auth['isAuthenticated'](),controller[_0x09f2('0xd')]);router[_0x09f2('0x4')](_0x09f2('0xe'),auth[_0x09f2('0x5')](),controller[_0x09f2('0xf')]);router[_0x09f2('0x10')]('/',auth[_0x09f2('0x5')](),controller[_0x09f2('0x11')]);router['post'](_0x09f2('0x12'),auth[_0x09f2('0x5')](),controller[_0x09f2('0x13')]);router[_0x09f2('0x10')](_0x09f2('0x14'),auth[_0x09f2('0x5')](),controller[_0x09f2('0x15')]);router[_0x09f2('0x16')]('/:id',auth[_0x09f2('0x5')](),controller['update']);router[_0x09f2('0x17')](_0x09f2('0xc'),auth[_0x09f2('0x5')](),controller[_0x09f2('0x18')]);module[_0x09f2('0x19')]=router; \ No newline at end of file +var _0xa121=['describe','getOpenContacts','/timezones','getTimezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','put','delete','destroy','exports','express','Router','../../components/auth/service','get','isAuthenticated','index'];(function(_0x5c5f9a,_0x5d5d85){var _0x507bc5=function(_0x228945){while(--_0x228945){_0x5c5f9a['push'](_0x5c5f9a['shift']());}};_0x507bc5(++_0x5d5d85);}(_0xa121,0x1c6));var _0x1a12=function(_0x4b0e6a,_0x2abb9c){_0x4b0e6a=_0x4b0e6a-0x0;var _0x4c5def=_0xa121[_0x4b0e6a];return _0x4c5def;};'use strict';var express=require(_0x1a12('0x0'));var router=express[_0x1a12('0x1')]();var auth=require(_0x1a12('0x2'));var controller=require('./cmHopper.controller');router[_0x1a12('0x3')]('/',auth[_0x1a12('0x4')](),controller[_0x1a12('0x5')]);router['get']('/describe',auth[_0x1a12('0x4')](),controller[_0x1a12('0x6')]);router['get']('/opencontacts',auth[_0x1a12('0x4')](),controller[_0x1a12('0x7')]);router[_0x1a12('0x3')](_0x1a12('0x8'),auth[_0x1a12('0x4')](),controller[_0x1a12('0x9')]);router[_0x1a12('0x3')](_0x1a12('0xa'),auth[_0x1a12('0x4')](),controller[_0x1a12('0xb')]);router['get'](_0x1a12('0xc'),auth['isAuthenticated'](),controller[_0x1a12('0xd')]);router[_0x1a12('0xe')]('/',auth[_0x1a12('0x4')](),controller[_0x1a12('0xf')]);router[_0x1a12('0xe')](_0x1a12('0x10'),auth[_0x1a12('0x4')](),controller[_0x1a12('0x11')]);router[_0x1a12('0xe')]('/timezone',auth[_0x1a12('0x4')](),controller[_0x1a12('0x12')]);router[_0x1a12('0x13')](_0x1a12('0xa'),auth[_0x1a12('0x4')](),controller['update']);router[_0x1a12('0x14')](_0x1a12('0xa'),auth[_0x1a12('0x4')](),controller[_0x1a12('0x15')]);module[_0x1a12('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 0bc6245..df41002 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 _0x720f=['STRING','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x720f,0xda));var _0xf720=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x720f[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0xf720('0x0'));var Sequelize=require(_0xf720('0x1'));module[_0xf720('0x2')]={'CmHopperId':{'type':Sequelize[_0xf720('0x3')]},'phone':{'type':Sequelize[_0xf720('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0xf720('0x5'))},'countbusyretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf720('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd5d6=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports','INTEGER'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0xd5d6,0x1ab));var _0x6d5d=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xd5d6[_0x494d1f];return _0x457b6e;};'use strict';var moment=require('moment');var Sequelize=require(_0x6d5d('0x0'));module[_0x6d5d('0x1')]={'CmHopperId':{'type':Sequelize[_0x6d5d('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x6d5d('0x3')](_0x6d5d('0x4'))},'countbusyretry':{'type':Sequelize[_0x6d5d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x6d5d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6d5d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6d5d('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 e2a6d15..ad4d7e8 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 _0xbfa8=['includeAll','include','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','bluebird','mustache','util','sox','ejs','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','end','error','stack','name','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','VIRTUAL','merge','options','where','CmHopperAdditionalPhone'];(function(_0x3343bb,_0x34a0f3){var _0xcf6d1b=function(_0x30576e){while(--_0x30576e){_0x3343bb['push'](_0x3343bb['shift']());}};_0xcf6d1b(++_0x34a0f3);}(_0xbfa8,0x181));var _0x8bfa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbfa8[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x8bfa('0x0'));var rimraf=require(_0x8bfa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8bfa('0x2'));var Mustache=require(_0x8bfa('0x3'));var util=require(_0x8bfa('0x4'));var path=require('path');var sox=require(_0x8bfa('0x5'));var csv=require('to-csv');var ejs=require(_0x8bfa('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8bfa('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x8bfa('0x8'));var toCsv=require(_0x8bfa('0x9'));var querystring=require(_0x8bfa('0xa'));var Papa=require('papaparse');var Redis=require(_0x8bfa('0xb'));var authService=require(_0x8bfa('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bfa('0xd'));var logger=require(_0x8bfa('0xe'))(_0x8bfa('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8bfa('0x10'))['db'];function respondWithStatusCode(_0x8dbe7d,_0x4d65d0){_0x4d65d0=_0x4d65d0||0xcc;return function(_0x1b56cb){if(_0x1b56cb){return _0x8dbe7d[_0x8bfa('0x11')](_0x4d65d0);}return _0x8dbe7d['status'](_0x4d65d0)['end']();};}function respondWithResult(_0x5bc6d0,_0x52036b){_0x52036b=_0x52036b||0xc8;return function(_0x18a6ff){if(_0x18a6ff){return _0x5bc6d0[_0x8bfa('0x12')](_0x52036b)[_0x8bfa('0x13')](_0x18a6ff);}};}function respondWithFilteredResult(_0x118aba,_0x51ebf9){return function(_0x1031a3){if(_0x1031a3){var _0x14dc07=typeof _0x51ebf9[_0x8bfa('0x14')]==='undefined'&&typeof _0x51ebf9['limit']===_0x8bfa('0x15');var _0x48b51d=_0x1031a3[_0x8bfa('0x16')];var _0x35f811=_0x14dc07?0x0:_0x51ebf9['offset'];var _0xe265e4=_0x14dc07?_0x1031a3[_0x8bfa('0x16')]:_0x51ebf9['offset']+_0x51ebf9[_0x8bfa('0x17')];var _0xe87fec;if(_0xe265e4>=_0x48b51d){_0xe265e4=_0x48b51d;_0xe87fec=0xc8;}else{_0xe87fec=0xce;}_0x118aba[_0x8bfa('0x12')](_0xe87fec);return _0x118aba[_0x8bfa('0x18')](_0x8bfa('0x19'),_0x35f811+'-'+_0xe265e4+'/'+_0x48b51d)[_0x8bfa('0x13')](_0x1031a3);}return null;};}function patchUpdates(_0x13c217){return function(_0x21236c){try{jsonpatch['apply'](_0x21236c,_0x13c217,!![]);}catch(_0x1c9a0c){return BPromise[_0x8bfa('0x1a')](_0x1c9a0c);}return _0x21236c[_0x8bfa('0x1b')]();};}function saveUpdates(_0x430ed3,_0x529b4a){return function(_0xd4fbb7){if(_0xd4fbb7){return _0xd4fbb7[_0x8bfa('0x1c')](_0x430ed3)[_0x8bfa('0x1d')](function(_0x1f498c){return _0x1f498c;});}return null;};}function removeEntity(_0x2091e2,_0x1d3da7){return function(_0x41f71a){if(_0x41f71a){return _0x41f71a[_0x8bfa('0x1e')]()[_0x8bfa('0x1d')](function(){var _0x106779=_0x41f71a[_0x8bfa('0x1f')]({'plain':!![]});var _0x377ce8=_0x8bfa('0x20');return db['UserProfileResource'][_0x8bfa('0x1e')]({'where':{'type':_0x377ce8,'resourceId':_0x106779['id']}})['then'](function(){return _0x41f71a;});})[_0x8bfa('0x1d')](function(){_0x2091e2[_0x8bfa('0x12')](0xcc)[_0x8bfa('0x21')]();});}};}function handleEntityNotFound(_0x59065e,_0x2bf4a6){return function(_0x506957){if(!_0x506957){_0x59065e[_0x8bfa('0x11')](0x194);}return _0x506957;};}function handleError(_0x4f1d2c,_0x4afaa8){_0x4afaa8=_0x4afaa8||0x1f4;return function(_0x3380bd){logger[_0x8bfa('0x22')](_0x3380bd[_0x8bfa('0x23')]);if(_0x3380bd['name']){delete _0x3380bd[_0x8bfa('0x24')];}_0x4f1d2c[_0x8bfa('0x12')](_0x4afaa8)['send'](_0x3380bd);};}exports[_0x8bfa('0x25')]=function(_0x2259a9,_0x19fd5e){var _0x2f5c6a={},_0x31278f={},_0x2cd38a={'count':0x0,'rows':[]};var _0x32d42d=_[_0x8bfa('0x26')](db['CmHopperAdditionalPhone'][_0x8bfa('0x27')],function(_0x3b41b4){return{'name':_0x3b41b4['fieldName'],'type':_0x3b41b4[_0x8bfa('0x28')][_0x8bfa('0x29')]};});_0x31278f[_0x8bfa('0x2a')]=_[_0x8bfa('0x26')](_0x32d42d,_0x8bfa('0x24'));_0x31278f[_0x8bfa('0x2b')]=_['keys'](_0x2259a9[_0x8bfa('0x2b')]);_0x31278f['filters']=_[_0x8bfa('0x2c')](_0x31278f[_0x8bfa('0x2a')],_0x31278f[_0x8bfa('0x2b')]);_0x2f5c6a[_0x8bfa('0x2d')]=_[_0x8bfa('0x2c')](_0x31278f[_0x8bfa('0x2a')],qs[_0x8bfa('0x2e')](_0x2259a9[_0x8bfa('0x2b')]['fields']));_0x2f5c6a[_0x8bfa('0x2d')]=_0x2f5c6a[_0x8bfa('0x2d')][_0x8bfa('0x2f')]?_0x2f5c6a[_0x8bfa('0x2d')]:_0x31278f[_0x8bfa('0x2a')];if(!_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x30')](_0x8bfa('0x31'))){_0x2f5c6a[_0x8bfa('0x17')]=qs[_0x8bfa('0x17')](_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x17')]);_0x2f5c6a[_0x8bfa('0x14')]=qs[_0x8bfa('0x14')](_0x2259a9[_0x8bfa('0x2b')]['offset']);}_0x2f5c6a[_0x8bfa('0x32')]=qs[_0x8bfa('0x33')](_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x33')]);_0x2f5c6a['where']=qs['filters'](_['pick'](_0x2259a9[_0x8bfa('0x2b')],_0x31278f[_0x8bfa('0x34')]),_0x32d42d);if(_0x2259a9['query'][_0x8bfa('0x35')]){_0x2f5c6a['where']=_['merge'](_0x2f5c6a['where'],{'$or':_[_0x8bfa('0x26')](_0x32d42d,function(_0x396730){if(_0x396730[_0x8bfa('0x28')]!==_0x8bfa('0x36')){var _0x8f5731={};_0x8f5731[_0x396730[_0x8bfa('0x24')]]={'$like':'%'+_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x35')]+'%'};return _0x8f5731;}})});}_0x2f5c6a=_[_0x8bfa('0x37')]({},_0x2f5c6a,_0x2259a9[_0x8bfa('0x38')]);var _0x25919e={'where':_0x2f5c6a[_0x8bfa('0x39')]};return db[_0x8bfa('0x3a')][_0x8bfa('0x16')](_0x25919e)[_0x8bfa('0x1d')](function(_0x22bdd9){_0x2cd38a['count']=_0x22bdd9;if(_0x2259a9[_0x8bfa('0x2b')][_0x8bfa('0x3b')]){_0x2f5c6a[_0x8bfa('0x3c')]=[{'all':!![]}];}return db[_0x8bfa('0x3a')]['findAll'](_0x2f5c6a);})[_0x8bfa('0x1d')](function(_0x508c8b){_0x2cd38a[_0x8bfa('0x3d')]=_0x508c8b;return _0x2cd38a;})[_0x8bfa('0x1d')](respondWithFilteredResult(_0x19fd5e,_0x2f5c6a))[_0x8bfa('0x3e')](handleError(_0x19fd5e,null));};exports[_0x8bfa('0x3f')]=function(_0x3f0e80,_0x526c92){var _0x3531f5={'raw':!![],'where':{'id':_0x3f0e80[_0x8bfa('0x40')]['id']}},_0x4cfd96={};_0x4cfd96['model']=_['keys'](db[_0x8bfa('0x3a')][_0x8bfa('0x27')]);_0x4cfd96['query']=_[_0x8bfa('0x41')](_0x3f0e80['query']);_0x4cfd96['filters']=_[_0x8bfa('0x2c')](_0x4cfd96[_0x8bfa('0x2a')],_0x4cfd96[_0x8bfa('0x2b')]);_0x3531f5[_0x8bfa('0x2d')]=_[_0x8bfa('0x2c')](_0x4cfd96[_0x8bfa('0x2a')],qs[_0x8bfa('0x2e')](_0x3f0e80[_0x8bfa('0x2b')][_0x8bfa('0x2e')]));_0x3531f5[_0x8bfa('0x2d')]=_0x3531f5[_0x8bfa('0x2d')][_0x8bfa('0x2f')]?_0x3531f5[_0x8bfa('0x2d')]:_0x4cfd96[_0x8bfa('0x2a')];if(_0x3f0e80[_0x8bfa('0x2b')][_0x8bfa('0x3b')]){_0x3531f5[_0x8bfa('0x3c')]=[{'all':!![]}];}_0x3531f5=_['merge']({},_0x3531f5,_0x3f0e80[_0x8bfa('0x38')]);return db[_0x8bfa('0x3a')][_0x8bfa('0x42')](_0x3531f5)[_0x8bfa('0x1d')](handleEntityNotFound(_0x526c92,null))['then'](respondWithResult(_0x526c92,null))['catch'](handleError(_0x526c92,null));};exports[_0x8bfa('0x43')]=function(_0x11d372,_0x44e118){return db['CmHopperAdditionalPhone']['create'](_0x11d372[_0x8bfa('0x44')],{})[_0x8bfa('0x1d')](function(_0x597c71){var _0x49a9ca=_0x11d372['user'][_0x8bfa('0x1f')]({'plain':!![]});if(!_0x49a9ca)throw new Error(_0x8bfa('0x45'));if(_0x49a9ca[_0x8bfa('0x46')]==='user'){var _0x5e2b80=_0x597c71['get']({'plain':!![]});var _0x3b7e1e=_0x8bfa('0x20');return db[_0x8bfa('0x47')]['find']({'where':{'name':_0x3b7e1e,'userProfileId':_0x49a9ca['userProfileId']},'raw':!![]})[_0x8bfa('0x1d')](function(_0x33e1d5){if(_0x33e1d5&&_0x33e1d5[_0x8bfa('0x48')]===0x0){return db['UserProfileResource']['create']({'name':_0x5e2b80[_0x8bfa('0x24')],'resourceId':_0x5e2b80['id'],'type':_0x33e1d5[_0x8bfa('0x24')],'sectionId':_0x33e1d5['id']},{})[_0x8bfa('0x1d')](function(){return _0x597c71;});}else{return _0x597c71;}})[_0x8bfa('0x3e')](function(_0x66016c){logger[_0x8bfa('0x22')](_0x8bfa('0x49'),_0x66016c);throw _0x66016c;});}return _0x597c71;})[_0x8bfa('0x1d')](respondWithResult(_0x44e118,0xc9))[_0x8bfa('0x3e')](handleError(_0x44e118,null));};exports['update']=function(_0x3a8d82,_0x454dfa){if(_0x3a8d82[_0x8bfa('0x44')]['id']){delete _0x3a8d82[_0x8bfa('0x44')]['id'];}return db[_0x8bfa('0x3a')]['find']({'where':{'id':_0x3a8d82[_0x8bfa('0x40')]['id']}})['then'](handleEntityNotFound(_0x454dfa,null))[_0x8bfa('0x1d')](saveUpdates(_0x3a8d82[_0x8bfa('0x44')],null))[_0x8bfa('0x1d')](respondWithResult(_0x454dfa,null))['catch'](handleError(_0x454dfa,null));};exports[_0x8bfa('0x1e')]=function(_0x29ce81,_0x87328a){return db[_0x8bfa('0x3a')][_0x8bfa('0x42')]({'where':{'id':_0x29ce81[_0x8bfa('0x40')]['id']}})['then'](handleEntityNotFound(_0x87328a,null))[_0x8bfa('0x1d')](removeEntity(_0x87328a,null))[_0x8bfa('0x3e')](handleError(_0x87328a,null));}; \ No newline at end of file +var _0x42dd=['sendStatus','end','json','undefined','limit','count','offset','status','set','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','CmHopperAdditionalPhone','includeAll','include','rows','show','params','intersection','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x42dd,0x18b));var _0xd42d=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x42dd[_0x173441];return _0x2423a8;};'use strict';var emlformat=require(_0xd42d('0x0'));var rimraf=require(_0xd42d('0x1'));var zipdir=require(_0xd42d('0x2'));var jsonpatch=require(_0xd42d('0x3'));var rp=require(_0xd42d('0x4'));var moment=require(_0xd42d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd42d('0x6'));var path=require(_0xd42d('0x7'));var sox=require(_0xd42d('0x8'));var csv=require('to-csv');var ejs=require(_0xd42d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd42d('0xa'));var squel=require(_0xd42d('0xb'));var crypto=require('crypto');var jsforce=require(_0xd42d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd42d('0xd'));var querystring=require(_0xd42d('0xe'));var Papa=require(_0xd42d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd42d('0x10'));var as=require(_0xd42d('0x11'));var hardwareService=require(_0xd42d('0x12'));var logger=require(_0xd42d('0x13'))(_0xd42d('0x14'));var utils=require(_0xd42d('0x15'));var config=require(_0xd42d('0x16'));var licenseUtil=require(_0xd42d('0x17'));var db=require(_0xd42d('0x18'))['db'];function respondWithStatusCode(_0x27a160,_0x2dbf38){_0x2dbf38=_0x2dbf38||0xcc;return function(_0x303841){if(_0x303841){return _0x27a160[_0xd42d('0x19')](_0x2dbf38);}return _0x27a160['status'](_0x2dbf38)[_0xd42d('0x1a')]();};}function respondWithResult(_0x21701e,_0x13d039){_0x13d039=_0x13d039||0xc8;return function(_0x532179){if(_0x532179){return _0x21701e['status'](_0x13d039)[_0xd42d('0x1b')](_0x532179);}};}function respondWithFilteredResult(_0x119667,_0x5ebe58){return function(_0x577872){if(_0x577872){var _0xa0421b=typeof _0x5ebe58['offset']===_0xd42d('0x1c')&&typeof _0x5ebe58[_0xd42d('0x1d')]===_0xd42d('0x1c');var _0x2ae7b3=_0x577872['count'];var _0x6840b9=_0xa0421b?0x0:_0x5ebe58['offset'];var _0x325f63=_0xa0421b?_0x577872[_0xd42d('0x1e')]:_0x5ebe58[_0xd42d('0x1f')]+_0x5ebe58[_0xd42d('0x1d')];var _0x2336e8;if(_0x325f63>=_0x2ae7b3){_0x325f63=_0x2ae7b3;_0x2336e8=0xc8;}else{_0x2336e8=0xce;}_0x119667[_0xd42d('0x20')](_0x2336e8);return _0x119667[_0xd42d('0x21')]('Content-Range',_0x6840b9+'-'+_0x325f63+'/'+_0x2ae7b3)[_0xd42d('0x1b')](_0x577872);}return null;};}function patchUpdates(_0x304d81){return function(_0x144999){try{jsonpatch[_0xd42d('0x22')](_0x144999,_0x304d81,!![]);}catch(_0x1dd5ed){return BPromise[_0xd42d('0x23')](_0x1dd5ed);}return _0x144999['save']();};}function saveUpdates(_0x418076,_0x3a1ba4){return function(_0x4ea08c){if(_0x4ea08c){return _0x4ea08c[_0xd42d('0x24')](_0x418076)['then'](function(_0x3a7f27){return _0x3a7f27;});}return null;};}function removeEntity(_0x39b295,_0x504fec){return function(_0x833131){if(_0x833131){return _0x833131['destroy']()[_0xd42d('0x25')](function(){var _0xc767f1=_0x833131[_0xd42d('0x26')]({'plain':!![]});var _0x2b2b76='CmHopperAdditionalPhones';return db[_0xd42d('0x27')]['destroy']({'where':{'type':_0x2b2b76,'resourceId':_0xc767f1['id']}})['then'](function(){return _0x833131;});})[_0xd42d('0x25')](function(){_0x39b295[_0xd42d('0x20')](0xcc)[_0xd42d('0x1a')]();});}};}function handleEntityNotFound(_0x5f0fbe,_0x445760){return function(_0x2bd6c2){if(!_0x2bd6c2){_0x5f0fbe['sendStatus'](0x194);}return _0x2bd6c2;};}function handleError(_0x1ec00e,_0x46d9f1){_0x46d9f1=_0x46d9f1||0x1f4;return function(_0x2c2bc7){logger[_0xd42d('0x28')](_0x2c2bc7[_0xd42d('0x29')]);if(_0x2c2bc7[_0xd42d('0x2a')]){delete _0x2c2bc7[_0xd42d('0x2a')];}_0x1ec00e[_0xd42d('0x20')](_0x46d9f1)[_0xd42d('0x2b')](_0x2c2bc7);};}exports[_0xd42d('0x2c')]=function(_0x408616,_0x5809ed){var _0x3cef46={},_0x34cd23={},_0x2de68e={'count':0x0,'rows':[]};var _0x52989d=_[_0xd42d('0x2d')](db['CmHopperAdditionalPhone'][_0xd42d('0x2e')],function(_0x330b6f){return{'name':_0x330b6f[_0xd42d('0x2f')],'type':_0x330b6f[_0xd42d('0x30')][_0xd42d('0x31')]};});_0x34cd23[_0xd42d('0x32')]=_['map'](_0x52989d,_0xd42d('0x2a'));_0x34cd23[_0xd42d('0x33')]=_[_0xd42d('0x34')](_0x408616['query']);_0x34cd23[_0xd42d('0x35')]=_['intersection'](_0x34cd23[_0xd42d('0x32')],_0x34cd23[_0xd42d('0x33')]);_0x3cef46[_0xd42d('0x36')]=_['intersection'](_0x34cd23[_0xd42d('0x32')],qs[_0xd42d('0x37')](_0x408616['query'][_0xd42d('0x37')]));_0x3cef46[_0xd42d('0x36')]=_0x3cef46[_0xd42d('0x36')][_0xd42d('0x38')]?_0x3cef46[_0xd42d('0x36')]:_0x34cd23[_0xd42d('0x32')];if(!_0x408616[_0xd42d('0x33')][_0xd42d('0x39')](_0xd42d('0x3a'))){_0x3cef46['limit']=qs[_0xd42d('0x1d')](_0x408616[_0xd42d('0x33')][_0xd42d('0x1d')]);_0x3cef46['offset']=qs[_0xd42d('0x1f')](_0x408616[_0xd42d('0x33')][_0xd42d('0x1f')]);}_0x3cef46[_0xd42d('0x3b')]=qs[_0xd42d('0x3c')](_0x408616[_0xd42d('0x33')][_0xd42d('0x3c')]);_0x3cef46[_0xd42d('0x3d')]=qs['filters'](_[_0xd42d('0x3e')](_0x408616[_0xd42d('0x33')],_0x34cd23['filters']),_0x52989d);if(_0x408616[_0xd42d('0x33')][_0xd42d('0x3f')]){_0x3cef46[_0xd42d('0x3d')]=_[_0xd42d('0x40')](_0x3cef46[_0xd42d('0x3d')],{'$or':_[_0xd42d('0x2d')](_0x52989d,function(_0x589f90){if(_0x589f90[_0xd42d('0x30')]!=='VIRTUAL'){var _0xbd69dc={};_0xbd69dc[_0x589f90[_0xd42d('0x2a')]]={'$like':'%'+_0x408616[_0xd42d('0x33')][_0xd42d('0x3f')]+'%'};return _0xbd69dc;}})});}_0x3cef46=_['merge']({},_0x3cef46,_0x408616['options']);var _0x4d8edf={'where':_0x3cef46[_0xd42d('0x3d')]};return db[_0xd42d('0x41')]['count'](_0x4d8edf)[_0xd42d('0x25')](function(_0x4d69e4){_0x2de68e['count']=_0x4d69e4;if(_0x408616[_0xd42d('0x33')][_0xd42d('0x42')]){_0x3cef46[_0xd42d('0x43')]=[{'all':!![]}];}return db[_0xd42d('0x41')]['findAll'](_0x3cef46);})['then'](function(_0x18b13b){_0x2de68e[_0xd42d('0x44')]=_0x18b13b;return _0x2de68e;})['then'](respondWithFilteredResult(_0x5809ed,_0x3cef46))['catch'](handleError(_0x5809ed,null));};exports[_0xd42d('0x45')]=function(_0x4e7158,_0x1d10b0){var _0x437eb3={'raw':!![],'where':{'id':_0x4e7158[_0xd42d('0x46')]['id']}},_0x19c690={};_0x19c690[_0xd42d('0x32')]=_[_0xd42d('0x34')](db[_0xd42d('0x41')]['rawAttributes']);_0x19c690[_0xd42d('0x33')]=_[_0xd42d('0x34')](_0x4e7158[_0xd42d('0x33')]);_0x19c690[_0xd42d('0x35')]=_[_0xd42d('0x47')](_0x19c690[_0xd42d('0x32')],_0x19c690[_0xd42d('0x33')]);_0x437eb3[_0xd42d('0x36')]=_[_0xd42d('0x47')](_0x19c690['model'],qs[_0xd42d('0x37')](_0x4e7158['query']['fields']));_0x437eb3[_0xd42d('0x36')]=_0x437eb3[_0xd42d('0x36')][_0xd42d('0x38')]?_0x437eb3[_0xd42d('0x36')]:_0x19c690['model'];if(_0x4e7158[_0xd42d('0x33')]['includeAll']){_0x437eb3[_0xd42d('0x43')]=[{'all':!![]}];}_0x437eb3=_[_0xd42d('0x40')]({},_0x437eb3,_0x4e7158[_0xd42d('0x48')]);return db[_0xd42d('0x41')][_0xd42d('0x49')](_0x437eb3)[_0xd42d('0x25')](handleEntityNotFound(_0x1d10b0,null))[_0xd42d('0x25')](respondWithResult(_0x1d10b0,null))[_0xd42d('0x4a')](handleError(_0x1d10b0,null));};exports[_0xd42d('0x4b')]=function(_0xdd32fe,_0x1d5a67){return db[_0xd42d('0x41')][_0xd42d('0x4b')](_0xdd32fe[_0xd42d('0x4c')],{})[_0xd42d('0x25')](function(_0x5ea7bf){var _0x4e8f79=_0xdd32fe[_0xd42d('0x4d')][_0xd42d('0x26')]({'plain':!![]});if(!_0x4e8f79)throw new Error(_0xd42d('0x4e'));if(_0x4e8f79[_0xd42d('0x4f')]==='user'){var _0x6119c=_0x5ea7bf[_0xd42d('0x26')]({'plain':!![]});var _0xbe126c='CmHopperAdditionalPhones';return db['UserProfileSection']['find']({'where':{'name':_0xbe126c,'userProfileId':_0x4e8f79[_0xd42d('0x50')]},'raw':!![]})[_0xd42d('0x25')](function(_0x53bbfe){if(_0x53bbfe&&_0x53bbfe[_0xd42d('0x51')]===0x0){return db['UserProfileResource'][_0xd42d('0x4b')]({'name':_0x6119c[_0xd42d('0x2a')],'resourceId':_0x6119c['id'],'type':_0x53bbfe[_0xd42d('0x2a')],'sectionId':_0x53bbfe['id']},{})[_0xd42d('0x25')](function(){return _0x5ea7bf;});}else{return _0x5ea7bf;}})['catch'](function(_0x33290e){logger['error'](_0xd42d('0x52'),_0x33290e);throw _0x33290e;});}return _0x5ea7bf;})['then'](respondWithResult(_0x1d5a67,0xc9))[_0xd42d('0x4a')](handleError(_0x1d5a67,null));};exports[_0xd42d('0x24')]=function(_0x50731a,_0x13d025){if(_0x50731a[_0xd42d('0x4c')]['id']){delete _0x50731a[_0xd42d('0x4c')]['id'];}return db[_0xd42d('0x41')]['find']({'where':{'id':_0x50731a['params']['id']}})['then'](handleEntityNotFound(_0x13d025,null))[_0xd42d('0x25')](saveUpdates(_0x50731a[_0xd42d('0x4c')],null))[_0xd42d('0x25')](respondWithResult(_0x13d025,null))[_0xd42d('0x4a')](handleError(_0x13d025,null));};exports[_0xd42d('0x53')]=function(_0xc70104,_0x3a0e99){return db['CmHopperAdditionalPhone'][_0xd42d('0x49')]({'where':{'id':_0xc70104['params']['id']}})[_0xd42d('0x25')](handleEntityNotFound(_0x3a0e99,null))['then'](removeEntity(_0x3a0e99,null))[_0xd42d('0x4a')](handleError(_0x3a0e99,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 12ca93f..92e4cdb 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 _0x0686=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','../../config/logger'];(function(_0x167205,_0x5b7425){var _0x24a7e9=function(_0xbb5306){while(--_0xbb5306){_0x167205['push'](_0x167205['shift']());}};_0x24a7e9(++_0x5b7425);}(_0x0686,0x123));var _0x6068=function(_0x4b5f33,_0x32f9a2){_0x4b5f33=_0x4b5f33-0x0;var _0x300939=_0x0686[_0x4b5f33];return _0x300939;};'use strict';var _=require(_0x6068('0x0'));var util=require(_0x6068('0x1'));var logger=require(_0x6068('0x2'))(_0x6068('0x3'));var moment=require(_0x6068('0x4'));var BPromise=require(_0x6068('0x5'));var rp=require(_0x6068('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6068('0x7'));var config=require(_0x6068('0x8'));var attributes=require(_0x6068('0x9'));module[_0x6068('0xa')]=function(_0x2d4dd0,_0x3e5dfd){return _0x2d4dd0[_0x6068('0xb')](_0x6068('0xc'),attributes,{'tableName':_0x6068('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa34e=['./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash','util','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x395dc0,_0x3e1799){var _0x5c77d8=function(_0x32d9ad){while(--_0x32d9ad){_0x395dc0['push'](_0x395dc0['shift']());}};_0x5c77d8(++_0x3e1799);}(_0xa34e,0x17a));var _0xea34=function(_0x42e1ec,_0x19aacc){_0x42e1ec=_0x42e1ec-0x0;var _0xe8c124=_0xa34e[_0x42e1ec];return _0xe8c124;};'use strict';var _=require(_0xea34('0x0'));var util=require(_0xea34('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xea34('0x2'));var BPromise=require(_0xea34('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea34('0x4'));var rimraf=require(_0xea34('0x5'));var config=require(_0xea34('0x6'));var attributes=require(_0xea34('0x7'));module[_0xea34('0x8')]=function(_0x1996b1,_0x4bf94c){return _0x1996b1['define'](_0xea34('0x9'),attributes,{'tableName':_0xea34('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index ba5af15..43b4c3f 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 _0x97f5=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CmHopper','findOne','ContactId','body','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','entity','CmHopperAdditionalPhone','countnoanswerretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','minutes','add','phone','createdAt','updatedAt','transaction','update','IncrementPreviewCounters','field'];(function(_0x4d12b0,_0x664307){var _0x30cecd=function(_0x59a309){while(--_0x59a309){_0x4d12b0['push'](_0x4d12b0['shift']());}};_0x30cecd(++_0x664307);}(_0x97f5,0x72));var _0x597f=function(_0x1c952e,_0x3fb65a){_0x1c952e=_0x1c952e-0x0;var _0x2e807e=_0x97f5[_0x1c952e];return _0x2e807e;};'use strict';var _=require(_0x597f('0x0'));var util=require(_0x597f('0x1'));var moment=require(_0x597f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x597f('0x3'));var db=require(_0x597f('0x4'))['db'];var utils=require(_0x597f('0x5'));var logger=require(_0x597f('0x6'))(_0x597f('0x7'));var config=require(_0x597f('0x8'));var jayson=require(_0x597f('0x9'));var client=jayson[_0x597f('0xa')][_0x597f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f4eb9,_0x22b5d0,_0x20f0fc){return new BPromise(function(_0x1098e6,_0x40b1cd){return client[_0x597f('0xc')](_0x5f4eb9,_0x20f0fc)[_0x597f('0xd')](function(_0x5b293a){logger[_0x597f('0xe')](_0x597f('0xf'),_0x22b5d0,_0x597f('0x10'));logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x22b5d0,_0x597f('0x10'),JSON['stringify'](_0x5b293a));if(_0x5b293a[_0x597f('0x11')]){if(_0x5b293a[_0x597f('0x11')][_0x597f('0x12')]===0x1f4){logger['error'](_0x597f('0xf'),_0x22b5d0,_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);return _0x40b1cd(_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);}logger[_0x597f('0x11')](_0x597f('0xf'),_0x22b5d0,_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);return _0x1098e6(_0x5b293a[_0x597f('0x11')][_0x597f('0x13')]);}else{logger[_0x597f('0xe')](_0x597f('0xf'),_0x22b5d0,'request\x20sent');_0x1098e6(_0x5b293a[_0x597f('0x14')][_0x597f('0x13')]);}})[_0x597f('0x15')](function(_0x55eed9){logger[_0x597f('0x11')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x22b5d0,_0x55eed9);_0x40b1cd(_0x55eed9);});});}exports['VerifyAdditionalPhones']=function(_0x507552){var _0x50f89a=this;return new Promise(function(_0x49f12b,_0x4dcc95){return db[_0x597f('0x16')][_0x597f('0x17')]({'raw':!![],'where':{'ContactId':_0x507552['body'][_0x597f('0x18')],'ListId':_0x507552[_0x597f('0x19')][_0x597f('0x1a')],'VoiceQueueId':_0x507552[_0x597f('0x19')]['VoiceQueueId']===undefined?null:_0x507552['body'][_0x597f('0x1b')],'CampaignId':_0x507552[_0x597f('0x19')][_0x597f('0x1c')]===undefined?null:_0x507552[_0x597f('0x19')]['CampaignId']}})['then'](function(_0x376b5f){if(_0x376b5f!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x376b5f['id'],'OrderBy':{'$gt':_0x376b5f[_0x597f('0x1d')]}},'order':[[_0x597f('0x1d'),_0x597f('0x1e')]]})['then'](function(_0x553e9c){var _0x51bc3c=0x0;if(_0x553e9c){if(_0x553e9c[_0x597f('0x1f')]+_0x553e9c[_0x597f('0x20')]+_0x553e9c['countnoanswerretry']+_0x553e9c[_0x597f('0x21')]+_0x553e9c[_0x597f('0x22')]+_0x553e9c[_0x597f('0x23')]+_0x553e9c['countmachineretry']+_0x553e9c['countagentrejectretry']<_0x507552[_0x597f('0x24')]['dialGlobalMaxRetry'])_0x51bc3c=0x1;_0x49f12b({'additional':_0x51bc3c});}else{return db[_0x597f('0x25')][_0x597f('0x17')]({'raw':!![],'where':{'CmHopperId':_0x376b5f['id']},'order':[[_0x597f('0x1d'),_0x597f('0x1e')]]})[_0x597f('0xd')](function(_0x10509d){var _0x1c5300=0x0;if(_0x10509d){if(_0x10509d['countbusyretry']+_0x10509d['countcongestionretry']+_0x10509d[_0x597f('0x26')]+_0x10509d['countnosuchnumberretry']+_0x10509d[_0x597f('0x22')]+_0x10509d[_0x597f('0x23')]+_0x10509d[_0x597f('0x27')]+_0x10509d[_0x597f('0x28')]<_0x507552[_0x597f('0x24')][_0x597f('0x29')])_0x1c5300=0x1;_0x49f12b({'additional':_0x1c5300});}else{_0x49f12b({'additional':0x0});}})[_0x597f('0x15')](function(_0x591a8e){logger['error'](_0x597f('0x2a'),_0x591a8e['message']);_0x4dcc95(_0x50f89a[_0x597f('0x11')](0x1f4,_0x591a8e[_0x597f('0x13')]));});}})[_0x597f('0x15')](function(_0x6a05f){logger['error'](_0x597f('0x2a'),_0x6a05f[_0x597f('0x13')]);_0x4dcc95(_0x50f89a['error'](0x1f4,_0x6a05f[_0x597f('0x13')]));});}else _0x49f12b({'additional':0x0});});});};exports[_0x597f('0x2b')]=function(_0x402d84){var _0x4e91a1=this;return new Promise(function(_0x4eb733,_0xb9c3c9){return db[_0x597f('0x16')][_0x597f('0x17')]({'raw':!![],'where':{'ContactId':_0x402d84['body']['ContactId'],'ListId':_0x402d84[_0x597f('0x19')][_0x597f('0x1a')],'VoiceQueueId':_0x402d84[_0x597f('0x19')][_0x597f('0x1b')]===undefined?null:_0x402d84[_0x597f('0x19')]['VoiceQueueId'],'CampaignId':_0x402d84[_0x597f('0x19')][_0x597f('0x1c')]===undefined?null:_0x402d84[_0x597f('0x19')][_0x597f('0x1c')]}})[_0x597f('0xd')](function(_0x75eb9f){if(_0x75eb9f!=null){return db[_0x597f('0x25')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x75eb9f['id'],'OrderBy':{'$gte':_0x75eb9f[_0x597f('0x1d')]}},'order':[['OrderBy',_0x597f('0x1e')]]})[_0x597f('0xd')](function(_0x3e3505){if(_0x3e3505)return activateAdditionalPhone(_0x75eb9f,_0x402d84['body'],_0x3e3505,_0x402d84[_0x597f('0x2c')],_0x402d84['waitTime'])[_0x597f('0xd')](function(_0x1e71de){_0x4eb733(_0x1e71de);});else{return db[_0x597f('0x25')][_0x597f('0x17')]({'raw':!![],'where':{'CmHopperId':_0x75eb9f['id']},'order':[[_0x597f('0x1d'),_0x597f('0x1e')]]})[_0x597f('0xd')](function(_0x25f103){if(_0x25f103)return activateAdditionalPhone(_0x75eb9f,_0x402d84['body'],_0x25f103,_0x402d84[_0x597f('0x2c')],_0x402d84[_0x597f('0x2d')])[_0x597f('0xd')](function(_0x5e20d9){_0x4eb733(_0x5e20d9);});else{_0x4eb733({'id':_0x75eb9f['id'],'phone':''});}})['catch'](function(_0x52c995){logger[_0x597f('0x11')](_0x597f('0x2a'),_0x52c995[_0x597f('0x13')]);_0xb9c3c9(_0x4e91a1['error'](0x1f4,_0x52c995[_0x597f('0x13')]));});}})[_0x597f('0x15')](function(_0x50b5a3){logger[_0x597f('0x11')](_0x597f('0x2a'),_0x50b5a3[_0x597f('0x13')]);_0xb9c3c9(_0x4e91a1['error'](0x1f4,_0x50b5a3['message']));});}else _0x4eb733(0x1);});});};function activateAdditionalPhone(_0x5916f6,_0x1976f8,_0xc62652,_0xe610bd,_0x4485ff){return new Promise(function(_0x2e484e,_0x2f4b15){var _0x3e11a2;if(_[_0x597f('0x2e')](_0xc62652[_0x597f('0x2f')])){_0xc62652[_0x597f('0x2f')]=moment();}if(moment()>moment(_0xc62652['scheduledat'])){_0x3e11a2=moment()['add'](_0x4485ff||0x3,_0x597f('0x30'));}else{if(_0xc62652[_0x597f('0x1d')]==0x0){_0x3e11a2=moment(_0xc62652[_0x597f('0x2f')]);}else{_0x3e11a2=moment()[_0x597f('0x31')](_0x4485ff||0x3,_0x597f('0x30'));}}if(_[_0x597f('0x2e')](_0x3e11a2)){_0x3e11a2=moment()[_0x597f('0x31')](_0x4485ff||0x3,'minutes');}var _0x15cf35={'phone':_0x5916f6[_0x597f('0x32')],'active':0x0,'OrderBy':_[_0x597f('0x2e')](_0x5916f6[_0x597f('0x1d')])?0x0:_0x5916f6[_0x597f('0x1d')],'scheduledat':moment()[_0x597f('0x31')](_0xe610bd||0x1,'minutes'),'countbusyretry':_0x1976f8[_0x597f('0x1f')],'countcongestionretry':_0x1976f8[_0x597f('0x20')],'countnoanswerretry':_0x1976f8[_0x597f('0x26')],'countnosuchnumberretry':_0x1976f8[_0x597f('0x21')],'countdropretry':_0x1976f8['countdropretry'],'countabandonedretry':_0x1976f8[_0x597f('0x23')],'countmachineretry':_0x1976f8['countmachineretry'],'countagentrejectretry':_0x1976f8['countagentrejectretry'],'createdAt':_0x1976f8[_0x597f('0x33')],'updatedAt':_0x1976f8[_0x597f('0x34')]};var _0x34df0f={'CmHopperId':_0x5916f6['id'],'phone':_0xc62652[_0x597f('0x32')],'active':0x0,'OrderBy':_[_0x597f('0x2e')](_0xc62652['OrderBy'])?0x0:_0xc62652[_0x597f('0x1d')],'scheduledat':_0x3e11a2,'countbusyretry':_0xc62652[_0x597f('0x1f')],'countcongestionretry':_0xc62652[_0x597f('0x20')],'countnoanswerretry':_0xc62652[_0x597f('0x26')],'countnosuchnumberretry':_0xc62652[_0x597f('0x21')],'countdropretry':_0xc62652[_0x597f('0x22')],'countabandonedretry':_0xc62652['countabandonedretry'],'countmachineretry':_0xc62652[_0x597f('0x27')],'countagentrejectretry':_0xc62652[_0x597f('0x28')],'createdAt':_0xc62652[_0x597f('0x33')],'updatedAt':_0xc62652['updatedAt']};return db['sequelize'][_0x597f('0x35')](function(_0x8e52cf){return db['CmHopperAdditionalPhone'][_0x597f('0x36')](_0x15cf35,{'where':{'id':_0xc62652['id']}},{'transaction':_0x8e52cf})['then'](function(){return db[_0x597f('0x16')][_0x597f('0x36')](_0x34df0f,{'where':{'id':_0x5916f6['id']}},{'transaction':_0x8e52cf});});})[_0x597f('0xd')](function(_0x42a80a){_0x2e484e({'id':_0x5916f6['id'],'phone':_0xc62652['phone']});})[_0x597f('0x15')](function(_0x32137c){logger[_0x597f('0x11')]('activateAdditionalPhone',_0x32137c[_0x597f('0x13')]);_0x2f4b15({'error':_0x32137c['message']});});});}exports[_0x597f('0x37')]=function(_0x589bae){var _0x274e88=this;return new Promise(function(_0x5cc1de,_0xfd183e){return db[_0x597f('0x16')][_0x597f('0x36')](_0x589bae[_0x597f('0x19')][_0x597f('0x38')],{'where':{'id':_0x589bae[_0x597f('0x19')]['id']}})[_0x597f('0xd')](function(_0x240f90){_0x5cc1de(_0x240f90);})[_0x597f('0x15')](function(_0x526b39){logger[_0x597f('0x11')]('IncrementPreviewCounters',_0x526b39[_0x597f('0x13')]);_0xfd183e(_0x274e88[_0x597f('0x11')](0x1f4,_0x526b39['message']));});});}; \ No newline at end of file +var _0x47d5=['VerifyAdditionalPhones','CmHopper','ContactId','body','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','entity','countcongestionretry','countmachineretry','countagentrejectretry','SwapAdditionalPhones','waitTime','duration','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch'];(function(_0x4d920b,_0x30f1c4){var _0x1a6220=function(_0x37f487){while(--_0x37f487){_0x4d920b['push'](_0x4d920b['shift']());}};_0x1a6220(++_0x30f1c4);}(_0x47d5,0x1eb));var _0x547d=function(_0x532dd0,_0xff1a19){_0x532dd0=_0x532dd0-0x0;var _0x10fef2=_0x47d5[_0x532dd0];return _0x10fef2;};'use strict';var _=require('lodash');var util=require(_0x547d('0x0'));var moment=require(_0x547d('0x1'));var BPromise=require('bluebird');var rs=require(_0x547d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x547d('0x3'));var logger=require(_0x547d('0x4'))(_0x547d('0x5'));var config=require(_0x547d('0x6'));var jayson=require(_0x547d('0x7'));var client=jayson[_0x547d('0x8')][_0x547d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54e2f9,_0x39946e,_0x4f823c){return new BPromise(function(_0x2144f8,_0x288666){return client[_0x547d('0xa')](_0x54e2f9,_0x4f823c)[_0x547d('0xb')](function(_0x1dc790){logger[_0x547d('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x39946e,_0x547d('0xd'));logger['debug'](_0x547d('0xe'),_0x39946e,_0x547d('0xd'),JSON[_0x547d('0xf')](_0x1dc790));if(_0x1dc790[_0x547d('0x10')]){if(_0x1dc790[_0x547d('0x10')][_0x547d('0x11')]===0x1f4){logger[_0x547d('0x10')](_0x547d('0x12'),_0x39946e,_0x1dc790[_0x547d('0x10')][_0x547d('0x13')]);return _0x288666(_0x1dc790[_0x547d('0x10')][_0x547d('0x13')]);}logger['error'](_0x547d('0x12'),_0x39946e,_0x1dc790['error'][_0x547d('0x13')]);return _0x2144f8(_0x1dc790[_0x547d('0x10')][_0x547d('0x13')]);}else{logger['info'](_0x547d('0x12'),_0x39946e,_0x547d('0xd'));_0x2144f8(_0x1dc790[_0x547d('0x14')][_0x547d('0x13')]);}})[_0x547d('0x15')](function(_0x5b815b){logger[_0x547d('0x10')](_0x547d('0x12'),_0x39946e,_0x5b815b);_0x288666(_0x5b815b);});});}exports[_0x547d('0x16')]=function(_0x34ac2b){var _0x52d227=this;return new Promise(function(_0x11ffdc,_0x4b7afc){return db[_0x547d('0x17')]['findOne']({'raw':!![],'where':{'ContactId':_0x34ac2b['body'][_0x547d('0x18')],'ListId':_0x34ac2b[_0x547d('0x19')][_0x547d('0x1a')],'VoiceQueueId':_0x34ac2b[_0x547d('0x19')]['VoiceQueueId']===undefined?null:_0x34ac2b[_0x547d('0x19')][_0x547d('0x1b')],'CampaignId':_0x34ac2b['body'][_0x547d('0x1c')]===undefined?null:_0x34ac2b[_0x547d('0x19')][_0x547d('0x1c')]}})['then'](function(_0x10857b){if(_0x10857b!=null){return db[_0x547d('0x1d')][_0x547d('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x10857b['id'],'OrderBy':{'$gt':_0x10857b['OrderBy']}},'order':[[_0x547d('0x1f'),_0x547d('0x20')]]})[_0x547d('0xb')](function(_0x6894c7){var _0x17131e=0x0;if(_0x6894c7){if(_0x6894c7[_0x547d('0x21')]+_0x6894c7['countcongestionretry']+_0x6894c7[_0x547d('0x22')]+_0x6894c7[_0x547d('0x23')]+_0x6894c7[_0x547d('0x24')]+_0x6894c7[_0x547d('0x25')]+_0x6894c7['countmachineretry']+_0x6894c7['countagentrejectretry']<_0x34ac2b[_0x547d('0x26')]['dialGlobalMaxRetry'])_0x17131e=0x1;_0x11ffdc({'additional':_0x17131e});}else{return db['CmHopperAdditionalPhone'][_0x547d('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x10857b['id']},'order':[[_0x547d('0x1f'),_0x547d('0x20')]]})[_0x547d('0xb')](function(_0x46584c){var _0x22f411=0x0;if(_0x46584c){if(_0x46584c[_0x547d('0x21')]+_0x46584c[_0x547d('0x27')]+_0x46584c[_0x547d('0x22')]+_0x46584c[_0x547d('0x23')]+_0x46584c[_0x547d('0x24')]+_0x46584c[_0x547d('0x25')]+_0x46584c[_0x547d('0x28')]+_0x46584c[_0x547d('0x29')]<_0x34ac2b[_0x547d('0x26')]['dialGlobalMaxRetry'])_0x22f411=0x1;_0x11ffdc({'additional':_0x22f411});}else{_0x11ffdc({'additional':0x0});}})[_0x547d('0x15')](function(_0x32efce){logger['error'](_0x547d('0x16'),_0x32efce[_0x547d('0x13')]);_0x4b7afc(_0x52d227[_0x547d('0x10')](0x1f4,_0x32efce[_0x547d('0x13')]));});}})[_0x547d('0x15')](function(_0xb0bf0){logger['error'](_0x547d('0x16'),_0xb0bf0[_0x547d('0x13')]);_0x4b7afc(_0x52d227[_0x547d('0x10')](0x1f4,_0xb0bf0['message']));});}else _0x11ffdc({'additional':0x0});});});};exports[_0x547d('0x2a')]=function(_0x566e56){var _0x3c1ce7=this;return new Promise(function(_0x258f48,_0x579d27){return db[_0x547d('0x17')][_0x547d('0x1e')]({'raw':!![],'where':{'ContactId':_0x566e56[_0x547d('0x19')][_0x547d('0x18')],'ListId':_0x566e56['body'][_0x547d('0x1a')],'VoiceQueueId':_0x566e56['body'][_0x547d('0x1b')]===undefined?null:_0x566e56[_0x547d('0x19')][_0x547d('0x1b')],'CampaignId':_0x566e56[_0x547d('0x19')][_0x547d('0x1c')]===undefined?null:_0x566e56[_0x547d('0x19')][_0x547d('0x1c')]}})['then'](function(_0x502363){if(_0x502363!=null){return db['CmHopperAdditionalPhone'][_0x547d('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x502363['id'],'OrderBy':{'$gte':_0x502363[_0x547d('0x1f')]}},'order':[[_0x547d('0x1f'),_0x547d('0x20')]]})[_0x547d('0xb')](function(_0x398e48){if(_0x398e48)return activateAdditionalPhone(_0x502363,_0x566e56[_0x547d('0x19')],_0x398e48,_0x566e56['duration'],_0x566e56[_0x547d('0x2b')])[_0x547d('0xb')](function(_0x514da9){_0x258f48(_0x514da9);});else{return db[_0x547d('0x1d')][_0x547d('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x502363['id']},'order':[[_0x547d('0x1f'),_0x547d('0x20')]]})['then'](function(_0x5cd843){if(_0x5cd843)return activateAdditionalPhone(_0x502363,_0x566e56[_0x547d('0x19')],_0x5cd843,_0x566e56[_0x547d('0x2c')],_0x566e56['waitTime'])[_0x547d('0xb')](function(_0x162045){_0x258f48(_0x162045);});else{_0x258f48({'id':_0x502363['id'],'phone':''});}})[_0x547d('0x15')](function(_0x2a21f4){logger[_0x547d('0x10')](_0x547d('0x16'),_0x2a21f4[_0x547d('0x13')]);_0x579d27(_0x3c1ce7[_0x547d('0x10')](0x1f4,_0x2a21f4[_0x547d('0x13')]));});}})[_0x547d('0x15')](function(_0x15258a){logger[_0x547d('0x10')](_0x547d('0x16'),_0x15258a[_0x547d('0x13')]);_0x579d27(_0x3c1ce7[_0x547d('0x10')](0x1f4,_0x15258a[_0x547d('0x13')]));});}else _0x258f48(0x1);});});};function activateAdditionalPhone(_0xb13fbb,_0x2c2f8a,_0x2aba43,_0x1a2bdc,_0x4b3035){return new Promise(function(_0x1ecfd0,_0x11f78b){var _0x4eae85;if(_[_0x547d('0x2d')](_0x2aba43['scheduledat'])){_0x2aba43[_0x547d('0x2e')]=moment();}if(moment()>moment(_0x2aba43[_0x547d('0x2e')])){_0x4eae85=moment()[_0x547d('0x2f')](_0x4b3035||0x3,_0x547d('0x30'));}else{if(_0x2aba43[_0x547d('0x1f')]==0x0){_0x4eae85=moment(_0x2aba43[_0x547d('0x2e')]);}else{_0x4eae85=moment()[_0x547d('0x2f')](_0x4b3035||0x3,_0x547d('0x30'));}}if(_['isNil'](_0x4eae85)){_0x4eae85=moment()[_0x547d('0x2f')](_0x4b3035||0x3,'minutes');}var _0x270b95={'phone':_0xb13fbb[_0x547d('0x31')],'active':0x0,'OrderBy':_[_0x547d('0x2d')](_0xb13fbb[_0x547d('0x1f')])?0x0:_0xb13fbb[_0x547d('0x1f')],'scheduledat':moment()[_0x547d('0x2f')](_0x1a2bdc||0x1,_0x547d('0x30')),'countbusyretry':_0x2c2f8a['countbusyretry'],'countcongestionretry':_0x2c2f8a['countcongestionretry'],'countnoanswerretry':_0x2c2f8a['countnoanswerretry'],'countnosuchnumberretry':_0x2c2f8a['countnosuchnumberretry'],'countdropretry':_0x2c2f8a[_0x547d('0x24')],'countabandonedretry':_0x2c2f8a[_0x547d('0x25')],'countmachineretry':_0x2c2f8a[_0x547d('0x28')],'countagentrejectretry':_0x2c2f8a['countagentrejectretry'],'createdAt':_0x2c2f8a[_0x547d('0x32')],'updatedAt':_0x2c2f8a[_0x547d('0x33')]};var _0x1eac02={'CmHopperId':_0xb13fbb['id'],'phone':_0x2aba43[_0x547d('0x31')],'active':0x0,'OrderBy':_[_0x547d('0x2d')](_0x2aba43[_0x547d('0x1f')])?0x0:_0x2aba43[_0x547d('0x1f')],'scheduledat':_0x4eae85,'countbusyretry':_0x2aba43[_0x547d('0x21')],'countcongestionretry':_0x2aba43[_0x547d('0x27')],'countnoanswerretry':_0x2aba43[_0x547d('0x22')],'countnosuchnumberretry':_0x2aba43[_0x547d('0x23')],'countdropretry':_0x2aba43['countdropretry'],'countabandonedretry':_0x2aba43[_0x547d('0x25')],'countmachineretry':_0x2aba43['countmachineretry'],'countagentrejectretry':_0x2aba43[_0x547d('0x29')],'createdAt':_0x2aba43[_0x547d('0x32')],'updatedAt':_0x2aba43[_0x547d('0x33')]};return db[_0x547d('0x34')][_0x547d('0x35')](function(_0x2c6026){return db[_0x547d('0x1d')][_0x547d('0x36')](_0x270b95,{'where':{'id':_0x2aba43['id']}},{'transaction':_0x2c6026})[_0x547d('0xb')](function(){return db[_0x547d('0x17')][_0x547d('0x36')](_0x1eac02,{'where':{'id':_0xb13fbb['id']}},{'transaction':_0x2c6026});});})[_0x547d('0xb')](function(_0xa8d713){_0x1ecfd0({'id':_0xb13fbb['id'],'phone':_0x2aba43['phone']});})[_0x547d('0x15')](function(_0x4e3c5e){logger[_0x547d('0x10')](_0x547d('0x37'),_0x4e3c5e['message']);_0x11f78b({'error':_0x4e3c5e[_0x547d('0x13')]});});});}exports[_0x547d('0x38')]=function(_0x3b97da){var _0x2d8c50=this;return new Promise(function(_0x4accf9,_0x216068){return db[_0x547d('0x17')][_0x547d('0x36')](_0x3b97da[_0x547d('0x19')]['field'],{'where':{'id':_0x3b97da[_0x547d('0x19')]['id']}})[_0x547d('0xb')](function(_0x1fe98d){_0x4accf9(_0x1fe98d);})[_0x547d('0x15')](function(_0xaec957){logger[_0x547d('0x10')]('IncrementPreviewCounters',_0xaec957[_0x547d('0x13')]);_0x216068(_0x2d8c50[_0x547d('0x10')](0x1f4,_0xaec957[_0x547d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 9d0f6d7..eb87ea8 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 _0x6460=['../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x14baad,_0x1dba8d){var _0x3dc4ec=function(_0x7c63c7){while(--_0x7c63c7){_0x14baad['push'](_0x14baad['shift']());}};_0x3dc4ec(++_0x1dba8d);}(_0x6460,0x1f1));var _0x0646=function(_0x297528,_0x9d3b4b){_0x297528=_0x297528-0x0;var _0x27fc0d=_0x6460[_0x297528];return _0x27fc0d;};'use strict';var multer=require('multer');var util=require(_0x0646('0x0'));var path=require(_0x0646('0x1'));var timeout=require('connect-timeout');var express=require(_0x0646('0x2'));var router=express[_0x0646('0x3')]();var fs_extra=require(_0x0646('0x4'));var auth=require(_0x0646('0x5'));var interaction=require(_0x0646('0x6'));var config=require(_0x0646('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x0646('0x8')]('/',auth[_0x0646('0x9')](),controller['index']);router[_0x0646('0x8')](_0x0646('0xa'),auth[_0x0646('0x9')](),controller[_0x0646('0xb')]);router[_0x0646('0xc')]('/',auth[_0x0646('0x9')](),controller['create']);router[_0x0646('0xd')](_0x0646('0xa'),auth[_0x0646('0x9')](),controller[_0x0646('0xe')]);router[_0x0646('0xf')](_0x0646('0xa'),auth[_0x0646('0x9')](),controller[_0x0646('0x10')]);module[_0x0646('0x11')]=router; \ No newline at end of file +var _0x1c4d=['destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x24e265,_0x48d1e9){var _0x7fc2a2=function(_0x5d5248){while(--_0x5d5248){_0x24e265['push'](_0x24e265['shift']());}};_0x7fc2a2(++_0x48d1e9);}(_0x1c4d,0x19f));var _0xd1c4=function(_0x1eba12,_0x327d6c){_0x1eba12=_0x1eba12-0x0;var _0x302aa4=_0x1c4d[_0x1eba12];return _0x302aa4;};'use strict';var multer=require(_0xd1c4('0x0'));var util=require(_0xd1c4('0x1'));var path=require('path');var timeout=require(_0xd1c4('0x2'));var express=require('express');var router=express[_0xd1c4('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd1c4('0x4'));var interaction=require(_0xd1c4('0x5'));var config=require('../../config/environment');var controller=require(_0xd1c4('0x6'));router[_0xd1c4('0x7')]('/',auth['isAuthenticated'](),controller[_0xd1c4('0x8')]);router[_0xd1c4('0x7')](_0xd1c4('0x9'),auth[_0xd1c4('0xa')](),controller[_0xd1c4('0xb')]);router[_0xd1c4('0xc')]('/',auth['isAuthenticated'](),controller[_0xd1c4('0xd')]);router[_0xd1c4('0xe')](_0xd1c4('0x9'),auth[_0xd1c4('0xa')](),controller[_0xd1c4('0xf')]);router[_0xd1c4('0x10')]('/:id',auth[_0xd1c4('0xa')](),controller[_0xd1c4('0x11')]);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 84465b4..b61911a 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 _0x1b20=['contactListQueue','INTEGER','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1b20,0x66));var _0x01b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1b20[_0x20a584];return _0x4b41a8;};'use strict';var moment=require('moment');var Sequelize=require(_0x01b2('0x0'));module[_0x01b2('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x01b2('0x2')},'ListId':{'type':Sequelize[_0x01b2('0x3')],'unique':_0x01b2('0x2')},'VoiceQueueId':{'type':Sequelize[_0x01b2('0x3')],'unique':_0x01b2('0x2')}}; \ No newline at end of file +var _0x7c1a=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x2b0102,_0xe3da2e){var _0x22e6e1=function(_0x5c18fb){while(--_0x5c18fb){_0x2b0102['push'](_0x2b0102['shift']());}};_0x22e6e1(++_0xe3da2e);}(_0x7c1a,0x159));var _0xa7c1=function(_0x170436,_0x90563c){_0x170436=_0x170436-0x0;var _0x4794d8=_0x7c1a[_0x170436];return _0x4794d8;};'use strict';var moment=require(_0xa7c1('0x0'));var Sequelize=require(_0xa7c1('0x1'));module[_0xa7c1('0x2')]={'phone':{'type':Sequelize[_0xa7c1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa7c1('0x4')],'unique':_0xa7c1('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xa7c1('0x5')},'VoiceQueueId':{'type':Sequelize[_0xa7c1('0x4')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 5d17d2f..bd1d505 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 _0x29bb=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','reject','save','update','then','destroy','error','stack','name','send','CmHopperBlack','rawAttributes','fieldName','key','model','map','query','keys','filters'];(function(_0x4c3fb,_0x1e1896){var _0x1a5ca1=function(_0x5e1a0a){while(--_0x5e1a0a){_0x4c3fb['push'](_0x4c3fb['shift']());}};_0x1a5ca1(++_0x1e1896);}(_0x29bb,0x13d));var _0xb29b=function(_0x1ad34f,_0x5bdf04){_0x1ad34f=_0x1ad34f-0x0;var _0x2bd8a1=_0x29bb[_0x1ad34f];return _0x2bd8a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb29b('0x0'));var zipdir=require(_0xb29b('0x1'));var jsonpatch=require(_0xb29b('0x2'));var rp=require(_0xb29b('0x3'));var moment=require(_0xb29b('0x4'));var BPromise=require(_0xb29b('0x5'));var Mustache=require('mustache');var util=require(_0xb29b('0x6'));var path=require(_0xb29b('0x7'));var sox=require('sox');var csv=require(_0xb29b('0x8'));var ejs=require(_0xb29b('0x9'));var fs=require('fs');var fs_extra=require(_0xb29b('0xa'));var _=require(_0xb29b('0xb'));var squel=require('squel');var crypto=require(_0xb29b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb29b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb29b('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb29b('0xf'));var as=require(_0xb29b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb29b('0x11'))('api');var utils=require(_0xb29b('0x12'));var config=require(_0xb29b('0x13'));var licenseUtil=require(_0xb29b('0x14'));var db=require(_0xb29b('0x15'))['db'];function respondWithStatusCode(_0x1fdcf0,_0x4ada32){_0x4ada32=_0x4ada32||0xcc;return function(_0x29a9d3){if(_0x29a9d3){return _0x1fdcf0[_0xb29b('0x16')](_0x4ada32);}return _0x1fdcf0['status'](_0x4ada32)[_0xb29b('0x17')]();};}function respondWithResult(_0x4a084b,_0x3216d5){_0x3216d5=_0x3216d5||0xc8;return function(_0x5bb483){if(_0x5bb483){return _0x4a084b[_0xb29b('0x18')](_0x3216d5)[_0xb29b('0x19')](_0x5bb483);}};}function respondWithFilteredResult(_0xb67a63,_0x123858){return function(_0x5c2cbb){if(_0x5c2cbb){var _0x31c921=typeof _0x123858[_0xb29b('0x1a')]==='undefined'&&typeof _0x123858[_0xb29b('0x1b')]==='undefined';var _0x53f6a6=_0x5c2cbb[_0xb29b('0x1c')];var _0xd27442=_0x31c921?0x0:_0x123858[_0xb29b('0x1a')];var _0x2fefa5=_0x31c921?_0x5c2cbb[_0xb29b('0x1c')]:_0x123858[_0xb29b('0x1a')]+_0x123858[_0xb29b('0x1b')];var _0x287ae1;if(_0x2fefa5>=_0x53f6a6){_0x2fefa5=_0x53f6a6;_0x287ae1=0xc8;}else{_0x287ae1=0xce;}_0xb67a63[_0xb29b('0x18')](_0x287ae1);return _0xb67a63[_0xb29b('0x1d')]('Content-Range',_0xd27442+'-'+_0x2fefa5+'/'+_0x53f6a6)[_0xb29b('0x19')](_0x5c2cbb);}return null;};}function patchUpdates(_0x4a7e45){return function(_0x46902f){try{jsonpatch['apply'](_0x46902f,_0x4a7e45,!![]);}catch(_0x3a1b05){return BPromise[_0xb29b('0x1e')](_0x3a1b05);}return _0x46902f[_0xb29b('0x1f')]();};}function saveUpdates(_0xce5193,_0x425719){return function(_0x140921){if(_0x140921){return _0x140921[_0xb29b('0x20')](_0xce5193)[_0xb29b('0x21')](function(_0x3bd83d){return _0x3bd83d;});}return null;};}function removeEntity(_0xb083b9,_0x2b21b0){return function(_0x40b983){if(_0x40b983){return _0x40b983[_0xb29b('0x22')]()[_0xb29b('0x21')](function(){_0xb083b9[_0xb29b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15af89,_0x5c0a97){return function(_0x40b3f7){if(!_0x40b3f7){_0x15af89[_0xb29b('0x16')](0x194);}return _0x40b3f7;};}function handleError(_0x35e2f0,_0x2a817b){_0x2a817b=_0x2a817b||0x1f4;return function(_0x37151c){logger[_0xb29b('0x23')](_0x37151c[_0xb29b('0x24')]);if(_0x37151c['name']){delete _0x37151c[_0xb29b('0x25')];}_0x35e2f0['status'](_0x2a817b)[_0xb29b('0x26')](_0x37151c);};}exports['index']=function(_0x5017f1,_0x4b8244){var _0x479eb7={},_0x3418ee={},_0x7f4951={'count':0x0,'rows':[]};var _0x1797c1=_['map'](db[_0xb29b('0x27')][_0xb29b('0x28')],function(_0x4f0f07){return{'name':_0x4f0f07[_0xb29b('0x29')],'type':_0x4f0f07['type'][_0xb29b('0x2a')]};});_0x3418ee[_0xb29b('0x2b')]=_[_0xb29b('0x2c')](_0x1797c1,_0xb29b('0x25'));_0x3418ee[_0xb29b('0x2d')]=_[_0xb29b('0x2e')](_0x5017f1[_0xb29b('0x2d')]);_0x3418ee[_0xb29b('0x2f')]=_[_0xb29b('0x30')](_0x3418ee[_0xb29b('0x2b')],_0x3418ee[_0xb29b('0x2d')]);_0x479eb7[_0xb29b('0x31')]=_['intersection'](_0x3418ee[_0xb29b('0x2b')],qs[_0xb29b('0x32')](_0x5017f1['query'][_0xb29b('0x32')]));_0x479eb7[_0xb29b('0x31')]=_0x479eb7[_0xb29b('0x31')]['length']?_0x479eb7[_0xb29b('0x31')]:_0x3418ee[_0xb29b('0x2b')];if(!_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x33')](_0xb29b('0x34'))){_0x479eb7[_0xb29b('0x1b')]=qs[_0xb29b('0x1b')](_0x5017f1['query'][_0xb29b('0x1b')]);_0x479eb7[_0xb29b('0x1a')]=qs[_0xb29b('0x1a')](_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x1a')]);}_0x479eb7[_0xb29b('0x35')]=qs[_0xb29b('0x36')](_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x36')]);_0x479eb7[_0xb29b('0x37')]=qs[_0xb29b('0x2f')](_[_0xb29b('0x38')](_0x5017f1[_0xb29b('0x2d')],_0x3418ee[_0xb29b('0x2f')]),_0x1797c1);if(_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x39')]){_0x479eb7['where']=_[_0xb29b('0x3a')](_0x479eb7[_0xb29b('0x37')],{'$or':_[_0xb29b('0x2c')](_0x1797c1,function(_0x709396){if(_0x709396[_0xb29b('0x3b')]!==_0xb29b('0x3c')){var _0x4333ba={};_0x4333ba[_0x709396[_0xb29b('0x25')]]={'$like':'%'+_0x5017f1['query']['filter']+'%'};return _0x4333ba;}})});}_0x479eb7=_[_0xb29b('0x3a')]({},_0x479eb7,_0x5017f1['options']);var _0x2e6145={'where':_0x479eb7[_0xb29b('0x37')]};return db[_0xb29b('0x27')][_0xb29b('0x1c')](_0x2e6145)[_0xb29b('0x21')](function(_0x33c24f){_0x7f4951[_0xb29b('0x1c')]=_0x33c24f;if(_0x5017f1[_0xb29b('0x2d')][_0xb29b('0x3d')]){_0x479eb7[_0xb29b('0x3e')]=[{'all':!![]}];}return db[_0xb29b('0x27')][_0xb29b('0x3f')](_0x479eb7);})[_0xb29b('0x21')](function(_0xae6b11){_0x7f4951[_0xb29b('0x40')]=_0xae6b11;return _0x7f4951;})[_0xb29b('0x21')](respondWithFilteredResult(_0x4b8244,_0x479eb7))[_0xb29b('0x41')](handleError(_0x4b8244,null));};exports[_0xb29b('0x42')]=function(_0x5b12ed,_0x4fe3b4){var _0x41f767={'raw':!![],'where':{'id':_0x5b12ed[_0xb29b('0x43')]['id']}},_0x4df48b={};_0x4df48b[_0xb29b('0x2b')]=_[_0xb29b('0x2e')](db['CmHopperBlack'][_0xb29b('0x28')]);_0x4df48b['query']=_[_0xb29b('0x2e')](_0x5b12ed[_0xb29b('0x2d')]);_0x4df48b[_0xb29b('0x2f')]=_[_0xb29b('0x30')](_0x4df48b[_0xb29b('0x2b')],_0x4df48b[_0xb29b('0x2d')]);_0x41f767['attributes']=_[_0xb29b('0x30')](_0x4df48b[_0xb29b('0x2b')],qs[_0xb29b('0x32')](_0x5b12ed[_0xb29b('0x2d')][_0xb29b('0x32')]));_0x41f767[_0xb29b('0x31')]=_0x41f767['attributes'][_0xb29b('0x44')]?_0x41f767[_0xb29b('0x31')]:_0x4df48b[_0xb29b('0x2b')];if(_0x5b12ed[_0xb29b('0x2d')][_0xb29b('0x3d')]){_0x41f767[_0xb29b('0x3e')]=[{'all':!![]}];}_0x41f767=_[_0xb29b('0x3a')]({},_0x41f767,_0x5b12ed[_0xb29b('0x45')]);return db['CmHopperBlack'][_0xb29b('0x46')](_0x41f767)[_0xb29b('0x21')](handleEntityNotFound(_0x4fe3b4,null))[_0xb29b('0x21')](respondWithResult(_0x4fe3b4,null))['catch'](handleError(_0x4fe3b4,null));};exports['update']=function(_0x30f5f6,_0x34eddf){if(_0x30f5f6[_0xb29b('0x47')]['id']){delete _0x30f5f6[_0xb29b('0x47')]['id'];}return db['CmHopperBlack'][_0xb29b('0x46')]({'where':{'id':_0x30f5f6[_0xb29b('0x43')]['id']}})['then'](handleEntityNotFound(_0x34eddf,null))[_0xb29b('0x21')](saveUpdates(_0x30f5f6[_0xb29b('0x47')],null))[_0xb29b('0x21')](respondWithResult(_0x34eddf,null))['catch'](handleError(_0x34eddf,null));};exports[_0xb29b('0x22')]=function(_0x71913d,_0x2946bd){return db[_0xb29b('0x27')][_0xb29b('0x46')]({'where':{'id':_0x71913d[_0xb29b('0x43')]['id']}})['then'](handleEntityNotFound(_0x2946bd,null))['then'](removeEntity(_0x2946bd,null))['catch'](handleError(_0x2946bd,null));};exports[_0xb29b('0x48')]=function(_0x4cc064,_0x40547f){return db[_0xb29b('0x27')][_0xb29b('0x48')]()[_0xb29b('0x21')](respondWithResult(_0x40547f,null))[_0xb29b('0x41')](handleError(_0x40547f,null));}; \ No newline at end of file +var _0xaecc=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','map','rawAttributes','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','CmHopperBlack','keys','length','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x5b79fe,_0x3dad90){var _0x17d865=function(_0x5ef0dd){while(--_0x5ef0dd){_0x5b79fe['push'](_0x5b79fe['shift']());}};_0x17d865(++_0x3dad90);}(_0xaecc,0x172));var _0xcaec=function(_0x4c4b3a,_0xdffe34){_0x4c4b3a=_0x4c4b3a-0x0;var _0x18bd63=_0xaecc[_0x4c4b3a];return _0x18bd63;};'use strict';var emlformat=require(_0xcaec('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcaec('0x1'));var jsonpatch=require(_0xcaec('0x2'));var rp=require(_0xcaec('0x3'));var moment=require(_0xcaec('0x4'));var BPromise=require(_0xcaec('0x5'));var Mustache=require(_0xcaec('0x6'));var util=require(_0xcaec('0x7'));var path=require('path');var sox=require(_0xcaec('0x8'));var csv=require(_0xcaec('0x9'));var ejs=require(_0xcaec('0xa'));var fs=require('fs');var fs_extra=require(_0xcaec('0xb'));var _=require(_0xcaec('0xc'));var squel=require(_0xcaec('0xd'));var crypto=require(_0xcaec('0xe'));var jsforce=require(_0xcaec('0xf'));var deskjs=require(_0xcaec('0x10'));var toCsv=require('to-csv');var querystring=require(_0xcaec('0x11'));var Papa=require(_0xcaec('0x12'));var Redis=require(_0xcaec('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xcaec('0x14'));var as=require(_0xcaec('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcaec('0x16'))('api');var utils=require(_0xcaec('0x17'));var config=require(_0xcaec('0x18'));var licenseUtil=require(_0xcaec('0x19'));var db=require(_0xcaec('0x1a'))['db'];function respondWithStatusCode(_0xd68ff2,_0x4e72f7){_0x4e72f7=_0x4e72f7||0xcc;return function(_0x1c3715){if(_0x1c3715){return _0xd68ff2[_0xcaec('0x1b')](_0x4e72f7);}return _0xd68ff2[_0xcaec('0x1c')](_0x4e72f7)['end']();};}function respondWithResult(_0x2d8596,_0x452a01){_0x452a01=_0x452a01||0xc8;return function(_0x1a6777){if(_0x1a6777){return _0x2d8596['status'](_0x452a01)[_0xcaec('0x1d')](_0x1a6777);}};}function respondWithFilteredResult(_0x1272c9,_0xa30e97){return function(_0x5440ba){if(_0x5440ba){var _0x3b3e99=typeof _0xa30e97[_0xcaec('0x1e')]===_0xcaec('0x1f')&&typeof _0xa30e97[_0xcaec('0x20')]==='undefined';var _0x2899ed=_0x5440ba[_0xcaec('0x21')];var _0x19b83b=_0x3b3e99?0x0:_0xa30e97[_0xcaec('0x1e')];var _0x250f13=_0x3b3e99?_0x5440ba['count']:_0xa30e97[_0xcaec('0x1e')]+_0xa30e97[_0xcaec('0x20')];var _0x542655;if(_0x250f13>=_0x2899ed){_0x250f13=_0x2899ed;_0x542655=0xc8;}else{_0x542655=0xce;}_0x1272c9[_0xcaec('0x1c')](_0x542655);return _0x1272c9[_0xcaec('0x22')](_0xcaec('0x23'),_0x19b83b+'-'+_0x250f13+'/'+_0x2899ed)[_0xcaec('0x1d')](_0x5440ba);}return null;};}function patchUpdates(_0x2d72eb){return function(_0x40d2de){try{jsonpatch[_0xcaec('0x24')](_0x40d2de,_0x2d72eb,!![]);}catch(_0x30312e){return BPromise[_0xcaec('0x25')](_0x30312e);}return _0x40d2de[_0xcaec('0x26')]();};}function saveUpdates(_0x319196,_0x42683a){return function(_0x517cf2){if(_0x517cf2){return _0x517cf2[_0xcaec('0x27')](_0x319196)[_0xcaec('0x28')](function(_0x22b82b){return _0x22b82b;});}return null;};}function removeEntity(_0x429355,_0x381399){return function(_0x1b4f07){if(_0x1b4f07){return _0x1b4f07[_0xcaec('0x29')]()[_0xcaec('0x28')](function(){_0x429355[_0xcaec('0x1c')](0xcc)[_0xcaec('0x2a')]();});}};}function handleEntityNotFound(_0x8baeec,_0x23e22a){return function(_0x4f8371){if(!_0x4f8371){_0x8baeec['sendStatus'](0x194);}return _0x4f8371;};}function handleError(_0x3da95a,_0x38d500){_0x38d500=_0x38d500||0x1f4;return function(_0x24b7af){logger['error'](_0x24b7af[_0xcaec('0x2b')]);if(_0x24b7af[_0xcaec('0x2c')]){delete _0x24b7af['name'];}_0x3da95a[_0xcaec('0x1c')](_0x38d500)['send'](_0x24b7af);};}exports['index']=function(_0x4aa29d,_0x203099){var _0x3c3df8={},_0xf07371={},_0x3d4f41={'count':0x0,'rows':[]};var _0x10a584=_[_0xcaec('0x2d')](db['CmHopperBlack'][_0xcaec('0x2e')],function(_0x23a86f){return{'name':_0x23a86f['fieldName'],'type':_0x23a86f['type'][_0xcaec('0x2f')]};});_0xf07371[_0xcaec('0x30')]=_[_0xcaec('0x2d')](_0x10a584,_0xcaec('0x2c'));_0xf07371[_0xcaec('0x31')]=_['keys'](_0x4aa29d['query']);_0xf07371[_0xcaec('0x32')]=_[_0xcaec('0x33')](_0xf07371['model'],_0xf07371[_0xcaec('0x31')]);_0x3c3df8['attributes']=_[_0xcaec('0x33')](_0xf07371[_0xcaec('0x30')],qs[_0xcaec('0x34')](_0x4aa29d['query'][_0xcaec('0x34')]));_0x3c3df8[_0xcaec('0x35')]=_0x3c3df8['attributes']['length']?_0x3c3df8[_0xcaec('0x35')]:_0xf07371[_0xcaec('0x30')];if(!_0x4aa29d[_0xcaec('0x31')][_0xcaec('0x36')]('nolimit')){_0x3c3df8['limit']=qs[_0xcaec('0x20')](_0x4aa29d['query'][_0xcaec('0x20')]);_0x3c3df8[_0xcaec('0x1e')]=qs[_0xcaec('0x1e')](_0x4aa29d[_0xcaec('0x31')]['offset']);}_0x3c3df8[_0xcaec('0x37')]=qs[_0xcaec('0x38')](_0x4aa29d['query'][_0xcaec('0x38')]);_0x3c3df8[_0xcaec('0x39')]=qs[_0xcaec('0x32')](_['pick'](_0x4aa29d['query'],_0xf07371[_0xcaec('0x32')]),_0x10a584);if(_0x4aa29d[_0xcaec('0x31')]['filter']){_0x3c3df8[_0xcaec('0x39')]=_[_0xcaec('0x3a')](_0x3c3df8[_0xcaec('0x39')],{'$or':_['map'](_0x10a584,function(_0x119671){if(_0x119671[_0xcaec('0x3b')]!==_0xcaec('0x3c')){var _0x4679d9={};_0x4679d9[_0x119671[_0xcaec('0x2c')]]={'$like':'%'+_0x4aa29d[_0xcaec('0x31')][_0xcaec('0x3d')]+'%'};return _0x4679d9;}})});}_0x3c3df8=_[_0xcaec('0x3a')]({},_0x3c3df8,_0x4aa29d[_0xcaec('0x3e')]);var _0x3038c2={'where':_0x3c3df8[_0xcaec('0x39')]};return db['CmHopperBlack'][_0xcaec('0x21')](_0x3038c2)[_0xcaec('0x28')](function(_0x26d207){_0x3d4f41[_0xcaec('0x21')]=_0x26d207;if(_0x4aa29d[_0xcaec('0x31')][_0xcaec('0x3f')]){_0x3c3df8[_0xcaec('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xcaec('0x41')](_0x3c3df8);})[_0xcaec('0x28')](function(_0x2f7f7f){_0x3d4f41['rows']=_0x2f7f7f;return _0x3d4f41;})[_0xcaec('0x28')](respondWithFilteredResult(_0x203099,_0x3c3df8))[_0xcaec('0x42')](handleError(_0x203099,null));};exports[_0xcaec('0x43')]=function(_0xccde48,_0x38f52c){var _0x24997f={'raw':!![],'where':{'id':_0xccde48[_0xcaec('0x44')]['id']}},_0x43e849={};_0x43e849[_0xcaec('0x30')]=_['keys'](db[_0xcaec('0x45')][_0xcaec('0x2e')]);_0x43e849[_0xcaec('0x31')]=_[_0xcaec('0x46')](_0xccde48[_0xcaec('0x31')]);_0x43e849[_0xcaec('0x32')]=_[_0xcaec('0x33')](_0x43e849[_0xcaec('0x30')],_0x43e849['query']);_0x24997f[_0xcaec('0x35')]=_['intersection'](_0x43e849[_0xcaec('0x30')],qs[_0xcaec('0x34')](_0xccde48[_0xcaec('0x31')][_0xcaec('0x34')]));_0x24997f['attributes']=_0x24997f[_0xcaec('0x35')][_0xcaec('0x47')]?_0x24997f[_0xcaec('0x35')]:_0x43e849[_0xcaec('0x30')];if(_0xccde48[_0xcaec('0x31')]['includeAll']){_0x24997f[_0xcaec('0x40')]=[{'all':!![]}];}_0x24997f=_[_0xcaec('0x3a')]({},_0x24997f,_0xccde48['options']);return db[_0xcaec('0x45')][_0xcaec('0x48')](_0x24997f)[_0xcaec('0x28')](handleEntityNotFound(_0x38f52c,null))['then'](respondWithResult(_0x38f52c,null))[_0xcaec('0x42')](handleError(_0x38f52c,null));};exports[_0xcaec('0x27')]=function(_0x219ab7,_0x40bdee){if(_0x219ab7[_0xcaec('0x49')]['id']){delete _0x219ab7[_0xcaec('0x49')]['id'];}return db[_0xcaec('0x45')][_0xcaec('0x48')]({'where':{'id':_0x219ab7[_0xcaec('0x44')]['id']}})[_0xcaec('0x28')](handleEntityNotFound(_0x40bdee,null))['then'](saveUpdates(_0x219ab7[_0xcaec('0x49')],null))[_0xcaec('0x28')](respondWithResult(_0x40bdee,null))[_0xcaec('0x42')](handleError(_0x40bdee,null));};exports[_0xcaec('0x29')]=function(_0x9ef618,_0x4d4a64){return db['CmHopperBlack']['find']({'where':{'id':_0x9ef618[_0xcaec('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4a64,null))[_0xcaec('0x28')](removeEntity(_0x4d4a64,null))[_0xcaec('0x42')](handleError(_0x4d4a64,null));};exports[_0xcaec('0x4a')]=function(_0x152a61,_0x2ff825){return db[_0xcaec('0x45')]['describe']()[_0xcaec('0x28')](respondWithResult(_0x2ff825,null))[_0xcaec('0x42')](handleError(_0x2ff825,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index f2db4f4..945a4f4 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 _0x8b46=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','moment'];(function(_0xbb36a0,_0x1cb1e4){var _0x306db2=function(_0xc63ad3){while(--_0xc63ad3){_0xbb36a0['push'](_0xbb36a0['shift']());}};_0x306db2(++_0x1cb1e4);}(_0x8b46,0x69));var _0x68b4=function(_0x4a0719,_0x5bdc5a){_0x4a0719=_0x4a0719-0x0;var _0x1c0447=_0x8b46[_0x4a0719];return _0x1c0447;};'use strict';var _=require(_0x68b4('0x0'));var util=require(_0x68b4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x68b4('0x2'));var BPromise=require(_0x68b4('0x3'));var rp=require(_0x68b4('0x4'));var fs=require('fs');var path=require(_0x68b4('0x5'));var rimraf=require(_0x68b4('0x6'));var config=require(_0x68b4('0x7'));var attributes=require(_0x68b4('0x8'));module[_0x68b4('0x9')]=function(_0x46f321,_0x36cc03){return _0x46f321['define'](_0x68b4('0xa'),attributes,{'tableName':_0x68b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee0c=['request-promise','path','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment'];(function(_0x191c2b,_0x2f6455){var _0x38dbee=function(_0x14c982){while(--_0x14c982){_0x191c2b['push'](_0x191c2b['shift']());}};_0x38dbee(++_0x2f6455);}(_0xee0c,0x124));var _0xcee0=function(_0x16fd18,_0x4fd96e){_0x16fd18=_0x16fd18-0x0;var _0x8a50bf=_0xee0c[_0x16fd18];return _0x8a50bf;};'use strict';var _=require(_0xcee0('0x0'));var util=require(_0xcee0('0x1'));var logger=require(_0xcee0('0x2'))(_0xcee0('0x3'));var moment=require(_0xcee0('0x4'));var BPromise=require('bluebird');var rp=require(_0xcee0('0x5'));var fs=require('fs');var path=require(_0xcee0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0xcee0('0x7')]=function(_0x132853,_0x34cec8){return _0x132853[_0xcee0('0x8')](_0xcee0('0x9'),attributes,{'tableName':_0xcee0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 09634a4..12029e0 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 _0x9b36=['request','then','info','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','map','model','debug','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x7584cb,_0x2a13ff){var _0x40256c=function(_0x111065){while(--_0x111065){_0x7584cb['push'](_0x7584cb['shift']());}};_0x40256c(++_0x2a13ff);}(_0x9b36,0x108));var _0x69b3=function(_0x112e48,_0x478649){_0x112e48=_0x112e48-0x0;var _0x3c80c0=_0x9b36[_0x112e48];return _0x3c80c0;};'use strict';var _=require('lodash');var util=require(_0x69b3('0x0'));var moment=require(_0x69b3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69b3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x69b3('0x3'));var logger=require(_0x69b3('0x4'))(_0x69b3('0x5'));var config=require(_0x69b3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x69b3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15ce13,_0x4f6fd6,_0x2da3e9){return new BPromise(function(_0xc1980b,_0x30cfbd){return client[_0x69b3('0x8')](_0x15ce13,_0x2da3e9)[_0x69b3('0x9')](function(_0x289535){logger[_0x69b3('0xa')](_0x69b3('0xb'),_0x4f6fd6,'request\x20sent');logger['debug'](_0x69b3('0xc'),_0x4f6fd6,_0x69b3('0xd'),JSON[_0x69b3('0xe')](_0x289535));if(_0x289535['error']){if(_0x289535[_0x69b3('0xf')]['code']===0x1f4){logger[_0x69b3('0xf')](_0x69b3('0xb'),_0x4f6fd6,_0x289535[_0x69b3('0xf')][_0x69b3('0x10')]);return _0x30cfbd(_0x289535['error'][_0x69b3('0x10')]);}logger[_0x69b3('0xf')](_0x69b3('0xb'),_0x4f6fd6,_0x289535['error'][_0x69b3('0x10')]);return _0xc1980b(_0x289535['error']['message']);}else{logger[_0x69b3('0xa')](_0x69b3('0xb'),_0x4f6fd6,_0x69b3('0xd'));_0xc1980b(_0x289535[_0x69b3('0x11')][_0x69b3('0x10')]);}})[_0x69b3('0x12')](function(_0x1f0535){logger[_0x69b3('0xf')](_0x69b3('0xb'),_0x4f6fd6,_0x1f0535);_0x30cfbd(_0x1f0535);});});}exports[_0x69b3('0x13')]=function(_0x386ce0){var _0x231cba=this;return new Promise(function(_0x7c2796,_0xbc5135){return db[_0x69b3('0x14')][_0x69b3('0x15')]({'raw':_0x386ce0['options']?_0x386ce0[_0x69b3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x386ce0[_0x69b3('0x16')]?_0x386ce0[_0x69b3('0x16')][_0x69b3('0x17')]||null:null,'attributes':_0x386ce0[_0x69b3('0x16')]?_0x386ce0['options'][_0x69b3('0x18')]||null:null,'limit':_0x386ce0[_0x69b3('0x16')]?_0x386ce0['options'][_0x69b3('0x19')]||null:null,'include':_0x386ce0[_0x69b3('0x16')]?_0x386ce0[_0x69b3('0x16')][_0x69b3('0x1a')]?_[_0x69b3('0x1b')](_0x386ce0[_0x69b3('0x16')][_0x69b3('0x1a')],function(_0x5a3dd6){return{'model':db[_0x5a3dd6['model']],'as':_0x5a3dd6['as'],'attributes':_0x5a3dd6[_0x69b3('0x18')],'include':_0x5a3dd6[_0x69b3('0x1a')]?_['map'](_0x5a3dd6[_0x69b3('0x1a')],function(_0x83eda8){return{'model':db[_0x83eda8[_0x69b3('0x1c')]],'as':_0x83eda8['as'],'attributes':_0x83eda8[_0x69b3('0x18')],'include':_0x83eda8['include']?_['map'](_0x83eda8[_0x69b3('0x1a')],function(_0x55acba){return{'model':db[_0x55acba[_0x69b3('0x1c')]],'as':_0x55acba['as'],'attributes':_0x55acba[_0x69b3('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ed1ba){logger['info'](_0x69b3('0x13'),_0x386ce0);logger[_0x69b3('0x1d')](_0x69b3('0x13'),_0x386ce0,JSON[_0x69b3('0xe')](_0x4ed1ba));_0x7c2796(_0x4ed1ba);})['catch'](function(_0x228f39){logger[_0x69b3('0xf')](_0x69b3('0x13'),_0x228f39[_0x69b3('0x10')],_0x386ce0);_0xbc5135(_0x231cba[_0x69b3('0xf')](0x1f4,_0x228f39[_0x69b3('0x10')]));});});};exports[_0x69b3('0x1e')]=function(_0x1bbe21){var _0x4d2b93=this;return new Promise(function(_0xcd1360,_0xb9a3dc){return db[_0x69b3('0x14')][_0x69b3('0x1f')](_0x1bbe21[_0x69b3('0x20')],{'raw':_0x1bbe21[_0x69b3('0x16')]?_0x1bbe21[_0x69b3('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bbe21['options']?_0x1bbe21[_0x69b3('0x16')][_0x69b3('0x17')]||null:null,'attributes':_0x1bbe21[_0x69b3('0x16')]?_0x1bbe21[_0x69b3('0x16')][_0x69b3('0x18')]||null:null,'limit':_0x1bbe21[_0x69b3('0x16')]?_0x1bbe21[_0x69b3('0x16')]['limit']||null:null})['then'](function(_0x1d75ea){logger['info'](_0x69b3('0x1e'),_0x1bbe21);logger['debug'](_0x69b3('0x1e'),_0x1bbe21,JSON[_0x69b3('0xe')](_0x1d75ea));_0xcd1360(_0x1d75ea);})['catch'](function(_0x403605){logger[_0x69b3('0xf')]('UpdateCmHopperBlack',_0x403605[_0x69b3('0x10')],_0x1bbe21);_0xb9a3dc(_0x4d2b93['error'](0x1f4,_0x403605[_0x69b3('0x10')]));});});};exports['DestroyCmHopperBlack']=function(_0x4ca159){var _0x2356da=this;return new Promise(function(_0x28b8a3,_0xdadaf8){return db[_0x69b3('0x14')]['destroy']({'where':_0x4ca159['options']?_0x4ca159[_0x69b3('0x16')]['where']||null:null})['then'](function(_0xa2e1dc){logger[_0x69b3('0xa')](_0x69b3('0x21'),_0x4ca159);logger[_0x69b3('0x1d')](_0x69b3('0x21'),_0x4ca159,JSON[_0x69b3('0xe')](_0xa2e1dc));_0x28b8a3(_0xa2e1dc);})[_0x69b3('0x12')](function(_0x59acab){logger[_0x69b3('0xf')](_0x69b3('0x21'),_0x59acab[_0x69b3('0x10')],_0x4ca159);_0xdadaf8(_0x2356da[_0x69b3('0xf')](0x1f4,_0x59acab[_0x69b3('0x10')]));});});}; \ No newline at end of file +var _0xd209=['update','body','UpdateCmHopperBlack','catch','destroy','DestroyCmHopperBlack','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetCmHopperBlack','options','raw','where','attributes','limit','include','map','model','CmHopperBlack'];(function(_0x2d089f,_0x4148b7){var _0x16497c=function(_0x1f3241){while(--_0x1f3241){_0x2d089f['push'](_0x2d089f['shift']());}};_0x16497c(++_0x4148b7);}(_0xd209,0x7b));var _0x9d20=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xd209[_0x21aec3];return _0x288bbc;};'use strict';var _=require('lodash');var util=require(_0x9d20('0x0'));var moment=require(_0x9d20('0x1'));var BPromise=require(_0x9d20('0x2'));var rs=require(_0x9d20('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d20('0x4'))['db'];var utils=require(_0x9d20('0x5'));var logger=require(_0x9d20('0x6'))(_0x9d20('0x7'));var config=require(_0x9d20('0x8'));var jayson=require(_0x9d20('0x9'));var client=jayson[_0x9d20('0xa')][_0x9d20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33754c,_0x62e625,_0x32157a){return new BPromise(function(_0x5141e6,_0x4d6c4c){return client['request'](_0x33754c,_0x32157a)[_0x9d20('0xc')](function(_0x33f79d){logger[_0x9d20('0xd')](_0x9d20('0xe'),_0x62e625,'request\x20sent');logger[_0x9d20('0xf')](_0x9d20('0x10'),_0x62e625,'request\x20sent',JSON[_0x9d20('0x11')](_0x33f79d));if(_0x33f79d[_0x9d20('0x12')]){if(_0x33f79d[_0x9d20('0x12')][_0x9d20('0x13')]===0x1f4){logger[_0x9d20('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x62e625,_0x33f79d[_0x9d20('0x12')]['message']);return _0x4d6c4c(_0x33f79d[_0x9d20('0x12')]['message']);}logger[_0x9d20('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x62e625,_0x33f79d['error'][_0x9d20('0x14')]);return _0x5141e6(_0x33f79d[_0x9d20('0x12')][_0x9d20('0x14')]);}else{logger[_0x9d20('0xd')](_0x9d20('0xe'),_0x62e625,_0x9d20('0x15'));_0x5141e6(_0x33f79d[_0x9d20('0x16')][_0x9d20('0x14')]);}})['catch'](function(_0x580b4f){logger[_0x9d20('0x12')](_0x9d20('0xe'),_0x62e625,_0x580b4f);_0x4d6c4c(_0x580b4f);});});}exports[_0x9d20('0x17')]=function(_0x14596b){var _0x18988f=this;return new Promise(function(_0x4f1de4,_0x59c886){return db['CmHopperBlack']['findAll']({'raw':_0x14596b[_0x9d20('0x18')]?_0x14596b[_0x9d20('0x18')][_0x9d20('0x19')]===undefined?!![]:![]:!![],'where':_0x14596b[_0x9d20('0x18')]?_0x14596b[_0x9d20('0x18')][_0x9d20('0x1a')]||null:null,'attributes':_0x14596b[_0x9d20('0x18')]?_0x14596b[_0x9d20('0x18')][_0x9d20('0x1b')]||null:null,'limit':_0x14596b['options']?_0x14596b['options'][_0x9d20('0x1c')]||null:null,'include':_0x14596b[_0x9d20('0x18')]?_0x14596b[_0x9d20('0x18')][_0x9d20('0x1d')]?_[_0x9d20('0x1e')](_0x14596b[_0x9d20('0x18')][_0x9d20('0x1d')],function(_0x44919a){return{'model':db[_0x44919a['model']],'as':_0x44919a['as'],'attributes':_0x44919a[_0x9d20('0x1b')],'include':_0x44919a[_0x9d20('0x1d')]?_[_0x9d20('0x1e')](_0x44919a[_0x9d20('0x1d')],function(_0x48269b){return{'model':db[_0x48269b[_0x9d20('0x1f')]],'as':_0x48269b['as'],'attributes':_0x48269b[_0x9d20('0x1b')],'include':_0x48269b[_0x9d20('0x1d')]?_['map'](_0x48269b['include'],function(_0x11eadb){return{'model':db[_0x11eadb[_0x9d20('0x1f')]],'as':_0x11eadb['as'],'attributes':_0x11eadb['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d20('0xc')](function(_0x542704){logger[_0x9d20('0xd')]('GetCmHopperBlack',_0x14596b);logger[_0x9d20('0xf')]('GetCmHopperBlack',_0x14596b,JSON[_0x9d20('0x11')](_0x542704));_0x4f1de4(_0x542704);})['catch'](function(_0x8eaac8){logger['error']('GetCmHopperBlack',_0x8eaac8[_0x9d20('0x14')],_0x14596b);_0x59c886(_0x18988f[_0x9d20('0x12')](0x1f4,_0x8eaac8[_0x9d20('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x1b9cd6){var _0x5133b7=this;return new Promise(function(_0xb25140,_0x49a265){return db[_0x9d20('0x20')][_0x9d20('0x21')](_0x1b9cd6[_0x9d20('0x22')],{'raw':_0x1b9cd6[_0x9d20('0x18')]?_0x1b9cd6['options'][_0x9d20('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b9cd6[_0x9d20('0x18')]?_0x1b9cd6[_0x9d20('0x18')][_0x9d20('0x1a')]||null:null,'attributes':_0x1b9cd6[_0x9d20('0x18')]?_0x1b9cd6['options'][_0x9d20('0x1b')]||null:null,'limit':_0x1b9cd6[_0x9d20('0x18')]?_0x1b9cd6[_0x9d20('0x18')][_0x9d20('0x1c')]||null:null})[_0x9d20('0xc')](function(_0x440b57){logger[_0x9d20('0xd')](_0x9d20('0x23'),_0x1b9cd6);logger[_0x9d20('0xf')]('UpdateCmHopperBlack',_0x1b9cd6,JSON['stringify'](_0x440b57));_0xb25140(_0x440b57);})[_0x9d20('0x24')](function(_0x390354){logger[_0x9d20('0x12')](_0x9d20('0x23'),_0x390354[_0x9d20('0x14')],_0x1b9cd6);_0x49a265(_0x5133b7[_0x9d20('0x12')](0x1f4,_0x390354[_0x9d20('0x14')]));});});};exports['DestroyCmHopperBlack']=function(_0x2cb8c9){var _0x4a845c=this;return new Promise(function(_0x2d1a01,_0xa5cc11){return db[_0x9d20('0x20')][_0x9d20('0x25')]({'where':_0x2cb8c9[_0x9d20('0x18')]?_0x2cb8c9[_0x9d20('0x18')][_0x9d20('0x1a')]||null:null})[_0x9d20('0xc')](function(_0x19aafd){logger[_0x9d20('0xd')](_0x9d20('0x26'),_0x2cb8c9);logger[_0x9d20('0xf')]('DestroyCmHopperBlack',_0x2cb8c9,JSON[_0x9d20('0x11')](_0x19aafd));_0x2d1a01(_0x19aafd);})[_0x9d20('0x24')](function(_0x228b9e){logger[_0x9d20('0x12')]('DestroyCmHopperBlack',_0x228b9e[_0x9d20('0x14')],_0x2cb8c9);_0xa5cc11(_0x4a845c[_0x9d20('0x12')](0x1f4,_0x228b9e[_0x9d20('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 79460e3..1dd230f 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 _0x9a5a=['put','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x214943,_0x3c9fd9){var _0x35b759=function(_0x4be178){while(--_0x4be178){_0x214943['push'](_0x214943['shift']());}};_0x35b759(++_0x3c9fd9);}(_0x9a5a,0x194));var _0xa9a5=function(_0xe6ed26,_0x309afb){_0xe6ed26=_0xe6ed26-0x0;var _0x20e59a=_0x9a5a[_0xe6ed26];return _0x20e59a;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0x10')](_0xa9a5('0x11'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x12')]);router[_0xa9a5('0x13')](_0xa9a5('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9fd4=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id'];(function(_0x1460e4,_0x297ba4){var _0x4ef818=function(_0x44775b){while(--_0x44775b){_0x1460e4['push'](_0x1460e4['shift']());}};_0x4ef818(++_0x297ba4);}(_0x9fd4,0x16c));var _0x49fd=function(_0x5a35c2,_0x25015b){_0x5a35c2=_0x5a35c2-0x0;var _0x53902d=_0x9fd4[_0x5a35c2];return _0x53902d;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var fs_extra=require(_0x49fd('0x6'));var auth=require(_0x49fd('0x7'));var interaction=require(_0x49fd('0x8'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/describe',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['show']);router[_0x49fd('0xe')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x10')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['destroy']);module[_0x49fd('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index bd2ba79..2a47d89 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 _0x264b=['DATE','getDataValue','setDataValue','followuptime','seconds','BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x2f8bc6,_0x4dc869){var _0x2d008a=function(_0x276072){while(--_0x276072){_0x2f8bc6['push'](_0x2f8bc6['shift']());}};_0x2d008a(++_0x4dc869);}(_0x264b,0x7e));var _0xb264=function(_0xa8f4e9,_0x3d27d2){_0xa8f4e9=_0xa8f4e9-0x0;var _0x15a8fc=_0x264b[_0xa8f4e9];return _0x15a8fc;};'use strict';var Sequelize=require(_0xb264('0x0'));var moment=require('moment');module[_0xb264('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xb264('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb264('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xb264('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb264('0x2')]},'calleridname':{'type':Sequelize[_0xb264('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb264('0x4')]},'droptime':{'type':Sequelize[_0xb264('0x4')]},'endtime':{'type':Sequelize[_0xb264('0x4')]},'ringtime':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb264('0x2')]},'campaign':{'type':Sequelize[_0xb264('0x2')]},'campaigntype':{'type':Sequelize[_0xb264('0x2')]},'membername':{'type':Sequelize[_0xb264('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xb264('0x2')]},'secondDisposition':{'type':Sequelize[_0xb264('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb264('0x2')]},'dispositionat':{'type':Sequelize[_0xb264('0x4')],'set':function(_0xed8f5){var _0x387158=this[_0xb264('0x5')]('endtime');if(_0x387158&&_0xed8f5){this[_0xb264('0x6')](_0xb264('0x7'),moment(_0xed8f5)['diff'](moment(_0x387158),_0xb264('0x8')));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb264('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xb264('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb264('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb264('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb264('0x4')]},'recallme':{'type':Sequelize[_0xb264('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb264('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb264('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc52d=['STRING','DATE','setDataValue','diff','seconds','BOOLEAN','moment','INTEGER'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0xc52d,0xe6));var _0xdc52=function(_0x5c53b1,_0x2f8af8){_0x5c53b1=_0x5c53b1-0x0;var _0x43fa61=_0xc52d[_0x5c53b1];return _0x43fa61;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdc52('0x0'));module['exports']={'state':{'type':Sequelize[_0xdc52('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xdc52('0x2')]},'scheduledat':{'type':Sequelize[_0xdc52('0x3')]},'countbusyretry':{'type':Sequelize[_0xdc52('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdc52('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xdc52('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xdc52('0x2')]},'originatecalleridname':{'type':Sequelize[_0xdc52('0x2')]},'calleridnum':{'type':Sequelize[_0xdc52('0x2')]},'calleridname':{'type':Sequelize[_0xdc52('0x2')]},'starttime':{'type':Sequelize[_0xdc52('0x3')]},'responsetime':{'type':Sequelize[_0xdc52('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xdc52('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xdc52('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xdc52('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xdc52('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xdc52('0x2')]},'campaign':{'type':Sequelize[_0xdc52('0x2')]},'campaigntype':{'type':Sequelize[_0xdc52('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xdc52('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdc52('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xdc52('0x3')],'set':function(_0x190ca0){var _0x546ea6=this['getDataValue']('endtime');if(_0x546ea6&&_0x190ca0){this[_0xdc52('0x4')]('followuptime',moment(_0x190ca0)[_0xdc52('0x5')](moment(_0x546ea6),_0xdc52('0x6')));}}},'amd':{'type':Sequelize[_0xdc52('0x7')],'defaultValue':![]},'fax':{'type':Sequelize[_0xdc52('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xdc52('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xdc52('0x7')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xdc52('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdc52('0x3')]},'deleted':{'type':Sequelize[_0xdc52('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xdc52('0x3')]},'recallme':{'type':Sequelize[_0xdc52('0x7')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xdc52('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0xdc52('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdc52('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdc52('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdc52('0x1')],'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 2fdf179..819c889 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 _0x4975=['ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','CmHopperFinal','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','noAnswerContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','ANY_VALUE(calleridnum)','phone','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','select'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4975,0x86));var _0x5497=function(_0x1b8ee9,_0xf49a87){_0x1b8ee9=_0x1b8ee9-0x0;var _0x370d33=_0x4975[_0x1b8ee9];return _0x370d33;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['CmHopperFinal']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['CmHopperFinal'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['describe']()[_0x5497('0x24')](respondWithResult(_0x466287,null))[_0x5497('0x40')](handleError(_0x466287,null));};exports[_0x5497('0x23')]=function(_0x52a189,_0x3e4da2){if(_0x52a189['body'][_0x5497('0x46')]){delete _0x52a189[_0x5497('0x47')][_0x5497('0x46')];}return db['CmHopperFinal'][_0x5497('0x44')]({'where':{'uniqueid':_0x52a189[_0x5497('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e4da2,null))[_0x5497('0x24')](saveUpdates(_0x52a189['body'],null))[_0x5497('0x24')](respondWithResult(_0x3e4da2,null))['catch'](handleError(_0x3e4da2,null));};exports[_0x5497('0x48')]=function(_0x400860,_0x26fd9f,_0xf07541){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x400860[_0x5497('0x42')]['id']},'attributes':[[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db['sequelize']['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize'][_0x5497('0x4d')]('`state`\x20=\x208,\x201,\x20null'))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x50')))),_0x5497('0x51')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x52')))),_0x5497('0x53')],[db['sequelize']['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal'](_0x5497('0x56')))),_0x5497('0x57')]]})[_0x5497('0x24')](handleEntityNotFound(_0x26fd9f,null))[_0x5497('0x24')](respondWithResult(_0x26fd9f,null))[_0x5497('0x40')](handleError(_0x26fd9f,null));};exports[_0x5497('0x58')]=function(_0x573f93,_0x18b30c,_0x3b0350){return db[_0x5497('0x3b')][_0x5497('0x3f')]({'raw':![],'where':{'CampaignId':_0x573f93['params']['id']},'attributes':[[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x4a')))),_0x5497('0x4b')],[db[_0x5497('0x49')]['fn']('COUNT',db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x5497('0x4e')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x59')))),_0x5497('0x5a')],[db['sequelize']['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')]['literal'](_0x5497('0x5b')))),_0x5497('0x4f')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5497('0x51')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5497('0x53')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db['sequelize']['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x54')))),_0x5497('0x55')],[db[_0x5497('0x49')]['fn'](_0x5497('0x4c'),db[_0x5497('0x49')]['fn']('IF',db[_0x5497('0x49')][_0x5497('0x4d')](_0x5497('0x56')))),_0x5497('0x57')]]})['then'](handleEntityNotFound(_0x18b30c,null))[_0x5497('0x24')](respondWithResult(_0x18b30c,null))[_0x5497('0x40')](handleError(_0x18b30c,null));};exports[_0x5497('0x5c')]=function(_0x4ef195,_0x5794ff,_0x589008){return db[_0x5497('0x5d')][_0x5497('0x44')]({'where':{'id':_0x4ef195['params']['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x5794ff,null))[_0x5497('0x24')](function(_0x21c715){var _0x286af8;if(_0x21c715){_0x286af8=squel['insert']()[_0x5497('0x5e')](_0x5497('0x5f'))[_0x5497('0x60')](['phone',_0x5497('0x61'),_0x5497('0x62'),'ListId',_0x5497('0x63'),_0x5497('0x64'),_0x5497('0x65')],squel['select']()['field'](_0x5497('0x66'),_0x5497('0x67'))[_0x5497('0x68')](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x6d'),_0x5497('0x63'))[_0x5497('0x68')]('NOW()',_0x5497('0x64'))[_0x5497('0x68')]('NOW()',_0x5497('0x65'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4ef195[_0x5497('0x47')][_0x5497('0x73')]['toString']())[_0x5497('0x37')](_0x5497('0x74'))[_0x5497('0x37')](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x67'))['from'](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195[_0x5497('0x42')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x5497('0x76'))[_0x5497('0x6e')](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x70'),_0x4ef195['params']['id']['toString']())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x286af8);}return[];})[_0x5497('0x24')](respondWithResult(_0x5794ff,null))[_0x5497('0x40')](handleError(_0x5794ff,null));};exports[_0x5497('0x79')]=function(_0x4c41c4,_0x1515f1,_0x4118ec){return db[_0x5497('0x7a')][_0x5497('0x44')]({'where':{'id':_0x4c41c4[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x1515f1,null))['then'](function(_0x1ef7fc){var _0x5903b7;if(_0x1ef7fc){_0x5903b7=squel[_0x5497('0x7b')]()[_0x5497('0x5e')](_0x5497('0x5f'))['fromQuery'](['phone',_0x5497('0x61'),_0x5497('0x62'),_0x5497('0x6c'),_0x5497('0x7c'),_0x5497('0x64'),_0x5497('0x65')],squel[_0x5497('0x7d')]()[_0x5497('0x68')]('ANY_VALUE(calleridnum)','phone')['field'](_0x5497('0x69'),_0x5497('0x61'))[_0x5497('0x68')](_0x5497('0x6a'),'ContactId')['field'](_0x5497('0x6b'),_0x5497('0x6c'))['field'](_0x5497('0x7e'),_0x5497('0x7c'))[_0x5497('0x68')](_0x5497('0x69'),'createdAt')['field']('NOW()','updatedAt')['from'](_0x5497('0x6f'))['where'](_0x5497('0x7f'),_0x4c41c4['params']['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x72'),_0x4c41c4[_0x5497('0x47')][_0x5497('0x73')][_0x5497('0x71')]())['where'](_0x5497('0x74'))['where'](_0x5497('0x75'),squel[_0x5497('0x7d')]()[_0x5497('0x68')](_0x5497('0x67'))[_0x5497('0x6e')](_0x5497('0x5f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]()))['where'](_0x5497('0x75'),squel['select']()[_0x5497('0x68')](_0x5497('0x76'))['from'](_0x5497('0x6f'))[_0x5497('0x37')](_0x5497('0x7f'),_0x4c41c4[_0x5497('0x42')]['id'][_0x5497('0x71')]())[_0x5497('0x37')](_0x5497('0x77')))[_0x5497('0x78')](_0x5497('0x62')))[_0x5497('0x71')]();return db[_0x5497('0x49')][_0x5497('0x2c')](_0x5903b7);}return[];})[_0x5497('0x24')](respondWithResult(_0x1515f1,null))[_0x5497('0x40')](handleError(_0x1515f1,null));};exports['checkContactHopper']=function(_0x37c17e,_0x163b5b,_0x3a31be){return db[_0x5497('0x80')][_0x5497('0x81')]({'where':{'VoiceQueueId':_0x37c17e['body'][_0x5497('0x63')],'CampaignId':_0x37c17e[_0x5497('0x47')]['CampaignId'],'ContactId':_0x37c17e['body'][_0x5497('0x62')]}})[_0x5497('0x24')](handleEntityNotFound(_0x163b5b,null))[_0x5497('0x24')](function(_0x14f693){if(_0x14f693){return _0x14f693;}return null;})[_0x5497('0x24')](respondWithResult(_0x163b5b,null))['catch'](handleError(_0x163b5b,null));}; \ No newline at end of file +var _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x5c6d2,_0x1d4644){var _0x426a7f=function(_0x39497d){while(--_0x39497d){_0x5c6d2['push'](_0x5c6d2['shift']());}};_0x426a7f(++_0x1d4644);}(_0x0295,0x1f0));var _0x5029=function(_0x34022f,_0x21134c){_0x34022f=_0x34022f-0x0;var _0x1bebdf=_0x0295[_0x34022f];return _0x1bebdf;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 2d81737..379f3b3 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 _0x7a6b=['request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x2bf799,_0x3d81dc){var _0x220479=function(_0x3ca801){while(--_0x3ca801){_0x2bf799['push'](_0x2bf799['shift']());}};_0x220479(++_0x3d81dc);}(_0x7a6b,0x10b));var _0xb7a6=function(_0x363593,_0x3b4415){_0x363593=_0x363593-0x0;var _0x439351=_0x7a6b[_0x363593];return _0x439351;};'use strict';var _=require(_0xb7a6('0x0'));var util=require(_0xb7a6('0x1'));var logger=require('../../config/logger')(_0xb7a6('0x2'));var moment=require(_0xb7a6('0x3'));var BPromise=require(_0xb7a6('0x4'));var rp=require(_0xb7a6('0x5'));var fs=require('fs');var path=require(_0xb7a6('0x6'));var rimraf=require(_0xb7a6('0x7'));var config=require(_0xb7a6('0x8'));var attributes=require(_0xb7a6('0x9'));module[_0xb7a6('0xa')]=function(_0x426d51,_0x2288cb){return _0x426d51[_0xb7a6('0xb')](_0xb7a6('0xc'),attributes,{'tableName':_0xb7a6('0xd'),'paranoid':![],'indexes':[{'name':_0xb7a6('0xe'),'fields':[_0xb7a6('0xe')]},{'name':_0xb7a6('0xf'),'fields':[_0xb7a6('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x346b=['lodash','util','../../config/logger','api','path','exports','define','cm_hopper_final','calleridnum','uniqueid'];(function(_0x38382f,_0x51183d){var _0x152e8b=function(_0x45dc28){while(--_0x45dc28){_0x38382f['push'](_0x38382f['shift']());}};_0x152e8b(++_0x51183d);}(_0x346b,0xdc));var _0xb346=function(_0x4c14aa,_0x5bf58d){_0x4c14aa=_0x4c14aa-0x0;var _0x14a7ab=_0x346b[_0x4c14aa];return _0x14a7ab;};'use strict';var _=require(_0xb346('0x0'));var util=require(_0xb346('0x1'));var logger=require(_0xb346('0x2'))(_0xb346('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb346('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xb346('0x5')]=function(_0x496c25,_0x70bf02){return _0x496c25[_0xb346('0x6')]('CmHopperFinal',attributes,{'tableName':_0xb346('0x7'),'paranoid':![],'indexes':[{'name':_0xb346('0x8'),'fields':[_0xb346('0x8')]},{'name':_0xb346('0x9'),'fields':[_0xb346('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 56bc194..2ada84d 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x5b99cc,_0x859705){var _0x16023c=function(_0x633bb3){while(--_0x633bb3){_0x5b99cc['push'](_0x5b99cc['shift']());}};_0x16023c(++_0x859705);}(_0xb10b,0x12a));var _0xbb10=function(_0x323c59,_0x2fa7f5){_0x323c59=_0x323c59-0x0;var _0x4b2831=_0xb10b[_0x323c59];return _0x4b2831;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0xbf1161,_0x48f658){var _0x5464c8=function(_0x416411){while(--_0x416411){_0xbf1161['push'](_0xbf1161['shift']());}};_0x5464c8(++_0x48f658);}(_0xb10b,0x12a));var _0xbb10=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0xb10b[_0x47adb8];return _0x4689a8;};'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 8037589..aad3dfa 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 _0x7985=['/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index'];(function(_0x3f724c,_0x387c3b){var _0x31b1e4=function(_0xe51cb3){while(--_0xe51cb3){_0x3f724c['push'](_0x3f724c['shift']());}};_0x31b1e4(++_0x387c3b);}(_0x7985,0x128));var _0x5798=function(_0xc721f5,_0x42404b){_0xc721f5=_0xc721f5-0x0;var _0x1bc1bd=_0x7985[_0xc721f5];return _0x1bc1bd;};'use strict';var multer=require(_0x5798('0x0'));var util=require(_0x5798('0x1'));var path=require(_0x5798('0x2'));var timeout=require(_0x5798('0x3'));var express=require(_0x5798('0x4'));var router=express['Router']();var fs_extra=require(_0x5798('0x5'));var auth=require(_0x5798('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5798('0x7'));var controller=require(_0x5798('0x8'));router[_0x5798('0x9')]('/',auth[_0x5798('0xa')](),controller[_0x5798('0xb')]);router[_0x5798('0x9')](_0x5798('0xc'),auth[_0x5798('0xa')](),controller[_0x5798('0xd')]);router['get'](_0x5798('0xe'),auth[_0x5798('0xa')](),controller[_0x5798('0xf')]);router[_0x5798('0x9')](_0x5798('0x10'),auth[_0x5798('0xa')](),controller[_0x5798('0x11')]);router[_0x5798('0x9')](_0x5798('0x12'),auth['isAuthenticated'](),controller[_0x5798('0x13')]);router[_0x5798('0x14')](_0x5798('0x15'),auth[_0x5798('0xa')](),controller[_0x5798('0x16')]);router[_0x5798('0x14')](_0x5798('0x17'),auth[_0x5798('0xa')](),controller[_0x5798('0x18')]);router[_0x5798('0x14')](_0x5798('0x19'),auth[_0x5798('0xa')](),controller[_0x5798('0x1a')]);router['put'](_0x5798('0xe'),auth[_0x5798('0xa')](),controller['update']);module[_0x5798('0x1b')]=router; \ No newline at end of file +var _0xe1c7=['../../config/environment','get','isAuthenticated','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1c7,0x71));var _0x7e1c=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0xe1c7[_0x496333];return _0x44256e;};'use strict';var multer=require(_0x7e1c('0x0'));var util=require('util');var path=require(_0x7e1c('0x1'));var timeout=require(_0x7e1c('0x2'));var express=require('express');var router=express[_0x7e1c('0x3')]();var fs_extra=require(_0x7e1c('0x4'));var auth=require(_0x7e1c('0x5'));var interaction=require(_0x7e1c('0x6'));var config=require(_0x7e1c('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x7e1c('0x8')]('/',auth[_0x7e1c('0x9')](),controller['index']);router[_0x7e1c('0x8')](_0x7e1c('0xa'),auth[_0x7e1c('0x9')](),controller['describe']);router[_0x7e1c('0x8')](_0x7e1c('0xb'),auth[_0x7e1c('0x9')](),controller[_0x7e1c('0xc')]);router['get'](_0x7e1c('0xd'),auth[_0x7e1c('0x9')](),controller[_0x7e1c('0xe')]);router['get']('/campaign/countAttributes/:id',auth[_0x7e1c('0x9')](),controller[_0x7e1c('0xf')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x7e1c('0x9')](),controller[_0x7e1c('0x10')]);router['post'](_0x7e1c('0x11'),auth[_0x7e1c('0x9')](),controller[_0x7e1c('0x12')]);router[_0x7e1c('0x13')](_0x7e1c('0x14'),auth[_0x7e1c('0x9')](),controller[_0x7e1c('0x15')]);router['put']('/:id',auth[_0x7e1c('0x9')](),controller[_0x7e1c('0x16')]);module[_0x7e1c('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index c843554..4cd4af7 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 _0x9e78=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x9e78,0xb8));var _0x89e7=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9e78[_0x1694f5];return _0x5b4321;};'use strict';var Sequelize=require(_0x89e7('0x0'));module[_0x89e7('0x1')]={'state':{'type':Sequelize[_0x89e7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x89e7('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x89e7('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x89e7('0x3')]},'originatecalleridname':{'type':Sequelize[_0x89e7('0x3')]},'calleridnum':{'type':Sequelize[_0x89e7('0x3')]},'calleridname':{'type':Sequelize[_0x89e7('0x3')]},'starttime':{'type':Sequelize[_0x89e7('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x89e7('0x4')]},'droptime':{'type':Sequelize[_0x89e7('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x89e7('0x3')]},'campaign':{'type':Sequelize[_0x89e7('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x89e7('0x3')]},'reason':{'type':Sequelize[_0x89e7('0x3')]},'amd':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x89e7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x89e7('0x4')]},'recallme':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x89e7('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x89e7('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x89e7('0x3')]}}; \ No newline at end of file +var _0x7e5b=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0xe4f667,_0x187e21){var _0x24bfa4=function(_0x430541){while(--_0x430541){_0xe4f667['push'](_0xe4f667['shift']());}};_0x24bfa4(++_0x187e21);}(_0x7e5b,0x9f));var _0xb7e5=function(_0x5183aa,_0xd72818){_0x5183aa=_0x5183aa-0x0;var _0x2d4421=_0x7e5b[_0x5183aa];return _0x2d4421;};'use strict';var Sequelize=require(_0xb7e5('0x0'));module[_0xb7e5('0x1')]={'state':{'type':Sequelize[_0xb7e5('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb7e5('0x3')]},'scheduledat':{'type':Sequelize[_0xb7e5('0x4')]},'countbusyretry':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb7e5('0x3')]},'calleridnum':{'type':Sequelize[_0xb7e5('0x3')]},'calleridname':{'type':Sequelize[_0xb7e5('0x3')]},'starttime':{'type':Sequelize[_0xb7e5('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb7e5('0x4')]},'droptime':{'type':Sequelize[_0xb7e5('0x4')]},'endtime':{'type':Sequelize[_0xb7e5('0x4')]},'ringtime':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xb7e5('0x3')]},'reason':{'type':Sequelize[_0xb7e5('0x3')]},'amd':{'type':Sequelize[_0xb7e5('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xb7e5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb7e5('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xb7e5('0x4')]},'edited':{'type':Sequelize[_0xb7e5('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb7e5('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb7e5('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index cff6e4f..e52f149 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 _0x33f0=['squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','status','name','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','keys','include','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5f5a2d,_0x1d9fca){var _0x4c3b2c=function(_0x369ba){while(--_0x369ba){_0x5f5a2d['push'](_0x5f5a2d['shift']());}};_0x4c3b2c(++_0x1d9fca);}(_0x33f0,0x78));var _0x033f=function(_0x9befbe,_0x51b723){_0x9befbe=_0x9befbe-0x0;var _0x5138ca=_0x33f0[_0x9befbe];return _0x5138ca;};'use strict';var emlformat=require(_0x033f('0x0'));var rimraf=require(_0x033f('0x1'));var zipdir=require(_0x033f('0x2'));var jsonpatch=require(_0x033f('0x3'));var rp=require(_0x033f('0x4'));var moment=require(_0x033f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x033f('0x6'));var util=require(_0x033f('0x7'));var path=require(_0x033f('0x8'));var sox=require(_0x033f('0x9'));var csv=require(_0x033f('0xa'));var ejs=require(_0x033f('0xb'));var fs=require('fs');var fs_extra=require(_0x033f('0xc'));var _=require(_0x033f('0xd'));var squel=require(_0x033f('0xe'));var crypto=require('crypto');var jsforce=require(_0x033f('0xf'));var deskjs=require(_0x033f('0x10'));var toCsv=require(_0x033f('0xa'));var querystring=require(_0x033f('0x11'));var Papa=require(_0x033f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x033f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x033f('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x033f('0x15'));var licenseUtil=require(_0x033f('0x16'));var db=require(_0x033f('0x17'))['db'];function respondWithStatusCode(_0x3a6b58,_0x3343f8){_0x3343f8=_0x3343f8||0xcc;return function(_0x1344c5){if(_0x1344c5){return _0x3a6b58['sendStatus'](_0x3343f8);}return _0x3a6b58['status'](_0x3343f8)[_0x033f('0x18')]();};}function respondWithResult(_0x42a385,_0x26bcb2){_0x26bcb2=_0x26bcb2||0xc8;return function(_0x5873c9){if(_0x5873c9){return _0x42a385['status'](_0x26bcb2)['json'](_0x5873c9);}};}function respondWithFilteredResult(_0x522bac,_0x586c3d){return function(_0xfb8b13){if(_0xfb8b13){var _0x582c5e=typeof _0x586c3d[_0x033f('0x19')]===_0x033f('0x1a')&&typeof _0x586c3d[_0x033f('0x1b')]===_0x033f('0x1a');var _0x1c2309=_0xfb8b13[_0x033f('0x1c')];var _0x264564=_0x582c5e?0x0:_0x586c3d[_0x033f('0x19')];var _0x182cb9=_0x582c5e?_0xfb8b13[_0x033f('0x1c')]:_0x586c3d[_0x033f('0x19')]+_0x586c3d[_0x033f('0x1b')];var _0x515053;if(_0x182cb9>=_0x1c2309){_0x182cb9=_0x1c2309;_0x515053=0xc8;}else{_0x515053=0xce;}_0x522bac['status'](_0x515053);return _0x522bac[_0x033f('0x1d')](_0x033f('0x1e'),_0x264564+'-'+_0x182cb9+'/'+_0x1c2309)[_0x033f('0x1f')](_0xfb8b13);}return null;};}function patchUpdates(_0x40923){return function(_0x2abe3a){try{jsonpatch['apply'](_0x2abe3a,_0x40923,!![]);}catch(_0x2a730f){return BPromise[_0x033f('0x20')](_0x2a730f);}return _0x2abe3a[_0x033f('0x21')]();};}function saveUpdates(_0x181ac3,_0x3efa30){return function(_0x5f1ddd){if(_0x5f1ddd){return _0x5f1ddd[_0x033f('0x22')](_0x181ac3)[_0x033f('0x23')](function(_0x59e75f){return _0x59e75f;});}return null;};}function removeEntity(_0x23fa45,_0x573ae8){return function(_0x4ee129){if(_0x4ee129){return _0x4ee129['destroy']()[_0x033f('0x23')](function(){_0x23fa45[_0x033f('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1606b7,_0x3c63d0){return function(_0x14d486){if(!_0x14d486){_0x1606b7['sendStatus'](0x194);}return _0x14d486;};}function handleError(_0x290baf,_0x5dcb0e){_0x5dcb0e=_0x5dcb0e||0x1f4;return function(_0x566bde){logger['error'](_0x566bde['stack']);if(_0x566bde[_0x033f('0x25')]){delete _0x566bde[_0x033f('0x25')];}_0x290baf['status'](_0x5dcb0e)['send'](_0x566bde);};}exports['index']=function(_0x4e766e,_0x4dd45f){var _0x21e8fc={},_0x158600={},_0x412cf2={'count':0x0,'rows':[]};var _0x361933=_[_0x033f('0x26')](db[_0x033f('0x27')][_0x033f('0x28')],function(_0x37721d){return{'name':_0x37721d[_0x033f('0x29')],'type':_0x37721d[_0x033f('0x2a')]['key']};});_0x158600[_0x033f('0x2b')]=_[_0x033f('0x26')](_0x361933,_0x033f('0x25'));_0x158600[_0x033f('0x2c')]=_['keys'](_0x4e766e[_0x033f('0x2c')]);_0x158600[_0x033f('0x2d')]=_['intersection'](_0x158600[_0x033f('0x2b')],_0x158600['query']);_0x21e8fc[_0x033f('0x2e')]=_[_0x033f('0x2f')](_0x158600['model'],qs[_0x033f('0x30')](_0x4e766e['query']['fields']));_0x21e8fc[_0x033f('0x2e')]=_0x21e8fc[_0x033f('0x2e')]['length']?_0x21e8fc[_0x033f('0x2e')]:_0x158600[_0x033f('0x2b')];if(!_0x4e766e[_0x033f('0x2c')][_0x033f('0x31')]('nolimit')){_0x21e8fc[_0x033f('0x1b')]=qs[_0x033f('0x1b')](_0x4e766e[_0x033f('0x2c')][_0x033f('0x1b')]);_0x21e8fc[_0x033f('0x19')]=qs[_0x033f('0x19')](_0x4e766e['query']['offset']);}_0x21e8fc[_0x033f('0x32')]=qs[_0x033f('0x33')](_0x4e766e[_0x033f('0x2c')][_0x033f('0x33')]);_0x21e8fc[_0x033f('0x34')]=qs[_0x033f('0x2d')](_['pick'](_0x4e766e['query'],_0x158600[_0x033f('0x2d')]),_0x361933);if(_0x4e766e[_0x033f('0x2c')][_0x033f('0x35')]){_0x21e8fc[_0x033f('0x34')]=_[_0x033f('0x36')](_0x21e8fc[_0x033f('0x34')],{'$or':_['map'](_0x361933,function(_0x22f968){if(_0x22f968['type']!==_0x033f('0x37')){var _0x6c3400={};_0x6c3400[_0x22f968['name']]={'$like':'%'+_0x4e766e[_0x033f('0x2c')][_0x033f('0x35')]+'%'};return _0x6c3400;}})});}_0x21e8fc=_[_0x033f('0x36')]({},_0x21e8fc,_0x4e766e[_0x033f('0x38')]);var _0x647290={'where':_0x21e8fc[_0x033f('0x34')]};return db[_0x033f('0x27')][_0x033f('0x1c')](_0x647290)[_0x033f('0x23')](function(_0x3868ef){_0x412cf2[_0x033f('0x1c')]=_0x3868ef;if(_0x4e766e[_0x033f('0x2c')][_0x033f('0x39')]){_0x21e8fc['include']=[{'all':!![]}];}return db[_0x033f('0x27')][_0x033f('0x3a')](_0x21e8fc);})[_0x033f('0x23')](function(_0x12c5fc){_0x412cf2['rows']=_0x12c5fc;return _0x412cf2;})[_0x033f('0x23')](respondWithFilteredResult(_0x4dd45f,_0x21e8fc))['catch'](handleError(_0x4dd45f,null));};exports['show']=function(_0x17ca9d,_0x41fd96){var _0x29ca83={'raw':!![],'where':{'id':_0x17ca9d['params']['id']}},_0x3bd1b3={};_0x3bd1b3[_0x033f('0x2b')]=_[_0x033f('0x3b')](db['CmHopperHistory'][_0x033f('0x28')]);_0x3bd1b3[_0x033f('0x2c')]=_['keys'](_0x17ca9d[_0x033f('0x2c')]);_0x3bd1b3['filters']=_[_0x033f('0x2f')](_0x3bd1b3[_0x033f('0x2b')],_0x3bd1b3[_0x033f('0x2c')]);_0x29ca83[_0x033f('0x2e')]=_['intersection'](_0x3bd1b3[_0x033f('0x2b')],qs[_0x033f('0x30')](_0x17ca9d[_0x033f('0x2c')][_0x033f('0x30')]));_0x29ca83['attributes']=_0x29ca83[_0x033f('0x2e')]['length']?_0x29ca83[_0x033f('0x2e')]:_0x3bd1b3[_0x033f('0x2b')];if(_0x17ca9d[_0x033f('0x2c')][_0x033f('0x39')]){_0x29ca83[_0x033f('0x3c')]=[{'all':!![]}];}_0x29ca83=_[_0x033f('0x36')]({},_0x29ca83,_0x17ca9d['options']);return db[_0x033f('0x27')][_0x033f('0x3d')](_0x29ca83)[_0x033f('0x23')](handleEntityNotFound(_0x41fd96,null))[_0x033f('0x23')](respondWithResult(_0x41fd96,null))[_0x033f('0x3e')](handleError(_0x41fd96,null));};exports[_0x033f('0x3f')]=function(_0x1dc91d,_0x4f0218){return db[_0x033f('0x27')][_0x033f('0x3f')](_0x1dc91d[_0x033f('0x40')],{})[_0x033f('0x23')](respondWithResult(_0x4f0218,0xc9))['catch'](handleError(_0x4f0218,null));};exports[_0x033f('0x41')]=function(_0x50740c,_0x288190){return db[_0x033f('0x27')][_0x033f('0x41')]()[_0x033f('0x23')](respondWithResult(_0x288190,null))[_0x033f('0x3e')](handleError(_0x288190,null));};exports[_0x033f('0x22')]=function(_0x2c5946,_0x95981c){if(_0x2c5946[_0x033f('0x40')][_0x033f('0x42')]){delete _0x2c5946[_0x033f('0x40')][_0x033f('0x42')];}return db[_0x033f('0x27')][_0x033f('0x3d')]({'where':{'uniqueid':_0x2c5946['params']['id']}})[_0x033f('0x23')](handleEntityNotFound(_0x95981c,null))['then'](saveUpdates(_0x2c5946[_0x033f('0x40')],null))['then'](respondWithResult(_0x95981c,null))['catch'](handleError(_0x95981c,null));}; \ No newline at end of file +var _0x848a=['to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','destroy','then','sendStatus','stack','index','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','map','VIRTUAL','merge','options','CmHopperHistory','includeAll','include','findAll','catch','find','create','body','describe','uniqueid','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x848a,0x89));var _0xa848=function(_0x36d703,_0x55b354){_0x36d703=_0x36d703-0x0;var _0x12c909=_0x848a[_0x36d703];return _0x12c909;};'use strict';var emlformat=require(_0xa848('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa848('0x1'));var jsonpatch=require(_0xa848('0x2'));var rp=require(_0xa848('0x3'));var moment=require(_0xa848('0x4'));var BPromise=require(_0xa848('0x5'));var Mustache=require(_0xa848('0x6'));var util=require(_0xa848('0x7'));var path=require(_0xa848('0x8'));var sox=require('sox');var csv=require(_0xa848('0x9'));var ejs=require(_0xa848('0xa'));var fs=require('fs');var fs_extra=require(_0xa848('0xb'));var _=require('lodash');var squel=require(_0xa848('0xc'));var crypto=require('crypto');var jsforce=require(_0xa848('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa848('0xe'));var Redis=require(_0xa848('0xf'));var authService=require(_0xa848('0x10'));var qs=require(_0xa848('0x11'));var as=require(_0xa848('0x12'));var hardwareService=require(_0xa848('0x13'));var logger=require('../../config/logger')(_0xa848('0x14'));var utils=require(_0xa848('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa848('0x16'));var db=require(_0xa848('0x17'))['db'];function respondWithStatusCode(_0x19f03b,_0x485a67){_0x485a67=_0x485a67||0xcc;return function(_0x4c7010){if(_0x4c7010){return _0x19f03b['sendStatus'](_0x485a67);}return _0x19f03b[_0xa848('0x18')](_0x485a67)[_0xa848('0x19')]();};}function respondWithResult(_0x41889b,_0x3a6c8d){_0x3a6c8d=_0x3a6c8d||0xc8;return function(_0xfd7a42){if(_0xfd7a42){return _0x41889b['status'](_0x3a6c8d)[_0xa848('0x1a')](_0xfd7a42);}};}function respondWithFilteredResult(_0x4c2d1e,_0x370cae){return function(_0x2fd01c){if(_0x2fd01c){var _0x1980af=typeof _0x370cae['offset']===_0xa848('0x1b')&&typeof _0x370cae[_0xa848('0x1c')]==='undefined';var _0x431021=_0x2fd01c[_0xa848('0x1d')];var _0x17ddb1=_0x1980af?0x0:_0x370cae[_0xa848('0x1e')];var _0x3b9de6=_0x1980af?_0x2fd01c[_0xa848('0x1d')]:_0x370cae[_0xa848('0x1e')]+_0x370cae[_0xa848('0x1c')];var _0x2eaeee;if(_0x3b9de6>=_0x431021){_0x3b9de6=_0x431021;_0x2eaeee=0xc8;}else{_0x2eaeee=0xce;}_0x4c2d1e['status'](_0x2eaeee);return _0x4c2d1e['set']('Content-Range',_0x17ddb1+'-'+_0x3b9de6+'/'+_0x431021)[_0xa848('0x1a')](_0x2fd01c);}return null;};}function patchUpdates(_0x3c04ea){return function(_0x28ba1c){try{jsonpatch[_0xa848('0x1f')](_0x28ba1c,_0x3c04ea,!![]);}catch(_0x14ff57){return BPromise[_0xa848('0x20')](_0x14ff57);}return _0x28ba1c[_0xa848('0x21')]();};}function saveUpdates(_0x327cd2,_0x55adf7){return function(_0x5a093d){if(_0x5a093d){return _0x5a093d[_0xa848('0x22')](_0x327cd2)['then'](function(_0x697651){return _0x697651;});}return null;};}function removeEntity(_0x21014a,_0x7c97ec){return function(_0x1f8aa7){if(_0x1f8aa7){return _0x1f8aa7[_0xa848('0x23')]()[_0xa848('0x24')](function(){_0x21014a[_0xa848('0x18')](0xcc)[_0xa848('0x19')]();});}};}function handleEntityNotFound(_0x13adc8,_0x48af99){return function(_0x212f30){if(!_0x212f30){_0x13adc8[_0xa848('0x25')](0x194);}return _0x212f30;};}function handleError(_0x502c84,_0x3c2094){_0x3c2094=_0x3c2094||0x1f4;return function(_0x2d4547){logger['error'](_0x2d4547[_0xa848('0x26')]);if(_0x2d4547['name']){delete _0x2d4547['name'];}_0x502c84[_0xa848('0x18')](_0x3c2094)['send'](_0x2d4547);};}exports[_0xa848('0x27')]=function(_0x4b0c04,_0xcbf437){var _0x3d0403={},_0x32631d={},_0x2fca18={'count':0x0,'rows':[]};var _0x28cfc5=_['map'](db['CmHopperHistory']['rawAttributes'],function(_0x1ce42d){return{'name':_0x1ce42d[_0xa848('0x28')],'type':_0x1ce42d[_0xa848('0x29')][_0xa848('0x2a')]};});_0x32631d[_0xa848('0x2b')]=_['map'](_0x28cfc5,_0xa848('0x2c'));_0x32631d[_0xa848('0x2d')]=_[_0xa848('0x2e')](_0x4b0c04[_0xa848('0x2d')]);_0x32631d['filters']=_[_0xa848('0x2f')](_0x32631d[_0xa848('0x2b')],_0x32631d[_0xa848('0x2d')]);_0x3d0403['attributes']=_['intersection'](_0x32631d[_0xa848('0x2b')],qs[_0xa848('0x30')](_0x4b0c04[_0xa848('0x2d')][_0xa848('0x30')]));_0x3d0403[_0xa848('0x31')]=_0x3d0403[_0xa848('0x31')][_0xa848('0x32')]?_0x3d0403['attributes']:_0x32631d[_0xa848('0x2b')];if(!_0x4b0c04['query'][_0xa848('0x33')](_0xa848('0x34'))){_0x3d0403[_0xa848('0x1c')]=qs[_0xa848('0x1c')](_0x4b0c04[_0xa848('0x2d')][_0xa848('0x1c')]);_0x3d0403[_0xa848('0x1e')]=qs[_0xa848('0x1e')](_0x4b0c04[_0xa848('0x2d')][_0xa848('0x1e')]);}_0x3d0403['order']=qs[_0xa848('0x35')](_0x4b0c04[_0xa848('0x2d')][_0xa848('0x35')]);_0x3d0403[_0xa848('0x36')]=qs[_0xa848('0x37')](_[_0xa848('0x38')](_0x4b0c04[_0xa848('0x2d')],_0x32631d[_0xa848('0x37')]),_0x28cfc5);if(_0x4b0c04[_0xa848('0x2d')][_0xa848('0x39')]){_0x3d0403['where']=_['merge'](_0x3d0403[_0xa848('0x36')],{'$or':_[_0xa848('0x3a')](_0x28cfc5,function(_0x41faba){if(_0x41faba[_0xa848('0x29')]!==_0xa848('0x3b')){var _0x689492={};_0x689492[_0x41faba[_0xa848('0x2c')]]={'$like':'%'+_0x4b0c04[_0xa848('0x2d')]['filter']+'%'};return _0x689492;}})});}_0x3d0403=_[_0xa848('0x3c')]({},_0x3d0403,_0x4b0c04[_0xa848('0x3d')]);var _0x34f1c8={'where':_0x3d0403['where']};return db[_0xa848('0x3e')][_0xa848('0x1d')](_0x34f1c8)[_0xa848('0x24')](function(_0x2b4af0){_0x2fca18[_0xa848('0x1d')]=_0x2b4af0;if(_0x4b0c04[_0xa848('0x2d')][_0xa848('0x3f')]){_0x3d0403[_0xa848('0x40')]=[{'all':!![]}];}return db[_0xa848('0x3e')][_0xa848('0x41')](_0x3d0403);})[_0xa848('0x24')](function(_0x5e4246){_0x2fca18['rows']=_0x5e4246;return _0x2fca18;})[_0xa848('0x24')](respondWithFilteredResult(_0xcbf437,_0x3d0403))[_0xa848('0x42')](handleError(_0xcbf437,null));};exports['show']=function(_0xf582,_0x4983d){var _0x443095={'raw':!![],'where':{'id':_0xf582['params']['id']}},_0x437c6={};_0x437c6[_0xa848('0x2b')]=_[_0xa848('0x2e')](db[_0xa848('0x3e')]['rawAttributes']);_0x437c6['query']=_[_0xa848('0x2e')](_0xf582[_0xa848('0x2d')]);_0x437c6['filters']=_[_0xa848('0x2f')](_0x437c6[_0xa848('0x2b')],_0x437c6[_0xa848('0x2d')]);_0x443095[_0xa848('0x31')]=_[_0xa848('0x2f')](_0x437c6['model'],qs['fields'](_0xf582[_0xa848('0x2d')][_0xa848('0x30')]));_0x443095[_0xa848('0x31')]=_0x443095[_0xa848('0x31')][_0xa848('0x32')]?_0x443095[_0xa848('0x31')]:_0x437c6[_0xa848('0x2b')];if(_0xf582['query'][_0xa848('0x3f')]){_0x443095[_0xa848('0x40')]=[{'all':!![]}];}_0x443095=_[_0xa848('0x3c')]({},_0x443095,_0xf582[_0xa848('0x3d')]);return db[_0xa848('0x3e')][_0xa848('0x43')](_0x443095)[_0xa848('0x24')](handleEntityNotFound(_0x4983d,null))[_0xa848('0x24')](respondWithResult(_0x4983d,null))[_0xa848('0x42')](handleError(_0x4983d,null));};exports[_0xa848('0x44')]=function(_0x4e87c4,_0x23d037){return db[_0xa848('0x3e')][_0xa848('0x44')](_0x4e87c4[_0xa848('0x45')],{})[_0xa848('0x24')](respondWithResult(_0x23d037,0xc9))[_0xa848('0x42')](handleError(_0x23d037,null));};exports[_0xa848('0x46')]=function(_0x32c6c8,_0xba582f){return db[_0xa848('0x3e')][_0xa848('0x46')]()[_0xa848('0x24')](respondWithResult(_0xba582f,null))['catch'](handleError(_0xba582f,null));};exports[_0xa848('0x22')]=function(_0x433632,_0x19401b){if(_0x433632[_0xa848('0x45')][_0xa848('0x47')]){delete _0x433632[_0xa848('0x45')][_0xa848('0x47')];}return db[_0xa848('0x3e')][_0xa848('0x43')]({'where':{'uniqueid':_0x433632[_0xa848('0x48')]['id']}})['then'](handleEntityNotFound(_0x19401b,null))[_0xa848('0x24')](saveUpdates(_0x433632[_0xa848('0x45')],null))[_0xa848('0x24')](respondWithResult(_0x19401b,null))[_0xa848('0x42')](handleError(_0x19401b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 28c2e00..7c6540d 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 _0x9962=['endtime','uniqueid','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9962,0xb8));var _0x2996=function(_0x27a378,_0x1cd0ad){_0x27a378=_0x27a378-0x0;var _0x89114a=_0x9962[_0x27a378];return _0x89114a;};'use strict';var _=require(_0x2996('0x0'));var util=require('util');var logger=require(_0x2996('0x1'))(_0x2996('0x2'));var moment=require(_0x2996('0x3'));var BPromise=require('bluebird');var rp=require(_0x2996('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2996('0x5'));var config=require(_0x2996('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x2996('0x7')]=function(_0x196d1e,_0x5609bc){return _0x196d1e[_0x2996('0x8')](_0x2996('0x9'),attributes,{'tableName':_0x2996('0xa'),'paranoid':![],'indexes':[{'name':_0x2996('0xb'),'fields':[_0x2996('0xb')]},{'name':'uniqueid','fields':[_0x2996('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0eeb=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eeb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb0ee('0x0'));var util=require(_0xb0ee('0x1'));var logger=require(_0xb0ee('0x2'))(_0xb0ee('0x3'));var moment=require(_0xb0ee('0x4'));var BPromise=require(_0xb0ee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0ee('0x6'));var config=require(_0xb0ee('0x7'));var attributes=require(_0xb0ee('0x8'));module[_0xb0ee('0x9')]=function(_0x209dda,_0x453fa4){return _0x209dda[_0xb0ee('0xa')]('CmHopperHistory',attributes,{'tableName':_0xb0ee('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xb0ee('0xc')]},{'name':_0xb0ee('0xd'),'fields':[_0xb0ee('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 e34d3b3..e4edcce 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 _0xe6eb=['outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','name','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','options','raw','catch','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`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','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay'];(function(_0x785659,_0xdbbb04){var _0x411b88=function(_0x532e0a){while(--_0x532e0a){_0x785659['push'](_0x785659['shift']());}};_0x411b88(++_0xdbbb04);}(_0xe6eb,0xd7));var _0xbe6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6eb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbe6e('0x0'));var util=require(_0xbe6e('0x1'));var moment=require(_0xbe6e('0x2'));var BPromise=require(_0xbe6e('0x3'));var rs=require(_0xbe6e('0x4'));var fs=require('fs');var Redis=require(_0xbe6e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe6e('0x6'));var logger=require(_0xbe6e('0x7'))(_0xbe6e('0x8'));var config=require('../../config/environment');var jayson=require(_0xbe6e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b281e,_0x39f88f,_0x8459d6){return new BPromise(function(_0x50cad9,_0x4e49bd){return client['request'](_0x5b281e,_0x8459d6)[_0xbe6e('0xa')](function(_0x1a4bb6){logger[_0xbe6e('0xb')](_0xbe6e('0xc'),_0x39f88f,_0xbe6e('0xd'));logger[_0xbe6e('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x39f88f,_0xbe6e('0xd'),JSON[_0xbe6e('0xf')](_0x1a4bb6));if(_0x1a4bb6[_0xbe6e('0x10')]){if(_0x1a4bb6[_0xbe6e('0x10')][_0xbe6e('0x11')]===0x1f4){logger[_0xbe6e('0x10')]('CmHopperHistory,\x20%s,\x20%s',_0x39f88f,_0x1a4bb6[_0xbe6e('0x10')][_0xbe6e('0x12')]);return _0x4e49bd(_0x1a4bb6['error'][_0xbe6e('0x12')]);}logger[_0xbe6e('0x10')](_0xbe6e('0xc'),_0x39f88f,_0x1a4bb6[_0xbe6e('0x10')][_0xbe6e('0x12')]);return _0x50cad9(_0x1a4bb6['error'][_0xbe6e('0x12')]);}else{logger[_0xbe6e('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x39f88f,_0xbe6e('0xd'));_0x50cad9(_0x1a4bb6[_0xbe6e('0x13')][_0xbe6e('0x12')]);}})['catch'](function(_0x49ee2a){logger['error'](_0xbe6e('0xc'),_0x39f88f,_0x49ee2a);_0x4e49bd(_0x49ee2a);});});}exports[_0xbe6e('0x14')]=function(_0x4835ec){var _0x2665fc=this;return new Promise(function(_0x130438,_0x1251e2){return db[_0xbe6e('0x15')]['create'](_0x4835ec['body'],{'raw':_0x4835ec[_0xbe6e('0x16')]?_0x4835ec[_0xbe6e('0x16')][_0xbe6e('0x17')]===undefined?!![]:![]:!![]})[_0xbe6e('0xa')](function(_0x278e29){logger[_0xbe6e('0xb')](_0xbe6e('0x14'),_0x4835ec);logger['debug']('CreateCmHopperHistory',_0x4835ec,JSON[_0xbe6e('0xf')](_0x278e29));_0x130438(_0x278e29);})[_0xbe6e('0x18')](function(_0x2059c4){logger[_0xbe6e('0x10')]('CreateCmHopperHistory',_0x2059c4[_0xbe6e('0x12')],_0x4835ec);_0x1251e2(_0x2665fc[_0xbe6e('0x10')](0x1f4,_0x2059c4['message']));});});};exports[_0xbe6e('0x19')]=function(_0x5c73be){var _0x42965f=this;return new Promise(function(_0x290ada,_0x18f1c5){return db[_0xbe6e('0x15')][_0xbe6e('0x1a')]({'raw':_0x5c73be[_0xbe6e('0x16')]?_0x5c73be[_0xbe6e('0x16')][_0xbe6e('0x17')]===undefined?!![]:![]:!![],'where':_0x5c73be[_0xbe6e('0x16')]?_0x5c73be[_0xbe6e('0x16')][_0xbe6e('0x1b')]||null:null,'attributes':[[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')][_0xbe6e('0x1d')]('id')),_0xbe6e('0x1e')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x20')))),'predictiveIntervalAnsweredCalls'],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x22')))),_0xbe6e('0x23')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbe6e('0x1c')]['literal'](_0xbe6e('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xbe6e('0x1c')]['fn']('AVG',db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xbe6e('0x25')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x26'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x27')))),_0xbe6e('0x28')]]})['then'](function(_0x4c23f6){logger['info'](_0xbe6e('0x19'),_0x5c73be);logger[_0xbe6e('0xe')]('AvgHandleTime',_0x5c73be,JSON[_0xbe6e('0xf')](_0x4c23f6));_0x290ada(_0x4c23f6);})[_0xbe6e('0x18')](function(_0x51be94){logger['error'](_0xbe6e('0x19'),_0x51be94[_0xbe6e('0x12')],_0x5c73be);_0x18f1c5(_0x42965f[_0xbe6e('0x10')](0x1f4,_0x51be94[_0xbe6e('0x12')]));});});};exports[_0xbe6e('0x29')]=function(_0x56be1f){var _0x42a3ae=this;return new Promise(function(_0x31391d,_0x404dba){return db[_0xbe6e('0x15')]['findAll']({'raw':_0x56be1f[_0xbe6e('0x16')]?_0x56be1f['options'][_0xbe6e('0x17')]===undefined?!![]:![]:!![],'where':_0x56be1f['options']?_0x56be1f[_0xbe6e('0x16')]['where']||null:null,'attributes':[[_0xbe6e('0x2a'),'name'],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x2b')))),_0xbe6e('0x2c')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x2d')))),_0xbe6e('0x2e')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x20')))),_0xbe6e('0x2f')],[db['sequelize']['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')](_0xbe6e('0x30')))),_0xbe6e('0x31')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')](_0xbe6e('0x32')))),_0xbe6e('0x33')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x34')))),_0xbe6e('0x35')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x36')))),_0xbe6e('0x37')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db['sequelize'][_0xbe6e('0x1f')]('`state`\x20=\x2013,\x201,\x20null'))),_0xbe6e('0x38')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x39')))),_0xbe6e('0x3a')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x3b')))),_0xbe6e('0x3c')],[db[_0xbe6e('0x1c')]['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xbe6e('0x3d')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x3e')))),_0xbe6e('0x3c')],[db['sequelize']['fn'](_0xbe6e('0x21'),db['sequelize']['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x3f')))),_0xbe6e('0x40')]],'group':['campaign']})['then'](function(_0x515069){logger['info'](_0xbe6e('0x29'),_0x56be1f);logger[_0xbe6e('0xe')](_0xbe6e('0x29'),_0x56be1f,JSON[_0xbe6e('0xf')](_0x515069));_0x31391d(_0x515069);})[_0xbe6e('0x18')](function(_0x452ccc){logger[_0xbe6e('0x10')](_0xbe6e('0x29'),_0x452ccc[_0xbe6e('0x12')],_0x56be1f);_0x404dba(_0x42a3ae[_0xbe6e('0x10')](0x1f4,_0x452ccc[_0xbe6e('0x12')]));});});};exports['GetCampaignHopperHistory']=function(_0x34a181){var _0x10a5c0=this;return new Promise(function(_0x24f59c,_0x3a6b6b){return db[_0xbe6e('0x15')][_0xbe6e('0x1a')]({'raw':_0x34a181['options']?_0x34a181[_0xbe6e('0x16')][_0xbe6e('0x17')]===undefined?!![]:![]:!![],'where':_0x34a181['options']?_0x34a181[_0xbe6e('0x16')]['where']||null:null,'attributes':[[_0xbe6e('0x2a'),_0xbe6e('0x41')],[db[_0xbe6e('0x1c')]['fn']('COUNT',db[_0xbe6e('0x1c')][_0xbe6e('0x1d')]('id')),_0xbe6e('0x42')],[db['sequelize']['fn'](_0xbe6e('0x21'),db[_0xbe6e('0x1c')]['fn']('IF',db[_0xbe6e('0x1c')][_0xbe6e('0x1f')](_0xbe6e('0x20')))),_0xbe6e('0x43')]],'group':[_0xbe6e('0x2a')]})['then'](function(_0x4fefce){logger[_0xbe6e('0xb')](_0xbe6e('0x44'),_0x34a181);logger[_0xbe6e('0xe')](_0xbe6e('0x44'),_0x34a181,JSON[_0xbe6e('0xf')](_0x4fefce));_0x24f59c(_0x4fefce);})[_0xbe6e('0x18')](function(_0x58b616){logger[_0xbe6e('0x10')](_0xbe6e('0x44'),_0x58b616['message'],_0x34a181);_0x3a6b6b(_0x10a5c0[_0xbe6e('0x10')](0x1f4,_0x58b616[_0xbe6e('0x12')]));});});}; \ No newline at end of file +var _0x950a=['findAll','options','COUNT','sequelize','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','raw','then','AvgHandleTime'];(function(_0x17b6ab,_0xe0a38e){var _0x23959b=function(_0x55a295){while(--_0x55a295){_0x17b6ab['push'](_0x17b6ab['shift']());}};_0x23959b(++_0xe0a38e);}(_0x950a,0x174));var _0xa950=function(_0x343199,_0x262b29){_0x343199=_0x343199-0x0;var _0x145d52=_0x950a[_0x343199];return _0x145d52;};'use strict';var _=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var moment=require(_0xa950('0x2'));var BPromise=require('bluebird');var rs=require(_0xa950('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa950('0x4'));var logger=require(_0xa950('0x5'))(_0xa950('0x6'));var config=require(_0xa950('0x7'));var jayson=require(_0xa950('0x8'));var client=jayson[_0xa950('0x9')][_0xa950('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57e8ff,_0x426c4d,_0x11bd04){return new BPromise(function(_0x13f2de,_0x713f2b){return client[_0xa950('0xb')](_0x57e8ff,_0x11bd04)['then'](function(_0x595a04){logger['info'](_0xa950('0xc'),_0x426c4d,_0xa950('0xd'));logger[_0xa950('0xe')](_0xa950('0xf'),_0x426c4d,_0xa950('0xd'),JSON[_0xa950('0x10')](_0x595a04));if(_0x595a04[_0xa950('0x11')]){if(_0x595a04[_0xa950('0x11')][_0xa950('0x12')]===0x1f4){logger[_0xa950('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x426c4d,_0x595a04['error']['message']);return _0x713f2b(_0x595a04[_0xa950('0x11')][_0xa950('0x13')]);}logger[_0xa950('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x426c4d,_0x595a04[_0xa950('0x11')]['message']);return _0x13f2de(_0x595a04[_0xa950('0x11')]['message']);}else{logger[_0xa950('0x14')](_0xa950('0xc'),_0x426c4d,_0xa950('0xd'));_0x13f2de(_0x595a04[_0xa950('0x15')]['message']);}})[_0xa950('0x16')](function(_0x4c5c5d){logger[_0xa950('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x426c4d,_0x4c5c5d);_0x713f2b(_0x4c5c5d);});});}exports[_0xa950('0x17')]=function(_0x1f961e){var _0x473182=this;return new Promise(function(_0x4bdb54,_0x297e82){return db[_0xa950('0x18')][_0xa950('0x19')](_0x1f961e[_0xa950('0x1a')],{'raw':_0x1f961e['options']?_0x1f961e['options'][_0xa950('0x1b')]===undefined?!![]:![]:!![]})[_0xa950('0x1c')](function(_0x255dfc){logger[_0xa950('0x14')]('CreateCmHopperHistory',_0x1f961e);logger[_0xa950('0xe')](_0xa950('0x17'),_0x1f961e,JSON[_0xa950('0x10')](_0x255dfc));_0x4bdb54(_0x255dfc);})[_0xa950('0x16')](function(_0x1062f1){logger[_0xa950('0x11')](_0xa950('0x17'),_0x1062f1['message'],_0x1f961e);_0x297e82(_0x473182[_0xa950('0x11')](0x1f4,_0x1062f1['message']));});});};exports[_0xa950('0x1d')]=function(_0x2451b4){var _0xd04c9c=this;return new Promise(function(_0x5f5104,_0x5a21fb){return db[_0xa950('0x18')][_0xa950('0x1e')]({'raw':_0x2451b4[_0xa950('0x1f')]?_0x2451b4[_0xa950('0x1f')][_0xa950('0x1b')]===undefined?!![]:![]:!![],'where':_0x2451b4[_0xa950('0x1f')]?_0x2451b4['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['col']('id')),_0xa950('0x22')],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')]('`state`\x20=\x204,\x201,\x20null'))),_0xa950('0x24')],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0xa950('0x23')]('`state`\x20=\x2010,\x201,\x20null'))),_0xa950('0x25')],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')]['literal'](_0xa950('0x26')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xa950('0x21')]['fn'](_0xa950('0x27'),db[_0xa950('0x21')]['fn']('IF',db['sequelize'][_0xa950('0x23')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xa950('0x21')]['fn'](_0xa950('0x27'),db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x28')))),_0xa950('0x29')]]})[_0xa950('0x1c')](function(_0x468f88){logger[_0xa950('0x14')](_0xa950('0x1d'),_0x2451b4);logger['debug'](_0xa950('0x1d'),_0x2451b4,JSON[_0xa950('0x10')](_0x468f88));_0x5f5104(_0x468f88);})[_0xa950('0x16')](function(_0x4bbc97){logger[_0xa950('0x11')](_0xa950('0x1d'),_0x4bbc97[_0xa950('0x13')],_0x2451b4);_0x5a21fb(_0xd04c9c[_0xa950('0x11')](0x1f4,_0x4bbc97[_0xa950('0x13')]));});});};exports[_0xa950('0x2a')]=function(_0x2a9f8e){var _0x651199=this;return new Promise(function(_0x32fb63,_0x4d9959){return db['CmHopperHistory'][_0xa950('0x1e')]({'raw':_0x2a9f8e[_0xa950('0x1f')]?_0x2a9f8e[_0xa950('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x2a9f8e[_0xa950('0x1f')]?_0x2a9f8e['options']['where']||null:null,'attributes':[[_0xa950('0x2b'),_0xa950('0x2c')],[db['sequelize']['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0xa950('0x2d')],[db[_0xa950('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x2e')))),_0xa950('0x2f')],[db['sequelize']['fn']('COUNT',db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x30')))),'outboundAnswerCallsDay'],[db[_0xa950('0x21')]['fn']('COUNT',db[_0xa950('0x21')]['fn']('IF',db['sequelize']['literal'](_0xa950('0x31')))),_0xa950('0x32')],[db[_0xa950('0x21')]['fn']('COUNT',db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x33')))),_0xa950('0x34')],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x35')))),'outboundDropCallsDayTimeout'],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')]['literal'](_0xa950('0x36')))),_0xa950('0x37')],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['fn']('IF',db['sequelize'][_0xa950('0x23')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x38')))),_0xa950('0x39')],[db['sequelize']['fn'](_0xa950('0x20'),db['sequelize']['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x3a')))),'outboundOriginateFailureCallsDay'],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['fn']('IF',db['sequelize'][_0xa950('0x23')](_0xa950('0x3b')))),_0xa950('0x3c')],[db[_0xa950('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x3d')))),_0xa950('0x3e')],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db['sequelize']['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')](_0xa950('0x3f')))),'outboundRejectCallsDay'],[db[_0xa950('0x21')]['fn']('COUNT',db[_0xa950('0x21')]['fn']('IF',db['sequelize'][_0xa950('0x23')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xa950('0x40')]],'group':[_0xa950('0x2b')]})['then'](function(_0x17482e){logger[_0xa950('0x14')](_0xa950('0x2a'),_0x2a9f8e);logger[_0xa950('0xe')]('GetVoiceQueueHopperHistory',_0x2a9f8e,JSON['stringify'](_0x17482e));_0x32fb63(_0x17482e);})['catch'](function(_0xdd402){logger[_0xa950('0x11')](_0xa950('0x2a'),_0xdd402[_0xa950('0x13')],_0x2a9f8e);_0x4d9959(_0x651199[_0xa950('0x11')](0x1f4,_0xdd402[_0xa950('0x13')]));});});};exports[_0xa950('0x41')]=function(_0x1c3705){var _0x483599=this;return new Promise(function(_0x4fdbb4,_0x4b508f){return db[_0xa950('0x18')][_0xa950('0x1e')]({'raw':_0x1c3705[_0xa950('0x1f')]?_0x1c3705[_0xa950('0x1f')][_0xa950('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c3705[_0xa950('0x1f')]?_0x1c3705[_0xa950('0x1f')]['where']||null:null,'attributes':[[_0xa950('0x2b'),_0xa950('0x2c')],[db[_0xa950('0x21')]['fn'](_0xa950('0x20'),db[_0xa950('0x21')]['col']('id')),_0xa950('0x42')],[db[_0xa950('0x21')]['fn']('COUNT',db[_0xa950('0x21')]['fn']('IF',db[_0xa950('0x21')][_0xa950('0x23')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':['campaign']})[_0xa950('0x1c')](function(_0x4e732a){logger[_0xa950('0x14')](_0xa950('0x41'),_0x1c3705);logger[_0xa950('0xe')](_0xa950('0x41'),_0x1c3705,JSON[_0xa950('0x10')](_0x4e732a));_0x4fdbb4(_0x4e732a);})[_0xa950('0x16')](function(_0x36cab8){logger[_0xa950('0x11')]('GetCampaignHopperHistory',_0x36cab8[_0xa950('0x13')],_0x1c3705);_0x4b508f(_0x483599[_0xa950('0x11')](0x1f4,_0x36cab8[_0xa950('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 1502a39..164aed0 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 _0x6fc7=['put','exports','multer','connect-timeout','express','Router','fs-extra','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x23228f,_0x5ed680){var _0x2c07e8=function(_0xcfc1d9){while(--_0xcfc1d9){_0x23228f['push'](_0x23228f['shift']());}};_0x2c07e8(++_0x5ed680);}(_0x6fc7,0xf0));var _0x76fc=function(_0x1451f8,_0x1e537f){_0x1451f8=_0x1451f8-0x0;var _0x392bc9=_0x6fc7[_0x1451f8];return _0x392bc9;};'use strict';var multer=require(_0x76fc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x76fc('0x1'));var express=require(_0x76fc('0x2'));var router=express[_0x76fc('0x3')]();var fs_extra=require(_0x76fc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x76fc('0x5'));router[_0x76fc('0x6')]('/',auth[_0x76fc('0x7')](),controller[_0x76fc('0x8')]);router[_0x76fc('0x6')](_0x76fc('0x9'),auth['isAuthenticated'](),controller[_0x76fc('0xa')]);router['get'](_0x76fc('0xb'),auth['isAuthenticated'](),controller[_0x76fc('0xc')]);router[_0x76fc('0xd')]('/',auth[_0x76fc('0x7')](),controller[_0x76fc('0xe')]);router[_0x76fc('0xf')](_0x76fc('0xb'),auth[_0x76fc('0x7')](),controller['update']);module[_0x76fc('0x10')]=router; \ No newline at end of file +var _0x6d94=['/:id','show','update','util','path','express','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d94,0x148));var _0x46d9=function(_0x2ab175,_0x4715a9){_0x2ab175=_0x2ab175-0x0;var _0x212e36=_0x6d94[_0x2ab175];return _0x212e36;};'use strict';var multer=require('multer');var util=require(_0x46d9('0x0'));var path=require(_0x46d9('0x1'));var timeout=require('connect-timeout');var express=require(_0x46d9('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x46d9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x46d9('0x4'));var controller=require(_0x46d9('0x5'));router[_0x46d9('0x6')]('/',auth[_0x46d9('0x7')](),controller[_0x46d9('0x8')]);router[_0x46d9('0x6')]('/describe',auth[_0x46d9('0x7')](),controller[_0x46d9('0x9')]);router['get'](_0x46d9('0xa'),auth[_0x46d9('0x7')](),controller[_0x46d9('0xb')]);router['post']('/',auth[_0x46d9('0x7')](),controller['create']);router['put'](_0x46d9('0xa'),auth['isAuthenticated'](),controller[_0x46d9('0xc')]);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 ab2b12d..e5991c7 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 _0x67a2=['exports','name','STRING','sequelize'];(function(_0x546032,_0x53ad39){var _0x3b580e=function(_0x5940ee){while(--_0x5940ee){_0x546032['push'](_0x546032['shift']());}};_0x3b580e(++_0x53ad39);}(_0x67a2,0xd3));var _0x267a=function(_0x7bb99c,_0x50aeaa){_0x7bb99c=_0x7bb99c-0x0;var _0x4bb802=_0x67a2[_0x7bb99c];return _0x4bb802;};'use strict';var Sequelize=require(_0x267a('0x0'));module[_0x267a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x267a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x267a('0x3')]},'dialPrefix':{'type':Sequelize[_0x267a('0x3')]}}; \ No newline at end of file +var _0xaa7c=['sequelize','STRING'];(function(_0x3c957d,_0x40d8f3){var _0x46ab64=function(_0x470663){while(--_0x470663){_0x3c957d['push'](_0x3c957d['shift']());}};_0x46ab64(++_0x40d8f3);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x2cb9c3,_0xacf68f){_0x2cb9c3=_0x2cb9c3-0x0;var _0x1a3440=_0xaa7c[_0x2cb9c3];return _0x1a3440;};'use strict';var Sequelize=require(_0xcaa7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xcaa7('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index bc3bdbc..3449dfe 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 _0x1d99=['getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','sendStatus','addCustomField','findOne','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','isArray','userCmList:remove','User','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','UserProfileResource','then','end','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','params','fields','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','create','Disposition','hasOwnProperty','include','ids','addContacts','CmContact','tags','join','push','each','success','errors','message','Malformed\x20request\x20syntax'];(function(_0x3b7fc4,_0x442564){var _0x1c6ccf=function(_0x16579d){while(--_0x16579d){_0x3b7fc4['push'](_0x3b7fc4['shift']());}};_0x1c6ccf(++_0x442564);}(_0x1d99,0x18a));var _0x91d9=function(_0x3cc02f,_0x210421){_0x3cc02f=_0x3cc02f-0x0;var _0x11bf29=_0x1d99[_0x3cc02f];return _0x11bf29;};'use strict';var emlformat=require(_0x91d9('0x0'));var rimraf=require(_0x91d9('0x1'));var zipdir=require(_0x91d9('0x2'));var jsonpatch=require(_0x91d9('0x3'));var rp=require(_0x91d9('0x4'));var moment=require(_0x91d9('0x5'));var BPromise=require(_0x91d9('0x6'));var Mustache=require(_0x91d9('0x7'));var util=require(_0x91d9('0x8'));var path=require(_0x91d9('0x9'));var sox=require('sox');var csv=require(_0x91d9('0xa'));var ejs=require(_0x91d9('0xb'));var fs=require('fs');var fs_extra=require(_0x91d9('0xc'));var _=require('lodash');var squel=require(_0x91d9('0xd'));var crypto=require(_0x91d9('0xe'));var jsforce=require(_0x91d9('0xf'));var deskjs=require(_0x91d9('0x10'));var toCsv=require(_0x91d9('0xa'));var querystring=require(_0x91d9('0x11'));var Papa=require(_0x91d9('0x12'));var Redis=require(_0x91d9('0x13'));var authService=require(_0x91d9('0x14'));var qs=require(_0x91d9('0x15'));var as=require(_0x91d9('0x16'));var hardwareService=require(_0x91d9('0x17'));var logger=require(_0x91d9('0x18'))(_0x91d9('0x19'));var utils=require(_0x91d9('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x91d9('0x1b'));var db=require(_0x91d9('0x1c'))['db'];var csv_results;config[_0x91d9('0x1d')]=_[_0x91d9('0x1e')](config[_0x91d9('0x1d')],{'host':_0x91d9('0x1f'),'port':0x18eb});var socket=require(_0x91d9('0x20'))(new Redis(config[_0x91d9('0x1d')]));require(_0x91d9('0x21'))[_0x91d9('0x22')](socket);function respondWithStatusCode(_0x25296e,_0x55e7a3){_0x55e7a3=_0x55e7a3||0xcc;return function(_0x21e44c){if(_0x21e44c){return _0x25296e['sendStatus'](_0x55e7a3);}return _0x25296e[_0x91d9('0x23')](_0x55e7a3)['end']();};}function respondWithResult(_0x3e867f,_0x455796){_0x455796=_0x455796||0xc8;return function(_0x3cd190){if(_0x3cd190){return _0x3e867f[_0x91d9('0x23')](_0x455796)[_0x91d9('0x24')](_0x3cd190);}};}function respondWithFilteredResult(_0x3c8cce,_0x59ce56){return function(_0x367457){if(_0x367457){var _0x10f2e8=typeof _0x59ce56[_0x91d9('0x25')]===_0x91d9('0x26')&&typeof _0x59ce56[_0x91d9('0x27')]===_0x91d9('0x26');var _0x3e72e7=_0x367457[_0x91d9('0x28')];var _0x3049f4=_0x10f2e8?0x0:_0x59ce56[_0x91d9('0x25')];var _0x1afefd=_0x10f2e8?_0x367457[_0x91d9('0x28')]:_0x59ce56[_0x91d9('0x25')]+_0x59ce56[_0x91d9('0x27')];var _0x1efc9c;if(_0x1afefd>=_0x3e72e7){_0x1afefd=_0x3e72e7;_0x1efc9c=0xc8;}else{_0x1efc9c=0xce;}_0x3c8cce[_0x91d9('0x23')](_0x1efc9c);return _0x3c8cce[_0x91d9('0x29')]('Content-Range',_0x3049f4+'-'+_0x1afefd+'/'+_0x3e72e7)[_0x91d9('0x24')](_0x367457);}return null;};}function patchUpdates(_0x23fc3f){return function(_0x56562d){try{jsonpatch[_0x91d9('0x2a')](_0x56562d,_0x23fc3f,!![]);}catch(_0x54bbd6){return BPromise[_0x91d9('0x2b')](_0x54bbd6);}return _0x56562d[_0x91d9('0x2c')]();};}function saveUpdates(_0x21c4ef,_0x234daa){return function(_0x129c3b){if(_0x129c3b){return _0x129c3b[_0x91d9('0x2d')](_0x21c4ef)['then'](function(_0x143488){return _0x143488;});}return null;};}function removeEntity(_0x56381a,_0x27c327){return function(_0x1ddb66){if(_0x1ddb66){return _0x1ddb66[_0x91d9('0x2e')]()['then'](function(){var _0x115849=_0x1ddb66[_0x91d9('0x2f')]({'plain':!![]});var _0x128eb4='Lists';return db[_0x91d9('0x30')][_0x91d9('0x2e')]({'where':{'type':_0x128eb4,'resourceId':_0x115849['id']}})[_0x91d9('0x31')](function(){return _0x1ddb66;});})[_0x91d9('0x31')](function(){_0x56381a[_0x91d9('0x23')](0xcc)[_0x91d9('0x32')]();});}};}function handleEntityNotFound(_0x37c859,_0x2a3051){return function(_0x5f2c4f){if(!_0x5f2c4f){_0x37c859['sendStatus'](0x194);}return _0x5f2c4f;};}function handleError(_0x4315e7,_0xe10ae){_0xe10ae=_0xe10ae||0x1f4;return function(_0x2fada0){logger[_0x91d9('0x33')](_0x2fada0['stack']);if(_0x2fada0['name']){delete _0x2fada0[_0x91d9('0x34')];}_0x4315e7[_0x91d9('0x23')](_0xe10ae)[_0x91d9('0x35')](_0x2fada0);};}exports[_0x91d9('0x36')]=function(_0x1d89cd,_0x2f2350){var _0x408f2c={},_0x1e4ee9={},_0x313a09={'count':0x0,'rows':[]};var _0x49aae1=_[_0x91d9('0x37')](db[_0x91d9('0x38')][_0x91d9('0x39')],function(_0x27db61){return{'name':_0x27db61[_0x91d9('0x3a')],'type':_0x27db61[_0x91d9('0x3b')][_0x91d9('0x3c')]};});_0x1e4ee9['model']=_['map'](_0x49aae1,_0x91d9('0x34'));_0x1e4ee9[_0x91d9('0x3d')]=_[_0x91d9('0x3e')](_0x1d89cd['query']);_0x1e4ee9['filters']=_[_0x91d9('0x3f')](_0x1e4ee9[_0x91d9('0x40')],_0x1e4ee9['query']);_0x408f2c[_0x91d9('0x41')]=_['intersection'](_0x1e4ee9[_0x91d9('0x40')],qs['fields'](_0x1d89cd[_0x91d9('0x3d')]['fields']));_0x408f2c['attributes']=_0x408f2c['attributes']['length']?_0x408f2c['attributes']:_0x1e4ee9['model'];if(!_0x1d89cd[_0x91d9('0x3d')]['hasOwnProperty'](_0x91d9('0x42'))){_0x408f2c[_0x91d9('0x27')]=qs['limit'](_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x27')]);_0x408f2c[_0x91d9('0x25')]=qs[_0x91d9('0x25')](_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x25')]);}_0x408f2c[_0x91d9('0x43')]=qs[_0x91d9('0x44')](_0x1d89cd[_0x91d9('0x3d')]['sort']);_0x408f2c[_0x91d9('0x45')]=qs[_0x91d9('0x46')](_[_0x91d9('0x47')](_0x1d89cd[_0x91d9('0x3d')],_0x1e4ee9['filters']),_0x49aae1);if(_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x48')]){_0x408f2c[_0x91d9('0x45')]=_[_0x91d9('0x49')](_0x408f2c[_0x91d9('0x45')],{'$or':_[_0x91d9('0x37')](_0x49aae1,function(_0x581245){if(_0x581245[_0x91d9('0x3b')]!=='VIRTUAL'){var _0x5f2d7e={};_0x5f2d7e[_0x581245[_0x91d9('0x34')]]={'$like':'%'+_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x48')]+'%'};return _0x5f2d7e;}})});}_0x408f2c=_['merge']({},_0x408f2c,_0x1d89cd[_0x91d9('0x4a')]);var _0x2ce977={'where':_0x408f2c[_0x91d9('0x45')]};return db['CmList'][_0x91d9('0x28')](_0x2ce977)[_0x91d9('0x31')](function(_0x2f410e){_0x313a09[_0x91d9('0x28')]=_0x2f410e;if(_0x1d89cd[_0x91d9('0x3d')][_0x91d9('0x4b')]){_0x408f2c['include']=[{'all':!![]}];}return db['CmList'][_0x91d9('0x4c')](_0x408f2c);})[_0x91d9('0x31')](function(_0x4656c2){_0x313a09[_0x91d9('0x4d')]=_0x4656c2;return _0x313a09;})['then'](respondWithFilteredResult(_0x2f2350,_0x408f2c))[_0x91d9('0x4e')](handleError(_0x2f2350,null));};exports['show']=function(_0x33f91d,_0x13b007){var _0x2fc38e={'raw':![],'where':{'id':_0x33f91d[_0x91d9('0x4f')]['id']}},_0x170ad5={};_0x170ad5[_0x91d9('0x40')]=_[_0x91d9('0x3e')](db[_0x91d9('0x38')][_0x91d9('0x39')]);_0x170ad5[_0x91d9('0x3d')]=_[_0x91d9('0x3e')](_0x33f91d[_0x91d9('0x3d')]);_0x170ad5[_0x91d9('0x46')]=_['intersection'](_0x170ad5[_0x91d9('0x40')],_0x170ad5[_0x91d9('0x3d')]);_0x2fc38e[_0x91d9('0x41')]=_[_0x91d9('0x3f')](_0x170ad5[_0x91d9('0x40')],qs['fields'](_0x33f91d[_0x91d9('0x3d')][_0x91d9('0x50')]));_0x2fc38e['attributes']=_0x2fc38e['attributes'][_0x91d9('0x51')]?_0x2fc38e[_0x91d9('0x41')]:_0x170ad5[_0x91d9('0x40')];if(_0x33f91d[_0x91d9('0x3d')][_0x91d9('0x4b')]){_0x2fc38e['include']=[{'all':!![]}];}_0x2fc38e=_[_0x91d9('0x49')]({},_0x2fc38e,_0x33f91d[_0x91d9('0x4a')]);return db[_0x91d9('0x38')][_0x91d9('0x52')](_0x2fc38e)[_0x91d9('0x31')](handleEntityNotFound(_0x13b007,null))[_0x91d9('0x31')](respondWithResult(_0x13b007,null))['catch'](handleError(_0x13b007,null));};exports['create']=function(_0x7c8266,_0x5a538f){return db[_0x91d9('0x38')]['create'](_0x7c8266[_0x91d9('0x53')],{})[_0x91d9('0x31')](function(_0x9789c4){var _0x34b9cb=_0x7c8266[_0x91d9('0x54')]['get']({'plain':!![]});if(!_0x34b9cb)throw new Error(_0x91d9('0x55'));if(_0x34b9cb[_0x91d9('0x56')]==='user'){var _0xe63553=_0x9789c4[_0x91d9('0x2f')]({'plain':!![]});var _0x2b4239=_0x91d9('0x57');return db['UserProfileSection'][_0x91d9('0x52')]({'where':{'name':_0x2b4239,'userProfileId':_0x34b9cb['userProfileId']},'raw':!![]})[_0x91d9('0x31')](function(_0x135dc6){if(_0x135dc6&&_0x135dc6[_0x91d9('0x58')]===0x0){return db[_0x91d9('0x30')]['create']({'name':_0xe63553[_0x91d9('0x34')],'resourceId':_0xe63553['id'],'type':_0x135dc6['name'],'sectionId':_0x135dc6['id']},{})['then'](function(){return _0x9789c4;});}else{return _0x9789c4;}})[_0x91d9('0x4e')](function(_0x278299){logger['error'](_0x91d9('0x59'),_0x278299);throw _0x278299;});}return _0x9789c4;})['then'](respondWithResult(_0x5a538f,0xc9))[_0x91d9('0x4e')](handleError(_0x5a538f,null));};exports[_0x91d9('0x2d')]=function(_0x1e44ad,_0x1c79d){if(_0x1e44ad[_0x91d9('0x53')]['id']){delete _0x1e44ad[_0x91d9('0x53')]['id'];}return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x1e44ad[_0x91d9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1c79d,null))[_0x91d9('0x31')](saveUpdates(_0x1e44ad[_0x91d9('0x53')],null))[_0x91d9('0x31')](respondWithResult(_0x1c79d,null))[_0x91d9('0x4e')](handleError(_0x1c79d,null));};exports[_0x91d9('0x2e')]=function(_0x15bb2f,_0x4bba1e){return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x15bb2f[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x4bba1e,null))[_0x91d9('0x31')](removeEntity(_0x4bba1e,null))[_0x91d9('0x4e')](handleError(_0x4bba1e,null));};exports[_0x91d9('0x5a')]=function(_0x4c1514,_0x2db87f){return db[_0x91d9('0x38')][_0x91d9('0x5a')]()[_0x91d9('0x31')](respondWithResult(_0x2db87f,null))[_0x91d9('0x4e')](handleError(_0x2db87f,null));};exports['addDisposition']=function(_0xc74d96,_0x2006c1,_0x2a496c){if(_0xc74d96['body']['id']){delete _0xc74d96[_0x91d9('0x53')]['id'];}return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0xc74d96[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x2006c1,null))[_0x91d9('0x31')](function(_0x9c2790){if(_0x9c2790){_0xc74d96['body'][_0x91d9('0x5b')]=_0x9c2790['id'];return db['Disposition'][_0x91d9('0x5c')](_0xc74d96[_0x91d9('0x53')]);}})['then'](respondWithResult(_0x2006c1,null))[_0x91d9('0x4e')](handleError(_0x2006c1,null));};exports['getDispositions']=function(_0xfcb799,_0x4a0f81,_0x13b57a){var _0x49b206={'raw':![],'where':{}};var _0x38642a={};var _0x4fdf2d={'count':0x0,'rows':[]};return db[_0x91d9('0x38')]['findOne']({'where':{'id':_0xfcb799[_0x91d9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4a0f81,null))[_0x91d9('0x31')](function(_0x1fe6bf){if(_0x1fe6bf){_0x38642a[_0x91d9('0x40')]=_[_0x91d9('0x3e')](db[_0x91d9('0x5d')][_0x91d9('0x39')]);_0x38642a[_0x91d9('0x3d')]=_['keys'](_0xfcb799[_0x91d9('0x3d')]);_0x38642a[_0x91d9('0x46')]=_[_0x91d9('0x3f')](_0x38642a[_0x91d9('0x40')],_0x38642a[_0x91d9('0x3d')]);_0x49b206['attributes']=_[_0x91d9('0x3f')](_0x38642a[_0x91d9('0x40')],qs['fields'](_0xfcb799[_0x91d9('0x3d')]['fields']));_0x49b206[_0x91d9('0x41')]=_0x49b206[_0x91d9('0x41')]['length']?_0x49b206[_0x91d9('0x41')]:_0x38642a[_0x91d9('0x40')];if(!_0xfcb799[_0x91d9('0x3d')][_0x91d9('0x5e')]('nolimit')){_0x49b206[_0x91d9('0x27')]=qs[_0x91d9('0x27')](_0xfcb799[_0x91d9('0x3d')]['limit']);_0x49b206['offset']=qs[_0x91d9('0x25')](_0xfcb799[_0x91d9('0x3d')]['offset']);}_0x49b206['order']=qs['sort'](_0xfcb799[_0x91d9('0x3d')][_0x91d9('0x44')]);_0x49b206[_0x91d9('0x45')]=qs['filters'](_[_0x91d9('0x47')](_0xfcb799[_0x91d9('0x3d')],_0x38642a['filters']));_0x49b206[_0x91d9('0x45')][_0x91d9('0x5b')]=_0x1fe6bf['id'];if(_0xfcb799[_0x91d9('0x3d')][_0x91d9('0x48')]){_0x49b206[_0x91d9('0x45')]=_['merge'](_0x49b206[_0x91d9('0x45')],{'$or':_[_0x91d9('0x37')](_0x49b206[_0x91d9('0x41')],function(_0x3c4b63){var _0x89c8fd={};_0x89c8fd[_0x3c4b63]={'$like':'%'+_0xfcb799[_0x91d9('0x3d')]['filter']+'%'};return _0x89c8fd;})});}_0x49b206=_[_0x91d9('0x49')]({},_0x49b206,_0xfcb799['options']);return db['Disposition'][_0x91d9('0x28')]({'where':_0x49b206[_0x91d9('0x45')]})['then'](function(_0x2a4bf5){_0x4fdf2d[_0x91d9('0x28')]=_0x2a4bf5;if(_0xfcb799[_0x91d9('0x3d')][_0x91d9('0x4b')]){_0x49b206[_0x91d9('0x5f')]=[{'all':!![]}];}return db[_0x91d9('0x5d')][_0x91d9('0x4c')](_0x49b206);})[_0x91d9('0x31')](function(_0x161bb4){_0x4fdf2d[_0x91d9('0x4d')]=_0x161bb4;return _0x4fdf2d;});}})[_0x91d9('0x31')](respondWithFilteredResult(_0x4a0f81,_0x49b206))['catch'](handleError(_0x4a0f81,null));};exports['removeDispositions']=function(_0x332f8b,_0x37739f,_0x596625){return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x332f8b['params']['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x37739f,null))[_0x91d9('0x31')](function(_0x2ee6de){if(_0x2ee6de){return _0x2ee6de['removeDispositions'](_0x332f8b[_0x91d9('0x3d')][_0x91d9('0x60')]);}})[_0x91d9('0x31')](respondWithStatusCode(_0x37739f,null))[_0x91d9('0x4e')](handleError(_0x37739f,null));};exports[_0x91d9('0x61')]=function(_0x444897,_0xc06895,_0x1c47b3){return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x444897[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0xc06895,null))[_0x91d9('0x31')](function(_0x42fbec){if(_0x42fbec){var _0x8512b4=[];var _0x305085={'success':[],'errors':[]};return db[_0x91d9('0x62')][_0x91d9('0x5a')]()[_0x91d9('0x31')](function(_0x3414fc){if(_0x444897[_0x91d9('0x53')]['tags']&&_['isArray'](_0x444897[_0x91d9('0x53')][_0x91d9('0x63')])){if(_0x444897[_0x91d9('0x53')]['tags'][_0x91d9('0x51')]){_0x444897[_0x91d9('0x53')][_0x91d9('0x63')]=_0x444897[_0x91d9('0x53')][_0x91d9('0x63')][_0x91d9('0x64')](';')+';';}else{_0x444897[_0x91d9('0x53')]['tags']=null;}}else{_0x444897[_0x91d9('0x53')][_0x91d9('0x63')]=null;}if(_0x444897[_0x91d9('0x53')]&&_['isArray'](_0x444897[_0x91d9('0x53')])){for(var _0x509c6a=0x0;_0x509c6a<_0x444897[_0x91d9('0x53')][_0x91d9('0x51')];_0x509c6a+=0x1){_0x444897['body'][_0x509c6a]['ListId']=_0x444897['params']['id'];_0x8512b4[_0x91d9('0x65')](_0x444897[_0x91d9('0x53')][_0x509c6a]);}return BPromise[_0x91d9('0x66')](_0x8512b4,function(_0x478f2c){return db[_0x91d9('0x62')][_0x91d9('0x5c')](_['omit'](_0x478f2c,[_0x91d9('0x60'),'id'])||{},{'fields':_[_0x91d9('0x3e')](_0x3414fc),'raw':!![]})[_0x91d9('0x31')](function(_0x2783b6){_0x305085[_0x91d9('0x67')]['push'](_0x2783b6['dataValues']);})[_0x91d9('0x4e')](function(_0x113fc7){_0x305085[_0x91d9('0x68')][_0x91d9('0x65')]({'data':_0x478f2c,'error':_0x113fc7[_0x91d9('0x69')]});});})[_0x91d9('0x31')](function(_0x2b9aaf){return _0x305085;})[_0x91d9('0x4e')](function(_0x307329){return _0x307329;});}else{_0xc06895['status'](0x190)[_0x91d9('0x24')]({'message':_0x91d9('0x6a')});}});}})[_0x91d9('0x31')](respondWithResult(_0xc06895,null))[_0x91d9('0x4e')](handleError(_0xc06895,null));};exports[_0x91d9('0x6b')]=function(_0x42bcf3,_0x39f57c,_0x1db43a){var _0x54374c;return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x42bcf3[_0x91d9('0x4f')]['id']},'include':[{'model':db[_0x91d9('0x6c')],'as':_0x91d9('0x6d')}]})['then'](handleEntityNotFound(_0x39f57c,null))[_0x91d9('0x31')](function(_0x3c04aa){if(_0x3c04aa){_0x54374c=_0x3c04aa;return db[_0x91d9('0x62')][_0x91d9('0x39')];}})['then'](function(_0x7e26e0){if(_0x7e26e0){var _0x129c09={};var _0x53f7b={};_0x53f7b[_0x91d9('0x40')]=_[_0x91d9('0x6e')](_[_0x91d9('0x3e')](_0x7e26e0),_[_0x91d9('0x37')](_0x54374c[_0x91d9('0x6d')],function(_0xc033dc){return util[_0x91d9('0x6f')](_0x91d9('0x70'),_0xc033dc['id']);}));_0x53f7b[_0x91d9('0x3d')]=_['keys'](_0x42bcf3[_0x91d9('0x3d')]);_0x53f7b['filters']=_['intersection'](_0x53f7b[_0x91d9('0x40')],_0x53f7b['query']);_0x129c09[_0x91d9('0x41')]=_['intersection'](_0x53f7b[_0x91d9('0x40')],qs['fields'](_0x42bcf3[_0x91d9('0x3d')]['fields']));_0x129c09[_0x91d9('0x41')]=_0x129c09[_0x91d9('0x41')][_0x91d9('0x51')]?_0x129c09['attributes']:_0x53f7b[_0x91d9('0x40')];if(!_0x42bcf3['query']['hasOwnProperty']('nolimit')){_0x129c09['limit']=qs[_0x91d9('0x27')](_0x42bcf3[_0x91d9('0x3d')][_0x91d9('0x27')]);_0x129c09[_0x91d9('0x25')]=qs[_0x91d9('0x25')](_0x42bcf3[_0x91d9('0x3d')][_0x91d9('0x25')]);}_0x129c09['order']=qs[_0x91d9('0x44')](_0x42bcf3[_0x91d9('0x3d')][_0x91d9('0x44')]);_0x129c09[_0x91d9('0x45')]=qs[_0x91d9('0x46')](_[_0x91d9('0x47')](_0x42bcf3[_0x91d9('0x3d')],_0x53f7b[_0x91d9('0x46')]));_0x129c09['raw']=!![];if(_0x42bcf3[_0x91d9('0x3d')][_0x91d9('0x48')]){_0x129c09[_0x91d9('0x45')]=_['merge'](_0x129c09[_0x91d9('0x45')],{'$or':_['map'](_0x129c09['attributes'],function(_0x213050){var _0x3a5b02={};_0x3a5b02[_0x213050]={'$like':'%'+_0x42bcf3[_0x91d9('0x3d')]['filter']+'%'};return _0x3a5b02;})});}_0x129c09=_[_0x91d9('0x49')]({},_0x129c09,_0x42bcf3[_0x91d9('0x4a')]);return _0x54374c['getContacts'](_0x129c09);}})[_0x91d9('0x31')](respondWithResult(_0x39f57c,null))[_0x91d9('0x4e')](handleError(_0x39f57c,null));};exports[_0x91d9('0x71')]=function(_0x132868,_0x44ee53,_0x29e6d7){var _0x52a28a;var _0x3d72af;var _0x548926;var _0x557e8a=_0x132868['params']['id'];csv_results=[];return db[_0x91d9('0x72')][_0x91d9('0x4c')]({'attributes':['id',_0x91d9('0x34')],'raw':!![],'order':[_0x91d9('0x73')]})['then'](function(_0x3bbc99){_0x52a28a=_0x3bbc99;var _0x1b7764=_[_0x91d9('0x3e')](db['CmContact'][_0x91d9('0x39')]);return db[_0x91d9('0x6c')]['findAll']({'raw':!![],'attributes':['id',_0x91d9('0x74')]})['then'](function(_0x52f759){_0x3d72af=_0x52f759;var _0x118dc8=squel[_0x91d9('0x75')]()[_0x91d9('0x50')](_0x1b7764)[_0x91d9('0x76')](_0x91d9('0x77'),'c')['where']('c.ListId\x20=\x20?',_0x557e8a)[_0x91d9('0x45')](_0x91d9('0x78'))['distinct']();for(var _0x42b04e=0x0;_0x42b04e<_0x3d72af[_0x91d9('0x51')];_0x42b04e++){_0x118dc8[_0x91d9('0x79')](_0x91d9('0x7a')+_0x3d72af[_0x42b04e]['id'],_0x91d9('0x7b')+_0x3d72af[_0x42b04e][_0x91d9('0x74')]);}for(var _0x42b04e=0x0;_0x42b04e<_0x52a28a[_0x91d9('0x51')];_0x42b04e++){_0x118dc8['field'](squel[_0x91d9('0x75')]()[_0x91d9('0x79')](_0x91d9('0x7c'))[_0x91d9('0x76')](_0x91d9('0x7d'))[_0x91d9('0x45')](_0x91d9('0x7e'),_0x52a28a[_0x42b04e]['id'])['where']('CmContactId\x20=\x20c.id'),'additionalPhone_'+_0x52a28a[_0x42b04e][_0x91d9('0x34')]);_0x118dc8[_0x91d9('0x79')](squel[_0x91d9('0x75')]()[_0x91d9('0x79')](_0x91d9('0x7f'))[_0x91d9('0x76')](_0x91d9('0x7d'))['where'](_0x91d9('0x7e'),_0x52a28a[_0x42b04e]['id'])['where'](_0x91d9('0x80')),_0x91d9('0x81')+_0x52a28a[_0x42b04e][_0x91d9('0x34')]);}var _0x30cd45=[];_0x30cd45[_0x91d9('0x65')](_0x118dc8[_0x91d9('0x82')]());BPromise[_0x91d9('0x66')](_0x30cd45,handleQuery)['then'](function(_0x3301a3){handleQuery(_0x118dc8[_0x91d9('0x82')]());var _0x2ae474=csv_results[0x0];if(!_[_0x91d9('0x83')](_0x2ae474)){var _0x299db2=toCsv(_0x2ae474);var _0x2b4ac0=Date[_0x91d9('0x84')]();fs['writeFileSync'](util[_0x91d9('0x6f')](_0x91d9('0x85'),_0x557e8a,_0x2b4ac0),_0x299db2);_0x44ee53[_0x91d9('0x86')](_0x91d9('0x87'),'attachment;\x20filename='+util[_0x91d9('0x6f')](_0x91d9('0x88'),_0x557e8a,_0x2b4ac0));_0x44ee53['setHeader'](_0x91d9('0x89'),_0x91d9('0x8a'));return _0x44ee53['download'](util[_0x91d9('0x6f')](_0x91d9('0x85'),_0x557e8a,_0x2b4ac0));}else{return _0x44ee53[_0x91d9('0x8b')](0xcc);}});});});};exports[_0x91d9('0x8c')]=function(_0xf7ce03,_0x5e6175,_0x5f145c){var _0x5bf694;delete _0xf7ce03[_0x91d9('0x53')]['id'];return db[_0x91d9('0x38')][_0x91d9('0x8d')]({'where':{'id':_0xf7ce03[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x5e6175,null))[_0x91d9('0x31')](function(_0x439432){if(_0x439432){return db[_0x91d9('0x8e')][_0x91d9('0x8f')](function(_0x4988be){return db['CmCustomField'][_0x91d9('0x5c')](_0xf7ce03[_0x91d9('0x53')],{'transaction':_0x4988be})['then'](function(_0x59619f){_0x5bf694=_0x59619f;return _0x439432[_0x91d9('0x90')](_0x59619f,{'transaction':_0x4988be});})['then'](function(){var _0x192a5e={'type':db['Sequelize'][_0x91d9('0x91')],'transaction':_0x4988be};switch(_0xf7ce03['body'][_0x91d9('0x3b')]){case _0x91d9('0x92'):_0x192a5e[_0x91d9('0x3b')]=db[_0x91d9('0x93')][_0x91d9('0x91')];break;case _0x91d9('0x94'):_0x192a5e[_0x91d9('0x3b')]=db[_0x91d9('0x93')][_0x91d9('0x95')];break;case'switch':_0x192a5e[_0x91d9('0x3b')]=db[_0x91d9('0x93')][_0x91d9('0x96')];_0x192a5e[_0x91d9('0x97')]=![];break;default:}return db['sequelize'][_0x91d9('0x98')][_0x91d9('0x99')]('cm_contacts',util['format'](_0x91d9('0x9a'),_0x5bf694['id']),_0x192a5e);})[_0x91d9('0x31')](function(){return _0x5bf694;});});}})[_0x91d9('0x31')](respondWithResult(_0x5e6175,null))[_0x91d9('0x4e')](handleError(_0x5e6175,null));};exports[_0x91d9('0x9b')]=function(_0x18e221,_0x49572f,_0x1972b4){var _0x34acb4={};var _0x1e09d9={};var _0x533631;var _0x531feb;return db['CmList'][_0x91d9('0x8d')]({'where':{'id':_0x18e221[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x49572f,null))[_0x91d9('0x31')](function(_0x345176){if(_0x345176){_0x533631=_0x345176;_0x1e09d9['model']=_['keys'](db[_0x91d9('0x6c')][_0x91d9('0x39')]);_0x1e09d9[_0x91d9('0x3d')]=_['keys'](_0x18e221['query']);_0x1e09d9[_0x91d9('0x46')]=_[_0x91d9('0x3f')](_0x1e09d9['model'],_0x1e09d9[_0x91d9('0x3d')]);_0x34acb4[_0x91d9('0x41')]=_[_0x91d9('0x3f')](_0x1e09d9[_0x91d9('0x40')],qs[_0x91d9('0x50')](_0x18e221[_0x91d9('0x3d')]['fields']));_0x34acb4[_0x91d9('0x41')]=_0x34acb4[_0x91d9('0x41')][_0x91d9('0x51')]?_0x34acb4['attributes']:_0x1e09d9[_0x91d9('0x40')];_0x34acb4[_0x91d9('0x43')]=qs[_0x91d9('0x44')](_0x18e221[_0x91d9('0x3d')][_0x91d9('0x44')]);_0x34acb4[_0x91d9('0x45')]=qs[_0x91d9('0x46')](_['pick'](_0x18e221[_0x91d9('0x3d')],_0x1e09d9[_0x91d9('0x46')]));_0x34acb4[_0x91d9('0x45')]=_[_0x91d9('0x49')](_0x34acb4[_0x91d9('0x45')],{'$or':[{'ListId':_0x345176['id']},{'ListId':null}]});if(_0x18e221['query'][_0x91d9('0x48')]){_0x34acb4[_0x91d9('0x45')]=_[_0x91d9('0x49')](_0x34acb4[_0x91d9('0x45')],{'$or':_[_0x91d9('0x37')](_0x34acb4[_0x91d9('0x41')],function(_0x47f014){var _0x243136={};_0x243136[_0x47f014]={'$like':'%'+_0x18e221[_0x91d9('0x3d')]['filter']+'%'};return _0x243136;})});}_0x34acb4=_[_0x91d9('0x49')]({},_0x34acb4,_0x18e221['options']);return db[_0x91d9('0x6c')]['findAndCountAll'](_0x34acb4);}})[_0x91d9('0x31')](respondWithResult(_0x49572f,null))[_0x91d9('0x4e')](handleError(_0x49572f,null));};exports['getGlobalCustomFields']=function(_0x1ab39e,_0x1227b1){return db[_0x91d9('0x6c')][_0x91d9('0x9c')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x1227b1,null))[_0x91d9('0x31')](function(_0x49fd3c){return _0x49fd3c;})[_0x91d9('0x31')](respondWithResult(_0x1227b1,null))[_0x91d9('0x4e')](handleError(_0x1227b1,null));};exports[_0x91d9('0x9d')]=function(_0x1e54a4,_0x361e1a,_0x3ae674){return db[_0x91d9('0x38')]['find']({'where':{'id':_0x1e54a4[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x361e1a,null))[_0x91d9('0x31')](function(_0x428031){if(_0x428031){return _0x428031[_0x91d9('0x9d')](_0x1e54a4['body'][_0x91d9('0x60')],_[_0x91d9('0x9e')](_0x1e54a4['body'],[_0x91d9('0x60'),'id'])||{})[_0x91d9('0x9f')](function(_0x5cf4bf){for(var _0x1e390f=0x0;_0x1e390f<_0x1e54a4[_0x91d9('0x53')]['ids'][_0x91d9('0x51')];_0x1e390f+=0x1){socket[_0x91d9('0xa0')](_0x91d9('0xa1'),{'UserId':Number(_0x1e54a4[_0x91d9('0x53')][_0x91d9('0x60')][_0x1e390f]),'CmListId':Number(_0x1e54a4[_0x91d9('0x4f')]['id'])});}return _0x5cf4bf;});}})[_0x91d9('0x31')](respondWithResult(_0x361e1a,null))[_0x91d9('0x4e')](handleError(_0x361e1a,null));};exports['removeAgents']=function(_0x1b2a8b,_0x8ddbbc,_0x4e346e){return db[_0x91d9('0x38')][_0x91d9('0x52')]({'where':{'id':_0x1b2a8b[_0x91d9('0x4f')]['id']}})[_0x91d9('0x31')](handleEntityNotFound(_0x8ddbbc,null))[_0x91d9('0x31')](function(_0x64c5b5){if(_0x64c5b5){return _0x64c5b5['removeAgents'](_0x1b2a8b[_0x91d9('0x3d')][_0x91d9('0x60')])[_0x91d9('0x31')](function(){if(_[_0x91d9('0xa2')](_0x1b2a8b['query']['ids'])){for(var _0x452099=0x0;_0x452099<_0x1b2a8b[_0x91d9('0x3d')]['ids'][_0x91d9('0x51')];_0x452099+=0x1){socket[_0x91d9('0xa0')](_0x91d9('0xa3'),{'UserId':Number(_0x1b2a8b[_0x91d9('0x3d')]['ids'][_0x452099]),'CmListId':Number(_0x1b2a8b['params']['id'])});}}else{socket['emit'](_0x91d9('0xa3'),{'UserId':Number(_0x1b2a8b[_0x91d9('0x3d')][_0x91d9('0x60')]),'CmListId':Number(_0x1b2a8b['params']['id'])});}});}})[_0x91d9('0x31')](respondWithStatusCode(_0x8ddbbc,null))[_0x91d9('0x4e')](handleError(_0x8ddbbc,null));};exports['getAgents']=function(_0x3b159a,_0x39bee2,_0x2ff164){var _0x7aafc4={};var _0x39c25b={};var _0x56d9cd;var _0x46b9db;return db[_0x91d9('0x38')][_0x91d9('0x8d')]({'where':{'id':_0x3b159a[_0x91d9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39bee2,null))[_0x91d9('0x31')](function(_0x5a31be){if(_0x5a31be){_0x56d9cd=_0x5a31be;_0x39c25b['model']=_[_0x91d9('0x3e')](db[_0x91d9('0xa4')]['rawAttributes']);_0x39c25b[_0x91d9('0x3d')]=_[_0x91d9('0x3e')](_0x3b159a[_0x91d9('0x3d')]);_0x39c25b[_0x91d9('0x46')]=_['intersection'](_0x39c25b[_0x91d9('0x40')],_0x39c25b[_0x91d9('0x3d')]);_0x7aafc4[_0x91d9('0x41')]=_[_0x91d9('0x3f')](_0x39c25b[_0x91d9('0x40')],qs[_0x91d9('0x50')](_0x3b159a['query']['fields']));_0x7aafc4[_0x91d9('0x41')]=_0x7aafc4[_0x91d9('0x41')]['length']?_0x7aafc4[_0x91d9('0x41')]:_0x39c25b[_0x91d9('0x40')];_0x7aafc4[_0x91d9('0x43')]=qs[_0x91d9('0x44')](_0x3b159a[_0x91d9('0x3d')][_0x91d9('0x44')]);_0x7aafc4[_0x91d9('0x45')]=qs[_0x91d9('0x46')](_[_0x91d9('0x47')](_0x3b159a[_0x91d9('0x3d')],_0x39c25b[_0x91d9('0x46')]));if(_0x3b159a[_0x91d9('0x3d')][_0x91d9('0x48')]){_0x7aafc4[_0x91d9('0x45')]=_['merge'](_0x7aafc4[_0x91d9('0x45')],{'$or':_[_0x91d9('0x37')](_0x7aafc4['attributes'],function(_0x4f9b6c){var _0xb52fa3={};_0xb52fa3[_0x4f9b6c]={'$like':'%'+_0x3b159a[_0x91d9('0x3d')]['filter']+'%'};return _0xb52fa3;})});}_0x7aafc4=_[_0x91d9('0x49')]({},_0x7aafc4,_0x3b159a[_0x91d9('0x4a')]);return _0x56d9cd[_0x91d9('0xa5')](_0x7aafc4);}})[_0x91d9('0x31')](function(_0x387346){if(_0x387346){_0x46b9db=_0x387346[_0x91d9('0x51')];if(!_0x3b159a[_0x91d9('0x3d')][_0x91d9('0x5e')](_0x91d9('0x42'))){_0x7aafc4['limit']=qs[_0x91d9('0x27')](_0x3b159a['query']['limit']);_0x7aafc4['offset']=qs['offset'](_0x3b159a['query']['offset']);}return _0x56d9cd[_0x91d9('0xa5')](_0x7aafc4);}})[_0x91d9('0x31')](function(_0x5efd3b){if(_0x5efd3b){return _0x5efd3b?{'count':_0x46b9db,'rows':_0x5efd3b}:null;}})[_0x91d9('0x31')](respondWithResult(_0x39bee2,null))[_0x91d9('0x4e')](handleError(_0x39bee2,null));};function handleQuery(_0x151cc0){logger[_0x91d9('0xa6')](_0x151cc0);return db[_0x91d9('0x8e')][_0x91d9('0x3d')](_0x151cc0)[_0x91d9('0x9f')](function(_0x57fc7d){csv_results['push'](_0x57fc7d);})[_0x91d9('0x4e')](function(_0x4d8fa8){logger[_0x91d9('0x33')](_0x4d8fa8[_0x91d9('0x69')]);});} \ No newline at end of file +var _0xfa6f=['number','INTEGER','switch','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./cmList.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','Lists','UserProfileResource','end','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','describe','addDisposition','ListId','Disposition','findOne','includeAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','order','raw','getContactsCsv','ContactItemType','OrderBy','select','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','alias','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','description_additionalPhone_','each','toString','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT'];(function(_0x32d709,_0x5a3680){var _0x55ca94=function(_0x5498b5){while(--_0x5498b5){_0x32d709['push'](_0x32d709['shift']());}};_0x55ca94(++_0x5a3680);}(_0xfa6f,0x163));var _0xffa6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfa6f[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xffa6('0x0'));var rimraf=require(_0xffa6('0x1'));var zipdir=require(_0xffa6('0x2'));var jsonpatch=require(_0xffa6('0x3'));var rp=require('request-promise');var moment=require(_0xffa6('0x4'));var BPromise=require(_0xffa6('0x5'));var Mustache=require('mustache');var util=require(_0xffa6('0x6'));var path=require(_0xffa6('0x7'));var sox=require('sox');var csv=require(_0xffa6('0x8'));var ejs=require(_0xffa6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xffa6('0xa'));var squel=require(_0xffa6('0xb'));var crypto=require(_0xffa6('0xc'));var jsforce=require(_0xffa6('0xd'));var deskjs=require(_0xffa6('0xe'));var toCsv=require(_0xffa6('0x8'));var querystring=require(_0xffa6('0xf'));var Papa=require(_0xffa6('0x10'));var Redis=require(_0xffa6('0x11'));var authService=require(_0xffa6('0x12'));var qs=require(_0xffa6('0x13'));var as=require(_0xffa6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xffa6('0x15'));var utils=require(_0xffa6('0x16'));var config=require(_0xffa6('0x17'));var licenseUtil=require(_0xffa6('0x18'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xffa6('0x19')]=_['defaults'](config[_0xffa6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xffa6('0x1a'))(new Redis(config[_0xffa6('0x19')]));require(_0xffa6('0x1b'))['register'](socket);function respondWithStatusCode(_0x16b86d,_0xcfc87c){_0xcfc87c=_0xcfc87c||0xcc;return function(_0x521d88){if(_0x521d88){return _0x16b86d[_0xffa6('0x1c')](_0xcfc87c);}return _0x16b86d['status'](_0xcfc87c)['end']();};}function respondWithResult(_0x520d8d,_0x1e5666){_0x1e5666=_0x1e5666||0xc8;return function(_0x13a3c4){if(_0x13a3c4){return _0x520d8d[_0xffa6('0x1d')](_0x1e5666)[_0xffa6('0x1e')](_0x13a3c4);}};}function respondWithFilteredResult(_0xc2fa31,_0x1c157e){return function(_0x5d1f95){if(_0x5d1f95){var _0x5cfdb5=typeof _0x1c157e[_0xffa6('0x1f')]===_0xffa6('0x20')&&typeof _0x1c157e[_0xffa6('0x21')]===_0xffa6('0x20');var _0x1ff7c2=_0x5d1f95[_0xffa6('0x22')];var _0x5edd36=_0x5cfdb5?0x0:_0x1c157e[_0xffa6('0x1f')];var _0x47df0b=_0x5cfdb5?_0x5d1f95[_0xffa6('0x22')]:_0x1c157e[_0xffa6('0x1f')]+_0x1c157e[_0xffa6('0x21')];var _0x4c5dbe;if(_0x47df0b>=_0x1ff7c2){_0x47df0b=_0x1ff7c2;_0x4c5dbe=0xc8;}else{_0x4c5dbe=0xce;}_0xc2fa31[_0xffa6('0x1d')](_0x4c5dbe);return _0xc2fa31[_0xffa6('0x23')](_0xffa6('0x24'),_0x5edd36+'-'+_0x47df0b+'/'+_0x1ff7c2)[_0xffa6('0x1e')](_0x5d1f95);}return null;};}function patchUpdates(_0x354377){return function(_0x5718b3){try{jsonpatch['apply'](_0x5718b3,_0x354377,!![]);}catch(_0x2b38e7){return BPromise[_0xffa6('0x25')](_0x2b38e7);}return _0x5718b3[_0xffa6('0x26')]();};}function saveUpdates(_0x3263b8,_0x442a43){return function(_0x1cf2b7){if(_0x1cf2b7){return _0x1cf2b7['update'](_0x3263b8)[_0xffa6('0x27')](function(_0x4eebff){return _0x4eebff;});}return null;};}function removeEntity(_0x508f71,_0x3f20dc){return function(_0x17cdaf){if(_0x17cdaf){return _0x17cdaf[_0xffa6('0x28')]()['then'](function(){var _0x20d9d7=_0x17cdaf[_0xffa6('0x29')]({'plain':!![]});var _0x204a87=_0xffa6('0x2a');return db[_0xffa6('0x2b')][_0xffa6('0x28')]({'where':{'type':_0x204a87,'resourceId':_0x20d9d7['id']}})['then'](function(){return _0x17cdaf;});})['then'](function(){_0x508f71['status'](0xcc)[_0xffa6('0x2c')]();});}};}function handleEntityNotFound(_0xc9bb1a,_0x3173c3){return function(_0x565526){if(!_0x565526){_0xc9bb1a['sendStatus'](0x194);}return _0x565526;};}function handleError(_0x2b034a,_0x498085){_0x498085=_0x498085||0x1f4;return function(_0xccd741){logger['error'](_0xccd741[_0xffa6('0x2d')]);if(_0xccd741['name']){delete _0xccd741[_0xffa6('0x2e')];}_0x2b034a[_0xffa6('0x1d')](_0x498085)[_0xffa6('0x2f')](_0xccd741);};}exports[_0xffa6('0x30')]=function(_0x32ffe1,_0x70a280){var _0x327a79={},_0xa42341={},_0x697a41={'count':0x0,'rows':[]};var _0x2e3e4a=_[_0xffa6('0x31')](db[_0xffa6('0x32')][_0xffa6('0x33')],function(_0x3a2407){return{'name':_0x3a2407[_0xffa6('0x34')],'type':_0x3a2407[_0xffa6('0x35')][_0xffa6('0x36')]};});_0xa42341[_0xffa6('0x37')]=_[_0xffa6('0x31')](_0x2e3e4a,'name');_0xa42341[_0xffa6('0x38')]=_[_0xffa6('0x39')](_0x32ffe1[_0xffa6('0x38')]);_0xa42341[_0xffa6('0x3a')]=_[_0xffa6('0x3b')](_0xa42341[_0xffa6('0x37')],_0xa42341[_0xffa6('0x38')]);_0x327a79[_0xffa6('0x3c')]=_[_0xffa6('0x3b')](_0xa42341[_0xffa6('0x37')],qs[_0xffa6('0x3d')](_0x32ffe1[_0xffa6('0x38')][_0xffa6('0x3d')]));_0x327a79[_0xffa6('0x3c')]=_0x327a79['attributes'][_0xffa6('0x3e')]?_0x327a79['attributes']:_0xa42341[_0xffa6('0x37')];if(!_0x32ffe1['query'][_0xffa6('0x3f')](_0xffa6('0x40'))){_0x327a79['limit']=qs[_0xffa6('0x21')](_0x32ffe1[_0xffa6('0x38')]['limit']);_0x327a79[_0xffa6('0x1f')]=qs[_0xffa6('0x1f')](_0x32ffe1['query'][_0xffa6('0x1f')]);}_0x327a79['order']=qs['sort'](_0x32ffe1[_0xffa6('0x38')][_0xffa6('0x41')]);_0x327a79[_0xffa6('0x42')]=qs[_0xffa6('0x3a')](_[_0xffa6('0x43')](_0x32ffe1[_0xffa6('0x38')],_0xa42341[_0xffa6('0x3a')]),_0x2e3e4a);if(_0x32ffe1[_0xffa6('0x38')][_0xffa6('0x44')]){_0x327a79[_0xffa6('0x42')]=_[_0xffa6('0x45')](_0x327a79['where'],{'$or':_[_0xffa6('0x31')](_0x2e3e4a,function(_0x4a718a){if(_0x4a718a[_0xffa6('0x35')]!==_0xffa6('0x46')){var _0x13be83={};_0x13be83[_0x4a718a[_0xffa6('0x2e')]]={'$like':'%'+_0x32ffe1[_0xffa6('0x38')]['filter']+'%'};return _0x13be83;}})});}_0x327a79=_[_0xffa6('0x45')]({},_0x327a79,_0x32ffe1[_0xffa6('0x47')]);var _0x2a47f0={'where':_0x327a79[_0xffa6('0x42')]};return db[_0xffa6('0x32')]['count'](_0x2a47f0)[_0xffa6('0x27')](function(_0x10a768){_0x697a41[_0xffa6('0x22')]=_0x10a768;if(_0x32ffe1[_0xffa6('0x38')]['includeAll']){_0x327a79[_0xffa6('0x48')]=[{'all':!![]}];}return db[_0xffa6('0x32')][_0xffa6('0x49')](_0x327a79);})['then'](function(_0x476d4c){_0x697a41[_0xffa6('0x4a')]=_0x476d4c;return _0x697a41;})[_0xffa6('0x27')](respondWithFilteredResult(_0x70a280,_0x327a79))[_0xffa6('0x4b')](handleError(_0x70a280,null));};exports[_0xffa6('0x4c')]=function(_0x492800,_0x119315){var _0x97daac={'raw':![],'where':{'id':_0x492800['params']['id']}},_0x10768b={};_0x10768b[_0xffa6('0x37')]=_[_0xffa6('0x39')](db['CmList'][_0xffa6('0x33')]);_0x10768b[_0xffa6('0x38')]=_[_0xffa6('0x39')](_0x492800['query']);_0x10768b[_0xffa6('0x3a')]=_[_0xffa6('0x3b')](_0x10768b[_0xffa6('0x37')],_0x10768b[_0xffa6('0x38')]);_0x97daac[_0xffa6('0x3c')]=_[_0xffa6('0x3b')](_0x10768b[_0xffa6('0x37')],qs[_0xffa6('0x3d')](_0x492800['query'][_0xffa6('0x3d')]));_0x97daac[_0xffa6('0x3c')]=_0x97daac['attributes']['length']?_0x97daac[_0xffa6('0x3c')]:_0x10768b['model'];if(_0x492800[_0xffa6('0x38')]['includeAll']){_0x97daac[_0xffa6('0x48')]=[{'all':!![]}];}_0x97daac=_['merge']({},_0x97daac,_0x492800[_0xffa6('0x47')]);return db[_0xffa6('0x32')]['find'](_0x97daac)['then'](handleEntityNotFound(_0x119315,null))[_0xffa6('0x27')](respondWithResult(_0x119315,null))[_0xffa6('0x4b')](handleError(_0x119315,null));};exports[_0xffa6('0x4d')]=function(_0x12d07a,_0x550aa9){return db[_0xffa6('0x32')]['create'](_0x12d07a[_0xffa6('0x4e')],{})['then'](function(_0x37236b){var _0x2bb279=_0x12d07a[_0xffa6('0x4f')][_0xffa6('0x29')]({'plain':!![]});if(!_0x2bb279)throw new Error(_0xffa6('0x50'));if(_0x2bb279[_0xffa6('0x51')]===_0xffa6('0x4f')){var _0x56e06c=_0x37236b[_0xffa6('0x29')]({'plain':!![]});var _0x53d57f=_0xffa6('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x53d57f,'userProfileId':_0x2bb279[_0xffa6('0x52')]},'raw':!![]})[_0xffa6('0x27')](function(_0x392f79){if(_0x392f79&&_0x392f79[_0xffa6('0x53')]===0x0){return db['UserProfileResource'][_0xffa6('0x4d')]({'name':_0x56e06c[_0xffa6('0x2e')],'resourceId':_0x56e06c['id'],'type':_0x392f79[_0xffa6('0x2e')],'sectionId':_0x392f79['id']},{})[_0xffa6('0x27')](function(){return _0x37236b;});}else{return _0x37236b;}})['catch'](function(_0x3e59c5){logger[_0xffa6('0x54')](_0xffa6('0x55'),_0x3e59c5);throw _0x3e59c5;});}return _0x37236b;})[_0xffa6('0x27')](respondWithResult(_0x550aa9,0xc9))[_0xffa6('0x4b')](handleError(_0x550aa9,null));};exports[_0xffa6('0x56')]=function(_0x5b7f3d,_0x4857c3){if(_0x5b7f3d[_0xffa6('0x4e')]['id']){delete _0x5b7f3d[_0xffa6('0x4e')]['id'];}return db[_0xffa6('0x32')][_0xffa6('0x57')]({'where':{'id':_0x5b7f3d[_0xffa6('0x58')]['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x4857c3,null))[_0xffa6('0x27')](saveUpdates(_0x5b7f3d['body'],null))[_0xffa6('0x27')](respondWithResult(_0x4857c3,null))['catch'](handleError(_0x4857c3,null));};exports[_0xffa6('0x28')]=function(_0x2ae2db,_0x472323){return db[_0xffa6('0x32')][_0xffa6('0x57')]({'where':{'id':_0x2ae2db[_0xffa6('0x58')]['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x472323,null))[_0xffa6('0x27')](removeEntity(_0x472323,null))[_0xffa6('0x4b')](handleError(_0x472323,null));};exports[_0xffa6('0x59')]=function(_0x3edb9e,_0x5696e0){return db[_0xffa6('0x32')]['describe']()['then'](respondWithResult(_0x5696e0,null))['catch'](handleError(_0x5696e0,null));};exports[_0xffa6('0x5a')]=function(_0x15b9d0,_0x55053f,_0xfabfec){if(_0x15b9d0[_0xffa6('0x4e')]['id']){delete _0x15b9d0['body']['id'];}return db[_0xffa6('0x32')][_0xffa6('0x57')]({'where':{'id':_0x15b9d0[_0xffa6('0x58')]['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x55053f,null))[_0xffa6('0x27')](function(_0x2f8cad){if(_0x2f8cad){_0x15b9d0[_0xffa6('0x4e')][_0xffa6('0x5b')]=_0x2f8cad['id'];return db[_0xffa6('0x5c')]['create'](_0x15b9d0[_0xffa6('0x4e')]);}})[_0xffa6('0x27')](respondWithResult(_0x55053f,null))[_0xffa6('0x4b')](handleError(_0x55053f,null));};exports['getDispositions']=function(_0x3ebd09,_0x45f28e,_0x42e240){var _0x2685f3={'raw':![],'where':{}};var _0x23c7ab={};var _0x2daf6e={'count':0x0,'rows':[]};return db['CmList'][_0xffa6('0x5d')]({'where':{'id':_0x3ebd09['params']['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x45f28e,null))[_0xffa6('0x27')](function(_0x22fc64){if(_0x22fc64){_0x23c7ab['model']=_[_0xffa6('0x39')](db[_0xffa6('0x5c')][_0xffa6('0x33')]);_0x23c7ab[_0xffa6('0x38')]=_[_0xffa6('0x39')](_0x3ebd09['query']);_0x23c7ab[_0xffa6('0x3a')]=_[_0xffa6('0x3b')](_0x23c7ab['model'],_0x23c7ab['query']);_0x2685f3['attributes']=_[_0xffa6('0x3b')](_0x23c7ab['model'],qs[_0xffa6('0x3d')](_0x3ebd09[_0xffa6('0x38')][_0xffa6('0x3d')]));_0x2685f3[_0xffa6('0x3c')]=_0x2685f3[_0xffa6('0x3c')]['length']?_0x2685f3[_0xffa6('0x3c')]:_0x23c7ab[_0xffa6('0x37')];if(!_0x3ebd09[_0xffa6('0x38')][_0xffa6('0x3f')]('nolimit')){_0x2685f3[_0xffa6('0x21')]=qs[_0xffa6('0x21')](_0x3ebd09[_0xffa6('0x38')]['limit']);_0x2685f3['offset']=qs[_0xffa6('0x1f')](_0x3ebd09['query']['offset']);}_0x2685f3['order']=qs[_0xffa6('0x41')](_0x3ebd09[_0xffa6('0x38')][_0xffa6('0x41')]);_0x2685f3[_0xffa6('0x42')]=qs['filters'](_['pick'](_0x3ebd09[_0xffa6('0x38')],_0x23c7ab['filters']));_0x2685f3[_0xffa6('0x42')][_0xffa6('0x5b')]=_0x22fc64['id'];if(_0x3ebd09[_0xffa6('0x38')]['filter']){_0x2685f3[_0xffa6('0x42')]=_[_0xffa6('0x45')](_0x2685f3[_0xffa6('0x42')],{'$or':_[_0xffa6('0x31')](_0x2685f3[_0xffa6('0x3c')],function(_0x5301ab){var _0x58d982={};_0x58d982[_0x5301ab]={'$like':'%'+_0x3ebd09[_0xffa6('0x38')][_0xffa6('0x44')]+'%'};return _0x58d982;})});}_0x2685f3=_['merge']({},_0x2685f3,_0x3ebd09[_0xffa6('0x47')]);return db[_0xffa6('0x5c')][_0xffa6('0x22')]({'where':_0x2685f3[_0xffa6('0x42')]})[_0xffa6('0x27')](function(_0xe1355){_0x2daf6e['count']=_0xe1355;if(_0x3ebd09[_0xffa6('0x38')][_0xffa6('0x5e')]){_0x2685f3[_0xffa6('0x48')]=[{'all':!![]}];}return db[_0xffa6('0x5c')][_0xffa6('0x49')](_0x2685f3);})['then'](function(_0x178b5f){_0x2daf6e[_0xffa6('0x4a')]=_0x178b5f;return _0x2daf6e;});}})[_0xffa6('0x27')](respondWithFilteredResult(_0x45f28e,_0x2685f3))[_0xffa6('0x4b')](handleError(_0x45f28e,null));};exports[_0xffa6('0x5f')]=function(_0x3f6e19,_0x2a577a,_0x9a3816){return db[_0xffa6('0x32')]['find']({'where':{'id':_0x3f6e19['params']['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x2a577a,null))[_0xffa6('0x27')](function(_0x5d7da6){if(_0x5d7da6){return _0x5d7da6['removeDispositions'](_0x3f6e19['query'][_0xffa6('0x60')]);}})[_0xffa6('0x27')](respondWithStatusCode(_0x2a577a,null))['catch'](handleError(_0x2a577a,null));};exports[_0xffa6('0x61')]=function(_0x3e5fcf,_0x417ebe,_0x163d89){return db[_0xffa6('0x32')]['find']({'where':{'id':_0x3e5fcf[_0xffa6('0x58')]['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x417ebe,null))[_0xffa6('0x27')](function(_0x1516c6){if(_0x1516c6){var _0x16449f=[];var _0x28ca66={'success':[],'errors':[]};return db[_0xffa6('0x62')][_0xffa6('0x59')]()[_0xffa6('0x27')](function(_0x2adba5){if(_0x3e5fcf[_0xffa6('0x4e')][_0xffa6('0x63')]&&_[_0xffa6('0x64')](_0x3e5fcf['body'][_0xffa6('0x63')])){if(_0x3e5fcf[_0xffa6('0x4e')][_0xffa6('0x63')][_0xffa6('0x3e')]){_0x3e5fcf[_0xffa6('0x4e')][_0xffa6('0x63')]=_0x3e5fcf[_0xffa6('0x4e')][_0xffa6('0x63')][_0xffa6('0x65')](';')+';';}else{_0x3e5fcf[_0xffa6('0x4e')][_0xffa6('0x63')]=null;}}else{_0x3e5fcf[_0xffa6('0x4e')][_0xffa6('0x63')]=null;}if(_0x3e5fcf[_0xffa6('0x4e')]&&_[_0xffa6('0x64')](_0x3e5fcf[_0xffa6('0x4e')])){for(var _0x1f74c4=0x0;_0x1f74c4<_0x3e5fcf['body']['length'];_0x1f74c4+=0x1){_0x3e5fcf[_0xffa6('0x4e')][_0x1f74c4]['ListId']=_0x3e5fcf[_0xffa6('0x58')]['id'];_0x16449f[_0xffa6('0x66')](_0x3e5fcf['body'][_0x1f74c4]);}return BPromise['each'](_0x16449f,function(_0x576437){return db[_0xffa6('0x62')][_0xffa6('0x4d')](_[_0xffa6('0x67')](_0x576437,[_0xffa6('0x60'),'id'])||{},{'fields':_[_0xffa6('0x39')](_0x2adba5),'raw':!![]})[_0xffa6('0x27')](function(_0x2f417a){_0x28ca66[_0xffa6('0x68')]['push'](_0x2f417a[_0xffa6('0x69')]);})['catch'](function(_0x3f05ed){_0x28ca66[_0xffa6('0x6a')][_0xffa6('0x66')]({'data':_0x576437,'error':_0x3f05ed[_0xffa6('0x6b')]});});})['then'](function(_0x38449b){return _0x28ca66;})[_0xffa6('0x4b')](function(_0x2dab3b){return _0x2dab3b;});}else{_0x417ebe[_0xffa6('0x1d')](0x190)[_0xffa6('0x1e')]({'message':_0xffa6('0x6c')});}});}})[_0xffa6('0x27')](respondWithResult(_0x417ebe,null))[_0xffa6('0x4b')](handleError(_0x417ebe,null));};exports[_0xffa6('0x6d')]=function(_0x3c53de,_0x2dfbaa,_0xfe83d){var _0x146995;return db[_0xffa6('0x32')][_0xffa6('0x57')]({'where':{'id':_0x3c53de[_0xffa6('0x58')]['id']},'include':[{'model':db[_0xffa6('0x6e')],'as':_0xffa6('0x6f')}]})['then'](handleEntityNotFound(_0x2dfbaa,null))[_0xffa6('0x27')](function(_0x10fd23){if(_0x10fd23){_0x146995=_0x10fd23;return db['CmContact'][_0xffa6('0x33')];}})[_0xffa6('0x27')](function(_0x12a20b){if(_0x12a20b){var _0x174942={};var _0x4b6031={};_0x4b6031[_0xffa6('0x37')]=_[_0xffa6('0x70')](_[_0xffa6('0x39')](_0x12a20b),_['map'](_0x146995[_0xffa6('0x6f')],function(_0x3038a0){return util[_0xffa6('0x71')](_0xffa6('0x72'),_0x3038a0['id']);}));_0x4b6031['query']=_[_0xffa6('0x39')](_0x3c53de[_0xffa6('0x38')]);_0x4b6031['filters']=_[_0xffa6('0x3b')](_0x4b6031[_0xffa6('0x37')],_0x4b6031[_0xffa6('0x38')]);_0x174942['attributes']=_['intersection'](_0x4b6031[_0xffa6('0x37')],qs['fields'](_0x3c53de[_0xffa6('0x38')]['fields']));_0x174942[_0xffa6('0x3c')]=_0x174942[_0xffa6('0x3c')][_0xffa6('0x3e')]?_0x174942[_0xffa6('0x3c')]:_0x4b6031[_0xffa6('0x37')];if(!_0x3c53de[_0xffa6('0x38')][_0xffa6('0x3f')](_0xffa6('0x40'))){_0x174942[_0xffa6('0x21')]=qs[_0xffa6('0x21')](_0x3c53de[_0xffa6('0x38')][_0xffa6('0x21')]);_0x174942[_0xffa6('0x1f')]=qs[_0xffa6('0x1f')](_0x3c53de['query'][_0xffa6('0x1f')]);}_0x174942[_0xffa6('0x73')]=qs['sort'](_0x3c53de[_0xffa6('0x38')][_0xffa6('0x41')]);_0x174942[_0xffa6('0x42')]=qs[_0xffa6('0x3a')](_[_0xffa6('0x43')](_0x3c53de[_0xffa6('0x38')],_0x4b6031[_0xffa6('0x3a')]));_0x174942[_0xffa6('0x74')]=!![];if(_0x3c53de[_0xffa6('0x38')][_0xffa6('0x44')]){_0x174942[_0xffa6('0x42')]=_['merge'](_0x174942[_0xffa6('0x42')],{'$or':_[_0xffa6('0x31')](_0x174942[_0xffa6('0x3c')],function(_0x1f3a84){var _0x260fe5={};_0x260fe5[_0x1f3a84]={'$like':'%'+_0x3c53de['query'][_0xffa6('0x44')]+'%'};return _0x260fe5;})});}_0x174942=_[_0xffa6('0x45')]({},_0x174942,_0x3c53de['options']);return _0x146995[_0xffa6('0x6d')](_0x174942);}})[_0xffa6('0x27')](respondWithResult(_0x2dfbaa,null))['catch'](handleError(_0x2dfbaa,null));};exports[_0xffa6('0x75')]=function(_0x4c8fc1,_0x51d5b1,_0x144d89){var _0xe86fa4;var _0xb9f3fb;var _0x5df0a1;var _0x1383c3=_0x4c8fc1[_0xffa6('0x58')]['id'];csv_results=[];return db[_0xffa6('0x76')]['findAll']({'attributes':['id',_0xffa6('0x2e')],'raw':!![],'order':[_0xffa6('0x77')]})['then'](function(_0x3459c7){_0xe86fa4=_0x3459c7;var _0x2ed00f=_['keys'](db[_0xffa6('0x62')][_0xffa6('0x33')]);return db[_0xffa6('0x6e')][_0xffa6('0x49')]({'raw':!![],'attributes':['id','alias']})[_0xffa6('0x27')](function(_0x1676a7){_0xb9f3fb=_0x1676a7;var _0x113a18=squel[_0xffa6('0x78')]()['fields'](_0x2ed00f)['from']('cm_contacts','c')['where'](_0xffa6('0x79'),_0x1383c3)[_0xffa6('0x42')](_0xffa6('0x7a'))[_0xffa6('0x7b')]();for(var _0x37f706=0x0;_0x37f706<_0xb9f3fb[_0xffa6('0x3e')];_0x37f706++){_0x113a18[_0xffa6('0x7c')](_0xffa6('0x7d')+_0xb9f3fb[_0x37f706]['id'],_0xffa6('0x7e')+_0xb9f3fb[_0x37f706][_0xffa6('0x7f')]);}for(var _0x37f706=0x0;_0x37f706<_0xe86fa4[_0xffa6('0x3e')];_0x37f706++){_0x113a18[_0xffa6('0x7c')](squel[_0xffa6('0x78')]()[_0xffa6('0x7c')](_0xffa6('0x80'))[_0xffa6('0x81')](_0xffa6('0x82'))[_0xffa6('0x42')](_0xffa6('0x83'),_0xe86fa4[_0x37f706]['id'])[_0xffa6('0x42')](_0xffa6('0x84')),'additionalPhone_'+_0xe86fa4[_0x37f706][_0xffa6('0x2e')]);_0x113a18['field'](squel[_0xffa6('0x78')]()[_0xffa6('0x7c')](_0xffa6('0x85'))[_0xffa6('0x81')](_0xffa6('0x82'))[_0xffa6('0x42')](_0xffa6('0x83'),_0xe86fa4[_0x37f706]['id'])[_0xffa6('0x42')](_0xffa6('0x84')),_0xffa6('0x86')+_0xe86fa4[_0x37f706][_0xffa6('0x2e')]);}var _0x24dea3=[];_0x24dea3[_0xffa6('0x66')](_0x113a18['toString']());BPromise[_0xffa6('0x87')](_0x24dea3,handleQuery)[_0xffa6('0x27')](function(_0x58a9de){handleQuery(_0x113a18[_0xffa6('0x88')]());var _0x31b33b=csv_results[0x0];if(!_[_0xffa6('0x89')](_0x31b33b)){var _0xf1aefa=toCsv(_0x31b33b);var _0x26f804=Date['now']();fs[_0xffa6('0x8a')](util[_0xffa6('0x71')](_0xffa6('0x8b'),_0x1383c3,_0x26f804),_0xf1aefa);_0x51d5b1['setHeader']('Content-disposition',_0xffa6('0x8c')+util[_0xffa6('0x71')](_0xffa6('0x8d'),_0x1383c3,_0x26f804));_0x51d5b1[_0xffa6('0x8e')](_0xffa6('0x8f'),_0xffa6('0x90'));return _0x51d5b1[_0xffa6('0x91')](util['format'](_0xffa6('0x8b'),_0x1383c3,_0x26f804));}else{return _0x51d5b1['sendStatus'](0xcc);}});});});};exports[_0xffa6('0x92')]=function(_0x41fb3e,_0x3db178,_0x43a7c9){var _0x4afe3b;delete _0x41fb3e[_0xffa6('0x4e')]['id'];return db[_0xffa6('0x32')]['findOne']({'where':{'id':_0x41fb3e[_0xffa6('0x58')]['id']}})['then'](handleEntityNotFound(_0x3db178,null))[_0xffa6('0x27')](function(_0x56be58){if(_0x56be58){return db[_0xffa6('0x93')][_0xffa6('0x94')](function(_0x37951f){return db[_0xffa6('0x6e')][_0xffa6('0x4d')](_0x41fb3e[_0xffa6('0x4e')],{'transaction':_0x37951f})[_0xffa6('0x27')](function(_0x398880){_0x4afe3b=_0x398880;return _0x56be58[_0xffa6('0x95')](_0x398880,{'transaction':_0x37951f});})['then'](function(){var _0x2139c8={'type':db[_0xffa6('0x96')][_0xffa6('0x97')],'transaction':_0x37951f};switch(_0x41fb3e[_0xffa6('0x4e')][_0xffa6('0x35')]){case'text':_0x2139c8[_0xffa6('0x35')]=db[_0xffa6('0x96')][_0xffa6('0x97')];break;case _0xffa6('0x98'):_0x2139c8[_0xffa6('0x35')]=db['Sequelize'][_0xffa6('0x99')];break;case _0xffa6('0x9a'):_0x2139c8[_0xffa6('0x35')]=db[_0xffa6('0x96')]['BOOLEAN'];_0x2139c8[_0xffa6('0x9b')]=![];break;default:}return db[_0xffa6('0x93')][_0xffa6('0x9c')][_0xffa6('0x9d')]('cm_contacts',util[_0xffa6('0x71')](_0xffa6('0x9e'),_0x4afe3b['id']),_0x2139c8);})[_0xffa6('0x27')](function(){return _0x4afe3b;});});}})[_0xffa6('0x27')](respondWithResult(_0x3db178,null))[_0xffa6('0x4b')](handleError(_0x3db178,null));};exports[_0xffa6('0x9f')]=function(_0x2c208e,_0x5c4795,_0x39fff9){var _0x143f5b={};var _0x1b13a9={};var _0x22cd79;var _0x2cf54b;return db[_0xffa6('0x32')][_0xffa6('0x5d')]({'where':{'id':_0x2c208e[_0xffa6('0x58')]['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x5c4795,null))['then'](function(_0x514610){if(_0x514610){_0x22cd79=_0x514610;_0x1b13a9['model']=_['keys'](db['CmCustomField'][_0xffa6('0x33')]);_0x1b13a9[_0xffa6('0x38')]=_[_0xffa6('0x39')](_0x2c208e[_0xffa6('0x38')]);_0x1b13a9['filters']=_[_0xffa6('0x3b')](_0x1b13a9[_0xffa6('0x37')],_0x1b13a9[_0xffa6('0x38')]);_0x143f5b[_0xffa6('0x3c')]=_[_0xffa6('0x3b')](_0x1b13a9[_0xffa6('0x37')],qs[_0xffa6('0x3d')](_0x2c208e['query'][_0xffa6('0x3d')]));_0x143f5b[_0xffa6('0x3c')]=_0x143f5b['attributes'][_0xffa6('0x3e')]?_0x143f5b[_0xffa6('0x3c')]:_0x1b13a9[_0xffa6('0x37')];_0x143f5b[_0xffa6('0x73')]=qs[_0xffa6('0x41')](_0x2c208e[_0xffa6('0x38')]['sort']);_0x143f5b['where']=qs[_0xffa6('0x3a')](_[_0xffa6('0x43')](_0x2c208e[_0xffa6('0x38')],_0x1b13a9['filters']));_0x143f5b[_0xffa6('0x42')]=_[_0xffa6('0x45')](_0x143f5b[_0xffa6('0x42')],{'$or':[{'ListId':_0x514610['id']},{'ListId':null}]});if(_0x2c208e[_0xffa6('0x38')]['filter']){_0x143f5b[_0xffa6('0x42')]=_['merge'](_0x143f5b[_0xffa6('0x42')],{'$or':_[_0xffa6('0x31')](_0x143f5b[_0xffa6('0x3c')],function(_0x137d01){var _0x5af9c5={};_0x5af9c5[_0x137d01]={'$like':'%'+_0x2c208e[_0xffa6('0x38')][_0xffa6('0x44')]+'%'};return _0x5af9c5;})});}_0x143f5b=_[_0xffa6('0x45')]({},_0x143f5b,_0x2c208e[_0xffa6('0x47')]);return db[_0xffa6('0x6e')][_0xffa6('0xa0')](_0x143f5b);}})[_0xffa6('0x27')](respondWithResult(_0x5c4795,null))[_0xffa6('0x4b')](handleError(_0x5c4795,null));};exports[_0xffa6('0xa1')]=function(_0x1eed47,_0x2c122e){return db[_0xffa6('0x6e')][_0xffa6('0xa0')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x2c122e,null))[_0xffa6('0x27')](function(_0x30ff0c){return _0x30ff0c;})['then'](respondWithResult(_0x2c122e,null))['catch'](handleError(_0x2c122e,null));};exports[_0xffa6('0xa2')]=function(_0x1e9178,_0x3941d5,_0x2bc766){return db[_0xffa6('0x32')]['find']({'where':{'id':_0x1e9178[_0xffa6('0x58')]['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x3941d5,null))[_0xffa6('0x27')](function(_0x1b0681){if(_0x1b0681){return _0x1b0681['addAgents'](_0x1e9178[_0xffa6('0x4e')][_0xffa6('0x60')],_[_0xffa6('0x67')](_0x1e9178[_0xffa6('0x4e')],[_0xffa6('0x60'),'id'])||{})[_0xffa6('0xa3')](function(_0x1d5390){for(var _0x20d530=0x0;_0x20d530<_0x1e9178['body'][_0xffa6('0x60')][_0xffa6('0x3e')];_0x20d530+=0x1){socket[_0xffa6('0xa4')](_0xffa6('0xa5'),{'UserId':Number(_0x1e9178[_0xffa6('0x4e')][_0xffa6('0x60')][_0x20d530]),'CmListId':Number(_0x1e9178[_0xffa6('0x58')]['id'])});}return _0x1d5390;});}})['then'](respondWithResult(_0x3941d5,null))[_0xffa6('0x4b')](handleError(_0x3941d5,null));};exports[_0xffa6('0xa6')]=function(_0x5c23b7,_0x1ba51d,_0x542b8e){return db[_0xffa6('0x32')][_0xffa6('0x57')]({'where':{'id':_0x5c23b7['params']['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x1ba51d,null))[_0xffa6('0x27')](function(_0x50bfa6){if(_0x50bfa6){return _0x50bfa6[_0xffa6('0xa6')](_0x5c23b7[_0xffa6('0x38')]['ids'])[_0xffa6('0x27')](function(){if(_[_0xffa6('0x64')](_0x5c23b7[_0xffa6('0x38')][_0xffa6('0x60')])){for(var _0x1bd615=0x0;_0x1bd615<_0x5c23b7[_0xffa6('0x38')]['ids']['length'];_0x1bd615+=0x1){socket[_0xffa6('0xa4')](_0xffa6('0xa7'),{'UserId':Number(_0x5c23b7[_0xffa6('0x38')]['ids'][_0x1bd615]),'CmListId':Number(_0x5c23b7[_0xffa6('0x58')]['id'])});}}else{socket[_0xffa6('0xa4')]('userCmList:remove',{'UserId':Number(_0x5c23b7[_0xffa6('0x38')][_0xffa6('0x60')]),'CmListId':Number(_0x5c23b7[_0xffa6('0x58')]['id'])});}});}})[_0xffa6('0x27')](respondWithStatusCode(_0x1ba51d,null))[_0xffa6('0x4b')](handleError(_0x1ba51d,null));};exports[_0xffa6('0xa8')]=function(_0x55aa8e,_0x29721b,_0xb8b0d2){var _0x5aed4d={};var _0x5be6e2={};var _0x5b6acc;var _0x58b53f;return db['CmList'][_0xffa6('0x5d')]({'where':{'id':_0x55aa8e[_0xffa6('0x58')]['id']}})[_0xffa6('0x27')](handleEntityNotFound(_0x29721b,null))[_0xffa6('0x27')](function(_0x294308){if(_0x294308){_0x5b6acc=_0x294308;_0x5be6e2[_0xffa6('0x37')]=_[_0xffa6('0x39')](db['User'][_0xffa6('0x33')]);_0x5be6e2[_0xffa6('0x38')]=_[_0xffa6('0x39')](_0x55aa8e[_0xffa6('0x38')]);_0x5be6e2[_0xffa6('0x3a')]=_[_0xffa6('0x3b')](_0x5be6e2[_0xffa6('0x37')],_0x5be6e2[_0xffa6('0x38')]);_0x5aed4d[_0xffa6('0x3c')]=_[_0xffa6('0x3b')](_0x5be6e2[_0xffa6('0x37')],qs[_0xffa6('0x3d')](_0x55aa8e[_0xffa6('0x38')]['fields']));_0x5aed4d[_0xffa6('0x3c')]=_0x5aed4d[_0xffa6('0x3c')][_0xffa6('0x3e')]?_0x5aed4d[_0xffa6('0x3c')]:_0x5be6e2[_0xffa6('0x37')];_0x5aed4d[_0xffa6('0x73')]=qs[_0xffa6('0x41')](_0x55aa8e['query'][_0xffa6('0x41')]);_0x5aed4d[_0xffa6('0x42')]=qs['filters'](_[_0xffa6('0x43')](_0x55aa8e[_0xffa6('0x38')],_0x5be6e2[_0xffa6('0x3a')]));if(_0x55aa8e[_0xffa6('0x38')][_0xffa6('0x44')]){_0x5aed4d[_0xffa6('0x42')]=_['merge'](_0x5aed4d[_0xffa6('0x42')],{'$or':_[_0xffa6('0x31')](_0x5aed4d[_0xffa6('0x3c')],function(_0x28d766){var _0x1ad5d2={};_0x1ad5d2[_0x28d766]={'$like':'%'+_0x55aa8e[_0xffa6('0x38')][_0xffa6('0x44')]+'%'};return _0x1ad5d2;})});}_0x5aed4d=_[_0xffa6('0x45')]({},_0x5aed4d,_0x55aa8e[_0xffa6('0x47')]);return _0x5b6acc[_0xffa6('0xa8')](_0x5aed4d);}})[_0xffa6('0x27')](function(_0x23aecb){if(_0x23aecb){_0x58b53f=_0x23aecb[_0xffa6('0x3e')];if(!_0x55aa8e[_0xffa6('0x38')][_0xffa6('0x3f')](_0xffa6('0x40'))){_0x5aed4d[_0xffa6('0x21')]=qs[_0xffa6('0x21')](_0x55aa8e[_0xffa6('0x38')][_0xffa6('0x21')]);_0x5aed4d[_0xffa6('0x1f')]=qs[_0xffa6('0x1f')](_0x55aa8e[_0xffa6('0x38')]['offset']);}return _0x5b6acc[_0xffa6('0xa8')](_0x5aed4d);}})['then'](function(_0x1c06f3){if(_0x1c06f3){return _0x1c06f3?{'count':_0x58b53f,'rows':_0x1c06f3}:null;}})[_0xffa6('0x27')](respondWithResult(_0x29721b,null))[_0xffa6('0x4b')](handleError(_0x29721b,null));};function handleQuery(_0x574ab1){logger['info'](_0x574ab1);return db[_0xffa6('0x93')][_0xffa6('0x38')](_0x574ab1)[_0xffa6('0xa3')](function(_0xd42a09){csv_results[_0xffa6('0x66')](_0xd42a09);})['catch'](function(_0x3b54b8){logger['error'](_0x3b54b8[_0xffa6('0x6b')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 03723d1..5d05d5a 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x30aa8a,_0x8b1742){var _0x4c4340=function(_0x6b999a){while(--_0x6b999a){_0x30aa8a['push'](_0x30aa8a['shift']());}};_0x4c4340(++_0x8b1742);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x55ca,0x126));var _0xa55c=function(_0x13ae3b,_0x4ddd7c){_0x13ae3b=_0x13ae3b-0x0;var _0x145764=_0x55ca[_0x13ae3b];return _0x145764;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index abb0577..d36cf98 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 _0xf109=['CmList','cm_lists','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x1b58e3,_0x4e4566){var _0x2f3de2=function(_0x268703){while(--_0x268703){_0x1b58e3['push'](_0x1b58e3['shift']());}};_0x2f3de2(++_0x4e4566);}(_0xf109,0xce));var _0x9f10=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xf109[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f7a=['CmList','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x2a655d,_0x56a557){_0x2a655d=_0x2a655d-0x0;var _0x24d4dd=_0x6f7a[_0x2a655d];return _0x24d4dd;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var moment=require('moment');var BPromise=require(_0xa6f7('0x4'));var rp=require(_0xa6f7('0x5'));var fs=require('fs');var path=require(_0xa6f7('0x6'));var rimraf=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var attributes=require(_0xa6f7('0x9'));module[_0xa6f7('0xa')]=function(_0x20cccd,_0x1fdd5f){return _0x20cccd[_0xa6f7('0xb')](_0xa6f7('0xc'),attributes,{'tableName':'cm_lists','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 e85743b..e964058 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 _0xe0f0=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','randomstring'];(function(_0x528b78,_0x549ea2){var _0x6b01ee=function(_0x4f1db4){while(--_0x4f1db4){_0x528b78['push'](_0x528b78['shift']());}};_0x6b01ee(++_0x549ea2);}(_0xe0f0,0x16c));var _0x0e0f=function(_0x9a307,_0x502f7b){_0x9a307=_0x9a307-0x0;var _0x254590=_0xe0f0[_0x9a307];return _0x254590;};'use strict';var _=require(_0x0e0f('0x0'));var util=require(_0x0e0f('0x1'));var moment=require(_0x0e0f('0x2'));var BPromise=require('bluebird');var rs=require(_0x0e0f('0x3'));var fs=require('fs');var Redis=require(_0x0e0f('0x4'));var db=require(_0x0e0f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0e0f('0x6'))(_0x0e0f('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e0f('0x8'));var client=jayson['client'][_0x0e0f('0x9')]({'port':0x232a});config[_0x0e0f('0xa')]=_[_0x0e0f('0xb')](config[_0x0e0f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e0f('0xc'))(new Redis(config[_0x0e0f('0xa')]));require(_0x0e0f('0xd'))[_0x0e0f('0xe')](socket);function respondWithRpcPromise(_0x44bab8,_0x40b909,_0x3cb1b4){return new BPromise(function(_0x4888f1,_0x1a5119){return client[_0x0e0f('0xf')](_0x44bab8,_0x3cb1b4)['then'](function(_0x47c140){logger[_0x0e0f('0x10')](_0x0e0f('0x11'),_0x40b909,_0x0e0f('0x12'));logger[_0x0e0f('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x40b909,_0x0e0f('0x12'),JSON['stringify'](_0x47c140));if(_0x47c140[_0x0e0f('0x14')]){if(_0x47c140[_0x0e0f('0x14')]['code']===0x1f4){logger[_0x0e0f('0x14')](_0x0e0f('0x11'),_0x40b909,_0x47c140[_0x0e0f('0x14')][_0x0e0f('0x15')]);return _0x1a5119(_0x47c140[_0x0e0f('0x14')][_0x0e0f('0x15')]);}logger[_0x0e0f('0x14')](_0x0e0f('0x11'),_0x40b909,_0x47c140[_0x0e0f('0x14')][_0x0e0f('0x15')]);return _0x4888f1(_0x47c140['error'][_0x0e0f('0x15')]);}else{logger[_0x0e0f('0x10')]('CmList,\x20%s,\x20%s',_0x40b909,_0x0e0f('0x12'));_0x4888f1(_0x47c140['result'][_0x0e0f('0x15')]);}})[_0x0e0f('0x16')](function(_0x1e7138){logger[_0x0e0f('0x14')]('CmList,\x20%s,\x20%s',_0x40b909,_0x1e7138);_0x1a5119(_0x1e7138);});});} \ No newline at end of file +var _0xf71d=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird'];(function(_0x3f66a9,_0x235b1c){var _0x328e76=function(_0x5ef037){while(--_0x5ef037){_0x3f66a9['push'](_0x3f66a9['shift']());}};_0x328e76(++_0x235b1c);}(_0xf71d,0x195));var _0xdf71=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xf71d[_0x209ec9];return _0x129b1b;};'use strict';var _=require('lodash');var util=require(_0xdf71('0x0'));var moment=require(_0xdf71('0x1'));var BPromise=require(_0xdf71('0x2'));var rs=require(_0xdf71('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf71('0x4'))['db'];var utils=require(_0xdf71('0x5'));var logger=require(_0xdf71('0x6'))('rpc');var config=require(_0xdf71('0x7'));var jayson=require(_0xdf71('0x8'));var client=jayson[_0xdf71('0x9')][_0xdf71('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xdf71('0xb'),'port':0x18eb});var socket=require(_0xdf71('0xc'))(new Redis(config['redis']));require('./cmList.socket')[_0xdf71('0xd')](socket);function respondWithRpcPromise(_0x44b9c7,_0x1c6a63,_0x26c85e){return new BPromise(function(_0x425890,_0x11339e){return client[_0xdf71('0xe')](_0x44b9c7,_0x26c85e)[_0xdf71('0xf')](function(_0x5538c8){logger[_0xdf71('0x10')](_0xdf71('0x11'),_0x1c6a63,_0xdf71('0x12'));logger['debug'](_0xdf71('0x13'),_0x1c6a63,'request\x20sent',JSON['stringify'](_0x5538c8));if(_0x5538c8[_0xdf71('0x14')]){if(_0x5538c8['error']['code']===0x1f4){logger[_0xdf71('0x14')](_0xdf71('0x11'),_0x1c6a63,_0x5538c8[_0xdf71('0x14')][_0xdf71('0x15')]);return _0x11339e(_0x5538c8[_0xdf71('0x14')][_0xdf71('0x15')]);}logger['error'](_0xdf71('0x11'),_0x1c6a63,_0x5538c8['error']['message']);return _0x425890(_0x5538c8[_0xdf71('0x14')][_0xdf71('0x15')]);}else{logger[_0xdf71('0x10')](_0xdf71('0x11'),_0x1c6a63,_0xdf71('0x12'));_0x425890(_0x5538c8[_0xdf71('0x16')][_0xdf71('0x15')]);}})[_0xdf71('0x17')](function(_0x37d3b4){logger[_0xdf71('0x14')](_0xdf71('0x11'),_0x1c6a63,_0x37d3b4);_0x11339e(_0x37d3b4);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index e3f47b0..8fc8cd0 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 _0x2cf7=['./cmList.events','save','update','emit','removeListener','register','length','cmList:'];(function(_0xa1c675,_0x3a51c2){var _0x5ad15b=function(_0x25c030){while(--_0x25c030){_0xa1c675['push'](_0xa1c675['shift']());}};_0x5ad15b(++_0x3a51c2);}(_0x2cf7,0x120));var _0x72cf=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0x2cf7[_0x2dacca];return _0x4e8745;};'use strict';var CmListEvents=require(_0x72cf('0x0'));var events=[_0x72cf('0x1'),'remove',_0x72cf('0x2')];function createListener(_0x46946a,_0x1c4bb6){return function(_0x18798e){_0x1c4bb6[_0x72cf('0x3')](_0x46946a,_0x18798e);};}function removeListener(_0x5b2645,_0x15f504){return function(){CmListEvents[_0x72cf('0x4')](_0x5b2645,_0x15f504);};}exports[_0x72cf('0x5')]=function(_0x1da313){for(var _0x54200c=0x0,_0x3435f2=events[_0x72cf('0x6')];_0x54200c<_0x3435f2;_0x54200c++){var _0x18e4dd=events[_0x54200c];var _0x27831a=createListener(_0x72cf('0x7')+_0x18e4dd,_0x1da313);CmListEvents['on'](_0x18e4dd,_0x27831a);}}; \ No newline at end of file +var _0x1316=['length','cmList:','./cmList.events','save','remove','removeListener'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x1316,0x164));var _0x6131=function(_0x38a39e,_0x316c2e){_0x38a39e=_0x38a39e-0x0;var _0x1f89c0=_0x1316[_0x38a39e];return _0x1f89c0;};'use strict';var CmListEvents=require(_0x6131('0x0'));var events=[_0x6131('0x1'),_0x6131('0x2'),'update'];function createListener(_0x364c01,_0x17c436){return function(_0x1cb7ed){_0x17c436['emit'](_0x364c01,_0x1cb7ed);};}function removeListener(_0x30d2be,_0x5da51f){return function(){CmListEvents[_0x6131('0x3')](_0x30d2be,_0x5da51f);};}exports['register']=function(_0x10de2b){for(var _0x52fc69=0x0,_0x221b8d=events[_0x6131('0x4')];_0x52fc69<_0x221b8d;_0x52fc69++){var _0x140664=events[_0x52fc69];var _0x46e1c5=createListener(_0x6131('0x5')+_0x140664,_0x10de2b);CmListEvents['on'](_0x140664,_0x46e1c5);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b4f57f9..1caa36d 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 _0xb6e4=['./cmList.controller','get','isAuthenticated','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','create','addDisposition','addContacts','/:id/users','addAgents','put','update','destroy','delete','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3bdd0c,_0x124964){var _0x598cd6=function(_0x4b8c28){while(--_0x4b8c28){_0x3bdd0c['push'](_0x3bdd0c['shift']());}};_0x598cd6(++_0x124964);}(_0xb6e4,0x117));var _0x4b6e=function(_0x3dea6d,_0x642e){_0x3dea6d=_0x3dea6d-0x0;var _0xc1001c=_0xb6e4[_0x3dea6d];return _0xc1001c;};'use strict';var multer=require(_0x4b6e('0x0'));var util=require(_0x4b6e('0x1'));var path=require(_0x4b6e('0x2'));var timeout=require(_0x4b6e('0x3'));var express=require(_0x4b6e('0x4'));var router=express['Router']();var fs_extra=require(_0x4b6e('0x5'));var auth=require(_0x4b6e('0x6'));var interaction=require(_0x4b6e('0x7'));var config=require(_0x4b6e('0x8'));var controller=require(_0x4b6e('0x9'));router[_0x4b6e('0xa')]('/',auth[_0x4b6e('0xb')](),controller['index']);router[_0x4b6e('0xa')](_0x4b6e('0xc'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0xd')]);router[_0x4b6e('0xa')](_0x4b6e('0xe'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0xf')]);router[_0x4b6e('0xa')](_0x4b6e('0x10'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x11')]);router[_0x4b6e('0xa')](_0x4b6e('0x12'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x4b6e('0xa')](_0x4b6e('0x13'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x14')]);router['get'](_0x4b6e('0x15'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x16')]);router['get'](_0x4b6e('0x17'),auth[_0x4b6e('0xb')](),controller['getCustomFields']);router[_0x4b6e('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x4b6e('0x18')]);router[_0x4b6e('0x19')]('/',auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x1a')]);router[_0x4b6e('0x19')](_0x4b6e('0x12'),auth['isAuthenticated'](),controller[_0x4b6e('0x1b')]);router[_0x4b6e('0x19')](_0x4b6e('0x13'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x1c')]);router[_0x4b6e('0x19')](_0x4b6e('0x17'),auth[_0x4b6e('0xb')](),controller['addCustomField']);router['post'](_0x4b6e('0x1d'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x1e')]);router[_0x4b6e('0x1f')](_0x4b6e('0x10'),auth['isAuthenticated'](),controller[_0x4b6e('0x20')]);router['delete'](_0x4b6e('0x10'),auth[_0x4b6e('0xb')](),controller[_0x4b6e('0x21')]);router[_0x4b6e('0x22')](_0x4b6e('0x12'),auth[_0x4b6e('0xb')](),controller['removeDispositions']);router[_0x4b6e('0x22')](_0x4b6e('0x1d'),auth['isAuthenticated'](),controller[_0x4b6e('0x23')]);module['exports']=router; \ No newline at end of file +var _0x2180=['getDispositions','/:id/contacts','getContacts','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addContacts','addCustomField','destroy','removeDispositions','removeAgents','exports','util','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','/global_fields','/:id','show','/:id/dispositions'];(function(_0x31feb1,_0xeb2734){var _0x58232c=function(_0x3b039b){while(--_0x3b039b){_0x31feb1['push'](_0x31feb1['shift']());}};_0x58232c(++_0xeb2734);}(_0x2180,0xa0));var _0x0218=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0x2180[_0x4c80d7];return _0x3c5095;};'use strict';var multer=require('multer');var util=require(_0x0218('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0218('0x1'));var router=express[_0x0218('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0218('0x3'));var config=require(_0x0218('0x4'));var controller=require(_0x0218('0x5'));router[_0x0218('0x6')]('/',auth[_0x0218('0x7')](),controller[_0x0218('0x8')]);router['get']('/describe',auth[_0x0218('0x7')](),controller[_0x0218('0x9')]);router[_0x0218('0x6')](_0x0218('0xa'),auth[_0x0218('0x7')](),controller['getGlobalCustomFields']);router['get'](_0x0218('0xb'),auth[_0x0218('0x7')](),controller[_0x0218('0xc')]);router['get'](_0x0218('0xd'),auth[_0x0218('0x7')](),controller[_0x0218('0xe')]);router[_0x0218('0x6')](_0x0218('0xf'),auth[_0x0218('0x7')](),controller[_0x0218('0x10')]);router[_0x0218('0x6')]('/:id/contacts/csv',auth[_0x0218('0x7')](),controller['getContactsCsv']);router[_0x0218('0x6')](_0x0218('0x11'),auth['isAuthenticated'](),controller[_0x0218('0x12')]);router[_0x0218('0x6')](_0x0218('0x13'),auth['isAuthenticated'](),controller[_0x0218('0x14')]);router[_0x0218('0x15')]('/',auth[_0x0218('0x7')](),controller[_0x0218('0x16')]);router[_0x0218('0x15')](_0x0218('0xd'),auth[_0x0218('0x7')](),controller['addDisposition']);router[_0x0218('0x15')]('/:id/contacts',auth[_0x0218('0x7')](),controller[_0x0218('0x17')]);router[_0x0218('0x15')](_0x0218('0x11'),auth[_0x0218('0x7')](),controller[_0x0218('0x18')]);router['post'](_0x0218('0x13'),auth[_0x0218('0x7')](),controller['addAgents']);router['put'](_0x0218('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0218('0x7')](),controller[_0x0218('0x19')]);router['delete'](_0x0218('0xd'),auth['isAuthenticated'](),controller[_0x0218('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x0218('0x1b')]);module[_0x0218('0x1c')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0a14369..12ff03f 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 _0x53df=['sequelize','exports','VIRTUAL','getDataValue','field','STRING'];(function(_0x5427a0,_0x1cc3c2){var _0x8a3f26=function(_0x2837a9){while(--_0x2837a9){_0x5427a0['push'](_0x5427a0['shift']());}};_0x8a3f26(++_0x1cc3c2);}(_0x53df,0x156));var _0xf53d=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x53df[_0x58dc25];return _0x21b0a7;};'use strict';var Sequelize=require(_0xf53d('0x0'));module[_0xf53d('0x1')]={'name':{'type':Sequelize[_0xf53d('0x2')],'get':function(_0x58133e){return this[_0xf53d('0x3')](_0xf53d('0x4'));}},'field':{'type':Sequelize[_0xf53d('0x5')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xf53d('0x5')],'allowNull':![]}}; \ No newline at end of file +var _0x85ee=['VIRTUAL','getDataValue','STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85ee,0x7b));var _0xe85e=function(_0x487b80,_0x46177a){_0x487b80=_0x487b80-0x0;var _0x4c3ebc=_0x85ee[_0x487b80];return _0x4c3ebc;};'use strict';var Sequelize=require('sequelize');module[_0xe85e('0x0')]={'name':{'type':Sequelize[_0xe85e('0x1')],'get':function(_0x268d70){return this[_0xe85e('0x2')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xe85e('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 3fba9a5..72ecd59 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(_0x34d53c,_0x20b5b2){var _0x2d7cd5=function(_0x30d63b){while(--_0x30d63b){_0x34d53c['push'](_0x34d53c['shift']());}};_0x2d7cd5(++_0x20b5b2);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x1e066f,_0x46d87e){var _0x54a6be=function(_0x123eb5){while(--_0x123eb5){_0x1e066f['push'](_0x1e066f['shift']());}};_0x54a6be(++_0x46d87e);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 8fc8532..35de1cf 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 _0x2219=['path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','bluebird','request-promise'];(function(_0x6e4d51,_0x27cacf){var _0x2adffe=function(_0x85bbe3){while(--_0x85bbe3){_0x6e4d51['push'](_0x6e4d51['shift']());}};_0x2adffe(++_0x27cacf);}(_0x2219,0x128));var _0x9221=function(_0x1e9e56,_0x34a74a){_0x1e9e56=_0x1e9e56-0x0;var _0x5d5e2e=_0x2219[_0x1e9e56];return _0x5d5e2e;};'use strict';var _=require(_0x9221('0x0'));var util=require(_0x9221('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9221('0x2'));var rp=require(_0x9221('0x3'));var fs=require('fs');var path=require(_0x9221('0x4'));var rimraf=require(_0x9221('0x5'));var config=require(_0x9221('0x6'));var attributes=require(_0x9221('0x7'));module[_0x9221('0x8')]=function(_0x4a7ee6,_0x1d6fa2){return _0x4a7ee6[_0x9221('0x9')](_0x9221('0xa'),attributes,{'tableName':_0x9221('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a1a=['api','moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','define','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x34e5c9,_0x1db328){var _0x772b2d=function(_0x261e9c){while(--_0x261e9c){_0x34e5c9['push'](_0x34e5c9['shift']());}};_0x772b2d(++_0x1db328);}(_0x9a1a,0xe7));var _0xa9a1=function(_0x227a9d,_0x344409){_0x227a9d=_0x227a9d-0x0;var _0x33ae58=_0x9a1a[_0x227a9d];return _0x33ae58;};'use strict';var _=require(_0xa9a1('0x0'));var util=require(_0xa9a1('0x1'));var logger=require(_0xa9a1('0x2'))(_0xa9a1('0x3'));var moment=require(_0xa9a1('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a1('0x5'));var fs=require('fs');var path=require(_0xa9a1('0x6'));var rimraf=require(_0xa9a1('0x7'));var config=require(_0xa9a1('0x8'));var attributes=require(_0xa9a1('0x9'));module['exports']=function(_0x11af4a,_0xa990bd){return _0x11af4a[_0xa9a1('0xa')](_0xa9a1('0xb'),attributes,{'tableName':_0xa9a1('0xc'),'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 d00d12c..aefaf75 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 _0xe8a4=['../../config/logger','../../config/environment','jayson/promise','request','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0xbc78a0,_0xab1e8d){var _0x79a306=function(_0x3039f0){while(--_0x3039f0){_0xbc78a0['push'](_0xbc78a0['shift']());}};_0x79a306(++_0xab1e8d);}(_0xe8a4,0x1f2));var _0x4e8a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xe8a4[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x4e8a('0x0'));var util=require(_0x4e8a('0x1'));var moment=require(_0x4e8a('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e8a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e8a('0x4'))['db'];var utils=require(_0x4e8a('0x5'));var logger=require(_0x4e8a('0x6'))('rpc');var config=require(_0x4e8a('0x7'));var jayson=require(_0x4e8a('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x273bde,_0x3020a5,_0x5838f0){return new BPromise(function(_0x14186e,_0x4486dc){return client[_0x4e8a('0x9')](_0x273bde,_0x5838f0)['then'](function(_0x4cd28f){logger['info'](_0x4e8a('0xa'),_0x3020a5,_0x4e8a('0xb'));logger[_0x4e8a('0xc')](_0x4e8a('0xd'),_0x3020a5,'request\x20sent',JSON[_0x4e8a('0xe')](_0x4cd28f));if(_0x4cd28f['error']){if(_0x4cd28f['error']['code']===0x1f4){logger['error'](_0x4e8a('0xa'),_0x3020a5,_0x4cd28f[_0x4e8a('0xf')][_0x4e8a('0x10')]);return _0x4486dc(_0x4cd28f[_0x4e8a('0xf')][_0x4e8a('0x10')]);}logger[_0x4e8a('0xf')](_0x4e8a('0xa'),_0x3020a5,_0x4cd28f[_0x4e8a('0xf')][_0x4e8a('0x10')]);return _0x14186e(_0x4cd28f[_0x4e8a('0xf')][_0x4e8a('0x10')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x3020a5,'request\x20sent');_0x14186e(_0x4cd28f[_0x4e8a('0x11')][_0x4e8a('0x10')]);}})['catch'](function(_0x5322a4){logger['error'](_0x4e8a('0xa'),_0x3020a5,_0x5322a4);_0x4486dc(_0x5322a4);});});} \ No newline at end of file +var _0x113c=['result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x349701,_0x5f30c2){var _0x53ad26=function(_0x1090af){while(--_0x1090af){_0x349701['push'](_0x349701['shift']());}};_0x53ad26(++_0x5f30c2);}(_0x113c,0xec));var _0xc113=function(_0x263345,_0x7d713e){_0x263345=_0x263345-0x0;var _0x9aa4c1=_0x113c[_0x263345];return _0x9aa4c1;};'use strict';var _=require(_0xc113('0x0'));var util=require('util');var moment=require(_0xc113('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc113('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc113('0x3'));var logger=require(_0xc113('0x4'))(_0xc113('0x5'));var config=require(_0xc113('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc113('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x131886,_0xb6e82b,_0x56d871){return new BPromise(function(_0x73c0b7,_0x599715){return client['request'](_0x131886,_0x56d871)[_0xc113('0x8')](function(_0x3ae783){logger[_0xc113('0x9')](_0xc113('0xa'),_0xb6e82b,_0xc113('0xb'));logger[_0xc113('0xc')]('Condition,\x20%s,\x20%s,\x20%s',_0xb6e82b,_0xc113('0xb'),JSON['stringify'](_0x3ae783));if(_0x3ae783[_0xc113('0xd')]){if(_0x3ae783[_0xc113('0xd')][_0xc113('0xe')]===0x1f4){logger[_0xc113('0xd')]('Condition,\x20%s,\x20%s',_0xb6e82b,_0x3ae783[_0xc113('0xd')]['message']);return _0x599715(_0x3ae783[_0xc113('0xd')][_0xc113('0xf')]);}logger['error'](_0xc113('0xa'),_0xb6e82b,_0x3ae783['error'][_0xc113('0xf')]);return _0x73c0b7(_0x3ae783[_0xc113('0xd')]['message']);}else{logger[_0xc113('0x9')](_0xc113('0xa'),_0xb6e82b,'request\x20sent');_0x73c0b7(_0x3ae783[_0xc113('0x10')][_0xc113('0xf')]);}})[_0xc113('0x11')](function(_0x3d8c30){logger[_0xc113('0xd')](_0xc113('0xa'),_0xb6e82b,_0x3d8c30);_0x599715(_0x3d8c30);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 87dbbbc..f1586bc 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 _0x8a30=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy','exports'];(function(_0x1daf07,_0x57c650){var _0x179038=function(_0x43be03){while(--_0x43be03){_0x1daf07['push'](_0x1daf07['shift']());}};_0x179038(++_0x57c650);}(_0x8a30,0x121));var _0x08a3=function(_0xc4ec73,_0x39eaeb){_0xc4ec73=_0xc4ec73-0x0;var _0x108483=_0x8a30[_0xc4ec73];return _0x108483;};'use strict';var multer=require(_0x08a3('0x0'));var util=require(_0x08a3('0x1'));var path=require(_0x08a3('0x2'));var timeout=require(_0x08a3('0x3'));var express=require(_0x08a3('0x4'));var router=express[_0x08a3('0x5')]();var fs_extra=require(_0x08a3('0x6'));var auth=require(_0x08a3('0x7'));var interaction=require(_0x08a3('0x8'));var config=require(_0x08a3('0x9'));var controller=require(_0x08a3('0xa'));router[_0x08a3('0xb')](_0x08a3('0xc'),auth[_0x08a3('0xd')](),controller[_0x08a3('0xe')]);router['delete'](_0x08a3('0xc'),auth['isAuthenticated'](),controller[_0x08a3('0xf')]);module[_0x08a3('0x10')]=router; \ No newline at end of file +var _0xa57a=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','util','connect-timeout'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0xa57a,0x194));var _0xaa57=function(_0x2a73f7,_0x2e9257){_0x2a73f7=_0x2a73f7-0x0;var _0x758c4c=_0xa57a[_0x2a73f7];return _0x758c4c;};'use strict';var multer=require('multer');var util=require(_0xaa57('0x0'));var path=require('path');var timeout=require(_0xaa57('0x1'));var express=require(_0xaa57('0x2'));var router=express['Router']();var fs_extra=require(_0xaa57('0x3'));var auth=require(_0xaa57('0x4'));var interaction=require(_0xaa57('0x5'));var config=require(_0xaa57('0x6'));var controller=require('./condition.controller');router[_0xaa57('0x7')](_0xaa57('0x8'),auth[_0xaa57('0x9')](),controller[_0xaa57('0xa')]);router[_0xaa57('0xb')]('/:id',auth[_0xaa57('0x9')](),controller[_0xaa57('0xc')]);module[_0xaa57('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 75a6ba5..df18e62 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 _0xfd90=['exports','STRING','sequelize'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0xfd90,0x1c4));var _0x0fd9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfd90[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x0fd9('0x0'));module[_0x0fd9('0x1')]={'name':{'type':Sequelize[_0x0fd9('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x7460=['STRING','name','INTEGER','sequelize','exports'];(function(_0x7fc28,_0x17f193){var _0x57d19a=function(_0x350238){while(--_0x350238){_0x7fc28['push'](_0x7fc28['shift']());}};_0x57d19a(++_0x17f193);}(_0x7460,0x11b));var _0x0746=function(_0xbf1132,_0x176b34){_0xbf1132=_0xbf1132-0x0;var _0xe63ce4=_0x7460[_0xbf1132];return _0xe63ce4;};'use strict';var Sequelize=require(_0x0746('0x0'));module[_0x0746('0x1')]={'name':{'type':Sequelize[_0x0746('0x2')],'allowNull':![],'unique':_0x0746('0x3')},'OrderBy':{'type':Sequelize[_0x0746('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x0746('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 97be91f..51fda40 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 _0xef0f=['rows','catch','show','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContactHasItem','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','ContactItemTypes','UserProfileResource','error','stack','name','send','index','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','options','ContactItemType'];(function(_0x2ded31,_0x3d3da1){var _0x49cffc=function(_0xe2ba9){while(--_0xe2ba9){_0x2ded31['push'](_0x2ded31['shift']());}};_0x49cffc(++_0x3d3da1);}(_0xef0f,0x168));var _0xfef0=function(_0x3f3835,_0x4ad60c){_0x3f3835=_0x3f3835-0x0;var _0x131b9c=_0xef0f[_0x3f3835];return _0x131b9c;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];function respondWithStatusCode(_0x546c7a,_0x3135ab){_0x3135ab=_0x3135ab||0xcc;return function(_0x2f4e23){if(_0x2f4e23){return _0x546c7a[_0xfef0('0x1b')](_0x3135ab);}return _0x546c7a[_0xfef0('0x1c')](_0x3135ab)[_0xfef0('0x1d')]();};}function respondWithResult(_0x45599a,_0xa9f040){_0xa9f040=_0xa9f040||0xc8;return function(_0x573ae7){if(_0x573ae7){return _0x45599a[_0xfef0('0x1c')](_0xa9f040)['json'](_0x573ae7);}};}function respondWithFilteredResult(_0x4b5bcf,_0x5acdd0){return function(_0x118b8d){if(_0x118b8d){var _0x284b6d=typeof _0x5acdd0[_0xfef0('0x1e')]===_0xfef0('0x1f')&&typeof _0x5acdd0[_0xfef0('0x20')]===_0xfef0('0x1f');var _0x155833=_0x118b8d[_0xfef0('0x21')];var _0x581459=_0x284b6d?0x0:_0x5acdd0[_0xfef0('0x1e')];var _0x1642cd=_0x284b6d?_0x118b8d[_0xfef0('0x21')]:_0x5acdd0[_0xfef0('0x1e')]+_0x5acdd0[_0xfef0('0x20')];var _0x55912f;if(_0x1642cd>=_0x155833){_0x1642cd=_0x155833;_0x55912f=0xc8;}else{_0x55912f=0xce;}_0x4b5bcf[_0xfef0('0x1c')](_0x55912f);return _0x4b5bcf['set'](_0xfef0('0x22'),_0x581459+'-'+_0x1642cd+'/'+_0x155833)[_0xfef0('0x23')](_0x118b8d);}return null;};}function patchUpdates(_0x28dee1){return function(_0x48408a){try{jsonpatch[_0xfef0('0x24')](_0x48408a,_0x28dee1,!![]);}catch(_0x4c304d){return BPromise[_0xfef0('0x25')](_0x4c304d);}return _0x48408a[_0xfef0('0x26')]();};}function saveUpdates(_0x52b93b,_0x4897af){return function(_0x4b8b22){if(_0x4b8b22){return _0x4b8b22[_0xfef0('0x27')](_0x52b93b)['then'](function(_0x1f9970){return _0x1f9970;});}return null;};}function removeEntity(_0x46b34a,_0x1a8d66){return function(_0x4483f2){if(_0x4483f2){return _0x4483f2[_0xfef0('0x28')]()[_0xfef0('0x29')](function(){var _0x5c9085=_0x4483f2['get']({'plain':!![]});var _0x316e20=_0xfef0('0x2a');return db[_0xfef0('0x2b')][_0xfef0('0x28')]({'where':{'type':_0x316e20,'resourceId':_0x5c9085['id']}})[_0xfef0('0x29')](function(){return _0x4483f2;});})[_0xfef0('0x29')](function(){_0x46b34a[_0xfef0('0x1c')](0xcc)[_0xfef0('0x1d')]();});}};}function handleEntityNotFound(_0x391279,_0x529d86){return function(_0x1a6758){if(!_0x1a6758){_0x391279[_0xfef0('0x1b')](0x194);}return _0x1a6758;};}function handleError(_0xca0cce,_0x956de8){_0x956de8=_0x956de8||0x1f4;return function(_0x37921f){logger[_0xfef0('0x2c')](_0x37921f[_0xfef0('0x2d')]);if(_0x37921f[_0xfef0('0x2e')]){delete _0x37921f[_0xfef0('0x2e')];}_0xca0cce[_0xfef0('0x1c')](_0x956de8)[_0xfef0('0x2f')](_0x37921f);};}exports[_0xfef0('0x30')]=function(_0x51af0f,_0x445625){var _0x5806bd={},_0x4eaf74={},_0x7d1692={'count':0x0,'rows':[]};var _0x2ae54a=_['map'](db['ContactItemType']['rawAttributes'],function(_0x4f65cd){return{'name':_0x4f65cd['fieldName'],'type':_0x4f65cd[_0xfef0('0x31')][_0xfef0('0x32')]};});_0x4eaf74[_0xfef0('0x33')]=_['map'](_0x2ae54a,'name');_0x4eaf74['query']=_[_0xfef0('0x34')](_0x51af0f['query']);_0x4eaf74[_0xfef0('0x35')]=_[_0xfef0('0x36')](_0x4eaf74[_0xfef0('0x33')],_0x4eaf74['query']);_0x5806bd[_0xfef0('0x37')]=_['intersection'](_0x4eaf74[_0xfef0('0x33')],qs[_0xfef0('0x38')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x38')]));_0x5806bd[_0xfef0('0x37')]=_0x5806bd[_0xfef0('0x37')][_0xfef0('0x3a')]?_0x5806bd[_0xfef0('0x37')]:_0x4eaf74['model'];if(!_0x51af0f[_0xfef0('0x39')][_0xfef0('0x3b')](_0xfef0('0x3c'))){_0x5806bd[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x20')]);_0x5806bd[_0xfef0('0x1e')]=qs[_0xfef0('0x1e')](_0x51af0f[_0xfef0('0x39')][_0xfef0('0x1e')]);}_0x5806bd[_0xfef0('0x3d')]=qs[_0xfef0('0x3e')](_0x51af0f['query'][_0xfef0('0x3e')]);_0x5806bd['where']=qs[_0xfef0('0x35')](_[_0xfef0('0x3f')](_0x51af0f[_0xfef0('0x39')],_0x4eaf74['filters']),_0x2ae54a);if(_0x51af0f[_0xfef0('0x39')][_0xfef0('0x40')]){_0x5806bd[_0xfef0('0x41')]=_['merge'](_0x5806bd[_0xfef0('0x41')],{'$or':_[_0xfef0('0x42')](_0x2ae54a,function(_0x39b5c2){if(_0x39b5c2['type']!==_0xfef0('0x43')){var _0x492b90={};_0x492b90[_0x39b5c2['name']]={'$like':'%'+_0x51af0f[_0xfef0('0x39')]['filter']+'%'};return _0x492b90;}})});}_0x5806bd=_['merge']({},_0x5806bd,_0x51af0f[_0xfef0('0x44')]);var _0x61f1ce={'where':_0x5806bd[_0xfef0('0x41')]};return db[_0xfef0('0x45')][_0xfef0('0x21')](_0x61f1ce)[_0xfef0('0x29')](function(_0x4dd8f8){_0x7d1692[_0xfef0('0x21')]=_0x4dd8f8;if(_0x51af0f[_0xfef0('0x39')]['includeAll']){_0x5806bd['include']=[{'all':!![]}];}return db[_0xfef0('0x45')]['findAll'](_0x5806bd);})[_0xfef0('0x29')](function(_0x22c940){_0x7d1692[_0xfef0('0x46')]=_0x22c940;return _0x7d1692;})[_0xfef0('0x29')](respondWithFilteredResult(_0x445625,_0x5806bd))[_0xfef0('0x47')](handleError(_0x445625,null));};exports[_0xfef0('0x48')]=function(_0x166a7b,_0x15b4a6){var _0x4e63f3={'raw':!![],'where':{'id':_0x166a7b['params']['id']}},_0x1813dc={};_0x1813dc['model']=_[_0xfef0('0x34')](db[_0xfef0('0x45')]['rawAttributes']);_0x1813dc[_0xfef0('0x39')]=_['keys'](_0x166a7b[_0xfef0('0x39')]);_0x1813dc[_0xfef0('0x35')]=_[_0xfef0('0x36')](_0x1813dc[_0xfef0('0x33')],_0x1813dc['query']);_0x4e63f3[_0xfef0('0x37')]=_[_0xfef0('0x36')](_0x1813dc['model'],qs['fields'](_0x166a7b[_0xfef0('0x39')]['fields']));_0x4e63f3[_0xfef0('0x37')]=_0x4e63f3[_0xfef0('0x37')][_0xfef0('0x3a')]?_0x4e63f3[_0xfef0('0x37')]:_0x1813dc[_0xfef0('0x33')];if(_0x166a7b[_0xfef0('0x39')]['includeAll']){_0x4e63f3[_0xfef0('0x49')]=[{'all':!![]}];}_0x4e63f3=_['merge']({},_0x4e63f3,_0x166a7b['options']);return db[_0xfef0('0x45')][_0xfef0('0x4a')](_0x4e63f3)[_0xfef0('0x29')](handleEntityNotFound(_0x15b4a6,null))['then'](respondWithResult(_0x15b4a6,null))[_0xfef0('0x47')](handleError(_0x15b4a6,null));};exports['create']=function(_0x5dd26b,_0x51f207){return db[_0xfef0('0x45')][_0xfef0('0x4b')](_0x5dd26b[_0xfef0('0x4c')],{})[_0xfef0('0x29')](function(_0x2712e9){var _0xa23cc8=_0x5dd26b[_0xfef0('0x4d')][_0xfef0('0x4e')]({'plain':!![]});if(!_0xa23cc8)throw new Error(_0xfef0('0x4f'));if(_0xa23cc8['role']==='user'){var _0x2bebec=_0x2712e9[_0xfef0('0x4e')]({'plain':!![]});var _0x34e9ed=_0xfef0('0x2a');return db[_0xfef0('0x50')][_0xfef0('0x4a')]({'where':{'name':_0x34e9ed,'userProfileId':_0xa23cc8[_0xfef0('0x51')]},'raw':!![]})[_0xfef0('0x29')](function(_0x5e989f){if(_0x5e989f&&_0x5e989f[_0xfef0('0x52')]===0x0){return db[_0xfef0('0x2b')][_0xfef0('0x4b')]({'name':_0x2bebec[_0xfef0('0x2e')],'resourceId':_0x2bebec['id'],'type':_0x5e989f[_0xfef0('0x2e')],'sectionId':_0x5e989f['id']},{})['then'](function(){return _0x2712e9;});}else{return _0x2712e9;}})['catch'](function(_0x523763){logger[_0xfef0('0x2c')](_0xfef0('0x53'),_0x523763);throw _0x523763;});}return _0x2712e9;})[_0xfef0('0x29')](respondWithResult(_0x51f207,0xc9))[_0xfef0('0x47')](handleError(_0x51f207,null));};exports['update']=function(_0x18a6ee,_0x2b5c33){if(_0x18a6ee[_0xfef0('0x4c')]['id']){delete _0x18a6ee[_0xfef0('0x4c')]['id'];}return db[_0xfef0('0x45')][_0xfef0('0x4a')]({'where':{'id':_0x18a6ee[_0xfef0('0x54')]['id']}})['then'](handleEntityNotFound(_0x2b5c33,null))[_0xfef0('0x29')](saveUpdates(_0x18a6ee[_0xfef0('0x4c')],null))['then'](respondWithResult(_0x2b5c33,null))[_0xfef0('0x47')](handleError(_0x2b5c33,null));};exports['destroy']=function(_0x175e97,_0x3f3fd5){return db['ContactItemType'][_0xfef0('0x4a')]({'where':{'id':_0x175e97['params']['id']}})['then'](handleEntityNotFound(_0x3f3fd5,null))['then'](db[_0xfef0('0x55')][_0xfef0('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x175e97[_0xfef0('0x54')]['id']}}))[_0xfef0('0x29')](removeEntity(_0x3f3fd5,null))[_0xfef0('0x47')](handleError(_0x3f3fd5,null));}; \ No newline at end of file +var _0x32f4=['Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','ContactItemTypes','UserProfileResource','end','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','limit','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','merge','options','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32f4,0x154));var _0x432f=function(_0x551317,_0x21eb24){_0x551317=_0x551317-0x0;var _0x14bf35=_0x32f4[_0x551317];return _0x14bf35;};'use strict';var emlformat=require(_0x432f('0x0'));var rimraf=require(_0x432f('0x1'));var zipdir=require(_0x432f('0x2'));var jsonpatch=require(_0x432f('0x3'));var rp=require('request-promise');var moment=require(_0x432f('0x4'));var BPromise=require(_0x432f('0x5'));var Mustache=require('mustache');var util=require(_0x432f('0x6'));var path=require(_0x432f('0x7'));var sox=require(_0x432f('0x8'));var csv=require(_0x432f('0x9'));var ejs=require(_0x432f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x432f('0xb'));var crypto=require(_0x432f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x432f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x432f('0xe'));var Papa=require(_0x432f('0xf'));var Redis=require(_0x432f('0x10'));var authService=require(_0x432f('0x11'));var qs=require(_0x432f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x432f('0x13'));var logger=require('../../config/logger')(_0x432f('0x14'));var utils=require('../../config/utils');var config=require(_0x432f('0x15'));var licenseUtil=require(_0x432f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x457389,_0x29f7d2){_0x29f7d2=_0x29f7d2||0xcc;return function(_0x52e40f){if(_0x52e40f){return _0x457389[_0x432f('0x17')](_0x29f7d2);}return _0x457389[_0x432f('0x18')](_0x29f7d2)['end']();};}function respondWithResult(_0x48a4db,_0x28d9e9){_0x28d9e9=_0x28d9e9||0xc8;return function(_0x44756d){if(_0x44756d){return _0x48a4db[_0x432f('0x18')](_0x28d9e9)[_0x432f('0x19')](_0x44756d);}};}function respondWithFilteredResult(_0x419bfe,_0x4f91c5){return function(_0x175ba7){if(_0x175ba7){var _0x2f0708=typeof _0x4f91c5[_0x432f('0x1a')]===_0x432f('0x1b')&&typeof _0x4f91c5['limit']===_0x432f('0x1b');var _0x30f231=_0x175ba7[_0x432f('0x1c')];var _0x243cf=_0x2f0708?0x0:_0x4f91c5[_0x432f('0x1a')];var _0x129582=_0x2f0708?_0x175ba7['count']:_0x4f91c5[_0x432f('0x1a')]+_0x4f91c5['limit'];var _0x3d545d;if(_0x129582>=_0x30f231){_0x129582=_0x30f231;_0x3d545d=0xc8;}else{_0x3d545d=0xce;}_0x419bfe[_0x432f('0x18')](_0x3d545d);return _0x419bfe[_0x432f('0x1d')](_0x432f('0x1e'),_0x243cf+'-'+_0x129582+'/'+_0x30f231)[_0x432f('0x19')](_0x175ba7);}return null;};}function patchUpdates(_0xf1f5d){return function(_0x10f39b){try{jsonpatch[_0x432f('0x1f')](_0x10f39b,_0xf1f5d,!![]);}catch(_0x693eb3){return BPromise[_0x432f('0x20')](_0x693eb3);}return _0x10f39b[_0x432f('0x21')]();};}function saveUpdates(_0x3446fd,_0x4dd230){return function(_0x5940bd){if(_0x5940bd){return _0x5940bd[_0x432f('0x22')](_0x3446fd)['then'](function(_0x28968e){return _0x28968e;});}return null;};}function removeEntity(_0x5b9c70,_0x37f136){return function(_0x175d1b){if(_0x175d1b){return _0x175d1b[_0x432f('0x23')]()[_0x432f('0x24')](function(){var _0x2f84a7=_0x175d1b[_0x432f('0x25')]({'plain':!![]});var _0x59f352=_0x432f('0x26');return db[_0x432f('0x27')]['destroy']({'where':{'type':_0x59f352,'resourceId':_0x2f84a7['id']}})[_0x432f('0x24')](function(){return _0x175d1b;});})[_0x432f('0x24')](function(){_0x5b9c70[_0x432f('0x18')](0xcc)[_0x432f('0x28')]();});}};}function handleEntityNotFound(_0x44839,_0x781862){return function(_0x138a6a){if(!_0x138a6a){_0x44839['sendStatus'](0x194);}return _0x138a6a;};}function handleError(_0x294bfe,_0x4eeae1){_0x4eeae1=_0x4eeae1||0x1f4;return function(_0x1f1fdd){logger['error'](_0x1f1fdd[_0x432f('0x29')]);if(_0x1f1fdd['name']){delete _0x1f1fdd[_0x432f('0x2a')];}_0x294bfe['status'](_0x4eeae1)[_0x432f('0x2b')](_0x1f1fdd);};}exports[_0x432f('0x2c')]=function(_0x263cd8,_0x59c1ab){var _0x6a116e={},_0x24406a={},_0x48139b={'count':0x0,'rows':[]};var _0x5ee0fa=_[_0x432f('0x2d')](db[_0x432f('0x2e')][_0x432f('0x2f')],function(_0x3581c2){return{'name':_0x3581c2[_0x432f('0x30')],'type':_0x3581c2[_0x432f('0x31')]['key']};});_0x24406a['model']=_[_0x432f('0x2d')](_0x5ee0fa,_0x432f('0x2a'));_0x24406a[_0x432f('0x32')]=_['keys'](_0x263cd8[_0x432f('0x32')]);_0x24406a[_0x432f('0x33')]=_[_0x432f('0x34')](_0x24406a[_0x432f('0x35')],_0x24406a[_0x432f('0x32')]);_0x6a116e[_0x432f('0x36')]=_[_0x432f('0x34')](_0x24406a[_0x432f('0x35')],qs['fields'](_0x263cd8['query'][_0x432f('0x37')]));_0x6a116e[_0x432f('0x36')]=_0x6a116e['attributes']['length']?_0x6a116e['attributes']:_0x24406a[_0x432f('0x35')];if(!_0x263cd8[_0x432f('0x32')]['hasOwnProperty'](_0x432f('0x38'))){_0x6a116e[_0x432f('0x39')]=qs[_0x432f('0x39')](_0x263cd8['query'][_0x432f('0x39')]);_0x6a116e[_0x432f('0x1a')]=qs['offset'](_0x263cd8[_0x432f('0x32')][_0x432f('0x1a')]);}_0x6a116e['order']=qs[_0x432f('0x3a')](_0x263cd8[_0x432f('0x32')][_0x432f('0x3a')]);_0x6a116e[_0x432f('0x3b')]=qs[_0x432f('0x33')](_[_0x432f('0x3c')](_0x263cd8[_0x432f('0x32')],_0x24406a[_0x432f('0x33')]),_0x5ee0fa);if(_0x263cd8[_0x432f('0x32')][_0x432f('0x3d')]){_0x6a116e[_0x432f('0x3b')]=_['merge'](_0x6a116e[_0x432f('0x3b')],{'$or':_['map'](_0x5ee0fa,function(_0x1550fc){if(_0x1550fc[_0x432f('0x31')]!=='VIRTUAL'){var _0x43d836={};_0x43d836[_0x1550fc['name']]={'$like':'%'+_0x263cd8[_0x432f('0x32')][_0x432f('0x3d')]+'%'};return _0x43d836;}})});}_0x6a116e=_['merge']({},_0x6a116e,_0x263cd8['options']);var _0xbd4240={'where':_0x6a116e[_0x432f('0x3b')]};return db[_0x432f('0x2e')][_0x432f('0x1c')](_0xbd4240)[_0x432f('0x24')](function(_0x513a57){_0x48139b['count']=_0x513a57;if(_0x263cd8['query'][_0x432f('0x3e')]){_0x6a116e[_0x432f('0x3f')]=[{'all':!![]}];}return db['ContactItemType'][_0x432f('0x40')](_0x6a116e);})[_0x432f('0x24')](function(_0x41c90c){_0x48139b[_0x432f('0x41')]=_0x41c90c;return _0x48139b;})[_0x432f('0x24')](respondWithFilteredResult(_0x59c1ab,_0x6a116e))[_0x432f('0x42')](handleError(_0x59c1ab,null));};exports[_0x432f('0x43')]=function(_0x1a2be2,_0x1c5f87){var _0x5c6298={'raw':!![],'where':{'id':_0x1a2be2[_0x432f('0x44')]['id']}},_0x247b63={};_0x247b63['model']=_[_0x432f('0x45')](db[_0x432f('0x2e')][_0x432f('0x2f')]);_0x247b63[_0x432f('0x32')]=_[_0x432f('0x45')](_0x1a2be2[_0x432f('0x32')]);_0x247b63[_0x432f('0x33')]=_[_0x432f('0x34')](_0x247b63[_0x432f('0x35')],_0x247b63[_0x432f('0x32')]);_0x5c6298[_0x432f('0x36')]=_[_0x432f('0x34')](_0x247b63[_0x432f('0x35')],qs[_0x432f('0x37')](_0x1a2be2['query']['fields']));_0x5c6298[_0x432f('0x36')]=_0x5c6298[_0x432f('0x36')][_0x432f('0x46')]?_0x5c6298[_0x432f('0x36')]:_0x247b63[_0x432f('0x35')];if(_0x1a2be2['query'][_0x432f('0x3e')]){_0x5c6298[_0x432f('0x3f')]=[{'all':!![]}];}_0x5c6298=_[_0x432f('0x47')]({},_0x5c6298,_0x1a2be2[_0x432f('0x48')]);return db[_0x432f('0x2e')][_0x432f('0x49')](_0x5c6298)[_0x432f('0x24')](handleEntityNotFound(_0x1c5f87,null))['then'](respondWithResult(_0x1c5f87,null))[_0x432f('0x42')](handleError(_0x1c5f87,null));};exports[_0x432f('0x4a')]=function(_0x359853,_0x547bd0){return db[_0x432f('0x2e')][_0x432f('0x4a')](_0x359853['body'],{})['then'](function(_0x3b2021){var _0x24f244=_0x359853['user']['get']({'plain':!![]});if(!_0x24f244)throw new Error(_0x432f('0x4b'));if(_0x24f244['role']===_0x432f('0x4c')){var _0x66b80e=_0x3b2021['get']({'plain':!![]});var _0x12f2f7='ContactItemTypes';return db[_0x432f('0x4d')][_0x432f('0x49')]({'where':{'name':_0x12f2f7,'userProfileId':_0x24f244[_0x432f('0x4e')]},'raw':!![]})[_0x432f('0x24')](function(_0x3051ea){if(_0x3051ea&&_0x3051ea[_0x432f('0x4f')]===0x0){return db['UserProfileResource'][_0x432f('0x4a')]({'name':_0x66b80e['name'],'resourceId':_0x66b80e['id'],'type':_0x3051ea[_0x432f('0x2a')],'sectionId':_0x3051ea['id']},{})[_0x432f('0x24')](function(){return _0x3b2021;});}else{return _0x3b2021;}})[_0x432f('0x42')](function(_0x21ae8c){logger['error'](_0x432f('0x50'),_0x21ae8c);throw _0x21ae8c;});}return _0x3b2021;})[_0x432f('0x24')](respondWithResult(_0x547bd0,0xc9))[_0x432f('0x42')](handleError(_0x547bd0,null));};exports[_0x432f('0x22')]=function(_0x13aced,_0x2a26bd){if(_0x13aced[_0x432f('0x51')]['id']){delete _0x13aced['body']['id'];}return db['ContactItemType'][_0x432f('0x49')]({'where':{'id':_0x13aced[_0x432f('0x44')]['id']}})[_0x432f('0x24')](handleEntityNotFound(_0x2a26bd,null))[_0x432f('0x24')](saveUpdates(_0x13aced[_0x432f('0x51')],null))[_0x432f('0x24')](respondWithResult(_0x2a26bd,null))['catch'](handleError(_0x2a26bd,null));};exports[_0x432f('0x23')]=function(_0x545035,_0x4e96d8){return db[_0x432f('0x2e')][_0x432f('0x49')]({'where':{'id':_0x545035[_0x432f('0x44')]['id']}})[_0x432f('0x24')](handleEntityNotFound(_0x4e96d8,null))[_0x432f('0x24')](db[_0x432f('0x52')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x545035[_0x432f('0x44')]['id']}}))[_0x432f('0x24')](removeEntity(_0x4e96d8,null))['catch'](handleError(_0x4e96d8,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index b2bf1f5..3312cd3 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 _0xbae0=['request-promise','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5b7d49,_0x52bd2b){var _0x2adbd7=function(_0xe602f9){while(--_0xe602f9){_0x5b7d49['push'](_0x5b7d49['shift']());}};_0x2adbd7(++_0x52bd2b);}(_0xbae0,0x1c6));var _0x0bae=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0xbae0[_0x48c615];return _0x3d9e22;};'use strict';var _=require(_0x0bae('0x0'));var util=require(_0x0bae('0x1'));var logger=require(_0x0bae('0x2'))(_0x0bae('0x3'));var moment=require(_0x0bae('0x4'));var BPromise=require(_0x0bae('0x5'));var rp=require(_0x0bae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0bae('0x7'));var attributes=require('./contactItemType.attributes');module[_0x0bae('0x8')]=function(_0x3dda4d,_0x45af52){return _0x3dda4d[_0x0bae('0x9')]('ContactItemType',attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ca0=['path','exports','define','tools_contact_item_types','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3fa100,_0x3c5ae5){var _0x371fce=function(_0x1d9d9a){while(--_0x1d9d9a){_0x3fa100['push'](_0x3fa100['shift']());}};_0x371fce(++_0x3c5ae5);}(_0x2ca0,0x112));var _0x02ca=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x2ca0[_0x5a27e8];return _0x4e38f7;};'use strict';var _=require(_0x02ca('0x0'));var util=require(_0x02ca('0x1'));var logger=require(_0x02ca('0x2'))(_0x02ca('0x3'));var moment=require('moment');var BPromise=require(_0x02ca('0x4'));var rp=require(_0x02ca('0x5'));var fs=require('fs');var path=require(_0x02ca('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module[_0x02ca('0x7')]=function(_0x38fa5d,_0x1307e4){return _0x38fa5d[_0x02ca('0x8')]('ContactItemType',attributes,{'tableName':_0x02ca('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 58cb10b..7ed2836 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 _0x45d5=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','ContactItemType,\x20%s,\x20%s,\x20%s'];(function(_0x109cfd,_0x156695){var _0x285452=function(_0xdfb414){while(--_0xdfb414){_0x109cfd['push'](_0x109cfd['shift']());}};_0x285452(++_0x156695);}(_0x45d5,0x1d1));var _0x545d=function(_0x2f23cb,_0x699234){_0x2f23cb=_0x2f23cb-0x0;var _0x581dce=_0x45d5[_0x2f23cb];return _0x581dce;};'use strict';var _=require('lodash');var util=require(_0x545d('0x0'));var moment=require(_0x545d('0x1'));var BPromise=require(_0x545d('0x2'));var rs=require(_0x545d('0x3'));var fs=require('fs');var Redis=require(_0x545d('0x4'));var db=require(_0x545d('0x5'))['db'];var utils=require(_0x545d('0x6'));var logger=require('../../config/logger')(_0x545d('0x7'));var config=require(_0x545d('0x8'));var jayson=require(_0x545d('0x9'));var client=jayson[_0x545d('0xa')][_0x545d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e00a3,_0xee0060,_0x3095d6){return new BPromise(function(_0x2effbd,_0x38619d){return client[_0x545d('0xc')](_0x2e00a3,_0x3095d6)[_0x545d('0xd')](function(_0x91526f){logger[_0x545d('0xe')](_0x545d('0xf'),_0xee0060,_0x545d('0x10'));logger['debug'](_0x545d('0x11'),_0xee0060,_0x545d('0x10'),JSON[_0x545d('0x12')](_0x91526f));if(_0x91526f[_0x545d('0x13')]){if(_0x91526f[_0x545d('0x13')][_0x545d('0x14')]===0x1f4){logger[_0x545d('0x13')](_0x545d('0xf'),_0xee0060,_0x91526f[_0x545d('0x13')][_0x545d('0x15')]);return _0x38619d(_0x91526f['error'][_0x545d('0x15')]);}logger[_0x545d('0x13')](_0x545d('0xf'),_0xee0060,_0x91526f[_0x545d('0x13')]['message']);return _0x2effbd(_0x91526f[_0x545d('0x13')][_0x545d('0x15')]);}else{logger[_0x545d('0xe')](_0x545d('0xf'),_0xee0060,_0x545d('0x10'));_0x2effbd(_0x91526f['result'][_0x545d('0x15')]);}})[_0x545d('0x16')](function(_0xdfe445){logger[_0x545d('0x13')](_0x545d('0xf'),_0xee0060,_0xdfe445);_0x38619d(_0xdfe445);});});} \ No newline at end of file +var _0x7872=['ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x411bbc,_0x4e1ff7){var _0x5d5227=function(_0x2ab311){while(--_0x2ab311){_0x411bbc['push'](_0x411bbc['shift']());}};_0x5d5227(++_0x4e1ff7);}(_0x7872,0x193));var _0x2787=function(_0x1fa4ea,_0x13892a){_0x1fa4ea=_0x1fa4ea-0x0;var _0x5ecc8c=_0x7872[_0x1fa4ea];return _0x5ecc8c;};'use strict';var _=require(_0x2787('0x0'));var util=require(_0x2787('0x1'));var moment=require(_0x2787('0x2'));var BPromise=require('bluebird');var rs=require(_0x2787('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2787('0x4'))['db'];var utils=require(_0x2787('0x5'));var logger=require('../../config/logger')(_0x2787('0x6'));var config=require(_0x2787('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2787('0x8')][_0x2787('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x102cd8,_0x56b049,_0x508d39){return new BPromise(function(_0x5ba648,_0x2f2058){return client['request'](_0x102cd8,_0x508d39)[_0x2787('0xa')](function(_0x2e3abe){logger[_0x2787('0xb')]('ContactItemType,\x20%s,\x20%s',_0x56b049,'request\x20sent');logger[_0x2787('0xc')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x56b049,_0x2787('0xd'),JSON[_0x2787('0xe')](_0x2e3abe));if(_0x2e3abe[_0x2787('0xf')]){if(_0x2e3abe[_0x2787('0xf')][_0x2787('0x10')]===0x1f4){logger[_0x2787('0xf')](_0x2787('0x11'),_0x56b049,_0x2e3abe['error']['message']);return _0x2f2058(_0x2e3abe[_0x2787('0xf')][_0x2787('0x12')]);}logger['error'](_0x2787('0x11'),_0x56b049,_0x2e3abe[_0x2787('0xf')][_0x2787('0x12')]);return _0x5ba648(_0x2e3abe['error'][_0x2787('0x12')]);}else{logger[_0x2787('0xb')](_0x2787('0x11'),_0x56b049,_0x2787('0xd'));_0x5ba648(_0x2e3abe[_0x2787('0x13')]['message']);}})[_0x2787('0x14')](function(_0x3adccb){logger[_0x2787('0xf')](_0x2787('0x11'),_0x56b049,_0x3adccb);_0x2f2058(_0x3adccb);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index ee56228..02e0aa2 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 _0x2a29=['../../components/interaction/service','../../config/environment','./contactItemType.controller','index','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5622a1,_0x117688){var _0x407601=function(_0x49ac69){while(--_0x49ac69){_0x5622a1['push'](_0x5622a1['shift']());}};_0x407601(++_0x117688);}(_0x2a29,0x175));var _0x92a2=function(_0x2b0a1a,_0x799148){_0x2b0a1a=_0x2b0a1a-0x0;var _0x22fed9=_0x2a29[_0x2b0a1a];return _0x22fed9;};'use strict';var multer=require(_0x92a2('0x0'));var util=require('util');var path=require(_0x92a2('0x1'));var timeout=require(_0x92a2('0x2'));var express=require(_0x92a2('0x3'));var router=express[_0x92a2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x92a2('0x5'));var config=require(_0x92a2('0x6'));var controller=require(_0x92a2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x92a2('0x8')]);router[_0x92a2('0x9')](_0x92a2('0xa'),auth[_0x92a2('0xb')](),controller['show']);router[_0x92a2('0xc')]('/',auth[_0x92a2('0xb')](),controller[_0x92a2('0xd')]);router[_0x92a2('0xe')](_0x92a2('0xa'),auth[_0x92a2('0xb')](),controller['update']);router[_0x92a2('0xf')](_0x92a2('0xa'),auth[_0x92a2('0xb')](),controller[_0x92a2('0x10')]);module[_0x92a2('0x11')]=router; \ No newline at end of file +var _0xef8d=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','isAuthenticated','get','show','post','create','put','/:id','update','destroy','multer','util'];(function(_0x17516d,_0x2efe23){var _0x47389d=function(_0x215d50){while(--_0x215d50){_0x17516d['push'](_0x17516d['shift']());}};_0x47389d(++_0x2efe23);}(_0xef8d,0x1d9));var _0xdef8=function(_0x27efcf,_0x320952){_0x27efcf=_0x27efcf-0x0;var _0xdb0237=_0xef8d[_0x27efcf];return _0xdb0237;};'use strict';var multer=require(_0xdef8('0x0'));var util=require(_0xdef8('0x1'));var path=require(_0xdef8('0x2'));var timeout=require(_0xdef8('0x3'));var express=require(_0xdef8('0x4'));var router=express[_0xdef8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdef8('0x6'));var interaction=require(_0xdef8('0x7'));var config=require(_0xdef8('0x8'));var controller=require(_0xdef8('0x9'));router['get']('/',auth[_0xdef8('0xa')](),controller['index']);router[_0xdef8('0xb')]('/:id',auth[_0xdef8('0xa')](),controller[_0xdef8('0xc')]);router[_0xdef8('0xd')]('/',auth[_0xdef8('0xa')](),controller[_0xdef8('0xe')]);router[_0xdef8('0xf')](_0xdef8('0x10'),auth[_0xdef8('0xa')](),controller[_0xdef8('0x11')]);router['delete'](_0xdef8('0x10'),auth[_0xdef8('0xa')](),controller[_0xdef8('0x12')]);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 4a1b2dd..797363c 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['name','exports','STRING'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x4b9bef,_0x3dc0cb){var _0x2815ee=function(_0x4073dd){while(--_0x4073dd){_0x4b9bef['push'](_0x4b9bef['shift']());}};_0x2815ee(++_0x3dc0cb);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index f831ba0..7a7c1b3 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 _0xa3bc=['show','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','create','destroy','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','socket.io-emitter','redis','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','Dashboard','rows','catch'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xa3bc,0xb8));var _0xca3b=function(_0x41bc1e,_0x5e9b8f){_0x41bc1e=_0x41bc1e-0x0;var _0xca6740=_0xa3bc[_0x41bc1e];return _0xca6740;};'use strict';var emlformat=require(_0xca3b('0x0'));var rimraf=require(_0xca3b('0x1'));var zipdir=require(_0xca3b('0x2'));var jsonpatch=require(_0xca3b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xca3b('0x4'));var Mustache=require(_0xca3b('0x5'));var util=require(_0xca3b('0x6'));var path=require('path');var sox=require(_0xca3b('0x7'));var csv=require(_0xca3b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca3b('0x9'));var _=require(_0xca3b('0xa'));var squel=require('squel');var crypto=require(_0xca3b('0xb'));var jsforce=require(_0xca3b('0xc'));var deskjs=require(_0xca3b('0xd'));var toCsv=require(_0xca3b('0x8'));var querystring=require(_0xca3b('0xe'));var Papa=require(_0xca3b('0xf'));var Redis=require(_0xca3b('0x10'));var authService=require(_0xca3b('0x11'));var qs=require(_0xca3b('0x12'));var as=require(_0xca3b('0x13'));var hardwareService=require(_0xca3b('0x14'));var logger=require(_0xca3b('0x15'))('api');var utils=require(_0xca3b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xca3b('0x17'));var db=require(_0xca3b('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xca3b('0x19'))(new Redis(config[_0xca3b('0x1a')]));require('./dashboard.socket')[_0xca3b('0x1b')](socket);function respondWithStatusCode(_0x539186,_0x4b1043){_0x4b1043=_0x4b1043||0xcc;return function(_0x496011){if(_0x496011){return _0x539186[_0xca3b('0x1c')](_0x4b1043);}return _0x539186[_0xca3b('0x1d')](_0x4b1043)[_0xca3b('0x1e')]();};}function respondWithResult(_0x26fa9b,_0x3aa5ad){_0x3aa5ad=_0x3aa5ad||0xc8;return function(_0x314971){if(_0x314971){return _0x26fa9b[_0xca3b('0x1d')](_0x3aa5ad)[_0xca3b('0x1f')](_0x314971);}};}function respondWithFilteredResult(_0x85f0e4,_0x57f75c){return function(_0x183fb1){if(_0x183fb1){var _0x58ed68=typeof _0x57f75c[_0xca3b('0x20')]===_0xca3b('0x21')&&typeof _0x57f75c[_0xca3b('0x22')]===_0xca3b('0x21');var _0x53ed0d=_0x183fb1[_0xca3b('0x23')];var _0x2545e3=_0x58ed68?0x0:_0x57f75c['offset'];var _0x6fe34b=_0x58ed68?_0x183fb1[_0xca3b('0x23')]:_0x57f75c[_0xca3b('0x20')]+_0x57f75c[_0xca3b('0x22')];var _0x461b5b;if(_0x6fe34b>=_0x53ed0d){_0x6fe34b=_0x53ed0d;_0x461b5b=0xc8;}else{_0x461b5b=0xce;}_0x85f0e4[_0xca3b('0x1d')](_0x461b5b);return _0x85f0e4['set'](_0xca3b('0x24'),_0x2545e3+'-'+_0x6fe34b+'/'+_0x53ed0d)['json'](_0x183fb1);}return null;};}function patchUpdates(_0x3c76d1){return function(_0x959ac4){try{jsonpatch[_0xca3b('0x25')](_0x959ac4,_0x3c76d1,!![]);}catch(_0x51a605){return BPromise[_0xca3b('0x26')](_0x51a605);}return _0x959ac4[_0xca3b('0x27')]();};}function saveUpdates(_0x4149ed,_0x1df02f){return function(_0x217bf1){if(_0x217bf1){return _0x217bf1['update'](_0x4149ed)[_0xca3b('0x28')](function(_0x4198e7){return _0x4198e7;});}return null;};}function removeEntity(_0x17e226,_0xe974ba){return function(_0xd43426){if(_0xd43426){return _0xd43426['destroy']()[_0xca3b('0x28')](function(){var _0xb6f83d=_0xd43426[_0xca3b('0x29')]({'plain':!![]});var _0x1768bd='CustomDashboards';return db[_0xca3b('0x2a')]['destroy']({'where':{'type':_0x1768bd,'resourceId':_0xb6f83d['id']}})[_0xca3b('0x28')](function(){return _0xd43426;});})['then'](function(){_0x17e226[_0xca3b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x186ce5,_0x3da0fe){return function(_0x3f33b4){if(!_0x3f33b4){_0x186ce5[_0xca3b('0x1c')](0x194);}return _0x3f33b4;};}function handleError(_0x375acc,_0x3703bf){_0x3703bf=_0x3703bf||0x1f4;return function(_0x90dc57){logger[_0xca3b('0x2b')](_0x90dc57[_0xca3b('0x2c')]);if(_0x90dc57[_0xca3b('0x2d')]){delete _0x90dc57[_0xca3b('0x2d')];}_0x375acc['status'](_0x3703bf)[_0xca3b('0x2e')](_0x90dc57);};}exports[_0xca3b('0x2f')]=function(_0x48c92,_0x327dcf){var _0x21eaa8={},_0x4634b1={},_0x1121a9={'count':0x0,'rows':[]};var _0x3ede32=_[_0xca3b('0x30')](db['Dashboard'][_0xca3b('0x31')],function(_0x8dace0){return{'name':_0x8dace0[_0xca3b('0x32')],'type':_0x8dace0[_0xca3b('0x33')][_0xca3b('0x34')]};});_0x4634b1[_0xca3b('0x35')]=_[_0xca3b('0x30')](_0x3ede32,_0xca3b('0x2d'));_0x4634b1[_0xca3b('0x36')]=_[_0xca3b('0x37')](_0x48c92[_0xca3b('0x36')]);_0x4634b1[_0xca3b('0x38')]=_['intersection'](_0x4634b1[_0xca3b('0x35')],_0x4634b1[_0xca3b('0x36')]);_0x21eaa8['attributes']=_[_0xca3b('0x39')](_0x4634b1['model'],qs[_0xca3b('0x3a')](_0x48c92['query'][_0xca3b('0x3a')]));_0x21eaa8[_0xca3b('0x3b')]=_0x21eaa8['attributes'][_0xca3b('0x3c')]?_0x21eaa8['attributes']:_0x4634b1['model'];if(!_0x48c92[_0xca3b('0x36')][_0xca3b('0x3d')](_0xca3b('0x3e'))){_0x21eaa8[_0xca3b('0x22')]=qs[_0xca3b('0x22')](_0x48c92[_0xca3b('0x36')][_0xca3b('0x22')]);_0x21eaa8[_0xca3b('0x20')]=qs[_0xca3b('0x20')](_0x48c92[_0xca3b('0x36')][_0xca3b('0x20')]);}_0x21eaa8['order']=qs[_0xca3b('0x3f')](_0x48c92['query'][_0xca3b('0x3f')]);_0x21eaa8[_0xca3b('0x40')]=qs['filters'](_[_0xca3b('0x41')](_0x48c92[_0xca3b('0x36')],_0x4634b1[_0xca3b('0x38')]),_0x3ede32);if(_0x48c92[_0xca3b('0x36')][_0xca3b('0x42')]){_0x21eaa8[_0xca3b('0x40')]=_[_0xca3b('0x43')](_0x21eaa8[_0xca3b('0x40')],{'$or':_['map'](_0x3ede32,function(_0x18a65b){if(_0x18a65b[_0xca3b('0x33')]!==_0xca3b('0x44')){var _0x2f7492={};_0x2f7492[_0x18a65b[_0xca3b('0x2d')]]={'$like':'%'+_0x48c92['query']['filter']+'%'};return _0x2f7492;}})});}_0x21eaa8=_[_0xca3b('0x43')]({},_0x21eaa8,_0x48c92[_0xca3b('0x45')]);var _0x1a13d7={'where':_0x21eaa8[_0xca3b('0x40')]};return db['Dashboard'][_0xca3b('0x23')](_0x1a13d7)[_0xca3b('0x28')](function(_0x5240f9){_0x1121a9[_0xca3b('0x23')]=_0x5240f9;if(_0x48c92['query'][_0xca3b('0x46')]){_0x21eaa8['include']=[{'all':!![]}];}return db[_0xca3b('0x47')]['findAll'](_0x21eaa8);})[_0xca3b('0x28')](function(_0x3a42fa){_0x1121a9[_0xca3b('0x48')]=_0x3a42fa;return _0x1121a9;})['then'](respondWithFilteredResult(_0x327dcf,_0x21eaa8))[_0xca3b('0x49')](handleError(_0x327dcf,null));};exports[_0xca3b('0x4a')]=function(_0x1bd08d,_0x150c11){var _0x2b7d39={'raw':![],'where':{'id':_0x1bd08d[_0xca3b('0x4b')]['id']}},_0x10f320={};_0x10f320['model']=_['keys'](db[_0xca3b('0x47')]['rawAttributes']);_0x10f320[_0xca3b('0x36')]=_[_0xca3b('0x37')](_0x1bd08d[_0xca3b('0x36')]);_0x10f320['filters']=_['intersection'](_0x10f320[_0xca3b('0x35')],_0x10f320[_0xca3b('0x36')]);_0x2b7d39[_0xca3b('0x3b')]=_[_0xca3b('0x39')](_0x10f320[_0xca3b('0x35')],qs['fields'](_0x1bd08d[_0xca3b('0x36')][_0xca3b('0x3a')]));_0x2b7d39[_0xca3b('0x3b')]=_0x2b7d39[_0xca3b('0x3b')]['length']?_0x2b7d39[_0xca3b('0x3b')]:_0x10f320[_0xca3b('0x35')];if(_0x1bd08d[_0xca3b('0x36')]['includeAll']){_0x2b7d39[_0xca3b('0x4c')]=[{'all':!![]}];}_0x2b7d39=_[_0xca3b('0x43')]({},_0x2b7d39,_0x1bd08d[_0xca3b('0x45')]);return db[_0xca3b('0x47')][_0xca3b('0x4d')](_0x2b7d39)['then'](handleEntityNotFound(_0x150c11,null))[_0xca3b('0x28')](respondWithResult(_0x150c11,null))[_0xca3b('0x49')](handleError(_0x150c11,null));};exports['create']=function(_0x196a53,_0x1e6cd3){return db[_0xca3b('0x47')]['create'](_0x196a53[_0xca3b('0x4e')],{})[_0xca3b('0x28')](function(_0xb6c7c){var _0x257e48=_0x196a53[_0xca3b('0x4f')][_0xca3b('0x29')]({'plain':!![]});if(!_0x257e48)throw new Error(_0xca3b('0x50'));if(_0x257e48[_0xca3b('0x51')]===_0xca3b('0x4f')){var _0x4c262f=_0xb6c7c[_0xca3b('0x29')]({'plain':!![]});var _0x118b22=_0xca3b('0x52');return db[_0xca3b('0x53')][_0xca3b('0x4d')]({'where':{'name':_0x118b22,'userProfileId':_0x257e48[_0xca3b('0x54')]},'raw':!![]})[_0xca3b('0x28')](function(_0x4101b9){if(_0x4101b9&&_0x4101b9[_0xca3b('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x4c262f[_0xca3b('0x2d')],'resourceId':_0x4c262f['id'],'type':_0x4101b9['name'],'sectionId':_0x4101b9['id']},{})[_0xca3b('0x28')](function(){return _0xb6c7c;});}else{return _0xb6c7c;}})[_0xca3b('0x49')](function(_0x320c86){logger[_0xca3b('0x2b')](_0xca3b('0x56'),_0x320c86);throw _0x320c86;});}return _0xb6c7c;})[_0xca3b('0x28')](respondWithResult(_0x1e6cd3,0xc9))[_0xca3b('0x49')](handleError(_0x1e6cd3,null));};exports[_0xca3b('0x57')]=function(_0x5aab0e,_0x223492){var _0x46676b={'where':{'id':_0x5aab0e[_0xca3b('0x4b')]['id']}},_0x92a660={};_0x92a660[_0xca3b('0x35')]=_[_0xca3b('0x37')](db['Dashboard']['rawAttributes']);_0x46676b[_0xca3b('0x3b')]=_[_0xca3b('0x39')](_0x92a660[_0xca3b('0x35')],qs[_0xca3b('0x3a')](_0x5aab0e[_0xca3b('0x36')][_0xca3b('0x3a')]));_0x46676b['attributes']=_0x46676b[_0xca3b('0x3b')][_0xca3b('0x3c')]?_0x46676b[_0xca3b('0x3b')]:_0x92a660[_0xca3b('0x35')];if(_0x5aab0e[_0xca3b('0x36')][_0xca3b('0x46')]){_0x46676b[_0xca3b('0x4c')]=[{'all':!![]}];}_0x46676b=_[_0xca3b('0x43')]({},_0x46676b,_0x5aab0e[_0xca3b('0x45')]);return db[_0xca3b('0x47')][_0xca3b('0x4d')](_0x46676b)[_0xca3b('0x28')](handleEntityNotFound(_0x223492,null))[_0xca3b('0x28')](function(_0x890d14){if(_0x890d14){var _0x1ef3cd=_0x890d14[_0xca3b('0x29')]({'plain':!![]});_0x1ef3cd=qs['omit'](_0x1ef3cd,['id',_0xca3b('0x58'),_0xca3b('0x59')]);_0x5aab0e[_0xca3b('0x4e')]=_[_0xca3b('0x5a')](_0x5aab0e[_0xca3b('0x4e')],['id',_0xca3b('0x58'),'updatedAt']);return db[_0xca3b('0x47')]['create'](_['merge'](_0x1ef3cd,_0x5aab0e[_0xca3b('0x4e')]),{'include':_0x5aab0e[_0xca3b('0x36')][_0xca3b('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x365967){var _0x4336bc=_0x5aab0e[_0xca3b('0x4f')][_0xca3b('0x29')]({'plain':!![]});if(!_0x4336bc)throw new Error(_0xca3b('0x50'));if(_0x4336bc[_0xca3b('0x51')]===_0xca3b('0x4f')){var _0x58fd7c=_0x365967[_0xca3b('0x29')]({'plain':!![]});var _0x1e32e4=_0xca3b('0x52');return db[_0xca3b('0x53')]['find']({'where':{'name':_0x1e32e4,'userProfileId':_0x4336bc[_0xca3b('0x54')]},'raw':!![]})[_0xca3b('0x28')](function(_0x5e1c75){if(_0x5e1c75&&_0x5e1c75['autoAssociation']===0x0){return db[_0xca3b('0x2a')][_0xca3b('0x5b')]({'name':_0x58fd7c[_0xca3b('0x2d')],'resourceId':_0x58fd7c['id'],'type':_0x5e1c75[_0xca3b('0x2d')],'sectionId':_0x5e1c75['id']},{})[_0xca3b('0x28')](function(){return _0x365967;});}else{return _0x365967;}})[_0xca3b('0x49')](function(_0x21828a){logger[_0xca3b('0x2b')](_0xca3b('0x56'),_0x21828a);throw _0x21828a;});}return _0x365967;});}})['then'](respondWithResult(_0x223492,0xc9))[_0xca3b('0x49')](handleError(_0x223492,null));};exports['update']=function(_0x23c34f,_0x4ed5c6){if(_0x23c34f[_0xca3b('0x4e')]['id']){delete _0x23c34f[_0xca3b('0x4e')]['id'];}return db['Dashboard'][_0xca3b('0x4d')]({'where':{'id':_0x23c34f['params']['id']}})['then'](handleEntityNotFound(_0x4ed5c6,null))['then'](saveUpdates(_0x23c34f[_0xca3b('0x4e')],null))[_0xca3b('0x28')](respondWithResult(_0x4ed5c6,null))['catch'](handleError(_0x4ed5c6,null));};exports[_0xca3b('0x5c')]=function(_0x408f56,_0x118238){return db[_0xca3b('0x47')][_0xca3b('0x4d')]({'where':{'id':_0x408f56[_0xca3b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x118238,null))['then'](removeEntity(_0x118238,null))['catch'](handleError(_0x118238,null));};function widgetAttributes(_0x3ad081){try{switch(_0x3ad081[_0xca3b('0x33')]){case _0xca3b('0x5d'):return[{'name':_0xca3b('0x5e'),'value':_0x3ad081[_0xca3b('0x5e')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x0]?_0x3ad081[_0xca3b('0x5f')][0x0][_0xca3b('0x60')]:undefined)||_0xca3b('0x61')}];case _0xca3b('0x62'):return[{'name':'attrPath','value':_0x3ad081[_0xca3b('0x63')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081['attrs'][0x0]['value']:undefined)||''}];case _0xca3b('0x64'):return[{'name':_0xca3b('0x65'),'value':_0x3ad081['attrHourFormat']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081[_0xca3b('0x5f')][0x0]['value']:undefined)||_0xca3b('0x66')},{'name':_0xca3b('0x67'),'value':_0x3ad081[_0xca3b('0x67')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x1]?_0x3ad081['attrs'][0x1][_0xca3b('0x60')]:undefined)||_0xca3b('0x68')},{'name':_0xca3b('0x69'),'value':_0x3ad081[_0xca3b('0x69')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x2]?_0x3ad081[_0xca3b('0x5f')][0x2][_0xca3b('0x60')]:undefined)||0xc}];case _0xca3b('0x6a'):return[{'name':_0xca3b('0x6b'),'value':_0x3ad081[_0xca3b('0x6b')]||(_0x3ad081['attrs']&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081[_0xca3b('0x5f')][0x0][_0xca3b('0x60')]:undefined)||_0xca3b('0x6c')},{'name':'attrVoiceQueues','value':_0x3ad081[_0xca3b('0x6d')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x1]?_0x3ad081[_0xca3b('0x5f')][0x1][_0xca3b('0x60')]:undefined)||[]},{'name':'attrFontSize','value':_0x3ad081[_0xca3b('0x69')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x2]?_0x3ad081[_0xca3b('0x5f')][0x2]['value']:undefined)||0x14},{'name':_0xca3b('0x6e'),'value':_0x3ad081[_0xca3b('0x6e')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x3]?_0x3ad081[_0xca3b('0x5f')][0x3]['value']:undefined)||'voice'},{'name':_0xca3b('0x6f'),'value':_0x3ad081[_0xca3b('0x6f')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x4]?_0x3ad081[_0xca3b('0x5f')][0x4][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x70'),'value':_0x3ad081['attrFaxAccounts']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x5]?_0x3ad081[_0xca3b('0x5f')][0x5][_0xca3b('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3ad081[_0xca3b('0x71')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x6]?_0x3ad081[_0xca3b('0x5f')][0x6][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x72'),'value':_0x3ad081['attrOpenchannelAccounts']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x7]?_0x3ad081[_0xca3b('0x5f')][0x7][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x73'),'value':_0x3ad081[_0xca3b('0x73')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x8]?_0x3ad081[_0xca3b('0x5f')][0x8][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x74'),'value':_0x3ad081[_0xca3b('0x74')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x9]?_0x3ad081[_0xca3b('0x5f')][0x9][_0xca3b('0x60')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x3ad081['attrSerie1']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x0]?_0x3ad081['attrs'][0x0][_0xca3b('0x60')]:undefined)||_0xca3b('0x6c')},{'name':'attrSerie2','value':_0x3ad081[_0xca3b('0x75')]||(_0x3ad081['attrs']&&_0x3ad081['attrs'][0x1]?_0x3ad081[_0xca3b('0x5f')][0x1][_0xca3b('0x60')]:undefined)||null},{'name':_0xca3b('0x76'),'value':_0x3ad081['attrSerie3']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x2]?_0x3ad081[_0xca3b('0x5f')][0x2][_0xca3b('0x60')]:undefined)||null},{'name':_0xca3b('0x6d'),'value':_0x3ad081[_0xca3b('0x6d')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x3]?_0x3ad081['attrs'][0x3][_0xca3b('0x60')]:undefined)||[]},{'name':'attrChannel','value':_0x3ad081[_0xca3b('0x6e')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x4]?_0x3ad081['attrs'][0x4]['value']:undefined)||_0xca3b('0x77')},{'name':_0xca3b('0x6f'),'value':_0x3ad081[_0xca3b('0x6f')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x5]?_0x3ad081[_0xca3b('0x5f')][0x5][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x70'),'value':_0x3ad081[_0xca3b('0x70')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x6]?_0x3ad081[_0xca3b('0x5f')][0x6][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x71'),'value':_0x3ad081['attrSmsAccounts']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x7]?_0x3ad081[_0xca3b('0x5f')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3ad081[_0xca3b('0x72')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x8]?_0x3ad081['attrs'][0x8]['value']:undefined)||''},{'name':_0xca3b('0x73'),'value':_0x3ad081[_0xca3b('0x73')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081['attrs'][0x9]?_0x3ad081[_0xca3b('0x5f')][0x9][_0xca3b('0x60')]:undefined)||''},{'name':_0xca3b('0x74'),'value':_0x3ad081['attrChatWebsites']||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0xa]?_0x3ad081[_0xca3b('0x5f')][0xa]['value']:undefined)||''}];case _0xca3b('0x78'):return[{'name':_0xca3b('0x79'),'type':_0x3ad081[_0xca3b('0x7a')]||(_0x3ad081['attrs']&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081['attrs'][0x0][_0xca3b('0x33')]:undefined)||null,'value':_0x3ad081[_0xca3b('0x79')]||(_0x3ad081[_0xca3b('0x5f')]&&_0x3ad081[_0xca3b('0x5f')][0x0]?_0x3ad081[_0xca3b('0x5f')][0x0][_0xca3b('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x3ad081[_0xca3b('0x7b')]||(_0x3ad081['attrs']&&_0x3ad081[_0xca3b('0x5f')][0x1]?_0x3ad081[_0xca3b('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x175ddc){logger[_0xca3b('0x2b')]('widgetAttributes:\x20%s',JSON['stringify'](_0x175ddc));return[];}}exports[_0xca3b('0x7c')]=function(_0x183c15,_0x1fd255,_0x14788a){if(_0x183c15[_0xca3b('0x4e')]['id']){delete _0x183c15['body']['id'];}return db['Dashboard'][_0xca3b('0x4d')]({'where':{'id':_0x183c15[_0xca3b('0x4b')]['id']}})[_0xca3b('0x28')](handleEntityNotFound(_0x1fd255,null))['then'](function(_0x576381){if(_0x576381){_0x183c15[_0xca3b('0x4e')][_0xca3b('0x7d')]=_0x576381['id'];_0x183c15['body'][_0xca3b('0x5f')]=widgetAttributes(_0x183c15[_0xca3b('0x4e')]);return db[_0xca3b('0x7e')]['create'](_0x183c15['body']);}})[_0xca3b('0x28')](respondWithResult(_0x1fd255,null))[_0xca3b('0x49')](handleError(_0x1fd255,null));};exports[_0xca3b('0x7f')]=function(_0x47cec8,_0x42f4e8,_0x18fcb7){var _0x100d24={};var _0x5e7dbd={};var _0x1e49cf;var _0x2667d4;return db['Dashboard'][_0xca3b('0x80')]({'where':{'id':_0x47cec8[_0xca3b('0x4b')]['id']}})[_0xca3b('0x28')](handleEntityNotFound(_0x42f4e8,null))['then'](function(_0x2c11b5){if(_0x2c11b5){_0x1e49cf=_0x2c11b5;_0x5e7dbd[_0xca3b('0x35')]=_[_0xca3b('0x37')](db[_0xca3b('0x7e')][_0xca3b('0x31')]);_0x5e7dbd['query']=_[_0xca3b('0x37')](_0x47cec8[_0xca3b('0x36')]);_0x5e7dbd[_0xca3b('0x38')]=_[_0xca3b('0x39')](_0x5e7dbd[_0xca3b('0x35')],_0x5e7dbd[_0xca3b('0x36')]);_0x100d24[_0xca3b('0x3b')]=_[_0xca3b('0x39')](_0x5e7dbd[_0xca3b('0x35')],qs[_0xca3b('0x3a')](_0x47cec8[_0xca3b('0x36')]['fields']));_0x100d24[_0xca3b('0x3b')]=_0x100d24[_0xca3b('0x3b')][_0xca3b('0x3c')]?_0x100d24[_0xca3b('0x3b')]:_0x5e7dbd[_0xca3b('0x35')];_0x100d24['order']=qs[_0xca3b('0x3f')](_0x47cec8['query']['sort']);_0x100d24[_0xca3b('0x40')]=qs[_0xca3b('0x38')](_[_0xca3b('0x41')](_0x47cec8['query'],_0x5e7dbd[_0xca3b('0x38')]));if(_0x47cec8[_0xca3b('0x36')][_0xca3b('0x42')]){_0x100d24['where']=_[_0xca3b('0x43')](_0x100d24[_0xca3b('0x40')],{'$or':_[_0xca3b('0x30')](_0x100d24[_0xca3b('0x3b')],function(_0x35b717){var _0x4e9aba={};_0x4e9aba[_0x35b717]={'$like':'%'+_0x47cec8[_0xca3b('0x36')][_0xca3b('0x42')]+'%'};return _0x4e9aba;})});}_0x100d24=_[_0xca3b('0x43')]({},_0x100d24,_0x47cec8[_0xca3b('0x45')]);return _0x1e49cf[_0xca3b('0x7f')](_0x100d24);}})[_0xca3b('0x28')](function(_0x318ce9){if(_0x318ce9){_0x2667d4=_0x318ce9[_0xca3b('0x3c')];if(!_0x47cec8[_0xca3b('0x36')][_0xca3b('0x3d')]('nolimit')){_0x100d24[_0xca3b('0x22')]=qs[_0xca3b('0x22')](_0x47cec8['query']['limit']);_0x100d24[_0xca3b('0x20')]=qs[_0xca3b('0x20')](_0x47cec8[_0xca3b('0x36')][_0xca3b('0x20')]);}return _0x1e49cf[_0xca3b('0x7f')](_0x100d24);}})[_0xca3b('0x28')](function(_0x20e33c){if(_0x20e33c){return _0x20e33c?{'count':_0x2667d4,'rows':_0x20e33c}:null;}})['then'](respondWithResult(_0x42f4e8,null))[_0xca3b('0x49')](handleError(_0x42f4e8,null));}; \ No newline at end of file +var _0x2494=['../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','end','error','stack','name','index','map','Dashboard','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','catch','clone','rawAttributes','omit','createdAt','updatedAt','body','role','UserProfileSection','type','attrs','https://','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','getItems','findOne','DashboardItem','order','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0xdef717,_0x2fda4c){var _0x2d0fe5=function(_0x5c3fa4){while(--_0x5c3fa4){_0xdef717['push'](_0xdef717['shift']());}};_0x2d0fe5(++_0x2fda4c);}(_0x2494,0x171));var _0x4249=function(_0x5e4732,_0x259177){_0x5e4732=_0x5e4732-0x0;var _0x11124a=_0x2494[_0x5e4732];return _0x11124a;};'use strict';var emlformat=require(_0x4249('0x0'));var rimraf=require(_0x4249('0x1'));var zipdir=require(_0x4249('0x2'));var jsonpatch=require(_0x4249('0x3'));var rp=require(_0x4249('0x4'));var moment=require(_0x4249('0x5'));var BPromise=require(_0x4249('0x6'));var Mustache=require(_0x4249('0x7'));var util=require('util');var path=require('path');var sox=require(_0x4249('0x8'));var csv=require(_0x4249('0x9'));var ejs=require(_0x4249('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4249('0xb'));var squel=require('squel');var crypto=require(_0x4249('0xc'));var jsforce=require(_0x4249('0xd'));var deskjs=require(_0x4249('0xe'));var toCsv=require(_0x4249('0x9'));var querystring=require('querystring');var Papa=require(_0x4249('0xf'));var Redis=require(_0x4249('0x10'));var authService=require(_0x4249('0x11'));var qs=require(_0x4249('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4249('0x13'))(_0x4249('0x14'));var utils=require(_0x4249('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4249('0x16'));var db=require(_0x4249('0x17'))['db'];config[_0x4249('0x18')]=_[_0x4249('0x19')](config[_0x4249('0x18')],{'host':_0x4249('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4249('0x1b'))['register'](socket);function respondWithStatusCode(_0x4f4f2c,_0x192363){_0x192363=_0x192363||0xcc;return function(_0x1c3930){if(_0x1c3930){return _0x4f4f2c[_0x4249('0x1c')](_0x192363);}return _0x4f4f2c[_0x4249('0x1d')](_0x192363)['end']();};}function respondWithResult(_0x24def5,_0x281872){_0x281872=_0x281872||0xc8;return function(_0x16bcef){if(_0x16bcef){return _0x24def5[_0x4249('0x1d')](_0x281872)[_0x4249('0x1e')](_0x16bcef);}};}function respondWithFilteredResult(_0x4d4d9b,_0x35ab26){return function(_0x3ed05f){if(_0x3ed05f){var _0x5cb400=typeof _0x35ab26[_0x4249('0x1f')]==='undefined'&&typeof _0x35ab26['limit']==='undefined';var _0x4167e5=_0x3ed05f[_0x4249('0x20')];var _0x4ee2a0=_0x5cb400?0x0:_0x35ab26[_0x4249('0x1f')];var _0xe41d66=_0x5cb400?_0x3ed05f[_0x4249('0x20')]:_0x35ab26[_0x4249('0x1f')]+_0x35ab26[_0x4249('0x21')];var _0x23808c;if(_0xe41d66>=_0x4167e5){_0xe41d66=_0x4167e5;_0x23808c=0xc8;}else{_0x23808c=0xce;}_0x4d4d9b[_0x4249('0x1d')](_0x23808c);return _0x4d4d9b[_0x4249('0x22')](_0x4249('0x23'),_0x4ee2a0+'-'+_0xe41d66+'/'+_0x4167e5)['json'](_0x3ed05f);}return null;};}function patchUpdates(_0x1511e8){return function(_0x77fdd8){try{jsonpatch[_0x4249('0x24')](_0x77fdd8,_0x1511e8,!![]);}catch(_0x3e67e2){return BPromise[_0x4249('0x25')](_0x3e67e2);}return _0x77fdd8[_0x4249('0x26')]();};}function saveUpdates(_0x1cdbcf,_0x37fd68){return function(_0x120499){if(_0x120499){return _0x120499[_0x4249('0x27')](_0x1cdbcf)[_0x4249('0x28')](function(_0x44d9f5){return _0x44d9f5;});}return null;};}function removeEntity(_0x25116c,_0x253749){return function(_0xbcd598){if(_0xbcd598){return _0xbcd598[_0x4249('0x29')]()[_0x4249('0x28')](function(){var _0x208bab=_0xbcd598[_0x4249('0x2a')]({'plain':!![]});var _0x12f445=_0x4249('0x2b');return db['UserProfileResource'][_0x4249('0x29')]({'where':{'type':_0x12f445,'resourceId':_0x208bab['id']}})[_0x4249('0x28')](function(){return _0xbcd598;});})[_0x4249('0x28')](function(){_0x25116c[_0x4249('0x1d')](0xcc)[_0x4249('0x2c')]();});}};}function handleEntityNotFound(_0x268839,_0x36a245){return function(_0x3fff4f){if(!_0x3fff4f){_0x268839[_0x4249('0x1c')](0x194);}return _0x3fff4f;};}function handleError(_0x193607,_0x50d7eb){_0x50d7eb=_0x50d7eb||0x1f4;return function(_0x5eea05){logger[_0x4249('0x2d')](_0x5eea05[_0x4249('0x2e')]);if(_0x5eea05[_0x4249('0x2f')]){delete _0x5eea05['name'];}_0x193607[_0x4249('0x1d')](_0x50d7eb)['send'](_0x5eea05);};}exports[_0x4249('0x30')]=function(_0x513407,_0xf50374){var _0x1c1810={},_0xe3d517={},_0x162107={'count':0x0,'rows':[]};var _0x1bb828=_[_0x4249('0x31')](db[_0x4249('0x32')]['rawAttributes'],function(_0x4a64ed){return{'name':_0x4a64ed[_0x4249('0x33')],'type':_0x4a64ed['type'][_0x4249('0x34')]};});_0xe3d517['model']=_['map'](_0x1bb828,'name');_0xe3d517[_0x4249('0x35')]=_[_0x4249('0x36')](_0x513407['query']);_0xe3d517[_0x4249('0x37')]=_[_0x4249('0x38')](_0xe3d517[_0x4249('0x39')],_0xe3d517[_0x4249('0x35')]);_0x1c1810[_0x4249('0x3a')]=_[_0x4249('0x38')](_0xe3d517['model'],qs[_0x4249('0x3b')](_0x513407['query'][_0x4249('0x3b')]));_0x1c1810[_0x4249('0x3a')]=_0x1c1810[_0x4249('0x3a')][_0x4249('0x3c')]?_0x1c1810[_0x4249('0x3a')]:_0xe3d517['model'];if(!_0x513407[_0x4249('0x35')][_0x4249('0x3d')](_0x4249('0x3e'))){_0x1c1810['limit']=qs[_0x4249('0x21')](_0x513407[_0x4249('0x35')]['limit']);_0x1c1810[_0x4249('0x1f')]=qs['offset'](_0x513407[_0x4249('0x35')][_0x4249('0x1f')]);}_0x1c1810['order']=qs[_0x4249('0x3f')](_0x513407[_0x4249('0x35')][_0x4249('0x3f')]);_0x1c1810[_0x4249('0x40')]=qs['filters'](_['pick'](_0x513407[_0x4249('0x35')],_0xe3d517['filters']),_0x1bb828);if(_0x513407[_0x4249('0x35')][_0x4249('0x41')]){_0x1c1810[_0x4249('0x40')]=_[_0x4249('0x42')](_0x1c1810[_0x4249('0x40')],{'$or':_['map'](_0x1bb828,function(_0x5d4360){if(_0x5d4360['type']!==_0x4249('0x43')){var _0x507234={};_0x507234[_0x5d4360[_0x4249('0x2f')]]={'$like':'%'+_0x513407['query']['filter']+'%'};return _0x507234;}})});}_0x1c1810=_[_0x4249('0x42')]({},_0x1c1810,_0x513407[_0x4249('0x44')]);var _0x11c133={'where':_0x1c1810[_0x4249('0x40')]};return db['Dashboard']['count'](_0x11c133)[_0x4249('0x28')](function(_0x463a73){_0x162107['count']=_0x463a73;if(_0x513407[_0x4249('0x35')][_0x4249('0x45')]){_0x1c1810[_0x4249('0x46')]=[{'all':!![]}];}return db['Dashboard'][_0x4249('0x47')](_0x1c1810);})['then'](function(_0x2673eb){_0x162107[_0x4249('0x48')]=_0x2673eb;return _0x162107;})[_0x4249('0x28')](respondWithFilteredResult(_0xf50374,_0x1c1810))['catch'](handleError(_0xf50374,null));};exports[_0x4249('0x49')]=function(_0x571ec0,_0x3749b1){var _0x47f396={'raw':![],'where':{'id':_0x571ec0[_0x4249('0x4a')]['id']}},_0x3f47bf={};_0x3f47bf['model']=_[_0x4249('0x36')](db[_0x4249('0x32')]['rawAttributes']);_0x3f47bf[_0x4249('0x35')]=_['keys'](_0x571ec0[_0x4249('0x35')]);_0x3f47bf['filters']=_[_0x4249('0x38')](_0x3f47bf['model'],_0x3f47bf[_0x4249('0x35')]);_0x47f396[_0x4249('0x3a')]=_['intersection'](_0x3f47bf['model'],qs[_0x4249('0x3b')](_0x571ec0['query'][_0x4249('0x3b')]));_0x47f396[_0x4249('0x3a')]=_0x47f396['attributes'][_0x4249('0x3c')]?_0x47f396[_0x4249('0x3a')]:_0x3f47bf[_0x4249('0x39')];if(_0x571ec0[_0x4249('0x35')][_0x4249('0x45')]){_0x47f396[_0x4249('0x46')]=[{'all':!![]}];}_0x47f396=_[_0x4249('0x42')]({},_0x47f396,_0x571ec0['options']);return db[_0x4249('0x32')][_0x4249('0x4b')](_0x47f396)[_0x4249('0x28')](handleEntityNotFound(_0x3749b1,null))[_0x4249('0x28')](respondWithResult(_0x3749b1,null))['catch'](handleError(_0x3749b1,null));};exports[_0x4249('0x4c')]=function(_0x12ec7e,_0x2c7465){return db[_0x4249('0x32')][_0x4249('0x4c')](_0x12ec7e['body'],{})[_0x4249('0x28')](function(_0x34bca0){var _0x31ad98=_0x12ec7e[_0x4249('0x4d')]['get']({'plain':!![]});if(!_0x31ad98)throw new Error(_0x4249('0x4e'));if(_0x31ad98['role']===_0x4249('0x4d')){var _0x3fb34e=_0x34bca0[_0x4249('0x2a')]({'plain':!![]});var _0x5a7444=_0x4249('0x2b');return db['UserProfileSection'][_0x4249('0x4b')]({'where':{'name':_0x5a7444,'userProfileId':_0x31ad98[_0x4249('0x4f')]},'raw':!![]})[_0x4249('0x28')](function(_0x33a5d4){if(_0x33a5d4&&_0x33a5d4[_0x4249('0x50')]===0x0){return db[_0x4249('0x51')]['create']({'name':_0x3fb34e['name'],'resourceId':_0x3fb34e['id'],'type':_0x33a5d4[_0x4249('0x2f')],'sectionId':_0x33a5d4['id']},{})['then'](function(){return _0x34bca0;});}else{return _0x34bca0;}})[_0x4249('0x52')](function(_0x5a8897){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a8897);throw _0x5a8897;});}return _0x34bca0;})[_0x4249('0x28')](respondWithResult(_0x2c7465,0xc9))['catch'](handleError(_0x2c7465,null));};exports[_0x4249('0x53')]=function(_0x2efef9,_0x672cc2){var _0x742b52={'where':{'id':_0x2efef9['params']['id']}},_0xca53a3={};_0xca53a3['model']=_['keys'](db[_0x4249('0x32')][_0x4249('0x54')]);_0x742b52[_0x4249('0x3a')]=_[_0x4249('0x38')](_0xca53a3[_0x4249('0x39')],qs[_0x4249('0x3b')](_0x2efef9['query'][_0x4249('0x3b')]));_0x742b52['attributes']=_0x742b52[_0x4249('0x3a')][_0x4249('0x3c')]?_0x742b52[_0x4249('0x3a')]:_0xca53a3['model'];if(_0x2efef9[_0x4249('0x35')][_0x4249('0x45')]){_0x742b52[_0x4249('0x46')]=[{'all':!![]}];}_0x742b52=_[_0x4249('0x42')]({},_0x742b52,_0x2efef9['options']);return db['Dashboard'][_0x4249('0x4b')](_0x742b52)['then'](handleEntityNotFound(_0x672cc2,null))[_0x4249('0x28')](function(_0x5994fb){if(_0x5994fb){var _0x53f58a=_0x5994fb[_0x4249('0x2a')]({'plain':!![]});_0x53f58a=qs[_0x4249('0x55')](_0x53f58a,['id',_0x4249('0x56'),_0x4249('0x57')]);_0x2efef9['body']=_[_0x4249('0x55')](_0x2efef9['body'],['id',_0x4249('0x56'),_0x4249('0x57')]);return db[_0x4249('0x32')][_0x4249('0x4c')](_['merge'](_0x53f58a,_0x2efef9[_0x4249('0x58')]),{'include':_0x2efef9[_0x4249('0x35')][_0x4249('0x45')]?[{'all':!![]}]:undefined})[_0x4249('0x28')](function(_0x4aa224){var _0x5b785b=_0x2efef9['user'][_0x4249('0x2a')]({'plain':!![]});if(!_0x5b785b)throw new Error(_0x4249('0x4e'));if(_0x5b785b[_0x4249('0x59')]===_0x4249('0x4d')){var _0x24d9ad=_0x4aa224[_0x4249('0x2a')]({'plain':!![]});var _0xc48a7c=_0x4249('0x2b');return db[_0x4249('0x5a')][_0x4249('0x4b')]({'where':{'name':_0xc48a7c,'userProfileId':_0x5b785b[_0x4249('0x4f')]},'raw':!![]})['then'](function(_0x3699b7){if(_0x3699b7&&_0x3699b7[_0x4249('0x50')]===0x0){return db[_0x4249('0x51')]['create']({'name':_0x24d9ad[_0x4249('0x2f')],'resourceId':_0x24d9ad['id'],'type':_0x3699b7[_0x4249('0x2f')],'sectionId':_0x3699b7['id']},{})['then'](function(){return _0x4aa224;});}else{return _0x4aa224;}})['catch'](function(_0x509108){logger[_0x4249('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x509108);throw _0x509108;});}return _0x4aa224;});}})[_0x4249('0x28')](respondWithResult(_0x672cc2,0xc9))[_0x4249('0x52')](handleError(_0x672cc2,null));};exports[_0x4249('0x27')]=function(_0xe4540e,_0x2031c1){if(_0xe4540e[_0x4249('0x58')]['id']){delete _0xe4540e[_0x4249('0x58')]['id'];}return db[_0x4249('0x32')][_0x4249('0x4b')]({'where':{'id':_0xe4540e[_0x4249('0x4a')]['id']}})[_0x4249('0x28')](handleEntityNotFound(_0x2031c1,null))[_0x4249('0x28')](saveUpdates(_0xe4540e['body'],null))[_0x4249('0x28')](respondWithResult(_0x2031c1,null))[_0x4249('0x52')](handleError(_0x2031c1,null));};exports['destroy']=function(_0x598435,_0x5efcd2){return db[_0x4249('0x32')]['find']({'where':{'id':_0x598435['params']['id']}})[_0x4249('0x28')](handleEntityNotFound(_0x5efcd2,null))[_0x4249('0x28')](removeEntity(_0x5efcd2,null))['catch'](handleError(_0x5efcd2,null));};function widgetAttributes(_0x249d0d){try{switch(_0x249d0d[_0x4249('0x5b')]){case'iframe':return[{'name':'attrUrl','value':_0x249d0d['attrUrl']||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x0]?_0x249d0d['attrs'][0x0]['value']:undefined)||_0x4249('0x5d')}];case _0x4249('0x5e'):return[{'name':_0x4249('0x5f'),'value':_0x249d0d[_0x4249('0x5f')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x0]?_0x249d0d[_0x4249('0x5c')][0x0][_0x4249('0x60')]:undefined)||''}];case _0x4249('0x61'):return[{'name':_0x4249('0x62'),'value':_0x249d0d[_0x4249('0x62')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d['attrs'][0x0]?_0x249d0d[_0x4249('0x5c')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0x4249('0x63'),'value':_0x249d0d[_0x4249('0x63')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x1]?_0x249d0d[_0x4249('0x5c')][0x1][_0x4249('0x60')]:undefined)||_0x4249('0x64')},{'name':_0x4249('0x65'),'value':_0x249d0d[_0x4249('0x65')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x2]?_0x249d0d['attrs'][0x2][_0x4249('0x60')]:undefined)||0xc}];case _0x4249('0x66'):return[{'name':'attrMetric','value':_0x249d0d[_0x4249('0x67')]||(_0x249d0d['attrs']&&_0x249d0d[_0x4249('0x5c')][0x0]?_0x249d0d[_0x4249('0x5c')][0x0][_0x4249('0x60')]:undefined)||_0x4249('0x68')},{'name':'attrVoiceQueues','value':_0x249d0d[_0x4249('0x69')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x1]?_0x249d0d[_0x4249('0x5c')][0x1][_0x4249('0x60')]:undefined)||[]},{'name':_0x4249('0x65'),'value':_0x249d0d[_0x4249('0x65')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x2]?_0x249d0d[_0x4249('0x5c')][0x2][_0x4249('0x60')]:undefined)||0x14},{'name':'attrChannel','value':_0x249d0d[_0x4249('0x6a')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d['attrs'][0x3]?_0x249d0d[_0x4249('0x5c')][0x3][_0x4249('0x60')]:undefined)||_0x4249('0x6b')},{'name':_0x4249('0x6c'),'value':_0x249d0d[_0x4249('0x6c')]||(_0x249d0d['attrs']&&_0x249d0d[_0x4249('0x5c')][0x4]?_0x249d0d[_0x4249('0x5c')][0x4]['value']:undefined)||''},{'name':_0x4249('0x6d'),'value':_0x249d0d[_0x4249('0x6d')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d['attrs'][0x5]?_0x249d0d[_0x4249('0x5c')][0x5][_0x4249('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x249d0d[_0x4249('0x6e')]||(_0x249d0d['attrs']&&_0x249d0d[_0x4249('0x5c')][0x6]?_0x249d0d[_0x4249('0x5c')][0x6][_0x4249('0x60')]:undefined)||''},{'name':_0x4249('0x6f'),'value':_0x249d0d['attrOpenchannelAccounts']||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x7]?_0x249d0d[_0x4249('0x5c')][0x7]['value']:undefined)||''},{'name':_0x4249('0x70'),'value':_0x249d0d[_0x4249('0x70')]||(_0x249d0d['attrs']&&_0x249d0d[_0x4249('0x5c')][0x8]?_0x249d0d[_0x4249('0x5c')][0x8][_0x4249('0x60')]:undefined)||''},{'name':_0x4249('0x71'),'value':_0x249d0d['attrChatWebsites']||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d['attrs'][0x9]?_0x249d0d[_0x4249('0x5c')][0x9]['value']:undefined)||''}];case _0x4249('0x72'):case _0x4249('0x73'):return[{'name':_0x4249('0x74'),'value':_0x249d0d[_0x4249('0x74')]||(_0x249d0d['attrs']&&_0x249d0d[_0x4249('0x5c')][0x0]?_0x249d0d[_0x4249('0x5c')][0x0][_0x4249('0x60')]:undefined)||'total'},{'name':'attrSerie2','value':_0x249d0d[_0x4249('0x75')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x1]?_0x249d0d['attrs'][0x1]['value']:undefined)||null},{'name':_0x4249('0x76'),'value':_0x249d0d[_0x4249('0x76')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x2]?_0x249d0d[_0x4249('0x5c')][0x2][_0x4249('0x60')]:undefined)||null},{'name':_0x4249('0x69'),'value':_0x249d0d['attrVoiceQueues']||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x3]?_0x249d0d[_0x4249('0x5c')][0x3][_0x4249('0x60')]:undefined)||[]},{'name':_0x4249('0x6a'),'value':_0x249d0d['attrChannel']||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x4]?_0x249d0d['attrs'][0x4][_0x4249('0x60')]:undefined)||_0x4249('0x6b')},{'name':_0x4249('0x6c'),'value':_0x249d0d['attrEmailAccounts']||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x5]?_0x249d0d[_0x4249('0x5c')][0x5]['value']:undefined)||''},{'name':_0x4249('0x6d'),'value':_0x249d0d[_0x4249('0x6d')]||(_0x249d0d['attrs']&&_0x249d0d[_0x4249('0x5c')][0x6]?_0x249d0d[_0x4249('0x5c')][0x6][_0x4249('0x60')]:undefined)||''},{'name':_0x4249('0x6e'),'value':_0x249d0d[_0x4249('0x6e')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d['attrs'][0x7]?_0x249d0d[_0x4249('0x5c')][0x7][_0x4249('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x249d0d[_0x4249('0x6f')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d['attrs'][0x8]?_0x249d0d[_0x4249('0x5c')][0x8][_0x4249('0x60')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x249d0d['attrWhatsappAccounts']||(_0x249d0d['attrs']&&_0x249d0d[_0x4249('0x5c')][0x9]?_0x249d0d[_0x4249('0x5c')][0x9][_0x4249('0x60')]:undefined)||''},{'name':_0x4249('0x71'),'value':_0x249d0d[_0x4249('0x71')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0xa]?_0x249d0d[_0x4249('0x5c')][0xa]['value']:undefined)||''}];case _0x4249('0x77'):return[{'name':_0x4249('0x78'),'type':_0x249d0d[_0x4249('0x79')]||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x0]?_0x249d0d[_0x4249('0x5c')][0x0][_0x4249('0x5b')]:undefined)||null,'value':_0x249d0d['attrReport']||(_0x249d0d[_0x4249('0x5c')]&&_0x249d0d[_0x4249('0x5c')][0x0]?_0x249d0d[_0x4249('0x5c')][0x0][_0x4249('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x249d0d[_0x4249('0x7a')]||(_0x249d0d['attrs']&&_0x249d0d[_0x4249('0x5c')][0x1]?_0x249d0d[_0x4249('0x5c')][0x1][_0x4249('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x2ceb4c){logger[_0x4249('0x2d')](_0x4249('0x7b'),JSON['stringify'](_0x2ceb4c));return[];}}exports['addItem']=function(_0x4a1311,_0x45b251,_0x857052){if(_0x4a1311[_0x4249('0x58')]['id']){delete _0x4a1311['body']['id'];}return db[_0x4249('0x32')][_0x4249('0x4b')]({'where':{'id':_0x4a1311[_0x4249('0x4a')]['id']}})[_0x4249('0x28')](handleEntityNotFound(_0x45b251,null))[_0x4249('0x28')](function(_0x10ba4c){if(_0x10ba4c){_0x4a1311['body'][_0x4249('0x7c')]=_0x10ba4c['id'];_0x4a1311[_0x4249('0x58')][_0x4249('0x5c')]=widgetAttributes(_0x4a1311[_0x4249('0x58')]);return db['DashboardItem']['create'](_0x4a1311[_0x4249('0x58')]);}})[_0x4249('0x28')](respondWithResult(_0x45b251,null))[_0x4249('0x52')](handleError(_0x45b251,null));};exports[_0x4249('0x7d')]=function(_0x465b0d,_0x403e19,_0x4a9775){var _0x2445af={};var _0x49fc00={};var _0x3e7bce;var _0x31401e;return db[_0x4249('0x32')][_0x4249('0x7e')]({'where':{'id':_0x465b0d['params']['id']}})['then'](handleEntityNotFound(_0x403e19,null))[_0x4249('0x28')](function(_0x1702c9){if(_0x1702c9){_0x3e7bce=_0x1702c9;_0x49fc00[_0x4249('0x39')]=_[_0x4249('0x36')](db[_0x4249('0x7f')][_0x4249('0x54')]);_0x49fc00[_0x4249('0x35')]=_['keys'](_0x465b0d['query']);_0x49fc00[_0x4249('0x37')]=_[_0x4249('0x38')](_0x49fc00[_0x4249('0x39')],_0x49fc00[_0x4249('0x35')]);_0x2445af[_0x4249('0x3a')]=_[_0x4249('0x38')](_0x49fc00[_0x4249('0x39')],qs[_0x4249('0x3b')](_0x465b0d[_0x4249('0x35')][_0x4249('0x3b')]));_0x2445af[_0x4249('0x3a')]=_0x2445af['attributes'][_0x4249('0x3c')]?_0x2445af[_0x4249('0x3a')]:_0x49fc00['model'];_0x2445af[_0x4249('0x80')]=qs['sort'](_0x465b0d[_0x4249('0x35')][_0x4249('0x3f')]);_0x2445af[_0x4249('0x40')]=qs[_0x4249('0x37')](_[_0x4249('0x81')](_0x465b0d['query'],_0x49fc00['filters']));if(_0x465b0d[_0x4249('0x35')][_0x4249('0x41')]){_0x2445af['where']=_[_0x4249('0x42')](_0x2445af[_0x4249('0x40')],{'$or':_[_0x4249('0x31')](_0x2445af[_0x4249('0x3a')],function(_0x4e6c52){var _0xb1803c={};_0xb1803c[_0x4e6c52]={'$like':'%'+_0x465b0d[_0x4249('0x35')]['filter']+'%'};return _0xb1803c;})});}_0x2445af=_[_0x4249('0x42')]({},_0x2445af,_0x465b0d[_0x4249('0x44')]);return _0x3e7bce[_0x4249('0x7d')](_0x2445af);}})[_0x4249('0x28')](function(_0x3ab047){if(_0x3ab047){_0x31401e=_0x3ab047['length'];if(!_0x465b0d[_0x4249('0x35')][_0x4249('0x3d')]('nolimit')){_0x2445af[_0x4249('0x21')]=qs['limit'](_0x465b0d[_0x4249('0x35')][_0x4249('0x21')]);_0x2445af[_0x4249('0x1f')]=qs[_0x4249('0x1f')](_0x465b0d[_0x4249('0x35')][_0x4249('0x1f')]);}return _0x3e7bce['getItems'](_0x2445af);}})['then'](function(_0xec928c){if(_0xec928c){return _0xec928c?{'count':_0x31401e,'rows':_0xec928c}:null;}})['then'](respondWithResult(_0x403e19,null))[_0x4249('0x52')](handleError(_0x403e19,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index f5a03f5..a32496d 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 _0x9ac9=['emit','hasOwnProperty','hook','exports','events','Dashboard','save','update','remove'];(function(_0x357a72,_0x5c32ff){var _0x3820b0=function(_0x2c9896){while(--_0x2c9896){_0x357a72['push'](_0x357a72['shift']());}};_0x3820b0(++_0x5c32ff);}(_0x9ac9,0x190));var _0x99ac=function(_0x1176d9,_0x2a1b64){_0x1176d9=_0x1176d9-0x0;var _0x3d1cb6=_0x9ac9[_0x1176d9];return _0x3d1cb6;};'use strict';var EventEmitter=require(_0x99ac('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x99ac('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x99ac('0x2'),'afterUpdate':_0x99ac('0x3'),'afterDestroy':_0x99ac('0x4')};function emitEvent(_0x2a2474){return function(_0x4f2015,_0x182dab,_0x262871){DashboardEvents['emit'](_0x2a2474+':'+_0x4f2015['id'],_0x4f2015);DashboardEvents[_0x99ac('0x5')](_0x2a2474,_0x4f2015);_0x262871(null);};}for(var e in events){if(events[_0x99ac('0x6')](e)){var event=events[e];Dashboard[_0x99ac('0x7')](e,emitEvent(event));}}module[_0x99ac('0x8')]=DashboardEvents; \ No newline at end of file +var _0x184a=['Dashboard','setMaxListeners','save','remove','emit','hook','events'];(function(_0x5c7174,_0x4954d3){var _0x33cec3=function(_0x3d75c6){while(--_0x3d75c6){_0x5c7174['push'](_0x5c7174['shift']());}};_0x33cec3(++_0x4954d3);}(_0x184a,0x16b));var _0xa184=function(_0x96bb1f,_0x261d0c){_0x96bb1f=_0x96bb1f-0x0;var _0x504f48=_0x184a[_0x96bb1f];return _0x504f48;};'use strict';var EventEmitter=require(_0xa184('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xa184('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xa184('0x2')](0x0);var events={'afterCreate':_0xa184('0x3'),'afterUpdate':'update','afterDestroy':_0xa184('0x4')};function emitEvent(_0x1d2ef7){return function(_0x87e562,_0x2d49c6,_0x442467){DashboardEvents[_0xa184('0x5')](_0x1d2ef7+':'+_0x87e562['id'],_0x87e562);DashboardEvents[_0xa184('0x5')](_0x1d2ef7,_0x87e562);_0x442467(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xa184('0x6')](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 2bba9b5..b2be3c6 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 _0x2be0=['moment','request-promise','path','rimraf','./dashboard.attributes','exports','Dashboard','dashboards','lodash','util','../../config/logger','api'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x2be0,0x128));var _0x02be=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x2be0[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x02be('0x0'));var util=require(_0x02be('0x1'));var logger=require(_0x02be('0x2'))(_0x02be('0x3'));var moment=require(_0x02be('0x4'));var BPromise=require('bluebird');var rp=require(_0x02be('0x5'));var fs=require('fs');var path=require(_0x02be('0x6'));var rimraf=require(_0x02be('0x7'));var config=require('../../config/environment');var attributes=require(_0x02be('0x8'));module[_0x02be('0x9')]=function(_0x46392d,_0x184bf6){return _0x46392d['define'](_0x02be('0xa'),attributes,{'tableName':_0x02be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda44=['bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','api','moment'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0xda44,0x175));var _0x4da4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xda44[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x4da4('0x0'));var util=require(_0x4da4('0x1'));var logger=require(_0x4da4('0x2'))(_0x4da4('0x3'));var moment=require(_0x4da4('0x4'));var BPromise=require(_0x4da4('0x5'));var rp=require(_0x4da4('0x6'));var fs=require('fs');var path=require(_0x4da4('0x7'));var rimraf=require(_0x4da4('0x8'));var config=require(_0x4da4('0x9'));var attributes=require(_0x4da4('0xa'));module['exports']=function(_0x4fc154,_0x4291c3){return _0x4fc154[_0x4da4('0xb')](_0x4da4('0xc'),attributes,{'tableName':_0x4da4('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 d322396..c799e45 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 _0x2698=['stringify','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xe094ab,_0x3aa511){var _0x3ad8ed=function(_0x231c63){while(--_0x231c63){_0xe094ab['push'](_0xe094ab['shift']());}};_0x3ad8ed(++_0x3aa511);}(_0x2698,0x124));var _0x8269=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2698[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8269('0x0'));var util=require('util');var moment=require(_0x8269('0x1'));var BPromise=require(_0x8269('0x2'));var rs=require(_0x8269('0x3'));var fs=require('fs');var Redis=require(_0x8269('0x4'));var db=require(_0x8269('0x5'))['db'];var utils=require(_0x8269('0x6'));var logger=require(_0x8269('0x7'))(_0x8269('0x8'));var config=require(_0x8269('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8269('0xa')]({'port':0x232a});config[_0x8269('0xb')]=_['defaults'](config[_0x8269('0xb')],{'host':_0x8269('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8269('0xb')]));require(_0x8269('0xd'))[_0x8269('0xe')](socket);function respondWithRpcPromise(_0x59621c,_0x8747df,_0x3f9d63){return new BPromise(function(_0x5ea467,_0x2e70f4){return client['request'](_0x59621c,_0x3f9d63)[_0x8269('0xf')](function(_0x295c0f){logger[_0x8269('0x10')](_0x8269('0x11'),_0x8747df,_0x8269('0x12'));logger[_0x8269('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x8747df,_0x8269('0x12'),JSON[_0x8269('0x14')](_0x295c0f));if(_0x295c0f['error']){if(_0x295c0f['error'][_0x8269('0x15')]===0x1f4){logger[_0x8269('0x16')](_0x8269('0x11'),_0x8747df,_0x295c0f[_0x8269('0x16')][_0x8269('0x17')]);return _0x2e70f4(_0x295c0f[_0x8269('0x16')][_0x8269('0x17')]);}logger[_0x8269('0x16')](_0x8269('0x11'),_0x8747df,_0x295c0f['error'][_0x8269('0x17')]);return _0x5ea467(_0x295c0f[_0x8269('0x16')]['message']);}else{logger['info'](_0x8269('0x11'),_0x8747df,_0x8269('0x12'));_0x5ea467(_0x295c0f[_0x8269('0x18')][_0x8269('0x17')]);}})[_0x8269('0x19')](function(_0x437670){logger[_0x8269('0x16')]('Dashboard,\x20%s,\x20%s',_0x8747df,_0x437670);_0x2e70f4(_0x437670);});});} \ No newline at end of file +var _0x546d=['debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','defaults','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent'];(function(_0x5ed15b,_0x45f94e){var _0x30e261=function(_0x3eebd0){while(--_0x3eebd0){_0x5ed15b['push'](_0x5ed15b['shift']());}};_0x30e261(++_0x45f94e);}(_0x546d,0x132));var _0xd546=function(_0x4c33d5,_0x19446b){_0x4c33d5=_0x4c33d5-0x0;var _0x3b0abd=_0x546d[_0x4c33d5];return _0x3b0abd;};'use strict';var _=require(_0xd546('0x0'));var util=require(_0xd546('0x1'));var moment=require(_0xd546('0x2'));var BPromise=require(_0xd546('0x3'));var rs=require(_0xd546('0x4'));var fs=require('fs');var Redis=require(_0xd546('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd546('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd546('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xd546('0x8')](config[_0xd546('0x9')],{'host':_0xd546('0xa'),'port':0x18eb});var socket=require(_0xd546('0xb'))(new Redis(config['redis']));require(_0xd546('0xc'))[_0xd546('0xd')](socket);function respondWithRpcPromise(_0x25348a,_0x8d027c,_0x4347b7){return new BPromise(function(_0x312831,_0x56107d){return client[_0xd546('0xe')](_0x25348a,_0x4347b7)[_0xd546('0xf')](function(_0x18827d){logger[_0xd546('0x10')]('Dashboard,\x20%s,\x20%s',_0x8d027c,_0xd546('0x11'));logger[_0xd546('0x12')](_0xd546('0x13'),_0x8d027c,_0xd546('0x11'),JSON[_0xd546('0x14')](_0x18827d));if(_0x18827d[_0xd546('0x15')]){if(_0x18827d['error'][_0xd546('0x16')]===0x1f4){logger['error'](_0xd546('0x17'),_0x8d027c,_0x18827d[_0xd546('0x15')][_0xd546('0x18')]);return _0x56107d(_0x18827d[_0xd546('0x15')][_0xd546('0x18')]);}logger[_0xd546('0x15')](_0xd546('0x17'),_0x8d027c,_0x18827d[_0xd546('0x15')][_0xd546('0x18')]);return _0x312831(_0x18827d['error'][_0xd546('0x18')]);}else{logger[_0xd546('0x10')]('Dashboard,\x20%s,\x20%s',_0x8d027c,'request\x20sent');_0x312831(_0x18827d[_0xd546('0x19')]['message']);}})[_0xd546('0x1a')](function(_0x1f173c){logger['error'](_0xd546('0x17'),_0x8d027c,_0x1f173c);_0x56107d(_0x1f173c);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 2d3641e..9ce621f 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 _0x5b0d=['dashboard:','save','remove','update','emit','removeListener','register','length'];(function(_0x496f9e,_0x48b53f){var _0x2ef07e=function(_0x32ec73){while(--_0x32ec73){_0x496f9e['push'](_0x496f9e['shift']());}};_0x2ef07e(++_0x48b53f);}(_0x5b0d,0x1b9));var _0xd5b0=function(_0x7b6b1,_0x2b9af7){_0x7b6b1=_0x7b6b1-0x0;var _0x4b57ee=_0x5b0d[_0x7b6b1];return _0x4b57ee;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xd5b0('0x0'),_0xd5b0('0x1'),_0xd5b0('0x2')];function createListener(_0x247350,_0x52e7c6){return function(_0x53f8f0){_0x52e7c6[_0xd5b0('0x3')](_0x247350,_0x53f8f0);};}function removeListener(_0x5c3d4a,_0x1512db){return function(){DashboardEvents[_0xd5b0('0x4')](_0x5c3d4a,_0x1512db);};}exports[_0xd5b0('0x5')]=function(_0x2b9c0b){for(var _0x113042=0x0,_0x53cf91=events[_0xd5b0('0x6')];_0x113042<_0x53cf91;_0x113042++){var _0x3760fe=events[_0x113042];var _0x3d649f=createListener(_0xd5b0('0x7')+_0x3760fe,_0x2b9c0b);DashboardEvents['on'](_0x3760fe,_0x3d649f);}}; \ No newline at end of file +var _0xc407=['register','length','dashboard:','./dashboard.events','save','remove','update','removeListener'];(function(_0x4ccf7f,_0x161ffd){var _0x1953f0=function(_0xfd2ca6){while(--_0xfd2ca6){_0x4ccf7f['push'](_0x4ccf7f['shift']());}};_0x1953f0(++_0x161ffd);}(_0xc407,0xeb));var _0x7c40=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0xc407[_0x59b439];return _0x521ea3;};'use strict';var DashboardEvents=require(_0x7c40('0x0'));var events=[_0x7c40('0x1'),_0x7c40('0x2'),_0x7c40('0x3')];function createListener(_0x28360f,_0x58aab9){return function(_0x5958f4){_0x58aab9['emit'](_0x28360f,_0x5958f4);};}function removeListener(_0x4c2013,_0x383646){return function(){DashboardEvents[_0x7c40('0x4')](_0x4c2013,_0x383646);};}exports[_0x7c40('0x5')]=function(_0x3f393b){for(var _0x288a43=0x0,_0x35e742=events[_0x7c40('0x6')];_0x288a43<_0x35e742;_0x288a43++){var _0xc5f903=events[_0x288a43];var _0x400007=createListener(_0x7c40('0x7')+_0xc5f903,_0x3f393b);DashboardEvents['on'](_0xc5f903,_0x400007);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 3ae3e1f..d104157 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 _0x6a4c=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/items','getItems','post','create','clone','addItem','put','/:id','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x453323,_0x495f1d){var _0x108773=function(_0x1d9070){while(--_0x1d9070){_0x453323['push'](_0x453323['shift']());}};_0x108773(++_0x495f1d);}(_0x6a4c,0x68));var _0xc6a4=function(_0x4bb1ac,_0x4ba10d){_0x4bb1ac=_0x4bb1ac-0x0;var _0x289ced=_0x6a4c[_0x4bb1ac];return _0x289ced;};'use strict';var multer=require('multer');var util=require(_0xc6a4('0x0'));var path=require('path');var timeout=require(_0xc6a4('0x1'));var express=require(_0xc6a4('0x2'));var router=express[_0xc6a4('0x3')]();var fs_extra=require(_0xc6a4('0x4'));var auth=require(_0xc6a4('0x5'));var interaction=require(_0xc6a4('0x6'));var config=require(_0xc6a4('0x7'));var controller=require('./dashboard.controller');router['get']('/',auth[_0xc6a4('0x8')](),controller[_0xc6a4('0x9')]);router[_0xc6a4('0xa')]('/:id',auth[_0xc6a4('0x8')](),controller[_0xc6a4('0xb')]);router['get'](_0xc6a4('0xc'),auth[_0xc6a4('0x8')](),controller[_0xc6a4('0xd')]);router[_0xc6a4('0xe')]('/',auth[_0xc6a4('0x8')](),controller[_0xc6a4('0xf')]);router['post']('/:id/clone',auth[_0xc6a4('0x8')](),controller[_0xc6a4('0x10')]);router[_0xc6a4('0xe')](_0xc6a4('0xc'),auth[_0xc6a4('0x8')](),controller[_0xc6a4('0x11')]);router[_0xc6a4('0x12')](_0xc6a4('0x13'),auth[_0xc6a4('0x8')](),controller[_0xc6a4('0x14')]);router['delete'](_0xc6a4('0x13'),auth[_0xc6a4('0x8')](),controller['destroy']);module[_0xc6a4('0x15')]=router; \ No newline at end of file +var _0x75f0=['put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','getItems','post','create','clone','/:id/items','addItem'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x75f0,0xc5));var _0x075f=function(_0x179fdf,_0x53b69d){_0x179fdf=_0x179fdf-0x0;var _0x13777c=_0x75f0[_0x179fdf];return _0x13777c;};'use strict';var multer=require('multer');var util=require(_0x075f('0x0'));var path=require(_0x075f('0x1'));var timeout=require(_0x075f('0x2'));var express=require('express');var router=express[_0x075f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x075f('0x4'));var interaction=require(_0x075f('0x5'));var config=require(_0x075f('0x6'));var controller=require(_0x075f('0x7'));router[_0x075f('0x8')]('/',auth[_0x075f('0x9')](),controller[_0x075f('0xa')]);router[_0x075f('0x8')](_0x075f('0xb'),auth[_0x075f('0x9')](),controller[_0x075f('0xc')]);router[_0x075f('0x8')]('/:id/items',auth[_0x075f('0x9')](),controller[_0x075f('0xd')]);router[_0x075f('0xe')]('/',auth[_0x075f('0x9')](),controller[_0x075f('0xf')]);router['post']('/:id/clone',auth[_0x075f('0x9')](),controller[_0x075f('0x10')]);router[_0x075f('0xe')](_0x075f('0x11'),auth[_0x075f('0x9')](),controller[_0x075f('0x12')]);router[_0x075f('0x13')](_0x075f('0xb'),auth[_0x075f('0x9')](),controller[_0x075f('0x14')]);router[_0x075f('0x15')](_0x075f('0xb'),auth[_0x075f('0x9')](),controller[_0x075f('0x16')]);module[_0x075f('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index f713ceb..0bab1f9 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 _0x5496=['#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5496,0x175));var _0x6549=function(_0x5772b1,_0x133969){_0x5772b1=_0x5772b1-0x0;var _0x4c01c5=_0x5496[_0x5772b1];return _0x4c01c5;};'use strict';var Sequelize=require(_0x6549('0x0'));var squel=require(_0x6549('0x1'));var _=require(_0x6549('0x2'));module[_0x6549('0x3')]={'title':{'type':Sequelize[_0x6549('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6549('0x5')]('long'),'get':function(){try{return JSON[_0x6549('0x6')](this[_0x6549('0x7')](_0x6549('0x8')));}catch(_0x4d0473){return[];}},'set':function(_0x5a4658){try{this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify'](_0x5a4658));}catch(_0x1ca8fc){this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x6549('0xa')]},'col':{'type':Sequelize[_0x6549('0xa')]},'background':{'type':Sequelize[_0x6549('0x4')],'allowNull':![],'defaultValue':_0x6549('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6549('0x4')]},'titleFontSize':{'type':Sequelize[_0x6549('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0x7a54=['lodash','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x7a54,0x106));var _0x47a5=function(_0x3f4764,_0x414718){_0x3f4764=_0x3f4764-0x0;var _0x3b2914=_0x7a54[_0x3f4764];return _0x3b2914;};'use strict';var Sequelize=require(_0x47a5('0x0'));var squel=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));module['exports']={'title':{'type':Sequelize[_0x47a5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x47a5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x47a5('0x4')),'get':function(){try{return JSON[_0x47a5('0x5')](this[_0x47a5('0x6')](_0x47a5('0x7')));}catch(_0xfdf934){return[];}},'set':function(_0x545a97){try{this[_0x47a5('0x8')]('attrs',JSON[_0x47a5('0x9')](_0x545a97));}catch(_0x30e405){this['setDataValue'](_0x47a5('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x47a5('0xa')]},'col':{'type':Sequelize[_0x47a5('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x47a5('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x47a5('0x3')]},'titleFontSize':{'type':Sequelize[_0x47a5('0xa')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 4bdee05..c3ac610 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 _0xf8af=['https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','create','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','error','stack','send','show','params','model','DashboardItem','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','type','attrUrl','attrs'];(function(_0x4da1ef,_0x203c6b){var _0x4c2e99=function(_0xeb4ecc){while(--_0xeb4ecc){_0x4da1ef['push'](_0x4da1ef['shift']());}};_0x4c2e99(++_0x203c6b);}(_0xf8af,0x8b));var _0xff8a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf8af[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xff8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff8a('0x1'));var jsonpatch=require(_0xff8a('0x2'));var rp=require(_0xff8a('0x3'));var moment=require(_0xff8a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff8a('0x5'));var util=require(_0xff8a('0x6'));var path=require(_0xff8a('0x7'));var sox=require(_0xff8a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xff8a('0x9'));var _=require('lodash');var squel=require(_0xff8a('0xa'));var crypto=require(_0xff8a('0xb'));var jsforce=require(_0xff8a('0xc'));var deskjs=require(_0xff8a('0xd'));var toCsv=require(_0xff8a('0xe'));var querystring=require(_0xff8a('0xf'));var Papa=require(_0xff8a('0x10'));var Redis=require(_0xff8a('0x11'));var authService=require(_0xff8a('0x12'));var qs=require(_0xff8a('0x13'));var as=require(_0xff8a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xff8a('0x15'))(_0xff8a('0x16'));var utils=require(_0xff8a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xff8a('0x18'));var db=require(_0xff8a('0x19'))['db'];config[_0xff8a('0x1a')]=_[_0xff8a('0x1b')](config[_0xff8a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff8a('0x1c'))(new Redis(config[_0xff8a('0x1a')]));require(_0xff8a('0x1d'))[_0xff8a('0x1e')](socket);function respondWithStatusCode(_0x5d793b,_0x5a17f8){_0x5a17f8=_0x5a17f8||0xcc;return function(_0x559371){if(_0x559371){return _0x5d793b['sendStatus'](_0x5a17f8);}return _0x5d793b[_0xff8a('0x1f')](_0x5a17f8)['end']();};}function respondWithResult(_0x279441,_0x2917a7){_0x2917a7=_0x2917a7||0xc8;return function(_0x4e98b0){if(_0x4e98b0){return _0x279441[_0xff8a('0x1f')](_0x2917a7)['json'](_0x4e98b0);}};}function respondWithFilteredResult(_0x5ed382,_0x392f43){return function(_0x68524a){if(_0x68524a){var _0x124cb9=typeof _0x392f43['offset']===_0xff8a('0x20')&&typeof _0x392f43['limit']===_0xff8a('0x20');var _0x4bb5ec=_0x68524a[_0xff8a('0x21')];var _0x1b4272=_0x124cb9?0x0:_0x392f43[_0xff8a('0x22')];var _0xdb1027=_0x124cb9?_0x68524a[_0xff8a('0x21')]:_0x392f43[_0xff8a('0x22')]+_0x392f43[_0xff8a('0x23')];var _0x1ba1f1;if(_0xdb1027>=_0x4bb5ec){_0xdb1027=_0x4bb5ec;_0x1ba1f1=0xc8;}else{_0x1ba1f1=0xce;}_0x5ed382[_0xff8a('0x1f')](_0x1ba1f1);return _0x5ed382[_0xff8a('0x24')](_0xff8a('0x25'),_0x1b4272+'-'+_0xdb1027+'/'+_0x4bb5ec)[_0xff8a('0x26')](_0x68524a);}return null;};}function patchUpdates(_0x3bb4ac){return function(_0x1d9a9b){try{jsonpatch[_0xff8a('0x27')](_0x1d9a9b,_0x3bb4ac,!![]);}catch(_0x5e7897){return BPromise[_0xff8a('0x28')](_0x5e7897);}return _0x1d9a9b[_0xff8a('0x29')]();};}function saveUpdates(_0x2d6d8f,_0x303050){return function(_0x518d33){if(_0x518d33){return _0x518d33[_0xff8a('0x2a')](_0x2d6d8f)['then'](function(_0x1c9ecc){return _0x1c9ecc;});}return null;};}function removeEntity(_0x3f03ce,_0x2c67c2){return function(_0x3fdce3){if(_0x3fdce3){return _0x3fdce3[_0xff8a('0x2b')]()['then'](function(){_0x3f03ce[_0xff8a('0x1f')](0xcc)[_0xff8a('0x2c')]();});}};}function handleEntityNotFound(_0x3063b1,_0x5153f6){return function(_0x2458a0){if(!_0x2458a0){_0x3063b1[_0xff8a('0x2d')](0x194);}return _0x2458a0;};}function handleError(_0x30c36f,_0x2d69d2){_0x2d69d2=_0x2d69d2||0x1f4;return function(_0x38188f){logger[_0xff8a('0x2e')](_0x38188f[_0xff8a('0x2f')]);if(_0x38188f['name']){delete _0x38188f['name'];}_0x30c36f[_0xff8a('0x1f')](_0x2d69d2)[_0xff8a('0x30')](_0x38188f);};}exports[_0xff8a('0x31')]=function(_0x279347,_0x430cbd){var _0x184254={'raw':![],'where':{'id':_0x279347[_0xff8a('0x32')]['id']}},_0x50cb0f={};_0x50cb0f[_0xff8a('0x33')]=_['keys'](db[_0xff8a('0x34')][_0xff8a('0x35')]);_0x50cb0f[_0xff8a('0x36')]=_['keys'](_0x279347[_0xff8a('0x36')]);_0x50cb0f[_0xff8a('0x37')]=_['intersection'](_0x50cb0f[_0xff8a('0x33')],_0x50cb0f[_0xff8a('0x36')]);_0x184254[_0xff8a('0x38')]=_[_0xff8a('0x39')](_0x50cb0f[_0xff8a('0x33')],qs[_0xff8a('0x3a')](_0x279347[_0xff8a('0x36')][_0xff8a('0x3a')]));_0x184254[_0xff8a('0x38')]=_0x184254['attributes'][_0xff8a('0x3b')]?_0x184254[_0xff8a('0x38')]:_0x50cb0f['model'];if(_0x279347[_0xff8a('0x36')][_0xff8a('0x3c')]){_0x184254[_0xff8a('0x3d')]=[{'all':!![]}];}_0x184254=_[_0xff8a('0x3e')]({},_0x184254,_0x279347[_0xff8a('0x3f')]);return db[_0xff8a('0x34')][_0xff8a('0x40')](_0x184254)[_0xff8a('0x41')](handleEntityNotFound(_0x430cbd,null))[_0xff8a('0x41')](respondWithResult(_0x430cbd,null))['catch'](handleError(_0x430cbd,null));};exports['destroy']=function(_0x15a96b,_0x3f58a4){return db['DashboardItem'][_0xff8a('0x40')]({'where':{'id':_0x15a96b[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x3f58a4,null))['then'](removeEntity(_0x3f58a4,null))['catch'](handleError(_0x3f58a4,null));};function widgetAttributes(_0x2fd75f){try{switch(_0x2fd75f[_0xff8a('0x42')]){case'iframe':return[{'name':_0xff8a('0x43'),'value':_0x2fd75f[_0xff8a('0x43')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['value']:undefined)||_0xff8a('0x45')}];case _0xff8a('0x46'):return[{'name':'attrPath','value':_0x2fd75f[_0xff8a('0x47')]||(_0x2fd75f['attrs']&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x49'):return[{'name':_0xff8a('0x4a'),'value':_0x2fd75f[_0xff8a('0x4a')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x4b')},{'name':_0xff8a('0x4c'),'value':_0x2fd75f[_0xff8a('0x4c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||_0xff8a('0x4d')},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0xc}];case _0xff8a('0x4f'):return[{'name':_0xff8a('0x50'),'value':_0x2fd75f['attrMetric']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||[]},{'name':_0xff8a('0x4e'),'value':_0x2fd75f[_0xff8a('0x4e')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||0x14},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3][_0xff8a('0x48')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f[_0xff8a('0x57')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f[_0xff8a('0x44')][0x8][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x5a'):case _0xff8a('0x5b'):return[{'name':'attrSerie1','value':_0x2fd75f[_0xff8a('0x5c')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f['attrs'][0x0][_0xff8a('0x48')]:undefined)||_0xff8a('0x51')},{'name':_0xff8a('0x5d'),'value':_0x2fd75f[_0xff8a('0x5d')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x5e'),'value':_0x2fd75f[_0xff8a('0x5e')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x2]?_0x2fd75f[_0xff8a('0x44')][0x2][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x52'),'value':_0x2fd75f[_0xff8a('0x52')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x3]?_0x2fd75f[_0xff8a('0x44')][0x3]['value']:undefined)||[]},{'name':_0xff8a('0x53'),'value':_0x2fd75f[_0xff8a('0x53')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x4]?_0x2fd75f[_0xff8a('0x44')][0x4][_0xff8a('0x48')]:undefined)||_0xff8a('0x5f')},{'name':_0xff8a('0x54'),'value':_0x2fd75f[_0xff8a('0x54')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x5]?_0x2fd75f[_0xff8a('0x44')][0x5]['value']:undefined)||''},{'name':_0xff8a('0x55'),'value':_0x2fd75f[_0xff8a('0x55')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x6]?_0x2fd75f[_0xff8a('0x44')][0x6][_0xff8a('0x48')]:undefined)||''},{'name':_0xff8a('0x56'),'value':_0x2fd75f[_0xff8a('0x56')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x7]?_0x2fd75f[_0xff8a('0x44')][0x7]['value']:undefined)||''},{'name':_0xff8a('0x57'),'value':_0x2fd75f['attrOpenchannelAccounts']||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f[_0xff8a('0x44')][0x8]?_0x2fd75f['attrs'][0x8]['value']:undefined)||''},{'name':_0xff8a('0x58'),'value':_0x2fd75f[_0xff8a('0x58')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0x9]?_0x2fd75f[_0xff8a('0x44')][0x9]['value']:undefined)||''},{'name':_0xff8a('0x59'),'value':_0x2fd75f[_0xff8a('0x59')]||(_0x2fd75f[_0xff8a('0x44')]&&_0x2fd75f['attrs'][0xa]?_0x2fd75f['attrs'][0xa][_0xff8a('0x48')]:undefined)||''}];case _0xff8a('0x60'):return[{'name':_0xff8a('0x61'),'type':_0x2fd75f[_0xff8a('0x62')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0]['type']:undefined)||null,'value':_0x2fd75f[_0xff8a('0x61')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x0]?_0x2fd75f[_0xff8a('0x44')][0x0][_0xff8a('0x48')]:undefined)||null},{'name':_0xff8a('0x63'),'value':_0x2fd75f[_0xff8a('0x63')]||(_0x2fd75f['attrs']&&_0x2fd75f[_0xff8a('0x44')][0x1]?_0x2fd75f[_0xff8a('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5acf87){logger[_0xff8a('0x2e')](_0xff8a('0x64'),JSON['stringify'](_0x5acf87));return[];}}exports['create']=function(_0x40e4ee,_0x4ddc06){if(_0x40e4ee[_0xff8a('0x65')]){_0x40e4ee[_0xff8a('0x65')][_0xff8a('0x44')]=widgetAttributes(_0x40e4ee[_0xff8a('0x65')]);}return db[_0xff8a('0x34')][_0xff8a('0x66')](_0x40e4ee[_0xff8a('0x65')],{})[_0xff8a('0x41')](respondWithResult(_0x4ddc06,0xc9))[_0xff8a('0x67')](handleError(_0x4ddc06,null));};exports[_0xff8a('0x2a')]=function(_0x182026,_0x48d8e7){if(_0x182026[_0xff8a('0x65')]['id']){delete _0x182026[_0xff8a('0x65')]['id'];}_0x182026[_0xff8a('0x65')]['attrs']=widgetAttributes(_0x182026[_0xff8a('0x65')]);return db[_0xff8a('0x34')]['find']({'where':{'id':_0x182026[_0xff8a('0x32')]['id']}})['then'](handleEntityNotFound(_0x48d8e7,null))[_0xff8a('0x41')](saveUpdates(_0x182026[_0xff8a('0x65')],null))[_0xff8a('0x41')](respondWithResult(_0x48d8e7,null))[_0xff8a('0x67')](handleError(_0x48d8e7,null));}; \ No newline at end of file +var _0x496e=['intersection','fields','attributes','length','includeAll','include','merge','find','catch','destroy','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','params','model','DashboardItem','query','keys','filters'];(function(_0x22356b,_0x36f66e){var _0x3514d4=function(_0x4fb2cc){while(--_0x4fb2cc){_0x22356b['push'](_0x22356b['shift']());}};_0x3514d4(++_0x36f66e);}(_0x496e,0x1a0));var _0xe496=function(_0xc1fc58,_0x1b1b8a){_0xc1fc58=_0xc1fc58-0x0;var _0x529162=_0x496e[_0xc1fc58];return _0x529162;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe496('0x0'));var zipdir=require(_0xe496('0x1'));var jsonpatch=require(_0xe496('0x2'));var rp=require(_0xe496('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe496('0x4'));var path=require('path');var sox=require(_0xe496('0x5'));var csv=require(_0xe496('0x6'));var ejs=require(_0xe496('0x7'));var fs=require('fs');var fs_extra=require(_0xe496('0x8'));var _=require(_0xe496('0x9'));var squel=require(_0xe496('0xa'));var crypto=require(_0xe496('0xb'));var jsforce=require(_0xe496('0xc'));var deskjs=require(_0xe496('0xd'));var toCsv=require(_0xe496('0x6'));var querystring=require(_0xe496('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe496('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe496('0x10'));var hardwareService=require(_0xe496('0x11'));var logger=require(_0xe496('0x12'))(_0xe496('0x13'));var utils=require(_0xe496('0x14'));var config=require(_0xe496('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xe496('0x16')]=_[_0xe496('0x17')](config['redis'],{'host':_0xe496('0x18'),'port':0x18eb});var socket=require(_0xe496('0x19'))(new Redis(config[_0xe496('0x16')]));require(_0xe496('0x1a'))['register'](socket);function respondWithStatusCode(_0xfa63a3,_0x487b50){_0x487b50=_0x487b50||0xcc;return function(_0xddb0f){if(_0xddb0f){return _0xfa63a3['sendStatus'](_0x487b50);}return _0xfa63a3[_0xe496('0x1b')](_0x487b50)[_0xe496('0x1c')]();};}function respondWithResult(_0x16adfd,_0x46cc5b){_0x46cc5b=_0x46cc5b||0xc8;return function(_0x5b91a2){if(_0x5b91a2){return _0x16adfd[_0xe496('0x1b')](_0x46cc5b)[_0xe496('0x1d')](_0x5b91a2);}};}function respondWithFilteredResult(_0x5268a2,_0x2733dd){return function(_0x29d07c){if(_0x29d07c){var _0x3d3bd6=typeof _0x2733dd[_0xe496('0x1e')]===_0xe496('0x1f')&&typeof _0x2733dd[_0xe496('0x20')]===_0xe496('0x1f');var _0x360a48=_0x29d07c[_0xe496('0x21')];var _0x1993cd=_0x3d3bd6?0x0:_0x2733dd[_0xe496('0x1e')];var _0x3f6436=_0x3d3bd6?_0x29d07c[_0xe496('0x21')]:_0x2733dd['offset']+_0x2733dd[_0xe496('0x20')];var _0x33a497;if(_0x3f6436>=_0x360a48){_0x3f6436=_0x360a48;_0x33a497=0xc8;}else{_0x33a497=0xce;}_0x5268a2[_0xe496('0x1b')](_0x33a497);return _0x5268a2[_0xe496('0x22')](_0xe496('0x23'),_0x1993cd+'-'+_0x3f6436+'/'+_0x360a48)[_0xe496('0x1d')](_0x29d07c);}return null;};}function patchUpdates(_0x3fb384){return function(_0x2337c7){try{jsonpatch['apply'](_0x2337c7,_0x3fb384,!![]);}catch(_0x1af1da){return BPromise['reject'](_0x1af1da);}return _0x2337c7['save']();};}function saveUpdates(_0x4fc3ce,_0x16c08d){return function(_0x26863e){if(_0x26863e){return _0x26863e[_0xe496('0x24')](_0x4fc3ce)[_0xe496('0x25')](function(_0x541173){return _0x541173;});}return null;};}function removeEntity(_0x3f114d,_0x2d122e){return function(_0x25cd2c){if(_0x25cd2c){return _0x25cd2c['destroy']()[_0xe496('0x25')](function(){_0x3f114d[_0xe496('0x1b')](0xcc)[_0xe496('0x1c')]();});}};}function handleEntityNotFound(_0x57dc9d,_0x4701f0){return function(_0x9eb3ab){if(!_0x9eb3ab){_0x57dc9d[_0xe496('0x26')](0x194);}return _0x9eb3ab;};}function handleError(_0xf736dd,_0x5a1d84){_0x5a1d84=_0x5a1d84||0x1f4;return function(_0x2c6ee6){logger[_0xe496('0x27')](_0x2c6ee6[_0xe496('0x28')]);if(_0x2c6ee6[_0xe496('0x29')]){delete _0x2c6ee6[_0xe496('0x29')];}_0xf736dd[_0xe496('0x1b')](_0x5a1d84)[_0xe496('0x2a')](_0x2c6ee6);};}exports['show']=function(_0x24cc17,_0x3b80f7){var _0x11432d={'raw':![],'where':{'id':_0x24cc17[_0xe496('0x2b')]['id']}},_0x3fa5bc={};_0x3fa5bc[_0xe496('0x2c')]=_['keys'](db[_0xe496('0x2d')]['rawAttributes']);_0x3fa5bc[_0xe496('0x2e')]=_[_0xe496('0x2f')](_0x24cc17[_0xe496('0x2e')]);_0x3fa5bc[_0xe496('0x30')]=_[_0xe496('0x31')](_0x3fa5bc[_0xe496('0x2c')],_0x3fa5bc[_0xe496('0x2e')]);_0x11432d['attributes']=_[_0xe496('0x31')](_0x3fa5bc['model'],qs['fields'](_0x24cc17['query'][_0xe496('0x32')]));_0x11432d[_0xe496('0x33')]=_0x11432d[_0xe496('0x33')][_0xe496('0x34')]?_0x11432d[_0xe496('0x33')]:_0x3fa5bc[_0xe496('0x2c')];if(_0x24cc17[_0xe496('0x2e')][_0xe496('0x35')]){_0x11432d[_0xe496('0x36')]=[{'all':!![]}];}_0x11432d=_[_0xe496('0x37')]({},_0x11432d,_0x24cc17['options']);return db[_0xe496('0x2d')][_0xe496('0x38')](_0x11432d)['then'](handleEntityNotFound(_0x3b80f7,null))['then'](respondWithResult(_0x3b80f7,null))[_0xe496('0x39')](handleError(_0x3b80f7,null));};exports[_0xe496('0x3a')]=function(_0xf5b212,_0x591bee){return db[_0xe496('0x2d')][_0xe496('0x38')]({'where':{'id':_0xf5b212[_0xe496('0x2b')]['id']}})['then'](handleEntityNotFound(_0x591bee,null))[_0xe496('0x25')](removeEntity(_0x591bee,null))[_0xe496('0x39')](handleError(_0x591bee,null));};function widgetAttributes(_0x23fd16){try{switch(_0x23fd16['type']){case _0xe496('0x3b'):return[{'name':_0xe496('0x3c'),'value':_0x23fd16[_0xe496('0x3c')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x0]?_0x23fd16[_0xe496('0x3d')][0x0][_0xe496('0x3e')]:undefined)||_0xe496('0x3f')}];case'custom':return[{'name':_0xe496('0x40'),'value':_0x23fd16[_0xe496('0x40')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x0]?_0x23fd16[_0xe496('0x3d')][0x0]['value']:undefined)||''}];case _0xe496('0x41'):return[{'name':_0xe496('0x42'),'value':_0x23fd16[_0xe496('0x42')]||(_0x23fd16['attrs']&&_0x23fd16[_0xe496('0x3d')][0x0]?_0x23fd16[_0xe496('0x3d')][0x0]['value']:undefined)||_0xe496('0x43')},{'name':_0xe496('0x44'),'value':_0x23fd16['attrTimezone']||(_0x23fd16['attrs']&&_0x23fd16[_0xe496('0x3d')][0x1]?_0x23fd16['attrs'][0x1][_0xe496('0x3e')]:undefined)||_0xe496('0x45')},{'name':_0xe496('0x46'),'value':_0x23fd16[_0xe496('0x46')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x2]?_0x23fd16[_0xe496('0x3d')][0x2]['value']:undefined)||0xc}];case _0xe496('0x47'):return[{'name':_0xe496('0x48'),'value':_0x23fd16[_0xe496('0x48')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x0]?_0x23fd16['attrs'][0x0][_0xe496('0x3e')]:undefined)||_0xe496('0x49')},{'name':'attrVoiceQueues','value':_0x23fd16[_0xe496('0x4a')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x1]?_0x23fd16['attrs'][0x1][_0xe496('0x3e')]:undefined)||[]},{'name':_0xe496('0x46'),'value':_0x23fd16['attrFontSize']||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x2]?_0x23fd16['attrs'][0x2][_0xe496('0x3e')]:undefined)||0x14},{'name':'attrChannel','value':_0x23fd16[_0xe496('0x4b')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x3]?_0x23fd16[_0xe496('0x3d')][0x3][_0xe496('0x3e')]:undefined)||_0xe496('0x4c')},{'name':'attrEmailAccounts','value':_0x23fd16[_0xe496('0x4d')]||(_0x23fd16['attrs']&&_0x23fd16[_0xe496('0x3d')][0x4]?_0x23fd16['attrs'][0x4]['value']:undefined)||''},{'name':_0xe496('0x4e'),'value':_0x23fd16[_0xe496('0x4e')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x5]?_0x23fd16['attrs'][0x5][_0xe496('0x3e')]:undefined)||''},{'name':_0xe496('0x4f'),'value':_0x23fd16[_0xe496('0x4f')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x6]?_0x23fd16[_0xe496('0x3d')][0x6][_0xe496('0x3e')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x23fd16[_0xe496('0x50')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x7]?_0x23fd16[_0xe496('0x3d')][0x7][_0xe496('0x3e')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x23fd16[_0xe496('0x51')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x8]?_0x23fd16[_0xe496('0x3d')][0x8][_0xe496('0x3e')]:undefined)||''},{'name':_0xe496('0x52'),'value':_0x23fd16[_0xe496('0x52')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x9]?_0x23fd16[_0xe496('0x3d')][0x9][_0xe496('0x3e')]:undefined)||''}];case'multibar-chart':case _0xe496('0x53'):return[{'name':'attrSerie1','value':_0x23fd16[_0xe496('0x54')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16['attrs'][0x0]?_0x23fd16[_0xe496('0x3d')][0x0]['value']:undefined)||_0xe496('0x49')},{'name':_0xe496('0x55'),'value':_0x23fd16[_0xe496('0x55')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16['attrs'][0x1]?_0x23fd16[_0xe496('0x3d')][0x1][_0xe496('0x3e')]:undefined)||null},{'name':'attrSerie3','value':_0x23fd16['attrSerie3']||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x2]?_0x23fd16[_0xe496('0x3d')][0x2][_0xe496('0x3e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x23fd16[_0xe496('0x4a')]||(_0x23fd16['attrs']&&_0x23fd16[_0xe496('0x3d')][0x3]?_0x23fd16[_0xe496('0x3d')][0x3][_0xe496('0x3e')]:undefined)||[]},{'name':'attrChannel','value':_0x23fd16[_0xe496('0x4b')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x4]?_0x23fd16[_0xe496('0x3d')][0x4][_0xe496('0x3e')]:undefined)||_0xe496('0x4c')},{'name':_0xe496('0x4d'),'value':_0x23fd16['attrEmailAccounts']||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16['attrs'][0x5]?_0x23fd16[_0xe496('0x3d')][0x5][_0xe496('0x3e')]:undefined)||''},{'name':_0xe496('0x4e'),'value':_0x23fd16[_0xe496('0x4e')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16['attrs'][0x6]?_0x23fd16[_0xe496('0x3d')][0x6][_0xe496('0x3e')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x23fd16[_0xe496('0x4f')]||(_0x23fd16['attrs']&&_0x23fd16[_0xe496('0x3d')][0x7]?_0x23fd16[_0xe496('0x3d')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x23fd16[_0xe496('0x50')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x8]?_0x23fd16[_0xe496('0x3d')][0x8]['value']:undefined)||''},{'name':_0xe496('0x51'),'value':_0x23fd16[_0xe496('0x51')]||(_0x23fd16['attrs']&&_0x23fd16[_0xe496('0x3d')][0x9]?_0x23fd16[_0xe496('0x3d')][0x9][_0xe496('0x3e')]:undefined)||''},{'name':_0xe496('0x52'),'value':_0x23fd16['attrChatWebsites']||(_0x23fd16['attrs']&&_0x23fd16[_0xe496('0x3d')][0xa]?_0x23fd16['attrs'][0xa][_0xe496('0x3e')]:undefined)||''}];case _0xe496('0x56'):return[{'name':_0xe496('0x57'),'type':_0x23fd16[_0xe496('0x58')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x0]?_0x23fd16[_0xe496('0x3d')][0x0]['type']:undefined)||null,'value':_0x23fd16[_0xe496('0x57')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16[_0xe496('0x3d')][0x0]?_0x23fd16[_0xe496('0x3d')][0x0][_0xe496('0x3e')]:undefined)||null},{'name':_0xe496('0x59'),'value':_0x23fd16[_0xe496('0x59')]||(_0x23fd16[_0xe496('0x3d')]&&_0x23fd16['attrs'][0x1]?_0x23fd16[_0xe496('0x3d')][0x1][_0xe496('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x59585b){logger[_0xe496('0x27')](_0xe496('0x5a'),JSON[_0xe496('0x5b')](_0x59585b));return[];}}exports['create']=function(_0x27c56f,_0x4d867b){if(_0x27c56f[_0xe496('0x5c')]){_0x27c56f[_0xe496('0x5c')]['attrs']=widgetAttributes(_0x27c56f[_0xe496('0x5c')]);}return db[_0xe496('0x2d')]['create'](_0x27c56f[_0xe496('0x5c')],{})[_0xe496('0x25')](respondWithResult(_0x4d867b,0xc9))[_0xe496('0x39')](handleError(_0x4d867b,null));};exports[_0xe496('0x24')]=function(_0x4a365f,_0x2241d1){if(_0x4a365f['body']['id']){delete _0x4a365f[_0xe496('0x5c')]['id'];}_0x4a365f[_0xe496('0x5c')][_0xe496('0x3d')]=widgetAttributes(_0x4a365f[_0xe496('0x5c')]);return db[_0xe496('0x2d')][_0xe496('0x38')]({'where':{'id':_0x4a365f['params']['id']}})['then'](handleEntityNotFound(_0x2241d1,null))[_0xe496('0x25')](saveUpdates(_0x4a365f[_0xe496('0x5c')],null))[_0xe496('0x25')](respondWithResult(_0x2241d1,null))[_0xe496('0x39')](handleError(_0x2241d1,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 7002126..aba4728 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 _0x568d=['../../mysqldb','DashboardItem','update','emit','hasOwnProperty','hook','exports'];(function(_0x19e023,_0x1ea14d){var _0xa87e83=function(_0x1a0ddb){while(--_0x1a0ddb){_0x19e023['push'](_0x19e023['shift']());}};_0xa87e83(++_0x1ea14d);}(_0x568d,0xaf));var _0xd568=function(_0x18d3d2,_0x48809e){_0x18d3d2=_0x18d3d2-0x0;var _0x582ee2=_0x568d[_0x18d3d2];return _0x582ee2;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xd568('0x0'))['db'][_0xd568('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd568('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5365b8){return function(_0x20051b,_0xe39fe,_0xd35d24){DashboardItemEvents[_0xd568('0x3')](_0x5365b8+':'+_0x20051b['id'],_0x20051b);DashboardItemEvents[_0xd568('0x3')](_0x5365b8,_0x20051b);_0xd35d24(null);};}for(var e in events){if(events[_0xd568('0x4')](e)){var event=events[e];DashboardItem[_0xd568('0x5')](e,emitEvent(event));}}module[_0xd568('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x566a=['DashboardItem','setMaxListeners','save','remove','hasOwnProperty','hook','exports','events'];(function(_0x5672a0,_0x20189a){var _0x54dea6=function(_0x5ac11b){while(--_0x5ac11b){_0x5672a0['push'](_0x5672a0['shift']());}};_0x54dea6(++_0x20189a);}(_0x566a,0x9f));var _0xa566=function(_0x52a99c,_0x16b4f7){_0x52a99c=_0x52a99c-0x0;var _0x42bdc0=_0x566a[_0x52a99c];return _0x42bdc0;};'use strict';var EventEmitter=require(_0xa566('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xa566('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa566('0x2')](0x0);var events={'afterCreate':_0xa566('0x3'),'afterUpdate':'update','afterDestroy':_0xa566('0x4')};function emitEvent(_0x403e99){return function(_0x79497e,_0x2052c5,_0x42419c){DashboardItemEvents['emit'](_0x403e99+':'+_0x79497e['id'],_0x79497e);DashboardItemEvents['emit'](_0x403e99,_0x79497e);_0x42419c(null);};}for(var e in events){if(events[_0xa566('0x5')](e)){var event=events[e];DashboardItem[_0xa566('0x6')](e,emitEvent(event));}}module[_0xa566('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 50d5bb8..0d58f75 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 _0x7707=['DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','path','exports'];(function(_0x1044e5,_0x498e01){var _0x5ad0dd=function(_0x458548){while(--_0x458548){_0x1044e5['push'](_0x1044e5['shift']());}};_0x5ad0dd(++_0x498e01);}(_0x7707,0x158));var _0x7770=function(_0x488bc0,_0x21d46c){_0x488bc0=_0x488bc0-0x0;var _0x399194=_0x7707[_0x488bc0];return _0x399194;};'use strict';var _=require(_0x7770('0x0'));var util=require(_0x7770('0x1'));var logger=require(_0x7770('0x2'))(_0x7770('0x3'));var moment=require(_0x7770('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7770('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x7770('0x6')]=function(_0x251dae,_0x115d50){return _0x251dae['define'](_0x7770('0x7'),attributes,{'tableName':_0x7770('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x843b=['dashboard_items','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x4ca466,_0x2632cb){var _0x4b9284=function(_0x309a27){while(--_0x309a27){_0x4ca466['push'](_0x4ca466['shift']());}};_0x4b9284(++_0x2632cb);}(_0x843b,0xc5));var _0xb843=function(_0x1028eb,_0x488b3f){_0x1028eb=_0x1028eb-0x0;var _0x20a1df=_0x843b[_0x1028eb];return _0x20a1df;};'use strict';var _=require(_0xb843('0x0'));var util=require(_0xb843('0x1'));var logger=require(_0xb843('0x2'))('api');var moment=require(_0xb843('0x3'));var BPromise=require(_0xb843('0x4'));var rp=require(_0xb843('0x5'));var fs=require('fs');var path=require(_0xb843('0x6'));var rimraf=require(_0xb843('0x7'));var config=require(_0xb843('0x8'));var attributes=require(_0xb843('0x9'));module[_0xb843('0xa')]=function(_0x2ad5f3,_0x3987db){return _0x2ad5f3[_0xb843('0xb')](_0xb843('0xc'),attributes,{'tableName':_0xb843('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 0a1b0a9..5837e62 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 _0x1e44=['stringify','error','code','message','info','catch','lodash','util','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x10ac22,_0x1b8314){var _0x2452ee=function(_0x4d8260){while(--_0x4d8260){_0x10ac22['push'](_0x10ac22['shift']());}};_0x2452ee(++_0x1b8314);}(_0x1e44,0x96));var _0x41e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e44[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41e4('0x0'));var util=require(_0x41e4('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(_0x41e4('0x2'));var logger=require(_0x41e4('0x3'))(_0x41e4('0x4'));var config=require(_0x41e4('0x5'));var jayson=require(_0x41e4('0x6'));var client=jayson['client'][_0x41e4('0x7')]({'port':0x232a});config[_0x41e4('0x8')]=_['defaults'](config[_0x41e4('0x8')],{'host':_0x41e4('0x9'),'port':0x18eb});var socket=require(_0x41e4('0xa'))(new Redis(config[_0x41e4('0x8')]));require(_0x41e4('0xb'))['register'](socket);function respondWithRpcPromise(_0x25f327,_0x2a0d79,_0x5aca33){return new BPromise(function(_0xce94a8,_0x26f1ff){return client[_0x41e4('0xc')](_0x25f327,_0x5aca33)[_0x41e4('0xd')](function(_0x51efe9){logger['info'](_0x41e4('0xe'),_0x2a0d79,_0x41e4('0xf'));logger[_0x41e4('0x10')](_0x41e4('0x11'),_0x2a0d79,_0x41e4('0xf'),JSON[_0x41e4('0x12')](_0x51efe9));if(_0x51efe9['error']){if(_0x51efe9[_0x41e4('0x13')][_0x41e4('0x14')]===0x1f4){logger['error'](_0x41e4('0xe'),_0x2a0d79,_0x51efe9['error']['message']);return _0x26f1ff(_0x51efe9['error'][_0x41e4('0x15')]);}logger[_0x41e4('0x13')]('DashboardItem,\x20%s,\x20%s',_0x2a0d79,_0x51efe9[_0x41e4('0x13')][_0x41e4('0x15')]);return _0xce94a8(_0x51efe9[_0x41e4('0x13')][_0x41e4('0x15')]);}else{logger[_0x41e4('0x16')](_0x41e4('0xe'),_0x2a0d79,_0x41e4('0xf'));_0xce94a8(_0x51efe9['result'][_0x41e4('0x15')]);}})[_0x41e4('0x17')](function(_0x389473){logger[_0x41e4('0x13')](_0x41e4('0xe'),_0x2a0d79,_0x389473);_0x26f1ff(_0x389473);});});} \ No newline at end of file +var _0x8da9=['defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x409458,_0x5f4e8c){var _0xe3f00=function(_0x158402){while(--_0x158402){_0x409458['push'](_0x409458['shift']());}};_0xe3f00(++_0x5f4e8c);}(_0x8da9,0x186));var _0x98da=function(_0x456f35,_0x124842){_0x456f35=_0x456f35-0x0;var _0x2e65dd=_0x8da9[_0x456f35];return _0x2e65dd;};'use strict';var _=require(_0x98da('0x0'));var util=require(_0x98da('0x1'));var moment=require(_0x98da('0x2'));var BPromise=require(_0x98da('0x3'));var rs=require(_0x98da('0x4'));var fs=require('fs');var Redis=require(_0x98da('0x5'));var db=require(_0x98da('0x6'))['db'];var utils=require(_0x98da('0x7'));var logger=require(_0x98da('0x8'))(_0x98da('0x9'));var config=require(_0x98da('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x98da('0xb')][_0x98da('0xc')]({'port':0x232a});config['redis']=_[_0x98da('0xd')](config[_0x98da('0xe')],{'host':_0x98da('0xf'),'port':0x18eb});var socket=require(_0x98da('0x10'))(new Redis(config[_0x98da('0xe')]));require(_0x98da('0x11'))[_0x98da('0x12')](socket);function respondWithRpcPromise(_0x5405f4,_0x2948c3,_0x33122c){return new BPromise(function(_0x56d799,_0x25c7d6){return client[_0x98da('0x13')](_0x5405f4,_0x33122c)[_0x98da('0x14')](function(_0x8b71b8){logger['info'](_0x98da('0x15'),_0x2948c3,_0x98da('0x16'));logger[_0x98da('0x17')](_0x98da('0x18'),_0x2948c3,_0x98da('0x16'),JSON[_0x98da('0x19')](_0x8b71b8));if(_0x8b71b8[_0x98da('0x1a')]){if(_0x8b71b8[_0x98da('0x1a')]['code']===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x2948c3,_0x8b71b8[_0x98da('0x1a')]['message']);return _0x25c7d6(_0x8b71b8['error'][_0x98da('0x1b')]);}logger[_0x98da('0x1a')](_0x98da('0x15'),_0x2948c3,_0x8b71b8['error']['message']);return _0x56d799(_0x8b71b8[_0x98da('0x1a')][_0x98da('0x1b')]);}else{logger[_0x98da('0x1c')]('DashboardItem,\x20%s,\x20%s',_0x2948c3,'request\x20sent');_0x56d799(_0x8b71b8[_0x98da('0x1d')]['message']);}})[_0x98da('0x1e')](function(_0x43416c){logger['error'](_0x98da('0x15'),_0x2948c3,_0x43416c);_0x25c7d6(_0x43416c);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 52ee148..a883d42 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 _0xcbe3=['emit','register','./dashboardItem.events','save','update'];(function(_0x5af0fc,_0x1be68a){var _0x9cbafa=function(_0x2d52b1){while(--_0x2d52b1){_0x5af0fc['push'](_0x5af0fc['shift']());}};_0x9cbafa(++_0x1be68a);}(_0xcbe3,0x1dd));var _0x3cbe=function(_0x4b0156,_0x3d8d34){_0x4b0156=_0x4b0156-0x0;var _0x4705c0=_0xcbe3[_0x4b0156];return _0x4705c0;};'use strict';var DashboardItemEvents=require(_0x3cbe('0x0'));var events=[_0x3cbe('0x1'),'remove',_0x3cbe('0x2')];function createListener(_0x529ef4,_0xf7d185){return function(_0x22a687){_0xf7d185[_0x3cbe('0x3')](_0x529ef4,_0x22a687);};}function removeListener(_0x1287bf,_0x5aeeff){return function(){DashboardItemEvents['removeListener'](_0x1287bf,_0x5aeeff);};}exports[_0x3cbe('0x4')]=function(_0x25ebad){for(var _0x1ff706=0x0,_0x48375c=events['length'];_0x1ff706<_0x48375c;_0x1ff706++){var _0x143a82=events[_0x1ff706];var _0x49ed00=createListener('dashboardItem:'+_0x143a82,_0x25ebad);DashboardItemEvents['on'](_0x143a82,_0x49ed00);}}; \ No newline at end of file +var _0x6f26=['save','remove','update','emit','register','length','dashboardItem:'];(function(_0x2e8cbf,_0x36c592){var _0x28ce66=function(_0x3a0941){while(--_0x3a0941){_0x2e8cbf['push'](_0x2e8cbf['shift']());}};_0x28ce66(++_0x36c592);}(_0x6f26,0x12d));var _0x66f2=function(_0x1de390,_0x202934){_0x1de390=_0x1de390-0x0;var _0x195f29=_0x6f26[_0x1de390];return _0x195f29;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x66f2('0x0'),_0x66f2('0x1'),_0x66f2('0x2')];function createListener(_0x5b4714,_0x55f3f7){return function(_0x31eada){_0x55f3f7[_0x66f2('0x3')](_0x5b4714,_0x31eada);};}function removeListener(_0x39028c,_0x48fca7){return function(){DashboardItemEvents['removeListener'](_0x39028c,_0x48fca7);};}exports[_0x66f2('0x4')]=function(_0x4c6c6d){for(var _0x4a6478=0x0,_0x34d836=events[_0x66f2('0x5')];_0x4a6478<_0x34d836;_0x4a6478++){var _0x1ba4f7=events[_0x4a6478];var _0x5c85a1=createListener(_0x66f2('0x6')+_0x1ba4f7,_0x4c6c6d);DashboardItemEvents['on'](_0x1ba4f7,_0x5c85a1);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 24b700f..8ea8907 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 _0x524c=['get','/:id','isAuthenticated','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller'];(function(_0x53c238,_0x33da60){var _0x5a105d=function(_0x11934f){while(--_0x11934f){_0x53c238['push'](_0x53c238['shift']());}};_0x5a105d(++_0x33da60);}(_0x524c,0x117));var _0xc524=function(_0x204adb,_0x57ecfd){_0x204adb=_0x204adb-0x0;var _0x3ad9cc=_0x524c[_0x204adb];return _0x3ad9cc;};'use strict';var multer=require(_0xc524('0x0'));var util=require(_0xc524('0x1'));var path=require(_0xc524('0x2'));var timeout=require(_0xc524('0x3'));var express=require(_0xc524('0x4'));var router=express['Router']();var fs_extra=require(_0xc524('0x5'));var auth=require(_0xc524('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc524('0x7'));var controller=require(_0xc524('0x8'));router[_0xc524('0x9')](_0xc524('0xa'),auth[_0xc524('0xb')](),controller[_0xc524('0xc')]);router[_0xc524('0xd')]('/',auth['isAuthenticated'](),controller[_0xc524('0xe')]);router['put'](_0xc524('0xa'),auth['isAuthenticated'](),controller[_0xc524('0xf')]);router[_0xc524('0x10')](_0xc524('0xa'),auth[_0xc524('0xb')](),controller['destroy']);module[_0xc524('0x11')]=router; \ No newline at end of file +var _0x425f=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','show','post','isAuthenticated','create','/:id','update','delete','destroy'];(function(_0x9faea2,_0x5b5fdb){var _0x499532=function(_0x1b3a76){while(--_0x1b3a76){_0x9faea2['push'](_0x9faea2['shift']());}};_0x499532(++_0x5b5fdb);}(_0x425f,0xee));var _0xf425=function(_0x2f0104,_0x55225a){_0x2f0104=_0x2f0104-0x0;var _0xcb3cce=_0x425f[_0x2f0104];return _0xcb3cce;};'use strict';var multer=require('multer');var util=require(_0xf425('0x0'));var path=require(_0xf425('0x1'));var timeout=require(_0xf425('0x2'));var express=require(_0xf425('0x3'));var router=express[_0xf425('0x4')]();var fs_extra=require(_0xf425('0x5'));var auth=require(_0xf425('0x6'));var interaction=require(_0xf425('0x7'));var config=require('../../config/environment');var controller=require(_0xf425('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xf425('0x9')]);router[_0xf425('0xa')]('/',auth[_0xf425('0xb')](),controller[_0xf425('0xc')]);router['put'](_0xf425('0xd'),auth[_0xf425('0xb')](),controller[_0xf425('0xe')]);router[_0xf425('0xf')](_0xf425('0xd'),auth['isAuthenticated'](),controller[_0xf425('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 1012d1e..9f96f2e 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 _0xef9f=['second','sequelize','STRING','ENUM','first'];(function(_0x1d04c0,_0x404899){var _0x2fae2e=function(_0x15f2f3){while(--_0x15f2f3){_0x1d04c0['push'](_0x1d04c0['shift']());}};_0x2fae2e(++_0x404899);}(_0xef9f,0x7e));var _0xfef9=function(_0x5a6208,_0x12c7d9){_0x5a6208=_0x5a6208-0x0;var _0x4aa670=_0xef9f[_0x5a6208];return _0x4aa670;};'use strict';var Sequelize=require(_0xfef9('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef9('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xfef9('0x2')](_0xfef9('0x3'),_0xfef9('0x4'),'third'),'allowNull':![],'defaultValue':_0xfef9('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2ffe=['STRING','ENUM','first','second','third','exports'];(function(_0x369ee0,_0x57a15c){var _0x493a06=function(_0x570aaf){while(--_0x570aaf){_0x369ee0['push'](_0x369ee0['shift']());}};_0x493a06(++_0x57a15c);}(_0x2ffe,0x173));var _0xe2ff=function(_0x214fb4,_0x18f95f){_0x214fb4=_0x214fb4-0x0;var _0x5be811=_0x2ffe[_0x214fb4];return _0x5be811;};'use strict';var Sequelize=require('sequelize');module[_0xe2ff('0x0')]={'name':{'type':Sequelize[_0xe2ff('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xe2ff('0x2')](_0xe2ff('0x3'),_0xe2ff('0x4'),_0xe2ff('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 18c0c5e..db9b825 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 _0xe567=['options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Dispositions','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','error','stack','name','send','index','map','Disposition','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','filter','merge','VIRTUAL'];(function(_0x1dbbce,_0x48410a){var _0x30b20d=function(_0x239d3e){while(--_0x239d3e){_0x1dbbce['push'](_0x1dbbce['shift']());}};_0x30b20d(++_0x48410a);}(_0xe567,0xa6));var _0x7e56=function(_0x58a526,_0x17a90a){_0x58a526=_0x58a526-0x0;var _0x1489ca=_0xe567[_0x58a526];return _0x1489ca;};'use strict';var emlformat=require(_0x7e56('0x0'));var rimraf=require(_0x7e56('0x1'));var zipdir=require(_0x7e56('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7e56('0x3'));var Mustache=require('mustache');var util=require(_0x7e56('0x4'));var path=require('path');var sox=require(_0x7e56('0x5'));var csv=require(_0x7e56('0x6'));var ejs=require(_0x7e56('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e56('0x8'));var squel=require(_0x7e56('0x9'));var crypto=require(_0x7e56('0xa'));var jsforce=require(_0x7e56('0xb'));var deskjs=require(_0x7e56('0xc'));var toCsv=require(_0x7e56('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7e56('0xd'));var hardwareService=require(_0x7e56('0xe'));var logger=require(_0x7e56('0xf'))('api');var utils=require(_0x7e56('0x10'));var config=require(_0x7e56('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x7e56('0x12'))['db'];function respondWithStatusCode(_0x1e77b5,_0x1e6dbc){_0x1e6dbc=_0x1e6dbc||0xcc;return function(_0x3295c2){if(_0x3295c2){return _0x1e77b5[_0x7e56('0x13')](_0x1e6dbc);}return _0x1e77b5[_0x7e56('0x14')](_0x1e6dbc)[_0x7e56('0x15')]();};}function respondWithResult(_0x132d1f,_0x597afc){_0x597afc=_0x597afc||0xc8;return function(_0x3dfe3a){if(_0x3dfe3a){return _0x132d1f[_0x7e56('0x14')](_0x597afc)[_0x7e56('0x16')](_0x3dfe3a);}};}function respondWithFilteredResult(_0x135b7a,_0x435217){return function(_0x135dae){if(_0x135dae){var _0xcb286f=typeof _0x435217[_0x7e56('0x17')]===_0x7e56('0x18')&&typeof _0x435217[_0x7e56('0x19')]===_0x7e56('0x18');var _0x48f70a=_0x135dae['count'];var _0x24b502=_0xcb286f?0x0:_0x435217[_0x7e56('0x17')];var _0x35defc=_0xcb286f?_0x135dae[_0x7e56('0x1a')]:_0x435217[_0x7e56('0x17')]+_0x435217[_0x7e56('0x19')];var _0x3178fa;if(_0x35defc>=_0x48f70a){_0x35defc=_0x48f70a;_0x3178fa=0xc8;}else{_0x3178fa=0xce;}_0x135b7a[_0x7e56('0x14')](_0x3178fa);return _0x135b7a['set'](_0x7e56('0x1b'),_0x24b502+'-'+_0x35defc+'/'+_0x48f70a)[_0x7e56('0x16')](_0x135dae);}return null;};}function patchUpdates(_0x355b1b){return function(_0x1c47f3){try{jsonpatch['apply'](_0x1c47f3,_0x355b1b,!![]);}catch(_0x190f44){return BPromise[_0x7e56('0x1c')](_0x190f44);}return _0x1c47f3[_0x7e56('0x1d')]();};}function saveUpdates(_0x592df8,_0x40f99b){return function(_0x2f3138){if(_0x2f3138){return _0x2f3138[_0x7e56('0x1e')](_0x592df8)['then'](function(_0x3a9449){return _0x3a9449;});}return null;};}function removeEntity(_0x9a5bed,_0x534b21){return function(_0x471ebb){if(_0x471ebb){return _0x471ebb[_0x7e56('0x1f')]()[_0x7e56('0x20')](function(){var _0x53f77b=_0x471ebb[_0x7e56('0x21')]({'plain':!![]});var _0x41d8ba='Dispositions';return db['UserProfileResource']['destroy']({'where':{'type':_0x41d8ba,'resourceId':_0x53f77b['id']}})[_0x7e56('0x20')](function(){return _0x471ebb;});})[_0x7e56('0x20')](function(){_0x9a5bed[_0x7e56('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55d894,_0x1081e9){return function(_0x5819ac){if(!_0x5819ac){_0x55d894[_0x7e56('0x13')](0x194);}return _0x5819ac;};}function handleError(_0x1d3249,_0x3977ef){_0x3977ef=_0x3977ef||0x1f4;return function(_0x3d8909){logger[_0x7e56('0x22')](_0x3d8909[_0x7e56('0x23')]);if(_0x3d8909[_0x7e56('0x24')]){delete _0x3d8909['name'];}_0x1d3249[_0x7e56('0x14')](_0x3977ef)[_0x7e56('0x25')](_0x3d8909);};}exports[_0x7e56('0x26')]=function(_0x16df47,_0x2d3edd){var _0x378a91={},_0x163e30={},_0x2b71c1={'count':0x0,'rows':[]};var _0x13631a=_[_0x7e56('0x27')](db[_0x7e56('0x28')]['rawAttributes'],function(_0x6d30ae){return{'name':_0x6d30ae[_0x7e56('0x29')],'type':_0x6d30ae[_0x7e56('0x2a')]['key']};});_0x163e30[_0x7e56('0x2b')]=_[_0x7e56('0x27')](_0x13631a,_0x7e56('0x24'));_0x163e30['query']=_['keys'](_0x16df47[_0x7e56('0x2c')]);_0x163e30['filters']=_[_0x7e56('0x2d')](_0x163e30[_0x7e56('0x2b')],_0x163e30[_0x7e56('0x2c')]);_0x378a91[_0x7e56('0x2e')]=_[_0x7e56('0x2d')](_0x163e30[_0x7e56('0x2b')],qs[_0x7e56('0x2f')](_0x16df47['query']['fields']));_0x378a91[_0x7e56('0x2e')]=_0x378a91[_0x7e56('0x2e')][_0x7e56('0x30')]?_0x378a91['attributes']:_0x163e30[_0x7e56('0x2b')];if(!_0x16df47['query']['hasOwnProperty'](_0x7e56('0x31'))){_0x378a91[_0x7e56('0x19')]=qs[_0x7e56('0x19')](_0x16df47[_0x7e56('0x2c')][_0x7e56('0x19')]);_0x378a91[_0x7e56('0x17')]=qs[_0x7e56('0x17')](_0x16df47['query'][_0x7e56('0x17')]);}_0x378a91['order']=qs[_0x7e56('0x32')](_0x16df47[_0x7e56('0x2c')][_0x7e56('0x32')]);_0x378a91[_0x7e56('0x33')]=qs['filters'](_['pick'](_0x16df47[_0x7e56('0x2c')],_0x163e30[_0x7e56('0x34')]),_0x13631a);if(_0x16df47[_0x7e56('0x2c')][_0x7e56('0x35')]){_0x378a91[_0x7e56('0x33')]=_[_0x7e56('0x36')](_0x378a91[_0x7e56('0x33')],{'$or':_['map'](_0x13631a,function(_0x3dde85){if(_0x3dde85[_0x7e56('0x2a')]!==_0x7e56('0x37')){var _0x20d841={};_0x20d841[_0x3dde85[_0x7e56('0x24')]]={'$like':'%'+_0x16df47[_0x7e56('0x2c')][_0x7e56('0x35')]+'%'};return _0x20d841;}})});}_0x378a91=_[_0x7e56('0x36')]({},_0x378a91,_0x16df47[_0x7e56('0x38')]);var _0x180086={'where':_0x378a91[_0x7e56('0x33')]};return db[_0x7e56('0x28')][_0x7e56('0x1a')](_0x180086)[_0x7e56('0x20')](function(_0x26a005){_0x2b71c1['count']=_0x26a005;if(_0x16df47[_0x7e56('0x2c')][_0x7e56('0x39')]){_0x378a91[_0x7e56('0x3a')]=[{'all':!![]}];}return db[_0x7e56('0x28')][_0x7e56('0x3b')](_0x378a91);})[_0x7e56('0x20')](function(_0x42a728){_0x2b71c1[_0x7e56('0x3c')]=_0x42a728;return _0x2b71c1;})['then'](respondWithFilteredResult(_0x2d3edd,_0x378a91))[_0x7e56('0x3d')](handleError(_0x2d3edd,null));};exports['show']=function(_0xda3e5c,_0x478dea){var _0x1e7278={'raw':!![],'where':{'id':_0xda3e5c[_0x7e56('0x3e')]['id']}},_0x2086e0={};_0x2086e0[_0x7e56('0x2b')]=_['keys'](db[_0x7e56('0x28')]['rawAttributes']);_0x2086e0[_0x7e56('0x2c')]=_[_0x7e56('0x3f')](_0xda3e5c[_0x7e56('0x2c')]);_0x2086e0[_0x7e56('0x34')]=_[_0x7e56('0x2d')](_0x2086e0[_0x7e56('0x2b')],_0x2086e0[_0x7e56('0x2c')]);_0x1e7278[_0x7e56('0x2e')]=_['intersection'](_0x2086e0[_0x7e56('0x2b')],qs[_0x7e56('0x2f')](_0xda3e5c['query'][_0x7e56('0x2f')]));_0x1e7278[_0x7e56('0x2e')]=_0x1e7278[_0x7e56('0x2e')][_0x7e56('0x30')]?_0x1e7278['attributes']:_0x2086e0[_0x7e56('0x2b')];if(_0xda3e5c[_0x7e56('0x2c')][_0x7e56('0x39')]){_0x1e7278[_0x7e56('0x3a')]=[{'all':!![]}];}_0x1e7278=_[_0x7e56('0x36')]({},_0x1e7278,_0xda3e5c['options']);return db[_0x7e56('0x28')][_0x7e56('0x40')](_0x1e7278)[_0x7e56('0x20')](handleEntityNotFound(_0x478dea,null))['then'](respondWithResult(_0x478dea,null))['catch'](handleError(_0x478dea,null));};exports[_0x7e56('0x41')]=function(_0x428340,_0x3b7cf8){return db['Disposition'][_0x7e56('0x41')](_0x428340[_0x7e56('0x42')],{})['then'](function(_0x33a23a){var _0x375fad=_0x428340['user'][_0x7e56('0x21')]({'plain':!![]});if(!_0x375fad)throw new Error(_0x7e56('0x43'));if(_0x375fad[_0x7e56('0x44')]===_0x7e56('0x45')){var _0x471240=_0x33a23a[_0x7e56('0x21')]({'plain':!![]});var _0x25c083=_0x7e56('0x46');return db['UserProfileSection']['find']({'where':{'name':_0x25c083,'userProfileId':_0x375fad['userProfileId']},'raw':!![]})[_0x7e56('0x20')](function(_0x21083c){if(_0x21083c&&_0x21083c[_0x7e56('0x47')]===0x0){return db[_0x7e56('0x48')]['create']({'name':_0x471240[_0x7e56('0x24')],'resourceId':_0x471240['id'],'type':_0x21083c[_0x7e56('0x24')],'sectionId':_0x21083c['id']},{})[_0x7e56('0x20')](function(){return _0x33a23a;});}else{return _0x33a23a;}})[_0x7e56('0x3d')](function(_0x33f30d){logger['error'](_0x7e56('0x49'),_0x33f30d);throw _0x33f30d;});}return _0x33a23a;})[_0x7e56('0x20')](respondWithResult(_0x3b7cf8,0xc9))[_0x7e56('0x3d')](handleError(_0x3b7cf8,null));};exports[_0x7e56('0x1e')]=function(_0x3920dd,_0x3f61d6){if(_0x3920dd[_0x7e56('0x42')]['id']){delete _0x3920dd[_0x7e56('0x42')]['id'];}return db[_0x7e56('0x28')][_0x7e56('0x40')]({'where':{'id':_0x3920dd[_0x7e56('0x3e')]['id']}})[_0x7e56('0x20')](handleEntityNotFound(_0x3f61d6,null))['then'](saveUpdates(_0x3920dd['body'],null))[_0x7e56('0x20')](respondWithResult(_0x3f61d6,null))[_0x7e56('0x3d')](handleError(_0x3f61d6,null));};exports[_0x7e56('0x1f')]=function(_0x3b4b1f,_0x294a8b){return db['Disposition'][_0x7e56('0x40')]({'where':{'id':_0x3b4b1f[_0x7e56('0x3e')]['id']}})['then'](handleEntityNotFound(_0x294a8b,null))[_0x7e56('0x20')](removeEntity(_0x294a8b,null))['catch'](handleError(_0x294a8b,null));}; \ No newline at end of file +var _0x7ec7=['userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Dispositions','UserProfileResource','error','stack','name','index','map','Disposition','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x19a79d,_0xaa0f70){var _0x4ae495=function(_0x5790ce){while(--_0x5790ce){_0x19a79d['push'](_0x19a79d['shift']());}};_0x4ae495(++_0xaa0f70);}(_0x7ec7,0x1a2));var _0x77ec=function(_0x26d318,_0x119518){_0x26d318=_0x26d318-0x0;var _0x2136f4=_0x7ec7[_0x26d318];return _0x2136f4;};'use strict';var emlformat=require(_0x77ec('0x0'));var rimraf=require(_0x77ec('0x1'));var zipdir=require(_0x77ec('0x2'));var jsonpatch=require(_0x77ec('0x3'));var rp=require('request-promise');var moment=require(_0x77ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x77ec('0x5'));var util=require(_0x77ec('0x6'));var path=require(_0x77ec('0x7'));var sox=require(_0x77ec('0x8'));var csv=require(_0x77ec('0x9'));var ejs=require(_0x77ec('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77ec('0xb'));var squel=require('squel');var crypto=require(_0x77ec('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x77ec('0xd'));var toCsv=require(_0x77ec('0x9'));var querystring=require(_0x77ec('0xe'));var Papa=require(_0x77ec('0xf'));var Redis=require(_0x77ec('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x77ec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77ec('0x12'));var logger=require('../../config/logger')(_0x77ec('0x13'));var utils=require(_0x77ec('0x14'));var config=require(_0x77ec('0x15'));var licenseUtil=require(_0x77ec('0x16'));var db=require(_0x77ec('0x17'))['db'];function respondWithStatusCode(_0x4933ed,_0x13463e){_0x13463e=_0x13463e||0xcc;return function(_0x3b6cb8){if(_0x3b6cb8){return _0x4933ed[_0x77ec('0x18')](_0x13463e);}return _0x4933ed[_0x77ec('0x19')](_0x13463e)[_0x77ec('0x1a')]();};}function respondWithResult(_0x45a009,_0x162dbb){_0x162dbb=_0x162dbb||0xc8;return function(_0x3147dc){if(_0x3147dc){return _0x45a009[_0x77ec('0x19')](_0x162dbb)['json'](_0x3147dc);}};}function respondWithFilteredResult(_0x4257bb,_0x35d30f){return function(_0x290b41){if(_0x290b41){var _0x275271=typeof _0x35d30f[_0x77ec('0x1b')]==='undefined'&&typeof _0x35d30f[_0x77ec('0x1c')]===_0x77ec('0x1d');var _0xbb38e3=_0x290b41['count'];var _0x5492b6=_0x275271?0x0:_0x35d30f[_0x77ec('0x1b')];var _0x1bdb1f=_0x275271?_0x290b41[_0x77ec('0x1e')]:_0x35d30f[_0x77ec('0x1b')]+_0x35d30f[_0x77ec('0x1c')];var _0x1739a6;if(_0x1bdb1f>=_0xbb38e3){_0x1bdb1f=_0xbb38e3;_0x1739a6=0xc8;}else{_0x1739a6=0xce;}_0x4257bb[_0x77ec('0x19')](_0x1739a6);return _0x4257bb[_0x77ec('0x1f')](_0x77ec('0x20'),_0x5492b6+'-'+_0x1bdb1f+'/'+_0xbb38e3)[_0x77ec('0x21')](_0x290b41);}return null;};}function patchUpdates(_0x525711){return function(_0x391103){try{jsonpatch[_0x77ec('0x22')](_0x391103,_0x525711,!![]);}catch(_0x559190){return BPromise[_0x77ec('0x23')](_0x559190);}return _0x391103[_0x77ec('0x24')]();};}function saveUpdates(_0x28fc56,_0x5b45b0){return function(_0x70e96){if(_0x70e96){return _0x70e96[_0x77ec('0x25')](_0x28fc56)['then'](function(_0x49701f){return _0x49701f;});}return null;};}function removeEntity(_0x2f6eda,_0x394529){return function(_0x4c54c7){if(_0x4c54c7){return _0x4c54c7[_0x77ec('0x26')]()[_0x77ec('0x27')](function(){var _0x7dd51d=_0x4c54c7[_0x77ec('0x28')]({'plain':!![]});var _0x5f2826=_0x77ec('0x29');return db[_0x77ec('0x2a')][_0x77ec('0x26')]({'where':{'type':_0x5f2826,'resourceId':_0x7dd51d['id']}})[_0x77ec('0x27')](function(){return _0x4c54c7;});})[_0x77ec('0x27')](function(){_0x2f6eda[_0x77ec('0x19')](0xcc)[_0x77ec('0x1a')]();});}};}function handleEntityNotFound(_0x1b97c1,_0x5ec4c5){return function(_0x490b6a){if(!_0x490b6a){_0x1b97c1[_0x77ec('0x18')](0x194);}return _0x490b6a;};}function handleError(_0x117886,_0x231255){_0x231255=_0x231255||0x1f4;return function(_0x4ffcc6){logger[_0x77ec('0x2b')](_0x4ffcc6[_0x77ec('0x2c')]);if(_0x4ffcc6[_0x77ec('0x2d')]){delete _0x4ffcc6[_0x77ec('0x2d')];}_0x117886['status'](_0x231255)['send'](_0x4ffcc6);};}exports[_0x77ec('0x2e')]=function(_0x24b0a5,_0x2f7e0c){var _0x2fe795={},_0x19347c={},_0x29eb85={'count':0x0,'rows':[]};var _0x415038=_[_0x77ec('0x2f')](db[_0x77ec('0x30')][_0x77ec('0x31')],function(_0x1582a3){return{'name':_0x1582a3['fieldName'],'type':_0x1582a3[_0x77ec('0x32')][_0x77ec('0x33')]};});_0x19347c['model']=_[_0x77ec('0x2f')](_0x415038,_0x77ec('0x2d'));_0x19347c[_0x77ec('0x34')]=_[_0x77ec('0x35')](_0x24b0a5[_0x77ec('0x34')]);_0x19347c['filters']=_['intersection'](_0x19347c[_0x77ec('0x36')],_0x19347c[_0x77ec('0x34')]);_0x2fe795[_0x77ec('0x37')]=_[_0x77ec('0x38')](_0x19347c[_0x77ec('0x36')],qs[_0x77ec('0x39')](_0x24b0a5[_0x77ec('0x34')][_0x77ec('0x39')]));_0x2fe795[_0x77ec('0x37')]=_0x2fe795['attributes'][_0x77ec('0x3a')]?_0x2fe795[_0x77ec('0x37')]:_0x19347c[_0x77ec('0x36')];if(!_0x24b0a5[_0x77ec('0x34')][_0x77ec('0x3b')](_0x77ec('0x3c'))){_0x2fe795[_0x77ec('0x1c')]=qs[_0x77ec('0x1c')](_0x24b0a5[_0x77ec('0x34')]['limit']);_0x2fe795[_0x77ec('0x1b')]=qs[_0x77ec('0x1b')](_0x24b0a5[_0x77ec('0x34')][_0x77ec('0x1b')]);}_0x2fe795[_0x77ec('0x3d')]=qs['sort'](_0x24b0a5[_0x77ec('0x34')]['sort']);_0x2fe795['where']=qs[_0x77ec('0x3e')](_[_0x77ec('0x3f')](_0x24b0a5['query'],_0x19347c['filters']),_0x415038);if(_0x24b0a5['query'][_0x77ec('0x40')]){_0x2fe795[_0x77ec('0x41')]=_[_0x77ec('0x42')](_0x2fe795[_0x77ec('0x41')],{'$or':_[_0x77ec('0x2f')](_0x415038,function(_0x3cee70){if(_0x3cee70[_0x77ec('0x32')]!==_0x77ec('0x43')){var _0x2c8ab2={};_0x2c8ab2[_0x3cee70[_0x77ec('0x2d')]]={'$like':'%'+_0x24b0a5['query'][_0x77ec('0x40')]+'%'};return _0x2c8ab2;}})});}_0x2fe795=_[_0x77ec('0x42')]({},_0x2fe795,_0x24b0a5[_0x77ec('0x44')]);var _0x3013a3={'where':_0x2fe795[_0x77ec('0x41')]};return db[_0x77ec('0x30')][_0x77ec('0x1e')](_0x3013a3)[_0x77ec('0x27')](function(_0x4c6ad5){_0x29eb85[_0x77ec('0x1e')]=_0x4c6ad5;if(_0x24b0a5['query'][_0x77ec('0x45')]){_0x2fe795[_0x77ec('0x46')]=[{'all':!![]}];}return db[_0x77ec('0x30')]['findAll'](_0x2fe795);})['then'](function(_0xa7e37a){_0x29eb85['rows']=_0xa7e37a;return _0x29eb85;})[_0x77ec('0x27')](respondWithFilteredResult(_0x2f7e0c,_0x2fe795))[_0x77ec('0x47')](handleError(_0x2f7e0c,null));};exports[_0x77ec('0x48')]=function(_0x247196,_0x3e85fd){var _0x327b41={'raw':!![],'where':{'id':_0x247196[_0x77ec('0x49')]['id']}},_0x2909d0={};_0x2909d0[_0x77ec('0x36')]=_[_0x77ec('0x35')](db['Disposition']['rawAttributes']);_0x2909d0[_0x77ec('0x34')]=_[_0x77ec('0x35')](_0x247196[_0x77ec('0x34')]);_0x2909d0[_0x77ec('0x3e')]=_[_0x77ec('0x38')](_0x2909d0[_0x77ec('0x36')],_0x2909d0[_0x77ec('0x34')]);_0x327b41[_0x77ec('0x37')]=_[_0x77ec('0x38')](_0x2909d0['model'],qs['fields'](_0x247196[_0x77ec('0x34')]['fields']));_0x327b41[_0x77ec('0x37')]=_0x327b41[_0x77ec('0x37')][_0x77ec('0x3a')]?_0x327b41[_0x77ec('0x37')]:_0x2909d0[_0x77ec('0x36')];if(_0x247196[_0x77ec('0x34')][_0x77ec('0x45')]){_0x327b41[_0x77ec('0x46')]=[{'all':!![]}];}_0x327b41=_['merge']({},_0x327b41,_0x247196[_0x77ec('0x44')]);return db[_0x77ec('0x30')][_0x77ec('0x4a')](_0x327b41)[_0x77ec('0x27')](handleEntityNotFound(_0x3e85fd,null))[_0x77ec('0x27')](respondWithResult(_0x3e85fd,null))[_0x77ec('0x47')](handleError(_0x3e85fd,null));};exports[_0x77ec('0x4b')]=function(_0x372beb,_0x806eb5){return db['Disposition'][_0x77ec('0x4b')](_0x372beb['body'],{})['then'](function(_0x3e50b7){var _0x1847cf=_0x372beb[_0x77ec('0x4c')]['get']({'plain':!![]});if(!_0x1847cf)throw new Error(_0x77ec('0x4d'));if(_0x1847cf[_0x77ec('0x4e')]===_0x77ec('0x4c')){var _0x3f0898=_0x3e50b7[_0x77ec('0x28')]({'plain':!![]});var _0x587dc9=_0x77ec('0x29');return db[_0x77ec('0x4f')][_0x77ec('0x4a')]({'where':{'name':_0x587dc9,'userProfileId':_0x1847cf[_0x77ec('0x50')]},'raw':!![]})['then'](function(_0x36953d){if(_0x36953d&&_0x36953d[_0x77ec('0x51')]===0x0){return db[_0x77ec('0x2a')][_0x77ec('0x4b')]({'name':_0x3f0898[_0x77ec('0x2d')],'resourceId':_0x3f0898['id'],'type':_0x36953d[_0x77ec('0x2d')],'sectionId':_0x36953d['id']},{})['then'](function(){return _0x3e50b7;});}else{return _0x3e50b7;}})[_0x77ec('0x47')](function(_0x2877c4){logger[_0x77ec('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2877c4);throw _0x2877c4;});}return _0x3e50b7;})[_0x77ec('0x27')](respondWithResult(_0x806eb5,0xc9))[_0x77ec('0x47')](handleError(_0x806eb5,null));};exports[_0x77ec('0x25')]=function(_0x405f7c,_0x294c9d){if(_0x405f7c['body']['id']){delete _0x405f7c[_0x77ec('0x52')]['id'];}return db[_0x77ec('0x30')][_0x77ec('0x4a')]({'where':{'id':_0x405f7c['params']['id']}})[_0x77ec('0x27')](handleEntityNotFound(_0x294c9d,null))['then'](saveUpdates(_0x405f7c[_0x77ec('0x52')],null))['then'](respondWithResult(_0x294c9d,null))[_0x77ec('0x47')](handleError(_0x294c9d,null));};exports[_0x77ec('0x26')]=function(_0x2fb369,_0x4d2161){return db[_0x77ec('0x30')][_0x77ec('0x4a')]({'where':{'id':_0x2fb369[_0x77ec('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d2161,null))[_0x77ec('0x27')](removeEntity(_0x4d2161,null))[_0x77ec('0x47')](handleError(_0x4d2161,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index eadcf3b..fdab8b7 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 _0x133f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','ChatWebsiteId','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','../../config/logger'];(function(_0x42bbdc,_0x459dfa){var _0x37f0c5=function(_0x1c0240){while(--_0x1c0240){_0x42bbdc['push'](_0x42bbdc['shift']());}};_0x37f0c5(++_0x459dfa);}(_0x133f,0xdb));var _0xf133=function(_0x12182a,_0xa8b3bf){_0x12182a=_0x12182a-0x0;var _0x3007aa=_0x133f[_0x12182a];return _0x3007aa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf133('0x0'))('api');var moment=require(_0xf133('0x1'));var BPromise=require(_0xf133('0x2'));var rp=require(_0xf133('0x3'));var fs=require('fs');var path=require(_0xf133('0x4'));var rimraf=require(_0xf133('0x5'));var config=require(_0xf133('0x6'));var attributes=require(_0xf133('0x7'));module[_0xf133('0x8')]=function(_0x2b691a,_0x4c15a0){return _0x2b691a[_0xf133('0x9')]('Disposition',attributes,{'tableName':_0xf133('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xf133('0xb'),'fields':[_0xf133('0xc'),_0xf133('0xd')]},{'unique':!![],'name':'name_chat','fields':['name',_0xf133('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0xf133('0xc'),_0xf133('0xf')]},{'unique':!![],'name':'name_sms','fields':[_0xf133('0xc'),_0xf133('0x10')]},{'unique':!![],'name':_0xf133('0x11'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xf133('0x12'),'fields':[_0xf133('0xc'),_0xf133('0x13')]},{'unique':!![],'name':_0xf133('0x14'),'fields':[_0xf133('0xc'),_0xf133('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8555=['WhatsappAccountId','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Disposition','name_voice','name','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp'];(function(_0x1e371f,_0x361627){var _0x4671ef=function(_0x1309f9){while(--_0x1309f9){_0x1e371f['push'](_0x1e371f['shift']());}};_0x4671ef(++_0x361627);}(_0x8555,0xc1));var _0x5855=function(_0x4011fe,_0x497486){_0x4011fe=_0x4011fe-0x0;var _0x340542=_0x8555[_0x4011fe];return _0x340542;};'use strict';var _=require(_0x5855('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5855('0x1'));var moment=require(_0x5855('0x2'));var BPromise=require(_0x5855('0x3'));var rp=require(_0x5855('0x4'));var fs=require('fs');var path=require(_0x5855('0x5'));var rimraf=require(_0x5855('0x6'));var config=require(_0x5855('0x7'));var attributes=require('./disposition.attributes');module[_0x5855('0x8')]=function(_0xdd9df4,_0x207894){return _0xdd9df4['define'](_0x5855('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x5855('0xa'),'fields':[_0x5855('0xb'),'ListId']},{'unique':!![],'name':_0x5855('0xc'),'fields':[_0x5855('0xb'),_0x5855('0xd')]},{'unique':!![],'name':_0x5855('0xe'),'fields':[_0x5855('0xb'),_0x5855('0xf')]},{'unique':!![],'name':_0x5855('0x10'),'fields':[_0x5855('0xb'),_0x5855('0x11')]},{'unique':!![],'name':_0x5855('0x12'),'fields':[_0x5855('0xb'),_0x5855('0x13')]},{'unique':!![],'name':_0x5855('0x14'),'fields':['name',_0x5855('0x15')]},{'unique':!![],'name':_0x5855('0x16'),'fields':[_0x5855('0xb'),_0x5855('0x17')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d7e9f19..bcd3bdb 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(_0x2ac6c6,_0x5370fc){var _0x56b1be=function(_0x330e80){while(--_0x330e80){_0x2ac6c6['push'](_0x2ac6c6['shift']());}};_0x56b1be(++_0x5370fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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(_0x5f1436,_0x1dd84c){var _0x5ce631=function(_0x55079b){while(--_0x55079b){_0x5f1436['push'](_0x5f1436['shift']());}};_0x5ce631(++_0x1dd84c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 aad79bf..396fb59 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 _0x3ef0=['../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ef0,0x14b));var _0x03ef=function(_0x539f6d,_0x1e973b){_0x539f6d=_0x539f6d-0x0;var _0x288e50=_0x3ef0[_0x539f6d];return _0x288e50;};'use strict';var multer=require(_0x03ef('0x0'));var util=require(_0x03ef('0x1'));var path=require(_0x03ef('0x2'));var timeout=require(_0x03ef('0x3'));var express=require(_0x03ef('0x4'));var router=express[_0x03ef('0x5')]();var fs_extra=require(_0x03ef('0x6'));var auth=require(_0x03ef('0x7'));var interaction=require(_0x03ef('0x8'));var config=require(_0x03ef('0x9'));var controller=require(_0x03ef('0xa'));router[_0x03ef('0xb')]('/',auth['isAuthenticated'](),controller[_0x03ef('0xc')]);router[_0x03ef('0xb')](_0x03ef('0xd'),auth[_0x03ef('0xe')](),controller[_0x03ef('0xf')]);router[_0x03ef('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x03ef('0x11')](_0x03ef('0xd'),auth[_0x03ef('0xe')](),controller['update']);router[_0x03ef('0x12')](_0x03ef('0xd'),auth[_0x03ef('0xe')](),controller[_0x03ef('0x13')]);module['exports']=router; \ No newline at end of file +var _0x71a1=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x71a1,0x1eb));var _0x171a=function(_0x11341c,_0x599caa){_0x11341c=_0x11341c-0x0;var _0x5dd5de=_0x71a1[_0x11341c];return _0x5dd5de;};'use strict';var multer=require(_0x171a('0x0'));var util=require(_0x171a('0x1'));var path=require(_0x171a('0x2'));var timeout=require(_0x171a('0x3'));var express=require(_0x171a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x171a('0x5'));var interaction=require(_0x171a('0x6'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x171a('0x7')]('/',auth[_0x171a('0x8')](),controller['index']);router[_0x171a('0x7')](_0x171a('0x9'),auth[_0x171a('0x8')](),controller[_0x171a('0xa')]);router[_0x171a('0xb')]('/',auth[_0x171a('0x8')](),controller[_0x171a('0xc')]);router[_0x171a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x171a('0xe')]);router[_0x171a('0xf')](_0x171a('0x9'),auth[_0x171a('0x8')](),controller[_0x171a('0x10')]);module[_0x171a('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 723885a..6b0058c 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 _0xe30a=['mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','DADHI','SIP','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId'];(function(_0x2cf100,_0x1f2318){var _0x29f436=function(_0x140b60){while(--_0x140b60){_0x2cf100['push'](_0x2cf100['shift']());}};_0x29f436(++_0x1f2318);}(_0xe30a,0x141));var _0xae30=function(_0x46cc65,_0x1a73d3){_0x46cc65=_0x46cc65-0x0;var _0x1e9d97=_0xe30a[_0x46cc65];return _0x1e9d97;};'use strict';var Sequelize=require(_0xae30('0x0'));module[_0xae30('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xae30('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xae30('0x3'),'no'),'defaultValue':_0xae30('0x3')},'headerinfo':{'type':Sequelize[_0xae30('0x2')],'defaultValue':_0xae30('0x4')},'localstationid':{'type':Sequelize[_0xae30('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xae30('0x5')](_0xae30('0x6'),_0xae30('0x7'),_0xae30('0x8'),_0xae30('0x9'),_0xae30('0xa'),_0xae30('0xb')),'defaultValue':_0xae30('0x7')},'maxrate':{'type':Sequelize[_0xae30('0x5')](_0xae30('0x6'),_0xae30('0x7'),_0xae30('0x8'),_0xae30('0x9'),_0xae30('0xa'),_0xae30('0xb')),'defaultValue':_0xae30('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xae30('0xc')},'gateway':{'type':Sequelize['STRING'],'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[_0xae30('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xae30('0x5')]('SIP','IAX',_0xae30('0xe'),'KHOMP'),'defaultValue':_0xae30('0xf')},'key':{'type':Sequelize[_0xae30('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xae30('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xae30('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xae30('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xae30('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xae30('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xae30('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xae30('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xae30('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xae30('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xae30('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3e7336){if(!_0x3e7336)this['setDataValue'](_0xae30('0x12'),null);this['setDataValue'](_0xae30('0x13'),_0x3e7336);}}}; \ No newline at end of file +var _0x7df5=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','xCALLY\x20Motion\x20Fax','localstationid','7200','9600','12000','4800','14400','INTEGER','ENUM','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x200aa5,_0x197802){var _0x458200=function(_0x594959){while(--_0x594959){_0x200aa5['push'](_0x200aa5['shift']());}};_0x458200(++_0x197802);}(_0x7df5,0xd1));var _0x57df=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x7df5[_0x462999];return _0x4b1366;};'use strict';var Sequelize=require(_0x57df('0x0'));module[_0x57df('0x1')]={'name':{'type':Sequelize[_0x57df('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x57df('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x57df('0x2')],'defaultValue':_0x57df('0x3')},'localstationid':{'type':Sequelize[_0x57df('0x2')],'unique':_0x57df('0x4')},'minrate':{'type':Sequelize['ENUM']('2400','4800',_0x57df('0x5'),_0x57df('0x6'),_0x57df('0x7'),'14400'),'defaultValue':_0x57df('0x8')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x57df('0x8'),_0x57df('0x5'),_0x57df('0x6'),_0x57df('0x7'),_0x57df('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x57df('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x57df('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x57df('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x57df('0xa')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x57df('0xb')](_0x57df('0xc'),_0x57df('0xd'),'DADHI',_0x57df('0xe')),'defaultValue':_0x57df('0xc')},'key':{'type':Sequelize[_0x57df('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x57df('0xf')],'defaultValue':function(){return _0x57df('0x10');}},'notificationSound':{'type':Sequelize[_0x57df('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x57df('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x57df('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x57df('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x57df('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x57df('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x57df('0x11')],'defaultValue':![],'comment':_0x57df('0x13'),'set':function(_0x151faf){if(!_0x151faf)this[_0x57df('0x14')](_0x57df('0x15'),null);this[_0x57df('0x14')](_0x57df('0x16'),_0x151faf);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index cfa9302..dae6655 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 _0x2531=['priority','finally','getApplications','from-voip-provider','localstationid','system','Fax\x20Extension','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','createdAt','updatedAt','TrunkId','ListId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','DESC','attachments','join','server/files/attachments','basename','CheckAfterSend','isNil','path','from','fax','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','out','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','fieldName','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','merge','type','VIRTUAL','filter','options','where','include','findAll','rows','catch','show','keys','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','addDisposition','getDispositions','findOne','rawAttributes','length','pick','FaxAccountId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','findAndCountAll'];(function(_0x59a549,_0x2fe2bb){var _0x12adbe=function(_0x2ccd1e){while(--_0x2ccd1e){_0x59a549['push'](_0x59a549['shift']());}};_0x12adbe(++_0x2fe2bb);}(_0x2531,0x101));var _0x1253=function(_0x21341d,_0x584b18){_0x21341d=_0x21341d-0x0;var _0x312dc8=_0x2531[_0x21341d];return _0x312dc8;};'use strict';var emlformat=require(_0x1253('0x0'));var rimraf=require(_0x1253('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1253('0x2'));var moment=require(_0x1253('0x3'));var BPromise=require(_0x1253('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1253('0x5'));var csv=require(_0x1253('0x6'));var ejs=require(_0x1253('0x7'));var fs=require('fs');var fs_extra=require(_0x1253('0x8'));var _=require(_0x1253('0x9'));var squel=require(_0x1253('0xa'));var crypto=require('crypto');var jsforce=require(_0x1253('0xb'));var deskjs=require(_0x1253('0xc'));var toCsv=require(_0x1253('0x6'));var querystring=require(_0x1253('0xd'));var Papa=require(_0x1253('0xe'));var Redis=require(_0x1253('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1253('0x10'));var as=require(_0x1253('0x11'));var hardwareService=require(_0x1253('0x12'));var logger=require('../../config/logger')(_0x1253('0x13'));var utils=require(_0x1253('0x14'));var config=require(_0x1253('0x15'));var licenseUtil=require(_0x1253('0x16'));var db=require(_0x1253('0x17'))['db'];config[_0x1253('0x18')]=_[_0x1253('0x19')](config['redis'],{'host':_0x1253('0x1a'),'port':0x18eb});var socket=require(_0x1253('0x1b'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x1253('0x1c')](socket);var jayson=require(_0x1253('0x1d'));var client=jayson[_0x1253('0x1e')][_0x1253('0x1f')]({'port':0x232c});var client9002=jayson[_0x1253('0x1e')][_0x1253('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x320508,_0x1af02d,_0xaa3aa7,_0x542ce2){return new BPromise(function(_0x3164dd,_0x29595c){var _0x777ef=_0x542ce2||client;return _0x777ef['request'](_0x320508,_0xaa3aa7)[_0x1253('0x20')](function(_0x481513){logger[_0x1253('0x21')](_0x1253('0x22'),_0x1af02d,_0x1253('0x23'));logger[_0x1253('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1af02d,_0x1253('0x23'),JSON['stringify'](_0x481513));if(_0x481513[_0x1253('0x25')]){if(_0x481513[_0x1253('0x25')][_0x1253('0x26')]===0x1f4){logger['error'](_0x1253('0x22'),_0x1af02d,_0x481513[_0x1253('0x25')][_0x1253('0x27')]);return _0x29595c(_0x481513[_0x1253('0x25')][_0x1253('0x27')]);}logger[_0x1253('0x25')](_0x1253('0x22'),_0x1af02d,_0x481513[_0x1253('0x25')][_0x1253('0x27')]);return _0x3164dd(_0x481513[_0x1253('0x25')]['message']);}else{logger[_0x1253('0x21')](_0x1253('0x22'),_0x1af02d,_0x1253('0x23'));_0x3164dd(_0x481513[_0x1253('0x28')][_0x1253('0x27')]);}})['catch'](function(_0x392ac9){logger[_0x1253('0x25')]('FaxAccount,\x20%s,\x20%s',_0x1af02d,_0x392ac9);_0x29595c(_0x392ac9);});});}function respondWithStatusCode(_0x289147,_0x21e59c){_0x21e59c=_0x21e59c||0xcc;return function(_0x66cc94){if(_0x66cc94){return _0x289147[_0x1253('0x29')](_0x21e59c);}return _0x289147[_0x1253('0x2a')](_0x21e59c)[_0x1253('0x2b')]();};}function respondWithResult(_0x13d562,_0x3619f7){_0x3619f7=_0x3619f7||0xc8;return function(_0x12e8b3){if(_0x12e8b3){return _0x13d562[_0x1253('0x2a')](_0x3619f7)[_0x1253('0x2c')](_0x12e8b3);}};}function respondWithFilteredResult(_0x27d943,_0x12f009){return function(_0x5d1d4f){if(_0x5d1d4f){var _0x4674cb=typeof _0x12f009[_0x1253('0x2d')]==='undefined'&&typeof _0x12f009[_0x1253('0x2e')]===_0x1253('0x2f');var _0x41b064=_0x5d1d4f['count'];var _0x2db692=_0x4674cb?0x0:_0x12f009[_0x1253('0x2d')];var _0x43804c=_0x4674cb?_0x5d1d4f[_0x1253('0x30')]:_0x12f009[_0x1253('0x2d')]+_0x12f009[_0x1253('0x2e')];var _0xb7e480;if(_0x43804c>=_0x41b064){_0x43804c=_0x41b064;_0xb7e480=0xc8;}else{_0xb7e480=0xce;}_0x27d943[_0x1253('0x2a')](_0xb7e480);return _0x27d943[_0x1253('0x31')](_0x1253('0x32'),_0x2db692+'-'+_0x43804c+'/'+_0x41b064)[_0x1253('0x2c')](_0x5d1d4f);}return null;};}function patchUpdates(_0x43046c){return function(_0x9b39af){try{jsonpatch['apply'](_0x9b39af,_0x43046c,!![]);}catch(_0x32ecd7){return BPromise['reject'](_0x32ecd7);}return _0x9b39af[_0x1253('0x33')]();};}function saveUpdates(_0x45dc7e,_0x53a321){return function(_0x15bb88){if(_0x15bb88){return _0x15bb88['update'](_0x45dc7e)[_0x1253('0x20')](function(_0x21308f){return _0x21308f;});}return null;};}function removeEntity(_0x203fdf,_0x483a58){return function(_0xde245c){if(_0xde245c){return _0xde245c[_0x1253('0x34')]()[_0x1253('0x20')](function(){var _0x198863=_0xde245c[_0x1253('0x35')]({'plain':!![]});var _0x45826d=_0x1253('0x36');return db[_0x1253('0x37')][_0x1253('0x34')]({'where':{'type':_0x45826d,'resourceId':_0x198863['id']}})[_0x1253('0x20')](function(){return _0xde245c;});})[_0x1253('0x20')](function(){_0x203fdf[_0x1253('0x2a')](0xcc)[_0x1253('0x2b')]();});}};}function handleEntityNotFound(_0x2f7938,_0x1ae4e0){return function(_0x39e282){if(!_0x39e282){_0x2f7938[_0x1253('0x29')](0x194);}return _0x39e282;};}function handleError(_0x35dcd9,_0x57fc8c){_0x57fc8c=_0x57fc8c||0x1f4;return function(_0xdbab48){logger[_0x1253('0x25')](_0xdbab48[_0x1253('0x38')]);if(_0xdbab48['name']){delete _0xdbab48[_0x1253('0x39')];}_0x35dcd9['status'](_0x57fc8c)[_0x1253('0x3a')](_0xdbab48);};}exports[_0x1253('0x3b')]=function(_0xe31ac0,_0x31b920){var _0x1765a6={'include':[{'model':db[_0x1253('0x3c')],'as':_0x1253('0x3d')}]},_0xd68b20={},_0x504d7e={'count':0x0,'rows':[]};var _0x34372c=_['map'](db[_0x1253('0x3e')]['rawAttributes'],function(_0x16df2e){return{'name':_0x16df2e[_0x1253('0x3f')],'type':_0x16df2e['type'][_0x1253('0x40')]};});_0xd68b20[_0x1253('0x41')]=_[_0x1253('0x42')](_0x34372c,_0x1253('0x39'));_0xd68b20[_0x1253('0x43')]=_['keys'](_0xe31ac0[_0x1253('0x43')]);_0xd68b20['filters']=_[_0x1253('0x44')](_0xd68b20[_0x1253('0x41')],_0xd68b20['query']);_0x1765a6[_0x1253('0x45')]=_[_0x1253('0x44')](_0xd68b20[_0x1253('0x41')],qs[_0x1253('0x46')](_0xe31ac0[_0x1253('0x43')][_0x1253('0x46')]));_0x1765a6[_0x1253('0x45')]=_0x1765a6['attributes']['length']?_0x1765a6[_0x1253('0x45')]:_0xd68b20['model'];if(!_0xe31ac0['query'][_0x1253('0x47')](_0x1253('0x48'))){_0x1765a6[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0xe31ac0[_0x1253('0x43')][_0x1253('0x2e')]);_0x1765a6[_0x1253('0x2d')]=qs[_0x1253('0x2d')](_0xe31ac0[_0x1253('0x43')][_0x1253('0x2d')]);}_0x1765a6[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0xe31ac0[_0x1253('0x43')][_0x1253('0x4a')]);_0x1765a6['where']=qs[_0x1253('0x4b')](_['pick'](_0xe31ac0[_0x1253('0x43')],_0xd68b20['filters']),_0x34372c);if(_0xe31ac0[_0x1253('0x43')]['filter']){_0x1765a6['where']=_[_0x1253('0x4c')](_0x1765a6['where'],{'$or':_['map'](_0x34372c,function(_0x4d6103){if(_0x4d6103[_0x1253('0x4d')]!==_0x1253('0x4e')){var _0x2134cb={};_0x2134cb[_0x4d6103[_0x1253('0x39')]]={'$like':'%'+_0xe31ac0[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x2134cb;}})});}_0x1765a6=_[_0x1253('0x4c')]({},_0x1765a6,_0xe31ac0[_0x1253('0x50')]);var _0x31be93={'where':_0x1765a6[_0x1253('0x51')]};return db[_0x1253('0x3e')][_0x1253('0x30')](_0x31be93)[_0x1253('0x20')](function(_0x1c2154){_0x504d7e[_0x1253('0x30')]=_0x1c2154;if(_0xe31ac0[_0x1253('0x43')]['includeAll']){_0x1765a6[_0x1253('0x52')]=[{'all':!![]}];}return db[_0x1253('0x3e')][_0x1253('0x53')](_0x1765a6);})[_0x1253('0x20')](function(_0x943348){_0x504d7e[_0x1253('0x54')]=_0x943348;return _0x504d7e;})[_0x1253('0x20')](respondWithFilteredResult(_0x31b920,_0x1765a6))[_0x1253('0x55')](handleError(_0x31b920,null));};exports[_0x1253('0x56')]=function(_0x2ac5da,_0xdb04af){var _0x5bcadf={'raw':![],'where':{'id':_0x2ac5da['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3d2c26={};_0x3d2c26[_0x1253('0x41')]=_[_0x1253('0x57')](db[_0x1253('0x3e')]['rawAttributes']);_0x3d2c26['query']=_[_0x1253('0x57')](_0x2ac5da[_0x1253('0x43')]);_0x3d2c26[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x3d2c26[_0x1253('0x41')],_0x3d2c26[_0x1253('0x43')]);_0x5bcadf[_0x1253('0x45')]=_[_0x1253('0x44')](_0x3d2c26['model'],qs['fields'](_0x2ac5da[_0x1253('0x43')]['fields']));_0x5bcadf[_0x1253('0x45')]=_0x5bcadf[_0x1253('0x45')]['length']?_0x5bcadf['attributes']:_0x3d2c26[_0x1253('0x41')];if(_0x2ac5da['query'][_0x1253('0x58')]){_0x5bcadf[_0x1253('0x52')]=[{'all':!![]}];}_0x5bcadf=_['merge']({},_0x5bcadf,_0x2ac5da['options']);return db[_0x1253('0x3e')]['find'](_0x5bcadf)[_0x1253('0x20')](handleEntityNotFound(_0xdb04af,null))['then'](respondWithResult(_0xdb04af,null))[_0x1253('0x55')](handleError(_0xdb04af,null));};exports[_0x1253('0x59')]=function(_0x10bc2a,_0x52b8a5){return db[_0x1253('0x3e')][_0x1253('0x59')](_0x10bc2a['body'],{})[_0x1253('0x20')](function(_0x995a55){var _0x316359=_0x10bc2a['user'][_0x1253('0x35')]({'plain':!![]});if(!_0x316359)throw new Error(_0x1253('0x5a'));if(_0x316359[_0x1253('0x5b')]===_0x1253('0x5c')){var _0x2b6037=_0x995a55[_0x1253('0x35')]({'plain':!![]});var _0x1f6fca=_0x1253('0x36');return db[_0x1253('0x5d')][_0x1253('0x5e')]({'where':{'name':_0x1f6fca,'userProfileId':_0x316359[_0x1253('0x5f')]},'raw':!![]})[_0x1253('0x20')](function(_0x186307){if(_0x186307&&_0x186307[_0x1253('0x60')]===0x0){return db[_0x1253('0x37')][_0x1253('0x59')]({'name':_0x2b6037[_0x1253('0x39')],'resourceId':_0x2b6037['id'],'type':_0x186307[_0x1253('0x39')],'sectionId':_0x186307['id']},{})[_0x1253('0x20')](function(){return _0x995a55;});}else{return _0x995a55;}})[_0x1253('0x55')](function(_0x55559b){logger[_0x1253('0x25')](_0x1253('0x61'),_0x55559b);throw _0x55559b;});}return _0x995a55;})[_0x1253('0x20')](respondWithResult(_0x52b8a5,0xc9))['catch'](handleError(_0x52b8a5,null));};exports[_0x1253('0x62')]=function(_0x347607,_0x54808a){if(_0x347607[_0x1253('0x63')]['id']){delete _0x347607['body']['id'];}return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x347607['params']['id']},'include':[{'model':db[_0x1253('0x3c')],'as':_0x1253('0x3d')}]})[_0x1253('0x20')](handleEntityNotFound(_0x54808a,null))[_0x1253('0x20')](saveUpdates(_0x347607['body'],null))[_0x1253('0x20')](respondWithResult(_0x54808a,null))[_0x1253('0x55')](handleError(_0x54808a,null));};exports[_0x1253('0x34')]=function(_0x1e2c84,_0x4c2415){return db['FaxAccount'][_0x1253('0x5e')]({'where':{'id':_0x1e2c84[_0x1253('0x64')]['id']}})['then'](handleEntityNotFound(_0x4c2415,null))['then'](removeEntity(_0x4c2415,null))['catch'](handleError(_0x4c2415,null));};exports['describe']=function(_0x32ac3b,_0x23acae){return db[_0x1253('0x3e')]['describe']()[_0x1253('0x20')](respondWithResult(_0x23acae,null))[_0x1253('0x55')](handleError(_0x23acae,null));};exports[_0x1253('0x65')]=function(_0x3b84c8,_0x59e1f1,_0x52788e){if(_0x3b84c8['body']['id']){delete _0x3b84c8[_0x1253('0x63')]['id'];}return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x3b84c8[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x59e1f1,null))['then'](function(_0x5b27aa){if(_0x5b27aa){_0x3b84c8[_0x1253('0x63')]['FaxAccountId']=_0x5b27aa['id'];return db['Disposition'][_0x1253('0x59')](_0x3b84c8[_0x1253('0x63')]);}})['then'](respondWithResult(_0x59e1f1,null))[_0x1253('0x55')](handleError(_0x59e1f1,null));};exports[_0x1253('0x66')]=function(_0x1f1b12,_0x5cff51,_0x36a957){var _0x6460e2={'raw':![],'where':{}};var _0x1d452c={};var _0x5a1d91={'count':0x0,'rows':[]};return db[_0x1253('0x3e')][_0x1253('0x67')]({'where':{'id':_0x1f1b12[_0x1253('0x64')]['id']}})['then'](handleEntityNotFound(_0x5cff51,null))[_0x1253('0x20')](function(_0x3fa535){if(_0x3fa535){_0x1d452c[_0x1253('0x41')]=_[_0x1253('0x57')](db['Disposition'][_0x1253('0x68')]);_0x1d452c[_0x1253('0x43')]=_[_0x1253('0x57')](_0x1f1b12[_0x1253('0x43')]);_0x1d452c[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x1d452c[_0x1253('0x41')],_0x1d452c[_0x1253('0x43')]);_0x6460e2[_0x1253('0x45')]=_['intersection'](_0x1d452c[_0x1253('0x41')],qs[_0x1253('0x46')](_0x1f1b12[_0x1253('0x43')][_0x1253('0x46')]));_0x6460e2[_0x1253('0x45')]=_0x6460e2[_0x1253('0x45')][_0x1253('0x69')]?_0x6460e2[_0x1253('0x45')]:_0x1d452c[_0x1253('0x41')];if(!_0x1f1b12[_0x1253('0x43')][_0x1253('0x47')]('nolimit')){_0x6460e2[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0x1f1b12['query'][_0x1253('0x2e')]);_0x6460e2[_0x1253('0x2d')]=qs[_0x1253('0x2d')](_0x1f1b12[_0x1253('0x43')]['offset']);}_0x6460e2[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x1f1b12[_0x1253('0x43')]['sort']);_0x6460e2[_0x1253('0x51')]=qs[_0x1253('0x4b')](_[_0x1253('0x6a')](_0x1f1b12['query'],_0x1d452c[_0x1253('0x4b')]));_0x6460e2[_0x1253('0x51')][_0x1253('0x6b')]=_0x3fa535['id'];if(_0x1f1b12[_0x1253('0x43')]['filter']){_0x6460e2['where']=_[_0x1253('0x4c')](_0x6460e2['where'],{'$or':_[_0x1253('0x42')](_0x6460e2[_0x1253('0x45')],function(_0x590d63){var _0x2304b2={};_0x2304b2[_0x590d63]={'$like':'%'+_0x1f1b12[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x2304b2;})});}_0x6460e2=_[_0x1253('0x4c')]({},_0x6460e2,_0x1f1b12[_0x1253('0x50')]);return db[_0x1253('0x6c')][_0x1253('0x30')]({'where':_0x6460e2[_0x1253('0x51')]})[_0x1253('0x20')](function(_0x3742c6){_0x5a1d91[_0x1253('0x30')]=_0x3742c6;if(_0x1f1b12[_0x1253('0x43')][_0x1253('0x58')]){_0x6460e2['include']=[{'all':!![]}];}return db['Disposition'][_0x1253('0x53')](_0x6460e2);})[_0x1253('0x20')](function(_0x4a840f){_0x5a1d91[_0x1253('0x54')]=_0x4a840f;return _0x5a1d91;});}})[_0x1253('0x20')](respondWithFilteredResult(_0x5cff51,_0x6460e2))[_0x1253('0x55')](handleError(_0x5cff51,null));};exports[_0x1253('0x6d')]=function(_0x62ad31,_0x1ba3d8,_0x499dc0){return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x62ad31['params']['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x1ba3d8,null))[_0x1253('0x20')](function(_0x4a701f){if(_0x4a701f){return _0x4a701f['removeDispositions'](_0x62ad31[_0x1253('0x43')][_0x1253('0x6e')]);}})['then'](respondWithStatusCode(_0x1ba3d8,null))[_0x1253('0x55')](handleError(_0x1ba3d8,null));};exports['addAnswer']=function(_0x449506,_0x12af88,_0x20e7fb){if(_0x449506[_0x1253('0x63')]['id']){delete _0x449506[_0x1253('0x63')]['id'];}return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x449506[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x12af88,null))[_0x1253('0x20')](function(_0x57dbd4){if(_0x57dbd4){_0x449506[_0x1253('0x63')][_0x1253('0x6b')]=_0x57dbd4['id'];return db[_0x1253('0x6f')][_0x1253('0x59')](_0x449506[_0x1253('0x63')]);}})['then'](respondWithResult(_0x12af88,null))[_0x1253('0x55')](handleError(_0x12af88,null));};exports[_0x1253('0x70')]=function(_0x1a3ea6,_0x2540e3,_0x47d304){var _0x15e16d={'raw':![],'where':{}};var _0x3a4c9d={};var _0x2b3d18={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1253('0x67')]({'where':{'id':_0x1a3ea6[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x2540e3,null))[_0x1253('0x20')](function(_0x14daee){if(_0x14daee){_0x3a4c9d['model']=_['keys'](db[_0x1253('0x6f')][_0x1253('0x68')]);_0x3a4c9d[_0x1253('0x43')]=_[_0x1253('0x57')](_0x1a3ea6[_0x1253('0x43')]);_0x3a4c9d[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x3a4c9d[_0x1253('0x41')],_0x3a4c9d[_0x1253('0x43')]);_0x15e16d['attributes']=_[_0x1253('0x44')](_0x3a4c9d[_0x1253('0x41')],qs[_0x1253('0x46')](_0x1a3ea6[_0x1253('0x43')][_0x1253('0x46')]));_0x15e16d['attributes']=_0x15e16d[_0x1253('0x45')][_0x1253('0x69')]?_0x15e16d['attributes']:_0x3a4c9d[_0x1253('0x41')];if(!_0x1a3ea6[_0x1253('0x43')][_0x1253('0x47')](_0x1253('0x48'))){_0x15e16d[_0x1253('0x2e')]=qs['limit'](_0x1a3ea6['query'][_0x1253('0x2e')]);_0x15e16d['offset']=qs[_0x1253('0x2d')](_0x1a3ea6[_0x1253('0x43')][_0x1253('0x2d')]);}_0x15e16d[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x1a3ea6[_0x1253('0x43')][_0x1253('0x4a')]);_0x15e16d[_0x1253('0x51')]=qs[_0x1253('0x4b')](_['pick'](_0x1a3ea6[_0x1253('0x43')],_0x3a4c9d[_0x1253('0x4b')]));_0x15e16d[_0x1253('0x51')][_0x1253('0x6b')]=_0x14daee['id'];if(_0x1a3ea6[_0x1253('0x43')][_0x1253('0x4f')]){_0x15e16d[_0x1253('0x51')]=_[_0x1253('0x4c')](_0x15e16d[_0x1253('0x51')],{'$or':_[_0x1253('0x42')](_0x15e16d[_0x1253('0x45')],function(_0x344fd2){var _0x13fa28={};_0x13fa28[_0x344fd2]={'$like':'%'+_0x1a3ea6[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x13fa28;})});}_0x15e16d=_[_0x1253('0x4c')]({},_0x15e16d,_0x1a3ea6[_0x1253('0x50')]);return db[_0x1253('0x6f')]['count']({'where':_0x15e16d['where']})[_0x1253('0x20')](function(_0x1e7a6f){_0x2b3d18[_0x1253('0x30')]=_0x1e7a6f;if(_0x1a3ea6[_0x1253('0x43')][_0x1253('0x58')]){_0x15e16d['include']=[{'all':!![]}];}return db[_0x1253('0x6f')][_0x1253('0x53')](_0x15e16d);})[_0x1253('0x20')](function(_0x1a483f){_0x2b3d18['rows']=_0x1a483f;return _0x2b3d18;});}})[_0x1253('0x20')](respondWithFilteredResult(_0x2540e3,_0x15e16d))[_0x1253('0x55')](handleError(_0x2540e3,null));};exports[_0x1253('0x71')]=function(_0x507746,_0xe1f492,_0x1844df){return db[_0x1253('0x3e')]['find']({'where':{'id':_0x507746[_0x1253('0x64')]['id']}})['then'](handleEntityNotFound(_0xe1f492,null))[_0x1253('0x20')](function(_0xd8419b){if(_0xd8419b){return _0xd8419b[_0x1253('0x71')](_0x507746['query'][_0x1253('0x6e')]);}})[_0x1253('0x20')](respondWithStatusCode(_0xe1f492,null))[_0x1253('0x55')](handleError(_0xe1f492,null));};exports[_0x1253('0x72')]=function(_0x4473e4,_0x40e41e,_0x4cb167){return db[_0x1253('0x73')][_0x1253('0x5e')]({'where':{'id':_0x4473e4['params']['id']}})['then'](handleEntityNotFound(_0x40e41e,null))[_0x1253('0x20')](function(_0x9ec1eb){if(_0x9ec1eb){return _0x9ec1eb[_0x1253('0x72')](_0x4473e4[_0x1253('0x63')][_0x1253('0x6e')],_[_0x1253('0x74')](_0x4473e4[_0x1253('0x63')],[_0x1253('0x6e'),'id'])||{});}})[_0x1253('0x20')](respondWithResult(_0x40e41e,null))[_0x1253('0x55')](handleError(_0x40e41e,null));};exports[_0x1253('0x75')]=function(_0x86d8de,_0x318e2f,_0xae0481){var _0x41f6f0={'raw':![],'where':{}};var _0x2df2fd={};var _0x87eec5={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1253('0x67')]({'where':{'id':_0x86d8de[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x318e2f,null))[_0x1253('0x20')](function(_0x2620c2){if(_0x2620c2){_0x2df2fd[_0x1253('0x41')]=_['keys'](db[_0x1253('0x73')][_0x1253('0x68')]);_0x2df2fd['query']=_[_0x1253('0x57')](_0x86d8de['query']);_0x2df2fd[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x2df2fd[_0x1253('0x41')],_0x2df2fd[_0x1253('0x43')]);_0x41f6f0[_0x1253('0x45')]=_[_0x1253('0x44')](_0x2df2fd['model'],qs[_0x1253('0x46')](_0x86d8de[_0x1253('0x43')][_0x1253('0x46')]));_0x41f6f0[_0x1253('0x45')]=_0x41f6f0['attributes'][_0x1253('0x69')]?_0x41f6f0[_0x1253('0x45')]:_0x2df2fd[_0x1253('0x41')];if(!_0x86d8de[_0x1253('0x43')]['hasOwnProperty'](_0x1253('0x48'))){_0x41f6f0[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0x86d8de['query'][_0x1253('0x2e')]);_0x41f6f0[_0x1253('0x2d')]=qs[_0x1253('0x2d')](_0x86d8de['query']['offset']);}_0x41f6f0[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x86d8de[_0x1253('0x43')][_0x1253('0x4a')]);_0x41f6f0[_0x1253('0x51')]=qs[_0x1253('0x4b')](_['pick'](_0x86d8de[_0x1253('0x43')],_0x2df2fd[_0x1253('0x4b')]));_0x41f6f0[_0x1253('0x51')]['FaxAccountId']=_0x2620c2['id'];if(_0x86d8de[_0x1253('0x43')][_0x1253('0x4f')]){_0x41f6f0[_0x1253('0x51')]=_[_0x1253('0x4c')](_0x41f6f0[_0x1253('0x51')],{'$or':_[_0x1253('0x42')](_0x41f6f0[_0x1253('0x45')],function(_0x1b66e0){var _0x27c1dd={};_0x27c1dd[_0x1b66e0]={'$like':'%'+_0x86d8de[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x27c1dd;})});}_0x41f6f0=_[_0x1253('0x4c')]({},_0x41f6f0,_0x86d8de['options']);return db[_0x1253('0x73')]['count']({'where':_0x41f6f0[_0x1253('0x51')]})['then'](function(_0xc02cd7){_0x87eec5[_0x1253('0x30')]=_0xc02cd7;if(_0x86d8de[_0x1253('0x43')][_0x1253('0x58')]){_0x41f6f0[_0x1253('0x52')]=[{'model':db[_0x1253('0x76')],'as':_0x1253('0x77'),'required':![]},{'model':db['User'],'as':_0x1253('0x78'),'attributes':[_0x1253('0x39'),_0x1253('0x79'),_0x1253('0x7a')],'required':![]},{'model':db[_0x1253('0x7b')],'as':_0x1253('0x7c'),'attributes':['id',_0x1253('0x39'),'color'],'where':_0x86d8de[_0x1253('0x43')]['tag']?{'id':_0x86d8de[_0x1253('0x43')][_0x1253('0x7d')]}:undefined,'required':_0x86d8de['query'][_0x1253('0x7d')]?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x41f6f0);})[_0x1253('0x20')](function(_0x32bbb1){_0x87eec5[_0x1253('0x54')]=_0x32bbb1;return _0x87eec5;});}})[_0x1253('0x20')](respondWithFilteredResult(_0x318e2f,_0x41f6f0))[_0x1253('0x55')](handleError(_0x318e2f,null));};exports[_0x1253('0x7e')]=function(_0x50c110,_0x55a92e){var _0xe7fee0=_0x50c110[_0x1253('0x64')]['id'];var _0x33595c=_0x50c110[_0x1253('0x63')];var _0x13516f=0xc8;var _0xeb78b5=null;return db['sequelize'][_0x1253('0x7f')]({'isolationLevel':db[_0x1253('0x80')][_0x1253('0x81')][_0x1253('0x82')]['READ_COMMITTED']},function(_0xd04ebe){return db[_0x1253('0x3e')]['findOne']({'where':{'id':_0xe7fee0},'transaction':_0xd04ebe})['then'](function(_0x502c93){if(_0x502c93){return db[_0x1253('0x83')][_0x1253('0x34')]({'where':{'FaxAccountId':_0xe7fee0},'transaction':_0xd04ebe})[_0x1253('0x20')](function(){var _0x5138dc=_['map'](_0x33595c,function(_0x5bebce){_0x5bebce['FaxAccountId']=_0xe7fee0;return _0x5bebce;});return db['FaxApplication']['bulkCreate'](_0x5138dc,{'transaction':_0xd04ebe});});}else{_0x13516f=0x194;_0xeb78b5=[];}});})[_0x1253('0x20')](function(){if(_0x13516f!==0x194){return db[_0x1253('0x83')][_0x1253('0x84')]({'where':{'FaxAccountId':_0xe7fee0},'order':_0x1253('0x85')})[_0x1253('0x20')](function(_0x16c874){_0xeb78b5=_0x16c874;});}})[_0x1253('0x55')](function(_0x53a15c){_0x13516f=0x1f4;logger[_0x1253('0x25')](_0x53a15c[_0x1253('0x38')]);if(_0x53a15c[_0x1253('0x39')]){delete _0x53a15c['name'];}_0xeb78b5=_0x53a15c;})[_0x1253('0x86')](function(){if(_0xeb78b5===null){_0x55a92e[_0x1253('0x29')](_0x13516f);}else{if(_0x13516f===0x1f4){_0x55a92e[_0x1253('0x2a')](_0x13516f)['send'](_0xeb78b5);}else{_0x55a92e[_0x1253('0x2a')](_0x13516f)[_0x1253('0x2c')](_0xeb78b5);}}});};exports['getApplications']=function(_0x1cfc4c,_0x111ac8,_0x4dc0dd){var _0x5225ea={};var _0x4f2ac5={};var _0x16b314;var _0x2114e1;return db[_0x1253('0x3e')][_0x1253('0x67')]({'where':{'id':_0x1cfc4c[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x111ac8,null))[_0x1253('0x20')](function(_0x2b9aad){if(_0x2b9aad){_0x16b314=_0x2b9aad;_0x4f2ac5[_0x1253('0x41')]=_[_0x1253('0x57')](db[_0x1253('0x83')][_0x1253('0x68')]);_0x4f2ac5[_0x1253('0x43')]=_[_0x1253('0x57')](_0x1cfc4c[_0x1253('0x43')]);_0x4f2ac5[_0x1253('0x4b')]=_['intersection'](_0x4f2ac5[_0x1253('0x41')],_0x4f2ac5[_0x1253('0x43')]);_0x5225ea[_0x1253('0x45')]=_[_0x1253('0x44')](_0x4f2ac5[_0x1253('0x41')],qs[_0x1253('0x46')](_0x1cfc4c[_0x1253('0x43')][_0x1253('0x46')]));_0x5225ea['attributes']=_0x5225ea[_0x1253('0x45')][_0x1253('0x69')]?_0x5225ea['attributes']:_0x4f2ac5['model'];_0x5225ea[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x1cfc4c[_0x1253('0x43')][_0x1253('0x4a')]);_0x5225ea[_0x1253('0x51')]=qs['filters'](_[_0x1253('0x6a')](_0x1cfc4c['query'],_0x4f2ac5['filters']));if(_0x1cfc4c[_0x1253('0x43')][_0x1253('0x4f')]){_0x5225ea['where']=_[_0x1253('0x4c')](_0x5225ea[_0x1253('0x51')],{'$or':_[_0x1253('0x42')](_0x5225ea['attributes'],function(_0x1d0f7d){var _0xd6aa96={};_0xd6aa96[_0x1d0f7d]={'$like':'%'+_0x1cfc4c['query'][_0x1253('0x4f')]+'%'};return _0xd6aa96;})});}_0x5225ea=_['merge']({},_0x5225ea,_0x1cfc4c['options']);return _0x16b314['getApplications'](_0x5225ea);}})[_0x1253('0x20')](function(_0x3222ca){if(_0x3222ca){_0x2114e1=_0x3222ca['length'];if(!_0x1cfc4c[_0x1253('0x43')][_0x1253('0x47')](_0x1253('0x48'))){_0x5225ea[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0x1cfc4c['query'][_0x1253('0x2e')]);_0x5225ea[_0x1253('0x2d')]=qs['offset'](_0x1cfc4c['query'][_0x1253('0x2d')]);}return _0x16b314[_0x1253('0x87')](_0x5225ea);}})[_0x1253('0x20')](function(_0x576a6b){if(_0x576a6b){return _0x576a6b?{'count':_0x2114e1,'rows':_0x576a6b}:null;}})[_0x1253('0x20')](respondWithResult(_0x111ac8,null))['catch'](handleError(_0x111ac8,null));};function Extension(_0x2a6c09,_0x3518e9,_0x24766e,_0x46a2f5){this['context']=_0x1253('0x88');this['exten']=_0x2a6c09[_0x1253('0x89')];this['app']=_0x46a2f5;this[_0x1253('0x4d')]=_0x1253('0x8a');this['description']=_0x1253('0x8b');this['FaxAccountId']=_0x2a6c09['id'];this['priority']=_0x3518e9;this['appdata']=_0x24766e;}function createExtensionsReciveFax(_0x5aaa65){var _0x2e6b5a=0x1;var _0x255553=[];_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,'','Answer'));_0x2e6b5a+=0x1;_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,_0x1253('0x8d'),_0x1253('0x8e')));_0x2e6b5a+=0x1;for(var _0x2ca94e in _0x5aaa65){if(_0x5aaa65['hasOwnProperty'](_0x2ca94e)&&(_0x2ca94e===_0x1253('0x8f')||_0x2ca94e===_0x1253('0x89')||_0x2ca94e===_0x1253('0x90')||_0x2ca94e===_0x1253('0x91')||_0x2ca94e===_0x1253('0x92')||_0x2ca94e===_0x1253('0x93')||_0x2ca94e===_0x1253('0x94')||_0x2ca94e===_0x1253('0x95')||_0x2ca94e==='t38timeout')){_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,_0x1253('0x96')+_0x2ca94e+')='+_0x5aaa65[_0x2ca94e],_0x1253('0x8e')));_0x2e6b5a+=0x1;}}_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,'6','Wait'));_0x2e6b5a+=0x1;_0x255553[_0x1253('0x8c')](new Extension(_0x5aaa65,_0x2e6b5a,_0x1253('0x97'),'ReceiveFax'));_0x2e6b5a=0x0;return _0x255553;}exports[_0x1253('0x98')]=function(_0x349b81,_0x8a4d26,_0x565570){var _0x13fc43;return db['sequelize'][_0x1253('0x7f')](function(_0x2c7385){return db[_0x1253('0x3e')][_0x1253('0x59')](_0x349b81['body'],{'transaction':_0x2c7385})[_0x1253('0x20')](function(_0x57831f){_0x13fc43=_0x57831f[_0x1253('0x35')]({'plain':!![]});return db['VoiceExtension'][_0x1253('0x99')](createExtensionsReciveFax(_0x13fc43),{'transaction':_0x2c7385});});})['then'](function(){return _0x13fc43;})[_0x1253('0x20')](respondWithResult(_0x8a4d26,null))[_0x1253('0x55')](handleError(_0x8a4d26,null));};exports[_0x1253('0x9a')]=function(_0x295843,_0x5f381e,_0xab9fc9){var _0x2ee218;return db['sequelize'][_0x1253('0x7f')](function(_0x3a89d4){return db['FaxAccount']['update'](_0x295843[_0x1253('0x63')],{'where':{'id':_0x295843[_0x1253('0x63')]['id']},'transaction':_0x3a89d4})[_0x1253('0x20')](function(_0x3428e1){return db[_0x1253('0x9b')][_0x1253('0x34')]({'where':{'FaxAccountId':_0x295843[_0x1253('0x63')]['id']},'transaction':_0x3a89d4})[_0x1253('0x20')](function(_0xd5d037){return db[_0x1253('0x9b')][_0x1253('0x99')](createExtensionsReciveFax(_[_0x1253('0x74')](_0x295843[_0x1253('0x63')],['tech','key',_0x1253('0x9c'),_0x1253('0x9d'),_0x1253('0x9e'),_0x1253('0x9f')])),{'transaction':_0x3a89d4});});});})[_0x1253('0x20')](function(){return db[_0x1253('0x3e')]['findById'](_0x295843['body']['id']);})[_0x1253('0x20')](respondWithResult(_0x5f381e,null))[_0x1253('0x55')](handleError(_0x5f381e,null));};exports[_0x1253('0xa0')]=function(_0x5e12b9,_0x36c643,_0x53b536){var _0x5737fd={'raw':!![],'where':{}};var _0x3905cb={};var _0x3adbe1={'count':0x0,'rows':[]};return db[_0x1253('0x3e')][_0x1253('0x67')]({'where':{'id':_0x5e12b9[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x36c643,null))[_0x1253('0x20')](function(_0xc627ca){if(_0xc627ca){_0x3905cb[_0x1253('0x41')]=_[_0x1253('0x57')](db['FaxMessage'][_0x1253('0x68')]);_0x3905cb['query']=_[_0x1253('0x57')](_0x5e12b9[_0x1253('0x43')]);_0x3905cb[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x3905cb[_0x1253('0x41')],_0x3905cb['query']);_0x5737fd[_0x1253('0x45')]=_['intersection'](_0x3905cb['model'],qs[_0x1253('0x46')](_0x5e12b9['query']['fields']));_0x5737fd[_0x1253('0x45')]=_0x5737fd[_0x1253('0x45')][_0x1253('0x69')]?_0x5737fd[_0x1253('0x45')]:_0x3905cb[_0x1253('0x41')];if(!_0x5e12b9[_0x1253('0x43')]['hasOwnProperty'](_0x1253('0x48'))){_0x5737fd[_0x1253('0x2e')]=qs[_0x1253('0x2e')](_0x5e12b9[_0x1253('0x43')][_0x1253('0x2e')]);_0x5737fd['offset']=qs['offset'](_0x5e12b9[_0x1253('0x43')][_0x1253('0x2d')]);}_0x5737fd[_0x1253('0x49')]=qs[_0x1253('0x4a')](_0x5e12b9[_0x1253('0x43')][_0x1253('0x4a')]);_0x5737fd[_0x1253('0x51')]=qs[_0x1253('0x4b')](_[_0x1253('0x6a')](_0x5e12b9[_0x1253('0x43')],_0x3905cb[_0x1253('0x4b')]));_0x5737fd[_0x1253('0x51')][_0x1253('0x6b')]=_0xc627ca['id'];if(_0x5e12b9[_0x1253('0x43')][_0x1253('0x4f')]){_0x5737fd[_0x1253('0x51')]=_[_0x1253('0x4c')](_0x5737fd[_0x1253('0x51')],{'$or':_[_0x1253('0x42')](_0x5737fd[_0x1253('0x45')],function(_0x3e2ccd){var _0x45e69d={};_0x45e69d[_0x3e2ccd]={'$like':'%'+_0x5e12b9[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x45e69d;})});}if(_0x5e12b9['query'][_0x1253('0xa1')]){var _0x3608ef=_0x5e12b9[_0x1253('0x43')][_0x1253('0xa1')][_0x1253('0xa2')](',');var _0x4079f1={};_0x4079f1[_0x3608ef[0x0]]={'$gte':moment(_0x3608ef[0x1])[_0x1253('0xa3')](_0x1253('0xa4'))};_0x5737fd[_0x1253('0x51')]=_['merge'](_0x5737fd[_0x1253('0x51')],_0x4079f1);}_0x5737fd=_[_0x1253('0x4c')]({},_0x5737fd,_0x5e12b9[_0x1253('0x50')]);return db[_0x1253('0xa5')][_0x1253('0x30')]({'where':_0x5737fd[_0x1253('0x51')]})['then'](function(_0x1cfbe0){_0x3adbe1[_0x1253('0x30')]=_0x1cfbe0;if(_0x5e12b9[_0x1253('0x43')][_0x1253('0x58')]){_0x5737fd[_0x1253('0x52')]=[{'all':!![]}];}return db[_0x1253('0xa5')][_0x1253('0x53')](_0x5737fd);})[_0x1253('0x20')](function(_0x18996f){_0x3adbe1[_0x1253('0x54')]=_0x18996f;return _0x3adbe1;});}})[_0x1253('0x20')](respondWithFilteredResult(_0x36c643,_0x5737fd))[_0x1253('0x55')](handleError(_0x36c643,null));};exports[_0x1253('0x3a')]=function(_0x465c34,_0xc9083d,_0x3bfacc){var _0x2bcad6,_0x26ecbc={},_0x10785f;if(_0x465c34[_0x1253('0x63')]['to']){_0x10785f=_0x465c34[_0x1253('0x63')]['to'][0x0];}return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x465c34[_0x1253('0x64')]['id']},'include':[{'model':db[_0x1253('0xa6')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x10785f},'limit':0x1,'order':[[_0x1253('0x9d'),_0x1253('0xa7')]]}]}]})['then'](handleEntityNotFound(_0xc9083d,null))[_0x1253('0x20')](function(_0x142142){_0x2bcad6=_0x142142;if(_0x465c34[_0x1253('0x63')]['attachments']&&_0x465c34['body']['attachments'][_0x1253('0x69')]){for(var _0x2f31a0=0x0;_0x2f31a0<_0x465c34['body'][_0x1253('0xa8')]['length'];_0x2f31a0+=0x1){_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][_0x2f31a0]={'filename':_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][_0x2f31a0][_0x1253('0x39')],'id':_0x465c34['body']['attachments'][_0x2f31a0]['id'],'path':path[_0x1253('0xa9')](config['root'],_0x1253('0xaa'),_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][_0x2f31a0][_0x1253('0xab')])};}}return respondWithRpcPromise(_0x1253('0xac'),_0x1253('0xac'),{'FaxAccountId':_[_0x1253('0xad')](_0x465c34[_0x1253('0x64')]['id'])?undefined:_0x465c34[_0x1253('0x64')]['id'],'path':_[_0x1253('0xad')](_0x465c34[_0x1253('0x63')]['attachments'][0x0][_0x1253('0xae')])?undefined:_0x465c34['body'][_0x1253('0xa8')][0x0][_0x1253('0xae')],'fax':_['isNil'](_0x465c34[_0x1253('0x63')]['to'][0x0])?undefined:_0x465c34[_0x1253('0x63')]['to'][0x0]},client9002);})[_0x1253('0x20')](function(){if(_0x2bcad6){if(_[_0x1253('0xad')](_0x465c34[_0x1253('0x63')][_0x1253('0xaf')])){_0x465c34['body']['from']=util[_0x1253('0xa3')]('\x22%s\x22\x20<%s>',_0x2bcad6['name'],_0x2bcad6[_0x1253('0xb0')]);}if(_0x2bcad6[_0x1253('0xb1')]){if(_0x2bcad6[_0x1253('0xb1')][_0x1253('0xb2')][_0x1253('0x69')]){return _0x2bcad6[_0x1253('0xb1')][_0x1253('0xb2')][0x0];}else{return db[_0x1253('0x76')][_0x1253('0x59')](_[_0x1253('0x19')](_0x465c34[_0x1253('0x63')],{'firstName':_0x465c34[_0x1253('0x63')]['to'][0x0],'phone':_0x465c34[_0x1253('0x63')]['to'][0x0],'fax':_0x465c34['body']['to'][0x0],'ListId':_0x2bcad6[_0x1253('0x9f')]}));}}else{throw new Error(_0x1253('0xb3'));}}else{throw new Error(_0x1253('0xb4'));}})[_0x1253('0x20')](function(_0x145656){if(_0x145656){return db[_0x1253('0x73')]['find']({'where':{'ContactId':_0x145656['id'],'closed':![],'FaxAccountId':_0x2bcad6['id']}})[_0x1253('0x20')](function(_0x4f0791){if(_0x4f0791){return[_0x4f0791,![]];}return db[_0x1253('0x73')]['create']({'UserId':_0x465c34[_0x1253('0x5c')]['id'],'ContactId':_0x145656['id'],'FaxAccountId':_0x2bcad6['id'],'fax':_0x465c34[_0x1253('0x63')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x1253('0x4c')](_0x465c34[_0x1253('0x63')],{'read':![],'body':_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][0x0][_0x1253('0xb5')],'FaxAccountId':_0x2bcad6['id'],'UserId':_0x465c34[_0x1253('0x5c')]['id'],'ContactId':_0x145656['id'],'AttachmentId':_0x465c34['body'][_0x1253('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x1253('0xa5')],'as':_0x1253('0xb6')}]})[_0x1253('0x20')](function(_0x384244){return[_0x384244,!![]];});});}else{throw new Error(_0x1253('0xb7'));}})['spread'](function(_0x502381,_0x5695ac){if(_0x5695ac){return _0x502381;}return db[_0x1253('0xa5')][_0x1253('0x59')]({'direction':_0x1253('0xb8'),'read':![],'body':_0x465c34[_0x1253('0x63')]['attachments'][0x0]['filename'],'FaxAccountId':_0x2bcad6['id'],'FaxInteractionId':_0x502381['id'],'UserId':_0x465c34[_0x1253('0x5c')]['id'],'ContactId':_0x502381['ContactId'],'AttachmentId':_0x465c34['body'][_0x1253('0xa8')][0x0]['id']})[_0x1253('0x20')](function(_0x11099d){_0x502381[_0x1253('0xb9')][_0x1253('0xb6')]=[];_0x502381[_0x1253('0xb9')][_0x1253('0xb6')][_0x1253('0x8c')](_0x11099d[_0x1253('0xb9')]);return _0x502381;});})[_0x1253('0x20')](function(_0x2de371){respondWithRpcPromise(_0x1253('0xba'),_0x1253('0xba'),{'FaxAccountId':_[_0x1253('0xad')](_0x465c34['params']['id'])?undefined:_0x465c34['params']['id'],'path':_[_0x1253('0xad')](_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][0x0][_0x1253('0xae')])?undefined:_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][0x0][_0x1253('0xae')],'fax':_[_0x1253('0xad')](_0x465c34[_0x1253('0x63')]['to'][0x0])?undefined:_0x465c34[_0x1253('0x63')]['to'][0x0],'AttachmentId':_0x465c34[_0x1253('0x63')][_0x1253('0xa8')][0x0]['id']},client9002)['then'](function(_0x49c151){logger[_0x1253('0x21')](_0x1253('0xbb'),_0x49c151);})['catch'](function(_0x57b67b){logger['info'](_0x1253('0xbb'),_0x57b67b);});return _0x2de371;})['then'](respondWithResult(_0xc9083d,null))[_0x1253('0x55')](handleError(_0xc9083d,null));};exports[_0x1253('0xbc')]=function(_0x4d4fe9,_0x33df3b,_0x5ccb81){return db[_0x1253('0x3e')][_0x1253('0x5e')]({'where':{'id':_0x4d4fe9[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x33df3b,null))[_0x1253('0x20')](function(_0x934a4e){if(_0x934a4e){return _0x934a4e['addAgents'](_0x4d4fe9[_0x1253('0x63')][_0x1253('0x6e')],_[_0x1253('0x74')](_0x4d4fe9['body'],[_0x1253('0x6e'),'id'])||{})['spread'](function(_0x31df9b){for(var _0xdaf3d=0x0;_0xdaf3d<_0x4d4fe9[_0x1253('0x63')][_0x1253('0x6e')][_0x1253('0x69')];_0xdaf3d+=0x1){socket['emit'](_0x1253('0xbd'),{'UserId':Number(_0x4d4fe9[_0x1253('0x63')][_0x1253('0x6e')][_0xdaf3d]),'FaxAccountId':Number(_0x4d4fe9[_0x1253('0x64')]['id'])});}return _0x31df9b;});}})[_0x1253('0x20')](respondWithResult(_0x33df3b,null))[_0x1253('0x55')](handleError(_0x33df3b,null));};exports[_0x1253('0xbe')]=function(_0x19e132,_0x12ced5,_0x50de58){return db[_0x1253('0x3e')]['find']({'where':{'id':_0x19e132[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x12ced5,null))[_0x1253('0x20')](function(_0x5b3a1e){if(_0x5b3a1e){return _0x5b3a1e[_0x1253('0xbe')](_0x19e132[_0x1253('0x43')]['ids'])[_0x1253('0x20')](function(){if(_[_0x1253('0xbf')](_0x19e132[_0x1253('0x43')][_0x1253('0x6e')])){for(var _0xf4c2f6=0x0;_0xf4c2f6<_0x19e132[_0x1253('0x43')][_0x1253('0x6e')][_0x1253('0x69')];_0xf4c2f6+=0x1){socket[_0x1253('0xc0')](_0x1253('0xc1'),{'UserId':Number(_0x19e132[_0x1253('0x43')][_0x1253('0x6e')][_0xf4c2f6]),'FaxAccountId':Number(_0x19e132[_0x1253('0x64')]['id'])});}}else{socket['emit'](_0x1253('0xc1'),{'UserId':Number(_0x19e132[_0x1253('0x43')][_0x1253('0x6e')]),'FaxAccountId':Number(_0x19e132['params']['id'])});}});}})[_0x1253('0x20')](respondWithStatusCode(_0x12ced5,null))[_0x1253('0x55')](handleError(_0x12ced5,null));};exports[_0x1253('0xc2')]=function(_0x34ccd5,_0x45fbdb,_0x2c53de){var _0x4f566d={};var _0x54476d={};var _0xa0a452;var _0x241013;return db['FaxAccount'][_0x1253('0x67')]({'where':{'id':_0x34ccd5[_0x1253('0x64')]['id']}})[_0x1253('0x20')](handleEntityNotFound(_0x45fbdb,null))[_0x1253('0x20')](function(_0x5ab4ab){if(_0x5ab4ab){_0xa0a452=_0x5ab4ab;_0x54476d[_0x1253('0x41')]=_[_0x1253('0x57')](db['User'][_0x1253('0x68')]);_0x54476d[_0x1253('0x43')]=_[_0x1253('0x57')](_0x34ccd5[_0x1253('0x43')]);_0x54476d[_0x1253('0x4b')]=_[_0x1253('0x44')](_0x54476d['model'],_0x54476d[_0x1253('0x43')]);_0x4f566d[_0x1253('0x45')]=_['intersection'](_0x54476d[_0x1253('0x41')],qs[_0x1253('0x46')](_0x34ccd5[_0x1253('0x43')][_0x1253('0x46')]));_0x4f566d[_0x1253('0x45')]=_0x4f566d['attributes']['length']?_0x4f566d[_0x1253('0x45')]:_0x54476d[_0x1253('0x41')];_0x4f566d['order']=qs[_0x1253('0x4a')](_0x34ccd5[_0x1253('0x43')][_0x1253('0x4a')]);_0x4f566d[_0x1253('0x51')]=qs[_0x1253('0x4b')](_[_0x1253('0x6a')](_0x34ccd5[_0x1253('0x43')],_0x54476d[_0x1253('0x4b')]));if(_0x34ccd5[_0x1253('0x43')][_0x1253('0x4f')]){_0x4f566d[_0x1253('0x51')]=_[_0x1253('0x4c')](_0x4f566d['where'],{'$or':_[_0x1253('0x42')](_0x4f566d['attributes'],function(_0x5d0973){var _0x14d0bc={};_0x14d0bc[_0x5d0973]={'$like':'%'+_0x34ccd5[_0x1253('0x43')][_0x1253('0x4f')]+'%'};return _0x14d0bc;})});}_0x4f566d=_[_0x1253('0x4c')]({},_0x4f566d,_0x34ccd5[_0x1253('0x50')]);return _0xa0a452[_0x1253('0xc2')](_0x4f566d);}})[_0x1253('0x20')](function(_0xca589b){if(_0xca589b){_0x241013=_0xca589b['length'];if(!_0x34ccd5[_0x1253('0x43')][_0x1253('0x47')]('nolimit')){_0x4f566d['limit']=qs[_0x1253('0x2e')](_0x34ccd5[_0x1253('0x43')][_0x1253('0x2e')]);_0x4f566d[_0x1253('0x2d')]=qs[_0x1253('0x2d')](_0x34ccd5['query'][_0x1253('0x2d')]);}return _0xa0a452[_0x1253('0xc2')](_0x4f566d);}})[_0x1253('0x20')](function(_0x551093){if(_0x551093){return _0x551093?{'count':_0x241013,'rows':_0x551093}:null;}})[_0x1253('0x20')](respondWithResult(_0x45fbdb,null))[_0x1253('0x55')](handleError(_0x45fbdb,null));}; \ No newline at end of file +var _0xba20=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','FaxAccount','includeAll','include','findAll','show','params','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','rows','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','Owner','Tag','color','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','priority','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','key','createdAt','ListId','getMessages','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','user','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxAccount.socket','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','model','map','query','keys'];(function(_0x3233c3,_0x15e5fa){var _0x36029b=function(_0xe3dd12){while(--_0xe3dd12){_0x3233c3['push'](_0x3233c3['shift']());}};_0x36029b(++_0x15e5fa);}(_0xba20,0x14d));var _0x0ba2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba20[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0ba2('0x0'));var rimraf=require(_0x0ba2('0x1'));var zipdir=require(_0x0ba2('0x2'));var jsonpatch=require(_0x0ba2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0ba2('0x4'));var Mustache=require(_0x0ba2('0x5'));var util=require(_0x0ba2('0x6'));var path=require('path');var sox=require(_0x0ba2('0x7'));var csv=require(_0x0ba2('0x8'));var ejs=require(_0x0ba2('0x9'));var fs=require('fs');var fs_extra=require(_0x0ba2('0xa'));var _=require(_0x0ba2('0xb'));var squel=require(_0x0ba2('0xc'));var crypto=require('crypto');var jsforce=require(_0x0ba2('0xd'));var deskjs=require(_0x0ba2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ba2('0xf'));var Redis=require(_0x0ba2('0x10'));var authService=require(_0x0ba2('0x11'));var qs=require(_0x0ba2('0x12'));var as=require(_0x0ba2('0x13'));var hardwareService=require(_0x0ba2('0x14'));var logger=require(_0x0ba2('0x15'))(_0x0ba2('0x16'));var utils=require('../../config/utils');var config=require(_0x0ba2('0x17'));var licenseUtil=require(_0x0ba2('0x18'));var db=require(_0x0ba2('0x19'))['db'];config[_0x0ba2('0x1a')]=_['defaults'](config[_0x0ba2('0x1a')],{'host':_0x0ba2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ba2('0x1a')]));require(_0x0ba2('0x1c'))['register'](socket);var jayson=require(_0x0ba2('0x1d'));var client=jayson[_0x0ba2('0x1e')][_0x0ba2('0x1f')]({'port':0x232c});var client9002=jayson[_0x0ba2('0x1e')][_0x0ba2('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1b4c31,_0xbb4ea1,_0x387eb9,_0x5306cf){return new BPromise(function(_0xece074,_0x228ec4){var _0x448075=_0x5306cf||client;return _0x448075['request'](_0x1b4c31,_0x387eb9)['then'](function(_0x5b716b){logger[_0x0ba2('0x20')](_0x0ba2('0x21'),_0xbb4ea1,'request\x20sent');logger[_0x0ba2('0x22')](_0x0ba2('0x23'),_0xbb4ea1,_0x0ba2('0x24'),JSON['stringify'](_0x5b716b));if(_0x5b716b[_0x0ba2('0x25')]){if(_0x5b716b['error'][_0x0ba2('0x26')]===0x1f4){logger[_0x0ba2('0x25')](_0x0ba2('0x21'),_0xbb4ea1,_0x5b716b[_0x0ba2('0x25')][_0x0ba2('0x27')]);return _0x228ec4(_0x5b716b[_0x0ba2('0x25')]['message']);}logger['error'](_0x0ba2('0x21'),_0xbb4ea1,_0x5b716b['error']['message']);return _0xece074(_0x5b716b[_0x0ba2('0x25')][_0x0ba2('0x27')]);}else{logger[_0x0ba2('0x20')](_0x0ba2('0x21'),_0xbb4ea1,_0x0ba2('0x24'));_0xece074(_0x5b716b['result']['message']);}})['catch'](function(_0x4e0b8c){logger[_0x0ba2('0x25')](_0x0ba2('0x21'),_0xbb4ea1,_0x4e0b8c);_0x228ec4(_0x4e0b8c);});});}function respondWithStatusCode(_0x579360,_0x3998f1){_0x3998f1=_0x3998f1||0xcc;return function(_0x223463){if(_0x223463){return _0x579360[_0x0ba2('0x28')](_0x3998f1);}return _0x579360[_0x0ba2('0x29')](_0x3998f1)[_0x0ba2('0x2a')]();};}function respondWithResult(_0x532b10,_0x3cf2c3){_0x3cf2c3=_0x3cf2c3||0xc8;return function(_0x441986){if(_0x441986){return _0x532b10[_0x0ba2('0x29')](_0x3cf2c3)['json'](_0x441986);}};}function respondWithFilteredResult(_0x20bd41,_0x2d672e){return function(_0x2ffeb1){if(_0x2ffeb1){var _0x56f611=typeof _0x2d672e[_0x0ba2('0x2b')]===_0x0ba2('0x2c')&&typeof _0x2d672e['limit']===_0x0ba2('0x2c');var _0xade362=_0x2ffeb1[_0x0ba2('0x2d')];var _0x4c271e=_0x56f611?0x0:_0x2d672e[_0x0ba2('0x2b')];var _0x394366=_0x56f611?_0x2ffeb1[_0x0ba2('0x2d')]:_0x2d672e[_0x0ba2('0x2b')]+_0x2d672e[_0x0ba2('0x2e')];var _0x220696;if(_0x394366>=_0xade362){_0x394366=_0xade362;_0x220696=0xc8;}else{_0x220696=0xce;}_0x20bd41[_0x0ba2('0x29')](_0x220696);return _0x20bd41[_0x0ba2('0x2f')](_0x0ba2('0x30'),_0x4c271e+'-'+_0x394366+'/'+_0xade362)[_0x0ba2('0x31')](_0x2ffeb1);}return null;};}function patchUpdates(_0xcbd3dd){return function(_0x21c5b6){try{jsonpatch['apply'](_0x21c5b6,_0xcbd3dd,!![]);}catch(_0xcbe960){return BPromise[_0x0ba2('0x32')](_0xcbe960);}return _0x21c5b6[_0x0ba2('0x33')]();};}function saveUpdates(_0x5a3c77,_0x4e1f80){return function(_0xab1c69){if(_0xab1c69){return _0xab1c69[_0x0ba2('0x34')](_0x5a3c77)['then'](function(_0x46edca){return _0x46edca;});}return null;};}function removeEntity(_0x542680,_0xdd06fb){return function(_0x2e90f8){if(_0x2e90f8){return _0x2e90f8[_0x0ba2('0x35')]()['then'](function(){var _0x2bc096=_0x2e90f8[_0x0ba2('0x36')]({'plain':!![]});var _0x596810='FaxAccounts';return db[_0x0ba2('0x37')][_0x0ba2('0x35')]({'where':{'type':_0x596810,'resourceId':_0x2bc096['id']}})[_0x0ba2('0x38')](function(){return _0x2e90f8;});})[_0x0ba2('0x38')](function(){_0x542680[_0x0ba2('0x29')](0xcc)[_0x0ba2('0x2a')]();});}};}function handleEntityNotFound(_0x15b810,_0x5e7eaf){return function(_0x393b48){if(!_0x393b48){_0x15b810[_0x0ba2('0x28')](0x194);}return _0x393b48;};}function handleError(_0x50966a,_0x51f05f){_0x51f05f=_0x51f05f||0x1f4;return function(_0x462624){logger[_0x0ba2('0x25')](_0x462624[_0x0ba2('0x39')]);if(_0x462624[_0x0ba2('0x3a')]){delete _0x462624[_0x0ba2('0x3a')];}_0x50966a[_0x0ba2('0x29')](_0x51f05f)[_0x0ba2('0x3b')](_0x462624);};}exports[_0x0ba2('0x3c')]=function(_0x41daaf,_0x36f050){var _0x2cf644={'include':[{'model':db[_0x0ba2('0x3d')],'as':_0x0ba2('0x3e')}]},_0x1fd845={},_0x50700d={'count':0x0,'rows':[]};var _0xd2bc33=_['map'](db['FaxAccount'][_0x0ba2('0x3f')],function(_0x35d180){return{'name':_0x35d180[_0x0ba2('0x40')],'type':_0x35d180['type']['key']};});_0x1fd845[_0x0ba2('0x41')]=_[_0x0ba2('0x42')](_0xd2bc33,'name');_0x1fd845[_0x0ba2('0x43')]=_[_0x0ba2('0x44')](_0x41daaf[_0x0ba2('0x43')]);_0x1fd845[_0x0ba2('0x45')]=_[_0x0ba2('0x46')](_0x1fd845[_0x0ba2('0x41')],_0x1fd845[_0x0ba2('0x43')]);_0x2cf644[_0x0ba2('0x47')]=_[_0x0ba2('0x46')](_0x1fd845['model'],qs[_0x0ba2('0x48')](_0x41daaf['query'][_0x0ba2('0x48')]));_0x2cf644['attributes']=_0x2cf644[_0x0ba2('0x47')]['length']?_0x2cf644[_0x0ba2('0x47')]:_0x1fd845[_0x0ba2('0x41')];if(!_0x41daaf[_0x0ba2('0x43')][_0x0ba2('0x49')](_0x0ba2('0x4a'))){_0x2cf644[_0x0ba2('0x2e')]=qs[_0x0ba2('0x2e')](_0x41daaf['query']['limit']);_0x2cf644['offset']=qs[_0x0ba2('0x2b')](_0x41daaf[_0x0ba2('0x43')][_0x0ba2('0x2b')]);}_0x2cf644['order']=qs[_0x0ba2('0x4b')](_0x41daaf[_0x0ba2('0x43')]['sort']);_0x2cf644[_0x0ba2('0x4c')]=qs[_0x0ba2('0x45')](_[_0x0ba2('0x4d')](_0x41daaf[_0x0ba2('0x43')],_0x1fd845['filters']),_0xd2bc33);if(_0x41daaf['query'][_0x0ba2('0x4e')]){_0x2cf644[_0x0ba2('0x4c')]=_[_0x0ba2('0x4f')](_0x2cf644[_0x0ba2('0x4c')],{'$or':_[_0x0ba2('0x42')](_0xd2bc33,function(_0x453e19){if(_0x453e19[_0x0ba2('0x50')]!=='VIRTUAL'){var _0x2b6e93={};_0x2b6e93[_0x453e19[_0x0ba2('0x3a')]]={'$like':'%'+_0x41daaf['query'][_0x0ba2('0x4e')]+'%'};return _0x2b6e93;}})});}_0x2cf644=_[_0x0ba2('0x4f')]({},_0x2cf644,_0x41daaf['options']);var _0x75f5bb={'where':_0x2cf644[_0x0ba2('0x4c')]};return db[_0x0ba2('0x51')][_0x0ba2('0x2d')](_0x75f5bb)['then'](function(_0x6e1934){_0x50700d[_0x0ba2('0x2d')]=_0x6e1934;if(_0x41daaf[_0x0ba2('0x43')][_0x0ba2('0x52')]){_0x2cf644[_0x0ba2('0x53')]=[{'all':!![]}];}return db[_0x0ba2('0x51')][_0x0ba2('0x54')](_0x2cf644);})['then'](function(_0x137d78){_0x50700d['rows']=_0x137d78;return _0x50700d;})[_0x0ba2('0x38')](respondWithFilteredResult(_0x36f050,_0x2cf644))['catch'](handleError(_0x36f050,null));};exports[_0x0ba2('0x55')]=function(_0x522688,_0x360dcb){var _0x3d1966={'raw':![],'where':{'id':_0x522688[_0x0ba2('0x56')]['id']},'include':[{'model':db[_0x0ba2('0x3d')],'as':'mandatoryDispositionPause'}]},_0x2e3d1a={};_0x2e3d1a[_0x0ba2('0x41')]=_[_0x0ba2('0x44')](db[_0x0ba2('0x51')][_0x0ba2('0x3f')]);_0x2e3d1a[_0x0ba2('0x43')]=_[_0x0ba2('0x44')](_0x522688[_0x0ba2('0x43')]);_0x2e3d1a[_0x0ba2('0x45')]=_['intersection'](_0x2e3d1a['model'],_0x2e3d1a[_0x0ba2('0x43')]);_0x3d1966['attributes']=_[_0x0ba2('0x46')](_0x2e3d1a[_0x0ba2('0x41')],qs[_0x0ba2('0x48')](_0x522688[_0x0ba2('0x43')][_0x0ba2('0x48')]));_0x3d1966['attributes']=_0x3d1966['attributes'][_0x0ba2('0x57')]?_0x3d1966['attributes']:_0x2e3d1a['model'];if(_0x522688[_0x0ba2('0x43')]['includeAll']){_0x3d1966[_0x0ba2('0x53')]=[{'all':!![]}];}_0x3d1966=_[_0x0ba2('0x4f')]({},_0x3d1966,_0x522688['options']);return db[_0x0ba2('0x51')]['find'](_0x3d1966)['then'](handleEntityNotFound(_0x360dcb,null))['then'](respondWithResult(_0x360dcb,null))['catch'](handleError(_0x360dcb,null));};exports[_0x0ba2('0x58')]=function(_0x2d73d4,_0x44913b){return db[_0x0ba2('0x51')][_0x0ba2('0x58')](_0x2d73d4[_0x0ba2('0x59')],{})[_0x0ba2('0x38')](function(_0x1867c9){var _0x2da214=_0x2d73d4['user']['get']({'plain':!![]});if(!_0x2da214)throw new Error(_0x0ba2('0x5a'));if(_0x2da214[_0x0ba2('0x5b')]==='user'){var _0x175d42=_0x1867c9[_0x0ba2('0x36')]({'plain':!![]});var _0x5d1c14='FaxAccounts';return db[_0x0ba2('0x5c')][_0x0ba2('0x5d')]({'where':{'name':_0x5d1c14,'userProfileId':_0x2da214[_0x0ba2('0x5e')]},'raw':!![]})[_0x0ba2('0x38')](function(_0x1a17d6){if(_0x1a17d6&&_0x1a17d6[_0x0ba2('0x5f')]===0x0){return db[_0x0ba2('0x37')][_0x0ba2('0x58')]({'name':_0x175d42['name'],'resourceId':_0x175d42['id'],'type':_0x1a17d6[_0x0ba2('0x3a')],'sectionId':_0x1a17d6['id']},{})[_0x0ba2('0x38')](function(){return _0x1867c9;});}else{return _0x1867c9;}})[_0x0ba2('0x60')](function(_0x2b516d){logger[_0x0ba2('0x25')](_0x0ba2('0x61'),_0x2b516d);throw _0x2b516d;});}return _0x1867c9;})[_0x0ba2('0x38')](respondWithResult(_0x44913b,0xc9))[_0x0ba2('0x60')](handleError(_0x44913b,null));};exports[_0x0ba2('0x34')]=function(_0x18e271,_0x4590c5){if(_0x18e271[_0x0ba2('0x59')]['id']){delete _0x18e271[_0x0ba2('0x59')]['id'];}return db[_0x0ba2('0x51')]['find']({'where':{'id':_0x18e271['params']['id']},'include':[{'model':db[_0x0ba2('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x0ba2('0x38')](handleEntityNotFound(_0x4590c5,null))[_0x0ba2('0x38')](saveUpdates(_0x18e271[_0x0ba2('0x59')],null))[_0x0ba2('0x38')](respondWithResult(_0x4590c5,null))[_0x0ba2('0x60')](handleError(_0x4590c5,null));};exports['destroy']=function(_0x493afb,_0x3c1272){return db[_0x0ba2('0x51')][_0x0ba2('0x5d')]({'where':{'id':_0x493afb['params']['id']}})['then'](handleEntityNotFound(_0x3c1272,null))['then'](removeEntity(_0x3c1272,null))[_0x0ba2('0x60')](handleError(_0x3c1272,null));};exports[_0x0ba2('0x62')]=function(_0x9ae7b2,_0x49b066){return db[_0x0ba2('0x51')][_0x0ba2('0x62')]()[_0x0ba2('0x38')](respondWithResult(_0x49b066,null))['catch'](handleError(_0x49b066,null));};exports[_0x0ba2('0x63')]=function(_0x58e531,_0x2558ef,_0x462dba){if(_0x58e531[_0x0ba2('0x59')]['id']){delete _0x58e531[_0x0ba2('0x59')]['id'];}return db[_0x0ba2('0x51')]['find']({'where':{'id':_0x58e531[_0x0ba2('0x56')]['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x2558ef,null))[_0x0ba2('0x38')](function(_0x760c43){if(_0x760c43){_0x58e531['body'][_0x0ba2('0x64')]=_0x760c43['id'];return db[_0x0ba2('0x65')][_0x0ba2('0x58')](_0x58e531[_0x0ba2('0x59')]);}})['then'](respondWithResult(_0x2558ef,null))['catch'](handleError(_0x2558ef,null));};exports[_0x0ba2('0x66')]=function(_0x9fe40c,_0x42b79a,_0x2202ee){var _0x13eb1e={'raw':![],'where':{}};var _0x3041a8={};var _0x2d0030={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0ba2('0x67')]({'where':{'id':_0x9fe40c['params']['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x42b79a,null))['then'](function(_0x4d433e){if(_0x4d433e){_0x3041a8[_0x0ba2('0x41')]=_['keys'](db[_0x0ba2('0x65')][_0x0ba2('0x3f')]);_0x3041a8['query']=_[_0x0ba2('0x44')](_0x9fe40c[_0x0ba2('0x43')]);_0x3041a8['filters']=_[_0x0ba2('0x46')](_0x3041a8[_0x0ba2('0x41')],_0x3041a8['query']);_0x13eb1e[_0x0ba2('0x47')]=_[_0x0ba2('0x46')](_0x3041a8[_0x0ba2('0x41')],qs['fields'](_0x9fe40c['query'][_0x0ba2('0x48')]));_0x13eb1e[_0x0ba2('0x47')]=_0x13eb1e['attributes']['length']?_0x13eb1e[_0x0ba2('0x47')]:_0x3041a8['model'];if(!_0x9fe40c[_0x0ba2('0x43')]['hasOwnProperty']('nolimit')){_0x13eb1e[_0x0ba2('0x2e')]=qs['limit'](_0x9fe40c[_0x0ba2('0x43')]['limit']);_0x13eb1e['offset']=qs[_0x0ba2('0x2b')](_0x9fe40c[_0x0ba2('0x43')][_0x0ba2('0x2b')]);}_0x13eb1e['order']=qs[_0x0ba2('0x4b')](_0x9fe40c['query'][_0x0ba2('0x4b')]);_0x13eb1e[_0x0ba2('0x4c')]=qs[_0x0ba2('0x45')](_[_0x0ba2('0x4d')](_0x9fe40c['query'],_0x3041a8[_0x0ba2('0x45')]));_0x13eb1e['where'][_0x0ba2('0x64')]=_0x4d433e['id'];if(_0x9fe40c[_0x0ba2('0x43')][_0x0ba2('0x4e')]){_0x13eb1e['where']=_[_0x0ba2('0x4f')](_0x13eb1e[_0x0ba2('0x4c')],{'$or':_[_0x0ba2('0x42')](_0x13eb1e[_0x0ba2('0x47')],function(_0x4875b0){var _0x304d62={};_0x304d62[_0x4875b0]={'$like':'%'+_0x9fe40c[_0x0ba2('0x43')][_0x0ba2('0x4e')]+'%'};return _0x304d62;})});}_0x13eb1e=_[_0x0ba2('0x4f')]({},_0x13eb1e,_0x9fe40c[_0x0ba2('0x68')]);return db[_0x0ba2('0x65')][_0x0ba2('0x2d')]({'where':_0x13eb1e[_0x0ba2('0x4c')]})[_0x0ba2('0x38')](function(_0x13ec01){_0x2d0030[_0x0ba2('0x2d')]=_0x13ec01;if(_0x9fe40c['query'][_0x0ba2('0x52')]){_0x13eb1e[_0x0ba2('0x53')]=[{'all':!![]}];}return db[_0x0ba2('0x65')][_0x0ba2('0x54')](_0x13eb1e);})[_0x0ba2('0x38')](function(_0x664bfe){_0x2d0030['rows']=_0x664bfe;return _0x2d0030;});}})[_0x0ba2('0x38')](respondWithFilteredResult(_0x42b79a,_0x13eb1e))[_0x0ba2('0x60')](handleError(_0x42b79a,null));};exports[_0x0ba2('0x69')]=function(_0x1e78e7,_0x298c26,_0x30d87c){return db[_0x0ba2('0x51')][_0x0ba2('0x5d')]({'where':{'id':_0x1e78e7[_0x0ba2('0x56')]['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x298c26,null))[_0x0ba2('0x38')](function(_0x96b318){if(_0x96b318){return _0x96b318[_0x0ba2('0x69')](_0x1e78e7[_0x0ba2('0x43')][_0x0ba2('0x6a')]);}})[_0x0ba2('0x38')](respondWithStatusCode(_0x298c26,null))['catch'](handleError(_0x298c26,null));};exports[_0x0ba2('0x6b')]=function(_0x345448,_0x82fbd8,_0x1e167d){if(_0x345448['body']['id']){delete _0x345448[_0x0ba2('0x59')]['id'];}return db[_0x0ba2('0x51')][_0x0ba2('0x5d')]({'where':{'id':_0x345448[_0x0ba2('0x56')]['id']}})['then'](handleEntityNotFound(_0x82fbd8,null))[_0x0ba2('0x38')](function(_0x15166c){if(_0x15166c){_0x345448[_0x0ba2('0x59')][_0x0ba2('0x64')]=_0x15166c['id'];return db[_0x0ba2('0x6c')][_0x0ba2('0x58')](_0x345448['body']);}})[_0x0ba2('0x38')](respondWithResult(_0x82fbd8,null))[_0x0ba2('0x60')](handleError(_0x82fbd8,null));};exports[_0x0ba2('0x6d')]=function(_0x57712b,_0x3c0c8c,_0x509dc6){var _0x3f33d3={'raw':![],'where':{}};var _0x51e612={};var _0x4bacd0={'count':0x0,'rows':[]};return db[_0x0ba2('0x51')][_0x0ba2('0x67')]({'where':{'id':_0x57712b['params']['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x3c0c8c,null))[_0x0ba2('0x38')](function(_0x141a3a){if(_0x141a3a){_0x51e612['model']=_[_0x0ba2('0x44')](db['CannedAnswer'][_0x0ba2('0x3f')]);_0x51e612[_0x0ba2('0x43')]=_[_0x0ba2('0x44')](_0x57712b['query']);_0x51e612['filters']=_[_0x0ba2('0x46')](_0x51e612[_0x0ba2('0x41')],_0x51e612[_0x0ba2('0x43')]);_0x3f33d3[_0x0ba2('0x47')]=_['intersection'](_0x51e612['model'],qs['fields'](_0x57712b[_0x0ba2('0x43')]['fields']));_0x3f33d3[_0x0ba2('0x47')]=_0x3f33d3[_0x0ba2('0x47')]['length']?_0x3f33d3['attributes']:_0x51e612['model'];if(!_0x57712b[_0x0ba2('0x43')][_0x0ba2('0x49')](_0x0ba2('0x4a'))){_0x3f33d3[_0x0ba2('0x2e')]=qs[_0x0ba2('0x2e')](_0x57712b['query'][_0x0ba2('0x2e')]);_0x3f33d3[_0x0ba2('0x2b')]=qs[_0x0ba2('0x2b')](_0x57712b[_0x0ba2('0x43')][_0x0ba2('0x2b')]);}_0x3f33d3[_0x0ba2('0x6e')]=qs[_0x0ba2('0x4b')](_0x57712b['query'][_0x0ba2('0x4b')]);_0x3f33d3[_0x0ba2('0x4c')]=qs[_0x0ba2('0x45')](_['pick'](_0x57712b[_0x0ba2('0x43')],_0x51e612[_0x0ba2('0x45')]));_0x3f33d3['where']['FaxAccountId']=_0x141a3a['id'];if(_0x57712b[_0x0ba2('0x43')]['filter']){_0x3f33d3[_0x0ba2('0x4c')]=_[_0x0ba2('0x4f')](_0x3f33d3[_0x0ba2('0x4c')],{'$or':_[_0x0ba2('0x42')](_0x3f33d3[_0x0ba2('0x47')],function(_0x4a894b){var _0x33958f={};_0x33958f[_0x4a894b]={'$like':'%'+_0x57712b[_0x0ba2('0x43')]['filter']+'%'};return _0x33958f;})});}_0x3f33d3=_[_0x0ba2('0x4f')]({},_0x3f33d3,_0x57712b[_0x0ba2('0x68')]);return db[_0x0ba2('0x6c')][_0x0ba2('0x2d')]({'where':_0x3f33d3[_0x0ba2('0x4c')]})[_0x0ba2('0x38')](function(_0x5983ea){_0x4bacd0[_0x0ba2('0x2d')]=_0x5983ea;if(_0x57712b[_0x0ba2('0x43')]['includeAll']){_0x3f33d3[_0x0ba2('0x53')]=[{'all':!![]}];}return db[_0x0ba2('0x6c')][_0x0ba2('0x54')](_0x3f33d3);})[_0x0ba2('0x38')](function(_0x4f4716){_0x4bacd0[_0x0ba2('0x6f')]=_0x4f4716;return _0x4bacd0;});}})[_0x0ba2('0x38')](respondWithFilteredResult(_0x3c0c8c,_0x3f33d3))['catch'](handleError(_0x3c0c8c,null));};exports[_0x0ba2('0x70')]=function(_0x1fe03a,_0x29ce3d,_0x220e4d){return db['FaxAccount']['find']({'where':{'id':_0x1fe03a[_0x0ba2('0x56')]['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x29ce3d,null))[_0x0ba2('0x38')](function(_0x36ce22){if(_0x36ce22){return _0x36ce22[_0x0ba2('0x70')](_0x1fe03a[_0x0ba2('0x43')][_0x0ba2('0x6a')]);}})['then'](respondWithStatusCode(_0x29ce3d,null))['catch'](handleError(_0x29ce3d,null));};exports[_0x0ba2('0x71')]=function(_0x959ea1,_0x2c532a,_0x341480){return db['FaxInteraction'][_0x0ba2('0x5d')]({'where':{'id':_0x959ea1['params']['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x2c532a,null))['then'](function(_0x513128){if(_0x513128){return _0x513128[_0x0ba2('0x71')](_0x959ea1[_0x0ba2('0x59')][_0x0ba2('0x6a')],_[_0x0ba2('0x72')](_0x959ea1[_0x0ba2('0x59')],['ids','id'])||{});}})[_0x0ba2('0x38')](respondWithResult(_0x2c532a,null))[_0x0ba2('0x60')](handleError(_0x2c532a,null));};exports[_0x0ba2('0x73')]=function(_0x1d6527,_0x2f71ca,_0x225ef2){var _0x32f485={'raw':![],'where':{}};var _0x2ae1e5={};var _0x89f3e1={'count':0x0,'rows':[]};return db[_0x0ba2('0x51')]['findOne']({'where':{'id':_0x1d6527[_0x0ba2('0x56')]['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x2f71ca,null))[_0x0ba2('0x38')](function(_0x4cda26){if(_0x4cda26){_0x2ae1e5['model']=_[_0x0ba2('0x44')](db[_0x0ba2('0x74')][_0x0ba2('0x3f')]);_0x2ae1e5['query']=_[_0x0ba2('0x44')](_0x1d6527['query']);_0x2ae1e5['filters']=_['intersection'](_0x2ae1e5[_0x0ba2('0x41')],_0x2ae1e5[_0x0ba2('0x43')]);_0x32f485[_0x0ba2('0x47')]=_[_0x0ba2('0x46')](_0x2ae1e5[_0x0ba2('0x41')],qs[_0x0ba2('0x48')](_0x1d6527[_0x0ba2('0x43')][_0x0ba2('0x48')]));_0x32f485[_0x0ba2('0x47')]=_0x32f485[_0x0ba2('0x47')][_0x0ba2('0x57')]?_0x32f485[_0x0ba2('0x47')]:_0x2ae1e5[_0x0ba2('0x41')];if(!_0x1d6527[_0x0ba2('0x43')]['hasOwnProperty'](_0x0ba2('0x4a'))){_0x32f485[_0x0ba2('0x2e')]=qs[_0x0ba2('0x2e')](_0x1d6527['query'][_0x0ba2('0x2e')]);_0x32f485['offset']=qs[_0x0ba2('0x2b')](_0x1d6527[_0x0ba2('0x43')][_0x0ba2('0x2b')]);}_0x32f485[_0x0ba2('0x6e')]=qs[_0x0ba2('0x4b')](_0x1d6527[_0x0ba2('0x43')][_0x0ba2('0x4b')]);_0x32f485[_0x0ba2('0x4c')]=qs[_0x0ba2('0x45')](_[_0x0ba2('0x4d')](_0x1d6527[_0x0ba2('0x43')],_0x2ae1e5[_0x0ba2('0x45')]));_0x32f485['where'][_0x0ba2('0x64')]=_0x4cda26['id'];if(_0x1d6527['query'][_0x0ba2('0x4e')]){_0x32f485[_0x0ba2('0x4c')]=_[_0x0ba2('0x4f')](_0x32f485['where'],{'$or':_[_0x0ba2('0x42')](_0x32f485[_0x0ba2('0x47')],function(_0x20bf75){var _0x347243={};_0x347243[_0x20bf75]={'$like':'%'+_0x1d6527[_0x0ba2('0x43')]['filter']+'%'};return _0x347243;})});}_0x32f485=_[_0x0ba2('0x4f')]({},_0x32f485,_0x1d6527[_0x0ba2('0x68')]);return db['FaxInteraction'][_0x0ba2('0x2d')]({'where':_0x32f485[_0x0ba2('0x4c')]})[_0x0ba2('0x38')](function(_0x15b6c6){_0x89f3e1['count']=_0x15b6c6;if(_0x1d6527[_0x0ba2('0x43')][_0x0ba2('0x52')]){_0x32f485[_0x0ba2('0x53')]=[{'model':db[_0x0ba2('0x75')],'as':_0x0ba2('0x76'),'required':![]},{'model':db['User'],'as':_0x0ba2('0x77'),'attributes':[_0x0ba2('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0x0ba2('0x78')],'as':'Tags','attributes':['id',_0x0ba2('0x3a'),_0x0ba2('0x79')],'where':_0x1d6527[_0x0ba2('0x43')]['tag']?{'id':_0x1d6527['query'][_0x0ba2('0x7a')]}:undefined,'required':_0x1d6527['query'][_0x0ba2('0x7a')]?!![]:![]}];}return db[_0x0ba2('0x74')][_0x0ba2('0x54')](_0x32f485);})[_0x0ba2('0x38')](function(_0x38ceff){_0x89f3e1['rows']=_0x38ceff;return _0x89f3e1;});}})[_0x0ba2('0x38')](respondWithFilteredResult(_0x2f71ca,_0x32f485))[_0x0ba2('0x60')](handleError(_0x2f71ca,null));};exports[_0x0ba2('0x7b')]=function(_0x322f21,_0x3c8703){var _0x3902d6=_0x322f21[_0x0ba2('0x56')]['id'];var _0x2ced66=_0x322f21[_0x0ba2('0x59')];var _0x48f8d8=0xc8;var _0x37c47b=null;return db[_0x0ba2('0x7c')][_0x0ba2('0x7d')]({'isolationLevel':db[_0x0ba2('0x7c')]['Transaction'][_0x0ba2('0x7e')][_0x0ba2('0x7f')]},function(_0x1fc72f){return db[_0x0ba2('0x51')]['findOne']({'where':{'id':_0x3902d6},'transaction':_0x1fc72f})['then'](function(_0x44375b){if(_0x44375b){return db[_0x0ba2('0x80')][_0x0ba2('0x35')]({'where':{'FaxAccountId':_0x3902d6},'transaction':_0x1fc72f})[_0x0ba2('0x38')](function(){var _0x2517dc=_[_0x0ba2('0x42')](_0x2ced66,function(_0x4cabec){_0x4cabec[_0x0ba2('0x64')]=_0x3902d6;return _0x4cabec;});return db[_0x0ba2('0x80')][_0x0ba2('0x81')](_0x2517dc,{'transaction':_0x1fc72f});});}else{_0x48f8d8=0x194;_0x37c47b=[];}});})['then'](function(){if(_0x48f8d8!==0x194){return db[_0x0ba2('0x80')][_0x0ba2('0x82')]({'where':{'FaxAccountId':_0x3902d6},'order':'priority'})[_0x0ba2('0x38')](function(_0xb3b8af){_0x37c47b=_0xb3b8af;});}})[_0x0ba2('0x60')](function(_0x2a69e3){_0x48f8d8=0x1f4;logger['error'](_0x2a69e3[_0x0ba2('0x39')]);if(_0x2a69e3['name']){delete _0x2a69e3['name'];}_0x37c47b=_0x2a69e3;})['finally'](function(){if(_0x37c47b===null){_0x3c8703[_0x0ba2('0x28')](_0x48f8d8);}else{if(_0x48f8d8===0x1f4){_0x3c8703[_0x0ba2('0x29')](_0x48f8d8)[_0x0ba2('0x3b')](_0x37c47b);}else{_0x3c8703[_0x0ba2('0x29')](_0x48f8d8)[_0x0ba2('0x31')](_0x37c47b);}}});};exports[_0x0ba2('0x83')]=function(_0x513742,_0x4ec463,_0x189a07){var _0x5cda7e={};var _0x4e1abb={};var _0x52ab98;var _0x4e6320;return db['FaxAccount']['findOne']({'where':{'id':_0x513742[_0x0ba2('0x56')]['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x4ec463,null))['then'](function(_0x12c848){if(_0x12c848){_0x52ab98=_0x12c848;_0x4e1abb['model']=_['keys'](db[_0x0ba2('0x80')][_0x0ba2('0x3f')]);_0x4e1abb[_0x0ba2('0x43')]=_['keys'](_0x513742[_0x0ba2('0x43')]);_0x4e1abb[_0x0ba2('0x45')]=_['intersection'](_0x4e1abb[_0x0ba2('0x41')],_0x4e1abb[_0x0ba2('0x43')]);_0x5cda7e['attributes']=_[_0x0ba2('0x46')](_0x4e1abb[_0x0ba2('0x41')],qs['fields'](_0x513742['query'][_0x0ba2('0x48')]));_0x5cda7e[_0x0ba2('0x47')]=_0x5cda7e[_0x0ba2('0x47')]['length']?_0x5cda7e[_0x0ba2('0x47')]:_0x4e1abb['model'];_0x5cda7e[_0x0ba2('0x6e')]=qs[_0x0ba2('0x4b')](_0x513742[_0x0ba2('0x43')][_0x0ba2('0x4b')]);_0x5cda7e[_0x0ba2('0x4c')]=qs[_0x0ba2('0x45')](_['pick'](_0x513742[_0x0ba2('0x43')],_0x4e1abb[_0x0ba2('0x45')]));if(_0x513742[_0x0ba2('0x43')][_0x0ba2('0x4e')]){_0x5cda7e[_0x0ba2('0x4c')]=_[_0x0ba2('0x4f')](_0x5cda7e[_0x0ba2('0x4c')],{'$or':_[_0x0ba2('0x42')](_0x5cda7e[_0x0ba2('0x47')],function(_0x36b2ec){var _0x49ef90={};_0x49ef90[_0x36b2ec]={'$like':'%'+_0x513742['query']['filter']+'%'};return _0x49ef90;})});}_0x5cda7e=_[_0x0ba2('0x4f')]({},_0x5cda7e,_0x513742[_0x0ba2('0x68')]);return _0x52ab98['getApplications'](_0x5cda7e);}})[_0x0ba2('0x38')](function(_0x425a98){if(_0x425a98){_0x4e6320=_0x425a98[_0x0ba2('0x57')];if(!_0x513742[_0x0ba2('0x43')][_0x0ba2('0x49')](_0x0ba2('0x4a'))){_0x5cda7e[_0x0ba2('0x2e')]=qs[_0x0ba2('0x2e')](_0x513742['query'][_0x0ba2('0x2e')]);_0x5cda7e['offset']=qs[_0x0ba2('0x2b')](_0x513742[_0x0ba2('0x43')][_0x0ba2('0x2b')]);}return _0x52ab98[_0x0ba2('0x83')](_0x5cda7e);}})[_0x0ba2('0x38')](function(_0x3328b8){if(_0x3328b8){return _0x3328b8?{'count':_0x4e6320,'rows':_0x3328b8}:null;}})[_0x0ba2('0x38')](respondWithResult(_0x4ec463,null))[_0x0ba2('0x60')](handleError(_0x4ec463,null));};function Extension(_0x2f50df,_0x54ce67,_0x1f5cf7,_0x2fe066){this[_0x0ba2('0x84')]=_0x0ba2('0x85');this[_0x0ba2('0x86')]=_0x2f50df[_0x0ba2('0x87')];this[_0x0ba2('0x88')]=_0x2fe066;this[_0x0ba2('0x50')]=_0x0ba2('0x89');this['description']=_0x0ba2('0x8a');this[_0x0ba2('0x64')]=_0x2f50df['id'];this[_0x0ba2('0x8b')]=_0x54ce67;this['appdata']=_0x1f5cf7;}function createExtensionsReciveFax(_0x163ed1){var _0x140b44=0x1;var _0x1ae6ab=[];_0x1ae6ab[_0x0ba2('0x8c')](new Extension(_0x163ed1,_0x140b44,'',_0x0ba2('0x8d')));_0x140b44+=0x1;_0x1ae6ab[_0x0ba2('0x8c')](new Extension(_0x163ed1,_0x140b44,_0x0ba2('0x8e'),_0x0ba2('0x8f')));_0x140b44+=0x1;for(var _0xfded2f in _0x163ed1){if(_0x163ed1[_0x0ba2('0x49')](_0xfded2f)&&(_0xfded2f===_0x0ba2('0x90')||_0xfded2f===_0x0ba2('0x87')||_0xfded2f===_0x0ba2('0x91')||_0xfded2f===_0x0ba2('0x92')||_0xfded2f===_0x0ba2('0x93')||_0xfded2f===_0x0ba2('0x94')||_0xfded2f==='minrate'||_0xfded2f===_0x0ba2('0x95')||_0xfded2f===_0x0ba2('0x96'))){_0x1ae6ab[_0x0ba2('0x8c')](new Extension(_0x163ed1,_0x140b44,_0x0ba2('0x97')+_0xfded2f+')='+_0x163ed1[_0xfded2f],_0x0ba2('0x8f')));_0x140b44+=0x1;}}_0x1ae6ab['push'](new Extension(_0x163ed1,_0x140b44,'6','Wait'));_0x140b44+=0x1;_0x1ae6ab[_0x0ba2('0x8c')](new Extension(_0x163ed1,_0x140b44,_0x0ba2('0x98'),_0x0ba2('0x99')));_0x140b44=0x0;return _0x1ae6ab;}exports[_0x0ba2('0x9a')]=function(_0x994ef3,_0x757a00,_0x5dcf6e){var _0x1ab9f1;return db[_0x0ba2('0x7c')]['transaction'](function(_0x31652b){return db[_0x0ba2('0x51')]['create'](_0x994ef3[_0x0ba2('0x59')],{'transaction':_0x31652b})[_0x0ba2('0x38')](function(_0x519ac2){_0x1ab9f1=_0x519ac2[_0x0ba2('0x36')]({'plain':!![]});return db[_0x0ba2('0x9b')][_0x0ba2('0x81')](createExtensionsReciveFax(_0x1ab9f1),{'transaction':_0x31652b});});})[_0x0ba2('0x38')](function(){return _0x1ab9f1;})[_0x0ba2('0x38')](respondWithResult(_0x757a00,null))['catch'](handleError(_0x757a00,null));};exports[_0x0ba2('0x9c')]=function(_0x40deab,_0x52fc75,_0x5ecdf6){var _0x502607;return db['sequelize'][_0x0ba2('0x7d')](function(_0x46fb20){return db[_0x0ba2('0x51')][_0x0ba2('0x34')](_0x40deab[_0x0ba2('0x59')],{'where':{'id':_0x40deab[_0x0ba2('0x59')]['id']},'transaction':_0x46fb20})['then'](function(_0x3c28d0){return db[_0x0ba2('0x9b')]['destroy']({'where':{'FaxAccountId':_0x40deab['body']['id']},'transaction':_0x46fb20})[_0x0ba2('0x38')](function(_0x210fd7){return db[_0x0ba2('0x9b')][_0x0ba2('0x81')](createExtensionsReciveFax(_[_0x0ba2('0x72')](_0x40deab['body'],[_0x0ba2('0x9d'),_0x0ba2('0x9e'),_0x0ba2('0x9f'),'updatedAt','TrunkId',_0x0ba2('0xa0')])),{'transaction':_0x46fb20});});});})[_0x0ba2('0x38')](function(){return db[_0x0ba2('0x51')]['findById'](_0x40deab['body']['id']);})[_0x0ba2('0x38')](respondWithResult(_0x52fc75,null))[_0x0ba2('0x60')](handleError(_0x52fc75,null));};exports[_0x0ba2('0xa1')]=function(_0xa3c99,_0x2f4109,_0x5371a4){var _0x38d497={'raw':!![],'where':{}};var _0x3caf51={};var _0x31723b={'count':0x0,'rows':[]};return db['FaxAccount'][_0x0ba2('0x67')]({'where':{'id':_0xa3c99[_0x0ba2('0x56')]['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x2f4109,null))['then'](function(_0x16589d){if(_0x16589d){_0x3caf51['model']=_['keys'](db[_0x0ba2('0xa2')][_0x0ba2('0x3f')]);_0x3caf51['query']=_[_0x0ba2('0x44')](_0xa3c99[_0x0ba2('0x43')]);_0x3caf51['filters']=_[_0x0ba2('0x46')](_0x3caf51[_0x0ba2('0x41')],_0x3caf51[_0x0ba2('0x43')]);_0x38d497[_0x0ba2('0x47')]=_['intersection'](_0x3caf51[_0x0ba2('0x41')],qs[_0x0ba2('0x48')](_0xa3c99['query'][_0x0ba2('0x48')]));_0x38d497['attributes']=_0x38d497[_0x0ba2('0x47')]['length']?_0x38d497[_0x0ba2('0x47')]:_0x3caf51[_0x0ba2('0x41')];if(!_0xa3c99['query'][_0x0ba2('0x49')]('nolimit')){_0x38d497[_0x0ba2('0x2e')]=qs[_0x0ba2('0x2e')](_0xa3c99[_0x0ba2('0x43')][_0x0ba2('0x2e')]);_0x38d497[_0x0ba2('0x2b')]=qs[_0x0ba2('0x2b')](_0xa3c99['query'][_0x0ba2('0x2b')]);}_0x38d497[_0x0ba2('0x6e')]=qs[_0x0ba2('0x4b')](_0xa3c99[_0x0ba2('0x43')][_0x0ba2('0x4b')]);_0x38d497['where']=qs[_0x0ba2('0x45')](_[_0x0ba2('0x4d')](_0xa3c99[_0x0ba2('0x43')],_0x3caf51[_0x0ba2('0x45')]));_0x38d497[_0x0ba2('0x4c')]['FaxAccountId']=_0x16589d['id'];if(_0xa3c99[_0x0ba2('0x43')][_0x0ba2('0x4e')]){_0x38d497['where']=_['merge'](_0x38d497['where'],{'$or':_[_0x0ba2('0x42')](_0x38d497[_0x0ba2('0x47')],function(_0x2350bb){var _0x2eadab={};_0x2eadab[_0x2350bb]={'$like':'%'+_0xa3c99[_0x0ba2('0x43')][_0x0ba2('0x4e')]+'%'};return _0x2eadab;})});}if(_0xa3c99['query'][_0x0ba2('0xa3')]){var _0x1e66d5=_0xa3c99[_0x0ba2('0x43')][_0x0ba2('0xa3')]['split'](',');var _0x739041={};_0x739041[_0x1e66d5[0x0]]={'$gte':moment(_0x1e66d5[0x1])['format'](_0x0ba2('0xa4'))};_0x38d497['where']=_[_0x0ba2('0x4f')](_0x38d497['where'],_0x739041);}_0x38d497=_[_0x0ba2('0x4f')]({},_0x38d497,_0xa3c99[_0x0ba2('0x68')]);return db[_0x0ba2('0xa2')][_0x0ba2('0x2d')]({'where':_0x38d497[_0x0ba2('0x4c')]})[_0x0ba2('0x38')](function(_0x1ef3a4){_0x31723b[_0x0ba2('0x2d')]=_0x1ef3a4;if(_0xa3c99['query'][_0x0ba2('0x52')]){_0x38d497[_0x0ba2('0x53')]=[{'all':!![]}];}return db['FaxMessage'][_0x0ba2('0x54')](_0x38d497);})['then'](function(_0x33ff8f){_0x31723b[_0x0ba2('0x6f')]=_0x33ff8f;return _0x31723b;});}})['then'](respondWithFilteredResult(_0x2f4109,_0x38d497))[_0x0ba2('0x60')](handleError(_0x2f4109,null));};exports['send']=function(_0x580df0,_0x32d8e2,_0x215634){var _0x5a7560,_0x146909={},_0x2411ec;if(_0x580df0[_0x0ba2('0x59')]['to']){_0x2411ec=_0x580df0[_0x0ba2('0x59')]['to'][0x0];}return db['FaxAccount'][_0x0ba2('0x5d')]({'where':{'id':_0x580df0['params']['id']},'include':[{'model':db[_0x0ba2('0xa5')],'as':_0x0ba2('0xa6'),'include':[{'model':db['CmContact'],'as':_0x0ba2('0xa7'),'where':{'fax':_0x2411ec},'limit':0x1,'order':[[_0x0ba2('0xa8'),_0x0ba2('0xa9')]]}]}]})[_0x0ba2('0x38')](handleEntityNotFound(_0x32d8e2,null))[_0x0ba2('0x38')](function(_0x14910b){_0x5a7560=_0x14910b;if(_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xaa')]&&_0x580df0['body']['attachments'][_0x0ba2('0x57')]){for(var _0x1a7fea=0x0;_0x1a7fea<_0x580df0['body']['attachments'][_0x0ba2('0x57')];_0x1a7fea+=0x1){_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xaa')][_0x1a7fea]={'filename':_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xaa')][_0x1a7fea][_0x0ba2('0x3a')],'id':_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xaa')][_0x1a7fea]['id'],'path':path[_0x0ba2('0xab')](config[_0x0ba2('0xac')],_0x0ba2('0xad'),_0x580df0[_0x0ba2('0x59')]['attachments'][_0x1a7fea][_0x0ba2('0xae')])};}}return respondWithRpcPromise('CheckAfterSend',_0x0ba2('0xaf'),{'FaxAccountId':_[_0x0ba2('0xb0')](_0x580df0[_0x0ba2('0x56')]['id'])?undefined:_0x580df0[_0x0ba2('0x56')]['id'],'path':_[_0x0ba2('0xb0')](_0x580df0[_0x0ba2('0x59')]['attachments'][0x0][_0x0ba2('0xb1')])?undefined:_0x580df0[_0x0ba2('0x59')]['attachments'][0x0][_0x0ba2('0xb1')],'fax':_['isNil'](_0x580df0[_0x0ba2('0x59')]['to'][0x0])?undefined:_0x580df0[_0x0ba2('0x59')]['to'][0x0]},client9002);})[_0x0ba2('0x38')](function(){if(_0x5a7560){if(_[_0x0ba2('0xb0')](_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xb2')])){_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xb2')]=util[_0x0ba2('0xb3')](_0x0ba2('0xb4'),_0x5a7560[_0x0ba2('0x3a')],_0x5a7560[_0x0ba2('0xb5')]);}if(_0x5a7560['List']){if(_0x5a7560[_0x0ba2('0xa6')][_0x0ba2('0xa7')][_0x0ba2('0x57')]){return _0x5a7560[_0x0ba2('0xa6')][_0x0ba2('0xa7')][0x0];}else{return db[_0x0ba2('0x75')]['create'](_['defaults'](_0x580df0['body'],{'firstName':_0x580df0['body']['to'][0x0],'phone':_0x580df0['body']['to'][0x0],'fax':_0x580df0['body']['to'][0x0],'ListId':_0x5a7560[_0x0ba2('0xa0')]}));}}else{throw new Error(_0x0ba2('0xb6'));}}else{throw new Error(_0x0ba2('0xb7'));}})['then'](function(_0x227be6){if(_0x227be6){return db['FaxInteraction'][_0x0ba2('0x5d')]({'where':{'ContactId':_0x227be6['id'],'closed':![],'FaxAccountId':_0x5a7560['id']}})[_0x0ba2('0x38')](function(_0x70ae45){if(_0x70ae45){return[_0x70ae45,![]];}return db[_0x0ba2('0x74')][_0x0ba2('0x58')]({'UserId':_0x580df0[_0x0ba2('0xb8')]['id'],'ContactId':_0x227be6['id'],'FaxAccountId':_0x5a7560['id'],'fax':_0x580df0[_0x0ba2('0x59')]['to'][0x0],'firstMsgDirection':_0x0ba2('0xb9'),'Messages':[_['merge'](_0x580df0[_0x0ba2('0x59')],{'read':![],'body':_0x580df0[_0x0ba2('0x59')]['attachments'][0x0][_0x0ba2('0xba')],'FaxAccountId':_0x5a7560['id'],'UserId':_0x580df0['user']['id'],'ContactId':_0x227be6['id'],'AttachmentId':_0x580df0['body'][_0x0ba2('0xaa')][0x0]['id']})]},{'include':[{'model':db[_0x0ba2('0xa2')],'as':_0x0ba2('0xbb')}]})[_0x0ba2('0x38')](function(_0x52ae9f){return[_0x52ae9f,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x0ba2('0xbc')](function(_0x25fb5c,_0x4bf2b1){if(_0x4bf2b1){return _0x25fb5c;}return db['FaxMessage'][_0x0ba2('0x58')]({'direction':_0x0ba2('0xb9'),'read':![],'body':_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xaa')][0x0][_0x0ba2('0xba')],'FaxAccountId':_0x5a7560['id'],'FaxInteractionId':_0x25fb5c['id'],'UserId':_0x580df0['user']['id'],'ContactId':_0x25fb5c[_0x0ba2('0xbd')],'AttachmentId':_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xaa')][0x0]['id']})[_0x0ba2('0x38')](function(_0x46029e){_0x25fb5c[_0x0ba2('0xbe')][_0x0ba2('0xbb')]=[];_0x25fb5c[_0x0ba2('0xbe')][_0x0ba2('0xbb')][_0x0ba2('0x8c')](_0x46029e[_0x0ba2('0xbe')]);return _0x25fb5c;});})[_0x0ba2('0x38')](function(_0x3dd204){respondWithRpcPromise(_0x0ba2('0xbf'),_0x0ba2('0xbf'),{'FaxAccountId':_[_0x0ba2('0xb0')](_0x580df0[_0x0ba2('0x56')]['id'])?undefined:_0x580df0[_0x0ba2('0x56')]['id'],'path':_['isNil'](_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xaa')][0x0][_0x0ba2('0xb1')])?undefined:_0x580df0[_0x0ba2('0x59')][_0x0ba2('0xaa')][0x0][_0x0ba2('0xb1')],'fax':_[_0x0ba2('0xb0')](_0x580df0[_0x0ba2('0x59')]['to'][0x0])?undefined:_0x580df0['body']['to'][0x0],'AttachmentId':_0x580df0[_0x0ba2('0x59')]['attachments'][0x0]['id']},client9002)[_0x0ba2('0x38')](function(_0xd17400){logger[_0x0ba2('0x20')](_0x0ba2('0xc0'),_0xd17400);})[_0x0ba2('0x60')](function(_0x4a0e28){logger['info'](_0x0ba2('0xc0'),_0x4a0e28);});return _0x3dd204;})[_0x0ba2('0x38')](respondWithResult(_0x32d8e2,null))[_0x0ba2('0x60')](handleError(_0x32d8e2,null));};exports[_0x0ba2('0xc1')]=function(_0x19460f,_0x4fa46c,_0x39cc7f){return db[_0x0ba2('0x51')][_0x0ba2('0x5d')]({'where':{'id':_0x19460f['params']['id']}})['then'](handleEntityNotFound(_0x4fa46c,null))['then'](function(_0x25ed1a){if(_0x25ed1a){return _0x25ed1a[_0x0ba2('0xc1')](_0x19460f[_0x0ba2('0x59')][_0x0ba2('0x6a')],_[_0x0ba2('0x72')](_0x19460f[_0x0ba2('0x59')],[_0x0ba2('0x6a'),'id'])||{})[_0x0ba2('0xbc')](function(_0x825283){for(var _0xa9b86e=0x0;_0xa9b86e<_0x19460f[_0x0ba2('0x59')][_0x0ba2('0x6a')][_0x0ba2('0x57')];_0xa9b86e+=0x1){socket[_0x0ba2('0xc2')](_0x0ba2('0xc3'),{'UserId':Number(_0x19460f[_0x0ba2('0x59')][_0x0ba2('0x6a')][_0xa9b86e]),'FaxAccountId':Number(_0x19460f['params']['id'])});}return _0x825283;});}})[_0x0ba2('0x38')](respondWithResult(_0x4fa46c,null))[_0x0ba2('0x60')](handleError(_0x4fa46c,null));};exports['removeAgents']=function(_0x63ed9f,_0x29e081,_0x3bf24d){return db['FaxAccount'][_0x0ba2('0x5d')]({'where':{'id':_0x63ed9f['params']['id']}})[_0x0ba2('0x38')](handleEntityNotFound(_0x29e081,null))[_0x0ba2('0x38')](function(_0x599caa){if(_0x599caa){return _0x599caa[_0x0ba2('0xc4')](_0x63ed9f[_0x0ba2('0x43')][_0x0ba2('0x6a')])[_0x0ba2('0x38')](function(){if(_[_0x0ba2('0xc5')](_0x63ed9f[_0x0ba2('0x43')]['ids'])){for(var _0x2afba5=0x0;_0x2afba5<_0x63ed9f[_0x0ba2('0x43')][_0x0ba2('0x6a')]['length'];_0x2afba5+=0x1){socket[_0x0ba2('0xc2')](_0x0ba2('0xc6'),{'UserId':Number(_0x63ed9f[_0x0ba2('0x43')][_0x0ba2('0x6a')][_0x2afba5]),'FaxAccountId':Number(_0x63ed9f[_0x0ba2('0x56')]['id'])});}}else{socket['emit'](_0x0ba2('0xc6'),{'UserId':Number(_0x63ed9f[_0x0ba2('0x43')][_0x0ba2('0x6a')]),'FaxAccountId':Number(_0x63ed9f[_0x0ba2('0x56')]['id'])});}});}})[_0x0ba2('0x38')](respondWithStatusCode(_0x29e081,null))[_0x0ba2('0x60')](handleError(_0x29e081,null));};exports[_0x0ba2('0xc7')]=function(_0x61af96,_0x535a3c,_0x5e7a63){var _0x5b591b={};var _0x113f2b={};var _0x464269;var _0x5c4287;return db[_0x0ba2('0x51')][_0x0ba2('0x67')]({'where':{'id':_0x61af96['params']['id']}})['then'](handleEntityNotFound(_0x535a3c,null))['then'](function(_0x559de6){if(_0x559de6){_0x464269=_0x559de6;_0x113f2b['model']=_['keys'](db[_0x0ba2('0xc8')][_0x0ba2('0x3f')]);_0x113f2b[_0x0ba2('0x43')]=_[_0x0ba2('0x44')](_0x61af96[_0x0ba2('0x43')]);_0x113f2b[_0x0ba2('0x45')]=_['intersection'](_0x113f2b[_0x0ba2('0x41')],_0x113f2b['query']);_0x5b591b['attributes']=_[_0x0ba2('0x46')](_0x113f2b['model'],qs[_0x0ba2('0x48')](_0x61af96[_0x0ba2('0x43')][_0x0ba2('0x48')]));_0x5b591b[_0x0ba2('0x47')]=_0x5b591b['attributes'][_0x0ba2('0x57')]?_0x5b591b[_0x0ba2('0x47')]:_0x113f2b[_0x0ba2('0x41')];_0x5b591b['order']=qs['sort'](_0x61af96[_0x0ba2('0x43')][_0x0ba2('0x4b')]);_0x5b591b['where']=qs['filters'](_[_0x0ba2('0x4d')](_0x61af96[_0x0ba2('0x43')],_0x113f2b[_0x0ba2('0x45')]));if(_0x61af96['query'][_0x0ba2('0x4e')]){_0x5b591b[_0x0ba2('0x4c')]=_[_0x0ba2('0x4f')](_0x5b591b[_0x0ba2('0x4c')],{'$or':_['map'](_0x5b591b['attributes'],function(_0x1800f9){var _0x4b9d06={};_0x4b9d06[_0x1800f9]={'$like':'%'+_0x61af96[_0x0ba2('0x43')][_0x0ba2('0x4e')]+'%'};return _0x4b9d06;})});}_0x5b591b=_['merge']({},_0x5b591b,_0x61af96[_0x0ba2('0x68')]);return _0x464269['getAgents'](_0x5b591b);}})[_0x0ba2('0x38')](function(_0x5c258f){if(_0x5c258f){_0x5c4287=_0x5c258f[_0x0ba2('0x57')];if(!_0x61af96['query']['hasOwnProperty']('nolimit')){_0x5b591b[_0x0ba2('0x2e')]=qs['limit'](_0x61af96[_0x0ba2('0x43')][_0x0ba2('0x2e')]);_0x5b591b[_0x0ba2('0x2b')]=qs[_0x0ba2('0x2b')](_0x61af96[_0x0ba2('0x43')][_0x0ba2('0x2b')]);}return _0x464269[_0x0ba2('0xc7')](_0x5b591b);}})['then'](function(_0x6c0676){if(_0x6c0676){return _0x6c0676?{'count':_0x5c4287,'rows':_0x6c0676}:null;}})['then'](respondWithResult(_0x535a3c,null))[_0x0ba2('0x60')](handleError(_0x535a3c,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 50e03dd..ddc4f26 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 _0xe149=['hook','exports','events','save','emit','hasOwnProperty'];(function(_0x974a75,_0x1acfc3){var _0x150cf6=function(_0x202c96){while(--_0x202c96){_0x974a75['push'](_0x974a75['shift']());}};_0x150cf6(++_0x1acfc3);}(_0xe149,0x7a));var _0x9e14=function(_0x54ff33,_0x35a087){_0x54ff33=_0x54ff33-0x0;var _0xa81ed0=_0xe149[_0x54ff33];return _0xa81ed0;};'use strict';var EventEmitter=require(_0x9e14('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e14('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc27309){return function(_0x42f9f4,_0x4d4482,_0x127777){FaxAccountEvents[_0x9e14('0x2')](_0xc27309+':'+_0x42f9f4['id'],_0x42f9f4);FaxAccountEvents[_0x9e14('0x2')](_0xc27309,_0x42f9f4);_0x127777(null);};}for(var e in events){if(events[_0x9e14('0x3')](e)){var event=events[e];FaxAccount[_0x9e14('0x4')](e,emitEvent(event));}}module[_0x9e14('0x5')]=FaxAccountEvents; \ No newline at end of file +var _0x18df=['hook','exports','events','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x110424,_0xa077fb){var _0x2ef599=function(_0x19b933){while(--_0x19b933){_0x110424['push'](_0x110424['shift']());}};_0x2ef599(++_0xa077fb);}(_0x18df,0x1b2));var _0xf18d=function(_0x3e000a,_0x84f846){_0x3e000a=_0x3e000a-0x0;var _0x2e119e=_0x18df[_0x3e000a];return _0x2e119e;};'use strict';var EventEmitter=require(_0xf18d('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf18d('0x1')](0x0);var events={'afterCreate':_0xf18d('0x2'),'afterUpdate':_0xf18d('0x3'),'afterDestroy':_0xf18d('0x4')};function emitEvent(_0x58e89c){return function(_0x38ec4e,_0x124a0b,_0x10be93){FaxAccountEvents[_0xf18d('0x5')](_0x58e89c+':'+_0x38ec4e['id'],_0x38ec4e);FaxAccountEvents[_0xf18d('0x5')](_0x58e89c,_0x38ec4e);_0x10be93(null);};}for(var e in events){if(events[_0xf18d('0x6')](e)){var event=events[e];FaxAccount[_0xf18d('0x7')](e,emitEvent(event));}}module[_0xf18d('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index a827cef..4151700 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 _0x7e64=['bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api'];(function(_0x18228a,_0x2a371b){var _0x5d973c=function(_0x8bc4a8){while(--_0x8bc4a8){_0x18228a['push'](_0x18228a['shift']());}};_0x5d973c(++_0x2a371b);}(_0x7e64,0xc0));var _0x47e6=function(_0x34f271,_0x26b85f){_0x34f271=_0x34f271-0x0;var _0x5067d5=_0x7e64[_0x34f271];return _0x5067d5;};'use strict';var _=require(_0x47e6('0x0'));var util=require(_0x47e6('0x1'));var logger=require(_0x47e6('0x2'))(_0x47e6('0x3'));var moment=require('moment');var BPromise=require(_0x47e6('0x4'));var rp=require(_0x47e6('0x5'));var fs=require('fs');var path=require(_0x47e6('0x6'));var rimraf=require(_0x47e6('0x7'));var config=require(_0x47e6('0x8'));var attributes=require(_0x47e6('0x9'));module[_0x47e6('0xa')]=function(_0x17379a,_0x45d9d6){return _0x17379a[_0x47e6('0xb')](_0x47e6('0xc'),attributes,{'tableName':_0x47e6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc1d=['lodash','util','api','moment','request-promise','path','rimraf','./faxAccount.attributes','define','FaxAccount','fax_accounts'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0xdc1d,0x1c3));var _0xddc1=function(_0x4f3044,_0x18dd88){_0x4f3044=_0x4f3044-0x0;var _0x1efa50=_0xdc1d[_0x4f3044];return _0x1efa50;};'use strict';var _=require(_0xddc1('0x0'));var util=require(_0xddc1('0x1'));var logger=require('../../config/logger')(_0xddc1('0x2'));var moment=require(_0xddc1('0x3'));var BPromise=require('bluebird');var rp=require(_0xddc1('0x4'));var fs=require('fs');var path=require(_0xddc1('0x5'));var rimraf=require(_0xddc1('0x6'));var config=require('../../config/environment');var attributes=require(_0xddc1('0x7'));module['exports']=function(_0xf397dc,_0x22ed41){return _0xf397dc[_0xddc1('0x8')](_0xddc1('0x9'),attributes,{'tableName':_0xddc1('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 8f22f23..03c45b5 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 _0xaac4=['where','limit','include','map','attributes','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','push','close','*,*,*,*','created','FaxMessage','interaction','User','unshift','agent','name','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xaac4,0x140));var _0x4aac=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0xaac4[_0x282ccc];return _0x27c2dd;};'use strict';var _=require(_0x4aac('0x0'));var util=require('util');var moment=require(_0x4aac('0x1'));var BPromise=require(_0x4aac('0x2'));var rs=require(_0x4aac('0x3'));var fs=require('fs');var Redis=require(_0x4aac('0x4'));var db=require(_0x4aac('0x5'))['db'];var utils=require(_0x4aac('0x6'));var logger=require(_0x4aac('0x7'))(_0x4aac('0x8'));var config=require('../../config/environment');var jayson=require(_0x4aac('0x9'));var client=jayson[_0x4aac('0xa')][_0x4aac('0xb')]({'port':0x232c});config[_0x4aac('0xc')]=_[_0x4aac('0xd')](config[_0x4aac('0xc')],{'host':_0x4aac('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4aac('0xc')]));require(_0x4aac('0xf'))[_0x4aac('0x10')](socket);function respondWithRpcPromise(_0x24efcf,_0x3be45b,_0x4213a1){return new BPromise(function(_0x2efae1,_0x5e2506){return client[_0x4aac('0x11')](_0x24efcf,_0x4213a1)[_0x4aac('0x12')](function(_0x2a1ed7){logger[_0x4aac('0x13')](_0x4aac('0x14'),_0x3be45b,'request\x20sent');logger['debug'](_0x4aac('0x15'),_0x3be45b,'request\x20sent',JSON[_0x4aac('0x16')](_0x2a1ed7));if(_0x2a1ed7[_0x4aac('0x17')]){if(_0x2a1ed7[_0x4aac('0x17')][_0x4aac('0x18')]===0x1f4){logger[_0x4aac('0x17')](_0x4aac('0x14'),_0x3be45b,_0x2a1ed7[_0x4aac('0x17')]['message']);return _0x5e2506(_0x2a1ed7[_0x4aac('0x17')][_0x4aac('0x19')]);}logger[_0x4aac('0x17')]('FaxAccount,\x20%s,\x20%s',_0x3be45b,_0x2a1ed7[_0x4aac('0x17')][_0x4aac('0x19')]);return _0x2efae1(_0x2a1ed7[_0x4aac('0x17')][_0x4aac('0x19')]);}else{logger[_0x4aac('0x13')](_0x4aac('0x14'),_0x3be45b,'request\x20sent');_0x2efae1(_0x2a1ed7['result'][_0x4aac('0x19')]);}})[_0x4aac('0x1a')](function(_0x598f70){logger['error'](_0x4aac('0x14'),_0x3be45b,_0x598f70);_0x5e2506(_0x598f70);});});}exports[_0x4aac('0x1b')]=function(_0x237a0f){var _0xd39b3c=this;return new Promise(function(_0x124773,_0x5ac4a9){return db[_0x4aac('0x1c')][_0x4aac('0x1d')]({'raw':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f[_0x4aac('0x1e')][_0x4aac('0x1f')]===undefined?!![]:![]:!![],'where':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f[_0x4aac('0x1e')][_0x4aac('0x20')]||null:null,'attributes':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f[_0x4aac('0x1e')]['attributes']||null:null,'limit':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f[_0x4aac('0x1e')][_0x4aac('0x21')]||null:null,'include':_0x237a0f[_0x4aac('0x1e')]?_0x237a0f['options'][_0x4aac('0x22')]?_[_0x4aac('0x23')](_0x237a0f[_0x4aac('0x1e')][_0x4aac('0x22')],function(_0xc99bdc){return{'model':db[_0xc99bdc['model']],'as':_0xc99bdc['as'],'attributes':_0xc99bdc[_0x4aac('0x24')],'include':_0xc99bdc[_0x4aac('0x22')]?_[_0x4aac('0x23')](_0xc99bdc[_0x4aac('0x22')],function(_0x897004){return{'model':db[_0x897004['model']],'as':_0x897004['as'],'attributes':_0x897004['attributes'],'include':_0x897004['include']?_[_0x4aac('0x23')](_0x897004['include'],function(_0x2aa4bd){return{'model':db[_0x2aa4bd['model']],'as':_0x2aa4bd['as'],'attributes':_0x2aa4bd[_0x4aac('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f9497){logger['info']('GetFaxAccount',_0x237a0f);logger['debug'](_0x4aac('0x1b'),_0x237a0f,JSON[_0x4aac('0x16')](_0x1f9497));_0x124773(_0x1f9497);})[_0x4aac('0x1a')](function(_0x584c37){logger[_0x4aac('0x17')]('GetFaxAccount',_0x584c37[_0x4aac('0x19')],_0x237a0f);_0x5ac4a9(_0xd39b3c[_0x4aac('0x17')](0x1f4,_0x584c37[_0x4aac('0x19')]));});});};exports[_0x4aac('0x25')]=function(_0x3c426f,_0x2f11f2,_0x3fa796){var _0x36d8b2=this;return new Promise(function(_0x58f6aa,_0x16a0f3){var _0x3adae3={'body':_0x3c426f[_0x4aac('0x26')],'channel':_0x4aac('0x27')};var _0x18149b=[];var _0x2a3160=[];var _0x33e063={};return db[_0x4aac('0x28')]['describe']()[_0x4aac('0x12')](function(_0x4b5393){if(!_0x4b5393){throw new db[(_0x4aac('0x29'))][(_0x4aac('0x2a'))](_0x4aac('0x2b'));}_0x18149b=_[_0x4aac('0x2c')](_[_0x4aac('0x2d')](_0x4b5393),[_0x4aac('0x2e'),_0x4aac('0x2f')]);_0x2a3160=_[_0x4aac('0x2c')](_[_0x4aac('0x2d')](_0x4b5393),[_0x4aac('0x2e'),'updatedAt',_0x4aac('0x30'),_0x4aac('0x31')]);if(_0x3c426f[_0x4aac('0x26')]['id']){delete _0x3c426f['body']['id'];}if(_[_0x4aac('0x32')](_0x3c426f[_0x4aac('0x26')][_0x4aac('0x33')])){throw new db['Sequelize'][(_0x4aac('0x2a'))](_0x4aac('0x34'));}if(_[_0x4aac('0x32')](_0x3c426f[_0x4aac('0x26')]['body'])||_0x3c426f[_0x4aac('0x26')][_0x4aac('0x26')]===''){throw new db[(_0x4aac('0x29'))][(_0x4aac('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x4aac('0x32')](_0x3c426f[_0x4aac('0x26')]['mapKey'])){throw new db[(_0x4aac('0x29'))][(_0x4aac('0x2a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a3160);}if(!_[_0x4aac('0x35')](_0x2a3160,_0x3c426f[_0x4aac('0x26')][_0x4aac('0x36')])){throw new db[(_0x4aac('0x29'))][(_0x4aac('0x2a'))](_0x4aac('0x37')+_0x2a3160);}_0x33e063[_0x3c426f[_0x4aac('0x26')][_0x4aac('0x36')]]=_0x3c426f[_0x4aac('0x26')][_0x4aac('0x33')];})[_0x4aac('0x12')](function(){return db['FaxAccount'][_0x4aac('0x38')]({'where':{'id':_0x3c426f[_0x4aac('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0x4aac('0x3a'),'include':[{'model':db[_0x4aac('0x28')],'as':_0x4aac('0x3b'),'where':_0x33e063,'limit':0x1,'order':[[_0x4aac('0x2f'),_0x4aac('0x3c')]]}]},{'model':db[_0x4aac('0x3d')],'as':_0x4aac('0x3e')}]});})[_0x4aac('0x12')](function(_0x1a56c2){if(_0x1a56c2&&_0x1a56c2[_0x4aac('0x3a')]){var _0xad4c5f=_0x1a56c2[_0x4aac('0x3f')]({'plain':!![]});_0x3adae3[_0x4aac('0x39')]=_0xad4c5f;_0x3adae3['applications']=_0xad4c5f[_0x4aac('0x3e')];_0x3adae3[_0x4aac('0x40')]=_0xad4c5f[_0x4aac('0x3a')];_0x3adae3[_0x4aac('0x41')]=_[_0x4aac('0x42')](_0x3adae3[_0x4aac('0x41')],[_0x4aac('0x43')],[_0x4aac('0x44')]);if(_0x3adae3[_0x4aac('0x39')][_0x4aac('0x3e')]){delete _0x3adae3[_0x4aac('0x39')]['Applications'];}if(_0x3adae3[_0x4aac('0x39')][_0x4aac('0x3a')]&&_0x3adae3[_0x4aac('0x39')][_0x4aac('0x3a')]['Contacts'][_0x4aac('0x45')]){return _0x3adae3['account'][_0x4aac('0x3a')][_0x4aac('0x3b')][0x0];}var _0x2f9f7e=_['defaults'](_0x3c426f['body'],{'firstName':_0x3c426f['body'][_0x4aac('0x33')],'ListId':_0xad4c5f[_0x4aac('0x31')]});_0x2f9f7e[_0x3c426f['body'][_0x4aac('0x36')]]=_0x3c426f[_0x4aac('0x26')][_0x4aac('0x33')];return db[_0x4aac('0x28')][_0x4aac('0x46')](_0x2f9f7e,{'fields':_0x18149b,'raw':!![]});}})[_0x4aac('0x12')](function(_0x19db16){_0x3adae3[_0x4aac('0x47')]=_0x19db16;if(_0x19db16){var _0x405131={'ContactId':_0x19db16['id'],'FaxAccountId':_0x3c426f[_0x4aac('0x39')]['id'],'fax':_0x19db16[_0x4aac('0x27')]};return db[_0x4aac('0x48')][_0x4aac('0x38')]({'where':{'ContactId':_0x19db16['id'],'closed':![],'FaxAccountId':_0x3c426f[_0x4aac('0x39')]['id']}})[_0x4aac('0x12')](function(_0x54914c){if(_0x54914c){return[_0x54914c,![]];}return db[_0x4aac('0x48')]['create'](_0x405131)[_0x4aac('0x12')](function(_0x4e6cce){return[_0x4e6cce,!![]];});});}else{throw new Error(_0x4aac('0x49'));}})[_0x4aac('0x4a')](function(_0x416a65,_0x3e7edd){var _0x2cd203=_0x416a65['get']({'plain':!![]});if(_0x3e7edd){if(_0x3adae3[_0x4aac('0x39')]['autoclose']){_0x3adae3[_0x4aac('0x41')][_0x4aac('0x4b')]({'id':0x0,'priority':_0x3adae3[_0x4aac('0x41')][_0x4aac('0x45')]+0x1,'app':_0x4aac('0x4c'),'appdata':'unmanaged','interval':_0x4aac('0x4d')});}_0x2cd203[_0x4aac('0x4e')]=!![];}else{_0x2cd203[_0x4aac('0x4e')]=![];}_0x3adae3['interaction']=_0x2cd203;return db[_0x4aac('0x4f')][_0x4aac('0x46')]({'body':_0x3c426f[_0x4aac('0x26')]['body'],'FaxAccountId':_0x3c426f[_0x4aac('0x39')]['id'],'FaxInteractionId':_0x416a65['id'],'direction':'in','ContactId':_0x416a65['ContactId'],'AttachmentId':_0x3c426f[_0x4aac('0x26')]['AttachmentId']});})[_0x4aac('0x12')](function(_0x560e0c){_0x3adae3[_0x4aac('0x19')]=_0x560e0c;if(_0x3adae3[_0x4aac('0x50')]['UserId']){return db[_0x4aac('0x51')]['find']({'attributes':['id','name'],'where':{'id':_0x3adae3['interaction']['UserId']}})[_0x4aac('0x12')](function(_0x5b623c){if(_0x5b623c){_0x3adae3[_0x4aac('0x41')][_0x4aac('0x52')]({'id':0x0,'priority':0x0,'app':_0x4aac('0x53'),'appdata':_0x5b623c[_0x4aac('0x54')]+','+(_0x3adae3[_0x4aac('0x39')][_0x4aac('0x55')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x4aac('0x56'),_0x3adae3);});}return respondWithRpcPromise(_0x4aac('0x57'),_0x4aac('0x56'),_0x3adae3);})[_0x4aac('0x12')](function(_0x18f77f){_0x58f6aa(_0x18f77f);})['catch'](function(_0x232f0f){_0x16a0f3(_0x36d8b2[_0x4aac('0x17')](0x1f4,_0x232f0f['message']));});});}; \ No newline at end of file +var _0x238c=['limit','include','model','attributes','map','GetFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','FaxApplication','applications','Applications','list','List','length','defaults','FaxInteraction','create','Contact\x20not\x20found','get','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll','raw','options'];(function(_0x3cc4bc,_0x43040f){var _0x2977a7=function(_0x3e34ca){while(--_0x3e34ca){_0x3cc4bc['push'](_0x3cc4bc['shift']());}};_0x2977a7(++_0x43040f);}(_0x238c,0x1a2));var _0xc238=function(_0x451999,_0x1b3908){_0x451999=_0x451999-0x0;var _0x1b696e=_0x238c[_0x451999];return _0x1b696e;};'use strict';var _=require(_0xc238('0x0'));var util=require(_0xc238('0x1'));var moment=require(_0xc238('0x2'));var BPromise=require(_0xc238('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc238('0x4'));var db=require(_0xc238('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc238('0x6'))('rpc');var config=require(_0xc238('0x7'));var jayson=require(_0xc238('0x8'));var client=jayson[_0xc238('0x9')]['http']({'port':0x232c});config[_0xc238('0xa')]=_['defaults'](config[_0xc238('0xa')],{'host':_0xc238('0xb'),'port':0x18eb});var socket=require(_0xc238('0xc'))(new Redis(config['redis']));require(_0xc238('0xd'))[_0xc238('0xe')](socket);function respondWithRpcPromise(_0x24c174,_0x5e3278,_0x45a3a9){return new BPromise(function(_0x5ee4a5,_0x182e55){return client[_0xc238('0xf')](_0x24c174,_0x45a3a9)[_0xc238('0x10')](function(_0x235461){logger[_0xc238('0x11')](_0xc238('0x12'),_0x5e3278,_0xc238('0x13'));logger[_0xc238('0x14')](_0xc238('0x15'),_0x5e3278,_0xc238('0x13'),JSON[_0xc238('0x16')](_0x235461));if(_0x235461[_0xc238('0x17')]){if(_0x235461[_0xc238('0x17')][_0xc238('0x18')]===0x1f4){logger[_0xc238('0x17')]('FaxAccount,\x20%s,\x20%s',_0x5e3278,_0x235461[_0xc238('0x17')]['message']);return _0x182e55(_0x235461['error'][_0xc238('0x19')]);}logger[_0xc238('0x17')](_0xc238('0x12'),_0x5e3278,_0x235461[_0xc238('0x17')][_0xc238('0x19')]);return _0x5ee4a5(_0x235461[_0xc238('0x17')][_0xc238('0x19')]);}else{logger[_0xc238('0x11')]('FaxAccount,\x20%s,\x20%s',_0x5e3278,_0xc238('0x13'));_0x5ee4a5(_0x235461[_0xc238('0x1a')][_0xc238('0x19')]);}})[_0xc238('0x1b')](function(_0x44d473){logger[_0xc238('0x17')](_0xc238('0x12'),_0x5e3278,_0x44d473);_0x182e55(_0x44d473);});});}exports['GetFaxAccount']=function(_0x165674){var _0x6d6d95=this;return new Promise(function(_0xa922db,_0xc74dc8){return db[_0xc238('0x1c')][_0xc238('0x1d')]({'raw':_0x165674['options']?_0x165674['options'][_0xc238('0x1e')]===undefined?!![]:![]:!![],'where':_0x165674['options']?_0x165674['options']['where']||null:null,'attributes':_0x165674[_0xc238('0x1f')]?_0x165674[_0xc238('0x1f')]['attributes']||null:null,'limit':_0x165674['options']?_0x165674[_0xc238('0x1f')][_0xc238('0x20')]||null:null,'include':_0x165674['options']?_0x165674[_0xc238('0x1f')][_0xc238('0x21')]?_['map'](_0x165674[_0xc238('0x1f')][_0xc238('0x21')],function(_0x2405e1){return{'model':db[_0x2405e1[_0xc238('0x22')]],'as':_0x2405e1['as'],'attributes':_0x2405e1[_0xc238('0x23')],'include':_0x2405e1['include']?_[_0xc238('0x24')](_0x2405e1['include'],function(_0x53d565){return{'model':db[_0x53d565[_0xc238('0x22')]],'as':_0x53d565['as'],'attributes':_0x53d565[_0xc238('0x23')],'include':_0x53d565[_0xc238('0x21')]?_[_0xc238('0x24')](_0x53d565[_0xc238('0x21')],function(_0x4d0c3f){return{'model':db[_0x4d0c3f[_0xc238('0x22')]],'as':_0x4d0c3f['as'],'attributes':_0x4d0c3f['attributes']};}):[]};}):[]};}):[]:[]})[_0xc238('0x10')](function(_0x2fed6b){logger[_0xc238('0x11')](_0xc238('0x25'),_0x165674);logger[_0xc238('0x14')]('GetFaxAccount',_0x165674,JSON[_0xc238('0x16')](_0x2fed6b));_0xa922db(_0x2fed6b);})[_0xc238('0x1b')](function(_0x4acec7){logger['error'](_0xc238('0x25'),_0x4acec7[_0xc238('0x19')],_0x165674);_0xc74dc8(_0x6d6d95[_0xc238('0x17')](0x1f4,_0x4acec7[_0xc238('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x51d2ea,_0x10e8ed,_0x390692){var _0x558dee=this;return new Promise(function(_0x4d4bf8,_0x5376f5){var _0x4f4a2e={'body':_0x51d2ea[_0xc238('0x26')],'channel':_0xc238('0x27')};var _0x15e3e2=[];var _0x23e9ba=[];var _0x37b812={};return db[_0xc238('0x28')][_0xc238('0x29')]()[_0xc238('0x10')](function(_0xc9a46d){if(!_0xc9a46d){throw new db[(_0xc238('0x2a'))][(_0xc238('0x2b'))](_0xc238('0x2c'));}_0x15e3e2=_[_0xc238('0x2d')](_['keys'](_0xc9a46d),[_0xc238('0x2e'),_0xc238('0x2f')]);_0x23e9ba=_[_0xc238('0x2d')](_[_0xc238('0x30')](_0xc9a46d),[_0xc238('0x2e'),'updatedAt',_0xc238('0x31'),_0xc238('0x32')]);if(_0x51d2ea[_0xc238('0x26')]['id']){delete _0x51d2ea[_0xc238('0x26')]['id'];}if(_[_0xc238('0x33')](_0x51d2ea[_0xc238('0x26')][_0xc238('0x34')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xc238('0x33')](_0x51d2ea[_0xc238('0x26')][_0xc238('0x26')])||_0x51d2ea[_0xc238('0x26')][_0xc238('0x26')]===''){throw new db[(_0xc238('0x2a'))]['ValidationError'](_0xc238('0x35'));}if(_[_0xc238('0x33')](_0x51d2ea[_0xc238('0x26')][_0xc238('0x36')])){throw new db['Sequelize'][(_0xc238('0x2b'))](_0xc238('0x37')+_0x23e9ba);}if(!_[_0xc238('0x38')](_0x23e9ba,_0x51d2ea[_0xc238('0x26')]['mapKey'])){throw new db[(_0xc238('0x2a'))][(_0xc238('0x2b'))](_0xc238('0x39')+_0x23e9ba);}_0x37b812[_0x51d2ea[_0xc238('0x26')][_0xc238('0x36')]]=_0x51d2ea[_0xc238('0x26')][_0xc238('0x34')];})[_0xc238('0x10')](function(){return db['FaxAccount'][_0xc238('0x3a')]({'where':{'id':_0x51d2ea[_0xc238('0x3b')]['id']},'include':[{'model':db[_0xc238('0x3c')],'as':'List','include':[{'model':db[_0xc238('0x28')],'as':_0xc238('0x3d'),'where':_0x37b812,'limit':0x1,'order':[[_0xc238('0x2f'),_0xc238('0x3e')]]}]},{'model':db[_0xc238('0x3f')],'as':'Applications'}]});})[_0xc238('0x10')](function(_0x320f08){if(_0x320f08&&_0x320f08['List']){var _0x4949dd=_0x320f08['get']({'plain':!![]});_0x4f4a2e[_0xc238('0x3b')]=_0x4949dd;_0x4f4a2e[_0xc238('0x40')]=_0x4949dd[_0xc238('0x41')];_0x4f4a2e[_0xc238('0x42')]=_0x4949dd[_0xc238('0x43')];_0x4f4a2e[_0xc238('0x40')]=_['orderBy'](_0x4f4a2e[_0xc238('0x40')],['priority'],['asc']);if(_0x4f4a2e[_0xc238('0x3b')][_0xc238('0x41')]){delete _0x4f4a2e['account']['Applications'];}if(_0x4f4a2e[_0xc238('0x3b')][_0xc238('0x43')]&&_0x4f4a2e['account'][_0xc238('0x43')][_0xc238('0x3d')][_0xc238('0x44')]){return _0x4f4a2e[_0xc238('0x3b')][_0xc238('0x43')][_0xc238('0x3d')][0x0];}var _0x447697=_[_0xc238('0x45')](_0x51d2ea['body'],{'firstName':_0x51d2ea['body']['from'],'ListId':_0x4949dd[_0xc238('0x32')]});_0x447697[_0x51d2ea['body'][_0xc238('0x36')]]=_0x51d2ea[_0xc238('0x26')][_0xc238('0x34')];return db[_0xc238('0x28')]['create'](_0x447697,{'fields':_0x15e3e2,'raw':!![]});}})[_0xc238('0x10')](function(_0x1530cf){_0x4f4a2e['contact']=_0x1530cf;if(_0x1530cf){var _0xa18db={'ContactId':_0x1530cf['id'],'FaxAccountId':_0x51d2ea[_0xc238('0x3b')]['id'],'fax':_0x1530cf['fax']};return db[_0xc238('0x46')]['find']({'where':{'ContactId':_0x1530cf['id'],'closed':![],'FaxAccountId':_0x51d2ea[_0xc238('0x3b')]['id']}})['then'](function(_0x20afd0){if(_0x20afd0){return[_0x20afd0,![]];}return db['FaxInteraction'][_0xc238('0x47')](_0xa18db)[_0xc238('0x10')](function(_0x548dab){return[_0x548dab,!![]];});});}else{throw new Error(_0xc238('0x48'));}})['spread'](function(_0x11f6b7,_0x383a7b){var _0x546f67=_0x11f6b7[_0xc238('0x49')]({'plain':!![]});if(_0x383a7b){if(_0x4f4a2e[_0xc238('0x3b')][_0xc238('0x4a')]){_0x4f4a2e[_0xc238('0x40')][_0xc238('0x4b')]({'id':0x0,'priority':_0x4f4a2e[_0xc238('0x40')]['length']+0x1,'app':_0xc238('0x4c'),'appdata':_0xc238('0x4d'),'interval':_0xc238('0x4e')});}_0x546f67[_0xc238('0x4f')]=!![];}else{_0x546f67[_0xc238('0x4f')]=![];}_0x4f4a2e[_0xc238('0x50')]=_0x546f67;return db[_0xc238('0x51')][_0xc238('0x47')]({'body':_0x51d2ea[_0xc238('0x26')]['body'],'FaxAccountId':_0x51d2ea[_0xc238('0x3b')]['id'],'FaxInteractionId':_0x11f6b7['id'],'direction':'in','ContactId':_0x11f6b7[_0xc238('0x52')],'AttachmentId':_0x51d2ea['body'][_0xc238('0x53')]});})[_0xc238('0x10')](function(_0x3b19d7){_0x4f4a2e[_0xc238('0x19')]=_0x3b19d7;if(_0x4f4a2e[_0xc238('0x50')][_0xc238('0x54')]){return db['User'][_0xc238('0x3a')]({'attributes':['id','name'],'where':{'id':_0x4f4a2e[_0xc238('0x50')]['UserId']}})['then'](function(_0x43b657){if(_0x43b657){_0x4f4a2e[_0xc238('0x40')][_0xc238('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x43b657[_0xc238('0x56')]+','+(_0x4f4a2e[_0xc238('0x3b')][_0xc238('0x57')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xc238('0x58'),_0xc238('0x59'),_0x4f4a2e);});}return respondWithRpcPromise(_0xc238('0x58'),_0xc238('0x59'),_0x4f4a2e);})[_0xc238('0x10')](function(_0x144848){_0x4d4bf8(_0x144848);})['catch'](function(_0x137e90){_0x5376f5(_0x558dee[_0xc238('0x17')](0x1f4,_0x137e90[_0xc238('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 21f86af..1e44405 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 _0x38b5=['emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x33a1b0,_0x1b1217){var _0x65d239=function(_0x320a0a){while(--_0x320a0a){_0x33a1b0['push'](_0x33a1b0['shift']());}};_0x65d239(++_0x1b1217);}(_0x38b5,0x188));var _0x538b=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x38b5[_0x3e2fcf];return _0x497db7;};'use strict';var FaxAccountEvents=require(_0x538b('0x0'));var events=[_0x538b('0x1'),_0x538b('0x2'),_0x538b('0x3')];function createListener(_0x1b87f1,_0x396d30){return function(_0x3b5087){_0x396d30[_0x538b('0x4')](_0x1b87f1,_0x3b5087);};}function removeListener(_0x5c1ed4,_0x415f24){return function(){FaxAccountEvents[_0x538b('0x5')](_0x5c1ed4,_0x415f24);};}exports[_0x538b('0x6')]=function(_0x1b6e04){for(var _0x2cb255=0x0,_0x36b871=events[_0x538b('0x7')];_0x2cb255<_0x36b871;_0x2cb255++){var _0x6a773b=events[_0x2cb255];var _0x38fe59=createListener(_0x538b('0x8')+_0x6a773b,_0x1b6e04);FaxAccountEvents['on'](_0x6a773b,_0x38fe59);}}; \ No newline at end of file +var _0x42b2=['save','remove','update','removeListener','length','faxAccount:','./faxAccount.events'];(function(_0x4d0daa,_0x424974){var _0x402529=function(_0x47e03d){while(--_0x47e03d){_0x4d0daa['push'](_0x4d0daa['shift']());}};_0x402529(++_0x424974);}(_0x42b2,0xae));var _0x242b=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x42b2[_0x2a6809];return _0x11c371;};'use strict';var FaxAccountEvents=require(_0x242b('0x0'));var events=[_0x242b('0x1'),_0x242b('0x2'),_0x242b('0x3')];function createListener(_0x46731b,_0x1185cc){return function(_0x414ba5){_0x1185cc['emit'](_0x46731b,_0x414ba5);};}function removeListener(_0x1ece9a,_0x221bf3){return function(){FaxAccountEvents[_0x242b('0x4')](_0x1ece9a,_0x221bf3);};}exports['register']=function(_0x498be6){for(var _0x369dd2=0x0,_0x2bfed1=events[_0x242b('0x5')];_0x369dd2<_0x2bfed1;_0x369dd2++){var _0x13ef19=events[_0x369dd2];var _0x29bf1d=createListener(_0x242b('0x6')+_0x13ef19,_0x498be6);FaxAccountEvents['on'](_0x13ef19,_0x29bf1d);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 340511d..b2e3b77 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(_0x4a0cd1,_0x23c60e){var _0x1826d3=function(_0x14f84a){while(--_0x14f84a){_0x4a0cd1['push'](_0x4a0cd1['shift']());}};_0x1826d3(++_0x23c60e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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(_0x276993,_0x340745){var _0x1f6207=function(_0x27e94e){while(--_0x27e94e){_0x276993['push'](_0x276993['shift']());}};_0x1f6207(++_0x340745);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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 b9b58c1..95e25ec 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 _0x9a1c=['exports','INTEGER','STRING','*,*,*,*','sequelize'];(function(_0x5c2f35,_0x1872d2){var _0x4a434d=function(_0x2c2309){while(--_0x2c2309){_0x5c2f35['push'](_0x5c2f35['shift']());}};_0x4a434d(++_0x1872d2);}(_0x9a1c,0x1cb));var _0xc9a1=function(_0x505674,_0x561904){_0x505674=_0x505674-0x0;var _0x4fd89d=_0x9a1c[_0x505674];return _0x4fd89d;};'use strict';var Sequelize=require(_0xc9a1('0x0'));module[_0xc9a1('0x1')]={'priority':{'type':Sequelize[_0xc9a1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xc9a1('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc9a1('0x3')]},'interval':{'type':Sequelize[_0xc9a1('0x3')],'defaultValue':_0xc9a1('0x4')}}; \ No newline at end of file +var _0xf586=['noop','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x47177e,_0x4ea6d0){var _0x477ae8=function(_0x6b5457){while(--_0x6b5457){_0x47177e['push'](_0x47177e['shift']());}};_0x477ae8(++_0x4ea6d0);}(_0xf586,0x1d1));var _0x6f58=function(_0xfee10f,_0x53470e){_0xfee10f=_0xfee10f-0x0;var _0xb91051=_0xf586[_0xfee10f];return _0xb91051;};'use strict';var Sequelize=require(_0x6f58('0x0'));module[_0x6f58('0x1')]={'priority':{'type':Sequelize[_0x6f58('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f58('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6f58('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6f58('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 9f864e5..875b8a9 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 _0x7adc=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','FaxApplication','findAll','rows','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','index','map','rawAttributes','fieldName','type','model'];(function(_0x1857c6,_0x48840c){var _0x51011c=function(_0x3a4736){while(--_0x3a4736){_0x1857c6['push'](_0x1857c6['shift']());}};_0x51011c(++_0x48840c);}(_0x7adc,0x1d6));var _0xc7ad=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x7adc[_0x2085f3];return _0x384e3c;};'use strict';var emlformat=require(_0xc7ad('0x0'));var rimraf=require(_0xc7ad('0x1'));var zipdir=require(_0xc7ad('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc7ad('0x3'));var BPromise=require(_0xc7ad('0x4'));var Mustache=require('mustache');var util=require(_0xc7ad('0x5'));var path=require(_0xc7ad('0x6'));var sox=require(_0xc7ad('0x7'));var csv=require(_0xc7ad('0x8'));var ejs=require(_0xc7ad('0x9'));var fs=require('fs');var fs_extra=require(_0xc7ad('0xa'));var _=require('lodash');var squel=require(_0xc7ad('0xb'));var crypto=require(_0xc7ad('0xc'));var jsforce=require(_0xc7ad('0xd'));var deskjs=require(_0xc7ad('0xe'));var toCsv=require(_0xc7ad('0x8'));var querystring=require(_0xc7ad('0xf'));var Papa=require('papaparse');var Redis=require(_0xc7ad('0x10'));var authService=require(_0xc7ad('0x11'));var qs=require(_0xc7ad('0x12'));var as=require(_0xc7ad('0x13'));var hardwareService=require(_0xc7ad('0x14'));var logger=require(_0xc7ad('0x15'))('api');var utils=require(_0xc7ad('0x16'));var config=require(_0xc7ad('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc7ad('0x18'))['db'];function respondWithStatusCode(_0x338740,_0x34d6c3){_0x34d6c3=_0x34d6c3||0xcc;return function(_0x1dcd50){if(_0x1dcd50){return _0x338740[_0xc7ad('0x19')](_0x34d6c3);}return _0x338740[_0xc7ad('0x1a')](_0x34d6c3)['end']();};}function respondWithResult(_0xf85968,_0xb6532a){_0xb6532a=_0xb6532a||0xc8;return function(_0x27b1ab){if(_0x27b1ab){return _0xf85968['status'](_0xb6532a)[_0xc7ad('0x1b')](_0x27b1ab);}};}function respondWithFilteredResult(_0x3ca710,_0xa8763e){return function(_0x57f81c){if(_0x57f81c){var _0x547de0=typeof _0xa8763e['offset']===_0xc7ad('0x1c')&&typeof _0xa8763e['limit']===_0xc7ad('0x1c');var _0x1c0123=_0x57f81c[_0xc7ad('0x1d')];var _0x4c9da6=_0x547de0?0x0:_0xa8763e[_0xc7ad('0x1e')];var _0x3418a5=_0x547de0?_0x57f81c['count']:_0xa8763e[_0xc7ad('0x1e')]+_0xa8763e[_0xc7ad('0x1f')];var _0x37ee11;if(_0x3418a5>=_0x1c0123){_0x3418a5=_0x1c0123;_0x37ee11=0xc8;}else{_0x37ee11=0xce;}_0x3ca710[_0xc7ad('0x1a')](_0x37ee11);return _0x3ca710[_0xc7ad('0x20')](_0xc7ad('0x21'),_0x4c9da6+'-'+_0x3418a5+'/'+_0x1c0123)['json'](_0x57f81c);}return null;};}function patchUpdates(_0x2c424b){return function(_0x564f6f){try{jsonpatch[_0xc7ad('0x22')](_0x564f6f,_0x2c424b,!![]);}catch(_0x439452){return BPromise[_0xc7ad('0x23')](_0x439452);}return _0x564f6f['save']();};}function saveUpdates(_0x148378,_0x3f17d0){return function(_0x539b00){if(_0x539b00){return _0x539b00[_0xc7ad('0x24')](_0x148378)['then'](function(_0x55d0c2){return _0x55d0c2;});}return null;};}function removeEntity(_0x1f98a6,_0x3ad0bf){return function(_0x1e6a1d){if(_0x1e6a1d){return _0x1e6a1d[_0xc7ad('0x25')]()[_0xc7ad('0x26')](function(){_0x1f98a6[_0xc7ad('0x1a')](0xcc)[_0xc7ad('0x27')]();});}};}function handleEntityNotFound(_0x43ff06,_0x4a501b){return function(_0x41c283){if(!_0x41c283){_0x43ff06['sendStatus'](0x194);}return _0x41c283;};}function handleError(_0x4758ab,_0x523cf8){_0x523cf8=_0x523cf8||0x1f4;return function(_0x3f9238){logger[_0xc7ad('0x28')](_0x3f9238[_0xc7ad('0x29')]);if(_0x3f9238['name']){delete _0x3f9238['name'];}_0x4758ab[_0xc7ad('0x1a')](_0x523cf8)['send'](_0x3f9238);};}exports[_0xc7ad('0x2a')]=function(_0x3eb0d2,_0xb4bec0){var _0x42ce50={},_0x4cfe76={},_0x4faa40={'count':0x0,'rows':[]};var _0x57b8e9=_[_0xc7ad('0x2b')](db['FaxApplication'][_0xc7ad('0x2c')],function(_0x26e17d){return{'name':_0x26e17d[_0xc7ad('0x2d')],'type':_0x26e17d[_0xc7ad('0x2e')]['key']};});_0x4cfe76[_0xc7ad('0x2f')]=_[_0xc7ad('0x2b')](_0x57b8e9,'name');_0x4cfe76[_0xc7ad('0x30')]=_['keys'](_0x3eb0d2[_0xc7ad('0x30')]);_0x4cfe76[_0xc7ad('0x31')]=_[_0xc7ad('0x32')](_0x4cfe76[_0xc7ad('0x2f')],_0x4cfe76['query']);_0x42ce50[_0xc7ad('0x33')]=_[_0xc7ad('0x32')](_0x4cfe76[_0xc7ad('0x2f')],qs['fields'](_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x34')]));_0x42ce50[_0xc7ad('0x33')]=_0x42ce50[_0xc7ad('0x33')][_0xc7ad('0x35')]?_0x42ce50['attributes']:_0x4cfe76[_0xc7ad('0x2f')];if(!_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x36')](_0xc7ad('0x37'))){_0x42ce50[_0xc7ad('0x1f')]=qs['limit'](_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x1f')]);_0x42ce50['offset']=qs['offset'](_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x1e')]);}_0x42ce50[_0xc7ad('0x38')]=qs[_0xc7ad('0x39')](_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x39')]);_0x42ce50[_0xc7ad('0x3a')]=qs['filters'](_[_0xc7ad('0x3b')](_0x3eb0d2[_0xc7ad('0x30')],_0x4cfe76['filters']),_0x57b8e9);if(_0x3eb0d2[_0xc7ad('0x30')]['filter']){_0x42ce50[_0xc7ad('0x3a')]=_[_0xc7ad('0x3c')](_0x42ce50['where'],{'$or':_[_0xc7ad('0x2b')](_0x57b8e9,function(_0x4be6e5){if(_0x4be6e5['type']!==_0xc7ad('0x3d')){var _0x1afef6={};_0x1afef6[_0x4be6e5['name']]={'$like':'%'+_0x3eb0d2[_0xc7ad('0x30')][_0xc7ad('0x3e')]+'%'};return _0x1afef6;}})});}_0x42ce50=_[_0xc7ad('0x3c')]({},_0x42ce50,_0x3eb0d2[_0xc7ad('0x3f')]);var _0x9dbb62={'where':_0x42ce50['where']};return db['FaxApplication'][_0xc7ad('0x1d')](_0x9dbb62)[_0xc7ad('0x26')](function(_0x4cddaf){_0x4faa40['count']=_0x4cddaf;if(_0x3eb0d2[_0xc7ad('0x30')]['includeAll']){_0x42ce50[_0xc7ad('0x40')]=[{'all':!![]}];}return db[_0xc7ad('0x41')][_0xc7ad('0x42')](_0x42ce50);})[_0xc7ad('0x26')](function(_0x3bdff9){_0x4faa40[_0xc7ad('0x43')]=_0x3bdff9;return _0x4faa40;})[_0xc7ad('0x26')](respondWithFilteredResult(_0xb4bec0,_0x42ce50))['catch'](handleError(_0xb4bec0,null));};exports['show']=function(_0x27fedd,_0x5b48fb){var _0x13d190={'raw':!![],'where':{'id':_0x27fedd[_0xc7ad('0x44')]['id']}},_0x4975d5={};_0x4975d5['model']=_['keys'](db[_0xc7ad('0x41')][_0xc7ad('0x2c')]);_0x4975d5['query']=_['keys'](_0x27fedd[_0xc7ad('0x30')]);_0x4975d5['filters']=_['intersection'](_0x4975d5[_0xc7ad('0x2f')],_0x4975d5[_0xc7ad('0x30')]);_0x13d190['attributes']=_[_0xc7ad('0x32')](_0x4975d5[_0xc7ad('0x2f')],qs['fields'](_0x27fedd[_0xc7ad('0x30')][_0xc7ad('0x34')]));_0x13d190[_0xc7ad('0x33')]=_0x13d190[_0xc7ad('0x33')][_0xc7ad('0x35')]?_0x13d190[_0xc7ad('0x33')]:_0x4975d5['model'];if(_0x27fedd[_0xc7ad('0x30')][_0xc7ad('0x45')]){_0x13d190[_0xc7ad('0x40')]=[{'all':!![]}];}_0x13d190=_[_0xc7ad('0x3c')]({},_0x13d190,_0x27fedd[_0xc7ad('0x3f')]);return db[_0xc7ad('0x41')][_0xc7ad('0x46')](_0x13d190)[_0xc7ad('0x26')](handleEntityNotFound(_0x5b48fb,null))[_0xc7ad('0x26')](respondWithResult(_0x5b48fb,null))[_0xc7ad('0x47')](handleError(_0x5b48fb,null));};exports[_0xc7ad('0x48')]=function(_0x23fa75,_0x3d5565){return db['FaxApplication'][_0xc7ad('0x48')](_0x23fa75[_0xc7ad('0x49')],{})[_0xc7ad('0x26')](respondWithResult(_0x3d5565,0xc9))['catch'](handleError(_0x3d5565,null));};exports['update']=function(_0x3e0f5d,_0x1e4fa3){if(_0x3e0f5d[_0xc7ad('0x49')]['id']){delete _0x3e0f5d['body']['id'];}return db[_0xc7ad('0x41')][_0xc7ad('0x46')]({'where':{'id':_0x3e0f5d[_0xc7ad('0x44')]['id']}})[_0xc7ad('0x26')](handleEntityNotFound(_0x1e4fa3,null))['then'](saveUpdates(_0x3e0f5d['body'],null))[_0xc7ad('0x26')](respondWithResult(_0x1e4fa3,null))[_0xc7ad('0x47')](handleError(_0x1e4fa3,null));};exports[_0xc7ad('0x25')]=function(_0x21578c,_0x28cb44){return db[_0xc7ad('0x41')][_0xc7ad('0x46')]({'where':{'id':_0x21578c[_0xc7ad('0x44')]['id']}})[_0xc7ad('0x26')](handleEntityNotFound(_0x28cb44,null))['then'](removeEntity(_0x28cb44,null))[_0xc7ad('0x47')](handleError(_0x28cb44,null));}; \ No newline at end of file +var _0x607b=['includeAll','include','findAll','rows','catch','create','body','params','find','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','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0x607b,0x131));var _0xb607=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x607b[_0x42245d];return _0x4b211a;};'use strict';var emlformat=require(_0xb607('0x0'));var rimraf=require(_0xb607('0x1'));var zipdir=require(_0xb607('0x2'));var jsonpatch=require(_0xb607('0x3'));var rp=require(_0xb607('0x4'));var moment=require(_0xb607('0x5'));var BPromise=require(_0xb607('0x6'));var Mustache=require(_0xb607('0x7'));var util=require('util');var path=require(_0xb607('0x8'));var sox=require(_0xb607('0x9'));var csv=require(_0xb607('0xa'));var ejs=require(_0xb607('0xb'));var fs=require('fs');var fs_extra=require(_0xb607('0xc'));var _=require(_0xb607('0xd'));var squel=require('squel');var crypto=require(_0xb607('0xe'));var jsforce=require(_0xb607('0xf'));var deskjs=require(_0xb607('0x10'));var toCsv=require(_0xb607('0xa'));var querystring=require(_0xb607('0x11'));var Papa=require('papaparse');var Redis=require(_0xb607('0x12'));var authService=require(_0xb607('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb607('0x14'));var logger=require('../../config/logger')(_0xb607('0x15'));var utils=require(_0xb607('0x16'));var config=require(_0xb607('0x17'));var licenseUtil=require(_0xb607('0x18'));var db=require(_0xb607('0x19'))['db'];function respondWithStatusCode(_0x5d7db1,_0x14ba53){_0x14ba53=_0x14ba53||0xcc;return function(_0x3c36a4){if(_0x3c36a4){return _0x5d7db1[_0xb607('0x1a')](_0x14ba53);}return _0x5d7db1[_0xb607('0x1b')](_0x14ba53)[_0xb607('0x1c')]();};}function respondWithResult(_0x3a2bb5,_0x3b7a4c){_0x3b7a4c=_0x3b7a4c||0xc8;return function(_0x1f3cf6){if(_0x1f3cf6){return _0x3a2bb5['status'](_0x3b7a4c)['json'](_0x1f3cf6);}};}function respondWithFilteredResult(_0x3d3ff3,_0x4f0e3e){return function(_0x1c38a4){if(_0x1c38a4){var _0x18e081=typeof _0x4f0e3e['offset']===_0xb607('0x1d')&&typeof _0x4f0e3e[_0xb607('0x1e')]===_0xb607('0x1d');var _0x73bf9=_0x1c38a4[_0xb607('0x1f')];var _0x5bd0d0=_0x18e081?0x0:_0x4f0e3e[_0xb607('0x20')];var _0x780547=_0x18e081?_0x1c38a4[_0xb607('0x1f')]:_0x4f0e3e[_0xb607('0x20')]+_0x4f0e3e[_0xb607('0x1e')];var _0x4cbca3;if(_0x780547>=_0x73bf9){_0x780547=_0x73bf9;_0x4cbca3=0xc8;}else{_0x4cbca3=0xce;}_0x3d3ff3['status'](_0x4cbca3);return _0x3d3ff3[_0xb607('0x21')](_0xb607('0x22'),_0x5bd0d0+'-'+_0x780547+'/'+_0x73bf9)[_0xb607('0x23')](_0x1c38a4);}return null;};}function patchUpdates(_0x21507a){return function(_0x1206c1){try{jsonpatch[_0xb607('0x24')](_0x1206c1,_0x21507a,!![]);}catch(_0x48472c){return BPromise['reject'](_0x48472c);}return _0x1206c1[_0xb607('0x25')]();};}function saveUpdates(_0x2a4df7,_0x1e0229){return function(_0x12fdd9){if(_0x12fdd9){return _0x12fdd9[_0xb607('0x26')](_0x2a4df7)[_0xb607('0x27')](function(_0x338a08){return _0x338a08;});}return null;};}function removeEntity(_0x3680e5,_0x4fa1b9){return function(_0x17465b){if(_0x17465b){return _0x17465b[_0xb607('0x28')]()[_0xb607('0x27')](function(){_0x3680e5[_0xb607('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25d493,_0x46a568){return function(_0x4aadad){if(!_0x4aadad){_0x25d493['sendStatus'](0x194);}return _0x4aadad;};}function handleError(_0x372410,_0x5cf183){_0x5cf183=_0x5cf183||0x1f4;return function(_0x5d0d32){logger[_0xb607('0x29')](_0x5d0d32['stack']);if(_0x5d0d32[_0xb607('0x2a')]){delete _0x5d0d32[_0xb607('0x2a')];}_0x372410[_0xb607('0x1b')](_0x5cf183)[_0xb607('0x2b')](_0x5d0d32);};}exports['index']=function(_0x54a248,_0x4140bc){var _0xd4acb2={},_0x1cc00e={},_0x4d7b13={'count':0x0,'rows':[]};var _0x22e724=_[_0xb607('0x2c')](db[_0xb607('0x2d')][_0xb607('0x2e')],function(_0x417d05){return{'name':_0x417d05[_0xb607('0x2f')],'type':_0x417d05[_0xb607('0x30')][_0xb607('0x31')]};});_0x1cc00e[_0xb607('0x32')]=_['map'](_0x22e724,_0xb607('0x2a'));_0x1cc00e[_0xb607('0x33')]=_[_0xb607('0x34')](_0x54a248[_0xb607('0x33')]);_0x1cc00e[_0xb607('0x35')]=_['intersection'](_0x1cc00e[_0xb607('0x32')],_0x1cc00e[_0xb607('0x33')]);_0xd4acb2[_0xb607('0x36')]=_[_0xb607('0x37')](_0x1cc00e[_0xb607('0x32')],qs[_0xb607('0x38')](_0x54a248[_0xb607('0x33')][_0xb607('0x38')]));_0xd4acb2[_0xb607('0x36')]=_0xd4acb2[_0xb607('0x36')][_0xb607('0x39')]?_0xd4acb2[_0xb607('0x36')]:_0x1cc00e[_0xb607('0x32')];if(!_0x54a248[_0xb607('0x33')][_0xb607('0x3a')]('nolimit')){_0xd4acb2[_0xb607('0x1e')]=qs[_0xb607('0x1e')](_0x54a248[_0xb607('0x33')]['limit']);_0xd4acb2[_0xb607('0x20')]=qs[_0xb607('0x20')](_0x54a248[_0xb607('0x33')][_0xb607('0x20')]);}_0xd4acb2['order']=qs[_0xb607('0x3b')](_0x54a248[_0xb607('0x33')][_0xb607('0x3b')]);_0xd4acb2[_0xb607('0x3c')]=qs[_0xb607('0x35')](_[_0xb607('0x3d')](_0x54a248[_0xb607('0x33')],_0x1cc00e[_0xb607('0x35')]),_0x22e724);if(_0x54a248[_0xb607('0x33')][_0xb607('0x3e')]){_0xd4acb2[_0xb607('0x3c')]=_[_0xb607('0x3f')](_0xd4acb2[_0xb607('0x3c')],{'$or':_['map'](_0x22e724,function(_0x274be4){if(_0x274be4['type']!=='VIRTUAL'){var _0x5eeadc={};_0x5eeadc[_0x274be4[_0xb607('0x2a')]]={'$like':'%'+_0x54a248[_0xb607('0x33')][_0xb607('0x3e')]+'%'};return _0x5eeadc;}})});}_0xd4acb2=_[_0xb607('0x3f')]({},_0xd4acb2,_0x54a248[_0xb607('0x40')]);var _0x4caf23={'where':_0xd4acb2[_0xb607('0x3c')]};return db['FaxApplication'][_0xb607('0x1f')](_0x4caf23)[_0xb607('0x27')](function(_0x3a3bf1){_0x4d7b13['count']=_0x3a3bf1;if(_0x54a248['query'][_0xb607('0x41')]){_0xd4acb2[_0xb607('0x42')]=[{'all':!![]}];}return db[_0xb607('0x2d')][_0xb607('0x43')](_0xd4acb2);})[_0xb607('0x27')](function(_0x360a83){_0x4d7b13[_0xb607('0x44')]=_0x360a83;return _0x4d7b13;})[_0xb607('0x27')](respondWithFilteredResult(_0x4140bc,_0xd4acb2))[_0xb607('0x45')](handleError(_0x4140bc,null));};exports['show']=function(_0x53b667,_0x2cc7fb){var _0x47262d={'raw':!![],'where':{'id':_0x53b667['params']['id']}},_0x46f07f={};_0x46f07f[_0xb607('0x32')]=_[_0xb607('0x34')](db[_0xb607('0x2d')]['rawAttributes']);_0x46f07f[_0xb607('0x33')]=_[_0xb607('0x34')](_0x53b667[_0xb607('0x33')]);_0x46f07f['filters']=_[_0xb607('0x37')](_0x46f07f['model'],_0x46f07f[_0xb607('0x33')]);_0x47262d[_0xb607('0x36')]=_[_0xb607('0x37')](_0x46f07f['model'],qs[_0xb607('0x38')](_0x53b667['query'][_0xb607('0x38')]));_0x47262d[_0xb607('0x36')]=_0x47262d['attributes'][_0xb607('0x39')]?_0x47262d[_0xb607('0x36')]:_0x46f07f[_0xb607('0x32')];if(_0x53b667[_0xb607('0x33')][_0xb607('0x41')]){_0x47262d['include']=[{'all':!![]}];}_0x47262d=_['merge']({},_0x47262d,_0x53b667[_0xb607('0x40')]);return db[_0xb607('0x2d')]['find'](_0x47262d)[_0xb607('0x27')](handleEntityNotFound(_0x2cc7fb,null))[_0xb607('0x27')](respondWithResult(_0x2cc7fb,null))['catch'](handleError(_0x2cc7fb,null));};exports[_0xb607('0x46')]=function(_0x362826,_0x373236){return db[_0xb607('0x2d')][_0xb607('0x46')](_0x362826[_0xb607('0x47')],{})[_0xb607('0x27')](respondWithResult(_0x373236,0xc9))[_0xb607('0x45')](handleError(_0x373236,null));};exports[_0xb607('0x26')]=function(_0x4dc196,_0x5c5f71){if(_0x4dc196['body']['id']){delete _0x4dc196['body']['id'];}return db['FaxApplication']['find']({'where':{'id':_0x4dc196[_0xb607('0x48')]['id']}})[_0xb607('0x27')](handleEntityNotFound(_0x5c5f71,null))[_0xb607('0x27')](saveUpdates(_0x4dc196[_0xb607('0x47')],null))['then'](respondWithResult(_0x5c5f71,null))[_0xb607('0x45')](handleError(_0x5c5f71,null));};exports[_0xb607('0x28')]=function(_0x2afd7b,_0x4f2583){return db[_0xb607('0x2d')][_0xb607('0x49')]({'where':{'id':_0x2afd7b[_0xb607('0x48')]['id']}})[_0xb607('0x27')](handleEntityNotFound(_0x4f2583,null))['then'](removeEntity(_0x4f2583,null))['catch'](handleError(_0x4f2583,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 772bd18..b706a82 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 _0x93cb=['FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./faxApplication.attributes','exports','define'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0x93cb,0x19a));var _0xb93c=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x93cb[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xb93c('0x0'));var util=require(_0xb93c('0x1'));var logger=require(_0xb93c('0x2'))('api');var moment=require(_0xb93c('0x3'));var BPromise=require(_0xb93c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb93c('0x5'));var rimraf=require('rimraf');var config=require(_0xb93c('0x6'));var attributes=require(_0xb93c('0x7'));module[_0xb93c('0x8')]=function(_0x54df71,_0x9ff58a){return _0x54df71[_0xb93c('0x9')](_0xb93c('0xa'),attributes,{'tableName':_0xb93c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb93c('0xc'),'collate':_0xb93c('0xd')});}; \ No newline at end of file +var _0x5c40=['api','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x5af6d8,_0x51857c){var _0x441d0a=function(_0x2eddba){while(--_0x2eddba){_0x5af6d8['push'](_0x5af6d8['shift']());}};_0x441d0a(++_0x51857c);}(_0x5c40,0x15e));var _0x05c4=function(_0x567e9e,_0x37ca69){_0x567e9e=_0x567e9e-0x0;var _0x2de44e=_0x5c40[_0x567e9e];return _0x2de44e;};'use strict';var _=require('lodash');var util=require(_0x05c4('0x0'));var logger=require(_0x05c4('0x1'))(_0x05c4('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('rimraf');var config=require(_0x05c4('0x3'));var attributes=require(_0x05c4('0x4'));module[_0x05c4('0x5')]=function(_0x23164b,_0x2df004){return _0x23164b[_0x05c4('0x6')](_0x05c4('0x7'),attributes,{'tableName':_0x05c4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x05c4('0x9'),'collate':_0x05c4('0xa')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 3ee4cf7..0dc45af 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 _0x438d=['options','raw','where','attributes','catch','lodash','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0x438d,0x161));var _0xd438=function(_0x1c2434,_0x28868c){_0x1c2434=_0x1c2434-0x0;var _0x3a601=_0x438d[_0x1c2434];return _0x3a601;};'use strict';var _=require(_0xd438('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd438('0x1'));var db=require(_0xd438('0x2'))['db'];var utils=require(_0xd438('0x3'));var logger=require('../../config/logger')(_0xd438('0x4'));var config=require(_0xd438('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd438('0x6')][_0xd438('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x285a18,_0x36ab5e,_0x1b61a2){return new BPromise(function(_0x186e77,_0x219560){return client[_0xd438('0x8')](_0x285a18,_0x1b61a2)[_0xd438('0x9')](function(_0x21107d){logger[_0xd438('0xa')](_0xd438('0xb'),_0x36ab5e,_0xd438('0xc'));logger[_0xd438('0xd')](_0xd438('0xe'),_0x36ab5e,_0xd438('0xc'),JSON[_0xd438('0xf')](_0x21107d));if(_0x21107d[_0xd438('0x10')]){if(_0x21107d[_0xd438('0x10')][_0xd438('0x11')]===0x1f4){logger[_0xd438('0x10')](_0xd438('0xb'),_0x36ab5e,_0x21107d['error'][_0xd438('0x12')]);return _0x219560(_0x21107d[_0xd438('0x10')]['message']);}logger[_0xd438('0x10')](_0xd438('0xb'),_0x36ab5e,_0x21107d[_0xd438('0x10')]['message']);return _0x186e77(_0x21107d[_0xd438('0x10')][_0xd438('0x12')]);}else{logger[_0xd438('0xa')](_0xd438('0xb'),_0x36ab5e,_0xd438('0xc'));_0x186e77(_0x21107d[_0xd438('0x13')][_0xd438('0x12')]);}})['catch'](function(_0x109fb4){logger[_0xd438('0x10')](_0xd438('0xb'),_0x36ab5e,_0x109fb4);_0x219560(_0x109fb4);});});}exports[_0xd438('0x14')]=function(_0x160df3){var _0xb24217=this;return new Promise(function(_0x483bd2,_0x252e13){return db[_0xd438('0x15')][_0xd438('0x16')](_0x160df3[_0xd438('0x17')],{'raw':_0x160df3[_0xd438('0x18')]?_0x160df3[_0xd438('0x18')][_0xd438('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x160df3['options']?_0x160df3[_0xd438('0x18')][_0xd438('0x1a')]||null:null,'attributes':_0x160df3[_0xd438('0x18')]?_0x160df3[_0xd438('0x18')][_0xd438('0x1b')]||null:null,'limit':_0x160df3[_0xd438('0x18')]?_0x160df3['options']['limit']||null:null})[_0xd438('0x9')](function(_0x43244f){logger[_0xd438('0xa')](_0xd438('0x14'),_0x160df3);logger['debug'](_0xd438('0x14'),_0x160df3,JSON['stringify'](_0x43244f));_0x483bd2(_0x43244f);})[_0xd438('0x1c')](function(_0x15bb16){logger['error']('UpdateFaxApplication',_0x15bb16[_0xd438('0x12')],_0x160df3);_0x252e13(_0xb24217[_0xd438('0x10')](0x1f4,_0x15bb16[_0xd438('0x12')]));});});}; \ No newline at end of file +var _0x49e5=['request\x20sent','debug','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info'];(function(_0x4f72d8,_0x470fd7){var _0x44ef7a=function(_0x4a36d2){while(--_0x4a36d2){_0x4f72d8['push'](_0x4f72d8['shift']());}};_0x44ef7a(++_0x470fd7);}(_0x49e5,0x196));var _0x549e=function(_0x10711b,_0x439ba6){_0x10711b=_0x10711b-0x0;var _0x3955ff=_0x49e5[_0x10711b];return _0x3955ff;};'use strict';var _=require(_0x549e('0x0'));var util=require(_0x549e('0x1'));var moment=require(_0x549e('0x2'));var BPromise=require(_0x549e('0x3'));var rs=require(_0x549e('0x4'));var fs=require('fs');var Redis=require(_0x549e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x549e('0x6'));var logger=require(_0x549e('0x7'))(_0x549e('0x8'));var config=require(_0x549e('0x9'));var jayson=require(_0x549e('0xa'));var client=jayson['client'][_0x549e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ee59d,_0x1f22c7,_0x4c0e06){return new BPromise(function(_0x4baf3c,_0x16bde3){return client['request'](_0x2ee59d,_0x4c0e06)[_0x549e('0xc')](function(_0x4ced36){logger[_0x549e('0xd')]('FaxApplication,\x20%s,\x20%s',_0x1f22c7,_0x549e('0xe'));logger[_0x549e('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x1f22c7,'request\x20sent',JSON[_0x549e('0x10')](_0x4ced36));if(_0x4ced36['error']){if(_0x4ced36[_0x549e('0x11')][_0x549e('0x12')]===0x1f4){logger['error'](_0x549e('0x13'),_0x1f22c7,_0x4ced36[_0x549e('0x11')][_0x549e('0x14')]);return _0x16bde3(_0x4ced36[_0x549e('0x11')]['message']);}logger[_0x549e('0x11')](_0x549e('0x13'),_0x1f22c7,_0x4ced36[_0x549e('0x11')][_0x549e('0x14')]);return _0x4baf3c(_0x4ced36[_0x549e('0x11')]['message']);}else{logger[_0x549e('0xd')](_0x549e('0x13'),_0x1f22c7,_0x549e('0xe'));_0x4baf3c(_0x4ced36[_0x549e('0x15')][_0x549e('0x14')]);}})[_0x549e('0x16')](function(_0x31183c){logger['error'](_0x549e('0x13'),_0x1f22c7,_0x31183c);_0x16bde3(_0x31183c);});});}exports[_0x549e('0x17')]=function(_0x209c5b){var _0x2d858d=this;return new Promise(function(_0xd0ac55,_0x1763a5){return db['FaxApplication']['update'](_0x209c5b[_0x549e('0x18')],{'raw':_0x209c5b[_0x549e('0x19')]?_0x209c5b[_0x549e('0x19')][_0x549e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x209c5b[_0x549e('0x19')]?_0x209c5b[_0x549e('0x19')][_0x549e('0x1b')]||null:null,'attributes':_0x209c5b[_0x549e('0x19')]?_0x209c5b[_0x549e('0x19')][_0x549e('0x1c')]||null:null,'limit':_0x209c5b[_0x549e('0x19')]?_0x209c5b[_0x549e('0x19')][_0x549e('0x1d')]||null:null})[_0x549e('0xc')](function(_0x441457){logger[_0x549e('0xd')](_0x549e('0x17'),_0x209c5b);logger[_0x549e('0xf')]('UpdateFaxApplication',_0x209c5b,JSON[_0x549e('0x10')](_0x441457));_0xd0ac55(_0x441457);})[_0x549e('0x16')](function(_0x261a92){logger[_0x549e('0x11')](_0x549e('0x17'),_0x261a92['message'],_0x209c5b);_0x1763a5(_0x2d858d[_0x549e('0x11')](0x1f4,_0x261a92[_0x549e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 208e38d..a1edb3f 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 _0x4cf8=['show','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x4d230c,_0x3862fd){_0x4d230c=_0x4d230c-0x0;var _0x16b044=_0x4cf8[_0x4d230c];return _0x16b044;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0xe')]);router['put'](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router[_0x84cf('0x11')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb62e=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','show','post','/:id','update','delete','destroy','exports','multer','util'];(function(_0x37b768,_0x349d37){var _0x7ce433=function(_0x19913f){while(--_0x19913f){_0x37b768['push'](_0x37b768['shift']());}};_0x7ce433(++_0x349d37);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var path=require(_0xeb62('0x2'));var timeout=require(_0xeb62('0x3'));var express=require('express');var router=express[_0xeb62('0x4')]();var fs_extra=require(_0xeb62('0x5'));var auth=require(_0xeb62('0x6'));var interaction=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var controller=require(_0xeb62('0x9'));router['get']('/',auth[_0xeb62('0xa')](),controller[_0xeb62('0xb')]);router[_0xeb62('0xc')]('/:id',auth[_0xeb62('0xa')](),controller[_0xeb62('0xd')]);router[_0xeb62('0xe')]('/',auth[_0xeb62('0xa')](),controller['create']);router['put'](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x10')]);router[_0xeb62('0x11')](_0xeb62('0xf'),auth[_0xeb62('0xa')](),controller[_0xeb62('0x12')]);module[_0xeb62('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index f2bb172..ebc3af2 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 _0x6299=['ENUM','out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0xed158b,_0x5ab842){var _0x485232=function(_0x5b50e1){while(--_0x5b50e1){_0xed158b['push'](_0xed158b['shift']());}};_0x485232(++_0x5ab842);}(_0x6299,0x1d7));var _0x9629=function(_0x24e505,_0x5616fe){_0x24e505=_0x24e505-0x0;var _0x206815=_0x6299[_0x24e505];return _0x206815;};'use strict';var Sequelize=require(_0x9629('0x0'));module[_0x9629('0x1')]={'closed':{'type':Sequelize[_0x9629('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9629('0x3')]},'disposition':{'type':Sequelize[_0x9629('0x4')]},'secondDisposition':{'type':Sequelize[_0x9629('0x4')]},'thirdDisposition':{'type':Sequelize[_0x9629('0x4')]},'note':{'type':Sequelize[_0x9629('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x9629('0x5')]('in',_0x9629('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9629('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x9629('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7258=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0xb60781,_0x24e11c){var _0x1b2329=function(_0x5b9764){while(--_0x5b9764){_0xb60781['push'](_0xb60781['shift']());}};_0x1b2329(++_0x24e11c);}(_0x7258,0x127));var _0x8725=function(_0x1c0269,_0x5cc4b6){_0x1c0269=_0x1c0269-0x0;var _0x473260=_0x7258[_0x1c0269];return _0x473260;};'use strict';var Sequelize=require('sequelize');module[_0x8725('0x0')]={'closed':{'type':Sequelize[_0x8725('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8725('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8725('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8725('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x8725('0x2')]},'fax':{'type':Sequelize[_0x8725('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8725('0x4')]('in',_0x8725('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8725('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'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 d0e7b19..d9f3c9c 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 _0x2935=['util','lodash','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','redis','localhost','./faxInteraction.socket','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','findAll','fax','user','catch','model','keys','FaxInteraction','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','create','body','params','describe','addMessage','ids','findOne','FaxMessage','sort','where','FaxInteractionId','filter','merge','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','resolve','err','unlinkSync','rimraf','zip-dir','moment','bluebird'];(function(_0x3e381c,_0x3e5ae9){var _0x1f4252=function(_0x25f0a3){while(--_0x25f0a3){_0x3e381c['push'](_0x3e381c['shift']());}};_0x1f4252(++_0x3e5ae9);}(_0x2935,0x184));var _0x5293=function(_0x544729,_0x20d30d){_0x544729=_0x544729-0x0;var _0x539484=_0x2935[_0x544729];return _0x539484;};'use strict';var rimraf=require(_0x5293('0x0'));var zipdir=require(_0x5293('0x1'));var moment=require(_0x5293('0x2'));var BPromise=require(_0x5293('0x3'));var util=require(_0x5293('0x4'));var path=require('path');var fs=require('fs');var _=require(_0x5293('0x5'));var Redis=require(_0x5293('0x6'));var interaction=require(_0x5293('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x5293('0x8'))('api');var config=require(_0x5293('0x9'));var db=require('../../mysqldb')['db'];config[_0x5293('0xa')]=_['defaults'](config[_0x5293('0xa')],{'host':_0x5293('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5293('0xa')]));require(_0x5293('0xc'))['register'](socket);function respondWithStatusCode(_0x25c674,_0x2e35f3){_0x2e35f3=_0x2e35f3||0xcc;return function(_0x3ddb15){if(_0x3ddb15){return _0x25c674[_0x5293('0xd')](_0x2e35f3);}return _0x25c674[_0x5293('0xe')](_0x2e35f3)[_0x5293('0xf')]();};}function respondWithResult(_0xf0aeb3,_0x179d43){_0x179d43=_0x179d43||0xc8;return function(_0x27e0d3){if(_0x27e0d3){return _0xf0aeb3[_0x5293('0xe')](_0x179d43)[_0x5293('0x10')](_0x27e0d3);}};}function respondWithFilteredResult(_0x51fcfc,_0x3cb48e){return function(_0x4fde4f){if(_0x4fde4f){var _0x83e0fe=typeof _0x3cb48e['offset']===_0x5293('0x11')&&typeof _0x3cb48e['limit']===_0x5293('0x11');var _0x14c515=_0x4fde4f['count'];var _0x1a2138=_0x83e0fe?0x0:_0x3cb48e[_0x5293('0x12')];var _0x5bf7b1=_0x83e0fe?_0x4fde4f[_0x5293('0x13')]:_0x3cb48e[_0x5293('0x12')]+_0x3cb48e[_0x5293('0x14')];var _0x440f56;if(_0x5bf7b1>=_0x14c515){_0x5bf7b1=_0x14c515;_0x440f56=0xc8;}else{_0x440f56=0xce;}_0x51fcfc[_0x5293('0xe')](_0x440f56);return _0x51fcfc[_0x5293('0x15')](_0x5293('0x16'),_0x1a2138+'-'+_0x5bf7b1+'/'+_0x14c515)[_0x5293('0x10')](_0x4fde4f);}return null;};}function saveUpdates(_0x5a8b54){return function(_0x564163){if(_0x564163){return _0x564163[_0x5293('0x17')](_0x5a8b54)[_0x5293('0x18')](function(_0xac346d){return _0xac346d;});}return null;};}function removeEntity(_0x5c6941){return function(_0x4f7d73){if(_0x4f7d73){return _0x4f7d73[_0x5293('0x19')]()['then'](function(){_0x5c6941[_0x5293('0xe')](0xcc)[_0x5293('0xf')]();});}};}function handleEntityNotFound(_0x4368bf){return function(_0x4d8bfe){if(!_0x4d8bfe){_0x4368bf['sendStatus'](0x194);}return _0x4d8bfe;};}function handleError(_0x468d2e,_0x1b71f2){_0x1b71f2=_0x1b71f2||0x1f4;return function(_0x5c23a9){logger[_0x5293('0x1a')](_0x5c23a9[_0x5293('0x1b')]);if(_0x5c23a9[_0x5293('0x1c')]){delete _0x5c23a9[_0x5293('0x1c')];}_0x468d2e[_0x5293('0xe')](_0x1b71f2)[_0x5293('0x1d')](_0x5c23a9);};}exports[_0x5293('0x1e')]=function(_0x2b6001,_0x441e92){var _0x594446={};var _0x166e40=_[_0x5293('0x1f')](db['FaxInteraction'][_0x5293('0x20')],function(_0x42d99b){return{'name':_0x42d99b[_0x5293('0x21')],'type':_0x42d99b[_0x5293('0x22')]['key']};});_0x594446=qs[_0x5293('0x23')](_0x166e40,_0x2b6001);return interaction[_0x5293('0x24')](_0x5293('0x25'),_0x2b6001['query'],_0x2b6001[_0x5293('0x26')],_0x594446,_0x166e40)['then'](respondWithFilteredResult(_0x441e92,_0x594446))[_0x5293('0x27')](handleError(_0x441e92,null));};exports['show']=function(_0x12feeb,_0x59052e){var _0x7c7f78={'raw':![],'where':{'id':_0x12feeb['params']['id']}},_0x4be98c={};_0x4be98c[_0x5293('0x28')]=_[_0x5293('0x29')](db[_0x5293('0x2a')][_0x5293('0x20')]);_0x4be98c[_0x5293('0x2b')]=_[_0x5293('0x29')](_0x12feeb[_0x5293('0x2b')]);_0x4be98c[_0x5293('0x2c')]=_[_0x5293('0x2d')](_0x4be98c[_0x5293('0x28')],_0x4be98c[_0x5293('0x2b')]);_0x7c7f78[_0x5293('0x2e')]=_['intersection'](_0x4be98c[_0x5293('0x28')],qs['fields'](_0x12feeb[_0x5293('0x2b')][_0x5293('0x2f')]));_0x7c7f78['attributes']=_0x7c7f78[_0x5293('0x2e')][_0x5293('0x30')]?_0x7c7f78[_0x5293('0x2e')]:_0x4be98c[_0x5293('0x28')];if(_0x12feeb[_0x5293('0x2b')][_0x5293('0x31')]){_0x7c7f78[_0x5293('0x32')]=[{'all':!![]}];}_0x7c7f78=_['merge']({},_0x7c7f78,_0x12feeb[_0x5293('0x33')]);return db[_0x5293('0x2a')][_0x5293('0x34')](_0x7c7f78)[_0x5293('0x18')](handleEntityNotFound(_0x59052e,null))['then'](respondWithResult(_0x59052e,null))[_0x5293('0x27')](handleError(_0x59052e,null));};exports[_0x5293('0x35')]=function(_0x19848b,_0x5468d3){return db[_0x5293('0x2a')][_0x5293('0x35')](_0x19848b[_0x5293('0x36')],{})['then'](respondWithResult(_0x5468d3,0xc9))[_0x5293('0x27')](handleError(_0x5468d3,null));};exports[_0x5293('0x17')]=function(_0x48f727,_0x3368ba){if(_0x48f727[_0x5293('0x36')]['id']){delete _0x48f727['body']['id'];}return db[_0x5293('0x2a')][_0x5293('0x34')]({'where':{'id':_0x48f727[_0x5293('0x37')]['id']}})[_0x5293('0x18')](handleEntityNotFound(_0x3368ba,null))['then'](saveUpdates(_0x48f727[_0x5293('0x36')],null))['then'](respondWithResult(_0x3368ba,null))[_0x5293('0x27')](handleError(_0x3368ba,null));};exports[_0x5293('0x19')]=function(_0x2ccbf8,_0x35fdca){return db['FaxInteraction']['find']({'where':{'id':_0x2ccbf8['params']['id']}})[_0x5293('0x18')](handleEntityNotFound(_0x35fdca,null))['then'](removeEntity(_0x35fdca,null))['catch'](handleError(_0x35fdca,null));};exports[_0x5293('0x38')]=function(_0x48b514,_0x2bc7e2){return db[_0x5293('0x2a')][_0x5293('0x38')]()[_0x5293('0x18')](respondWithResult(_0x2bc7e2,null))[_0x5293('0x27')](handleError(_0x2bc7e2,null));};exports[_0x5293('0x39')]=function(_0x112bf2,_0xae76db){return db['FaxMessage']['find']({'where':{'id':_0x112bf2[_0x5293('0x37')]['id']}})[_0x5293('0x18')](handleEntityNotFound(_0xae76db,null))[_0x5293('0x18')](function(_0x34e585){if(_0x34e585){return _0x34e585['addMessage'](_0x112bf2[_0x5293('0x36')][_0x5293('0x3a')],_['omit'](_0x112bf2['body'],[_0x5293('0x3a'),'id'])||{});}})[_0x5293('0x18')](respondWithResult(_0xae76db,null))[_0x5293('0x27')](handleError(_0xae76db,null));};exports['getMessages']=function(_0x371b99,_0x1ee6dd){var _0x253b24={'raw':![],'where':{}};var _0x56e658={};var _0x2281cd={'count':0x0,'rows':[]};return db[_0x5293('0x2a')][_0x5293('0x3b')]({'where':{'id':_0x371b99['params']['id']}})[_0x5293('0x18')](handleEntityNotFound(_0x1ee6dd,null))[_0x5293('0x18')](function(_0x1a9e5a){if(_0x1a9e5a){_0x56e658[_0x5293('0x28')]=_[_0x5293('0x29')](db[_0x5293('0x3c')][_0x5293('0x20')]);_0x56e658[_0x5293('0x2b')]=_[_0x5293('0x29')](_0x371b99[_0x5293('0x2b')]);_0x56e658[_0x5293('0x2c')]=_['intersection'](_0x56e658[_0x5293('0x28')],_0x56e658[_0x5293('0x2b')]);_0x253b24['attributes']=_['intersection'](_0x56e658[_0x5293('0x28')],qs['fields'](_0x371b99['query']['fields']));_0x253b24[_0x5293('0x2e')]=_0x253b24[_0x5293('0x2e')][_0x5293('0x30')]?_0x253b24[_0x5293('0x2e')]:_0x56e658[_0x5293('0x28')];if(!_0x371b99[_0x5293('0x2b')]['hasOwnProperty']('nolimit')){_0x253b24[_0x5293('0x14')]=qs[_0x5293('0x14')](_0x371b99[_0x5293('0x2b')]['limit']);_0x253b24[_0x5293('0x12')]=qs['offset'](_0x371b99[_0x5293('0x2b')][_0x5293('0x12')]);}_0x253b24['order']=qs[_0x5293('0x3d')](_0x371b99['query'][_0x5293('0x3d')]);_0x253b24['where']=qs['filters'](_['pick'](_0x371b99[_0x5293('0x2b')],_0x56e658[_0x5293('0x2c')]));_0x253b24[_0x5293('0x3e')][_0x5293('0x3f')]=_0x1a9e5a['id'];if(_0x371b99['query'][_0x5293('0x40')]){_0x253b24[_0x5293('0x3e')]=_[_0x5293('0x41')](_0x253b24[_0x5293('0x3e')],{'$or':_[_0x5293('0x1f')](_0x253b24[_0x5293('0x2e')],function(_0x41190c){var _0x3e71f9={};_0x3e71f9[_0x41190c]={'$like':'%'+_0x371b99[_0x5293('0x2b')][_0x5293('0x40')]+'%'};return _0x3e71f9;})});}if(_0x371b99['query']['$gte']){var _0x4518b1=_0x371b99[_0x5293('0x2b')][_0x5293('0x42')][_0x5293('0x43')](',');var _0x450caf={};_0x450caf[_0x4518b1[0x0]]={'$gte':moment(_0x4518b1[0x1])['format'](_0x5293('0x44'))};_0x253b24[_0x5293('0x3e')]=_[_0x5293('0x41')](_0x253b24[_0x5293('0x3e')],_0x450caf);}_0x253b24=_[_0x5293('0x41')]({},_0x253b24,_0x371b99[_0x5293('0x33')]);return db['FaxMessage'][_0x5293('0x13')]({'where':_0x253b24['where']})[_0x5293('0x18')](function(_0x4e69b2){_0x2281cd[_0x5293('0x13')]=_0x4e69b2;if(_0x371b99['query'][_0x5293('0x31')]){_0x253b24[_0x5293('0x32')]=[{'all':!![]}];}return db[_0x5293('0x3c')]['findAll'](_0x253b24);})[_0x5293('0x18')](function(_0x1739a3){_0x2281cd[_0x5293('0x45')]=_0x1739a3;return _0x2281cd;});}})['then'](respondWithFilteredResult(_0x1ee6dd,_0x253b24))[_0x5293('0x27')](handleError(_0x1ee6dd,null));};exports['addTags']=function(_0x21f479,_0xd841e7){return db[_0x5293('0x2a')][_0x5293('0x34')]({'where':{'id':_0x21f479[_0x5293('0x37')]['id']}})['then'](handleEntityNotFound(_0xd841e7,null))[_0x5293('0x18')](function(_0x14fae7){if(_0x14fae7){return _0x14fae7[_0x5293('0x46')](_0x21f479[_0x5293('0x36')][_0x5293('0x3a')],_[_0x5293('0x47')](_0x21f479[_0x5293('0x36')],[_0x5293('0x3a'),'id'])||{})[_0x5293('0x48')](function(){return db['Tag'][_0x5293('0x24')]({'attributes':['id','name','color'],'where':{'id':_0x21f479[_0x5293('0x36')][_0x5293('0x3a')]}});})[_0x5293('0x18')](function(_0x3ba09e){socket[_0x5293('0x49')](_0x5293('0x4a'),{'id':Number(_0x21f479[_0x5293('0x37')]['id']),'tags':_0x3ba09e||[]});return{'id':Number(_0x21f479[_0x5293('0x37')]['id']),'tags':_0x3ba09e||[]};});}})[_0x5293('0x18')](respondWithResult(_0xd841e7,null))[_0x5293('0x27')](handleError(_0xd841e7,null));};exports['removeTags']=function(_0x174a72,_0x2214cd){return db['FaxInteraction'][_0x5293('0x34')]({'where':{'id':_0x174a72[_0x5293('0x37')]['id']}})[_0x5293('0x18')](handleEntityNotFound(_0x2214cd,null))[_0x5293('0x18')](function(_0x433eac){if(_0x433eac){return _0x433eac[_0x5293('0x4b')](_0x174a72[_0x5293('0x2b')][_0x5293('0x3a')]);}})[_0x5293('0x18')](respondWithStatusCode(_0x2214cd,null))[_0x5293('0x27')](handleError(_0x2214cd,null));};exports[_0x5293('0x4c')]=function(_0x33bf23,_0x51ff2a){var _0x4b3ba0=moment()[_0x5293('0x4d')]()['toString']();var _0xbe24ad=path[_0x5293('0x4e')](config[_0x5293('0x4f')],_0x5293('0x50'),'files',_0x5293('0x51'));var _0x17ae22=path[_0x5293('0x4e')](config['root'],_0x5293('0x50'),_0x5293('0x52'),_0x5293('0x53'));var _0x1f9b27=path[_0x5293('0x4e')](_0xbe24ad,_0x4b3ba0);var _0x582c5c=util[_0x5293('0x54')](_0x5293('0x55'),_0x33bf23[_0x5293('0x37')]['id'],_0x4b3ba0);var _0xd6f786=path[_0x5293('0x4e')](_0xbe24ad,_0x582c5c);var _0x599a2f=[];_0x599a2f[_0x5293('0x56')]({'model':db[_0x5293('0x57')],'as':_0x5293('0x57'),'raw':!![]});var _0x5f3bae=[{'model':db[_0x5293('0x3c')],'as':_0x5293('0x58'),'attributes':['id','body','createdAt'],'include':_0x599a2f}];return db[_0x5293('0x2a')]['find']({'where':{'id':_0x33bf23[_0x5293('0x37')]['id']},'include':_0x5f3bae})[_0x5293('0x18')](handleEntityNotFound(_0x51ff2a,null))['then'](function(_0x44e0b1){if(_0x44e0b1&&_0x44e0b1[_0x5293('0x58')]){var _0x2fef69=_0x44e0b1[_0x5293('0x59')]({'plain':!![]});fs[_0x5293('0x5a')](_0x1f9b27);for(var _0x468924=0x0;_0x468924<_0x2fef69[_0x5293('0x58')][_0x5293('0x30')];_0x468924++){var _0x158470=_0x2fef69[_0x5293('0x58')][_0x468924][_0x5293('0x57')];if(_0x158470){var _0x18147=path[_0x5293('0x4e')](_0x17ae22,_0x158470[_0x5293('0x5b')]);if(fs[_0x5293('0x5c')](_0x18147)){fs[_0x5293('0x5d')](_0x18147)[_0x5293('0x5e')](fs['createWriteStream'](path['join'](_0x1f9b27,_0x158470[_0x5293('0x5b')])));}}}return BPromise[_0x5293('0x5f')]()[_0x5293('0x18')](function(){return new BPromise(function(_0x5815fe,_0x16316f){zipdir(_0x1f9b27,{'saveTo':_0xd6f786},function(_0x2e4896,_0x1e7dbf){if(_0x2e4896)return _0x16316f(_0x2e4896);return _0x5815fe(_0x1e7dbf);});})[_0x5293('0x18')](function(){return new BPromise(function(_0x3da2e2,_0x230c07){rimraf(_0x1f9b27,function(_0x35b80f){if(_0x35b80f)_0x230c07(_0x35b80f);return _0x3da2e2();});});})[_0x5293('0x18')](function(){return _0x51ff2a[_0x5293('0x4c')](_0xd6f786,_0x582c5c,function(_0x3fffc0){if(_0x3fffc0){console['log'](_0x5293('0x60'),_0x3fffc0);}else{fs[_0x5293('0x61')](_0xd6f786);}});});});}else{return _0x51ff2a[_0x5293('0xd')](0xc8);}})[_0x5293('0x27')](handleError(_0x51ff2a,null));}; \ No newline at end of file +var _0x16d0=['faxInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','existsSync','pipe','createWriteStream','basename','resolve','log','unlinkSync','rimraf','moment','bluebird','util','path','lodash','../../components/interaction/service','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','map','FaxInteraction','rawAttributes','fieldName','key','getOptions','findAll','fax','query','user','show','params','keys','filters','intersection','model','attributes','fields','length','includeAll','include','options','find','catch','create','body','describe','addMessage','FaxMessage','ids','omit','findOne','hasOwnProperty','order','sort','pick','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','rows','addTags','setTags','spread','Tag','color','emit'];(function(_0x5255fd,_0x528c02){var _0x540a61=function(_0x391e0c){while(--_0x391e0c){_0x5255fd['push'](_0x5255fd['shift']());}};_0x540a61(++_0x528c02);}(_0x16d0,0x80));var _0x016d=function(_0x59c147,_0x32b9a0){_0x59c147=_0x59c147-0x0;var _0x4a4f6c=_0x16d0[_0x59c147];return _0x4a4f6c;};'use strict';var rimraf=require(_0x016d('0x0'));var zipdir=require('zip-dir');var moment=require(_0x016d('0x1'));var BPromise=require(_0x016d('0x2'));var util=require(_0x016d('0x3'));var path=require(_0x016d('0x4'));var fs=require('fs');var _=require(_0x016d('0x5'));var Redis=require('ioredis');var interaction=require(_0x016d('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x016d('0x7'))(_0x016d('0x8'));var config=require(_0x016d('0x9'));var db=require('../../mysqldb')['db'];config[_0x016d('0xa')]=_[_0x016d('0xb')](config[_0x016d('0xa')],{'host':_0x016d('0xc'),'port':0x18eb});var socket=require(_0x016d('0xd'))(new Redis(config[_0x016d('0xa')]));require('./faxInteraction.socket')[_0x016d('0xe')](socket);function respondWithStatusCode(_0x4d4a1d,_0x4c52be){_0x4c52be=_0x4c52be||0xcc;return function(_0x14a3b1){if(_0x14a3b1){return _0x4d4a1d[_0x016d('0xf')](_0x4c52be);}return _0x4d4a1d[_0x016d('0x10')](_0x4c52be)[_0x016d('0x11')]();};}function respondWithResult(_0x3b73d3,_0x268db8){_0x268db8=_0x268db8||0xc8;return function(_0x1d7a98){if(_0x1d7a98){return _0x3b73d3[_0x016d('0x10')](_0x268db8)[_0x016d('0x12')](_0x1d7a98);}};}function respondWithFilteredResult(_0x1d602f,_0x1cb0d3){return function(_0x2690d1){if(_0x2690d1){var _0x360d57=typeof _0x1cb0d3[_0x016d('0x13')]===_0x016d('0x14')&&typeof _0x1cb0d3[_0x016d('0x15')]===_0x016d('0x14');var _0xf7d6f6=_0x2690d1[_0x016d('0x16')];var _0x41da4b=_0x360d57?0x0:_0x1cb0d3['offset'];var _0x59648a=_0x360d57?_0x2690d1[_0x016d('0x16')]:_0x1cb0d3[_0x016d('0x13')]+_0x1cb0d3[_0x016d('0x15')];var _0x29888e;if(_0x59648a>=_0xf7d6f6){_0x59648a=_0xf7d6f6;_0x29888e=0xc8;}else{_0x29888e=0xce;}_0x1d602f[_0x016d('0x10')](_0x29888e);return _0x1d602f[_0x016d('0x17')](_0x016d('0x18'),_0x41da4b+'-'+_0x59648a+'/'+_0xf7d6f6)[_0x016d('0x12')](_0x2690d1);}return null;};}function saveUpdates(_0x57142f){return function(_0x1972a9){if(_0x1972a9){return _0x1972a9[_0x016d('0x19')](_0x57142f)[_0x016d('0x1a')](function(_0x511e73){return _0x511e73;});}return null;};}function removeEntity(_0x2d2d39){return function(_0x1ab3b5){if(_0x1ab3b5){return _0x1ab3b5[_0x016d('0x1b')]()['then'](function(){_0x2d2d39[_0x016d('0x10')](0xcc)[_0x016d('0x11')]();});}};}function handleEntityNotFound(_0xb4aa1c){return function(_0x1c65a9){if(!_0x1c65a9){_0xb4aa1c[_0x016d('0xf')](0x194);}return _0x1c65a9;};}function handleError(_0x3af111,_0xc8a0f9){_0xc8a0f9=_0xc8a0f9||0x1f4;return function(_0x363b4d){logger[_0x016d('0x1c')](_0x363b4d[_0x016d('0x1d')]);if(_0x363b4d[_0x016d('0x1e')]){delete _0x363b4d[_0x016d('0x1e')];}_0x3af111['status'](_0xc8a0f9)[_0x016d('0x1f')](_0x363b4d);};}exports['index']=function(_0x3905ed,_0x4f93d3){var _0x2a1933={};var _0x5e5f99=_[_0x016d('0x20')](db[_0x016d('0x21')][_0x016d('0x22')],function(_0xe310cf){return{'name':_0xe310cf[_0x016d('0x23')],'type':_0xe310cf['type'][_0x016d('0x24')]};});_0x2a1933=qs[_0x016d('0x25')](_0x5e5f99,_0x3905ed);return interaction[_0x016d('0x26')](_0x016d('0x27'),_0x3905ed[_0x016d('0x28')],_0x3905ed[_0x016d('0x29')],_0x2a1933,_0x5e5f99)[_0x016d('0x1a')](respondWithFilteredResult(_0x4f93d3,_0x2a1933))['catch'](handleError(_0x4f93d3,null));};exports[_0x016d('0x2a')]=function(_0x15d1ec,_0x3be98d){var _0x4220df={'raw':![],'where':{'id':_0x15d1ec[_0x016d('0x2b')]['id']}},_0x41971b={};_0x41971b['model']=_[_0x016d('0x2c')](db[_0x016d('0x21')][_0x016d('0x22')]);_0x41971b[_0x016d('0x28')]=_['keys'](_0x15d1ec['query']);_0x41971b[_0x016d('0x2d')]=_[_0x016d('0x2e')](_0x41971b[_0x016d('0x2f')],_0x41971b['query']);_0x4220df[_0x016d('0x30')]=_[_0x016d('0x2e')](_0x41971b[_0x016d('0x2f')],qs[_0x016d('0x31')](_0x15d1ec[_0x016d('0x28')][_0x016d('0x31')]));_0x4220df[_0x016d('0x30')]=_0x4220df['attributes'][_0x016d('0x32')]?_0x4220df[_0x016d('0x30')]:_0x41971b[_0x016d('0x2f')];if(_0x15d1ec[_0x016d('0x28')][_0x016d('0x33')]){_0x4220df[_0x016d('0x34')]=[{'all':!![]}];}_0x4220df=_['merge']({},_0x4220df,_0x15d1ec[_0x016d('0x35')]);return db['FaxInteraction'][_0x016d('0x36')](_0x4220df)[_0x016d('0x1a')](handleEntityNotFound(_0x3be98d,null))[_0x016d('0x1a')](respondWithResult(_0x3be98d,null))[_0x016d('0x37')](handleError(_0x3be98d,null));};exports[_0x016d('0x38')]=function(_0x426cd6,_0x3c68a8){return db['FaxInteraction'][_0x016d('0x38')](_0x426cd6[_0x016d('0x39')],{})[_0x016d('0x1a')](respondWithResult(_0x3c68a8,0xc9))[_0x016d('0x37')](handleError(_0x3c68a8,null));};exports[_0x016d('0x19')]=function(_0x25b9dd,_0x4923b7){if(_0x25b9dd[_0x016d('0x39')]['id']){delete _0x25b9dd['body']['id'];}return db[_0x016d('0x21')]['find']({'where':{'id':_0x25b9dd['params']['id']}})['then'](handleEntityNotFound(_0x4923b7,null))[_0x016d('0x1a')](saveUpdates(_0x25b9dd['body'],null))[_0x016d('0x1a')](respondWithResult(_0x4923b7,null))[_0x016d('0x37')](handleError(_0x4923b7,null));};exports[_0x016d('0x1b')]=function(_0x23f1ed,_0x264307){return db[_0x016d('0x21')][_0x016d('0x36')]({'where':{'id':_0x23f1ed[_0x016d('0x2b')]['id']}})[_0x016d('0x1a')](handleEntityNotFound(_0x264307,null))[_0x016d('0x1a')](removeEntity(_0x264307,null))[_0x016d('0x37')](handleError(_0x264307,null));};exports[_0x016d('0x3a')]=function(_0x3f75e7,_0x4882c7){return db[_0x016d('0x21')][_0x016d('0x3a')]()[_0x016d('0x1a')](respondWithResult(_0x4882c7,null))[_0x016d('0x37')](handleError(_0x4882c7,null));};exports[_0x016d('0x3b')]=function(_0x404d49,_0x5797c9){return db[_0x016d('0x3c')][_0x016d('0x36')]({'where':{'id':_0x404d49[_0x016d('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5797c9,null))['then'](function(_0x18c68b){if(_0x18c68b){return _0x18c68b['addMessage'](_0x404d49[_0x016d('0x39')][_0x016d('0x3d')],_[_0x016d('0x3e')](_0x404d49[_0x016d('0x39')],[_0x016d('0x3d'),'id'])||{});}})[_0x016d('0x1a')](respondWithResult(_0x5797c9,null))[_0x016d('0x37')](handleError(_0x5797c9,null));};exports['getMessages']=function(_0x22de18,_0x4a103b){var _0x1e7c4b={'raw':![],'where':{}};var _0x598cfd={};var _0x254493={'count':0x0,'rows':[]};return db[_0x016d('0x21')][_0x016d('0x3f')]({'where':{'id':_0x22de18[_0x016d('0x2b')]['id']}})[_0x016d('0x1a')](handleEntityNotFound(_0x4a103b,null))['then'](function(_0x54e8ec){if(_0x54e8ec){_0x598cfd[_0x016d('0x2f')]=_[_0x016d('0x2c')](db[_0x016d('0x3c')]['rawAttributes']);_0x598cfd[_0x016d('0x28')]=_[_0x016d('0x2c')](_0x22de18['query']);_0x598cfd['filters']=_[_0x016d('0x2e')](_0x598cfd[_0x016d('0x2f')],_0x598cfd[_0x016d('0x28')]);_0x1e7c4b[_0x016d('0x30')]=_[_0x016d('0x2e')](_0x598cfd[_0x016d('0x2f')],qs['fields'](_0x22de18['query'][_0x016d('0x31')]));_0x1e7c4b['attributes']=_0x1e7c4b['attributes'][_0x016d('0x32')]?_0x1e7c4b[_0x016d('0x30')]:_0x598cfd[_0x016d('0x2f')];if(!_0x22de18[_0x016d('0x28')][_0x016d('0x40')]('nolimit')){_0x1e7c4b['limit']=qs[_0x016d('0x15')](_0x22de18[_0x016d('0x28')][_0x016d('0x15')]);_0x1e7c4b[_0x016d('0x13')]=qs[_0x016d('0x13')](_0x22de18[_0x016d('0x28')][_0x016d('0x13')]);}_0x1e7c4b[_0x016d('0x41')]=qs['sort'](_0x22de18[_0x016d('0x28')][_0x016d('0x42')]);_0x1e7c4b['where']=qs[_0x016d('0x2d')](_[_0x016d('0x43')](_0x22de18[_0x016d('0x28')],_0x598cfd[_0x016d('0x2d')]));_0x1e7c4b[_0x016d('0x44')]['FaxInteractionId']=_0x54e8ec['id'];if(_0x22de18['query']['filter']){_0x1e7c4b[_0x016d('0x44')]=_['merge'](_0x1e7c4b[_0x016d('0x44')],{'$or':_['map'](_0x1e7c4b[_0x016d('0x30')],function(_0x4a5485){var _0x58df09={};_0x58df09[_0x4a5485]={'$like':'%'+_0x22de18[_0x016d('0x28')][_0x016d('0x45')]+'%'};return _0x58df09;})});}if(_0x22de18[_0x016d('0x28')][_0x016d('0x46')]){var _0x3aa926=_0x22de18[_0x016d('0x28')][_0x016d('0x46')][_0x016d('0x47')](',');var _0x19b41e={};_0x19b41e[_0x3aa926[0x0]]={'$gte':moment(_0x3aa926[0x1])[_0x016d('0x48')](_0x016d('0x49'))};_0x1e7c4b[_0x016d('0x44')]=_['merge'](_0x1e7c4b[_0x016d('0x44')],_0x19b41e);}_0x1e7c4b=_[_0x016d('0x4a')]({},_0x1e7c4b,_0x22de18[_0x016d('0x35')]);return db['FaxMessage']['count']({'where':_0x1e7c4b[_0x016d('0x44')]})[_0x016d('0x1a')](function(_0x578081){_0x254493['count']=_0x578081;if(_0x22de18[_0x016d('0x28')]['includeAll']){_0x1e7c4b[_0x016d('0x34')]=[{'all':!![]}];}return db[_0x016d('0x3c')][_0x016d('0x26')](_0x1e7c4b);})[_0x016d('0x1a')](function(_0xb4e8fe){_0x254493[_0x016d('0x4b')]=_0xb4e8fe;return _0x254493;});}})[_0x016d('0x1a')](respondWithFilteredResult(_0x4a103b,_0x1e7c4b))[_0x016d('0x37')](handleError(_0x4a103b,null));};exports[_0x016d('0x4c')]=function(_0x38a7b1,_0x4affb2){return db[_0x016d('0x21')][_0x016d('0x36')]({'where':{'id':_0x38a7b1[_0x016d('0x2b')]['id']}})[_0x016d('0x1a')](handleEntityNotFound(_0x4affb2,null))['then'](function(_0x2c0b7c){if(_0x2c0b7c){return _0x2c0b7c[_0x016d('0x4d')](_0x38a7b1[_0x016d('0x39')][_0x016d('0x3d')],_[_0x016d('0x3e')](_0x38a7b1[_0x016d('0x39')],[_0x016d('0x3d'),'id'])||{})[_0x016d('0x4e')](function(){return db[_0x016d('0x4f')][_0x016d('0x26')]({'attributes':['id',_0x016d('0x1e'),_0x016d('0x50')],'where':{'id':_0x38a7b1['body']['ids']}});})[_0x016d('0x1a')](function(_0x27679e){socket[_0x016d('0x51')](_0x016d('0x52'),{'id':Number(_0x38a7b1['params']['id']),'tags':_0x27679e||[]});return{'id':Number(_0x38a7b1[_0x016d('0x2b')]['id']),'tags':_0x27679e||[]};});}})[_0x016d('0x1a')](respondWithResult(_0x4affb2,null))[_0x016d('0x37')](handleError(_0x4affb2,null));};exports[_0x016d('0x53')]=function(_0x203eb2,_0x391aae){return db['FaxInteraction'][_0x016d('0x36')]({'where':{'id':_0x203eb2[_0x016d('0x2b')]['id']}})[_0x016d('0x1a')](handleEntityNotFound(_0x391aae,null))[_0x016d('0x1a')](function(_0x508fed){if(_0x508fed){return _0x508fed[_0x016d('0x53')](_0x203eb2[_0x016d('0x28')]['ids']);}})[_0x016d('0x1a')](respondWithStatusCode(_0x391aae,null))['catch'](handleError(_0x391aae,null));};exports['download']=function(_0x49876e,_0x2f8c6e){var _0x83257e=moment()[_0x016d('0x54')]()[_0x016d('0x55')]();var _0x4af7d6=path[_0x016d('0x56')](config[_0x016d('0x57')],_0x016d('0x58'),_0x016d('0x59'),_0x016d('0x5a'));var _0x39534b=path[_0x016d('0x56')](config[_0x016d('0x57')],_0x016d('0x58'),_0x016d('0x59'),_0x016d('0x5b'));var _0x5a03ad=path[_0x016d('0x56')](_0x4af7d6,_0x83257e);var _0x4f8286=util[_0x016d('0x48')](_0x016d('0x5c'),_0x49876e[_0x016d('0x2b')]['id'],_0x83257e);var _0x4c2a68=path['join'](_0x4af7d6,_0x4f8286);var _0x4bcbf6=[];_0x4bcbf6['push']({'model':db['Attachment'],'as':_0x016d('0x5d'),'raw':!![]});var _0x9f1a54=[{'model':db['FaxMessage'],'as':_0x016d('0x5e'),'attributes':['id',_0x016d('0x39'),_0x016d('0x5f')],'include':_0x4bcbf6}];return db[_0x016d('0x21')]['find']({'where':{'id':_0x49876e[_0x016d('0x2b')]['id']},'include':_0x9f1a54})['then'](handleEntityNotFound(_0x2f8c6e,null))[_0x016d('0x1a')](function(_0x1727ef){if(_0x1727ef&&_0x1727ef[_0x016d('0x5e')]){var _0x31acec=_0x1727ef[_0x016d('0x60')]({'plain':!![]});fs[_0x016d('0x61')](_0x5a03ad);for(var _0x420069=0x0;_0x420069<_0x31acec[_0x016d('0x5e')]['length'];_0x420069++){var _0x3a43f9=_0x31acec['Messages'][_0x420069][_0x016d('0x5d')];if(_0x3a43f9){var _0x53dea9=path[_0x016d('0x56')](_0x39534b,_0x3a43f9['basename']);if(fs[_0x016d('0x62')](_0x53dea9)){fs['createReadStream'](_0x53dea9)[_0x016d('0x63')](fs[_0x016d('0x64')](path[_0x016d('0x56')](_0x5a03ad,_0x3a43f9[_0x016d('0x65')])));}}}return BPromise[_0x016d('0x66')]()[_0x016d('0x1a')](function(){return new BPromise(function(_0x5e8641,_0x3b3556){zipdir(_0x5a03ad,{'saveTo':_0x4c2a68},function(_0x5406bd,_0x360962){if(_0x5406bd)return _0x3b3556(_0x5406bd);return _0x5e8641(_0x360962);});})[_0x016d('0x1a')](function(){return new BPromise(function(_0x5b1482,_0x22f4f9){rimraf(_0x5a03ad,function(_0x5ed99c){if(_0x5ed99c)_0x22f4f9(_0x5ed99c);return _0x5b1482();});});})[_0x016d('0x1a')](function(){return _0x2f8c6e['download'](_0x4c2a68,_0x4f8286,function(_0x535298){if(_0x535298){console[_0x016d('0x67')]('err',_0x535298);}else{fs[_0x016d('0x68')](_0x4c2a68);}});});});}else{return _0x2f8c6e[_0x016d('0xf')](0xc8);}})[_0x016d('0x37')](handleError(_0x2f8c6e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 0cc360e..4866e23 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 _0x33ae=['map','findAll','setDataValue','unreadMessages','emit','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','then','Users'];(function(_0x1cdb84,_0x508f70){var _0x3a4513=function(_0x55cce7){while(--_0x55cce7){_0x1cdb84['push'](_0x1cdb84['shift']());}};_0x3a4513(++_0x508f70);}(_0x33ae,0x18e));var _0xe33a=function(_0x5e3bb1,_0x3cfe7c){_0x5e3bb1=_0x5e3bb1-0x0;var _0x4c1278=_0x33ae[_0x5e3bb1];return _0x4c1278;};'use strict';var EventEmitter=require(_0xe33a('0x0'));var FaxInteraction=require(_0xe33a('0x1'))['db'][_0xe33a('0x2')];var FaxMessage=require(_0xe33a('0x1'))['db'][_0xe33a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe33a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe33a('0x5'),'afterDestroy':_0xe33a('0x6')};function emitEvent(_0x5f318f){return function(_0x59a44e,_0x5e1dc6,_0x235a8f){_0x59a44e[_0xe33a('0x7')]({'attributes':['id'],'raw':!![]})[_0xe33a('0x8')](function(_0x27ad09){_0x59a44e['setDataValue'](_0xe33a('0x9'),_0x27ad09[_0xe33a('0xa')](function(_0x41afb4){return{'id':_0x41afb4['id']};}));return FaxMessage[_0xe33a('0xb')]({'where':{'FaxInteractionId':_0x59a44e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xa1233){_0x59a44e[_0xe33a('0xc')](_0xe33a('0xd'),_0xa1233['length']);FaxInteractionEvents['emit'](_0x5f318f+':'+_0x59a44e['id'],_0x59a44e);FaxInteractionEvents[_0xe33a('0xe')](_0x5f318f,_0x59a44e);_0x235a8f(null);})['catch'](_0x235a8f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xe33a('0xf')](e,emitEvent(event));}}module[_0xe33a('0x10')]=FaxInteractionEvents; \ No newline at end of file +var _0x54a6=['save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x2e752b,_0x5cb17d){var _0x40a0b4=function(_0x11365a){while(--_0x11365a){_0x2e752b['push'](_0x2e752b['shift']());}};_0x40a0b4(++_0x5cb17d);}(_0x54a6,0x13f));var _0x654a=function(_0x13d95b,_0x4652c2){_0x13d95b=_0x13d95b-0x0;var _0x3fec5d=_0x54a6[_0x13d95b];return _0x3fec5d;};'use strict';var EventEmitter=require(_0x654a('0x0'));var FaxInteraction=require(_0x654a('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0x654a('0x1'))['db'][_0x654a('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x654a('0x3')](0x0);var events={'afterCreate':_0x654a('0x4'),'afterUpdate':_0x654a('0x5'),'afterDestroy':_0x654a('0x6')};function emitEvent(_0x137579){return function(_0x30f973,_0x1daa6d,_0x923d19){_0x30f973[_0x654a('0x7')]({'attributes':['id'],'raw':!![]})[_0x654a('0x8')](function(_0x3a12c5){_0x30f973[_0x654a('0x9')](_0x654a('0xa'),_0x3a12c5[_0x654a('0xb')](function(_0x232553){return{'id':_0x232553['id']};}));return FaxMessage[_0x654a('0xc')]({'where':{'FaxInteractionId':_0x30f973['id'],'direction':'in','read':![]},'raw':!![]});})[_0x654a('0x8')](function(_0x1ff6cc){_0x30f973[_0x654a('0x9')](_0x654a('0xd'),_0x1ff6cc[_0x654a('0xe')]);FaxInteractionEvents[_0x654a('0xf')](_0x137579+':'+_0x30f973['id'],_0x30f973);FaxInteractionEvents[_0x654a('0xf')](_0x137579,_0x30f973);_0x923d19(null);})[_0x654a('0x10')](_0x923d19(null));};}for(var e in events){if(events[_0x654a('0x11')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x654a('0x12')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index ef21624..52a81a7 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 _0xad5f=['../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x25fa5c,_0x421141){var _0x1bade2=function(_0x3faf20){while(--_0x3faf20){_0x25fa5c['push'](_0x25fa5c['shift']());}};_0x1bade2(++_0x421141);}(_0xad5f,0x1a8));var _0xfad5=function(_0x489618,_0x233987){_0x489618=_0x489618-0x0;var _0x3d34b8=_0xad5f[_0x489618];return _0x3d34b8;};'use strict';var _=require(_0xfad5('0x0'));var util=require(_0xfad5('0x1'));var logger=require(_0xfad5('0x2'))(_0xfad5('0x3'));var moment=require(_0xfad5('0x4'));var BPromise=require(_0xfad5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfad5('0x6'));var rimraf=require(_0xfad5('0x7'));var config=require(_0xfad5('0x8'));var attributes=require(_0xfad5('0x9'));module[_0xfad5('0xa')]=function(_0x180450,_0x43cae5){return _0x180450['define'](_0xfad5('0xb'),attributes,{'tableName':_0xfad5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x39d228,_0xbe8f56,_0x535cb5){if(_0x39d228[_0xfad5('0xd')](_0xfad5('0xe'))){_0x39d228[_0xfad5('0xf')]=moment()[_0xfad5('0x10')](_0xfad5('0x11'));}_0x535cb5(null,_0x39d228);}}});}; \ No newline at end of file +var _0x7ca0=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','FaxInteraction','fax_interactions','changed','closedAt'];(function(_0x4588bd,_0x57222b){var _0x1becaa=function(_0x2ec59d){while(--_0x2ec59d){_0x4588bd['push'](_0x4588bd['shift']());}};_0x1becaa(++_0x57222b);}(_0x7ca0,0xe2));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x07ca('0x0'));var util=require(_0x07ca('0x1'));var logger=require(_0x07ca('0x2'))(_0x07ca('0x3'));var moment=require(_0x07ca('0x4'));var BPromise=require('bluebird');var rp=require(_0x07ca('0x5'));var fs=require('fs');var path=require(_0x07ca('0x6'));var rimraf=require('rimraf');var config=require(_0x07ca('0x7'));var attributes=require('./faxInteraction.attributes');module[_0x07ca('0x8')]=function(_0xcf9765,_0x4109e8){return _0xcf9765[_0x07ca('0x9')](_0x07ca('0xa'),attributes,{'tableName':_0x07ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2441a2,_0x1de96c,_0x200369){if(_0x2441a2[_0x07ca('0xc')]('closed')){_0x2441a2[_0x07ca('0xd')]=moment()['format'](_0x07ca('0xe'));}_0x200369(null,_0x2441a2);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 7e8c5cb..4ee6828 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 _0x89c8=['redis','defaults','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','limit','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x3ffa3b,_0xd9f4ec){var _0x3a8f92=function(_0x16c7af){while(--_0x16c7af){_0x3ffa3b['push'](_0x3ffa3b['shift']());}};_0x3a8f92(++_0xd9f4ec);}(_0x89c8,0x99));var _0x889c=function(_0x2b9a87,_0x2622aa){_0x2b9a87=_0x2b9a87-0x0;var _0x471592=_0x89c8[_0x2b9a87];return _0x471592;};'use strict';var _=require(_0x889c('0x0'));var util=require(_0x889c('0x1'));var moment=require(_0x889c('0x2'));var BPromise=require(_0x889c('0x3'));var rs=require(_0x889c('0x4'));var fs=require('fs');var Redis=require(_0x889c('0x5'));var db=require(_0x889c('0x6'))['db'];var utils=require(_0x889c('0x7'));var logger=require(_0x889c('0x8'))(_0x889c('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x889c('0xa')]['http']({'port':0x232a});config[_0x889c('0xb')]=_[_0x889c('0xc')](config[_0x889c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x889c('0xd'))(new Redis(config[_0x889c('0xb')]));require(_0x889c('0xe'))[_0x889c('0xf')](socket);function respondWithRpcPromise(_0x39695a,_0x2f05fd,_0x3dac4f){return new BPromise(function(_0x27e94e,_0x497b57){return client['request'](_0x39695a,_0x3dac4f)[_0x889c('0x10')](function(_0x13247f){logger[_0x889c('0x11')](_0x889c('0x12'),_0x2f05fd,_0x889c('0x13'));logger[_0x889c('0x14')](_0x889c('0x15'),_0x2f05fd,_0x889c('0x13'),JSON[_0x889c('0x16')](_0x13247f));if(_0x13247f[_0x889c('0x17')]){if(_0x13247f[_0x889c('0x17')][_0x889c('0x18')]===0x1f4){logger['error'](_0x889c('0x12'),_0x2f05fd,_0x13247f[_0x889c('0x17')][_0x889c('0x19')]);return _0x497b57(_0x13247f['error'][_0x889c('0x19')]);}logger[_0x889c('0x17')](_0x889c('0x12'),_0x2f05fd,_0x13247f[_0x889c('0x17')][_0x889c('0x19')]);return _0x27e94e(_0x13247f['error'][_0x889c('0x19')]);}else{logger[_0x889c('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x2f05fd,'request\x20sent');_0x27e94e(_0x13247f['result'][_0x889c('0x19')]);}})[_0x889c('0x1a')](function(_0x51a0a5){logger[_0x889c('0x17')](_0x889c('0x12'),_0x2f05fd,_0x51a0a5);_0x497b57(_0x51a0a5);});});}exports[_0x889c('0x1b')]=function(_0x51e645){var _0x5d737f=this;return new Promise(function(_0x201ad9,_0x6302b4){return db[_0x889c('0x1c')][_0x889c('0x1d')](_0x51e645[_0x889c('0x1e')],{'raw':_0x51e645[_0x889c('0x1f')]?_0x51e645[_0x889c('0x1f')][_0x889c('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e645[_0x889c('0x1f')]?_0x51e645[_0x889c('0x1f')][_0x889c('0x21')]||null:null,'attributes':_0x51e645['options']?_0x51e645[_0x889c('0x1f')]['attributes']||null:null,'limit':_0x51e645['options']?_0x51e645[_0x889c('0x1f')][_0x889c('0x22')]||null:null})[_0x889c('0x10')](function(_0x345122){logger['info'](_0x889c('0x1b'),_0x51e645);logger[_0x889c('0x14')](_0x889c('0x1b'),_0x51e645,JSON['stringify'](_0x345122));_0x201ad9(_0x345122);})[_0x889c('0x1a')](function(_0x3c7c6b){logger[_0x889c('0x17')](_0x889c('0x1b'),_0x3c7c6b['message'],_0x51e645);_0x6302b4(_0x5d737f[_0x889c('0x17')](0x1f4,_0x3c7c6b[_0x889c('0x19')]));});});};exports[_0x889c('0x23')]=function(_0x19199a){return new Promise(function(_0xd03322,_0x23c20e){return db['FaxInteraction'][_0x889c('0x24')]({'where':_0x19199a[_0x889c('0x1f')]?_0x19199a[_0x889c('0x1f')]['where']||null:null})['then'](function(_0x4e5f04){if(_0x4e5f04){return _0x4e5f04[_0x889c('0x25')](_0x19199a[_0x889c('0x1e')][_0x889c('0x26')],_['omit'](_0x19199a['body'],[_0x889c('0x26'),'id'])||{});}})[_0x889c('0x27')](function(_0x42864d){logger[_0x889c('0x11')](_0x889c('0x28'),_0x19199a);logger[_0x889c('0x14')](_0x889c('0x28'),_0x19199a,JSON[_0x889c('0x16')](_0x42864d));_0xd03322(_0x42864d);})['catch'](function(_0x3e37ef){logger[_0x889c('0x17')](_0x889c('0x28'),_0x3e37ef['message'],_0x19199a);_0x23c20e(_this[_0x889c('0x17')](0x1f4,_0x3e37ef[_0x889c('0x19')]));});});}; \ No newline at end of file +var _0xc900=['omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToFaxInteraction','addTags'];(function(_0x3d20db,_0xf7c56a){var _0x98510e=function(_0xf79c5a){while(--_0xf79c5a){_0x3d20db['push'](_0x3d20db['shift']());}};_0x98510e(++_0xf7c56a);}(_0xc900,0x1f3));var _0x0c90=function(_0x1b3a93,_0x45f7fd){_0x1b3a93=_0x1b3a93-0x0;var _0x12baea=_0xc900[_0x1b3a93];return _0x12baea;};'use strict';var _=require(_0x0c90('0x0'));var util=require(_0x0c90('0x1'));var moment=require(_0x0c90('0x2'));var BPromise=require(_0x0c90('0x3'));var rs=require(_0x0c90('0x4'));var fs=require('fs');var Redis=require(_0x0c90('0x5'));var db=require(_0x0c90('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c90('0x7'))(_0x0c90('0x8'));var config=require(_0x0c90('0x9'));var jayson=require(_0x0c90('0xa'));var client=jayson[_0x0c90('0xb')][_0x0c90('0xc')]({'port':0x232a});config[_0x0c90('0xd')]=_['defaults'](config['redis'],{'host':_0x0c90('0xe'),'port':0x18eb});var socket=require(_0x0c90('0xf'))(new Redis(config[_0x0c90('0xd')]));require(_0x0c90('0x10'))[_0x0c90('0x11')](socket);function respondWithRpcPromise(_0x34b767,_0x3af693,_0x3c13d3){return new BPromise(function(_0x1cbd45,_0x53428b){return client[_0x0c90('0x12')](_0x34b767,_0x3c13d3)[_0x0c90('0x13')](function(_0x1b61e1){logger[_0x0c90('0x14')](_0x0c90('0x15'),_0x3af693,_0x0c90('0x16'));logger[_0x0c90('0x17')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x3af693,_0x0c90('0x16'),JSON[_0x0c90('0x18')](_0x1b61e1));if(_0x1b61e1[_0x0c90('0x19')]){if(_0x1b61e1[_0x0c90('0x19')][_0x0c90('0x1a')]===0x1f4){logger[_0x0c90('0x19')](_0x0c90('0x15'),_0x3af693,_0x1b61e1[_0x0c90('0x19')][_0x0c90('0x1b')]);return _0x53428b(_0x1b61e1[_0x0c90('0x19')][_0x0c90('0x1b')]);}logger[_0x0c90('0x19')](_0x0c90('0x15'),_0x3af693,_0x1b61e1[_0x0c90('0x19')][_0x0c90('0x1b')]);return _0x1cbd45(_0x1b61e1[_0x0c90('0x19')][_0x0c90('0x1b')]);}else{logger[_0x0c90('0x14')](_0x0c90('0x15'),_0x3af693,'request\x20sent');_0x1cbd45(_0x1b61e1[_0x0c90('0x1c')]['message']);}})['catch'](function(_0x4e335b){logger['error'](_0x0c90('0x15'),_0x3af693,_0x4e335b);_0x53428b(_0x4e335b);});});}exports[_0x0c90('0x1d')]=function(_0x498bbe){var _0x3130b1=this;return new Promise(function(_0xafd30a,_0x58e56b){return db[_0x0c90('0x1e')][_0x0c90('0x1f')](_0x498bbe[_0x0c90('0x20')],{'raw':_0x498bbe[_0x0c90('0x21')]?_0x498bbe[_0x0c90('0x21')][_0x0c90('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x498bbe[_0x0c90('0x21')]?_0x498bbe[_0x0c90('0x21')][_0x0c90('0x23')]||null:null,'attributes':_0x498bbe[_0x0c90('0x21')]?_0x498bbe['options'][_0x0c90('0x24')]||null:null,'limit':_0x498bbe[_0x0c90('0x21')]?_0x498bbe['options'][_0x0c90('0x25')]||null:null})[_0x0c90('0x13')](function(_0x9880fa){logger[_0x0c90('0x14')](_0x0c90('0x1d'),_0x498bbe);logger[_0x0c90('0x17')](_0x0c90('0x1d'),_0x498bbe,JSON[_0x0c90('0x18')](_0x9880fa));_0xafd30a(_0x9880fa);})[_0x0c90('0x26')](function(_0x4f7d55){logger[_0x0c90('0x19')](_0x0c90('0x1d'),_0x4f7d55[_0x0c90('0x1b')],_0x498bbe);_0x58e56b(_0x3130b1[_0x0c90('0x19')](0x1f4,_0x4f7d55[_0x0c90('0x1b')]));});});};exports[_0x0c90('0x27')]=function(_0x4f643c){return new Promise(function(_0x5ee011,_0x14976d){return db[_0x0c90('0x1e')]['find']({'where':_0x4f643c[_0x0c90('0x21')]?_0x4f643c[_0x0c90('0x21')][_0x0c90('0x23')]||null:null})[_0x0c90('0x13')](function(_0x285fc6){if(_0x285fc6){return _0x285fc6[_0x0c90('0x28')](_0x4f643c[_0x0c90('0x20')]['ids'],_[_0x0c90('0x29')](_0x4f643c['body'],[_0x0c90('0x2a'),'id'])||{});}})[_0x0c90('0x2b')](function(_0x5dcf7a){logger[_0x0c90('0x14')](_0x0c90('0x2c'),_0x4f643c);logger[_0x0c90('0x17')](_0x0c90('0x2c'),_0x4f643c,JSON[_0x0c90('0x18')](_0x5dcf7a));_0x5ee011(_0x5dcf7a);})[_0x0c90('0x26')](function(_0x4bf7ba){logger[_0x0c90('0x19')](_0x0c90('0x2c'),_0x4bf7ba['message'],_0x4f643c);_0x14976d(_this['error'](0x1f4,_0x4bf7ba[_0x0c90('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index e093b3e..7f24743 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 _0x32ff=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','update','emit'];(function(_0x48643b,_0x46f978){var _0x233542=function(_0x35d17d){while(--_0x35d17d){_0x48643b['push'](_0x48643b['shift']());}};_0x233542(++_0x46f978);}(_0x32ff,0x73));var _0xf32f=function(_0x44b3e2,_0x4df17f){_0x44b3e2=_0x44b3e2-0x0;var _0x32b21e=_0x32ff[_0x44b3e2];return _0x32b21e;};'use strict';var FaxInteractionEvents=require(_0xf32f('0x0'));var events=[_0xf32f('0x1'),_0xf32f('0x2'),_0xf32f('0x3')];function createListener(_0x13bf94,_0x634e2b){return function(_0xb588ad){_0x634e2b[_0xf32f('0x4')](_0x13bf94,_0xb588ad);};}function removeListener(_0x17652a,_0x525fe8){return function(){FaxInteractionEvents[_0xf32f('0x5')](_0x17652a,_0x525fe8);};}exports[_0xf32f('0x6')]=function(_0x40cb78){for(var _0x2a070e=0x0,_0x85963d=events['length'];_0x2a070e<_0x85963d;_0x2a070e++){var _0x3e4159=events[_0x2a070e];var _0x1a6594=createListener(_0xf32f('0x7')+_0x3e4159,_0x40cb78);FaxInteractionEvents['on'](_0x3e4159,_0x1a6594);}}; \ No newline at end of file +var _0xb4d4=['remove','update','removeListener','length'];(function(_0x107b24,_0x461a4a){var _0x1a5817=function(_0x492ef3){while(--_0x492ef3){_0x107b24['push'](_0x107b24['shift']());}};_0x1a5817(++_0x461a4a);}(_0xb4d4,0xd8));var _0x4b4d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4d4[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0x4b4d('0x0'),_0x4b4d('0x1')];function createListener(_0x23cb4a,_0x4c08ed){return function(_0x1d056b){_0x4c08ed['emit'](_0x23cb4a,_0x1d056b);};}function removeListener(_0x4dd214,_0x53a53f){return function(){FaxInteractionEvents[_0x4b4d('0x2')](_0x4dd214,_0x53a53f);};}exports['register']=function(_0x32552b){for(var _0x5c1016=0x0,_0x55641f=events[_0x4b4d('0x3')];_0x5c1016<_0x55641f;_0x5c1016++){var _0x48a511=events[_0x5c1016];var _0x14f47f=createListener('faxInteraction:'+_0x48a511,_0x32552b);FaxInteractionEvents['on'](_0x48a511,_0x14f47f);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 7234857..40ff8e4 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 _0x23c9=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','destroy','removeTags'];(function(_0x295743,_0x39c842){var _0xcb6e35=function(_0x4a365d){while(--_0x4a365d){_0x295743['push'](_0x295743['shift']());}};_0xcb6e35(++_0x39c842);}(_0x23c9,0x1a1));var _0x923c=function(_0x54be74,_0x37c908){_0x54be74=_0x54be74-0x0;var _0x47da47=_0x23c9[_0x54be74];return _0x47da47;};'use strict';var multer=require('multer');var util=require(_0x923c('0x0'));var path=require(_0x923c('0x1'));var timeout=require(_0x923c('0x2'));var express=require(_0x923c('0x3'));var router=express['Router']();var fs_extra=require(_0x923c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x923c('0x5'));var config=require(_0x923c('0x6'));var controller=require(_0x923c('0x7'));router['get']('/',auth[_0x923c('0x8')](),controller[_0x923c('0x9')]);router[_0x923c('0xa')]('/describe',auth[_0x923c('0x8')](),controller[_0x923c('0xb')]);router['get'](_0x923c('0xc'),auth[_0x923c('0x8')](),controller[_0x923c('0xd')]);router[_0x923c('0xa')](_0x923c('0xe'),auth[_0x923c('0x8')](),controller[_0x923c('0xf')]);router['get'](_0x923c('0x10'),auth['isAuthenticated'](),controller[_0x923c('0x11')]);router[_0x923c('0x12')]('/',auth[_0x923c('0x8')](),controller[_0x923c('0x13')]);router[_0x923c('0x12')](_0x923c('0xe'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x923c('0x14'),auth[_0x923c('0x8')](),interaction[_0x923c('0x15')](_0x923c('0x16'),_0x923c('0x17')),controller[_0x923c('0x18')]);router[_0x923c('0x19')](_0x923c('0xc'),auth[_0x923c('0x8')](),interaction['tracked'](_0x923c('0x16'),_0x923c('0x1a')),controller[_0x923c('0x1b')]);router[_0x923c('0x1c')](_0x923c('0xc'),auth[_0x923c('0x8')](),interaction['tracked'](_0x923c('0x16'),'faxinteraction:destroy'),controller[_0x923c('0x1d')]);router[_0x923c('0x1c')](_0x923c('0x14'),auth['isAuthenticated'](),controller[_0x923c('0x1e')]);module[_0x923c('0x1f')]=router; \ No newline at end of file +var _0x15ec=['post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download'];(function(_0x19e0fe,_0x5e093f){var _0x62ac24=function(_0x46b540){while(--_0x46b540){_0x19e0fe['push'](_0x19e0fe['shift']());}};_0x62ac24(++_0x5e093f);}(_0x15ec,0x6f));var _0xc15e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x15ec[_0x220dbb];return _0x2b77de;};'use strict';var multer=require(_0xc15e('0x0'));var util=require(_0xc15e('0x1'));var path=require(_0xc15e('0x2'));var timeout=require(_0xc15e('0x3'));var express=require(_0xc15e('0x4'));var router=express[_0xc15e('0x5')]();var fs_extra=require(_0xc15e('0x6'));var auth=require(_0xc15e('0x7'));var interaction=require(_0xc15e('0x8'));var config=require(_0xc15e('0x9'));var controller=require(_0xc15e('0xa'));router[_0xc15e('0xb')]('/',auth[_0xc15e('0xc')](),controller[_0xc15e('0xd')]);router[_0xc15e('0xb')](_0xc15e('0xe'),auth[_0xc15e('0xc')](),controller[_0xc15e('0xf')]);router[_0xc15e('0xb')](_0xc15e('0x10'),auth[_0xc15e('0xc')](),controller[_0xc15e('0x11')]);router[_0xc15e('0xb')](_0xc15e('0x12'),auth[_0xc15e('0xc')](),controller[_0xc15e('0x13')]);router[_0xc15e('0xb')]('/:id/download',auth[_0xc15e('0xc')](),controller[_0xc15e('0x14')]);router[_0xc15e('0x15')]('/',auth[_0xc15e('0xc')](),controller[_0xc15e('0x16')]);router[_0xc15e('0x15')](_0xc15e('0x12'),auth[_0xc15e('0xc')](),controller[_0xc15e('0x17')]);router[_0xc15e('0x15')](_0xc15e('0x18'),auth['isAuthenticated'](),interaction[_0xc15e('0x19')](_0xc15e('0x1a'),_0xc15e('0x1b')),controller[_0xc15e('0x1c')]);router[_0xc15e('0x1d')](_0xc15e('0x10'),auth[_0xc15e('0xc')](),interaction[_0xc15e('0x19')](_0xc15e('0x1a'),'faxinteraction:update'),controller[_0xc15e('0x1e')]);router[_0xc15e('0x1f')](_0xc15e('0x10'),auth[_0xc15e('0xc')](),interaction[_0xc15e('0x19')](_0xc15e('0x1a'),'faxinteraction:destroy'),controller['destroy']);router[_0xc15e('0x1f')](_0xc15e('0x18'),auth[_0xc15e('0xc')](),controller['removeTags']);module[_0xc15e('0x20')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index a3405f0..edd576f 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 _0xcb81=['medium','out','TEXT','DATE','sequelize','exports'];(function(_0x3fa05c,_0x5af872){var _0x55c937=function(_0x378862){while(--_0x378862){_0x3fa05c['push'](_0x3fa05c['shift']());}};_0x55c937(++_0x5af872);}(_0xcb81,0x154));var _0x1cb8=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0xcb81[_0x102ff9];return _0x24fa97;};'use strict';var Sequelize=require(_0x1cb8('0x0'));module[_0x1cb8('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1cb8('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x1cb8('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1cb8('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1cb8('0x5')]}}; \ No newline at end of file +var _0x5645=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x42d69d,_0x4a014e){var _0x27d15b=function(_0x2d2ead){while(--_0x2d2ead){_0x42d69d['push'](_0x42d69d['shift']());}};_0x27d15b(++_0x4a014e);}(_0x5645,0x19e));var _0x5564=function(_0x415a3b,_0x22a6b1){_0x415a3b=_0x415a3b-0x0;var _0xe84651=_0x5645[_0x415a3b];return _0xe84651;};'use strict';var Sequelize=require(_0x5564('0x0'));module[_0x5564('0x1')]={'body':{'type':Sequelize[_0x5564('0x2')](_0x5564('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5564('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5564('0x5')),'defaultValue':_0x5564('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x5564('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5564('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 6ab41d7..ed2fa03 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 _0xc589=['download','root','files','join','basename','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','stack','name','send','map','FaxMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','where','includeAll','findAll','rows','show','params','include','options','find','body','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteraction','isNil','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','manual','interface','SIP/%s','motionChannel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','sequelize','internal','channel','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc589,0x99));var _0x9c58=function(_0x54271f,_0x262e0c){_0x54271f=_0x54271f-0x0;var _0x53b7c7=_0xc589[_0x54271f];return _0x53b7c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9c58('0x0'));var zipdir=require(_0x9c58('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c58('0x2'));var moment=require('moment');var BPromise=require(_0x9c58('0x3'));var Mustache=require(_0x9c58('0x4'));var util=require(_0x9c58('0x5'));var path=require(_0x9c58('0x6'));var sox=require(_0x9c58('0x7'));var csv=require(_0x9c58('0x8'));var ejs=require(_0x9c58('0x9'));var fs=require('fs');var fs_extra=require(_0x9c58('0xa'));var _=require(_0x9c58('0xb'));var squel=require(_0x9c58('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c58('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9c58('0x8'));var querystring=require(_0x9c58('0xe'));var Papa=require(_0x9c58('0xf'));var Redis=require(_0x9c58('0x10'));var authService=require(_0x9c58('0x11'));var qs=require(_0x9c58('0x12'));var as=require(_0x9c58('0x13'));var hardwareService=require(_0x9c58('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9c58('0x15'));var licenseUtil=require(_0x9c58('0x16'));var db=require(_0x9c58('0x17'))['db'];config[_0x9c58('0x18')]=_['defaults'](config[_0x9c58('0x18')],{'host':_0x9c58('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')[_0x9c58('0x1a')](socket);var jayson=require(_0x9c58('0x1b'));var client=jayson[_0x9c58('0x1c')][_0x9c58('0x1d')]({'port':0x232c});var client9002=jayson[_0x9c58('0x1c')][_0x9c58('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x150869,_0x592423,_0xbeb89e,_0x57e11c){return new BPromise(function(_0xdb1775,_0x169167){var _0x5c9bcf=_0x57e11c||client;return _0x5c9bcf[_0x9c58('0x1e')](_0x150869,_0xbeb89e)[_0x9c58('0x1f')](function(_0x3bef3f){logger[_0x9c58('0x20')]('FaxMessage,\x20%s,\x20%s',_0x592423,_0x9c58('0x21'));logger['debug'](_0x9c58('0x22'),_0x592423,_0x9c58('0x21'),JSON['stringify'](_0x3bef3f));if(_0x3bef3f['error']){if(_0x3bef3f[_0x9c58('0x23')][_0x9c58('0x24')]===0x1f4){logger[_0x9c58('0x23')]('FaxMessage,\x20%s,\x20%s',_0x592423,_0x3bef3f[_0x9c58('0x23')][_0x9c58('0x25')]);return _0x169167(_0x3bef3f[_0x9c58('0x23')][_0x9c58('0x25')]);}logger[_0x9c58('0x23')](_0x9c58('0x26'),_0x592423,_0x3bef3f['error'][_0x9c58('0x25')]);return _0xdb1775(_0x3bef3f[_0x9c58('0x23')][_0x9c58('0x25')]);}else{logger[_0x9c58('0x20')]('FaxMessage,\x20%s,\x20%s',_0x592423,_0x9c58('0x21'));_0xdb1775(_0x3bef3f[_0x9c58('0x27')][_0x9c58('0x25')]);}})[_0x9c58('0x28')](function(_0x430dfc){logger[_0x9c58('0x23')](_0x9c58('0x26'),_0x592423,_0x430dfc);_0x169167(_0x430dfc);});});}function respondWithStatusCode(_0x3578dd,_0x35a418){_0x35a418=_0x35a418||0xcc;return function(_0x3836d1){if(_0x3836d1){return _0x3578dd[_0x9c58('0x29')](_0x35a418);}return _0x3578dd[_0x9c58('0x2a')](_0x35a418)['end']();};}function respondWithResult(_0x36e2c9,_0x13f442){_0x13f442=_0x13f442||0xc8;return function(_0x57aeb1){if(_0x57aeb1){return _0x36e2c9[_0x9c58('0x2a')](_0x13f442)['json'](_0x57aeb1);}};}function respondWithFilteredResult(_0x342da1,_0x4cd1c2){return function(_0x4f35c1){if(_0x4f35c1){var _0x334141=typeof _0x4cd1c2[_0x9c58('0x2b')]===_0x9c58('0x2c')&&typeof _0x4cd1c2[_0x9c58('0x2d')]===_0x9c58('0x2c');var _0x327151=_0x4f35c1[_0x9c58('0x2e')];var _0x5166c9=_0x334141?0x0:_0x4cd1c2[_0x9c58('0x2b')];var _0x5a83dc=_0x334141?_0x4f35c1[_0x9c58('0x2e')]:_0x4cd1c2['offset']+_0x4cd1c2[_0x9c58('0x2d')];var _0x2e2bf7;if(_0x5a83dc>=_0x327151){_0x5a83dc=_0x327151;_0x2e2bf7=0xc8;}else{_0x2e2bf7=0xce;}_0x342da1[_0x9c58('0x2a')](_0x2e2bf7);return _0x342da1[_0x9c58('0x2f')](_0x9c58('0x30'),_0x5166c9+'-'+_0x5a83dc+'/'+_0x327151)[_0x9c58('0x31')](_0x4f35c1);}return null;};}function patchUpdates(_0x1edb6c){return function(_0x45aebb){try{jsonpatch[_0x9c58('0x32')](_0x45aebb,_0x1edb6c,!![]);}catch(_0x240c7d){return BPromise[_0x9c58('0x33')](_0x240c7d);}return _0x45aebb[_0x9c58('0x34')]();};}function saveUpdates(_0x560bb0,_0x3cc7ea){return function(_0x4d1485){if(_0x4d1485){return _0x4d1485[_0x9c58('0x35')](_0x560bb0)[_0x9c58('0x1f')](function(_0x524637){return _0x524637;});}return null;};}function removeEntity(_0x5b70c2,_0x181cbd){return function(_0x2c4ee9){if(_0x2c4ee9){return _0x2c4ee9[_0x9c58('0x36')]()[_0x9c58('0x1f')](function(){_0x5b70c2[_0x9c58('0x2a')](0xcc)[_0x9c58('0x37')]();});}};}function handleEntityNotFound(_0x5436cb,_0x150b7a){return function(_0x127b4b){if(!_0x127b4b){_0x5436cb[_0x9c58('0x29')](0x194);}return _0x127b4b;};}function handleError(_0xee5cf1,_0x48de68){_0x48de68=_0x48de68||0x1f4;return function(_0x26a22e){logger[_0x9c58('0x23')](_0x26a22e[_0x9c58('0x38')]);if(_0x26a22e[_0x9c58('0x39')]){delete _0x26a22e[_0x9c58('0x39')];}_0xee5cf1[_0x9c58('0x2a')](_0x48de68)[_0x9c58('0x3a')](_0x26a22e);};}exports['index']=function(_0xf2fecc,_0x24b95c){var _0xf0299e={},_0x2dedc8={},_0x3f4982={'count':0x0,'rows':[]};var _0x4a6674=_[_0x9c58('0x3b')](db[_0x9c58('0x3c')][_0x9c58('0x3d')],function(_0x3f8992){return{'name':_0x3f8992[_0x9c58('0x3e')],'type':_0x3f8992['type'][_0x9c58('0x3f')]};});_0x2dedc8[_0x9c58('0x40')]=_[_0x9c58('0x3b')](_0x4a6674,'name');_0x2dedc8['query']=_[_0x9c58('0x41')](_0xf2fecc[_0x9c58('0x42')]);_0x2dedc8[_0x9c58('0x43')]=_[_0x9c58('0x44')](_0x2dedc8[_0x9c58('0x40')],_0x2dedc8[_0x9c58('0x42')]);_0xf0299e[_0x9c58('0x45')]=_[_0x9c58('0x44')](_0x2dedc8[_0x9c58('0x40')],qs[_0x9c58('0x46')](_0xf2fecc[_0x9c58('0x42')][_0x9c58('0x46')]));_0xf0299e[_0x9c58('0x45')]=_0xf0299e['attributes'][_0x9c58('0x47')]?_0xf0299e['attributes']:_0x2dedc8[_0x9c58('0x40')];if(!_0xf2fecc['query'][_0x9c58('0x48')](_0x9c58('0x49'))){_0xf0299e[_0x9c58('0x2d')]=qs[_0x9c58('0x2d')](_0xf2fecc['query'][_0x9c58('0x2d')]);_0xf0299e['offset']=qs[_0x9c58('0x2b')](_0xf2fecc['query'][_0x9c58('0x2b')]);}_0xf0299e[_0x9c58('0x4a')]=qs['sort'](_0xf2fecc['query'][_0x9c58('0x4b')]);_0xf0299e['where']=qs[_0x9c58('0x43')](_[_0x9c58('0x4c')](_0xf2fecc[_0x9c58('0x42')],_0x2dedc8[_0x9c58('0x43')]),_0x4a6674);if(_0xf2fecc['query'][_0x9c58('0x4d')]){_0xf0299e['where']=_[_0x9c58('0x4e')](_0xf0299e['where'],{'$or':_[_0x9c58('0x3b')](_0x4a6674,function(_0xcaceb9){if(_0xcaceb9[_0x9c58('0x4f')]!==_0x9c58('0x50')){var _0x47f2fe={};_0x47f2fe[_0xcaceb9[_0x9c58('0x39')]]={'$like':'%'+_0xf2fecc[_0x9c58('0x42')]['filter']+'%'};return _0x47f2fe;}})});}_0xf0299e=_[_0x9c58('0x4e')]({},_0xf0299e,_0xf2fecc['options']);var _0x42469b={'where':_0xf0299e[_0x9c58('0x51')]};return db[_0x9c58('0x3c')][_0x9c58('0x2e')](_0x42469b)[_0x9c58('0x1f')](function(_0x61b503){_0x3f4982[_0x9c58('0x2e')]=_0x61b503;if(_0xf2fecc[_0x9c58('0x42')][_0x9c58('0x52')]){_0xf0299e['include']=[{'all':!![]}];}return db[_0x9c58('0x3c')][_0x9c58('0x53')](_0xf0299e);})[_0x9c58('0x1f')](function(_0x16a603){_0x3f4982[_0x9c58('0x54')]=_0x16a603;return _0x3f4982;})['then'](respondWithFilteredResult(_0x24b95c,_0xf0299e))[_0x9c58('0x28')](handleError(_0x24b95c,null));};exports[_0x9c58('0x55')]=function(_0x99f924,_0x546b61){var _0x3043da={'raw':!![],'where':{'id':_0x99f924[_0x9c58('0x56')]['id']}},_0xac588c={};_0xac588c[_0x9c58('0x40')]=_[_0x9c58('0x41')](db['FaxMessage'][_0x9c58('0x3d')]);_0xac588c[_0x9c58('0x42')]=_[_0x9c58('0x41')](_0x99f924['query']);_0xac588c[_0x9c58('0x43')]=_['intersection'](_0xac588c[_0x9c58('0x40')],_0xac588c[_0x9c58('0x42')]);_0x3043da[_0x9c58('0x45')]=_[_0x9c58('0x44')](_0xac588c[_0x9c58('0x40')],qs[_0x9c58('0x46')](_0x99f924['query'][_0x9c58('0x46')]));_0x3043da['attributes']=_0x3043da['attributes']['length']?_0x3043da['attributes']:_0xac588c[_0x9c58('0x40')];if(_0x99f924[_0x9c58('0x42')][_0x9c58('0x52')]){_0x3043da[_0x9c58('0x57')]=[{'all':!![]}];}_0x3043da=_['merge']({},_0x3043da,_0x99f924[_0x9c58('0x58')]);return db[_0x9c58('0x3c')][_0x9c58('0x59')](_0x3043da)[_0x9c58('0x1f')](handleEntityNotFound(_0x546b61,null))[_0x9c58('0x1f')](respondWithResult(_0x546b61,null))[_0x9c58('0x28')](handleError(_0x546b61,null));};exports[_0x9c58('0x35')]=function(_0x2742b6,_0x20d48f){if(_0x2742b6[_0x9c58('0x5a')]['id']){delete _0x2742b6[_0x9c58('0x5a')]['id'];}return db[_0x9c58('0x3c')][_0x9c58('0x59')]({'where':{'id':_0x2742b6['params']['id']}})[_0x9c58('0x1f')](handleEntityNotFound(_0x20d48f,null))[_0x9c58('0x1f')](saveUpdates(_0x2742b6[_0x9c58('0x5a')],null))[_0x9c58('0x1f')](respondWithResult(_0x20d48f,null))[_0x9c58('0x28')](handleError(_0x20d48f,null));};exports[_0x9c58('0x36')]=function(_0x2e7c58,_0x5e16ac){return db[_0x9c58('0x3c')]['find']({'where':{'id':_0x2e7c58[_0x9c58('0x56')]['id']}})['then'](handleEntityNotFound(_0x5e16ac,null))['then'](removeEntity(_0x5e16ac,null))[_0x9c58('0x28')](handleError(_0x5e16ac,null));};exports[_0x9c58('0x5b')]=function(_0xb5ed2d,_0x22730c){return db[_0x9c58('0x3c')][_0x9c58('0x5b')]()['then'](respondWithResult(_0x22730c,null))[_0x9c58('0x28')](handleError(_0x22730c,null));};var interaction_log=require(_0x9c58('0x5c'))(_0x9c58('0x5d'));exports[_0x9c58('0x5e')]=function(_0xb1f259,_0x215510,_0x521e79){var _0x2a8800={'agent':{},'channel':_0x9c58('0x5f')};if(_0xb1f259['body']['id']){delete _0xb1f259[_0x9c58('0x5a')]['id'];}_0xb1f259['body'][_0x9c58('0x60')]=!![];_0xb1f259[_0x9c58('0x5a')][_0x9c58('0x61')]=moment()[_0x9c58('0x62')](_0x9c58('0x63'));_0xb1f259[_0x9c58('0x5a')]['UserId']=_0xb1f259['body'][_0x9c58('0x64')]||_0xb1f259['user']['id'];_0x2a8800['agent']['id']=_0xb1f259[_0x9c58('0x5a')][_0x9c58('0x64')];return db[_0x9c58('0x3c')]['find']({'where':{'id':_0xb1f259[_0x9c58('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x215510,null))['then'](saveUpdates(_0xb1f259[_0x9c58('0x5a')],null))[_0x9c58('0x1f')](function(_0xec72df){if(_0xec72df){_0x2a8800['message']=_0xec72df['get']({'plain':!![]});return db[_0x9c58('0x65')]['find']({'where':{'id':_0xec72df['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x215510,null))['then'](function(_0x591260){if(_0x591260){return _0x591260[_0x9c58('0x35')]({'UserId':_0xb1f259[_0x9c58('0x5a')][_0x9c58('0x64')],'read1stAt':_[_0x9c58('0x66')](_0x591260['read1stAt'])?moment()[_0x9c58('0x62')](_0x9c58('0x63')):undefined});}return null;})[_0x9c58('0x1f')](function(_0x4b6f82){if(_0x4b6f82){_0x2a8800[_0x9c58('0x67')]=_0x4b6f82[_0x9c58('0x68')]({'plain':!![]});interaction_log[_0x9c58('0x20')](_0x9c58('0x69'),_0xb1f259[_0x9c58('0x6a')]['id'],_0xb1f259[_0x9c58('0x6a')][_0x9c58('0x39')],_0xb1f259[_0x9c58('0x6a')]['role'],_0x2a8800[_0x9c58('0x67')]['id'],_0xb1f259[_0x9c58('0x5a')]?JSON[_0x9c58('0x6b')](_0xb1f259[_0x9c58('0x5a')]):_0x9c58('0x6c'));return respondWithRpcPromise(_0x9c58('0x6d'),_0x9c58('0x6e'),_0x2a8800);}return null;})[_0x9c58('0x1f')](function(_0x59b0eb){var _0x5a08d3=_0x9c58('0x6f')+_0x59b0eb[_0x9c58('0x25')]['ContactId'];return db['sequelize'][_0x9c58('0x42')](_0x5a08d3,{'type':db[_0x9c58('0x70')][_0x9c58('0x71')][_0x9c58('0x72')],'raw':!![]})[_0x9c58('0x1f')](function(_0x57dcc1){return _0x57dcc1;});})[_0x9c58('0x1f')](function(_0x337a1a){if(_0x337a1a){_0x2a8800['message'][_0x9c58('0x73')]=_0x337a1a[0x0];if(!_0xb1f259[_0x9c58('0x5a')]['UserId'])return;return db[_0x9c58('0x74')][_0x9c58('0x59')]({'where':{'id':_0xb1f259['body'][_0x9c58('0x64')],'role':_0x9c58('0x75')},'attributes':['id','name',_0x9c58('0x76'),_0x9c58('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x54d566){if(!_0x54d566)return null;_0x2a8800[_0x9c58('0x25')][_0x9c58('0x75')]=_0x54d566;return _0x2a8800;})['then'](function(_0x33affa){if(_0x33affa){if(_0xb1f259['body'][_0x9c58('0x78')]){_0x2a8800[_0x9c58('0x25')][_0x9c58('0x79')]=util[_0x9c58('0x62')](_0x9c58('0x7a'),_0xb1f259['user'][_0x9c58('0x39')]);_0x2a8800[_0x9c58('0x25')]['channel']=_0x2a8800['channel'];_0x2a8800[_0x9c58('0x25')][_0x9c58('0x7b')]=_0x2a8800['channel'];_0x2a8800[_0x9c58('0x25')][_0x9c58('0x7c')]=_0x9c58('0x5e');return respondWithRpcPromise('EventManager',_0x9c58('0x7d'),{'event':_0x9c58('0x7e'),'message':_0x2a8800[_0x9c58('0x25')]},client9002)[_0x9c58('0x1f')](function(){return _0x2a8800;});}return _0x2a8800;}return null;})['then'](respondWithResult(_0x215510,null))[_0x9c58('0x28')](handleError(_0x215510,null));};var interaction_log=require(_0x9c58('0x5c'))(_0x9c58('0x5d'));exports[_0x9c58('0x33')]=function(_0x56b1d9,_0x5836b8,_0x588f51){var _0x5d33c8={'agent':{},'channel':_0x9c58('0x5f')};if(_0x56b1d9['body']['id']){delete _0x56b1d9[_0x9c58('0x5a')]['id'];}_0x56b1d9[_0x9c58('0x5a')]['UserId']=_0x56b1d9[_0x9c58('0x5a')][_0x9c58('0x64')]||_0x56b1d9[_0x9c58('0x6a')]['id'];_0x5d33c8[_0x9c58('0x75')]['id']=_0x56b1d9[_0x9c58('0x5a')][_0x9c58('0x64')];return db[_0x9c58('0x3c')][_0x9c58('0x59')]({'where':{'id':_0x56b1d9[_0x9c58('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5836b8,null))[_0x9c58('0x1f')](function(_0x1dee42){if(_0x1dee42){_0x5d33c8[_0x9c58('0x25')]=_0x1dee42[_0x9c58('0x68')]({'plain':!![]});return db[_0x9c58('0x65')][_0x9c58('0x59')]({'where':{'id':_0x1dee42['FaxInteractionId']}});}return null;})[_0x9c58('0x1f')](handleEntityNotFound(_0x5836b8,null))['then'](function(_0x24390e){if(_0x24390e){_0x5d33c8[_0x9c58('0x67')]=_0x24390e[_0x9c58('0x68')]({'plain':!![]});interaction_log[_0x9c58('0x20')](_0x9c58('0x7f'),_0x56b1d9['user']['id'],_0x56b1d9[_0x9c58('0x6a')][_0x9c58('0x39')],_0x56b1d9[_0x9c58('0x6a')][_0x9c58('0x80')],_0x5d33c8[_0x9c58('0x67')]['id'],_0x56b1d9[_0x9c58('0x5a')]?JSON['stringify'](_0x56b1d9[_0x9c58('0x5a')]):_0x9c58('0x6c'));return respondWithRpcPromise(_0x9c58('0x81'),_0x9c58('0x82'),_0x5d33c8);}return null;})['then'](function(_0xf6be61){var _0x1da824='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xf6be61[_0x9c58('0x25')][_0x9c58('0x83')];return db[_0x9c58('0x84')][_0x9c58('0x42')](_0x1da824,{'type':db[_0x9c58('0x70')][_0x9c58('0x71')][_0x9c58('0x72')],'raw':!![]})[_0x9c58('0x1f')](function(_0x2c73ee){return _0x2c73ee;});})[_0x9c58('0x1f')](function(_0x5c0acf){if(_0x5c0acf){_0x5d33c8[_0x9c58('0x25')][_0x9c58('0x73')]=_0x5c0acf[0x0];if(!_0x56b1d9['body'][_0x9c58('0x64')])return;return db[_0x9c58('0x74')][_0x9c58('0x59')]({'where':{'id':_0x56b1d9[_0x9c58('0x5a')][_0x9c58('0x64')],'role':'agent'},'attributes':['id',_0x9c58('0x39'),'fullname','email',_0x9c58('0x85')],'raw':!![]});}return null;})[_0x9c58('0x1f')](function(_0x146f75){if(!_0x146f75)return null;_0x5d33c8[_0x9c58('0x25')]['agent']=_0x146f75;return _0x5d33c8;})[_0x9c58('0x1f')](function(_0x525401){if(_0x525401){_0x525401[_0x9c58('0x25')][_0x9c58('0x79')]=util['format'](_0x9c58('0x7a'),_0x56b1d9[_0x9c58('0x6a')][_0x9c58('0x39')]);_0x525401['message']['channel']=_0x5d33c8[_0x9c58('0x86')];_0x525401[_0x9c58('0x25')][_0x9c58('0x7b')]=_0x5d33c8[_0x9c58('0x86')];_0x525401[_0x9c58('0x25')]['event']=_0x9c58('0x33');respondWithRpcPromise('EventManager',_0x9c58('0x7d'),{'event':'rejectmessage','message':_0x525401[_0x9c58('0x25')]},client9002);return _0x5d33c8;}return null;})[_0x9c58('0x1f')](respondWithResult(_0x5836b8,null))[_0x9c58('0x28')](handleError(_0x5836b8,null));};exports[_0x9c58('0x87')]=function(_0x13dfeb,_0x2f6b8e){var _0xa5d6d6;return db[_0x9c58('0x3c')]['create'](_0x13dfeb[_0x9c58('0x5a')],{})[_0x9c58('0x1f')](function(_0x1df01e){_0xa5d6d6=_0x1df01e;return db[_0x9c58('0x88')][_0x9c58('0x89')]({'where':{'id':_0xa5d6d6['ContactId']}});})[_0x9c58('0x1f')](function(_0x13a1cd){if(_[_0x9c58('0x66')](_0x13a1cd)){return;}else{_0xa5d6d6[_0x9c58('0x5f')]=_0x13a1cd['fax'];return db[_0x9c58('0x8a')][_0x9c58('0x89')]({'where':{'id':_0xa5d6d6[_0x9c58('0x8b')]}});}})[_0x9c58('0x1f')](function(_0x11ca41){return respondWithRpcPromise('SendFax',_0x9c58('0x8c'),{'FaxAccountId':_[_0x9c58('0x66')](_0x13dfeb[_0x9c58('0x5a')])?undefined:_0x13dfeb['body'][_0x9c58('0x8d')],'path':_[_0x9c58('0x66')](_0x11ca41)?undefined:util[_0x9c58('0x62')](_0x9c58('0x8e'),_0x11ca41['basename']),'fax':_[_0x9c58('0x66')](_0xa5d6d6['fax'])?undefined:_0xa5d6d6[_0x9c58('0x5f')],'AttachmentId':_0xa5d6d6[_0x9c58('0x8b')]},client9002);})[_0x9c58('0x1f')](respondWithResult(_0x2f6b8e,0xc9))[_0x9c58('0x28')](handleError(_0x2f6b8e,null));};exports[_0x9c58('0x8f')]=function(_0x352d36,_0x47c0f4){var _0x230d10=path['join'](config[_0x9c58('0x90')],'server',_0x9c58('0x91'),'attachments');return db['FaxMessage'][_0x9c58('0x59')]({'where':{'id':_0x352d36[_0x9c58('0x56')]['id']},'include':[{'model':db[_0x9c58('0x8a')],'as':_0x9c58('0x8a')}]})[_0x9c58('0x1f')](handleEntityNotFound(_0x47c0f4,null))[_0x9c58('0x1f')](function(_0x4b59ac){if(_0x4b59ac){return _0x47c0f4['download'](path[_0x9c58('0x92')](_0x230d10,_0x4b59ac['Attachment'][_0x9c58('0x93')]));}})[_0x9c58('0x28')](handleError(_0x47c0f4,null));}; \ No newline at end of file +var _0x7000=['register','jayson/promise','http','client','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','then','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','FaxMessage','findAll','rows','show','params','includeAll','include','find','body','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','update','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','email','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','../../config/logger','fax-interactions','rejectMessage','QueryTypes','fullname','internal','rejectmessage','create','CmContact','findOne','Attachment','SendFax','FaxAccountId','basename','AttachmentId','download','join','server','files','attachments','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.socket'];(function(_0x377ebd,_0xddb478){var _0x2abe4c=function(_0x20c093){while(--_0x20c093){_0x377ebd['push'](_0x377ebd['shift']());}};_0x2abe4c(++_0xddb478);}(_0x7000,0x109));var _0x0700=function(_0x2583b2,_0x45a743){_0x2583b2=_0x2583b2-0x0;var _0xc1b07c=_0x7000[_0x2583b2];return _0xc1b07c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0700('0x0'));var zipdir=require(_0x0700('0x1'));var jsonpatch=require(_0x0700('0x2'));var rp=require(_0x0700('0x3'));var moment=require(_0x0700('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0700('0x5'));var util=require(_0x0700('0x6'));var path=require(_0x0700('0x7'));var sox=require(_0x0700('0x8'));var csv=require('to-csv');var ejs=require(_0x0700('0x9'));var fs=require('fs');var fs_extra=require(_0x0700('0xa'));var _=require(_0x0700('0xb'));var squel=require(_0x0700('0xc'));var crypto=require(_0x0700('0xd'));var jsforce=require(_0x0700('0xe'));var deskjs=require(_0x0700('0xf'));var toCsv=require(_0x0700('0x10'));var querystring=require(_0x0700('0x11'));var Papa=require(_0x0700('0x12'));var Redis=require(_0x0700('0x13'));var authService=require(_0x0700('0x14'));var qs=require(_0x0700('0x15'));var as=require(_0x0700('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0700('0x17'));var utils=require(_0x0700('0x18'));var config=require(_0x0700('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0700('0x1a'))['db'];config[_0x0700('0x1b')]=_[_0x0700('0x1c')](config[_0x0700('0x1b')],{'host':_0x0700('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0700('0x1b')]));require(_0x0700('0x1e'))[_0x0700('0x1f')](socket);var jayson=require(_0x0700('0x20'));var client=jayson['client'][_0x0700('0x21')]({'port':0x232c});var client9002=jayson[_0x0700('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7bca,_0x51bb12,_0x279f9e,_0x5cb67e){return new BPromise(function(_0x335297,_0x3dffca){var _0x930a2a=_0x5cb67e||client;return _0x930a2a[_0x0700('0x23')](_0x3f7bca,_0x279f9e)['then'](function(_0x3721fa){logger[_0x0700('0x24')](_0x0700('0x25'),_0x51bb12,_0x0700('0x26'));logger[_0x0700('0x27')](_0x0700('0x28'),_0x51bb12,'request\x20sent',JSON[_0x0700('0x29')](_0x3721fa));if(_0x3721fa[_0x0700('0x2a')]){if(_0x3721fa['error'][_0x0700('0x2b')]===0x1f4){logger[_0x0700('0x2a')](_0x0700('0x25'),_0x51bb12,_0x3721fa[_0x0700('0x2a')][_0x0700('0x2c')]);return _0x3dffca(_0x3721fa[_0x0700('0x2a')]['message']);}logger[_0x0700('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x51bb12,_0x3721fa[_0x0700('0x2a')]['message']);return _0x335297(_0x3721fa[_0x0700('0x2a')][_0x0700('0x2c')]);}else{logger[_0x0700('0x24')](_0x0700('0x25'),_0x51bb12,_0x0700('0x26'));_0x335297(_0x3721fa[_0x0700('0x2d')][_0x0700('0x2c')]);}})[_0x0700('0x2e')](function(_0x2b8fdd){logger['error'](_0x0700('0x25'),_0x51bb12,_0x2b8fdd);_0x3dffca(_0x2b8fdd);});});}function respondWithStatusCode(_0x3c1644,_0x46d054){_0x46d054=_0x46d054||0xcc;return function(_0x4aa9e6){if(_0x4aa9e6){return _0x3c1644[_0x0700('0x2f')](_0x46d054);}return _0x3c1644['status'](_0x46d054)[_0x0700('0x30')]();};}function respondWithResult(_0x1b861b,_0x34812c){_0x34812c=_0x34812c||0xc8;return function(_0x2d2ece){if(_0x2d2ece){return _0x1b861b[_0x0700('0x31')](_0x34812c)[_0x0700('0x32')](_0x2d2ece);}};}function respondWithFilteredResult(_0x4c9d3b,_0x4aac50){return function(_0x844d81){if(_0x844d81){var _0x41ed54=typeof _0x4aac50[_0x0700('0x33')]==='undefined'&&typeof _0x4aac50[_0x0700('0x34')]===_0x0700('0x35');var _0x5f06cb=_0x844d81[_0x0700('0x36')];var _0x31e630=_0x41ed54?0x0:_0x4aac50[_0x0700('0x33')];var _0x315151=_0x41ed54?_0x844d81['count']:_0x4aac50['offset']+_0x4aac50[_0x0700('0x34')];var _0x1b3cc0;if(_0x315151>=_0x5f06cb){_0x315151=_0x5f06cb;_0x1b3cc0=0xc8;}else{_0x1b3cc0=0xce;}_0x4c9d3b[_0x0700('0x31')](_0x1b3cc0);return _0x4c9d3b[_0x0700('0x37')]('Content-Range',_0x31e630+'-'+_0x315151+'/'+_0x5f06cb)[_0x0700('0x32')](_0x844d81);}return null;};}function patchUpdates(_0x4841ce){return function(_0x244cfb){try{jsonpatch[_0x0700('0x38')](_0x244cfb,_0x4841ce,!![]);}catch(_0x38a860){return BPromise[_0x0700('0x39')](_0x38a860);}return _0x244cfb[_0x0700('0x3a')]();};}function saveUpdates(_0xa1b775,_0x3f1cf9){return function(_0x51595b){if(_0x51595b){return _0x51595b['update'](_0xa1b775)[_0x0700('0x3b')](function(_0x4c27a8){return _0x4c27a8;});}return null;};}function removeEntity(_0x239f09,_0x4e706c){return function(_0x220b3a){if(_0x220b3a){return _0x220b3a['destroy']()[_0x0700('0x3b')](function(){_0x239f09[_0x0700('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb65950,_0x10be05){return function(_0xf12202){if(!_0xf12202){_0xb65950[_0x0700('0x2f')](0x194);}return _0xf12202;};}function handleError(_0x1d47b1,_0x58d6ae){_0x58d6ae=_0x58d6ae||0x1f4;return function(_0x1947e4){logger[_0x0700('0x2a')](_0x1947e4['stack']);if(_0x1947e4[_0x0700('0x3c')]){delete _0x1947e4[_0x0700('0x3c')];}_0x1d47b1[_0x0700('0x31')](_0x58d6ae)[_0x0700('0x3d')](_0x1947e4);};}exports[_0x0700('0x3e')]=function(_0x537cda,_0x42bd64){var _0x16f5d1={},_0x4fed31={},_0xcf918d={'count':0x0,'rows':[]};var _0x482b45=_[_0x0700('0x3f')](db['FaxMessage'][_0x0700('0x40')],function(_0x12460c){return{'name':_0x12460c[_0x0700('0x41')],'type':_0x12460c['type'][_0x0700('0x42')]};});_0x4fed31[_0x0700('0x43')]=_[_0x0700('0x3f')](_0x482b45,_0x0700('0x3c'));_0x4fed31[_0x0700('0x44')]=_[_0x0700('0x45')](_0x537cda['query']);_0x4fed31['filters']=_[_0x0700('0x46')](_0x4fed31['model'],_0x4fed31[_0x0700('0x44')]);_0x16f5d1[_0x0700('0x47')]=_[_0x0700('0x46')](_0x4fed31[_0x0700('0x43')],qs[_0x0700('0x48')](_0x537cda[_0x0700('0x44')]['fields']));_0x16f5d1['attributes']=_0x16f5d1[_0x0700('0x47')][_0x0700('0x49')]?_0x16f5d1[_0x0700('0x47')]:_0x4fed31[_0x0700('0x43')];if(!_0x537cda[_0x0700('0x44')]['hasOwnProperty']('nolimit')){_0x16f5d1[_0x0700('0x34')]=qs[_0x0700('0x34')](_0x537cda[_0x0700('0x44')]['limit']);_0x16f5d1['offset']=qs[_0x0700('0x33')](_0x537cda['query']['offset']);}_0x16f5d1[_0x0700('0x4a')]=qs[_0x0700('0x4b')](_0x537cda[_0x0700('0x44')][_0x0700('0x4b')]);_0x16f5d1[_0x0700('0x4c')]=qs[_0x0700('0x4d')](_[_0x0700('0x4e')](_0x537cda[_0x0700('0x44')],_0x4fed31['filters']),_0x482b45);if(_0x537cda[_0x0700('0x44')]['filter']){_0x16f5d1[_0x0700('0x4c')]=_[_0x0700('0x4f')](_0x16f5d1[_0x0700('0x4c')],{'$or':_['map'](_0x482b45,function(_0xeb7ac9){if(_0xeb7ac9[_0x0700('0x50')]!==_0x0700('0x51')){var _0x52bf0e={};_0x52bf0e[_0xeb7ac9[_0x0700('0x3c')]]={'$like':'%'+_0x537cda['query'][_0x0700('0x52')]+'%'};return _0x52bf0e;}})});}_0x16f5d1=_[_0x0700('0x4f')]({},_0x16f5d1,_0x537cda[_0x0700('0x53')]);var _0x34e8d8={'where':_0x16f5d1[_0x0700('0x4c')]};return db['FaxMessage']['count'](_0x34e8d8)['then'](function(_0x29b7ce){_0xcf918d[_0x0700('0x36')]=_0x29b7ce;if(_0x537cda[_0x0700('0x44')]['includeAll']){_0x16f5d1['include']=[{'all':!![]}];}return db[_0x0700('0x54')][_0x0700('0x55')](_0x16f5d1);})[_0x0700('0x3b')](function(_0x59a0c6){_0xcf918d[_0x0700('0x56')]=_0x59a0c6;return _0xcf918d;})[_0x0700('0x3b')](respondWithFilteredResult(_0x42bd64,_0x16f5d1))['catch'](handleError(_0x42bd64,null));};exports[_0x0700('0x57')]=function(_0x352a91,_0x502e9c){var _0x46474f={'raw':!![],'where':{'id':_0x352a91[_0x0700('0x58')]['id']}},_0x2af5fc={};_0x2af5fc[_0x0700('0x43')]=_[_0x0700('0x45')](db[_0x0700('0x54')][_0x0700('0x40')]);_0x2af5fc[_0x0700('0x44')]=_['keys'](_0x352a91[_0x0700('0x44')]);_0x2af5fc[_0x0700('0x4d')]=_[_0x0700('0x46')](_0x2af5fc[_0x0700('0x43')],_0x2af5fc[_0x0700('0x44')]);_0x46474f[_0x0700('0x47')]=_[_0x0700('0x46')](_0x2af5fc['model'],qs[_0x0700('0x48')](_0x352a91[_0x0700('0x44')][_0x0700('0x48')]));_0x46474f[_0x0700('0x47')]=_0x46474f[_0x0700('0x47')][_0x0700('0x49')]?_0x46474f[_0x0700('0x47')]:_0x2af5fc[_0x0700('0x43')];if(_0x352a91[_0x0700('0x44')][_0x0700('0x59')]){_0x46474f[_0x0700('0x5a')]=[{'all':!![]}];}_0x46474f=_[_0x0700('0x4f')]({},_0x46474f,_0x352a91[_0x0700('0x53')]);return db['FaxMessage'][_0x0700('0x5b')](_0x46474f)[_0x0700('0x3b')](handleEntityNotFound(_0x502e9c,null))['then'](respondWithResult(_0x502e9c,null))[_0x0700('0x2e')](handleError(_0x502e9c,null));};exports['update']=function(_0x3d33a7,_0xc5bcc9){if(_0x3d33a7[_0x0700('0x5c')]['id']){delete _0x3d33a7[_0x0700('0x5c')]['id'];}return db[_0x0700('0x54')][_0x0700('0x5b')]({'where':{'id':_0x3d33a7[_0x0700('0x58')]['id']}})[_0x0700('0x3b')](handleEntityNotFound(_0xc5bcc9,null))[_0x0700('0x3b')](saveUpdates(_0x3d33a7['body'],null))[_0x0700('0x3b')](respondWithResult(_0xc5bcc9,null))[_0x0700('0x2e')](handleError(_0xc5bcc9,null));};exports['destroy']=function(_0x4d7da3,_0x4896b2){return db[_0x0700('0x54')][_0x0700('0x5b')]({'where':{'id':_0x4d7da3['params']['id']}})[_0x0700('0x3b')](handleEntityNotFound(_0x4896b2,null))['then'](removeEntity(_0x4896b2,null))['catch'](handleError(_0x4896b2,null));};exports[_0x0700('0x5d')]=function(_0x1bac1e,_0x470e21){return db[_0x0700('0x54')][_0x0700('0x5d')]()['then'](respondWithResult(_0x470e21,null))['catch'](handleError(_0x470e21,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['accept']=function(_0x1955ea,_0x4c43ae,_0x1fc1f4){var _0x4462a6={'agent':{},'channel':_0x0700('0x5e')};if(_0x1955ea[_0x0700('0x5c')]['id']){delete _0x1955ea[_0x0700('0x5c')]['id'];}_0x1955ea['body'][_0x0700('0x5f')]=!![];_0x1955ea['body'][_0x0700('0x60')]=moment()[_0x0700('0x61')](_0x0700('0x62'));_0x1955ea[_0x0700('0x5c')][_0x0700('0x63')]=_0x1955ea[_0x0700('0x5c')]['UserId']||_0x1955ea['user']['id'];_0x4462a6['agent']['id']=_0x1955ea[_0x0700('0x5c')][_0x0700('0x63')];return db[_0x0700('0x54')][_0x0700('0x5b')]({'where':{'id':_0x1955ea[_0x0700('0x58')]['id'],'UserId':null}})[_0x0700('0x3b')](handleEntityNotFound(_0x4c43ae,null))[_0x0700('0x3b')](saveUpdates(_0x1955ea[_0x0700('0x5c')],null))[_0x0700('0x3b')](function(_0x46c91e){if(_0x46c91e){_0x4462a6[_0x0700('0x2c')]=_0x46c91e[_0x0700('0x64')]({'plain':!![]});return db[_0x0700('0x65')][_0x0700('0x5b')]({'where':{'id':_0x46c91e[_0x0700('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x4c43ae,null))[_0x0700('0x3b')](function(_0x2a26fe){if(_0x2a26fe){return _0x2a26fe[_0x0700('0x67')]({'UserId':_0x1955ea[_0x0700('0x5c')][_0x0700('0x63')],'read1stAt':_[_0x0700('0x68')](_0x2a26fe[_0x0700('0x69')])?moment()[_0x0700('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0700('0x3b')](function(_0xf5538f){if(_0xf5538f){_0x4462a6[_0x0700('0x6a')]=_0xf5538f['get']({'plain':!![]});interaction_log[_0x0700('0x24')](_0x0700('0x6b'),_0x1955ea[_0x0700('0x6c')]['id'],_0x1955ea['user']['name'],_0x1955ea['user'][_0x0700('0x6d')],_0x4462a6[_0x0700('0x6a')]['id'],_0x1955ea[_0x0700('0x5c')]?JSON['stringify'](_0x1955ea[_0x0700('0x5c')]):_0x0700('0x6e'));return respondWithRpcPromise(_0x0700('0x6f'),_0x0700('0x70'),_0x4462a6);}return null;})[_0x0700('0x3b')](function(_0x47c4f4){var _0x2ed39d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x47c4f4[_0x0700('0x2c')][_0x0700('0x71')];return db[_0x0700('0x72')][_0x0700('0x44')](_0x2ed39d,{'type':db[_0x0700('0x73')]['QueryTypes'][_0x0700('0x74')],'raw':!![]})['then'](function(_0x4a7eec){return _0x4a7eec;});})[_0x0700('0x3b')](function(_0x5c8728){if(_0x5c8728){_0x4462a6[_0x0700('0x2c')][_0x0700('0x75')]=_0x5c8728[0x0];if(!_0x1955ea[_0x0700('0x5c')][_0x0700('0x63')])return;return db[_0x0700('0x76')]['find']({'where':{'id':_0x1955ea[_0x0700('0x5c')][_0x0700('0x63')],'role':_0x0700('0x77')},'attributes':['id',_0x0700('0x3c'),'fullname',_0x0700('0x78'),'internal'],'raw':!![]});}return null;})['then'](function(_0x30ee8e){if(!_0x30ee8e)return null;_0x4462a6[_0x0700('0x2c')][_0x0700('0x77')]=_0x30ee8e;return _0x4462a6;})['then'](function(_0x3a3710){if(_0x3a3710){if(_0x1955ea[_0x0700('0x5c')][_0x0700('0x79')]){_0x4462a6[_0x0700('0x2c')][_0x0700('0x7a')]=util[_0x0700('0x61')]('SIP/%s',_0x1955ea[_0x0700('0x6c')][_0x0700('0x3c')]);_0x4462a6['message'][_0x0700('0x7b')]=_0x4462a6['channel'];_0x4462a6['message'][_0x0700('0x7c')]=_0x4462a6[_0x0700('0x7b')];_0x4462a6['message'][_0x0700('0x7d')]='accept';return respondWithRpcPromise(_0x0700('0x7e'),'EventManager',{'event':_0x0700('0x7f'),'message':_0x4462a6[_0x0700('0x2c')]},client9002)[_0x0700('0x3b')](function(){return _0x4462a6;});}return _0x4462a6;}return null;})[_0x0700('0x3b')](respondWithResult(_0x4c43ae,null))[_0x0700('0x2e')](handleError(_0x4c43ae,null));};var interaction_log=require(_0x0700('0x80'))(_0x0700('0x81'));exports[_0x0700('0x39')]=function(_0x189333,_0x420853,_0x5b53a5){var _0x139377={'agent':{},'channel':'fax'};if(_0x189333[_0x0700('0x5c')]['id']){delete _0x189333[_0x0700('0x5c')]['id'];}_0x189333[_0x0700('0x5c')][_0x0700('0x63')]=_0x189333[_0x0700('0x5c')][_0x0700('0x63')]||_0x189333['user']['id'];_0x139377[_0x0700('0x77')]['id']=_0x189333[_0x0700('0x5c')][_0x0700('0x63')];return db['FaxMessage'][_0x0700('0x5b')]({'where':{'id':_0x189333['params']['id'],'UserId':null}})[_0x0700('0x3b')](handleEntityNotFound(_0x420853,null))[_0x0700('0x3b')](function(_0x2021c7){if(_0x2021c7){_0x139377['message']=_0x2021c7['get']({'plain':!![]});return db['FaxInteraction'][_0x0700('0x5b')]({'where':{'id':_0x2021c7[_0x0700('0x66')]}});}return null;})[_0x0700('0x3b')](handleEntityNotFound(_0x420853,null))[_0x0700('0x3b')](function(_0x5e3827){if(_0x5e3827){_0x139377[_0x0700('0x6a')]=_0x5e3827[_0x0700('0x64')]({'plain':!![]});interaction_log['info']('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x189333[_0x0700('0x6c')]['id'],_0x189333[_0x0700('0x6c')][_0x0700('0x3c')],_0x189333[_0x0700('0x6c')]['role'],_0x139377[_0x0700('0x6a')]['id'],_0x189333[_0x0700('0x5c')]?JSON[_0x0700('0x29')](_0x189333[_0x0700('0x5c')]):_0x0700('0x6e'));return respondWithRpcPromise('RejectMessage',_0x0700('0x82'),_0x139377);}return null;})[_0x0700('0x3b')](function(_0x25d291){var _0x32608a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x25d291[_0x0700('0x2c')][_0x0700('0x71')];return db[_0x0700('0x72')][_0x0700('0x44')](_0x32608a,{'type':db[_0x0700('0x73')][_0x0700('0x83')][_0x0700('0x74')],'raw':!![]})['then'](function(_0x31d088){return _0x31d088;});})[_0x0700('0x3b')](function(_0x3264b7){if(_0x3264b7){_0x139377[_0x0700('0x2c')]['contact']=_0x3264b7[0x0];if(!_0x189333[_0x0700('0x5c')][_0x0700('0x63')])return;return db[_0x0700('0x76')][_0x0700('0x5b')]({'where':{'id':_0x189333[_0x0700('0x5c')][_0x0700('0x63')],'role':'agent'},'attributes':['id',_0x0700('0x3c'),_0x0700('0x84'),_0x0700('0x78'),_0x0700('0x85')],'raw':!![]});}return null;})['then'](function(_0x279532){if(!_0x279532)return null;_0x139377[_0x0700('0x2c')]['agent']=_0x279532;return _0x139377;})[_0x0700('0x3b')](function(_0x18a5f6){if(_0x18a5f6){_0x18a5f6[_0x0700('0x2c')][_0x0700('0x7a')]=util[_0x0700('0x61')]('SIP/%s',_0x189333[_0x0700('0x6c')]['name']);_0x18a5f6[_0x0700('0x2c')][_0x0700('0x7b')]=_0x139377['channel'];_0x18a5f6['message'][_0x0700('0x7c')]=_0x139377['channel'];_0x18a5f6[_0x0700('0x2c')][_0x0700('0x7d')]=_0x0700('0x39');respondWithRpcPromise(_0x0700('0x7e'),'EventManager',{'event':_0x0700('0x86'),'message':_0x18a5f6[_0x0700('0x2c')]},client9002);return _0x139377;}return null;})[_0x0700('0x3b')](respondWithResult(_0x420853,null))[_0x0700('0x2e')](handleError(_0x420853,null));};exports[_0x0700('0x87')]=function(_0x3ebaad,_0x2803f5){var _0x40b399;return db[_0x0700('0x54')]['create'](_0x3ebaad[_0x0700('0x5c')],{})[_0x0700('0x3b')](function(_0x474f0){_0x40b399=_0x474f0;return db[_0x0700('0x88')][_0x0700('0x89')]({'where':{'id':_0x40b399[_0x0700('0x71')]}});})[_0x0700('0x3b')](function(_0x1f6a07){if(_[_0x0700('0x68')](_0x1f6a07)){return;}else{_0x40b399['fax']=_0x1f6a07['fax'];return db[_0x0700('0x8a')][_0x0700('0x89')]({'where':{'id':_0x40b399['AttachmentId']}});}})[_0x0700('0x3b')](function(_0x1e24a6){return respondWithRpcPromise(_0x0700('0x8b'),'SendFax',{'FaxAccountId':_[_0x0700('0x68')](_0x3ebaad[_0x0700('0x5c')])?undefined:_0x3ebaad[_0x0700('0x5c')][_0x0700('0x8c')],'path':_[_0x0700('0x68')](_0x1e24a6)?undefined:util[_0x0700('0x61')]('/var/opt/motion2/server/files/attachments/%s',_0x1e24a6[_0x0700('0x8d')]),'fax':_[_0x0700('0x68')](_0x40b399[_0x0700('0x5e')])?undefined:_0x40b399['fax'],'AttachmentId':_0x40b399[_0x0700('0x8e')]},client9002);})[_0x0700('0x3b')](respondWithResult(_0x2803f5,0xc9))[_0x0700('0x2e')](handleError(_0x2803f5,null));};exports[_0x0700('0x8f')]=function(_0x526f54,_0x381daf){var _0x4013dc=path[_0x0700('0x90')](config['root'],_0x0700('0x91'),_0x0700('0x92'),_0x0700('0x93'));return db[_0x0700('0x54')]['find']({'where':{'id':_0x526f54['params']['id']},'include':[{'model':db[_0x0700('0x8a')],'as':_0x0700('0x8a')}]})[_0x0700('0x3b')](handleEntityNotFound(_0x381daf,null))['then'](function(_0x39c399){if(_0x39c399){return _0x381daf[_0x0700('0x8f')](path[_0x0700('0x90')](_0x4013dc,_0x39c399[_0x0700('0x8a')][_0x0700('0x8d')]));}})[_0x0700('0x2e')](handleError(_0x381daf,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 330b96d..2cbbbc0 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 _0x6931=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x2cacef,_0xba1573){var _0x289ba6=function(_0x4ac8b9){while(--_0x4ac8b9){_0x2cacef['push'](_0x2cacef['shift']());}};_0x289ba6(++_0xba1573);}(_0x6931,0x1a9));var _0x1693=function(_0x17d9c2,_0x47142a){_0x17d9c2=_0x17d9c2-0x0;var _0xb37a62=_0x6931[_0x17d9c2];return _0xb37a62;};'use strict';var EventEmitter=require(_0x1693('0x0'));var FaxMessage=require(_0x1693('0x1'))['db'][_0x1693('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1693('0x3')](0x0);var events={'afterCreate':_0x1693('0x4'),'afterUpdate':_0x1693('0x5'),'afterDestroy':_0x1693('0x6')};function emitEvent(_0x2cb142){return function(_0x59d148,_0x19ff1c,_0x2ca960){FaxMessageEvents[_0x1693('0x7')](_0x2cb142+':'+_0x59d148['id'],_0x59d148);FaxMessageEvents[_0x1693('0x7')](_0x2cb142,_0x59d148);_0x2ca960(null);};}for(var e in events){if(events[_0x1693('0x8')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1693('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x2e65=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0xdd27d1,_0xb6f0da){var _0x58220e=function(_0x52bbff){while(--_0x52bbff){_0xdd27d1['push'](_0xdd27d1['shift']());}};_0x58220e(++_0xb6f0da);}(_0x2e65,0x193));var _0x52e6=function(_0x86b219,_0x43038f){_0x86b219=_0x86b219-0x0;var _0x1f320c=_0x2e65[_0x86b219];return _0x1f320c;};'use strict';var EventEmitter=require(_0x52e6('0x0'));var FaxMessage=require(_0x52e6('0x1'))['db'][_0x52e6('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x52e6('0x3')](0x0);var events={'afterCreate':_0x52e6('0x4'),'afterUpdate':_0x52e6('0x5'),'afterDestroy':_0x52e6('0x6')};function emitEvent(_0x74e40d){return function(_0x47912f,_0x383919,_0x12ee44){FaxMessageEvents[_0x52e6('0x7')](_0x74e40d+':'+_0x47912f['id'],_0x47912f);FaxMessageEvents[_0x52e6('0x7')](_0x74e40d,_0x47912f);_0x12ee44(null);};}for(var e in events){if(events[_0x52e6('0x8')](e)){var event=events[e];FaxMessage[_0x52e6('0x9')](e,emitEvent(event));}}module[_0x52e6('0xa')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 6c6c270..f0a54ef 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 _0x3912=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x322723,_0x31b409){var _0x5200f8=function(_0x5d7b93){while(--_0x5d7b93){_0x322723['push'](_0x322723['shift']());}};_0x5200f8(++_0x31b409);}(_0x3912,0x1b2));var _0x2391=function(_0x487c8f,_0x233f1a){_0x487c8f=_0x487c8f-0x0;var _0x39397f=_0x3912[_0x487c8f];return _0x39397f;};'use strict';var _=require(_0x2391('0x0'));var util=require(_0x2391('0x1'));var logger=require(_0x2391('0x2'))(_0x2391('0x3'));var moment=require(_0x2391('0x4'));var BPromise=require(_0x2391('0x5'));var rp=require(_0x2391('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2391('0x7'));var config=require(_0x2391('0x8'));var attributes=require(_0x2391('0x9'));module[_0x2391('0xa')]=function(_0x3d629d,_0x47abac){return _0x3d629d[_0x2391('0xb')](_0x2391('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x2391('0xd'),'fields':[_0x2391('0xe')],'type':_0x2391('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30e5bc,_0x526f87,_0x3cc598){var _0x1557a0=_0x3d629d[_0x2391('0x10')];var _0x4d2487=_0x30e5bc[_0x2391('0x11')]({'plain':!![]});if(_0x4d2487['direction'][_0x2391('0x12')]()==='in'||_0x4d2487[_0x2391('0x13')][_0x2391('0x12')]()===_0x2391('0x14')&&!_0x4d2487['secret']&&!_[_0x2391('0x15')](_0x4d2487[_0x2391('0x16')])){_0x1557a0[_0x2391('0x17')][_0x2391('0x18')]({'where':{'id':_0x4d2487[_0x2391('0x19')]}})['then'](function(_0x4ffbd5){if(_0x4ffbd5){_0x4ffbd5['update']({'lastMsgAt':_0x4d2487[_0x2391('0x1a')],'lastMsgDirection':_0x4d2487['direction']['toLowerCase']()});}})[_0x2391('0x1b')](function(_0x2ce4db){console[_0x2391('0x1c')](_0x2ce4db);});}_0x3cc598();}},'charset':_0x2391('0x1d'),'collate':_0x2391('0x1e')});}; \ No newline at end of file +var _0xa729=['./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xa729,0x19b));var _0x9a72=function(_0x4992be,_0x555abf){_0x4992be=_0x4992be-0x0;var _0x39e44e=_0xa729[_0x4992be];return _0x39e44e;};'use strict';var _=require(_0x9a72('0x0'));var util=require(_0x9a72('0x1'));var logger=require(_0x9a72('0x2'))(_0x9a72('0x3'));var moment=require(_0x9a72('0x4'));var BPromise=require('bluebird');var rp=require(_0x9a72('0x5'));var fs=require('fs');var path=require(_0x9a72('0x6'));var rimraf=require(_0x9a72('0x7'));var config=require(_0x9a72('0x8'));var attributes=require(_0x9a72('0x9'));module[_0x9a72('0xa')]=function(_0x4a08c7,_0x4aa2d5){return _0x4a08c7[_0x9a72('0xb')](_0x9a72('0xc'),attributes,{'tableName':_0x9a72('0xd'),'paranoid':![],'indexes':[{'name':_0x9a72('0xe'),'fields':[_0x9a72('0xf')],'type':_0x9a72('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf76c48,_0x23462b,_0x27da5){var _0x2f7d22=_0x4a08c7['models'];var _0x45b1fd=_0xf76c48[_0x9a72('0x11')]({'plain':!![]});if(_0x45b1fd[_0x9a72('0x12')]['toLowerCase']()==='in'||_0x45b1fd['direction'][_0x9a72('0x13')]()===_0x9a72('0x14')&&!_0x45b1fd[_0x9a72('0x15')]&&!_['isNil'](_0x45b1fd[_0x9a72('0x16')])){_0x2f7d22['FaxInteraction'][_0x9a72('0x17')]({'where':{'id':_0x45b1fd['FaxInteractionId']}})[_0x9a72('0x18')](function(_0x137dd0){if(_0x137dd0){_0x137dd0[_0x9a72('0x19')]({'lastMsgAt':_0x45b1fd['createdAt'],'lastMsgDirection':_0x45b1fd[_0x9a72('0x12')][_0x9a72('0x13')]()});}})[_0x9a72('0x1a')](function(_0x125c4a){console[_0x9a72('0x1b')](_0x125c4a);});}_0x27da5();}},'charset':_0x9a72('0x1c'),'collate':_0x9a72('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 7d187a5..7a4f4f2 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 _0x0a9a=['error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','CreateFaxMessage','debug','UpdateFaxMessage','update','raw','where','attributes','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./faxMessage.socket','register','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xfe7202,_0x4cf97d){var _0x4b4526=function(_0x441568){while(--_0x441568){_0xfe7202['push'](_0xfe7202['shift']());}};_0x4b4526(++_0x4cf97d);}(_0x0a9a,0x183));var _0xa0a9=function(_0xa2b71,_0x3531b2){_0xa2b71=_0xa2b71-0x0;var _0x1fb731=_0x0a9a[_0xa2b71];return _0x1fb731;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});config[_0xa0a9('0xa')]=_['defaults'](config[_0xa0a9('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa0a9('0xb'))(new Redis(config[_0xa0a9('0xa')]));require(_0xa0a9('0xc'))[_0xa0a9('0xd')](socket);function respondWithRpcPromise(_0x4b9b93,_0x2ba0ac,_0x1b5bfb){return new BPromise(function(_0x5ce7e9,_0x5909cf){return client[_0xa0a9('0xe')](_0x4b9b93,_0x1b5bfb)[_0xa0a9('0xf')](function(_0x51d5a5){logger[_0xa0a9('0x10')]('FaxMessage,\x20%s,\x20%s',_0x2ba0ac,_0xa0a9('0x11'));logger['debug'](_0xa0a9('0x12'),_0x2ba0ac,_0xa0a9('0x11'),JSON[_0xa0a9('0x13')](_0x51d5a5));if(_0x51d5a5[_0xa0a9('0x14')]){if(_0x51d5a5[_0xa0a9('0x14')]['code']===0x1f4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);return _0x5909cf(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}logger['error'](_0xa0a9('0x15'),_0x2ba0ac,_0x51d5a5['error']['message']);return _0x5ce7e9(_0x51d5a5[_0xa0a9('0x14')][_0xa0a9('0x16')]);}else{logger[_0xa0a9('0x10')](_0xa0a9('0x15'),_0x2ba0ac,'request\x20sent');_0x5ce7e9(_0x51d5a5[_0xa0a9('0x17')][_0xa0a9('0x16')]);}})[_0xa0a9('0x18')](function(_0x27f8d4){logger[_0xa0a9('0x14')](_0xa0a9('0x15'),_0x2ba0ac,_0x27f8d4);_0x5909cf(_0x27f8d4);});});}exports['CreateFaxMessage']=function(_0x3cdd8c){var _0x3107ce=this;return new Promise(function(_0x4a8e80,_0x53b99d){return db[_0xa0a9('0x19')][_0xa0a9('0x1a')](_0x3cdd8c[_0xa0a9('0x1b')],{'raw':_0x3cdd8c['options']?_0x3cdd8c[_0xa0a9('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xa0a9('0xf')](function(_0x5e6148){logger[_0xa0a9('0x10')](_0xa0a9('0x1d'),_0x3cdd8c);logger[_0xa0a9('0x1e')](_0xa0a9('0x1d'),_0x3cdd8c,JSON['stringify'](_0x5e6148));_0x4a8e80(_0x5e6148);})[_0xa0a9('0x18')](function(_0x4fb909){logger[_0xa0a9('0x14')](_0xa0a9('0x1d'),_0x4fb909[_0xa0a9('0x16')],_0x3cdd8c);_0x53b99d(_0x3107ce[_0xa0a9('0x14')](0x1f4,_0x4fb909['message']));});});};exports[_0xa0a9('0x1f')]=function(_0xe49d3b){var _0x384cd5=this;return new Promise(function(_0x3f4bea,_0x526dd1){return db[_0xa0a9('0x19')][_0xa0a9('0x20')](_0xe49d3b[_0xa0a9('0x1b')],{'raw':_0xe49d3b['options']?_0xe49d3b['options'][_0xa0a9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x22')]||null:null,'attributes':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x23')]||null:null,'limit':_0xe49d3b[_0xa0a9('0x1c')]?_0xe49d3b[_0xa0a9('0x1c')][_0xa0a9('0x24')]||null:null})[_0xa0a9('0xf')](function(_0x554191){logger[_0xa0a9('0x10')](_0xa0a9('0x1f'),_0xe49d3b);logger['debug'](_0xa0a9('0x1f'),_0xe49d3b,JSON[_0xa0a9('0x13')](_0x554191));_0x3f4bea(_0x554191);})['catch'](function(_0x47c19b){logger[_0xa0a9('0x14')]('UpdateFaxMessage',_0x47c19b['message'],_0xe49d3b);_0x526dd1(_0x384cd5[_0xa0a9('0x14')](0x1f4,_0x47c19b[_0xa0a9('0x16')]));});});}; \ No newline at end of file +var _0x54ef=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./faxMessage.socket','request','then','info','request\x20sent','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2e8d63,_0x4d6f2a){var _0x114beb=function(_0x5a8b3f){while(--_0x5a8b3f){_0x2e8d63['push'](_0x2e8d63['shift']());}};_0x114beb(++_0x4d6f2a);}(_0x54ef,0x112));var _0xf54e=function(_0x3b89b1,_0x1931b5){_0x3b89b1=_0x3b89b1-0x0;var _0x4186db=_0x54ef[_0x3b89b1];return _0x4186db;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});config[_0xf54e('0xb')]=_[_0xf54e('0xc')](config['redis'],{'host':_0xf54e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf54e('0xb')]));require(_0xf54e('0xe'))['register'](socket);function respondWithRpcPromise(_0x26fc3e,_0xefa1c0,_0x6b9e61){return new BPromise(function(_0x3ecfb3,_0x5f232a){return client[_0xf54e('0xf')](_0x26fc3e,_0x6b9e61)[_0xf54e('0x10')](function(_0x143d66){logger[_0xf54e('0x11')]('FaxMessage,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0xefa1c0,_0xf54e('0x12'),JSON[_0xf54e('0x13')](_0x143d66));if(_0x143d66[_0xf54e('0x14')]){if(_0x143d66[_0xf54e('0x14')]['code']===0x1f4){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);return _0x5f232a(_0x143d66['error'][_0xf54e('0x16')]);}logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x143d66['error']['message']);return _0x3ecfb3(_0x143d66[_0xf54e('0x14')][_0xf54e('0x16')]);}else{logger[_0xf54e('0x11')](_0xf54e('0x15'),_0xefa1c0,_0xf54e('0x12'));_0x3ecfb3(_0x143d66[_0xf54e('0x17')][_0xf54e('0x16')]);}})[_0xf54e('0x18')](function(_0x1dcc04){logger[_0xf54e('0x14')](_0xf54e('0x15'),_0xefa1c0,_0x1dcc04);_0x5f232a(_0x1dcc04);});});}exports['CreateFaxMessage']=function(_0x48a7e1){var _0x23e14=this;return new Promise(function(_0x59f338,_0x3e1556){return db[_0xf54e('0x19')][_0xf54e('0x1a')](_0x48a7e1[_0xf54e('0x1b')],{'raw':_0x48a7e1[_0xf54e('0x1c')]?_0x48a7e1[_0xf54e('0x1c')][_0xf54e('0x1d')]===undefined?!![]:![]:!![]})[_0xf54e('0x10')](function(_0x3c0169){logger[_0xf54e('0x11')](_0xf54e('0x1e'),_0x48a7e1);logger['debug'](_0xf54e('0x1e'),_0x48a7e1,JSON['stringify'](_0x3c0169));_0x59f338(_0x3c0169);})[_0xf54e('0x18')](function(_0x272df6){logger[_0xf54e('0x14')](_0xf54e('0x1e'),_0x272df6[_0xf54e('0x16')],_0x48a7e1);_0x3e1556(_0x23e14[_0xf54e('0x14')](0x1f4,_0x272df6[_0xf54e('0x16')]));});});};exports[_0xf54e('0x1f')]=function(_0x2342a9){var _0x33457f=this;return new Promise(function(_0xf6cdd7,_0x39c0ae){return db[_0xf54e('0x19')]['update'](_0x2342a9[_0xf54e('0x1b')],{'raw':_0x2342a9['options']?_0x2342a9[_0xf54e('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x20')]||null:null,'attributes':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9[_0xf54e('0x1c')][_0xf54e('0x21')]||null:null,'limit':_0x2342a9[_0xf54e('0x1c')]?_0x2342a9['options']['limit']||null:null})[_0xf54e('0x10')](function(_0x258d29){logger[_0xf54e('0x11')](_0xf54e('0x1f'),_0x2342a9);logger[_0xf54e('0x22')](_0xf54e('0x1f'),_0x2342a9,JSON[_0xf54e('0x13')](_0x258d29));_0xf6cdd7(_0x258d29);})[_0xf54e('0x18')](function(_0x3ae704){logger[_0xf54e('0x14')]('UpdateFaxMessage',_0x3ae704['message'],_0x2342a9);_0x39c0ae(_0x33457f[_0xf54e('0x14')](0x1f4,_0x3ae704[_0xf54e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b267b28..7581065 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 _0x24c8=['./faxMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x110653,_0x3ff1f3){var _0x13c540=function(_0x194c24){while(--_0x194c24){_0x110653['push'](_0x110653['shift']());}};_0x13c540(++_0x3ff1f3);}(_0x24c8,0x1e3));var _0x824c=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x24c8[_0x5a99db];return _0x3aad62;};'use strict';var FaxMessageEvents=require(_0x824c('0x0'));var events=[_0x824c('0x1'),_0x824c('0x2'),_0x824c('0x3')];function createListener(_0x319315,_0x68dea1){return function(_0x53c550){_0x68dea1[_0x824c('0x4')](_0x319315,_0x53c550);};}function removeListener(_0x557c36,_0x3673cb){return function(){FaxMessageEvents[_0x824c('0x5')](_0x557c36,_0x3673cb);};}exports['register']=function(_0x414817){for(var _0x498bc3=0x0,_0x1ce4ee=events[_0x824c('0x6')];_0x498bc3<_0x1ce4ee;_0x498bc3++){var _0x44c8f1=events[_0x498bc3];var _0x13a6a4=createListener('faxMessage:'+_0x44c8f1,_0x414817);FaxMessageEvents['on'](_0x44c8f1,_0x13a6a4);}}; \ No newline at end of file +var _0x3588=['save','update','emit','register','length','faxMessage:','./faxMessage.events'];(function(_0x157f7e,_0x432daa){var _0xcfa55e=function(_0x2b97ca){while(--_0x2b97ca){_0x157f7e['push'](_0x157f7e['shift']());}};_0xcfa55e(++_0x432daa);}(_0x3588,0xe6));var _0x8358=function(_0x433c11,_0x509a13){_0x433c11=_0x433c11-0x0;var _0x1bbb06=_0x3588[_0x433c11];return _0x1bbb06;};'use strict';var FaxMessageEvents=require(_0x8358('0x0'));var events=[_0x8358('0x1'),'remove',_0x8358('0x2')];function createListener(_0x1090a0,_0x13d261){return function(_0x4cf20d){_0x13d261[_0x8358('0x3')](_0x1090a0,_0x4cf20d);};}function removeListener(_0x59bea5,_0x3b1041){return function(){FaxMessageEvents['removeListener'](_0x59bea5,_0x3b1041);};}exports[_0x8358('0x4')]=function(_0x109cd1){for(var _0x291b59=0x0,_0x21695c=events[_0x8358('0x5')];_0x291b59<_0x21695c;_0x291b59++){var _0x1f8a57=events[_0x291b59];var _0x4860b4=createListener(_0x8358('0x6')+_0x1f8a57,_0x109cd1);FaxMessageEvents['on'](_0x1f8a57,_0x4860b4);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 85369d5..0cab259 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 _0xb9a7=['faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','post','tracked'];(function(_0xee6c6f,_0x241922){var _0x26c138=function(_0x4edddb){while(--_0x4edddb){_0xee6c6f['push'](_0xee6c6f['shift']());}};_0x26c138(++_0x241922);}(_0xb9a7,0x112));var _0x7b9a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xb9a7[_0x68c979];return _0x4f0001;};'use strict';var multer=require('multer');var util=require(_0x7b9a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7b9a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7b9a('0x2'));var interaction=require(_0x7b9a('0x3'));var config=require(_0x7b9a('0x4'));var controller=require(_0x7b9a('0x5'));router[_0x7b9a('0x6')]('/',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x8')]);router[_0x7b9a('0x6')](_0x7b9a('0x9'),auth[_0x7b9a('0x7')](),controller['describe']);router[_0x7b9a('0x6')](_0x7b9a('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7b9a('0xb'),auth[_0x7b9a('0x7')](),controller['download']);router[_0x7b9a('0xc')]('/',auth['isAuthenticated'](),interaction[_0x7b9a('0xd')]('fax',_0x7b9a('0xe')),controller[_0x7b9a('0xf')]);router[_0x7b9a('0x10')]('/:id',auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x11')]);router['put'](_0x7b9a('0x12'),auth[_0x7b9a('0x7')](),controller['accept']);router[_0x7b9a('0x10')](_0x7b9a('0x13'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x14')]);router[_0x7b9a('0x15')](_0x7b9a('0xa'),auth[_0x7b9a('0x7')](),controller[_0x7b9a('0x16')]);module[_0x7b9a('0x17')]=router; \ No newline at end of file +var _0xa75b=['get','isAuthenticated','index','/describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller'];(function(_0x445bf3,_0x18e7a7){var _0x305d97=function(_0x303c24){while(--_0x303c24){_0x445bf3['push'](_0x445bf3['shift']());}};_0x305d97(++_0x18e7a7);}(_0xa75b,0x170));var _0xba75=function(_0x323157,_0x4ec29d){_0x323157=_0x323157-0x0;var _0x549768=_0xa75b[_0x323157];return _0x549768;};'use strict';var multer=require(_0xba75('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xba75('0x1'));var express=require(_0xba75('0x2'));var router=express[_0xba75('0x3')]();var fs_extra=require(_0xba75('0x4'));var auth=require(_0xba75('0x5'));var interaction=require(_0xba75('0x6'));var config=require(_0xba75('0x7'));var controller=require(_0xba75('0x8'));router[_0xba75('0x9')]('/',auth[_0xba75('0xa')](),controller[_0xba75('0xb')]);router[_0xba75('0x9')](_0xba75('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xba75('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xba75('0xd')]);router['get'](_0xba75('0xe'),auth[_0xba75('0xa')](),controller[_0xba75('0xf')]);router[_0xba75('0x10')]('/',auth[_0xba75('0xa')](),interaction[_0xba75('0x11')](_0xba75('0x12'),_0xba75('0x13')),controller[_0xba75('0x14')]);router[_0xba75('0x15')](_0xba75('0x16'),auth[_0xba75('0xa')](),controller['update']);router['put'](_0xba75('0x17'),auth['isAuthenticated'](),controller[_0xba75('0x18')]);router[_0xba75('0x15')](_0xba75('0x19'),auth[_0xba75('0xa')](),controller['reject']);router[_0xba75('0x1a')](_0xba75('0x16'),auth[_0xba75('0xa')](),controller[_0xba75('0x1b')]);module[_0xba75('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 44b54ce..c4126c2 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 _0xa533=['beepall','roundrobin','INTEGER','STRING','name','ENUM','rrmemory'];(function(_0x2b114c,_0x1de719){var _0x1fb52e=function(_0x5184c4){while(--_0x5184c4){_0x2b114c['push'](_0x2b114c['shift']());}};_0x1fb52e(++_0x1de719);}(_0xa533,0x13e));var _0x3a53=function(_0x5842c3,_0x56bd74){_0x5842c3=_0x5842c3-0x0;var _0x44bf8c=_0xa533[_0x5842c3];return _0x44bf8c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3a53('0x0')],'unique':_0x3a53('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3a53('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3a53('0x2')](_0x3a53('0x3'),_0x3a53('0x4'),_0x3a53('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3a53('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6811=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x12f4d5,_0xd944df){var _0x3446b8=function(_0x3d937a){while(--_0x3d937a){_0x12f4d5['push'](_0x12f4d5['shift']());}};_0x3446b8(++_0xd944df);}(_0x6811,0x121));var _0x1681=function(_0x602436,_0xbf433){_0x602436=_0x602436-0x0;var _0x504c33=_0x6811[_0x602436];return _0x504c33;};'use strict';var Sequelize=require(_0x1681('0x0'));module[_0x1681('0x1')]={'name':{'type':Sequelize[_0x1681('0x2')],'unique':_0x1681('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1681('0x2')]},'timeout':{'type':Sequelize[_0x1681('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1681('0x5')](_0x1681('0x6'),_0x1681('0x7'),_0x1681('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 c3ddba2..529da6d 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 _0x18da=['compact','value','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','omit','spread','getAgents','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./faxQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','end','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','FaxQueue','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','rawAttributes','pick','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','createdAt','rows','%s/%s','SIP','updatedAt','getTeams','findOne','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all'];(function(_0x291589,_0x394acd){var _0x304d5d=function(_0x12e247){while(--_0x12e247){_0x291589['push'](_0x291589['shift']());}};_0x304d5d(++_0x394acd);}(_0x18da,0x9b));var _0xa18d=function(_0x1e1d8c,_0x4e004c){_0x1e1d8c=_0x1e1d8c-0x0;var _0x5a00ae=_0x18da[_0x1e1d8c];return _0x5a00ae;};'use strict';var emlformat=require(_0xa18d('0x0'));var rimraf=require(_0xa18d('0x1'));var zipdir=require(_0xa18d('0x2'));var jsonpatch=require(_0xa18d('0x3'));var rp=require(_0xa18d('0x4'));var moment=require(_0xa18d('0x5'));var BPromise=require(_0xa18d('0x6'));var Mustache=require(_0xa18d('0x7'));var util=require(_0xa18d('0x8'));var path=require('path');var sox=require(_0xa18d('0x9'));var csv=require(_0xa18d('0xa'));var ejs=require(_0xa18d('0xb'));var fs=require('fs');var fs_extra=require(_0xa18d('0xc'));var _=require(_0xa18d('0xd'));var squel=require(_0xa18d('0xe'));var crypto=require(_0xa18d('0xf'));var jsforce=require(_0xa18d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa18d('0xa'));var querystring=require(_0xa18d('0x11'));var Papa=require('papaparse');var Redis=require(_0xa18d('0x12'));var authService=require(_0xa18d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa18d('0x14'));var hardwareService=require(_0xa18d('0x15'));var logger=require(_0xa18d('0x16'))(_0xa18d('0x17'));var utils=require(_0xa18d('0x18'));var config=require(_0xa18d('0x19'));var licenseUtil=require(_0xa18d('0x1a'));var db=require('../../mysqldb')['db'];config[_0xa18d('0x1b')]=_['defaults'](config[_0xa18d('0x1b')],{'host':_0xa18d('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa18d('0x1b')]));require(_0xa18d('0x1d'))['register'](socket);function respondWithStatusCode(_0x1d852b,_0x295ba9){_0x295ba9=_0x295ba9||0xcc;return function(_0x5745e3){if(_0x5745e3){return _0x1d852b[_0xa18d('0x1e')](_0x295ba9);}return _0x1d852b[_0xa18d('0x1f')](_0x295ba9)['end']();};}function respondWithResult(_0x34ac28,_0x4d756e){_0x4d756e=_0x4d756e||0xc8;return function(_0x311691){if(_0x311691){return _0x34ac28['status'](_0x4d756e)[_0xa18d('0x20')](_0x311691);}};}function respondWithFilteredResult(_0x5e64ee,_0x51ac91){return function(_0x260dae){if(_0x260dae){var _0x384ca0=typeof _0x51ac91[_0xa18d('0x21')]===_0xa18d('0x22')&&typeof _0x51ac91[_0xa18d('0x23')]==='undefined';var _0x11bee6=_0x260dae[_0xa18d('0x24')];var _0x54e1a3=_0x384ca0?0x0:_0x51ac91[_0xa18d('0x21')];var _0x4ddbdd=_0x384ca0?_0x260dae[_0xa18d('0x24')]:_0x51ac91['offset']+_0x51ac91[_0xa18d('0x23')];var _0x3b9d73;if(_0x4ddbdd>=_0x11bee6){_0x4ddbdd=_0x11bee6;_0x3b9d73=0xc8;}else{_0x3b9d73=0xce;}_0x5e64ee[_0xa18d('0x1f')](_0x3b9d73);return _0x5e64ee[_0xa18d('0x25')](_0xa18d('0x26'),_0x54e1a3+'-'+_0x4ddbdd+'/'+_0x11bee6)[_0xa18d('0x20')](_0x260dae);}return null;};}function patchUpdates(_0x2b606b){return function(_0x4708a8){try{jsonpatch[_0xa18d('0x27')](_0x4708a8,_0x2b606b,!![]);}catch(_0x2d3251){return BPromise[_0xa18d('0x28')](_0x2d3251);}return _0x4708a8[_0xa18d('0x29')]();};}function saveUpdates(_0x25d74e,_0xcf0258){return function(_0x1a2dba){if(_0x1a2dba){return _0x1a2dba[_0xa18d('0x2a')](_0x25d74e)[_0xa18d('0x2b')](function(_0x44b813){return _0x44b813;});}return null;};}function removeEntity(_0x5aecbd,_0x35a953){return function(_0x26f4dc){if(_0x26f4dc){return _0x26f4dc[_0xa18d('0x2c')]()['then'](function(){var _0x1dd5b0=_0x26f4dc['get']({'plain':!![]});var _0x5f95e6=_0xa18d('0x2d');return db[_0xa18d('0x2e')][_0xa18d('0x2c')]({'where':{'type':_0x5f95e6,'resourceId':_0x1dd5b0['id']}})[_0xa18d('0x2b')](function(){return _0x26f4dc;});})[_0xa18d('0x2b')](function(){_0x5aecbd['status'](0xcc)[_0xa18d('0x2f')]();});}};}function handleEntityNotFound(_0x1e57a1,_0x2799f2){return function(_0xed604){if(!_0xed604){_0x1e57a1[_0xa18d('0x1e')](0x194);}return _0xed604;};}function handleError(_0x145a53,_0x230fc4){_0x230fc4=_0x230fc4||0x1f4;return function(_0xd18a19){logger['error'](_0xd18a19['stack']);if(_0xd18a19[_0xa18d('0x30')]){delete _0xd18a19[_0xa18d('0x30')];}_0x145a53[_0xa18d('0x1f')](_0x230fc4)[_0xa18d('0x31')](_0xd18a19);};}exports[_0xa18d('0x32')]=function(_0x368ac4,_0x2992bc){var _0x64b68={},_0x5e88af={},_0x550403={'count':0x0,'rows':[]};var _0x4df221=_[_0xa18d('0x33')](db['FaxQueue']['rawAttributes'],function(_0x594020){return{'name':_0x594020[_0xa18d('0x34')],'type':_0x594020[_0xa18d('0x35')][_0xa18d('0x36')]};});_0x5e88af[_0xa18d('0x37')]=_[_0xa18d('0x33')](_0x4df221,_0xa18d('0x30'));_0x5e88af['query']=_[_0xa18d('0x38')](_0x368ac4[_0xa18d('0x39')]);_0x5e88af[_0xa18d('0x3a')]=_[_0xa18d('0x3b')](_0x5e88af[_0xa18d('0x37')],_0x5e88af[_0xa18d('0x39')]);_0x64b68[_0xa18d('0x3c')]=_[_0xa18d('0x3b')](_0x5e88af['model'],qs[_0xa18d('0x3d')](_0x368ac4['query']['fields']));_0x64b68['attributes']=_0x64b68[_0xa18d('0x3c')][_0xa18d('0x3e')]?_0x64b68[_0xa18d('0x3c')]:_0x5e88af[_0xa18d('0x37')];if(!_0x368ac4[_0xa18d('0x39')][_0xa18d('0x3f')](_0xa18d('0x40'))){_0x64b68[_0xa18d('0x23')]=qs[_0xa18d('0x23')](_0x368ac4['query'][_0xa18d('0x23')]);_0x64b68[_0xa18d('0x21')]=qs[_0xa18d('0x21')](_0x368ac4[_0xa18d('0x39')][_0xa18d('0x21')]);}_0x64b68[_0xa18d('0x41')]=qs[_0xa18d('0x42')](_0x368ac4[_0xa18d('0x39')][_0xa18d('0x42')]);_0x64b68[_0xa18d('0x43')]=qs[_0xa18d('0x3a')](_['pick'](_0x368ac4[_0xa18d('0x39')],_0x5e88af[_0xa18d('0x3a')]),_0x4df221);if(_0x368ac4[_0xa18d('0x39')][_0xa18d('0x44')]){_0x64b68[_0xa18d('0x43')]=_[_0xa18d('0x45')](_0x64b68[_0xa18d('0x43')],{'$or':_[_0xa18d('0x33')](_0x4df221,function(_0x1c14b4){if(_0x1c14b4[_0xa18d('0x35')]!=='VIRTUAL'){var _0x34889c={};_0x34889c[_0x1c14b4[_0xa18d('0x30')]]={'$like':'%'+_0x368ac4[_0xa18d('0x39')][_0xa18d('0x44')]+'%'};return _0x34889c;}})});}_0x64b68=_['merge']({},_0x64b68,_0x368ac4[_0xa18d('0x46')]);var _0x354fae={'where':_0x64b68[_0xa18d('0x43')]};return db[_0xa18d('0x47')][_0xa18d('0x24')](_0x354fae)['then'](function(_0xa39e6a){_0x550403[_0xa18d('0x24')]=_0xa39e6a;if(_0x368ac4[_0xa18d('0x39')][_0xa18d('0x48')]){_0x64b68[_0xa18d('0x49')]=[{'all':!![]}];}return db[_0xa18d('0x47')][_0xa18d('0x4a')](_0x64b68);})[_0xa18d('0x2b')](function(_0x54ad22){_0x550403['rows']=_0x54ad22;return _0x550403;})['then'](respondWithFilteredResult(_0x2992bc,_0x64b68))[_0xa18d('0x4b')](handleError(_0x2992bc,null));};exports[_0xa18d('0x4c')]=function(_0x48d151,_0x96a20a){var _0xc3b393={'raw':!![],'where':{'id':_0x48d151[_0xa18d('0x4d')]['id']}},_0x1cbd2c={};_0x1cbd2c[_0xa18d('0x37')]=_['keys'](db['FaxQueue']['rawAttributes']);_0x1cbd2c[_0xa18d('0x39')]=_['keys'](_0x48d151[_0xa18d('0x39')]);_0x1cbd2c[_0xa18d('0x3a')]=_[_0xa18d('0x3b')](_0x1cbd2c[_0xa18d('0x37')],_0x1cbd2c[_0xa18d('0x39')]);_0xc3b393[_0xa18d('0x3c')]=_['intersection'](_0x1cbd2c[_0xa18d('0x37')],qs[_0xa18d('0x3d')](_0x48d151[_0xa18d('0x39')][_0xa18d('0x3d')]));_0xc3b393[_0xa18d('0x3c')]=_0xc3b393[_0xa18d('0x3c')][_0xa18d('0x3e')]?_0xc3b393[_0xa18d('0x3c')]:_0x1cbd2c[_0xa18d('0x37')];if(_0x48d151[_0xa18d('0x39')]['includeAll']){_0xc3b393['include']=[{'all':!![]}];}_0xc3b393=_[_0xa18d('0x45')]({},_0xc3b393,_0x48d151[_0xa18d('0x46')]);return db[_0xa18d('0x47')][_0xa18d('0x4e')](_0xc3b393)[_0xa18d('0x2b')](handleEntityNotFound(_0x96a20a,null))['then'](respondWithResult(_0x96a20a,null))[_0xa18d('0x4b')](handleError(_0x96a20a,null));};exports[_0xa18d('0x4f')]=function(_0x141d84,_0x108564){return db[_0xa18d('0x47')]['create'](_0x141d84[_0xa18d('0x50')],{})[_0xa18d('0x2b')](function(_0x580582){var _0x3f0cda=_0x141d84[_0xa18d('0x51')]['get']({'plain':!![]});if(!_0x3f0cda)throw new Error(_0xa18d('0x52'));if(_0x3f0cda[_0xa18d('0x53')]===_0xa18d('0x51')){var _0x5751dd=_0x580582[_0xa18d('0x54')]({'plain':!![]});var _0x180b01='FaxQueues';return db[_0xa18d('0x55')]['find']({'where':{'name':_0x180b01,'userProfileId':_0x3f0cda['userProfileId']},'raw':!![]})[_0xa18d('0x2b')](function(_0x4de31a){if(_0x4de31a&&_0x4de31a[_0xa18d('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x5751dd[_0xa18d('0x30')],'resourceId':_0x5751dd['id'],'type':_0x4de31a['name'],'sectionId':_0x4de31a['id']},{})[_0xa18d('0x2b')](function(){return _0x580582;});}else{return _0x580582;}})['catch'](function(_0x724000){logger['error'](_0xa18d('0x57'),_0x724000);throw _0x724000;});}return _0x580582;})['then'](respondWithResult(_0x108564,0xc9))['catch'](handleError(_0x108564,null));};exports[_0xa18d('0x2a')]=function(_0xf97be0,_0x17cdb2){if(_0xf97be0['body']['id']){delete _0xf97be0[_0xa18d('0x50')]['id'];}return db[_0xa18d('0x47')][_0xa18d('0x4e')]({'where':{'id':_0xf97be0['params']['id']}})['then'](handleEntityNotFound(_0x17cdb2,null))[_0xa18d('0x2b')](saveUpdates(_0xf97be0[_0xa18d('0x50')],null))[_0xa18d('0x2b')](respondWithResult(_0x17cdb2,null))[_0xa18d('0x4b')](handleError(_0x17cdb2,null));};exports[_0xa18d('0x2c')]=function(_0x48c7bd,_0x38dbca){return db[_0xa18d('0x47')][_0xa18d('0x4e')]({'where':{'id':_0x48c7bd['params']['id']}})[_0xa18d('0x2b')](handleEntityNotFound(_0x38dbca,null))[_0xa18d('0x2b')](removeEntity(_0x38dbca,null))[_0xa18d('0x4b')](handleError(_0x38dbca,null));};exports[_0xa18d('0x58')]=function(_0x52df78,_0x3a87e9){return db[_0xa18d('0x47')][_0xa18d('0x58')]()[_0xa18d('0x2b')](respondWithResult(_0x3a87e9,null))[_0xa18d('0x4b')](handleError(_0x3a87e9,null));};exports[_0xa18d('0x59')]=function(_0x1c3168,_0x45c230,_0x380328){var _0x4939f0={'raw':!![],'where':{}},_0xf358dc={},_0xdd272f;return db[_0xa18d('0x47')]['findOne']({'where':{'id':_0x1c3168[_0xa18d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x45c230,null))[_0xa18d('0x2b')](function(_0x2ae352){if(_0x2ae352){_0xdd272f=_0x2ae352[_0xa18d('0x54')]({'plain':!![]});_0xf358dc[_0xa18d('0x37')]=_[_0xa18d('0x38')](db[_0xa18d('0x5a')][_0xa18d('0x5b')]);_0xf358dc[_0xa18d('0x39')]=_['keys'](_0x1c3168['query']);_0xf358dc['filters']=_['intersection'](_0xf358dc[_0xa18d('0x37')],_0xf358dc['query']);_0x4939f0['attributes']=_[_0xa18d('0x3b')](_0xf358dc[_0xa18d('0x37')],qs['fields'](_0x1c3168[_0xa18d('0x39')][_0xa18d('0x3d')]));_0x4939f0[_0xa18d('0x3c')]=_0x4939f0[_0xa18d('0x3c')]['length']?_0x4939f0['attributes']:_0xf358dc[_0xa18d('0x37')];if(!_0x1c3168[_0xa18d('0x39')][_0xa18d('0x3f')]('nolimit')){_0x4939f0[_0xa18d('0x23')]=qs[_0xa18d('0x23')](_0x1c3168[_0xa18d('0x39')][_0xa18d('0x23')]);_0x4939f0[_0xa18d('0x21')]=qs[_0xa18d('0x21')](_0x1c3168[_0xa18d('0x39')][_0xa18d('0x21')]);}_0x4939f0[_0xa18d('0x41')]=qs[_0xa18d('0x42')](_0x1c3168['query'][_0xa18d('0x42')]);_0x4939f0[_0xa18d('0x43')]=qs[_0xa18d('0x3a')](_[_0xa18d('0x5c')](_0x1c3168[_0xa18d('0x39')],_0xf358dc[_0xa18d('0x3a')]));_0x4939f0[_0xa18d('0x43')][_0xa18d('0x5d')]=_0x2ae352['id'];if(_0x1c3168['query'][_0xa18d('0x44')]){_0x4939f0[_0xa18d('0x43')]=_[_0xa18d('0x45')](_0x4939f0[_0xa18d('0x43')],{'$or':_[_0xa18d('0x33')](_0x4939f0[_0xa18d('0x3c')],function(_0x345a40){var _0x27543f={};_0x27543f[_0x345a40]={'$like':'%'+_0x1c3168['query'][_0xa18d('0x44')]+'%'};return _0x27543f;})});}_0x4939f0=_['merge']({},_0x4939f0,_0x1c3168[_0xa18d('0x46')]);return db[_0xa18d('0x5a')][_0xa18d('0x4a')](_0x4939f0);}})[_0xa18d('0x2b')](function(_0x45b28f){if(_0x45b28f){return db[_0xa18d('0x5e')][_0xa18d('0x5f')]({'where':{'id':_['map'](_0x45b28f,_0xa18d('0x60')),'role':_0xa18d('0x61')},'attributes':['id','name',_0xa18d('0x62'),'updatedAt',_0xa18d('0x63')]});}})[_0xa18d('0x2b')](function(_0x11b61b){if(_0x11b61b){return{'count':_0x11b61b[_0xa18d('0x24')],'rows':_[_0xa18d('0x33')](_0x11b61b[_0xa18d('0x64')],function(_0x9876c0){return{'membername':_0x9876c0[_0xa18d('0x30')],'UserId':_0x9876c0['id'],'queue_name':_0xdd272f[_0xa18d('0x30')],'FaxQueueId':_0xdd272f['id'],'interface':util['format'](_0xa18d('0x65'),_0xa18d('0x66'),_0x9876c0[_0xa18d('0x30')]),'penalty':0x0,'paused':_0x9876c0['faxPause'],'createdAt':_0x9876c0[_0xa18d('0x63')],'updatedAt':_0x9876c0[_0xa18d('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x45c230,_0x4939f0))[_0xa18d('0x4b')](handleError(_0x45c230,null));};exports[_0xa18d('0x68')]=function(_0x3bedd5,_0x48f809,_0x59c0f1){var _0x260ebf={};var _0xe1e42f={};var _0x207da5;var _0x4eb8e6;return db['FaxQueue'][_0xa18d('0x69')]({'where':{'id':_0x3bedd5[_0xa18d('0x4d')]['id']}})[_0xa18d('0x2b')](handleEntityNotFound(_0x48f809,null))[_0xa18d('0x2b')](function(_0x508358){if(_0x508358){_0x207da5=_0x508358;_0xe1e42f[_0xa18d('0x37')]=_['keys'](db['Team'][_0xa18d('0x5b')]);_0xe1e42f[_0xa18d('0x39')]=_['keys'](_0x3bedd5[_0xa18d('0x39')]);_0xe1e42f[_0xa18d('0x3a')]=_[_0xa18d('0x3b')](_0xe1e42f[_0xa18d('0x37')],_0xe1e42f[_0xa18d('0x39')]);_0x260ebf[_0xa18d('0x3c')]=_[_0xa18d('0x3b')](_0xe1e42f[_0xa18d('0x37')],qs['fields'](_0x3bedd5[_0xa18d('0x39')][_0xa18d('0x3d')]));_0x260ebf[_0xa18d('0x3c')]=_0x260ebf['attributes'][_0xa18d('0x3e')]?_0x260ebf[_0xa18d('0x3c')]:_0xe1e42f[_0xa18d('0x37')];_0x260ebf['order']=qs[_0xa18d('0x42')](_0x3bedd5[_0xa18d('0x39')][_0xa18d('0x42')]);_0x260ebf[_0xa18d('0x43')]=qs['filters'](_[_0xa18d('0x5c')](_0x3bedd5[_0xa18d('0x39')],_0xe1e42f[_0xa18d('0x3a')]));if(_0x3bedd5[_0xa18d('0x39')][_0xa18d('0x44')]){_0x260ebf['where']=_['merge'](_0x260ebf['where'],{'$or':_[_0xa18d('0x33')](_0x260ebf[_0xa18d('0x3c')],function(_0x2ef552){var _0x3d527e={};_0x3d527e[_0x2ef552]={'$like':'%'+_0x3bedd5[_0xa18d('0x39')]['filter']+'%'};return _0x3d527e;})});}_0x260ebf=_['merge']({},_0x260ebf,_0x3bedd5[_0xa18d('0x46')]);return _0x207da5[_0xa18d('0x68')](_0x260ebf);}})[_0xa18d('0x2b')](function(_0x4860b2){if(_0x4860b2){_0x4eb8e6=_0x4860b2[_0xa18d('0x3e')];if(!_0x3bedd5['query'][_0xa18d('0x3f')]('nolimit')){_0x260ebf[_0xa18d('0x23')]=qs[_0xa18d('0x23')](_0x3bedd5[_0xa18d('0x39')]['limit']);_0x260ebf[_0xa18d('0x21')]=qs['offset'](_0x3bedd5[_0xa18d('0x39')]['offset']);}return _0x207da5[_0xa18d('0x68')](_0x260ebf);}})[_0xa18d('0x2b')](function(_0x2de5cb){if(_0x2de5cb){return _0x2de5cb?{'count':_0x4eb8e6,'rows':_0x2de5cb}:null;}})[_0xa18d('0x2b')](respondWithResult(_0x48f809,null))[_0xa18d('0x4b')](handleError(_0x48f809,null));};exports[_0xa18d('0x6a')]=function(_0x4e46cd,_0x4b77c8,_0x597a75){var _0x3ff944=_0x4e46cd[_0xa18d('0x50')][_0xa18d('0x6b')];return db[_0xa18d('0x6c')][_0xa18d('0x4a')]({'where':{'id':_0x3ff944},'attributes':['id'],'include':[{'model':db[_0xa18d('0x5e')],'as':_0xa18d('0x6d'),'attributes':['id',_0xa18d('0x30'),_0xa18d('0x6e'),_0xa18d('0x6f'),_0xa18d('0x70')],'raw':!![]}]})['then'](function(_0x1dd872){if(_0x1dd872){var _0x40d057=_[_0xa18d('0x71')](_0x1dd872,function(_0x50db7f){var _0x556a94=_0x50db7f[_0xa18d('0x54')]({'plain':!![]});return _0x556a94[_0xa18d('0x6d')];});return db['FaxQueue']['find']({'where':{'id':_0x4e46cd[_0xa18d('0x4d')]['id']}})[_0xa18d('0x2b')](function(_0x1c47cf){return db[_0xa18d('0x72')][_0xa18d('0x73')](function(_0x49876a){return _0x1c47cf[_0xa18d('0x6a')](_0x3ff944,{'transaction':_0x49876a})[_0xa18d('0x2b')](function(){return BPromise[_0xa18d('0x74')](_0x40d057,function(_0x264b28){return db['UserFaxQueue'][_0xa18d('0x75')]({'where':{'UserId':_0x264b28['id'],'FaxQueueId':_0x4e46cd[_0xa18d('0x4d')]['id']},'transaction':_0x49876a});});})[_0xa18d('0x2b')](function(){_0x40d057[_0xa18d('0x76')](function(_0x5c8895){socket['emit'](_0xa18d('0x77'),{'UserId':_0x5c8895['id'],'FaxQueueId':_0x1c47cf['id']});});});});});}})[_0xa18d('0x2b')](respondWithStatusCode(_0x4b77c8,null))['catch'](handleError(_0x4b77c8,null));};exports[_0xa18d('0x78')]=function(_0x1e08ed,_0xfe3af3,_0x52ab6a){return db[_0xa18d('0x6c')][_0xa18d('0x4a')]({'where':{'id':_0x1e08ed[_0xa18d('0x39')][_0xa18d('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xa18d('0x2b')](handleEntityNotFound(_0xfe3af3,null))[_0xa18d('0x2b')](function(_0x47a57c){var _0xad22c7=_[_0xa18d('0x33')](_0x47a57c,'id');var _0x5f0ab5=[];var _0x3c991f=[];var _0x628645=squel[_0xa18d('0x79')]();_0x628645[_0xa18d('0x7a')](_0xa18d('0x7b'))[_0xa18d('0x7c')]('team_has_fax_queues','tq')['join'](_0xa18d('0x7d'),'ut',_0xa18d('0x7e'))[_0xa18d('0x43')](_0xa18d('0x7f'),_0x1e08ed['params']['id']);for(var _0x1f5f64=0x0;_0x1f5f64<_0x47a57c[_0xa18d('0x3e')];_0x1f5f64+=0x1){let _0x416ff5=_0x47a57c[_0x1f5f64];for(var _0x26693f=0x0;_0x26693f<_0x416ff5['Agents'][_0xa18d('0x3e')];_0x26693f+=0x1){let _0x2eb549=_0x416ff5[_0xa18d('0x6d')][_0x26693f];var _0x754491=_0x628645['clone']();_0x754491[_0xa18d('0x43')](_0xa18d('0x80'),_0x2eb549['id']);_0x3c991f[_0xa18d('0x81')](db[_0xa18d('0x72')][_0xa18d('0x39')](_0x754491[_0xa18d('0x82')](),{'type':db[_0xa18d('0x72')]['QueryTypes']['SELECT']})[_0xa18d('0x2b')](function(_0x4dc381){if(_0x4dc381['length']===0x1){return _0x2eb549['id'];}else{var _0x196fa1=_[_0xa18d('0x83')](_['map'](_0x4dc381,_0xa18d('0x84')),function(_0x40a03f){return _[_0xa18d('0x85')](_0xad22c7,_0x40a03f);});if(_0x196fa1){return _0x2eb549['id'];}}}));}}return BPromise[_0xa18d('0x86')](_0x3c991f)[_0xa18d('0x2b')](function(_0x49605a){_0x5f0ab5=_(_0x5f0ab5)['union'](_0x49605a)[_0xa18d('0x87')]()[_0xa18d('0x88')]();return db[_0xa18d('0x47')][_0xa18d('0x4e')]({'where':{'id':_0x1e08ed[_0xa18d('0x4d')]['id']}})['then'](function(_0x3c22b5){return db[_0xa18d('0x72')][_0xa18d('0x73')](function(_0x3af6cf){return _0x3c22b5[_0xa18d('0x78')](_0x1e08ed['query'][_0xa18d('0x6b')],{'transaction':_0x3af6cf})[_0xa18d('0x2b')](function(){if(!_[_0xa18d('0x89')](_0x5f0ab5)){return _0x3c22b5[_0xa18d('0x8a')](_0x5f0ab5,{'transaction':_0x3af6cf});}})[_0xa18d('0x2b')](function(){_0x5f0ab5[_0xa18d('0x76')](function(_0x357660){socket[_0xa18d('0x8b')](_0xa18d('0x8c'),{'UserId':_0x357660,'FaxQueueId':_0x3c22b5['id']});});});});});});})[_0xa18d('0x2b')](respondWithStatusCode(_0xfe3af3,null))[_0xa18d('0x4b')](handleError(_0xfe3af3,null));};exports['addAgents']=function(_0x44fb30,_0x32547c,_0x6ad89){return db[_0xa18d('0x47')]['find']({'where':{'id':_0x44fb30[_0xa18d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x32547c,null))['then'](function(_0x32dc88){if(_0x32dc88){return _0x32dc88[_0xa18d('0x8d')](_0x44fb30['body'][_0xa18d('0x6b')],_[_0xa18d('0x8e')](_0x44fb30['body'],[_0xa18d('0x6b'),'id'])||{})[_0xa18d('0x8f')](function(_0x63a70){for(var _0x409e73=0x0;_0x409e73<_0x44fb30[_0xa18d('0x50')][_0xa18d('0x6b')]['length'];_0x409e73+=0x1){socket[_0xa18d('0x8b')](_0xa18d('0x77'),{'UserId':Number(_0x44fb30[_0xa18d('0x50')][_0xa18d('0x6b')][_0x409e73]),'FaxQueueId':Number(_0x44fb30[_0xa18d('0x4d')]['id'])});}return _0x63a70;});}})[_0xa18d('0x2b')](respondWithResult(_0x32547c,null))[_0xa18d('0x4b')](handleError(_0x32547c,null));};exports[_0xa18d('0x8a')]=function(_0x215239,_0x1a1b3d,_0x3cff7e){return db[_0xa18d('0x47')]['find']({'where':{'id':_0x215239[_0xa18d('0x4d')]['id']}})[_0xa18d('0x2b')](handleEntityNotFound(_0x1a1b3d,null))[_0xa18d('0x2b')](function(_0x1b2054){if(_0x1b2054){return _0x1b2054[_0xa18d('0x8a')](_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')])['then'](function(){if(_['isArray'](_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')])){for(var _0x5e6ad6=0x0;_0x5e6ad6<_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')]['length'];_0x5e6ad6+=0x1){socket[_0xa18d('0x8b')](_0xa18d('0x8c'),{'UserId':Number(_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')][_0x5e6ad6]),'FaxQueueId':Number(_0x215239[_0xa18d('0x4d')]['id'])});}}else{socket[_0xa18d('0x8b')](_0xa18d('0x8c'),{'UserId':Number(_0x215239[_0xa18d('0x39')][_0xa18d('0x6b')]),'FaxQueueId':Number(_0x215239[_0xa18d('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a1b3d,null))[_0xa18d('0x4b')](handleError(_0x1a1b3d,null));};exports[_0xa18d('0x90')]=function(_0x25f394,_0x5ba08d,_0x986211){var _0x4686e0={};var _0x39b70c={};var _0x3795ac;var _0x420027;return db[_0xa18d('0x47')]['findOne']({'where':{'id':_0x25f394['params']['id']}})['then'](handleEntityNotFound(_0x5ba08d,null))[_0xa18d('0x2b')](function(_0x563ecb){if(_0x563ecb){_0x3795ac=_0x563ecb;_0x39b70c[_0xa18d('0x37')]=_[_0xa18d('0x38')](db[_0xa18d('0x5e')][_0xa18d('0x5b')]);_0x39b70c[_0xa18d('0x39')]=_['keys'](_0x25f394['query']);_0x39b70c['filters']=_['intersection'](_0x39b70c['model'],_0x39b70c[_0xa18d('0x39')]);_0x4686e0['attributes']=_[_0xa18d('0x3b')](_0x39b70c[_0xa18d('0x37')],qs['fields'](_0x25f394['query']['fields']));_0x4686e0[_0xa18d('0x3c')]=_0x4686e0[_0xa18d('0x3c')][_0xa18d('0x3e')]?_0x4686e0[_0xa18d('0x3c')]:_0x39b70c[_0xa18d('0x37')];_0x4686e0[_0xa18d('0x41')]=qs[_0xa18d('0x42')](_0x25f394['query']['sort']);_0x4686e0['where']=qs[_0xa18d('0x3a')](_['pick'](_0x25f394[_0xa18d('0x39')],_0x39b70c['filters']));if(_0x25f394[_0xa18d('0x39')]['filter']){_0x4686e0[_0xa18d('0x43')]=_[_0xa18d('0x45')](_0x4686e0['where'],{'$or':_['map'](_0x4686e0['attributes'],function(_0x52af2e){var _0x244489={};_0x244489[_0x52af2e]={'$like':'%'+_0x25f394['query'][_0xa18d('0x44')]+'%'};return _0x244489;})});}_0x4686e0=_[_0xa18d('0x45')]({},_0x4686e0,_0x25f394[_0xa18d('0x46')]);return _0x3795ac['getAgents'](_0x4686e0);}})['then'](function(_0xde66d9){if(_0xde66d9){_0x420027=_0xde66d9['length'];if(!_0x25f394[_0xa18d('0x39')]['hasOwnProperty']('nolimit')){_0x4686e0[_0xa18d('0x23')]=qs[_0xa18d('0x23')](_0x25f394['query'][_0xa18d('0x23')]);_0x4686e0[_0xa18d('0x21')]=qs[_0xa18d('0x21')](_0x25f394['query'][_0xa18d('0x21')]);}return _0x3795ac[_0xa18d('0x90')](_0x4686e0);}})[_0xa18d('0x2b')](function(_0x24d43a){if(_0x24d43a){return _0x24d43a?{'count':_0x420027,'rows':_0x24d43a}:null;}})[_0xa18d('0x2b')](respondWithResult(_0x5ba08d,null))['catch'](handleError(_0x5ba08d,null));}; \ No newline at end of file +var _0x5e87=['every','TeamId','union','compact','value','sequelize','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','spread','isArray','getAgents','rimraf','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','name','send','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxQueue','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','body','role','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','hasOwnProperty','FaxQueueId','User','UserId','agent','faxPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','findOne','addTeams','ids','Team','Agents','online','interface','transaction','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT'];(function(_0x458fe1,_0xe673b1){var _0x49fa05=function(_0x3aba54){while(--_0x3aba54){_0x458fe1['push'](_0x458fe1['shift']());}};_0x49fa05(++_0xe673b1);}(_0x5e87,0x1ac));var _0x75e8=function(_0x302400,_0x3c66ad){_0x302400=_0x302400-0x0;var _0x26ed52=_0x5e87[_0x302400];return _0x26ed52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x75e8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x75e8('0x1'));var rp=require(_0x75e8('0x2'));var moment=require('moment');var BPromise=require(_0x75e8('0x3'));var Mustache=require(_0x75e8('0x4'));var util=require('util');var path=require('path');var sox=require(_0x75e8('0x5'));var csv=require(_0x75e8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75e8('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x75e8('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x75e8('0x9'));var toCsv=require(_0x75e8('0x6'));var querystring=require(_0x75e8('0xa'));var Papa=require('papaparse');var Redis=require(_0x75e8('0xb'));var authService=require(_0x75e8('0xc'));var qs=require(_0x75e8('0xd'));var as=require(_0x75e8('0xe'));var hardwareService=require(_0x75e8('0xf'));var logger=require('../../config/logger')(_0x75e8('0x10'));var utils=require(_0x75e8('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x75e8('0x12')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x75e8('0x13'))(new Redis(config[_0x75e8('0x12')]));require(_0x75e8('0x14'))[_0x75e8('0x15')](socket);function respondWithStatusCode(_0x503f92,_0x410fef){_0x410fef=_0x410fef||0xcc;return function(_0x8a967e){if(_0x8a967e){return _0x503f92[_0x75e8('0x16')](_0x410fef);}return _0x503f92[_0x75e8('0x17')](_0x410fef)[_0x75e8('0x18')]();};}function respondWithResult(_0x2442e8,_0x1a5ea2){_0x1a5ea2=_0x1a5ea2||0xc8;return function(_0x239d88){if(_0x239d88){return _0x2442e8[_0x75e8('0x17')](_0x1a5ea2)['json'](_0x239d88);}};}function respondWithFilteredResult(_0x21fca5,_0xafe5a9){return function(_0x3b1528){if(_0x3b1528){var _0x57e5a5=typeof _0xafe5a9['offset']===_0x75e8('0x19')&&typeof _0xafe5a9[_0x75e8('0x1a')]===_0x75e8('0x19');var _0x868cc=_0x3b1528['count'];var _0x187f26=_0x57e5a5?0x0:_0xafe5a9[_0x75e8('0x1b')];var _0x2d02de=_0x57e5a5?_0x3b1528[_0x75e8('0x1c')]:_0xafe5a9[_0x75e8('0x1b')]+_0xafe5a9[_0x75e8('0x1a')];var _0x1c0fce;if(_0x2d02de>=_0x868cc){_0x2d02de=_0x868cc;_0x1c0fce=0xc8;}else{_0x1c0fce=0xce;}_0x21fca5['status'](_0x1c0fce);return _0x21fca5[_0x75e8('0x1d')](_0x75e8('0x1e'),_0x187f26+'-'+_0x2d02de+'/'+_0x868cc)['json'](_0x3b1528);}return null;};}function patchUpdates(_0x263f5f){return function(_0x16c413){try{jsonpatch[_0x75e8('0x1f')](_0x16c413,_0x263f5f,!![]);}catch(_0x2558da){return BPromise[_0x75e8('0x20')](_0x2558da);}return _0x16c413[_0x75e8('0x21')]();};}function saveUpdates(_0x508199,_0x3f49c2){return function(_0x37dcd3){if(_0x37dcd3){return _0x37dcd3[_0x75e8('0x22')](_0x508199)[_0x75e8('0x23')](function(_0x4ede8b){return _0x4ede8b;});}return null;};}function removeEntity(_0x4913e8,_0x67b2f4){return function(_0x2dde34){if(_0x2dde34){return _0x2dde34[_0x75e8('0x24')]()[_0x75e8('0x23')](function(){var _0x3d68b2=_0x2dde34[_0x75e8('0x25')]({'plain':!![]});var _0x137c61=_0x75e8('0x26');return db[_0x75e8('0x27')]['destroy']({'where':{'type':_0x137c61,'resourceId':_0x3d68b2['id']}})['then'](function(){return _0x2dde34;});})[_0x75e8('0x23')](function(){_0x4913e8[_0x75e8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ea446,_0x7748ff){return function(_0x44aada){if(!_0x44aada){_0x2ea446[_0x75e8('0x16')](0x194);}return _0x44aada;};}function handleError(_0x529dca,_0x27cf39){_0x27cf39=_0x27cf39||0x1f4;return function(_0x49e77c){logger[_0x75e8('0x28')](_0x49e77c['stack']);if(_0x49e77c['name']){delete _0x49e77c[_0x75e8('0x29')];}_0x529dca['status'](_0x27cf39)[_0x75e8('0x2a')](_0x49e77c);};}exports[_0x75e8('0x2b')]=function(_0x42dba6,_0x55f5a8){var _0x1afc30={},_0x5f51b6={},_0x58478f={'count':0x0,'rows':[]};var _0x329d34=_[_0x75e8('0x2c')](db['FaxQueue']['rawAttributes'],function(_0x2d8d43){return{'name':_0x2d8d43[_0x75e8('0x2d')],'type':_0x2d8d43[_0x75e8('0x2e')][_0x75e8('0x2f')]};});_0x5f51b6[_0x75e8('0x30')]=_[_0x75e8('0x2c')](_0x329d34,_0x75e8('0x29'));_0x5f51b6[_0x75e8('0x31')]=_['keys'](_0x42dba6[_0x75e8('0x31')]);_0x5f51b6[_0x75e8('0x32')]=_[_0x75e8('0x33')](_0x5f51b6[_0x75e8('0x30')],_0x5f51b6['query']);_0x1afc30[_0x75e8('0x34')]=_[_0x75e8('0x33')](_0x5f51b6['model'],qs[_0x75e8('0x35')](_0x42dba6[_0x75e8('0x31')]['fields']));_0x1afc30['attributes']=_0x1afc30[_0x75e8('0x34')][_0x75e8('0x36')]?_0x1afc30[_0x75e8('0x34')]:_0x5f51b6[_0x75e8('0x30')];if(!_0x42dba6[_0x75e8('0x31')]['hasOwnProperty'](_0x75e8('0x37'))){_0x1afc30[_0x75e8('0x1a')]=qs[_0x75e8('0x1a')](_0x42dba6[_0x75e8('0x31')][_0x75e8('0x1a')]);_0x1afc30[_0x75e8('0x1b')]=qs[_0x75e8('0x1b')](_0x42dba6[_0x75e8('0x31')][_0x75e8('0x1b')]);}_0x1afc30[_0x75e8('0x38')]=qs[_0x75e8('0x39')](_0x42dba6[_0x75e8('0x31')][_0x75e8('0x39')]);_0x1afc30[_0x75e8('0x3a')]=qs['filters'](_[_0x75e8('0x3b')](_0x42dba6[_0x75e8('0x31')],_0x5f51b6[_0x75e8('0x32')]),_0x329d34);if(_0x42dba6[_0x75e8('0x31')][_0x75e8('0x3c')]){_0x1afc30[_0x75e8('0x3a')]=_[_0x75e8('0x3d')](_0x1afc30[_0x75e8('0x3a')],{'$or':_[_0x75e8('0x2c')](_0x329d34,function(_0x2ebcf2){if(_0x2ebcf2[_0x75e8('0x2e')]!==_0x75e8('0x3e')){var _0xc4e117={};_0xc4e117[_0x2ebcf2[_0x75e8('0x29')]]={'$like':'%'+_0x42dba6[_0x75e8('0x31')][_0x75e8('0x3c')]+'%'};return _0xc4e117;}})});}_0x1afc30=_[_0x75e8('0x3d')]({},_0x1afc30,_0x42dba6[_0x75e8('0x3f')]);var _0x9e0292={'where':_0x1afc30[_0x75e8('0x3a')]};return db[_0x75e8('0x40')]['count'](_0x9e0292)[_0x75e8('0x23')](function(_0x3228b8){_0x58478f['count']=_0x3228b8;if(_0x42dba6[_0x75e8('0x31')][_0x75e8('0x41')]){_0x1afc30[_0x75e8('0x42')]=[{'all':!![]}];}return db[_0x75e8('0x40')][_0x75e8('0x43')](_0x1afc30);})[_0x75e8('0x23')](function(_0x44065f){_0x58478f['rows']=_0x44065f;return _0x58478f;})['then'](respondWithFilteredResult(_0x55f5a8,_0x1afc30))['catch'](handleError(_0x55f5a8,null));};exports[_0x75e8('0x44')]=function(_0x3aedb4,_0x41f70e){var _0x2c3568={'raw':!![],'where':{'id':_0x3aedb4[_0x75e8('0x45')]['id']}},_0xf8c5f8={};_0xf8c5f8[_0x75e8('0x30')]=_[_0x75e8('0x46')](db['FaxQueue'][_0x75e8('0x47')]);_0xf8c5f8[_0x75e8('0x31')]=_['keys'](_0x3aedb4[_0x75e8('0x31')]);_0xf8c5f8[_0x75e8('0x32')]=_['intersection'](_0xf8c5f8[_0x75e8('0x30')],_0xf8c5f8[_0x75e8('0x31')]);_0x2c3568[_0x75e8('0x34')]=_[_0x75e8('0x33')](_0xf8c5f8[_0x75e8('0x30')],qs[_0x75e8('0x35')](_0x3aedb4[_0x75e8('0x31')][_0x75e8('0x35')]));_0x2c3568[_0x75e8('0x34')]=_0x2c3568[_0x75e8('0x34')][_0x75e8('0x36')]?_0x2c3568[_0x75e8('0x34')]:_0xf8c5f8[_0x75e8('0x30')];if(_0x3aedb4[_0x75e8('0x31')][_0x75e8('0x41')]){_0x2c3568['include']=[{'all':!![]}];}_0x2c3568=_[_0x75e8('0x3d')]({},_0x2c3568,_0x3aedb4[_0x75e8('0x3f')]);return db[_0x75e8('0x40')][_0x75e8('0x48')](_0x2c3568)['then'](handleEntityNotFound(_0x41f70e,null))[_0x75e8('0x23')](respondWithResult(_0x41f70e,null))[_0x75e8('0x49')](handleError(_0x41f70e,null));};exports['create']=function(_0x3aeaaf,_0x536320){return db['FaxQueue']['create'](_0x3aeaaf[_0x75e8('0x4a')],{})['then'](function(_0x320e47){var _0xc722d6=_0x3aeaaf['user'][_0x75e8('0x25')]({'plain':!![]});if(!_0xc722d6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc722d6[_0x75e8('0x4b')]===_0x75e8('0x4c')){var _0x173028=_0x320e47['get']({'plain':!![]});var _0x3abce6=_0x75e8('0x26');return db[_0x75e8('0x4d')][_0x75e8('0x48')]({'where':{'name':_0x3abce6,'userProfileId':_0xc722d6[_0x75e8('0x4e')]},'raw':!![]})[_0x75e8('0x23')](function(_0x295578){if(_0x295578&&_0x295578[_0x75e8('0x4f')]===0x0){return db[_0x75e8('0x27')][_0x75e8('0x50')]({'name':_0x173028[_0x75e8('0x29')],'resourceId':_0x173028['id'],'type':_0x295578[_0x75e8('0x29')],'sectionId':_0x295578['id']},{})[_0x75e8('0x23')](function(){return _0x320e47;});}else{return _0x320e47;}})[_0x75e8('0x49')](function(_0x2cdae4){logger[_0x75e8('0x28')](_0x75e8('0x51'),_0x2cdae4);throw _0x2cdae4;});}return _0x320e47;})[_0x75e8('0x23')](respondWithResult(_0x536320,0xc9))[_0x75e8('0x49')](handleError(_0x536320,null));};exports['update']=function(_0x98b423,_0x13184f){if(_0x98b423[_0x75e8('0x4a')]['id']){delete _0x98b423[_0x75e8('0x4a')]['id'];}return db[_0x75e8('0x40')][_0x75e8('0x48')]({'where':{'id':_0x98b423[_0x75e8('0x45')]['id']}})[_0x75e8('0x23')](handleEntityNotFound(_0x13184f,null))[_0x75e8('0x23')](saveUpdates(_0x98b423['body'],null))[_0x75e8('0x23')](respondWithResult(_0x13184f,null))[_0x75e8('0x49')](handleError(_0x13184f,null));};exports[_0x75e8('0x24')]=function(_0x1ba19f,_0x3e56ee){return db[_0x75e8('0x40')][_0x75e8('0x48')]({'where':{'id':_0x1ba19f['params']['id']}})[_0x75e8('0x23')](handleEntityNotFound(_0x3e56ee,null))[_0x75e8('0x23')](removeEntity(_0x3e56ee,null))['catch'](handleError(_0x3e56ee,null));};exports[_0x75e8('0x52')]=function(_0x46fbe4,_0x1f9ed2){return db[_0x75e8('0x40')][_0x75e8('0x52')]()[_0x75e8('0x23')](respondWithResult(_0x1f9ed2,null))[_0x75e8('0x49')](handleError(_0x1f9ed2,null));};exports[_0x75e8('0x53')]=function(_0x59bb4d,_0x4e3af6,_0x1b6d35){var _0x3cfec6={'raw':!![],'where':{}},_0x4918ef={},_0x7c1dd2;return db[_0x75e8('0x40')]['findOne']({'where':{'id':_0x59bb4d[_0x75e8('0x45')]['id']}})[_0x75e8('0x23')](handleEntityNotFound(_0x4e3af6,null))['then'](function(_0x3e58e4){if(_0x3e58e4){_0x7c1dd2=_0x3e58e4[_0x75e8('0x25')]({'plain':!![]});_0x4918ef['model']=_['keys'](db[_0x75e8('0x54')][_0x75e8('0x47')]);_0x4918ef['query']=_[_0x75e8('0x46')](_0x59bb4d['query']);_0x4918ef[_0x75e8('0x32')]=_[_0x75e8('0x33')](_0x4918ef[_0x75e8('0x30')],_0x4918ef[_0x75e8('0x31')]);_0x3cfec6[_0x75e8('0x34')]=_[_0x75e8('0x33')](_0x4918ef['model'],qs['fields'](_0x59bb4d[_0x75e8('0x31')]['fields']));_0x3cfec6[_0x75e8('0x34')]=_0x3cfec6[_0x75e8('0x34')][_0x75e8('0x36')]?_0x3cfec6['attributes']:_0x4918ef['model'];if(!_0x59bb4d[_0x75e8('0x31')][_0x75e8('0x55')](_0x75e8('0x37'))){_0x3cfec6[_0x75e8('0x1a')]=qs['limit'](_0x59bb4d[_0x75e8('0x31')]['limit']);_0x3cfec6[_0x75e8('0x1b')]=qs['offset'](_0x59bb4d['query']['offset']);}_0x3cfec6[_0x75e8('0x38')]=qs[_0x75e8('0x39')](_0x59bb4d[_0x75e8('0x31')][_0x75e8('0x39')]);_0x3cfec6[_0x75e8('0x3a')]=qs[_0x75e8('0x32')](_[_0x75e8('0x3b')](_0x59bb4d[_0x75e8('0x31')],_0x4918ef[_0x75e8('0x32')]));_0x3cfec6['where'][_0x75e8('0x56')]=_0x3e58e4['id'];if(_0x59bb4d[_0x75e8('0x31')][_0x75e8('0x3c')]){_0x3cfec6[_0x75e8('0x3a')]=_['merge'](_0x3cfec6['where'],{'$or':_[_0x75e8('0x2c')](_0x3cfec6[_0x75e8('0x34')],function(_0x2d7ace){var _0x5e1869={};_0x5e1869[_0x2d7ace]={'$like':'%'+_0x59bb4d[_0x75e8('0x31')]['filter']+'%'};return _0x5e1869;})});}_0x3cfec6=_[_0x75e8('0x3d')]({},_0x3cfec6,_0x59bb4d[_0x75e8('0x3f')]);return db[_0x75e8('0x54')][_0x75e8('0x43')](_0x3cfec6);}})[_0x75e8('0x23')](function(_0x3c27f9){if(_0x3c27f9){return db[_0x75e8('0x57')]['findAndCountAll']({'where':{'id':_[_0x75e8('0x2c')](_0x3c27f9,_0x75e8('0x58')),'role':_0x75e8('0x59')},'attributes':['id','name',_0x75e8('0x5a'),_0x75e8('0x5b'),'createdAt']});}})[_0x75e8('0x23')](function(_0x2c6b0d){if(_0x2c6b0d){return{'count':_0x2c6b0d[_0x75e8('0x1c')],'rows':_[_0x75e8('0x2c')](_0x2c6b0d[_0x75e8('0x5c')],function(_0x52282a){return{'membername':_0x52282a[_0x75e8('0x29')],'UserId':_0x52282a['id'],'queue_name':_0x7c1dd2['name'],'FaxQueueId':_0x7c1dd2['id'],'interface':util[_0x75e8('0x5d')](_0x75e8('0x5e'),_0x75e8('0x5f'),_0x52282a[_0x75e8('0x29')]),'penalty':0x0,'paused':_0x52282a[_0x75e8('0x5a')],'createdAt':_0x52282a[_0x75e8('0x60')],'updatedAt':_0x52282a[_0x75e8('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x75e8('0x23')](respondWithFilteredResult(_0x4e3af6,_0x3cfec6))[_0x75e8('0x49')](handleError(_0x4e3af6,null));};exports[_0x75e8('0x61')]=function(_0x20a813,_0x23a770,_0x32942d){var _0x561bd9={};var _0x50fe2c={};var _0x9b3a2a;var _0x3fe766;return db[_0x75e8('0x40')][_0x75e8('0x62')]({'where':{'id':_0x20a813[_0x75e8('0x45')]['id']}})['then'](handleEntityNotFound(_0x23a770,null))['then'](function(_0x17973d){if(_0x17973d){_0x9b3a2a=_0x17973d;_0x50fe2c[_0x75e8('0x30')]=_['keys'](db['Team'][_0x75e8('0x47')]);_0x50fe2c['query']=_[_0x75e8('0x46')](_0x20a813['query']);_0x50fe2c[_0x75e8('0x32')]=_[_0x75e8('0x33')](_0x50fe2c['model'],_0x50fe2c[_0x75e8('0x31')]);_0x561bd9[_0x75e8('0x34')]=_['intersection'](_0x50fe2c[_0x75e8('0x30')],qs[_0x75e8('0x35')](_0x20a813[_0x75e8('0x31')][_0x75e8('0x35')]));_0x561bd9[_0x75e8('0x34')]=_0x561bd9[_0x75e8('0x34')][_0x75e8('0x36')]?_0x561bd9[_0x75e8('0x34')]:_0x50fe2c[_0x75e8('0x30')];_0x561bd9[_0x75e8('0x38')]=qs[_0x75e8('0x39')](_0x20a813[_0x75e8('0x31')][_0x75e8('0x39')]);_0x561bd9[_0x75e8('0x3a')]=qs[_0x75e8('0x32')](_[_0x75e8('0x3b')](_0x20a813[_0x75e8('0x31')],_0x50fe2c['filters']));if(_0x20a813['query'][_0x75e8('0x3c')]){_0x561bd9[_0x75e8('0x3a')]=_[_0x75e8('0x3d')](_0x561bd9['where'],{'$or':_['map'](_0x561bd9[_0x75e8('0x34')],function(_0x229a0e){var _0xeb68dd={};_0xeb68dd[_0x229a0e]={'$like':'%'+_0x20a813['query']['filter']+'%'};return _0xeb68dd;})});}_0x561bd9=_[_0x75e8('0x3d')]({},_0x561bd9,_0x20a813['options']);return _0x9b3a2a[_0x75e8('0x61')](_0x561bd9);}})[_0x75e8('0x23')](function(_0x46d2ee){if(_0x46d2ee){_0x3fe766=_0x46d2ee[_0x75e8('0x36')];if(!_0x20a813[_0x75e8('0x31')][_0x75e8('0x55')](_0x75e8('0x37'))){_0x561bd9['limit']=qs['limit'](_0x20a813['query']['limit']);_0x561bd9[_0x75e8('0x1b')]=qs[_0x75e8('0x1b')](_0x20a813[_0x75e8('0x31')]['offset']);}return _0x9b3a2a[_0x75e8('0x61')](_0x561bd9);}})[_0x75e8('0x23')](function(_0x598fc0){if(_0x598fc0){return _0x598fc0?{'count':_0x3fe766,'rows':_0x598fc0}:null;}})[_0x75e8('0x23')](respondWithResult(_0x23a770,null))['catch'](handleError(_0x23a770,null));};exports[_0x75e8('0x63')]=function(_0x3d307a,_0x50a92c,_0x52bdc1){var _0x588803=_0x3d307a[_0x75e8('0x4a')][_0x75e8('0x64')];return db[_0x75e8('0x65')][_0x75e8('0x43')]({'where':{'id':_0x588803},'attributes':['id'],'include':[{'model':db[_0x75e8('0x57')],'as':_0x75e8('0x66'),'attributes':['id',_0x75e8('0x29'),_0x75e8('0x67'),'voicePause',_0x75e8('0x68')],'raw':!![]}]})[_0x75e8('0x23')](function(_0x26b2df){if(_0x26b2df){var _0x59c15f=_['flatMap'](_0x26b2df,function(_0x4dfc99){var _0x4e4dea=_0x4dfc99[_0x75e8('0x25')]({'plain':!![]});return _0x4e4dea[_0x75e8('0x66')];});return db['FaxQueue'][_0x75e8('0x48')]({'where':{'id':_0x3d307a[_0x75e8('0x45')]['id']}})['then'](function(_0x229e0d){return db['sequelize'][_0x75e8('0x69')](function(_0x2bb1c7){return _0x229e0d[_0x75e8('0x63')](_0x588803,{'transaction':_0x2bb1c7})['then'](function(){return BPromise[_0x75e8('0x6a')](_0x59c15f,function(_0x578f71){return db[_0x75e8('0x54')][_0x75e8('0x6b')]({'where':{'UserId':_0x578f71['id'],'FaxQueueId':_0x3d307a[_0x75e8('0x45')]['id']},'transaction':_0x2bb1c7});});})[_0x75e8('0x23')](function(){_0x59c15f[_0x75e8('0x6c')](function(_0x3da565){socket['emit'](_0x75e8('0x6d'),{'UserId':_0x3da565['id'],'FaxQueueId':_0x229e0d['id']});});});});});}})[_0x75e8('0x23')](respondWithStatusCode(_0x50a92c,null))[_0x75e8('0x49')](handleError(_0x50a92c,null));};exports[_0x75e8('0x6e')]=function(_0xca339f,_0x2f921a,_0x50c4dd){return db[_0x75e8('0x65')]['findAll']({'where':{'id':_0xca339f[_0x75e8('0x31')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x75e8('0x66'),'attributes':['id'],'raw':!![]}]})[_0x75e8('0x23')](handleEntityNotFound(_0x2f921a,null))[_0x75e8('0x23')](function(_0x713dcf){var _0x322493=_[_0x75e8('0x2c')](_0x713dcf,'id');var _0x2f840e=[];var _0x2be526=[];var _0x5a1d42=squel['select']();_0x5a1d42[_0x75e8('0x6f')](_0x75e8('0x70'))[_0x75e8('0x71')](_0x75e8('0x72'),'tq')['join'](_0x75e8('0x73'),'ut',_0x75e8('0x74'))[_0x75e8('0x3a')](_0x75e8('0x75'),_0xca339f[_0x75e8('0x45')]['id']);for(var _0x264fc3=0x0;_0x264fc3<_0x713dcf[_0x75e8('0x36')];_0x264fc3+=0x1){let _0x77a170=_0x713dcf[_0x264fc3];for(var _0x1a80b7=0x0;_0x1a80b7<_0x77a170[_0x75e8('0x66')]['length'];_0x1a80b7+=0x1){let _0x2b35a4=_0x77a170[_0x75e8('0x66')][_0x1a80b7];var _0x2842f0=_0x5a1d42[_0x75e8('0x76')]();_0x2842f0[_0x75e8('0x3a')](_0x75e8('0x77'),_0x2b35a4['id']);_0x2be526[_0x75e8('0x78')](db['sequelize'][_0x75e8('0x31')](_0x2842f0[_0x75e8('0x79')](),{'type':db['sequelize'][_0x75e8('0x7a')][_0x75e8('0x7b')]})['then'](function(_0x56d7ca){if(_0x56d7ca['length']===0x1){return _0x2b35a4['id'];}else{var _0x3381b1=_[_0x75e8('0x7c')](_['map'](_0x56d7ca,_0x75e8('0x7d')),function(_0x461eae){return _['includes'](_0x322493,_0x461eae);});if(_0x3381b1){return _0x2b35a4['id'];}}}));}}return BPromise['all'](_0x2be526)[_0x75e8('0x23')](function(_0x568ad1){_0x2f840e=_(_0x2f840e)[_0x75e8('0x7e')](_0x568ad1)[_0x75e8('0x7f')]()[_0x75e8('0x80')]();return db[_0x75e8('0x40')][_0x75e8('0x48')]({'where':{'id':_0xca339f[_0x75e8('0x45')]['id']}})[_0x75e8('0x23')](function(_0x3880e9){return db[_0x75e8('0x81')]['transaction'](function(_0x9e3dfa){return _0x3880e9[_0x75e8('0x6e')](_0xca339f['query'][_0x75e8('0x64')],{'transaction':_0x9e3dfa})[_0x75e8('0x23')](function(){if(!_[_0x75e8('0x82')](_0x2f840e)){return _0x3880e9[_0x75e8('0x83')](_0x2f840e,{'transaction':_0x9e3dfa});}})['then'](function(){_0x2f840e[_0x75e8('0x6c')](function(_0x50b46e){socket[_0x75e8('0x84')](_0x75e8('0x85'),{'UserId':_0x50b46e,'FaxQueueId':_0x3880e9['id']});});});});});});})[_0x75e8('0x23')](respondWithStatusCode(_0x2f921a,null))[_0x75e8('0x49')](handleError(_0x2f921a,null));};exports[_0x75e8('0x86')]=function(_0xc45af4,_0x4f200b,_0x4cd389){return db[_0x75e8('0x40')][_0x75e8('0x48')]({'where':{'id':_0xc45af4[_0x75e8('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f200b,null))['then'](function(_0x5bc960){if(_0x5bc960){return _0x5bc960[_0x75e8('0x86')](_0xc45af4['body'][_0x75e8('0x64')],_['omit'](_0xc45af4[_0x75e8('0x4a')],[_0x75e8('0x64'),'id'])||{})[_0x75e8('0x87')](function(_0x412577){for(var _0x30d183=0x0;_0x30d183<_0xc45af4[_0x75e8('0x4a')]['ids'][_0x75e8('0x36')];_0x30d183+=0x1){socket[_0x75e8('0x84')]('userFaxQueue:save',{'UserId':Number(_0xc45af4[_0x75e8('0x4a')][_0x75e8('0x64')][_0x30d183]),'FaxQueueId':Number(_0xc45af4['params']['id'])});}return _0x412577;});}})[_0x75e8('0x23')](respondWithResult(_0x4f200b,null))[_0x75e8('0x49')](handleError(_0x4f200b,null));};exports[_0x75e8('0x83')]=function(_0x2cb13a,_0x4f1c70,_0x48e502){return db[_0x75e8('0x40')][_0x75e8('0x48')]({'where':{'id':_0x2cb13a[_0x75e8('0x45')]['id']}})['then'](handleEntityNotFound(_0x4f1c70,null))[_0x75e8('0x23')](function(_0x115e91){if(_0x115e91){return _0x115e91[_0x75e8('0x83')](_0x2cb13a['query']['ids'])[_0x75e8('0x23')](function(){if(_[_0x75e8('0x88')](_0x2cb13a['query'][_0x75e8('0x64')])){for(var _0x58f235=0x0;_0x58f235<_0x2cb13a[_0x75e8('0x31')][_0x75e8('0x64')]['length'];_0x58f235+=0x1){socket['emit'](_0x75e8('0x85'),{'UserId':Number(_0x2cb13a[_0x75e8('0x31')]['ids'][_0x58f235]),'FaxQueueId':Number(_0x2cb13a[_0x75e8('0x45')]['id'])});}}else{socket[_0x75e8('0x84')](_0x75e8('0x85'),{'UserId':Number(_0x2cb13a[_0x75e8('0x31')][_0x75e8('0x64')]),'FaxQueueId':Number(_0x2cb13a[_0x75e8('0x45')]['id'])});}});}})[_0x75e8('0x23')](respondWithStatusCode(_0x4f1c70,null))[_0x75e8('0x49')](handleError(_0x4f1c70,null));};exports[_0x75e8('0x89')]=function(_0x48006a,_0x272670,_0x110409){var _0x370623={};var _0x3335a0={};var _0x493bba;var _0x35d362;return db[_0x75e8('0x40')]['findOne']({'where':{'id':_0x48006a['params']['id']}})['then'](handleEntityNotFound(_0x272670,null))[_0x75e8('0x23')](function(_0x45972c){if(_0x45972c){_0x493bba=_0x45972c;_0x3335a0[_0x75e8('0x30')]=_[_0x75e8('0x46')](db[_0x75e8('0x57')][_0x75e8('0x47')]);_0x3335a0[_0x75e8('0x31')]=_['keys'](_0x48006a[_0x75e8('0x31')]);_0x3335a0[_0x75e8('0x32')]=_[_0x75e8('0x33')](_0x3335a0['model'],_0x3335a0[_0x75e8('0x31')]);_0x370623[_0x75e8('0x34')]=_['intersection'](_0x3335a0[_0x75e8('0x30')],qs['fields'](_0x48006a[_0x75e8('0x31')][_0x75e8('0x35')]));_0x370623[_0x75e8('0x34')]=_0x370623['attributes'][_0x75e8('0x36')]?_0x370623['attributes']:_0x3335a0[_0x75e8('0x30')];_0x370623['order']=qs['sort'](_0x48006a['query'][_0x75e8('0x39')]);_0x370623[_0x75e8('0x3a')]=qs[_0x75e8('0x32')](_[_0x75e8('0x3b')](_0x48006a[_0x75e8('0x31')],_0x3335a0[_0x75e8('0x32')]));if(_0x48006a[_0x75e8('0x31')][_0x75e8('0x3c')]){_0x370623['where']=_['merge'](_0x370623['where'],{'$or':_[_0x75e8('0x2c')](_0x370623[_0x75e8('0x34')],function(_0x4775dd){var _0x26d427={};_0x26d427[_0x4775dd]={'$like':'%'+_0x48006a[_0x75e8('0x31')]['filter']+'%'};return _0x26d427;})});}_0x370623=_['merge']({},_0x370623,_0x48006a[_0x75e8('0x3f')]);return _0x493bba[_0x75e8('0x89')](_0x370623);}})[_0x75e8('0x23')](function(_0x2543bd){if(_0x2543bd){_0x35d362=_0x2543bd['length'];if(!_0x48006a[_0x75e8('0x31')][_0x75e8('0x55')](_0x75e8('0x37'))){_0x370623[_0x75e8('0x1a')]=qs[_0x75e8('0x1a')](_0x48006a[_0x75e8('0x31')][_0x75e8('0x1a')]);_0x370623[_0x75e8('0x1b')]=qs[_0x75e8('0x1b')](_0x48006a[_0x75e8('0x31')]['offset']);}return _0x493bba['getAgents'](_0x370623);}})['then'](function(_0x2b5bf8){if(_0x2b5bf8){return _0x2b5bf8?{'count':_0x35d362,'rows':_0x2b5bf8}:null;}})[_0x75e8('0x23')](respondWithResult(_0x272670,null))[_0x75e8('0x49')](handleError(_0x272670,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index db57e17..c285368 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 _0x0599=['FaxQueue','setMaxListeners','save','update','hook','exports'];(function(_0x3bfe97,_0x2ae77c){var _0xee1365=function(_0x1c4267){while(--_0x1c4267){_0x3bfe97['push'](_0x3bfe97['shift']());}};_0xee1365(++_0x2ae77c);}(_0x0599,0xf0));var _0x9059=function(_0x4c129e,_0x178149){_0x4c129e=_0x4c129e-0x0;var _0x41d725=_0x0599[_0x4c129e];return _0x41d725;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x9059('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x9059('0x1')](0x0);var events={'afterCreate':_0x9059('0x2'),'afterUpdate':_0x9059('0x3'),'afterDestroy':'remove'};function emitEvent(_0x55a336){return function(_0x1cdbfc,_0x331e91,_0x5d33dd){FaxQueueEvents['emit'](_0x55a336+':'+_0x1cdbfc['id'],_0x1cdbfc);FaxQueueEvents['emit'](_0x55a336,_0x1cdbfc);_0x5d33dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x9059('0x4')](e,emitEvent(event));}}module[_0x9059('0x5')]=FaxQueueEvents; \ No newline at end of file +var _0x87b4=['hook','exports','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2740bb,_0x481689){var _0x3c757a=function(_0xf53b90){while(--_0xf53b90){_0x2740bb['push'](_0x2740bb['shift']());}};_0x3c757a(++_0x481689);}(_0x87b4,0xc2));var _0x487b=function(_0x212961,_0x24b949){_0x212961=_0x212961-0x0;var _0x43e323=_0x87b4[_0x212961];return _0x43e323;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x487b('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x487b('0x1')](0x0);var events={'afterCreate':_0x487b('0x2'),'afterUpdate':'update','afterDestroy':_0x487b('0x3')};function emitEvent(_0x40fba3){return function(_0x1fbe79,_0x2b14d5,_0x558227){FaxQueueEvents[_0x487b('0x4')](_0x40fba3+':'+_0x1fbe79['id'],_0x1fbe79);FaxQueueEvents['emit'](_0x40fba3,_0x1fbe79);_0x558227(null);};}for(var e in events){if(events[_0x487b('0x5')](e)){var event=events[e];FaxQueue[_0x487b('0x6')](e,emitEvent(event));}}module[_0x487b('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index febab6f..0572f79 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 _0xef75=['rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x10c10f,_0x5a26a2){var _0x4532f0=function(_0x1c45b2){while(--_0x1c45b2){_0x10c10f['push'](_0x10c10f['shift']());}};_0x4532f0(++_0x5a26a2);}(_0xef75,0xcb));var _0x5ef7=function(_0x429842,_0x32aafa){_0x429842=_0x429842-0x0;var _0x2a3264=_0xef75[_0x429842];return _0x2a3264;};'use strict';var _=require(_0x5ef7('0x0'));var util=require(_0x5ef7('0x1'));var logger=require(_0x5ef7('0x2'))(_0x5ef7('0x3'));var moment=require('moment');var BPromise=require(_0x5ef7('0x4'));var rp=require(_0x5ef7('0x5'));var fs=require('fs');var path=require(_0x5ef7('0x6'));var rimraf=require(_0x5ef7('0x7'));var config=require(_0x5ef7('0x8'));var attributes=require(_0x5ef7('0x9'));module[_0x5ef7('0xa')]=function(_0x562743,_0x4e3e8e){return _0x562743[_0x5ef7('0xb')](_0x5ef7('0xc'),attributes,{'tableName':_0x5ef7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0bfd=['request-promise','path','rimraf','./faxQueue.attributes','define','FaxQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x55db1d,_0x2b843e){var _0xac8d7f=function(_0x24793a){while(--_0x24793a){_0x55db1d['push'](_0x55db1d['shift']());}};_0xac8d7f(++_0x2b843e);}(_0x0bfd,0x11a));var _0xd0bf=function(_0x4e7528,_0x5ad3c5){_0x4e7528=_0x4e7528-0x0;var _0x52fa95=_0x0bfd[_0x4e7528];return _0x52fa95;};'use strict';var _=require(_0xd0bf('0x0'));var util=require(_0xd0bf('0x1'));var logger=require(_0xd0bf('0x2'))(_0xd0bf('0x3'));var moment=require(_0xd0bf('0x4'));var BPromise=require(_0xd0bf('0x5'));var rp=require(_0xd0bf('0x6'));var fs=require('fs');var path=require(_0xd0bf('0x7'));var rimraf=require(_0xd0bf('0x8'));var config=require('../../config/environment');var attributes=require(_0xd0bf('0x9'));module['exports']=function(_0xbd0697,_0x334d5f){return _0xbd0697[_0xd0bf('0xa')](_0xd0bf('0xb'),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 fdefac2..e7e7f15 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 _0x931a=['../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','limit','include','map','model','attributes','stringify','ShowFaxQueue','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4225aa,_0x582bf2){var _0x3f8fab=function(_0x498647){while(--_0x498647){_0x4225aa['push'](_0x4225aa['shift']());}};_0x3f8fab(++_0x582bf2);}(_0x931a,0x116));var _0xa931=function(_0xc95737,_0xae8df6){_0xc95737=_0xc95737-0x0;var _0x387f66=_0x931a[_0xc95737];return _0x387f66;};'use strict';var _=require(_0xa931('0x0'));var util=require(_0xa931('0x1'));var moment=require(_0xa931('0x2'));var BPromise=require(_0xa931('0x3'));var rs=require(_0xa931('0x4'));var fs=require('fs');var Redis=require(_0xa931('0x5'));var db=require(_0xa931('0x6'))['db'];var utils=require(_0xa931('0x7'));var logger=require('../../config/logger')(_0xa931('0x8'));var config=require(_0xa931('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa931('0xa')]['http']({'port':0x232a});config[_0xa931('0xb')]=_[_0xa931('0xc')](config[_0xa931('0xb')],{'host':_0xa931('0xd'),'port':0x18eb});var socket=require(_0xa931('0xe'))(new Redis(config[_0xa931('0xb')]));require(_0xa931('0xf'))[_0xa931('0x10')](socket);function respondWithRpcPromise(_0x4dafc2,_0x350bfa,_0x8521db){return new BPromise(function(_0x4a434c,_0xf8da3f){return client['request'](_0x4dafc2,_0x8521db)[_0xa931('0x11')](function(_0x1ce7c3){logger[_0xa931('0x12')](_0xa931('0x13'),_0x350bfa,_0xa931('0x14'));logger[_0xa931('0x15')](_0xa931('0x16'),_0x350bfa,_0xa931('0x14'),JSON['stringify'](_0x1ce7c3));if(_0x1ce7c3[_0xa931('0x17')]){if(_0x1ce7c3[_0xa931('0x17')][_0xa931('0x18')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x350bfa,_0x1ce7c3[_0xa931('0x17')][_0xa931('0x19')]);return _0xf8da3f(_0x1ce7c3[_0xa931('0x17')][_0xa931('0x19')]);}logger[_0xa931('0x17')](_0xa931('0x13'),_0x350bfa,_0x1ce7c3['error'][_0xa931('0x19')]);return _0x4a434c(_0x1ce7c3[_0xa931('0x17')][_0xa931('0x19')]);}else{logger[_0xa931('0x12')](_0xa931('0x13'),_0x350bfa,_0xa931('0x14'));_0x4a434c(_0x1ce7c3['result'][_0xa931('0x19')]);}})[_0xa931('0x1a')](function(_0xb663fb){logger[_0xa931('0x17')](_0xa931('0x13'),_0x350bfa,_0xb663fb);_0xf8da3f(_0xb663fb);});});}exports[_0xa931('0x1b')]=function(_0x268d30){var _0x235dcd=this;return new Promise(function(_0x568d4c,_0x1d8724){return db[_0xa931('0x1c')][_0xa931('0x1d')]({'raw':_0x268d30[_0xa931('0x1e')]?_0x268d30[_0xa931('0x1e')][_0xa931('0x1f')]===undefined?!![]:![]:!![],'where':_0x268d30[_0xa931('0x1e')]?_0x268d30[_0xa931('0x1e')]['where']||null:null,'attributes':_0x268d30['options']?_0x268d30['options']['attributes']||null:null,'limit':_0x268d30[_0xa931('0x1e')]?_0x268d30['options'][_0xa931('0x20')]||null:null,'include':_0x268d30['options']?_0x268d30[_0xa931('0x1e')][_0xa931('0x21')]?_[_0xa931('0x22')](_0x268d30[_0xa931('0x1e')][_0xa931('0x21')],function(_0x3e9761){return{'model':db[_0x3e9761[_0xa931('0x23')]],'as':_0x3e9761['as'],'attributes':_0x3e9761[_0xa931('0x24')],'include':_0x3e9761[_0xa931('0x21')]?_['map'](_0x3e9761[_0xa931('0x21')],function(_0x3c64b1){return{'model':db[_0x3c64b1['model']],'as':_0x3c64b1['as'],'attributes':_0x3c64b1[_0xa931('0x24')],'include':_0x3c64b1[_0xa931('0x21')]?_[_0xa931('0x22')](_0x3c64b1[_0xa931('0x21')],function(_0x43ba90){return{'model':db[_0x43ba90[_0xa931('0x23')]],'as':_0x43ba90['as'],'attributes':_0x43ba90[_0xa931('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa931('0x11')](function(_0x3066a1){logger[_0xa931('0x12')](_0xa931('0x1b'),_0x268d30);logger[_0xa931('0x15')]('GetFaxQueue',_0x268d30,JSON[_0xa931('0x25')](_0x3066a1));_0x568d4c(_0x3066a1);})['catch'](function(_0x363c91){logger[_0xa931('0x17')](_0xa931('0x1b'),_0x363c91[_0xa931('0x19')],_0x268d30);_0x1d8724(_0x235dcd['error'](0x1f4,_0x363c91[_0xa931('0x19')]));});});};exports[_0xa931('0x26')]=function(_0x4f68fb){var _0xe22069=this;return new Promise(function(_0x7675b8,_0x56d152){return db[_0xa931('0x1c')][_0xa931('0x27')]({'raw':_0x4f68fb[_0xa931('0x1e')]?_0x4f68fb[_0xa931('0x1e')][_0xa931('0x1f')]===undefined?!![]:![]:!![],'where':_0x4f68fb['options']?_0x4f68fb[_0xa931('0x1e')][_0xa931('0x28')]||null:null,'attributes':_0x4f68fb['options']?_0x4f68fb[_0xa931('0x1e')][_0xa931('0x24')]||null:null,'include':_0x4f68fb[_0xa931('0x1e')]?_0x4f68fb[_0xa931('0x1e')][_0xa931('0x21')]?_[_0xa931('0x22')](_0x4f68fb['options']['include'],function(_0xe972e4){return{'model':db[_0xe972e4[_0xa931('0x23')]],'as':_0xe972e4['as'],'attributes':_0xe972e4[_0xa931('0x24')],'include':_0xe972e4[_0xa931('0x21')]?_[_0xa931('0x22')](_0xe972e4['include'],function(_0x51faed){return{'model':db[_0x51faed[_0xa931('0x23')]],'as':_0x51faed['as'],'attributes':_0x51faed['attributes'],'include':_0x51faed['include']?_[_0xa931('0x22')](_0x51faed[_0xa931('0x21')],function(_0x4a5201){return{'model':db[_0x4a5201['model']],'as':_0x4a5201['as'],'attributes':_0x4a5201[_0xa931('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa931('0x11')](function(_0x3c92fb){logger[_0xa931('0x12')]('ShowFaxQueue',_0x4f68fb);logger[_0xa931('0x15')](_0xa931('0x26'),_0x4f68fb,JSON['stringify'](_0x3c92fb));_0x7675b8(_0x3c92fb);})['catch'](function(_0x2501d0){logger[_0xa931('0x17')](_0xa931('0x26'),_0x2501d0[_0xa931('0x19')],_0x4f68fb);_0x56d152(_0xe22069[_0xa931('0x17')](0x1f4,_0x2501d0[_0xa931('0x19')]));});});}; \ No newline at end of file +var _0xccef=['map','include','ShowFaxQueue','find','raw','where','model','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','attributes','limit'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xccef,0x19e));var _0xfcce=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xccef[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xfcce('0x0'));var moment=require('moment');var BPromise=require(_0xfcce('0x1'));var rs=require(_0xfcce('0x2'));var fs=require('fs');var Redis=require(_0xfcce('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfcce('0x4'));var logger=require(_0xfcce('0x5'))(_0xfcce('0x6'));var config=require(_0xfcce('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfcce('0x8')]({'port':0x232a});config[_0xfcce('0x9')]=_['defaults'](config[_0xfcce('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcce('0xa'))(new Redis(config[_0xfcce('0x9')]));require(_0xfcce('0xb'))[_0xfcce('0xc')](socket);function respondWithRpcPromise(_0x20e219,_0x38a051,_0x17323e){return new BPromise(function(_0x52a06b,_0x392c4b){return client[_0xfcce('0xd')](_0x20e219,_0x17323e)[_0xfcce('0xe')](function(_0x143254){logger[_0xfcce('0xf')](_0xfcce('0x10'),_0x38a051,_0xfcce('0x11'));logger[_0xfcce('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x38a051,_0xfcce('0x11'),JSON[_0xfcce('0x13')](_0x143254));if(_0x143254[_0xfcce('0x14')]){if(_0x143254[_0xfcce('0x14')][_0xfcce('0x15')]===0x1f4){logger[_0xfcce('0x14')](_0xfcce('0x10'),_0x38a051,_0x143254[_0xfcce('0x14')][_0xfcce('0x16')]);return _0x392c4b(_0x143254[_0xfcce('0x14')][_0xfcce('0x16')]);}logger[_0xfcce('0x14')](_0xfcce('0x10'),_0x38a051,_0x143254[_0xfcce('0x14')][_0xfcce('0x16')]);return _0x52a06b(_0x143254[_0xfcce('0x14')][_0xfcce('0x16')]);}else{logger[_0xfcce('0xf')](_0xfcce('0x10'),_0x38a051,_0xfcce('0x11'));_0x52a06b(_0x143254[_0xfcce('0x17')]['message']);}})[_0xfcce('0x18')](function(_0x5231bd){logger[_0xfcce('0x14')](_0xfcce('0x10'),_0x38a051,_0x5231bd);_0x392c4b(_0x5231bd);});});}exports[_0xfcce('0x19')]=function(_0x4e6df2){var _0x2f31fe=this;return new Promise(function(_0x8cee3f,_0x5eb445){return db[_0xfcce('0x1a')]['findAll']({'raw':_0x4e6df2[_0xfcce('0x1b')]?_0x4e6df2[_0xfcce('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4e6df2[_0xfcce('0x1b')]?_0x4e6df2[_0xfcce('0x1b')]['where']||null:null,'attributes':_0x4e6df2[_0xfcce('0x1b')]?_0x4e6df2[_0xfcce('0x1b')][_0xfcce('0x1c')]||null:null,'limit':_0x4e6df2[_0xfcce('0x1b')]?_0x4e6df2['options'][_0xfcce('0x1d')]||null:null,'include':_0x4e6df2[_0xfcce('0x1b')]?_0x4e6df2['options']['include']?_[_0xfcce('0x1e')](_0x4e6df2[_0xfcce('0x1b')][_0xfcce('0x1f')],function(_0x1e8e6e){return{'model':db[_0x1e8e6e['model']],'as':_0x1e8e6e['as'],'attributes':_0x1e8e6e[_0xfcce('0x1c')],'include':_0x1e8e6e['include']?_['map'](_0x1e8e6e[_0xfcce('0x1f')],function(_0x5d95f0){return{'model':db[_0x5d95f0['model']],'as':_0x5d95f0['as'],'attributes':_0x5d95f0['attributes'],'include':_0x5d95f0[_0xfcce('0x1f')]?_[_0xfcce('0x1e')](_0x5d95f0[_0xfcce('0x1f')],function(_0x4040cf){return{'model':db[_0x4040cf['model']],'as':_0x4040cf['as'],'attributes':_0x4040cf[_0xfcce('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x559586){logger[_0xfcce('0xf')]('GetFaxQueue',_0x4e6df2);logger[_0xfcce('0x12')](_0xfcce('0x19'),_0x4e6df2,JSON[_0xfcce('0x13')](_0x559586));_0x8cee3f(_0x559586);})[_0xfcce('0x18')](function(_0x24229e){logger[_0xfcce('0x14')](_0xfcce('0x19'),_0x24229e['message'],_0x4e6df2);_0x5eb445(_0x2f31fe[_0xfcce('0x14')](0x1f4,_0x24229e[_0xfcce('0x16')]));});});};exports[_0xfcce('0x20')]=function(_0x29409d){var _0x4ae8c7=this;return new Promise(function(_0x3df5a9,_0x1f97b2){return db[_0xfcce('0x1a')][_0xfcce('0x21')]({'raw':_0x29409d[_0xfcce('0x1b')]?_0x29409d['options'][_0xfcce('0x22')]===undefined?!![]:![]:!![],'where':_0x29409d[_0xfcce('0x1b')]?_0x29409d[_0xfcce('0x1b')][_0xfcce('0x23')]||null:null,'attributes':_0x29409d[_0xfcce('0x1b')]?_0x29409d[_0xfcce('0x1b')][_0xfcce('0x1c')]||null:null,'include':_0x29409d['options']?_0x29409d[_0xfcce('0x1b')][_0xfcce('0x1f')]?_[_0xfcce('0x1e')](_0x29409d[_0xfcce('0x1b')]['include'],function(_0x446410){return{'model':db[_0x446410['model']],'as':_0x446410['as'],'attributes':_0x446410[_0xfcce('0x1c')],'include':_0x446410[_0xfcce('0x1f')]?_['map'](_0x446410[_0xfcce('0x1f')],function(_0x221a08){return{'model':db[_0x221a08[_0xfcce('0x24')]],'as':_0x221a08['as'],'attributes':_0x221a08['attributes'],'include':_0x221a08[_0xfcce('0x1f')]?_[_0xfcce('0x1e')](_0x221a08[_0xfcce('0x1f')],function(_0x14f6ff){return{'model':db[_0x14f6ff[_0xfcce('0x24')]],'as':_0x14f6ff['as'],'attributes':_0x14f6ff[_0xfcce('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfcce('0xe')](function(_0xa88e30){logger[_0xfcce('0xf')]('ShowFaxQueue',_0x29409d);logger[_0xfcce('0x12')](_0xfcce('0x20'),_0x29409d,JSON['stringify'](_0xa88e30));_0x3df5a9(_0xa88e30);})[_0xfcce('0x18')](function(_0x24c80d){logger['error'](_0xfcce('0x20'),_0x24c80d[_0xfcce('0x16')],_0x29409d);_0x1f97b2(_0x4ae8c7[_0xfcce('0x14')](0x1f4,_0x24c80d[_0xfcce('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index de81e36..a4ebb47 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 _0x3741=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x55d2d9,_0x374c74){var _0x150ffe=function(_0x59628e){while(--_0x59628e){_0x55d2d9['push'](_0x55d2d9['shift']());}};_0x150ffe(++_0x374c74);}(_0x3741,0x17c));var _0x1374=function(_0xf34b0a,_0x11e116){_0xf34b0a=_0xf34b0a-0x0;var _0x5021e1=_0x3741[_0xf34b0a];return _0x5021e1;};'use strict';var FaxQueueEvents=require(_0x1374('0x0'));var events=[_0x1374('0x1'),_0x1374('0x2'),_0x1374('0x3')];function createListener(_0x28dd8c,_0x229dfb){return function(_0x1c426c){_0x229dfb['emit'](_0x28dd8c,_0x1c426c);};}function removeListener(_0xccf38d,_0x5e6ba4){return function(){FaxQueueEvents[_0x1374('0x4')](_0xccf38d,_0x5e6ba4);};}exports[_0x1374('0x5')]=function(_0x2ad015){for(var _0x10190f=0x0,_0x205bba=events[_0x1374('0x6')];_0x10190f<_0x205bba;_0x10190f++){var _0x2654dc=events[_0x10190f];var _0x36ef52=createListener(_0x1374('0x7')+_0x2654dc,_0x2ad015);FaxQueueEvents['on'](_0x2654dc,_0x36ef52);}}; \ No newline at end of file +var _0x938d=['./faxQueue.events','save','update','removeListener','length'];(function(_0x5324a2,_0x55f16c){var _0x4f9892=function(_0xa384e){while(--_0xa384e){_0x5324a2['push'](_0x5324a2['shift']());}};_0x4f9892(++_0x55f16c);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0xd938('0x0'));var events=[_0xd938('0x1'),'remove',_0xd938('0x2')];function createListener(_0x29cf5f,_0x221132){return function(_0x5349c7){_0x221132['emit'](_0x29cf5f,_0x5349c7);};}function removeListener(_0xc9f24b,_0x429911){return function(){FaxQueueEvents[_0xd938('0x3')](_0xc9f24b,_0x429911);};}exports['register']=function(_0x3a81d2){for(var _0xb5e113=0x0,_0x1ed46b=events[_0xd938('0x4')];_0xb5e113<_0x1ed46b;_0xb5e113++){var _0x678164=events[_0xb5e113];var _0x419e0b=createListener('faxQueue:'+_0x678164,_0x3a81d2);FaxQueueEvents['on'](_0x678164,_0x419e0b);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 529aedb..67614aa 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 _0xcf98=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show'];(function(_0x193ddf,_0x6f30bb){var _0x5bc6df=function(_0x70fd9e){while(--_0x70fd9e){_0x193ddf['push'](_0x193ddf['shift']());}};_0x5bc6df(++_0x6f30bb);}(_0xcf98,0x8d));var _0x8cf9=function(_0x10e0a8,_0x545281){_0x10e0a8=_0x10e0a8-0x0;var _0x2af21b=_0xcf98[_0x10e0a8];return _0x2af21b;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var controller=require(_0x8cf9('0x7'));router[_0x8cf9('0x8')]('/',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xa')]);router[_0x8cf9('0x8')](_0x8cf9('0xb'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xc')]);router[_0x8cf9('0x8')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xd')]);router['get'](_0x8cf9('0xe'),auth['isAuthenticated'](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x8')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x11')]);router[_0x8cf9('0x8')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8cf9('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8cf9('0x15')]);router[_0x8cf9('0x14')](_0x8cf9('0x12'),auth['isAuthenticated'](),controller[_0x8cf9('0x16')]);router[_0x8cf9('0x17')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x18')]);router[_0x8cf9('0x19')](_0x8cf9('0x1a'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1b')]);router[_0x8cf9('0x19')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1c')]);router[_0x8cf9('0x19')](_0x8cf9('0x12'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1d')]);module[_0x8cf9('0x1e')]=router; \ No newline at end of file +var _0xa751=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getAgents','post','/:id/users','addAgents','put','/:id','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','Router'];(function(_0xeb67cb,_0x3facda){var _0xc8fe96=function(_0x4074a2){while(--_0x4074a2){_0xeb67cb['push'](_0xeb67cb['shift']());}};_0xc8fe96(++_0x3facda);}(_0xa751,0x175));var _0x1a75=function(_0x1eb201,_0x4101e0){_0x1eb201=_0x1eb201-0x0;var _0x4cbe3c=_0xa751[_0x1eb201];return _0x4cbe3c;};'use strict';var multer=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var path=require(_0x1a75('0x2'));var timeout=require(_0x1a75('0x3'));var express=require('express');var router=express[_0x1a75('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a75('0x5'));var interaction=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var controller=require('./faxQueue.controller');router[_0x1a75('0x8')]('/',auth[_0x1a75('0x9')](),controller[_0x1a75('0xa')]);router[_0x1a75('0x8')](_0x1a75('0xb'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1a75('0xd')]);router[_0x1a75('0x8')](_0x1a75('0xe'),auth[_0x1a75('0x9')](),controller[_0x1a75('0xf')]);router[_0x1a75('0x8')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['getTeams']);router['get']('/:id/users',auth[_0x1a75('0x9')](),controller[_0x1a75('0x11')]);router[_0x1a75('0x12')]('/',auth[_0x1a75('0x9')](),controller['create']);router['post'](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['addTeams']);router[_0x1a75('0x12')](_0x1a75('0x13'),auth['isAuthenticated'](),controller[_0x1a75('0x14')]);router[_0x1a75('0x15')](_0x1a75('0x16'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x1a75('0x16'),auth[_0x1a75('0x9')](),controller[_0x1a75('0x17')]);router[_0x1a75('0x18')](_0x1a75('0x10'),auth[_0x1a75('0x9')](),controller['removeTeams']);router[_0x1a75('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x1a75('0x19')]);module[_0x1a75('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 37e0228..09abf60 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 _0x6a7c=['exports','STRING','DATE','moment'];(function(_0x371223,_0x536f4b){var _0x1c3557=function(_0x535738){while(--_0x535738){_0x371223['push'](_0x371223['shift']());}};_0x1c3557(++_0x536f4b);}(_0x6a7c,0x1e7));var _0xc6a7=function(_0x5f200e,_0x1fccef){_0x5f200e=_0x5f200e-0x0;var _0x34717b=_0x6a7c[_0x5f200e];return _0x34717b;};'use strict';var moment=require(_0xc6a7('0x0'));var Sequelize=require('sequelize');module[_0xc6a7('0x1')]={'uniqueid':{'type':Sequelize[_0xc6a7('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xc6a7('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc6a7('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x06dc=['DATE','sequelize','exports','STRING'];(function(_0x350079,_0x510691){var _0x220852=function(_0x4e7d34){while(--_0x4e7d34){_0x350079['push'](_0x350079['shift']());}};_0x220852(++_0x510691);}(_0x06dc,0x89));var _0xc06d=function(_0x286bfb,_0x46ac3c){_0x286bfb=_0x286bfb-0x0;var _0x52b683=_0x06dc[_0x286bfb];return _0x52b683;};'use strict';var moment=require('moment');var Sequelize=require(_0xc06d('0x0'));module[_0xc06d('0x1')]={'uniqueid':{'type':Sequelize[_0xc06d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc06d('0x2')]},'joinAt':{'type':Sequelize[_0xc06d('0x3')]},'leaveAt':{'type':Sequelize[_0xc06d('0x3')]},'acceptAt':{'type':Sequelize[_0xc06d('0x3')]},'exitAt':{'type':Sequelize[_0xc06d('0x3')]},'reason':{'type':Sequelize[_0xc06d('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 33fbf53..8662bdd 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 _0x235a=['destroy','error','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x197b38,_0x394a4d){var _0x20a23a=function(_0x2a5541){while(--_0x2a5541){_0x197b38['push'](_0x197b38['shift']());}};_0x20a23a(++_0x394a4d);}(_0x235a,0x1ef));var _0xa235=function(_0x5717fc,_0x456c1a){_0x5717fc=_0x5717fc-0x0;var _0x1e5111=_0x235a[_0x5717fc];return _0x1e5111;};'use strict';var emlformat=require(_0xa235('0x0'));var rimraf=require(_0xa235('0x1'));var zipdir=require(_0xa235('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa235('0x3'));var moment=require('moment');var BPromise=require(_0xa235('0x4'));var Mustache=require(_0xa235('0x5'));var util=require(_0xa235('0x6'));var path=require(_0xa235('0x7'));var sox=require(_0xa235('0x8'));var csv=require(_0xa235('0x9'));var ejs=require(_0xa235('0xa'));var fs=require('fs');var fs_extra=require(_0xa235('0xb'));var _=require('lodash');var squel=require(_0xa235('0xc'));var crypto=require(_0xa235('0xd'));var jsforce=require(_0xa235('0xe'));var deskjs=require(_0xa235('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa235('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa235('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa235('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa235('0x13'));var config=require(_0xa235('0x14'));var licenseUtil=require(_0xa235('0x15'));var db=require(_0xa235('0x16'))['db'];function respondWithStatusCode(_0x5330db,_0x5510ff){_0x5510ff=_0x5510ff||0xcc;return function(_0x47aad7){if(_0x47aad7){return _0x5330db[_0xa235('0x17')](_0x5510ff);}return _0x5330db[_0xa235('0x18')](_0x5510ff)[_0xa235('0x19')]();};}function respondWithResult(_0x3bf6fc,_0x36b4b1){_0x36b4b1=_0x36b4b1||0xc8;return function(_0x44ea6a){if(_0x44ea6a){return _0x3bf6fc[_0xa235('0x18')](_0x36b4b1)[_0xa235('0x1a')](_0x44ea6a);}};}function respondWithFilteredResult(_0x1369de,_0x4aceee){return function(_0x352463){if(_0x352463){var _0x20cd67=typeof _0x4aceee[_0xa235('0x1b')]===_0xa235('0x1c')&&typeof _0x4aceee[_0xa235('0x1d')]===_0xa235('0x1c');var _0x5c6e95=_0x352463['count'];var _0x446ea2=_0x20cd67?0x0:_0x4aceee[_0xa235('0x1b')];var _0x2b3769=_0x20cd67?_0x352463['count']:_0x4aceee[_0xa235('0x1b')]+_0x4aceee[_0xa235('0x1d')];var _0x3ca514;if(_0x2b3769>=_0x5c6e95){_0x2b3769=_0x5c6e95;_0x3ca514=0xc8;}else{_0x3ca514=0xce;}_0x1369de[_0xa235('0x18')](_0x3ca514);return _0x1369de[_0xa235('0x1e')](_0xa235('0x1f'),_0x446ea2+'-'+_0x2b3769+'/'+_0x5c6e95)[_0xa235('0x1a')](_0x352463);}return null;};}function patchUpdates(_0x483771){return function(_0x5a3bea){try{jsonpatch[_0xa235('0x20')](_0x5a3bea,_0x483771,!![]);}catch(_0x21940f){return BPromise[_0xa235('0x21')](_0x21940f);}return _0x5a3bea[_0xa235('0x22')]();};}function saveUpdates(_0x2e38e,_0x3deeea){return function(_0x3d9f70){if(_0x3d9f70){return _0x3d9f70[_0xa235('0x23')](_0x2e38e)[_0xa235('0x24')](function(_0x216083){return _0x216083;});}return null;};}function removeEntity(_0x3219f1,_0x20292c){return function(_0xee45e1){if(_0xee45e1){return _0xee45e1[_0xa235('0x25')]()[_0xa235('0x24')](function(){_0x3219f1[_0xa235('0x18')](0xcc)[_0xa235('0x19')]();});}};}function handleEntityNotFound(_0x13c868,_0x976c9f){return function(_0x1cb892){if(!_0x1cb892){_0x13c868[_0xa235('0x17')](0x194);}return _0x1cb892;};}function handleError(_0x57f591,_0xe1176c){_0xe1176c=_0xe1176c||0x1f4;return function(_0x533b15){logger[_0xa235('0x26')](_0x533b15['stack']);if(_0x533b15[_0xa235('0x27')]){delete _0x533b15[_0xa235('0x27')];}_0x57f591[_0xa235('0x18')](_0xe1176c)[_0xa235('0x28')](_0x533b15);};}exports[_0xa235('0x29')]=function(_0x5d811a,_0x2585c7){var _0x612f2={},_0x55a21e={},_0x4b33ef={'count':0x0,'rows':[]};var _0x502df9=_['map'](db[_0xa235('0x2a')][_0xa235('0x2b')],function(_0x2d8073){return{'name':_0x2d8073[_0xa235('0x2c')],'type':_0x2d8073[_0xa235('0x2d')][_0xa235('0x2e')]};});_0x55a21e[_0xa235('0x2f')]=_['map'](_0x502df9,'name');_0x55a21e[_0xa235('0x30')]=_[_0xa235('0x31')](_0x5d811a['query']);_0x55a21e[_0xa235('0x32')]=_[_0xa235('0x33')](_0x55a21e[_0xa235('0x2f')],_0x55a21e[_0xa235('0x30')]);_0x612f2[_0xa235('0x34')]=_[_0xa235('0x33')](_0x55a21e[_0xa235('0x2f')],qs[_0xa235('0x35')](_0x5d811a['query'][_0xa235('0x35')]));_0x612f2['attributes']=_0x612f2[_0xa235('0x34')][_0xa235('0x36')]?_0x612f2[_0xa235('0x34')]:_0x55a21e[_0xa235('0x2f')];if(!_0x5d811a[_0xa235('0x30')][_0xa235('0x37')](_0xa235('0x38'))){_0x612f2[_0xa235('0x1d')]=qs[_0xa235('0x1d')](_0x5d811a[_0xa235('0x30')][_0xa235('0x1d')]);_0x612f2[_0xa235('0x1b')]=qs[_0xa235('0x1b')](_0x5d811a['query']['offset']);}_0x612f2['order']=qs[_0xa235('0x39')](_0x5d811a['query'][_0xa235('0x39')]);_0x612f2[_0xa235('0x3a')]=qs[_0xa235('0x32')](_[_0xa235('0x3b')](_0x5d811a[_0xa235('0x30')],_0x55a21e[_0xa235('0x32')]),_0x502df9);if(_0x5d811a[_0xa235('0x30')]['filter']){_0x612f2[_0xa235('0x3a')]=_[_0xa235('0x3c')](_0x612f2['where'],{'$or':_[_0xa235('0x3d')](_0x502df9,function(_0x3fa927){if(_0x3fa927[_0xa235('0x2d')]!==_0xa235('0x3e')){var _0x45cc55={};_0x45cc55[_0x3fa927[_0xa235('0x27')]]={'$like':'%'+_0x5d811a[_0xa235('0x30')][_0xa235('0x3f')]+'%'};return _0x45cc55;}})});}_0x612f2=_[_0xa235('0x3c')]({},_0x612f2,_0x5d811a['options']);var _0x28c259={'where':_0x612f2[_0xa235('0x3a')]};return db[_0xa235('0x2a')][_0xa235('0x40')](_0x28c259)[_0xa235('0x24')](function(_0x542755){_0x4b33ef[_0xa235('0x40')]=_0x542755;if(_0x5d811a[_0xa235('0x30')][_0xa235('0x41')]){_0x612f2[_0xa235('0x42')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xa235('0x43')](_0x612f2);})[_0xa235('0x24')](function(_0x47801f){_0x4b33ef[_0xa235('0x44')]=_0x47801f;return _0x4b33ef;})[_0xa235('0x24')](respondWithFilteredResult(_0x2585c7,_0x612f2))[_0xa235('0x45')](handleError(_0x2585c7,null));};exports[_0xa235('0x46')]=function(_0x5c203c,_0x333ed8){var _0x4748d8={'raw':!![],'where':{'id':_0x5c203c[_0xa235('0x47')]['id']}},_0x1e90a9={};_0x1e90a9[_0xa235('0x2f')]=_['keys'](db[_0xa235('0x2a')][_0xa235('0x2b')]);_0x1e90a9[_0xa235('0x30')]=_[_0xa235('0x31')](_0x5c203c[_0xa235('0x30')]);_0x1e90a9['filters']=_[_0xa235('0x33')](_0x1e90a9[_0xa235('0x2f')],_0x1e90a9[_0xa235('0x30')]);_0x4748d8[_0xa235('0x34')]=_[_0xa235('0x33')](_0x1e90a9[_0xa235('0x2f')],qs[_0xa235('0x35')](_0x5c203c[_0xa235('0x30')]['fields']));_0x4748d8[_0xa235('0x34')]=_0x4748d8[_0xa235('0x34')][_0xa235('0x36')]?_0x4748d8[_0xa235('0x34')]:_0x1e90a9[_0xa235('0x2f')];if(_0x5c203c[_0xa235('0x30')][_0xa235('0x41')]){_0x4748d8[_0xa235('0x42')]=[{'all':!![]}];}_0x4748d8=_[_0xa235('0x3c')]({},_0x4748d8,_0x5c203c['options']);return db[_0xa235('0x2a')][_0xa235('0x48')](_0x4748d8)[_0xa235('0x24')](handleEntityNotFound(_0x333ed8,null))[_0xa235('0x24')](respondWithResult(_0x333ed8,null))[_0xa235('0x45')](handleError(_0x333ed8,null));};exports['create']=function(_0x22f11c,_0x11b5e7){return db['FaxQueueReport'][_0xa235('0x49')](_0x22f11c[_0xa235('0x4a')],{})[_0xa235('0x24')](respondWithResult(_0x11b5e7,0xc9))[_0xa235('0x45')](handleError(_0x11b5e7,null));};exports['update']=function(_0x16d9e8,_0x4909e9){if(_0x16d9e8[_0xa235('0x4a')]['id']){delete _0x16d9e8[_0xa235('0x4a')]['id'];}return db['FaxQueueReport'][_0xa235('0x48')]({'where':{'id':_0x16d9e8[_0xa235('0x47')]['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x4909e9,null))[_0xa235('0x24')](saveUpdates(_0x16d9e8[_0xa235('0x4a')],null))[_0xa235('0x24')](respondWithResult(_0x4909e9,null))[_0xa235('0x45')](handleError(_0x4909e9,null));};exports[_0xa235('0x25')]=function(_0x5ab614,_0x5033dc){return db['FaxQueueReport'][_0xa235('0x48')]({'where':{'id':_0x5ab614[_0xa235('0x47')]['id']}})[_0xa235('0x24')](handleEntityNotFound(_0x5033dc,null))[_0xa235('0x24')](removeEntity(_0x5033dc,null))['catch'](handleError(_0x5033dc,null));};exports[_0xa235('0x4b')]=function(_0x5e4a80,_0x1d9ce8){return db[_0xa235('0x2a')][_0xa235('0x4b')]()[_0xa235('0x24')](respondWithResult(_0x1d9ce8,null))['catch'](handleError(_0x1d9ce8,null));}; \ No newline at end of file +var _0xa73a=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','map','FaxQueueReport','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','name','includeAll','include','findAll','rows','show','params','length','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring'];(function(_0xfb4a69,_0x2820af){var _0x53cfde=function(_0x46c0d6){while(--_0x46c0d6){_0xfb4a69['push'](_0xfb4a69['shift']());}};_0x53cfde(++_0x2820af);}(_0xa73a,0x82));var _0xaa73=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xa73a[_0x4bacb6];return _0x58c029;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa73('0x0'));var zipdir=require(_0xaa73('0x1'));var jsonpatch=require(_0xaa73('0x2'));var rp=require(_0xaa73('0x3'));var moment=require(_0xaa73('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xaa73('0x5'));var sox=require(_0xaa73('0x6'));var csv=require(_0xaa73('0x7'));var ejs=require(_0xaa73('0x8'));var fs=require('fs');var fs_extra=require(_0xaa73('0x9'));var _=require(_0xaa73('0xa'));var squel=require(_0xaa73('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa73('0xc'));var toCsv=require(_0xaa73('0x7'));var querystring=require(_0xaa73('0xd'));var Papa=require(_0xaa73('0xe'));var Redis=require(_0xaa73('0xf'));var authService=require(_0xaa73('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa73('0x11'));var logger=require('../../config/logger')(_0xaa73('0x12'));var utils=require('../../config/utils');var config=require(_0xaa73('0x13'));var licenseUtil=require(_0xaa73('0x14'));var db=require(_0xaa73('0x15'))['db'];function respondWithStatusCode(_0x3bfcfa,_0x44915e){_0x44915e=_0x44915e||0xcc;return function(_0x213aa1){if(_0x213aa1){return _0x3bfcfa['sendStatus'](_0x44915e);}return _0x3bfcfa[_0xaa73('0x16')](_0x44915e)[_0xaa73('0x17')]();};}function respondWithResult(_0x29128f,_0x457922){_0x457922=_0x457922||0xc8;return function(_0xc4a8e){if(_0xc4a8e){return _0x29128f[_0xaa73('0x16')](_0x457922)[_0xaa73('0x18')](_0xc4a8e);}};}function respondWithFilteredResult(_0x626226,_0x339c82){return function(_0x5a4174){if(_0x5a4174){var _0x409d07=typeof _0x339c82['offset']===_0xaa73('0x19')&&typeof _0x339c82[_0xaa73('0x1a')]===_0xaa73('0x19');var _0x4af9df=_0x5a4174['count'];var _0x3ce616=_0x409d07?0x0:_0x339c82['offset'];var _0x9ec989=_0x409d07?_0x5a4174[_0xaa73('0x1b')]:_0x339c82['offset']+_0x339c82[_0xaa73('0x1a')];var _0x48420a;if(_0x9ec989>=_0x4af9df){_0x9ec989=_0x4af9df;_0x48420a=0xc8;}else{_0x48420a=0xce;}_0x626226[_0xaa73('0x16')](_0x48420a);return _0x626226[_0xaa73('0x1c')](_0xaa73('0x1d'),_0x3ce616+'-'+_0x9ec989+'/'+_0x4af9df)[_0xaa73('0x18')](_0x5a4174);}return null;};}function patchUpdates(_0x4de045){return function(_0x551790){try{jsonpatch['apply'](_0x551790,_0x4de045,!![]);}catch(_0xf43dd0){return BPromise[_0xaa73('0x1e')](_0xf43dd0);}return _0x551790[_0xaa73('0x1f')]();};}function saveUpdates(_0x24ce6b,_0x53b746){return function(_0x5ac0c5){if(_0x5ac0c5){return _0x5ac0c5[_0xaa73('0x20')](_0x24ce6b)[_0xaa73('0x21')](function(_0x27243f){return _0x27243f;});}return null;};}function removeEntity(_0x2d7798,_0x346d57){return function(_0x482795){if(_0x482795){return _0x482795[_0xaa73('0x22')]()[_0xaa73('0x21')](function(){_0x2d7798[_0xaa73('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cae16,_0x88731){return function(_0x2e34a8){if(!_0x2e34a8){_0x3cae16[_0xaa73('0x23')](0x194);}return _0x2e34a8;};}function handleError(_0x3af228,_0x1253aa){_0x1253aa=_0x1253aa||0x1f4;return function(_0x1ed112){logger[_0xaa73('0x24')](_0x1ed112['stack']);if(_0x1ed112['name']){delete _0x1ed112['name'];}_0x3af228[_0xaa73('0x16')](_0x1253aa)['send'](_0x1ed112);};}exports['index']=function(_0x5617da,_0x7b7f86){var _0x344e31={},_0x5613a4={},_0x532ded={'count':0x0,'rows':[]};var _0x5ce12c=_[_0xaa73('0x25')](db[_0xaa73('0x26')][_0xaa73('0x27')],function(_0xa9c83d){return{'name':_0xa9c83d['fieldName'],'type':_0xa9c83d[_0xaa73('0x28')]['key']};});_0x5613a4[_0xaa73('0x29')]=_['map'](_0x5ce12c,'name');_0x5613a4[_0xaa73('0x2a')]=_[_0xaa73('0x2b')](_0x5617da[_0xaa73('0x2a')]);_0x5613a4[_0xaa73('0x2c')]=_['intersection'](_0x5613a4[_0xaa73('0x29')],_0x5613a4[_0xaa73('0x2a')]);_0x344e31[_0xaa73('0x2d')]=_[_0xaa73('0x2e')](_0x5613a4[_0xaa73('0x29')],qs[_0xaa73('0x2f')](_0x5617da[_0xaa73('0x2a')][_0xaa73('0x2f')]));_0x344e31[_0xaa73('0x2d')]=_0x344e31['attributes']['length']?_0x344e31['attributes']:_0x5613a4[_0xaa73('0x29')];if(!_0x5617da[_0xaa73('0x2a')][_0xaa73('0x30')](_0xaa73('0x31'))){_0x344e31[_0xaa73('0x1a')]=qs[_0xaa73('0x1a')](_0x5617da[_0xaa73('0x2a')][_0xaa73('0x1a')]);_0x344e31[_0xaa73('0x32')]=qs[_0xaa73('0x32')](_0x5617da['query']['offset']);}_0x344e31[_0xaa73('0x33')]=qs[_0xaa73('0x34')](_0x5617da[_0xaa73('0x2a')][_0xaa73('0x34')]);_0x344e31[_0xaa73('0x35')]=qs[_0xaa73('0x2c')](_[_0xaa73('0x36')](_0x5617da[_0xaa73('0x2a')],_0x5613a4['filters']),_0x5ce12c);if(_0x5617da[_0xaa73('0x2a')][_0xaa73('0x37')]){_0x344e31[_0xaa73('0x35')]=_[_0xaa73('0x38')](_0x344e31[_0xaa73('0x35')],{'$or':_[_0xaa73('0x25')](_0x5ce12c,function(_0x478ef9){if(_0x478ef9[_0xaa73('0x28')]!==_0xaa73('0x39')){var _0x3127db={};_0x3127db[_0x478ef9[_0xaa73('0x3a')]]={'$like':'%'+_0x5617da['query'][_0xaa73('0x37')]+'%'};return _0x3127db;}})});}_0x344e31=_['merge']({},_0x344e31,_0x5617da['options']);var _0x1f0e92={'where':_0x344e31[_0xaa73('0x35')]};return db['FaxQueueReport']['count'](_0x1f0e92)['then'](function(_0x48f3e2){_0x532ded[_0xaa73('0x1b')]=_0x48f3e2;if(_0x5617da[_0xaa73('0x2a')][_0xaa73('0x3b')]){_0x344e31[_0xaa73('0x3c')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xaa73('0x3d')](_0x344e31);})[_0xaa73('0x21')](function(_0x44d331){_0x532ded[_0xaa73('0x3e')]=_0x44d331;return _0x532ded;})[_0xaa73('0x21')](respondWithFilteredResult(_0x7b7f86,_0x344e31))['catch'](handleError(_0x7b7f86,null));};exports[_0xaa73('0x3f')]=function(_0x11ac57,_0x28d590){var _0x534e41={'raw':!![],'where':{'id':_0x11ac57[_0xaa73('0x40')]['id']}},_0x3ba022={};_0x3ba022[_0xaa73('0x29')]=_[_0xaa73('0x2b')](db[_0xaa73('0x26')][_0xaa73('0x27')]);_0x3ba022[_0xaa73('0x2a')]=_[_0xaa73('0x2b')](_0x11ac57['query']);_0x3ba022[_0xaa73('0x2c')]=_[_0xaa73('0x2e')](_0x3ba022[_0xaa73('0x29')],_0x3ba022[_0xaa73('0x2a')]);_0x534e41[_0xaa73('0x2d')]=_[_0xaa73('0x2e')](_0x3ba022[_0xaa73('0x29')],qs['fields'](_0x11ac57['query'][_0xaa73('0x2f')]));_0x534e41[_0xaa73('0x2d')]=_0x534e41[_0xaa73('0x2d')][_0xaa73('0x41')]?_0x534e41[_0xaa73('0x2d')]:_0x3ba022['model'];if(_0x11ac57[_0xaa73('0x2a')][_0xaa73('0x3b')]){_0x534e41[_0xaa73('0x3c')]=[{'all':!![]}];}_0x534e41=_[_0xaa73('0x38')]({},_0x534e41,_0x11ac57[_0xaa73('0x42')]);return db[_0xaa73('0x26')][_0xaa73('0x43')](_0x534e41)[_0xaa73('0x21')](handleEntityNotFound(_0x28d590,null))['then'](respondWithResult(_0x28d590,null))[_0xaa73('0x44')](handleError(_0x28d590,null));};exports[_0xaa73('0x45')]=function(_0x48fbdb,_0x5d9a5b){return db[_0xaa73('0x26')]['create'](_0x48fbdb[_0xaa73('0x46')],{})['then'](respondWithResult(_0x5d9a5b,0xc9))['catch'](handleError(_0x5d9a5b,null));};exports[_0xaa73('0x20')]=function(_0x3d386b,_0x2dd8e0){if(_0x3d386b[_0xaa73('0x46')]['id']){delete _0x3d386b[_0xaa73('0x46')]['id'];}return db[_0xaa73('0x26')][_0xaa73('0x43')]({'where':{'id':_0x3d386b[_0xaa73('0x40')]['id']}})['then'](handleEntityNotFound(_0x2dd8e0,null))[_0xaa73('0x21')](saveUpdates(_0x3d386b[_0xaa73('0x46')],null))['then'](respondWithResult(_0x2dd8e0,null))[_0xaa73('0x44')](handleError(_0x2dd8e0,null));};exports[_0xaa73('0x22')]=function(_0x14bda5,_0x4ac6c8){return db['FaxQueueReport']['find']({'where':{'id':_0x14bda5[_0xaa73('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ac6c8,null))['then'](removeEntity(_0x4ac6c8,null))[_0xaa73('0x44')](handleError(_0x4ac6c8,null));};exports['describe']=function(_0x326ca4,_0x4ca2b7){return db['FaxQueueReport'][_0xaa73('0x47')]()['then'](respondWithResult(_0x4ca2b7,null))[_0xaa73('0x44')](handleError(_0x4ca2b7,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 0540858..460f4ed 100644 --- a/server/api/faxQueueReport/faxQueueReport.model.js +++ b/server/api/faxQueueReport/faxQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x4ef44e,_0x33afb9){var _0x157d8d=function(_0x42fd84){while(--_0x42fd84){_0x4ef44e['push'](_0x4ef44e['shift']());}};_0x157d8d(++_0x33afb9);}(_0x326f,0xd1));var _0xf326=function(_0x22ea0e,_0x189e3c){_0x22ea0e=_0x22ea0e-0x0;var _0x2a2fe0=_0x326f[_0x22ea0e];return _0x2a2fe0;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger'];(function(_0x8307e3,_0x48eb78){var _0x492db9=function(_0x1284f7){while(--_0x1284f7){_0x8307e3['push'](_0x8307e3['shift']());}};_0x492db9(++_0x48eb78);}(_0x7217,0x19e));var _0x7721=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x7217[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[{'name':_0x7721('0xc'),'fields':[_0x7721('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 14f21dc..af74c3e 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 _0x3164=['CreateFaxQueueReport','FaxQueueReport','create','body','options','debug','UpdateFaxQueueReport','update','raw','where','limit','then','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x1353ef,_0x5c1263){var _0x39e8c2=function(_0x1e24da){while(--_0x1e24da){_0x1353ef['push'](_0x1353ef['shift']());}};_0x39e8c2(++_0x5c1263);}(_0x3164,0x1b9));var _0x4316=function(_0x16984d,_0x40a4d9){_0x16984d=_0x16984d-0x0;var _0x567c12=_0x3164[_0x16984d];return _0x567c12;};'use strict';var _=require(_0x4316('0x0'));var util=require('util');var moment=require(_0x4316('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4316('0x2'));var db=require(_0x4316('0x3'))['db'];var utils=require(_0x4316('0x4'));var logger=require(_0x4316('0x5'))(_0x4316('0x6'));var config=require(_0x4316('0x7'));var jayson=require(_0x4316('0x8'));var client=jayson[_0x4316('0x9')][_0x4316('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41431e,_0xddd60,_0x38c7ba){return new BPromise(function(_0x2c5b86,_0x160172){return client[_0x4316('0xb')](_0x41431e,_0x38c7ba)['then'](function(_0x51c27a){logger[_0x4316('0xc')](_0x4316('0xd'),_0xddd60,_0x4316('0xe'));logger['debug'](_0x4316('0xf'),_0xddd60,'request\x20sent',JSON[_0x4316('0x10')](_0x51c27a));if(_0x51c27a['error']){if(_0x51c27a[_0x4316('0x11')][_0x4316('0x12')]===0x1f4){logger[_0x4316('0x11')](_0x4316('0xd'),_0xddd60,_0x51c27a[_0x4316('0x11')][_0x4316('0x13')]);return _0x160172(_0x51c27a[_0x4316('0x11')][_0x4316('0x13')]);}logger[_0x4316('0x11')](_0x4316('0xd'),_0xddd60,_0x51c27a['error'][_0x4316('0x13')]);return _0x2c5b86(_0x51c27a[_0x4316('0x11')]['message']);}else{logger['info'](_0x4316('0xd'),_0xddd60,'request\x20sent');_0x2c5b86(_0x51c27a['result'][_0x4316('0x13')]);}})[_0x4316('0x14')](function(_0x389142){logger[_0x4316('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0xddd60,_0x389142);_0x160172(_0x389142);});});}exports[_0x4316('0x15')]=function(_0x5dcefe){var _0x1e81fa=this;return new Promise(function(_0xa69c3e,_0x18aa1a){return db[_0x4316('0x16')][_0x4316('0x17')](_0x5dcefe[_0x4316('0x18')],{'raw':_0x5dcefe[_0x4316('0x19')]?_0x5dcefe['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x33d196){logger[_0x4316('0xc')](_0x4316('0x15'),_0x5dcefe);logger[_0x4316('0x1a')]('CreateFaxQueueReport',_0x5dcefe,JSON['stringify'](_0x33d196));_0xa69c3e(_0x33d196);})[_0x4316('0x14')](function(_0x3d9189){logger['error'](_0x4316('0x15'),_0x3d9189[_0x4316('0x13')],_0x5dcefe);_0x18aa1a(_0x1e81fa[_0x4316('0x11')](0x1f4,_0x3d9189['message']));});});};exports[_0x4316('0x1b')]=function(_0x44899b){var _0x361b7b=this;return new Promise(function(_0x22c2a9,_0x222086){return db['FaxQueueReport'][_0x4316('0x1c')](_0x44899b[_0x4316('0x18')],{'raw':_0x44899b[_0x4316('0x19')]?_0x44899b[_0x4316('0x19')][_0x4316('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44899b[_0x4316('0x19')]?_0x44899b['options'][_0x4316('0x1e')]||null:null,'attributes':_0x44899b[_0x4316('0x19')]?_0x44899b['options']['attributes']||null:null,'limit':_0x44899b[_0x4316('0x19')]?_0x44899b[_0x4316('0x19')][_0x4316('0x1f')]||null:null})[_0x4316('0x20')](function(_0x499b3a){logger['info']('UpdateFaxQueueReport',_0x44899b);logger['debug'](_0x4316('0x1b'),_0x44899b,JSON[_0x4316('0x10')](_0x499b3a));_0x22c2a9(_0x499b3a);})[_0x4316('0x14')](function(_0x47eb32){logger[_0x4316('0x11')]('UpdateFaxQueueReport',_0x47eb32['message'],_0x44899b);_0x222086(_0x361b7b[_0x4316('0x11')](0x1f4,_0x47eb32[_0x4316('0x13')]));});});}; \ No newline at end of file +var _0xf9d7=['error','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport','FaxQueueReport','options','update','raw','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xf9d7,0x1eb));var _0x7f9d=function(_0x29e91f,_0x19746f){_0x29e91f=_0x29e91f-0x0;var _0x96024=_0xf9d7[_0x29e91f];return _0x96024;};'use strict';var _=require(_0x7f9d('0x0'));var util=require(_0x7f9d('0x1'));var moment=require(_0x7f9d('0x2'));var BPromise=require(_0x7f9d('0x3'));var rs=require(_0x7f9d('0x4'));var fs=require('fs');var Redis=require(_0x7f9d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f9d('0x6'));var logger=require(_0x7f9d('0x7'))(_0x7f9d('0x8'));var config=require('../../config/environment');var jayson=require(_0x7f9d('0x9'));var client=jayson[_0x7f9d('0xa')][_0x7f9d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c0ab5,_0x98eaa4,_0x29cd3b){return new BPromise(function(_0xa4324b,_0x1f556b){return client[_0x7f9d('0xc')](_0x2c0ab5,_0x29cd3b)[_0x7f9d('0xd')](function(_0x4c1974){logger[_0x7f9d('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x98eaa4,'request\x20sent');logger[_0x7f9d('0xf')](_0x7f9d('0x10'),_0x98eaa4,_0x7f9d('0x11'),JSON[_0x7f9d('0x12')](_0x4c1974));if(_0x4c1974[_0x7f9d('0x13')]){if(_0x4c1974[_0x7f9d('0x13')]['code']===0x1f4){logger['error'](_0x7f9d('0x14'),_0x98eaa4,_0x4c1974['error'][_0x7f9d('0x15')]);return _0x1f556b(_0x4c1974['error'][_0x7f9d('0x15')]);}logger['error'](_0x7f9d('0x14'),_0x98eaa4,_0x4c1974[_0x7f9d('0x13')][_0x7f9d('0x15')]);return _0xa4324b(_0x4c1974[_0x7f9d('0x13')][_0x7f9d('0x15')]);}else{logger['info'](_0x7f9d('0x14'),_0x98eaa4,_0x7f9d('0x11'));_0xa4324b(_0x4c1974[_0x7f9d('0x16')][_0x7f9d('0x15')]);}})['catch'](function(_0x51ba40){logger[_0x7f9d('0x13')](_0x7f9d('0x14'),_0x98eaa4,_0x51ba40);_0x1f556b(_0x51ba40);});});}exports[_0x7f9d('0x17')]=function(_0x18599e){var _0x38fedd=this;return new Promise(function(_0x25fa7a,_0x580926){return db[_0x7f9d('0x18')]['create'](_0x18599e['body'],{'raw':_0x18599e['options']?_0x18599e[_0x7f9d('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x7f9d('0xd')](function(_0x367755){logger['info'](_0x7f9d('0x17'),_0x18599e);logger[_0x7f9d('0xf')](_0x7f9d('0x17'),_0x18599e,JSON['stringify'](_0x367755));_0x25fa7a(_0x367755);})['catch'](function(_0x4c9047){logger[_0x7f9d('0x13')](_0x7f9d('0x17'),_0x4c9047['message'],_0x18599e);_0x580926(_0x38fedd[_0x7f9d('0x13')](0x1f4,_0x4c9047['message']));});});};exports['UpdateFaxQueueReport']=function(_0x411da7){var _0xf520ce=this;return new Promise(function(_0x162a65,_0x24f111){return db[_0x7f9d('0x18')][_0x7f9d('0x1a')](_0x411da7['body'],{'raw':_0x411da7[_0x7f9d('0x19')]?_0x411da7[_0x7f9d('0x19')][_0x7f9d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x411da7[_0x7f9d('0x19')]?_0x411da7[_0x7f9d('0x19')]['where']||null:null,'attributes':_0x411da7[_0x7f9d('0x19')]?_0x411da7[_0x7f9d('0x19')]['attributes']||null:null,'limit':_0x411da7[_0x7f9d('0x19')]?_0x411da7[_0x7f9d('0x19')][_0x7f9d('0x1c')]||null:null})[_0x7f9d('0xd')](function(_0x173704){logger[_0x7f9d('0xe')](_0x7f9d('0x1d'),_0x411da7);logger[_0x7f9d('0xf')]('UpdateFaxQueueReport',_0x411da7,JSON[_0x7f9d('0x12')](_0x173704));_0x162a65(_0x173704);})['catch'](function(_0xf8b9a1){logger[_0x7f9d('0x13')](_0x7f9d('0x1d'),_0xf8b9a1[_0x7f9d('0x15')],_0x411da7);_0x24f111(_0xf520ce[_0x7f9d('0x13')](0x1f4,_0xf8b9a1[_0x7f9d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index d7c8775..9ec9dc7 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 _0x58f9=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update'];(function(_0x113105,_0xce1173){var _0x31f76f=function(_0x55ac93){while(--_0x55ac93){_0x113105['push'](_0x113105['shift']());}};_0x31f76f(++_0xce1173);}(_0x58f9,0x100));var _0x958f=function(_0x1fa70a,_0xca1af8){_0x1fa70a=_0x1fa70a-0x0;var _0x18c010=_0x58f9[_0x1fa70a];return _0x18c010;};'use strict';var multer=require(_0x958f('0x0'));var util=require(_0x958f('0x1'));var path=require('path');var timeout=require(_0x958f('0x2'));var express=require(_0x958f('0x3'));var router=express[_0x958f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x958f('0x5'));var interaction=require(_0x958f('0x6'));var config=require('../../config/environment');var controller=require(_0x958f('0x7'));router[_0x958f('0x8')]('/',auth[_0x958f('0x9')](),controller['index']);router[_0x958f('0x8')]('/describe',auth[_0x958f('0x9')](),controller[_0x958f('0xa')]);router[_0x958f('0x8')](_0x958f('0xb'),auth[_0x958f('0x9')](),controller[_0x958f('0xc')]);router[_0x958f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x958f('0xe')](_0x958f('0xb'),auth[_0x958f('0x9')](),controller[_0x958f('0xf')]);router['delete'](_0x958f('0xb'),auth[_0x958f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2255=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','get','/describe','describe'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x2255,0xa3));var _0x5225=function(_0x380a1d,_0x2c35dd){_0x380a1d=_0x380a1d-0x0;var _0x5ef300=_0x2255[_0x380a1d];return _0x5ef300;};'use strict';var multer=require(_0x5225('0x0'));var util=require(_0x5225('0x1'));var path=require(_0x5225('0x2'));var timeout=require(_0x5225('0x3'));var express=require(_0x5225('0x4'));var router=express[_0x5225('0x5')]();var fs_extra=require(_0x5225('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5225('0x7'));var controller=require('./faxQueueReport.controller');router['get']('/',auth[_0x5225('0x8')](),controller[_0x5225('0x9')]);router[_0x5225('0xa')](_0x5225('0xb'),auth[_0x5225('0x8')](),controller[_0x5225('0xc')]);router[_0x5225('0xa')](_0x5225('0xd'),auth['isAuthenticated'](),controller[_0x5225('0xe')]);router[_0x5225('0xf')]('/',auth[_0x5225('0x8')](),controller[_0x5225('0x10')]);router[_0x5225('0x11')]('/:id',auth[_0x5225('0x8')](),controller[_0x5225('0x12')]);router[_0x5225('0x13')](_0x5225('0xd'),auth['isAuthenticated'](),controller[_0x5225('0x14')]);module[_0x5225('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 9b381ef..62e1472 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0xacadf9,_0x435886){var _0x1f2a17=function(_0x52a859){while(--_0x52a859){_0xacadf9['push'](_0xacadf9['shift']());}};_0x1f2a17(++_0x435886);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x496738,_0x3f1a9f){var _0xee1381=function(_0x4dc50c){while(--_0x4dc50c){_0x496738['push'](_0x496738['shift']());}};_0xee1381(++_0x3f1a9f);}(_0x9bde,0xe1));var _0xe9bd=function(_0x26b34a,_0x3a6148){_0x26b34a=_0x26b34a-0x0;var _0x47d800=_0x9bde[_0x26b34a];return _0x47d800;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 508ff37..b342d2a 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 _0x3eab=['VIRTUAL','include','findAll','rows','catch','show','params','length','merge','options','find','create','update','body','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter'];(function(_0x5ec019,_0x5bd130){var _0x556c3c=function(_0x24bb75){while(--_0x24bb75){_0x5ec019['push'](_0x5ec019['shift']());}};_0x556c3c(++_0x5bd130);}(_0x3eab,0x19a));var _0xb3ea=function(_0x5b63ea,_0x1a7dbf){_0x5b63ea=_0x5b63ea-0x0;var _0x5ba165=_0x3eab[_0x5b63ea];return _0x5ba165;};'use strict';var emlformat=require(_0xb3ea('0x0'));var rimraf=require(_0xb3ea('0x1'));var zipdir=require(_0xb3ea('0x2'));var jsonpatch=require(_0xb3ea('0x3'));var rp=require(_0xb3ea('0x4'));var moment=require(_0xb3ea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb3ea('0x6'));var util=require(_0xb3ea('0x7'));var path=require(_0xb3ea('0x8'));var sox=require(_0xb3ea('0x9'));var csv=require(_0xb3ea('0xa'));var ejs=require(_0xb3ea('0xb'));var fs=require('fs');var fs_extra=require(_0xb3ea('0xc'));var _=require(_0xb3ea('0xd'));var squel=require(_0xb3ea('0xe'));var crypto=require(_0xb3ea('0xf'));var jsforce=require(_0xb3ea('0x10'));var deskjs=require(_0xb3ea('0x11'));var toCsv=require(_0xb3ea('0xa'));var querystring=require('querystring');var Papa=require(_0xb3ea('0x12'));var Redis=require(_0xb3ea('0x13'));var authService=require(_0xb3ea('0x14'));var qs=require(_0xb3ea('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb3ea('0x16'));var logger=require(_0xb3ea('0x17'))(_0xb3ea('0x18'));var utils=require(_0xb3ea('0x19'));var config=require(_0xb3ea('0x1a'));var licenseUtil=require(_0xb3ea('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x559f33,_0x24c676){_0x24c676=_0x24c676||0xcc;return function(_0x1b5a07){if(_0x1b5a07){return _0x559f33['sendStatus'](_0x24c676);}return _0x559f33[_0xb3ea('0x1c')](_0x24c676)[_0xb3ea('0x1d')]();};}function respondWithResult(_0x523c54,_0x4c7593){_0x4c7593=_0x4c7593||0xc8;return function(_0x260df8){if(_0x260df8){return _0x523c54['status'](_0x4c7593)[_0xb3ea('0x1e')](_0x260df8);}};}function respondWithFilteredResult(_0x3cfa56,_0x3a9eb5){return function(_0xc4b189){if(_0xc4b189){var _0x27444b=typeof _0x3a9eb5['offset']===_0xb3ea('0x1f')&&typeof _0x3a9eb5['limit']===_0xb3ea('0x1f');var _0xb72765=_0xc4b189['count'];var _0xb70be2=_0x27444b?0x0:_0x3a9eb5[_0xb3ea('0x20')];var _0x43a91f=_0x27444b?_0xc4b189['count']:_0x3a9eb5[_0xb3ea('0x20')]+_0x3a9eb5[_0xb3ea('0x21')];var _0x491eb8;if(_0x43a91f>=_0xb72765){_0x43a91f=_0xb72765;_0x491eb8=0xc8;}else{_0x491eb8=0xce;}_0x3cfa56['status'](_0x491eb8);return _0x3cfa56[_0xb3ea('0x22')](_0xb3ea('0x23'),_0xb70be2+'-'+_0x43a91f+'/'+_0xb72765)[_0xb3ea('0x1e')](_0xc4b189);}return null;};}function patchUpdates(_0xcce07c){return function(_0x4fb032){try{jsonpatch[_0xb3ea('0x24')](_0x4fb032,_0xcce07c,!![]);}catch(_0x5a08b1){return BPromise[_0xb3ea('0x25')](_0x5a08b1);}return _0x4fb032[_0xb3ea('0x26')]();};}function saveUpdates(_0x3bdf57,_0x47f77b){return function(_0x388153){if(_0x388153){return _0x388153['update'](_0x3bdf57)[_0xb3ea('0x27')](function(_0x1f5063){return _0x1f5063;});}return null;};}function removeEntity(_0x2da341,_0x320252){return function(_0x5671d1){if(_0x5671d1){return _0x5671d1[_0xb3ea('0x28')]()[_0xb3ea('0x27')](function(){_0x2da341[_0xb3ea('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d1ab7,_0x4ff222){return function(_0x15ad37){if(!_0x15ad37){_0x1d1ab7['sendStatus'](0x194);}return _0x15ad37;};}function handleError(_0x239a62,_0x325af6){_0x325af6=_0x325af6||0x1f4;return function(_0x5b1762){logger[_0xb3ea('0x29')](_0x5b1762['stack']);if(_0x5b1762[_0xb3ea('0x2a')]){delete _0x5b1762['name'];}_0x239a62[_0xb3ea('0x1c')](_0x325af6)[_0xb3ea('0x2b')](_0x5b1762);};}exports[_0xb3ea('0x2c')]=function(_0x329b78,_0x447533){var _0x108f7f={},_0x3e1bad={},_0x1de51d={'count':0x0,'rows':[]};var _0x595a2d=_[_0xb3ea('0x2d')](db[_0xb3ea('0x2e')][_0xb3ea('0x2f')],function(_0x2f6bd5){return{'name':_0x2f6bd5[_0xb3ea('0x30')],'type':_0x2f6bd5[_0xb3ea('0x31')][_0xb3ea('0x32')]};});_0x3e1bad[_0xb3ea('0x33')]=_['map'](_0x595a2d,_0xb3ea('0x2a'));_0x3e1bad[_0xb3ea('0x34')]=_[_0xb3ea('0x35')](_0x329b78['query']);_0x3e1bad[_0xb3ea('0x36')]=_['intersection'](_0x3e1bad[_0xb3ea('0x33')],_0x3e1bad['query']);_0x108f7f[_0xb3ea('0x37')]=_[_0xb3ea('0x38')](_0x3e1bad[_0xb3ea('0x33')],qs[_0xb3ea('0x39')](_0x329b78['query'][_0xb3ea('0x39')]));_0x108f7f[_0xb3ea('0x37')]=_0x108f7f[_0xb3ea('0x37')]['length']?_0x108f7f[_0xb3ea('0x37')]:_0x3e1bad['model'];if(!_0x329b78[_0xb3ea('0x34')]['hasOwnProperty'](_0xb3ea('0x3a'))){_0x108f7f[_0xb3ea('0x21')]=qs['limit'](_0x329b78[_0xb3ea('0x34')][_0xb3ea('0x21')]);_0x108f7f[_0xb3ea('0x20')]=qs['offset'](_0x329b78[_0xb3ea('0x34')]['offset']);}_0x108f7f[_0xb3ea('0x3b')]=qs[_0xb3ea('0x3c')](_0x329b78[_0xb3ea('0x34')][_0xb3ea('0x3c')]);_0x108f7f[_0xb3ea('0x3d')]=qs[_0xb3ea('0x36')](_[_0xb3ea('0x3e')](_0x329b78['query'],_0x3e1bad[_0xb3ea('0x36')]),_0x595a2d);if(_0x329b78[_0xb3ea('0x34')][_0xb3ea('0x3f')]){_0x108f7f[_0xb3ea('0x3d')]=_['merge'](_0x108f7f[_0xb3ea('0x3d')],{'$or':_[_0xb3ea('0x2d')](_0x595a2d,function(_0x1d325f){if(_0x1d325f['type']!==_0xb3ea('0x40')){var _0x2ccafe={};_0x2ccafe[_0x1d325f[_0xb3ea('0x2a')]]={'$like':'%'+_0x329b78[_0xb3ea('0x34')]['filter']+'%'};return _0x2ccafe;}})});}_0x108f7f=_['merge']({},_0x108f7f,_0x329b78['options']);var _0x5984ea={'where':_0x108f7f[_0xb3ea('0x3d')]};return db[_0xb3ea('0x2e')]['count'](_0x5984ea)[_0xb3ea('0x27')](function(_0x499ddf){_0x1de51d['count']=_0x499ddf;if(_0x329b78[_0xb3ea('0x34')]['includeAll']){_0x108f7f[_0xb3ea('0x41')]=[{'all':!![]}];}return db[_0xb3ea('0x2e')][_0xb3ea('0x42')](_0x108f7f);})[_0xb3ea('0x27')](function(_0xeac701){_0x1de51d[_0xb3ea('0x43')]=_0xeac701;return _0x1de51d;})[_0xb3ea('0x27')](respondWithFilteredResult(_0x447533,_0x108f7f))[_0xb3ea('0x44')](handleError(_0x447533,null));};exports[_0xb3ea('0x45')]=function(_0x3bce22,_0xdb80ac){var _0x517ff3={'raw':!![],'where':{'id':_0x3bce22[_0xb3ea('0x46')]['id']}},_0x5e20ee={};_0x5e20ee[_0xb3ea('0x33')]=_['keys'](db[_0xb3ea('0x2e')]['rawAttributes']);_0x5e20ee['query']=_['keys'](_0x3bce22['query']);_0x5e20ee[_0xb3ea('0x36')]=_['intersection'](_0x5e20ee[_0xb3ea('0x33')],_0x5e20ee[_0xb3ea('0x34')]);_0x517ff3[_0xb3ea('0x37')]=_['intersection'](_0x5e20ee[_0xb3ea('0x33')],qs[_0xb3ea('0x39')](_0x3bce22['query'][_0xb3ea('0x39')]));_0x517ff3[_0xb3ea('0x37')]=_0x517ff3['attributes'][_0xb3ea('0x47')]?_0x517ff3['attributes']:_0x5e20ee['model'];if(_0x3bce22[_0xb3ea('0x34')]['includeAll']){_0x517ff3['include']=[{'all':!![]}];}_0x517ff3=_[_0xb3ea('0x48')]({},_0x517ff3,_0x3bce22[_0xb3ea('0x49')]);return db[_0xb3ea('0x2e')][_0xb3ea('0x4a')](_0x517ff3)[_0xb3ea('0x27')](handleEntityNotFound(_0xdb80ac,null))[_0xb3ea('0x27')](respondWithResult(_0xdb80ac,null))['catch'](handleError(_0xdb80ac,null));};exports[_0xb3ea('0x4b')]=function(_0x32ab54,_0x564f6e){return db[_0xb3ea('0x2e')][_0xb3ea('0x4b')](_0x32ab54['body'],{})[_0xb3ea('0x27')](respondWithResult(_0x564f6e,0xc9))[_0xb3ea('0x44')](handleError(_0x564f6e,null));};exports[_0xb3ea('0x4c')]=function(_0x141610,_0x375bfc){if(_0x141610[_0xb3ea('0x4d')]['id']){delete _0x141610['body']['id'];}return db[_0xb3ea('0x2e')][_0xb3ea('0x4a')]({'where':{'id':_0x141610[_0xb3ea('0x46')]['id']}})[_0xb3ea('0x27')](handleEntityNotFound(_0x375bfc,null))[_0xb3ea('0x27')](saveUpdates(_0x141610[_0xb3ea('0x4d')],null))[_0xb3ea('0x27')](respondWithResult(_0x375bfc,null))[_0xb3ea('0x44')](handleError(_0x375bfc,null));};exports[_0xb3ea('0x28')]=function(_0x4b31db,_0x1af082){return db[_0xb3ea('0x2e')][_0xb3ea('0x4a')]({'where':{'id':_0x4b31db[_0xb3ea('0x46')]['id']}})[_0xb3ea('0x27')](handleEntityNotFound(_0x1af082,null))[_0xb3ea('0x27')](removeEntity(_0x1af082,null))[_0xb3ea('0x44')](handleError(_0x1af082,null));};exports['describe']=function(_0x17a37b,_0x24413b){return db[_0xb3ea('0x2e')][_0xb3ea('0x4e')]()['then'](respondWithResult(_0x24413b,null))[_0xb3ea('0x44')](handleError(_0x24413b,null));}; \ No newline at end of file +var _0x6ba6=['findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','save','update','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x3cc3fc,_0x537cf1){var _0x37f6ef=function(_0x12448d){while(--_0x12448d){_0x3cc3fc['push'](_0x3cc3fc['shift']());}};_0x37f6ef(++_0x537cf1);}(_0x6ba6,0x133));var _0x66ba=function(_0x2af627,_0x33d47f){_0x2af627=_0x2af627-0x0;var _0x14eda9=_0x6ba6[_0x2af627];return _0x14eda9;};'use strict';var emlformat=require(_0x66ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x66ba('0x1'));var rp=require('request-promise');var moment=require(_0x66ba('0x2'));var BPromise=require(_0x66ba('0x3'));var Mustache=require(_0x66ba('0x4'));var util=require('util');var path=require('path');var sox=require(_0x66ba('0x5'));var csv=require(_0x66ba('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66ba('0x7'));var _=require(_0x66ba('0x8'));var squel=require(_0x66ba('0x9'));var crypto=require(_0x66ba('0xa'));var jsforce=require(_0x66ba('0xb'));var deskjs=require(_0x66ba('0xc'));var toCsv=require(_0x66ba('0x6'));var querystring=require(_0x66ba('0xd'));var Papa=require(_0x66ba('0xe'));var Redis=require(_0x66ba('0xf'));var authService=require(_0x66ba('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x66ba('0x11'));var hardwareService=require(_0x66ba('0x12'));var logger=require(_0x66ba('0x13'))(_0x66ba('0x14'));var utils=require(_0x66ba('0x15'));var config=require(_0x66ba('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x66ba('0x17'))['db'];function respondWithStatusCode(_0x5d85e8,_0x16c35a){_0x16c35a=_0x16c35a||0xcc;return function(_0x18c26c){if(_0x18c26c){return _0x5d85e8[_0x66ba('0x18')](_0x16c35a);}return _0x5d85e8[_0x66ba('0x19')](_0x16c35a)[_0x66ba('0x1a')]();};}function respondWithResult(_0x43a938,_0x31564d){_0x31564d=_0x31564d||0xc8;return function(_0x146adb){if(_0x146adb){return _0x43a938[_0x66ba('0x19')](_0x31564d)['json'](_0x146adb);}};}function respondWithFilteredResult(_0x41b70a,_0x1b2c81){return function(_0x544326){if(_0x544326){var _0x5e9550=typeof _0x1b2c81[_0x66ba('0x1b')]===_0x66ba('0x1c')&&typeof _0x1b2c81['limit']===_0x66ba('0x1c');var _0x11b444=_0x544326[_0x66ba('0x1d')];var _0x1a80ed=_0x5e9550?0x0:_0x1b2c81[_0x66ba('0x1b')];var _0x55c554=_0x5e9550?_0x544326[_0x66ba('0x1d')]:_0x1b2c81[_0x66ba('0x1b')]+_0x1b2c81[_0x66ba('0x1e')];var _0xbbedef;if(_0x55c554>=_0x11b444){_0x55c554=_0x11b444;_0xbbedef=0xc8;}else{_0xbbedef=0xce;}_0x41b70a['status'](_0xbbedef);return _0x41b70a['set']('Content-Range',_0x1a80ed+'-'+_0x55c554+'/'+_0x11b444)['json'](_0x544326);}return null;};}function patchUpdates(_0xae83c0){return function(_0x50571e){try{jsonpatch['apply'](_0x50571e,_0xae83c0,!![]);}catch(_0x2bc59c){return BPromise['reject'](_0x2bc59c);}return _0x50571e[_0x66ba('0x1f')]();};}function saveUpdates(_0x3e3040,_0x22e465){return function(_0x107992){if(_0x107992){return _0x107992[_0x66ba('0x20')](_0x3e3040)[_0x66ba('0x21')](function(_0x2bc3a8){return _0x2bc3a8;});}return null;};}function removeEntity(_0x5d1632,_0x39d916){return function(_0x1f594c){if(_0x1f594c){return _0x1f594c['destroy']()[_0x66ba('0x21')](function(){_0x5d1632[_0x66ba('0x19')](0xcc)[_0x66ba('0x1a')]();});}};}function handleEntityNotFound(_0x571e02,_0x3fcc76){return function(_0x5188a0){if(!_0x5188a0){_0x571e02[_0x66ba('0x18')](0x194);}return _0x5188a0;};}function handleError(_0x47e10e,_0x2f0986){_0x2f0986=_0x2f0986||0x1f4;return function(_0x4e029b){logger[_0x66ba('0x22')](_0x4e029b[_0x66ba('0x23')]);if(_0x4e029b[_0x66ba('0x24')]){delete _0x4e029b[_0x66ba('0x24')];}_0x47e10e['status'](_0x2f0986)[_0x66ba('0x25')](_0x4e029b);};}exports[_0x66ba('0x26')]=function(_0x212196,_0x57fcaa){var _0x415d95={},_0x300f78={},_0x51bfe5={'count':0x0,'rows':[]};var _0x5e7f82=_[_0x66ba('0x27')](db[_0x66ba('0x28')][_0x66ba('0x29')],function(_0x3a3299){return{'name':_0x3a3299[_0x66ba('0x2a')],'type':_0x3a3299[_0x66ba('0x2b')][_0x66ba('0x2c')]};});_0x300f78[_0x66ba('0x2d')]=_[_0x66ba('0x27')](_0x5e7f82,_0x66ba('0x24'));_0x300f78[_0x66ba('0x2e')]=_['keys'](_0x212196[_0x66ba('0x2e')]);_0x300f78['filters']=_[_0x66ba('0x2f')](_0x300f78['model'],_0x300f78['query']);_0x415d95[_0x66ba('0x30')]=_[_0x66ba('0x2f')](_0x300f78['model'],qs[_0x66ba('0x31')](_0x212196[_0x66ba('0x2e')][_0x66ba('0x31')]));_0x415d95[_0x66ba('0x30')]=_0x415d95[_0x66ba('0x30')]['length']?_0x415d95['attributes']:_0x300f78[_0x66ba('0x2d')];if(!_0x212196['query'][_0x66ba('0x32')](_0x66ba('0x33'))){_0x415d95[_0x66ba('0x1e')]=qs[_0x66ba('0x1e')](_0x212196[_0x66ba('0x2e')][_0x66ba('0x1e')]);_0x415d95[_0x66ba('0x1b')]=qs[_0x66ba('0x1b')](_0x212196[_0x66ba('0x2e')][_0x66ba('0x1b')]);}_0x415d95[_0x66ba('0x34')]=qs[_0x66ba('0x35')](_0x212196['query']['sort']);_0x415d95[_0x66ba('0x36')]=qs['filters'](_[_0x66ba('0x37')](_0x212196[_0x66ba('0x2e')],_0x300f78[_0x66ba('0x38')]),_0x5e7f82);if(_0x212196[_0x66ba('0x2e')][_0x66ba('0x39')]){_0x415d95[_0x66ba('0x36')]=_[_0x66ba('0x3a')](_0x415d95[_0x66ba('0x36')],{'$or':_['map'](_0x5e7f82,function(_0x50f722){if(_0x50f722[_0x66ba('0x2b')]!==_0x66ba('0x3b')){var _0x4b6c68={};_0x4b6c68[_0x50f722[_0x66ba('0x24')]]={'$like':'%'+_0x212196[_0x66ba('0x2e')][_0x66ba('0x39')]+'%'};return _0x4b6c68;}})});}_0x415d95=_['merge']({},_0x415d95,_0x212196[_0x66ba('0x3c')]);var _0x3287db={'where':_0x415d95[_0x66ba('0x36')]};return db[_0x66ba('0x28')][_0x66ba('0x1d')](_0x3287db)[_0x66ba('0x21')](function(_0x1c129b){_0x51bfe5[_0x66ba('0x1d')]=_0x1c129b;if(_0x212196[_0x66ba('0x2e')][_0x66ba('0x3d')]){_0x415d95[_0x66ba('0x3e')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x66ba('0x3f')](_0x415d95);})[_0x66ba('0x21')](function(_0x497a0a){_0x51bfe5[_0x66ba('0x40')]=_0x497a0a;return _0x51bfe5;})[_0x66ba('0x21')](respondWithFilteredResult(_0x57fcaa,_0x415d95))[_0x66ba('0x41')](handleError(_0x57fcaa,null));};exports[_0x66ba('0x42')]=function(_0x405d56,_0x289fb3){var _0x2ac260={'raw':!![],'where':{'id':_0x405d56[_0x66ba('0x43')]['id']}},_0x1f58aa={};_0x1f58aa[_0x66ba('0x2d')]=_['keys'](db['FaxTransferReport']['rawAttributes']);_0x1f58aa[_0x66ba('0x2e')]=_[_0x66ba('0x44')](_0x405d56[_0x66ba('0x2e')]);_0x1f58aa[_0x66ba('0x38')]=_['intersection'](_0x1f58aa[_0x66ba('0x2d')],_0x1f58aa[_0x66ba('0x2e')]);_0x2ac260['attributes']=_['intersection'](_0x1f58aa[_0x66ba('0x2d')],qs[_0x66ba('0x31')](_0x405d56[_0x66ba('0x2e')][_0x66ba('0x31')]));_0x2ac260[_0x66ba('0x30')]=_0x2ac260[_0x66ba('0x30')][_0x66ba('0x45')]?_0x2ac260[_0x66ba('0x30')]:_0x1f58aa[_0x66ba('0x2d')];if(_0x405d56[_0x66ba('0x2e')]['includeAll']){_0x2ac260[_0x66ba('0x3e')]=[{'all':!![]}];}_0x2ac260=_[_0x66ba('0x3a')]({},_0x2ac260,_0x405d56[_0x66ba('0x3c')]);return db[_0x66ba('0x28')][_0x66ba('0x46')](_0x2ac260)[_0x66ba('0x21')](handleEntityNotFound(_0x289fb3,null))[_0x66ba('0x21')](respondWithResult(_0x289fb3,null))['catch'](handleError(_0x289fb3,null));};exports[_0x66ba('0x47')]=function(_0x49c61c,_0x59fa28){return db[_0x66ba('0x28')][_0x66ba('0x47')](_0x49c61c[_0x66ba('0x48')],{})[_0x66ba('0x21')](respondWithResult(_0x59fa28,0xc9))[_0x66ba('0x41')](handleError(_0x59fa28,null));};exports[_0x66ba('0x20')]=function(_0x275836,_0x585306){if(_0x275836[_0x66ba('0x48')]['id']){delete _0x275836[_0x66ba('0x48')]['id'];}return db[_0x66ba('0x28')][_0x66ba('0x46')]({'where':{'id':_0x275836['params']['id']}})[_0x66ba('0x21')](handleEntityNotFound(_0x585306,null))[_0x66ba('0x21')](saveUpdates(_0x275836[_0x66ba('0x48')],null))[_0x66ba('0x21')](respondWithResult(_0x585306,null))[_0x66ba('0x41')](handleError(_0x585306,null));};exports['destroy']=function(_0x12f93e,_0x24d906){return db[_0x66ba('0x28')][_0x66ba('0x46')]({'where':{'id':_0x12f93e[_0x66ba('0x43')]['id']}})[_0x66ba('0x21')](handleEntityNotFound(_0x24d906,null))[_0x66ba('0x21')](removeEntity(_0x24d906,null))[_0x66ba('0x41')](handleError(_0x24d906,null));};exports[_0x66ba('0x49')]=function(_0x1ea27a,_0x3001bd){return db[_0x66ba('0x28')]['describe']()[_0x66ba('0x21')](respondWithResult(_0x3001bd,null))[_0x66ba('0x41')](handleError(_0x3001bd,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 05e074a..90aa16f 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 _0x4599=['./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4599,0x155));var _0x9459=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4599[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9459('0x0'));var util=require('util');var logger=require(_0x9459('0x1'))(_0x9459('0x2'));var moment=require(_0x9459('0x3'));var BPromise=require(_0x9459('0x4'));var rp=require(_0x9459('0x5'));var fs=require('fs');var path=require(_0x9459('0x6'));var rimraf=require(_0x9459('0x7'));var config=require(_0x9459('0x8'));var attributes=require(_0x9459('0x9'));module[_0x9459('0xa')]=function(_0x41b4fb,_0x2c9abb){return _0x41b4fb['define'](_0x9459('0xb'),attributes,{'tableName':_0x9459('0xc'),'paranoid':![],'indexes':[{'name':_0x9459('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x26f0=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x56bf62,_0x3787f6){var _0x3f71d7=function(_0x444300){while(--_0x444300){_0x56bf62['push'](_0x56bf62['shift']());}};_0x3f71d7(++_0x3787f6);}(_0x26f0,0xf4));var _0x026f=function(_0x4bbb60,_0x2506e4){_0x4bbb60=_0x4bbb60-0x0;var _0x4735b1=_0x26f0[_0x4bbb60];return _0x4735b1;};'use strict';var _=require(_0x026f('0x0'));var util=require(_0x026f('0x1'));var logger=require(_0x026f('0x2'))(_0x026f('0x3'));var moment=require('moment');var BPromise=require(_0x026f('0x4'));var rp=require(_0x026f('0x5'));var fs=require('fs');var path=require(_0x026f('0x6'));var rimraf=require(_0x026f('0x7'));var config=require(_0x026f('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0x026f('0x9')]=function(_0x57cf6f,_0x4206b3){return _0x57cf6f['define'](_0x026f('0xa'),attributes,{'tableName':_0x026f('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x026f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index ba6546e..4dc9705 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 _0x16f4=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x16f4,0x133));var _0x416f=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x16f4[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x416f('0x0'));var util=require('util');var moment=require(_0x416f('0x1'));var BPromise=require(_0x416f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x416f('0x3'))['db'];var utils=require(_0x416f('0x4'));var logger=require(_0x416f('0x5'))('rpc');var config=require(_0x416f('0x6'));var jayson=require(_0x416f('0x7'));var client=jayson[_0x416f('0x8')][_0x416f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf956ba,_0x90a58f,_0x90013b){return new BPromise(function(_0x1cac61,_0x2b7738){return client[_0x416f('0xa')](_0xf956ba,_0x90013b)[_0x416f('0xb')](function(_0x38699e){logger[_0x416f('0xc')](_0x416f('0xd'),_0x90a58f,_0x416f('0xe'));logger[_0x416f('0xf')](_0x416f('0x10'),_0x90a58f,_0x416f('0xe'),JSON[_0x416f('0x11')](_0x38699e));if(_0x38699e[_0x416f('0x12')]){if(_0x38699e[_0x416f('0x12')][_0x416f('0x13')]===0x1f4){logger[_0x416f('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x90a58f,_0x38699e[_0x416f('0x12')][_0x416f('0x14')]);return _0x2b7738(_0x38699e[_0x416f('0x12')]['message']);}logger[_0x416f('0x12')](_0x416f('0xd'),_0x90a58f,_0x38699e[_0x416f('0x12')]['message']);return _0x1cac61(_0x38699e[_0x416f('0x12')]['message']);}else{logger[_0x416f('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x90a58f,_0x416f('0xe'));_0x1cac61(_0x38699e[_0x416f('0x15')][_0x416f('0x14')]);}})[_0x416f('0x16')](function(_0x2b442d){logger[_0x416f('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x90a58f,_0x2b442d);_0x2b7738(_0x2b442d);});});} \ No newline at end of file +var _0x7828=['code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5ecbdf,_0x405953){var _0x46fdcb=function(_0x92134a){while(--_0x92134a){_0x5ecbdf['push'](_0x5ecbdf['shift']());}};_0x46fdcb(++_0x405953);}(_0x7828,0x1bc));var _0x8782=function(_0x259e04,_0x1944f8){_0x259e04=_0x259e04-0x0;var _0x566381=_0x7828[_0x259e04];return _0x566381;};'use strict';var _=require(_0x8782('0x0'));var util=require(_0x8782('0x1'));var moment=require(_0x8782('0x2'));var BPromise=require('bluebird');var rs=require(_0x8782('0x3'));var fs=require('fs');var Redis=require(_0x8782('0x4'));var db=require(_0x8782('0x5'))['db'];var utils=require(_0x8782('0x6'));var logger=require(_0x8782('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8782('0x8'));var client=jayson[_0x8782('0x9')][_0x8782('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fb898,_0x4455a3,_0x2413bf){return new BPromise(function(_0x3b86a2,_0xfbe454){return client[_0x8782('0xb')](_0x4fb898,_0x2413bf)[_0x8782('0xc')](function(_0x1d9f74){logger[_0x8782('0xd')](_0x8782('0xe'),_0x4455a3,'request\x20sent');logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x4455a3,_0x8782('0xf'),JSON[_0x8782('0x10')](_0x1d9f74));if(_0x1d9f74[_0x8782('0x11')]){if(_0x1d9f74['error'][_0x8782('0x12')]===0x1f4){logger[_0x8782('0x11')](_0x8782('0xe'),_0x4455a3,_0x1d9f74[_0x8782('0x11')][_0x8782('0x13')]);return _0xfbe454(_0x1d9f74[_0x8782('0x11')][_0x8782('0x13')]);}logger['error'](_0x8782('0xe'),_0x4455a3,_0x1d9f74[_0x8782('0x11')]['message']);return _0x3b86a2(_0x1d9f74[_0x8782('0x11')][_0x8782('0x13')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x4455a3,'request\x20sent');_0x3b86a2(_0x1d9f74[_0x8782('0x14')]['message']);}})[_0x8782('0x15')](function(_0x344cbd){logger[_0x8782('0x11')](_0x8782('0xe'),_0x4455a3,_0x344cbd);_0xfbe454(_0x344cbd);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 89b7c3b..abb6dee 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 _0x6e6d=['describe','/:id','post','create','update','delete','exports','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe'];(function(_0x36e26e,_0x13b02b){var _0x508e6c=function(_0x3c0b44){while(--_0x3c0b44){_0x36e26e['push'](_0x36e26e['shift']());}};_0x508e6c(++_0x13b02b);}(_0x6e6d,0x187));var _0xd6e6=function(_0x5241ba,_0x41a1d4){_0x5241ba=_0x5241ba-0x0;var _0x26e7c5=_0x6e6d[_0x5241ba];return _0x26e7c5;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd6e6('0x0'));var express=require(_0xd6e6('0x1'));var router=express['Router']();var fs_extra=require(_0xd6e6('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xd6e6('0x3'));var config=require(_0xd6e6('0x4'));var controller=require(_0xd6e6('0x5'));router[_0xd6e6('0x6')]('/',auth[_0xd6e6('0x7')](),controller['index']);router['get'](_0xd6e6('0x8'),auth[_0xd6e6('0x7')](),controller[_0xd6e6('0x9')]);router[_0xd6e6('0x6')](_0xd6e6('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xd6e6('0xb')]('/',auth[_0xd6e6('0x7')](),controller[_0xd6e6('0xc')]);router['put'](_0xd6e6('0xa'),auth[_0xd6e6('0x7')](),controller[_0xd6e6('0xd')]);router[_0xd6e6('0xe')](_0xd6e6('0xa'),auth[_0xd6e6('0x7')](),controller['destroy']);module[_0xd6e6('0xf')]=router; \ No newline at end of file +var _0xed0b=['post','create','put','update','delete','destroy','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1b5231,_0x2c4358){var _0xa43730=function(_0x5483e4){while(--_0x5483e4){_0x1b5231['push'](_0x1b5231['shift']());}};_0xa43730(++_0x2c4358);}(_0xed0b,0x16e));var _0xbed0=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xed0b[_0x10004e];return _0x5af990;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbed0('0x0'));var timeout=require(_0xbed0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbed0('0x2'));var auth=require(_0xbed0('0x3'));var interaction=require(_0xbed0('0x4'));var config=require(_0xbed0('0x5'));var controller=require(_0xbed0('0x6'));router[_0xbed0('0x7')]('/',auth[_0xbed0('0x8')](),controller[_0xbed0('0x9')]);router[_0xbed0('0x7')](_0xbed0('0xa'),auth[_0xbed0('0x8')](),controller[_0xbed0('0xb')]);router[_0xbed0('0x7')](_0xbed0('0xc'),auth[_0xbed0('0x8')](),controller[_0xbed0('0xd')]);router[_0xbed0('0xe')]('/',auth['isAuthenticated'](),controller[_0xbed0('0xf')]);router[_0xbed0('0x10')](_0xbed0('0xc'),auth[_0xbed0('0x8')](),controller[_0xbed0('0x11')]);router[_0xbed0('0x12')]('/:id',auth[_0xbed0('0x8')](),controller[_0xbed0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 688833d..6efc11f 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 _0xf0e3=['index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','path','connect-timeout','../../config/environment','isAuthenticated'];(function(_0x49462a,_0x52b916){var _0x20e2db=function(_0x4a38b1){while(--_0x4a38b1){_0x49462a['push'](_0x49462a['shift']());}};_0x20e2db(++_0x52b916);}(_0xf0e3,0x15c));var _0x3f0e=function(_0x1a605b,_0x7c9deb){_0x1a605b=_0x1a605b-0x0;var _0x2003b6=_0xf0e3[_0x1a605b];return _0x2003b6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3f0e('0x0'));var timeout=require(_0x3f0e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f0e('0x2'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x3f0e('0x3')](),controller[_0x3f0e('0x4')]);router[_0x3f0e('0x5')](_0x3f0e('0x6'),auth[_0x3f0e('0x3')](),controller[_0x3f0e('0x7')]);router[_0x3f0e('0x5')](_0x3f0e('0x8'),auth[_0x3f0e('0x3')](),controller['getConfigurations']);router['get'](_0x3f0e('0x9'),auth[_0x3f0e('0x3')](),controller[_0x3f0e('0xa')]);router[_0x3f0e('0xb')]('/',auth[_0x3f0e('0x3')](),controller[_0x3f0e('0xc')]);router[_0x3f0e('0xb')](_0x3f0e('0x8'),auth[_0x3f0e('0x3')](),controller[_0x3f0e('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3f0e('0xe')]);router['delete'](_0x3f0e('0x6'),auth[_0x3f0e('0x3')](),controller[_0x3f0e('0xf')]);module['exports']=router; \ No newline at end of file +var _0xc87d=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc87d,0x19b));var _0xdc87=function(_0x37f7b7,_0x3cf4d8){_0x37f7b7=_0x37f7b7-0x0;var _0x3c4497=_0xc87d[_0x37f7b7];return _0x3c4497;};'use strict';var multer=require(_0xdc87('0x0'));var util=require(_0xdc87('0x1'));var path=require(_0xdc87('0x2'));var timeout=require(_0xdc87('0x3'));var express=require(_0xdc87('0x4'));var router=express[_0xdc87('0x5')]();var fs_extra=require(_0xdc87('0x6'));var auth=require(_0xdc87('0x7'));var interaction=require(_0xdc87('0x8'));var config=require(_0xdc87('0x9'));var controller=require(_0xdc87('0xa'));router[_0xdc87('0xb')]('/',auth[_0xdc87('0xc')](),controller[_0xdc87('0xd')]);router[_0xdc87('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdc87('0xe')]);router[_0xdc87('0xb')](_0xdc87('0xf'),auth[_0xdc87('0xc')](),controller[_0xdc87('0x10')]);router[_0xdc87('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0xdc87('0x11')]);router[_0xdc87('0x12')]('/',auth[_0xdc87('0xc')](),controller[_0xdc87('0x13')]);router[_0xdc87('0x12')](_0xdc87('0xf'),auth[_0xdc87('0xc')](),controller[_0xdc87('0x14')]);router[_0xdc87('0x15')](_0xdc87('0x16'),auth['isAuthenticated'](),controller[_0xdc87('0x17')]);router[_0xdc87('0x18')](_0xdc87('0x16'),auth['isAuthenticated'](),controller[_0xdc87('0x19')]);module[_0xdc87('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 15e65fc..0940545 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 _0xdad0=['sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x1a3904,_0x812f56){var _0x8e8499=function(_0x3f5cfc){while(--_0x3f5cfc){_0x1a3904['push'](_0x1a3904['shift']());}};_0x8e8499(++_0x812f56);}(_0xdad0,0x108));var _0x0dad=function(_0x40294c,_0x2b4c24){_0x40294c=_0x40294c-0x0;var _0x547504=_0xdad0[_0x40294c];return _0x547504;};'use strict';var Sequelize=require(_0x0dad('0x0'));module[_0x0dad('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0dad('0x2')]},'username':{'type':Sequelize[_0x0dad('0x2')]},'remoteUri':{'type':Sequelize[_0x0dad('0x2')]},'authType':{'type':Sequelize[_0x0dad('0x3')]('basic'),'defaultValue':_0x0dad('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x0dad('0x2')]},'token':{'type':Sequelize[_0x0dad('0x2')]},'tokenSecret':{'type':Sequelize[_0x0dad('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x0dad('0x3')](_0x0dad('0x5'),'newTab'),'defaultValue':_0x0dad('0x5')}}; \ No newline at end of file +var _0x813e=['integrationTab','newTab','STRING','ENUM','basic'];(function(_0x35acf5,_0x4577af){var _0x3ffed3=function(_0x58d47c){while(--_0x58d47c){_0x35acf5['push'](_0x35acf5['shift']());}};_0x3ffed3(++_0x4577af);}(_0x813e,0x18d));var _0xe813=function(_0x1cd51f,_0x297954){_0x1cd51f=_0x1cd51f-0x0;var _0x54208a=_0x813e[_0x1cd51f];return _0x54208a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe813('0x0')]},'description':{'type':Sequelize[_0xe813('0x0')]},'username':{'type':Sequelize[_0xe813('0x0')]},'remoteUri':{'type':Sequelize[_0xe813('0x0')]},'authType':{'type':Sequelize[_0xe813('0x1')]('basic'),'defaultValue':_0xe813('0x2')},'password':{'type':Sequelize[_0xe813('0x0')]},'consumerKey':{'type':Sequelize[_0xe813('0x0')]},'consumerSecret':{'type':Sequelize[_0xe813('0x0')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xe813('0x0')]},'serverUrl':{'type':Sequelize[_0xe813('0x0')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe813('0x3'),_0xe813('0x4')),'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 2612d28..7863e0f 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 _0x5695=['show','options','find','create','body','params','getConfigurations','DeskConfiguration','rawAttributes','addConfiguration','findOne','AccountId','Subjects','channel','type','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','GET','format','%s/custom_fields','application/json','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','entries','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','destroy','then','stack','name','index','map','DeskAccount','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x4490e8,_0x3fd1b2){var _0x41af10=function(_0x3c1cf2){while(--_0x3c1cf2){_0x4490e8['push'](_0x4490e8['shift']());}};_0x41af10(++_0x3fd1b2);}(_0x5695,0x9e));var _0x5569=function(_0x123f6c,_0x3e34bc){_0x123f6c=_0x123f6c-0x0;var _0x1a35d0=_0x5695[_0x123f6c];return _0x1a35d0;};'use strict';var emlformat=require(_0x5569('0x0'));var rimraf=require(_0x5569('0x1'));var zipdir=require(_0x5569('0x2'));var jsonpatch=require(_0x5569('0x3'));var rp=require(_0x5569('0x4'));var moment=require(_0x5569('0x5'));var BPromise=require(_0x5569('0x6'));var Mustache=require(_0x5569('0x7'));var util=require(_0x5569('0x8'));var path=require(_0x5569('0x9'));var sox=require(_0x5569('0xa'));var csv=require(_0x5569('0xb'));var ejs=require(_0x5569('0xc'));var fs=require('fs');var fs_extra=require(_0x5569('0xd'));var _=require('lodash');var squel=require(_0x5569('0xe'));var crypto=require(_0x5569('0xf'));var jsforce=require(_0x5569('0x10'));var deskjs=require(_0x5569('0x11'));var toCsv=require(_0x5569('0xb'));var querystring=require(_0x5569('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5569('0x13'));var qs=require(_0x5569('0x14'));var as=require(_0x5569('0x15'));var hardwareService=require(_0x5569('0x16'));var logger=require('../../config/logger')(_0x5569('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5569('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x333e24,_0x2479f5){_0x2479f5=_0x2479f5||0xcc;return function(_0x50f417){if(_0x50f417){return _0x333e24[_0x5569('0x19')](_0x2479f5);}return _0x333e24[_0x5569('0x1a')](_0x2479f5)[_0x5569('0x1b')]();};}function respondWithResult(_0xc8406d,_0x88165){_0x88165=_0x88165||0xc8;return function(_0x13238e){if(_0x13238e){return _0xc8406d[_0x5569('0x1a')](_0x88165)[_0x5569('0x1c')](_0x13238e);}};}function respondWithFilteredResult(_0x36cca4,_0x3d8320){return function(_0x14d045){if(_0x14d045){var _0x373cba=typeof _0x3d8320['offset']===_0x5569('0x1d')&&typeof _0x3d8320[_0x5569('0x1e')]===_0x5569('0x1d');var _0x34b805=_0x14d045[_0x5569('0x1f')];var _0x260f93=_0x373cba?0x0:_0x3d8320[_0x5569('0x20')];var _0xa42272=_0x373cba?_0x14d045[_0x5569('0x1f')]:_0x3d8320[_0x5569('0x20')]+_0x3d8320[_0x5569('0x1e')];var _0x1b2605;if(_0xa42272>=_0x34b805){_0xa42272=_0x34b805;_0x1b2605=0xc8;}else{_0x1b2605=0xce;}_0x36cca4['status'](_0x1b2605);return _0x36cca4[_0x5569('0x21')]('Content-Range',_0x260f93+'-'+_0xa42272+'/'+_0x34b805)['json'](_0x14d045);}return null;};}function patchUpdates(_0xdcc62f){return function(_0x1b9e22){try{jsonpatch[_0x5569('0x22')](_0x1b9e22,_0xdcc62f,!![]);}catch(_0x4d70d2){return BPromise['reject'](_0x4d70d2);}return _0x1b9e22[_0x5569('0x23')]();};}function saveUpdates(_0x3afa30,_0x6ff7db){return function(_0x5e6d23){if(_0x5e6d23){return _0x5e6d23[_0x5569('0x24')](_0x3afa30)['then'](function(_0x1cb1ef){return _0x1cb1ef;});}return null;};}function removeEntity(_0x344c72,_0x2768e3){return function(_0x3cb681){if(_0x3cb681){return _0x3cb681[_0x5569('0x25')]()[_0x5569('0x26')](function(){_0x344c72[_0x5569('0x1a')](0xcc)[_0x5569('0x1b')]();});}};}function handleEntityNotFound(_0x53afdf,_0x87feb2){return function(_0x1571b4){if(!_0x1571b4){_0x53afdf[_0x5569('0x19')](0x194);}return _0x1571b4;};}function handleError(_0x2fa875,_0xf6f489){_0xf6f489=_0xf6f489||0x1f4;return function(_0x46609a){logger['error'](_0x46609a[_0x5569('0x27')]);if(_0x46609a[_0x5569('0x28')]){delete _0x46609a[_0x5569('0x28')];}_0x2fa875[_0x5569('0x1a')](_0xf6f489)['send'](_0x46609a);};}exports[_0x5569('0x29')]=function(_0x1af25d,_0x44e666){var _0x11b152={},_0x210009={},_0x2ad263={'count':0x0,'rows':[]};var _0x4029e9=_[_0x5569('0x2a')](db[_0x5569('0x2b')]['rawAttributes'],function(_0x4efb46){return{'name':_0x4efb46['fieldName'],'type':_0x4efb46['type']['key']};});_0x210009[_0x5569('0x2c')]=_[_0x5569('0x2a')](_0x4029e9,_0x5569('0x28'));_0x210009[_0x5569('0x2d')]=_[_0x5569('0x2e')](_0x1af25d[_0x5569('0x2d')]);_0x210009[_0x5569('0x2f')]=_['intersection'](_0x210009[_0x5569('0x2c')],_0x210009[_0x5569('0x2d')]);_0x11b152[_0x5569('0x30')]=_[_0x5569('0x31')](_0x210009[_0x5569('0x2c')],qs[_0x5569('0x32')](_0x1af25d[_0x5569('0x2d')][_0x5569('0x32')]));_0x11b152[_0x5569('0x30')]=_0x11b152[_0x5569('0x30')][_0x5569('0x33')]?_0x11b152['attributes']:_0x210009[_0x5569('0x2c')];if(!_0x1af25d[_0x5569('0x2d')][_0x5569('0x34')](_0x5569('0x35'))){_0x11b152[_0x5569('0x1e')]=qs[_0x5569('0x1e')](_0x1af25d['query']['limit']);_0x11b152[_0x5569('0x20')]=qs[_0x5569('0x20')](_0x1af25d[_0x5569('0x2d')][_0x5569('0x20')]);}_0x11b152[_0x5569('0x36')]=qs['sort'](_0x1af25d[_0x5569('0x2d')][_0x5569('0x37')]);_0x11b152[_0x5569('0x38')]=qs[_0x5569('0x2f')](_[_0x5569('0x39')](_0x1af25d[_0x5569('0x2d')],_0x210009[_0x5569('0x2f')]),_0x4029e9);if(_0x1af25d[_0x5569('0x2d')][_0x5569('0x3a')]){_0x11b152[_0x5569('0x38')]=_[_0x5569('0x3b')](_0x11b152[_0x5569('0x38')],{'$or':_[_0x5569('0x2a')](_0x4029e9,function(_0x19eeed){if(_0x19eeed['type']!==_0x5569('0x3c')){var _0x24b6a3={};_0x24b6a3[_0x19eeed['name']]={'$like':'%'+_0x1af25d[_0x5569('0x2d')]['filter']+'%'};return _0x24b6a3;}})});}_0x11b152=_['merge']({},_0x11b152,_0x1af25d['options']);var _0x35f7f6={'where':_0x11b152[_0x5569('0x38')]};return db[_0x5569('0x2b')]['count'](_0x35f7f6)[_0x5569('0x26')](function(_0x25141a){_0x2ad263['count']=_0x25141a;if(_0x1af25d['query'][_0x5569('0x3d')]){_0x11b152[_0x5569('0x3e')]=[{'all':!![]}];}return db[_0x5569('0x2b')][_0x5569('0x3f')](_0x11b152);})[_0x5569('0x26')](function(_0x13a9bb){_0x2ad263[_0x5569('0x40')]=_0x13a9bb;return _0x2ad263;})[_0x5569('0x26')](respondWithFilteredResult(_0x44e666,_0x11b152))[_0x5569('0x41')](handleError(_0x44e666,null));};exports[_0x5569('0x42')]=function(_0x768030,_0x5c2aeb){var _0x504b69={'raw':![],'where':{'id':_0x768030['params']['id']}},_0x1352cb={};_0x1352cb[_0x5569('0x2c')]=_[_0x5569('0x2e')](db[_0x5569('0x2b')]['rawAttributes']);_0x1352cb[_0x5569('0x2d')]=_[_0x5569('0x2e')](_0x768030['query']);_0x1352cb['filters']=_[_0x5569('0x31')](_0x1352cb['model'],_0x1352cb[_0x5569('0x2d')]);_0x504b69['attributes']=_[_0x5569('0x31')](_0x1352cb[_0x5569('0x2c')],qs[_0x5569('0x32')](_0x768030[_0x5569('0x2d')][_0x5569('0x32')]));_0x504b69[_0x5569('0x30')]=_0x504b69['attributes'][_0x5569('0x33')]?_0x504b69[_0x5569('0x30')]:_0x1352cb[_0x5569('0x2c')];if(_0x768030[_0x5569('0x2d')][_0x5569('0x3d')]){_0x504b69[_0x5569('0x3e')]=[{'all':!![]}];}_0x504b69=_[_0x5569('0x3b')]({},_0x504b69,_0x768030[_0x5569('0x43')]);return db[_0x5569('0x2b')][_0x5569('0x44')](_0x504b69)['then'](handleEntityNotFound(_0x5c2aeb,null))['then'](respondWithResult(_0x5c2aeb,null))[_0x5569('0x41')](handleError(_0x5c2aeb,null));};exports['create']=function(_0x4fcda6,_0x2b8a78){return db['DeskAccount'][_0x5569('0x45')](_0x4fcda6[_0x5569('0x46')],{})['then'](respondWithResult(_0x2b8a78,0xc9))[_0x5569('0x41')](handleError(_0x2b8a78,null));};exports[_0x5569('0x24')]=function(_0x37cc3d,_0x44fc6e){if(_0x37cc3d[_0x5569('0x46')]['id']){delete _0x37cc3d[_0x5569('0x46')]['id'];}return db[_0x5569('0x2b')][_0x5569('0x44')]({'where':{'id':_0x37cc3d[_0x5569('0x47')]['id']}})[_0x5569('0x26')](handleEntityNotFound(_0x44fc6e,null))['then'](saveUpdates(_0x37cc3d[_0x5569('0x46')],null))['then'](respondWithResult(_0x44fc6e,null))[_0x5569('0x41')](handleError(_0x44fc6e,null));};exports['destroy']=function(_0x2e0aab,_0x6bbb38){return db['DeskAccount'][_0x5569('0x44')]({'where':{'id':_0x2e0aab[_0x5569('0x47')]['id']}})[_0x5569('0x26')](handleEntityNotFound(_0x6bbb38,null))['then'](removeEntity(_0x6bbb38,null))[_0x5569('0x41')](handleError(_0x6bbb38,null));};exports[_0x5569('0x48')]=function(_0x214745,_0x3b96a8,_0x114977){var _0x4979c5={};var _0x3efe3e={};var _0xbc3ec8;var _0x5e626f;return db[_0x5569('0x2b')]['findOne']({'where':{'id':_0x214745[_0x5569('0x47')]['id']}})[_0x5569('0x26')](handleEntityNotFound(_0x3b96a8,null))[_0x5569('0x26')](function(_0x164876){if(_0x164876){_0xbc3ec8=_0x164876;_0x3efe3e[_0x5569('0x2c')]=_[_0x5569('0x2e')](db[_0x5569('0x49')][_0x5569('0x4a')]);_0x3efe3e[_0x5569('0x2d')]=_[_0x5569('0x2e')](_0x214745[_0x5569('0x2d')]);_0x3efe3e[_0x5569('0x2f')]=_[_0x5569('0x31')](_0x3efe3e['model'],_0x3efe3e[_0x5569('0x2d')]);_0x4979c5[_0x5569('0x30')]=_[_0x5569('0x31')](_0x3efe3e[_0x5569('0x2c')],qs[_0x5569('0x32')](_0x214745[_0x5569('0x2d')]['fields']));_0x4979c5[_0x5569('0x30')]=_0x4979c5[_0x5569('0x30')]['length']?_0x4979c5[_0x5569('0x30')]:_0x3efe3e[_0x5569('0x2c')];_0x4979c5[_0x5569('0x36')]=qs[_0x5569('0x37')](_0x214745[_0x5569('0x2d')]['sort']);_0x4979c5[_0x5569('0x38')]=qs[_0x5569('0x2f')](_[_0x5569('0x39')](_0x214745[_0x5569('0x2d')],_0x3efe3e[_0x5569('0x2f')]));if(_0x214745[_0x5569('0x2d')][_0x5569('0x3a')]){_0x4979c5[_0x5569('0x38')]=_[_0x5569('0x3b')](_0x4979c5[_0x5569('0x38')],{'$or':_[_0x5569('0x2a')](_0x4979c5['attributes'],function(_0x443c63){var _0x3163a0={};_0x3163a0[_0x443c63]={'$like':'%'+_0x214745[_0x5569('0x2d')][_0x5569('0x3a')]+'%'};return _0x3163a0;})});}_0x4979c5=_[_0x5569('0x3b')]({},_0x4979c5,_0x214745['options']);return _0xbc3ec8[_0x5569('0x48')](_0x4979c5);}})[_0x5569('0x26')](function(_0x3ef7c0){if(_0x3ef7c0){_0x5e626f=_0x3ef7c0[_0x5569('0x33')];if(!_0x214745[_0x5569('0x2d')]['hasOwnProperty'](_0x5569('0x35'))){_0x4979c5[_0x5569('0x1e')]=qs[_0x5569('0x1e')](_0x214745['query'][_0x5569('0x1e')]);_0x4979c5[_0x5569('0x20')]=qs[_0x5569('0x20')](_0x214745[_0x5569('0x2d')][_0x5569('0x20')]);}return _0xbc3ec8['getConfigurations'](_0x4979c5);}})[_0x5569('0x26')](function(_0x12ff0e){if(_0x12ff0e){return _0x12ff0e?{'count':_0x5e626f,'rows':_0x12ff0e}:null;}})['then'](respondWithResult(_0x3b96a8,null))['catch'](handleError(_0x3b96a8,null));};exports[_0x5569('0x4b')]=function(_0xef638c,_0x5861fb,_0x4743cb){if(_0xef638c['body']['id']){delete _0xef638c[_0x5569('0x46')]['id'];}return db['DeskAccount'][_0x5569('0x4c')]({'where':{'id':_0xef638c[_0x5569('0x47')]['id']}})[_0x5569('0x26')](handleEntityNotFound(_0x5861fb,null))['then'](function(_0x26874d){if(_0x26874d){_0xef638c[_0x5569('0x46')][_0x5569('0x4d')]=_0x26874d['id'];_0xef638c['body'][_0x5569('0x4e')]=integrations['getSubjects'](_0xef638c[_0x5569('0x46')][_0x5569('0x4f')],_0xef638c[_0x5569('0x46')][_0x5569('0x50')]);_0xef638c[_0x5569('0x46')][_0x5569('0x51')]=integrations[_0x5569('0x52')](_0xef638c[_0x5569('0x46')][_0x5569('0x4f')],_0xef638c[_0x5569('0x46')]['type']);return db[_0x5569('0x49')]['create'](_0xef638c[_0x5569('0x46')],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0x5569('0x53')],'as':_0x5569('0x51')}]});}return null;})[_0x5569('0x26')](respondWithResult(_0x5861fb,null))[_0x5569('0x41')](handleError(_0x5861fb,null));};exports[_0x5569('0x54')]=function(_0x1320b0,_0xe9721c,_0x46cb3e){var _0x5aba39=[{'name':_0x5569('0x55'),'label':_0x5569('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 _0x35efbf='';return db[_0x5569('0x2b')][_0x5569('0x4c')]({'where':{'id':_0x1320b0[_0x5569('0x47')]['id']},'attributes':['id',_0x5569('0x56'),_0x5569('0x57'),_0x5569('0x58'),_0x5569('0x59'),_0x5569('0x5a'),_0x5569('0x5b'),_0x5569('0x5c'),_0x5569('0x5d')]})[_0x5569('0x26')](handleEntityNotFound(_0xe9721c,null))[_0x5569('0x26')](function(_0x4d3b28){if(_0x4d3b28){_0x35efbf=_0x4d3b28[_0x5569('0x56')];var _0x487adc=_0x35efbf['slice'](-0x1);if(_0x487adc==='/'){_0x35efbf=_0x35efbf['substring'](0x0,_0x35efbf['lastIndexOf'](_0x487adc));}var _0x46d014={'method':_0x5569('0x5e'),'uri':util[_0x5569('0x5f')](_0x5569('0x60'),_0x35efbf),'headers':{'Content-Type':_0x5569('0x61'),'Accept':_0x5569('0x61')},'json':!![]};if(_0x4d3b28[_0x5569('0x57')]==='basic'){_0x46d014['headers'][_0x5569('0x62')]=util['format'](_0x5569('0x63'),new Buffer(util[_0x5569('0x5f')](_0x5569('0x64'),_0x4d3b28[_0x5569('0x58')],_0x4d3b28[_0x5569('0x59')]))[_0x5569('0x65')](_0x5569('0x66')));}return rp(_0x46d014)[_0x5569('0x26')](function(_0x4a9645){return _0x5aba39[_0x5569('0x67')](_[_0x5569('0x2a')](_0x4a9645['_embedded'][_0x5569('0x68')],function(_0x58b9fb){return{'id':_0x58b9fb[_0x5569('0x28')],'name':_0x58b9fb[_0x5569('0x28')],'type':_0x58b9fb[_0x5569('0x50')],'active':_0x58b9fb[_0x5569('0x69')],'label':_0x58b9fb[_0x5569('0x6a')],'custom':!![]};}));});}})[_0x5569('0x26')](function(_0x4767e7){return{'count':_0x4767e7[_0x5569('0x33')],'rows':_0x4767e7};})[_0x5569('0x26')](respondWithResult(_0xe9721c,null))['catch'](function(_0x33d77e){var _0x10207d=_0x1320b0[_0x5569('0x2d')][_0x5569('0x6b')]?0x1f4:_0x33d77e[_0x5569('0x6c')]||0x1f4;logger[_0x5569('0x6d')](_0x5569('0x6e'),_0x5569('0x54'),_0x10207d,JSON['stringify'](_0x33d77e));delete _0x33d77e[_0x5569('0x28')];if(_0x10207d===0x191){_0x10207d=0x190;}_0xe9721c['status'](_0x10207d)[_0x5569('0x6f')](_0x1320b0[_0x5569('0x2d')][_0x5569('0x6b')]?{'message':'Wrong\x20credentials','statusCode':_0x33d77e['statusCode']}:_0x33d77e);});}; \ No newline at end of file +var _0xc946=['consumerKey','consumerSecret','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','entries','active','label','test','statusCode','getFields','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','set','Content-Range','save','update','sendStatus','error','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','options','then','include','findAll','rows','catch','params','includeAll','find','create','body','getConfigurations','findOne','order','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','Subjects','DeskField','remoteUri','authType','username','password'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xc946,0x1e4));var _0x6c94=function(_0x29fc06,_0x24a97f){_0x29fc06=_0x29fc06-0x0;var _0x2a37ea=_0xc946[_0x29fc06];return _0x2a37ea;};'use strict';var emlformat=require(_0x6c94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6c94('0x1'));var jsonpatch=require(_0x6c94('0x2'));var rp=require(_0x6c94('0x3'));var moment=require(_0x6c94('0x4'));var BPromise=require(_0x6c94('0x5'));var Mustache=require(_0x6c94('0x6'));var util=require('util');var path=require(_0x6c94('0x7'));var sox=require(_0x6c94('0x8'));var csv=require(_0x6c94('0x9'));var ejs=require(_0x6c94('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6c94('0xb'));var squel=require(_0x6c94('0xc'));var crypto=require(_0x6c94('0xd'));var jsforce=require(_0x6c94('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6c94('0x9'));var querystring=require('querystring');var Papa=require(_0x6c94('0xf'));var Redis=require(_0x6c94('0x10'));var authService=require(_0x6c94('0x11'));var qs=require(_0x6c94('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c94('0x13'));var logger=require(_0x6c94('0x14'))(_0x6c94('0x15'));var utils=require(_0x6c94('0x16'));var config=require(_0x6c94('0x17'));var licenseUtil=require(_0x6c94('0x18'));var db=require(_0x6c94('0x19'))['db'];var integrations=require(_0x6c94('0x1a'));function respondWithStatusCode(_0x32076d,_0x47b1f0){_0x47b1f0=_0x47b1f0||0xcc;return function(_0x30f569){if(_0x30f569){return _0x32076d['sendStatus'](_0x47b1f0);}return _0x32076d[_0x6c94('0x1b')](_0x47b1f0)[_0x6c94('0x1c')]();};}function respondWithResult(_0x20e6b0,_0x58869c){_0x58869c=_0x58869c||0xc8;return function(_0x2e03bc){if(_0x2e03bc){return _0x20e6b0[_0x6c94('0x1b')](_0x58869c)[_0x6c94('0x1d')](_0x2e03bc);}};}function respondWithFilteredResult(_0x52277d,_0x4447f7){return function(_0x4ecc9a){if(_0x4ecc9a){var _0x1b29c0=typeof _0x4447f7[_0x6c94('0x1e')]===_0x6c94('0x1f')&&typeof _0x4447f7['limit']===_0x6c94('0x1f');var _0x14a709=_0x4ecc9a[_0x6c94('0x20')];var _0x8e37d1=_0x1b29c0?0x0:_0x4447f7[_0x6c94('0x1e')];var _0x2d049c=_0x1b29c0?_0x4ecc9a[_0x6c94('0x20')]:_0x4447f7[_0x6c94('0x1e')]+_0x4447f7['limit'];var _0x123595;if(_0x2d049c>=_0x14a709){_0x2d049c=_0x14a709;_0x123595=0xc8;}else{_0x123595=0xce;}_0x52277d[_0x6c94('0x1b')](_0x123595);return _0x52277d[_0x6c94('0x21')](_0x6c94('0x22'),_0x8e37d1+'-'+_0x2d049c+'/'+_0x14a709)[_0x6c94('0x1d')](_0x4ecc9a);}return null;};}function patchUpdates(_0xb7dfc8){return function(_0x1775bd){try{jsonpatch['apply'](_0x1775bd,_0xb7dfc8,!![]);}catch(_0x32afc3){return BPromise['reject'](_0x32afc3);}return _0x1775bd[_0x6c94('0x23')]();};}function saveUpdates(_0x20668a,_0x10e19b){return function(_0x350293){if(_0x350293){return _0x350293[_0x6c94('0x24')](_0x20668a)['then'](function(_0x12e97e){return _0x12e97e;});}return null;};}function removeEntity(_0x57cacb,_0x4b9eb4){return function(_0x32749e){if(_0x32749e){return _0x32749e['destroy']()['then'](function(){_0x57cacb['status'](0xcc)[_0x6c94('0x1c')]();});}};}function handleEntityNotFound(_0x3447c8,_0x3acc4e){return function(_0x293bff){if(!_0x293bff){_0x3447c8[_0x6c94('0x25')](0x194);}return _0x293bff;};}function handleError(_0x385814,_0x59bb58){_0x59bb58=_0x59bb58||0x1f4;return function(_0x4ab289){logger[_0x6c94('0x26')](_0x4ab289[_0x6c94('0x27')]);if(_0x4ab289[_0x6c94('0x28')]){delete _0x4ab289[_0x6c94('0x28')];}_0x385814[_0x6c94('0x1b')](_0x59bb58)[_0x6c94('0x29')](_0x4ab289);};}exports[_0x6c94('0x2a')]=function(_0x52657d,_0x3bfc07){var _0x40f7ea={},_0x2ea1d4={},_0x4bc0a4={'count':0x0,'rows':[]};var _0x238299=_[_0x6c94('0x2b')](db[_0x6c94('0x2c')][_0x6c94('0x2d')],function(_0x1c877a){return{'name':_0x1c877a[_0x6c94('0x2e')],'type':_0x1c877a[_0x6c94('0x2f')]['key']};});_0x2ea1d4[_0x6c94('0x30')]=_[_0x6c94('0x2b')](_0x238299,_0x6c94('0x28'));_0x2ea1d4['query']=_[_0x6c94('0x31')](_0x52657d['query']);_0x2ea1d4[_0x6c94('0x32')]=_[_0x6c94('0x33')](_0x2ea1d4['model'],_0x2ea1d4[_0x6c94('0x34')]);_0x40f7ea[_0x6c94('0x35')]=_[_0x6c94('0x33')](_0x2ea1d4['model'],qs[_0x6c94('0x36')](_0x52657d['query'][_0x6c94('0x36')]));_0x40f7ea[_0x6c94('0x35')]=_0x40f7ea[_0x6c94('0x35')][_0x6c94('0x37')]?_0x40f7ea[_0x6c94('0x35')]:_0x2ea1d4['model'];if(!_0x52657d[_0x6c94('0x34')]['hasOwnProperty'](_0x6c94('0x38'))){_0x40f7ea[_0x6c94('0x39')]=qs['limit'](_0x52657d[_0x6c94('0x34')][_0x6c94('0x39')]);_0x40f7ea['offset']=qs[_0x6c94('0x1e')](_0x52657d[_0x6c94('0x34')][_0x6c94('0x1e')]);}_0x40f7ea['order']=qs[_0x6c94('0x3a')](_0x52657d[_0x6c94('0x34')][_0x6c94('0x3a')]);_0x40f7ea[_0x6c94('0x3b')]=qs[_0x6c94('0x32')](_[_0x6c94('0x3c')](_0x52657d[_0x6c94('0x34')],_0x2ea1d4['filters']),_0x238299);if(_0x52657d[_0x6c94('0x34')][_0x6c94('0x3d')]){_0x40f7ea[_0x6c94('0x3b')]=_[_0x6c94('0x3e')](_0x40f7ea[_0x6c94('0x3b')],{'$or':_[_0x6c94('0x2b')](_0x238299,function(_0x2a2e51){if(_0x2a2e51[_0x6c94('0x2f')]!=='VIRTUAL'){var _0x588b81={};_0x588b81[_0x2a2e51[_0x6c94('0x28')]]={'$like':'%'+_0x52657d[_0x6c94('0x34')][_0x6c94('0x3d')]+'%'};return _0x588b81;}})});}_0x40f7ea=_[_0x6c94('0x3e')]({},_0x40f7ea,_0x52657d[_0x6c94('0x3f')]);var _0x2706b6={'where':_0x40f7ea[_0x6c94('0x3b')]};return db['DeskAccount'][_0x6c94('0x20')](_0x2706b6)[_0x6c94('0x40')](function(_0xebc736){_0x4bc0a4[_0x6c94('0x20')]=_0xebc736;if(_0x52657d['query']['includeAll']){_0x40f7ea[_0x6c94('0x41')]=[{'all':!![]}];}return db['DeskAccount'][_0x6c94('0x42')](_0x40f7ea);})[_0x6c94('0x40')](function(_0x5a08f){_0x4bc0a4[_0x6c94('0x43')]=_0x5a08f;return _0x4bc0a4;})[_0x6c94('0x40')](respondWithFilteredResult(_0x3bfc07,_0x40f7ea))[_0x6c94('0x44')](handleError(_0x3bfc07,null));};exports['show']=function(_0x55d4da,_0x51431e){var _0x23ff3d={'raw':![],'where':{'id':_0x55d4da[_0x6c94('0x45')]['id']}},_0xcef414={};_0xcef414['model']=_[_0x6c94('0x31')](db[_0x6c94('0x2c')]['rawAttributes']);_0xcef414[_0x6c94('0x34')]=_[_0x6c94('0x31')](_0x55d4da['query']);_0xcef414['filters']=_[_0x6c94('0x33')](_0xcef414['model'],_0xcef414[_0x6c94('0x34')]);_0x23ff3d['attributes']=_[_0x6c94('0x33')](_0xcef414['model'],qs['fields'](_0x55d4da[_0x6c94('0x34')]['fields']));_0x23ff3d[_0x6c94('0x35')]=_0x23ff3d[_0x6c94('0x35')][_0x6c94('0x37')]?_0x23ff3d[_0x6c94('0x35')]:_0xcef414['model'];if(_0x55d4da[_0x6c94('0x34')][_0x6c94('0x46')]){_0x23ff3d[_0x6c94('0x41')]=[{'all':!![]}];}_0x23ff3d=_[_0x6c94('0x3e')]({},_0x23ff3d,_0x55d4da['options']);return db[_0x6c94('0x2c')][_0x6c94('0x47')](_0x23ff3d)[_0x6c94('0x40')](handleEntityNotFound(_0x51431e,null))[_0x6c94('0x40')](respondWithResult(_0x51431e,null))['catch'](handleError(_0x51431e,null));};exports[_0x6c94('0x48')]=function(_0x1bde31,_0x570462){return db[_0x6c94('0x2c')][_0x6c94('0x48')](_0x1bde31['body'],{})['then'](respondWithResult(_0x570462,0xc9))['catch'](handleError(_0x570462,null));};exports['update']=function(_0x5907e3,_0x2ae0b8){if(_0x5907e3[_0x6c94('0x49')]['id']){delete _0x5907e3[_0x6c94('0x49')]['id'];}return db[_0x6c94('0x2c')][_0x6c94('0x47')]({'where':{'id':_0x5907e3[_0x6c94('0x45')]['id']}})['then'](handleEntityNotFound(_0x2ae0b8,null))[_0x6c94('0x40')](saveUpdates(_0x5907e3[_0x6c94('0x49')],null))[_0x6c94('0x40')](respondWithResult(_0x2ae0b8,null))[_0x6c94('0x44')](handleError(_0x2ae0b8,null));};exports['destroy']=function(_0xecbfdf,_0xf9b6b8){return db[_0x6c94('0x2c')][_0x6c94('0x47')]({'where':{'id':_0xecbfdf[_0x6c94('0x45')]['id']}})[_0x6c94('0x40')](handleEntityNotFound(_0xf9b6b8,null))[_0x6c94('0x40')](removeEntity(_0xf9b6b8,null))['catch'](handleError(_0xf9b6b8,null));};exports[_0x6c94('0x4a')]=function(_0x230a8b,_0x5d08ec,_0x1be8ee){var _0x28eb94={};var _0x39713c={};var _0x41b6a4;var _0x43bf89;return db['DeskAccount'][_0x6c94('0x4b')]({'where':{'id':_0x230a8b[_0x6c94('0x45')]['id']}})[_0x6c94('0x40')](handleEntityNotFound(_0x5d08ec,null))[_0x6c94('0x40')](function(_0x511346){if(_0x511346){_0x41b6a4=_0x511346;_0x39713c[_0x6c94('0x30')]=_['keys'](db['DeskConfiguration'][_0x6c94('0x2d')]);_0x39713c['query']=_[_0x6c94('0x31')](_0x230a8b['query']);_0x39713c[_0x6c94('0x32')]=_[_0x6c94('0x33')](_0x39713c[_0x6c94('0x30')],_0x39713c[_0x6c94('0x34')]);_0x28eb94[_0x6c94('0x35')]=_['intersection'](_0x39713c[_0x6c94('0x30')],qs[_0x6c94('0x36')](_0x230a8b['query'][_0x6c94('0x36')]));_0x28eb94[_0x6c94('0x35')]=_0x28eb94[_0x6c94('0x35')][_0x6c94('0x37')]?_0x28eb94['attributes']:_0x39713c[_0x6c94('0x30')];_0x28eb94[_0x6c94('0x4c')]=qs[_0x6c94('0x3a')](_0x230a8b['query']['sort']);_0x28eb94[_0x6c94('0x3b')]=qs['filters'](_[_0x6c94('0x3c')](_0x230a8b['query'],_0x39713c['filters']));if(_0x230a8b[_0x6c94('0x34')]['filter']){_0x28eb94[_0x6c94('0x3b')]=_[_0x6c94('0x3e')](_0x28eb94[_0x6c94('0x3b')],{'$or':_[_0x6c94('0x2b')](_0x28eb94[_0x6c94('0x35')],function(_0x56d5c){var _0x4ca388={};_0x4ca388[_0x56d5c]={'$like':'%'+_0x230a8b[_0x6c94('0x34')][_0x6c94('0x3d')]+'%'};return _0x4ca388;})});}_0x28eb94=_['merge']({},_0x28eb94,_0x230a8b[_0x6c94('0x3f')]);return _0x41b6a4[_0x6c94('0x4a')](_0x28eb94);}})['then'](function(_0x37b1cd){if(_0x37b1cd){_0x43bf89=_0x37b1cd[_0x6c94('0x37')];if(!_0x230a8b[_0x6c94('0x34')][_0x6c94('0x4d')](_0x6c94('0x38'))){_0x28eb94[_0x6c94('0x39')]=qs[_0x6c94('0x39')](_0x230a8b['query'][_0x6c94('0x39')]);_0x28eb94[_0x6c94('0x1e')]=qs[_0x6c94('0x1e')](_0x230a8b[_0x6c94('0x34')][_0x6c94('0x1e')]);}return _0x41b6a4[_0x6c94('0x4a')](_0x28eb94);}})['then'](function(_0x506f8e){if(_0x506f8e){return _0x506f8e?{'count':_0x43bf89,'rows':_0x506f8e}:null;}})[_0x6c94('0x40')](respondWithResult(_0x5d08ec,null))['catch'](handleError(_0x5d08ec,null));};exports[_0x6c94('0x4e')]=function(_0x26e989,_0x9ba9f5,_0x4b8638){if(_0x26e989[_0x6c94('0x49')]['id']){delete _0x26e989[_0x6c94('0x49')]['id'];}return db[_0x6c94('0x2c')][_0x6c94('0x4b')]({'where':{'id':_0x26e989['params']['id']}})[_0x6c94('0x40')](handleEntityNotFound(_0x9ba9f5,null))[_0x6c94('0x40')](function(_0x38164a){if(_0x38164a){_0x26e989[_0x6c94('0x49')][_0x6c94('0x4f')]=_0x38164a['id'];_0x26e989[_0x6c94('0x49')]['Subjects']=integrations[_0x6c94('0x50')](_0x26e989['body'][_0x6c94('0x51')],_0x26e989[_0x6c94('0x49')][_0x6c94('0x2f')]);_0x26e989[_0x6c94('0x49')][_0x6c94('0x52')]=integrations[_0x6c94('0x53')](_0x26e989[_0x6c94('0x49')][_0x6c94('0x51')],_0x26e989[_0x6c94('0x49')]['type']);return db[_0x6c94('0x54')][_0x6c94('0x48')](_0x26e989['body'],{'include':[{'model':db['DeskField'],'as':_0x6c94('0x55')},{'model':db[_0x6c94('0x56')],'as':'Descriptions'}]});}return null;})[_0x6c94('0x40')](respondWithResult(_0x9ba9f5,null))['catch'](handleError(_0x9ba9f5,null));};exports['getFields']=function(_0x1dbb68,_0x51f8fb,_0x2eec76){var _0x527c3c=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2a83cd='';return db[_0x6c94('0x2c')][_0x6c94('0x4b')]({'where':{'id':_0x1dbb68[_0x6c94('0x45')]['id']},'attributes':['id',_0x6c94('0x57'),_0x6c94('0x58'),_0x6c94('0x59'),_0x6c94('0x5a'),_0x6c94('0x5b'),_0x6c94('0x5c'),'token',_0x6c94('0x5d')]})[_0x6c94('0x40')](handleEntityNotFound(_0x51f8fb,null))[_0x6c94('0x40')](function(_0x463d8c){if(_0x463d8c){_0x2a83cd=_0x463d8c[_0x6c94('0x57')];var _0x520de9=_0x2a83cd['slice'](-0x1);if(_0x520de9==='/'){_0x2a83cd=_0x2a83cd[_0x6c94('0x5e')](0x0,_0x2a83cd[_0x6c94('0x5f')](_0x520de9));}var _0x16e5af={'method':_0x6c94('0x60'),'uri':util[_0x6c94('0x61')](_0x6c94('0x62'),_0x2a83cd),'headers':{'Content-Type':_0x6c94('0x63'),'Accept':_0x6c94('0x63')},'json':!![]};if(_0x463d8c['authType']===_0x6c94('0x64')){_0x16e5af[_0x6c94('0x65')][_0x6c94('0x66')]=util[_0x6c94('0x61')](_0x6c94('0x67'),new Buffer(util[_0x6c94('0x61')](_0x6c94('0x68'),_0x463d8c[_0x6c94('0x59')],_0x463d8c[_0x6c94('0x5a')]))[_0x6c94('0x69')](_0x6c94('0x6a')));}return rp(_0x16e5af)[_0x6c94('0x40')](function(_0x73765){return _0x527c3c[_0x6c94('0x6b')](_['map'](_0x73765['_embedded'][_0x6c94('0x6c')],function(_0x2833d7){return{'id':_0x2833d7[_0x6c94('0x28')],'name':_0x2833d7[_0x6c94('0x28')],'type':_0x2833d7[_0x6c94('0x2f')],'active':_0x2833d7[_0x6c94('0x6d')],'label':_0x2833d7[_0x6c94('0x6e')],'custom':!![]};}));});}})[_0x6c94('0x40')](function(_0x471bc9){return{'count':_0x471bc9[_0x6c94('0x37')],'rows':_0x471bc9};})[_0x6c94('0x40')](respondWithResult(_0x51f8fb,null))[_0x6c94('0x44')](function(_0x43cd4b){var _0x6f2905=_0x1dbb68['query'][_0x6c94('0x6f')]?0x1f4:_0x43cd4b[_0x6c94('0x70')]||0x1f4;logger[_0x6c94('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x6c94('0x71'),_0x6f2905,JSON[_0x6c94('0x72')](_0x43cd4b));delete _0x43cd4b[_0x6c94('0x28')];if(_0x6f2905===0x191){_0x6f2905=0x190;}_0x51f8fb['status'](_0x6f2905)[_0x6c94('0x29')](_0x1dbb68[_0x6c94('0x34')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x43cd4b['statusCode']}:_0x43cd4b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 3915499..2dd907a 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 _0xc15c=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','util'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0xc15c,0x110));var _0xcc15=function(_0x54e5ae,_0x371b98){_0x54e5ae=_0x54e5ae-0x0;var _0x4f60db=_0xc15c[_0x54e5ae];return _0x4f60db;};'use strict';var _=require('lodash');var util=require(_0xcc15('0x0'));var logger=require(_0xcc15('0x1'))(_0xcc15('0x2'));var moment=require(_0xcc15('0x3'));var BPromise=require(_0xcc15('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc15('0x5'));var rimraf=require(_0xcc15('0x6'));var config=require(_0xcc15('0x7'));var attributes=require(_0xcc15('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xcc15('0x9')]=function(_0x2ea668,_0x474d25){return _0x2ea668[_0xcc15('0xa')](_0xcc15('0xb'),attributes,{'tableName':_0xcc15('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x446f=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3c6310,_0x13601d){var _0x320122=function(_0x596176){while(--_0x596176){_0x3c6310['push'](_0x3c6310['shift']());}};_0x320122(++_0x13601d);}(_0x446f,0x84));var _0xf446=function(_0x4b77c8,_0x32a7ad){_0x4b77c8=_0x4b77c8-0x0;var _0xee40a7=_0x446f[_0x4b77c8];return _0xee40a7;};'use strict';var _=require(_0xf446('0x0'));var util=require(_0xf446('0x1'));var logger=require(_0xf446('0x2'))(_0xf446('0x3'));var moment=require(_0xf446('0x4'));var BPromise=require(_0xf446('0x5'));var rp=require(_0xf446('0x6'));var fs=require('fs');var path=require(_0xf446('0x7'));var rimraf=require(_0xf446('0x8'));var config=require(_0xf446('0x9'));var attributes=require(_0xf446('0xa'));var integrations=require(_0xf446('0xb'));module['exports']=function(_0x410426,_0x342bad){return _0x410426[_0xf446('0xc')](_0xf446('0xd'),attributes,{'tableName':'int_desk_accounts','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 f121e5b..a4f1665 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 _0x7ef4=['debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s'];(function(_0x1385d9,_0x44d41a){var _0x4e1c1e=function(_0xe9cf16){while(--_0xe9cf16){_0x1385d9['push'](_0x1385d9['shift']());}};_0x4e1c1e(++_0x44d41a);}(_0x7ef4,0xe1));var _0x47ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7ef4[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x47ef('0x0'));var util=require(_0x47ef('0x1'));var moment=require(_0x47ef('0x2'));var BPromise=require('bluebird');var rs=require(_0x47ef('0x3'));var fs=require('fs');var Redis=require(_0x47ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47ef('0x5'));var logger=require('../../config/logger')(_0x47ef('0x6'));var config=require('../../config/environment');var jayson=require(_0x47ef('0x7'));var client=jayson['client'][_0x47ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6e5ae8,_0xd1ab0a,_0x4bf1eb){return new BPromise(function(_0x481660,_0x5cff5f){return client[_0x47ef('0x9')](_0x6e5ae8,_0x4bf1eb)[_0x47ef('0xa')](function(_0x316d9e){logger[_0x47ef('0xb')](_0x47ef('0xc'),_0xd1ab0a,'request\x20sent');logger[_0x47ef('0xd')](_0x47ef('0xe'),_0xd1ab0a,_0x47ef('0xf'),JSON[_0x47ef('0x10')](_0x316d9e));if(_0x316d9e[_0x47ef('0x11')]){if(_0x316d9e[_0x47ef('0x11')]['code']===0x1f4){logger[_0x47ef('0x11')](_0x47ef('0xc'),_0xd1ab0a,_0x316d9e[_0x47ef('0x11')][_0x47ef('0x12')]);return _0x5cff5f(_0x316d9e[_0x47ef('0x11')][_0x47ef('0x12')]);}logger[_0x47ef('0x11')](_0x47ef('0xc'),_0xd1ab0a,_0x316d9e[_0x47ef('0x11')][_0x47ef('0x12')]);return _0x481660(_0x316d9e['error'][_0x47ef('0x12')]);}else{logger['info'](_0x47ef('0xc'),_0xd1ab0a,_0x47ef('0xf'));_0x481660(_0x316d9e[_0x47ef('0x13')][_0x47ef('0x12')]);}})[_0x47ef('0x14')](function(_0x32e07f){logger[_0x47ef('0x11')]('DeskAccount,\x20%s,\x20%s',_0xd1ab0a,_0x32e07f);_0x5cff5f(_0x32e07f);});});}exports['GetDeskAccount']=function(_0x465bec){var _0x5406a3=this;return new Promise(function(_0x3d3043,_0x2dc891){return db[_0x47ef('0x15')][_0x47ef('0x16')]({'raw':_0x465bec[_0x47ef('0x17')]?_0x465bec[_0x47ef('0x17')][_0x47ef('0x18')]===undefined?!![]:![]:!![],'where':_0x465bec['options']?_0x465bec['options'][_0x47ef('0x19')]||null:null,'attributes':_0x465bec['options']?_0x465bec['options'][_0x47ef('0x1a')]||null:null,'limit':_0x465bec['options']?_0x465bec['options'][_0x47ef('0x1b')]||null:null,'include':_0x465bec[_0x47ef('0x17')]?_0x465bec['options'][_0x47ef('0x1c')]?_[_0x47ef('0x1d')](_0x465bec[_0x47ef('0x17')]['include'],function(_0x102e9a){return{'model':db[_0x102e9a[_0x47ef('0x1e')]],'as':_0x102e9a['as'],'attributes':_0x102e9a[_0x47ef('0x1a')],'include':_0x102e9a[_0x47ef('0x1c')]?_[_0x47ef('0x1d')](_0x102e9a['include'],function(_0x4c4b06){return{'model':db[_0x4c4b06[_0x47ef('0x1e')]],'as':_0x4c4b06['as'],'attributes':_0x4c4b06[_0x47ef('0x1a')],'include':_0x4c4b06[_0x47ef('0x1c')]?_[_0x47ef('0x1d')](_0x4c4b06['include'],function(_0x43ee40){return{'model':db[_0x43ee40[_0x47ef('0x1e')]],'as':_0x43ee40['as'],'attributes':_0x43ee40[_0x47ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47ef('0xa')](function(_0x34424f){logger[_0x47ef('0xb')](_0x47ef('0x1f'),_0x465bec);logger['debug'](_0x47ef('0x1f'),_0x465bec,JSON[_0x47ef('0x10')](_0x34424f));_0x3d3043(_0x34424f);})[_0x47ef('0x14')](function(_0x30fec9){logger['error']('GetDeskAccount',_0x30fec9[_0x47ef('0x12')],_0x465bec);_0x2dc891(_0x5406a3[_0x47ef('0x11')](0x1f4,_0x30fec9['message']));});});};exports[_0x47ef('0x20')]=function(_0x1780c4){var _0x47d25a=this;return new Promise(function(_0x2fdc2a,_0x58f28f){return db[_0x47ef('0x15')][_0x47ef('0x21')]({'raw':_0x1780c4[_0x47ef('0x17')]?_0x1780c4[_0x47ef('0x17')][_0x47ef('0x18')]===undefined?!![]:![]:!![],'where':_0x1780c4['options']?_0x1780c4['options'][_0x47ef('0x19')]||null:null,'attributes':_0x1780c4[_0x47ef('0x17')]?_0x1780c4[_0x47ef('0x17')]['attributes']||null:null,'include':_0x1780c4[_0x47ef('0x17')]?_0x1780c4[_0x47ef('0x17')][_0x47ef('0x1c')]?_['map'](_0x1780c4['options'][_0x47ef('0x1c')],function(_0x38f764){return{'model':db[_0x38f764[_0x47ef('0x1e')]],'as':_0x38f764['as'],'attributes':_0x38f764['attributes'],'include':_0x38f764[_0x47ef('0x1c')]?_['map'](_0x38f764[_0x47ef('0x1c')],function(_0x50e27d){return{'model':db[_0x50e27d[_0x47ef('0x1e')]],'as':_0x50e27d['as'],'attributes':_0x50e27d['attributes'],'include':_0x50e27d[_0x47ef('0x1c')]?_[_0x47ef('0x1d')](_0x50e27d[_0x47ef('0x1c')],function(_0x9b54e1){return{'model':db[_0x9b54e1[_0x47ef('0x1e')]],'as':_0x9b54e1['as'],'attributes':_0x9b54e1[_0x47ef('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47ef('0xa')](function(_0x50da3d){logger[_0x47ef('0xb')](_0x47ef('0x20'),_0x1780c4);logger[_0x47ef('0xd')](_0x47ef('0x20'),_0x1780c4,JSON[_0x47ef('0x10')](_0x50da3d));_0x2fdc2a(_0x50da3d);})[_0x47ef('0x14')](function(_0x538d90){logger[_0x47ef('0x11')]('ShowDeskAccount',_0x538d90['message'],_0x1780c4);_0x58f28f(_0x47d25a[_0x47ef('0x11')](0x1f4,_0x538d90['message']));});});}; \ No newline at end of file +var _0x74d0=['catch','DeskAccount','findAll','options','raw','where','attributes','include','map','model','GetDeskAccount','ShowDeskAccount','find','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x3b0037,_0xb9e081){var _0x23ce2a=function(_0x10c5ec){while(--_0x10c5ec){_0x3b0037['push'](_0x3b0037['shift']());}};_0x23ce2a(++_0xb9e081);}(_0x74d0,0x1e9));var _0x074d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x74d0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x074d('0x0'));var util=require('util');var moment=require(_0x074d('0x1'));var BPromise=require(_0x074d('0x2'));var rs=require(_0x074d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x074d('0x4'))(_0x074d('0x5'));var config=require(_0x074d('0x6'));var jayson=require(_0x074d('0x7'));var client=jayson[_0x074d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d779a,_0x14b9d5,_0xdcb34){return new BPromise(function(_0x17cd6e,_0x4d7b6d){return client[_0x074d('0x9')](_0x2d779a,_0xdcb34)[_0x074d('0xa')](function(_0x1ca975){logger[_0x074d('0xb')](_0x074d('0xc'),_0x14b9d5,_0x074d('0xd'));logger[_0x074d('0xe')](_0x074d('0xf'),_0x14b9d5,_0x074d('0xd'),JSON[_0x074d('0x10')](_0x1ca975));if(_0x1ca975['error']){if(_0x1ca975['error'][_0x074d('0x11')]===0x1f4){logger[_0x074d('0x12')]('DeskAccount,\x20%s,\x20%s',_0x14b9d5,_0x1ca975[_0x074d('0x12')][_0x074d('0x13')]);return _0x4d7b6d(_0x1ca975['error']['message']);}logger[_0x074d('0x12')]('DeskAccount,\x20%s,\x20%s',_0x14b9d5,_0x1ca975[_0x074d('0x12')][_0x074d('0x13')]);return _0x17cd6e(_0x1ca975['error']['message']);}else{logger[_0x074d('0xb')](_0x074d('0xc'),_0x14b9d5,_0x074d('0xd'));_0x17cd6e(_0x1ca975[_0x074d('0x14')][_0x074d('0x13')]);}})[_0x074d('0x15')](function(_0x1dc017){logger[_0x074d('0x12')](_0x074d('0xc'),_0x14b9d5,_0x1dc017);_0x4d7b6d(_0x1dc017);});});}exports['GetDeskAccount']=function(_0x535151){var _0x266341=this;return new Promise(function(_0x40ce2d,_0x403dd9){return db[_0x074d('0x16')][_0x074d('0x17')]({'raw':_0x535151[_0x074d('0x18')]?_0x535151[_0x074d('0x18')][_0x074d('0x19')]===undefined?!![]:![]:!![],'where':_0x535151['options']?_0x535151[_0x074d('0x18')][_0x074d('0x1a')]||null:null,'attributes':_0x535151['options']?_0x535151[_0x074d('0x18')][_0x074d('0x1b')]||null:null,'limit':_0x535151[_0x074d('0x18')]?_0x535151['options']['limit']||null:null,'include':_0x535151['options']?_0x535151[_0x074d('0x18')][_0x074d('0x1c')]?_[_0x074d('0x1d')](_0x535151[_0x074d('0x18')]['include'],function(_0x2af518){return{'model':db[_0x2af518[_0x074d('0x1e')]],'as':_0x2af518['as'],'attributes':_0x2af518[_0x074d('0x1b')],'include':_0x2af518['include']?_['map'](_0x2af518[_0x074d('0x1c')],function(_0x1e17c9){return{'model':db[_0x1e17c9[_0x074d('0x1e')]],'as':_0x1e17c9['as'],'attributes':_0x1e17c9[_0x074d('0x1b')],'include':_0x1e17c9['include']?_['map'](_0x1e17c9['include'],function(_0xb8a04e){return{'model':db[_0xb8a04e[_0x074d('0x1e')]],'as':_0xb8a04e['as'],'attributes':_0xb8a04e[_0x074d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x074d('0xa')](function(_0x180882){logger[_0x074d('0xb')](_0x074d('0x1f'),_0x535151);logger['debug'](_0x074d('0x1f'),_0x535151,JSON[_0x074d('0x10')](_0x180882));_0x40ce2d(_0x180882);})['catch'](function(_0x17cbf3){logger[_0x074d('0x12')]('GetDeskAccount',_0x17cbf3['message'],_0x535151);_0x403dd9(_0x266341[_0x074d('0x12')](0x1f4,_0x17cbf3[_0x074d('0x13')]));});});};exports[_0x074d('0x20')]=function(_0x5c4da3){var _0x181f9b=this;return new Promise(function(_0x4d3b12,_0x10f7fb){return db[_0x074d('0x16')][_0x074d('0x21')]({'raw':_0x5c4da3[_0x074d('0x18')]?_0x5c4da3['options'][_0x074d('0x19')]===undefined?!![]:![]:!![],'where':_0x5c4da3[_0x074d('0x18')]?_0x5c4da3['options'][_0x074d('0x1a')]||null:null,'attributes':_0x5c4da3[_0x074d('0x18')]?_0x5c4da3[_0x074d('0x18')]['attributes']||null:null,'include':_0x5c4da3['options']?_0x5c4da3[_0x074d('0x18')][_0x074d('0x1c')]?_[_0x074d('0x1d')](_0x5c4da3['options']['include'],function(_0x4cd779){return{'model':db[_0x4cd779[_0x074d('0x1e')]],'as':_0x4cd779['as'],'attributes':_0x4cd779[_0x074d('0x1b')],'include':_0x4cd779[_0x074d('0x1c')]?_['map'](_0x4cd779[_0x074d('0x1c')],function(_0x5edb1b){return{'model':db[_0x5edb1b[_0x074d('0x1e')]],'as':_0x5edb1b['as'],'attributes':_0x5edb1b[_0x074d('0x1b')],'include':_0x5edb1b['include']?_[_0x074d('0x1d')](_0x5edb1b['include'],function(_0x589002){return{'model':db[_0x589002[_0x074d('0x1e')]],'as':_0x589002['as'],'attributes':_0x589002[_0x074d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x158759){logger[_0x074d('0xb')](_0x074d('0x20'),_0x5c4da3);logger[_0x074d('0xe')](_0x074d('0x20'),_0x5c4da3,JSON['stringify'](_0x158759));_0x4d3b12(_0x158759);})[_0x074d('0x15')](function(_0x1c2de9){logger['error'](_0x074d('0x20'),_0x1c2de9[_0x074d('0x13')],_0x5c4da3);_0x10f7fb(_0x181f9b[_0x074d('0x12')](0x1f4,_0x1c2de9[_0x074d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 75880cd..5cc2f94 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(_0x49b4b1,_0x2b38c1){var _0x51bd88=function(_0x1beede){while(--_0x1beede){_0x49b4b1['push'](_0x49b4b1['shift']());}};_0x51bd88(++_0x2b38c1);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x28e4ea,_0xa46c7){var _0x50c6ca=function(_0x5de4d6){while(--_0x5de4d6){_0x28e4ea['push'](_0x28e4ea['shift']());}};_0x50c6ca(++_0xa46c7);}(_0xedd9,0xfc));var _0x9edd=function(_0x422e50,_0x225a37){_0x422e50=_0x422e50-0x0;var _0x1fcd12=_0xedd9[_0x422e50];return _0x1fcd12;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index ba80d9b..b4a72aa 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 _0x4df7=['exports','STRING','sequelize'];(function(_0x441221,_0x6fa798){var _0x3b9fe7=function(_0x1defd5){while(--_0x1defd5){_0x441221['push'](_0x441221['shift']());}};_0x3b9fe7(++_0x6fa798);}(_0x4df7,0x107));var _0x74df=function(_0x3751cb,_0x5bddef){_0x3751cb=_0x3751cb-0x0;var _0x1d1f83=_0x4df7[_0x3751cb];return _0x1d1f83;};'use strict';var Sequelize=require(_0x74df('0x0'));module[_0x74df('0x1')]={'name':{'type':Sequelize[_0x74df('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1784=['exports','STRING'];(function(_0x9d0b59,_0x4e715c){var _0x4015b0=function(_0x2f4f0c){while(--_0x2f4f0c){_0x9d0b59['push'](_0x9d0b59['shift']());}};_0x4015b0(++_0x4e715c);}(_0x1784,0x72));var _0x4178=function(_0x186591,_0x41385c){_0x186591=_0x186591-0x0;var _0x54d42d=_0x1784[_0x186591];return _0x54d42d;};'use strict';var Sequelize=require('sequelize');module[_0x4178('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4178('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 90b94c4..e7f9dec 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 _0x54d5=['send','index','DeskConfiguration','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','create','update','getFields','DeskField','order','map','getSubjects','findOne','hasOwnProperty','getDescriptions','getTags','setTags','body','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','then','destroy','stack','name'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x54d5,0x179));var _0x554d=function(_0x415f81,_0x5422ff){_0x415f81=_0x415f81-0x0;var _0x518fa8=_0x54d5[_0x415f81];return _0x518fa8;};'use strict';var emlformat=require(_0x554d('0x0'));var rimraf=require(_0x554d('0x1'));var zipdir=require(_0x554d('0x2'));var jsonpatch=require(_0x554d('0x3'));var rp=require(_0x554d('0x4'));var moment=require(_0x554d('0x5'));var BPromise=require(_0x554d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x554d('0x7'));var sox=require(_0x554d('0x8'));var csv=require(_0x554d('0x9'));var ejs=require(_0x554d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x554d('0xb'));var crypto=require('crypto');var jsforce=require(_0x554d('0xc'));var deskjs=require(_0x554d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x554d('0xe'));var Papa=require(_0x554d('0xf'));var Redis=require(_0x554d('0x10'));var authService=require(_0x554d('0x11'));var qs=require(_0x554d('0x12'));var as=require(_0x554d('0x13'));var hardwareService=require(_0x554d('0x14'));var logger=require(_0x554d('0x15'))(_0x554d('0x16'));var utils=require(_0x554d('0x17'));var config=require(_0x554d('0x18'));var licenseUtil=require(_0x554d('0x19'));var db=require(_0x554d('0x1a'))['db'];function respondWithStatusCode(_0x24733d,_0x4b5e48){_0x4b5e48=_0x4b5e48||0xcc;return function(_0x205771){if(_0x205771){return _0x24733d[_0x554d('0x1b')](_0x4b5e48);}return _0x24733d['status'](_0x4b5e48)[_0x554d('0x1c')]();};}function respondWithResult(_0x91bf8b,_0x115ee9){_0x115ee9=_0x115ee9||0xc8;return function(_0x14a1d8){if(_0x14a1d8){return _0x91bf8b[_0x554d('0x1d')](_0x115ee9)['json'](_0x14a1d8);}};}function respondWithFilteredResult(_0x36de1e,_0x38e4dd){return function(_0x448629){if(_0x448629){var _0x105eb7=typeof _0x38e4dd[_0x554d('0x1e')]==='undefined'&&typeof _0x38e4dd['limit']===_0x554d('0x1f');var _0x4225c6=_0x448629[_0x554d('0x20')];var _0x1096f3=_0x105eb7?0x0:_0x38e4dd['offset'];var _0x4b3412=_0x105eb7?_0x448629[_0x554d('0x20')]:_0x38e4dd['offset']+_0x38e4dd[_0x554d('0x21')];var _0x272d9d;if(_0x4b3412>=_0x4225c6){_0x4b3412=_0x4225c6;_0x272d9d=0xc8;}else{_0x272d9d=0xce;}_0x36de1e[_0x554d('0x1d')](_0x272d9d);return _0x36de1e['set'](_0x554d('0x22'),_0x1096f3+'-'+_0x4b3412+'/'+_0x4225c6)[_0x554d('0x23')](_0x448629);}return null;};}function patchUpdates(_0x2e8ed1){return function(_0x4a8741){try{jsonpatch[_0x554d('0x24')](_0x4a8741,_0x2e8ed1,!![]);}catch(_0x5e42bc){return BPromise[_0x554d('0x25')](_0x5e42bc);}return _0x4a8741[_0x554d('0x26')]();};}function saveUpdates(_0x9de384,_0x108d0b){return function(_0x17f077){if(_0x17f077){return _0x17f077['update'](_0x9de384)[_0x554d('0x27')](function(_0x25ffc0){return _0x25ffc0;});}return null;};}function removeEntity(_0x3e2a2c,_0x1b1cd2){return function(_0x1d4ccf){if(_0x1d4ccf){return _0x1d4ccf[_0x554d('0x28')]()[_0x554d('0x27')](function(){_0x3e2a2c['status'](0xcc)[_0x554d('0x1c')]();});}};}function handleEntityNotFound(_0x29a621,_0x12dcec){return function(_0x1df6ad){if(!_0x1df6ad){_0x29a621[_0x554d('0x1b')](0x194);}return _0x1df6ad;};}function handleError(_0x8c2799,_0x54ecdb){_0x54ecdb=_0x54ecdb||0x1f4;return function(_0x245fc6){logger['error'](_0x245fc6[_0x554d('0x29')]);if(_0x245fc6[_0x554d('0x2a')]){delete _0x245fc6['name'];}_0x8c2799[_0x554d('0x1d')](_0x54ecdb)[_0x554d('0x2b')](_0x245fc6);};}exports[_0x554d('0x2c')]=function(_0x1c2544,_0x30d674){var _0x41669e={},_0x4501c3={},_0x11b28c={'count':0x0,'rows':[]};var _0x337ff3=_['map'](db[_0x554d('0x2d')]['rawAttributes'],function(_0x89bac7){return{'name':_0x89bac7[_0x554d('0x2e')],'type':_0x89bac7[_0x554d('0x2f')]['key']};});_0x4501c3[_0x554d('0x30')]=_['map'](_0x337ff3,_0x554d('0x2a'));_0x4501c3[_0x554d('0x31')]=_[_0x554d('0x32')](_0x1c2544[_0x554d('0x31')]);_0x4501c3['filters']=_[_0x554d('0x33')](_0x4501c3['model'],_0x4501c3[_0x554d('0x31')]);_0x41669e[_0x554d('0x34')]=_['intersection'](_0x4501c3[_0x554d('0x30')],qs[_0x554d('0x35')](_0x1c2544[_0x554d('0x31')][_0x554d('0x35')]));_0x41669e[_0x554d('0x34')]=_0x41669e['attributes'][_0x554d('0x36')]?_0x41669e[_0x554d('0x34')]:_0x4501c3['model'];if(!_0x1c2544[_0x554d('0x31')]['hasOwnProperty'](_0x554d('0x37'))){_0x41669e[_0x554d('0x21')]=qs[_0x554d('0x21')](_0x1c2544['query'][_0x554d('0x21')]);_0x41669e[_0x554d('0x1e')]=qs['offset'](_0x1c2544['query'][_0x554d('0x1e')]);}_0x41669e['order']=qs['sort'](_0x1c2544[_0x554d('0x31')][_0x554d('0x38')]);_0x41669e[_0x554d('0x39')]=qs['filters'](_[_0x554d('0x3a')](_0x1c2544[_0x554d('0x31')],_0x4501c3[_0x554d('0x3b')]),_0x337ff3);if(_0x1c2544['query'][_0x554d('0x3c')]){_0x41669e['where']=_[_0x554d('0x3d')](_0x41669e[_0x554d('0x39')],{'$or':_['map'](_0x337ff3,function(_0x3ce4aa){if(_0x3ce4aa[_0x554d('0x2f')]!=='VIRTUAL'){var _0x42bca2={};_0x42bca2[_0x3ce4aa[_0x554d('0x2a')]]={'$like':'%'+_0x1c2544['query'][_0x554d('0x3c')]+'%'};return _0x42bca2;}})});}_0x41669e=_['merge']({},_0x41669e,_0x1c2544['options']);var _0xcb3433={'where':_0x41669e['where']};return db[_0x554d('0x2d')]['count'](_0xcb3433)['then'](function(_0xa97fb0){_0x11b28c[_0x554d('0x20')]=_0xa97fb0;if(_0x1c2544[_0x554d('0x31')][_0x554d('0x3e')]){_0x41669e[_0x554d('0x3f')]=[{'all':!![]}];}return db[_0x554d('0x2d')][_0x554d('0x40')](_0x41669e);})[_0x554d('0x27')](function(_0x4519fe){_0x11b28c[_0x554d('0x41')]=_0x4519fe;return _0x11b28c;})[_0x554d('0x27')](respondWithFilteredResult(_0x30d674,_0x41669e))[_0x554d('0x42')](handleError(_0x30d674,null));};exports['show']=function(_0x3c52d2,_0x30d79c){var _0x36f6f3={'raw':![],'where':{'id':_0x3c52d2[_0x554d('0x43')]['id']}},_0x4d9f0a={};_0x4d9f0a['model']=_[_0x554d('0x32')](db[_0x554d('0x2d')][_0x554d('0x44')]);_0x4d9f0a[_0x554d('0x31')]=_[_0x554d('0x32')](_0x3c52d2[_0x554d('0x31')]);_0x4d9f0a[_0x554d('0x3b')]=_[_0x554d('0x33')](_0x4d9f0a[_0x554d('0x30')],_0x4d9f0a[_0x554d('0x31')]);_0x36f6f3[_0x554d('0x34')]=_[_0x554d('0x33')](_0x4d9f0a[_0x554d('0x30')],qs[_0x554d('0x35')](_0x3c52d2[_0x554d('0x31')][_0x554d('0x35')]));_0x36f6f3[_0x554d('0x34')]=_0x36f6f3[_0x554d('0x34')]['length']?_0x36f6f3[_0x554d('0x34')]:_0x4d9f0a['model'];if(_0x3c52d2[_0x554d('0x31')][_0x554d('0x3e')]){_0x36f6f3[_0x554d('0x3f')]=[{'all':!![]}];}_0x36f6f3=_[_0x554d('0x3d')]({},_0x36f6f3,_0x3c52d2[_0x554d('0x45')]);return db[_0x554d('0x2d')]['find'](_0x36f6f3)[_0x554d('0x27')](handleEntityNotFound(_0x30d79c,null))[_0x554d('0x27')](respondWithResult(_0x30d79c,null))[_0x554d('0x42')](handleError(_0x30d79c,null));};exports[_0x554d('0x46')]=function(_0x44ed12,_0x61faa0){return db[_0x554d('0x2d')][_0x554d('0x46')](_0x44ed12['body'],{})[_0x554d('0x27')](respondWithResult(_0x61faa0,0xc9))['catch'](handleError(_0x61faa0,null));};exports[_0x554d('0x47')]=function(_0x3039ca,_0x33ba83){if(_0x3039ca['body']['id']){delete _0x3039ca['body']['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x3039ca['params']['id']}})[_0x554d('0x27')](handleEntityNotFound(_0x33ba83,null))[_0x554d('0x27')](saveUpdates(_0x3039ca['body'],null))[_0x554d('0x27')](respondWithResult(_0x33ba83,null))[_0x554d('0x42')](handleError(_0x33ba83,null));};exports[_0x554d('0x28')]=function(_0x5d5acc,_0x21a023){return db[_0x554d('0x2d')]['find']({'where':{'id':_0x5d5acc[_0x554d('0x43')]['id']}})['then'](handleEntityNotFound(_0x21a023,null))[_0x554d('0x27')](removeEntity(_0x21a023,null))[_0x554d('0x42')](handleError(_0x21a023,null));};exports[_0x554d('0x48')]=function(_0x176fce,_0x2a62b0,_0x3ebbeb){var _0x3b41ed={};var _0xe0b567={};var _0x5acd20;var _0xc869e4;return db[_0x554d('0x2d')]['findOne']({'where':{'id':_0x176fce[_0x554d('0x43')]['id']}})[_0x554d('0x27')](handleEntityNotFound(_0x2a62b0,null))[_0x554d('0x27')](function(_0x34d50a){if(_0x34d50a){_0x5acd20=_0x34d50a;_0xe0b567[_0x554d('0x30')]=_[_0x554d('0x32')](db[_0x554d('0x49')][_0x554d('0x44')]);_0xe0b567['query']=_[_0x554d('0x32')](_0x176fce[_0x554d('0x31')]);_0xe0b567[_0x554d('0x3b')]=_['intersection'](_0xe0b567['model'],_0xe0b567['query']);_0x3b41ed[_0x554d('0x34')]=_['intersection'](_0xe0b567[_0x554d('0x30')],qs[_0x554d('0x35')](_0x176fce[_0x554d('0x31')][_0x554d('0x35')]));_0x3b41ed['attributes']=_0x3b41ed[_0x554d('0x34')][_0x554d('0x36')]?_0x3b41ed[_0x554d('0x34')]:_0xe0b567[_0x554d('0x30')];_0x3b41ed[_0x554d('0x4a')]=qs[_0x554d('0x38')](_0x176fce['query'][_0x554d('0x38')]);_0x3b41ed[_0x554d('0x39')]=qs['filters'](_[_0x554d('0x3a')](_0x176fce[_0x554d('0x31')],_0xe0b567[_0x554d('0x3b')]));if(_0x176fce[_0x554d('0x31')][_0x554d('0x3c')]){_0x3b41ed[_0x554d('0x39')]=_[_0x554d('0x3d')](_0x3b41ed[_0x554d('0x39')],{'$or':_[_0x554d('0x4b')](_0x3b41ed['attributes'],function(_0x5db218){var _0x3a38ba={};_0x3a38ba[_0x5db218]={'$like':'%'+_0x176fce[_0x554d('0x31')][_0x554d('0x3c')]+'%'};return _0x3a38ba;})});}_0x3b41ed=_[_0x554d('0x3d')]({},_0x3b41ed,_0x176fce[_0x554d('0x45')]);return _0x5acd20[_0x554d('0x48')](_0x3b41ed);}})[_0x554d('0x27')](function(_0x3e1b9a){if(_0x3e1b9a){_0xc869e4=_0x3e1b9a['length'];if(!_0x176fce['query']['hasOwnProperty'](_0x554d('0x37'))){_0x3b41ed[_0x554d('0x21')]=qs[_0x554d('0x21')](_0x176fce[_0x554d('0x31')][_0x554d('0x21')]);_0x3b41ed[_0x554d('0x1e')]=qs['offset'](_0x176fce[_0x554d('0x31')][_0x554d('0x1e')]);}return _0x5acd20['getFields'](_0x3b41ed);}})[_0x554d('0x27')](function(_0x53af39){if(_0x53af39){return _0x53af39?{'count':_0xc869e4,'rows':_0x53af39}:null;}})[_0x554d('0x27')](respondWithResult(_0x2a62b0,null))[_0x554d('0x42')](handleError(_0x2a62b0,null));};exports[_0x554d('0x4c')]=function(_0x1eaff1,_0x4518be,_0x393c62){var _0x3c3f66={};var _0x1a5cda={};var _0x439cfe;var _0x3b84f8;return db['DeskConfiguration'][_0x554d('0x4d')]({'where':{'id':_0x1eaff1[_0x554d('0x43')]['id']}})['then'](handleEntityNotFound(_0x4518be,null))['then'](function(_0x113043){if(_0x113043){_0x439cfe=_0x113043;_0x1a5cda[_0x554d('0x30')]=_[_0x554d('0x32')](db['DeskField']['rawAttributes']);_0x1a5cda[_0x554d('0x31')]=_['keys'](_0x1eaff1[_0x554d('0x31')]);_0x1a5cda['filters']=_[_0x554d('0x33')](_0x1a5cda[_0x554d('0x30')],_0x1a5cda[_0x554d('0x31')]);_0x3c3f66[_0x554d('0x34')]=_[_0x554d('0x33')](_0x1a5cda[_0x554d('0x30')],qs[_0x554d('0x35')](_0x1eaff1[_0x554d('0x31')][_0x554d('0x35')]));_0x3c3f66[_0x554d('0x34')]=_0x3c3f66[_0x554d('0x34')]['length']?_0x3c3f66['attributes']:_0x1a5cda['model'];_0x3c3f66[_0x554d('0x4a')]=qs[_0x554d('0x38')](_0x1eaff1[_0x554d('0x31')][_0x554d('0x38')]);_0x3c3f66[_0x554d('0x39')]=qs[_0x554d('0x3b')](_[_0x554d('0x3a')](_0x1eaff1[_0x554d('0x31')],_0x1a5cda[_0x554d('0x3b')]));if(_0x1eaff1[_0x554d('0x31')][_0x554d('0x3c')]){_0x3c3f66[_0x554d('0x39')]=_[_0x554d('0x3d')](_0x3c3f66[_0x554d('0x39')],{'$or':_[_0x554d('0x4b')](_0x3c3f66['attributes'],function(_0x5a3936){var _0x3375dc={};_0x3375dc[_0x5a3936]={'$like':'%'+_0x1eaff1[_0x554d('0x31')][_0x554d('0x3c')]+'%'};return _0x3375dc;})});}_0x3c3f66=_['merge']({},_0x3c3f66,_0x1eaff1['options']);return _0x439cfe[_0x554d('0x4c')](_0x3c3f66);}})['then'](function(_0xde291b){if(_0xde291b){_0x3b84f8=_0xde291b[_0x554d('0x36')];if(!_0x1eaff1['query'][_0x554d('0x4e')](_0x554d('0x37'))){_0x3c3f66[_0x554d('0x21')]=qs[_0x554d('0x21')](_0x1eaff1[_0x554d('0x31')][_0x554d('0x21')]);_0x3c3f66[_0x554d('0x1e')]=qs[_0x554d('0x1e')](_0x1eaff1['query'][_0x554d('0x1e')]);}return _0x439cfe['getSubjects'](_0x3c3f66);}})[_0x554d('0x27')](function(_0x3d2986){if(_0x3d2986){return _0x3d2986?{'count':_0x3b84f8,'rows':_0x3d2986}:null;}})['then'](respondWithResult(_0x4518be,null))[_0x554d('0x42')](handleError(_0x4518be,null));};exports[_0x554d('0x4f')]=function(_0x130f18,_0x452d22,_0xb8e36a){var _0x3077d0={};var _0x1b34c2={};var _0x2244b6;var _0x164122;return db[_0x554d('0x2d')]['findOne']({'where':{'id':_0x130f18[_0x554d('0x43')]['id']}})[_0x554d('0x27')](handleEntityNotFound(_0x452d22,null))[_0x554d('0x27')](function(_0xe44dc0){if(_0xe44dc0){_0x2244b6=_0xe44dc0;_0x1b34c2[_0x554d('0x30')]=_[_0x554d('0x32')](db[_0x554d('0x49')][_0x554d('0x44')]);_0x1b34c2['query']=_[_0x554d('0x32')](_0x130f18[_0x554d('0x31')]);_0x1b34c2['filters']=_['intersection'](_0x1b34c2[_0x554d('0x30')],_0x1b34c2[_0x554d('0x31')]);_0x3077d0[_0x554d('0x34')]=_[_0x554d('0x33')](_0x1b34c2[_0x554d('0x30')],qs[_0x554d('0x35')](_0x130f18[_0x554d('0x31')]['fields']));_0x3077d0['attributes']=_0x3077d0[_0x554d('0x34')][_0x554d('0x36')]?_0x3077d0[_0x554d('0x34')]:_0x1b34c2[_0x554d('0x30')];_0x3077d0[_0x554d('0x4a')]=qs['sort'](_0x130f18['query'][_0x554d('0x38')]);_0x3077d0['where']=qs[_0x554d('0x3b')](_[_0x554d('0x3a')](_0x130f18[_0x554d('0x31')],_0x1b34c2['filters']));if(_0x130f18['query'][_0x554d('0x3c')]){_0x3077d0[_0x554d('0x39')]=_[_0x554d('0x3d')](_0x3077d0[_0x554d('0x39')],{'$or':_['map'](_0x3077d0[_0x554d('0x34')],function(_0xd36875){var _0x2cc189={};_0x2cc189[_0xd36875]={'$like':'%'+_0x130f18[_0x554d('0x31')]['filter']+'%'};return _0x2cc189;})});}_0x3077d0=_['merge']({},_0x3077d0,_0x130f18[_0x554d('0x45')]);return _0x2244b6[_0x554d('0x4f')](_0x3077d0);}})['then'](function(_0x33c811){if(_0x33c811){_0x164122=_0x33c811[_0x554d('0x36')];if(!_0x130f18['query'][_0x554d('0x4e')]('nolimit')){_0x3077d0[_0x554d('0x21')]=qs[_0x554d('0x21')](_0x130f18['query']['limit']);_0x3077d0[_0x554d('0x1e')]=qs[_0x554d('0x1e')](_0x130f18[_0x554d('0x31')]['offset']);}return _0x2244b6['getDescriptions'](_0x3077d0);}})[_0x554d('0x27')](function(_0x4bc343){if(_0x4bc343){return _0x4bc343?{'count':_0x164122,'rows':_0x4bc343}:null;}})['then'](respondWithResult(_0x452d22,null))[_0x554d('0x42')](handleError(_0x452d22,null));};exports[_0x554d('0x50')]=function(_0x227d67,_0x2f9e70,_0x3068c5){var _0x414f58={};var _0x59e557={};var _0x26ec13;var _0xc04389;return db[_0x554d('0x2d')]['findOne']({'where':{'id':_0x227d67[_0x554d('0x43')]['id']}})[_0x554d('0x27')](handleEntityNotFound(_0x2f9e70,null))[_0x554d('0x27')](function(_0x546b2a){if(_0x546b2a){_0x26ec13=_0x546b2a;_0x59e557['model']=_[_0x554d('0x32')](db['Tag'][_0x554d('0x44')]);_0x59e557[_0x554d('0x31')]=_['keys'](_0x227d67[_0x554d('0x31')]);_0x59e557[_0x554d('0x3b')]=_['intersection'](_0x59e557['model'],_0x59e557[_0x554d('0x31')]);_0x414f58[_0x554d('0x34')]=_[_0x554d('0x33')](_0x59e557[_0x554d('0x30')],qs[_0x554d('0x35')](_0x227d67[_0x554d('0x31')][_0x554d('0x35')]));_0x414f58[_0x554d('0x34')]=_0x414f58[_0x554d('0x34')][_0x554d('0x36')]?_0x414f58['attributes']:_0x59e557[_0x554d('0x30')];_0x414f58[_0x554d('0x4a')]=qs['sort'](_0x227d67[_0x554d('0x31')][_0x554d('0x38')]);_0x414f58['where']=qs[_0x554d('0x3b')](_['pick'](_0x227d67['query'],_0x59e557[_0x554d('0x3b')]));if(_0x227d67[_0x554d('0x31')][_0x554d('0x3c')]){_0x414f58[_0x554d('0x39')]=_[_0x554d('0x3d')](_0x414f58[_0x554d('0x39')],{'$or':_[_0x554d('0x4b')](_0x414f58[_0x554d('0x34')],function(_0x4d272e){var _0x3fbabb={};_0x3fbabb[_0x4d272e]={'$like':'%'+_0x227d67[_0x554d('0x31')][_0x554d('0x3c')]+'%'};return _0x3fbabb;})});}_0x414f58=_[_0x554d('0x3d')]({},_0x414f58,_0x227d67[_0x554d('0x45')]);return _0x26ec13['getTags'](_0x414f58);}})['then'](function(_0x195307){if(_0x195307){_0xc04389=_0x195307[_0x554d('0x36')];if(!_0x227d67[_0x554d('0x31')][_0x554d('0x4e')]('nolimit')){_0x414f58['limit']=qs['limit'](_0x227d67[_0x554d('0x31')][_0x554d('0x21')]);_0x414f58[_0x554d('0x1e')]=qs[_0x554d('0x1e')](_0x227d67['query']['offset']);}return _0x26ec13[_0x554d('0x50')](_0x414f58);}})[_0x554d('0x27')](function(_0x1c1ca1){if(_0x1c1ca1){return _0x1c1ca1?{'count':_0xc04389,'rows':_0x1c1ca1}:null;}})['then'](respondWithResult(_0x2f9e70,null))[_0x554d('0x42')](handleError(_0x2f9e70,null));};exports[_0x554d('0x51')]=function(_0x831600,_0x3830b8,_0x2e2e76){if(_0x831600[_0x554d('0x52')]['id']){delete _0x831600[_0x554d('0x52')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x831600[_0x554d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3830b8,null))['then'](function(_0x54be60){if(_0x54be60){return _0x54be60[_0x554d('0x51')](_0x831600[_0x554d('0x52')][_0x554d('0x53')]||[]);}return null;})[_0x554d('0x27')](respondWithResult(_0x3830b8,null))[_0x554d('0x42')](handleError(_0x3830b8,null));}; \ No newline at end of file +var _0x256d=['destroy','error','stack','name','map','type','key','model','query','keys','filters','intersection','attributes','fields','sort','where','filter','VIRTUAL','options','DeskConfiguration','includeAll','findAll','show','params','length','merge','find','catch','create','body','getFields','findOne','DeskField','rawAttributes','order','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','apply','update','then'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x256d,0xca));var _0xd256=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x256d[_0x126fb9];return _0xc8a3b1;};'use strict';var emlformat=require(_0xd256('0x0'));var rimraf=require(_0xd256('0x1'));var zipdir=require(_0xd256('0x2'));var jsonpatch=require(_0xd256('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd256('0x4'));var Mustache=require(_0xd256('0x5'));var util=require(_0xd256('0x6'));var path=require(_0xd256('0x7'));var sox=require(_0xd256('0x8'));var csv=require(_0xd256('0x9'));var ejs=require(_0xd256('0xa'));var fs=require('fs');var fs_extra=require(_0xd256('0xb'));var _=require('lodash');var squel=require(_0xd256('0xc'));var crypto=require('crypto');var jsforce=require(_0xd256('0xd'));var deskjs=require(_0xd256('0xe'));var toCsv=require(_0xd256('0x9'));var querystring=require(_0xd256('0xf'));var Papa=require('papaparse');var Redis=require(_0xd256('0x10'));var authService=require(_0xd256('0x11'));var qs=require(_0xd256('0x12'));var as=require(_0xd256('0x13'));var hardwareService=require(_0xd256('0x14'));var logger=require(_0xd256('0x15'))(_0xd256('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd256('0x17'));var db=require(_0xd256('0x18'))['db'];function respondWithStatusCode(_0x4fb3df,_0x11c85e){_0x11c85e=_0x11c85e||0xcc;return function(_0x1c2241){if(_0x1c2241){return _0x4fb3df['sendStatus'](_0x11c85e);}return _0x4fb3df[_0xd256('0x19')](_0x11c85e)[_0xd256('0x1a')]();};}function respondWithResult(_0xb92e60,_0x3ceb86){_0x3ceb86=_0x3ceb86||0xc8;return function(_0x3cc1ea){if(_0x3cc1ea){return _0xb92e60[_0xd256('0x19')](_0x3ceb86)['json'](_0x3cc1ea);}};}function respondWithFilteredResult(_0x81e30a,_0x256e76){return function(_0x2b4d3a){if(_0x2b4d3a){var _0xbb071f=typeof _0x256e76[_0xd256('0x1b')]===_0xd256('0x1c')&&typeof _0x256e76[_0xd256('0x1d')]===_0xd256('0x1c');var _0x110f06=_0x2b4d3a[_0xd256('0x1e')];var _0x40b2e8=_0xbb071f?0x0:_0x256e76['offset'];var _0xbc7574=_0xbb071f?_0x2b4d3a[_0xd256('0x1e')]:_0x256e76[_0xd256('0x1b')]+_0x256e76[_0xd256('0x1d')];var _0x562d39;if(_0xbc7574>=_0x110f06){_0xbc7574=_0x110f06;_0x562d39=0xc8;}else{_0x562d39=0xce;}_0x81e30a[_0xd256('0x19')](_0x562d39);return _0x81e30a[_0xd256('0x1f')]('Content-Range',_0x40b2e8+'-'+_0xbc7574+'/'+_0x110f06)['json'](_0x2b4d3a);}return null;};}function patchUpdates(_0x46843a){return function(_0x588236){try{jsonpatch[_0xd256('0x20')](_0x588236,_0x46843a,!![]);}catch(_0x326e14){return BPromise['reject'](_0x326e14);}return _0x588236['save']();};}function saveUpdates(_0x1b3b97,_0x2a2e74){return function(_0x622a84){if(_0x622a84){return _0x622a84[_0xd256('0x21')](_0x1b3b97)[_0xd256('0x22')](function(_0x4348db){return _0x4348db;});}return null;};}function removeEntity(_0x51fac5,_0x4f7103){return function(_0x1f2ddf){if(_0x1f2ddf){return _0x1f2ddf[_0xd256('0x23')]()['then'](function(){_0x51fac5[_0xd256('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7f932f,_0x291bc8){return function(_0x51cc42){if(!_0x51cc42){_0x7f932f['sendStatus'](0x194);}return _0x51cc42;};}function handleError(_0x3e7cfd,_0x3f1175){_0x3f1175=_0x3f1175||0x1f4;return function(_0xfa4cc3){logger[_0xd256('0x24')](_0xfa4cc3[_0xd256('0x25')]);if(_0xfa4cc3[_0xd256('0x26')]){delete _0xfa4cc3[_0xd256('0x26')];}_0x3e7cfd[_0xd256('0x19')](_0x3f1175)['send'](_0xfa4cc3);};}exports['index']=function(_0xea8961,_0x5c5078){var _0x26062a={},_0x10c483={},_0x2ccc49={'count':0x0,'rows':[]};var _0x547199=_[_0xd256('0x27')](db['DeskConfiguration']['rawAttributes'],function(_0x37de36){return{'name':_0x37de36['fieldName'],'type':_0x37de36[_0xd256('0x28')][_0xd256('0x29')]};});_0x10c483[_0xd256('0x2a')]=_['map'](_0x547199,'name');_0x10c483[_0xd256('0x2b')]=_[_0xd256('0x2c')](_0xea8961[_0xd256('0x2b')]);_0x10c483[_0xd256('0x2d')]=_[_0xd256('0x2e')](_0x10c483[_0xd256('0x2a')],_0x10c483[_0xd256('0x2b')]);_0x26062a[_0xd256('0x2f')]=_[_0xd256('0x2e')](_0x10c483['model'],qs[_0xd256('0x30')](_0xea8961[_0xd256('0x2b')][_0xd256('0x30')]));_0x26062a[_0xd256('0x2f')]=_0x26062a[_0xd256('0x2f')]['length']?_0x26062a[_0xd256('0x2f')]:_0x10c483[_0xd256('0x2a')];if(!_0xea8961[_0xd256('0x2b')]['hasOwnProperty']('nolimit')){_0x26062a[_0xd256('0x1d')]=qs[_0xd256('0x1d')](_0xea8961[_0xd256('0x2b')][_0xd256('0x1d')]);_0x26062a[_0xd256('0x1b')]=qs[_0xd256('0x1b')](_0xea8961[_0xd256('0x2b')][_0xd256('0x1b')]);}_0x26062a['order']=qs[_0xd256('0x31')](_0xea8961[_0xd256('0x2b')][_0xd256('0x31')]);_0x26062a[_0xd256('0x32')]=qs[_0xd256('0x2d')](_['pick'](_0xea8961[_0xd256('0x2b')],_0x10c483[_0xd256('0x2d')]),_0x547199);if(_0xea8961[_0xd256('0x2b')][_0xd256('0x33')]){_0x26062a[_0xd256('0x32')]=_['merge'](_0x26062a[_0xd256('0x32')],{'$or':_['map'](_0x547199,function(_0x32c177){if(_0x32c177['type']!==_0xd256('0x34')){var _0x564b38={};_0x564b38[_0x32c177['name']]={'$like':'%'+_0xea8961['query'][_0xd256('0x33')]+'%'};return _0x564b38;}})});}_0x26062a=_['merge']({},_0x26062a,_0xea8961[_0xd256('0x35')]);var _0x3d12fd={'where':_0x26062a['where']};return db[_0xd256('0x36')][_0xd256('0x1e')](_0x3d12fd)['then'](function(_0x4cebea){_0x2ccc49['count']=_0x4cebea;if(_0xea8961[_0xd256('0x2b')][_0xd256('0x37')]){_0x26062a['include']=[{'all':!![]}];}return db[_0xd256('0x36')][_0xd256('0x38')](_0x26062a);})[_0xd256('0x22')](function(_0x55324b){_0x2ccc49['rows']=_0x55324b;return _0x2ccc49;})[_0xd256('0x22')](respondWithFilteredResult(_0x5c5078,_0x26062a))['catch'](handleError(_0x5c5078,null));};exports[_0xd256('0x39')]=function(_0x3cd92a,_0x343961){var _0x4d87b2={'raw':![],'where':{'id':_0x3cd92a[_0xd256('0x3a')]['id']}},_0x2ef8d8={};_0x2ef8d8[_0xd256('0x2a')]=_['keys'](db[_0xd256('0x36')]['rawAttributes']);_0x2ef8d8[_0xd256('0x2b')]=_[_0xd256('0x2c')](_0x3cd92a[_0xd256('0x2b')]);_0x2ef8d8[_0xd256('0x2d')]=_[_0xd256('0x2e')](_0x2ef8d8[_0xd256('0x2a')],_0x2ef8d8[_0xd256('0x2b')]);_0x4d87b2[_0xd256('0x2f')]=_['intersection'](_0x2ef8d8[_0xd256('0x2a')],qs['fields'](_0x3cd92a[_0xd256('0x2b')]['fields']));_0x4d87b2['attributes']=_0x4d87b2[_0xd256('0x2f')][_0xd256('0x3b')]?_0x4d87b2['attributes']:_0x2ef8d8['model'];if(_0x3cd92a[_0xd256('0x2b')]['includeAll']){_0x4d87b2['include']=[{'all':!![]}];}_0x4d87b2=_[_0xd256('0x3c')]({},_0x4d87b2,_0x3cd92a['options']);return db[_0xd256('0x36')][_0xd256('0x3d')](_0x4d87b2)[_0xd256('0x22')](handleEntityNotFound(_0x343961,null))['then'](respondWithResult(_0x343961,null))[_0xd256('0x3e')](handleError(_0x343961,null));};exports['create']=function(_0x13c79e,_0x9fc1c4){return db['DeskConfiguration'][_0xd256('0x3f')](_0x13c79e[_0xd256('0x40')],{})[_0xd256('0x22')](respondWithResult(_0x9fc1c4,0xc9))[_0xd256('0x3e')](handleError(_0x9fc1c4,null));};exports[_0xd256('0x21')]=function(_0x57df17,_0x2e6428){if(_0x57df17[_0xd256('0x40')]['id']){delete _0x57df17[_0xd256('0x40')]['id'];}return db[_0xd256('0x36')]['find']({'where':{'id':_0x57df17[_0xd256('0x3a')]['id']}})[_0xd256('0x22')](handleEntityNotFound(_0x2e6428,null))[_0xd256('0x22')](saveUpdates(_0x57df17[_0xd256('0x40')],null))[_0xd256('0x22')](respondWithResult(_0x2e6428,null))[_0xd256('0x3e')](handleError(_0x2e6428,null));};exports[_0xd256('0x23')]=function(_0x4eabcd,_0x2821be){return db[_0xd256('0x36')][_0xd256('0x3d')]({'where':{'id':_0x4eabcd['params']['id']}})[_0xd256('0x22')](handleEntityNotFound(_0x2821be,null))['then'](removeEntity(_0x2821be,null))[_0xd256('0x3e')](handleError(_0x2821be,null));};exports[_0xd256('0x41')]=function(_0x3098c5,_0x133a48,_0x4af313){var _0x2bce6a={};var _0x31b994={};var _0x43f054;var _0x481105;return db[_0xd256('0x36')][_0xd256('0x42')]({'where':{'id':_0x3098c5[_0xd256('0x3a')]['id']}})['then'](handleEntityNotFound(_0x133a48,null))[_0xd256('0x22')](function(_0x1ce6b2){if(_0x1ce6b2){_0x43f054=_0x1ce6b2;_0x31b994[_0xd256('0x2a')]=_[_0xd256('0x2c')](db[_0xd256('0x43')][_0xd256('0x44')]);_0x31b994['query']=_['keys'](_0x3098c5[_0xd256('0x2b')]);_0x31b994[_0xd256('0x2d')]=_[_0xd256('0x2e')](_0x31b994['model'],_0x31b994['query']);_0x2bce6a[_0xd256('0x2f')]=_['intersection'](_0x31b994['model'],qs[_0xd256('0x30')](_0x3098c5[_0xd256('0x2b')]['fields']));_0x2bce6a[_0xd256('0x2f')]=_0x2bce6a[_0xd256('0x2f')][_0xd256('0x3b')]?_0x2bce6a['attributes']:_0x31b994[_0xd256('0x2a')];_0x2bce6a[_0xd256('0x45')]=qs[_0xd256('0x31')](_0x3098c5['query'][_0xd256('0x31')]);_0x2bce6a[_0xd256('0x32')]=qs[_0xd256('0x2d')](_[_0xd256('0x46')](_0x3098c5[_0xd256('0x2b')],_0x31b994['filters']));if(_0x3098c5[_0xd256('0x2b')]['filter']){_0x2bce6a['where']=_[_0xd256('0x3c')](_0x2bce6a[_0xd256('0x32')],{'$or':_['map'](_0x2bce6a[_0xd256('0x2f')],function(_0x28e2aa){var _0x5a77cf={};_0x5a77cf[_0x28e2aa]={'$like':'%'+_0x3098c5[_0xd256('0x2b')][_0xd256('0x33')]+'%'};return _0x5a77cf;})});}_0x2bce6a=_[_0xd256('0x3c')]({},_0x2bce6a,_0x3098c5['options']);return _0x43f054['getFields'](_0x2bce6a);}})[_0xd256('0x22')](function(_0x136b11){if(_0x136b11){_0x481105=_0x136b11[_0xd256('0x3b')];if(!_0x3098c5[_0xd256('0x2b')][_0xd256('0x47')](_0xd256('0x48'))){_0x2bce6a[_0xd256('0x1d')]=qs['limit'](_0x3098c5[_0xd256('0x2b')][_0xd256('0x1d')]);_0x2bce6a[_0xd256('0x1b')]=qs[_0xd256('0x1b')](_0x3098c5[_0xd256('0x2b')][_0xd256('0x1b')]);}return _0x43f054[_0xd256('0x41')](_0x2bce6a);}})['then'](function(_0x356e30){if(_0x356e30){return _0x356e30?{'count':_0x481105,'rows':_0x356e30}:null;}})[_0xd256('0x22')](respondWithResult(_0x133a48,null))[_0xd256('0x3e')](handleError(_0x133a48,null));};exports[_0xd256('0x49')]=function(_0x356878,_0x13a3ba,_0x2b0c20){var _0x25dc55={};var _0x33d35d={};var _0x140754;var _0x4dcbb4;return db[_0xd256('0x36')][_0xd256('0x42')]({'where':{'id':_0x356878[_0xd256('0x3a')]['id']}})[_0xd256('0x22')](handleEntityNotFound(_0x13a3ba,null))['then'](function(_0x108120){if(_0x108120){_0x140754=_0x108120;_0x33d35d[_0xd256('0x2a')]=_['keys'](db[_0xd256('0x43')][_0xd256('0x44')]);_0x33d35d['query']=_[_0xd256('0x2c')](_0x356878[_0xd256('0x2b')]);_0x33d35d[_0xd256('0x2d')]=_[_0xd256('0x2e')](_0x33d35d['model'],_0x33d35d['query']);_0x25dc55[_0xd256('0x2f')]=_[_0xd256('0x2e')](_0x33d35d[_0xd256('0x2a')],qs[_0xd256('0x30')](_0x356878[_0xd256('0x2b')][_0xd256('0x30')]));_0x25dc55[_0xd256('0x2f')]=_0x25dc55[_0xd256('0x2f')][_0xd256('0x3b')]?_0x25dc55[_0xd256('0x2f')]:_0x33d35d[_0xd256('0x2a')];_0x25dc55[_0xd256('0x45')]=qs['sort'](_0x356878[_0xd256('0x2b')][_0xd256('0x31')]);_0x25dc55['where']=qs['filters'](_[_0xd256('0x46')](_0x356878[_0xd256('0x2b')],_0x33d35d['filters']));if(_0x356878['query'][_0xd256('0x33')]){_0x25dc55[_0xd256('0x32')]=_[_0xd256('0x3c')](_0x25dc55[_0xd256('0x32')],{'$or':_['map'](_0x25dc55['attributes'],function(_0x54de8e){var _0x409ec6={};_0x409ec6[_0x54de8e]={'$like':'%'+_0x356878[_0xd256('0x2b')]['filter']+'%'};return _0x409ec6;})});}_0x25dc55=_[_0xd256('0x3c')]({},_0x25dc55,_0x356878[_0xd256('0x35')]);return _0x140754['getSubjects'](_0x25dc55);}})['then'](function(_0x2a8df6){if(_0x2a8df6){_0x4dcbb4=_0x2a8df6['length'];if(!_0x356878[_0xd256('0x2b')][_0xd256('0x47')]('nolimit')){_0x25dc55[_0xd256('0x1d')]=qs['limit'](_0x356878['query'][_0xd256('0x1d')]);_0x25dc55[_0xd256('0x1b')]=qs[_0xd256('0x1b')](_0x356878['query']['offset']);}return _0x140754[_0xd256('0x49')](_0x25dc55);}})[_0xd256('0x22')](function(_0x51a0f6){if(_0x51a0f6){return _0x51a0f6?{'count':_0x4dcbb4,'rows':_0x51a0f6}:null;}})[_0xd256('0x22')](respondWithResult(_0x13a3ba,null))[_0xd256('0x3e')](handleError(_0x13a3ba,null));};exports[_0xd256('0x4a')]=function(_0x48ef97,_0x1a7c01,_0x3b020d){var _0x37da46={};var _0x2ecbf6={};var _0x1cb85b;var _0x1183d9;return db[_0xd256('0x36')][_0xd256('0x42')]({'where':{'id':_0x48ef97[_0xd256('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1a7c01,null))[_0xd256('0x22')](function(_0x3f85c4){if(_0x3f85c4){_0x1cb85b=_0x3f85c4;_0x2ecbf6[_0xd256('0x2a')]=_['keys'](db[_0xd256('0x43')][_0xd256('0x44')]);_0x2ecbf6['query']=_[_0xd256('0x2c')](_0x48ef97['query']);_0x2ecbf6[_0xd256('0x2d')]=_[_0xd256('0x2e')](_0x2ecbf6[_0xd256('0x2a')],_0x2ecbf6['query']);_0x37da46['attributes']=_['intersection'](_0x2ecbf6[_0xd256('0x2a')],qs[_0xd256('0x30')](_0x48ef97[_0xd256('0x2b')][_0xd256('0x30')]));_0x37da46[_0xd256('0x2f')]=_0x37da46[_0xd256('0x2f')][_0xd256('0x3b')]?_0x37da46[_0xd256('0x2f')]:_0x2ecbf6[_0xd256('0x2a')];_0x37da46[_0xd256('0x45')]=qs[_0xd256('0x31')](_0x48ef97[_0xd256('0x2b')]['sort']);_0x37da46[_0xd256('0x32')]=qs[_0xd256('0x2d')](_[_0xd256('0x46')](_0x48ef97[_0xd256('0x2b')],_0x2ecbf6['filters']));if(_0x48ef97[_0xd256('0x2b')][_0xd256('0x33')]){_0x37da46['where']=_[_0xd256('0x3c')](_0x37da46[_0xd256('0x32')],{'$or':_[_0xd256('0x27')](_0x37da46[_0xd256('0x2f')],function(_0x59ba08){var _0x31c1bd={};_0x31c1bd[_0x59ba08]={'$like':'%'+_0x48ef97[_0xd256('0x2b')]['filter']+'%'};return _0x31c1bd;})});}_0x37da46=_['merge']({},_0x37da46,_0x48ef97[_0xd256('0x35')]);return _0x1cb85b['getDescriptions'](_0x37da46);}})[_0xd256('0x22')](function(_0xe11d74){if(_0xe11d74){_0x1183d9=_0xe11d74[_0xd256('0x3b')];if(!_0x48ef97['query'][_0xd256('0x47')](_0xd256('0x48'))){_0x37da46[_0xd256('0x1d')]=qs[_0xd256('0x1d')](_0x48ef97[_0xd256('0x2b')][_0xd256('0x1d')]);_0x37da46[_0xd256('0x1b')]=qs['offset'](_0x48ef97[_0xd256('0x2b')][_0xd256('0x1b')]);}return _0x1cb85b[_0xd256('0x4a')](_0x37da46);}})[_0xd256('0x22')](function(_0x98b344){if(_0x98b344){return _0x98b344?{'count':_0x1183d9,'rows':_0x98b344}:null;}})['then'](respondWithResult(_0x1a7c01,null))[_0xd256('0x3e')](handleError(_0x1a7c01,null));};exports[_0xd256('0x4b')]=function(_0x53a568,_0xf23747,_0x7f241b){var _0x2f7a3b={};var _0x4de656={};var _0x13ebf3;var _0x30c188;return db[_0xd256('0x36')][_0xd256('0x42')]({'where':{'id':_0x53a568['params']['id']}})['then'](handleEntityNotFound(_0xf23747,null))[_0xd256('0x22')](function(_0x4e022c){if(_0x4e022c){_0x13ebf3=_0x4e022c;_0x4de656[_0xd256('0x2a')]=_[_0xd256('0x2c')](db[_0xd256('0x4c')]['rawAttributes']);_0x4de656[_0xd256('0x2b')]=_[_0xd256('0x2c')](_0x53a568['query']);_0x4de656[_0xd256('0x2d')]=_[_0xd256('0x2e')](_0x4de656[_0xd256('0x2a')],_0x4de656[_0xd256('0x2b')]);_0x2f7a3b[_0xd256('0x2f')]=_['intersection'](_0x4de656[_0xd256('0x2a')],qs['fields'](_0x53a568[_0xd256('0x2b')][_0xd256('0x30')]));_0x2f7a3b[_0xd256('0x2f')]=_0x2f7a3b[_0xd256('0x2f')]['length']?_0x2f7a3b[_0xd256('0x2f')]:_0x4de656[_0xd256('0x2a')];_0x2f7a3b[_0xd256('0x45')]=qs[_0xd256('0x31')](_0x53a568[_0xd256('0x2b')]['sort']);_0x2f7a3b[_0xd256('0x32')]=qs[_0xd256('0x2d')](_[_0xd256('0x46')](_0x53a568[_0xd256('0x2b')],_0x4de656['filters']));if(_0x53a568[_0xd256('0x2b')][_0xd256('0x33')]){_0x2f7a3b[_0xd256('0x32')]=_[_0xd256('0x3c')](_0x2f7a3b[_0xd256('0x32')],{'$or':_['map'](_0x2f7a3b[_0xd256('0x2f')],function(_0x5d02b3){var _0x4d038c={};_0x4d038c[_0x5d02b3]={'$like':'%'+_0x53a568[_0xd256('0x2b')]['filter']+'%'};return _0x4d038c;})});}_0x2f7a3b=_[_0xd256('0x3c')]({},_0x2f7a3b,_0x53a568[_0xd256('0x35')]);return _0x13ebf3['getTags'](_0x2f7a3b);}})['then'](function(_0x906fd7){if(_0x906fd7){_0x30c188=_0x906fd7[_0xd256('0x3b')];if(!_0x53a568['query'][_0xd256('0x47')](_0xd256('0x48'))){_0x2f7a3b[_0xd256('0x1d')]=qs[_0xd256('0x1d')](_0x53a568['query']['limit']);_0x2f7a3b[_0xd256('0x1b')]=qs[_0xd256('0x1b')](_0x53a568[_0xd256('0x2b')][_0xd256('0x1b')]);}return _0x13ebf3[_0xd256('0x4b')](_0x2f7a3b);}})[_0xd256('0x22')](function(_0x2c1ae9){if(_0x2c1ae9){return _0x2c1ae9?{'count':_0x30c188,'rows':_0x2c1ae9}:null;}})[_0xd256('0x22')](respondWithResult(_0xf23747,null))['catch'](handleError(_0xf23747,null));};exports[_0xd256('0x4d')]=function(_0x561dcc,_0x2dbdd6,_0x1f1473){if(_0x561dcc['body']['id']){delete _0x561dcc['body']['id'];}return db[_0xd256('0x36')]['findOne']({'where':{'id':_0x561dcc[_0xd256('0x3a')]['id']}})[_0xd256('0x22')](handleEntityNotFound(_0x2dbdd6,null))[_0xd256('0x22')](function(_0x4dfa20){if(_0x4dfa20){return _0x4dfa20[_0xd256('0x4d')](_0x561dcc[_0xd256('0x40')][_0xd256('0x4e')]||[]);}return null;})[_0xd256('0x22')](respondWithResult(_0x2dbdd6,null))[_0xd256('0x3e')](handleError(_0x2dbdd6,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index c5cdaf0..463e85a 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 _0xa643=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','int_desk_configurations','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa643,0x11c));var _0x3a64=function(_0x4fe8d5,_0x3188d0){_0x4fe8d5=_0x4fe8d5-0x0;var _0x215681=_0xa643[_0x4fe8d5];return _0x215681;};'use strict';var _=require(_0x3a64('0x0'));var util=require(_0x3a64('0x1'));var logger=require('../../config/logger')(_0x3a64('0x2'));var moment=require(_0x3a64('0x3'));var BPromise=require('bluebird');var rp=require(_0x3a64('0x4'));var fs=require('fs');var path=require(_0x3a64('0x5'));var rimraf=require(_0x3a64('0x6'));var config=require(_0x3a64('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0x3a64('0x8')]=function(_0x14e51b,_0x207bec){return _0x14e51b[_0x3a64('0x9')]('DeskConfiguration',attributes,{'tableName':_0x3a64('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d0c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0xf2ba9c,_0x574c2a){var _0x5b43a1=function(_0x4051ac){while(--_0x4051ac){_0xf2ba9c['push'](_0xf2ba9c['shift']());}};_0x5b43a1(++_0x574c2a);}(_0x6d0c,0x8d));var _0xc6d0=function(_0x457608,_0x1100f9){_0x457608=_0x457608-0x0;var _0x1e5eed=_0x6d0c[_0x457608];return _0x1e5eed;};'use strict';var _=require(_0xc6d0('0x0'));var util=require(_0xc6d0('0x1'));var logger=require(_0xc6d0('0x2'))(_0xc6d0('0x3'));var moment=require(_0xc6d0('0x4'));var BPromise=require(_0xc6d0('0x5'));var rp=require(_0xc6d0('0x6'));var fs=require('fs');var path=require(_0xc6d0('0x7'));var rimraf=require(_0xc6d0('0x8'));var config=require(_0xc6d0('0x9'));var attributes=require(_0xc6d0('0xa'));module['exports']=function(_0x1529b0,_0x484f0f){return _0x1529b0['define'](_0xc6d0('0xb'),attributes,{'tableName':_0xc6d0('0xc'),'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 54adc64..2c9609d 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 _0x288a=['jayson/promise','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x6a2fe0,_0x6a9f5f){var _0x3732b0=function(_0x35aa94){while(--_0x35aa94){_0x6a2fe0['push'](_0x6a2fe0['shift']());}};_0x3732b0(++_0x6a9f5f);}(_0x288a,0x188));var _0xa288=function(_0x9d2732,_0x4e241a){_0x9d2732=_0x9d2732-0x0;var _0x2532f5=_0x288a[_0x9d2732];return _0x2532f5;};'use strict';var _=require('lodash');var util=require(_0xa288('0x0'));var moment=require(_0xa288('0x1'));var BPromise=require(_0xa288('0x2'));var rs=require(_0xa288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa288('0x4'));var logger=require('../../config/logger')(_0xa288('0x5'));var config=require(_0xa288('0x6'));var jayson=require(_0xa288('0x7'));var client=jayson['client'][_0xa288('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xaee90c,_0x156720,_0x57f445){return new BPromise(function(_0x14e4a6,_0x1e8412){return client[_0xa288('0x9')](_0xaee90c,_0x57f445)[_0xa288('0xa')](function(_0x1a0c06){logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x156720,'request\x20sent',JSON[_0xa288('0xe')](_0x1a0c06));if(_0x1a0c06[_0xa288('0xf')]){if(_0x1a0c06['error'][_0xa288('0x10')]===0x1f4){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x1e8412(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);return _0x14e4a6(_0x1a0c06[_0xa288('0xf')][_0xa288('0x11')]);}else{logger[_0xa288('0xb')](_0xa288('0xc'),_0x156720,_0xa288('0xd'));_0x14e4a6(_0x1a0c06['result'][_0xa288('0x11')]);}})[_0xa288('0x12')](function(_0x299ede){logger[_0xa288('0xf')](_0xa288('0xc'),_0x156720,_0x299ede);_0x1e8412(_0x299ede);});});} \ No newline at end of file +var _0xd4d0=['then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x3cfe21,_0x5035b8){var _0x19a810=function(_0x1d1258){while(--_0x1d1258){_0x3cfe21['push'](_0x3cfe21['shift']());}};_0x19a810(++_0x5035b8);}(_0xd4d0,0x6d));var _0x0d4d=function(_0x4026ce,_0x19b4b2){_0x4026ce=_0x4026ce-0x0;var _0x34e3fe=_0xd4d0[_0x4026ce];return _0x34e3fe;};'use strict';var _=require(_0x0d4d('0x0'));var util=require('util');var moment=require(_0x0d4d('0x1'));var BPromise=require(_0x0d4d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d4d('0x3'))['db'];var utils=require(_0x0d4d('0x4'));var logger=require(_0x0d4d('0x5'))('rpc');var config=require(_0x0d4d('0x6'));var jayson=require(_0x0d4d('0x7'));var client=jayson[_0x0d4d('0x8')][_0x0d4d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c1ad0,_0x38f96b,_0x296db5){return new BPromise(function(_0x5c35ef,_0x1ff00b){return client[_0x0d4d('0xa')](_0x3c1ad0,_0x296db5)[_0x0d4d('0xb')](function(_0x64a879){logger['info'](_0x0d4d('0xc'),_0x38f96b,_0x0d4d('0xd'));logger[_0x0d4d('0xe')](_0x0d4d('0xf'),_0x38f96b,_0x0d4d('0xd'),JSON['stringify'](_0x64a879));if(_0x64a879['error']){if(_0x64a879[_0x0d4d('0x10')][_0x0d4d('0x11')]===0x1f4){logger[_0x0d4d('0x10')](_0x0d4d('0xc'),_0x38f96b,_0x64a879[_0x0d4d('0x10')][_0x0d4d('0x12')]);return _0x1ff00b(_0x64a879['error']['message']);}logger[_0x0d4d('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x38f96b,_0x64a879[_0x0d4d('0x10')]['message']);return _0x5c35ef(_0x64a879[_0x0d4d('0x10')][_0x0d4d('0x12')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x38f96b,_0x0d4d('0xd'));_0x5c35ef(_0x64a879['result'][_0x0d4d('0x12')]);}})[_0x0d4d('0x13')](function(_0x333ac0){logger['error'](_0x0d4d('0xc'),_0x38f96b,_0x333ac0);_0x1ff00b(_0x333ac0);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 79a74f9..9f0ff86 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 _0xe55d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','index','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','util'];(function(_0x2d87c4,_0x341d6b){var _0x2f453b=function(_0x3cf382){while(--_0x3cf382){_0x2d87c4['push'](_0x2d87c4['shift']());}};_0x2f453b(++_0x341d6b);}(_0xe55d,0x9f));var _0xde55=function(_0xa66559,_0x466ee4){_0xa66559=_0xa66559-0x0;var _0x2be33f=_0xe55d[_0xa66559];return _0x2be33f;};'use strict';var multer=require('multer');var util=require(_0xde55('0x0'));var path=require(_0xde55('0x1'));var timeout=require(_0xde55('0x2'));var express=require(_0xde55('0x3'));var router=express[_0xde55('0x4')]();var fs_extra=require(_0xde55('0x5'));var auth=require(_0xde55('0x6'));var interaction=require(_0xde55('0x7'));var config=require(_0xde55('0x8'));var controller=require(_0xde55('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xde55('0xa')]);router['get'](_0xde55('0xb'),auth[_0xde55('0xc')](),controller[_0xde55('0xd')]);router[_0xde55('0xe')]('/',auth[_0xde55('0xc')](),controller['create']);router[_0xde55('0xf')](_0xde55('0xb'),auth['isAuthenticated'](),controller[_0xde55('0x10')]);router[_0xde55('0x11')](_0xde55('0xb'),auth[_0xde55('0xc')](),controller[_0xde55('0x12')]);module[_0xde55('0x13')]=router; \ No newline at end of file +var _0x3713=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','create','update','delete'];(function(_0x520da7,_0x3f49cb){var _0x462a2d=function(_0x2ab1d4){while(--_0x2ab1d4){_0x520da7['push'](_0x520da7['shift']());}};_0x462a2d(++_0x3f49cb);}(_0x3713,0xa2));var _0x3371=function(_0x592dcd,_0x369200){_0x592dcd=_0x592dcd-0x0;var _0x2888c0=_0x3713[_0x592dcd];return _0x2888c0;};'use strict';var multer=require(_0x3371('0x0'));var util=require(_0x3371('0x1'));var path=require(_0x3371('0x2'));var timeout=require(_0x3371('0x3'));var express=require(_0x3371('0x4'));var router=express[_0x3371('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3371('0x6'));var interaction=require(_0x3371('0x7'));var config=require(_0x3371('0x8'));var controller=require(_0x3371('0x9'));router['get']('/',auth[_0x3371('0xa')](),controller[_0x3371('0xb')]);router[_0x3371('0xc')](_0x3371('0xd'),auth[_0x3371('0xa')](),controller[_0x3371('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3371('0xf')]);router['put'](_0x3371('0xd'),auth[_0x3371('0xa')](),controller[_0x3371('0x10')]);router[_0x3371('0x11')](_0x3371('0xd'),auth['isAuthenticated'](),controller[_0x3371('0x12')]);module[_0x3371('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 7d41579..c7cb574 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 _0x635c=['BOOLEAN','sequelize','exports','keyValue','picklist','string','STRING','ENUM','variable'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x635c,0x1e7));var _0xc635=function(_0x2860b2,_0x2c42fe){_0x2860b2=_0x2860b2-0x0;var _0x73e907=_0x635c[_0x2860b2];return _0x73e907;};'use strict';var Sequelize=require(_0xc635('0x0'));module[_0xc635('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0xc635('0x2'),_0xc635('0x3')),'defaultValue':_0xc635('0x4')},'content':{'type':Sequelize[_0xc635('0x5')]},'key':{'type':Sequelize[_0xc635('0x5')]},'keyType':{'type':Sequelize[_0xc635('0x6')](_0xc635('0x4'),_0xc635('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc635('0x5')]},'nameField':{'type':Sequelize[_0xc635('0x5')]},'customField':{'type':Sequelize[_0xc635('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc635('0x5')]}}; \ No newline at end of file +var _0x7b6c=['ENUM','variable','customVariable','picklist','string','STRING','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b6c,0xfb));var _0xc7b6=function(_0x39f989,_0x2365d7){_0x39f989=_0x39f989-0x0;var _0x3816f6=_0x7b6c[_0x39f989];return _0x3816f6;};'use strict';var Sequelize=require('sequelize');module[_0xc7b6('0x0')]={'type':{'type':Sequelize[_0xc7b6('0x1')]('string',_0xc7b6('0x2'),_0xc7b6('0x3'),'keyValue',_0xc7b6('0x4')),'defaultValue':_0xc7b6('0x5')},'content':{'type':Sequelize[_0xc7b6('0x6')]},'key':{'type':Sequelize[_0xc7b6('0x6')]},'keyType':{'type':Sequelize[_0xc7b6('0x1')](_0xc7b6('0x5'),_0xc7b6('0x2'),_0xc7b6('0x3'))},'keyContent':{'type':Sequelize[_0xc7b6('0x6')]},'idField':{'type':Sequelize[_0xc7b6('0x6')]},'nameField':{'type':Sequelize[_0xc7b6('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc7b6('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index c9a83dc..825ed0f 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 _0xdbf5=['stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','includeAll','create','body','find','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','end','error'];(function(_0x31dda0,_0xba5ef9){var _0x2b00fe=function(_0x4fed92){while(--_0x4fed92){_0x31dda0['push'](_0x31dda0['shift']());}};_0x2b00fe(++_0xba5ef9);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5e1a6e,_0x4d390b){_0x5e1a6e=_0x5e1a6e-0x0;var _0x34bace=_0xdbf5[_0x5e1a6e];return _0x34bace;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x22')]();});}};}function handleEntityNotFound(_0x20ab1b,_0x42f13b){return function(_0x15a790){if(!_0x15a790){_0x20ab1b[_0x5dbf('0x16')](0x194);}return _0x15a790;};}function handleError(_0x232c77,_0x3f9e60){_0x3f9e60=_0x3f9e60||0x1f4;return function(_0x407741){logger[_0x5dbf('0x23')](_0x407741[_0x5dbf('0x24')]);if(_0x407741[_0x5dbf('0x25')]){delete _0x407741[_0x5dbf('0x25')];}_0x232c77[_0x5dbf('0x17')](_0x3f9e60)[_0x5dbf('0x26')](_0x407741);};}exports[_0x5dbf('0x27')]=function(_0x471027,_0x21cd00){var _0x5768b7={},_0x2f71eb={},_0x24dc99={'count':0x0,'rows':[]};var _0xc4748=_[_0x5dbf('0x28')](db[_0x5dbf('0x29')][_0x5dbf('0x2a')],function(_0x2a65c5){return{'name':_0x2a65c5[_0x5dbf('0x2b')],'type':_0x2a65c5[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x2f71eb[_0x5dbf('0x2e')]=_['map'](_0xc4748,'name');_0x2f71eb[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x471027[_0x5dbf('0x2f')]);_0x2f71eb[_0x5dbf('0x31')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],_0x2f71eb['query']);_0x5768b7[_0x5dbf('0x33')]=_[_0x5dbf('0x32')](_0x2f71eb['model'],qs[_0x5dbf('0x34')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x5768b7[_0x5dbf('0x33')]=_0x5768b7[_0x5dbf('0x33')]['length']?_0x5768b7[_0x5dbf('0x33')]:_0x2f71eb[_0x5dbf('0x2e')];if(!_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x5768b7['limit']=qs[_0x5dbf('0x37')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x37')]);_0x5768b7[_0x5dbf('0x19')]=qs['offset'](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x19')]);}_0x5768b7[_0x5dbf('0x38')]=qs[_0x5dbf('0x39')](_0x471027[_0x5dbf('0x2f')][_0x5dbf('0x39')]);_0x5768b7[_0x5dbf('0x3a')]=qs[_0x5dbf('0x31')](_[_0x5dbf('0x3b')](_0x471027[_0x5dbf('0x2f')],_0x2f71eb[_0x5dbf('0x31')]),_0xc4748);if(_0x471027['query'][_0x5dbf('0x3c')]){_0x5768b7[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x5768b7['where'],{'$or':_[_0x5dbf('0x28')](_0xc4748,function(_0x43954b){if(_0x43954b[_0x5dbf('0x2c')]!=='VIRTUAL'){var _0x444814={};_0x444814[_0x43954b[_0x5dbf('0x25')]]={'$like':'%'+_0x471027[_0x5dbf('0x2f')]['filter']+'%'};return _0x444814;}})});}_0x5768b7=_[_0x5dbf('0x3d')]({},_0x5768b7,_0x471027[_0x5dbf('0x3e')]);var _0x2ac162={'where':_0x5768b7[_0x5dbf('0x3a')]};return db[_0x5dbf('0x29')][_0x5dbf('0x1b')](_0x2ac162)[_0x5dbf('0x20')](function(_0x2ed355){_0x24dc99['count']=_0x2ed355;if(_0x471027['query']['includeAll']){_0x5768b7['include']=[{'all':!![]}];}return db[_0x5dbf('0x29')][_0x5dbf('0x3f')](_0x5768b7);})['then'](function(_0x3ef0eb){_0x24dc99[_0x5dbf('0x40')]=_0x3ef0eb;return _0x24dc99;})['then'](respondWithFilteredResult(_0x21cd00,_0x5768b7))[_0x5dbf('0x41')](handleError(_0x21cd00,null));};exports[_0x5dbf('0x42')]=function(_0x2ee717,_0x2ee6b9){var _0x21ae10={'raw':!![],'where':{'id':_0x2ee717[_0x5dbf('0x43')]['id']}},_0x7c390d={};_0x7c390d[_0x5dbf('0x2e')]=_[_0x5dbf('0x30')](db[_0x5dbf('0x29')]['rawAttributes']);_0x7c390d[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x2ee717[_0x5dbf('0x2f')]);_0x7c390d['filters']=_[_0x5dbf('0x32')](_0x7c390d[_0x5dbf('0x2e')],_0x7c390d[_0x5dbf('0x2f')]);_0x21ae10[_0x5dbf('0x33')]=_['intersection'](_0x7c390d[_0x5dbf('0x2e')],qs['fields'](_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x34')]));_0x21ae10[_0x5dbf('0x33')]=_0x21ae10[_0x5dbf('0x33')]['length']?_0x21ae10['attributes']:_0x7c390d[_0x5dbf('0x2e')];if(_0x2ee717[_0x5dbf('0x2f')][_0x5dbf('0x44')]){_0x21ae10['include']=[{'all':!![]}];}_0x21ae10=_[_0x5dbf('0x3d')]({},_0x21ae10,_0x2ee717['options']);return db['DeskField']['find'](_0x21ae10)['then'](handleEntityNotFound(_0x2ee6b9,null))[_0x5dbf('0x20')](respondWithResult(_0x2ee6b9,null))[_0x5dbf('0x41')](handleError(_0x2ee6b9,null));};exports['create']=function(_0x47063d,_0x3ba5cb){return db['DeskField'][_0x5dbf('0x45')](_0x47063d[_0x5dbf('0x46')],{})['then'](respondWithResult(_0x3ba5cb,0xc9))[_0x5dbf('0x41')](handleError(_0x3ba5cb,null));};exports['update']=function(_0x5ab862,_0x337897){if(_0x5ab862[_0x5dbf('0x46')]['id']){delete _0x5ab862[_0x5dbf('0x46')]['id'];}return db['DeskField']['find']({'where':{'id':_0x5ab862[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x337897,null))[_0x5dbf('0x20')](saveUpdates(_0x5ab862[_0x5dbf('0x46')],null))[_0x5dbf('0x20')](respondWithResult(_0x337897,null))[_0x5dbf('0x41')](handleError(_0x337897,null));};exports[_0x5dbf('0x21')]=function(_0x319906,_0x4bc7eb){return db[_0x5dbf('0x29')][_0x5dbf('0x47')]({'where':{'id':_0x319906[_0x5dbf('0x43')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x4bc7eb,null))[_0x5dbf('0x20')](removeEntity(_0x4bc7eb,null))[_0x5dbf('0x41')](handleError(_0x4bc7eb,null));}; \ No newline at end of file +var _0x1fee=['pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','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/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','update','then','destroy','error','stack','name','map','DeskField','rawAttributes','fieldName','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x760a23,_0x43352a){var _0x5ef632=function(_0x552402){while(--_0x552402){_0x760a23['push'](_0x760a23['shift']());}};_0x5ef632(++_0x43352a);}(_0x1fee,0x1de));var _0xe1fe=function(_0x4b3a11,_0x488bb2){_0x4b3a11=_0x4b3a11-0x0;var _0x32960d=_0x1fee[_0x4b3a11];return _0x32960d;};'use strict';var emlformat=require(_0xe1fe('0x0'));var rimraf=require(_0xe1fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1fe('0x2'));var rp=require(_0xe1fe('0x3'));var moment=require(_0xe1fe('0x4'));var BPromise=require(_0xe1fe('0x5'));var Mustache=require(_0xe1fe('0x6'));var util=require(_0xe1fe('0x7'));var path=require('path');var sox=require(_0xe1fe('0x8'));var csv=require(_0xe1fe('0x9'));var ejs=require(_0xe1fe('0xa'));var fs=require('fs');var fs_extra=require(_0xe1fe('0xb'));var _=require(_0xe1fe('0xc'));var squel=require(_0xe1fe('0xd'));var crypto=require(_0xe1fe('0xe'));var jsforce=require(_0xe1fe('0xf'));var deskjs=require(_0xe1fe('0x10'));var toCsv=require(_0xe1fe('0x9'));var querystring=require(_0xe1fe('0x11'));var Papa=require(_0xe1fe('0x12'));var Redis=require(_0xe1fe('0x13'));var authService=require(_0xe1fe('0x14'));var qs=require(_0xe1fe('0x15'));var as=require(_0xe1fe('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1fe('0x17'))('api');var utils=require(_0xe1fe('0x18'));var config=require(_0xe1fe('0x19'));var licenseUtil=require(_0xe1fe('0x1a'));var db=require(_0xe1fe('0x1b'))['db'];function respondWithStatusCode(_0x45ad5a,_0x31692a){_0x31692a=_0x31692a||0xcc;return function(_0x519ee3){if(_0x519ee3){return _0x45ad5a[_0xe1fe('0x1c')](_0x31692a);}return _0x45ad5a['status'](_0x31692a)[_0xe1fe('0x1d')]();};}function respondWithResult(_0x5cdb67,_0x2cd710){_0x2cd710=_0x2cd710||0xc8;return function(_0x2063e1){if(_0x2063e1){return _0x5cdb67['status'](_0x2cd710)[_0xe1fe('0x1e')](_0x2063e1);}};}function respondWithFilteredResult(_0x4c76e9,_0x3c28f1){return function(_0x49de71){if(_0x49de71){var _0x41dacd=typeof _0x3c28f1[_0xe1fe('0x1f')]===_0xe1fe('0x20')&&typeof _0x3c28f1[_0xe1fe('0x21')]==='undefined';var _0x527fc4=_0x49de71['count'];var _0x311eec=_0x41dacd?0x0:_0x3c28f1[_0xe1fe('0x1f')];var _0x128f3e=_0x41dacd?_0x49de71[_0xe1fe('0x22')]:_0x3c28f1[_0xe1fe('0x1f')]+_0x3c28f1[_0xe1fe('0x21')];var _0x1d277a;if(_0x128f3e>=_0x527fc4){_0x128f3e=_0x527fc4;_0x1d277a=0xc8;}else{_0x1d277a=0xce;}_0x4c76e9[_0xe1fe('0x23')](_0x1d277a);return _0x4c76e9[_0xe1fe('0x24')](_0xe1fe('0x25'),_0x311eec+'-'+_0x128f3e+'/'+_0x527fc4)[_0xe1fe('0x1e')](_0x49de71);}return null;};}function patchUpdates(_0x326177){return function(_0x3f0f20){try{jsonpatch['apply'](_0x3f0f20,_0x326177,!![]);}catch(_0x51f7ab){return BPromise[_0xe1fe('0x26')](_0x51f7ab);}return _0x3f0f20['save']();};}function saveUpdates(_0x3d5b34,_0x12d507){return function(_0xd55d41){if(_0xd55d41){return _0xd55d41[_0xe1fe('0x27')](_0x3d5b34)[_0xe1fe('0x28')](function(_0x2b7e05){return _0x2b7e05;});}return null;};}function removeEntity(_0x237cae,_0x519402){return function(_0x2aefe6){if(_0x2aefe6){return _0x2aefe6[_0xe1fe('0x29')]()['then'](function(){_0x237cae[_0xe1fe('0x23')](0xcc)[_0xe1fe('0x1d')]();});}};}function handleEntityNotFound(_0x1ebd78,_0x129e28){return function(_0x159918){if(!_0x159918){_0x1ebd78[_0xe1fe('0x1c')](0x194);}return _0x159918;};}function handleError(_0x308944,_0x388393){_0x388393=_0x388393||0x1f4;return function(_0x58bcd0){logger[_0xe1fe('0x2a')](_0x58bcd0[_0xe1fe('0x2b')]);if(_0x58bcd0[_0xe1fe('0x2c')]){delete _0x58bcd0[_0xe1fe('0x2c')];}_0x308944['status'](_0x388393)['send'](_0x58bcd0);};}exports['index']=function(_0x25f941,_0x1fc946){var _0xea7729={},_0x14f3c9={},_0x449e72={'count':0x0,'rows':[]};var _0x5b3ca8=_[_0xe1fe('0x2d')](db[_0xe1fe('0x2e')][_0xe1fe('0x2f')],function(_0x2ad82d){return{'name':_0x2ad82d[_0xe1fe('0x30')],'type':_0x2ad82d['type']['key']};});_0x14f3c9[_0xe1fe('0x31')]=_[_0xe1fe('0x2d')](_0x5b3ca8,_0xe1fe('0x2c'));_0x14f3c9['query']=_[_0xe1fe('0x32')](_0x25f941[_0xe1fe('0x33')]);_0x14f3c9[_0xe1fe('0x34')]=_['intersection'](_0x14f3c9['model'],_0x14f3c9[_0xe1fe('0x33')]);_0xea7729[_0xe1fe('0x35')]=_['intersection'](_0x14f3c9[_0xe1fe('0x31')],qs[_0xe1fe('0x36')](_0x25f941['query'][_0xe1fe('0x36')]));_0xea7729['attributes']=_0xea7729['attributes'][_0xe1fe('0x37')]?_0xea7729[_0xe1fe('0x35')]:_0x14f3c9[_0xe1fe('0x31')];if(!_0x25f941[_0xe1fe('0x33')][_0xe1fe('0x38')](_0xe1fe('0x39'))){_0xea7729[_0xe1fe('0x21')]=qs[_0xe1fe('0x21')](_0x25f941['query'][_0xe1fe('0x21')]);_0xea7729[_0xe1fe('0x1f')]=qs[_0xe1fe('0x1f')](_0x25f941[_0xe1fe('0x33')][_0xe1fe('0x1f')]);}_0xea7729[_0xe1fe('0x3a')]=qs[_0xe1fe('0x3b')](_0x25f941[_0xe1fe('0x33')][_0xe1fe('0x3b')]);_0xea7729[_0xe1fe('0x3c')]=qs[_0xe1fe('0x34')](_[_0xe1fe('0x3d')](_0x25f941[_0xe1fe('0x33')],_0x14f3c9[_0xe1fe('0x34')]),_0x5b3ca8);if(_0x25f941[_0xe1fe('0x33')][_0xe1fe('0x3e')]){_0xea7729[_0xe1fe('0x3c')]=_[_0xe1fe('0x3f')](_0xea7729['where'],{'$or':_['map'](_0x5b3ca8,function(_0x1747ec){if(_0x1747ec[_0xe1fe('0x40')]!==_0xe1fe('0x41')){var _0x367e5e={};_0x367e5e[_0x1747ec[_0xe1fe('0x2c')]]={'$like':'%'+_0x25f941['query'][_0xe1fe('0x3e')]+'%'};return _0x367e5e;}})});}_0xea7729=_[_0xe1fe('0x3f')]({},_0xea7729,_0x25f941['options']);var _0x35dc0d={'where':_0xea7729[_0xe1fe('0x3c')]};return db[_0xe1fe('0x2e')][_0xe1fe('0x22')](_0x35dc0d)[_0xe1fe('0x28')](function(_0x55bce9){_0x449e72[_0xe1fe('0x22')]=_0x55bce9;if(_0x25f941[_0xe1fe('0x33')][_0xe1fe('0x42')]){_0xea7729[_0xe1fe('0x43')]=[{'all':!![]}];}return db[_0xe1fe('0x2e')][_0xe1fe('0x44')](_0xea7729);})[_0xe1fe('0x28')](function(_0x126e3e){_0x449e72[_0xe1fe('0x45')]=_0x126e3e;return _0x449e72;})[_0xe1fe('0x28')](respondWithFilteredResult(_0x1fc946,_0xea7729))[_0xe1fe('0x46')](handleError(_0x1fc946,null));};exports[_0xe1fe('0x47')]=function(_0x314bda,_0x16de55){var _0x45c229={'raw':!![],'where':{'id':_0x314bda[_0xe1fe('0x48')]['id']}},_0x4bb7bf={};_0x4bb7bf[_0xe1fe('0x31')]=_[_0xe1fe('0x32')](db['DeskField'][_0xe1fe('0x2f')]);_0x4bb7bf[_0xe1fe('0x33')]=_[_0xe1fe('0x32')](_0x314bda[_0xe1fe('0x33')]);_0x4bb7bf[_0xe1fe('0x34')]=_['intersection'](_0x4bb7bf[_0xe1fe('0x31')],_0x4bb7bf[_0xe1fe('0x33')]);_0x45c229[_0xe1fe('0x35')]=_['intersection'](_0x4bb7bf[_0xe1fe('0x31')],qs[_0xe1fe('0x36')](_0x314bda[_0xe1fe('0x33')][_0xe1fe('0x36')]));_0x45c229[_0xe1fe('0x35')]=_0x45c229[_0xe1fe('0x35')]['length']?_0x45c229[_0xe1fe('0x35')]:_0x4bb7bf[_0xe1fe('0x31')];if(_0x314bda[_0xe1fe('0x33')][_0xe1fe('0x42')]){_0x45c229['include']=[{'all':!![]}];}_0x45c229=_['merge']({},_0x45c229,_0x314bda[_0xe1fe('0x49')]);return db[_0xe1fe('0x2e')]['find'](_0x45c229)[_0xe1fe('0x28')](handleEntityNotFound(_0x16de55,null))['then'](respondWithResult(_0x16de55,null))['catch'](handleError(_0x16de55,null));};exports[_0xe1fe('0x4a')]=function(_0x2546f6,_0xefe0a9){return db[_0xe1fe('0x2e')][_0xe1fe('0x4a')](_0x2546f6['body'],{})[_0xe1fe('0x28')](respondWithResult(_0xefe0a9,0xc9))[_0xe1fe('0x46')](handleError(_0xefe0a9,null));};exports[_0xe1fe('0x27')]=function(_0x4bafba,_0x3a7345){if(_0x4bafba['body']['id']){delete _0x4bafba[_0xe1fe('0x4b')]['id'];}return db[_0xe1fe('0x2e')][_0xe1fe('0x4c')]({'where':{'id':_0x4bafba[_0xe1fe('0x48')]['id']}})[_0xe1fe('0x28')](handleEntityNotFound(_0x3a7345,null))[_0xe1fe('0x28')](saveUpdates(_0x4bafba['body'],null))['then'](respondWithResult(_0x3a7345,null))[_0xe1fe('0x46')](handleError(_0x3a7345,null));};exports[_0xe1fe('0x29')]=function(_0x3ae384,_0x361683){return db[_0xe1fe('0x2e')]['find']({'where':{'id':_0x3ae384[_0xe1fe('0x48')]['id']}})['then'](handleEntityNotFound(_0x361683,null))[_0xe1fe('0x28')](removeEntity(_0x361683,null))['catch'](handleError(_0x361683,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index f883306..06747f5 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 _0xe8d0=['exports','DeskField','idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x25f37d,_0xb31d3a){var _0x4ef65d=function(_0xd256b3){while(--_0xd256b3){_0x25f37d['push'](_0x25f37d['shift']());}};_0x4ef65d(++_0xb31d3a);}(_0xe8d0,0x19e));var _0x0e8d=function(_0x2e2494,_0x5d0cbf){_0x2e2494=_0x2e2494-0x0;var _0x499ce3=_0xe8d0[_0x2e2494];return _0x499ce3;};'use strict';var _=require(_0x0e8d('0x0'));var util=require(_0x0e8d('0x1'));var logger=require(_0x0e8d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0e8d('0x3'));var rp=require(_0x0e8d('0x4'));var fs=require('fs');var path=require(_0x0e8d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x0e8d('0x6')]=function(_0x3c7da3,_0x14eb96){return _0x3c7da3['define'](_0x0e8d('0x7'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x0e8d('0x8'),_0x0e8d('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x35fb=['idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','DeskField','int_desk_fields'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x35fb,0x13a));var _0xb35f=function(_0x11f5ff,_0xa0ef18){_0x11f5ff=_0x11f5ff-0x0;var _0x46eefb=_0x35fb[_0x11f5ff];return _0x46eefb;};'use strict';var _=require('lodash');var util=require(_0xb35f('0x0'));var logger=require(_0xb35f('0x1'))(_0xb35f('0x2'));var moment=require(_0xb35f('0x3'));var BPromise=require(_0xb35f('0x4'));var rp=require(_0xb35f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb35f('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xb35f('0x7')]=function(_0x5eff93,_0x2efd1c){return _0x5eff93[_0xb35f('0x8')](_0xb35f('0x9'),attributes,{'tableName':_0xb35f('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xb35f('0xb'),_0xb35f('0xc')],'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 e2ea35d..7c287e5 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 _0x82b4=['client','request','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x82b4,0x187));var _0x482b=function(_0x2a75d5,_0x4219ee){_0x2a75d5=_0x2a75d5-0x0;var _0x100f64=_0x82b4[_0x2a75d5];return _0x100f64;};'use strict';var _=require('lodash');var util=require(_0x482b('0x0'));var moment=require('moment');var BPromise=require(_0x482b('0x1'));var rs=require(_0x482b('0x2'));var fs=require('fs');var Redis=require(_0x482b('0x3'));var db=require(_0x482b('0x4'))['db'];var utils=require(_0x482b('0x5'));var logger=require(_0x482b('0x6'))(_0x482b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x482b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254367,_0x1df6d7,_0x5ddfdd){return new BPromise(function(_0xfa9567,_0x131a10){return client[_0x482b('0x9')](_0x254367,_0x5ddfdd)['then'](function(_0x35ccbe){logger[_0x482b('0xa')](_0x482b('0xb'),_0x1df6d7,'request\x20sent');logger[_0x482b('0xc')](_0x482b('0xd'),_0x1df6d7,'request\x20sent',JSON['stringify'](_0x35ccbe));if(_0x35ccbe[_0x482b('0xe')]){if(_0x35ccbe[_0x482b('0xe')][_0x482b('0xf')]===0x1f4){logger[_0x482b('0xe')](_0x482b('0xb'),_0x1df6d7,_0x35ccbe[_0x482b('0xe')][_0x482b('0x10')]);return _0x131a10(_0x35ccbe['error'][_0x482b('0x10')]);}logger['error'](_0x482b('0xb'),_0x1df6d7,_0x35ccbe[_0x482b('0xe')][_0x482b('0x10')]);return _0xfa9567(_0x35ccbe['error'][_0x482b('0x10')]);}else{logger['info'](_0x482b('0xb'),_0x1df6d7,_0x482b('0x11'));_0xfa9567(_0x35ccbe['result'][_0x482b('0x10')]);}})[_0x482b('0x12')](function(_0x5b6d60){logger[_0x482b('0xe')](_0x482b('0xb'),_0x1df6d7,_0x5b6d60);_0x131a10(_0x5b6d60);});});} \ No newline at end of file +var _0x4ca4=['request','then','info','DeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http'];(function(_0x1a8040,_0x93074a){var _0xec59e0=function(_0xbf387e){while(--_0xbf387e){_0x1a8040['push'](_0x1a8040['shift']());}};_0xec59e0(++_0x93074a);}(_0x4ca4,0x11c));var _0x44ca=function(_0xcb9a49,_0x2bb75a){_0xcb9a49=_0xcb9a49-0x0;var _0x43d838=_0x4ca4[_0xcb9a49];return _0x43d838;};'use strict';var _=require(_0x44ca('0x0'));var util=require(_0x44ca('0x1'));var moment=require(_0x44ca('0x2'));var BPromise=require(_0x44ca('0x3'));var rs=require(_0x44ca('0x4'));var fs=require('fs');var Redis=require(_0x44ca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x44ca('0x6'));var logger=require(_0x44ca('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x44ca('0x8')][_0x44ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45b6d6,_0x19f069,_0xc3881e){return new BPromise(function(_0x214851,_0x4d0f78){return client[_0x44ca('0xa')](_0x45b6d6,_0xc3881e)[_0x44ca('0xb')](function(_0x5f0260){logger[_0x44ca('0xc')](_0x44ca('0xd'),_0x19f069,'request\x20sent');logger[_0x44ca('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x19f069,_0x44ca('0xf'),JSON[_0x44ca('0x10')](_0x5f0260));if(_0x5f0260[_0x44ca('0x11')]){if(_0x5f0260[_0x44ca('0x11')][_0x44ca('0x12')]===0x1f4){logger[_0x44ca('0x11')](_0x44ca('0xd'),_0x19f069,_0x5f0260['error'][_0x44ca('0x13')]);return _0x4d0f78(_0x5f0260['error'][_0x44ca('0x13')]);}logger['error']('DeskField,\x20%s,\x20%s',_0x19f069,_0x5f0260['error']['message']);return _0x214851(_0x5f0260[_0x44ca('0x11')]['message']);}else{logger[_0x44ca('0xc')](_0x44ca('0xd'),_0x19f069,_0x44ca('0xf'));_0x214851(_0x5f0260['result'][_0x44ca('0x13')]);}})[_0x44ca('0x14')](function(_0x2259d5){logger['error']('DeskField,\x20%s,\x20%s',_0x19f069,_0x2259d5);_0x4d0f78(_0x2259d5);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 140e7fb..3516bec 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 _0x4abd=['isAuthenticated','/:id/configurations','getConfigurations','post','create','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/:id'];(function(_0xf405ad,_0x1afcdf){var _0x45c5a7=function(_0x4d32df){while(--_0x4d32df){_0xf405ad['push'](_0xf405ad['shift']());}};_0x45c5a7(++_0x1afcdf);}(_0x4abd,0xce));var _0xd4ab=function(_0x368fc3,_0x2b7c2c){_0x368fc3=_0x368fc3-0x0;var _0x1fa4b2=_0x4abd[_0x368fc3];return _0x1fa4b2;};'use strict';var multer=require(_0xd4ab('0x0'));var util=require(_0xd4ab('0x1'));var path=require(_0xd4ab('0x2'));var timeout=require('connect-timeout');var express=require(_0xd4ab('0x3'));var router=express[_0xd4ab('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd4ab('0x5'));var interaction=require(_0xd4ab('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd4ab('0x7')]);router[_0xd4ab('0x8')](_0xd4ab('0x9'),auth[_0xd4ab('0xa')](),controller['show']);router['get'](_0xd4ab('0xb'),auth[_0xd4ab('0xa')](),controller[_0xd4ab('0xc')]);router[_0xd4ab('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xd4ab('0xd')]('/',auth[_0xd4ab('0xa')](),controller[_0xd4ab('0xe')]);router[_0xd4ab('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0xd4ab('0x9'),auth[_0xd4ab('0xa')](),controller[_0xd4ab('0xf')]);router[_0xd4ab('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd4ab('0x11')]=router; \ No newline at end of file +var _0x1bff=['getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x56aa66,_0x1ddf52){var _0xeba9ff=function(_0x5467b5){while(--_0x5467b5){_0x56aa66['push'](_0x56aa66['shift']());}};_0xeba9ff(++_0x1ddf52);}(_0x1bff,0x93));var _0xf1bf=function(_0x1e1020,_0xd64a27){_0x1e1020=_0x1e1020-0x0;var _0x464719=_0x1bff[_0x1e1020];return _0x464719;};'use strict';var multer=require(_0xf1bf('0x0'));var util=require(_0xf1bf('0x1'));var path=require(_0xf1bf('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1bf('0x3'));var router=express['Router']();var fs_extra=require(_0xf1bf('0x4'));var auth=require(_0xf1bf('0x5'));var interaction=require(_0xf1bf('0x6'));var config=require(_0xf1bf('0x7'));var controller=require('./intDynamics365Account.controller');router[_0xf1bf('0x8')]('/',auth[_0xf1bf('0x9')](),controller[_0xf1bf('0xa')]);router[_0xf1bf('0x8')](_0xf1bf('0xb'),auth[_0xf1bf('0x9')](),controller[_0xf1bf('0xc')]);router[_0xf1bf('0x8')](_0xf1bf('0xd'),auth['isAuthenticated'](),controller[_0xf1bf('0xe')]);router['get'](_0xf1bf('0xf'),auth[_0xf1bf('0x9')](),controller[_0xf1bf('0x10')]);router[_0xf1bf('0x11')]('/',auth[_0xf1bf('0x9')](),controller[_0xf1bf('0x12')]);router[_0xf1bf('0x11')](_0xf1bf('0xd'),auth['isAuthenticated'](),controller[_0xf1bf('0x13')]);router[_0xf1bf('0x14')](_0xf1bf('0xb'),auth[_0xf1bf('0x9')](),controller[_0xf1bf('0x15')]);router[_0xf1bf('0x16')](_0xf1bf('0xb'),auth[_0xf1bf('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index ff5ba57..29f0934 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 _0x10dc=['exports','STRING','BOOLEAN','sequelize'];(function(_0x5e201a,_0x5dc272){var _0x59da82=function(_0x4bfb47){while(--_0x4bfb47){_0x5e201a['push'](_0x5e201a['shift']());}};_0x59da82(++_0x5dc272);}(_0x10dc,0x107));var _0xc10d=function(_0x2f2cb9,_0x6e0d62){_0x2f2cb9=_0x2f2cb9-0x0;var _0x15c9c0=_0x10dc[_0x2f2cb9];return _0x15c9c0;};'use strict';var Sequelize=require(_0xc10d('0x0'));module[_0xc10d('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc10d('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc10d('0x2')]},'tenantId':{'type':Sequelize[_0xc10d('0x2')]},'clientId':{'type':Sequelize[_0xc10d('0x2')]},'clientSecret':{'type':Sequelize[_0xc10d('0x2')]},'serverUrl':{'type':Sequelize[_0xc10d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc10d('0x2')]},'modernAuthentication':{'type':Sequelize[_0xc10d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb091=['exports','STRING'];(function(_0x2898cb,_0x1b2bad){var _0x3539b4=function(_0x5aba97){while(--_0x5aba97){_0x2898cb['push'](_0x2898cb['shift']());}};_0x3539b4(++_0x1b2bad);}(_0xb091,0x16e));var _0x1b09=function(_0x3ddf03,_0x3a5f8f){_0x3ddf03=_0x3ddf03-0x0;var _0x11b876=_0xb091[_0x3ddf03];return _0x11b876;};'use strict';var Sequelize=require('sequelize');module[_0x1b09('0x0')]={'name':{'type':Sequelize[_0x1b09('0x1')]},'username':{'type':Sequelize[_0x1b09('0x1')]},'password':{'type':Sequelize[_0x1b09('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x1b09('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1b09('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1b09('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index bdc8268..71445e2 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 _0xa01c=['exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','error','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','then','destroy','end','name','send','index','map','Dynamics365Account','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','update','getConfigurations','findOne','Dynamics365Configuration','sort','addConfiguration','AccountId','getSubjects','channel','Descriptions','Dynamics365Field','Subjects','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','Incident','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','entityimage_timestamp','entityimage_url'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xa01c,0x1c8));var _0xca01=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa01c[_0x14add3];return _0x4a174f;};'use strict';var rp=require('request-promise');var util=require(_0xca01('0x0'));var _=require(_0xca01('0x1'));var qs=require(_0xca01('0x2'));var logger=require(_0xca01('0x3'))(_0xca01('0x4'));var db=require(_0xca01('0x5'))['db'];var integrations=require(_0xca01('0x6'));function respondWithResult(_0x2b7be1,_0x14d4f6){_0x14d4f6=_0x14d4f6||0xc8;return function(_0x31c20f){if(_0x31c20f){return _0x2b7be1[_0xca01('0x7')](_0x14d4f6)[_0xca01('0x8')](_0x31c20f);}};}function respondWithFilteredResult(_0x1033a4,_0x1c0d7a){return function(_0x4cd17c){if(_0x4cd17c){var _0x174a7a=typeof _0x1c0d7a['offset']===_0xca01('0x9')&&typeof _0x1c0d7a[_0xca01('0xa')]==='undefined';var _0x259433=_0x4cd17c[_0xca01('0xb')];var _0x20d72e=_0x174a7a?0x0:_0x1c0d7a[_0xca01('0xc')];var _0x5559e6=_0x174a7a?_0x4cd17c[_0xca01('0xb')]:_0x1c0d7a['offset']+_0x1c0d7a['limit'];var _0x3753c3;if(_0x5559e6>=_0x259433){_0x5559e6=_0x259433;_0x3753c3=0xc8;}else{_0x3753c3=0xce;}_0x1033a4['status'](_0x3753c3);return _0x1033a4[_0xca01('0xd')]('Content-Range',_0x20d72e+'-'+_0x5559e6+'/'+_0x259433)[_0xca01('0x8')](_0x4cd17c);}return null;};}function saveUpdates(_0x522c96){return function(_0x4e1cdc){if(_0x4e1cdc){return _0x4e1cdc['update'](_0x522c96)[_0xca01('0xe')](function(_0x4f6115){return _0x4f6115;});}return null;};}function removeEntity(_0x3dd0c2){return function(_0x31f671){if(_0x31f671){return _0x31f671[_0xca01('0xf')]()['then'](function(){_0x3dd0c2[_0xca01('0x7')](0xcc)[_0xca01('0x10')]();});}};}function handleEntityNotFound(_0x2417b0){return function(_0x1f000a){if(!_0x1f000a){_0x2417b0['sendStatus'](0x194);}return _0x1f000a;};}function handleError(_0x5924e2,_0x40636e){_0x40636e=_0x40636e||0x1f4;return function(_0x50b059){logger['error'](_0x50b059['stack']);if(_0x50b059[_0xca01('0x11')]){delete _0x50b059[_0xca01('0x11')];}_0x5924e2[_0xca01('0x7')](_0x40636e)[_0xca01('0x12')](_0x50b059);};}exports[_0xca01('0x13')]=function(_0x327ce1,_0xbafcf0){var _0xb73249={},_0x2f5cb0={},_0x13c9cb={'count':0x0,'rows':[]};var _0xedbf56=_[_0xca01('0x14')](db[_0xca01('0x15')]['rawAttributes'],function(_0x25a6ff){return{'name':_0x25a6ff[_0xca01('0x16')],'type':_0x25a6ff[_0xca01('0x17')][_0xca01('0x18')]};});_0x2f5cb0[_0xca01('0x19')]=_[_0xca01('0x14')](_0xedbf56,'name');_0x2f5cb0[_0xca01('0x1a')]=_['keys'](_0x327ce1[_0xca01('0x1a')]);_0x2f5cb0[_0xca01('0x1b')]=_[_0xca01('0x1c')](_0x2f5cb0[_0xca01('0x19')],_0x2f5cb0[_0xca01('0x1a')]);_0xb73249['attributes']=_['intersection'](_0x2f5cb0[_0xca01('0x19')],qs['fields'](_0x327ce1[_0xca01('0x1a')][_0xca01('0x1d')]));_0xb73249[_0xca01('0x1e')]=_0xb73249[_0xca01('0x1e')][_0xca01('0x1f')]?_0xb73249[_0xca01('0x1e')]:_0x2f5cb0[_0xca01('0x19')];if(!_0x327ce1[_0xca01('0x1a')][_0xca01('0x20')](_0xca01('0x21'))){_0xb73249[_0xca01('0xa')]=qs['limit'](_0x327ce1[_0xca01('0x1a')][_0xca01('0xa')]);_0xb73249[_0xca01('0xc')]=qs[_0xca01('0xc')](_0x327ce1[_0xca01('0x1a')][_0xca01('0xc')]);}_0xb73249[_0xca01('0x22')]=qs['sort'](_0x327ce1[_0xca01('0x1a')]['sort']);_0xb73249[_0xca01('0x23')]=qs[_0xca01('0x1b')](_[_0xca01('0x24')](_0x327ce1[_0xca01('0x1a')],_0x2f5cb0[_0xca01('0x1b')]),_0xedbf56);if(_0x327ce1[_0xca01('0x1a')][_0xca01('0x25')]){_0xb73249['where']=_[_0xca01('0x26')](_0xb73249[_0xca01('0x23')],{'$or':_[_0xca01('0x14')](_0xedbf56,function(_0x51c771){if(_0x51c771[_0xca01('0x17')]!==_0xca01('0x27')){var _0x16d6c5={};_0x16d6c5[_0x51c771[_0xca01('0x11')]]={'$like':'%'+_0x327ce1[_0xca01('0x1a')][_0xca01('0x25')]+'%'};return _0x16d6c5;}})});}_0xb73249=_['merge']({},_0xb73249,_0x327ce1[_0xca01('0x28')]);var _0x2daa84={'where':_0xb73249['where']};return db[_0xca01('0x15')][_0xca01('0xb')](_0x2daa84)[_0xca01('0xe')](function(_0xcc3d5d){_0x13c9cb[_0xca01('0xb')]=_0xcc3d5d;if(_0x327ce1['query'][_0xca01('0x29')]){_0xb73249[_0xca01('0x2a')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xca01('0x2b')](_0xb73249);})[_0xca01('0xe')](function(_0x2167c6){_0x13c9cb[_0xca01('0x2c')]=_0x2167c6;return _0x13c9cb;})[_0xca01('0xe')](respondWithFilteredResult(_0xbafcf0,_0xb73249))['catch'](handleError(_0xbafcf0,null));};exports['show']=function(_0x205810,_0x184722){var _0x1f36fe={'raw':![],'where':{'id':_0x205810[_0xca01('0x2d')]['id']}},_0x3d194e={};_0x3d194e[_0xca01('0x19')]=_[_0xca01('0x2e')](db[_0xca01('0x15')][_0xca01('0x2f')]);_0x3d194e[_0xca01('0x1a')]=_[_0xca01('0x2e')](_0x205810[_0xca01('0x1a')]);_0x3d194e['filters']=_[_0xca01('0x1c')](_0x3d194e[_0xca01('0x19')],_0x3d194e[_0xca01('0x1a')]);_0x1f36fe[_0xca01('0x1e')]=_[_0xca01('0x1c')](_0x3d194e[_0xca01('0x19')],qs[_0xca01('0x1d')](_0x205810[_0xca01('0x1a')]['fields']));_0x1f36fe['attributes']=_0x1f36fe[_0xca01('0x1e')][_0xca01('0x1f')]?_0x1f36fe[_0xca01('0x1e')]:_0x3d194e[_0xca01('0x19')];if(_0x205810[_0xca01('0x1a')][_0xca01('0x29')]){_0x1f36fe['include']=[{'all':!![]}];}_0x1f36fe=_[_0xca01('0x26')]({},_0x1f36fe,_0x205810[_0xca01('0x28')]);return db[_0xca01('0x15')][_0xca01('0x30')](_0x1f36fe)[_0xca01('0xe')](handleEntityNotFound(_0x184722,null))[_0xca01('0xe')](respondWithResult(_0x184722,null))[_0xca01('0x31')](handleError(_0x184722,null));};exports[_0xca01('0x32')]=function(_0x401abd,_0x25d8c6){return db['Dynamics365Account'][_0xca01('0x32')](_0x401abd[_0xca01('0x33')],{})[_0xca01('0xe')](respondWithResult(_0x25d8c6,0xc9))[_0xca01('0x31')](handleError(_0x25d8c6,null));};exports[_0xca01('0x34')]=function(_0x354ca7,_0x4b3493){if(_0x354ca7[_0xca01('0x33')]['id']){delete _0x354ca7[_0xca01('0x33')]['id'];}return db[_0xca01('0x15')][_0xca01('0x30')]({'where':{'id':_0x354ca7[_0xca01('0x2d')]['id']}})[_0xca01('0xe')](handleEntityNotFound(_0x4b3493,null))[_0xca01('0xe')](saveUpdates(_0x354ca7[_0xca01('0x33')],null))[_0xca01('0xe')](respondWithResult(_0x4b3493,null))[_0xca01('0x31')](handleError(_0x4b3493,null));};exports[_0xca01('0xf')]=function(_0x16ed68,_0x2c68b7){return db[_0xca01('0x15')]['find']({'where':{'id':_0x16ed68[_0xca01('0x2d')]['id']}})[_0xca01('0xe')](handleEntityNotFound(_0x2c68b7,null))[_0xca01('0xe')](removeEntity(_0x2c68b7,null))[_0xca01('0x31')](handleError(_0x2c68b7,null));};exports[_0xca01('0x35')]=function(_0xa9b53,_0x1fce92){var _0x1ffa5f={};var _0xeee1ea={};var _0x282ee4;var _0x85b6ba;return db[_0xca01('0x15')][_0xca01('0x36')]({'where':{'id':_0xa9b53[_0xca01('0x2d')]['id']}})[_0xca01('0xe')](handleEntityNotFound(_0x1fce92,null))[_0xca01('0xe')](function(_0x3da1d8){if(_0x3da1d8){_0x282ee4=_0x3da1d8;_0xeee1ea[_0xca01('0x19')]=_['keys'](db[_0xca01('0x37')][_0xca01('0x2f')]);_0xeee1ea[_0xca01('0x1a')]=_[_0xca01('0x2e')](_0xa9b53[_0xca01('0x1a')]);_0xeee1ea[_0xca01('0x1b')]=_['intersection'](_0xeee1ea['model'],_0xeee1ea[_0xca01('0x1a')]);_0x1ffa5f[_0xca01('0x1e')]=_[_0xca01('0x1c')](_0xeee1ea[_0xca01('0x19')],qs[_0xca01('0x1d')](_0xa9b53[_0xca01('0x1a')]['fields']));_0x1ffa5f[_0xca01('0x1e')]=_0x1ffa5f[_0xca01('0x1e')][_0xca01('0x1f')]?_0x1ffa5f[_0xca01('0x1e')]:_0xeee1ea[_0xca01('0x19')];_0x1ffa5f[_0xca01('0x22')]=qs[_0xca01('0x38')](_0xa9b53[_0xca01('0x1a')]['sort']);_0x1ffa5f[_0xca01('0x23')]=qs[_0xca01('0x1b')](_[_0xca01('0x24')](_0xa9b53[_0xca01('0x1a')],_0xeee1ea[_0xca01('0x1b')]));if(_0xa9b53[_0xca01('0x1a')][_0xca01('0x25')]){_0x1ffa5f['where']=_['merge'](_0x1ffa5f['where'],{'$or':_[_0xca01('0x14')](_0x1ffa5f[_0xca01('0x1e')],function(_0x4b207a){var _0xa05019={};_0xa05019[_0x4b207a]={'$like':'%'+_0xa9b53['query'][_0xca01('0x25')]+'%'};return _0xa05019;})});}_0x1ffa5f=_['merge']({},_0x1ffa5f,_0xa9b53[_0xca01('0x28')]);return _0x282ee4[_0xca01('0x35')](_0x1ffa5f);}})[_0xca01('0xe')](function(_0x55846a){if(_0x55846a){_0x85b6ba=_0x55846a[_0xca01('0x1f')];if(!_0xa9b53['query'][_0xca01('0x20')](_0xca01('0x21'))){_0x1ffa5f['limit']=qs[_0xca01('0xa')](_0xa9b53[_0xca01('0x1a')]['limit']);_0x1ffa5f[_0xca01('0xc')]=qs[_0xca01('0xc')](_0xa9b53['query'][_0xca01('0xc')]);}return _0x282ee4['getConfigurations'](_0x1ffa5f);}})[_0xca01('0xe')](function(_0x3a313b){if(_0x3a313b){return _0x3a313b?{'count':_0x85b6ba,'rows':_0x3a313b}:null;}})['then'](respondWithResult(_0x1fce92,null))[_0xca01('0x31')](handleError(_0x1fce92,null));};exports[_0xca01('0x39')]=function(_0x414357,_0x16ac9f){if(_0x414357[_0xca01('0x33')]['id']){delete _0x414357['body']['id'];}return db[_0xca01('0x15')][_0xca01('0x36')]({'where':{'id':_0x414357[_0xca01('0x2d')]['id']}})[_0xca01('0xe')](handleEntityNotFound(_0x16ac9f,null))[_0xca01('0xe')](function(_0x38a0cb){if(_0x38a0cb){_0x414357[_0xca01('0x33')][_0xca01('0x3a')]=_0x38a0cb['id'];_0x414357[_0xca01('0x33')]['Subjects']=integrations[_0xca01('0x3b')](_0x414357[_0xca01('0x33')][_0xca01('0x3c')],_0x414357[_0xca01('0x33')][_0xca01('0x17')]);_0x414357['body'][_0xca01('0x3d')]=integrations['getDescriptions'](_0x414357[_0xca01('0x33')][_0xca01('0x3c')],_0x414357[_0xca01('0x33')][_0xca01('0x17')]);return db[_0xca01('0x37')][_0xca01('0x32')](_0x414357[_0xca01('0x33')],{'include':[{'model':db[_0xca01('0x3e')],'as':_0xca01('0x3f')},{'model':db[_0xca01('0x3e')],'as':_0xca01('0x3d')}]});}return null;})[_0xca01('0xe')](respondWithResult(_0x16ac9f,null))[_0xca01('0x31')](handleError(_0x16ac9f,null));};function sanitizeRemoteUri(_0x5d283e){var _0x5db55e=_0x5d283e[_0xca01('0x40')](-0x1);if(_0x5db55e==='/')return _0x5d283e[_0xca01('0x41')](0x0,_0x5d283e[_0xca01('0x42')](_0x5db55e));return _0x5d283e;}function getWebApiUrl(_0x2419c6){return util[_0xca01('0x43')](_0xca01('0x44'),_0x2419c6);}exports[_0xca01('0x45')]=function(_0x505bf5,_0x4a9c4b){var _0xbe876f=_0x505bf5[_0xca01('0x1a')][_0xca01('0x46')];var _0x9e9397=_0xbe876f==='incident'?_0xca01('0x47'):'PhoneCall';var _0x2c0598='';var _0x4b9ae8='';var _0x3fc68d='';var _0x3787e0='';var _0x5983f9='';var _0xe0c8d4='';var _0x41e1cf='';var _0x4253a3='';var _0x122b03=['title',_0xca01('0x48'),_0xca01('0x49'),'ownerid',_0xca01('0x4a'),_0xca01('0x4b'),_0xca01('0x4c'),_0xca01('0x4d'),_0xca01('0x4e'),_0xca01('0x4f')];var _0x14fd31=[_0xca01('0x50'),_0xca01('0x51'),_0xca01('0x52'),'billedserviceunits',_0xca01('0x53'),_0xca01('0x54'),'contractdetailidname',_0xca01('0x55'),_0xca01('0x56'),_0xca01('0x57'),_0xca01('0x58'),_0xca01('0x59'),_0xca01('0x5a'),'createdonbehalfbyname',_0xca01('0x5b'),_0xca01('0x5c'),_0xca01('0x5d'),'customeridyominame','emailaddress','entitlementidname',_0xca01('0x5e'),_0xca01('0x5f'),'escalatedon',_0xca01('0x60'),_0xca01('0x61'),_0xca01('0x62'),_0xca01('0x63'),'influencescore',_0xca01('0x64'),'lastonholdtime',_0xca01('0x65'),_0xca01('0x66'),'modifiedbyexternalpartyyominame',_0xca01('0x67'),_0xca01('0x68'),_0xca01('0x69'),'modifiedonbehalfbyname',_0xca01('0x6a'),'msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon',_0xca01('0x6b'),_0xca01('0x6c'),_0xca01('0x6d'),_0xca01('0x6e'),_0xca01('0x6f'),_0xca01('0x70'),_0xca01('0x71'),_0xca01('0x72'),_0xca01('0x73'),_0xca01('0x74'),_0xca01('0x75'),_0xca01('0x76'),_0xca01('0x77'),'responsiblecontactidyominame',_0xca01('0x78'),_0xca01('0x79'),_0xca01('0x7a'),_0xca01('0x7b'),'statecode','statuscode',_0xca01('0x7c'),_0xca01('0x7d'),_0xca01('0x7e'),'transactioncurrencyidname',_0xca01('0x7f'),_0xca01('0x80'),_0xca01('0x81')];var _0x42e28e=_0x122b03[_0xca01('0x82')](_0x14fd31);return db['Dynamics365Account'][_0xca01('0x36')]({'where':{'id':_0x505bf5[_0xca01('0x2d')]['id']},'attributes':['id','username',_0xca01('0x83'),_0xca01('0x84'),_0xca01('0x85'),_0xca01('0x86'),_0xca01('0x87'),_0xca01('0x88')],'include':[{'model':db[_0xca01('0x89')],'as':_0xca01('0x89'),'attributes':['id',_0xca01('0x8a'),_0xca01('0x8b')]}]})[_0xca01('0xe')](handleEntityNotFound(_0x4a9c4b,null))[_0xca01('0xe')](function(_0x38777a){if(_0x38777a){if(_0x38777a[_0xca01('0x88')]){_0x38777a['access_token']=_0x38777a['CloudProvider'][_0xca01('0x8a')];_0x4253a3=sanitizeRemoteUri(_0x38777a[_0xca01('0x89')][_0xca01('0x8b')]);_0x41e1cf=getWebApiUrl(_0x4253a3);return _0x38777a;}_0x4253a3=sanitizeRemoteUri(_0x38777a[_0xca01('0x84')]);_0x41e1cf=getWebApiUrl(_0x4253a3);var _0x2fe904={'method':_0xca01('0x8c'),'uri':_0xca01('0x8d')+_0x38777a[_0xca01('0x85')]+_0xca01('0x8e'),'form':{'client_id':_0x38777a[_0xca01('0x86')],'resource':_0x4253a3,'username':_0x38777a[_0xca01('0x8f')],'password':_0x38777a[_0xca01('0x83')],'grant_type':_0xca01('0x83'),'client_secret':_0x38777a[_0xca01('0x87')]},'json':!![]};return rp(_0x2fe904);}})[_0xca01('0xe')](function(_0x352475){_0xe0c8d4=_0x352475[_0xca01('0x90')];var _0x4ea0f7={'method':_0xca01('0x91'),'uri':encodeURI(_0x41e1cf+_0xca01('0x92')+_0x9e9397+'\x27'),'headers':{'Authorization':_0xca01('0x93')+_0xe0c8d4,'If-None-Match':null,'OData-Version':_0xca01('0x94')},'json':!![]};return rp(_0x4ea0f7);})[_0xca01('0xe')](function(_0x83c0ea){var _0x3c11d1=_0x83c0ea[_0xca01('0x95')][0x0];var _0x59ad10=_0x3c11d1[_0xca01('0x96')];var _0x4d8762={'method':'GET','uri':_0x41e1cf+'EntityDefinitions('+_0x59ad10+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xca01('0x93')+_0xe0c8d4,'If-None-Match':null,'OData-Version':_0xca01('0x94')},'json':!![]};return rp(_0x4d8762);})[_0xca01('0xe')](function(_0x538fe6){_0x2c0598=_0x538fe6;_0x4b9ae8=_0x2c0598[_0xca01('0x97')];_0x4b9ae8=_['remove'](_0x4b9ae8,function(_0x2945c4){return!_0x42e28e[_0xca01('0x98')](_0x2945c4[_0xca01('0x99')]);});var _0x494f95=[];var _0x599ff5=[];_0x4b9ae8[_0xca01('0x9a')](function(_0x4c0b9e){if(_0x4c0b9e[_0xca01('0x9b')]){var _0x1136fe=_0x4c0b9e[_0xca01('0x9b')][_0xca01('0x41')](_0x4c0b9e['@odata.type'][_0xca01('0x42')]('.')+0x1);if(_0x1136fe===_0xca01('0x9c')){_0x494f95[_0xca01('0x9d')](getSelectList(_0x41e1cf,_0xbe876f,_0x599ff5,_0x2c0598[_0xca01('0x96')],_0x4c0b9e[_0xca01('0x96')],_0xe0c8d4));}}});return Promise[_0xca01('0x9e')](_0x494f95);})[_0xca01('0xe')](function(_0x165522){_0x3fc68d=_0x165522[0x0];var _0x1c79b0=[];var _0x44e72c=[];_0x4b9ae8['forEach'](function(_0x92c113){if(!_[_0xca01('0x9f')](_0x92c113[_0xca01('0x9b')])){var _0x491152=_0x92c113['@odata.type'][_0xca01('0x41')](_0x92c113[_0xca01('0x9b')][_0xca01('0x42')]('.')+0x1);if(_0x491152===_0xca01('0xa0')){_0x1c79b0[_0xca01('0x9d')](getBooleanList(_0x41e1cf,_0xbe876f,_0x44e72c,_0x2c0598[_0xca01('0x96')],_0x92c113[_0xca01('0x96')],_0xe0c8d4));}}});return Promise[_0xca01('0x9e')](_0x1c79b0);})['then'](function(_0x145974){_0x3787e0=_0x145974[0x0];var _0x11bf46=[];var _0x5908c6=[];_0x4b9ae8[_0xca01('0x9a')](function(_0x4449a1){if(_0x4449a1[_0xca01('0x9b')]){var _0x3bf5ca=_0x4449a1[_0xca01('0x9b')][_0xca01('0x41')](_0x4449a1[_0xca01('0x9b')][_0xca01('0x42')]('.')+0x1);if(_0x3bf5ca===_0xca01('0xa1')||_0x3bf5ca==='DoubleAttributeMetadata'||_0x3bf5ca==='BigIntAttributeMetadata'||_0x3bf5ca===_0xca01('0xa2')||_0x3bf5ca===_0xca01('0xa3')||_0x3bf5ca==='DateTimeAttributeMetadata'||_0x3bf5ca===_0xca01('0xa4')||_0x3bf5ca==='EntityNameAttributeMetadata'||_0x3bf5ca===_0xca01('0xa5')||_0x3bf5ca===_0xca01('0xa6')){_0x11bf46[_0xca01('0x9d')](getInputList(_0x41e1cf,_0xbe876f,_0x3bf5ca,_0x5908c6,_0x2c0598[_0xca01('0x96')],_0x4449a1[_0xca01('0x96')],_0xe0c8d4));}}});return Promise[_0xca01('0x9e')](_0x11bf46);})[_0xca01('0xe')](function(_0x3113b2){_0x5983f9=_0x3113b2[0x0];var _0x489343=_0x3fc68d['concat'](_0x3787e0)[_0xca01('0x82')](_0x5983f9);var _0x311a38={'count':_0x489343['length'],'rows':_0x489343};return _0x311a38;})[_0xca01('0xe')](respondWithResult(_0x4a9c4b,null))[_0xca01('0x31')](function(_0x427c7c){var _0x4efd8d=_0x505bf5[_0xca01('0x1a')]['test']?0x1f4:_0x427c7c[_0xca01('0xa7')]||0x1f4;logger[_0xca01('0xa8')](_0x427c7c['stack']);delete _0x427c7c[_0xca01('0x11')];if(_0x4efd8d===0x191){_0x4efd8d=0x190;}_0x4a9c4b[_0xca01('0x7')](_0x4efd8d)[_0xca01('0x12')](_0x505bf5[_0xca01('0x1a')]['test']?{'message':_0xca01('0xa9'),'statusCode':_0x427c7c[_0xca01('0xa7')]}:_0x427c7c);});};function getSelectList(_0x51d345,_0x2fbd17,_0x263c63,_0x365a4b,_0x186bc1,_0x18f160){var _0x5b360c={'method':'GET','uri':_0x51d345+'EntityDefinitions('+_0x365a4b+_0xca01('0xaa')+_0x186bc1+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xca01('0xab'),'headers':{'Authorization':_0xca01('0x93')+_0x18f160,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5b360c)[_0xca01('0xe')](function(_0x2aeb07){var _0x47cebe=[];var _0x4dc37e=_0x2aeb07['OptionSet'][_0xca01('0xac')];_0x4dc37e[_0xca01('0x9a')](function(_0x2524c3){_0x47cebe[_0xca01('0x9d')]({'name':_0x2524c3[_0xca01('0xad')][_0xca01('0xae')][_0xca01('0xad')],'value':String(_0x2524c3[_0xca01('0xaf')])});});var _0x18726e={'id':_0x2fbd17+'_'+_0x2aeb07['LogicalName'],'name':_0x2aeb07[_0xca01('0xb0')][_0xca01('0xae')][_0xca01('0xad')],'custom':![],'options':_0x47cebe};_0x263c63[_0xca01('0x9d')](_0x18726e);return _0x263c63;});}function getBooleanList(_0x240cc8,_0x4ccf01,_0xb83ffb,_0x1a8fca,_0x3ae4e0,_0x313d52){var _0x1f5f52={'method':_0xca01('0x91'),'uri':_0x240cc8+_0xca01('0xb1')+_0x1a8fca+_0xca01('0xaa')+_0x3ae4e0+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xca01('0x93')+_0x313d52,'If-None-Match':null,'OData-Version':_0xca01('0x94')},'json':!![]};return rp(_0x1f5f52)['then'](function(_0x91e363){var _0x20706d=[];_0x20706d[_0xca01('0x9d')]({'name':_0x91e363['OptionSet'][_0xca01('0xb2')]['Label'][_0xca01('0xae')][_0xca01('0xad')],'value':_0xca01('0xb3')},{'name':_0x91e363['OptionSet'][_0xca01('0xb4')][_0xca01('0xad')][_0xca01('0xae')][_0xca01('0xad')],'value':_0xca01('0xb5')});var _0x2708d9={'id':_0x4ccf01+'_'+_0x91e363[_0xca01('0x99')],'name':_0x91e363[_0xca01('0xb0')][_0xca01('0xae')]['Label'],'custom':![],'options':_0x20706d};_0xb83ffb[_0xca01('0x9d')](_0x2708d9);return _0xb83ffb;});}function getInputList(_0x30b86a,_0x24cd43,_0xb76340,_0x1ee4a9,_0x4b5d7e,_0xb6762d,_0x37e9fc){var _0x5e5ed0={'method':_0xca01('0x91'),'uri':_0x30b86a+_0xca01('0xb1')+_0x4b5d7e+_0xca01('0xaa')+_0xb6762d+_0xca01('0xb6')+_0xb76340+_0xca01('0xb7'),'headers':{'Authorization':_0xca01('0x93')+_0x37e9fc,'If-None-Match':null,'OData-Version':_0xca01('0x94')},'json':!![]};return rp(_0x5e5ed0)[_0xca01('0xe')](function(_0x252dcb){var _0x4e26b7={'id':_0x24cd43+'_'+_0x252dcb['LogicalName'],'name':_0x252dcb[_0xca01('0xb0')]['UserLocalizedLabel']?_0x252dcb[_0xca01('0xb0')][_0xca01('0xae')][_0xca01('0xad')]:_0x252dcb[_0xca01('0x99')],'custom':![],'options':[]};_0x1ee4a9[_0xca01('0x9d')](_0x4e26b7);return _0x1ee4a9;});} \ No newline at end of file +var _0xbca8=['OptionSet','Options','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','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','show','params','catch','create','body','find','getConfigurations','findOne','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Configuration','Dynamics365Field','Subjects','substring','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','remoteUri','tenantId','clientSecret','CloudProvider','data7','modernAuthentication','access_token','data5','POST','https://login.microsoftonline.com/','/oauth2/token','clientId','username','4.0','value','MetadataId','GET','EntityDefinitions(','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','all','push','lastIndexOf','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','test','statusCode','send',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20'];(function(_0x1bc30d,_0x6faa50){var _0x54e4a3=function(_0x3afb51){while(--_0x3afb51){_0x1bc30d['push'](_0x1bc30d['shift']());}};_0x54e4a3(++_0x6faa50);}(_0xbca8,0xcc));var _0x8bca=function(_0x4bd8de,_0x584bc1){_0x4bd8de=_0x4bd8de-0x0;var _0x489958=_0xbca8[_0x4bd8de];return _0x489958;};'use strict';var rp=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var _=require(_0x8bca('0x2'));var qs=require(_0x8bca('0x3'));var logger=require(_0x8bca('0x4'))('api');var db=require(_0x8bca('0x5'))['db'];var integrations=require(_0x8bca('0x6'));function respondWithResult(_0x34d392,_0x5cafc7){_0x5cafc7=_0x5cafc7||0xc8;return function(_0x4c2ac8){if(_0x4c2ac8){return _0x34d392[_0x8bca('0x7')](_0x5cafc7)[_0x8bca('0x8')](_0x4c2ac8);}};}function respondWithFilteredResult(_0x318474,_0x348ddd){return function(_0x4b3267){if(_0x4b3267){var _0x3fdccf=typeof _0x348ddd[_0x8bca('0x9')]===_0x8bca('0xa')&&typeof _0x348ddd[_0x8bca('0xb')]===_0x8bca('0xa');var _0xe266ca=_0x4b3267[_0x8bca('0xc')];var _0x4ee4a0=_0x3fdccf?0x0:_0x348ddd['offset'];var _0x18c1ca=_0x3fdccf?_0x4b3267[_0x8bca('0xc')]:_0x348ddd['offset']+_0x348ddd['limit'];var _0x31afa0;if(_0x18c1ca>=_0xe266ca){_0x18c1ca=_0xe266ca;_0x31afa0=0xc8;}else{_0x31afa0=0xce;}_0x318474['status'](_0x31afa0);return _0x318474[_0x8bca('0xd')](_0x8bca('0xe'),_0x4ee4a0+'-'+_0x18c1ca+'/'+_0xe266ca)['json'](_0x4b3267);}return null;};}function saveUpdates(_0x62c6d1){return function(_0x1fe1b5){if(_0x1fe1b5){return _0x1fe1b5[_0x8bca('0xf')](_0x62c6d1)[_0x8bca('0x10')](function(_0x5d32dc){return _0x5d32dc;});}return null;};}function removeEntity(_0x4bbf5c){return function(_0x250d09){if(_0x250d09){return _0x250d09['destroy']()[_0x8bca('0x10')](function(){_0x4bbf5c[_0x8bca('0x7')](0xcc)[_0x8bca('0x11')]();});}};}function handleEntityNotFound(_0x2e3633){return function(_0x1c3590){if(!_0x1c3590){_0x2e3633[_0x8bca('0x12')](0x194);}return _0x1c3590;};}function handleError(_0x487305,_0x586eca){_0x586eca=_0x586eca||0x1f4;return function(_0x11037e){logger['error'](_0x11037e[_0x8bca('0x13')]);if(_0x11037e[_0x8bca('0x14')]){delete _0x11037e['name'];}_0x487305['status'](_0x586eca)['send'](_0x11037e);};}exports[_0x8bca('0x15')]=function(_0xcc6ee5,_0x4e9dd3){var _0x1a834c={},_0x599c9e={},_0x47b27c={'count':0x0,'rows':[]};var _0x5e95e4=_[_0x8bca('0x16')](db[_0x8bca('0x17')][_0x8bca('0x18')],function(_0xaaee66){return{'name':_0xaaee66[_0x8bca('0x19')],'type':_0xaaee66[_0x8bca('0x1a')]['key']};});_0x599c9e[_0x8bca('0x1b')]=_[_0x8bca('0x16')](_0x5e95e4,_0x8bca('0x14'));_0x599c9e['query']=_[_0x8bca('0x1c')](_0xcc6ee5['query']);_0x599c9e[_0x8bca('0x1d')]=_['intersection'](_0x599c9e[_0x8bca('0x1b')],_0x599c9e[_0x8bca('0x1e')]);_0x1a834c[_0x8bca('0x1f')]=_[_0x8bca('0x20')](_0x599c9e[_0x8bca('0x1b')],qs[_0x8bca('0x21')](_0xcc6ee5[_0x8bca('0x1e')]['fields']));_0x1a834c['attributes']=_0x1a834c[_0x8bca('0x1f')][_0x8bca('0x22')]?_0x1a834c['attributes']:_0x599c9e[_0x8bca('0x1b')];if(!_0xcc6ee5[_0x8bca('0x1e')][_0x8bca('0x23')](_0x8bca('0x24'))){_0x1a834c[_0x8bca('0xb')]=qs['limit'](_0xcc6ee5[_0x8bca('0x1e')]['limit']);_0x1a834c[_0x8bca('0x9')]=qs['offset'](_0xcc6ee5[_0x8bca('0x1e')][_0x8bca('0x9')]);}_0x1a834c[_0x8bca('0x25')]=qs[_0x8bca('0x26')](_0xcc6ee5['query'][_0x8bca('0x26')]);_0x1a834c[_0x8bca('0x27')]=qs[_0x8bca('0x1d')](_['pick'](_0xcc6ee5['query'],_0x599c9e['filters']),_0x5e95e4);if(_0xcc6ee5[_0x8bca('0x1e')][_0x8bca('0x28')]){_0x1a834c[_0x8bca('0x27')]=_['merge'](_0x1a834c[_0x8bca('0x27')],{'$or':_[_0x8bca('0x16')](_0x5e95e4,function(_0x5d147b){if(_0x5d147b[_0x8bca('0x1a')]!==_0x8bca('0x29')){var _0x21b1f1={};_0x21b1f1[_0x5d147b[_0x8bca('0x14')]]={'$like':'%'+_0xcc6ee5[_0x8bca('0x1e')]['filter']+'%'};return _0x21b1f1;}})});}_0x1a834c=_[_0x8bca('0x2a')]({},_0x1a834c,_0xcc6ee5[_0x8bca('0x2b')]);var _0x462b12={'where':_0x1a834c[_0x8bca('0x27')]};return db[_0x8bca('0x17')]['count'](_0x462b12)[_0x8bca('0x10')](function(_0x5cb82d){_0x47b27c['count']=_0x5cb82d;if(_0xcc6ee5[_0x8bca('0x1e')][_0x8bca('0x2c')]){_0x1a834c['include']=[{'all':!![]}];}return db['Dynamics365Account'][_0x8bca('0x2d')](_0x1a834c);})[_0x8bca('0x10')](function(_0x3baef6){_0x47b27c['rows']=_0x3baef6;return _0x47b27c;})[_0x8bca('0x10')](respondWithFilteredResult(_0x4e9dd3,_0x1a834c))['catch'](handleError(_0x4e9dd3,null));};exports[_0x8bca('0x2e')]=function(_0x18dee5,_0x49f0d3){var _0x269669={'raw':![],'where':{'id':_0x18dee5[_0x8bca('0x2f')]['id']}},_0x2d5a2f={};_0x2d5a2f['model']=_[_0x8bca('0x1c')](db[_0x8bca('0x17')]['rawAttributes']);_0x2d5a2f['query']=_[_0x8bca('0x1c')](_0x18dee5[_0x8bca('0x1e')]);_0x2d5a2f['filters']=_['intersection'](_0x2d5a2f[_0x8bca('0x1b')],_0x2d5a2f[_0x8bca('0x1e')]);_0x269669[_0x8bca('0x1f')]=_[_0x8bca('0x20')](_0x2d5a2f[_0x8bca('0x1b')],qs[_0x8bca('0x21')](_0x18dee5['query'][_0x8bca('0x21')]));_0x269669[_0x8bca('0x1f')]=_0x269669[_0x8bca('0x1f')][_0x8bca('0x22')]?_0x269669[_0x8bca('0x1f')]:_0x2d5a2f[_0x8bca('0x1b')];if(_0x18dee5[_0x8bca('0x1e')][_0x8bca('0x2c')]){_0x269669['include']=[{'all':!![]}];}_0x269669=_['merge']({},_0x269669,_0x18dee5[_0x8bca('0x2b')]);return db[_0x8bca('0x17')]['find'](_0x269669)[_0x8bca('0x10')](handleEntityNotFound(_0x49f0d3,null))[_0x8bca('0x10')](respondWithResult(_0x49f0d3,null))[_0x8bca('0x30')](handleError(_0x49f0d3,null));};exports[_0x8bca('0x31')]=function(_0x476521,_0x2b7a7c){return db[_0x8bca('0x17')][_0x8bca('0x31')](_0x476521[_0x8bca('0x32')],{})['then'](respondWithResult(_0x2b7a7c,0xc9))[_0x8bca('0x30')](handleError(_0x2b7a7c,null));};exports['update']=function(_0x1c8ff8,_0x1f529f){if(_0x1c8ff8[_0x8bca('0x32')]['id']){delete _0x1c8ff8[_0x8bca('0x32')]['id'];}return db[_0x8bca('0x17')][_0x8bca('0x33')]({'where':{'id':_0x1c8ff8['params']['id']}})[_0x8bca('0x10')](handleEntityNotFound(_0x1f529f,null))[_0x8bca('0x10')](saveUpdates(_0x1c8ff8['body'],null))[_0x8bca('0x10')](respondWithResult(_0x1f529f,null))['catch'](handleError(_0x1f529f,null));};exports['destroy']=function(_0x5cb9f0,_0x5add4a){return db[_0x8bca('0x17')][_0x8bca('0x33')]({'where':{'id':_0x5cb9f0[_0x8bca('0x2f')]['id']}})[_0x8bca('0x10')](handleEntityNotFound(_0x5add4a,null))['then'](removeEntity(_0x5add4a,null))[_0x8bca('0x30')](handleError(_0x5add4a,null));};exports[_0x8bca('0x34')]=function(_0x3ebc12,_0x2f0d32){var _0x5636d3={};var _0x103d04={};var _0x3b279e;var _0x39835e;return db[_0x8bca('0x17')][_0x8bca('0x35')]({'where':{'id':_0x3ebc12[_0x8bca('0x2f')]['id']}})[_0x8bca('0x10')](handleEntityNotFound(_0x2f0d32,null))[_0x8bca('0x10')](function(_0x4b8ce1){if(_0x4b8ce1){_0x3b279e=_0x4b8ce1;_0x103d04[_0x8bca('0x1b')]=_[_0x8bca('0x1c')](db['Dynamics365Configuration']['rawAttributes']);_0x103d04[_0x8bca('0x1e')]=_[_0x8bca('0x1c')](_0x3ebc12[_0x8bca('0x1e')]);_0x103d04['filters']=_[_0x8bca('0x20')](_0x103d04[_0x8bca('0x1b')],_0x103d04['query']);_0x5636d3[_0x8bca('0x1f')]=_[_0x8bca('0x20')](_0x103d04[_0x8bca('0x1b')],qs[_0x8bca('0x21')](_0x3ebc12['query'][_0x8bca('0x21')]));_0x5636d3[_0x8bca('0x1f')]=_0x5636d3['attributes'][_0x8bca('0x22')]?_0x5636d3[_0x8bca('0x1f')]:_0x103d04[_0x8bca('0x1b')];_0x5636d3['order']=qs['sort'](_0x3ebc12['query'][_0x8bca('0x26')]);_0x5636d3['where']=qs[_0x8bca('0x1d')](_[_0x8bca('0x36')](_0x3ebc12['query'],_0x103d04[_0x8bca('0x1d')]));if(_0x3ebc12[_0x8bca('0x1e')]['filter']){_0x5636d3[_0x8bca('0x27')]=_[_0x8bca('0x2a')](_0x5636d3['where'],{'$or':_['map'](_0x5636d3['attributes'],function(_0x1b5992){var _0x2a4a81={};_0x2a4a81[_0x1b5992]={'$like':'%'+_0x3ebc12[_0x8bca('0x1e')][_0x8bca('0x28')]+'%'};return _0x2a4a81;})});}_0x5636d3=_['merge']({},_0x5636d3,_0x3ebc12[_0x8bca('0x2b')]);return _0x3b279e[_0x8bca('0x34')](_0x5636d3);}})[_0x8bca('0x10')](function(_0xff48b7){if(_0xff48b7){_0x39835e=_0xff48b7[_0x8bca('0x22')];if(!_0x3ebc12[_0x8bca('0x1e')][_0x8bca('0x23')](_0x8bca('0x24'))){_0x5636d3[_0x8bca('0xb')]=qs[_0x8bca('0xb')](_0x3ebc12[_0x8bca('0x1e')][_0x8bca('0xb')]);_0x5636d3[_0x8bca('0x9')]=qs[_0x8bca('0x9')](_0x3ebc12[_0x8bca('0x1e')]['offset']);}return _0x3b279e[_0x8bca('0x34')](_0x5636d3);}})[_0x8bca('0x10')](function(_0x480fe8){if(_0x480fe8){return _0x480fe8?{'count':_0x39835e,'rows':_0x480fe8}:null;}})[_0x8bca('0x10')](respondWithResult(_0x2f0d32,null))[_0x8bca('0x30')](handleError(_0x2f0d32,null));};exports[_0x8bca('0x37')]=function(_0xcb64fc,_0xc2825d){if(_0xcb64fc[_0x8bca('0x32')]['id']){delete _0xcb64fc[_0x8bca('0x32')]['id'];}return db[_0x8bca('0x17')][_0x8bca('0x35')]({'where':{'id':_0xcb64fc[_0x8bca('0x2f')]['id']}})[_0x8bca('0x10')](handleEntityNotFound(_0xc2825d,null))['then'](function(_0x452122){if(_0x452122){_0xcb64fc[_0x8bca('0x32')][_0x8bca('0x38')]=_0x452122['id'];_0xcb64fc[_0x8bca('0x32')]['Subjects']=integrations[_0x8bca('0x39')](_0xcb64fc[_0x8bca('0x32')][_0x8bca('0x3a')],_0xcb64fc[_0x8bca('0x32')]['type']);_0xcb64fc[_0x8bca('0x32')][_0x8bca('0x3b')]=integrations[_0x8bca('0x3c')](_0xcb64fc[_0x8bca('0x32')][_0x8bca('0x3a')],_0xcb64fc[_0x8bca('0x32')][_0x8bca('0x1a')]);return db[_0x8bca('0x3d')]['create'](_0xcb64fc['body'],{'include':[{'model':db[_0x8bca('0x3e')],'as':_0x8bca('0x3f')},{'model':db[_0x8bca('0x3e')],'as':_0x8bca('0x3b')}]});}return null;})[_0x8bca('0x10')](respondWithResult(_0xc2825d,null))[_0x8bca('0x30')](handleError(_0xc2825d,null));};function sanitizeRemoteUri(_0x56d1b3){var _0x306321=_0x56d1b3['slice'](-0x1);if(_0x306321==='/')return _0x56d1b3[_0x8bca('0x40')](0x0,_0x56d1b3['lastIndexOf'](_0x306321));return _0x56d1b3;}function getWebApiUrl(_0x58beb3){return util['format'](_0x8bca('0x41'),_0x58beb3);}exports[_0x8bca('0x42')]=function(_0x9cc051,_0x10da15){var _0x153116=_0x9cc051['query'][_0x8bca('0x43')];var _0x307283=_0x153116===_0x8bca('0x44')?_0x8bca('0x45'):_0x8bca('0x46');var _0x1133fe='';var _0x49eef3='';var _0x5c4d3a='';var _0x15a74a='';var _0x392fc6='';var _0x4ec6c9='';var _0x377fc7='';var _0x3e9ae7='';var _0x3aa6e3=[_0x8bca('0x47'),_0x8bca('0x48'),_0x8bca('0x49'),_0x8bca('0x4a'),_0x8bca('0x4b'),_0x8bca('0x4c'),_0x8bca('0x4d'),'regardingobjectid','directioncode',_0x8bca('0x4e')];var _0x3f49dd=[_0x8bca('0x4f'),_0x8bca('0x50'),_0x8bca('0x51'),_0x8bca('0x52'),_0x8bca('0x53'),'contactidyominame',_0x8bca('0x54'),_0x8bca('0x55'),'createdbyexternalpartyname',_0x8bca('0x56'),_0x8bca('0x57'),_0x8bca('0x58'),_0x8bca('0x59'),'createdonbehalfbyname',_0x8bca('0x5a'),_0x8bca('0x5b'),_0x8bca('0x5c'),_0x8bca('0x5d'),_0x8bca('0x5e'),_0x8bca('0x5f'),_0x8bca('0x60'),'entityimage_url','escalatedon',_0x8bca('0x61'),_0x8bca('0x62'),_0x8bca('0x63'),_0x8bca('0x64'),_0x8bca('0x65'),_0x8bca('0x66'),_0x8bca('0x67'),'masteridname',_0x8bca('0x68'),_0x8bca('0x69'),_0x8bca('0x6a'),_0x8bca('0x6b'),_0x8bca('0x6c'),_0x8bca('0x6d'),'modifiedonbehalfbyyominame',_0x8bca('0x6e'),_0x8bca('0x6f'),_0x8bca('0x70'),'onholdtime',_0x8bca('0x71'),_0x8bca('0x72'),'owneridtype',_0x8bca('0x73'),_0x8bca('0x74'),_0x8bca('0x75'),_0x8bca('0x76'),_0x8bca('0x77'),'productidname',_0x8bca('0x78'),_0x8bca('0x79'),_0x8bca('0x7a'),_0x8bca('0x7b'),_0x8bca('0x7c'),_0x8bca('0x7d'),'sentimentvalue',_0x8bca('0x7e'),_0x8bca('0x7f'),_0x8bca('0x80'),_0x8bca('0x81'),_0x8bca('0x82'),'subjectidname',_0x8bca('0x83'),_0x8bca('0x84'),_0x8bca('0x85'),_0x8bca('0x86'),_0x8bca('0x87'),_0x8bca('0x88')];var _0x4f46b1=_0x3aa6e3[_0x8bca('0x89')](_0x3f49dd);return db[_0x8bca('0x17')][_0x8bca('0x35')]({'where':{'id':_0x9cc051['params']['id']},'attributes':['id','username',_0x8bca('0x8a'),_0x8bca('0x8b'),_0x8bca('0x8c'),'clientId',_0x8bca('0x8d'),'modernAuthentication'],'include':[{'model':db[_0x8bca('0x8e')],'as':'CloudProvider','attributes':['id','data5',_0x8bca('0x8f')]}]})[_0x8bca('0x10')](handleEntityNotFound(_0x10da15,null))[_0x8bca('0x10')](function(_0x57ae60){if(_0x57ae60){if(_0x57ae60[_0x8bca('0x90')]){_0x57ae60[_0x8bca('0x91')]=_0x57ae60['CloudProvider'][_0x8bca('0x92')];_0x3e9ae7=sanitizeRemoteUri(_0x57ae60['CloudProvider'][_0x8bca('0x8f')]);_0x377fc7=getWebApiUrl(_0x3e9ae7);return _0x57ae60;}_0x3e9ae7=sanitizeRemoteUri(_0x57ae60['remoteUri']);_0x377fc7=getWebApiUrl(_0x3e9ae7);var _0x49e138={'method':_0x8bca('0x93'),'uri':_0x8bca('0x94')+_0x57ae60['tenantId']+_0x8bca('0x95'),'form':{'client_id':_0x57ae60[_0x8bca('0x96')],'resource':_0x3e9ae7,'username':_0x57ae60[_0x8bca('0x97')],'password':_0x57ae60[_0x8bca('0x8a')],'grant_type':_0x8bca('0x8a'),'client_secret':_0x57ae60[_0x8bca('0x8d')]},'json':!![]};return rp(_0x49e138);}})['then'](function(_0x5a9e8e){_0x4ec6c9=_0x5a9e8e[_0x8bca('0x91')];var _0x478b8b={'method':'GET','uri':encodeURI(_0x377fc7+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x307283+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x4ec6c9,'If-None-Match':null,'OData-Version':_0x8bca('0x98')},'json':!![]};return rp(_0x478b8b);})['then'](function(_0x1c0362){var _0x31ec52=_0x1c0362[_0x8bca('0x99')][0x0];var _0x4010af=_0x31ec52[_0x8bca('0x9a')];var _0x323ac2={'method':_0x8bca('0x9b'),'uri':_0x377fc7+_0x8bca('0x9c')+_0x4010af+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x4ec6c9,'If-None-Match':null,'OData-Version':_0x8bca('0x98')},'json':!![]};return rp(_0x323ac2);})[_0x8bca('0x10')](function(_0x398e94){_0x1133fe=_0x398e94;_0x49eef3=_0x1133fe[_0x8bca('0x9d')];_0x49eef3=_[_0x8bca('0x9e')](_0x49eef3,function(_0x23f6e4){return!_0x4f46b1[_0x8bca('0x9f')](_0x23f6e4['LogicalName']);});var _0x32776e=[];var _0x2422d5=[];_0x49eef3[_0x8bca('0xa0')](function(_0x1ec1b4){if(_0x1ec1b4[_0x8bca('0xa1')]){var _0x4ee538=_0x1ec1b4['@odata.type'][_0x8bca('0x40')](_0x1ec1b4[_0x8bca('0xa1')]['lastIndexOf']('.')+0x1);if(_0x4ee538===_0x8bca('0xa2')){_0x32776e['push'](getSelectList(_0x377fc7,_0x153116,_0x2422d5,_0x1133fe[_0x8bca('0x9a')],_0x1ec1b4[_0x8bca('0x9a')],_0x4ec6c9));}}});return Promise[_0x8bca('0xa3')](_0x32776e);})[_0x8bca('0x10')](function(_0x5f165){_0x5c4d3a=_0x5f165[0x0];var _0x153ff1=[];var _0x1455fd=[];_0x49eef3[_0x8bca('0xa0')](function(_0x1aedf5){if(!_['isNil'](_0x1aedf5[_0x8bca('0xa1')])){var _0x38b0d0=_0x1aedf5[_0x8bca('0xa1')][_0x8bca('0x40')](_0x1aedf5[_0x8bca('0xa1')]['lastIndexOf']('.')+0x1);if(_0x38b0d0==='BooleanAttributeMetadata'){_0x153ff1[_0x8bca('0xa4')](getBooleanList(_0x377fc7,_0x153116,_0x1455fd,_0x1133fe[_0x8bca('0x9a')],_0x1aedf5['MetadataId'],_0x4ec6c9));}}});return Promise[_0x8bca('0xa3')](_0x153ff1);})[_0x8bca('0x10')](function(_0x188c7f){_0x15a74a=_0x188c7f[0x0];var _0x3dde74=[];var _0x48597c=[];_0x49eef3['forEach'](function(_0x109169){if(_0x109169[_0x8bca('0xa1')]){var _0x319387=_0x109169[_0x8bca('0xa1')][_0x8bca('0x40')](_0x109169[_0x8bca('0xa1')][_0x8bca('0xa5')]('.')+0x1);if(_0x319387===_0x8bca('0xa6')||_0x319387===_0x8bca('0xa7')||_0x319387==='BigIntAttributeMetadata'||_0x319387===_0x8bca('0xa8')||_0x319387===_0x8bca('0xa9')||_0x319387==='DateTimeAttributeMetadata'||_0x319387===_0x8bca('0xaa')||_0x319387===_0x8bca('0xab')||_0x319387===_0x8bca('0xac')||_0x319387==='DecimalAttributeMetadata'){_0x3dde74[_0x8bca('0xa4')](getInputList(_0x377fc7,_0x153116,_0x319387,_0x48597c,_0x1133fe[_0x8bca('0x9a')],_0x109169['MetadataId'],_0x4ec6c9));}}});return Promise[_0x8bca('0xa3')](_0x3dde74);})[_0x8bca('0x10')](function(_0x3bea36){_0x392fc6=_0x3bea36[0x0];var _0x327d1d=_0x5c4d3a[_0x8bca('0x89')](_0x15a74a)['concat'](_0x392fc6);var _0x46a6e2={'count':_0x327d1d[_0x8bca('0x22')],'rows':_0x327d1d};return _0x46a6e2;})[_0x8bca('0x10')](respondWithResult(_0x10da15,null))[_0x8bca('0x30')](function(_0x2b357a){var _0x49454c=_0x9cc051[_0x8bca('0x1e')][_0x8bca('0xad')]?0x1f4:_0x2b357a[_0x8bca('0xae')]||0x1f4;logger['error'](_0x2b357a['stack']);delete _0x2b357a['name'];if(_0x49454c===0x191){_0x49454c=0x190;}_0x10da15[_0x8bca('0x7')](_0x49454c)[_0x8bca('0xaf')](_0x9cc051[_0x8bca('0x1e')][_0x8bca('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0x2b357a['statusCode']}:_0x2b357a);});};function getSelectList(_0x2043bc,_0x1acee9,_0x1eb10b,_0x327dfa,_0x5e47bb,_0x559ae9){var _0x187300={'method':'GET','uri':_0x2043bc+_0x8bca('0x9c')+_0x327dfa+_0x8bca('0xb0')+_0x5e47bb+_0x8bca('0xb1')+_0x8bca('0xb2'),'headers':{'Authorization':_0x8bca('0xb3')+_0x559ae9,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x187300)['then'](function(_0x395891){var _0x43304a=[];var _0x2ee3e9=_0x395891[_0x8bca('0xb4')][_0x8bca('0xb5')];_0x2ee3e9['forEach'](function(_0x49e6f0){_0x43304a[_0x8bca('0xa4')]({'name':_0x49e6f0[_0x8bca('0xb6')][_0x8bca('0xb7')][_0x8bca('0xb6')],'value':String(_0x49e6f0[_0x8bca('0xb8')])});});var _0x4065e7={'id':_0x1acee9+'_'+_0x395891[_0x8bca('0xb9')],'name':_0x395891[_0x8bca('0xba')][_0x8bca('0xb7')][_0x8bca('0xb6')],'custom':![],'options':_0x43304a};_0x1eb10b[_0x8bca('0xa4')](_0x4065e7);return _0x1eb10b;});}function getBooleanList(_0x915813,_0x2ae92f,_0x4ae084,_0x5d2927,_0x44496c,_0xd929ca){var _0x5dbd2e={'method':_0x8bca('0x9b'),'uri':_0x915813+_0x8bca('0x9c')+_0x5d2927+_0x8bca('0xb0')+_0x44496c+_0x8bca('0xbb'),'headers':{'Authorization':_0x8bca('0xb3')+_0xd929ca,'If-None-Match':null,'OData-Version':_0x8bca('0x98')},'json':!![]};return rp(_0x5dbd2e)[_0x8bca('0x10')](function(_0x1a5a65){var _0x194f58=[];_0x194f58[_0x8bca('0xa4')]({'name':_0x1a5a65['OptionSet'][_0x8bca('0xbc')][_0x8bca('0xb6')][_0x8bca('0xb7')][_0x8bca('0xb6')],'value':_0x8bca('0xbd')},{'name':_0x1a5a65[_0x8bca('0xb4')][_0x8bca('0xbe')][_0x8bca('0xb6')][_0x8bca('0xb7')][_0x8bca('0xb6')],'value':'false'});var _0x465933={'id':_0x2ae92f+'_'+_0x1a5a65[_0x8bca('0xb9')],'name':_0x1a5a65[_0x8bca('0xba')]['UserLocalizedLabel'][_0x8bca('0xb6')],'custom':![],'options':_0x194f58};_0x4ae084[_0x8bca('0xa4')](_0x465933);return _0x4ae084;});}function getInputList(_0x300c7e,_0x1f0fb6,_0x310ba9,_0x1e2d90,_0x1d3bb8,_0x400d91,_0x34a02d){var _0x3f8460={'method':_0x8bca('0x9b'),'uri':_0x300c7e+_0x8bca('0x9c')+_0x1d3bb8+_0x8bca('0xb0')+_0x400d91+_0x8bca('0xbf')+_0x310ba9+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x8bca('0xb3')+_0x34a02d,'If-None-Match':null,'OData-Version':_0x8bca('0x98')},'json':!![]};return rp(_0x3f8460)[_0x8bca('0x10')](function(_0x32fa2c){var _0x46c0d6={'id':_0x1f0fb6+'_'+_0x32fa2c['LogicalName'],'name':_0x32fa2c['DisplayName']['UserLocalizedLabel']?_0x32fa2c[_0x8bca('0xba')][_0x8bca('0xb7')][_0x8bca('0xb6')]:_0x32fa2c[_0x8bca('0xb9')],'custom':![],'options':[]};_0x1e2d90[_0x8bca('0xa4')](_0x46c0d6);return _0x1e2d90;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index b9f29f8..f239ab0 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x4cba4b,_0x58eb50){var _0x524849=function(_0x479e97){while(--_0x479e97){_0x4cba4b['push'](_0x4cba4b['shift']());}};_0x524849(++_0x58eb50);}(_0xe706,0xa3));var _0x6e70=function(_0x46eb0e,_0x296d16){_0x46eb0e=_0x46eb0e-0x0;var _0x523297=_0xe706[_0x46eb0e];return _0x523297;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x48d4e9,_0x3e9c90){var _0x3b6dff=function(_0x3dd492){while(--_0x3dd492){_0x48d4e9['push'](_0x48d4e9['shift']());}};_0x3b6dff(++_0x3e9c90);}(_0x757a,0xde));var _0xa757=function(_0x1f2842,_0x5418f3){_0x1f2842=_0x1f2842-0x0;var _0x2a939f=_0x757a[_0x1f2842];return _0x2a939f;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index a20c0f8..2d4dc87 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 _0xec2e=['message','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','include','map','then','Dynamics365Account','find','model','debug','ShowDynamics365Account','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x58620d,_0x5d4d59){var _0x597698=function(_0x90d66e){while(--_0x90d66e){_0x58620d['push'](_0x58620d['shift']());}};_0x597698(++_0x5d4d59);}(_0xec2e,0x131));var _0xeec2=function(_0x5bbeeb,_0x2c7cae){_0x5bbeeb=_0x5bbeeb-0x0;var _0x17c2bb=_0xec2e[_0x5bbeeb];return _0x17c2bb;};'use strict';var _=require(_0xeec2('0x0'));var util=require(_0xeec2('0x1'));var moment=require('moment');var BPromise=require(_0xeec2('0x2'));var rs=require(_0xeec2('0x3'));var fs=require('fs');var Redis=require(_0xeec2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeec2('0x5'));var logger=require(_0xeec2('0x6'))(_0xeec2('0x7'));var config=require(_0xeec2('0x8'));var jayson=require(_0xeec2('0x9'));var client=jayson[_0xeec2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4bc3c8,_0x15a651,_0x238a58){return new BPromise(function(_0x173cdd,_0x5e1566){return client[_0xeec2('0xb')](_0x4bc3c8,_0x238a58)['then'](function(_0x710ad4){logger[_0xeec2('0xc')](_0xeec2('0xd'),_0x15a651,_0xeec2('0xe'));logger['debug'](_0xeec2('0xf'),_0x15a651,_0xeec2('0xe'),JSON[_0xeec2('0x10')](_0x710ad4));if(_0x710ad4[_0xeec2('0x11')]){if(_0x710ad4[_0xeec2('0x11')][_0xeec2('0x12')]===0x1f4){logger[_0xeec2('0x11')](_0xeec2('0xd'),_0x15a651,_0x710ad4[_0xeec2('0x11')][_0xeec2('0x13')]);return _0x5e1566(_0x710ad4[_0xeec2('0x11')][_0xeec2('0x13')]);}logger['error'](_0xeec2('0xd'),_0x15a651,_0x710ad4[_0xeec2('0x11')][_0xeec2('0x13')]);return _0x173cdd(_0x710ad4[_0xeec2('0x11')][_0xeec2('0x13')]);}else{logger[_0xeec2('0xc')](_0xeec2('0xd'),_0x15a651,'request\x20sent');_0x173cdd(_0x710ad4['result']['message']);}})[_0xeec2('0x14')](function(_0x5a3097){logger['error'](_0xeec2('0xd'),_0x15a651,_0x5a3097);_0x5e1566(_0x5a3097);});});}exports[_0xeec2('0x15')]=function(_0x31511c){var _0x5425ff=this;return new Promise(function(_0x10da52,_0x535df6){return db['Dynamics365Account'][_0xeec2('0x16')]({'raw':_0x31511c['options']?_0x31511c[_0xeec2('0x17')][_0xeec2('0x18')]===undefined?!![]:![]:!![],'where':_0x31511c['options']?_0x31511c[_0xeec2('0x17')][_0xeec2('0x19')]||null:null,'attributes':_0x31511c[_0xeec2('0x17')]?_0x31511c[_0xeec2('0x17')][_0xeec2('0x1a')]||null:null,'limit':_0x31511c[_0xeec2('0x17')]?_0x31511c[_0xeec2('0x17')][_0xeec2('0x1b')]||null:null,'include':_0x31511c[_0xeec2('0x17')]?_0x31511c[_0xeec2('0x17')][_0xeec2('0x1c')]?_[_0xeec2('0x1d')](_0x31511c['options'][_0xeec2('0x1c')],function(_0x1b1ab3){return{'model':db[_0x1b1ab3['model']],'as':_0x1b1ab3['as'],'attributes':_0x1b1ab3[_0xeec2('0x1a')],'include':_0x1b1ab3[_0xeec2('0x1c')]?_[_0xeec2('0x1d')](_0x1b1ab3[_0xeec2('0x1c')],function(_0x5bab0f){return{'model':db[_0x5bab0f['model']],'as':_0x5bab0f['as'],'attributes':_0x5bab0f[_0xeec2('0x1a')],'include':_0x5bab0f[_0xeec2('0x1c')]?_['map'](_0x5bab0f['include'],function(_0x1f7796){return{'model':db[_0x1f7796['model']],'as':_0x1f7796['as'],'attributes':_0x1f7796[_0xeec2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xeec2('0x1e')](function(_0x2c530c){logger[_0xeec2('0xc')](_0xeec2('0x15'),_0x31511c);logger['debug'](_0xeec2('0x15'),_0x31511c,JSON[_0xeec2('0x10')](_0x2c530c));_0x10da52(_0x2c530c);})[_0xeec2('0x14')](function(_0x154727){logger['error'](_0xeec2('0x15'),_0x154727[_0xeec2('0x13')],_0x31511c);_0x535df6(_0x5425ff[_0xeec2('0x11')](0x1f4,_0x154727[_0xeec2('0x13')]));});});};exports['ShowDynamics365Account']=function(_0x31fb33){var _0x5d6ce3=this;return new Promise(function(_0x2473a4,_0xc23134){return db[_0xeec2('0x1f')][_0xeec2('0x20')]({'raw':_0x31fb33[_0xeec2('0x17')]?_0x31fb33['options']['raw']===undefined?!![]:![]:!![],'where':_0x31fb33[_0xeec2('0x17')]?_0x31fb33['options'][_0xeec2('0x19')]||null:null,'attributes':_0x31fb33[_0xeec2('0x17')]?_0x31fb33[_0xeec2('0x17')][_0xeec2('0x1a')]||null:null,'include':_0x31fb33[_0xeec2('0x17')]?_0x31fb33[_0xeec2('0x17')][_0xeec2('0x1c')]?_['map'](_0x31fb33[_0xeec2('0x17')][_0xeec2('0x1c')],function(_0x25eb79){return{'model':db[_0x25eb79[_0xeec2('0x21')]],'as':_0x25eb79['as'],'attributes':_0x25eb79[_0xeec2('0x1a')],'include':_0x25eb79[_0xeec2('0x1c')]?_[_0xeec2('0x1d')](_0x25eb79[_0xeec2('0x1c')],function(_0x38cb5c){return{'model':db[_0x38cb5c['model']],'as':_0x38cb5c['as'],'attributes':_0x38cb5c['attributes'],'include':_0x38cb5c[_0xeec2('0x1c')]?_[_0xeec2('0x1d')](_0x38cb5c['include'],function(_0x55fe37){return{'model':db[_0x55fe37[_0xeec2('0x21')]],'as':_0x55fe37['as'],'attributes':_0x55fe37[_0xeec2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xeec2('0x1e')](function(_0x1f492d){logger[_0xeec2('0xc')]('ShowDynamics365Account',_0x31fb33);logger[_0xeec2('0x22')](_0xeec2('0x23'),_0x31fb33,JSON[_0xeec2('0x10')](_0x1f492d));_0x2473a4(_0x1f492d);})[_0xeec2('0x14')](function(_0x323460){logger['error'](_0xeec2('0x23'),_0x323460[_0xeec2('0x13')],_0x31fb33);_0xc23134(_0x5d6ce3['error'](0x1f4,_0x323460[_0xeec2('0x13')]));});});}; \ No newline at end of file +var _0xb538=['options','raw','where','attributes','limit','map','include','model','GetDynamics365Account','debug','ShowDynamics365Account','find','lodash','util','randomstring','../../config/utils','rpc','../../config/environment','client','http','request','then','info','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','request\x20sent','result','catch','Dynamics365Account','findAll'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0xb538,0x1da));var _0x8b53=function(_0x4e060d,_0x12265e){_0x4e060d=_0x4e060d-0x0;var _0x563fc6=_0xb538[_0x4e060d];return _0x563fc6;};'use strict';var _=require(_0x8b53('0x0'));var util=require(_0x8b53('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8b53('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8b53('0x3'));var logger=require('../../config/logger')(_0x8b53('0x4'));var config=require(_0x8b53('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8b53('0x6')][_0x8b53('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1a7ccc,_0x26784a,_0x42cb6e){return new BPromise(function(_0x1b8ea1,_0x1201d8){return client[_0x8b53('0x8')](_0x1a7ccc,_0x42cb6e)[_0x8b53('0x9')](function(_0x593e66){logger[_0x8b53('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x26784a,'request\x20sent');logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x26784a,'request\x20sent',JSON[_0x8b53('0xb')](_0x593e66));if(_0x593e66[_0x8b53('0xc')]){if(_0x593e66[_0x8b53('0xc')][_0x8b53('0xd')]===0x1f4){logger[_0x8b53('0xc')](_0x8b53('0xe'),_0x26784a,_0x593e66[_0x8b53('0xc')][_0x8b53('0xf')]);return _0x1201d8(_0x593e66[_0x8b53('0xc')][_0x8b53('0xf')]);}logger['error'](_0x8b53('0xe'),_0x26784a,_0x593e66[_0x8b53('0xc')][_0x8b53('0xf')]);return _0x1b8ea1(_0x593e66[_0x8b53('0xc')][_0x8b53('0xf')]);}else{logger['info'](_0x8b53('0xe'),_0x26784a,_0x8b53('0x10'));_0x1b8ea1(_0x593e66[_0x8b53('0x11')][_0x8b53('0xf')]);}})[_0x8b53('0x12')](function(_0x312fbb){logger[_0x8b53('0xc')](_0x8b53('0xe'),_0x26784a,_0x312fbb);_0x1201d8(_0x312fbb);});});}exports['GetDynamics365Account']=function(_0x40841f){var _0x44fd11=this;return new Promise(function(_0x1fd5b8,_0x1e6e6b){return db[_0x8b53('0x13')][_0x8b53('0x14')]({'raw':_0x40841f[_0x8b53('0x15')]?_0x40841f['options'][_0x8b53('0x16')]===undefined?!![]:![]:!![],'where':_0x40841f[_0x8b53('0x15')]?_0x40841f[_0x8b53('0x15')][_0x8b53('0x17')]||null:null,'attributes':_0x40841f[_0x8b53('0x15')]?_0x40841f[_0x8b53('0x15')][_0x8b53('0x18')]||null:null,'limit':_0x40841f['options']?_0x40841f[_0x8b53('0x15')][_0x8b53('0x19')]||null:null,'include':_0x40841f[_0x8b53('0x15')]?_0x40841f[_0x8b53('0x15')]['include']?_[_0x8b53('0x1a')](_0x40841f[_0x8b53('0x15')]['include'],function(_0x15494d){return{'model':db[_0x15494d['model']],'as':_0x15494d['as'],'attributes':_0x15494d[_0x8b53('0x18')],'include':_0x15494d['include']?_[_0x8b53('0x1a')](_0x15494d[_0x8b53('0x1b')],function(_0x5125b5){return{'model':db[_0x5125b5[_0x8b53('0x1c')]],'as':_0x5125b5['as'],'attributes':_0x5125b5[_0x8b53('0x18')],'include':_0x5125b5[_0x8b53('0x1b')]?_[_0x8b53('0x1a')](_0x5125b5['include'],function(_0x5900b3){return{'model':db[_0x5900b3[_0x8b53('0x1c')]],'as':_0x5900b3['as'],'attributes':_0x5900b3[_0x8b53('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8b53('0x9')](function(_0x5739b3){logger['info'](_0x8b53('0x1d'),_0x40841f);logger[_0x8b53('0x1e')](_0x8b53('0x1d'),_0x40841f,JSON[_0x8b53('0xb')](_0x5739b3));_0x1fd5b8(_0x5739b3);})[_0x8b53('0x12')](function(_0x26cb3c){logger[_0x8b53('0xc')](_0x8b53('0x1d'),_0x26cb3c['message'],_0x40841f);_0x1e6e6b(_0x44fd11['error'](0x1f4,_0x26cb3c[_0x8b53('0xf')]));});});};exports[_0x8b53('0x1f')]=function(_0xd97493){var _0x486940=this;return new Promise(function(_0x9859c4,_0x1bd478){return db['Dynamics365Account'][_0x8b53('0x20')]({'raw':_0xd97493[_0x8b53('0x15')]?_0xd97493[_0x8b53('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xd97493[_0x8b53('0x15')]?_0xd97493['options'][_0x8b53('0x17')]||null:null,'attributes':_0xd97493[_0x8b53('0x15')]?_0xd97493[_0x8b53('0x15')]['attributes']||null:null,'include':_0xd97493[_0x8b53('0x15')]?_0xd97493['options']['include']?_[_0x8b53('0x1a')](_0xd97493[_0x8b53('0x15')][_0x8b53('0x1b')],function(_0x5677b1){return{'model':db[_0x5677b1['model']],'as':_0x5677b1['as'],'attributes':_0x5677b1[_0x8b53('0x18')],'include':_0x5677b1[_0x8b53('0x1b')]?_[_0x8b53('0x1a')](_0x5677b1[_0x8b53('0x1b')],function(_0x623a02){return{'model':db[_0x623a02['model']],'as':_0x623a02['as'],'attributes':_0x623a02[_0x8b53('0x18')],'include':_0x623a02[_0x8b53('0x1b')]?_['map'](_0x623a02['include'],function(_0x52df4b){return{'model':db[_0x52df4b[_0x8b53('0x1c')]],'as':_0x52df4b['as'],'attributes':_0x52df4b[_0x8b53('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8b53('0x9')](function(_0x403bc4){logger['info'](_0x8b53('0x1f'),_0xd97493);logger[_0x8b53('0x1e')](_0x8b53('0x1f'),_0xd97493,JSON[_0x8b53('0xb')](_0x403bc4));_0x9859c4(_0x403bc4);})[_0x8b53('0x12')](function(_0x23ca88){logger[_0x8b53('0xc')]('ShowDynamics365Account',_0x23ca88['message'],_0xd97493);_0x1bd478(_0x486940['error'](0x1f4,_0x23ca88[_0x8b53('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 93c613c..d4e14c2 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 _0xfef3=['./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2eb88f,_0x37fe90){var _0x52e1ed=function(_0x531ff1){while(--_0x531ff1){_0x2eb88f['push'](_0x2eb88f['shift']());}};_0x52e1ed(++_0x37fe90);}(_0xfef3,0x118));var _0x3fef=function(_0x5ebf27,_0x4514e0){_0x5ebf27=_0x5ebf27-0x0;var _0x121c72=_0xfef3[_0x5ebf27];return _0x121c72;};'use strict';var multer=require(_0x3fef('0x0'));var util=require('util');var path=require(_0x3fef('0x1'));var timeout=require('connect-timeout');var express=require(_0x3fef('0x2'));var router=express[_0x3fef('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fef('0x4'));var interaction=require(_0x3fef('0x5'));var config=require('../../config/environment');var controller=require(_0x3fef('0x6'));router[_0x3fef('0x7')]('/',auth['isAuthenticated'](),controller[_0x3fef('0x8')]);router[_0x3fef('0x7')](_0x3fef('0x9'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xb')]);router[_0x3fef('0x7')](_0x3fef('0xc'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xd')]);router[_0x3fef('0x7')](_0x3fef('0xe'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xf')]);router[_0x3fef('0x7')]('/:id/descriptions',auth[_0x3fef('0xa')](),controller[_0x3fef('0x10')]);router[_0x3fef('0x11')]('/',auth['isAuthenticated'](),controller[_0x3fef('0x12')]);router['put'](_0x3fef('0x9'),auth[_0x3fef('0xa')](),controller[_0x3fef('0x13')]);router['delete'](_0x3fef('0x9'),auth['isAuthenticated'](),controller[_0x3fef('0x14')]);module[_0x3fef('0x15')]=router; \ No newline at end of file +var _0x75ea=['show','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','index','get','/:id'];(function(_0x5b0766,_0x1cc5e1){var _0x52c5e7=function(_0xb155fc){while(--_0xb155fc){_0x5b0766['push'](_0x5b0766['shift']());}};_0x52c5e7(++_0x1cc5e1);}(_0x75ea,0x7d));var _0xa75e=function(_0x3471e6,_0x3511c0){_0x3471e6=_0x3471e6-0x0;var _0xe1066f=_0x75ea[_0x3471e6];return _0xe1066f;};'use strict';var multer=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var path=require('path');var timeout=require(_0xa75e('0x2'));var express=require(_0xa75e('0x3'));var router=express['Router']();var fs_extra=require(_0xa75e('0x4'));var auth=require(_0xa75e('0x5'));var interaction=require(_0xa75e('0x6'));var config=require(_0xa75e('0x7'));var controller=require(_0xa75e('0x8'));router['get']('/',auth[_0xa75e('0x9')](),controller[_0xa75e('0xa')]);router[_0xa75e('0xb')](_0xa75e('0xc'),auth[_0xa75e('0x9')](),controller[_0xa75e('0xd')]);router[_0xa75e('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['get'](_0xa75e('0xe'),auth['isAuthenticated'](),controller[_0xa75e('0xf')]);router['get'](_0xa75e('0x10'),auth[_0xa75e('0x9')](),controller['getDescriptions']);router[_0xa75e('0x11')]('/',auth[_0xa75e('0x9')](),controller[_0xa75e('0x12')]);router[_0xa75e('0x13')](_0xa75e('0xc'),auth[_0xa75e('0x9')](),controller[_0xa75e('0x14')]);router[_0xa75e('0x15')](_0xa75e('0xc'),auth['isAuthenticated'](),controller[_0xa75e('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index edb2bc4..22f36c3 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 _0xf9a1=['exports','STRING','ENUM','incident','phonecall','contact','sequelize'];(function(_0x5345fa,_0x5b95f0){var _0x119e0d=function(_0x140c27){while(--_0x140c27){_0x5345fa['push'](_0x5345fa['shift']());}};_0x119e0d(++_0x5b95f0);}(_0xf9a1,0x1b8));var _0x1f9a=function(_0x1e7d01,_0x48f47f){_0x1e7d01=_0x1e7d01-0x0;var _0x60d047=_0xf9a1[_0x1e7d01];return _0x60d047;};'use strict';var Sequelize=require(_0x1f9a('0x0'));module[_0x1f9a('0x1')]={'name':{'type':Sequelize[_0x1f9a('0x2')]},'description':{'type':Sequelize[_0x1f9a('0x2')]},'ticketType':{'type':Sequelize[_0x1f9a('0x3')](_0x1f9a('0x4'),_0x1f9a('0x5')),'defaultValue':_0x1f9a('0x4')},'moduleCreate':{'type':Sequelize[_0x1f9a('0x3')](_0x1f9a('0x6'),'nothing'),'defaultValue':_0x1f9a('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x1f9a('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x8251=['BOOLEAN','exports','STRING','ENUM','phonecall','incident'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x8251,0x9d));var _0x1825=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8251[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x1825('0x0')]={'name':{'type':Sequelize[_0x1825('0x1')]},'description':{'type':Sequelize[_0x1825('0x1')]},'ticketType':{'type':Sequelize[_0x1825('0x2')]('incident',_0x1825('0x3')),'defaultValue':_0x1825('0x4')},'moduleCreate':{'type':Sequelize[_0x1825('0x2')]('contact','nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x1825('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x1825('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 094dc49..a50774f 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 _0xe994=['squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','error','stack','send','index','map','Dynamics365Configuration','rawAttributes','key','name','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','catch','params','keys','merge','find','create','body','findOne','getFields','nolimit','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x13d8af,_0x51ee52){var _0x981d50=function(_0x5ab5b4){while(--_0x5ab5b4){_0x13d8af['push'](_0x13d8af['shift']());}};_0x981d50(++_0x51ee52);}(_0xe994,0x1bc));var _0x4e99=function(_0x1b3a09,_0x20c774){_0x1b3a09=_0x1b3a09-0x0;var _0x357bb8=_0xe994[_0x1b3a09];return _0x357bb8;};'use strict';var emlformat=require(_0x4e99('0x0'));var rimraf=require(_0x4e99('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e99('0x2'));var rp=require(_0x4e99('0x3'));var moment=require('moment');var BPromise=require(_0x4e99('0x4'));var Mustache=require(_0x4e99('0x5'));var util=require('util');var path=require(_0x4e99('0x6'));var sox=require(_0x4e99('0x7'));var csv=require(_0x4e99('0x8'));var ejs=require(_0x4e99('0x9'));var fs=require('fs');var fs_extra=require(_0x4e99('0xa'));var _=require(_0x4e99('0xb'));var squel=require(_0x4e99('0xc'));var crypto=require(_0x4e99('0xd'));var jsforce=require(_0x4e99('0xe'));var deskjs=require(_0x4e99('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4e99('0x10'));var qs=require(_0x4e99('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4e99('0x12'));var utils=require(_0x4e99('0x13'));var config=require(_0x4e99('0x14'));var licenseUtil=require(_0x4e99('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bc7ad,_0x535545){_0x535545=_0x535545||0xcc;return function(_0x12294e){if(_0x12294e){return _0x2bc7ad[_0x4e99('0x16')](_0x535545);}return _0x2bc7ad[_0x4e99('0x17')](_0x535545)[_0x4e99('0x18')]();};}function respondWithResult(_0x52d94b,_0xfbe5c9){_0xfbe5c9=_0xfbe5c9||0xc8;return function(_0x4873b3){if(_0x4873b3){return _0x52d94b['status'](_0xfbe5c9)['json'](_0x4873b3);}};}function respondWithFilteredResult(_0x422978,_0x10ae7e){return function(_0x379486){if(_0x379486){var _0x39b9ab=typeof _0x10ae7e[_0x4e99('0x19')]===_0x4e99('0x1a')&&typeof _0x10ae7e[_0x4e99('0x1b')]===_0x4e99('0x1a');var _0x5d4aa6=_0x379486[_0x4e99('0x1c')];var _0xc58b44=_0x39b9ab?0x0:_0x10ae7e['offset'];var _0x5241d9=_0x39b9ab?_0x379486[_0x4e99('0x1c')]:_0x10ae7e[_0x4e99('0x19')]+_0x10ae7e['limit'];var _0x542aac;if(_0x5241d9>=_0x5d4aa6){_0x5241d9=_0x5d4aa6;_0x542aac=0xc8;}else{_0x542aac=0xce;}_0x422978[_0x4e99('0x17')](_0x542aac);return _0x422978[_0x4e99('0x1d')](_0x4e99('0x1e'),_0xc58b44+'-'+_0x5241d9+'/'+_0x5d4aa6)[_0x4e99('0x1f')](_0x379486);}return null;};}function patchUpdates(_0x39c121){return function(_0x30b8b7){try{jsonpatch['apply'](_0x30b8b7,_0x39c121,!![]);}catch(_0x34595c){return BPromise['reject'](_0x34595c);}return _0x30b8b7[_0x4e99('0x20')]();};}function saveUpdates(_0x56b3f1,_0x2e4ecd){return function(_0x1bb5f3){if(_0x1bb5f3){return _0x1bb5f3[_0x4e99('0x21')](_0x56b3f1)[_0x4e99('0x22')](function(_0x45c85b){return _0x45c85b;});}return null;};}function removeEntity(_0x4addc2,_0x560041){return function(_0x18f84a){if(_0x18f84a){return _0x18f84a[_0x4e99('0x23')]()['then'](function(){_0x4addc2[_0x4e99('0x17')](0xcc)[_0x4e99('0x18')]();});}};}function handleEntityNotFound(_0x5ab9a7,_0x24f0c3){return function(_0x56b923){if(!_0x56b923){_0x5ab9a7[_0x4e99('0x16')](0x194);}return _0x56b923;};}function handleError(_0x7095ac,_0x23b303){_0x23b303=_0x23b303||0x1f4;return function(_0x2bac02){logger[_0x4e99('0x24')](_0x2bac02[_0x4e99('0x25')]);if(_0x2bac02['name']){delete _0x2bac02['name'];}_0x7095ac[_0x4e99('0x17')](_0x23b303)[_0x4e99('0x26')](_0x2bac02);};}exports[_0x4e99('0x27')]=function(_0xfe6969,_0x55cd80){var _0x57a6f5={},_0x58156c={},_0x3a58ec={'count':0x0,'rows':[]};var _0x269854=_[_0x4e99('0x28')](db[_0x4e99('0x29')][_0x4e99('0x2a')],function(_0x412db1){return{'name':_0x412db1['fieldName'],'type':_0x412db1['type'][_0x4e99('0x2b')]};});_0x58156c['model']=_[_0x4e99('0x28')](_0x269854,_0x4e99('0x2c'));_0x58156c[_0x4e99('0x2d')]=_['keys'](_0xfe6969[_0x4e99('0x2d')]);_0x58156c['filters']=_[_0x4e99('0x2e')](_0x58156c[_0x4e99('0x2f')],_0x58156c['query']);_0x57a6f5[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x58156c[_0x4e99('0x2f')],qs['fields'](_0xfe6969['query'][_0x4e99('0x31')]));_0x57a6f5[_0x4e99('0x30')]=_0x57a6f5[_0x4e99('0x30')][_0x4e99('0x32')]?_0x57a6f5['attributes']:_0x58156c[_0x4e99('0x2f')];if(!_0xfe6969['query'][_0x4e99('0x33')]('nolimit')){_0x57a6f5[_0x4e99('0x1b')]=qs['limit'](_0xfe6969['query'][_0x4e99('0x1b')]);_0x57a6f5[_0x4e99('0x19')]=qs['offset'](_0xfe6969['query']['offset']);}_0x57a6f5[_0x4e99('0x34')]=qs[_0x4e99('0x35')](_0xfe6969[_0x4e99('0x2d')][_0x4e99('0x35')]);_0x57a6f5[_0x4e99('0x36')]=qs[_0x4e99('0x37')](_[_0x4e99('0x38')](_0xfe6969['query'],_0x58156c[_0x4e99('0x37')]),_0x269854);if(_0xfe6969['query'][_0x4e99('0x39')]){_0x57a6f5[_0x4e99('0x36')]=_['merge'](_0x57a6f5['where'],{'$or':_['map'](_0x269854,function(_0x32db63){if(_0x32db63[_0x4e99('0x3a')]!==_0x4e99('0x3b')){var _0x3af38d={};_0x3af38d[_0x32db63[_0x4e99('0x2c')]]={'$like':'%'+_0xfe6969['query'][_0x4e99('0x39')]+'%'};return _0x3af38d;}})});}_0x57a6f5=_['merge']({},_0x57a6f5,_0xfe6969[_0x4e99('0x3c')]);var _0x1b51c5={'where':_0x57a6f5['where']};return db[_0x4e99('0x29')]['count'](_0x1b51c5)[_0x4e99('0x22')](function(_0x5e3c04){_0x3a58ec[_0x4e99('0x1c')]=_0x5e3c04;if(_0xfe6969[_0x4e99('0x2d')][_0x4e99('0x3d')]){_0x57a6f5[_0x4e99('0x3e')]=[{'all':!![]}];}return db[_0x4e99('0x29')]['findAll'](_0x57a6f5);})[_0x4e99('0x22')](function(_0x448ad0){_0x3a58ec['rows']=_0x448ad0;return _0x3a58ec;})[_0x4e99('0x22')](respondWithFilteredResult(_0x55cd80,_0x57a6f5))[_0x4e99('0x3f')](handleError(_0x55cd80,null));};exports['show']=function(_0x307ea9,_0x364b2b){var _0x578400={'raw':![],'where':{'id':_0x307ea9[_0x4e99('0x40')]['id']}},_0x475aa9={};_0x475aa9[_0x4e99('0x2f')]=_[_0x4e99('0x41')](db[_0x4e99('0x29')][_0x4e99('0x2a')]);_0x475aa9[_0x4e99('0x2d')]=_[_0x4e99('0x41')](_0x307ea9[_0x4e99('0x2d')]);_0x475aa9[_0x4e99('0x37')]=_[_0x4e99('0x2e')](_0x475aa9[_0x4e99('0x2f')],_0x475aa9[_0x4e99('0x2d')]);_0x578400[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x475aa9[_0x4e99('0x2f')],qs[_0x4e99('0x31')](_0x307ea9[_0x4e99('0x2d')][_0x4e99('0x31')]));_0x578400['attributes']=_0x578400[_0x4e99('0x30')][_0x4e99('0x32')]?_0x578400[_0x4e99('0x30')]:_0x475aa9[_0x4e99('0x2f')];if(_0x307ea9['query'][_0x4e99('0x3d')]){_0x578400[_0x4e99('0x3e')]=[{'all':!![]}];}_0x578400=_[_0x4e99('0x42')]({},_0x578400,_0x307ea9[_0x4e99('0x3c')]);return db[_0x4e99('0x29')][_0x4e99('0x43')](_0x578400)[_0x4e99('0x22')](handleEntityNotFound(_0x364b2b,null))['then'](respondWithResult(_0x364b2b,null))['catch'](handleError(_0x364b2b,null));};exports[_0x4e99('0x44')]=function(_0x4cbe4f,_0x3d88e2){return db[_0x4e99('0x29')]['create'](_0x4cbe4f['body'],{})[_0x4e99('0x22')](respondWithResult(_0x3d88e2,0xc9))[_0x4e99('0x3f')](handleError(_0x3d88e2,null));};exports[_0x4e99('0x21')]=function(_0x3e1553,_0x706d18){if(_0x3e1553[_0x4e99('0x45')]['id']){delete _0x3e1553[_0x4e99('0x45')]['id'];}return db[_0x4e99('0x29')][_0x4e99('0x43')]({'where':{'id':_0x3e1553[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x706d18,null))['then'](saveUpdates(_0x3e1553[_0x4e99('0x45')],null))[_0x4e99('0x22')](respondWithResult(_0x706d18,null))['catch'](handleError(_0x706d18,null));};exports[_0x4e99('0x23')]=function(_0x5690c3,_0x5dce84){return db[_0x4e99('0x29')][_0x4e99('0x43')]({'where':{'id':_0x5690c3[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x5dce84,null))[_0x4e99('0x22')](removeEntity(_0x5dce84,null))[_0x4e99('0x3f')](handleError(_0x5dce84,null));};exports['getFields']=function(_0x275b7b,_0x5f1977,_0x4f45df){var _0x569cd8={};var _0x34765d={};var _0x539e8f;var _0x41c26a;return db[_0x4e99('0x29')][_0x4e99('0x46')]({'where':{'id':_0x275b7b[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x5f1977,null))['then'](function(_0x62699c){if(_0x62699c){_0x539e8f=_0x62699c;_0x34765d[_0x4e99('0x2f')]=_['keys'](db['Dynamics365Field'][_0x4e99('0x2a')]);_0x34765d[_0x4e99('0x2d')]=_[_0x4e99('0x41')](_0x275b7b[_0x4e99('0x2d')]);_0x34765d['filters']=_[_0x4e99('0x2e')](_0x34765d[_0x4e99('0x2f')],_0x34765d[_0x4e99('0x2d')]);_0x569cd8[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x34765d[_0x4e99('0x2f')],qs[_0x4e99('0x31')](_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x31')]));_0x569cd8[_0x4e99('0x30')]=_0x569cd8['attributes'][_0x4e99('0x32')]?_0x569cd8['attributes']:_0x34765d[_0x4e99('0x2f')];_0x569cd8['order']=qs[_0x4e99('0x35')](_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x35')]);_0x569cd8[_0x4e99('0x36')]=qs[_0x4e99('0x37')](_[_0x4e99('0x38')](_0x275b7b[_0x4e99('0x2d')],_0x34765d[_0x4e99('0x37')]));if(_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x39')]){_0x569cd8[_0x4e99('0x36')]=_[_0x4e99('0x42')](_0x569cd8[_0x4e99('0x36')],{'$or':_[_0x4e99('0x28')](_0x569cd8[_0x4e99('0x30')],function(_0x573266){var _0x4a2816={};_0x4a2816[_0x573266]={'$like':'%'+_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x39')]+'%'};return _0x4a2816;})});}_0x569cd8=_['merge']({},_0x569cd8,_0x275b7b[_0x4e99('0x3c')]);return _0x539e8f[_0x4e99('0x47')](_0x569cd8);}})[_0x4e99('0x22')](function(_0x1cd241){if(_0x1cd241){_0x41c26a=_0x1cd241[_0x4e99('0x32')];if(!_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x33')](_0x4e99('0x48'))){_0x569cd8[_0x4e99('0x1b')]=qs[_0x4e99('0x1b')](_0x275b7b[_0x4e99('0x2d')][_0x4e99('0x1b')]);_0x569cd8[_0x4e99('0x19')]=qs[_0x4e99('0x19')](_0x275b7b[_0x4e99('0x2d')]['offset']);}return _0x539e8f[_0x4e99('0x47')](_0x569cd8);}})[_0x4e99('0x22')](function(_0x43c7e9){if(_0x43c7e9){return _0x43c7e9?{'count':_0x41c26a,'rows':_0x43c7e9}:null;}})[_0x4e99('0x22')](respondWithResult(_0x5f1977,null))['catch'](handleError(_0x5f1977,null));};exports['getSubjects']=function(_0x4045b2,_0x32ff4e,_0xfebf39){var _0xae226c={};var _0x4c3399={};var _0x37d481;var _0x4606c0;return db[_0x4e99('0x29')][_0x4e99('0x46')]({'where':{'id':_0x4045b2[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x32ff4e,null))['then'](function(_0x1c5f36){if(_0x1c5f36){_0x37d481=_0x1c5f36;_0x4c3399['model']=_['keys'](db[_0x4e99('0x49')][_0x4e99('0x2a')]);_0x4c3399[_0x4e99('0x2d')]=_[_0x4e99('0x41')](_0x4045b2['query']);_0x4c3399['filters']=_[_0x4e99('0x2e')](_0x4c3399['model'],_0x4c3399[_0x4e99('0x2d')]);_0xae226c[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x4c3399[_0x4e99('0x2f')],qs[_0x4e99('0x31')](_0x4045b2[_0x4e99('0x2d')][_0x4e99('0x31')]));_0xae226c[_0x4e99('0x30')]=_0xae226c[_0x4e99('0x30')][_0x4e99('0x32')]?_0xae226c[_0x4e99('0x30')]:_0x4c3399[_0x4e99('0x2f')];_0xae226c['order']=qs[_0x4e99('0x35')](_0x4045b2[_0x4e99('0x2d')][_0x4e99('0x35')]);_0xae226c[_0x4e99('0x36')]=qs[_0x4e99('0x37')](_[_0x4e99('0x38')](_0x4045b2['query'],_0x4c3399[_0x4e99('0x37')]));if(_0x4045b2[_0x4e99('0x2d')][_0x4e99('0x39')]){_0xae226c['where']=_[_0x4e99('0x42')](_0xae226c['where'],{'$or':_[_0x4e99('0x28')](_0xae226c['attributes'],function(_0x2da46){var _0x54130c={};_0x54130c[_0x2da46]={'$like':'%'+_0x4045b2['query'][_0x4e99('0x39')]+'%'};return _0x54130c;})});}_0xae226c=_[_0x4e99('0x42')]({},_0xae226c,_0x4045b2[_0x4e99('0x3c')]);return _0x37d481[_0x4e99('0x4a')](_0xae226c);}})['then'](function(_0x4084fb){if(_0x4084fb){_0x4606c0=_0x4084fb[_0x4e99('0x32')];if(!_0x4045b2[_0x4e99('0x2d')][_0x4e99('0x33')](_0x4e99('0x48'))){_0xae226c[_0x4e99('0x1b')]=qs[_0x4e99('0x1b')](_0x4045b2[_0x4e99('0x2d')]['limit']);_0xae226c['offset']=qs['offset'](_0x4045b2[_0x4e99('0x2d')]['offset']);}return _0x37d481['getSubjects'](_0xae226c);}})['then'](function(_0x567cd4){if(_0x567cd4){return _0x567cd4?{'count':_0x4606c0,'rows':_0x567cd4}:null;}})[_0x4e99('0x22')](respondWithResult(_0x32ff4e,null))[_0x4e99('0x3f')](handleError(_0x32ff4e,null));};exports[_0x4e99('0x4b')]=function(_0x2546fd,_0x4e269b,_0xd19d7){var _0x42fefa={};var _0x4ec73a={};var _0x5bcbd2;var _0x70dc70;return db[_0x4e99('0x29')][_0x4e99('0x46')]({'where':{'id':_0x2546fd[_0x4e99('0x40')]['id']}})[_0x4e99('0x22')](handleEntityNotFound(_0x4e269b,null))[_0x4e99('0x22')](function(_0x54934d){if(_0x54934d){_0x5bcbd2=_0x54934d;_0x4ec73a[_0x4e99('0x2f')]=_[_0x4e99('0x41')](db[_0x4e99('0x49')][_0x4e99('0x2a')]);_0x4ec73a[_0x4e99('0x2d')]=_[_0x4e99('0x41')](_0x2546fd['query']);_0x4ec73a[_0x4e99('0x37')]=_['intersection'](_0x4ec73a['model'],_0x4ec73a['query']);_0x42fefa[_0x4e99('0x30')]=_[_0x4e99('0x2e')](_0x4ec73a[_0x4e99('0x2f')],qs['fields'](_0x2546fd[_0x4e99('0x2d')][_0x4e99('0x31')]));_0x42fefa[_0x4e99('0x30')]=_0x42fefa['attributes'][_0x4e99('0x32')]?_0x42fefa[_0x4e99('0x30')]:_0x4ec73a[_0x4e99('0x2f')];_0x42fefa[_0x4e99('0x34')]=qs[_0x4e99('0x35')](_0x2546fd['query'][_0x4e99('0x35')]);_0x42fefa[_0x4e99('0x36')]=qs[_0x4e99('0x37')](_['pick'](_0x2546fd[_0x4e99('0x2d')],_0x4ec73a[_0x4e99('0x37')]));if(_0x2546fd[_0x4e99('0x2d')][_0x4e99('0x39')]){_0x42fefa[_0x4e99('0x36')]=_[_0x4e99('0x42')](_0x42fefa[_0x4e99('0x36')],{'$or':_[_0x4e99('0x28')](_0x42fefa[_0x4e99('0x30')],function(_0x56a4cd){var _0x5a801a={};_0x5a801a[_0x56a4cd]={'$like':'%'+_0x2546fd[_0x4e99('0x2d')][_0x4e99('0x39')]+'%'};return _0x5a801a;})});}_0x42fefa=_[_0x4e99('0x42')]({},_0x42fefa,_0x2546fd[_0x4e99('0x3c')]);return _0x5bcbd2[_0x4e99('0x4b')](_0x42fefa);}})[_0x4e99('0x22')](function(_0x26535c){if(_0x26535c){_0x70dc70=_0x26535c[_0x4e99('0x32')];if(!_0x2546fd[_0x4e99('0x2d')]['hasOwnProperty'](_0x4e99('0x48'))){_0x42fefa[_0x4e99('0x1b')]=qs[_0x4e99('0x1b')](_0x2546fd[_0x4e99('0x2d')]['limit']);_0x42fefa['offset']=qs[_0x4e99('0x19')](_0x2546fd[_0x4e99('0x2d')][_0x4e99('0x19')]);}return _0x5bcbd2[_0x4e99('0x4b')](_0x42fefa);}})[_0x4e99('0x22')](function(_0x5b0ff2){if(_0x5b0ff2){return _0x5b0ff2?{'count':_0x70dc70,'rows':_0x5b0ff2}:null;}})[_0x4e99('0x22')](respondWithResult(_0x4e269b,null))['catch'](handleError(_0x4e269b,null));}; \ No newline at end of file +var _0xfc7b=['getFields','findOne','Dynamics365Field','hasOwnProperty','getSubjects','getDescriptions','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','Dynamics365Configuration','model','map','name','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','params','rawAttributes','includeAll','find','create','body'];(function(_0x3218fd,_0x174164){var _0x5dd1e6=function(_0x3b4700){while(--_0x3b4700){_0x3218fd['push'](_0x3218fd['shift']());}};_0x5dd1e6(++_0x174164);}(_0xfc7b,0x1f1));var _0xbfc7=function(_0x3531d0,_0x2d7fa6){_0x3531d0=_0x3531d0-0x0;var _0x5edec8=_0xfc7b[_0x3531d0];return _0x5edec8;};'use strict';var emlformat=require(_0xbfc7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbfc7('0x1'));var jsonpatch=require(_0xbfc7('0x2'));var rp=require(_0xbfc7('0x3'));var moment=require(_0xbfc7('0x4'));var BPromise=require(_0xbfc7('0x5'));var Mustache=require(_0xbfc7('0x6'));var util=require(_0xbfc7('0x7'));var path=require('path');var sox=require(_0xbfc7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbfc7('0x9'));var toCsv=require(_0xbfc7('0xa'));var querystring=require(_0xbfc7('0xb'));var Papa=require('papaparse');var Redis=require(_0xbfc7('0xc'));var authService=require(_0xbfc7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xbfc7('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfc7('0xf'))('api');var utils=require(_0xbfc7('0x10'));var config=require(_0xbfc7('0x11'));var licenseUtil=require(_0xbfc7('0x12'));var db=require(_0xbfc7('0x13'))['db'];function respondWithStatusCode(_0x26c95c,_0xe96b7b){_0xe96b7b=_0xe96b7b||0xcc;return function(_0x443e09){if(_0x443e09){return _0x26c95c['sendStatus'](_0xe96b7b);}return _0x26c95c[_0xbfc7('0x14')](_0xe96b7b)[_0xbfc7('0x15')]();};}function respondWithResult(_0x1565ba,_0x4665b8){_0x4665b8=_0x4665b8||0xc8;return function(_0x43148b){if(_0x43148b){return _0x1565ba[_0xbfc7('0x14')](_0x4665b8)[_0xbfc7('0x16')](_0x43148b);}};}function respondWithFilteredResult(_0x14efd4,_0x128f0f){return function(_0x232234){if(_0x232234){var _0x4b6252=typeof _0x128f0f[_0xbfc7('0x17')]===_0xbfc7('0x18')&&typeof _0x128f0f[_0xbfc7('0x19')]===_0xbfc7('0x18');var _0x4897e6=_0x232234['count'];var _0x1a6c90=_0x4b6252?0x0:_0x128f0f[_0xbfc7('0x17')];var _0x5a864d=_0x4b6252?_0x232234[_0xbfc7('0x1a')]:_0x128f0f[_0xbfc7('0x17')]+_0x128f0f[_0xbfc7('0x19')];var _0x4a851f;if(_0x5a864d>=_0x4897e6){_0x5a864d=_0x4897e6;_0x4a851f=0xc8;}else{_0x4a851f=0xce;}_0x14efd4[_0xbfc7('0x14')](_0x4a851f);return _0x14efd4[_0xbfc7('0x1b')](_0xbfc7('0x1c'),_0x1a6c90+'-'+_0x5a864d+'/'+_0x4897e6)[_0xbfc7('0x16')](_0x232234);}return null;};}function patchUpdates(_0x5397f2){return function(_0x3201d7){try{jsonpatch[_0xbfc7('0x1d')](_0x3201d7,_0x5397f2,!![]);}catch(_0x4eefd5){return BPromise[_0xbfc7('0x1e')](_0x4eefd5);}return _0x3201d7['save']();};}function saveUpdates(_0x1ba060,_0x56dce7){return function(_0x4d69b4){if(_0x4d69b4){return _0x4d69b4[_0xbfc7('0x1f')](_0x1ba060)[_0xbfc7('0x20')](function(_0x270dfa){return _0x270dfa;});}return null;};}function removeEntity(_0x2773aa,_0x4c957e){return function(_0x862bb){if(_0x862bb){return _0x862bb[_0xbfc7('0x21')]()['then'](function(){_0x2773aa['status'](0xcc)[_0xbfc7('0x15')]();});}};}function handleEntityNotFound(_0xf71ff0,_0x5d683c){return function(_0x5219ff){if(!_0x5219ff){_0xf71ff0['sendStatus'](0x194);}return _0x5219ff;};}function handleError(_0x1caf38,_0x2434df){_0x2434df=_0x2434df||0x1f4;return function(_0x1be031){logger['error'](_0x1be031[_0xbfc7('0x22')]);if(_0x1be031['name']){delete _0x1be031['name'];}_0x1caf38[_0xbfc7('0x14')](_0x2434df)['send'](_0x1be031);};}exports['index']=function(_0x480760,_0x469019){var _0x206c18={},_0x53c9e7={},_0x3304b3={'count':0x0,'rows':[]};var _0x577ed0=_['map'](db[_0xbfc7('0x23')]['rawAttributes'],function(_0x275178){return{'name':_0x275178['fieldName'],'type':_0x275178['type']['key']};});_0x53c9e7[_0xbfc7('0x24')]=_[_0xbfc7('0x25')](_0x577ed0,_0xbfc7('0x26'));_0x53c9e7[_0xbfc7('0x27')]=_[_0xbfc7('0x28')](_0x480760[_0xbfc7('0x27')]);_0x53c9e7[_0xbfc7('0x29')]=_[_0xbfc7('0x2a')](_0x53c9e7['model'],_0x53c9e7[_0xbfc7('0x27')]);_0x206c18[_0xbfc7('0x2b')]=_['intersection'](_0x53c9e7['model'],qs['fields'](_0x480760[_0xbfc7('0x27')][_0xbfc7('0x2c')]));_0x206c18[_0xbfc7('0x2b')]=_0x206c18['attributes'][_0xbfc7('0x2d')]?_0x206c18[_0xbfc7('0x2b')]:_0x53c9e7[_0xbfc7('0x24')];if(!_0x480760[_0xbfc7('0x27')]['hasOwnProperty'](_0xbfc7('0x2e'))){_0x206c18[_0xbfc7('0x19')]=qs[_0xbfc7('0x19')](_0x480760[_0xbfc7('0x27')]['limit']);_0x206c18[_0xbfc7('0x17')]=qs[_0xbfc7('0x17')](_0x480760[_0xbfc7('0x27')]['offset']);}_0x206c18[_0xbfc7('0x2f')]=qs[_0xbfc7('0x30')](_0x480760[_0xbfc7('0x27')]['sort']);_0x206c18[_0xbfc7('0x31')]=qs['filters'](_['pick'](_0x480760['query'],_0x53c9e7[_0xbfc7('0x29')]),_0x577ed0);if(_0x480760['query'][_0xbfc7('0x32')]){_0x206c18[_0xbfc7('0x31')]=_[_0xbfc7('0x33')](_0x206c18[_0xbfc7('0x31')],{'$or':_[_0xbfc7('0x25')](_0x577ed0,function(_0x272c9a){if(_0x272c9a['type']!==_0xbfc7('0x34')){var _0x3035b4={};_0x3035b4[_0x272c9a[_0xbfc7('0x26')]]={'$like':'%'+_0x480760['query'][_0xbfc7('0x32')]+'%'};return _0x3035b4;}})});}_0x206c18=_[_0xbfc7('0x33')]({},_0x206c18,_0x480760[_0xbfc7('0x35')]);var _0x31836c={'where':_0x206c18[_0xbfc7('0x31')]};return db[_0xbfc7('0x23')]['count'](_0x31836c)[_0xbfc7('0x20')](function(_0x322bf1){_0x3304b3['count']=_0x322bf1;if(_0x480760['query']['includeAll']){_0x206c18[_0xbfc7('0x36')]=[{'all':!![]}];}return db[_0xbfc7('0x23')]['findAll'](_0x206c18);})[_0xbfc7('0x20')](function(_0x48c9ca){_0x3304b3[_0xbfc7('0x37')]=_0x48c9ca;return _0x3304b3;})[_0xbfc7('0x20')](respondWithFilteredResult(_0x469019,_0x206c18))[_0xbfc7('0x38')](handleError(_0x469019,null));};exports['show']=function(_0x363720,_0xe2ded2){var _0x1253fa={'raw':![],'where':{'id':_0x363720[_0xbfc7('0x39')]['id']}},_0x315f49={};_0x315f49['model']=_[_0xbfc7('0x28')](db[_0xbfc7('0x23')][_0xbfc7('0x3a')]);_0x315f49[_0xbfc7('0x27')]=_[_0xbfc7('0x28')](_0x363720[_0xbfc7('0x27')]);_0x315f49['filters']=_[_0xbfc7('0x2a')](_0x315f49[_0xbfc7('0x24')],_0x315f49['query']);_0x1253fa[_0xbfc7('0x2b')]=_[_0xbfc7('0x2a')](_0x315f49[_0xbfc7('0x24')],qs['fields'](_0x363720[_0xbfc7('0x27')]['fields']));_0x1253fa[_0xbfc7('0x2b')]=_0x1253fa[_0xbfc7('0x2b')]['length']?_0x1253fa['attributes']:_0x315f49[_0xbfc7('0x24')];if(_0x363720[_0xbfc7('0x27')][_0xbfc7('0x3b')]){_0x1253fa['include']=[{'all':!![]}];}_0x1253fa=_[_0xbfc7('0x33')]({},_0x1253fa,_0x363720['options']);return db[_0xbfc7('0x23')][_0xbfc7('0x3c')](_0x1253fa)[_0xbfc7('0x20')](handleEntityNotFound(_0xe2ded2,null))[_0xbfc7('0x20')](respondWithResult(_0xe2ded2,null))[_0xbfc7('0x38')](handleError(_0xe2ded2,null));};exports[_0xbfc7('0x3d')]=function(_0x47e7da,_0x3b0a4e){return db[_0xbfc7('0x23')][_0xbfc7('0x3d')](_0x47e7da['body'],{})[_0xbfc7('0x20')](respondWithResult(_0x3b0a4e,0xc9))['catch'](handleError(_0x3b0a4e,null));};exports[_0xbfc7('0x1f')]=function(_0x54d83b,_0x192df8){if(_0x54d83b[_0xbfc7('0x3e')]['id']){delete _0x54d83b[_0xbfc7('0x3e')]['id'];}return db[_0xbfc7('0x23')][_0xbfc7('0x3c')]({'where':{'id':_0x54d83b[_0xbfc7('0x39')]['id']}})[_0xbfc7('0x20')](handleEntityNotFound(_0x192df8,null))[_0xbfc7('0x20')](saveUpdates(_0x54d83b[_0xbfc7('0x3e')],null))[_0xbfc7('0x20')](respondWithResult(_0x192df8,null))[_0xbfc7('0x38')](handleError(_0x192df8,null));};exports[_0xbfc7('0x21')]=function(_0x498acd,_0x47af0f){return db[_0xbfc7('0x23')][_0xbfc7('0x3c')]({'where':{'id':_0x498acd[_0xbfc7('0x39')]['id']}})[_0xbfc7('0x20')](handleEntityNotFound(_0x47af0f,null))['then'](removeEntity(_0x47af0f,null))[_0xbfc7('0x38')](handleError(_0x47af0f,null));};exports[_0xbfc7('0x3f')]=function(_0x296efa,_0x479d50,_0x401489){var _0x27d46c={};var _0x499dee={};var _0x10f184;var _0x3d9687;return db[_0xbfc7('0x23')][_0xbfc7('0x40')]({'where':{'id':_0x296efa[_0xbfc7('0x39')]['id']}})['then'](handleEntityNotFound(_0x479d50,null))[_0xbfc7('0x20')](function(_0x18d948){if(_0x18d948){_0x10f184=_0x18d948;_0x499dee[_0xbfc7('0x24')]=_[_0xbfc7('0x28')](db[_0xbfc7('0x41')][_0xbfc7('0x3a')]);_0x499dee[_0xbfc7('0x27')]=_['keys'](_0x296efa[_0xbfc7('0x27')]);_0x499dee[_0xbfc7('0x29')]=_[_0xbfc7('0x2a')](_0x499dee[_0xbfc7('0x24')],_0x499dee[_0xbfc7('0x27')]);_0x27d46c[_0xbfc7('0x2b')]=_[_0xbfc7('0x2a')](_0x499dee[_0xbfc7('0x24')],qs[_0xbfc7('0x2c')](_0x296efa['query'][_0xbfc7('0x2c')]));_0x27d46c[_0xbfc7('0x2b')]=_0x27d46c[_0xbfc7('0x2b')][_0xbfc7('0x2d')]?_0x27d46c[_0xbfc7('0x2b')]:_0x499dee[_0xbfc7('0x24')];_0x27d46c[_0xbfc7('0x2f')]=qs['sort'](_0x296efa[_0xbfc7('0x27')][_0xbfc7('0x30')]);_0x27d46c['where']=qs[_0xbfc7('0x29')](_['pick'](_0x296efa[_0xbfc7('0x27')],_0x499dee[_0xbfc7('0x29')]));if(_0x296efa[_0xbfc7('0x27')][_0xbfc7('0x32')]){_0x27d46c[_0xbfc7('0x31')]=_[_0xbfc7('0x33')](_0x27d46c[_0xbfc7('0x31')],{'$or':_[_0xbfc7('0x25')](_0x27d46c[_0xbfc7('0x2b')],function(_0x1b53d7){var _0x2e472f={};_0x2e472f[_0x1b53d7]={'$like':'%'+_0x296efa['query'][_0xbfc7('0x32')]+'%'};return _0x2e472f;})});}_0x27d46c=_[_0xbfc7('0x33')]({},_0x27d46c,_0x296efa['options']);return _0x10f184[_0xbfc7('0x3f')](_0x27d46c);}})[_0xbfc7('0x20')](function(_0x4daccc){if(_0x4daccc){_0x3d9687=_0x4daccc[_0xbfc7('0x2d')];if(!_0x296efa[_0xbfc7('0x27')][_0xbfc7('0x42')](_0xbfc7('0x2e'))){_0x27d46c[_0xbfc7('0x19')]=qs['limit'](_0x296efa[_0xbfc7('0x27')][_0xbfc7('0x19')]);_0x27d46c[_0xbfc7('0x17')]=qs[_0xbfc7('0x17')](_0x296efa[_0xbfc7('0x27')][_0xbfc7('0x17')]);}return _0x10f184[_0xbfc7('0x3f')](_0x27d46c);}})[_0xbfc7('0x20')](function(_0x3e4144){if(_0x3e4144){return _0x3e4144?{'count':_0x3d9687,'rows':_0x3e4144}:null;}})[_0xbfc7('0x20')](respondWithResult(_0x479d50,null))[_0xbfc7('0x38')](handleError(_0x479d50,null));};exports['getSubjects']=function(_0x1ea22a,_0x40d63f,_0x117d68){var _0x50254f={};var _0x185f62={};var _0x699cb8;var _0x5e43c6;return db[_0xbfc7('0x23')]['findOne']({'where':{'id':_0x1ea22a[_0xbfc7('0x39')]['id']}})['then'](handleEntityNotFound(_0x40d63f,null))[_0xbfc7('0x20')](function(_0x8c83e8){if(_0x8c83e8){_0x699cb8=_0x8c83e8;_0x185f62[_0xbfc7('0x24')]=_[_0xbfc7('0x28')](db[_0xbfc7('0x41')][_0xbfc7('0x3a')]);_0x185f62[_0xbfc7('0x27')]=_[_0xbfc7('0x28')](_0x1ea22a[_0xbfc7('0x27')]);_0x185f62[_0xbfc7('0x29')]=_['intersection'](_0x185f62[_0xbfc7('0x24')],_0x185f62[_0xbfc7('0x27')]);_0x50254f[_0xbfc7('0x2b')]=_[_0xbfc7('0x2a')](_0x185f62[_0xbfc7('0x24')],qs[_0xbfc7('0x2c')](_0x1ea22a[_0xbfc7('0x27')][_0xbfc7('0x2c')]));_0x50254f[_0xbfc7('0x2b')]=_0x50254f[_0xbfc7('0x2b')][_0xbfc7('0x2d')]?_0x50254f['attributes']:_0x185f62['model'];_0x50254f[_0xbfc7('0x2f')]=qs[_0xbfc7('0x30')](_0x1ea22a[_0xbfc7('0x27')][_0xbfc7('0x30')]);_0x50254f[_0xbfc7('0x31')]=qs[_0xbfc7('0x29')](_['pick'](_0x1ea22a['query'],_0x185f62['filters']));if(_0x1ea22a[_0xbfc7('0x27')][_0xbfc7('0x32')]){_0x50254f[_0xbfc7('0x31')]=_['merge'](_0x50254f['where'],{'$or':_['map'](_0x50254f[_0xbfc7('0x2b')],function(_0xe5a5d6){var _0xe8731e={};_0xe8731e[_0xe5a5d6]={'$like':'%'+_0x1ea22a[_0xbfc7('0x27')]['filter']+'%'};return _0xe8731e;})});}_0x50254f=_[_0xbfc7('0x33')]({},_0x50254f,_0x1ea22a[_0xbfc7('0x35')]);return _0x699cb8['getSubjects'](_0x50254f);}})[_0xbfc7('0x20')](function(_0x4e3902){if(_0x4e3902){_0x5e43c6=_0x4e3902[_0xbfc7('0x2d')];if(!_0x1ea22a[_0xbfc7('0x27')][_0xbfc7('0x42')]('nolimit')){_0x50254f[_0xbfc7('0x19')]=qs[_0xbfc7('0x19')](_0x1ea22a[_0xbfc7('0x27')][_0xbfc7('0x19')]);_0x50254f[_0xbfc7('0x17')]=qs[_0xbfc7('0x17')](_0x1ea22a[_0xbfc7('0x27')][_0xbfc7('0x17')]);}return _0x699cb8[_0xbfc7('0x43')](_0x50254f);}})[_0xbfc7('0x20')](function(_0x54a5ef){if(_0x54a5ef){return _0x54a5ef?{'count':_0x5e43c6,'rows':_0x54a5ef}:null;}})[_0xbfc7('0x20')](respondWithResult(_0x40d63f,null))[_0xbfc7('0x38')](handleError(_0x40d63f,null));};exports[_0xbfc7('0x44')]=function(_0x392ea2,_0x32cb43,_0xb922e3){var _0x48943f={};var _0x52c3dd={};var _0x499cb7;var _0x4c501c;return db[_0xbfc7('0x23')][_0xbfc7('0x40')]({'where':{'id':_0x392ea2[_0xbfc7('0x39')]['id']}})[_0xbfc7('0x20')](handleEntityNotFound(_0x32cb43,null))[_0xbfc7('0x20')](function(_0x4aedd8){if(_0x4aedd8){_0x499cb7=_0x4aedd8;_0x52c3dd[_0xbfc7('0x24')]=_['keys'](db[_0xbfc7('0x41')][_0xbfc7('0x3a')]);_0x52c3dd[_0xbfc7('0x27')]=_[_0xbfc7('0x28')](_0x392ea2['query']);_0x52c3dd[_0xbfc7('0x29')]=_[_0xbfc7('0x2a')](_0x52c3dd[_0xbfc7('0x24')],_0x52c3dd[_0xbfc7('0x27')]);_0x48943f[_0xbfc7('0x2b')]=_[_0xbfc7('0x2a')](_0x52c3dd[_0xbfc7('0x24')],qs[_0xbfc7('0x2c')](_0x392ea2[_0xbfc7('0x27')][_0xbfc7('0x2c')]));_0x48943f[_0xbfc7('0x2b')]=_0x48943f['attributes'][_0xbfc7('0x2d')]?_0x48943f[_0xbfc7('0x2b')]:_0x52c3dd[_0xbfc7('0x24')];_0x48943f['order']=qs[_0xbfc7('0x30')](_0x392ea2[_0xbfc7('0x27')]['sort']);_0x48943f['where']=qs[_0xbfc7('0x29')](_[_0xbfc7('0x45')](_0x392ea2['query'],_0x52c3dd[_0xbfc7('0x29')]));if(_0x392ea2[_0xbfc7('0x27')][_0xbfc7('0x32')]){_0x48943f[_0xbfc7('0x31')]=_[_0xbfc7('0x33')](_0x48943f['where'],{'$or':_[_0xbfc7('0x25')](_0x48943f['attributes'],function(_0x3f7043){var _0x1d8438={};_0x1d8438[_0x3f7043]={'$like':'%'+_0x392ea2[_0xbfc7('0x27')]['filter']+'%'};return _0x1d8438;})});}_0x48943f=_[_0xbfc7('0x33')]({},_0x48943f,_0x392ea2[_0xbfc7('0x35')]);return _0x499cb7['getDescriptions'](_0x48943f);}})[_0xbfc7('0x20')](function(_0x201e41){if(_0x201e41){_0x4c501c=_0x201e41[_0xbfc7('0x2d')];if(!_0x392ea2['query'][_0xbfc7('0x42')]('nolimit')){_0x48943f[_0xbfc7('0x19')]=qs['limit'](_0x392ea2['query']['limit']);_0x48943f['offset']=qs['offset'](_0x392ea2[_0xbfc7('0x27')][_0xbfc7('0x17')]);}return _0x499cb7['getDescriptions'](_0x48943f);}})[_0xbfc7('0x20')](function(_0x2cdd9b){if(_0x2cdd9b){return _0x2cdd9b?{'count':_0x4c501c,'rows':_0x2cdd9b}:null;}})[_0xbfc7('0x20')](respondWithResult(_0x32cb43,null))['catch'](handleError(_0x32cb43,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 7e708fa..a3e568b 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_0x4053b8,_0x236f4d){var _0x3b5e3e=function(_0x1bb48d){while(--_0x1bb48d){_0x4053b8['push'](_0x4053b8['shift']());}};_0x3b5e3e(++_0x236f4d);}(_0xedd9,0xfc));var _0x9edd=function(_0x573b69,_0x3bd144){_0x573b69=_0x573b69-0x0;var _0x4f4f25=_0xedd9[_0x573b69];return _0x4f4f25;};'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':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x9a19,0x114));var _0x99a1=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x9a19[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 4e924c3..3de3beb 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 _0x929f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird'];(function(_0x38eee0,_0x3e1bda){var _0x9748c0=function(_0x58f950){while(--_0x58f950){_0x38eee0['push'](_0x38eee0['shift']());}};_0x9748c0(++_0x3e1bda);}(_0x929f,0x1c8));var _0xf929=function(_0x37cdc5,_0x5510ba){_0x37cdc5=_0x37cdc5-0x0;var _0x1aa6be=_0x929f[_0x37cdc5];return _0x1aa6be;};'use strict';var _=require(_0xf929('0x0'));var util=require(_0xf929('0x1'));var moment=require(_0xf929('0x2'));var BPromise=require(_0xf929('0x3'));var rs=require(_0xf929('0x4'));var fs=require('fs');var Redis=require(_0xf929('0x5'));var db=require(_0xf929('0x6'))['db'];var utils=require(_0xf929('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf929('0x8'));var jayson=require(_0xf929('0x9'));var client=jayson[_0xf929('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x209ae1,_0x2d8d78,_0x12daea){return new BPromise(function(_0x12e273,_0x115275){return client['request'](_0x209ae1,_0x12daea)[_0xf929('0xb')](function(_0x3aaad3){logger[_0xf929('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2d8d78,'request\x20sent');logger['debug'](_0xf929('0xd'),_0x2d8d78,'request\x20sent',JSON['stringify'](_0x3aaad3));if(_0x3aaad3[_0xf929('0xe')]){if(_0x3aaad3[_0xf929('0xe')][_0xf929('0xf')]===0x1f4){logger[_0xf929('0xe')](_0xf929('0x10'),_0x2d8d78,_0x3aaad3[_0xf929('0xe')][_0xf929('0x11')]);return _0x115275(_0x3aaad3[_0xf929('0xe')][_0xf929('0x11')]);}logger[_0xf929('0xe')](_0xf929('0x10'),_0x2d8d78,_0x3aaad3['error'][_0xf929('0x11')]);return _0x12e273(_0x3aaad3[_0xf929('0xe')][_0xf929('0x11')]);}else{logger['info'](_0xf929('0x10'),_0x2d8d78,_0xf929('0x12'));_0x12e273(_0x3aaad3[_0xf929('0x13')][_0xf929('0x11')]);}})['catch'](function(_0x1802c9){logger['error'](_0xf929('0x10'),_0x2d8d78,_0x1802c9);_0x115275(_0x1802c9);});});} \ No newline at end of file +var _0x9f32=['code','Dynamics365Configuration,\x20%s,\x20%s','message','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x9f32,0x154));var _0x29f3=function(_0x47a5c5,_0x106018){_0x47a5c5=_0x47a5c5-0x0;var _0x41816b=_0x9f32[_0x47a5c5];return _0x41816b;};'use strict';var _=require('lodash');var util=require(_0x29f3('0x0'));var moment=require('moment');var BPromise=require(_0x29f3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x29f3('0x2'));var db=require(_0x29f3('0x3'))['db'];var utils=require(_0x29f3('0x4'));var logger=require(_0x29f3('0x5'))(_0x29f3('0x6'));var config=require(_0x29f3('0x7'));var jayson=require(_0x29f3('0x8'));var client=jayson[_0x29f3('0x9')][_0x29f3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcc1feb,_0x2a125f,_0x2507f7){return new BPromise(function(_0x101c92,_0x2d11ba){return client['request'](_0xcc1feb,_0x2507f7)[_0x29f3('0xb')](function(_0x44da5f){logger[_0x29f3('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2a125f,_0x29f3('0xd'));logger[_0x29f3('0xe')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2a125f,_0x29f3('0xd'),JSON[_0x29f3('0xf')](_0x44da5f));if(_0x44da5f[_0x29f3('0x10')]){if(_0x44da5f[_0x29f3('0x10')][_0x29f3('0x11')]===0x1f4){logger[_0x29f3('0x10')](_0x29f3('0x12'),_0x2a125f,_0x44da5f[_0x29f3('0x10')][_0x29f3('0x13')]);return _0x2d11ba(_0x44da5f[_0x29f3('0x10')][_0x29f3('0x13')]);}logger[_0x29f3('0x10')](_0x29f3('0x12'),_0x2a125f,_0x44da5f[_0x29f3('0x10')]['message']);return _0x101c92(_0x44da5f[_0x29f3('0x10')][_0x29f3('0x13')]);}else{logger[_0x29f3('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2a125f,_0x29f3('0xd'));_0x101c92(_0x44da5f['result']['message']);}})[_0x29f3('0x14')](function(_0x1c1932){logger['error'](_0x29f3('0x12'),_0x2a125f,_0x1c1932);_0x2d11ba(_0x1c1932);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 766f345..3250274 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 _0x8a14=['show','post','isAuthenticated','create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id'];(function(_0x44179f,_0x3e5b2e){var _0x44fb58=function(_0x228ded){while(--_0x228ded){_0x44179f['push'](_0x44179f['shift']());}};_0x44fb58(++_0x3e5b2e);}(_0x8a14,0xff));var _0x48a1=function(_0x5fc770,_0x4116c6){_0x5fc770=_0x5fc770-0x0;var _0x292910=_0x8a14[_0x5fc770];return _0x292910;};'use strict';var multer=require(_0x48a1('0x0'));var util=require('util');var path=require(_0x48a1('0x1'));var timeout=require(_0x48a1('0x2'));var express=require('express');var router=express[_0x48a1('0x3')]();var fs_extra=require(_0x48a1('0x4'));var auth=require(_0x48a1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x48a1('0x6'));var controller=require(_0x48a1('0x7'));router[_0x48a1('0x8')]('/',auth['isAuthenticated'](),controller[_0x48a1('0x9')]);router[_0x48a1('0x8')](_0x48a1('0xa'),auth['isAuthenticated'](),controller[_0x48a1('0xb')]);router[_0x48a1('0xc')]('/',auth[_0x48a1('0xd')](),controller[_0x48a1('0xe')]);router[_0x48a1('0xf')](_0x48a1('0xa'),auth[_0x48a1('0xd')](),controller[_0x48a1('0x10')]);router['delete'](_0x48a1('0xa'),auth['isAuthenticated'](),controller[_0x48a1('0x11')]);module[_0x48a1('0x12')]=router; \ No newline at end of file +var _0x4c12=['destroy','util','path','express','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete'];(function(_0x474c1c,_0x3622a5){var _0x432b68=function(_0x410275){while(--_0x410275){_0x474c1c['push'](_0x474c1c['shift']());}};_0x432b68(++_0x3622a5);}(_0x4c12,0x9a));var _0x24c1=function(_0x204ad4,_0x502841){_0x204ad4=_0x204ad4-0x0;var _0x50675f=_0x4c12[_0x204ad4];return _0x50675f;};'use strict';var multer=require('multer');var util=require(_0x24c1('0x0'));var path=require(_0x24c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x24c1('0x2'));var router=express['Router']();var fs_extra=require(_0x24c1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x24c1('0x4'));var config=require('../../config/environment');var controller=require(_0x24c1('0x5'));router[_0x24c1('0x6')]('/',auth['isAuthenticated'](),controller[_0x24c1('0x7')]);router[_0x24c1('0x6')](_0x24c1('0x8'),auth['isAuthenticated'](),controller[_0x24c1('0x9')]);router[_0x24c1('0xa')]('/',auth[_0x24c1('0xb')](),controller[_0x24c1('0xc')]);router[_0x24c1('0xd')](_0x24c1('0x8'),auth[_0x24c1('0xb')](),controller[_0x24c1('0xe')]);router[_0x24c1('0xf')](_0x24c1('0x8'),auth[_0x24c1('0xb')](),controller[_0x24c1('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 2dd6c31..53b547f 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 _0x2ad0=['STRING','customVariable','BOOLEAN','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2ad0,0x147));var _0x02ad=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x2ad0[_0x368e09];return _0x14b7df;};'use strict';var Sequelize=require('sequelize');module[_0x02ad('0x0')]={'type':{'type':Sequelize[_0x02ad('0x1')](_0x02ad('0x2'),_0x02ad('0x3'),'customVariable',_0x02ad('0x4'),_0x02ad('0x5')),'defaultValue':_0x02ad('0x2')},'content':{'type':Sequelize[_0x02ad('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x02ad('0x1')](_0x02ad('0x2'),_0x02ad('0x3'),_0x02ad('0x7'))},'keyContent':{'type':Sequelize[_0x02ad('0x6')]},'idField':{'type':Sequelize[_0x02ad('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x02ad('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02ad('0x6')]}}; \ No newline at end of file +var _0x9b59=['BOOLEAN','sequelize','exports','string','customVariable','picklist','STRING','ENUM','variable'];(function(_0x144863,_0x4503fd){var _0x2dd2b7=function(_0x181035){while(--_0x181035){_0x144863['push'](_0x144863['shift']());}};_0x2dd2b7(++_0x4503fd);}(_0x9b59,0x106));var _0x99b5=function(_0x568687,_0x339acc){_0x568687=_0x568687-0x0;var _0x3a1008=_0x9b59[_0x568687];return _0x3a1008;};'use strict';var Sequelize=require(_0x99b5('0x0'));module[_0x99b5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x99b5('0x2'),'variable',_0x99b5('0x3'),'keyValue',_0x99b5('0x4')),'defaultValue':_0x99b5('0x2')},'content':{'type':Sequelize[_0x99b5('0x5')]},'key':{'type':Sequelize[_0x99b5('0x5')]},'keyType':{'type':Sequelize[_0x99b5('0x6')]('string',_0x99b5('0x7'),_0x99b5('0x3'))},'keyContent':{'type':Sequelize[_0x99b5('0x5')]},'idField':{'type':Sequelize[_0x99b5('0x5')]},'nameField':{'type':Sequelize[_0x99b5('0x5')]},'customField':{'type':Sequelize[_0x99b5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x99b5('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index bc0fcfa..4476d5f 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 _0x4e4e=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','error','stack','name','send','index','map','Dynamics365Field','key'];(function(_0x30e8ee,_0x47bdb1){var _0x25ecb2=function(_0x34bd18){while(--_0x34bd18){_0x30e8ee['push'](_0x30e8ee['shift']());}};_0x25ecb2(++_0x47bdb1);}(_0x4e4e,0x18f));var _0xe4e4=function(_0x30efb7,_0x7a9aaf){_0x30efb7=_0x30efb7-0x0;var _0x31624e=_0x4e4e[_0x30efb7];return _0x31624e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e4('0x0'));var zipdir=require(_0xe4e4('0x1'));var jsonpatch=require(_0xe4e4('0x2'));var rp=require(_0xe4e4('0x3'));var moment=require(_0xe4e4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe4e4('0x5'));var util=require('util');var path=require(_0xe4e4('0x6'));var sox=require(_0xe4e4('0x7'));var csv=require('to-csv');var ejs=require(_0xe4e4('0x8'));var fs=require('fs');var fs_extra=require(_0xe4e4('0x9'));var _=require(_0xe4e4('0xa'));var squel=require('squel');var crypto=require(_0xe4e4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe4e4('0xc'));var toCsv=require(_0xe4e4('0xd'));var querystring=require(_0xe4e4('0xe'));var Papa=require(_0xe4e4('0xf'));var Redis=require(_0xe4e4('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe4e4('0x11'));var hardwareService=require(_0xe4e4('0x12'));var logger=require(_0xe4e4('0x13'))(_0xe4e4('0x14'));var utils=require(_0xe4e4('0x15'));var config=require(_0xe4e4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e4('0x17'))['db'];function respondWithStatusCode(_0x319632,_0x1f460c){_0x1f460c=_0x1f460c||0xcc;return function(_0x121718){if(_0x121718){return _0x319632[_0xe4e4('0x18')](_0x1f460c);}return _0x319632[_0xe4e4('0x19')](_0x1f460c)[_0xe4e4('0x1a')]();};}function respondWithResult(_0x32a4a9,_0x1ff32c){_0x1ff32c=_0x1ff32c||0xc8;return function(_0x33ea17){if(_0x33ea17){return _0x32a4a9[_0xe4e4('0x19')](_0x1ff32c)[_0xe4e4('0x1b')](_0x33ea17);}};}function respondWithFilteredResult(_0x5decd2,_0xb73f3c){return function(_0x519df7){if(_0x519df7){var _0x2cd9dc=typeof _0xb73f3c[_0xe4e4('0x1c')]===_0xe4e4('0x1d')&&typeof _0xb73f3c['limit']===_0xe4e4('0x1d');var _0x4067ca=_0x519df7['count'];var _0x21f89b=_0x2cd9dc?0x0:_0xb73f3c[_0xe4e4('0x1c')];var _0x3e7d70=_0x2cd9dc?_0x519df7[_0xe4e4('0x1e')]:_0xb73f3c[_0xe4e4('0x1c')]+_0xb73f3c[_0xe4e4('0x1f')];var _0x53ae73;if(_0x3e7d70>=_0x4067ca){_0x3e7d70=_0x4067ca;_0x53ae73=0xc8;}else{_0x53ae73=0xce;}_0x5decd2[_0xe4e4('0x19')](_0x53ae73);return _0x5decd2['set']('Content-Range',_0x21f89b+'-'+_0x3e7d70+'/'+_0x4067ca)[_0xe4e4('0x1b')](_0x519df7);}return null;};}function patchUpdates(_0x1c3bd9){return function(_0x134d13){try{jsonpatch[_0xe4e4('0x20')](_0x134d13,_0x1c3bd9,!![]);}catch(_0x3e1994){return BPromise[_0xe4e4('0x21')](_0x3e1994);}return _0x134d13[_0xe4e4('0x22')]();};}function saveUpdates(_0x15eeef,_0x21eb23){return function(_0x99e654){if(_0x99e654){return _0x99e654[_0xe4e4('0x23')](_0x15eeef)[_0xe4e4('0x24')](function(_0x3babda){return _0x3babda;});}return null;};}function removeEntity(_0x16d620,_0x161ed1){return function(_0x126e34){if(_0x126e34){return _0x126e34['destroy']()['then'](function(){_0x16d620[_0xe4e4('0x19')](0xcc)[_0xe4e4('0x1a')]();});}};}function handleEntityNotFound(_0x3ed4d4,_0x37d466){return function(_0x4f2abc){if(!_0x4f2abc){_0x3ed4d4[_0xe4e4('0x18')](0x194);}return _0x4f2abc;};}function handleError(_0x199636,_0x4bf208){_0x4bf208=_0x4bf208||0x1f4;return function(_0x7e8594){logger[_0xe4e4('0x25')](_0x7e8594[_0xe4e4('0x26')]);if(_0x7e8594['name']){delete _0x7e8594[_0xe4e4('0x27')];}_0x199636['status'](_0x4bf208)[_0xe4e4('0x28')](_0x7e8594);};}exports[_0xe4e4('0x29')]=function(_0x59126c,_0x1b33a9){var _0x2273fb={},_0x3b7711={},_0x5e788d={'count':0x0,'rows':[]};var _0x40cfe8=_[_0xe4e4('0x2a')](db[_0xe4e4('0x2b')]['rawAttributes'],function(_0x41fb34){return{'name':_0x41fb34['fieldName'],'type':_0x41fb34['type'][_0xe4e4('0x2c')]};});_0x3b7711['model']=_['map'](_0x40cfe8,_0xe4e4('0x27'));_0x3b7711['query']=_['keys'](_0x59126c[_0xe4e4('0x2d')]);_0x3b7711[_0xe4e4('0x2e')]=_[_0xe4e4('0x2f')](_0x3b7711[_0xe4e4('0x30')],_0x3b7711[_0xe4e4('0x2d')]);_0x2273fb[_0xe4e4('0x31')]=_['intersection'](_0x3b7711[_0xe4e4('0x30')],qs[_0xe4e4('0x32')](_0x59126c['query'][_0xe4e4('0x32')]));_0x2273fb[_0xe4e4('0x31')]=_0x2273fb['attributes'][_0xe4e4('0x33')]?_0x2273fb['attributes']:_0x3b7711[_0xe4e4('0x30')];if(!_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x34')](_0xe4e4('0x35'))){_0x2273fb[_0xe4e4('0x1f')]=qs[_0xe4e4('0x1f')](_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x1f')]);_0x2273fb[_0xe4e4('0x1c')]=qs['offset'](_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x1c')]);}_0x2273fb[_0xe4e4('0x36')]=qs[_0xe4e4('0x37')](_0x59126c['query'][_0xe4e4('0x37')]);_0x2273fb[_0xe4e4('0x38')]=qs[_0xe4e4('0x2e')](_[_0xe4e4('0x39')](_0x59126c[_0xe4e4('0x2d')],_0x3b7711[_0xe4e4('0x2e')]),_0x40cfe8);if(_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x3a')]){_0x2273fb[_0xe4e4('0x38')]=_[_0xe4e4('0x3b')](_0x2273fb[_0xe4e4('0x38')],{'$or':_[_0xe4e4('0x2a')](_0x40cfe8,function(_0x4eef80){if(_0x4eef80[_0xe4e4('0x3c')]!==_0xe4e4('0x3d')){var _0x5218bd={};_0x5218bd[_0x4eef80['name']]={'$like':'%'+_0x59126c['query']['filter']+'%'};return _0x5218bd;}})});}_0x2273fb=_[_0xe4e4('0x3b')]({},_0x2273fb,_0x59126c[_0xe4e4('0x3e')]);var _0x17c2f3={'where':_0x2273fb[_0xe4e4('0x38')]};return db[_0xe4e4('0x2b')][_0xe4e4('0x1e')](_0x17c2f3)[_0xe4e4('0x24')](function(_0x419f0c){_0x5e788d[_0xe4e4('0x1e')]=_0x419f0c;if(_0x59126c[_0xe4e4('0x2d')][_0xe4e4('0x3f')]){_0x2273fb[_0xe4e4('0x40')]=[{'all':!![]}];}return db[_0xe4e4('0x2b')][_0xe4e4('0x41')](_0x2273fb);})['then'](function(_0x4b0da3){_0x5e788d[_0xe4e4('0x42')]=_0x4b0da3;return _0x5e788d;})[_0xe4e4('0x24')](respondWithFilteredResult(_0x1b33a9,_0x2273fb))[_0xe4e4('0x43')](handleError(_0x1b33a9,null));};exports['show']=function(_0x4f47b9,_0x1217d4){var _0x4c5b71={'raw':!![],'where':{'id':_0x4f47b9[_0xe4e4('0x44')]['id']}},_0x284633={};_0x284633['model']=_[_0xe4e4('0x45')](db[_0xe4e4('0x2b')][_0xe4e4('0x46')]);_0x284633[_0xe4e4('0x2d')]=_[_0xe4e4('0x45')](_0x4f47b9[_0xe4e4('0x2d')]);_0x284633[_0xe4e4('0x2e')]=_[_0xe4e4('0x2f')](_0x284633[_0xe4e4('0x30')],_0x284633[_0xe4e4('0x2d')]);_0x4c5b71['attributes']=_[_0xe4e4('0x2f')](_0x284633[_0xe4e4('0x30')],qs[_0xe4e4('0x32')](_0x4f47b9[_0xe4e4('0x2d')][_0xe4e4('0x32')]));_0x4c5b71['attributes']=_0x4c5b71[_0xe4e4('0x31')][_0xe4e4('0x33')]?_0x4c5b71[_0xe4e4('0x31')]:_0x284633['model'];if(_0x4f47b9[_0xe4e4('0x2d')]['includeAll']){_0x4c5b71[_0xe4e4('0x40')]=[{'all':!![]}];}_0x4c5b71=_[_0xe4e4('0x3b')]({},_0x4c5b71,_0x4f47b9[_0xe4e4('0x3e')]);return db[_0xe4e4('0x2b')][_0xe4e4('0x47')](_0x4c5b71)[_0xe4e4('0x24')](handleEntityNotFound(_0x1217d4,null))[_0xe4e4('0x24')](respondWithResult(_0x1217d4,null))[_0xe4e4('0x43')](handleError(_0x1217d4,null));};exports[_0xe4e4('0x48')]=function(_0x1cbe2f,_0x2c35de){return db['Dynamics365Field'][_0xe4e4('0x48')](_0x1cbe2f[_0xe4e4('0x49')],{})[_0xe4e4('0x24')](respondWithResult(_0x2c35de,0xc9))[_0xe4e4('0x43')](handleError(_0x2c35de,null));};exports['update']=function(_0x20ba51,_0x1212ad){if(_0x20ba51[_0xe4e4('0x49')]['id']){delete _0x20ba51[_0xe4e4('0x49')]['id'];}return db[_0xe4e4('0x2b')]['find']({'where':{'id':_0x20ba51['params']['id']}})[_0xe4e4('0x24')](handleEntityNotFound(_0x1212ad,null))[_0xe4e4('0x24')](saveUpdates(_0x20ba51[_0xe4e4('0x49')],null))[_0xe4e4('0x24')](respondWithResult(_0x1212ad,null))['catch'](handleError(_0x1212ad,null));};exports['destroy']=function(_0x12d2e7,_0xcb4da5){return db[_0xe4e4('0x2b')][_0xe4e4('0x47')]({'where':{'id':_0x12d2e7['params']['id']}})[_0xe4e4('0x24')](handleEntityNotFound(_0xcb4da5,null))[_0xe4e4('0x24')](removeEntity(_0xcb4da5,null))['catch'](handleError(_0xcb4da5,null));}; \ No newline at end of file +var _0x6c5c=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','then','end','error','stack','name','index','map','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x2a6c5d,_0xb75cb8){var _0x5b2b6b=function(_0x4fea6b){while(--_0x4fea6b){_0x2a6c5d['push'](_0x2a6c5d['shift']());}};_0x5b2b6b(++_0xb75cb8);}(_0x6c5c,0x113));var _0xc6c5=function(_0x39e8cb,_0x2d096f){_0x39e8cb=_0x39e8cb-0x0;var _0x4168fa=_0x6c5c[_0x39e8cb];return _0x4168fa;};'use strict';var emlformat=require(_0xc6c5('0x0'));var rimraf=require(_0xc6c5('0x1'));var zipdir=require(_0xc6c5('0x2'));var jsonpatch=require(_0xc6c5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc6c5('0x4'));var Mustache=require(_0xc6c5('0x5'));var util=require(_0xc6c5('0x6'));var path=require(_0xc6c5('0x7'));var sox=require(_0xc6c5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6c5('0x9'));var _=require(_0xc6c5('0xa'));var squel=require(_0xc6c5('0xb'));var crypto=require('crypto');var jsforce=require(_0xc6c5('0xc'));var deskjs=require(_0xc6c5('0xd'));var toCsv=require(_0xc6c5('0xe'));var querystring=require(_0xc6c5('0xf'));var Papa=require(_0xc6c5('0x10'));var Redis=require(_0xc6c5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc6c5('0x12'));var as=require(_0xc6c5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6c5('0x14'))(_0xc6c5('0x15'));var utils=require(_0xc6c5('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc6c5('0x17'))['db'];function respondWithStatusCode(_0x20e7a6,_0x18be3e){_0x18be3e=_0x18be3e||0xcc;return function(_0x12a8fd){if(_0x12a8fd){return _0x20e7a6[_0xc6c5('0x18')](_0x18be3e);}return _0x20e7a6[_0xc6c5('0x19')](_0x18be3e)['end']();};}function respondWithResult(_0x3e5c55,_0x19db05){_0x19db05=_0x19db05||0xc8;return function(_0xea44d8){if(_0xea44d8){return _0x3e5c55[_0xc6c5('0x19')](_0x19db05)[_0xc6c5('0x1a')](_0xea44d8);}};}function respondWithFilteredResult(_0x4a70a5,_0x4fe3fd){return function(_0x4492b2){if(_0x4492b2){var _0x515161=typeof _0x4fe3fd[_0xc6c5('0x1b')]==='undefined'&&typeof _0x4fe3fd['limit']===_0xc6c5('0x1c');var _0x5d0fe2=_0x4492b2[_0xc6c5('0x1d')];var _0xf76024=_0x515161?0x0:_0x4fe3fd['offset'];var _0x27a174=_0x515161?_0x4492b2['count']:_0x4fe3fd[_0xc6c5('0x1b')]+_0x4fe3fd[_0xc6c5('0x1e')];var _0x105a80;if(_0x27a174>=_0x5d0fe2){_0x27a174=_0x5d0fe2;_0x105a80=0xc8;}else{_0x105a80=0xce;}_0x4a70a5[_0xc6c5('0x19')](_0x105a80);return _0x4a70a5[_0xc6c5('0x1f')](_0xc6c5('0x20'),_0xf76024+'-'+_0x27a174+'/'+_0x5d0fe2)[_0xc6c5('0x1a')](_0x4492b2);}return null;};}function patchUpdates(_0x45f5bf){return function(_0x5eb2ae){try{jsonpatch['apply'](_0x5eb2ae,_0x45f5bf,!![]);}catch(_0x3ed846){return BPromise['reject'](_0x3ed846);}return _0x5eb2ae[_0xc6c5('0x21')]();};}function saveUpdates(_0x1ffebc,_0x4c7218){return function(_0x2be394){if(_0x2be394){return _0x2be394[_0xc6c5('0x22')](_0x1ffebc)['then'](function(_0x522fd6){return _0x522fd6;});}return null;};}function removeEntity(_0x36aec4,_0x3c71d3){return function(_0xcc1a2a){if(_0xcc1a2a){return _0xcc1a2a[_0xc6c5('0x23')]()[_0xc6c5('0x24')](function(){_0x36aec4['status'](0xcc)[_0xc6c5('0x25')]();});}};}function handleEntityNotFound(_0x6982dd,_0x26affc){return function(_0x52ca3d){if(!_0x52ca3d){_0x6982dd['sendStatus'](0x194);}return _0x52ca3d;};}function handleError(_0x3d4350,_0x210333){_0x210333=_0x210333||0x1f4;return function(_0x1383eb){logger[_0xc6c5('0x26')](_0x1383eb[_0xc6c5('0x27')]);if(_0x1383eb[_0xc6c5('0x28')]){delete _0x1383eb[_0xc6c5('0x28')];}_0x3d4350[_0xc6c5('0x19')](_0x210333)['send'](_0x1383eb);};}exports[_0xc6c5('0x29')]=function(_0xdc9962,_0x110a22){var _0x497d11={},_0x4f9c75={},_0x3c868b={'count':0x0,'rows':[]};var _0x309c0d=_[_0xc6c5('0x2a')](db[_0xc6c5('0x2b')][_0xc6c5('0x2c')],function(_0x9aca21){return{'name':_0x9aca21[_0xc6c5('0x2d')],'type':_0x9aca21['type'][_0xc6c5('0x2e')]};});_0x4f9c75[_0xc6c5('0x2f')]=_[_0xc6c5('0x2a')](_0x309c0d,_0xc6c5('0x28'));_0x4f9c75[_0xc6c5('0x30')]=_[_0xc6c5('0x31')](_0xdc9962[_0xc6c5('0x30')]);_0x4f9c75[_0xc6c5('0x32')]=_[_0xc6c5('0x33')](_0x4f9c75['model'],_0x4f9c75[_0xc6c5('0x30')]);_0x497d11[_0xc6c5('0x34')]=_[_0xc6c5('0x33')](_0x4f9c75[_0xc6c5('0x2f')],qs[_0xc6c5('0x35')](_0xdc9962[_0xc6c5('0x30')][_0xc6c5('0x35')]));_0x497d11['attributes']=_0x497d11[_0xc6c5('0x34')][_0xc6c5('0x36')]?_0x497d11[_0xc6c5('0x34')]:_0x4f9c75[_0xc6c5('0x2f')];if(!_0xdc9962[_0xc6c5('0x30')]['hasOwnProperty'](_0xc6c5('0x37'))){_0x497d11[_0xc6c5('0x1e')]=qs[_0xc6c5('0x1e')](_0xdc9962[_0xc6c5('0x30')]['limit']);_0x497d11[_0xc6c5('0x1b')]=qs[_0xc6c5('0x1b')](_0xdc9962[_0xc6c5('0x30')][_0xc6c5('0x1b')]);}_0x497d11[_0xc6c5('0x38')]=qs[_0xc6c5('0x39')](_0xdc9962[_0xc6c5('0x30')][_0xc6c5('0x39')]);_0x497d11[_0xc6c5('0x3a')]=qs['filters'](_['pick'](_0xdc9962[_0xc6c5('0x30')],_0x4f9c75['filters']),_0x309c0d);if(_0xdc9962[_0xc6c5('0x30')][_0xc6c5('0x3b')]){_0x497d11[_0xc6c5('0x3a')]=_[_0xc6c5('0x3c')](_0x497d11[_0xc6c5('0x3a')],{'$or':_[_0xc6c5('0x2a')](_0x309c0d,function(_0x2a4a7e){if(_0x2a4a7e[_0xc6c5('0x3d')]!==_0xc6c5('0x3e')){var _0x4a8ba0={};_0x4a8ba0[_0x2a4a7e[_0xc6c5('0x28')]]={'$like':'%'+_0xdc9962[_0xc6c5('0x30')][_0xc6c5('0x3b')]+'%'};return _0x4a8ba0;}})});}_0x497d11=_[_0xc6c5('0x3c')]({},_0x497d11,_0xdc9962['options']);var _0x1a56df={'where':_0x497d11['where']};return db[_0xc6c5('0x2b')][_0xc6c5('0x1d')](_0x1a56df)[_0xc6c5('0x24')](function(_0x3be46f){_0x3c868b[_0xc6c5('0x1d')]=_0x3be46f;if(_0xdc9962[_0xc6c5('0x30')]['includeAll']){_0x497d11[_0xc6c5('0x3f')]=[{'all':!![]}];}return db[_0xc6c5('0x2b')][_0xc6c5('0x40')](_0x497d11);})[_0xc6c5('0x24')](function(_0x5cfd47){_0x3c868b[_0xc6c5('0x41')]=_0x5cfd47;return _0x3c868b;})[_0xc6c5('0x24')](respondWithFilteredResult(_0x110a22,_0x497d11))[_0xc6c5('0x42')](handleError(_0x110a22,null));};exports[_0xc6c5('0x43')]=function(_0x543c64,_0x303fc5){var _0x1c2817={'raw':!![],'where':{'id':_0x543c64['params']['id']}},_0x5bb046={};_0x5bb046[_0xc6c5('0x2f')]=_[_0xc6c5('0x31')](db['Dynamics365Field']['rawAttributes']);_0x5bb046[_0xc6c5('0x30')]=_[_0xc6c5('0x31')](_0x543c64['query']);_0x5bb046[_0xc6c5('0x32')]=_[_0xc6c5('0x33')](_0x5bb046[_0xc6c5('0x2f')],_0x5bb046[_0xc6c5('0x30')]);_0x1c2817[_0xc6c5('0x34')]=_['intersection'](_0x5bb046['model'],qs[_0xc6c5('0x35')](_0x543c64[_0xc6c5('0x30')][_0xc6c5('0x35')]));_0x1c2817['attributes']=_0x1c2817[_0xc6c5('0x34')][_0xc6c5('0x36')]?_0x1c2817[_0xc6c5('0x34')]:_0x5bb046['model'];if(_0x543c64['query']['includeAll']){_0x1c2817[_0xc6c5('0x3f')]=[{'all':!![]}];}_0x1c2817=_[_0xc6c5('0x3c')]({},_0x1c2817,_0x543c64[_0xc6c5('0x44')]);return db[_0xc6c5('0x2b')][_0xc6c5('0x45')](_0x1c2817)['then'](handleEntityNotFound(_0x303fc5,null))[_0xc6c5('0x24')](respondWithResult(_0x303fc5,null))[_0xc6c5('0x42')](handleError(_0x303fc5,null));};exports[_0xc6c5('0x46')]=function(_0x2ceafc,_0x1543fc){return db['Dynamics365Field'][_0xc6c5('0x46')](_0x2ceafc[_0xc6c5('0x47')],{})[_0xc6c5('0x24')](respondWithResult(_0x1543fc,0xc9))[_0xc6c5('0x42')](handleError(_0x1543fc,null));};exports[_0xc6c5('0x22')]=function(_0x2b792a,_0x7ec7ff){if(_0x2b792a[_0xc6c5('0x47')]['id']){delete _0x2b792a['body']['id'];}return db[_0xc6c5('0x2b')][_0xc6c5('0x45')]({'where':{'id':_0x2b792a['params']['id']}})[_0xc6c5('0x24')](handleEntityNotFound(_0x7ec7ff,null))[_0xc6c5('0x24')](saveUpdates(_0x2b792a[_0xc6c5('0x47')],null))[_0xc6c5('0x24')](respondWithResult(_0x7ec7ff,null))[_0xc6c5('0x42')](handleError(_0x7ec7ff,null));};exports['destroy']=function(_0x37bd70,_0x123bba){return db[_0xc6c5('0x2b')][_0xc6c5('0x45')]({'where':{'id':_0x37bd70[_0xc6c5('0x48')]['id']}})[_0xc6c5('0x24')](handleEntityNotFound(_0x123bba,null))[_0xc6c5('0x24')](removeEntity(_0x123bba,null))[_0xc6c5('0x42')](handleError(_0x123bba,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index d1c6e7a..3d9a286 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 _0x8299=['../../config/logger','bluebird','request-promise','rimraf','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0x8299,0xd0));var _0x9829=function(_0x3ef1dc,_0x210a81){_0x3ef1dc=_0x3ef1dc-0x0;var _0x151f5f=_0x8299[_0x3ef1dc];return _0x151f5f;};'use strict';var _=require(_0x9829('0x0'));var util=require('util');var logger=require(_0x9829('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9829('0x2'));var rp=require(_0x9829('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9829('0x4'));var config=require('../../config/environment');var attributes=require(_0x9829('0x5'));module['exports']=function(_0xc4a6f,_0x4fd6b4){return _0xc4a6f[_0x9829('0x6')](_0x9829('0x7'),attributes,{'tableName':_0x9829('0x8'),'paranoid':![],'indexes':[{'name':_0x9829('0x9'),'fields':['idField',_0x9829('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x33c0=['Dynamics365Field','int_dynamics365_fields','idField','FieldId','util','api','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define'];(function(_0x1070b3,_0x5348d3){var _0x16e491=function(_0x1bfed5){while(--_0x1bfed5){_0x1070b3['push'](_0x1070b3['shift']());}};_0x16e491(++_0x5348d3);}(_0x33c0,0x160));var _0x033c=function(_0x1ad770,_0x28bd83){_0x1ad770=_0x1ad770-0x0;var _0x42132f=_0x33c0[_0x1ad770];return _0x42132f;};'use strict';var _=require('lodash');var util=require(_0x033c('0x0'));var logger=require('../../config/logger')(_0x033c('0x1'));var moment=require('moment');var BPromise=require(_0x033c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x033c('0x3'));var rimraf=require(_0x033c('0x4'));var config=require(_0x033c('0x5'));var attributes=require(_0x033c('0x6'));module['exports']=function(_0x25d04f,_0x2ce6a7){return _0x25d04f[_0x033c('0x7')](_0x033c('0x8'),attributes,{'tableName':_0x033c('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x033c('0xa'),_0x033c('0xb')],'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 0ee2270..dd06e7a 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 _0xf71b=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5b9224,_0x3a20ec){var _0x33f2ab=function(_0x1e5201){while(--_0x1e5201){_0x5b9224['push'](_0x5b9224['shift']());}};_0x33f2ab(++_0x3a20ec);}(_0xf71b,0x8d));var _0xbf71=function(_0x3e85a1,_0x431ad2){_0x3e85a1=_0x3e85a1-0x0;var _0x3e8502=_0xf71b[_0x3e85a1];return _0x3e8502;};'use strict';var _=require(_0xbf71('0x0'));var util=require(_0xbf71('0x1'));var moment=require('moment');var BPromise=require(_0xbf71('0x2'));var rs=require(_0xbf71('0x3'));var fs=require('fs');var Redis=require(_0xbf71('0x4'));var db=require(_0xbf71('0x5'))['db'];var utils=require(_0xbf71('0x6'));var logger=require(_0xbf71('0x7'))(_0xbf71('0x8'));var config=require(_0xbf71('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbf71('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x220935,_0x2552ca,_0x308024){return new BPromise(function(_0x3a7510,_0x1acdbd){return client[_0xbf71('0xb')](_0x220935,_0x308024)[_0xbf71('0xc')](function(_0x4ef7dd){logger[_0xbf71('0xd')](_0xbf71('0xe'),_0x2552ca,_0xbf71('0xf'));logger[_0xbf71('0x10')](_0xbf71('0x11'),_0x2552ca,_0xbf71('0xf'),JSON[_0xbf71('0x12')](_0x4ef7dd));if(_0x4ef7dd[_0xbf71('0x13')]){if(_0x4ef7dd['error'][_0xbf71('0x14')]===0x1f4){logger[_0xbf71('0x13')](_0xbf71('0xe'),_0x2552ca,_0x4ef7dd[_0xbf71('0x13')]['message']);return _0x1acdbd(_0x4ef7dd[_0xbf71('0x13')][_0xbf71('0x15')]);}logger[_0xbf71('0x13')](_0xbf71('0xe'),_0x2552ca,_0x4ef7dd[_0xbf71('0x13')][_0xbf71('0x15')]);return _0x3a7510(_0x4ef7dd[_0xbf71('0x13')][_0xbf71('0x15')]);}else{logger[_0xbf71('0xd')](_0xbf71('0xe'),_0x2552ca,_0xbf71('0xf'));_0x3a7510(_0x4ef7dd['result'][_0xbf71('0x15')]);}})[_0xbf71('0x16')](function(_0x3205d0){logger[_0xbf71('0x13')](_0xbf71('0xe'),_0x2552ca,_0x3205d0);_0x1acdbd(_0x3205d0);});});} \ No newline at end of file +var _0x3046=['request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5966e2,_0x32749b){var _0x347a5c=function(_0x4d6ae1){while(--_0x4d6ae1){_0x5966e2['push'](_0x5966e2['shift']());}};_0x347a5c(++_0x32749b);}(_0x3046,0x180));var _0x6304=function(_0x2f7e9c,_0x1888a2){_0x2f7e9c=_0x2f7e9c-0x0;var _0x2c50aa=_0x3046[_0x2f7e9c];return _0x2c50aa;};'use strict';var _=require(_0x6304('0x0'));var util=require(_0x6304('0x1'));var moment=require(_0x6304('0x2'));var BPromise=require(_0x6304('0x3'));var rs=require(_0x6304('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6304('0x5'))['db'];var utils=require(_0x6304('0x6'));var logger=require(_0x6304('0x7'))('rpc');var config=require(_0x6304('0x8'));var jayson=require(_0x6304('0x9'));var client=jayson[_0x6304('0xa')][_0x6304('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c124f,_0x2bfb99,_0x4f24a8){return new BPromise(function(_0x4af249,_0x3b29e1){return client[_0x6304('0xc')](_0x5c124f,_0x4f24a8)[_0x6304('0xd')](function(_0x58557e){logger[_0x6304('0xe')](_0x6304('0xf'),_0x2bfb99,_0x6304('0x10'));logger['debug'](_0x6304('0x11'),_0x2bfb99,_0x6304('0x10'),JSON[_0x6304('0x12')](_0x58557e));if(_0x58557e[_0x6304('0x13')]){if(_0x58557e[_0x6304('0x13')][_0x6304('0x14')]===0x1f4){logger['error'](_0x6304('0xf'),_0x2bfb99,_0x58557e[_0x6304('0x13')]['message']);return _0x3b29e1(_0x58557e[_0x6304('0x13')][_0x6304('0x15')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2bfb99,_0x58557e['error'][_0x6304('0x15')]);return _0x4af249(_0x58557e[_0x6304('0x13')]['message']);}else{logger[_0x6304('0xe')](_0x6304('0xf'),_0x2bfb99,_0x6304('0x10'));_0x4af249(_0x58557e['result'][_0x6304('0x15')]);}})['catch'](function(_0x9fdd4){logger[_0x6304('0x13')](_0x6304('0xf'),_0x2bfb99,_0x9fdd4);_0x3b29e1(_0x9fdd4);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index d5414d7..0765fab 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 _0x77fc=['delete','exports','path','express','Router','fs-extra','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put'];(function(_0x346b49,_0x35206c){var _0x13c4fc=function(_0x155aa4){while(--_0x155aa4){_0x346b49['push'](_0x346b49['shift']());}};_0x13c4fc(++_0x35206c);}(_0x77fc,0xe9));var _0xc77f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x77fc[_0x397e5f];return _0x5302b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc77f('0x0'));var timeout=require('connect-timeout');var express=require(_0xc77f('0x1'));var router=express[_0xc77f('0x2')]();var fs_extra=require(_0xc77f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc77f('0x4'));var controller=require(_0xc77f('0x5'));router['get']('/',auth[_0xc77f('0x6')](),controller[_0xc77f('0x7')]);router[_0xc77f('0x8')](_0xc77f('0x9'),auth[_0xc77f('0x6')](),controller[_0xc77f('0xa')]);router[_0xc77f('0x8')](_0xc77f('0xb'),auth[_0xc77f('0x6')](),controller[_0xc77f('0xc')]);router[_0xc77f('0x8')](_0xc77f('0xd'),auth[_0xc77f('0x6')](),controller[_0xc77f('0xe')]);router[_0xc77f('0xf')]('/',auth['isAuthenticated'](),controller[_0xc77f('0x10')]);router['post'](_0xc77f('0xb'),auth[_0xc77f('0x6')](),controller[_0xc77f('0x11')]);router[_0xc77f('0x12')](_0xc77f('0x9'),auth[_0xc77f('0x6')](),controller['update']);router[_0xc77f('0x13')](_0xc77f('0x9'),auth[_0xc77f('0x6')](),controller['destroy']);module[_0xc77f('0x14')]=router; \ No newline at end of file +var _0xf0b5=['addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations'];(function(_0x10952c,_0x31b1f9){var _0x1e6df4=function(_0x34d1c7){while(--_0x34d1c7){_0x10952c['push'](_0x10952c['shift']());}};_0x1e6df4(++_0x31b1f9);}(_0xf0b5,0x18f));var _0x5f0b=function(_0x504439,_0x592c72){_0x504439=_0x504439-0x0;var _0x22a0e0=_0xf0b5[_0x504439];return _0x22a0e0;};'use strict';var multer=require(_0x5f0b('0x0'));var util=require(_0x5f0b('0x1'));var path=require(_0x5f0b('0x2'));var timeout=require(_0x5f0b('0x3'));var express=require(_0x5f0b('0x4'));var router=express[_0x5f0b('0x5')]();var fs_extra=require(_0x5f0b('0x6'));var auth=require(_0x5f0b('0x7'));var interaction=require(_0x5f0b('0x8'));var config=require(_0x5f0b('0x9'));var controller=require(_0x5f0b('0xa'));router['get']('/',auth[_0x5f0b('0xb')](),controller[_0x5f0b('0xc')]);router[_0x5f0b('0xd')]('/:id',auth[_0x5f0b('0xb')](),controller[_0x5f0b('0xe')]);router[_0x5f0b('0xd')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5f0b('0xf')]);router[_0x5f0b('0xd')](_0x5f0b('0x10'),auth['isAuthenticated'](),controller[_0x5f0b('0x11')]);router[_0x5f0b('0x12')]('/',auth[_0x5f0b('0xb')](),controller[_0x5f0b('0x13')]);router['post'](_0x5f0b('0x14'),auth['isAuthenticated'](),controller[_0x5f0b('0x15')]);router[_0x5f0b('0x16')](_0x5f0b('0x17'),auth[_0x5f0b('0xb')](),controller[_0x5f0b('0x18')]);router[_0x5f0b('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x5f0b('0x1a')]);module[_0x5f0b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 4df308b..6aab685 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 _0xef0f=['sequelize','STRING','remoteUri'];(function(_0x9879a7,_0x2c1070){var _0x54e12c=function(_0x254cd7){while(--_0x254cd7){_0x9879a7['push'](_0x9879a7['shift']());}};_0x54e12c(++_0x2c1070);}(_0xef0f,0x168));var _0xfef0=function(_0x553473,_0x4b409b){_0x553473=_0x553473-0x0;var _0x1f0387=_0xef0f[_0x553473];return _0x1f0387;};'use strict';var Sequelize=require(_0xfef0('0x0'));module['exports']={'name':{'type':Sequelize[_0xfef0('0x1')]},'description':{'type':Sequelize[_0xfef0('0x1')]},'username':{'type':Sequelize[_0xfef0('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xfef0('0x1')]},'remoteUri':{'type':Sequelize[_0xfef0('0x1')],'unique':_0xfef0('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x781d=['sequelize','exports','STRING','username','remoteUri'];(function(_0x5aedbc,_0x41eab8){var _0xc9a701=function(_0x3e965e){while(--_0x3e965e){_0x5aedbc['push'](_0x5aedbc['shift']());}};_0xc9a701(++_0x41eab8);}(_0x781d,0x14a));var _0xd781=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x781d[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0xd781('0x0'));module[_0xd781('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x3')},'apiKey':{'type':Sequelize[_0xd781('0x2')]},'remoteUri':{'type':Sequelize[_0xd781('0x2')],'unique':_0xd781('0x4')},'serverUrl':{'type':Sequelize[_0xd781('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 31768c5..a8d63b7 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 _0xbdb7=['reject','save','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','model','attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','FreshdeskAccount','include','findAll','rows','intersection','length','includeAll','options','catch','create','body','update','find','params','destroy','getConfigurations','hasOwnProperty','nolimit','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskConfiguration','FreshdeskField','getFields','apiKey','remoteUri','slice','format','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','agent','description','group','ticket_type','company','remove','includes','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','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','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x2deb2b,_0x35f4e5){var _0x5836a0=function(_0x10d89b){while(--_0x10d89b){_0x2deb2b['push'](_0x2deb2b['shift']());}};_0x5836a0(++_0x35f4e5);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x14e001,_0x569bf){_0x14e001=_0x14e001-0x0;var _0x2c09da=_0xbdb7[_0x14e001];return _0x2c09da;};'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'];var integrations=require(_0x7bdb('0x17'));function respondWithStatusCode(_0x496613,_0x8d74ff){_0x8d74ff=_0x8d74ff||0xcc;return function(_0x53021d){if(_0x53021d){return _0x496613['sendStatus'](_0x8d74ff);}return _0x496613[_0x7bdb('0x18')](_0x8d74ff)[_0x7bdb('0x19')]();};}function respondWithResult(_0x4fd91a,_0x50eeca){_0x50eeca=_0x50eeca||0xc8;return function(_0x4e98f7){if(_0x4e98f7){return _0x4fd91a[_0x7bdb('0x18')](_0x50eeca)[_0x7bdb('0x1a')](_0x4e98f7);}};}function respondWithFilteredResult(_0xe9919f,_0x25d417){return function(_0x31c909){if(_0x31c909){var _0xbde12a=typeof _0x25d417[_0x7bdb('0x1b')]===_0x7bdb('0x1c')&&typeof _0x25d417['limit']===_0x7bdb('0x1c');var _0x43f352=_0x31c909[_0x7bdb('0x1d')];var _0x2aff6a=_0xbde12a?0x0:_0x25d417['offset'];var _0x41f540=_0xbde12a?_0x31c909[_0x7bdb('0x1d')]:_0x25d417['offset']+_0x25d417[_0x7bdb('0x1e')];var _0x31f78e;if(_0x41f540>=_0x43f352){_0x41f540=_0x43f352;_0x31f78e=0xc8;}else{_0x31f78e=0xce;}_0xe9919f[_0x7bdb('0x18')](_0x31f78e);return _0xe9919f[_0x7bdb('0x1f')](_0x7bdb('0x20'),_0x2aff6a+'-'+_0x41f540+'/'+_0x43f352)['json'](_0x31c909);}return null;};}function patchUpdates(_0x49f353){return function(_0x677825){try{jsonpatch[_0x7bdb('0x21')](_0x677825,_0x49f353,!![]);}catch(_0x5daea4){return BPromise[_0x7bdb('0x22')](_0x5daea4);}return _0x677825[_0x7bdb('0x23')]();};}function saveUpdates(_0x346c72,_0x3f53e7){return function(_0x3a1d0f){if(_0x3a1d0f){return _0x3a1d0f['update'](_0x346c72)[_0x7bdb('0x24')](function(_0xdad53d){return _0xdad53d;});}return null;};}function removeEntity(_0x40c447,_0x3a456f){return function(_0x481f4b){if(_0x481f4b){return _0x481f4b['destroy']()[_0x7bdb('0x24')](function(){_0x40c447['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a9e02,_0x2abef6){return function(_0x51ab04){if(!_0x51ab04){_0x4a9e02[_0x7bdb('0x25')](0x194);}return _0x51ab04;};}function handleError(_0x72ba69,_0x3ec129){_0x3ec129=_0x3ec129||0x1f4;return function(_0x7c09cf){logger[_0x7bdb('0x26')](_0x7c09cf['stack']);if(_0x7c09cf[_0x7bdb('0x27')]){delete _0x7c09cf[_0x7bdb('0x27')];}_0x72ba69[_0x7bdb('0x18')](_0x3ec129)[_0x7bdb('0x28')](_0x7c09cf);};}exports[_0x7bdb('0x29')]=function(_0x2e8e65,_0x1e9996){var _0xd2d7be={},_0x25a1fe={},_0x365c02={'count':0x0,'rows':[]};var _0x9ec48d=_[_0x7bdb('0x2a')](db['FreshdeskAccount'][_0x7bdb('0x2b')],function(_0x23fc3a){return{'name':_0x23fc3a[_0x7bdb('0x2c')],'type':_0x23fc3a[_0x7bdb('0x2d')][_0x7bdb('0x2e')]};});_0x25a1fe['model']=_[_0x7bdb('0x2a')](_0x9ec48d,_0x7bdb('0x27'));_0x25a1fe[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x2e8e65['query']);_0x25a1fe['filters']=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],_0x25a1fe['query']);_0xd2d7be[_0x7bdb('0x32')]=_['intersection'](_0x25a1fe[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x2e8e65[_0x7bdb('0x2f')]['fields']));_0xd2d7be[_0x7bdb('0x32')]=_0xd2d7be['attributes']['length']?_0xd2d7be[_0x7bdb('0x32')]:_0x25a1fe['model'];if(!_0x2e8e65[_0x7bdb('0x2f')]['hasOwnProperty']('nolimit')){_0xd2d7be[_0x7bdb('0x1e')]=qs[_0x7bdb('0x1e')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x1e')]);_0xd2d7be[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x2e8e65['query'][_0x7bdb('0x1b')]);}_0xd2d7be[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x2e8e65[_0x7bdb('0x2f')][_0x7bdb('0x35')]);_0xd2d7be[_0x7bdb('0x36')]=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x2e8e65[_0x7bdb('0x2f')],_0x25a1fe['filters']),_0x9ec48d);if(_0x2e8e65['query'][_0x7bdb('0x39')]){_0xd2d7be[_0x7bdb('0x36')]=_[_0x7bdb('0x3a')](_0xd2d7be[_0x7bdb('0x36')],{'$or':_[_0x7bdb('0x2a')](_0x9ec48d,function(_0x509e90){if(_0x509e90['type']!==_0x7bdb('0x3b')){var _0x5d7c1f={};_0x5d7c1f[_0x509e90[_0x7bdb('0x27')]]={'$like':'%'+_0x2e8e65['query'][_0x7bdb('0x39')]+'%'};return _0x5d7c1f;}})});}_0xd2d7be=_['merge']({},_0xd2d7be,_0x2e8e65['options']);var _0x21dae7={'where':_0xd2d7be[_0x7bdb('0x36')]};return db[_0x7bdb('0x3c')][_0x7bdb('0x1d')](_0x21dae7)[_0x7bdb('0x24')](function(_0x2b4829){_0x365c02[_0x7bdb('0x1d')]=_0x2b4829;if(_0x2e8e65['query']['includeAll']){_0xd2d7be[_0x7bdb('0x3d')]=[{'all':!![]}];}return db[_0x7bdb('0x3c')][_0x7bdb('0x3e')](_0xd2d7be);})[_0x7bdb('0x24')](function(_0x39fbca){_0x365c02[_0x7bdb('0x3f')]=_0x39fbca;return _0x365c02;})[_0x7bdb('0x24')](respondWithFilteredResult(_0x1e9996,_0xd2d7be))['catch'](handleError(_0x1e9996,null));};exports['show']=function(_0x1bcbcd,_0x8e893e){var _0x4636f8={'raw':![],'where':{'id':_0x1bcbcd['params']['id']}},_0x72a81c={};_0x72a81c[_0x7bdb('0x31')]=_['keys'](db[_0x7bdb('0x3c')][_0x7bdb('0x2b')]);_0x72a81c[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x1bcbcd[_0x7bdb('0x2f')]);_0x72a81c[_0x7bdb('0x37')]=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],_0x72a81c[_0x7bdb('0x2f')]);_0x4636f8['attributes']=_[_0x7bdb('0x40')](_0x72a81c[_0x7bdb('0x31')],qs['fields'](_0x1bcbcd[_0x7bdb('0x2f')]['fields']));_0x4636f8[_0x7bdb('0x32')]=_0x4636f8[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x4636f8[_0x7bdb('0x32')]:_0x72a81c[_0x7bdb('0x31')];if(_0x1bcbcd['query'][_0x7bdb('0x42')]){_0x4636f8[_0x7bdb('0x3d')]=[{'all':!![]}];}_0x4636f8=_[_0x7bdb('0x3a')]({},_0x4636f8,_0x1bcbcd[_0x7bdb('0x43')]);return db[_0x7bdb('0x3c')]['find'](_0x4636f8)[_0x7bdb('0x24')](handleEntityNotFound(_0x8e893e,null))[_0x7bdb('0x24')](respondWithResult(_0x8e893e,null))[_0x7bdb('0x44')](handleError(_0x8e893e,null));};exports[_0x7bdb('0x45')]=function(_0x259007,_0x25c534){return db[_0x7bdb('0x3c')][_0x7bdb('0x45')](_0x259007[_0x7bdb('0x46')],{})[_0x7bdb('0x24')](respondWithResult(_0x25c534,0xc9))['catch'](handleError(_0x25c534,null));};exports[_0x7bdb('0x47')]=function(_0x58c4bc,_0x47cccd){if(_0x58c4bc[_0x7bdb('0x46')]['id']){delete _0x58c4bc[_0x7bdb('0x46')]['id'];}return db['FreshdeskAccount'][_0x7bdb('0x48')]({'where':{'id':_0x58c4bc[_0x7bdb('0x49')]['id']}})['then'](handleEntityNotFound(_0x47cccd,null))['then'](saveUpdates(_0x58c4bc['body'],null))[_0x7bdb('0x24')](respondWithResult(_0x47cccd,null))[_0x7bdb('0x44')](handleError(_0x47cccd,null));};exports[_0x7bdb('0x4a')]=function(_0x46410c,_0x33687b){return db[_0x7bdb('0x3c')][_0x7bdb('0x48')]({'where':{'id':_0x46410c[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x33687b,null))[_0x7bdb('0x24')](removeEntity(_0x33687b,null))['catch'](handleError(_0x33687b,null));};exports[_0x7bdb('0x4b')]=function(_0x4806e0,_0x240425,_0x27358d){var _0x5d564d={};var _0x457886={};var _0x493d23;var _0x258f29;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x4806e0[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x240425,null))['then'](function(_0x4e17f3){if(_0x4e17f3){_0x493d23=_0x4e17f3;_0x457886['model']=_[_0x7bdb('0x30')](db['FreshdeskConfiguration']['rawAttributes']);_0x457886[_0x7bdb('0x2f')]=_[_0x7bdb('0x30')](_0x4806e0[_0x7bdb('0x2f')]);_0x457886[_0x7bdb('0x37')]=_['intersection'](_0x457886[_0x7bdb('0x31')],_0x457886['query']);_0x5d564d[_0x7bdb('0x32')]=_[_0x7bdb('0x40')](_0x457886[_0x7bdb('0x31')],qs[_0x7bdb('0x33')](_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x33')]));_0x5d564d['attributes']=_0x5d564d[_0x7bdb('0x32')][_0x7bdb('0x41')]?_0x5d564d[_0x7bdb('0x32')]:_0x457886['model'];_0x5d564d[_0x7bdb('0x34')]=qs[_0x7bdb('0x35')](_0x4806e0['query'][_0x7bdb('0x35')]);_0x5d564d['where']=qs[_0x7bdb('0x37')](_[_0x7bdb('0x38')](_0x4806e0['query'],_0x457886['filters']));if(_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x39')]){_0x5d564d['where']=_[_0x7bdb('0x3a')](_0x5d564d['where'],{'$or':_[_0x7bdb('0x2a')](_0x5d564d['attributes'],function(_0x496cc3){var _0x22ef9c={};_0x22ef9c[_0x496cc3]={'$like':'%'+_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x39')]+'%'};return _0x22ef9c;})});}_0x5d564d=_[_0x7bdb('0x3a')]({},_0x5d564d,_0x4806e0[_0x7bdb('0x43')]);return _0x493d23[_0x7bdb('0x4b')](_0x5d564d);}})[_0x7bdb('0x24')](function(_0x8cf13a){if(_0x8cf13a){_0x258f29=_0x8cf13a[_0x7bdb('0x41')];if(!_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x4c')](_0x7bdb('0x4d'))){_0x5d564d['limit']=qs[_0x7bdb('0x1e')](_0x4806e0[_0x7bdb('0x2f')]['limit']);_0x5d564d[_0x7bdb('0x1b')]=qs[_0x7bdb('0x1b')](_0x4806e0[_0x7bdb('0x2f')][_0x7bdb('0x1b')]);}return _0x493d23[_0x7bdb('0x4b')](_0x5d564d);}})['then'](function(_0xa5624f){if(_0xa5624f){return _0xa5624f?{'count':_0x258f29,'rows':_0xa5624f}:null;}})[_0x7bdb('0x24')](respondWithResult(_0x240425,null))[_0x7bdb('0x44')](handleError(_0x240425,null));};exports['addConfiguration']=function(_0x3dbcf,_0x2c2fb7,_0x33b93a){if(_0x3dbcf[_0x7bdb('0x46')]['id']){delete _0x3dbcf[_0x7bdb('0x46')]['id'];}return db[_0x7bdb('0x3c')][_0x7bdb('0x4e')]({'where':{'id':_0x3dbcf[_0x7bdb('0x49')]['id']}})[_0x7bdb('0x24')](handleEntityNotFound(_0x2c2fb7,null))['then'](function(_0x7a7c4a){if(_0x7a7c4a){_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x4f')]=_0x7a7c4a['id'];_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x50')]=integrations[_0x7bdb('0x51')](_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x52')],_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x2d')]);_0x3dbcf[_0x7bdb('0x46')][_0x7bdb('0x53')]=integrations[_0x7bdb('0x54')](_0x3dbcf['body'][_0x7bdb('0x52')],_0x3dbcf['body'][_0x7bdb('0x2d')]);return db[_0x7bdb('0x55')][_0x7bdb('0x45')](_0x3dbcf['body'],{'include':[{'model':db[_0x7bdb('0x56')],'as':_0x7bdb('0x50')},{'model':db['FreshdeskField'],'as':_0x7bdb('0x53')}]});}return null;})[_0x7bdb('0x24')](respondWithResult(_0x2c2fb7,null))['catch'](handleError(_0x2c2fb7,null));};exports[_0x7bdb('0x57')]=function(_0x1a706b,_0x579caa,_0x291fd3){var _0x237688='';return db['FreshdeskAccount'][_0x7bdb('0x4e')]({'where':{'id':_0x1a706b[_0x7bdb('0x49')]['id']},'attributes':['id','remoteUri',_0x7bdb('0x58')]})['then'](handleEntityNotFound(_0x579caa,null))[_0x7bdb('0x24')](function(_0x25136b){if(_0x25136b){_0x237688=_0x25136b[_0x7bdb('0x59')];var _0x21dd9a=_0x237688[_0x7bdb('0x5a')](-0x1);if(_0x21dd9a==='/'){_0x237688=_0x237688['substring'](0x0,_0x237688['lastIndexOf'](_0x21dd9a));}return rp({'method':'GET','uri':util[_0x7bdb('0x5b')]('%s/%s',_0x237688,_0x7bdb('0x5c')),'headers':{'Authorization':util[_0x7bdb('0x5b')](_0x7bdb('0x5d'),new Buffer(util['format']('%s:X',_0x25136b[_0x7bdb('0x58')]))[_0x7bdb('0x5e')](_0x7bdb('0x5f')))},'json':!![]});}})[_0x7bdb('0x24')](function(_0x572cbe){if(_0x572cbe){var _0x194908=[_0x7bdb('0x60'),_0x7bdb('0x61'),_0x7bdb('0x62'),_0x7bdb('0x63'),_0x7bdb('0x18'),'priority',_0x7bdb('0x64'),'source',_0x7bdb('0x65'),'group',_0x7bdb('0x66')];_[_0x7bdb('0x67')](_0x572cbe,function(_0xee6d78){return _0x194908[_0x7bdb('0x68')](_0xee6d78[_0x7bdb('0x27')])||!_0xee6d78['default']&&_0xee6d78['type']!==_0x7bdb('0x69')&&_0xee6d78[_0x7bdb('0x2d')]!=='custom_dropdown';});return{'count':_0x572cbe[_0x7bdb('0x41')],'rows':_[_0x7bdb('0x2a')](_0x572cbe,function(_0x5a674b){return{'id':_0x5a674b[_0x7bdb('0x27')],'name':_0x5a674b[_0x7bdb('0x6a')],'custom':!_0x5a674b['default'],'options':_0x5a674b[_0x7bdb('0x6b')]?_['map'](_0x5a674b['choices'],function(_0x18d686){return{'name':_[_0x7bdb('0x6c')](_0x18d686),'value':_0x18d686};}):[]};})};}})['then'](respondWithResult(_0x579caa,null))['catch'](function(_0xd5881e){var _0x566a9e=_0x1a706b[_0x7bdb('0x2f')]['test']?0x1f4:_0xd5881e[_0x7bdb('0x6d')]||0x1f4;logger[_0x7bdb('0x26')](_0x7bdb('0x6e'),_0x7bdb('0x57'),_0x566a9e,JSON['stringify'](_0xd5881e));delete _0xd5881e[_0x7bdb('0x27')];if(_0x566a9e===0x191){_0x566a9e=0x190;}_0x579caa[_0x7bdb('0x18')](_0x566a9e)['send'](_0x1a706b[_0x7bdb('0x2f')][_0x7bdb('0x6f')]?{'message':'Wrong\x20credentials','statusCode':_0xd5881e[_0x7bdb('0x6d')]}:_0xd5881e);});}; \ No newline at end of file +var _0x50c1=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','destroy','then','error','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','findOne','FreshdeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','source','ticket_type','group','remove','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','stringify','send','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x50c1,0x1b6));var _0x150c=function(_0x3ca2dd,_0x56fd93){_0x3ca2dd=_0x3ca2dd-0x0;var _0x5d5b7a=_0x50c1[_0x3ca2dd];return _0x5d5b7a;};'use strict';var emlformat=require(_0x150c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x150c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x150c('0x2'));var moment=require(_0x150c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x150c('0x4'));var util=require(_0x150c('0x5'));var path=require(_0x150c('0x6'));var sox=require(_0x150c('0x7'));var csv=require('to-csv');var ejs=require(_0x150c('0x8'));var fs=require('fs');var fs_extra=require(_0x150c('0x9'));var _=require('lodash');var squel=require(_0x150c('0xa'));var crypto=require(_0x150c('0xb'));var jsforce=require(_0x150c('0xc'));var deskjs=require(_0x150c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x150c('0xe'));var Papa=require(_0x150c('0xf'));var Redis=require(_0x150c('0x10'));var authService=require(_0x150c('0x11'));var qs=require(_0x150c('0x12'));var as=require(_0x150c('0x13'));var hardwareService=require(_0x150c('0x14'));var logger=require('../../config/logger')(_0x150c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x150c('0x16'));var db=require(_0x150c('0x17'))['db'];var integrations=require(_0x150c('0x18'));function respondWithStatusCode(_0x110e2f,_0x1d9959){_0x1d9959=_0x1d9959||0xcc;return function(_0x1c42b2){if(_0x1c42b2){return _0x110e2f[_0x150c('0x19')](_0x1d9959);}return _0x110e2f[_0x150c('0x1a')](_0x1d9959)[_0x150c('0x1b')]();};}function respondWithResult(_0x50c0a7,_0x5d6950){_0x5d6950=_0x5d6950||0xc8;return function(_0x5412ca){if(_0x5412ca){return _0x50c0a7[_0x150c('0x1a')](_0x5d6950)[_0x150c('0x1c')](_0x5412ca);}};}function respondWithFilteredResult(_0x269861,_0x168e47){return function(_0x2add86){if(_0x2add86){var _0x11ff13=typeof _0x168e47['offset']===_0x150c('0x1d')&&typeof _0x168e47[_0x150c('0x1e')]==='undefined';var _0x46c10e=_0x2add86[_0x150c('0x1f')];var _0x5bc046=_0x11ff13?0x0:_0x168e47[_0x150c('0x20')];var _0x460221=_0x11ff13?_0x2add86['count']:_0x168e47[_0x150c('0x20')]+_0x168e47['limit'];var _0x21149b;if(_0x460221>=_0x46c10e){_0x460221=_0x46c10e;_0x21149b=0xc8;}else{_0x21149b=0xce;}_0x269861['status'](_0x21149b);return _0x269861['set']('Content-Range',_0x5bc046+'-'+_0x460221+'/'+_0x46c10e)[_0x150c('0x1c')](_0x2add86);}return null;};}function patchUpdates(_0x2d4e47){return function(_0x256f7c){try{jsonpatch[_0x150c('0x21')](_0x256f7c,_0x2d4e47,!![]);}catch(_0x1fd1e7){return BPromise[_0x150c('0x22')](_0x1fd1e7);}return _0x256f7c[_0x150c('0x23')]();};}function saveUpdates(_0x3eff82,_0x8b1177){return function(_0xce2eca){if(_0xce2eca){return _0xce2eca['update'](_0x3eff82)['then'](function(_0x1b0c6c){return _0x1b0c6c;});}return null;};}function removeEntity(_0x3afccf,_0x4061c5){return function(_0x25e31c){if(_0x25e31c){return _0x25e31c[_0x150c('0x24')]()[_0x150c('0x25')](function(){_0x3afccf[_0x150c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x92d995,_0x186b29){return function(_0x551806){if(!_0x551806){_0x92d995[_0x150c('0x19')](0x194);}return _0x551806;};}function handleError(_0x4c1da9,_0x42ecb1){_0x42ecb1=_0x42ecb1||0x1f4;return function(_0x1fdd94){logger[_0x150c('0x26')](_0x1fdd94['stack']);if(_0x1fdd94[_0x150c('0x27')]){delete _0x1fdd94[_0x150c('0x27')];}_0x4c1da9[_0x150c('0x1a')](_0x42ecb1)['send'](_0x1fdd94);};}exports[_0x150c('0x28')]=function(_0x5721d7,_0x54eaf7){var _0xd94002={},_0x59f362={},_0x5b7bb5={'count':0x0,'rows':[]};var _0x425764=_[_0x150c('0x29')](db[_0x150c('0x2a')][_0x150c('0x2b')],function(_0x3a042c){return{'name':_0x3a042c[_0x150c('0x2c')],'type':_0x3a042c[_0x150c('0x2d')][_0x150c('0x2e')]};});_0x59f362['model']=_[_0x150c('0x29')](_0x425764,_0x150c('0x27'));_0x59f362['query']=_[_0x150c('0x2f')](_0x5721d7[_0x150c('0x30')]);_0x59f362['filters']=_['intersection'](_0x59f362[_0x150c('0x31')],_0x59f362[_0x150c('0x30')]);_0xd94002[_0x150c('0x32')]=_[_0x150c('0x33')](_0x59f362[_0x150c('0x31')],qs[_0x150c('0x34')](_0x5721d7['query'][_0x150c('0x34')]));_0xd94002[_0x150c('0x32')]=_0xd94002[_0x150c('0x32')][_0x150c('0x35')]?_0xd94002['attributes']:_0x59f362[_0x150c('0x31')];if(!_0x5721d7['query'][_0x150c('0x36')](_0x150c('0x37'))){_0xd94002[_0x150c('0x1e')]=qs['limit'](_0x5721d7[_0x150c('0x30')][_0x150c('0x1e')]);_0xd94002[_0x150c('0x20')]=qs[_0x150c('0x20')](_0x5721d7[_0x150c('0x30')][_0x150c('0x20')]);}_0xd94002[_0x150c('0x38')]=qs['sort'](_0x5721d7[_0x150c('0x30')][_0x150c('0x39')]);_0xd94002[_0x150c('0x3a')]=qs[_0x150c('0x3b')](_['pick'](_0x5721d7[_0x150c('0x30')],_0x59f362[_0x150c('0x3b')]),_0x425764);if(_0x5721d7[_0x150c('0x30')][_0x150c('0x3c')]){_0xd94002[_0x150c('0x3a')]=_['merge'](_0xd94002[_0x150c('0x3a')],{'$or':_['map'](_0x425764,function(_0x47fcf4){if(_0x47fcf4[_0x150c('0x2d')]!==_0x150c('0x3d')){var _0x454e05={};_0x454e05[_0x47fcf4['name']]={'$like':'%'+_0x5721d7[_0x150c('0x30')][_0x150c('0x3c')]+'%'};return _0x454e05;}})});}_0xd94002=_[_0x150c('0x3e')]({},_0xd94002,_0x5721d7[_0x150c('0x3f')]);var _0x242157={'where':_0xd94002[_0x150c('0x3a')]};return db[_0x150c('0x2a')][_0x150c('0x1f')](_0x242157)[_0x150c('0x25')](function(_0x52cb4e){_0x5b7bb5['count']=_0x52cb4e;if(_0x5721d7[_0x150c('0x30')][_0x150c('0x40')]){_0xd94002[_0x150c('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0x150c('0x42')](_0xd94002);})[_0x150c('0x25')](function(_0x1b16ef){_0x5b7bb5[_0x150c('0x43')]=_0x1b16ef;return _0x5b7bb5;})['then'](respondWithFilteredResult(_0x54eaf7,_0xd94002))[_0x150c('0x44')](handleError(_0x54eaf7,null));};exports['show']=function(_0x4b5d21,_0x2b3d27){var _0x3b6e03={'raw':![],'where':{'id':_0x4b5d21[_0x150c('0x45')]['id']}},_0x4f9a73={};_0x4f9a73[_0x150c('0x31')]=_[_0x150c('0x2f')](db[_0x150c('0x2a')]['rawAttributes']);_0x4f9a73[_0x150c('0x30')]=_[_0x150c('0x2f')](_0x4b5d21[_0x150c('0x30')]);_0x4f9a73[_0x150c('0x3b')]=_[_0x150c('0x33')](_0x4f9a73[_0x150c('0x31')],_0x4f9a73[_0x150c('0x30')]);_0x3b6e03['attributes']=_[_0x150c('0x33')](_0x4f9a73[_0x150c('0x31')],qs['fields'](_0x4b5d21[_0x150c('0x30')]['fields']));_0x3b6e03[_0x150c('0x32')]=_0x3b6e03[_0x150c('0x32')][_0x150c('0x35')]?_0x3b6e03[_0x150c('0x32')]:_0x4f9a73[_0x150c('0x31')];if(_0x4b5d21['query'][_0x150c('0x40')]){_0x3b6e03[_0x150c('0x41')]=[{'all':!![]}];}_0x3b6e03=_[_0x150c('0x3e')]({},_0x3b6e03,_0x4b5d21[_0x150c('0x3f')]);return db[_0x150c('0x2a')][_0x150c('0x46')](_0x3b6e03)[_0x150c('0x25')](handleEntityNotFound(_0x2b3d27,null))[_0x150c('0x25')](respondWithResult(_0x2b3d27,null))['catch'](handleError(_0x2b3d27,null));};exports['create']=function(_0x46c159,_0xd9bb6f){return db[_0x150c('0x2a')][_0x150c('0x47')](_0x46c159[_0x150c('0x48')],{})[_0x150c('0x25')](respondWithResult(_0xd9bb6f,0xc9))[_0x150c('0x44')](handleError(_0xd9bb6f,null));};exports['update']=function(_0x3f39da,_0x254e55){if(_0x3f39da[_0x150c('0x48')]['id']){delete _0x3f39da[_0x150c('0x48')]['id'];}return db[_0x150c('0x2a')]['find']({'where':{'id':_0x3f39da[_0x150c('0x45')]['id']}})['then'](handleEntityNotFound(_0x254e55,null))['then'](saveUpdates(_0x3f39da[_0x150c('0x48')],null))[_0x150c('0x25')](respondWithResult(_0x254e55,null))['catch'](handleError(_0x254e55,null));};exports[_0x150c('0x24')]=function(_0x141e66,_0x41b668){return db['FreshdeskAccount'][_0x150c('0x46')]({'where':{'id':_0x141e66['params']['id']}})[_0x150c('0x25')](handleEntityNotFound(_0x41b668,null))[_0x150c('0x25')](removeEntity(_0x41b668,null))[_0x150c('0x44')](handleError(_0x41b668,null));};exports['getConfigurations']=function(_0x344e81,_0x46146d,_0x5e0218){var _0x1a5351={};var _0x4f06ec={};var _0x4205c5;var _0x13f84d;return db['FreshdeskAccount'][_0x150c('0x49')]({'where':{'id':_0x344e81[_0x150c('0x45')]['id']}})[_0x150c('0x25')](handleEntityNotFound(_0x46146d,null))[_0x150c('0x25')](function(_0x36540e){if(_0x36540e){_0x4205c5=_0x36540e;_0x4f06ec[_0x150c('0x31')]=_[_0x150c('0x2f')](db[_0x150c('0x4a')]['rawAttributes']);_0x4f06ec[_0x150c('0x30')]=_[_0x150c('0x2f')](_0x344e81[_0x150c('0x30')]);_0x4f06ec['filters']=_['intersection'](_0x4f06ec[_0x150c('0x31')],_0x4f06ec[_0x150c('0x30')]);_0x1a5351[_0x150c('0x32')]=_['intersection'](_0x4f06ec[_0x150c('0x31')],qs[_0x150c('0x34')](_0x344e81['query'][_0x150c('0x34')]));_0x1a5351[_0x150c('0x32')]=_0x1a5351[_0x150c('0x32')]['length']?_0x1a5351['attributes']:_0x4f06ec[_0x150c('0x31')];_0x1a5351[_0x150c('0x38')]=qs[_0x150c('0x39')](_0x344e81[_0x150c('0x30')][_0x150c('0x39')]);_0x1a5351[_0x150c('0x3a')]=qs[_0x150c('0x3b')](_['pick'](_0x344e81[_0x150c('0x30')],_0x4f06ec[_0x150c('0x3b')]));if(_0x344e81[_0x150c('0x30')]['filter']){_0x1a5351[_0x150c('0x3a')]=_[_0x150c('0x3e')](_0x1a5351[_0x150c('0x3a')],{'$or':_[_0x150c('0x29')](_0x1a5351[_0x150c('0x32')],function(_0x4a8290){var _0x2e28cc={};_0x2e28cc[_0x4a8290]={'$like':'%'+_0x344e81['query'][_0x150c('0x3c')]+'%'};return _0x2e28cc;})});}_0x1a5351=_['merge']({},_0x1a5351,_0x344e81[_0x150c('0x3f')]);return _0x4205c5[_0x150c('0x4b')](_0x1a5351);}})[_0x150c('0x25')](function(_0xd5311e){if(_0xd5311e){_0x13f84d=_0xd5311e[_0x150c('0x35')];if(!_0x344e81['query'][_0x150c('0x36')](_0x150c('0x37'))){_0x1a5351['limit']=qs[_0x150c('0x1e')](_0x344e81[_0x150c('0x30')]['limit']);_0x1a5351[_0x150c('0x20')]=qs[_0x150c('0x20')](_0x344e81[_0x150c('0x30')][_0x150c('0x20')]);}return _0x4205c5[_0x150c('0x4b')](_0x1a5351);}})[_0x150c('0x25')](function(_0x3e2a79){if(_0x3e2a79){return _0x3e2a79?{'count':_0x13f84d,'rows':_0x3e2a79}:null;}})['then'](respondWithResult(_0x46146d,null))[_0x150c('0x44')](handleError(_0x46146d,null));};exports[_0x150c('0x4c')]=function(_0x580957,_0x2e60b8,_0x22732b){if(_0x580957['body']['id']){delete _0x580957[_0x150c('0x48')]['id'];}return db[_0x150c('0x2a')]['findOne']({'where':{'id':_0x580957[_0x150c('0x45')]['id']}})[_0x150c('0x25')](handleEntityNotFound(_0x2e60b8,null))[_0x150c('0x25')](function(_0x3474d7){if(_0x3474d7){_0x580957[_0x150c('0x48')][_0x150c('0x4d')]=_0x3474d7['id'];_0x580957[_0x150c('0x48')][_0x150c('0x4e')]=integrations[_0x150c('0x4f')](_0x580957[_0x150c('0x48')][_0x150c('0x50')],_0x580957[_0x150c('0x48')][_0x150c('0x2d')]);_0x580957[_0x150c('0x48')][_0x150c('0x51')]=integrations[_0x150c('0x52')](_0x580957[_0x150c('0x48')][_0x150c('0x50')],_0x580957[_0x150c('0x48')][_0x150c('0x2d')]);return db[_0x150c('0x4a')][_0x150c('0x47')](_0x580957[_0x150c('0x48')],{'include':[{'model':db['FreshdeskField'],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x150c('0x25')](respondWithResult(_0x2e60b8,null))[_0x150c('0x44')](handleError(_0x2e60b8,null));};exports[_0x150c('0x53')]=function(_0x3ccdaa,_0x114a3c,_0x1a4067){var _0x5875cf='';return db[_0x150c('0x2a')][_0x150c('0x49')]({'where':{'id':_0x3ccdaa[_0x150c('0x45')]['id']},'attributes':['id',_0x150c('0x54'),'apiKey']})[_0x150c('0x25')](handleEntityNotFound(_0x114a3c,null))[_0x150c('0x25')](function(_0x386433){if(_0x386433){_0x5875cf=_0x386433[_0x150c('0x54')];var _0x5f28ab=_0x5875cf[_0x150c('0x55')](-0x1);if(_0x5f28ab==='/'){_0x5875cf=_0x5875cf[_0x150c('0x56')](0x0,_0x5875cf[_0x150c('0x57')](_0x5f28ab));}return rp({'method':_0x150c('0x58'),'uri':util['format'](_0x150c('0x59'),_0x5875cf,_0x150c('0x5a')),'headers':{'Authorization':util[_0x150c('0x5b')](_0x150c('0x5c'),new Buffer(util['format'](_0x150c('0x5d'),_0x386433['apiKey']))[_0x150c('0x5e')](_0x150c('0x5f')))},'json':!![]});}})['then'](function(_0x1f23c7){if(_0x1f23c7){var _0xb85648=[_0x150c('0x60'),_0x150c('0x61'),_0x150c('0x62'),'description',_0x150c('0x1a'),_0x150c('0x63'),'group',_0x150c('0x64'),_0x150c('0x65'),_0x150c('0x66'),'company'];_[_0x150c('0x67')](_0x1f23c7,function(_0x2a8ec9){return _0xb85648['includes'](_0x2a8ec9[_0x150c('0x27')])||!_0x2a8ec9[_0x150c('0x68')]&&_0x2a8ec9[_0x150c('0x2d')]!==_0x150c('0x69')&&_0x2a8ec9[_0x150c('0x2d')]!==_0x150c('0x6a');});return{'count':_0x1f23c7[_0x150c('0x35')],'rows':_[_0x150c('0x29')](_0x1f23c7,function(_0x1108d8){return{'id':_0x1108d8[_0x150c('0x27')],'name':_0x1108d8['label'],'custom':!_0x1108d8[_0x150c('0x68')],'options':_0x1108d8[_0x150c('0x6b')]?_[_0x150c('0x29')](_0x1108d8[_0x150c('0x6b')],function(_0x536849){return{'name':_[_0x150c('0x6c')](_0x536849),'value':_0x536849};}):[]};})};}})['then'](respondWithResult(_0x114a3c,null))[_0x150c('0x44')](function(_0x41dc17){var _0x57357e=_0x3ccdaa[_0x150c('0x30')][_0x150c('0x6d')]?0x1f4:_0x41dc17[_0x150c('0x6e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x150c('0x53'),_0x57357e,JSON[_0x150c('0x6f')](_0x41dc17));delete _0x41dc17[_0x150c('0x27')];if(_0x57357e===0x191){_0x57357e=0x190;}_0x114a3c[_0x150c('0x1a')](_0x57357e)[_0x150c('0x70')](_0x3ccdaa[_0x150c('0x30')][_0x150c('0x6d')]?{'message':_0x150c('0x71'),'statusCode':_0x41dc17[_0x150c('0x6e')]}:_0x41dc17);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 38d1c27..f0a4a45 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 _0xe2a9=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x471001,_0x5b0bdb){var _0x77798a=function(_0x3c9cae){while(--_0x3c9cae){_0x471001['push'](_0x471001['shift']());}};_0x77798a(++_0x5b0bdb);}(_0xe2a9,0x1cd));var _0x9e2a=function(_0x2c750c,_0x589f97){_0x2c750c=_0x2c750c-0x0;var _0x21f92d=_0xe2a9[_0x2c750c];return _0x21f92d;};'use strict';var _=require(_0x9e2a('0x0'));var util=require(_0x9e2a('0x1'));var logger=require(_0x9e2a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9e2a('0x3'));var rp=require(_0x9e2a('0x4'));var fs=require('fs');var path=require(_0x9e2a('0x5'));var rimraf=require(_0x9e2a('0x6'));var config=require(_0x9e2a('0x7'));var attributes=require(_0x9e2a('0x8'));var integrations=require(_0x9e2a('0x9'));module[_0x9e2a('0xa')]=function(_0x1827c1,_0x21d60a){return _0x1827c1[_0x9e2a('0xb')](_0x9e2a('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec16=['path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2775f4,_0x10ddd4){var _0x377a51=function(_0x357ce5){while(--_0x357ce5){_0x2775f4['push'](_0x2775f4['shift']());}};_0x377a51(++_0x10ddd4);}(_0xec16,0xd6));var _0x6ec1=function(_0x52a8da,_0x5d9213){_0x52a8da=_0x52a8da-0x0;var _0x5e9460=_0xec16[_0x52a8da];return _0x5e9460;};'use strict';var _=require(_0x6ec1('0x0'));var util=require(_0x6ec1('0x1'));var logger=require('../../config/logger')(_0x6ec1('0x2'));var moment=require(_0x6ec1('0x3'));var BPromise=require(_0x6ec1('0x4'));var rp=require(_0x6ec1('0x5'));var fs=require('fs');var path=require(_0x6ec1('0x6'));var rimraf=require('rimraf');var config=require(_0x6ec1('0x7'));var attributes=require(_0x6ec1('0x8'));var integrations=require(_0x6ec1('0x9'));module['exports']=function(_0x496ea7,_0x5f03dd){return _0x496ea7[_0x6ec1('0xa')]('FreshdeskAccount',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 bf1c74d..a00044a 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 _0x1061=['FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','include','map','model','attributes','then','ShowFreshdeskAccount','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x369909,_0x2050ec){var _0x285fec=function(_0x56dc5a){while(--_0x56dc5a){_0x369909['push'](_0x369909['shift']());}};_0x285fec(++_0x2050ec);}(_0x1061,0x1b5));var _0x1106=function(_0x56dcf8,_0x5cf591){_0x56dcf8=_0x56dcf8-0x0;var _0x172671=_0x1061[_0x56dcf8];return _0x172671;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1106('0x1'));var fs=require('fs');var Redis=require(_0x1106('0x2'));var db=require(_0x1106('0x3'))['db'];var utils=require(_0x1106('0x4'));var logger=require(_0x1106('0x5'))(_0x1106('0x6'));var config=require(_0x1106('0x7'));var jayson=require(_0x1106('0x8'));var client=jayson['client'][_0x1106('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36bfb3,_0x54d2d5,_0x523f0f){return new BPromise(function(_0x287336,_0x3056e0){return client['request'](_0x36bfb3,_0x523f0f)['then'](function(_0x223c85){logger[_0x1106('0xa')](_0x1106('0xb'),_0x54d2d5,_0x1106('0xc'));logger[_0x1106('0xd')](_0x1106('0xe'),_0x54d2d5,_0x1106('0xc'),JSON[_0x1106('0xf')](_0x223c85));if(_0x223c85[_0x1106('0x10')]){if(_0x223c85[_0x1106('0x10')]['code']===0x1f4){logger[_0x1106('0x10')](_0x1106('0xb'),_0x54d2d5,_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);return _0x3056e0(_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);}logger[_0x1106('0x10')](_0x1106('0xb'),_0x54d2d5,_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);return _0x287336(_0x223c85[_0x1106('0x10')][_0x1106('0x11')]);}else{logger[_0x1106('0xa')](_0x1106('0xb'),_0x54d2d5,_0x1106('0xc'));_0x287336(_0x223c85[_0x1106('0x12')][_0x1106('0x11')]);}})[_0x1106('0x13')](function(_0x547ca3){logger['error'](_0x1106('0xb'),_0x54d2d5,_0x547ca3);_0x3056e0(_0x547ca3);});});}exports[_0x1106('0x14')]=function(_0x2c2905){var _0x465c13=this;return new Promise(function(_0x5be7fc,_0x2c8ff5){return db[_0x1106('0x15')][_0x1106('0x16')]({'raw':_0x2c2905[_0x1106('0x17')]?_0x2c2905[_0x1106('0x17')][_0x1106('0x18')]===undefined?!![]:![]:!![],'where':_0x2c2905[_0x1106('0x17')]?_0x2c2905[_0x1106('0x17')][_0x1106('0x19')]||null:null,'attributes':_0x2c2905['options']?_0x2c2905[_0x1106('0x17')]['attributes']||null:null,'limit':_0x2c2905[_0x1106('0x17')]?_0x2c2905['options']['limit']||null:null,'include':_0x2c2905[_0x1106('0x17')]?_0x2c2905['options'][_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x2c2905[_0x1106('0x17')][_0x1106('0x1a')],function(_0x2418c7){return{'model':db[_0x2418c7[_0x1106('0x1c')]],'as':_0x2418c7['as'],'attributes':_0x2418c7[_0x1106('0x1d')],'include':_0x2418c7[_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x2418c7[_0x1106('0x1a')],function(_0x1ff815){return{'model':db[_0x1ff815[_0x1106('0x1c')]],'as':_0x1ff815['as'],'attributes':_0x1ff815['attributes'],'include':_0x1ff815[_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x1ff815[_0x1106('0x1a')],function(_0x2285dd){return{'model':db[_0x2285dd['model']],'as':_0x2285dd['as'],'attributes':_0x2285dd[_0x1106('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1106('0x1e')](function(_0x465d83){logger[_0x1106('0xa')](_0x1106('0x14'),_0x2c2905);logger[_0x1106('0xd')](_0x1106('0x14'),_0x2c2905,JSON['stringify'](_0x465d83));_0x5be7fc(_0x465d83);})['catch'](function(_0x4b070d){logger[_0x1106('0x10')](_0x1106('0x14'),_0x4b070d[_0x1106('0x11')],_0x2c2905);_0x2c8ff5(_0x465c13[_0x1106('0x10')](0x1f4,_0x4b070d[_0x1106('0x11')]));});});};exports[_0x1106('0x1f')]=function(_0x1edae3){var _0x664bf4=this;return new Promise(function(_0x23ac46,_0x3b2021){return db[_0x1106('0x15')]['find']({'raw':_0x1edae3['options']?_0x1edae3[_0x1106('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1edae3[_0x1106('0x17')]?_0x1edae3[_0x1106('0x17')][_0x1106('0x19')]||null:null,'attributes':_0x1edae3[_0x1106('0x17')]?_0x1edae3[_0x1106('0x17')]['attributes']||null:null,'include':_0x1edae3[_0x1106('0x17')]?_0x1edae3['options'][_0x1106('0x1a')]?_[_0x1106('0x1b')](_0x1edae3[_0x1106('0x17')][_0x1106('0x1a')],function(_0x4809a8){return{'model':db[_0x4809a8[_0x1106('0x1c')]],'as':_0x4809a8['as'],'attributes':_0x4809a8[_0x1106('0x1d')],'include':_0x4809a8[_0x1106('0x1a')]?_['map'](_0x4809a8['include'],function(_0x5af406){return{'model':db[_0x5af406[_0x1106('0x1c')]],'as':_0x5af406['as'],'attributes':_0x5af406[_0x1106('0x1d')],'include':_0x5af406[_0x1106('0x1a')]?_['map'](_0x5af406[_0x1106('0x1a')],function(_0x5158bd){return{'model':db[_0x5158bd[_0x1106('0x1c')]],'as':_0x5158bd['as'],'attributes':_0x5158bd[_0x1106('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1106('0x1e')](function(_0x56abbf){logger['info']('ShowFreshdeskAccount',_0x1edae3);logger[_0x1106('0xd')]('ShowFreshdeskAccount',_0x1edae3,JSON['stringify'](_0x56abbf));_0x23ac46(_0x56abbf);})['catch'](function(_0x3c2a02){logger[_0x1106('0x10')](_0x1106('0x1f'),_0x3c2a02[_0x1106('0x11')],_0x1edae3);_0x3b2021(_0x664bf4['error'](0x1f4,_0x3c2a02['message']));});});}; \ No newline at end of file +var _0x6f1e=['error','code','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowFreshdeskAccount','find','raw','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0xe33285,_0x7f474){var _0x31ca6b=function(_0x51b2a6){while(--_0x51b2a6){_0xe33285['push'](_0xe33285['shift']());}};_0x31ca6b(++_0x7f474);}(_0x6f1e,0x1e0));var _0xe6f1=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0x6f1e[_0xb66df];return _0x42a702;};'use strict';var _=require(_0xe6f1('0x0'));var util=require(_0xe6f1('0x1'));var moment=require('moment');var BPromise=require(_0xe6f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe6f1('0x3'));var logger=require(_0xe6f1('0x4'))(_0xe6f1('0x5'));var config=require(_0xe6f1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe6f1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bf151,_0x36ebb2,_0x234fd6){return new BPromise(function(_0x50b450,_0x338066){return client[_0xe6f1('0x8')](_0x5bf151,_0x234fd6)[_0xe6f1('0x9')](function(_0x2ea4fc){logger[_0xe6f1('0xa')](_0xe6f1('0xb'),_0x36ebb2,'request\x20sent');logger[_0xe6f1('0xc')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x36ebb2,_0xe6f1('0xd'),JSON[_0xe6f1('0xe')](_0x2ea4fc));if(_0x2ea4fc['error']){if(_0x2ea4fc[_0xe6f1('0xf')][_0xe6f1('0x10')]===0x1f4){logger[_0xe6f1('0xf')](_0xe6f1('0xb'),_0x36ebb2,_0x2ea4fc['error']['message']);return _0x338066(_0x2ea4fc[_0xe6f1('0xf')][_0xe6f1('0x11')]);}logger[_0xe6f1('0xf')](_0xe6f1('0xb'),_0x36ebb2,_0x2ea4fc['error'][_0xe6f1('0x11')]);return _0x50b450(_0x2ea4fc[_0xe6f1('0xf')][_0xe6f1('0x11')]);}else{logger['info'](_0xe6f1('0xb'),_0x36ebb2,'request\x20sent');_0x50b450(_0x2ea4fc[_0xe6f1('0x12')][_0xe6f1('0x11')]);}})[_0xe6f1('0x13')](function(_0x25df4e){logger['error'](_0xe6f1('0xb'),_0x36ebb2,_0x25df4e);_0x338066(_0x25df4e);});});}exports[_0xe6f1('0x14')]=function(_0x5b6052){var _0x543998=this;return new Promise(function(_0x4208ee,_0x4a5e0c){return db[_0xe6f1('0x15')][_0xe6f1('0x16')]({'raw':_0x5b6052['options']?_0x5b6052[_0xe6f1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5b6052[_0xe6f1('0x17')]?_0x5b6052[_0xe6f1('0x17')][_0xe6f1('0x18')]||null:null,'attributes':_0x5b6052[_0xe6f1('0x17')]?_0x5b6052[_0xe6f1('0x17')][_0xe6f1('0x19')]||null:null,'limit':_0x5b6052[_0xe6f1('0x17')]?_0x5b6052['options'][_0xe6f1('0x1a')]||null:null,'include':_0x5b6052['options']?_0x5b6052[_0xe6f1('0x17')][_0xe6f1('0x1b')]?_['map'](_0x5b6052[_0xe6f1('0x17')]['include'],function(_0x20fd37){return{'model':db[_0x20fd37[_0xe6f1('0x1c')]],'as':_0x20fd37['as'],'attributes':_0x20fd37[_0xe6f1('0x19')],'include':_0x20fd37[_0xe6f1('0x1b')]?_[_0xe6f1('0x1d')](_0x20fd37['include'],function(_0xe415f){return{'model':db[_0xe415f['model']],'as':_0xe415f['as'],'attributes':_0xe415f[_0xe6f1('0x19')],'include':_0xe415f[_0xe6f1('0x1b')]?_[_0xe6f1('0x1d')](_0xe415f[_0xe6f1('0x1b')],function(_0x407c1a){return{'model':db[_0x407c1a[_0xe6f1('0x1c')]],'as':_0x407c1a['as'],'attributes':_0x407c1a[_0xe6f1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe6f1('0x9')](function(_0x325578){logger[_0xe6f1('0xa')](_0xe6f1('0x14'),_0x5b6052);logger[_0xe6f1('0xc')](_0xe6f1('0x14'),_0x5b6052,JSON['stringify'](_0x325578));_0x4208ee(_0x325578);})[_0xe6f1('0x13')](function(_0x4f35a4){logger[_0xe6f1('0xf')]('GetFreshdeskAccount',_0x4f35a4[_0xe6f1('0x11')],_0x5b6052);_0x4a5e0c(_0x543998[_0xe6f1('0xf')](0x1f4,_0x4f35a4['message']));});});};exports[_0xe6f1('0x1e')]=function(_0x32b48e){var _0x3eb90f=this;return new Promise(function(_0x5f3775,_0x45fba2){return db[_0xe6f1('0x15')][_0xe6f1('0x1f')]({'raw':_0x32b48e['options']?_0x32b48e['options'][_0xe6f1('0x20')]===undefined?!![]:![]:!![],'where':_0x32b48e['options']?_0x32b48e[_0xe6f1('0x17')][_0xe6f1('0x18')]||null:null,'attributes':_0x32b48e[_0xe6f1('0x17')]?_0x32b48e[_0xe6f1('0x17')][_0xe6f1('0x19')]||null:null,'include':_0x32b48e['options']?_0x32b48e[_0xe6f1('0x17')][_0xe6f1('0x1b')]?_[_0xe6f1('0x1d')](_0x32b48e[_0xe6f1('0x17')][_0xe6f1('0x1b')],function(_0x529db5){return{'model':db[_0x529db5[_0xe6f1('0x1c')]],'as':_0x529db5['as'],'attributes':_0x529db5['attributes'],'include':_0x529db5['include']?_['map'](_0x529db5[_0xe6f1('0x1b')],function(_0x1b396f){return{'model':db[_0x1b396f[_0xe6f1('0x1c')]],'as':_0x1b396f['as'],'attributes':_0x1b396f[_0xe6f1('0x19')],'include':_0x1b396f[_0xe6f1('0x1b')]?_[_0xe6f1('0x1d')](_0x1b396f[_0xe6f1('0x1b')],function(_0x31c0af){return{'model':db[_0x31c0af['model']],'as':_0x31c0af['as'],'attributes':_0x31c0af['attributes']};}):[]};}):[]};}):[]:[]})[_0xe6f1('0x9')](function(_0x1e386d){logger['info'](_0xe6f1('0x1e'),_0x32b48e);logger[_0xe6f1('0xc')](_0xe6f1('0x1e'),_0x32b48e,JSON[_0xe6f1('0xe')](_0x1e386d));_0x5f3775(_0x1e386d);})[_0xe6f1('0x13')](function(_0x162081){logger[_0xe6f1('0xf')](_0xe6f1('0x1e'),_0x162081[_0xe6f1('0x11')],_0x32b48e);_0x45fba2(_0x3eb90f[_0xe6f1('0xf')](0x1f4,_0x162081[_0xe6f1('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index c99a596..28a908e 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 _0x149e=['put','/:id','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags'];(function(_0x332d18,_0xb1c601){var _0x2aab22=function(_0x27602c){while(--_0x27602c){_0x332d18['push'](_0x332d18['shift']());}};_0x2aab22(++_0xb1c601);}(_0x149e,0x15e));var _0xe149=function(_0x2a3a3a,_0x1316df){_0x2a3a3a=_0x2a3a3a-0x0;var _0x36be2e=_0x149e[_0x2a3a3a];return _0x36be2e;};'use strict';var multer=require(_0xe149('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe149('0x1'));var express=require(_0xe149('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe149('0x3'));var interaction=require(_0xe149('0x4'));var config=require(_0xe149('0x5'));var controller=require(_0xe149('0x6'));router[_0xe149('0x7')]('/',auth[_0xe149('0x8')](),controller[_0xe149('0x9')]);router['get']('/:id',auth[_0xe149('0x8')](),controller[_0xe149('0xa')]);router[_0xe149('0x7')]('/:id/fields',auth[_0xe149('0x8')](),controller['getFields']);router[_0xe149('0x7')](_0xe149('0xb'),auth[_0xe149('0x8')](),controller[_0xe149('0xc')]);router[_0xe149('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe149('0xd')]);router[_0xe149('0x7')](_0xe149('0xe'),auth[_0xe149('0x8')](),controller[_0xe149('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe149('0x10')](_0xe149('0xe'),auth[_0xe149('0x8')](),controller[_0xe149('0x11')]);router[_0xe149('0x12')](_0xe149('0x13'),auth[_0xe149('0x8')](),controller['update']);router[_0xe149('0x14')](_0xe149('0x13'),auth[_0xe149('0x8')](),controller[_0xe149('0x15')]);module[_0xe149('0x16')]=router; \ No newline at end of file +var _0x31a3=['getTags','post','setTags','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','show','get','getFields','/:id/subjects','/:id/descriptions','/:id/tags'];(function(_0x3b8995,_0x37dd10){var _0x24e13b=function(_0x68b2ae){while(--_0x68b2ae){_0x3b8995['push'](_0x3b8995['shift']());}};_0x24e13b(++_0x37dd10);}(_0x31a3,0x129));var _0x331a=function(_0xea897b,_0x269096){_0xea897b=_0xea897b-0x0;var _0x8a736e=_0x31a3[_0xea897b];return _0x8a736e;};'use strict';var multer=require(_0x331a('0x0'));var util=require(_0x331a('0x1'));var path=require('path');var timeout=require(_0x331a('0x2'));var express=require(_0x331a('0x3'));var router=express['Router']();var fs_extra=require(_0x331a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x331a('0x5'));var controller=require(_0x331a('0x6'));router['get']('/',auth[_0x331a('0x7')](),controller[_0x331a('0x8')]);router['get']('/:id',auth[_0x331a('0x7')](),controller[_0x331a('0x9')]);router[_0x331a('0xa')]('/:id/fields',auth[_0x331a('0x7')](),controller[_0x331a('0xb')]);router[_0x331a('0xa')](_0x331a('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x331a('0xa')](_0x331a('0xd'),auth[_0x331a('0x7')](),controller['getDescriptions']);router[_0x331a('0xa')](_0x331a('0xe'),auth[_0x331a('0x7')](),controller[_0x331a('0xf')]);router[_0x331a('0x10')]('/',auth[_0x331a('0x7')](),controller['create']);router[_0x331a('0x10')](_0x331a('0xe'),auth[_0x331a('0x7')](),controller[_0x331a('0x11')]);router[_0x331a('0x12')](_0x331a('0x13'),auth['isAuthenticated'](),controller[_0x331a('0x14')]);router[_0x331a('0x15')](_0x331a('0x13'),auth[_0x331a('0x7')](),controller[_0x331a('0x16')]);module[_0x331a('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index e2f1490..88f9fc5 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 _0xe5c1=['STRING'];(function(_0x147474,_0x3ec480){var _0x4b7c92=function(_0x58e7eb){while(--_0x58e7eb){_0x147474['push'](_0x147474['shift']());}};_0x4b7c92(++_0x3ec480);}(_0xe5c1,0x153));var _0x1e5c=function(_0x5256f8,_0x4ba759){_0x5256f8=_0x5256f8-0x0;var _0x1c6b16=_0xe5c1[_0x5256f8];return _0x1c6b16;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1e5c('0x0')]},'description':{'type':Sequelize[_0x1e5c('0x0')]}}; \ No newline at end of file +var _0xc833=['exports','STRING','sequelize'];(function(_0x4a663b,_0x4eb317){var _0x219741=function(_0x3e845f){while(--_0x3e845f){_0x4a663b['push'](_0x4a663b['shift']());}};_0x219741(++_0x4eb317);}(_0xc833,0x7a));var _0x3c83=function(_0x51b006,_0x327644){_0x51b006=_0x51b006-0x0;var _0x77c65c=_0xc833[_0x51b006];return _0x77c65c;};'use strict';var Sequelize=require(_0x3c83('0x0'));module[_0x3c83('0x1')]={'name':{'type':Sequelize[_0x3c83('0x2')]},'description':{'type':Sequelize[_0x3c83('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index c9300a6..ae0e382 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 _0x9c5a=['rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','findOne','getFields','FreshdeskField','pick','getSubjects','hasOwnProperty','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format'];(function(_0x133fe4,_0x1f473b){var _0x4c4017=function(_0x3c1fb1){while(--_0x3c1fb1){_0x133fe4['push'](_0x133fe4['shift']());}};_0x4c4017(++_0x1f473b);}(_0x9c5a,0x107));var _0xa9c5=function(_0x300a43,_0x25cb22){_0x300a43=_0x300a43-0x0;var _0x53cde6=_0x9c5a[_0x300a43];return _0x53cde6;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require(_0xa9c5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var Mustache=require(_0xa9c5('0x5'));var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require(_0xa9c5('0x8'));var csv=require(_0xa9c5('0x9'));var ejs=require(_0xa9c5('0xa'));var fs=require('fs');var fs_extra=require(_0xa9c5('0xb'));var _=require('lodash');var squel=require(_0xa9c5('0xc'));var crypto=require(_0xa9c5('0xd'));var jsforce=require(_0xa9c5('0xe'));var deskjs=require(_0xa9c5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa9c5('0x10'));var Redis=require('ioredis');var authService=require(_0xa9c5('0x11'));var qs=require(_0xa9c5('0x12'));var as=require(_0xa9c5('0x13'));var hardwareService=require(_0xa9c5('0x14'));var logger=require(_0xa9c5('0x15'))(_0xa9c5('0x16'));var utils=require(_0xa9c5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa9c5('0x18'));var db=require(_0xa9c5('0x19'))['db'];function respondWithStatusCode(_0x456117,_0x4cc89c){_0x4cc89c=_0x4cc89c||0xcc;return function(_0x5f9ec9){if(_0x5f9ec9){return _0x456117[_0xa9c5('0x1a')](_0x4cc89c);}return _0x456117[_0xa9c5('0x1b')](_0x4cc89c)[_0xa9c5('0x1c')]();};}function respondWithResult(_0x4a0597,_0x1ff52a){_0x1ff52a=_0x1ff52a||0xc8;return function(_0xaaff7e){if(_0xaaff7e){return _0x4a0597[_0xa9c5('0x1b')](_0x1ff52a)[_0xa9c5('0x1d')](_0xaaff7e);}};}function respondWithFilteredResult(_0x3a1bda,_0x1ff121){return function(_0x27e1b7){if(_0x27e1b7){var _0xa1d3ca=typeof _0x1ff121[_0xa9c5('0x1e')]==='undefined'&&typeof _0x1ff121[_0xa9c5('0x1f')]===_0xa9c5('0x20');var _0x103bac=_0x27e1b7[_0xa9c5('0x21')];var _0x1e4fc4=_0xa1d3ca?0x0:_0x1ff121['offset'];var _0x2703ae=_0xa1d3ca?_0x27e1b7[_0xa9c5('0x21')]:_0x1ff121[_0xa9c5('0x1e')]+_0x1ff121[_0xa9c5('0x1f')];var _0x32f575;if(_0x2703ae>=_0x103bac){_0x2703ae=_0x103bac;_0x32f575=0xc8;}else{_0x32f575=0xce;}_0x3a1bda[_0xa9c5('0x1b')](_0x32f575);return _0x3a1bda[_0xa9c5('0x22')](_0xa9c5('0x23'),_0x1e4fc4+'-'+_0x2703ae+'/'+_0x103bac)['json'](_0x27e1b7);}return null;};}function patchUpdates(_0x5bfd83){return function(_0x2fb78d){try{jsonpatch['apply'](_0x2fb78d,_0x5bfd83,!![]);}catch(_0x50d974){return BPromise[_0xa9c5('0x24')](_0x50d974);}return _0x2fb78d[_0xa9c5('0x25')]();};}function saveUpdates(_0x17551f,_0x4b1086){return function(_0x249e93){if(_0x249e93){return _0x249e93[_0xa9c5('0x26')](_0x17551f)[_0xa9c5('0x27')](function(_0x17b055){return _0x17b055;});}return null;};}function removeEntity(_0x2af95f,_0x4a210e){return function(_0x50967b){if(_0x50967b){return _0x50967b[_0xa9c5('0x28')]()[_0xa9c5('0x27')](function(){_0x2af95f[_0xa9c5('0x1b')](0xcc)[_0xa9c5('0x1c')]();});}};}function handleEntityNotFound(_0x177657,_0x3a4bfd){return function(_0xd78f92){if(!_0xd78f92){_0x177657['sendStatus'](0x194);}return _0xd78f92;};}function handleError(_0xa9da41,_0x599468){_0x599468=_0x599468||0x1f4;return function(_0x2d1cde){logger['error'](_0x2d1cde[_0xa9c5('0x29')]);if(_0x2d1cde[_0xa9c5('0x2a')]){delete _0x2d1cde['name'];}_0xa9da41[_0xa9c5('0x1b')](_0x599468)[_0xa9c5('0x2b')](_0x2d1cde);};}exports[_0xa9c5('0x2c')]=function(_0x102eb1,_0x55655a){var _0x3e4d27={},_0x121648={},_0x21abd9={'count':0x0,'rows':[]};var _0xf70a3a=_[_0xa9c5('0x2d')](db[_0xa9c5('0x2e')]['rawAttributes'],function(_0x36c1a9){return{'name':_0x36c1a9[_0xa9c5('0x2f')],'type':_0x36c1a9[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x121648[_0xa9c5('0x32')]=_['map'](_0xf70a3a,'name');_0x121648[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x102eb1[_0xa9c5('0x33')]);_0x121648['filters']=_[_0xa9c5('0x35')](_0x121648[_0xa9c5('0x32')],_0x121648[_0xa9c5('0x33')]);_0x3e4d27[_0xa9c5('0x36')]=_[_0xa9c5('0x35')](_0x121648[_0xa9c5('0x32')],qs['fields'](_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x3e4d27[_0xa9c5('0x36')]=_0x3e4d27[_0xa9c5('0x36')][_0xa9c5('0x38')]?_0x3e4d27['attributes']:_0x121648[_0xa9c5('0x32')];if(!_0x102eb1[_0xa9c5('0x33')]['hasOwnProperty']('nolimit')){_0x3e4d27['limit']=qs[_0xa9c5('0x1f')](_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x1f')]);_0x3e4d27[_0xa9c5('0x1e')]=qs['offset'](_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x1e')]);}_0x3e4d27[_0xa9c5('0x39')]=qs[_0xa9c5('0x3a')](_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x3a')]);_0x3e4d27[_0xa9c5('0x3b')]=qs[_0xa9c5('0x3c')](_['pick'](_0x102eb1['query'],_0x121648[_0xa9c5('0x3c')]),_0xf70a3a);if(_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x3d')]){_0x3e4d27[_0xa9c5('0x3b')]=_[_0xa9c5('0x3e')](_0x3e4d27[_0xa9c5('0x3b')],{'$or':_[_0xa9c5('0x2d')](_0xf70a3a,function(_0x291996){if(_0x291996[_0xa9c5('0x30')]!==_0xa9c5('0x3f')){var _0x2ae796={};_0x2ae796[_0x291996['name']]={'$like':'%'+_0x102eb1[_0xa9c5('0x33')][_0xa9c5('0x3d')]+'%'};return _0x2ae796;}})});}_0x3e4d27=_[_0xa9c5('0x3e')]({},_0x3e4d27,_0x102eb1[_0xa9c5('0x40')]);var _0x3d5506={'where':_0x3e4d27[_0xa9c5('0x3b')]};return db['FreshdeskConfiguration'][_0xa9c5('0x21')](_0x3d5506)[_0xa9c5('0x27')](function(_0x129b70){_0x21abd9[_0xa9c5('0x21')]=_0x129b70;if(_0x102eb1['query'][_0xa9c5('0x41')]){_0x3e4d27[_0xa9c5('0x42')]=[{'all':!![]}];}return db[_0xa9c5('0x2e')][_0xa9c5('0x43')](_0x3e4d27);})[_0xa9c5('0x27')](function(_0x17afc3){_0x21abd9[_0xa9c5('0x44')]=_0x17afc3;return _0x21abd9;})['then'](respondWithFilteredResult(_0x55655a,_0x3e4d27))[_0xa9c5('0x45')](handleError(_0x55655a,null));};exports[_0xa9c5('0x46')]=function(_0x121f24,_0x50fed1){var _0x28209c={'raw':![],'where':{'id':_0x121f24['params']['id']}},_0x23fde8={};_0x23fde8[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2e')][_0xa9c5('0x47')]);_0x23fde8[_0xa9c5('0x33')]=_['keys'](_0x121f24[_0xa9c5('0x33')]);_0x23fde8[_0xa9c5('0x3c')]=_[_0xa9c5('0x35')](_0x23fde8[_0xa9c5('0x32')],_0x23fde8[_0xa9c5('0x33')]);_0x28209c[_0xa9c5('0x36')]=_[_0xa9c5('0x35')](_0x23fde8['model'],qs['fields'](_0x121f24[_0xa9c5('0x33')]['fields']));_0x28209c[_0xa9c5('0x36')]=_0x28209c['attributes'][_0xa9c5('0x38')]?_0x28209c[_0xa9c5('0x36')]:_0x23fde8[_0xa9c5('0x32')];if(_0x121f24['query'][_0xa9c5('0x41')]){_0x28209c[_0xa9c5('0x42')]=[{'all':!![]}];}_0x28209c=_[_0xa9c5('0x3e')]({},_0x28209c,_0x121f24[_0xa9c5('0x40')]);return db['FreshdeskConfiguration'][_0xa9c5('0x48')](_0x28209c)['then'](handleEntityNotFound(_0x50fed1,null))[_0xa9c5('0x27')](respondWithResult(_0x50fed1,null))[_0xa9c5('0x45')](handleError(_0x50fed1,null));};exports[_0xa9c5('0x49')]=function(_0x20ce9f,_0x58eb5c){return db[_0xa9c5('0x2e')]['create'](_0x20ce9f[_0xa9c5('0x4a')],{})[_0xa9c5('0x27')](respondWithResult(_0x58eb5c,0xc9))[_0xa9c5('0x45')](handleError(_0x58eb5c,null));};exports['update']=function(_0x2c8d4a,_0x27d0a7){if(_0x2c8d4a[_0xa9c5('0x4a')]['id']){delete _0x2c8d4a['body']['id'];}return db[_0xa9c5('0x2e')][_0xa9c5('0x48')]({'where':{'id':_0x2c8d4a[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x27d0a7,null))['then'](saveUpdates(_0x2c8d4a[_0xa9c5('0x4a')],null))[_0xa9c5('0x27')](respondWithResult(_0x27d0a7,null))[_0xa9c5('0x45')](handleError(_0x27d0a7,null));};exports[_0xa9c5('0x28')]=function(_0x18982e,_0x46b5ca){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x18982e[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x46b5ca,null))[_0xa9c5('0x27')](removeEntity(_0x46b5ca,null))[_0xa9c5('0x45')](handleError(_0x46b5ca,null));};exports['getFields']=function(_0x34bf85,_0x2b8d49,_0x5b2f60){var _0x422acf={};var _0x4b9853={};var _0xf504b0;var _0x54ffc2;return db['FreshdeskConfiguration'][_0xa9c5('0x4c')]({'where':{'id':_0x34bf85[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x2b8d49,null))[_0xa9c5('0x27')](function(_0x69f5ca){if(_0x69f5ca){_0xf504b0=_0x69f5ca;_0x4b9853[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db['FreshdeskField']['rawAttributes']);_0x4b9853[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x34bf85[_0xa9c5('0x33')]);_0x4b9853[_0xa9c5('0x3c')]=_[_0xa9c5('0x35')](_0x4b9853[_0xa9c5('0x32')],_0x4b9853['query']);_0x422acf['attributes']=_[_0xa9c5('0x35')](_0x4b9853[_0xa9c5('0x32')],qs['fields'](_0x34bf85[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x422acf[_0xa9c5('0x36')]=_0x422acf[_0xa9c5('0x36')]['length']?_0x422acf[_0xa9c5('0x36')]:_0x4b9853[_0xa9c5('0x32')];_0x422acf['order']=qs[_0xa9c5('0x3a')](_0x34bf85[_0xa9c5('0x33')]['sort']);_0x422acf['where']=qs[_0xa9c5('0x3c')](_['pick'](_0x34bf85[_0xa9c5('0x33')],_0x4b9853[_0xa9c5('0x3c')]));if(_0x34bf85[_0xa9c5('0x33')]['filter']){_0x422acf[_0xa9c5('0x3b')]=_['merge'](_0x422acf['where'],{'$or':_[_0xa9c5('0x2d')](_0x422acf['attributes'],function(_0x53ee22){var _0x3cb7e9={};_0x3cb7e9[_0x53ee22]={'$like':'%'+_0x34bf85[_0xa9c5('0x33')][_0xa9c5('0x3d')]+'%'};return _0x3cb7e9;})});}_0x422acf=_[_0xa9c5('0x3e')]({},_0x422acf,_0x34bf85[_0xa9c5('0x40')]);return _0xf504b0[_0xa9c5('0x4d')](_0x422acf);}})[_0xa9c5('0x27')](function(_0x52f01b){if(_0x52f01b){_0x54ffc2=_0x52f01b['length'];if(!_0x34bf85[_0xa9c5('0x33')]['hasOwnProperty']('nolimit')){_0x422acf[_0xa9c5('0x1f')]=qs[_0xa9c5('0x1f')](_0x34bf85[_0xa9c5('0x33')][_0xa9c5('0x1f')]);_0x422acf[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x34bf85[_0xa9c5('0x33')]['offset']);}return _0xf504b0[_0xa9c5('0x4d')](_0x422acf);}})['then'](function(_0x5d9d99){if(_0x5d9d99){return _0x5d9d99?{'count':_0x54ffc2,'rows':_0x5d9d99}:null;}})['then'](respondWithResult(_0x2b8d49,null))[_0xa9c5('0x45')](handleError(_0x2b8d49,null));};exports['getSubjects']=function(_0x426059,_0x538e3b,_0x4d743c){var _0x491dea={};var _0x293938={};var _0x75aded;var _0x4fe9df;return db['FreshdeskConfiguration'][_0xa9c5('0x4c')]({'where':{'id':_0x426059[_0xa9c5('0x4b')]['id']}})['then'](handleEntityNotFound(_0x538e3b,null))[_0xa9c5('0x27')](function(_0x48c278){if(_0x48c278){_0x75aded=_0x48c278;_0x293938[_0xa9c5('0x32')]=_['keys'](db[_0xa9c5('0x4e')][_0xa9c5('0x47')]);_0x293938[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x426059[_0xa9c5('0x33')]);_0x293938['filters']=_[_0xa9c5('0x35')](_0x293938[_0xa9c5('0x32')],_0x293938[_0xa9c5('0x33')]);_0x491dea[_0xa9c5('0x36')]=_['intersection'](_0x293938[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x426059['query']['fields']));_0x491dea[_0xa9c5('0x36')]=_0x491dea[_0xa9c5('0x36')][_0xa9c5('0x38')]?_0x491dea['attributes']:_0x293938['model'];_0x491dea['order']=qs['sort'](_0x426059[_0xa9c5('0x33')][_0xa9c5('0x3a')]);_0x491dea['where']=qs[_0xa9c5('0x3c')](_[_0xa9c5('0x4f')](_0x426059[_0xa9c5('0x33')],_0x293938[_0xa9c5('0x3c')]));if(_0x426059['query'][_0xa9c5('0x3d')]){_0x491dea[_0xa9c5('0x3b')]=_[_0xa9c5('0x3e')](_0x491dea['where'],{'$or':_[_0xa9c5('0x2d')](_0x491dea[_0xa9c5('0x36')],function(_0xf094ff){var _0x185087={};_0x185087[_0xf094ff]={'$like':'%'+_0x426059[_0xa9c5('0x33')][_0xa9c5('0x3d')]+'%'};return _0x185087;})});}_0x491dea=_[_0xa9c5('0x3e')]({},_0x491dea,_0x426059[_0xa9c5('0x40')]);return _0x75aded[_0xa9c5('0x50')](_0x491dea);}})[_0xa9c5('0x27')](function(_0x4a8623){if(_0x4a8623){_0x4fe9df=_0x4a8623['length'];if(!_0x426059[_0xa9c5('0x33')][_0xa9c5('0x51')](_0xa9c5('0x52'))){_0x491dea[_0xa9c5('0x1f')]=qs[_0xa9c5('0x1f')](_0x426059[_0xa9c5('0x33')]['limit']);_0x491dea[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x426059[_0xa9c5('0x33')][_0xa9c5('0x1e')]);}return _0x75aded[_0xa9c5('0x50')](_0x491dea);}})[_0xa9c5('0x27')](function(_0x268e8d){if(_0x268e8d){return _0x268e8d?{'count':_0x4fe9df,'rows':_0x268e8d}:null;}})[_0xa9c5('0x27')](respondWithResult(_0x538e3b,null))[_0xa9c5('0x45')](handleError(_0x538e3b,null));};exports[_0xa9c5('0x53')]=function(_0x5364c7,_0x13989d,_0x5f2a95){var _0x5bba81={};var _0x195844={};var _0x2c5392;var _0x121ae1;return db[_0xa9c5('0x2e')][_0xa9c5('0x4c')]({'where':{'id':_0x5364c7[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x13989d,null))[_0xa9c5('0x27')](function(_0x394e45){if(_0x394e45){_0x2c5392=_0x394e45;_0x195844[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x4e')][_0xa9c5('0x47')]);_0x195844[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x5364c7['query']);_0x195844[_0xa9c5('0x3c')]=_[_0xa9c5('0x35')](_0x195844[_0xa9c5('0x32')],_0x195844[_0xa9c5('0x33')]);_0x5bba81['attributes']=_['intersection'](_0x195844[_0xa9c5('0x32')],qs['fields'](_0x5364c7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x5bba81['attributes']=_0x5bba81[_0xa9c5('0x36')][_0xa9c5('0x38')]?_0x5bba81[_0xa9c5('0x36')]:_0x195844[_0xa9c5('0x32')];_0x5bba81[_0xa9c5('0x39')]=qs[_0xa9c5('0x3a')](_0x5364c7[_0xa9c5('0x33')][_0xa9c5('0x3a')]);_0x5bba81['where']=qs[_0xa9c5('0x3c')](_[_0xa9c5('0x4f')](_0x5364c7[_0xa9c5('0x33')],_0x195844['filters']));if(_0x5364c7['query'][_0xa9c5('0x3d')]){_0x5bba81[_0xa9c5('0x3b')]=_[_0xa9c5('0x3e')](_0x5bba81['where'],{'$or':_[_0xa9c5('0x2d')](_0x5bba81[_0xa9c5('0x36')],function(_0x42734e){var _0x1a621d={};_0x1a621d[_0x42734e]={'$like':'%'+_0x5364c7['query'][_0xa9c5('0x3d')]+'%'};return _0x1a621d;})});}_0x5bba81=_[_0xa9c5('0x3e')]({},_0x5bba81,_0x5364c7[_0xa9c5('0x40')]);return _0x2c5392[_0xa9c5('0x53')](_0x5bba81);}})['then'](function(_0x30985e){if(_0x30985e){_0x121ae1=_0x30985e[_0xa9c5('0x38')];if(!_0x5364c7[_0xa9c5('0x33')][_0xa9c5('0x51')](_0xa9c5('0x52'))){_0x5bba81[_0xa9c5('0x1f')]=qs[_0xa9c5('0x1f')](_0x5364c7['query']['limit']);_0x5bba81[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x5364c7[_0xa9c5('0x33')][_0xa9c5('0x1e')]);}return _0x2c5392[_0xa9c5('0x53')](_0x5bba81);}})[_0xa9c5('0x27')](function(_0x3a0b97){if(_0x3a0b97){return _0x3a0b97?{'count':_0x121ae1,'rows':_0x3a0b97}:null;}})[_0xa9c5('0x27')](respondWithResult(_0x13989d,null))[_0xa9c5('0x45')](handleError(_0x13989d,null));};exports[_0xa9c5('0x54')]=function(_0x5b4d43,_0x1dd709,_0x1ec6d7){var _0x4d90af={};var _0x2176a5={};var _0x3fb699;var _0x1a3cf4;return db[_0xa9c5('0x2e')][_0xa9c5('0x4c')]({'where':{'id':_0x5b4d43['params']['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x1dd709,null))['then'](function(_0x1cb688){if(_0x1cb688){_0x3fb699=_0x1cb688;_0x2176a5[_0xa9c5('0x32')]=_['keys'](db[_0xa9c5('0x55')]['rawAttributes']);_0x2176a5[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x5b4d43[_0xa9c5('0x33')]);_0x2176a5[_0xa9c5('0x3c')]=_[_0xa9c5('0x35')](_0x2176a5['model'],_0x2176a5[_0xa9c5('0x33')]);_0x4d90af[_0xa9c5('0x36')]=_[_0xa9c5('0x35')](_0x2176a5[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x5b4d43['query'][_0xa9c5('0x37')]));_0x4d90af[_0xa9c5('0x36')]=_0x4d90af[_0xa9c5('0x36')][_0xa9c5('0x38')]?_0x4d90af['attributes']:_0x2176a5[_0xa9c5('0x32')];_0x4d90af[_0xa9c5('0x39')]=qs[_0xa9c5('0x3a')](_0x5b4d43[_0xa9c5('0x33')][_0xa9c5('0x3a')]);_0x4d90af[_0xa9c5('0x3b')]=qs['filters'](_[_0xa9c5('0x4f')](_0x5b4d43[_0xa9c5('0x33')],_0x2176a5['filters']));if(_0x5b4d43[_0xa9c5('0x33')]['filter']){_0x4d90af[_0xa9c5('0x3b')]=_['merge'](_0x4d90af[_0xa9c5('0x3b')],{'$or':_[_0xa9c5('0x2d')](_0x4d90af[_0xa9c5('0x36')],function(_0x2b6630){var _0x6834b2={};_0x6834b2[_0x2b6630]={'$like':'%'+_0x5b4d43[_0xa9c5('0x33')][_0xa9c5('0x3d')]+'%'};return _0x6834b2;})});}_0x4d90af=_[_0xa9c5('0x3e')]({},_0x4d90af,_0x5b4d43['options']);return _0x3fb699[_0xa9c5('0x54')](_0x4d90af);}})['then'](function(_0x74257b){if(_0x74257b){_0x1a3cf4=_0x74257b[_0xa9c5('0x38')];if(!_0x5b4d43['query'][_0xa9c5('0x51')](_0xa9c5('0x52'))){_0x4d90af[_0xa9c5('0x1f')]=qs['limit'](_0x5b4d43[_0xa9c5('0x33')][_0xa9c5('0x1f')]);_0x4d90af[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x5b4d43['query']['offset']);}return _0x3fb699[_0xa9c5('0x54')](_0x4d90af);}})[_0xa9c5('0x27')](function(_0xa7ed5d){if(_0xa7ed5d){return _0xa7ed5d?{'count':_0x1a3cf4,'rows':_0xa7ed5d}:null;}})[_0xa9c5('0x27')](respondWithResult(_0x1dd709,null))[_0xa9c5('0x45')](handleError(_0x1dd709,null));};exports[_0xa9c5('0x56')]=function(_0x4f2e26,_0x2b462a,_0x2e9859){if(_0x4f2e26[_0xa9c5('0x4a')]['id']){delete _0x4f2e26[_0xa9c5('0x4a')]['id'];}return db['FreshdeskConfiguration'][_0xa9c5('0x4c')]({'where':{'id':_0x4f2e26[_0xa9c5('0x4b')]['id']}})[_0xa9c5('0x27')](handleEntityNotFound(_0x2b462a,null))[_0xa9c5('0x27')](function(_0x2d67ad){if(_0x2d67ad){return _0x2d67ad[_0xa9c5('0x56')](_0x4f2e26[_0xa9c5('0x4a')][_0xa9c5('0x57')]||[]);}return null;})[_0xa9c5('0x27')](respondWithResult(_0x2b462a,null))[_0xa9c5('0x45')](handleError(_0x2b462a,null));}; \ No newline at end of file +var _0xdc16=['desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','then','destroy','stack','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','includeAll','include','find','create','body','catch','update','params','getFields','findOne','FreshdeskField','nolimit','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto'];(function(_0xaff1bd,_0x5380c4){var _0x52ad89=function(_0x50720e){while(--_0x50720e){_0xaff1bd['push'](_0xaff1bd['shift']());}};_0x52ad89(++_0x5380c4);}(_0xdc16,0x19c));var _0x6dc1=function(_0x29e0eb,_0x9acb52){_0x29e0eb=_0x29e0eb-0x0;var _0x597d2d=_0xdc16[_0x29e0eb];return _0x597d2d;};'use strict';var emlformat=require(_0x6dc1('0x0'));var rimraf=require(_0x6dc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc1('0x2'));var rp=require(_0x6dc1('0x3'));var moment=require(_0x6dc1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6dc1('0x5'));var util=require(_0x6dc1('0x6'));var path=require(_0x6dc1('0x7'));var sox=require(_0x6dc1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6dc1('0x9'));var _=require(_0x6dc1('0xa'));var squel=require(_0x6dc1('0xb'));var crypto=require(_0x6dc1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6dc1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6dc1('0xe'));var Papa=require(_0x6dc1('0xf'));var Redis=require('ioredis');var authService=require(_0x6dc1('0x10'));var qs=require(_0x6dc1('0x11'));var as=require(_0x6dc1('0x12'));var hardwareService=require(_0x6dc1('0x13'));var logger=require('../../config/logger')(_0x6dc1('0x14'));var utils=require(_0x6dc1('0x15'));var config=require(_0x6dc1('0x16'));var licenseUtil=require(_0x6dc1('0x17'));var db=require(_0x6dc1('0x18'))['db'];function respondWithStatusCode(_0x2558e5,_0x25ce49){_0x25ce49=_0x25ce49||0xcc;return function(_0x47eb9a){if(_0x47eb9a){return _0x2558e5[_0x6dc1('0x19')](_0x25ce49);}return _0x2558e5[_0x6dc1('0x1a')](_0x25ce49)[_0x6dc1('0x1b')]();};}function respondWithResult(_0xfd3e1b,_0x329d66){_0x329d66=_0x329d66||0xc8;return function(_0x41287c){if(_0x41287c){return _0xfd3e1b[_0x6dc1('0x1a')](_0x329d66)[_0x6dc1('0x1c')](_0x41287c);}};}function respondWithFilteredResult(_0x175b9a,_0x9e0a15){return function(_0x55baac){if(_0x55baac){var _0x4a90d8=typeof _0x9e0a15['offset']===_0x6dc1('0x1d')&&typeof _0x9e0a15['limit']==='undefined';var _0x24abad=_0x55baac[_0x6dc1('0x1e')];var _0x89be51=_0x4a90d8?0x0:_0x9e0a15[_0x6dc1('0x1f')];var _0x12bc69=_0x4a90d8?_0x55baac['count']:_0x9e0a15[_0x6dc1('0x1f')]+_0x9e0a15[_0x6dc1('0x20')];var _0x24450d;if(_0x12bc69>=_0x24abad){_0x12bc69=_0x24abad;_0x24450d=0xc8;}else{_0x24450d=0xce;}_0x175b9a[_0x6dc1('0x1a')](_0x24450d);return _0x175b9a[_0x6dc1('0x21')](_0x6dc1('0x22'),_0x89be51+'-'+_0x12bc69+'/'+_0x24abad)[_0x6dc1('0x1c')](_0x55baac);}return null;};}function patchUpdates(_0x3b90fc){return function(_0x1a55d5){try{jsonpatch[_0x6dc1('0x23')](_0x1a55d5,_0x3b90fc,!![]);}catch(_0x1853fe){return BPromise['reject'](_0x1853fe);}return _0x1a55d5[_0x6dc1('0x24')]();};}function saveUpdates(_0x33c7b6,_0x11de32){return function(_0x3cc2f4){if(_0x3cc2f4){return _0x3cc2f4['update'](_0x33c7b6)[_0x6dc1('0x25')](function(_0x55db97){return _0x55db97;});}return null;};}function removeEntity(_0x17965e,_0x388bd9){return function(_0x3c023b){if(_0x3c023b){return _0x3c023b[_0x6dc1('0x26')]()[_0x6dc1('0x25')](function(){_0x17965e[_0x6dc1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b5c1,_0x13f4a9){return function(_0x4fe902){if(!_0x4fe902){_0x52b5c1['sendStatus'](0x194);}return _0x4fe902;};}function handleError(_0x237127,_0x42fd72){_0x42fd72=_0x42fd72||0x1f4;return function(_0x47eeec){logger['error'](_0x47eeec[_0x6dc1('0x27')]);if(_0x47eeec['name']){delete _0x47eeec['name'];}_0x237127[_0x6dc1('0x1a')](_0x42fd72)[_0x6dc1('0x28')](_0x47eeec);};}exports[_0x6dc1('0x29')]=function(_0xc3c8a5,_0x23fbcc){var _0xa087f7={},_0x383e98={},_0x1a7645={'count':0x0,'rows':[]};var _0x589a4a=_[_0x6dc1('0x2a')](db[_0x6dc1('0x2b')][_0x6dc1('0x2c')],function(_0x35754a){return{'name':_0x35754a[_0x6dc1('0x2d')],'type':_0x35754a[_0x6dc1('0x2e')][_0x6dc1('0x2f')]};});_0x383e98[_0x6dc1('0x30')]=_[_0x6dc1('0x2a')](_0x589a4a,_0x6dc1('0x31'));_0x383e98[_0x6dc1('0x32')]=_[_0x6dc1('0x33')](_0xc3c8a5[_0x6dc1('0x32')]);_0x383e98[_0x6dc1('0x34')]=_[_0x6dc1('0x35')](_0x383e98['model'],_0x383e98[_0x6dc1('0x32')]);_0xa087f7[_0x6dc1('0x36')]=_[_0x6dc1('0x35')](_0x383e98['model'],qs[_0x6dc1('0x37')](_0xc3c8a5[_0x6dc1('0x32')][_0x6dc1('0x37')]));_0xa087f7[_0x6dc1('0x36')]=_0xa087f7[_0x6dc1('0x36')][_0x6dc1('0x38')]?_0xa087f7[_0x6dc1('0x36')]:_0x383e98[_0x6dc1('0x30')];if(!_0xc3c8a5[_0x6dc1('0x32')][_0x6dc1('0x39')]('nolimit')){_0xa087f7['limit']=qs[_0x6dc1('0x20')](_0xc3c8a5[_0x6dc1('0x32')][_0x6dc1('0x20')]);_0xa087f7['offset']=qs[_0x6dc1('0x1f')](_0xc3c8a5[_0x6dc1('0x32')][_0x6dc1('0x1f')]);}_0xa087f7[_0x6dc1('0x3a')]=qs[_0x6dc1('0x3b')](_0xc3c8a5[_0x6dc1('0x32')][_0x6dc1('0x3b')]);_0xa087f7[_0x6dc1('0x3c')]=qs[_0x6dc1('0x34')](_[_0x6dc1('0x3d')](_0xc3c8a5[_0x6dc1('0x32')],_0x383e98['filters']),_0x589a4a);if(_0xc3c8a5[_0x6dc1('0x32')][_0x6dc1('0x3e')]){_0xa087f7['where']=_[_0x6dc1('0x3f')](_0xa087f7[_0x6dc1('0x3c')],{'$or':_[_0x6dc1('0x2a')](_0x589a4a,function(_0xc1eef9){if(_0xc1eef9['type']!==_0x6dc1('0x40')){var _0x4db0d1={};_0x4db0d1[_0xc1eef9['name']]={'$like':'%'+_0xc3c8a5[_0x6dc1('0x32')][_0x6dc1('0x3e')]+'%'};return _0x4db0d1;}})});}_0xa087f7=_[_0x6dc1('0x3f')]({},_0xa087f7,_0xc3c8a5[_0x6dc1('0x41')]);var _0x50cce9={'where':_0xa087f7[_0x6dc1('0x3c')]};return db['FreshdeskConfiguration']['count'](_0x50cce9)[_0x6dc1('0x25')](function(_0x3efd18){_0x1a7645['count']=_0x3efd18;if(_0xc3c8a5['query']['includeAll']){_0xa087f7['include']=[{'all':!![]}];}return db[_0x6dc1('0x2b')][_0x6dc1('0x42')](_0xa087f7);})[_0x6dc1('0x25')](function(_0x1d24b2){_0x1a7645[_0x6dc1('0x43')]=_0x1d24b2;return _0x1a7645;})['then'](respondWithFilteredResult(_0x23fbcc,_0xa087f7))['catch'](handleError(_0x23fbcc,null));};exports[_0x6dc1('0x44')]=function(_0x16d802,_0x3f8079){var _0x4d1fb4={'raw':![],'where':{'id':_0x16d802['params']['id']}},_0x1a7afa={};_0x1a7afa[_0x6dc1('0x30')]=_['keys'](db['FreshdeskConfiguration'][_0x6dc1('0x2c')]);_0x1a7afa[_0x6dc1('0x32')]=_[_0x6dc1('0x33')](_0x16d802[_0x6dc1('0x32')]);_0x1a7afa[_0x6dc1('0x34')]=_[_0x6dc1('0x35')](_0x1a7afa[_0x6dc1('0x30')],_0x1a7afa[_0x6dc1('0x32')]);_0x4d1fb4[_0x6dc1('0x36')]=_[_0x6dc1('0x35')](_0x1a7afa[_0x6dc1('0x30')],qs[_0x6dc1('0x37')](_0x16d802['query'][_0x6dc1('0x37')]));_0x4d1fb4['attributes']=_0x4d1fb4[_0x6dc1('0x36')][_0x6dc1('0x38')]?_0x4d1fb4[_0x6dc1('0x36')]:_0x1a7afa[_0x6dc1('0x30')];if(_0x16d802[_0x6dc1('0x32')][_0x6dc1('0x45')]){_0x4d1fb4[_0x6dc1('0x46')]=[{'all':!![]}];}_0x4d1fb4=_[_0x6dc1('0x3f')]({},_0x4d1fb4,_0x16d802[_0x6dc1('0x41')]);return db[_0x6dc1('0x2b')][_0x6dc1('0x47')](_0x4d1fb4)[_0x6dc1('0x25')](handleEntityNotFound(_0x3f8079,null))[_0x6dc1('0x25')](respondWithResult(_0x3f8079,null))['catch'](handleError(_0x3f8079,null));};exports[_0x6dc1('0x48')]=function(_0x171a08,_0x8a4c16){return db[_0x6dc1('0x2b')][_0x6dc1('0x48')](_0x171a08[_0x6dc1('0x49')],{})[_0x6dc1('0x25')](respondWithResult(_0x8a4c16,0xc9))[_0x6dc1('0x4a')](handleError(_0x8a4c16,null));};exports[_0x6dc1('0x4b')]=function(_0x148159,_0x1eb38a){if(_0x148159['body']['id']){delete _0x148159[_0x6dc1('0x49')]['id'];}return db[_0x6dc1('0x2b')][_0x6dc1('0x47')]({'where':{'id':_0x148159[_0x6dc1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1eb38a,null))['then'](saveUpdates(_0x148159[_0x6dc1('0x49')],null))[_0x6dc1('0x25')](respondWithResult(_0x1eb38a,null))[_0x6dc1('0x4a')](handleError(_0x1eb38a,null));};exports[_0x6dc1('0x26')]=function(_0x49e329,_0x199833){return db[_0x6dc1('0x2b')][_0x6dc1('0x47')]({'where':{'id':_0x49e329[_0x6dc1('0x4c')]['id']}})[_0x6dc1('0x25')](handleEntityNotFound(_0x199833,null))['then'](removeEntity(_0x199833,null))[_0x6dc1('0x4a')](handleError(_0x199833,null));};exports[_0x6dc1('0x4d')]=function(_0x149515,_0x126b5c,_0x19a704){var _0x1abffb={};var _0x31bbfb={};var _0x2dc41b;var _0x487368;return db['FreshdeskConfiguration'][_0x6dc1('0x4e')]({'where':{'id':_0x149515[_0x6dc1('0x4c')]['id']}})[_0x6dc1('0x25')](handleEntityNotFound(_0x126b5c,null))[_0x6dc1('0x25')](function(_0x31c0b8){if(_0x31c0b8){_0x2dc41b=_0x31c0b8;_0x31bbfb[_0x6dc1('0x30')]=_[_0x6dc1('0x33')](db[_0x6dc1('0x4f')][_0x6dc1('0x2c')]);_0x31bbfb[_0x6dc1('0x32')]=_['keys'](_0x149515['query']);_0x31bbfb[_0x6dc1('0x34')]=_[_0x6dc1('0x35')](_0x31bbfb['model'],_0x31bbfb[_0x6dc1('0x32')]);_0x1abffb['attributes']=_[_0x6dc1('0x35')](_0x31bbfb['model'],qs[_0x6dc1('0x37')](_0x149515[_0x6dc1('0x32')][_0x6dc1('0x37')]));_0x1abffb[_0x6dc1('0x36')]=_0x1abffb[_0x6dc1('0x36')]['length']?_0x1abffb[_0x6dc1('0x36')]:_0x31bbfb['model'];_0x1abffb[_0x6dc1('0x3a')]=qs['sort'](_0x149515['query'][_0x6dc1('0x3b')]);_0x1abffb['where']=qs[_0x6dc1('0x34')](_[_0x6dc1('0x3d')](_0x149515[_0x6dc1('0x32')],_0x31bbfb[_0x6dc1('0x34')]));if(_0x149515[_0x6dc1('0x32')][_0x6dc1('0x3e')]){_0x1abffb['where']=_[_0x6dc1('0x3f')](_0x1abffb['where'],{'$or':_[_0x6dc1('0x2a')](_0x1abffb[_0x6dc1('0x36')],function(_0x7f8df8){var _0x13c7ea={};_0x13c7ea[_0x7f8df8]={'$like':'%'+_0x149515['query'][_0x6dc1('0x3e')]+'%'};return _0x13c7ea;})});}_0x1abffb=_[_0x6dc1('0x3f')]({},_0x1abffb,_0x149515[_0x6dc1('0x41')]);return _0x2dc41b[_0x6dc1('0x4d')](_0x1abffb);}})[_0x6dc1('0x25')](function(_0x468f04){if(_0x468f04){_0x487368=_0x468f04[_0x6dc1('0x38')];if(!_0x149515[_0x6dc1('0x32')][_0x6dc1('0x39')](_0x6dc1('0x50'))){_0x1abffb[_0x6dc1('0x20')]=qs[_0x6dc1('0x20')](_0x149515['query'][_0x6dc1('0x20')]);_0x1abffb[_0x6dc1('0x1f')]=qs[_0x6dc1('0x1f')](_0x149515[_0x6dc1('0x32')][_0x6dc1('0x1f')]);}return _0x2dc41b['getFields'](_0x1abffb);}})[_0x6dc1('0x25')](function(_0x17c804){if(_0x17c804){return _0x17c804?{'count':_0x487368,'rows':_0x17c804}:null;}})['then'](respondWithResult(_0x126b5c,null))[_0x6dc1('0x4a')](handleError(_0x126b5c,null));};exports[_0x6dc1('0x51')]=function(_0x3e4f38,_0xb80e57,_0x56482f){var _0x12c460={};var _0x2fb363={};var _0x1482db;var _0x348de5;return db['FreshdeskConfiguration'][_0x6dc1('0x4e')]({'where':{'id':_0x3e4f38[_0x6dc1('0x4c')]['id']}})[_0x6dc1('0x25')](handleEntityNotFound(_0xb80e57,null))['then'](function(_0xb916ed){if(_0xb916ed){_0x1482db=_0xb916ed;_0x2fb363[_0x6dc1('0x30')]=_[_0x6dc1('0x33')](db['FreshdeskField'][_0x6dc1('0x2c')]);_0x2fb363[_0x6dc1('0x32')]=_[_0x6dc1('0x33')](_0x3e4f38[_0x6dc1('0x32')]);_0x2fb363[_0x6dc1('0x34')]=_[_0x6dc1('0x35')](_0x2fb363[_0x6dc1('0x30')],_0x2fb363[_0x6dc1('0x32')]);_0x12c460[_0x6dc1('0x36')]=_[_0x6dc1('0x35')](_0x2fb363['model'],qs[_0x6dc1('0x37')](_0x3e4f38['query'][_0x6dc1('0x37')]));_0x12c460[_0x6dc1('0x36')]=_0x12c460[_0x6dc1('0x36')][_0x6dc1('0x38')]?_0x12c460[_0x6dc1('0x36')]:_0x2fb363[_0x6dc1('0x30')];_0x12c460[_0x6dc1('0x3a')]=qs[_0x6dc1('0x3b')](_0x3e4f38[_0x6dc1('0x32')][_0x6dc1('0x3b')]);_0x12c460[_0x6dc1('0x3c')]=qs['filters'](_[_0x6dc1('0x3d')](_0x3e4f38[_0x6dc1('0x32')],_0x2fb363[_0x6dc1('0x34')]));if(_0x3e4f38[_0x6dc1('0x32')][_0x6dc1('0x3e')]){_0x12c460['where']=_[_0x6dc1('0x3f')](_0x12c460[_0x6dc1('0x3c')],{'$or':_[_0x6dc1('0x2a')](_0x12c460[_0x6dc1('0x36')],function(_0x18424e){var _0x477cfc={};_0x477cfc[_0x18424e]={'$like':'%'+_0x3e4f38[_0x6dc1('0x32')][_0x6dc1('0x3e')]+'%'};return _0x477cfc;})});}_0x12c460=_[_0x6dc1('0x3f')]({},_0x12c460,_0x3e4f38[_0x6dc1('0x41')]);return _0x1482db[_0x6dc1('0x51')](_0x12c460);}})['then'](function(_0x283a68){if(_0x283a68){_0x348de5=_0x283a68[_0x6dc1('0x38')];if(!_0x3e4f38[_0x6dc1('0x32')]['hasOwnProperty'](_0x6dc1('0x50'))){_0x12c460[_0x6dc1('0x20')]=qs[_0x6dc1('0x20')](_0x3e4f38['query']['limit']);_0x12c460[_0x6dc1('0x1f')]=qs[_0x6dc1('0x1f')](_0x3e4f38[_0x6dc1('0x32')]['offset']);}return _0x1482db[_0x6dc1('0x51')](_0x12c460);}})[_0x6dc1('0x25')](function(_0x4fa1f6){if(_0x4fa1f6){return _0x4fa1f6?{'count':_0x348de5,'rows':_0x4fa1f6}:null;}})[_0x6dc1('0x25')](respondWithResult(_0xb80e57,null))['catch'](handleError(_0xb80e57,null));};exports[_0x6dc1('0x52')]=function(_0x1d85b5,_0x40df2d,_0xdae94a){var _0x339808={};var _0x2eea93={};var _0x26b23f;var _0x55c365;return db['FreshdeskConfiguration'][_0x6dc1('0x4e')]({'where':{'id':_0x1d85b5[_0x6dc1('0x4c')]['id']}})[_0x6dc1('0x25')](handleEntityNotFound(_0x40df2d,null))['then'](function(_0x3e7bcb){if(_0x3e7bcb){_0x26b23f=_0x3e7bcb;_0x2eea93[_0x6dc1('0x30')]=_['keys'](db[_0x6dc1('0x4f')]['rawAttributes']);_0x2eea93['query']=_[_0x6dc1('0x33')](_0x1d85b5[_0x6dc1('0x32')]);_0x2eea93[_0x6dc1('0x34')]=_[_0x6dc1('0x35')](_0x2eea93[_0x6dc1('0x30')],_0x2eea93[_0x6dc1('0x32')]);_0x339808[_0x6dc1('0x36')]=_[_0x6dc1('0x35')](_0x2eea93[_0x6dc1('0x30')],qs[_0x6dc1('0x37')](_0x1d85b5['query'][_0x6dc1('0x37')]));_0x339808['attributes']=_0x339808[_0x6dc1('0x36')]['length']?_0x339808[_0x6dc1('0x36')]:_0x2eea93['model'];_0x339808[_0x6dc1('0x3a')]=qs['sort'](_0x1d85b5[_0x6dc1('0x32')][_0x6dc1('0x3b')]);_0x339808[_0x6dc1('0x3c')]=qs[_0x6dc1('0x34')](_['pick'](_0x1d85b5[_0x6dc1('0x32')],_0x2eea93[_0x6dc1('0x34')]));if(_0x1d85b5[_0x6dc1('0x32')][_0x6dc1('0x3e')]){_0x339808[_0x6dc1('0x3c')]=_[_0x6dc1('0x3f')](_0x339808[_0x6dc1('0x3c')],{'$or':_[_0x6dc1('0x2a')](_0x339808[_0x6dc1('0x36')],function(_0x3b9990){var _0x21dbc2={};_0x21dbc2[_0x3b9990]={'$like':'%'+_0x1d85b5[_0x6dc1('0x32')][_0x6dc1('0x3e')]+'%'};return _0x21dbc2;})});}_0x339808=_[_0x6dc1('0x3f')]({},_0x339808,_0x1d85b5[_0x6dc1('0x41')]);return _0x26b23f[_0x6dc1('0x52')](_0x339808);}})[_0x6dc1('0x25')](function(_0x49d27e){if(_0x49d27e){_0x55c365=_0x49d27e['length'];if(!_0x1d85b5[_0x6dc1('0x32')]['hasOwnProperty'](_0x6dc1('0x50'))){_0x339808[_0x6dc1('0x20')]=qs[_0x6dc1('0x20')](_0x1d85b5[_0x6dc1('0x32')][_0x6dc1('0x20')]);_0x339808['offset']=qs[_0x6dc1('0x1f')](_0x1d85b5[_0x6dc1('0x32')][_0x6dc1('0x1f')]);}return _0x26b23f[_0x6dc1('0x52')](_0x339808);}})[_0x6dc1('0x25')](function(_0x43d81c){if(_0x43d81c){return _0x43d81c?{'count':_0x55c365,'rows':_0x43d81c}:null;}})[_0x6dc1('0x25')](respondWithResult(_0x40df2d,null))['catch'](handleError(_0x40df2d,null));};exports[_0x6dc1('0x53')]=function(_0x4251cf,_0x28c199,_0x494b46){var _0x18d77a={};var _0xd1fc73={};var _0x1120a9;var _0x5394e1;return db[_0x6dc1('0x2b')]['findOne']({'where':{'id':_0x4251cf['params']['id']}})[_0x6dc1('0x25')](handleEntityNotFound(_0x28c199,null))[_0x6dc1('0x25')](function(_0x2bb5bb){if(_0x2bb5bb){_0x1120a9=_0x2bb5bb;_0xd1fc73['model']=_[_0x6dc1('0x33')](db['Tag']['rawAttributes']);_0xd1fc73['query']=_['keys'](_0x4251cf[_0x6dc1('0x32')]);_0xd1fc73['filters']=_[_0x6dc1('0x35')](_0xd1fc73[_0x6dc1('0x30')],_0xd1fc73[_0x6dc1('0x32')]);_0x18d77a['attributes']=_[_0x6dc1('0x35')](_0xd1fc73[_0x6dc1('0x30')],qs[_0x6dc1('0x37')](_0x4251cf['query'][_0x6dc1('0x37')]));_0x18d77a['attributes']=_0x18d77a[_0x6dc1('0x36')][_0x6dc1('0x38')]?_0x18d77a['attributes']:_0xd1fc73[_0x6dc1('0x30')];_0x18d77a[_0x6dc1('0x3a')]=qs[_0x6dc1('0x3b')](_0x4251cf[_0x6dc1('0x32')][_0x6dc1('0x3b')]);_0x18d77a[_0x6dc1('0x3c')]=qs[_0x6dc1('0x34')](_['pick'](_0x4251cf[_0x6dc1('0x32')],_0xd1fc73[_0x6dc1('0x34')]));if(_0x4251cf[_0x6dc1('0x32')][_0x6dc1('0x3e')]){_0x18d77a[_0x6dc1('0x3c')]=_[_0x6dc1('0x3f')](_0x18d77a[_0x6dc1('0x3c')],{'$or':_['map'](_0x18d77a['attributes'],function(_0x3662d0){var _0x3d4da2={};_0x3d4da2[_0x3662d0]={'$like':'%'+_0x4251cf[_0x6dc1('0x32')][_0x6dc1('0x3e')]+'%'};return _0x3d4da2;})});}_0x18d77a=_[_0x6dc1('0x3f')]({},_0x18d77a,_0x4251cf[_0x6dc1('0x41')]);return _0x1120a9['getTags'](_0x18d77a);}})['then'](function(_0x2430ef){if(_0x2430ef){_0x5394e1=_0x2430ef[_0x6dc1('0x38')];if(!_0x4251cf[_0x6dc1('0x32')][_0x6dc1('0x39')]('nolimit')){_0x18d77a[_0x6dc1('0x20')]=qs[_0x6dc1('0x20')](_0x4251cf[_0x6dc1('0x32')]['limit']);_0x18d77a['offset']=qs[_0x6dc1('0x1f')](_0x4251cf[_0x6dc1('0x32')]['offset']);}return _0x1120a9[_0x6dc1('0x53')](_0x18d77a);}})[_0x6dc1('0x25')](function(_0xea1915){if(_0xea1915){return _0xea1915?{'count':_0x5394e1,'rows':_0xea1915}:null;}})[_0x6dc1('0x25')](respondWithResult(_0x28c199,null))['catch'](handleError(_0x28c199,null));};exports[_0x6dc1('0x54')]=function(_0x1efe52,_0x180034,_0x8794c3){if(_0x1efe52[_0x6dc1('0x49')]['id']){delete _0x1efe52[_0x6dc1('0x49')]['id'];}return db[_0x6dc1('0x2b')][_0x6dc1('0x4e')]({'where':{'id':_0x1efe52[_0x6dc1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x180034,null))[_0x6dc1('0x25')](function(_0x3cc5d6){if(_0x3cc5d6){return _0x3cc5d6[_0x6dc1('0x54')](_0x1efe52['body']['ids']||[]);}return null;})[_0x6dc1('0x25')](respondWithResult(_0x180034,null))['catch'](handleError(_0x180034,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 032cea3..6908181 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 _0xa502=['define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x30aafb,_0x15166d){var _0x25f84f=function(_0x3d5019){while(--_0x3d5019){_0x30aafb['push'](_0x30aafb['shift']());}};_0x25f84f(++_0x15166d);}(_0xa502,0x1d7));var _0x2a50=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa502[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x2a50('0x0'));var logger=require(_0x2a50('0x1'))(_0x2a50('0x2'));var moment=require('moment');var BPromise=require(_0x2a50('0x3'));var rp=require(_0x2a50('0x4'));var fs=require('fs');var path=require(_0x2a50('0x5'));var rimraf=require(_0x2a50('0x6'));var config=require(_0x2a50('0x7'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x2a50('0x8')]=function(_0x3fb719,_0x38bf98){return _0x3fb719[_0x2a50('0x9')](_0x2a50('0xa'),attributes,{'tableName':_0x2a50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x47c3=['path','rimraf','./intFreshdeskConfiguration.attributes','FreshdeskConfiguration','lodash','util','api','moment','request-promise'];(function(_0x112db5,_0x38a06d){var _0x1d7d06=function(_0x44571e){while(--_0x44571e){_0x112db5['push'](_0x112db5['shift']());}};_0x1d7d06(++_0x38a06d);}(_0x47c3,0x1ab));var _0x347c=function(_0xc3776,_0x306a6f){_0xc3776=_0xc3776-0x0;var _0x52a884=_0x47c3[_0xc3776];return _0x52a884;};'use strict';var _=require(_0x347c('0x0'));var util=require(_0x347c('0x1'));var logger=require('../../config/logger')(_0x347c('0x2'));var moment=require(_0x347c('0x3'));var BPromise=require('bluebird');var rp=require(_0x347c('0x4'));var fs=require('fs');var path=require(_0x347c('0x5'));var rimraf=require(_0x347c('0x6'));var config=require('../../config/environment');var attributes=require(_0x347c('0x7'));module['exports']=function(_0x15006c,_0x623f79){return _0x15006c['define'](_0x347c('0x8'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index f575aa7..542f7c7 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 _0xe9cb=['info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','request','then'];(function(_0xeb447a,_0x4b67f4){var _0x5db1d8=function(_0x5a5652){while(--_0x5a5652){_0xeb447a['push'](_0xeb447a['shift']());}};_0x5db1d8(++_0x4b67f4);}(_0xe9cb,0xc7));var _0xbe9c=function(_0x3e216a,_0x1f81ea){_0x3e216a=_0x3e216a-0x0;var _0x29bffc=_0xe9cb[_0x3e216a];return _0x29bffc;};'use strict';var _=require(_0xbe9c('0x0'));var util=require(_0xbe9c('0x1'));var moment=require(_0xbe9c('0x2'));var BPromise=require(_0xbe9c('0x3'));var rs=require(_0xbe9c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe9c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe9c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbe9c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19e2d6,_0x54a458,_0x2dbcaa){return new BPromise(function(_0xcf6a2a,_0x562802){return client[_0xbe9c('0x8')](_0x19e2d6,_0x2dbcaa)[_0xbe9c('0x9')](function(_0x3618ec){logger[_0xbe9c('0xa')](_0xbe9c('0xb'),_0x54a458,'request\x20sent');logger['debug'](_0xbe9c('0xc'),_0x54a458,_0xbe9c('0xd'),JSON[_0xbe9c('0xe')](_0x3618ec));if(_0x3618ec['error']){if(_0x3618ec['error']['code']===0x1f4){logger[_0xbe9c('0xf')](_0xbe9c('0xb'),_0x54a458,_0x3618ec[_0xbe9c('0xf')]['message']);return _0x562802(_0x3618ec[_0xbe9c('0xf')][_0xbe9c('0x10')]);}logger['error'](_0xbe9c('0xb'),_0x54a458,_0x3618ec['error'][_0xbe9c('0x10')]);return _0xcf6a2a(_0x3618ec[_0xbe9c('0xf')][_0xbe9c('0x10')]);}else{logger[_0xbe9c('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x54a458,_0xbe9c('0xd'));_0xcf6a2a(_0x3618ec[_0xbe9c('0x11')][_0xbe9c('0x10')]);}})[_0xbe9c('0x12')](function(_0x304d6e){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x54a458,_0x304d6e);_0x562802(_0x304d6e);});});} \ No newline at end of file +var _0x98ae=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x17f762,_0x4caa7e){var _0x2a2407=function(_0x5d7e76){while(--_0x5d7e76){_0x17f762['push'](_0x17f762['shift']());}};_0x2a2407(++_0x4caa7e);}(_0x98ae,0x13d));var _0xe98a=function(_0x39b980,_0x2ada2e){_0x39b980=_0x39b980-0x0;var _0x24e259=_0x98ae[_0x39b980];return _0x24e259;};'use strict';var _=require(_0xe98a('0x0'));var util=require(_0xe98a('0x1'));var moment=require(_0xe98a('0x2'));var BPromise=require(_0xe98a('0x3'));var rs=require(_0xe98a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe98a('0x5'))['db'];var utils=require(_0xe98a('0x6'));var logger=require(_0xe98a('0x7'))('rpc');var config=require(_0xe98a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe98a('0x9')][_0xe98a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c7b1e,_0xfd6d71,_0x2ed526){return new BPromise(function(_0x31ecb7,_0x319fa4){return client['request'](_0x4c7b1e,_0x2ed526)[_0xe98a('0xb')](function(_0x45a7d0){logger[_0xe98a('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xfd6d71,_0xe98a('0xd'));logger[_0xe98a('0xe')](_0xe98a('0xf'),_0xfd6d71,'request\x20sent',JSON[_0xe98a('0x10')](_0x45a7d0));if(_0x45a7d0[_0xe98a('0x11')]){if(_0x45a7d0[_0xe98a('0x11')]['code']===0x1f4){logger[_0xe98a('0x11')](_0xe98a('0x12'),_0xfd6d71,_0x45a7d0['error'][_0xe98a('0x13')]);return _0x319fa4(_0x45a7d0[_0xe98a('0x11')][_0xe98a('0x13')]);}logger[_0xe98a('0x11')](_0xe98a('0x12'),_0xfd6d71,_0x45a7d0[_0xe98a('0x11')][_0xe98a('0x13')]);return _0x31ecb7(_0x45a7d0['error'][_0xe98a('0x13')]);}else{logger['info'](_0xe98a('0x12'),_0xfd6d71,_0xe98a('0xd'));_0x31ecb7(_0x45a7d0[_0xe98a('0x14')][_0xe98a('0x13')]);}})['catch'](function(_0x14ee3d){logger[_0xe98a('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xfd6d71,_0x14ee3d);_0x319fa4(_0x14ee3d);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index ecf0205..b1310d6 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 _0xce24=['Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','path','express'];(function(_0x5c52da,_0x182ff8){var _0x4d5ba4=function(_0x5c4556){while(--_0x5c4556){_0x5c52da['push'](_0x5c52da['shift']());}};_0x4d5ba4(++_0x182ff8);}(_0xce24,0x1be));var _0x4ce2=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xce24[_0x56482c];return _0x5aae7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ce2('0x0'));var timeout=require('connect-timeout');var express=require(_0x4ce2('0x1'));var router=express[_0x4ce2('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4ce2('0x3'));var interaction=require(_0x4ce2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ce2('0x5'));router[_0x4ce2('0x6')]('/',auth[_0x4ce2('0x7')](),controller[_0x4ce2('0x8')]);router['get'](_0x4ce2('0x9'),auth[_0x4ce2('0x7')](),controller['show']);router['post']('/',auth[_0x4ce2('0x7')](),controller[_0x4ce2('0xa')]);router[_0x4ce2('0xb')](_0x4ce2('0x9'),auth[_0x4ce2('0x7')](),controller[_0x4ce2('0xc')]);router['delete'](_0x4ce2('0x9'),auth[_0x4ce2('0x7')](),controller[_0x4ce2('0xd')]);module['exports']=router; \ No newline at end of file +var _0x2851=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x49a6a5,_0x48eda5){var _0x4f0cdc=function(_0x34704b){while(--_0x34704b){_0x49a6a5['push'](_0x49a6a5['shift']());}};_0x4f0cdc(++_0x48eda5);}(_0x2851,0x159));var _0x1285=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2851[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x1285('0x0'));var util=require(_0x1285('0x1'));var path=require(_0x1285('0x2'));var timeout=require(_0x1285('0x3'));var express=require(_0x1285('0x4'));var router=express[_0x1285('0x5')]();var fs_extra=require(_0x1285('0x6'));var auth=require(_0x1285('0x7'));var interaction=require(_0x1285('0x8'));var config=require(_0x1285('0x9'));var controller=require(_0x1285('0xa'));router[_0x1285('0xb')]('/',auth[_0x1285('0xc')](),controller[_0x1285('0xd')]);router[_0x1285('0xb')](_0x1285('0xe'),auth['isAuthenticated'](),controller[_0x1285('0xf')]);router[_0x1285('0x10')]('/',auth[_0x1285('0xc')](),controller[_0x1285('0x11')]);router[_0x1285('0x12')](_0x1285('0xe'),auth[_0x1285('0xc')](),controller['update']);router[_0x1285('0x13')](_0x1285('0xe'),auth[_0x1285('0xc')](),controller[_0x1285('0x14')]);module[_0x1285('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index c99d4dc..80253e0 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 _0xb3fc=['customVariable','keyValue','picklist','STRING','ENUM','variable','sequelize','exports','string'];(function(_0x2a66b5,_0x1c5502){var _0x18b701=function(_0x5de565){while(--_0x5de565){_0x2a66b5['push'](_0x2a66b5['shift']());}};_0x18b701(++_0x1c5502);}(_0xb3fc,0x192));var _0xcb3f=function(_0x16535d,_0xe13222){_0x16535d=_0x16535d-0x0;var _0x4a0239=_0xb3fc[_0x16535d];return _0x4a0239;};'use strict';var Sequelize=require(_0xcb3f('0x0'));module[_0xcb3f('0x1')]={'type':{'type':Sequelize['ENUM'](_0xcb3f('0x2'),'variable',_0xcb3f('0x3'),_0xcb3f('0x4'),_0xcb3f('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xcb3f('0x6')]},'key':{'type':Sequelize[_0xcb3f('0x6')]},'keyType':{'type':Sequelize[_0xcb3f('0x7')](_0xcb3f('0x2'),_0xcb3f('0x8'),_0xcb3f('0x3'))},'keyContent':{'type':Sequelize[_0xcb3f('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda70=['customVariable','ENUM','string','variable','keyValue','picklist','STRING'];(function(_0xc036bb,_0x5cab81){var _0x523ab9=function(_0x2eed72){while(--_0x2eed72){_0xc036bb['push'](_0xc036bb['shift']());}};_0x523ab9(++_0x5cab81);}(_0xda70,0x166));var _0x0da7=function(_0x3fa631,_0x24392c){_0x3fa631=_0x3fa631-0x0;var _0x5c9dec=_0xda70[_0x3fa631];return _0x5c9dec;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x0da7('0x0')](_0x0da7('0x1'),_0x0da7('0x2'),'customVariable',_0x0da7('0x3'),_0x0da7('0x4')),'defaultValue':_0x0da7('0x1')},'content':{'type':Sequelize[_0x0da7('0x5')]},'key':{'type':Sequelize[_0x0da7('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x0da7('0x1'),'variable',_0x0da7('0x6'))},'keyContent':{'type':Sequelize[_0x0da7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 4f4b4ae..795e770 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 _0x9348=['undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','FreshdeskField','count','include','findAll','show','params','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit'];(function(_0x3c48df,_0x56a07a){var _0x2fff07=function(_0x5b46f9){while(--_0x5b46f9){_0x3c48df['push'](_0x3c48df['shift']());}};_0x2fff07(++_0x56a07a);}(_0x9348,0x10d));var _0x8934=function(_0x2e55eb,_0x3c90b1){_0x2e55eb=_0x2e55eb-0x0;var _0x4d033d=_0x9348[_0x2e55eb];return _0x4d033d;};'use strict';var emlformat=require(_0x8934('0x0'));var rimraf=require(_0x8934('0x1'));var zipdir=require(_0x8934('0x2'));var jsonpatch=require(_0x8934('0x3'));var rp=require(_0x8934('0x4'));var moment=require('moment');var BPromise=require(_0x8934('0x5'));var Mustache=require(_0x8934('0x6'));var util=require('util');var path=require(_0x8934('0x7'));var sox=require(_0x8934('0x8'));var csv=require(_0x8934('0x9'));var ejs=require(_0x8934('0xa'));var fs=require('fs');var fs_extra=require(_0x8934('0xb'));var _=require(_0x8934('0xc'));var squel=require('squel');var crypto=require(_0x8934('0xd'));var jsforce=require(_0x8934('0xe'));var deskjs=require(_0x8934('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8934('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8934('0x11'));var hardwareService=require(_0x8934('0x12'));var logger=require(_0x8934('0x13'))(_0x8934('0x14'));var utils=require(_0x8934('0x15'));var config=require(_0x8934('0x16'));var licenseUtil=require(_0x8934('0x17'));var db=require(_0x8934('0x18'))['db'];function respondWithStatusCode(_0x4a999c,_0x68427d){_0x68427d=_0x68427d||0xcc;return function(_0x108eab){if(_0x108eab){return _0x4a999c[_0x8934('0x19')](_0x68427d);}return _0x4a999c[_0x8934('0x1a')](_0x68427d)[_0x8934('0x1b')]();};}function respondWithResult(_0xdf59f4,_0x5b560f){_0x5b560f=_0x5b560f||0xc8;return function(_0x254720){if(_0x254720){return _0xdf59f4[_0x8934('0x1a')](_0x5b560f)[_0x8934('0x1c')](_0x254720);}};}function respondWithFilteredResult(_0x94b948,_0x34d4dc){return function(_0x41e6a9){if(_0x41e6a9){var _0x2a5b04=typeof _0x34d4dc[_0x8934('0x1d')]==='undefined'&&typeof _0x34d4dc[_0x8934('0x1e')]===_0x8934('0x1f');var _0x261c78=_0x41e6a9['count'];var _0x47f25e=_0x2a5b04?0x0:_0x34d4dc['offset'];var _0x2ff9ce=_0x2a5b04?_0x41e6a9['count']:_0x34d4dc[_0x8934('0x1d')]+_0x34d4dc[_0x8934('0x1e')];var _0x14b4e4;if(_0x2ff9ce>=_0x261c78){_0x2ff9ce=_0x261c78;_0x14b4e4=0xc8;}else{_0x14b4e4=0xce;}_0x94b948[_0x8934('0x1a')](_0x14b4e4);return _0x94b948[_0x8934('0x20')]('Content-Range',_0x47f25e+'-'+_0x2ff9ce+'/'+_0x261c78)[_0x8934('0x1c')](_0x41e6a9);}return null;};}function patchUpdates(_0x5ae49f){return function(_0x476c6c){try{jsonpatch[_0x8934('0x21')](_0x476c6c,_0x5ae49f,!![]);}catch(_0x1ccbe5){return BPromise[_0x8934('0x22')](_0x1ccbe5);}return _0x476c6c[_0x8934('0x23')]();};}function saveUpdates(_0x331e18,_0x36fe20){return function(_0x4f4a9b){if(_0x4f4a9b){return _0x4f4a9b[_0x8934('0x24')](_0x331e18)[_0x8934('0x25')](function(_0x32020a){return _0x32020a;});}return null;};}function removeEntity(_0x343e09,_0x43b89a){return function(_0x5e593b){if(_0x5e593b){return _0x5e593b[_0x8934('0x26')]()[_0x8934('0x25')](function(){_0x343e09[_0x8934('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16cfc2,_0x561df2){return function(_0x14c5f0){if(!_0x14c5f0){_0x16cfc2[_0x8934('0x19')](0x194);}return _0x14c5f0;};}function handleError(_0x110f7f,_0x5ef0ed){_0x5ef0ed=_0x5ef0ed||0x1f4;return function(_0x1fd5eb){logger[_0x8934('0x27')](_0x1fd5eb[_0x8934('0x28')]);if(_0x1fd5eb[_0x8934('0x29')]){delete _0x1fd5eb['name'];}_0x110f7f[_0x8934('0x1a')](_0x5ef0ed)[_0x8934('0x2a')](_0x1fd5eb);};}exports[_0x8934('0x2b')]=function(_0x3d93c7,_0x44972b){var _0x20d448={},_0x3f328a={},_0x457634={'count':0x0,'rows':[]};var _0x9c6a71=_[_0x8934('0x2c')](db['FreshdeskField'][_0x8934('0x2d')],function(_0x3e973e){return{'name':_0x3e973e['fieldName'],'type':_0x3e973e[_0x8934('0x2e')][_0x8934('0x2f')]};});_0x3f328a[_0x8934('0x30')]=_[_0x8934('0x2c')](_0x9c6a71,'name');_0x3f328a[_0x8934('0x31')]=_[_0x8934('0x32')](_0x3d93c7[_0x8934('0x31')]);_0x3f328a[_0x8934('0x33')]=_[_0x8934('0x34')](_0x3f328a['model'],_0x3f328a[_0x8934('0x31')]);_0x20d448['attributes']=_['intersection'](_0x3f328a[_0x8934('0x30')],qs[_0x8934('0x35')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x35')]));_0x20d448['attributes']=_0x20d448[_0x8934('0x36')][_0x8934('0x37')]?_0x20d448[_0x8934('0x36')]:_0x3f328a[_0x8934('0x30')];if(!_0x3d93c7[_0x8934('0x31')]['hasOwnProperty'](_0x8934('0x38'))){_0x20d448[_0x8934('0x1e')]=qs['limit'](_0x3d93c7['query'][_0x8934('0x1e')]);_0x20d448[_0x8934('0x1d')]=qs['offset'](_0x3d93c7['query'][_0x8934('0x1d')]);}_0x20d448[_0x8934('0x39')]=qs[_0x8934('0x3a')](_0x3d93c7[_0x8934('0x31')][_0x8934('0x3a')]);_0x20d448[_0x8934('0x3b')]=qs[_0x8934('0x33')](_[_0x8934('0x3c')](_0x3d93c7[_0x8934('0x31')],_0x3f328a[_0x8934('0x33')]),_0x9c6a71);if(_0x3d93c7[_0x8934('0x31')]['filter']){_0x20d448[_0x8934('0x3b')]=_[_0x8934('0x3d')](_0x20d448['where'],{'$or':_[_0x8934('0x2c')](_0x9c6a71,function(_0x122ad1){if(_0x122ad1[_0x8934('0x2e')]!==_0x8934('0x3e')){var _0xb189f1={};_0xb189f1[_0x122ad1['name']]={'$like':'%'+_0x3d93c7['query']['filter']+'%'};return _0xb189f1;}})});}_0x20d448=_[_0x8934('0x3d')]({},_0x20d448,_0x3d93c7[_0x8934('0x3f')]);var _0x8814f6={'where':_0x20d448['where']};return db[_0x8934('0x40')]['count'](_0x8814f6)['then'](function(_0x332098){_0x457634[_0x8934('0x41')]=_0x332098;if(_0x3d93c7['query']['includeAll']){_0x20d448[_0x8934('0x42')]=[{'all':!![]}];}return db[_0x8934('0x40')][_0x8934('0x43')](_0x20d448);})['then'](function(_0x46bfe7){_0x457634['rows']=_0x46bfe7;return _0x457634;})[_0x8934('0x25')](respondWithFilteredResult(_0x44972b,_0x20d448))['catch'](handleError(_0x44972b,null));};exports[_0x8934('0x44')]=function(_0x476ed9,_0x83be9e){var _0x566d67={'raw':!![],'where':{'id':_0x476ed9[_0x8934('0x45')]['id']}},_0xefdfab={};_0xefdfab[_0x8934('0x30')]=_[_0x8934('0x32')](db['FreshdeskField'][_0x8934('0x2d')]);_0xefdfab[_0x8934('0x31')]=_[_0x8934('0x32')](_0x476ed9[_0x8934('0x31')]);_0xefdfab[_0x8934('0x33')]=_[_0x8934('0x34')](_0xefdfab[_0x8934('0x30')],_0xefdfab[_0x8934('0x31')]);_0x566d67['attributes']=_['intersection'](_0xefdfab['model'],qs[_0x8934('0x35')](_0x476ed9[_0x8934('0x31')]['fields']));_0x566d67[_0x8934('0x36')]=_0x566d67['attributes'][_0x8934('0x37')]?_0x566d67[_0x8934('0x36')]:_0xefdfab['model'];if(_0x476ed9[_0x8934('0x31')][_0x8934('0x46')]){_0x566d67[_0x8934('0x42')]=[{'all':!![]}];}_0x566d67=_[_0x8934('0x3d')]({},_0x566d67,_0x476ed9['options']);return db[_0x8934('0x40')][_0x8934('0x47')](_0x566d67)['then'](handleEntityNotFound(_0x83be9e,null))[_0x8934('0x25')](respondWithResult(_0x83be9e,null))[_0x8934('0x48')](handleError(_0x83be9e,null));};exports[_0x8934('0x49')]=function(_0x2d5c6a,_0x406d0a){return db[_0x8934('0x40')][_0x8934('0x49')](_0x2d5c6a[_0x8934('0x4a')],{})[_0x8934('0x25')](respondWithResult(_0x406d0a,0xc9))[_0x8934('0x48')](handleError(_0x406d0a,null));};exports[_0x8934('0x24')]=function(_0xe212bc,_0x2c322d){if(_0xe212bc[_0x8934('0x4a')]['id']){delete _0xe212bc[_0x8934('0x4a')]['id'];}return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0xe212bc[_0x8934('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c322d,null))[_0x8934('0x25')](saveUpdates(_0xe212bc[_0x8934('0x4a')],null))['then'](respondWithResult(_0x2c322d,null))['catch'](handleError(_0x2c322d,null));};exports['destroy']=function(_0x4bc431,_0x3610a0){return db[_0x8934('0x40')][_0x8934('0x47')]({'where':{'id':_0x4bc431['params']['id']}})['then'](handleEntityNotFound(_0x3610a0,null))[_0x8934('0x25')](removeEntity(_0x3610a0,null))['catch'](handleError(_0x3610a0,null));}; \ No newline at end of file +var _0xe5b5=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','FreshdeskField','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3862a4,_0xe3099b){var _0x406da4=function(_0x8300f6){while(--_0x8300f6){_0x3862a4['push'](_0x3862a4['shift']());}};_0x406da4(++_0xe3099b);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0xe5b5[_0x2d8d69];return _0x39ae22;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require(_0x5e5b('0xc'));var fs=require('fs');var fs_extra=require(_0x5e5b('0xd'));var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xb'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310f71,_0x18434e){_0x18434e=_0x18434e||0xcc;return function(_0x4559a0){if(_0x4559a0){return _0x310f71[_0x5e5b('0x1b')](_0x18434e);}return _0x310f71[_0x5e5b('0x1c')](_0x18434e)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x2e331d,_0x49edd0){_0x49edd0=_0x49edd0||0xc8;return function(_0x2b37fa){if(_0x2b37fa){return _0x2e331d[_0x5e5b('0x1c')](_0x49edd0)['json'](_0x2b37fa);}};}function respondWithFilteredResult(_0x227417,_0x578c14){return function(_0x4e9509){if(_0x4e9509){var _0x13a1cb=typeof _0x578c14[_0x5e5b('0x1e')]===_0x5e5b('0x1f')&&typeof _0x578c14['limit']===_0x5e5b('0x1f');var _0x4d490c=_0x4e9509[_0x5e5b('0x20')];var _0x45a091=_0x13a1cb?0x0:_0x578c14['offset'];var _0xe5aa6b=_0x13a1cb?_0x4e9509[_0x5e5b('0x20')]:_0x578c14[_0x5e5b('0x1e')]+_0x578c14['limit'];var _0x2bf0b7;if(_0xe5aa6b>=_0x4d490c){_0xe5aa6b=_0x4d490c;_0x2bf0b7=0xc8;}else{_0x2bf0b7=0xce;}_0x227417[_0x5e5b('0x1c')](_0x2bf0b7);return _0x227417['set'](_0x5e5b('0x21'),_0x45a091+'-'+_0xe5aa6b+'/'+_0x4d490c)[_0x5e5b('0x22')](_0x4e9509);}return null;};}function patchUpdates(_0x3c488e){return function(_0x2d8252){try{jsonpatch[_0x5e5b('0x23')](_0x2d8252,_0x3c488e,!![]);}catch(_0x33d61b){return BPromise[_0x5e5b('0x24')](_0x33d61b);}return _0x2d8252[_0x5e5b('0x25')]();};}function saveUpdates(_0x4a78e3,_0x512e46){return function(_0x256a00){if(_0x256a00){return _0x256a00[_0x5e5b('0x26')](_0x4a78e3)[_0x5e5b('0x27')](function(_0xe1c268){return _0xe1c268;});}return null;};}function removeEntity(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(_0x135c6c){return _0x135c6c[_0x5e5b('0x28')]()[_0x5e5b('0x27')](function(){_0x2e38ed[_0x5e5b('0x1c')](0xcc)[_0x5e5b('0x1d')]();});}};}function handleEntityNotFound(_0x4da321,_0x1ebb11){return function(_0x75800d){if(!_0x75800d){_0x4da321[_0x5e5b('0x1b')](0x194);}return _0x75800d;};}function handleError(_0x5a2ba8,_0x988e5d){_0x988e5d=_0x988e5d||0x1f4;return function(_0xdb2863){logger['error'](_0xdb2863[_0x5e5b('0x29')]);if(_0xdb2863[_0x5e5b('0x2a')]){delete _0xdb2863[_0x5e5b('0x2a')];}_0x5a2ba8[_0x5e5b('0x1c')](_0x988e5d)[_0x5e5b('0x2b')](_0xdb2863);};}exports[_0x5e5b('0x2c')]=function(_0x2cb695,_0x2b4351){var _0x3f6b25={},_0x42da3b={},_0xcb272c={'count':0x0,'rows':[]};var _0x28157a=_['map'](db['FreshdeskField'][_0x5e5b('0x2d')],function(_0x289f54){return{'name':_0x289f54[_0x5e5b('0x2e')],'type':_0x289f54[_0x5e5b('0x2f')][_0x5e5b('0x30')]};});_0x42da3b['model']=_[_0x5e5b('0x31')](_0x28157a,'name');_0x42da3b[_0x5e5b('0x32')]=_[_0x5e5b('0x33')](_0x2cb695[_0x5e5b('0x32')]);_0x42da3b[_0x5e5b('0x34')]=_['intersection'](_0x42da3b[_0x5e5b('0x35')],_0x42da3b[_0x5e5b('0x32')]);_0x3f6b25['attributes']=_[_0x5e5b('0x36')](_0x42da3b[_0x5e5b('0x35')],qs[_0x5e5b('0x37')](_0x2cb695[_0x5e5b('0x32')][_0x5e5b('0x37')]));_0x3f6b25[_0x5e5b('0x38')]=_0x3f6b25[_0x5e5b('0x38')][_0x5e5b('0x39')]?_0x3f6b25['attributes']:_0x42da3b[_0x5e5b('0x35')];if(!_0x2cb695[_0x5e5b('0x32')][_0x5e5b('0x3a')](_0x5e5b('0x3b'))){_0x3f6b25[_0x5e5b('0x3c')]=qs[_0x5e5b('0x3c')](_0x2cb695['query']['limit']);_0x3f6b25[_0x5e5b('0x1e')]=qs[_0x5e5b('0x1e')](_0x2cb695[_0x5e5b('0x32')]['offset']);}_0x3f6b25[_0x5e5b('0x3d')]=qs[_0x5e5b('0x3e')](_0x2cb695[_0x5e5b('0x32')][_0x5e5b('0x3e')]);_0x3f6b25['where']=qs[_0x5e5b('0x34')](_[_0x5e5b('0x3f')](_0x2cb695['query'],_0x42da3b['filters']),_0x28157a);if(_0x2cb695[_0x5e5b('0x32')][_0x5e5b('0x40')]){_0x3f6b25[_0x5e5b('0x41')]=_['merge'](_0x3f6b25[_0x5e5b('0x41')],{'$or':_['map'](_0x28157a,function(_0x5cb741){if(_0x5cb741[_0x5e5b('0x2f')]!==_0x5e5b('0x42')){var _0xef0295={};_0xef0295[_0x5cb741[_0x5e5b('0x2a')]]={'$like':'%'+_0x2cb695[_0x5e5b('0x32')][_0x5e5b('0x40')]+'%'};return _0xef0295;}})});}_0x3f6b25=_[_0x5e5b('0x43')]({},_0x3f6b25,_0x2cb695[_0x5e5b('0x44')]);var _0x1034fa={'where':_0x3f6b25['where']};return db[_0x5e5b('0x45')][_0x5e5b('0x20')](_0x1034fa)['then'](function(_0x204487){_0xcb272c['count']=_0x204487;if(_0x2cb695[_0x5e5b('0x32')][_0x5e5b('0x46')]){_0x3f6b25[_0x5e5b('0x47')]=[{'all':!![]}];}return db[_0x5e5b('0x45')][_0x5e5b('0x48')](_0x3f6b25);})[_0x5e5b('0x27')](function(_0x371550){_0xcb272c[_0x5e5b('0x49')]=_0x371550;return _0xcb272c;})[_0x5e5b('0x27')](respondWithFilteredResult(_0x2b4351,_0x3f6b25))[_0x5e5b('0x4a')](handleError(_0x2b4351,null));};exports[_0x5e5b('0x4b')]=function(_0x4e6fe2,_0x2b81dd){var _0x40e8ce={'raw':!![],'where':{'id':_0x4e6fe2['params']['id']}},_0x46fec9={};_0x46fec9[_0x5e5b('0x35')]=_[_0x5e5b('0x33')](db['FreshdeskField'][_0x5e5b('0x2d')]);_0x46fec9[_0x5e5b('0x32')]=_['keys'](_0x4e6fe2[_0x5e5b('0x32')]);_0x46fec9['filters']=_['intersection'](_0x46fec9['model'],_0x46fec9[_0x5e5b('0x32')]);_0x40e8ce['attributes']=_[_0x5e5b('0x36')](_0x46fec9['model'],qs[_0x5e5b('0x37')](_0x4e6fe2[_0x5e5b('0x32')][_0x5e5b('0x37')]));_0x40e8ce[_0x5e5b('0x38')]=_0x40e8ce[_0x5e5b('0x38')][_0x5e5b('0x39')]?_0x40e8ce[_0x5e5b('0x38')]:_0x46fec9['model'];if(_0x4e6fe2['query'][_0x5e5b('0x46')]){_0x40e8ce['include']=[{'all':!![]}];}_0x40e8ce=_['merge']({},_0x40e8ce,_0x4e6fe2['options']);return db[_0x5e5b('0x45')]['find'](_0x40e8ce)[_0x5e5b('0x27')](handleEntityNotFound(_0x2b81dd,null))[_0x5e5b('0x27')](respondWithResult(_0x2b81dd,null))[_0x5e5b('0x4a')](handleError(_0x2b81dd,null));};exports[_0x5e5b('0x4c')]=function(_0x2982e7,_0x192445){return db['FreshdeskField'][_0x5e5b('0x4c')](_0x2982e7[_0x5e5b('0x4d')],{})['then'](respondWithResult(_0x192445,0xc9))[_0x5e5b('0x4a')](handleError(_0x192445,null));};exports['update']=function(_0x41e4b3,_0x36d8fa){if(_0x41e4b3[_0x5e5b('0x4d')]['id']){delete _0x41e4b3[_0x5e5b('0x4d')]['id'];}return db['FreshdeskField'][_0x5e5b('0x4e')]({'where':{'id':_0x41e4b3[_0x5e5b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x36d8fa,null))[_0x5e5b('0x27')](saveUpdates(_0x41e4b3[_0x5e5b('0x4d')],null))[_0x5e5b('0x27')](respondWithResult(_0x36d8fa,null))[_0x5e5b('0x4a')](handleError(_0x36d8fa,null));};exports[_0x5e5b('0x28')]=function(_0x5ae8d0,_0x50fc9c){return db[_0x5e5b('0x45')][_0x5e5b('0x4e')]({'where':{'id':_0x5ae8d0['params']['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x50fc9c,null))[_0x5e5b('0x27')](removeEntity(_0x50fc9c,null))[_0x5e5b('0x4a')](handleError(_0x50fc9c,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 67e8b0f..ccd94ef 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 _0x54e5=['FieldId','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','idField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54e5,0x145));var _0x554e=function(_0x4ae32d,_0x256489){_0x4ae32d=_0x4ae32d-0x0;var _0x550537=_0x54e5[_0x4ae32d];return _0x550537;};'use strict';var _=require(_0x554e('0x0'));var util=require(_0x554e('0x1'));var logger=require(_0x554e('0x2'))('api');var moment=require(_0x554e('0x3'));var BPromise=require(_0x554e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x554e('0x5'));var rimraf=require('rimraf');var config=require(_0x554e('0x6'));var attributes=require(_0x554e('0x7'));module['exports']=function(_0x4fe7f0,_0x346efd){return _0x4fe7f0[_0x554e('0x8')](_0x554e('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x554e('0xa'),_0x554e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2113=['lodash','util','api','moment','path','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','FieldId'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2113,0x140));var _0x3211=function(_0xacc8a9,_0x41a361){_0xacc8a9=_0xacc8a9-0x0;var _0x2c15e3=_0x2113[_0xacc8a9];return _0x2c15e3;};'use strict';var _=require(_0x3211('0x0'));var util=require(_0x3211('0x1'));var logger=require('../../config/logger')(_0x3211('0x2'));var moment=require(_0x3211('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3211('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3211('0x5'));module['exports']=function(_0x3a3f10,_0x54837c){return _0x3a3f10[_0x3211('0x6')](_0x3211('0x7'),attributes,{'tableName':_0x3211('0x8'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x3211('0x9')],'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 1cb06bd..caafe8c 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 _0x4f5a=['http','request','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x28e919,_0x145939){var _0x692b7e=function(_0x1514ae){while(--_0x1514ae){_0x28e919['push'](_0x28e919['shift']());}};_0x692b7e(++_0x145939);}(_0x4f5a,0x1d9));var _0xa4f5=function(_0x38dc47,_0x60eb3e){_0x38dc47=_0x38dc47-0x0;var _0xa3a3ff=_0x4f5a[_0x38dc47];return _0xa3a3ff;};'use strict';var _=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var moment=require(_0xa4f5('0x2'));var BPromise=require(_0xa4f5('0x3'));var rs=require(_0xa4f5('0x4'));var fs=require('fs');var Redis=require(_0xa4f5('0x5'));var db=require(_0xa4f5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4f5('0x7'))(_0xa4f5('0x8'));var config=require(_0xa4f5('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa4f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47c266,_0x44418e,_0x41a775){return new BPromise(function(_0x1ae133,_0x158e09){return client[_0xa4f5('0xb')](_0x47c266,_0x41a775)[_0xa4f5('0xc')](function(_0x52c3c0){logger['info'](_0xa4f5('0xd'),_0x44418e,_0xa4f5('0xe'));logger[_0xa4f5('0xf')](_0xa4f5('0x10'),_0x44418e,_0xa4f5('0xe'),JSON['stringify'](_0x52c3c0));if(_0x52c3c0[_0xa4f5('0x11')]){if(_0x52c3c0[_0xa4f5('0x11')][_0xa4f5('0x12')]===0x1f4){logger['error'](_0xa4f5('0xd'),_0x44418e,_0x52c3c0['error'][_0xa4f5('0x13')]);return _0x158e09(_0x52c3c0[_0xa4f5('0x11')]['message']);}logger[_0xa4f5('0x11')](_0xa4f5('0xd'),_0x44418e,_0x52c3c0[_0xa4f5('0x11')][_0xa4f5('0x13')]);return _0x1ae133(_0x52c3c0[_0xa4f5('0x11')]['message']);}else{logger[_0xa4f5('0x14')](_0xa4f5('0xd'),_0x44418e,_0xa4f5('0xe'));_0x1ae133(_0x52c3c0[_0xa4f5('0x15')][_0xa4f5('0x13')]);}})[_0xa4f5('0x16')](function(_0x20605b){logger[_0xa4f5('0x11')](_0xa4f5('0xd'),_0x44418e,_0x20605b);_0x158e09(_0x20605b);});});} \ No newline at end of file +var _0x3915=['client','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x4f8acf,_0x4c723d){var _0x26b570=function(_0x486852){while(--_0x486852){_0x4f8acf['push'](_0x4f8acf['shift']());}};_0x26b570(++_0x4c723d);}(_0x3915,0x97));var _0x5391=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0x3915[_0x45aa72];return _0x75adaa;};'use strict';var _=require(_0x5391('0x0'));var util=require(_0x5391('0x1'));var moment=require(_0x5391('0x2'));var BPromise=require(_0x5391('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5391('0x4'));var db=require(_0x5391('0x5'))['db'];var utils=require(_0x5391('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5391('0x7'));var jayson=require(_0x5391('0x8'));var client=jayson[_0x5391('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23c502,_0x19b0bc,_0x53a114){return new BPromise(function(_0x194fcf,_0x76b879){return client['request'](_0x23c502,_0x53a114)[_0x5391('0xa')](function(_0x425b99){logger['info'](_0x5391('0xb'),_0x19b0bc,_0x5391('0xc'));logger[_0x5391('0xd')](_0x5391('0xe'),_0x19b0bc,'request\x20sent',JSON[_0x5391('0xf')](_0x425b99));if(_0x425b99[_0x5391('0x10')]){if(_0x425b99[_0x5391('0x10')]['code']===0x1f4){logger['error'](_0x5391('0xb'),_0x19b0bc,_0x425b99[_0x5391('0x10')][_0x5391('0x11')]);return _0x76b879(_0x425b99[_0x5391('0x10')][_0x5391('0x11')]);}logger[_0x5391('0x10')](_0x5391('0xb'),_0x19b0bc,_0x425b99[_0x5391('0x10')]['message']);return _0x194fcf(_0x425b99[_0x5391('0x10')][_0x5391('0x11')]);}else{logger[_0x5391('0x12')](_0x5391('0xb'),_0x19b0bc,_0x5391('0xc'));_0x194fcf(_0x425b99[_0x5391('0x13')][_0x5391('0x11')]);}})['catch'](function(_0x5ed7b6){logger[_0x5391('0x10')](_0x5391('0xb'),_0x19b0bc,_0x5ed7b6);_0x76b879(_0x5ed7b6);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index d55344f..6c667b5 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 _0xd404=['/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show'];(function(_0x467b6b,_0x2dd887){var _0x3ae317=function(_0x250c33){while(--_0x250c33){_0x467b6b['push'](_0x467b6b['shift']());}};_0x3ae317(++_0x2dd887);}(_0xd404,0x15b));var _0x4d40=function(_0x15027e,_0x44d145){_0x15027e=_0x15027e-0x0;var _0x2d6d11=_0xd404[_0x15027e];return _0x2d6d11;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var fs_extra=require(_0x4d40('0x4'));var auth=require(_0x4d40('0x5'));var interaction=require(_0x4d40('0x6'));var config=require(_0x4d40('0x7'));var controller=require(_0x4d40('0x8'));router[_0x4d40('0x9')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0xb')]);router[_0x4d40('0x9')]('/:id',auth[_0x4d40('0xa')](),controller[_0x4d40('0xc')]);router['get'](_0x4d40('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x4d40('0x9')](_0x4d40('0xe'),auth[_0x4d40('0xa')](),controller[_0x4d40('0xf')]);router[_0x4d40('0x10')]('/',auth[_0x4d40('0xa')](),controller[_0x4d40('0x11')]);router[_0x4d40('0x10')](_0x4d40('0xd'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x12')]);router[_0x4d40('0x13')](_0x4d40('0x14'),auth[_0x4d40('0xa')](),controller['update']);router[_0x4d40('0x15')](_0x4d40('0x14'),auth[_0x4d40('0xa')](),controller[_0x4d40('0x16')]);module[_0x4d40('0x17')]=router; \ No newline at end of file +var _0xc900=['../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x51cdf1,_0x5ed52d){var _0x4a2cff=function(_0x245f2e){while(--_0x245f2e){_0x51cdf1['push'](_0x51cdf1['shift']());}};_0x4a2cff(++_0x5ed52d);}(_0xc900,0xb3));var _0x0c90=function(_0x552e2d,_0x2c6149){_0x552e2d=_0x552e2d-0x0;var _0x1ea426=_0xc900[_0x552e2d];return _0x1ea426;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0c90('0x0'));var timeout=require(_0x0c90('0x1'));var express=require(_0x0c90('0x2'));var router=express['Router']();var fs_extra=require(_0x0c90('0x3'));var auth=require(_0x0c90('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0c90('0x5'));var controller=require(_0x0c90('0x6'));router[_0x0c90('0x7')]('/',auth[_0x0c90('0x8')](),controller[_0x0c90('0x9')]);router[_0x0c90('0x7')]('/:id',auth[_0x0c90('0x8')](),controller[_0x0c90('0xa')]);router[_0x0c90('0x7')](_0x0c90('0xb'),auth[_0x0c90('0x8')](),controller[_0x0c90('0xc')]);router[_0x0c90('0x7')](_0x0c90('0xd'),auth[_0x0c90('0x8')](),controller[_0x0c90('0xe')]);router[_0x0c90('0xf')]('/',auth[_0x0c90('0x8')](),controller[_0x0c90('0x10')]);router['post'](_0x0c90('0xb'),auth['isAuthenticated'](),controller[_0x0c90('0x11')]);router['put'](_0x0c90('0x12'),auth[_0x0c90('0x8')](),controller[_0x0c90('0x13')]);router[_0x0c90('0x14')](_0x0c90('0x12'),auth['isAuthenticated'](),controller[_0x0c90('0x15')]);module[_0x0c90('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 2c75d5f..585be2e 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 _0x7880=['exports','STRING','username','remoteUri'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0x7880,0x1f4));var _0x0788=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x7880[_0x2e986d];return _0x351c79;};'use strict';var Sequelize=require('sequelize');module[_0x0788('0x0')]={'name':{'type':Sequelize[_0x0788('0x1')]},'description':{'type':Sequelize[_0x0788('0x1')]},'username':{'type':Sequelize[_0x0788('0x1')],'unique':_0x0788('0x2')},'apiKey':{'type':Sequelize[_0x0788('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0788('0x3')},'serverUrl':{'type':Sequelize[_0x0788('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xeb3b=['sequelize','exports','STRING'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x4b7f28,_0x27d23a){_0x4b7f28=_0x4b7f28-0x0;var _0xf5b553=_0xeb3b[_0x4b7f28];return _0xf5b553;};'use strict';var Sequelize=require(_0xbeb3('0x0'));module[_0xbeb3('0x1')]={'name':{'type':Sequelize[_0xbeb3('0x2')]},'description':{'type':Sequelize[_0xbeb3('0x2')]},'username':{'type':Sequelize[_0xbeb3('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbeb3('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xbeb3('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 c9fe0b2..b292a26 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 _0x9df5=['substring','GET','format','%s%s','/api/selector/owners','Token\x20token=','apiKey','users','test','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','keys','include','find','catch','create','body','params','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','getDescriptions','FreshsalesConfiguration','FreshsalesField','Descriptions','username','remoteUri','slice'];(function(_0x27e000,_0x50aaf0){var _0xaf3232=function(_0xe1f44e){while(--_0xe1f44e){_0x27e000['push'](_0x27e000['shift']());}};_0xaf3232(++_0x50aaf0);}(_0x9df5,0x14d));var _0x59df=function(_0x5dba5e,_0x5a3014){_0x5dba5e=_0x5dba5e-0x0;var _0x183039=_0x9df5[_0x5dba5e];return _0x183039;};'use strict';var emlformat=require(_0x59df('0x0'));var rimraf=require(_0x59df('0x1'));var zipdir=require(_0x59df('0x2'));var jsonpatch=require(_0x59df('0x3'));var rp=require(_0x59df('0x4'));var moment=require(_0x59df('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x59df('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x59df('0x7'));var ejs=require(_0x59df('0x8'));var fs=require('fs');var fs_extra=require(_0x59df('0x9'));var _=require(_0x59df('0xa'));var squel=require(_0x59df('0xb'));var crypto=require(_0x59df('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x59df('0xd'));var toCsv=require(_0x59df('0x7'));var querystring=require(_0x59df('0xe'));var Papa=require(_0x59df('0xf'));var Redis=require(_0x59df('0x10'));var authService=require(_0x59df('0x11'));var qs=require(_0x59df('0x12'));var as=require(_0x59df('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x59df('0x14'))(_0x59df('0x15'));var utils=require(_0x59df('0x16'));var config=require(_0x59df('0x17'));var licenseUtil=require(_0x59df('0x18'));var db=require(_0x59df('0x19'))['db'];var integrations=require(_0x59df('0x1a'));function respondWithStatusCode(_0x293a70,_0x28634e){_0x28634e=_0x28634e||0xcc;return function(_0x5d7fa0){if(_0x5d7fa0){return _0x293a70[_0x59df('0x1b')](_0x28634e);}return _0x293a70[_0x59df('0x1c')](_0x28634e)[_0x59df('0x1d')]();};}function respondWithResult(_0x14e615,_0x5ba911){_0x5ba911=_0x5ba911||0xc8;return function(_0x342373){if(_0x342373){return _0x14e615[_0x59df('0x1c')](_0x5ba911)[_0x59df('0x1e')](_0x342373);}};}function respondWithFilteredResult(_0x4866f2,_0x31c345){return function(_0x4608dc){if(_0x4608dc){var _0x3517c5=typeof _0x31c345[_0x59df('0x1f')]===_0x59df('0x20')&&typeof _0x31c345['limit']===_0x59df('0x20');var _0x491d5b=_0x4608dc[_0x59df('0x21')];var _0x3cfa30=_0x3517c5?0x0:_0x31c345[_0x59df('0x1f')];var _0x29f99c=_0x3517c5?_0x4608dc[_0x59df('0x21')]:_0x31c345['offset']+_0x31c345['limit'];var _0x1d6741;if(_0x29f99c>=_0x491d5b){_0x29f99c=_0x491d5b;_0x1d6741=0xc8;}else{_0x1d6741=0xce;}_0x4866f2['status'](_0x1d6741);return _0x4866f2[_0x59df('0x22')](_0x59df('0x23'),_0x3cfa30+'-'+_0x29f99c+'/'+_0x491d5b)[_0x59df('0x1e')](_0x4608dc);}return null;};}function patchUpdates(_0x1adfc2){return function(_0x5c3ede){try{jsonpatch[_0x59df('0x24')](_0x5c3ede,_0x1adfc2,!![]);}catch(_0x47e7d){return BPromise[_0x59df('0x25')](_0x47e7d);}return _0x5c3ede[_0x59df('0x26')]();};}function saveUpdates(_0x41bb26,_0x5a0d57){return function(_0x30a103){if(_0x30a103){return _0x30a103[_0x59df('0x27')](_0x41bb26)[_0x59df('0x28')](function(_0x2d099f){return _0x2d099f;});}return null;};}function removeEntity(_0x2a0baf,_0x40f713){return function(_0x4e1b05){if(_0x4e1b05){return _0x4e1b05[_0x59df('0x29')]()['then'](function(){_0x2a0baf[_0x59df('0x1c')](0xcc)[_0x59df('0x1d')]();});}};}function handleEntityNotFound(_0xeeaa7b,_0x22ec31){return function(_0x26cb70){if(!_0x26cb70){_0xeeaa7b[_0x59df('0x1b')](0x194);}return _0x26cb70;};}function handleError(_0x580acd,_0x40ca62){_0x40ca62=_0x40ca62||0x1f4;return function(_0x31e512){logger['error'](_0x31e512['stack']);if(_0x31e512[_0x59df('0x2a')]){delete _0x31e512[_0x59df('0x2a')];}_0x580acd[_0x59df('0x1c')](_0x40ca62)[_0x59df('0x2b')](_0x31e512);};}exports[_0x59df('0x2c')]=function(_0x4491a6,_0x41dcf7){var _0x28c1db={},_0x24a997={},_0x2b2944={'count':0x0,'rows':[]};var _0x58ba32=_['map'](db[_0x59df('0x2d')][_0x59df('0x2e')],function(_0x4b9fbc){return{'name':_0x4b9fbc[_0x59df('0x2f')],'type':_0x4b9fbc[_0x59df('0x30')][_0x59df('0x31')]};});_0x24a997[_0x59df('0x32')]=_[_0x59df('0x33')](_0x58ba32,_0x59df('0x2a'));_0x24a997[_0x59df('0x34')]=_['keys'](_0x4491a6[_0x59df('0x34')]);_0x24a997[_0x59df('0x35')]=_[_0x59df('0x36')](_0x24a997[_0x59df('0x32')],_0x24a997[_0x59df('0x34')]);_0x28c1db['attributes']=_['intersection'](_0x24a997[_0x59df('0x32')],qs[_0x59df('0x37')](_0x4491a6[_0x59df('0x34')][_0x59df('0x37')]));_0x28c1db['attributes']=_0x28c1db['attributes'][_0x59df('0x38')]?_0x28c1db[_0x59df('0x39')]:_0x24a997['model'];if(!_0x4491a6[_0x59df('0x34')][_0x59df('0x3a')](_0x59df('0x3b'))){_0x28c1db[_0x59df('0x3c')]=qs['limit'](_0x4491a6[_0x59df('0x34')][_0x59df('0x3c')]);_0x28c1db['offset']=qs[_0x59df('0x1f')](_0x4491a6[_0x59df('0x34')][_0x59df('0x1f')]);}_0x28c1db[_0x59df('0x3d')]=qs[_0x59df('0x3e')](_0x4491a6[_0x59df('0x34')][_0x59df('0x3e')]);_0x28c1db[_0x59df('0x3f')]=qs[_0x59df('0x35')](_[_0x59df('0x40')](_0x4491a6[_0x59df('0x34')],_0x24a997[_0x59df('0x35')]),_0x58ba32);if(_0x4491a6[_0x59df('0x34')]['filter']){_0x28c1db[_0x59df('0x3f')]=_[_0x59df('0x41')](_0x28c1db[_0x59df('0x3f')],{'$or':_['map'](_0x58ba32,function(_0x1fdf9e){if(_0x1fdf9e['type']!==_0x59df('0x42')){var _0x1990fd={};_0x1990fd[_0x1fdf9e['name']]={'$like':'%'+_0x4491a6[_0x59df('0x34')][_0x59df('0x43')]+'%'};return _0x1990fd;}})});}_0x28c1db=_[_0x59df('0x41')]({},_0x28c1db,_0x4491a6[_0x59df('0x44')]);var _0x446454={'where':_0x28c1db[_0x59df('0x3f')]};return db['FreshsalesAccount'][_0x59df('0x21')](_0x446454)['then'](function(_0x318d65){_0x2b2944[_0x59df('0x21')]=_0x318d65;if(_0x4491a6[_0x59df('0x34')][_0x59df('0x45')]){_0x28c1db['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x28c1db);})['then'](function(_0xdf413b){_0x2b2944[_0x59df('0x46')]=_0xdf413b;return _0x2b2944;})[_0x59df('0x28')](respondWithFilteredResult(_0x41dcf7,_0x28c1db))['catch'](handleError(_0x41dcf7,null));};exports['show']=function(_0x4ad481,_0x5d88ad){var _0x4df7d2={'raw':![],'where':{'id':_0x4ad481['params']['id']}},_0x588629={};_0x588629[_0x59df('0x32')]=_[_0x59df('0x47')](db[_0x59df('0x2d')][_0x59df('0x2e')]);_0x588629['query']=_['keys'](_0x4ad481['query']);_0x588629[_0x59df('0x35')]=_[_0x59df('0x36')](_0x588629['model'],_0x588629[_0x59df('0x34')]);_0x4df7d2['attributes']=_[_0x59df('0x36')](_0x588629[_0x59df('0x32')],qs[_0x59df('0x37')](_0x4ad481['query'][_0x59df('0x37')]));_0x4df7d2[_0x59df('0x39')]=_0x4df7d2[_0x59df('0x39')]['length']?_0x4df7d2['attributes']:_0x588629[_0x59df('0x32')];if(_0x4ad481[_0x59df('0x34')][_0x59df('0x45')]){_0x4df7d2[_0x59df('0x48')]=[{'all':!![]}];}_0x4df7d2=_[_0x59df('0x41')]({},_0x4df7d2,_0x4ad481[_0x59df('0x44')]);return db[_0x59df('0x2d')][_0x59df('0x49')](_0x4df7d2)['then'](handleEntityNotFound(_0x5d88ad,null))['then'](respondWithResult(_0x5d88ad,null))[_0x59df('0x4a')](handleError(_0x5d88ad,null));};exports[_0x59df('0x4b')]=function(_0x30b93a,_0xeb339f){return db[_0x59df('0x2d')][_0x59df('0x4b')](_0x30b93a[_0x59df('0x4c')],{})['then'](respondWithResult(_0xeb339f,0xc9))[_0x59df('0x4a')](handleError(_0xeb339f,null));};exports[_0x59df('0x27')]=function(_0x31733e,_0x3f5678){if(_0x31733e['body']['id']){delete _0x31733e[_0x59df('0x4c')]['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0x31733e[_0x59df('0x4d')]['id']}})[_0x59df('0x28')](handleEntityNotFound(_0x3f5678,null))[_0x59df('0x28')](saveUpdates(_0x31733e[_0x59df('0x4c')],null))['then'](respondWithResult(_0x3f5678,null))[_0x59df('0x4a')](handleError(_0x3f5678,null));};exports[_0x59df('0x29')]=function(_0x5c32b7,_0x56e2a8){return db[_0x59df('0x2d')]['find']({'where':{'id':_0x5c32b7[_0x59df('0x4d')]['id']}})[_0x59df('0x28')](handleEntityNotFound(_0x56e2a8,null))['then'](removeEntity(_0x56e2a8,null))[_0x59df('0x4a')](handleError(_0x56e2a8,null));};exports['getConfigurations']=function(_0x3b9bdb,_0x54f7a2,_0x16bd2f){var _0x2c8d43={};var _0x4e09de={};var _0x1a6c7f;var _0x1a9d76;return db[_0x59df('0x2d')]['findOne']({'where':{'id':_0x3b9bdb[_0x59df('0x4d')]['id']}})['then'](handleEntityNotFound(_0x54f7a2,null))[_0x59df('0x28')](function(_0x217433){if(_0x217433){_0x1a6c7f=_0x217433;_0x4e09de['model']=_[_0x59df('0x47')](db['FreshsalesConfiguration'][_0x59df('0x2e')]);_0x4e09de[_0x59df('0x34')]=_['keys'](_0x3b9bdb['query']);_0x4e09de[_0x59df('0x35')]=_['intersection'](_0x4e09de[_0x59df('0x32')],_0x4e09de[_0x59df('0x34')]);_0x2c8d43[_0x59df('0x39')]=_[_0x59df('0x36')](_0x4e09de[_0x59df('0x32')],qs['fields'](_0x3b9bdb[_0x59df('0x34')][_0x59df('0x37')]));_0x2c8d43[_0x59df('0x39')]=_0x2c8d43['attributes'][_0x59df('0x38')]?_0x2c8d43[_0x59df('0x39')]:_0x4e09de[_0x59df('0x32')];_0x2c8d43[_0x59df('0x3d')]=qs[_0x59df('0x3e')](_0x3b9bdb[_0x59df('0x34')][_0x59df('0x3e')]);_0x2c8d43[_0x59df('0x3f')]=qs['filters'](_['pick'](_0x3b9bdb[_0x59df('0x34')],_0x4e09de[_0x59df('0x35')]));if(_0x3b9bdb['query']['filter']){_0x2c8d43[_0x59df('0x3f')]=_[_0x59df('0x41')](_0x2c8d43[_0x59df('0x3f')],{'$or':_[_0x59df('0x33')](_0x2c8d43[_0x59df('0x39')],function(_0x7ad3e6){var _0x25e46f={};_0x25e46f[_0x7ad3e6]={'$like':'%'+_0x3b9bdb['query'][_0x59df('0x43')]+'%'};return _0x25e46f;})});}_0x2c8d43=_['merge']({},_0x2c8d43,_0x3b9bdb[_0x59df('0x44')]);return _0x1a6c7f[_0x59df('0x4e')](_0x2c8d43);}})[_0x59df('0x28')](function(_0x1844d8){if(_0x1844d8){_0x1a9d76=_0x1844d8['length'];if(!_0x3b9bdb['query'][_0x59df('0x3a')](_0x59df('0x3b'))){_0x2c8d43[_0x59df('0x3c')]=qs[_0x59df('0x3c')](_0x3b9bdb[_0x59df('0x34')]['limit']);_0x2c8d43[_0x59df('0x1f')]=qs[_0x59df('0x1f')](_0x3b9bdb[_0x59df('0x34')]['offset']);}return _0x1a6c7f[_0x59df('0x4e')](_0x2c8d43);}})[_0x59df('0x28')](function(_0x44f6a7){if(_0x44f6a7){return _0x44f6a7?{'count':_0x1a9d76,'rows':_0x44f6a7}:null;}})[_0x59df('0x28')](respondWithResult(_0x54f7a2,null))[_0x59df('0x4a')](handleError(_0x54f7a2,null));};exports[_0x59df('0x4f')]=function(_0x2b7b8c,_0x3d3660,_0x3c5be9){if(_0x2b7b8c['body']['id']){delete _0x2b7b8c[_0x59df('0x4c')]['id'];}return db[_0x59df('0x2d')][_0x59df('0x50')]({'where':{'id':_0x2b7b8c[_0x59df('0x4d')]['id']}})[_0x59df('0x28')](handleEntityNotFound(_0x3d3660,null))[_0x59df('0x28')](function(_0x126446){if(_0x126446){_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x51')]=_0x126446['id'];_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x52')]=integrations['getSubjects'](_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x53')],_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x30')]);_0x2b7b8c['body']['Descriptions']=integrations[_0x59df('0x54')](_0x2b7b8c[_0x59df('0x4c')][_0x59df('0x53')],_0x2b7b8c['body']['type']);return db[_0x59df('0x55')][_0x59df('0x4b')](_0x2b7b8c[_0x59df('0x4c')],{'include':[{'model':db[_0x59df('0x56')],'as':'Subjects'},{'model':db[_0x59df('0x56')],'as':_0x59df('0x57')}]});}return null;})[_0x59df('0x28')](respondWithResult(_0x3d3660,null))['catch'](handleError(_0x3d3660,null));};exports['getFields']=function(_0xa5c4e4,_0x17e8a2,_0x458936){var _0x58403a='';var _0x1dfd78='';return db[_0x59df('0x2d')]['findOne']({'where':{'id':_0xa5c4e4['params']['id']},'attributes':['id',_0x59df('0x58'),_0x59df('0x59'),'apiKey']})[_0x59df('0x28')](handleEntityNotFound(_0x17e8a2,null))[_0x59df('0x28')](function(_0x244e79){if(_0x244e79){_0x1dfd78=_0x244e79[_0x59df('0x58')];_0x58403a=_0x244e79[_0x59df('0x59')];var _0x30da13=_0x244e79[_0x59df('0x59')][_0x59df('0x5a')](-0x1);if(_0x30da13==='/'){_0x58403a=_0x58403a[_0x59df('0x5b')](0x0,_0x58403a['lastIndexOf'](_0x30da13));}return rp({'method':_0x59df('0x5c'),'uri':util[_0x59df('0x5d')](_0x59df('0x5e'),_0x58403a,_0x59df('0x5f')),'headers':{'Authorization':_0x59df('0x60')+_0x244e79[_0x59df('0x61')]},'json':!![]});}})[_0x59df('0x28')](function(_0x42f479){if(_0x42f479){var _0x207722=_0x42f479[_0x59df('0x62')];var _0x29b35e=![];var _0x10796=null;for(_0x10796=0x0;_0x10796<_0x207722[_0x59df('0x38')];_0x10796++){if(_0x207722[_0x10796]['email']===_0x1dfd78){_0x29b35e=!![];}}if(_0x29b35e){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x59df('0x28')](respondWithResult(_0x17e8a2,null))['catch'](function(_0x60b9a9){var _0x5e983d=_0xa5c4e4[_0x59df('0x34')][_0x59df('0x63')]?0x1f4:_0x60b9a9['statusCode']||0x1f4;logger[_0x59df('0x64')](_0x59df('0x65'),_0x59df('0x66'),_0x5e983d,JSON[_0x59df('0x67')](_0x60b9a9));delete _0x60b9a9[_0x59df('0x2a')];if(_0x5e983d===0x191){_0x5e983d=0x190;}_0x17e8a2['status'](_0x5e983d)[_0x59df('0x2b')](_0xa5c4e4[_0x59df('0x34')][_0x59df('0x63')]?{'message':_0x59df('0x68'),'statusCode':_0x60b9a9[_0x59df('0x69')]}:_0x60b9a9);});}; \ No newline at end of file +var _0xc252=['util','path','to-csv','fs-extra','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','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','apply','save','update','destroy','then','error','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','FreshsalesAccount','includeAll','include','params','options','find','catch','create','body','getConfigurations','FreshsalesConfiguration','map','addConfiguration','findOne','AccountId','getSubjects','channel','FreshsalesField','Descriptions','getFields','username','remoteUri','slice','substring','lastIndexOf','%s%s','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','zip-dir','request-promise','moment','bluebird','mustache'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xc252,0x112));var _0x2c25=function(_0xbffe69,_0x495110){_0xbffe69=_0xbffe69-0x0;var _0x4f0db9=_0xc252[_0xbffe69];return _0x4f0db9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2c25('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c25('0x1'));var moment=require(_0x2c25('0x2'));var BPromise=require(_0x2c25('0x3'));var Mustache=require(_0x2c25('0x4'));var util=require(_0x2c25('0x5'));var path=require(_0x2c25('0x6'));var sox=require('sox');var csv=require(_0x2c25('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c25('0x8'));var _=require(_0x2c25('0x9'));var squel=require(_0x2c25('0xa'));var crypto=require(_0x2c25('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2c25('0xc'));var toCsv=require(_0x2c25('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2c25('0xd'));var authService=require(_0x2c25('0xe'));var qs=require(_0x2c25('0xf'));var as=require(_0x2c25('0x10'));var hardwareService=require(_0x2c25('0x11'));var logger=require('../../config/logger')(_0x2c25('0x12'));var utils=require(_0x2c25('0x13'));var config=require(_0x2c25('0x14'));var licenseUtil=require(_0x2c25('0x15'));var db=require(_0x2c25('0x16'))['db'];var integrations=require(_0x2c25('0x17'));function respondWithStatusCode(_0x34aedb,_0xcec285){_0xcec285=_0xcec285||0xcc;return function(_0x39d72f){if(_0x39d72f){return _0x34aedb['sendStatus'](_0xcec285);}return _0x34aedb[_0x2c25('0x18')](_0xcec285)[_0x2c25('0x19')]();};}function respondWithResult(_0x4a0951,_0x58bac1){_0x58bac1=_0x58bac1||0xc8;return function(_0x32a5d7){if(_0x32a5d7){return _0x4a0951[_0x2c25('0x18')](_0x58bac1)[_0x2c25('0x1a')](_0x32a5d7);}};}function respondWithFilteredResult(_0x32b299,_0x5b3601){return function(_0x32e9eb){if(_0x32e9eb){var _0x16e930=typeof _0x5b3601[_0x2c25('0x1b')]==='undefined'&&typeof _0x5b3601[_0x2c25('0x1c')]===_0x2c25('0x1d');var _0x71e29c=_0x32e9eb[_0x2c25('0x1e')];var _0x573d50=_0x16e930?0x0:_0x5b3601[_0x2c25('0x1b')];var _0x5d807c=_0x16e930?_0x32e9eb[_0x2c25('0x1e')]:_0x5b3601[_0x2c25('0x1b')]+_0x5b3601[_0x2c25('0x1c')];var _0x2bf1a0;if(_0x5d807c>=_0x71e29c){_0x5d807c=_0x71e29c;_0x2bf1a0=0xc8;}else{_0x2bf1a0=0xce;}_0x32b299[_0x2c25('0x18')](_0x2bf1a0);return _0x32b299['set']('Content-Range',_0x573d50+'-'+_0x5d807c+'/'+_0x71e29c)[_0x2c25('0x1a')](_0x32e9eb);}return null;};}function patchUpdates(_0x3af672){return function(_0x3f1100){try{jsonpatch[_0x2c25('0x1f')](_0x3f1100,_0x3af672,!![]);}catch(_0x54a388){return BPromise['reject'](_0x54a388);}return _0x3f1100[_0x2c25('0x20')]();};}function saveUpdates(_0x178372,_0x324e1b){return function(_0x15f04e){if(_0x15f04e){return _0x15f04e[_0x2c25('0x21')](_0x178372)['then'](function(_0x257343){return _0x257343;});}return null;};}function removeEntity(_0x1afaeb,_0x45ec71){return function(_0x5e2483){if(_0x5e2483){return _0x5e2483[_0x2c25('0x22')]()[_0x2c25('0x23')](function(){_0x1afaeb[_0x2c25('0x18')](0xcc)[_0x2c25('0x19')]();});}};}function handleEntityNotFound(_0x3210e2,_0x327bd6){return function(_0x28d6f4){if(!_0x28d6f4){_0x3210e2['sendStatus'](0x194);}return _0x28d6f4;};}function handleError(_0x33b9b1,_0x756dbd){_0x756dbd=_0x756dbd||0x1f4;return function(_0x3ac3d3){logger[_0x2c25('0x24')](_0x3ac3d3['stack']);if(_0x3ac3d3[_0x2c25('0x25')]){delete _0x3ac3d3['name'];}_0x33b9b1[_0x2c25('0x18')](_0x756dbd)[_0x2c25('0x26')](_0x3ac3d3);};}exports[_0x2c25('0x27')]=function(_0x427521,_0xd11eb){var _0x3de5dc={},_0xf92b4a={},_0x365eb6={'count':0x0,'rows':[]};var _0x53f14a=_['map'](db['FreshsalesAccount'][_0x2c25('0x28')],function(_0x1d1481){return{'name':_0x1d1481[_0x2c25('0x29')],'type':_0x1d1481['type'][_0x2c25('0x2a')]};});_0xf92b4a[_0x2c25('0x2b')]=_['map'](_0x53f14a,'name');_0xf92b4a[_0x2c25('0x2c')]=_[_0x2c25('0x2d')](_0x427521[_0x2c25('0x2c')]);_0xf92b4a[_0x2c25('0x2e')]=_['intersection'](_0xf92b4a[_0x2c25('0x2b')],_0xf92b4a[_0x2c25('0x2c')]);_0x3de5dc[_0x2c25('0x2f')]=_[_0x2c25('0x30')](_0xf92b4a['model'],qs[_0x2c25('0x31')](_0x427521[_0x2c25('0x2c')][_0x2c25('0x31')]));_0x3de5dc['attributes']=_0x3de5dc[_0x2c25('0x2f')][_0x2c25('0x32')]?_0x3de5dc[_0x2c25('0x2f')]:_0xf92b4a[_0x2c25('0x2b')];if(!_0x427521['query'][_0x2c25('0x33')]('nolimit')){_0x3de5dc[_0x2c25('0x1c')]=qs[_0x2c25('0x1c')](_0x427521[_0x2c25('0x2c')][_0x2c25('0x1c')]);_0x3de5dc[_0x2c25('0x1b')]=qs[_0x2c25('0x1b')](_0x427521['query']['offset']);}_0x3de5dc[_0x2c25('0x34')]=qs[_0x2c25('0x35')](_0x427521[_0x2c25('0x2c')][_0x2c25('0x35')]);_0x3de5dc[_0x2c25('0x36')]=qs[_0x2c25('0x2e')](_[_0x2c25('0x37')](_0x427521['query'],_0xf92b4a['filters']),_0x53f14a);if(_0x427521[_0x2c25('0x2c')][_0x2c25('0x38')]){_0x3de5dc[_0x2c25('0x36')]=_[_0x2c25('0x39')](_0x3de5dc['where'],{'$or':_['map'](_0x53f14a,function(_0x22db49){if(_0x22db49[_0x2c25('0x3a')]!==_0x2c25('0x3b')){var _0x5d9f18={};_0x5d9f18[_0x22db49[_0x2c25('0x25')]]={'$like':'%'+_0x427521[_0x2c25('0x2c')][_0x2c25('0x38')]+'%'};return _0x5d9f18;}})});}_0x3de5dc=_[_0x2c25('0x39')]({},_0x3de5dc,_0x427521['options']);var _0x1c0a0f={'where':_0x3de5dc[_0x2c25('0x36')]};return db[_0x2c25('0x3c')]['count'](_0x1c0a0f)[_0x2c25('0x23')](function(_0x495d23){_0x365eb6[_0x2c25('0x1e')]=_0x495d23;if(_0x427521['query'][_0x2c25('0x3d')]){_0x3de5dc[_0x2c25('0x3e')]=[{'all':!![]}];}return db[_0x2c25('0x3c')]['findAll'](_0x3de5dc);})[_0x2c25('0x23')](function(_0x2f416a){_0x365eb6['rows']=_0x2f416a;return _0x365eb6;})['then'](respondWithFilteredResult(_0xd11eb,_0x3de5dc))['catch'](handleError(_0xd11eb,null));};exports['show']=function(_0x5de15f,_0x36f07e){var _0x49bfbf={'raw':![],'where':{'id':_0x5de15f[_0x2c25('0x3f')]['id']}},_0x1aeadb={};_0x1aeadb[_0x2c25('0x2b')]=_['keys'](db['FreshsalesAccount']['rawAttributes']);_0x1aeadb[_0x2c25('0x2c')]=_[_0x2c25('0x2d')](_0x5de15f[_0x2c25('0x2c')]);_0x1aeadb[_0x2c25('0x2e')]=_[_0x2c25('0x30')](_0x1aeadb[_0x2c25('0x2b')],_0x1aeadb[_0x2c25('0x2c')]);_0x49bfbf[_0x2c25('0x2f')]=_[_0x2c25('0x30')](_0x1aeadb['model'],qs[_0x2c25('0x31')](_0x5de15f[_0x2c25('0x2c')][_0x2c25('0x31')]));_0x49bfbf[_0x2c25('0x2f')]=_0x49bfbf['attributes']['length']?_0x49bfbf[_0x2c25('0x2f')]:_0x1aeadb[_0x2c25('0x2b')];if(_0x5de15f[_0x2c25('0x2c')][_0x2c25('0x3d')]){_0x49bfbf[_0x2c25('0x3e')]=[{'all':!![]}];}_0x49bfbf=_[_0x2c25('0x39')]({},_0x49bfbf,_0x5de15f[_0x2c25('0x40')]);return db[_0x2c25('0x3c')][_0x2c25('0x41')](_0x49bfbf)[_0x2c25('0x23')](handleEntityNotFound(_0x36f07e,null))['then'](respondWithResult(_0x36f07e,null))[_0x2c25('0x42')](handleError(_0x36f07e,null));};exports[_0x2c25('0x43')]=function(_0x227daf,_0x15a664){return db['FreshsalesAccount'][_0x2c25('0x43')](_0x227daf[_0x2c25('0x44')],{})[_0x2c25('0x23')](respondWithResult(_0x15a664,0xc9))['catch'](handleError(_0x15a664,null));};exports[_0x2c25('0x21')]=function(_0xa7688f,_0x46472f){if(_0xa7688f[_0x2c25('0x44')]['id']){delete _0xa7688f['body']['id'];}return db['FreshsalesAccount']['find']({'where':{'id':_0xa7688f[_0x2c25('0x3f')]['id']}})['then'](handleEntityNotFound(_0x46472f,null))['then'](saveUpdates(_0xa7688f[_0x2c25('0x44')],null))['then'](respondWithResult(_0x46472f,null))['catch'](handleError(_0x46472f,null));};exports['destroy']=function(_0x47983b,_0x49c431){return db['FreshsalesAccount'][_0x2c25('0x41')]({'where':{'id':_0x47983b[_0x2c25('0x3f')]['id']}})[_0x2c25('0x23')](handleEntityNotFound(_0x49c431,null))[_0x2c25('0x23')](removeEntity(_0x49c431,null))[_0x2c25('0x42')](handleError(_0x49c431,null));};exports[_0x2c25('0x45')]=function(_0x133f70,_0x5399b9,_0x101ea0){var _0x4ff503={};var _0x26347d={};var _0x5b5937;var _0xe176d8;return db[_0x2c25('0x3c')]['findOne']({'where':{'id':_0x133f70[_0x2c25('0x3f')]['id']}})[_0x2c25('0x23')](handleEntityNotFound(_0x5399b9,null))['then'](function(_0x25ac84){if(_0x25ac84){_0x5b5937=_0x25ac84;_0x26347d['model']=_[_0x2c25('0x2d')](db[_0x2c25('0x46')]['rawAttributes']);_0x26347d[_0x2c25('0x2c')]=_['keys'](_0x133f70[_0x2c25('0x2c')]);_0x26347d['filters']=_[_0x2c25('0x30')](_0x26347d['model'],_0x26347d['query']);_0x4ff503[_0x2c25('0x2f')]=_[_0x2c25('0x30')](_0x26347d[_0x2c25('0x2b')],qs[_0x2c25('0x31')](_0x133f70['query'][_0x2c25('0x31')]));_0x4ff503[_0x2c25('0x2f')]=_0x4ff503['attributes'][_0x2c25('0x32')]?_0x4ff503[_0x2c25('0x2f')]:_0x26347d['model'];_0x4ff503['order']=qs[_0x2c25('0x35')](_0x133f70[_0x2c25('0x2c')][_0x2c25('0x35')]);_0x4ff503[_0x2c25('0x36')]=qs['filters'](_[_0x2c25('0x37')](_0x133f70['query'],_0x26347d[_0x2c25('0x2e')]));if(_0x133f70[_0x2c25('0x2c')]['filter']){_0x4ff503['where']=_['merge'](_0x4ff503[_0x2c25('0x36')],{'$or':_[_0x2c25('0x47')](_0x4ff503[_0x2c25('0x2f')],function(_0x3a02d1){var _0x314636={};_0x314636[_0x3a02d1]={'$like':'%'+_0x133f70[_0x2c25('0x2c')][_0x2c25('0x38')]+'%'};return _0x314636;})});}_0x4ff503=_['merge']({},_0x4ff503,_0x133f70[_0x2c25('0x40')]);return _0x5b5937[_0x2c25('0x45')](_0x4ff503);}})['then'](function(_0x331af1){if(_0x331af1){_0xe176d8=_0x331af1[_0x2c25('0x32')];if(!_0x133f70[_0x2c25('0x2c')]['hasOwnProperty']('nolimit')){_0x4ff503[_0x2c25('0x1c')]=qs[_0x2c25('0x1c')](_0x133f70[_0x2c25('0x2c')]['limit']);_0x4ff503[_0x2c25('0x1b')]=qs['offset'](_0x133f70[_0x2c25('0x2c')]['offset']);}return _0x5b5937[_0x2c25('0x45')](_0x4ff503);}})[_0x2c25('0x23')](function(_0x5e2d5d){if(_0x5e2d5d){return _0x5e2d5d?{'count':_0xe176d8,'rows':_0x5e2d5d}:null;}})[_0x2c25('0x23')](respondWithResult(_0x5399b9,null))[_0x2c25('0x42')](handleError(_0x5399b9,null));};exports[_0x2c25('0x48')]=function(_0x11300c,_0x1fba8e,_0x3a6734){if(_0x11300c[_0x2c25('0x44')]['id']){delete _0x11300c[_0x2c25('0x44')]['id'];}return db[_0x2c25('0x3c')][_0x2c25('0x49')]({'where':{'id':_0x11300c[_0x2c25('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1fba8e,null))[_0x2c25('0x23')](function(_0x380042){if(_0x380042){_0x11300c[_0x2c25('0x44')][_0x2c25('0x4a')]=_0x380042['id'];_0x11300c[_0x2c25('0x44')]['Subjects']=integrations[_0x2c25('0x4b')](_0x11300c[_0x2c25('0x44')][_0x2c25('0x4c')],_0x11300c[_0x2c25('0x44')][_0x2c25('0x3a')]);_0x11300c['body']['Descriptions']=integrations['getDescriptions'](_0x11300c[_0x2c25('0x44')]['channel'],_0x11300c[_0x2c25('0x44')][_0x2c25('0x3a')]);return db[_0x2c25('0x46')][_0x2c25('0x43')](_0x11300c[_0x2c25('0x44')],{'include':[{'model':db[_0x2c25('0x4d')],'as':'Subjects'},{'model':db[_0x2c25('0x4d')],'as':_0x2c25('0x4e')}]});}return null;})['then'](respondWithResult(_0x1fba8e,null))['catch'](handleError(_0x1fba8e,null));};exports[_0x2c25('0x4f')]=function(_0x552dae,_0x470e77,_0x39c1d4){var _0x266215='';var _0x5e5735='';return db['FreshsalesAccount'][_0x2c25('0x49')]({'where':{'id':_0x552dae[_0x2c25('0x3f')]['id']},'attributes':['id',_0x2c25('0x50'),_0x2c25('0x51'),'apiKey']})[_0x2c25('0x23')](handleEntityNotFound(_0x470e77,null))['then'](function(_0x169df2){if(_0x169df2){_0x5e5735=_0x169df2['username'];_0x266215=_0x169df2[_0x2c25('0x51')];var _0x55a0fa=_0x169df2[_0x2c25('0x51')][_0x2c25('0x52')](-0x1);if(_0x55a0fa==='/'){_0x266215=_0x266215[_0x2c25('0x53')](0x0,_0x266215[_0x2c25('0x54')](_0x55a0fa));}return rp({'method':'GET','uri':util['format'](_0x2c25('0x55'),_0x266215,_0x2c25('0x56')),'headers':{'Authorization':_0x2c25('0x57')+_0x169df2['apiKey']},'json':!![]});}})[_0x2c25('0x23')](function(_0x5f4ad7){if(_0x5f4ad7){var _0x288ef4=_0x5f4ad7[_0x2c25('0x58')];var _0x4ced8f=![];var _0x420d1c=null;for(_0x420d1c=0x0;_0x420d1c<_0x288ef4[_0x2c25('0x32')];_0x420d1c++){if(_0x288ef4[_0x420d1c]['email']===_0x5e5735){_0x4ced8f=!![];}}if(_0x4ced8f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x2c25('0x59')});}}})[_0x2c25('0x23')](respondWithResult(_0x470e77,null))[_0x2c25('0x42')](function(_0x5e2b88){var _0x23e309=_0x552dae[_0x2c25('0x2c')][_0x2c25('0x5a')]?0x1f4:_0x5e2b88[_0x2c25('0x5b')]||0x1f4;logger[_0x2c25('0x24')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x23e309,JSON[_0x2c25('0x5c')](_0x5e2b88));delete _0x5e2b88[_0x2c25('0x25')];if(_0x23e309===0x191){_0x23e309=0x190;}_0x470e77[_0x2c25('0x18')](_0x23e309)[_0x2c25('0x26')](_0x552dae['query'][_0x2c25('0x5a')]?{'message':'Wrong\x20credentials','statusCode':_0x5e2b88['statusCode']}:_0x5e2b88);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 4329950..a588efb 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 _0x524e=['define','int_freshsales_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x4cc8a9,_0x294eaf){var _0x3213c4=function(_0x4c19d5){while(--_0x4c19d5){_0x4cc8a9['push'](_0x4cc8a9['shift']());}};_0x3213c4(++_0x294eaf);}(_0x524e,0x15e));var _0xe524=function(_0x1ad5ea,_0x108933){_0x1ad5ea=_0x1ad5ea-0x0;var _0x1fca0e=_0x524e[_0x1ad5ea];return _0x1fca0e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe524('0x0'))(_0xe524('0x1'));var moment=require(_0xe524('0x2'));var BPromise=require(_0xe524('0x3'));var rp=require(_0xe524('0x4'));var fs=require('fs');var path=require(_0xe524('0x5'));var rimraf=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var attributes=require(_0xe524('0x8'));var integrations=require(_0xe524('0x9'));module['exports']=function(_0xaaeaa9,_0x41e1a3){return _0xaaeaa9[_0xe524('0xa')]('FreshsalesAccount',attributes,{'tableName':_0xe524('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0x9a5a,0x194));var _0xa9a5=function(_0x48ea03,_0x3735fb){_0x48ea03=_0x48ea03-0x0;var _0x5ae05d=_0x9a5a[_0x48ea03];return _0x5ae05d;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));var integrations=require(_0xa9a5('0xa'));module['exports']=function(_0xb0ccd9,_0x37e93b){return _0xb0ccd9[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index f3ae942..0a9bc47 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 _0xacf4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowFreshsalesAccount'];(function(_0x2fec5e,_0x3befde){var _0x2ae95d=function(_0x35ad9f){while(--_0x35ad9f){_0x2fec5e['push'](_0x2fec5e['shift']());}};_0x2ae95d(++_0x3befde);}(_0xacf4,0xe7));var _0x4acf=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xacf4[_0x56825b];return _0x69ce77;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')]({'raw':_0x240c00[_0x4acf('0x16')]?_0x240c00[_0x4acf('0x16')][_0x4acf('0x17')]===undefined?!![]:![]:!![],'where':_0x240c00[_0x4acf('0x16')]?_0x240c00[_0x4acf('0x16')][_0x4acf('0x18')]||null:null,'attributes':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x19')]||null:null,'limit':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x1a')]||null:null,'include':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x240c00[_0x4acf('0x16')][_0x4acf('0x1b')],function(_0x53885f){return{'model':db[_0x53885f[_0x4acf('0x1d')]],'as':_0x53885f['as'],'attributes':_0x53885f[_0x4acf('0x19')],'include':_0x53885f['include']?_[_0x4acf('0x1c')](_0x53885f[_0x4acf('0x1b')],function(_0x52a84a){return{'model':db[_0x52a84a[_0x4acf('0x1d')]],'as':_0x52a84a['as'],'attributes':_0x52a84a[_0x4acf('0x19')],'include':_0x52a84a[_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x52a84a['include'],function(_0x50236d){return{'model':db[_0x50236d[_0x4acf('0x1d')]],'as':_0x50236d['as'],'attributes':_0x50236d[_0x4acf('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4acf('0xa')](function(_0x42c90c){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1e')](_0x4acf('0x13'),_0x240c00,JSON[_0x4acf('0x1f')](_0x42c90c));_0x2a678b(_0x42c90c);})[_0x4acf('0x12')](function(_0x57989e){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57989e[_0x4acf('0x10')],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57989e[_0x4acf('0x10')]));});});};exports[_0x4acf('0x20')]=function(_0x27384c){var _0x5d862f=this;return new Promise(function(_0x337b3c,_0x1d221b){return db[_0x4acf('0x14')]['find']({'raw':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')][_0x4acf('0x17')]===undefined?!![]:![]:!![],'where':_0x27384c[_0x4acf('0x16')]?_0x27384c['options'][_0x4acf('0x18')]||null:null,'attributes':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')]['attributes']||null:null,'include':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')][_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x27384c[_0x4acf('0x16')][_0x4acf('0x1b')],function(_0x490880){return{'model':db[_0x490880[_0x4acf('0x1d')]],'as':_0x490880['as'],'attributes':_0x490880[_0x4acf('0x19')],'include':_0x490880['include']?_[_0x4acf('0x1c')](_0x490880['include'],function(_0x4cd020){return{'model':db[_0x4cd020['model']],'as':_0x4cd020['as'],'attributes':_0x4cd020['attributes'],'include':_0x4cd020['include']?_['map'](_0x4cd020['include'],function(_0x3364dd){return{'model':db[_0x3364dd[_0x4acf('0x1d')]],'as':_0x3364dd['as'],'attributes':_0x3364dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x4acf('0xa')](function(_0xbd0f92){logger[_0x4acf('0xb')](_0x4acf('0x20'),_0x27384c);logger[_0x4acf('0x1e')](_0x4acf('0x20'),_0x27384c,JSON[_0x4acf('0x1f')](_0xbd0f92));_0x337b3c(_0xbd0f92);})[_0x4acf('0x12')](function(_0x24465b){logger[_0x4acf('0xf')]('ShowFreshsalesAccount',_0x24465b['message'],_0x27384c);_0x1d221b(_0x5d862f[_0x4acf('0xf')](0x1f4,_0x24465b[_0x4acf('0x10')]));});});}; \ No newline at end of file +var _0xd046=['ioredis','../../config/logger','../../config/environment','http','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','find','ShowFreshsalesAccount','util','moment','bluebird'];(function(_0x128112,_0x68c508){var _0x886a9d=function(_0x57d590){while(--_0x57d590){_0x128112['push'](_0x128112['shift']());}};_0x886a9d(++_0x68c508);}(_0xd046,0x129));var _0x6d04=function(_0x3ff410,_0x4c00c5){_0x3ff410=_0x3ff410-0x0;var _0x1101a6=_0xd046[_0x3ff410];return _0x1101a6;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var moment=require(_0x6d04('0x1'));var BPromise=require(_0x6d04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d04('0x4'))('rpc');var config=require(_0x6d04('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1968c4,_0x4f83bc,_0x569c7b){return new BPromise(function(_0x2e2c01,_0x42aa22){return client['request'](_0x1968c4,_0x569c7b)['then'](function(_0x27a3d6){logger['info'](_0x6d04('0x7'),_0x4f83bc,'request\x20sent');logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x4f83bc,_0x6d04('0x8'),JSON[_0x6d04('0x9')](_0x27a3d6));if(_0x27a3d6[_0x6d04('0xa')]){if(_0x27a3d6[_0x6d04('0xa')]['code']===0x1f4){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x42aa22(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x2e2c01(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}else{logger[_0x6d04('0xc')](_0x6d04('0x7'),_0x4f83bc,_0x6d04('0x8'));_0x2e2c01(_0x27a3d6[_0x6d04('0xd')][_0x6d04('0xb')]);}})[_0x6d04('0xe')](function(_0xed5538){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0xed5538);_0x42aa22(_0xed5538);});});}exports[_0x6d04('0xf')]=function(_0x2bc798){var _0x3ad325=this;return new Promise(function(_0x4e93b5,_0x3657a1){return db[_0x6d04('0x10')][_0x6d04('0x11')]({'raw':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![],'where':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x14')]||null:null,'attributes':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x15')]||null:null,'limit':_0x2bc798[_0x6d04('0x12')]?_0x2bc798['options'][_0x6d04('0x16')]||null:null,'include':_0x2bc798[_0x6d04('0x12')]?_0x2bc798['options']['include']?_[_0x6d04('0x17')](_0x2bc798[_0x6d04('0x12')][_0x6d04('0x18')],function(_0xe8f198){return{'model':db[_0xe8f198[_0x6d04('0x19')]],'as':_0xe8f198['as'],'attributes':_0xe8f198[_0x6d04('0x15')],'include':_0xe8f198[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0xe8f198[_0x6d04('0x18')],function(_0x38e90f){return{'model':db[_0x38e90f[_0x6d04('0x19')]],'as':_0x38e90f['as'],'attributes':_0x38e90f[_0x6d04('0x15')],'include':_0x38e90f[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x38e90f['include'],function(_0x1dc29b){return{'model':db[_0x1dc29b[_0x6d04('0x19')]],'as':_0x1dc29b['as'],'attributes':_0x1dc29b[_0x6d04('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6d04('0x1a')](function(_0x4256a3){logger[_0x6d04('0xc')]('GetFreshsalesAccount',_0x2bc798);logger[_0x6d04('0x1b')](_0x6d04('0xf'),_0x2bc798,JSON[_0x6d04('0x9')](_0x4256a3));_0x4e93b5(_0x4256a3);})[_0x6d04('0xe')](function(_0x2ed2bb){logger['error']('GetFreshsalesAccount',_0x2ed2bb['message'],_0x2bc798);_0x3657a1(_0x3ad325['error'](0x1f4,_0x2ed2bb[_0x6d04('0xb')]));});});};exports['ShowFreshsalesAccount']=function(_0x43eb48){var _0x4ed123=this;return new Promise(function(_0x26be38,_0xee1291){return db[_0x6d04('0x10')][_0x6d04('0x1c')]({'raw':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![],'where':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x14')]||null:null,'attributes':_0x43eb48['options']?_0x43eb48['options'][_0x6d04('0x15')]||null:null,'include':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x18')]?_['map'](_0x43eb48[_0x6d04('0x12')][_0x6d04('0x18')],function(_0x40758d){return{'model':db[_0x40758d[_0x6d04('0x19')]],'as':_0x40758d['as'],'attributes':_0x40758d['attributes'],'include':_0x40758d[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x40758d[_0x6d04('0x18')],function(_0x184da2){return{'model':db[_0x184da2[_0x6d04('0x19')]],'as':_0x184da2['as'],'attributes':_0x184da2[_0x6d04('0x15')],'include':_0x184da2[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x184da2[_0x6d04('0x18')],function(_0x67e455){return{'model':db[_0x67e455[_0x6d04('0x19')]],'as':_0x67e455['as'],'attributes':_0x67e455[_0x6d04('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6d04('0x1a')](function(_0x2c2203){logger[_0x6d04('0xc')]('ShowFreshsalesAccount',_0x43eb48);logger[_0x6d04('0x1b')]('ShowFreshsalesAccount',_0x43eb48,JSON[_0x6d04('0x9')](_0x2c2203));_0x26be38(_0x2c2203);})[_0x6d04('0xe')](function(_0x4c1908){logger[_0x6d04('0xa')](_0x6d04('0x1d'),_0x4c1908[_0x6d04('0xb')],_0x43eb48);_0xee1291(_0x4ed123[_0x6d04('0xa')](0x1f4,_0x4c1908[_0x6d04('0xb')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index f5e8764..5612c2d 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 _0x8a02=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x8a02,0xc9));var _0x28a0=function(_0x48299b,_0x25bd30){_0x48299b=_0x48299b-0x0;var _0x2f531e=_0x8a02[_0x48299b];return _0x2f531e;};'use strict';var multer=require(_0x28a0('0x0'));var util=require(_0x28a0('0x1'));var path=require(_0x28a0('0x2'));var timeout=require(_0x28a0('0x3'));var express=require(_0x28a0('0x4'));var router=express['Router']();var fs_extra=require(_0x28a0('0x5'));var auth=require(_0x28a0('0x6'));var interaction=require(_0x28a0('0x7'));var config=require(_0x28a0('0x8'));var controller=require(_0x28a0('0x9'));router[_0x28a0('0xa')]('/',auth[_0x28a0('0xb')](),controller[_0x28a0('0xc')]);router[_0x28a0('0xa')](_0x28a0('0xd'),auth[_0x28a0('0xb')](),controller[_0x28a0('0xe')]);router[_0x28a0('0xa')](_0x28a0('0xf'),auth[_0x28a0('0xb')](),controller[_0x28a0('0x10')]);router[_0x28a0('0xa')](_0x28a0('0x11'),auth[_0x28a0('0xb')](),controller[_0x28a0('0x12')]);router[_0x28a0('0xa')](_0x28a0('0x13'),auth['isAuthenticated'](),controller[_0x28a0('0x14')]);router[_0x28a0('0x15')]('/',auth[_0x28a0('0xb')](),controller[_0x28a0('0x16')]);router[_0x28a0('0x17')](_0x28a0('0xd'),auth[_0x28a0('0xb')](),controller['update']);router[_0x28a0('0x18')](_0x28a0('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x28a0('0x19')]=router; \ No newline at end of file +var _0x5cbc=['create','/:id','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post'];(function(_0x10a39e,_0x33a33e){var _0x12ccab=function(_0x421f7d){while(--_0x421f7d){_0x10a39e['push'](_0x10a39e['shift']());}};_0x12ccab(++_0x33a33e);}(_0x5cbc,0x1a2));var _0xc5cb=function(_0x182102,_0x1ae491){_0x182102=_0x182102-0x0;var _0x3aa4ee=_0x5cbc[_0x182102];return _0x3aa4ee;};'use strict';var multer=require('multer');var util=require(_0xc5cb('0x0'));var path=require(_0xc5cb('0x1'));var timeout=require('connect-timeout');var express=require(_0xc5cb('0x2'));var router=express[_0xc5cb('0x3')]();var fs_extra=require(_0xc5cb('0x4'));var auth=require(_0xc5cb('0x5'));var interaction=require(_0xc5cb('0x6'));var config=require(_0xc5cb('0x7'));var controller=require(_0xc5cb('0x8'));router[_0xc5cb('0x9')]('/',auth['isAuthenticated'](),controller[_0xc5cb('0xa')]);router[_0xc5cb('0x9')]('/:id',auth[_0xc5cb('0xb')](),controller[_0xc5cb('0xc')]);router[_0xc5cb('0x9')](_0xc5cb('0xd'),auth[_0xc5cb('0xb')](),controller[_0xc5cb('0xe')]);router['get'](_0xc5cb('0xf'),auth['isAuthenticated'](),controller[_0xc5cb('0x10')]);router[_0xc5cb('0x9')](_0xc5cb('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0xc5cb('0x12')]('/',auth[_0xc5cb('0xb')](),controller[_0xc5cb('0x13')]);router['put'](_0xc5cb('0x14'),auth['isAuthenticated'](),controller[_0xc5cb('0x15')]);router['delete'](_0xc5cb('0x14'),auth['isAuthenticated'](),controller['destroy']);module[_0xc5cb('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index d402aa6..f250ed1 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 _0x3cc9=['STRING','sequelize','exports'];(function(_0x4f3a6a,_0x3fc1c2){var _0x1d2458=function(_0x3db9ad){while(--_0x3db9ad){_0x4f3a6a['push'](_0x4f3a6a['shift']());}};_0x1d2458(++_0x3fc1c2);}(_0x3cc9,0x12d));var _0x93cc=function(_0x43d8b5,_0x3fad20){_0x43d8b5=_0x43d8b5-0x0;var _0x39cc30=_0x3cc9[_0x43d8b5];return _0x39cc30;};'use strict';var Sequelize=require(_0x93cc('0x0'));module[_0x93cc('0x1')]={'name':{'type':Sequelize[_0x93cc('0x2')]},'description':{'type':Sequelize[_0x93cc('0x2')]}}; \ No newline at end of file +var _0xde97=['sequelize','exports','STRING'];(function(_0x2882d0,_0x200dcc){var _0x40e067=function(_0x5191b2){while(--_0x5191b2){_0x2882d0['push'](_0x2882d0['shift']());}};_0x40e067(++_0x200dcc);}(_0xde97,0x1d1));var _0x7de9=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0xde97[_0x685346];return _0x52e15b;};'use strict';var Sequelize=require(_0x7de9('0x0'));module[_0x7de9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7de9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index a7b97b9..0d083a5 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 _0x0892=['merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','getSubjects','findOne','FreshsalesField','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../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','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter'];(function(_0x504f15,_0x23a1ca){var _0x2a92c1=function(_0x298472){while(--_0x298472){_0x504f15['push'](_0x504f15['shift']());}};_0x2a92c1(++_0x23a1ca);}(_0x0892,0x65));var _0x2089=function(_0x34699c,_0x20d48c){_0x34699c=_0x34699c-0x0;var _0x394bb7=_0x0892[_0x34699c];return _0x394bb7;};'use strict';var emlformat=require(_0x2089('0x0'));var rimraf=require(_0x2089('0x1'));var zipdir=require(_0x2089('0x2'));var jsonpatch=require(_0x2089('0x3'));var rp=require('request-promise');var moment=require(_0x2089('0x4'));var BPromise=require(_0x2089('0x5'));var Mustache=require(_0x2089('0x6'));var util=require(_0x2089('0x7'));var path=require(_0x2089('0x8'));var sox=require(_0x2089('0x9'));var csv=require('to-csv');var ejs=require(_0x2089('0xa'));var fs=require('fs');var fs_extra=require(_0x2089('0xb'));var _=require(_0x2089('0xc'));var squel=require(_0x2089('0xd'));var crypto=require(_0x2089('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2089('0xf'));var toCsv=require(_0x2089('0x10'));var querystring=require('querystring');var Papa=require(_0x2089('0x11'));var Redis=require('ioredis');var authService=require(_0x2089('0x12'));var qs=require(_0x2089('0x13'));var as=require(_0x2089('0x14'));var hardwareService=require(_0x2089('0x15'));var logger=require(_0x2089('0x16'))(_0x2089('0x17'));var utils=require(_0x2089('0x18'));var config=require(_0x2089('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2089('0x1a'))['db'];function respondWithStatusCode(_0x1b0921,_0x34bc33){_0x34bc33=_0x34bc33||0xcc;return function(_0x2d1c58){if(_0x2d1c58){return _0x1b0921[_0x2089('0x1b')](_0x34bc33);}return _0x1b0921[_0x2089('0x1c')](_0x34bc33)[_0x2089('0x1d')]();};}function respondWithResult(_0x162fcf,_0x4d2bd4){_0x4d2bd4=_0x4d2bd4||0xc8;return function(_0x2572c3){if(_0x2572c3){return _0x162fcf[_0x2089('0x1c')](_0x4d2bd4)['json'](_0x2572c3);}};}function respondWithFilteredResult(_0x33d9cd,_0x2a6ada){return function(_0x51b144){if(_0x51b144){var _0x16a291=typeof _0x2a6ada[_0x2089('0x1e')]===_0x2089('0x1f')&&typeof _0x2a6ada[_0x2089('0x20')]===_0x2089('0x1f');var _0x65cf4b=_0x51b144[_0x2089('0x21')];var _0x23178e=_0x16a291?0x0:_0x2a6ada[_0x2089('0x1e')];var _0x25eaff=_0x16a291?_0x51b144['count']:_0x2a6ada[_0x2089('0x1e')]+_0x2a6ada[_0x2089('0x20')];var _0xf9fe89;if(_0x25eaff>=_0x65cf4b){_0x25eaff=_0x65cf4b;_0xf9fe89=0xc8;}else{_0xf9fe89=0xce;}_0x33d9cd[_0x2089('0x1c')](_0xf9fe89);return _0x33d9cd[_0x2089('0x22')](_0x2089('0x23'),_0x23178e+'-'+_0x25eaff+'/'+_0x65cf4b)[_0x2089('0x24')](_0x51b144);}return null;};}function patchUpdates(_0x46cd14){return function(_0x321fb2){try{jsonpatch['apply'](_0x321fb2,_0x46cd14,!![]);}catch(_0x19b653){return BPromise[_0x2089('0x25')](_0x19b653);}return _0x321fb2['save']();};}function saveUpdates(_0x44d61a,_0x176087){return function(_0x10b919){if(_0x10b919){return _0x10b919[_0x2089('0x26')](_0x44d61a)[_0x2089('0x27')](function(_0x4b19de){return _0x4b19de;});}return null;};}function removeEntity(_0x4398a6,_0x3f436b){return function(_0x2fa209){if(_0x2fa209){return _0x2fa209[_0x2089('0x28')]()['then'](function(){_0x4398a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5be21d,_0x55186f){return function(_0xc5a188){if(!_0xc5a188){_0x5be21d[_0x2089('0x1b')](0x194);}return _0xc5a188;};}function handleError(_0x309b70,_0x19067e){_0x19067e=_0x19067e||0x1f4;return function(_0x3249d5){logger[_0x2089('0x29')](_0x3249d5[_0x2089('0x2a')]);if(_0x3249d5[_0x2089('0x2b')]){delete _0x3249d5[_0x2089('0x2b')];}_0x309b70['status'](_0x19067e)[_0x2089('0x2c')](_0x3249d5);};}exports[_0x2089('0x2d')]=function(_0x530a82,_0x27f643){var _0x1d64c5={},_0x3e2c1a={},_0x4aad0a={'count':0x0,'rows':[]};var _0xb503eb=_[_0x2089('0x2e')](db[_0x2089('0x2f')][_0x2089('0x30')],function(_0xb4549c){return{'name':_0xb4549c[_0x2089('0x31')],'type':_0xb4549c['type'][_0x2089('0x32')]};});_0x3e2c1a[_0x2089('0x33')]=_[_0x2089('0x2e')](_0xb503eb,_0x2089('0x2b'));_0x3e2c1a[_0x2089('0x34')]=_[_0x2089('0x35')](_0x530a82[_0x2089('0x34')]);_0x3e2c1a['filters']=_[_0x2089('0x36')](_0x3e2c1a[_0x2089('0x33')],_0x3e2c1a[_0x2089('0x34')]);_0x1d64c5[_0x2089('0x37')]=_['intersection'](_0x3e2c1a['model'],qs[_0x2089('0x38')](_0x530a82['query'][_0x2089('0x38')]));_0x1d64c5[_0x2089('0x37')]=_0x1d64c5['attributes'][_0x2089('0x39')]?_0x1d64c5[_0x2089('0x37')]:_0x3e2c1a['model'];if(!_0x530a82['query']['hasOwnProperty'](_0x2089('0x3a'))){_0x1d64c5[_0x2089('0x20')]=qs[_0x2089('0x20')](_0x530a82['query'][_0x2089('0x20')]);_0x1d64c5[_0x2089('0x1e')]=qs['offset'](_0x530a82[_0x2089('0x34')][_0x2089('0x1e')]);}_0x1d64c5[_0x2089('0x3b')]=qs[_0x2089('0x3c')](_0x530a82[_0x2089('0x34')][_0x2089('0x3c')]);_0x1d64c5[_0x2089('0x3d')]=qs[_0x2089('0x3e')](_[_0x2089('0x3f')](_0x530a82[_0x2089('0x34')],_0x3e2c1a[_0x2089('0x3e')]),_0xb503eb);if(_0x530a82['query'][_0x2089('0x40')]){_0x1d64c5['where']=_[_0x2089('0x41')](_0x1d64c5['where'],{'$or':_[_0x2089('0x2e')](_0xb503eb,function(_0x730240){if(_0x730240['type']!=='VIRTUAL'){var _0x4a4fb1={};_0x4a4fb1[_0x730240[_0x2089('0x2b')]]={'$like':'%'+_0x530a82[_0x2089('0x34')][_0x2089('0x40')]+'%'};return _0x4a4fb1;}})});}_0x1d64c5=_[_0x2089('0x41')]({},_0x1d64c5,_0x530a82[_0x2089('0x42')]);var _0x312ac3={'where':_0x1d64c5['where']};return db[_0x2089('0x2f')]['count'](_0x312ac3)['then'](function(_0x696ad6){_0x4aad0a['count']=_0x696ad6;if(_0x530a82['query'][_0x2089('0x43')]){_0x1d64c5[_0x2089('0x44')]=[{'all':!![]}];}return db[_0x2089('0x2f')][_0x2089('0x45')](_0x1d64c5);})[_0x2089('0x27')](function(_0xd971a2){_0x4aad0a[_0x2089('0x46')]=_0xd971a2;return _0x4aad0a;})[_0x2089('0x27')](respondWithFilteredResult(_0x27f643,_0x1d64c5))[_0x2089('0x47')](handleError(_0x27f643,null));};exports[_0x2089('0x48')]=function(_0x113fe7,_0x5bae11){var _0x14b745={'raw':![],'where':{'id':_0x113fe7['params']['id']}},_0x32cafa={};_0x32cafa['model']=_[_0x2089('0x35')](db['FreshsalesConfiguration'][_0x2089('0x30')]);_0x32cafa[_0x2089('0x34')]=_[_0x2089('0x35')](_0x113fe7[_0x2089('0x34')]);_0x32cafa[_0x2089('0x3e')]=_[_0x2089('0x36')](_0x32cafa['model'],_0x32cafa[_0x2089('0x34')]);_0x14b745[_0x2089('0x37')]=_[_0x2089('0x36')](_0x32cafa[_0x2089('0x33')],qs[_0x2089('0x38')](_0x113fe7[_0x2089('0x34')][_0x2089('0x38')]));_0x14b745[_0x2089('0x37')]=_0x14b745['attributes']['length']?_0x14b745['attributes']:_0x32cafa[_0x2089('0x33')];if(_0x113fe7['query'][_0x2089('0x43')]){_0x14b745['include']=[{'all':!![]}];}_0x14b745=_[_0x2089('0x41')]({},_0x14b745,_0x113fe7['options']);return db[_0x2089('0x2f')]['find'](_0x14b745)[_0x2089('0x27')](handleEntityNotFound(_0x5bae11,null))[_0x2089('0x27')](respondWithResult(_0x5bae11,null))[_0x2089('0x47')](handleError(_0x5bae11,null));};exports['create']=function(_0x358187,_0x5b69){return db['FreshsalesConfiguration'][_0x2089('0x49')](_0x358187[_0x2089('0x4a')],{})[_0x2089('0x27')](respondWithResult(_0x5b69,0xc9))['catch'](handleError(_0x5b69,null));};exports[_0x2089('0x26')]=function(_0x29bf76,_0x58ab7d){if(_0x29bf76[_0x2089('0x4a')]['id']){delete _0x29bf76[_0x2089('0x4a')]['id'];}return db[_0x2089('0x2f')][_0x2089('0x4b')]({'where':{'id':_0x29bf76[_0x2089('0x4c')]['id']}})[_0x2089('0x27')](handleEntityNotFound(_0x58ab7d,null))[_0x2089('0x27')](saveUpdates(_0x29bf76[_0x2089('0x4a')],null))['then'](respondWithResult(_0x58ab7d,null))['catch'](handleError(_0x58ab7d,null));};exports['destroy']=function(_0x56039e,_0x170b56){return db[_0x2089('0x2f')]['find']({'where':{'id':_0x56039e[_0x2089('0x4c')]['id']}})[_0x2089('0x27')](handleEntityNotFound(_0x170b56,null))[_0x2089('0x27')](removeEntity(_0x170b56,null))[_0x2089('0x47')](handleError(_0x170b56,null));};exports[_0x2089('0x4d')]=function(_0x53ac73,_0x75fc89,_0xbd037e){var _0x54b5eb={};var _0xc92dad={};var _0x125608;var _0xc102d9;return db[_0x2089('0x2f')][_0x2089('0x4e')]({'where':{'id':_0x53ac73['params']['id']}})[_0x2089('0x27')](handleEntityNotFound(_0x75fc89,null))[_0x2089('0x27')](function(_0x1b2639){if(_0x1b2639){_0x125608=_0x1b2639;_0xc92dad[_0x2089('0x33')]=_[_0x2089('0x35')](db[_0x2089('0x4f')][_0x2089('0x30')]);_0xc92dad['query']=_[_0x2089('0x35')](_0x53ac73['query']);_0xc92dad['filters']=_[_0x2089('0x36')](_0xc92dad[_0x2089('0x33')],_0xc92dad[_0x2089('0x34')]);_0x54b5eb[_0x2089('0x37')]=_[_0x2089('0x36')](_0xc92dad['model'],qs['fields'](_0x53ac73['query'][_0x2089('0x38')]));_0x54b5eb[_0x2089('0x37')]=_0x54b5eb[_0x2089('0x37')][_0x2089('0x39')]?_0x54b5eb['attributes']:_0xc92dad[_0x2089('0x33')];_0x54b5eb[_0x2089('0x3b')]=qs[_0x2089('0x3c')](_0x53ac73['query'][_0x2089('0x3c')]);_0x54b5eb[_0x2089('0x3d')]=qs[_0x2089('0x3e')](_['pick'](_0x53ac73['query'],_0xc92dad[_0x2089('0x3e')]));if(_0x53ac73['query'][_0x2089('0x40')]){_0x54b5eb[_0x2089('0x3d')]=_[_0x2089('0x41')](_0x54b5eb[_0x2089('0x3d')],{'$or':_[_0x2089('0x2e')](_0x54b5eb[_0x2089('0x37')],function(_0x2e3f14){var _0xc1e08e={};_0xc1e08e[_0x2e3f14]={'$like':'%'+_0x53ac73['query']['filter']+'%'};return _0xc1e08e;})});}_0x54b5eb=_[_0x2089('0x41')]({},_0x54b5eb,_0x53ac73[_0x2089('0x42')]);return _0x125608[_0x2089('0x4d')](_0x54b5eb);}})['then'](function(_0x287a41){if(_0x287a41){_0xc102d9=_0x287a41[_0x2089('0x39')];if(!_0x53ac73[_0x2089('0x34')][_0x2089('0x50')](_0x2089('0x3a'))){_0x54b5eb[_0x2089('0x20')]=qs['limit'](_0x53ac73['query'][_0x2089('0x20')]);_0x54b5eb[_0x2089('0x1e')]=qs[_0x2089('0x1e')](_0x53ac73[_0x2089('0x34')]['offset']);}return _0x125608[_0x2089('0x4d')](_0x54b5eb);}})[_0x2089('0x27')](function(_0x3cf41a){if(_0x3cf41a){return _0x3cf41a?{'count':_0xc102d9,'rows':_0x3cf41a}:null;}})[_0x2089('0x27')](respondWithResult(_0x75fc89,null))[_0x2089('0x47')](handleError(_0x75fc89,null));};exports[_0x2089('0x51')]=function(_0x3de6a0,_0x3ae4c5,_0x3427df){var _0x5bd5bc={};var _0x4fafd8={};var _0x5eede1;var _0x1806b8;return db[_0x2089('0x2f')][_0x2089('0x4e')]({'where':{'id':_0x3de6a0['params']['id']}})['then'](handleEntityNotFound(_0x3ae4c5,null))[_0x2089('0x27')](function(_0x50c219){if(_0x50c219){_0x5eede1=_0x50c219;_0x4fafd8[_0x2089('0x33')]=_[_0x2089('0x35')](db['FreshsalesField']['rawAttributes']);_0x4fafd8['query']=_['keys'](_0x3de6a0['query']);_0x4fafd8['filters']=_[_0x2089('0x36')](_0x4fafd8[_0x2089('0x33')],_0x4fafd8[_0x2089('0x34')]);_0x5bd5bc['attributes']=_['intersection'](_0x4fafd8[_0x2089('0x33')],qs[_0x2089('0x38')](_0x3de6a0['query'][_0x2089('0x38')]));_0x5bd5bc['attributes']=_0x5bd5bc[_0x2089('0x37')]['length']?_0x5bd5bc[_0x2089('0x37')]:_0x4fafd8[_0x2089('0x33')];_0x5bd5bc[_0x2089('0x3b')]=qs['sort'](_0x3de6a0[_0x2089('0x34')][_0x2089('0x3c')]);_0x5bd5bc[_0x2089('0x3d')]=qs[_0x2089('0x3e')](_[_0x2089('0x3f')](_0x3de6a0[_0x2089('0x34')],_0x4fafd8['filters']));if(_0x3de6a0[_0x2089('0x34')][_0x2089('0x40')]){_0x5bd5bc[_0x2089('0x3d')]=_[_0x2089('0x41')](_0x5bd5bc['where'],{'$or':_[_0x2089('0x2e')](_0x5bd5bc['attributes'],function(_0x4fae6b){var _0x5c026e={};_0x5c026e[_0x4fae6b]={'$like':'%'+_0x3de6a0[_0x2089('0x34')][_0x2089('0x40')]+'%'};return _0x5c026e;})});}_0x5bd5bc=_[_0x2089('0x41')]({},_0x5bd5bc,_0x3de6a0[_0x2089('0x42')]);return _0x5eede1[_0x2089('0x51')](_0x5bd5bc);}})[_0x2089('0x27')](function(_0x15af95){if(_0x15af95){_0x1806b8=_0x15af95[_0x2089('0x39')];if(!_0x3de6a0[_0x2089('0x34')]['hasOwnProperty'](_0x2089('0x3a'))){_0x5bd5bc[_0x2089('0x20')]=qs['limit'](_0x3de6a0[_0x2089('0x34')][_0x2089('0x20')]);_0x5bd5bc[_0x2089('0x1e')]=qs['offset'](_0x3de6a0['query']['offset']);}return _0x5eede1[_0x2089('0x51')](_0x5bd5bc);}})['then'](function(_0x1eb8ea){if(_0x1eb8ea){return _0x1eb8ea?{'count':_0x1806b8,'rows':_0x1eb8ea}:null;}})['then'](respondWithResult(_0x3ae4c5,null))[_0x2089('0x47')](handleError(_0x3ae4c5,null));};exports[_0x2089('0x52')]=function(_0xd23b6a,_0x15834b,_0x1c27b9){var _0x337e9a={};var _0x37805f={};var _0x3f6304;var _0x8fd78;return db[_0x2089('0x2f')][_0x2089('0x4e')]({'where':{'id':_0xd23b6a[_0x2089('0x4c')]['id']}})[_0x2089('0x27')](handleEntityNotFound(_0x15834b,null))[_0x2089('0x27')](function(_0x6ce5de){if(_0x6ce5de){_0x3f6304=_0x6ce5de;_0x37805f[_0x2089('0x33')]=_[_0x2089('0x35')](db[_0x2089('0x4f')]['rawAttributes']);_0x37805f[_0x2089('0x34')]=_[_0x2089('0x35')](_0xd23b6a[_0x2089('0x34')]);_0x37805f[_0x2089('0x3e')]=_[_0x2089('0x36')](_0x37805f[_0x2089('0x33')],_0x37805f[_0x2089('0x34')]);_0x337e9a[_0x2089('0x37')]=_[_0x2089('0x36')](_0x37805f[_0x2089('0x33')],qs[_0x2089('0x38')](_0xd23b6a['query'][_0x2089('0x38')]));_0x337e9a[_0x2089('0x37')]=_0x337e9a[_0x2089('0x37')][_0x2089('0x39')]?_0x337e9a['attributes']:_0x37805f[_0x2089('0x33')];_0x337e9a[_0x2089('0x3b')]=qs['sort'](_0xd23b6a[_0x2089('0x34')][_0x2089('0x3c')]);_0x337e9a[_0x2089('0x3d')]=qs[_0x2089('0x3e')](_['pick'](_0xd23b6a[_0x2089('0x34')],_0x37805f['filters']));if(_0xd23b6a[_0x2089('0x34')][_0x2089('0x40')]){_0x337e9a['where']=_[_0x2089('0x41')](_0x337e9a[_0x2089('0x3d')],{'$or':_[_0x2089('0x2e')](_0x337e9a[_0x2089('0x37')],function(_0x2cdb94){var _0xc3bf85={};_0xc3bf85[_0x2cdb94]={'$like':'%'+_0xd23b6a[_0x2089('0x34')][_0x2089('0x40')]+'%'};return _0xc3bf85;})});}_0x337e9a=_[_0x2089('0x41')]({},_0x337e9a,_0xd23b6a['options']);return _0x3f6304[_0x2089('0x52')](_0x337e9a);}})[_0x2089('0x27')](function(_0x232c9c){if(_0x232c9c){_0x8fd78=_0x232c9c[_0x2089('0x39')];if(!_0xd23b6a['query'][_0x2089('0x50')]('nolimit')){_0x337e9a[_0x2089('0x20')]=qs[_0x2089('0x20')](_0xd23b6a[_0x2089('0x34')]['limit']);_0x337e9a[_0x2089('0x1e')]=qs[_0x2089('0x1e')](_0xd23b6a[_0x2089('0x34')]['offset']);}return _0x3f6304[_0x2089('0x52')](_0x337e9a);}})['then'](function(_0x496cc1){if(_0x496cc1){return _0x496cc1?{'count':_0x8fd78,'rows':_0x496cc1}:null;}})[_0x2089('0x27')](respondWithResult(_0x15834b,null))[_0x2089('0x47')](handleError(_0x15834b,null));}; \ No newline at end of file +var _0xd29b=['FreshsalesField','hasOwnProperty','getDescriptions','getFields','zip-dir','request-promise','moment','util','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','apply','save','update','then','sendStatus','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','options','where','includeAll','include','rows','show','merge','find','catch','body','params','destroy','findOne'];(function(_0x548627,_0x4ec392){var _0x844a84=function(_0x2ffdd2){while(--_0x2ffdd2){_0x548627['push'](_0x548627['shift']());}};_0x844a84(++_0x4ec392);}(_0xd29b,0x167));var _0xbd29=function(_0xfc5c2b,_0x15e0ac){_0xfc5c2b=_0xfc5c2b-0x0;var _0x398816=_0xd29b[_0xfc5c2b];return _0x398816;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbd29('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd29('0x1'));var moment=require(_0xbd29('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbd29('0x3'));var path=require(_0xbd29('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd29('0x5'));var _=require(_0xbd29('0x6'));var squel=require('squel');var crypto=require(_0xbd29('0x7'));var jsforce=require(_0xbd29('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xbd29('0x9'));var querystring=require(_0xbd29('0xa'));var Papa=require('papaparse');var Redis=require(_0xbd29('0xb'));var authService=require(_0xbd29('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xbd29('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd29('0xe'))(_0xbd29('0xf'));var utils=require(_0xbd29('0x10'));var config=require(_0xbd29('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd29('0x12'))['db'];function respondWithStatusCode(_0xb51ba1,_0xce7600){_0xce7600=_0xce7600||0xcc;return function(_0x5cb378){if(_0x5cb378){return _0xb51ba1['sendStatus'](_0xce7600);}return _0xb51ba1[_0xbd29('0x13')](_0xce7600)[_0xbd29('0x14')]();};}function respondWithResult(_0x54ed65,_0x259196){_0x259196=_0x259196||0xc8;return function(_0x34f431){if(_0x34f431){return _0x54ed65[_0xbd29('0x13')](_0x259196)['json'](_0x34f431);}};}function respondWithFilteredResult(_0x2f15b4,_0x3a4c1d){return function(_0x40512b){if(_0x40512b){var _0x16bcda=typeof _0x3a4c1d[_0xbd29('0x15')]==='undefined'&&typeof _0x3a4c1d[_0xbd29('0x16')]===_0xbd29('0x17');var _0x2a2a57=_0x40512b[_0xbd29('0x18')];var _0x5d0d01=_0x16bcda?0x0:_0x3a4c1d[_0xbd29('0x15')];var _0x1dff9d=_0x16bcda?_0x40512b[_0xbd29('0x18')]:_0x3a4c1d[_0xbd29('0x15')]+_0x3a4c1d[_0xbd29('0x16')];var _0x19cad8;if(_0x1dff9d>=_0x2a2a57){_0x1dff9d=_0x2a2a57;_0x19cad8=0xc8;}else{_0x19cad8=0xce;}_0x2f15b4[_0xbd29('0x13')](_0x19cad8);return _0x2f15b4[_0xbd29('0x19')]('Content-Range',_0x5d0d01+'-'+_0x1dff9d+'/'+_0x2a2a57)['json'](_0x40512b);}return null;};}function patchUpdates(_0x487dc9){return function(_0x3bf7bb){try{jsonpatch[_0xbd29('0x1a')](_0x3bf7bb,_0x487dc9,!![]);}catch(_0x162cba){return BPromise['reject'](_0x162cba);}return _0x3bf7bb[_0xbd29('0x1b')]();};}function saveUpdates(_0x414f6e,_0x477b52){return function(_0x30216e){if(_0x30216e){return _0x30216e[_0xbd29('0x1c')](_0x414f6e)[_0xbd29('0x1d')](function(_0x593a7a){return _0x593a7a;});}return null;};}function removeEntity(_0x37d832,_0x368eaf){return function(_0x2b0604){if(_0x2b0604){return _0x2b0604['destroy']()[_0xbd29('0x1d')](function(){_0x37d832['status'](0xcc)[_0xbd29('0x14')]();});}};}function handleEntityNotFound(_0x151a83,_0xacc2b4){return function(_0x2ad429){if(!_0x2ad429){_0x151a83[_0xbd29('0x1e')](0x194);}return _0x2ad429;};}function handleError(_0x3b6487,_0x180ed0){_0x180ed0=_0x180ed0||0x1f4;return function(_0x47d6af){logger[_0xbd29('0x1f')](_0x47d6af['stack']);if(_0x47d6af[_0xbd29('0x20')]){delete _0x47d6af[_0xbd29('0x20')];}_0x3b6487[_0xbd29('0x13')](_0x180ed0)[_0xbd29('0x21')](_0x47d6af);};}exports[_0xbd29('0x22')]=function(_0x45d7f5,_0x569503){var _0x28474a={},_0x2ab14b={},_0x5de655={'count':0x0,'rows':[]};var _0x43c02f=_[_0xbd29('0x23')](db[_0xbd29('0x24')][_0xbd29('0x25')],function(_0x5af012){return{'name':_0x5af012[_0xbd29('0x26')],'type':_0x5af012[_0xbd29('0x27')][_0xbd29('0x28')]};});_0x2ab14b[_0xbd29('0x29')]=_[_0xbd29('0x23')](_0x43c02f,_0xbd29('0x20'));_0x2ab14b[_0xbd29('0x2a')]=_[_0xbd29('0x2b')](_0x45d7f5['query']);_0x2ab14b['filters']=_[_0xbd29('0x2c')](_0x2ab14b[_0xbd29('0x29')],_0x2ab14b[_0xbd29('0x2a')]);_0x28474a[_0xbd29('0x2d')]=_['intersection'](_0x2ab14b[_0xbd29('0x29')],qs[_0xbd29('0x2e')](_0x45d7f5['query'][_0xbd29('0x2e')]));_0x28474a[_0xbd29('0x2d')]=_0x28474a[_0xbd29('0x2d')][_0xbd29('0x2f')]?_0x28474a[_0xbd29('0x2d')]:_0x2ab14b['model'];if(!_0x45d7f5[_0xbd29('0x2a')]['hasOwnProperty'](_0xbd29('0x30'))){_0x28474a[_0xbd29('0x16')]=qs[_0xbd29('0x16')](_0x45d7f5[_0xbd29('0x2a')]['limit']);_0x28474a[_0xbd29('0x15')]=qs['offset'](_0x45d7f5[_0xbd29('0x2a')][_0xbd29('0x15')]);}_0x28474a[_0xbd29('0x31')]=qs[_0xbd29('0x32')](_0x45d7f5[_0xbd29('0x2a')]['sort']);_0x28474a['where']=qs[_0xbd29('0x33')](_[_0xbd29('0x34')](_0x45d7f5[_0xbd29('0x2a')],_0x2ab14b[_0xbd29('0x33')]),_0x43c02f);if(_0x45d7f5[_0xbd29('0x2a')][_0xbd29('0x35')]){_0x28474a['where']=_['merge'](_0x28474a['where'],{'$or':_[_0xbd29('0x23')](_0x43c02f,function(_0xe6f0b0){if(_0xe6f0b0[_0xbd29('0x27')]!=='VIRTUAL'){var _0x602045={};_0x602045[_0xe6f0b0[_0xbd29('0x20')]]={'$like':'%'+_0x45d7f5[_0xbd29('0x2a')][_0xbd29('0x35')]+'%'};return _0x602045;}})});}_0x28474a=_['merge']({},_0x28474a,_0x45d7f5[_0xbd29('0x36')]);var _0x4f956a={'where':_0x28474a[_0xbd29('0x37')]};return db[_0xbd29('0x24')][_0xbd29('0x18')](_0x4f956a)['then'](function(_0x2f522a){_0x5de655[_0xbd29('0x18')]=_0x2f522a;if(_0x45d7f5[_0xbd29('0x2a')][_0xbd29('0x38')]){_0x28474a[_0xbd29('0x39')]=[{'all':!![]}];}return db[_0xbd29('0x24')]['findAll'](_0x28474a);})[_0xbd29('0x1d')](function(_0x5a813d){_0x5de655[_0xbd29('0x3a')]=_0x5a813d;return _0x5de655;})[_0xbd29('0x1d')](respondWithFilteredResult(_0x569503,_0x28474a))['catch'](handleError(_0x569503,null));};exports[_0xbd29('0x3b')]=function(_0x4855e8,_0x430b73){var _0x46d416={'raw':![],'where':{'id':_0x4855e8['params']['id']}},_0x1aa444={};_0x1aa444[_0xbd29('0x29')]=_['keys'](db['FreshsalesConfiguration'][_0xbd29('0x25')]);_0x1aa444['query']=_[_0xbd29('0x2b')](_0x4855e8['query']);_0x1aa444[_0xbd29('0x33')]=_[_0xbd29('0x2c')](_0x1aa444[_0xbd29('0x29')],_0x1aa444[_0xbd29('0x2a')]);_0x46d416[_0xbd29('0x2d')]=_['intersection'](_0x1aa444[_0xbd29('0x29')],qs[_0xbd29('0x2e')](_0x4855e8[_0xbd29('0x2a')][_0xbd29('0x2e')]));_0x46d416['attributes']=_0x46d416[_0xbd29('0x2d')][_0xbd29('0x2f')]?_0x46d416[_0xbd29('0x2d')]:_0x1aa444[_0xbd29('0x29')];if(_0x4855e8[_0xbd29('0x2a')][_0xbd29('0x38')]){_0x46d416[_0xbd29('0x39')]=[{'all':!![]}];}_0x46d416=_[_0xbd29('0x3c')]({},_0x46d416,_0x4855e8[_0xbd29('0x36')]);return db[_0xbd29('0x24')][_0xbd29('0x3d')](_0x46d416)[_0xbd29('0x1d')](handleEntityNotFound(_0x430b73,null))[_0xbd29('0x1d')](respondWithResult(_0x430b73,null))[_0xbd29('0x3e')](handleError(_0x430b73,null));};exports['create']=function(_0xdddf51,_0x5d7e80){return db[_0xbd29('0x24')]['create'](_0xdddf51[_0xbd29('0x3f')],{})[_0xbd29('0x1d')](respondWithResult(_0x5d7e80,0xc9))['catch'](handleError(_0x5d7e80,null));};exports[_0xbd29('0x1c')]=function(_0x4e8ced,_0x5e5b14){if(_0x4e8ced[_0xbd29('0x3f')]['id']){delete _0x4e8ced[_0xbd29('0x3f')]['id'];}return db[_0xbd29('0x24')][_0xbd29('0x3d')]({'where':{'id':_0x4e8ced[_0xbd29('0x40')]['id']}})[_0xbd29('0x1d')](handleEntityNotFound(_0x5e5b14,null))[_0xbd29('0x1d')](saveUpdates(_0x4e8ced[_0xbd29('0x3f')],null))['then'](respondWithResult(_0x5e5b14,null))[_0xbd29('0x3e')](handleError(_0x5e5b14,null));};exports[_0xbd29('0x41')]=function(_0x1e65ef,_0xecbe4f){return db['FreshsalesConfiguration'][_0xbd29('0x3d')]({'where':{'id':_0x1e65ef[_0xbd29('0x40')]['id']}})['then'](handleEntityNotFound(_0xecbe4f,null))[_0xbd29('0x1d')](removeEntity(_0xecbe4f,null))[_0xbd29('0x3e')](handleError(_0xecbe4f,null));};exports['getSubjects']=function(_0x5b2f97,_0x355579,_0x2506ca){var _0x397d4d={};var _0x4acaa0={};var _0x394935;var _0x11092b;return db['FreshsalesConfiguration'][_0xbd29('0x42')]({'where':{'id':_0x5b2f97['params']['id']}})['then'](handleEntityNotFound(_0x355579,null))[_0xbd29('0x1d')](function(_0x5856b4){if(_0x5856b4){_0x394935=_0x5856b4;_0x4acaa0[_0xbd29('0x29')]=_['keys'](db[_0xbd29('0x43')][_0xbd29('0x25')]);_0x4acaa0['query']=_[_0xbd29('0x2b')](_0x5b2f97['query']);_0x4acaa0[_0xbd29('0x33')]=_[_0xbd29('0x2c')](_0x4acaa0['model'],_0x4acaa0['query']);_0x397d4d[_0xbd29('0x2d')]=_[_0xbd29('0x2c')](_0x4acaa0['model'],qs[_0xbd29('0x2e')](_0x5b2f97[_0xbd29('0x2a')]['fields']));_0x397d4d[_0xbd29('0x2d')]=_0x397d4d['attributes'][_0xbd29('0x2f')]?_0x397d4d['attributes']:_0x4acaa0[_0xbd29('0x29')];_0x397d4d[_0xbd29('0x31')]=qs[_0xbd29('0x32')](_0x5b2f97[_0xbd29('0x2a')][_0xbd29('0x32')]);_0x397d4d['where']=qs[_0xbd29('0x33')](_['pick'](_0x5b2f97['query'],_0x4acaa0['filters']));if(_0x5b2f97['query']['filter']){_0x397d4d[_0xbd29('0x37')]=_[_0xbd29('0x3c')](_0x397d4d[_0xbd29('0x37')],{'$or':_['map'](_0x397d4d[_0xbd29('0x2d')],function(_0x36e121){var _0x26a927={};_0x26a927[_0x36e121]={'$like':'%'+_0x5b2f97['query'][_0xbd29('0x35')]+'%'};return _0x26a927;})});}_0x397d4d=_[_0xbd29('0x3c')]({},_0x397d4d,_0x5b2f97[_0xbd29('0x36')]);return _0x394935['getSubjects'](_0x397d4d);}})[_0xbd29('0x1d')](function(_0x55821b){if(_0x55821b){_0x11092b=_0x55821b[_0xbd29('0x2f')];if(!_0x5b2f97[_0xbd29('0x2a')][_0xbd29('0x44')](_0xbd29('0x30'))){_0x397d4d[_0xbd29('0x16')]=qs[_0xbd29('0x16')](_0x5b2f97[_0xbd29('0x2a')][_0xbd29('0x16')]);_0x397d4d[_0xbd29('0x15')]=qs[_0xbd29('0x15')](_0x5b2f97[_0xbd29('0x2a')][_0xbd29('0x15')]);}return _0x394935['getSubjects'](_0x397d4d);}})[_0xbd29('0x1d')](function(_0x477a6d){if(_0x477a6d){return _0x477a6d?{'count':_0x11092b,'rows':_0x477a6d}:null;}})[_0xbd29('0x1d')](respondWithResult(_0x355579,null))['catch'](handleError(_0x355579,null));};exports['getDescriptions']=function(_0x33d4fd,_0x5c01c9,_0x429382){var _0x13c262={};var _0x48707b={};var _0x126196;var _0x568bbe;return db[_0xbd29('0x24')][_0xbd29('0x42')]({'where':{'id':_0x33d4fd[_0xbd29('0x40')]['id']}})[_0xbd29('0x1d')](handleEntityNotFound(_0x5c01c9,null))['then'](function(_0xe7bed8){if(_0xe7bed8){_0x126196=_0xe7bed8;_0x48707b['model']=_[_0xbd29('0x2b')](db[_0xbd29('0x43')][_0xbd29('0x25')]);_0x48707b[_0xbd29('0x2a')]=_[_0xbd29('0x2b')](_0x33d4fd[_0xbd29('0x2a')]);_0x48707b[_0xbd29('0x33')]=_[_0xbd29('0x2c')](_0x48707b['model'],_0x48707b['query']);_0x13c262['attributes']=_[_0xbd29('0x2c')](_0x48707b[_0xbd29('0x29')],qs['fields'](_0x33d4fd[_0xbd29('0x2a')][_0xbd29('0x2e')]));_0x13c262[_0xbd29('0x2d')]=_0x13c262[_0xbd29('0x2d')][_0xbd29('0x2f')]?_0x13c262[_0xbd29('0x2d')]:_0x48707b['model'];_0x13c262[_0xbd29('0x31')]=qs[_0xbd29('0x32')](_0x33d4fd[_0xbd29('0x2a')]['sort']);_0x13c262['where']=qs['filters'](_['pick'](_0x33d4fd[_0xbd29('0x2a')],_0x48707b[_0xbd29('0x33')]));if(_0x33d4fd[_0xbd29('0x2a')]['filter']){_0x13c262[_0xbd29('0x37')]=_[_0xbd29('0x3c')](_0x13c262[_0xbd29('0x37')],{'$or':_[_0xbd29('0x23')](_0x13c262['attributes'],function(_0x36eb06){var _0x318ac5={};_0x318ac5[_0x36eb06]={'$like':'%'+_0x33d4fd[_0xbd29('0x2a')][_0xbd29('0x35')]+'%'};return _0x318ac5;})});}_0x13c262=_[_0xbd29('0x3c')]({},_0x13c262,_0x33d4fd[_0xbd29('0x36')]);return _0x126196[_0xbd29('0x45')](_0x13c262);}})['then'](function(_0x474d56){if(_0x474d56){_0x568bbe=_0x474d56[_0xbd29('0x2f')];if(!_0x33d4fd[_0xbd29('0x2a')][_0xbd29('0x44')](_0xbd29('0x30'))){_0x13c262[_0xbd29('0x16')]=qs[_0xbd29('0x16')](_0x33d4fd[_0xbd29('0x2a')][_0xbd29('0x16')]);_0x13c262[_0xbd29('0x15')]=qs[_0xbd29('0x15')](_0x33d4fd[_0xbd29('0x2a')][_0xbd29('0x15')]);}return _0x126196[_0xbd29('0x45')](_0x13c262);}})[_0xbd29('0x1d')](function(_0x23bbfc){if(_0x23bbfc){return _0x23bbfc?{'count':_0x568bbe,'rows':_0x23bbfc}:null;}})[_0xbd29('0x1d')](respondWithResult(_0x5c01c9,null))[_0xbd29('0x3e')](handleError(_0x5c01c9,null));};exports[_0xbd29('0x46')]=function(_0x4977ea,_0x51075c,_0xda4f64){var _0x3d9a09={};var _0x1507e3={};var _0x144819;var _0xc554d5;return db[_0xbd29('0x24')][_0xbd29('0x42')]({'where':{'id':_0x4977ea['params']['id']}})[_0xbd29('0x1d')](handleEntityNotFound(_0x51075c,null))[_0xbd29('0x1d')](function(_0x67901){if(_0x67901){_0x144819=_0x67901;_0x1507e3['model']=_[_0xbd29('0x2b')](db[_0xbd29('0x43')][_0xbd29('0x25')]);_0x1507e3[_0xbd29('0x2a')]=_['keys'](_0x4977ea[_0xbd29('0x2a')]);_0x1507e3['filters']=_[_0xbd29('0x2c')](_0x1507e3[_0xbd29('0x29')],_0x1507e3[_0xbd29('0x2a')]);_0x3d9a09['attributes']=_[_0xbd29('0x2c')](_0x1507e3[_0xbd29('0x29')],qs[_0xbd29('0x2e')](_0x4977ea[_0xbd29('0x2a')]['fields']));_0x3d9a09[_0xbd29('0x2d')]=_0x3d9a09[_0xbd29('0x2d')][_0xbd29('0x2f')]?_0x3d9a09[_0xbd29('0x2d')]:_0x1507e3[_0xbd29('0x29')];_0x3d9a09[_0xbd29('0x31')]=qs['sort'](_0x4977ea[_0xbd29('0x2a')][_0xbd29('0x32')]);_0x3d9a09[_0xbd29('0x37')]=qs[_0xbd29('0x33')](_[_0xbd29('0x34')](_0x4977ea[_0xbd29('0x2a')],_0x1507e3[_0xbd29('0x33')]));if(_0x4977ea[_0xbd29('0x2a')]['filter']){_0x3d9a09[_0xbd29('0x37')]=_[_0xbd29('0x3c')](_0x3d9a09[_0xbd29('0x37')],{'$or':_['map'](_0x3d9a09[_0xbd29('0x2d')],function(_0x2701e0){var _0x4e0f22={};_0x4e0f22[_0x2701e0]={'$like':'%'+_0x4977ea['query'][_0xbd29('0x35')]+'%'};return _0x4e0f22;})});}_0x3d9a09=_[_0xbd29('0x3c')]({},_0x3d9a09,_0x4977ea[_0xbd29('0x36')]);return _0x144819['getFields'](_0x3d9a09);}})[_0xbd29('0x1d')](function(_0x13bba2){if(_0x13bba2){_0xc554d5=_0x13bba2[_0xbd29('0x2f')];if(!_0x4977ea['query'][_0xbd29('0x44')](_0xbd29('0x30'))){_0x3d9a09[_0xbd29('0x16')]=qs['limit'](_0x4977ea[_0xbd29('0x2a')]['limit']);_0x3d9a09[_0xbd29('0x15')]=qs[_0xbd29('0x15')](_0x4977ea[_0xbd29('0x2a')][_0xbd29('0x15')]);}return _0x144819[_0xbd29('0x46')](_0x3d9a09);}})[_0xbd29('0x1d')](function(_0xf746f){if(_0xf746f){return _0xf746f?{'count':_0xc554d5,'rows':_0xf746f}:null;}})[_0xbd29('0x1d')](respondWithResult(_0x51075c,null))[_0xbd29('0x3e')](handleError(_0x51075c,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 07af0ab..6a584b2 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 _0xb6a9=['exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x1944dc,_0x409526){var _0x5de3bd=function(_0x351374){while(--_0x351374){_0x1944dc['push'](_0x1944dc['shift']());}};_0x5de3bd(++_0x409526);}(_0xb6a9,0x1b6));var _0x9b6a=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb6a9[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x9b6a('0x0'));var util=require(_0x9b6a('0x1'));var logger=require('../../config/logger')(_0x9b6a('0x2'));var moment=require(_0x9b6a('0x3'));var BPromise=require(_0x9b6a('0x4'));var rp=require(_0x9b6a('0x5'));var fs=require('fs');var path=require(_0x9b6a('0x6'));var rimraf=require(_0x9b6a('0x7'));var config=require(_0x9b6a('0x8'));var attributes=require(_0x9b6a('0x9'));module[_0x9b6a('0xa')]=function(_0x4a51e6,_0x2241c7){return _0x4a51e6[_0x9b6a('0xb')](_0x9b6a('0xc'),attributes,{'tableName':_0x9b6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84f7=['request-promise','path','rimraf','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','util','../../config/logger','api','moment','bluebird'];(function(_0x11cbb5,_0x390441){var _0x54b8d3=function(_0x162ca2){while(--_0x162ca2){_0x11cbb5['push'](_0x11cbb5['shift']());}};_0x54b8d3(++_0x390441);}(_0x84f7,0x11b));var _0x784f=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x84f7[_0x49c057];return _0xd8f0e6;};'use strict';var _=require('lodash');var util=require(_0x784f('0x0'));var logger=require(_0x784f('0x1'))(_0x784f('0x2'));var moment=require(_0x784f('0x3'));var BPromise=require(_0x784f('0x4'));var rp=require(_0x784f('0x5'));var fs=require('fs');var path=require(_0x784f('0x6'));var rimraf=require(_0x784f('0x7'));var config=require('../../config/environment');var attributes=require(_0x784f('0x8'));module[_0x784f('0x9')]=function(_0x493641,_0x555fc8){return _0x493641[_0x784f('0xa')](_0x784f('0xb'),attributes,{'tableName':'int_freshsales_configurations','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 83c8f8e..8ed7005 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 _0xdade=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring'];(function(_0x55ae99,_0x5ab789){var _0x4297e1=function(_0x33ee69){while(--_0x33ee69){_0x55ae99['push'](_0x55ae99['shift']());}};_0x4297e1(++_0x5ab789);}(_0xdade,0x15c));var _0xedad=function(_0x166146,_0x1f34c6){_0x166146=_0x166146-0x0;var _0x9c7390=_0xdade[_0x166146];return _0x9c7390;};'use strict';var _=require(_0xedad('0x0'));var util=require(_0xedad('0x1'));var moment=require('moment');var BPromise=require(_0xedad('0x2'));var rs=require(_0xedad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedad('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xedad('0x5'))(_0xedad('0x6'));var config=require(_0xedad('0x7'));var jayson=require(_0xedad('0x8'));var client=jayson[_0xedad('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x113044,_0x4023a1,_0x9660b0){return new BPromise(function(_0x5577b5,_0x2c3c04){return client[_0xedad('0xa')](_0x113044,_0x9660b0)[_0xedad('0xb')](function(_0x300f92){logger[_0xedad('0xc')](_0xedad('0xd'),_0x4023a1,_0xedad('0xe'));logger[_0xedad('0xf')](_0xedad('0x10'),_0x4023a1,_0xedad('0xe'),JSON[_0xedad('0x11')](_0x300f92));if(_0x300f92[_0xedad('0x12')]){if(_0x300f92[_0xedad('0x12')][_0xedad('0x13')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x4023a1,_0x300f92[_0xedad('0x12')][_0xedad('0x14')]);return _0x2c3c04(_0x300f92[_0xedad('0x12')][_0xedad('0x14')]);}logger[_0xedad('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4023a1,_0x300f92[_0xedad('0x12')][_0xedad('0x14')]);return _0x5577b5(_0x300f92[_0xedad('0x12')][_0xedad('0x14')]);}else{logger['info'](_0xedad('0xd'),_0x4023a1,_0xedad('0xe'));_0x5577b5(_0x300f92[_0xedad('0x15')][_0xedad('0x14')]);}})['catch'](function(_0x3b1312){logger['error'](_0xedad('0xd'),_0x4023a1,_0x3b1312);_0x2c3c04(_0x3b1312);});});} \ No newline at end of file +var _0x49c4=['then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x49c4,0x114));var _0x449c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x49c4[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x449c('0x0'));var util=require(_0x449c('0x1'));var moment=require('moment');var BPromise=require(_0x449c('0x2'));var rs=require(_0x449c('0x3'));var fs=require('fs');var Redis=require(_0x449c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x449c('0x5'));var logger=require(_0x449c('0x6'))(_0x449c('0x7'));var config=require(_0x449c('0x8'));var jayson=require(_0x449c('0x9'));var client=jayson[_0x449c('0xa')][_0x449c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x72c48f,_0x4aeabf,_0x5d7702){return new BPromise(function(_0x542e9a,_0x243724){return client['request'](_0x72c48f,_0x5d7702)[_0x449c('0xc')](function(_0x4f9e4a){logger[_0x449c('0xd')](_0x449c('0xe'),_0x4aeabf,_0x449c('0xf'));logger[_0x449c('0x10')](_0x449c('0x11'),_0x4aeabf,_0x449c('0xf'),JSON[_0x449c('0x12')](_0x4f9e4a));if(_0x4f9e4a[_0x449c('0x13')]){if(_0x4f9e4a[_0x449c('0x13')][_0x449c('0x14')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x4aeabf,_0x4f9e4a[_0x449c('0x13')]['message']);return _0x243724(_0x4f9e4a[_0x449c('0x13')][_0x449c('0x15')]);}logger[_0x449c('0x13')](_0x449c('0xe'),_0x4aeabf,_0x4f9e4a[_0x449c('0x13')]['message']);return _0x542e9a(_0x4f9e4a[_0x449c('0x13')][_0x449c('0x15')]);}else{logger[_0x449c('0xd')](_0x449c('0xe'),_0x4aeabf,_0x449c('0xf'));_0x542e9a(_0x4f9e4a[_0x449c('0x16')][_0x449c('0x15')]);}})[_0x449c('0x17')](function(_0x145ab7){logger[_0x449c('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4aeabf,_0x145ab7);_0x243724(_0x145ab7);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 21b5a06..27166d7 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 _0x17ba=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5beda8,_0x1e8554){var _0x2aa042=function(_0x510f45){while(--_0x510f45){_0x5beda8['push'](_0x5beda8['shift']());}};_0x2aa042(++_0x1e8554);}(_0x17ba,0xab));var _0xa17b=function(_0x493532,_0x30a15e){_0x493532=_0x493532-0x0;var _0x37393f=_0x17ba[_0x493532];return _0x37393f;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xf')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router[_0xa17b('0x11')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x12')]);router[_0xa17b('0x13')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x14')]);module[_0xa17b('0x15')]=router; \ No newline at end of file +var _0x9f94=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x46de08,_0x350a03){var _0x11dcff=function(_0x213b4d){while(--_0x213b4d){_0x46de08['push'](_0x46de08['shift']());}};_0x11dcff(++_0x350a03);}(_0x9f94,0x1e7));var _0x49f9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9f94[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var path=require(_0x49f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x49f9('0x3')]();var fs_extra=require(_0x49f9('0x4'));var auth=require(_0x49f9('0x5'));var interaction=require(_0x49f9('0x6'));var config=require(_0x49f9('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x49f9('0x8')]('/',auth[_0x49f9('0x9')](),controller[_0x49f9('0xa')]);router[_0x49f9('0x8')](_0x49f9('0xb'),auth[_0x49f9('0x9')](),controller[_0x49f9('0xc')]);router[_0x49f9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49f9('0xe')]('/:id',auth[_0x49f9('0x9')](),controller[_0x49f9('0xf')]);router[_0x49f9('0x10')]('/:id',auth[_0x49f9('0x9')](),controller['destroy']);module[_0x49f9('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index e7d655a..3ef5bc8 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 _0x5845=['string','variable','customVariable','keyValue','STRING','exports','ENUM'];(function(_0x1252d9,_0xb59816){var _0x76c018=function(_0x52e72c){while(--_0x52e72c){_0x1252d9['push'](_0x1252d9['shift']());}};_0x76c018(++_0xb59816);}(_0x5845,0xde));var _0x5584=function(_0x448e81,_0x402d6b){_0x448e81=_0x448e81-0x0;var _0xca57f8=_0x5845[_0x448e81];return _0xca57f8;};'use strict';var Sequelize=require('sequelize');module[_0x5584('0x0')]={'type':{'type':Sequelize[_0x5584('0x1')](_0x5584('0x2'),_0x5584('0x3'),_0x5584('0x4'),_0x5584('0x5'),'picklist'),'defaultValue':_0x5584('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5584('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x5584('0x2'),_0x5584('0x3'),_0x5584('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5584('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5584('0x6')]}}; \ No newline at end of file +var _0x7da6=['customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist','string','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x7da6,0x19c));var _0x67da=function(_0x39772f,_0x5605cb){_0x39772f=_0x39772f-0x0;var _0xc9edbf=_0x7da6[_0x39772f];return _0xc9edbf;};'use strict';var Sequelize=require(_0x67da('0x0'));module[_0x67da('0x1')]={'type':{'type':Sequelize[_0x67da('0x2')]('string',_0x67da('0x3'),'customVariable',_0x67da('0x4'),_0x67da('0x5')),'defaultValue':_0x67da('0x6')},'content':{'type':Sequelize[_0x67da('0x7')]},'key':{'type':Sequelize[_0x67da('0x7')]},'keyType':{'type':Sequelize[_0x67da('0x2')](_0x67da('0x6'),_0x67da('0x3'),_0x67da('0x8'))},'keyContent':{'type':Sequelize[_0x67da('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x67da('0x7')]},'customField':{'type':Sequelize[_0x67da('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index db5f278..5320e61 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 _0x85a5=['lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshsalesField','includeAll','findAll','rows','catch','show','find','create','body','update','params','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0x85a5,0x88));var _0x585a=function(_0x4b352f,_0x2c3ac1){_0x4b352f=_0x4b352f-0x0;var _0xb78495=_0x85a5[_0x4b352f];return _0xb78495;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x585a('0x0'));var zipdir=require(_0x585a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x585a('0x2'));var BPromise=require(_0x585a('0x3'));var Mustache=require(_0x585a('0x4'));var util=require(_0x585a('0x5'));var path=require(_0x585a('0x6'));var sox=require(_0x585a('0x7'));var csv=require(_0x585a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x585a('0x9'));var _=require(_0x585a('0xa'));var squel=require(_0x585a('0xb'));var crypto=require(_0x585a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x585a('0xd'));var toCsv=require(_0x585a('0x8'));var querystring=require(_0x585a('0xe'));var Papa=require(_0x585a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x585a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x585a('0x11'));var logger=require(_0x585a('0x12'))(_0x585a('0x13'));var utils=require(_0x585a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x585a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2885bb,_0x2591dd){_0x2591dd=_0x2591dd||0xcc;return function(_0x188199){if(_0x188199){return _0x2885bb[_0x585a('0x16')](_0x2591dd);}return _0x2885bb[_0x585a('0x17')](_0x2591dd)[_0x585a('0x18')]();};}function respondWithResult(_0x4674ec,_0x3617c2){_0x3617c2=_0x3617c2||0xc8;return function(_0x522c90){if(_0x522c90){return _0x4674ec[_0x585a('0x17')](_0x3617c2)[_0x585a('0x19')](_0x522c90);}};}function respondWithFilteredResult(_0x1c2f99,_0x5ee5ad){return function(_0x5a3c72){if(_0x5a3c72){var _0x4e0023=typeof _0x5ee5ad[_0x585a('0x1a')]==='undefined'&&typeof _0x5ee5ad[_0x585a('0x1b')]==='undefined';var _0x4eda4b=_0x5a3c72[_0x585a('0x1c')];var _0x16d2a5=_0x4e0023?0x0:_0x5ee5ad['offset'];var _0x2f5046=_0x4e0023?_0x5a3c72[_0x585a('0x1c')]:_0x5ee5ad['offset']+_0x5ee5ad[_0x585a('0x1b')];var _0x4daed1;if(_0x2f5046>=_0x4eda4b){_0x2f5046=_0x4eda4b;_0x4daed1=0xc8;}else{_0x4daed1=0xce;}_0x1c2f99[_0x585a('0x17')](_0x4daed1);return _0x1c2f99[_0x585a('0x1d')](_0x585a('0x1e'),_0x16d2a5+'-'+_0x2f5046+'/'+_0x4eda4b)[_0x585a('0x19')](_0x5a3c72);}return null;};}function patchUpdates(_0x5db316){return function(_0x1e0773){try{jsonpatch['apply'](_0x1e0773,_0x5db316,!![]);}catch(_0x755ee4){return BPromise[_0x585a('0x1f')](_0x755ee4);}return _0x1e0773[_0x585a('0x20')]();};}function saveUpdates(_0x49934e,_0x6fa7fb){return function(_0x397416){if(_0x397416){return _0x397416['update'](_0x49934e)[_0x585a('0x21')](function(_0x2f60ac){return _0x2f60ac;});}return null;};}function removeEntity(_0x1782da,_0x58d2a8){return function(_0x4c9775){if(_0x4c9775){return _0x4c9775[_0x585a('0x22')]()['then'](function(){_0x1782da[_0x585a('0x17')](0xcc)[_0x585a('0x18')]();});}};}function handleEntityNotFound(_0x29d840,_0x53759b){return function(_0x3903af){if(!_0x3903af){_0x29d840[_0x585a('0x16')](0x194);}return _0x3903af;};}function handleError(_0x3222d7,_0x34cbcf){_0x34cbcf=_0x34cbcf||0x1f4;return function(_0x5b8858){logger[_0x585a('0x23')](_0x5b8858[_0x585a('0x24')]);if(_0x5b8858[_0x585a('0x25')]){delete _0x5b8858[_0x585a('0x25')];}_0x3222d7['status'](_0x34cbcf)[_0x585a('0x26')](_0x5b8858);};}exports['index']=function(_0x15ae3e,_0x282093){var _0x3dfcaf={},_0x109067={},_0x380ce1={'count':0x0,'rows':[]};var _0x124516=_[_0x585a('0x27')](db['FreshsalesField'][_0x585a('0x28')],function(_0x30715e){return{'name':_0x30715e[_0x585a('0x29')],'type':_0x30715e['type'][_0x585a('0x2a')]};});_0x109067[_0x585a('0x2b')]=_['map'](_0x124516,_0x585a('0x25'));_0x109067[_0x585a('0x2c')]=_[_0x585a('0x2d')](_0x15ae3e[_0x585a('0x2c')]);_0x109067[_0x585a('0x2e')]=_[_0x585a('0x2f')](_0x109067[_0x585a('0x2b')],_0x109067['query']);_0x3dfcaf['attributes']=_[_0x585a('0x2f')](_0x109067['model'],qs[_0x585a('0x30')](_0x15ae3e['query'][_0x585a('0x30')]));_0x3dfcaf['attributes']=_0x3dfcaf[_0x585a('0x31')][_0x585a('0x32')]?_0x3dfcaf['attributes']:_0x109067[_0x585a('0x2b')];if(!_0x15ae3e[_0x585a('0x2c')][_0x585a('0x33')](_0x585a('0x34'))){_0x3dfcaf['limit']=qs['limit'](_0x15ae3e[_0x585a('0x2c')][_0x585a('0x1b')]);_0x3dfcaf['offset']=qs[_0x585a('0x1a')](_0x15ae3e[_0x585a('0x2c')][_0x585a('0x1a')]);}_0x3dfcaf[_0x585a('0x35')]=qs[_0x585a('0x36')](_0x15ae3e[_0x585a('0x2c')]['sort']);_0x3dfcaf[_0x585a('0x37')]=qs[_0x585a('0x2e')](_[_0x585a('0x38')](_0x15ae3e['query'],_0x109067['filters']),_0x124516);if(_0x15ae3e[_0x585a('0x2c')][_0x585a('0x39')]){_0x3dfcaf[_0x585a('0x37')]=_[_0x585a('0x3a')](_0x3dfcaf[_0x585a('0x37')],{'$or':_[_0x585a('0x27')](_0x124516,function(_0x180b4b){if(_0x180b4b[_0x585a('0x3b')]!==_0x585a('0x3c')){var _0x1b883f={};_0x1b883f[_0x180b4b[_0x585a('0x25')]]={'$like':'%'+_0x15ae3e['query'][_0x585a('0x39')]+'%'};return _0x1b883f;}})});}_0x3dfcaf=_[_0x585a('0x3a')]({},_0x3dfcaf,_0x15ae3e[_0x585a('0x3d')]);var _0x9b0930={'where':_0x3dfcaf[_0x585a('0x37')]};return db[_0x585a('0x3e')][_0x585a('0x1c')](_0x9b0930)[_0x585a('0x21')](function(_0xbe9ec7){_0x380ce1[_0x585a('0x1c')]=_0xbe9ec7;if(_0x15ae3e['query'][_0x585a('0x3f')]){_0x3dfcaf['include']=[{'all':!![]}];}return db[_0x585a('0x3e')][_0x585a('0x40')](_0x3dfcaf);})['then'](function(_0x14d42d){_0x380ce1[_0x585a('0x41')]=_0x14d42d;return _0x380ce1;})[_0x585a('0x21')](respondWithFilteredResult(_0x282093,_0x3dfcaf))[_0x585a('0x42')](handleError(_0x282093,null));};exports[_0x585a('0x43')]=function(_0x1ec5ba,_0x6962ae){var _0x283445={'raw':!![],'where':{'id':_0x1ec5ba['params']['id']}},_0x4ac405={};_0x4ac405[_0x585a('0x2b')]=_['keys'](db[_0x585a('0x3e')][_0x585a('0x28')]);_0x4ac405[_0x585a('0x2c')]=_[_0x585a('0x2d')](_0x1ec5ba[_0x585a('0x2c')]);_0x4ac405[_0x585a('0x2e')]=_[_0x585a('0x2f')](_0x4ac405[_0x585a('0x2b')],_0x4ac405[_0x585a('0x2c')]);_0x283445[_0x585a('0x31')]=_[_0x585a('0x2f')](_0x4ac405[_0x585a('0x2b')],qs[_0x585a('0x30')](_0x1ec5ba[_0x585a('0x2c')]['fields']));_0x283445[_0x585a('0x31')]=_0x283445['attributes'][_0x585a('0x32')]?_0x283445['attributes']:_0x4ac405['model'];if(_0x1ec5ba[_0x585a('0x2c')]['includeAll']){_0x283445['include']=[{'all':!![]}];}_0x283445=_[_0x585a('0x3a')]({},_0x283445,_0x1ec5ba[_0x585a('0x3d')]);return db[_0x585a('0x3e')][_0x585a('0x44')](_0x283445)['then'](handleEntityNotFound(_0x6962ae,null))[_0x585a('0x21')](respondWithResult(_0x6962ae,null))['catch'](handleError(_0x6962ae,null));};exports[_0x585a('0x45')]=function(_0x488e6c,_0x1af66c){return db['FreshsalesField'][_0x585a('0x45')](_0x488e6c[_0x585a('0x46')],{})['then'](respondWithResult(_0x1af66c,0xc9))[_0x585a('0x42')](handleError(_0x1af66c,null));};exports[_0x585a('0x47')]=function(_0x5302b5,_0x3242a9){if(_0x5302b5['body']['id']){delete _0x5302b5[_0x585a('0x46')]['id'];}return db[_0x585a('0x3e')]['find']({'where':{'id':_0x5302b5[_0x585a('0x48')]['id']}})[_0x585a('0x21')](handleEntityNotFound(_0x3242a9,null))['then'](saveUpdates(_0x5302b5['body'],null))[_0x585a('0x21')](respondWithResult(_0x3242a9,null))['catch'](handleError(_0x3242a9,null));};exports[_0x585a('0x22')]=function(_0x32a584,_0x59384a){return db[_0x585a('0x3e')][_0x585a('0x44')]({'where':{'id':_0x32a584['params']['id']}})[_0x585a('0x21')](handleEntityNotFound(_0x59384a,null))[_0x585a('0x21')](removeEntity(_0x59384a,null))[_0x585a('0x42')](handleError(_0x59384a,null));}; \ No newline at end of file +var _0x58e0=['request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','fields','length','include','find','create','body','eml-format','zip-dir','fast-json-patch'];(function(_0x28f4cb,_0x17286a){var _0x33c790=function(_0x390d67){while(--_0x390d67){_0x28f4cb['push'](_0x28f4cb['shift']());}};_0x33c790(++_0x17286a);}(_0x58e0,0x129));var _0x058e=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0x58e0[_0x1a7846];return _0x48049;};'use strict';var emlformat=require(_0x058e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x058e('0x1'));var jsonpatch=require(_0x058e('0x2'));var rp=require(_0x058e('0x3'));var moment=require(_0x058e('0x4'));var BPromise=require(_0x058e('0x5'));var Mustache=require(_0x058e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x058e('0x7'));var csv=require(_0x058e('0x8'));var ejs=require(_0x058e('0x9'));var fs=require('fs');var fs_extra=require(_0x058e('0xa'));var _=require(_0x058e('0xb'));var squel=require('squel');var crypto=require(_0x058e('0xc'));var jsforce=require(_0x058e('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x058e('0xe'));var Papa=require(_0x058e('0xf'));var Redis=require(_0x058e('0x10'));var authService=require(_0x058e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x058e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x058e('0x13'))(_0x058e('0x14'));var utils=require(_0x058e('0x15'));var config=require(_0x058e('0x16'));var licenseUtil=require(_0x058e('0x17'));var db=require(_0x058e('0x18'))['db'];function respondWithStatusCode(_0x478965,_0x5992fd){_0x5992fd=_0x5992fd||0xcc;return function(_0x38f15f){if(_0x38f15f){return _0x478965[_0x058e('0x19')](_0x5992fd);}return _0x478965[_0x058e('0x1a')](_0x5992fd)[_0x058e('0x1b')]();};}function respondWithResult(_0x32a9d9,_0x25194c){_0x25194c=_0x25194c||0xc8;return function(_0x5d6a6d){if(_0x5d6a6d){return _0x32a9d9['status'](_0x25194c)[_0x058e('0x1c')](_0x5d6a6d);}};}function respondWithFilteredResult(_0x395a6d,_0xad8032){return function(_0xf7f7bf){if(_0xf7f7bf){var _0x4ed4f5=typeof _0xad8032[_0x058e('0x1d')]===_0x058e('0x1e')&&typeof _0xad8032[_0x058e('0x1f')]===_0x058e('0x1e');var _0x48bb41=_0xf7f7bf[_0x058e('0x20')];var _0x3d0dc5=_0x4ed4f5?0x0:_0xad8032['offset'];var _0x13a01c=_0x4ed4f5?_0xf7f7bf['count']:_0xad8032['offset']+_0xad8032['limit'];var _0x5f0e66;if(_0x13a01c>=_0x48bb41){_0x13a01c=_0x48bb41;_0x5f0e66=0xc8;}else{_0x5f0e66=0xce;}_0x395a6d[_0x058e('0x1a')](_0x5f0e66);return _0x395a6d[_0x058e('0x21')]('Content-Range',_0x3d0dc5+'-'+_0x13a01c+'/'+_0x48bb41)[_0x058e('0x1c')](_0xf7f7bf);}return null;};}function patchUpdates(_0x5cfded){return function(_0x8cee1a){try{jsonpatch[_0x058e('0x22')](_0x8cee1a,_0x5cfded,!![]);}catch(_0x3dd1fa){return BPromise[_0x058e('0x23')](_0x3dd1fa);}return _0x8cee1a[_0x058e('0x24')]();};}function saveUpdates(_0x3e3b68,_0x20419){return function(_0x10e2dd){if(_0x10e2dd){return _0x10e2dd[_0x058e('0x25')](_0x3e3b68)[_0x058e('0x26')](function(_0x408954){return _0x408954;});}return null;};}function removeEntity(_0x5cce5e,_0x27d083){return function(_0x29d99a){if(_0x29d99a){return _0x29d99a[_0x058e('0x27')]()[_0x058e('0x26')](function(){_0x5cce5e[_0x058e('0x1a')](0xcc)[_0x058e('0x1b')]();});}};}function handleEntityNotFound(_0xdfcff6,_0x337917){return function(_0x345dbe){if(!_0x345dbe){_0xdfcff6[_0x058e('0x19')](0x194);}return _0x345dbe;};}function handleError(_0x347200,_0x4de29e){_0x4de29e=_0x4de29e||0x1f4;return function(_0x14556a){logger[_0x058e('0x28')](_0x14556a[_0x058e('0x29')]);if(_0x14556a[_0x058e('0x2a')]){delete _0x14556a[_0x058e('0x2a')];}_0x347200[_0x058e('0x1a')](_0x4de29e)[_0x058e('0x2b')](_0x14556a);};}exports['index']=function(_0x1a73d3,_0x2f31cc){var _0x33e634={},_0x58dafd={},_0x25e76a={'count':0x0,'rows':[]};var _0x1348fc=_[_0x058e('0x2c')](db[_0x058e('0x2d')][_0x058e('0x2e')],function(_0x226f20){return{'name':_0x226f20[_0x058e('0x2f')],'type':_0x226f20[_0x058e('0x30')]['key']};});_0x58dafd[_0x058e('0x31')]=_['map'](_0x1348fc,'name');_0x58dafd[_0x058e('0x32')]=_[_0x058e('0x33')](_0x1a73d3['query']);_0x58dafd[_0x058e('0x34')]=_[_0x058e('0x35')](_0x58dafd[_0x058e('0x31')],_0x58dafd['query']);_0x33e634[_0x058e('0x36')]=_[_0x058e('0x35')](_0x58dafd['model'],qs['fields'](_0x1a73d3[_0x058e('0x32')]['fields']));_0x33e634[_0x058e('0x36')]=_0x33e634[_0x058e('0x36')]['length']?_0x33e634[_0x058e('0x36')]:_0x58dafd[_0x058e('0x31')];if(!_0x1a73d3[_0x058e('0x32')]['hasOwnProperty'](_0x058e('0x37'))){_0x33e634['limit']=qs[_0x058e('0x1f')](_0x1a73d3['query'][_0x058e('0x1f')]);_0x33e634[_0x058e('0x1d')]=qs[_0x058e('0x1d')](_0x1a73d3[_0x058e('0x32')][_0x058e('0x1d')]);}_0x33e634['order']=qs['sort'](_0x1a73d3[_0x058e('0x32')][_0x058e('0x38')]);_0x33e634[_0x058e('0x39')]=qs[_0x058e('0x34')](_[_0x058e('0x3a')](_0x1a73d3[_0x058e('0x32')],_0x58dafd['filters']),_0x1348fc);if(_0x1a73d3[_0x058e('0x32')][_0x058e('0x3b')]){_0x33e634['where']=_[_0x058e('0x3c')](_0x33e634[_0x058e('0x39')],{'$or':_[_0x058e('0x2c')](_0x1348fc,function(_0x3052ab){if(_0x3052ab['type']!==_0x058e('0x3d')){var _0x405db3={};_0x405db3[_0x3052ab[_0x058e('0x2a')]]={'$like':'%'+_0x1a73d3[_0x058e('0x32')][_0x058e('0x3b')]+'%'};return _0x405db3;}})});}_0x33e634=_[_0x058e('0x3c')]({},_0x33e634,_0x1a73d3[_0x058e('0x3e')]);var _0x15d4f8={'where':_0x33e634[_0x058e('0x39')]};return db['FreshsalesField'][_0x058e('0x20')](_0x15d4f8)[_0x058e('0x26')](function(_0x2931c6){_0x25e76a[_0x058e('0x20')]=_0x2931c6;if(_0x1a73d3[_0x058e('0x32')][_0x058e('0x3f')]){_0x33e634['include']=[{'all':!![]}];}return db[_0x058e('0x2d')][_0x058e('0x40')](_0x33e634);})[_0x058e('0x26')](function(_0x1ec247){_0x25e76a[_0x058e('0x41')]=_0x1ec247;return _0x25e76a;})[_0x058e('0x26')](respondWithFilteredResult(_0x2f31cc,_0x33e634))[_0x058e('0x42')](handleError(_0x2f31cc,null));};exports[_0x058e('0x43')]=function(_0x269bcb,_0x425144){var _0x447307={'raw':!![],'where':{'id':_0x269bcb[_0x058e('0x44')]['id']}},_0x895e31={};_0x895e31['model']=_[_0x058e('0x33')](db['FreshsalesField']['rawAttributes']);_0x895e31[_0x058e('0x32')]=_[_0x058e('0x33')](_0x269bcb[_0x058e('0x32')]);_0x895e31[_0x058e('0x34')]=_[_0x058e('0x35')](_0x895e31[_0x058e('0x31')],_0x895e31['query']);_0x447307[_0x058e('0x36')]=_[_0x058e('0x35')](_0x895e31[_0x058e('0x31')],qs[_0x058e('0x45')](_0x269bcb['query'][_0x058e('0x45')]));_0x447307[_0x058e('0x36')]=_0x447307[_0x058e('0x36')][_0x058e('0x46')]?_0x447307[_0x058e('0x36')]:_0x895e31[_0x058e('0x31')];if(_0x269bcb[_0x058e('0x32')][_0x058e('0x3f')]){_0x447307[_0x058e('0x47')]=[{'all':!![]}];}_0x447307=_[_0x058e('0x3c')]({},_0x447307,_0x269bcb[_0x058e('0x3e')]);return db[_0x058e('0x2d')][_0x058e('0x48')](_0x447307)[_0x058e('0x26')](handleEntityNotFound(_0x425144,null))['then'](respondWithResult(_0x425144,null))[_0x058e('0x42')](handleError(_0x425144,null));};exports[_0x058e('0x49')]=function(_0x153df5,_0x37cadf){return db[_0x058e('0x2d')][_0x058e('0x49')](_0x153df5[_0x058e('0x4a')],{})[_0x058e('0x26')](respondWithResult(_0x37cadf,0xc9))[_0x058e('0x42')](handleError(_0x37cadf,null));};exports['update']=function(_0x1e6ca4,_0x44435b){if(_0x1e6ca4[_0x058e('0x4a')]['id']){delete _0x1e6ca4[_0x058e('0x4a')]['id'];}return db[_0x058e('0x2d')][_0x058e('0x48')]({'where':{'id':_0x1e6ca4[_0x058e('0x44')]['id']}})['then'](handleEntityNotFound(_0x44435b,null))[_0x058e('0x26')](saveUpdates(_0x1e6ca4[_0x058e('0x4a')],null))[_0x058e('0x26')](respondWithResult(_0x44435b,null))[_0x058e('0x42')](handleError(_0x44435b,null));};exports['destroy']=function(_0x153424,_0x3af0e6){return db[_0x058e('0x2d')][_0x058e('0x48')]({'where':{'id':_0x153424[_0x058e('0x44')]['id']}})[_0x058e('0x26')](handleEntityNotFound(_0x3af0e6,null))[_0x058e('0x26')](removeEntity(_0x3af0e6,null))['catch'](handleError(_0x3af0e6,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 32356e0..39d21e2 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 _0x7269=['idField','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0x241d45,_0x1d62ba){var _0x145c87=function(_0x36463d){while(--_0x36463d){_0x241d45['push'](_0x241d45['shift']());}};_0x145c87(++_0x1d62ba);}(_0x7269,0x76));var _0x9726=function(_0x41a1c8,_0x2b88c3){_0x41a1c8=_0x41a1c8-0x0;var _0x36a628=_0x7269[_0x41a1c8];return _0x36a628;};'use strict';var _=require(_0x9726('0x0'));var util=require(_0x9726('0x1'));var logger=require(_0x9726('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9726('0x3'));var rp=require(_0x9726('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9726('0x5'));var config=require(_0x9726('0x6'));var attributes=require(_0x9726('0x7'));module[_0x9726('0x8')]=function(_0x795889,_0x832cb){return _0x795889[_0x9726('0x9')](_0x9726('0xa'),attributes,{'tableName':_0x9726('0xb'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x9726('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x32d5=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshsalesField','idField','lodash','util','../../config/logger'];(function(_0x4d46e9,_0x4da04e){var _0x4ce40d=function(_0x54905e){while(--_0x54905e){_0x4d46e9['push'](_0x4d46e9['shift']());}};_0x4ce40d(++_0x4da04e);}(_0x32d5,0x1aa));var _0x532d=function(_0x1796f3,_0x196d7c){_0x1796f3=_0x1796f3-0x0;var _0x453f3c=_0x32d5[_0x1796f3];return _0x453f3c;};'use strict';var _=require(_0x532d('0x0'));var util=require(_0x532d('0x1'));var logger=require(_0x532d('0x2'))(_0x532d('0x3'));var moment=require(_0x532d('0x4'));var BPromise=require(_0x532d('0x5'));var rp=require(_0x532d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x532d('0x7'));var config=require(_0x532d('0x8'));var attributes=require('./intFreshsalesField.attributes');module[_0x532d('0x9')]=function(_0x2b1142,_0x2995e2){return _0x2b1142[_0x532d('0xa')](_0x532d('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x532d('0xc'),'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 ae4c0b4..899cf06 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 _0xe3da=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x30d39f,_0x1ea039){var _0x1f17dd=function(_0xb150d){while(--_0xb150d){_0x30d39f['push'](_0x30d39f['shift']());}};_0x1f17dd(++_0x1ea039);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','FreshsalesField,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xa61208,_0x209d3e){var _0x4c229c=function(_0x17b83c){while(--_0x17b83c){_0xa61208['push'](_0xa61208['shift']());}};_0x4c229c(++_0x209d3e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4d180c,_0x45c68e){_0x4d180c=_0x4d180c-0x0;var _0x49b57e=_0x5fc3[_0x4d180c];return _0x49b57e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 2417b9d..cf2ce33 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1ff6a7,_0x15a671){var _0x2decad=function(_0x3caf83){while(--_0x3caf83){_0x1ff6a7['push'](_0x1ff6a7['shift']());}};_0x2decad(++_0x15a671);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x138859,_0x2d04a3){var _0x271497=function(_0x1ca916){while(--_0x1ca916){_0x138859['push'](_0x138859['shift']());}};_0x271497(++_0x2d04a3);}(_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('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index a278f89..f5b912f 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 _0x99e7=['username','integrationTab','sequelize','exports','STRING'];(function(_0x8d65d2,_0x17511d){var _0x109850=function(_0x2a1d84){while(--_0x2a1d84){_0x8d65d2['push'](_0x8d65d2['shift']());}};_0x109850(++_0x17511d);}(_0x99e7,0x1b5));var _0x799e=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x99e7[_0x50e40b];return _0x2608b7;};'use strict';var Sequelize=require(_0x799e('0x0'));module[_0x799e('0x1')]={'name':{'type':Sequelize[_0x799e('0x2')]},'description':{'type':Sequelize[_0x799e('0x2')]},'username':{'type':Sequelize[_0x799e('0x2')],'unique':_0x799e('0x3')},'remoteUri':{'type':Sequelize[_0x799e('0x2')]},'password':{'type':Sequelize[_0x799e('0x2')]},'clientId':{'type':Sequelize[_0x799e('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x799e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x799e('0x4'),'newTab'),'defaultValue':_0x799e('0x4')}}; \ No newline at end of file +var _0xaac4=['sequelize','exports','STRING','username','integrationTab','newTab'];(function(_0x46b135,_0x66252d){var _0x2b1cd3=function(_0x564332){while(--_0x564332){_0x46b135['push'](_0x46b135['shift']());}};_0x2b1cd3(++_0x66252d);}(_0xaac4,0x6c));var _0x4aac=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0xaac4[_0xaf25ae];return _0x49732d;};'use strict';var Sequelize=require(_0x4aac('0x0'));module[_0x4aac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4aac('0x2')]},'username':{'type':Sequelize[_0x4aac('0x2')],'unique':_0x4aac('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4aac('0x2')]},'clientId':{'type':Sequelize[_0x4aac('0x2')]},'clientSecret':{'type':Sequelize[_0x4aac('0x2')]},'securityToken':{'type':Sequelize[_0x4aac('0x2')]},'serverUrl':{'type':Sequelize[_0x4aac('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4aac('0x4'),_0x4aac('0x5')),'defaultValue':_0x4aac('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 2df5d79..829f589 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 _0x569e=['options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getConfigurations','findOne','SalesforceConfiguration','length','pick','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','lastIndexOf','Connection','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','textarea','remove','includes','label','custom','picklistValues','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','sendStatus','error','stack','SalesforceAccount','rawAttributes','fieldName','type','model','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL'];(function(_0x2a6754,_0x277259){var _0x17feda=function(_0x5745be){while(--_0x5745be){_0x2a6754['push'](_0x2a6754['shift']());}};_0x17feda(++_0x277259);}(_0x569e,0x13d));var _0xe569=function(_0x5c80c1,_0x4f80ca){_0x5c80c1=_0x5c80c1-0x0;var _0xb74ac=_0x569e[_0x5c80c1];return _0xb74ac;};'use strict';var emlformat=require(_0xe569('0x0'));var rimraf=require(_0xe569('0x1'));var zipdir=require(_0xe569('0x2'));var jsonpatch=require(_0xe569('0x3'));var rp=require(_0xe569('0x4'));var moment=require(_0xe569('0x5'));var BPromise=require(_0xe569('0x6'));var Mustache=require(_0xe569('0x7'));var util=require(_0xe569('0x8'));var path=require(_0xe569('0x9'));var sox=require(_0xe569('0xa'));var csv=require(_0xe569('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe569('0xc'));var _=require(_0xe569('0xd'));var squel=require(_0xe569('0xe'));var crypto=require('crypto');var jsforce=require(_0xe569('0xf'));var deskjs=require(_0xe569('0x10'));var toCsv=require(_0xe569('0xb'));var querystring=require(_0xe569('0x11'));var Papa=require('papaparse');var Redis=require(_0xe569('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe569('0x13'));var as=require(_0xe569('0x14'));var hardwareService=require(_0xe569('0x15'));var logger=require('../../config/logger')(_0xe569('0x16'));var utils=require(_0xe569('0x17'));var config=require(_0xe569('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xe569('0x19'));function respondWithStatusCode(_0x129b28,_0x3d22d3){_0x3d22d3=_0x3d22d3||0xcc;return function(_0x21bfad){if(_0x21bfad){return _0x129b28['sendStatus'](_0x3d22d3);}return _0x129b28[_0xe569('0x1a')](_0x3d22d3)['end']();};}function respondWithResult(_0x122a59,_0x4e4487){_0x4e4487=_0x4e4487||0xc8;return function(_0x32fa06){if(_0x32fa06){return _0x122a59[_0xe569('0x1a')](_0x4e4487)[_0xe569('0x1b')](_0x32fa06);}};}function respondWithFilteredResult(_0xa4f7f3,_0x318488){return function(_0x3d291e){if(_0x3d291e){var _0x750207=typeof _0x318488[_0xe569('0x1c')]===_0xe569('0x1d')&&typeof _0x318488[_0xe569('0x1e')]==='undefined';var _0x3e928b=_0x3d291e[_0xe569('0x1f')];var _0x282d8f=_0x750207?0x0:_0x318488[_0xe569('0x1c')];var _0xb1b5c2=_0x750207?_0x3d291e[_0xe569('0x1f')]:_0x318488[_0xe569('0x1c')]+_0x318488['limit'];var _0xdd6f1d;if(_0xb1b5c2>=_0x3e928b){_0xb1b5c2=_0x3e928b;_0xdd6f1d=0xc8;}else{_0xdd6f1d=0xce;}_0xa4f7f3[_0xe569('0x1a')](_0xdd6f1d);return _0xa4f7f3[_0xe569('0x20')]('Content-Range',_0x282d8f+'-'+_0xb1b5c2+'/'+_0x3e928b)['json'](_0x3d291e);}return null;};}function patchUpdates(_0x21d008){return function(_0x5cfe0e){try{jsonpatch[_0xe569('0x21')](_0x5cfe0e,_0x21d008,!![]);}catch(_0x4cce56){return BPromise['reject'](_0x4cce56);}return _0x5cfe0e[_0xe569('0x22')]();};}function saveUpdates(_0x50b6fd,_0x31183f){return function(_0x43b3e9){if(_0x43b3e9){return _0x43b3e9[_0xe569('0x23')](_0x50b6fd)[_0xe569('0x24')](function(_0x3460b6){return _0x3460b6;});}return null;};}function removeEntity(_0x40e4af,_0x2f6223){return function(_0xc9b063){if(_0xc9b063){return _0xc9b063[_0xe569('0x25')]()[_0xe569('0x24')](function(){_0x40e4af[_0xe569('0x1a')](0xcc)[_0xe569('0x26')]();});}};}function handleEntityNotFound(_0x2fd3cf,_0x41f42c){return function(_0x734e37){if(!_0x734e37){_0x2fd3cf[_0xe569('0x27')](0x194);}return _0x734e37;};}function handleError(_0x167dec,_0x4f22c2){_0x4f22c2=_0x4f22c2||0x1f4;return function(_0x4f4f42){logger[_0xe569('0x28')](_0x4f4f42[_0xe569('0x29')]);if(_0x4f4f42['name']){delete _0x4f4f42['name'];}_0x167dec[_0xe569('0x1a')](_0x4f22c2)['send'](_0x4f4f42);};}exports['index']=function(_0x138822,_0x15d549){var _0xfc0a22={},_0x47f99e={},_0x1d2b94={'count':0x0,'rows':[]};var _0x54195a=_['map'](db[_0xe569('0x2a')][_0xe569('0x2b')],function(_0x170d5c){return{'name':_0x170d5c[_0xe569('0x2c')],'type':_0x170d5c[_0xe569('0x2d')]['key']};});_0x47f99e[_0xe569('0x2e')]=_['map'](_0x54195a,_0xe569('0x2f'));_0x47f99e[_0xe569('0x30')]=_[_0xe569('0x31')](_0x138822[_0xe569('0x30')]);_0x47f99e['filters']=_[_0xe569('0x32')](_0x47f99e[_0xe569('0x2e')],_0x47f99e['query']);_0xfc0a22['attributes']=_[_0xe569('0x32')](_0x47f99e['model'],qs[_0xe569('0x33')](_0x138822[_0xe569('0x30')]['fields']));_0xfc0a22['attributes']=_0xfc0a22['attributes']['length']?_0xfc0a22[_0xe569('0x34')]:_0x47f99e[_0xe569('0x2e')];if(!_0x138822['query'][_0xe569('0x35')](_0xe569('0x36'))){_0xfc0a22['limit']=qs[_0xe569('0x1e')](_0x138822[_0xe569('0x30')][_0xe569('0x1e')]);_0xfc0a22[_0xe569('0x1c')]=qs[_0xe569('0x1c')](_0x138822[_0xe569('0x30')][_0xe569('0x1c')]);}_0xfc0a22[_0xe569('0x37')]=qs[_0xe569('0x38')](_0x138822[_0xe569('0x30')]['sort']);_0xfc0a22['where']=qs[_0xe569('0x39')](_['pick'](_0x138822[_0xe569('0x30')],_0x47f99e[_0xe569('0x39')]),_0x54195a);if(_0x138822['query']['filter']){_0xfc0a22[_0xe569('0x3a')]=_[_0xe569('0x3b')](_0xfc0a22[_0xe569('0x3a')],{'$or':_['map'](_0x54195a,function(_0x537837){if(_0x537837[_0xe569('0x2d')]!==_0xe569('0x3c')){var _0x44214e={};_0x44214e[_0x537837['name']]={'$like':'%'+_0x138822['query']['filter']+'%'};return _0x44214e;}})});}_0xfc0a22=_[_0xe569('0x3b')]({},_0xfc0a22,_0x138822[_0xe569('0x3d')]);var _0x53d50d={'where':_0xfc0a22[_0xe569('0x3a')]};return db[_0xe569('0x2a')]['count'](_0x53d50d)[_0xe569('0x24')](function(_0x17d387){_0x1d2b94[_0xe569('0x1f')]=_0x17d387;if(_0x138822[_0xe569('0x30')]['includeAll']){_0xfc0a22[_0xe569('0x3e')]=[{'all':!![]}];}return db[_0xe569('0x2a')][_0xe569('0x3f')](_0xfc0a22);})[_0xe569('0x24')](function(_0x4b0b77){_0x1d2b94[_0xe569('0x40')]=_0x4b0b77;return _0x1d2b94;})[_0xe569('0x24')](respondWithFilteredResult(_0x15d549,_0xfc0a22))[_0xe569('0x41')](handleError(_0x15d549,null));};exports[_0xe569('0x42')]=function(_0x3f9a16,_0x6a903f){var _0x5ea13e={'raw':![],'where':{'id':_0x3f9a16[_0xe569('0x43')]['id']}},_0x2b16ac={};_0x2b16ac[_0xe569('0x2e')]=_['keys'](db[_0xe569('0x2a')]['rawAttributes']);_0x2b16ac[_0xe569('0x30')]=_[_0xe569('0x31')](_0x3f9a16['query']);_0x2b16ac[_0xe569('0x39')]=_[_0xe569('0x32')](_0x2b16ac[_0xe569('0x2e')],_0x2b16ac[_0xe569('0x30')]);_0x5ea13e[_0xe569('0x34')]=_[_0xe569('0x32')](_0x2b16ac[_0xe569('0x2e')],qs['fields'](_0x3f9a16['query'][_0xe569('0x33')]));_0x5ea13e[_0xe569('0x34')]=_0x5ea13e[_0xe569('0x34')]['length']?_0x5ea13e[_0xe569('0x34')]:_0x2b16ac[_0xe569('0x2e')];if(_0x3f9a16[_0xe569('0x30')][_0xe569('0x44')]){_0x5ea13e[_0xe569('0x3e')]=[{'all':!![]}];}_0x5ea13e=_[_0xe569('0x3b')]({},_0x5ea13e,_0x3f9a16[_0xe569('0x3d')]);return db['SalesforceAccount'][_0xe569('0x45')](_0x5ea13e)['then'](handleEntityNotFound(_0x6a903f,null))[_0xe569('0x24')](respondWithResult(_0x6a903f,null))[_0xe569('0x41')](handleError(_0x6a903f,null));};exports[_0xe569('0x46')]=function(_0x1214f8,_0x2befc5){return db[_0xe569('0x2a')]['create'](_0x1214f8[_0xe569('0x47')],{})[_0xe569('0x24')](respondWithResult(_0x2befc5,0xc9))[_0xe569('0x41')](handleError(_0x2befc5,null));};exports[_0xe569('0x23')]=function(_0x196325,_0x31f993){if(_0x196325[_0xe569('0x47')]['id']){delete _0x196325['body']['id'];}return db[_0xe569('0x2a')][_0xe569('0x45')]({'where':{'id':_0x196325[_0xe569('0x43')]['id']}})[_0xe569('0x24')](handleEntityNotFound(_0x31f993,null))[_0xe569('0x24')](saveUpdates(_0x196325['body'],null))['then'](respondWithResult(_0x31f993,null))[_0xe569('0x41')](handleError(_0x31f993,null));};exports[_0xe569('0x25')]=function(_0x239c9b,_0x5e27c3){return db[_0xe569('0x2a')]['find']({'where':{'id':_0x239c9b[_0xe569('0x43')]['id']}})[_0xe569('0x24')](handleEntityNotFound(_0x5e27c3,null))['then'](removeEntity(_0x5e27c3,null))[_0xe569('0x41')](handleError(_0x5e27c3,null));};exports[_0xe569('0x48')]=function(_0x4e8b6b,_0x1fb44b,_0x5595fe){var _0x9470bc={};var _0x3dd6bd={};var _0x15920f;var _0x5c8990;return db[_0xe569('0x2a')][_0xe569('0x49')]({'where':{'id':_0x4e8b6b['params']['id']}})[_0xe569('0x24')](handleEntityNotFound(_0x1fb44b,null))[_0xe569('0x24')](function(_0x46f803){if(_0x46f803){_0x15920f=_0x46f803;_0x3dd6bd[_0xe569('0x2e')]=_['keys'](db[_0xe569('0x4a')]['rawAttributes']);_0x3dd6bd[_0xe569('0x30')]=_[_0xe569('0x31')](_0x4e8b6b[_0xe569('0x30')]);_0x3dd6bd[_0xe569('0x39')]=_[_0xe569('0x32')](_0x3dd6bd[_0xe569('0x2e')],_0x3dd6bd[_0xe569('0x30')]);_0x9470bc[_0xe569('0x34')]=_[_0xe569('0x32')](_0x3dd6bd[_0xe569('0x2e')],qs['fields'](_0x4e8b6b[_0xe569('0x30')][_0xe569('0x33')]));_0x9470bc[_0xe569('0x34')]=_0x9470bc[_0xe569('0x34')][_0xe569('0x4b')]?_0x9470bc['attributes']:_0x3dd6bd[_0xe569('0x2e')];_0x9470bc[_0xe569('0x37')]=qs['sort'](_0x4e8b6b[_0xe569('0x30')]['sort']);_0x9470bc[_0xe569('0x3a')]=qs['filters'](_[_0xe569('0x4c')](_0x4e8b6b['query'],_0x3dd6bd[_0xe569('0x39')]));if(_0x4e8b6b['query']['filter']){_0x9470bc['where']=_['merge'](_0x9470bc[_0xe569('0x3a')],{'$or':_[_0xe569('0x4d')](_0x9470bc['attributes'],function(_0x1619fa){var _0x42f21b={};_0x42f21b[_0x1619fa]={'$like':'%'+_0x4e8b6b[_0xe569('0x30')]['filter']+'%'};return _0x42f21b;})});}_0x9470bc=_[_0xe569('0x3b')]({},_0x9470bc,_0x4e8b6b['options']);return _0x15920f[_0xe569('0x48')](_0x9470bc);}})[_0xe569('0x24')](function(_0x5d1712){if(_0x5d1712){_0x5c8990=_0x5d1712['length'];if(!_0x4e8b6b[_0xe569('0x30')][_0xe569('0x35')](_0xe569('0x36'))){_0x9470bc['limit']=qs[_0xe569('0x1e')](_0x4e8b6b[_0xe569('0x30')][_0xe569('0x1e')]);_0x9470bc[_0xe569('0x1c')]=qs[_0xe569('0x1c')](_0x4e8b6b[_0xe569('0x30')][_0xe569('0x1c')]);}return _0x15920f[_0xe569('0x48')](_0x9470bc);}})['then'](function(_0x69e06c){if(_0x69e06c){return _0x69e06c?{'count':_0x5c8990,'rows':_0x69e06c}:null;}})['then'](respondWithResult(_0x1fb44b,null))[_0xe569('0x41')](handleError(_0x1fb44b,null));};exports[_0xe569('0x4e')]=function(_0x57879e,_0x349b44,_0x1241c7){if(_0x57879e[_0xe569('0x47')]['id']){delete _0x57879e[_0xe569('0x47')]['id'];}return db[_0xe569('0x2a')][_0xe569('0x49')]({'where':{'id':_0x57879e[_0xe569('0x43')]['id']}})[_0xe569('0x24')](handleEntityNotFound(_0x349b44,null))['then'](function(_0x4af67c){if(_0x4af67c){_0x57879e[_0xe569('0x47')][_0xe569('0x4f')]=_0x4af67c['id'];_0x57879e['body'][_0xe569('0x50')]=integrations[_0xe569('0x51')](_0x57879e['body'][_0xe569('0x52')],_0x57879e[_0xe569('0x47')][_0xe569('0x2d')]);_0x57879e[_0xe569('0x47')]['Descriptions']=integrations[_0xe569('0x53')](_0x57879e[_0xe569('0x47')][_0xe569('0x52')],_0x57879e[_0xe569('0x47')][_0xe569('0x2d')]);return db[_0xe569('0x4a')][_0xe569('0x46')](_0x57879e['body'],{'include':[{'model':db['SalesforceField'],'as':_0xe569('0x50')},{'model':db[_0xe569('0x54')],'as':_0xe569('0x55')}]});}return null;})[_0xe569('0x24')](respondWithResult(_0x349b44,null))['catch'](handleError(_0x349b44,null));};exports[_0xe569('0x56')]=function(_0xf49400,_0x56b447,_0x45872b){var _0x285e57;var _0xc855bd='';var _0xa9ac75=_0xe569('0x57');return db['SalesforceAccount'][_0xe569('0x49')]({'where':{'id':_0xf49400[_0xe569('0x43')]['id']},'attributes':['id',_0xe569('0x58'),_0xe569('0x59'),_0xe569('0x5a'),_0xe569('0x5b'),'password',_0xe569('0x5c')]})['then'](handleEntityNotFound(_0x56b447,null))[_0xe569('0x24')](function(_0x398648){if(_0x398648){_0xc855bd=_0x398648[_0xe569('0x58')];var _0x579229=_0xc855bd[_0xe569('0x5d')](-0x1);if(_0x579229==='/'){_0xc855bd=_0xc855bd['substring'](0x0,_0xc855bd[_0xe569('0x5e')](_0x579229));}_0x285e57=new jsforce[(_0xe569('0x5f'))]({'oauth2':{'loginUrl':_0xc855bd,'clientId':_0x398648['clientId'],'clientSecret':_0x398648[_0xe569('0x5a')]}});return _0x285e57['login'](_0x398648[_0xe569('0x5b')],_0x398648['password']['concat'](_0x398648[_0xe569('0x5c')]));}})['then'](function(_0x3b411a){if(_0x3b411a){if(!_[_0xe569('0x60')](_0xf49400[_0xe569('0x30')][_0xe569('0x61')])){_0xa9ac75=_0xf49400[_0xe569('0x30')][_0xe569('0x61')];}return _0x285e57[_0xe569('0x62')](_0xa9ac75)['describe']();}})[_0xe569('0x24')](function(_0x3b9c62){var _0x36c452=[_0xe569('0x63'),_0xe569('0x64'),_0xe569('0x65'),_0xe569('0x66'),_0xe569('0x67'),_0xe569('0x68')];var _0x45ed73=[_0xe569('0x69'),_0xe569('0x6a'),_0xe569('0x6b'),_0xe569('0x6c'),_0xe569('0x6d'),_0xe569('0x6e'),'phone'];if(_0x3b9c62){_[_0xe569('0x6f')](_0x3b9c62['fields'],function(_0x191391){return _0x36c452[_0xe569('0x70')](_0x191391['name'])||!_0x45ed73['includes'](_0x191391[_0xe569('0x2d')]);});return{'count':_0x3b9c62['fields'][_0xe569('0x4b')],'rows':_[_0xe569('0x4d')](_0x3b9c62[_0xe569('0x33')],function(_0x16ae49){return{'id':_0x16ae49[_0xe569('0x2f')],'name':_0x16ae49[_0xe569('0x71')],'custom':_0x16ae49[_0xe569('0x72')],'options':_0x16ae49[_0xe569('0x73')]['length']>0x0?_[_0xe569('0x4d')](_0x16ae49[_0xe569('0x73')],function(_0x48432d){return{'name':_0x48432d[_0xe569('0x71')],'value':_0x48432d[_0xe569('0x74')]};}):_0x16ae49[_0xe569('0x2d')]=='boolean'?[{'name':_0xe569('0x75'),'value':_0xe569('0x76')},{'name':'False','value':_0xe569('0x77')}]:[]};})};}})[_0xe569('0x24')](respondWithResult(_0x56b447,null))[_0xe569('0x41')](function(_0x15809a){var _0x38b2a1=_0xf49400[_0xe569('0x30')][_0xe569('0x78')]?0x1f4:_0x15809a[_0xe569('0x79')]||0x1f4;logger[_0xe569('0x28')](_0xe569('0x7a'),_0xe569('0x56'),_0x38b2a1,JSON[_0xe569('0x7b')](_0x15809a));delete _0x15809a[_0xe569('0x2f')];if(_0x38b2a1===0x191){_0x38b2a1=0x190;}_0x56b447[_0xe569('0x1a')](_0x38b2a1)[_0xe569('0x7c')](_0xf49400[_0xe569('0x30')]['test']?{'message':_0xe569('0x7d'),'statusCode':_0x15809a[_0xe569('0x79')]}:_0x15809a);});}; \ No newline at end of file +var _0x489f=['update','destroy','then','error','stack','name','send','index','SalesforceAccount','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','getConfigurations','SalesforceConfiguration','nolimit','findOne','AccountId','getSubjects','channel','SalesforceField','getFields','Task','clientId','password','securityToken','slice','lastIndexOf','Connection','clientSecret','login','username','concat','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','int','picklist','boolean','email','textarea','phone','remove','includes','custom','picklistValues','label','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save'];(function(_0x300868,_0x15c7ab){var _0x129d72=function(_0x3ffd99){while(--_0x3ffd99){_0x300868['push'](_0x300868['shift']());}};_0x129d72(++_0x15c7ab);}(_0x489f,0xd4));var _0xf489=function(_0x320df0,_0x25de28){_0x320df0=_0x320df0-0x0;var _0x3a34c9=_0x489f[_0x320df0];return _0x3a34c9;};'use strict';var emlformat=require(_0xf489('0x0'));var rimraf=require(_0xf489('0x1'));var zipdir=require(_0xf489('0x2'));var jsonpatch=require(_0xf489('0x3'));var rp=require('request-promise');var moment=require(_0xf489('0x4'));var BPromise=require(_0xf489('0x5'));var Mustache=require('mustache');var util=require(_0xf489('0x6'));var path=require(_0xf489('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf489('0x8'));var fs=require('fs');var fs_extra=require(_0xf489('0x9'));var _=require(_0xf489('0xa'));var squel=require(_0xf489('0xb'));var crypto=require(_0xf489('0xc'));var jsforce=require(_0xf489('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf489('0xe'));var Papa=require('papaparse');var Redis=require(_0xf489('0xf'));var authService=require(_0xf489('0x10'));var qs=require(_0xf489('0x11'));var as=require(_0xf489('0x12'));var hardwareService=require(_0xf489('0x13'));var logger=require(_0xf489('0x14'))('api');var utils=require(_0xf489('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf489('0x16'));var db=require(_0xf489('0x17'))['db'];var integrations=require(_0xf489('0x18'));function respondWithStatusCode(_0x14a021,_0x2551f2){_0x2551f2=_0x2551f2||0xcc;return function(_0x1317c7){if(_0x1317c7){return _0x14a021[_0xf489('0x19')](_0x2551f2);}return _0x14a021[_0xf489('0x1a')](_0x2551f2)[_0xf489('0x1b')]();};}function respondWithResult(_0xc77da3,_0x59b7f5){_0x59b7f5=_0x59b7f5||0xc8;return function(_0x511e70){if(_0x511e70){return _0xc77da3['status'](_0x59b7f5)[_0xf489('0x1c')](_0x511e70);}};}function respondWithFilteredResult(_0x56a4a3,_0x540782){return function(_0x414c96){if(_0x414c96){var _0x1248ad=typeof _0x540782[_0xf489('0x1d')]===_0xf489('0x1e')&&typeof _0x540782[_0xf489('0x1f')]===_0xf489('0x1e');var _0x458755=_0x414c96['count'];var _0xdfd8d3=_0x1248ad?0x0:_0x540782[_0xf489('0x1d')];var _0x3f4b6e=_0x1248ad?_0x414c96['count']:_0x540782[_0xf489('0x1d')]+_0x540782['limit'];var _0x5abd4d;if(_0x3f4b6e>=_0x458755){_0x3f4b6e=_0x458755;_0x5abd4d=0xc8;}else{_0x5abd4d=0xce;}_0x56a4a3['status'](_0x5abd4d);return _0x56a4a3[_0xf489('0x20')](_0xf489('0x21'),_0xdfd8d3+'-'+_0x3f4b6e+'/'+_0x458755)[_0xf489('0x1c')](_0x414c96);}return null;};}function patchUpdates(_0x5a8e52){return function(_0x3d468d){try{jsonpatch['apply'](_0x3d468d,_0x5a8e52,!![]);}catch(_0x7e0b84){return BPromise[_0xf489('0x22')](_0x7e0b84);}return _0x3d468d[_0xf489('0x23')]();};}function saveUpdates(_0x42ec96,_0x2e80c8){return function(_0x1b995c){if(_0x1b995c){return _0x1b995c[_0xf489('0x24')](_0x42ec96)['then'](function(_0x1734c2){return _0x1734c2;});}return null;};}function removeEntity(_0x318b2f,_0x7d8682){return function(_0x115b39){if(_0x115b39){return _0x115b39[_0xf489('0x25')]()[_0xf489('0x26')](function(){_0x318b2f['status'](0xcc)[_0xf489('0x1b')]();});}};}function handleEntityNotFound(_0x5699cd,_0x16c814){return function(_0x38480d){if(!_0x38480d){_0x5699cd[_0xf489('0x19')](0x194);}return _0x38480d;};}function handleError(_0x1df784,_0x2bdbab){_0x2bdbab=_0x2bdbab||0x1f4;return function(_0x7a0ba4){logger[_0xf489('0x27')](_0x7a0ba4[_0xf489('0x28')]);if(_0x7a0ba4[_0xf489('0x29')]){delete _0x7a0ba4[_0xf489('0x29')];}_0x1df784[_0xf489('0x1a')](_0x2bdbab)[_0xf489('0x2a')](_0x7a0ba4);};}exports[_0xf489('0x2b')]=function(_0x36fd0d,_0x21decf){var _0x1ff620={},_0x16b87b={},_0x4f4574={'count':0x0,'rows':[]};var _0x17f4ea=_['map'](db[_0xf489('0x2c')][_0xf489('0x2d')],function(_0xf56056){return{'name':_0xf56056['fieldName'],'type':_0xf56056['type'][_0xf489('0x2e')]};});_0x16b87b[_0xf489('0x2f')]=_[_0xf489('0x30')](_0x17f4ea,_0xf489('0x29'));_0x16b87b[_0xf489('0x31')]=_[_0xf489('0x32')](_0x36fd0d[_0xf489('0x31')]);_0x16b87b[_0xf489('0x33')]=_[_0xf489('0x34')](_0x16b87b[_0xf489('0x2f')],_0x16b87b[_0xf489('0x31')]);_0x1ff620[_0xf489('0x35')]=_[_0xf489('0x34')](_0x16b87b[_0xf489('0x2f')],qs['fields'](_0x36fd0d['query'][_0xf489('0x36')]));_0x1ff620[_0xf489('0x35')]=_0x1ff620[_0xf489('0x35')][_0xf489('0x37')]?_0x1ff620[_0xf489('0x35')]:_0x16b87b['model'];if(!_0x36fd0d[_0xf489('0x31')][_0xf489('0x38')]('nolimit')){_0x1ff620[_0xf489('0x1f')]=qs['limit'](_0x36fd0d[_0xf489('0x31')][_0xf489('0x1f')]);_0x1ff620[_0xf489('0x1d')]=qs['offset'](_0x36fd0d[_0xf489('0x31')]['offset']);}_0x1ff620[_0xf489('0x39')]=qs[_0xf489('0x3a')](_0x36fd0d['query'][_0xf489('0x3a')]);_0x1ff620[_0xf489('0x3b')]=qs['filters'](_[_0xf489('0x3c')](_0x36fd0d[_0xf489('0x31')],_0x16b87b[_0xf489('0x33')]),_0x17f4ea);if(_0x36fd0d[_0xf489('0x31')]['filter']){_0x1ff620['where']=_['merge'](_0x1ff620[_0xf489('0x3b')],{'$or':_[_0xf489('0x30')](_0x17f4ea,function(_0x551062){if(_0x551062[_0xf489('0x3d')]!==_0xf489('0x3e')){var _0x3b800b={};_0x3b800b[_0x551062[_0xf489('0x29')]]={'$like':'%'+_0x36fd0d[_0xf489('0x31')][_0xf489('0x3f')]+'%'};return _0x3b800b;}})});}_0x1ff620=_['merge']({},_0x1ff620,_0x36fd0d[_0xf489('0x40')]);var _0x486a7e={'where':_0x1ff620[_0xf489('0x3b')]};return db['SalesforceAccount'][_0xf489('0x41')](_0x486a7e)[_0xf489('0x26')](function(_0x138d39){_0x4f4574['count']=_0x138d39;if(_0x36fd0d['query'][_0xf489('0x42')]){_0x1ff620[_0xf489('0x43')]=[{'all':!![]}];}return db[_0xf489('0x2c')][_0xf489('0x44')](_0x1ff620);})[_0xf489('0x26')](function(_0x26a854){_0x4f4574[_0xf489('0x45')]=_0x26a854;return _0x4f4574;})[_0xf489('0x26')](respondWithFilteredResult(_0x21decf,_0x1ff620))[_0xf489('0x46')](handleError(_0x21decf,null));};exports[_0xf489('0x47')]=function(_0x55ffb5,_0x105ef5){var _0x1c41e9={'raw':![],'where':{'id':_0x55ffb5[_0xf489('0x48')]['id']}},_0x47b534={};_0x47b534[_0xf489('0x2f')]=_[_0xf489('0x32')](db[_0xf489('0x2c')][_0xf489('0x2d')]);_0x47b534[_0xf489('0x31')]=_['keys'](_0x55ffb5[_0xf489('0x31')]);_0x47b534['filters']=_['intersection'](_0x47b534['model'],_0x47b534[_0xf489('0x31')]);_0x1c41e9[_0xf489('0x35')]=_[_0xf489('0x34')](_0x47b534[_0xf489('0x2f')],qs['fields'](_0x55ffb5['query'][_0xf489('0x36')]));_0x1c41e9[_0xf489('0x35')]=_0x1c41e9[_0xf489('0x35')][_0xf489('0x37')]?_0x1c41e9[_0xf489('0x35')]:_0x47b534[_0xf489('0x2f')];if(_0x55ffb5['query']['includeAll']){_0x1c41e9['include']=[{'all':!![]}];}_0x1c41e9=_[_0xf489('0x49')]({},_0x1c41e9,_0x55ffb5[_0xf489('0x40')]);return db['SalesforceAccount'][_0xf489('0x4a')](_0x1c41e9)[_0xf489('0x26')](handleEntityNotFound(_0x105ef5,null))[_0xf489('0x26')](respondWithResult(_0x105ef5,null))['catch'](handleError(_0x105ef5,null));};exports['create']=function(_0x12117d,_0x25cd03){return db['SalesforceAccount'][_0xf489('0x4b')](_0x12117d[_0xf489('0x4c')],{})[_0xf489('0x26')](respondWithResult(_0x25cd03,0xc9))[_0xf489('0x46')](handleError(_0x25cd03,null));};exports[_0xf489('0x24')]=function(_0x1e2688,_0x3671f3){if(_0x1e2688[_0xf489('0x4c')]['id']){delete _0x1e2688['body']['id'];}return db[_0xf489('0x2c')]['find']({'where':{'id':_0x1e2688[_0xf489('0x48')]['id']}})[_0xf489('0x26')](handleEntityNotFound(_0x3671f3,null))[_0xf489('0x26')](saveUpdates(_0x1e2688[_0xf489('0x4c')],null))['then'](respondWithResult(_0x3671f3,null))[_0xf489('0x46')](handleError(_0x3671f3,null));};exports['destroy']=function(_0x5a6c15,_0x5d80d6){return db['SalesforceAccount'][_0xf489('0x4a')]({'where':{'id':_0x5a6c15[_0xf489('0x48')]['id']}})[_0xf489('0x26')](handleEntityNotFound(_0x5d80d6,null))[_0xf489('0x26')](removeEntity(_0x5d80d6,null))[_0xf489('0x46')](handleError(_0x5d80d6,null));};exports[_0xf489('0x4d')]=function(_0x2103e8,_0x5d969b,_0x365718){var _0x26d2ea={};var _0x4c944d={};var _0x2b625a;var _0x55159b;return db['SalesforceAccount']['findOne']({'where':{'id':_0x2103e8[_0xf489('0x48')]['id']}})['then'](handleEntityNotFound(_0x5d969b,null))[_0xf489('0x26')](function(_0x2007c9){if(_0x2007c9){_0x2b625a=_0x2007c9;_0x4c944d[_0xf489('0x2f')]=_[_0xf489('0x32')](db[_0xf489('0x4e')][_0xf489('0x2d')]);_0x4c944d[_0xf489('0x31')]=_[_0xf489('0x32')](_0x2103e8[_0xf489('0x31')]);_0x4c944d[_0xf489('0x33')]=_['intersection'](_0x4c944d['model'],_0x4c944d['query']);_0x26d2ea[_0xf489('0x35')]=_[_0xf489('0x34')](_0x4c944d[_0xf489('0x2f')],qs[_0xf489('0x36')](_0x2103e8['query'][_0xf489('0x36')]));_0x26d2ea[_0xf489('0x35')]=_0x26d2ea[_0xf489('0x35')][_0xf489('0x37')]?_0x26d2ea[_0xf489('0x35')]:_0x4c944d[_0xf489('0x2f')];_0x26d2ea['order']=qs[_0xf489('0x3a')](_0x2103e8[_0xf489('0x31')]['sort']);_0x26d2ea[_0xf489('0x3b')]=qs[_0xf489('0x33')](_[_0xf489('0x3c')](_0x2103e8[_0xf489('0x31')],_0x4c944d[_0xf489('0x33')]));if(_0x2103e8[_0xf489('0x31')]['filter']){_0x26d2ea[_0xf489('0x3b')]=_[_0xf489('0x49')](_0x26d2ea['where'],{'$or':_[_0xf489('0x30')](_0x26d2ea[_0xf489('0x35')],function(_0x8f9329){var _0x2f8dcc={};_0x2f8dcc[_0x8f9329]={'$like':'%'+_0x2103e8[_0xf489('0x31')][_0xf489('0x3f')]+'%'};return _0x2f8dcc;})});}_0x26d2ea=_[_0xf489('0x49')]({},_0x26d2ea,_0x2103e8['options']);return _0x2b625a[_0xf489('0x4d')](_0x26d2ea);}})[_0xf489('0x26')](function(_0x362830){if(_0x362830){_0x55159b=_0x362830[_0xf489('0x37')];if(!_0x2103e8[_0xf489('0x31')][_0xf489('0x38')](_0xf489('0x4f'))){_0x26d2ea[_0xf489('0x1f')]=qs[_0xf489('0x1f')](_0x2103e8[_0xf489('0x31')]['limit']);_0x26d2ea['offset']=qs['offset'](_0x2103e8[_0xf489('0x31')][_0xf489('0x1d')]);}return _0x2b625a[_0xf489('0x4d')](_0x26d2ea);}})[_0xf489('0x26')](function(_0x19541d){if(_0x19541d){return _0x19541d?{'count':_0x55159b,'rows':_0x19541d}:null;}})[_0xf489('0x26')](respondWithResult(_0x5d969b,null))[_0xf489('0x46')](handleError(_0x5d969b,null));};exports['addConfiguration']=function(_0xbf1770,_0x535caa,_0x55b6be){if(_0xbf1770['body']['id']){delete _0xbf1770[_0xf489('0x4c')]['id'];}return db[_0xf489('0x2c')][_0xf489('0x50')]({'where':{'id':_0xbf1770[_0xf489('0x48')]['id']}})[_0xf489('0x26')](handleEntityNotFound(_0x535caa,null))[_0xf489('0x26')](function(_0x3553e3){if(_0x3553e3){_0xbf1770[_0xf489('0x4c')][_0xf489('0x51')]=_0x3553e3['id'];_0xbf1770[_0xf489('0x4c')]['Subjects']=integrations[_0xf489('0x52')](_0xbf1770[_0xf489('0x4c')][_0xf489('0x53')],_0xbf1770[_0xf489('0x4c')][_0xf489('0x3d')]);_0xbf1770[_0xf489('0x4c')]['Descriptions']=integrations['getDescriptions'](_0xbf1770[_0xf489('0x4c')][_0xf489('0x53')],_0xbf1770['body']['type']);return db[_0xf489('0x4e')][_0xf489('0x4b')](_0xbf1770[_0xf489('0x4c')],{'include':[{'model':db[_0xf489('0x54')],'as':'Subjects'},{'model':db[_0xf489('0x54')],'as':'Descriptions'}]});}return null;})[_0xf489('0x26')](respondWithResult(_0x535caa,null))['catch'](handleError(_0x535caa,null));};exports[_0xf489('0x55')]=function(_0x1d5dc0,_0x1d1926,_0x300726){var _0x348ecc;var _0x59a864='';var _0x200a56=_0xf489('0x56');return db[_0xf489('0x2c')][_0xf489('0x50')]({'where':{'id':_0x1d5dc0[_0xf489('0x48')]['id']},'attributes':['id','remoteUri',_0xf489('0x57'),'clientSecret','username',_0xf489('0x58'),_0xf489('0x59')]})[_0xf489('0x26')](handleEntityNotFound(_0x1d1926,null))[_0xf489('0x26')](function(_0x2bb4ec){if(_0x2bb4ec){_0x59a864=_0x2bb4ec['remoteUri'];var _0x3c789f=_0x59a864[_0xf489('0x5a')](-0x1);if(_0x3c789f==='/'){_0x59a864=_0x59a864['substring'](0x0,_0x59a864[_0xf489('0x5b')](_0x3c789f));}_0x348ecc=new jsforce[(_0xf489('0x5c'))]({'oauth2':{'loginUrl':_0x59a864,'clientId':_0x2bb4ec['clientId'],'clientSecret':_0x2bb4ec[_0xf489('0x5d')]}});return _0x348ecc[_0xf489('0x5e')](_0x2bb4ec[_0xf489('0x5f')],_0x2bb4ec[_0xf489('0x58')][_0xf489('0x60')](_0x2bb4ec[_0xf489('0x59')]));}})[_0xf489('0x26')](function(_0x51c909){if(_0x51c909){if(!_['isNil'](_0x1d5dc0[_0xf489('0x31')][_0xf489('0x61')])){_0x200a56=_0x1d5dc0[_0xf489('0x31')][_0xf489('0x61')];}return _0x348ecc['sobject'](_0x200a56)[_0xf489('0x62')]();}})[_0xf489('0x26')](function(_0x25e9cc){var _0x67ceab=[_0xf489('0x63'),_0xf489('0x64'),_0xf489('0x65'),_0xf489('0x66'),'Subject',_0xf489('0x67')];var _0x58e6a0=[_0xf489('0x68'),_0xf489('0x69'),_0xf489('0x6a'),_0xf489('0x6b'),_0xf489('0x6c'),_0xf489('0x6d'),_0xf489('0x6e')];if(_0x25e9cc){_[_0xf489('0x6f')](_0x25e9cc[_0xf489('0x36')],function(_0x475648){return _0x67ceab[_0xf489('0x70')](_0x475648['name'])||!_0x58e6a0[_0xf489('0x70')](_0x475648['type']);});return{'count':_0x25e9cc[_0xf489('0x36')][_0xf489('0x37')],'rows':_[_0xf489('0x30')](_0x25e9cc[_0xf489('0x36')],function(_0x4b2632){return{'id':_0x4b2632[_0xf489('0x29')],'name':_0x4b2632['label'],'custom':_0x4b2632[_0xf489('0x71')],'options':_0x4b2632[_0xf489('0x72')][_0xf489('0x37')]>0x0?_['map'](_0x4b2632[_0xf489('0x72')],function(_0x327511){return{'name':_0x327511[_0xf489('0x73')],'value':_0x327511['value']};}):_0x4b2632[_0xf489('0x3d')]==_0xf489('0x6b')?[{'name':_0xf489('0x74'),'value':_0xf489('0x75')},{'name':_0xf489('0x76'),'value':_0xf489('0x77')}]:[]};})};}})[_0xf489('0x26')](respondWithResult(_0x1d1926,null))[_0xf489('0x46')](function(_0x1ee858){var _0x42f874=_0x1d5dc0['query']['test']?0x1f4:_0x1ee858[_0xf489('0x78')]||0x1f4;logger[_0xf489('0x27')](_0xf489('0x79'),_0xf489('0x55'),_0x42f874,JSON['stringify'](_0x1ee858));delete _0x1ee858[_0xf489('0x29')];if(_0x42f874===0x191){_0x42f874=0x190;}_0x1d1926[_0xf489('0x1a')](_0x42f874)[_0xf489('0x2a')](_0x1d5dc0[_0xf489('0x31')][_0xf489('0x7a')]?{'message':_0xf489('0x7b'),'statusCode':_0x1ee858[_0xf489('0x78')]}:_0x1ee858);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 809f6d1..0e5f6b0 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 _0x072c=['util','../../config/logger','bluebird','request-promise','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','int_salesforce_accounts'];(function(_0x50703b,_0x2532cb){var _0x5bed36=function(_0x18e3a5){while(--_0x18e3a5){_0x50703b['push'](_0x50703b['shift']());}};_0x5bed36(++_0x2532cb);}(_0x072c,0x10e));var _0xc072=function(_0x54399e,_0x2aeaa8){_0x54399e=_0x54399e-0x0;var _0xecbebf=_0x072c[_0x54399e];return _0xecbebf;};'use strict';var _=require('lodash');var util=require(_0xc072('0x0'));var logger=require(_0xc072('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc072('0x2'));var rp=require(_0xc072('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc072('0x4'));var attributes=require(_0xc072('0x5'));var integrations=require(_0xc072('0x6'));module[_0xc072('0x7')]=function(_0x27514c,_0x5388b0){return _0x27514c['define']('SalesforceAccount',attributes,{'tableName':_0xc072('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf9a=['rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x9fc17,_0x23c0ab){var _0x33e21c=function(_0x465e4c){while(--_0x465e4c){_0x9fc17['push'](_0x9fc17['shift']());}};_0x33e21c(++_0x23c0ab);}(_0xbf9a,0x7e));var _0xabf9=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xbf9a[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xabf9('0x0'));var util=require('util');var logger=require(_0xabf9('0x1'))(_0xabf9('0x2'));var moment=require(_0xabf9('0x3'));var BPromise=require('bluebird');var rp=require(_0xabf9('0x4'));var fs=require('fs');var path=require(_0xabf9('0x5'));var rimraf=require(_0xabf9('0x6'));var config=require(_0xabf9('0x7'));var attributes=require(_0xabf9('0x8'));var integrations=require(_0xabf9('0x9'));module['exports']=function(_0x1848dc,_0xb73b5a){return _0x1848dc[_0xabf9('0xa')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 0d55b9d..83d72af 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 _0xe091=['then','info','request\x20sent','debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','GetSalesforceAccount','SalesforceAccount','options','raw','attributes','limit','include','map','model','catch','ShowSalesforceAccount','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x257e8f,_0xdc7fc9){var _0x2d8b1e=function(_0x24739a){while(--_0x24739a){_0x257e8f['push'](_0x257e8f['shift']());}};_0x2d8b1e(++_0xdc7fc9);}(_0xe091,0x1ad));var _0x1e09=function(_0x19ec02,_0x222aff){_0x19ec02=_0x19ec02-0x0;var _0x1c8fb0=_0xe091[_0x19ec02];return _0x1c8fb0;};'use strict';var _=require(_0x1e09('0x0'));var util=require(_0x1e09('0x1'));var moment=require(_0x1e09('0x2'));var BPromise=require('bluebird');var rs=require(_0x1e09('0x3'));var fs=require('fs');var Redis=require(_0x1e09('0x4'));var db=require(_0x1e09('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e09('0x6'))(_0x1e09('0x7'));var config=require(_0x1e09('0x8'));var jayson=require(_0x1e09('0x9'));var client=jayson[_0x1e09('0xa')][_0x1e09('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dbe36,_0x3aa5ae,_0x521372){return new BPromise(function(_0x260b33,_0x97eefb){return client[_0x1e09('0xc')](_0x2dbe36,_0x521372)[_0x1e09('0xd')](function(_0x10bc96){logger[_0x1e09('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x3aa5ae,_0x1e09('0xf'));logger[_0x1e09('0x10')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3aa5ae,_0x1e09('0xf'),JSON[_0x1e09('0x11')](_0x10bc96));if(_0x10bc96[_0x1e09('0x12')]){if(_0x10bc96['error'][_0x1e09('0x13')]===0x1f4){logger['error'](_0x1e09('0x14'),_0x3aa5ae,_0x10bc96[_0x1e09('0x12')][_0x1e09('0x15')]);return _0x97eefb(_0x10bc96[_0x1e09('0x12')][_0x1e09('0x15')]);}logger[_0x1e09('0x12')](_0x1e09('0x14'),_0x3aa5ae,_0x10bc96['error'][_0x1e09('0x15')]);return _0x260b33(_0x10bc96[_0x1e09('0x12')]['message']);}else{logger['info'](_0x1e09('0x14'),_0x3aa5ae,_0x1e09('0xf'));_0x260b33(_0x10bc96['result'][_0x1e09('0x15')]);}})['catch'](function(_0x42455e){logger[_0x1e09('0x12')](_0x1e09('0x14'),_0x3aa5ae,_0x42455e);_0x97eefb(_0x42455e);});});}exports[_0x1e09('0x16')]=function(_0x3408a3){var _0x204cbb=this;return new Promise(function(_0x1062e3,_0x1ac872){return db[_0x1e09('0x17')]['findAll']({'raw':_0x3408a3[_0x1e09('0x18')]?_0x3408a3[_0x1e09('0x18')][_0x1e09('0x19')]===undefined?!![]:![]:!![],'where':_0x3408a3[_0x1e09('0x18')]?_0x3408a3[_0x1e09('0x18')]['where']||null:null,'attributes':_0x3408a3[_0x1e09('0x18')]?_0x3408a3[_0x1e09('0x18')][_0x1e09('0x1a')]||null:null,'limit':_0x3408a3['options']?_0x3408a3[_0x1e09('0x18')][_0x1e09('0x1b')]||null:null,'include':_0x3408a3['options']?_0x3408a3[_0x1e09('0x18')][_0x1e09('0x1c')]?_[_0x1e09('0x1d')](_0x3408a3[_0x1e09('0x18')][_0x1e09('0x1c')],function(_0x2c1c08){return{'model':db[_0x2c1c08['model']],'as':_0x2c1c08['as'],'attributes':_0x2c1c08[_0x1e09('0x1a')],'include':_0x2c1c08[_0x1e09('0x1c')]?_[_0x1e09('0x1d')](_0x2c1c08['include'],function(_0x34f935){return{'model':db[_0x34f935[_0x1e09('0x1e')]],'as':_0x34f935['as'],'attributes':_0x34f935['attributes'],'include':_0x34f935[_0x1e09('0x1c')]?_['map'](_0x34f935[_0x1e09('0x1c')],function(_0x39b7b9){return{'model':db[_0x39b7b9[_0x1e09('0x1e')]],'as':_0x39b7b9['as'],'attributes':_0x39b7b9[_0x1e09('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x1e09('0xd')](function(_0xa6fc32){logger['info'](_0x1e09('0x16'),_0x3408a3);logger[_0x1e09('0x10')](_0x1e09('0x16'),_0x3408a3,JSON[_0x1e09('0x11')](_0xa6fc32));_0x1062e3(_0xa6fc32);})[_0x1e09('0x1f')](function(_0x428dc4){logger[_0x1e09('0x12')](_0x1e09('0x16'),_0x428dc4[_0x1e09('0x15')],_0x3408a3);_0x1ac872(_0x204cbb[_0x1e09('0x12')](0x1f4,_0x428dc4[_0x1e09('0x15')]));});});};exports[_0x1e09('0x20')]=function(_0x7c9616){var _0x436c5e=this;return new Promise(function(_0x588f5b,_0x2af33f){return db[_0x1e09('0x17')]['find']({'raw':_0x7c9616[_0x1e09('0x18')]?_0x7c9616['options'][_0x1e09('0x19')]===undefined?!![]:![]:!![],'where':_0x7c9616['options']?_0x7c9616[_0x1e09('0x18')][_0x1e09('0x21')]||null:null,'attributes':_0x7c9616[_0x1e09('0x18')]?_0x7c9616[_0x1e09('0x18')]['attributes']||null:null,'include':_0x7c9616['options']?_0x7c9616['options'][_0x1e09('0x1c')]?_[_0x1e09('0x1d')](_0x7c9616['options'][_0x1e09('0x1c')],function(_0x4ec592){return{'model':db[_0x4ec592[_0x1e09('0x1e')]],'as':_0x4ec592['as'],'attributes':_0x4ec592[_0x1e09('0x1a')],'include':_0x4ec592[_0x1e09('0x1c')]?_[_0x1e09('0x1d')](_0x4ec592[_0x1e09('0x1c')],function(_0x164939){return{'model':db[_0x164939[_0x1e09('0x1e')]],'as':_0x164939['as'],'attributes':_0x164939['attributes'],'include':_0x164939['include']?_[_0x1e09('0x1d')](_0x164939[_0x1e09('0x1c')],function(_0x52d6f9){return{'model':db[_0x52d6f9[_0x1e09('0x1e')]],'as':_0x52d6f9['as'],'attributes':_0x52d6f9[_0x1e09('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x55fe3e){logger[_0x1e09('0xe')]('ShowSalesforceAccount',_0x7c9616);logger[_0x1e09('0x10')](_0x1e09('0x20'),_0x7c9616,JSON['stringify'](_0x55fe3e));_0x588f5b(_0x55fe3e);})[_0x1e09('0x1f')](function(_0x457e53){logger[_0x1e09('0x12')](_0x1e09('0x20'),_0x457e53[_0x1e09('0x15')],_0x7c9616);_0x2af33f(_0x436c5e[_0x1e09('0x12')](0x1f4,_0x457e53[_0x1e09('0x15')]));});});}; \ No newline at end of file +var _0xc1c6=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','include','map','attributes','model','stringify','ShowSalesforceAccount','find','raw','lodash','moment'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0xc1c6,0xd0));var _0x6c1c=function(_0x3168ed,_0x105719){_0x3168ed=_0x3168ed-0x0;var _0x2e7550=_0xc1c6[_0x3168ed];return _0x2e7550;};'use strict';var _=require(_0x6c1c('0x0'));var util=require('util');var moment=require(_0x6c1c('0x1'));var BPromise=require(_0x6c1c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c1c('0x3'));var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))(_0x6c1c('0x7'));var config=require(_0x6c1c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6c1c('0x9')][_0x6c1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34b382,_0x2df10e,_0x4e15b6){return new BPromise(function(_0x331fb5,_0x5da5b0){return client['request'](_0x34b382,_0x4e15b6)[_0x6c1c('0xb')](function(_0x3ffdca){logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0x2df10e,_0x6c1c('0xe'));logger[_0x6c1c('0xf')](_0x6c1c('0x10'),_0x2df10e,_0x6c1c('0xe'),JSON['stringify'](_0x3ffdca));if(_0x3ffdca[_0x6c1c('0x11')]){if(_0x3ffdca[_0x6c1c('0x11')][_0x6c1c('0x12')]===0x1f4){logger[_0x6c1c('0x11')](_0x6c1c('0xd'),_0x2df10e,_0x3ffdca[_0x6c1c('0x11')][_0x6c1c('0x13')]);return _0x5da5b0(_0x3ffdca[_0x6c1c('0x11')][_0x6c1c('0x13')]);}logger[_0x6c1c('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x2df10e,_0x3ffdca[_0x6c1c('0x11')][_0x6c1c('0x13')]);return _0x331fb5(_0x3ffdca['error'][_0x6c1c('0x13')]);}else{logger['info'](_0x6c1c('0xd'),_0x2df10e,_0x6c1c('0xe'));_0x331fb5(_0x3ffdca['result']['message']);}})[_0x6c1c('0x14')](function(_0x29617c){logger[_0x6c1c('0x11')](_0x6c1c('0xd'),_0x2df10e,_0x29617c);_0x5da5b0(_0x29617c);});});}exports[_0x6c1c('0x15')]=function(_0xda41bc){var _0x44fadc=this;return new Promise(function(_0x4ddf01,_0x4e508f){return db[_0x6c1c('0x16')][_0x6c1c('0x17')]({'raw':_0xda41bc[_0x6c1c('0x18')]?_0xda41bc['options']['raw']===undefined?!![]:![]:!![],'where':_0xda41bc[_0x6c1c('0x18')]?_0xda41bc['options'][_0x6c1c('0x19')]||null:null,'attributes':_0xda41bc[_0x6c1c('0x18')]?_0xda41bc[_0x6c1c('0x18')]['attributes']||null:null,'limit':_0xda41bc[_0x6c1c('0x18')]?_0xda41bc[_0x6c1c('0x18')][_0x6c1c('0x1a')]||null:null,'include':_0xda41bc['options']?_0xda41bc[_0x6c1c('0x18')][_0x6c1c('0x1b')]?_[_0x6c1c('0x1c')](_0xda41bc['options'][_0x6c1c('0x1b')],function(_0xdba07d){return{'model':db[_0xdba07d['model']],'as':_0xdba07d['as'],'attributes':_0xdba07d[_0x6c1c('0x1d')],'include':_0xdba07d[_0x6c1c('0x1b')]?_[_0x6c1c('0x1c')](_0xdba07d[_0x6c1c('0x1b')],function(_0x31af49){return{'model':db[_0x31af49[_0x6c1c('0x1e')]],'as':_0x31af49['as'],'attributes':_0x31af49[_0x6c1c('0x1d')],'include':_0x31af49['include']?_[_0x6c1c('0x1c')](_0x31af49[_0x6c1c('0x1b')],function(_0x449dbe){return{'model':db[_0x449dbe[_0x6c1c('0x1e')]],'as':_0x449dbe['as'],'attributes':_0x449dbe[_0x6c1c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6c1c('0xb')](function(_0x2c2471){logger[_0x6c1c('0xc')](_0x6c1c('0x15'),_0xda41bc);logger['debug'](_0x6c1c('0x15'),_0xda41bc,JSON[_0x6c1c('0x1f')](_0x2c2471));_0x4ddf01(_0x2c2471);})[_0x6c1c('0x14')](function(_0x1873b9){logger[_0x6c1c('0x11')](_0x6c1c('0x15'),_0x1873b9[_0x6c1c('0x13')],_0xda41bc);_0x4e508f(_0x44fadc[_0x6c1c('0x11')](0x1f4,_0x1873b9['message']));});});};exports[_0x6c1c('0x20')]=function(_0x3f5000){var _0x54f8ae=this;return new Promise(function(_0x1ff8b1,_0x578687){return db[_0x6c1c('0x16')][_0x6c1c('0x21')]({'raw':_0x3f5000[_0x6c1c('0x18')]?_0x3f5000[_0x6c1c('0x18')][_0x6c1c('0x22')]===undefined?!![]:![]:!![],'where':_0x3f5000['options']?_0x3f5000[_0x6c1c('0x18')][_0x6c1c('0x19')]||null:null,'attributes':_0x3f5000['options']?_0x3f5000[_0x6c1c('0x18')][_0x6c1c('0x1d')]||null:null,'include':_0x3f5000[_0x6c1c('0x18')]?_0x3f5000[_0x6c1c('0x18')][_0x6c1c('0x1b')]?_[_0x6c1c('0x1c')](_0x3f5000[_0x6c1c('0x18')][_0x6c1c('0x1b')],function(_0x354029){return{'model':db[_0x354029[_0x6c1c('0x1e')]],'as':_0x354029['as'],'attributes':_0x354029[_0x6c1c('0x1d')],'include':_0x354029['include']?_['map'](_0x354029[_0x6c1c('0x1b')],function(_0x3c9dae){return{'model':db[_0x3c9dae['model']],'as':_0x3c9dae['as'],'attributes':_0x3c9dae[_0x6c1c('0x1d')],'include':_0x3c9dae['include']?_[_0x6c1c('0x1c')](_0x3c9dae[_0x6c1c('0x1b')],function(_0x1076d3){return{'model':db[_0x1076d3[_0x6c1c('0x1e')]],'as':_0x1076d3['as'],'attributes':_0x1076d3[_0x6c1c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6c1c('0xb')](function(_0x4dbf7b){logger[_0x6c1c('0xc')](_0x6c1c('0x20'),_0x3f5000);logger[_0x6c1c('0xf')](_0x6c1c('0x20'),_0x3f5000,JSON[_0x6c1c('0x1f')](_0x4dbf7b));_0x1ff8b1(_0x4dbf7b);})[_0x6c1c('0x14')](function(_0x56ddc4){logger[_0x6c1c('0x11')](_0x6c1c('0x20'),_0x56ddc4[_0x6c1c('0x13')],_0x3f5000);_0x578687(_0x54f8ae[_0x6c1c('0x11')](0x1f4,_0x56ddc4[_0x6c1c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index b9809fc..e95e5d2 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 _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(_0x1042d2,_0x3da8a9){var _0x8934e5=function(_0x3048cb){while(--_0x3048cb){_0x1042d2['push'](_0x1042d2['shift']());}};_0x8934e5(++_0x3da8a9);}(_0xadb5,0xad));var _0x5adb=function(_0x44ccd4,_0x48c81d){_0x44ccd4=_0x44ccd4-0x0;var _0x54064b=_0xadb5[_0x44ccd4];return _0x54064b;};'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 +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xdb28,0x106));var _0x8db2=function(_0x417e67,_0x43feb0){_0x417e67=_0x417e67-0x0;var _0x3cb0d7=_0xdb28[_0x417e67];return _0x3cb0d7;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index dbf0251..3e9d74c 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 _0x7ac9=['contact_lead','contact','lead','account','STRING','sequelize','exports','ENUM','Task','Case'];(function(_0x350343,_0x256f69){var _0x9afc1c=function(_0x47ab32){while(--_0x47ab32){_0x350343['push'](_0x350343['shift']());}};_0x9afc1c(++_0x256f69);}(_0x7ac9,0xeb));var _0x97ac=function(_0x2ec288,_0x56a150){_0x2ec288=_0x2ec288-0x0;var _0x377cb5=_0x7ac9[_0x2ec288];return _0x377cb5;};'use strict';var Sequelize=require(_0x97ac('0x0'));module[_0x97ac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x97ac('0x2')](_0x97ac('0x3'),_0x97ac('0x4')),'defaultValue':_0x97ac('0x3')},'moduleSearch':{'type':Sequelize[_0x97ac('0x2')](_0x97ac('0x5'),_0x97ac('0x6'),_0x97ac('0x7'),'account_contact_lead','account'),'defaultValue':_0x97ac('0x5')},'moduleCreate':{'type':Sequelize[_0x97ac('0x2')]('nothing',_0x97ac('0x6'),_0x97ac('0x7'),_0x97ac('0x8')),'defaultValue':_0x97ac('0x7')},'leadId':{'type':Sequelize[_0x97ac('0x9')]},'additionalSearchAccount':{'type':Sequelize[_0x97ac('0x9')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x97ac('0x9')]}}; \ No newline at end of file +var _0xeea4=['contact','account_contact_lead','account','contact_lead','nothing','lead','sequelize','exports','STRING','ENUM','Task','Case'];(function(_0x28286e,_0xd8c672){var _0x3a253e=function(_0x1830e7){while(--_0x1830e7){_0x28286e['push'](_0x28286e['shift']());}};_0x3a253e(++_0xd8c672);}(_0xeea4,0x19e));var _0x4eea=function(_0x364010,_0x270fc8){_0x364010=_0x364010-0x0;var _0x598af0=_0xeea4[_0x364010];return _0x598af0;};'use strict';var Sequelize=require(_0x4eea('0x0'));module[_0x4eea('0x1')]={'name':{'type':Sequelize[_0x4eea('0x2')]},'description':{'type':Sequelize[_0x4eea('0x2')]},'ticketType':{'type':Sequelize[_0x4eea('0x3')](_0x4eea('0x4'),_0x4eea('0x5')),'defaultValue':_0x4eea('0x4')},'moduleSearch':{'type':Sequelize[_0x4eea('0x3')]('contact_lead',_0x4eea('0x6'),'lead',_0x4eea('0x7'),_0x4eea('0x8')),'defaultValue':_0x4eea('0x9')},'moduleCreate':{'type':Sequelize['ENUM'](_0x4eea('0xa'),_0x4eea('0x6'),'lead',_0x4eea('0x8')),'defaultValue':_0x4eea('0xb')},'leadId':{'type':Sequelize[_0x4eea('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x4eea('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x4eea('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 75fb42f..bb2e40f 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 _0x58a0=['hasOwnProperty','getDescriptions','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','SalesforceConfiguration','fieldName','type','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','intersection','find','create','body','getFields','findOne','getSubjects','SalesforceField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58a0,0xa6));var _0x058a=function(_0x3a66fa,_0x399904){_0x3a66fa=_0x3a66fa-0x0;var _0x388cf9=_0x58a0[_0x3a66fa];return _0x388cf9;};'use strict';var emlformat=require(_0x058a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x058a('0x1'));var moment=require(_0x058a('0x2'));var BPromise=require(_0x058a('0x3'));var Mustache=require(_0x058a('0x4'));var util=require(_0x058a('0x5'));var path=require(_0x058a('0x6'));var sox=require(_0x058a('0x7'));var csv=require(_0x058a('0x8'));var ejs=require(_0x058a('0x9'));var fs=require('fs');var fs_extra=require(_0x058a('0xa'));var _=require(_0x058a('0xb'));var squel=require(_0x058a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x058a('0x8'));var querystring=require(_0x058a('0xd'));var Papa=require(_0x058a('0xe'));var Redis=require(_0x058a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x058a('0x10'));var as=require(_0x058a('0x11'));var hardwareService=require(_0x058a('0x12'));var logger=require(_0x058a('0x13'))(_0x058a('0x14'));var utils=require(_0x058a('0x15'));var config=require(_0x058a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x058a('0x17'))['db'];function respondWithStatusCode(_0x3877a2,_0x4174f0){_0x4174f0=_0x4174f0||0xcc;return function(_0x4a880e){if(_0x4a880e){return _0x3877a2['sendStatus'](_0x4174f0);}return _0x3877a2[_0x058a('0x18')](_0x4174f0)['end']();};}function respondWithResult(_0x48fcff,_0x55bb87){_0x55bb87=_0x55bb87||0xc8;return function(_0x2edf01){if(_0x2edf01){return _0x48fcff[_0x058a('0x18')](_0x55bb87)[_0x058a('0x19')](_0x2edf01);}};}function respondWithFilteredResult(_0x1dc293,_0x749fa9){return function(_0xb9881d){if(_0xb9881d){var _0x17e33f=typeof _0x749fa9['offset']===_0x058a('0x1a')&&typeof _0x749fa9[_0x058a('0x1b')]==='undefined';var _0x2fb9da=_0xb9881d[_0x058a('0x1c')];var _0x26c546=_0x17e33f?0x0:_0x749fa9[_0x058a('0x1d')];var _0x332ace=_0x17e33f?_0xb9881d[_0x058a('0x1c')]:_0x749fa9[_0x058a('0x1d')]+_0x749fa9[_0x058a('0x1b')];var _0x143d64;if(_0x332ace>=_0x2fb9da){_0x332ace=_0x2fb9da;_0x143d64=0xc8;}else{_0x143d64=0xce;}_0x1dc293[_0x058a('0x18')](_0x143d64);return _0x1dc293[_0x058a('0x1e')](_0x058a('0x1f'),_0x26c546+'-'+_0x332ace+'/'+_0x2fb9da)['json'](_0xb9881d);}return null;};}function patchUpdates(_0x30e183){return function(_0x44e2e6){try{jsonpatch['apply'](_0x44e2e6,_0x30e183,!![]);}catch(_0x3a7438){return BPromise[_0x058a('0x20')](_0x3a7438);}return _0x44e2e6[_0x058a('0x21')]();};}function saveUpdates(_0x24b362,_0x1400e5){return function(_0x3b42ec){if(_0x3b42ec){return _0x3b42ec[_0x058a('0x22')](_0x24b362)[_0x058a('0x23')](function(_0x40844e){return _0x40844e;});}return null;};}function removeEntity(_0x162613,_0x2a1d3e){return function(_0x37c48a){if(_0x37c48a){return _0x37c48a[_0x058a('0x24')]()[_0x058a('0x23')](function(){_0x162613[_0x058a('0x18')](0xcc)[_0x058a('0x25')]();});}};}function handleEntityNotFound(_0x595cf0,_0x3860b4){return function(_0x57c3da){if(!_0x57c3da){_0x595cf0[_0x058a('0x26')](0x194);}return _0x57c3da;};}function handleError(_0x2cb515,_0x3dea05){_0x3dea05=_0x3dea05||0x1f4;return function(_0x38cc5f){logger[_0x058a('0x27')](_0x38cc5f[_0x058a('0x28')]);if(_0x38cc5f['name']){delete _0x38cc5f[_0x058a('0x29')];}_0x2cb515['status'](_0x3dea05)['send'](_0x38cc5f);};}exports[_0x058a('0x2a')]=function(_0x5f21e8,_0x484557){var _0x40bf9d={},_0x3e5ea9={},_0x44bac1={'count':0x0,'rows':[]};var _0x209282=_[_0x058a('0x2b')](db[_0x058a('0x2c')]['rawAttributes'],function(_0x1cb7bd){return{'name':_0x1cb7bd[_0x058a('0x2d')],'type':_0x1cb7bd[_0x058a('0x2e')][_0x058a('0x2f')]};});_0x3e5ea9[_0x058a('0x30')]=_['map'](_0x209282,'name');_0x3e5ea9[_0x058a('0x31')]=_['keys'](_0x5f21e8[_0x058a('0x31')]);_0x3e5ea9[_0x058a('0x32')]=_['intersection'](_0x3e5ea9[_0x058a('0x30')],_0x3e5ea9[_0x058a('0x31')]);_0x40bf9d['attributes']=_['intersection'](_0x3e5ea9['model'],qs[_0x058a('0x33')](_0x5f21e8[_0x058a('0x31')][_0x058a('0x33')]));_0x40bf9d[_0x058a('0x34')]=_0x40bf9d[_0x058a('0x34')][_0x058a('0x35')]?_0x40bf9d[_0x058a('0x34')]:_0x3e5ea9['model'];if(!_0x5f21e8[_0x058a('0x31')]['hasOwnProperty'](_0x058a('0x36'))){_0x40bf9d['limit']=qs['limit'](_0x5f21e8['query'][_0x058a('0x1b')]);_0x40bf9d[_0x058a('0x1d')]=qs['offset'](_0x5f21e8[_0x058a('0x31')][_0x058a('0x1d')]);}_0x40bf9d[_0x058a('0x37')]=qs['sort'](_0x5f21e8[_0x058a('0x31')][_0x058a('0x38')]);_0x40bf9d[_0x058a('0x39')]=qs['filters'](_[_0x058a('0x3a')](_0x5f21e8[_0x058a('0x31')],_0x3e5ea9[_0x058a('0x32')]),_0x209282);if(_0x5f21e8['query'][_0x058a('0x3b')]){_0x40bf9d[_0x058a('0x39')]=_['merge'](_0x40bf9d[_0x058a('0x39')],{'$or':_['map'](_0x209282,function(_0x2bd483){if(_0x2bd483[_0x058a('0x2e')]!==_0x058a('0x3c')){var _0x3e0272={};_0x3e0272[_0x2bd483[_0x058a('0x29')]]={'$like':'%'+_0x5f21e8[_0x058a('0x31')]['filter']+'%'};return _0x3e0272;}})});}_0x40bf9d=_[_0x058a('0x3d')]({},_0x40bf9d,_0x5f21e8[_0x058a('0x3e')]);var _0x1d3675={'where':_0x40bf9d[_0x058a('0x39')]};return db['SalesforceConfiguration'][_0x058a('0x1c')](_0x1d3675)[_0x058a('0x23')](function(_0x5d83e0){_0x44bac1[_0x058a('0x1c')]=_0x5d83e0;if(_0x5f21e8['query'][_0x058a('0x3f')]){_0x40bf9d[_0x058a('0x40')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x058a('0x41')](_0x40bf9d);})['then'](function(_0x4cfce3){_0x44bac1[_0x058a('0x42')]=_0x4cfce3;return _0x44bac1;})[_0x058a('0x23')](respondWithFilteredResult(_0x484557,_0x40bf9d))[_0x058a('0x43')](handleError(_0x484557,null));};exports[_0x058a('0x44')]=function(_0x52598d,_0x40b66f){var _0x4b273a={'raw':![],'where':{'id':_0x52598d[_0x058a('0x45')]['id']}},_0x2b624f={};_0x2b624f[_0x058a('0x30')]=_['keys'](db[_0x058a('0x2c')][_0x058a('0x46')]);_0x2b624f[_0x058a('0x31')]=_[_0x058a('0x47')](_0x52598d[_0x058a('0x31')]);_0x2b624f[_0x058a('0x32')]=_[_0x058a('0x48')](_0x2b624f['model'],_0x2b624f[_0x058a('0x31')]);_0x4b273a[_0x058a('0x34')]=_[_0x058a('0x48')](_0x2b624f[_0x058a('0x30')],qs['fields'](_0x52598d[_0x058a('0x31')][_0x058a('0x33')]));_0x4b273a[_0x058a('0x34')]=_0x4b273a[_0x058a('0x34')][_0x058a('0x35')]?_0x4b273a[_0x058a('0x34')]:_0x2b624f[_0x058a('0x30')];if(_0x52598d[_0x058a('0x31')][_0x058a('0x3f')]){_0x4b273a['include']=[{'all':!![]}];}_0x4b273a=_[_0x058a('0x3d')]({},_0x4b273a,_0x52598d['options']);return db[_0x058a('0x2c')][_0x058a('0x49')](_0x4b273a)[_0x058a('0x23')](handleEntityNotFound(_0x40b66f,null))['then'](respondWithResult(_0x40b66f,null))[_0x058a('0x43')](handleError(_0x40b66f,null));};exports[_0x058a('0x4a')]=function(_0x5c230c,_0x4a560d){return db['SalesforceConfiguration']['create'](_0x5c230c[_0x058a('0x4b')],{})[_0x058a('0x23')](respondWithResult(_0x4a560d,0xc9))[_0x058a('0x43')](handleError(_0x4a560d,null));};exports[_0x058a('0x22')]=function(_0x5ce2ec,_0x321a59){if(_0x5ce2ec[_0x058a('0x4b')]['id']){delete _0x5ce2ec['body']['id'];}return db[_0x058a('0x2c')][_0x058a('0x49')]({'where':{'id':_0x5ce2ec[_0x058a('0x45')]['id']}})['then'](handleEntityNotFound(_0x321a59,null))[_0x058a('0x23')](saveUpdates(_0x5ce2ec[_0x058a('0x4b')],null))['then'](respondWithResult(_0x321a59,null))[_0x058a('0x43')](handleError(_0x321a59,null));};exports[_0x058a('0x24')]=function(_0x221fc4,_0x2bb546){return db[_0x058a('0x2c')][_0x058a('0x49')]({'where':{'id':_0x221fc4['params']['id']}})[_0x058a('0x23')](handleEntityNotFound(_0x2bb546,null))[_0x058a('0x23')](removeEntity(_0x2bb546,null))[_0x058a('0x43')](handleError(_0x2bb546,null));};exports[_0x058a('0x4c')]=function(_0x1dc95e,_0x14fd6c,_0xf9cd0c){var _0xe59d12={};var _0x21b76d={};var _0x1b6a20;var _0x36ef8a;return db[_0x058a('0x2c')][_0x058a('0x4d')]({'where':{'id':_0x1dc95e[_0x058a('0x45')]['id']}})[_0x058a('0x23')](handleEntityNotFound(_0x14fd6c,null))[_0x058a('0x23')](function(_0xd22f8e){if(_0xd22f8e){_0x1b6a20=_0xd22f8e;_0x21b76d['model']=_[_0x058a('0x47')](db['SalesforceField']['rawAttributes']);_0x21b76d[_0x058a('0x31')]=_[_0x058a('0x47')](_0x1dc95e[_0x058a('0x31')]);_0x21b76d[_0x058a('0x32')]=_[_0x058a('0x48')](_0x21b76d[_0x058a('0x30')],_0x21b76d[_0x058a('0x31')]);_0xe59d12[_0x058a('0x34')]=_[_0x058a('0x48')](_0x21b76d[_0x058a('0x30')],qs[_0x058a('0x33')](_0x1dc95e[_0x058a('0x31')][_0x058a('0x33')]));_0xe59d12[_0x058a('0x34')]=_0xe59d12['attributes']['length']?_0xe59d12[_0x058a('0x34')]:_0x21b76d[_0x058a('0x30')];_0xe59d12['order']=qs['sort'](_0x1dc95e[_0x058a('0x31')][_0x058a('0x38')]);_0xe59d12[_0x058a('0x39')]=qs[_0x058a('0x32')](_[_0x058a('0x3a')](_0x1dc95e[_0x058a('0x31')],_0x21b76d['filters']));if(_0x1dc95e[_0x058a('0x31')][_0x058a('0x3b')]){_0xe59d12[_0x058a('0x39')]=_['merge'](_0xe59d12['where'],{'$or':_['map'](_0xe59d12[_0x058a('0x34')],function(_0x1308dd){var _0x3b7f43={};_0x3b7f43[_0x1308dd]={'$like':'%'+_0x1dc95e[_0x058a('0x31')][_0x058a('0x3b')]+'%'};return _0x3b7f43;})});}_0xe59d12=_['merge']({},_0xe59d12,_0x1dc95e['options']);return _0x1b6a20[_0x058a('0x4c')](_0xe59d12);}})[_0x058a('0x23')](function(_0x2391cb){if(_0x2391cb){_0x36ef8a=_0x2391cb[_0x058a('0x35')];if(!_0x1dc95e['query']['hasOwnProperty'](_0x058a('0x36'))){_0xe59d12['limit']=qs[_0x058a('0x1b')](_0x1dc95e[_0x058a('0x31')][_0x058a('0x1b')]);_0xe59d12[_0x058a('0x1d')]=qs[_0x058a('0x1d')](_0x1dc95e[_0x058a('0x31')][_0x058a('0x1d')]);}return _0x1b6a20[_0x058a('0x4c')](_0xe59d12);}})['then'](function(_0x154ea0){if(_0x154ea0){return _0x154ea0?{'count':_0x36ef8a,'rows':_0x154ea0}:null;}})['then'](respondWithResult(_0x14fd6c,null))[_0x058a('0x43')](handleError(_0x14fd6c,null));};exports[_0x058a('0x4e')]=function(_0x51c0ee,_0x463da3,_0x257580){var _0x5f4799={};var _0x500fe2={};var _0x1b8be4;var _0x19ec74;return db[_0x058a('0x2c')][_0x058a('0x4d')]({'where':{'id':_0x51c0ee[_0x058a('0x45')]['id']}})[_0x058a('0x23')](handleEntityNotFound(_0x463da3,null))[_0x058a('0x23')](function(_0x27a7ef){if(_0x27a7ef){_0x1b8be4=_0x27a7ef;_0x500fe2['model']=_[_0x058a('0x47')](db[_0x058a('0x4f')][_0x058a('0x46')]);_0x500fe2[_0x058a('0x31')]=_[_0x058a('0x47')](_0x51c0ee[_0x058a('0x31')]);_0x500fe2[_0x058a('0x32')]=_['intersection'](_0x500fe2[_0x058a('0x30')],_0x500fe2['query']);_0x5f4799[_0x058a('0x34')]=_['intersection'](_0x500fe2[_0x058a('0x30')],qs[_0x058a('0x33')](_0x51c0ee[_0x058a('0x31')][_0x058a('0x33')]));_0x5f4799[_0x058a('0x34')]=_0x5f4799[_0x058a('0x34')][_0x058a('0x35')]?_0x5f4799[_0x058a('0x34')]:_0x500fe2[_0x058a('0x30')];_0x5f4799[_0x058a('0x37')]=qs[_0x058a('0x38')](_0x51c0ee['query'][_0x058a('0x38')]);_0x5f4799['where']=qs[_0x058a('0x32')](_[_0x058a('0x3a')](_0x51c0ee[_0x058a('0x31')],_0x500fe2[_0x058a('0x32')]));if(_0x51c0ee[_0x058a('0x31')][_0x058a('0x3b')]){_0x5f4799[_0x058a('0x39')]=_[_0x058a('0x3d')](_0x5f4799['where'],{'$or':_[_0x058a('0x2b')](_0x5f4799[_0x058a('0x34')],function(_0x212c56){var _0x3775ef={};_0x3775ef[_0x212c56]={'$like':'%'+_0x51c0ee[_0x058a('0x31')][_0x058a('0x3b')]+'%'};return _0x3775ef;})});}_0x5f4799=_[_0x058a('0x3d')]({},_0x5f4799,_0x51c0ee[_0x058a('0x3e')]);return _0x1b8be4[_0x058a('0x4e')](_0x5f4799);}})['then'](function(_0xd375b3){if(_0xd375b3){_0x19ec74=_0xd375b3[_0x058a('0x35')];if(!_0x51c0ee[_0x058a('0x31')][_0x058a('0x50')](_0x058a('0x36'))){_0x5f4799[_0x058a('0x1b')]=qs['limit'](_0x51c0ee[_0x058a('0x31')]['limit']);_0x5f4799['offset']=qs['offset'](_0x51c0ee[_0x058a('0x31')][_0x058a('0x1d')]);}return _0x1b8be4[_0x058a('0x4e')](_0x5f4799);}})['then'](function(_0x524b34){if(_0x524b34){return _0x524b34?{'count':_0x19ec74,'rows':_0x524b34}:null;}})['then'](respondWithResult(_0x463da3,null))[_0x058a('0x43')](handleError(_0x463da3,null));};exports[_0x058a('0x51')]=function(_0x510bcd,_0x437076,_0x49727c){var _0x17d4e0={};var _0x349dde={};var _0x4c1244;var _0xb298c;return db[_0x058a('0x2c')][_0x058a('0x4d')]({'where':{'id':_0x510bcd[_0x058a('0x45')]['id']}})[_0x058a('0x23')](handleEntityNotFound(_0x437076,null))[_0x058a('0x23')](function(_0xc11de5){if(_0xc11de5){_0x4c1244=_0xc11de5;_0x349dde['model']=_[_0x058a('0x47')](db[_0x058a('0x4f')][_0x058a('0x46')]);_0x349dde[_0x058a('0x31')]=_[_0x058a('0x47')](_0x510bcd[_0x058a('0x31')]);_0x349dde[_0x058a('0x32')]=_[_0x058a('0x48')](_0x349dde[_0x058a('0x30')],_0x349dde[_0x058a('0x31')]);_0x17d4e0['attributes']=_[_0x058a('0x48')](_0x349dde['model'],qs['fields'](_0x510bcd[_0x058a('0x31')][_0x058a('0x33')]));_0x17d4e0[_0x058a('0x34')]=_0x17d4e0[_0x058a('0x34')][_0x058a('0x35')]?_0x17d4e0['attributes']:_0x349dde[_0x058a('0x30')];_0x17d4e0[_0x058a('0x37')]=qs['sort'](_0x510bcd[_0x058a('0x31')][_0x058a('0x38')]);_0x17d4e0['where']=qs[_0x058a('0x32')](_['pick'](_0x510bcd['query'],_0x349dde[_0x058a('0x32')]));if(_0x510bcd['query'][_0x058a('0x3b')]){_0x17d4e0['where']=_[_0x058a('0x3d')](_0x17d4e0[_0x058a('0x39')],{'$or':_['map'](_0x17d4e0[_0x058a('0x34')],function(_0x26cc19){var _0x50939a={};_0x50939a[_0x26cc19]={'$like':'%'+_0x510bcd[_0x058a('0x31')][_0x058a('0x3b')]+'%'};return _0x50939a;})});}_0x17d4e0=_[_0x058a('0x3d')]({},_0x17d4e0,_0x510bcd['options']);return _0x4c1244[_0x058a('0x51')](_0x17d4e0);}})[_0x058a('0x23')](function(_0x2e6eaf){if(_0x2e6eaf){_0xb298c=_0x2e6eaf[_0x058a('0x35')];if(!_0x510bcd[_0x058a('0x31')]['hasOwnProperty'](_0x058a('0x36'))){_0x17d4e0[_0x058a('0x1b')]=qs['limit'](_0x510bcd[_0x058a('0x31')]['limit']);_0x17d4e0[_0x058a('0x1d')]=qs['offset'](_0x510bcd[_0x058a('0x31')][_0x058a('0x1d')]);}return _0x4c1244[_0x058a('0x51')](_0x17d4e0);}})[_0x058a('0x23')](function(_0x156dbb){if(_0x156dbb){return _0x156dbb?{'count':_0xb298c,'rows':_0x156dbb}:null;}})[_0x058a('0x23')](respondWithResult(_0x437076,null))['catch'](handleError(_0x437076,null));}; \ No newline at end of file +var _0xcd89=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','count','limit','set','apply','reject','save','update','destroy','then','end','error','stack','name','send','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','getSubjects','findOne','SalesforceField','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2ac91f,_0xac417f){var _0x469b9a=function(_0xdfc08e){while(--_0xdfc08e){_0x2ac91f['push'](_0x2ac91f['shift']());}};_0x469b9a(++_0xac417f);}(_0xcd89,0xe1));var _0x9cd8=function(_0x9a8a60,_0x3da559){_0x9a8a60=_0x9a8a60-0x0;var _0x49b339=_0xcd89[_0x9a8a60];return _0x49b339;};'use strict';var emlformat=require(_0x9cd8('0x0'));var rimraf=require(_0x9cd8('0x1'));var zipdir=require(_0x9cd8('0x2'));var jsonpatch=require(_0x9cd8('0x3'));var rp=require(_0x9cd8('0x4'));var moment=require('moment');var BPromise=require(_0x9cd8('0x5'));var Mustache=require(_0x9cd8('0x6'));var util=require('util');var path=require(_0x9cd8('0x7'));var sox=require(_0x9cd8('0x8'));var csv=require(_0x9cd8('0x9'));var ejs=require(_0x9cd8('0xa'));var fs=require('fs');var fs_extra=require(_0x9cd8('0xb'));var _=require(_0x9cd8('0xc'));var squel=require(_0x9cd8('0xd'));var crypto=require(_0x9cd8('0xe'));var jsforce=require(_0x9cd8('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9cd8('0x10'));var Papa=require(_0x9cd8('0x11'));var Redis=require(_0x9cd8('0x12'));var authService=require(_0x9cd8('0x13'));var qs=require(_0x9cd8('0x14'));var as=require(_0x9cd8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cd8('0x16'))('api');var utils=require(_0x9cd8('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9cd8('0x18'))['db'];function respondWithStatusCode(_0x3db3d5,_0x873de0){_0x873de0=_0x873de0||0xcc;return function(_0x425cef){if(_0x425cef){return _0x3db3d5[_0x9cd8('0x19')](_0x873de0);}return _0x3db3d5['status'](_0x873de0)['end']();};}function respondWithResult(_0x5ac494,_0x20cddb){_0x20cddb=_0x20cddb||0xc8;return function(_0x455c3a){if(_0x455c3a){return _0x5ac494[_0x9cd8('0x1a')](_0x20cddb)[_0x9cd8('0x1b')](_0x455c3a);}};}function respondWithFilteredResult(_0x29aaf0,_0x1f2f2c){return function(_0x1169f9){if(_0x1169f9){var _0x2fe745=typeof _0x1f2f2c[_0x9cd8('0x1c')]==='undefined'&&typeof _0x1f2f2c['limit']==='undefined';var _0x53b0cf=_0x1169f9[_0x9cd8('0x1d')];var _0x15dffb=_0x2fe745?0x0:_0x1f2f2c[_0x9cd8('0x1c')];var _0x42fe1d=_0x2fe745?_0x1169f9[_0x9cd8('0x1d')]:_0x1f2f2c[_0x9cd8('0x1c')]+_0x1f2f2c[_0x9cd8('0x1e')];var _0xfda305;if(_0x42fe1d>=_0x53b0cf){_0x42fe1d=_0x53b0cf;_0xfda305=0xc8;}else{_0xfda305=0xce;}_0x29aaf0['status'](_0xfda305);return _0x29aaf0[_0x9cd8('0x1f')]('Content-Range',_0x15dffb+'-'+_0x42fe1d+'/'+_0x53b0cf)[_0x9cd8('0x1b')](_0x1169f9);}return null;};}function patchUpdates(_0x54ed87){return function(_0xcff39d){try{jsonpatch[_0x9cd8('0x20')](_0xcff39d,_0x54ed87,!![]);}catch(_0x504118){return BPromise[_0x9cd8('0x21')](_0x504118);}return _0xcff39d[_0x9cd8('0x22')]();};}function saveUpdates(_0x175b73,_0x331104){return function(_0x8f7b5e){if(_0x8f7b5e){return _0x8f7b5e[_0x9cd8('0x23')](_0x175b73)['then'](function(_0x41d0b6){return _0x41d0b6;});}return null;};}function removeEntity(_0x246181,_0x1b516d){return function(_0x4f3cc2){if(_0x4f3cc2){return _0x4f3cc2[_0x9cd8('0x24')]()[_0x9cd8('0x25')](function(){_0x246181[_0x9cd8('0x1a')](0xcc)[_0x9cd8('0x26')]();});}};}function handleEntityNotFound(_0x2a7b1,_0x46d053){return function(_0x5aeeb4){if(!_0x5aeeb4){_0x2a7b1[_0x9cd8('0x19')](0x194);}return _0x5aeeb4;};}function handleError(_0x49700e,_0x210a95){_0x210a95=_0x210a95||0x1f4;return function(_0x370bd8){logger[_0x9cd8('0x27')](_0x370bd8[_0x9cd8('0x28')]);if(_0x370bd8[_0x9cd8('0x29')]){delete _0x370bd8['name'];}_0x49700e[_0x9cd8('0x1a')](_0x210a95)[_0x9cd8('0x2a')](_0x370bd8);};}exports['index']=function(_0x276624,_0x580835){var _0x37c23a={},_0x3308e4={},_0xf402b7={'count':0x0,'rows':[]};var _0x2be8e9=_['map'](db[_0x9cd8('0x2b')][_0x9cd8('0x2c')],function(_0x110189){return{'name':_0x110189[_0x9cd8('0x2d')],'type':_0x110189[_0x9cd8('0x2e')][_0x9cd8('0x2f')]};});_0x3308e4[_0x9cd8('0x30')]=_[_0x9cd8('0x31')](_0x2be8e9,_0x9cd8('0x29'));_0x3308e4[_0x9cd8('0x32')]=_[_0x9cd8('0x33')](_0x276624[_0x9cd8('0x32')]);_0x3308e4['filters']=_[_0x9cd8('0x34')](_0x3308e4[_0x9cd8('0x30')],_0x3308e4[_0x9cd8('0x32')]);_0x37c23a['attributes']=_['intersection'](_0x3308e4[_0x9cd8('0x30')],qs['fields'](_0x276624['query'][_0x9cd8('0x35')]));_0x37c23a[_0x9cd8('0x36')]=_0x37c23a[_0x9cd8('0x36')][_0x9cd8('0x37')]?_0x37c23a['attributes']:_0x3308e4[_0x9cd8('0x30')];if(!_0x276624[_0x9cd8('0x32')][_0x9cd8('0x38')]('nolimit')){_0x37c23a[_0x9cd8('0x1e')]=qs['limit'](_0x276624[_0x9cd8('0x32')]['limit']);_0x37c23a[_0x9cd8('0x1c')]=qs[_0x9cd8('0x1c')](_0x276624['query']['offset']);}_0x37c23a[_0x9cd8('0x39')]=qs[_0x9cd8('0x3a')](_0x276624['query'][_0x9cd8('0x3a')]);_0x37c23a['where']=qs[_0x9cd8('0x3b')](_[_0x9cd8('0x3c')](_0x276624[_0x9cd8('0x32')],_0x3308e4[_0x9cd8('0x3b')]),_0x2be8e9);if(_0x276624[_0x9cd8('0x32')]['filter']){_0x37c23a[_0x9cd8('0x3d')]=_[_0x9cd8('0x3e')](_0x37c23a[_0x9cd8('0x3d')],{'$or':_[_0x9cd8('0x31')](_0x2be8e9,function(_0x36058e){if(_0x36058e[_0x9cd8('0x2e')]!=='VIRTUAL'){var _0x5ebb6d={};_0x5ebb6d[_0x36058e[_0x9cd8('0x29')]]={'$like':'%'+_0x276624[_0x9cd8('0x32')][_0x9cd8('0x3f')]+'%'};return _0x5ebb6d;}})});}_0x37c23a=_['merge']({},_0x37c23a,_0x276624[_0x9cd8('0x40')]);var _0x4f7b69={'where':_0x37c23a[_0x9cd8('0x3d')]};return db['SalesforceConfiguration'][_0x9cd8('0x1d')](_0x4f7b69)['then'](function(_0x2c9b9c){_0xf402b7[_0x9cd8('0x1d')]=_0x2c9b9c;if(_0x276624['query'][_0x9cd8('0x41')]){_0x37c23a[_0x9cd8('0x42')]=[{'all':!![]}];}return db[_0x9cd8('0x2b')][_0x9cd8('0x43')](_0x37c23a);})[_0x9cd8('0x25')](function(_0x4a9b0c){_0xf402b7[_0x9cd8('0x44')]=_0x4a9b0c;return _0xf402b7;})[_0x9cd8('0x25')](respondWithFilteredResult(_0x580835,_0x37c23a))[_0x9cd8('0x45')](handleError(_0x580835,null));};exports['show']=function(_0x5eff90,_0x243483){var _0x6abb8={'raw':![],'where':{'id':_0x5eff90[_0x9cd8('0x46')]['id']}},_0x7b74f6={};_0x7b74f6[_0x9cd8('0x30')]=_[_0x9cd8('0x33')](db[_0x9cd8('0x2b')][_0x9cd8('0x2c')]);_0x7b74f6[_0x9cd8('0x32')]=_[_0x9cd8('0x33')](_0x5eff90['query']);_0x7b74f6[_0x9cd8('0x3b')]=_[_0x9cd8('0x34')](_0x7b74f6[_0x9cd8('0x30')],_0x7b74f6['query']);_0x6abb8[_0x9cd8('0x36')]=_['intersection'](_0x7b74f6[_0x9cd8('0x30')],qs[_0x9cd8('0x35')](_0x5eff90[_0x9cd8('0x32')][_0x9cd8('0x35')]));_0x6abb8[_0x9cd8('0x36')]=_0x6abb8[_0x9cd8('0x36')][_0x9cd8('0x37')]?_0x6abb8[_0x9cd8('0x36')]:_0x7b74f6[_0x9cd8('0x30')];if(_0x5eff90[_0x9cd8('0x32')]['includeAll']){_0x6abb8['include']=[{'all':!![]}];}_0x6abb8=_[_0x9cd8('0x3e')]({},_0x6abb8,_0x5eff90[_0x9cd8('0x40')]);return db[_0x9cd8('0x2b')][_0x9cd8('0x47')](_0x6abb8)['then'](handleEntityNotFound(_0x243483,null))[_0x9cd8('0x25')](respondWithResult(_0x243483,null))[_0x9cd8('0x45')](handleError(_0x243483,null));};exports[_0x9cd8('0x48')]=function(_0x4e3aae,_0x118eba){return db[_0x9cd8('0x2b')][_0x9cd8('0x48')](_0x4e3aae[_0x9cd8('0x49')],{})[_0x9cd8('0x25')](respondWithResult(_0x118eba,0xc9))[_0x9cd8('0x45')](handleError(_0x118eba,null));};exports[_0x9cd8('0x23')]=function(_0x35d1d4,_0x4d4f84){if(_0x35d1d4[_0x9cd8('0x49')]['id']){delete _0x35d1d4[_0x9cd8('0x49')]['id'];}return db[_0x9cd8('0x2b')][_0x9cd8('0x47')]({'where':{'id':_0x35d1d4[_0x9cd8('0x46')]['id']}})[_0x9cd8('0x25')](handleEntityNotFound(_0x4d4f84,null))[_0x9cd8('0x25')](saveUpdates(_0x35d1d4['body'],null))[_0x9cd8('0x25')](respondWithResult(_0x4d4f84,null))[_0x9cd8('0x45')](handleError(_0x4d4f84,null));};exports[_0x9cd8('0x24')]=function(_0x2430a0,_0x46990b){return db[_0x9cd8('0x2b')][_0x9cd8('0x47')]({'where':{'id':_0x2430a0[_0x9cd8('0x46')]['id']}})[_0x9cd8('0x25')](handleEntityNotFound(_0x46990b,null))['then'](removeEntity(_0x46990b,null))[_0x9cd8('0x45')](handleError(_0x46990b,null));};exports['getFields']=function(_0x72f124,_0x1293c9,_0x4ea05){var _0x2b10f9={};var _0x325493={};var _0x248429;var _0x4f13f4;return db[_0x9cd8('0x2b')]['findOne']({'where':{'id':_0x72f124[_0x9cd8('0x46')]['id']}})[_0x9cd8('0x25')](handleEntityNotFound(_0x1293c9,null))[_0x9cd8('0x25')](function(_0x478b75){if(_0x478b75){_0x248429=_0x478b75;_0x325493['model']=_[_0x9cd8('0x33')](db['SalesforceField']['rawAttributes']);_0x325493[_0x9cd8('0x32')]=_[_0x9cd8('0x33')](_0x72f124[_0x9cd8('0x32')]);_0x325493[_0x9cd8('0x3b')]=_[_0x9cd8('0x34')](_0x325493[_0x9cd8('0x30')],_0x325493[_0x9cd8('0x32')]);_0x2b10f9[_0x9cd8('0x36')]=_['intersection'](_0x325493['model'],qs['fields'](_0x72f124[_0x9cd8('0x32')][_0x9cd8('0x35')]));_0x2b10f9[_0x9cd8('0x36')]=_0x2b10f9[_0x9cd8('0x36')]['length']?_0x2b10f9[_0x9cd8('0x36')]:_0x325493[_0x9cd8('0x30')];_0x2b10f9[_0x9cd8('0x39')]=qs[_0x9cd8('0x3a')](_0x72f124[_0x9cd8('0x32')][_0x9cd8('0x3a')]);_0x2b10f9[_0x9cd8('0x3d')]=qs[_0x9cd8('0x3b')](_[_0x9cd8('0x3c')](_0x72f124['query'],_0x325493[_0x9cd8('0x3b')]));if(_0x72f124[_0x9cd8('0x32')]['filter']){_0x2b10f9[_0x9cd8('0x3d')]=_[_0x9cd8('0x3e')](_0x2b10f9[_0x9cd8('0x3d')],{'$or':_[_0x9cd8('0x31')](_0x2b10f9[_0x9cd8('0x36')],function(_0x988bef){var _0x481e50={};_0x481e50[_0x988bef]={'$like':'%'+_0x72f124[_0x9cd8('0x32')][_0x9cd8('0x3f')]+'%'};return _0x481e50;})});}_0x2b10f9=_[_0x9cd8('0x3e')]({},_0x2b10f9,_0x72f124[_0x9cd8('0x40')]);return _0x248429[_0x9cd8('0x4a')](_0x2b10f9);}})['then'](function(_0x191a7){if(_0x191a7){_0x4f13f4=_0x191a7['length'];if(!_0x72f124[_0x9cd8('0x32')][_0x9cd8('0x38')]('nolimit')){_0x2b10f9[_0x9cd8('0x1e')]=qs['limit'](_0x72f124['query'][_0x9cd8('0x1e')]);_0x2b10f9[_0x9cd8('0x1c')]=qs[_0x9cd8('0x1c')](_0x72f124[_0x9cd8('0x32')]['offset']);}return _0x248429[_0x9cd8('0x4a')](_0x2b10f9);}})[_0x9cd8('0x25')](function(_0x14ce9b){if(_0x14ce9b){return _0x14ce9b?{'count':_0x4f13f4,'rows':_0x14ce9b}:null;}})['then'](respondWithResult(_0x1293c9,null))['catch'](handleError(_0x1293c9,null));};exports[_0x9cd8('0x4b')]=function(_0x13eb75,_0x18a906,_0x236959){var _0x4efe84={};var _0x18ae39={};var _0x3e3618;var _0x117182;return db['SalesforceConfiguration'][_0x9cd8('0x4c')]({'where':{'id':_0x13eb75[_0x9cd8('0x46')]['id']}})['then'](handleEntityNotFound(_0x18a906,null))[_0x9cd8('0x25')](function(_0xf0dcff){if(_0xf0dcff){_0x3e3618=_0xf0dcff;_0x18ae39['model']=_[_0x9cd8('0x33')](db[_0x9cd8('0x4d')][_0x9cd8('0x2c')]);_0x18ae39[_0x9cd8('0x32')]=_[_0x9cd8('0x33')](_0x13eb75[_0x9cd8('0x32')]);_0x18ae39[_0x9cd8('0x3b')]=_[_0x9cd8('0x34')](_0x18ae39[_0x9cd8('0x30')],_0x18ae39[_0x9cd8('0x32')]);_0x4efe84[_0x9cd8('0x36')]=_[_0x9cd8('0x34')](_0x18ae39[_0x9cd8('0x30')],qs['fields'](_0x13eb75[_0x9cd8('0x32')]['fields']));_0x4efe84[_0x9cd8('0x36')]=_0x4efe84[_0x9cd8('0x36')]['length']?_0x4efe84['attributes']:_0x18ae39[_0x9cd8('0x30')];_0x4efe84[_0x9cd8('0x39')]=qs['sort'](_0x13eb75['query']['sort']);_0x4efe84['where']=qs[_0x9cd8('0x3b')](_[_0x9cd8('0x3c')](_0x13eb75[_0x9cd8('0x32')],_0x18ae39[_0x9cd8('0x3b')]));if(_0x13eb75['query'][_0x9cd8('0x3f')]){_0x4efe84[_0x9cd8('0x3d')]=_[_0x9cd8('0x3e')](_0x4efe84['where'],{'$or':_[_0x9cd8('0x31')](_0x4efe84[_0x9cd8('0x36')],function(_0x55a296){var _0x471805={};_0x471805[_0x55a296]={'$like':'%'+_0x13eb75[_0x9cd8('0x32')][_0x9cd8('0x3f')]+'%'};return _0x471805;})});}_0x4efe84=_[_0x9cd8('0x3e')]({},_0x4efe84,_0x13eb75[_0x9cd8('0x40')]);return _0x3e3618[_0x9cd8('0x4b')](_0x4efe84);}})[_0x9cd8('0x25')](function(_0x278fb5){if(_0x278fb5){_0x117182=_0x278fb5['length'];if(!_0x13eb75[_0x9cd8('0x32')][_0x9cd8('0x38')](_0x9cd8('0x4e'))){_0x4efe84[_0x9cd8('0x1e')]=qs[_0x9cd8('0x1e')](_0x13eb75['query']['limit']);_0x4efe84[_0x9cd8('0x1c')]=qs[_0x9cd8('0x1c')](_0x13eb75[_0x9cd8('0x32')]['offset']);}return _0x3e3618['getSubjects'](_0x4efe84);}})['then'](function(_0x5824bf){if(_0x5824bf){return _0x5824bf?{'count':_0x117182,'rows':_0x5824bf}:null;}})[_0x9cd8('0x25')](respondWithResult(_0x18a906,null))[_0x9cd8('0x45')](handleError(_0x18a906,null));};exports[_0x9cd8('0x4f')]=function(_0x55214b,_0x16422e,_0x179877){var _0x5c918f={};var _0xb31fcb={};var _0x9e7f69;var _0x56d118;return db['SalesforceConfiguration'][_0x9cd8('0x4c')]({'where':{'id':_0x55214b[_0x9cd8('0x46')]['id']}})['then'](handleEntityNotFound(_0x16422e,null))[_0x9cd8('0x25')](function(_0x1e84ee){if(_0x1e84ee){_0x9e7f69=_0x1e84ee;_0xb31fcb[_0x9cd8('0x30')]=_[_0x9cd8('0x33')](db[_0x9cd8('0x4d')][_0x9cd8('0x2c')]);_0xb31fcb[_0x9cd8('0x32')]=_[_0x9cd8('0x33')](_0x55214b[_0x9cd8('0x32')]);_0xb31fcb[_0x9cd8('0x3b')]=_[_0x9cd8('0x34')](_0xb31fcb['model'],_0xb31fcb[_0x9cd8('0x32')]);_0x5c918f[_0x9cd8('0x36')]=_[_0x9cd8('0x34')](_0xb31fcb['model'],qs['fields'](_0x55214b[_0x9cd8('0x32')]['fields']));_0x5c918f[_0x9cd8('0x36')]=_0x5c918f[_0x9cd8('0x36')][_0x9cd8('0x37')]?_0x5c918f['attributes']:_0xb31fcb['model'];_0x5c918f[_0x9cd8('0x39')]=qs['sort'](_0x55214b[_0x9cd8('0x32')]['sort']);_0x5c918f[_0x9cd8('0x3d')]=qs[_0x9cd8('0x3b')](_['pick'](_0x55214b[_0x9cd8('0x32')],_0xb31fcb[_0x9cd8('0x3b')]));if(_0x55214b[_0x9cd8('0x32')][_0x9cd8('0x3f')]){_0x5c918f[_0x9cd8('0x3d')]=_['merge'](_0x5c918f[_0x9cd8('0x3d')],{'$or':_[_0x9cd8('0x31')](_0x5c918f[_0x9cd8('0x36')],function(_0x354edd){var _0x21fdf5={};_0x21fdf5[_0x354edd]={'$like':'%'+_0x55214b[_0x9cd8('0x32')]['filter']+'%'};return _0x21fdf5;})});}_0x5c918f=_[_0x9cd8('0x3e')]({},_0x5c918f,_0x55214b[_0x9cd8('0x40')]);return _0x9e7f69[_0x9cd8('0x4f')](_0x5c918f);}})[_0x9cd8('0x25')](function(_0xcc87c3){if(_0xcc87c3){_0x56d118=_0xcc87c3[_0x9cd8('0x37')];if(!_0x55214b[_0x9cd8('0x32')][_0x9cd8('0x38')](_0x9cd8('0x4e'))){_0x5c918f[_0x9cd8('0x1e')]=qs['limit'](_0x55214b[_0x9cd8('0x32')]['limit']);_0x5c918f[_0x9cd8('0x1c')]=qs[_0x9cd8('0x1c')](_0x55214b[_0x9cd8('0x32')][_0x9cd8('0x1c')]);}return _0x9e7f69[_0x9cd8('0x4f')](_0x5c918f);}})['then'](function(_0x43c176){if(_0x43c176){return _0x43c176?{'count':_0x56d118,'rows':_0x43c176}:null;}})[_0x9cd8('0x25')](respondWithResult(_0x16422e,null))[_0x9cd8('0x45')](handleError(_0x16422e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index a51f63a..f37fea7 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 _0x0ac6=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','lodash'];(function(_0x479646,_0x31e898){var _0x5c809b=function(_0x3b1e27){while(--_0x3b1e27){_0x479646['push'](_0x479646['shift']());}};_0x5c809b(++_0x31e898);}(_0x0ac6,0xf1));var _0x60ac=function(_0x202bb5,_0x4c5a09){_0x202bb5=_0x202bb5-0x0;var _0x1733b8=_0x0ac6[_0x202bb5];return _0x1733b8;};'use strict';var _=require(_0x60ac('0x0'));var util=require('util');var logger=require(_0x60ac('0x1'))(_0x60ac('0x2'));var moment=require('moment');var BPromise=require(_0x60ac('0x3'));var rp=require(_0x60ac('0x4'));var fs=require('fs');var path=require(_0x60ac('0x5'));var rimraf=require(_0x60ac('0x6'));var config=require(_0x60ac('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x134cf8,_0x2eb37b){return _0x134cf8[_0x60ac('0x8')](_0x60ac('0x9'),attributes,{'tableName':_0x60ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x94ca=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','lodash','util','api'];(function(_0x42ead6,_0x1c1b1c){var _0xdadbff=function(_0x400edc){while(--_0x400edc){_0x42ead6['push'](_0x42ead6['shift']());}};_0xdadbff(++_0x1c1b1c);}(_0x94ca,0x111));var _0xa94c=function(_0x1f8fa4,_0xbb785){_0x1f8fa4=_0x1f8fa4-0x0;var _0x2ff529=_0x94ca[_0x1f8fa4];return _0x2ff529;};'use strict';var _=require(_0xa94c('0x0'));var util=require(_0xa94c('0x1'));var logger=require('../../config/logger')(_0xa94c('0x2'));var moment=require(_0xa94c('0x3'));var BPromise=require(_0xa94c('0x4'));var rp=require(_0xa94c('0x5'));var fs=require('fs');var path=require(_0xa94c('0x6'));var rimraf=require(_0xa94c('0x7'));var config=require(_0xa94c('0x8'));var attributes=require(_0xa94c('0x9'));module['exports']=function(_0x69d7b8,_0x49474e){return _0x69d7b8[_0xa94c('0xa')](_0xa94c('0xb'),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 da28307..fddafaf 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 _0xd78d=['request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http'];(function(_0x1cefd7,_0x1ede17){var _0x157286=function(_0x279917){while(--_0x279917){_0x1cefd7['push'](_0x1cefd7['shift']());}};_0x157286(++_0x1ede17);}(_0xd78d,0x6f));var _0xdd78=function(_0x674e0a,_0x424d90){_0x674e0a=_0x674e0a-0x0;var _0x5ca3fd=_0xd78d[_0x674e0a];return _0x5ca3fd;};'use strict';var _=require(_0xdd78('0x0'));var util=require(_0xdd78('0x1'));var moment=require('moment');var BPromise=require(_0xdd78('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd78('0x3'));var db=require(_0xdd78('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd78('0x5'));var config=require(_0xdd78('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdd78('0x7')][_0xdd78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40face,_0x4c84d9,_0x1666cf){return new BPromise(function(_0x278f50,_0x1debb0){return client[_0xdd78('0x9')](_0x40face,_0x1666cf)[_0xdd78('0xa')](function(_0x2611c3){logger['info'](_0xdd78('0xb'),_0x4c84d9,_0xdd78('0xc'));logger[_0xdd78('0xd')](_0xdd78('0xe'),_0x4c84d9,_0xdd78('0xc'),JSON['stringify'](_0x2611c3));if(_0x2611c3[_0xdd78('0xf')]){if(_0x2611c3[_0xdd78('0xf')][_0xdd78('0x10')]===0x1f4){logger['error'](_0xdd78('0xb'),_0x4c84d9,_0x2611c3[_0xdd78('0xf')][_0xdd78('0x11')]);return _0x1debb0(_0x2611c3[_0xdd78('0xf')][_0xdd78('0x11')]);}logger[_0xdd78('0xf')](_0xdd78('0xb'),_0x4c84d9,_0x2611c3[_0xdd78('0xf')]['message']);return _0x278f50(_0x2611c3[_0xdd78('0xf')][_0xdd78('0x11')]);}else{logger['info'](_0xdd78('0xb'),_0x4c84d9,_0xdd78('0xc'));_0x278f50(_0x2611c3[_0xdd78('0x12')][_0xdd78('0x11')]);}})[_0xdd78('0x13')](function(_0x50d21f){logger[_0xdd78('0xf')](_0xdd78('0xb'),_0x4c84d9,_0x50d21f);_0x1debb0(_0x50d21f);});});} \ No newline at end of file +var _0xfece=['stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x465fa1,_0x46b71d){var _0x2d05f5=function(_0x159c87){while(--_0x159c87){_0x465fa1['push'](_0x465fa1['shift']());}};_0x2d05f5(++_0x46b71d);}(_0xfece,0xf5));var _0xefec=function(_0x2175a6,_0x5075f8){_0x2175a6=_0x2175a6-0x0;var _0x460f6=_0xfece[_0x2175a6];return _0x460f6;};'use strict';var _=require(_0xefec('0x0'));var util=require(_0xefec('0x1'));var moment=require('moment');var BPromise=require(_0xefec('0x2'));var rs=require(_0xefec('0x3'));var fs=require('fs');var Redis=require(_0xefec('0x4'));var db=require(_0xefec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xefec('0x6'))('rpc');var config=require(_0xefec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xefec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52cbc4,_0x51b973,_0x5f5133){return new BPromise(function(_0x4f8544,_0x445cce){return client[_0xefec('0x9')](_0x52cbc4,_0x5f5133)[_0xefec('0xa')](function(_0x4354c0){logger[_0xefec('0xb')](_0xefec('0xc'),_0x51b973,_0xefec('0xd'));logger[_0xefec('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x51b973,_0xefec('0xd'),JSON[_0xefec('0xf')](_0x4354c0));if(_0x4354c0[_0xefec('0x10')]){if(_0x4354c0[_0xefec('0x10')][_0xefec('0x11')]===0x1f4){logger[_0xefec('0x10')](_0xefec('0xc'),_0x51b973,_0x4354c0['error'][_0xefec('0x12')]);return _0x445cce(_0x4354c0[_0xefec('0x10')][_0xefec('0x12')]);}logger['error'](_0xefec('0xc'),_0x51b973,_0x4354c0['error'][_0xefec('0x12')]);return _0x4f8544(_0x4354c0['error'][_0xefec('0x12')]);}else{logger[_0xefec('0xb')](_0xefec('0xc'),_0x51b973,_0xefec('0xd'));_0x4f8544(_0x4354c0['result'][_0xefec('0x12')]);}})[_0xefec('0x13')](function(_0x2577e9){logger[_0xefec('0x10')](_0xefec('0xc'),_0x51b973,_0x2577e9);_0x445cce(_0x2577e9);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 4d2fbb9..aa66e84 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 _0x744f=['update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index','show','create','put','/:id'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x744f,0xb8));var _0xf744=function(_0x439a4d,_0x1c0018){_0x439a4d=_0x439a4d-0x0;var _0x2025b6=_0x744f[_0x439a4d];return _0x2025b6;};'use strict';var multer=require(_0xf744('0x0'));var util=require(_0xf744('0x1'));var path=require(_0xf744('0x2'));var timeout=require(_0xf744('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf744('0x4'));var interaction=require(_0xf744('0x5'));var config=require('../../config/environment');var controller=require(_0xf744('0x6'));router[_0xf744('0x7')]('/',auth[_0xf744('0x8')](),controller[_0xf744('0x9')]);router[_0xf744('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xf744('0xa')]);router['post']('/',auth[_0xf744('0x8')](),controller[_0xf744('0xb')]);router[_0xf744('0xc')](_0xf744('0xd'),auth[_0xf744('0x8')](),controller[_0xf744('0xe')]);router[_0xf744('0xf')](_0xf744('0xd'),auth['isAuthenticated'](),controller[_0xf744('0x10')]);module[_0xf744('0x11')]=router; \ No newline at end of file +var _0x368f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','post','put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra'];(function(_0x482484,_0x4b2f85){var _0x49c432=function(_0x59a46b){while(--_0x59a46b){_0x482484['push'](_0x482484['shift']());}};_0x49c432(++_0x4b2f85);}(_0x368f,0x12d));var _0xf368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf368('0x0'));var util=require(_0xf368('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf368('0x2'));var router=express[_0xf368('0x3')]();var fs_extra=require(_0xf368('0x4'));var auth=require(_0xf368('0x5'));var interaction=require(_0xf368('0x6'));var config=require(_0xf368('0x7'));var controller=require(_0xf368('0x8'));router[_0xf368('0x9')]('/',auth[_0xf368('0xa')](),controller['index']);router[_0xf368('0x9')]('/:id',auth[_0xf368('0xa')](),controller['show']);router[_0xf368('0xb')]('/',auth[_0xf368('0xa')](),controller['create']);router[_0xf368('0xc')](_0xf368('0xd'),auth[_0xf368('0xa')](),controller[_0xf368('0xe')]);router['delete'](_0xf368('0xd'),auth[_0xf368('0xa')](),controller[_0xf368('0xf')]);module[_0xf368('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index ec2043e..fe688dd 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 _0xf5ed=['picklist','STRING','string','customVariable','sequelize','exports','ENUM','variable','keyValue'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xf5ed,0x1f3));var _0xdf5e=function(_0x1d6b12,_0x277761){_0x1d6b12=_0x1d6b12-0x0;var _0xf8cddb=_0xf5ed[_0x1d6b12];return _0xf8cddb;};'use strict';var Sequelize=require(_0xdf5e('0x0'));module[_0xdf5e('0x1')]={'type':{'type':Sequelize[_0xdf5e('0x2')]('string',_0xdf5e('0x3'),'customVariable',_0xdf5e('0x4'),_0xdf5e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xdf5e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xdf5e('0x7'),_0xdf5e('0x3'),_0xdf5e('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdf5e('0x6')]},'variableName':{'type':Sequelize[_0xdf5e('0x6')]}}; \ No newline at end of file +var _0x6717=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','exports'];(function(_0x412d81,_0x2a2dd7){var _0x10019d=function(_0x44bcbe){while(--_0x44bcbe){_0x412d81['push'](_0x412d81['shift']());}};_0x10019d(++_0x2a2dd7);}(_0x6717,0xcf));var _0x7671=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6717[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x7671('0x0')]={'type':{'type':Sequelize[_0x7671('0x1')](_0x7671('0x2'),_0x7671('0x3'),_0x7671('0x4'),_0x7671('0x5'),_0x7671('0x6')),'defaultValue':_0x7671('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7671('0x1')](_0x7671('0x2'),_0x7671('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x7671('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x7671('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 376cc09..a1098d8 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 _0x4053=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis'];(function(_0x408e7f,_0xbb794){var _0x155181=function(_0xd2b36b){while(--_0xd2b36b){_0x408e7f['push'](_0x408e7f['shift']());}};_0x155181(++_0xbb794);}(_0x4053,0xd7));var _0x3405=function(_0x1c212f,_0x59d13f){_0x1c212f=_0x1c212f-0x0;var _0x212fee=_0x4053[_0x1c212f];return _0x212fee;};'use strict';var emlformat=require(_0x3405('0x0'));var rimraf=require(_0x3405('0x1'));var zipdir=require(_0x3405('0x2'));var jsonpatch=require(_0x3405('0x3'));var rp=require(_0x3405('0x4'));var moment=require(_0x3405('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3405('0x6'));var util=require(_0x3405('0x7'));var path=require(_0x3405('0x8'));var sox=require(_0x3405('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3405('0xa'));var _=require(_0x3405('0xb'));var squel=require(_0x3405('0xc'));var crypto=require(_0x3405('0xd'));var jsforce=require(_0x3405('0xe'));var deskjs=require(_0x3405('0xf'));var toCsv=require(_0x3405('0x10'));var querystring=require('querystring');var Papa=require(_0x3405('0x11'));var Redis=require(_0x3405('0x12'));var authService=require(_0x3405('0x13'));var qs=require(_0x3405('0x14'));var as=require(_0x3405('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3405('0x16'))('api');var utils=require(_0x3405('0x17'));var config=require(_0x3405('0x18'));var licenseUtil=require(_0x3405('0x19'));var db=require(_0x3405('0x1a'))['db'];function respondWithStatusCode(_0x45800f,_0x2e0fd2){_0x2e0fd2=_0x2e0fd2||0xcc;return function(_0x3538e7){if(_0x3538e7){return _0x45800f[_0x3405('0x1b')](_0x2e0fd2);}return _0x45800f[_0x3405('0x1c')](_0x2e0fd2)[_0x3405('0x1d')]();};}function respondWithResult(_0x96afc1,_0x4f486c){_0x4f486c=_0x4f486c||0xc8;return function(_0x1c3013){if(_0x1c3013){return _0x96afc1[_0x3405('0x1c')](_0x4f486c)[_0x3405('0x1e')](_0x1c3013);}};}function respondWithFilteredResult(_0x5741c7,_0x4c3144){return function(_0x464673){if(_0x464673){var _0x39582e=typeof _0x4c3144[_0x3405('0x1f')]===_0x3405('0x20')&&typeof _0x4c3144[_0x3405('0x21')]===_0x3405('0x20');var _0x1c4495=_0x464673[_0x3405('0x22')];var _0x5a66f7=_0x39582e?0x0:_0x4c3144[_0x3405('0x1f')];var _0x7b13a7=_0x39582e?_0x464673[_0x3405('0x22')]:_0x4c3144[_0x3405('0x1f')]+_0x4c3144[_0x3405('0x21')];var _0x396435;if(_0x7b13a7>=_0x1c4495){_0x7b13a7=_0x1c4495;_0x396435=0xc8;}else{_0x396435=0xce;}_0x5741c7[_0x3405('0x1c')](_0x396435);return _0x5741c7[_0x3405('0x23')](_0x3405('0x24'),_0x5a66f7+'-'+_0x7b13a7+'/'+_0x1c4495)[_0x3405('0x1e')](_0x464673);}return null;};}function patchUpdates(_0x121cef){return function(_0x5fa692){try{jsonpatch[_0x3405('0x25')](_0x5fa692,_0x121cef,!![]);}catch(_0x3457e7){return BPromise[_0x3405('0x26')](_0x3457e7);}return _0x5fa692[_0x3405('0x27')]();};}function saveUpdates(_0x52f1ee,_0x260826){return function(_0x369181){if(_0x369181){return _0x369181[_0x3405('0x28')](_0x52f1ee)['then'](function(_0x4f5ad8){return _0x4f5ad8;});}return null;};}function removeEntity(_0x295b47,_0xe1810b){return function(_0x42c69b){if(_0x42c69b){return _0x42c69b[_0x3405('0x29')]()[_0x3405('0x2a')](function(){_0x295b47[_0x3405('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfe8c67,_0x444596){return function(_0x433708){if(!_0x433708){_0xfe8c67[_0x3405('0x1b')](0x194);}return _0x433708;};}function handleError(_0x279881,_0x17ec5e){_0x17ec5e=_0x17ec5e||0x1f4;return function(_0x1394b0){logger[_0x3405('0x2b')](_0x1394b0['stack']);if(_0x1394b0[_0x3405('0x2c')]){delete _0x1394b0[_0x3405('0x2c')];}_0x279881[_0x3405('0x1c')](_0x17ec5e)[_0x3405('0x2d')](_0x1394b0);};}exports[_0x3405('0x2e')]=function(_0x247bf7,_0x164324){var _0x4b3310={},_0x13902e={},_0xecba45={'count':0x0,'rows':[]};var _0x55089a=_[_0x3405('0x2f')](db[_0x3405('0x30')][_0x3405('0x31')],function(_0x5758bc){return{'name':_0x5758bc[_0x3405('0x32')],'type':_0x5758bc[_0x3405('0x33')][_0x3405('0x34')]};});_0x13902e[_0x3405('0x35')]=_['map'](_0x55089a,_0x3405('0x2c'));_0x13902e[_0x3405('0x36')]=_[_0x3405('0x37')](_0x247bf7[_0x3405('0x36')]);_0x13902e['filters']=_[_0x3405('0x38')](_0x13902e[_0x3405('0x35')],_0x13902e[_0x3405('0x36')]);_0x4b3310[_0x3405('0x39')]=_['intersection'](_0x13902e['model'],qs[_0x3405('0x3a')](_0x247bf7['query'][_0x3405('0x3a')]));_0x4b3310[_0x3405('0x39')]=_0x4b3310[_0x3405('0x39')][_0x3405('0x3b')]?_0x4b3310[_0x3405('0x39')]:_0x13902e[_0x3405('0x35')];if(!_0x247bf7[_0x3405('0x36')][_0x3405('0x3c')](_0x3405('0x3d'))){_0x4b3310['limit']=qs[_0x3405('0x21')](_0x247bf7[_0x3405('0x36')][_0x3405('0x21')]);_0x4b3310[_0x3405('0x1f')]=qs[_0x3405('0x1f')](_0x247bf7[_0x3405('0x36')][_0x3405('0x1f')]);}_0x4b3310['order']=qs[_0x3405('0x3e')](_0x247bf7['query'][_0x3405('0x3e')]);_0x4b3310[_0x3405('0x3f')]=qs[_0x3405('0x40')](_['pick'](_0x247bf7[_0x3405('0x36')],_0x13902e[_0x3405('0x40')]),_0x55089a);if(_0x247bf7[_0x3405('0x36')][_0x3405('0x41')]){_0x4b3310[_0x3405('0x3f')]=_['merge'](_0x4b3310[_0x3405('0x3f')],{'$or':_['map'](_0x55089a,function(_0x5c09af){if(_0x5c09af[_0x3405('0x33')]!=='VIRTUAL'){var _0x5b86a8={};_0x5b86a8[_0x5c09af[_0x3405('0x2c')]]={'$like':'%'+_0x247bf7[_0x3405('0x36')][_0x3405('0x41')]+'%'};return _0x5b86a8;}})});}_0x4b3310=_[_0x3405('0x42')]({},_0x4b3310,_0x247bf7[_0x3405('0x43')]);var _0x518193={'where':_0x4b3310[_0x3405('0x3f')]};return db[_0x3405('0x30')][_0x3405('0x22')](_0x518193)['then'](function(_0x476c4e){_0xecba45[_0x3405('0x22')]=_0x476c4e;if(_0x247bf7[_0x3405('0x36')][_0x3405('0x44')]){_0x4b3310[_0x3405('0x45')]=[{'all':!![]}];}return db[_0x3405('0x30')][_0x3405('0x46')](_0x4b3310);})[_0x3405('0x2a')](function(_0x132064){_0xecba45[_0x3405('0x47')]=_0x132064;return _0xecba45;})['then'](respondWithFilteredResult(_0x164324,_0x4b3310))[_0x3405('0x48')](handleError(_0x164324,null));};exports[_0x3405('0x49')]=function(_0x17b673,_0x1e3318){var _0xe37d31={'raw':!![],'where':{'id':_0x17b673[_0x3405('0x4a')]['id']}},_0x128b4c={};_0x128b4c[_0x3405('0x35')]=_[_0x3405('0x37')](db['SalesforceField'][_0x3405('0x31')]);_0x128b4c[_0x3405('0x36')]=_[_0x3405('0x37')](_0x17b673[_0x3405('0x36')]);_0x128b4c[_0x3405('0x40')]=_[_0x3405('0x38')](_0x128b4c['model'],_0x128b4c['query']);_0xe37d31['attributes']=_[_0x3405('0x38')](_0x128b4c['model'],qs[_0x3405('0x3a')](_0x17b673[_0x3405('0x36')][_0x3405('0x3a')]));_0xe37d31[_0x3405('0x39')]=_0xe37d31[_0x3405('0x39')][_0x3405('0x3b')]?_0xe37d31[_0x3405('0x39')]:_0x128b4c[_0x3405('0x35')];if(_0x17b673[_0x3405('0x36')][_0x3405('0x44')]){_0xe37d31[_0x3405('0x45')]=[{'all':!![]}];}_0xe37d31=_['merge']({},_0xe37d31,_0x17b673[_0x3405('0x43')]);return db[_0x3405('0x30')]['find'](_0xe37d31)[_0x3405('0x2a')](handleEntityNotFound(_0x1e3318,null))[_0x3405('0x2a')](respondWithResult(_0x1e3318,null))[_0x3405('0x48')](handleError(_0x1e3318,null));};exports[_0x3405('0x4b')]=function(_0x2b64d2,_0x494973){return db[_0x3405('0x30')]['create'](_0x2b64d2[_0x3405('0x4c')],{})[_0x3405('0x2a')](respondWithResult(_0x494973,0xc9))[_0x3405('0x48')](handleError(_0x494973,null));};exports[_0x3405('0x28')]=function(_0x1cb587,_0x24cdec){if(_0x1cb587[_0x3405('0x4c')]['id']){delete _0x1cb587[_0x3405('0x4c')]['id'];}return db[_0x3405('0x30')][_0x3405('0x4d')]({'where':{'id':_0x1cb587[_0x3405('0x4a')]['id']}})[_0x3405('0x2a')](handleEntityNotFound(_0x24cdec,null))[_0x3405('0x2a')](saveUpdates(_0x1cb587[_0x3405('0x4c')],null))[_0x3405('0x2a')](respondWithResult(_0x24cdec,null))[_0x3405('0x48')](handleError(_0x24cdec,null));};exports[_0x3405('0x29')]=function(_0x544814,_0x3f0b5a){return db[_0x3405('0x30')][_0x3405('0x4d')]({'where':{'id':_0x544814[_0x3405('0x4a')]['id']}})[_0x3405('0x2a')](handleEntityNotFound(_0x3f0b5a,null))[_0x3405('0x2a')](removeEntity(_0x3f0b5a,null))[_0x3405('0x48')](handleError(_0x3f0b5a,null));}; \ No newline at end of file +var _0x78a3=['destroy','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','end','name','send','index','map','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','SalesforceField','findAll','rows','show','params','keys','find','catch','create','body'];(function(_0x35841f,_0x3c96c7){var _0x1604ad=function(_0x4a9a57){while(--_0x4a9a57){_0x35841f['push'](_0x35841f['shift']());}};_0x1604ad(++_0x3c96c7);}(_0x78a3,0x1a5));var _0x378a=function(_0x1c9c24,_0x2a517b){_0x1c9c24=_0x1c9c24-0x0;var _0x349c69=_0x78a3[_0x1c9c24];return _0x349c69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x378a('0x0'));var zipdir=require(_0x378a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x378a('0x2'));var moment=require('moment');var BPromise=require(_0x378a('0x3'));var Mustache=require(_0x378a('0x4'));var util=require('util');var path=require(_0x378a('0x5'));var sox=require(_0x378a('0x6'));var csv=require(_0x378a('0x7'));var ejs=require(_0x378a('0x8'));var fs=require('fs');var fs_extra=require(_0x378a('0x9'));var _=require(_0x378a('0xa'));var squel=require('squel');var crypto=require(_0x378a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x378a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x378a('0xd'));var Papa=require('papaparse');var Redis=require(_0x378a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x378a('0xf'));var hardwareService=require(_0x378a('0x10'));var logger=require(_0x378a('0x11'))('api');var utils=require(_0x378a('0x12'));var config=require(_0x378a('0x13'));var licenseUtil=require(_0x378a('0x14'));var db=require(_0x378a('0x15'))['db'];function respondWithStatusCode(_0x850d1e,_0x4ba94c){_0x4ba94c=_0x4ba94c||0xcc;return function(_0x4f5d79){if(_0x4f5d79){return _0x850d1e[_0x378a('0x16')](_0x4ba94c);}return _0x850d1e[_0x378a('0x17')](_0x4ba94c)['end']();};}function respondWithResult(_0x487624,_0x471995){_0x471995=_0x471995||0xc8;return function(_0x315db5){if(_0x315db5){return _0x487624[_0x378a('0x17')](_0x471995)[_0x378a('0x18')](_0x315db5);}};}function respondWithFilteredResult(_0x51ce76,_0x79d953){return function(_0x4e3176){if(_0x4e3176){var _0x4fe336=typeof _0x79d953[_0x378a('0x19')]===_0x378a('0x1a')&&typeof _0x79d953['limit']===_0x378a('0x1a');var _0x256232=_0x4e3176[_0x378a('0x1b')];var _0x448a92=_0x4fe336?0x0:_0x79d953['offset'];var _0x4cce64=_0x4fe336?_0x4e3176[_0x378a('0x1b')]:_0x79d953[_0x378a('0x19')]+_0x79d953[_0x378a('0x1c')];var _0x323cd9;if(_0x4cce64>=_0x256232){_0x4cce64=_0x256232;_0x323cd9=0xc8;}else{_0x323cd9=0xce;}_0x51ce76[_0x378a('0x17')](_0x323cd9);return _0x51ce76['set'](_0x378a('0x1d'),_0x448a92+'-'+_0x4cce64+'/'+_0x256232)[_0x378a('0x18')](_0x4e3176);}return null;};}function patchUpdates(_0x1c2310){return function(_0x555188){try{jsonpatch[_0x378a('0x1e')](_0x555188,_0x1c2310,!![]);}catch(_0x2b0082){return BPromise[_0x378a('0x1f')](_0x2b0082);}return _0x555188['save']();};}function saveUpdates(_0x5598dc,_0x5ddaf1){return function(_0x506e99){if(_0x506e99){return _0x506e99[_0x378a('0x20')](_0x5598dc)[_0x378a('0x21')](function(_0x59f939){return _0x59f939;});}return null;};}function removeEntity(_0x25ed39,_0x4247e7){return function(_0x43c4cd){if(_0x43c4cd){return _0x43c4cd['destroy']()['then'](function(){_0x25ed39[_0x378a('0x17')](0xcc)[_0x378a('0x22')]();});}};}function handleEntityNotFound(_0x201c1d,_0x2c4fbe){return function(_0x560ce1){if(!_0x560ce1){_0x201c1d[_0x378a('0x16')](0x194);}return _0x560ce1;};}function handleError(_0x2c830e,_0xe6eaba){_0xe6eaba=_0xe6eaba||0x1f4;return function(_0x28228c){logger['error'](_0x28228c['stack']);if(_0x28228c[_0x378a('0x23')]){delete _0x28228c[_0x378a('0x23')];}_0x2c830e[_0x378a('0x17')](_0xe6eaba)[_0x378a('0x24')](_0x28228c);};}exports[_0x378a('0x25')]=function(_0x1383d6,_0x2c77d2){var _0x42f6f7={},_0x42cf20={},_0x3bcef5={'count':0x0,'rows':[]};var _0x246a74=_[_0x378a('0x26')](db['SalesforceField'][_0x378a('0x27')],function(_0x59f830){return{'name':_0x59f830[_0x378a('0x28')],'type':_0x59f830[_0x378a('0x29')]['key']};});_0x42cf20[_0x378a('0x2a')]=_['map'](_0x246a74,_0x378a('0x23'));_0x42cf20[_0x378a('0x2b')]=_['keys'](_0x1383d6['query']);_0x42cf20['filters']=_['intersection'](_0x42cf20[_0x378a('0x2a')],_0x42cf20['query']);_0x42f6f7[_0x378a('0x2c')]=_[_0x378a('0x2d')](_0x42cf20[_0x378a('0x2a')],qs['fields'](_0x1383d6[_0x378a('0x2b')][_0x378a('0x2e')]));_0x42f6f7['attributes']=_0x42f6f7[_0x378a('0x2c')][_0x378a('0x2f')]?_0x42f6f7[_0x378a('0x2c')]:_0x42cf20['model'];if(!_0x1383d6['query'][_0x378a('0x30')](_0x378a('0x31'))){_0x42f6f7['limit']=qs[_0x378a('0x1c')](_0x1383d6[_0x378a('0x2b')][_0x378a('0x1c')]);_0x42f6f7['offset']=qs[_0x378a('0x19')](_0x1383d6[_0x378a('0x2b')][_0x378a('0x19')]);}_0x42f6f7['order']=qs[_0x378a('0x32')](_0x1383d6['query'][_0x378a('0x32')]);_0x42f6f7[_0x378a('0x33')]=qs[_0x378a('0x34')](_['pick'](_0x1383d6[_0x378a('0x2b')],_0x42cf20[_0x378a('0x34')]),_0x246a74);if(_0x1383d6[_0x378a('0x2b')][_0x378a('0x35')]){_0x42f6f7[_0x378a('0x33')]=_['merge'](_0x42f6f7[_0x378a('0x33')],{'$or':_['map'](_0x246a74,function(_0x2f0a8a){if(_0x2f0a8a[_0x378a('0x29')]!==_0x378a('0x36')){var _0x1b5c23={};_0x1b5c23[_0x2f0a8a[_0x378a('0x23')]]={'$like':'%'+_0x1383d6[_0x378a('0x2b')][_0x378a('0x35')]+'%'};return _0x1b5c23;}})});}_0x42f6f7=_[_0x378a('0x37')]({},_0x42f6f7,_0x1383d6[_0x378a('0x38')]);var _0x554f80={'where':_0x42f6f7['where']};return db['SalesforceField'][_0x378a('0x1b')](_0x554f80)[_0x378a('0x21')](function(_0x1068ea){_0x3bcef5['count']=_0x1068ea;if(_0x1383d6[_0x378a('0x2b')][_0x378a('0x39')]){_0x42f6f7[_0x378a('0x3a')]=[{'all':!![]}];}return db[_0x378a('0x3b')][_0x378a('0x3c')](_0x42f6f7);})[_0x378a('0x21')](function(_0x203b47){_0x3bcef5[_0x378a('0x3d')]=_0x203b47;return _0x3bcef5;})[_0x378a('0x21')](respondWithFilteredResult(_0x2c77d2,_0x42f6f7))['catch'](handleError(_0x2c77d2,null));};exports[_0x378a('0x3e')]=function(_0x4a8d34,_0x21d36b){var _0xb7eed4={'raw':!![],'where':{'id':_0x4a8d34[_0x378a('0x3f')]['id']}},_0x25df58={};_0x25df58['model']=_[_0x378a('0x40')](db[_0x378a('0x3b')][_0x378a('0x27')]);_0x25df58[_0x378a('0x2b')]=_[_0x378a('0x40')](_0x4a8d34[_0x378a('0x2b')]);_0x25df58[_0x378a('0x34')]=_['intersection'](_0x25df58['model'],_0x25df58[_0x378a('0x2b')]);_0xb7eed4['attributes']=_[_0x378a('0x2d')](_0x25df58[_0x378a('0x2a')],qs[_0x378a('0x2e')](_0x4a8d34[_0x378a('0x2b')][_0x378a('0x2e')]));_0xb7eed4[_0x378a('0x2c')]=_0xb7eed4[_0x378a('0x2c')]['length']?_0xb7eed4[_0x378a('0x2c')]:_0x25df58[_0x378a('0x2a')];if(_0x4a8d34[_0x378a('0x2b')][_0x378a('0x39')]){_0xb7eed4[_0x378a('0x3a')]=[{'all':!![]}];}_0xb7eed4=_[_0x378a('0x37')]({},_0xb7eed4,_0x4a8d34[_0x378a('0x38')]);return db['SalesforceField'][_0x378a('0x41')](_0xb7eed4)[_0x378a('0x21')](handleEntityNotFound(_0x21d36b,null))['then'](respondWithResult(_0x21d36b,null))[_0x378a('0x42')](handleError(_0x21d36b,null));};exports[_0x378a('0x43')]=function(_0x2af220,_0x26be8c){return db[_0x378a('0x3b')][_0x378a('0x43')](_0x2af220['body'],{})['then'](respondWithResult(_0x26be8c,0xc9))['catch'](handleError(_0x26be8c,null));};exports['update']=function(_0x548359,_0x166451){if(_0x548359[_0x378a('0x44')]['id']){delete _0x548359['body']['id'];}return db['SalesforceField'][_0x378a('0x41')]({'where':{'id':_0x548359['params']['id']}})[_0x378a('0x21')](handleEntityNotFound(_0x166451,null))['then'](saveUpdates(_0x548359['body'],null))[_0x378a('0x21')](respondWithResult(_0x166451,null))[_0x378a('0x42')](handleError(_0x166451,null));};exports[_0x378a('0x45')]=function(_0x5112ab,_0x3f02cb){return db[_0x378a('0x3b')]['find']({'where':{'id':_0x5112ab['params']['id']}})['then'](handleEntityNotFound(_0x3f02cb,null))['then'](removeEntity(_0x3f02cb,null))[_0x378a('0x42')](handleError(_0x3f02cb,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 05e72d8..0bda016 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 _0x5afb=['request-promise','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','util','bluebird'];(function(_0x45c5d7,_0x1d0928){var _0x54f9d9=function(_0x425168){while(--_0x425168){_0x45c5d7['push'](_0x45c5d7['shift']());}};_0x54f9d9(++_0x1d0928);}(_0x5afb,0x94));var _0xb5af=function(_0x281353,_0x5d53a9){_0x281353=_0x281353-0x0;var _0x4f4e7b=_0x5afb[_0x281353];return _0x4f4e7b;};'use strict';var _=require('lodash');var util=require(_0xb5af('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb5af('0x1'));var rp=require(_0xb5af('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb5af('0x3'));var attributes=require(_0xb5af('0x4'));module[_0xb5af('0x5')]=function(_0x72bda3,_0x44377b){return _0x72bda3['define'](_0xb5af('0x6'),attributes,{'tableName':_0xb5af('0x7'),'paranoid':![],'indexes':[{'name':_0xb5af('0x8'),'fields':[_0xb5af('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe6f1=['define','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xe6f1,0x12b));var _0x1e6f=function(_0x58df61,_0x263bda){_0x58df61=_0x58df61-0x0;var _0x2af205=_0xe6f1[_0x58df61];return _0x2af205;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1e6f('0x0'))(_0x1e6f('0x1'));var moment=require('moment');var BPromise=require(_0x1e6f('0x2'));var rp=require(_0x1e6f('0x3'));var fs=require('fs');var path=require(_0x1e6f('0x4'));var rimraf=require(_0x1e6f('0x5'));var config=require(_0x1e6f('0x6'));var attributes=require(_0x1e6f('0x7'));module[_0x1e6f('0x8')]=function(_0x5b28d5,_0x4fb8b4){return _0x5b28d5[_0x1e6f('0x9')](_0x1e6f('0xa'),attributes,{'tableName':_0x1e6f('0xb'),'paranoid':![],'indexes':[{'name':_0x1e6f('0xc'),'fields':['idField',_0x1e6f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index bb23a2e..55d399e 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 _0xcafa=['../../config/logger','rpc','jayson/promise','client','http','request','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1e294e,_0x5d8455){var _0x18fa86=function(_0x58be42){while(--_0x58be42){_0x1e294e['push'](_0x1e294e['shift']());}};_0x18fa86(++_0x5d8455);}(_0xcafa,0xc9));var _0xacaf=function(_0x42c01c,_0x433f5b){_0x42c01c=_0x42c01c-0x0;var _0x563dc8=_0xcafa[_0x42c01c];return _0x563dc8;};'use strict';var _=require(_0xacaf('0x0'));var util=require('util');var moment=require(_0xacaf('0x1'));var BPromise=require(_0xacaf('0x2'));var rs=require(_0xacaf('0x3'));var fs=require('fs');var Redis=require(_0xacaf('0x4'));var db=require(_0xacaf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xacaf('0x6'))(_0xacaf('0x7'));var config=require('../../config/environment');var jayson=require(_0xacaf('0x8'));var client=jayson[_0xacaf('0x9')][_0xacaf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e17e3,_0x4f6909,_0x42c0ce){return new BPromise(function(_0x280bf3,_0x1a15da){return client[_0xacaf('0xb')](_0x1e17e3,_0x42c0ce)['then'](function(_0x9bd44b){logger['info'](_0xacaf('0xc'),_0x4f6909,'request\x20sent');logger[_0xacaf('0xd')](_0xacaf('0xe'),_0x4f6909,'request\x20sent',JSON[_0xacaf('0xf')](_0x9bd44b));if(_0x9bd44b[_0xacaf('0x10')]){if(_0x9bd44b[_0xacaf('0x10')][_0xacaf('0x11')]===0x1f4){logger[_0xacaf('0x10')]('SalesforceField,\x20%s,\x20%s',_0x4f6909,_0x9bd44b[_0xacaf('0x10')][_0xacaf('0x12')]);return _0x1a15da(_0x9bd44b[_0xacaf('0x10')][_0xacaf('0x12')]);}logger[_0xacaf('0x10')]('SalesforceField,\x20%s,\x20%s',_0x4f6909,_0x9bd44b['error'][_0xacaf('0x12')]);return _0x280bf3(_0x9bd44b[_0xacaf('0x10')][_0xacaf('0x12')]);}else{logger[_0xacaf('0x13')](_0xacaf('0xc'),_0x4f6909,_0xacaf('0x14'));_0x280bf3(_0x9bd44b[_0xacaf('0x15')][_0xacaf('0x12')]);}})[_0xacaf('0x16')](function(_0x3cb42f){logger['error']('SalesforceField,\x20%s,\x20%s',_0x4f6909,_0x3cb42f);_0x1a15da(_0x3cb42f);});});} \ No newline at end of file +var _0xf67c=['request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x903228,_0x42c429){var _0xcec81d=function(_0x4da97a){while(--_0x4da97a){_0x903228['push'](_0x903228['shift']());}};_0xcec81d(++_0x42c429);}(_0xf67c,0x17c));var _0xcf67=function(_0x5f25e9,_0x2c0498){_0x5f25e9=_0x5f25e9-0x0;var _0x2d4487=_0xf67c[_0x5f25e9];return _0x2d4487;};'use strict';var _=require(_0xcf67('0x0'));var util=require('util');var moment=require(_0xcf67('0x1'));var BPromise=require(_0xcf67('0x2'));var rs=require(_0xcf67('0x3'));var fs=require('fs');var Redis=require(_0xcf67('0x4'));var db=require(_0xcf67('0x5'))['db'];var utils=require(_0xcf67('0x6'));var logger=require(_0xcf67('0x7'))('rpc');var config=require(_0xcf67('0x8'));var jayson=require(_0xcf67('0x9'));var client=jayson['client'][_0xcf67('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43a64a,_0x3088c2,_0xfa9def){return new BPromise(function(_0x4813ed,_0x48ec11){return client[_0xcf67('0xb')](_0x43a64a,_0xfa9def)[_0xcf67('0xc')](function(_0x282ea8){logger[_0xcf67('0xd')](_0xcf67('0xe'),_0x3088c2,_0xcf67('0xf'));logger[_0xcf67('0x10')](_0xcf67('0x11'),_0x3088c2,'request\x20sent',JSON[_0xcf67('0x12')](_0x282ea8));if(_0x282ea8[_0xcf67('0x13')]){if(_0x282ea8[_0xcf67('0x13')][_0xcf67('0x14')]===0x1f4){logger['error'](_0xcf67('0xe'),_0x3088c2,_0x282ea8[_0xcf67('0x13')]['message']);return _0x48ec11(_0x282ea8[_0xcf67('0x13')]['message']);}logger[_0xcf67('0x13')](_0xcf67('0xe'),_0x3088c2,_0x282ea8[_0xcf67('0x13')]['message']);return _0x4813ed(_0x282ea8['error']['message']);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x3088c2,_0xcf67('0xf'));_0x4813ed(_0x282ea8[_0xcf67('0x15')][_0xcf67('0x16')]);}})['catch'](function(_0x11818a){logger[_0xcf67('0x13')](_0xcf67('0xe'),_0x3088c2,_0x11818a);_0x48ec11(_0x11818a);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index e4ea1dc..1f0603b 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 _0x0b25=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getFields','addConfiguration','put','update','delete'];(function(_0x19b981,_0x50edd4){var _0x1cd2d3=function(_0x15324c){while(--_0x15324c){_0x19b981['push'](_0x19b981['shift']());}};_0x1cd2d3(++_0x50edd4);}(_0x0b25,0x155));var _0x50b2=function(_0x5dfc2a,_0x1a953f){_0x5dfc2a=_0x5dfc2a-0x0;var _0x3f1a71=_0x0b25[_0x5dfc2a];return _0x3f1a71;};'use strict';var multer=require(_0x50b2('0x0'));var util=require(_0x50b2('0x1'));var path=require(_0x50b2('0x2'));var timeout=require(_0x50b2('0x3'));var express=require(_0x50b2('0x4'));var router=express[_0x50b2('0x5')]();var fs_extra=require(_0x50b2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50b2('0x7'));var controller=require('./intServicenowAccount.controller');router[_0x50b2('0x8')]('/',auth[_0x50b2('0x9')](),controller[_0x50b2('0xa')]);router[_0x50b2('0x8')](_0x50b2('0xb'),auth['isAuthenticated'](),controller[_0x50b2('0xc')]);router[_0x50b2('0x8')](_0x50b2('0xd'),auth[_0x50b2('0x9')](),controller['getConfigurations']);router[_0x50b2('0x8')]('/:id/fields',auth[_0x50b2('0x9')](),controller[_0x50b2('0xe')]);router['post']('/',auth[_0x50b2('0x9')](),controller['create']);router['post'](_0x50b2('0xd'),auth[_0x50b2('0x9')](),controller[_0x50b2('0xf')]);router[_0x50b2('0x10')](_0x50b2('0xb'),auth[_0x50b2('0x9')](),controller[_0x50b2('0x11')]);router[_0x50b2('0x12')](_0x50b2('0xb'),auth[_0x50b2('0x9')](),controller[_0x50b2('0x13')]);module['exports']=router; \ No newline at end of file +var _0x518d=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','exports','multer','util'];(function(_0x5d897a,_0x5ee145){var _0x56d8a8=function(_0xb87fdd){while(--_0xb87fdd){_0x5d897a['push'](_0x5d897a['shift']());}};_0x56d8a8(++_0x5ee145);}(_0x518d,0x140));var _0xd518=function(_0xe31c3d,_0x1aeed6){_0xe31c3d=_0xe31c3d-0x0;var _0x7c777e=_0x518d[_0xe31c3d];return _0x7c777e;};'use strict';var multer=require(_0xd518('0x0'));var util=require(_0xd518('0x1'));var path=require(_0xd518('0x2'));var timeout=require('connect-timeout');var express=require(_0xd518('0x3'));var router=express[_0xd518('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd518('0x5'));var interaction=require(_0xd518('0x6'));var config=require(_0xd518('0x7'));var controller=require(_0xd518('0x8'));router[_0xd518('0x9')]('/',auth[_0xd518('0xa')](),controller[_0xd518('0xb')]);router[_0xd518('0x9')](_0xd518('0xc'),auth[_0xd518('0xa')](),controller['show']);router[_0xd518('0x9')](_0xd518('0xd'),auth['isAuthenticated'](),controller[_0xd518('0xe')]);router[_0xd518('0x9')](_0xd518('0xf'),auth['isAuthenticated'](),controller[_0xd518('0x10')]);router[_0xd518('0x11')]('/',auth[_0xd518('0xa')](),controller[_0xd518('0x12')]);router[_0xd518('0x11')](_0xd518('0xd'),auth['isAuthenticated'](),controller[_0xd518('0x13')]);router[_0xd518('0x14')](_0xd518('0xc'),auth[_0xd518('0xa')](),controller[_0xd518('0x15')]);router['delete']('/:id',auth[_0xd518('0xa')](),controller['destroy']);module[_0xd518('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index b1727f9..97e8072 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 _0xd86c=['STRING','username','remoteUri','exports'];(function(_0xc88bc4,_0xa44c68){var _0x598833=function(_0x5d7bdb){while(--_0x5d7bdb){_0xc88bc4['push'](_0xc88bc4['shift']());}};_0x598833(++_0xa44c68);}(_0xd86c,0x7b));var _0xcd86=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xd86c[_0x16dbfd];return _0x382254;};'use strict';var Sequelize=require('sequelize');module[_0xcd86('0x0')]={'name':{'type':Sequelize[_0xcd86('0x1')]},'description':{'type':Sequelize[_0xcd86('0x1')]},'username':{'type':Sequelize[_0xcd86('0x1')],'unique':_0xcd86('0x2')},'password':{'type':Sequelize[_0xcd86('0x1')]},'email':{'type':Sequelize[_0xcd86('0x1')]},'remoteUri':{'type':Sequelize[_0xcd86('0x1')],'unique':_0xcd86('0x3')},'serverUrl':{'type':Sequelize[_0xcd86('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xcd26=['username','exports','STRING'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0xcd26,0x19f));var _0x6cd2=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0xcd26[_0x460150];return _0x340677;};'use strict';var Sequelize=require('sequelize');module[_0x6cd2('0x0')]={'name':{'type':Sequelize[_0x6cd2('0x1')]},'description':{'type':Sequelize[_0x6cd2('0x1')]},'username':{'type':Sequelize[_0x6cd2('0x1')],'unique':_0x6cd2('0x2')},'password':{'type':Sequelize[_0x6cd2('0x1')]},'email':{'type':Sequelize[_0x6cd2('0x1')]},'remoteUri':{'type':Sequelize[_0x6cd2('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6cd2('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 490157d..8a5e22c 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 _0xd3ce=['caller_id','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','reassignment_count','activity_due','severity','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','test','boolean','True','true','False','false','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','ServicenowConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','category','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','rfc','time_worked','expected_start','opened_at','business_duration','reopened_time','resolved_at'];(function(_0x38f11f,_0x438e05){var _0x503943=function(_0x3746f7){while(--_0x3746f7){_0x38f11f['push'](_0x38f11f['shift']());}};_0x503943(++_0x438e05);}(_0xd3ce,0x1b3));var _0xed3c=function(_0x5dfe69,_0x293c29){_0x5dfe69=_0x5dfe69-0x0;var _0x179897=_0xd3ce[_0x5dfe69];return _0x179897;};'use strict';var emlformat=require(_0xed3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed3c('0x1'));var jsonpatch=require(_0xed3c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xed3c('0x3'));var Mustache=require(_0xed3c('0x4'));var util=require(_0xed3c('0x5'));var path=require(_0xed3c('0x6'));var sox=require(_0xed3c('0x7'));var csv=require(_0xed3c('0x8'));var ejs=require(_0xed3c('0x9'));var fs=require('fs');var fs_extra=require(_0xed3c('0xa'));var _=require(_0xed3c('0xb'));var squel=require(_0xed3c('0xc'));var crypto=require(_0xed3c('0xd'));var jsforce=require(_0xed3c('0xe'));var deskjs=require(_0xed3c('0xf'));var toCsv=require(_0xed3c('0x8'));var querystring=require('querystring');var Papa=require(_0xed3c('0x10'));var Redis=require('ioredis');var authService=require(_0xed3c('0x11'));var qs=require(_0xed3c('0x12'));var as=require(_0xed3c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed3c('0x14'))(_0xed3c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xed3c('0x16'));var db=require(_0xed3c('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x165e42,_0x46780b){_0x46780b=_0x46780b||0xcc;return function(_0x2a10c0){if(_0x2a10c0){return _0x165e42[_0xed3c('0x18')](_0x46780b);}return _0x165e42[_0xed3c('0x19')](_0x46780b)[_0xed3c('0x1a')]();};}function respondWithResult(_0x1d2c27,_0x359fa3){_0x359fa3=_0x359fa3||0xc8;return function(_0x20c3af){if(_0x20c3af){return _0x1d2c27[_0xed3c('0x19')](_0x359fa3)[_0xed3c('0x1b')](_0x20c3af);}};}function respondWithFilteredResult(_0x2b2c4a,_0x11bf03){return function(_0x50ae1e){if(_0x50ae1e){var _0x598af4=typeof _0x11bf03[_0xed3c('0x1c')]===_0xed3c('0x1d')&&typeof _0x11bf03['limit']===_0xed3c('0x1d');var _0x47e4b8=_0x50ae1e[_0xed3c('0x1e')];var _0x4d3f78=_0x598af4?0x0:_0x11bf03[_0xed3c('0x1c')];var _0x2c88c6=_0x598af4?_0x50ae1e[_0xed3c('0x1e')]:_0x11bf03[_0xed3c('0x1c')]+_0x11bf03[_0xed3c('0x1f')];var _0x22724b;if(_0x2c88c6>=_0x47e4b8){_0x2c88c6=_0x47e4b8;_0x22724b=0xc8;}else{_0x22724b=0xce;}_0x2b2c4a['status'](_0x22724b);return _0x2b2c4a[_0xed3c('0x20')](_0xed3c('0x21'),_0x4d3f78+'-'+_0x2c88c6+'/'+_0x47e4b8)['json'](_0x50ae1e);}return null;};}function patchUpdates(_0x18aa5a){return function(_0x1eb765){try{jsonpatch['apply'](_0x1eb765,_0x18aa5a,!![]);}catch(_0x1ebd79){return BPromise[_0xed3c('0x22')](_0x1ebd79);}return _0x1eb765['save']();};}function saveUpdates(_0x18ff09,_0x4e4f37){return function(_0x471854){if(_0x471854){return _0x471854[_0xed3c('0x23')](_0x18ff09)[_0xed3c('0x24')](function(_0x1bad7a){return _0x1bad7a;});}return null;};}function removeEntity(_0x17b64d,_0x4ab612){return function(_0x58f222){if(_0x58f222){return _0x58f222[_0xed3c('0x25')]()[_0xed3c('0x24')](function(){_0x17b64d[_0xed3c('0x19')](0xcc)[_0xed3c('0x1a')]();});}};}function handleEntityNotFound(_0x1b4ab3,_0x55cf75){return function(_0x43eaf8){if(!_0x43eaf8){_0x1b4ab3['sendStatus'](0x194);}return _0x43eaf8;};}function handleError(_0x4d3850,_0x321627){_0x321627=_0x321627||0x1f4;return function(_0x3f2190){logger[_0xed3c('0x26')](_0x3f2190[_0xed3c('0x27')]);if(_0x3f2190['name']){delete _0x3f2190[_0xed3c('0x28')];}_0x4d3850[_0xed3c('0x19')](_0x321627)[_0xed3c('0x29')](_0x3f2190);};}exports[_0xed3c('0x2a')]=function(_0x3a6ee1,_0x165622){var _0x5df89d={},_0x320055={},_0x39158d={'count':0x0,'rows':[]};var _0x4a7bd2=_[_0xed3c('0x2b')](db[_0xed3c('0x2c')][_0xed3c('0x2d')],function(_0x2b2b4c){return{'name':_0x2b2b4c[_0xed3c('0x2e')],'type':_0x2b2b4c[_0xed3c('0x2f')]['key']};});_0x320055[_0xed3c('0x30')]=_[_0xed3c('0x2b')](_0x4a7bd2,_0xed3c('0x28'));_0x320055[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x3a6ee1['query']);_0x320055[_0xed3c('0x33')]=_[_0xed3c('0x34')](_0x320055[_0xed3c('0x30')],_0x320055[_0xed3c('0x31')]);_0x5df89d[_0xed3c('0x35')]=_[_0xed3c('0x34')](_0x320055['model'],qs[_0xed3c('0x36')](_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x36')]));_0x5df89d[_0xed3c('0x35')]=_0x5df89d[_0xed3c('0x35')][_0xed3c('0x37')]?_0x5df89d['attributes']:_0x320055['model'];if(!_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x38')](_0xed3c('0x39'))){_0x5df89d[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x1f')]);_0x5df89d['offset']=qs[_0xed3c('0x1c')](_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x1c')]);}_0x5df89d['order']=qs[_0xed3c('0x3a')](_0x3a6ee1['query']['sort']);_0x5df89d[_0xed3c('0x3b')]=qs[_0xed3c('0x33')](_[_0xed3c('0x3c')](_0x3a6ee1[_0xed3c('0x31')],_0x320055[_0xed3c('0x33')]),_0x4a7bd2);if(_0x3a6ee1['query']['filter']){_0x5df89d[_0xed3c('0x3b')]=_[_0xed3c('0x3d')](_0x5df89d[_0xed3c('0x3b')],{'$or':_[_0xed3c('0x2b')](_0x4a7bd2,function(_0x142db6){if(_0x142db6[_0xed3c('0x2f')]!==_0xed3c('0x3e')){var _0x15c70c={};_0x15c70c[_0x142db6[_0xed3c('0x28')]]={'$like':'%'+_0x3a6ee1[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x15c70c;}})});}_0x5df89d=_[_0xed3c('0x3d')]({},_0x5df89d,_0x3a6ee1[_0xed3c('0x40')]);var _0x1a5bb3={'where':_0x5df89d[_0xed3c('0x3b')]};return db[_0xed3c('0x2c')][_0xed3c('0x1e')](_0x1a5bb3)[_0xed3c('0x24')](function(_0x272bc9){_0x39158d[_0xed3c('0x1e')]=_0x272bc9;if(_0x3a6ee1[_0xed3c('0x31')]['includeAll']){_0x5df89d[_0xed3c('0x41')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xed3c('0x42')](_0x5df89d);})[_0xed3c('0x24')](function(_0x414aa){_0x39158d[_0xed3c('0x43')]=_0x414aa;return _0x39158d;})['then'](respondWithFilteredResult(_0x165622,_0x5df89d))[_0xed3c('0x44')](handleError(_0x165622,null));};exports[_0xed3c('0x45')]=function(_0x4e63ab,_0x372dc4){var _0x2a8d7a={'raw':![],'where':{'id':_0x4e63ab[_0xed3c('0x46')]['id']}},_0x5d2cca={};_0x5d2cca[_0xed3c('0x30')]=_[_0xed3c('0x32')](db['ServicenowAccount'][_0xed3c('0x2d')]);_0x5d2cca[_0xed3c('0x31')]=_[_0xed3c('0x32')](_0x4e63ab[_0xed3c('0x31')]);_0x5d2cca[_0xed3c('0x33')]=_['intersection'](_0x5d2cca[_0xed3c('0x30')],_0x5d2cca['query']);_0x2a8d7a[_0xed3c('0x35')]=_[_0xed3c('0x34')](_0x5d2cca[_0xed3c('0x30')],qs[_0xed3c('0x36')](_0x4e63ab[_0xed3c('0x31')][_0xed3c('0x36')]));_0x2a8d7a[_0xed3c('0x35')]=_0x2a8d7a[_0xed3c('0x35')][_0xed3c('0x37')]?_0x2a8d7a[_0xed3c('0x35')]:_0x5d2cca[_0xed3c('0x30')];if(_0x4e63ab['query']['includeAll']){_0x2a8d7a['include']=[{'all':!![]}];}_0x2a8d7a=_[_0xed3c('0x3d')]({},_0x2a8d7a,_0x4e63ab[_0xed3c('0x40')]);return db[_0xed3c('0x2c')][_0xed3c('0x47')](_0x2a8d7a)[_0xed3c('0x24')](handleEntityNotFound(_0x372dc4,null))[_0xed3c('0x24')](respondWithResult(_0x372dc4,null))[_0xed3c('0x44')](handleError(_0x372dc4,null));};exports['create']=function(_0x22596f,_0x32935e){return db[_0xed3c('0x2c')][_0xed3c('0x48')](_0x22596f[_0xed3c('0x49')],{})[_0xed3c('0x24')](respondWithResult(_0x32935e,0xc9))[_0xed3c('0x44')](handleError(_0x32935e,null));};exports[_0xed3c('0x23')]=function(_0x19dd2c,_0x2d5b06){if(_0x19dd2c[_0xed3c('0x49')]['id']){delete _0x19dd2c[_0xed3c('0x49')]['id'];}return db[_0xed3c('0x2c')][_0xed3c('0x47')]({'where':{'id':_0x19dd2c['params']['id']}})[_0xed3c('0x24')](handleEntityNotFound(_0x2d5b06,null))[_0xed3c('0x24')](saveUpdates(_0x19dd2c[_0xed3c('0x49')],null))['then'](respondWithResult(_0x2d5b06,null))['catch'](handleError(_0x2d5b06,null));};exports['destroy']=function(_0x3fb998,_0x98646a){return db['ServicenowAccount'][_0xed3c('0x47')]({'where':{'id':_0x3fb998[_0xed3c('0x46')]['id']}})[_0xed3c('0x24')](handleEntityNotFound(_0x98646a,null))[_0xed3c('0x24')](removeEntity(_0x98646a,null))['catch'](handleError(_0x98646a,null));};exports[_0xed3c('0x4a')]=function(_0x3b218c,_0x292dd1,_0x2221a1){var _0x21cbb1={};var _0x59e85d={};var _0x5e3780;var _0x36b3e3;return db[_0xed3c('0x2c')][_0xed3c('0x4b')]({'where':{'id':_0x3b218c[_0xed3c('0x46')]['id']}})[_0xed3c('0x24')](handleEntityNotFound(_0x292dd1,null))[_0xed3c('0x24')](function(_0x51c958){if(_0x51c958){_0x5e3780=_0x51c958;_0x59e85d[_0xed3c('0x30')]=_[_0xed3c('0x32')](db[_0xed3c('0x4c')][_0xed3c('0x2d')]);_0x59e85d[_0xed3c('0x31')]=_['keys'](_0x3b218c[_0xed3c('0x31')]);_0x59e85d['filters']=_['intersection'](_0x59e85d[_0xed3c('0x30')],_0x59e85d[_0xed3c('0x31')]);_0x21cbb1[_0xed3c('0x35')]=_[_0xed3c('0x34')](_0x59e85d[_0xed3c('0x30')],qs[_0xed3c('0x36')](_0x3b218c['query'][_0xed3c('0x36')]));_0x21cbb1['attributes']=_0x21cbb1[_0xed3c('0x35')][_0xed3c('0x37')]?_0x21cbb1[_0xed3c('0x35')]:_0x59e85d[_0xed3c('0x30')];_0x21cbb1[_0xed3c('0x4d')]=qs[_0xed3c('0x3a')](_0x3b218c[_0xed3c('0x31')][_0xed3c('0x3a')]);_0x21cbb1[_0xed3c('0x3b')]=qs[_0xed3c('0x33')](_['pick'](_0x3b218c['query'],_0x59e85d[_0xed3c('0x33')]));if(_0x3b218c['query'][_0xed3c('0x3f')]){_0x21cbb1[_0xed3c('0x3b')]=_['merge'](_0x21cbb1[_0xed3c('0x3b')],{'$or':_['map'](_0x21cbb1[_0xed3c('0x35')],function(_0x124ba7){var _0x4f967e={};_0x4f967e[_0x124ba7]={'$like':'%'+_0x3b218c[_0xed3c('0x31')][_0xed3c('0x3f')]+'%'};return _0x4f967e;})});}_0x21cbb1=_['merge']({},_0x21cbb1,_0x3b218c[_0xed3c('0x40')]);return _0x5e3780[_0xed3c('0x4a')](_0x21cbb1);}})[_0xed3c('0x24')](function(_0x1333ab){if(_0x1333ab){_0x36b3e3=_0x1333ab[_0xed3c('0x37')];if(!_0x3b218c[_0xed3c('0x31')][_0xed3c('0x38')]('nolimit')){_0x21cbb1[_0xed3c('0x1f')]=qs[_0xed3c('0x1f')](_0x3b218c[_0xed3c('0x31')][_0xed3c('0x1f')]);_0x21cbb1['offset']=qs[_0xed3c('0x1c')](_0x3b218c[_0xed3c('0x31')][_0xed3c('0x1c')]);}return _0x5e3780[_0xed3c('0x4a')](_0x21cbb1);}})[_0xed3c('0x24')](function(_0x5eb512){if(_0x5eb512){return _0x5eb512?{'count':_0x36b3e3,'rows':_0x5eb512}:null;}})['then'](respondWithResult(_0x292dd1,null))['catch'](handleError(_0x292dd1,null));};exports[_0xed3c('0x4e')]=function(_0x4c738a,_0x4a7ace,_0x181eee){if(_0x4c738a['body']['id']){delete _0x4c738a[_0xed3c('0x49')]['id'];}return db[_0xed3c('0x2c')]['findOne']({'where':{'id':_0x4c738a[_0xed3c('0x46')]['id']}})[_0xed3c('0x24')](handleEntityNotFound(_0x4a7ace,null))['then'](function(_0x42a0c9){if(_0x42a0c9){_0x4c738a[_0xed3c('0x49')]['AccountId']=_0x42a0c9['id'];_0x4c738a[_0xed3c('0x49')][_0xed3c('0x4f')]=integrations[_0xed3c('0x50')](_0x4c738a[_0xed3c('0x49')][_0xed3c('0x51')],_0x4c738a['body'][_0xed3c('0x2f')]);_0x4c738a[_0xed3c('0x49')][_0xed3c('0x52')]=integrations[_0xed3c('0x53')](_0x4c738a[_0xed3c('0x49')][_0xed3c('0x51')],_0x4c738a[_0xed3c('0x49')][_0xed3c('0x2f')]);return db[_0xed3c('0x4c')][_0xed3c('0x48')](_0x4c738a[_0xed3c('0x49')],{'include':[{'model':db[_0xed3c('0x54')],'as':_0xed3c('0x4f')},{'model':db[_0xed3c('0x54')],'as':_0xed3c('0x52')}]});}return null;})[_0xed3c('0x24')](respondWithResult(_0x4a7ace,null))[_0xed3c('0x44')](handleError(_0x4a7ace,null));};exports[_0xed3c('0x55')]=function(_0xc6b518,_0x542001,_0x4d1c74){var _0x48c762=[_0xed3c('0x56'),_0xed3c('0x57'),_0xed3c('0x58'),_0xed3c('0x59'),_0xed3c('0x5a'),_0xed3c('0x5b'),'incident_state','severity',_0xed3c('0x5c')];var _0x38d117=['parent','made_sla',_0xed3c('0x5d'),_0xed3c('0x5e'),_0xed3c('0x5f'),_0xed3c('0x60'),_0xed3c('0x61'),_0xed3c('0x57'),'approval_history',_0xed3c('0x62'),_0xed3c('0x63'),_0xed3c('0x64'),_0xed3c('0x65'),_0xed3c('0x66'),'sys_created_on',_0xed3c('0x67'),'state',_0xed3c('0x68'),_0xed3c('0x58'),_0xed3c('0x4d'),_0xed3c('0x69'),_0xed3c('0x6a'),_0xed3c('0x6b'),_0xed3c('0x6c'),_0xed3c('0x6d'),_0xed3c('0x6e'),'work_notes_list',_0xed3c('0x6f'),_0xed3c('0x70'),'sys_domain_path',_0xed3c('0x71'),_0xed3c('0x72'),_0xed3c('0x73'),_0xed3c('0x74'),_0xed3c('0x75'),'group_list','work_end',_0xed3c('0x76'),_0xed3c('0x77'),_0xed3c('0x78'),_0xed3c('0x79'),_0xed3c('0x59'),_0xed3c('0x7a'),'short_description',_0xed3c('0x5a'),_0xed3c('0x7b'),'delivery_task',_0xed3c('0x7c'),_0xed3c('0x7d'),_0xed3c('0x7e'),_0xed3c('0x7f'),_0xed3c('0x80'),_0xed3c('0x81'),'notify',_0xed3c('0x82'),'close_notes',_0xed3c('0x83'),_0xed3c('0x84'),'parent_incident',_0xed3c('0x85'),_0xed3c('0x86'),_0xed3c('0x87'),_0xed3c('0x88'),_0xed3c('0x89'),_0xed3c('0x8a'),'company',_0xed3c('0x8b'),_0xed3c('0x8c'),'assigned_to',_0xed3c('0x8d'),_0xed3c('0x8e'),_0xed3c('0x8f'),_0xed3c('0x90'),_0xed3c('0x91'),'due_date',_0xed3c('0x92'),_0xed3c('0x93'),_0xed3c('0x94'),_0xed3c('0x95'),_0xed3c('0x96'),_0xed3c('0x97'),'location',_0xed3c('0x5c')];var _0x1b98d8='';var _0x44002d='';var _0x108a2e=[];var _0x168993='';var _0x2247c6='';var _0x533049=[];var _0x18b19b='';var _0x1fde02='';var _0x2075e9={};var _0x2afa07='';return db[_0xed3c('0x2c')][_0xed3c('0x4b')]({'where':{'id':_0xc6b518['params']['id']},'attributes':['id',_0xed3c('0x98'),_0xed3c('0x99'),_0xed3c('0x9a'),_0xed3c('0x9b'),_0xed3c('0x9c')]})['then'](handleEntityNotFound(_0x542001,null))['then'](function(_0x4049da){if(_0x4049da){_0x2afa07=_0x4049da[_0xed3c('0x9b')];var _0x4f9b3f=_0x2afa07[_0xed3c('0x9d')](-0x1);if(_0x4f9b3f==='/'){_0x2afa07=_0x2afa07[_0xed3c('0x9e')](0x0,_0x2afa07['lastIndexOf'](_0x4f9b3f));}_0x1fde02=util[_0xed3c('0x9f')](_0xed3c('0xa0'),_0x2afa07);_0x18b19b=util[_0xed3c('0x9f')]('%s/api/now/table/',_0x2afa07);_0x2075e9={'user':_0x4049da['username'],'pass':_0x4049da[_0xed3c('0x99')]};var _0x4cab7e={'method':_0xed3c('0xa1'),'uri':_0x1fde02+_0xed3c('0xa2'),'auth':_0x2075e9,'json':!![]};return rp(_0x4cab7e);}})[_0xed3c('0x24')](function(_0x2dd60a){if(_0x2dd60a[_0xed3c('0xa3')][_0xed3c('0x37')]>0x0){_0x1b98d8=_0x2dd60a[_0xed3c('0xa3')];}console[_0xed3c('0xa4')](_0xed3c('0xa5'),_0x1b98d8);_0x533049=[];_0x44002d=Object['assign']([],_0x1b98d8);_[_0xed3c('0xa6')](_0x44002d,function(_0x57268a){return!_0x48c762[_0xed3c('0xa7')](_0x57268a[_0xed3c('0x28')]);});_0x44002d[_0xed3c('0xa8')](function(_0x10cc70){var _0xe06027=createFieldObject(_0x18b19b,_0x2075e9,_0x10cc70[_0xed3c('0xa9')],_0x10cc70['name'],_0x10cc70[_0xed3c('0xaa')],![]);_0x533049[_0xed3c('0xab')](_0xe06027);});return Promise[_0xed3c('0xac')](_0x533049);})['then'](function(_0x6bf0b0){_0x108a2e=_0x6bf0b0;_0x168993=Object[_0xed3c('0xad')]([],_0x1b98d8);console['log'](_0xed3c('0xae'),_0x1b98d8);_['remove'](_0x168993,function(_0x77a49b){return _0x38d117['includes'](_0x77a49b[_0xed3c('0x28')]);});console[_0xed3c('0xa4')](_0xed3c('0xaf'),_0x168993);_0x533049=[];_0x168993[_0xed3c('0xa8')](function(_0x50a0e3){var _0x32a868=createFieldObject(_0x18b19b,_0x2075e9,_0x50a0e3[_0xed3c('0xa9')],_0x50a0e3['name'],_0x50a0e3['label'],!![]);_0x533049[_0xed3c('0xab')](_0x32a868);});return Promise[_0xed3c('0xac')](_0x533049);})[_0xed3c('0x24')](function(_0x2e6fc8){_0x2247c6=_0x2e6fc8;var _0x18635b=_0x108a2e[_0xed3c('0xb0')](_0x2247c6);return{'count':_0x18635b[_0xed3c('0x37')],'rows':_0x18635b};})[_0xed3c('0x24')](respondWithResult(_0x542001,null))[_0xed3c('0x44')](function(_0x574f78){console[_0xed3c('0xa4')](_0xed3c('0xb1')+_0x574f78);var _0x211943=_0xc6b518[_0xed3c('0x31')]['test']?0x1f4:_0x574f78[_0xed3c('0xb2')]||0x1f4;logger['error'](_0x574f78[_0xed3c('0x27')]);delete _0x574f78[_0xed3c('0x28')];if(_0x211943===0x191){_0x211943=0x190;}_0x542001[_0xed3c('0x19')](_0x211943)[_0xed3c('0x29')](_0xc6b518[_0xed3c('0x31')][_0xed3c('0xb3')]?{'message':'Wrong\x20credentials','statusCode':_0x574f78['statusCode']}:_0x574f78);});};function createFieldObject(_0x110f83,_0x5d1264,_0xe4eff6,_0x50c701,_0x37ee9e,_0x2609bb){return new Promise(function(_0xe16ba2,_0x554c1f){var _0x21fcc0={'id':_0x50c701,'name':_0x37ee9e,'custom':_0x2609bb};if(_0xe4eff6===_0xed3c('0xb4')){_0x21fcc0['options']=[{'name':_0xed3c('0xb5'),'value':_0xed3c('0xb6')},{'name':_0xed3c('0xb7'),'value':_0xed3c('0xb8')}];_0xe16ba2(_0x21fcc0);}else{var _0x80f0e1={'method':_0xed3c('0xa1'),'uri':_0x110f83+'sys_choice?sysparm_query=name=incident^element='+_0x50c701,'auth':_0x5d1264,'json':!![]};return rp(_0x80f0e1)[_0xed3c('0x24')](function(_0x4d3e00){var _0x2414e6=[];if(_0x4d3e00[_0xed3c('0xa3')][_0xed3c('0x37')]>0x0){_0x4d3e00[_0xed3c('0xa3')]['forEach'](function(_0x1fd6da){if(_0x1fd6da['inactive']==='false'){var _0x4bc1c7={'name':_0x1fd6da['label'],'value':_0x1fd6da['value']};_0x2414e6[_0xed3c('0xab')](_0x4bc1c7);}});}_0x21fcc0[_0xed3c('0x40')]=_0x2414e6;if(_0x21fcc0[_0xed3c('0x40')][_0xed3c('0x37')]>0x0){_0xe16ba2(_0x21fcc0);}else{if(_0x2609bb==![]){_0xe16ba2();}else{_0xe16ba2(_0x21fcc0);}}});}});} \ No newline at end of file +var _0xe3c9=['nolimit','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','rows','params','merge','find','catch','create','body','update','ServicenowConfiguration','filter','getConfigurations','addConfiguration','AccountId','getSubjects','channel','type','Descriptions','getDescriptions','ServicenowField','Subjects','getFields','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','hold_reason','approval_history','resolved_by','sys_updated_by','user_input','sys_created_on','state','sys_created_by','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','time_worked','expected_start','opened_at','group_list','reopened_time','caller_id','approval_set','work_notes','short_description','work_start','assignment_group','business_stc','calendar_duration','close_notes','closed_by','follow_up','parent_incident','contact_type','reopened_by','urgency','problem_id','company','activity_due','assigned_to','sla_due','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','location','findOne','password','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','result','log','incident\x20table\x20objects','assign','forEach','internalType','label','push','all','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20','test','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','stack','name','index','ServicenowAccount','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0xe3c9,0x1e6));var _0x9e3c=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xe3c9[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0x9e3c('0x0'));var rimraf=require(_0x9e3c('0x1'));var zipdir=require(_0x9e3c('0x2'));var jsonpatch=require(_0x9e3c('0x3'));var rp=require(_0x9e3c('0x4'));var moment=require(_0x9e3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9e3c('0x6'));var util=require(_0x9e3c('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e3c('0x8'));var fs=require('fs');var fs_extra=require(_0x9e3c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9e3c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9e3c('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9e3c('0xc'));var authService=require(_0x9e3c('0xd'));var qs=require(_0x9e3c('0xe'));var as=require(_0x9e3c('0xf'));var hardwareService=require(_0x9e3c('0x10'));var logger=require(_0x9e3c('0x11'))(_0x9e3c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9e3c('0x13'));var db=require(_0x9e3c('0x14'))['db'];var integrations=require(_0x9e3c('0x15'));function respondWithStatusCode(_0x4f9fa1,_0xdb7c7c){_0xdb7c7c=_0xdb7c7c||0xcc;return function(_0x395da2){if(_0x395da2){return _0x4f9fa1[_0x9e3c('0x16')](_0xdb7c7c);}return _0x4f9fa1[_0x9e3c('0x17')](_0xdb7c7c)[_0x9e3c('0x18')]();};}function respondWithResult(_0x1daf66,_0xe3d551){_0xe3d551=_0xe3d551||0xc8;return function(_0xe1e4cf){if(_0xe1e4cf){return _0x1daf66[_0x9e3c('0x17')](_0xe3d551)[_0x9e3c('0x19')](_0xe1e4cf);}};}function respondWithFilteredResult(_0x19c2d4,_0x47e35a){return function(_0x32856a){if(_0x32856a){var _0x3c8475=typeof _0x47e35a[_0x9e3c('0x1a')]===_0x9e3c('0x1b')&&typeof _0x47e35a[_0x9e3c('0x1c')]===_0x9e3c('0x1b');var _0x31b179=_0x32856a[_0x9e3c('0x1d')];var _0x8bf929=_0x3c8475?0x0:_0x47e35a[_0x9e3c('0x1a')];var _0x8db352=_0x3c8475?_0x32856a[_0x9e3c('0x1d')]:_0x47e35a[_0x9e3c('0x1a')]+_0x47e35a[_0x9e3c('0x1c')];var _0xcd6628;if(_0x8db352>=_0x31b179){_0x8db352=_0x31b179;_0xcd6628=0xc8;}else{_0xcd6628=0xce;}_0x19c2d4[_0x9e3c('0x17')](_0xcd6628);return _0x19c2d4[_0x9e3c('0x1e')](_0x9e3c('0x1f'),_0x8bf929+'-'+_0x8db352+'/'+_0x31b179)[_0x9e3c('0x19')](_0x32856a);}return null;};}function patchUpdates(_0x3c2d78){return function(_0x4b4379){try{jsonpatch[_0x9e3c('0x20')](_0x4b4379,_0x3c2d78,!![]);}catch(_0x3fdf80){return BPromise[_0x9e3c('0x21')](_0x3fdf80);}return _0x4b4379[_0x9e3c('0x22')]();};}function saveUpdates(_0x15e27c,_0x3bfc4c){return function(_0x446790){if(_0x446790){return _0x446790['update'](_0x15e27c)['then'](function(_0x2d98cc){return _0x2d98cc;});}return null;};}function removeEntity(_0x44e9b6,_0x26dbb1){return function(_0x578700){if(_0x578700){return _0x578700[_0x9e3c('0x23')]()[_0x9e3c('0x24')](function(){_0x44e9b6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x347903,_0x3d3500){return function(_0x3c1745){if(!_0x3c1745){_0x347903[_0x9e3c('0x16')](0x194);}return _0x3c1745;};}function handleError(_0x35df30,_0x2fdad9){_0x2fdad9=_0x2fdad9||0x1f4;return function(_0x3c2b37){logger['error'](_0x3c2b37[_0x9e3c('0x25')]);if(_0x3c2b37[_0x9e3c('0x26')]){delete _0x3c2b37[_0x9e3c('0x26')];}_0x35df30[_0x9e3c('0x17')](_0x2fdad9)['send'](_0x3c2b37);};}exports[_0x9e3c('0x27')]=function(_0x18f3bc,_0x14db91){var _0x2d098a={},_0xabe58d={},_0xd85a3f={'count':0x0,'rows':[]};var _0x1f09a1=_['map'](db[_0x9e3c('0x28')][_0x9e3c('0x29')],function(_0x4003fe){return{'name':_0x4003fe[_0x9e3c('0x2a')],'type':_0x4003fe['type'][_0x9e3c('0x2b')]};});_0xabe58d[_0x9e3c('0x2c')]=_[_0x9e3c('0x2d')](_0x1f09a1,'name');_0xabe58d['query']=_[_0x9e3c('0x2e')](_0x18f3bc[_0x9e3c('0x2f')]);_0xabe58d[_0x9e3c('0x30')]=_['intersection'](_0xabe58d['model'],_0xabe58d[_0x9e3c('0x2f')]);_0x2d098a['attributes']=_[_0x9e3c('0x31')](_0xabe58d['model'],qs[_0x9e3c('0x32')](_0x18f3bc['query'][_0x9e3c('0x32')]));_0x2d098a[_0x9e3c('0x33')]=_0x2d098a[_0x9e3c('0x33')][_0x9e3c('0x34')]?_0x2d098a[_0x9e3c('0x33')]:_0xabe58d[_0x9e3c('0x2c')];if(!_0x18f3bc[_0x9e3c('0x2f')][_0x9e3c('0x35')](_0x9e3c('0x36'))){_0x2d098a['limit']=qs[_0x9e3c('0x1c')](_0x18f3bc[_0x9e3c('0x2f')][_0x9e3c('0x1c')]);_0x2d098a[_0x9e3c('0x1a')]=qs[_0x9e3c('0x1a')](_0x18f3bc[_0x9e3c('0x2f')][_0x9e3c('0x1a')]);}_0x2d098a[_0x9e3c('0x37')]=qs[_0x9e3c('0x38')](_0x18f3bc['query'][_0x9e3c('0x38')]);_0x2d098a[_0x9e3c('0x39')]=qs[_0x9e3c('0x30')](_[_0x9e3c('0x3a')](_0x18f3bc[_0x9e3c('0x2f')],_0xabe58d[_0x9e3c('0x30')]),_0x1f09a1);if(_0x18f3bc['query']['filter']){_0x2d098a[_0x9e3c('0x39')]=_['merge'](_0x2d098a[_0x9e3c('0x39')],{'$or':_[_0x9e3c('0x2d')](_0x1f09a1,function(_0x1cdfba){if(_0x1cdfba['type']!==_0x9e3c('0x3b')){var _0x1457c2={};_0x1457c2[_0x1cdfba[_0x9e3c('0x26')]]={'$like':'%'+_0x18f3bc[_0x9e3c('0x2f')]['filter']+'%'};return _0x1457c2;}})});}_0x2d098a=_['merge']({},_0x2d098a,_0x18f3bc[_0x9e3c('0x3c')]);var _0x3430d6={'where':_0x2d098a[_0x9e3c('0x39')]};return db[_0x9e3c('0x28')][_0x9e3c('0x1d')](_0x3430d6)[_0x9e3c('0x24')](function(_0x290c17){_0xd85a3f['count']=_0x290c17;if(_0x18f3bc[_0x9e3c('0x2f')][_0x9e3c('0x3d')]){_0x2d098a[_0x9e3c('0x3e')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x9e3c('0x3f')](_0x2d098a);})[_0x9e3c('0x24')](function(_0x34ad5c){_0xd85a3f[_0x9e3c('0x40')]=_0x34ad5c;return _0xd85a3f;})[_0x9e3c('0x24')](respondWithFilteredResult(_0x14db91,_0x2d098a))['catch'](handleError(_0x14db91,null));};exports['show']=function(_0x28a871,_0x1e7d9f){var _0x343fc0={'raw':![],'where':{'id':_0x28a871[_0x9e3c('0x41')]['id']}},_0x5b9430={};_0x5b9430[_0x9e3c('0x2c')]=_['keys'](db[_0x9e3c('0x28')][_0x9e3c('0x29')]);_0x5b9430[_0x9e3c('0x2f')]=_[_0x9e3c('0x2e')](_0x28a871[_0x9e3c('0x2f')]);_0x5b9430[_0x9e3c('0x30')]=_[_0x9e3c('0x31')](_0x5b9430[_0x9e3c('0x2c')],_0x5b9430[_0x9e3c('0x2f')]);_0x343fc0[_0x9e3c('0x33')]=_[_0x9e3c('0x31')](_0x5b9430[_0x9e3c('0x2c')],qs[_0x9e3c('0x32')](_0x28a871['query']['fields']));_0x343fc0[_0x9e3c('0x33')]=_0x343fc0['attributes'][_0x9e3c('0x34')]?_0x343fc0[_0x9e3c('0x33')]:_0x5b9430['model'];if(_0x28a871[_0x9e3c('0x2f')][_0x9e3c('0x3d')]){_0x343fc0['include']=[{'all':!![]}];}_0x343fc0=_[_0x9e3c('0x42')]({},_0x343fc0,_0x28a871['options']);return db[_0x9e3c('0x28')][_0x9e3c('0x43')](_0x343fc0)[_0x9e3c('0x24')](handleEntityNotFound(_0x1e7d9f,null))[_0x9e3c('0x24')](respondWithResult(_0x1e7d9f,null))[_0x9e3c('0x44')](handleError(_0x1e7d9f,null));};exports[_0x9e3c('0x45')]=function(_0x1e463b,_0x12c4f8){return db[_0x9e3c('0x28')][_0x9e3c('0x45')](_0x1e463b[_0x9e3c('0x46')],{})[_0x9e3c('0x24')](respondWithResult(_0x12c4f8,0xc9))[_0x9e3c('0x44')](handleError(_0x12c4f8,null));};exports[_0x9e3c('0x47')]=function(_0x3644ca,_0x4d878c){if(_0x3644ca[_0x9e3c('0x46')]['id']){delete _0x3644ca['body']['id'];}return db['ServicenowAccount'][_0x9e3c('0x43')]({'where':{'id':_0x3644ca['params']['id']}})[_0x9e3c('0x24')](handleEntityNotFound(_0x4d878c,null))[_0x9e3c('0x24')](saveUpdates(_0x3644ca[_0x9e3c('0x46')],null))[_0x9e3c('0x24')](respondWithResult(_0x4d878c,null))['catch'](handleError(_0x4d878c,null));};exports[_0x9e3c('0x23')]=function(_0x1adad1,_0x2166da){return db[_0x9e3c('0x28')][_0x9e3c('0x43')]({'where':{'id':_0x1adad1['params']['id']}})[_0x9e3c('0x24')](handleEntityNotFound(_0x2166da,null))[_0x9e3c('0x24')](removeEntity(_0x2166da,null))[_0x9e3c('0x44')](handleError(_0x2166da,null));};exports['getConfigurations']=function(_0x50d87e,_0x516d87,_0x559919){var _0x1b4fb5={};var _0x1f7cba={};var _0x5f1773;var _0x46427c;return db[_0x9e3c('0x28')]['findOne']({'where':{'id':_0x50d87e[_0x9e3c('0x41')]['id']}})[_0x9e3c('0x24')](handleEntityNotFound(_0x516d87,null))[_0x9e3c('0x24')](function(_0x271c47){if(_0x271c47){_0x5f1773=_0x271c47;_0x1f7cba[_0x9e3c('0x2c')]=_[_0x9e3c('0x2e')](db[_0x9e3c('0x48')][_0x9e3c('0x29')]);_0x1f7cba[_0x9e3c('0x2f')]=_[_0x9e3c('0x2e')](_0x50d87e[_0x9e3c('0x2f')]);_0x1f7cba['filters']=_[_0x9e3c('0x31')](_0x1f7cba[_0x9e3c('0x2c')],_0x1f7cba['query']);_0x1b4fb5[_0x9e3c('0x33')]=_[_0x9e3c('0x31')](_0x1f7cba[_0x9e3c('0x2c')],qs[_0x9e3c('0x32')](_0x50d87e[_0x9e3c('0x2f')][_0x9e3c('0x32')]));_0x1b4fb5[_0x9e3c('0x33')]=_0x1b4fb5[_0x9e3c('0x33')]['length']?_0x1b4fb5[_0x9e3c('0x33')]:_0x1f7cba[_0x9e3c('0x2c')];_0x1b4fb5[_0x9e3c('0x37')]=qs['sort'](_0x50d87e['query']['sort']);_0x1b4fb5[_0x9e3c('0x39')]=qs[_0x9e3c('0x30')](_[_0x9e3c('0x3a')](_0x50d87e[_0x9e3c('0x2f')],_0x1f7cba['filters']));if(_0x50d87e['query'][_0x9e3c('0x49')]){_0x1b4fb5[_0x9e3c('0x39')]=_[_0x9e3c('0x42')](_0x1b4fb5[_0x9e3c('0x39')],{'$or':_[_0x9e3c('0x2d')](_0x1b4fb5[_0x9e3c('0x33')],function(_0x4dd839){var _0x269f4a={};_0x269f4a[_0x4dd839]={'$like':'%'+_0x50d87e[_0x9e3c('0x2f')][_0x9e3c('0x49')]+'%'};return _0x269f4a;})});}_0x1b4fb5=_[_0x9e3c('0x42')]({},_0x1b4fb5,_0x50d87e[_0x9e3c('0x3c')]);return _0x5f1773['getConfigurations'](_0x1b4fb5);}})[_0x9e3c('0x24')](function(_0x416a41){if(_0x416a41){_0x46427c=_0x416a41[_0x9e3c('0x34')];if(!_0x50d87e[_0x9e3c('0x2f')][_0x9e3c('0x35')](_0x9e3c('0x36'))){_0x1b4fb5[_0x9e3c('0x1c')]=qs[_0x9e3c('0x1c')](_0x50d87e[_0x9e3c('0x2f')][_0x9e3c('0x1c')]);_0x1b4fb5[_0x9e3c('0x1a')]=qs[_0x9e3c('0x1a')](_0x50d87e[_0x9e3c('0x2f')][_0x9e3c('0x1a')]);}return _0x5f1773[_0x9e3c('0x4a')](_0x1b4fb5);}})[_0x9e3c('0x24')](function(_0x2e0fd4){if(_0x2e0fd4){return _0x2e0fd4?{'count':_0x46427c,'rows':_0x2e0fd4}:null;}})[_0x9e3c('0x24')](respondWithResult(_0x516d87,null))[_0x9e3c('0x44')](handleError(_0x516d87,null));};exports[_0x9e3c('0x4b')]=function(_0x2bd839,_0x874f49,_0x9ad2d4){if(_0x2bd839[_0x9e3c('0x46')]['id']){delete _0x2bd839[_0x9e3c('0x46')]['id'];}return db[_0x9e3c('0x28')]['findOne']({'where':{'id':_0x2bd839[_0x9e3c('0x41')]['id']}})['then'](handleEntityNotFound(_0x874f49,null))[_0x9e3c('0x24')](function(_0x47c344){if(_0x47c344){_0x2bd839['body'][_0x9e3c('0x4c')]=_0x47c344['id'];_0x2bd839[_0x9e3c('0x46')]['Subjects']=integrations[_0x9e3c('0x4d')](_0x2bd839['body'][_0x9e3c('0x4e')],_0x2bd839[_0x9e3c('0x46')][_0x9e3c('0x4f')]);_0x2bd839['body'][_0x9e3c('0x50')]=integrations[_0x9e3c('0x51')](_0x2bd839[_0x9e3c('0x46')][_0x9e3c('0x4e')],_0x2bd839['body'][_0x9e3c('0x4f')]);return db[_0x9e3c('0x48')][_0x9e3c('0x45')](_0x2bd839[_0x9e3c('0x46')],{'include':[{'model':db[_0x9e3c('0x52')],'as':_0x9e3c('0x53')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x9e3c('0x24')](respondWithResult(_0x874f49,null))[_0x9e3c('0x44')](handleError(_0x874f49,null));};exports[_0x9e3c('0x54')]=function(_0x449f25,_0x3235ca,_0x1cb783){var _0x5d0ae6=['made_sla','hold_reason',_0x9e3c('0x55'),_0x9e3c('0x56'),_0x9e3c('0x57'),_0x9e3c('0x58'),_0x9e3c('0x59'),_0x9e3c('0x5a'),_0x9e3c('0x5b')];var _0x485d61=[_0x9e3c('0x5c'),_0x9e3c('0x5d'),_0x9e3c('0x5e'),_0x9e3c('0x5f'),_0x9e3c('0x60'),_0x9e3c('0x61'),'child_incidents',_0x9e3c('0x62'),_0x9e3c('0x63'),'number',_0x9e3c('0x64'),_0x9e3c('0x65'),'opened_by',_0x9e3c('0x66'),_0x9e3c('0x67'),'sys_domain',_0x9e3c('0x68'),_0x9e3c('0x69'),'knowledge',_0x9e3c('0x37'),'calendar_stc',_0x9e3c('0x6a'),_0x9e3c('0x6b'),_0x9e3c('0x6c'),_0x9e3c('0x6d'),_0x9e3c('0x6e'),_0x9e3c('0x6f'),'business_service',_0x9e3c('0x70'),'sys_domain_path','rfc',_0x9e3c('0x71'),_0x9e3c('0x72'),_0x9e3c('0x73'),'business_duration',_0x9e3c('0x74'),'work_end',_0x9e3c('0x75'),'resolved_at',_0x9e3c('0x76'),_0x9e3c('0x77'),'subcategory',_0x9e3c('0x78'),_0x9e3c('0x79'),_0x9e3c('0x57'),'correlation_display','delivery_task',_0x9e3c('0x7a'),_0x9e3c('0x7b'),_0x9e3c('0x7c'),'additional_assignee_list','description',_0x9e3c('0x7d'),_0x9e3c('0x58'),'sys_class_name',_0x9e3c('0x7e'),_0x9e3c('0x7f'),_0x9e3c('0x80'),_0x9e3c('0x81'),'sys_id',_0x9e3c('0x82'),_0x9e3c('0x83'),_0x9e3c('0x59'),_0x9e3c('0x84'),_0x9e3c('0x85'),_0x9e3c('0x86'),'reassignment_count',_0x9e3c('0x87'),_0x9e3c('0x88'),_0x9e3c('0x5a'),'comments',_0x9e3c('0x89'),'approval',_0x9e3c('0x8a'),_0x9e3c('0x8b'),_0x9e3c('0x8c'),_0x9e3c('0x8d'),_0x9e3c('0x8e'),_0x9e3c('0x8f'),'upon_approval','correlation_id',_0x9e3c('0x90'),_0x9e3c('0x5b')];var _0x5030d0='';var _0xb31f70='';var _0x3566e0=[];var _0x5e8a55='';var _0x19f6e4='';var _0x247a96=[];var _0x4a0fce='';var _0x483b65='';var _0x5b3ca2={};var _0x4755d4='';return db['ServicenowAccount'][_0x9e3c('0x91')]({'where':{'id':_0x449f25['params']['id']},'attributes':['id','username',_0x9e3c('0x92'),'email',_0x9e3c('0x93'),_0x9e3c('0x94')]})['then'](handleEntityNotFound(_0x3235ca,null))['then'](function(_0x19f55f){if(_0x19f55f){_0x4755d4=_0x19f55f['remoteUri'];var _0xb6f8bb=_0x4755d4[_0x9e3c('0x95')](-0x1);if(_0xb6f8bb==='/'){_0x4755d4=_0x4755d4['substring'](0x0,_0x4755d4[_0x9e3c('0x96')](_0xb6f8bb));}_0x483b65=util[_0x9e3c('0x97')](_0x9e3c('0x98'),_0x4755d4);_0x4a0fce=util[_0x9e3c('0x97')](_0x9e3c('0x99'),_0x4755d4);_0x5b3ca2={'user':_0x19f55f[_0x9e3c('0x9a')],'pass':_0x19f55f[_0x9e3c('0x92')]};var _0x3f92b3={'method':_0x9e3c('0x9b'),'uri':_0x483b65+'incident?sysparm_display_value=all','auth':_0x5b3ca2,'json':!![]};return rp(_0x3f92b3);}})[_0x9e3c('0x24')](function(_0x23e9ac){if(_0x23e9ac[_0x9e3c('0x9c')][_0x9e3c('0x34')]>0x0){_0x5030d0=_0x23e9ac['result'];}console[_0x9e3c('0x9d')](_0x9e3c('0x9e'),_0x5030d0);_0x247a96=[];_0xb31f70=Object[_0x9e3c('0x9f')]([],_0x5030d0);_['remove'](_0xb31f70,function(_0x2ff4ef){return!_0x5d0ae6['includes'](_0x2ff4ef[_0x9e3c('0x26')]);});_0xb31f70[_0x9e3c('0xa0')](function(_0x446f7c){var _0x217c95=createFieldObject(_0x4a0fce,_0x5b3ca2,_0x446f7c[_0x9e3c('0xa1')],_0x446f7c[_0x9e3c('0x26')],_0x446f7c[_0x9e3c('0xa2')],![]);_0x247a96[_0x9e3c('0xa3')](_0x217c95);});return Promise[_0x9e3c('0xa4')](_0x247a96);})[_0x9e3c('0x24')](function(_0x20baf2){_0x3566e0=_0x20baf2;_0x5e8a55=Object[_0x9e3c('0x9f')]([],_0x5030d0);console[_0x9e3c('0x9d')](_0x9e3c('0xa5'),_0x5030d0);_[_0x9e3c('0xa6')](_0x5e8a55,function(_0x7209fc){return _0x485d61['includes'](_0x7209fc['name']);});console[_0x9e3c('0x9d')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x5e8a55);_0x247a96=[];_0x5e8a55[_0x9e3c('0xa0')](function(_0x2859c7){var _0x468669=createFieldObject(_0x4a0fce,_0x5b3ca2,_0x2859c7[_0x9e3c('0xa1')],_0x2859c7[_0x9e3c('0x26')],_0x2859c7[_0x9e3c('0xa2')],!![]);_0x247a96[_0x9e3c('0xa3')](_0x468669);});return Promise[_0x9e3c('0xa4')](_0x247a96);})['then'](function(_0x1b82c3){_0x19f6e4=_0x1b82c3;var _0x4a41e5=_0x3566e0[_0x9e3c('0xa7')](_0x19f6e4);return{'count':_0x4a41e5['length'],'rows':_0x4a41e5};})['then'](respondWithResult(_0x3235ca,null))[_0x9e3c('0x44')](function(_0x4038c4){console[_0x9e3c('0x9d')](_0x9e3c('0xa8')+_0x4038c4);var _0x16b6d6=_0x449f25[_0x9e3c('0x2f')][_0x9e3c('0xa9')]?0x1f4:_0x4038c4['statusCode']||0x1f4;logger['error'](_0x4038c4[_0x9e3c('0x25')]);delete _0x4038c4[_0x9e3c('0x26')];if(_0x16b6d6===0x191){_0x16b6d6=0x190;}_0x3235ca['status'](_0x16b6d6)['send'](_0x449f25['query'][_0x9e3c('0xa9')]?{'message':_0x9e3c('0xaa'),'statusCode':_0x4038c4[_0x9e3c('0xab')]}:_0x4038c4);});};function createFieldObject(_0x4a4a31,_0x3dfecc,_0x389d0c,_0x4e7d71,_0x15cf4c,_0x5c116a){return new Promise(function(_0x53f392,_0x430f27){var _0x1b3f6e={'id':_0x4e7d71,'name':_0x15cf4c,'custom':_0x5c116a};if(_0x389d0c===_0x9e3c('0xac')){_0x1b3f6e[_0x9e3c('0x3c')]=[{'name':_0x9e3c('0xad'),'value':_0x9e3c('0xae')},{'name':_0x9e3c('0xaf'),'value':_0x9e3c('0xb0')}];_0x53f392(_0x1b3f6e);}else{var _0x59bbfc={'method':_0x9e3c('0x9b'),'uri':_0x4a4a31+_0x9e3c('0xb1')+_0x4e7d71,'auth':_0x3dfecc,'json':!![]};return rp(_0x59bbfc)[_0x9e3c('0x24')](function(_0x18e316){var _0x57315f=[];if(_0x18e316[_0x9e3c('0x9c')][_0x9e3c('0x34')]>0x0){_0x18e316[_0x9e3c('0x9c')][_0x9e3c('0xa0')](function(_0x39fdc9){if(_0x39fdc9[_0x9e3c('0xb2')]===_0x9e3c('0xb0')){var _0x1f4ae1={'name':_0x39fdc9['label'],'value':_0x39fdc9[_0x9e3c('0xb3')]};_0x57315f['push'](_0x1f4ae1);}});}_0x1b3f6e[_0x9e3c('0x3c')]=_0x57315f;if(_0x1b3f6e['options'][_0x9e3c('0x34')]>0x0){_0x53f392(_0x1b3f6e);}else{if(_0x5c116a==![]){_0x53f392();}else{_0x53f392(_0x1b3f6e);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 5bb816e..011f90a 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 _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','../../config/logger','api'];(function(_0x2fdce0,_0x496242){var _0x36f07e=function(_0x44c8c6){while(--_0x44c8c6){_0x2fdce0['push'](_0x2fdce0['shift']());}};_0x36f07e(++_0x496242);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2c366f,_0x1bd4f8){_0x2c366f=_0x2c366f-0x0;var _0x180634=_0x7fbe[_0x2c366f];return _0x180634;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));var integrations=require(_0xe7fb('0x9'));module[_0xe7fb('0xa')]=function(_0x12d1b0,_0x24cd67){return _0x12d1b0[_0xe7fb('0xb')]('ServicenowAccount',attributes,{'tableName':_0xe7fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8fb=['../../components/integrations/configuration','define','int_servicenow_accounts','lodash','util','../../config/logger','api','path','rimraf','./intServicenowAccount.attributes'];(function(_0x442b68,_0x11bb13){var _0x224ba7=function(_0x3b6246){while(--_0x3b6246){_0x442b68['push'](_0x442b68['shift']());}};_0x224ba7(++_0x11bb13);}(_0xd8fb,0x99));var _0xbd8f=function(_0x14cbde,_0x215749){_0x14cbde=_0x14cbde-0x0;var _0x3679e2=_0xd8fb[_0x14cbde];return _0x3679e2;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var logger=require(_0xbd8f('0x2'))(_0xbd8f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd8f('0x4'));var rimraf=require(_0xbd8f('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd8f('0x6'));var integrations=require(_0xbd8f('0x7'));module['exports']=function(_0x33d541,_0x4e97cf){return _0x33d541[_0xbd8f('0x8')]('ServicenowAccount',attributes,{'tableName':_0xbd8f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 129dc09..b4a526e 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 _0x9571=['options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','find','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll'];(function(_0x29c537,_0x2a4059){var _0xca2b5e=function(_0x12061a){while(--_0x12061a){_0x29c537['push'](_0x29c537['shift']());}};_0xca2b5e(++_0x2a4059);}(_0x9571,0x96));var _0x1957=function(_0xdafc1b,_0x2e33a2){_0xdafc1b=_0xdafc1b-0x0;var _0x31de5b=_0x9571[_0xdafc1b];return _0x31de5b;};'use strict';var _=require(_0x1957('0x0'));var util=require('util');var moment=require(_0x1957('0x1'));var BPromise=require(_0x1957('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1957('0x3'))['db'];var utils=require(_0x1957('0x4'));var logger=require(_0x1957('0x5'))(_0x1957('0x6'));var config=require(_0x1957('0x7'));var jayson=require(_0x1957('0x8'));var client=jayson[_0x1957('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b33da,_0x172df2,_0x279446){return new BPromise(function(_0x37ad57,_0x43affa){return client[_0x1957('0xa')](_0x2b33da,_0x279446)[_0x1957('0xb')](function(_0x124ad9){logger[_0x1957('0xc')](_0x1957('0xd'),_0x172df2,'request\x20sent');logger[_0x1957('0xe')](_0x1957('0xf'),_0x172df2,_0x1957('0x10'),JSON[_0x1957('0x11')](_0x124ad9));if(_0x124ad9[_0x1957('0x12')]){if(_0x124ad9['error'][_0x1957('0x13')]===0x1f4){logger[_0x1957('0x12')](_0x1957('0xd'),_0x172df2,_0x124ad9[_0x1957('0x12')]['message']);return _0x43affa(_0x124ad9['error']['message']);}logger[_0x1957('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x172df2,_0x124ad9[_0x1957('0x12')][_0x1957('0x14')]);return _0x37ad57(_0x124ad9['error']['message']);}else{logger[_0x1957('0xc')](_0x1957('0xd'),_0x172df2,_0x1957('0x10'));_0x37ad57(_0x124ad9['result'][_0x1957('0x14')]);}})[_0x1957('0x15')](function(_0x1b4192){logger[_0x1957('0x12')](_0x1957('0xd'),_0x172df2,_0x1b4192);_0x43affa(_0x1b4192);});});}exports[_0x1957('0x16')]=function(_0x564c98){var _0x54e147=this;return new Promise(function(_0x457ded,_0x5a0ba6){return db[_0x1957('0x17')][_0x1957('0x18')]({'raw':_0x564c98[_0x1957('0x19')]?_0x564c98['options'][_0x1957('0x1a')]===undefined?!![]:![]:!![],'where':_0x564c98[_0x1957('0x19')]?_0x564c98[_0x1957('0x19')][_0x1957('0x1b')]||null:null,'attributes':_0x564c98[_0x1957('0x19')]?_0x564c98[_0x1957('0x19')][_0x1957('0x1c')]||null:null,'limit':_0x564c98[_0x1957('0x19')]?_0x564c98[_0x1957('0x19')][_0x1957('0x1d')]||null:null,'include':_0x564c98['options']?_0x564c98[_0x1957('0x19')][_0x1957('0x1e')]?_[_0x1957('0x1f')](_0x564c98[_0x1957('0x19')][_0x1957('0x1e')],function(_0x283a95){return{'model':db[_0x283a95[_0x1957('0x20')]],'as':_0x283a95['as'],'attributes':_0x283a95['attributes'],'include':_0x283a95[_0x1957('0x1e')]?_[_0x1957('0x1f')](_0x283a95[_0x1957('0x1e')],function(_0x3bbbaf){return{'model':db[_0x3bbbaf['model']],'as':_0x3bbbaf['as'],'attributes':_0x3bbbaf['attributes'],'include':_0x3bbbaf[_0x1957('0x1e')]?_[_0x1957('0x1f')](_0x3bbbaf[_0x1957('0x1e')],function(_0x42d41a){return{'model':db[_0x42d41a[_0x1957('0x20')]],'as':_0x42d41a['as'],'attributes':_0x42d41a['attributes']};}):[]};}):[]};}):[]:[]})[_0x1957('0xb')](function(_0x212cac){logger[_0x1957('0xc')](_0x1957('0x16'),_0x564c98);logger[_0x1957('0xe')]('GetServicenowAccount',_0x564c98,JSON[_0x1957('0x11')](_0x212cac));_0x457ded(_0x212cac);})[_0x1957('0x15')](function(_0x5be32c){logger['error']('GetServicenowAccount',_0x5be32c[_0x1957('0x14')],_0x564c98);_0x5a0ba6(_0x54e147['error'](0x1f4,_0x5be32c[_0x1957('0x14')]));});});};exports[_0x1957('0x21')]=function(_0x389263){var _0x501924=this;return new Promise(function(_0x51d511,_0x241782){return db[_0x1957('0x17')][_0x1957('0x22')]({'raw':_0x389263[_0x1957('0x19')]?_0x389263[_0x1957('0x19')][_0x1957('0x1a')]===undefined?!![]:![]:!![],'where':_0x389263[_0x1957('0x19')]?_0x389263['options'][_0x1957('0x1b')]||null:null,'attributes':_0x389263['options']?_0x389263['options']['attributes']||null:null,'include':_0x389263['options']?_0x389263[_0x1957('0x19')][_0x1957('0x1e')]?_[_0x1957('0x1f')](_0x389263[_0x1957('0x19')][_0x1957('0x1e')],function(_0x5b9da6){return{'model':db[_0x5b9da6[_0x1957('0x20')]],'as':_0x5b9da6['as'],'attributes':_0x5b9da6[_0x1957('0x1c')],'include':_0x5b9da6['include']?_['map'](_0x5b9da6[_0x1957('0x1e')],function(_0x2e474b){return{'model':db[_0x2e474b['model']],'as':_0x2e474b['as'],'attributes':_0x2e474b[_0x1957('0x1c')],'include':_0x2e474b[_0x1957('0x1e')]?_['map'](_0x2e474b[_0x1957('0x1e')],function(_0x2271ce){return{'model':db[_0x2271ce['model']],'as':_0x2271ce['as'],'attributes':_0x2271ce[_0x1957('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1957('0xb')](function(_0x1a5788){logger[_0x1957('0xc')]('ShowServicenowAccount',_0x389263);logger[_0x1957('0xe')]('ShowServicenowAccount',_0x389263,JSON['stringify'](_0x1a5788));_0x51d511(_0x1a5788);})[_0x1957('0x15')](function(_0x1b3285){logger[_0x1957('0x12')]('ShowServicenowAccount',_0x1b3285[_0x1957('0x14')],_0x389263);_0x241782(_0x501924[_0x1957('0x12')](0x1f4,_0x1b3285[_0x1957('0x14')]));});});}; \ No newline at end of file +var _0x5465=['request\x20sent','debug','stringify','error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowServicenowAccount','ServicenowAccount','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s'];(function(_0x38b8bd,_0x39822a){var _0x5a3760=function(_0x4b6f3a){while(--_0x4b6f3a){_0x38b8bd['push'](_0x38b8bd['shift']());}};_0x5a3760(++_0x39822a);}(_0x5465,0x150));var _0x5546=function(_0x18d9fe,_0x33f8df){_0x18d9fe=_0x18d9fe-0x0;var _0x19005d=_0x5465[_0x18d9fe];return _0x19005d;};'use strict';var _=require(_0x5546('0x0'));var util=require(_0x5546('0x1'));var moment=require(_0x5546('0x2'));var BPromise=require(_0x5546('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5546('0x4'));var logger=require(_0x5546('0x5'))(_0x5546('0x6'));var config=require(_0x5546('0x7'));var jayson=require(_0x5546('0x8'));var client=jayson[_0x5546('0x9')][_0x5546('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d5445,_0x8f4898,_0x9fe109){return new BPromise(function(_0x1fbde4,_0x45292b){return client[_0x5546('0xb')](_0x4d5445,_0x9fe109)['then'](function(_0x273ae1){logger[_0x5546('0xc')](_0x5546('0xd'),_0x8f4898,_0x5546('0xe'));logger[_0x5546('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x8f4898,_0x5546('0xe'),JSON[_0x5546('0x10')](_0x273ae1));if(_0x273ae1[_0x5546('0x11')]){if(_0x273ae1[_0x5546('0x11')][_0x5546('0x12')]===0x1f4){logger[_0x5546('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x8f4898,_0x273ae1['error'][_0x5546('0x13')]);return _0x45292b(_0x273ae1[_0x5546('0x11')]['message']);}logger[_0x5546('0x11')](_0x5546('0xd'),_0x8f4898,_0x273ae1[_0x5546('0x11')]['message']);return _0x1fbde4(_0x273ae1['error']['message']);}else{logger[_0x5546('0xc')](_0x5546('0xd'),_0x8f4898,'request\x20sent');_0x1fbde4(_0x273ae1[_0x5546('0x14')][_0x5546('0x13')]);}})[_0x5546('0x15')](function(_0xb982ee){logger['error'](_0x5546('0xd'),_0x8f4898,_0xb982ee);_0x45292b(_0xb982ee);});});}exports[_0x5546('0x16')]=function(_0x38605b){var _0x271b6f=this;return new Promise(function(_0x416324,_0x3b3fa7){return db['ServicenowAccount'][_0x5546('0x17')]({'raw':_0x38605b[_0x5546('0x18')]?_0x38605b['options'][_0x5546('0x19')]===undefined?!![]:![]:!![],'where':_0x38605b[_0x5546('0x18')]?_0x38605b[_0x5546('0x18')][_0x5546('0x1a')]||null:null,'attributes':_0x38605b['options']?_0x38605b[_0x5546('0x18')][_0x5546('0x1b')]||null:null,'limit':_0x38605b[_0x5546('0x18')]?_0x38605b['options'][_0x5546('0x1c')]||null:null,'include':_0x38605b[_0x5546('0x18')]?_0x38605b[_0x5546('0x18')]['include']?_['map'](_0x38605b['options'][_0x5546('0x1d')],function(_0x2f5dc2){return{'model':db[_0x2f5dc2['model']],'as':_0x2f5dc2['as'],'attributes':_0x2f5dc2['attributes'],'include':_0x2f5dc2[_0x5546('0x1d')]?_[_0x5546('0x1e')](_0x2f5dc2['include'],function(_0x4fa72b){return{'model':db[_0x4fa72b['model']],'as':_0x4fa72b['as'],'attributes':_0x4fa72b[_0x5546('0x1b')],'include':_0x4fa72b['include']?_[_0x5546('0x1e')](_0x4fa72b[_0x5546('0x1d')],function(_0x53b7cc){return{'model':db[_0x53b7cc[_0x5546('0x1f')]],'as':_0x53b7cc['as'],'attributes':_0x53b7cc['attributes']};}):[]};}):[]};}):[]:[]})[_0x5546('0x20')](function(_0x36363a){logger[_0x5546('0xc')](_0x5546('0x16'),_0x38605b);logger['debug'](_0x5546('0x16'),_0x38605b,JSON[_0x5546('0x10')](_0x36363a));_0x416324(_0x36363a);})[_0x5546('0x15')](function(_0x4d1b88){logger[_0x5546('0x11')](_0x5546('0x16'),_0x4d1b88['message'],_0x38605b);_0x3b3fa7(_0x271b6f[_0x5546('0x11')](0x1f4,_0x4d1b88['message']));});});};exports[_0x5546('0x21')]=function(_0x403af3){var _0x309b42=this;return new Promise(function(_0x909841,_0x2e1350){return db[_0x5546('0x22')]['find']({'raw':_0x403af3[_0x5546('0x18')]?_0x403af3['options'][_0x5546('0x19')]===undefined?!![]:![]:!![],'where':_0x403af3[_0x5546('0x18')]?_0x403af3[_0x5546('0x18')][_0x5546('0x1a')]||null:null,'attributes':_0x403af3[_0x5546('0x18')]?_0x403af3[_0x5546('0x18')][_0x5546('0x1b')]||null:null,'include':_0x403af3['options']?_0x403af3['options'][_0x5546('0x1d')]?_[_0x5546('0x1e')](_0x403af3[_0x5546('0x18')]['include'],function(_0x2a5eda){return{'model':db[_0x2a5eda[_0x5546('0x1f')]],'as':_0x2a5eda['as'],'attributes':_0x2a5eda[_0x5546('0x1b')],'include':_0x2a5eda[_0x5546('0x1d')]?_['map'](_0x2a5eda[_0x5546('0x1d')],function(_0x16ac7f){return{'model':db[_0x16ac7f[_0x5546('0x1f')]],'as':_0x16ac7f['as'],'attributes':_0x16ac7f[_0x5546('0x1b')],'include':_0x16ac7f[_0x5546('0x1d')]?_[_0x5546('0x1e')](_0x16ac7f[_0x5546('0x1d')],function(_0x1c4ca5){return{'model':db[_0x1c4ca5['model']],'as':_0x1c4ca5['as'],'attributes':_0x1c4ca5[_0x5546('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bd5da){logger['info']('ShowServicenowAccount',_0x403af3);logger[_0x5546('0xf')]('ShowServicenowAccount',_0x403af3,JSON[_0x5546('0x10')](_0x5bd5da));_0x909841(_0x5bd5da);})[_0x5546('0x15')](function(_0xa2f00f){logger[_0x5546('0x11')](_0x5546('0x21'),_0xa2f00f[_0x5546('0x13')],_0x403af3);_0x2e1350(_0x309b42[_0x5546('0x11')](0x1f4,_0xa2f00f[_0x5546('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 19e4114..11fcdb2 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 _0x6847=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','getDescriptions','post','put','update','delete','destroy','util'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x6847,0x103));var _0x7684=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0x6847[_0x29e2af];return _0x1ea06a;};'use strict';var multer=require('multer');var util=require(_0x7684('0x0'));var path=require(_0x7684('0x1'));var timeout=require(_0x7684('0x2'));var express=require(_0x7684('0x3'));var router=express[_0x7684('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7684('0x5'));var config=require(_0x7684('0x6'));var controller=require(_0x7684('0x7'));router[_0x7684('0x8')]('/',auth['isAuthenticated'](),controller[_0x7684('0x9')]);router[_0x7684('0x8')](_0x7684('0xa'),auth[_0x7684('0xb')](),controller['show']);router[_0x7684('0x8')](_0x7684('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x7684('0x8')](_0x7684('0xd'),auth[_0x7684('0xb')](),controller['getSubjects']);router[_0x7684('0x8')]('/:id/descriptions',auth[_0x7684('0xb')](),controller[_0x7684('0xe')]);router[_0x7684('0xf')]('/',auth[_0x7684('0xb')](),controller['create']);router[_0x7684('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7684('0x11')]);router[_0x7684('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x7684('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa81b=['put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x2e2a44,_0x1b1515){var _0x19c520=function(_0xd42377){while(--_0xd42377){_0x2e2a44['push'](_0x2e2a44['shift']());}};_0x19c520(++_0x1b1515);}(_0xa81b,0x6d));var _0xba81=function(_0x5498b8,_0x3fd10c){_0x5498b8=_0x5498b8-0x0;var _0x13c31c=_0xa81b[_0x5498b8];return _0x13c31c;};'use strict';var multer=require(_0xba81('0x0'));var util=require(_0xba81('0x1'));var path=require(_0xba81('0x2'));var timeout=require('connect-timeout');var express=require(_0xba81('0x3'));var router=express[_0xba81('0x4')]();var fs_extra=require(_0xba81('0x5'));var auth=require(_0xba81('0x6'));var interaction=require(_0xba81('0x7'));var config=require('../../config/environment');var controller=require(_0xba81('0x8'));router[_0xba81('0x9')]('/',auth[_0xba81('0xa')](),controller[_0xba81('0xb')]);router[_0xba81('0x9')](_0xba81('0xc'),auth[_0xba81('0xa')](),controller[_0xba81('0xd')]);router['get'](_0xba81('0xe'),auth[_0xba81('0xa')](),controller[_0xba81('0xf')]);router[_0xba81('0x9')](_0xba81('0x10'),auth[_0xba81('0xa')](),controller[_0xba81('0x11')]);router['get'](_0xba81('0x12'),auth[_0xba81('0xa')](),controller[_0xba81('0x13')]);router[_0xba81('0x14')]('/',auth[_0xba81('0xa')](),controller['create']);router[_0xba81('0x15')]('/:id',auth[_0xba81('0xa')](),controller[_0xba81('0x16')]);router[_0xba81('0x17')](_0xba81('0xc'),auth[_0xba81('0xa')](),controller[_0xba81('0x18')]);module[_0xba81('0x19')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 522a8ba..7703470 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 _0x71ab=['exports','STRING','sequelize'];(function(_0x1a7c18,_0x29d596){var _0x5561cc=function(_0x26fc76){while(--_0x26fc76){_0x1a7c18['push'](_0x1a7c18['shift']());}};_0x5561cc(++_0x29d596);}(_0x71ab,0x113));var _0xb71a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x71ab[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xb71a('0x0'));module[_0xb71a('0x1')]={'name':{'type':Sequelize[_0xb71a('0x2')]},'description':{'type':Sequelize[_0xb71a('0x2')]}}; \ No newline at end of file +var _0xa453=['sequelize','STRING'];(function(_0x27e416,_0x58bf17){var _0xd8a50e=function(_0x32fec7){while(--_0x32fec7){_0x27e416['push'](_0x27e416['shift']());}};_0xd8a50e(++_0x58bf17);}(_0xa453,0x1d4));var _0x3a45=function(_0x3a562e,_0x3a3391){_0x3a562e=_0x3a562e-0x0;var _0x26e310=_0xa453[_0x3a562e];return _0x26e310;};'use strict';var Sequelize=require(_0x3a45('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3a45('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 80c2a21..863597d 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 _0xcd60=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','params','find','catch','create','body','update','getFields','findOne','ServicenowField','sort','pick','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys'];(function(_0x34e7fe,_0x3df429){var _0x1615e2=function(_0x1439f5){while(--_0x1439f5){_0x34e7fe['push'](_0x34e7fe['shift']());}};_0x1615e2(++_0x3df429);}(_0xcd60,0x1db));var _0x0cd6=function(_0x4b6f17,_0x163a79){_0x4b6f17=_0x4b6f17-0x0;var _0x4b242d=_0xcd60[_0x4b6f17];return _0x4b242d;};'use strict';var emlformat=require(_0x0cd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0cd6('0x1'));var jsonpatch=require(_0x0cd6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0cd6('0x3'));var Mustache=require(_0x0cd6('0x4'));var util=require('util');var path=require('path');var sox=require(_0x0cd6('0x5'));var csv=require('to-csv');var ejs=require(_0x0cd6('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0cd6('0x7'));var squel=require('squel');var crypto=require(_0x0cd6('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0cd6('0x9'));var Papa=require(_0x0cd6('0xa'));var Redis=require(_0x0cd6('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x0cd6('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0cd6('0xd'))(_0x0cd6('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0cd6('0xf'))['db'];function respondWithStatusCode(_0x54c8a6,_0xac718e){_0xac718e=_0xac718e||0xcc;return function(_0x4b7b07){if(_0x4b7b07){return _0x54c8a6[_0x0cd6('0x10')](_0xac718e);}return _0x54c8a6['status'](_0xac718e)[_0x0cd6('0x11')]();};}function respondWithResult(_0x1314ad,_0x102197){_0x102197=_0x102197||0xc8;return function(_0x1e3fc0){if(_0x1e3fc0){return _0x1314ad['status'](_0x102197)[_0x0cd6('0x12')](_0x1e3fc0);}};}function respondWithFilteredResult(_0x15744f,_0x270aa7){return function(_0x325a30){if(_0x325a30){var _0x5c1629=typeof _0x270aa7[_0x0cd6('0x13')]===_0x0cd6('0x14')&&typeof _0x270aa7[_0x0cd6('0x15')]==='undefined';var _0xe64d6b=_0x325a30['count'];var _0x2b9d46=_0x5c1629?0x0:_0x270aa7[_0x0cd6('0x13')];var _0x29f336=_0x5c1629?_0x325a30['count']:_0x270aa7[_0x0cd6('0x13')]+_0x270aa7[_0x0cd6('0x15')];var _0x83759f;if(_0x29f336>=_0xe64d6b){_0x29f336=_0xe64d6b;_0x83759f=0xc8;}else{_0x83759f=0xce;}_0x15744f[_0x0cd6('0x16')](_0x83759f);return _0x15744f[_0x0cd6('0x17')](_0x0cd6('0x18'),_0x2b9d46+'-'+_0x29f336+'/'+_0xe64d6b)[_0x0cd6('0x12')](_0x325a30);}return null;};}function patchUpdates(_0x39445e){return function(_0x2982b9){try{jsonpatch[_0x0cd6('0x19')](_0x2982b9,_0x39445e,!![]);}catch(_0x4cb9f3){return BPromise[_0x0cd6('0x1a')](_0x4cb9f3);}return _0x2982b9[_0x0cd6('0x1b')]();};}function saveUpdates(_0x5bb7d1,_0x4c3cca){return function(_0x29e32a){if(_0x29e32a){return _0x29e32a['update'](_0x5bb7d1)[_0x0cd6('0x1c')](function(_0x18451c){return _0x18451c;});}return null;};}function removeEntity(_0x1c4512,_0xc229d8){return function(_0x2d121b){if(_0x2d121b){return _0x2d121b[_0x0cd6('0x1d')]()[_0x0cd6('0x1c')](function(){_0x1c4512[_0x0cd6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f14ba,_0x9da37a){return function(_0x327cd1){if(!_0x327cd1){_0x5f14ba[_0x0cd6('0x10')](0x194);}return _0x327cd1;};}function handleError(_0x386c4,_0x4372b3){_0x4372b3=_0x4372b3||0x1f4;return function(_0x5d5ef2){logger[_0x0cd6('0x1e')](_0x5d5ef2[_0x0cd6('0x1f')]);if(_0x5d5ef2[_0x0cd6('0x20')]){delete _0x5d5ef2[_0x0cd6('0x20')];}_0x386c4['status'](_0x4372b3)[_0x0cd6('0x21')](_0x5d5ef2);};}exports[_0x0cd6('0x22')]=function(_0xa8c3f2,_0x18fd73){var _0x269d6a={},_0xb573bc={},_0x5b3252={'count':0x0,'rows':[]};var _0x50359c=_[_0x0cd6('0x23')](db[_0x0cd6('0x24')][_0x0cd6('0x25')],function(_0x42a60f){return{'name':_0x42a60f[_0x0cd6('0x26')],'type':_0x42a60f['type'][_0x0cd6('0x27')]};});_0xb573bc[_0x0cd6('0x28')]=_[_0x0cd6('0x23')](_0x50359c,_0x0cd6('0x20'));_0xb573bc[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0xa8c3f2['query']);_0xb573bc[_0x0cd6('0x2b')]=_[_0x0cd6('0x2c')](_0xb573bc[_0x0cd6('0x28')],_0xb573bc[_0x0cd6('0x29')]);_0x269d6a[_0x0cd6('0x2d')]=_[_0x0cd6('0x2c')](_0xb573bc[_0x0cd6('0x28')],qs[_0x0cd6('0x2e')](_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x2e')]));_0x269d6a[_0x0cd6('0x2d')]=_0x269d6a['attributes'][_0x0cd6('0x2f')]?_0x269d6a[_0x0cd6('0x2d')]:_0xb573bc[_0x0cd6('0x28')];if(!_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x30')](_0x0cd6('0x31'))){_0x269d6a['limit']=qs['limit'](_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x15')]);_0x269d6a['offset']=qs[_0x0cd6('0x13')](_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x13')]);}_0x269d6a[_0x0cd6('0x32')]=qs['sort'](_0xa8c3f2[_0x0cd6('0x29')]['sort']);_0x269d6a[_0x0cd6('0x33')]=qs[_0x0cd6('0x2b')](_['pick'](_0xa8c3f2[_0x0cd6('0x29')],_0xb573bc[_0x0cd6('0x2b')]),_0x50359c);if(_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x34')]){_0x269d6a[_0x0cd6('0x33')]=_['merge'](_0x269d6a[_0x0cd6('0x33')],{'$or':_[_0x0cd6('0x23')](_0x50359c,function(_0x3561eb){if(_0x3561eb[_0x0cd6('0x35')]!==_0x0cd6('0x36')){var _0x593993={};_0x593993[_0x3561eb['name']]={'$like':'%'+_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x34')]+'%'};return _0x593993;}})});}_0x269d6a=_[_0x0cd6('0x37')]({},_0x269d6a,_0xa8c3f2[_0x0cd6('0x38')]);var _0x400305={'where':_0x269d6a[_0x0cd6('0x33')]};return db['ServicenowConfiguration'][_0x0cd6('0x39')](_0x400305)['then'](function(_0x1e8507){_0x5b3252[_0x0cd6('0x39')]=_0x1e8507;if(_0xa8c3f2[_0x0cd6('0x29')][_0x0cd6('0x3a')]){_0x269d6a[_0x0cd6('0x3b')]=[{'all':!![]}];}return db[_0x0cd6('0x24')][_0x0cd6('0x3c')](_0x269d6a);})[_0x0cd6('0x1c')](function(_0x27674c){_0x5b3252['rows']=_0x27674c;return _0x5b3252;})[_0x0cd6('0x1c')](respondWithFilteredResult(_0x18fd73,_0x269d6a))['catch'](handleError(_0x18fd73,null));};exports['show']=function(_0x225ee9,_0x2c7c9c){var _0x5270f6={'raw':![],'where':{'id':_0x225ee9[_0x0cd6('0x3d')]['id']}},_0x4b3e45={};_0x4b3e45[_0x0cd6('0x28')]=_[_0x0cd6('0x2a')](db[_0x0cd6('0x24')][_0x0cd6('0x25')]);_0x4b3e45[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0x225ee9[_0x0cd6('0x29')]);_0x4b3e45[_0x0cd6('0x2b')]=_[_0x0cd6('0x2c')](_0x4b3e45[_0x0cd6('0x28')],_0x4b3e45[_0x0cd6('0x29')]);_0x5270f6['attributes']=_[_0x0cd6('0x2c')](_0x4b3e45[_0x0cd6('0x28')],qs[_0x0cd6('0x2e')](_0x225ee9[_0x0cd6('0x29')][_0x0cd6('0x2e')]));_0x5270f6[_0x0cd6('0x2d')]=_0x5270f6['attributes']['length']?_0x5270f6[_0x0cd6('0x2d')]:_0x4b3e45['model'];if(_0x225ee9[_0x0cd6('0x29')][_0x0cd6('0x3a')]){_0x5270f6[_0x0cd6('0x3b')]=[{'all':!![]}];}_0x5270f6=_['merge']({},_0x5270f6,_0x225ee9[_0x0cd6('0x38')]);return db[_0x0cd6('0x24')][_0x0cd6('0x3e')](_0x5270f6)[_0x0cd6('0x1c')](handleEntityNotFound(_0x2c7c9c,null))[_0x0cd6('0x1c')](respondWithResult(_0x2c7c9c,null))[_0x0cd6('0x3f')](handleError(_0x2c7c9c,null));};exports[_0x0cd6('0x40')]=function(_0x2ddbdb,_0xd8aa5f){return db[_0x0cd6('0x24')][_0x0cd6('0x40')](_0x2ddbdb[_0x0cd6('0x41')],{})['then'](respondWithResult(_0xd8aa5f,0xc9))[_0x0cd6('0x3f')](handleError(_0xd8aa5f,null));};exports[_0x0cd6('0x42')]=function(_0x412112,_0x219c22){if(_0x412112[_0x0cd6('0x41')]['id']){delete _0x412112[_0x0cd6('0x41')]['id'];}return db[_0x0cd6('0x24')][_0x0cd6('0x3e')]({'where':{'id':_0x412112[_0x0cd6('0x3d')]['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x219c22,null))[_0x0cd6('0x1c')](saveUpdates(_0x412112[_0x0cd6('0x41')],null))[_0x0cd6('0x1c')](respondWithResult(_0x219c22,null))[_0x0cd6('0x3f')](handleError(_0x219c22,null));};exports[_0x0cd6('0x1d')]=function(_0x4ed6c3,_0x55a933){return db[_0x0cd6('0x24')][_0x0cd6('0x3e')]({'where':{'id':_0x4ed6c3[_0x0cd6('0x3d')]['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x55a933,null))[_0x0cd6('0x1c')](removeEntity(_0x55a933,null))['catch'](handleError(_0x55a933,null));};exports[_0x0cd6('0x43')]=function(_0x28c95c,_0x1db068,_0x295f8a){var _0x5cd6b8={};var _0x4c18fa={};var _0x17b861;var _0x3e8c94;return db[_0x0cd6('0x24')][_0x0cd6('0x44')]({'where':{'id':_0x28c95c['params']['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x1db068,null))['then'](function(_0x1ff08d){if(_0x1ff08d){_0x17b861=_0x1ff08d;_0x4c18fa[_0x0cd6('0x28')]=_[_0x0cd6('0x2a')](db[_0x0cd6('0x45')]['rawAttributes']);_0x4c18fa[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0x28c95c['query']);_0x4c18fa[_0x0cd6('0x2b')]=_['intersection'](_0x4c18fa[_0x0cd6('0x28')],_0x4c18fa[_0x0cd6('0x29')]);_0x5cd6b8[_0x0cd6('0x2d')]=_[_0x0cd6('0x2c')](_0x4c18fa[_0x0cd6('0x28')],qs['fields'](_0x28c95c['query'][_0x0cd6('0x2e')]));_0x5cd6b8[_0x0cd6('0x2d')]=_0x5cd6b8[_0x0cd6('0x2d')]['length']?_0x5cd6b8[_0x0cd6('0x2d')]:_0x4c18fa['model'];_0x5cd6b8['order']=qs[_0x0cd6('0x46')](_0x28c95c[_0x0cd6('0x29')][_0x0cd6('0x46')]);_0x5cd6b8[_0x0cd6('0x33')]=qs[_0x0cd6('0x2b')](_[_0x0cd6('0x47')](_0x28c95c[_0x0cd6('0x29')],_0x4c18fa[_0x0cd6('0x2b')]));if(_0x28c95c['query']['filter']){_0x5cd6b8['where']=_[_0x0cd6('0x37')](_0x5cd6b8[_0x0cd6('0x33')],{'$or':_[_0x0cd6('0x23')](_0x5cd6b8[_0x0cd6('0x2d')],function(_0x3f55b9){var _0x200532={};_0x200532[_0x3f55b9]={'$like':'%'+_0x28c95c['query'][_0x0cd6('0x34')]+'%'};return _0x200532;})});}_0x5cd6b8=_[_0x0cd6('0x37')]({},_0x5cd6b8,_0x28c95c[_0x0cd6('0x38')]);return _0x17b861[_0x0cd6('0x43')](_0x5cd6b8);}})['then'](function(_0x265e8c){if(_0x265e8c){_0x3e8c94=_0x265e8c['length'];if(!_0x28c95c[_0x0cd6('0x29')]['hasOwnProperty']('nolimit')){_0x5cd6b8[_0x0cd6('0x15')]=qs['limit'](_0x28c95c[_0x0cd6('0x29')][_0x0cd6('0x15')]);_0x5cd6b8[_0x0cd6('0x13')]=qs[_0x0cd6('0x13')](_0x28c95c['query'][_0x0cd6('0x13')]);}return _0x17b861[_0x0cd6('0x43')](_0x5cd6b8);}})['then'](function(_0x5c6e1d){if(_0x5c6e1d){return _0x5c6e1d?{'count':_0x3e8c94,'rows':_0x5c6e1d}:null;}})[_0x0cd6('0x1c')](respondWithResult(_0x1db068,null))[_0x0cd6('0x3f')](handleError(_0x1db068,null));};exports[_0x0cd6('0x48')]=function(_0x5e8e11,_0x25c4b8,_0x33a204){var _0xba99b1={};var _0x139c6e={};var _0x1204d1;var _0x59056b;return db[_0x0cd6('0x24')][_0x0cd6('0x44')]({'where':{'id':_0x5e8e11[_0x0cd6('0x3d')]['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x25c4b8,null))[_0x0cd6('0x1c')](function(_0x4ead2b){if(_0x4ead2b){_0x1204d1=_0x4ead2b;_0x139c6e['model']=_['keys'](db[_0x0cd6('0x45')][_0x0cd6('0x25')]);_0x139c6e[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0x5e8e11[_0x0cd6('0x29')]);_0x139c6e[_0x0cd6('0x2b')]=_[_0x0cd6('0x2c')](_0x139c6e[_0x0cd6('0x28')],_0x139c6e[_0x0cd6('0x29')]);_0xba99b1[_0x0cd6('0x2d')]=_[_0x0cd6('0x2c')](_0x139c6e['model'],qs[_0x0cd6('0x2e')](_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x2e')]));_0xba99b1[_0x0cd6('0x2d')]=_0xba99b1[_0x0cd6('0x2d')][_0x0cd6('0x2f')]?_0xba99b1[_0x0cd6('0x2d')]:_0x139c6e['model'];_0xba99b1[_0x0cd6('0x32')]=qs['sort'](_0x5e8e11['query']['sort']);_0xba99b1[_0x0cd6('0x33')]=qs[_0x0cd6('0x2b')](_['pick'](_0x5e8e11['query'],_0x139c6e[_0x0cd6('0x2b')]));if(_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x34')]){_0xba99b1[_0x0cd6('0x33')]=_[_0x0cd6('0x37')](_0xba99b1[_0x0cd6('0x33')],{'$or':_['map'](_0xba99b1[_0x0cd6('0x2d')],function(_0x1228f4){var _0x457944={};_0x457944[_0x1228f4]={'$like':'%'+_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x34')]+'%'};return _0x457944;})});}_0xba99b1=_[_0x0cd6('0x37')]({},_0xba99b1,_0x5e8e11[_0x0cd6('0x38')]);return _0x1204d1[_0x0cd6('0x48')](_0xba99b1);}})[_0x0cd6('0x1c')](function(_0x28f896){if(_0x28f896){_0x59056b=_0x28f896[_0x0cd6('0x2f')];if(!_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x30')]('nolimit')){_0xba99b1[_0x0cd6('0x15')]=qs[_0x0cd6('0x15')](_0x5e8e11['query'][_0x0cd6('0x15')]);_0xba99b1[_0x0cd6('0x13')]=qs[_0x0cd6('0x13')](_0x5e8e11[_0x0cd6('0x29')][_0x0cd6('0x13')]);}return _0x1204d1[_0x0cd6('0x48')](_0xba99b1);}})[_0x0cd6('0x1c')](function(_0x238944){if(_0x238944){return _0x238944?{'count':_0x59056b,'rows':_0x238944}:null;}})[_0x0cd6('0x1c')](respondWithResult(_0x25c4b8,null))[_0x0cd6('0x3f')](handleError(_0x25c4b8,null));};exports[_0x0cd6('0x49')]=function(_0x5a5db8,_0x2be1f2,_0x598051){var _0x4dd6b8={};var _0x55bdbc={};var _0x41540a;var _0x4e4cd5;return db[_0x0cd6('0x24')]['findOne']({'where':{'id':_0x5a5db8['params']['id']}})[_0x0cd6('0x1c')](handleEntityNotFound(_0x2be1f2,null))[_0x0cd6('0x1c')](function(_0x2c65dc){if(_0x2c65dc){_0x41540a=_0x2c65dc;_0x55bdbc['model']=_[_0x0cd6('0x2a')](db[_0x0cd6('0x45')][_0x0cd6('0x25')]);_0x55bdbc[_0x0cd6('0x29')]=_[_0x0cd6('0x2a')](_0x5a5db8[_0x0cd6('0x29')]);_0x55bdbc[_0x0cd6('0x2b')]=_[_0x0cd6('0x2c')](_0x55bdbc[_0x0cd6('0x28')],_0x55bdbc[_0x0cd6('0x29')]);_0x4dd6b8[_0x0cd6('0x2d')]=_[_0x0cd6('0x2c')](_0x55bdbc['model'],qs[_0x0cd6('0x2e')](_0x5a5db8['query'][_0x0cd6('0x2e')]));_0x4dd6b8['attributes']=_0x4dd6b8[_0x0cd6('0x2d')][_0x0cd6('0x2f')]?_0x4dd6b8[_0x0cd6('0x2d')]:_0x55bdbc[_0x0cd6('0x28')];_0x4dd6b8[_0x0cd6('0x32')]=qs[_0x0cd6('0x46')](_0x5a5db8[_0x0cd6('0x29')][_0x0cd6('0x46')]);_0x4dd6b8[_0x0cd6('0x33')]=qs['filters'](_[_0x0cd6('0x47')](_0x5a5db8['query'],_0x55bdbc['filters']));if(_0x5a5db8[_0x0cd6('0x29')][_0x0cd6('0x34')]){_0x4dd6b8[_0x0cd6('0x33')]=_[_0x0cd6('0x37')](_0x4dd6b8[_0x0cd6('0x33')],{'$or':_[_0x0cd6('0x23')](_0x4dd6b8['attributes'],function(_0x2b6956){var _0x5b9a0d={};_0x5b9a0d[_0x2b6956]={'$like':'%'+_0x5a5db8[_0x0cd6('0x29')][_0x0cd6('0x34')]+'%'};return _0x5b9a0d;})});}_0x4dd6b8=_[_0x0cd6('0x37')]({},_0x4dd6b8,_0x5a5db8['options']);return _0x41540a[_0x0cd6('0x49')](_0x4dd6b8);}})[_0x0cd6('0x1c')](function(_0x32a647){if(_0x32a647){_0x4e4cd5=_0x32a647[_0x0cd6('0x2f')];if(!_0x5a5db8['query'][_0x0cd6('0x30')]('nolimit')){_0x4dd6b8['limit']=qs[_0x0cd6('0x15')](_0x5a5db8['query'][_0x0cd6('0x15')]);_0x4dd6b8[_0x0cd6('0x13')]=qs[_0x0cd6('0x13')](_0x5a5db8[_0x0cd6('0x29')][_0x0cd6('0x13')]);}return _0x41540a[_0x0cd6('0x49')](_0x4dd6b8);}})[_0x0cd6('0x1c')](function(_0x4ca4f7){if(_0x4ca4f7){return _0x4ca4f7?{'count':_0x4e4cd5,'rows':_0x4ca4f7}:null;}})[_0x0cd6('0x1c')](respondWithResult(_0x2be1f2,null))[_0x0cd6('0x3f')](handleError(_0x2be1f2,null));}; \ No newline at end of file +var _0x9ff2=['sort','filters','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy','getFields','ServicenowField','getSubjects','nolimit','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order'];(function(_0x372b72,_0x333bf9){var _0x4ed832=function(_0x491aea){while(--_0x491aea){_0x372b72['push'](_0x372b72['shift']());}};_0x4ed832(++_0x333bf9);}(_0x9ff2,0x1e5));var _0x29ff=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x9ff2[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0x29ff('0x0'));var rimraf=require(_0x29ff('0x1'));var zipdir=require(_0x29ff('0x2'));var jsonpatch=require(_0x29ff('0x3'));var rp=require(_0x29ff('0x4'));var moment=require(_0x29ff('0x5'));var BPromise=require(_0x29ff('0x6'));var Mustache=require('mustache');var util=require(_0x29ff('0x7'));var path=require(_0x29ff('0x8'));var sox=require(_0x29ff('0x9'));var csv=require('to-csv');var ejs=require(_0x29ff('0xa'));var fs=require('fs');var fs_extra=require(_0x29ff('0xb'));var _=require('lodash');var squel=require(_0x29ff('0xc'));var crypto=require(_0x29ff('0xd'));var jsforce=require(_0x29ff('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x29ff('0xf'));var querystring=require('querystring');var Papa=require(_0x29ff('0x10'));var Redis=require('ioredis');var authService=require(_0x29ff('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x29ff('0x12'));var utils=require(_0x29ff('0x13'));var config=require(_0x29ff('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x29ff('0x15'))['db'];function respondWithStatusCode(_0x47baf8,_0x4c823a){_0x4c823a=_0x4c823a||0xcc;return function(_0x32ab27){if(_0x32ab27){return _0x47baf8[_0x29ff('0x16')](_0x4c823a);}return _0x47baf8[_0x29ff('0x17')](_0x4c823a)[_0x29ff('0x18')]();};}function respondWithResult(_0x1ee726,_0x41bf5c){_0x41bf5c=_0x41bf5c||0xc8;return function(_0x127108){if(_0x127108){return _0x1ee726['status'](_0x41bf5c)[_0x29ff('0x19')](_0x127108);}};}function respondWithFilteredResult(_0x4f229d,_0x45e436){return function(_0x505659){if(_0x505659){var _0x15279e=typeof _0x45e436['offset']===_0x29ff('0x1a')&&typeof _0x45e436[_0x29ff('0x1b')]==='undefined';var _0x5289af=_0x505659[_0x29ff('0x1c')];var _0x4caaaa=_0x15279e?0x0:_0x45e436[_0x29ff('0x1d')];var _0x54c5b0=_0x15279e?_0x505659[_0x29ff('0x1c')]:_0x45e436[_0x29ff('0x1d')]+_0x45e436[_0x29ff('0x1b')];var _0x40449a;if(_0x54c5b0>=_0x5289af){_0x54c5b0=_0x5289af;_0x40449a=0xc8;}else{_0x40449a=0xce;}_0x4f229d[_0x29ff('0x17')](_0x40449a);return _0x4f229d['set']('Content-Range',_0x4caaaa+'-'+_0x54c5b0+'/'+_0x5289af)['json'](_0x505659);}return null;};}function patchUpdates(_0x2da103){return function(_0xe5b67d){try{jsonpatch[_0x29ff('0x1e')](_0xe5b67d,_0x2da103,!![]);}catch(_0x85da9d){return BPromise[_0x29ff('0x1f')](_0x85da9d);}return _0xe5b67d[_0x29ff('0x20')]();};}function saveUpdates(_0x353c9c,_0x59d662){return function(_0x388ba5){if(_0x388ba5){return _0x388ba5[_0x29ff('0x21')](_0x353c9c)[_0x29ff('0x22')](function(_0x370a3d){return _0x370a3d;});}return null;};}function removeEntity(_0x56f3e2,_0x40286f){return function(_0x1c0a1e){if(_0x1c0a1e){return _0x1c0a1e['destroy']()[_0x29ff('0x22')](function(){_0x56f3e2[_0x29ff('0x17')](0xcc)[_0x29ff('0x18')]();});}};}function handleEntityNotFound(_0x5749fa,_0x2d8299){return function(_0x4c2d03){if(!_0x4c2d03){_0x5749fa[_0x29ff('0x16')](0x194);}return _0x4c2d03;};}function handleError(_0x358749,_0x27fa81){_0x27fa81=_0x27fa81||0x1f4;return function(_0x2a1aa5){logger[_0x29ff('0x23')](_0x2a1aa5['stack']);if(_0x2a1aa5['name']){delete _0x2a1aa5['name'];}_0x358749[_0x29ff('0x17')](_0x27fa81)[_0x29ff('0x24')](_0x2a1aa5);};}exports[_0x29ff('0x25')]=function(_0x36f7fc,_0x20825e){var _0x447a16={},_0x4f9fcc={},_0x57ce1e={'count':0x0,'rows':[]};var _0x44fbd0=_[_0x29ff('0x26')](db[_0x29ff('0x27')][_0x29ff('0x28')],function(_0x287a89){return{'name':_0x287a89[_0x29ff('0x29')],'type':_0x287a89[_0x29ff('0x2a')][_0x29ff('0x2b')]};});_0x4f9fcc['model']=_[_0x29ff('0x26')](_0x44fbd0,_0x29ff('0x2c'));_0x4f9fcc[_0x29ff('0x2d')]=_[_0x29ff('0x2e')](_0x36f7fc[_0x29ff('0x2d')]);_0x4f9fcc['filters']=_[_0x29ff('0x2f')](_0x4f9fcc[_0x29ff('0x30')],_0x4f9fcc['query']);_0x447a16[_0x29ff('0x31')]=_['intersection'](_0x4f9fcc[_0x29ff('0x30')],qs[_0x29ff('0x32')](_0x36f7fc[_0x29ff('0x2d')][_0x29ff('0x32')]));_0x447a16[_0x29ff('0x31')]=_0x447a16[_0x29ff('0x31')][_0x29ff('0x33')]?_0x447a16[_0x29ff('0x31')]:_0x4f9fcc[_0x29ff('0x30')];if(!_0x36f7fc[_0x29ff('0x2d')][_0x29ff('0x34')]('nolimit')){_0x447a16[_0x29ff('0x1b')]=qs['limit'](_0x36f7fc[_0x29ff('0x2d')][_0x29ff('0x1b')]);_0x447a16[_0x29ff('0x1d')]=qs['offset'](_0x36f7fc[_0x29ff('0x2d')][_0x29ff('0x1d')]);}_0x447a16[_0x29ff('0x35')]=qs[_0x29ff('0x36')](_0x36f7fc[_0x29ff('0x2d')][_0x29ff('0x36')]);_0x447a16['where']=qs[_0x29ff('0x37')](_[_0x29ff('0x38')](_0x36f7fc['query'],_0x4f9fcc['filters']),_0x44fbd0);if(_0x36f7fc[_0x29ff('0x2d')][_0x29ff('0x39')]){_0x447a16['where']=_['merge'](_0x447a16[_0x29ff('0x3a')],{'$or':_[_0x29ff('0x26')](_0x44fbd0,function(_0x4bbb6b){if(_0x4bbb6b[_0x29ff('0x2a')]!=='VIRTUAL'){var _0x202e37={};_0x202e37[_0x4bbb6b['name']]={'$like':'%'+_0x36f7fc[_0x29ff('0x2d')][_0x29ff('0x39')]+'%'};return _0x202e37;}})});}_0x447a16=_[_0x29ff('0x3b')]({},_0x447a16,_0x36f7fc[_0x29ff('0x3c')]);var _0x46bd60={'where':_0x447a16['where']};return db[_0x29ff('0x27')]['count'](_0x46bd60)[_0x29ff('0x22')](function(_0x4d0538){_0x57ce1e['count']=_0x4d0538;if(_0x36f7fc[_0x29ff('0x2d')][_0x29ff('0x3d')]){_0x447a16['include']=[{'all':!![]}];}return db[_0x29ff('0x27')][_0x29ff('0x3e')](_0x447a16);})[_0x29ff('0x22')](function(_0x37d505){_0x57ce1e['rows']=_0x37d505;return _0x57ce1e;})[_0x29ff('0x22')](respondWithFilteredResult(_0x20825e,_0x447a16))[_0x29ff('0x3f')](handleError(_0x20825e,null));};exports[_0x29ff('0x40')]=function(_0x35f6e4,_0x975b3a){var _0x5f03d4={'raw':![],'where':{'id':_0x35f6e4[_0x29ff('0x41')]['id']}},_0x3dd0cc={};_0x3dd0cc[_0x29ff('0x30')]=_[_0x29ff('0x2e')](db[_0x29ff('0x27')]['rawAttributes']);_0x3dd0cc['query']=_[_0x29ff('0x2e')](_0x35f6e4[_0x29ff('0x2d')]);_0x3dd0cc[_0x29ff('0x37')]=_[_0x29ff('0x2f')](_0x3dd0cc[_0x29ff('0x30')],_0x3dd0cc[_0x29ff('0x2d')]);_0x5f03d4[_0x29ff('0x31')]=_['intersection'](_0x3dd0cc[_0x29ff('0x30')],qs[_0x29ff('0x32')](_0x35f6e4[_0x29ff('0x2d')][_0x29ff('0x32')]));_0x5f03d4[_0x29ff('0x31')]=_0x5f03d4[_0x29ff('0x31')][_0x29ff('0x33')]?_0x5f03d4[_0x29ff('0x31')]:_0x3dd0cc[_0x29ff('0x30')];if(_0x35f6e4[_0x29ff('0x2d')][_0x29ff('0x3d')]){_0x5f03d4[_0x29ff('0x42')]=[{'all':!![]}];}_0x5f03d4=_[_0x29ff('0x3b')]({},_0x5f03d4,_0x35f6e4[_0x29ff('0x3c')]);return db['ServicenowConfiguration'][_0x29ff('0x43')](_0x5f03d4)[_0x29ff('0x22')](handleEntityNotFound(_0x975b3a,null))[_0x29ff('0x22')](respondWithResult(_0x975b3a,null))[_0x29ff('0x3f')](handleError(_0x975b3a,null));};exports[_0x29ff('0x44')]=function(_0x58e78d,_0x5029c0){return db[_0x29ff('0x27')][_0x29ff('0x44')](_0x58e78d['body'],{})['then'](respondWithResult(_0x5029c0,0xc9))[_0x29ff('0x3f')](handleError(_0x5029c0,null));};exports[_0x29ff('0x21')]=function(_0x3910ba,_0x402110){if(_0x3910ba[_0x29ff('0x45')]['id']){delete _0x3910ba[_0x29ff('0x45')]['id'];}return db[_0x29ff('0x27')]['find']({'where':{'id':_0x3910ba['params']['id']}})[_0x29ff('0x22')](handleEntityNotFound(_0x402110,null))[_0x29ff('0x22')](saveUpdates(_0x3910ba['body'],null))['then'](respondWithResult(_0x402110,null))[_0x29ff('0x3f')](handleError(_0x402110,null));};exports[_0x29ff('0x46')]=function(_0x2669da,_0x3e5ef4){return db[_0x29ff('0x27')][_0x29ff('0x43')]({'where':{'id':_0x2669da[_0x29ff('0x41')]['id']}})['then'](handleEntityNotFound(_0x3e5ef4,null))['then'](removeEntity(_0x3e5ef4,null))[_0x29ff('0x3f')](handleError(_0x3e5ef4,null));};exports[_0x29ff('0x47')]=function(_0x52f8f0,_0x33339d,_0x16bb4f){var _0x26beb2={};var _0x2e2e5b={};var _0x1845b1;var _0x58be83;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x52f8f0[_0x29ff('0x41')]['id']}})[_0x29ff('0x22')](handleEntityNotFound(_0x33339d,null))[_0x29ff('0x22')](function(_0x534528){if(_0x534528){_0x1845b1=_0x534528;_0x2e2e5b['model']=_[_0x29ff('0x2e')](db[_0x29ff('0x48')][_0x29ff('0x28')]);_0x2e2e5b[_0x29ff('0x2d')]=_[_0x29ff('0x2e')](_0x52f8f0[_0x29ff('0x2d')]);_0x2e2e5b[_0x29ff('0x37')]=_['intersection'](_0x2e2e5b[_0x29ff('0x30')],_0x2e2e5b[_0x29ff('0x2d')]);_0x26beb2[_0x29ff('0x31')]=_[_0x29ff('0x2f')](_0x2e2e5b['model'],qs[_0x29ff('0x32')](_0x52f8f0[_0x29ff('0x2d')][_0x29ff('0x32')]));_0x26beb2[_0x29ff('0x31')]=_0x26beb2[_0x29ff('0x31')]['length']?_0x26beb2[_0x29ff('0x31')]:_0x2e2e5b[_0x29ff('0x30')];_0x26beb2[_0x29ff('0x35')]=qs[_0x29ff('0x36')](_0x52f8f0[_0x29ff('0x2d')][_0x29ff('0x36')]);_0x26beb2[_0x29ff('0x3a')]=qs[_0x29ff('0x37')](_[_0x29ff('0x38')](_0x52f8f0[_0x29ff('0x2d')],_0x2e2e5b[_0x29ff('0x37')]));if(_0x52f8f0[_0x29ff('0x2d')][_0x29ff('0x39')]){_0x26beb2[_0x29ff('0x3a')]=_[_0x29ff('0x3b')](_0x26beb2[_0x29ff('0x3a')],{'$or':_[_0x29ff('0x26')](_0x26beb2[_0x29ff('0x31')],function(_0x2eed8a){var _0x11d399={};_0x11d399[_0x2eed8a]={'$like':'%'+_0x52f8f0[_0x29ff('0x2d')][_0x29ff('0x39')]+'%'};return _0x11d399;})});}_0x26beb2=_[_0x29ff('0x3b')]({},_0x26beb2,_0x52f8f0[_0x29ff('0x3c')]);return _0x1845b1[_0x29ff('0x47')](_0x26beb2);}})[_0x29ff('0x22')](function(_0x20783a){if(_0x20783a){_0x58be83=_0x20783a[_0x29ff('0x33')];if(!_0x52f8f0[_0x29ff('0x2d')]['hasOwnProperty']('nolimit')){_0x26beb2[_0x29ff('0x1b')]=qs[_0x29ff('0x1b')](_0x52f8f0[_0x29ff('0x2d')][_0x29ff('0x1b')]);_0x26beb2[_0x29ff('0x1d')]=qs['offset'](_0x52f8f0[_0x29ff('0x2d')][_0x29ff('0x1d')]);}return _0x1845b1['getFields'](_0x26beb2);}})[_0x29ff('0x22')](function(_0x3e4338){if(_0x3e4338){return _0x3e4338?{'count':_0x58be83,'rows':_0x3e4338}:null;}})['then'](respondWithResult(_0x33339d,null))['catch'](handleError(_0x33339d,null));};exports[_0x29ff('0x49')]=function(_0x3eb392,_0x59234d,_0xe8a6e2){var _0x252e5c={};var _0xa3ff2={};var _0x582e63;var _0x21cb31;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3eb392[_0x29ff('0x41')]['id']}})['then'](handleEntityNotFound(_0x59234d,null))[_0x29ff('0x22')](function(_0x30a971){if(_0x30a971){_0x582e63=_0x30a971;_0xa3ff2['model']=_[_0x29ff('0x2e')](db['ServicenowField'][_0x29ff('0x28')]);_0xa3ff2[_0x29ff('0x2d')]=_['keys'](_0x3eb392['query']);_0xa3ff2[_0x29ff('0x37')]=_[_0x29ff('0x2f')](_0xa3ff2[_0x29ff('0x30')],_0xa3ff2['query']);_0x252e5c[_0x29ff('0x31')]=_['intersection'](_0xa3ff2[_0x29ff('0x30')],qs[_0x29ff('0x32')](_0x3eb392[_0x29ff('0x2d')][_0x29ff('0x32')]));_0x252e5c['attributes']=_0x252e5c['attributes'][_0x29ff('0x33')]?_0x252e5c['attributes']:_0xa3ff2[_0x29ff('0x30')];_0x252e5c[_0x29ff('0x35')]=qs[_0x29ff('0x36')](_0x3eb392[_0x29ff('0x2d')]['sort']);_0x252e5c[_0x29ff('0x3a')]=qs['filters'](_[_0x29ff('0x38')](_0x3eb392[_0x29ff('0x2d')],_0xa3ff2[_0x29ff('0x37')]));if(_0x3eb392['query']['filter']){_0x252e5c[_0x29ff('0x3a')]=_[_0x29ff('0x3b')](_0x252e5c[_0x29ff('0x3a')],{'$or':_[_0x29ff('0x26')](_0x252e5c[_0x29ff('0x31')],function(_0x1667b9){var _0x54a4f9={};_0x54a4f9[_0x1667b9]={'$like':'%'+_0x3eb392[_0x29ff('0x2d')][_0x29ff('0x39')]+'%'};return _0x54a4f9;})});}_0x252e5c=_[_0x29ff('0x3b')]({},_0x252e5c,_0x3eb392[_0x29ff('0x3c')]);return _0x582e63[_0x29ff('0x49')](_0x252e5c);}})[_0x29ff('0x22')](function(_0x451e23){if(_0x451e23){_0x21cb31=_0x451e23[_0x29ff('0x33')];if(!_0x3eb392[_0x29ff('0x2d')][_0x29ff('0x34')](_0x29ff('0x4a'))){_0x252e5c[_0x29ff('0x1b')]=qs['limit'](_0x3eb392[_0x29ff('0x2d')][_0x29ff('0x1b')]);_0x252e5c[_0x29ff('0x1d')]=qs[_0x29ff('0x1d')](_0x3eb392[_0x29ff('0x2d')][_0x29ff('0x1d')]);}return _0x582e63[_0x29ff('0x49')](_0x252e5c);}})[_0x29ff('0x22')](function(_0x4a5a53){if(_0x4a5a53){return _0x4a5a53?{'count':_0x21cb31,'rows':_0x4a5a53}:null;}})[_0x29ff('0x22')](respondWithResult(_0x59234d,null))[_0x29ff('0x3f')](handleError(_0x59234d,null));};exports['getDescriptions']=function(_0x2ff048,_0x551c08,_0x525f6b){var _0x2f0913={};var _0x275066={};var _0xe16250;var _0x5c58f2;return db[_0x29ff('0x27')][_0x29ff('0x4b')]({'where':{'id':_0x2ff048[_0x29ff('0x41')]['id']}})[_0x29ff('0x22')](handleEntityNotFound(_0x551c08,null))[_0x29ff('0x22')](function(_0x10befb){if(_0x10befb){_0xe16250=_0x10befb;_0x275066['model']=_[_0x29ff('0x2e')](db['ServicenowField'][_0x29ff('0x28')]);_0x275066[_0x29ff('0x2d')]=_[_0x29ff('0x2e')](_0x2ff048[_0x29ff('0x2d')]);_0x275066[_0x29ff('0x37')]=_['intersection'](_0x275066['model'],_0x275066[_0x29ff('0x2d')]);_0x2f0913[_0x29ff('0x31')]=_[_0x29ff('0x2f')](_0x275066[_0x29ff('0x30')],qs[_0x29ff('0x32')](_0x2ff048[_0x29ff('0x2d')][_0x29ff('0x32')]));_0x2f0913[_0x29ff('0x31')]=_0x2f0913[_0x29ff('0x31')]['length']?_0x2f0913[_0x29ff('0x31')]:_0x275066[_0x29ff('0x30')];_0x2f0913[_0x29ff('0x35')]=qs[_0x29ff('0x36')](_0x2ff048['query']['sort']);_0x2f0913['where']=qs[_0x29ff('0x37')](_[_0x29ff('0x38')](_0x2ff048[_0x29ff('0x2d')],_0x275066[_0x29ff('0x37')]));if(_0x2ff048[_0x29ff('0x2d')][_0x29ff('0x39')]){_0x2f0913[_0x29ff('0x3a')]=_[_0x29ff('0x3b')](_0x2f0913[_0x29ff('0x3a')],{'$or':_[_0x29ff('0x26')](_0x2f0913[_0x29ff('0x31')],function(_0x57972c){var _0x4f7b8f={};_0x4f7b8f[_0x57972c]={'$like':'%'+_0x2ff048[_0x29ff('0x2d')][_0x29ff('0x39')]+'%'};return _0x4f7b8f;})});}_0x2f0913=_[_0x29ff('0x3b')]({},_0x2f0913,_0x2ff048[_0x29ff('0x3c')]);return _0xe16250['getDescriptions'](_0x2f0913);}})['then'](function(_0x44c648){if(_0x44c648){_0x5c58f2=_0x44c648[_0x29ff('0x33')];if(!_0x2ff048[_0x29ff('0x2d')]['hasOwnProperty'](_0x29ff('0x4a'))){_0x2f0913[_0x29ff('0x1b')]=qs[_0x29ff('0x1b')](_0x2ff048[_0x29ff('0x2d')][_0x29ff('0x1b')]);_0x2f0913[_0x29ff('0x1d')]=qs[_0x29ff('0x1d')](_0x2ff048['query'][_0x29ff('0x1d')]);}return _0xe16250[_0x29ff('0x4c')](_0x2f0913);}})[_0x29ff('0x22')](function(_0x4b076b){if(_0x4b076b){return _0x4b076b?{'count':_0x5c58f2,'rows':_0x4b076b}:null;}})['then'](respondWithResult(_0x551c08,null))[_0x29ff('0x3f')](handleError(_0x551c08,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index d7bceed..ed1dde5 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 _0xda20=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','bluebird','path','rimraf','./intServicenowConfiguration.attributes','exports'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xda20,0x1d9));var _0x0da2=function(_0x5725c0,_0x260a86){_0x5725c0=_0x5725c0-0x0;var _0x495959=_0xda20[_0x5725c0];return _0x495959;};'use strict';var _=require(_0x0da2('0x0'));var util=require('util');var logger=require(_0x0da2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0da2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0da2('0x3'));var rimraf=require(_0x0da2('0x4'));var config=require('../../config/environment');var attributes=require(_0x0da2('0x5'));module[_0x0da2('0x6')]=function(_0x5c1bcb,_0x4674a3){return _0x5c1bcb[_0x0da2('0x7')](_0x0da2('0x8'),attributes,{'tableName':_0x0da2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f56=['int_servicenow_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x14dfe9,_0x226b44){var _0x41cbb6=function(_0x157d1c){while(--_0x157d1c){_0x14dfe9['push'](_0x14dfe9['shift']());}};_0x41cbb6(++_0x226b44);}(_0x2f56,0xb5));var _0x62f5=function(_0x21d16e,_0x4dad0c){_0x21d16e=_0x21d16e-0x0;var _0x59b9af=_0x2f56[_0x21d16e];return _0x59b9af;};'use strict';var _=require(_0x62f5('0x0'));var util=require(_0x62f5('0x1'));var logger=require(_0x62f5('0x2'))(_0x62f5('0x3'));var moment=require('moment');var BPromise=require(_0x62f5('0x4'));var rp=require(_0x62f5('0x5'));var fs=require('fs');var path=require(_0x62f5('0x6'));var rimraf=require(_0x62f5('0x7'));var config=require(_0x62f5('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x62f5('0x9')]=function(_0x3c6ce8,_0x15fc7e){return _0x3c6ce8[_0x62f5('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0x62f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 0925986..d2bcbf4 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 _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x1862f5,_0x4697e6){var _0x56cdec=function(_0x4fcaa5){while(--_0x4fcaa5){_0x1862f5['push'](_0x1862f5['shift']());}};_0x56cdec(++_0x4697e6);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1c1b59,_0x282b21){_0x1c1b59=_0x1c1b59-0x0;var _0xcedf9e=_0xdbf5[_0x1c1b59];return _0xcedf9e;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file +var _0xc50d=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0xc50d,0x94));var _0xdc50=function(_0x2ef829,_0x3433d4){_0x2ef829=_0x2ef829-0x0;var _0x2e4c02=_0xc50d[_0x2ef829];return _0x2e4c02;};'use strict';var _=require('lodash');var util=require(_0xdc50('0x0'));var moment=require(_0xdc50('0x1'));var BPromise=require('bluebird');var rs=require(_0xdc50('0x2'));var fs=require('fs');var Redis=require(_0xdc50('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc50('0x4'));var logger=require(_0xdc50('0x5'))('rpc');var config=require(_0xdc50('0x6'));var jayson=require(_0xdc50('0x7'));var client=jayson['client'][_0xdc50('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c3b69,_0x1af6ad,_0x8eeeab){return new BPromise(function(_0x26c59a,_0x1d69f5){return client['request'](_0x5c3b69,_0x8eeeab)[_0xdc50('0x9')](function(_0x13bc44){logger[_0xdc50('0xa')](_0xdc50('0xb'),_0x1af6ad,_0xdc50('0xc'));logger[_0xdc50('0xd')](_0xdc50('0xe'),_0x1af6ad,'request\x20sent',JSON['stringify'](_0x13bc44));if(_0x13bc44[_0xdc50('0xf')]){if(_0x13bc44[_0xdc50('0xf')]['code']===0x1f4){logger[_0xdc50('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1af6ad,_0x13bc44[_0xdc50('0xf')]['message']);return _0x1d69f5(_0x13bc44[_0xdc50('0xf')][_0xdc50('0x10')]);}logger['error'](_0xdc50('0xb'),_0x1af6ad,_0x13bc44[_0xdc50('0xf')][_0xdc50('0x10')]);return _0x26c59a(_0x13bc44[_0xdc50('0xf')][_0xdc50('0x10')]);}else{logger[_0xdc50('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x1af6ad,_0xdc50('0xc'));_0x26c59a(_0x13bc44['result'][_0xdc50('0x10')]);}})[_0xdc50('0x11')](function(_0x328b9d){logger['error'](_0xdc50('0xb'),_0x1af6ad,_0x328b9d);_0x1d69f5(_0x328b9d);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index ad028e9..f4779c8 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 _0x91ab=['show','post','create','put','/:id','update','delete','destroy','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x326205,_0x5ef700){var _0x2717dd=function(_0x2d8862){while(--_0x2d8862){_0x326205['push'](_0x326205['shift']());}};_0x2717dd(++_0x5ef700);}(_0x91ab,0x1a6));var _0xb91a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x91ab[_0x465028];return _0xb783d4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb91a('0x0'));var express=require(_0xb91a('0x1'));var router=express[_0xb91a('0x2')]();var fs_extra=require(_0xb91a('0x3'));var auth=require(_0xb91a('0x4'));var interaction=require(_0xb91a('0x5'));var config=require(_0xb91a('0x6'));var controller=require('./intServicenowField.controller');router[_0xb91a('0x7')]('/',auth[_0xb91a('0x8')](),controller[_0xb91a('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb91a('0xa')]);router[_0xb91a('0xb')]('/',auth[_0xb91a('0x8')](),controller[_0xb91a('0xc')]);router[_0xb91a('0xd')](_0xb91a('0xe'),auth[_0xb91a('0x8')](),controller[_0xb91a('0xf')]);router[_0xb91a('0x10')](_0xb91a('0xe'),auth['isAuthenticated'](),controller[_0xb91a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe101=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x241099,_0x2997a9){var _0x164e96=function(_0x2975e4){while(--_0x2975e4){_0x241099['push'](_0x241099['shift']());}};_0x164e96(++_0x2997a9);}(_0xe101,0xf1));var _0x1e10=function(_0x145ca9,_0x1b9505){_0x145ca9=_0x145ca9-0x0;var _0x130d47=_0xe101[_0x145ca9];return _0x130d47;};'use strict';var multer=require('multer');var util=require(_0x1e10('0x0'));var path=require(_0x1e10('0x1'));var timeout=require(_0x1e10('0x2'));var express=require(_0x1e10('0x3'));var router=express[_0x1e10('0x4')]();var fs_extra=require(_0x1e10('0x5'));var auth=require(_0x1e10('0x6'));var interaction=require(_0x1e10('0x7'));var config=require(_0x1e10('0x8'));var controller=require('./intServicenowField.controller');router[_0x1e10('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e10('0x9')](_0x1e10('0xa'),auth['isAuthenticated'](),controller[_0x1e10('0xb')]);router[_0x1e10('0xc')]('/',auth[_0x1e10('0xd')](),controller['create']);router[_0x1e10('0xe')](_0x1e10('0xa'),auth[_0x1e10('0xd')](),controller[_0x1e10('0xf')]);router[_0x1e10('0x10')]('/:id',auth[_0x1e10('0xd')](),controller[_0x1e10('0x11')]);module[_0x1e10('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 1954dc9..4b9f61b 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 _0xb2b2=['ENUM','variable','keyValue','string','STRING','customVariable','sequelize','exports'];(function(_0x364643,_0x35a6b8){var _0x12eb9f=function(_0x3429bc){while(--_0x3429bc){_0x364643['push'](_0x364643['shift']());}};_0x12eb9f(++_0x35a6b8);}(_0xb2b2,0x1e6));var _0x2b2b=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xb2b2[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0x2b2b('0x0'));module[_0x2b2b('0x1')]={'type':{'type':Sequelize[_0x2b2b('0x2')]('string',_0x2b2b('0x3'),'customVariable',_0x2b2b('0x4'),'picklist'),'defaultValue':_0x2b2b('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2b2b('0x6')]},'keyType':{'type':Sequelize[_0x2b2b('0x2')](_0x2b2b('0x5'),_0x2b2b('0x3'),_0x2b2b('0x7'))},'keyContent':{'type':Sequelize[_0x2b2b('0x6')]},'idField':{'type':Sequelize[_0x2b2b('0x6')]},'nameField':{'type':Sequelize[_0x2b2b('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x55b5=['BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x3034ce,_0x1421b6){var _0x4bc0e3=function(_0x49a5ca){while(--_0x49a5ca){_0x3034ce['push'](_0x3034ce['shift']());}};_0x4bc0e3(++_0x1421b6);}(_0x55b5,0x1b1));var _0x555b=function(_0x4d8ee0,_0x10edb2){_0x4d8ee0=_0x4d8ee0-0x0;var _0x352fae=_0x55b5[_0x4d8ee0];return _0x352fae;};'use strict';var Sequelize=require('sequelize');module[_0x555b('0x0')]={'type':{'type':Sequelize[_0x555b('0x1')](_0x555b('0x2'),_0x555b('0x3'),_0x555b('0x4'),_0x555b('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x555b('0x6')]},'key':{'type':Sequelize[_0x555b('0x6')]},'keyType':{'type':Sequelize[_0x555b('0x1')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x555b('0x6')]},'idField':{'type':Sequelize[_0x555b('0x6')]},'nameField':{'type':Sequelize[_0x555b('0x6')]},'customField':{'type':Sequelize[_0x555b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x555b('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 7b72f09..867bee1 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 _0x5163=['to-csv','ejs','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','update','then','destroy','end','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','params','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x340b72,_0xdecf9){var _0x227e04=function(_0x115290){while(--_0x115290){_0x340b72['push'](_0x340b72['shift']());}};_0x227e04(++_0xdecf9);}(_0x5163,0xce));var _0x3516=function(_0x5668a1,_0x15cbc6){_0x5668a1=_0x5668a1-0x0;var _0x1dab00=_0x5163[_0x5668a1];return _0x1dab00;};'use strict';var emlformat=require(_0x3516('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3516('0x1'));var jsonpatch=require(_0x3516('0x2'));var rp=require(_0x3516('0x3'));var moment=require('moment');var BPromise=require(_0x3516('0x4'));var Mustache=require(_0x3516('0x5'));var util=require(_0x3516('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3516('0x7'));var ejs=require(_0x3516('0x8'));var fs=require('fs');var fs_extra=require(_0x3516('0x9'));var _=require('lodash');var squel=require(_0x3516('0xa'));var crypto=require('crypto');var jsforce=require(_0x3516('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3516('0x7'));var querystring=require(_0x3516('0xc'));var Papa=require('papaparse');var Redis=require(_0x3516('0xd'));var authService=require(_0x3516('0xe'));var qs=require(_0x3516('0xf'));var as=require(_0x3516('0x10'));var hardwareService=require(_0x3516('0x11'));var logger=require(_0x3516('0x12'))(_0x3516('0x13'));var utils=require(_0x3516('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3516('0x15'));var db=require(_0x3516('0x16'))['db'];function respondWithStatusCode(_0x14fb9f,_0x30596e){_0x30596e=_0x30596e||0xcc;return function(_0x4f7e32){if(_0x4f7e32){return _0x14fb9f[_0x3516('0x17')](_0x30596e);}return _0x14fb9f[_0x3516('0x18')](_0x30596e)['end']();};}function respondWithResult(_0x4af0a8,_0x5d3069){_0x5d3069=_0x5d3069||0xc8;return function(_0x1fc01d){if(_0x1fc01d){return _0x4af0a8[_0x3516('0x18')](_0x5d3069)[_0x3516('0x19')](_0x1fc01d);}};}function respondWithFilteredResult(_0xc65617,_0x49aa4f){return function(_0x2220f1){if(_0x2220f1){var _0x1f1220=typeof _0x49aa4f[_0x3516('0x1a')]===_0x3516('0x1b')&&typeof _0x49aa4f['limit']==='undefined';var _0x3fc3cd=_0x2220f1[_0x3516('0x1c')];var _0x583236=_0x1f1220?0x0:_0x49aa4f[_0x3516('0x1a')];var _0x436618=_0x1f1220?_0x2220f1['count']:_0x49aa4f[_0x3516('0x1a')]+_0x49aa4f[_0x3516('0x1d')];var _0x44cbe6;if(_0x436618>=_0x3fc3cd){_0x436618=_0x3fc3cd;_0x44cbe6=0xc8;}else{_0x44cbe6=0xce;}_0xc65617[_0x3516('0x18')](_0x44cbe6);return _0xc65617['set'](_0x3516('0x1e'),_0x583236+'-'+_0x436618+'/'+_0x3fc3cd)['json'](_0x2220f1);}return null;};}function patchUpdates(_0x2cd1ea){return function(_0x57f2a2){try{jsonpatch['apply'](_0x57f2a2,_0x2cd1ea,!![]);}catch(_0x1c2420){return BPromise['reject'](_0x1c2420);}return _0x57f2a2['save']();};}function saveUpdates(_0x485f95,_0x3f1898){return function(_0x2966){if(_0x2966){return _0x2966[_0x3516('0x1f')](_0x485f95)[_0x3516('0x20')](function(_0xd4b05a){return _0xd4b05a;});}return null;};}function removeEntity(_0x3cd52,_0x347301){return function(_0x1dea38){if(_0x1dea38){return _0x1dea38[_0x3516('0x21')]()[_0x3516('0x20')](function(){_0x3cd52[_0x3516('0x18')](0xcc)[_0x3516('0x22')]();});}};}function handleEntityNotFound(_0x4cd9d6,_0x27b77f){return function(_0x53d4ba){if(!_0x53d4ba){_0x4cd9d6['sendStatus'](0x194);}return _0x53d4ba;};}function handleError(_0x55ec6c,_0xacf813){_0xacf813=_0xacf813||0x1f4;return function(_0x508da4){logger[_0x3516('0x23')](_0x508da4[_0x3516('0x24')]);if(_0x508da4[_0x3516('0x25')]){delete _0x508da4[_0x3516('0x25')];}_0x55ec6c[_0x3516('0x18')](_0xacf813)[_0x3516('0x26')](_0x508da4);};}exports[_0x3516('0x27')]=function(_0x29d90b,_0x2b0792){var _0x324f3a={},_0x39b3b9={},_0x48eb32={'count':0x0,'rows':[]};var _0x38cb9f=_[_0x3516('0x28')](db[_0x3516('0x29')][_0x3516('0x2a')],function(_0x1856c4){return{'name':_0x1856c4[_0x3516('0x2b')],'type':_0x1856c4[_0x3516('0x2c')][_0x3516('0x2d')]};});_0x39b3b9[_0x3516('0x2e')]=_[_0x3516('0x28')](_0x38cb9f,'name');_0x39b3b9[_0x3516('0x2f')]=_[_0x3516('0x30')](_0x29d90b[_0x3516('0x2f')]);_0x39b3b9[_0x3516('0x31')]=_[_0x3516('0x32')](_0x39b3b9['model'],_0x39b3b9[_0x3516('0x2f')]);_0x324f3a[_0x3516('0x33')]=_['intersection'](_0x39b3b9[_0x3516('0x2e')],qs[_0x3516('0x34')](_0x29d90b[_0x3516('0x2f')][_0x3516('0x34')]));_0x324f3a['attributes']=_0x324f3a['attributes'][_0x3516('0x35')]?_0x324f3a[_0x3516('0x33')]:_0x39b3b9[_0x3516('0x2e')];if(!_0x29d90b[_0x3516('0x2f')][_0x3516('0x36')](_0x3516('0x37'))){_0x324f3a[_0x3516('0x1d')]=qs[_0x3516('0x1d')](_0x29d90b[_0x3516('0x2f')]['limit']);_0x324f3a[_0x3516('0x1a')]=qs[_0x3516('0x1a')](_0x29d90b['query'][_0x3516('0x1a')]);}_0x324f3a[_0x3516('0x38')]=qs['sort'](_0x29d90b[_0x3516('0x2f')][_0x3516('0x39')]);_0x324f3a[_0x3516('0x3a')]=qs[_0x3516('0x31')](_['pick'](_0x29d90b[_0x3516('0x2f')],_0x39b3b9[_0x3516('0x31')]),_0x38cb9f);if(_0x29d90b[_0x3516('0x2f')][_0x3516('0x3b')]){_0x324f3a[_0x3516('0x3a')]=_[_0x3516('0x3c')](_0x324f3a['where'],{'$or':_['map'](_0x38cb9f,function(_0x43789a){if(_0x43789a[_0x3516('0x2c')]!==_0x3516('0x3d')){var _0x939277={};_0x939277[_0x43789a[_0x3516('0x25')]]={'$like':'%'+_0x29d90b[_0x3516('0x2f')][_0x3516('0x3b')]+'%'};return _0x939277;}})});}_0x324f3a=_[_0x3516('0x3c')]({},_0x324f3a,_0x29d90b[_0x3516('0x3e')]);var _0x299e4a={'where':_0x324f3a[_0x3516('0x3a')]};return db[_0x3516('0x29')]['count'](_0x299e4a)[_0x3516('0x20')](function(_0x1e2e8c){_0x48eb32['count']=_0x1e2e8c;if(_0x29d90b[_0x3516('0x2f')]['includeAll']){_0x324f3a['include']=[{'all':!![]}];}return db[_0x3516('0x29')]['findAll'](_0x324f3a);})['then'](function(_0x37e2b4){_0x48eb32[_0x3516('0x3f')]=_0x37e2b4;return _0x48eb32;})[_0x3516('0x20')](respondWithFilteredResult(_0x2b0792,_0x324f3a))[_0x3516('0x40')](handleError(_0x2b0792,null));};exports[_0x3516('0x41')]=function(_0x454414,_0x1db191){var _0x424178={'raw':!![],'where':{'id':_0x454414[_0x3516('0x42')]['id']}},_0x3e86ee={};_0x3e86ee[_0x3516('0x2e')]=_['keys'](db[_0x3516('0x29')][_0x3516('0x2a')]);_0x3e86ee[_0x3516('0x2f')]=_[_0x3516('0x30')](_0x454414[_0x3516('0x2f')]);_0x3e86ee[_0x3516('0x31')]=_[_0x3516('0x32')](_0x3e86ee['model'],_0x3e86ee[_0x3516('0x2f')]);_0x424178[_0x3516('0x33')]=_[_0x3516('0x32')](_0x3e86ee[_0x3516('0x2e')],qs['fields'](_0x454414[_0x3516('0x2f')][_0x3516('0x34')]));_0x424178[_0x3516('0x33')]=_0x424178[_0x3516('0x33')][_0x3516('0x35')]?_0x424178[_0x3516('0x33')]:_0x3e86ee['model'];if(_0x454414[_0x3516('0x2f')]['includeAll']){_0x424178[_0x3516('0x43')]=[{'all':!![]}];}_0x424178=_[_0x3516('0x3c')]({},_0x424178,_0x454414[_0x3516('0x3e')]);return db[_0x3516('0x29')][_0x3516('0x44')](_0x424178)[_0x3516('0x20')](handleEntityNotFound(_0x1db191,null))[_0x3516('0x20')](respondWithResult(_0x1db191,null))[_0x3516('0x40')](handleError(_0x1db191,null));};exports[_0x3516('0x45')]=function(_0x819c63,_0x475572){return db[_0x3516('0x29')][_0x3516('0x45')](_0x819c63[_0x3516('0x46')],{})[_0x3516('0x20')](respondWithResult(_0x475572,0xc9))[_0x3516('0x40')](handleError(_0x475572,null));};exports['update']=function(_0x546310,_0x436a8c){if(_0x546310[_0x3516('0x46')]['id']){delete _0x546310[_0x3516('0x46')]['id'];}return db[_0x3516('0x29')][_0x3516('0x44')]({'where':{'id':_0x546310['params']['id']}})[_0x3516('0x20')](handleEntityNotFound(_0x436a8c,null))[_0x3516('0x20')](saveUpdates(_0x546310[_0x3516('0x46')],null))[_0x3516('0x20')](respondWithResult(_0x436a8c,null))[_0x3516('0x40')](handleError(_0x436a8c,null));};exports['destroy']=function(_0x5f0428,_0x57ecf){return db[_0x3516('0x29')][_0x3516('0x44')]({'where':{'id':_0x5f0428[_0x3516('0x42')]['id']}})[_0x3516('0x20')](handleEntityNotFound(_0x57ecf,null))['then'](removeEntity(_0x57ecf,null))['catch'](handleError(_0x57ecf,null));}; \ No newline at end of file +var _0x3ac9=['limit','count','offset','apply','reject','save','update','destroy','stack','name','send','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ServicenowField','then','includeAll','include','findAll','rows','catch','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x3ac9,0x111));var _0x93ac=function(_0x1d046a,_0x30db41){_0x1d046a=_0x1d046a-0x0;var _0x2c0b0c=_0x3ac9[_0x1d046a];return _0x2c0b0c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x93ac('0x0'));var zipdir=require(_0x93ac('0x1'));var jsonpatch=require(_0x93ac('0x2'));var rp=require(_0x93ac('0x3'));var moment=require(_0x93ac('0x4'));var BPromise=require(_0x93ac('0x5'));var Mustache=require(_0x93ac('0x6'));var util=require(_0x93ac('0x7'));var path=require('path');var sox=require(_0x93ac('0x8'));var csv=require('to-csv');var ejs=require(_0x93ac('0x9'));var fs=require('fs');var fs_extra=require(_0x93ac('0xa'));var _=require(_0x93ac('0xb'));var squel=require(_0x93ac('0xc'));var crypto=require('crypto');var jsforce=require(_0x93ac('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x93ac('0xe'));var querystring=require('querystring');var Papa=require(_0x93ac('0xf'));var Redis=require('ioredis');var authService=require(_0x93ac('0x10'));var qs=require(_0x93ac('0x11'));var as=require(_0x93ac('0x12'));var hardwareService=require(_0x93ac('0x13'));var logger=require(_0x93ac('0x14'))(_0x93ac('0x15'));var utils=require(_0x93ac('0x16'));var config=require(_0x93ac('0x17'));var licenseUtil=require(_0x93ac('0x18'));var db=require(_0x93ac('0x19'))['db'];function respondWithStatusCode(_0x31b81f,_0xd0d36d){_0xd0d36d=_0xd0d36d||0xcc;return function(_0x213ad9){if(_0x213ad9){return _0x31b81f[_0x93ac('0x1a')](_0xd0d36d);}return _0x31b81f[_0x93ac('0x1b')](_0xd0d36d)[_0x93ac('0x1c')]();};}function respondWithResult(_0x3528e2,_0x3093a7){_0x3093a7=_0x3093a7||0xc8;return function(_0x5e3afc){if(_0x5e3afc){return _0x3528e2['status'](_0x3093a7)[_0x93ac('0x1d')](_0x5e3afc);}};}function respondWithFilteredResult(_0x3691a1,_0x524fc9){return function(_0x57c92f){if(_0x57c92f){var _0x3bba02=typeof _0x524fc9['offset']===_0x93ac('0x1e')&&typeof _0x524fc9[_0x93ac('0x1f')]===_0x93ac('0x1e');var _0x47771c=_0x57c92f[_0x93ac('0x20')];var _0x38028e=_0x3bba02?0x0:_0x524fc9[_0x93ac('0x21')];var _0xce7ade=_0x3bba02?_0x57c92f[_0x93ac('0x20')]:_0x524fc9[_0x93ac('0x21')]+_0x524fc9['limit'];var _0x22c14c;if(_0xce7ade>=_0x47771c){_0xce7ade=_0x47771c;_0x22c14c=0xc8;}else{_0x22c14c=0xce;}_0x3691a1[_0x93ac('0x1b')](_0x22c14c);return _0x3691a1['set']('Content-Range',_0x38028e+'-'+_0xce7ade+'/'+_0x47771c)[_0x93ac('0x1d')](_0x57c92f);}return null;};}function patchUpdates(_0x5ffcea){return function(_0x2032ca){try{jsonpatch[_0x93ac('0x22')](_0x2032ca,_0x5ffcea,!![]);}catch(_0x161875){return BPromise[_0x93ac('0x23')](_0x161875);}return _0x2032ca[_0x93ac('0x24')]();};}function saveUpdates(_0x5471c6,_0x365c95){return function(_0x46c414){if(_0x46c414){return _0x46c414[_0x93ac('0x25')](_0x5471c6)['then'](function(_0x13f7f0){return _0x13f7f0;});}return null;};}function removeEntity(_0x10c5e0,_0x4453d7){return function(_0x4241e1){if(_0x4241e1){return _0x4241e1[_0x93ac('0x26')]()['then'](function(){_0x10c5e0[_0x93ac('0x1b')](0xcc)[_0x93ac('0x1c')]();});}};}function handleEntityNotFound(_0x69230d,_0x1103ce){return function(_0x234515){if(!_0x234515){_0x69230d['sendStatus'](0x194);}return _0x234515;};}function handleError(_0x2bb3b7,_0x578c78){_0x578c78=_0x578c78||0x1f4;return function(_0x226a2e){logger['error'](_0x226a2e[_0x93ac('0x27')]);if(_0x226a2e[_0x93ac('0x28')]){delete _0x226a2e[_0x93ac('0x28')];}_0x2bb3b7[_0x93ac('0x1b')](_0x578c78)[_0x93ac('0x29')](_0x226a2e);};}exports['index']=function(_0x4d9cb5,_0x4c2cdb){var _0x3d886e={},_0x191ede={},_0x2b4b91={'count':0x0,'rows':[]};var _0x1d20e1=_['map'](db['ServicenowField'][_0x93ac('0x2a')],function(_0x5ab402){return{'name':_0x5ab402[_0x93ac('0x2b')],'type':_0x5ab402[_0x93ac('0x2c')][_0x93ac('0x2d')]};});_0x191ede['model']=_['map'](_0x1d20e1,_0x93ac('0x28'));_0x191ede[_0x93ac('0x2e')]=_[_0x93ac('0x2f')](_0x4d9cb5[_0x93ac('0x2e')]);_0x191ede[_0x93ac('0x30')]=_['intersection'](_0x191ede['model'],_0x191ede[_0x93ac('0x2e')]);_0x3d886e['attributes']=_[_0x93ac('0x31')](_0x191ede[_0x93ac('0x32')],qs[_0x93ac('0x33')](_0x4d9cb5[_0x93ac('0x2e')][_0x93ac('0x33')]));_0x3d886e[_0x93ac('0x34')]=_0x3d886e[_0x93ac('0x34')][_0x93ac('0x35')]?_0x3d886e[_0x93ac('0x34')]:_0x191ede[_0x93ac('0x32')];if(!_0x4d9cb5[_0x93ac('0x2e')][_0x93ac('0x36')](_0x93ac('0x37'))){_0x3d886e[_0x93ac('0x1f')]=qs[_0x93ac('0x1f')](_0x4d9cb5['query']['limit']);_0x3d886e[_0x93ac('0x21')]=qs[_0x93ac('0x21')](_0x4d9cb5[_0x93ac('0x2e')][_0x93ac('0x21')]);}_0x3d886e[_0x93ac('0x38')]=qs[_0x93ac('0x39')](_0x4d9cb5[_0x93ac('0x2e')][_0x93ac('0x39')]);_0x3d886e[_0x93ac('0x3a')]=qs[_0x93ac('0x30')](_[_0x93ac('0x3b')](_0x4d9cb5[_0x93ac('0x2e')],_0x191ede['filters']),_0x1d20e1);if(_0x4d9cb5['query'][_0x93ac('0x3c')]){_0x3d886e[_0x93ac('0x3a')]=_[_0x93ac('0x3d')](_0x3d886e[_0x93ac('0x3a')],{'$or':_[_0x93ac('0x3e')](_0x1d20e1,function(_0x285460){if(_0x285460['type']!==_0x93ac('0x3f')){var _0x381a5b={};_0x381a5b[_0x285460['name']]={'$like':'%'+_0x4d9cb5[_0x93ac('0x2e')][_0x93ac('0x3c')]+'%'};return _0x381a5b;}})});}_0x3d886e=_[_0x93ac('0x3d')]({},_0x3d886e,_0x4d9cb5[_0x93ac('0x40')]);var _0x20b224={'where':_0x3d886e[_0x93ac('0x3a')]};return db[_0x93ac('0x41')][_0x93ac('0x20')](_0x20b224)[_0x93ac('0x42')](function(_0x4c9fd6){_0x2b4b91[_0x93ac('0x20')]=_0x4c9fd6;if(_0x4d9cb5['query'][_0x93ac('0x43')]){_0x3d886e[_0x93ac('0x44')]=[{'all':!![]}];}return db[_0x93ac('0x41')][_0x93ac('0x45')](_0x3d886e);})[_0x93ac('0x42')](function(_0x7f0223){_0x2b4b91[_0x93ac('0x46')]=_0x7f0223;return _0x2b4b91;})[_0x93ac('0x42')](respondWithFilteredResult(_0x4c2cdb,_0x3d886e))[_0x93ac('0x47')](handleError(_0x4c2cdb,null));};exports['show']=function(_0x41101c,_0x473312){var _0x745b27={'raw':!![],'where':{'id':_0x41101c['params']['id']}},_0x42c325={};_0x42c325[_0x93ac('0x32')]=_[_0x93ac('0x2f')](db['ServicenowField'][_0x93ac('0x2a')]);_0x42c325[_0x93ac('0x2e')]=_[_0x93ac('0x2f')](_0x41101c[_0x93ac('0x2e')]);_0x42c325['filters']=_[_0x93ac('0x31')](_0x42c325[_0x93ac('0x32')],_0x42c325['query']);_0x745b27[_0x93ac('0x34')]=_[_0x93ac('0x31')](_0x42c325[_0x93ac('0x32')],qs[_0x93ac('0x33')](_0x41101c['query'][_0x93ac('0x33')]));_0x745b27[_0x93ac('0x34')]=_0x745b27['attributes']['length']?_0x745b27['attributes']:_0x42c325[_0x93ac('0x32')];if(_0x41101c[_0x93ac('0x2e')][_0x93ac('0x43')]){_0x745b27['include']=[{'all':!![]}];}_0x745b27=_[_0x93ac('0x3d')]({},_0x745b27,_0x41101c[_0x93ac('0x40')]);return db[_0x93ac('0x41')]['find'](_0x745b27)[_0x93ac('0x42')](handleEntityNotFound(_0x473312,null))[_0x93ac('0x42')](respondWithResult(_0x473312,null))[_0x93ac('0x47')](handleError(_0x473312,null));};exports[_0x93ac('0x48')]=function(_0x3c57b7,_0x1f02cf){return db[_0x93ac('0x41')][_0x93ac('0x48')](_0x3c57b7['body'],{})[_0x93ac('0x42')](respondWithResult(_0x1f02cf,0xc9))['catch'](handleError(_0x1f02cf,null));};exports[_0x93ac('0x25')]=function(_0x2e6283,_0x304848){if(_0x2e6283[_0x93ac('0x49')]['id']){delete _0x2e6283[_0x93ac('0x49')]['id'];}return db[_0x93ac('0x41')][_0x93ac('0x4a')]({'where':{'id':_0x2e6283[_0x93ac('0x4b')]['id']}})[_0x93ac('0x42')](handleEntityNotFound(_0x304848,null))[_0x93ac('0x42')](saveUpdates(_0x2e6283[_0x93ac('0x49')],null))[_0x93ac('0x42')](respondWithResult(_0x304848,null))[_0x93ac('0x47')](handleError(_0x304848,null));};exports[_0x93ac('0x26')]=function(_0x38de2c,_0x2604c1){return db[_0x93ac('0x41')][_0x93ac('0x4a')]({'where':{'id':_0x38de2c[_0x93ac('0x4b')]['id']}})[_0x93ac('0x42')](handleEntityNotFound(_0x2604c1,null))[_0x93ac('0x42')](removeEntity(_0x2604c1,null))[_0x93ac('0x47')](handleError(_0x2604c1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 80cfce5..3ee61fc 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 _0x703c=['api','moment','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util'];(function(_0x187c30,_0x238119){var _0x391824=function(_0x5e10e3){while(--_0x5e10e3){_0x187c30['push'](_0x187c30['shift']());}};_0x391824(++_0x238119);}(_0x703c,0x1b0));var _0xc703=function(_0x3864d8,_0x311498){_0x3864d8=_0x3864d8-0x0;var _0x6d161=_0x703c[_0x3864d8];return _0x6d161;};'use strict';var _=require(_0xc703('0x0'));var util=require(_0xc703('0x1'));var logger=require('../../config/logger')(_0xc703('0x2'));var moment=require(_0xc703('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc703('0x4'));var rimraf=require(_0xc703('0x5'));var config=require(_0xc703('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xc703('0x7')]=function(_0x50eb69,_0x33b0df){return _0x50eb69[_0xc703('0x8')](_0xc703('0x9'),attributes,{'tableName':_0xc703('0xa'),'paranoid':![],'indexes':[{'name':_0xc703('0xb'),'fields':[_0xc703('0xc'),_0xc703('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4677=['define','servicenow_unique_index','idField','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0x120ab6,_0xc5d29){var _0x1faf95=function(_0x3211a8){while(--_0x3211a8){_0x120ab6['push'](_0x120ab6['shift']());}};_0x1faf95(++_0xc5d29);}(_0x4677,0x155));var _0x7467=function(_0x45dc4b,_0x39080d){_0x45dc4b=_0x45dc4b-0x0;var _0x4109ce=_0x4677[_0x45dc4b];return _0x4109ce;};'use strict';var _=require(_0x7467('0x0'));var util=require('util');var logger=require(_0x7467('0x1'))(_0x7467('0x2'));var moment=require(_0x7467('0x3'));var BPromise=require('bluebird');var rp=require(_0x7467('0x4'));var fs=require('fs');var path=require(_0x7467('0x5'));var rimraf=require(_0x7467('0x6'));var config=require(_0x7467('0x7'));var attributes=require(_0x7467('0x8'));module[_0x7467('0x9')]=function(_0x36fc81,_0x40a9c6){return _0x36fc81[_0x7467('0xa')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x7467('0xb'),'fields':[_0x7467('0xc'),'FieldId'],'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 5ad7a5e..3c75c4e 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 _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xf8a295,_0x3980db){var _0xf28354=function(_0x382fb0){while(--_0x382fb0){_0xf8a295['push'](_0xf8a295['shift']());}};_0xf28354(++_0x3980db);}(_0xe706,0xa3));var _0x6e70=function(_0x19fec1,_0x1cc62f){_0x19fec1=_0x19fec1-0x0;var _0x29cd35=_0xe706[_0x19fec1];return _0x29cd35;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x29e2f3,_0xbbf81a){var _0xf5aff4=function(_0x255a9a){while(--_0x255a9a){_0x29e2f3['push'](_0x29e2f3['shift']());}};_0xf5aff4(++_0xbbf81a);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4b5aa7,_0x234a45){_0x4b5aa7=_0x4b5aa7-0x0;var _0x4b0ab2=_0xf4eb[_0x4b5aa7];return _0x4b0ab2;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 6158bd1..6c695c5 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(_0xe47558,_0x603ef2){var _0x404a43=function(_0x37c3d5){while(--_0x37c3d5){_0xe47558['push'](_0xe47558['shift']());}};_0x404a43(++_0x603ef2);}(_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/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(_0x229d82,_0x10d753){var _0x382e5f=function(_0x474ee9){while(--_0x474ee9){_0x229d82['push'](_0x229d82['shift']());}};_0x382e5f(++_0x10d753);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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 a78234e..07f3786 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(_0x57a64c,_0x33f071){var _0x445964=function(_0x1260ce){while(--_0x1260ce){_0x57a64c['push'](_0x57a64c['shift']());}};_0x445964(++_0x33f071);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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(_0xa9bd44,_0x3526b8){var _0x29b7e5=function(_0x2ac703){while(--_0x2ac703){_0xa9bd44['push'](_0xa9bd44['shift']());}};_0x29b7e5(++_0x3526b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 7e0ab26..2175f42 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 _0xdb63=['destroy','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','/service/v4_1/rest.php','get_module_fields','Calls','values','module_fields','remove','includes','label','endsWith','value','test','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','then','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','intersection','includeAll','create','body','update','find','params'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xdb63,0x18a));var _0x3db6=function(_0x54d6a6,_0x608245){_0x54d6a6=_0x54d6a6-0x0;var _0x7d3f26=_0xdb63[_0x54d6a6];return _0x7d3f26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3db6('0x0'));var zipdir=require(_0x3db6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3db6('0x2'));var moment=require(_0x3db6('0x3'));var BPromise=require(_0x3db6('0x4'));var Mustache=require(_0x3db6('0x5'));var util=require('util');var path=require(_0x3db6('0x6'));var sox=require(_0x3db6('0x7'));var csv=require(_0x3db6('0x8'));var ejs=require(_0x3db6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3db6('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3db6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3db6('0x8'));var querystring=require(_0x3db6('0xc'));var Papa=require(_0x3db6('0xd'));var Redis=require(_0x3db6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3db6('0xf'));var as=require(_0x3db6('0x10'));var hardwareService=require(_0x3db6('0x11'));var logger=require('../../config/logger')(_0x3db6('0x12'));var utils=require(_0x3db6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3db6('0x14'));var db=require(_0x3db6('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x31b6d6,_0x4457e3){_0x4457e3=_0x4457e3||0xcc;return function(_0x1ed5ad){if(_0x1ed5ad){return _0x31b6d6['sendStatus'](_0x4457e3);}return _0x31b6d6[_0x3db6('0x16')](_0x4457e3)[_0x3db6('0x17')]();};}function respondWithResult(_0x23178c,_0x55cea3){_0x55cea3=_0x55cea3||0xc8;return function(_0x29aa51){if(_0x29aa51){return _0x23178c['status'](_0x55cea3)[_0x3db6('0x18')](_0x29aa51);}};}function respondWithFilteredResult(_0xbceee3,_0x3ac4d4){return function(_0x49fd79){if(_0x49fd79){var _0x7537d0=typeof _0x3ac4d4['offset']===_0x3db6('0x19')&&typeof _0x3ac4d4['limit']===_0x3db6('0x19');var _0x3ee6cc=_0x49fd79[_0x3db6('0x1a')];var _0x20de4d=_0x7537d0?0x0:_0x3ac4d4[_0x3db6('0x1b')];var _0x1df379=_0x7537d0?_0x49fd79[_0x3db6('0x1a')]:_0x3ac4d4[_0x3db6('0x1b')]+_0x3ac4d4[_0x3db6('0x1c')];var _0x47e05a;if(_0x1df379>=_0x3ee6cc){_0x1df379=_0x3ee6cc;_0x47e05a=0xc8;}else{_0x47e05a=0xce;}_0xbceee3['status'](_0x47e05a);return _0xbceee3['set'](_0x3db6('0x1d'),_0x20de4d+'-'+_0x1df379+'/'+_0x3ee6cc)['json'](_0x49fd79);}return null;};}function patchUpdates(_0xfe4622){return function(_0x36c6f2){try{jsonpatch[_0x3db6('0x1e')](_0x36c6f2,_0xfe4622,!![]);}catch(_0xd2e011){return BPromise['reject'](_0xd2e011);}return _0x36c6f2[_0x3db6('0x1f')]();};}function saveUpdates(_0xfb4143,_0x565e81){return function(_0x126997){if(_0x126997){return _0x126997['update'](_0xfb4143)[_0x3db6('0x20')](function(_0x1368d9){return _0x1368d9;});}return null;};}function removeEntity(_0x3e1a79,_0x13902a){return function(_0x38ba17){if(_0x38ba17){return _0x38ba17['destroy']()[_0x3db6('0x20')](function(){_0x3e1a79['status'](0xcc)[_0x3db6('0x17')]();});}};}function handleEntityNotFound(_0x366362,_0x53946f){return function(_0x31a169){if(!_0x31a169){_0x366362[_0x3db6('0x21')](0x194);}return _0x31a169;};}function handleError(_0x574ce0,_0x2bbd92){_0x2bbd92=_0x2bbd92||0x1f4;return function(_0x31e1b1){logger[_0x3db6('0x22')](_0x31e1b1[_0x3db6('0x23')]);if(_0x31e1b1['name']){delete _0x31e1b1[_0x3db6('0x24')];}_0x574ce0['status'](_0x2bbd92)[_0x3db6('0x25')](_0x31e1b1);};}exports[_0x3db6('0x26')]=function(_0x2c9dd0,_0x40805d){var _0x7466c5={},_0x20d896={},_0x170d42={'count':0x0,'rows':[]};var _0x64db41=_[_0x3db6('0x27')](db[_0x3db6('0x28')][_0x3db6('0x29')],function(_0x53ec42){return{'name':_0x53ec42[_0x3db6('0x2a')],'type':_0x53ec42[_0x3db6('0x2b')][_0x3db6('0x2c')]};});_0x20d896[_0x3db6('0x2d')]=_[_0x3db6('0x27')](_0x64db41,_0x3db6('0x24'));_0x20d896[_0x3db6('0x2e')]=_[_0x3db6('0x2f')](_0x2c9dd0['query']);_0x20d896[_0x3db6('0x30')]=_['intersection'](_0x20d896['model'],_0x20d896[_0x3db6('0x2e')]);_0x7466c5[_0x3db6('0x31')]=_['intersection'](_0x20d896[_0x3db6('0x2d')],qs[_0x3db6('0x32')](_0x2c9dd0['query']['fields']));_0x7466c5[_0x3db6('0x31')]=_0x7466c5[_0x3db6('0x31')][_0x3db6('0x33')]?_0x7466c5[_0x3db6('0x31')]:_0x20d896[_0x3db6('0x2d')];if(!_0x2c9dd0[_0x3db6('0x2e')][_0x3db6('0x34')](_0x3db6('0x35'))){_0x7466c5['limit']=qs[_0x3db6('0x1c')](_0x2c9dd0['query']['limit']);_0x7466c5[_0x3db6('0x1b')]=qs[_0x3db6('0x1b')](_0x2c9dd0[_0x3db6('0x2e')][_0x3db6('0x1b')]);}_0x7466c5[_0x3db6('0x36')]=qs[_0x3db6('0x37')](_0x2c9dd0[_0x3db6('0x2e')]['sort']);_0x7466c5[_0x3db6('0x38')]=qs[_0x3db6('0x30')](_[_0x3db6('0x39')](_0x2c9dd0[_0x3db6('0x2e')],_0x20d896['filters']),_0x64db41);if(_0x2c9dd0[_0x3db6('0x2e')][_0x3db6('0x3a')]){_0x7466c5['where']=_[_0x3db6('0x3b')](_0x7466c5[_0x3db6('0x38')],{'$or':_[_0x3db6('0x27')](_0x64db41,function(_0x4404ad){if(_0x4404ad[_0x3db6('0x2b')]!==_0x3db6('0x3c')){var _0x2724a4={};_0x2724a4[_0x4404ad[_0x3db6('0x24')]]={'$like':'%'+_0x2c9dd0[_0x3db6('0x2e')]['filter']+'%'};return _0x2724a4;}})});}_0x7466c5=_[_0x3db6('0x3b')]({},_0x7466c5,_0x2c9dd0[_0x3db6('0x3d')]);var _0x520287={'where':_0x7466c5[_0x3db6('0x38')]};return db[_0x3db6('0x28')]['count'](_0x520287)[_0x3db6('0x20')](function(_0xa27886){_0x170d42[_0x3db6('0x1a')]=_0xa27886;if(_0x2c9dd0[_0x3db6('0x2e')]['includeAll']){_0x7466c5[_0x3db6('0x3e')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x3db6('0x3f')](_0x7466c5);})['then'](function(_0x39d69f){_0x170d42[_0x3db6('0x40')]=_0x39d69f;return _0x170d42;})[_0x3db6('0x20')](respondWithFilteredResult(_0x40805d,_0x7466c5))[_0x3db6('0x41')](handleError(_0x40805d,null));};exports[_0x3db6('0x42')]=function(_0x35ec84,_0x38365){var _0xb1259c={'raw':![],'where':{'id':_0x35ec84['params']['id']}},_0x4107bb={};_0x4107bb[_0x3db6('0x2d')]=_[_0x3db6('0x2f')](db[_0x3db6('0x28')][_0x3db6('0x29')]);_0x4107bb[_0x3db6('0x2e')]=_[_0x3db6('0x2f')](_0x35ec84[_0x3db6('0x2e')]);_0x4107bb[_0x3db6('0x30')]=_['intersection'](_0x4107bb[_0x3db6('0x2d')],_0x4107bb[_0x3db6('0x2e')]);_0xb1259c[_0x3db6('0x31')]=_[_0x3db6('0x43')](_0x4107bb[_0x3db6('0x2d')],qs[_0x3db6('0x32')](_0x35ec84[_0x3db6('0x2e')]['fields']));_0xb1259c['attributes']=_0xb1259c['attributes'][_0x3db6('0x33')]?_0xb1259c[_0x3db6('0x31')]:_0x4107bb['model'];if(_0x35ec84['query'][_0x3db6('0x44')]){_0xb1259c[_0x3db6('0x3e')]=[{'all':!![]}];}_0xb1259c=_['merge']({},_0xb1259c,_0x35ec84[_0x3db6('0x3d')]);return db[_0x3db6('0x28')]['find'](_0xb1259c)[_0x3db6('0x20')](handleEntityNotFound(_0x38365,null))[_0x3db6('0x20')](respondWithResult(_0x38365,null))[_0x3db6('0x41')](handleError(_0x38365,null));};exports[_0x3db6('0x45')]=function(_0x35fc19,_0xc603b0){return db['SugarcrmAccount'][_0x3db6('0x45')](_0x35fc19[_0x3db6('0x46')],{})[_0x3db6('0x20')](respondWithResult(_0xc603b0,0xc9))[_0x3db6('0x41')](handleError(_0xc603b0,null));};exports[_0x3db6('0x47')]=function(_0x25194b,_0x465ec9){if(_0x25194b[_0x3db6('0x46')]['id']){delete _0x25194b[_0x3db6('0x46')]['id'];}return db[_0x3db6('0x28')][_0x3db6('0x48')]({'where':{'id':_0x25194b[_0x3db6('0x49')]['id']}})['then'](handleEntityNotFound(_0x465ec9,null))[_0x3db6('0x20')](saveUpdates(_0x25194b[_0x3db6('0x46')],null))[_0x3db6('0x20')](respondWithResult(_0x465ec9,null))[_0x3db6('0x41')](handleError(_0x465ec9,null));};exports[_0x3db6('0x4a')]=function(_0x4ff4d8,_0x16ba73){return db[_0x3db6('0x28')]['find']({'where':{'id':_0x4ff4d8[_0x3db6('0x49')]['id']}})[_0x3db6('0x20')](handleEntityNotFound(_0x16ba73,null))['then'](removeEntity(_0x16ba73,null))['catch'](handleError(_0x16ba73,null));};exports[_0x3db6('0x4b')]=function(_0x239b89,_0x219f49,_0x2e70c1){var _0x401601={};var _0x7d6af7={};var _0x28c1a6;var _0x3e736a;return db['SugarcrmAccount'][_0x3db6('0x4c')]({'where':{'id':_0x239b89[_0x3db6('0x49')]['id']}})['then'](handleEntityNotFound(_0x219f49,null))[_0x3db6('0x20')](function(_0x290d75){if(_0x290d75){_0x28c1a6=_0x290d75;_0x7d6af7[_0x3db6('0x2d')]=_[_0x3db6('0x2f')](db[_0x3db6('0x4d')][_0x3db6('0x29')]);_0x7d6af7[_0x3db6('0x2e')]=_[_0x3db6('0x2f')](_0x239b89['query']);_0x7d6af7[_0x3db6('0x30')]=_[_0x3db6('0x43')](_0x7d6af7[_0x3db6('0x2d')],_0x7d6af7[_0x3db6('0x2e')]);_0x401601[_0x3db6('0x31')]=_['intersection'](_0x7d6af7[_0x3db6('0x2d')],qs[_0x3db6('0x32')](_0x239b89['query'][_0x3db6('0x32')]));_0x401601[_0x3db6('0x31')]=_0x401601['attributes']['length']?_0x401601['attributes']:_0x7d6af7[_0x3db6('0x2d')];_0x401601[_0x3db6('0x36')]=qs[_0x3db6('0x37')](_0x239b89[_0x3db6('0x2e')][_0x3db6('0x37')]);_0x401601[_0x3db6('0x38')]=qs[_0x3db6('0x30')](_[_0x3db6('0x39')](_0x239b89[_0x3db6('0x2e')],_0x7d6af7['filters']));if(_0x239b89['query'][_0x3db6('0x3a')]){_0x401601['where']=_[_0x3db6('0x3b')](_0x401601[_0x3db6('0x38')],{'$or':_[_0x3db6('0x27')](_0x401601['attributes'],function(_0x962614){var _0x2cc3b={};_0x2cc3b[_0x962614]={'$like':'%'+_0x239b89[_0x3db6('0x2e')][_0x3db6('0x3a')]+'%'};return _0x2cc3b;})});}_0x401601=_[_0x3db6('0x3b')]({},_0x401601,_0x239b89['options']);return _0x28c1a6[_0x3db6('0x4b')](_0x401601);}})[_0x3db6('0x20')](function(_0x5b653b){if(_0x5b653b){_0x3e736a=_0x5b653b[_0x3db6('0x33')];if(!_0x239b89['query']['hasOwnProperty']('nolimit')){_0x401601[_0x3db6('0x1c')]=qs[_0x3db6('0x1c')](_0x239b89['query'][_0x3db6('0x1c')]);_0x401601[_0x3db6('0x1b')]=qs[_0x3db6('0x1b')](_0x239b89[_0x3db6('0x2e')]['offset']);}return _0x28c1a6[_0x3db6('0x4b')](_0x401601);}})['then'](function(_0x9270f6){if(_0x9270f6){return _0x9270f6?{'count':_0x3e736a,'rows':_0x9270f6}:null;}})[_0x3db6('0x20')](respondWithResult(_0x219f49,null))[_0x3db6('0x41')](handleError(_0x219f49,null));};exports[_0x3db6('0x4e')]=function(_0x16648d,_0x2fd5e3,_0x17f573){if(_0x16648d[_0x3db6('0x46')]['id']){delete _0x16648d[_0x3db6('0x46')]['id'];}return db[_0x3db6('0x28')][_0x3db6('0x4c')]({'where':{'id':_0x16648d[_0x3db6('0x49')]['id']}})[_0x3db6('0x20')](handleEntityNotFound(_0x2fd5e3,null))['then'](function(_0x341d91){if(_0x341d91){_0x16648d['body'][_0x3db6('0x4f')]=_0x341d91['id'];_0x16648d[_0x3db6('0x46')][_0x3db6('0x50')]=integrations[_0x3db6('0x51')](_0x16648d['body'][_0x3db6('0x52')],_0x16648d[_0x3db6('0x46')][_0x3db6('0x2b')]);_0x16648d['body'][_0x3db6('0x53')]=integrations['getDescriptions'](_0x16648d['body'][_0x3db6('0x52')],_0x16648d[_0x3db6('0x46')][_0x3db6('0x2b')]);return db['SugarcrmConfiguration'][_0x3db6('0x45')](_0x16648d[_0x3db6('0x46')],{'include':[{'model':db[_0x3db6('0x54')],'as':'Subjects'},{'model':db[_0x3db6('0x54')],'as':_0x3db6('0x53')}]});}return null;})[_0x3db6('0x20')](respondWithResult(_0x2fd5e3,null))[_0x3db6('0x41')](handleError(_0x2fd5e3,null));};exports[_0x3db6('0x55')]=function(_0x44f961,_0x22fd3b,_0x42a7cd){var _0x2edb59='';var _0x23c038=['id',_0x3db6('0x24'),_0x3db6('0x56'),_0x3db6('0x57'),_0x3db6('0x58'),_0x3db6('0x59'),'duration_hours',_0x3db6('0x5a'),'parent_id','parent_type','parent_name',_0x3db6('0x5b')];return db['SugarcrmAccount'][_0x3db6('0x4c')]({'where':{'id':_0x44f961[_0x3db6('0x49')]['id']},'attributes':['id',_0x3db6('0x5c'),_0x3db6('0x5d'),_0x3db6('0x5e')]})[_0x3db6('0x20')](handleEntityNotFound(_0x22fd3b,null))[_0x3db6('0x20')](function(_0x5a002e){if(_0x5a002e){_0x2edb59=_0x5a002e[_0x3db6('0x5e')];var _0x5933af=_0x2edb59['slice'](-0x1);if(_0x5933af==='/'){_0x2edb59=_0x2edb59[_0x3db6('0x5f')](0x0,_0x2edb59[_0x3db6('0x60')](_0x5933af));}return rp({'method':_0x3db6('0x61'),'uri':util[_0x3db6('0x62')](_0x3db6('0x63'),_0x2edb59,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'login','input_type':_0x3db6('0x64'),'response_type':_0x3db6('0x64'),'rest_data':JSON[_0x3db6('0x65')]({'user_auth':{'user_name':_0x5a002e[_0x3db6('0x5c')],'password':_0x5a002e[_0x3db6('0x5d')],'encryption':_0x3db6('0x66')},'application':_0x3db6('0x67')})}});}})['then'](function(_0x11f4af){if(_0x11f4af&&_0x11f4af['name']!==_0x3db6('0x68')&&_0x11f4af[_0x3db6('0x24')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util['format'](_0x3db6('0x63'),_0x2edb59,_0x3db6('0x69')),'json':!![],'form':{'method':_0x3db6('0x6a'),'input_type':'JSON','response_type':_0x3db6('0x64'),'rest_data':JSON[_0x3db6('0x65')]({'session':_0x11f4af['id'],'module_name':_0x3db6('0x6b')})}})[_0x3db6('0x20')](function(_0x1ca47e){if(_0x1ca47e){var _0x2f5ec6=_[_0x3db6('0x6c')](_0x1ca47e[_0x3db6('0x6d')]);_[_0x3db6('0x6e')](_0x2f5ec6,function(_0x4f122a){return _0x23c038[_0x3db6('0x6f')](_0x4f122a['name']);});return{'count':_0x2f5ec6[_0x3db6('0x33')],'rows':_[_0x3db6('0x27')](_0x2f5ec6,function(_0x57a106){return{'id':_0x57a106['name'],'name':_0x57a106[_0x3db6('0x70')],'custom':_[_0x3db6('0x71')](_0x57a106['name'],'_c')?!![]:![],'options':_0x57a106['options']?_[_0x3db6('0x27')](_[_0x3db6('0x6c')](_0x57a106['options']),function(_0x34d15b){return{'name':_0x34d15b[_0x3db6('0x72')],'value':_0x34d15b['name']};}):[]};})};}})[_0x3db6('0x20')](respondWithResult(_0x22fd3b,null))[_0x3db6('0x41')](function(_0xde1654){var _0x4a5e9f=_0x44f961[_0x3db6('0x2e')][_0x3db6('0x73')]?0x1f4:_0xde1654['statusCode']||0x1f4;logger[_0x3db6('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0x3db6('0x55'),_0x4a5e9f,JSON[_0x3db6('0x65')](_0xde1654));delete _0xde1654[_0x3db6('0x24')];if(_0x4a5e9f===0x191){_0x4a5e9f=0x190;}_0x22fd3b[_0x3db6('0x16')](_0x4a5e9f)['send'](_0x44f961['query'][_0x3db6('0x73')]?{'message':'Wrong\x20credentials','statusCode':_0xde1654['statusCode']}:_0xde1654);});}else{var _0x3b8b0a=0x1f4;_0x22fd3b[_0x3db6('0x16')](_0x3b8b0a)['send']({'message':_0x3db6('0x74'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x4e44=['values','module_fields','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','pick','filter','where','merge','options','SugarcrmAccount','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','duration_hours','parent_id','direction','username','password','remoteUri','slice','substring','POST','%s%s','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x4e44,0xf4));var _0x44e4=function(_0x2f0fa9,_0x1f521b){_0x2f0fa9=_0x2f0fa9-0x0;var _0x144677=_0x4e44[_0x2f0fa9];return _0x144677;};'use strict';var emlformat=require(_0x44e4('0x0'));var rimraf=require(_0x44e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x44e4('0x2'));var rp=require('request-promise');var moment=require(_0x44e4('0x3'));var BPromise=require(_0x44e4('0x4'));var Mustache=require(_0x44e4('0x5'));var util=require(_0x44e4('0x6'));var path=require(_0x44e4('0x7'));var sox=require('sox');var csv=require(_0x44e4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44e4('0x9'));var squel=require(_0x44e4('0xa'));var crypto=require('crypto');var jsforce=require(_0x44e4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44e4('0xc'));var Papa=require(_0x44e4('0xd'));var Redis=require(_0x44e4('0xe'));var authService=require(_0x44e4('0xf'));var qs=require(_0x44e4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44e4('0x11'));var logger=require(_0x44e4('0x12'))(_0x44e4('0x13'));var utils=require(_0x44e4('0x14'));var config=require(_0x44e4('0x15'));var licenseUtil=require(_0x44e4('0x16'));var db=require(_0x44e4('0x17'))['db'];var integrations=require(_0x44e4('0x18'));function respondWithStatusCode(_0xc1063,_0x5cb56e){_0x5cb56e=_0x5cb56e||0xcc;return function(_0x421c47){if(_0x421c47){return _0xc1063[_0x44e4('0x19')](_0x5cb56e);}return _0xc1063[_0x44e4('0x1a')](_0x5cb56e)[_0x44e4('0x1b')]();};}function respondWithResult(_0x43c45f,_0x29d115){_0x29d115=_0x29d115||0xc8;return function(_0x11ffc3){if(_0x11ffc3){return _0x43c45f[_0x44e4('0x1a')](_0x29d115)[_0x44e4('0x1c')](_0x11ffc3);}};}function respondWithFilteredResult(_0x1f703e,_0x5e53a9){return function(_0x47f284){if(_0x47f284){var _0xb33d3=typeof _0x5e53a9[_0x44e4('0x1d')]===_0x44e4('0x1e')&&typeof _0x5e53a9['limit']===_0x44e4('0x1e');var _0x407660=_0x47f284[_0x44e4('0x1f')];var _0x289417=_0xb33d3?0x0:_0x5e53a9[_0x44e4('0x1d')];var _0x408f3a=_0xb33d3?_0x47f284[_0x44e4('0x1f')]:_0x5e53a9[_0x44e4('0x1d')]+_0x5e53a9['limit'];var _0x467476;if(_0x408f3a>=_0x407660){_0x408f3a=_0x407660;_0x467476=0xc8;}else{_0x467476=0xce;}_0x1f703e[_0x44e4('0x1a')](_0x467476);return _0x1f703e[_0x44e4('0x20')](_0x44e4('0x21'),_0x289417+'-'+_0x408f3a+'/'+_0x407660)[_0x44e4('0x1c')](_0x47f284);}return null;};}function patchUpdates(_0x2ab131){return function(_0x360a5b){try{jsonpatch['apply'](_0x360a5b,_0x2ab131,!![]);}catch(_0x8b43f9){return BPromise[_0x44e4('0x22')](_0x8b43f9);}return _0x360a5b[_0x44e4('0x23')]();};}function saveUpdates(_0x28317f,_0x475fd1){return function(_0x126d80){if(_0x126d80){return _0x126d80[_0x44e4('0x24')](_0x28317f)[_0x44e4('0x25')](function(_0x2fb611){return _0x2fb611;});}return null;};}function removeEntity(_0x6164fe,_0xbdfb4a){return function(_0x2d9699){if(_0x2d9699){return _0x2d9699[_0x44e4('0x26')]()['then'](function(){_0x6164fe[_0x44e4('0x1a')](0xcc)[_0x44e4('0x1b')]();});}};}function handleEntityNotFound(_0x2838dd,_0x59476c){return function(_0x40bc1c){if(!_0x40bc1c){_0x2838dd[_0x44e4('0x19')](0x194);}return _0x40bc1c;};}function handleError(_0x36dbff,_0xa01a83){_0xa01a83=_0xa01a83||0x1f4;return function(_0xddfe2e){logger[_0x44e4('0x27')](_0xddfe2e[_0x44e4('0x28')]);if(_0xddfe2e['name']){delete _0xddfe2e[_0x44e4('0x29')];}_0x36dbff[_0x44e4('0x1a')](_0xa01a83)[_0x44e4('0x2a')](_0xddfe2e);};}exports[_0x44e4('0x2b')]=function(_0x10f2e4,_0x38e1f3){var _0x56357a={},_0x1a21e4={},_0x117da6={'count':0x0,'rows':[]};var _0x2bee78=_[_0x44e4('0x2c')](db['SugarcrmAccount']['rawAttributes'],function(_0x105968){return{'name':_0x105968['fieldName'],'type':_0x105968[_0x44e4('0x2d')][_0x44e4('0x2e')]};});_0x1a21e4[_0x44e4('0x2f')]=_[_0x44e4('0x2c')](_0x2bee78,_0x44e4('0x29'));_0x1a21e4[_0x44e4('0x30')]=_['keys'](_0x10f2e4['query']);_0x1a21e4[_0x44e4('0x31')]=_[_0x44e4('0x32')](_0x1a21e4[_0x44e4('0x2f')],_0x1a21e4[_0x44e4('0x30')]);_0x56357a[_0x44e4('0x33')]=_[_0x44e4('0x32')](_0x1a21e4['model'],qs[_0x44e4('0x34')](_0x10f2e4[_0x44e4('0x30')][_0x44e4('0x34')]));_0x56357a['attributes']=_0x56357a[_0x44e4('0x33')][_0x44e4('0x35')]?_0x56357a[_0x44e4('0x33')]:_0x1a21e4[_0x44e4('0x2f')];if(!_0x10f2e4[_0x44e4('0x30')]['hasOwnProperty'](_0x44e4('0x36'))){_0x56357a[_0x44e4('0x37')]=qs[_0x44e4('0x37')](_0x10f2e4[_0x44e4('0x30')][_0x44e4('0x37')]);_0x56357a[_0x44e4('0x1d')]=qs['offset'](_0x10f2e4[_0x44e4('0x30')][_0x44e4('0x1d')]);}_0x56357a['order']=qs[_0x44e4('0x38')](_0x10f2e4[_0x44e4('0x30')]['sort']);_0x56357a['where']=qs['filters'](_[_0x44e4('0x39')](_0x10f2e4[_0x44e4('0x30')],_0x1a21e4[_0x44e4('0x31')]),_0x2bee78);if(_0x10f2e4[_0x44e4('0x30')][_0x44e4('0x3a')]){_0x56357a['where']=_['merge'](_0x56357a[_0x44e4('0x3b')],{'$or':_[_0x44e4('0x2c')](_0x2bee78,function(_0x52fe66){if(_0x52fe66['type']!=='VIRTUAL'){var _0x513d21={};_0x513d21[_0x52fe66[_0x44e4('0x29')]]={'$like':'%'+_0x10f2e4[_0x44e4('0x30')]['filter']+'%'};return _0x513d21;}})});}_0x56357a=_[_0x44e4('0x3c')]({},_0x56357a,_0x10f2e4[_0x44e4('0x3d')]);var _0x3b795d={'where':_0x56357a[_0x44e4('0x3b')]};return db[_0x44e4('0x3e')][_0x44e4('0x1f')](_0x3b795d)[_0x44e4('0x25')](function(_0x3f28fa){_0x117da6[_0x44e4('0x1f')]=_0x3f28fa;if(_0x10f2e4[_0x44e4('0x30')][_0x44e4('0x3f')]){_0x56357a[_0x44e4('0x40')]=[{'all':!![]}];}return db[_0x44e4('0x3e')][_0x44e4('0x41')](_0x56357a);})[_0x44e4('0x25')](function(_0x297906){_0x117da6['rows']=_0x297906;return _0x117da6;})[_0x44e4('0x25')](respondWithFilteredResult(_0x38e1f3,_0x56357a))[_0x44e4('0x42')](handleError(_0x38e1f3,null));};exports[_0x44e4('0x43')]=function(_0x12871b,_0x4720e7){var _0xe75f05={'raw':![],'where':{'id':_0x12871b[_0x44e4('0x44')]['id']}},_0x33d3f5={};_0x33d3f5[_0x44e4('0x2f')]=_[_0x44e4('0x45')](db[_0x44e4('0x3e')][_0x44e4('0x46')]);_0x33d3f5[_0x44e4('0x30')]=_[_0x44e4('0x45')](_0x12871b['query']);_0x33d3f5[_0x44e4('0x31')]=_['intersection'](_0x33d3f5[_0x44e4('0x2f')],_0x33d3f5[_0x44e4('0x30')]);_0xe75f05['attributes']=_['intersection'](_0x33d3f5['model'],qs[_0x44e4('0x34')](_0x12871b[_0x44e4('0x30')][_0x44e4('0x34')]));_0xe75f05[_0x44e4('0x33')]=_0xe75f05[_0x44e4('0x33')][_0x44e4('0x35')]?_0xe75f05['attributes']:_0x33d3f5[_0x44e4('0x2f')];if(_0x12871b[_0x44e4('0x30')][_0x44e4('0x3f')]){_0xe75f05[_0x44e4('0x40')]=[{'all':!![]}];}_0xe75f05=_['merge']({},_0xe75f05,_0x12871b[_0x44e4('0x3d')]);return db[_0x44e4('0x3e')][_0x44e4('0x47')](_0xe75f05)['then'](handleEntityNotFound(_0x4720e7,null))[_0x44e4('0x25')](respondWithResult(_0x4720e7,null))[_0x44e4('0x42')](handleError(_0x4720e7,null));};exports[_0x44e4('0x48')]=function(_0x29b91f,_0x2684e2){return db[_0x44e4('0x3e')][_0x44e4('0x48')](_0x29b91f[_0x44e4('0x49')],{})[_0x44e4('0x25')](respondWithResult(_0x2684e2,0xc9))['catch'](handleError(_0x2684e2,null));};exports[_0x44e4('0x24')]=function(_0x32b383,_0x1965d2){if(_0x32b383['body']['id']){delete _0x32b383[_0x44e4('0x49')]['id'];}return db[_0x44e4('0x3e')][_0x44e4('0x47')]({'where':{'id':_0x32b383['params']['id']}})[_0x44e4('0x25')](handleEntityNotFound(_0x1965d2,null))[_0x44e4('0x25')](saveUpdates(_0x32b383[_0x44e4('0x49')],null))[_0x44e4('0x25')](respondWithResult(_0x1965d2,null))[_0x44e4('0x42')](handleError(_0x1965d2,null));};exports[_0x44e4('0x26')]=function(_0x52e1c7,_0x3bbf5c){return db[_0x44e4('0x3e')][_0x44e4('0x47')]({'where':{'id':_0x52e1c7[_0x44e4('0x44')]['id']}})[_0x44e4('0x25')](handleEntityNotFound(_0x3bbf5c,null))[_0x44e4('0x25')](removeEntity(_0x3bbf5c,null))[_0x44e4('0x42')](handleError(_0x3bbf5c,null));};exports[_0x44e4('0x4a')]=function(_0xe44eb6,_0x4c1594,_0x20764d){var _0x5360c4={};var _0x1377bf={};var _0x1f081d;var _0x25bccc;return db['SugarcrmAccount'][_0x44e4('0x4b')]({'where':{'id':_0xe44eb6['params']['id']}})[_0x44e4('0x25')](handleEntityNotFound(_0x4c1594,null))[_0x44e4('0x25')](function(_0x4e74de){if(_0x4e74de){_0x1f081d=_0x4e74de;_0x1377bf[_0x44e4('0x2f')]=_[_0x44e4('0x45')](db[_0x44e4('0x4c')]['rawAttributes']);_0x1377bf[_0x44e4('0x30')]=_[_0x44e4('0x45')](_0xe44eb6[_0x44e4('0x30')]);_0x1377bf['filters']=_[_0x44e4('0x32')](_0x1377bf[_0x44e4('0x2f')],_0x1377bf['query']);_0x5360c4['attributes']=_['intersection'](_0x1377bf[_0x44e4('0x2f')],qs[_0x44e4('0x34')](_0xe44eb6[_0x44e4('0x30')]['fields']));_0x5360c4[_0x44e4('0x33')]=_0x5360c4[_0x44e4('0x33')][_0x44e4('0x35')]?_0x5360c4[_0x44e4('0x33')]:_0x1377bf[_0x44e4('0x2f')];_0x5360c4[_0x44e4('0x4d')]=qs['sort'](_0xe44eb6[_0x44e4('0x30')]['sort']);_0x5360c4[_0x44e4('0x3b')]=qs[_0x44e4('0x31')](_[_0x44e4('0x39')](_0xe44eb6[_0x44e4('0x30')],_0x1377bf[_0x44e4('0x31')]));if(_0xe44eb6[_0x44e4('0x30')][_0x44e4('0x3a')]){_0x5360c4['where']=_[_0x44e4('0x3c')](_0x5360c4[_0x44e4('0x3b')],{'$or':_[_0x44e4('0x2c')](_0x5360c4[_0x44e4('0x33')],function(_0x4ae574){var _0x1a5452={};_0x1a5452[_0x4ae574]={'$like':'%'+_0xe44eb6[_0x44e4('0x30')][_0x44e4('0x3a')]+'%'};return _0x1a5452;})});}_0x5360c4=_[_0x44e4('0x3c')]({},_0x5360c4,_0xe44eb6[_0x44e4('0x3d')]);return _0x1f081d['getConfigurations'](_0x5360c4);}})[_0x44e4('0x25')](function(_0x24751d){if(_0x24751d){_0x25bccc=_0x24751d['length'];if(!_0xe44eb6[_0x44e4('0x30')]['hasOwnProperty']('nolimit')){_0x5360c4['limit']=qs['limit'](_0xe44eb6[_0x44e4('0x30')]['limit']);_0x5360c4[_0x44e4('0x1d')]=qs[_0x44e4('0x1d')](_0xe44eb6[_0x44e4('0x30')]['offset']);}return _0x1f081d[_0x44e4('0x4a')](_0x5360c4);}})[_0x44e4('0x25')](function(_0x1a97ae){if(_0x1a97ae){return _0x1a97ae?{'count':_0x25bccc,'rows':_0x1a97ae}:null;}})[_0x44e4('0x25')](respondWithResult(_0x4c1594,null))[_0x44e4('0x42')](handleError(_0x4c1594,null));};exports['addConfiguration']=function(_0x49d649,_0x14da20,_0x2bcf7d){if(_0x49d649[_0x44e4('0x49')]['id']){delete _0x49d649[_0x44e4('0x49')]['id'];}return db['SugarcrmAccount'][_0x44e4('0x4b')]({'where':{'id':_0x49d649[_0x44e4('0x44')]['id']}})[_0x44e4('0x25')](handleEntityNotFound(_0x14da20,null))[_0x44e4('0x25')](function(_0xf9d31){if(_0xf9d31){_0x49d649['body'][_0x44e4('0x4e')]=_0xf9d31['id'];_0x49d649['body'][_0x44e4('0x4f')]=integrations[_0x44e4('0x50')](_0x49d649[_0x44e4('0x49')][_0x44e4('0x51')],_0x49d649[_0x44e4('0x49')][_0x44e4('0x2d')]);_0x49d649[_0x44e4('0x49')][_0x44e4('0x52')]=integrations[_0x44e4('0x53')](_0x49d649['body'][_0x44e4('0x51')],_0x49d649[_0x44e4('0x49')][_0x44e4('0x2d')]);return db[_0x44e4('0x4c')][_0x44e4('0x48')](_0x49d649[_0x44e4('0x49')],{'include':[{'model':db[_0x44e4('0x54')],'as':_0x44e4('0x4f')},{'model':db[_0x44e4('0x54')],'as':'Descriptions'}]});}return null;})[_0x44e4('0x25')](respondWithResult(_0x14da20,null))[_0x44e4('0x42')](handleError(_0x14da20,null));};exports[_0x44e4('0x55')]=function(_0x1e584c,_0x5a5aca,_0x22f59b){var _0xf6969c='';var _0x58d33c=['id','name',_0x44e4('0x56'),_0x44e4('0x57'),'description','date_start',_0x44e4('0x58'),'duration_minutes',_0x44e4('0x59'),'parent_type','parent_name',_0x44e4('0x5a')];return db[_0x44e4('0x3e')][_0x44e4('0x4b')]({'where':{'id':_0x1e584c[_0x44e4('0x44')]['id']},'attributes':['id',_0x44e4('0x5b'),_0x44e4('0x5c'),_0x44e4('0x5d')]})[_0x44e4('0x25')](handleEntityNotFound(_0x5a5aca,null))['then'](function(_0x3937ca){if(_0x3937ca){_0xf6969c=_0x3937ca[_0x44e4('0x5d')];var _0x168f44=_0xf6969c[_0x44e4('0x5e')](-0x1);if(_0x168f44==='/'){_0xf6969c=_0xf6969c[_0x44e4('0x5f')](0x0,_0xf6969c['lastIndexOf'](_0x168f44));}return rp({'method':_0x44e4('0x60'),'uri':util['format'](_0x44e4('0x61'),_0xf6969c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x44e4('0x62'),'input_type':_0x44e4('0x63'),'response_type':_0x44e4('0x63'),'rest_data':JSON[_0x44e4('0x64')]({'user_auth':{'user_name':_0x3937ca[_0x44e4('0x5b')],'password':_0x3937ca['password'],'encryption':'PLAIN'},'application':_0x44e4('0x65')})}});}})[_0x44e4('0x25')](function(_0x81c25e){if(_0x81c25e&&_0x81c25e['name']!==_0x44e4('0x66')&&_0x81c25e[_0x44e4('0x29')]!==_0x44e4('0x67')){return rp({'method':'POST','uri':util['format']('%s%s',_0xf6969c,_0x44e4('0x68')),'json':!![],'form':{'method':_0x44e4('0x69'),'input_type':_0x44e4('0x63'),'response_type':_0x44e4('0x63'),'rest_data':JSON[_0x44e4('0x64')]({'session':_0x81c25e['id'],'module_name':_0x44e4('0x6a')})}})['then'](function(_0x3a5443){if(_0x3a5443){var _0x55b72b=_[_0x44e4('0x6b')](_0x3a5443[_0x44e4('0x6c')]);_[_0x44e4('0x6d')](_0x55b72b,function(_0x389ca4){return _0x58d33c[_0x44e4('0x6e')](_0x389ca4[_0x44e4('0x29')]);});return{'count':_0x55b72b[_0x44e4('0x35')],'rows':_['map'](_0x55b72b,function(_0x59adaf){return{'id':_0x59adaf[_0x44e4('0x29')],'name':_0x59adaf[_0x44e4('0x6f')],'custom':_['endsWith'](_0x59adaf[_0x44e4('0x29')],'_c')?!![]:![],'options':_0x59adaf[_0x44e4('0x3d')]?_[_0x44e4('0x2c')](_[_0x44e4('0x6b')](_0x59adaf['options']),function(_0x22e3c4){return{'name':_0x22e3c4[_0x44e4('0x70')],'value':_0x22e3c4[_0x44e4('0x29')]};}):[]};})};}})['then'](respondWithResult(_0x5a5aca,null))['catch'](function(_0x309109){var _0xc246f=_0x1e584c[_0x44e4('0x30')][_0x44e4('0x71')]?0x1f4:_0x309109[_0x44e4('0x72')]||0x1f4;logger['error'](_0x44e4('0x73'),_0x44e4('0x55'),_0xc246f,JSON[_0x44e4('0x64')](_0x309109));delete _0x309109[_0x44e4('0x29')];if(_0xc246f===0x191){_0xc246f=0x190;}_0x5a5aca[_0x44e4('0x1a')](_0xc246f)[_0x44e4('0x2a')](_0x1e584c[_0x44e4('0x30')][_0x44e4('0x71')]?{'message':_0x44e4('0x74'),'statusCode':_0x309109[_0x44e4('0x72')]}:_0x309109);});}else{var _0x46536d=0x1f4;_0x5a5aca[_0x44e4('0x1a')](_0x46536d)['send']({'message':'Wrong\x20credentials','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 ee82f83..4d48bfa 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 _0xe205=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x220b8d,_0x3bb480){var _0x4e5f2d=function(_0x1b7948){while(--_0x1b7948){_0x220b8d['push'](_0x220b8d['shift']());}};_0x4e5f2d(++_0x3bb480);}(_0xe205,0xb0));var _0x5e20=function(_0x3982d0,_0x2e7634){_0x3982d0=_0x3982d0-0x0;var _0x5707d3=_0xe205[_0x3982d0];return _0x5707d3;};'use strict';var _=require(_0x5e20('0x0'));var util=require(_0x5e20('0x1'));var logger=require('../../config/logger')(_0x5e20('0x2'));var moment=require('moment');var BPromise=require(_0x5e20('0x3'));var rp=require(_0x5e20('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e20('0x5'));var config=require(_0x5e20('0x6'));var attributes=require(_0x5e20('0x7'));var integrations=require(_0x5e20('0x8'));module[_0x5e20('0x9')]=function(_0x516d56,_0x1f1f75){return _0x516d56[_0x5e20('0xa')](_0x5e20('0xb'),attributes,{'tableName':_0x5e20('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x845f=['bluebird','request-promise','path','rimraf','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','moment'];(function(_0x34ede4,_0x519750){var _0x49a9c3=function(_0x1ccaf9){while(--_0x1ccaf9){_0x34ede4['push'](_0x34ede4['shift']());}};_0x49a9c3(++_0x519750);}(_0x845f,0x1b8));var _0xf845=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x845f[_0x35885a];return _0xe86249;};'use strict';var _=require(_0xf845('0x0'));var util=require(_0xf845('0x1'));var logger=require(_0xf845('0x2'))('api');var moment=require(_0xf845('0x3'));var BPromise=require(_0xf845('0x4'));var rp=require(_0xf845('0x5'));var fs=require('fs');var path=require(_0xf845('0x6'));var rimraf=require(_0xf845('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0xf845('0x8'));module[_0xf845('0x9')]=function(_0x1efcaa,_0x21cea){return _0x1efcaa['define'](_0xf845('0xa'),attributes,{'tableName':_0xf845('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 2c8df98..19da180 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 _0xbd4b=['bluebird','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','SugarcrmAccount','ShowSugarcrmAccount','util','moment'];(function(_0x331be0,_0x382566){var _0x4fa203=function(_0x3f8964){while(--_0x3f8964){_0x331be0['push'](_0x331be0['shift']());}};_0x4fa203(++_0x382566);}(_0xbd4b,0x169));var _0xbbd4=function(_0x15462b,_0x4fcf41){_0x15462b=_0x15462b-0x0;var _0x2295fe=_0xbd4b[_0x15462b];return _0x2295fe;};'use strict';var _=require('lodash');var util=require(_0xbbd4('0x0'));var moment=require(_0xbbd4('0x1'));var BPromise=require(_0xbbd4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbbd4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbd4('0x4'))(_0xbbd4('0x5'));var config=require('../../config/environment');var jayson=require(_0xbbd4('0x6'));var client=jayson['client'][_0xbbd4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd9e566,_0x415cee,_0x2a9e0a){return new BPromise(function(_0x37cee5,_0x39dcf2){return client[_0xbbd4('0x8')](_0xd9e566,_0x2a9e0a)[_0xbbd4('0x9')](function(_0x31d5a1){logger[_0xbbd4('0xa')](_0xbbd4('0xb'),_0x415cee,_0xbbd4('0xc'));logger[_0xbbd4('0xd')](_0xbbd4('0xe'),_0x415cee,'request\x20sent',JSON[_0xbbd4('0xf')](_0x31d5a1));if(_0x31d5a1[_0xbbd4('0x10')]){if(_0x31d5a1[_0xbbd4('0x10')][_0xbbd4('0x11')]===0x1f4){logger[_0xbbd4('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x415cee,_0x31d5a1[_0xbbd4('0x10')][_0xbbd4('0x12')]);return _0x39dcf2(_0x31d5a1[_0xbbd4('0x10')][_0xbbd4('0x12')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x415cee,_0x31d5a1[_0xbbd4('0x10')][_0xbbd4('0x12')]);return _0x37cee5(_0x31d5a1[_0xbbd4('0x10')]['message']);}else{logger[_0xbbd4('0xa')](_0xbbd4('0xb'),_0x415cee,_0xbbd4('0xc'));_0x37cee5(_0x31d5a1[_0xbbd4('0x13')]['message']);}})['catch'](function(_0x41f377){logger['error'](_0xbbd4('0xb'),_0x415cee,_0x41f377);_0x39dcf2(_0x41f377);});});}exports[_0xbbd4('0x14')]=function(_0x422270){var _0x3566f9=this;return new Promise(function(_0x7372a0,_0x1aa44f){return db['SugarcrmAccount'][_0xbbd4('0x15')]({'raw':_0x422270[_0xbbd4('0x16')]?_0x422270[_0xbbd4('0x16')][_0xbbd4('0x17')]===undefined?!![]:![]:!![],'where':_0x422270[_0xbbd4('0x16')]?_0x422270[_0xbbd4('0x16')][_0xbbd4('0x18')]||null:null,'attributes':_0x422270[_0xbbd4('0x16')]?_0x422270[_0xbbd4('0x16')][_0xbbd4('0x19')]||null:null,'limit':_0x422270[_0xbbd4('0x16')]?_0x422270[_0xbbd4('0x16')][_0xbbd4('0x1a')]||null:null,'include':_0x422270['options']?_0x422270['options']['include']?_[_0xbbd4('0x1b')](_0x422270[_0xbbd4('0x16')]['include'],function(_0x4e24c8){return{'model':db[_0x4e24c8['model']],'as':_0x4e24c8['as'],'attributes':_0x4e24c8[_0xbbd4('0x19')],'include':_0x4e24c8[_0xbbd4('0x1c')]?_[_0xbbd4('0x1b')](_0x4e24c8[_0xbbd4('0x1c')],function(_0x266da1){return{'model':db[_0x266da1[_0xbbd4('0x1d')]],'as':_0x266da1['as'],'attributes':_0x266da1['attributes'],'include':_0x266da1[_0xbbd4('0x1c')]?_[_0xbbd4('0x1b')](_0x266da1[_0xbbd4('0x1c')],function(_0x2296ae){return{'model':db[_0x2296ae[_0xbbd4('0x1d')]],'as':_0x2296ae['as'],'attributes':_0x2296ae[_0xbbd4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbbd4('0x9')](function(_0x3ce746){logger['info'](_0xbbd4('0x14'),_0x422270);logger[_0xbbd4('0xd')](_0xbbd4('0x14'),_0x422270,JSON['stringify'](_0x3ce746));_0x7372a0(_0x3ce746);})[_0xbbd4('0x1e')](function(_0x48111e){logger[_0xbbd4('0x10')]('GetSugarcrmAccount',_0x48111e[_0xbbd4('0x12')],_0x422270);_0x1aa44f(_0x3566f9[_0xbbd4('0x10')](0x1f4,_0x48111e[_0xbbd4('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0xb44d59){var _0x15f6ba=this;return new Promise(function(_0x19a0a7,_0xb99290){return db[_0xbbd4('0x1f')]['find']({'raw':_0xb44d59[_0xbbd4('0x16')]?_0xb44d59['options']['raw']===undefined?!![]:![]:!![],'where':_0xb44d59[_0xbbd4('0x16')]?_0xb44d59[_0xbbd4('0x16')][_0xbbd4('0x18')]||null:null,'attributes':_0xb44d59['options']?_0xb44d59[_0xbbd4('0x16')][_0xbbd4('0x19')]||null:null,'include':_0xb44d59[_0xbbd4('0x16')]?_0xb44d59['options'][_0xbbd4('0x1c')]?_[_0xbbd4('0x1b')](_0xb44d59['options'][_0xbbd4('0x1c')],function(_0x491a53){return{'model':db[_0x491a53[_0xbbd4('0x1d')]],'as':_0x491a53['as'],'attributes':_0x491a53[_0xbbd4('0x19')],'include':_0x491a53[_0xbbd4('0x1c')]?_[_0xbbd4('0x1b')](_0x491a53[_0xbbd4('0x1c')],function(_0x1455c2){return{'model':db[_0x1455c2['model']],'as':_0x1455c2['as'],'attributes':_0x1455c2[_0xbbd4('0x19')],'include':_0x1455c2['include']?_[_0xbbd4('0x1b')](_0x1455c2[_0xbbd4('0x1c')],function(_0x8e5269){return{'model':db[_0x8e5269['model']],'as':_0x8e5269['as'],'attributes':_0x8e5269['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbd4('0x9')](function(_0x13a76f){logger[_0xbbd4('0xa')]('ShowSugarcrmAccount',_0xb44d59);logger['debug'](_0xbbd4('0x20'),_0xb44d59,JSON['stringify'](_0x13a76f));_0x19a0a7(_0x13a76f);})[_0xbbd4('0x1e')](function(_0x542c87){logger[_0xbbd4('0x10')](_0xbbd4('0x20'),_0x542c87['message'],_0xb44d59);_0xb99290(_0x15f6ba[_0xbbd4('0x10')](0x1f4,_0x542c87[_0xbbd4('0x12')]));});});}; \ No newline at end of file +var _0x60bd=['SugarcrmAccount','findAll','raw','options','where','attributes','limit','include','map','model','then','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','request','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetSugarcrmAccount'];(function(_0x23c314,_0x467489){var _0x39e586=function(_0x25f647){while(--_0x25f647){_0x23c314['push'](_0x23c314['shift']());}};_0x39e586(++_0x467489);}(_0x60bd,0xd3));var _0xd60b=function(_0x3adc9a,_0x715dba){_0x3adc9a=_0x3adc9a-0x0;var _0x27b069=_0x60bd[_0x3adc9a];return _0x27b069;};'use strict';var _=require(_0xd60b('0x0'));var util=require(_0xd60b('0x1'));var moment=require(_0xd60b('0x2'));var BPromise=require(_0xd60b('0x3'));var rs=require(_0xd60b('0x4'));var fs=require('fs');var Redis=require(_0xd60b('0x5'));var db=require(_0xd60b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd60b('0x7'));var config=require(_0xd60b('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11adfb,_0x13e06d,_0x3aee20){return new BPromise(function(_0x3a0040,_0x15f4ad){return client[_0xd60b('0x9')](_0x11adfb,_0x3aee20)['then'](function(_0x4e3d32){logger[_0xd60b('0xa')](_0xd60b('0xb'),_0x13e06d,'request\x20sent');logger[_0xd60b('0xc')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x13e06d,_0xd60b('0xd'),JSON[_0xd60b('0xe')](_0x4e3d32));if(_0x4e3d32[_0xd60b('0xf')]){if(_0x4e3d32['error']['code']===0x1f4){logger[_0xd60b('0xf')](_0xd60b('0xb'),_0x13e06d,_0x4e3d32[_0xd60b('0xf')]['message']);return _0x15f4ad(_0x4e3d32[_0xd60b('0xf')][_0xd60b('0x10')]);}logger[_0xd60b('0xf')](_0xd60b('0xb'),_0x13e06d,_0x4e3d32[_0xd60b('0xf')][_0xd60b('0x10')]);return _0x3a0040(_0x4e3d32[_0xd60b('0xf')][_0xd60b('0x10')]);}else{logger[_0xd60b('0xa')](_0xd60b('0xb'),_0x13e06d,_0xd60b('0xd'));_0x3a0040(_0x4e3d32[_0xd60b('0x11')][_0xd60b('0x10')]);}})[_0xd60b('0x12')](function(_0x281d7c){logger[_0xd60b('0xf')](_0xd60b('0xb'),_0x13e06d,_0x281d7c);_0x15f4ad(_0x281d7c);});});}exports[_0xd60b('0x13')]=function(_0x8a3ec0){var _0x1eb008=this;return new Promise(function(_0x1e6053,_0x21eda0){return db[_0xd60b('0x14')][_0xd60b('0x15')]({'raw':_0x8a3ec0['options']?_0x8a3ec0['options'][_0xd60b('0x16')]===undefined?!![]:![]:!![],'where':_0x8a3ec0['options']?_0x8a3ec0[_0xd60b('0x17')][_0xd60b('0x18')]||null:null,'attributes':_0x8a3ec0[_0xd60b('0x17')]?_0x8a3ec0[_0xd60b('0x17')][_0xd60b('0x19')]||null:null,'limit':_0x8a3ec0[_0xd60b('0x17')]?_0x8a3ec0['options'][_0xd60b('0x1a')]||null:null,'include':_0x8a3ec0['options']?_0x8a3ec0[_0xd60b('0x17')][_0xd60b('0x1b')]?_[_0xd60b('0x1c')](_0x8a3ec0[_0xd60b('0x17')][_0xd60b('0x1b')],function(_0xde98ab){return{'model':db[_0xde98ab[_0xd60b('0x1d')]],'as':_0xde98ab['as'],'attributes':_0xde98ab[_0xd60b('0x19')],'include':_0xde98ab[_0xd60b('0x1b')]?_['map'](_0xde98ab[_0xd60b('0x1b')],function(_0x1e2aa1){return{'model':db[_0x1e2aa1['model']],'as':_0x1e2aa1['as'],'attributes':_0x1e2aa1[_0xd60b('0x19')],'include':_0x1e2aa1['include']?_[_0xd60b('0x1c')](_0x1e2aa1['include'],function(_0x324a2e){return{'model':db[_0x324a2e[_0xd60b('0x1d')]],'as':_0x324a2e['as'],'attributes':_0x324a2e[_0xd60b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd60b('0x1e')](function(_0x3b2370){logger[_0xd60b('0xa')](_0xd60b('0x13'),_0x8a3ec0);logger[_0xd60b('0xc')](_0xd60b('0x13'),_0x8a3ec0,JSON[_0xd60b('0xe')](_0x3b2370));_0x1e6053(_0x3b2370);})[_0xd60b('0x12')](function(_0x5d0575){logger[_0xd60b('0xf')](_0xd60b('0x13'),_0x5d0575['message'],_0x8a3ec0);_0x21eda0(_0x1eb008['error'](0x1f4,_0x5d0575[_0xd60b('0x10')]));});});};exports['ShowSugarcrmAccount']=function(_0x21a21b){var _0x5664e8=this;return new Promise(function(_0x3719ea,_0xdc4348){return db[_0xd60b('0x14')][_0xd60b('0x1f')]({'raw':_0x21a21b[_0xd60b('0x17')]?_0x21a21b[_0xd60b('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x21a21b['options']?_0x21a21b[_0xd60b('0x17')][_0xd60b('0x18')]||null:null,'attributes':_0x21a21b[_0xd60b('0x17')]?_0x21a21b[_0xd60b('0x17')][_0xd60b('0x19')]||null:null,'include':_0x21a21b['options']?_0x21a21b[_0xd60b('0x17')]['include']?_['map'](_0x21a21b[_0xd60b('0x17')][_0xd60b('0x1b')],function(_0x20bd6b){return{'model':db[_0x20bd6b[_0xd60b('0x1d')]],'as':_0x20bd6b['as'],'attributes':_0x20bd6b['attributes'],'include':_0x20bd6b[_0xd60b('0x1b')]?_[_0xd60b('0x1c')](_0x20bd6b[_0xd60b('0x1b')],function(_0x4f348d){return{'model':db[_0x4f348d['model']],'as':_0x4f348d['as'],'attributes':_0x4f348d[_0xd60b('0x19')],'include':_0x4f348d[_0xd60b('0x1b')]?_[_0xd60b('0x1c')](_0x4f348d['include'],function(_0x2d8cf0){return{'model':db[_0x2d8cf0[_0xd60b('0x1d')]],'as':_0x2d8cf0['as'],'attributes':_0x2d8cf0[_0xd60b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd60b('0x1e')](function(_0x5dcdb5){logger[_0xd60b('0xa')](_0xd60b('0x20'),_0x21a21b);logger[_0xd60b('0xc')](_0xd60b('0x20'),_0x21a21b,JSON['stringify'](_0x5dcdb5));_0x3719ea(_0x5dcdb5);})[_0xd60b('0x12')](function(_0x5dff49){logger['error'](_0xd60b('0x20'),_0x5dff49[_0xd60b('0x10')],_0x21a21b);_0xdc4348(_0x5664e8[_0xd60b('0xf')](0x1f4,_0x5dff49[_0xd60b('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ce6bba9..60e9fd6 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 _0x5fab=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','/:id','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x266dab,_0x211142){var _0x2acc69=function(_0x33c40e){while(--_0x33c40e){_0x266dab['push'](_0x266dab['shift']());}};_0x2acc69(++_0x211142);}(_0x5fab,0x16f));var _0xb5fa=function(_0x95ac8b,_0x3706f5){_0x95ac8b=_0x95ac8b-0x0;var _0x5b0792=_0x5fab[_0x95ac8b];return _0x5b0792;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require(_0xb5fa('0x2'));var timeout=require(_0xb5fa('0x3'));var express=require(_0xb5fa('0x4'));var router=express['Router']();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb5fa('0xa')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xc')]);router['get'](_0xb5fa('0xd'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xa')](_0xb5fa('0xf'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0xa')]('/:id/descriptions',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x11')]);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router['put'](_0xb5fa('0x13'),auth['isAuthenticated'](),controller[_0xb5fa('0x14')]);router[_0xb5fa('0x15')](_0xb5fa('0x13'),auth[_0xb5fa('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf497=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy'];(function(_0x4ea911,_0x1e3ba8){var _0x5db975=function(_0x4bf693){while(--_0x4bf693){_0x4ea911['push'](_0x4ea911['shift']());}};_0x5db975(++_0x1e3ba8);}(_0xf497,0x97));var _0x7f49=function(_0x27a9be,_0x2afa06){_0x27a9be=_0x27a9be-0x0;var _0x365c49=_0xf497[_0x27a9be];return _0x365c49;};'use strict';var multer=require(_0x7f49('0x0'));var util=require(_0x7f49('0x1'));var path=require(_0x7f49('0x2'));var timeout=require(_0x7f49('0x3'));var express=require(_0x7f49('0x4'));var router=express[_0x7f49('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7f49('0x6'));var interaction=require(_0x7f49('0x7'));var config=require(_0x7f49('0x8'));var controller=require(_0x7f49('0x9'));router[_0x7f49('0xa')]('/',auth[_0x7f49('0xb')](),controller['index']);router[_0x7f49('0xa')]('/:id',auth[_0x7f49('0xb')](),controller[_0x7f49('0xc')]);router['get'](_0x7f49('0xd'),auth[_0x7f49('0xb')](),controller[_0x7f49('0xe')]);router[_0x7f49('0xa')]('/:id/subjects',auth[_0x7f49('0xb')](),controller[_0x7f49('0xf')]);router[_0x7f49('0xa')](_0x7f49('0x10'),auth[_0x7f49('0xb')](),controller[_0x7f49('0x11')]);router[_0x7f49('0x12')]('/',auth[_0x7f49('0xb')](),controller['create']);router[_0x7f49('0x13')](_0x7f49('0x14'),auth['isAuthenticated'](),controller[_0x7f49('0x15')]);router[_0x7f49('0x16')](_0x7f49('0x14'),auth[_0x7f49('0xb')](),controller[_0x7f49('0x17')]);module[_0x7f49('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 2780e96..e1aae5c 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 _0x84ab=['exports','STRING','sequelize'];(function(_0x1514b4,_0x150b75){var _0x432431=function(_0xd7f2f7){while(--_0xd7f2f7){_0x1514b4['push'](_0x1514b4['shift']());}};_0x432431(++_0x150b75);}(_0x84ab,0xdd));var _0xb84a=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0x84ab[_0x57b432];return _0x2edf2a;};'use strict';var Sequelize=require(_0xb84a('0x0'));module[_0xb84a('0x1')]={'name':{'type':Sequelize[_0xb84a('0x2')]},'description':{'type':Sequelize[_0xb84a('0x2')]}}; \ No newline at end of file +var _0xa224=['sequelize','exports','STRING'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0xa224,0xfc));var _0x4a22=function(_0x5c4942,_0x1b85cf){_0x5c4942=_0x5c4942-0x0;var _0xd57bdb=_0xa224[_0x5c4942];return _0xd57bdb;};'use strict';var Sequelize=require(_0x4a22('0x0'));module[_0x4a22('0x1')]={'name':{'type':Sequelize[_0x4a22('0x2')]},'description':{'type':Sequelize[_0x4a22('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index ca9cb1c..255d86a 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 _0x9085=['merge','then','includeAll','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','options','hasOwnProperty','SugarcrmField','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','end','send','index','SugarcrmConfiguration','rawAttributes','fieldName','model','map','name','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9085,0x14b));var _0x5908=function(_0x3e618a,_0x135251){_0x3e618a=_0x3e618a-0x0;var _0x1f3d61=_0x9085[_0x3e618a];return _0x1f3d61;};'use strict';var emlformat=require(_0x5908('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5908('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5908('0x2'));var moment=require('moment');var BPromise=require(_0x5908('0x3'));var Mustache=require('mustache');var util=require(_0x5908('0x4'));var path=require(_0x5908('0x5'));var sox=require(_0x5908('0x6'));var csv=require(_0x5908('0x7'));var ejs=require(_0x5908('0x8'));var fs=require('fs');var fs_extra=require(_0x5908('0x9'));var _=require(_0x5908('0xa'));var squel=require(_0x5908('0xb'));var crypto=require('crypto');var jsforce=require(_0x5908('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5908('0x7'));var querystring=require(_0x5908('0xd'));var Papa=require(_0x5908('0xe'));var Redis=require('ioredis');var authService=require(_0x5908('0xf'));var qs=require(_0x5908('0x10'));var as=require(_0x5908('0x11'));var hardwareService=require(_0x5908('0x12'));var logger=require(_0x5908('0x13'))(_0x5908('0x14'));var utils=require(_0x5908('0x15'));var config=require(_0x5908('0x16'));var licenseUtil=require(_0x5908('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ebb92,_0x86f898){_0x86f898=_0x86f898||0xcc;return function(_0x7af54d){if(_0x7af54d){return _0x1ebb92[_0x5908('0x18')](_0x86f898);}return _0x1ebb92[_0x5908('0x19')](_0x86f898)['end']();};}function respondWithResult(_0x2ec371,_0x15618b){_0x15618b=_0x15618b||0xc8;return function(_0x3ee9de){if(_0x3ee9de){return _0x2ec371[_0x5908('0x19')](_0x15618b)[_0x5908('0x1a')](_0x3ee9de);}};}function respondWithFilteredResult(_0x2508a4,_0x4bb144){return function(_0x3d732e){if(_0x3d732e){var _0x2663e2=typeof _0x4bb144[_0x5908('0x1b')]===_0x5908('0x1c')&&typeof _0x4bb144[_0x5908('0x1d')]===_0x5908('0x1c');var _0x42f381=_0x3d732e[_0x5908('0x1e')];var _0x3bae0d=_0x2663e2?0x0:_0x4bb144[_0x5908('0x1b')];var _0x5d40e8=_0x2663e2?_0x3d732e['count']:_0x4bb144[_0x5908('0x1b')]+_0x4bb144[_0x5908('0x1d')];var _0x2e08e3;if(_0x5d40e8>=_0x42f381){_0x5d40e8=_0x42f381;_0x2e08e3=0xc8;}else{_0x2e08e3=0xce;}_0x2508a4['status'](_0x2e08e3);return _0x2508a4[_0x5908('0x1f')]('Content-Range',_0x3bae0d+'-'+_0x5d40e8+'/'+_0x42f381)[_0x5908('0x1a')](_0x3d732e);}return null;};}function patchUpdates(_0x22d653){return function(_0x592d18){try{jsonpatch[_0x5908('0x20')](_0x592d18,_0x22d653,!![]);}catch(_0x10cade){return BPromise[_0x5908('0x21')](_0x10cade);}return _0x592d18[_0x5908('0x22')]();};}function saveUpdates(_0x2a98f5,_0x41f521){return function(_0x5cc4a8){if(_0x5cc4a8){return _0x5cc4a8[_0x5908('0x23')](_0x2a98f5)['then'](function(_0x2e50d4){return _0x2e50d4;});}return null;};}function removeEntity(_0x390482,_0xe2548e){return function(_0x3439e3){if(_0x3439e3){return _0x3439e3[_0x5908('0x24')]()['then'](function(){_0x390482[_0x5908('0x19')](0xcc)[_0x5908('0x25')]();});}};}function handleEntityNotFound(_0x538f67,_0x59ea8e){return function(_0x18ba88){if(!_0x18ba88){_0x538f67[_0x5908('0x18')](0x194);}return _0x18ba88;};}function handleError(_0x41aade,_0x4f2a7f){_0x4f2a7f=_0x4f2a7f||0x1f4;return function(_0x22c204){logger['error'](_0x22c204['stack']);if(_0x22c204['name']){delete _0x22c204['name'];}_0x41aade[_0x5908('0x19')](_0x4f2a7f)[_0x5908('0x26')](_0x22c204);};}exports[_0x5908('0x27')]=function(_0x552057,_0x1c2687){var _0xf7b622={},_0x3b49b1={},_0x33cdf1={'count':0x0,'rows':[]};var _0x3fad7a=_['map'](db[_0x5908('0x28')][_0x5908('0x29')],function(_0x2f1a1b){return{'name':_0x2f1a1b[_0x5908('0x2a')],'type':_0x2f1a1b['type']['key']};});_0x3b49b1[_0x5908('0x2b')]=_[_0x5908('0x2c')](_0x3fad7a,_0x5908('0x2d'));_0x3b49b1[_0x5908('0x2e')]=_['keys'](_0x552057[_0x5908('0x2e')]);_0x3b49b1[_0x5908('0x2f')]=_[_0x5908('0x30')](_0x3b49b1['model'],_0x3b49b1[_0x5908('0x2e')]);_0xf7b622[_0x5908('0x31')]=_[_0x5908('0x30')](_0x3b49b1[_0x5908('0x2b')],qs[_0x5908('0x32')](_0x552057[_0x5908('0x2e')][_0x5908('0x32')]));_0xf7b622[_0x5908('0x31')]=_0xf7b622[_0x5908('0x31')][_0x5908('0x33')]?_0xf7b622[_0x5908('0x31')]:_0x3b49b1[_0x5908('0x2b')];if(!_0x552057[_0x5908('0x2e')]['hasOwnProperty'](_0x5908('0x34'))){_0xf7b622[_0x5908('0x1d')]=qs[_0x5908('0x1d')](_0x552057['query']['limit']);_0xf7b622[_0x5908('0x1b')]=qs[_0x5908('0x1b')](_0x552057['query'][_0x5908('0x1b')]);}_0xf7b622[_0x5908('0x35')]=qs[_0x5908('0x36')](_0x552057[_0x5908('0x2e')][_0x5908('0x36')]);_0xf7b622[_0x5908('0x37')]=qs[_0x5908('0x2f')](_[_0x5908('0x38')](_0x552057[_0x5908('0x2e')],_0x3b49b1[_0x5908('0x2f')]),_0x3fad7a);if(_0x552057['query'][_0x5908('0x39')]){_0xf7b622[_0x5908('0x37')]=_['merge'](_0xf7b622['where'],{'$or':_[_0x5908('0x2c')](_0x3fad7a,function(_0x5d6fb4){if(_0x5d6fb4[_0x5908('0x3a')]!=='VIRTUAL'){var _0x1411ea={};_0x1411ea[_0x5d6fb4[_0x5908('0x2d')]]={'$like':'%'+_0x552057['query'][_0x5908('0x39')]+'%'};return _0x1411ea;}})});}_0xf7b622=_[_0x5908('0x3b')]({},_0xf7b622,_0x552057['options']);var _0xa69b10={'where':_0xf7b622[_0x5908('0x37')]};return db[_0x5908('0x28')][_0x5908('0x1e')](_0xa69b10)[_0x5908('0x3c')](function(_0x487c7e){_0x33cdf1[_0x5908('0x1e')]=_0x487c7e;if(_0x552057[_0x5908('0x2e')][_0x5908('0x3d')]){_0xf7b622['include']=[{'all':!![]}];}return db[_0x5908('0x28')][_0x5908('0x3e')](_0xf7b622);})['then'](function(_0x3495e0){_0x33cdf1[_0x5908('0x3f')]=_0x3495e0;return _0x33cdf1;})['then'](respondWithFilteredResult(_0x1c2687,_0xf7b622))[_0x5908('0x40')](handleError(_0x1c2687,null));};exports[_0x5908('0x41')]=function(_0x91ad83,_0x410c08){var _0xa858a8={'raw':![],'where':{'id':_0x91ad83[_0x5908('0x42')]['id']}},_0x5656eb={};_0x5656eb[_0x5908('0x2b')]=_[_0x5908('0x43')](db[_0x5908('0x28')][_0x5908('0x29')]);_0x5656eb[_0x5908('0x2e')]=_[_0x5908('0x43')](_0x91ad83[_0x5908('0x2e')]);_0x5656eb['filters']=_[_0x5908('0x30')](_0x5656eb[_0x5908('0x2b')],_0x5656eb[_0x5908('0x2e')]);_0xa858a8[_0x5908('0x31')]=_['intersection'](_0x5656eb[_0x5908('0x2b')],qs[_0x5908('0x32')](_0x91ad83[_0x5908('0x2e')][_0x5908('0x32')]));_0xa858a8[_0x5908('0x31')]=_0xa858a8[_0x5908('0x31')]['length']?_0xa858a8[_0x5908('0x31')]:_0x5656eb['model'];if(_0x91ad83[_0x5908('0x2e')][_0x5908('0x3d')]){_0xa858a8['include']=[{'all':!![]}];}_0xa858a8=_['merge']({},_0xa858a8,_0x91ad83['options']);return db[_0x5908('0x28')][_0x5908('0x44')](_0xa858a8)[_0x5908('0x3c')](handleEntityNotFound(_0x410c08,null))[_0x5908('0x3c')](respondWithResult(_0x410c08,null))[_0x5908('0x40')](handleError(_0x410c08,null));};exports['create']=function(_0x53ce4f,_0x41989e){return db['SugarcrmConfiguration'][_0x5908('0x45')](_0x53ce4f[_0x5908('0x46')],{})[_0x5908('0x3c')](respondWithResult(_0x41989e,0xc9))[_0x5908('0x40')](handleError(_0x41989e,null));};exports['update']=function(_0x1554a3,_0x5afbff){if(_0x1554a3[_0x5908('0x46')]['id']){delete _0x1554a3[_0x5908('0x46')]['id'];}return db[_0x5908('0x28')]['find']({'where':{'id':_0x1554a3[_0x5908('0x42')]['id']}})[_0x5908('0x3c')](handleEntityNotFound(_0x5afbff,null))['then'](saveUpdates(_0x1554a3[_0x5908('0x46')],null))[_0x5908('0x3c')](respondWithResult(_0x5afbff,null))[_0x5908('0x40')](handleError(_0x5afbff,null));};exports[_0x5908('0x24')]=function(_0x3b5954,_0x4fa3c8){return db['SugarcrmConfiguration'][_0x5908('0x44')]({'where':{'id':_0x3b5954['params']['id']}})[_0x5908('0x3c')](handleEntityNotFound(_0x4fa3c8,null))[_0x5908('0x3c')](removeEntity(_0x4fa3c8,null))[_0x5908('0x40')](handleError(_0x4fa3c8,null));};exports[_0x5908('0x47')]=function(_0x11c0b5,_0x5b2e60,_0x46c38e){var _0x429c90={};var _0x3df86d={};var _0x36d4e5;var _0x42d751;return db['SugarcrmConfiguration'][_0x5908('0x48')]({'where':{'id':_0x11c0b5[_0x5908('0x42')]['id']}})[_0x5908('0x3c')](handleEntityNotFound(_0x5b2e60,null))[_0x5908('0x3c')](function(_0x197d16){if(_0x197d16){_0x36d4e5=_0x197d16;_0x3df86d[_0x5908('0x2b')]=_[_0x5908('0x43')](db['SugarcrmField'][_0x5908('0x29')]);_0x3df86d[_0x5908('0x2e')]=_[_0x5908('0x43')](_0x11c0b5[_0x5908('0x2e')]);_0x3df86d[_0x5908('0x2f')]=_[_0x5908('0x30')](_0x3df86d[_0x5908('0x2b')],_0x3df86d['query']);_0x429c90['attributes']=_[_0x5908('0x30')](_0x3df86d[_0x5908('0x2b')],qs[_0x5908('0x32')](_0x11c0b5[_0x5908('0x2e')][_0x5908('0x32')]));_0x429c90[_0x5908('0x31')]=_0x429c90[_0x5908('0x31')][_0x5908('0x33')]?_0x429c90['attributes']:_0x3df86d['model'];_0x429c90[_0x5908('0x35')]=qs[_0x5908('0x36')](_0x11c0b5[_0x5908('0x2e')][_0x5908('0x36')]);_0x429c90['where']=qs[_0x5908('0x2f')](_[_0x5908('0x38')](_0x11c0b5[_0x5908('0x2e')],_0x3df86d[_0x5908('0x2f')]));if(_0x11c0b5[_0x5908('0x2e')][_0x5908('0x39')]){_0x429c90[_0x5908('0x37')]=_[_0x5908('0x3b')](_0x429c90[_0x5908('0x37')],{'$or':_['map'](_0x429c90[_0x5908('0x31')],function(_0x4fb99b){var _0x510275={};_0x510275[_0x4fb99b]={'$like':'%'+_0x11c0b5[_0x5908('0x2e')][_0x5908('0x39')]+'%'};return _0x510275;})});}_0x429c90=_[_0x5908('0x3b')]({},_0x429c90,_0x11c0b5[_0x5908('0x49')]);return _0x36d4e5[_0x5908('0x47')](_0x429c90);}})[_0x5908('0x3c')](function(_0x52c68a){if(_0x52c68a){_0x42d751=_0x52c68a[_0x5908('0x33')];if(!_0x11c0b5[_0x5908('0x2e')][_0x5908('0x4a')](_0x5908('0x34'))){_0x429c90[_0x5908('0x1d')]=qs['limit'](_0x11c0b5[_0x5908('0x2e')][_0x5908('0x1d')]);_0x429c90[_0x5908('0x1b')]=qs['offset'](_0x11c0b5['query'][_0x5908('0x1b')]);}return _0x36d4e5[_0x5908('0x47')](_0x429c90);}})[_0x5908('0x3c')](function(_0x1a758c){if(_0x1a758c){return _0x1a758c?{'count':_0x42d751,'rows':_0x1a758c}:null;}})[_0x5908('0x3c')](respondWithResult(_0x5b2e60,null))[_0x5908('0x40')](handleError(_0x5b2e60,null));};exports['getSubjects']=function(_0xb80f15,_0x19e135,_0x1156d1){var _0x185b06={};var _0x20f963={};var _0x3515c8;var _0x19d813;return db[_0x5908('0x28')][_0x5908('0x48')]({'where':{'id':_0xb80f15['params']['id']}})[_0x5908('0x3c')](handleEntityNotFound(_0x19e135,null))['then'](function(_0xd21ce7){if(_0xd21ce7){_0x3515c8=_0xd21ce7;_0x20f963['model']=_[_0x5908('0x43')](db[_0x5908('0x4b')][_0x5908('0x29')]);_0x20f963[_0x5908('0x2e')]=_[_0x5908('0x43')](_0xb80f15['query']);_0x20f963[_0x5908('0x2f')]=_[_0x5908('0x30')](_0x20f963[_0x5908('0x2b')],_0x20f963[_0x5908('0x2e')]);_0x185b06[_0x5908('0x31')]=_['intersection'](_0x20f963['model'],qs[_0x5908('0x32')](_0xb80f15[_0x5908('0x2e')][_0x5908('0x32')]));_0x185b06[_0x5908('0x31')]=_0x185b06[_0x5908('0x31')][_0x5908('0x33')]?_0x185b06[_0x5908('0x31')]:_0x20f963[_0x5908('0x2b')];_0x185b06[_0x5908('0x35')]=qs[_0x5908('0x36')](_0xb80f15['query'][_0x5908('0x36')]);_0x185b06[_0x5908('0x37')]=qs['filters'](_[_0x5908('0x38')](_0xb80f15[_0x5908('0x2e')],_0x20f963['filters']));if(_0xb80f15[_0x5908('0x2e')][_0x5908('0x39')]){_0x185b06[_0x5908('0x37')]=_['merge'](_0x185b06[_0x5908('0x37')],{'$or':_[_0x5908('0x2c')](_0x185b06[_0x5908('0x31')],function(_0x11b370){var _0x2c9b0e={};_0x2c9b0e[_0x11b370]={'$like':'%'+_0xb80f15[_0x5908('0x2e')][_0x5908('0x39')]+'%'};return _0x2c9b0e;})});}_0x185b06=_[_0x5908('0x3b')]({},_0x185b06,_0xb80f15[_0x5908('0x49')]);return _0x3515c8[_0x5908('0x4c')](_0x185b06);}})[_0x5908('0x3c')](function(_0x3cc1c0){if(_0x3cc1c0){_0x19d813=_0x3cc1c0[_0x5908('0x33')];if(!_0xb80f15[_0x5908('0x2e')][_0x5908('0x4a')](_0x5908('0x34'))){_0x185b06[_0x5908('0x1d')]=qs[_0x5908('0x1d')](_0xb80f15[_0x5908('0x2e')][_0x5908('0x1d')]);_0x185b06[_0x5908('0x1b')]=qs['offset'](_0xb80f15[_0x5908('0x2e')]['offset']);}return _0x3515c8['getSubjects'](_0x185b06);}})[_0x5908('0x3c')](function(_0x1dd155){if(_0x1dd155){return _0x1dd155?{'count':_0x19d813,'rows':_0x1dd155}:null;}})[_0x5908('0x3c')](respondWithResult(_0x19e135,null))['catch'](handleError(_0x19e135,null));};exports[_0x5908('0x4d')]=function(_0x4ee517,_0x5e2ade,_0x3cfa3c){var _0x1b1612={};var _0x835636={};var _0x4353b1;var _0xf2ed5;return db[_0x5908('0x28')]['findOne']({'where':{'id':_0x4ee517['params']['id']}})['then'](handleEntityNotFound(_0x5e2ade,null))[_0x5908('0x3c')](function(_0x15f13c){if(_0x15f13c){_0x4353b1=_0x15f13c;_0x835636[_0x5908('0x2b')]=_['keys'](db[_0x5908('0x4b')]['rawAttributes']);_0x835636[_0x5908('0x2e')]=_[_0x5908('0x43')](_0x4ee517[_0x5908('0x2e')]);_0x835636[_0x5908('0x2f')]=_['intersection'](_0x835636[_0x5908('0x2b')],_0x835636[_0x5908('0x2e')]);_0x1b1612[_0x5908('0x31')]=_[_0x5908('0x30')](_0x835636[_0x5908('0x2b')],qs[_0x5908('0x32')](_0x4ee517[_0x5908('0x2e')]['fields']));_0x1b1612[_0x5908('0x31')]=_0x1b1612[_0x5908('0x31')][_0x5908('0x33')]?_0x1b1612[_0x5908('0x31')]:_0x835636[_0x5908('0x2b')];_0x1b1612[_0x5908('0x35')]=qs[_0x5908('0x36')](_0x4ee517[_0x5908('0x2e')][_0x5908('0x36')]);_0x1b1612[_0x5908('0x37')]=qs[_0x5908('0x2f')](_['pick'](_0x4ee517[_0x5908('0x2e')],_0x835636[_0x5908('0x2f')]));if(_0x4ee517[_0x5908('0x2e')][_0x5908('0x39')]){_0x1b1612[_0x5908('0x37')]=_['merge'](_0x1b1612[_0x5908('0x37')],{'$or':_[_0x5908('0x2c')](_0x1b1612[_0x5908('0x31')],function(_0x4c1133){var _0x65b770={};_0x65b770[_0x4c1133]={'$like':'%'+_0x4ee517[_0x5908('0x2e')][_0x5908('0x39')]+'%'};return _0x65b770;})});}_0x1b1612=_[_0x5908('0x3b')]({},_0x1b1612,_0x4ee517[_0x5908('0x49')]);return _0x4353b1[_0x5908('0x4d')](_0x1b1612);}})[_0x5908('0x3c')](function(_0x462a1b){if(_0x462a1b){_0xf2ed5=_0x462a1b['length'];if(!_0x4ee517['query'][_0x5908('0x4a')](_0x5908('0x34'))){_0x1b1612[_0x5908('0x1d')]=qs[_0x5908('0x1d')](_0x4ee517['query']['limit']);_0x1b1612[_0x5908('0x1b')]=qs[_0x5908('0x1b')](_0x4ee517['query'][_0x5908('0x1b')]);}return _0x4353b1[_0x5908('0x4d')](_0x1b1612);}})['then'](function(_0x394e2b){if(_0x394e2b){return _0x394e2b?{'count':_0xf2ed5,'rows':_0x394e2b}:null;}})[_0x5908('0x3c')](respondWithResult(_0x5e2ade,null))[_0x5908('0x40')](handleError(_0x5e2ade,null));}; \ No newline at end of file +var _0x7ce3=['type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','SugarcrmField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','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','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x5f3472,_0x504db9){var _0x8636da=function(_0x459a4d){while(--_0x459a4d){_0x5f3472['push'](_0x5f3472['shift']());}};_0x8636da(++_0x504db9);}(_0x7ce3,0x10f));var _0x37ce=function(_0x264aac,_0x4ffc6c){_0x264aac=_0x264aac-0x0;var _0xd1c2c6=_0x7ce3[_0x264aac];return _0xd1c2c6;};'use strict';var emlformat=require(_0x37ce('0x0'));var rimraf=require(_0x37ce('0x1'));var zipdir=require(_0x37ce('0x2'));var jsonpatch=require(_0x37ce('0x3'));var rp=require('request-promise');var moment=require(_0x37ce('0x4'));var BPromise=require(_0x37ce('0x5'));var Mustache=require(_0x37ce('0x6'));var util=require('util');var path=require('path');var sox=require(_0x37ce('0x7'));var csv=require(_0x37ce('0x8'));var ejs=require(_0x37ce('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37ce('0xa'));var squel=require('squel');var crypto=require(_0x37ce('0xb'));var jsforce=require(_0x37ce('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x37ce('0x8'));var querystring=require(_0x37ce('0xd'));var Papa=require(_0x37ce('0xe'));var Redis=require(_0x37ce('0xf'));var authService=require(_0x37ce('0x10'));var qs=require(_0x37ce('0x11'));var as=require(_0x37ce('0x12'));var hardwareService=require(_0x37ce('0x13'));var logger=require(_0x37ce('0x14'))(_0x37ce('0x15'));var utils=require(_0x37ce('0x16'));var config=require(_0x37ce('0x17'));var licenseUtil=require(_0x37ce('0x18'));var db=require(_0x37ce('0x19'))['db'];function respondWithStatusCode(_0x559d0b,_0x4de445){_0x4de445=_0x4de445||0xcc;return function(_0x1997e3){if(_0x1997e3){return _0x559d0b[_0x37ce('0x1a')](_0x4de445);}return _0x559d0b[_0x37ce('0x1b')](_0x4de445)[_0x37ce('0x1c')]();};}function respondWithResult(_0x41dc2f,_0x815b19){_0x815b19=_0x815b19||0xc8;return function(_0xc15efe){if(_0xc15efe){return _0x41dc2f[_0x37ce('0x1b')](_0x815b19)[_0x37ce('0x1d')](_0xc15efe);}};}function respondWithFilteredResult(_0x4fdb06,_0x42779d){return function(_0x188525){if(_0x188525){var _0x31103f=typeof _0x42779d['offset']==='undefined'&&typeof _0x42779d[_0x37ce('0x1e')]===_0x37ce('0x1f');var _0x1399b0=_0x188525['count'];var _0x11fa13=_0x31103f?0x0:_0x42779d[_0x37ce('0x20')];var _0x93e891=_0x31103f?_0x188525[_0x37ce('0x21')]:_0x42779d['offset']+_0x42779d[_0x37ce('0x1e')];var _0x3dc356;if(_0x93e891>=_0x1399b0){_0x93e891=_0x1399b0;_0x3dc356=0xc8;}else{_0x3dc356=0xce;}_0x4fdb06[_0x37ce('0x1b')](_0x3dc356);return _0x4fdb06[_0x37ce('0x22')](_0x37ce('0x23'),_0x11fa13+'-'+_0x93e891+'/'+_0x1399b0)[_0x37ce('0x1d')](_0x188525);}return null;};}function patchUpdates(_0x36d019){return function(_0x45d5d1){try{jsonpatch[_0x37ce('0x24')](_0x45d5d1,_0x36d019,!![]);}catch(_0x2fab9f){return BPromise[_0x37ce('0x25')](_0x2fab9f);}return _0x45d5d1[_0x37ce('0x26')]();};}function saveUpdates(_0x2783f2,_0x10b148){return function(_0x267a8d){if(_0x267a8d){return _0x267a8d[_0x37ce('0x27')](_0x2783f2)['then'](function(_0x47a5c6){return _0x47a5c6;});}return null;};}function removeEntity(_0x27e76a,_0x1f294b){return function(_0x5b1361){if(_0x5b1361){return _0x5b1361[_0x37ce('0x28')]()[_0x37ce('0x29')](function(){_0x27e76a[_0x37ce('0x1b')](0xcc)[_0x37ce('0x1c')]();});}};}function handleEntityNotFound(_0x4d6e33,_0x4b7b4d){return function(_0x23dc03){if(!_0x23dc03){_0x4d6e33[_0x37ce('0x1a')](0x194);}return _0x23dc03;};}function handleError(_0x380f63,_0x4589ac){_0x4589ac=_0x4589ac||0x1f4;return function(_0x59d2ac){logger[_0x37ce('0x2a')](_0x59d2ac['stack']);if(_0x59d2ac[_0x37ce('0x2b')]){delete _0x59d2ac[_0x37ce('0x2b')];}_0x380f63[_0x37ce('0x1b')](_0x4589ac)[_0x37ce('0x2c')](_0x59d2ac);};}exports[_0x37ce('0x2d')]=function(_0x41a129,_0x12a3de){var _0x22561f={},_0x563e24={},_0x455c2c={'count':0x0,'rows':[]};var _0x189b72=_[_0x37ce('0x2e')](db[_0x37ce('0x2f')][_0x37ce('0x30')],function(_0x38de6c){return{'name':_0x38de6c['fieldName'],'type':_0x38de6c['type'][_0x37ce('0x31')]};});_0x563e24['model']=_[_0x37ce('0x2e')](_0x189b72,_0x37ce('0x2b'));_0x563e24[_0x37ce('0x32')]=_[_0x37ce('0x33')](_0x41a129[_0x37ce('0x32')]);_0x563e24[_0x37ce('0x34')]=_[_0x37ce('0x35')](_0x563e24['model'],_0x563e24[_0x37ce('0x32')]);_0x22561f[_0x37ce('0x36')]=_[_0x37ce('0x35')](_0x563e24[_0x37ce('0x37')],qs[_0x37ce('0x38')](_0x41a129[_0x37ce('0x32')][_0x37ce('0x38')]));_0x22561f[_0x37ce('0x36')]=_0x22561f[_0x37ce('0x36')][_0x37ce('0x39')]?_0x22561f[_0x37ce('0x36')]:_0x563e24['model'];if(!_0x41a129['query']['hasOwnProperty'](_0x37ce('0x3a'))){_0x22561f[_0x37ce('0x1e')]=qs[_0x37ce('0x1e')](_0x41a129[_0x37ce('0x32')][_0x37ce('0x1e')]);_0x22561f[_0x37ce('0x20')]=qs[_0x37ce('0x20')](_0x41a129[_0x37ce('0x32')]['offset']);}_0x22561f[_0x37ce('0x3b')]=qs[_0x37ce('0x3c')](_0x41a129[_0x37ce('0x32')]['sort']);_0x22561f[_0x37ce('0x3d')]=qs[_0x37ce('0x34')](_[_0x37ce('0x3e')](_0x41a129[_0x37ce('0x32')],_0x563e24['filters']),_0x189b72);if(_0x41a129[_0x37ce('0x32')][_0x37ce('0x3f')]){_0x22561f[_0x37ce('0x3d')]=_[_0x37ce('0x40')](_0x22561f[_0x37ce('0x3d')],{'$or':_['map'](_0x189b72,function(_0x367bf3){if(_0x367bf3[_0x37ce('0x41')]!==_0x37ce('0x42')){var _0x177803={};_0x177803[_0x367bf3[_0x37ce('0x2b')]]={'$like':'%'+_0x41a129[_0x37ce('0x32')]['filter']+'%'};return _0x177803;}})});}_0x22561f=_[_0x37ce('0x40')]({},_0x22561f,_0x41a129['options']);var _0x53f1c5={'where':_0x22561f['where']};return db[_0x37ce('0x2f')][_0x37ce('0x21')](_0x53f1c5)[_0x37ce('0x29')](function(_0x596489){_0x455c2c['count']=_0x596489;if(_0x41a129[_0x37ce('0x32')][_0x37ce('0x43')]){_0x22561f[_0x37ce('0x44')]=[{'all':!![]}];}return db[_0x37ce('0x2f')][_0x37ce('0x45')](_0x22561f);})[_0x37ce('0x29')](function(_0x23f825){_0x455c2c[_0x37ce('0x46')]=_0x23f825;return _0x455c2c;})[_0x37ce('0x29')](respondWithFilteredResult(_0x12a3de,_0x22561f))[_0x37ce('0x47')](handleError(_0x12a3de,null));};exports[_0x37ce('0x48')]=function(_0x11e90d,_0x10d00d){var _0x1bd2fd={'raw':![],'where':{'id':_0x11e90d[_0x37ce('0x49')]['id']}},_0x42fec8={};_0x42fec8[_0x37ce('0x37')]=_[_0x37ce('0x33')](db[_0x37ce('0x2f')]['rawAttributes']);_0x42fec8['query']=_[_0x37ce('0x33')](_0x11e90d[_0x37ce('0x32')]);_0x42fec8['filters']=_[_0x37ce('0x35')](_0x42fec8[_0x37ce('0x37')],_0x42fec8[_0x37ce('0x32')]);_0x1bd2fd['attributes']=_[_0x37ce('0x35')](_0x42fec8['model'],qs[_0x37ce('0x38')](_0x11e90d[_0x37ce('0x32')][_0x37ce('0x38')]));_0x1bd2fd[_0x37ce('0x36')]=_0x1bd2fd[_0x37ce('0x36')][_0x37ce('0x39')]?_0x1bd2fd['attributes']:_0x42fec8[_0x37ce('0x37')];if(_0x11e90d[_0x37ce('0x32')][_0x37ce('0x43')]){_0x1bd2fd['include']=[{'all':!![]}];}_0x1bd2fd=_[_0x37ce('0x40')]({},_0x1bd2fd,_0x11e90d[_0x37ce('0x4a')]);return db[_0x37ce('0x2f')][_0x37ce('0x4b')](_0x1bd2fd)[_0x37ce('0x29')](handleEntityNotFound(_0x10d00d,null))[_0x37ce('0x29')](respondWithResult(_0x10d00d,null))[_0x37ce('0x47')](handleError(_0x10d00d,null));};exports['create']=function(_0x137064,_0x5b5352){return db['SugarcrmConfiguration'][_0x37ce('0x4c')](_0x137064[_0x37ce('0x4d')],{})[_0x37ce('0x29')](respondWithResult(_0x5b5352,0xc9))[_0x37ce('0x47')](handleError(_0x5b5352,null));};exports[_0x37ce('0x27')]=function(_0x5a0948,_0x2732d3){if(_0x5a0948[_0x37ce('0x4d')]['id']){delete _0x5a0948[_0x37ce('0x4d')]['id'];}return db[_0x37ce('0x2f')][_0x37ce('0x4b')]({'where':{'id':_0x5a0948[_0x37ce('0x49')]['id']}})[_0x37ce('0x29')](handleEntityNotFound(_0x2732d3,null))['then'](saveUpdates(_0x5a0948[_0x37ce('0x4d')],null))['then'](respondWithResult(_0x2732d3,null))[_0x37ce('0x47')](handleError(_0x2732d3,null));};exports[_0x37ce('0x28')]=function(_0x2d8722,_0x348620){return db['SugarcrmConfiguration'][_0x37ce('0x4b')]({'where':{'id':_0x2d8722['params']['id']}})[_0x37ce('0x29')](handleEntityNotFound(_0x348620,null))['then'](removeEntity(_0x348620,null))[_0x37ce('0x47')](handleError(_0x348620,null));};exports[_0x37ce('0x4e')]=function(_0x2708dd,_0x419888,_0xdf0172){var _0x4bf80d={};var _0x3da18d={};var _0x8a11b5;var _0x22cba0;return db[_0x37ce('0x2f')][_0x37ce('0x4f')]({'where':{'id':_0x2708dd[_0x37ce('0x49')]['id']}})['then'](handleEntityNotFound(_0x419888,null))[_0x37ce('0x29')](function(_0x58cb08){if(_0x58cb08){_0x8a11b5=_0x58cb08;_0x3da18d[_0x37ce('0x37')]=_[_0x37ce('0x33')](db[_0x37ce('0x50')][_0x37ce('0x30')]);_0x3da18d[_0x37ce('0x32')]=_['keys'](_0x2708dd[_0x37ce('0x32')]);_0x3da18d['filters']=_[_0x37ce('0x35')](_0x3da18d['model'],_0x3da18d['query']);_0x4bf80d[_0x37ce('0x36')]=_[_0x37ce('0x35')](_0x3da18d[_0x37ce('0x37')],qs[_0x37ce('0x38')](_0x2708dd[_0x37ce('0x32')][_0x37ce('0x38')]));_0x4bf80d[_0x37ce('0x36')]=_0x4bf80d[_0x37ce('0x36')][_0x37ce('0x39')]?_0x4bf80d[_0x37ce('0x36')]:_0x3da18d[_0x37ce('0x37')];_0x4bf80d[_0x37ce('0x3b')]=qs['sort'](_0x2708dd['query']['sort']);_0x4bf80d[_0x37ce('0x3d')]=qs['filters'](_[_0x37ce('0x3e')](_0x2708dd[_0x37ce('0x32')],_0x3da18d['filters']));if(_0x2708dd['query'][_0x37ce('0x3f')]){_0x4bf80d[_0x37ce('0x3d')]=_['merge'](_0x4bf80d['where'],{'$or':_[_0x37ce('0x2e')](_0x4bf80d[_0x37ce('0x36')],function(_0x40d0bd){var _0x309ccd={};_0x309ccd[_0x40d0bd]={'$like':'%'+_0x2708dd['query'][_0x37ce('0x3f')]+'%'};return _0x309ccd;})});}_0x4bf80d=_[_0x37ce('0x40')]({},_0x4bf80d,_0x2708dd[_0x37ce('0x4a')]);return _0x8a11b5[_0x37ce('0x4e')](_0x4bf80d);}})[_0x37ce('0x29')](function(_0xdde83b){if(_0xdde83b){_0x22cba0=_0xdde83b[_0x37ce('0x39')];if(!_0x2708dd[_0x37ce('0x32')][_0x37ce('0x51')](_0x37ce('0x3a'))){_0x4bf80d['limit']=qs[_0x37ce('0x1e')](_0x2708dd[_0x37ce('0x32')][_0x37ce('0x1e')]);_0x4bf80d[_0x37ce('0x20')]=qs[_0x37ce('0x20')](_0x2708dd[_0x37ce('0x32')][_0x37ce('0x20')]);}return _0x8a11b5['getFields'](_0x4bf80d);}})[_0x37ce('0x29')](function(_0x5bee92){if(_0x5bee92){return _0x5bee92?{'count':_0x22cba0,'rows':_0x5bee92}:null;}})['then'](respondWithResult(_0x419888,null))[_0x37ce('0x47')](handleError(_0x419888,null));};exports[_0x37ce('0x52')]=function(_0x1b4255,_0x57551c,_0x4aaf6b){var _0x689bc0={};var _0x2743f6={};var _0x2ef4b0;var _0x37b37a;return db[_0x37ce('0x2f')][_0x37ce('0x4f')]({'where':{'id':_0x1b4255[_0x37ce('0x49')]['id']}})['then'](handleEntityNotFound(_0x57551c,null))[_0x37ce('0x29')](function(_0x27a257){if(_0x27a257){_0x2ef4b0=_0x27a257;_0x2743f6['model']=_['keys'](db[_0x37ce('0x50')][_0x37ce('0x30')]);_0x2743f6[_0x37ce('0x32')]=_['keys'](_0x1b4255[_0x37ce('0x32')]);_0x2743f6[_0x37ce('0x34')]=_[_0x37ce('0x35')](_0x2743f6['model'],_0x2743f6[_0x37ce('0x32')]);_0x689bc0['attributes']=_['intersection'](_0x2743f6['model'],qs['fields'](_0x1b4255['query'][_0x37ce('0x38')]));_0x689bc0[_0x37ce('0x36')]=_0x689bc0['attributes'][_0x37ce('0x39')]?_0x689bc0[_0x37ce('0x36')]:_0x2743f6[_0x37ce('0x37')];_0x689bc0[_0x37ce('0x3b')]=qs[_0x37ce('0x3c')](_0x1b4255[_0x37ce('0x32')][_0x37ce('0x3c')]);_0x689bc0['where']=qs[_0x37ce('0x34')](_['pick'](_0x1b4255[_0x37ce('0x32')],_0x2743f6['filters']));if(_0x1b4255['query'][_0x37ce('0x3f')]){_0x689bc0['where']=_['merge'](_0x689bc0[_0x37ce('0x3d')],{'$or':_[_0x37ce('0x2e')](_0x689bc0['attributes'],function(_0x3e97e3){var _0x4e86ca={};_0x4e86ca[_0x3e97e3]={'$like':'%'+_0x1b4255['query'][_0x37ce('0x3f')]+'%'};return _0x4e86ca;})});}_0x689bc0=_['merge']({},_0x689bc0,_0x1b4255[_0x37ce('0x4a')]);return _0x2ef4b0[_0x37ce('0x52')](_0x689bc0);}})[_0x37ce('0x29')](function(_0x9b8017){if(_0x9b8017){_0x37b37a=_0x9b8017[_0x37ce('0x39')];if(!_0x1b4255[_0x37ce('0x32')]['hasOwnProperty'](_0x37ce('0x3a'))){_0x689bc0[_0x37ce('0x1e')]=qs[_0x37ce('0x1e')](_0x1b4255['query']['limit']);_0x689bc0['offset']=qs[_0x37ce('0x20')](_0x1b4255[_0x37ce('0x32')][_0x37ce('0x20')]);}return _0x2ef4b0[_0x37ce('0x52')](_0x689bc0);}})[_0x37ce('0x29')](function(_0x391c85){if(_0x391c85){return _0x391c85?{'count':_0x37b37a,'rows':_0x391c85}:null;}})[_0x37ce('0x29')](respondWithResult(_0x57551c,null))[_0x37ce('0x47')](handleError(_0x57551c,null));};exports[_0x37ce('0x53')]=function(_0x103f11,_0x1d2a0b,_0x212190){var _0x2afcbf={};var _0x299f69={};var _0x4dbc17;var _0x15d410;return db['SugarcrmConfiguration'][_0x37ce('0x4f')]({'where':{'id':_0x103f11[_0x37ce('0x49')]['id']}})[_0x37ce('0x29')](handleEntityNotFound(_0x1d2a0b,null))['then'](function(_0x57b9d8){if(_0x57b9d8){_0x4dbc17=_0x57b9d8;_0x299f69[_0x37ce('0x37')]=_[_0x37ce('0x33')](db['SugarcrmField']['rawAttributes']);_0x299f69[_0x37ce('0x32')]=_[_0x37ce('0x33')](_0x103f11['query']);_0x299f69['filters']=_[_0x37ce('0x35')](_0x299f69[_0x37ce('0x37')],_0x299f69[_0x37ce('0x32')]);_0x2afcbf[_0x37ce('0x36')]=_[_0x37ce('0x35')](_0x299f69[_0x37ce('0x37')],qs[_0x37ce('0x38')](_0x103f11[_0x37ce('0x32')][_0x37ce('0x38')]));_0x2afcbf['attributes']=_0x2afcbf[_0x37ce('0x36')][_0x37ce('0x39')]?_0x2afcbf[_0x37ce('0x36')]:_0x299f69[_0x37ce('0x37')];_0x2afcbf[_0x37ce('0x3b')]=qs[_0x37ce('0x3c')](_0x103f11[_0x37ce('0x32')][_0x37ce('0x3c')]);_0x2afcbf[_0x37ce('0x3d')]=qs[_0x37ce('0x34')](_[_0x37ce('0x3e')](_0x103f11[_0x37ce('0x32')],_0x299f69[_0x37ce('0x34')]));if(_0x103f11['query'][_0x37ce('0x3f')]){_0x2afcbf['where']=_[_0x37ce('0x40')](_0x2afcbf[_0x37ce('0x3d')],{'$or':_[_0x37ce('0x2e')](_0x2afcbf['attributes'],function(_0x125f40){var _0x1bbf91={};_0x1bbf91[_0x125f40]={'$like':'%'+_0x103f11[_0x37ce('0x32')][_0x37ce('0x3f')]+'%'};return _0x1bbf91;})});}_0x2afcbf=_[_0x37ce('0x40')]({},_0x2afcbf,_0x103f11[_0x37ce('0x4a')]);return _0x4dbc17[_0x37ce('0x53')](_0x2afcbf);}})[_0x37ce('0x29')](function(_0x1f1f9d){if(_0x1f1f9d){_0x15d410=_0x1f1f9d[_0x37ce('0x39')];if(!_0x103f11[_0x37ce('0x32')][_0x37ce('0x51')](_0x37ce('0x3a'))){_0x2afcbf['limit']=qs[_0x37ce('0x1e')](_0x103f11['query'][_0x37ce('0x1e')]);_0x2afcbf[_0x37ce('0x20')]=qs['offset'](_0x103f11[_0x37ce('0x32')]['offset']);}return _0x4dbc17[_0x37ce('0x53')](_0x2afcbf);}})[_0x37ce('0x29')](function(_0xa63174){if(_0xa63174){return _0xa63174?{'count':_0x15d410,'rows':_0xa63174}:null;}})[_0x37ce('0x29')](respondWithResult(_0x1d2a0b,null))['catch'](handleError(_0x1d2a0b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index d84eed7..d05b6db 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 _0xcd77=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','api'];(function(_0x50bfd8,_0x5af783){var _0x424ca1=function(_0x52c67b){while(--_0x52c67b){_0x50bfd8['push'](_0x50bfd8['shift']());}};_0x424ca1(++_0x5af783);}(_0xcd77,0xf4));var _0x7cd7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcd77[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7cd7('0x0'));var util=require('util');var logger=require(_0x7cd7('0x1'))(_0x7cd7('0x2'));var moment=require(_0x7cd7('0x3'));var BPromise=require(_0x7cd7('0x4'));var rp=require(_0x7cd7('0x5'));var fs=require('fs');var path=require(_0x7cd7('0x6'));var rimraf=require(_0x7cd7('0x7'));var config=require(_0x7cd7('0x8'));var attributes=require(_0x7cd7('0x9'));module['exports']=function(_0x2b5e36,_0x3422c3){return _0x2b5e36[_0x7cd7('0xa')](_0x7cd7('0xb'),attributes,{'tableName':_0x7cd7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x596b=['exports','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x2b2c5e,_0x5b4f51){var _0xbeff1e=function(_0x2e0034){while(--_0x2e0034){_0x2b2c5e['push'](_0x2b2c5e['shift']());}};_0xbeff1e(++_0x5b4f51);}(_0x596b,0xd4));var _0xb596=function(_0x3a47b3,_0x182e59){_0x3a47b3=_0x3a47b3-0x0;var _0x551551=_0x596b[_0x3a47b3];return _0x551551;};'use strict';var _=require('lodash');var util=require(_0xb596('0x0'));var logger=require(_0xb596('0x1'))(_0xb596('0x2'));var moment=require(_0xb596('0x3'));var BPromise=require('bluebird');var rp=require(_0xb596('0x4'));var fs=require('fs');var path=require(_0xb596('0x5'));var rimraf=require('rimraf');var config=require(_0xb596('0x6'));var attributes=require(_0xb596('0x7'));module[_0xb596('0x8')]=function(_0x336706,_0x1e7fa6){return _0x336706['define'](_0xb596('0x9'),attributes,{'tableName':_0xb596('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 86c324b..f588138 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 _0x7a4f=['http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x59080e,_0x2c3518){var _0x4f86a9=function(_0x43784a){while(--_0x43784a){_0x59080e['push'](_0x59080e['shift']());}};_0x4f86a9(++_0x2c3518);}(_0x7a4f,0x6e));var _0xf7a4=function(_0x46b22a,_0x5bf83a){_0x46b22a=_0x46b22a-0x0;var _0x44c2e8=_0x7a4f[_0x46b22a];return _0x44c2e8;};'use strict';var _=require(_0xf7a4('0x0'));var util=require(_0xf7a4('0x1'));var moment=require(_0xf7a4('0x2'));var BPromise=require(_0xf7a4('0x3'));var rs=require(_0xf7a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7a4('0x5'))['db'];var utils=require(_0xf7a4('0x6'));var logger=require(_0xf7a4('0x7'))(_0xf7a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf7a4('0x9')][_0xf7a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38ef6a,_0x348edc,_0x7fb76){return new BPromise(function(_0x3df6bb,_0x59e3b4){return client[_0xf7a4('0xb')](_0x38ef6a,_0x7fb76)[_0xf7a4('0xc')](function(_0x1d2954){logger[_0xf7a4('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x348edc,_0xf7a4('0xe'));logger[_0xf7a4('0xf')](_0xf7a4('0x10'),_0x348edc,'request\x20sent',JSON[_0xf7a4('0x11')](_0x1d2954));if(_0x1d2954[_0xf7a4('0x12')]){if(_0x1d2954[_0xf7a4('0x12')][_0xf7a4('0x13')]===0x1f4){logger[_0xf7a4('0x12')](_0xf7a4('0x14'),_0x348edc,_0x1d2954['error'][_0xf7a4('0x15')]);return _0x59e3b4(_0x1d2954[_0xf7a4('0x12')]['message']);}logger[_0xf7a4('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x348edc,_0x1d2954[_0xf7a4('0x12')][_0xf7a4('0x15')]);return _0x3df6bb(_0x1d2954['error'][_0xf7a4('0x15')]);}else{logger[_0xf7a4('0xd')](_0xf7a4('0x14'),_0x348edc,_0xf7a4('0xe'));_0x3df6bb(_0x1d2954[_0xf7a4('0x16')][_0xf7a4('0x15')]);}})[_0xf7a4('0x17')](function(_0x489ac1){logger[_0xf7a4('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x348edc,_0x489ac1);_0x59e3b4(_0x489ac1);});});} \ No newline at end of file +var _0x037a=['request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3492ad,_0x58c7bb){var _0x503562=function(_0x4d26f5){while(--_0x4d26f5){_0x3492ad['push'](_0x3492ad['shift']());}};_0x503562(++_0x58c7bb);}(_0x037a,0x8f));var _0xa037=function(_0x1bf29f,_0x114ad4){_0x1bf29f=_0x1bf29f-0x0;var _0x234c5e=_0x037a[_0x1bf29f];return _0x234c5e;};'use strict';var _=require(_0xa037('0x0'));var util=require(_0xa037('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa037('0x2'));var db=require(_0xa037('0x3'))['db'];var utils=require(_0xa037('0x4'));var logger=require(_0xa037('0x5'))(_0xa037('0x6'));var config=require(_0xa037('0x7'));var jayson=require(_0xa037('0x8'));var client=jayson[_0xa037('0x9')][_0xa037('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x472de9,_0x7c1a00,_0x112094){return new BPromise(function(_0x56c614,_0x27259e){return client[_0xa037('0xb')](_0x472de9,_0x112094)[_0xa037('0xc')](function(_0x59432b){logger[_0xa037('0xd')](_0xa037('0xe'),_0x7c1a00,_0xa037('0xf'));logger[_0xa037('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x7c1a00,_0xa037('0xf'),JSON[_0xa037('0x11')](_0x59432b));if(_0x59432b['error']){if(_0x59432b[_0xa037('0x12')]['code']===0x1f4){logger[_0xa037('0x12')](_0xa037('0xe'),_0x7c1a00,_0x59432b[_0xa037('0x12')][_0xa037('0x13')]);return _0x27259e(_0x59432b[_0xa037('0x12')]['message']);}logger[_0xa037('0x12')](_0xa037('0xe'),_0x7c1a00,_0x59432b[_0xa037('0x12')][_0xa037('0x13')]);return _0x56c614(_0x59432b[_0xa037('0x12')]['message']);}else{logger[_0xa037('0xd')](_0xa037('0xe'),_0x7c1a00,_0xa037('0xf'));_0x56c614(_0x59432b[_0xa037('0x14')][_0xa037('0x13')]);}})[_0xa037('0x15')](function(_0x9d642b){logger[_0xa037('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x7c1a00,_0x9d642b);_0x27259e(_0x9d642b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index fa16a81..8fb687d 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 _0x6b0e=['get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','./intSugarcrmField.controller'];(function(_0x14a8d5,_0x17b15c){var _0x3a7c52=function(_0x2c1ec7){while(--_0x2c1ec7){_0x14a8d5['push'](_0x14a8d5['shift']());}};_0x3a7c52(++_0x17b15c);}(_0x6b0e,0x1b4));var _0xe6b0=function(_0x4a624b,_0x21544a){_0x4a624b=_0x4a624b-0x0;var _0x156cba=_0x6b0e[_0x4a624b];return _0x156cba;};'use strict';var multer=require('multer');var util=require(_0xe6b0('0x0'));var path=require(_0xe6b0('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe6b0('0x2')]();var fs_extra=require(_0xe6b0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe6b0('0x4'));var config=require('../../config/environment');var controller=require(_0xe6b0('0x5'));router[_0xe6b0('0x6')]('/',auth[_0xe6b0('0x7')](),controller[_0xe6b0('0x8')]);router['get']('/:id',auth[_0xe6b0('0x7')](),controller[_0xe6b0('0x9')]);router[_0xe6b0('0xa')]('/',auth[_0xe6b0('0x7')](),controller[_0xe6b0('0xb')]);router['put'](_0xe6b0('0xc'),auth[_0xe6b0('0x7')](),controller[_0xe6b0('0xd')]);router[_0xe6b0('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe6b0('0xf')]);module[_0xe6b0('0x10')]=router; \ No newline at end of file +var _0x4685=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xecbf7a,_0x41cd6f){var _0x42feda=function(_0x2da0d1){while(--_0x2da0d1){_0xecbf7a['push'](_0xecbf7a['shift']());}};_0x42feda(++_0x41cd6f);}(_0x4685,0xdf));var _0x5468=function(_0x1105be,_0x11cd14){_0x1105be=_0x1105be-0x0;var _0x59db74=_0x4685[_0x1105be];return _0x59db74;};'use strict';var multer=require(_0x5468('0x0'));var util=require(_0x5468('0x1'));var path=require(_0x5468('0x2'));var timeout=require(_0x5468('0x3'));var express=require(_0x5468('0x4'));var router=express[_0x5468('0x5')]();var fs_extra=require(_0x5468('0x6'));var auth=require(_0x5468('0x7'));var interaction=require(_0x5468('0x8'));var config=require(_0x5468('0x9'));var controller=require(_0x5468('0xa'));router[_0x5468('0xb')]('/',auth[_0x5468('0xc')](),controller[_0x5468('0xd')]);router[_0x5468('0xb')](_0x5468('0xe'),auth[_0x5468('0xc')](),controller[_0x5468('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5468('0x10')](_0x5468('0xe'),auth['isAuthenticated'](),controller[_0x5468('0x11')]);router[_0x5468('0x12')](_0x5468('0xe'),auth[_0x5468('0xc')](),controller[_0x5468('0x13')]);module[_0x5468('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 7c894f8..f20a130 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 _0x1c0c=['string','exports','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1c0c,0xa1));var _0xc1c0=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x1c0c[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require('sequelize');module[_0xc1c0('0x0')]={'type':{'type':Sequelize[_0xc1c0('0x1')]('string',_0xc1c0('0x2'),_0xc1c0('0x3'),_0xc1c0('0x4'),_0xc1c0('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc1c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xc1c0('0x7'),_0xc1c0('0x2'),_0xc1c0('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc1c0('0x6')]},'nameField':{'type':Sequelize[_0xc1c0('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc1c0('0x6')]}}; \ No newline at end of file +var _0x8e06=['variable','customVariable','STRING','BOOLEAN','string'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8e06,0x11c));var _0x68e0=function(_0x3921a4,_0x2be82c){_0x3921a4=_0x3921a4-0x0;var _0x79fe81=_0x8e06[_0x3921a4];return _0x79fe81;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x68e0('0x0'),_0x68e0('0x1'),_0x68e0('0x2'),'keyValue','picklist'),'defaultValue':_0x68e0('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x68e0('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x68e0('0x0'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x68e0('0x3')]},'idField':{'type':Sequelize[_0x68e0('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x68e0('0x4')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 66db04c..9a13a3c 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 _0xc15e=['update','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','destroy','then','stack','name','index','SugarcrmField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body'];(function(_0x4a0879,_0xce40c){var _0x35f33e=function(_0x31280e){while(--_0x31280e){_0x4a0879['push'](_0x4a0879['shift']());}};_0x35f33e(++_0xce40c);}(_0xc15e,0x178));var _0xec15=function(_0x2ef40b,_0x118719){_0x2ef40b=_0x2ef40b-0x0;var _0x3be817=_0xc15e[_0x2ef40b];return _0x3be817;};'use strict';var emlformat=require(_0xec15('0x0'));var rimraf=require(_0xec15('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec15('0x2'));var rp=require('request-promise');var moment=require(_0xec15('0x3'));var BPromise=require(_0xec15('0x4'));var Mustache=require(_0xec15('0x5'));var util=require(_0xec15('0x6'));var path=require(_0xec15('0x7'));var sox=require(_0xec15('0x8'));var csv=require(_0xec15('0x9'));var ejs=require(_0xec15('0xa'));var fs=require('fs');var fs_extra=require(_0xec15('0xb'));var _=require(_0xec15('0xc'));var squel=require(_0xec15('0xd'));var crypto=require(_0xec15('0xe'));var jsforce=require(_0xec15('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xec15('0x9'));var querystring=require(_0xec15('0x10'));var Papa=require('papaparse');var Redis=require(_0xec15('0x11'));var authService=require(_0xec15('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xec15('0x13'));var hardwareService=require(_0xec15('0x14'));var logger=require(_0xec15('0x15'))(_0xec15('0x16'));var utils=require(_0xec15('0x17'));var config=require(_0xec15('0x18'));var licenseUtil=require(_0xec15('0x19'));var db=require(_0xec15('0x1a'))['db'];function respondWithStatusCode(_0x45ea69,_0x2bc622){_0x2bc622=_0x2bc622||0xcc;return function(_0x11f292){if(_0x11f292){return _0x45ea69[_0xec15('0x1b')](_0x2bc622);}return _0x45ea69[_0xec15('0x1c')](_0x2bc622)[_0xec15('0x1d')]();};}function respondWithResult(_0x3c6cb3,_0x2b201b){_0x2b201b=_0x2b201b||0xc8;return function(_0x333def){if(_0x333def){return _0x3c6cb3['status'](_0x2b201b)[_0xec15('0x1e')](_0x333def);}};}function respondWithFilteredResult(_0x507451,_0x25d061){return function(_0x26f099){if(_0x26f099){var _0xdb46c9=typeof _0x25d061[_0xec15('0x1f')]===_0xec15('0x20')&&typeof _0x25d061[_0xec15('0x21')]===_0xec15('0x20');var _0x7c3a2=_0x26f099[_0xec15('0x22')];var _0x4d5842=_0xdb46c9?0x0:_0x25d061[_0xec15('0x1f')];var _0xe1e646=_0xdb46c9?_0x26f099[_0xec15('0x22')]:_0x25d061[_0xec15('0x1f')]+_0x25d061[_0xec15('0x21')];var _0x2ffa9a;if(_0xe1e646>=_0x7c3a2){_0xe1e646=_0x7c3a2;_0x2ffa9a=0xc8;}else{_0x2ffa9a=0xce;}_0x507451[_0xec15('0x1c')](_0x2ffa9a);return _0x507451[_0xec15('0x23')](_0xec15('0x24'),_0x4d5842+'-'+_0xe1e646+'/'+_0x7c3a2)['json'](_0x26f099);}return null;};}function patchUpdates(_0x56f3fa){return function(_0x90d24e){try{jsonpatch['apply'](_0x90d24e,_0x56f3fa,!![]);}catch(_0x2dceab){return BPromise['reject'](_0x2dceab);}return _0x90d24e[_0xec15('0x25')]();};}function saveUpdates(_0x195bc6,_0x2925a0){return function(_0x1f74f5){if(_0x1f74f5){return _0x1f74f5['update'](_0x195bc6)['then'](function(_0x3361a7){return _0x3361a7;});}return null;};}function removeEntity(_0x3fa0ba,_0x3b39d4){return function(_0x2a847f){if(_0x2a847f){return _0x2a847f[_0xec15('0x26')]()[_0xec15('0x27')](function(){_0x3fa0ba[_0xec15('0x1c')](0xcc)[_0xec15('0x1d')]();});}};}function handleEntityNotFound(_0x1272be,_0x143d8c){return function(_0x316521){if(!_0x316521){_0x1272be['sendStatus'](0x194);}return _0x316521;};}function handleError(_0x319d39,_0x2c71a3){_0x2c71a3=_0x2c71a3||0x1f4;return function(_0x3262bc){logger['error'](_0x3262bc[_0xec15('0x28')]);if(_0x3262bc[_0xec15('0x29')]){delete _0x3262bc[_0xec15('0x29')];}_0x319d39[_0xec15('0x1c')](_0x2c71a3)['send'](_0x3262bc);};}exports[_0xec15('0x2a')]=function(_0x2229fa,_0x412301){var _0x27fc84={},_0x283211={},_0x54201d={'count':0x0,'rows':[]};var _0x1d6615=_['map'](db[_0xec15('0x2b')][_0xec15('0x2c')],function(_0x5066ea){return{'name':_0x5066ea[_0xec15('0x2d')],'type':_0x5066ea['type'][_0xec15('0x2e')]};});_0x283211[_0xec15('0x2f')]=_[_0xec15('0x30')](_0x1d6615,'name');_0x283211[_0xec15('0x31')]=_[_0xec15('0x32')](_0x2229fa[_0xec15('0x31')]);_0x283211[_0xec15('0x33')]=_[_0xec15('0x34')](_0x283211['model'],_0x283211['query']);_0x27fc84[_0xec15('0x35')]=_[_0xec15('0x34')](_0x283211[_0xec15('0x2f')],qs[_0xec15('0x36')](_0x2229fa['query'][_0xec15('0x36')]));_0x27fc84[_0xec15('0x35')]=_0x27fc84[_0xec15('0x35')][_0xec15('0x37')]?_0x27fc84[_0xec15('0x35')]:_0x283211['model'];if(!_0x2229fa[_0xec15('0x31')][_0xec15('0x38')]('nolimit')){_0x27fc84[_0xec15('0x21')]=qs[_0xec15('0x21')](_0x2229fa['query']['limit']);_0x27fc84['offset']=qs[_0xec15('0x1f')](_0x2229fa[_0xec15('0x31')][_0xec15('0x1f')]);}_0x27fc84[_0xec15('0x39')]=qs['sort'](_0x2229fa['query'][_0xec15('0x3a')]);_0x27fc84[_0xec15('0x3b')]=qs[_0xec15('0x33')](_[_0xec15('0x3c')](_0x2229fa[_0xec15('0x31')],_0x283211['filters']),_0x1d6615);if(_0x2229fa[_0xec15('0x31')]['filter']){_0x27fc84[_0xec15('0x3b')]=_[_0xec15('0x3d')](_0x27fc84['where'],{'$or':_['map'](_0x1d6615,function(_0xf562ee){if(_0xf562ee[_0xec15('0x3e')]!==_0xec15('0x3f')){var _0x3c0920={};_0x3c0920[_0xf562ee[_0xec15('0x29')]]={'$like':'%'+_0x2229fa[_0xec15('0x31')]['filter']+'%'};return _0x3c0920;}})});}_0x27fc84=_[_0xec15('0x3d')]({},_0x27fc84,_0x2229fa[_0xec15('0x40')]);var _0x26bbff={'where':_0x27fc84[_0xec15('0x3b')]};return db[_0xec15('0x2b')]['count'](_0x26bbff)[_0xec15('0x27')](function(_0x8cd863){_0x54201d['count']=_0x8cd863;if(_0x2229fa[_0xec15('0x31')][_0xec15('0x41')]){_0x27fc84[_0xec15('0x42')]=[{'all':!![]}];}return db[_0xec15('0x2b')][_0xec15('0x43')](_0x27fc84);})[_0xec15('0x27')](function(_0x45f2dd){_0x54201d['rows']=_0x45f2dd;return _0x54201d;})[_0xec15('0x27')](respondWithFilteredResult(_0x412301,_0x27fc84))[_0xec15('0x44')](handleError(_0x412301,null));};exports[_0xec15('0x45')]=function(_0x3bf00c,_0x150f25){var _0x5e383c={'raw':!![],'where':{'id':_0x3bf00c[_0xec15('0x46')]['id']}},_0x5d91b3={};_0x5d91b3['model']=_['keys'](db[_0xec15('0x2b')][_0xec15('0x2c')]);_0x5d91b3['query']=_[_0xec15('0x32')](_0x3bf00c[_0xec15('0x31')]);_0x5d91b3[_0xec15('0x33')]=_['intersection'](_0x5d91b3['model'],_0x5d91b3['query']);_0x5e383c['attributes']=_['intersection'](_0x5d91b3[_0xec15('0x2f')],qs[_0xec15('0x36')](_0x3bf00c['query'][_0xec15('0x36')]));_0x5e383c[_0xec15('0x35')]=_0x5e383c['attributes'][_0xec15('0x37')]?_0x5e383c['attributes']:_0x5d91b3[_0xec15('0x2f')];if(_0x3bf00c[_0xec15('0x31')][_0xec15('0x41')]){_0x5e383c[_0xec15('0x42')]=[{'all':!![]}];}_0x5e383c=_[_0xec15('0x3d')]({},_0x5e383c,_0x3bf00c[_0xec15('0x40')]);return db['SugarcrmField'][_0xec15('0x47')](_0x5e383c)[_0xec15('0x27')](handleEntityNotFound(_0x150f25,null))[_0xec15('0x27')](respondWithResult(_0x150f25,null))[_0xec15('0x44')](handleError(_0x150f25,null));};exports[_0xec15('0x48')]=function(_0x2b533e,_0x5b8a0e){return db['SugarcrmField'][_0xec15('0x48')](_0x2b533e[_0xec15('0x49')],{})[_0xec15('0x27')](respondWithResult(_0x5b8a0e,0xc9))[_0xec15('0x44')](handleError(_0x5b8a0e,null));};exports[_0xec15('0x4a')]=function(_0x320a62,_0x2f4e9c){if(_0x320a62[_0xec15('0x49')]['id']){delete _0x320a62[_0xec15('0x49')]['id'];}return db[_0xec15('0x2b')][_0xec15('0x47')]({'where':{'id':_0x320a62[_0xec15('0x46')]['id']}})[_0xec15('0x27')](handleEntityNotFound(_0x2f4e9c,null))[_0xec15('0x27')](saveUpdates(_0x320a62[_0xec15('0x49')],null))[_0xec15('0x27')](respondWithResult(_0x2f4e9c,null))[_0xec15('0x44')](handleError(_0x2f4e9c,null));};exports[_0xec15('0x26')]=function(_0x5433eb,_0x106a1b){return db[_0xec15('0x2b')][_0xec15('0x47')]({'where':{'id':_0x5433eb[_0xec15('0x46')]['id']}})[_0xec15('0x27')](handleEntityNotFound(_0x106a1b,null))['then'](removeEntity(_0x106a1b,null))[_0xec15('0x44')](handleError(_0x106a1b,null));}; \ No newline at end of file +var _0x3695=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','merge','create','catch','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x4d5227,_0x355eb6){var _0x4b40e8=function(_0x298dad){while(--_0x298dad){_0x4d5227['push'](_0x4d5227['shift']());}};_0x4b40e8(++_0x355eb6);}(_0x3695,0x92));var _0x5369=function(_0x47307d,_0x4bd71c){_0x47307d=_0x47307d-0x0;var _0x555f6f=_0x3695[_0x47307d];return _0x555f6f;};'use strict';var emlformat=require(_0x5369('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5369('0x1'));var jsonpatch=require(_0x5369('0x2'));var rp=require(_0x5369('0x3'));var moment=require(_0x5369('0x4'));var BPromise=require(_0x5369('0x5'));var Mustache=require(_0x5369('0x6'));var util=require(_0x5369('0x7'));var path=require(_0x5369('0x8'));var sox=require('sox');var csv=require(_0x5369('0x9'));var ejs=require(_0x5369('0xa'));var fs=require('fs');var fs_extra=require(_0x5369('0xb'));var _=require(_0x5369('0xc'));var squel=require(_0x5369('0xd'));var crypto=require(_0x5369('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5369('0xf'));var toCsv=require(_0x5369('0x9'));var querystring=require('querystring');var Papa=require(_0x5369('0x10'));var Redis=require(_0x5369('0x11'));var authService=require(_0x5369('0x12'));var qs=require(_0x5369('0x13'));var as=require(_0x5369('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5369('0x15'))(_0x5369('0x16'));var utils=require(_0x5369('0x17'));var config=require(_0x5369('0x18'));var licenseUtil=require(_0x5369('0x19'));var db=require(_0x5369('0x1a'))['db'];function respondWithStatusCode(_0xf51572,_0x1505b2){_0x1505b2=_0x1505b2||0xcc;return function(_0x9f62e4){if(_0x9f62e4){return _0xf51572[_0x5369('0x1b')](_0x1505b2);}return _0xf51572['status'](_0x1505b2)[_0x5369('0x1c')]();};}function respondWithResult(_0x4426cb,_0x34b04c){_0x34b04c=_0x34b04c||0xc8;return function(_0x271f12){if(_0x271f12){return _0x4426cb[_0x5369('0x1d')](_0x34b04c)[_0x5369('0x1e')](_0x271f12);}};}function respondWithFilteredResult(_0x4c132b,_0x21786d){return function(_0x10d727){if(_0x10d727){var _0xd6c86b=typeof _0x21786d[_0x5369('0x1f')]===_0x5369('0x20')&&typeof _0x21786d[_0x5369('0x21')]==='undefined';var _0x102ef3=_0x10d727[_0x5369('0x22')];var _0x218dcd=_0xd6c86b?0x0:_0x21786d[_0x5369('0x1f')];var _0x9737e6=_0xd6c86b?_0x10d727['count']:_0x21786d[_0x5369('0x1f')]+_0x21786d[_0x5369('0x21')];var _0x31f6f0;if(_0x9737e6>=_0x102ef3){_0x9737e6=_0x102ef3;_0x31f6f0=0xc8;}else{_0x31f6f0=0xce;}_0x4c132b[_0x5369('0x1d')](_0x31f6f0);return _0x4c132b[_0x5369('0x23')](_0x5369('0x24'),_0x218dcd+'-'+_0x9737e6+'/'+_0x102ef3)[_0x5369('0x1e')](_0x10d727);}return null;};}function patchUpdates(_0x37385a){return function(_0x391876){try{jsonpatch[_0x5369('0x25')](_0x391876,_0x37385a,!![]);}catch(_0x8a5da4){return BPromise[_0x5369('0x26')](_0x8a5da4);}return _0x391876[_0x5369('0x27')]();};}function saveUpdates(_0x30f9de,_0x5a0d8c){return function(_0x562ec6){if(_0x562ec6){return _0x562ec6[_0x5369('0x28')](_0x30f9de)[_0x5369('0x29')](function(_0x53214b){return _0x53214b;});}return null;};}function removeEntity(_0x58d7d2,_0x46cad9){return function(_0x2ce380){if(_0x2ce380){return _0x2ce380[_0x5369('0x2a')]()[_0x5369('0x29')](function(){_0x58d7d2['status'](0xcc)[_0x5369('0x1c')]();});}};}function handleEntityNotFound(_0x3bfb00,_0x310595){return function(_0x2ef2b4){if(!_0x2ef2b4){_0x3bfb00[_0x5369('0x1b')](0x194);}return _0x2ef2b4;};}function handleError(_0x28855c,_0x43df9a){_0x43df9a=_0x43df9a||0x1f4;return function(_0x590407){logger[_0x5369('0x2b')](_0x590407[_0x5369('0x2c')]);if(_0x590407[_0x5369('0x2d')]){delete _0x590407['name'];}_0x28855c[_0x5369('0x1d')](_0x43df9a)[_0x5369('0x2e')](_0x590407);};}exports[_0x5369('0x2f')]=function(_0x54a6b7,_0x254350){var _0x30c88a={},_0xc23442={},_0xe1b263={'count':0x0,'rows':[]};var _0x1f0ad9=_[_0x5369('0x30')](db[_0x5369('0x31')]['rawAttributes'],function(_0x10bddc){return{'name':_0x10bddc[_0x5369('0x32')],'type':_0x10bddc['type']['key']};});_0xc23442[_0x5369('0x33')]=_['map'](_0x1f0ad9,_0x5369('0x2d'));_0xc23442[_0x5369('0x34')]=_[_0x5369('0x35')](_0x54a6b7[_0x5369('0x34')]);_0xc23442[_0x5369('0x36')]=_[_0x5369('0x37')](_0xc23442[_0x5369('0x33')],_0xc23442[_0x5369('0x34')]);_0x30c88a[_0x5369('0x38')]=_['intersection'](_0xc23442['model'],qs['fields'](_0x54a6b7[_0x5369('0x34')][_0x5369('0x39')]));_0x30c88a[_0x5369('0x38')]=_0x30c88a[_0x5369('0x38')][_0x5369('0x3a')]?_0x30c88a['attributes']:_0xc23442[_0x5369('0x33')];if(!_0x54a6b7[_0x5369('0x34')][_0x5369('0x3b')](_0x5369('0x3c'))){_0x30c88a['limit']=qs[_0x5369('0x21')](_0x54a6b7['query'][_0x5369('0x21')]);_0x30c88a[_0x5369('0x1f')]=qs[_0x5369('0x1f')](_0x54a6b7[_0x5369('0x34')][_0x5369('0x1f')]);}_0x30c88a[_0x5369('0x3d')]=qs[_0x5369('0x3e')](_0x54a6b7[_0x5369('0x34')][_0x5369('0x3e')]);_0x30c88a['where']=qs[_0x5369('0x36')](_[_0x5369('0x3f')](_0x54a6b7[_0x5369('0x34')],_0xc23442[_0x5369('0x36')]),_0x1f0ad9);if(_0x54a6b7[_0x5369('0x34')][_0x5369('0x40')]){_0x30c88a[_0x5369('0x41')]=_['merge'](_0x30c88a[_0x5369('0x41')],{'$or':_[_0x5369('0x30')](_0x1f0ad9,function(_0x578651){if(_0x578651[_0x5369('0x42')]!==_0x5369('0x43')){var _0x5ad5c4={};_0x5ad5c4[_0x578651['name']]={'$like':'%'+_0x54a6b7[_0x5369('0x34')][_0x5369('0x40')]+'%'};return _0x5ad5c4;}})});}_0x30c88a=_['merge']({},_0x30c88a,_0x54a6b7[_0x5369('0x44')]);var _0x4f5b49={'where':_0x30c88a[_0x5369('0x41')]};return db[_0x5369('0x31')][_0x5369('0x22')](_0x4f5b49)[_0x5369('0x29')](function(_0x5dbc29){_0xe1b263[_0x5369('0x22')]=_0x5dbc29;if(_0x54a6b7['query'][_0x5369('0x45')]){_0x30c88a[_0x5369('0x46')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x30c88a);})[_0x5369('0x29')](function(_0x48be4b){_0xe1b263[_0x5369('0x47')]=_0x48be4b;return _0xe1b263;})[_0x5369('0x29')](respondWithFilteredResult(_0x254350,_0x30c88a))['catch'](handleError(_0x254350,null));};exports[_0x5369('0x48')]=function(_0x583d1e,_0x1c8303){var _0x56108e={'raw':!![],'where':{'id':_0x583d1e[_0x5369('0x49')]['id']}},_0x2d4e32={};_0x2d4e32['model']=_['keys'](db[_0x5369('0x31')][_0x5369('0x4a')]);_0x2d4e32['query']=_[_0x5369('0x35')](_0x583d1e[_0x5369('0x34')]);_0x2d4e32['filters']=_['intersection'](_0x2d4e32['model'],_0x2d4e32[_0x5369('0x34')]);_0x56108e[_0x5369('0x38')]=_[_0x5369('0x37')](_0x2d4e32['model'],qs[_0x5369('0x39')](_0x583d1e['query'][_0x5369('0x39')]));_0x56108e[_0x5369('0x38')]=_0x56108e['attributes'][_0x5369('0x3a')]?_0x56108e[_0x5369('0x38')]:_0x2d4e32[_0x5369('0x33')];if(_0x583d1e[_0x5369('0x34')]['includeAll']){_0x56108e[_0x5369('0x46')]=[{'all':!![]}];}_0x56108e=_[_0x5369('0x4b')]({},_0x56108e,_0x583d1e[_0x5369('0x44')]);return db[_0x5369('0x31')]['find'](_0x56108e)[_0x5369('0x29')](handleEntityNotFound(_0x1c8303,null))[_0x5369('0x29')](respondWithResult(_0x1c8303,null))['catch'](handleError(_0x1c8303,null));};exports['create']=function(_0x20cfc0,_0x205b90){return db['SugarcrmField'][_0x5369('0x4c')](_0x20cfc0['body'],{})[_0x5369('0x29')](respondWithResult(_0x205b90,0xc9))[_0x5369('0x4d')](handleError(_0x205b90,null));};exports[_0x5369('0x28')]=function(_0x1b66ca,_0x2466a5){if(_0x1b66ca['body']['id']){delete _0x1b66ca[_0x5369('0x4e')]['id'];}return db[_0x5369('0x31')][_0x5369('0x4f')]({'where':{'id':_0x1b66ca[_0x5369('0x49')]['id']}})['then'](handleEntityNotFound(_0x2466a5,null))[_0x5369('0x29')](saveUpdates(_0x1b66ca[_0x5369('0x4e')],null))[_0x5369('0x29')](respondWithResult(_0x2466a5,null))[_0x5369('0x4d')](handleError(_0x2466a5,null));};exports[_0x5369('0x2a')]=function(_0x350ca8,_0x26500f){return db['SugarcrmField'][_0x5369('0x4f')]({'where':{'id':_0x350ca8['params']['id']}})[_0x5369('0x29')](handleEntityNotFound(_0x26500f,null))[_0x5369('0x29')](removeEntity(_0x26500f,null))[_0x5369('0x4d')](handleError(_0x26500f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 0dbf033..617edb6 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 _0xacd8=['FieldId','util','../../config/logger','moment','bluebird','path','../../config/environment','./intSugarcrmField.attributes','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x3700fd,_0x5bd346){var _0x4ffb6c=function(_0x42a3de){while(--_0x42a3de){_0x3700fd['push'](_0x3700fd['shift']());}};_0x4ffb6c(++_0x5bd346);}(_0xacd8,0x137));var _0x8acd=function(_0x29c4dc,_0x1a667a){_0x29c4dc=_0x29c4dc-0x0;var _0x5ac8a9=_0xacd8[_0x29c4dc];return _0x5ac8a9;};'use strict';var _=require('lodash');var util=require(_0x8acd('0x0'));var logger=require(_0x8acd('0x1'))('api');var moment=require(_0x8acd('0x2'));var BPromise=require(_0x8acd('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8acd('0x4'));var rimraf=require('rimraf');var config=require(_0x8acd('0x5'));var attributes=require(_0x8acd('0x6'));module['exports']=function(_0xa34bf7,_0x3ab142){return _0xa34bf7['define']('SugarcrmField',attributes,{'tableName':_0x8acd('0x7'),'paranoid':![],'indexes':[{'name':_0x8acd('0x8'),'fields':['idField',_0x8acd('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x85f4=['util','../../config/logger','moment','path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0xc694f3,_0x4a5a35){var _0x32f671=function(_0x19003a){while(--_0x19003a){_0xc694f3['push'](_0xc694f3['shift']());}};_0x32f671(++_0x4a5a35);}(_0x85f4,0x133));var _0x485f=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x85f4[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x485f('0x0'));var util=require(_0x485f('0x1'));var logger=require(_0x485f('0x2'))('api');var moment=require(_0x485f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x485f('0x4'));var rimraf=require(_0x485f('0x5'));var config=require('../../config/environment');var attributes=require(_0x485f('0x6'));module[_0x485f('0x7')]=function(_0x41bfe3,_0x165555){return _0x41bfe3[_0x485f('0x8')](_0x485f('0x9'),attributes,{'tableName':_0x485f('0xa'),'paranoid':![],'indexes':[{'name':_0x485f('0xb'),'fields':[_0x485f('0xc'),_0x485f('0xd')],'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 9943658..bc78083 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 _0x87b0=['error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x87b0,0x1cf));var _0x087b=function(_0x9f8d6b,_0x3fa4b5){_0x9f8d6b=_0x9f8d6b-0x0;var _0x3cc8d2=_0x87b0[_0x9f8d6b];return _0x3cc8d2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x087b('0x0'));var BPromise=require(_0x087b('0x1'));var rs=require(_0x087b('0x2'));var fs=require('fs');var Redis=require(_0x087b('0x3'));var db=require(_0x087b('0x4'))['db'];var utils=require(_0x087b('0x5'));var logger=require(_0x087b('0x6'))('rpc');var config=require(_0x087b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x087b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x326bc3,_0x108693,_0x510a01){return new BPromise(function(_0x387106,_0x5c5cbb){return client[_0x087b('0x9')](_0x326bc3,_0x510a01)[_0x087b('0xa')](function(_0x32fefc){logger[_0x087b('0xb')](_0x087b('0xc'),_0x108693,_0x087b('0xd'));logger[_0x087b('0xe')](_0x087b('0xf'),_0x108693,_0x087b('0xd'),JSON[_0x087b('0x10')](_0x32fefc));if(_0x32fefc[_0x087b('0x11')]){if(_0x32fefc[_0x087b('0x11')]['code']===0x1f4){logger[_0x087b('0x11')](_0x087b('0xc'),_0x108693,_0x32fefc['error'][_0x087b('0x12')]);return _0x5c5cbb(_0x32fefc[_0x087b('0x11')][_0x087b('0x12')]);}logger[_0x087b('0x11')](_0x087b('0xc'),_0x108693,_0x32fefc[_0x087b('0x11')][_0x087b('0x12')]);return _0x387106(_0x32fefc[_0x087b('0x11')]['message']);}else{logger['info'](_0x087b('0xc'),_0x108693,_0x087b('0xd'));_0x387106(_0x32fefc[_0x087b('0x13')][_0x087b('0x12')]);}})['catch'](function(_0x952848){logger['error'](_0x087b('0xc'),_0x108693,_0x952848);_0x5c5cbb(_0x952848);});});} \ No newline at end of file +var _0x3546=['../../mysqldb','../../config/utils','rpc','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xb874a2,_0x4eaad7){var _0x4cae28=function(_0x5644aa){while(--_0x5644aa){_0xb874a2['push'](_0xb874a2['shift']());}};_0x4cae28(++_0x4eaad7);}(_0x3546,0x1ea));var _0x6354=function(_0x1e48d3,_0x5d8c43){_0x1e48d3=_0x1e48d3-0x0;var _0x2852b1=_0x3546[_0x1e48d3];return _0x2852b1;};'use strict';var _=require(_0x6354('0x0'));var util=require('util');var moment=require(_0x6354('0x1'));var BPromise=require(_0x6354('0x2'));var rs=require(_0x6354('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6354('0x4'))['db'];var utils=require(_0x6354('0x5'));var logger=require('../../config/logger')(_0x6354('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x670d12,_0x49d4cc,_0x1f67c5){return new BPromise(function(_0x76ca4e,_0x5f743d){return client[_0x6354('0x7')](_0x670d12,_0x1f67c5)[_0x6354('0x8')](function(_0x938db2){logger[_0x6354('0x9')](_0x6354('0xa'),_0x49d4cc,_0x6354('0xb'));logger['debug'](_0x6354('0xc'),_0x49d4cc,'request\x20sent',JSON[_0x6354('0xd')](_0x938db2));if(_0x938db2['error']){if(_0x938db2[_0x6354('0xe')][_0x6354('0xf')]===0x1f4){logger[_0x6354('0xe')](_0x6354('0xa'),_0x49d4cc,_0x938db2[_0x6354('0xe')][_0x6354('0x10')]);return _0x5f743d(_0x938db2[_0x6354('0xe')]['message']);}logger[_0x6354('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x49d4cc,_0x938db2[_0x6354('0xe')][_0x6354('0x10')]);return _0x76ca4e(_0x938db2[_0x6354('0xe')][_0x6354('0x10')]);}else{logger[_0x6354('0x9')]('SugarcrmField,\x20%s,\x20%s',_0x49d4cc,_0x6354('0xb'));_0x76ca4e(_0x938db2[_0x6354('0x11')][_0x6354('0x10')]);}})[_0x6354('0x12')](function(_0x38b355){logger['error'](_0x6354('0xa'),_0x49d4cc,_0x38b355);_0x5f743d(_0x38b355);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index b7d0447..7b247a3 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 _0xc0c2=['/:id/configurations','addConfiguration','put','/:id','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','create'];(function(_0x23c4a9,_0x15eaf1){var _0xf708c5=function(_0x22f2be){while(--_0x22f2be){_0x23c4a9['push'](_0x23c4a9['shift']());}};_0xf708c5(++_0x15eaf1);}(_0xc0c2,0x1b7));var _0x2c0c=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0xc0c2[_0x364b32];return _0x3f3ea0;};'use strict';var multer=require('multer');var util=require(_0x2c0c('0x0'));var path=require(_0x2c0c('0x1'));var timeout=require(_0x2c0c('0x2'));var express=require(_0x2c0c('0x3'));var router=express['Router']();var fs_extra=require(_0x2c0c('0x4'));var auth=require(_0x2c0c('0x5'));var interaction=require(_0x2c0c('0x6'));var config=require(_0x2c0c('0x7'));var controller=require(_0x2c0c('0x8'));router[_0x2c0c('0x9')]('/',auth[_0x2c0c('0xa')](),controller[_0x2c0c('0xb')]);router['get']('/:id',auth[_0x2c0c('0xa')](),controller[_0x2c0c('0xc')]);router[_0x2c0c('0x9')]('/:id/configurations',auth[_0x2c0c('0xa')](),controller['getConfigurations']);router[_0x2c0c('0x9')](_0x2c0c('0xd'),auth['isAuthenticated'](),controller[_0x2c0c('0xe')]);router[_0x2c0c('0xf')]('/',auth[_0x2c0c('0xa')](),controller[_0x2c0c('0x10')]);router[_0x2c0c('0xf')](_0x2c0c('0x11'),auth[_0x2c0c('0xa')](),controller[_0x2c0c('0x12')]);router[_0x2c0c('0x13')](_0x2c0c('0x14'),auth[_0x2c0c('0xa')](),controller[_0x2c0c('0x15')]);router['delete'](_0x2c0c('0x14'),auth['isAuthenticated'](),controller[_0x2c0c('0x16')]);module[_0x2c0c('0x17')]=router; \ No newline at end of file +var _0xf296=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','getFields','create','addConfiguration','/:id','update','delete','destroy'];(function(_0x2f07ec,_0x22fa5d){var _0x488796=function(_0x3859d9){while(--_0x3859d9){_0x2f07ec['push'](_0x2f07ec['shift']());}};_0x488796(++_0x22fa5d);}(_0xf296,0x94));var _0x6f29=function(_0x4cdbc8,_0x4d8e1d){_0x4cdbc8=_0x4cdbc8-0x0;var _0x311448=_0xf296[_0x4cdbc8];return _0x311448;};'use strict';var multer=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var path=require('path');var timeout=require(_0x6f29('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6f29('0x3'));var auth=require(_0x6f29('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f29('0x5'));var controller=require(_0x6f29('0x6'));router[_0x6f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x6f29('0x8')]);router[_0x6f29('0x7')]('/:id',auth[_0x6f29('0x9')](),controller[_0x6f29('0xa')]);router[_0x6f29('0x7')](_0x6f29('0xb'),auth[_0x6f29('0x9')](),controller[_0x6f29('0xc')]);router[_0x6f29('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x6f29('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6f29('0xe')]);router['post'](_0x6f29('0xb'),auth[_0x6f29('0x9')](),controller[_0x6f29('0xf')]);router['put'](_0x6f29('0x10'),auth[_0x6f29('0x9')](),controller[_0x6f29('0x11')]);router[_0x6f29('0x12')](_0x6f29('0x10'),auth['isAuthenticated'](),controller[_0x6f29('0x13')]);module[_0x6f29('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 9827e1e..992353c 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 _0x6e6f=['STRING','sequelize'];(function(_0x240c63,_0x7e2d08){var _0xb19b09=function(_0x46256c){while(--_0x46256c){_0x240c63['push'](_0x240c63['shift']());}};_0xb19b09(++_0x7e2d08);}(_0x6e6f,0xcb));var _0xf6e6=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0x6e6f[_0x476b00];return _0x44ec8e;};'use strict';var Sequelize=require(_0xf6e6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8ec6=['STRING','HelpDesk','sequelize','exports'];(function(_0x334d8c,_0xfe847d){var _0x5e4902=function(_0x4b0e77){while(--_0x4b0e77){_0x334d8c['push'](_0x334d8c['shift']());}};_0x5e4902(++_0xfe847d);}(_0x8ec6,0x18e));var _0x68ec=function(_0x40aea0,_0x54b5e5){_0x40aea0=_0x40aea0-0x0;var _0x5f4432=_0x8ec6[_0x40aea0];return _0x5f4432;};'use strict';var Sequelize=require(_0x68ec('0x0'));module[_0x68ec('0x1')]={'name':{'type':Sequelize[_0x68ec('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ec('0x2')]},'username':{'type':Sequelize[_0x68ec('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x68ec('0x2')],'allowNull':![],'defaultValue':_0x68ec('0x3')},'remoteUri':{'type':Sequelize[_0x68ec('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x68ec('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 311edca..44c6588 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 _0x3890=['fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','VtigerAccount','rawAttributes','fieldName','map','query','keys','intersection','model','fields','attributes','nolimit','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','body','getConfigurations','findOne','order','pick','hasOwnProperty','Subjects','getSubjects','channel','type','Descriptions','create','VtigerField','getFields','username','moduleName','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','result','describe','sessionName','reference','owner','remove','includes','editable','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x3890,0x153));var _0x0389=function(_0x568870,_0x12b6f3){_0x568870=_0x568870-0x0;var _0x59fa8e=_0x3890[_0x568870];return _0x59fa8e;};'use strict';var emlformat=require(_0x0389('0x0'));var rimraf=require(_0x0389('0x1'));var zipdir=require(_0x0389('0x2'));var jsonpatch=require(_0x0389('0x3'));var rp=require(_0x0389('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0389('0x5'));var util=require('util');var path=require(_0x0389('0x6'));var sox=require(_0x0389('0x7'));var csv=require(_0x0389('0x8'));var ejs=require(_0x0389('0x9'));var fs=require('fs');var fs_extra=require(_0x0389('0xa'));var _=require(_0x0389('0xb'));var squel=require(_0x0389('0xc'));var crypto=require(_0x0389('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0389('0xe'));var Papa=require(_0x0389('0xf'));var Redis=require(_0x0389('0x10'));var authService=require(_0x0389('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0389('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0389('0x13'));var utils=require(_0x0389('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x0389('0x15'));function respondWithStatusCode(_0x1aedf5,_0x386ec8){_0x386ec8=_0x386ec8||0xcc;return function(_0x420d45){if(_0x420d45){return _0x1aedf5['sendStatus'](_0x386ec8);}return _0x1aedf5[_0x0389('0x16')](_0x386ec8)[_0x0389('0x17')]();};}function respondWithResult(_0x46ba4b,_0x190a28){_0x190a28=_0x190a28||0xc8;return function(_0x5a29ae){if(_0x5a29ae){return _0x46ba4b[_0x0389('0x16')](_0x190a28)[_0x0389('0x18')](_0x5a29ae);}};}function respondWithFilteredResult(_0x24ec4b,_0x3ca86c){return function(_0xc226d7){if(_0xc226d7){var _0xdb3beb=typeof _0x3ca86c[_0x0389('0x19')]===_0x0389('0x1a')&&typeof _0x3ca86c[_0x0389('0x1b')]===_0x0389('0x1a');var _0x4d89eb=_0xc226d7[_0x0389('0x1c')];var _0x3bda91=_0xdb3beb?0x0:_0x3ca86c['offset'];var _0x59ea28=_0xdb3beb?_0xc226d7['count']:_0x3ca86c['offset']+_0x3ca86c[_0x0389('0x1b')];var _0x1f0022;if(_0x59ea28>=_0x4d89eb){_0x59ea28=_0x4d89eb;_0x1f0022=0xc8;}else{_0x1f0022=0xce;}_0x24ec4b[_0x0389('0x16')](_0x1f0022);return _0x24ec4b[_0x0389('0x1d')](_0x0389('0x1e'),_0x3bda91+'-'+_0x59ea28+'/'+_0x4d89eb)[_0x0389('0x18')](_0xc226d7);}return null;};}function patchUpdates(_0xb805f2){return function(_0x5e3299){try{jsonpatch[_0x0389('0x1f')](_0x5e3299,_0xb805f2,!![]);}catch(_0x5a1560){return BPromise[_0x0389('0x20')](_0x5a1560);}return _0x5e3299[_0x0389('0x21')]();};}function saveUpdates(_0x2fe734,_0x250e7d){return function(_0x5a0dfd){if(_0x5a0dfd){return _0x5a0dfd[_0x0389('0x22')](_0x2fe734)['then'](function(_0x2419b){return _0x2419b;});}return null;};}function removeEntity(_0x30ea2f,_0x418e7f){return function(_0x176961){if(_0x176961){return _0x176961['destroy']()[_0x0389('0x23')](function(){_0x30ea2f[_0x0389('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50e4b8,_0x351a1c){return function(_0x14d5eb){if(!_0x14d5eb){_0x50e4b8[_0x0389('0x24')](0x194);}return _0x14d5eb;};}function handleError(_0x2387fe,_0x4b7bfa){_0x4b7bfa=_0x4b7bfa||0x1f4;return function(_0x5f530f){logger[_0x0389('0x25')](_0x5f530f[_0x0389('0x26')]);if(_0x5f530f[_0x0389('0x27')]){delete _0x5f530f[_0x0389('0x27')];}_0x2387fe[_0x0389('0x16')](_0x4b7bfa)['send'](_0x5f530f);};}exports['index']=function(_0x3bf4ae,_0x2d467a){var _0x429b39={},_0x14eb37={},_0x163790={'count':0x0,'rows':[]};var _0x54bceb=_['map'](db[_0x0389('0x28')][_0x0389('0x29')],function(_0x4672ed){return{'name':_0x4672ed[_0x0389('0x2a')],'type':_0x4672ed['type']['key']};});_0x14eb37['model']=_[_0x0389('0x2b')](_0x54bceb,'name');_0x14eb37[_0x0389('0x2c')]=_[_0x0389('0x2d')](_0x3bf4ae[_0x0389('0x2c')]);_0x14eb37['filters']=_[_0x0389('0x2e')](_0x14eb37[_0x0389('0x2f')],_0x14eb37[_0x0389('0x2c')]);_0x429b39['attributes']=_['intersection'](_0x14eb37[_0x0389('0x2f')],qs[_0x0389('0x30')](_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x30')]));_0x429b39[_0x0389('0x31')]=_0x429b39[_0x0389('0x31')]['length']?_0x429b39['attributes']:_0x14eb37[_0x0389('0x2f')];if(!_0x3bf4ae['query']['hasOwnProperty'](_0x0389('0x32'))){_0x429b39[_0x0389('0x1b')]=qs[_0x0389('0x1b')](_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x1b')]);_0x429b39[_0x0389('0x19')]=qs['offset'](_0x3bf4ae[_0x0389('0x2c')]['offset']);}_0x429b39['order']=qs[_0x0389('0x33')](_0x3bf4ae['query'][_0x0389('0x33')]);_0x429b39[_0x0389('0x34')]=qs['filters'](_['pick'](_0x3bf4ae['query'],_0x14eb37[_0x0389('0x35')]),_0x54bceb);if(_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x36')]){_0x429b39['where']=_[_0x0389('0x37')](_0x429b39['where'],{'$or':_['map'](_0x54bceb,function(_0x216910){if(_0x216910['type']!=='VIRTUAL'){var _0x3a34da={};_0x3a34da[_0x216910['name']]={'$like':'%'+_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x36')]+'%'};return _0x3a34da;}})});}_0x429b39=_[_0x0389('0x37')]({},_0x429b39,_0x3bf4ae[_0x0389('0x38')]);var _0x570791={'where':_0x429b39[_0x0389('0x34')]};return db[_0x0389('0x28')]['count'](_0x570791)['then'](function(_0x276fd4){_0x163790[_0x0389('0x1c')]=_0x276fd4;if(_0x3bf4ae[_0x0389('0x2c')][_0x0389('0x39')]){_0x429b39[_0x0389('0x3a')]=[{'all':!![]}];}return db[_0x0389('0x28')][_0x0389('0x3b')](_0x429b39);})[_0x0389('0x23')](function(_0x15f7fb){_0x163790[_0x0389('0x3c')]=_0x15f7fb;return _0x163790;})[_0x0389('0x23')](respondWithFilteredResult(_0x2d467a,_0x429b39))[_0x0389('0x3d')](handleError(_0x2d467a,null));};exports['show']=function(_0x50017d,_0x3ec23c){var _0x34d347={'raw':![],'where':{'id':_0x50017d[_0x0389('0x3e')]['id']}},_0x549b34={};_0x549b34['model']=_['keys'](db[_0x0389('0x28')][_0x0389('0x29')]);_0x549b34[_0x0389('0x2c')]=_[_0x0389('0x2d')](_0x50017d[_0x0389('0x2c')]);_0x549b34[_0x0389('0x35')]=_['intersection'](_0x549b34['model'],_0x549b34['query']);_0x34d347[_0x0389('0x31')]=_['intersection'](_0x549b34['model'],qs[_0x0389('0x30')](_0x50017d[_0x0389('0x2c')][_0x0389('0x30')]));_0x34d347[_0x0389('0x31')]=_0x34d347['attributes'][_0x0389('0x3f')]?_0x34d347[_0x0389('0x31')]:_0x549b34[_0x0389('0x2f')];if(_0x50017d[_0x0389('0x2c')]['includeAll']){_0x34d347[_0x0389('0x3a')]=[{'all':!![]}];}_0x34d347=_['merge']({},_0x34d347,_0x50017d[_0x0389('0x38')]);return db['VtigerAccount'][_0x0389('0x40')](_0x34d347)['then'](handleEntityNotFound(_0x3ec23c,null))['then'](respondWithResult(_0x3ec23c,null))[_0x0389('0x3d')](handleError(_0x3ec23c,null));};exports['create']=function(_0x2aa31e,_0x5c3328){return db[_0x0389('0x28')]['create'](_0x2aa31e[_0x0389('0x41')],{})['then'](respondWithResult(_0x5c3328,0xc9))[_0x0389('0x3d')](handleError(_0x5c3328,null));};exports['update']=function(_0x45af62,_0x260c09){if(_0x45af62[_0x0389('0x41')]['id']){delete _0x45af62['body']['id'];}return db['VtigerAccount'][_0x0389('0x40')]({'where':{'id':_0x45af62[_0x0389('0x3e')]['id']}})[_0x0389('0x23')](handleEntityNotFound(_0x260c09,null))[_0x0389('0x23')](saveUpdates(_0x45af62[_0x0389('0x41')],null))[_0x0389('0x23')](respondWithResult(_0x260c09,null))[_0x0389('0x3d')](handleError(_0x260c09,null));};exports['destroy']=function(_0x4135e1,_0x46f636){return db['VtigerAccount']['find']({'where':{'id':_0x4135e1[_0x0389('0x3e')]['id']}})['then'](handleEntityNotFound(_0x46f636,null))['then'](removeEntity(_0x46f636,null))[_0x0389('0x3d')](handleError(_0x46f636,null));};exports[_0x0389('0x42')]=function(_0x5ef59f,_0x45ee22,_0x316c9d){var _0x47a06f={};var _0x28acc8={};var _0x5726fe;var _0x27785c;return db[_0x0389('0x28')][_0x0389('0x43')]({'where':{'id':_0x5ef59f[_0x0389('0x3e')]['id']}})[_0x0389('0x23')](handleEntityNotFound(_0x45ee22,null))['then'](function(_0x1a7720){if(_0x1a7720){_0x5726fe=_0x1a7720;_0x28acc8[_0x0389('0x2f')]=_[_0x0389('0x2d')](db['VtigerConfiguration'][_0x0389('0x29')]);_0x28acc8[_0x0389('0x2c')]=_[_0x0389('0x2d')](_0x5ef59f[_0x0389('0x2c')]);_0x28acc8['filters']=_[_0x0389('0x2e')](_0x28acc8[_0x0389('0x2f')],_0x28acc8[_0x0389('0x2c')]);_0x47a06f[_0x0389('0x31')]=_[_0x0389('0x2e')](_0x28acc8['model'],qs['fields'](_0x5ef59f[_0x0389('0x2c')][_0x0389('0x30')]));_0x47a06f[_0x0389('0x31')]=_0x47a06f[_0x0389('0x31')]['length']?_0x47a06f['attributes']:_0x28acc8['model'];_0x47a06f[_0x0389('0x44')]=qs[_0x0389('0x33')](_0x5ef59f['query'][_0x0389('0x33')]);_0x47a06f[_0x0389('0x34')]=qs[_0x0389('0x35')](_[_0x0389('0x45')](_0x5ef59f[_0x0389('0x2c')],_0x28acc8[_0x0389('0x35')]));if(_0x5ef59f[_0x0389('0x2c')][_0x0389('0x36')]){_0x47a06f[_0x0389('0x34')]=_[_0x0389('0x37')](_0x47a06f[_0x0389('0x34')],{'$or':_[_0x0389('0x2b')](_0x47a06f[_0x0389('0x31')],function(_0x26d0e5){var _0x1e45db={};_0x1e45db[_0x26d0e5]={'$like':'%'+_0x5ef59f[_0x0389('0x2c')][_0x0389('0x36')]+'%'};return _0x1e45db;})});}_0x47a06f=_['merge']({},_0x47a06f,_0x5ef59f[_0x0389('0x38')]);return _0x5726fe[_0x0389('0x42')](_0x47a06f);}})[_0x0389('0x23')](function(_0x19e9b0){if(_0x19e9b0){_0x27785c=_0x19e9b0['length'];if(!_0x5ef59f['query'][_0x0389('0x46')](_0x0389('0x32'))){_0x47a06f[_0x0389('0x1b')]=qs[_0x0389('0x1b')](_0x5ef59f['query']['limit']);_0x47a06f[_0x0389('0x19')]=qs[_0x0389('0x19')](_0x5ef59f['query'][_0x0389('0x19')]);}return _0x5726fe[_0x0389('0x42')](_0x47a06f);}})[_0x0389('0x23')](function(_0x3b2230){if(_0x3b2230){return _0x3b2230?{'count':_0x27785c,'rows':_0x3b2230}:null;}})[_0x0389('0x23')](respondWithResult(_0x45ee22,null))['catch'](handleError(_0x45ee22,null));};exports['addConfiguration']=function(_0x38df86,_0xb2db52,_0xff180d){if(_0x38df86[_0x0389('0x41')]['id']){delete _0x38df86[_0x0389('0x41')]['id'];}return db['VtigerAccount'][_0x0389('0x43')]({'where':{'id':_0x38df86[_0x0389('0x3e')]['id']}})[_0x0389('0x23')](handleEntityNotFound(_0xb2db52,null))['then'](function(_0x5613d4){if(_0x5613d4){_0x38df86['body']['AccountId']=_0x5613d4['id'];_0x38df86['body'][_0x0389('0x47')]=integrations[_0x0389('0x48')](_0x38df86['body'][_0x0389('0x49')],_0x38df86['body'][_0x0389('0x4a')]);_0x38df86['body'][_0x0389('0x4b')]=integrations['getDescriptions'](_0x38df86[_0x0389('0x41')]['channel'],_0x38df86[_0x0389('0x41')][_0x0389('0x4a')]);return db['VtigerConfiguration'][_0x0389('0x4c')](_0x38df86[_0x0389('0x41')],{'include':[{'model':db[_0x0389('0x4d')],'as':_0x0389('0x47')},{'model':db[_0x0389('0x4d')],'as':'Descriptions'}]});}return null;})[_0x0389('0x23')](respondWithResult(_0xb2db52,null))[_0x0389('0x3d')](handleError(_0xb2db52,null));};var md5=require('md5');exports[_0x0389('0x4e')]=function(_0x230de6,_0x44078e,_0x165759){var _0x757262=null;var _0xf4a912=null;var _0x108be1=null;var _0x4de000=null;var _0x893ccd='';return db[_0x0389('0x28')][_0x0389('0x43')]({'where':{'id':_0x230de6[_0x0389('0x3e')]['id']},'attributes':['id',_0x0389('0x27'),_0x0389('0x4f'),'description',_0x0389('0x50'),'remoteUri',_0x0389('0x51'),_0x0389('0x52')]})[_0x0389('0x23')](handleEntityNotFound(_0x44078e,null))[_0x0389('0x23')](function(_0x522a78){if(_0x522a78){_0x757262=_0x522a78[_0x0389('0x4f')];_0xf4a912=_0x522a78[_0x0389('0x52')];_0x108be1=_0x522a78[_0x0389('0x50')];_0x893ccd=_0x522a78['remoteUri'];var _0x443305=_0x893ccd[_0x0389('0x53')](-0x1);if(_0x443305==='/'){_0x893ccd=_0x893ccd[_0x0389('0x54')](0x0,_0x893ccd[_0x0389('0x55')](_0x443305));}_0x4de000=util[_0x0389('0x56')](_0x0389('0x57'),_0x893ccd);var _0x4c4b7f={'method':_0x0389('0x58'),'uri':_0x4de000,'qs':{'operation':_0x0389('0x59'),'username':_0x522a78['username']},'json':!![]};return rp(_0x4c4b7f);}})[_0x0389('0x23')](function(_0x46a722){if(_0x46a722[_0x0389('0x5a')]){var _0x200cb5={'method':_0x0389('0x5b'),'uri':_0x4de000,'form':{'operation':'login','username':_0x757262,'accessKey':md5(_0x46a722[_0x0389('0x5c')]['token']+_0xf4a912)},'json':!![]};return rp(_0x200cb5);}})['then'](function(_0x30b1e5){if(_0x30b1e5[_0x0389('0x5a')]){var _0x495e8a={'method':_0x0389('0x58'),'uri':_0x4de000,'qs':{'operation':_0x0389('0x5d'),'username':_0x757262,'sessionName':_0x30b1e5[_0x0389('0x5c')][_0x0389('0x5e')],'elementType':_0x108be1},'json':!![]};return rp(_0x495e8a);}})[_0x0389('0x23')](function(_0xa83ab8){if(_0xa83ab8[_0x0389('0x5a')]){var _0x239313=['autogenerated',_0x0389('0x5f'),_0x0389('0x60')];_[_0x0389('0x61')](_0xa83ab8[_0x0389('0x5c')][_0x0389('0x30')],function(_0x179ea2){return _0x239313[_0x0389('0x62')](_0x179ea2['type']['name']);});_['remove'](_0xa83ab8[_0x0389('0x5c')][_0x0389('0x30')],function(_0x4e616){return _0x4e616[_0x0389('0x63')]==='false';});return{'count':_0xa83ab8[_0x0389('0x5c')][_0x0389('0x30')][_0x0389('0x3f')],'rows':_[_0x0389('0x2b')](_0xa83ab8[_0x0389('0x5c')][_0x0389('0x30')],function(_0x2e9e8b){return{'id':_0x2e9e8b[_0x0389('0x27')],'name':_0x2e9e8b[_0x0389('0x64')],'custom':_[_0x0389('0x65')](_0x2e9e8b[_0x0389('0x27')],_0x0389('0x66'))?!![]:![],'options':_0x2e9e8b['type']['name']===_0x0389('0x67')&&_0x2e9e8b[_0x0389('0x4a')][_0x0389('0x68')][_0x0389('0x3f')]>0x0?_[_0x0389('0x2b')](_0x2e9e8b['type']['picklistValues'],function(_0x10da8c){return{'name':_0x10da8c[_0x0389('0x64')],'value':_0x10da8c[_0x0389('0x69')]};}):[]};})};}})[_0x0389('0x23')](respondWithResult(_0x44078e,null))['catch'](function(_0x44f7c4){console[_0x0389('0x6a')](_0x0389('0x6b')+_0x44f7c4);var _0xacd6f7=_0x230de6[_0x0389('0x2c')]['test']?0x1f4:_0x44f7c4[_0x0389('0x6c')]||0x1f4;logger['error'](_0x0389('0x6d'),_0x0389('0x4e'),_0xacd6f7,JSON[_0x0389('0x6e')](_0x44f7c4));delete _0x44f7c4[_0x0389('0x27')];if(_0xacd6f7===0x191){_0xacd6f7=0x190;}_0x44078e['status'](_0xacd6f7)[_0x0389('0x6f')](_0x230de6['query'][_0x0389('0x70')]?{'message':_0x0389('0x71'),'statusCode':_0x44f7c4[_0x0389('0x6c')]}:_0x44f7c4);});}; \ No newline at end of file +var _0x139c=['startsWith','cf_','picklist','picklistValues','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','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/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','apply','reject','save','destroy','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','then','includeAll','include','rows','catch','show','params','options','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','VtigerField','md5','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','login','result','token','GET','describe','success','autogenerated','reference','owner','remove','label'];(function(_0x24db39,_0x268284){var _0x38dad8=function(_0x316c21){while(--_0x316c21){_0x24db39['push'](_0x24db39['shift']());}};_0x38dad8(++_0x268284);}(_0x139c,0x1eb));var _0xc139=function(_0x4dc11e,_0x39159e){_0x4dc11e=_0x4dc11e-0x0;var _0x9f0390=_0x139c[_0x4dc11e];return _0x9f0390;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc139('0x0'));var zipdir=require(_0xc139('0x1'));var jsonpatch=require(_0xc139('0x2'));var rp=require('request-promise');var moment=require(_0xc139('0x3'));var BPromise=require(_0xc139('0x4'));var Mustache=require(_0xc139('0x5'));var util=require(_0xc139('0x6'));var path=require(_0xc139('0x7'));var sox=require(_0xc139('0x8'));var csv=require(_0xc139('0x9'));var ejs=require(_0xc139('0xa'));var fs=require('fs');var fs_extra=require(_0xc139('0xb'));var _=require(_0xc139('0xc'));var squel=require(_0xc139('0xd'));var crypto=require(_0xc139('0xe'));var jsforce=require(_0xc139('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc139('0x9'));var querystring=require(_0xc139('0x10'));var Papa=require(_0xc139('0x11'));var Redis=require(_0xc139('0x12'));var authService=require(_0xc139('0x13'));var qs=require(_0xc139('0x14'));var as=require(_0xc139('0x15'));var hardwareService=require(_0xc139('0x16'));var logger=require(_0xc139('0x17'))(_0xc139('0x18'));var utils=require(_0xc139('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc139('0x1a'));var db=require(_0xc139('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xd945e,_0x57c29a){_0x57c29a=_0x57c29a||0xcc;return function(_0x192392){if(_0x192392){return _0xd945e[_0xc139('0x1c')](_0x57c29a);}return _0xd945e['status'](_0x57c29a)[_0xc139('0x1d')]();};}function respondWithResult(_0x4cbaa2,_0x100e9c){_0x100e9c=_0x100e9c||0xc8;return function(_0x88a3d6){if(_0x88a3d6){return _0x4cbaa2[_0xc139('0x1e')](_0x100e9c)['json'](_0x88a3d6);}};}function respondWithFilteredResult(_0x1f8108,_0x56b6bd){return function(_0x7ae1b4){if(_0x7ae1b4){var _0x4d6bc2=typeof _0x56b6bd[_0xc139('0x1f')]===_0xc139('0x20')&&typeof _0x56b6bd[_0xc139('0x21')]===_0xc139('0x20');var _0x368047=_0x7ae1b4[_0xc139('0x22')];var _0x104f39=_0x4d6bc2?0x0:_0x56b6bd[_0xc139('0x1f')];var _0x4c84a6=_0x4d6bc2?_0x7ae1b4[_0xc139('0x22')]:_0x56b6bd['offset']+_0x56b6bd[_0xc139('0x21')];var _0xd4ad54;if(_0x4c84a6>=_0x368047){_0x4c84a6=_0x368047;_0xd4ad54=0xc8;}else{_0xd4ad54=0xce;}_0x1f8108['status'](_0xd4ad54);return _0x1f8108[_0xc139('0x23')]('Content-Range',_0x104f39+'-'+_0x4c84a6+'/'+_0x368047)['json'](_0x7ae1b4);}return null;};}function patchUpdates(_0xa587b1){return function(_0x1a9c04){try{jsonpatch[_0xc139('0x24')](_0x1a9c04,_0xa587b1,!![]);}catch(_0x11fffc){return BPromise[_0xc139('0x25')](_0x11fffc);}return _0x1a9c04[_0xc139('0x26')]();};}function saveUpdates(_0x293505,_0x32da0e){return function(_0xcc9a64){if(_0xcc9a64){return _0xcc9a64['update'](_0x293505)['then'](function(_0xce3e38){return _0xce3e38;});}return null;};}function removeEntity(_0x2c5ee6,_0x208461){return function(_0x40b12a){if(_0x40b12a){return _0x40b12a[_0xc139('0x27')]()['then'](function(){_0x2c5ee6[_0xc139('0x1e')](0xcc)[_0xc139('0x1d')]();});}};}function handleEntityNotFound(_0x2c6621,_0x405fac){return function(_0x3b7ee9){if(!_0x3b7ee9){_0x2c6621[_0xc139('0x1c')](0x194);}return _0x3b7ee9;};}function handleError(_0x3bfdf6,_0x5fb4b9){_0x5fb4b9=_0x5fb4b9||0x1f4;return function(_0x4a7145){logger[_0xc139('0x28')](_0x4a7145[_0xc139('0x29')]);if(_0x4a7145[_0xc139('0x2a')]){delete _0x4a7145[_0xc139('0x2a')];}_0x3bfdf6[_0xc139('0x1e')](_0x5fb4b9)[_0xc139('0x2b')](_0x4a7145);};}exports[_0xc139('0x2c')]=function(_0x5a0434,_0x518a6e){var _0x1578f4={},_0x55ff9a={},_0x3047a5={'count':0x0,'rows':[]};var _0xf7769f=_['map'](db[_0xc139('0x2d')][_0xc139('0x2e')],function(_0x11b646){return{'name':_0x11b646[_0xc139('0x2f')],'type':_0x11b646[_0xc139('0x30')][_0xc139('0x31')]};});_0x55ff9a[_0xc139('0x32')]=_[_0xc139('0x33')](_0xf7769f,_0xc139('0x2a'));_0x55ff9a[_0xc139('0x34')]=_[_0xc139('0x35')](_0x5a0434[_0xc139('0x34')]);_0x55ff9a[_0xc139('0x36')]=_[_0xc139('0x37')](_0x55ff9a[_0xc139('0x32')],_0x55ff9a[_0xc139('0x34')]);_0x1578f4[_0xc139('0x38')]=_['intersection'](_0x55ff9a[_0xc139('0x32')],qs[_0xc139('0x39')](_0x5a0434[_0xc139('0x34')][_0xc139('0x39')]));_0x1578f4[_0xc139('0x38')]=_0x1578f4['attributes'][_0xc139('0x3a')]?_0x1578f4[_0xc139('0x38')]:_0x55ff9a[_0xc139('0x32')];if(!_0x5a0434['query'][_0xc139('0x3b')]('nolimit')){_0x1578f4['limit']=qs[_0xc139('0x21')](_0x5a0434[_0xc139('0x34')][_0xc139('0x21')]);_0x1578f4['offset']=qs[_0xc139('0x1f')](_0x5a0434['query'][_0xc139('0x1f')]);}_0x1578f4[_0xc139('0x3c')]=qs[_0xc139('0x3d')](_0x5a0434[_0xc139('0x34')][_0xc139('0x3d')]);_0x1578f4[_0xc139('0x3e')]=qs[_0xc139('0x36')](_[_0xc139('0x3f')](_0x5a0434[_0xc139('0x34')],_0x55ff9a['filters']),_0xf7769f);if(_0x5a0434[_0xc139('0x34')][_0xc139('0x40')]){_0x1578f4[_0xc139('0x3e')]=_['merge'](_0x1578f4[_0xc139('0x3e')],{'$or':_[_0xc139('0x33')](_0xf7769f,function(_0x357d5c){if(_0x357d5c[_0xc139('0x30')]!==_0xc139('0x41')){var _0x304bfd={};_0x304bfd[_0x357d5c[_0xc139('0x2a')]]={'$like':'%'+_0x5a0434['query']['filter']+'%'};return _0x304bfd;}})});}_0x1578f4=_[_0xc139('0x42')]({},_0x1578f4,_0x5a0434['options']);var _0x2751bf={'where':_0x1578f4[_0xc139('0x3e')]};return db['VtigerAccount'][_0xc139('0x22')](_0x2751bf)[_0xc139('0x43')](function(_0x290c02){_0x3047a5['count']=_0x290c02;if(_0x5a0434[_0xc139('0x34')][_0xc139('0x44')]){_0x1578f4[_0xc139('0x45')]=[{'all':!![]}];}return db[_0xc139('0x2d')]['findAll'](_0x1578f4);})['then'](function(_0x396500){_0x3047a5[_0xc139('0x46')]=_0x396500;return _0x3047a5;})[_0xc139('0x43')](respondWithFilteredResult(_0x518a6e,_0x1578f4))[_0xc139('0x47')](handleError(_0x518a6e,null));};exports[_0xc139('0x48')]=function(_0x49d3ca,_0x43bcc2){var _0x421bd5={'raw':![],'where':{'id':_0x49d3ca[_0xc139('0x49')]['id']}},_0x36600e={};_0x36600e[_0xc139('0x32')]=_['keys'](db[_0xc139('0x2d')][_0xc139('0x2e')]);_0x36600e['query']=_[_0xc139('0x35')](_0x49d3ca['query']);_0x36600e[_0xc139('0x36')]=_[_0xc139('0x37')](_0x36600e['model'],_0x36600e[_0xc139('0x34')]);_0x421bd5['attributes']=_['intersection'](_0x36600e[_0xc139('0x32')],qs[_0xc139('0x39')](_0x49d3ca[_0xc139('0x34')][_0xc139('0x39')]));_0x421bd5[_0xc139('0x38')]=_0x421bd5[_0xc139('0x38')]['length']?_0x421bd5[_0xc139('0x38')]:_0x36600e[_0xc139('0x32')];if(_0x49d3ca['query'][_0xc139('0x44')]){_0x421bd5['include']=[{'all':!![]}];}_0x421bd5=_[_0xc139('0x42')]({},_0x421bd5,_0x49d3ca[_0xc139('0x4a')]);return db[_0xc139('0x2d')][_0xc139('0x4b')](_0x421bd5)[_0xc139('0x43')](handleEntityNotFound(_0x43bcc2,null))[_0xc139('0x43')](respondWithResult(_0x43bcc2,null))[_0xc139('0x47')](handleError(_0x43bcc2,null));};exports[_0xc139('0x4c')]=function(_0x145334,_0x1e6c75){return db[_0xc139('0x2d')][_0xc139('0x4c')](_0x145334[_0xc139('0x4d')],{})['then'](respondWithResult(_0x1e6c75,0xc9))[_0xc139('0x47')](handleError(_0x1e6c75,null));};exports['update']=function(_0x392322,_0xc0d10b){if(_0x392322[_0xc139('0x4d')]['id']){delete _0x392322[_0xc139('0x4d')]['id'];}return db[_0xc139('0x2d')][_0xc139('0x4b')]({'where':{'id':_0x392322['params']['id']}})[_0xc139('0x43')](handleEntityNotFound(_0xc0d10b,null))['then'](saveUpdates(_0x392322[_0xc139('0x4d')],null))[_0xc139('0x43')](respondWithResult(_0xc0d10b,null))['catch'](handleError(_0xc0d10b,null));};exports[_0xc139('0x27')]=function(_0x5e745a,_0x2ed339){return db[_0xc139('0x2d')][_0xc139('0x4b')]({'where':{'id':_0x5e745a[_0xc139('0x49')]['id']}})[_0xc139('0x43')](handleEntityNotFound(_0x2ed339,null))[_0xc139('0x43')](removeEntity(_0x2ed339,null))[_0xc139('0x47')](handleError(_0x2ed339,null));};exports[_0xc139('0x4e')]=function(_0x2a2865,_0x2b5bc7,_0x5822f4){var _0x392986={};var _0x560aac={};var _0x446e4c;var _0x236e2f;return db[_0xc139('0x2d')][_0xc139('0x4f')]({'where':{'id':_0x2a2865[_0xc139('0x49')]['id']}})[_0xc139('0x43')](handleEntityNotFound(_0x2b5bc7,null))[_0xc139('0x43')](function(_0x4aaf84){if(_0x4aaf84){_0x446e4c=_0x4aaf84;_0x560aac[_0xc139('0x32')]=_[_0xc139('0x35')](db['VtigerConfiguration'][_0xc139('0x2e')]);_0x560aac['query']=_[_0xc139('0x35')](_0x2a2865[_0xc139('0x34')]);_0x560aac[_0xc139('0x36')]=_[_0xc139('0x37')](_0x560aac['model'],_0x560aac['query']);_0x392986[_0xc139('0x38')]=_['intersection'](_0x560aac[_0xc139('0x32')],qs[_0xc139('0x39')](_0x2a2865[_0xc139('0x34')]['fields']));_0x392986['attributes']=_0x392986['attributes'][_0xc139('0x3a')]?_0x392986['attributes']:_0x560aac['model'];_0x392986['order']=qs[_0xc139('0x3d')](_0x2a2865['query'][_0xc139('0x3d')]);_0x392986[_0xc139('0x3e')]=qs[_0xc139('0x36')](_['pick'](_0x2a2865[_0xc139('0x34')],_0x560aac[_0xc139('0x36')]));if(_0x2a2865[_0xc139('0x34')][_0xc139('0x40')]){_0x392986[_0xc139('0x3e')]=_[_0xc139('0x42')](_0x392986[_0xc139('0x3e')],{'$or':_[_0xc139('0x33')](_0x392986[_0xc139('0x38')],function(_0x342289){var _0x25d3d2={};_0x25d3d2[_0x342289]={'$like':'%'+_0x2a2865[_0xc139('0x34')][_0xc139('0x40')]+'%'};return _0x25d3d2;})});}_0x392986=_[_0xc139('0x42')]({},_0x392986,_0x2a2865['options']);return _0x446e4c[_0xc139('0x4e')](_0x392986);}})[_0xc139('0x43')](function(_0x3bfa42){if(_0x3bfa42){_0x236e2f=_0x3bfa42[_0xc139('0x3a')];if(!_0x2a2865[_0xc139('0x34')][_0xc139('0x3b')]('nolimit')){_0x392986[_0xc139('0x21')]=qs[_0xc139('0x21')](_0x2a2865['query'][_0xc139('0x21')]);_0x392986[_0xc139('0x1f')]=qs['offset'](_0x2a2865[_0xc139('0x34')][_0xc139('0x1f')]);}return _0x446e4c[_0xc139('0x4e')](_0x392986);}})[_0xc139('0x43')](function(_0x1bbeb4){if(_0x1bbeb4){return _0x1bbeb4?{'count':_0x236e2f,'rows':_0x1bbeb4}:null;}})[_0xc139('0x43')](respondWithResult(_0x2b5bc7,null))['catch'](handleError(_0x2b5bc7,null));};exports[_0xc139('0x50')]=function(_0x5771c2,_0xe1e0c7,_0x49f742){if(_0x5771c2['body']['id']){delete _0x5771c2['body']['id'];}return db[_0xc139('0x2d')][_0xc139('0x4f')]({'where':{'id':_0x5771c2[_0xc139('0x49')]['id']}})[_0xc139('0x43')](handleEntityNotFound(_0xe1e0c7,null))[_0xc139('0x43')](function(_0x3da03f){if(_0x3da03f){_0x5771c2[_0xc139('0x4d')][_0xc139('0x51')]=_0x3da03f['id'];_0x5771c2[_0xc139('0x4d')][_0xc139('0x52')]=integrations[_0xc139('0x53')](_0x5771c2[_0xc139('0x4d')]['channel'],_0x5771c2[_0xc139('0x4d')][_0xc139('0x30')]);_0x5771c2[_0xc139('0x4d')][_0xc139('0x54')]=integrations['getDescriptions'](_0x5771c2[_0xc139('0x4d')]['channel'],_0x5771c2[_0xc139('0x4d')][_0xc139('0x30')]);return db['VtigerConfiguration']['create'](_0x5771c2[_0xc139('0x4d')],{'include':[{'model':db[_0xc139('0x55')],'as':_0xc139('0x52')},{'model':db[_0xc139('0x55')],'as':_0xc139('0x54')}]});}return null;})[_0xc139('0x43')](respondWithResult(_0xe1e0c7,null))[_0xc139('0x47')](handleError(_0xe1e0c7,null));};var md5=require(_0xc139('0x56'));exports['getFields']=function(_0x175395,_0x4ced8b,_0x49c15c){var _0x8431fb=null;var _0x1e1bdc=null;var _0x37f548=null;var _0x5d0474=null;var _0x4c8002='';return db[_0xc139('0x2d')][_0xc139('0x4f')]({'where':{'id':_0x175395[_0xc139('0x49')]['id']},'attributes':['id',_0xc139('0x2a'),'username','description',_0xc139('0x57'),_0xc139('0x58'),_0xc139('0x59'),_0xc139('0x5a')]})[_0xc139('0x43')](handleEntityNotFound(_0x4ced8b,null))[_0xc139('0x43')](function(_0x1e3e8b){if(_0x1e3e8b){_0x8431fb=_0x1e3e8b[_0xc139('0x5b')];_0x1e1bdc=_0x1e3e8b[_0xc139('0x5a')];_0x37f548=_0x1e3e8b[_0xc139('0x57')];_0x4c8002=_0x1e3e8b[_0xc139('0x58')];var _0x448054=_0x4c8002[_0xc139('0x5c')](-0x1);if(_0x448054==='/'){_0x4c8002=_0x4c8002[_0xc139('0x5d')](0x0,_0x4c8002[_0xc139('0x5e')](_0x448054));}_0x5d0474=util[_0xc139('0x5f')](_0xc139('0x60'),_0x4c8002);var _0x5fff76={'method':'GET','uri':_0x5d0474,'qs':{'operation':_0xc139('0x61'),'username':_0x1e3e8b[_0xc139('0x5b')]},'json':!![]};return rp(_0x5fff76);}})[_0xc139('0x43')](function(_0x442189){if(_0x442189['success']){var _0x5a366e={'method':'POST','uri':_0x5d0474,'form':{'operation':_0xc139('0x62'),'username':_0x8431fb,'accessKey':md5(_0x442189[_0xc139('0x63')][_0xc139('0x64')]+_0x1e1bdc)},'json':!![]};return rp(_0x5a366e);}})[_0xc139('0x43')](function(_0x34e586){if(_0x34e586['success']){var _0x2716b0={'method':_0xc139('0x65'),'uri':_0x5d0474,'qs':{'operation':_0xc139('0x66'),'username':_0x8431fb,'sessionName':_0x34e586[_0xc139('0x63')]['sessionName'],'elementType':_0x37f548},'json':!![]};return rp(_0x2716b0);}})[_0xc139('0x43')](function(_0x368481){if(_0x368481[_0xc139('0x67')]){var _0x3bc3e7=[_0xc139('0x68'),_0xc139('0x69'),_0xc139('0x6a')];_[_0xc139('0x6b')](_0x368481[_0xc139('0x63')][_0xc139('0x39')],function(_0x5adcf1){return _0x3bc3e7['includes'](_0x5adcf1[_0xc139('0x30')][_0xc139('0x2a')]);});_[_0xc139('0x6b')](_0x368481[_0xc139('0x63')][_0xc139('0x39')],function(_0x2b3262){return _0x2b3262['editable']==='false';});return{'count':_0x368481[_0xc139('0x63')][_0xc139('0x39')][_0xc139('0x3a')],'rows':_[_0xc139('0x33')](_0x368481['result'][_0xc139('0x39')],function(_0x1ffc67){return{'id':_0x1ffc67[_0xc139('0x2a')],'name':_0x1ffc67[_0xc139('0x6c')],'custom':_[_0xc139('0x6d')](_0x1ffc67[_0xc139('0x2a')],_0xc139('0x6e'))?!![]:![],'options':_0x1ffc67[_0xc139('0x30')][_0xc139('0x2a')]===_0xc139('0x6f')&&_0x1ffc67[_0xc139('0x30')]['picklistValues'][_0xc139('0x3a')]>0x0?_[_0xc139('0x33')](_0x1ffc67[_0xc139('0x30')][_0xc139('0x70')],function(_0x48720b){return{'name':_0x48720b[_0xc139('0x6c')],'value':_0x48720b['value']};}):[]};})};}})[_0xc139('0x43')](respondWithResult(_0x4ced8b,null))[_0xc139('0x47')](function(_0x54d61d){console['log'](_0xc139('0x71')+_0x54d61d);var _0x1c2e4b=_0x175395[_0xc139('0x34')][_0xc139('0x72')]?0x1f4:_0x54d61d[_0xc139('0x73')]||0x1f4;logger[_0xc139('0x28')](_0xc139('0x74'),_0xc139('0x75'),_0x1c2e4b,JSON[_0xc139('0x76')](_0x54d61d));delete _0x54d61d[_0xc139('0x2a')];if(_0x1c2e4b===0x191){_0x1c2e4b=0x190;}_0x4ced8b[_0xc139('0x1e')](_0x1c2e4b)[_0xc139('0x2b')](_0x175395[_0xc139('0x34')]['test']?{'message':_0xc139('0x77'),'statusCode':_0x54d61d[_0xc139('0x73')]}:_0x54d61d);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 3c5aa78..112b74a 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 _0x1818=['VtigerAccount','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0x1818,0x19b));var _0x8181=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x1818[_0x28394f];return _0x2618d2;};'use strict';var _=require('lodash');var util=require(_0x8181('0x0'));var logger=require(_0x8181('0x1'))(_0x8181('0x2'));var moment=require('moment');var BPromise=require(_0x8181('0x3'));var rp=require(_0x8181('0x4'));var fs=require('fs');var path=require(_0x8181('0x5'));var rimraf=require(_0x8181('0x6'));var config=require(_0x8181('0x7'));var attributes=require(_0x8181('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2b628f,_0x381fa4){return _0x2b628f['define'](_0x8181('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad74=['bluebird','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment'];(function(_0x4ccfbc,_0x353f7b){var _0x5315ff=function(_0x4115f1){while(--_0x4115f1){_0x4ccfbc['push'](_0x4ccfbc['shift']());}};_0x5315ff(++_0x353f7b);}(_0xad74,0x106));var _0x4ad7=function(_0x55f9af,_0xfd306d){_0x55f9af=_0x55f9af-0x0;var _0x286fad=_0xad74[_0x55f9af];return _0x286fad;};'use strict';var _=require(_0x4ad7('0x0'));var util=require('util');var logger=require(_0x4ad7('0x1'))(_0x4ad7('0x2'));var moment=require(_0x4ad7('0x3'));var BPromise=require(_0x4ad7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ad7('0x5'));var rimraf=require(_0x4ad7('0x6'));var config=require(_0x4ad7('0x7'));var attributes=require(_0x4ad7('0x8'));var integrations=require(_0x4ad7('0x9'));module[_0x4ad7('0xa')]=function(_0x1e5c30,_0x156ae9){return _0x1e5c30[_0x4ad7('0xb')](_0x4ad7('0xc'),attributes,{'tableName':_0x4ad7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 8c5549b..bbd2c82 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 _0x065e=['request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','VtigerAccount,\x20%s,\x20%s','message','result','GetVtigerAccount','VtigerAccount','findAll','options','attributes','limit','include','map','model','find','ShowVtigerAccount','catch','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info'];(function(_0x588f7c,_0x90f955){var _0x3fab30=function(_0x5568b6){while(--_0x5568b6){_0x588f7c['push'](_0x588f7c['shift']());}};_0x3fab30(++_0x90f955);}(_0x065e,0x1a7));var _0xe065=function(_0x4d65e8,_0x5e81ad){_0x4d65e8=_0x4d65e8-0x0;var _0x3cb43f=_0x065e[_0x4d65e8];return _0x3cb43f;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe065('0x1'));var fs=require('fs');var Redis=require(_0xe065('0x2'));var db=require(_0xe065('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe065('0x4'));var config=require(_0xe065('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xe065('0x6')][_0xe065('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x189d72,_0x52403a,_0x267122){return new BPromise(function(_0x5afbd4,_0x273e22){return client[_0xe065('0x8')](_0x189d72,_0x267122)[_0xe065('0x9')](function(_0x114497){logger[_0xe065('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x52403a,_0xe065('0xb'));logger[_0xe065('0xc')](_0xe065('0xd'),_0x52403a,_0xe065('0xb'),JSON[_0xe065('0xe')](_0x114497));if(_0x114497[_0xe065('0xf')]){if(_0x114497['error']['code']===0x1f4){logger[_0xe065('0xf')](_0xe065('0x10'),_0x52403a,_0x114497[_0xe065('0xf')]['message']);return _0x273e22(_0x114497[_0xe065('0xf')][_0xe065('0x11')]);}logger[_0xe065('0xf')](_0xe065('0x10'),_0x52403a,_0x114497[_0xe065('0xf')]['message']);return _0x5afbd4(_0x114497[_0xe065('0xf')][_0xe065('0x11')]);}else{logger[_0xe065('0xa')](_0xe065('0x10'),_0x52403a,_0xe065('0xb'));_0x5afbd4(_0x114497[_0xe065('0x12')][_0xe065('0x11')]);}})['catch'](function(_0x1ba88d){logger[_0xe065('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x52403a,_0x1ba88d);_0x273e22(_0x1ba88d);});});}exports[_0xe065('0x13')]=function(_0x1d2f7a){var _0x397f05=this;return new Promise(function(_0x14c97c,_0x1e7177){return db[_0xe065('0x14')][_0xe065('0x15')]({'raw':_0x1d2f7a['options']?_0x1d2f7a[_0xe065('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')]['where']||null:null,'attributes':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a['options'][_0xe065('0x17')]||null:null,'limit':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')][_0xe065('0x18')]||null:null,'include':_0x1d2f7a[_0xe065('0x16')]?_0x1d2f7a[_0xe065('0x16')][_0xe065('0x19')]?_[_0xe065('0x1a')](_0x1d2f7a[_0xe065('0x16')]['include'],function(_0x7208af){return{'model':db[_0x7208af[_0xe065('0x1b')]],'as':_0x7208af['as'],'attributes':_0x7208af[_0xe065('0x17')],'include':_0x7208af[_0xe065('0x19')]?_['map'](_0x7208af['include'],function(_0x164965){return{'model':db[_0x164965['model']],'as':_0x164965['as'],'attributes':_0x164965[_0xe065('0x17')],'include':_0x164965[_0xe065('0x19')]?_[_0xe065('0x1a')](_0x164965[_0xe065('0x19')],function(_0x418731){return{'model':db[_0x418731[_0xe065('0x1b')]],'as':_0x418731['as'],'attributes':_0x418731[_0xe065('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe065('0x9')](function(_0x52cd9c){logger['info'](_0xe065('0x13'),_0x1d2f7a);logger[_0xe065('0xc')](_0xe065('0x13'),_0x1d2f7a,JSON[_0xe065('0xe')](_0x52cd9c));_0x14c97c(_0x52cd9c);})['catch'](function(_0x23f573){logger['error']('GetVtigerAccount',_0x23f573[_0xe065('0x11')],_0x1d2f7a);_0x1e7177(_0x397f05[_0xe065('0xf')](0x1f4,_0x23f573[_0xe065('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x883747){var _0x59b915=this;return new Promise(function(_0x12679d,_0x46db7e){return db[_0xe065('0x14')][_0xe065('0x1c')]({'raw':_0x883747['options']?_0x883747[_0xe065('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x883747[_0xe065('0x16')]?_0x883747[_0xe065('0x16')]['where']||null:null,'attributes':_0x883747[_0xe065('0x16')]?_0x883747['options'][_0xe065('0x17')]||null:null,'include':_0x883747['options']?_0x883747[_0xe065('0x16')][_0xe065('0x19')]?_[_0xe065('0x1a')](_0x883747[_0xe065('0x16')]['include'],function(_0x1fe1dc){return{'model':db[_0x1fe1dc[_0xe065('0x1b')]],'as':_0x1fe1dc['as'],'attributes':_0x1fe1dc[_0xe065('0x17')],'include':_0x1fe1dc[_0xe065('0x19')]?_[_0xe065('0x1a')](_0x1fe1dc[_0xe065('0x19')],function(_0x4b822a){return{'model':db[_0x4b822a[_0xe065('0x1b')]],'as':_0x4b822a['as'],'attributes':_0x4b822a[_0xe065('0x17')],'include':_0x4b822a['include']?_[_0xe065('0x1a')](_0x4b822a[_0xe065('0x19')],function(_0x5afc23){return{'model':db[_0x5afc23[_0xe065('0x1b')]],'as':_0x5afc23['as'],'attributes':_0x5afc23[_0xe065('0x17')]};}):[]};}):[]};}):[]:[]})[_0xe065('0x9')](function(_0x35135f){logger['info'](_0xe065('0x1d'),_0x883747);logger['debug'](_0xe065('0x1d'),_0x883747,JSON[_0xe065('0xe')](_0x35135f));_0x12679d(_0x35135f);})[_0xe065('0x1e')](function(_0xcceb12){logger[_0xe065('0xf')](_0xe065('0x1d'),_0xcceb12['message'],_0x883747);_0x46db7e(_0x59b915[_0xe065('0xf')](0x1f4,_0xcceb12[_0xe065('0x11')]));});});}; \ No newline at end of file +var _0xb58b=['model','map','debug','catch','ShowVtigerAccount','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../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','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','limit','include'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4f98b8,_0x3b077d){_0x4f98b8=_0x4f98b8-0x0;var _0x1e64a1=_0xb58b[_0x4f98b8];return _0x1e64a1;};'use strict';var _=require('lodash');var util=require(_0xbb58('0x0'));var moment=require(_0xbb58('0x1'));var BPromise=require(_0xbb58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb58('0x3'));var db=require(_0xbb58('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb58('0x5'))('rpc');var config=require(_0xbb58('0x6'));var jayson=require(_0xbb58('0x7'));var client=jayson[_0xbb58('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27cbda,_0x323066,_0xe874f2){return new BPromise(function(_0x5d7fe8,_0xd94f1){return client[_0xbb58('0x9')](_0x27cbda,_0xe874f2)[_0xbb58('0xa')](function(_0x36ca50){logger[_0xbb58('0xb')](_0xbb58('0xc'),_0x323066,_0xbb58('0xd'));logger['debug'](_0xbb58('0xe'),_0x323066,'request\x20sent',JSON[_0xbb58('0xf')](_0x36ca50));if(_0x36ca50[_0xbb58('0x10')]){if(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x11')]===0x1f4){logger['error'](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0xd94f1(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}logger[_0xbb58('0x10')](_0xbb58('0xc'),_0x323066,_0x36ca50[_0xbb58('0x10')]['message']);return _0x5d7fe8(_0x36ca50[_0xbb58('0x10')][_0xbb58('0x12')]);}else{logger['info']('VtigerAccount,\x20%s,\x20%s',_0x323066,_0xbb58('0xd'));_0x5d7fe8(_0x36ca50[_0xbb58('0x13')][_0xbb58('0x12')]);}})['catch'](function(_0x5edc97){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x323066,_0x5edc97);_0xd94f1(_0x5edc97);});});}exports[_0xbb58('0x14')]=function(_0x3134ea){var _0x48f3e0=this;return new Promise(function(_0xbee66,_0x497653){return db[_0xbb58('0x15')][_0xbb58('0x16')]({'raw':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x18')]===undefined?!![]:![]:!![],'where':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')]['where']||null:null,'attributes':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x19')]||null:null,'limit':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x1a')]||null:null,'include':_0x3134ea[_0xbb58('0x17')]?_0x3134ea[_0xbb58('0x17')][_0xbb58('0x1b')]?_['map'](_0x3134ea[_0xbb58('0x17')]['include'],function(_0x21964d){return{'model':db[_0x21964d[_0xbb58('0x1c')]],'as':_0x21964d['as'],'attributes':_0x21964d[_0xbb58('0x19')],'include':_0x21964d[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x21964d[_0xbb58('0x1b')],function(_0x2d556a){return{'model':db[_0x2d556a[_0xbb58('0x1c')]],'as':_0x2d556a['as'],'attributes':_0x2d556a['attributes'],'include':_0x2d556a[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x2d556a[_0xbb58('0x1b')],function(_0x129094){return{'model':db[_0x129094[_0xbb58('0x1c')]],'as':_0x129094['as'],'attributes':_0x129094[_0xbb58('0x19')]};}):[]};}):[]};}):[]:[]})[_0xbb58('0xa')](function(_0x2ce7c3){logger[_0xbb58('0xb')](_0xbb58('0x14'),_0x3134ea);logger[_0xbb58('0x1e')](_0xbb58('0x14'),_0x3134ea,JSON[_0xbb58('0xf')](_0x2ce7c3));_0xbee66(_0x2ce7c3);})[_0xbb58('0x1f')](function(_0x3559b6){logger['error'](_0xbb58('0x14'),_0x3559b6[_0xbb58('0x12')],_0x3134ea);_0x497653(_0x48f3e0[_0xbb58('0x10')](0x1f4,_0x3559b6[_0xbb58('0x12')]));});});};exports[_0xbb58('0x20')]=function(_0x9d379f){var _0x1ba526=this;return new Promise(function(_0x643e0e,_0x3f8db3){return db['VtigerAccount'][_0xbb58('0x21')]({'raw':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x18')]===undefined?!![]:![]:!![],'where':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x22')]||null:null,'attributes':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x19')]||null:null,'include':_0x9d379f[_0xbb58('0x17')]?_0x9d379f[_0xbb58('0x17')][_0xbb58('0x1b')]?_['map'](_0x9d379f['options']['include'],function(_0x1def9f){return{'model':db[_0x1def9f[_0xbb58('0x1c')]],'as':_0x1def9f['as'],'attributes':_0x1def9f[_0xbb58('0x19')],'include':_0x1def9f[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x1def9f[_0xbb58('0x1b')],function(_0x3093bf){return{'model':db[_0x3093bf[_0xbb58('0x1c')]],'as':_0x3093bf['as'],'attributes':_0x3093bf['attributes'],'include':_0x3093bf[_0xbb58('0x1b')]?_[_0xbb58('0x1d')](_0x3093bf['include'],function(_0x33ec68){return{'model':db[_0x33ec68['model']],'as':_0x33ec68['as'],'attributes':_0x33ec68[_0xbb58('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x86372e){logger[_0xbb58('0xb')]('ShowVtigerAccount',_0x9d379f);logger[_0xbb58('0x1e')](_0xbb58('0x20'),_0x9d379f,JSON[_0xbb58('0xf')](_0x86372e));_0x643e0e(_0x86372e);})[_0xbb58('0x1f')](function(_0x1b86a6){logger[_0xbb58('0x10')](_0xbb58('0x20'),_0x1b86a6[_0xbb58('0x12')],_0x9d379f);_0x3f8db3(_0x1ba526['error'](0x1f4,_0x1b86a6[_0xbb58('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index d471615..e176183 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 _0x0e9f=['get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','multer','util','express','Router','../../config/environment','./intVtigerConfiguration.controller'];(function(_0x396543,_0x49155f){var _0x124f7d=function(_0x177404){while(--_0x177404){_0x396543['push'](_0x396543['shift']());}};_0x124f7d(++_0x49155f);}(_0x0e9f,0xf6));var _0xf0e9=function(_0xb2f0d4,_0x2a8baf){_0xb2f0d4=_0xb2f0d4-0x0;var _0x2581eb=_0x0e9f[_0xb2f0d4];return _0x2581eb;};'use strict';var multer=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf0e9('0x2'));var router=express[_0xf0e9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf0e9('0x4'));var controller=require(_0xf0e9('0x5'));router[_0xf0e9('0x6')]('/',auth[_0xf0e9('0x7')](),controller[_0xf0e9('0x8')]);router['get'](_0xf0e9('0x9'),auth['isAuthenticated'](),controller[_0xf0e9('0xa')]);router['get'](_0xf0e9('0xb'),auth[_0xf0e9('0x7')](),controller[_0xf0e9('0xc')]);router[_0xf0e9('0x6')](_0xf0e9('0xd'),auth[_0xf0e9('0x7')](),controller['getSubjects']);router[_0xf0e9('0x6')](_0xf0e9('0xe'),auth['isAuthenticated'](),controller[_0xf0e9('0xf')]);router[_0xf0e9('0x10')]('/',auth[_0xf0e9('0x7')](),controller[_0xf0e9('0x11')]);router[_0xf0e9('0x12')](_0xf0e9('0x9'),auth['isAuthenticated'](),controller[_0xf0e9('0x13')]);router[_0xf0e9('0x14')]('/:id',auth[_0xf0e9('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x9110=['get','/:id','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x24a20d,_0x5b08cb){var _0x13e76f=function(_0x2593b7){while(--_0x2593b7){_0x24a20d['push'](_0x24a20d['shift']());}};_0x13e76f(++_0x5b08cb);}(_0x9110,0x175));var _0x0911=function(_0x2c4cee,_0xed54d6){_0x2c4cee=_0x2c4cee-0x0;var _0x4cad54=_0x9110[_0x2c4cee];return _0x4cad54;};'use strict';var multer=require(_0x0911('0x0'));var util=require('util');var path=require(_0x0911('0x1'));var timeout=require('connect-timeout');var express=require(_0x0911('0x2'));var router=express[_0x0911('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0911('0x4'));var interaction=require(_0x0911('0x5'));var config=require(_0x0911('0x6'));var controller=require('./intVtigerConfiguration.controller');router[_0x0911('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0911('0x7')](_0x0911('0x8'),auth[_0x0911('0x9')](),controller['show']);router[_0x0911('0x7')]('/:id/fields',auth[_0x0911('0x9')](),controller['getFields']);router[_0x0911('0x7')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x0911('0xa')]);router[_0x0911('0x7')](_0x0911('0xb'),auth[_0x0911('0x9')](),controller[_0x0911('0xc')]);router[_0x0911('0xd')]('/',auth[_0x0911('0x9')](),controller[_0x0911('0xe')]);router[_0x0911('0xf')](_0x0911('0x8'),auth['isAuthenticated'](),controller[_0x0911('0x10')]);router[_0x0911('0x11')](_0x0911('0x8'),auth['isAuthenticated'](),controller[_0x0911('0x12')]);module[_0x0911('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index ea05c03..85b39a4 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 _0xb296=['STRING','exports'];(function(_0x247b59,_0x4eb44b){var _0x4b8714=function(_0x20716d){while(--_0x20716d){_0x247b59['push'](_0x247b59['shift']());}};_0x4b8714(++_0x4eb44b);}(_0xb296,0xc3));var _0x6b29=function(_0x4518f5,_0x1e41a9){_0x4518f5=_0x4518f5-0x0;var _0x26381e=_0xb296[_0x4518f5];return _0x26381e;};'use strict';var Sequelize=require('sequelize');module[_0x6b29('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6b29('0x1')]}}; \ No newline at end of file +var _0x52c9=['exports','STRING','sequelize'];(function(_0x4a1e96,_0x143e6b){var _0x5acea9=function(_0x1e1677){while(--_0x1e1677){_0x4a1e96['push'](_0x4a1e96['shift']());}};_0x5acea9(++_0x143e6b);}(_0x52c9,0xe3));var _0x952c=function(_0x4ac13f,_0x351e32){_0x4ac13f=_0x4ac13f-0x0;var _0x310041=_0x52c9[_0x4ac13f];return _0x310041;};'use strict';var Sequelize=require(_0x952c('0x0'));module[_0x952c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x952c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 1fa2727..b3ff712 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 _0x7edc=['undefined','count','offset','limit','Content-Range','json','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','merge','filter','includeAll','findAll','rows','intersection','include','options','body','find','params','catch','getFields','findOne','VtigerField','rawAttributes','nolimit','getSubjects','pick','getDescriptions','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x1fc091,_0x4a43a0){var _0x22a409=function(_0x593407){while(--_0x593407){_0x1fc091['push'](_0x1fc091['shift']());}};_0x22a409(++_0x4a43a0);}(_0x7edc,0x7e));var _0xc7ed=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x7edc[_0x2085f3];return _0x384e3c;};'use strict';var emlformat=require(_0xc7ed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc7ed('0x1'));var rp=require(_0xc7ed('0x2'));var moment=require(_0xc7ed('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc7ed('0x4'));var path=require(_0xc7ed('0x5'));var sox=require(_0xc7ed('0x6'));var csv=require(_0xc7ed('0x7'));var ejs=require(_0xc7ed('0x8'));var fs=require('fs');var fs_extra=require(_0xc7ed('0x9'));var _=require(_0xc7ed('0xa'));var squel=require(_0xc7ed('0xb'));var crypto=require(_0xc7ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc7ed('0xd'));var toCsv=require(_0xc7ed('0x7'));var querystring=require(_0xc7ed('0xe'));var Papa=require(_0xc7ed('0xf'));var Redis=require(_0xc7ed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc7ed('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7ed('0x12'));var logger=require('../../config/logger')(_0xc7ed('0x13'));var utils=require(_0xc7ed('0x14'));var config=require(_0xc7ed('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc7ed('0x16'))['db'];function respondWithStatusCode(_0x5926f4,_0x1db270){_0x1db270=_0x1db270||0xcc;return function(_0x5d6e05){if(_0x5d6e05){return _0x5926f4[_0xc7ed('0x17')](_0x1db270);}return _0x5926f4[_0xc7ed('0x18')](_0x1db270)[_0xc7ed('0x19')]();};}function respondWithResult(_0x59674d,_0x27c0d2){_0x27c0d2=_0x27c0d2||0xc8;return function(_0x43474b){if(_0x43474b){return _0x59674d[_0xc7ed('0x18')](_0x27c0d2)['json'](_0x43474b);}};}function respondWithFilteredResult(_0x1dea6d,_0x535bab){return function(_0x8f897b){if(_0x8f897b){var _0x1734c2=typeof _0x535bab['offset']===_0xc7ed('0x1a')&&typeof _0x535bab['limit']===_0xc7ed('0x1a');var _0x463059=_0x8f897b[_0xc7ed('0x1b')];var _0x402cec=_0x1734c2?0x0:_0x535bab[_0xc7ed('0x1c')];var _0x2de273=_0x1734c2?_0x8f897b[_0xc7ed('0x1b')]:_0x535bab[_0xc7ed('0x1c')]+_0x535bab[_0xc7ed('0x1d')];var _0x5bd358;if(_0x2de273>=_0x463059){_0x2de273=_0x463059;_0x5bd358=0xc8;}else{_0x5bd358=0xce;}_0x1dea6d[_0xc7ed('0x18')](_0x5bd358);return _0x1dea6d['set'](_0xc7ed('0x1e'),_0x402cec+'-'+_0x2de273+'/'+_0x463059)[_0xc7ed('0x1f')](_0x8f897b);}return null;};}function patchUpdates(_0xcfc711){return function(_0x3c150e){try{jsonpatch['apply'](_0x3c150e,_0xcfc711,!![]);}catch(_0xce6fba){return BPromise['reject'](_0xce6fba);}return _0x3c150e['save']();};}function saveUpdates(_0x30bcff,_0x2baae7){return function(_0x1c1121){if(_0x1c1121){return _0x1c1121[_0xc7ed('0x20')](_0x30bcff)[_0xc7ed('0x21')](function(_0x2a6919){return _0x2a6919;});}return null;};}function removeEntity(_0x52b6f4,_0x50a9d0){return function(_0x3fccb2){if(_0x3fccb2){return _0x3fccb2[_0xc7ed('0x22')]()[_0xc7ed('0x21')](function(){_0x52b6f4[_0xc7ed('0x18')](0xcc)[_0xc7ed('0x19')]();});}};}function handleEntityNotFound(_0x4214cc,_0x43082){return function(_0xd96f1c){if(!_0xd96f1c){_0x4214cc[_0xc7ed('0x17')](0x194);}return _0xd96f1c;};}function handleError(_0x52803a,_0x5e71b6){_0x5e71b6=_0x5e71b6||0x1f4;return function(_0x435218){logger[_0xc7ed('0x23')](_0x435218[_0xc7ed('0x24')]);if(_0x435218[_0xc7ed('0x25')]){delete _0x435218[_0xc7ed('0x25')];}_0x52803a[_0xc7ed('0x18')](_0x5e71b6)[_0xc7ed('0x26')](_0x435218);};}exports[_0xc7ed('0x27')]=function(_0x245b6f,_0xacfe0f){var _0x92ce4e={},_0x1ba7a1={},_0x1ada66={'count':0x0,'rows':[]};var _0x774b8c=_[_0xc7ed('0x28')](db[_0xc7ed('0x29')]['rawAttributes'],function(_0x2f8bbd){return{'name':_0x2f8bbd[_0xc7ed('0x2a')],'type':_0x2f8bbd[_0xc7ed('0x2b')][_0xc7ed('0x2c')]};});_0x1ba7a1['model']=_[_0xc7ed('0x28')](_0x774b8c,_0xc7ed('0x25'));_0x1ba7a1[_0xc7ed('0x2d')]=_[_0xc7ed('0x2e')](_0x245b6f['query']);_0x1ba7a1[_0xc7ed('0x2f')]=_['intersection'](_0x1ba7a1[_0xc7ed('0x30')],_0x1ba7a1[_0xc7ed('0x2d')]);_0x92ce4e['attributes']=_['intersection'](_0x1ba7a1[_0xc7ed('0x30')],qs[_0xc7ed('0x31')](_0x245b6f['query']['fields']));_0x92ce4e['attributes']=_0x92ce4e[_0xc7ed('0x32')][_0xc7ed('0x33')]?_0x92ce4e['attributes']:_0x1ba7a1[_0xc7ed('0x30')];if(!_0x245b6f['query'][_0xc7ed('0x34')]('nolimit')){_0x92ce4e[_0xc7ed('0x1d')]=qs[_0xc7ed('0x1d')](_0x245b6f[_0xc7ed('0x2d')]['limit']);_0x92ce4e[_0xc7ed('0x1c')]=qs['offset'](_0x245b6f[_0xc7ed('0x2d')]['offset']);}_0x92ce4e[_0xc7ed('0x35')]=qs[_0xc7ed('0x36')](_0x245b6f[_0xc7ed('0x2d')][_0xc7ed('0x36')]);_0x92ce4e[_0xc7ed('0x37')]=qs[_0xc7ed('0x2f')](_['pick'](_0x245b6f['query'],_0x1ba7a1['filters']),_0x774b8c);if(_0x245b6f['query']['filter']){_0x92ce4e[_0xc7ed('0x37')]=_[_0xc7ed('0x38')](_0x92ce4e[_0xc7ed('0x37')],{'$or':_[_0xc7ed('0x28')](_0x774b8c,function(_0x864365){if(_0x864365[_0xc7ed('0x2b')]!=='VIRTUAL'){var _0x3106c5={};_0x3106c5[_0x864365[_0xc7ed('0x25')]]={'$like':'%'+_0x245b6f[_0xc7ed('0x2d')][_0xc7ed('0x39')]+'%'};return _0x3106c5;}})});}_0x92ce4e=_[_0xc7ed('0x38')]({},_0x92ce4e,_0x245b6f['options']);var _0x3af6bd={'where':_0x92ce4e['where']};return db['VtigerConfiguration'][_0xc7ed('0x1b')](_0x3af6bd)[_0xc7ed('0x21')](function(_0x3ab415){_0x1ada66[_0xc7ed('0x1b')]=_0x3ab415;if(_0x245b6f['query'][_0xc7ed('0x3a')]){_0x92ce4e['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xc7ed('0x3b')](_0x92ce4e);})[_0xc7ed('0x21')](function(_0x56a901){_0x1ada66[_0xc7ed('0x3c')]=_0x56a901;return _0x1ada66;})[_0xc7ed('0x21')](respondWithFilteredResult(_0xacfe0f,_0x92ce4e))['catch'](handleError(_0xacfe0f,null));};exports['show']=function(_0x11c896,_0x4457b4){var _0x27b7d1={'raw':![],'where':{'id':_0x11c896['params']['id']}},_0x109453={};_0x109453[_0xc7ed('0x30')]=_['keys'](db['VtigerConfiguration']['rawAttributes']);_0x109453['query']=_['keys'](_0x11c896[_0xc7ed('0x2d')]);_0x109453[_0xc7ed('0x2f')]=_[_0xc7ed('0x3d')](_0x109453[_0xc7ed('0x30')],_0x109453[_0xc7ed('0x2d')]);_0x27b7d1[_0xc7ed('0x32')]=_[_0xc7ed('0x3d')](_0x109453[_0xc7ed('0x30')],qs['fields'](_0x11c896['query'][_0xc7ed('0x31')]));_0x27b7d1[_0xc7ed('0x32')]=_0x27b7d1[_0xc7ed('0x32')][_0xc7ed('0x33')]?_0x27b7d1[_0xc7ed('0x32')]:_0x109453[_0xc7ed('0x30')];if(_0x11c896[_0xc7ed('0x2d')][_0xc7ed('0x3a')]){_0x27b7d1[_0xc7ed('0x3e')]=[{'all':!![]}];}_0x27b7d1=_[_0xc7ed('0x38')]({},_0x27b7d1,_0x11c896[_0xc7ed('0x3f')]);return db[_0xc7ed('0x29')]['find'](_0x27b7d1)['then'](handleEntityNotFound(_0x4457b4,null))['then'](respondWithResult(_0x4457b4,null))['catch'](handleError(_0x4457b4,null));};exports['create']=function(_0x5d2c54,_0x3eacc2){return db[_0xc7ed('0x29')]['create'](_0x5d2c54[_0xc7ed('0x40')],{})['then'](respondWithResult(_0x3eacc2,0xc9))['catch'](handleError(_0x3eacc2,null));};exports[_0xc7ed('0x20')]=function(_0x371b5c,_0x22e893){if(_0x371b5c[_0xc7ed('0x40')]['id']){delete _0x371b5c[_0xc7ed('0x40')]['id'];}return db[_0xc7ed('0x29')][_0xc7ed('0x41')]({'where':{'id':_0x371b5c[_0xc7ed('0x42')]['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x22e893,null))[_0xc7ed('0x21')](saveUpdates(_0x371b5c['body'],null))[_0xc7ed('0x21')](respondWithResult(_0x22e893,null))['catch'](handleError(_0x22e893,null));};exports[_0xc7ed('0x22')]=function(_0x347aeb,_0x185a29){return db['VtigerConfiguration']['find']({'where':{'id':_0x347aeb['params']['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x185a29,null))[_0xc7ed('0x21')](removeEntity(_0x185a29,null))[_0xc7ed('0x43')](handleError(_0x185a29,null));};exports[_0xc7ed('0x44')]=function(_0x48ae28,_0x1c06e5,_0x328815){var _0x163d2d={};var _0x5d30aa={};var _0x812023;var _0x127f8c;return db[_0xc7ed('0x29')][_0xc7ed('0x45')]({'where':{'id':_0x48ae28['params']['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x1c06e5,null))[_0xc7ed('0x21')](function(_0x45c2dd){if(_0x45c2dd){_0x812023=_0x45c2dd;_0x5d30aa['model']=_['keys'](db[_0xc7ed('0x46')][_0xc7ed('0x47')]);_0x5d30aa[_0xc7ed('0x2d')]=_[_0xc7ed('0x2e')](_0x48ae28[_0xc7ed('0x2d')]);_0x5d30aa['filters']=_['intersection'](_0x5d30aa[_0xc7ed('0x30')],_0x5d30aa[_0xc7ed('0x2d')]);_0x163d2d['attributes']=_[_0xc7ed('0x3d')](_0x5d30aa[_0xc7ed('0x30')],qs['fields'](_0x48ae28[_0xc7ed('0x2d')]['fields']));_0x163d2d['attributes']=_0x163d2d[_0xc7ed('0x32')][_0xc7ed('0x33')]?_0x163d2d[_0xc7ed('0x32')]:_0x5d30aa[_0xc7ed('0x30')];_0x163d2d[_0xc7ed('0x35')]=qs[_0xc7ed('0x36')](_0x48ae28[_0xc7ed('0x2d')][_0xc7ed('0x36')]);_0x163d2d[_0xc7ed('0x37')]=qs[_0xc7ed('0x2f')](_['pick'](_0x48ae28['query'],_0x5d30aa[_0xc7ed('0x2f')]));if(_0x48ae28['query'][_0xc7ed('0x39')]){_0x163d2d['where']=_['merge'](_0x163d2d['where'],{'$or':_['map'](_0x163d2d[_0xc7ed('0x32')],function(_0x2f3396){var _0x20803f={};_0x20803f[_0x2f3396]={'$like':'%'+_0x48ae28[_0xc7ed('0x2d')][_0xc7ed('0x39')]+'%'};return _0x20803f;})});}_0x163d2d=_[_0xc7ed('0x38')]({},_0x163d2d,_0x48ae28[_0xc7ed('0x3f')]);return _0x812023[_0xc7ed('0x44')](_0x163d2d);}})['then'](function(_0x130cfb){if(_0x130cfb){_0x127f8c=_0x130cfb[_0xc7ed('0x33')];if(!_0x48ae28['query']['hasOwnProperty'](_0xc7ed('0x48'))){_0x163d2d[_0xc7ed('0x1d')]=qs['limit'](_0x48ae28['query'][_0xc7ed('0x1d')]);_0x163d2d['offset']=qs['offset'](_0x48ae28[_0xc7ed('0x2d')]['offset']);}return _0x812023['getFields'](_0x163d2d);}})['then'](function(_0x33feec){if(_0x33feec){return _0x33feec?{'count':_0x127f8c,'rows':_0x33feec}:null;}})['then'](respondWithResult(_0x1c06e5,null))[_0xc7ed('0x43')](handleError(_0x1c06e5,null));};exports[_0xc7ed('0x49')]=function(_0x598e32,_0x3a3251,_0x2d49b8){var _0xb3d0a8={};var _0x53cae8={};var _0x1b798c;var _0x7ed754;return db[_0xc7ed('0x29')][_0xc7ed('0x45')]({'where':{'id':_0x598e32[_0xc7ed('0x42')]['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x3a3251,null))['then'](function(_0x2e80d1){if(_0x2e80d1){_0x1b798c=_0x2e80d1;_0x53cae8[_0xc7ed('0x30')]=_[_0xc7ed('0x2e')](db[_0xc7ed('0x46')][_0xc7ed('0x47')]);_0x53cae8[_0xc7ed('0x2d')]=_[_0xc7ed('0x2e')](_0x598e32[_0xc7ed('0x2d')]);_0x53cae8[_0xc7ed('0x2f')]=_[_0xc7ed('0x3d')](_0x53cae8['model'],_0x53cae8[_0xc7ed('0x2d')]);_0xb3d0a8[_0xc7ed('0x32')]=_['intersection'](_0x53cae8[_0xc7ed('0x30')],qs['fields'](_0x598e32[_0xc7ed('0x2d')]['fields']));_0xb3d0a8[_0xc7ed('0x32')]=_0xb3d0a8[_0xc7ed('0x32')]['length']?_0xb3d0a8[_0xc7ed('0x32')]:_0x53cae8['model'];_0xb3d0a8['order']=qs[_0xc7ed('0x36')](_0x598e32[_0xc7ed('0x2d')][_0xc7ed('0x36')]);_0xb3d0a8[_0xc7ed('0x37')]=qs[_0xc7ed('0x2f')](_['pick'](_0x598e32[_0xc7ed('0x2d')],_0x53cae8['filters']));if(_0x598e32[_0xc7ed('0x2d')][_0xc7ed('0x39')]){_0xb3d0a8[_0xc7ed('0x37')]=_['merge'](_0xb3d0a8[_0xc7ed('0x37')],{'$or':_[_0xc7ed('0x28')](_0xb3d0a8[_0xc7ed('0x32')],function(_0xe4411f){var _0x2fb945={};_0x2fb945[_0xe4411f]={'$like':'%'+_0x598e32[_0xc7ed('0x2d')][_0xc7ed('0x39')]+'%'};return _0x2fb945;})});}_0xb3d0a8=_[_0xc7ed('0x38')]({},_0xb3d0a8,_0x598e32['options']);return _0x1b798c[_0xc7ed('0x49')](_0xb3d0a8);}})['then'](function(_0x2c2701){if(_0x2c2701){_0x7ed754=_0x2c2701[_0xc7ed('0x33')];if(!_0x598e32[_0xc7ed('0x2d')]['hasOwnProperty'](_0xc7ed('0x48'))){_0xb3d0a8['limit']=qs[_0xc7ed('0x1d')](_0x598e32['query'][_0xc7ed('0x1d')]);_0xb3d0a8[_0xc7ed('0x1c')]=qs['offset'](_0x598e32[_0xc7ed('0x2d')][_0xc7ed('0x1c')]);}return _0x1b798c[_0xc7ed('0x49')](_0xb3d0a8);}})[_0xc7ed('0x21')](function(_0x31c08f){if(_0x31c08f){return _0x31c08f?{'count':_0x7ed754,'rows':_0x31c08f}:null;}})['then'](respondWithResult(_0x3a3251,null))[_0xc7ed('0x43')](handleError(_0x3a3251,null));};exports['getDescriptions']=function(_0x3b1ccb,_0x429cb3,_0x353c53){var _0x1fc993={};var _0x5221bf={};var _0x498995;var _0x20788e;return db[_0xc7ed('0x29')][_0xc7ed('0x45')]({'where':{'id':_0x3b1ccb[_0xc7ed('0x42')]['id']}})[_0xc7ed('0x21')](handleEntityNotFound(_0x429cb3,null))['then'](function(_0x47dd99){if(_0x47dd99){_0x498995=_0x47dd99;_0x5221bf[_0xc7ed('0x30')]=_[_0xc7ed('0x2e')](db[_0xc7ed('0x46')][_0xc7ed('0x47')]);_0x5221bf[_0xc7ed('0x2d')]=_['keys'](_0x3b1ccb['query']);_0x5221bf[_0xc7ed('0x2f')]=_[_0xc7ed('0x3d')](_0x5221bf['model'],_0x5221bf[_0xc7ed('0x2d')]);_0x1fc993[_0xc7ed('0x32')]=_[_0xc7ed('0x3d')](_0x5221bf['model'],qs[_0xc7ed('0x31')](_0x3b1ccb[_0xc7ed('0x2d')]['fields']));_0x1fc993[_0xc7ed('0x32')]=_0x1fc993[_0xc7ed('0x32')][_0xc7ed('0x33')]?_0x1fc993[_0xc7ed('0x32')]:_0x5221bf['model'];_0x1fc993[_0xc7ed('0x35')]=qs[_0xc7ed('0x36')](_0x3b1ccb['query'][_0xc7ed('0x36')]);_0x1fc993[_0xc7ed('0x37')]=qs[_0xc7ed('0x2f')](_[_0xc7ed('0x4a')](_0x3b1ccb[_0xc7ed('0x2d')],_0x5221bf[_0xc7ed('0x2f')]));if(_0x3b1ccb['query'][_0xc7ed('0x39')]){_0x1fc993[_0xc7ed('0x37')]=_[_0xc7ed('0x38')](_0x1fc993[_0xc7ed('0x37')],{'$or':_['map'](_0x1fc993[_0xc7ed('0x32')],function(_0x20537d){var _0x925b6f={};_0x925b6f[_0x20537d]={'$like':'%'+_0x3b1ccb[_0xc7ed('0x2d')][_0xc7ed('0x39')]+'%'};return _0x925b6f;})});}_0x1fc993=_[_0xc7ed('0x38')]({},_0x1fc993,_0x3b1ccb[_0xc7ed('0x3f')]);return _0x498995[_0xc7ed('0x4b')](_0x1fc993);}})[_0xc7ed('0x21')](function(_0x155797){if(_0x155797){_0x20788e=_0x155797[_0xc7ed('0x33')];if(!_0x3b1ccb[_0xc7ed('0x2d')][_0xc7ed('0x34')](_0xc7ed('0x48'))){_0x1fc993[_0xc7ed('0x1d')]=qs[_0xc7ed('0x1d')](_0x3b1ccb[_0xc7ed('0x2d')][_0xc7ed('0x1d')]);_0x1fc993[_0xc7ed('0x1c')]=qs[_0xc7ed('0x1c')](_0x3b1ccb[_0xc7ed('0x2d')][_0xc7ed('0x1c')]);}return _0x498995['getDescriptions'](_0x1fc993);}})['then'](function(_0x49cd2d){if(_0x49cd2d){return _0x49cd2d?{'count':_0x20788e,'rows':_0x49cd2d}:null;}})['then'](respondWithResult(_0x429cb3,null))[_0xc7ed('0x43')](handleError(_0x429cb3,null));}; \ No newline at end of file +var _0x1210=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','VtigerConfiguration','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0x1210,0x188));var _0x0121=function(_0x576d8a,_0x2d7bde){_0x576d8a=_0x576d8a-0x0;var _0x3dc3ef=_0x1210[_0x576d8a];return _0x3dc3ef;};'use strict';var emlformat=require(_0x0121('0x0'));var rimraf=require(_0x0121('0x1'));var zipdir=require(_0x0121('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0121('0x3'));var moment=require(_0x0121('0x4'));var BPromise=require(_0x0121('0x5'));var Mustache=require(_0x0121('0x6'));var util=require(_0x0121('0x7'));var path=require(_0x0121('0x8'));var sox=require(_0x0121('0x9'));var csv=require(_0x0121('0xa'));var ejs=require(_0x0121('0xb'));var fs=require('fs');var fs_extra=require(_0x0121('0xc'));var _=require(_0x0121('0xd'));var squel=require(_0x0121('0xe'));var crypto=require(_0x0121('0xf'));var jsforce=require(_0x0121('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0121('0x11'));var Papa=require(_0x0121('0x12'));var Redis=require('ioredis');var authService=require(_0x0121('0x13'));var qs=require(_0x0121('0x14'));var as=require(_0x0121('0x15'));var hardwareService=require(_0x0121('0x16'));var logger=require('../../config/logger')(_0x0121('0x17'));var utils=require(_0x0121('0x18'));var config=require(_0x0121('0x19'));var licenseUtil=require(_0x0121('0x1a'));var db=require(_0x0121('0x1b'))['db'];function respondWithStatusCode(_0x25c7b1,_0x5b41d7){_0x5b41d7=_0x5b41d7||0xcc;return function(_0x46caa7){if(_0x46caa7){return _0x25c7b1[_0x0121('0x1c')](_0x5b41d7);}return _0x25c7b1[_0x0121('0x1d')](_0x5b41d7)['end']();};}function respondWithResult(_0x4e7c9d,_0x1e8f9e){_0x1e8f9e=_0x1e8f9e||0xc8;return function(_0x3a2539){if(_0x3a2539){return _0x4e7c9d[_0x0121('0x1d')](_0x1e8f9e)['json'](_0x3a2539);}};}function respondWithFilteredResult(_0x102989,_0x28c6ea){return function(_0x511f01){if(_0x511f01){var _0x38404c=typeof _0x28c6ea[_0x0121('0x1e')]===_0x0121('0x1f')&&typeof _0x28c6ea[_0x0121('0x20')]===_0x0121('0x1f');var _0x59cded=_0x511f01[_0x0121('0x21')];var _0x4ff3fb=_0x38404c?0x0:_0x28c6ea['offset'];var _0x16a496=_0x38404c?_0x511f01[_0x0121('0x21')]:_0x28c6ea[_0x0121('0x1e')]+_0x28c6ea['limit'];var _0x461374;if(_0x16a496>=_0x59cded){_0x16a496=_0x59cded;_0x461374=0xc8;}else{_0x461374=0xce;}_0x102989[_0x0121('0x1d')](_0x461374);return _0x102989[_0x0121('0x22')]('Content-Range',_0x4ff3fb+'-'+_0x16a496+'/'+_0x59cded)[_0x0121('0x23')](_0x511f01);}return null;};}function patchUpdates(_0x17aefa){return function(_0x4dbeea){try{jsonpatch[_0x0121('0x24')](_0x4dbeea,_0x17aefa,!![]);}catch(_0xd976b4){return BPromise[_0x0121('0x25')](_0xd976b4);}return _0x4dbeea[_0x0121('0x26')]();};}function saveUpdates(_0x688472,_0x384a60){return function(_0x492aa0){if(_0x492aa0){return _0x492aa0[_0x0121('0x27')](_0x688472)[_0x0121('0x28')](function(_0x3cdf22){return _0x3cdf22;});}return null;};}function removeEntity(_0x419e5c,_0x4d1cf3){return function(_0x47c9d2){if(_0x47c9d2){return _0x47c9d2[_0x0121('0x29')]()[_0x0121('0x28')](function(){_0x419e5c['status'](0xcc)[_0x0121('0x2a')]();});}};}function handleEntityNotFound(_0x1f2cbe,_0x4608c8){return function(_0x3fa746){if(!_0x3fa746){_0x1f2cbe[_0x0121('0x1c')](0x194);}return _0x3fa746;};}function handleError(_0x3f82eb,_0x5540f8){_0x5540f8=_0x5540f8||0x1f4;return function(_0x4ea48b){logger[_0x0121('0x2b')](_0x4ea48b['stack']);if(_0x4ea48b[_0x0121('0x2c')]){delete _0x4ea48b['name'];}_0x3f82eb[_0x0121('0x1d')](_0x5540f8)[_0x0121('0x2d')](_0x4ea48b);};}exports[_0x0121('0x2e')]=function(_0x2d8abb,_0x1aa5e7){var _0x5ae177={},_0x3385cc={},_0xe9cbf3={'count':0x0,'rows':[]};var _0x6d2160=_[_0x0121('0x2f')](db[_0x0121('0x30')]['rawAttributes'],function(_0x2b42fc){return{'name':_0x2b42fc['fieldName'],'type':_0x2b42fc[_0x0121('0x31')]['key']};});_0x3385cc[_0x0121('0x32')]=_[_0x0121('0x2f')](_0x6d2160,_0x0121('0x2c'));_0x3385cc[_0x0121('0x33')]=_[_0x0121('0x34')](_0x2d8abb['query']);_0x3385cc['filters']=_[_0x0121('0x35')](_0x3385cc['model'],_0x3385cc[_0x0121('0x33')]);_0x5ae177[_0x0121('0x36')]=_[_0x0121('0x35')](_0x3385cc[_0x0121('0x32')],qs[_0x0121('0x37')](_0x2d8abb[_0x0121('0x33')]['fields']));_0x5ae177[_0x0121('0x36')]=_0x5ae177['attributes'][_0x0121('0x38')]?_0x5ae177['attributes']:_0x3385cc[_0x0121('0x32')];if(!_0x2d8abb[_0x0121('0x33')][_0x0121('0x39')](_0x0121('0x3a'))){_0x5ae177[_0x0121('0x20')]=qs[_0x0121('0x20')](_0x2d8abb[_0x0121('0x33')][_0x0121('0x20')]);_0x5ae177[_0x0121('0x1e')]=qs[_0x0121('0x1e')](_0x2d8abb[_0x0121('0x33')]['offset']);}_0x5ae177[_0x0121('0x3b')]=qs[_0x0121('0x3c')](_0x2d8abb['query'][_0x0121('0x3c')]);_0x5ae177[_0x0121('0x3d')]=qs[_0x0121('0x3e')](_[_0x0121('0x3f')](_0x2d8abb['query'],_0x3385cc[_0x0121('0x3e')]),_0x6d2160);if(_0x2d8abb[_0x0121('0x33')][_0x0121('0x40')]){_0x5ae177[_0x0121('0x3d')]=_['merge'](_0x5ae177[_0x0121('0x3d')],{'$or':_[_0x0121('0x2f')](_0x6d2160,function(_0x425b58){if(_0x425b58[_0x0121('0x31')]!==_0x0121('0x41')){var _0x254364={};_0x254364[_0x425b58['name']]={'$like':'%'+_0x2d8abb[_0x0121('0x33')][_0x0121('0x40')]+'%'};return _0x254364;}})});}_0x5ae177=_[_0x0121('0x42')]({},_0x5ae177,_0x2d8abb[_0x0121('0x43')]);var _0xb921e2={'where':_0x5ae177['where']};return db['VtigerConfiguration'][_0x0121('0x21')](_0xb921e2)[_0x0121('0x28')](function(_0x5226b2){_0xe9cbf3[_0x0121('0x21')]=_0x5226b2;if(_0x2d8abb[_0x0121('0x33')][_0x0121('0x44')]){_0x5ae177[_0x0121('0x45')]=[{'all':!![]}];}return db[_0x0121('0x30')]['findAll'](_0x5ae177);})[_0x0121('0x28')](function(_0x48dee){_0xe9cbf3[_0x0121('0x46')]=_0x48dee;return _0xe9cbf3;})[_0x0121('0x28')](respondWithFilteredResult(_0x1aa5e7,_0x5ae177))[_0x0121('0x47')](handleError(_0x1aa5e7,null));};exports[_0x0121('0x48')]=function(_0x61b17a,_0x13d2f8){var _0x40ab36={'raw':![],'where':{'id':_0x61b17a[_0x0121('0x49')]['id']}},_0x5d639b={};_0x5d639b[_0x0121('0x32')]=_[_0x0121('0x34')](db['VtigerConfiguration']['rawAttributes']);_0x5d639b[_0x0121('0x33')]=_[_0x0121('0x34')](_0x61b17a[_0x0121('0x33')]);_0x5d639b[_0x0121('0x3e')]=_[_0x0121('0x35')](_0x5d639b[_0x0121('0x32')],_0x5d639b[_0x0121('0x33')]);_0x40ab36['attributes']=_[_0x0121('0x35')](_0x5d639b[_0x0121('0x32')],qs[_0x0121('0x37')](_0x61b17a[_0x0121('0x33')][_0x0121('0x37')]));_0x40ab36[_0x0121('0x36')]=_0x40ab36[_0x0121('0x36')][_0x0121('0x38')]?_0x40ab36[_0x0121('0x36')]:_0x5d639b[_0x0121('0x32')];if(_0x61b17a['query']['includeAll']){_0x40ab36[_0x0121('0x45')]=[{'all':!![]}];}_0x40ab36=_[_0x0121('0x42')]({},_0x40ab36,_0x61b17a[_0x0121('0x43')]);return db[_0x0121('0x30')][_0x0121('0x4a')](_0x40ab36)[_0x0121('0x28')](handleEntityNotFound(_0x13d2f8,null))[_0x0121('0x28')](respondWithResult(_0x13d2f8,null))[_0x0121('0x47')](handleError(_0x13d2f8,null));};exports[_0x0121('0x4b')]=function(_0x41c9f2,_0x48c511){return db['VtigerConfiguration']['create'](_0x41c9f2['body'],{})[_0x0121('0x28')](respondWithResult(_0x48c511,0xc9))[_0x0121('0x47')](handleError(_0x48c511,null));};exports['update']=function(_0x4005e2,_0x5dd917){if(_0x4005e2[_0x0121('0x4c')]['id']){delete _0x4005e2[_0x0121('0x4c')]['id'];}return db[_0x0121('0x30')][_0x0121('0x4a')]({'where':{'id':_0x4005e2[_0x0121('0x49')]['id']}})[_0x0121('0x28')](handleEntityNotFound(_0x5dd917,null))[_0x0121('0x28')](saveUpdates(_0x4005e2[_0x0121('0x4c')],null))[_0x0121('0x28')](respondWithResult(_0x5dd917,null))[_0x0121('0x47')](handleError(_0x5dd917,null));};exports[_0x0121('0x29')]=function(_0x373f48,_0x47432c){return db[_0x0121('0x30')][_0x0121('0x4a')]({'where':{'id':_0x373f48[_0x0121('0x49')]['id']}})['then'](handleEntityNotFound(_0x47432c,null))[_0x0121('0x28')](removeEntity(_0x47432c,null))[_0x0121('0x47')](handleError(_0x47432c,null));};exports[_0x0121('0x4d')]=function(_0x4da0d4,_0x4a1403,_0x418673){var _0x5c3263={};var _0x4870ae={};var _0x372ae3;var _0x504b69;return db[_0x0121('0x30')][_0x0121('0x4e')]({'where':{'id':_0x4da0d4[_0x0121('0x49')]['id']}})['then'](handleEntityNotFound(_0x4a1403,null))[_0x0121('0x28')](function(_0x5dd519){if(_0x5dd519){_0x372ae3=_0x5dd519;_0x4870ae[_0x0121('0x32')]=_[_0x0121('0x34')](db[_0x0121('0x4f')][_0x0121('0x50')]);_0x4870ae['query']=_['keys'](_0x4da0d4['query']);_0x4870ae['filters']=_[_0x0121('0x35')](_0x4870ae[_0x0121('0x32')],_0x4870ae[_0x0121('0x33')]);_0x5c3263[_0x0121('0x36')]=_[_0x0121('0x35')](_0x4870ae[_0x0121('0x32')],qs['fields'](_0x4da0d4[_0x0121('0x33')][_0x0121('0x37')]));_0x5c3263['attributes']=_0x5c3263[_0x0121('0x36')][_0x0121('0x38')]?_0x5c3263[_0x0121('0x36')]:_0x4870ae[_0x0121('0x32')];_0x5c3263[_0x0121('0x3b')]=qs['sort'](_0x4da0d4['query'][_0x0121('0x3c')]);_0x5c3263[_0x0121('0x3d')]=qs['filters'](_[_0x0121('0x3f')](_0x4da0d4['query'],_0x4870ae[_0x0121('0x3e')]));if(_0x4da0d4[_0x0121('0x33')][_0x0121('0x40')]){_0x5c3263[_0x0121('0x3d')]=_[_0x0121('0x42')](_0x5c3263[_0x0121('0x3d')],{'$or':_[_0x0121('0x2f')](_0x5c3263['attributes'],function(_0x4846ea){var _0x19a632={};_0x19a632[_0x4846ea]={'$like':'%'+_0x4da0d4['query']['filter']+'%'};return _0x19a632;})});}_0x5c3263=_[_0x0121('0x42')]({},_0x5c3263,_0x4da0d4[_0x0121('0x43')]);return _0x372ae3['getFields'](_0x5c3263);}})['then'](function(_0x396607){if(_0x396607){_0x504b69=_0x396607[_0x0121('0x38')];if(!_0x4da0d4[_0x0121('0x33')][_0x0121('0x39')](_0x0121('0x3a'))){_0x5c3263[_0x0121('0x20')]=qs[_0x0121('0x20')](_0x4da0d4[_0x0121('0x33')][_0x0121('0x20')]);_0x5c3263[_0x0121('0x1e')]=qs[_0x0121('0x1e')](_0x4da0d4[_0x0121('0x33')][_0x0121('0x1e')]);}return _0x372ae3[_0x0121('0x4d')](_0x5c3263);}})[_0x0121('0x28')](function(_0x238d17){if(_0x238d17){return _0x238d17?{'count':_0x504b69,'rows':_0x238d17}:null;}})['then'](respondWithResult(_0x4a1403,null))[_0x0121('0x47')](handleError(_0x4a1403,null));};exports[_0x0121('0x51')]=function(_0x354a26,_0x3449f8,_0x2469c4){var _0x130d15={};var _0xd73b3f={};var _0x3bb82f;var _0x271e0c;return db[_0x0121('0x30')][_0x0121('0x4e')]({'where':{'id':_0x354a26[_0x0121('0x49')]['id']}})['then'](handleEntityNotFound(_0x3449f8,null))[_0x0121('0x28')](function(_0xc1400f){if(_0xc1400f){_0x3bb82f=_0xc1400f;_0xd73b3f[_0x0121('0x32')]=_[_0x0121('0x34')](db[_0x0121('0x4f')][_0x0121('0x50')]);_0xd73b3f[_0x0121('0x33')]=_[_0x0121('0x34')](_0x354a26[_0x0121('0x33')]);_0xd73b3f[_0x0121('0x3e')]=_[_0x0121('0x35')](_0xd73b3f[_0x0121('0x32')],_0xd73b3f[_0x0121('0x33')]);_0x130d15[_0x0121('0x36')]=_[_0x0121('0x35')](_0xd73b3f[_0x0121('0x32')],qs[_0x0121('0x37')](_0x354a26[_0x0121('0x33')][_0x0121('0x37')]));_0x130d15['attributes']=_0x130d15['attributes']['length']?_0x130d15[_0x0121('0x36')]:_0xd73b3f[_0x0121('0x32')];_0x130d15[_0x0121('0x3b')]=qs[_0x0121('0x3c')](_0x354a26[_0x0121('0x33')][_0x0121('0x3c')]);_0x130d15[_0x0121('0x3d')]=qs[_0x0121('0x3e')](_['pick'](_0x354a26[_0x0121('0x33')],_0xd73b3f['filters']));if(_0x354a26[_0x0121('0x33')][_0x0121('0x40')]){_0x130d15[_0x0121('0x3d')]=_['merge'](_0x130d15[_0x0121('0x3d')],{'$or':_[_0x0121('0x2f')](_0x130d15[_0x0121('0x36')],function(_0x5bbf59){var _0x3d26b0={};_0x3d26b0[_0x5bbf59]={'$like':'%'+_0x354a26[_0x0121('0x33')][_0x0121('0x40')]+'%'};return _0x3d26b0;})});}_0x130d15=_['merge']({},_0x130d15,_0x354a26[_0x0121('0x43')]);return _0x3bb82f[_0x0121('0x51')](_0x130d15);}})['then'](function(_0xf9f192){if(_0xf9f192){_0x271e0c=_0xf9f192['length'];if(!_0x354a26['query'][_0x0121('0x39')]('nolimit')){_0x130d15[_0x0121('0x20')]=qs[_0x0121('0x20')](_0x354a26['query']['limit']);_0x130d15[_0x0121('0x1e')]=qs[_0x0121('0x1e')](_0x354a26[_0x0121('0x33')][_0x0121('0x1e')]);}return _0x3bb82f[_0x0121('0x51')](_0x130d15);}})['then'](function(_0x16e6b8){if(_0x16e6b8){return _0x16e6b8?{'count':_0x271e0c,'rows':_0x16e6b8}:null;}})['then'](respondWithResult(_0x3449f8,null))[_0x0121('0x47')](handleError(_0x3449f8,null));};exports['getDescriptions']=function(_0x18a162,_0x504a72,_0x393979){var _0x264259={};var _0x35fd51={};var _0x36ccd7;var _0x42652f;return db[_0x0121('0x30')][_0x0121('0x4e')]({'where':{'id':_0x18a162[_0x0121('0x49')]['id']}})[_0x0121('0x28')](handleEntityNotFound(_0x504a72,null))[_0x0121('0x28')](function(_0x45460c){if(_0x45460c){_0x36ccd7=_0x45460c;_0x35fd51[_0x0121('0x32')]=_[_0x0121('0x34')](db[_0x0121('0x4f')][_0x0121('0x50')]);_0x35fd51[_0x0121('0x33')]=_['keys'](_0x18a162['query']);_0x35fd51[_0x0121('0x3e')]=_[_0x0121('0x35')](_0x35fd51[_0x0121('0x32')],_0x35fd51[_0x0121('0x33')]);_0x264259[_0x0121('0x36')]=_[_0x0121('0x35')](_0x35fd51[_0x0121('0x32')],qs['fields'](_0x18a162['query'][_0x0121('0x37')]));_0x264259[_0x0121('0x36')]=_0x264259[_0x0121('0x36')][_0x0121('0x38')]?_0x264259[_0x0121('0x36')]:_0x35fd51[_0x0121('0x32')];_0x264259[_0x0121('0x3b')]=qs[_0x0121('0x3c')](_0x18a162[_0x0121('0x33')]['sort']);_0x264259[_0x0121('0x3d')]=qs['filters'](_[_0x0121('0x3f')](_0x18a162[_0x0121('0x33')],_0x35fd51[_0x0121('0x3e')]));if(_0x18a162[_0x0121('0x33')][_0x0121('0x40')]){_0x264259[_0x0121('0x3d')]=_[_0x0121('0x42')](_0x264259[_0x0121('0x3d')],{'$or':_[_0x0121('0x2f')](_0x264259[_0x0121('0x36')],function(_0x39f681){var _0x23b09c={};_0x23b09c[_0x39f681]={'$like':'%'+_0x18a162[_0x0121('0x33')][_0x0121('0x40')]+'%'};return _0x23b09c;})});}_0x264259=_[_0x0121('0x42')]({},_0x264259,_0x18a162[_0x0121('0x43')]);return _0x36ccd7['getDescriptions'](_0x264259);}})[_0x0121('0x28')](function(_0x35e152){if(_0x35e152){_0x42652f=_0x35e152[_0x0121('0x38')];if(!_0x18a162[_0x0121('0x33')][_0x0121('0x39')](_0x0121('0x3a'))){_0x264259[_0x0121('0x20')]=qs['limit'](_0x18a162[_0x0121('0x33')]['limit']);_0x264259['offset']=qs['offset'](_0x18a162['query'][_0x0121('0x1e')]);}return _0x36ccd7[_0x0121('0x52')](_0x264259);}})[_0x0121('0x28')](function(_0x5823af){if(_0x5823af){return _0x5823af?{'count':_0x42652f,'rows':_0x5823af}:null;}})[_0x0121('0x28')](respondWithResult(_0x504a72,null))[_0x0121('0x47')](handleError(_0x504a72,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 4824d83..fb216b4 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 _0x774b=['rimraf','../../config/environment','define','VtigerConfiguration','lodash','util','../../config/logger','moment','path'];(function(_0x3e2f31,_0x9d498){var _0x59a738=function(_0x42d2e5){while(--_0x42d2e5){_0x3e2f31['push'](_0x3e2f31['shift']());}};_0x59a738(++_0x9d498);}(_0x774b,0xc1));var _0xb774=function(_0x474964,_0x4be4f7){_0x474964=_0x474964-0x0;var _0x18e819=_0x774b[_0x474964];return _0x18e819;};'use strict';var _=require(_0xb774('0x0'));var util=require(_0xb774('0x1'));var logger=require(_0xb774('0x2'))('api');var moment=require(_0xb774('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb774('0x4'));var rimraf=require(_0xb774('0x5'));var config=require(_0xb774('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x4b6dea,_0x346000){return _0x4b6dea[_0xb774('0x7')](_0xb774('0x8'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c62=['api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','util'];(function(_0x1bb07a,_0x202ed1){var _0x52ff00=function(_0x55f251){while(--_0x55f251){_0x1bb07a['push'](_0x1bb07a['shift']());}};_0x52ff00(++_0x202ed1);}(_0x0c62,0x6a));var _0x20c6=function(_0x344a2c,_0xb81f43){_0x344a2c=_0x344a2c-0x0;var _0x2408a4=_0x0c62[_0x344a2c];return _0x2408a4;};'use strict';var _=require(_0x20c6('0x0'));var util=require(_0x20c6('0x1'));var logger=require('../../config/logger')(_0x20c6('0x2'));var moment=require(_0x20c6('0x3'));var BPromise=require('bluebird');var rp=require(_0x20c6('0x4'));var fs=require('fs');var path=require(_0x20c6('0x5'));var rimraf=require(_0x20c6('0x6'));var config=require(_0x20c6('0x7'));var attributes=require(_0x20c6('0x8'));module[_0x20c6('0x9')]=function(_0x4d5b4b,_0x4e855b){return _0x4d5b4b[_0x20c6('0xa')]('VtigerConfiguration',attributes,{'tableName':_0x20c6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index efc0a0a..f842549 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 _0x42be=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird'];(function(_0x41e5bb,_0xbae913){var _0x221055=function(_0x10f0b5){while(--_0x10f0b5){_0x41e5bb['push'](_0x41e5bb['shift']());}};_0x221055(++_0xbae913);}(_0x42be,0x11a));var _0xe42b=function(_0x37011d,_0x4d6234){_0x37011d=_0x37011d-0x0;var _0xb86273=_0x42be[_0x37011d];return _0xb86273;};'use strict';var _=require(_0xe42b('0x0'));var util=require(_0xe42b('0x1'));var moment=require(_0xe42b('0x2'));var BPromise=require(_0xe42b('0x3'));var rs=require(_0xe42b('0x4'));var fs=require('fs');var Redis=require(_0xe42b('0x5'));var db=require(_0xe42b('0x6'))['db'];var utils=require(_0xe42b('0x7'));var logger=require(_0xe42b('0x8'))('rpc');var config=require(_0xe42b('0x9'));var jayson=require(_0xe42b('0xa'));var client=jayson['client'][_0xe42b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ceb88,_0x4090bf,_0xd228ce){return new BPromise(function(_0x402cd1,_0x2aa88b){return client[_0xe42b('0xc')](_0x1ceb88,_0xd228ce)['then'](function(_0x3f9bcf){logger[_0xe42b('0xd')](_0xe42b('0xe'),_0x4090bf,_0xe42b('0xf'));logger[_0xe42b('0x10')](_0xe42b('0x11'),_0x4090bf,_0xe42b('0xf'),JSON[_0xe42b('0x12')](_0x3f9bcf));if(_0x3f9bcf['error']){if(_0x3f9bcf[_0xe42b('0x13')][_0xe42b('0x14')]===0x1f4){logger[_0xe42b('0x13')](_0xe42b('0xe'),_0x4090bf,_0x3f9bcf[_0xe42b('0x13')][_0xe42b('0x15')]);return _0x2aa88b(_0x3f9bcf['error'][_0xe42b('0x15')]);}logger['error'](_0xe42b('0xe'),_0x4090bf,_0x3f9bcf[_0xe42b('0x13')][_0xe42b('0x15')]);return _0x402cd1(_0x3f9bcf[_0xe42b('0x13')][_0xe42b('0x15')]);}else{logger[_0xe42b('0xd')]('VtigerConfiguration,\x20%s,\x20%s',_0x4090bf,'request\x20sent');_0x402cd1(_0x3f9bcf['result'][_0xe42b('0x15')]);}})['catch'](function(_0x5777c1){logger[_0xe42b('0x13')](_0xe42b('0xe'),_0x4090bf,_0x5777c1);_0x2aa88b(_0x5777c1);});});} \ No newline at end of file +var _0x3afc=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x20cc55,_0x10e04d){var _0x55bf68=function(_0x212119){while(--_0x212119){_0x20cc55['push'](_0x20cc55['shift']());}};_0x55bf68(++_0x10e04d);}(_0x3afc,0x162));var _0xc3af=function(_0x2395a4,_0x54572e){_0x2395a4=_0x2395a4-0x0;var _0x55905b=_0x3afc[_0x2395a4];return _0x55905b;};'use strict';var _=require(_0xc3af('0x0'));var util=require(_0xc3af('0x1'));var moment=require('moment');var BPromise=require(_0xc3af('0x2'));var rs=require(_0xc3af('0x3'));var fs=require('fs');var Redis=require(_0xc3af('0x4'));var db=require(_0xc3af('0x5'))['db'];var utils=require(_0xc3af('0x6'));var logger=require(_0xc3af('0x7'))('rpc');var config=require(_0xc3af('0x8'));var jayson=require(_0xc3af('0x9'));var client=jayson[_0xc3af('0xa')][_0xc3af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38b869,_0x1d564d,_0x3393bf){return new BPromise(function(_0x147a43,_0x4b1a77){return client[_0xc3af('0xc')](_0x38b869,_0x3393bf)[_0xc3af('0xd')](function(_0x4bf58c){logger[_0xc3af('0xe')](_0xc3af('0xf'),_0x1d564d,'request\x20sent');logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x1d564d,'request\x20sent',JSON[_0xc3af('0x10')](_0x4bf58c));if(_0x4bf58c['error']){if(_0x4bf58c[_0xc3af('0x11')][_0xc3af('0x12')]===0x1f4){logger[_0xc3af('0x11')](_0xc3af('0xf'),_0x1d564d,_0x4bf58c['error'][_0xc3af('0x13')]);return _0x4b1a77(_0x4bf58c[_0xc3af('0x11')][_0xc3af('0x13')]);}logger['error'](_0xc3af('0xf'),_0x1d564d,_0x4bf58c[_0xc3af('0x11')]['message']);return _0x147a43(_0x4bf58c[_0xc3af('0x11')][_0xc3af('0x13')]);}else{logger[_0xc3af('0xe')](_0xc3af('0xf'),_0x1d564d,'request\x20sent');_0x147a43(_0x4bf58c[_0xc3af('0x14')]['message']);}})['catch'](function(_0x28935e){logger[_0xc3af('0x11')](_0xc3af('0xf'),_0x1d564d,_0x28935e);_0x4b1a77(_0x28935e);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index eb1eecf..2a4afb9 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 _0x280c=['destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','/:id','create','put','update','delete'];(function(_0xae7883,_0xabf9c8){var _0xd55326=function(_0x51fb2f){while(--_0x51fb2f){_0xae7883['push'](_0xae7883['shift']());}};_0xd55326(++_0xabf9c8);}(_0x280c,0xe1));var _0xc280=function(_0xa79dc4,_0x5cb28a){_0xa79dc4=_0xa79dc4-0x0;var _0x170a44=_0x280c[_0xa79dc4];return _0x170a44;};'use strict';var multer=require('multer');var util=require(_0xc280('0x0'));var path=require(_0xc280('0x1'));var timeout=require('connect-timeout');var express=require(_0xc280('0x2'));var router=express[_0xc280('0x3')]();var fs_extra=require(_0xc280('0x4'));var auth=require(_0xc280('0x5'));var interaction=require(_0xc280('0x6'));var config=require(_0xc280('0x7'));var controller=require(_0xc280('0x8'));router['get']('/',auth[_0xc280('0x9')](),controller['index']);router['get'](_0xc280('0xa'),auth[_0xc280('0x9')](),controller['show']);router['post']('/',auth[_0xc280('0x9')](),controller[_0xc280('0xb')]);router[_0xc280('0xc')](_0xc280('0xa'),auth[_0xc280('0x9')](),controller[_0xc280('0xd')]);router[_0xc280('0xe')](_0xc280('0xa'),auth[_0xc280('0x9')](),controller[_0xc280('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf9be=['update','delete','destroy','multer','util','path','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf9be,0x16b));var _0xef9b=function(_0x19b3f8,_0x150751){_0x19b3f8=_0x19b3f8-0x0;var _0x22c3a1=_0xf9be[_0x19b3f8];return _0x22c3a1;};'use strict';var multer=require(_0xef9b('0x0'));var util=require(_0xef9b('0x1'));var path=require(_0xef9b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xef9b('0x3'));var config=require('../../config/environment');var controller=require('./intVtigerField.controller');router[_0xef9b('0x4')]('/',auth[_0xef9b('0x5')](),controller[_0xef9b('0x6')]);router['get'](_0xef9b('0x7'),auth[_0xef9b('0x5')](),controller[_0xef9b('0x8')]);router[_0xef9b('0x9')]('/',auth[_0xef9b('0x5')](),controller[_0xef9b('0xa')]);router[_0xef9b('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef9b('0xc')]);router[_0xef9b('0xd')]('/:id',auth[_0xef9b('0x5')](),controller[_0xef9b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index abc502a..68b92d1 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 _0x9e51=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x9e51,0x176));var _0x19e5=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x9e51[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x19e5('0x0'));module['exports']={'type':{'type':Sequelize[_0x19e5('0x1')](_0x19e5('0x2'),_0x19e5('0x3'),_0x19e5('0x4'),'keyValue',_0x19e5('0x5')),'defaultValue':_0x19e5('0x2')},'content':{'type':Sequelize[_0x19e5('0x6')]},'key':{'type':Sequelize[_0x19e5('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x19e5('0x2'),_0x19e5('0x3'),_0x19e5('0x4'))},'keyContent':{'type':Sequelize[_0x19e5('0x6')]},'idField':{'type':Sequelize[_0x19e5('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x19e5('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x340a=['keyValue','picklist','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x3fba82,_0x26ef45){var _0x22ae3a=function(_0x564aae){while(--_0x564aae){_0x3fba82['push'](_0x3fba82['shift']());}};_0x22ae3a(++_0x26ef45);}(_0x340a,0x123));var _0xa340=function(_0x4e6eaf,_0x1133ce){_0x4e6eaf=_0x4e6eaf-0x0;var _0x167368=_0x340a[_0x4e6eaf];return _0x167368;};'use strict';var Sequelize=require(_0xa340('0x0'));module[_0xa340('0x1')]={'type':{'type':Sequelize[_0xa340('0x2')](_0xa340('0x3'),_0xa340('0x4'),'customVariable',_0xa340('0x5'),_0xa340('0x6')),'defaultValue':_0xa340('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xa340('0x7')]},'keyType':{'type':Sequelize[_0xa340('0x2')](_0xa340('0x3'),_0xa340('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xa340('0x7')]},'idField':{'type':Sequelize[_0xa340('0x7')]},'nameField':{'type':Sequelize[_0xa340('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa340('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ef96a89..f8977ef 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 _0xa4b4=['VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','update','then','error','stack','name','send','VtigerField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x159902,_0x2f808c){var _0x128878=function(_0x5ee91e){while(--_0x5ee91e){_0x159902['push'](_0x159902['shift']());}};_0x128878(++_0x2f808c);}(_0xa4b4,0xa7));var _0x4a4b=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0xa4b4[_0x1f44e4];return _0x591989;};'use strict';var emlformat=require(_0x4a4b('0x0'));var rimraf=require(_0x4a4b('0x1'));var zipdir=require(_0x4a4b('0x2'));var jsonpatch=require(_0x4a4b('0x3'));var rp=require(_0x4a4b('0x4'));var moment=require(_0x4a4b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4a4b('0x6'));var util=require(_0x4a4b('0x7'));var path=require(_0x4a4b('0x8'));var sox=require(_0x4a4b('0x9'));var csv=require(_0x4a4b('0xa'));var ejs=require(_0x4a4b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4a4b('0xc'));var crypto=require(_0x4a4b('0xd'));var jsforce=require(_0x4a4b('0xe'));var deskjs=require(_0x4a4b('0xf'));var toCsv=require(_0x4a4b('0xa'));var querystring=require(_0x4a4b('0x10'));var Papa=require(_0x4a4b('0x11'));var Redis=require(_0x4a4b('0x12'));var authService=require(_0x4a4b('0x13'));var qs=require(_0x4a4b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a4b('0x15'));var utils=require(_0x4a4b('0x16'));var config=require(_0x4a4b('0x17'));var licenseUtil=require(_0x4a4b('0x18'));var db=require(_0x4a4b('0x19'))['db'];function respondWithStatusCode(_0x59c5a5,_0x48828a){_0x48828a=_0x48828a||0xcc;return function(_0x543352){if(_0x543352){return _0x59c5a5[_0x4a4b('0x1a')](_0x48828a);}return _0x59c5a5['status'](_0x48828a)[_0x4a4b('0x1b')]();};}function respondWithResult(_0x1f9c5c,_0x58e64b){_0x58e64b=_0x58e64b||0xc8;return function(_0x13709d){if(_0x13709d){return _0x1f9c5c['status'](_0x58e64b)[_0x4a4b('0x1c')](_0x13709d);}};}function respondWithFilteredResult(_0x3b3d3d,_0x1f189b){return function(_0x5b2ebc){if(_0x5b2ebc){var _0x227e84=typeof _0x1f189b[_0x4a4b('0x1d')]===_0x4a4b('0x1e')&&typeof _0x1f189b[_0x4a4b('0x1f')]===_0x4a4b('0x1e');var _0xbfbc77=_0x5b2ebc[_0x4a4b('0x20')];var _0x590550=_0x227e84?0x0:_0x1f189b[_0x4a4b('0x1d')];var _0x2b6a4c=_0x227e84?_0x5b2ebc[_0x4a4b('0x20')]:_0x1f189b['offset']+_0x1f189b[_0x4a4b('0x1f')];var _0x1579e6;if(_0x2b6a4c>=_0xbfbc77){_0x2b6a4c=_0xbfbc77;_0x1579e6=0xc8;}else{_0x1579e6=0xce;}_0x3b3d3d[_0x4a4b('0x21')](_0x1579e6);return _0x3b3d3d[_0x4a4b('0x22')]('Content-Range',_0x590550+'-'+_0x2b6a4c+'/'+_0xbfbc77)['json'](_0x5b2ebc);}return null;};}function patchUpdates(_0x5bf09a){return function(_0x5eff86){try{jsonpatch[_0x4a4b('0x23')](_0x5eff86,_0x5bf09a,!![]);}catch(_0xdd2112){return BPromise['reject'](_0xdd2112);}return _0x5eff86['save']();};}function saveUpdates(_0x31875b,_0x346eeb){return function(_0x3f2fb2){if(_0x3f2fb2){return _0x3f2fb2[_0x4a4b('0x24')](_0x31875b)['then'](function(_0x51436b){return _0x51436b;});}return null;};}function removeEntity(_0x465fcb,_0x1bf478){return function(_0x2a9998){if(_0x2a9998){return _0x2a9998['destroy']()[_0x4a4b('0x25')](function(){_0x465fcb[_0x4a4b('0x21')](0xcc)[_0x4a4b('0x1b')]();});}};}function handleEntityNotFound(_0xf732e5,_0x561e11){return function(_0x1b0aa7){if(!_0x1b0aa7){_0xf732e5[_0x4a4b('0x1a')](0x194);}return _0x1b0aa7;};}function handleError(_0x208f53,_0x5d30e6){_0x5d30e6=_0x5d30e6||0x1f4;return function(_0xeb9e5a){logger[_0x4a4b('0x26')](_0xeb9e5a[_0x4a4b('0x27')]);if(_0xeb9e5a[_0x4a4b('0x28')]){delete _0xeb9e5a[_0x4a4b('0x28')];}_0x208f53[_0x4a4b('0x21')](_0x5d30e6)[_0x4a4b('0x29')](_0xeb9e5a);};}exports['index']=function(_0xef34e0,_0x66ad5){var _0x53a648={},_0x30a59a={},_0x457c5b={'count':0x0,'rows':[]};var _0x5e8af2=_['map'](db[_0x4a4b('0x2a')][_0x4a4b('0x2b')],function(_0x292db8){return{'name':_0x292db8[_0x4a4b('0x2c')],'type':_0x292db8[_0x4a4b('0x2d')][_0x4a4b('0x2e')]};});_0x30a59a[_0x4a4b('0x2f')]=_[_0x4a4b('0x30')](_0x5e8af2,_0x4a4b('0x28'));_0x30a59a[_0x4a4b('0x31')]=_[_0x4a4b('0x32')](_0xef34e0[_0x4a4b('0x31')]);_0x30a59a['filters']=_[_0x4a4b('0x33')](_0x30a59a['model'],_0x30a59a[_0x4a4b('0x31')]);_0x53a648[_0x4a4b('0x34')]=_[_0x4a4b('0x33')](_0x30a59a[_0x4a4b('0x2f')],qs['fields'](_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x35')]));_0x53a648[_0x4a4b('0x34')]=_0x53a648[_0x4a4b('0x34')][_0x4a4b('0x36')]?_0x53a648[_0x4a4b('0x34')]:_0x30a59a[_0x4a4b('0x2f')];if(!_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x37')](_0x4a4b('0x38'))){_0x53a648[_0x4a4b('0x1f')]=qs['limit'](_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x1f')]);_0x53a648[_0x4a4b('0x1d')]=qs[_0x4a4b('0x1d')](_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x1d')]);}_0x53a648[_0x4a4b('0x39')]=qs[_0x4a4b('0x3a')](_0xef34e0['query'][_0x4a4b('0x3a')]);_0x53a648[_0x4a4b('0x3b')]=qs[_0x4a4b('0x3c')](_[_0x4a4b('0x3d')](_0xef34e0[_0x4a4b('0x31')],_0x30a59a[_0x4a4b('0x3c')]),_0x5e8af2);if(_0xef34e0[_0x4a4b('0x31')][_0x4a4b('0x3e')]){_0x53a648[_0x4a4b('0x3b')]=_[_0x4a4b('0x3f')](_0x53a648[_0x4a4b('0x3b')],{'$or':_['map'](_0x5e8af2,function(_0x5f49c4){if(_0x5f49c4[_0x4a4b('0x2d')]!==_0x4a4b('0x40')){var _0x2593c2={};_0x2593c2[_0x5f49c4[_0x4a4b('0x28')]]={'$like':'%'+_0xef34e0['query'][_0x4a4b('0x3e')]+'%'};return _0x2593c2;}})});}_0x53a648=_[_0x4a4b('0x3f')]({},_0x53a648,_0xef34e0[_0x4a4b('0x41')]);var _0x4e4824={'where':_0x53a648[_0x4a4b('0x3b')]};return db[_0x4a4b('0x2a')][_0x4a4b('0x20')](_0x4e4824)['then'](function(_0x1cfde9){_0x457c5b[_0x4a4b('0x20')]=_0x1cfde9;if(_0xef34e0['query']['includeAll']){_0x53a648[_0x4a4b('0x42')]=[{'all':!![]}];}return db[_0x4a4b('0x2a')][_0x4a4b('0x43')](_0x53a648);})[_0x4a4b('0x25')](function(_0x50ad16){_0x457c5b[_0x4a4b('0x44')]=_0x50ad16;return _0x457c5b;})['then'](respondWithFilteredResult(_0x66ad5,_0x53a648))[_0x4a4b('0x45')](handleError(_0x66ad5,null));};exports[_0x4a4b('0x46')]=function(_0x157c6e,_0x4aabe0){var _0x478931={'raw':!![],'where':{'id':_0x157c6e['params']['id']}},_0x1c8946={};_0x1c8946[_0x4a4b('0x2f')]=_[_0x4a4b('0x32')](db[_0x4a4b('0x2a')][_0x4a4b('0x2b')]);_0x1c8946['query']=_[_0x4a4b('0x32')](_0x157c6e[_0x4a4b('0x31')]);_0x1c8946[_0x4a4b('0x3c')]=_[_0x4a4b('0x33')](_0x1c8946[_0x4a4b('0x2f')],_0x1c8946['query']);_0x478931[_0x4a4b('0x34')]=_[_0x4a4b('0x33')](_0x1c8946['model'],qs[_0x4a4b('0x35')](_0x157c6e['query'][_0x4a4b('0x35')]));_0x478931['attributes']=_0x478931['attributes']['length']?_0x478931[_0x4a4b('0x34')]:_0x1c8946[_0x4a4b('0x2f')];if(_0x157c6e[_0x4a4b('0x31')][_0x4a4b('0x47')]){_0x478931[_0x4a4b('0x42')]=[{'all':!![]}];}_0x478931=_[_0x4a4b('0x3f')]({},_0x478931,_0x157c6e[_0x4a4b('0x41')]);return db[_0x4a4b('0x2a')][_0x4a4b('0x48')](_0x478931)[_0x4a4b('0x25')](handleEntityNotFound(_0x4aabe0,null))[_0x4a4b('0x25')](respondWithResult(_0x4aabe0,null))[_0x4a4b('0x45')](handleError(_0x4aabe0,null));};exports[_0x4a4b('0x49')]=function(_0x5f39ef,_0x24b140){return db[_0x4a4b('0x2a')][_0x4a4b('0x49')](_0x5f39ef['body'],{})[_0x4a4b('0x25')](respondWithResult(_0x24b140,0xc9))[_0x4a4b('0x45')](handleError(_0x24b140,null));};exports['update']=function(_0x438b24,_0x45af0d){if(_0x438b24['body']['id']){delete _0x438b24[_0x4a4b('0x4a')]['id'];}return db[_0x4a4b('0x2a')][_0x4a4b('0x48')]({'where':{'id':_0x438b24[_0x4a4b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45af0d,null))[_0x4a4b('0x25')](saveUpdates(_0x438b24[_0x4a4b('0x4a')],null))[_0x4a4b('0x25')](respondWithResult(_0x45af0d,null))[_0x4a4b('0x45')](handleError(_0x45af0d,null));};exports[_0x4a4b('0x4c')]=function(_0x3aed2b,_0x564b03){return db[_0x4a4b('0x2a')][_0x4a4b('0x48')]({'where':{'id':_0x3aed2b['params']['id']}})[_0x4a4b('0x25')](handleEntityNotFound(_0x564b03,null))[_0x4a4b('0x25')](removeEntity(_0x564b03,null))[_0x4a4b('0x45')](handleError(_0x564b03,null));}; \ No newline at end of file +var _0xab30=['json','offset','undefined','count','limit','set','Content-Range','save','then','destroy','error','name','send','index','map','VtigerField','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','create','body','update','eml-format','rimraf','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x4fd4d4,_0x176a09){var _0x365fbf=function(_0x37ddd1){while(--_0x37ddd1){_0x4fd4d4['push'](_0x4fd4d4['shift']());}};_0x365fbf(++_0x176a09);}(_0xab30,0x15a));var _0x0ab3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xab30[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x0ab3('0x0'));var rimraf=require(_0x0ab3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0ab3('0x2'));var moment=require(_0x0ab3('0x3'));var BPromise=require(_0x0ab3('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0ab3('0x5'));var sox=require(_0x0ab3('0x6'));var csv=require(_0x0ab3('0x7'));var ejs=require(_0x0ab3('0x8'));var fs=require('fs');var fs_extra=require(_0x0ab3('0x9'));var _=require(_0x0ab3('0xa'));var squel=require(_0x0ab3('0xb'));var crypto=require(_0x0ab3('0xc'));var jsforce=require(_0x0ab3('0xd'));var deskjs=require(_0x0ab3('0xe'));var toCsv=require(_0x0ab3('0x7'));var querystring=require(_0x0ab3('0xf'));var Papa=require(_0x0ab3('0x10'));var Redis=require(_0x0ab3('0x11'));var authService=require(_0x0ab3('0x12'));var qs=require(_0x0ab3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0ab3('0x14'));var logger=require(_0x0ab3('0x15'))(_0x0ab3('0x16'));var utils=require(_0x0ab3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0ab3('0x18'));var db=require(_0x0ab3('0x19'))['db'];function respondWithStatusCode(_0xddbcab,_0x103ef9){_0x103ef9=_0x103ef9||0xcc;return function(_0xbeabb6){if(_0xbeabb6){return _0xddbcab[_0x0ab3('0x1a')](_0x103ef9);}return _0xddbcab[_0x0ab3('0x1b')](_0x103ef9)[_0x0ab3('0x1c')]();};}function respondWithResult(_0x5ab602,_0x3bb486){_0x3bb486=_0x3bb486||0xc8;return function(_0x156468){if(_0x156468){return _0x5ab602[_0x0ab3('0x1b')](_0x3bb486)[_0x0ab3('0x1d')](_0x156468);}};}function respondWithFilteredResult(_0x440de4,_0x5b8a4c){return function(_0x21ed0d){if(_0x21ed0d){var _0x2fe0b1=typeof _0x5b8a4c[_0x0ab3('0x1e')]===_0x0ab3('0x1f')&&typeof _0x5b8a4c['limit']==='undefined';var _0x5af522=_0x21ed0d['count'];var _0x41f782=_0x2fe0b1?0x0:_0x5b8a4c[_0x0ab3('0x1e')];var _0x535a2b=_0x2fe0b1?_0x21ed0d[_0x0ab3('0x20')]:_0x5b8a4c[_0x0ab3('0x1e')]+_0x5b8a4c[_0x0ab3('0x21')];var _0x2eb4b2;if(_0x535a2b>=_0x5af522){_0x535a2b=_0x5af522;_0x2eb4b2=0xc8;}else{_0x2eb4b2=0xce;}_0x440de4['status'](_0x2eb4b2);return _0x440de4[_0x0ab3('0x22')](_0x0ab3('0x23'),_0x41f782+'-'+_0x535a2b+'/'+_0x5af522)['json'](_0x21ed0d);}return null;};}function patchUpdates(_0x3e17d5){return function(_0x2536d3){try{jsonpatch['apply'](_0x2536d3,_0x3e17d5,!![]);}catch(_0x1509df){return BPromise['reject'](_0x1509df);}return _0x2536d3[_0x0ab3('0x24')]();};}function saveUpdates(_0x354464,_0x2a4103){return function(_0xed533c){if(_0xed533c){return _0xed533c['update'](_0x354464)[_0x0ab3('0x25')](function(_0x358416){return _0x358416;});}return null;};}function removeEntity(_0x4eade5,_0x469373){return function(_0x16eec9){if(_0x16eec9){return _0x16eec9[_0x0ab3('0x26')]()[_0x0ab3('0x25')](function(){_0x4eade5[_0x0ab3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x73c960,_0x5df3da){return function(_0x3503dc){if(!_0x3503dc){_0x73c960[_0x0ab3('0x1a')](0x194);}return _0x3503dc;};}function handleError(_0x1c65c0,_0x33f63c){_0x33f63c=_0x33f63c||0x1f4;return function(_0x2661a8){logger[_0x0ab3('0x27')](_0x2661a8['stack']);if(_0x2661a8[_0x0ab3('0x28')]){delete _0x2661a8[_0x0ab3('0x28')];}_0x1c65c0[_0x0ab3('0x1b')](_0x33f63c)[_0x0ab3('0x29')](_0x2661a8);};}exports[_0x0ab3('0x2a')]=function(_0x138c1d,_0xef5fe0){var _0x357807={},_0x1bffec={},_0x1bb3db={'count':0x0,'rows':[]};var _0x2f71b3=_[_0x0ab3('0x2b')](db[_0x0ab3('0x2c')][_0x0ab3('0x2d')],function(_0x6f748){return{'name':_0x6f748['fieldName'],'type':_0x6f748[_0x0ab3('0x2e')]['key']};});_0x1bffec[_0x0ab3('0x2f')]=_['map'](_0x2f71b3,_0x0ab3('0x28'));_0x1bffec[_0x0ab3('0x30')]=_['keys'](_0x138c1d[_0x0ab3('0x30')]);_0x1bffec[_0x0ab3('0x31')]=_[_0x0ab3('0x32')](_0x1bffec['model'],_0x1bffec[_0x0ab3('0x30')]);_0x357807[_0x0ab3('0x33')]=_[_0x0ab3('0x32')](_0x1bffec['model'],qs[_0x0ab3('0x34')](_0x138c1d['query'][_0x0ab3('0x34')]));_0x357807[_0x0ab3('0x33')]=_0x357807[_0x0ab3('0x33')][_0x0ab3('0x35')]?_0x357807[_0x0ab3('0x33')]:_0x1bffec[_0x0ab3('0x2f')];if(!_0x138c1d[_0x0ab3('0x30')][_0x0ab3('0x36')](_0x0ab3('0x37'))){_0x357807[_0x0ab3('0x21')]=qs[_0x0ab3('0x21')](_0x138c1d[_0x0ab3('0x30')][_0x0ab3('0x21')]);_0x357807[_0x0ab3('0x1e')]=qs[_0x0ab3('0x1e')](_0x138c1d[_0x0ab3('0x30')][_0x0ab3('0x1e')]);}_0x357807[_0x0ab3('0x38')]=qs['sort'](_0x138c1d[_0x0ab3('0x30')][_0x0ab3('0x39')]);_0x357807[_0x0ab3('0x3a')]=qs[_0x0ab3('0x31')](_[_0x0ab3('0x3b')](_0x138c1d[_0x0ab3('0x30')],_0x1bffec[_0x0ab3('0x31')]),_0x2f71b3);if(_0x138c1d['query'][_0x0ab3('0x3c')]){_0x357807[_0x0ab3('0x3a')]=_[_0x0ab3('0x3d')](_0x357807['where'],{'$or':_[_0x0ab3('0x2b')](_0x2f71b3,function(_0x38c9a6){if(_0x38c9a6[_0x0ab3('0x2e')]!==_0x0ab3('0x3e')){var _0x379960={};_0x379960[_0x38c9a6[_0x0ab3('0x28')]]={'$like':'%'+_0x138c1d[_0x0ab3('0x30')][_0x0ab3('0x3c')]+'%'};return _0x379960;}})});}_0x357807=_[_0x0ab3('0x3d')]({},_0x357807,_0x138c1d['options']);var _0x27d4e2={'where':_0x357807[_0x0ab3('0x3a')]};return db['VtigerField'][_0x0ab3('0x20')](_0x27d4e2)[_0x0ab3('0x25')](function(_0xd1aa5c){_0x1bb3db['count']=_0xd1aa5c;if(_0x138c1d[_0x0ab3('0x30')][_0x0ab3('0x3f')]){_0x357807[_0x0ab3('0x40')]=[{'all':!![]}];}return db[_0x0ab3('0x2c')][_0x0ab3('0x41')](_0x357807);})[_0x0ab3('0x25')](function(_0x5acdb5){_0x1bb3db[_0x0ab3('0x42')]=_0x5acdb5;return _0x1bb3db;})[_0x0ab3('0x25')](respondWithFilteredResult(_0xef5fe0,_0x357807))[_0x0ab3('0x43')](handleError(_0xef5fe0,null));};exports['show']=function(_0x1388ad,_0x37feac){var _0x274b60={'raw':!![],'where':{'id':_0x1388ad[_0x0ab3('0x44')]['id']}},_0x4fed58={};_0x4fed58['model']=_['keys'](db[_0x0ab3('0x2c')][_0x0ab3('0x2d')]);_0x4fed58[_0x0ab3('0x30')]=_[_0x0ab3('0x45')](_0x1388ad[_0x0ab3('0x30')]);_0x4fed58[_0x0ab3('0x31')]=_[_0x0ab3('0x32')](_0x4fed58['model'],_0x4fed58[_0x0ab3('0x30')]);_0x274b60[_0x0ab3('0x33')]=_[_0x0ab3('0x32')](_0x4fed58[_0x0ab3('0x2f')],qs[_0x0ab3('0x34')](_0x1388ad[_0x0ab3('0x30')][_0x0ab3('0x34')]));_0x274b60[_0x0ab3('0x33')]=_0x274b60[_0x0ab3('0x33')][_0x0ab3('0x35')]?_0x274b60[_0x0ab3('0x33')]:_0x4fed58[_0x0ab3('0x2f')];if(_0x1388ad[_0x0ab3('0x30')][_0x0ab3('0x3f')]){_0x274b60[_0x0ab3('0x40')]=[{'all':!![]}];}_0x274b60=_[_0x0ab3('0x3d')]({},_0x274b60,_0x1388ad[_0x0ab3('0x46')]);return db[_0x0ab3('0x2c')][_0x0ab3('0x47')](_0x274b60)[_0x0ab3('0x25')](handleEntityNotFound(_0x37feac,null))['then'](respondWithResult(_0x37feac,null))[_0x0ab3('0x43')](handleError(_0x37feac,null));};exports[_0x0ab3('0x48')]=function(_0x2c0cfd,_0xc553f4){return db['VtigerField'][_0x0ab3('0x48')](_0x2c0cfd[_0x0ab3('0x49')],{})[_0x0ab3('0x25')](respondWithResult(_0xc553f4,0xc9))[_0x0ab3('0x43')](handleError(_0xc553f4,null));};exports[_0x0ab3('0x4a')]=function(_0x1704be,_0x3aae39){if(_0x1704be[_0x0ab3('0x49')]['id']){delete _0x1704be[_0x0ab3('0x49')]['id'];}return db['VtigerField'][_0x0ab3('0x47')]({'where':{'id':_0x1704be['params']['id']}})[_0x0ab3('0x25')](handleEntityNotFound(_0x3aae39,null))[_0x0ab3('0x25')](saveUpdates(_0x1704be[_0x0ab3('0x49')],null))[_0x0ab3('0x25')](respondWithResult(_0x3aae39,null))[_0x0ab3('0x43')](handleError(_0x3aae39,null));};exports[_0x0ab3('0x26')]=function(_0x57874c,_0x198d96){return db[_0x0ab3('0x2c')][_0x0ab3('0x47')]({'where':{'id':_0x57874c['params']['id']}})['then'](handleEntityNotFound(_0x198d96,null))['then'](removeEntity(_0x198d96,null))[_0x0ab3('0x43')](handleError(_0x198d96,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index e1d5650..31b97d6 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 _0x1268=['exports','define','int_vtiger_fields','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x1268,0x70));var _0x8126=function(_0x3243fe,_0x454166){_0x3243fe=_0x3243fe-0x0;var _0x34eeaa=_0x1268[_0x3243fe];return _0x34eeaa;};'use strict';var _=require(_0x8126('0x0'));var util=require(_0x8126('0x1'));var logger=require(_0x8126('0x2'))(_0x8126('0x3'));var moment=require(_0x8126('0x4'));var BPromise=require(_0x8126('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8126('0x6'));var rimraf=require('rimraf');var config=require(_0x8126('0x7'));var attributes=require('./intVtigerField.attributes');module[_0x8126('0x8')]=function(_0x5f045d,_0x2f7c6a){return _0x5f045d[_0x8126('0x9')]('VtigerField',attributes,{'tableName':_0x8126('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x8126('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd56a=['rimraf','./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x344adc,_0x183c37){var _0x4014b2=function(_0xe809e5){while(--_0xe809e5){_0x344adc['push'](_0x344adc['shift']());}};_0x4014b2(++_0x183c37);}(_0xd56a,0x13b));var _0xad56=function(_0x4c3eb7,_0x53e68f){_0x4c3eb7=_0x4c3eb7-0x0;var _0xde4438=_0xd56a[_0x4c3eb7];return _0xde4438;};'use strict';var _=require(_0xad56('0x0'));var util=require(_0xad56('0x1'));var logger=require(_0xad56('0x2'))(_0xad56('0x3'));var moment=require(_0xad56('0x4'));var BPromise=require(_0xad56('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad56('0x6'));var rimraf=require(_0xad56('0x7'));var config=require('../../config/environment');var attributes=require(_0xad56('0x8'));module[_0xad56('0x9')]=function(_0x41bfdf,_0x5d2048){return _0x41bfdf['define'](_0xad56('0xa'),attributes,{'tableName':_0xad56('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0xad56('0xc'),_0xad56('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 9396b70..ddac568 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 _0xa359=['request','then','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1dcd5b,_0x5f157b){var _0x1092ea=function(_0x4a4388){while(--_0x4a4388){_0x1dcd5b['push'](_0x1dcd5b['shift']());}};_0x1092ea(++_0x5f157b);}(_0xa359,0x79));var _0x9a35=function(_0x2ffb80,_0x5c17cd){_0x2ffb80=_0x2ffb80-0x0;var _0x3500a3=_0xa359[_0x2ffb80];return _0x3500a3;};'use strict';var _=require(_0x9a35('0x0'));var util=require(_0x9a35('0x1'));var moment=require('moment');var BPromise=require(_0x9a35('0x2'));var rs=require(_0x9a35('0x3'));var fs=require('fs');var Redis=require(_0x9a35('0x4'));var db=require(_0x9a35('0x5'))['db'];var utils=require(_0x9a35('0x6'));var logger=require(_0x9a35('0x7'))(_0x9a35('0x8'));var config=require('../../config/environment');var jayson=require(_0x9a35('0x9'));var client=jayson[_0x9a35('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c2729,_0xba2f54,_0x10ce32){return new BPromise(function(_0x226cc6,_0x3129fe){return client[_0x9a35('0xb')](_0x4c2729,_0x10ce32)[_0x9a35('0xc')](function(_0x4b8f41){logger['info'](_0x9a35('0xd'),_0xba2f54,'request\x20sent');logger['debug'](_0x9a35('0xe'),_0xba2f54,_0x9a35('0xf'),JSON[_0x9a35('0x10')](_0x4b8f41));if(_0x4b8f41[_0x9a35('0x11')]){if(_0x4b8f41[_0x9a35('0x11')][_0x9a35('0x12')]===0x1f4){logger[_0x9a35('0x11')]('VtigerField,\x20%s,\x20%s',_0xba2f54,_0x4b8f41['error'][_0x9a35('0x13')]);return _0x3129fe(_0x4b8f41[_0x9a35('0x11')][_0x9a35('0x13')]);}logger[_0x9a35('0x11')](_0x9a35('0xd'),_0xba2f54,_0x4b8f41[_0x9a35('0x11')][_0x9a35('0x13')]);return _0x226cc6(_0x4b8f41['error'][_0x9a35('0x13')]);}else{logger[_0x9a35('0x14')]('VtigerField,\x20%s,\x20%s',_0xba2f54,_0x9a35('0xf'));_0x226cc6(_0x4b8f41['result'][_0x9a35('0x13')]);}})[_0x9a35('0x15')](function(_0x4028b2){logger['error'](_0x9a35('0xd'),_0xba2f54,_0x4028b2);_0x3129fe(_0x4028b2);});});} \ No newline at end of file +var _0x4ce5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird'];(function(_0x36ac01,_0x36165f){var _0x394d9a=function(_0x5a0e73){while(--_0x5a0e73){_0x36ac01['push'](_0x36ac01['shift']());}};_0x394d9a(++_0x36165f);}(_0x4ce5,0x1b2));var _0x54ce=function(_0x3b0164,_0x10c2ca){_0x3b0164=_0x3b0164-0x0;var _0x144659=_0x4ce5[_0x3b0164];return _0x144659;};'use strict';var _=require(_0x54ce('0x0'));var util=require('util');var moment=require(_0x54ce('0x1'));var BPromise=require(_0x54ce('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x54ce('0x3'))['db'];var utils=require(_0x54ce('0x4'));var logger=require(_0x54ce('0x5'))(_0x54ce('0x6'));var config=require(_0x54ce('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x54ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33154e,_0xc1caec,_0x1f1ebb){return new BPromise(function(_0x5c65ed,_0x40c0e5){return client[_0x54ce('0x9')](_0x33154e,_0x1f1ebb)[_0x54ce('0xa')](function(_0x159741){logger[_0x54ce('0xb')](_0x54ce('0xc'),_0xc1caec,_0x54ce('0xd'));logger[_0x54ce('0xe')](_0x54ce('0xf'),_0xc1caec,'request\x20sent',JSON['stringify'](_0x159741));if(_0x159741[_0x54ce('0x10')]){if(_0x159741['error']['code']===0x1f4){logger[_0x54ce('0x10')](_0x54ce('0xc'),_0xc1caec,_0x159741[_0x54ce('0x10')]['message']);return _0x40c0e5(_0x159741[_0x54ce('0x10')]['message']);}logger['error'](_0x54ce('0xc'),_0xc1caec,_0x159741['error'][_0x54ce('0x11')]);return _0x5c65ed(_0x159741[_0x54ce('0x10')][_0x54ce('0x11')]);}else{logger['info'](_0x54ce('0xc'),_0xc1caec,_0x54ce('0xd'));_0x5c65ed(_0x159741['result'][_0x54ce('0x11')]);}})[_0x54ce('0x12')](function(_0x19c34c){logger['error'](_0x54ce('0xc'),_0xc1caec,_0x19c34c);_0x40c0e5(_0x19c34c);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 43e543f..b5ec4eb 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 _0xbb03=['fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x5bcad5,_0x4dc46a){var _0x3cbb78=function(_0x25b60f){while(--_0x25b60f){_0x5bcad5['push'](_0x5bcad5['shift']());}};_0x3cbb78(++_0x4dc46a);}(_0xbb03,0x7f));var _0x3bb0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbb03[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x3bb0('0x0'));var util=require(_0x3bb0('0x1'));var path=require(_0x3bb0('0x2'));var timeout=require(_0x3bb0('0x3'));var express=require('express');var router=express[_0x3bb0('0x4')]();var fs_extra=require(_0x3bb0('0x5'));var auth=require(_0x3bb0('0x6'));var interaction=require(_0x3bb0('0x7'));var config=require('../../config/environment');var controller=require(_0x3bb0('0x8'));router[_0x3bb0('0x9')]('/',auth[_0x3bb0('0xa')](),controller['index']);router[_0x3bb0('0x9')](_0x3bb0('0xb'),auth[_0x3bb0('0xa')](),controller[_0x3bb0('0xc')]);router[_0x3bb0('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3bb0('0xd')]);router['get'](_0x3bb0('0xe'),auth[_0x3bb0('0xa')](),controller[_0x3bb0('0xf')]);router[_0x3bb0('0x10')]('/',auth[_0x3bb0('0xa')](),controller[_0x3bb0('0x11')]);router[_0x3bb0('0x10')]('/:id/configurations',auth[_0x3bb0('0xa')](),controller[_0x3bb0('0x12')]);router['put'](_0x3bb0('0xb'),auth[_0x3bb0('0xa')](),controller[_0x3bb0('0x13')]);router[_0x3bb0('0x14')]('/:id',auth[_0x3bb0('0xa')](),controller[_0x3bb0('0x15')]);module['exports']=router; \ No newline at end of file +var _0xebcb=['post','/:id/configurations','addConfiguration','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','getConfigurations','/:id/fields','getFields'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0xebcb,0x85));var _0xbebc=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xebcb[_0x1bbc08];return _0x5d825b;};'use strict';var multer=require('multer');var util=require(_0xbebc('0x0'));var path=require(_0xbebc('0x1'));var timeout=require(_0xbebc('0x2'));var express=require(_0xbebc('0x3'));var router=express[_0xbebc('0x4')]();var fs_extra=require(_0xbebc('0x5'));var auth=require(_0xbebc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbebc('0x7'));var controller=require('./intZendeskAccount.controller');router[_0xbebc('0x8')]('/',auth[_0xbebc('0x9')](),controller['index']);router['get'](_0xbebc('0xa'),auth[_0xbebc('0x9')](),controller['show']);router[_0xbebc('0x8')]('/:id/configurations',auth[_0xbebc('0x9')](),controller[_0xbebc('0xb')]);router[_0xbebc('0x8')](_0xbebc('0xc'),auth[_0xbebc('0x9')](),controller[_0xbebc('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbebc('0xe')](_0xbebc('0xf'),auth[_0xbebc('0x9')](),controller[_0xbebc('0x10')]);router[_0xbebc('0x11')]('/:id',auth[_0xbebc('0x9')](),controller[_0xbebc('0x12')]);router[_0xbebc('0x13')]('/:id',auth[_0xbebc('0x9')](),controller[_0xbebc('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index d9c932b..3a2669a 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 _0xb016=['newTab','sequelize','exports','STRING','remoteUri','password','token','integrationTab'];(function(_0x4d394d,_0x40e7b3){var _0x4f0003=function(_0x56d25d){while(--_0x56d25d){_0x4d394d['push'](_0x4d394d['shift']());}};_0x4f0003(++_0x40e7b3);}(_0xb016,0x159));var _0x6b01=function(_0x145b65,_0x18418f){_0x145b65=_0x145b65-0x0;var _0x13ca65=_0xb016[_0x145b65];return _0x13ca65;};'use strict';var Sequelize=require(_0x6b01('0x0'));module[_0x6b01('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6b01('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6b01('0x2')]},'token':{'type':Sequelize[_0x6b01('0x2')]},'remoteUri':{'type':Sequelize[_0x6b01('0x2')],'unique':_0x6b01('0x3')},'authType':{'type':Sequelize['ENUM'](_0x6b01('0x4'),_0x6b01('0x5')),'defaultValue':_0x6b01('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6b01('0x6'),_0x6b01('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x627e=['integrationTab','newTab','sequelize','exports','STRING','token','password','ENUM'];(function(_0x37a52a,_0x37e3ed){var _0x2431cb=function(_0x582267){while(--_0x582267){_0x37a52a['push'](_0x37a52a['shift']());}};_0x2431cb(++_0x37e3ed);}(_0x627e,0x14a));var _0xe627=function(_0x1da11b,_0x2d5e1e){_0x1da11b=_0x1da11b-0x0;var _0x50e779=_0x627e[_0x1da11b];return _0x50e779;};'use strict';var Sequelize=require(_0xe627('0x0'));module[_0xe627('0x1')]={'name':{'type':Sequelize[_0xe627('0x2')]},'description':{'type':Sequelize[_0xe627('0x2')]},'username':{'type':Sequelize[_0xe627('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xe627('0x2')]},'token':{'type':Sequelize[_0xe627('0x2')]},'remoteUri':{'type':Sequelize[_0xe627('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM']('password',_0xe627('0x3')),'defaultValue':_0xe627('0x4')},'serverUrl':{'type':Sequelize[_0xe627('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe627('0x5')](_0xe627('0x6'),_0xe627('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 2c9757e..2848214 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 _0x7af2=['pick','VIRTUAL','filter','merge','options','includeAll','findAll','params','rawAttributes','include','catch','create','body','find','getConfigurations','findOne','ZendeskConfiguration','length','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','toString','base64','%s/token:%s','Unknown\x20authentication\x20type','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','ZendeskAccount','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','filters'];(function(_0x18c6ce,_0x146434){var _0x4e968f=function(_0x4e2415){while(--_0x4e2415){_0x18c6ce['push'](_0x18c6ce['shift']());}};_0x4e968f(++_0x146434);}(_0x7af2,0x119));var _0x27af=function(_0x4d7ea6,_0x463467){_0x4d7ea6=_0x4d7ea6-0x0;var _0x30d4ef=_0x7af2[_0x4d7ea6];return _0x30d4ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x406340,_0x203501){_0x203501=_0x203501||0xcc;return function(_0x1fd964){if(_0x1fd964){return _0x406340[_0x27af('0x17')](_0x203501);}return _0x406340[_0x27af('0x18')](_0x203501)[_0x27af('0x19')]();};}function respondWithResult(_0x234825,_0x3da435){_0x3da435=_0x3da435||0xc8;return function(_0x423222){if(_0x423222){return _0x234825[_0x27af('0x18')](_0x3da435)[_0x27af('0x1a')](_0x423222);}};}function respondWithFilteredResult(_0x9c2d4b,_0x2d7800){return function(_0x3102c4){if(_0x3102c4){var _0x2bfc9=typeof _0x2d7800[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x2d7800[_0x27af('0x1d')]==='undefined';var _0x315661=_0x3102c4[_0x27af('0x1e')];var _0x5997ae=_0x2bfc9?0x0:_0x2d7800['offset'];var _0x20a6d7=_0x2bfc9?_0x3102c4[_0x27af('0x1e')]:_0x2d7800[_0x27af('0x1b')]+_0x2d7800[_0x27af('0x1d')];var _0xec699a;if(_0x20a6d7>=_0x315661){_0x20a6d7=_0x315661;_0xec699a=0xc8;}else{_0xec699a=0xce;}_0x9c2d4b['status'](_0xec699a);return _0x9c2d4b[_0x27af('0x1f')](_0x27af('0x20'),_0x5997ae+'-'+_0x20a6d7+'/'+_0x315661)[_0x27af('0x1a')](_0x3102c4);}return null;};}function patchUpdates(_0x5e7c19){return function(_0x19afb1){try{jsonpatch[_0x27af('0x21')](_0x19afb1,_0x5e7c19,!![]);}catch(_0x2ae47e){return BPromise['reject'](_0x2ae47e);}return _0x19afb1[_0x27af('0x22')]();};}function saveUpdates(_0x2460f4,_0x30720b){return function(_0x2af76d){if(_0x2af76d){return _0x2af76d[_0x27af('0x23')](_0x2460f4)[_0x27af('0x24')](function(_0x43dd9e){return _0x43dd9e;});}return null;};}function removeEntity(_0x35b36d,_0x2e1bb0){return function(_0x49780b){if(_0x49780b){return _0x49780b['destroy']()['then'](function(){_0x35b36d[_0x27af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12625c,_0x396326){return function(_0x4ba49f){if(!_0x4ba49f){_0x12625c[_0x27af('0x17')](0x194);}return _0x4ba49f;};}function handleError(_0x1d9341,_0x463e36){_0x463e36=_0x463e36||0x1f4;return function(_0x424490){logger[_0x27af('0x25')](_0x424490[_0x27af('0x26')]);if(_0x424490[_0x27af('0x27')]){delete _0x424490['name'];}_0x1d9341[_0x27af('0x18')](_0x463e36)[_0x27af('0x28')](_0x424490);};}exports[_0x27af('0x29')]=function(_0xe009a,_0x25d65a){var _0xa08dd9={},_0x42a5b7={},_0x2b26ac={'count':0x0,'rows':[]};var _0x4406e2=_[_0x27af('0x2a')](db[_0x27af('0x2b')]['rawAttributes'],function(_0x15e867){return{'name':_0x15e867[_0x27af('0x2c')],'type':_0x15e867[_0x27af('0x2d')][_0x27af('0x2e')]};});_0x42a5b7[_0x27af('0x2f')]=_[_0x27af('0x2a')](_0x4406e2,'name');_0x42a5b7['query']=_[_0x27af('0x30')](_0xe009a[_0x27af('0x31')]);_0x42a5b7['filters']=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],_0x42a5b7[_0x27af('0x31')]);_0xa08dd9[_0x27af('0x33')]=_[_0x27af('0x32')](_0x42a5b7[_0x27af('0x2f')],qs[_0x27af('0x34')](_0xe009a[_0x27af('0x31')][_0x27af('0x34')]));_0xa08dd9[_0x27af('0x33')]=_0xa08dd9[_0x27af('0x33')]['length']?_0xa08dd9['attributes']:_0x42a5b7[_0x27af('0x2f')];if(!_0xe009a[_0x27af('0x31')]['hasOwnProperty'](_0x27af('0x35'))){_0xa08dd9[_0x27af('0x1d')]=qs['limit'](_0xe009a[_0x27af('0x31')][_0x27af('0x1d')]);_0xa08dd9[_0x27af('0x1b')]=qs[_0x27af('0x1b')](_0xe009a[_0x27af('0x31')]['offset']);}_0xa08dd9[_0x27af('0x36')]=qs[_0x27af('0x37')](_0xe009a['query']['sort']);_0xa08dd9[_0x27af('0x38')]=qs[_0x27af('0x39')](_[_0x27af('0x3a')](_0xe009a[_0x27af('0x31')],_0x42a5b7[_0x27af('0x39')]),_0x4406e2);if(_0xe009a[_0x27af('0x31')]['filter']){_0xa08dd9[_0x27af('0x38')]=_['merge'](_0xa08dd9[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x4406e2,function(_0x2a6b14){if(_0x2a6b14[_0x27af('0x2d')]!==_0x27af('0x3b')){var _0x5f5504={};_0x5f5504[_0x2a6b14[_0x27af('0x27')]]={'$like':'%'+_0xe009a[_0x27af('0x31')][_0x27af('0x3c')]+'%'};return _0x5f5504;}})});}_0xa08dd9=_[_0x27af('0x3d')]({},_0xa08dd9,_0xe009a[_0x27af('0x3e')]);var _0x32b558={'where':_0xa08dd9[_0x27af('0x38')]};return db[_0x27af('0x2b')][_0x27af('0x1e')](_0x32b558)[_0x27af('0x24')](function(_0xda424e){_0x2b26ac[_0x27af('0x1e')]=_0xda424e;if(_0xe009a[_0x27af('0x31')][_0x27af('0x3f')]){_0xa08dd9['include']=[{'all':!![]}];}return db[_0x27af('0x2b')][_0x27af('0x40')](_0xa08dd9);})[_0x27af('0x24')](function(_0x373c05){_0x2b26ac['rows']=_0x373c05;return _0x2b26ac;})[_0x27af('0x24')](respondWithFilteredResult(_0x25d65a,_0xa08dd9))['catch'](handleError(_0x25d65a,null));};exports['show']=function(_0x2425dd,_0x3c9c81){var _0x279f99={'raw':![],'where':{'id':_0x2425dd[_0x27af('0x41')]['id']}},_0x17efd6={};_0x17efd6[_0x27af('0x2f')]=_[_0x27af('0x30')](db[_0x27af('0x2b')][_0x27af('0x42')]);_0x17efd6[_0x27af('0x31')]=_[_0x27af('0x30')](_0x2425dd[_0x27af('0x31')]);_0x17efd6['filters']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],_0x17efd6['query']);_0x279f99['attributes']=_[_0x27af('0x32')](_0x17efd6[_0x27af('0x2f')],qs[_0x27af('0x34')](_0x2425dd[_0x27af('0x31')][_0x27af('0x34')]));_0x279f99['attributes']=_0x279f99[_0x27af('0x33')]['length']?_0x279f99[_0x27af('0x33')]:_0x17efd6[_0x27af('0x2f')];if(_0x2425dd[_0x27af('0x31')][_0x27af('0x3f')]){_0x279f99[_0x27af('0x43')]=[{'all':!![]}];}_0x279f99=_[_0x27af('0x3d')]({},_0x279f99,_0x2425dd[_0x27af('0x3e')]);return db['ZendeskAccount']['find'](_0x279f99)[_0x27af('0x24')](handleEntityNotFound(_0x3c9c81,null))['then'](respondWithResult(_0x3c9c81,null))[_0x27af('0x44')](handleError(_0x3c9c81,null));};exports[_0x27af('0x45')]=function(_0x226025,_0x389962){return db[_0x27af('0x2b')][_0x27af('0x45')](_0x226025[_0x27af('0x46')],{})['then'](respondWithResult(_0x389962,0xc9))[_0x27af('0x44')](handleError(_0x389962,null));};exports[_0x27af('0x23')]=function(_0x20e180,_0x3fdc0e){if(_0x20e180[_0x27af('0x46')]['id']){delete _0x20e180['body']['id'];}return db[_0x27af('0x2b')][_0x27af('0x47')]({'where':{'id':_0x20e180[_0x27af('0x41')]['id']}})['then'](handleEntityNotFound(_0x3fdc0e,null))['then'](saveUpdates(_0x20e180[_0x27af('0x46')],null))[_0x27af('0x24')](respondWithResult(_0x3fdc0e,null))[_0x27af('0x44')](handleError(_0x3fdc0e,null));};exports['destroy']=function(_0x495794,_0x2fad23){return db['ZendeskAccount'][_0x27af('0x47')]({'where':{'id':_0x495794[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2fad23,null))[_0x27af('0x24')](removeEntity(_0x2fad23,null))[_0x27af('0x44')](handleError(_0x2fad23,null));};exports[_0x27af('0x48')]=function(_0x123533,_0x374794,_0x1b6d94){var _0x24d8bf={};var _0x23369a={};var _0x5c02c1;var _0x76ed78;return db[_0x27af('0x2b')][_0x27af('0x49')]({'where':{'id':_0x123533[_0x27af('0x41')]['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x374794,null))[_0x27af('0x24')](function(_0x20c155){if(_0x20c155){_0x5c02c1=_0x20c155;_0x23369a[_0x27af('0x2f')]=_['keys'](db[_0x27af('0x4a')]['rawAttributes']);_0x23369a[_0x27af('0x31')]=_[_0x27af('0x30')](_0x123533[_0x27af('0x31')]);_0x23369a['filters']=_[_0x27af('0x32')](_0x23369a['model'],_0x23369a[_0x27af('0x31')]);_0x24d8bf[_0x27af('0x33')]=_[_0x27af('0x32')](_0x23369a['model'],qs[_0x27af('0x34')](_0x123533['query'][_0x27af('0x34')]));_0x24d8bf['attributes']=_0x24d8bf[_0x27af('0x33')][_0x27af('0x4b')]?_0x24d8bf[_0x27af('0x33')]:_0x23369a['model'];_0x24d8bf['order']=qs[_0x27af('0x37')](_0x123533[_0x27af('0x31')][_0x27af('0x37')]);_0x24d8bf[_0x27af('0x38')]=qs['filters'](_[_0x27af('0x3a')](_0x123533[_0x27af('0x31')],_0x23369a[_0x27af('0x39')]));if(_0x123533[_0x27af('0x31')][_0x27af('0x3c')]){_0x24d8bf[_0x27af('0x38')]=_['merge'](_0x24d8bf[_0x27af('0x38')],{'$or':_[_0x27af('0x2a')](_0x24d8bf[_0x27af('0x33')],function(_0x2401c7){var _0x49eb46={};_0x49eb46[_0x2401c7]={'$like':'%'+_0x123533[_0x27af('0x31')]['filter']+'%'};return _0x49eb46;})});}_0x24d8bf=_[_0x27af('0x3d')]({},_0x24d8bf,_0x123533[_0x27af('0x3e')]);return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x13a5a8){if(_0x13a5a8){_0x76ed78=_0x13a5a8['length'];if(!_0x123533['query'][_0x27af('0x4c')](_0x27af('0x35'))){_0x24d8bf[_0x27af('0x1d')]=qs['limit'](_0x123533[_0x27af('0x31')][_0x27af('0x1d')]);_0x24d8bf['offset']=qs[_0x27af('0x1b')](_0x123533[_0x27af('0x31')]['offset']);}return _0x5c02c1['getConfigurations'](_0x24d8bf);}})[_0x27af('0x24')](function(_0x1fa50b){if(_0x1fa50b){return _0x1fa50b?{'count':_0x76ed78,'rows':_0x1fa50b}:null;}})['then'](respondWithResult(_0x374794,null))['catch'](handleError(_0x374794,null));};exports[_0x27af('0x4d')]=function(_0xf97695,_0x2a8534,_0x266220){if(_0xf97695[_0x27af('0x46')]['id']){delete _0xf97695[_0x27af('0x46')]['id'];}return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0xf97695['params']['id']}})[_0x27af('0x24')](handleEntityNotFound(_0x2a8534,null))[_0x27af('0x24')](function(_0xa692f6){if(_0xa692f6){_0xf97695[_0x27af('0x46')][_0x27af('0x4e')]=_0xa692f6['id'];_0xf97695[_0x27af('0x46')][_0x27af('0x4f')]=integrations[_0x27af('0x50')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695[_0x27af('0x46')][_0x27af('0x2d')]);_0xf97695[_0x27af('0x46')][_0x27af('0x52')]=integrations[_0x27af('0x53')](_0xf97695[_0x27af('0x46')][_0x27af('0x51')],_0xf97695['body'][_0x27af('0x2d')]);return db[_0x27af('0x4a')]['create'](_0xf97695[_0x27af('0x46')],{'include':[{'model':db[_0x27af('0x54')],'as':_0x27af('0x4f')},{'model':db[_0x27af('0x54')],'as':_0x27af('0x52')}]});}return null;})[_0x27af('0x24')](respondWithResult(_0x2a8534,null))['catch'](handleError(_0x2a8534,null));};exports[_0x27af('0x55')]=function(_0x31a595,_0x3a2958,_0x4ab463){var _0x5d7af4='';return db[_0x27af('0x2b')]['findOne']({'where':{'id':_0x31a595[_0x27af('0x41')]['id']},'attributes':['id',_0x27af('0x56'),_0x27af('0x57'),_0x27af('0x58'),_0x27af('0x59'),'remoteUri']})[_0x27af('0x24')](handleEntityNotFound(_0x3a2958,null))[_0x27af('0x24')](function(_0x4ac2a3){if(_0x4ac2a3){_0x5d7af4=_0x4ac2a3[_0x27af('0x5a')];var _0xc0a98c=_0x5d7af4['slice'](-0x1);if(_0xc0a98c==='/'){_0x5d7af4=_0x5d7af4['substring'](0x0,_0x5d7af4[_0x27af('0x5b')](_0xc0a98c));}var _0x287f7c={'method':_0x27af('0x5c'),'uri':util[_0x27af('0x5d')](_0x27af('0x5e'),_0x5d7af4,_0x27af('0x5f')),'json':!![]};switch(_0x4ac2a3[_0x27af('0x59')]){case'password':_0x287f7c[_0x27af('0x60')]={'Authorization':util[_0x27af('0x5d')](_0x27af('0x61'),new Buffer(util[_0x27af('0x5d')]('%s:%s',_0x4ac2a3['username'],_0x4ac2a3[_0x27af('0x57')]))[_0x27af('0x62')](_0x27af('0x63')))};break;case _0x27af('0x58'):_0x287f7c['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x27af('0x5d')](_0x27af('0x64'),_0x4ac2a3[_0x27af('0x56')],_0x4ac2a3[_0x27af('0x58')]))[_0x27af('0x62')](_0x27af('0x63')))};break;default:throw new db['Sequelize']['ValidationError'](_0x27af('0x65'));}return rp(_0x287f7c);}})[_0x27af('0x24')](function(_0x55637f){if(_0x55637f){var _0x2c3d30=['subject','description',_0x27af('0x66'),_0x27af('0x67')];_[_0x27af('0x68')](_0x55637f[_0x27af('0x5f')],function(_0x2b7e18){return _0x2c3d30[_0x27af('0x69')](_0x2b7e18[_0x27af('0x2d')]);});return{'count':_0x55637f[_0x27af('0x5f')][_0x27af('0x4b')],'rows':_[_0x27af('0x2a')](_0x55637f[_0x27af('0x5f')],function(_0x4dd124){return{'id':_0x4dd124['id'],'name':_0x4dd124[_0x27af('0x6a')]>0x7?_0x4dd124[_0x27af('0x6b')]:_0x4dd124[_0x27af('0x2d')],'custom':_0x4dd124['position']>0x7?!![]:![],'options':_0x4dd124[_0x27af('0x6c')]?_0x4dd124[_0x27af('0x6c')]:_0x4dd124[_0x27af('0x6d')]?_0x4dd124['custom_field_options']:[]};})};}})[_0x27af('0x24')](respondWithResult(_0x3a2958,null))['catch'](function(_0x118d06){var _0x9350fa=_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?0x1f4:_0x118d06[_0x27af('0x6f')]||0x1f4;logger[_0x27af('0x25')](_0x27af('0x70'),_0x27af('0x55'),_0x9350fa,JSON['stringify'](_0x118d06));delete _0x118d06[_0x27af('0x27')];if(_0x9350fa===0x191){_0x9350fa=0x190;}_0x3a2958['status'](_0x9350fa)[_0x27af('0x28')](_0x31a595[_0x27af('0x31')][_0x27af('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x118d06['statusCode']}:_0x118d06);});}; \ No newline at end of file +var _0xd64b=['undefined','count','Content-Range','apply','update','then','stack','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','name','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','rows','catch','show','params','keys','includeAll','include','merge','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskField','Descriptions','getFields','username','password','token','remoteUri','substring','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','subject','description','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xd64b,0xc1));var _0xbd64=function(_0x3d78b5,_0x4936ed){_0x3d78b5=_0x3d78b5-0x0;var _0x380d7b=_0xd64b[_0x3d78b5];return _0x380d7b;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd64('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbd64('0x2'));var moment=require(_0xbd64('0x3'));var BPromise=require(_0xbd64('0x4'));var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd64('0x7'));var _=require(_0xbd64('0x8'));var squel=require(_0xbd64('0x9'));var crypto=require(_0xbd64('0xa'));var jsforce=require(_0xbd64('0xb'));var deskjs=require(_0xbd64('0xc'));var toCsv=require(_0xbd64('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd64('0xe'));var authService=require(_0xbd64('0xf'));var qs=require(_0xbd64('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd64('0x11'));var logger=require(_0xbd64('0x12'))(_0xbd64('0x13'));var utils=require(_0xbd64('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbd64('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd64('0x16'));function respondWithStatusCode(_0x2729d8,_0x3a941c){_0x3a941c=_0x3a941c||0xcc;return function(_0x2183e2){if(_0x2183e2){return _0x2729d8[_0xbd64('0x17')](_0x3a941c);}return _0x2729d8[_0xbd64('0x18')](_0x3a941c)[_0xbd64('0x19')]();};}function respondWithResult(_0x269e2f,_0x2b5808){_0x2b5808=_0x2b5808||0xc8;return function(_0x4ae471){if(_0x4ae471){return _0x269e2f[_0xbd64('0x18')](_0x2b5808)[_0xbd64('0x1a')](_0x4ae471);}};}function respondWithFilteredResult(_0x3ff550,_0x32fd34){return function(_0x29fc16){if(_0x29fc16){var _0x49a914=typeof _0x32fd34[_0xbd64('0x1b')]==='undefined'&&typeof _0x32fd34[_0xbd64('0x1c')]===_0xbd64('0x1d');var _0x3aef70=_0x29fc16[_0xbd64('0x1e')];var _0x17d015=_0x49a914?0x0:_0x32fd34[_0xbd64('0x1b')];var _0xa5491d=_0x49a914?_0x29fc16[_0xbd64('0x1e')]:_0x32fd34['offset']+_0x32fd34[_0xbd64('0x1c')];var _0x1f618b;if(_0xa5491d>=_0x3aef70){_0xa5491d=_0x3aef70;_0x1f618b=0xc8;}else{_0x1f618b=0xce;}_0x3ff550['status'](_0x1f618b);return _0x3ff550['set'](_0xbd64('0x1f'),_0x17d015+'-'+_0xa5491d+'/'+_0x3aef70)[_0xbd64('0x1a')](_0x29fc16);}return null;};}function patchUpdates(_0x196d21){return function(_0x39e2eb){try{jsonpatch[_0xbd64('0x20')](_0x39e2eb,_0x196d21,!![]);}catch(_0x816e00){return BPromise['reject'](_0x816e00);}return _0x39e2eb['save']();};}function saveUpdates(_0x6038f,_0x41f2f){return function(_0x12f67b){if(_0x12f67b){return _0x12f67b[_0xbd64('0x21')](_0x6038f)['then'](function(_0x51d118){return _0x51d118;});}return null;};}function removeEntity(_0x28497c,_0x4afaff){return function(_0x46ab38){if(_0x46ab38){return _0x46ab38['destroy']()[_0xbd64('0x22')](function(){_0x28497c[_0xbd64('0x18')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x2d0993,_0x5ae417){return function(_0x9d0fb8){if(!_0x9d0fb8){_0x2d0993[_0xbd64('0x17')](0x194);}return _0x9d0fb8;};}function handleError(_0x13f527,_0x2a44d0){_0x2a44d0=_0x2a44d0||0x1f4;return function(_0x4d1563){logger['error'](_0x4d1563[_0xbd64('0x23')]);if(_0x4d1563['name']){delete _0x4d1563['name'];}_0x13f527[_0xbd64('0x18')](_0x2a44d0)['send'](_0x4d1563);};}exports[_0xbd64('0x24')]=function(_0x5300e8,_0x28199c){var _0x5d8c35={},_0x1db9f3={},_0x3c0eaf={'count':0x0,'rows':[]};var _0x3be63a=_[_0xbd64('0x25')](db[_0xbd64('0x26')][_0xbd64('0x27')],function(_0x4ed44a){return{'name':_0x4ed44a[_0xbd64('0x28')],'type':_0x4ed44a[_0xbd64('0x29')][_0xbd64('0x2a')]};});_0x1db9f3[_0xbd64('0x2b')]=_[_0xbd64('0x25')](_0x3be63a,_0xbd64('0x2c'));_0x1db9f3['query']=_['keys'](_0x5300e8[_0xbd64('0x2d')]);_0x1db9f3['filters']=_[_0xbd64('0x2e')](_0x1db9f3[_0xbd64('0x2b')],_0x1db9f3['query']);_0x5d8c35['attributes']=_[_0xbd64('0x2e')](_0x1db9f3['model'],qs['fields'](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x5d8c35[_0xbd64('0x30')]=_0x5d8c35['attributes'][_0xbd64('0x31')]?_0x5d8c35['attributes']:_0x1db9f3[_0xbd64('0x2b')];if(!_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x32')](_0xbd64('0x33'))){_0x5d8c35[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x5300e8['query']['limit']);_0x5d8c35[_0xbd64('0x1b')]=qs[_0xbd64('0x1b')](_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x1b')]);}_0x5d8c35[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x5300e8['query']['sort']);_0x5d8c35[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x5300e8['query'],_0x1db9f3['filters']),_0x3be63a);if(_0x5300e8[_0xbd64('0x2d')]['filter']){_0x5d8c35[_0xbd64('0x36')]=_['merge'](_0x5d8c35[_0xbd64('0x36')],{'$or':_[_0xbd64('0x25')](_0x3be63a,function(_0x550221){if(_0x550221[_0xbd64('0x29')]!=='VIRTUAL'){var _0x534091={};_0x534091[_0x550221[_0xbd64('0x2c')]]={'$like':'%'+_0x5300e8[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x534091;}})});}_0x5d8c35=_['merge']({},_0x5d8c35,_0x5300e8['options']);var _0x5d6bcf={'where':_0x5d8c35[_0xbd64('0x36')]};return db[_0xbd64('0x26')]['count'](_0x5d6bcf)[_0xbd64('0x22')](function(_0x34b19a){_0x3c0eaf[_0xbd64('0x1e')]=_0x34b19a;if(_0x5300e8[_0xbd64('0x2d')]['includeAll']){_0x5d8c35['include']=[{'all':!![]}];}return db[_0xbd64('0x26')]['findAll'](_0x5d8c35);})['then'](function(_0x231fa6){_0x3c0eaf[_0xbd64('0x3a')]=_0x231fa6;return _0x3c0eaf;})[_0xbd64('0x22')](respondWithFilteredResult(_0x28199c,_0x5d8c35))[_0xbd64('0x3b')](handleError(_0x28199c,null));};exports[_0xbd64('0x3c')]=function(_0x3155b3,_0x247775){var _0x762380={'raw':![],'where':{'id':_0x3155b3[_0xbd64('0x3d')]['id']}},_0x4870fd={};_0x4870fd[_0xbd64('0x2b')]=_['keys'](db[_0xbd64('0x26')][_0xbd64('0x27')]);_0x4870fd[_0xbd64('0x2d')]=_[_0xbd64('0x3e')](_0x3155b3[_0xbd64('0x2d')]);_0x4870fd[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0x4870fd['model'],_0x4870fd[_0xbd64('0x2d')]);_0x762380['attributes']=_[_0xbd64('0x2e')](_0x4870fd['model'],qs[_0xbd64('0x2f')](_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x762380['attributes']=_0x762380[_0xbd64('0x30')]['length']?_0x762380['attributes']:_0x4870fd['model'];if(_0x3155b3[_0xbd64('0x2d')][_0xbd64('0x3f')]){_0x762380[_0xbd64('0x40')]=[{'all':!![]}];}_0x762380=_[_0xbd64('0x41')]({},_0x762380,_0x3155b3[_0xbd64('0x42')]);return db[_0xbd64('0x26')][_0xbd64('0x43')](_0x762380)['then'](handleEntityNotFound(_0x247775,null))[_0xbd64('0x22')](respondWithResult(_0x247775,null))[_0xbd64('0x3b')](handleError(_0x247775,null));};exports[_0xbd64('0x44')]=function(_0x4e5efe,_0x105bee){return db[_0xbd64('0x26')][_0xbd64('0x44')](_0x4e5efe[_0xbd64('0x45')],{})[_0xbd64('0x22')](respondWithResult(_0x105bee,0xc9))['catch'](handleError(_0x105bee,null));};exports[_0xbd64('0x21')]=function(_0x1a9ec8,_0x2a8011){if(_0x1a9ec8[_0xbd64('0x45')]['id']){delete _0x1a9ec8['body']['id'];}return db['ZendeskAccount'][_0xbd64('0x43')]({'where':{'id':_0x1a9ec8[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2a8011,null))[_0xbd64('0x22')](saveUpdates(_0x1a9ec8[_0xbd64('0x45')],null))[_0xbd64('0x22')](respondWithResult(_0x2a8011,null))[_0xbd64('0x3b')](handleError(_0x2a8011,null));};exports[_0xbd64('0x46')]=function(_0x460158,_0x2709b2){return db[_0xbd64('0x26')][_0xbd64('0x43')]({'where':{'id':_0x460158[_0xbd64('0x3d')]['id']}})[_0xbd64('0x22')](handleEntityNotFound(_0x2709b2,null))[_0xbd64('0x22')](removeEntity(_0x2709b2,null))['catch'](handleError(_0x2709b2,null));};exports[_0xbd64('0x47')]=function(_0x4952db,_0x5ede67,_0x552c95){var _0x4aa662={};var _0xced0ca={};var _0x2f56df;var _0x5480f5;return db[_0xbd64('0x26')][_0xbd64('0x48')]({'where':{'id':_0x4952db[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0x5ede67,null))[_0xbd64('0x22')](function(_0x371bad){if(_0x371bad){_0x2f56df=_0x371bad;_0xced0ca[_0xbd64('0x2b')]=_[_0xbd64('0x3e')](db[_0xbd64('0x49')][_0xbd64('0x27')]);_0xced0ca['query']=_['keys'](_0x4952db['query']);_0xced0ca[_0xbd64('0x37')]=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],_0xced0ca[_0xbd64('0x2d')]);_0x4aa662['attributes']=_[_0xbd64('0x2e')](_0xced0ca[_0xbd64('0x2b')],qs[_0xbd64('0x2f')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x2f')]));_0x4aa662[_0xbd64('0x30')]=_0x4aa662['attributes'][_0xbd64('0x31')]?_0x4aa662[_0xbd64('0x30')]:_0xced0ca[_0xbd64('0x2b')];_0x4aa662[_0xbd64('0x34')]=qs[_0xbd64('0x35')](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x35')]);_0x4aa662[_0xbd64('0x36')]=qs[_0xbd64('0x37')](_[_0xbd64('0x38')](_0x4952db[_0xbd64('0x2d')],_0xced0ca[_0xbd64('0x37')]));if(_0x4952db['query']['filter']){_0x4aa662[_0xbd64('0x36')]=_[_0xbd64('0x41')](_0x4aa662['where'],{'$or':_['map'](_0x4aa662[_0xbd64('0x30')],function(_0x12bc56){var _0x49051a={};_0x49051a[_0x12bc56]={'$like':'%'+_0x4952db[_0xbd64('0x2d')][_0xbd64('0x39')]+'%'};return _0x49051a;})});}_0x4aa662=_[_0xbd64('0x41')]({},_0x4aa662,_0x4952db[_0xbd64('0x42')]);return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x2d788){if(_0x2d788){_0x5480f5=_0x2d788[_0xbd64('0x31')];if(!_0x4952db[_0xbd64('0x2d')]['hasOwnProperty'](_0xbd64('0x33'))){_0x4aa662[_0xbd64('0x1c')]=qs[_0xbd64('0x1c')](_0x4952db['query'][_0xbd64('0x1c')]);_0x4aa662[_0xbd64('0x1b')]=qs['offset'](_0x4952db[_0xbd64('0x2d')][_0xbd64('0x1b')]);}return _0x2f56df[_0xbd64('0x47')](_0x4aa662);}})[_0xbd64('0x22')](function(_0x3615bc){if(_0x3615bc){return _0x3615bc?{'count':_0x5480f5,'rows':_0x3615bc}:null;}})[_0xbd64('0x22')](respondWithResult(_0x5ede67,null))['catch'](handleError(_0x5ede67,null));};exports[_0xbd64('0x4a')]=function(_0x1f3bd0,_0xc57eb1,_0x28d899){if(_0x1f3bd0['body']['id']){delete _0x1f3bd0[_0xbd64('0x45')]['id'];}return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x1f3bd0[_0xbd64('0x3d')]['id']}})['then'](handleEntityNotFound(_0xc57eb1,null))[_0xbd64('0x22')](function(_0x10e269){if(_0x10e269){_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4b')]=_0x10e269['id'];_0x1f3bd0['body'][_0xbd64('0x4c')]=integrations[_0xbd64('0x4d')](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);_0x1f3bd0['body']['Descriptions']=integrations['getDescriptions'](_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x4e')],_0x1f3bd0[_0xbd64('0x45')][_0xbd64('0x29')]);return db[_0xbd64('0x49')][_0xbd64('0x44')](_0x1f3bd0['body'],{'include':[{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x4c')},{'model':db[_0xbd64('0x4f')],'as':_0xbd64('0x50')}]});}return null;})[_0xbd64('0x22')](respondWithResult(_0xc57eb1,null))[_0xbd64('0x3b')](handleError(_0xc57eb1,null));};exports[_0xbd64('0x51')]=function(_0x3d7e47,_0x301f42,_0x18e724){var _0x32e611='';return db[_0xbd64('0x26')]['findOne']({'where':{'id':_0x3d7e47['params']['id']},'attributes':['id',_0xbd64('0x52'),_0xbd64('0x53'),_0xbd64('0x54'),'authType',_0xbd64('0x55')]})['then'](handleEntityNotFound(_0x301f42,null))[_0xbd64('0x22')](function(_0x36ebb5){if(_0x36ebb5){_0x32e611=_0x36ebb5[_0xbd64('0x55')];var _0x819774=_0x32e611['slice'](-0x1);if(_0x819774==='/'){_0x32e611=_0x32e611[_0xbd64('0x56')](0x0,_0x32e611['lastIndexOf'](_0x819774));}var _0x14f79e={'method':_0xbd64('0x57'),'uri':util[_0xbd64('0x58')](_0xbd64('0x59'),_0x32e611,_0xbd64('0x5a')),'json':!![]};switch(_0x36ebb5['authType']){case _0xbd64('0x53'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util['format'](_0xbd64('0x5c'),new Buffer(util[_0xbd64('0x58')](_0xbd64('0x5d'),_0x36ebb5[_0xbd64('0x52')],_0x36ebb5['password']))[_0xbd64('0x5e')]('base64'))};break;case _0xbd64('0x54'):_0x14f79e[_0xbd64('0x5b')]={'Authorization':util[_0xbd64('0x58')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x36ebb5['username'],_0x36ebb5[_0xbd64('0x54')]))[_0xbd64('0x5e')](_0xbd64('0x5f')))};break;default:throw new db[(_0xbd64('0x60'))][(_0xbd64('0x61'))]('Unknown\x20authentication\x20type');}return rp(_0x14f79e);}})[_0xbd64('0x22')](function(_0x23de71){if(_0x23de71){var _0xac13e6=[_0xbd64('0x62'),_0xbd64('0x63'),'group',_0xbd64('0x64')];_[_0xbd64('0x65')](_0x23de71[_0xbd64('0x5a')],function(_0x808467){return _0xac13e6['includes'](_0x808467['type']);});return{'count':_0x23de71[_0xbd64('0x5a')][_0xbd64('0x31')],'rows':_[_0xbd64('0x25')](_0x23de71[_0xbd64('0x5a')],function(_0x18b0f0){return{'id':_0x18b0f0['id'],'name':_0x18b0f0[_0xbd64('0x66')]>0x7?_0x18b0f0[_0xbd64('0x67')]:_0x18b0f0[_0xbd64('0x29')],'custom':_0x18b0f0['position']>0x7?!![]:![],'options':_0x18b0f0[_0xbd64('0x68')]?_0x18b0f0['system_field_options']:_0x18b0f0[_0xbd64('0x69')]?_0x18b0f0[_0xbd64('0x69')]:[]};})};}})[_0xbd64('0x22')](respondWithResult(_0x301f42,null))['catch'](function(_0x15b625){var _0x5c30f9=_0x3d7e47['query'][_0xbd64('0x6a')]?0x1f4:_0x15b625[_0xbd64('0x6b')]||0x1f4;logger[_0xbd64('0x6c')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd64('0x51'),_0x5c30f9,JSON[_0xbd64('0x6d')](_0x15b625));delete _0x15b625[_0xbd64('0x2c')];if(_0x5c30f9===0x191){_0x5c30f9=0x190;}_0x301f42[_0xbd64('0x18')](_0x5c30f9)['send'](_0x3d7e47[_0xbd64('0x2d')][_0xbd64('0x6a')]?{'message':_0xbd64('0x6e'),'statusCode':_0x15b625[_0xbd64('0x6b')]}:_0x15b625);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 9f9bf1f..10628fa 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 _0x8190=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x42e407,_0x1d65d5){var _0x4761c0=function(_0x36a587){while(--_0x36a587){_0x42e407['push'](_0x42e407['shift']());}};_0x4761c0(++_0x1d65d5);}(_0x8190,0x1e6));var _0x0819=function(_0x427106,_0x3f3c52){_0x427106=_0x427106-0x0;var _0x73bf25=_0x8190[_0x427106];return _0x73bf25;};'use strict';var _=require(_0x0819('0x0'));var util=require(_0x0819('0x1'));var logger=require(_0x0819('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0819('0x3'));var rp=require(_0x0819('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0819('0x5'));var config=require(_0x0819('0x6'));var attributes=require(_0x0819('0x7'));var integrations=require(_0x0819('0x8'));module[_0x0819('0x9')]=function(_0x3b97ba,_0x382136){return _0x3b97ba[_0x0819('0xa')]('ZendeskAccount',attributes,{'tableName':_0x0819('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7a3=['../../config/environment','./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x215f2c,_0x4dbda1){var _0x193f9d=function(_0x4f3b3f){while(--_0x4f3b3f){_0x215f2c['push'](_0x215f2c['shift']());}};_0x193f9d(++_0x4dbda1);}(_0xa7a3,0x102));var _0x3a7a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa7a3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3a7a('0x0'));var util=require(_0x3a7a('0x1'));var logger=require(_0x3a7a('0x2'))(_0x3a7a('0x3'));var moment=require(_0x3a7a('0x4'));var BPromise=require(_0x3a7a('0x5'));var rp=require(_0x3a7a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a7a('0x7'));var config=require(_0x3a7a('0x8'));var attributes=require(_0x3a7a('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x3a7a('0xa')]=function(_0x27b03b,_0x20b6db){return _0x27b03b[_0x3a7a('0xb')](_0x3a7a('0xc'),attributes,{'tableName':_0x3a7a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 8a47742..01f2b98 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 _0xc904=['model','then','GetZendeskAccount','ShowZendeskAccount','find','raw','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ZendeskAccount','findAll','options','where','attributes','include','map'];(function(_0xb400c,_0x386824){var _0xfe8b97=function(_0x251541){while(--_0x251541){_0xb400c['push'](_0xb400c['shift']());}};_0xfe8b97(++_0x386824);}(_0xc904,0x1aa));var _0x4c90=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc904[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x4c90('0x0'));var util=require(_0x4c90('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4c90('0x2'));var fs=require('fs');var Redis=require(_0x4c90('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c90('0x4'));var logger=require(_0x4c90('0x5'))(_0x4c90('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c90('0x7'));var client=jayson[_0x4c90('0x8')][_0x4c90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a0315,_0x20b0b2,_0x30f19d){return new BPromise(function(_0x126682,_0x3d95d6){return client[_0x4c90('0xa')](_0x1a0315,_0x30f19d)['then'](function(_0x30bb3c){logger['info'](_0x4c90('0xb'),_0x20b0b2,_0x4c90('0xc'));logger[_0x4c90('0xd')](_0x4c90('0xe'),_0x20b0b2,_0x4c90('0xc'),JSON[_0x4c90('0xf')](_0x30bb3c));if(_0x30bb3c[_0x4c90('0x10')]){if(_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x11')]===0x1f4){logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);return _0x3d95d6(_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);}logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x30bb3c[_0x4c90('0x10')][_0x4c90('0x12')]);return _0x126682(_0x30bb3c['error'][_0x4c90('0x12')]);}else{logger[_0x4c90('0x13')](_0x4c90('0xb'),_0x20b0b2,_0x4c90('0xc'));_0x126682(_0x30bb3c[_0x4c90('0x14')][_0x4c90('0x12')]);}})[_0x4c90('0x15')](function(_0x5763c0){logger[_0x4c90('0x10')](_0x4c90('0xb'),_0x20b0b2,_0x5763c0);_0x3d95d6(_0x5763c0);});});}exports['GetZendeskAccount']=function(_0x4ea961){var _0x7b8108=this;return new Promise(function(_0xe151a9,_0x3aa69c){return db[_0x4c90('0x16')][_0x4c90('0x17')]({'raw':_0x4ea961[_0x4c90('0x18')]?_0x4ea961['options']['raw']===undefined?!![]:![]:!![],'where':_0x4ea961[_0x4c90('0x18')]?_0x4ea961[_0x4c90('0x18')][_0x4c90('0x19')]||null:null,'attributes':_0x4ea961[_0x4c90('0x18')]?_0x4ea961[_0x4c90('0x18')][_0x4c90('0x1a')]||null:null,'limit':_0x4ea961[_0x4c90('0x18')]?_0x4ea961[_0x4c90('0x18')]['limit']||null:null,'include':_0x4ea961['options']?_0x4ea961[_0x4c90('0x18')][_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0x4ea961['options'][_0x4c90('0x1b')],function(_0x45988c){return{'model':db[_0x45988c[_0x4c90('0x1d')]],'as':_0x45988c['as'],'attributes':_0x45988c['attributes'],'include':_0x45988c[_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0x45988c[_0x4c90('0x1b')],function(_0xf1f792){return{'model':db[_0xf1f792[_0x4c90('0x1d')]],'as':_0xf1f792['as'],'attributes':_0xf1f792[_0x4c90('0x1a')],'include':_0xf1f792[_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0xf1f792[_0x4c90('0x1b')],function(_0x142d4f){return{'model':db[_0x142d4f['model']],'as':_0x142d4f['as'],'attributes':_0x142d4f['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c90('0x1e')](function(_0x3338e2){logger[_0x4c90('0x13')](_0x4c90('0x1f'),_0x4ea961);logger[_0x4c90('0xd')]('GetZendeskAccount',_0x4ea961,JSON[_0x4c90('0xf')](_0x3338e2));_0xe151a9(_0x3338e2);})[_0x4c90('0x15')](function(_0x26e1ce){logger[_0x4c90('0x10')](_0x4c90('0x1f'),_0x26e1ce[_0x4c90('0x12')],_0x4ea961);_0x3aa69c(_0x7b8108[_0x4c90('0x10')](0x1f4,_0x26e1ce[_0x4c90('0x12')]));});});};exports[_0x4c90('0x20')]=function(_0x5e6dc4){var _0x33af80=this;return new Promise(function(_0x37af4e,_0x537a76){return db[_0x4c90('0x16')][_0x4c90('0x21')]({'raw':_0x5e6dc4[_0x4c90('0x18')]?_0x5e6dc4[_0x4c90('0x18')][_0x4c90('0x22')]===undefined?!![]:![]:!![],'where':_0x5e6dc4['options']?_0x5e6dc4['options'][_0x4c90('0x19')]||null:null,'attributes':_0x5e6dc4[_0x4c90('0x18')]?_0x5e6dc4['options'][_0x4c90('0x1a')]||null:null,'include':_0x5e6dc4[_0x4c90('0x18')]?_0x5e6dc4['options']['include']?_[_0x4c90('0x1c')](_0x5e6dc4[_0x4c90('0x18')][_0x4c90('0x1b')],function(_0x351e7f){return{'model':db[_0x351e7f[_0x4c90('0x1d')]],'as':_0x351e7f['as'],'attributes':_0x351e7f['attributes'],'include':_0x351e7f[_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0x351e7f[_0x4c90('0x1b')],function(_0x3da504){return{'model':db[_0x3da504['model']],'as':_0x3da504['as'],'attributes':_0x3da504[_0x4c90('0x1a')],'include':_0x3da504[_0x4c90('0x1b')]?_[_0x4c90('0x1c')](_0x3da504[_0x4c90('0x1b')],function(_0x451a1e){return{'model':db[_0x451a1e[_0x4c90('0x1d')]],'as':_0x451a1e['as'],'attributes':_0x451a1e[_0x4c90('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4c90('0x1e')](function(_0x57740c){logger[_0x4c90('0x13')](_0x4c90('0x20'),_0x5e6dc4);logger[_0x4c90('0xd')](_0x4c90('0x20'),_0x5e6dc4,JSON[_0x4c90('0xf')](_0x57740c));_0x37af4e(_0x57740c);})['catch'](function(_0x3df2f5){logger[_0x4c90('0x10')](_0x4c90('0x20'),_0x3df2f5['message'],_0x5e6dc4);_0x537a76(_0x33af80[_0x4c90('0x10')](0x1f4,_0x3df2f5['message']));});});}; \ No newline at end of file +var _0xa245=['limit','include','model','map','GetZendeskAccount','stringify','ZendeskAccount','find','ShowZendeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','findAll','options','raw','where','attributes'];(function(_0x154b31,_0x2d12bc){var _0x1183d8=function(_0x5c9e27){while(--_0x5c9e27){_0x154b31['push'](_0x154b31['shift']());}};_0x1183d8(++_0x2d12bc);}(_0xa245,0x195));var _0x5a24=function(_0x1cc69f,_0x158209){_0x1cc69f=_0x1cc69f-0x0;var _0x3c7334=_0xa245[_0x1cc69f];return _0x3c7334;};'use strict';var _=require(_0x5a24('0x0'));var util=require(_0x5a24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5a24('0x2'));var fs=require('fs');var Redis=require(_0x5a24('0x3'));var db=require(_0x5a24('0x4'))['db'];var utils=require(_0x5a24('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5a24('0x6')][_0x5a24('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x363f4a,_0x5d88ac,_0x448597){return new BPromise(function(_0xdcc422,_0xc6591d){return client[_0x5a24('0x8')](_0x363f4a,_0x448597)[_0x5a24('0x9')](function(_0x4190a1){logger[_0x5a24('0xa')](_0x5a24('0xb'),_0x5d88ac,'request\x20sent');logger[_0x5a24('0xc')](_0x5a24('0xd'),_0x5d88ac,_0x5a24('0xe'),JSON['stringify'](_0x4190a1));if(_0x4190a1[_0x5a24('0xf')]){if(_0x4190a1[_0x5a24('0xf')]['code']===0x1f4){logger[_0x5a24('0xf')](_0x5a24('0xb'),_0x5d88ac,_0x4190a1[_0x5a24('0xf')][_0x5a24('0x10')]);return _0xc6591d(_0x4190a1[_0x5a24('0xf')][_0x5a24('0x10')]);}logger[_0x5a24('0xf')](_0x5a24('0xb'),_0x5d88ac,_0x4190a1[_0x5a24('0xf')][_0x5a24('0x10')]);return _0xdcc422(_0x4190a1[_0x5a24('0xf')]['message']);}else{logger[_0x5a24('0xa')](_0x5a24('0xb'),_0x5d88ac,_0x5a24('0xe'));_0xdcc422(_0x4190a1[_0x5a24('0x11')][_0x5a24('0x10')]);}})[_0x5a24('0x12')](function(_0x5dcaef){logger[_0x5a24('0xf')](_0x5a24('0xb'),_0x5d88ac,_0x5dcaef);_0xc6591d(_0x5dcaef);});});}exports['GetZendeskAccount']=function(_0x3bfd6a){var _0x506f7c=this;return new Promise(function(_0x2aed95,_0x3bbade){return db['ZendeskAccount'][_0x5a24('0x13')]({'raw':_0x3bfd6a[_0x5a24('0x14')]?_0x3bfd6a[_0x5a24('0x14')][_0x5a24('0x15')]===undefined?!![]:![]:!![],'where':_0x3bfd6a['options']?_0x3bfd6a[_0x5a24('0x14')][_0x5a24('0x16')]||null:null,'attributes':_0x3bfd6a[_0x5a24('0x14')]?_0x3bfd6a[_0x5a24('0x14')][_0x5a24('0x17')]||null:null,'limit':_0x3bfd6a[_0x5a24('0x14')]?_0x3bfd6a[_0x5a24('0x14')][_0x5a24('0x18')]||null:null,'include':_0x3bfd6a['options']?_0x3bfd6a['options'][_0x5a24('0x19')]?_['map'](_0x3bfd6a[_0x5a24('0x14')][_0x5a24('0x19')],function(_0x17cdb0){return{'model':db[_0x17cdb0[_0x5a24('0x1a')]],'as':_0x17cdb0['as'],'attributes':_0x17cdb0[_0x5a24('0x17')],'include':_0x17cdb0[_0x5a24('0x19')]?_['map'](_0x17cdb0[_0x5a24('0x19')],function(_0x55f286){return{'model':db[_0x55f286['model']],'as':_0x55f286['as'],'attributes':_0x55f286[_0x5a24('0x17')],'include':_0x55f286[_0x5a24('0x19')]?_[_0x5a24('0x1b')](_0x55f286[_0x5a24('0x19')],function(_0x54507e){return{'model':db[_0x54507e[_0x5a24('0x1a')]],'as':_0x54507e['as'],'attributes':_0x54507e[_0x5a24('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5a24('0x9')](function(_0x2f0d2b){logger[_0x5a24('0xa')](_0x5a24('0x1c'),_0x3bfd6a);logger[_0x5a24('0xc')](_0x5a24('0x1c'),_0x3bfd6a,JSON[_0x5a24('0x1d')](_0x2f0d2b));_0x2aed95(_0x2f0d2b);})[_0x5a24('0x12')](function(_0x25fb1c){logger[_0x5a24('0xf')](_0x5a24('0x1c'),_0x25fb1c[_0x5a24('0x10')],_0x3bfd6a);_0x3bbade(_0x506f7c['error'](0x1f4,_0x25fb1c[_0x5a24('0x10')]));});});};exports['ShowZendeskAccount']=function(_0x47237d){var _0x11153a=this;return new Promise(function(_0x58880c,_0x308cdf){return db[_0x5a24('0x1e')][_0x5a24('0x1f')]({'raw':_0x47237d['options']?_0x47237d['options']['raw']===undefined?!![]:![]:!![],'where':_0x47237d[_0x5a24('0x14')]?_0x47237d[_0x5a24('0x14')]['where']||null:null,'attributes':_0x47237d[_0x5a24('0x14')]?_0x47237d[_0x5a24('0x14')]['attributes']||null:null,'include':_0x47237d[_0x5a24('0x14')]?_0x47237d[_0x5a24('0x14')][_0x5a24('0x19')]?_[_0x5a24('0x1b')](_0x47237d[_0x5a24('0x14')][_0x5a24('0x19')],function(_0x329bee){return{'model':db[_0x329bee[_0x5a24('0x1a')]],'as':_0x329bee['as'],'attributes':_0x329bee['attributes'],'include':_0x329bee['include']?_[_0x5a24('0x1b')](_0x329bee[_0x5a24('0x19')],function(_0x2dbfe9){return{'model':db[_0x2dbfe9[_0x5a24('0x1a')]],'as':_0x2dbfe9['as'],'attributes':_0x2dbfe9[_0x5a24('0x17')],'include':_0x2dbfe9[_0x5a24('0x19')]?_['map'](_0x2dbfe9[_0x5a24('0x19')],function(_0x519947){return{'model':db[_0x519947['model']],'as':_0x519947['as'],'attributes':_0x519947[_0x5a24('0x17')]};}):[]};}):[]};}):[]:[]})[_0x5a24('0x9')](function(_0x39b7e6){logger[_0x5a24('0xa')]('ShowZendeskAccount',_0x47237d);logger['debug']('ShowZendeskAccount',_0x47237d,JSON[_0x5a24('0x1d')](_0x39b7e6));_0x58880c(_0x39b7e6);})[_0x5a24('0x12')](function(_0x4712ec){logger[_0x5a24('0xf')](_0x5a24('0x20'),_0x4712ec['message'],_0x47237d);_0x308cdf(_0x11153a[_0x5a24('0xf')](0x1f4,_0x4712ec[_0x5a24('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 56c0b9b..37bf9e8 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 _0xe706=['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','/:id/tags','getTags','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x3c074,_0x104c66){var _0x3ec6d7=function(_0x163561){while(--_0x163561){_0x3c074['push'](_0x3c074['shift']());}};_0x3ec6d7(++_0x104c66);}(_0xe706,0xa3));var _0x6e70=function(_0x1c1798,_0x24812b){_0x1c1798=_0x1c1798-0x0;var _0x4f235e=_0xe706[_0x1c1798];return _0x4f235e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0xa')](_0x6e70('0x11'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0xa')](_0x6e70('0x13'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x6e70('0xa')](_0x6e70('0x14'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x15')]);router[_0x6e70('0x16')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x17')]);router[_0x6e70('0x16')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x6e70('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6e70('0x19')]);router[_0x6e70('0x1a')]('/:id',auth[_0x6e70('0xb')](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +var _0x9ffd=['update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put'];(function(_0xe38764,_0x28ce79){var _0x5979cf=function(_0x1fedef){while(--_0x1fedef){_0xe38764['push'](_0xe38764['shift']());}};_0x5979cf(++_0x28ce79);}(_0x9ffd,0xaa));var _0xd9ff=function(_0xaade86,_0x27d7db){_0xaade86=_0xaade86-0x0;var _0x223c0b=_0x9ffd[_0xaade86];return _0x223c0b;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0xb')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['getTags']);router['post']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['setTags']);router[_0xd9ff('0x15')](_0xd9ff('0xc'),auth['isAuthenticated'](),controller[_0xd9ff('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd9ff('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 7469003..a6b4d80 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 _0xfc14=['sequelize','STRING'];(function(_0x49b5ed,_0x35cb99){var _0x117247=function(_0x13d664){while(--_0x13d664){_0x49b5ed['push'](_0x49b5ed['shift']());}};_0x117247(++_0x35cb99);}(_0xfc14,0x138));var _0x4fc1=function(_0x150e08,_0x250886){_0x150e08=_0x150e08-0x0;var _0xc45681=_0xfc14[_0x150e08];return _0xc45681;};'use strict';var Sequelize=require(_0x4fc1('0x0'));module['exports']={'name':{'type':Sequelize[_0x4fc1('0x1')]},'description':{'type':Sequelize[_0x4fc1('0x1')]}}; \ No newline at end of file +var _0x8d43=['STRING','sequelize'];(function(_0xd8b6b4,_0x5aa2f4){var _0x407e69=function(_0x8b41){while(--_0x8b41){_0xd8b6b4['push'](_0xd8b6b4['shift']());}};_0x407e69(++_0x5aa2f4);}(_0x8d43,0xa9));var _0x38d4=function(_0x2ff585,_0x68d662){_0x2ff585=_0x2ff585-0x0;var _0x5e03d5=_0x8d43[_0x2ff585];return _0x5e03d5;};'use strict';var Sequelize=require(_0x38d4('0x0'));module['exports']={'name':{'type':Sequelize[_0x38d4('0x1')]},'description':{'type':Sequelize[_0x38d4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 8b94243..a9d69bb 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 _0xee25=['fieldName','key','model','map','query','keys','attributes','intersection','fields','length','nolimit','sort','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','filters','includeAll','find','create','body','params','getFields','findOne','ZendeskField','hasOwnProperty','order','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskConfiguration','rawAttributes'];(function(_0x4a93be,_0x4bc1b4){var _0x14733e=function(_0xda849c){while(--_0xda849c){_0x4a93be['push'](_0x4a93be['shift']());}};_0x14733e(++_0x4bc1b4);}(_0xee25,0xd8));var _0x5ee2=function(_0x4b644f,_0x405ecd){_0x4b644f=_0x4b644f-0x0;var _0x1e6bdb=_0xee25[_0x4b644f];return _0x1e6bdb;};'use strict';var emlformat=require(_0x5ee2('0x0'));var rimraf=require(_0x5ee2('0x1'));var zipdir=require(_0x5ee2('0x2'));var jsonpatch=require(_0x5ee2('0x3'));var rp=require(_0x5ee2('0x4'));var moment=require(_0x5ee2('0x5'));var BPromise=require(_0x5ee2('0x6'));var Mustache=require(_0x5ee2('0x7'));var util=require(_0x5ee2('0x8'));var path=require(_0x5ee2('0x9'));var sox=require(_0x5ee2('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ee2('0xb'));var _=require(_0x5ee2('0xc'));var squel=require(_0x5ee2('0xd'));var crypto=require('crypto');var jsforce=require(_0x5ee2('0xe'));var deskjs=require(_0x5ee2('0xf'));var toCsv=require(_0x5ee2('0x10'));var querystring=require(_0x5ee2('0x11'));var Papa=require(_0x5ee2('0x12'));var Redis=require(_0x5ee2('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5ee2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ee2('0x15'));var logger=require(_0x5ee2('0x16'))(_0x5ee2('0x17'));var utils=require('../../config/utils');var config=require(_0x5ee2('0x18'));var licenseUtil=require(_0x5ee2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f98d3,_0x3930da){_0x3930da=_0x3930da||0xcc;return function(_0x1fa415){if(_0x1fa415){return _0x4f98d3[_0x5ee2('0x1a')](_0x3930da);}return _0x4f98d3[_0x5ee2('0x1b')](_0x3930da)[_0x5ee2('0x1c')]();};}function respondWithResult(_0x1f9b9f,_0x4b2c43){_0x4b2c43=_0x4b2c43||0xc8;return function(_0x3ca82a){if(_0x3ca82a){return _0x1f9b9f[_0x5ee2('0x1b')](_0x4b2c43)[_0x5ee2('0x1d')](_0x3ca82a);}};}function respondWithFilteredResult(_0x365705,_0x3111d9){return function(_0x4fef44){if(_0x4fef44){var _0x3a7cea=typeof _0x3111d9[_0x5ee2('0x1e')]===_0x5ee2('0x1f')&&typeof _0x3111d9[_0x5ee2('0x20')]===_0x5ee2('0x1f');var _0x418c62=_0x4fef44[_0x5ee2('0x21')];var _0x478456=_0x3a7cea?0x0:_0x3111d9[_0x5ee2('0x1e')];var _0x30c2df=_0x3a7cea?_0x4fef44['count']:_0x3111d9[_0x5ee2('0x1e')]+_0x3111d9[_0x5ee2('0x20')];var _0x14fe65;if(_0x30c2df>=_0x418c62){_0x30c2df=_0x418c62;_0x14fe65=0xc8;}else{_0x14fe65=0xce;}_0x365705[_0x5ee2('0x1b')](_0x14fe65);return _0x365705[_0x5ee2('0x22')](_0x5ee2('0x23'),_0x478456+'-'+_0x30c2df+'/'+_0x418c62)['json'](_0x4fef44);}return null;};}function patchUpdates(_0x318417){return function(_0x1d27f7){try{jsonpatch[_0x5ee2('0x24')](_0x1d27f7,_0x318417,!![]);}catch(_0x2afa2a){return BPromise[_0x5ee2('0x25')](_0x2afa2a);}return _0x1d27f7['save']();};}function saveUpdates(_0x1a17fd,_0x5392a2){return function(_0xa2c0d8){if(_0xa2c0d8){return _0xa2c0d8[_0x5ee2('0x26')](_0x1a17fd)[_0x5ee2('0x27')](function(_0x3800c0){return _0x3800c0;});}return null;};}function removeEntity(_0x546692,_0x278536){return function(_0x1b063c){if(_0x1b063c){return _0x1b063c[_0x5ee2('0x28')]()['then'](function(){_0x546692[_0x5ee2('0x1b')](0xcc)[_0x5ee2('0x1c')]();});}};}function handleEntityNotFound(_0x48cc32,_0xeda1c0){return function(_0xa4edaa){if(!_0xa4edaa){_0x48cc32[_0x5ee2('0x1a')](0x194);}return _0xa4edaa;};}function handleError(_0x55c88e,_0x20114f){_0x20114f=_0x20114f||0x1f4;return function(_0x4d0aab){logger[_0x5ee2('0x29')](_0x4d0aab[_0x5ee2('0x2a')]);if(_0x4d0aab[_0x5ee2('0x2b')]){delete _0x4d0aab[_0x5ee2('0x2b')];}_0x55c88e[_0x5ee2('0x1b')](_0x20114f)[_0x5ee2('0x2c')](_0x4d0aab);};}exports[_0x5ee2('0x2d')]=function(_0x1b7540,_0x5dafec){var _0xa7faf7={},_0x52804f={},_0x3ce2a8={'count':0x0,'rows':[]};var _0x2d23c8=_['map'](db[_0x5ee2('0x2e')][_0x5ee2('0x2f')],function(_0x10560d){return{'name':_0x10560d[_0x5ee2('0x30')],'type':_0x10560d['type'][_0x5ee2('0x31')]};});_0x52804f[_0x5ee2('0x32')]=_[_0x5ee2('0x33')](_0x2d23c8,'name');_0x52804f[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x1b7540[_0x5ee2('0x34')]);_0x52804f['filters']=_['intersection'](_0x52804f['model'],_0x52804f[_0x5ee2('0x34')]);_0xa7faf7[_0x5ee2('0x36')]=_[_0x5ee2('0x37')](_0x52804f[_0x5ee2('0x32')],qs[_0x5ee2('0x38')](_0x1b7540[_0x5ee2('0x34')][_0x5ee2('0x38')]));_0xa7faf7['attributes']=_0xa7faf7[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0xa7faf7[_0x5ee2('0x36')]:_0x52804f[_0x5ee2('0x32')];if(!_0x1b7540[_0x5ee2('0x34')]['hasOwnProperty'](_0x5ee2('0x3a'))){_0xa7faf7[_0x5ee2('0x20')]=qs['limit'](_0x1b7540[_0x5ee2('0x34')]['limit']);_0xa7faf7[_0x5ee2('0x1e')]=qs['offset'](_0x1b7540['query'][_0x5ee2('0x1e')]);}_0xa7faf7['order']=qs[_0x5ee2('0x3b')](_0x1b7540[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0xa7faf7[_0x5ee2('0x3c')]=qs['filters'](_['pick'](_0x1b7540['query'],_0x52804f['filters']),_0x2d23c8);if(_0x1b7540[_0x5ee2('0x34')]['filter']){_0xa7faf7[_0x5ee2('0x3c')]=_['merge'](_0xa7faf7[_0x5ee2('0x3c')],{'$or':_[_0x5ee2('0x33')](_0x2d23c8,function(_0xeb5403){if(_0xeb5403['type']!==_0x5ee2('0x3d')){var _0x11553e={};_0x11553e[_0xeb5403[_0x5ee2('0x2b')]]={'$like':'%'+_0x1b7540['query'][_0x5ee2('0x3e')]+'%'};return _0x11553e;}})});}_0xa7faf7=_[_0x5ee2('0x3f')]({},_0xa7faf7,_0x1b7540[_0x5ee2('0x40')]);var _0x8d65ec={'where':_0xa7faf7['where']};return db[_0x5ee2('0x2e')][_0x5ee2('0x21')](_0x8d65ec)['then'](function(_0x37fd13){_0x3ce2a8['count']=_0x37fd13;if(_0x1b7540['query']['includeAll']){_0xa7faf7[_0x5ee2('0x41')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x5ee2('0x42')](_0xa7faf7);})[_0x5ee2('0x27')](function(_0x11a64a){_0x3ce2a8[_0x5ee2('0x43')]=_0x11a64a;return _0x3ce2a8;})['then'](respondWithFilteredResult(_0x5dafec,_0xa7faf7))[_0x5ee2('0x44')](handleError(_0x5dafec,null));};exports[_0x5ee2('0x45')]=function(_0x38f08b,_0x5e4504){var _0x2f0e9d={'raw':![],'where':{'id':_0x38f08b['params']['id']}},_0x2fbeb2={};_0x2fbeb2[_0x5ee2('0x32')]=_[_0x5ee2('0x35')](db['ZendeskConfiguration']['rawAttributes']);_0x2fbeb2[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x38f08b[_0x5ee2('0x34')]);_0x2fbeb2[_0x5ee2('0x46')]=_[_0x5ee2('0x37')](_0x2fbeb2['model'],_0x2fbeb2['query']);_0x2f0e9d[_0x5ee2('0x36')]=_['intersection'](_0x2fbeb2['model'],qs[_0x5ee2('0x38')](_0x38f08b[_0x5ee2('0x34')]['fields']));_0x2f0e9d[_0x5ee2('0x36')]=_0x2f0e9d[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x2f0e9d[_0x5ee2('0x36')]:_0x2fbeb2['model'];if(_0x38f08b['query'][_0x5ee2('0x47')]){_0x2f0e9d[_0x5ee2('0x41')]=[{'all':!![]}];}_0x2f0e9d=_[_0x5ee2('0x3f')]({},_0x2f0e9d,_0x38f08b['options']);return db[_0x5ee2('0x2e')][_0x5ee2('0x48')](_0x2f0e9d)['then'](handleEntityNotFound(_0x5e4504,null))['then'](respondWithResult(_0x5e4504,null))['catch'](handleError(_0x5e4504,null));};exports[_0x5ee2('0x49')]=function(_0x2d90b2,_0x534dcf){return db[_0x5ee2('0x2e')][_0x5ee2('0x49')](_0x2d90b2[_0x5ee2('0x4a')],{})[_0x5ee2('0x27')](respondWithResult(_0x534dcf,0xc9))[_0x5ee2('0x44')](handleError(_0x534dcf,null));};exports['update']=function(_0x1aec06,_0x3e6f1a){if(_0x1aec06[_0x5ee2('0x4a')]['id']){delete _0x1aec06[_0x5ee2('0x4a')]['id'];}return db[_0x5ee2('0x2e')][_0x5ee2('0x48')]({'where':{'id':_0x1aec06[_0x5ee2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e6f1a,null))[_0x5ee2('0x27')](saveUpdates(_0x1aec06[_0x5ee2('0x4a')],null))[_0x5ee2('0x27')](respondWithResult(_0x3e6f1a,null))[_0x5ee2('0x44')](handleError(_0x3e6f1a,null));};exports[_0x5ee2('0x28')]=function(_0x3aaacd,_0x22a161){return db[_0x5ee2('0x2e')][_0x5ee2('0x48')]({'where':{'id':_0x3aaacd['params']['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x22a161,null))[_0x5ee2('0x27')](removeEntity(_0x22a161,null))[_0x5ee2('0x44')](handleError(_0x22a161,null));};exports[_0x5ee2('0x4c')]=function(_0x3d6a32,_0x47a219,_0x2575e4){var _0x48aed1={};var _0x2b876b={};var _0x3f264d;var _0x3036b9;return db[_0x5ee2('0x2e')][_0x5ee2('0x4d')]({'where':{'id':_0x3d6a32[_0x5ee2('0x4b')]['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x47a219,null))['then'](function(_0x5b61ff){if(_0x5b61ff){_0x3f264d=_0x5b61ff;_0x2b876b['model']=_[_0x5ee2('0x35')](db[_0x5ee2('0x4e')][_0x5ee2('0x2f')]);_0x2b876b[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x3d6a32[_0x5ee2('0x34')]);_0x2b876b[_0x5ee2('0x46')]=_[_0x5ee2('0x37')](_0x2b876b[_0x5ee2('0x32')],_0x2b876b[_0x5ee2('0x34')]);_0x48aed1[_0x5ee2('0x36')]=_['intersection'](_0x2b876b[_0x5ee2('0x32')],qs[_0x5ee2('0x38')](_0x3d6a32['query'][_0x5ee2('0x38')]));_0x48aed1[_0x5ee2('0x36')]=_0x48aed1[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x48aed1[_0x5ee2('0x36')]:_0x2b876b[_0x5ee2('0x32')];_0x48aed1['order']=qs['sort'](_0x3d6a32[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0x48aed1[_0x5ee2('0x3c')]=qs['filters'](_['pick'](_0x3d6a32[_0x5ee2('0x34')],_0x2b876b[_0x5ee2('0x46')]));if(_0x3d6a32[_0x5ee2('0x34')]['filter']){_0x48aed1[_0x5ee2('0x3c')]=_[_0x5ee2('0x3f')](_0x48aed1[_0x5ee2('0x3c')],{'$or':_[_0x5ee2('0x33')](_0x48aed1[_0x5ee2('0x36')],function(_0x3fb90f){var _0x4e1ee1={};_0x4e1ee1[_0x3fb90f]={'$like':'%'+_0x3d6a32[_0x5ee2('0x34')][_0x5ee2('0x3e')]+'%'};return _0x4e1ee1;})});}_0x48aed1=_['merge']({},_0x48aed1,_0x3d6a32[_0x5ee2('0x40')]);return _0x3f264d['getFields'](_0x48aed1);}})[_0x5ee2('0x27')](function(_0x19f4e5){if(_0x19f4e5){_0x3036b9=_0x19f4e5[_0x5ee2('0x39')];if(!_0x3d6a32['query'][_0x5ee2('0x4f')](_0x5ee2('0x3a'))){_0x48aed1[_0x5ee2('0x20')]=qs[_0x5ee2('0x20')](_0x3d6a32[_0x5ee2('0x34')][_0x5ee2('0x20')]);_0x48aed1[_0x5ee2('0x1e')]=qs[_0x5ee2('0x1e')](_0x3d6a32[_0x5ee2('0x34')]['offset']);}return _0x3f264d['getFields'](_0x48aed1);}})['then'](function(_0x3c2996){if(_0x3c2996){return _0x3c2996?{'count':_0x3036b9,'rows':_0x3c2996}:null;}})[_0x5ee2('0x27')](respondWithResult(_0x47a219,null))[_0x5ee2('0x44')](handleError(_0x47a219,null));};exports['getSubjects']=function(_0x49b1d3,_0x8d0e0a,_0x3169ae){var _0x6b0156={};var _0x220107={};var _0x3c34e4;var _0x323a95;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x49b1d3['params']['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x8d0e0a,null))[_0x5ee2('0x27')](function(_0x1e77f3){if(_0x1e77f3){_0x3c34e4=_0x1e77f3;_0x220107[_0x5ee2('0x32')]=_[_0x5ee2('0x35')](db[_0x5ee2('0x4e')][_0x5ee2('0x2f')]);_0x220107[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x49b1d3[_0x5ee2('0x34')]);_0x220107['filters']=_[_0x5ee2('0x37')](_0x220107[_0x5ee2('0x32')],_0x220107['query']);_0x6b0156[_0x5ee2('0x36')]=_['intersection'](_0x220107[_0x5ee2('0x32')],qs['fields'](_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x38')]));_0x6b0156['attributes']=_0x6b0156[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x6b0156[_0x5ee2('0x36')]:_0x220107[_0x5ee2('0x32')];_0x6b0156[_0x5ee2('0x50')]=qs[_0x5ee2('0x3b')](_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0x6b0156[_0x5ee2('0x3c')]=qs[_0x5ee2('0x46')](_[_0x5ee2('0x51')](_0x49b1d3[_0x5ee2('0x34')],_0x220107['filters']));if(_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x3e')]){_0x6b0156['where']=_[_0x5ee2('0x3f')](_0x6b0156[_0x5ee2('0x3c')],{'$or':_['map'](_0x6b0156[_0x5ee2('0x36')],function(_0x1d991b){var _0x5ae065={};_0x5ae065[_0x1d991b]={'$like':'%'+_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x3e')]+'%'};return _0x5ae065;})});}_0x6b0156=_['merge']({},_0x6b0156,_0x49b1d3[_0x5ee2('0x40')]);return _0x3c34e4[_0x5ee2('0x52')](_0x6b0156);}})[_0x5ee2('0x27')](function(_0x5c3e53){if(_0x5c3e53){_0x323a95=_0x5c3e53[_0x5ee2('0x39')];if(!_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x4f')](_0x5ee2('0x3a'))){_0x6b0156[_0x5ee2('0x20')]=qs['limit'](_0x49b1d3['query']['limit']);_0x6b0156['offset']=qs[_0x5ee2('0x1e')](_0x49b1d3[_0x5ee2('0x34')][_0x5ee2('0x1e')]);}return _0x3c34e4[_0x5ee2('0x52')](_0x6b0156);}})[_0x5ee2('0x27')](function(_0x4817e1){if(_0x4817e1){return _0x4817e1?{'count':_0x323a95,'rows':_0x4817e1}:null;}})[_0x5ee2('0x27')](respondWithResult(_0x8d0e0a,null))['catch'](handleError(_0x8d0e0a,null));};exports[_0x5ee2('0x53')]=function(_0x1677f6,_0x407554,_0x23f5eb){var _0x135844={};var _0x1a7710={};var _0x3431e4;var _0x1b0ca6;return db[_0x5ee2('0x2e')][_0x5ee2('0x4d')]({'where':{'id':_0x1677f6['params']['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x407554,null))[_0x5ee2('0x27')](function(_0x15195c){if(_0x15195c){_0x3431e4=_0x15195c;_0x1a7710['model']=_[_0x5ee2('0x35')](db['ZendeskField']['rawAttributes']);_0x1a7710[_0x5ee2('0x34')]=_[_0x5ee2('0x35')](_0x1677f6['query']);_0x1a7710[_0x5ee2('0x46')]=_[_0x5ee2('0x37')](_0x1a7710[_0x5ee2('0x32')],_0x1a7710[_0x5ee2('0x34')]);_0x135844[_0x5ee2('0x36')]=_[_0x5ee2('0x37')](_0x1a7710[_0x5ee2('0x32')],qs[_0x5ee2('0x38')](_0x1677f6[_0x5ee2('0x34')][_0x5ee2('0x38')]));_0x135844[_0x5ee2('0x36')]=_0x135844[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x135844[_0x5ee2('0x36')]:_0x1a7710[_0x5ee2('0x32')];_0x135844[_0x5ee2('0x50')]=qs['sort'](_0x1677f6[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0x135844['where']=qs[_0x5ee2('0x46')](_[_0x5ee2('0x51')](_0x1677f6[_0x5ee2('0x34')],_0x1a7710[_0x5ee2('0x46')]));if(_0x1677f6[_0x5ee2('0x34')][_0x5ee2('0x3e')]){_0x135844['where']=_[_0x5ee2('0x3f')](_0x135844[_0x5ee2('0x3c')],{'$or':_['map'](_0x135844[_0x5ee2('0x36')],function(_0x8d257a){var _0xfaf365={};_0xfaf365[_0x8d257a]={'$like':'%'+_0x1677f6[_0x5ee2('0x34')]['filter']+'%'};return _0xfaf365;})});}_0x135844=_[_0x5ee2('0x3f')]({},_0x135844,_0x1677f6[_0x5ee2('0x40')]);return _0x3431e4[_0x5ee2('0x53')](_0x135844);}})[_0x5ee2('0x27')](function(_0x407f75){if(_0x407f75){_0x1b0ca6=_0x407f75['length'];if(!_0x1677f6[_0x5ee2('0x34')]['hasOwnProperty'](_0x5ee2('0x3a'))){_0x135844[_0x5ee2('0x20')]=qs[_0x5ee2('0x20')](_0x1677f6['query'][_0x5ee2('0x20')]);_0x135844[_0x5ee2('0x1e')]=qs[_0x5ee2('0x1e')](_0x1677f6['query'][_0x5ee2('0x1e')]);}return _0x3431e4[_0x5ee2('0x53')](_0x135844);}})[_0x5ee2('0x27')](function(_0x27345d){if(_0x27345d){return _0x27345d?{'count':_0x1b0ca6,'rows':_0x27345d}:null;}})['then'](respondWithResult(_0x407554,null))[_0x5ee2('0x44')](handleError(_0x407554,null));};exports[_0x5ee2('0x54')]=function(_0x5caf8e,_0x2c7335,_0x5e7ea1){var _0x295223={};var _0x4d1584={};var _0x33eb6a;var _0x3bbf3d;return db[_0x5ee2('0x2e')]['findOne']({'where':{'id':_0x5caf8e[_0x5ee2('0x4b')]['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x2c7335,null))[_0x5ee2('0x27')](function(_0x16519e){if(_0x16519e){_0x33eb6a=_0x16519e;_0x4d1584[_0x5ee2('0x32')]=_[_0x5ee2('0x35')](db[_0x5ee2('0x55')][_0x5ee2('0x2f')]);_0x4d1584['query']=_[_0x5ee2('0x35')](_0x5caf8e['query']);_0x4d1584[_0x5ee2('0x46')]=_[_0x5ee2('0x37')](_0x4d1584[_0x5ee2('0x32')],_0x4d1584[_0x5ee2('0x34')]);_0x295223[_0x5ee2('0x36')]=_['intersection'](_0x4d1584['model'],qs['fields'](_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x38')]));_0x295223[_0x5ee2('0x36')]=_0x295223[_0x5ee2('0x36')][_0x5ee2('0x39')]?_0x295223[_0x5ee2('0x36')]:_0x4d1584[_0x5ee2('0x32')];_0x295223[_0x5ee2('0x50')]=qs[_0x5ee2('0x3b')](_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x3b')]);_0x295223[_0x5ee2('0x3c')]=qs[_0x5ee2('0x46')](_[_0x5ee2('0x51')](_0x5caf8e[_0x5ee2('0x34')],_0x4d1584[_0x5ee2('0x46')]));if(_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x3e')]){_0x295223[_0x5ee2('0x3c')]=_[_0x5ee2('0x3f')](_0x295223[_0x5ee2('0x3c')],{'$or':_[_0x5ee2('0x33')](_0x295223[_0x5ee2('0x36')],function(_0x38b515){var _0x2bb0d3={};_0x2bb0d3[_0x38b515]={'$like':'%'+_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x3e')]+'%'};return _0x2bb0d3;})});}_0x295223=_[_0x5ee2('0x3f')]({},_0x295223,_0x5caf8e['options']);return _0x33eb6a[_0x5ee2('0x54')](_0x295223);}})[_0x5ee2('0x27')](function(_0x171a81){if(_0x171a81){_0x3bbf3d=_0x171a81[_0x5ee2('0x39')];if(!_0x5caf8e[_0x5ee2('0x34')][_0x5ee2('0x4f')](_0x5ee2('0x3a'))){_0x295223[_0x5ee2('0x20')]=qs[_0x5ee2('0x20')](_0x5caf8e[_0x5ee2('0x34')]['limit']);_0x295223[_0x5ee2('0x1e')]=qs[_0x5ee2('0x1e')](_0x5caf8e['query'][_0x5ee2('0x1e')]);}return _0x33eb6a[_0x5ee2('0x54')](_0x295223);}})[_0x5ee2('0x27')](function(_0x405685){if(_0x405685){return _0x405685?{'count':_0x3bbf3d,'rows':_0x405685}:null;}})[_0x5ee2('0x27')](respondWithResult(_0x2c7335,null))['catch'](handleError(_0x2c7335,null));};exports[_0x5ee2('0x56')]=function(_0x3fd19b,_0x3fdbbd,_0x5fd7d6){if(_0x3fd19b[_0x5ee2('0x4a')]['id']){delete _0x3fd19b[_0x5ee2('0x4a')]['id'];}return db[_0x5ee2('0x2e')][_0x5ee2('0x4d')]({'where':{'id':_0x3fd19b[_0x5ee2('0x4b')]['id']}})[_0x5ee2('0x27')](handleEntityNotFound(_0x3fdbbd,null))[_0x5ee2('0x27')](function(_0x25d6a0){if(_0x25d6a0){return _0x25d6a0[_0x5ee2('0x56')](_0x3fd19b[_0x5ee2('0x4a')][_0x5ee2('0x57')]||[]);}return null;})[_0x5ee2('0x27')](respondWithResult(_0x3fdbbd,null))[_0x5ee2('0x44')](handleError(_0x3fdbbd,null));}; \ No newline at end of file +var _0x8c21=['params','find','create','body','findOne','ZendeskField','options','getSubjects','getDescriptions','getTags','setTags','eml-format','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','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','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskConfiguration','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show'];(function(_0x103589,_0x2acf11){var _0x3ea116=function(_0x52eee9){while(--_0x52eee9){_0x103589['push'](_0x103589['shift']());}};_0x3ea116(++_0x2acf11);}(_0x8c21,0x191));var _0x18c2=function(_0x34e6c1,_0x36d7ba){_0x34e6c1=_0x34e6c1-0x0;var _0x4d6b99=_0x8c21[_0x34e6c1];return _0x4d6b99;};'use strict';var emlformat=require(_0x18c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18c2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x18c2('0x2'));var moment=require(_0x18c2('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x18c2('0x4'));var path=require(_0x18c2('0x5'));var sox=require('sox');var csv=require(_0x18c2('0x6'));var ejs=require(_0x18c2('0x7'));var fs=require('fs');var fs_extra=require(_0x18c2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x18c2('0x9'));var Papa=require(_0x18c2('0xa'));var Redis=require(_0x18c2('0xb'));var authService=require(_0x18c2('0xc'));var qs=require(_0x18c2('0xd'));var as=require(_0x18c2('0xe'));var hardwareService=require(_0x18c2('0xf'));var logger=require(_0x18c2('0x10'))('api');var utils=require(_0x18c2('0x11'));var config=require(_0x18c2('0x12'));var licenseUtil=require(_0x18c2('0x13'));var db=require(_0x18c2('0x14'))['db'];function respondWithStatusCode(_0x23f93d,_0x2be4a5){_0x2be4a5=_0x2be4a5||0xcc;return function(_0x5d8cfd){if(_0x5d8cfd){return _0x23f93d[_0x18c2('0x15')](_0x2be4a5);}return _0x23f93d[_0x18c2('0x16')](_0x2be4a5)[_0x18c2('0x17')]();};}function respondWithResult(_0x579414,_0x5b9f86){_0x5b9f86=_0x5b9f86||0xc8;return function(_0x1e0a6f){if(_0x1e0a6f){return _0x579414['status'](_0x5b9f86)[_0x18c2('0x18')](_0x1e0a6f);}};}function respondWithFilteredResult(_0xa9c4eb,_0x28915c){return function(_0x14529f){if(_0x14529f){var _0x3ae120=typeof _0x28915c[_0x18c2('0x19')]==='undefined'&&typeof _0x28915c[_0x18c2('0x1a')]===_0x18c2('0x1b');var _0x2d756b=_0x14529f[_0x18c2('0x1c')];var _0x4304b4=_0x3ae120?0x0:_0x28915c[_0x18c2('0x19')];var _0x2ed243=_0x3ae120?_0x14529f[_0x18c2('0x1c')]:_0x28915c[_0x18c2('0x19')]+_0x28915c['limit'];var _0x1c15aa;if(_0x2ed243>=_0x2d756b){_0x2ed243=_0x2d756b;_0x1c15aa=0xc8;}else{_0x1c15aa=0xce;}_0xa9c4eb[_0x18c2('0x16')](_0x1c15aa);return _0xa9c4eb[_0x18c2('0x1d')]('Content-Range',_0x4304b4+'-'+_0x2ed243+'/'+_0x2d756b)[_0x18c2('0x18')](_0x14529f);}return null;};}function patchUpdates(_0x50f9fe){return function(_0xc5dd0e){try{jsonpatch[_0x18c2('0x1e')](_0xc5dd0e,_0x50f9fe,!![]);}catch(_0x47fbce){return BPromise[_0x18c2('0x1f')](_0x47fbce);}return _0xc5dd0e['save']();};}function saveUpdates(_0x319a33,_0x3bb6d0){return function(_0x1f9043){if(_0x1f9043){return _0x1f9043[_0x18c2('0x20')](_0x319a33)[_0x18c2('0x21')](function(_0x12979d){return _0x12979d;});}return null;};}function removeEntity(_0x46bc4a,_0x1e6871){return function(_0x37dd89){if(_0x37dd89){return _0x37dd89[_0x18c2('0x22')]()['then'](function(){_0x46bc4a[_0x18c2('0x16')](0xcc)[_0x18c2('0x17')]();});}};}function handleEntityNotFound(_0x1c4279,_0x3b09ef){return function(_0x191468){if(!_0x191468){_0x1c4279[_0x18c2('0x15')](0x194);}return _0x191468;};}function handleError(_0x804b2a,_0x569e17){_0x569e17=_0x569e17||0x1f4;return function(_0x28c86d){logger[_0x18c2('0x23')](_0x28c86d[_0x18c2('0x24')]);if(_0x28c86d[_0x18c2('0x25')]){delete _0x28c86d[_0x18c2('0x25')];}_0x804b2a['status'](_0x569e17)[_0x18c2('0x26')](_0x28c86d);};}exports[_0x18c2('0x27')]=function(_0x35919c,_0x2f7d7b){var _0x3b7ce4={},_0x341f0b={},_0x3c576a={'count':0x0,'rows':[]};var _0x3b1dc0=_['map'](db[_0x18c2('0x28')][_0x18c2('0x29')],function(_0x14a7d8){return{'name':_0x14a7d8['fieldName'],'type':_0x14a7d8['type']['key']};});_0x341f0b[_0x18c2('0x2a')]=_[_0x18c2('0x2b')](_0x3b1dc0,_0x18c2('0x25'));_0x341f0b[_0x18c2('0x2c')]=_[_0x18c2('0x2d')](_0x35919c['query']);_0x341f0b[_0x18c2('0x2e')]=_[_0x18c2('0x2f')](_0x341f0b[_0x18c2('0x2a')],_0x341f0b['query']);_0x3b7ce4[_0x18c2('0x30')]=_[_0x18c2('0x2f')](_0x341f0b[_0x18c2('0x2a')],qs[_0x18c2('0x31')](_0x35919c[_0x18c2('0x2c')]['fields']));_0x3b7ce4['attributes']=_0x3b7ce4['attributes'][_0x18c2('0x32')]?_0x3b7ce4[_0x18c2('0x30')]:_0x341f0b[_0x18c2('0x2a')];if(!_0x35919c[_0x18c2('0x2c')][_0x18c2('0x33')](_0x18c2('0x34'))){_0x3b7ce4[_0x18c2('0x1a')]=qs[_0x18c2('0x1a')](_0x35919c[_0x18c2('0x2c')]['limit']);_0x3b7ce4[_0x18c2('0x19')]=qs['offset'](_0x35919c['query'][_0x18c2('0x19')]);}_0x3b7ce4[_0x18c2('0x35')]=qs['sort'](_0x35919c[_0x18c2('0x2c')][_0x18c2('0x36')]);_0x3b7ce4[_0x18c2('0x37')]=qs[_0x18c2('0x2e')](_[_0x18c2('0x38')](_0x35919c[_0x18c2('0x2c')],_0x341f0b[_0x18c2('0x2e')]),_0x3b1dc0);if(_0x35919c[_0x18c2('0x2c')][_0x18c2('0x39')]){_0x3b7ce4[_0x18c2('0x37')]=_['merge'](_0x3b7ce4[_0x18c2('0x37')],{'$or':_[_0x18c2('0x2b')](_0x3b1dc0,function(_0x36cd85){if(_0x36cd85[_0x18c2('0x3a')]!==_0x18c2('0x3b')){var _0x55a531={};_0x55a531[_0x36cd85['name']]={'$like':'%'+_0x35919c[_0x18c2('0x2c')][_0x18c2('0x39')]+'%'};return _0x55a531;}})});}_0x3b7ce4=_[_0x18c2('0x3c')]({},_0x3b7ce4,_0x35919c['options']);var _0x4b4caf={'where':_0x3b7ce4['where']};return db[_0x18c2('0x28')][_0x18c2('0x1c')](_0x4b4caf)[_0x18c2('0x21')](function(_0xc87c33){_0x3c576a[_0x18c2('0x1c')]=_0xc87c33;if(_0x35919c['query'][_0x18c2('0x3d')]){_0x3b7ce4[_0x18c2('0x3e')]=[{'all':!![]}];}return db[_0x18c2('0x28')][_0x18c2('0x3f')](_0x3b7ce4);})['then'](function(_0x12e0c5){_0x3c576a[_0x18c2('0x40')]=_0x12e0c5;return _0x3c576a;})[_0x18c2('0x21')](respondWithFilteredResult(_0x2f7d7b,_0x3b7ce4))[_0x18c2('0x41')](handleError(_0x2f7d7b,null));};exports[_0x18c2('0x42')]=function(_0x528428,_0x45c92e){var _0x1a841e={'raw':![],'where':{'id':_0x528428[_0x18c2('0x43')]['id']}},_0x412fa7={};_0x412fa7[_0x18c2('0x2a')]=_['keys'](db[_0x18c2('0x28')][_0x18c2('0x29')]);_0x412fa7[_0x18c2('0x2c')]=_[_0x18c2('0x2d')](_0x528428[_0x18c2('0x2c')]);_0x412fa7[_0x18c2('0x2e')]=_['intersection'](_0x412fa7['model'],_0x412fa7[_0x18c2('0x2c')]);_0x1a841e[_0x18c2('0x30')]=_['intersection'](_0x412fa7['model'],qs[_0x18c2('0x31')](_0x528428[_0x18c2('0x2c')][_0x18c2('0x31')]));_0x1a841e[_0x18c2('0x30')]=_0x1a841e[_0x18c2('0x30')][_0x18c2('0x32')]?_0x1a841e[_0x18c2('0x30')]:_0x412fa7[_0x18c2('0x2a')];if(_0x528428['query']['includeAll']){_0x1a841e['include']=[{'all':!![]}];}_0x1a841e=_[_0x18c2('0x3c')]({},_0x1a841e,_0x528428['options']);return db[_0x18c2('0x28')][_0x18c2('0x44')](_0x1a841e)[_0x18c2('0x21')](handleEntityNotFound(_0x45c92e,null))[_0x18c2('0x21')](respondWithResult(_0x45c92e,null))['catch'](handleError(_0x45c92e,null));};exports['create']=function(_0x22878c,_0x408d5a){return db['ZendeskConfiguration'][_0x18c2('0x45')](_0x22878c['body'],{})[_0x18c2('0x21')](respondWithResult(_0x408d5a,0xc9))[_0x18c2('0x41')](handleError(_0x408d5a,null));};exports[_0x18c2('0x20')]=function(_0x22e3ba,_0x5b454a){if(_0x22e3ba[_0x18c2('0x46')]['id']){delete _0x22e3ba[_0x18c2('0x46')]['id'];}return db[_0x18c2('0x28')][_0x18c2('0x44')]({'where':{'id':_0x22e3ba[_0x18c2('0x43')]['id']}})[_0x18c2('0x21')](handleEntityNotFound(_0x5b454a,null))[_0x18c2('0x21')](saveUpdates(_0x22e3ba[_0x18c2('0x46')],null))[_0x18c2('0x21')](respondWithResult(_0x5b454a,null))[_0x18c2('0x41')](handleError(_0x5b454a,null));};exports[_0x18c2('0x22')]=function(_0x32be13,_0x516626){return db[_0x18c2('0x28')][_0x18c2('0x44')]({'where':{'id':_0x32be13[_0x18c2('0x43')]['id']}})[_0x18c2('0x21')](handleEntityNotFound(_0x516626,null))[_0x18c2('0x21')](removeEntity(_0x516626,null))[_0x18c2('0x41')](handleError(_0x516626,null));};exports['getFields']=function(_0x132749,_0x4e4098,_0x4d3c66){var _0x5f5bbc={};var _0x2dd746={};var _0x3500a7;var _0x45c6dd;return db[_0x18c2('0x28')][_0x18c2('0x47')]({'where':{'id':_0x132749[_0x18c2('0x43')]['id']}})[_0x18c2('0x21')](handleEntityNotFound(_0x4e4098,null))[_0x18c2('0x21')](function(_0x139aeb){if(_0x139aeb){_0x3500a7=_0x139aeb;_0x2dd746['model']=_['keys'](db[_0x18c2('0x48')][_0x18c2('0x29')]);_0x2dd746['query']=_[_0x18c2('0x2d')](_0x132749['query']);_0x2dd746[_0x18c2('0x2e')]=_['intersection'](_0x2dd746['model'],_0x2dd746['query']);_0x5f5bbc[_0x18c2('0x30')]=_[_0x18c2('0x2f')](_0x2dd746['model'],qs['fields'](_0x132749[_0x18c2('0x2c')][_0x18c2('0x31')]));_0x5f5bbc['attributes']=_0x5f5bbc[_0x18c2('0x30')][_0x18c2('0x32')]?_0x5f5bbc[_0x18c2('0x30')]:_0x2dd746[_0x18c2('0x2a')];_0x5f5bbc[_0x18c2('0x35')]=qs[_0x18c2('0x36')](_0x132749['query'][_0x18c2('0x36')]);_0x5f5bbc[_0x18c2('0x37')]=qs[_0x18c2('0x2e')](_['pick'](_0x132749['query'],_0x2dd746[_0x18c2('0x2e')]));if(_0x132749[_0x18c2('0x2c')]['filter']){_0x5f5bbc['where']=_[_0x18c2('0x3c')](_0x5f5bbc[_0x18c2('0x37')],{'$or':_['map'](_0x5f5bbc[_0x18c2('0x30')],function(_0x2a3e08){var _0x22c0d8={};_0x22c0d8[_0x2a3e08]={'$like':'%'+_0x132749[_0x18c2('0x2c')][_0x18c2('0x39')]+'%'};return _0x22c0d8;})});}_0x5f5bbc=_[_0x18c2('0x3c')]({},_0x5f5bbc,_0x132749[_0x18c2('0x49')]);return _0x3500a7['getFields'](_0x5f5bbc);}})[_0x18c2('0x21')](function(_0x58c5a0){if(_0x58c5a0){_0x45c6dd=_0x58c5a0[_0x18c2('0x32')];if(!_0x132749[_0x18c2('0x2c')][_0x18c2('0x33')](_0x18c2('0x34'))){_0x5f5bbc[_0x18c2('0x1a')]=qs[_0x18c2('0x1a')](_0x132749[_0x18c2('0x2c')]['limit']);_0x5f5bbc[_0x18c2('0x19')]=qs[_0x18c2('0x19')](_0x132749[_0x18c2('0x2c')][_0x18c2('0x19')]);}return _0x3500a7['getFields'](_0x5f5bbc);}})[_0x18c2('0x21')](function(_0x3e3fe4){if(_0x3e3fe4){return _0x3e3fe4?{'count':_0x45c6dd,'rows':_0x3e3fe4}:null;}})[_0x18c2('0x21')](respondWithResult(_0x4e4098,null))['catch'](handleError(_0x4e4098,null));};exports['getSubjects']=function(_0x48b3f1,_0x1b2448,_0x584d44){var _0x1ded89={};var _0x39d1bf={};var _0x31b49c;var _0x40b784;return db[_0x18c2('0x28')]['findOne']({'where':{'id':_0x48b3f1['params']['id']}})[_0x18c2('0x21')](handleEntityNotFound(_0x1b2448,null))['then'](function(_0x236397){if(_0x236397){_0x31b49c=_0x236397;_0x39d1bf[_0x18c2('0x2a')]=_[_0x18c2('0x2d')](db[_0x18c2('0x48')][_0x18c2('0x29')]);_0x39d1bf[_0x18c2('0x2c')]=_[_0x18c2('0x2d')](_0x48b3f1[_0x18c2('0x2c')]);_0x39d1bf[_0x18c2('0x2e')]=_[_0x18c2('0x2f')](_0x39d1bf[_0x18c2('0x2a')],_0x39d1bf['query']);_0x1ded89[_0x18c2('0x30')]=_['intersection'](_0x39d1bf[_0x18c2('0x2a')],qs['fields'](_0x48b3f1['query'][_0x18c2('0x31')]));_0x1ded89[_0x18c2('0x30')]=_0x1ded89[_0x18c2('0x30')][_0x18c2('0x32')]?_0x1ded89['attributes']:_0x39d1bf[_0x18c2('0x2a')];_0x1ded89[_0x18c2('0x35')]=qs[_0x18c2('0x36')](_0x48b3f1['query'][_0x18c2('0x36')]);_0x1ded89[_0x18c2('0x37')]=qs[_0x18c2('0x2e')](_[_0x18c2('0x38')](_0x48b3f1[_0x18c2('0x2c')],_0x39d1bf[_0x18c2('0x2e')]));if(_0x48b3f1[_0x18c2('0x2c')][_0x18c2('0x39')]){_0x1ded89['where']=_[_0x18c2('0x3c')](_0x1ded89['where'],{'$or':_['map'](_0x1ded89[_0x18c2('0x30')],function(_0x53eab7){var _0x4e47c8={};_0x4e47c8[_0x53eab7]={'$like':'%'+_0x48b3f1['query'][_0x18c2('0x39')]+'%'};return _0x4e47c8;})});}_0x1ded89=_[_0x18c2('0x3c')]({},_0x1ded89,_0x48b3f1[_0x18c2('0x49')]);return _0x31b49c[_0x18c2('0x4a')](_0x1ded89);}})[_0x18c2('0x21')](function(_0x471e47){if(_0x471e47){_0x40b784=_0x471e47[_0x18c2('0x32')];if(!_0x48b3f1[_0x18c2('0x2c')]['hasOwnProperty'](_0x18c2('0x34'))){_0x1ded89['limit']=qs[_0x18c2('0x1a')](_0x48b3f1[_0x18c2('0x2c')][_0x18c2('0x1a')]);_0x1ded89[_0x18c2('0x19')]=qs[_0x18c2('0x19')](_0x48b3f1['query'][_0x18c2('0x19')]);}return _0x31b49c[_0x18c2('0x4a')](_0x1ded89);}})[_0x18c2('0x21')](function(_0x3329c5){if(_0x3329c5){return _0x3329c5?{'count':_0x40b784,'rows':_0x3329c5}:null;}})[_0x18c2('0x21')](respondWithResult(_0x1b2448,null))['catch'](handleError(_0x1b2448,null));};exports[_0x18c2('0x4b')]=function(_0xf9d60f,_0x58e162,_0x344be0){var _0x24b4f1={};var _0x5aace6={};var _0x29120c;var _0x716fe3;return db[_0x18c2('0x28')]['findOne']({'where':{'id':_0xf9d60f[_0x18c2('0x43')]['id']}})[_0x18c2('0x21')](handleEntityNotFound(_0x58e162,null))[_0x18c2('0x21')](function(_0x53bfdf){if(_0x53bfdf){_0x29120c=_0x53bfdf;_0x5aace6[_0x18c2('0x2a')]=_[_0x18c2('0x2d')](db[_0x18c2('0x48')][_0x18c2('0x29')]);_0x5aace6[_0x18c2('0x2c')]=_['keys'](_0xf9d60f[_0x18c2('0x2c')]);_0x5aace6['filters']=_['intersection'](_0x5aace6[_0x18c2('0x2a')],_0x5aace6[_0x18c2('0x2c')]);_0x24b4f1[_0x18c2('0x30')]=_[_0x18c2('0x2f')](_0x5aace6['model'],qs[_0x18c2('0x31')](_0xf9d60f['query']['fields']));_0x24b4f1['attributes']=_0x24b4f1['attributes'][_0x18c2('0x32')]?_0x24b4f1[_0x18c2('0x30')]:_0x5aace6[_0x18c2('0x2a')];_0x24b4f1['order']=qs[_0x18c2('0x36')](_0xf9d60f['query'][_0x18c2('0x36')]);_0x24b4f1[_0x18c2('0x37')]=qs[_0x18c2('0x2e')](_[_0x18c2('0x38')](_0xf9d60f[_0x18c2('0x2c')],_0x5aace6[_0x18c2('0x2e')]));if(_0xf9d60f['query'][_0x18c2('0x39')]){_0x24b4f1['where']=_[_0x18c2('0x3c')](_0x24b4f1['where'],{'$or':_[_0x18c2('0x2b')](_0x24b4f1[_0x18c2('0x30')],function(_0x584701){var _0x3dd722={};_0x3dd722[_0x584701]={'$like':'%'+_0xf9d60f[_0x18c2('0x2c')]['filter']+'%'};return _0x3dd722;})});}_0x24b4f1=_[_0x18c2('0x3c')]({},_0x24b4f1,_0xf9d60f['options']);return _0x29120c[_0x18c2('0x4b')](_0x24b4f1);}})[_0x18c2('0x21')](function(_0x17596d){if(_0x17596d){_0x716fe3=_0x17596d[_0x18c2('0x32')];if(!_0xf9d60f[_0x18c2('0x2c')][_0x18c2('0x33')](_0x18c2('0x34'))){_0x24b4f1[_0x18c2('0x1a')]=qs[_0x18c2('0x1a')](_0xf9d60f[_0x18c2('0x2c')][_0x18c2('0x1a')]);_0x24b4f1[_0x18c2('0x19')]=qs[_0x18c2('0x19')](_0xf9d60f[_0x18c2('0x2c')][_0x18c2('0x19')]);}return _0x29120c[_0x18c2('0x4b')](_0x24b4f1);}})[_0x18c2('0x21')](function(_0x55c69f){if(_0x55c69f){return _0x55c69f?{'count':_0x716fe3,'rows':_0x55c69f}:null;}})['then'](respondWithResult(_0x58e162,null))[_0x18c2('0x41')](handleError(_0x58e162,null));};exports[_0x18c2('0x4c')]=function(_0xd8a7fa,_0x228db6,_0x4747d5){var _0x210047={};var _0x5aa58e={};var _0x575ecc;var _0x3a65af;return db['ZendeskConfiguration'][_0x18c2('0x47')]({'where':{'id':_0xd8a7fa['params']['id']}})[_0x18c2('0x21')](handleEntityNotFound(_0x228db6,null))[_0x18c2('0x21')](function(_0x5bb879){if(_0x5bb879){_0x575ecc=_0x5bb879;_0x5aa58e['model']=_['keys'](db['Tag'][_0x18c2('0x29')]);_0x5aa58e['query']=_[_0x18c2('0x2d')](_0xd8a7fa['query']);_0x5aa58e[_0x18c2('0x2e')]=_[_0x18c2('0x2f')](_0x5aa58e['model'],_0x5aa58e[_0x18c2('0x2c')]);_0x210047[_0x18c2('0x30')]=_[_0x18c2('0x2f')](_0x5aa58e['model'],qs[_0x18c2('0x31')](_0xd8a7fa[_0x18c2('0x2c')]['fields']));_0x210047['attributes']=_0x210047['attributes'][_0x18c2('0x32')]?_0x210047[_0x18c2('0x30')]:_0x5aa58e[_0x18c2('0x2a')];_0x210047[_0x18c2('0x35')]=qs[_0x18c2('0x36')](_0xd8a7fa[_0x18c2('0x2c')][_0x18c2('0x36')]);_0x210047[_0x18c2('0x37')]=qs[_0x18c2('0x2e')](_['pick'](_0xd8a7fa[_0x18c2('0x2c')],_0x5aa58e[_0x18c2('0x2e')]));if(_0xd8a7fa['query']['filter']){_0x210047[_0x18c2('0x37')]=_['merge'](_0x210047[_0x18c2('0x37')],{'$or':_[_0x18c2('0x2b')](_0x210047['attributes'],function(_0x3547d5){var _0x232e84={};_0x232e84[_0x3547d5]={'$like':'%'+_0xd8a7fa[_0x18c2('0x2c')][_0x18c2('0x39')]+'%'};return _0x232e84;})});}_0x210047=_[_0x18c2('0x3c')]({},_0x210047,_0xd8a7fa[_0x18c2('0x49')]);return _0x575ecc[_0x18c2('0x4c')](_0x210047);}})['then'](function(_0x3d4f79){if(_0x3d4f79){_0x3a65af=_0x3d4f79[_0x18c2('0x32')];if(!_0xd8a7fa[_0x18c2('0x2c')][_0x18c2('0x33')](_0x18c2('0x34'))){_0x210047['limit']=qs['limit'](_0xd8a7fa['query']['limit']);_0x210047[_0x18c2('0x19')]=qs[_0x18c2('0x19')](_0xd8a7fa['query']['offset']);}return _0x575ecc[_0x18c2('0x4c')](_0x210047);}})[_0x18c2('0x21')](function(_0x45d535){if(_0x45d535){return _0x45d535?{'count':_0x3a65af,'rows':_0x45d535}:null;}})['then'](respondWithResult(_0x228db6,null))[_0x18c2('0x41')](handleError(_0x228db6,null));};exports['setTags']=function(_0x2eb6ac,_0x22d1c3,_0x4b3d0b){if(_0x2eb6ac[_0x18c2('0x46')]['id']){delete _0x2eb6ac[_0x18c2('0x46')]['id'];}return db[_0x18c2('0x28')][_0x18c2('0x47')]({'where':{'id':_0x2eb6ac[_0x18c2('0x43')]['id']}})[_0x18c2('0x21')](handleEntityNotFound(_0x22d1c3,null))[_0x18c2('0x21')](function(_0x381d3d){if(_0x381d3d){return _0x381d3d[_0x18c2('0x4d')](_0x2eb6ac['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x22d1c3,null))[_0x18c2('0x41')](handleError(_0x22d1c3,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index bc51292..349efc9 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 _0x056b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x14a228,_0x428059){var _0x1caa95=function(_0x34db3c){while(--_0x34db3c){_0x14a228['push'](_0x14a228['shift']());}};_0x1caa95(++_0x428059);}(_0x056b,0xb6));var _0xb056=function(_0x5d6dfc,_0x43d8d4){_0x5d6dfc=_0x5d6dfc-0x0;var _0x1bfa18=_0x056b[_0x5d6dfc];return _0x1bfa18;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var logger=require(_0xb056('0x1'))(_0xb056('0x2'));var moment=require(_0xb056('0x3'));var BPromise=require(_0xb056('0x4'));var rp=require(_0xb056('0x5'));var fs=require('fs');var path=require(_0xb056('0x6'));var rimraf=require(_0xb056('0x7'));var config=require(_0xb056('0x8'));var attributes=require(_0xb056('0x9'));module[_0xb056('0xa')]=function(_0x515612,_0x2d5e4f){return _0x515612[_0xb056('0xb')](_0xb056('0xc'),attributes,{'tableName':_0xb056('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b12=['int_zendesk_configurations','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','ZendeskConfiguration'];(function(_0x2d77b8,_0x33f044){var _0x4febdc=function(_0x44a81e){while(--_0x44a81e){_0x2d77b8['push'](_0x2d77b8['shift']());}};_0x4febdc(++_0x33f044);}(_0x5b12,0xa3));var _0x25b1=function(_0x3de925,_0x4b57de){_0x3de925=_0x3de925-0x0;var _0x320b3b=_0x5b12[_0x3de925];return _0x320b3b;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var logger=require(_0x25b1('0x2'))('api');var moment=require(_0x25b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x25b1('0x4'));var fs=require('fs');var path=require(_0x25b1('0x5'));var rimraf=require('rimraf');var config=require(_0x25b1('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x35d90b,_0x5523c9){return _0x35d90b['define'](_0x25b1('0x7'),attributes,{'tableName':_0x25b1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 77828c2..b95a45d 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 _0x095c=['../../config/utils','rpc','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x095c,0xff));var _0xc095=function(_0x22b96b,_0x35470f){_0x22b96b=_0x22b96b-0x0;var _0x493b95=_0x095c[_0x22b96b];return _0x493b95;};'use strict';var _=require(_0xc095('0x0'));var util=require('util');var moment=require(_0xc095('0x1'));var BPromise=require(_0xc095('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc095('0x3'));var db=require(_0xc095('0x4'))['db'];var utils=require(_0xc095('0x5'));var logger=require('../../config/logger')(_0xc095('0x6'));var config=require(_0xc095('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc095('0x8')][_0xc095('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d7976,_0x121f23,_0x3303d4){return new BPromise(function(_0x104318,_0x54f86c){return client[_0xc095('0xa')](_0x5d7976,_0x3303d4)[_0xc095('0xb')](function(_0x1d261b){logger[_0xc095('0xc')](_0xc095('0xd'),_0x121f23,_0xc095('0xe'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x121f23,_0xc095('0xe'),JSON[_0xc095('0xf')](_0x1d261b));if(_0x1d261b[_0xc095('0x10')]){if(_0x1d261b[_0xc095('0x10')]['code']===0x1f4){logger[_0xc095('0x10')](_0xc095('0xd'),_0x121f23,_0x1d261b[_0xc095('0x10')]['message']);return _0x54f86c(_0x1d261b[_0xc095('0x10')][_0xc095('0x11')]);}logger[_0xc095('0x10')](_0xc095('0xd'),_0x121f23,_0x1d261b[_0xc095('0x10')][_0xc095('0x11')]);return _0x104318(_0x1d261b[_0xc095('0x10')][_0xc095('0x11')]);}else{logger['info'](_0xc095('0xd'),_0x121f23,_0xc095('0xe'));_0x104318(_0x1d261b[_0xc095('0x12')][_0xc095('0x11')]);}})[_0xc095('0x13')](function(_0x2151ba){logger[_0xc095('0x10')](_0xc095('0xd'),_0x121f23,_0x2151ba);_0x54f86c(_0x2151ba);});});} \ No newline at end of file +var _0xbd66=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info'];(function(_0x6aaa69,_0x4457b5){var _0x25359f=function(_0x1ab0be){while(--_0x1ab0be){_0x6aaa69['push'](_0x6aaa69['shift']());}};_0x25359f(++_0x4457b5);}(_0xbd66,0x86));var _0x6bd6=function(_0x508170,_0x771099){_0x508170=_0x508170-0x0;var _0x592c4d=_0xbd66[_0x508170];return _0x592c4d;};'use strict';var _=require(_0x6bd6('0x0'));var util=require(_0x6bd6('0x1'));var moment=require(_0x6bd6('0x2'));var BPromise=require(_0x6bd6('0x3'));var rs=require(_0x6bd6('0x4'));var fs=require('fs');var Redis=require(_0x6bd6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6bd6('0x6'));var logger=require(_0x6bd6('0x7'))(_0x6bd6('0x8'));var config=require(_0x6bd6('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6bd6('0xa')][_0x6bd6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bbb31,_0x1a51ee,_0x545e49){return new BPromise(function(_0x2e20d2,_0x381b19){return client['request'](_0x5bbb31,_0x545e49)['then'](function(_0x4f61ca){logger[_0x6bd6('0xc')](_0x6bd6('0xd'),_0x1a51ee,_0x6bd6('0xe'));logger[_0x6bd6('0xf')](_0x6bd6('0x10'),_0x1a51ee,'request\x20sent',JSON[_0x6bd6('0x11')](_0x4f61ca));if(_0x4f61ca[_0x6bd6('0x12')]){if(_0x4f61ca[_0x6bd6('0x12')]['code']===0x1f4){logger[_0x6bd6('0x12')](_0x6bd6('0xd'),_0x1a51ee,_0x4f61ca[_0x6bd6('0x12')][_0x6bd6('0x13')]);return _0x381b19(_0x4f61ca[_0x6bd6('0x12')]['message']);}logger[_0x6bd6('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1a51ee,_0x4f61ca[_0x6bd6('0x12')]['message']);return _0x2e20d2(_0x4f61ca[_0x6bd6('0x12')][_0x6bd6('0x13')]);}else{logger['info'](_0x6bd6('0xd'),_0x1a51ee,'request\x20sent');_0x2e20d2(_0x4f61ca['result'][_0x6bd6('0x13')]);}})[_0x6bd6('0x14')](function(_0x139c84){logger[_0x6bd6('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1a51ee,_0x139c84);_0x381b19(_0x139c84);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index e2f58b0..21e0418 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 _0x0bd6=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','destroy','multer','util','path','connect-timeout'];(function(_0x4f98f2,_0x35d270){var _0x595a12=function(_0x1c34e5){while(--_0x1c34e5){_0x4f98f2['push'](_0x4f98f2['shift']());}};_0x595a12(++_0x35d270);}(_0x0bd6,0x95));var _0x60bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bd6[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x60bd('0x0'));var util=require(_0x60bd('0x1'));var path=require(_0x60bd('0x2'));var timeout=require(_0x60bd('0x3'));var express=require(_0x60bd('0x4'));var router=express[_0x60bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x60bd('0x6'));var interaction=require(_0x60bd('0x7'));var config=require(_0x60bd('0x8'));var controller=require('./intZendeskField.controller');router[_0x60bd('0x9')]('/',auth[_0x60bd('0xa')](),controller[_0x60bd('0xb')]);router[_0x60bd('0x9')](_0x60bd('0xc'),auth[_0x60bd('0xa')](),controller['show']);router[_0x60bd('0xd')]('/',auth[_0x60bd('0xa')](),controller['create']);router[_0x60bd('0xe')]('/:id',auth[_0x60bd('0xa')](),controller[_0x60bd('0xf')]);router['delete'](_0x60bd('0xc'),auth['isAuthenticated'](),controller[_0x60bd('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf905=['post','create','put','/:id','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show'];(function(_0x5a6eec,_0x3d69a4){var _0x3845d0=function(_0x5f01dc){while(--_0x5f01dc){_0x5a6eec['push'](_0x5a6eec['shift']());}};_0x3845d0(++_0x3d69a4);}(_0xf905,0xcc));var _0x5f90=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xf905[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0x5f90('0x0'));var util=require('util');var path=require(_0x5f90('0x1'));var timeout=require(_0x5f90('0x2'));var express=require('express');var router=express[_0x5f90('0x3')]();var fs_extra=require(_0x5f90('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f90('0x5'));var config=require(_0x5f90('0x6'));var controller=require(_0x5f90('0x7'));router[_0x5f90('0x8')]('/',auth[_0x5f90('0x9')](),controller[_0x5f90('0xa')]);router[_0x5f90('0x8')]('/:id',auth[_0x5f90('0x9')](),controller[_0x5f90('0xb')]);router[_0x5f90('0xc')]('/',auth[_0x5f90('0x9')](),controller[_0x5f90('0xd')]);router[_0x5f90('0xe')](_0x5f90('0xf'),auth[_0x5f90('0x9')](),controller['update']);router[_0x5f90('0x10')]('/:id',auth[_0x5f90('0x9')](),controller[_0x5f90('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 14dc66e..044e00c 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 _0x2a00=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x39ffd1,_0x299703){var _0x31267e=function(_0x11b420){while(--_0x11b420){_0x39ffd1['push'](_0x39ffd1['shift']());}};_0x31267e(++_0x299703);}(_0x2a00,0x18c));var _0x02a0=function(_0x11b8a5,_0x2b56a0){_0x11b8a5=_0x11b8a5-0x0;var _0x1f64e8=_0x2a00[_0x11b8a5];return _0x1f64e8;};'use strict';var Sequelize=require(_0x02a0('0x0'));module[_0x02a0('0x1')]={'type':{'type':Sequelize[_0x02a0('0x2')](_0x02a0('0x3'),_0x02a0('0x4'),_0x02a0('0x5'),_0x02a0('0x6'),_0x02a0('0x7')),'defaultValue':_0x02a0('0x3')},'content':{'type':Sequelize[_0x02a0('0x8')]},'key':{'type':Sequelize[_0x02a0('0x8')]},'keyType':{'type':Sequelize[_0x02a0('0x2')]('string',_0x02a0('0x4'),_0x02a0('0x5'))},'keyContent':{'type':Sequelize[_0x02a0('0x8')]},'idField':{'type':Sequelize[_0x02a0('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x02a0('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x02a0('0x8')]}}; \ No newline at end of file +var _0xafd5=['ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','STRING'];(function(_0xa99439,_0x2400f9){var _0x121716=function(_0x3a7295){while(--_0x3a7295){_0xa99439['push'](_0xa99439['shift']());}};_0x121716(++_0x2400f9);}(_0xafd5,0x1b2));var _0x5afd=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0xafd5[_0xb833b1];return _0x1ab87a;};'use strict';var Sequelize=require(_0x5afd('0x0'));module[_0x5afd('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5afd('0x2'),_0x5afd('0x3'),_0x5afd('0x4'),_0x5afd('0x5'),'picklist'),'defaultValue':_0x5afd('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5afd('0x6')]},'keyType':{'type':Sequelize[_0x5afd('0x7')](_0x5afd('0x2'),_0x5afd('0x3'),_0x5afd('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x5afd('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5afd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5afd('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 63e1758..15b3332 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 _0x893d=['json','offset','undefined','limit','count','reject','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','ZendeskField','includeAll','findAll','rows','catch','show','params','create','body','find','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status'];(function(_0x480967,_0x70ab20){var _0x4f4bcd=function(_0x1d44b3){while(--_0x1d44b3){_0x480967['push'](_0x480967['shift']());}};_0x4f4bcd(++_0x70ab20);}(_0x893d,0x180));var _0xd893=function(_0xb8ba3e,_0x3554b5){_0xb8ba3e=_0xb8ba3e-0x0;var _0xfe3968=_0x893d[_0xb8ba3e];return _0xfe3968;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd893('0x0'));var rp=require(_0xd893('0x1'));var moment=require(_0xd893('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd893('0x3'));var util=require(_0xd893('0x4'));var path=require(_0xd893('0x5'));var sox=require(_0xd893('0x6'));var csv=require(_0xd893('0x7'));var ejs=require(_0xd893('0x8'));var fs=require('fs');var fs_extra=require(_0xd893('0x9'));var _=require(_0xd893('0xa'));var squel=require(_0xd893('0xb'));var crypto=require('crypto');var jsforce=require(_0xd893('0xc'));var deskjs=require(_0xd893('0xd'));var toCsv=require(_0xd893('0x7'));var querystring=require(_0xd893('0xe'));var Papa=require(_0xd893('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd893('0x10'));var as=require(_0xd893('0x11'));var hardwareService=require(_0xd893('0x12'));var logger=require(_0xd893('0x13'))(_0xd893('0x14'));var utils=require(_0xd893('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd893('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x556d9b,_0x30f69e){_0x30f69e=_0x30f69e||0xcc;return function(_0x446023){if(_0x446023){return _0x556d9b['sendStatus'](_0x30f69e);}return _0x556d9b[_0xd893('0x17')](_0x30f69e)['end']();};}function respondWithResult(_0x356ef2,_0x43bf5f){_0x43bf5f=_0x43bf5f||0xc8;return function(_0x551c8b){if(_0x551c8b){return _0x356ef2[_0xd893('0x17')](_0x43bf5f)[_0xd893('0x18')](_0x551c8b);}};}function respondWithFilteredResult(_0x3d3a82,_0x17ac6e){return function(_0x213e5a){if(_0x213e5a){var _0x4ad936=typeof _0x17ac6e[_0xd893('0x19')]===_0xd893('0x1a')&&typeof _0x17ac6e[_0xd893('0x1b')]===_0xd893('0x1a');var _0x4f2aeb=_0x213e5a[_0xd893('0x1c')];var _0x5bdaae=_0x4ad936?0x0:_0x17ac6e[_0xd893('0x19')];var _0x5513fa=_0x4ad936?_0x213e5a[_0xd893('0x1c')]:_0x17ac6e['offset']+_0x17ac6e[_0xd893('0x1b')];var _0x6412b4;if(_0x5513fa>=_0x4f2aeb){_0x5513fa=_0x4f2aeb;_0x6412b4=0xc8;}else{_0x6412b4=0xce;}_0x3d3a82['status'](_0x6412b4);return _0x3d3a82['set']('Content-Range',_0x5bdaae+'-'+_0x5513fa+'/'+_0x4f2aeb)[_0xd893('0x18')](_0x213e5a);}return null;};}function patchUpdates(_0x4048bb){return function(_0x191329){try{jsonpatch['apply'](_0x191329,_0x4048bb,!![]);}catch(_0x1abdf5){return BPromise[_0xd893('0x1d')](_0x1abdf5);}return _0x191329['save']();};}function saveUpdates(_0x145c8c,_0x15c758){return function(_0x1c7db5){if(_0x1c7db5){return _0x1c7db5[_0xd893('0x1e')](_0x145c8c)[_0xd893('0x1f')](function(_0x1fedf4){return _0x1fedf4;});}return null;};}function removeEntity(_0x4b5b8f,_0x17db26){return function(_0x52f73c){if(_0x52f73c){return _0x52f73c['destroy']()[_0xd893('0x1f')](function(){_0x4b5b8f[_0xd893('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x104900,_0x5ca38b){return function(_0x2723fe){if(!_0x2723fe){_0x104900[_0xd893('0x20')](0x194);}return _0x2723fe;};}function handleError(_0x53ab28,_0x5f5bee){_0x5f5bee=_0x5f5bee||0x1f4;return function(_0x404c0c){logger[_0xd893('0x21')](_0x404c0c['stack']);if(_0x404c0c[_0xd893('0x22')]){delete _0x404c0c[_0xd893('0x22')];}_0x53ab28['status'](_0x5f5bee)[_0xd893('0x23')](_0x404c0c);};}exports[_0xd893('0x24')]=function(_0x389d65,_0x4f314b){var _0x237c6d={},_0x4ceb2c={},_0x2a90f6={'count':0x0,'rows':[]};var _0x85c9c3=_[_0xd893('0x25')](db['ZendeskField'][_0xd893('0x26')],function(_0x15eb89){return{'name':_0x15eb89[_0xd893('0x27')],'type':_0x15eb89[_0xd893('0x28')][_0xd893('0x29')]};});_0x4ceb2c[_0xd893('0x2a')]=_[_0xd893('0x25')](_0x85c9c3,_0xd893('0x22'));_0x4ceb2c[_0xd893('0x2b')]=_[_0xd893('0x2c')](_0x389d65['query']);_0x4ceb2c['filters']=_[_0xd893('0x2d')](_0x4ceb2c[_0xd893('0x2a')],_0x4ceb2c[_0xd893('0x2b')]);_0x237c6d[_0xd893('0x2e')]=_[_0xd893('0x2d')](_0x4ceb2c[_0xd893('0x2a')],qs[_0xd893('0x2f')](_0x389d65['query'][_0xd893('0x2f')]));_0x237c6d[_0xd893('0x2e')]=_0x237c6d[_0xd893('0x2e')][_0xd893('0x30')]?_0x237c6d[_0xd893('0x2e')]:_0x4ceb2c['model'];if(!_0x389d65['query']['hasOwnProperty'](_0xd893('0x31'))){_0x237c6d[_0xd893('0x1b')]=qs[_0xd893('0x1b')](_0x389d65[_0xd893('0x2b')][_0xd893('0x1b')]);_0x237c6d[_0xd893('0x19')]=qs[_0xd893('0x19')](_0x389d65[_0xd893('0x2b')][_0xd893('0x19')]);}_0x237c6d[_0xd893('0x32')]=qs[_0xd893('0x33')](_0x389d65[_0xd893('0x2b')]['sort']);_0x237c6d[_0xd893('0x34')]=qs['filters'](_['pick'](_0x389d65[_0xd893('0x2b')],_0x4ceb2c[_0xd893('0x35')]),_0x85c9c3);if(_0x389d65[_0xd893('0x2b')][_0xd893('0x36')]){_0x237c6d[_0xd893('0x34')]=_[_0xd893('0x37')](_0x237c6d[_0xd893('0x34')],{'$or':_[_0xd893('0x25')](_0x85c9c3,function(_0x2b0d35){if(_0x2b0d35[_0xd893('0x28')]!==_0xd893('0x38')){var _0x4e9271={};_0x4e9271[_0x2b0d35[_0xd893('0x22')]]={'$like':'%'+_0x389d65['query'][_0xd893('0x36')]+'%'};return _0x4e9271;}})});}_0x237c6d=_[_0xd893('0x37')]({},_0x237c6d,_0x389d65[_0xd893('0x39')]);var _0x3550df={'where':_0x237c6d['where']};return db[_0xd893('0x3a')]['count'](_0x3550df)[_0xd893('0x1f')](function(_0x519879){_0x2a90f6[_0xd893('0x1c')]=_0x519879;if(_0x389d65[_0xd893('0x2b')][_0xd893('0x3b')]){_0x237c6d['include']=[{'all':!![]}];}return db['ZendeskField'][_0xd893('0x3c')](_0x237c6d);})[_0xd893('0x1f')](function(_0x7766f9){_0x2a90f6[_0xd893('0x3d')]=_0x7766f9;return _0x2a90f6;})['then'](respondWithFilteredResult(_0x4f314b,_0x237c6d))[_0xd893('0x3e')](handleError(_0x4f314b,null));};exports[_0xd893('0x3f')]=function(_0x2e77bf,_0x23bff1){var _0x17ca15={'raw':!![],'where':{'id':_0x2e77bf[_0xd893('0x40')]['id']}},_0x20e0d5={};_0x20e0d5['model']=_[_0xd893('0x2c')](db[_0xd893('0x3a')][_0xd893('0x26')]);_0x20e0d5['query']=_[_0xd893('0x2c')](_0x2e77bf[_0xd893('0x2b')]);_0x20e0d5[_0xd893('0x35')]=_[_0xd893('0x2d')](_0x20e0d5[_0xd893('0x2a')],_0x20e0d5[_0xd893('0x2b')]);_0x17ca15[_0xd893('0x2e')]=_[_0xd893('0x2d')](_0x20e0d5[_0xd893('0x2a')],qs[_0xd893('0x2f')](_0x2e77bf[_0xd893('0x2b')]['fields']));_0x17ca15['attributes']=_0x17ca15[_0xd893('0x2e')]['length']?_0x17ca15[_0xd893('0x2e')]:_0x20e0d5[_0xd893('0x2a')];if(_0x2e77bf[_0xd893('0x2b')]['includeAll']){_0x17ca15['include']=[{'all':!![]}];}_0x17ca15=_['merge']({},_0x17ca15,_0x2e77bf['options']);return db['ZendeskField']['find'](_0x17ca15)[_0xd893('0x1f')](handleEntityNotFound(_0x23bff1,null))[_0xd893('0x1f')](respondWithResult(_0x23bff1,null))['catch'](handleError(_0x23bff1,null));};exports[_0xd893('0x41')]=function(_0x31e1bd,_0x1a6fcc){return db[_0xd893('0x3a')][_0xd893('0x41')](_0x31e1bd['body'],{})[_0xd893('0x1f')](respondWithResult(_0x1a6fcc,0xc9))[_0xd893('0x3e')](handleError(_0x1a6fcc,null));};exports[_0xd893('0x1e')]=function(_0x5cd06e,_0x54ed26){if(_0x5cd06e[_0xd893('0x42')]['id']){delete _0x5cd06e[_0xd893('0x42')]['id'];}return db[_0xd893('0x3a')][_0xd893('0x43')]({'where':{'id':_0x5cd06e[_0xd893('0x40')]['id']}})['then'](handleEntityNotFound(_0x54ed26,null))[_0xd893('0x1f')](saveUpdates(_0x5cd06e['body'],null))['then'](respondWithResult(_0x54ed26,null))[_0xd893('0x3e')](handleError(_0x54ed26,null));};exports['destroy']=function(_0x2fa859,_0x37cb04){return db['ZendeskField'][_0xd893('0x43')]({'where':{'id':_0x2fa859[_0xd893('0x40')]['id']}})[_0xd893('0x1f')](handleEntityNotFound(_0x37cb04,null))['then'](removeEntity(_0x37cb04,null))[_0xd893('0x3e')](handleError(_0x37cb04,null));}; \ No newline at end of file +var _0xd5f7=['options','find','create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','intersection','model','attributes','length','order','sort','filters','pick','where','merge','filter','ZendeskField','includeAll','include','findAll','catch','show','params','keys'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd5f7,0x120));var _0x7d5f=function(_0x36c555,_0x10f2ed){_0x36c555=_0x36c555-0x0;var _0x5cc71e=_0xd5f7[_0x36c555];return _0x5cc71e;};'use strict';var emlformat=require(_0x7d5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7d5f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d5f('0x2'));var moment=require(_0x7d5f('0x3'));var BPromise=require(_0x7d5f('0x4'));var Mustache=require(_0x7d5f('0x5'));var util=require(_0x7d5f('0x6'));var path=require(_0x7d5f('0x7'));var sox=require('sox');var csv=require(_0x7d5f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d5f('0x9'));var _=require('lodash');var squel=require(_0x7d5f('0xa'));var crypto=require(_0x7d5f('0xb'));var jsforce=require(_0x7d5f('0xc'));var deskjs=require(_0x7d5f('0xd'));var toCsv=require(_0x7d5f('0x8'));var querystring=require(_0x7d5f('0xe'));var Papa=require('papaparse');var Redis=require(_0x7d5f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7d5f('0x10'));var as=require(_0x7d5f('0x11'));var hardwareService=require(_0x7d5f('0x12'));var logger=require(_0x7d5f('0x13'))(_0x7d5f('0x14'));var utils=require(_0x7d5f('0x15'));var config=require(_0x7d5f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d5f('0x17'))['db'];function respondWithStatusCode(_0x268784,_0x3f4a8f){_0x3f4a8f=_0x3f4a8f||0xcc;return function(_0xcd6b62){if(_0xcd6b62){return _0x268784['sendStatus'](_0x3f4a8f);}return _0x268784[_0x7d5f('0x18')](_0x3f4a8f)[_0x7d5f('0x19')]();};}function respondWithResult(_0x618369,_0x311c14){_0x311c14=_0x311c14||0xc8;return function(_0x3ec39f){if(_0x3ec39f){return _0x618369[_0x7d5f('0x18')](_0x311c14)[_0x7d5f('0x1a')](_0x3ec39f);}};}function respondWithFilteredResult(_0x499c44,_0x39e311){return function(_0x96b9f8){if(_0x96b9f8){var _0x1a91cd=typeof _0x39e311[_0x7d5f('0x1b')]==='undefined'&&typeof _0x39e311[_0x7d5f('0x1c')]===_0x7d5f('0x1d');var _0x6aef68=_0x96b9f8[_0x7d5f('0x1e')];var _0x2d1f30=_0x1a91cd?0x0:_0x39e311[_0x7d5f('0x1b')];var _0x39f6af=_0x1a91cd?_0x96b9f8[_0x7d5f('0x1e')]:_0x39e311['offset']+_0x39e311['limit'];var _0x178efa;if(_0x39f6af>=_0x6aef68){_0x39f6af=_0x6aef68;_0x178efa=0xc8;}else{_0x178efa=0xce;}_0x499c44[_0x7d5f('0x18')](_0x178efa);return _0x499c44[_0x7d5f('0x1f')](_0x7d5f('0x20'),_0x2d1f30+'-'+_0x39f6af+'/'+_0x6aef68)['json'](_0x96b9f8);}return null;};}function patchUpdates(_0x52efbf){return function(_0x122860){try{jsonpatch['apply'](_0x122860,_0x52efbf,!![]);}catch(_0x29b7c8){return BPromise[_0x7d5f('0x21')](_0x29b7c8);}return _0x122860['save']();};}function saveUpdates(_0x41a60e,_0x1d7f0e){return function(_0x2944fd){if(_0x2944fd){return _0x2944fd[_0x7d5f('0x22')](_0x41a60e)['then'](function(_0x3c394d){return _0x3c394d;});}return null;};}function removeEntity(_0x533f0b,_0x44ef79){return function(_0x1e0344){if(_0x1e0344){return _0x1e0344[_0x7d5f('0x23')]()[_0x7d5f('0x24')](function(){_0x533f0b['status'](0xcc)[_0x7d5f('0x19')]();});}};}function handleEntityNotFound(_0x569749,_0x3429dd){return function(_0x32dde3){if(!_0x32dde3){_0x569749[_0x7d5f('0x25')](0x194);}return _0x32dde3;};}function handleError(_0x35f9b8,_0x357e5e){_0x357e5e=_0x357e5e||0x1f4;return function(_0x2ef067){logger[_0x7d5f('0x26')](_0x2ef067[_0x7d5f('0x27')]);if(_0x2ef067['name']){delete _0x2ef067[_0x7d5f('0x28')];}_0x35f9b8['status'](_0x357e5e)[_0x7d5f('0x29')](_0x2ef067);};}exports[_0x7d5f('0x2a')]=function(_0x2460ae,_0x4d0985){var _0x5cbe32={},_0x302452={},_0x50fcc1={'count':0x0,'rows':[]};var _0x416d8d=_[_0x7d5f('0x2b')](db['ZendeskField'][_0x7d5f('0x2c')],function(_0x42f3ec){return{'name':_0x42f3ec[_0x7d5f('0x2d')],'type':_0x42f3ec['type'][_0x7d5f('0x2e')]};});_0x302452['model']=_[_0x7d5f('0x2b')](_0x416d8d,_0x7d5f('0x28'));_0x302452[_0x7d5f('0x2f')]=_['keys'](_0x2460ae['query']);_0x302452['filters']=_[_0x7d5f('0x30')](_0x302452[_0x7d5f('0x31')],_0x302452[_0x7d5f('0x2f')]);_0x5cbe32[_0x7d5f('0x32')]=_[_0x7d5f('0x30')](_0x302452['model'],qs['fields'](_0x2460ae[_0x7d5f('0x2f')]['fields']));_0x5cbe32[_0x7d5f('0x32')]=_0x5cbe32[_0x7d5f('0x32')][_0x7d5f('0x33')]?_0x5cbe32['attributes']:_0x302452[_0x7d5f('0x31')];if(!_0x2460ae[_0x7d5f('0x2f')]['hasOwnProperty']('nolimit')){_0x5cbe32['limit']=qs[_0x7d5f('0x1c')](_0x2460ae['query']['limit']);_0x5cbe32[_0x7d5f('0x1b')]=qs[_0x7d5f('0x1b')](_0x2460ae['query'][_0x7d5f('0x1b')]);}_0x5cbe32[_0x7d5f('0x34')]=qs['sort'](_0x2460ae[_0x7d5f('0x2f')][_0x7d5f('0x35')]);_0x5cbe32['where']=qs[_0x7d5f('0x36')](_[_0x7d5f('0x37')](_0x2460ae[_0x7d5f('0x2f')],_0x302452[_0x7d5f('0x36')]),_0x416d8d);if(_0x2460ae[_0x7d5f('0x2f')]['filter']){_0x5cbe32[_0x7d5f('0x38')]=_[_0x7d5f('0x39')](_0x5cbe32[_0x7d5f('0x38')],{'$or':_[_0x7d5f('0x2b')](_0x416d8d,function(_0x3dcdbc){if(_0x3dcdbc['type']!=='VIRTUAL'){var _0x24a961={};_0x24a961[_0x3dcdbc[_0x7d5f('0x28')]]={'$like':'%'+_0x2460ae[_0x7d5f('0x2f')][_0x7d5f('0x3a')]+'%'};return _0x24a961;}})});}_0x5cbe32=_['merge']({},_0x5cbe32,_0x2460ae['options']);var _0x2921f1={'where':_0x5cbe32[_0x7d5f('0x38')]};return db[_0x7d5f('0x3b')][_0x7d5f('0x1e')](_0x2921f1)[_0x7d5f('0x24')](function(_0x3e2a13){_0x50fcc1[_0x7d5f('0x1e')]=_0x3e2a13;if(_0x2460ae[_0x7d5f('0x2f')][_0x7d5f('0x3c')]){_0x5cbe32[_0x7d5f('0x3d')]=[{'all':!![]}];}return db[_0x7d5f('0x3b')][_0x7d5f('0x3e')](_0x5cbe32);})[_0x7d5f('0x24')](function(_0x216223){_0x50fcc1['rows']=_0x216223;return _0x50fcc1;})['then'](respondWithFilteredResult(_0x4d0985,_0x5cbe32))[_0x7d5f('0x3f')](handleError(_0x4d0985,null));};exports[_0x7d5f('0x40')]=function(_0x50479e,_0x403ec0){var _0x46e0bb={'raw':!![],'where':{'id':_0x50479e[_0x7d5f('0x41')]['id']}},_0x417711={};_0x417711[_0x7d5f('0x31')]=_[_0x7d5f('0x42')](db['ZendeskField'][_0x7d5f('0x2c')]);_0x417711[_0x7d5f('0x2f')]=_[_0x7d5f('0x42')](_0x50479e['query']);_0x417711['filters']=_[_0x7d5f('0x30')](_0x417711[_0x7d5f('0x31')],_0x417711[_0x7d5f('0x2f')]);_0x46e0bb[_0x7d5f('0x32')]=_[_0x7d5f('0x30')](_0x417711[_0x7d5f('0x31')],qs['fields'](_0x50479e[_0x7d5f('0x2f')]['fields']));_0x46e0bb[_0x7d5f('0x32')]=_0x46e0bb['attributes'][_0x7d5f('0x33')]?_0x46e0bb[_0x7d5f('0x32')]:_0x417711[_0x7d5f('0x31')];if(_0x50479e[_0x7d5f('0x2f')][_0x7d5f('0x3c')]){_0x46e0bb[_0x7d5f('0x3d')]=[{'all':!![]}];}_0x46e0bb=_[_0x7d5f('0x39')]({},_0x46e0bb,_0x50479e[_0x7d5f('0x43')]);return db[_0x7d5f('0x3b')][_0x7d5f('0x44')](_0x46e0bb)[_0x7d5f('0x24')](handleEntityNotFound(_0x403ec0,null))['then'](respondWithResult(_0x403ec0,null))[_0x7d5f('0x3f')](handleError(_0x403ec0,null));};exports[_0x7d5f('0x45')]=function(_0x54d861,_0x35b5aa){return db['ZendeskField']['create'](_0x54d861[_0x7d5f('0x46')],{})[_0x7d5f('0x24')](respondWithResult(_0x35b5aa,0xc9))[_0x7d5f('0x3f')](handleError(_0x35b5aa,null));};exports['update']=function(_0x3820a6,_0x20e147){if(_0x3820a6['body']['id']){delete _0x3820a6['body']['id'];}return db[_0x7d5f('0x3b')]['find']({'where':{'id':_0x3820a6[_0x7d5f('0x41')]['id']}})[_0x7d5f('0x24')](handleEntityNotFound(_0x20e147,null))[_0x7d5f('0x24')](saveUpdates(_0x3820a6[_0x7d5f('0x46')],null))[_0x7d5f('0x24')](respondWithResult(_0x20e147,null))[_0x7d5f('0x3f')](handleError(_0x20e147,null));};exports[_0x7d5f('0x23')]=function(_0x2f920e,_0x413cff){return db['ZendeskField'][_0x7d5f('0x44')]({'where':{'id':_0x2f920e[_0x7d5f('0x41')]['id']}})[_0x7d5f('0x24')](handleEntityNotFound(_0x413cff,null))[_0x7d5f('0x24')](removeEntity(_0x413cff,null))[_0x7d5f('0x3f')](handleError(_0x413cff,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index d2aec9d..26384a7 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 _0xfb91=['bluebird','request-promise','path','../../config/environment','exports','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x3c3952,_0x2f67f2){var _0xc615f8=function(_0x5c8834){while(--_0x5c8834){_0x3c3952['push'](_0x3c3952['shift']());}};_0xc615f8(++_0x2f67f2);}(_0xfb91,0x191));var _0x1fb9=function(_0x130199,_0x330ad8){_0x130199=_0x130199-0x0;var _0x5d1cb8=_0xfb91[_0x130199];return _0x5d1cb8;};'use strict';var _=require(_0x1fb9('0x0'));var util=require(_0x1fb9('0x1'));var logger=require(_0x1fb9('0x2'))(_0x1fb9('0x3'));var moment=require(_0x1fb9('0x4'));var BPromise=require(_0x1fb9('0x5'));var rp=require(_0x1fb9('0x6'));var fs=require('fs');var path=require(_0x1fb9('0x7'));var rimraf=require('rimraf');var config=require(_0x1fb9('0x8'));var attributes=require('./intZendeskField.attributes');module[_0x1fb9('0x9')]=function(_0x2f72f2,_0x338aa6){return _0x2f72f2['define'](_0x1fb9('0xa'),attributes,{'tableName':_0x1fb9('0xb'),'paranoid':![],'indexes':[{'name':_0x1fb9('0xc'),'fields':['idField',_0x1fb9('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8428=['FieldId','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','idField'];(function(_0x34a879,_0x10a72d){var _0x33d1d8=function(_0x1f52a6){while(--_0x1f52a6){_0x34a879['push'](_0x34a879['shift']());}};_0x33d1d8(++_0x10a72d);}(_0x8428,0x146));var _0x8842=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8428[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x8842('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8842('0x1'));var BPromise=require(_0x8842('0x2'));var rp=require(_0x8842('0x3'));var fs=require('fs');var path=require(_0x8842('0x4'));var rimraf=require(_0x8842('0x5'));var config=require(_0x8842('0x6'));var attributes=require(_0x8842('0x7'));module[_0x8842('0x8')]=function(_0x2bc068,_0x16d9c7){return _0x2bc068[_0x8842('0x9')](_0x8842('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x8842('0xb'),_0x8842('0xc')],'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 69772b5..ed46601 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 _0x9cf9=['debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x9cf9,0x64));var _0x99cf=function(_0x4cd338,_0x1efe9d){_0x4cd338=_0x4cd338-0x0;var _0x4f33e6=_0x9cf9[_0x4cd338];return _0x4f33e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x99cf('0x0'));var BPromise=require('bluebird');var rs=require(_0x99cf('0x1'));var fs=require('fs');var Redis=require(_0x99cf('0x2'));var db=require(_0x99cf('0x3'))['db'];var utils=require(_0x99cf('0x4'));var logger=require('../../config/logger')(_0x99cf('0x5'));var config=require('../../config/environment');var jayson=require(_0x99cf('0x6'));var client=jayson[_0x99cf('0x7')][_0x99cf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x152bf9,_0x511dbd,_0x1434d6){return new BPromise(function(_0x21cfdf,_0x1caa43){return client[_0x99cf('0x9')](_0x152bf9,_0x1434d6)[_0x99cf('0xa')](function(_0x469b73){logger[_0x99cf('0xb')](_0x99cf('0xc'),_0x511dbd,_0x99cf('0xd'));logger[_0x99cf('0xe')](_0x99cf('0xf'),_0x511dbd,_0x99cf('0xd'),JSON['stringify'](_0x469b73));if(_0x469b73[_0x99cf('0x10')]){if(_0x469b73['error'][_0x99cf('0x11')]===0x1f4){logger[_0x99cf('0x10')](_0x99cf('0xc'),_0x511dbd,_0x469b73['error'][_0x99cf('0x12')]);return _0x1caa43(_0x469b73[_0x99cf('0x10')][_0x99cf('0x12')]);}logger[_0x99cf('0x10')](_0x99cf('0xc'),_0x511dbd,_0x469b73[_0x99cf('0x10')][_0x99cf('0x12')]);return _0x21cfdf(_0x469b73['error'][_0x99cf('0x12')]);}else{logger[_0x99cf('0xb')](_0x99cf('0xc'),_0x511dbd,_0x99cf('0xd'));_0x21cfdf(_0x469b73['result'][_0x99cf('0x12')]);}})['catch'](function(_0x591bbd){logger[_0x99cf('0x10')](_0x99cf('0xc'),_0x511dbd,_0x591bbd);_0x1caa43(_0x591bbd);});});} \ No newline at end of file +var _0xc6ff=['message','info','result','catch','lodash','util','moment','bluebird','rpc','../../config/environment','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x6e654b,_0x17c1c6){var _0x40c085=function(_0x1010e4){while(--_0x1010e4){_0x6e654b['push'](_0x6e654b['shift']());}};_0x40c085(++_0x17c1c6);}(_0xc6ff,0x15a));var _0xfc6f=function(_0x409092,_0x24de72){_0x409092=_0x409092-0x0;var _0x24a239=_0xc6ff[_0x409092];return _0x24a239;};'use strict';var _=require(_0xfc6f('0x0'));var util=require(_0xfc6f('0x1'));var moment=require(_0xfc6f('0x2'));var BPromise=require(_0xfc6f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfc6f('0x4'));var config=require(_0xfc6f('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc6f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x507f7e,_0x442924,_0x2c4d8d){return new BPromise(function(_0x5eced5,_0x5e9b7d){return client[_0xfc6f('0x7')](_0x507f7e,_0x2c4d8d)[_0xfc6f('0x8')](function(_0x466021){logger['info'](_0xfc6f('0x9'),_0x442924,_0xfc6f('0xa'));logger[_0xfc6f('0xb')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x442924,_0xfc6f('0xa'),JSON[_0xfc6f('0xc')](_0x466021));if(_0x466021[_0xfc6f('0xd')]){if(_0x466021['error'][_0xfc6f('0xe')]===0x1f4){logger[_0xfc6f('0xd')]('ZendeskField,\x20%s,\x20%s',_0x442924,_0x466021[_0xfc6f('0xd')][_0xfc6f('0xf')]);return _0x5e9b7d(_0x466021[_0xfc6f('0xd')][_0xfc6f('0xf')]);}logger[_0xfc6f('0xd')](_0xfc6f('0x9'),_0x442924,_0x466021[_0xfc6f('0xd')]['message']);return _0x5eced5(_0x466021[_0xfc6f('0xd')][_0xfc6f('0xf')]);}else{logger[_0xfc6f('0x10')](_0xfc6f('0x9'),_0x442924,_0xfc6f('0xa'));_0x5eced5(_0x466021[_0xfc6f('0x11')][_0xfc6f('0xf')]);}})[_0xfc6f('0x12')](function(_0xbf21fe){logger['error'](_0xfc6f('0x9'),_0x442924,_0xbf21fe);_0x5e9b7d(_0xbf21fe);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index ee0cce3..6467a1c 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 _0xf53d=['../../config/environment','./intZohoAccount.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x468012,_0x380ff4){var _0x461013=function(_0x40116a){while(--_0x40116a){_0x468012['push'](_0x468012['shift']());}};_0x461013(++_0x380ff4);}(_0xf53d,0x1f2));var _0xdf53=function(_0x30f192,_0x8c241a){_0x30f192=_0x30f192-0x0;var _0x51aeb4=_0xf53d[_0x30f192];return _0x51aeb4;};'use strict';var multer=require(_0xdf53('0x0'));var util=require(_0xdf53('0x1'));var path=require(_0xdf53('0x2'));var timeout=require(_0xdf53('0x3'));var express=require(_0xdf53('0x4'));var router=express[_0xdf53('0x5')]();var fs_extra=require(_0xdf53('0x6'));var auth=require(_0xdf53('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdf53('0x8'));var controller=require(_0xdf53('0x9'));router[_0xdf53('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdf53('0xb'),auth['isAuthenticated'](),controller[_0xdf53('0xc')]);router[_0xdf53('0xa')](_0xdf53('0xd'),auth[_0xdf53('0xe')](),controller[_0xdf53('0xf')]);router[_0xdf53('0xa')](_0xdf53('0x10'),auth[_0xdf53('0xe')](),controller['getFields']);router[_0xdf53('0x11')]('/',auth[_0xdf53('0xe')](),controller['create']);router[_0xdf53('0x11')](_0xdf53('0xd'),auth[_0xdf53('0xe')](),controller['addConfiguration']);router[_0xdf53('0x12')](_0xdf53('0xb'),auth['isAuthenticated'](),controller[_0xdf53('0x13')]);router[_0xdf53('0x14')](_0xdf53('0xb'),auth['isAuthenticated'](),controller[_0xdf53('0x15')]);module[_0xdf53('0x16')]=router; \ No newline at end of file +var _0x87fa=['/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations'];(function(_0x1f62be,_0x107b86){var _0x2114d3=function(_0x404724){while(--_0x404724){_0x1f62be['push'](_0x1f62be['shift']());}};_0x2114d3(++_0x107b86);}(_0x87fa,0x65));var _0xa87f=function(_0x1fb474,_0x32c089){_0x1fb474=_0x1fb474-0x0;var _0xa01de2=_0x87fa[_0x1fb474];return _0xa01de2;};'use strict';var multer=require(_0xa87f('0x0'));var util=require(_0xa87f('0x1'));var path=require(_0xa87f('0x2'));var timeout=require(_0xa87f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa87f('0x4'));var auth=require(_0xa87f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa87f('0x6'));var controller=require(_0xa87f('0x7'));router['get']('/',auth[_0xa87f('0x8')](),controller[_0xa87f('0x9')]);router[_0xa87f('0xa')](_0xa87f('0xb'),auth[_0xa87f('0x8')](),controller[_0xa87f('0xc')]);router['get']('/:id/configurations',auth[_0xa87f('0x8')](),controller[_0xa87f('0xd')]);router['get'](_0xa87f('0xe'),auth[_0xa87f('0x8')](),controller[_0xa87f('0xf')]);router[_0xa87f('0x10')]('/',auth[_0xa87f('0x8')](),controller[_0xa87f('0x11')]);router[_0xa87f('0x10')](_0xa87f('0x12'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xa87f('0x13')](_0xa87f('0xb'),auth['isAuthenticated'](),controller[_0xa87f('0x14')]);router[_0xa87f('0x15')](_0xa87f('0xb'),auth[_0xa87f('0x8')](),controller['destroy']);module[_0xa87f('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d9570ad..419a092 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 _0x41bb=['exports','STRING','sequelize'];(function(_0x1be3b3,_0x4335ee){var _0x4f8b2d=function(_0x1d955f){while(--_0x1d955f){_0x1be3b3['push'](_0x1be3b3['shift']());}};_0x4f8b2d(++_0x4335ee);}(_0x41bb,0xc5));var _0xb41b=function(_0xd6d4c4,_0x24e036){_0xd6d4c4=_0xd6d4c4-0x0;var _0x1b5f94=_0x41bb[_0xd6d4c4];return _0x1b5f94;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file +var _0x0a9a=['STRING','exports'];(function(_0xc591bd,_0x233e71){var _0x1e04d1=function(_0x2e3907){while(--_0x2e3907){_0xc591bd['push'](_0xc591bd['shift']());}};_0x1e04d1(++_0x233e71);}(_0x0a9a,0x183));var _0xa0a9=function(_0x92d94c,_0x577827){_0x92d94c=_0x92d94c-0x0;var _0x14f0e8=_0x0a9a[_0x92d94c];return _0x14f0e8;};'use strict';var Sequelize=require('sequelize');module[_0xa0a9('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa0a9('0x1')]},'host':{'type':Sequelize[_0xa0a9('0x1')]},'zone':{'type':Sequelize[_0xa0a9('0x1')]},'clientId':{'type':Sequelize[_0xa0a9('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa0a9('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xa0a9('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index c69fe9d..2eee602 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 _0x996a=['sort','addConfiguration','Subjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','clientId','clientSecret','access_token','getFields','serverUrl','code','host','zoho.eu','com','slice','substring','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','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','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','update','find','getConfigurations','findOne','ZohoConfiguration'];(function(_0x50b7c4,_0x5becdf){var _0x192220=function(_0x1ac4d1){while(--_0x1ac4d1){_0x50b7c4['push'](_0x50b7c4['shift']());}};_0x192220(++_0x5becdf);}(_0x996a,0x1bb));var _0xa996=function(_0x5e70a0,_0x36abcc){_0x5e70a0=_0x5e70a0-0x0;var _0xbb13ad=_0x996a[_0x5e70a0];return _0xbb13ad;};'use strict';var emlformat=require(_0xa996('0x0'));var rimraf=require(_0xa996('0x1'));var zipdir=require(_0xa996('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa996('0x3'));var moment=require(_0xa996('0x4'));var BPromise=require(_0xa996('0x5'));var Mustache=require('mustache');var util=require(_0xa996('0x6'));var path=require(_0xa996('0x7'));var sox=require(_0xa996('0x8'));var csv=require(_0xa996('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa996('0xa'));var _=require('lodash');var squel=require(_0xa996('0xb'));var crypto=require('crypto');var jsforce=require(_0xa996('0xc'));var deskjs=require(_0xa996('0xd'));var toCsv=require(_0xa996('0x9'));var querystring=require('querystring');var Papa=require(_0xa996('0xe'));var Redis=require(_0xa996('0xf'));var authService=require(_0xa996('0x10'));var qs=require(_0xa996('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa996('0x12'));var logger=require(_0xa996('0x13'))(_0xa996('0x14'));var utils=require('../../config/utils');var config=require(_0xa996('0x15'));var licenseUtil=require(_0xa996('0x16'));var db=require(_0xa996('0x17'))['db'];var integrations=require(_0xa996('0x18'));function respondWithStatusCode(_0x4a72c5,_0x52ff58){_0x52ff58=_0x52ff58||0xcc;return function(_0x14ebab){if(_0x14ebab){return _0x4a72c5[_0xa996('0x19')](_0x52ff58);}return _0x4a72c5[_0xa996('0x1a')](_0x52ff58)['end']();};}function respondWithResult(_0x1b6f42,_0x2d7f95){_0x2d7f95=_0x2d7f95||0xc8;return function(_0x395d80){if(_0x395d80){return _0x1b6f42[_0xa996('0x1a')](_0x2d7f95)[_0xa996('0x1b')](_0x395d80);}};}function respondWithFilteredResult(_0x3c5d13,_0x4a9904){return function(_0x4cc66f){if(_0x4cc66f){var _0x121639=typeof _0x4a9904[_0xa996('0x1c')]===_0xa996('0x1d')&&typeof _0x4a9904[_0xa996('0x1e')]===_0xa996('0x1d');var _0x1ecfa7=_0x4cc66f[_0xa996('0x1f')];var _0x55e5d1=_0x121639?0x0:_0x4a9904['offset'];var _0x25f8eb=_0x121639?_0x4cc66f[_0xa996('0x1f')]:_0x4a9904[_0xa996('0x1c')]+_0x4a9904['limit'];var _0x29581e;if(_0x25f8eb>=_0x1ecfa7){_0x25f8eb=_0x1ecfa7;_0x29581e=0xc8;}else{_0x29581e=0xce;}_0x3c5d13[_0xa996('0x1a')](_0x29581e);return _0x3c5d13[_0xa996('0x20')](_0xa996('0x21'),_0x55e5d1+'-'+_0x25f8eb+'/'+_0x1ecfa7)[_0xa996('0x1b')](_0x4cc66f);}return null;};}function patchUpdates(_0x45c5ec){return function(_0x1d3768){try{jsonpatch[_0xa996('0x22')](_0x1d3768,_0x45c5ec,!![]);}catch(_0xf5178e){return BPromise[_0xa996('0x23')](_0xf5178e);}return _0x1d3768[_0xa996('0x24')]();};}function saveUpdates(_0x5dbbab,_0xb1101f){return function(_0x767186){if(_0x767186){return _0x767186['update'](_0x5dbbab)[_0xa996('0x25')](function(_0x57c2e0){return _0x57c2e0;});}return null;};}function removeEntity(_0x1d5bf6,_0x128042){return function(_0x4f1f33){if(_0x4f1f33){return _0x4f1f33[_0xa996('0x26')]()[_0xa996('0x25')](function(){_0x1d5bf6[_0xa996('0x1a')](0xcc)[_0xa996('0x27')]();});}};}function handleEntityNotFound(_0x540e74,_0x1bc199){return function(_0x427430){if(!_0x427430){_0x540e74[_0xa996('0x19')](0x194);}return _0x427430;};}function handleError(_0x215c2b,_0x4409cb){_0x4409cb=_0x4409cb||0x1f4;return function(_0x10438e){logger[_0xa996('0x28')](_0x10438e[_0xa996('0x29')]);if(_0x10438e[_0xa996('0x2a')]){delete _0x10438e[_0xa996('0x2a')];}_0x215c2b['status'](_0x4409cb)[_0xa996('0x2b')](_0x10438e);};}exports[_0xa996('0x2c')]=function(_0x5b5b76,_0x22d319){var _0x4c979c={},_0x595475={},_0x4609fb={'count':0x0,'rows':[]};var _0x41fbd0=_['map'](db[_0xa996('0x2d')][_0xa996('0x2e')],function(_0x9bac6f){return{'name':_0x9bac6f[_0xa996('0x2f')],'type':_0x9bac6f[_0xa996('0x30')][_0xa996('0x31')]};});_0x595475[_0xa996('0x32')]=_[_0xa996('0x33')](_0x41fbd0,_0xa996('0x2a'));_0x595475[_0xa996('0x34')]=_[_0xa996('0x35')](_0x5b5b76[_0xa996('0x34')]);_0x595475[_0xa996('0x36')]=_[_0xa996('0x37')](_0x595475['model'],_0x595475[_0xa996('0x34')]);_0x4c979c[_0xa996('0x38')]=_[_0xa996('0x37')](_0x595475[_0xa996('0x32')],qs['fields'](_0x5b5b76[_0xa996('0x34')][_0xa996('0x39')]));_0x4c979c[_0xa996('0x38')]=_0x4c979c[_0xa996('0x38')]['length']?_0x4c979c[_0xa996('0x38')]:_0x595475[_0xa996('0x32')];if(!_0x5b5b76[_0xa996('0x34')][_0xa996('0x3a')]('nolimit')){_0x4c979c[_0xa996('0x1e')]=qs[_0xa996('0x1e')](_0x5b5b76[_0xa996('0x34')][_0xa996('0x1e')]);_0x4c979c[_0xa996('0x1c')]=qs[_0xa996('0x1c')](_0x5b5b76[_0xa996('0x34')][_0xa996('0x1c')]);}_0x4c979c[_0xa996('0x3b')]=qs['sort'](_0x5b5b76[_0xa996('0x34')]['sort']);_0x4c979c[_0xa996('0x3c')]=qs[_0xa996('0x36')](_[_0xa996('0x3d')](_0x5b5b76[_0xa996('0x34')],_0x595475[_0xa996('0x36')]),_0x41fbd0);if(_0x5b5b76[_0xa996('0x34')]['filter']){_0x4c979c[_0xa996('0x3c')]=_[_0xa996('0x3e')](_0x4c979c[_0xa996('0x3c')],{'$or':_[_0xa996('0x33')](_0x41fbd0,function(_0x5a94cc){if(_0x5a94cc[_0xa996('0x30')]!==_0xa996('0x3f')){var _0x4d7e22={};_0x4d7e22[_0x5a94cc[_0xa996('0x2a')]]={'$like':'%'+_0x5b5b76['query'][_0xa996('0x40')]+'%'};return _0x4d7e22;}})});}_0x4c979c=_['merge']({},_0x4c979c,_0x5b5b76[_0xa996('0x41')]);var _0x26b8f3={'where':_0x4c979c[_0xa996('0x3c')]};return db['ZohoAccount'][_0xa996('0x1f')](_0x26b8f3)['then'](function(_0xfa04d9){_0x4609fb[_0xa996('0x1f')]=_0xfa04d9;if(_0x5b5b76[_0xa996('0x34')][_0xa996('0x42')]){_0x4c979c[_0xa996('0x43')]=[{'all':!![]}];}return db[_0xa996('0x2d')][_0xa996('0x44')](_0x4c979c);})[_0xa996('0x25')](function(_0x504cd6){_0x4609fb[_0xa996('0x45')]=_0x504cd6;return _0x4609fb;})[_0xa996('0x25')](respondWithFilteredResult(_0x22d319,_0x4c979c))['catch'](handleError(_0x22d319,null));};exports[_0xa996('0x46')]=function(_0x2e7249,_0x4fcdd8){var _0x19dfe4={'raw':![],'where':{'id':_0x2e7249[_0xa996('0x47')]['id']}},_0x1b3ade={};_0x1b3ade[_0xa996('0x32')]=_[_0xa996('0x35')](db[_0xa996('0x2d')][_0xa996('0x2e')]);_0x1b3ade[_0xa996('0x34')]=_[_0xa996('0x35')](_0x2e7249['query']);_0x1b3ade['filters']=_[_0xa996('0x37')](_0x1b3ade[_0xa996('0x32')],_0x1b3ade[_0xa996('0x34')]);_0x19dfe4[_0xa996('0x38')]=_[_0xa996('0x37')](_0x1b3ade['model'],qs[_0xa996('0x39')](_0x2e7249['query'][_0xa996('0x39')]));_0x19dfe4['attributes']=_0x19dfe4[_0xa996('0x38')][_0xa996('0x48')]?_0x19dfe4[_0xa996('0x38')]:_0x1b3ade[_0xa996('0x32')];if(_0x2e7249[_0xa996('0x34')]['includeAll']){_0x19dfe4[_0xa996('0x43')]=[{'all':!![]}];}_0x19dfe4=_[_0xa996('0x3e')]({},_0x19dfe4,_0x2e7249[_0xa996('0x41')]);return db[_0xa996('0x2d')]['find'](_0x19dfe4)['then'](handleEntityNotFound(_0x4fcdd8,null))[_0xa996('0x25')](respondWithResult(_0x4fcdd8,null))[_0xa996('0x49')](handleError(_0x4fcdd8,null));};exports['create']=function(_0x21d893,_0x4e60cf){return db[_0xa996('0x2d')][_0xa996('0x4a')](_0x21d893[_0xa996('0x4b')],{})[_0xa996('0x25')](respondWithResult(_0x4e60cf,0xc9))[_0xa996('0x49')](handleError(_0x4e60cf,null));};exports[_0xa996('0x4c')]=function(_0x4d939c,_0x251571){if(_0x4d939c[_0xa996('0x4b')]['id']){delete _0x4d939c[_0xa996('0x4b')]['id'];}return db[_0xa996('0x2d')][_0xa996('0x4d')]({'where':{'id':_0x4d939c[_0xa996('0x47')]['id']}})[_0xa996('0x25')](handleEntityNotFound(_0x251571,null))['then'](saveUpdates(_0x4d939c[_0xa996('0x4b')],null))['then'](respondWithResult(_0x251571,null))['catch'](handleError(_0x251571,null));};exports[_0xa996('0x26')]=function(_0x3d7bef,_0xf38397){return db[_0xa996('0x2d')][_0xa996('0x4d')]({'where':{'id':_0x3d7bef[_0xa996('0x47')]['id']}})[_0xa996('0x25')](handleEntityNotFound(_0xf38397,null))[_0xa996('0x25')](removeEntity(_0xf38397,null))[_0xa996('0x49')](handleError(_0xf38397,null));};exports[_0xa996('0x4e')]=function(_0x4fcfde,_0x3aeb0c,_0x1f7434){var _0x51771c={};var _0x10bc68={};var _0x3c80ad;var _0x2c723a;return db['ZohoAccount'][_0xa996('0x4f')]({'where':{'id':_0x4fcfde[_0xa996('0x47')]['id']}})[_0xa996('0x25')](handleEntityNotFound(_0x3aeb0c,null))[_0xa996('0x25')](function(_0xa43a3c){if(_0xa43a3c){_0x3c80ad=_0xa43a3c;_0x10bc68[_0xa996('0x32')]=_['keys'](db[_0xa996('0x50')]['rawAttributes']);_0x10bc68[_0xa996('0x34')]=_[_0xa996('0x35')](_0x4fcfde[_0xa996('0x34')]);_0x10bc68[_0xa996('0x36')]=_[_0xa996('0x37')](_0x10bc68['model'],_0x10bc68[_0xa996('0x34')]);_0x51771c[_0xa996('0x38')]=_[_0xa996('0x37')](_0x10bc68[_0xa996('0x32')],qs[_0xa996('0x39')](_0x4fcfde[_0xa996('0x34')][_0xa996('0x39')]));_0x51771c['attributes']=_0x51771c[_0xa996('0x38')][_0xa996('0x48')]?_0x51771c[_0xa996('0x38')]:_0x10bc68['model'];_0x51771c[_0xa996('0x3b')]=qs[_0xa996('0x51')](_0x4fcfde[_0xa996('0x34')]['sort']);_0x51771c['where']=qs[_0xa996('0x36')](_['pick'](_0x4fcfde[_0xa996('0x34')],_0x10bc68[_0xa996('0x36')]));if(_0x4fcfde['query'][_0xa996('0x40')]){_0x51771c['where']=_[_0xa996('0x3e')](_0x51771c[_0xa996('0x3c')],{'$or':_[_0xa996('0x33')](_0x51771c[_0xa996('0x38')],function(_0x438623){var _0x5db090={};_0x5db090[_0x438623]={'$like':'%'+_0x4fcfde[_0xa996('0x34')][_0xa996('0x40')]+'%'};return _0x5db090;})});}_0x51771c=_['merge']({},_0x51771c,_0x4fcfde[_0xa996('0x41')]);return _0x3c80ad['getConfigurations'](_0x51771c);}})[_0xa996('0x25')](function(_0xbd7645){if(_0xbd7645){_0x2c723a=_0xbd7645['length'];if(!_0x4fcfde[_0xa996('0x34')][_0xa996('0x3a')]('nolimit')){_0x51771c[_0xa996('0x1e')]=qs[_0xa996('0x1e')](_0x4fcfde['query'][_0xa996('0x1e')]);_0x51771c[_0xa996('0x1c')]=qs['offset'](_0x4fcfde['query'][_0xa996('0x1c')]);}return _0x3c80ad[_0xa996('0x4e')](_0x51771c);}})['then'](function(_0x4102b5){if(_0x4102b5){return _0x4102b5?{'count':_0x2c723a,'rows':_0x4102b5}:null;}})[_0xa996('0x25')](respondWithResult(_0x3aeb0c,null))[_0xa996('0x49')](handleError(_0x3aeb0c,null));};exports[_0xa996('0x52')]=function(_0x4e62ae,_0xf312a0,_0x4e4f32){if(_0x4e62ae[_0xa996('0x4b')]['id']){delete _0x4e62ae[_0xa996('0x4b')]['id'];}return db[_0xa996('0x2d')][_0xa996('0x4f')]({'where':{'id':_0x4e62ae[_0xa996('0x47')]['id']}})[_0xa996('0x25')](handleEntityNotFound(_0xf312a0,null))[_0xa996('0x25')](function(_0x8ea235){if(_0x8ea235){_0x4e62ae[_0xa996('0x4b')]['AccountId']=_0x8ea235['id'];_0x4e62ae[_0xa996('0x4b')][_0xa996('0x53')]=integrations['getSubjects'](_0x4e62ae['body'][_0xa996('0x54')],_0x4e62ae[_0xa996('0x4b')][_0xa996('0x30')]);_0x4e62ae[_0xa996('0x4b')][_0xa996('0x55')]=integrations[_0xa996('0x56')](_0x4e62ae[_0xa996('0x4b')][_0xa996('0x54')],_0x4e62ae[_0xa996('0x4b')][_0xa996('0x30')]);return db[_0xa996('0x50')][_0xa996('0x4a')](_0x4e62ae[_0xa996('0x4b')],{'include':[{'model':db[_0xa996('0x57')],'as':'Subjects'},{'model':db[_0xa996('0x57')],'as':_0xa996('0x55')}]});}return null;})['then'](respondWithResult(_0xf312a0,null))[_0xa996('0x49')](handleError(_0xf312a0,null));};function getAccessToken(_0x31f60f){return new Promise(function(_0x281069,_0x7b4e4d){var _0x15372f;switch(_0x31f60f[_0xa996('0x58')]){case'US':_0x15372f=_0xa996('0x59');break;case'AU':_0x15372f=_0xa996('0x5a');break;case'EU':_0x15372f=_0xa996('0x5b');break;case'IN':_0x15372f=_0xa996('0x5c');break;case'CN':_0x15372f=_0xa996('0x5d');break;default:_0x15372f=_0xa996('0x5b');break;}var _0x436f93={'method':'POST','uri':_0x15372f+'/oauth/v2/token','qs':{'refresh_token':_0x31f60f['refreshToken'],'client_id':_0x31f60f[_0xa996('0x5e')],'client_secret':_0x31f60f[_0xa996('0x5f')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x436f93)[_0xa996('0x25')](function(_0x76e3e3){if(_0x76e3e3[_0xa996('0x60')]){_0x281069(_0x76e3e3[_0xa996('0x60')]);}else{_0x7b4e4d('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})['catch'](function(_0x852f5b){_0x7b4e4d(_0x852f5b);});});}exports[_0xa996('0x61')]=function(_0x149bd4,_0x3da596,_0x5dbf42){var _0x4696f3,_0x29e6ff,_0x33cb20,_0x9dc73e,_0x24dc89;return db['ZohoAccount']['findOne']({'where':{'id':_0x149bd4[_0xa996('0x47')]['id']},'attributes':['id','host',_0xa996('0x58'),_0xa996('0x5e'),_0xa996('0x5f'),_0xa996('0x62'),_0xa996('0x63'),'refreshToken']})[_0xa996('0x25')](handleEntityNotFound(_0x3da596,null))[_0xa996('0x25')](function(_0xf65b33){_0x24dc89=_0xf65b33;_0x4696f3=_0x24dc89[_0xa996('0x64')];_0x29e6ff=_0x4696f3===_0xa996('0x65')?'eu':_0xa996('0x66');_0x33cb20=_0x24dc89['serverUrl'];var _0x32a4a1=_0x33cb20[_0xa996('0x67')](-0x1);if(_0x32a4a1==='/'||_0x32a4a1==='\x5c'||_0x32a4a1===':'){_0x33cb20=_0x33cb20[_0xa996('0x68')](0x0,_0x33cb20['lastIndexOf'](_0x32a4a1));}if(!_0x24dc89[_0xa996('0x69')]){throw new Error(_0xa996('0x6a'));}return getAccessToken(_0x24dc89);})[_0xa996('0x25')](function(_0x444b74){if(_0x444b74){return rp({'method':_0xa996('0x6b'),'uri':util['format'](_0xa996('0x6c'),_0x29e6ff),'qs':{'module':_0xa996('0x6d')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x444b74},'json':!![]});}})[_0xa996('0x25')](function(_0x34d190){if(_0x34d190){if(_0x34d190[_0xa996('0x6e')]&&_0x34d190['response'][_0xa996('0x28')]){throw new Error(_0x34d190[_0xa996('0x6e')][_0xa996('0x28')][_0xa996('0x6f')]);}var _0x53f12a=[];var _0xf94800=[];var _0x390ae1=['Owner',_0xa996('0x70'),_0xa996('0x71'),_0xa996('0x72'),_0xa996('0x73'),_0xa996('0x74'),'Call_Start_Time','Call_Type'];_0xf94800=_[_0xa996('0x75')](_0x34d190[_0xa996('0x39')],function(_0x5a6398){return _0x390ae1[_0xa996('0x76')](_0x5a6398[_0xa996('0x77')]);});for(var _0x21c38b=0x0;_0x21c38b<_0xf94800[_0xa996('0x48')];_0x21c38b++){if(_0xf94800[_0x21c38b][_0xa996('0x78')]===![]){_0x53f12a[_0xa996('0x79')]({'id':_0xf94800[_0x21c38b]['id'],'name':_0xf94800[_0x21c38b][_0xa996('0x7a')],'custom':_0xf94800[_0x21c38b][_0xa996('0x7b')],'options':_0xf94800[_0x21c38b][_0xa996('0x7c')]===_0xa996('0x7d')&&_0xf94800[_0x21c38b][_0xa996('0x7e')]['length']>-0x1?_[_0xa996('0x33')](_0xf94800[_0x21c38b][_0xa996('0x7e')],function(_0x267fc0){return{'name':_0x267fc0,'value':_0x267fc0};}):[]});}}return{'count':_0x53f12a[_0xa996('0x48')],'rows':_0x53f12a};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x3da596,null))[_0xa996('0x49')](function(_0x5d0abb){var _0x547c10=_0x149bd4['query'][_0xa996('0x7f')]?0x1f4:_0x5d0abb[_0xa996('0x80')]||0x1f4;logger[_0xa996('0x28')](_0xa996('0x81'),_0xa996('0x61'),_0x547c10,JSON['stringify'](_0x5d0abb));delete _0x5d0abb[_0xa996('0x2a')];if(_0x547c10===0x191){_0x547c10=0x190;}_0x3da596['status'](_0x547c10)[_0xa996('0x2b')](_0x149bd4[_0xa996('0x34')][_0xa996('0x7f')]?{'message':_0xa996('0x82'),'statusCode':_0x5d0abb[_0xa996('0x80')]}:_0x5d0abb);});}; \ No newline at end of file +var _0x8bf0=['query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','catch','params','find','create','body','destroy','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','type','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','access_token','getFields','clientSecret','serverUrl','code','host','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','remove','system_mandatory','push','custom_field','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','send','index','ZohoAccount','rawAttributes','fieldName','key','name'];(function(_0x9d53fb,_0x4b898b){var _0x12f955=function(_0x5b03f9){while(--_0x5b03f9){_0x9d53fb['push'](_0x9d53fb['shift']());}};_0x12f955(++_0x4b898b);}(_0x8bf0,0xd1));var _0x08bf=function(_0x55b936,_0x42509d){_0x55b936=_0x55b936-0x0;var _0xb7292c=_0x8bf0[_0x55b936];return _0xb7292c;};'use strict';var emlformat=require(_0x08bf('0x0'));var rimraf=require(_0x08bf('0x1'));var zipdir=require(_0x08bf('0x2'));var jsonpatch=require(_0x08bf('0x3'));var rp=require('request-promise');var moment=require(_0x08bf('0x4'));var BPromise=require(_0x08bf('0x5'));var Mustache=require(_0x08bf('0x6'));var util=require(_0x08bf('0x7'));var path=require(_0x08bf('0x8'));var sox=require(_0x08bf('0x9'));var csv=require('to-csv');var ejs=require(_0x08bf('0xa'));var fs=require('fs');var fs_extra=require(_0x08bf('0xb'));var _=require(_0x08bf('0xc'));var squel=require(_0x08bf('0xd'));var crypto=require(_0x08bf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x08bf('0xf'));var toCsv=require(_0x08bf('0x10'));var querystring=require(_0x08bf('0x11'));var Papa=require(_0x08bf('0x12'));var Redis=require(_0x08bf('0x13'));var authService=require(_0x08bf('0x14'));var qs=require(_0x08bf('0x15'));var as=require(_0x08bf('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x08bf('0x17'))(_0x08bf('0x18'));var utils=require(_0x08bf('0x19'));var config=require(_0x08bf('0x1a'));var licenseUtil=require(_0x08bf('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0x08bf('0x1c'));function respondWithStatusCode(_0x504a97,_0x34b205){_0x34b205=_0x34b205||0xcc;return function(_0x59a24c){if(_0x59a24c){return _0x504a97[_0x08bf('0x1d')](_0x34b205);}return _0x504a97[_0x08bf('0x1e')](_0x34b205)[_0x08bf('0x1f')]();};}function respondWithResult(_0x3f9229,_0x92e054){_0x92e054=_0x92e054||0xc8;return function(_0x1f4b4b){if(_0x1f4b4b){return _0x3f9229[_0x08bf('0x1e')](_0x92e054)['json'](_0x1f4b4b);}};}function respondWithFilteredResult(_0x38afc9,_0x45e600){return function(_0x56262c){if(_0x56262c){var _0x542d4a=typeof _0x45e600[_0x08bf('0x20')]==='undefined'&&typeof _0x45e600[_0x08bf('0x21')]===_0x08bf('0x22');var _0x3ef60f=_0x56262c[_0x08bf('0x23')];var _0x495dad=_0x542d4a?0x0:_0x45e600[_0x08bf('0x20')];var _0x7e24b8=_0x542d4a?_0x56262c['count']:_0x45e600[_0x08bf('0x20')]+_0x45e600[_0x08bf('0x21')];var _0x36900b;if(_0x7e24b8>=_0x3ef60f){_0x7e24b8=_0x3ef60f;_0x36900b=0xc8;}else{_0x36900b=0xce;}_0x38afc9[_0x08bf('0x1e')](_0x36900b);return _0x38afc9[_0x08bf('0x24')](_0x08bf('0x25'),_0x495dad+'-'+_0x7e24b8+'/'+_0x3ef60f)['json'](_0x56262c);}return null;};}function patchUpdates(_0x382e35){return function(_0x54e856){try{jsonpatch[_0x08bf('0x26')](_0x54e856,_0x382e35,!![]);}catch(_0x114585){return BPromise[_0x08bf('0x27')](_0x114585);}return _0x54e856[_0x08bf('0x28')]();};}function saveUpdates(_0x48197b,_0x4facc0){return function(_0x50e584){if(_0x50e584){return _0x50e584[_0x08bf('0x29')](_0x48197b)[_0x08bf('0x2a')](function(_0x174720){return _0x174720;});}return null;};}function removeEntity(_0x1857c8,_0x556b88){return function(_0x320a95){if(_0x320a95){return _0x320a95['destroy']()['then'](function(){_0x1857c8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x400cb0,_0x117b67){return function(_0x5a0013){if(!_0x5a0013){_0x400cb0['sendStatus'](0x194);}return _0x5a0013;};}function handleError(_0x355589,_0x4ee47f){_0x4ee47f=_0x4ee47f||0x1f4;return function(_0x27c877){logger['error'](_0x27c877[_0x08bf('0x2b')]);if(_0x27c877['name']){delete _0x27c877['name'];}_0x355589[_0x08bf('0x1e')](_0x4ee47f)[_0x08bf('0x2c')](_0x27c877);};}exports[_0x08bf('0x2d')]=function(_0x7a01b5,_0x3f8912){var _0x506c53={},_0x5902a9={},_0x1fc0e2={'count':0x0,'rows':[]};var _0x4c579c=_['map'](db[_0x08bf('0x2e')][_0x08bf('0x2f')],function(_0x1a6c71){return{'name':_0x1a6c71[_0x08bf('0x30')],'type':_0x1a6c71['type'][_0x08bf('0x31')]};});_0x5902a9['model']=_['map'](_0x4c579c,_0x08bf('0x32'));_0x5902a9[_0x08bf('0x33')]=_[_0x08bf('0x34')](_0x7a01b5[_0x08bf('0x33')]);_0x5902a9['filters']=_[_0x08bf('0x35')](_0x5902a9[_0x08bf('0x36')],_0x5902a9['query']);_0x506c53[_0x08bf('0x37')]=_[_0x08bf('0x35')](_0x5902a9[_0x08bf('0x36')],qs[_0x08bf('0x38')](_0x7a01b5['query'][_0x08bf('0x38')]));_0x506c53[_0x08bf('0x37')]=_0x506c53['attributes'][_0x08bf('0x39')]?_0x506c53[_0x08bf('0x37')]:_0x5902a9[_0x08bf('0x36')];if(!_0x7a01b5[_0x08bf('0x33')][_0x08bf('0x3a')](_0x08bf('0x3b'))){_0x506c53[_0x08bf('0x21')]=qs[_0x08bf('0x21')](_0x7a01b5['query'][_0x08bf('0x21')]);_0x506c53[_0x08bf('0x20')]=qs[_0x08bf('0x20')](_0x7a01b5['query'][_0x08bf('0x20')]);}_0x506c53[_0x08bf('0x3c')]=qs[_0x08bf('0x3d')](_0x7a01b5['query']['sort']);_0x506c53[_0x08bf('0x3e')]=qs[_0x08bf('0x3f')](_['pick'](_0x7a01b5[_0x08bf('0x33')],_0x5902a9[_0x08bf('0x3f')]),_0x4c579c);if(_0x7a01b5[_0x08bf('0x33')][_0x08bf('0x40')]){_0x506c53['where']=_[_0x08bf('0x41')](_0x506c53[_0x08bf('0x3e')],{'$or':_[_0x08bf('0x42')](_0x4c579c,function(_0x457a56){if(_0x457a56['type']!==_0x08bf('0x43')){var _0x398c09={};_0x398c09[_0x457a56['name']]={'$like':'%'+_0x7a01b5[_0x08bf('0x33')][_0x08bf('0x40')]+'%'};return _0x398c09;}})});}_0x506c53=_[_0x08bf('0x41')]({},_0x506c53,_0x7a01b5[_0x08bf('0x44')]);var _0x7b4924={'where':_0x506c53['where']};return db[_0x08bf('0x2e')][_0x08bf('0x23')](_0x7b4924)[_0x08bf('0x2a')](function(_0x165037){_0x1fc0e2[_0x08bf('0x23')]=_0x165037;if(_0x7a01b5['query'][_0x08bf('0x45')]){_0x506c53[_0x08bf('0x46')]=[{'all':!![]}];}return db[_0x08bf('0x2e')]['findAll'](_0x506c53);})[_0x08bf('0x2a')](function(_0x42b09e){_0x1fc0e2['rows']=_0x42b09e;return _0x1fc0e2;})[_0x08bf('0x2a')](respondWithFilteredResult(_0x3f8912,_0x506c53))[_0x08bf('0x47')](handleError(_0x3f8912,null));};exports['show']=function(_0x27273c,_0x2dd2f5){var _0x59c5c5={'raw':![],'where':{'id':_0x27273c[_0x08bf('0x48')]['id']}},_0xa421f5={};_0xa421f5[_0x08bf('0x36')]=_[_0x08bf('0x34')](db['ZohoAccount']['rawAttributes']);_0xa421f5['query']=_[_0x08bf('0x34')](_0x27273c[_0x08bf('0x33')]);_0xa421f5[_0x08bf('0x3f')]=_[_0x08bf('0x35')](_0xa421f5[_0x08bf('0x36')],_0xa421f5[_0x08bf('0x33')]);_0x59c5c5['attributes']=_[_0x08bf('0x35')](_0xa421f5[_0x08bf('0x36')],qs[_0x08bf('0x38')](_0x27273c[_0x08bf('0x33')][_0x08bf('0x38')]));_0x59c5c5[_0x08bf('0x37')]=_0x59c5c5[_0x08bf('0x37')][_0x08bf('0x39')]?_0x59c5c5[_0x08bf('0x37')]:_0xa421f5['model'];if(_0x27273c[_0x08bf('0x33')][_0x08bf('0x45')]){_0x59c5c5[_0x08bf('0x46')]=[{'all':!![]}];}_0x59c5c5=_[_0x08bf('0x41')]({},_0x59c5c5,_0x27273c['options']);return db[_0x08bf('0x2e')][_0x08bf('0x49')](_0x59c5c5)[_0x08bf('0x2a')](handleEntityNotFound(_0x2dd2f5,null))[_0x08bf('0x2a')](respondWithResult(_0x2dd2f5,null))[_0x08bf('0x47')](handleError(_0x2dd2f5,null));};exports[_0x08bf('0x4a')]=function(_0x5c2e6b,_0xc7439f){return db[_0x08bf('0x2e')][_0x08bf('0x4a')](_0x5c2e6b[_0x08bf('0x4b')],{})[_0x08bf('0x2a')](respondWithResult(_0xc7439f,0xc9))[_0x08bf('0x47')](handleError(_0xc7439f,null));};exports[_0x08bf('0x29')]=function(_0x2c8789,_0x1f461d){if(_0x2c8789[_0x08bf('0x4b')]['id']){delete _0x2c8789['body']['id'];}return db[_0x08bf('0x2e')][_0x08bf('0x49')]({'where':{'id':_0x2c8789[_0x08bf('0x48')]['id']}})[_0x08bf('0x2a')](handleEntityNotFound(_0x1f461d,null))[_0x08bf('0x2a')](saveUpdates(_0x2c8789['body'],null))[_0x08bf('0x2a')](respondWithResult(_0x1f461d,null))['catch'](handleError(_0x1f461d,null));};exports[_0x08bf('0x4c')]=function(_0x1f7a81,_0x3febd0){return db['ZohoAccount']['find']({'where':{'id':_0x1f7a81[_0x08bf('0x48')]['id']}})[_0x08bf('0x2a')](handleEntityNotFound(_0x3febd0,null))[_0x08bf('0x2a')](removeEntity(_0x3febd0,null))[_0x08bf('0x47')](handleError(_0x3febd0,null));};exports['getConfigurations']=function(_0x1ed70f,_0x239460,_0x524d0e){var _0x4a165e={};var _0x1dbe73={};var _0x3322e7;var _0x127adb;return db[_0x08bf('0x2e')]['findOne']({'where':{'id':_0x1ed70f[_0x08bf('0x48')]['id']}})[_0x08bf('0x2a')](handleEntityNotFound(_0x239460,null))[_0x08bf('0x2a')](function(_0x38ebec){if(_0x38ebec){_0x3322e7=_0x38ebec;_0x1dbe73[_0x08bf('0x36')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x1dbe73['query']=_['keys'](_0x1ed70f[_0x08bf('0x33')]);_0x1dbe73['filters']=_[_0x08bf('0x35')](_0x1dbe73[_0x08bf('0x36')],_0x1dbe73[_0x08bf('0x33')]);_0x4a165e['attributes']=_['intersection'](_0x1dbe73['model'],qs[_0x08bf('0x38')](_0x1ed70f['query'][_0x08bf('0x38')]));_0x4a165e[_0x08bf('0x37')]=_0x4a165e[_0x08bf('0x37')][_0x08bf('0x39')]?_0x4a165e[_0x08bf('0x37')]:_0x1dbe73['model'];_0x4a165e[_0x08bf('0x3c')]=qs[_0x08bf('0x3d')](_0x1ed70f[_0x08bf('0x33')][_0x08bf('0x3d')]);_0x4a165e[_0x08bf('0x3e')]=qs[_0x08bf('0x3f')](_[_0x08bf('0x4d')](_0x1ed70f[_0x08bf('0x33')],_0x1dbe73[_0x08bf('0x3f')]));if(_0x1ed70f[_0x08bf('0x33')][_0x08bf('0x40')]){_0x4a165e[_0x08bf('0x3e')]=_[_0x08bf('0x41')](_0x4a165e['where'],{'$or':_[_0x08bf('0x42')](_0x4a165e[_0x08bf('0x37')],function(_0x4d5bba){var _0x27ff8={};_0x27ff8[_0x4d5bba]={'$like':'%'+_0x1ed70f[_0x08bf('0x33')]['filter']+'%'};return _0x27ff8;})});}_0x4a165e=_[_0x08bf('0x41')]({},_0x4a165e,_0x1ed70f['options']);return _0x3322e7[_0x08bf('0x4e')](_0x4a165e);}})[_0x08bf('0x2a')](function(_0x2ddd6c){if(_0x2ddd6c){_0x127adb=_0x2ddd6c[_0x08bf('0x39')];if(!_0x1ed70f[_0x08bf('0x33')]['hasOwnProperty'](_0x08bf('0x3b'))){_0x4a165e['limit']=qs['limit'](_0x1ed70f['query'][_0x08bf('0x21')]);_0x4a165e[_0x08bf('0x20')]=qs[_0x08bf('0x20')](_0x1ed70f[_0x08bf('0x33')]['offset']);}return _0x3322e7[_0x08bf('0x4e')](_0x4a165e);}})[_0x08bf('0x2a')](function(_0x5b0e31){if(_0x5b0e31){return _0x5b0e31?{'count':_0x127adb,'rows':_0x5b0e31}:null;}})['then'](respondWithResult(_0x239460,null))[_0x08bf('0x47')](handleError(_0x239460,null));};exports[_0x08bf('0x4f')]=function(_0x4956e7,_0x33fe47,_0xa2ad96){if(_0x4956e7[_0x08bf('0x4b')]['id']){delete _0x4956e7[_0x08bf('0x4b')]['id'];}return db[_0x08bf('0x2e')][_0x08bf('0x50')]({'where':{'id':_0x4956e7[_0x08bf('0x48')]['id']}})[_0x08bf('0x2a')](handleEntityNotFound(_0x33fe47,null))[_0x08bf('0x2a')](function(_0x389b47){if(_0x389b47){_0x4956e7[_0x08bf('0x4b')][_0x08bf('0x51')]=_0x389b47['id'];_0x4956e7[_0x08bf('0x4b')][_0x08bf('0x52')]=integrations[_0x08bf('0x53')](_0x4956e7[_0x08bf('0x4b')][_0x08bf('0x54')],_0x4956e7[_0x08bf('0x4b')][_0x08bf('0x55')]);_0x4956e7['body']['Descriptions']=integrations[_0x08bf('0x56')](_0x4956e7[_0x08bf('0x4b')][_0x08bf('0x54')],_0x4956e7[_0x08bf('0x4b')]['type']);return db[_0x08bf('0x57')][_0x08bf('0x4a')](_0x4956e7[_0x08bf('0x4b')],{'include':[{'model':db[_0x08bf('0x58')],'as':'Subjects'},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x33fe47,null))[_0x08bf('0x47')](handleError(_0x33fe47,null));};function getAccessToken(_0x3dec1d){return new Promise(function(_0x24bfd6,_0x3060c6){var _0x546fc9;switch(_0x3dec1d[_0x08bf('0x59')]){case'US':_0x546fc9=_0x08bf('0x5a');break;case'AU':_0x546fc9='https://accounts.zoho.com.au';break;case'EU':_0x546fc9=_0x08bf('0x5b');break;case'IN':_0x546fc9=_0x08bf('0x5c');break;case'CN':_0x546fc9='https://accounts.zoho.com.cn';break;default:_0x546fc9='https://accounts.zoho.eu';break;}var _0x366b6a={'method':_0x08bf('0x5d'),'uri':_0x546fc9+'/oauth/v2/token','qs':{'refresh_token':_0x3dec1d[_0x08bf('0x5e')],'client_id':_0x3dec1d[_0x08bf('0x5f')],'client_secret':_0x3dec1d['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x366b6a)[_0x08bf('0x2a')](function(_0xe6fcac){if(_0xe6fcac[_0x08bf('0x60')]){_0x24bfd6(_0xe6fcac['access_token']);}else{_0x3060c6('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x08bf('0x47')](function(_0x4ed04d){_0x3060c6(_0x4ed04d);});});}exports[_0x08bf('0x61')]=function(_0x2a6ec4,_0x173cc8,_0x472e67){var _0x514950,_0x238835,_0x3854ab,_0x6bb044,_0x379f9f;return db['ZohoAccount']['findOne']({'where':{'id':_0x2a6ec4[_0x08bf('0x48')]['id']},'attributes':['id','host',_0x08bf('0x59'),'clientId',_0x08bf('0x62'),_0x08bf('0x63'),_0x08bf('0x64'),_0x08bf('0x5e')]})['then'](handleEntityNotFound(_0x173cc8,null))[_0x08bf('0x2a')](function(_0x1f3e8d){_0x379f9f=_0x1f3e8d;_0x514950=_0x379f9f[_0x08bf('0x65')];_0x238835=_0x514950==='zoho.eu'?'eu':_0x08bf('0x66');_0x3854ab=_0x379f9f[_0x08bf('0x63')];var _0x424d08=_0x3854ab[_0x08bf('0x67')](-0x1);if(_0x424d08==='/'||_0x424d08==='\x5c'||_0x424d08===':'){_0x3854ab=_0x3854ab[_0x08bf('0x68')](0x0,_0x3854ab[_0x08bf('0x69')](_0x424d08));}if(!_0x379f9f[_0x08bf('0x5e')]){throw new Error(_0x08bf('0x6a'));}return getAccessToken(_0x379f9f);})[_0x08bf('0x2a')](function(_0xc3a488){if(_0xc3a488){return rp({'method':_0x08bf('0x6b'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x238835),'qs':{'module':_0x08bf('0x6c')},'headers':{'Authorization':_0x08bf('0x6d')+_0xc3a488},'json':!![]});}})['then'](function(_0x5d42c3){if(_0x5d42c3){if(_0x5d42c3[_0x08bf('0x6e')]&&_0x5d42c3['response']['error']){throw new Error(_0x5d42c3[_0x08bf('0x6e')][_0x08bf('0x6f')][_0x08bf('0x70')]);}var _0x5ca9c2=[];var _0x2b5a47=[];var _0x3270f6=[_0x08bf('0x71'),_0x08bf('0x72'),_0x08bf('0x73'),'WhoId',_0x08bf('0x74'),_0x08bf('0x75'),_0x08bf('0x76'),'Call_Type'];_0x2b5a47=_[_0x08bf('0x77')](_0x5d42c3[_0x08bf('0x38')],function(_0x299003){return _0x3270f6['includes'](_0x299003['api_name']);});for(var _0x38dbd5=0x0;_0x38dbd5<_0x2b5a47[_0x08bf('0x39')];_0x38dbd5++){if(_0x2b5a47[_0x38dbd5][_0x08bf('0x78')]===![]){_0x5ca9c2[_0x08bf('0x79')]({'id':_0x2b5a47[_0x38dbd5]['id'],'name':_0x2b5a47[_0x38dbd5]['display_label'],'custom':_0x2b5a47[_0x38dbd5][_0x08bf('0x7a')],'options':_0x2b5a47[_0x38dbd5]['data_type']===_0x08bf('0x7b')&&_0x2b5a47[_0x38dbd5][_0x08bf('0x7c')][_0x08bf('0x39')]>-0x1?_[_0x08bf('0x42')](_0x2b5a47[_0x38dbd5][_0x08bf('0x7c')],function(_0x4f7118){return{'name':_0x4f7118,'value':_0x4f7118};}):[]});}}return{'count':_0x5ca9c2['length'],'rows':_0x5ca9c2};}else{return{'count':0x0,'rows':[]};}})[_0x08bf('0x2a')](respondWithResult(_0x173cc8,null))[_0x08bf('0x47')](function(_0x1af704){var _0x54649c=_0x2a6ec4[_0x08bf('0x33')][_0x08bf('0x7d')]?0x1f4:_0x1af704[_0x08bf('0x7e')]||0x1f4;logger['error'](_0x08bf('0x7f'),_0x08bf('0x61'),_0x54649c,JSON[_0x08bf('0x80')](_0x1af704));delete _0x1af704[_0x08bf('0x32')];if(_0x54649c===0x191){_0x54649c=0x190;}_0x173cc8[_0x08bf('0x1e')](_0x54649c)['send'](_0x2a6ec4[_0x08bf('0x33')][_0x08bf('0x7d')]?{'message':_0x08bf('0x81'),'statusCode':_0x1af704['statusCode']}:_0x1af704);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 446ac18..b3b48c0 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 _0xdf7e=['util','../../config/logger','api','moment','bluebird','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','serverUrl','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com','https://accounts.zoho.com.au','/oauth/v2/token','error'];(function(_0x54e7e5,_0x2748b9){var _0x2a44c6=function(_0x249563){while(--_0x249563){_0x54e7e5['push'](_0x54e7e5['shift']());}};_0x2a44c6(++_0x2748b9);}(_0xdf7e,0x190));var _0xedf7=function(_0x1c454d,_0x540913){_0x1c454d=_0x1c454d-0x0;var _0x21850f=_0xdf7e[_0x1c454d];return _0x21850f;};'use strict';var _=require('lodash');var util=require(_0xedf7('0x0'));var logger=require(_0xedf7('0x1'))(_0xedf7('0x2'));var moment=require(_0xedf7('0x3'));var BPromise=require(_0xedf7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xedf7('0x5'));var attributes=require(_0xedf7('0x6'));var integrations=require(_0xedf7('0x7'));module['exports']=function(_0x2e73f,_0x3491d1){return _0x2e73f[_0xedf7('0x8')](_0xedf7('0x9'),attributes,{'tableName':_0xedf7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x39515b,_0xb72c6c,_0x381daf){if(_0x39515b['changed'](_0xedf7('0xb'))||_0x39515b[_0xedf7('0xc')]('serverUrl')||_0x39515b[_0xedf7('0xc')](_0xedf7('0xd'))||_0x39515b[_0xedf7('0xc')](_0xedf7('0xe'))||_0x39515b[_0xedf7('0xc')](_0xedf7('0xf'))||_0x39515b[_0xedf7('0xc')](_0xedf7('0x10'))){var _0x56fac9,_0x1e3b6b;_0x56fac9=_0x39515b['serverUrl'];var _0x3f4e20=_0x56fac9[_0xedf7('0x11')](-0x1);if(_0x3f4e20==='/'||_0x3f4e20==='\x5c'||_0x3f4e20===':'){_0x56fac9=_0x56fac9[_0xedf7('0x12')](0x0,_0x56fac9[_0xedf7('0x13')](_0x3f4e20));}switch(_0x39515b['zone']){case'US':_0x1e3b6b='https://accounts.zoho.com';break;case'AU':_0x1e3b6b='https://accounts.zoho.com.au';break;case'IN':_0x1e3b6b=_0xedf7('0x14');break;case'CN':_0x1e3b6b=_0xedf7('0x15');break;default:_0x1e3b6b='https://accounts.zoho.eu';break;}var _0x4e3e98={'method':_0xedf7('0x16'),'uri':_0x1e3b6b+'/oauth/v2/token','form':{'grant_type':_0xedf7('0x17'),'client_id':_0x39515b[_0xedf7('0xd')],'client_secret':_0x39515b[_0xedf7('0xe')],'redirect_uri':_0x39515b[_0xedf7('0x18')],'code':_0x39515b['code']},'headers':{'Content-Type':_0xedf7('0x19')}};return rp(_0x4e3e98)[_0xedf7('0x1a')](function(_0x10270f){var _0x448b64=JSON[_0xedf7('0x1b')](_0x10270f);if(_0x448b64[_0xedf7('0x1c')]){_0x39515b[_0xedf7('0x1d')]=_0x448b64[_0xedf7('0x1c')];logger['info'](util[_0xedf7('0x1e')](_0xedf7('0x1f'),_0x39515b[_0xedf7('0x20')],_0x39515b['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x39515b[_0xedf7('0x20')],_0x39515b['id']),util[_0xedf7('0x21')](_0x448b64,{'showHidden':![],'depth':null}));}return _0x381daf(null,_0xb72c6c);})[_0xedf7('0x22')](function(_0x1a62d6){logger['error'](util[_0xedf7('0x1e')](_0xedf7('0x23'),_0x39515b[_0xedf7('0x20')],_0x39515b['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x381daf(_0x1a62d6);});}else{return _0x381daf(null,_0xb72c6c);}},'beforeUpdate':function(_0x2c3fc8,_0x1bcafc,_0x3524fc){if(_0x2c3fc8[_0xedf7('0xc')](_0xedf7('0xb'))||_0x2c3fc8[_0xedf7('0xc')](_0xedf7('0x18'))||_0x2c3fc8['changed'](_0xedf7('0xd'))||_0x2c3fc8[_0xedf7('0xc')]('clientSecret')||_0x2c3fc8[_0xedf7('0xc')](_0xedf7('0xf'))||_0x2c3fc8['changed'](_0xedf7('0x10'))){var _0x1aeabc,_0x570f3f;_0x1aeabc=_0x2c3fc8[_0xedf7('0x18')];var _0x568af4=_0x1aeabc['slice'](-0x1);if(_0x568af4==='/'||_0x568af4==='\x5c'||_0x568af4===':'){_0x1aeabc=_0x1aeabc['substring'](0x0,_0x1aeabc[_0xedf7('0x13')](_0x568af4));}switch(_0x2c3fc8[_0xedf7('0xb')]){case'US':_0x570f3f=_0xedf7('0x24');break;case'AU':_0x570f3f=_0xedf7('0x25');break;case'IN':_0x570f3f='https://accounts.zoho.in';break;case'CN':_0x570f3f=_0xedf7('0x15');break;default:_0x570f3f='https://accounts.zoho.eu';break;}var _0x59ae1f={'method':_0xedf7('0x16'),'uri':_0x570f3f+_0xedf7('0x26'),'form':{'grant_type':'authorization_code','client_id':_0x2c3fc8[_0xedf7('0xd')],'client_secret':_0x2c3fc8[_0xedf7('0xe')],'redirect_uri':_0x2c3fc8[_0xedf7('0x18')],'code':_0x2c3fc8['code']},'headers':{'Content-Type':_0xedf7('0x19')}};return rp(_0x59ae1f)[_0xedf7('0x1a')](function(_0x139f7e){var _0x30a0ca=JSON[_0xedf7('0x1b')](_0x139f7e);if(_0x30a0ca[_0xedf7('0x1c')]){_0x2c3fc8[_0xedf7('0x1d')]=_0x30a0ca[_0xedf7('0x1c')];logger['info'](util[_0xedf7('0x1e')](_0xedf7('0x1f'),_0x2c3fc8[_0xedf7('0x20')],_0x2c3fc8['id']));}else{logger[_0xedf7('0x27')](util[_0xedf7('0x1e')](_0xedf7('0x23'),_0x2c3fc8[_0xedf7('0x20')],_0x2c3fc8['id']),util[_0xedf7('0x21')](_0x30a0ca,{'showHidden':![],'depth':null}));}return _0x3524fc(null,_0x1bcafc);})[_0xedf7('0x22')](function(_0x4caca5){logger['error'](util[_0xedf7('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c3fc8['name'],_0x2c3fc8['id']),util[_0xedf7('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x3524fc(_0x4caca5);});}else{return _0x3524fc(null,_0x1bcafc);}}}});}; \ No newline at end of file +var _0x3d58=['api','moment','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','then','parse','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','application/x-www-form-urlencoded','lodash','../../config/logger'];(function(_0x2a3c0a,_0x163f5c){var _0x1703a2=function(_0x471dfe){while(--_0x471dfe){_0x2a3c0a['push'](_0x2a3c0a['shift']());}};_0x1703a2(++_0x163f5c);}(_0x3d58,0x181));var _0x83d5=function(_0x82a938,_0x5a8186){_0x82a938=_0x82a938-0x0;var _0x29e7a8=_0x3d58[_0x82a938];return _0x29e7a8;};'use strict';var _=require(_0x83d5('0x0'));var util=require('util');var logger=require(_0x83d5('0x1'))(_0x83d5('0x2'));var moment=require(_0x83d5('0x3'));var BPromise=require('bluebird');var rp=require(_0x83d5('0x4'));var fs=require('fs');var path=require(_0x83d5('0x5'));var rimraf=require(_0x83d5('0x6'));var config=require('../../config/environment');var attributes=require(_0x83d5('0x7'));var integrations=require(_0x83d5('0x8'));module['exports']=function(_0x85a000,_0x221b9f){return _0x85a000[_0x83d5('0x9')](_0x83d5('0xa'),attributes,{'tableName':_0x83d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x51c62a,_0xf7600c,_0x464d0c){if(_0x51c62a[_0x83d5('0xc')](_0x83d5('0xd'))||_0x51c62a[_0x83d5('0xc')](_0x83d5('0xe'))||_0x51c62a[_0x83d5('0xc')](_0x83d5('0xf'))||_0x51c62a[_0x83d5('0xc')](_0x83d5('0x10'))||_0x51c62a[_0x83d5('0xc')](_0x83d5('0x11'))||_0x51c62a['changed'](_0x83d5('0x12'))){var _0x5d6079,_0x43033;_0x5d6079=_0x51c62a[_0x83d5('0xe')];var _0x4c4815=_0x5d6079[_0x83d5('0x13')](-0x1);if(_0x4c4815==='/'||_0x4c4815==='\x5c'||_0x4c4815===':'){_0x5d6079=_0x5d6079[_0x83d5('0x14')](0x0,_0x5d6079[_0x83d5('0x15')](_0x4c4815));}switch(_0x51c62a[_0x83d5('0xd')]){case'US':_0x43033=_0x83d5('0x16');break;case'AU':_0x43033=_0x83d5('0x17');break;case'IN':_0x43033=_0x83d5('0x18');break;case'CN':_0x43033=_0x83d5('0x19');break;default:_0x43033=_0x83d5('0x1a');break;}var _0x42cddb={'method':_0x83d5('0x1b'),'uri':_0x43033+_0x83d5('0x1c'),'form':{'grant_type':_0x83d5('0x1d'),'client_id':_0x51c62a[_0x83d5('0xf')],'client_secret':_0x51c62a[_0x83d5('0x10')],'redirect_uri':_0x51c62a[_0x83d5('0xe')],'code':_0x51c62a[_0x83d5('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x42cddb)[_0x83d5('0x1e')](function(_0x101364){var _0x2c6251=JSON[_0x83d5('0x1f')](_0x101364);if(_0x2c6251[_0x83d5('0x20')]){_0x51c62a[_0x83d5('0x21')]=_0x2c6251[_0x83d5('0x20')];logger[_0x83d5('0x22')](util['format'](_0x83d5('0x23'),_0x51c62a[_0x83d5('0x24')],_0x51c62a['id']));}else{logger[_0x83d5('0x25')](util[_0x83d5('0x26')](_0x83d5('0x27'),_0x51c62a[_0x83d5('0x24')],_0x51c62a['id']),util[_0x83d5('0x28')](_0x2c6251,{'showHidden':![],'depth':null}));}return _0x464d0c(null,_0xf7600c);})[_0x83d5('0x29')](function(_0x2e4a70){logger[_0x83d5('0x25')](util['format'](_0x83d5('0x27'),_0x51c62a[_0x83d5('0x24')],_0x51c62a['id']),util[_0x83d5('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x464d0c(_0x2e4a70);});}else{return _0x464d0c(null,_0xf7600c);}},'beforeUpdate':function(_0x2ab57b,_0x477f00,_0x1c7345){if(_0x2ab57b[_0x83d5('0xc')]('zone')||_0x2ab57b[_0x83d5('0xc')](_0x83d5('0xe'))||_0x2ab57b[_0x83d5('0xc')](_0x83d5('0xf'))||_0x2ab57b['changed']('clientSecret')||_0x2ab57b[_0x83d5('0xc')](_0x83d5('0x11'))||_0x2ab57b[_0x83d5('0xc')](_0x83d5('0x12'))){var _0x2c44e8,_0x5cb534;_0x2c44e8=_0x2ab57b[_0x83d5('0xe')];var _0x45ac85=_0x2c44e8['slice'](-0x1);if(_0x45ac85==='/'||_0x45ac85==='\x5c'||_0x45ac85===':'){_0x2c44e8=_0x2c44e8[_0x83d5('0x14')](0x0,_0x2c44e8[_0x83d5('0x15')](_0x45ac85));}switch(_0x2ab57b[_0x83d5('0xd')]){case'US':_0x5cb534=_0x83d5('0x16');break;case'AU':_0x5cb534='https://accounts.zoho.com.au';break;case'IN':_0x5cb534=_0x83d5('0x18');break;case'CN':_0x5cb534=_0x83d5('0x19');break;default:_0x5cb534=_0x83d5('0x1a');break;}var _0x1877d8={'method':_0x83d5('0x1b'),'uri':_0x5cb534+_0x83d5('0x1c'),'form':{'grant_type':_0x83d5('0x1d'),'client_id':_0x2ab57b[_0x83d5('0xf')],'client_secret':_0x2ab57b[_0x83d5('0x10')],'redirect_uri':_0x2ab57b[_0x83d5('0xe')],'code':_0x2ab57b['code']},'headers':{'Content-Type':_0x83d5('0x2a')}};return rp(_0x1877d8)[_0x83d5('0x1e')](function(_0x532f5b){var _0x14b046=JSON[_0x83d5('0x1f')](_0x532f5b);if(_0x14b046[_0x83d5('0x20')]){_0x2ab57b[_0x83d5('0x21')]=_0x14b046[_0x83d5('0x20')];logger['info'](util[_0x83d5('0x26')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ab57b['name'],_0x2ab57b['id']));}else{logger[_0x83d5('0x25')](util[_0x83d5('0x26')](_0x83d5('0x27'),_0x2ab57b['name'],_0x2ab57b['id']),util[_0x83d5('0x28')](_0x14b046,{'showHidden':![],'depth':null}));}return _0x1c7345(null,_0x477f00);})[_0x83d5('0x29')](function(_0x85e2bd){logger[_0x83d5('0x25')](util[_0x83d5('0x26')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ab57b[_0x83d5('0x24')],_0x2ab57b['id']),util[_0x83d5('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x1c7345(_0x85e2bd);});}else{return _0x1c7345(null,_0x477f00);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 953d9f4..991a84e 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 _0xa486=['ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','findAll','options','where','attributes','include','model','GetZohoAccount','ZohoAccount','find','raw','map','ShowZohoAccount','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoAccount,\x20%s,\x20%s','debug'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xa486,0x17d));var _0x6a48=function(_0x3b8d1c,_0x3392f4){_0x3b8d1c=_0x3b8d1c-0x0;var _0x4dcfc5=_0xa486[_0x3b8d1c];return _0x4dcfc5;};'use strict';var _=require(_0x6a48('0x0'));var util=require('util');var moment=require(_0x6a48('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a48('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a48('0x3'))['db'];var utils=require(_0x6a48('0x4'));var logger=require(_0x6a48('0x5'))(_0x6a48('0x6'));var config=require(_0x6a48('0x7'));var jayson=require(_0x6a48('0x8'));var client=jayson[_0x6a48('0x9')][_0x6a48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x124af7,_0x121665,_0x422497){return new BPromise(function(_0x3b751d,_0x40a8f2){return client[_0x6a48('0xb')](_0x124af7,_0x422497)[_0x6a48('0xc')](function(_0xbd313a){logger['info'](_0x6a48('0xd'),_0x121665,'request\x20sent');logger[_0x6a48('0xe')](_0x6a48('0xf'),_0x121665,_0x6a48('0x10'),JSON[_0x6a48('0x11')](_0xbd313a));if(_0xbd313a[_0x6a48('0x12')]){if(_0xbd313a[_0x6a48('0x12')][_0x6a48('0x13')]===0x1f4){logger[_0x6a48('0x12')](_0x6a48('0xd'),_0x121665,_0xbd313a[_0x6a48('0x12')][_0x6a48('0x14')]);return _0x40a8f2(_0xbd313a[_0x6a48('0x12')][_0x6a48('0x14')]);}logger[_0x6a48('0x12')](_0x6a48('0xd'),_0x121665,_0xbd313a[_0x6a48('0x12')][_0x6a48('0x14')]);return _0x3b751d(_0xbd313a[_0x6a48('0x12')][_0x6a48('0x14')]);}else{logger[_0x6a48('0x15')](_0x6a48('0xd'),_0x121665,_0x6a48('0x10'));_0x3b751d(_0xbd313a[_0x6a48('0x16')][_0x6a48('0x14')]);}})[_0x6a48('0x17')](function(_0x2ca540){logger[_0x6a48('0x12')](_0x6a48('0xd'),_0x121665,_0x2ca540);_0x40a8f2(_0x2ca540);});});}exports['GetZohoAccount']=function(_0xab0913){var _0x23a1fe=this;return new Promise(function(_0x152280,_0x1290e1){return db['ZohoAccount'][_0x6a48('0x18')]({'raw':_0xab0913[_0x6a48('0x19')]?_0xab0913[_0x6a48('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xab0913[_0x6a48('0x19')]?_0xab0913[_0x6a48('0x19')][_0x6a48('0x1a')]||null:null,'attributes':_0xab0913['options']?_0xab0913[_0x6a48('0x19')][_0x6a48('0x1b')]||null:null,'limit':_0xab0913[_0x6a48('0x19')]?_0xab0913[_0x6a48('0x19')]['limit']||null:null,'include':_0xab0913[_0x6a48('0x19')]?_0xab0913[_0x6a48('0x19')]['include']?_['map'](_0xab0913[_0x6a48('0x19')][_0x6a48('0x1c')],function(_0x4cb5d0){return{'model':db[_0x4cb5d0[_0x6a48('0x1d')]],'as':_0x4cb5d0['as'],'attributes':_0x4cb5d0['attributes'],'include':_0x4cb5d0['include']?_['map'](_0x4cb5d0['include'],function(_0x2a14d5){return{'model':db[_0x2a14d5['model']],'as':_0x2a14d5['as'],'attributes':_0x2a14d5[_0x6a48('0x1b')],'include':_0x2a14d5['include']?_['map'](_0x2a14d5['include'],function(_0x5d62a6){return{'model':db[_0x5d62a6[_0x6a48('0x1d')]],'as':_0x5d62a6['as'],'attributes':_0x5d62a6[_0x6a48('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6a48('0xc')](function(_0x20ecb0){logger['info'](_0x6a48('0x1e'),_0xab0913);logger[_0x6a48('0xe')](_0x6a48('0x1e'),_0xab0913,JSON[_0x6a48('0x11')](_0x20ecb0));_0x152280(_0x20ecb0);})['catch'](function(_0x57522a){logger[_0x6a48('0x12')](_0x6a48('0x1e'),_0x57522a[_0x6a48('0x14')],_0xab0913);_0x1290e1(_0x23a1fe[_0x6a48('0x12')](0x1f4,_0x57522a[_0x6a48('0x14')]));});});};exports['ShowZohoAccount']=function(_0x16982f){var _0x5c8e3e=this;return new Promise(function(_0x50e0e8,_0x12ba71){return db[_0x6a48('0x1f')][_0x6a48('0x20')]({'raw':_0x16982f[_0x6a48('0x19')]?_0x16982f[_0x6a48('0x19')][_0x6a48('0x21')]===undefined?!![]:![]:!![],'where':_0x16982f[_0x6a48('0x19')]?_0x16982f[_0x6a48('0x19')][_0x6a48('0x1a')]||null:null,'attributes':_0x16982f[_0x6a48('0x19')]?_0x16982f[_0x6a48('0x19')][_0x6a48('0x1b')]||null:null,'include':_0x16982f['options']?_0x16982f[_0x6a48('0x19')][_0x6a48('0x1c')]?_[_0x6a48('0x22')](_0x16982f['options'][_0x6a48('0x1c')],function(_0x4a52a3){return{'model':db[_0x4a52a3[_0x6a48('0x1d')]],'as':_0x4a52a3['as'],'attributes':_0x4a52a3['attributes'],'include':_0x4a52a3[_0x6a48('0x1c')]?_[_0x6a48('0x22')](_0x4a52a3[_0x6a48('0x1c')],function(_0x483428){return{'model':db[_0x483428[_0x6a48('0x1d')]],'as':_0x483428['as'],'attributes':_0x483428[_0x6a48('0x1b')],'include':_0x483428['include']?_['map'](_0x483428[_0x6a48('0x1c')],function(_0x463476){return{'model':db[_0x463476[_0x6a48('0x1d')]],'as':_0x463476['as'],'attributes':_0x463476[_0x6a48('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6a48('0xc')](function(_0x174a44){logger[_0x6a48('0x15')](_0x6a48('0x23'),_0x16982f);logger['debug'](_0x6a48('0x23'),_0x16982f,JSON[_0x6a48('0x11')](_0x174a44));_0x50e0e8(_0x174a44);})[_0x6a48('0x17')](function(_0x2b236b){logger[_0x6a48('0x12')](_0x6a48('0x23'),_0x2b236b[_0x6a48('0x14')],_0x16982f);_0x12ba71(_0x5c8e3e[_0x6a48('0x12')](0x1f4,_0x2b236b[_0x6a48('0x14')]));});});}; \ No newline at end of file +var _0xb90a=['limit','include','map','model','attributes','debug','find','ShowZohoAccount','lodash','util','bluebird','rpc','../../config/environment','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZohoAccount','ZohoAccount','options','raw','where'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb90a,0x12a));var _0xab90=function(_0x40a270,_0x5cc8b5){_0x40a270=_0x40a270-0x0;var _0x2b42e4=_0xb90a[_0x40a270];return _0x2b42e4;};'use strict';var _=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var moment=require('moment');var BPromise=require(_0xab90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xab90('0x3'));var config=require(_0xab90('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab90('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x426588,_0x275bf7,_0x4b28a6){return new BPromise(function(_0x2406e1,_0xc5ca04){return client[_0xab90('0x6')](_0x426588,_0x4b28a6)[_0xab90('0x7')](function(_0x93af2f){logger[_0xab90('0x8')](_0xab90('0x9'),_0x275bf7,_0xab90('0xa'));logger['debug'](_0xab90('0xb'),_0x275bf7,_0xab90('0xa'),JSON[_0xab90('0xc')](_0x93af2f));if(_0x93af2f[_0xab90('0xd')]){if(_0x93af2f[_0xab90('0xd')]['code']===0x1f4){logger[_0xab90('0xd')](_0xab90('0x9'),_0x275bf7,_0x93af2f[_0xab90('0xd')][_0xab90('0xe')]);return _0xc5ca04(_0x93af2f[_0xab90('0xd')][_0xab90('0xe')]);}logger[_0xab90('0xd')](_0xab90('0x9'),_0x275bf7,_0x93af2f[_0xab90('0xd')][_0xab90('0xe')]);return _0x2406e1(_0x93af2f[_0xab90('0xd')][_0xab90('0xe')]);}else{logger[_0xab90('0x8')]('ZohoAccount,\x20%s,\x20%s',_0x275bf7,_0xab90('0xa'));_0x2406e1(_0x93af2f['result'][_0xab90('0xe')]);}})[_0xab90('0xf')](function(_0x526bee){logger[_0xab90('0xd')](_0xab90('0x9'),_0x275bf7,_0x526bee);_0xc5ca04(_0x526bee);});});}exports[_0xab90('0x10')]=function(_0x58cc79){var _0x2ab85c=this;return new Promise(function(_0x18323a,_0x1d5222){return db[_0xab90('0x11')]['findAll']({'raw':_0x58cc79[_0xab90('0x12')]?_0x58cc79['options'][_0xab90('0x13')]===undefined?!![]:![]:!![],'where':_0x58cc79['options']?_0x58cc79[_0xab90('0x12')][_0xab90('0x14')]||null:null,'attributes':_0x58cc79[_0xab90('0x12')]?_0x58cc79[_0xab90('0x12')]['attributes']||null:null,'limit':_0x58cc79[_0xab90('0x12')]?_0x58cc79[_0xab90('0x12')][_0xab90('0x15')]||null:null,'include':_0x58cc79[_0xab90('0x12')]?_0x58cc79[_0xab90('0x12')][_0xab90('0x16')]?_[_0xab90('0x17')](_0x58cc79[_0xab90('0x12')][_0xab90('0x16')],function(_0x2cdc7f){return{'model':db[_0x2cdc7f[_0xab90('0x18')]],'as':_0x2cdc7f['as'],'attributes':_0x2cdc7f[_0xab90('0x19')],'include':_0x2cdc7f[_0xab90('0x16')]?_[_0xab90('0x17')](_0x2cdc7f['include'],function(_0x7e141c){return{'model':db[_0x7e141c[_0xab90('0x18')]],'as':_0x7e141c['as'],'attributes':_0x7e141c[_0xab90('0x19')],'include':_0x7e141c[_0xab90('0x16')]?_[_0xab90('0x17')](_0x7e141c[_0xab90('0x16')],function(_0x2cad38){return{'model':db[_0x2cad38[_0xab90('0x18')]],'as':_0x2cad38['as'],'attributes':_0x2cad38[_0xab90('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38b3ae){logger[_0xab90('0x8')]('GetZohoAccount',_0x58cc79);logger[_0xab90('0x1a')](_0xab90('0x10'),_0x58cc79,JSON[_0xab90('0xc')](_0x38b3ae));_0x18323a(_0x38b3ae);})[_0xab90('0xf')](function(_0x24e562){logger[_0xab90('0xd')](_0xab90('0x10'),_0x24e562[_0xab90('0xe')],_0x58cc79);_0x1d5222(_0x2ab85c[_0xab90('0xd')](0x1f4,_0x24e562[_0xab90('0xe')]));});});};exports['ShowZohoAccount']=function(_0x59ed30){var _0x5671c2=this;return new Promise(function(_0x215c4b,_0x5f1359){return db[_0xab90('0x11')][_0xab90('0x1b')]({'raw':_0x59ed30[_0xab90('0x12')]?_0x59ed30[_0xab90('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x59ed30[_0xab90('0x12')]?_0x59ed30[_0xab90('0x12')][_0xab90('0x14')]||null:null,'attributes':_0x59ed30['options']?_0x59ed30['options'][_0xab90('0x19')]||null:null,'include':_0x59ed30[_0xab90('0x12')]?_0x59ed30[_0xab90('0x12')][_0xab90('0x16')]?_[_0xab90('0x17')](_0x59ed30[_0xab90('0x12')][_0xab90('0x16')],function(_0x1523bf){return{'model':db[_0x1523bf[_0xab90('0x18')]],'as':_0x1523bf['as'],'attributes':_0x1523bf[_0xab90('0x19')],'include':_0x1523bf[_0xab90('0x16')]?_['map'](_0x1523bf[_0xab90('0x16')],function(_0x1eb4d0){return{'model':db[_0x1eb4d0[_0xab90('0x18')]],'as':_0x1eb4d0['as'],'attributes':_0x1eb4d0[_0xab90('0x19')],'include':_0x1eb4d0[_0xab90('0x16')]?_['map'](_0x1eb4d0[_0xab90('0x16')],function(_0x30cea9){return{'model':db[_0x30cea9[_0xab90('0x18')]],'as':_0x30cea9['as'],'attributes':_0x30cea9['attributes']};}):[]};}):[]};}):[]:[]})[_0xab90('0x7')](function(_0x127d21){logger[_0xab90('0x8')](_0xab90('0x1c'),_0x59ed30);logger[_0xab90('0x1a')](_0xab90('0x1c'),_0x59ed30,JSON['stringify'](_0x127d21));_0x215c4b(_0x127d21);})[_0xab90('0xf')](function(_0x47e71b){logger[_0xab90('0xd')](_0xab90('0x1c'),_0x47e71b['message'],_0x59ed30);_0x5f1359(_0x5671c2[_0xab90('0xd')](0x1f4,_0x47e71b['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 90a97c1..71b2335 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 _0x9e02=['./intZohoConfiguration.controller','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','isAuthenticated','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x9e02,0x1ae));var _0x29e0=function(_0x35dcbc,_0x4834e9){_0x35dcbc=_0x35dcbc-0x0;var _0x3bfd51=_0x9e02[_0x35dcbc];return _0x3bfd51;};'use strict';var multer=require(_0x29e0('0x0'));var util=require('util');var path=require(_0x29e0('0x1'));var timeout=require(_0x29e0('0x2'));var express=require(_0x29e0('0x3'));var router=express['Router']();var fs_extra=require(_0x29e0('0x4'));var auth=require(_0x29e0('0x5'));var interaction=require(_0x29e0('0x6'));var config=require('../../config/environment');var controller=require(_0x29e0('0x7'));router[_0x29e0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x29e0('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x29e0('0x9')]);router[_0x29e0('0x8')](_0x29e0('0xa'),auth['isAuthenticated'](),controller[_0x29e0('0xb')]);router[_0x29e0('0x8')](_0x29e0('0xc'),auth['isAuthenticated'](),controller[_0x29e0('0xd')]);router[_0x29e0('0x8')]('/:id/descriptions',auth[_0x29e0('0xe')](),controller[_0x29e0('0xf')]);router[_0x29e0('0x10')]('/',auth['isAuthenticated'](),controller[_0x29e0('0x11')]);router[_0x29e0('0x12')](_0x29e0('0x13'),auth[_0x29e0('0xe')](),controller[_0x29e0('0x14')]);router[_0x29e0('0x15')]('/:id',auth[_0x29e0('0xe')](),controller[_0x29e0('0x16')]);module['exports']=router; \ No newline at end of file +var _0x1825=['isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','get','/:id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1825,0x107));var _0x5182=function(_0x39f24c,_0x592966){_0x39f24c=_0x39f24c-0x0;var _0x245f49=_0x1825[_0x39f24c];return _0x245f49;};'use strict';var multer=require(_0x5182('0x0'));var util=require(_0x5182('0x1'));var path=require(_0x5182('0x2'));var timeout=require(_0x5182('0x3'));var express=require(_0x5182('0x4'));var router=express[_0x5182('0x5')]();var fs_extra=require(_0x5182('0x6'));var auth=require(_0x5182('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5182('0x8'));var controller=require(_0x5182('0x9'));router[_0x5182('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5182('0xb'),auth[_0x5182('0xc')](),controller[_0x5182('0xd')]);router[_0x5182('0xa')](_0x5182('0xe'),auth[_0x5182('0xc')](),controller['getFields']);router[_0x5182('0xa')](_0x5182('0xf'),auth['isAuthenticated'](),controller[_0x5182('0x10')]);router[_0x5182('0xa')]('/:id/descriptions',auth[_0x5182('0xc')](),controller[_0x5182('0x11')]);router[_0x5182('0x12')]('/',auth['isAuthenticated'](),controller[_0x5182('0x13')]);router[_0x5182('0x14')]('/:id',auth[_0x5182('0xc')](),controller[_0x5182('0x15')]);router[_0x5182('0x16')]('/:id',auth[_0x5182('0xc')](),controller[_0x5182('0x17')]);module[_0x5182('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 62bedfc..cce84e2 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 _0xd54a=['nothing','lead','contact_lead','sequelize','STRING','ENUM','contact'];(function(_0x592ae5,_0x20524b){var _0x20b7be=function(_0x3628ba){while(--_0x3628ba){_0x592ae5['push'](_0x592ae5['shift']());}};_0x20b7be(++_0x20524b);}(_0xd54a,0x1df));var _0xad54=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd54a[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xad54('0x0'));module['exports']={'name':{'type':Sequelize[_0xad54('0x1')]},'moduleCreate':{'type':Sequelize[_0xad54('0x2')]('lead',_0xad54('0x3'),_0xad54('0x4')),'defaultValue':_0xad54('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0xad54('0x6'),_0xad54('0x3'),_0xad54('0x5')),'defaultValue':_0xad54('0x6')},'description':{'type':Sequelize[_0xad54('0x1')]}}; \ No newline at end of file +var _0x3ef6=['lead','ENUM','contact_lead','contact','sequelize','STRING'];(function(_0x473198,_0x48cb9c){var _0x5590a7=function(_0x5731ad){while(--_0x5731ad){_0x473198['push'](_0x473198['shift']());}};_0x5590a7(++_0x48cb9c);}(_0x3ef6,0xd6));var _0x63ef=function(_0xf6763d,_0x1ee231){_0xf6763d=_0xf6763d-0x0;var _0x212ae2=_0x3ef6[_0xf6763d];return _0x212ae2;};'use strict';var Sequelize=require(_0x63ef('0x0'));module['exports']={'name':{'type':Sequelize[_0x63ef('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x63ef('0x2'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x63ef('0x3')](_0x63ef('0x4'),_0x63ef('0x5'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x63ef('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index dd7284f..f148e46 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 _0x52ff=['zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','ZohoConfiguration','include','findAll','show','includeAll','catch','create','body','find','params','getFields','findOne','ZohoField','filters','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf'];(function(_0x59e7ac,_0x89d52e){var _0x2e2024=function(_0x13245f){while(--_0x13245f){_0x59e7ac['push'](_0x59e7ac['shift']());}};_0x2e2024(++_0x89d52e);}(_0x52ff,0x9c));var _0xf52f=function(_0x2e319e,_0x99e002){_0x2e319e=_0x2e319e-0x0;var _0x3a5306=_0x52ff[_0x2e319e];return _0x3a5306;};'use strict';var emlformat=require(_0xf52f('0x0'));var rimraf=require(_0xf52f('0x1'));var zipdir=require(_0xf52f('0x2'));var jsonpatch=require(_0xf52f('0x3'));var rp=require('request-promise');var moment=require(_0xf52f('0x4'));var BPromise=require(_0xf52f('0x5'));var Mustache=require(_0xf52f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf52f('0x7'));var csv=require(_0xf52f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf52f('0x9'));var _=require(_0xf52f('0xa'));var squel=require(_0xf52f('0xb'));var crypto=require(_0xf52f('0xc'));var jsforce=require(_0xf52f('0xd'));var deskjs=require(_0xf52f('0xe'));var toCsv=require(_0xf52f('0x8'));var querystring=require(_0xf52f('0xf'));var Papa=require(_0xf52f('0x10'));var Redis=require(_0xf52f('0x11'));var authService=require(_0xf52f('0x12'));var qs=require(_0xf52f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf52f('0x14'));var utils=require(_0xf52f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf52f('0x16'));var db=require(_0xf52f('0x17'))['db'];function respondWithStatusCode(_0x2c1469,_0x4a839f){_0x4a839f=_0x4a839f||0xcc;return function(_0x4aff4e){if(_0x4aff4e){return _0x2c1469[_0xf52f('0x18')](_0x4a839f);}return _0x2c1469[_0xf52f('0x19')](_0x4a839f)[_0xf52f('0x1a')]();};}function respondWithResult(_0x4f0a78,_0x27d926){_0x27d926=_0x27d926||0xc8;return function(_0xaa6b25){if(_0xaa6b25){return _0x4f0a78['status'](_0x27d926)[_0xf52f('0x1b')](_0xaa6b25);}};}function respondWithFilteredResult(_0x5548fe,_0x569cab){return function(_0x5f3420){if(_0x5f3420){var _0x110288=typeof _0x569cab['offset']===_0xf52f('0x1c')&&typeof _0x569cab['limit']===_0xf52f('0x1c');var _0x1b5ba5=_0x5f3420[_0xf52f('0x1d')];var _0x10a935=_0x110288?0x0:_0x569cab[_0xf52f('0x1e')];var _0x766d1d=_0x110288?_0x5f3420['count']:_0x569cab['offset']+_0x569cab['limit'];var _0x354be1;if(_0x766d1d>=_0x1b5ba5){_0x766d1d=_0x1b5ba5;_0x354be1=0xc8;}else{_0x354be1=0xce;}_0x5548fe[_0xf52f('0x19')](_0x354be1);return _0x5548fe[_0xf52f('0x1f')](_0xf52f('0x20'),_0x10a935+'-'+_0x766d1d+'/'+_0x1b5ba5)[_0xf52f('0x1b')](_0x5f3420);}return null;};}function patchUpdates(_0x1dc918){return function(_0x1b224f){try{jsonpatch['apply'](_0x1b224f,_0x1dc918,!![]);}catch(_0x2331d2){return BPromise[_0xf52f('0x21')](_0x2331d2);}return _0x1b224f[_0xf52f('0x22')]();};}function saveUpdates(_0x8c6fc3,_0x22ff0d){return function(_0x47fb1c){if(_0x47fb1c){return _0x47fb1c[_0xf52f('0x23')](_0x8c6fc3)[_0xf52f('0x24')](function(_0x1869b3){return _0x1869b3;});}return null;};}function removeEntity(_0x5cbb3c,_0x215b22){return function(_0x3614ef){if(_0x3614ef){return _0x3614ef[_0xf52f('0x25')]()[_0xf52f('0x24')](function(){_0x5cbb3c[_0xf52f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b62d4,_0x371462){return function(_0x15d912){if(!_0x15d912){_0x1b62d4[_0xf52f('0x18')](0x194);}return _0x15d912;};}function handleError(_0x522073,_0x4dc1b8){_0x4dc1b8=_0x4dc1b8||0x1f4;return function(_0x50b924){logger[_0xf52f('0x26')](_0x50b924[_0xf52f('0x27')]);if(_0x50b924[_0xf52f('0x28')]){delete _0x50b924[_0xf52f('0x28')];}_0x522073['status'](_0x4dc1b8)['send'](_0x50b924);};}exports[_0xf52f('0x29')]=function(_0x2e7a44,_0x2a410b){var _0x5af102={},_0x50cb34={},_0x2c60c0={'count':0x0,'rows':[]};var _0xb8c36d=_[_0xf52f('0x2a')](db['ZohoConfiguration'][_0xf52f('0x2b')],function(_0x459451){return{'name':_0x459451[_0xf52f('0x2c')],'type':_0x459451['type']['key']};});_0x50cb34[_0xf52f('0x2d')]=_[_0xf52f('0x2a')](_0xb8c36d,_0xf52f('0x28'));_0x50cb34[_0xf52f('0x2e')]=_[_0xf52f('0x2f')](_0x2e7a44['query']);_0x50cb34['filters']=_[_0xf52f('0x30')](_0x50cb34[_0xf52f('0x2d')],_0x50cb34['query']);_0x5af102[_0xf52f('0x31')]=_[_0xf52f('0x30')](_0x50cb34['model'],qs[_0xf52f('0x32')](_0x2e7a44[_0xf52f('0x2e')][_0xf52f('0x32')]));_0x5af102[_0xf52f('0x31')]=_0x5af102['attributes'][_0xf52f('0x33')]?_0x5af102['attributes']:_0x50cb34[_0xf52f('0x2d')];if(!_0x2e7a44['query']['hasOwnProperty'](_0xf52f('0x34'))){_0x5af102[_0xf52f('0x35')]=qs[_0xf52f('0x35')](_0x2e7a44[_0xf52f('0x2e')]['limit']);_0x5af102[_0xf52f('0x1e')]=qs['offset'](_0x2e7a44['query'][_0xf52f('0x1e')]);}_0x5af102[_0xf52f('0x36')]=qs['sort'](_0x2e7a44['query'][_0xf52f('0x37')]);_0x5af102[_0xf52f('0x38')]=qs['filters'](_[_0xf52f('0x39')](_0x2e7a44[_0xf52f('0x2e')],_0x50cb34['filters']),_0xb8c36d);if(_0x2e7a44[_0xf52f('0x2e')][_0xf52f('0x3a')]){_0x5af102['where']=_['merge'](_0x5af102[_0xf52f('0x38')],{'$or':_[_0xf52f('0x2a')](_0xb8c36d,function(_0x398f8e){if(_0x398f8e['type']!==_0xf52f('0x3b')){var _0x4811cc={};_0x4811cc[_0x398f8e[_0xf52f('0x28')]]={'$like':'%'+_0x2e7a44[_0xf52f('0x2e')][_0xf52f('0x3a')]+'%'};return _0x4811cc;}})});}_0x5af102=_[_0xf52f('0x3c')]({},_0x5af102,_0x2e7a44[_0xf52f('0x3d')]);var _0x3f1255={'where':_0x5af102[_0xf52f('0x38')]};return db[_0xf52f('0x3e')]['count'](_0x3f1255)['then'](function(_0x3626a9){_0x2c60c0[_0xf52f('0x1d')]=_0x3626a9;if(_0x2e7a44[_0xf52f('0x2e')]['includeAll']){_0x5af102[_0xf52f('0x3f')]=[{'all':!![]}];}return db[_0xf52f('0x3e')][_0xf52f('0x40')](_0x5af102);})[_0xf52f('0x24')](function(_0x3cd794){_0x2c60c0['rows']=_0x3cd794;return _0x2c60c0;})[_0xf52f('0x24')](respondWithFilteredResult(_0x2a410b,_0x5af102))['catch'](handleError(_0x2a410b,null));};exports[_0xf52f('0x41')]=function(_0x4c4527,_0x33ff08){var _0xff7c08={'raw':![],'where':{'id':_0x4c4527['params']['id']}},_0x1d513e={};_0x1d513e[_0xf52f('0x2d')]=_[_0xf52f('0x2f')](db[_0xf52f('0x3e')]['rawAttributes']);_0x1d513e[_0xf52f('0x2e')]=_[_0xf52f('0x2f')](_0x4c4527['query']);_0x1d513e['filters']=_[_0xf52f('0x30')](_0x1d513e[_0xf52f('0x2d')],_0x1d513e[_0xf52f('0x2e')]);_0xff7c08[_0xf52f('0x31')]=_[_0xf52f('0x30')](_0x1d513e['model'],qs[_0xf52f('0x32')](_0x4c4527[_0xf52f('0x2e')][_0xf52f('0x32')]));_0xff7c08['attributes']=_0xff7c08['attributes'][_0xf52f('0x33')]?_0xff7c08['attributes']:_0x1d513e[_0xf52f('0x2d')];if(_0x4c4527[_0xf52f('0x2e')][_0xf52f('0x42')]){_0xff7c08[_0xf52f('0x3f')]=[{'all':!![]}];}_0xff7c08=_[_0xf52f('0x3c')]({},_0xff7c08,_0x4c4527[_0xf52f('0x3d')]);return db['ZohoConfiguration']['find'](_0xff7c08)[_0xf52f('0x24')](handleEntityNotFound(_0x33ff08,null))[_0xf52f('0x24')](respondWithResult(_0x33ff08,null))[_0xf52f('0x43')](handleError(_0x33ff08,null));};exports[_0xf52f('0x44')]=function(_0x4da3d2,_0x2ded8f){return db[_0xf52f('0x3e')][_0xf52f('0x44')](_0x4da3d2[_0xf52f('0x45')],{})[_0xf52f('0x24')](respondWithResult(_0x2ded8f,0xc9))['catch'](handleError(_0x2ded8f,null));};exports[_0xf52f('0x23')]=function(_0x44f4b9,_0x1bf1a5){if(_0x44f4b9[_0xf52f('0x45')]['id']){delete _0x44f4b9['body']['id'];}return db[_0xf52f('0x3e')][_0xf52f('0x46')]({'where':{'id':_0x44f4b9[_0xf52f('0x47')]['id']}})[_0xf52f('0x24')](handleEntityNotFound(_0x1bf1a5,null))[_0xf52f('0x24')](saveUpdates(_0x44f4b9[_0xf52f('0x45')],null))['then'](respondWithResult(_0x1bf1a5,null))[_0xf52f('0x43')](handleError(_0x1bf1a5,null));};exports[_0xf52f('0x25')]=function(_0x29e875,_0x13adf6){return db[_0xf52f('0x3e')][_0xf52f('0x46')]({'where':{'id':_0x29e875['params']['id']}})['then'](handleEntityNotFound(_0x13adf6,null))[_0xf52f('0x24')](removeEntity(_0x13adf6,null))[_0xf52f('0x43')](handleError(_0x13adf6,null));};exports[_0xf52f('0x48')]=function(_0x4bc7eb,_0x5b1275,_0x521641){var _0x4fdbac={};var _0x324cdf={};var _0x36b7c8;var _0x4a5bac;return db[_0xf52f('0x3e')][_0xf52f('0x49')]({'where':{'id':_0x4bc7eb[_0xf52f('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b1275,null))[_0xf52f('0x24')](function(_0x5a48e6){if(_0x5a48e6){_0x36b7c8=_0x5a48e6;_0x324cdf[_0xf52f('0x2d')]=_[_0xf52f('0x2f')](db[_0xf52f('0x4a')][_0xf52f('0x2b')]);_0x324cdf[_0xf52f('0x2e')]=_['keys'](_0x4bc7eb[_0xf52f('0x2e')]);_0x324cdf[_0xf52f('0x4b')]=_[_0xf52f('0x30')](_0x324cdf['model'],_0x324cdf[_0xf52f('0x2e')]);_0x4fdbac['attributes']=_['intersection'](_0x324cdf[_0xf52f('0x2d')],qs['fields'](_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x32')]));_0x4fdbac[_0xf52f('0x31')]=_0x4fdbac['attributes']['length']?_0x4fdbac['attributes']:_0x324cdf[_0xf52f('0x2d')];_0x4fdbac['order']=qs['sort'](_0x4bc7eb[_0xf52f('0x2e')]['sort']);_0x4fdbac[_0xf52f('0x38')]=qs[_0xf52f('0x4b')](_[_0xf52f('0x39')](_0x4bc7eb[_0xf52f('0x2e')],_0x324cdf[_0xf52f('0x4b')]));if(_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x3a')]){_0x4fdbac['where']=_[_0xf52f('0x3c')](_0x4fdbac['where'],{'$or':_['map'](_0x4fdbac[_0xf52f('0x31')],function(_0x4d854c){var _0x1acd49={};_0x1acd49[_0x4d854c]={'$like':'%'+_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x3a')]+'%'};return _0x1acd49;})});}_0x4fdbac=_[_0xf52f('0x3c')]({},_0x4fdbac,_0x4bc7eb[_0xf52f('0x3d')]);return _0x36b7c8[_0xf52f('0x48')](_0x4fdbac);}})['then'](function(_0x42be12){if(_0x42be12){_0x4a5bac=_0x42be12[_0xf52f('0x33')];if(!_0x4bc7eb[_0xf52f('0x2e')]['hasOwnProperty'](_0xf52f('0x34'))){_0x4fdbac[_0xf52f('0x35')]=qs[_0xf52f('0x35')](_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x35')]);_0x4fdbac[_0xf52f('0x1e')]=qs[_0xf52f('0x1e')](_0x4bc7eb[_0xf52f('0x2e')][_0xf52f('0x1e')]);}return _0x36b7c8[_0xf52f('0x48')](_0x4fdbac);}})['then'](function(_0x319caf){if(_0x319caf){return _0x319caf?{'count':_0x4a5bac,'rows':_0x319caf}:null;}})['then'](respondWithResult(_0x5b1275,null))[_0xf52f('0x43')](handleError(_0x5b1275,null));};exports['getSubjects']=function(_0x2b5c53,_0x506a00,_0x561a76){var _0x5431bc={};var _0xc763c9={};var _0x4d7de1;var _0x2fd9cd;return db[_0xf52f('0x3e')][_0xf52f('0x49')]({'where':{'id':_0x2b5c53[_0xf52f('0x47')]['id']}})[_0xf52f('0x24')](handleEntityNotFound(_0x506a00,null))['then'](function(_0x114c36){if(_0x114c36){_0x4d7de1=_0x114c36;_0xc763c9[_0xf52f('0x2d')]=_[_0xf52f('0x2f')](db[_0xf52f('0x4a')][_0xf52f('0x2b')]);_0xc763c9[_0xf52f('0x2e')]=_[_0xf52f('0x2f')](_0x2b5c53[_0xf52f('0x2e')]);_0xc763c9[_0xf52f('0x4b')]=_[_0xf52f('0x30')](_0xc763c9['model'],_0xc763c9[_0xf52f('0x2e')]);_0x5431bc['attributes']=_[_0xf52f('0x30')](_0xc763c9[_0xf52f('0x2d')],qs[_0xf52f('0x32')](_0x2b5c53[_0xf52f('0x2e')][_0xf52f('0x32')]));_0x5431bc[_0xf52f('0x31')]=_0x5431bc[_0xf52f('0x31')][_0xf52f('0x33')]?_0x5431bc[_0xf52f('0x31')]:_0xc763c9[_0xf52f('0x2d')];_0x5431bc['order']=qs['sort'](_0x2b5c53[_0xf52f('0x2e')][_0xf52f('0x37')]);_0x5431bc[_0xf52f('0x38')]=qs[_0xf52f('0x4b')](_[_0xf52f('0x39')](_0x2b5c53[_0xf52f('0x2e')],_0xc763c9[_0xf52f('0x4b')]));if(_0x2b5c53['query']['filter']){_0x5431bc['where']=_[_0xf52f('0x3c')](_0x5431bc[_0xf52f('0x38')],{'$or':_[_0xf52f('0x2a')](_0x5431bc['attributes'],function(_0x354917){var _0x2b49bd={};_0x2b49bd[_0x354917]={'$like':'%'+_0x2b5c53[_0xf52f('0x2e')]['filter']+'%'};return _0x2b49bd;})});}_0x5431bc=_[_0xf52f('0x3c')]({},_0x5431bc,_0x2b5c53['options']);return _0x4d7de1[_0xf52f('0x4c')](_0x5431bc);}})[_0xf52f('0x24')](function(_0x4a9847){if(_0x4a9847){_0x2fd9cd=_0x4a9847[_0xf52f('0x33')];if(!_0x2b5c53[_0xf52f('0x2e')][_0xf52f('0x4d')](_0xf52f('0x34'))){_0x5431bc[_0xf52f('0x35')]=qs[_0xf52f('0x35')](_0x2b5c53[_0xf52f('0x2e')]['limit']);_0x5431bc['offset']=qs[_0xf52f('0x1e')](_0x2b5c53[_0xf52f('0x2e')][_0xf52f('0x1e')]);}return _0x4d7de1[_0xf52f('0x4c')](_0x5431bc);}})[_0xf52f('0x24')](function(_0x1d2a2b){if(_0x1d2a2b){return _0x1d2a2b?{'count':_0x2fd9cd,'rows':_0x1d2a2b}:null;}})[_0xf52f('0x24')](respondWithResult(_0x506a00,null))[_0xf52f('0x43')](handleError(_0x506a00,null));};exports[_0xf52f('0x4e')]=function(_0x53a3e1,_0x39628f,_0x167303){var _0x37b633={};var _0x509e36={};var _0x3fa68d;var _0xe119f5;return db[_0xf52f('0x3e')]['findOne']({'where':{'id':_0x53a3e1[_0xf52f('0x47')]['id']}})[_0xf52f('0x24')](handleEntityNotFound(_0x39628f,null))[_0xf52f('0x24')](function(_0x41c69b){if(_0x41c69b){_0x3fa68d=_0x41c69b;_0x509e36['model']=_[_0xf52f('0x2f')](db['ZohoField'][_0xf52f('0x2b')]);_0x509e36[_0xf52f('0x2e')]=_[_0xf52f('0x2f')](_0x53a3e1['query']);_0x509e36['filters']=_['intersection'](_0x509e36[_0xf52f('0x2d')],_0x509e36[_0xf52f('0x2e')]);_0x37b633[_0xf52f('0x31')]=_[_0xf52f('0x30')](_0x509e36[_0xf52f('0x2d')],qs[_0xf52f('0x32')](_0x53a3e1['query']['fields']));_0x37b633['attributes']=_0x37b633[_0xf52f('0x31')][_0xf52f('0x33')]?_0x37b633[_0xf52f('0x31')]:_0x509e36['model'];_0x37b633[_0xf52f('0x36')]=qs['sort'](_0x53a3e1[_0xf52f('0x2e')][_0xf52f('0x37')]);_0x37b633[_0xf52f('0x38')]=qs[_0xf52f('0x4b')](_[_0xf52f('0x39')](_0x53a3e1[_0xf52f('0x2e')],_0x509e36[_0xf52f('0x4b')]));if(_0x53a3e1[_0xf52f('0x2e')][_0xf52f('0x3a')]){_0x37b633[_0xf52f('0x38')]=_[_0xf52f('0x3c')](_0x37b633['where'],{'$or':_[_0xf52f('0x2a')](_0x37b633[_0xf52f('0x31')],function(_0x2e1ae5){var _0x404aa8={};_0x404aa8[_0x2e1ae5]={'$like':'%'+_0x53a3e1[_0xf52f('0x2e')]['filter']+'%'};return _0x404aa8;})});}_0x37b633=_[_0xf52f('0x3c')]({},_0x37b633,_0x53a3e1[_0xf52f('0x3d')]);return _0x3fa68d['getDescriptions'](_0x37b633);}})['then'](function(_0x314878){if(_0x314878){_0xe119f5=_0x314878[_0xf52f('0x33')];if(!_0x53a3e1['query'][_0xf52f('0x4d')](_0xf52f('0x34'))){_0x37b633[_0xf52f('0x35')]=qs[_0xf52f('0x35')](_0x53a3e1[_0xf52f('0x2e')][_0xf52f('0x35')]);_0x37b633['offset']=qs[_0xf52f('0x1e')](_0x53a3e1[_0xf52f('0x2e')][_0xf52f('0x1e')]);}return _0x3fa68d['getDescriptions'](_0x37b633);}})[_0xf52f('0x24')](function(_0x3070b8){if(_0x3070b8){return _0x3070b8?{'count':_0xe119f5,'rows':_0x3070b8}:null;}})[_0xf52f('0x24')](respondWithResult(_0x39628f,null))[_0xf52f('0x43')](handleError(_0x39628f,null));}; \ No newline at end of file +var _0xfb18=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoConfiguration','includeAll','include','catch','show','params','keys','find','create','body','getFields','findOne','ZohoField','getSubjects','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xfb18,0x136));var _0x8fb1=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0xfb18[_0x5027b1];return _0x4a46cf;};'use strict';var emlformat=require(_0x8fb1('0x0'));var rimraf=require(_0x8fb1('0x1'));var zipdir=require(_0x8fb1('0x2'));var jsonpatch=require(_0x8fb1('0x3'));var rp=require(_0x8fb1('0x4'));var moment=require(_0x8fb1('0x5'));var BPromise=require(_0x8fb1('0x6'));var Mustache=require(_0x8fb1('0x7'));var util=require(_0x8fb1('0x8'));var path=require('path');var sox=require(_0x8fb1('0x9'));var csv=require(_0x8fb1('0xa'));var ejs=require(_0x8fb1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8fb1('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8fb1('0xd'));var deskjs=require(_0x8fb1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8fb1('0xf'));var Papa=require(_0x8fb1('0x10'));var Redis=require('ioredis');var authService=require(_0x8fb1('0x11'));var qs=require(_0x8fb1('0x12'));var as=require(_0x8fb1('0x13'));var hardwareService=require(_0x8fb1('0x14'));var logger=require(_0x8fb1('0x15'))(_0x8fb1('0x16'));var utils=require(_0x8fb1('0x17'));var config=require(_0x8fb1('0x18'));var licenseUtil=require(_0x8fb1('0x19'));var db=require(_0x8fb1('0x1a'))['db'];function respondWithStatusCode(_0x2658cb,_0x2d79c0){_0x2d79c0=_0x2d79c0||0xcc;return function(_0x3ffcb9){if(_0x3ffcb9){return _0x2658cb[_0x8fb1('0x1b')](_0x2d79c0);}return _0x2658cb['status'](_0x2d79c0)[_0x8fb1('0x1c')]();};}function respondWithResult(_0x153bf8,_0x523e2f){_0x523e2f=_0x523e2f||0xc8;return function(_0x5748b4){if(_0x5748b4){return _0x153bf8[_0x8fb1('0x1d')](_0x523e2f)[_0x8fb1('0x1e')](_0x5748b4);}};}function respondWithFilteredResult(_0x154813,_0x82403c){return function(_0x2d0211){if(_0x2d0211){var _0x387acc=typeof _0x82403c['offset']==='undefined'&&typeof _0x82403c[_0x8fb1('0x1f')]===_0x8fb1('0x20');var _0x216db9=_0x2d0211[_0x8fb1('0x21')];var _0x1904f7=_0x387acc?0x0:_0x82403c[_0x8fb1('0x22')];var _0x3ee1af=_0x387acc?_0x2d0211[_0x8fb1('0x21')]:_0x82403c[_0x8fb1('0x22')]+_0x82403c[_0x8fb1('0x1f')];var _0x4be26c;if(_0x3ee1af>=_0x216db9){_0x3ee1af=_0x216db9;_0x4be26c=0xc8;}else{_0x4be26c=0xce;}_0x154813['status'](_0x4be26c);return _0x154813['set'](_0x8fb1('0x23'),_0x1904f7+'-'+_0x3ee1af+'/'+_0x216db9)[_0x8fb1('0x1e')](_0x2d0211);}return null;};}function patchUpdates(_0x3fdcce){return function(_0x113104){try{jsonpatch[_0x8fb1('0x24')](_0x113104,_0x3fdcce,!![]);}catch(_0x46747f){return BPromise[_0x8fb1('0x25')](_0x46747f);}return _0x113104[_0x8fb1('0x26')]();};}function saveUpdates(_0x245f2,_0xf505a5){return function(_0x1c8f34){if(_0x1c8f34){return _0x1c8f34[_0x8fb1('0x27')](_0x245f2)[_0x8fb1('0x28')](function(_0x98bd3e){return _0x98bd3e;});}return null;};}function removeEntity(_0x146e60,_0x9da24e){return function(_0x1987c5){if(_0x1987c5){return _0x1987c5[_0x8fb1('0x29')]()[_0x8fb1('0x28')](function(){_0x146e60[_0x8fb1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6404,_0x12d60c){return function(_0x534930){if(!_0x534930){_0x2c6404[_0x8fb1('0x1b')](0x194);}return _0x534930;};}function handleError(_0x3068fd,_0x2f5e71){_0x2f5e71=_0x2f5e71||0x1f4;return function(_0x17a28d){logger[_0x8fb1('0x2a')](_0x17a28d[_0x8fb1('0x2b')]);if(_0x17a28d[_0x8fb1('0x2c')]){delete _0x17a28d[_0x8fb1('0x2c')];}_0x3068fd[_0x8fb1('0x1d')](_0x2f5e71)[_0x8fb1('0x2d')](_0x17a28d);};}exports['index']=function(_0x10bd53,_0x52fff7){var _0x578066={},_0x58581c={},_0x4a286c={'count':0x0,'rows':[]};var _0x16636d=_[_0x8fb1('0x2e')](db['ZohoConfiguration'][_0x8fb1('0x2f')],function(_0x49c537){return{'name':_0x49c537[_0x8fb1('0x30')],'type':_0x49c537[_0x8fb1('0x31')][_0x8fb1('0x32')]};});_0x58581c['model']=_[_0x8fb1('0x2e')](_0x16636d,_0x8fb1('0x2c'));_0x58581c[_0x8fb1('0x33')]=_['keys'](_0x10bd53[_0x8fb1('0x33')]);_0x58581c[_0x8fb1('0x34')]=_['intersection'](_0x58581c[_0x8fb1('0x35')],_0x58581c[_0x8fb1('0x33')]);_0x578066[_0x8fb1('0x36')]=_[_0x8fb1('0x37')](_0x58581c[_0x8fb1('0x35')],qs['fields'](_0x10bd53[_0x8fb1('0x33')][_0x8fb1('0x38')]));_0x578066[_0x8fb1('0x36')]=_0x578066['attributes'][_0x8fb1('0x39')]?_0x578066[_0x8fb1('0x36')]:_0x58581c[_0x8fb1('0x35')];if(!_0x10bd53[_0x8fb1('0x33')][_0x8fb1('0x3a')]('nolimit')){_0x578066['limit']=qs['limit'](_0x10bd53['query'][_0x8fb1('0x1f')]);_0x578066[_0x8fb1('0x22')]=qs[_0x8fb1('0x22')](_0x10bd53[_0x8fb1('0x33')][_0x8fb1('0x22')]);}_0x578066[_0x8fb1('0x3b')]=qs[_0x8fb1('0x3c')](_0x10bd53[_0x8fb1('0x33')]['sort']);_0x578066['where']=qs[_0x8fb1('0x34')](_[_0x8fb1('0x3d')](_0x10bd53[_0x8fb1('0x33')],_0x58581c['filters']),_0x16636d);if(_0x10bd53[_0x8fb1('0x33')][_0x8fb1('0x3e')]){_0x578066[_0x8fb1('0x3f')]=_[_0x8fb1('0x40')](_0x578066[_0x8fb1('0x3f')],{'$or':_[_0x8fb1('0x2e')](_0x16636d,function(_0x5e783d){if(_0x5e783d[_0x8fb1('0x31')]!==_0x8fb1('0x41')){var _0x116b21={};_0x116b21[_0x5e783d['name']]={'$like':'%'+_0x10bd53[_0x8fb1('0x33')]['filter']+'%'};return _0x116b21;}})});}_0x578066=_[_0x8fb1('0x40')]({},_0x578066,_0x10bd53[_0x8fb1('0x42')]);var _0x533ee8={'where':_0x578066[_0x8fb1('0x3f')]};return db[_0x8fb1('0x43')][_0x8fb1('0x21')](_0x533ee8)[_0x8fb1('0x28')](function(_0x51f90e){_0x4a286c[_0x8fb1('0x21')]=_0x51f90e;if(_0x10bd53[_0x8fb1('0x33')][_0x8fb1('0x44')]){_0x578066[_0x8fb1('0x45')]=[{'all':!![]}];}return db[_0x8fb1('0x43')]['findAll'](_0x578066);})[_0x8fb1('0x28')](function(_0x229473){_0x4a286c['rows']=_0x229473;return _0x4a286c;})['then'](respondWithFilteredResult(_0x52fff7,_0x578066))[_0x8fb1('0x46')](handleError(_0x52fff7,null));};exports[_0x8fb1('0x47')]=function(_0x3ad0aa,_0x286117){var _0x4fbb1e={'raw':![],'where':{'id':_0x3ad0aa[_0x8fb1('0x48')]['id']}},_0xd073d7={};_0xd073d7[_0x8fb1('0x35')]=_[_0x8fb1('0x49')](db[_0x8fb1('0x43')][_0x8fb1('0x2f')]);_0xd073d7[_0x8fb1('0x33')]=_[_0x8fb1('0x49')](_0x3ad0aa[_0x8fb1('0x33')]);_0xd073d7[_0x8fb1('0x34')]=_['intersection'](_0xd073d7[_0x8fb1('0x35')],_0xd073d7[_0x8fb1('0x33')]);_0x4fbb1e[_0x8fb1('0x36')]=_[_0x8fb1('0x37')](_0xd073d7[_0x8fb1('0x35')],qs['fields'](_0x3ad0aa[_0x8fb1('0x33')]['fields']));_0x4fbb1e['attributes']=_0x4fbb1e[_0x8fb1('0x36')][_0x8fb1('0x39')]?_0x4fbb1e['attributes']:_0xd073d7[_0x8fb1('0x35')];if(_0x3ad0aa['query']['includeAll']){_0x4fbb1e['include']=[{'all':!![]}];}_0x4fbb1e=_[_0x8fb1('0x40')]({},_0x4fbb1e,_0x3ad0aa[_0x8fb1('0x42')]);return db[_0x8fb1('0x43')][_0x8fb1('0x4a')](_0x4fbb1e)[_0x8fb1('0x28')](handleEntityNotFound(_0x286117,null))[_0x8fb1('0x28')](respondWithResult(_0x286117,null))[_0x8fb1('0x46')](handleError(_0x286117,null));};exports[_0x8fb1('0x4b')]=function(_0x24ee84,_0x1d960d){return db[_0x8fb1('0x43')]['create'](_0x24ee84[_0x8fb1('0x4c')],{})[_0x8fb1('0x28')](respondWithResult(_0x1d960d,0xc9))[_0x8fb1('0x46')](handleError(_0x1d960d,null));};exports[_0x8fb1('0x27')]=function(_0x4d6543,_0x47a834){if(_0x4d6543[_0x8fb1('0x4c')]['id']){delete _0x4d6543[_0x8fb1('0x4c')]['id'];}return db['ZohoConfiguration'][_0x8fb1('0x4a')]({'where':{'id':_0x4d6543[_0x8fb1('0x48')]['id']}})[_0x8fb1('0x28')](handleEntityNotFound(_0x47a834,null))[_0x8fb1('0x28')](saveUpdates(_0x4d6543[_0x8fb1('0x4c')],null))['then'](respondWithResult(_0x47a834,null))[_0x8fb1('0x46')](handleError(_0x47a834,null));};exports[_0x8fb1('0x29')]=function(_0xb2f68e,_0x609a2c){return db['ZohoConfiguration'][_0x8fb1('0x4a')]({'where':{'id':_0xb2f68e[_0x8fb1('0x48')]['id']}})[_0x8fb1('0x28')](handleEntityNotFound(_0x609a2c,null))['then'](removeEntity(_0x609a2c,null))[_0x8fb1('0x46')](handleError(_0x609a2c,null));};exports[_0x8fb1('0x4d')]=function(_0xe91ea9,_0x407f90,_0x5d9751){var _0x5dd8a8={};var _0x52032a={};var _0x5e86f5;var _0x1be51d;return db[_0x8fb1('0x43')][_0x8fb1('0x4e')]({'where':{'id':_0xe91ea9[_0x8fb1('0x48')]['id']}})['then'](handleEntityNotFound(_0x407f90,null))['then'](function(_0x163984){if(_0x163984){_0x5e86f5=_0x163984;_0x52032a[_0x8fb1('0x35')]=_['keys'](db[_0x8fb1('0x4f')][_0x8fb1('0x2f')]);_0x52032a[_0x8fb1('0x33')]=_[_0x8fb1('0x49')](_0xe91ea9[_0x8fb1('0x33')]);_0x52032a['filters']=_[_0x8fb1('0x37')](_0x52032a[_0x8fb1('0x35')],_0x52032a[_0x8fb1('0x33')]);_0x5dd8a8['attributes']=_[_0x8fb1('0x37')](_0x52032a[_0x8fb1('0x35')],qs[_0x8fb1('0x38')](_0xe91ea9[_0x8fb1('0x33')]['fields']));_0x5dd8a8[_0x8fb1('0x36')]=_0x5dd8a8[_0x8fb1('0x36')][_0x8fb1('0x39')]?_0x5dd8a8[_0x8fb1('0x36')]:_0x52032a[_0x8fb1('0x35')];_0x5dd8a8[_0x8fb1('0x3b')]=qs[_0x8fb1('0x3c')](_0xe91ea9['query'][_0x8fb1('0x3c')]);_0x5dd8a8[_0x8fb1('0x3f')]=qs['filters'](_[_0x8fb1('0x3d')](_0xe91ea9[_0x8fb1('0x33')],_0x52032a[_0x8fb1('0x34')]));if(_0xe91ea9[_0x8fb1('0x33')][_0x8fb1('0x3e')]){_0x5dd8a8[_0x8fb1('0x3f')]=_[_0x8fb1('0x40')](_0x5dd8a8[_0x8fb1('0x3f')],{'$or':_['map'](_0x5dd8a8[_0x8fb1('0x36')],function(_0x255ab5){var _0x566831={};_0x566831[_0x255ab5]={'$like':'%'+_0xe91ea9['query'][_0x8fb1('0x3e')]+'%'};return _0x566831;})});}_0x5dd8a8=_[_0x8fb1('0x40')]({},_0x5dd8a8,_0xe91ea9[_0x8fb1('0x42')]);return _0x5e86f5[_0x8fb1('0x4d')](_0x5dd8a8);}})['then'](function(_0x19b561){if(_0x19b561){_0x1be51d=_0x19b561[_0x8fb1('0x39')];if(!_0xe91ea9[_0x8fb1('0x33')]['hasOwnProperty']('nolimit')){_0x5dd8a8[_0x8fb1('0x1f')]=qs[_0x8fb1('0x1f')](_0xe91ea9[_0x8fb1('0x33')]['limit']);_0x5dd8a8[_0x8fb1('0x22')]=qs[_0x8fb1('0x22')](_0xe91ea9['query'][_0x8fb1('0x22')]);}return _0x5e86f5[_0x8fb1('0x4d')](_0x5dd8a8);}})[_0x8fb1('0x28')](function(_0x326909){if(_0x326909){return _0x326909?{'count':_0x1be51d,'rows':_0x326909}:null;}})[_0x8fb1('0x28')](respondWithResult(_0x407f90,null))['catch'](handleError(_0x407f90,null));};exports[_0x8fb1('0x50')]=function(_0x327dce,_0x3124f9,_0x12f77b){var _0x5ebb20={};var _0x3b548b={};var _0xd9cebe;var _0x2ead84;return db[_0x8fb1('0x43')][_0x8fb1('0x4e')]({'where':{'id':_0x327dce[_0x8fb1('0x48')]['id']}})[_0x8fb1('0x28')](handleEntityNotFound(_0x3124f9,null))['then'](function(_0x3f4e84){if(_0x3f4e84){_0xd9cebe=_0x3f4e84;_0x3b548b[_0x8fb1('0x35')]=_[_0x8fb1('0x49')](db[_0x8fb1('0x4f')]['rawAttributes']);_0x3b548b[_0x8fb1('0x33')]=_[_0x8fb1('0x49')](_0x327dce[_0x8fb1('0x33')]);_0x3b548b[_0x8fb1('0x34')]=_[_0x8fb1('0x37')](_0x3b548b[_0x8fb1('0x35')],_0x3b548b['query']);_0x5ebb20[_0x8fb1('0x36')]=_[_0x8fb1('0x37')](_0x3b548b[_0x8fb1('0x35')],qs['fields'](_0x327dce[_0x8fb1('0x33')]['fields']));_0x5ebb20[_0x8fb1('0x36')]=_0x5ebb20[_0x8fb1('0x36')]['length']?_0x5ebb20['attributes']:_0x3b548b[_0x8fb1('0x35')];_0x5ebb20['order']=qs[_0x8fb1('0x3c')](_0x327dce[_0x8fb1('0x33')][_0x8fb1('0x3c')]);_0x5ebb20[_0x8fb1('0x3f')]=qs[_0x8fb1('0x34')](_[_0x8fb1('0x3d')](_0x327dce[_0x8fb1('0x33')],_0x3b548b[_0x8fb1('0x34')]));if(_0x327dce[_0x8fb1('0x33')][_0x8fb1('0x3e')]){_0x5ebb20[_0x8fb1('0x3f')]=_[_0x8fb1('0x40')](_0x5ebb20['where'],{'$or':_['map'](_0x5ebb20['attributes'],function(_0x104e67){var _0x2341d9={};_0x2341d9[_0x104e67]={'$like':'%'+_0x327dce[_0x8fb1('0x33')][_0x8fb1('0x3e')]+'%'};return _0x2341d9;})});}_0x5ebb20=_[_0x8fb1('0x40')]({},_0x5ebb20,_0x327dce[_0x8fb1('0x42')]);return _0xd9cebe[_0x8fb1('0x50')](_0x5ebb20);}})[_0x8fb1('0x28')](function(_0x3925e5){if(_0x3925e5){_0x2ead84=_0x3925e5[_0x8fb1('0x39')];if(!_0x327dce[_0x8fb1('0x33')][_0x8fb1('0x3a')](_0x8fb1('0x51'))){_0x5ebb20[_0x8fb1('0x1f')]=qs[_0x8fb1('0x1f')](_0x327dce[_0x8fb1('0x33')]['limit']);_0x5ebb20['offset']=qs[_0x8fb1('0x22')](_0x327dce[_0x8fb1('0x33')]['offset']);}return _0xd9cebe[_0x8fb1('0x50')](_0x5ebb20);}})['then'](function(_0x4719e9){if(_0x4719e9){return _0x4719e9?{'count':_0x2ead84,'rows':_0x4719e9}:null;}})['then'](respondWithResult(_0x3124f9,null))['catch'](handleError(_0x3124f9,null));};exports['getDescriptions']=function(_0x1dca5d,_0x21aaa1,_0x42dbca){var _0x8ef9aa={};var _0x3269ea={};var _0x51044d;var _0x448775;return db[_0x8fb1('0x43')][_0x8fb1('0x4e')]({'where':{'id':_0x1dca5d['params']['id']}})[_0x8fb1('0x28')](handleEntityNotFound(_0x21aaa1,null))[_0x8fb1('0x28')](function(_0x158deb){if(_0x158deb){_0x51044d=_0x158deb;_0x3269ea[_0x8fb1('0x35')]=_['keys'](db[_0x8fb1('0x4f')]['rawAttributes']);_0x3269ea['query']=_['keys'](_0x1dca5d[_0x8fb1('0x33')]);_0x3269ea[_0x8fb1('0x34')]=_[_0x8fb1('0x37')](_0x3269ea[_0x8fb1('0x35')],_0x3269ea['query']);_0x8ef9aa[_0x8fb1('0x36')]=_[_0x8fb1('0x37')](_0x3269ea[_0x8fb1('0x35')],qs['fields'](_0x1dca5d[_0x8fb1('0x33')][_0x8fb1('0x38')]));_0x8ef9aa[_0x8fb1('0x36')]=_0x8ef9aa[_0x8fb1('0x36')][_0x8fb1('0x39')]?_0x8ef9aa[_0x8fb1('0x36')]:_0x3269ea['model'];_0x8ef9aa[_0x8fb1('0x3b')]=qs['sort'](_0x1dca5d[_0x8fb1('0x33')][_0x8fb1('0x3c')]);_0x8ef9aa[_0x8fb1('0x3f')]=qs[_0x8fb1('0x34')](_['pick'](_0x1dca5d['query'],_0x3269ea[_0x8fb1('0x34')]));if(_0x1dca5d[_0x8fb1('0x33')][_0x8fb1('0x3e')]){_0x8ef9aa[_0x8fb1('0x3f')]=_['merge'](_0x8ef9aa[_0x8fb1('0x3f')],{'$or':_['map'](_0x8ef9aa[_0x8fb1('0x36')],function(_0x514963){var _0x47e68={};_0x47e68[_0x514963]={'$like':'%'+_0x1dca5d[_0x8fb1('0x33')][_0x8fb1('0x3e')]+'%'};return _0x47e68;})});}_0x8ef9aa=_[_0x8fb1('0x40')]({},_0x8ef9aa,_0x1dca5d[_0x8fb1('0x42')]);return _0x51044d[_0x8fb1('0x52')](_0x8ef9aa);}})['then'](function(_0x4e58b9){if(_0x4e58b9){_0x448775=_0x4e58b9[_0x8fb1('0x39')];if(!_0x1dca5d[_0x8fb1('0x33')][_0x8fb1('0x3a')]('nolimit')){_0x8ef9aa[_0x8fb1('0x1f')]=qs[_0x8fb1('0x1f')](_0x1dca5d[_0x8fb1('0x33')][_0x8fb1('0x1f')]);_0x8ef9aa[_0x8fb1('0x22')]=qs[_0x8fb1('0x22')](_0x1dca5d[_0x8fb1('0x33')][_0x8fb1('0x22')]);}return _0x51044d['getDescriptions'](_0x8ef9aa);}})[_0x8fb1('0x28')](function(_0x1b79cd){if(_0x1b79cd){return _0x1b79cd?{'count':_0x448775,'rows':_0x1b79cd}:null;}})[_0x8fb1('0x28')](respondWithResult(_0x21aaa1,null))[_0x8fb1('0x46')](handleError(_0x21aaa1,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 09c9f28..49d057c 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 _0xa239=['ZohoConfiguration','int_zoho_configurations','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x47d18a,_0xd53074){var _0x130c43=function(_0x380f11){while(--_0x380f11){_0x47d18a['push'](_0x47d18a['shift']());}};_0x130c43(++_0xd53074);}(_0xa239,0x98));var _0x9a23=function(_0xaa6f53,_0x10e28b){_0xaa6f53=_0xaa6f53-0x0;var _0x56188b=_0xa239[_0xaa6f53];return _0x56188b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a23('0x0'))(_0x9a23('0x1'));var moment=require(_0x9a23('0x2'));var BPromise=require(_0x9a23('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a23('0x4'));var rimraf=require(_0x9a23('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoConfiguration.attributes');module[_0x9a23('0x6')]=function(_0x3c5149,_0x2511f4){return _0x3c5149[_0x9a23('0x7')](_0x9a23('0x8'),attributes,{'tableName':_0x9a23('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4a4=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoConfiguration','int_zoho_configurations','lodash'];(function(_0x511c6c,_0x5166e9){var _0x3cc8c7=function(_0x48ccc2){while(--_0x48ccc2){_0x511c6c['push'](_0x511c6c['shift']());}};_0x3cc8c7(++_0x5166e9);}(_0xc4a4,0xa8));var _0x4c4a=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0xc4a4[_0x257642];return _0x3d813b;};'use strict';var _=require(_0x4c4a('0x0'));var util=require(_0x4c4a('0x1'));var logger=require('../../config/logger')(_0x4c4a('0x2'));var moment=require(_0x4c4a('0x3'));var BPromise=require(_0x4c4a('0x4'));var rp=require(_0x4c4a('0x5'));var fs=require('fs');var path=require(_0x4c4a('0x6'));var rimraf=require(_0x4c4a('0x7'));var config=require(_0x4c4a('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0x4c4a('0x9')]=function(_0x20231b,_0x4ae83a){return _0x20231b[_0x4c4a('0xa')](_0x4c4a('0xb'),attributes,{'tableName':_0x4c4a('0xc'),'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 bdfb9bd..63c4f34 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 _0xd561=['then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0xd561,0x78));var _0x1d56=function(_0x2ad8fa,_0x43bbd0){_0x2ad8fa=_0x2ad8fa-0x0;var _0x51e2d5=_0xd561[_0x2ad8fa];return _0x51e2d5;};'use strict';var _=require(_0x1d56('0x0'));var util=require(_0x1d56('0x1'));var moment=require(_0x1d56('0x2'));var BPromise=require(_0x1d56('0x3'));var rs=require(_0x1d56('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d56('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d56('0x6'))(_0x1d56('0x7'));var config=require(_0x1d56('0x8'));var jayson=require(_0x1d56('0x9'));var client=jayson[_0x1d56('0xa')][_0x1d56('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25fa90,_0xc4a580,_0x32ebef){return new BPromise(function(_0x59ebd7,_0x3cee41){return client[_0x1d56('0xc')](_0x25fa90,_0x32ebef)[_0x1d56('0xd')](function(_0x35ef40){logger['info'](_0x1d56('0xe'),_0xc4a580,_0x1d56('0xf'));logger['debug'](_0x1d56('0x10'),_0xc4a580,_0x1d56('0xf'),JSON['stringify'](_0x35ef40));if(_0x35ef40[_0x1d56('0x11')]){if(_0x35ef40[_0x1d56('0x11')]['code']===0x1f4){logger[_0x1d56('0x11')](_0x1d56('0xe'),_0xc4a580,_0x35ef40[_0x1d56('0x11')][_0x1d56('0x12')]);return _0x3cee41(_0x35ef40[_0x1d56('0x11')]['message']);}logger[_0x1d56('0x11')](_0x1d56('0xe'),_0xc4a580,_0x35ef40['error'][_0x1d56('0x12')]);return _0x59ebd7(_0x35ef40['error'][_0x1d56('0x12')]);}else{logger['info'](_0x1d56('0xe'),_0xc4a580,_0x1d56('0xf'));_0x59ebd7(_0x35ef40['result']['message']);}})['catch'](function(_0x8e1f4b){logger[_0x1d56('0x11')](_0x1d56('0xe'),_0xc4a580,_0x8e1f4b);_0x3cee41(_0x8e1f4b);});});} \ No newline at end of file +var _0x631b=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x49ec58,_0x548caf){var _0x5518f2=function(_0x487ccd){while(--_0x487ccd){_0x49ec58['push'](_0x49ec58['shift']());}};_0x5518f2(++_0x548caf);}(_0x631b,0x13b));var _0xb631=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x631b[_0xc8db6b];return _0x12cb81;};'use strict';var _=require(_0xb631('0x0'));var util=require(_0xb631('0x1'));var moment=require(_0xb631('0x2'));var BPromise=require(_0xb631('0x3'));var rs=require(_0xb631('0x4'));var fs=require('fs');var Redis=require(_0xb631('0x5'));var db=require(_0xb631('0x6'))['db'];var utils=require(_0xb631('0x7'));var logger=require(_0xb631('0x8'))(_0xb631('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb631('0xa')][_0xb631('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x173322,_0x3acde0,_0x5b276a){return new BPromise(function(_0x129f6b,_0x5255c4){return client[_0xb631('0xc')](_0x173322,_0x5b276a)[_0xb631('0xd')](function(_0x5e6656){logger[_0xb631('0xe')](_0xb631('0xf'),_0x3acde0,'request\x20sent');logger['debug'](_0xb631('0x10'),_0x3acde0,_0xb631('0x11'),JSON[_0xb631('0x12')](_0x5e6656));if(_0x5e6656[_0xb631('0x13')]){if(_0x5e6656['error'][_0xb631('0x14')]===0x1f4){logger[_0xb631('0x13')](_0xb631('0xf'),_0x3acde0,_0x5e6656['error'][_0xb631('0x15')]);return _0x5255c4(_0x5e6656[_0xb631('0x13')][_0xb631('0x15')]);}logger[_0xb631('0x13')](_0xb631('0xf'),_0x3acde0,_0x5e6656[_0xb631('0x13')][_0xb631('0x15')]);return _0x129f6b(_0x5e6656['error']['message']);}else{logger[_0xb631('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x3acde0,_0xb631('0x11'));_0x129f6b(_0x5e6656[_0xb631('0x16')][_0xb631('0x15')]);}})[_0xb631('0x17')](function(_0x5045b2){logger[_0xb631('0x13')](_0xb631('0xf'),_0x3acde0,_0x5045b2);_0x5255c4(_0x5045b2);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index cb4294a..25ba1b7 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 _0x001d=['update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1863de,_0x345a8e){var _0x1d4941=function(_0x344dd5){while(--_0x344dd5){_0x1863de['push'](_0x1863de['shift']());}};_0x1d4941(++_0x345a8e);}(_0x001d,0x1df));var _0xd001=function(_0xdcefae,_0xa7067d){_0xdcefae=_0xdcefae-0x0;var _0x22c4b1=_0x001d[_0xdcefae];return _0x22c4b1;};'use strict';var multer=require(_0xd001('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd001('0x1'));var express=require(_0xd001('0x2'));var router=express['Router']();var fs_extra=require(_0xd001('0x3'));var auth=require(_0xd001('0x4'));var interaction=require(_0xd001('0x5'));var config=require(_0xd001('0x6'));var controller=require(_0xd001('0x7'));router[_0xd001('0x8')]('/',auth[_0xd001('0x9')](),controller[_0xd001('0xa')]);router[_0xd001('0x8')](_0xd001('0xb'),auth[_0xd001('0x9')](),controller[_0xd001('0xc')]);router[_0xd001('0xd')]('/',auth[_0xd001('0x9')](),controller[_0xd001('0xe')]);router['put'](_0xd001('0xb'),auth[_0xd001('0x9')](),controller[_0xd001('0xf')]);router[_0xd001('0x10')](_0xd001('0xb'),auth[_0xd001('0x9')](),controller[_0xd001('0x11')]);module[_0xd001('0x12')]=router; \ No newline at end of file +var _0x55a1=['get','/:id','isAuthenticated','post','create','put','update','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x55a1,0x118));var _0x155a=function(_0x43739f,_0x40517a){_0x43739f=_0x43739f-0x0;var _0x2cdf3e=_0x55a1[_0x43739f];return _0x2cdf3e;};'use strict';var multer=require(_0x155a('0x0'));var util=require('util');var path=require(_0x155a('0x1'));var timeout=require(_0x155a('0x2'));var express=require(_0x155a('0x3'));var router=express['Router']();var fs_extra=require(_0x155a('0x4'));var auth=require(_0x155a('0x5'));var interaction=require(_0x155a('0x6'));var config=require(_0x155a('0x7'));var controller=require('./intZohoField.controller');router[_0x155a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x155a('0x9'),auth[_0x155a('0xa')](),controller['show']);router[_0x155a('0xb')]('/',auth['isAuthenticated'](),controller[_0x155a('0xc')]);router[_0x155a('0xd')](_0x155a('0x9'),auth['isAuthenticated'](),controller[_0x155a('0xe')]);router['delete'](_0x155a('0x9'),auth[_0x155a('0xa')](),controller[_0x155a('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7a5d9a9..a30f57a 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 _0xc11a=['customVariable','keyValue','picklist','STRING','ENUM','variable','exports','string'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0xc11a,0x106));var _0xac11=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xc11a[_0x4bb581];return _0x316bf5;};'use strict';var Sequelize=require('sequelize');module[_0xac11('0x0')]={'type':{'type':Sequelize['ENUM'](_0xac11('0x1'),'variable',_0xac11('0x2'),_0xac11('0x3'),_0xac11('0x4')),'defaultValue':_0xac11('0x1')},'content':{'type':Sequelize[_0xac11('0x5')]},'key':{'type':Sequelize[_0xac11('0x5')]},'keyType':{'type':Sequelize[_0xac11('0x6')](_0xac11('0x1'),_0xac11('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xac11('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xac11('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9359=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x557688,_0xce7605){var _0x8bf9dd=function(_0x2d5cfa){while(--_0x2d5cfa){_0x557688['push'](_0x557688['shift']());}};_0x8bf9dd(++_0xce7605);}(_0x9359,0x103));var _0x9935=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9359[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x9935('0x0'));module[_0x9935('0x1')]={'type':{'type':Sequelize[_0x9935('0x2')](_0x9935('0x3'),_0x9935('0x4'),_0x9935('0x5'),'keyValue',_0x9935('0x6')),'defaultValue':_0x9935('0x3')},'content':{'type':Sequelize[_0x9935('0x7')]},'key':{'type':Sequelize[_0x9935('0x7')]},'keyType':{'type':Sequelize[_0x9935('0x2')](_0x9935('0x3'),_0x9935('0x4'),_0x9935('0x5'))},'keyContent':{'type':Sequelize[_0x9935('0x7')]},'idField':{'type':Sequelize[_0x9935('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9935('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9935('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 52c15c2..3d748e8 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 _0xa5a4=['merge','VIRTUAL','filter','options','ZohoField','includeAll','findAll','rows','catch','show','keys','rawAttributes','intersection','include','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xa5a4,0xaf));var _0x4a5a=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xa5a4[_0x3305de];return _0x3b5a84;};'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(_0x4a5a('0x8'));var path=require(_0x4a5a('0x9'));var sox=require(_0x4a5a('0xa'));var csv=require(_0x4a5a('0xb'));var ejs=require('ejs');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('jsforce');var deskjs=require(_0x4a5a('0x10'));var toCsv=require(_0x4a5a('0xb'));var querystring=require(_0x4a5a('0x11'));var Papa=require('papaparse');var Redis=require(_0x4a5a('0x12'));var authService=require(_0x4a5a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a5a('0x14'));var logger=require('../../config/logger')(_0x4a5a('0x15'));var utils=require('../../config/utils');var config=require(_0x4a5a('0x16'));var licenseUtil=require(_0x4a5a('0x17'));var db=require(_0x4a5a('0x18'))['db'];function respondWithStatusCode(_0x2b2ca3,_0x4f5d05){_0x4f5d05=_0x4f5d05||0xcc;return function(_0x42af3e){if(_0x42af3e){return _0x2b2ca3[_0x4a5a('0x19')](_0x4f5d05);}return _0x2b2ca3['status'](_0x4f5d05)[_0x4a5a('0x1a')]();};}function respondWithResult(_0x25c659,_0x468892){_0x468892=_0x468892||0xc8;return function(_0x431075){if(_0x431075){return _0x25c659[_0x4a5a('0x1b')](_0x468892)[_0x4a5a('0x1c')](_0x431075);}};}function respondWithFilteredResult(_0x30f2b5,_0x3389a4){return function(_0x14f1ec){if(_0x14f1ec){var _0x4728e2=typeof _0x3389a4[_0x4a5a('0x1d')]==='undefined'&&typeof _0x3389a4[_0x4a5a('0x1e')]==='undefined';var _0x7f46ca=_0x14f1ec[_0x4a5a('0x1f')];var _0x4c2fa2=_0x4728e2?0x0:_0x3389a4['offset'];var _0x59b54c=_0x4728e2?_0x14f1ec['count']:_0x3389a4['offset']+_0x3389a4['limit'];var _0x38661e;if(_0x59b54c>=_0x7f46ca){_0x59b54c=_0x7f46ca;_0x38661e=0xc8;}else{_0x38661e=0xce;}_0x30f2b5[_0x4a5a('0x1b')](_0x38661e);return _0x30f2b5['set'](_0x4a5a('0x20'),_0x4c2fa2+'-'+_0x59b54c+'/'+_0x7f46ca)[_0x4a5a('0x1c')](_0x14f1ec);}return null;};}function patchUpdates(_0x5be26f){return function(_0x49ce9f){try{jsonpatch[_0x4a5a('0x21')](_0x49ce9f,_0x5be26f,!![]);}catch(_0x325eff){return BPromise[_0x4a5a('0x22')](_0x325eff);}return _0x49ce9f[_0x4a5a('0x23')]();};}function saveUpdates(_0x2f985c,_0x48da08){return function(_0x54a79c){if(_0x54a79c){return _0x54a79c['update'](_0x2f985c)[_0x4a5a('0x24')](function(_0x10df82){return _0x10df82;});}return null;};}function removeEntity(_0x17b0fc,_0x445e62){return function(_0x3d1973){if(_0x3d1973){return _0x3d1973[_0x4a5a('0x25')]()[_0x4a5a('0x24')](function(){_0x17b0fc[_0x4a5a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17fc46,_0xa935f9){return function(_0x27ad7c){if(!_0x27ad7c){_0x17fc46[_0x4a5a('0x19')](0x194);}return _0x27ad7c;};}function handleError(_0x44517b,_0x46086d){_0x46086d=_0x46086d||0x1f4;return function(_0x5a8492){logger[_0x4a5a('0x26')](_0x5a8492[_0x4a5a('0x27')]);if(_0x5a8492['name']){delete _0x5a8492[_0x4a5a('0x28')];}_0x44517b[_0x4a5a('0x1b')](_0x46086d)[_0x4a5a('0x29')](_0x5a8492);};}exports[_0x4a5a('0x2a')]=function(_0x123984,_0x43f980){var _0x407c0c={},_0x50933c={},_0x59a59e={'count':0x0,'rows':[]};var _0x67cc2b=_[_0x4a5a('0x2b')](db['ZohoField']['rawAttributes'],function(_0x44fc50){return{'name':_0x44fc50[_0x4a5a('0x2c')],'type':_0x44fc50[_0x4a5a('0x2d')][_0x4a5a('0x2e')]};});_0x50933c[_0x4a5a('0x2f')]=_[_0x4a5a('0x2b')](_0x67cc2b,_0x4a5a('0x28'));_0x50933c[_0x4a5a('0x30')]=_['keys'](_0x123984['query']);_0x50933c[_0x4a5a('0x31')]=_['intersection'](_0x50933c[_0x4a5a('0x2f')],_0x50933c[_0x4a5a('0x30')]);_0x407c0c[_0x4a5a('0x32')]=_['intersection'](_0x50933c[_0x4a5a('0x2f')],qs[_0x4a5a('0x33')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x33')]));_0x407c0c['attributes']=_0x407c0c['attributes'][_0x4a5a('0x34')]?_0x407c0c[_0x4a5a('0x32')]:_0x50933c[_0x4a5a('0x2f')];if(!_0x123984['query'][_0x4a5a('0x35')](_0x4a5a('0x36'))){_0x407c0c[_0x4a5a('0x1e')]=qs[_0x4a5a('0x1e')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x1e')]);_0x407c0c[_0x4a5a('0x1d')]=qs[_0x4a5a('0x1d')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x1d')]);}_0x407c0c[_0x4a5a('0x37')]=qs[_0x4a5a('0x38')](_0x123984[_0x4a5a('0x30')][_0x4a5a('0x38')]);_0x407c0c[_0x4a5a('0x39')]=qs[_0x4a5a('0x31')](_[_0x4a5a('0x3a')](_0x123984[_0x4a5a('0x30')],_0x50933c[_0x4a5a('0x31')]),_0x67cc2b);if(_0x123984['query']['filter']){_0x407c0c[_0x4a5a('0x39')]=_[_0x4a5a('0x3b')](_0x407c0c['where'],{'$or':_[_0x4a5a('0x2b')](_0x67cc2b,function(_0x4c7d17){if(_0x4c7d17[_0x4a5a('0x2d')]!==_0x4a5a('0x3c')){var _0xac1cb2={};_0xac1cb2[_0x4c7d17[_0x4a5a('0x28')]]={'$like':'%'+_0x123984[_0x4a5a('0x30')][_0x4a5a('0x3d')]+'%'};return _0xac1cb2;}})});}_0x407c0c=_[_0x4a5a('0x3b')]({},_0x407c0c,_0x123984[_0x4a5a('0x3e')]);var _0x4ca49a={'where':_0x407c0c[_0x4a5a('0x39')]};return db[_0x4a5a('0x3f')][_0x4a5a('0x1f')](_0x4ca49a)[_0x4a5a('0x24')](function(_0x492bdd){_0x59a59e[_0x4a5a('0x1f')]=_0x492bdd;if(_0x123984['query'][_0x4a5a('0x40')]){_0x407c0c['include']=[{'all':!![]}];}return db[_0x4a5a('0x3f')][_0x4a5a('0x41')](_0x407c0c);})['then'](function(_0x51e3e0){_0x59a59e[_0x4a5a('0x42')]=_0x51e3e0;return _0x59a59e;})[_0x4a5a('0x24')](respondWithFilteredResult(_0x43f980,_0x407c0c))[_0x4a5a('0x43')](handleError(_0x43f980,null));};exports[_0x4a5a('0x44')]=function(_0x22400e,_0x46b75d){var _0x551fd3={'raw':!![],'where':{'id':_0x22400e['params']['id']}},_0x57fa6a={};_0x57fa6a[_0x4a5a('0x2f')]=_[_0x4a5a('0x45')](db['ZohoField'][_0x4a5a('0x46')]);_0x57fa6a[_0x4a5a('0x30')]=_['keys'](_0x22400e[_0x4a5a('0x30')]);_0x57fa6a[_0x4a5a('0x31')]=_[_0x4a5a('0x47')](_0x57fa6a['model'],_0x57fa6a[_0x4a5a('0x30')]);_0x551fd3[_0x4a5a('0x32')]=_[_0x4a5a('0x47')](_0x57fa6a[_0x4a5a('0x2f')],qs[_0x4a5a('0x33')](_0x22400e[_0x4a5a('0x30')][_0x4a5a('0x33')]));_0x551fd3[_0x4a5a('0x32')]=_0x551fd3[_0x4a5a('0x32')][_0x4a5a('0x34')]?_0x551fd3[_0x4a5a('0x32')]:_0x57fa6a[_0x4a5a('0x2f')];if(_0x22400e[_0x4a5a('0x30')]['includeAll']){_0x551fd3[_0x4a5a('0x48')]=[{'all':!![]}];}_0x551fd3=_['merge']({},_0x551fd3,_0x22400e[_0x4a5a('0x3e')]);return db[_0x4a5a('0x3f')][_0x4a5a('0x49')](_0x551fd3)[_0x4a5a('0x24')](handleEntityNotFound(_0x46b75d,null))[_0x4a5a('0x24')](respondWithResult(_0x46b75d,null))[_0x4a5a('0x43')](handleError(_0x46b75d,null));};exports[_0x4a5a('0x4a')]=function(_0x1bd98b,_0xca6ead){return db[_0x4a5a('0x3f')][_0x4a5a('0x4a')](_0x1bd98b[_0x4a5a('0x4b')],{})[_0x4a5a('0x24')](respondWithResult(_0xca6ead,0xc9))[_0x4a5a('0x43')](handleError(_0xca6ead,null));};exports[_0x4a5a('0x4c')]=function(_0x46b324,_0x4c7feb){if(_0x46b324[_0x4a5a('0x4b')]['id']){delete _0x46b324['body']['id'];}return db[_0x4a5a('0x3f')]['find']({'where':{'id':_0x46b324['params']['id']}})[_0x4a5a('0x24')](handleEntityNotFound(_0x4c7feb,null))['then'](saveUpdates(_0x46b324['body'],null))['then'](respondWithResult(_0x4c7feb,null))[_0x4a5a('0x43')](handleError(_0x4c7feb,null));};exports[_0x4a5a('0x25')]=function(_0x28645d,_0x3580fa){return db[_0x4a5a('0x3f')][_0x4a5a('0x49')]({'where':{'id':_0x28645d[_0x4a5a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3580fa,null))[_0x4a5a('0x24')](removeEntity(_0x3580fa,null))[_0x4a5a('0x43')](handleError(_0x3580fa,null));}; \ No newline at end of file +var _0x00d1=['nolimit','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ZohoField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x00d1,0x16f));var _0x100d=function(_0x169600,_0x1d1346){_0x169600=_0x169600-0x0;var _0x3bee22=_0x00d1[_0x169600];return _0x3bee22;};'use strict';var emlformat=require(_0x100d('0x0'));var rimraf=require(_0x100d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x100d('0x2'));var rp=require(_0x100d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x100d('0x4'));var util=require('util');var path=require(_0x100d('0x5'));var sox=require('sox');var csv=require(_0x100d('0x6'));var ejs=require(_0x100d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x100d('0x8'));var squel=require(_0x100d('0x9'));var crypto=require(_0x100d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x100d('0xb'));var toCsv=require(_0x100d('0x6'));var querystring=require('querystring');var Papa=require(_0x100d('0xc'));var Redis=require(_0x100d('0xd'));var authService=require(_0x100d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x100d('0xf'));var hardwareService=require(_0x100d('0x10'));var logger=require(_0x100d('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x100d('0x12'))['db'];function respondWithStatusCode(_0xff3262,_0x2eb0ad){_0x2eb0ad=_0x2eb0ad||0xcc;return function(_0x376eae){if(_0x376eae){return _0xff3262[_0x100d('0x13')](_0x2eb0ad);}return _0xff3262[_0x100d('0x14')](_0x2eb0ad)['end']();};}function respondWithResult(_0xcc2542,_0x40151c){_0x40151c=_0x40151c||0xc8;return function(_0x1b5662){if(_0x1b5662){return _0xcc2542[_0x100d('0x14')](_0x40151c)[_0x100d('0x15')](_0x1b5662);}};}function respondWithFilteredResult(_0x4f8411,_0x24ed72){return function(_0x5cd392){if(_0x5cd392){var _0x4a292e=typeof _0x24ed72[_0x100d('0x16')]===_0x100d('0x17')&&typeof _0x24ed72[_0x100d('0x18')]===_0x100d('0x17');var _0x7fdd5d=_0x5cd392[_0x100d('0x19')];var _0x697286=_0x4a292e?0x0:_0x24ed72['offset'];var _0x2e8c5b=_0x4a292e?_0x5cd392['count']:_0x24ed72[_0x100d('0x16')]+_0x24ed72[_0x100d('0x18')];var _0x2dcc3c;if(_0x2e8c5b>=_0x7fdd5d){_0x2e8c5b=_0x7fdd5d;_0x2dcc3c=0xc8;}else{_0x2dcc3c=0xce;}_0x4f8411['status'](_0x2dcc3c);return _0x4f8411[_0x100d('0x1a')](_0x100d('0x1b'),_0x697286+'-'+_0x2e8c5b+'/'+_0x7fdd5d)[_0x100d('0x15')](_0x5cd392);}return null;};}function patchUpdates(_0x59c747){return function(_0x421b3c){try{jsonpatch[_0x100d('0x1c')](_0x421b3c,_0x59c747,!![]);}catch(_0x5445c7){return BPromise[_0x100d('0x1d')](_0x5445c7);}return _0x421b3c[_0x100d('0x1e')]();};}function saveUpdates(_0x3b5358,_0x4bf591){return function(_0x365fb8){if(_0x365fb8){return _0x365fb8[_0x100d('0x1f')](_0x3b5358)[_0x100d('0x20')](function(_0x48ff4a){return _0x48ff4a;});}return null;};}function removeEntity(_0x1f2324,_0x2f5d69){return function(_0x38870d){if(_0x38870d){return _0x38870d[_0x100d('0x21')]()[_0x100d('0x20')](function(){_0x1f2324['status'](0xcc)[_0x100d('0x22')]();});}};}function handleEntityNotFound(_0x43932a,_0x5f1030){return function(_0x921d08){if(!_0x921d08){_0x43932a[_0x100d('0x13')](0x194);}return _0x921d08;};}function handleError(_0x522dac,_0x429bdd){_0x429bdd=_0x429bdd||0x1f4;return function(_0x3fdf5f){logger[_0x100d('0x23')](_0x3fdf5f[_0x100d('0x24')]);if(_0x3fdf5f['name']){delete _0x3fdf5f[_0x100d('0x25')];}_0x522dac['status'](_0x429bdd)[_0x100d('0x26')](_0x3fdf5f);};}exports[_0x100d('0x27')]=function(_0x2ba6fe,_0x32ceac){var _0x5994a8={},_0x2f9007={},_0x10bbc5={'count':0x0,'rows':[]};var _0x173883=_[_0x100d('0x28')](db[_0x100d('0x29')][_0x100d('0x2a')],function(_0x2f1fab){return{'name':_0x2f1fab['fieldName'],'type':_0x2f1fab[_0x100d('0x2b')][_0x100d('0x2c')]};});_0x2f9007[_0x100d('0x2d')]=_[_0x100d('0x28')](_0x173883,_0x100d('0x25'));_0x2f9007[_0x100d('0x2e')]=_[_0x100d('0x2f')](_0x2ba6fe[_0x100d('0x2e')]);_0x2f9007[_0x100d('0x30')]=_[_0x100d('0x31')](_0x2f9007['model'],_0x2f9007[_0x100d('0x2e')]);_0x5994a8[_0x100d('0x32')]=_['intersection'](_0x2f9007[_0x100d('0x2d')],qs[_0x100d('0x33')](_0x2ba6fe['query']['fields']));_0x5994a8['attributes']=_0x5994a8[_0x100d('0x32')][_0x100d('0x34')]?_0x5994a8['attributes']:_0x2f9007[_0x100d('0x2d')];if(!_0x2ba6fe[_0x100d('0x2e')]['hasOwnProperty'](_0x100d('0x35'))){_0x5994a8[_0x100d('0x18')]=qs['limit'](_0x2ba6fe[_0x100d('0x2e')][_0x100d('0x18')]);_0x5994a8[_0x100d('0x16')]=qs[_0x100d('0x16')](_0x2ba6fe[_0x100d('0x2e')][_0x100d('0x16')]);}_0x5994a8['order']=qs[_0x100d('0x36')](_0x2ba6fe[_0x100d('0x2e')][_0x100d('0x36')]);_0x5994a8[_0x100d('0x37')]=qs[_0x100d('0x30')](_[_0x100d('0x38')](_0x2ba6fe['query'],_0x2f9007[_0x100d('0x30')]),_0x173883);if(_0x2ba6fe[_0x100d('0x2e')][_0x100d('0x39')]){_0x5994a8[_0x100d('0x37')]=_[_0x100d('0x3a')](_0x5994a8['where'],{'$or':_[_0x100d('0x28')](_0x173883,function(_0x56571e){if(_0x56571e['type']!==_0x100d('0x3b')){var _0x49f73c={};_0x49f73c[_0x56571e['name']]={'$like':'%'+_0x2ba6fe[_0x100d('0x2e')][_0x100d('0x39')]+'%'};return _0x49f73c;}})});}_0x5994a8=_[_0x100d('0x3a')]({},_0x5994a8,_0x2ba6fe[_0x100d('0x3c')]);var _0x3f1811={'where':_0x5994a8[_0x100d('0x37')]};return db[_0x100d('0x29')][_0x100d('0x19')](_0x3f1811)['then'](function(_0x3e940d){_0x10bbc5['count']=_0x3e940d;if(_0x2ba6fe[_0x100d('0x2e')]['includeAll']){_0x5994a8['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x5994a8);})[_0x100d('0x20')](function(_0x1e2f08){_0x10bbc5[_0x100d('0x3d')]=_0x1e2f08;return _0x10bbc5;})[_0x100d('0x20')](respondWithFilteredResult(_0x32ceac,_0x5994a8))[_0x100d('0x3e')](handleError(_0x32ceac,null));};exports[_0x100d('0x3f')]=function(_0x17c6df,_0x5cf2ff){var _0x5d7bb3={'raw':!![],'where':{'id':_0x17c6df[_0x100d('0x40')]['id']}},_0x256d0a={};_0x256d0a[_0x100d('0x2d')]=_['keys'](db[_0x100d('0x29')]['rawAttributes']);_0x256d0a['query']=_[_0x100d('0x2f')](_0x17c6df[_0x100d('0x2e')]);_0x256d0a[_0x100d('0x30')]=_['intersection'](_0x256d0a[_0x100d('0x2d')],_0x256d0a[_0x100d('0x2e')]);_0x5d7bb3['attributes']=_['intersection'](_0x256d0a[_0x100d('0x2d')],qs[_0x100d('0x33')](_0x17c6df[_0x100d('0x2e')][_0x100d('0x33')]));_0x5d7bb3[_0x100d('0x32')]=_0x5d7bb3[_0x100d('0x32')][_0x100d('0x34')]?_0x5d7bb3[_0x100d('0x32')]:_0x256d0a[_0x100d('0x2d')];if(_0x17c6df[_0x100d('0x2e')][_0x100d('0x41')]){_0x5d7bb3[_0x100d('0x42')]=[{'all':!![]}];}_0x5d7bb3=_[_0x100d('0x3a')]({},_0x5d7bb3,_0x17c6df[_0x100d('0x3c')]);return db[_0x100d('0x29')][_0x100d('0x43')](_0x5d7bb3)[_0x100d('0x20')](handleEntityNotFound(_0x5cf2ff,null))[_0x100d('0x20')](respondWithResult(_0x5cf2ff,null))[_0x100d('0x3e')](handleError(_0x5cf2ff,null));};exports[_0x100d('0x44')]=function(_0x28f94e,_0x389cbf){return db[_0x100d('0x29')]['create'](_0x28f94e[_0x100d('0x45')],{})[_0x100d('0x20')](respondWithResult(_0x389cbf,0xc9))[_0x100d('0x3e')](handleError(_0x389cbf,null));};exports[_0x100d('0x1f')]=function(_0x35e48d,_0x84efc1){if(_0x35e48d[_0x100d('0x45')]['id']){delete _0x35e48d[_0x100d('0x45')]['id'];}return db[_0x100d('0x29')][_0x100d('0x43')]({'where':{'id':_0x35e48d[_0x100d('0x40')]['id']}})[_0x100d('0x20')](handleEntityNotFound(_0x84efc1,null))[_0x100d('0x20')](saveUpdates(_0x35e48d[_0x100d('0x45')],null))['then'](respondWithResult(_0x84efc1,null))[_0x100d('0x3e')](handleError(_0x84efc1,null));};exports[_0x100d('0x21')]=function(_0x31dcd8,_0x10e9ef){return db[_0x100d('0x29')][_0x100d('0x43')]({'where':{'id':_0x31dcd8['params']['id']}})['then'](handleEntityNotFound(_0x10e9ef,null))[_0x100d('0x20')](removeEntity(_0x10e9ef,null))[_0x100d('0x3e')](handleError(_0x10e9ef,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index d78b319..0e75288 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 _0x0424=['define','ZohoField','int_zoho_fields','FieldId','../../config/logger','api','moment','bluebird','path','./intZohoField.attributes','exports'];(function(_0x499007,_0x58582e){var _0x3d8a7a=function(_0x1e0c6a){while(--_0x1e0c6a){_0x499007['push'](_0x499007['shift']());}};_0x3d8a7a(++_0x58582e);}(_0x0424,0x159));var _0x4042=function(_0x243f79,_0x429e45){_0x243f79=_0x243f79-0x0;var _0x460321=_0x0424[_0x243f79];return _0x460321;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));module[_0x4042('0x6')]=function(_0x472795,_0xc0fba0){return _0x472795[_0x4042('0x7')](_0x4042('0x8'),attributes,{'tableName':_0x4042('0x9'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x4042('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e3f=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x1d7300,_0x17f109){var _0x46ee98=function(_0x5ee16a){while(--_0x5ee16a){_0x1d7300['push'](_0x1d7300['shift']());}};_0x46ee98(++_0x17f109);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var logger=require(_0xf8e3('0x2'))('api');var moment=require(_0xf8e3('0x3'));var BPromise=require(_0xf8e3('0x4'));var rp=require(_0xf8e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var attributes=require('./intZohoField.attributes');module[_0xf8e3('0x8')]=function(_0xb21f8d,_0x2621c5){return _0xb21f8d[_0xf8e3('0x9')]('ZohoField',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[{'name':_0xf8e3('0xb'),'fields':[_0xf8e3('0xc'),_0xf8e3('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index a98ee3f..9c109d7 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 _0xdb1e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xdb1e,0xb2));var _0xedb1=function(_0x5138cd,_0x2b8708){_0x5138cd=_0x5138cd-0x0;var _0x1aff35=_0xdb1e[_0x5138cd];return _0x1aff35;};'use strict';var _=require(_0xedb1('0x0'));var util=require(_0xedb1('0x1'));var moment=require(_0xedb1('0x2'));var BPromise=require(_0xedb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedb1('0x4'))['db'];var utils=require(_0xedb1('0x5'));var logger=require(_0xedb1('0x6'))(_0xedb1('0x7'));var config=require(_0xedb1('0x8'));var jayson=require(_0xedb1('0x9'));var client=jayson[_0xedb1('0xa')][_0xedb1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f0599,_0x3f0029,_0x34f7b5){return new BPromise(function(_0x3f31dd,_0x482d30){return client[_0xedb1('0xc')](_0x4f0599,_0x34f7b5)[_0xedb1('0xd')](function(_0x5ce3d3){logger['info'](_0xedb1('0xe'),_0x3f0029,'request\x20sent');logger[_0xedb1('0xf')](_0xedb1('0x10'),_0x3f0029,'request\x20sent',JSON[_0xedb1('0x11')](_0x5ce3d3));if(_0x5ce3d3[_0xedb1('0x12')]){if(_0x5ce3d3[_0xedb1('0x12')]['code']===0x1f4){logger[_0xedb1('0x12')](_0xedb1('0xe'),_0x3f0029,_0x5ce3d3['error']['message']);return _0x482d30(_0x5ce3d3[_0xedb1('0x12')]['message']);}logger[_0xedb1('0x12')](_0xedb1('0xe'),_0x3f0029,_0x5ce3d3['error'][_0xedb1('0x13')]);return _0x3f31dd(_0x5ce3d3['error'][_0xedb1('0x13')]);}else{logger['info'](_0xedb1('0xe'),_0x3f0029,_0xedb1('0x14'));_0x3f31dd(_0x5ce3d3[_0xedb1('0x15')][_0xedb1('0x13')]);}})[_0xedb1('0x16')](function(_0x31a8f0){logger[_0xedb1('0x12')](_0xedb1('0xe'),_0x3f0029,_0x31a8f0);_0x482d30(_0x31a8f0);});});} \ No newline at end of file +var _0x021c=['message','result','catch','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s'];(function(_0xd63e34,_0x301b81){var _0x14147a=function(_0x18ca47){while(--_0x18ca47){_0xd63e34['push'](_0xd63e34['shift']());}};_0x14147a(++_0x301b81);}(_0x021c,0xea));var _0xc021=function(_0x5f12fd,_0x33c70d){_0x5f12fd=_0x5f12fd-0x0;var _0x58bd80=_0x021c[_0x5f12fd];return _0x58bd80;};'use strict';var _=require(_0xc021('0x0'));var util=require(_0xc021('0x1'));var moment=require(_0xc021('0x2'));var BPromise=require(_0xc021('0x3'));var rs=require(_0xc021('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc021('0x5'));var config=require(_0xc021('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc021('0x7')][_0xc021('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20db7a,_0x3e6a2c,_0x29c7fd){return new BPromise(function(_0x2c1e3f,_0x1cd631){return client['request'](_0x20db7a,_0x29c7fd)[_0xc021('0x9')](function(_0x139461){logger[_0xc021('0xa')]('ZohoField,\x20%s,\x20%s',_0x3e6a2c,_0xc021('0xb'));logger[_0xc021('0xc')](_0xc021('0xd'),_0x3e6a2c,_0xc021('0xb'),JSON[_0xc021('0xe')](_0x139461));if(_0x139461[_0xc021('0xf')]){if(_0x139461[_0xc021('0xf')][_0xc021('0x10')]===0x1f4){logger[_0xc021('0xf')](_0xc021('0x11'),_0x3e6a2c,_0x139461[_0xc021('0xf')][_0xc021('0x12')]);return _0x1cd631(_0x139461[_0xc021('0xf')][_0xc021('0x12')]);}logger[_0xc021('0xf')](_0xc021('0x11'),_0x3e6a2c,_0x139461[_0xc021('0xf')]['message']);return _0x2c1e3f(_0x139461[_0xc021('0xf')][_0xc021('0x12')]);}else{logger['info'](_0xc021('0x11'),_0x3e6a2c,_0xc021('0xb'));_0x2c1e3f(_0x139461[_0xc021('0x13')][_0xc021('0x12')]);}})[_0xc021('0x14')](function(_0xbb7087){logger[_0xc021('0xf')]('ZohoField,\x20%s,\x20%s',_0x3e6a2c,_0xbb7087);_0x1cd631(_0xbb7087);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index c359630..d0c38ef 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x564b60,_0x19dd4a){var _0x322362=function(_0x5e28de){while(--_0x5e28de){_0x564b60['push'](_0x564b60['shift']());}};_0x322362(++_0x19dd4a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0xcb91[_0x1a809b];return _0x5d90e6;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2d2d98,_0x3456fa){var _0x1895fe=function(_0x4670f6){while(--_0x4670f6){_0x2d2d98['push'](_0x2d2d98['shift']());}};_0x1895fe(++_0x3456fa);}(_0x70e0,0x17b));var _0x070e=function(_0x501a41,_0x50a0c0){_0x501a41=_0x501a41-0x0;var _0x11c50d=_0x70e0[_0x501a41];return _0x11c50d;};'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 01d63c5..68280ce 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 _0x6418=['STRING','app.js','INTEGER','BOOLEAN','state','exports','unique_name_and_version'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6418,0xfa));var _0x8641=function(_0x1f771b,_0x573f67){_0x1f771b=_0x1f771b-0x0;var _0xaf1e84=_0x6418[_0x1f771b];return _0xaf1e84;};'use strict';var Sequelize=require('sequelize');module[_0x8641('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8641('0x1')},'version':{'type':Sequelize[_0x8641('0x2')],'allowNull':![],'unique':_0x8641('0x1')},'main':{'type':Sequelize[_0x8641('0x2')],'defaultValue':_0x8641('0x3')},'filename':{'type':Sequelize[_0x8641('0x2')]},'path':{'type':Sequelize[_0x8641('0x2')]},'type':{'type':Sequelize[_0x8641('0x2')]},'size':{'type':Sequelize[_0x8641('0x4')]},'active':{'type':Sequelize[_0x8641('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x8641('0x2')]},'logo':{'type':Sequelize[_0x8641('0x2')]},'state':{'type':Sequelize[_0x8641('0x2')],'unique':_0x8641('0x6')},'description':{'type':Sequelize[_0x8641('0x2')]},'title':{'type':Sequelize[_0x8641('0x2')]},'remoteUri':{'type':Sequelize[_0x8641('0x2')]},'link':{'type':Sequelize[_0x8641('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x45d3=['unique_name_and_version','app.js','INTEGER','BOOLEAN','exports','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x45d3,0x148));var _0x345d=function(_0xae3c7e,_0x31c933){_0xae3c7e=_0xae3c7e-0x0;var _0x3bcd47=_0x45d3[_0xae3c7e];return _0x3bcd47;};'use strict';var Sequelize=require('sequelize');module[_0x345d('0x0')]={'name':{'type':Sequelize[_0x345d('0x1')],'allowNull':![],'unique':_0x345d('0x2')},'version':{'type':Sequelize[_0x345d('0x1')],'allowNull':![],'unique':_0x345d('0x2')},'main':{'type':Sequelize[_0x345d('0x1')],'defaultValue':_0x345d('0x3')},'filename':{'type':Sequelize[_0x345d('0x1')]},'path':{'type':Sequelize[_0x345d('0x1')]},'type':{'type':Sequelize[_0x345d('0x1')]},'size':{'type':Sequelize[_0x345d('0x4')]},'active':{'type':Sequelize[_0x345d('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x345d('0x1')]},'logo':{'type':Sequelize[_0x345d('0x1')]},'state':{'type':Sequelize[_0x345d('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x345d('0x1')]},'remoteUri':{'type':Sequelize[_0x345d('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index b73086d..f6684c4 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','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','body','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'];(function(_0x5bb718,_0x190cb7){var _0xf7bfa2=function(_0xc3d2c2){while(--_0xc3d2c2){_0x5bb718['push'](_0x5bb718['shift']());}};_0xf7bfa2(++_0x190cb7);}(_0x7a54,0x106));var _0x47a5=function(_0x134687,_0x20dbc7){_0x134687=_0x134687-0x0;var _0x2f2b7b=_0x7a54[_0x134687];return _0x2f2b7b;};'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['Integration'][_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['Integration']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['Integration']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x687b=['order','sort','where','filter','VIRTUAL','options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit'];(function(_0x18a71e,_0x1887ec){var _0x6a2ef7=function(_0x195001){while(--_0x195001){_0x18a71e['push'](_0x18a71e['shift']());}};_0x6a2ef7(++_0x1887ec);}(_0x687b,0x14a));var _0xb687=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x687b[_0x175a55];return _0x167adf;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['Integration'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['Integration']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 57256bc..f22d4d2 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 _0xd99b=['api','moment','bluebird','request-promise','rimraf','./integration.attributes','define','Integration','integrations','util','../../config/logger'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd99b,0x98));var _0xbd99=function(_0x4b2a99,_0x50f753){_0x4b2a99=_0x4b2a99-0x0;var _0x1b78f0=_0xd99b[_0x4b2a99];return _0x1b78f0;};'use strict';var _=require('lodash');var util=require(_0xbd99('0x0'));var logger=require(_0xbd99('0x1'))(_0xbd99('0x2'));var moment=require(_0xbd99('0x3'));var BPromise=require(_0xbd99('0x4'));var rp=require(_0xbd99('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd99('0x6'));var config=require('../../config/environment');var attributes=require(_0xbd99('0x7'));module['exports']=function(_0x31811a,_0x762243){return _0x31811a[_0xbd99('0x8')](_0xbd99('0x9'),attributes,{'tableName':_0xbd99('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3e5=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations'];(function(_0x38c38e,_0x5f4971){var _0x282c07=function(_0x55bd40){while(--_0x55bd40){_0x38c38e['push'](_0x38c38e['shift']());}};_0x282c07(++_0x5f4971);}(_0xa3e5,0x104));var _0x5a3e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa3e5[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x5a3e('0x0'));var util=require(_0x5a3e('0x1'));var logger=require(_0x5a3e('0x2'))('api');var moment=require(_0x5a3e('0x3'));var BPromise=require(_0x5a3e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5a3e('0x5'));var rimraf=require(_0x5a3e('0x6'));var config=require(_0x5a3e('0x7'));var attributes=require(_0x5a3e('0x8'));module[_0x5a3e('0x9')]=function(_0x3bd84e,_0xe68398){return _0x3bd84e[_0x5a3e('0xa')](_0x5a3e('0xb'),attributes,{'tableName':_0x5a3e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 6d67198..35dcdf9 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 _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2e12d1,_0x28b537){var _0x145958=function(_0x39499e){while(--_0x39499e){_0x2e12d1['push'](_0x2e12d1['shift']());}};_0x145958(++_0x28b537);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x266aa5,_0x5f477a){_0x266aa5=_0x266aa5-0x0;var _0x655791=_0xc6ac[_0x266aa5];return _0x655791;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0x0295=['client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','Integration,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ead7c,_0x2fade1){var _0x1fd95c=function(_0x3b1989){while(--_0x3b1989){_0x2ead7c['push'](_0x2ead7c['shift']());}};_0x1fd95c(++_0x2fade1);}(_0x0295,0x1f0));var _0x5029=function(_0x5a559c,_0xb34e0b){_0x5a559c=_0x5a559c-0x0;var _0x1a4bd9=_0x0295[_0x5a559c];return _0x1a4bd9;};'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')]('Integration,\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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 6e641ea..468e9e1 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 _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x121f61,_0x5174fc){var _0x393306=function(_0xc9dfde){while(--_0xc9dfde){_0x121f61['push'](_0x121f61['shift']());}};_0x393306(++_0x5174fc);}(_0x66fa,0x117));var _0xa66f=function(_0x4d6733,_0x2cee2e){_0x4d6733=_0x4d6733-0x0;var _0x547ad0=_0x66fa[_0x4d6733];return _0x547ad0;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file +var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x4d7433,_0x225b4f){var _0x23917d=function(_0x44d290){while(--_0x44d290){_0x4d7433['push'](_0x4d7433['shift']());}};_0x23917d(++_0x225b4f);}(_0x9f0e,0x116));var _0xe9f0=function(_0x285b29,_0x33f46a){_0x285b29=_0x285b29-0x0;var _0x2432d0=_0x9f0e[_0x285b29];return _0x2432d0;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index e03e1c4..eeb7a99 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 _0x2f74=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','exports','STRING'];(function(_0x59b9d3,_0x384472){var _0x171163=function(_0x251233){while(--_0x251233){_0x59b9d3['push'](_0x59b9d3['shift']());}};_0x171163(++_0x384472);}(_0x2f74,0xfb));var _0x42f7=function(_0x36a236,_0x3cc5fc){_0x36a236=_0x36a236-0x0;var _0xa4ab27=_0x2f74[_0x36a236];return _0xa4ab27;};'use strict';var Sequelize=require('sequelize');module[_0x42f7('0x0')]={'integration':{'type':Sequelize[_0x42f7('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x42f7('0x1')]},'integrationId':{'type':Sequelize[_0x42f7('0x2')]},'contacts':{'type':Sequelize[_0x42f7('0x1')]},'uniqueid':{'type':Sequelize[_0x42f7('0x1')]},'calleridnum':{'type':Sequelize[_0x42f7('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x42f7('0x1')]},'interface':{'type':Sequelize[_0x42f7('0x1')]},'membername':{'type':Sequelize[_0x42f7('0x1')]},'agentcalledAt':{'type':Sequelize[_0x42f7('0x3')]},'agentconnectAt':{'type':Sequelize[_0x42f7('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x42f7('0x3')]},'talktime':{'type':Sequelize[_0x42f7('0x2')]},'agentacw':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x42f7('0x2')]},'reason':{'type':Sequelize[_0x42f7('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x42f7('0x3')]},'lastevent':{'type':Sequelize[_0x42f7('0x1')]},'channel':{'type':Sequelize[_0x42f7('0x1')]},'channelstate':{'type':Sequelize[_0x42f7('0x2')]},'channelstatedesc':{'type':Sequelize[_0x42f7('0x1')]},'connectedlinenum':{'type':Sequelize[_0x42f7('0x1')]},'connectedlinename':{'type':Sequelize[_0x42f7('0x1')]},'language':{'type':Sequelize[_0x42f7('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x42f7('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x42f7('0x1')]},'destchannel':{'type':Sequelize[_0x42f7('0x1')]},'destchannelstate':{'type':Sequelize[_0x42f7('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x42f7('0x1')]},'destcalleridnum':{'type':Sequelize[_0x42f7('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x42f7('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x42f7('0x1')]},'destlanguage':{'type':Sequelize[_0x42f7('0x1')]},'destaccountcode':{'type':Sequelize[_0x42f7('0x1')]},'destcontext':{'type':Sequelize[_0x42f7('0x1')]},'destexten':{'type':Sequelize[_0x42f7('0x1')]},'destpriority':{'type':Sequelize[_0x42f7('0x1')]},'destuniqueid':{'type':Sequelize[_0x42f7('0x1')]},'messageId':{'type':Sequelize[_0x42f7('0x1')]},'inReplyTo':{'type':Sequelize[_0x42f7('0x1')]},'subject':{'type':Sequelize[_0x42f7('0x1')]},'from':{'type':Sequelize[_0x42f7('0x1')]},'to':{'type':Sequelize[_0x42f7('0x1')]},'cc':{'type':Sequelize[_0x42f7('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x42f7('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x42f7('0x6')](_0x42f7('0x7'),_0x42f7('0x8'),_0x42f7('0x9'),_0x42f7('0xa'))},'url':{'type':Sequelize[_0x42f7('0x1')]},'app':{'type':Sequelize[_0x42f7('0x1')]},'appdata':{'type':Sequelize[_0x42f7('0x1')]},'projectId':{'type':Sequelize[_0x42f7('0x2')]}}; \ No newline at end of file +var _0x3054=['BOOLEAN','DATE','TEXT','ENUM','SENDING','RECEIVED','FAILED','sequelize','STRING','INTEGER'];(function(_0x36b2f4,_0x1904f){var _0x5a690b=function(_0x15bf1f){while(--_0x15bf1f){_0x36b2f4['push'](_0x36b2f4['shift']());}};_0x5a690b(++_0x1904f);}(_0x3054,0x18d));var _0x4305=function(_0x125918,_0x382dad){_0x125918=_0x125918-0x0;var _0xc7807f=_0x3054[_0x125918];return _0xc7807f;};'use strict';var Sequelize=require(_0x4305('0x0'));module['exports']={'integration':{'type':Sequelize[_0x4305('0x1')]},'eventChannel':{'type':Sequelize[_0x4305('0x1')]},'exitStatus':{'type':Sequelize[_0x4305('0x1')]},'ticketId':{'type':Sequelize[_0x4305('0x1')]},'integrationId':{'type':Sequelize[_0x4305('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4305('0x1')]},'calleridnum':{'type':Sequelize[_0x4305('0x1')]},'calleridname':{'type':Sequelize[_0x4305('0x1')]},'queue':{'type':Sequelize[_0x4305('0x1')]},'interface':{'type':Sequelize[_0x4305('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4305('0x2')]},'agentcomplete':{'type':Sequelize[_0x4305('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4305('0x4')]},'talktime':{'type':Sequelize[_0x4305('0x2')]},'agentacw':{'type':Sequelize[_0x4305('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x4305('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x4305('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4305('0x4')]},'agentdump':{'type':Sequelize[_0x4305('0x3')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4305('0x4')]},'lastevent':{'type':Sequelize[_0x4305('0x1')]},'channel':{'type':Sequelize[_0x4305('0x1')]},'channelstate':{'type':Sequelize[_0x4305('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4305('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4305('0x1')]},'connectedlinename':{'type':Sequelize[_0x4305('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4305('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4305('0x1')]},'priority':{'type':Sequelize[_0x4305('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x4305('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x4305('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x4305('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x4305('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x4305('0x1')]},'destlanguage':{'type':Sequelize[_0x4305('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x4305('0x1')]},'destexten':{'type':Sequelize[_0x4305('0x1')]},'destpriority':{'type':Sequelize[_0x4305('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x4305('0x1')]},'inReplyTo':{'type':Sequelize[_0x4305('0x1')]},'subject':{'type':Sequelize[_0x4305('0x1')]},'from':{'type':Sequelize[_0x4305('0x1')]},'to':{'type':Sequelize[_0x4305('0x1')]},'cc':{'type':Sequelize[_0x4305('0x1')]},'attachment':{'type':Sequelize[_0x4305('0x5')]},'html':{'type':Sequelize[_0x4305('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x4305('0x6')]('SENT',_0x4305('0x7'),_0x4305('0x8'),_0x4305('0x9'))},'url':{'type':Sequelize[_0x4305('0x1')]},'app':{'type':Sequelize[_0x4305('0x1')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b53f3d2..0884a1f 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 _0xf0d2=['create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','rows','rawAttributes','length','find','catch'];(function(_0x173717,_0xc4974e){var _0x508533=function(_0x17e65c){while(--_0x17e65c){_0x173717['push'](_0x173717['shift']());}};_0x508533(++_0xc4974e);}(_0xf0d2,0xe2));var _0x2f0d=function(_0x371ca3,_0x57c221){_0x371ca3=_0x371ca3-0x0;var _0x57bb17=_0xf0d2[_0x371ca3];return _0x57bb17;};'use strict';var emlformat=require(_0x2f0d('0x0'));var rimraf=require(_0x2f0d('0x1'));var zipdir=require(_0x2f0d('0x2'));var jsonpatch=require(_0x2f0d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2f0d('0x4'));var Mustache=require('mustache');var util=require(_0x2f0d('0x5'));var path=require(_0x2f0d('0x6'));var sox=require('sox');var csv=require(_0x2f0d('0x7'));var ejs=require(_0x2f0d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f0d('0x9'));var squel=require(_0x2f0d('0xa'));var crypto=require(_0x2f0d('0xb'));var jsforce=require(_0x2f0d('0xc'));var deskjs=require(_0x2f0d('0xd'));var toCsv=require(_0x2f0d('0x7'));var querystring=require(_0x2f0d('0xe'));var Papa=require('papaparse');var Redis=require(_0x2f0d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2f0d('0x10'));var as=require(_0x2f0d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f0d('0x12'))('api');var utils=require(_0x2f0d('0x13'));var config=require(_0x2f0d('0x14'));var licenseUtil=require(_0x2f0d('0x15'));var db=require(_0x2f0d('0x16'))['db'];function respondWithStatusCode(_0x4afda1,_0x363f28){_0x363f28=_0x363f28||0xcc;return function(_0x3b01cd){if(_0x3b01cd){return _0x4afda1['sendStatus'](_0x363f28);}return _0x4afda1[_0x2f0d('0x17')](_0x363f28)['end']();};}function respondWithResult(_0x55b6ea,_0x2c4944){_0x2c4944=_0x2c4944||0xc8;return function(_0x48771c){if(_0x48771c){return _0x55b6ea[_0x2f0d('0x17')](_0x2c4944)[_0x2f0d('0x18')](_0x48771c);}};}function respondWithFilteredResult(_0x4248a8,_0x3e9320){return function(_0x51fa31){if(_0x51fa31){var _0x368f09=typeof _0x3e9320[_0x2f0d('0x19')]===_0x2f0d('0x1a')&&typeof _0x3e9320['limit']==='undefined';var _0x4c1567=_0x51fa31[_0x2f0d('0x1b')];var _0x10d8d1=_0x368f09?0x0:_0x3e9320[_0x2f0d('0x19')];var _0x5135b3=_0x368f09?_0x51fa31['count']:_0x3e9320[_0x2f0d('0x19')]+_0x3e9320[_0x2f0d('0x1c')];var _0x1d2314;if(_0x5135b3>=_0x4c1567){_0x5135b3=_0x4c1567;_0x1d2314=0xc8;}else{_0x1d2314=0xce;}_0x4248a8[_0x2f0d('0x17')](_0x1d2314);return _0x4248a8[_0x2f0d('0x1d')]('Content-Range',_0x10d8d1+'-'+_0x5135b3+'/'+_0x4c1567)['json'](_0x51fa31);}return null;};}function patchUpdates(_0x1ebc9a){return function(_0x5e3366){try{jsonpatch[_0x2f0d('0x1e')](_0x5e3366,_0x1ebc9a,!![]);}catch(_0x35a391){return BPromise[_0x2f0d('0x1f')](_0x35a391);}return _0x5e3366['save']();};}function saveUpdates(_0x47089a,_0x43288a){return function(_0x2cfb45){if(_0x2cfb45){return _0x2cfb45[_0x2f0d('0x20')](_0x47089a)[_0x2f0d('0x21')](function(_0x4275a4){return _0x4275a4;});}return null;};}function removeEntity(_0x57b306,_0x4403e8){return function(_0x5e6b57){if(_0x5e6b57){return _0x5e6b57[_0x2f0d('0x22')]()['then'](function(){_0x57b306[_0x2f0d('0x17')](0xcc)[_0x2f0d('0x23')]();});}};}function handleEntityNotFound(_0x3bd67a,_0xc60a93){return function(_0x439a8e){if(!_0x439a8e){_0x3bd67a[_0x2f0d('0x24')](0x194);}return _0x439a8e;};}function handleError(_0x33c140,_0x1baf24){_0x1baf24=_0x1baf24||0x1f4;return function(_0x4bca2a){logger[_0x2f0d('0x25')](_0x4bca2a[_0x2f0d('0x26')]);if(_0x4bca2a[_0x2f0d('0x27')]){delete _0x4bca2a[_0x2f0d('0x27')];}_0x33c140[_0x2f0d('0x17')](_0x1baf24)[_0x2f0d('0x28')](_0x4bca2a);};}exports[_0x2f0d('0x29')]=function(_0x9e3aa0,_0x116eaa){var _0x18b933={},_0x5223ce={},_0x1c09ef={'count':0x0,'rows':[]};var _0x31cee7=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x110b7c){return{'name':_0x110b7c['fieldName'],'type':_0x110b7c[_0x2f0d('0x2a')][_0x2f0d('0x2b')]};});_0x5223ce[_0x2f0d('0x2c')]=_[_0x2f0d('0x2d')](_0x31cee7,_0x2f0d('0x27'));_0x5223ce[_0x2f0d('0x2e')]=_[_0x2f0d('0x2f')](_0x9e3aa0['query']);_0x5223ce[_0x2f0d('0x30')]=_[_0x2f0d('0x31')](_0x5223ce[_0x2f0d('0x2c')],_0x5223ce[_0x2f0d('0x2e')]);_0x18b933[_0x2f0d('0x32')]=_[_0x2f0d('0x31')](_0x5223ce[_0x2f0d('0x2c')],qs['fields'](_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x33')]));_0x18b933[_0x2f0d('0x32')]=_0x18b933['attributes']['length']?_0x18b933[_0x2f0d('0x32')]:_0x5223ce['model'];if(!_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x34')]('nolimit')){_0x18b933[_0x2f0d('0x1c')]=qs[_0x2f0d('0x1c')](_0x9e3aa0['query'][_0x2f0d('0x1c')]);_0x18b933[_0x2f0d('0x19')]=qs[_0x2f0d('0x19')](_0x9e3aa0[_0x2f0d('0x2e')]['offset']);}_0x18b933[_0x2f0d('0x35')]=qs[_0x2f0d('0x36')](_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x36')]);_0x18b933[_0x2f0d('0x37')]=qs['filters'](_[_0x2f0d('0x38')](_0x9e3aa0[_0x2f0d('0x2e')],_0x5223ce[_0x2f0d('0x30')]),_0x31cee7);if(_0x9e3aa0['query'][_0x2f0d('0x39')]){_0x18b933[_0x2f0d('0x37')]=_[_0x2f0d('0x3a')](_0x18b933['where'],{'$or':_[_0x2f0d('0x2d')](_0x31cee7,function(_0x2cfb0a){if(_0x2cfb0a[_0x2f0d('0x2a')]!==_0x2f0d('0x3b')){var _0x5bdf5e={};_0x5bdf5e[_0x2cfb0a[_0x2f0d('0x27')]]={'$like':'%'+_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x39')]+'%'};return _0x5bdf5e;}})});}_0x18b933=_[_0x2f0d('0x3a')]({},_0x18b933,_0x9e3aa0[_0x2f0d('0x3c')]);var _0x270649={'where':_0x18b933[_0x2f0d('0x37')]};return db[_0x2f0d('0x3d')][_0x2f0d('0x1b')](_0x270649)[_0x2f0d('0x21')](function(_0x43e685){_0x1c09ef['count']=_0x43e685;if(_0x9e3aa0[_0x2f0d('0x2e')][_0x2f0d('0x3e')]){_0x18b933[_0x2f0d('0x3f')]=[{'all':!![]}];}return db[_0x2f0d('0x3d')][_0x2f0d('0x40')](_0x18b933);})[_0x2f0d('0x21')](function(_0x33d1e0){_0x1c09ef[_0x2f0d('0x41')]=_0x33d1e0;return _0x1c09ef;})['then'](respondWithFilteredResult(_0x116eaa,_0x18b933))['catch'](handleError(_0x116eaa,null));};exports['show']=function(_0x33cec2,_0x519fcd){var _0x4532ab={'raw':![],'where':{'id':_0x33cec2['params']['id']}},_0x356c62={};_0x356c62[_0x2f0d('0x2c')]=_[_0x2f0d('0x2f')](db['IntegrationReport'][_0x2f0d('0x42')]);_0x356c62[_0x2f0d('0x2e')]=_[_0x2f0d('0x2f')](_0x33cec2[_0x2f0d('0x2e')]);_0x356c62['filters']=_[_0x2f0d('0x31')](_0x356c62[_0x2f0d('0x2c')],_0x356c62[_0x2f0d('0x2e')]);_0x4532ab[_0x2f0d('0x32')]=_['intersection'](_0x356c62[_0x2f0d('0x2c')],qs[_0x2f0d('0x33')](_0x33cec2[_0x2f0d('0x2e')][_0x2f0d('0x33')]));_0x4532ab[_0x2f0d('0x32')]=_0x4532ab[_0x2f0d('0x32')][_0x2f0d('0x43')]?_0x4532ab[_0x2f0d('0x32')]:_0x356c62['model'];if(_0x33cec2['query'][_0x2f0d('0x3e')]){_0x4532ab[_0x2f0d('0x3f')]=[{'all':!![]}];}_0x4532ab=_[_0x2f0d('0x3a')]({},_0x4532ab,_0x33cec2[_0x2f0d('0x3c')]);return db['IntegrationReport'][_0x2f0d('0x44')](_0x4532ab)['then'](handleEntityNotFound(_0x519fcd,null))[_0x2f0d('0x21')](respondWithResult(_0x519fcd,null))[_0x2f0d('0x45')](handleError(_0x519fcd,null));};exports[_0x2f0d('0x46')]=function(_0x201f09,_0x160b1a){return db[_0x2f0d('0x3d')][_0x2f0d('0x46')](_0x201f09[_0x2f0d('0x47')],{})[_0x2f0d('0x21')](respondWithResult(_0x160b1a,0xc9))[_0x2f0d('0x45')](handleError(_0x160b1a,null));};exports['update']=function(_0x1a57ca,_0x530cce){if(_0x1a57ca['body']['id']){delete _0x1a57ca[_0x2f0d('0x47')]['id'];}return db[_0x2f0d('0x3d')][_0x2f0d('0x44')]({'where':{'id':_0x1a57ca[_0x2f0d('0x48')]['id']}})[_0x2f0d('0x21')](handleEntityNotFound(_0x530cce,null))[_0x2f0d('0x21')](saveUpdates(_0x1a57ca[_0x2f0d('0x47')],null))[_0x2f0d('0x21')](respondWithResult(_0x530cce,null))[_0x2f0d('0x45')](handleError(_0x530cce,null));};exports[_0x2f0d('0x22')]=function(_0x1c4c7b,_0x1a9122){return db['IntegrationReport'][_0x2f0d('0x44')]({'where':{'id':_0x1c4c7b['params']['id']}})['then'](handleEntityNotFound(_0x1a9122,null))[_0x2f0d('0x21')](removeEntity(_0x1a9122,null))[_0x2f0d('0x45')](handleError(_0x1a9122,null));};exports[_0x2f0d('0x49')]=function(_0x38ac36,_0x51338c){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0x51338c,null))[_0x2f0d('0x45')](handleError(_0x51338c,null));}; \ No newline at end of file +var _0xae27=['../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','error','send','index','map','rawAttributes','fieldName','type','name','keys','query','filters','intersection','model','attributes','fields','length','order','sort','pick','where','merge','VIRTUAL','filter','options','IntegrationReport','includeAll','findAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xae27,0x7c));var _0x7ae2=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xae27[_0x4f1da5];return _0xe972a8;};'use strict';var emlformat=require(_0x7ae2('0x0'));var rimraf=require(_0x7ae2('0x1'));var zipdir=require(_0x7ae2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7ae2('0x3'));var moment=require(_0x7ae2('0x4'));var BPromise=require(_0x7ae2('0x5'));var Mustache=require(_0x7ae2('0x6'));var util=require('util');var path=require(_0x7ae2('0x7'));var sox=require(_0x7ae2('0x8'));var csv=require(_0x7ae2('0x9'));var ejs=require(_0x7ae2('0xa'));var fs=require('fs');var fs_extra=require(_0x7ae2('0xb'));var _=require('lodash');var squel=require(_0x7ae2('0xc'));var crypto=require(_0x7ae2('0xd'));var jsforce=require(_0x7ae2('0xe'));var deskjs=require(_0x7ae2('0xf'));var toCsv=require(_0x7ae2('0x9'));var querystring=require(_0x7ae2('0x10'));var Papa=require(_0x7ae2('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7ae2('0x12'));var as=require(_0x7ae2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7ae2('0x14'))(_0x7ae2('0x15'));var utils=require(_0x7ae2('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7ae2('0x17'))['db'];function respondWithStatusCode(_0x4ed677,_0xcf3b44){_0xcf3b44=_0xcf3b44||0xcc;return function(_0x4cf82a){if(_0x4cf82a){return _0x4ed677[_0x7ae2('0x18')](_0xcf3b44);}return _0x4ed677['status'](_0xcf3b44)[_0x7ae2('0x19')]();};}function respondWithResult(_0x4af4ff,_0x2ca9c5){_0x2ca9c5=_0x2ca9c5||0xc8;return function(_0x44b1ad){if(_0x44b1ad){return _0x4af4ff[_0x7ae2('0x1a')](_0x2ca9c5)[_0x7ae2('0x1b')](_0x44b1ad);}};}function respondWithFilteredResult(_0x1c03f5,_0x73e7f8){return function(_0x2e1766){if(_0x2e1766){var _0x22b0ec=typeof _0x73e7f8[_0x7ae2('0x1c')]===_0x7ae2('0x1d')&&typeof _0x73e7f8[_0x7ae2('0x1e')]===_0x7ae2('0x1d');var _0xf07d27=_0x2e1766[_0x7ae2('0x1f')];var _0xcc15f8=_0x22b0ec?0x0:_0x73e7f8[_0x7ae2('0x1c')];var _0x29a8c4=_0x22b0ec?_0x2e1766[_0x7ae2('0x1f')]:_0x73e7f8[_0x7ae2('0x1c')]+_0x73e7f8[_0x7ae2('0x1e')];var _0x33318a;if(_0x29a8c4>=_0xf07d27){_0x29a8c4=_0xf07d27;_0x33318a=0xc8;}else{_0x33318a=0xce;}_0x1c03f5['status'](_0x33318a);return _0x1c03f5['set']('Content-Range',_0xcc15f8+'-'+_0x29a8c4+'/'+_0xf07d27)[_0x7ae2('0x1b')](_0x2e1766);}return null;};}function patchUpdates(_0x666b87){return function(_0x138bbe){try{jsonpatch[_0x7ae2('0x20')](_0x138bbe,_0x666b87,!![]);}catch(_0x3f4770){return BPromise['reject'](_0x3f4770);}return _0x138bbe[_0x7ae2('0x21')]();};}function saveUpdates(_0x15a0d8,_0x38bae4){return function(_0x5a88c4){if(_0x5a88c4){return _0x5a88c4[_0x7ae2('0x22')](_0x15a0d8)[_0x7ae2('0x23')](function(_0x4bf5e6){return _0x4bf5e6;});}return null;};}function removeEntity(_0x53d438,_0x51a4ae){return function(_0x2e6008){if(_0x2e6008){return _0x2e6008[_0x7ae2('0x24')]()['then'](function(){_0x53d438[_0x7ae2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d5fd2,_0x4d76a8){return function(_0x559e89){if(!_0x559e89){_0x3d5fd2[_0x7ae2('0x18')](0x194);}return _0x559e89;};}function handleError(_0x15489f,_0x38ba91){_0x38ba91=_0x38ba91||0x1f4;return function(_0x12252d){logger[_0x7ae2('0x25')](_0x12252d['stack']);if(_0x12252d['name']){delete _0x12252d['name'];}_0x15489f['status'](_0x38ba91)[_0x7ae2('0x26')](_0x12252d);};}exports[_0x7ae2('0x27')]=function(_0x1033cd,_0x42e858){var _0x2621ec={},_0x131cba={},_0x2944f3={'count':0x0,'rows':[]};var _0x42ca1a=_[_0x7ae2('0x28')](db['IntegrationReport'][_0x7ae2('0x29')],function(_0x5397c7){return{'name':_0x5397c7[_0x7ae2('0x2a')],'type':_0x5397c7[_0x7ae2('0x2b')]['key']};});_0x131cba['model']=_['map'](_0x42ca1a,_0x7ae2('0x2c'));_0x131cba['query']=_[_0x7ae2('0x2d')](_0x1033cd[_0x7ae2('0x2e')]);_0x131cba[_0x7ae2('0x2f')]=_[_0x7ae2('0x30')](_0x131cba[_0x7ae2('0x31')],_0x131cba[_0x7ae2('0x2e')]);_0x2621ec[_0x7ae2('0x32')]=_[_0x7ae2('0x30')](_0x131cba[_0x7ae2('0x31')],qs['fields'](_0x1033cd['query'][_0x7ae2('0x33')]));_0x2621ec['attributes']=_0x2621ec[_0x7ae2('0x32')][_0x7ae2('0x34')]?_0x2621ec[_0x7ae2('0x32')]:_0x131cba[_0x7ae2('0x31')];if(!_0x1033cd[_0x7ae2('0x2e')]['hasOwnProperty']('nolimit')){_0x2621ec['limit']=qs[_0x7ae2('0x1e')](_0x1033cd['query'][_0x7ae2('0x1e')]);_0x2621ec[_0x7ae2('0x1c')]=qs[_0x7ae2('0x1c')](_0x1033cd[_0x7ae2('0x2e')]['offset']);}_0x2621ec[_0x7ae2('0x35')]=qs[_0x7ae2('0x36')](_0x1033cd['query'][_0x7ae2('0x36')]);_0x2621ec['where']=qs[_0x7ae2('0x2f')](_[_0x7ae2('0x37')](_0x1033cd['query'],_0x131cba[_0x7ae2('0x2f')]),_0x42ca1a);if(_0x1033cd[_0x7ae2('0x2e')]['filter']){_0x2621ec[_0x7ae2('0x38')]=_[_0x7ae2('0x39')](_0x2621ec['where'],{'$or':_[_0x7ae2('0x28')](_0x42ca1a,function(_0x34b720){if(_0x34b720[_0x7ae2('0x2b')]!==_0x7ae2('0x3a')){var _0x183833={};_0x183833[_0x34b720[_0x7ae2('0x2c')]]={'$like':'%'+_0x1033cd[_0x7ae2('0x2e')][_0x7ae2('0x3b')]+'%'};return _0x183833;}})});}_0x2621ec=_[_0x7ae2('0x39')]({},_0x2621ec,_0x1033cd[_0x7ae2('0x3c')]);var _0x1980ac={'where':_0x2621ec['where']};return db[_0x7ae2('0x3d')][_0x7ae2('0x1f')](_0x1980ac)[_0x7ae2('0x23')](function(_0x3ec5c6){_0x2944f3[_0x7ae2('0x1f')]=_0x3ec5c6;if(_0x1033cd[_0x7ae2('0x2e')][_0x7ae2('0x3e')]){_0x2621ec['include']=[{'all':!![]}];}return db[_0x7ae2('0x3d')][_0x7ae2('0x3f')](_0x2621ec);})[_0x7ae2('0x23')](function(_0x324b9e){_0x2944f3[_0x7ae2('0x40')]=_0x324b9e;return _0x2944f3;})[_0x7ae2('0x23')](respondWithFilteredResult(_0x42e858,_0x2621ec))[_0x7ae2('0x41')](handleError(_0x42e858,null));};exports[_0x7ae2('0x42')]=function(_0x46705c,_0x2c19e2){var _0x33c838={'raw':![],'where':{'id':_0x46705c[_0x7ae2('0x43')]['id']}},_0x45f847={};_0x45f847[_0x7ae2('0x31')]=_['keys'](db[_0x7ae2('0x3d')][_0x7ae2('0x29')]);_0x45f847['query']=_[_0x7ae2('0x2d')](_0x46705c[_0x7ae2('0x2e')]);_0x45f847['filters']=_[_0x7ae2('0x30')](_0x45f847['model'],_0x45f847[_0x7ae2('0x2e')]);_0x33c838[_0x7ae2('0x32')]=_[_0x7ae2('0x30')](_0x45f847[_0x7ae2('0x31')],qs['fields'](_0x46705c['query'][_0x7ae2('0x33')]));_0x33c838['attributes']=_0x33c838['attributes']['length']?_0x33c838[_0x7ae2('0x32')]:_0x45f847['model'];if(_0x46705c[_0x7ae2('0x2e')][_0x7ae2('0x3e')]){_0x33c838[_0x7ae2('0x44')]=[{'all':!![]}];}_0x33c838=_[_0x7ae2('0x39')]({},_0x33c838,_0x46705c[_0x7ae2('0x3c')]);return db['IntegrationReport']['find'](_0x33c838)[_0x7ae2('0x23')](handleEntityNotFound(_0x2c19e2,null))[_0x7ae2('0x23')](respondWithResult(_0x2c19e2,null))[_0x7ae2('0x41')](handleError(_0x2c19e2,null));};exports[_0x7ae2('0x45')]=function(_0x4ea9a8,_0x3550e3){return db[_0x7ae2('0x3d')][_0x7ae2('0x45')](_0x4ea9a8[_0x7ae2('0x46')],{})[_0x7ae2('0x23')](respondWithResult(_0x3550e3,0xc9))[_0x7ae2('0x41')](handleError(_0x3550e3,null));};exports[_0x7ae2('0x22')]=function(_0x3810a5,_0x275b59){if(_0x3810a5[_0x7ae2('0x46')]['id']){delete _0x3810a5[_0x7ae2('0x46')]['id'];}return db[_0x7ae2('0x3d')]['find']({'where':{'id':_0x3810a5[_0x7ae2('0x43')]['id']}})[_0x7ae2('0x23')](handleEntityNotFound(_0x275b59,null))[_0x7ae2('0x23')](saveUpdates(_0x3810a5[_0x7ae2('0x46')],null))[_0x7ae2('0x23')](respondWithResult(_0x275b59,null))['catch'](handleError(_0x275b59,null));};exports[_0x7ae2('0x24')]=function(_0x47d95b,_0x1ab330){return db['IntegrationReport'][_0x7ae2('0x47')]({'where':{'id':_0x47d95b[_0x7ae2('0x43')]['id']}})[_0x7ae2('0x23')](handleEntityNotFound(_0x1ab330,null))['then'](removeEntity(_0x1ab330,null))[_0x7ae2('0x41')](handleError(_0x1ab330,null));};exports[_0x7ae2('0x48')]=function(_0x5721d4,_0xb90197){return db['IntegrationReport'][_0x7ae2('0x48')]()[_0x7ae2('0x23')](respondWithResult(_0xb90197,null))['catch'](handleError(_0xb90197,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index bcfba56..904ed6b 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 _0x9a90=['../../config/logger','api','moment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x9a90,0x1ac));var _0x09a9=function(_0x430e42,_0x337aa7){_0x430e42=_0x430e42-0x0;var _0x3fd4f5=_0x9a90[_0x430e42];return _0x3fd4f5;};'use strict';var _=require(_0x09a9('0x0'));var util=require(_0x09a9('0x1'));var logger=require(_0x09a9('0x2'))(_0x09a9('0x3'));var moment=require(_0x09a9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x09a9('0x5'));module[_0x09a9('0x6')]=function(_0x1de663,_0x232864){return _0x1de663[_0x09a9('0x7')](_0x09a9('0x8'),attributes,{'tableName':_0x09a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf928=['../../config/environment','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x311949,_0x52887f){var _0x342b4b=function(_0x535413){while(--_0x535413){_0x311949['push'](_0x311949['shift']());}};_0x342b4b(++_0x52887f);}(_0xf928,0xc9));var _0x8f92=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf928[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8f92('0x0'));var util=require(_0x8f92('0x1'));var logger=require(_0x8f92('0x2'))(_0x8f92('0x3'));var moment=require('moment');var BPromise=require(_0x8f92('0x4'));var rp=require(_0x8f92('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f92('0x6'));var config=require(_0x8f92('0x7'));var attributes=require(_0x8f92('0x8'));module[_0x8f92('0x9')]=function(_0x1f5ed2,_0x5e20b5){return _0x1f5ed2[_0x8f92('0xa')](_0x8f92('0xb'),attributes,{'tableName':_0x8f92('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index da17a7d..391d774 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 _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0x1967,0x173));var _0x7196=function(_0x125487,_0x1d6879){_0x125487=_0x125487-0x0;var _0x5af268=_0x1967[_0x125487];return _0x5af268;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x39bb52,_0x10116e){var _0x2f5d30=function(_0x1ec7b3){while(--_0x1ec7b3){_0x39bb52['push'](_0x39bb52['shift']());}};_0x2f5d30(++_0x10116e);}(_0xba34,0x119));var _0x4ba3=function(_0x15b8e0,_0x58a513){_0x15b8e0=_0x15b8e0-0x0;var _0x1a4c9c=_0xba34[_0x15b8e0];return _0x1a4c9c;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 5275eb4..5e35b9f 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 _0xd7ff=['express','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x59f719,_0x11d1a2){var _0x4f76ea=function(_0xc2c2c){while(--_0xc2c2c){_0x59f719['push'](_0x59f719['shift']());}};_0x4f76ea(++_0x11d1a2);}(_0xd7ff,0x100));var _0xfd7f=function(_0x5044b8,_0x15622f){_0x5044b8=_0x5044b8-0x0;var _0x23adf6=_0xd7ff[_0x5044b8];return _0x23adf6;};'use strict';var multer=require(_0xfd7f('0x0'));var util=require(_0xfd7f('0x1'));var path=require(_0xfd7f('0x2'));var timeout=require(_0xfd7f('0x3'));var express=require(_0xfd7f('0x4'));var router=express[_0xfd7f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfd7f('0x6'));var config=require(_0xfd7f('0x7'));var controller=require(_0xfd7f('0x8'));router[_0xfd7f('0x9')]('/',auth['isAuthenticated'](),controller[_0xfd7f('0xa')]);router[_0xfd7f('0x9')](_0xfd7f('0xb'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0xd')]);router[_0xfd7f('0x9')](_0xfd7f('0xe'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0xf')]);router[_0xfd7f('0x10')]('/',auth[_0xfd7f('0xc')](),controller[_0xfd7f('0x11')]);router[_0xfd7f('0x10')](_0xfd7f('0xe'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0x12')]);router['post'](_0xfd7f('0x13'),auth['isAuthenticated'](),controller[_0xfd7f('0x14')]);router[_0xfd7f('0x15')](_0xfd7f('0xb'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0x16')]);router[_0xfd7f('0x17')](_0xfd7f('0xb'),auth[_0xfd7f('0xc')](),controller[_0xfd7f('0x18')]);module[_0xfd7f('0x19')]=router; \ No newline at end of file +var _0x4508=['get','isAuthenticated','show','post','create','/:id/sub_intervals','addInterval','addIntervals','put','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4508,0x1ef));var _0x8450=function(_0x3ad938,_0x34040d){_0x3ad938=_0x3ad938-0x0;var _0x3d4f90=_0x4508[_0x3ad938];return _0x3d4f90;};'use strict';var multer=require('multer');var util=require(_0x8450('0x0'));var path=require(_0x8450('0x1'));var timeout=require(_0x8450('0x2'));var express=require('express');var router=express[_0x8450('0x3')]();var fs_extra=require(_0x8450('0x4'));var auth=require(_0x8450('0x5'));var interaction=require(_0x8450('0x6'));var config=require(_0x8450('0x7'));var controller=require(_0x8450('0x8'));router[_0x8450('0x9')]('/',auth[_0x8450('0xa')](),controller['index']);router[_0x8450('0x9')]('/:id',auth[_0x8450('0xa')](),controller[_0x8450('0xb')]);router['get']('/:id/sub_intervals',auth['isAuthenticated'](),controller['getIntervals']);router[_0x8450('0xc')]('/',auth[_0x8450('0xa')](),controller[_0x8450('0xd')]);router[_0x8450('0xc')](_0x8450('0xe'),auth[_0x8450('0xa')](),controller[_0x8450('0xf')]);router[_0x8450('0xc')]('/:id/sub_intervals/create_many',auth[_0x8450('0xa')](),controller[_0x8450('0x10')]);router[_0x8450('0x11')]('/:id',auth[_0x8450('0xa')](),controller[_0x8450('0x12')]);router['delete']('/:id',auth[_0x8450('0xa')](),controller[_0x8450('0x13')]);module[_0x8450('0x14')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 92cf320..f67c345 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 _0xcfb7=['exports','STRING','sequelize'];(function(_0x110b8f,_0x202a83){var _0x2cce4b=function(_0x2faab8){while(--_0x2faab8){_0x110b8f['push'](_0x110b8f['shift']());}};_0x2cce4b(++_0x202a83);}(_0xcfb7,0xa4));var _0x7cfb=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xcfb7[_0x52085a];return _0x5afc1a;};'use strict';var Sequelize=require(_0x7cfb('0x0'));module[_0x7cfb('0x1')]={'name':{'type':Sequelize[_0x7cfb('0x2')]},'description':{'type':Sequelize[_0x7cfb('0x2')]},'interval':{'type':Sequelize[_0x7cfb('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2893=['STRING','exports'];(function(_0x1979c7,_0x179db6){var _0x496aff=function(_0x54a717){while(--_0x54a717){_0x1979c7['push'](_0x1979c7['shift']());}};_0x496aff(++_0x179db6);}(_0x2893,0x149));var _0x3289=function(_0x4fd51c,_0x212fca){_0x4fd51c=_0x4fd51c-0x0;var _0xde5b62=_0x2893[_0x4fd51c];return _0xde5b62;};'use strict';var Sequelize=require('sequelize');module[_0x3289('0x0')]={'name':{'type':Sequelize[_0x3289('0x1')]},'description':{'type':Sequelize[_0x3289('0x1')]},'interval':{'type':Sequelize[_0x3289('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 253ae30..ff50687 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 _0x5725=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','reject','update','then','destroy','get','Intervals','error','name','send','index','map','Interval','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','intersection','includeAll','find','catch','create','body','user','role','userProfileId'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x5725,0xc2));var _0x5572=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5725[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5572('0x0'));var zipdir=require(_0x5572('0x1'));var jsonpatch=require(_0x5572('0x2'));var rp=require(_0x5572('0x3'));var moment=require(_0x5572('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5572('0x5'));var path=require(_0x5572('0x6'));var sox=require(_0x5572('0x7'));var csv=require(_0x5572('0x8'));var ejs=require(_0x5572('0x9'));var fs=require('fs');var fs_extra=require(_0x5572('0xa'));var _=require(_0x5572('0xb'));var squel=require(_0x5572('0xc'));var crypto=require(_0x5572('0xd'));var jsforce=require(_0x5572('0xe'));var deskjs=require(_0x5572('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5572('0x10'));var Redis=require(_0x5572('0x11'));var authService=require(_0x5572('0x12'));var qs=require(_0x5572('0x13'));var as=require(_0x5572('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5572('0x15'))('api');var utils=require(_0x5572('0x16'));var config=require(_0x5572('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5572('0x18'))['db'];var extensions=require(_0x5572('0x19'));function respondWithStatusCode(_0x472651,_0x27b25a){_0x27b25a=_0x27b25a||0xcc;return function(_0x529341){if(_0x529341){return _0x472651[_0x5572('0x1a')](_0x27b25a);}return _0x472651[_0x5572('0x1b')](_0x27b25a)[_0x5572('0x1c')]();};}function respondWithResult(_0x11fd51,_0x3fd7f6){_0x3fd7f6=_0x3fd7f6||0xc8;return function(_0x1c8a83){if(_0x1c8a83){return _0x11fd51[_0x5572('0x1b')](_0x3fd7f6)[_0x5572('0x1d')](_0x1c8a83);}};}function respondWithFilteredResult(_0x3a6ce0,_0x1579f9){return function(_0x3d939a){if(_0x3d939a){var _0x2914d8=typeof _0x1579f9[_0x5572('0x1e')]===_0x5572('0x1f')&&typeof _0x1579f9[_0x5572('0x20')]===_0x5572('0x1f');var _0x907b01=_0x3d939a[_0x5572('0x21')];var _0x542c8b=_0x2914d8?0x0:_0x1579f9[_0x5572('0x1e')];var _0x2e4121=_0x2914d8?_0x3d939a[_0x5572('0x21')]:_0x1579f9['offset']+_0x1579f9['limit'];var _0x5e8759;if(_0x2e4121>=_0x907b01){_0x2e4121=_0x907b01;_0x5e8759=0xc8;}else{_0x5e8759=0xce;}_0x3a6ce0['status'](_0x5e8759);return _0x3a6ce0['set']('Content-Range',_0x542c8b+'-'+_0x2e4121+'/'+_0x907b01)['json'](_0x3d939a);}return null;};}function patchUpdates(_0x368a98){return function(_0x25c00c){try{jsonpatch['apply'](_0x25c00c,_0x368a98,!![]);}catch(_0x3e744a){return BPromise[_0x5572('0x22')](_0x3e744a);}return _0x25c00c['save']();};}function saveUpdates(_0x34fc5d,_0x87a169){return function(_0x1137e4){if(_0x1137e4){return _0x1137e4[_0x5572('0x23')](_0x34fc5d)[_0x5572('0x24')](function(_0xc282d2){return _0xc282d2;});}return null;};}function removeEntity(_0x51f496,_0x2d02e2){return function(_0x590e41){if(_0x590e41){return _0x590e41[_0x5572('0x25')]()['then'](function(){var _0x3b6e79=_0x590e41[_0x5572('0x26')]({'plain':!![]});var _0x551270=_0x5572('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x551270,'resourceId':_0x3b6e79['id']}})[_0x5572('0x24')](function(){return _0x590e41;});})[_0x5572('0x24')](function(){_0x51f496[_0x5572('0x1b')](0xcc)[_0x5572('0x1c')]();});}};}function handleEntityNotFound(_0x3fb757,_0x29c7e8){return function(_0xf9b0d2){if(!_0xf9b0d2){_0x3fb757[_0x5572('0x1a')](0x194);}return _0xf9b0d2;};}function handleError(_0x29346b,_0x14e564){_0x14e564=_0x14e564||0x1f4;return function(_0x24efae){logger[_0x5572('0x28')](_0x24efae['stack']);if(_0x24efae[_0x5572('0x29')]){delete _0x24efae[_0x5572('0x29')];}_0x29346b[_0x5572('0x1b')](_0x14e564)[_0x5572('0x2a')](_0x24efae);};}exports[_0x5572('0x2b')]=function(_0x89f942,_0xa877aa){var _0x3a579e={},_0x2ab362={},_0x3cbbfc={'count':0x0,'rows':[]};var _0x2a7bae=_[_0x5572('0x2c')](db[_0x5572('0x2d')][_0x5572('0x2e')],function(_0x42b241){return{'name':_0x42b241[_0x5572('0x2f')],'type':_0x42b241['type'][_0x5572('0x30')]};});_0x2ab362[_0x5572('0x31')]=_[_0x5572('0x2c')](_0x2a7bae,_0x5572('0x29'));_0x2ab362[_0x5572('0x32')]=_[_0x5572('0x33')](_0x89f942['query']);_0x2ab362[_0x5572('0x34')]=_['intersection'](_0x2ab362['model'],_0x2ab362['query']);_0x3a579e[_0x5572('0x35')]=_['intersection'](_0x2ab362['model'],qs[_0x5572('0x36')](_0x89f942[_0x5572('0x32')]['fields']));_0x3a579e[_0x5572('0x35')]=_0x3a579e[_0x5572('0x35')][_0x5572('0x37')]?_0x3a579e[_0x5572('0x35')]:_0x2ab362[_0x5572('0x31')];if(!_0x89f942[_0x5572('0x32')]['hasOwnProperty'](_0x5572('0x38'))){_0x3a579e[_0x5572('0x20')]=qs[_0x5572('0x20')](_0x89f942['query'][_0x5572('0x20')]);_0x3a579e['offset']=qs[_0x5572('0x1e')](_0x89f942[_0x5572('0x32')][_0x5572('0x1e')]);}_0x3a579e['order']=qs[_0x5572('0x39')](_0x89f942[_0x5572('0x32')]['sort']);_0x3a579e[_0x5572('0x3a')]=qs[_0x5572('0x34')](_[_0x5572('0x3b')](_0x89f942['query'],_0x2ab362[_0x5572('0x34')]),_0x2a7bae);if(_0x89f942['query'][_0x5572('0x3c')]){_0x3a579e[_0x5572('0x3a')]=_[_0x5572('0x3d')](_0x3a579e[_0x5572('0x3a')],{'$or':_['map'](_0x2a7bae,function(_0x36cc6f){if(_0x36cc6f[_0x5572('0x3e')]!==_0x5572('0x3f')){var _0x31d4dc={};_0x31d4dc[_0x36cc6f['name']]={'$like':'%'+_0x89f942['query'][_0x5572('0x3c')]+'%'};return _0x31d4dc;}})});}_0x3a579e=_[_0x5572('0x3d')]({},_0x3a579e,_0x89f942[_0x5572('0x40')]);var _0x3654a5={'where':_0x3a579e[_0x5572('0x3a')]};return db[_0x5572('0x2d')][_0x5572('0x21')](_0x3654a5)[_0x5572('0x24')](function(_0xf47b47){_0x3cbbfc[_0x5572('0x21')]=_0xf47b47;if(_0x89f942[_0x5572('0x32')]['includeAll']){_0x3a579e[_0x5572('0x41')]=[{'all':!![]}];}return db[_0x5572('0x2d')][_0x5572('0x42')](_0x3a579e);})[_0x5572('0x24')](function(_0x20d122){_0x3cbbfc[_0x5572('0x43')]=_0x20d122;return _0x3cbbfc;})[_0x5572('0x24')](respondWithFilteredResult(_0xa877aa,_0x3a579e))['catch'](handleError(_0xa877aa,null));};exports[_0x5572('0x44')]=function(_0x5d48f4,_0x1f2572){var _0x4b804d={'raw':!![],'where':{'id':_0x5d48f4[_0x5572('0x45')]['id']}},_0x1baa1e={};_0x1baa1e[_0x5572('0x31')]=_[_0x5572('0x33')](db['Interval']['rawAttributes']);_0x1baa1e[_0x5572('0x32')]=_[_0x5572('0x33')](_0x5d48f4[_0x5572('0x32')]);_0x1baa1e[_0x5572('0x34')]=_[_0x5572('0x46')](_0x1baa1e[_0x5572('0x31')],_0x1baa1e[_0x5572('0x32')]);_0x4b804d[_0x5572('0x35')]=_[_0x5572('0x46')](_0x1baa1e[_0x5572('0x31')],qs[_0x5572('0x36')](_0x5d48f4['query'][_0x5572('0x36')]));_0x4b804d[_0x5572('0x35')]=_0x4b804d[_0x5572('0x35')][_0x5572('0x37')]?_0x4b804d[_0x5572('0x35')]:_0x1baa1e[_0x5572('0x31')];if(_0x5d48f4[_0x5572('0x32')][_0x5572('0x47')]){_0x4b804d['include']=[{'all':!![]}];}_0x4b804d=_[_0x5572('0x3d')]({},_0x4b804d,_0x5d48f4[_0x5572('0x40')]);return db[_0x5572('0x2d')][_0x5572('0x48')](_0x4b804d)[_0x5572('0x24')](handleEntityNotFound(_0x1f2572,null))[_0x5572('0x24')](respondWithResult(_0x1f2572,null))[_0x5572('0x49')](handleError(_0x1f2572,null));};exports['create']=function(_0x5077a0,_0x4056f9){return db[_0x5572('0x2d')][_0x5572('0x4a')](_0x5077a0[_0x5572('0x4b')],{})[_0x5572('0x24')](function(_0x468792){var _0x38f520=_0x5077a0[_0x5572('0x4c')]['get']({'plain':!![]});if(!_0x38f520)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38f520[_0x5572('0x4d')]===_0x5572('0x4c')){var _0xeb47d7=_0x468792[_0x5572('0x26')]({'plain':!![]});var _0x24d5b3=_0x5572('0x27');return db['UserProfileSection'][_0x5572('0x48')]({'where':{'name':_0x24d5b3,'userProfileId':_0x38f520[_0x5572('0x4e')]},'raw':!![]})[_0x5572('0x24')](function(_0x521552){if(_0x521552&&_0x521552[_0x5572('0x4f')]===0x0){return db[_0x5572('0x50')][_0x5572('0x4a')]({'name':_0xeb47d7['name'],'resourceId':_0xeb47d7['id'],'type':_0x521552['name'],'sectionId':_0x521552['id']},{})['then'](function(){return _0x468792;});}else{return _0x468792;}})[_0x5572('0x49')](function(_0x2fc09e){logger[_0x5572('0x28')](_0x5572('0x51'),_0x2fc09e);throw _0x2fc09e;});}return _0x468792;})[_0x5572('0x24')](respondWithResult(_0x4056f9,0xc9))[_0x5572('0x49')](handleError(_0x4056f9,null));};exports['update']=function(_0xed2d87,_0x333725){if(_0xed2d87['body']['id']){delete _0xed2d87['body']['id'];}return db[_0x5572('0x2d')][_0x5572('0x48')]({'where':{'id':_0xed2d87[_0x5572('0x45')]['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x333725,null))[_0x5572('0x24')](saveUpdates(_0xed2d87[_0x5572('0x4b')],null))[_0x5572('0x24')](respondWithResult(_0x333725,null))[_0x5572('0x49')](handleError(_0x333725,null));};exports[_0x5572('0x25')]=function(_0x1025dd,_0x449313){return db[_0x5572('0x2d')][_0x5572('0x48')]({'where':{'id':_0x1025dd[_0x5572('0x45')]['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x449313,null))[_0x5572('0x24')](removeEntity(_0x449313,null))[_0x5572('0x49')](handleError(_0x449313,null));};exports[_0x5572('0x52')]=function(_0x1083bc,_0x35b209,_0xa705c0){if(_0x1083bc[_0x5572('0x4b')]['id']){delete _0x1083bc[_0x5572('0x4b')]['id'];}return db[_0x5572('0x2d')]['find']({'where':{'id':_0x1083bc[_0x5572('0x45')]['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x35b209,null))[_0x5572('0x24')](function(_0x3eb9f8){if(_0x3eb9f8){_0x1083bc[_0x5572('0x4b')][_0x5572('0x53')]=_0x3eb9f8['id'];return db[_0x5572('0x2d')][_0x5572('0x4a')](_0x1083bc[_0x5572('0x4b')]);}})[_0x5572('0x24')](respondWithResult(_0x35b209,null))['catch'](handleError(_0x35b209,null));};exports[_0x5572('0x54')]=function(_0x17fdf9,_0x4f99be,_0x1c4e61){var _0x3c3414={};var _0x16a04b={};var _0x100260;var _0x31eb85;return db[_0x5572('0x2d')][_0x5572('0x55')]({'where':{'id':_0x17fdf9[_0x5572('0x45')]['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x4f99be,null))[_0x5572('0x24')](function(_0x58fc4c){if(_0x58fc4c){_0x100260=_0x58fc4c;_0x16a04b[_0x5572('0x31')]=_[_0x5572('0x33')](db[_0x5572('0x2d')][_0x5572('0x2e')]);_0x16a04b[_0x5572('0x32')]=_[_0x5572('0x33')](_0x17fdf9[_0x5572('0x32')]);_0x16a04b[_0x5572('0x34')]=_[_0x5572('0x46')](_0x16a04b[_0x5572('0x31')],_0x16a04b['query']);_0x3c3414[_0x5572('0x35')]=_[_0x5572('0x46')](_0x16a04b['model'],qs['fields'](_0x17fdf9[_0x5572('0x32')]['fields']));_0x3c3414['attributes']=_0x3c3414['attributes'][_0x5572('0x37')]?_0x3c3414[_0x5572('0x35')]:_0x16a04b['model'];_0x3c3414['order']=qs['sort'](_0x17fdf9[_0x5572('0x32')]['sort']);_0x3c3414[_0x5572('0x3a')]=qs[_0x5572('0x34')](_[_0x5572('0x3b')](_0x17fdf9[_0x5572('0x32')],_0x16a04b[_0x5572('0x34')]));if(_0x17fdf9[_0x5572('0x32')][_0x5572('0x3c')]){_0x3c3414[_0x5572('0x3a')]=_['merge'](_0x3c3414[_0x5572('0x3a')],{'$or':_[_0x5572('0x2c')](_0x3c3414['attributes'],function(_0x298684){var _0x291e09={};_0x291e09[_0x298684]={'$like':'%'+_0x17fdf9['query']['filter']+'%'};return _0x291e09;})});}_0x3c3414=_[_0x5572('0x3d')]({},_0x3c3414,_0x17fdf9['options']);return _0x100260[_0x5572('0x54')](_0x3c3414);}})['then'](function(_0x202ca8){if(_0x202ca8){_0x31eb85=_0x202ca8[_0x5572('0x37')];if(!_0x17fdf9[_0x5572('0x32')][_0x5572('0x56')](_0x5572('0x38'))){_0x3c3414['limit']=qs['limit'](_0x17fdf9['query']['limit']);_0x3c3414[_0x5572('0x1e')]=qs['offset'](_0x17fdf9[_0x5572('0x32')][_0x5572('0x1e')]);}return _0x100260['getIntervals'](_0x3c3414);}})[_0x5572('0x24')](function(_0x5541eb){if(_0x5541eb){return _0x5541eb?{'count':_0x31eb85,'rows':_0x5541eb}:null;}})[_0x5572('0x24')](respondWithResult(_0x4f99be,null))[_0x5572('0x49')](handleError(_0x4f99be,null));};exports[_0x5572('0x57')]=function(_0x5bbd8f,_0x209b64,_0x310eeb){return db[_0x5572('0x2d')]['findOne']({'where':{'id':_0x5bbd8f['params']['id']}})[_0x5572('0x24')](handleEntityNotFound(_0x209b64,null))[_0x5572('0x24')](function(_0xd45e2c){if(_0xd45e2c){return db[_0x5572('0x58')][_0x5572('0x59')](function(_0x205d06){return db['Interval'][_0x5572('0x25')]({'where':{'IntervalId':_0x5bbd8f[_0x5572('0x45')]['id']},'transaction':_0x205d06})[_0x5572('0x24')](function(_0x11978c){var _0x3deb25=_[_0x5572('0x2c')](_0x5bbd8f[_0x5572('0x4b')],function(_0x1a27ea){delete _0x1a27ea['id'];_0x1a27ea[_0x5572('0x53')]=_0x5bbd8f[_0x5572('0x45')]['id'];return _0x1a27ea;});return db[_0x5572('0x2d')][_0x5572('0x5a')](_0x3deb25,{'transaction':_0x205d06});});})[_0x5572('0x24')](function(){return db[_0x5572('0x2d')]['findAll']({'where':{'IntervalId':_0x5bbd8f['params']['id']}});});}})[_0x5572('0x24')](respondWithResult(_0x209b64,null))[_0x5572('0x49')](handleError(_0x209b64,null));}; \ No newline at end of file +var _0x4ccd=['../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','Interval','findAll','rows','catch','show','params','keys','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','pick','addIntervals','sequelize','transaction','bulkCreate','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util'];(function(_0x33c677,_0x2c734f){var _0x540ab1=function(_0x4a7a9e){while(--_0x4a7a9e){_0x33c677['push'](_0x33c677['shift']());}};_0x540ab1(++_0x2c734f);}(_0x4ccd,0xf8));var _0xd4cc=function(_0x6b6340,_0x6302c4){_0x6b6340=_0x6b6340-0x0;var _0x3609bf=_0x4ccd[_0x6b6340];return _0x3609bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd4cc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4cc('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd4cc('0x2'));var Mustache=require(_0xd4cc('0x3'));var util=require(_0xd4cc('0x4'));var path=require(_0xd4cc('0x5'));var sox=require(_0xd4cc('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4cc('0x7'));var _=require(_0xd4cc('0x8'));var squel=require(_0xd4cc('0x9'));var crypto=require('crypto');var jsforce=require(_0xd4cc('0xa'));var deskjs=require(_0xd4cc('0xb'));var toCsv=require(_0xd4cc('0xc'));var querystring=require(_0xd4cc('0xd'));var Papa=require(_0xd4cc('0xe'));var Redis=require('ioredis');var authService=require(_0xd4cc('0xf'));var qs=require(_0xd4cc('0x10'));var as=require(_0xd4cc('0x11'));var hardwareService=require(_0xd4cc('0x12'));var logger=require('../../config/logger')(_0xd4cc('0x13'));var utils=require(_0xd4cc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd4cc('0x15'));var db=require('../../mysqldb')['db'];var extensions=require(_0xd4cc('0x16'));function respondWithStatusCode(_0xdb603a,_0x419b5c){_0x419b5c=_0x419b5c||0xcc;return function(_0x425320){if(_0x425320){return _0xdb603a[_0xd4cc('0x17')](_0x419b5c);}return _0xdb603a[_0xd4cc('0x18')](_0x419b5c)[_0xd4cc('0x19')]();};}function respondWithResult(_0x4e91d4,_0x1e1359){_0x1e1359=_0x1e1359||0xc8;return function(_0x23d8a5){if(_0x23d8a5){return _0x4e91d4['status'](_0x1e1359)['json'](_0x23d8a5);}};}function respondWithFilteredResult(_0x4cd9e7,_0x59ffd8){return function(_0x14800c){if(_0x14800c){var _0x228dd2=typeof _0x59ffd8[_0xd4cc('0x1a')]===_0xd4cc('0x1b')&&typeof _0x59ffd8[_0xd4cc('0x1c')]===_0xd4cc('0x1b');var _0x20bf68=_0x14800c[_0xd4cc('0x1d')];var _0x3af4fd=_0x228dd2?0x0:_0x59ffd8[_0xd4cc('0x1a')];var _0x6feb31=_0x228dd2?_0x14800c[_0xd4cc('0x1d')]:_0x59ffd8[_0xd4cc('0x1a')]+_0x59ffd8[_0xd4cc('0x1c')];var _0x5a733b;if(_0x6feb31>=_0x20bf68){_0x6feb31=_0x20bf68;_0x5a733b=0xc8;}else{_0x5a733b=0xce;}_0x4cd9e7[_0xd4cc('0x18')](_0x5a733b);return _0x4cd9e7[_0xd4cc('0x1e')]('Content-Range',_0x3af4fd+'-'+_0x6feb31+'/'+_0x20bf68)['json'](_0x14800c);}return null;};}function patchUpdates(_0x371270){return function(_0x81e914){try{jsonpatch[_0xd4cc('0x1f')](_0x81e914,_0x371270,!![]);}catch(_0x13b1a9){return BPromise[_0xd4cc('0x20')](_0x13b1a9);}return _0x81e914[_0xd4cc('0x21')]();};}function saveUpdates(_0x1cf8aa,_0x57814e){return function(_0x47dce2){if(_0x47dce2){return _0x47dce2[_0xd4cc('0x22')](_0x1cf8aa)['then'](function(_0x24fdc1){return _0x24fdc1;});}return null;};}function removeEntity(_0x5525af,_0x2a720f){return function(_0x4c413f){if(_0x4c413f){return _0x4c413f[_0xd4cc('0x23')]()[_0xd4cc('0x24')](function(){var _0x3c958a=_0x4c413f[_0xd4cc('0x25')]({'plain':!![]});var _0x3c0a85=_0xd4cc('0x26');return db[_0xd4cc('0x27')][_0xd4cc('0x23')]({'where':{'type':_0x3c0a85,'resourceId':_0x3c958a['id']}})[_0xd4cc('0x24')](function(){return _0x4c413f;});})[_0xd4cc('0x24')](function(){_0x5525af[_0xd4cc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50971f,_0xa20eb){return function(_0x2bb6dd){if(!_0x2bb6dd){_0x50971f[_0xd4cc('0x17')](0x194);}return _0x2bb6dd;};}function handleError(_0x4949ff,_0x111cf9){_0x111cf9=_0x111cf9||0x1f4;return function(_0x3b4531){logger[_0xd4cc('0x28')](_0x3b4531[_0xd4cc('0x29')]);if(_0x3b4531[_0xd4cc('0x2a')]){delete _0x3b4531[_0xd4cc('0x2a')];}_0x4949ff[_0xd4cc('0x18')](_0x111cf9)[_0xd4cc('0x2b')](_0x3b4531);};}exports[_0xd4cc('0x2c')]=function(_0x31861a,_0x311ddd){var _0x340404={},_0x69442={},_0x2ce478={'count':0x0,'rows':[]};var _0x466f13=_[_0xd4cc('0x2d')](db['Interval'][_0xd4cc('0x2e')],function(_0x2cecc5){return{'name':_0x2cecc5[_0xd4cc('0x2f')],'type':_0x2cecc5[_0xd4cc('0x30')]['key']};});_0x69442[_0xd4cc('0x31')]=_[_0xd4cc('0x2d')](_0x466f13,_0xd4cc('0x2a'));_0x69442['query']=_['keys'](_0x31861a[_0xd4cc('0x32')]);_0x69442['filters']=_[_0xd4cc('0x33')](_0x69442[_0xd4cc('0x31')],_0x69442[_0xd4cc('0x32')]);_0x340404[_0xd4cc('0x34')]=_[_0xd4cc('0x33')](_0x69442[_0xd4cc('0x31')],qs[_0xd4cc('0x35')](_0x31861a[_0xd4cc('0x32')][_0xd4cc('0x35')]));_0x340404[_0xd4cc('0x34')]=_0x340404['attributes'][_0xd4cc('0x36')]?_0x340404[_0xd4cc('0x34')]:_0x69442[_0xd4cc('0x31')];if(!_0x31861a[_0xd4cc('0x32')][_0xd4cc('0x37')](_0xd4cc('0x38'))){_0x340404[_0xd4cc('0x1c')]=qs['limit'](_0x31861a[_0xd4cc('0x32')][_0xd4cc('0x1c')]);_0x340404[_0xd4cc('0x1a')]=qs[_0xd4cc('0x1a')](_0x31861a[_0xd4cc('0x32')][_0xd4cc('0x1a')]);}_0x340404[_0xd4cc('0x39')]=qs[_0xd4cc('0x3a')](_0x31861a[_0xd4cc('0x32')][_0xd4cc('0x3a')]);_0x340404[_0xd4cc('0x3b')]=qs[_0xd4cc('0x3c')](_['pick'](_0x31861a[_0xd4cc('0x32')],_0x69442[_0xd4cc('0x3c')]),_0x466f13);if(_0x31861a['query'][_0xd4cc('0x3d')]){_0x340404['where']=_[_0xd4cc('0x3e')](_0x340404[_0xd4cc('0x3b')],{'$or':_[_0xd4cc('0x2d')](_0x466f13,function(_0x5b4d9f){if(_0x5b4d9f['type']!=='VIRTUAL'){var _0x13b220={};_0x13b220[_0x5b4d9f['name']]={'$like':'%'+_0x31861a[_0xd4cc('0x32')]['filter']+'%'};return _0x13b220;}})});}_0x340404=_[_0xd4cc('0x3e')]({},_0x340404,_0x31861a[_0xd4cc('0x3f')]);var _0x170d9b={'where':_0x340404['where']};return db[_0xd4cc('0x40')][_0xd4cc('0x1d')](_0x170d9b)['then'](function(_0x2cceaf){_0x2ce478[_0xd4cc('0x1d')]=_0x2cceaf;if(_0x31861a[_0xd4cc('0x32')]['includeAll']){_0x340404['include']=[{'all':!![]}];}return db[_0xd4cc('0x40')][_0xd4cc('0x41')](_0x340404);})[_0xd4cc('0x24')](function(_0x317902){_0x2ce478[_0xd4cc('0x42')]=_0x317902;return _0x2ce478;})[_0xd4cc('0x24')](respondWithFilteredResult(_0x311ddd,_0x340404))[_0xd4cc('0x43')](handleError(_0x311ddd,null));};exports[_0xd4cc('0x44')]=function(_0x6d3c92,_0x323a58){var _0x26afe1={'raw':!![],'where':{'id':_0x6d3c92[_0xd4cc('0x45')]['id']}},_0x5b9228={};_0x5b9228[_0xd4cc('0x31')]=_[_0xd4cc('0x46')](db[_0xd4cc('0x40')]['rawAttributes']);_0x5b9228[_0xd4cc('0x32')]=_[_0xd4cc('0x46')](_0x6d3c92['query']);_0x5b9228['filters']=_['intersection'](_0x5b9228[_0xd4cc('0x31')],_0x5b9228['query']);_0x26afe1['attributes']=_[_0xd4cc('0x33')](_0x5b9228['model'],qs[_0xd4cc('0x35')](_0x6d3c92[_0xd4cc('0x32')][_0xd4cc('0x35')]));_0x26afe1[_0xd4cc('0x34')]=_0x26afe1['attributes'][_0xd4cc('0x36')]?_0x26afe1['attributes']:_0x5b9228[_0xd4cc('0x31')];if(_0x6d3c92[_0xd4cc('0x32')][_0xd4cc('0x47')]){_0x26afe1[_0xd4cc('0x48')]=[{'all':!![]}];}_0x26afe1=_[_0xd4cc('0x3e')]({},_0x26afe1,_0x6d3c92[_0xd4cc('0x3f')]);return db[_0xd4cc('0x40')][_0xd4cc('0x49')](_0x26afe1)['then'](handleEntityNotFound(_0x323a58,null))['then'](respondWithResult(_0x323a58,null))[_0xd4cc('0x43')](handleError(_0x323a58,null));};exports['create']=function(_0x1e607b,_0x55ccf7){return db[_0xd4cc('0x40')]['create'](_0x1e607b[_0xd4cc('0x4a')],{})['then'](function(_0x4a234a){var _0xdad8dd=_0x1e607b[_0xd4cc('0x4b')]['get']({'plain':!![]});if(!_0xdad8dd)throw new Error(_0xd4cc('0x4c'));if(_0xdad8dd[_0xd4cc('0x4d')]==='user'){var _0x441673=_0x4a234a['get']({'plain':!![]});var _0x2c4432=_0xd4cc('0x26');return db[_0xd4cc('0x4e')][_0xd4cc('0x49')]({'where':{'name':_0x2c4432,'userProfileId':_0xdad8dd[_0xd4cc('0x4f')]},'raw':!![]})[_0xd4cc('0x24')](function(_0x57595e){if(_0x57595e&&_0x57595e['autoAssociation']===0x0){return db['UserProfileResource'][_0xd4cc('0x50')]({'name':_0x441673['name'],'resourceId':_0x441673['id'],'type':_0x57595e[_0xd4cc('0x2a')],'sectionId':_0x57595e['id']},{})[_0xd4cc('0x24')](function(){return _0x4a234a;});}else{return _0x4a234a;}})[_0xd4cc('0x43')](function(_0x4cba5e){logger[_0xd4cc('0x28')](_0xd4cc('0x51'),_0x4cba5e);throw _0x4cba5e;});}return _0x4a234a;})[_0xd4cc('0x24')](respondWithResult(_0x55ccf7,0xc9))[_0xd4cc('0x43')](handleError(_0x55ccf7,null));};exports[_0xd4cc('0x22')]=function(_0xff3501,_0x3fb5c4){if(_0xff3501[_0xd4cc('0x4a')]['id']){delete _0xff3501[_0xd4cc('0x4a')]['id'];}return db[_0xd4cc('0x40')][_0xd4cc('0x49')]({'where':{'id':_0xff3501[_0xd4cc('0x45')]['id']}})[_0xd4cc('0x24')](handleEntityNotFound(_0x3fb5c4,null))[_0xd4cc('0x24')](saveUpdates(_0xff3501['body'],null))[_0xd4cc('0x24')](respondWithResult(_0x3fb5c4,null))[_0xd4cc('0x43')](handleError(_0x3fb5c4,null));};exports['destroy']=function(_0x2f4979,_0x1a1a95){return db[_0xd4cc('0x40')][_0xd4cc('0x49')]({'where':{'id':_0x2f4979['params']['id']}})[_0xd4cc('0x24')](handleEntityNotFound(_0x1a1a95,null))[_0xd4cc('0x24')](removeEntity(_0x1a1a95,null))['catch'](handleError(_0x1a1a95,null));};exports[_0xd4cc('0x52')]=function(_0x3d54b6,_0x5e62cd,_0x3531d7){if(_0x3d54b6[_0xd4cc('0x4a')]['id']){delete _0x3d54b6[_0xd4cc('0x4a')]['id'];}return db[_0xd4cc('0x40')]['find']({'where':{'id':_0x3d54b6['params']['id']}})[_0xd4cc('0x24')](handleEntityNotFound(_0x5e62cd,null))['then'](function(_0x1a50b7){if(_0x1a50b7){_0x3d54b6[_0xd4cc('0x4a')][_0xd4cc('0x53')]=_0x1a50b7['id'];return db[_0xd4cc('0x40')]['create'](_0x3d54b6[_0xd4cc('0x4a')]);}})[_0xd4cc('0x24')](respondWithResult(_0x5e62cd,null))[_0xd4cc('0x43')](handleError(_0x5e62cd,null));};exports[_0xd4cc('0x54')]=function(_0x43e176,_0x22a321,_0x15e2e1){var _0xc3d406={};var _0x5ad43c={};var _0x55e210;var _0x503178;return db[_0xd4cc('0x40')]['findOne']({'where':{'id':_0x43e176[_0xd4cc('0x45')]['id']}})[_0xd4cc('0x24')](handleEntityNotFound(_0x22a321,null))[_0xd4cc('0x24')](function(_0xad162c){if(_0xad162c){_0x55e210=_0xad162c;_0x5ad43c[_0xd4cc('0x31')]=_[_0xd4cc('0x46')](db['Interval'][_0xd4cc('0x2e')]);_0x5ad43c['query']=_[_0xd4cc('0x46')](_0x43e176[_0xd4cc('0x32')]);_0x5ad43c[_0xd4cc('0x3c')]=_[_0xd4cc('0x33')](_0x5ad43c[_0xd4cc('0x31')],_0x5ad43c[_0xd4cc('0x32')]);_0xc3d406['attributes']=_[_0xd4cc('0x33')](_0x5ad43c[_0xd4cc('0x31')],qs[_0xd4cc('0x35')](_0x43e176[_0xd4cc('0x32')][_0xd4cc('0x35')]));_0xc3d406[_0xd4cc('0x34')]=_0xc3d406[_0xd4cc('0x34')]['length']?_0xc3d406[_0xd4cc('0x34')]:_0x5ad43c[_0xd4cc('0x31')];_0xc3d406['order']=qs[_0xd4cc('0x3a')](_0x43e176[_0xd4cc('0x32')][_0xd4cc('0x3a')]);_0xc3d406[_0xd4cc('0x3b')]=qs[_0xd4cc('0x3c')](_[_0xd4cc('0x55')](_0x43e176['query'],_0x5ad43c[_0xd4cc('0x3c')]));if(_0x43e176[_0xd4cc('0x32')][_0xd4cc('0x3d')]){_0xc3d406[_0xd4cc('0x3b')]=_[_0xd4cc('0x3e')](_0xc3d406[_0xd4cc('0x3b')],{'$or':_['map'](_0xc3d406['attributes'],function(_0x184b9f){var _0x8487d3={};_0x8487d3[_0x184b9f]={'$like':'%'+_0x43e176[_0xd4cc('0x32')]['filter']+'%'};return _0x8487d3;})});}_0xc3d406=_['merge']({},_0xc3d406,_0x43e176[_0xd4cc('0x3f')]);return _0x55e210[_0xd4cc('0x54')](_0xc3d406);}})['then'](function(_0x52ff0d){if(_0x52ff0d){_0x503178=_0x52ff0d[_0xd4cc('0x36')];if(!_0x43e176[_0xd4cc('0x32')][_0xd4cc('0x37')]('nolimit')){_0xc3d406[_0xd4cc('0x1c')]=qs[_0xd4cc('0x1c')](_0x43e176[_0xd4cc('0x32')][_0xd4cc('0x1c')]);_0xc3d406[_0xd4cc('0x1a')]=qs[_0xd4cc('0x1a')](_0x43e176[_0xd4cc('0x32')]['offset']);}return _0x55e210[_0xd4cc('0x54')](_0xc3d406);}})[_0xd4cc('0x24')](function(_0x3567c0){if(_0x3567c0){return _0x3567c0?{'count':_0x503178,'rows':_0x3567c0}:null;}})[_0xd4cc('0x24')](respondWithResult(_0x22a321,null))[_0xd4cc('0x43')](handleError(_0x22a321,null));};exports[_0xd4cc('0x56')]=function(_0x21d36b,_0x2f29e6,_0x13d7a6){return db[_0xd4cc('0x40')]['findOne']({'where':{'id':_0x21d36b[_0xd4cc('0x45')]['id']}})[_0xd4cc('0x24')](handleEntityNotFound(_0x2f29e6,null))[_0xd4cc('0x24')](function(_0x128250){if(_0x128250){return db[_0xd4cc('0x57')][_0xd4cc('0x58')](function(_0x8103f1){return db[_0xd4cc('0x40')][_0xd4cc('0x23')]({'where':{'IntervalId':_0x21d36b['params']['id']},'transaction':_0x8103f1})[_0xd4cc('0x24')](function(_0x21c1fc){var _0x44bf9c=_['map'](_0x21d36b[_0xd4cc('0x4a')],function(_0x19f85d){delete _0x19f85d['id'];_0x19f85d[_0xd4cc('0x53')]=_0x21d36b['params']['id'];return _0x19f85d;});return db[_0xd4cc('0x40')][_0xd4cc('0x59')](_0x44bf9c,{'transaction':_0x8103f1});});})[_0xd4cc('0x24')](function(){return db[_0xd4cc('0x40')][_0xd4cc('0x41')]({'where':{'IntervalId':_0x21d36b[_0xd4cc('0x45')]['id']}});});}})[_0xd4cc('0x24')](respondWithResult(_0x2f29e6,null))['catch'](handleError(_0x2f29e6,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 0f8e9e1..3549240 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 _0xa772=['define','rewrite','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x331622,_0x573abb){var _0x1a98f2=function(_0x2ccb69){while(--_0x2ccb69){_0x331622['push'](_0x331622['shift']());}};_0x1a98f2(++_0x573abb);}(_0xa772,0x1b2));var _0x2a77=function(_0x4b416c,_0x53ef9e){_0x4b416c=_0x4b416c-0x0;var _0x2037fa=_0xa772[_0x4b416c];return _0x2037fa;};'use strict';var _=require('lodash');var util=require(_0x2a77('0x0'));var logger=require(_0x2a77('0x1'))(_0x2a77('0x2'));var moment=require(_0x2a77('0x3'));var BPromise=require(_0x2a77('0x4'));var rp=require(_0x2a77('0x5'));var fs=require('fs');var path=require(_0x2a77('0x6'));var rimraf=require('rimraf');var config=require(_0x2a77('0x7'));var attributes=require(_0x2a77('0x8'));var extensions=require(_0x2a77('0x9'));module['exports']=function(_0x2c3588,_0x16c2c0){return _0x2c3588[_0x2a77('0xa')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x340aba,_0x1ff7dd){extensions[_0x2a77('0xb')](_0x2c3588,_0x340aba);},'afterBulkCreate':function(_0x2e620a,_0x2a2708,_0x29b823){_0x29b823();extensions[_0x2a77('0xb')](_0x2c3588,_0x2e620a[0x0]);},'afterUpdate':function(_0xddab4b,_0x11b7ff){extensions[_0x2a77('0xb')](_0x2c3588,_0xddab4b);},'afterDestroy':function(_0x4a833b,_0x191d54){extensions['rewrite'](_0x2c3588,_0x4a833b);}}});}; \ No newline at end of file +var _0x7eae=['rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x24708a,_0x1fc85a){var _0x574528=function(_0x14500b){while(--_0x14500b){_0x24708a['push'](_0x24708a['shift']());}};_0x574528(++_0x1fc85a);}(_0x7eae,0x104));var _0xe7ea=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x7eae[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xe7ea('0x0'));var util=require(_0xe7ea('0x1'));var logger=require(_0xe7ea('0x2'))('api');var moment=require(_0xe7ea('0x3'));var BPromise=require(_0xe7ea('0x4'));var rp=require(_0xe7ea('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7ea('0x6'));var config=require(_0xe7ea('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0xe7ea('0x8'));module[_0xe7ea('0x9')]=function(_0x235f88,_0x4a066e){return _0x235f88[_0xe7ea('0xa')](_0xe7ea('0xb'),attributes,{'tableName':_0xe7ea('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x337de6,_0x4f4d98){extensions[_0xe7ea('0xd')](_0x235f88,_0x337de6);},'afterBulkCreate':function(_0x92c45a,_0x3e749c,_0x4b19b0){_0x4b19b0();extensions[_0xe7ea('0xd')](_0x235f88,_0x92c45a[0x0]);},'afterUpdate':function(_0x3ecce8,_0x5f48c7){extensions[_0xe7ea('0xd')](_0x235f88,_0x3ecce8);},'afterDestroy':function(_0x152348,_0x4b3ae1){extensions[_0xe7ea('0xd')](_0x235f88,_0x152348);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 9fc189d..70af608 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(_0x695b76,_0x551526){var _0x1dc21f=function(_0x5fdb1c){while(--_0x5fdb1c){_0x695b76['push'](_0x695b76['shift']());}};_0x1dc21f(++_0x551526);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 3909c75..e666f76 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(_0x45d43a,_0x71b8e){var _0x6e29f7=function(_0x5f4ce4){while(--_0x5f4ce4){_0x45d43a['push'](_0x45d43a['shift']());}};_0x6e29f7(++_0x71b8e);}(_0x2ef3,0xba));var _0x32ef=function(_0x223136,_0x28861a){_0x223136=_0x223136-0x0;var _0x4abdda=_0x2ef3[_0x223136];return _0x4abdda;};'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 _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x585276,_0x553f5a){var _0x4a7181=function(_0x26f87d){while(--_0x26f87d){_0x585276['push'](_0x585276['shift']());}};_0x4a7181(++_0x553f5a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d90ae,_0x5368f1){_0x4d90ae=_0x4d90ae-0x0;var _0x14cd38=_0x5f2f[_0x4d90ae];return _0x14cd38;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 65bf0de..e3fb3fd 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 _0x993b=['https','../../config/logger','api','support','3eAmWpBVP0','summary','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird'];(function(_0x54fe3c,_0x3ba4d8){var _0xde196e=function(_0x9dbe82){while(--_0x9dbe82){_0x54fe3c['push'](_0x54fe3c['shift']());}};_0xde196e(++_0x3ba4d8);}(_0x993b,0xea));var _0xb993=function(_0x356ac0,_0x254958){_0x356ac0=_0x356ac0-0x0;var _0x3d5ecf=_0x993b[_0x356ac0];return _0x3d5ecf;};'use strict';var BPromise=require(_0xb993('0x0'));var https=require(_0xb993('0x1'));var logger=require(_0xb993('0x2'))(_0xb993('0x3'));var USERNAME=_0xb993('0x4');var PASSWORD=_0xb993('0x5');function openIssue(_0x55acbc,_0x289941){var _0x2df29a={'fields':{'project':{'key':_0x55acbc['key']||'MOTGUI'},'summary':(_0x55acbc[_0xb993('0x6')]||'Report')+_0xb993('0x7')+_0x55acbc['ip'],'description':_0x55acbc[_0xb993('0x8')]||JSON[_0xb993('0x9')](_0x55acbc),'issuetype':{'name':_0x55acbc[_0xb993('0xa')]||_0xb993('0xb')}}};_0x2df29a[_0xb993('0xc')][_0xb993('0xd')]=_0x55acbc['email'];_0x2df29a[_0xb993('0xc')][_0xb993('0xe')]=_0x55acbc[_0xb993('0xf')];_0x2df29a[_0xb993('0xc')][_0xb993('0x10')]=_0x55acbc[_0xb993('0x11')];_0x2df29a['fields'][_0xb993('0x12')]=_0x55acbc[_0xb993('0x13')];_0x2df29a[_0xb993('0xc')][_0xb993('0x14')]=_0x55acbc[_0xb993('0x15')];_0x2df29a[_0xb993('0xc')][_0xb993('0x16')]=_0x55acbc['ip'];var _0x48361c={'host':_0xb993('0x17'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xb993('0x18'),'Authorization':_0xb993('0x19')+new Buffer(USERNAME+':'+PASSWORD)[_0xb993('0x1a')](_0xb993('0x1b'))}};var _0x35984e=JSON[_0xb993('0x9')](_0x2df29a);var _0x257fe9=https[_0xb993('0x1c')](_0x48361c,function(_0x228f2d){_0x228f2d[_0xb993('0x1d')](_0xb993('0x1e'));var _0x1634bf='';_0x228f2d['on'](_0xb993('0x1f'),function(_0xe891f4){_0x1634bf+=_0xe891f4;});_0x228f2d['on']('end',function(){if(_0x289941){return _0x289941[_0xb993('0x20')](_0x228f2d[_0xb993('0x21')])[_0xb993('0x22')](JSON[_0xb993('0x23')](_0x1634bf));}});});_0x257fe9['on'](_0xb993('0x24'),function(_0x419f98){if(_0x289941){return _0x289941[_0xb993('0x20')](0x1f4)[_0xb993('0x22')]({'errors':[{'message':_0xb993('0x25'),'type':_0xb993('0x26')}]});}});_0x257fe9[_0xb993('0x27')](_0x35984e);_0x257fe9['end']();}exports[_0xb993('0x28')]=openIssue;exports['send']=function(_0x32f9f0,_0xa1eb24){_0x32f9f0[_0xb993('0x29')]['ip']=_0x32f9f0[_0xb993('0x2a')][_0xb993('0x2b')]||_0x32f9f0[_0xb993('0x2c')][_0xb993('0x2d')]||_0x32f9f0['socket']['remoteAddress']||_0x32f9f0[_0xb993('0x2c')][_0xb993('0x2e')][_0xb993('0x2d')];return openIssue(_0x32f9f0[_0xb993('0x29')],_0xa1eb24);}; \ No newline at end of file +var _0x385a=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','headers','x-forwarded-for','connection','socket','body','https','../../config/logger','api','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','stringify','issuetype','fields','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','statusCode','json','error','status'];(function(_0x52ea08,_0x15d935){var _0x28d546=function(_0x4a3aa7){while(--_0x4a3aa7){_0x52ea08['push'](_0x52ea08['shift']());}};_0x28d546(++_0x15d935);}(_0x385a,0x1d7));var _0xa385=function(_0x1f3ee8,_0x5dc6da){_0x1f3ee8=_0x1f3ee8-0x0;var _0x966a63=_0x385a[_0x1f3ee8];return _0x966a63;};'use strict';var BPromise=require('bluebird');var https=require(_0xa385('0x0'));var logger=require(_0xa385('0x1'))(_0xa385('0x2'));var USERNAME=_0xa385('0x3');var PASSWORD=_0xa385('0x4');function openIssue(_0x515ce6,_0x18c550){var _0x5ae8de={'fields':{'project':{'key':_0x515ce6[_0xa385('0x5')]||'MOTGUI'},'summary':(_0x515ce6[_0xa385('0x6')]||_0xa385('0x7'))+_0xa385('0x8')+_0x515ce6['ip'],'description':_0x515ce6['description']||JSON[_0xa385('0x9')](_0x515ce6),'issuetype':{'name':_0x515ce6[_0xa385('0xa')]||'Bug'}}};_0x5ae8de[_0xa385('0xb')]['customfield_11500']=_0x515ce6['email'];_0x5ae8de[_0xa385('0xb')][_0xa385('0xc')]=_0x515ce6['oldToken'];_0x5ae8de[_0xa385('0xb')][_0xa385('0xd')]=_0x515ce6[_0xa385('0xe')];_0x5ae8de[_0xa385('0xb')][_0xa385('0xf')]=_0x515ce6[_0xa385('0x10')];_0x5ae8de[_0xa385('0xb')][_0xa385('0x11')]=_0x515ce6[_0xa385('0x12')];_0x5ae8de[_0xa385('0xb')][_0xa385('0x13')]=_0x515ce6['ip'];var _0x56ae87={'host':_0xa385('0x14'),'port':0x1bb,'path':_0xa385('0x15'),'method':_0xa385('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xa385('0x17'),'Authorization':_0xa385('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xa385('0x19')](_0xa385('0x1a'))}};var _0x24b366=JSON[_0xa385('0x9')](_0x5ae8de);var _0x46c875=https[_0xa385('0x1b')](_0x56ae87,function(_0x543cb9){_0x543cb9[_0xa385('0x1c')](_0xa385('0x1d'));var _0x3250b8='';_0x543cb9['on'](_0xa385('0x1e'),function(_0x5d9057){_0x3250b8+=_0x5d9057;});_0x543cb9['on']('end',function(){if(_0x18c550){return _0x18c550['status'](_0x543cb9[_0xa385('0x1f')])[_0xa385('0x20')](JSON['parse'](_0x3250b8));}});});_0x46c875['on'](_0xa385('0x21'),function(_0x5893dd){if(_0x18c550){return _0x18c550[_0xa385('0x22')](0x1f4)[_0xa385('0x20')]({'errors':[{'message':_0xa385('0x23'),'type':_0xa385('0x24')}]});}});_0x46c875[_0xa385('0x25')](_0x24b366);_0x46c875[_0xa385('0x26')]();}exports[_0xa385('0x27')]=openIssue;exports[_0xa385('0x28')]=function(_0x1803f7,_0xed5c8b){_0x1803f7['body']['ip']=_0x1803f7[_0xa385('0x29')][_0xa385('0x2a')]||_0x1803f7[_0xa385('0x2b')]['remoteAddress']||_0x1803f7[_0xa385('0x2c')]['remoteAddress']||_0x1803f7[_0xa385('0x2b')][_0xa385('0x2c')]['remoteAddress'];return openIssue(_0x1803f7[_0xa385('0x2d')],_0xed5c8b);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 456b561..32dc8b7 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 _0x153f=['Router','fs-extra','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0xdfa30d,_0x3c4d7c){var _0x1c2061=function(_0x3ae1ec){while(--_0x3ae1ec){_0xdfa30d['push'](_0xdfa30d['shift']());}};_0x1c2061(++_0x3c4d7c);}(_0x153f,0x15b));var _0xf153=function(_0x1d7ce6,_0x479c93){_0x1d7ce6=_0x1d7ce6-0x0;var _0x4ed978=_0x153f[_0x1d7ce6];return _0x4ed978;};'use strict';var multer=require(_0xf153('0x0'));var util=require(_0xf153('0x1'));var path=require(_0xf153('0x2'));var timeout=require(_0xf153('0x3'));var express=require(_0xf153('0x4'));var router=express[_0xf153('0x5')]();var fs_extra=require(_0xf153('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf153('0x7'));var config=require('../../config/environment');var controller=require(_0xf153('0x8'));router[_0xf153('0x9')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0xb')]);router[_0xf153('0x9')]('/describe',auth[_0xf153('0xa')](),controller[_0xf153('0xc')]);router[_0xf153('0x9')](_0xf153('0xd'),auth[_0xf153('0xa')](),controller[_0xf153('0xe')]);router[_0xf153('0xf')]('/',auth[_0xf153('0xa')](),controller[_0xf153('0x10')]);router[_0xf153('0x11')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x12')]);router[_0xf153('0x13')]('/:id',auth[_0xf153('0xa')](),controller[_0xf153('0x14')]);module[_0xf153('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x4b0acc,_0xadab2e){var _0x32af3b=function(_0x44ad69){while(--_0x44ad69){_0x4b0acc['push'](_0x4b0acc['shift']());}};_0x32af3b(++_0xadab2e);}(_0xe706,0xa3));var _0x6e70=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0xe706[_0x2e5f9c];return _0x538b44;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 70dd640..de1db62 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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x246998,_0x2a57de){_0x246998=_0x246998-0x0;var _0xd66b79=_0x7a54[_0x246998];return _0xd66b79;};'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(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x7a54,0x106));var _0x47a5=function(_0x9fcc56,_0x143dd4){_0x9fcc56=_0x9fcc56-0x0;var _0x415986=_0x7a54[_0x9fcc56];return _0x415986;};'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 297b9cd..ab4ab38 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 _0x363e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','JscriptyAnswerReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0xe4d7ec,_0x3be166){var _0x34a6a5=function(_0x135362){while(--_0x135362){_0xe4d7ec['push'](_0xe4d7ec['shift']());}};_0x34a6a5(++_0x3be166);}(_0x363e,0x179));var _0xe363=function(_0x1abef0,_0x3274db){_0x1abef0=_0x1abef0-0x0;var _0x438b22=_0x363e[_0x1abef0];return _0x438b22;};'use strict';var emlformat=require(_0xe363('0x0'));var rimraf=require(_0xe363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe363('0x2'));var rp=require(_0xe363('0x3'));var moment=require(_0xe363('0x4'));var BPromise=require(_0xe363('0x5'));var Mustache=require(_0xe363('0x6'));var util=require(_0xe363('0x7'));var path=require(_0xe363('0x8'));var sox=require(_0xe363('0x9'));var csv=require(_0xe363('0xa'));var ejs=require(_0xe363('0xb'));var fs=require('fs');var fs_extra=require(_0xe363('0xc'));var _=require('lodash');var squel=require(_0xe363('0xd'));var crypto=require(_0xe363('0xe'));var jsforce=require(_0xe363('0xf'));var deskjs=require(_0xe363('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe363('0x11'));var Papa=require(_0xe363('0x12'));var Redis=require(_0xe363('0x13'));var authService=require(_0xe363('0x14'));var qs=require(_0xe363('0x15'));var as=require(_0xe363('0x16'));var hardwareService=require(_0xe363('0x17'));var logger=require('../../config/logger')(_0xe363('0x18'));var utils=require(_0xe363('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe363('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1fb0,_0x8b6974){_0x8b6974=_0x8b6974||0xcc;return function(_0x21cb92){if(_0x21cb92){return _0x4e1fb0[_0xe363('0x1b')](_0x8b6974);}return _0x4e1fb0[_0xe363('0x1c')](_0x8b6974)[_0xe363('0x1d')]();};}function respondWithResult(_0x563fbf,_0x17ff61){_0x17ff61=_0x17ff61||0xc8;return function(_0x22b227){if(_0x22b227){return _0x563fbf['status'](_0x17ff61)[_0xe363('0x1e')](_0x22b227);}};}function respondWithFilteredResult(_0x2ad0e9,_0x52e6c6){return function(_0x3c74f9){if(_0x3c74f9){var _0x73ef9a=typeof _0x52e6c6['offset']===_0xe363('0x1f')&&typeof _0x52e6c6[_0xe363('0x20')]==='undefined';var _0xecbe2c=_0x3c74f9[_0xe363('0x21')];var _0x2f2c20=_0x73ef9a?0x0:_0x52e6c6['offset'];var _0x287104=_0x73ef9a?_0x3c74f9[_0xe363('0x21')]:_0x52e6c6['offset']+_0x52e6c6[_0xe363('0x20')];var _0x110e59;if(_0x287104>=_0xecbe2c){_0x287104=_0xecbe2c;_0x110e59=0xc8;}else{_0x110e59=0xce;}_0x2ad0e9[_0xe363('0x1c')](_0x110e59);return _0x2ad0e9[_0xe363('0x22')](_0xe363('0x23'),_0x2f2c20+'-'+_0x287104+'/'+_0xecbe2c)[_0xe363('0x1e')](_0x3c74f9);}return null;};}function patchUpdates(_0x4ee855){return function(_0x3bed39){try{jsonpatch[_0xe363('0x24')](_0x3bed39,_0x4ee855,!![]);}catch(_0x14ff95){return BPromise[_0xe363('0x25')](_0x14ff95);}return _0x3bed39[_0xe363('0x26')]();};}function saveUpdates(_0x42928e,_0x24199a){return function(_0xaff56f){if(_0xaff56f){return _0xaff56f[_0xe363('0x27')](_0x42928e)[_0xe363('0x28')](function(_0x1de673){return _0x1de673;});}return null;};}function removeEntity(_0x441b94,_0x11556d){return function(_0x388223){if(_0x388223){return _0x388223[_0xe363('0x29')]()[_0xe363('0x28')](function(){_0x441b94[_0xe363('0x1c')](0xcc)[_0xe363('0x1d')]();});}};}function handleEntityNotFound(_0x19c7b4,_0x3e24ad){return function(_0x312d75){if(!_0x312d75){_0x19c7b4[_0xe363('0x1b')](0x194);}return _0x312d75;};}function handleError(_0x5b2b3d,_0xbdfae9){_0xbdfae9=_0xbdfae9||0x1f4;return function(_0x12358b){logger[_0xe363('0x2a')](_0x12358b[_0xe363('0x2b')]);if(_0x12358b[_0xe363('0x2c')]){delete _0x12358b['name'];}_0x5b2b3d[_0xe363('0x1c')](_0xbdfae9)[_0xe363('0x2d')](_0x12358b);};}exports['index']=function(_0x3cc130,_0x5a790c){var _0x3ed3e1={},_0x45d664={},_0x4c739d={'count':0x0,'rows':[]};var _0x357b6f=_[_0xe363('0x2e')](db[_0xe363('0x2f')]['rawAttributes'],function(_0x40671e){return{'name':_0x40671e[_0xe363('0x30')],'type':_0x40671e[_0xe363('0x31')][_0xe363('0x32')]};});_0x45d664['model']=_[_0xe363('0x2e')](_0x357b6f,_0xe363('0x2c'));_0x45d664[_0xe363('0x33')]=_[_0xe363('0x34')](_0x3cc130[_0xe363('0x33')]);_0x45d664[_0xe363('0x35')]=_[_0xe363('0x36')](_0x45d664[_0xe363('0x37')],_0x45d664[_0xe363('0x33')]);_0x3ed3e1[_0xe363('0x38')]=_['intersection'](_0x45d664['model'],qs[_0xe363('0x39')](_0x3cc130[_0xe363('0x33')]['fields']));_0x3ed3e1[_0xe363('0x38')]=_0x3ed3e1[_0xe363('0x38')]['length']?_0x3ed3e1[_0xe363('0x38')]:_0x45d664[_0xe363('0x37')];if(!_0x3cc130[_0xe363('0x33')][_0xe363('0x3a')]('nolimit')){_0x3ed3e1['limit']=qs[_0xe363('0x20')](_0x3cc130['query']['limit']);_0x3ed3e1[_0xe363('0x3b')]=qs[_0xe363('0x3b')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3b')]);}_0x3ed3e1[_0xe363('0x3c')]=qs[_0xe363('0x3d')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3d')]);_0x3ed3e1[_0xe363('0x3e')]=qs[_0xe363('0x35')](_[_0xe363('0x3f')](_0x3cc130[_0xe363('0x33')],_0x45d664['filters']),_0x357b6f);if(_0x3cc130['query'][_0xe363('0x40')]){_0x3ed3e1[_0xe363('0x3e')]=_[_0xe363('0x41')](_0x3ed3e1['where'],{'$or':_['map'](_0x357b6f,function(_0x815550){if(_0x815550[_0xe363('0x31')]!==_0xe363('0x42')){var _0x199c78={};_0x199c78[_0x815550['name']]={'$like':'%'+_0x3cc130[_0xe363('0x33')]['filter']+'%'};return _0x199c78;}})});}_0x3ed3e1=_[_0xe363('0x41')]({},_0x3ed3e1,_0x3cc130[_0xe363('0x43')]);var _0xbca95f={'where':_0x3ed3e1[_0xe363('0x3e')]};return db[_0xe363('0x2f')][_0xe363('0x21')](_0xbca95f)[_0xe363('0x28')](function(_0x44f03c){_0x4c739d[_0xe363('0x21')]=_0x44f03c;if(_0x3cc130['query']['includeAll']){_0x3ed3e1[_0xe363('0x44')]=[{'all':!![]}];}return db[_0xe363('0x2f')][_0xe363('0x45')](_0x3ed3e1);})[_0xe363('0x28')](function(_0x2fc2f0){_0x4c739d[_0xe363('0x46')]=_0x2fc2f0;return _0x4c739d;})[_0xe363('0x28')](respondWithFilteredResult(_0x5a790c,_0x3ed3e1))[_0xe363('0x47')](handleError(_0x5a790c,null));};exports[_0xe363('0x48')]=function(_0x4b8238,_0x3da5ba){var _0x58b837={'raw':!![],'where':{'id':_0x4b8238['params']['id']}},_0x41a87c={};_0x41a87c[_0xe363('0x37')]=_[_0xe363('0x34')](db['JscriptyAnswerReport'][_0xe363('0x49')]);_0x41a87c[_0xe363('0x33')]=_[_0xe363('0x34')](_0x4b8238[_0xe363('0x33')]);_0x41a87c[_0xe363('0x35')]=_[_0xe363('0x36')](_0x41a87c['model'],_0x41a87c[_0xe363('0x33')]);_0x58b837[_0xe363('0x38')]=_[_0xe363('0x36')](_0x41a87c[_0xe363('0x37')],qs[_0xe363('0x39')](_0x4b8238['query'][_0xe363('0x39')]));_0x58b837[_0xe363('0x38')]=_0x58b837[_0xe363('0x38')][_0xe363('0x4a')]?_0x58b837[_0xe363('0x38')]:_0x41a87c[_0xe363('0x37')];if(_0x4b8238[_0xe363('0x33')]['includeAll']){_0x58b837['include']=[{'all':!![]}];}_0x58b837=_[_0xe363('0x41')]({},_0x58b837,_0x4b8238[_0xe363('0x43')]);return db[_0xe363('0x2f')]['find'](_0x58b837)[_0xe363('0x28')](handleEntityNotFound(_0x3da5ba,null))[_0xe363('0x28')](respondWithResult(_0x3da5ba,null))['catch'](handleError(_0x3da5ba,null));};exports['create']=function(_0x2a7b42,_0x34e08b){return db[_0xe363('0x2f')][_0xe363('0x4b')](_0x2a7b42['body'],{})[_0xe363('0x28')](respondWithResult(_0x34e08b,0xc9))[_0xe363('0x47')](handleError(_0x34e08b,null));};exports['update']=function(_0x4fbdbb,_0x306afd){if(_0x4fbdbb[_0xe363('0x4c')]['id']){delete _0x4fbdbb['body']['id'];}return db[_0xe363('0x2f')]['find']({'where':{'id':_0x4fbdbb[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x306afd,null))['then'](saveUpdates(_0x4fbdbb[_0xe363('0x4c')],null))[_0xe363('0x28')](respondWithResult(_0x306afd,null))['catch'](handleError(_0x306afd,null));};exports[_0xe363('0x29')]=function(_0x43ee23,_0x55f0e6){return db[_0xe363('0x2f')]['find']({'where':{'id':_0x43ee23[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x55f0e6,null))[_0xe363('0x28')](removeEntity(_0x55f0e6,null))[_0xe363('0x47')](handleError(_0x55f0e6,null));};exports['describe']=function(_0x2ff064,_0x225a43){return db[_0xe363('0x2f')]['describe']()[_0xe363('0x28')](respondWithResult(_0x225a43,null))[_0xe363('0x47')](handleError(_0x225a43,null));}; \ No newline at end of file +var _0x9576=['rows','catch','show','params','intersection','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','include','findAll'];(function(_0x184e0d,_0x488457){var _0x31aadc=function(_0x3c6483){while(--_0x3c6483){_0x184e0d['push'](_0x184e0d['shift']());}};_0x31aadc(++_0x488457);}(_0x9576,0x182));var _0x6957=function(_0xda9704,_0x43782a){_0xda9704=_0xda9704-0x0;var _0x266dfe=_0x9576[_0xda9704];return _0x266dfe;};'use strict';var emlformat=require(_0x6957('0x0'));var rimraf=require(_0x6957('0x1'));var zipdir=require(_0x6957('0x2'));var jsonpatch=require(_0x6957('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6957('0x4'));var Mustache=require(_0x6957('0x5'));var util=require(_0x6957('0x6'));var path=require(_0x6957('0x7'));var sox=require(_0x6957('0x8'));var csv=require(_0x6957('0x9'));var ejs=require(_0x6957('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6957('0xb'));var squel=require(_0x6957('0xc'));var crypto=require(_0x6957('0xd'));var jsforce=require(_0x6957('0xe'));var deskjs=require(_0x6957('0xf'));var toCsv=require(_0x6957('0x9'));var querystring=require('querystring');var Papa=require(_0x6957('0x10'));var Redis=require(_0x6957('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6957('0x12'));var hardwareService=require(_0x6957('0x13'));var logger=require(_0x6957('0x14'))(_0x6957('0x15'));var utils=require(_0x6957('0x16'));var config=require(_0x6957('0x17'));var licenseUtil=require(_0x6957('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5888d6,_0x548647){_0x548647=_0x548647||0xcc;return function(_0x3f40f0){if(_0x3f40f0){return _0x5888d6[_0x6957('0x19')](_0x548647);}return _0x5888d6[_0x6957('0x1a')](_0x548647)[_0x6957('0x1b')]();};}function respondWithResult(_0x345c3e,_0x1fd3d9){_0x1fd3d9=_0x1fd3d9||0xc8;return function(_0x25d32e){if(_0x25d32e){return _0x345c3e['status'](_0x1fd3d9)['json'](_0x25d32e);}};}function respondWithFilteredResult(_0x4f82cb,_0x35fffc){return function(_0x256ac7){if(_0x256ac7){var _0x228f76=typeof _0x35fffc[_0x6957('0x1c')]==='undefined'&&typeof _0x35fffc[_0x6957('0x1d')]==='undefined';var _0x2a39b5=_0x256ac7[_0x6957('0x1e')];var _0x49aa31=_0x228f76?0x0:_0x35fffc[_0x6957('0x1c')];var _0x448ff6=_0x228f76?_0x256ac7[_0x6957('0x1e')]:_0x35fffc['offset']+_0x35fffc[_0x6957('0x1d')];var _0x2c103c;if(_0x448ff6>=_0x2a39b5){_0x448ff6=_0x2a39b5;_0x2c103c=0xc8;}else{_0x2c103c=0xce;}_0x4f82cb[_0x6957('0x1a')](_0x2c103c);return _0x4f82cb[_0x6957('0x1f')](_0x6957('0x20'),_0x49aa31+'-'+_0x448ff6+'/'+_0x2a39b5)[_0x6957('0x21')](_0x256ac7);}return null;};}function patchUpdates(_0x35ee5b){return function(_0x3081b2){try{jsonpatch['apply'](_0x3081b2,_0x35ee5b,!![]);}catch(_0x5ee3f8){return BPromise[_0x6957('0x22')](_0x5ee3f8);}return _0x3081b2[_0x6957('0x23')]();};}function saveUpdates(_0x18037f,_0x2569f4){return function(_0x3591fa){if(_0x3591fa){return _0x3591fa[_0x6957('0x24')](_0x18037f)[_0x6957('0x25')](function(_0x310a5e){return _0x310a5e;});}return null;};}function removeEntity(_0x56b0ba,_0x2b2dcd){return function(_0x3c9de7){if(_0x3c9de7){return _0x3c9de7[_0x6957('0x26')]()[_0x6957('0x25')](function(){_0x56b0ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1e6af,_0x2a57b6){return function(_0x5c4e49){if(!_0x5c4e49){_0xa1e6af['sendStatus'](0x194);}return _0x5c4e49;};}function handleError(_0x320e7d,_0xa2f92f){_0xa2f92f=_0xa2f92f||0x1f4;return function(_0x3bc22f){logger['error'](_0x3bc22f[_0x6957('0x27')]);if(_0x3bc22f[_0x6957('0x28')]){delete _0x3bc22f[_0x6957('0x28')];}_0x320e7d[_0x6957('0x1a')](_0xa2f92f)[_0x6957('0x29')](_0x3bc22f);};}exports[_0x6957('0x2a')]=function(_0x2d33ef,_0x320e1a){var _0x595770={},_0x2e7fe1={},_0x3a6e07={'count':0x0,'rows':[]};var _0xd02a9=_[_0x6957('0x2b')](db[_0x6957('0x2c')][_0x6957('0x2d')],function(_0x3f8745){return{'name':_0x3f8745[_0x6957('0x2e')],'type':_0x3f8745[_0x6957('0x2f')][_0x6957('0x30')]};});_0x2e7fe1[_0x6957('0x31')]=_['map'](_0xd02a9,'name');_0x2e7fe1[_0x6957('0x32')]=_[_0x6957('0x33')](_0x2d33ef[_0x6957('0x32')]);_0x2e7fe1[_0x6957('0x34')]=_['intersection'](_0x2e7fe1[_0x6957('0x31')],_0x2e7fe1[_0x6957('0x32')]);_0x595770[_0x6957('0x35')]=_['intersection'](_0x2e7fe1['model'],qs[_0x6957('0x36')](_0x2d33ef[_0x6957('0x32')][_0x6957('0x36')]));_0x595770['attributes']=_0x595770[_0x6957('0x35')][_0x6957('0x37')]?_0x595770[_0x6957('0x35')]:_0x2e7fe1[_0x6957('0x31')];if(!_0x2d33ef[_0x6957('0x32')][_0x6957('0x38')](_0x6957('0x39'))){_0x595770[_0x6957('0x1d')]=qs[_0x6957('0x1d')](_0x2d33ef['query'][_0x6957('0x1d')]);_0x595770[_0x6957('0x1c')]=qs[_0x6957('0x1c')](_0x2d33ef['query']['offset']);}_0x595770['order']=qs[_0x6957('0x3a')](_0x2d33ef['query']['sort']);_0x595770[_0x6957('0x3b')]=qs[_0x6957('0x34')](_['pick'](_0x2d33ef['query'],_0x2e7fe1[_0x6957('0x34')]),_0xd02a9);if(_0x2d33ef[_0x6957('0x32')][_0x6957('0x3c')]){_0x595770[_0x6957('0x3b')]=_[_0x6957('0x3d')](_0x595770['where'],{'$or':_[_0x6957('0x2b')](_0xd02a9,function(_0x5c9be3){if(_0x5c9be3['type']!=='VIRTUAL'){var _0x5ab079={};_0x5ab079[_0x5c9be3['name']]={'$like':'%'+_0x2d33ef['query']['filter']+'%'};return _0x5ab079;}})});}_0x595770=_['merge']({},_0x595770,_0x2d33ef['options']);var _0x20caa3={'where':_0x595770[_0x6957('0x3b')]};return db[_0x6957('0x2c')][_0x6957('0x1e')](_0x20caa3)[_0x6957('0x25')](function(_0x51b189){_0x3a6e07[_0x6957('0x1e')]=_0x51b189;if(_0x2d33ef[_0x6957('0x32')]['includeAll']){_0x595770[_0x6957('0x3e')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x6957('0x3f')](_0x595770);})[_0x6957('0x25')](function(_0x22ec26){_0x3a6e07[_0x6957('0x40')]=_0x22ec26;return _0x3a6e07;})[_0x6957('0x25')](respondWithFilteredResult(_0x320e1a,_0x595770))[_0x6957('0x41')](handleError(_0x320e1a,null));};exports[_0x6957('0x42')]=function(_0x16575e,_0x18fb2a){var _0x35fa2d={'raw':!![],'where':{'id':_0x16575e[_0x6957('0x43')]['id']}},_0x421526={};_0x421526[_0x6957('0x31')]=_[_0x6957('0x33')](db[_0x6957('0x2c')][_0x6957('0x2d')]);_0x421526['query']=_[_0x6957('0x33')](_0x16575e['query']);_0x421526['filters']=_[_0x6957('0x44')](_0x421526['model'],_0x421526['query']);_0x35fa2d[_0x6957('0x35')]=_[_0x6957('0x44')](_0x421526[_0x6957('0x31')],qs[_0x6957('0x36')](_0x16575e[_0x6957('0x32')][_0x6957('0x36')]));_0x35fa2d[_0x6957('0x35')]=_0x35fa2d[_0x6957('0x35')][_0x6957('0x37')]?_0x35fa2d[_0x6957('0x35')]:_0x421526['model'];if(_0x16575e['query'][_0x6957('0x45')]){_0x35fa2d['include']=[{'all':!![]}];}_0x35fa2d=_[_0x6957('0x3d')]({},_0x35fa2d,_0x16575e[_0x6957('0x46')]);return db['JscriptyAnswerReport'][_0x6957('0x47')](_0x35fa2d)[_0x6957('0x25')](handleEntityNotFound(_0x18fb2a,null))[_0x6957('0x25')](respondWithResult(_0x18fb2a,null))[_0x6957('0x41')](handleError(_0x18fb2a,null));};exports[_0x6957('0x48')]=function(_0x497e99,_0x9763aa){return db[_0x6957('0x2c')][_0x6957('0x48')](_0x497e99[_0x6957('0x49')],{})['then'](respondWithResult(_0x9763aa,0xc9))[_0x6957('0x41')](handleError(_0x9763aa,null));};exports[_0x6957('0x24')]=function(_0x5c5d5b,_0x1768ba){if(_0x5c5d5b[_0x6957('0x49')]['id']){delete _0x5c5d5b[_0x6957('0x49')]['id'];}return db[_0x6957('0x2c')]['find']({'where':{'id':_0x5c5d5b['params']['id']}})[_0x6957('0x25')](handleEntityNotFound(_0x1768ba,null))[_0x6957('0x25')](saveUpdates(_0x5c5d5b[_0x6957('0x49')],null))[_0x6957('0x25')](respondWithResult(_0x1768ba,null))['catch'](handleError(_0x1768ba,null));};exports[_0x6957('0x26')]=function(_0x4ca6dc,_0x10fac5){return db['JscriptyAnswerReport'][_0x6957('0x47')]({'where':{'id':_0x4ca6dc['params']['id']}})[_0x6957('0x25')](handleEntityNotFound(_0x10fac5,null))['then'](removeEntity(_0x10fac5,null))['catch'](handleError(_0x10fac5,null));};exports[_0x6957('0x4a')]=function(_0x371e29,_0x38e917){return db[_0x6957('0x2c')][_0x6957('0x4a')]()[_0x6957('0x25')](respondWithResult(_0x38e917,null))[_0x6957('0x41')](handleError(_0x38e917,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index b9d1ac5..9b5c2c2 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 _0x041c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util'];(function(_0x30079b,_0x3833cd){var _0x42bdd3=function(_0x5952fa){while(--_0x5952fa){_0x30079b['push'](_0x30079b['shift']());}};_0x42bdd3(++_0x3833cd);}(_0x041c,0x8a));var _0xc041=function(_0x3389ba,_0x3284b1){_0x3389ba=_0x3389ba-0x0;var _0x5515e2=_0x041c[_0x3389ba];return _0x5515e2;};'use strict';var _=require(_0xc041('0x0'));var util=require(_0xc041('0x1'));var logger=require(_0xc041('0x2'))(_0xc041('0x3'));var moment=require(_0xc041('0x4'));var BPromise=require('bluebird');var rp=require(_0xc041('0x5'));var fs=require('fs');var path=require(_0xc041('0x6'));var rimraf=require(_0xc041('0x7'));var config=require(_0xc041('0x8'));var attributes=require(_0xc041('0x9'));module[_0xc041('0xa')]=function(_0x5b8af8,_0x1981e0){return _0x5b8af8[_0xc041('0xb')](_0xc041('0xc'),attributes,{'tableName':_0xc041('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7034=['lodash','util','../../config/logger','bluebird','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0xb7339e,_0x22a52b){var _0x4a74f2=function(_0x3f4121){while(--_0x3f4121){_0xb7339e['push'](_0xb7339e['shift']());}};_0x4a74f2(++_0x22a52b);}(_0x7034,0x1a4));var _0x4703=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x7034[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x4703('0x0'));var util=require(_0x4703('0x1'));var logger=require(_0x4703('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4703('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4703('0x4'));var attributes=require(_0x4703('0x5'));module[_0x4703('0x6')]=function(_0x4fa697,_0x2c1483){return _0x4fa697[_0x4703('0x7')](_0x4703('0x8'),attributes,{'tableName':_0x4703('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index b77dc6a..23b40e5 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 _0x5974=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','lodash','moment','randomstring'];(function(_0x1610d9,_0x5248b0){var _0x48a47a=function(_0x1e54f5){while(--_0x1e54f5){_0x1610d9['push'](_0x1610d9['shift']());}};_0x48a47a(++_0x5248b0);}(_0x5974,0xe1));var _0x4597=function(_0x59591b,_0x354045){_0x59591b=_0x59591b-0x0;var _0x576642=_0x5974[_0x59591b];return _0x576642;};'use strict';var _=require(_0x4597('0x0'));var util=require('util');var moment=require(_0x4597('0x1'));var BPromise=require('bluebird');var rs=require(_0x4597('0x2'));var fs=require('fs');var Redis=require(_0x4597('0x3'));var db=require(_0x4597('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4597('0x5'))('rpc');var config=require(_0x4597('0x6'));var jayson=require(_0x4597('0x7'));var client=jayson[_0x4597('0x8')][_0x4597('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xca4aea,_0x10e417,_0x59ab16){return new BPromise(function(_0x43b08f,_0x2463d3){return client['request'](_0xca4aea,_0x59ab16)[_0x4597('0xa')](function(_0x991029){logger[_0x4597('0xb')](_0x4597('0xc'),_0x10e417,'request\x20sent');logger[_0x4597('0xd')](_0x4597('0xe'),_0x10e417,_0x4597('0xf'),JSON[_0x4597('0x10')](_0x991029));if(_0x991029['error']){if(_0x991029[_0x4597('0x11')]['code']===0x1f4){logger['error'](_0x4597('0xc'),_0x10e417,_0x991029[_0x4597('0x11')][_0x4597('0x12')]);return _0x2463d3(_0x991029[_0x4597('0x11')]['message']);}logger[_0x4597('0x11')](_0x4597('0xc'),_0x10e417,_0x991029['error'][_0x4597('0x12')]);return _0x43b08f(_0x991029[_0x4597('0x11')][_0x4597('0x12')]);}else{logger['info'](_0x4597('0xc'),_0x10e417,_0x4597('0xf'));_0x43b08f(_0x991029['result']['message']);}})['catch'](function(_0x302f3e){logger[_0x4597('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x10e417,_0x302f3e);_0x2463d3(_0x302f3e);});});} \ No newline at end of file +var _0xb501=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0xb501,0x6d));var _0x1b50=function(_0x5edfad,_0x18ec05){_0x5edfad=_0x5edfad-0x0;var _0x4c5613=_0xb501[_0x5edfad];return _0x4c5613;};'use strict';var _=require(_0x1b50('0x0'));var util=require(_0x1b50('0x1'));var moment=require('moment');var BPromise=require(_0x1b50('0x2'));var rs=require(_0x1b50('0x3'));var fs=require('fs');var Redis=require(_0x1b50('0x4'));var db=require(_0x1b50('0x5'))['db'];var utils=require(_0x1b50('0x6'));var logger=require(_0x1b50('0x7'))('rpc');var config=require(_0x1b50('0x8'));var jayson=require(_0x1b50('0x9'));var client=jayson[_0x1b50('0xa')][_0x1b50('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xc6f694,_0x6534fe,_0x2d2814){return new BPromise(function(_0x3593f9,_0x4d7016){return client[_0x1b50('0xc')](_0xc6f694,_0x2d2814)[_0x1b50('0xd')](function(_0x5ba25c){logger[_0x1b50('0xe')](_0x1b50('0xf'),_0x6534fe,'request\x20sent');logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x6534fe,_0x1b50('0x10'),JSON['stringify'](_0x5ba25c));if(_0x5ba25c['error']){if(_0x5ba25c[_0x1b50('0x11')][_0x1b50('0x12')]===0x1f4){logger['error'](_0x1b50('0xf'),_0x6534fe,_0x5ba25c['error'][_0x1b50('0x13')]);return _0x4d7016(_0x5ba25c['error'][_0x1b50('0x13')]);}logger[_0x1b50('0x11')](_0x1b50('0xf'),_0x6534fe,_0x5ba25c[_0x1b50('0x11')][_0x1b50('0x13')]);return _0x3593f9(_0x5ba25c[_0x1b50('0x11')][_0x1b50('0x13')]);}else{logger[_0x1b50('0xe')](_0x1b50('0xf'),_0x6534fe,_0x1b50('0x10'));_0x3593f9(_0x5ba25c[_0x1b50('0x14')]['message']);}})[_0x1b50('0x15')](function(_0x28dd77){logger[_0x1b50('0x11')](_0x1b50('0xf'),_0x6534fe,_0x28dd77);_0x4d7016(_0x28dd77);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 73014e7..4445d60 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 _0x571d=['getAnswers','/:id/summary','post','create','/:id/clone','clone','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/sessions','/:id/answers'];(function(_0x7adaf0,_0x49d6f2){var _0x467057=function(_0x50e030){while(--_0x50e030){_0x7adaf0['push'](_0x7adaf0['shift']());}};_0x467057(++_0x49d6f2);}(_0x571d,0x1d7));var _0xd571=function(_0x4603c6,_0x2012db){_0x4603c6=_0x4603c6-0x0;var _0x233b6e=_0x571d[_0x4603c6];return _0x233b6e;};'use strict';var multer=require(_0xd571('0x0'));var util=require(_0xd571('0x1'));var path=require('path');var timeout=require(_0xd571('0x2'));var express=require('express');var router=express[_0xd571('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd571('0x4'));var config=require(_0xd571('0x5'));var controller=require(_0xd571('0x6'));router[_0xd571('0x7')]('/',auth[_0xd571('0x8')](),controller[_0xd571('0x9')]);router['get'](_0xd571('0xa'),auth[_0xd571('0x8')](),controller['show']);router[_0xd571('0x7')](_0xd571('0xb'),auth['isAuthenticated'](),controller['getSessions']);router[_0xd571('0x7')](_0xd571('0xc'),auth[_0xd571('0x8')](),controller[_0xd571('0xd')]);router[_0xd571('0x7')](_0xd571('0xe'),auth[_0xd571('0x8')](),timeout('30s'),controller['getSummary']);router[_0xd571('0xf')]('/',auth[_0xd571('0x8')](),controller[_0xd571('0x10')]);router[_0xd571('0xf')](_0xd571('0x11'),auth[_0xd571('0x8')](),controller[_0xd571('0x12')]);router['put'](_0xd571('0xa'),auth[_0xd571('0x8')](),controller['update']);router[_0xd571('0x13')](_0xd571('0xa'),auth[_0xd571('0x8')](),controller[_0xd571('0x14')]);module[_0xd571('0x15')]=router; \ No newline at end of file +var _0xd029=['exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','index','get','/:id','isAuthenticated','show','/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','delete','destroy'];(function(_0x39e853,_0x16d356){var _0x3a0ddb=function(_0x3fef8c){while(--_0x3fef8c){_0x39e853['push'](_0x39e853['shift']());}};_0x3a0ddb(++_0x16d356);}(_0xd029,0xe1));var _0x9d02=function(_0x3a3b0a,_0x1b4682){_0x3a3b0a=_0x3a3b0a-0x0;var _0x19ca0d=_0xd029[_0x3a3b0a];return _0x19ca0d;};'use strict';var multer=require(_0x9d02('0x0'));var util=require(_0x9d02('0x1'));var path=require(_0x9d02('0x2'));var timeout=require('connect-timeout');var express=require(_0x9d02('0x3'));var router=express[_0x9d02('0x4')]();var fs_extra=require(_0x9d02('0x5'));var auth=require(_0x9d02('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9d02('0x7'));var controller=require(_0x9d02('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9d02('0x9')]);router[_0x9d02('0xa')](_0x9d02('0xb'),auth[_0x9d02('0xc')](),controller[_0x9d02('0xd')]);router[_0x9d02('0xa')](_0x9d02('0xe'),auth[_0x9d02('0xc')](),controller['getSessions']);router['get'](_0x9d02('0xf'),auth[_0x9d02('0xc')](),controller[_0x9d02('0x10')]);router[_0x9d02('0xa')](_0x9d02('0x11'),auth[_0x9d02('0xc')](),timeout(_0x9d02('0x12')),controller[_0x9d02('0x13')]);router[_0x9d02('0x14')]('/',auth['isAuthenticated'](),controller[_0x9d02('0x15')]);router[_0x9d02('0x14')](_0x9d02('0x16'),auth['isAuthenticated'](),controller[_0x9d02('0x17')]);router[_0x9d02('0x18')]('/:id',auth[_0x9d02('0xc')](),controller['update']);router[_0x9d02('0x19')]('/:id',auth[_0x9d02('0xc')](),controller[_0x9d02('0x1a')]);module[_0x9d02('0x1b')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 6970b3f..d60e005 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 _0xd23b=['description','BOOLEAN','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x2491b3,_0x4f75d6){var _0x354e25=function(_0xb7ff36){while(--_0xb7ff36){_0x2491b3['push'](_0x2491b3['shift']());}};_0x354e25(++_0x4f75d6);}(_0xd23b,0x1d2));var _0xbd23=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0xd23b[_0x8ba19a];return _0x2bd8b4;};'use strict';var Sequelize=require('sequelize');var _=require(_0xbd23('0x0'));var util=require(_0xbd23('0x1'));module[_0xbd23('0x2')]={'name':{'type':Sequelize[_0xbd23('0x3')],'unique':_0xbd23('0x4')},'description':{'type':Sequelize[_0xbd23('0x3')]},'formData':{'type':Sequelize[_0xbd23('0x5')](_0xbd23('0x6')),'set':function(_0x249faf){if(_[_0xbd23('0x7')](_0x249faf)){this[_0xbd23('0x8')](_0xbd23('0x9'),JSON['stringify'](_0x249faf));}else if(_[_0xbd23('0xa')](_0x249faf)){this[_0xbd23('0x8')](_0xbd23('0x9'),_0x249faf);}else{this[_0xbd23('0x8')](_0xbd23('0x9'),util[_0xbd23('0xb')](_0xbd23('0xc'),this[_0xbd23('0xd')](_0xbd23('0x4'))||'',this[_0xbd23('0xd')](_0xbd23('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xbd23('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xbd23('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x0886=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','setDataValue','formData','stringify','isString','format'];(function(_0xcf4569,_0x1ce755){var _0x7fef=function(_0x374ab8){while(--_0x374ab8){_0xcf4569['push'](_0xcf4569['shift']());}};_0x7fef(++_0x1ce755);}(_0x0886,0x16f));var _0x6088=function(_0x473d0f,_0x90f587){_0x473d0f=_0x473d0f-0x0;var _0x2cd3b1=_0x0886[_0x473d0f];return _0x2cd3b1;};'use strict';var Sequelize=require(_0x6088('0x0'));var _=require(_0x6088('0x1'));var util=require('util');module[_0x6088('0x2')]={'name':{'type':Sequelize[_0x6088('0x3')],'unique':_0x6088('0x4')},'description':{'type':Sequelize[_0x6088('0x3')]},'formData':{'type':Sequelize[_0x6088('0x5')]('long'),'set':function(_0x19313b){if(_['isObjectLike'](_0x19313b)){this[_0x6088('0x6')](_0x6088('0x7'),JSON[_0x6088('0x8')](_0x19313b));}else if(_[_0x6088('0x9')](_0x19313b)){this[_0x6088('0x6')](_0x6088('0x7'),_0x19313b);}else{this['setDataValue'](_0x6088('0x7'),util[_0x6088('0xa')](_0x6088('0xb'),this['getDataValue'](_0x6088('0x4'))||'',this[_0x6088('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6088('0xd')],'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 7692f81..38d5666 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 _0x3611=['../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','pick','filter','where','merge','include','rows','show','params','length','options','find','catch','create','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','getSessions','findOne','JscriptySessionReport','nolimit','JscriptyAnswerReport','sort','ProjectId','findAll','number','fromCharCode','toString','indexOf','replace','startTime','starttime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','eml-format','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x529e62,_0x22128a){var _0x352fbe=function(_0x1acb27){while(--_0x1acb27){_0x529e62['push'](_0x529e62['shift']());}};_0x352fbe(++_0x22128a);}(_0x3611,0x136));var _0x1361=function(_0x4070d8,_0x3ebb3c){_0x4070d8=_0x4070d8-0x0;var _0x19eec3=_0x3611[_0x4070d8];return _0x19eec3;};'use strict';var emlformat=require(_0x1361('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1361('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1361('0x2'));var Mustache=require(_0x1361('0x3'));var util=require(_0x1361('0x4'));var path=require(_0x1361('0x5'));var sox=require('sox');var csv=require(_0x1361('0x6'));var ejs=require(_0x1361('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1361('0x8'));var squel=require('squel');var crypto=require(_0x1361('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1361('0x6'));var querystring=require(_0x1361('0xa'));var Papa=require(_0x1361('0xb'));var Redis=require(_0x1361('0xc'));var authService=require(_0x1361('0xd'));var qs=require(_0x1361('0xe'));var as=require(_0x1361('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1361('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x1361('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x1361('0x12'))['db'];function respondWithStatusCode(_0x2cecd6,_0xbc9d68){_0xbc9d68=_0xbc9d68||0xcc;return function(_0x1a36e9){if(_0x1a36e9){return _0x2cecd6[_0x1361('0x13')](_0xbc9d68);}return _0x2cecd6[_0x1361('0x14')](_0xbc9d68)[_0x1361('0x15')]();};}function respondWithResult(_0x161f92,_0x4a8345){_0x4a8345=_0x4a8345||0xc8;return function(_0x4c33e0){if(_0x4c33e0){return _0x161f92[_0x1361('0x14')](_0x4a8345)['json'](_0x4c33e0);}};}function respondWithFilteredResult(_0x577190,_0x2a0423){return function(_0x18a1fc){if(_0x18a1fc){var _0x31e1c7=typeof _0x2a0423[_0x1361('0x16')]==='undefined'&&typeof _0x2a0423[_0x1361('0x17')]===_0x1361('0x18');var _0x23dc0b=_0x18a1fc[_0x1361('0x19')];var _0x3c01f1=_0x31e1c7?0x0:_0x2a0423[_0x1361('0x16')];var _0x59c9e7=_0x31e1c7?_0x18a1fc[_0x1361('0x19')]:_0x2a0423['offset']+_0x2a0423[_0x1361('0x17')];var _0xe2ac9c;if(_0x59c9e7>=_0x23dc0b){_0x59c9e7=_0x23dc0b;_0xe2ac9c=0xc8;}else{_0xe2ac9c=0xce;}_0x577190[_0x1361('0x14')](_0xe2ac9c);return _0x577190[_0x1361('0x1a')](_0x1361('0x1b'),_0x3c01f1+'-'+_0x59c9e7+'/'+_0x23dc0b)['json'](_0x18a1fc);}return null;};}function patchUpdates(_0x26dacb){return function(_0x17f576){try{jsonpatch[_0x1361('0x1c')](_0x17f576,_0x26dacb,!![]);}catch(_0x273193){return BPromise['reject'](_0x273193);}return _0x17f576['save']();};}function saveUpdates(_0xa3f1f8,_0x52bbff){return function(_0x314b77){if(_0x314b77){return _0x314b77[_0x1361('0x1d')](_0xa3f1f8)[_0x1361('0x1e')](function(_0x14ab6d){return _0x14ab6d;});}return null;};}function removeEntity(_0x4406e2,_0x5c3c4b){return function(_0x1420e3){if(_0x1420e3){return _0x1420e3[_0x1361('0x1f')]()[_0x1361('0x1e')](function(){var _0x1d9c1d=_0x1420e3['get']({'plain':!![]});var _0x16cf21=_0x1361('0x20');return db[_0x1361('0x21')]['destroy']({'where':{'type':_0x16cf21,'resourceId':_0x1d9c1d['id']}})[_0x1361('0x1e')](function(){return _0x1420e3;});})[_0x1361('0x1e')](function(){_0x4406e2['status'](0xcc)[_0x1361('0x15')]();});}};}function handleEntityNotFound(_0x4785b6,_0x1d662d){return function(_0x326760){if(!_0x326760){_0x4785b6['sendStatus'](0x194);}return _0x326760;};}function handleError(_0x454ea1,_0x48e3ea){_0x48e3ea=_0x48e3ea||0x1f4;return function(_0x51b6be){logger[_0x1361('0x22')](_0x51b6be[_0x1361('0x23')]);if(_0x51b6be[_0x1361('0x24')]){delete _0x51b6be[_0x1361('0x24')];}_0x454ea1[_0x1361('0x14')](_0x48e3ea)[_0x1361('0x25')](_0x51b6be);};}exports[_0x1361('0x26')]=function(_0x3fe34a,_0x2fd4b7){var _0x39957b={},_0x398902={},_0x4f0829={'count':0x0,'rows':[]};var _0x6abb56=_[_0x1361('0x27')](db[_0x1361('0x28')][_0x1361('0x29')],function(_0x234311){return{'name':_0x234311[_0x1361('0x2a')],'type':_0x234311[_0x1361('0x2b')][_0x1361('0x2c')]};});_0x398902[_0x1361('0x2d')]=_[_0x1361('0x27')](_0x6abb56,_0x1361('0x24'));_0x398902[_0x1361('0x2e')]=_[_0x1361('0x2f')](_0x3fe34a[_0x1361('0x2e')]);_0x398902[_0x1361('0x30')]=_[_0x1361('0x31')](_0x398902[_0x1361('0x2d')],_0x398902['query']);_0x39957b[_0x1361('0x32')]=_[_0x1361('0x31')](_0x398902['model'],qs[_0x1361('0x33')](_0x3fe34a[_0x1361('0x2e')][_0x1361('0x33')]));_0x39957b['attributes']=_0x39957b[_0x1361('0x32')]['length']?_0x39957b[_0x1361('0x32')]:_0x398902['model'];if(!_0x3fe34a['query'][_0x1361('0x34')]('nolimit')){_0x39957b[_0x1361('0x17')]=qs[_0x1361('0x17')](_0x3fe34a[_0x1361('0x2e')][_0x1361('0x17')]);_0x39957b['offset']=qs[_0x1361('0x16')](_0x3fe34a[_0x1361('0x2e')]['offset']);}_0x39957b[_0x1361('0x35')]=qs['sort'](_0x3fe34a[_0x1361('0x2e')]['sort']);_0x39957b['where']=qs[_0x1361('0x30')](_[_0x1361('0x36')](_0x3fe34a['query'],_0x398902[_0x1361('0x30')]),_0x6abb56);if(_0x3fe34a[_0x1361('0x2e')][_0x1361('0x37')]){_0x39957b[_0x1361('0x38')]=_[_0x1361('0x39')](_0x39957b[_0x1361('0x38')],{'$or':_['map'](_0x6abb56,function(_0x22c494){if(_0x22c494['type']!=='VIRTUAL'){var _0x4136c3={};_0x4136c3[_0x22c494[_0x1361('0x24')]]={'$like':'%'+_0x3fe34a[_0x1361('0x2e')][_0x1361('0x37')]+'%'};return _0x4136c3;}})});}_0x39957b=_[_0x1361('0x39')]({},_0x39957b,_0x3fe34a['options']);var _0x6cbd6a={'where':_0x39957b[_0x1361('0x38')]};return db[_0x1361('0x28')][_0x1361('0x19')](_0x6cbd6a)['then'](function(_0x825b2e){_0x4f0829[_0x1361('0x19')]=_0x825b2e;if(_0x3fe34a[_0x1361('0x2e')]['includeAll']){_0x39957b[_0x1361('0x3a')]=[{'all':!![]}];}return db[_0x1361('0x28')]['findAll'](_0x39957b);})['then'](function(_0x4b705c){_0x4f0829[_0x1361('0x3b')]=_0x4b705c;return _0x4f0829;})[_0x1361('0x1e')](respondWithFilteredResult(_0x2fd4b7,_0x39957b))['catch'](handleError(_0x2fd4b7,null));};exports[_0x1361('0x3c')]=function(_0x39dcdc,_0x59dd75){var _0x5a04a3={'raw':![],'where':{'id':_0x39dcdc[_0x1361('0x3d')]['id']}},_0x2ecbb2={};_0x2ecbb2[_0x1361('0x2d')]=_[_0x1361('0x2f')](db[_0x1361('0x28')][_0x1361('0x29')]);_0x2ecbb2[_0x1361('0x2e')]=_['keys'](_0x39dcdc['query']);_0x2ecbb2[_0x1361('0x30')]=_[_0x1361('0x31')](_0x2ecbb2['model'],_0x2ecbb2['query']);_0x5a04a3[_0x1361('0x32')]=_[_0x1361('0x31')](_0x2ecbb2[_0x1361('0x2d')],qs[_0x1361('0x33')](_0x39dcdc['query'][_0x1361('0x33')]));_0x5a04a3[_0x1361('0x32')]=_0x5a04a3['attributes'][_0x1361('0x3e')]?_0x5a04a3[_0x1361('0x32')]:_0x2ecbb2['model'];if(_0x39dcdc[_0x1361('0x2e')]['includeAll']){_0x5a04a3[_0x1361('0x3a')]=[{'all':!![]}];}_0x5a04a3=_[_0x1361('0x39')]({},_0x5a04a3,_0x39dcdc[_0x1361('0x3f')]);return db[_0x1361('0x28')][_0x1361('0x40')](_0x5a04a3)[_0x1361('0x1e')](handleEntityNotFound(_0x59dd75,null))['then'](respondWithResult(_0x59dd75,null))[_0x1361('0x41')](handleError(_0x59dd75,null));};exports[_0x1361('0x42')]=function(_0x4b8114,_0x316137){return db['JscriptyProject'][_0x1361('0x42')](_0x4b8114['body'],{})[_0x1361('0x1e')](function(_0x4f682a){var _0x54f181=_0x4b8114[_0x1361('0x43')][_0x1361('0x44')]({'plain':!![]});if(!_0x54f181)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54f181['role']===_0x1361('0x43')){var _0x3bd647=_0x4f682a[_0x1361('0x44')]({'plain':!![]});var _0x40ae45=_0x1361('0x20');return db[_0x1361('0x45')][_0x1361('0x40')]({'where':{'name':_0x40ae45,'userProfileId':_0x54f181[_0x1361('0x46')]},'raw':!![]})['then'](function(_0x4fa7f6){if(_0x4fa7f6&&_0x4fa7f6[_0x1361('0x47')]===0x0){return db[_0x1361('0x21')][_0x1361('0x42')]({'name':_0x3bd647[_0x1361('0x24')],'resourceId':_0x3bd647['id'],'type':_0x4fa7f6[_0x1361('0x24')],'sectionId':_0x4fa7f6['id']},{})[_0x1361('0x1e')](function(){return _0x4f682a;});}else{return _0x4f682a;}})['catch'](function(_0x1a7120){logger['error'](_0x1361('0x48'),_0x1a7120);throw _0x1a7120;});}return _0x4f682a;})[_0x1361('0x1e')](respondWithResult(_0x316137,0xc9))[_0x1361('0x41')](handleError(_0x316137,null));};exports['clone']=function(_0x187a8a,_0x25a05d){var _0x3fc105={'where':{'id':_0x187a8a[_0x1361('0x3d')]['id']}},_0x96ca99={};_0x96ca99['model']=_['keys'](db[_0x1361('0x28')][_0x1361('0x29')]);_0x3fc105[_0x1361('0x32')]=_[_0x1361('0x31')](_0x96ca99['model'],qs[_0x1361('0x33')](_0x187a8a[_0x1361('0x2e')][_0x1361('0x33')]));_0x3fc105[_0x1361('0x32')]=_0x3fc105[_0x1361('0x32')]['length']?_0x3fc105[_0x1361('0x32')]:_0x96ca99[_0x1361('0x2d')];if(_0x187a8a[_0x1361('0x2e')]['includeAll']){_0x3fc105[_0x1361('0x3a')]=[{'all':!![]}];}_0x3fc105=_['merge']({},_0x3fc105,_0x187a8a[_0x1361('0x3f')]);return db['JscriptyProject']['find'](_0x3fc105)[_0x1361('0x1e')](handleEntityNotFound(_0x25a05d,null))[_0x1361('0x1e')](function(_0x9057f7){if(_0x9057f7){var _0x275511=_0x9057f7['get']({'plain':!![]});_0x275511=qs[_0x1361('0x49')](_0x275511,['id',_0x1361('0x4a'),'updatedAt']);_0x187a8a['body']=_[_0x1361('0x49')](_0x187a8a[_0x1361('0x4b')],['id','createdAt','updatedAt']);return db['JscriptyProject']['create'](_[_0x1361('0x39')](_0x275511,_0x187a8a[_0x1361('0x4b')]),{'include':_0x187a8a[_0x1361('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0x1361('0x1e')](function(_0x4cc4f5){var _0x597dff=_0x187a8a['user'][_0x1361('0x44')]({'plain':!![]});if(!_0x597dff)throw new Error(_0x1361('0x4c'));if(_0x597dff[_0x1361('0x4d')]===_0x1361('0x43')){var _0x307ffa=_0x4cc4f5[_0x1361('0x44')]({'plain':!![]});var _0x392c6e='Projects';return db[_0x1361('0x45')][_0x1361('0x40')]({'where':{'name':_0x392c6e,'userProfileId':_0x597dff[_0x1361('0x46')]},'raw':!![]})[_0x1361('0x1e')](function(_0x2bde05){if(_0x2bde05&&_0x2bde05[_0x1361('0x47')]===0x0){return db[_0x1361('0x21')]['create']({'name':_0x307ffa[_0x1361('0x24')],'resourceId':_0x307ffa['id'],'type':_0x2bde05[_0x1361('0x24')],'sectionId':_0x2bde05['id']},{})[_0x1361('0x1e')](function(){return _0x4cc4f5;});}else{return _0x4cc4f5;}})[_0x1361('0x41')](function(_0x294e25){logger[_0x1361('0x22')](_0x1361('0x48'),_0x294e25);throw _0x294e25;});}return _0x4cc4f5;});}})[_0x1361('0x1e')](respondWithResult(_0x25a05d,0xc9))[_0x1361('0x41')](handleError(_0x25a05d,null));};exports[_0x1361('0x1d')]=function(_0x52288c,_0x52ac3a){if(_0x52288c[_0x1361('0x4b')]['id']){delete _0x52288c[_0x1361('0x4b')]['id'];}return db['JscriptyProject'][_0x1361('0x40')]({'where':{'id':_0x52288c[_0x1361('0x3d')]['id']}})[_0x1361('0x1e')](handleEntityNotFound(_0x52ac3a,null))[_0x1361('0x1e')](saveUpdates(_0x52288c[_0x1361('0x4b')],null))[_0x1361('0x1e')](respondWithResult(_0x52ac3a,null))[_0x1361('0x41')](handleError(_0x52ac3a,null));};exports[_0x1361('0x1f')]=function(_0x44b925,_0x4da620){return db[_0x1361('0x28')]['find']({'where':{'id':_0x44b925[_0x1361('0x3d')]['id']}})[_0x1361('0x1e')](handleEntityNotFound(_0x4da620,null))[_0x1361('0x1e')](removeEntity(_0x4da620,null))[_0x1361('0x41')](handleError(_0x4da620,null));};exports[_0x1361('0x4e')]=function(_0x4faa6f,_0x445680,_0x2d395c){var _0x1e5693={'raw':!![],'where':{}};var _0x41c6be={};var _0x53d2e8={'count':0x0,'rows':[]};return db[_0x1361('0x28')][_0x1361('0x4f')]({'where':{'id':_0x4faa6f['params']['id']}})['then'](handleEntityNotFound(_0x445680,null))['then'](function(_0x1f872b){if(_0x1f872b){_0x41c6be['model']=_[_0x1361('0x2f')](db[_0x1361('0x50')]['rawAttributes']);_0x41c6be[_0x1361('0x2e')]=_[_0x1361('0x2f')](_0x4faa6f[_0x1361('0x2e')]);_0x41c6be[_0x1361('0x30')]=_['intersection'](_0x41c6be[_0x1361('0x2d')],_0x41c6be[_0x1361('0x2e')]);_0x1e5693[_0x1361('0x32')]=_[_0x1361('0x31')](_0x41c6be[_0x1361('0x2d')],qs[_0x1361('0x33')](_0x4faa6f['query'][_0x1361('0x33')]));_0x1e5693['attributes']=_0x1e5693[_0x1361('0x32')][_0x1361('0x3e')]?_0x1e5693['attributes']:_0x41c6be[_0x1361('0x2d')];if(!_0x4faa6f[_0x1361('0x2e')][_0x1361('0x34')](_0x1361('0x51'))){_0x1e5693[_0x1361('0x17')]=qs[_0x1361('0x17')](_0x4faa6f[_0x1361('0x2e')]['limit']);_0x1e5693[_0x1361('0x16')]=qs['offset'](_0x4faa6f[_0x1361('0x2e')]['offset']);}_0x1e5693[_0x1361('0x35')]=qs['sort'](_0x4faa6f[_0x1361('0x2e')]['sort']);_0x1e5693['where']=qs[_0x1361('0x30')](_[_0x1361('0x36')](_0x4faa6f[_0x1361('0x2e')],_0x41c6be[_0x1361('0x30')]));_0x1e5693[_0x1361('0x38')]['ProjectId']=_0x1f872b['id'];if(_0x4faa6f['query']['filter']){_0x1e5693[_0x1361('0x38')]=_[_0x1361('0x39')](_0x1e5693[_0x1361('0x38')],{'$or':_['map'](_0x1e5693[_0x1361('0x32')],function(_0x55b025){var _0x3fe12c={};_0x3fe12c[_0x55b025]={'$like':'%'+_0x4faa6f[_0x1361('0x2e')][_0x1361('0x37')]+'%'};return _0x3fe12c;})});}_0x1e5693=_[_0x1361('0x39')]({},_0x1e5693,_0x4faa6f[_0x1361('0x3f')]);return db['JscriptySessionReport']['count']({'where':_0x1e5693[_0x1361('0x38')]})[_0x1361('0x1e')](function(_0x4af835){_0x53d2e8[_0x1361('0x19')]=_0x4af835;if(_0x4faa6f[_0x1361('0x2e')]['includeAll']){_0x1e5693[_0x1361('0x3a')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x1e5693);})[_0x1361('0x1e')](function(_0x1366a7){_0x53d2e8[_0x1361('0x3b')]=_0x1366a7;return _0x53d2e8;});}})[_0x1361('0x1e')](respondWithFilteredResult(_0x445680,_0x1e5693))['catch'](handleError(_0x445680,null));};exports['getAnswers']=function(_0x44a421,_0x18acf8,_0x18fc7b){var _0x5c3afa={'raw':!![],'where':{}};var _0x5ed6a2={};var _0x122498={'count':0x0,'rows':[]};return db[_0x1361('0x28')][_0x1361('0x4f')]({'where':{'id':_0x44a421[_0x1361('0x3d')]['id']}})[_0x1361('0x1e')](handleEntityNotFound(_0x18acf8,null))[_0x1361('0x1e')](function(_0x31e03c){if(_0x31e03c){_0x5ed6a2[_0x1361('0x2d')]=_[_0x1361('0x2f')](db[_0x1361('0x52')]['rawAttributes']);_0x5ed6a2[_0x1361('0x2e')]=_[_0x1361('0x2f')](_0x44a421['query']);_0x5ed6a2[_0x1361('0x30')]=_[_0x1361('0x31')](_0x5ed6a2[_0x1361('0x2d')],_0x5ed6a2[_0x1361('0x2e')]);_0x5c3afa[_0x1361('0x32')]=_[_0x1361('0x31')](_0x5ed6a2[_0x1361('0x2d')],qs[_0x1361('0x33')](_0x44a421[_0x1361('0x2e')][_0x1361('0x33')]));_0x5c3afa[_0x1361('0x32')]=_0x5c3afa['attributes'][_0x1361('0x3e')]?_0x5c3afa['attributes']:_0x5ed6a2[_0x1361('0x2d')];if(!_0x44a421[_0x1361('0x2e')][_0x1361('0x34')](_0x1361('0x51'))){_0x5c3afa[_0x1361('0x17')]=qs[_0x1361('0x17')](_0x44a421[_0x1361('0x2e')]['limit']);_0x5c3afa[_0x1361('0x16')]=qs[_0x1361('0x16')](_0x44a421[_0x1361('0x2e')][_0x1361('0x16')]);}_0x5c3afa[_0x1361('0x35')]=qs[_0x1361('0x53')](_0x44a421[_0x1361('0x2e')][_0x1361('0x53')]);_0x5c3afa[_0x1361('0x38')]=qs['filters'](_[_0x1361('0x36')](_0x44a421['query'],_0x5ed6a2[_0x1361('0x30')]));_0x5c3afa['where'][_0x1361('0x54')]=_0x31e03c['id'];if(_0x44a421[_0x1361('0x2e')][_0x1361('0x37')]){_0x5c3afa['where']=_[_0x1361('0x39')](_0x5c3afa[_0x1361('0x38')],{'$or':_['map'](_0x5c3afa['attributes'],function(_0x206b45){var _0x35f3d9={};_0x35f3d9[_0x206b45]={'$like':'%'+_0x44a421[_0x1361('0x2e')][_0x1361('0x37')]+'%'};return _0x35f3d9;})});}_0x5c3afa=_['merge']({},_0x5c3afa,_0x44a421['options']);return db[_0x1361('0x52')][_0x1361('0x19')]({'where':_0x5c3afa[_0x1361('0x38')]})[_0x1361('0x1e')](function(_0x4caf6e){_0x122498[_0x1361('0x19')]=_0x4caf6e;if(_0x44a421['query']['includeAll']){_0x5c3afa[_0x1361('0x3a')]=[{'all':!![]}];}return db[_0x1361('0x52')][_0x1361('0x55')](_0x5c3afa);})['then'](function(_0x579adb){_0x122498['rows']=_0x579adb;return _0x122498;});}})[_0x1361('0x1e')](respondWithFilteredResult(_0x18acf8,_0x5c3afa))['catch'](handleError(_0x18acf8,null));};function char(_0x2fc1fb){return _0x1361('0x56')===typeof _0x2fc1fb?String[_0x1361('0x57')][_0x1361('0x1c')](null,arguments):_0x2fc1fb;}function needsEncapsulation(_0x265b50){return!!_0x265b50&&(_0x265b50[_0x1361('0x58')]()['indexOf'](char(0xd))>=0x0||_0x265b50['toString']()[_0x1361('0x59')](char(0xa))>=0x0||_0x265b50[_0x1361('0x58')]()[_0x1361('0x59')](char(0x2c))>=0x0||_0x265b50['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x128457){var _0x19bd77=char(0x22),_0xf1b938='\x5c'+char(0x22),_0x155823=_0x128457[_0x1361('0x58')]()[_0x1361('0x5a')](new RegExp(_0x19bd77,'g'),_0xf1b938);return _0x19bd77+_0x155823+_0x19bd77;}exports['getSummary']=function(_0x97c42e,_0x293f3c,_0x37b07e){var _0x47708a,_0x4b6868;var _0x56c574={'where':{'ProjectId':_0x97c42e[_0x1361('0x3d')]['id']}};if(_0x97c42e[_0x1361('0x2e')][_0x1361('0x5b')]){_0x56c574[_0x1361('0x38')][_0x1361('0x5c')]=JSON['parse'](_0x97c42e['query'][_0x1361('0x5b')]);}return db[_0x1361('0x50')][_0x1361('0x55')](_0x56c574)[_0x1361('0x1e')](handleEntityNotFound(_0x293f3c,null))[_0x1361('0x1e')](function(_0x3edce2){if(_0x3edce2){_0x47708a=_0x3edce2;return db[_0x1361('0x5d')][_0x1361('0x55')]({'where':{'SessionId':{'$in':_[_0x1361('0x27')](_0x47708a,'id')},'ProjectId':_0x97c42e[_0x1361('0x3d')]['id']},'order':'-createdAt'});}})[_0x1361('0x1e')](handleEntityNotFound(_0x293f3c,null))[_0x1361('0x1e')](function(_0x6bed12){if(_0x6bed12){_0x4b6868=_0x6bed12;var _0x497f3c={};for(var _0x11138d=0x0,_0xd6d2d5=_0x4b6868[_0x1361('0x3e')];_0x11138d<_0xd6d2d5;_0x11138d++){if(!_0x497f3c[_0x1361('0x34')](_0x4b6868[_0x11138d][_0x1361('0x5e')])){_0x497f3c[_0x4b6868[_0x11138d][_0x1361('0x5e')]]=needsEncapsulation(_0x4b6868[_0x11138d][_0x1361('0x5f')])?encapsulate(_0x4b6868[_0x11138d][_0x1361('0x5f')]):_0x4b6868[_0x11138d]['question'];}}var _0x3a8636=[],_0x18ff96={};for(var _0x28df1c=0x0,_0x59f4a9=_0x47708a['length'];_0x28df1c<_0x59f4a9;_0x28df1c++){_0x18ff96={'ProjectId':_0x97c42e[_0x1361('0x3d')]['id'],'SessionId':_0x47708a[_0x28df1c]['id'],'StartTime':moment(_0x47708a[_0x28df1c][_0x1361('0x5c')])[_0x1361('0x60')](_0x1361('0x61'))};for(var _0x3e2daa=0x0,_0x228ee4=_0x4b6868[_0x1361('0x3e')];_0x3e2daa<_0x228ee4;_0x3e2daa++){if(_0x4b6868[_0x3e2daa][_0x1361('0x62')]==_0x47708a[_0x28df1c]['id']&&_0x497f3c[_0x1361('0x34')](_0x4b6868[_0x3e2daa][_0x1361('0x5e')])){_0x18ff96[_0x497f3c[_0x4b6868[_0x3e2daa][_0x1361('0x5e')]]]=_0x4b6868[_0x3e2daa][_0x1361('0x63')];}}for(var _0x5a83ff in _0x497f3c){if(!_0x18ff96[_0x1361('0x34')](_0x497f3c[_0x5a83ff])){_0x18ff96[_0x497f3c[_0x5a83ff]]=null;}}_0x3a8636[_0x1361('0x64')](_0x18ff96);}return _0x3a8636;}})[_0x1361('0x1e')](function(_0x317d70){if(!_[_0x1361('0x65')](_0x317d70)){var _0x3252f0=toCsv(_0x317d70);var _0x41ed17=Date[_0x1361('0x66')]();fs['writeFileSync'](util[_0x1361('0x60')](_0x1361('0x67'),_0x97c42e[_0x1361('0x3d')]['id'],_0x41ed17),_0x3252f0);_0x293f3c[_0x1361('0x68')](_0x1361('0x69'),_0x1361('0x6a')+util[_0x1361('0x60')]('Jscripty_Project_%d_Summary_%s.csv',_0x97c42e['params']['id'],_0x41ed17));_0x293f3c[_0x1361('0x68')](_0x1361('0x6b'),_0x1361('0x6c'));return _0x293f3c['download'](util[_0x1361('0x60')](_0x1361('0x67'),_0x97c42e['params']['id'],_0x41ed17));}else{return _0x293f3c['sendStatus'](0xcc);}})[_0x1361('0x41')](handleError(_0x293f3c,null));}; \ No newline at end of file +var _0x32d4=['startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','SessionId','now','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','download','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','map','JscriptyProject','rawAttributes','fieldName','key','model','keys','filters','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','body','userProfileId','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','rows','getAnswers','JscriptyAnswerReport','toString','indexOf','replace'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x32d4,0x82));var _0x432d=function(_0x42cff8,_0x45af0a){_0x42cff8=_0x42cff8-0x0;var _0x59aff9=_0x32d4[_0x42cff8];return _0x59aff9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x432d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x432d('0x1'));var rp=require(_0x432d('0x2'));var moment=require(_0x432d('0x3'));var BPromise=require(_0x432d('0x4'));var Mustache=require(_0x432d('0x5'));var util=require(_0x432d('0x6'));var path=require(_0x432d('0x7'));var sox=require('sox');var csv=require(_0x432d('0x8'));var ejs=require(_0x432d('0x9'));var fs=require('fs');var fs_extra=require(_0x432d('0xa'));var _=require('lodash');var squel=require(_0x432d('0xb'));var crypto=require(_0x432d('0xc'));var jsforce=require(_0x432d('0xd'));var deskjs=require(_0x432d('0xe'));var toCsv=require(_0x432d('0x8'));var querystring=require(_0x432d('0xf'));var Papa=require(_0x432d('0x10'));var Redis=require(_0x432d('0x11'));var authService=require(_0x432d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x432d('0x13'));var hardwareService=require(_0x432d('0x14'));var logger=require(_0x432d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x432d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d899c,_0x2be426){_0x2be426=_0x2be426||0xcc;return function(_0x1d51c0){if(_0x1d51c0){return _0x3d899c[_0x432d('0x17')](_0x2be426);}return _0x3d899c[_0x432d('0x18')](_0x2be426)[_0x432d('0x19')]();};}function respondWithResult(_0x4d542d,_0x4d2b72){_0x4d2b72=_0x4d2b72||0xc8;return function(_0x111406){if(_0x111406){return _0x4d542d[_0x432d('0x18')](_0x4d2b72)['json'](_0x111406);}};}function respondWithFilteredResult(_0x448537,_0x54bbb0){return function(_0x49a410){if(_0x49a410){var _0x459af7=typeof _0x54bbb0[_0x432d('0x1a')]===_0x432d('0x1b')&&typeof _0x54bbb0['limit']===_0x432d('0x1b');var _0x5331cd=_0x49a410[_0x432d('0x1c')];var _0x2484e6=_0x459af7?0x0:_0x54bbb0['offset'];var _0x3fb47c=_0x459af7?_0x49a410[_0x432d('0x1c')]:_0x54bbb0[_0x432d('0x1a')]+_0x54bbb0[_0x432d('0x1d')];var _0x241609;if(_0x3fb47c>=_0x5331cd){_0x3fb47c=_0x5331cd;_0x241609=0xc8;}else{_0x241609=0xce;}_0x448537['status'](_0x241609);return _0x448537['set'](_0x432d('0x1e'),_0x2484e6+'-'+_0x3fb47c+'/'+_0x5331cd)[_0x432d('0x1f')](_0x49a410);}return null;};}function patchUpdates(_0x27bdef){return function(_0x3a4bb2){try{jsonpatch[_0x432d('0x20')](_0x3a4bb2,_0x27bdef,!![]);}catch(_0x1254a1){return BPromise[_0x432d('0x21')](_0x1254a1);}return _0x3a4bb2[_0x432d('0x22')]();};}function saveUpdates(_0x2dea38,_0x1c317d){return function(_0x59a68c){if(_0x59a68c){return _0x59a68c[_0x432d('0x23')](_0x2dea38)[_0x432d('0x24')](function(_0x23f427){return _0x23f427;});}return null;};}function removeEntity(_0x210ebc,_0x1e9247){return function(_0xa76f36){if(_0xa76f36){return _0xa76f36[_0x432d('0x25')]()[_0x432d('0x24')](function(){var _0x42b9d4=_0xa76f36[_0x432d('0x26')]({'plain':!![]});var _0xd5049f=_0x432d('0x27');return db[_0x432d('0x28')][_0x432d('0x25')]({'where':{'type':_0xd5049f,'resourceId':_0x42b9d4['id']}})[_0x432d('0x24')](function(){return _0xa76f36;});})[_0x432d('0x24')](function(){_0x210ebc[_0x432d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55650a,_0x3cefaf){return function(_0x518a38){if(!_0x518a38){_0x55650a['sendStatus'](0x194);}return _0x518a38;};}function handleError(_0x53ba4d,_0x1a7aae){_0x1a7aae=_0x1a7aae||0x1f4;return function(_0x263e6d){logger[_0x432d('0x29')](_0x263e6d[_0x432d('0x2a')]);if(_0x263e6d['name']){delete _0x263e6d[_0x432d('0x2b')];}_0x53ba4d[_0x432d('0x18')](_0x1a7aae)['send'](_0x263e6d);};}exports['index']=function(_0x19a875,_0x4a6d23){var _0xb0d98={},_0x10d9a1={},_0x7dc9ef={'count':0x0,'rows':[]};var _0x3a439d=_[_0x432d('0x2c')](db[_0x432d('0x2d')][_0x432d('0x2e')],function(_0x13bc73){return{'name':_0x13bc73[_0x432d('0x2f')],'type':_0x13bc73['type'][_0x432d('0x30')]};});_0x10d9a1[_0x432d('0x31')]=_[_0x432d('0x2c')](_0x3a439d,_0x432d('0x2b'));_0x10d9a1['query']=_[_0x432d('0x32')](_0x19a875['query']);_0x10d9a1[_0x432d('0x33')]=_['intersection'](_0x10d9a1[_0x432d('0x31')],_0x10d9a1[_0x432d('0x34')]);_0xb0d98[_0x432d('0x35')]=_[_0x432d('0x36')](_0x10d9a1['model'],qs[_0x432d('0x37')](_0x19a875[_0x432d('0x34')][_0x432d('0x37')]));_0xb0d98[_0x432d('0x35')]=_0xb0d98[_0x432d('0x35')][_0x432d('0x38')]?_0xb0d98[_0x432d('0x35')]:_0x10d9a1[_0x432d('0x31')];if(!_0x19a875['query']['hasOwnProperty'](_0x432d('0x39'))){_0xb0d98[_0x432d('0x1d')]=qs[_0x432d('0x1d')](_0x19a875[_0x432d('0x34')][_0x432d('0x1d')]);_0xb0d98['offset']=qs['offset'](_0x19a875[_0x432d('0x34')]['offset']);}_0xb0d98[_0x432d('0x3a')]=qs[_0x432d('0x3b')](_0x19a875[_0x432d('0x34')][_0x432d('0x3b')]);_0xb0d98[_0x432d('0x3c')]=qs[_0x432d('0x33')](_[_0x432d('0x3d')](_0x19a875[_0x432d('0x34')],_0x10d9a1[_0x432d('0x33')]),_0x3a439d);if(_0x19a875['query'][_0x432d('0x3e')]){_0xb0d98[_0x432d('0x3c')]=_[_0x432d('0x3f')](_0xb0d98[_0x432d('0x3c')],{'$or':_[_0x432d('0x2c')](_0x3a439d,function(_0x152a88){if(_0x152a88[_0x432d('0x40')]!==_0x432d('0x41')){var _0x5857d9={};_0x5857d9[_0x152a88[_0x432d('0x2b')]]={'$like':'%'+_0x19a875['query'][_0x432d('0x3e')]+'%'};return _0x5857d9;}})});}_0xb0d98=_[_0x432d('0x3f')]({},_0xb0d98,_0x19a875[_0x432d('0x42')]);var _0x56c4da={'where':_0xb0d98[_0x432d('0x3c')]};return db[_0x432d('0x2d')][_0x432d('0x1c')](_0x56c4da)[_0x432d('0x24')](function(_0x2de505){_0x7dc9ef[_0x432d('0x1c')]=_0x2de505;if(_0x19a875[_0x432d('0x34')][_0x432d('0x43')]){_0xb0d98[_0x432d('0x44')]=[{'all':!![]}];}return db['JscriptyProject'][_0x432d('0x45')](_0xb0d98);})['then'](function(_0x2564d0){_0x7dc9ef['rows']=_0x2564d0;return _0x7dc9ef;})[_0x432d('0x24')](respondWithFilteredResult(_0x4a6d23,_0xb0d98))[_0x432d('0x46')](handleError(_0x4a6d23,null));};exports[_0x432d('0x47')]=function(_0xa7a1ee,_0x227adc){var _0x5ba360={'raw':![],'where':{'id':_0xa7a1ee['params']['id']}},_0x12534a={};_0x12534a['model']=_[_0x432d('0x32')](db[_0x432d('0x2d')][_0x432d('0x2e')]);_0x12534a[_0x432d('0x34')]=_[_0x432d('0x32')](_0xa7a1ee[_0x432d('0x34')]);_0x12534a[_0x432d('0x33')]=_[_0x432d('0x36')](_0x12534a[_0x432d('0x31')],_0x12534a[_0x432d('0x34')]);_0x5ba360[_0x432d('0x35')]=_[_0x432d('0x36')](_0x12534a[_0x432d('0x31')],qs[_0x432d('0x37')](_0xa7a1ee[_0x432d('0x34')][_0x432d('0x37')]));_0x5ba360[_0x432d('0x35')]=_0x5ba360['attributes'][_0x432d('0x38')]?_0x5ba360['attributes']:_0x12534a[_0x432d('0x31')];if(_0xa7a1ee['query'][_0x432d('0x43')]){_0x5ba360[_0x432d('0x44')]=[{'all':!![]}];}_0x5ba360=_[_0x432d('0x3f')]({},_0x5ba360,_0xa7a1ee[_0x432d('0x42')]);return db[_0x432d('0x2d')][_0x432d('0x48')](_0x5ba360)[_0x432d('0x24')](handleEntityNotFound(_0x227adc,null))['then'](respondWithResult(_0x227adc,null))[_0x432d('0x46')](handleError(_0x227adc,null));};exports[_0x432d('0x49')]=function(_0x2cad30,_0x4d56ce){return db[_0x432d('0x2d')][_0x432d('0x49')](_0x2cad30['body'],{})[_0x432d('0x24')](function(_0xbd9b11){var _0x3ed02d=_0x2cad30[_0x432d('0x4a')][_0x432d('0x26')]({'plain':!![]});if(!_0x3ed02d)throw new Error(_0x432d('0x4b'));if(_0x3ed02d[_0x432d('0x4c')]===_0x432d('0x4a')){var _0x36348b=_0xbd9b11[_0x432d('0x26')]({'plain':!![]});var _0x5ad801=_0x432d('0x27');return db[_0x432d('0x4d')]['find']({'where':{'name':_0x5ad801,'userProfileId':_0x3ed02d['userProfileId']},'raw':!![]})[_0x432d('0x24')](function(_0x2d98db){if(_0x2d98db&&_0x2d98db[_0x432d('0x4e')]===0x0){return db[_0x432d('0x28')][_0x432d('0x49')]({'name':_0x36348b[_0x432d('0x2b')],'resourceId':_0x36348b['id'],'type':_0x2d98db[_0x432d('0x2b')],'sectionId':_0x2d98db['id']},{})[_0x432d('0x24')](function(){return _0xbd9b11;});}else{return _0xbd9b11;}})[_0x432d('0x46')](function(_0x313556){logger[_0x432d('0x29')](_0x432d('0x4f'),_0x313556);throw _0x313556;});}return _0xbd9b11;})[_0x432d('0x24')](respondWithResult(_0x4d56ce,0xc9))[_0x432d('0x46')](handleError(_0x4d56ce,null));};exports[_0x432d('0x50')]=function(_0x3ca77c,_0x36e562){var _0x2b99d3={'where':{'id':_0x3ca77c[_0x432d('0x51')]['id']}},_0x39e53e={};_0x39e53e['model']=_[_0x432d('0x32')](db[_0x432d('0x2d')]['rawAttributes']);_0x2b99d3[_0x432d('0x35')]=_[_0x432d('0x36')](_0x39e53e[_0x432d('0x31')],qs[_0x432d('0x37')](_0x3ca77c['query'][_0x432d('0x37')]));_0x2b99d3[_0x432d('0x35')]=_0x2b99d3['attributes'][_0x432d('0x38')]?_0x2b99d3[_0x432d('0x35')]:_0x39e53e['model'];if(_0x3ca77c[_0x432d('0x34')][_0x432d('0x43')]){_0x2b99d3[_0x432d('0x44')]=[{'all':!![]}];}_0x2b99d3=_['merge']({},_0x2b99d3,_0x3ca77c['options']);return db[_0x432d('0x2d')][_0x432d('0x48')](_0x2b99d3)[_0x432d('0x24')](handleEntityNotFound(_0x36e562,null))[_0x432d('0x24')](function(_0x4682a2){if(_0x4682a2){var _0x26c523=_0x4682a2[_0x432d('0x26')]({'plain':!![]});_0x26c523=qs[_0x432d('0x52')](_0x26c523,['id',_0x432d('0x53'),_0x432d('0x54')]);_0x3ca77c[_0x432d('0x55')]=_[_0x432d('0x52')](_0x3ca77c['body'],['id',_0x432d('0x53'),'updatedAt']);return db[_0x432d('0x2d')]['create'](_[_0x432d('0x3f')](_0x26c523,_0x3ca77c[_0x432d('0x55')]),{'include':_0x3ca77c[_0x432d('0x34')][_0x432d('0x43')]?[{'all':!![]}]:undefined})[_0x432d('0x24')](function(_0x39f88d){var _0x117806=_0x3ca77c[_0x432d('0x4a')][_0x432d('0x26')]({'plain':!![]});if(!_0x117806)throw new Error(_0x432d('0x4b'));if(_0x117806[_0x432d('0x4c')]===_0x432d('0x4a')){var _0x23b474=_0x39f88d[_0x432d('0x26')]({'plain':!![]});var _0x167fa9=_0x432d('0x27');return db[_0x432d('0x4d')]['find']({'where':{'name':_0x167fa9,'userProfileId':_0x117806[_0x432d('0x56')]},'raw':!![]})[_0x432d('0x24')](function(_0x260662){if(_0x260662&&_0x260662[_0x432d('0x4e')]===0x0){return db[_0x432d('0x28')][_0x432d('0x49')]({'name':_0x23b474[_0x432d('0x2b')],'resourceId':_0x23b474['id'],'type':_0x260662[_0x432d('0x2b')],'sectionId':_0x260662['id']},{})['then'](function(){return _0x39f88d;});}else{return _0x39f88d;}})[_0x432d('0x46')](function(_0x5945c8){logger['error'](_0x432d('0x4f'),_0x5945c8);throw _0x5945c8;});}return _0x39f88d;});}})[_0x432d('0x24')](respondWithResult(_0x36e562,0xc9))[_0x432d('0x46')](handleError(_0x36e562,null));};exports[_0x432d('0x23')]=function(_0x410345,_0x1f440a){if(_0x410345[_0x432d('0x55')]['id']){delete _0x410345[_0x432d('0x55')]['id'];}return db[_0x432d('0x2d')]['find']({'where':{'id':_0x410345['params']['id']}})['then'](handleEntityNotFound(_0x1f440a,null))['then'](saveUpdates(_0x410345['body'],null))['then'](respondWithResult(_0x1f440a,null))[_0x432d('0x46')](handleError(_0x1f440a,null));};exports[_0x432d('0x25')]=function(_0x5ccae6,_0x22b979){return db[_0x432d('0x2d')][_0x432d('0x48')]({'where':{'id':_0x5ccae6[_0x432d('0x51')]['id']}})[_0x432d('0x24')](handleEntityNotFound(_0x22b979,null))['then'](removeEntity(_0x22b979,null))[_0x432d('0x46')](handleError(_0x22b979,null));};exports[_0x432d('0x57')]=function(_0x1b7cf3,_0x3ddd4b,_0x15f129){var _0x5bc34f={'raw':!![],'where':{}};var _0x4bd393={};var _0x55c1ea={'count':0x0,'rows':[]};return db[_0x432d('0x2d')][_0x432d('0x58')]({'where':{'id':_0x1b7cf3[_0x432d('0x51')]['id']}})['then'](handleEntityNotFound(_0x3ddd4b,null))[_0x432d('0x24')](function(_0x2f97ae){if(_0x2f97ae){_0x4bd393[_0x432d('0x31')]=_[_0x432d('0x32')](db[_0x432d('0x59')]['rawAttributes']);_0x4bd393['query']=_[_0x432d('0x32')](_0x1b7cf3[_0x432d('0x34')]);_0x4bd393[_0x432d('0x33')]=_[_0x432d('0x36')](_0x4bd393[_0x432d('0x31')],_0x4bd393[_0x432d('0x34')]);_0x5bc34f['attributes']=_[_0x432d('0x36')](_0x4bd393[_0x432d('0x31')],qs[_0x432d('0x37')](_0x1b7cf3[_0x432d('0x34')][_0x432d('0x37')]));_0x5bc34f['attributes']=_0x5bc34f[_0x432d('0x35')][_0x432d('0x38')]?_0x5bc34f['attributes']:_0x4bd393[_0x432d('0x31')];if(!_0x1b7cf3[_0x432d('0x34')][_0x432d('0x5a')](_0x432d('0x39'))){_0x5bc34f[_0x432d('0x1d')]=qs[_0x432d('0x1d')](_0x1b7cf3[_0x432d('0x34')][_0x432d('0x1d')]);_0x5bc34f[_0x432d('0x1a')]=qs[_0x432d('0x1a')](_0x1b7cf3[_0x432d('0x34')][_0x432d('0x1a')]);}_0x5bc34f[_0x432d('0x3a')]=qs[_0x432d('0x3b')](_0x1b7cf3[_0x432d('0x34')][_0x432d('0x3b')]);_0x5bc34f[_0x432d('0x3c')]=qs[_0x432d('0x33')](_['pick'](_0x1b7cf3['query'],_0x4bd393[_0x432d('0x33')]));_0x5bc34f[_0x432d('0x3c')][_0x432d('0x5b')]=_0x2f97ae['id'];if(_0x1b7cf3[_0x432d('0x34')]['filter']){_0x5bc34f['where']=_[_0x432d('0x3f')](_0x5bc34f[_0x432d('0x3c')],{'$or':_[_0x432d('0x2c')](_0x5bc34f[_0x432d('0x35')],function(_0x3b0ed2){var _0x205e12={};_0x205e12[_0x3b0ed2]={'$like':'%'+_0x1b7cf3['query'][_0x432d('0x3e')]+'%'};return _0x205e12;})});}_0x5bc34f=_[_0x432d('0x3f')]({},_0x5bc34f,_0x1b7cf3[_0x432d('0x42')]);return db[_0x432d('0x59')]['count']({'where':_0x5bc34f['where']})[_0x432d('0x24')](function(_0x26a87a){_0x55c1ea['count']=_0x26a87a;if(_0x1b7cf3['query'][_0x432d('0x43')]){_0x5bc34f[_0x432d('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x432d('0x45')](_0x5bc34f);})[_0x432d('0x24')](function(_0x29bbda){_0x55c1ea[_0x432d('0x5c')]=_0x29bbda;return _0x55c1ea;});}})[_0x432d('0x24')](respondWithFilteredResult(_0x3ddd4b,_0x5bc34f))['catch'](handleError(_0x3ddd4b,null));};exports[_0x432d('0x5d')]=function(_0xae2d39,_0x2fe0a0,_0x44aa38){var _0x585694={'raw':!![],'where':{}};var _0x5603e8={};var _0x419778={'count':0x0,'rows':[]};return db[_0x432d('0x2d')][_0x432d('0x58')]({'where':{'id':_0xae2d39[_0x432d('0x51')]['id']}})[_0x432d('0x24')](handleEntityNotFound(_0x2fe0a0,null))[_0x432d('0x24')](function(_0x6f0c97){if(_0x6f0c97){_0x5603e8[_0x432d('0x31')]=_[_0x432d('0x32')](db[_0x432d('0x5e')][_0x432d('0x2e')]);_0x5603e8[_0x432d('0x34')]=_['keys'](_0xae2d39[_0x432d('0x34')]);_0x5603e8['filters']=_[_0x432d('0x36')](_0x5603e8['model'],_0x5603e8['query']);_0x585694[_0x432d('0x35')]=_[_0x432d('0x36')](_0x5603e8[_0x432d('0x31')],qs[_0x432d('0x37')](_0xae2d39[_0x432d('0x34')][_0x432d('0x37')]));_0x585694[_0x432d('0x35')]=_0x585694[_0x432d('0x35')][_0x432d('0x38')]?_0x585694[_0x432d('0x35')]:_0x5603e8[_0x432d('0x31')];if(!_0xae2d39['query'][_0x432d('0x5a')](_0x432d('0x39'))){_0x585694[_0x432d('0x1d')]=qs[_0x432d('0x1d')](_0xae2d39[_0x432d('0x34')]['limit']);_0x585694[_0x432d('0x1a')]=qs[_0x432d('0x1a')](_0xae2d39[_0x432d('0x34')]['offset']);}_0x585694[_0x432d('0x3a')]=qs[_0x432d('0x3b')](_0xae2d39[_0x432d('0x34')][_0x432d('0x3b')]);_0x585694[_0x432d('0x3c')]=qs[_0x432d('0x33')](_[_0x432d('0x3d')](_0xae2d39[_0x432d('0x34')],_0x5603e8[_0x432d('0x33')]));_0x585694[_0x432d('0x3c')][_0x432d('0x5b')]=_0x6f0c97['id'];if(_0xae2d39[_0x432d('0x34')][_0x432d('0x3e')]){_0x585694[_0x432d('0x3c')]=_['merge'](_0x585694['where'],{'$or':_[_0x432d('0x2c')](_0x585694[_0x432d('0x35')],function(_0x4f220e){var _0x5103d5={};_0x5103d5[_0x4f220e]={'$like':'%'+_0xae2d39[_0x432d('0x34')][_0x432d('0x3e')]+'%'};return _0x5103d5;})});}_0x585694=_[_0x432d('0x3f')]({},_0x585694,_0xae2d39[_0x432d('0x42')]);return db[_0x432d('0x5e')][_0x432d('0x1c')]({'where':_0x585694[_0x432d('0x3c')]})[_0x432d('0x24')](function(_0xc81f7e){_0x419778['count']=_0xc81f7e;if(_0xae2d39['query'][_0x432d('0x43')]){_0x585694[_0x432d('0x44')]=[{'all':!![]}];}return db[_0x432d('0x5e')][_0x432d('0x45')](_0x585694);})[_0x432d('0x24')](function(_0x9e977d){_0x419778[_0x432d('0x5c')]=_0x9e977d;return _0x419778;});}})[_0x432d('0x24')](respondWithFilteredResult(_0x2fe0a0,_0x585694))[_0x432d('0x46')](handleError(_0x2fe0a0,null));};function char(_0x3996bc){return'number'===typeof _0x3996bc?String['fromCharCode'][_0x432d('0x20')](null,arguments):_0x3996bc;}function needsEncapsulation(_0x22acf0){return!!_0x22acf0&&(_0x22acf0[_0x432d('0x5f')]()[_0x432d('0x60')](char(0xd))>=0x0||_0x22acf0[_0x432d('0x5f')]()[_0x432d('0x60')](char(0xa))>=0x0||_0x22acf0[_0x432d('0x5f')]()[_0x432d('0x60')](char(0x2c))>=0x0||_0x22acf0['toString']()[_0x432d('0x60')](char(0x22))>=0x0);}function encapsulate(_0x803a8f){var _0xad591b=char(0x22),_0x49e259='\x5c'+char(0x22),_0x316076=_0x803a8f[_0x432d('0x5f')]()[_0x432d('0x61')](new RegExp(_0xad591b,'g'),_0x49e259);return _0xad591b+_0x316076+_0xad591b;}exports['getSummary']=function(_0x276135,_0x43d40d,_0x36c674){var _0x21808a,_0xead355;var _0xf29485={'where':{'ProjectId':_0x276135[_0x432d('0x51')]['id']}};if(_0x276135[_0x432d('0x34')][_0x432d('0x62')]){_0xf29485[_0x432d('0x3c')]['starttime']=JSON[_0x432d('0x63')](_0x276135['query'][_0x432d('0x62')]);}return db[_0x432d('0x59')][_0x432d('0x45')](_0xf29485)['then'](handleEntityNotFound(_0x43d40d,null))[_0x432d('0x24')](function(_0x4742b6){if(_0x4742b6){_0x21808a=_0x4742b6;return db[_0x432d('0x64')][_0x432d('0x45')]({'where':{'SessionId':{'$in':_[_0x432d('0x2c')](_0x21808a,'id')},'ProjectId':_0x276135['params']['id']},'order':_0x432d('0x65')});}})[_0x432d('0x24')](handleEntityNotFound(_0x43d40d,null))['then'](function(_0x1574ca){if(_0x1574ca){_0xead355=_0x1574ca;var _0x1f576c={};for(var _0x1c5c24=0x0,_0x1627d2=_0xead355[_0x432d('0x38')];_0x1c5c24<_0x1627d2;_0x1c5c24++){if(!_0x1f576c[_0x432d('0x5a')](_0xead355[_0x1c5c24][_0x432d('0x66')])){_0x1f576c[_0xead355[_0x1c5c24][_0x432d('0x66')]]=needsEncapsulation(_0xead355[_0x1c5c24][_0x432d('0x67')])?encapsulate(_0xead355[_0x1c5c24][_0x432d('0x67')]):_0xead355[_0x1c5c24][_0x432d('0x67')];}}var _0x4e3744=[],_0x223550={};for(var _0x4d9605=0x0,_0x2b3258=_0x21808a[_0x432d('0x38')];_0x4d9605<_0x2b3258;_0x4d9605++){_0x223550={'ProjectId':_0x276135[_0x432d('0x51')]['id'],'SessionId':_0x21808a[_0x4d9605]['id'],'StartTime':moment(_0x21808a[_0x4d9605][_0x432d('0x68')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x349d96=0x0,_0x254884=_0xead355[_0x432d('0x38')];_0x349d96<_0x254884;_0x349d96++){if(_0xead355[_0x349d96][_0x432d('0x69')]==_0x21808a[_0x4d9605]['id']&&_0x1f576c['hasOwnProperty'](_0xead355[_0x349d96]['questionId'])){_0x223550[_0x1f576c[_0xead355[_0x349d96]['questionId']]]=_0xead355[_0x349d96]['answer'];}}for(var _0x475724 in _0x1f576c){if(!_0x223550['hasOwnProperty'](_0x1f576c[_0x475724])){_0x223550[_0x1f576c[_0x475724]]=null;}}_0x4e3744['push'](_0x223550);}return _0x4e3744;}})[_0x432d('0x24')](function(_0x571b9e){if(!_['isEmpty'](_0x571b9e)){var _0xcbc0fd=toCsv(_0x571b9e);var _0x3c32d7=Date[_0x432d('0x6a')]();fs['writeFileSync'](util[_0x432d('0x6b')](_0x432d('0x6c'),_0x276135[_0x432d('0x51')]['id'],_0x3c32d7),_0xcbc0fd);_0x43d40d['setHeader'](_0x432d('0x6d'),_0x432d('0x6e')+util[_0x432d('0x6b')]('Jscripty_Project_%d_Summary_%s.csv',_0x276135['params']['id'],_0x3c32d7));_0x43d40d[_0x432d('0x6f')](_0x432d('0x70'),'text/csv');return _0x43d40d[_0x432d('0x71')](util['format'](_0x432d('0x6c'),_0x276135[_0x432d('0x51')]['id'],_0x3c32d7));}else{return _0x43d40d['sendStatus'](0xcc);}})['catch'](handleError(_0x43d40d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e30c574..b696ee9 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 _0xc906=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects'];(function(_0x55bbfd,_0x3b79a9){var _0x13b979=function(_0x175014){while(--_0x175014){_0x55bbfd['push'](_0x55bbfd['shift']());}};_0x13b979(++_0x3b79a9);}(_0xc906,0x1ad));var _0x6c90=function(_0x312c25,_0x2e123b){_0x312c25=_0x312c25-0x0;var _0x3074db=_0xc906[_0x312c25];return _0x3074db;};'use strict';var _=require(_0x6c90('0x0'));var util=require(_0x6c90('0x1'));var logger=require('../../config/logger')(_0x6c90('0x2'));var moment=require(_0x6c90('0x3'));var BPromise=require(_0x6c90('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c90('0x5'));var rimraf=require(_0x6c90('0x6'));var config=require(_0x6c90('0x7'));var attributes=require(_0x6c90('0x8'));module[_0x6c90('0x9')]=function(_0x2b55b8,_0x5491d9){return _0x2b55b8['define']('JscriptyProject',attributes,{'tableName':_0x6c90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x42b0=['api','bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x1353e6,_0x4f30e7){var _0x50a9c4=function(_0x39143b){while(--_0x39143b){_0x1353e6['push'](_0x1353e6['shift']());}};_0x50a9c4(++_0x4f30e7);}(_0x42b0,0xbc));var _0x042b=function(_0x4b0be5,_0x1ed1aa){_0x4b0be5=_0x4b0be5-0x0;var _0x4b2c39=_0x42b0[_0x4b0be5];return _0x4b2c39;};'use strict';var _=require(_0x042b('0x0'));var util=require(_0x042b('0x1'));var logger=require('../../config/logger')(_0x042b('0x2'));var moment=require('moment');var BPromise=require(_0x042b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x042b('0x4'));var config=require(_0x042b('0x5'));var attributes=require(_0x042b('0x6'));module[_0x042b('0x7')]=function(_0x135bc1,_0x5d194a){return _0x135bc1['define'](_0x042b('0x8'),attributes,{'tableName':_0x042b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index e00d5a6..58e07ff 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 _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(_0x12226f,_0x282198){var _0x31bb52=function(_0x4c2425){while(--_0x4c2425){_0x12226f['push'](_0x12226f['shift']());}};_0x31bb52(++_0x282198);}(_0xaa88,0x137));var _0x8aa8=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0xaa88[_0x38987f];return _0x4cb697;};'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 +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x51858f,_0x581eb0){var _0x3f7e0e=function(_0x3fadf0){while(--_0x3fadf0){_0x51858f['push'](_0x51858f['shift']());}};_0x3f7e0e(++_0x581eb0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 8951f5b..a679d60 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 _0x60e8=['update','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','isAuthenticated','/:id','show','post','put'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x60e8,0x1ee));var _0x860e=function(_0x2c62df,_0x4e95fe){_0x2c62df=_0x2c62df-0x0;var _0x3cc941=_0x60e8[_0x2c62df];return _0x3cc941;};'use strict';var multer=require(_0x860e('0x0'));var util=require(_0x860e('0x1'));var path=require(_0x860e('0x2'));var timeout=require('connect-timeout');var express=require(_0x860e('0x3'));var router=express[_0x860e('0x4')]();var fs_extra=require(_0x860e('0x5'));var auth=require(_0x860e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x860e('0x7'));var controller=require(_0x860e('0x8'));router[_0x860e('0x9')]('/',auth['isAuthenticated'](),controller[_0x860e('0xa')]);router[_0x860e('0x9')]('/describe',auth[_0x860e('0xb')](),controller['describe']);router[_0x860e('0x9')](_0x860e('0xc'),auth[_0x860e('0xb')](),controller[_0x860e('0xd')]);router[_0x860e('0xe')]('/',auth[_0x860e('0xb')](),controller['create']);router[_0x860e('0xf')](_0x860e('0xc'),auth[_0x860e('0xb')](),controller[_0x860e('0x10')]);router['delete'](_0x860e('0xc'),auth[_0x860e('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2e2d=['/describe','isAuthenticated','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index'];(function(_0x57705e,_0xd3bfaa){var _0x4a50db=function(_0x354dab){while(--_0x354dab){_0x57705e['push'](_0x57705e['shift']());}};_0x4a50db(++_0xd3bfaa);}(_0x2e2d,0x130));var _0xd2e2=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x2e2d[_0x2ec461];return _0x28603d;};'use strict';var multer=require(_0xd2e2('0x0'));var util=require(_0xd2e2('0x1'));var path=require(_0xd2e2('0x2'));var timeout=require('connect-timeout');var express=require(_0xd2e2('0x3'));var router=express['Router']();var fs_extra=require(_0xd2e2('0x4'));var auth=require(_0xd2e2('0x5'));var interaction=require(_0xd2e2('0x6'));var config=require(_0xd2e2('0x7'));var controller=require(_0xd2e2('0x8'));router[_0xd2e2('0x9')]('/',auth['isAuthenticated'](),controller[_0xd2e2('0xa')]);router[_0xd2e2('0x9')](_0xd2e2('0xb'),auth[_0xd2e2('0xc')](),controller[_0xd2e2('0xd')]);router[_0xd2e2('0x9')](_0xd2e2('0xe'),auth[_0xd2e2('0xc')](),controller[_0xd2e2('0xf')]);router[_0xd2e2('0x10')]('/',auth['isAuthenticated'](),controller[_0xd2e2('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd2e2('0x12')]);router['delete'](_0xd2e2('0xe'),auth[_0xd2e2('0xc')](),controller[_0xd2e2('0x13')]);module[_0xd2e2('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9dcca65..c0f84e7 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(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x114960,_0x2dd296){_0x114960=_0x114960-0x0;var _0x59db75=_0x7a54[_0x114960];return _0x59db75;};'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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x291ccc,_0x5cc4a8){_0x291ccc=_0x291ccc-0x0;var _0x5db869=_0x7a54[_0x291ccc];return _0x5db869;};'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 df782da..6b09cc0 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 _0xfb69=['fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','describe','zip-dir'];(function(_0x22e930,_0x32e4c7){var _0x7afabf=function(_0x2c5873){while(--_0x2c5873){_0x22e930['push'](_0x22e930['shift']());}};_0x7afabf(++_0x32e4c7);}(_0xfb69,0x1b5));var _0x9fb6=function(_0x2b5928,_0x458693){_0x2b5928=_0x2b5928-0x0;var _0xb5131c=_0xfb69[_0x2b5928];return _0xb5131c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9fb6('0x0'));var jsonpatch=require(_0x9fb6('0x1'));var rp=require(_0x9fb6('0x2'));var moment=require('moment');var BPromise=require(_0x9fb6('0x3'));var Mustache=require(_0x9fb6('0x4'));var util=require('util');var path=require(_0x9fb6('0x5'));var sox=require(_0x9fb6('0x6'));var csv=require('to-csv');var ejs=require(_0x9fb6('0x7'));var fs=require('fs');var fs_extra=require(_0x9fb6('0x8'));var _=require(_0x9fb6('0x9'));var squel=require(_0x9fb6('0xa'));var crypto=require(_0x9fb6('0xb'));var jsforce=require(_0x9fb6('0xc'));var deskjs=require(_0x9fb6('0xd'));var toCsv=require(_0x9fb6('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9fb6('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9fb6('0x10'));var as=require(_0x9fb6('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9fb6('0x12'));var utils=require(_0x9fb6('0x13'));var config=require(_0x9fb6('0x14'));var licenseUtil=require(_0x9fb6('0x15'));var db=require(_0x9fb6('0x16'))['db'];function respondWithStatusCode(_0x29a499,_0x2ad358){_0x2ad358=_0x2ad358||0xcc;return function(_0xd1aed4){if(_0xd1aed4){return _0x29a499[_0x9fb6('0x17')](_0x2ad358);}return _0x29a499[_0x9fb6('0x18')](_0x2ad358)[_0x9fb6('0x19')]();};}function respondWithResult(_0x49e732,_0x24aa5f){_0x24aa5f=_0x24aa5f||0xc8;return function(_0x34df5e){if(_0x34df5e){return _0x49e732['status'](_0x24aa5f)[_0x9fb6('0x1a')](_0x34df5e);}};}function respondWithFilteredResult(_0x126b0a,_0x1f5e83){return function(_0x451480){if(_0x451480){var _0x270932=typeof _0x1f5e83[_0x9fb6('0x1b')]==='undefined'&&typeof _0x1f5e83['limit']===_0x9fb6('0x1c');var _0x42cfc0=_0x451480[_0x9fb6('0x1d')];var _0x15cd2f=_0x270932?0x0:_0x1f5e83[_0x9fb6('0x1b')];var _0x41fa24=_0x270932?_0x451480[_0x9fb6('0x1d')]:_0x1f5e83['offset']+_0x1f5e83[_0x9fb6('0x1e')];var _0x2bdaf4;if(_0x41fa24>=_0x42cfc0){_0x41fa24=_0x42cfc0;_0x2bdaf4=0xc8;}else{_0x2bdaf4=0xce;}_0x126b0a[_0x9fb6('0x18')](_0x2bdaf4);return _0x126b0a[_0x9fb6('0x1f')](_0x9fb6('0x20'),_0x15cd2f+'-'+_0x41fa24+'/'+_0x42cfc0)['json'](_0x451480);}return null;};}function patchUpdates(_0x53a509){return function(_0x62c20b){try{jsonpatch[_0x9fb6('0x21')](_0x62c20b,_0x53a509,!![]);}catch(_0x25f8ac){return BPromise['reject'](_0x25f8ac);}return _0x62c20b['save']();};}function saveUpdates(_0x5b7bea,_0x685717){return function(_0x2c75dd){if(_0x2c75dd){return _0x2c75dd[_0x9fb6('0x22')](_0x5b7bea)['then'](function(_0x457427){return _0x457427;});}return null;};}function removeEntity(_0x1a2e93,_0x58a372){return function(_0x344a41){if(_0x344a41){return _0x344a41[_0x9fb6('0x23')]()[_0x9fb6('0x24')](function(){_0x1a2e93['status'](0xcc)[_0x9fb6('0x19')]();});}};}function handleEntityNotFound(_0x35a862,_0x24e2a2){return function(_0x11c4b6){if(!_0x11c4b6){_0x35a862[_0x9fb6('0x17')](0x194);}return _0x11c4b6;};}function handleError(_0x149045,_0x4b8c4a){_0x4b8c4a=_0x4b8c4a||0x1f4;return function(_0x5aac8c){logger[_0x9fb6('0x25')](_0x5aac8c[_0x9fb6('0x26')]);if(_0x5aac8c[_0x9fb6('0x27')]){delete _0x5aac8c[_0x9fb6('0x27')];}_0x149045['status'](_0x4b8c4a)[_0x9fb6('0x28')](_0x5aac8c);};}exports['index']=function(_0x44afbb,_0x4b74c5){var _0xeea192={},_0x114db2={},_0x1fe35={'count':0x0,'rows':[]};var _0x21ec0b=_[_0x9fb6('0x29')](db[_0x9fb6('0x2a')][_0x9fb6('0x2b')],function(_0xd7547a){return{'name':_0xd7547a[_0x9fb6('0x2c')],'type':_0xd7547a[_0x9fb6('0x2d')][_0x9fb6('0x2e')]};});_0x114db2[_0x9fb6('0x2f')]=_[_0x9fb6('0x29')](_0x21ec0b,_0x9fb6('0x27'));_0x114db2[_0x9fb6('0x30')]=_[_0x9fb6('0x31')](_0x44afbb['query']);_0x114db2[_0x9fb6('0x32')]=_['intersection'](_0x114db2[_0x9fb6('0x2f')],_0x114db2['query']);_0xeea192[_0x9fb6('0x33')]=_[_0x9fb6('0x34')](_0x114db2[_0x9fb6('0x2f')],qs[_0x9fb6('0x35')](_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x35')]));_0xeea192[_0x9fb6('0x33')]=_0xeea192[_0x9fb6('0x33')][_0x9fb6('0x36')]?_0xeea192[_0x9fb6('0x33')]:_0x114db2[_0x9fb6('0x2f')];if(!_0x44afbb[_0x9fb6('0x30')]['hasOwnProperty'](_0x9fb6('0x37'))){_0xeea192['limit']=qs[_0x9fb6('0x1e')](_0x44afbb[_0x9fb6('0x30')]['limit']);_0xeea192[_0x9fb6('0x1b')]=qs[_0x9fb6('0x1b')](_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x1b')]);}_0xeea192[_0x9fb6('0x38')]=qs['sort'](_0x44afbb['query'][_0x9fb6('0x39')]);_0xeea192['where']=qs[_0x9fb6('0x32')](_[_0x9fb6('0x3a')](_0x44afbb[_0x9fb6('0x30')],_0x114db2[_0x9fb6('0x32')]),_0x21ec0b);if(_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x3b')]){_0xeea192[_0x9fb6('0x3c')]=_[_0x9fb6('0x3d')](_0xeea192[_0x9fb6('0x3c')],{'$or':_[_0x9fb6('0x29')](_0x21ec0b,function(_0x3e49b3){if(_0x3e49b3[_0x9fb6('0x2d')]!==_0x9fb6('0x3e')){var _0xf83c0c={};_0xf83c0c[_0x3e49b3[_0x9fb6('0x27')]]={'$like':'%'+_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x3b')]+'%'};return _0xf83c0c;}})});}_0xeea192=_['merge']({},_0xeea192,_0x44afbb[_0x9fb6('0x3f')]);var _0x3c36e2={'where':_0xeea192[_0x9fb6('0x3c')]};return db[_0x9fb6('0x2a')][_0x9fb6('0x1d')](_0x3c36e2)[_0x9fb6('0x24')](function(_0x2a6b7e){_0x1fe35[_0x9fb6('0x1d')]=_0x2a6b7e;if(_0x44afbb[_0x9fb6('0x30')][_0x9fb6('0x40')]){_0xeea192[_0x9fb6('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x9fb6('0x42')](_0xeea192);})[_0x9fb6('0x24')](function(_0x59c709){_0x1fe35['rows']=_0x59c709;return _0x1fe35;})[_0x9fb6('0x24')](respondWithFilteredResult(_0x4b74c5,_0xeea192))[_0x9fb6('0x43')](handleError(_0x4b74c5,null));};exports['show']=function(_0x2cf205,_0x3fcba6){var _0x4cf762={'raw':!![],'where':{'id':_0x2cf205[_0x9fb6('0x44')]['id']}},_0x3bbe33={};_0x3bbe33[_0x9fb6('0x2f')]=_['keys'](db[_0x9fb6('0x2a')][_0x9fb6('0x2b')]);_0x3bbe33[_0x9fb6('0x30')]=_['keys'](_0x2cf205[_0x9fb6('0x30')]);_0x3bbe33[_0x9fb6('0x32')]=_['intersection'](_0x3bbe33[_0x9fb6('0x2f')],_0x3bbe33[_0x9fb6('0x30')]);_0x4cf762[_0x9fb6('0x33')]=_['intersection'](_0x3bbe33[_0x9fb6('0x2f')],qs[_0x9fb6('0x35')](_0x2cf205[_0x9fb6('0x30')]['fields']));_0x4cf762[_0x9fb6('0x33')]=_0x4cf762[_0x9fb6('0x33')][_0x9fb6('0x36')]?_0x4cf762[_0x9fb6('0x33')]:_0x3bbe33[_0x9fb6('0x2f')];if(_0x2cf205[_0x9fb6('0x30')][_0x9fb6('0x40')]){_0x4cf762[_0x9fb6('0x41')]=[{'all':!![]}];}_0x4cf762=_[_0x9fb6('0x3d')]({},_0x4cf762,_0x2cf205['options']);return db['JscriptyQuestionReport'][_0x9fb6('0x45')](_0x4cf762)[_0x9fb6('0x24')](handleEntityNotFound(_0x3fcba6,null))[_0x9fb6('0x24')](respondWithResult(_0x3fcba6,null))[_0x9fb6('0x43')](handleError(_0x3fcba6,null));};exports[_0x9fb6('0x46')]=function(_0x1f8525,_0x406ee4){return db['JscriptyQuestionReport']['create'](_0x1f8525[_0x9fb6('0x47')],{})[_0x9fb6('0x24')](respondWithResult(_0x406ee4,0xc9))['catch'](handleError(_0x406ee4,null));};exports[_0x9fb6('0x22')]=function(_0x2ec66a,_0x36cc27){if(_0x2ec66a[_0x9fb6('0x47')]['id']){delete _0x2ec66a[_0x9fb6('0x47')]['id'];}return db[_0x9fb6('0x2a')][_0x9fb6('0x45')]({'where':{'id':_0x2ec66a[_0x9fb6('0x44')]['id']}})[_0x9fb6('0x24')](handleEntityNotFound(_0x36cc27,null))['then'](saveUpdates(_0x2ec66a['body'],null))[_0x9fb6('0x24')](respondWithResult(_0x36cc27,null))['catch'](handleError(_0x36cc27,null));};exports[_0x9fb6('0x23')]=function(_0x1c8ac2,_0x26c619){return db[_0x9fb6('0x2a')][_0x9fb6('0x45')]({'where':{'id':_0x1c8ac2[_0x9fb6('0x44')]['id']}})[_0x9fb6('0x24')](handleEntityNotFound(_0x26c619,null))[_0x9fb6('0x24')](removeEntity(_0x26c619,null))['catch'](handleError(_0x26c619,null));};exports[_0x9fb6('0x48')]=function(_0x4efb75,_0x44130b){return db['JscriptyQuestionReport'][_0x9fb6('0x48')]()[_0x9fb6('0x24')](respondWithResult(_0x44130b,null))['catch'](handleError(_0x44130b,null));}; \ No newline at end of file +var _0xf7ee=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','find','body','update'];(function(_0x45279f,_0x1d65ff){var _0x37fe53=function(_0x13f234){while(--_0x13f234){_0x45279f['push'](_0x45279f['shift']());}};_0x37fe53(++_0x1d65ff);}(_0xf7ee,0x130));var _0xef7e=function(_0x356e42,_0x3e1b42){_0x356e42=_0x356e42-0x0;var _0x4591ec=_0xf7ee[_0x356e42];return _0x4591ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef7e('0x0'));var zipdir=require(_0xef7e('0x1'));var jsonpatch=require(_0xef7e('0x2'));var rp=require(_0xef7e('0x3'));var moment=require('moment');var BPromise=require(_0xef7e('0x4'));var Mustache=require(_0xef7e('0x5'));var util=require(_0xef7e('0x6'));var path=require(_0xef7e('0x7'));var sox=require(_0xef7e('0x8'));var csv=require('to-csv');var ejs=require(_0xef7e('0x9'));var fs=require('fs');var fs_extra=require(_0xef7e('0xa'));var _=require(_0xef7e('0xb'));var squel=require(_0xef7e('0xc'));var crypto=require(_0xef7e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xef7e('0xe'));var toCsv=require(_0xef7e('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xef7e('0x10'));var authService=require(_0xef7e('0x11'));var qs=require(_0xef7e('0x12'));var as=require(_0xef7e('0x13'));var hardwareService=require(_0xef7e('0x14'));var logger=require('../../config/logger')(_0xef7e('0x15'));var utils=require('../../config/utils');var config=require(_0xef7e('0x16'));var licenseUtil=require(_0xef7e('0x17'));var db=require(_0xef7e('0x18'))['db'];function respondWithStatusCode(_0x4571b5,_0x24c5c4){_0x24c5c4=_0x24c5c4||0xcc;return function(_0x202df8){if(_0x202df8){return _0x4571b5[_0xef7e('0x19')](_0x24c5c4);}return _0x4571b5[_0xef7e('0x1a')](_0x24c5c4)[_0xef7e('0x1b')]();};}function respondWithResult(_0x21b65b,_0x41d9cc){_0x41d9cc=_0x41d9cc||0xc8;return function(_0x383621){if(_0x383621){return _0x21b65b[_0xef7e('0x1a')](_0x41d9cc)[_0xef7e('0x1c')](_0x383621);}};}function respondWithFilteredResult(_0x1c7db1,_0x3dfb3a){return function(_0x21c8e0){if(_0x21c8e0){var _0x3ff680=typeof _0x3dfb3a[_0xef7e('0x1d')]===_0xef7e('0x1e')&&typeof _0x3dfb3a[_0xef7e('0x1f')]===_0xef7e('0x1e');var _0x5f0e89=_0x21c8e0['count'];var _0x38d98e=_0x3ff680?0x0:_0x3dfb3a[_0xef7e('0x1d')];var _0x1a9ef4=_0x3ff680?_0x21c8e0['count']:_0x3dfb3a[_0xef7e('0x1d')]+_0x3dfb3a[_0xef7e('0x1f')];var _0x53ce88;if(_0x1a9ef4>=_0x5f0e89){_0x1a9ef4=_0x5f0e89;_0x53ce88=0xc8;}else{_0x53ce88=0xce;}_0x1c7db1['status'](_0x53ce88);return _0x1c7db1[_0xef7e('0x20')](_0xef7e('0x21'),_0x38d98e+'-'+_0x1a9ef4+'/'+_0x5f0e89)[_0xef7e('0x1c')](_0x21c8e0);}return null;};}function patchUpdates(_0x2ce202){return function(_0x5f4641){try{jsonpatch[_0xef7e('0x22')](_0x5f4641,_0x2ce202,!![]);}catch(_0x5a96c5){return BPromise[_0xef7e('0x23')](_0x5a96c5);}return _0x5f4641[_0xef7e('0x24')]();};}function saveUpdates(_0x500d23,_0x548390){return function(_0x5dc781){if(_0x5dc781){return _0x5dc781['update'](_0x500d23)[_0xef7e('0x25')](function(_0x608484){return _0x608484;});}return null;};}function removeEntity(_0x561c03,_0x54928f){return function(_0x41210c){if(_0x41210c){return _0x41210c[_0xef7e('0x26')]()[_0xef7e('0x25')](function(){_0x561c03['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46bef8,_0x193f77){return function(_0x38bf17){if(!_0x38bf17){_0x46bef8['sendStatus'](0x194);}return _0x38bf17;};}function handleError(_0x11d524,_0x1d6e49){_0x1d6e49=_0x1d6e49||0x1f4;return function(_0x1e34a4){logger[_0xef7e('0x27')](_0x1e34a4['stack']);if(_0x1e34a4[_0xef7e('0x28')]){delete _0x1e34a4['name'];}_0x11d524[_0xef7e('0x1a')](_0x1d6e49)[_0xef7e('0x29')](_0x1e34a4);};}exports[_0xef7e('0x2a')]=function(_0x51d9c4,_0x108f9e){var _0x3a27e9={},_0x5e8f54={},_0x3d97a5={'count':0x0,'rows':[]};var _0x465de0=_['map'](db[_0xef7e('0x2b')][_0xef7e('0x2c')],function(_0x56eeca){return{'name':_0x56eeca[_0xef7e('0x2d')],'type':_0x56eeca[_0xef7e('0x2e')][_0xef7e('0x2f')]};});_0x5e8f54[_0xef7e('0x30')]=_[_0xef7e('0x31')](_0x465de0,_0xef7e('0x28'));_0x5e8f54[_0xef7e('0x32')]=_[_0xef7e('0x33')](_0x51d9c4[_0xef7e('0x32')]);_0x5e8f54[_0xef7e('0x34')]=_[_0xef7e('0x35')](_0x5e8f54[_0xef7e('0x30')],_0x5e8f54['query']);_0x3a27e9[_0xef7e('0x36')]=_['intersection'](_0x5e8f54[_0xef7e('0x30')],qs[_0xef7e('0x37')](_0x51d9c4[_0xef7e('0x32')][_0xef7e('0x37')]));_0x3a27e9[_0xef7e('0x36')]=_0x3a27e9[_0xef7e('0x36')][_0xef7e('0x38')]?_0x3a27e9[_0xef7e('0x36')]:_0x5e8f54[_0xef7e('0x30')];if(!_0x51d9c4[_0xef7e('0x32')][_0xef7e('0x39')](_0xef7e('0x3a'))){_0x3a27e9[_0xef7e('0x1f')]=qs[_0xef7e('0x1f')](_0x51d9c4[_0xef7e('0x32')][_0xef7e('0x1f')]);_0x3a27e9[_0xef7e('0x1d')]=qs[_0xef7e('0x1d')](_0x51d9c4[_0xef7e('0x32')][_0xef7e('0x1d')]);}_0x3a27e9[_0xef7e('0x3b')]=qs[_0xef7e('0x3c')](_0x51d9c4['query'][_0xef7e('0x3c')]);_0x3a27e9[_0xef7e('0x3d')]=qs[_0xef7e('0x34')](_['pick'](_0x51d9c4[_0xef7e('0x32')],_0x5e8f54[_0xef7e('0x34')]),_0x465de0);if(_0x51d9c4[_0xef7e('0x32')][_0xef7e('0x3e')]){_0x3a27e9['where']=_[_0xef7e('0x3f')](_0x3a27e9[_0xef7e('0x3d')],{'$or':_[_0xef7e('0x31')](_0x465de0,function(_0xccefd8){if(_0xccefd8[_0xef7e('0x2e')]!==_0xef7e('0x40')){var _0x2d805e={};_0x2d805e[_0xccefd8['name']]={'$like':'%'+_0x51d9c4[_0xef7e('0x32')]['filter']+'%'};return _0x2d805e;}})});}_0x3a27e9=_[_0xef7e('0x3f')]({},_0x3a27e9,_0x51d9c4[_0xef7e('0x41')]);var _0x2898bc={'where':_0x3a27e9[_0xef7e('0x3d')]};return db[_0xef7e('0x2b')][_0xef7e('0x42')](_0x2898bc)[_0xef7e('0x25')](function(_0x1e51fa){_0x3d97a5[_0xef7e('0x42')]=_0x1e51fa;if(_0x51d9c4[_0xef7e('0x32')][_0xef7e('0x43')]){_0x3a27e9[_0xef7e('0x44')]=[{'all':!![]}];}return db[_0xef7e('0x2b')]['findAll'](_0x3a27e9);})[_0xef7e('0x25')](function(_0x5385ac){_0x3d97a5[_0xef7e('0x45')]=_0x5385ac;return _0x3d97a5;})['then'](respondWithFilteredResult(_0x108f9e,_0x3a27e9))[_0xef7e('0x46')](handleError(_0x108f9e,null));};exports[_0xef7e('0x47')]=function(_0x24a5e9,_0x598d63){var _0x4a3f09={'raw':!![],'where':{'id':_0x24a5e9[_0xef7e('0x48')]['id']}},_0x5c1bfe={};_0x5c1bfe[_0xef7e('0x30')]=_[_0xef7e('0x33')](db[_0xef7e('0x2b')][_0xef7e('0x2c')]);_0x5c1bfe[_0xef7e('0x32')]=_[_0xef7e('0x33')](_0x24a5e9['query']);_0x5c1bfe[_0xef7e('0x34')]=_[_0xef7e('0x35')](_0x5c1bfe[_0xef7e('0x30')],_0x5c1bfe['query']);_0x4a3f09['attributes']=_[_0xef7e('0x35')](_0x5c1bfe[_0xef7e('0x30')],qs[_0xef7e('0x37')](_0x24a5e9[_0xef7e('0x32')][_0xef7e('0x37')]));_0x4a3f09[_0xef7e('0x36')]=_0x4a3f09['attributes'][_0xef7e('0x38')]?_0x4a3f09[_0xef7e('0x36')]:_0x5c1bfe['model'];if(_0x24a5e9[_0xef7e('0x32')][_0xef7e('0x43')]){_0x4a3f09['include']=[{'all':!![]}];}_0x4a3f09=_[_0xef7e('0x3f')]({},_0x4a3f09,_0x24a5e9[_0xef7e('0x41')]);return db[_0xef7e('0x2b')][_0xef7e('0x49')](_0x4a3f09)[_0xef7e('0x25')](handleEntityNotFound(_0x598d63,null))[_0xef7e('0x25')](respondWithResult(_0x598d63,null))[_0xef7e('0x46')](handleError(_0x598d63,null));};exports['create']=function(_0x2ad3e1,_0x35819a){return db['JscriptyQuestionReport']['create'](_0x2ad3e1[_0xef7e('0x4a')],{})['then'](respondWithResult(_0x35819a,0xc9))[_0xef7e('0x46')](handleError(_0x35819a,null));};exports[_0xef7e('0x4b')]=function(_0x30a7fd,_0x4a8c1a){if(_0x30a7fd[_0xef7e('0x4a')]['id']){delete _0x30a7fd[_0xef7e('0x4a')]['id'];}return db[_0xef7e('0x2b')][_0xef7e('0x49')]({'where':{'id':_0x30a7fd['params']['id']}})['then'](handleEntityNotFound(_0x4a8c1a,null))[_0xef7e('0x25')](saveUpdates(_0x30a7fd['body'],null))[_0xef7e('0x25')](respondWithResult(_0x4a8c1a,null))['catch'](handleError(_0x4a8c1a,null));};exports[_0xef7e('0x26')]=function(_0x20c981,_0xc14c94){return db[_0xef7e('0x2b')][_0xef7e('0x49')]({'where':{'id':_0x20c981[_0xef7e('0x48')]['id']}})[_0xef7e('0x25')](handleEntityNotFound(_0xc14c94,null))[_0xef7e('0x25')](removeEntity(_0xc14c94,null))['catch'](handleError(_0xc14c94,null));};exports['describe']=function(_0x2e64a1,_0x16bb7e){return db[_0xef7e('0x2b')]['describe']()['then'](respondWithResult(_0x16bb7e,null))[_0xef7e('0x46')](handleError(_0x16bb7e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 0dece33..08f1600 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 _0x34fc=['request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','util','../../config/logger','moment'];(function(_0xfc959c,_0x4660c){var _0xa12959=function(_0x474863){while(--_0x474863){_0xfc959c['push'](_0xfc959c['shift']());}};_0xa12959(++_0x4660c);}(_0x34fc,0xcf));var _0xc34f=function(_0x38f612,_0x2c77d7){_0x38f612=_0x38f612-0x0;var _0x160ba7=_0x34fc[_0x38f612];return _0x160ba7;};'use strict';var _=require('lodash');var util=require(_0xc34f('0x0'));var logger=require(_0xc34f('0x1'))('api');var moment=require(_0xc34f('0x2'));var BPromise=require('bluebird');var rp=require(_0xc34f('0x3'));var fs=require('fs');var path=require(_0xc34f('0x4'));var rimraf=require(_0xc34f('0x5'));var config=require('../../config/environment');var attributes=require(_0xc34f('0x6'));module[_0xc34f('0x7')]=function(_0x53ac89,_0x163da1){return _0x53ac89[_0xc34f('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0xc34f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f14=['JscriptyQuestionReport','util','../../config/logger','api','moment','request-promise','../../config/environment','define'];(function(_0x34325b,_0x5e5afe){var _0x3da348=function(_0x3bf709){while(--_0x3bf709){_0x34325b['push'](_0x34325b['shift']());}};_0x3da348(++_0x5e5afe);}(_0x9f14,0x89));var _0x49f1=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9f14[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0x49f1('0x0'));var logger=require(_0x49f1('0x1'))(_0x49f1('0x2'));var moment=require(_0x49f1('0x3'));var BPromise=require('bluebird');var rp=require(_0x49f1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x49f1('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x51f4d1,_0x1b4318){return _0x51f4d1[_0x49f1('0x6')](_0x49f1('0x7'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index afa7854..3f9a525 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 _0xb643=['rpc','jayson/promise','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb643,0x151));var _0x3b64=function(_0x1e55e6,_0x4edd41){_0x1e55e6=_0x1e55e6-0x0;var _0x3fd4ca=_0xb643[_0x1e55e6];return _0x3fd4ca;};'use strict';var _=require('lodash');var util=require(_0x3b64('0x0'));var moment=require('moment');var BPromise=require(_0x3b64('0x1'));var rs=require(_0x3b64('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b64('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b64('0x4'))(_0x3b64('0x5'));var config=require('../../config/environment');var jayson=require(_0x3b64('0x6'));var client=jayson['client'][_0x3b64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ab978,_0x572a2f,_0x49a607){return new BPromise(function(_0x4040b5,_0x16fffc){return client['request'](_0x2ab978,_0x49a607)[_0x3b64('0x8')](function(_0x5dde66){logger[_0x3b64('0x9')](_0x3b64('0xa'),_0x572a2f,_0x3b64('0xb'));logger[_0x3b64('0xc')](_0x3b64('0xd'),_0x572a2f,_0x3b64('0xb'),JSON[_0x3b64('0xe')](_0x5dde66));if(_0x5dde66[_0x3b64('0xf')]){if(_0x5dde66[_0x3b64('0xf')]['code']===0x1f4){logger['error'](_0x3b64('0xa'),_0x572a2f,_0x5dde66[_0x3b64('0xf')][_0x3b64('0x10')]);return _0x16fffc(_0x5dde66[_0x3b64('0xf')]['message']);}logger[_0x3b64('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x572a2f,_0x5dde66['error']['message']);return _0x4040b5(_0x5dde66[_0x3b64('0xf')][_0x3b64('0x10')]);}else{logger[_0x3b64('0x9')](_0x3b64('0xa'),_0x572a2f,_0x3b64('0xb'));_0x4040b5(_0x5dde66['result']['message']);}})[_0x3b64('0x11')](function(_0x2ab63a){logger[_0x3b64('0xf')](_0x3b64('0xa'),_0x572a2f,_0x2ab63a);_0x16fffc(_0x2ab63a);});});} \ No newline at end of file +var _0xd962=['error','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x396570,_0x3e04eb){var _0x2d4f69=function(_0x35b84c){while(--_0x35b84c){_0x396570['push'](_0x396570['shift']());}};_0x2d4f69(++_0x3e04eb);}(_0xd962,0x11c));var _0x2d96=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xd962[_0x45bf86];return _0x1f02b7;};'use strict';var _=require(_0x2d96('0x0'));var util=require('util');var moment=require(_0x2d96('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2d96('0x2'));var db=require(_0x2d96('0x3'))['db'];var utils=require(_0x2d96('0x4'));var logger=require(_0x2d96('0x5'))(_0x2d96('0x6'));var config=require('../../config/environment');var jayson=require(_0x2d96('0x7'));var client=jayson['client'][_0x2d96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e386a,_0x1e39cf,_0x1dc01e){return new BPromise(function(_0x2b2416,_0xfc224f){return client[_0x2d96('0x9')](_0x3e386a,_0x1dc01e)[_0x2d96('0xa')](function(_0x5c0474){logger['info'](_0x2d96('0xb'),_0x1e39cf,_0x2d96('0xc'));logger[_0x2d96('0xd')](_0x2d96('0xe'),_0x1e39cf,'request\x20sent',JSON[_0x2d96('0xf')](_0x5c0474));if(_0x5c0474[_0x2d96('0x10')]){if(_0x5c0474[_0x2d96('0x10')]['code']===0x1f4){logger['error'](_0x2d96('0xb'),_0x1e39cf,_0x5c0474[_0x2d96('0x10')]['message']);return _0xfc224f(_0x5c0474['error']['message']);}logger[_0x2d96('0x10')](_0x2d96('0xb'),_0x1e39cf,_0x5c0474[_0x2d96('0x10')][_0x2d96('0x11')]);return _0x2b2416(_0x5c0474[_0x2d96('0x10')][_0x2d96('0x11')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e39cf,'request\x20sent');_0x2b2416(_0x5c0474[_0x2d96('0x12')][_0x2d96('0x11')]);}})[_0x2d96('0x13')](function(_0x584a67){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e39cf,_0x584a67);_0xfc224f(_0x584a67);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 1d5754a..fbb1537 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 _0x41a7=['isAuthenticated','index','show','/:id/questions','getQuestions','put','/:id','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x54ba7c,_0x57622e){var _0x5cbeab=function(_0x115f47){while(--_0x115f47){_0x54ba7c['push'](_0x54ba7c['shift']());}};_0x5cbeab(++_0x57622e);}(_0x41a7,0xf4));var _0x741a=function(_0x5597eb,_0x6d296c){_0x5597eb=_0x5597eb-0x0;var _0x1589d6=_0x41a7[_0x5597eb];return _0x1589d6;};'use strict';var multer=require(_0x741a('0x0'));var util=require('util');var path=require(_0x741a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x741a('0x2')]();var fs_extra=require(_0x741a('0x3'));var auth=require(_0x741a('0x4'));var interaction=require(_0x741a('0x5'));var config=require(_0x741a('0x6'));var controller=require('./jscriptySessionReport.controller');router[_0x741a('0x7')]('/',auth[_0x741a('0x8')](),controller[_0x741a('0x9')]);router[_0x741a('0x7')]('/describe',auth[_0x741a('0x8')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x741a('0xa')]);router[_0x741a('0x7')](_0x741a('0xb'),auth['isAuthenticated'](),controller[_0x741a('0xc')]);router['post']('/',auth[_0x741a('0x8')](),controller['create']);router[_0x741a('0xd')](_0x741a('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x741a('0xf')](_0x741a('0xe'),auth[_0x741a('0x8')](),controller[_0x741a('0x10')]);module[_0x741a('0x11')]=router; \ No newline at end of file +var _0x11fc=['../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x11fc,0x101));var _0xc11f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x11fc[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xc11f('0x0'));var util=require(_0xc11f('0x1'));var path=require(_0xc11f('0x2'));var timeout=require(_0xc11f('0x3'));var express=require(_0xc11f('0x4'));var router=express[_0xc11f('0x5')]();var fs_extra=require(_0xc11f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc11f('0x7'));var config=require(_0xc11f('0x8'));var controller=require(_0xc11f('0x9'));router[_0xc11f('0xa')]('/',auth[_0xc11f('0xb')](),controller[_0xc11f('0xc')]);router[_0xc11f('0xa')](_0xc11f('0xd'),auth[_0xc11f('0xb')](),controller['describe']);router['get'](_0xc11f('0xe'),auth[_0xc11f('0xb')](),controller[_0xc11f('0xf')]);router[_0xc11f('0xa')]('/:id/questions',auth[_0xc11f('0xb')](),controller['getQuestions']);router[_0xc11f('0x10')]('/',auth[_0xc11f('0xb')](),controller[_0xc11f('0x11')]);router[_0xc11f('0x12')](_0xc11f('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xc11f('0x13')](_0xc11f('0xe'),auth['isAuthenticated'](),controller[_0xc11f('0x14')]);module[_0xc11f('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 0894705..b3f328a 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 _0xd26f=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE','setDataValue','starttime'];(function(_0x28b1d3,_0x53238d){var _0x12066c=function(_0x3c439c){while(--_0x3c439c){_0x28b1d3['push'](_0x28b1d3['shift']());}};_0x12066c(++_0x53238d);}(_0xd26f,0x81));var _0xfd26=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xd26f[_0x4fc9e6];return _0x551d28;};'use strict';var moment=require(_0xfd26('0x0'));var Sequelize=require(_0xfd26('0x1'));module[_0xfd26('0x2')]={'starttime':{'type':Sequelize[_0xfd26('0x3')],'set':function(_0x2b2b99){this[_0xfd26('0x4')](_0xfd26('0x5'),_0x2b2b99);this[_0xfd26('0x4')]('endtime',moment()[_0xfd26('0x6')](_0xfd26('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xfd26('0x8')]},'projectname':{'type':Sequelize[_0xfd26('0x8')]},'queue':{'type':Sequelize[_0xfd26('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfd26('0x8')]},'calleridnum':{'type':Sequelize[_0xfd26('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0837=['STRING','moment','exports','setDataValue','endtime','DATE'];(function(_0x3bb63a,_0x15af8f){var _0x3b822a=function(_0x5e31cb){while(--_0x5e31cb){_0x3bb63a['push'](_0x3bb63a['shift']());}};_0x3b822a(++_0x15af8f);}(_0x0837,0x1e1));var _0x7083=function(_0x2c14d9,_0x58a1cc){_0x2c14d9=_0x2c14d9-0x0;var _0x45b372=_0x0837[_0x2c14d9];return _0x45b372;};'use strict';var moment=require(_0x7083('0x0'));var Sequelize=require('sequelize');module[_0x7083('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1c0b97){this[_0x7083('0x2')]('starttime',_0x1c0b97);this[_0x7083('0x2')](_0x7083('0x3'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x7083('0x4')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x7083('0x5')]},'uniqueid':{'type':Sequelize[_0x7083('0x5')]},'calleridname':{'type':Sequelize[_0x7083('0x5')]},'calleridnum':{'type':Sequelize[_0x7083('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index ea30af2..7e0408a 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 _0x86ae=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','save','then','end','error','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','params','find','create','body','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','options','findAll','rows','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x54faec,_0x43408b){var _0x8bde19=function(_0x21bdc1){while(--_0x21bdc1){_0x54faec['push'](_0x54faec['shift']());}};_0x8bde19(++_0x43408b);}(_0x86ae,0x186));var _0xe86a=function(_0x2e7840,_0x4ba938){_0x2e7840=_0x2e7840-0x0;var _0x64635=_0x86ae[_0x2e7840];return _0x64635;};'use strict';var emlformat=require(_0xe86a('0x0'));var rimraf=require(_0xe86a('0x1'));var zipdir=require(_0xe86a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe86a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe86a('0x4'));var path=require(_0xe86a('0x5'));var sox=require(_0xe86a('0x6'));var csv=require(_0xe86a('0x7'));var ejs=require(_0xe86a('0x8'));var fs=require('fs');var fs_extra=require(_0xe86a('0x9'));var _=require(_0xe86a('0xa'));var squel=require(_0xe86a('0xb'));var crypto=require('crypto');var jsforce=require(_0xe86a('0xc'));var deskjs=require(_0xe86a('0xd'));var toCsv=require(_0xe86a('0x7'));var querystring=require(_0xe86a('0xe'));var Papa=require(_0xe86a('0xf'));var Redis=require(_0xe86a('0x10'));var authService=require(_0xe86a('0x11'));var qs=require(_0xe86a('0x12'));var as=require(_0xe86a('0x13'));var hardwareService=require(_0xe86a('0x14'));var logger=require(_0xe86a('0x15'))(_0xe86a('0x16'));var utils=require(_0xe86a('0x17'));var config=require(_0xe86a('0x18'));var licenseUtil=require(_0xe86a('0x19'));var db=require(_0xe86a('0x1a'))['db'];function respondWithStatusCode(_0x4ff6c2,_0x58a23a){_0x58a23a=_0x58a23a||0xcc;return function(_0x19f1b9){if(_0x19f1b9){return _0x4ff6c2['sendStatus'](_0x58a23a);}return _0x4ff6c2[_0xe86a('0x1b')](_0x58a23a)['end']();};}function respondWithResult(_0x1bfe3c,_0x539f8c){_0x539f8c=_0x539f8c||0xc8;return function(_0x70f980){if(_0x70f980){return _0x1bfe3c['status'](_0x539f8c)[_0xe86a('0x1c')](_0x70f980);}};}function respondWithFilteredResult(_0x51c89e,_0x17fd90){return function(_0x29b734){if(_0x29b734){var _0x16c95e=typeof _0x17fd90[_0xe86a('0x1d')]==='undefined'&&typeof _0x17fd90[_0xe86a('0x1e')]===_0xe86a('0x1f');var _0x59a3f2=_0x29b734['count'];var _0xd95a11=_0x16c95e?0x0:_0x17fd90[_0xe86a('0x1d')];var _0x3e6b93=_0x16c95e?_0x29b734[_0xe86a('0x20')]:_0x17fd90[_0xe86a('0x1d')]+_0x17fd90[_0xe86a('0x1e')];var _0x3bd51a;if(_0x3e6b93>=_0x59a3f2){_0x3e6b93=_0x59a3f2;_0x3bd51a=0xc8;}else{_0x3bd51a=0xce;}_0x51c89e[_0xe86a('0x1b')](_0x3bd51a);return _0x51c89e['set'](_0xe86a('0x21'),_0xd95a11+'-'+_0x3e6b93+'/'+_0x59a3f2)['json'](_0x29b734);}return null;};}function patchUpdates(_0x257264){return function(_0x43e854){try{jsonpatch[_0xe86a('0x22')](_0x43e854,_0x257264,!![]);}catch(_0x27b082){return BPromise['reject'](_0x27b082);}return _0x43e854[_0xe86a('0x23')]();};}function saveUpdates(_0x1aeb86,_0x5107ad){return function(_0x4ba71a){if(_0x4ba71a){return _0x4ba71a['update'](_0x1aeb86)[_0xe86a('0x24')](function(_0x14c5cb){return _0x14c5cb;});}return null;};}function removeEntity(_0x3c9f92,_0xa9655d){return function(_0x527cdd){if(_0x527cdd){return _0x527cdd['destroy']()[_0xe86a('0x24')](function(){_0x3c9f92[_0xe86a('0x1b')](0xcc)[_0xe86a('0x25')]();});}};}function handleEntityNotFound(_0xd9cc56,_0x16f35c){return function(_0x1e0138){if(!_0x1e0138){_0xd9cc56['sendStatus'](0x194);}return _0x1e0138;};}function handleError(_0x147515,_0x56b92b){_0x56b92b=_0x56b92b||0x1f4;return function(_0x547929){logger[_0xe86a('0x26')](_0x547929['stack']);if(_0x547929['name']){delete _0x547929[_0xe86a('0x27')];}_0x147515[_0xe86a('0x1b')](_0x56b92b)[_0xe86a('0x28')](_0x547929);};}exports[_0xe86a('0x29')]=function(_0x2afa2e,_0x4a7085){var _0x1daf36={},_0xf804b={},_0x458052={'count':0x0,'rows':[]};var _0xf6f1aa=_[_0xe86a('0x2a')](db[_0xe86a('0x2b')][_0xe86a('0x2c')],function(_0x40aeb3){return{'name':_0x40aeb3[_0xe86a('0x2d')],'type':_0x40aeb3[_0xe86a('0x2e')][_0xe86a('0x2f')]};});_0xf804b['model']=_['map'](_0xf6f1aa,'name');_0xf804b[_0xe86a('0x30')]=_[_0xe86a('0x31')](_0x2afa2e['query']);_0xf804b[_0xe86a('0x32')]=_[_0xe86a('0x33')](_0xf804b[_0xe86a('0x34')],_0xf804b[_0xe86a('0x30')]);_0x1daf36[_0xe86a('0x35')]=_[_0xe86a('0x33')](_0xf804b[_0xe86a('0x34')],qs[_0xe86a('0x36')](_0x2afa2e['query'][_0xe86a('0x36')]));_0x1daf36[_0xe86a('0x35')]=_0x1daf36[_0xe86a('0x35')][_0xe86a('0x37')]?_0x1daf36[_0xe86a('0x35')]:_0xf804b[_0xe86a('0x34')];if(!_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x38')](_0xe86a('0x39'))){_0x1daf36[_0xe86a('0x1e')]=qs[_0xe86a('0x1e')](_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x1e')]);_0x1daf36[_0xe86a('0x1d')]=qs[_0xe86a('0x1d')](_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x1d')]);}_0x1daf36['order']=qs[_0xe86a('0x3a')](_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x3a')]);_0x1daf36[_0xe86a('0x3b')]=qs[_0xe86a('0x32')](_['pick'](_0x2afa2e['query'],_0xf804b[_0xe86a('0x32')]),_0xf6f1aa);if(_0x2afa2e['query'][_0xe86a('0x3c')]){_0x1daf36[_0xe86a('0x3b')]=_[_0xe86a('0x3d')](_0x1daf36[_0xe86a('0x3b')],{'$or':_[_0xe86a('0x2a')](_0xf6f1aa,function(_0x31bf95){if(_0x31bf95[_0xe86a('0x2e')]!==_0xe86a('0x3e')){var _0x16e45a={};_0x16e45a[_0x31bf95[_0xe86a('0x27')]]={'$like':'%'+_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x3c')]+'%'};return _0x16e45a;}})});}_0x1daf36=_['merge']({},_0x1daf36,_0x2afa2e['options']);var _0x1c990f={'where':_0x1daf36[_0xe86a('0x3b')]};return db[_0xe86a('0x2b')][_0xe86a('0x20')](_0x1c990f)['then'](function(_0x3e9a08){_0x458052[_0xe86a('0x20')]=_0x3e9a08;if(_0x2afa2e[_0xe86a('0x30')][_0xe86a('0x3f')]){_0x1daf36[_0xe86a('0x40')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x1daf36);})[_0xe86a('0x24')](function(_0xb20811){_0x458052['rows']=_0xb20811;return _0x458052;})[_0xe86a('0x24')](respondWithFilteredResult(_0x4a7085,_0x1daf36))[_0xe86a('0x41')](handleError(_0x4a7085,null));};exports[_0xe86a('0x42')]=function(_0xfd0f7f,_0x4b7f6c){var _0x1c13d1={'raw':!![],'where':{'id':_0xfd0f7f[_0xe86a('0x43')]['id']}},_0x758011={};_0x758011['model']=_['keys'](db[_0xe86a('0x2b')][_0xe86a('0x2c')]);_0x758011[_0xe86a('0x30')]=_[_0xe86a('0x31')](_0xfd0f7f['query']);_0x758011[_0xe86a('0x32')]=_['intersection'](_0x758011[_0xe86a('0x34')],_0x758011[_0xe86a('0x30')]);_0x1c13d1[_0xe86a('0x35')]=_[_0xe86a('0x33')](_0x758011[_0xe86a('0x34')],qs[_0xe86a('0x36')](_0xfd0f7f[_0xe86a('0x30')][_0xe86a('0x36')]));_0x1c13d1[_0xe86a('0x35')]=_0x1c13d1['attributes'][_0xe86a('0x37')]?_0x1c13d1[_0xe86a('0x35')]:_0x758011[_0xe86a('0x34')];if(_0xfd0f7f[_0xe86a('0x30')][_0xe86a('0x3f')]){_0x1c13d1[_0xe86a('0x40')]=[{'all':!![]}];}_0x1c13d1=_[_0xe86a('0x3d')]({},_0x1c13d1,_0xfd0f7f['options']);return db[_0xe86a('0x2b')][_0xe86a('0x44')](_0x1c13d1)[_0xe86a('0x24')](handleEntityNotFound(_0x4b7f6c,null))[_0xe86a('0x24')](respondWithResult(_0x4b7f6c,null))['catch'](handleError(_0x4b7f6c,null));};exports[_0xe86a('0x45')]=function(_0x3378fa,_0x415bb3){return db['JscriptySessionReport'][_0xe86a('0x45')](_0x3378fa[_0xe86a('0x46')],{})[_0xe86a('0x24')](respondWithResult(_0x415bb3,0xc9))['catch'](handleError(_0x415bb3,null));};exports['update']=function(_0x4e1208,_0x5c7883){if(_0x4e1208[_0xe86a('0x46')]['id']){delete _0x4e1208[_0xe86a('0x46')]['id'];}return db[_0xe86a('0x2b')]['find']({'where':{'id':_0x4e1208[_0xe86a('0x43')]['id']}})['then'](handleEntityNotFound(_0x5c7883,null))[_0xe86a('0x24')](saveUpdates(_0x4e1208[_0xe86a('0x46')],null))['then'](respondWithResult(_0x5c7883,null))[_0xe86a('0x41')](handleError(_0x5c7883,null));};exports[_0xe86a('0x47')]=function(_0x2f5645,_0x46f169){return db[_0xe86a('0x2b')][_0xe86a('0x44')]({'where':{'id':_0x2f5645[_0xe86a('0x43')]['id']}})[_0xe86a('0x24')](handleEntityNotFound(_0x46f169,null))[_0xe86a('0x24')](removeEntity(_0x46f169,null))['catch'](handleError(_0x46f169,null));};exports[_0xe86a('0x48')]=function(_0x4b69d6,_0x4879a3){return db[_0xe86a('0x2b')][_0xe86a('0x48')]()[_0xe86a('0x24')](respondWithResult(_0x4879a3,null))['catch'](handleError(_0x4879a3,null));};exports[_0xe86a('0x49')]=function(_0xa8f0ae,_0x473cf6,_0x55c696){var _0x3a1cb3={'raw':!![],'where':{}};var _0x4326de={};var _0x45f11a={'count':0x0,'rows':[]};return db[_0xe86a('0x2b')][_0xe86a('0x4a')]({'where':{'id':_0xa8f0ae[_0xe86a('0x43')]['id']}})[_0xe86a('0x24')](handleEntityNotFound(_0x473cf6,null))[_0xe86a('0x24')](function(_0x13adb7){if(_0x13adb7){_0x4326de[_0xe86a('0x34')]=_['keys'](db[_0xe86a('0x4b')][_0xe86a('0x2c')]);_0x4326de[_0xe86a('0x30')]=_[_0xe86a('0x31')](_0xa8f0ae[_0xe86a('0x30')]);_0x4326de[_0xe86a('0x32')]=_[_0xe86a('0x33')](_0x4326de[_0xe86a('0x34')],_0x4326de[_0xe86a('0x30')]);_0x3a1cb3['attributes']=_[_0xe86a('0x33')](_0x4326de[_0xe86a('0x34')],qs[_0xe86a('0x36')](_0xa8f0ae[_0xe86a('0x30')]['fields']));_0x3a1cb3['attributes']=_0x3a1cb3[_0xe86a('0x35')]['length']?_0x3a1cb3[_0xe86a('0x35')]:_0x4326de[_0xe86a('0x34')];if(!_0xa8f0ae[_0xe86a('0x30')]['hasOwnProperty'](_0xe86a('0x39'))){_0x3a1cb3[_0xe86a('0x1e')]=qs[_0xe86a('0x1e')](_0xa8f0ae['query']['limit']);_0x3a1cb3['offset']=qs[_0xe86a('0x1d')](_0xa8f0ae[_0xe86a('0x30')][_0xe86a('0x1d')]);}_0x3a1cb3[_0xe86a('0x4c')]=qs['sort'](_0xa8f0ae[_0xe86a('0x30')][_0xe86a('0x3a')]);_0x3a1cb3[_0xe86a('0x3b')]=qs['filters'](_['pick'](_0xa8f0ae[_0xe86a('0x30')],_0x4326de[_0xe86a('0x32')]));_0x3a1cb3[_0xe86a('0x3b')][_0xe86a('0x4d')]=_0x13adb7['id'];if(_0xa8f0ae[_0xe86a('0x30')]['filter']){_0x3a1cb3[_0xe86a('0x3b')]=_[_0xe86a('0x3d')](_0x3a1cb3[_0xe86a('0x3b')],{'$or':_[_0xe86a('0x2a')](_0x3a1cb3['attributes'],function(_0x1fd0e2){var _0x21a499={};_0x21a499[_0x1fd0e2]={'$like':'%'+_0xa8f0ae[_0xe86a('0x30')][_0xe86a('0x3c')]+'%'};return _0x21a499;})});}_0x3a1cb3=_[_0xe86a('0x3d')]({},_0x3a1cb3,_0xa8f0ae[_0xe86a('0x4e')]);return db[_0xe86a('0x4b')][_0xe86a('0x20')]({'where':_0x3a1cb3['where']})[_0xe86a('0x24')](function(_0x5d2242){_0x45f11a[_0xe86a('0x20')]=_0x5d2242;if(_0xa8f0ae['query'][_0xe86a('0x3f')]){_0x3a1cb3['include']=[{'all':!![]}];}return db[_0xe86a('0x4b')][_0xe86a('0x4f')](_0x3a1cb3);})[_0xe86a('0x24')](function(_0x6a1864){_0x45f11a[_0xe86a('0x50')]=_0x6a1864;return _0x45f11a;});}})['then'](respondWithFilteredResult(_0x473cf6,_0x3a1cb3))[_0xe86a('0x41')](handleError(_0x473cf6,null));}; \ No newline at end of file +var _0x10f5=['end','status','offset','limit','set','apply','reject','update','then','destroy','error','stack','name','send','map','JscriptySessionReport','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','count','includeAll','include','show','options','catch','create','body','find','params','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','pick','SessionId','findAll','rows','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x336c8b,_0x56b55b){var _0x4dd2f6=function(_0x169a0f){while(--_0x169a0f){_0x336c8b['push'](_0x336c8b['shift']());}};_0x4dd2f6(++_0x56b55b);}(_0x10f5,0x110));var _0x510f=function(_0x447341,_0x4c80a9){_0x447341=_0x447341-0x0;var _0x42b06a=_0x10f5[_0x447341];return _0x42b06a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x510f('0x0'));var rp=require(_0x510f('0x1'));var moment=require(_0x510f('0x2'));var BPromise=require(_0x510f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x510f('0x4'));var sox=require(_0x510f('0x5'));var csv=require(_0x510f('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x510f('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x510f('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x510f('0x9'));var toCsv=require(_0x510f('0x6'));var querystring=require(_0x510f('0xa'));var Papa=require(_0x510f('0xb'));var Redis=require(_0x510f('0xc'));var authService=require(_0x510f('0xd'));var qs=require(_0x510f('0xe'));var as=require(_0x510f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x510f('0x10'));var utils=require('../../config/utils');var config=require(_0x510f('0x11'));var licenseUtil=require(_0x510f('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x242105,_0x3016bf){_0x3016bf=_0x3016bf||0xcc;return function(_0x425d0e){if(_0x425d0e){return _0x242105[_0x510f('0x13')](_0x3016bf);}return _0x242105['status'](_0x3016bf)[_0x510f('0x14')]();};}function respondWithResult(_0x39acae,_0x454554){_0x454554=_0x454554||0xc8;return function(_0x1495c0){if(_0x1495c0){return _0x39acae[_0x510f('0x15')](_0x454554)['json'](_0x1495c0);}};}function respondWithFilteredResult(_0x44dd1e,_0x272321){return function(_0x3c097b){if(_0x3c097b){var _0x247580=typeof _0x272321[_0x510f('0x16')]==='undefined'&&typeof _0x272321[_0x510f('0x17')]==='undefined';var _0xb5f7f3=_0x3c097b['count'];var _0x4fd078=_0x247580?0x0:_0x272321[_0x510f('0x16')];var _0x1546e2=_0x247580?_0x3c097b['count']:_0x272321[_0x510f('0x16')]+_0x272321['limit'];var _0x330dca;if(_0x1546e2>=_0xb5f7f3){_0x1546e2=_0xb5f7f3;_0x330dca=0xc8;}else{_0x330dca=0xce;}_0x44dd1e[_0x510f('0x15')](_0x330dca);return _0x44dd1e[_0x510f('0x18')]('Content-Range',_0x4fd078+'-'+_0x1546e2+'/'+_0xb5f7f3)['json'](_0x3c097b);}return null;};}function patchUpdates(_0x40cb61){return function(_0x3854e3){try{jsonpatch[_0x510f('0x19')](_0x3854e3,_0x40cb61,!![]);}catch(_0x31835c){return BPromise[_0x510f('0x1a')](_0x31835c);}return _0x3854e3['save']();};}function saveUpdates(_0x512470,_0x262015){return function(_0x513159){if(_0x513159){return _0x513159[_0x510f('0x1b')](_0x512470)[_0x510f('0x1c')](function(_0x10d721){return _0x10d721;});}return null;};}function removeEntity(_0x2e8fd1,_0x4b4242){return function(_0x52342a){if(_0x52342a){return _0x52342a[_0x510f('0x1d')]()[_0x510f('0x1c')](function(){_0x2e8fd1[_0x510f('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x541f4a,_0x2e38e8){return function(_0x5c0389){if(!_0x5c0389){_0x541f4a[_0x510f('0x13')](0x194);}return _0x5c0389;};}function handleError(_0x575a69,_0x1c0c1f){_0x1c0c1f=_0x1c0c1f||0x1f4;return function(_0x1ed96b){logger[_0x510f('0x1e')](_0x1ed96b[_0x510f('0x1f')]);if(_0x1ed96b[_0x510f('0x20')]){delete _0x1ed96b[_0x510f('0x20')];}_0x575a69[_0x510f('0x15')](_0x1c0c1f)[_0x510f('0x21')](_0x1ed96b);};}exports['index']=function(_0x53aa58,_0x70bf4e){var _0x4eaa7e={},_0x45e2d3={},_0x2a6308={'count':0x0,'rows':[]};var _0x503d11=_[_0x510f('0x22')](db[_0x510f('0x23')]['rawAttributes'],function(_0x13de4b){return{'name':_0x13de4b[_0x510f('0x24')],'type':_0x13de4b[_0x510f('0x25')][_0x510f('0x26')]};});_0x45e2d3[_0x510f('0x27')]=_['map'](_0x503d11,_0x510f('0x20'));_0x45e2d3[_0x510f('0x28')]=_[_0x510f('0x29')](_0x53aa58[_0x510f('0x28')]);_0x45e2d3['filters']=_['intersection'](_0x45e2d3[_0x510f('0x27')],_0x45e2d3[_0x510f('0x28')]);_0x4eaa7e[_0x510f('0x2a')]=_[_0x510f('0x2b')](_0x45e2d3[_0x510f('0x27')],qs[_0x510f('0x2c')](_0x53aa58[_0x510f('0x28')][_0x510f('0x2c')]));_0x4eaa7e[_0x510f('0x2a')]=_0x4eaa7e[_0x510f('0x2a')][_0x510f('0x2d')]?_0x4eaa7e[_0x510f('0x2a')]:_0x45e2d3['model'];if(!_0x53aa58[_0x510f('0x28')][_0x510f('0x2e')](_0x510f('0x2f'))){_0x4eaa7e['limit']=qs['limit'](_0x53aa58[_0x510f('0x28')][_0x510f('0x17')]);_0x4eaa7e[_0x510f('0x16')]=qs[_0x510f('0x16')](_0x53aa58['query'][_0x510f('0x16')]);}_0x4eaa7e['order']=qs[_0x510f('0x30')](_0x53aa58[_0x510f('0x28')][_0x510f('0x30')]);_0x4eaa7e[_0x510f('0x31')]=qs[_0x510f('0x32')](_['pick'](_0x53aa58[_0x510f('0x28')],_0x45e2d3[_0x510f('0x32')]),_0x503d11);if(_0x53aa58[_0x510f('0x28')][_0x510f('0x33')]){_0x4eaa7e[_0x510f('0x31')]=_[_0x510f('0x34')](_0x4eaa7e[_0x510f('0x31')],{'$or':_[_0x510f('0x22')](_0x503d11,function(_0x46d671){if(_0x46d671[_0x510f('0x25')]!==_0x510f('0x35')){var _0x3155fd={};_0x3155fd[_0x46d671['name']]={'$like':'%'+_0x53aa58['query']['filter']+'%'};return _0x3155fd;}})});}_0x4eaa7e=_[_0x510f('0x34')]({},_0x4eaa7e,_0x53aa58['options']);var _0x2df49f={'where':_0x4eaa7e[_0x510f('0x31')]};return db[_0x510f('0x23')][_0x510f('0x36')](_0x2df49f)['then'](function(_0x369de5){_0x2a6308[_0x510f('0x36')]=_0x369de5;if(_0x53aa58[_0x510f('0x28')][_0x510f('0x37')]){_0x4eaa7e[_0x510f('0x38')]=[{'all':!![]}];}return db[_0x510f('0x23')]['findAll'](_0x4eaa7e);})[_0x510f('0x1c')](function(_0x460506){_0x2a6308['rows']=_0x460506;return _0x2a6308;})['then'](respondWithFilteredResult(_0x70bf4e,_0x4eaa7e))['catch'](handleError(_0x70bf4e,null));};exports[_0x510f('0x39')]=function(_0x6e0071,_0x310d54){var _0x31c2fe={'raw':!![],'where':{'id':_0x6e0071['params']['id']}},_0x362dff={};_0x362dff[_0x510f('0x27')]=_[_0x510f('0x29')](db[_0x510f('0x23')]['rawAttributes']);_0x362dff[_0x510f('0x28')]=_[_0x510f('0x29')](_0x6e0071[_0x510f('0x28')]);_0x362dff['filters']=_['intersection'](_0x362dff['model'],_0x362dff[_0x510f('0x28')]);_0x31c2fe[_0x510f('0x2a')]=_[_0x510f('0x2b')](_0x362dff['model'],qs[_0x510f('0x2c')](_0x6e0071['query'][_0x510f('0x2c')]));_0x31c2fe[_0x510f('0x2a')]=_0x31c2fe['attributes'][_0x510f('0x2d')]?_0x31c2fe[_0x510f('0x2a')]:_0x362dff['model'];if(_0x6e0071[_0x510f('0x28')]['includeAll']){_0x31c2fe[_0x510f('0x38')]=[{'all':!![]}];}_0x31c2fe=_[_0x510f('0x34')]({},_0x31c2fe,_0x6e0071[_0x510f('0x3a')]);return db[_0x510f('0x23')]['find'](_0x31c2fe)[_0x510f('0x1c')](handleEntityNotFound(_0x310d54,null))['then'](respondWithResult(_0x310d54,null))[_0x510f('0x3b')](handleError(_0x310d54,null));};exports['create']=function(_0x14135f,_0x2dd107){return db[_0x510f('0x23')][_0x510f('0x3c')](_0x14135f[_0x510f('0x3d')],{})['then'](respondWithResult(_0x2dd107,0xc9))['catch'](handleError(_0x2dd107,null));};exports[_0x510f('0x1b')]=function(_0x4540ce,_0x2dd36a){if(_0x4540ce['body']['id']){delete _0x4540ce[_0x510f('0x3d')]['id'];}return db[_0x510f('0x23')][_0x510f('0x3e')]({'where':{'id':_0x4540ce['params']['id']}})[_0x510f('0x1c')](handleEntityNotFound(_0x2dd36a,null))['then'](saveUpdates(_0x4540ce[_0x510f('0x3d')],null))[_0x510f('0x1c')](respondWithResult(_0x2dd36a,null))['catch'](handleError(_0x2dd36a,null));};exports[_0x510f('0x1d')]=function(_0x39618d,_0x2a9bf7){return db[_0x510f('0x23')][_0x510f('0x3e')]({'where':{'id':_0x39618d[_0x510f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a9bf7,null))['then'](removeEntity(_0x2a9bf7,null))[_0x510f('0x3b')](handleError(_0x2a9bf7,null));};exports[_0x510f('0x40')]=function(_0xe8ff72,_0x2c57f1){return db[_0x510f('0x23')][_0x510f('0x40')]()[_0x510f('0x1c')](respondWithResult(_0x2c57f1,null))['catch'](handleError(_0x2c57f1,null));};exports[_0x510f('0x41')]=function(_0x23c9f8,_0x4eb2b9,_0xe31136){var _0x36a8c3={'raw':!![],'where':{}};var _0x2a863d={};var _0x4bfc6b={'count':0x0,'rows':[]};return db[_0x510f('0x23')][_0x510f('0x42')]({'where':{'id':_0x23c9f8[_0x510f('0x3f')]['id']}})[_0x510f('0x1c')](handleEntityNotFound(_0x4eb2b9,null))['then'](function(_0x3b7b0c){if(_0x3b7b0c){_0x2a863d[_0x510f('0x27')]=_['keys'](db[_0x510f('0x43')][_0x510f('0x44')]);_0x2a863d[_0x510f('0x28')]=_[_0x510f('0x29')](_0x23c9f8[_0x510f('0x28')]);_0x2a863d[_0x510f('0x32')]=_[_0x510f('0x2b')](_0x2a863d[_0x510f('0x27')],_0x2a863d[_0x510f('0x28')]);_0x36a8c3[_0x510f('0x2a')]=_[_0x510f('0x2b')](_0x2a863d[_0x510f('0x27')],qs[_0x510f('0x2c')](_0x23c9f8[_0x510f('0x28')][_0x510f('0x2c')]));_0x36a8c3[_0x510f('0x2a')]=_0x36a8c3[_0x510f('0x2a')]['length']?_0x36a8c3[_0x510f('0x2a')]:_0x2a863d[_0x510f('0x27')];if(!_0x23c9f8['query'][_0x510f('0x2e')](_0x510f('0x2f'))){_0x36a8c3['limit']=qs['limit'](_0x23c9f8[_0x510f('0x28')][_0x510f('0x17')]);_0x36a8c3['offset']=qs[_0x510f('0x16')](_0x23c9f8[_0x510f('0x28')][_0x510f('0x16')]);}_0x36a8c3['order']=qs[_0x510f('0x30')](_0x23c9f8['query']['sort']);_0x36a8c3[_0x510f('0x31')]=qs[_0x510f('0x32')](_[_0x510f('0x45')](_0x23c9f8[_0x510f('0x28')],_0x2a863d[_0x510f('0x32')]));_0x36a8c3[_0x510f('0x31')][_0x510f('0x46')]=_0x3b7b0c['id'];if(_0x23c9f8[_0x510f('0x28')][_0x510f('0x33')]){_0x36a8c3['where']=_[_0x510f('0x34')](_0x36a8c3[_0x510f('0x31')],{'$or':_[_0x510f('0x22')](_0x36a8c3[_0x510f('0x2a')],function(_0x403ee4){var _0x458602={};_0x458602[_0x403ee4]={'$like':'%'+_0x23c9f8['query'][_0x510f('0x33')]+'%'};return _0x458602;})});}_0x36a8c3=_['merge']({},_0x36a8c3,_0x23c9f8['options']);return db['JscriptyQuestionReport']['count']({'where':_0x36a8c3[_0x510f('0x31')]})['then'](function(_0x4bbd85){_0x4bfc6b[_0x510f('0x36')]=_0x4bbd85;if(_0x23c9f8[_0x510f('0x28')]['includeAll']){_0x36a8c3[_0x510f('0x38')]=[{'all':!![]}];}return db[_0x510f('0x43')][_0x510f('0x47')](_0x36a8c3);})[_0x510f('0x1c')](function(_0x18e8f7){_0x4bfc6b[_0x510f('0x48')]=_0x18e8f7;return _0x4bfc6b;});}})[_0x510f('0x1c')](respondWithFilteredResult(_0x4eb2b9,_0x36a8c3))[_0x510f('0x3b')](handleError(_0x4eb2b9,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 8048302..6f6ca8d 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions'];(function(_0x36fd75,_0x22ef90){var _0x250360=function(_0x28f0e5){while(--_0x28f0e5){_0x36fd75['push'](_0x36fd75['shift']());}};_0x250360(++_0x22ef90);}(_0x1261,0x144));var _0x1126=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0x1261[_0x5f6a8a];return _0x2cce4d;};'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')]('JscriptySessionReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1db9=['JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define'];(function(_0x288267,_0x12e1e3){var _0x5b245c=function(_0x4716ab){while(--_0x4716ab){_0x288267['push'](_0x288267['shift']());}};_0x5b245c(++_0x12e1e3);}(_0x1db9,0x176));var _0x91db=function(_0x579858,_0x5c336b){_0x579858=_0x579858-0x0;var _0x467b5b=_0x1db9[_0x579858];return _0x467b5b;};'use strict';var _=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var logger=require(_0x91db('0x2'))(_0x91db('0x3'));var moment=require(_0x91db('0x4'));var BPromise=require(_0x91db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91db('0x6'));var rimraf=require(_0x91db('0x7'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x91db('0x8')]=function(_0x4b3f5c,_0x5e69d9){return _0x4b3f5c[_0x91db('0x9')](_0x91db('0xa'),attributes,{'tableName':_0x91db('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 0dbb195..8025f6b 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 _0x57ca=['client','http','request','info','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptySessionReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2f7b30,_0x16c3c3){var _0x1cdc19=function(_0xa1203a){while(--_0xa1203a){_0x2f7b30['push'](_0x2f7b30['shift']());}};_0x1cdc19(++_0x16c3c3);}(_0x57ca,0x108));var _0xa57c=function(_0x587f08,_0x5d867b){_0x587f08=_0x587f08-0x0;var _0x57dc56=_0x57ca[_0x587f08];return _0x57dc56;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0xacf4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xacf4,0xe7));var _0x4acf=function(_0x5ddf27,_0x5d6857){_0x5ddf27=_0x5ddf27-0x0;var _0xd8a2b8=_0xacf4[_0x5ddf27];return _0xd8a2b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 827330a..13ee578 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 _0xe3c7=['fs-extra','../../components/auth/service','../../components/interaction/service','get','index','put','/:id','update','/download_log_file','isAuthenticated','exports','util','path','express'];(function(_0x1c4f28,_0x59beb3){var _0x5b30a2=function(_0x370009){while(--_0x370009){_0x1c4f28['push'](_0x1c4f28['shift']());}};_0x5b30a2(++_0x59beb3);}(_0xe3c7,0x6d));var _0x7e3c=function(_0x8330a2,_0x177ecc){_0x8330a2=_0x8330a2-0x0;var _0x5243c6=_0xe3c7[_0x8330a2];return _0x5243c6;};'use strict';var multer=require('multer');var util=require(_0x7e3c('0x0'));var path=require(_0x7e3c('0x1'));var timeout=require('connect-timeout');var express=require(_0x7e3c('0x2'));var router=express['Router']();var fs_extra=require(_0x7e3c('0x3'));var auth=require(_0x7e3c('0x4'));var interaction=require(_0x7e3c('0x5'));var config=require('../../config/environment');var controller=require('./license.controller');router[_0x7e3c('0x6')]('/',controller[_0x7e3c('0x7')]);router[_0x7e3c('0x8')](_0x7e3c('0x9'),auth['isAuthenticated'](),controller[_0x7e3c('0xa')]);router[_0x7e3c('0x6')](_0x7e3c('0xb'),auth[_0x7e3c('0xc')](),controller['downloadLogFile']);module[_0x7e3c('0xd')]=router; \ No newline at end of file +var _0x0203=['Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','index','isAuthenticated','update','get','exports','multer','path','connect-timeout','express'];(function(_0x41e8b6,_0x306cc2){var _0x13f112=function(_0x484f85){while(--_0x484f85){_0x41e8b6['push'](_0x41e8b6['shift']());}};_0x13f112(++_0x306cc2);}(_0x0203,0x7a));var _0x3020=function(_0xbaec96,_0x765a6a){_0xbaec96=_0xbaec96-0x0;var _0x3ceff2=_0x0203[_0xbaec96];return _0x3ceff2;};'use strict';var multer=require(_0x3020('0x0'));var util=require('util');var path=require(_0x3020('0x1'));var timeout=require(_0x3020('0x2'));var express=require(_0x3020('0x3'));var router=express[_0x3020('0x4')]();var fs_extra=require(_0x3020('0x5'));var auth=require(_0x3020('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3020('0x7'));var controller=require(_0x3020('0x8'));router['get']('/',controller[_0x3020('0x9')]);router['put']('/:id',auth[_0x3020('0xa')](),controller[_0x3020('0xb')]);router[_0x3020('0xc')]('/download_log_file',auth[_0x3020('0xa')](),controller['downloadLogFile']);module[_0x3020('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 5e76385..34c1558 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 _0xefa6=['INTEGER','sequelize','TEXT','STRING'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0xefa6,0xb1));var _0x6efa=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xefa6[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0x6efa('0x0'));module['exports']={'license':{'type':Sequelize[_0x6efa('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x6efa('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x6efa('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa943=['INTEGER','sequelize','TEXT','STRING'];(function(_0x202b9f,_0x1d9dad){var _0x55faf1=function(_0x45680e){while(--_0x45680e){_0x202b9f['push'](_0x202b9f['shift']());}};_0x55faf1(++_0x1d9dad);}(_0xa943,0x179));var _0x3a94=function(_0x47c18d,_0x5094e3){_0x47c18d=_0x47c18d-0x0;var _0x55ac6c=_0xa943[_0x47c18d];return _0x55ac6c;};'use strict';var Sequelize=require(_0x3a94('0x0'));module['exports']={'license':{'type':Sequelize[_0x3a94('0x1')]},'data1':{'type':Sequelize[_0x3a94('0x2')]},'data2':{'type':Sequelize[_0x3a94('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x3a94('0x3')],'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 16e09d4..f687b01 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 _0xe035=['destroy','end','error','stack','name','index','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','options','getLicense','body','License','params','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then'];(function(_0x40c8eb,_0x38ce98){var _0x3ff10a=function(_0x5f2ef9){while(--_0x5f2ef9){_0x40c8eb['push'](_0x40c8eb['shift']());}};_0x3ff10a(++_0x38ce98);}(_0xe035,0x69));var _0x5e03=function(_0x4c41ff,_0x50acac){_0x4c41ff=_0x4c41ff-0x0;var _0xc9ec17=_0xe035[_0x4c41ff];return _0xc9ec17;};'use strict';var emlformat=require(_0x5e03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e03('0x1'));var jsonpatch=require(_0x5e03('0x2'));var rp=require(_0x5e03('0x3'));var moment=require(_0x5e03('0x4'));var BPromise=require(_0x5e03('0x5'));var Mustache=require(_0x5e03('0x6'));var util=require(_0x5e03('0x7'));var path=require(_0x5e03('0x8'));var sox=require(_0x5e03('0x9'));var csv=require(_0x5e03('0xa'));var ejs=require(_0x5e03('0xb'));var fs=require('fs');var fs_extra=require(_0x5e03('0xc'));var _=require(_0x5e03('0xd'));var squel=require(_0x5e03('0xe'));var crypto=require(_0x5e03('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e03('0xa'));var querystring=require(_0x5e03('0x10'));var Papa=require('papaparse');var Redis=require(_0x5e03('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e03('0x12'));var logger=require(_0x5e03('0x13'))(_0x5e03('0x14'));var utils=require(_0x5e03('0x15'));var config=require(_0x5e03('0x16'));var licenseUtil=require(_0x5e03('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1accaf,_0xb7f772){_0xb7f772=_0xb7f772||0xcc;return function(_0x4ef59b){if(_0x4ef59b){return _0x1accaf[_0x5e03('0x18')](_0xb7f772);}return _0x1accaf['status'](_0xb7f772)['end']();};}function respondWithResult(_0x5dcb3b,_0xe456ed){_0xe456ed=_0xe456ed||0xc8;return function(_0x38c62a){if(_0x38c62a){return _0x5dcb3b[_0x5e03('0x19')](_0xe456ed)[_0x5e03('0x1a')](_0x38c62a);}};}function respondWithFilteredResult(_0x1bfcf4,_0x5b28e4){return function(_0x111745){if(_0x111745){var _0x25b59e=typeof _0x5b28e4[_0x5e03('0x1b')]==='undefined'&&typeof _0x5b28e4[_0x5e03('0x1c')]===_0x5e03('0x1d');var _0x504936=_0x111745[_0x5e03('0x1e')];var _0x57da1a=_0x25b59e?0x0:_0x5b28e4[_0x5e03('0x1b')];var _0x5a9c71=_0x25b59e?_0x111745[_0x5e03('0x1e')]:_0x5b28e4[_0x5e03('0x1b')]+_0x5b28e4[_0x5e03('0x1c')];var _0x2b0cdf;if(_0x5a9c71>=_0x504936){_0x5a9c71=_0x504936;_0x2b0cdf=0xc8;}else{_0x2b0cdf=0xce;}_0x1bfcf4[_0x5e03('0x19')](_0x2b0cdf);return _0x1bfcf4[_0x5e03('0x1f')](_0x5e03('0x20'),_0x57da1a+'-'+_0x5a9c71+'/'+_0x504936)[_0x5e03('0x1a')](_0x111745);}return null;};}function patchUpdates(_0x3b6029){return function(_0x3dc55b){try{jsonpatch[_0x5e03('0x21')](_0x3dc55b,_0x3b6029,!![]);}catch(_0x416334){return BPromise[_0x5e03('0x22')](_0x416334);}return _0x3dc55b['save']();};}function saveUpdates(_0x50106a,_0x3f6366){return function(_0x32ae1f){if(_0x32ae1f){return _0x32ae1f[_0x5e03('0x23')](_0x50106a)[_0x5e03('0x24')](function(_0x2260e5){return _0x2260e5;});}return null;};}function removeEntity(_0x258b47,_0x3f55cd){return function(_0x239aea){if(_0x239aea){return _0x239aea[_0x5e03('0x25')]()[_0x5e03('0x24')](function(){_0x258b47[_0x5e03('0x19')](0xcc)[_0x5e03('0x26')]();});}};}function handleEntityNotFound(_0x1acb47,_0x18b8a3){return function(_0x565094){if(!_0x565094){_0x1acb47[_0x5e03('0x18')](0x194);}return _0x565094;};}function handleError(_0x5032aa,_0x1d186d){_0x1d186d=_0x1d186d||0x1f4;return function(_0x37d9d7){logger[_0x5e03('0x27')](_0x37d9d7[_0x5e03('0x28')]);if(_0x37d9d7['name']){delete _0x37d9d7[_0x5e03('0x29')];}_0x5032aa['status'](_0x1d186d)['send'](_0x37d9d7);};}var utilLicense=require(_0x5e03('0x17'));exports[_0x5e03('0x2a')]=function(_0x5e7243,_0x3c6d72){var _0x331400={'raw':!![],'where':{'id':0x1}},_0x2e7475={};_0x2e7475[_0x5e03('0x2b')]=_[_0x5e03('0x2c')](db['License'][_0x5e03('0x2d')]);_0x2e7475['query']=_[_0x5e03('0x2c')](_0x5e7243[_0x5e03('0x2e')]);_0x2e7475[_0x5e03('0x2f')]=_[_0x5e03('0x30')](_0x2e7475['model'],_0x2e7475[_0x5e03('0x2e')]);_0x331400[_0x5e03('0x31')]=_['intersection'](_0x2e7475['model'],qs[_0x5e03('0x32')](_0x5e7243[_0x5e03('0x2e')][_0x5e03('0x32')]));_0x331400[_0x5e03('0x31')]=_0x331400[_0x5e03('0x31')][_0x5e03('0x33')]?_0x331400[_0x5e03('0x31')]:_0x2e7475[_0x5e03('0x2b')];_0x331400=_['merge']({},_0x331400,_0x5e7243[_0x5e03('0x34')]);return utilLicense[_0x5e03('0x35')](_0x331400)[_0x5e03('0x24')](respondWithResult(_0x3c6d72,null))['catch'](handleError(_0x3c6d72,null));};exports['update']=function(_0x5d6e09,_0x3c0255){if(_0x5d6e09[_0x5e03('0x36')]['id']){delete _0x5d6e09[_0x5e03('0x36')]['id'];}return db[_0x5e03('0x37')]['find']({'where':{'id':_0x5d6e09[_0x5e03('0x38')]['id']}})[_0x5e03('0x24')](handleEntityNotFound(_0x3c0255,null))[_0x5e03('0x24')](function(_0x4b61a1){var _0x92c8d4=_0x4b61a1['get']({'plain':!![]});return utilLicense[_0x5e03('0x39')](_0x92c8d4,_0x5d6e09[_0x5e03('0x36')][_0x5e03('0x3a')]);})[_0x5e03('0x24')](function(_0x3406ac){if(!_0x3406ac[_0x5e03('0x3b')]){return saveUpdates(_0x5d6e09['body'],null);}return _0x3406ac;})[_0x5e03('0x24')](respondWithResult(_0x3c0255,null))['catch'](handleError(_0x3c0255,null));};exports[_0x5e03('0x3c')]=function(_0x5a6edb,_0xc63e0c){var _0x22d86a=_0x5e03('0x3d');var _0x193c5b=path[_0x5e03('0x3e')](_0x5e03('0x3f'),_0x5e03('0x40'),_0x5e03('0x41'),_0x22d86a);_0xc63e0c[_0x5e03('0x42')](_0x5e03('0x43'),_0x5e03('0x44')+_0x22d86a);_0xc63e0c[_0x5e03('0x1f')](_0x5e03('0x45'),'text/plain');_0xc63e0c[_0x5e03('0x46')](_0x193c5b);}; \ No newline at end of file +var _0xefb5=['join','/var','log','xcally','Content-disposition','Content-Type','text/plain','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','model','catch','body','find','params','get','checkLicense','key'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xefb5,0x91));var _0x5efb=function(_0x50f6e5,_0x151ccb){_0x50f6e5=_0x50f6e5-0x0;var _0x5988c5=_0xefb5[_0x50f6e5];return _0x5988c5;};'use strict';var emlformat=require(_0x5efb('0x0'));var rimraf=require(_0x5efb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5efb('0x2'));var rp=require('request-promise');var moment=require(_0x5efb('0x3'));var BPromise=require(_0x5efb('0x4'));var Mustache=require(_0x5efb('0x5'));var util=require('util');var path=require(_0x5efb('0x6'));var sox=require(_0x5efb('0x7'));var csv=require(_0x5efb('0x8'));var ejs=require(_0x5efb('0x9'));var fs=require('fs');var fs_extra=require(_0x5efb('0xa'));var _=require(_0x5efb('0xb'));var squel=require(_0x5efb('0xc'));var crypto=require(_0x5efb('0xd'));var jsforce=require(_0x5efb('0xe'));var deskjs=require(_0x5efb('0xf'));var toCsv=require(_0x5efb('0x8'));var querystring=require(_0x5efb('0x10'));var Papa=require(_0x5efb('0x11'));var Redis=require(_0x5efb('0x12'));var authService=require(_0x5efb('0x13'));var qs=require(_0x5efb('0x14'));var as=require(_0x5efb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5efb('0x16'))('api');var utils=require(_0x5efb('0x17'));var config=require(_0x5efb('0x18'));var licenseUtil=require(_0x5efb('0x19'));var db=require(_0x5efb('0x1a'))['db'];function respondWithStatusCode(_0x59d701,_0x2efc8a){_0x2efc8a=_0x2efc8a||0xcc;return function(_0x5572f3){if(_0x5572f3){return _0x59d701[_0x5efb('0x1b')](_0x2efc8a);}return _0x59d701['status'](_0x2efc8a)[_0x5efb('0x1c')]();};}function respondWithResult(_0x3b9331,_0x4ca65a){_0x4ca65a=_0x4ca65a||0xc8;return function(_0x30107b){if(_0x30107b){return _0x3b9331[_0x5efb('0x1d')](_0x4ca65a)[_0x5efb('0x1e')](_0x30107b);}};}function respondWithFilteredResult(_0xa14bed,_0x6229a5){return function(_0x916cfd){if(_0x916cfd){var _0x5d524b=typeof _0x6229a5['offset']===_0x5efb('0x1f')&&typeof _0x6229a5[_0x5efb('0x20')]===_0x5efb('0x1f');var _0xd93f6=_0x916cfd[_0x5efb('0x21')];var _0x2f9ac3=_0x5d524b?0x0:_0x6229a5['offset'];var _0x54c87c=_0x5d524b?_0x916cfd[_0x5efb('0x21')]:_0x6229a5['offset']+_0x6229a5[_0x5efb('0x20')];var _0x4134f4;if(_0x54c87c>=_0xd93f6){_0x54c87c=_0xd93f6;_0x4134f4=0xc8;}else{_0x4134f4=0xce;}_0xa14bed[_0x5efb('0x1d')](_0x4134f4);return _0xa14bed[_0x5efb('0x22')](_0x5efb('0x23'),_0x2f9ac3+'-'+_0x54c87c+'/'+_0xd93f6)[_0x5efb('0x1e')](_0x916cfd);}return null;};}function patchUpdates(_0x462e33){return function(_0x1715ff){try{jsonpatch[_0x5efb('0x24')](_0x1715ff,_0x462e33,!![]);}catch(_0x3027ce){return BPromise[_0x5efb('0x25')](_0x3027ce);}return _0x1715ff[_0x5efb('0x26')]();};}function saveUpdates(_0x1e257a,_0x156e6d){return function(_0x28ee35){if(_0x28ee35){return _0x28ee35[_0x5efb('0x27')](_0x1e257a)[_0x5efb('0x28')](function(_0x403a90){return _0x403a90;});}return null;};}function removeEntity(_0x2ee0a6,_0x56c28d){return function(_0x1ecda5){if(_0x1ecda5){return _0x1ecda5[_0x5efb('0x29')]()[_0x5efb('0x28')](function(){_0x2ee0a6['status'](0xcc)[_0x5efb('0x1c')]();});}};}function handleEntityNotFound(_0x3e5567,_0x16f178){return function(_0x309438){if(!_0x309438){_0x3e5567['sendStatus'](0x194);}return _0x309438;};}function handleError(_0x299589,_0xb65f64){_0xb65f64=_0xb65f64||0x1f4;return function(_0x36ac35){logger[_0x5efb('0x2a')](_0x36ac35[_0x5efb('0x2b')]);if(_0x36ac35['name']){delete _0x36ac35['name'];}_0x299589[_0x5efb('0x1d')](_0xb65f64)[_0x5efb('0x2c')](_0x36ac35);};}var utilLicense=require(_0x5efb('0x19'));exports['index']=function(_0x3ce059,_0x2beb22){var _0x5ee2b6={'raw':!![],'where':{'id':0x1}},_0x84fa32={};_0x84fa32['model']=_[_0x5efb('0x2d')](db[_0x5efb('0x2e')][_0x5efb('0x2f')]);_0x84fa32[_0x5efb('0x30')]=_[_0x5efb('0x2d')](_0x3ce059[_0x5efb('0x30')]);_0x84fa32[_0x5efb('0x31')]=_[_0x5efb('0x32')](_0x84fa32['model'],_0x84fa32['query']);_0x5ee2b6['attributes']=_[_0x5efb('0x32')](_0x84fa32['model'],qs[_0x5efb('0x33')](_0x3ce059[_0x5efb('0x30')][_0x5efb('0x33')]));_0x5ee2b6[_0x5efb('0x34')]=_0x5ee2b6[_0x5efb('0x34')][_0x5efb('0x35')]?_0x5ee2b6[_0x5efb('0x34')]:_0x84fa32[_0x5efb('0x36')];_0x5ee2b6=_['merge']({},_0x5ee2b6,_0x3ce059['options']);return utilLicense['getLicense'](_0x5ee2b6)[_0x5efb('0x28')](respondWithResult(_0x2beb22,null))[_0x5efb('0x37')](handleError(_0x2beb22,null));};exports['update']=function(_0x4bc33f,_0x5e2cd6){if(_0x4bc33f[_0x5efb('0x38')]['id']){delete _0x4bc33f[_0x5efb('0x38')]['id'];}return db[_0x5efb('0x2e')][_0x5efb('0x39')]({'where':{'id':_0x4bc33f[_0x5efb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x5e2cd6,null))[_0x5efb('0x28')](function(_0x159415){var _0x1de4fc=_0x159415[_0x5efb('0x3b')]({'plain':!![]});return utilLicense[_0x5efb('0x3c')](_0x1de4fc,_0x4bc33f['body'][_0x5efb('0x3d')]);})[_0x5efb('0x28')](function(_0x1b5082){if(!_0x1b5082['demo']){return saveUpdates(_0x4bc33f[_0x5efb('0x38')],null);}return _0x1b5082;})['then'](respondWithResult(_0x5e2cd6,null))[_0x5efb('0x37')](handleError(_0x5e2cd6,null));};exports['downloadLogFile']=function(_0x477b96,_0x19a895){var _0x24c772='license-info.log';var _0x3af63b=path[_0x5efb('0x3e')](_0x5efb('0x3f'),_0x5efb('0x40'),_0x5efb('0x41'),_0x24c772);_0x19a895['setHeader'](_0x5efb('0x42'),'attachment;\x20filename='+_0x24c772);_0x19a895[_0x5efb('0x22')](_0x5efb('0x43'),_0x5efb('0x44'));_0x19a895['download'](_0x3af63b);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 1538659..f01528b 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 _0x6c45=['rimraf','define','License','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x1f81dd,_0x10fb17){var _0x49d583=function(_0x1e7c29){while(--_0x1e7c29){_0x1f81dd['push'](_0x1f81dd['shift']());}};_0x49d583(++_0x10fb17);}(_0x6c45,0x1f2));var _0x56c4=function(_0x125803,_0x4616b7){_0x125803=_0x125803-0x0;var _0x4453cb=_0x6c45[_0x125803];return _0x4453cb;};'use strict';var _=require('lodash');var util=require(_0x56c4('0x0'));var logger=require(_0x56c4('0x1'))('api');var moment=require(_0x56c4('0x2'));var BPromise=require(_0x56c4('0x3'));var rp=require(_0x56c4('0x4'));var fs=require('fs');var path=require(_0x56c4('0x5'));var rimraf=require(_0x56c4('0x6'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x43e808,_0x53c6d6){return _0x43e808[_0x56c4('0x7')](_0x56c4('0x8'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x342e=['license','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','License'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x342e,0x1d5));var _0xe342=function(_0x3826ad,_0x49a30d){_0x3826ad=_0x3826ad-0x0;var _0x17b900=_0x342e[_0x3826ad];return _0x17b900;};'use strict';var _=require(_0xe342('0x0'));var util=require(_0xe342('0x1'));var logger=require(_0xe342('0x2'))('api');var moment=require(_0xe342('0x3'));var BPromise=require(_0xe342('0x4'));var rp=require(_0xe342('0x5'));var fs=require('fs');var path=require(_0xe342('0x6'));var rimraf=require(_0xe342('0x7'));var config=require(_0xe342('0x8'));var attributes=require('./license.attributes');module['exports']=function(_0x1ea0cb,_0x4d5002){return _0x1ea0cb[_0xe342('0x9')](_0xe342('0xa'),attributes,{'tableName':_0xe342('0xb'),'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 5a7883b..4bf5585 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 _0x89c1=['../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x356773,_0x49f8c2){var _0x4e478f=function(_0x547b46){while(--_0x547b46){_0x356773['push'](_0x356773['shift']());}};_0x4e478f(++_0x49f8c2);}(_0x89c1,0x64));var _0x189c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x89c1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x189c('0x0'));var moment=require(_0x189c('0x1'));var BPromise=require(_0x189c('0x2'));var rs=require(_0x189c('0x3'));var fs=require('fs');var Redis=require(_0x189c('0x4'));var db=require(_0x189c('0x5'))['db'];var utils=require(_0x189c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x189c('0x7'));var client=jayson[_0x189c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20aaa4,_0x3da7e1,_0x114287){return new BPromise(function(_0x498642,_0x703a22){return client[_0x189c('0x9')](_0x20aaa4,_0x114287)[_0x189c('0xa')](function(_0x2efcb0){logger[_0x189c('0xb')](_0x189c('0xc'),_0x3da7e1,'request\x20sent');logger[_0x189c('0xd')](_0x189c('0xe'),_0x3da7e1,_0x189c('0xf'),JSON['stringify'](_0x2efcb0));if(_0x2efcb0['error']){if(_0x2efcb0[_0x189c('0x10')][_0x189c('0x11')]===0x1f4){logger[_0x189c('0x10')](_0x189c('0xc'),_0x3da7e1,_0x2efcb0[_0x189c('0x10')][_0x189c('0x12')]);return _0x703a22(_0x2efcb0[_0x189c('0x10')][_0x189c('0x12')]);}logger[_0x189c('0x10')]('License,\x20%s,\x20%s',_0x3da7e1,_0x2efcb0['error'][_0x189c('0x12')]);return _0x498642(_0x2efcb0['error'][_0x189c('0x12')]);}else{logger[_0x189c('0xb')](_0x189c('0xc'),_0x3da7e1,'request\x20sent');_0x498642(_0x2efcb0[_0x189c('0x13')]['message']);}})[_0x189c('0x14')](function(_0x38f3d7){logger[_0x189c('0x10')](_0x189c('0xc'),_0x3da7e1,_0x38f3d7);_0x703a22(_0x38f3d7);});});} \ No newline at end of file +var _0xfb93=['debug','License,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x4277b0,_0x2b2cf6){var _0x57c93f=function(_0xadf08b){while(--_0xadf08b){_0x4277b0['push'](_0x4277b0['shift']());}};_0x57c93f(++_0x2b2cf6);}(_0xfb93,0x92));var _0x3fb9=function(_0x30626b,_0x41b7ef){_0x30626b=_0x30626b-0x0;var _0x254440=_0xfb93[_0x30626b];return _0x254440;};'use strict';var _=require('lodash');var util=require(_0x3fb9('0x0'));var moment=require('moment');var BPromise=require(_0x3fb9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fb9('0x2'));var db=require(_0x3fb9('0x3'))['db'];var utils=require(_0x3fb9('0x4'));var logger=require('../../config/logger')(_0x3fb9('0x5'));var config=require('../../config/environment');var jayson=require(_0x3fb9('0x6'));var client=jayson[_0x3fb9('0x7')][_0x3fb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f1d17,_0xe39245,_0x210836){return new BPromise(function(_0xd3771e,_0x5e145c){return client[_0x3fb9('0x9')](_0x1f1d17,_0x210836)[_0x3fb9('0xa')](function(_0x3bdab9){logger[_0x3fb9('0xb')](_0x3fb9('0xc'),_0xe39245,_0x3fb9('0xd'));logger[_0x3fb9('0xe')](_0x3fb9('0xf'),_0xe39245,'request\x20sent',JSON['stringify'](_0x3bdab9));if(_0x3bdab9[_0x3fb9('0x10')]){if(_0x3bdab9['error']['code']===0x1f4){logger[_0x3fb9('0x10')](_0x3fb9('0xc'),_0xe39245,_0x3bdab9[_0x3fb9('0x10')][_0x3fb9('0x11')]);return _0x5e145c(_0x3bdab9[_0x3fb9('0x10')]['message']);}logger[_0x3fb9('0x10')](_0x3fb9('0xc'),_0xe39245,_0x3bdab9[_0x3fb9('0x10')][_0x3fb9('0x11')]);return _0xd3771e(_0x3bdab9[_0x3fb9('0x10')]['message']);}else{logger[_0x3fb9('0xb')](_0x3fb9('0xc'),_0xe39245,'request\x20sent');_0xd3771e(_0x3bdab9[_0x3fb9('0x12')][_0x3fb9('0x11')]);}})[_0x3fb9('0x13')](function(_0x5013f0){logger[_0x3fb9('0x10')](_0x3fb9('0xc'),_0xe39245,_0x5013f0);_0x5e145c(_0x5013f0);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 4952d9a..82465ac 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 _0x954f=['/:id/users','post','/:id/dispositions','addDisposition','addAnswer','create','/:id/in_servers','addImap','addSmtp','addInteraction','/:id/send','send','addAgents','removeAnswers','removeImap','delete','removeSmtp','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x954f,0x1ba));var _0xf954=function(_0x2c3a22,_0x1324da){_0x2c3a22=_0x2c3a22-0x0;var _0x4a09c2=_0x954f[_0x2c3a22];return _0x4a09c2;};'use strict';var multer=require(_0xf954('0x0'));var util=require(_0xf954('0x1'));var path=require(_0xf954('0x2'));var timeout=require(_0xf954('0x3'));var express=require('express');var router=express[_0xf954('0x4')]();var fs_extra=require(_0xf954('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf954('0x6'));var config=require(_0xf954('0x7'));var controller=require(_0xf954('0x8'));router['get']('/',auth[_0xf954('0x9')](),controller[_0xf954('0xa')]);router[_0xf954('0xb')](_0xf954('0xc'),auth[_0xf954('0x9')](),controller[_0xf954('0xd')]);router[_0xf954('0xb')](_0xf954('0xe'),auth[_0xf954('0x9')](),controller['show']);router[_0xf954('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xf954('0xb')](_0xf954('0xf'),auth[_0xf954('0x9')](),controller[_0xf954('0x10')]);router[_0xf954('0xb')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xf954('0x11')]);router['get'](_0xf954('0x12'),auth[_0xf954('0x9')](),controller[_0xf954('0x13')]);router[_0xf954('0xb')](_0xf954('0x14'),auth[_0xf954('0x9')](),controller[_0xf954('0x15')]);router[_0xf954('0xb')](_0xf954('0x16'),auth[_0xf954('0x9')](),controller[_0xf954('0x17')]);router[_0xf954('0xb')](_0xf954('0x18'),auth[_0xf954('0x9')](),controller[_0xf954('0x19')]);router[_0xf954('0xb')](_0xf954('0x1a'),auth[_0xf954('0x9')](),controller[_0xf954('0x1b')]);router[_0xf954('0xb')](_0xf954('0x1c'),auth['isAuthenticated'](),controller['getAgents']);router[_0xf954('0x1d')](_0xf954('0x1e'),auth[_0xf954('0x9')](),controller[_0xf954('0x1f')]);router['post'](_0xf954('0xf'),auth['isAuthenticated'](),controller[_0xf954('0x20')]);router[_0xf954('0x1d')]('/',auth[_0xf954('0x9')](),controller[_0xf954('0x21')]);router[_0xf954('0x1d')](_0xf954('0x22'),auth[_0xf954('0x9')](),controller[_0xf954('0x23')]);router['post']('/:id/out_servers',auth[_0xf954('0x9')](),controller[_0xf954('0x24')]);router[_0xf954('0x1d')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xf954('0x25')]);router[_0xf954('0x1d')](_0xf954('0x16'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0xf954('0x26'),auth['isAuthenticated'](),controller[_0xf954('0x27')]);router[_0xf954('0x1d')](_0xf954('0x1c'),auth['isAuthenticated'](),controller[_0xf954('0x28')]);router['put'](_0xf954('0xe'),auth[_0xf954('0x9')](),controller['update']);router['delete'](_0xf954('0x1e'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0xf954('0xf'),auth[_0xf954('0x9')](),controller[_0xf954('0x29')]);router['delete']('/:id/in_servers',auth['isAuthenticated'](),controller[_0xf954('0x2a')]);router[_0xf954('0x2b')](_0xf954('0x12'),auth[_0xf954('0x9')](),controller[_0xf954('0x2c')]);router[_0xf954('0x2b')](_0xf954('0xe'),auth[_0xf954('0x9')](),controller['destroy']);router[_0xf954('0x2b')]('/:id/users',auth[_0xf954('0x9')](),controller[_0xf954('0x2d')]);module[_0xf954('0x2e')]=router; \ No newline at end of file +var _0xf726=['/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents','post','/:id/canned_answers','addImap','addSmtp','addApplications','/:id/send','send','addAgents','update','delete','removeDispositions','removeSmtp','/:id','destroy','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/:id/dispositions','/:id/in_servers','getImap'];(function(_0x9bcc0b,_0x120f6c){var _0x195399=function(_0x5be8b9){while(--_0x5be8b9){_0x9bcc0b['push'](_0x9bcc0b['shift']());}};_0x195399(++_0x120f6c);}(_0xf726,0x18b));var _0x6f72=function(_0x18295a,_0x234b39){_0x18295a=_0x18295a-0x0;var _0x3b30de=_0xf726[_0x18295a];return _0x3b30de;};'use strict';var multer=require(_0x6f72('0x0'));var util=require(_0x6f72('0x1'));var path=require('path');var timeout=require(_0x6f72('0x2'));var express=require(_0x6f72('0x3'));var router=express[_0x6f72('0x4')]();var fs_extra=require(_0x6f72('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6f72('0x6'));var config=require(_0x6f72('0x7'));var controller=require(_0x6f72('0x8'));router[_0x6f72('0x9')]('/',auth[_0x6f72('0xa')](),controller[_0x6f72('0xb')]);router[_0x6f72('0x9')]('/describe',auth[_0x6f72('0xa')](),controller['describe']);router[_0x6f72('0x9')]('/:id',auth[_0x6f72('0xa')](),controller['show']);router[_0x6f72('0x9')](_0x6f72('0xc'),auth[_0x6f72('0xa')](),controller['getDispositions']);router[_0x6f72('0x9')]('/:id/canned_answers',auth[_0x6f72('0xa')](),controller['getAnswers']);router[_0x6f72('0x9')](_0x6f72('0xd'),auth[_0x6f72('0xa')](),controller[_0x6f72('0xe')]);router['get'](_0x6f72('0xf'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x10')]);router[_0x6f72('0x9')](_0x6f72('0x11'),auth['isAuthenticated'](),controller[_0x6f72('0x12')]);router[_0x6f72('0x9')](_0x6f72('0x13'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x14')]);router[_0x6f72('0x9')](_0x6f72('0x15'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x16')]);router[_0x6f72('0x9')](_0x6f72('0x17'),auth[_0x6f72('0xa')](),controller['verifySmtp']);router[_0x6f72('0x9')](_0x6f72('0x18'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x19')]);router[_0x6f72('0x1a')]('/:id/dispositions',auth[_0x6f72('0xa')](),controller['addDisposition']);router[_0x6f72('0x1a')](_0x6f72('0x1b'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/',auth[_0x6f72('0xa')](),controller['create']);router[_0x6f72('0x1a')](_0x6f72('0xd'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x1c')]);router[_0x6f72('0x1a')](_0x6f72('0xf'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x1d')]);router['post'](_0x6f72('0x11'),auth[_0x6f72('0xa')](),controller['addInteraction']);router[_0x6f72('0x1a')](_0x6f72('0x13'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x1e')]);router[_0x6f72('0x1a')](_0x6f72('0x1f'),auth['isAuthenticated'](),controller[_0x6f72('0x20')]);router['post'](_0x6f72('0x18'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x21')]);router['put']('/:id',auth[_0x6f72('0xa')](),controller[_0x6f72('0x22')]);router[_0x6f72('0x23')](_0x6f72('0xc'),auth['isAuthenticated'](),controller[_0x6f72('0x24')]);router['delete'](_0x6f72('0x1b'),auth[_0x6f72('0xa')](),controller['removeAnswers']);router['delete']('/:id/in_servers',auth[_0x6f72('0xa')](),controller['removeImap']);router[_0x6f72('0x23')](_0x6f72('0xf'),auth['isAuthenticated'](),controller[_0x6f72('0x25')]);router['delete'](_0x6f72('0x26'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x27')]);router[_0x6f72('0x23')](_0x6f72('0x18'),auth[_0x6f72('0xa')](),controller[_0x6f72('0x28')]);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 f2cb42f..3738a25 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 _0x4563=['custom','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','yahoo','getDataValue','provider'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x4563,0x97));var _0x3456=function(_0xf2290f,_0x1a888e){_0xf2290f=_0xf2290f-0x0;var _0xecafbc=_0x4563[_0xf2290f];return _0xecafbc;};'use strict';var Sequelize=require(_0x3456('0x0'));module['exports']={'description':{'type':Sequelize[_0x3456('0x1')]},'name':{'type':Sequelize[_0x3456('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x3456('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x3456('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x3456('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x3456('0x3')]},'markAsUnread':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x3456('0x1')],'allowNull':![],'defaultValue':_0x3456('0x4')},'fontSize':{'type':Sequelize[_0x3456('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x3456('0x3')],'defaultValue':function(){return _0x3456('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3456('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3456('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3456('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xea945a){if(!_0xea945a)this[_0x3456('0x7')](_0x3456('0x8'),null);this[_0x3456('0x7')](_0x3456('0x9'),_0xea945a);}},'provider':{'type':Sequelize['ENUM'](_0x3456('0xa'),'hotmail',_0x3456('0xb'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x3456('0xc')]('provider'))return'custom';return this[_0x3456('0xc')](_0x3456('0xd'));},'set':function(_0x258eb7){if(_0x258eb7===_0x3456('0xe'))_0x258eb7=null;return this[_0x3456('0x7')](_0x3456('0xd'),_0x258eb7);}}}; \ No newline at end of file +var _0x6e8f=['ENUM','gmail','hotmail','yahoo','outlook365','provider','getDataValue','exports','STRING','BOOLEAN','TEXT','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x595bd1,_0xb1e7a){var _0xd0344f=function(_0x5eb2fd){while(--_0x5eb2fd){_0x595bd1['push'](_0x595bd1['shift']());}};_0xd0344f(++_0xb1e7a);}(_0x6e8f,0xeb));var _0xf6e8=function(_0x3e241b,_0x50609b){_0x3e241b=_0x3e241b-0x0;var _0x26ae7b=_0x6e8f[_0x3e241b];return _0x26ae7b;};'use strict';var Sequelize=require('sequelize');module[_0xf6e8('0x0')]={'description':{'type':Sequelize[_0xf6e8('0x1')]},'name':{'type':Sequelize[_0xf6e8('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xf6e8('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf6e8('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xf6e8('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf6e8('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xf6e8('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf6e8('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf6e8('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf6e8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf6e8('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf6e8('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf6e8('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf6e8('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xf6e8('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xf6e8('0x2')],'defaultValue':![],'comment':_0xf6e8('0x8'),'set':function(_0x1c12b6){if(!_0x1c12b6)this[_0xf6e8('0x9')](_0xf6e8('0xa'),null);this[_0xf6e8('0x9')](_0xf6e8('0xb'),_0x1c12b6);}},'provider':{'type':Sequelize[_0xf6e8('0xc')](_0xf6e8('0xd'),_0xf6e8('0xe'),_0xf6e8('0xf'),_0xf6e8('0x10')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0xf6e8('0x11')))return'custom';return this[_0xf6e8('0x12')]('provider');},'set':function(_0x4b403c){if(_0x4b403c==='custom')_0x4b403c=null;return this[_0xf6e8('0x9')](_0xf6e8('0x11'),_0x4b403c);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 982516d..429aed9 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 _0xf215=['params','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','create','getAnswers','removeAnswers','email','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','User','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','priority','finally','getApplications','MailApplication','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','attachments','join','root','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','messageId','attach','out','format','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','bluebird','util','path','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','get','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp-mail.outlook.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Smtp','index','MailServerIn','Imap','MailServerOut','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','MailAccount','includeAll','include','findAll','rows','show','mandatoryDispositionPause','find','body','provider','custom'];(function(_0x40810b,_0x360300){var _0x30a40b=function(_0x56d7fc){while(--_0x56d7fc){_0x40810b['push'](_0x40810b['shift']());}};_0x30a40b(++_0x360300);}(_0xf215,0x11f));var _0x5f21=function(_0x28c870,_0x1bf349){_0x28c870=_0x28c870-0x0;var _0x5e4de6=_0xf215[_0x28c870];return _0x5e4de6;};'use strict';var moment=require('moment');var BPromise=require(_0x5f21('0x0'));var util=require(_0x5f21('0x1'));var path=require(_0x5f21('0x2'));var _=require(_0x5f21('0x3'));var juice=require('juice');var Redis=require(_0x5f21('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x5f21('0x5'))('api');var config=require(_0x5f21('0x6'));var db=require(_0x5f21('0x7'))['db'];config[_0x5f21('0x8')]=_[_0x5f21('0x9')](config[_0x5f21('0x8')],{'host':_0x5f21('0xa'),'port':0x18eb});var socket=require(_0x5f21('0xb'))(new Redis(config[_0x5f21('0x8')]));require('./mailAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x5f21('0xc')][_0x5f21('0xd')]({'port':0x232b});function respondWithRpcPromise(_0x24a3ed,_0x3ab009,_0x21edae,_0x33adf2){return new BPromise(function(_0x3c90c6,_0xaa72f){var _0x2d6532=_0x33adf2||client;return _0x2d6532[_0x5f21('0xe')](_0x24a3ed,_0x21edae)[_0x5f21('0xf')](function(_0xaea8c6){logger[_0x5f21('0x10')](_0x5f21('0x11'),_0x3ab009,_0x5f21('0x12'));logger[_0x5f21('0x13')](_0x5f21('0x14'),_0x3ab009,_0x5f21('0x12'),JSON[_0x5f21('0x15')](_0xaea8c6));if(_0xaea8c6['error']){if(_0xaea8c6[_0x5f21('0x16')][_0x5f21('0x17')]===0x1f4){logger[_0x5f21('0x16')]('MailAccount,\x20%s,\x20%s',_0x3ab009,_0xaea8c6[_0x5f21('0x16')]['message']);return _0xaa72f(_0xaea8c6['error'][_0x5f21('0x18')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x3ab009,_0xaea8c6[_0x5f21('0x16')][_0x5f21('0x18')]);return _0x3c90c6(_0xaea8c6[_0x5f21('0x16')][_0x5f21('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x3ab009,'request\x20sent');_0x3c90c6(_0xaea8c6[_0x5f21('0x19')]['message']);}})[_0x5f21('0x1a')](function(_0x482b79){logger[_0x5f21('0x16')](_0x5f21('0x11'),_0x3ab009,_0x482b79);_0xaa72f(_0x482b79);});});}function respondWithStatusCode(_0x8f9a5f,_0x3fe0b8){_0x3fe0b8=_0x3fe0b8||0xcc;return function(_0xbc2e57){if(_0xbc2e57){return _0x8f9a5f[_0x5f21('0x1b')](_0x3fe0b8);}return _0x8f9a5f['status'](_0x3fe0b8)[_0x5f21('0x1c')]();};}function respondWithResult(_0x563e43,_0x29b8de){_0x29b8de=_0x29b8de||0xc8;return function(_0x583792){if(_0x583792){return _0x563e43[_0x5f21('0x1d')](_0x29b8de)[_0x5f21('0x1e')](_0x583792);}};}function respondWithFilteredResult(_0x86917d,_0x269b1c){return function(_0x39fe65){if(_0x39fe65){var _0x3897a8=typeof _0x269b1c[_0x5f21('0x1f')]==='undefined'&&typeof _0x269b1c[_0x5f21('0x20')]===_0x5f21('0x21');var _0x17baf9=_0x39fe65[_0x5f21('0x22')];var _0x18f15c=_0x3897a8?0x0:_0x269b1c[_0x5f21('0x1f')];var _0x57f2e2=_0x3897a8?_0x39fe65[_0x5f21('0x22')]:_0x269b1c[_0x5f21('0x1f')]+_0x269b1c[_0x5f21('0x20')];var _0x409d55;if(_0x57f2e2>=_0x17baf9){_0x57f2e2=_0x17baf9;_0x409d55=0xc8;}else{_0x409d55=0xce;}_0x86917d[_0x5f21('0x1d')](_0x409d55);return _0x86917d[_0x5f21('0x23')](_0x5f21('0x24'),_0x18f15c+'-'+_0x57f2e2+'/'+_0x17baf9)[_0x5f21('0x1e')](_0x39fe65);}return null;};}function saveUpdates(_0x5f0e04){return function(_0x2d3183){if(_0x2d3183){return _0x2d3183[_0x5f21('0x25')](_0x5f0e04)['then'](function(_0x341cb9){return _0x341cb9;});}return null;};}function removeEntity(_0xe7eb58){return function(_0x466194){if(_0x466194){return _0x466194['destroy']()[_0x5f21('0xf')](function(){var _0x51b555=_0x466194[_0x5f21('0x26')]({'plain':!![]});var _0x29117c='MailAccounts';return db[_0x5f21('0x27')][_0x5f21('0x28')]({'where':{'type':_0x29117c,'resourceId':_0x51b555['id']}})[_0x5f21('0xf')](function(){return _0x466194;});})['then'](function(){_0xe7eb58[_0x5f21('0x1d')](0xcc)[_0x5f21('0x1c')]();});}};}function handleEntityNotFound(_0x1c9095){return function(_0xf3046b){if(!_0xf3046b){_0x1c9095[_0x5f21('0x1b')](0x194);}return _0xf3046b;};}function handleError(_0x325cd0,_0x3f607c){_0x3f607c=_0x3f607c||0x1f4;return function(_0x475d7c){logger[_0x5f21('0x16')](_0x475d7c[_0x5f21('0x29')]);if(_0x475d7c[_0x5f21('0x2a')]){delete _0x475d7c[_0x5f21('0x2a')];}_0x325cd0['status'](_0x3f607c)[_0x5f21('0x2b')](_0x475d7c);};}function getImapHost(_0x279937){switch(_0x279937){case _0x5f21('0x2c'):return _0x5f21('0x2d');case'yahoo':return'imap.mail.yahoo.com';case'hotmail':return _0x5f21('0x2e');case _0x5f21('0x2f'):return _0x5f21('0x30');}throw new Error(_0x5f21('0x31'),_0x279937);}function getSmtpHost(_0x9cd45d){switch(_0x9cd45d){case _0x5f21('0x2c'):return _0x5f21('0x32');case _0x5f21('0x33'):return'smtp.mail.yahoo.com';case'hotmail':return _0x5f21('0x34');case _0x5f21('0x2f'):return _0x5f21('0x35');}throw new Error(_0x5f21('0x31'),_0x9cd45d);}function getAuthenticationOptions(_0x70530b,_0x4e5d14){var _0x346113={};var _0x4f6e08={};if(_0x70530b){_0x346113['user']=_0x4f6e08[_0x5f21('0x36')]=_0x4e5d14[_0x5f21('0x37')];_0x346113[_0x5f21('0x38')]=_0x4f6e08[_0x5f21('0x39')]=_0x4e5d14['password'];if(_0x4e5d14[_0x5f21('0x3a')]){_0x346113[_0x5f21('0x3a')]=_0x4f6e08[_0x5f21('0x3a')]=!![];_0x346113[_0x5f21('0x3b')]=_0x4f6e08[_0x5f21('0x3b')]=_0x4e5d14[_0x5f21('0x3b')];_0x346113[_0x5f21('0x38')]=_0x4f6e08[_0x5f21('0x39')]=null;}else{_0x346113['CloudProviderId']=_0x4f6e08[_0x5f21('0x3b')]=null;}_0x346113[_0x5f21('0x3c')]=getImapHost(_0x70530b);_0x346113[_0x5f21('0x3d')]=0x3e1;_0x4f6e08[_0x5f21('0x3c')]=getSmtpHost(_0x70530b);_0x4f6e08['port']=0x24b;_0x4f6e08[_0x5f21('0x3e')]=![];_0x346113[_0x5f21('0x3f')]=_0x4f6e08[_0x5f21('0x3f')]=null;}else{if(_0x4e5d14['authentication']){_0x346113['user']=_0x4f6e08[_0x5f21('0x36')]=_0x4e5d14[_0x5f21('0x37')];_0x346113['password']=_0x4f6e08[_0x5f21('0x39')]=_0x4e5d14[_0x5f21('0x38')];}else{_0x346113[_0x5f21('0x40')]=_0x4f6e08[_0x5f21('0x40')]=![];_0x346113['user']=_0x4f6e08['user']=null;_0x346113[_0x5f21('0x38')]=_0x4f6e08[_0x5f21('0x39')]=null;}_0x346113[_0x5f21('0x3c')]=_0x4e5d14['Imap'][_0x5f21('0x3c')];_0x346113[_0x5f21('0x3d')]=_0x4e5d14['Imap'][_0x5f21('0x3d')];_0x4f6e08[_0x5f21('0x3c')]=_0x4e5d14['Smtp'][_0x5f21('0x3c')];_0x4f6e08[_0x5f21('0x3d')]=_0x4e5d14[_0x5f21('0x41')][_0x5f21('0x3d')];}return{'Imap':_0x346113,'Smtp':_0x4f6e08};}exports[_0x5f21('0x42')]=function(_0xc79339,_0x261d32){var _0x5c7032={'include':[{'model':db[_0x5f21('0x43')],'as':_0x5f21('0x44')},{'model':db[_0x5f21('0x45')],'as':_0x5f21('0x41')},{'model':db[_0x5f21('0x46')],'as':'mandatoryDispositionPause'}]},_0x578163={},_0x31ef36={'count':0x0,'rows':[]};var _0xaf3c13=_[_0x5f21('0x47')](db['MailAccount'][_0x5f21('0x48')],function(_0x1dfbd6){return{'name':_0x1dfbd6[_0x5f21('0x49')],'type':_0x1dfbd6[_0x5f21('0x4a')][_0x5f21('0x4b')]};});_0x578163[_0x5f21('0x4c')]=_[_0x5f21('0x47')](_0xaf3c13,'name');_0x578163[_0x5f21('0x4d')]=_[_0x5f21('0x4e')](_0xc79339[_0x5f21('0x4d')]);_0x578163[_0x5f21('0x4f')]=_[_0x5f21('0x50')](_0x578163[_0x5f21('0x4c')],_0x578163[_0x5f21('0x4d')]);_0x5c7032[_0x5f21('0x51')]=_['intersection'](_0x578163[_0x5f21('0x4c')],qs['fields'](_0xc79339['query'][_0x5f21('0x52')]));_0x5c7032[_0x5f21('0x51')]=_0x5c7032[_0x5f21('0x51')][_0x5f21('0x53')]?_0x5c7032[_0x5f21('0x51')]:_0x578163[_0x5f21('0x4c')];if(!_0xc79339['query'][_0x5f21('0x54')](_0x5f21('0x55'))){_0x5c7032[_0x5f21('0x20')]=qs['limit'](_0xc79339[_0x5f21('0x4d')][_0x5f21('0x20')]);_0x5c7032[_0x5f21('0x1f')]=qs['offset'](_0xc79339[_0x5f21('0x4d')][_0x5f21('0x1f')]);}_0x5c7032[_0x5f21('0x56')]=qs[_0x5f21('0x57')](_0xc79339[_0x5f21('0x4d')]['sort']);_0x5c7032['where']=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0xc79339[_0x5f21('0x4d')],_0x578163[_0x5f21('0x4f')]),_0xaf3c13);if(_0xc79339[_0x5f21('0x4d')][_0x5f21('0x59')]){_0x5c7032[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0x5c7032[_0x5f21('0x5a')],{'$or':_[_0x5f21('0x47')](_0xaf3c13,function(_0x45ca34){if(_0x45ca34[_0x5f21('0x4a')]!==_0x5f21('0x5c')){var _0x3274d2={};_0x3274d2[_0x45ca34['name']]={'$like':'%'+_0xc79339[_0x5f21('0x4d')]['filter']+'%'};return _0x3274d2;}})});}_0x5c7032=_[_0x5f21('0x5b')]({},_0x5c7032,_0xc79339[_0x5f21('0x5d')]);var _0x119d1e={'where':_0x5c7032[_0x5f21('0x5a')]};return db[_0x5f21('0x5e')][_0x5f21('0x22')](_0x119d1e)['then'](function(_0x112a8d){_0x31ef36[_0x5f21('0x22')]=_0x112a8d;if(_0xc79339[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0x5c7032[_0x5f21('0x60')]=[{'all':!![]}];}return db[_0x5f21('0x5e')][_0x5f21('0x61')](_0x5c7032);})[_0x5f21('0xf')](function(_0xea2c30){_0x31ef36[_0x5f21('0x62')]=_0xea2c30;return _0x31ef36;})[_0x5f21('0xf')](respondWithFilteredResult(_0x261d32,_0x5c7032))[_0x5f21('0x1a')](handleError(_0x261d32,null));};exports[_0x5f21('0x63')]=function(_0x541679,_0x144695){var _0x1855a5={'raw':![],'where':{'id':_0x541679['params']['id']},'include':[{'model':db[_0x5f21('0x43')],'as':_0x5f21('0x44')},{'model':db['MailServerOut'],'as':_0x5f21('0x41')},{'model':db[_0x5f21('0x46')],'as':_0x5f21('0x64')}]},_0x29cebc={};_0x29cebc[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x5e')]['rawAttributes']);_0x29cebc['query']=_[_0x5f21('0x4e')](_0x541679['query']);_0x29cebc['filters']=_[_0x5f21('0x50')](_0x29cebc[_0x5f21('0x4c')],_0x29cebc['query']);_0x1855a5[_0x5f21('0x51')]=_[_0x5f21('0x50')](_0x29cebc['model'],qs[_0x5f21('0x52')](_0x541679['query'][_0x5f21('0x52')]));_0x1855a5[_0x5f21('0x51')]=_0x1855a5[_0x5f21('0x51')][_0x5f21('0x53')]?_0x1855a5[_0x5f21('0x51')]:_0x29cebc[_0x5f21('0x4c')];if(_0x541679[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0x1855a5[_0x5f21('0x60')]=[{'all':!![]}];}_0x1855a5=_[_0x5f21('0x5b')]({},_0x1855a5,_0x541679[_0x5f21('0x5d')]);return db[_0x5f21('0x5e')][_0x5f21('0x65')](_0x1855a5)[_0x5f21('0xf')](handleEntityNotFound(_0x144695,null))['then'](respondWithResult(_0x144695,null))[_0x5f21('0x1a')](handleError(_0x144695,null));};exports[_0x5f21('0x25')]=function(_0x1d4634,_0xf649ed){if(_0x1d4634[_0x5f21('0x66')]['id']){delete _0x1d4634[_0x5f21('0x66')]['id'];}var _0x4d8e26=_0x1d4634[_0x5f21('0x66')][_0x5f21('0x67')]===_0x5f21('0x68')?null:_0x1d4634[_0x5f21('0x66')][_0x5f21('0x67')];var _0x4eccdf=_0x1d4634[_0x5f21('0x66')][_0x5f21('0x44')]||{};var _0xed0f40=_0x1d4634[_0x5f21('0x66')]['Smtp']||{};if(_0x4d8e26){_0x4eccdf[_0x5f21('0x3c')]=getImapHost(_0x4d8e26);_0x4eccdf[_0x5f21('0x3d')]=0x3e1;_0xed0f40[_0x5f21('0x3c')]=getSmtpHost(_0x4d8e26);_0xed0f40[_0x5f21('0x3d')]=0x24b;_0xed0f40[_0x5f21('0x3e')]=![];}if(_0xed0f40[_0x5f21('0x3a')]){_0xed0f40[_0x5f21('0x3e')]=![];}else{_0xed0f40[_0x5f21('0x3b')]=null;}if(!_0x4eccdf['modernAuthentication'])_0x4eccdf['CloudProviderId']=null;_0x1d4634['body'][_0x5f21('0x44')]=_0x4eccdf;_0x1d4634['body']['Smtp']=_0xed0f40;return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x1d4634[_0x5f21('0x69')]['id']},'include':[{'model':db[_0x5f21('0x43')],'as':_0x5f21('0x44')},{'model':db[_0x5f21('0x45')],'as':_0x5f21('0x41')},{'model':db[_0x5f21('0x46')],'as':_0x5f21('0x64')}]})[_0x5f21('0xf')](handleEntityNotFound(_0xf649ed,null))['then'](function(_0x59c53f){if(!_0x59c53f)throw new Error(_0x5f21('0x6a'));if(_0x59c53f[_0x5f21('0x3f')])delete _0x1d4634[_0x5f21('0x66')][_0x5f21('0x44')];return _0x59c53f;})['then'](saveUpdates(_0x1d4634[_0x5f21('0x66')],null))['then'](function(_0x580728){if(!_0x1d4634[_0x5f21('0x66')][_0x5f21('0x44')])return _0x580728;return db['MailServerIn'][_0x5f21('0x25')](_0x1d4634['body'][_0x5f21('0x44')],{'where':{'MailAccountId':_0x580728['id']}})[_0x5f21('0xf')](function(){return _0x580728;});})[_0x5f21('0xf')](function(_0x14f088){if(!_0x1d4634['body'][_0x5f21('0x41')])return _0x14f088;return db['MailServerOut'][_0x5f21('0x25')](_0x1d4634[_0x5f21('0x66')][_0x5f21('0x41')],{'where':{'MailAccountId':_0x14f088['id']}})[_0x5f21('0xf')](function(){return _0x14f088;});})[_0x5f21('0xf')](respondWithResult(_0xf649ed,null))[_0x5f21('0x1a')](handleError(_0xf649ed,null));};exports[_0x5f21('0x6b')]=function(_0x3331c6,_0x35d7d4){return db['MailAccount']['describe']()['then'](respondWithResult(_0x35d7d4,null))[_0x5f21('0x1a')](handleError(_0x35d7d4,null));};exports['addDisposition']=function(_0x4ef038,_0x175aaf){if(_0x4ef038[_0x5f21('0x66')]['id']){delete _0x4ef038[_0x5f21('0x66')]['id'];}return db['MailAccount'][_0x5f21('0x65')]({'where':{'id':_0x4ef038['params']['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x175aaf,null))[_0x5f21('0xf')](function(_0x3b58cb){if(_0x3b58cb){_0x4ef038[_0x5f21('0x66')][_0x5f21('0x6c')]=_0x3b58cb['id'];return db[_0x5f21('0x6d')]['create'](_0x4ef038[_0x5f21('0x66')]);}})['then'](respondWithResult(_0x175aaf,null))[_0x5f21('0x1a')](handleError(_0x175aaf,null));};exports[_0x5f21('0x6e')]=function(_0x214600,_0x44c4a5){var _0xa6340d={'raw':![],'where':{}};var _0x38a661={};var _0x2be50f={'count':0x0,'rows':[]};return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x214600[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x44c4a5,null))[_0x5f21('0xf')](function(_0x1e00da){if(_0x1e00da){_0x38a661[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x6d')][_0x5f21('0x48')]);_0x38a661[_0x5f21('0x4d')]=_[_0x5f21('0x4e')](_0x214600[_0x5f21('0x4d')]);_0x38a661[_0x5f21('0x4f')]=_[_0x5f21('0x50')](_0x38a661[_0x5f21('0x4c')],_0x38a661[_0x5f21('0x4d')]);_0xa6340d[_0x5f21('0x51')]=_[_0x5f21('0x50')](_0x38a661[_0x5f21('0x4c')],qs[_0x5f21('0x52')](_0x214600[_0x5f21('0x4d')][_0x5f21('0x52')]));_0xa6340d['attributes']=_0xa6340d[_0x5f21('0x51')]['length']?_0xa6340d['attributes']:_0x38a661[_0x5f21('0x4c')];if(!_0x214600[_0x5f21('0x4d')]['hasOwnProperty'](_0x5f21('0x55'))){_0xa6340d['limit']=qs[_0x5f21('0x20')](_0x214600[_0x5f21('0x4d')]['limit']);_0xa6340d[_0x5f21('0x1f')]=qs[_0x5f21('0x1f')](_0x214600['query'][_0x5f21('0x1f')]);}_0xa6340d['order']=qs[_0x5f21('0x57')](_0x214600[_0x5f21('0x4d')][_0x5f21('0x57')]);_0xa6340d['where']=qs['filters'](_[_0x5f21('0x58')](_0x214600[_0x5f21('0x4d')],_0x38a661['filters']));_0xa6340d[_0x5f21('0x5a')]['MailAccountId']=_0x1e00da['id'];if(_0x214600[_0x5f21('0x4d')][_0x5f21('0x59')]){_0xa6340d[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0xa6340d[_0x5f21('0x5a')],{'$or':_['map'](_0xa6340d[_0x5f21('0x51')],function(_0x5130c3){var _0x45743d={};_0x45743d[_0x5130c3]={'$like':'%'+_0x214600['query'][_0x5f21('0x59')]+'%'};return _0x45743d;})});}_0xa6340d=_[_0x5f21('0x5b')]({},_0xa6340d,_0x214600[_0x5f21('0x5d')]);return db[_0x5f21('0x6d')][_0x5f21('0x22')]({'where':_0xa6340d[_0x5f21('0x5a')]})[_0x5f21('0xf')](function(_0x164aae){_0x2be50f[_0x5f21('0x22')]=_0x164aae;if(_0x214600[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0xa6340d[_0x5f21('0x60')]=[{'all':!![]}];}return db[_0x5f21('0x6d')]['findAll'](_0xa6340d);})[_0x5f21('0xf')](function(_0x3042dd){_0x2be50f['rows']=_0x3042dd;return _0x2be50f;});}})[_0x5f21('0xf')](respondWithFilteredResult(_0x44c4a5,_0xa6340d))['catch'](handleError(_0x44c4a5,null));};exports[_0x5f21('0x70')]=function(_0x5de53c,_0x148f04){return db[_0x5f21('0x5e')]['find']({'where':{'id':_0x5de53c[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x148f04,null))[_0x5f21('0xf')](function(_0x3a3e29){if(_0x3a3e29){return _0x3a3e29[_0x5f21('0x70')](_0x5de53c[_0x5f21('0x4d')][_0x5f21('0x71')]);}})[_0x5f21('0xf')](respondWithStatusCode(_0x148f04,null))['catch'](handleError(_0x148f04,null));};exports[_0x5f21('0x72')]=function(_0x4c2403,_0x498858){if(_0x4c2403['body']['id']){delete _0x4c2403[_0x5f21('0x66')]['id'];}return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x4c2403[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x498858,null))[_0x5f21('0xf')](function(_0x4e2e4c){if(_0x4e2e4c){_0x4c2403[_0x5f21('0x66')][_0x5f21('0x6c')]=_0x4e2e4c['id'];return db[_0x5f21('0x73')][_0x5f21('0x74')](_0x4c2403[_0x5f21('0x66')]);}})[_0x5f21('0xf')](respondWithResult(_0x498858,null))['catch'](handleError(_0x498858,null));};exports[_0x5f21('0x75')]=function(_0x1557d5,_0x12da87){var _0x32ed3b={'raw':![],'where':{}};var _0x49a2f8={};var _0x1fda57={'count':0x0,'rows':[]};return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x1557d5[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x12da87,null))[_0x5f21('0xf')](function(_0xb62185){if(_0xb62185){_0x49a2f8[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x73')][_0x5f21('0x48')]);_0x49a2f8['query']=_[_0x5f21('0x4e')](_0x1557d5[_0x5f21('0x4d')]);_0x49a2f8[_0x5f21('0x4f')]=_['intersection'](_0x49a2f8[_0x5f21('0x4c')],_0x49a2f8[_0x5f21('0x4d')]);_0x32ed3b['attributes']=_[_0x5f21('0x50')](_0x49a2f8[_0x5f21('0x4c')],qs[_0x5f21('0x52')](_0x1557d5[_0x5f21('0x4d')]['fields']));_0x32ed3b[_0x5f21('0x51')]=_0x32ed3b['attributes']['length']?_0x32ed3b['attributes']:_0x49a2f8[_0x5f21('0x4c')];if(!_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x54')](_0x5f21('0x55'))){_0x32ed3b[_0x5f21('0x20')]=qs[_0x5f21('0x20')](_0x1557d5['query'][_0x5f21('0x20')]);_0x32ed3b['offset']=qs['offset'](_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x1f')]);}_0x32ed3b[_0x5f21('0x56')]=qs['sort'](_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x57')]);_0x32ed3b[_0x5f21('0x5a')]=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0x1557d5[_0x5f21('0x4d')],_0x49a2f8[_0x5f21('0x4f')]));_0x32ed3b[_0x5f21('0x5a')][_0x5f21('0x6c')]=_0xb62185['id'];if(_0x1557d5[_0x5f21('0x4d')]['filter']){_0x32ed3b[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0x32ed3b['where'],{'$or':_['map'](_0x32ed3b[_0x5f21('0x51')],function(_0x4d64e4){var _0x1a04bd={};_0x1a04bd[_0x4d64e4]={'$like':'%'+_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x59')]+'%'};return _0x1a04bd;})});}_0x32ed3b=_[_0x5f21('0x5b')]({},_0x32ed3b,_0x1557d5[_0x5f21('0x5d')]);return db[_0x5f21('0x73')][_0x5f21('0x22')]({'where':_0x32ed3b['where']})['then'](function(_0x4fdbf1){_0x1fda57[_0x5f21('0x22')]=_0x4fdbf1;if(_0x1557d5[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0x32ed3b[_0x5f21('0x60')]=[{'all':!![]}];}return db[_0x5f21('0x73')][_0x5f21('0x61')](_0x32ed3b);})[_0x5f21('0xf')](function(_0x412af2){_0x1fda57[_0x5f21('0x62')]=_0x412af2;return _0x1fda57;});}})['then'](respondWithFilteredResult(_0x12da87,_0x32ed3b))[_0x5f21('0x1a')](handleError(_0x12da87,null));};exports['removeAnswers']=function(_0x279189,_0x12dbb5){return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x279189['params']['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x12dbb5,null))[_0x5f21('0xf')](function(_0x3d56cb){if(_0x3d56cb){return _0x3d56cb[_0x5f21('0x76')](_0x279189['query'][_0x5f21('0x71')]);}})[_0x5f21('0xf')](respondWithStatusCode(_0x12dbb5,null))['catch'](handleError(_0x12dbb5,null));};exports[_0x5f21('0x74')]=function(_0x57471e,_0x5ea8a8){var _0x907c56={'name':_0x57471e[_0x5f21('0x66')]['name'],'key':_0x57471e[_0x5f21('0x66')]['key'],'provider':_0x57471e[_0x5f21('0x66')][_0x5f21('0x67')]==='custom'?null:_0x57471e[_0x5f21('0x66')][_0x5f21('0x67')],'email':_0x57471e['body'][_0x5f21('0x77')],'ListId':_0x57471e[_0x5f21('0x66')][_0x5f21('0x78')],'active':!_[_0x5f21('0x79')](_0x57471e[_0x5f21('0x66')][_0x5f21('0x7a')])?_0x57471e['body'][_0x5f21('0x7a')]:!![],'description':_0x57471e[_0x5f21('0x66')]['description']||null};var _0x55d3fb=getAuthenticationOptions(_0x907c56[_0x5f21('0x67')],_0x57471e['body']);_0x907c56['Imap']=_0x55d3fb[_0x5f21('0x44')];_0x907c56[_0x5f21('0x41')]=_0x55d3fb[_0x5f21('0x41')];return db[_0x5f21('0x5e')][_0x5f21('0x74')](_0x907c56,{'include':[{'model':db['MailServerOut'],'as':_0x5f21('0x41')},{'model':db[_0x5f21('0x43')],'as':_0x5f21('0x44')}]})[_0x5f21('0xf')](function(_0x485b5f){var _0x15bcd8=_0x57471e[_0x5f21('0x36')]['get']({'plain':!![]});if(!_0x15bcd8)throw new Error(_0x5f21('0x7b'));if(_0x15bcd8[_0x5f21('0x7c')]===_0x5f21('0x36')){var _0x5a9d31=_0x485b5f['get']({'plain':!![]});return db[_0x5f21('0x7d')][_0x5f21('0x65')]({'where':{'name':_0x5f21('0x7e'),'userProfileId':_0x15bcd8[_0x5f21('0x7f')]},'raw':!![]})['then'](function(_0x306dad){if(_0x306dad&&_0x306dad[_0x5f21('0x80')]===0x0){return db['UserProfileResource'][_0x5f21('0x74')]({'name':_0x5a9d31['name'],'resourceId':_0x5a9d31['id'],'type':_0x306dad[_0x5f21('0x2a')],'sectionId':_0x306dad['id']},{})[_0x5f21('0xf')](function(){return _0x485b5f;});}else{return _0x485b5f;}})[_0x5f21('0x1a')](function(_0x4093ff){logger[_0x5f21('0x16')](_0x5f21('0x81'),_0x4093ff);throw _0x4093ff;});}return _0x485b5f;})[_0x5f21('0xf')](respondWithResult(_0x5ea8a8,0xc9))[_0x5f21('0x1a')](handleError(_0x5ea8a8,null));};exports[_0x5f21('0x82')]=function(_0x19421b,_0x19bd74){return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x19421b[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x19bd74,null))['then'](function(_0x2415ad){if(_0x2415ad){return _0x2415ad[_0x5f21('0x82')]();}return null;})[_0x5f21('0xf')](respondWithResult(_0x19bd74,null))[_0x5f21('0x1a')](handleError(_0x19bd74,null));};exports[_0x5f21('0x83')]=function(_0x3bc3a1,_0x4be71e){if(_0x3bc3a1[_0x5f21('0x66')]['id']){delete _0x3bc3a1['body']['id'];}return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x3bc3a1[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x4be71e,null))[_0x5f21('0xf')](function(_0x22b1b6){if(_0x22b1b6){_0x3bc3a1[_0x5f21('0x66')][_0x5f21('0x6c')]=_0x22b1b6['id'];return db[_0x5f21('0x43')]['create'](_0x3bc3a1[_0x5f21('0x66')]);}})['then'](respondWithResult(_0x4be71e,null))[_0x5f21('0x1a')](handleError(_0x4be71e,null));};exports[_0x5f21('0x84')]=function(_0x1f705d,_0x35c577){return db[_0x5f21('0x5e')]['findOne']({'where':{'id':_0x1f705d[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x35c577,null))[_0x5f21('0xf')](function(_0x298835){if(_0x298835){return _0x298835['setImap'](null);}return null;})[_0x5f21('0xf')](respondWithStatusCode(_0x35c577,null))[_0x5f21('0x1a')](handleError(_0x35c577,null));};exports[_0x5f21('0x85')]=function(_0x581227,_0x5342b2){return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x581227[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x5342b2,null))[_0x5f21('0xf')](function(_0x66f23a){if(_0x66f23a){return _0x66f23a['getSmtp']();}return null;})[_0x5f21('0xf')](respondWithResult(_0x5342b2,null))[_0x5f21('0x1a')](handleError(_0x5342b2,null));};exports[_0x5f21('0x86')]=function(_0x487dae,_0x4dad0a){if(_0x487dae[_0x5f21('0x66')]['id']){delete _0x487dae['body']['id'];}return db[_0x5f21('0x5e')]['find']({'where':{'id':_0x487dae[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x4dad0a,null))[_0x5f21('0xf')](function(_0x40ecaf){if(_0x40ecaf){_0x487dae['body'][_0x5f21('0x6c')]=_0x40ecaf['id'];return db[_0x5f21('0x45')]['create'](_0x487dae[_0x5f21('0x66')]);}})[_0x5f21('0xf')](respondWithResult(_0x4dad0a,null))['catch'](handleError(_0x4dad0a,null));};exports[_0x5f21('0x87')]=function(_0x258d1d,_0x2888cb){return db[_0x5f21('0x5e')]['findOne']({'where':{'id':_0x258d1d[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x2888cb,null))[_0x5f21('0xf')](function(_0x576a97){if(_0x576a97){return _0x576a97[_0x5f21('0x88')](null);}return null;})['then'](respondWithStatusCode(_0x2888cb,null))[_0x5f21('0x1a')](handleError(_0x2888cb,null));};exports[_0x5f21('0x89')]=function(_0x2c7461,_0x2feb18){return db[_0x5f21('0x8a')]['find']({'where':{'id':_0x2c7461[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x2feb18,null))[_0x5f21('0xf')](function(_0x5277a1){if(_0x5277a1){return _0x5277a1[_0x5f21('0x89')](_0x2c7461[_0x5f21('0x66')][_0x5f21('0x71')],_['omit'](_0x2c7461[_0x5f21('0x66')],[_0x5f21('0x71'),'id'])||{});}})['then'](respondWithResult(_0x2feb18,null))[_0x5f21('0x1a')](handleError(_0x2feb18,null));};exports[_0x5f21('0x8b')]=function(_0x5b5e64,_0xf9519b){var _0x3ee841={'raw':![],'where':{}};var _0x1e5fcc={};var _0x500ff9={'count':0x0,'rows':[]};return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0x5b5e64['params']['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0xf9519b,null))['then'](function(_0x339e49){if(_0x339e49){_0x1e5fcc[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x8a')][_0x5f21('0x48')]);_0x1e5fcc[_0x5f21('0x4d')]=_[_0x5f21('0x4e')](_0x5b5e64[_0x5f21('0x4d')]);_0x1e5fcc['filters']=_[_0x5f21('0x50')](_0x1e5fcc[_0x5f21('0x4c')],_0x1e5fcc[_0x5f21('0x4d')]);_0x3ee841['attributes']=_[_0x5f21('0x50')](_0x1e5fcc[_0x5f21('0x4c')],qs[_0x5f21('0x52')](_0x5b5e64[_0x5f21('0x4d')]['fields']));_0x3ee841[_0x5f21('0x51')]=_0x3ee841[_0x5f21('0x51')][_0x5f21('0x53')]?_0x3ee841[_0x5f21('0x51')]:_0x1e5fcc['model'];if(!_0x5b5e64['query']['hasOwnProperty'](_0x5f21('0x55'))){_0x3ee841[_0x5f21('0x20')]=qs['limit'](_0x5b5e64['query'][_0x5f21('0x20')]);_0x3ee841[_0x5f21('0x1f')]=qs['offset'](_0x5b5e64[_0x5f21('0x4d')][_0x5f21('0x1f')]);}_0x3ee841['order']=qs[_0x5f21('0x57')](_0x5b5e64[_0x5f21('0x4d')][_0x5f21('0x57')]);_0x3ee841[_0x5f21('0x5a')]=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0x5b5e64[_0x5f21('0x4d')],_0x1e5fcc['filters']));_0x3ee841[_0x5f21('0x5a')][_0x5f21('0x6c')]=_0x339e49['id'];if(_0x5b5e64[_0x5f21('0x4d')]['filter']){_0x3ee841['where']=_['merge'](_0x3ee841[_0x5f21('0x5a')],{'$or':_['map'](_0x3ee841[_0x5f21('0x51')],function(_0x4188d8){var _0xc633ac={};_0xc633ac[_0x4188d8]={'$like':'%'+_0x5b5e64['query']['filter']+'%'};return _0xc633ac;})});}_0x3ee841=_[_0x5f21('0x5b')]({},_0x3ee841,_0x5b5e64[_0x5f21('0x5d')]);return db[_0x5f21('0x8a')][_0x5f21('0x22')]({'where':_0x3ee841[_0x5f21('0x5a')]})[_0x5f21('0xf')](function(_0x16ea86){_0x500ff9[_0x5f21('0x22')]=_0x16ea86;if(_0x5b5e64[_0x5f21('0x4d')][_0x5f21('0x5f')]){_0x3ee841['include']=[{'model':db[_0x5f21('0x8c')],'as':_0x5f21('0x8d'),'required':![]},{'model':db[_0x5f21('0x8e')],'as':'Owner','attributes':['name','fullname',_0x5f21('0x8f')],'required':![]},{'model':db[_0x5f21('0x90')],'as':_0x5f21('0x91'),'attributes':['id',_0x5f21('0x2a'),_0x5f21('0x92')],'where':_0x5b5e64[_0x5f21('0x4d')]['tag']?{'id':_0x5b5e64[_0x5f21('0x4d')][_0x5f21('0x93')]}:undefined,'required':_0x5b5e64['query'][_0x5f21('0x93')]?!![]:![]}];}return db[_0x5f21('0x8a')]['findAll'](_0x3ee841);})['then'](function(_0x2528b9){_0x500ff9[_0x5f21('0x62')]=_0x2528b9;return _0x500ff9;});}})[_0x5f21('0xf')](respondWithFilteredResult(_0xf9519b,_0x3ee841))[_0x5f21('0x1a')](handleError(_0xf9519b,null));};exports[_0x5f21('0x94')]=function addApplications(_0x1e6361,_0x4e361c){var _0x3e8ccf=_0x1e6361[_0x5f21('0x69')]['id'];var _0x14eeec=_0x1e6361[_0x5f21('0x66')];var _0x8549fb=0xc8;var _0x41b6e2=null;return db[_0x5f21('0x95')][_0x5f21('0x96')]({'isolationLevel':db['sequelize'][_0x5f21('0x97')]['ISOLATION_LEVELS'][_0x5f21('0x98')]},function(_0x3150d5){return db['MailAccount'][_0x5f21('0x6f')]({'where':{'id':_0x3e8ccf},'transaction':_0x3150d5})[_0x5f21('0xf')](function(_0x254350){if(_0x254350){return db['MailApplication'][_0x5f21('0x28')]({'where':{'MailAccountId':_0x3e8ccf},'transaction':_0x3150d5})[_0x5f21('0xf')](function(){var _0x1fdcc4=_[_0x5f21('0x47')](_0x14eeec,function(_0x3b2e0b){_0x3b2e0b['MailAccountId']=_0x3e8ccf;return _0x3b2e0b;});return db['MailApplication'][_0x5f21('0x99')](_0x1fdcc4,{'transaction':_0x3150d5});});}else{_0x8549fb=0x194;_0x41b6e2=[];}});})[_0x5f21('0xf')](function(){if(_0x8549fb!==0x194){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x3e8ccf},'order':_0x5f21('0x9a')})[_0x5f21('0xf')](function(_0x58f0cf){_0x41b6e2=_0x58f0cf;});}})[_0x5f21('0x1a')](function(_0x364ad4){_0x8549fb=0x1f4;logger[_0x5f21('0x16')](_0x364ad4[_0x5f21('0x29')]);if(_0x364ad4['name']){delete _0x364ad4[_0x5f21('0x2a')];}_0x41b6e2=_0x364ad4;})[_0x5f21('0x9b')](function(){if(_0x41b6e2===null){_0x4e361c[_0x5f21('0x1b')](_0x8549fb);}else{if(_0x8549fb===0x1f4){_0x4e361c[_0x5f21('0x1d')](_0x8549fb)[_0x5f21('0x2b')](_0x41b6e2);}else{_0x4e361c['status'](_0x8549fb)[_0x5f21('0x1e')](_0x41b6e2);}}});};exports[_0x5f21('0x9c')]=function(_0x1a58b2,_0x264851){var _0x10f695={};var _0x327087={};var _0x10c273;var _0x53ddfb;return db[_0x5f21('0x5e')]['findOne']({'where':{'id':_0x1a58b2['params']['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x264851,null))['then'](function(_0x3770ff){if(_0x3770ff){_0x10c273=_0x3770ff;_0x327087[_0x5f21('0x4c')]=_[_0x5f21('0x4e')](db[_0x5f21('0x9d')][_0x5f21('0x48')]);_0x327087[_0x5f21('0x4d')]=_['keys'](_0x1a58b2[_0x5f21('0x4d')]);_0x327087[_0x5f21('0x4f')]=_[_0x5f21('0x50')](_0x327087[_0x5f21('0x4c')],_0x327087[_0x5f21('0x4d')]);_0x10f695['attributes']=_[_0x5f21('0x50')](_0x327087[_0x5f21('0x4c')],qs['fields'](_0x1a58b2['query']['fields']));_0x10f695[_0x5f21('0x51')]=_0x10f695[_0x5f21('0x51')][_0x5f21('0x53')]?_0x10f695[_0x5f21('0x51')]:_0x327087['model'];_0x10f695['order']=qs[_0x5f21('0x57')](_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x57')]);_0x10f695['where']=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0x1a58b2[_0x5f21('0x4d')],_0x327087[_0x5f21('0x4f')]));if(_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x59')]){_0x10f695[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0x10f695[_0x5f21('0x5a')],{'$or':_[_0x5f21('0x47')](_0x10f695[_0x5f21('0x51')],function(_0x22e4b3){var _0x5133b9={};_0x5133b9[_0x22e4b3]={'$like':'%'+_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x59')]+'%'};return _0x5133b9;})});}_0x10f695=_['merge']({},_0x10f695,_0x1a58b2[_0x5f21('0x5d')]);return _0x10c273[_0x5f21('0x9c')](_0x10f695);}})[_0x5f21('0xf')](function(_0x9516de){if(_0x9516de){_0x53ddfb=_0x9516de[_0x5f21('0x53')];if(!_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x54')](_0x5f21('0x55'))){_0x10f695[_0x5f21('0x20')]=qs[_0x5f21('0x20')](_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x20')]);_0x10f695['offset']=qs[_0x5f21('0x1f')](_0x1a58b2[_0x5f21('0x4d')][_0x5f21('0x1f')]);}return _0x10c273[_0x5f21('0x9c')](_0x10f695);}})['then'](function(_0x10c921){if(_0x10c921){return _0x10c921?{'count':_0x53ddfb,'rows':_0x10c921}:null;}})['then'](respondWithResult(_0x264851,null))[_0x5f21('0x1a')](handleError(_0x264851,null));};exports['getMessages']=function(_0xaca345,_0x2b7474){var _0x7e6331={'raw':!![],'where':{}};var _0x24dd9f={};var _0x44a189={'count':0x0,'rows':[]};return db[_0x5f21('0x5e')][_0x5f21('0x6f')]({'where':{'id':_0xaca345[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x2b7474,null))[_0x5f21('0xf')](function(_0x47ea7c){if(_0x47ea7c){_0x24dd9f['model']=_[_0x5f21('0x4e')](db[_0x5f21('0x9e')][_0x5f21('0x48')]);_0x24dd9f[_0x5f21('0x4d')]=_[_0x5f21('0x4e')](_0xaca345['query']);_0x24dd9f[_0x5f21('0x4f')]=_['intersection'](_0x24dd9f[_0x5f21('0x4c')],_0x24dd9f[_0x5f21('0x4d')]);_0x7e6331[_0x5f21('0x51')]=_[_0x5f21('0x50')](_0x24dd9f['model'],qs[_0x5f21('0x52')](_0xaca345[_0x5f21('0x4d')][_0x5f21('0x52')]));_0x7e6331[_0x5f21('0x51')]=_0x7e6331[_0x5f21('0x51')][_0x5f21('0x53')]?_0x7e6331[_0x5f21('0x51')]:_0x24dd9f[_0x5f21('0x4c')];if(!_0xaca345[_0x5f21('0x4d')]['hasOwnProperty']('nolimit')){_0x7e6331[_0x5f21('0x20')]=qs[_0x5f21('0x20')](_0xaca345[_0x5f21('0x4d')][_0x5f21('0x20')]);_0x7e6331[_0x5f21('0x1f')]=qs[_0x5f21('0x1f')](_0xaca345[_0x5f21('0x4d')][_0x5f21('0x1f')]);}_0x7e6331['order']=qs[_0x5f21('0x57')](_0xaca345['query'][_0x5f21('0x57')]);_0x7e6331[_0x5f21('0x5a')]=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0xaca345[_0x5f21('0x4d')],_0x24dd9f[_0x5f21('0x4f')]));_0x7e6331[_0x5f21('0x5a')]['MailAccountId']=_0x47ea7c['id'];if(_0xaca345[_0x5f21('0x4d')][_0x5f21('0x59')]){_0x7e6331[_0x5f21('0x5a')]=_[_0x5f21('0x5b')](_0x7e6331[_0x5f21('0x5a')],{'$or':_[_0x5f21('0x47')](_0x7e6331[_0x5f21('0x51')],function(_0x45c474){var _0x335811={};_0x335811[_0x45c474]={'$like':'%'+_0xaca345[_0x5f21('0x4d')][_0x5f21('0x59')]+'%'};return _0x335811;})});}if(_0xaca345[_0x5f21('0x4d')][_0x5f21('0x9f')]){var _0x561bf5=_0xaca345['query'][_0x5f21('0x9f')][_0x5f21('0xa0')](',');var _0x3915dc={};_0x3915dc[_0x561bf5[0x0]]={'$gte':moment(_0x561bf5[0x1])['format'](_0x5f21('0xa1'))};_0x7e6331['where']=_[_0x5f21('0x5b')](_0x7e6331[_0x5f21('0x5a')],_0x3915dc);}_0x7e6331=_['merge']({},_0x7e6331,_0xaca345['options']);return db[_0x5f21('0x9e')][_0x5f21('0x22')]({'where':_0x7e6331[_0x5f21('0x5a')]})[_0x5f21('0xf')](function(_0x1fb774){_0x44a189['count']=_0x1fb774;if(_0xaca345[_0x5f21('0x4d')]['includeAll']){_0x7e6331[_0x5f21('0x60')]=[{'all':!![]}];}return db[_0x5f21('0x9e')]['findAll'](_0x7e6331);})[_0x5f21('0xf')](function(_0x546a09){if(_0xaca345[_0x5f21('0x4d')]['inlineCss']===_0x5f21('0xa2')){for(var _0x14034e=0x0;_0x14034e<_0x546a09['length'];_0x14034e++){_0x546a09[_0x14034e][_0x5f21('0x66')]=juice(_0x546a09[_0x14034e][_0x5f21('0x66')]);}}_0x44a189['rows']=_0x546a09;return _0x44a189;});}})[_0x5f21('0xf')](respondWithFilteredResult(_0x2b7474,_0x7e6331))[_0x5f21('0x1a')](handleError(_0x2b7474,null));};exports['send']=function(_0x14e47f,_0x11b963){var _0xda825e,_0x30b8c8={},_0x23401b;if(_0x14e47f[_0x5f21('0x66')]['to']){_0x23401b=_0x14e47f[_0x5f21('0x66')]['to'][_0x5f21('0xa0')](',')[0x0];}return db[_0x5f21('0x5e')]['find']({'where':{'id':_0x14e47f['params']['id']},'include':[{'model':db[_0x5f21('0xa3')],'as':_0x5f21('0xa4'),'include':[{'model':db['CmContact'],'as':_0x5f21('0xa5'),'where':{'email':_0x23401b},'limit':0x1,'order':[[_0x5f21('0xa6'),_0x5f21('0xa7')]]}]},{'model':db['MailServerOut'],'as':_0x5f21('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5f21('0xa8'),'raw':!![]}]}]})[_0x5f21('0xf')](handleEntityNotFound(_0x11b963,null))[_0x5f21('0xf')](function(_0x23752f){if(!_0x23752f)return;_0xda825e=_0x23752f;if(!_0x23752f['Smtp'])throw new Error(_0x5f21('0xa9'));if(_[_0x5f21('0x79')](_0x14e47f[_0x5f21('0x66')]['from'])){_0x14e47f['body'][_0x5f21('0xaa')]=util['format']('%s\x20<%s>',_0x23752f['name'],_0x23752f[_0x5f21('0x77')]||_0x23752f['Smtp'][_0x5f21('0x36')]);}if(_0x14e47f[_0x5f21('0x66')][_0x5f21('0xab')]&&_0x14e47f[_0x5f21('0x66')]['attachments'][_0x5f21('0x53')]){for(var _0x5c7d5=0x0;_0x5c7d5<_0x14e47f[_0x5f21('0x66')]['attachments']['length'];_0x5c7d5+=0x1){_0x14e47f[_0x5f21('0x66')][_0x5f21('0xab')][_0x5c7d5]={'filename':_0x14e47f[_0x5f21('0x66')][_0x5f21('0xab')][_0x5c7d5][_0x5f21('0x2a')],'path':path[_0x5f21('0xac')](config[_0x5f21('0xad')],'server/files/attachments',_0x14e47f['body']['attachments'][_0x5c7d5]['basename'])};}}var _0x11424a=_0x23752f[_0x5f21('0xae')]();return respondWithRpcPromise(_0x5f21('0xaf'),_0x5f21('0xb0'),{'account':_0x11424a,'message':_0x14e47f['body']});})['then'](function(_0x203a97){if(!_0x203a97)return;_0x30b8c8=_0x203a97;if(!_0xda825e[_0x5f21('0xa4')])throw new Error(_0x5f21('0xb1'));if(_0xda825e[_0x5f21('0xa4')][_0x5f21('0xa5')]['length'])return _0xda825e['List']['Contacts'][0x0];return db[_0x5f21('0x8c')][_0x5f21('0x74')](_['defaults'](_0x14e47f[_0x5f21('0x66')],{'firstName':_0x14e47f['body']['to'],'email':_0x14e47f['body']['to'],'phone':_0x14e47f['body']['to'],'ListId':_0xda825e[_0x5f21('0x78')]}));})[_0x5f21('0xf')](function(_0xa1fb55){if(!_0xa1fb55)return;var _0x3c9773={'UserId':_0x14e47f[_0x5f21('0x36')]['id'],'ContactId':_0xa1fb55['id'],'MailAccountId':_0xda825e['id'],'inReplyTo':_0x30b8c8[_0x5f21('0xb2')],'to':_0x14e47f[_0x5f21('0x66')][_0x5f21('0xaa')],'cc':_0x14e47f[_0x5f21('0x66')]['cc'],'subject':_0x14e47f[_0x5f21('0x66')]['subject'],'attach':_0x14e47f['body'][_0x5f21('0xb3')],'firstMsgDirection':_0x5f21('0xb4'),'lastMsgAt':moment()[_0x5f21('0xb5')](_0x5f21('0xa1')),'lastMsgDirection':_0x5f21('0xb4'),'Messages':[_[_0x5f21('0x5b')](_0x14e47f[_0x5f21('0x66')],{'messageId':_0x30b8c8['messageId'],'sentAt':moment()[_0x5f21('0xb5')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0xda825e['id'],'UserId':_0x14e47f[_0x5f21('0x36')]['id'],'ContactId':_0xa1fb55['id']})]};if(_0x14e47f[_0x5f21('0x66')][_0x5f21('0xb6')]){_0x3c9773=_[_0x5f21('0x5b')](_0x3c9773,_0x14e47f[_0x5f21('0x66')][_0x5f21('0xb6')]);}return db['MailInteraction'][_0x5f21('0x74')](_0x3c9773,{'include':[{'model':db[_0x5f21('0x9e')],'as':_0x5f21('0xb7')}]});})['then'](respondWithResult(_0x11b963,null))['catch'](handleError(_0x11b963,null));};exports[_0x5f21('0xb8')]=function(_0x3f3fb4,_0x1fb670){return db[_0x5f21('0x5e')]['find']({'where':{'id':_0x3f3fb4[_0x5f21('0x69')]['id']},'include':[{'model':db[_0x5f21('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5f21('0xa8')],'as':_0x5f21('0xa8'),'raw':!![]}]}]})[_0x5f21('0xf')](handleEntityNotFound(_0x1fb670,null))[_0x5f21('0xf')](function(_0x51da24){if(!_0x51da24[_0x5f21('0x41')])return;var _0x3a92df=_0x51da24[_0x5f21('0xae')]();return respondWithRpcPromise(_0x5f21('0xb9'),_0x5f21('0xb8'),{'account':_0x3a92df});})[_0x5f21('0xf')](respondWithResult(_0x1fb670,null))[_0x5f21('0x1a')](handleError(_0x1fb670,null));};exports['destroy']=function(_0x483a71,_0x18f317){return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x483a71[_0x5f21('0x69')]['id']}})['then'](handleEntityNotFound(_0x18f317,null))[_0x5f21('0xf')](function(_0x5e0f38){if(_0x5e0f38&&_0x5e0f38['service']){throw new db[(_0x5f21('0xba'))][(_0x5f21('0xbb'))](_0x5f21('0xbc'));}return _0x5e0f38;})[_0x5f21('0xf')](removeEntity(_0x18f317,null))[_0x5f21('0x1a')](handleError(_0x18f317,null));};exports[_0x5f21('0xbd')]=function(_0x42849c,_0x4e7ddb){return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x42849c[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x4e7ddb,null))[_0x5f21('0xf')](function(_0x14d4ae){if(_0x14d4ae){return _0x14d4ae[_0x5f21('0xbd')](_0x42849c[_0x5f21('0x66')][_0x5f21('0x71')],_['omit'](_0x42849c[_0x5f21('0x66')],[_0x5f21('0x71'),'id'])||{})[_0x5f21('0xbe')](function(_0x6e3a7c){for(var _0x507e1d=0x0;_0x507e1d<_0x42849c['body'][_0x5f21('0x71')][_0x5f21('0x53')];_0x507e1d+=0x1){socket['emit'](_0x5f21('0xbf'),{'UserId':Number(_0x42849c[_0x5f21('0x66')][_0x5f21('0x71')][_0x507e1d]),'MailAccountId':Number(_0x42849c[_0x5f21('0x69')]['id'])});}return _0x6e3a7c;});}})[_0x5f21('0xf')](respondWithResult(_0x4e7ddb,null))[_0x5f21('0x1a')](handleError(_0x4e7ddb,null));};exports[_0x5f21('0xc0')]=function(_0x28dab3,_0x2c90d1){return db[_0x5f21('0x5e')][_0x5f21('0x65')]({'where':{'id':_0x28dab3[_0x5f21('0x69')]['id']}})[_0x5f21('0xf')](handleEntityNotFound(_0x2c90d1,null))[_0x5f21('0xf')](function(_0x4e91ad){if(_0x4e91ad){return _0x4e91ad[_0x5f21('0xc0')](_0x28dab3[_0x5f21('0x4d')][_0x5f21('0x71')])['then'](function(){if(_['isArray'](_0x28dab3[_0x5f21('0x4d')]['ids'])){for(var _0x4ba63c=0x0;_0x4ba63c<_0x28dab3[_0x5f21('0x4d')][_0x5f21('0x71')][_0x5f21('0x53')];_0x4ba63c+=0x1){socket[_0x5f21('0xc1')](_0x5f21('0xc2'),{'UserId':Number(_0x28dab3[_0x5f21('0x4d')][_0x5f21('0x71')][_0x4ba63c]),'MailAccountId':Number(_0x28dab3[_0x5f21('0x69')]['id'])});}}else{socket[_0x5f21('0xc1')]('userMailAccount:remove',{'UserId':Number(_0x28dab3[_0x5f21('0x4d')][_0x5f21('0x71')]),'MailAccountId':Number(_0x28dab3[_0x5f21('0x69')]['id'])});}});}})[_0x5f21('0xf')](respondWithStatusCode(_0x2c90d1,null))[_0x5f21('0x1a')](handleError(_0x2c90d1,null));};exports[_0x5f21('0xc3')]=function(_0x1fd850,_0x36ca1b){var _0x152e13={};var _0x57e23a={};var _0x43dc2d;var _0x1340a4;return db[_0x5f21('0x5e')]['findOne']({'where':{'id':_0x1fd850['params']['id']}})['then'](handleEntityNotFound(_0x36ca1b,null))[_0x5f21('0xf')](function(_0x3a2fcb){if(_0x3a2fcb){_0x43dc2d=_0x3a2fcb;_0x57e23a[_0x5f21('0x4c')]=_['keys'](db[_0x5f21('0x8e')][_0x5f21('0x48')]);_0x57e23a[_0x5f21('0x4d')]=_['keys'](_0x1fd850[_0x5f21('0x4d')]);_0x57e23a[_0x5f21('0x4f')]=_[_0x5f21('0x50')](_0x57e23a[_0x5f21('0x4c')],_0x57e23a['query']);_0x152e13['attributes']=_[_0x5f21('0x50')](_0x57e23a[_0x5f21('0x4c')],qs[_0x5f21('0x52')](_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x52')]));_0x152e13[_0x5f21('0x51')]=_0x152e13[_0x5f21('0x51')][_0x5f21('0x53')]?_0x152e13[_0x5f21('0x51')]:_0x57e23a['model'];_0x152e13['order']=qs[_0x5f21('0x57')](_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x57')]);_0x152e13[_0x5f21('0x5a')]=qs[_0x5f21('0x4f')](_[_0x5f21('0x58')](_0x1fd850[_0x5f21('0x4d')],_0x57e23a[_0x5f21('0x4f')]));if(_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x59')]){_0x152e13[_0x5f21('0x5a')]=_['merge'](_0x152e13[_0x5f21('0x5a')],{'$or':_[_0x5f21('0x47')](_0x152e13[_0x5f21('0x51')],function(_0x5f195f){var _0x3043aa={};_0x3043aa[_0x5f195f]={'$like':'%'+_0x1fd850[_0x5f21('0x4d')]['filter']+'%'};return _0x3043aa;})});}_0x152e13=_[_0x5f21('0x5b')]({},_0x152e13,_0x1fd850['options']);return _0x43dc2d['getAgents'](_0x152e13);}})[_0x5f21('0xf')](function(_0x563c03){if(_0x563c03){_0x1340a4=_0x563c03[_0x5f21('0x53')];if(!_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x54')]('nolimit')){_0x152e13[_0x5f21('0x20')]=qs[_0x5f21('0x20')](_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x20')]);_0x152e13[_0x5f21('0x1f')]=qs[_0x5f21('0x1f')](_0x1fd850[_0x5f21('0x4d')][_0x5f21('0x1f')]);}return _0x43dc2d['getAgents'](_0x152e13);}})[_0x5f21('0xf')](function(_0x301c18){if(_0x301c18){return _0x301c18?{'count':_0x1340a4,'rows':_0x301c18}:null;}})[_0x5f21('0xf')](respondWithResult(_0x36ca1b,null))[_0x5f21('0x1a')](handleError(_0x36ca1b,null));}; \ No newline at end of file +var _0x36e3=['juice','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','end','offset','undefined','limit','count','status','set','json','destroy','get','UserProfileResource','sendStatus','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','user','username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerIn','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','Pause','intersection','options','update','body','provider','custom','find','MailServerOut','Mail\x20Account\x20not\x20found','describe','MailAccountId','create','getDispositions','Disposition','nolimit','order','removeDispositions','CannedAnswer','getAnswers','findOne','include','removeAnswers','email','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','addInteraction','ids','omit','getInteractions','MailInteraction','CmContact','User','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','join','root','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','out','format','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','getAgents','moment','bluebird','util','path','lodash'];(function(_0x3fb030,_0x12aebe){var _0xd6899b=function(_0x327646){while(--_0x327646){_0x3fb030['push'](_0x3fb030['shift']());}};_0xd6899b(++_0x12aebe);}(_0x36e3,0xbd));var _0x336e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x36e3[_0x37bd26];return _0xe83dc4;};'use strict';var moment=require(_0x336e('0x0'));var BPromise=require(_0x336e('0x1'));var util=require(_0x336e('0x2'));var path=require(_0x336e('0x3'));var _=require(_0x336e('0x4'));var juice=require(_0x336e('0x5'));var Redis=require(_0x336e('0x6'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x336e('0x7'));var config=require(_0x336e('0x8'));var db=require(_0x336e('0x9'))['db'];config[_0x336e('0xa')]=_[_0x336e('0xb')](config[_0x336e('0xa')],{'host':_0x336e('0xc'),'port':0x18eb});var socket=require(_0x336e('0xd'))(new Redis(config[_0x336e('0xa')]));require(_0x336e('0xe'))['register'](socket);var jayson=require(_0x336e('0xf'));var client=jayson[_0x336e('0x10')][_0x336e('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x55a0ef,_0xe6daaf,_0x2fd858,_0x51aed5){return new BPromise(function(_0x2def46,_0x14e49f){var _0x316193=_0x51aed5||client;return _0x316193[_0x336e('0x12')](_0x55a0ef,_0x2fd858)[_0x336e('0x13')](function(_0x25904a){logger[_0x336e('0x14')](_0x336e('0x15'),_0xe6daaf,'request\x20sent');logger[_0x336e('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xe6daaf,_0x336e('0x17'),JSON[_0x336e('0x18')](_0x25904a));if(_0x25904a[_0x336e('0x19')]){if(_0x25904a['error'][_0x336e('0x1a')]===0x1f4){logger[_0x336e('0x19')](_0x336e('0x15'),_0xe6daaf,_0x25904a[_0x336e('0x19')][_0x336e('0x1b')]);return _0x14e49f(_0x25904a[_0x336e('0x19')][_0x336e('0x1b')]);}logger[_0x336e('0x19')](_0x336e('0x15'),_0xe6daaf,_0x25904a[_0x336e('0x19')][_0x336e('0x1b')]);return _0x2def46(_0x25904a[_0x336e('0x19')][_0x336e('0x1b')]);}else{logger[_0x336e('0x14')](_0x336e('0x15'),_0xe6daaf,_0x336e('0x17'));_0x2def46(_0x25904a['result'][_0x336e('0x1b')]);}})[_0x336e('0x1c')](function(_0x415fcc){logger['error']('MailAccount,\x20%s,\x20%s',_0xe6daaf,_0x415fcc);_0x14e49f(_0x415fcc);});});}function respondWithStatusCode(_0x3ea600,_0x3a17c9){_0x3a17c9=_0x3a17c9||0xcc;return function(_0x523b39){if(_0x523b39){return _0x3ea600['sendStatus'](_0x3a17c9);}return _0x3ea600['status'](_0x3a17c9)[_0x336e('0x1d')]();};}function respondWithResult(_0x579aae,_0x43d515){_0x43d515=_0x43d515||0xc8;return function(_0x5e84b9){if(_0x5e84b9){return _0x579aae['status'](_0x43d515)['json'](_0x5e84b9);}};}function respondWithFilteredResult(_0x552975,_0x5b2c84){return function(_0xb4af9f){if(_0xb4af9f){var _0x4a362e=typeof _0x5b2c84[_0x336e('0x1e')]===_0x336e('0x1f')&&typeof _0x5b2c84[_0x336e('0x20')]===_0x336e('0x1f');var _0x460a06=_0xb4af9f[_0x336e('0x21')];var _0x57095e=_0x4a362e?0x0:_0x5b2c84[_0x336e('0x1e')];var _0x4ca749=_0x4a362e?_0xb4af9f[_0x336e('0x21')]:_0x5b2c84[_0x336e('0x1e')]+_0x5b2c84['limit'];var _0x401b57;if(_0x4ca749>=_0x460a06){_0x4ca749=_0x460a06;_0x401b57=0xc8;}else{_0x401b57=0xce;}_0x552975[_0x336e('0x22')](_0x401b57);return _0x552975[_0x336e('0x23')]('Content-Range',_0x57095e+'-'+_0x4ca749+'/'+_0x460a06)[_0x336e('0x24')](_0xb4af9f);}return null;};}function saveUpdates(_0xd7ca44){return function(_0x38c97b){if(_0x38c97b){return _0x38c97b['update'](_0xd7ca44)['then'](function(_0x1f881f){return _0x1f881f;});}return null;};}function removeEntity(_0x51d1e1){return function(_0x5eb4c2){if(_0x5eb4c2){return _0x5eb4c2[_0x336e('0x25')]()['then'](function(){var _0x503085=_0x5eb4c2[_0x336e('0x26')]({'plain':!![]});var _0x4126ec='MailAccounts';return db[_0x336e('0x27')]['destroy']({'where':{'type':_0x4126ec,'resourceId':_0x503085['id']}})[_0x336e('0x13')](function(){return _0x5eb4c2;});})[_0x336e('0x13')](function(){_0x51d1e1[_0x336e('0x22')](0xcc)[_0x336e('0x1d')]();});}};}function handleEntityNotFound(_0x359292){return function(_0xe44011){if(!_0xe44011){_0x359292[_0x336e('0x28')](0x194);}return _0xe44011;};}function handleError(_0x452136,_0x369f59){_0x369f59=_0x369f59||0x1f4;return function(_0x4c735d){logger['error'](_0x4c735d[_0x336e('0x29')]);if(_0x4c735d[_0x336e('0x2a')]){delete _0x4c735d[_0x336e('0x2a')];}_0x452136[_0x336e('0x22')](_0x369f59)[_0x336e('0x2b')](_0x4c735d);};}function getImapHost(_0x49ec2e){switch(_0x49ec2e){case _0x336e('0x2c'):return _0x336e('0x2d');case _0x336e('0x2e'):return _0x336e('0x2f');case'hotmail':return'imap-mail.outlook.com';case _0x336e('0x30'):return _0x336e('0x31');}throw new Error(_0x336e('0x32'),_0x49ec2e);}function getSmtpHost(_0x546dcf){switch(_0x546dcf){case'gmail':return _0x336e('0x33');case _0x336e('0x2e'):return _0x336e('0x34');case _0x336e('0x35'):return _0x336e('0x36');case _0x336e('0x30'):return'smtp.office365.com';}throw new Error(_0x336e('0x32'),_0x546dcf);}function getAuthenticationOptions(_0x3e5e13,_0x458546){var _0x1acbc1={};var _0x133515={};if(_0x3e5e13){_0x1acbc1[_0x336e('0x37')]=_0x133515[_0x336e('0x37')]=_0x458546[_0x336e('0x38')];_0x1acbc1[_0x336e('0x39')]=_0x133515[_0x336e('0x3a')]=_0x458546[_0x336e('0x39')];if(_0x458546[_0x336e('0x3b')]){_0x1acbc1[_0x336e('0x3b')]=_0x133515['modernAuthentication']=!![];_0x1acbc1['CloudProviderId']=_0x133515['CloudProviderId']=_0x458546['CloudProviderId'];_0x1acbc1[_0x336e('0x39')]=_0x133515[_0x336e('0x3a')]=null;}else{_0x1acbc1[_0x336e('0x3c')]=_0x133515[_0x336e('0x3c')]=null;}_0x1acbc1['host']=getImapHost(_0x3e5e13);_0x1acbc1[_0x336e('0x3d')]=0x3e1;_0x133515[_0x336e('0x3e')]=getSmtpHost(_0x3e5e13);_0x133515[_0x336e('0x3d')]=0x24b;_0x133515[_0x336e('0x3f')]=![];_0x1acbc1[_0x336e('0x40')]=_0x133515[_0x336e('0x40')]=null;}else{if(_0x458546[_0x336e('0x41')]){_0x1acbc1[_0x336e('0x37')]=_0x133515['user']=_0x458546['username'];_0x1acbc1['password']=_0x133515[_0x336e('0x3a')]=_0x458546[_0x336e('0x39')];}else{_0x1acbc1[_0x336e('0x41')]=_0x133515['authentication']=![];_0x1acbc1[_0x336e('0x37')]=_0x133515['user']=null;_0x1acbc1[_0x336e('0x39')]=_0x133515[_0x336e('0x3a')]=null;}_0x1acbc1[_0x336e('0x3e')]=_0x458546[_0x336e('0x42')]['host'];_0x1acbc1[_0x336e('0x3d')]=_0x458546[_0x336e('0x42')]['port'];_0x133515[_0x336e('0x3e')]=_0x458546[_0x336e('0x43')]['host'];_0x133515[_0x336e('0x3d')]=_0x458546[_0x336e('0x43')][_0x336e('0x3d')];}return{'Imap':_0x1acbc1,'Smtp':_0x133515};}exports[_0x336e('0x44')]=function(_0x4b3a3c,_0x685bb){var _0x16b9b2={'include':[{'model':db[_0x336e('0x45')],'as':_0x336e('0x42')},{'model':db['MailServerOut'],'as':_0x336e('0x43')},{'model':db['Pause'],'as':_0x336e('0x46')}]},_0x2e2440={},_0x34196a={'count':0x0,'rows':[]};var _0x42c665=_[_0x336e('0x47')](db[_0x336e('0x48')][_0x336e('0x49')],function(_0x84ca3c){return{'name':_0x84ca3c[_0x336e('0x4a')],'type':_0x84ca3c[_0x336e('0x4b')][_0x336e('0x4c')]};});_0x2e2440[_0x336e('0x4d')]=_[_0x336e('0x47')](_0x42c665,'name');_0x2e2440[_0x336e('0x4e')]=_[_0x336e('0x4f')](_0x4b3a3c[_0x336e('0x4e')]);_0x2e2440[_0x336e('0x50')]=_['intersection'](_0x2e2440[_0x336e('0x4d')],_0x2e2440[_0x336e('0x4e')]);_0x16b9b2['attributes']=_['intersection'](_0x2e2440[_0x336e('0x4d')],qs['fields'](_0x4b3a3c[_0x336e('0x4e')][_0x336e('0x51')]));_0x16b9b2[_0x336e('0x52')]=_0x16b9b2[_0x336e('0x52')][_0x336e('0x53')]?_0x16b9b2[_0x336e('0x52')]:_0x2e2440[_0x336e('0x4d')];if(!_0x4b3a3c[_0x336e('0x4e')][_0x336e('0x54')]('nolimit')){_0x16b9b2['limit']=qs[_0x336e('0x20')](_0x4b3a3c[_0x336e('0x4e')]['limit']);_0x16b9b2['offset']=qs[_0x336e('0x1e')](_0x4b3a3c[_0x336e('0x4e')]['offset']);}_0x16b9b2['order']=qs[_0x336e('0x55')](_0x4b3a3c[_0x336e('0x4e')][_0x336e('0x55')]);_0x16b9b2[_0x336e('0x56')]=qs['filters'](_[_0x336e('0x57')](_0x4b3a3c[_0x336e('0x4e')],_0x2e2440[_0x336e('0x50')]),_0x42c665);if(_0x4b3a3c[_0x336e('0x4e')][_0x336e('0x58')]){_0x16b9b2[_0x336e('0x56')]=_[_0x336e('0x59')](_0x16b9b2['where'],{'$or':_[_0x336e('0x47')](_0x42c665,function(_0x25b23a){if(_0x25b23a['type']!==_0x336e('0x5a')){var _0x67888b={};_0x67888b[_0x25b23a[_0x336e('0x2a')]]={'$like':'%'+_0x4b3a3c[_0x336e('0x4e')][_0x336e('0x58')]+'%'};return _0x67888b;}})});}_0x16b9b2=_[_0x336e('0x59')]({},_0x16b9b2,_0x4b3a3c['options']);var _0x21ff31={'where':_0x16b9b2[_0x336e('0x56')]};return db[_0x336e('0x48')][_0x336e('0x21')](_0x21ff31)[_0x336e('0x13')](function(_0x491a66){_0x34196a[_0x336e('0x21')]=_0x491a66;if(_0x4b3a3c[_0x336e('0x4e')][_0x336e('0x5b')]){_0x16b9b2['include']=[{'all':!![]}];}return db[_0x336e('0x48')][_0x336e('0x5c')](_0x16b9b2);})[_0x336e('0x13')](function(_0x20bacb){_0x34196a[_0x336e('0x5d')]=_0x20bacb;return _0x34196a;})['then'](respondWithFilteredResult(_0x685bb,_0x16b9b2))[_0x336e('0x1c')](handleError(_0x685bb,null));};exports[_0x336e('0x5e')]=function(_0x33c89c,_0xc9988e){var _0x254e5f={'raw':![],'where':{'id':_0x33c89c[_0x336e('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x336e('0x42')},{'model':db['MailServerOut'],'as':_0x336e('0x43')},{'model':db[_0x336e('0x60')],'as':_0x336e('0x46')}]},_0x4cab61={};_0x4cab61[_0x336e('0x4d')]=_['keys'](db[_0x336e('0x48')][_0x336e('0x49')]);_0x4cab61[_0x336e('0x4e')]=_[_0x336e('0x4f')](_0x33c89c[_0x336e('0x4e')]);_0x4cab61['filters']=_[_0x336e('0x61')](_0x4cab61[_0x336e('0x4d')],_0x4cab61[_0x336e('0x4e')]);_0x254e5f[_0x336e('0x52')]=_[_0x336e('0x61')](_0x4cab61[_0x336e('0x4d')],qs[_0x336e('0x51')](_0x33c89c[_0x336e('0x4e')][_0x336e('0x51')]));_0x254e5f[_0x336e('0x52')]=_0x254e5f[_0x336e('0x52')]['length']?_0x254e5f[_0x336e('0x52')]:_0x4cab61['model'];if(_0x33c89c[_0x336e('0x4e')]['includeAll']){_0x254e5f['include']=[{'all':!![]}];}_0x254e5f=_[_0x336e('0x59')]({},_0x254e5f,_0x33c89c[_0x336e('0x62')]);return db[_0x336e('0x48')]['find'](_0x254e5f)[_0x336e('0x13')](handleEntityNotFound(_0xc9988e,null))[_0x336e('0x13')](respondWithResult(_0xc9988e,null))[_0x336e('0x1c')](handleError(_0xc9988e,null));};exports[_0x336e('0x63')]=function(_0x5c03a8,_0x454995){if(_0x5c03a8[_0x336e('0x64')]['id']){delete _0x5c03a8['body']['id'];}var _0x260217=_0x5c03a8[_0x336e('0x64')][_0x336e('0x65')]===_0x336e('0x66')?null:_0x5c03a8[_0x336e('0x64')][_0x336e('0x65')];var _0x40f740=_0x5c03a8[_0x336e('0x64')][_0x336e('0x42')]||{};var _0x58f1f1=_0x5c03a8[_0x336e('0x64')]['Smtp']||{};if(_0x260217){_0x40f740[_0x336e('0x3e')]=getImapHost(_0x260217);_0x40f740[_0x336e('0x3d')]=0x3e1;_0x58f1f1[_0x336e('0x3e')]=getSmtpHost(_0x260217);_0x58f1f1[_0x336e('0x3d')]=0x24b;_0x58f1f1[_0x336e('0x3f')]=![];}if(_0x58f1f1[_0x336e('0x3b')]){_0x58f1f1[_0x336e('0x3f')]=![];}else{_0x58f1f1['CloudProviderId']=null;}if(!_0x40f740[_0x336e('0x3b')])_0x40f740['CloudProviderId']=null;_0x5c03a8[_0x336e('0x64')][_0x336e('0x42')]=_0x40f740;_0x5c03a8[_0x336e('0x64')][_0x336e('0x43')]=_0x58f1f1;return db[_0x336e('0x48')][_0x336e('0x67')]({'where':{'id':_0x5c03a8[_0x336e('0x5f')]['id']},'include':[{'model':db[_0x336e('0x45')],'as':_0x336e('0x42')},{'model':db[_0x336e('0x68')],'as':_0x336e('0x43')},{'model':db[_0x336e('0x60')],'as':'mandatoryDispositionPause'}]})[_0x336e('0x13')](handleEntityNotFound(_0x454995,null))[_0x336e('0x13')](function(_0x1f3813){if(!_0x1f3813)throw new Error(_0x336e('0x69'));if(_0x1f3813['service'])delete _0x5c03a8['body'][_0x336e('0x42')];return _0x1f3813;})[_0x336e('0x13')](saveUpdates(_0x5c03a8[_0x336e('0x64')],null))[_0x336e('0x13')](function(_0x24b3b1){if(!_0x5c03a8[_0x336e('0x64')][_0x336e('0x42')])return _0x24b3b1;return db[_0x336e('0x45')][_0x336e('0x63')](_0x5c03a8[_0x336e('0x64')]['Imap'],{'where':{'MailAccountId':_0x24b3b1['id']}})[_0x336e('0x13')](function(){return _0x24b3b1;});})['then'](function(_0x493c07){if(!_0x5c03a8[_0x336e('0x64')][_0x336e('0x43')])return _0x493c07;return db[_0x336e('0x68')][_0x336e('0x63')](_0x5c03a8[_0x336e('0x64')][_0x336e('0x43')],{'where':{'MailAccountId':_0x493c07['id']}})[_0x336e('0x13')](function(){return _0x493c07;});})[_0x336e('0x13')](respondWithResult(_0x454995,null))[_0x336e('0x1c')](handleError(_0x454995,null));};exports[_0x336e('0x6a')]=function(_0x33ae0e,_0x348925){return db[_0x336e('0x48')]['describe']()[_0x336e('0x13')](respondWithResult(_0x348925,null))[_0x336e('0x1c')](handleError(_0x348925,null));};exports['addDisposition']=function(_0x19cab3,_0x4b53e2){if(_0x19cab3[_0x336e('0x64')]['id']){delete _0x19cab3['body']['id'];}return db['MailAccount'][_0x336e('0x67')]({'where':{'id':_0x19cab3[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x4b53e2,null))[_0x336e('0x13')](function(_0x2044ea){if(_0x2044ea){_0x19cab3['body'][_0x336e('0x6b')]=_0x2044ea['id'];return db['Disposition'][_0x336e('0x6c')](_0x19cab3['body']);}})['then'](respondWithResult(_0x4b53e2,null))['catch'](handleError(_0x4b53e2,null));};exports[_0x336e('0x6d')]=function(_0x22769d,_0xe42642){var _0x3a757c={'raw':![],'where':{}};var _0x22dde6={};var _0x3103fc={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x22769d[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0xe42642,null))[_0x336e('0x13')](function(_0x3ab8cd){if(_0x3ab8cd){_0x22dde6[_0x336e('0x4d')]=_['keys'](db[_0x336e('0x6e')]['rawAttributes']);_0x22dde6[_0x336e('0x4e')]=_[_0x336e('0x4f')](_0x22769d['query']);_0x22dde6[_0x336e('0x50')]=_[_0x336e('0x61')](_0x22dde6[_0x336e('0x4d')],_0x22dde6[_0x336e('0x4e')]);_0x3a757c[_0x336e('0x52')]=_[_0x336e('0x61')](_0x22dde6[_0x336e('0x4d')],qs[_0x336e('0x51')](_0x22769d[_0x336e('0x4e')]['fields']));_0x3a757c[_0x336e('0x52')]=_0x3a757c[_0x336e('0x52')][_0x336e('0x53')]?_0x3a757c[_0x336e('0x52')]:_0x22dde6[_0x336e('0x4d')];if(!_0x22769d[_0x336e('0x4e')]['hasOwnProperty'](_0x336e('0x6f'))){_0x3a757c[_0x336e('0x20')]=qs[_0x336e('0x20')](_0x22769d[_0x336e('0x4e')][_0x336e('0x20')]);_0x3a757c[_0x336e('0x1e')]=qs[_0x336e('0x1e')](_0x22769d['query']['offset']);}_0x3a757c[_0x336e('0x70')]=qs[_0x336e('0x55')](_0x22769d[_0x336e('0x4e')][_0x336e('0x55')]);_0x3a757c[_0x336e('0x56')]=qs['filters'](_[_0x336e('0x57')](_0x22769d[_0x336e('0x4e')],_0x22dde6[_0x336e('0x50')]));_0x3a757c[_0x336e('0x56')][_0x336e('0x6b')]=_0x3ab8cd['id'];if(_0x22769d['query'][_0x336e('0x58')]){_0x3a757c[_0x336e('0x56')]=_[_0x336e('0x59')](_0x3a757c['where'],{'$or':_[_0x336e('0x47')](_0x3a757c[_0x336e('0x52')],function(_0x223774){var _0x1548ff={};_0x1548ff[_0x223774]={'$like':'%'+_0x22769d['query'][_0x336e('0x58')]+'%'};return _0x1548ff;})});}_0x3a757c=_['merge']({},_0x3a757c,_0x22769d[_0x336e('0x62')]);return db[_0x336e('0x6e')][_0x336e('0x21')]({'where':_0x3a757c[_0x336e('0x56')]})['then'](function(_0x132fb8){_0x3103fc['count']=_0x132fb8;if(_0x22769d[_0x336e('0x4e')][_0x336e('0x5b')]){_0x3a757c['include']=[{'all':!![]}];}return db[_0x336e('0x6e')][_0x336e('0x5c')](_0x3a757c);})[_0x336e('0x13')](function(_0x2da25d){_0x3103fc[_0x336e('0x5d')]=_0x2da25d;return _0x3103fc;});}})[_0x336e('0x13')](respondWithFilteredResult(_0xe42642,_0x3a757c))[_0x336e('0x1c')](handleError(_0xe42642,null));};exports[_0x336e('0x71')]=function(_0x12d9d4,_0x2996b4){return db[_0x336e('0x48')][_0x336e('0x67')]({'where':{'id':_0x12d9d4[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x2996b4,null))[_0x336e('0x13')](function(_0x13ae8a){if(_0x13ae8a){return _0x13ae8a[_0x336e('0x71')](_0x12d9d4[_0x336e('0x4e')]['ids']);}})[_0x336e('0x13')](respondWithStatusCode(_0x2996b4,null))[_0x336e('0x1c')](handleError(_0x2996b4,null));};exports['addAnswer']=function(_0xb6b1af,_0x32d97b){if(_0xb6b1af[_0x336e('0x64')]['id']){delete _0xb6b1af[_0x336e('0x64')]['id'];}return db['MailAccount'][_0x336e('0x67')]({'where':{'id':_0xb6b1af[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x32d97b,null))[_0x336e('0x13')](function(_0x4063c9){if(_0x4063c9){_0xb6b1af[_0x336e('0x64')][_0x336e('0x6b')]=_0x4063c9['id'];return db[_0x336e('0x72')]['create'](_0xb6b1af[_0x336e('0x64')]);}})[_0x336e('0x13')](respondWithResult(_0x32d97b,null))[_0x336e('0x1c')](handleError(_0x32d97b,null));};exports[_0x336e('0x73')]=function(_0x3a11af,_0x1ec32d){var _0x901dc3={'raw':![],'where':{}};var _0x2dd341={};var _0x4fb880={'count':0x0,'rows':[]};return db[_0x336e('0x48')][_0x336e('0x74')]({'where':{'id':_0x3a11af[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x1ec32d,null))['then'](function(_0x42c2f1){if(_0x42c2f1){_0x2dd341['model']=_[_0x336e('0x4f')](db[_0x336e('0x72')][_0x336e('0x49')]);_0x2dd341[_0x336e('0x4e')]=_[_0x336e('0x4f')](_0x3a11af[_0x336e('0x4e')]);_0x2dd341[_0x336e('0x50')]=_[_0x336e('0x61')](_0x2dd341[_0x336e('0x4d')],_0x2dd341[_0x336e('0x4e')]);_0x901dc3[_0x336e('0x52')]=_[_0x336e('0x61')](_0x2dd341['model'],qs[_0x336e('0x51')](_0x3a11af['query'][_0x336e('0x51')]));_0x901dc3[_0x336e('0x52')]=_0x901dc3[_0x336e('0x52')][_0x336e('0x53')]?_0x901dc3[_0x336e('0x52')]:_0x2dd341[_0x336e('0x4d')];if(!_0x3a11af[_0x336e('0x4e')]['hasOwnProperty'](_0x336e('0x6f'))){_0x901dc3[_0x336e('0x20')]=qs[_0x336e('0x20')](_0x3a11af[_0x336e('0x4e')]['limit']);_0x901dc3[_0x336e('0x1e')]=qs[_0x336e('0x1e')](_0x3a11af['query'][_0x336e('0x1e')]);}_0x901dc3[_0x336e('0x70')]=qs[_0x336e('0x55')](_0x3a11af[_0x336e('0x4e')][_0x336e('0x55')]);_0x901dc3[_0x336e('0x56')]=qs[_0x336e('0x50')](_['pick'](_0x3a11af[_0x336e('0x4e')],_0x2dd341['filters']));_0x901dc3[_0x336e('0x56')][_0x336e('0x6b')]=_0x42c2f1['id'];if(_0x3a11af[_0x336e('0x4e')][_0x336e('0x58')]){_0x901dc3['where']=_['merge'](_0x901dc3[_0x336e('0x56')],{'$or':_[_0x336e('0x47')](_0x901dc3[_0x336e('0x52')],function(_0x74c582){var _0x570e48={};_0x570e48[_0x74c582]={'$like':'%'+_0x3a11af[_0x336e('0x4e')][_0x336e('0x58')]+'%'};return _0x570e48;})});}_0x901dc3=_['merge']({},_0x901dc3,_0x3a11af[_0x336e('0x62')]);return db[_0x336e('0x72')][_0x336e('0x21')]({'where':_0x901dc3[_0x336e('0x56')]})[_0x336e('0x13')](function(_0x3c67ec){_0x4fb880[_0x336e('0x21')]=_0x3c67ec;if(_0x3a11af[_0x336e('0x4e')][_0x336e('0x5b')]){_0x901dc3[_0x336e('0x75')]=[{'all':!![]}];}return db[_0x336e('0x72')]['findAll'](_0x901dc3);})[_0x336e('0x13')](function(_0x8083ba){_0x4fb880['rows']=_0x8083ba;return _0x4fb880;});}})[_0x336e('0x13')](respondWithFilteredResult(_0x1ec32d,_0x901dc3))[_0x336e('0x1c')](handleError(_0x1ec32d,null));};exports[_0x336e('0x76')]=function(_0x1e3ec0,_0x3a7215){return db[_0x336e('0x48')][_0x336e('0x67')]({'where':{'id':_0x1e3ec0[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x3a7215,null))['then'](function(_0x56a4c0){if(_0x56a4c0){return _0x56a4c0[_0x336e('0x76')](_0x1e3ec0[_0x336e('0x4e')]['ids']);}})[_0x336e('0x13')](respondWithStatusCode(_0x3a7215,null))[_0x336e('0x1c')](handleError(_0x3a7215,null));};exports[_0x336e('0x6c')]=function(_0xc10e1d,_0x2fb4f3){var _0x10e6c4={'name':_0xc10e1d[_0x336e('0x64')][_0x336e('0x2a')],'key':_0xc10e1d[_0x336e('0x64')][_0x336e('0x4c')],'provider':_0xc10e1d[_0x336e('0x64')]['provider']===_0x336e('0x66')?null:_0xc10e1d[_0x336e('0x64')][_0x336e('0x65')],'email':_0xc10e1d[_0x336e('0x64')][_0x336e('0x77')],'ListId':_0xc10e1d[_0x336e('0x64')][_0x336e('0x78')],'active':!_['isNil'](_0xc10e1d[_0x336e('0x64')][_0x336e('0x79')])?_0xc10e1d[_0x336e('0x64')][_0x336e('0x79')]:!![],'description':_0xc10e1d[_0x336e('0x64')][_0x336e('0x7a')]||null};var _0x7b27a=getAuthenticationOptions(_0x10e6c4[_0x336e('0x65')],_0xc10e1d['body']);_0x10e6c4['Imap']=_0x7b27a[_0x336e('0x42')];_0x10e6c4[_0x336e('0x43')]=_0x7b27a[_0x336e('0x43')];return db[_0x336e('0x48')][_0x336e('0x6c')](_0x10e6c4,{'include':[{'model':db[_0x336e('0x68')],'as':_0x336e('0x43')},{'model':db[_0x336e('0x45')],'as':_0x336e('0x42')}]})[_0x336e('0x13')](function(_0x5ca267){var _0x383bc1=_0xc10e1d[_0x336e('0x37')][_0x336e('0x26')]({'plain':!![]});if(!_0x383bc1)throw new Error(_0x336e('0x7b'));if(_0x383bc1['role']===_0x336e('0x37')){var _0x4d326b=_0x5ca267['get']({'plain':!![]});return db[_0x336e('0x7c')]['find']({'where':{'name':_0x336e('0x7d'),'userProfileId':_0x383bc1[_0x336e('0x7e')]},'raw':!![]})[_0x336e('0x13')](function(_0x144a61){if(_0x144a61&&_0x144a61['autoAssociation']===0x0){return db[_0x336e('0x27')]['create']({'name':_0x4d326b[_0x336e('0x2a')],'resourceId':_0x4d326b['id'],'type':_0x144a61[_0x336e('0x2a')],'sectionId':_0x144a61['id']},{})[_0x336e('0x13')](function(){return _0x5ca267;});}else{return _0x5ca267;}})[_0x336e('0x1c')](function(_0x5058ad){logger[_0x336e('0x19')](_0x336e('0x7f'),_0x5058ad);throw _0x5058ad;});}return _0x5ca267;})[_0x336e('0x13')](respondWithResult(_0x2fb4f3,0xc9))[_0x336e('0x1c')](handleError(_0x2fb4f3,null));};exports[_0x336e('0x80')]=function(_0x2238d9,_0x591447){return db['MailAccount'][_0x336e('0x74')]({'where':{'id':_0x2238d9['params']['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x591447,null))['then'](function(_0x45fb1f){if(_0x45fb1f){return _0x45fb1f['getImap']();}return null;})[_0x336e('0x13')](respondWithResult(_0x591447,null))[_0x336e('0x1c')](handleError(_0x591447,null));};exports[_0x336e('0x81')]=function(_0xe263c4,_0x24c336){if(_0xe263c4[_0x336e('0x64')]['id']){delete _0xe263c4['body']['id'];}return db[_0x336e('0x48')][_0x336e('0x67')]({'where':{'id':_0xe263c4[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x24c336,null))[_0x336e('0x13')](function(_0xc579a8){if(_0xc579a8){_0xe263c4['body'][_0x336e('0x6b')]=_0xc579a8['id'];return db['MailServerIn']['create'](_0xe263c4['body']);}})[_0x336e('0x13')](respondWithResult(_0x24c336,null))[_0x336e('0x1c')](handleError(_0x24c336,null));};exports[_0x336e('0x82')]=function(_0x56e269,_0x31e81a){return db['MailAccount'][_0x336e('0x74')]({'where':{'id':_0x56e269['params']['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x31e81a,null))[_0x336e('0x13')](function(_0x3c88a3){if(_0x3c88a3){return _0x3c88a3[_0x336e('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x31e81a,null))['catch'](handleError(_0x31e81a,null));};exports[_0x336e('0x84')]=function(_0x46c30a,_0x205ae2){return db[_0x336e('0x48')][_0x336e('0x74')]({'where':{'id':_0x46c30a[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x205ae2,null))[_0x336e('0x13')](function(_0x30250b){if(_0x30250b){return _0x30250b[_0x336e('0x84')]();}return null;})['then'](respondWithResult(_0x205ae2,null))['catch'](handleError(_0x205ae2,null));};exports[_0x336e('0x85')]=function(_0x450b29,_0x429da7){if(_0x450b29['body']['id']){delete _0x450b29[_0x336e('0x64')]['id'];}return db[_0x336e('0x48')][_0x336e('0x67')]({'where':{'id':_0x450b29[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x429da7,null))[_0x336e('0x13')](function(_0x1ab891){if(_0x1ab891){_0x450b29[_0x336e('0x64')]['MailAccountId']=_0x1ab891['id'];return db[_0x336e('0x68')]['create'](_0x450b29[_0x336e('0x64')]);}})[_0x336e('0x13')](respondWithResult(_0x429da7,null))[_0x336e('0x1c')](handleError(_0x429da7,null));};exports['removeSmtp']=function(_0x528373,_0x342232){return db[_0x336e('0x48')][_0x336e('0x74')]({'where':{'id':_0x528373[_0x336e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x342232,null))['then'](function(_0x364411){if(_0x364411){return _0x364411['setSmtp'](null);}return null;})[_0x336e('0x13')](respondWithStatusCode(_0x342232,null))[_0x336e('0x1c')](handleError(_0x342232,null));};exports[_0x336e('0x86')]=function(_0x41d12a,_0x4ec651){return db['MailInteraction'][_0x336e('0x67')]({'where':{'id':_0x41d12a[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x4ec651,null))[_0x336e('0x13')](function(_0x1abf7d){if(_0x1abf7d){return _0x1abf7d['addInteraction'](_0x41d12a[_0x336e('0x64')][_0x336e('0x87')],_[_0x336e('0x88')](_0x41d12a[_0x336e('0x64')],['ids','id'])||{});}})[_0x336e('0x13')](respondWithResult(_0x4ec651,null))['catch'](handleError(_0x4ec651,null));};exports[_0x336e('0x89')]=function(_0x1d966e,_0x582228){var _0x53a8f5={'raw':![],'where':{}};var _0x184d20={};var _0x2ff9f1={'count':0x0,'rows':[]};return db[_0x336e('0x48')][_0x336e('0x74')]({'where':{'id':_0x1d966e[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x582228,null))[_0x336e('0x13')](function(_0xd92c8e){if(_0xd92c8e){_0x184d20[_0x336e('0x4d')]=_['keys'](db[_0x336e('0x8a')][_0x336e('0x49')]);_0x184d20[_0x336e('0x4e')]=_['keys'](_0x1d966e[_0x336e('0x4e')]);_0x184d20[_0x336e('0x50')]=_['intersection'](_0x184d20[_0x336e('0x4d')],_0x184d20[_0x336e('0x4e')]);_0x53a8f5[_0x336e('0x52')]=_[_0x336e('0x61')](_0x184d20[_0x336e('0x4d')],qs[_0x336e('0x51')](_0x1d966e[_0x336e('0x4e')][_0x336e('0x51')]));_0x53a8f5['attributes']=_0x53a8f5[_0x336e('0x52')][_0x336e('0x53')]?_0x53a8f5['attributes']:_0x184d20[_0x336e('0x4d')];if(!_0x1d966e[_0x336e('0x4e')]['hasOwnProperty'](_0x336e('0x6f'))){_0x53a8f5[_0x336e('0x20')]=qs[_0x336e('0x20')](_0x1d966e[_0x336e('0x4e')]['limit']);_0x53a8f5['offset']=qs[_0x336e('0x1e')](_0x1d966e['query'][_0x336e('0x1e')]);}_0x53a8f5[_0x336e('0x70')]=qs[_0x336e('0x55')](_0x1d966e[_0x336e('0x4e')]['sort']);_0x53a8f5[_0x336e('0x56')]=qs['filters'](_[_0x336e('0x57')](_0x1d966e[_0x336e('0x4e')],_0x184d20[_0x336e('0x50')]));_0x53a8f5[_0x336e('0x56')][_0x336e('0x6b')]=_0xd92c8e['id'];if(_0x1d966e[_0x336e('0x4e')][_0x336e('0x58')]){_0x53a8f5[_0x336e('0x56')]=_[_0x336e('0x59')](_0x53a8f5[_0x336e('0x56')],{'$or':_[_0x336e('0x47')](_0x53a8f5[_0x336e('0x52')],function(_0x4a6e5b){var _0x10cb15={};_0x10cb15[_0x4a6e5b]={'$like':'%'+_0x1d966e[_0x336e('0x4e')][_0x336e('0x58')]+'%'};return _0x10cb15;})});}_0x53a8f5=_[_0x336e('0x59')]({},_0x53a8f5,_0x1d966e['options']);return db[_0x336e('0x8a')][_0x336e('0x21')]({'where':_0x53a8f5[_0x336e('0x56')]})[_0x336e('0x13')](function(_0x23a103){_0x2ff9f1['count']=_0x23a103;if(_0x1d966e[_0x336e('0x4e')]['includeAll']){_0x53a8f5[_0x336e('0x75')]=[{'model':db[_0x336e('0x8b')],'as':'Contact','required':![]},{'model':db[_0x336e('0x8c')],'as':'Owner','attributes':['name',_0x336e('0x8d'),'internal'],'required':![]},{'model':db[_0x336e('0x8e')],'as':_0x336e('0x8f'),'attributes':['id',_0x336e('0x2a'),_0x336e('0x90')],'where':_0x1d966e[_0x336e('0x4e')][_0x336e('0x91')]?{'id':_0x1d966e[_0x336e('0x4e')][_0x336e('0x91')]}:undefined,'required':_0x1d966e[_0x336e('0x4e')][_0x336e('0x91')]?!![]:![]}];}return db[_0x336e('0x8a')][_0x336e('0x5c')](_0x53a8f5);})[_0x336e('0x13')](function(_0x44bbab){_0x2ff9f1[_0x336e('0x5d')]=_0x44bbab;return _0x2ff9f1;});}})[_0x336e('0x13')](respondWithFilteredResult(_0x582228,_0x53a8f5))[_0x336e('0x1c')](handleError(_0x582228,null));};exports[_0x336e('0x92')]=function addApplications(_0x916e5,_0x21625a){var _0x4b78da=_0x916e5[_0x336e('0x5f')]['id'];var _0xbc7b35=_0x916e5[_0x336e('0x64')];var _0x300ee4=0xc8;var _0x43bd2c=null;return db[_0x336e('0x93')][_0x336e('0x94')]({'isolationLevel':db[_0x336e('0x93')][_0x336e('0x95')]['ISOLATION_LEVELS'][_0x336e('0x96')]},function(_0x343999){return db[_0x336e('0x48')]['findOne']({'where':{'id':_0x4b78da},'transaction':_0x343999})[_0x336e('0x13')](function(_0x301843){if(_0x301843){return db[_0x336e('0x97')][_0x336e('0x25')]({'where':{'MailAccountId':_0x4b78da},'transaction':_0x343999})['then'](function(){var _0x4e8424=_['map'](_0xbc7b35,function(_0x348741){_0x348741[_0x336e('0x6b')]=_0x4b78da;return _0x348741;});return db[_0x336e('0x97')][_0x336e('0x98')](_0x4e8424,{'transaction':_0x343999});});}else{_0x300ee4=0x194;_0x43bd2c=[];}});})[_0x336e('0x13')](function(){if(_0x300ee4!==0x194){return db[_0x336e('0x97')][_0x336e('0x99')]({'where':{'MailAccountId':_0x4b78da},'order':_0x336e('0x9a')})[_0x336e('0x13')](function(_0x36fe01){_0x43bd2c=_0x36fe01;});}})[_0x336e('0x1c')](function(_0x345e97){_0x300ee4=0x1f4;logger[_0x336e('0x19')](_0x345e97[_0x336e('0x29')]);if(_0x345e97[_0x336e('0x2a')]){delete _0x345e97[_0x336e('0x2a')];}_0x43bd2c=_0x345e97;})['finally'](function(){if(_0x43bd2c===null){_0x21625a[_0x336e('0x28')](_0x300ee4);}else{if(_0x300ee4===0x1f4){_0x21625a['status'](_0x300ee4)[_0x336e('0x2b')](_0x43bd2c);}else{_0x21625a[_0x336e('0x22')](_0x300ee4)['json'](_0x43bd2c);}}});};exports['getApplications']=function(_0x5bd63b,_0x114e63){var _0x8d2874={};var _0x53cabf={};var _0x20ffc3;var _0x40bdac;return db[_0x336e('0x48')][_0x336e('0x74')]({'where':{'id':_0x5bd63b[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x114e63,null))['then'](function(_0x4275e2){if(_0x4275e2){_0x20ffc3=_0x4275e2;_0x53cabf[_0x336e('0x4d')]=_[_0x336e('0x4f')](db[_0x336e('0x97')][_0x336e('0x49')]);_0x53cabf['query']=_[_0x336e('0x4f')](_0x5bd63b[_0x336e('0x4e')]);_0x53cabf['filters']=_[_0x336e('0x61')](_0x53cabf[_0x336e('0x4d')],_0x53cabf[_0x336e('0x4e')]);_0x8d2874[_0x336e('0x52')]=_[_0x336e('0x61')](_0x53cabf[_0x336e('0x4d')],qs[_0x336e('0x51')](_0x5bd63b[_0x336e('0x4e')][_0x336e('0x51')]));_0x8d2874['attributes']=_0x8d2874[_0x336e('0x52')][_0x336e('0x53')]?_0x8d2874[_0x336e('0x52')]:_0x53cabf['model'];_0x8d2874['order']=qs[_0x336e('0x55')](_0x5bd63b[_0x336e('0x4e')][_0x336e('0x55')]);_0x8d2874['where']=qs['filters'](_[_0x336e('0x57')](_0x5bd63b[_0x336e('0x4e')],_0x53cabf[_0x336e('0x50')]));if(_0x5bd63b[_0x336e('0x4e')][_0x336e('0x58')]){_0x8d2874[_0x336e('0x56')]=_[_0x336e('0x59')](_0x8d2874[_0x336e('0x56')],{'$or':_[_0x336e('0x47')](_0x8d2874[_0x336e('0x52')],function(_0x1e5bb8){var _0x14bf4d={};_0x14bf4d[_0x1e5bb8]={'$like':'%'+_0x5bd63b[_0x336e('0x4e')][_0x336e('0x58')]+'%'};return _0x14bf4d;})});}_0x8d2874=_[_0x336e('0x59')]({},_0x8d2874,_0x5bd63b['options']);return _0x20ffc3[_0x336e('0x9b')](_0x8d2874);}})[_0x336e('0x13')](function(_0x1abbb1){if(_0x1abbb1){_0x40bdac=_0x1abbb1[_0x336e('0x53')];if(!_0x5bd63b[_0x336e('0x4e')][_0x336e('0x54')]('nolimit')){_0x8d2874[_0x336e('0x20')]=qs['limit'](_0x5bd63b[_0x336e('0x4e')][_0x336e('0x20')]);_0x8d2874[_0x336e('0x1e')]=qs['offset'](_0x5bd63b['query']['offset']);}return _0x20ffc3['getApplications'](_0x8d2874);}})[_0x336e('0x13')](function(_0x51ae2c){if(_0x51ae2c){return _0x51ae2c?{'count':_0x40bdac,'rows':_0x51ae2c}:null;}})[_0x336e('0x13')](respondWithResult(_0x114e63,null))[_0x336e('0x1c')](handleError(_0x114e63,null));};exports['getMessages']=function(_0x1c0422,_0x23977a){var _0x559bae={'raw':!![],'where':{}};var _0x210f7e={};var _0x3cf01a={'count':0x0,'rows':[]};return db[_0x336e('0x48')][_0x336e('0x74')]({'where':{'id':_0x1c0422['params']['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x23977a,null))[_0x336e('0x13')](function(_0x3c5f31){if(_0x3c5f31){_0x210f7e[_0x336e('0x4d')]=_[_0x336e('0x4f')](db[_0x336e('0x9c')][_0x336e('0x49')]);_0x210f7e[_0x336e('0x4e')]=_['keys'](_0x1c0422['query']);_0x210f7e[_0x336e('0x50')]=_['intersection'](_0x210f7e['model'],_0x210f7e[_0x336e('0x4e')]);_0x559bae[_0x336e('0x52')]=_['intersection'](_0x210f7e[_0x336e('0x4d')],qs[_0x336e('0x51')](_0x1c0422[_0x336e('0x4e')][_0x336e('0x51')]));_0x559bae[_0x336e('0x52')]=_0x559bae[_0x336e('0x52')][_0x336e('0x53')]?_0x559bae[_0x336e('0x52')]:_0x210f7e[_0x336e('0x4d')];if(!_0x1c0422['query'][_0x336e('0x54')](_0x336e('0x6f'))){_0x559bae[_0x336e('0x20')]=qs[_0x336e('0x20')](_0x1c0422[_0x336e('0x4e')][_0x336e('0x20')]);_0x559bae['offset']=qs[_0x336e('0x1e')](_0x1c0422['query'][_0x336e('0x1e')]);}_0x559bae[_0x336e('0x70')]=qs[_0x336e('0x55')](_0x1c0422[_0x336e('0x4e')]['sort']);_0x559bae['where']=qs[_0x336e('0x50')](_[_0x336e('0x57')](_0x1c0422[_0x336e('0x4e')],_0x210f7e[_0x336e('0x50')]));_0x559bae[_0x336e('0x56')][_0x336e('0x6b')]=_0x3c5f31['id'];if(_0x1c0422[_0x336e('0x4e')][_0x336e('0x58')]){_0x559bae[_0x336e('0x56')]=_[_0x336e('0x59')](_0x559bae[_0x336e('0x56')],{'$or':_['map'](_0x559bae[_0x336e('0x52')],function(_0x39a6f1){var _0x4839da={};_0x4839da[_0x39a6f1]={'$like':'%'+_0x1c0422[_0x336e('0x4e')][_0x336e('0x58')]+'%'};return _0x4839da;})});}if(_0x1c0422[_0x336e('0x4e')][_0x336e('0x9d')]){var _0x614002=_0x1c0422[_0x336e('0x4e')][_0x336e('0x9d')][_0x336e('0x9e')](',');var _0xc8b183={};_0xc8b183[_0x614002[0x0]]={'$gte':moment(_0x614002[0x1])['format'](_0x336e('0x9f'))};_0x559bae[_0x336e('0x56')]=_['merge'](_0x559bae['where'],_0xc8b183);}_0x559bae=_[_0x336e('0x59')]({},_0x559bae,_0x1c0422[_0x336e('0x62')]);return db[_0x336e('0x9c')]['count']({'where':_0x559bae['where']})[_0x336e('0x13')](function(_0x17456c){_0x3cf01a[_0x336e('0x21')]=_0x17456c;if(_0x1c0422[_0x336e('0x4e')][_0x336e('0x5b')]){_0x559bae[_0x336e('0x75')]=[{'all':!![]}];}return db[_0x336e('0x9c')][_0x336e('0x5c')](_0x559bae);})[_0x336e('0x13')](function(_0x175f28){if(_0x1c0422['query'][_0x336e('0xa0')]===_0x336e('0xa1')){for(var _0x21c492=0x0;_0x21c492<_0x175f28[_0x336e('0x53')];_0x21c492++){_0x175f28[_0x21c492]['body']=juice(_0x175f28[_0x21c492][_0x336e('0x64')]);}}_0x3cf01a[_0x336e('0x5d')]=_0x175f28;return _0x3cf01a;});}})['then'](respondWithFilteredResult(_0x23977a,_0x559bae))['catch'](handleError(_0x23977a,null));};exports[_0x336e('0x2b')]=function(_0x77a6ee,_0x3ec77e){var _0x17b04f,_0x2b1435={},_0x311782;if(_0x77a6ee[_0x336e('0x64')]['to']){_0x311782=_0x77a6ee[_0x336e('0x64')]['to'][_0x336e('0x9e')](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x77a6ee['params']['id']},'include':[{'model':db[_0x336e('0xa2')],'as':_0x336e('0xa3'),'include':[{'model':db[_0x336e('0x8b')],'as':'Contacts','where':{'email':_0x311782},'limit':0x1,'order':[[_0x336e('0xa4'),'DESC']]}]},{'model':db[_0x336e('0x68')],'as':_0x336e('0x43'),'raw':!![],'include':[{'model':db[_0x336e('0xa5')],'as':_0x336e('0xa5'),'raw':!![]}]}]})[_0x336e('0x13')](handleEntityNotFound(_0x3ec77e,null))['then'](function(_0x432380){if(!_0x432380)return;_0x17b04f=_0x432380;if(!_0x432380['Smtp'])throw new Error(_0x336e('0xa6'));if(_[_0x336e('0xa7')](_0x77a6ee[_0x336e('0x64')]['from'])){_0x77a6ee[_0x336e('0x64')][_0x336e('0xa8')]=util['format'](_0x336e('0xa9'),_0x432380['name'],_0x432380[_0x336e('0x77')]||_0x432380[_0x336e('0x43')][_0x336e('0x37')]);}if(_0x77a6ee[_0x336e('0x64')][_0x336e('0xaa')]&&_0x77a6ee['body']['attachments'][_0x336e('0x53')]){for(var _0x16a121=0x0;_0x16a121<_0x77a6ee[_0x336e('0x64')][_0x336e('0xaa')][_0x336e('0x53')];_0x16a121+=0x1){_0x77a6ee[_0x336e('0x64')][_0x336e('0xaa')][_0x16a121]={'filename':_0x77a6ee[_0x336e('0x64')][_0x336e('0xaa')][_0x16a121][_0x336e('0x2a')],'path':path[_0x336e('0xab')](config[_0x336e('0xac')],'server/files/attachments',_0x77a6ee['body'][_0x336e('0xaa')][_0x16a121]['basename'])};}}var _0x504e0b=_0x432380[_0x336e('0xad')]();return respondWithRpcPromise(_0x336e('0xae'),_0x336e('0xaf'),{'account':_0x504e0b,'message':_0x77a6ee[_0x336e('0x64')]});})[_0x336e('0x13')](function(_0x4c6528){if(!_0x4c6528)return;_0x2b1435=_0x4c6528;if(!_0x17b04f[_0x336e('0xa3')])throw new Error(_0x336e('0xb0'));if(_0x17b04f[_0x336e('0xa3')][_0x336e('0xb1')][_0x336e('0x53')])return _0x17b04f['List']['Contacts'][0x0];return db[_0x336e('0x8b')]['create'](_[_0x336e('0xb')](_0x77a6ee[_0x336e('0x64')],{'firstName':_0x77a6ee[_0x336e('0x64')]['to'],'email':_0x77a6ee[_0x336e('0x64')]['to'],'phone':_0x77a6ee['body']['to'],'ListId':_0x17b04f['ListId']}));})[_0x336e('0x13')](function(_0x4550ec){if(!_0x4550ec)return;var _0x2e06a4={'UserId':_0x77a6ee[_0x336e('0x37')]['id'],'ContactId':_0x4550ec['id'],'MailAccountId':_0x17b04f['id'],'inReplyTo':_0x2b1435[_0x336e('0xb2')],'to':_0x77a6ee[_0x336e('0x64')][_0x336e('0xa8')],'cc':_0x77a6ee[_0x336e('0x64')]['cc'],'subject':_0x77a6ee[_0x336e('0x64')]['subject'],'attach':_0x77a6ee[_0x336e('0x64')]['attach'],'firstMsgDirection':_0x336e('0xb3'),'lastMsgAt':moment()[_0x336e('0xb4')](_0x336e('0x9f')),'lastMsgDirection':_0x336e('0xb3'),'Messages':[_[_0x336e('0x59')](_0x77a6ee[_0x336e('0x64')],{'messageId':_0x2b1435['messageId'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x17b04f['id'],'UserId':_0x77a6ee[_0x336e('0x37')]['id'],'ContactId':_0x4550ec['id']})]};if(_0x77a6ee['body'][_0x336e('0xb5')]){_0x2e06a4=_['merge'](_0x2e06a4,_0x77a6ee['body']['Interaction']);}return db[_0x336e('0x8a')][_0x336e('0x6c')](_0x2e06a4,{'include':[{'model':db[_0x336e('0x9c')],'as':_0x336e('0xb6')}]});})['then'](respondWithResult(_0x3ec77e,null))[_0x336e('0x1c')](handleError(_0x3ec77e,null));};exports[_0x336e('0xb7')]=function(_0xaaf0d5,_0x4b236b){return db['MailAccount'][_0x336e('0x67')]({'where':{'id':_0xaaf0d5['params']['id']},'include':[{'model':db[_0x336e('0x68')],'as':_0x336e('0x43'),'raw':!![],'include':[{'model':db[_0x336e('0xa5')],'as':_0x336e('0xa5'),'raw':!![]}]}]})[_0x336e('0x13')](handleEntityNotFound(_0x4b236b,null))[_0x336e('0x13')](function(_0x419b38){if(!_0x419b38['Smtp'])return;var _0x594fc4=_0x419b38[_0x336e('0xad')]();return respondWithRpcPromise(_0x336e('0xb8'),_0x336e('0xb7'),{'account':_0x594fc4});})[_0x336e('0x13')](respondWithResult(_0x4b236b,null))[_0x336e('0x1c')](handleError(_0x4b236b,null));};exports[_0x336e('0x25')]=function(_0x54ff06,_0xd15cb7){return db['MailAccount'][_0x336e('0x67')]({'where':{'id':_0x54ff06['params']['id']}})[_0x336e('0x13')](handleEntityNotFound(_0xd15cb7,null))[_0x336e('0x13')](function(_0x5e5cb9){if(_0x5e5cb9&&_0x5e5cb9[_0x336e('0x40')]){throw new db['Sequelize'][(_0x336e('0xb9'))](_0x336e('0xba'));}return _0x5e5cb9;})['then'](removeEntity(_0xd15cb7,null))['catch'](handleError(_0xd15cb7,null));};exports[_0x336e('0xbb')]=function(_0x3be5b0,_0x3c91c5){return db[_0x336e('0x48')]['find']({'where':{'id':_0x3be5b0[_0x336e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3c91c5,null))[_0x336e('0x13')](function(_0x37344b){if(_0x37344b){return _0x37344b[_0x336e('0xbb')](_0x3be5b0['body']['ids'],_['omit'](_0x3be5b0[_0x336e('0x64')],[_0x336e('0x87'),'id'])||{})[_0x336e('0xbc')](function(_0x34faaf){for(var _0x41e1f4=0x0;_0x41e1f4<_0x3be5b0[_0x336e('0x64')][_0x336e('0x87')][_0x336e('0x53')];_0x41e1f4+=0x1){socket[_0x336e('0xbd')](_0x336e('0xbe'),{'UserId':Number(_0x3be5b0[_0x336e('0x64')][_0x336e('0x87')][_0x41e1f4]),'MailAccountId':Number(_0x3be5b0['params']['id'])});}return _0x34faaf;});}})['then'](respondWithResult(_0x3c91c5,null))[_0x336e('0x1c')](handleError(_0x3c91c5,null));};exports['removeAgents']=function(_0x326e7f,_0x4e58a8){return db[_0x336e('0x48')][_0x336e('0x67')]({'where':{'id':_0x326e7f[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x4e58a8,null))['then'](function(_0x4745cd){if(_0x4745cd){return _0x4745cd[_0x336e('0xbf')](_0x326e7f[_0x336e('0x4e')][_0x336e('0x87')])[_0x336e('0x13')](function(){if(_[_0x336e('0xc0')](_0x326e7f[_0x336e('0x4e')][_0x336e('0x87')])){for(var _0x3b445d=0x0;_0x3b445d<_0x326e7f[_0x336e('0x4e')][_0x336e('0x87')][_0x336e('0x53')];_0x3b445d+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x326e7f[_0x336e('0x4e')][_0x336e('0x87')][_0x3b445d]),'MailAccountId':Number(_0x326e7f['params']['id'])});}}else{socket[_0x336e('0xbd')]('userMailAccount:remove',{'UserId':Number(_0x326e7f['query'][_0x336e('0x87')]),'MailAccountId':Number(_0x326e7f[_0x336e('0x5f')]['id'])});}});}})[_0x336e('0x13')](respondWithStatusCode(_0x4e58a8,null))[_0x336e('0x1c')](handleError(_0x4e58a8,null));};exports[_0x336e('0xc1')]=function(_0xa6520,_0x5231a4){var _0x2817ec={};var _0x295c41={};var _0x3d5175;var _0x2ca91c;return db['MailAccount'][_0x336e('0x74')]({'where':{'id':_0xa6520[_0x336e('0x5f')]['id']}})[_0x336e('0x13')](handleEntityNotFound(_0x5231a4,null))[_0x336e('0x13')](function(_0x3bd069){if(_0x3bd069){_0x3d5175=_0x3bd069;_0x295c41[_0x336e('0x4d')]=_[_0x336e('0x4f')](db[_0x336e('0x8c')][_0x336e('0x49')]);_0x295c41[_0x336e('0x4e')]=_['keys'](_0xa6520['query']);_0x295c41['filters']=_[_0x336e('0x61')](_0x295c41[_0x336e('0x4d')],_0x295c41[_0x336e('0x4e')]);_0x2817ec[_0x336e('0x52')]=_[_0x336e('0x61')](_0x295c41[_0x336e('0x4d')],qs['fields'](_0xa6520[_0x336e('0x4e')][_0x336e('0x51')]));_0x2817ec[_0x336e('0x52')]=_0x2817ec[_0x336e('0x52')][_0x336e('0x53')]?_0x2817ec[_0x336e('0x52')]:_0x295c41[_0x336e('0x4d')];_0x2817ec[_0x336e('0x70')]=qs['sort'](_0xa6520[_0x336e('0x4e')][_0x336e('0x55')]);_0x2817ec[_0x336e('0x56')]=qs[_0x336e('0x50')](_[_0x336e('0x57')](_0xa6520[_0x336e('0x4e')],_0x295c41['filters']));if(_0xa6520[_0x336e('0x4e')][_0x336e('0x58')]){_0x2817ec[_0x336e('0x56')]=_[_0x336e('0x59')](_0x2817ec['where'],{'$or':_[_0x336e('0x47')](_0x2817ec[_0x336e('0x52')],function(_0x274223){var _0x1666e3={};_0x1666e3[_0x274223]={'$like':'%'+_0xa6520[_0x336e('0x4e')][_0x336e('0x58')]+'%'};return _0x1666e3;})});}_0x2817ec=_[_0x336e('0x59')]({},_0x2817ec,_0xa6520['options']);return _0x3d5175[_0x336e('0xc1')](_0x2817ec);}})['then'](function(_0x2877af){if(_0x2877af){_0x2ca91c=_0x2877af['length'];if(!_0xa6520[_0x336e('0x4e')][_0x336e('0x54')](_0x336e('0x6f'))){_0x2817ec[_0x336e('0x20')]=qs[_0x336e('0x20')](_0xa6520[_0x336e('0x4e')]['limit']);_0x2817ec['offset']=qs[_0x336e('0x1e')](_0xa6520['query'][_0x336e('0x1e')]);}return _0x3d5175[_0x336e('0xc1')](_0x2817ec);}})['then'](function(_0x485004){if(_0x485004){return _0x485004?{'count':_0x2ca91c,'rows':_0x485004}:null;}})['then'](respondWithResult(_0x5231a4,null))['catch'](handleError(_0x5231a4,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c4b184e..3ffff83 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 _0x700c=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','update'];(function(_0x272d90,_0x5e70ff){var _0x2bf4a2=function(_0x544da6){while(--_0x544da6){_0x272d90['push'](_0x272d90['shift']());}};_0x2bf4a2(++_0x5e70ff);}(_0x700c,0x127));var _0xc700=function(_0x174536,_0x1e8bb5){_0x174536=_0x174536-0x0;var _0xf47484=_0x700c[_0x174536];return _0xf47484;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xc700('0x0'))['db'][_0xc700('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc700('0x2')](0x0);var events={'afterCreate':_0xc700('0x3'),'afterUpdate':_0xc700('0x4'),'afterDestroy':_0xc700('0x5')};function emitEvent(_0x31fc1d){return function(_0x35d8ed,_0x50fe7c,_0x508aba){MailAccountEvents[_0xc700('0x6')](_0x31fc1d+':'+_0x35d8ed['id'],_0x35d8ed);MailAccountEvents['emit'](_0x31fc1d,_0x35d8ed);_0x508aba(null);};}for(var e in events){if(events[_0xc700('0x7')](e)){var event=events[e];MailAccount[_0xc700('0x8')](e,emitEvent(event));}}module[_0xc700('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x8710=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xf0088a,_0x4b9052){var _0x3ed444=function(_0x3ca9fd){while(--_0x3ca9fd){_0xf0088a['push'](_0xf0088a['shift']());}};_0x3ed444(++_0x4b9052);}(_0x8710,0x68));var _0x0871=function(_0xe40aad,_0x3f40cf){_0xe40aad=_0xe40aad-0x0;var _0x1922dd=_0x8710[_0xe40aad];return _0x1922dd;};'use strict';var EventEmitter=require(_0x0871('0x0'));var MailAccount=require(_0x0871('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x0871('0x2')](0x0);var events={'afterCreate':_0x0871('0x3'),'afterUpdate':_0x0871('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2ac8cf){return function(_0x825b5,_0x48a450,_0x3bd909){MailAccountEvents['emit'](_0x2ac8cf+':'+_0x825b5['id'],_0x825b5);MailAccountEvents[_0x0871('0x5')](_0x2ac8cf,_0x825b5);_0x3bd909(null);};}for(var e in events){if(events[_0x0871('0x6')](e)){var event=events[e];MailAccount[_0x0871('0x7')](e,emitEvent(event));}}module[_0x0871('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 7a25960..53d71cd 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 _0x2d9b=['custom','host','Smtp','port','secure','authentication','CloudProvider','auth','OAuth2','user','data5','./mailAccount.attributes','exports','define','provider'];(function(_0x16b561,_0x5a914f){var _0x22599f=function(_0x27ce85){while(--_0x27ce85){_0x16b561['push'](_0x16b561['shift']());}};_0x22599f(++_0x5a914f);}(_0x2d9b,0x74));var _0xb2d9=function(_0x3a2fde,_0x14745d){_0x3a2fde=_0x3a2fde-0x0;var _0x8134b9=_0x2d9b[_0x3a2fde];return _0x8134b9;};'use strict';var attributes=require(_0xb2d9('0x0'));module[_0xb2d9('0x1')]=function(_0x335ca4){return _0x335ca4[_0xb2d9('0x2')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1588f2=this;var _0x3edae4={'id':_0x1588f2['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1588f2[_0xb2d9('0x3')]!==_0xb2d9('0x4')){_0x3edae4['service']=_0x1588f2[_0xb2d9('0x3')];}else{_0x3edae4[_0xb2d9('0x5')]=_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0x5')];_0x3edae4[_0xb2d9('0x7')]=_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0x7')];_0x3edae4['secure']=_0x1588f2['Smtp'][_0xb2d9('0x8')];}if(_0x1588f2['Smtp'][_0xb2d9('0x9')]){if(_0x1588f2[_0xb2d9('0x6')]['modernAuthentication']){if(!_0x1588f2['Smtp'][_0xb2d9('0xa')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3edae4[_0xb2d9('0xb')]={'type':_0xb2d9('0xc'),'user':_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0xd')],'accessToken':_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0xa')][_0xb2d9('0xe')]};}else{_0x3edae4['auth']={'user':_0x1588f2[_0xb2d9('0x6')][_0xb2d9('0xd')],'pass':_0x1588f2[_0xb2d9('0x6')]['pass']};}}return _0x3edae4;}}});}; \ No newline at end of file +var _0xc933=['host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','auth','OAuth2','user','data5','pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','service'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xc933,0x188));var _0x3c93=function(_0x1339e9,_0x1940d6){_0x1339e9=_0x1339e9-0x0;var _0xdcf12a=_0xc933[_0x1339e9];return _0xdcf12a;};'use strict';var attributes=require(_0x3c93('0x0'));module[_0x3c93('0x1')]=function(_0x4b3460){return _0x4b3460[_0x3c93('0x2')](_0x3c93('0x3'),attributes,{'tableName':_0x3c93('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x5d4c34=this;var _0x2ed1c1={'id':_0x5d4c34['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5d4c34[_0x3c93('0x5')]!==_0x3c93('0x6')){_0x2ed1c1[_0x3c93('0x7')]=_0x5d4c34[_0x3c93('0x5')];}else{_0x2ed1c1[_0x3c93('0x8')]=_0x5d4c34[_0x3c93('0x9')][_0x3c93('0x8')];_0x2ed1c1[_0x3c93('0xa')]=_0x5d4c34[_0x3c93('0x9')][_0x3c93('0xa')];_0x2ed1c1[_0x3c93('0xb')]=_0x5d4c34[_0x3c93('0x9')][_0x3c93('0xb')];}if(_0x5d4c34[_0x3c93('0x9')][_0x3c93('0xc')]){if(_0x5d4c34[_0x3c93('0x9')][_0x3c93('0xd')]){if(!_0x5d4c34['Smtp'][_0x3c93('0xe')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x2ed1c1[_0x3c93('0xf')]={'type':_0x3c93('0x10'),'user':_0x5d4c34[_0x3c93('0x9')][_0x3c93('0x11')],'accessToken':_0x5d4c34[_0x3c93('0x9')]['CloudProvider'][_0x3c93('0x12')]};}else{_0x2ed1c1[_0x3c93('0xf')]={'user':_0x5d4c34[_0x3c93('0x9')][_0x3c93('0x11')],'pass':_0x5d4c34['Smtp'][_0x3c93('0x13')]};}}return _0x2ed1c1;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 290b53a..e18ca98 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 _0x1261=['Contact\x20not\x20found','spread','update','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','User','UserId','unshift','agent','*,*,*,*','Start','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./mailAccount.socket','register','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','MailAccount','options','where','attributes','limit','map','include','model','ShowMailAccount','find','setDataValue','getSmtpOptions','catch','difference','keys','CmContact','rawAttributes','createdAt','body','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','List','Contacts','updatedAt','MailApplication','Applications','Smtp','CloudProvider','get','omit','smtpOptions','applications','priority','asc','autoclose','push','close','length','ListId','create','List\x20not\x20found','contact','messageId','generate','attach','format','MailInteraction','Messages','inReplyTo'];(function(_0x1a704d,_0x4e818c){var _0x5df79b=function(_0x506fa2){while(--_0x506fa2){_0x1a704d['push'](_0x1a704d['shift']());}};_0x5df79b(++_0x4e818c);}(_0x1261,0x144));var _0x1126=function(_0x2050f7,_0x3833c6){_0x2050f7=_0x2050f7-0x0;var _0x219da1=_0x1261[_0x2050f7];return _0x219da1;};'use strict';var _=require('lodash');var moment=require(_0x1126('0x0'));var BPromise=require(_0x1126('0x1'));var rs=require(_0x1126('0x2'));var Redis=require(_0x1126('0x3'));var db=require(_0x1126('0x4'))['db'];var logger=require(_0x1126('0x5'))(_0x1126('0x6'));var config=require(_0x1126('0x7'));var jayson=require(_0x1126('0x8'));var client=jayson[_0x1126('0x9')]['http']({'port':0x232c});config['redis']=_[_0x1126('0xa')](config[_0x1126('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1126('0xc'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xd'))[_0x1126('0xe')](socket);function respondWithRpcPromise(_0x2d9033,_0x59cfa1,_0x3f09ac){return new BPromise(function(_0x18dbe6,_0x167ef1){return client['request'](_0x2d9033,_0x3f09ac)[_0x1126('0xf')](function(_0x5d581b){logger['info'](_0x1126('0x10'),_0x59cfa1,'request\x20sent');logger[_0x1126('0x11')](_0x1126('0x12'),_0x59cfa1,_0x1126('0x13'),JSON[_0x1126('0x14')](_0x5d581b));if(_0x5d581b[_0x1126('0x15')]){if(_0x5d581b[_0x1126('0x15')][_0x1126('0x16')]===0x1f4){logger[_0x1126('0x15')](_0x1126('0x10'),_0x59cfa1,_0x5d581b['error']['message']);return _0x167ef1(_0x5d581b[_0x1126('0x15')][_0x1126('0x17')]);}logger[_0x1126('0x15')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x5d581b[_0x1126('0x15')]['message']);return _0x18dbe6(_0x5d581b[_0x1126('0x15')][_0x1126('0x17')]);}else{logger[_0x1126('0x18')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x1126('0x13'));_0x18dbe6(_0x5d581b[_0x1126('0x19')]['message']);}})['catch'](function(_0x22ae0b){logger[_0x1126('0x15')]('MailAccount,\x20%s,\x20%s',_0x59cfa1,_0x22ae0b);_0x167ef1(_0x22ae0b);});});}exports['GetMailAccount']=function(_0x4564c0){var _0x58b109=this;return new Promise(function(_0x22ed37,_0x1d6d19){return db[_0x1126('0x1a')]['findAll']({'raw':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options']['raw']===undefined?!![]:![]:!![],'where':_0x4564c0[_0x1126('0x1b')]?_0x4564c0[_0x1126('0x1b')][_0x1126('0x1c')]||null:null,'attributes':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options'][_0x1126('0x1d')]||null:null,'limit':_0x4564c0[_0x1126('0x1b')]?_0x4564c0['options'][_0x1126('0x1e')]||null:null,'include':_0x4564c0['options']?_0x4564c0['options']['include']?_[_0x1126('0x1f')](_0x4564c0[_0x1126('0x1b')][_0x1126('0x20')],function(_0x34bcf1){return{'model':db[_0x34bcf1[_0x1126('0x21')]],'as':_0x34bcf1['as'],'attributes':_0x34bcf1[_0x1126('0x1d')],'include':_0x34bcf1[_0x1126('0x20')]?_[_0x1126('0x1f')](_0x34bcf1['include'],function(_0x35eec3){return{'model':db[_0x35eec3[_0x1126('0x21')]],'as':_0x35eec3['as'],'attributes':_0x35eec3[_0x1126('0x1d')],'include':_0x35eec3['include']?_['map'](_0x35eec3[_0x1126('0x20')],function(_0x39bf0e){return{'model':db[_0x39bf0e['model']],'as':_0x39bf0e['as'],'attributes':_0x39bf0e[_0x1126('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1126('0xf')](function(_0x4a334a){logger[_0x1126('0x18')]('GetMailAccount',_0x4564c0);logger[_0x1126('0x11')]('GetMailAccount',_0x4564c0,JSON[_0x1126('0x14')](_0x4a334a));_0x22ed37(_0x4a334a);})['catch'](function(_0x378f4d){logger['error']('GetMailAccount',_0x378f4d['message'],_0x4564c0);_0x1d6d19(_0x58b109[_0x1126('0x15')](0x1f4,_0x378f4d[_0x1126('0x17')]));});});};exports[_0x1126('0x22')]=function(_0x5b8bea){var _0x2a3055=this;return new Promise(function(_0x226afb,_0x56f7f8){return db[_0x1126('0x1a')][_0x1126('0x23')]({'raw':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5b8bea['options']?_0x5b8bea[_0x1126('0x1b')][_0x1126('0x1c')]||null:null,'attributes':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')]['attributes']||null:null,'include':_0x5b8bea[_0x1126('0x1b')]?_0x5b8bea[_0x1126('0x1b')][_0x1126('0x20')]?_[_0x1126('0x1f')](_0x5b8bea[_0x1126('0x1b')]['include'],function(_0x2a0dfe){return{'model':db[_0x2a0dfe[_0x1126('0x21')]],'as':_0x2a0dfe['as'],'attributes':_0x2a0dfe[_0x1126('0x1d')],'include':_0x2a0dfe[_0x1126('0x20')]?_['map'](_0x2a0dfe['include'],function(_0x22827a){return{'model':db[_0x22827a[_0x1126('0x21')]],'as':_0x22827a['as'],'attributes':_0x22827a['attributes'],'include':_0x22827a[_0x1126('0x20')]?_[_0x1126('0x1f')](_0x22827a[_0x1126('0x20')],function(_0x5c08b9){return{'model':db[_0x5c08b9['model']],'as':_0x5c08b9['as'],'attributes':_0x5c08b9[_0x1126('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1126('0xf')](function(_0x3aa08f){if(_0x5b8bea[_0x1126('0x1b')]['smtp']===!![])_0x3aa08f[_0x1126('0x24')]('smtpOptions',_0x3aa08f[_0x1126('0x25')]());logger[_0x1126('0x18')](_0x1126('0x22'),_0x5b8bea);logger[_0x1126('0x11')](_0x1126('0x22'),_0x5b8bea,JSON['stringify'](_0x3aa08f));_0x226afb(_0x3aa08f);})[_0x1126('0x26')](function(_0x3ea9de){logger[_0x1126('0x15')](_0x1126('0x22'),_0x3ea9de[_0x1126('0x17')],_0x5b8bea);_0x56f7f8(_0x2a3055[_0x1126('0x15')](0x1f4,_0x3ea9de[_0x1126('0x17')]));});});};exports['NotifyMailAccount']=function(_0x1c8d8a){var _0x154c28=this;return new Promise(function(_0x227a6b,_0xf3a0bd){var _0xcf0483={'body':_0x1c8d8a['body'],'channel':'mail'};var _0x1c4f06=_[_0x1126('0x27')](_[_0x1126('0x28')](db[_0x1126('0x29')][_0x1126('0x2a')]),[_0x1126('0x2b'),'updatedAt','CompanyId','ListId']);var _0xb8054e=![];if(_0x1c8d8a['body']['id']){delete _0x1c8d8a[_0x1126('0x2c')]['id'];}if(_[_0x1126('0x2d')](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2e')])){return _0xf3a0bd(_0x154c28['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x1126('0x2d')](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2c')])||_0x1c8d8a['body'][_0x1126('0x2c')]===''){return _0xf3a0bd(_0x154c28['error'](0x1f4,_0x1126('0x2f')));}if(_['isNil'](_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x30')])){return _0xf3a0bd(_0x154c28[_0x1126('0x15')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c4f06));}if(!_[_0x1126('0x31')](_0x1c4f06,_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x30')])){return _0xf3a0bd(_0x154c28['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c4f06));}var _0x4dd7f5={};_0x4dd7f5[_0x1c8d8a[_0x1126('0x2c')]['mapKey']]=_0x1c8d8a[_0x1126('0x2c')]['from'];return db[_0x1126('0x1a')][_0x1126('0x23')]({'where':{'id':_0x1c8d8a[_0x1126('0x32')]['id']},'include':[{'model':db[_0x1126('0x33')],'as':_0x1126('0x34'),'include':[{'model':db['CmContact'],'as':_0x1126('0x35'),'where':_0x4dd7f5,'limit':0x1,'order':[[_0x1126('0x36'),'DESC']]}]},{'model':db[_0x1126('0x37')],'as':_0x1126('0x38')},{'model':db['MailServerOut'],'as':_0x1126('0x39'),'include':[{'model':db[_0x1126('0x3a')],'as':'CloudProvider'}]}]})[_0x1126('0xf')](function(_0xbdde58){if(_0xbdde58&&_0xbdde58[_0x1126('0x34')]){var _0x59656d=_0xbdde58[_0x1126('0x3b')]({'plain':!![]});_0xcf0483[_0x1126('0x32')]=_[_0x1126('0x3c')](_0x59656d,[_0x1126('0x38'),_0x1126('0x34')]);_0xcf0483[_0x1126('0x32')][_0x1126('0x3d')]=_0xbdde58[_0x1126('0x25')]();_0xcf0483['applications']=_0x59656d[_0x1126('0x38')];_0xcf0483['list']=_0x59656d[_0x1126('0x34')];_0xcf0483[_0x1126('0x3e')]=_['orderBy'](_0xcf0483['applications'],[_0x1126('0x3f')],[_0x1126('0x40')]);if(_0xcf0483[_0x1126('0x32')]&&_0xcf0483['account'][_0x1126('0x41')]){_0xcf0483[_0x1126('0x3e')][_0x1126('0x42')]({'id':0x0,'priority':_0xcf0483[_0x1126('0x3e')]['length']+0x1,'app':_0x1126('0x43'),'appdata':_0x1126('0x41'),'interval':'*,*,*,*'});}if(_0xcf0483['account']['Applications']){delete _0xcf0483['account'][_0x1126('0x38')];}if(_0xcf0483[_0x1126('0x32')]['List']){delete _0xcf0483[_0x1126('0x32')][_0x1126('0x34')];}if(_0x59656d[_0x1126('0x34')][_0x1126('0x35')][_0x1126('0x44')]){return _0x59656d['List'][_0x1126('0x35')][0x0];}var _0x267592=_['defaults'](_0x1c8d8a[_0x1126('0x2c')],{'firstName':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2e')],'ListId':_0x59656d[_0x1126('0x45')]});_0x267592[_0x1c8d8a[_0x1126('0x2c')]['mapKey']]=_0x1c8d8a[_0x1126('0x2c')]['from'];return db[_0x1126('0x29')][_0x1126('0x46')](_0x267592);}else{throw new Error(_0x1126('0x47'));}})['then'](function(_0x427add){_0xcf0483[_0x1126('0x48')]=_0x427add;if(_0x427add){if(!_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x49')]){_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x49')]=rs[_0x1126('0x4a')]()+'\x20'+_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')];}var _0x26949c={'ContactId':_0x427add['id'],'MailAccountId':_0x1c8d8a[_0x1126('0x32')]['id'],'inReplyTo':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x49')],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')],'cc':_0x1c8d8a[_0x1126('0x2c')]['message']['cc'],'subject':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['subject'],'attach':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x4b')],'lastMsgAt':moment()[_0x1126('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x1126('0x4d')][_0x1126('0x23')]({'where':{'closed':![],'MailAccountId':_0x1c8d8a[_0x1126('0x32')]['id']},'include':[{'model':db['MailMessage'],'as':_0x1126('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x4f')]}}]})[_0x1126('0xf')](function(_0x1230e9){if(_0x1230e9){return[_0x1230e9,![]];}return db[_0x1126('0x4d')][_0x1126('0x46')](_0x26949c)[_0x1126('0xf')](function(_0x5036d4){return[_0x5036d4,!![]];});});}else{throw new Error(_0x1126('0x50'));}})[_0x1126('0x51')](function(_0x116867,_0xc39c36){if(_0x116867){_0xb8054e=_0xc39c36;if(!_0xc39c36){return _0x116867[_0x1126('0x52')]({'inReplyTo':_0x1c8d8a[_0x1126('0x2c')]['message']['messageId'],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['from'],'cc':_0x1c8d8a['body']['message']['cc'],'subject':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x53')],'attach':_0x116867[_0x1126('0x4b')]?_0x116867['attach']:_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x4b')],'substatus':null,'substatusAt':moment()[_0x1126('0x4c')](_0x1126('0x54')),'lastMsgAt':moment()[_0x1126('0x4c')](_0x1126('0x54')),'lastMsgDirection':'in'});}else{return _0x116867;}}})['then'](function(_0x339aa6){_0xcf0483[_0x1126('0x55')]=_0x339aa6[_0x1126('0x3b')]({'plain':!![]});_0xcf0483[_0x1126('0x55')][_0x1126('0x56')]=_0xb8054e;return db['MailMessage']['create']({'body':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x2c')],'MailAccountId':_0x1c8d8a['account']['id'],'MailInteractionId':_0x339aa6['id'],'direction':'in','ContactId':_0xcf0483[_0x1126('0x48')]['id'],'messageId':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x49')],'from':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x2e')],'to':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['to'],'cc':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['cc'],'subject':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')]['subject'],'attach':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x4b')],'Attachments':_0x1c8d8a['body']['message'][_0x1126('0x57')],'originTo':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x58')],'originCc':_0x1c8d8a['body']['message']['originCc'],'bcc':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x59')],'ChatWebsiteId':_0x1c8d8a[_0x1126('0x2c')]['message'][_0x1126('0x5a')]||null,'originChannel':_0x1c8d8a['body'][_0x1126('0x17')][_0x1126('0x5b')]||_0x1126('0x5c'),'ChatOfflineMessageId':_0x1c8d8a[_0x1126('0x2c')][_0x1126('0x17')][_0x1126('0x5d')]||null},{'include':[{'model':db[_0x1126('0x5e')],'as':'Attachments'}]});})[_0x1126('0xf')](function(_0x57ece2){_0xcf0483[_0x1126('0x17')]=_0x57ece2;if(_0xcf0483[_0x1126('0x55')]['UserId']){return db[_0x1126('0x5f')][_0x1126('0x23')]({'attributes':['id','name'],'where':{'id':_0xcf0483[_0x1126('0x55')][_0x1126('0x60')]}})['then'](function(_0x561647){if(_0x561647){_0xcf0483[_0x1126('0x3e')][_0x1126('0x61')]({'id':0x0,'priority':0x0,'app':_0x1126('0x62'),'appdata':_0x561647['name']+','+(_0xcf0483['account']['waitForTheAssignedAgent']||0xa),'interval':_0x1126('0x63')});}return respondWithRpcPromise('Start','startRouting',_0xcf0483);});}return respondWithRpcPromise(_0x1126('0x64'),'startRouting',_0xcf0483);})[_0x1126('0xf')](function(_0x288a0c){_0x227a6b(_0x288a0c);})['catch'](function(_0x133075){_0xf3a0bd(_0x154c28[_0x1126('0x15')](0x1f4,_0x133075[_0x1126('0x17')]));});});}; \ No newline at end of file +var _0xba34=['MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','Applications','getSmtpOptions','list','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','from','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailAccount','MailAccount','find','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC'];(function(_0x1eae48,_0x17810d){var _0x39735a=function(_0x14c3dc){while(--_0x14c3dc){_0x1eae48['push'](_0x1eae48['shift']());}};_0x39735a(++_0x17810d);}(_0xba34,0x119));var _0x4ba3=function(_0x4a8688,_0x511dfa){_0x4a8688=_0x4a8688-0x0;var _0x284d0c=_0xba34[_0x4a8688];return _0x284d0c;};'use strict';var _=require(_0x4ba3('0x0'));var moment=require(_0x4ba3('0x1'));var BPromise=require(_0x4ba3('0x2'));var rs=require(_0x4ba3('0x3'));var Redis=require(_0x4ba3('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('rpc');var config=require(_0x4ba3('0x5'));var jayson=require(_0x4ba3('0x6'));var client=jayson[_0x4ba3('0x7')][_0x4ba3('0x8')]({'port':0x232c});config[_0x4ba3('0x9')]=_[_0x4ba3('0xa')](config[_0x4ba3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ba3('0xb'))(new Redis(config[_0x4ba3('0x9')]));require(_0x4ba3('0xc'))[_0x4ba3('0xd')](socket);function respondWithRpcPromise(_0x380d60,_0xcf1ec3,_0x292f58){return new BPromise(function(_0x3f653c,_0x2ed106){return client[_0x4ba3('0xe')](_0x380d60,_0x292f58)[_0x4ba3('0xf')](function(_0x51edab){logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0xcf1ec3,'request\x20sent');logger[_0x4ba3('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xcf1ec3,_0x4ba3('0x13'),JSON['stringify'](_0x51edab));if(_0x51edab[_0x4ba3('0x14')]){if(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x15')]===0x1f4){logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);return _0x2ed106(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);}logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);return _0x3f653c(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);}else{logger[_0x4ba3('0x10')]('MailAccount,\x20%s,\x20%s',_0xcf1ec3,_0x4ba3('0x13'));_0x3f653c(_0x51edab[_0x4ba3('0x17')][_0x4ba3('0x16')]);}})[_0x4ba3('0x18')](function(_0x556290){logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x556290);_0x2ed106(_0x556290);});});}exports[_0x4ba3('0x19')]=function(_0x1e2ce5){var _0x184332=this;return new Promise(function(_0x125944,_0x4b2791){return db['MailAccount'][_0x4ba3('0x1a')]({'raw':_0x1e2ce5['options']?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x1d')]||null:null,'attributes':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5['options'][_0x4ba3('0x1e')]||null:null,'limit':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5['options'][_0x4ba3('0x1f')]||null:null,'include':_0x1e2ce5['options']?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x20')],function(_0xe29a49){return{'model':db[_0xe29a49[_0x4ba3('0x22')]],'as':_0xe29a49['as'],'attributes':_0xe29a49[_0x4ba3('0x1e')],'include':_0xe29a49[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0xe29a49['include'],function(_0x252f37){return{'model':db[_0x252f37[_0x4ba3('0x22')]],'as':_0x252f37['as'],'attributes':_0x252f37[_0x4ba3('0x1e')],'include':_0x252f37['include']?_[_0x4ba3('0x21')](_0x252f37[_0x4ba3('0x20')],function(_0x44d78c){return{'model':db[_0x44d78c['model']],'as':_0x44d78c['as'],'attributes':_0x44d78c[_0x4ba3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4ba3('0xf')](function(_0x34ecb4){logger[_0x4ba3('0x10')]('GetMailAccount',_0x1e2ce5);logger['debug'](_0x4ba3('0x19'),_0x1e2ce5,JSON[_0x4ba3('0x23')](_0x34ecb4));_0x125944(_0x34ecb4);})[_0x4ba3('0x18')](function(_0x19f039){logger[_0x4ba3('0x14')](_0x4ba3('0x19'),_0x19f039['message'],_0x1e2ce5);_0x4b2791(_0x184332[_0x4ba3('0x14')](0x1f4,_0x19f039[_0x4ba3('0x16')]));});});};exports[_0x4ba3('0x24')]=function(_0xbf95b3){var _0x2a6757=this;return new Promise(function(_0x1a7a2c,_0x457236){return db[_0x4ba3('0x25')][_0x4ba3('0x26')]({'raw':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3['options']['raw']===undefined?!![]:![]:!![],'where':_0xbf95b3['options']?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x1d')]||null:null,'attributes':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x1e')]||null:null,'include':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x20')],function(_0x3439cb){return{'model':db[_0x3439cb['model']],'as':_0x3439cb['as'],'attributes':_0x3439cb[_0x4ba3('0x1e')],'include':_0x3439cb[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x3439cb['include'],function(_0x188f8c){return{'model':db[_0x188f8c['model']],'as':_0x188f8c['as'],'attributes':_0x188f8c[_0x4ba3('0x1e')],'include':_0x188f8c[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x188f8c[_0x4ba3('0x20')],function(_0xf892e1){return{'model':db[_0xf892e1[_0x4ba3('0x22')]],'as':_0xf892e1['as'],'attributes':_0xf892e1['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ba3('0xf')](function(_0x3cf56c){if(_0xbf95b3[_0x4ba3('0x1b')]['smtp']===!![])_0x3cf56c[_0x4ba3('0x27')](_0x4ba3('0x28'),_0x3cf56c['getSmtpOptions']());logger[_0x4ba3('0x10')]('ShowMailAccount',_0xbf95b3);logger['debug'](_0x4ba3('0x24'),_0xbf95b3,JSON[_0x4ba3('0x23')](_0x3cf56c));_0x1a7a2c(_0x3cf56c);})[_0x4ba3('0x18')](function(_0x2b14e1){logger[_0x4ba3('0x14')]('ShowMailAccount',_0x2b14e1[_0x4ba3('0x16')],_0xbf95b3);_0x457236(_0x2a6757[_0x4ba3('0x14')](0x1f4,_0x2b14e1[_0x4ba3('0x16')]));});});};exports[_0x4ba3('0x29')]=function(_0xab7983){var _0x2acc92=this;return new Promise(function(_0x349af4,_0x2577be){var _0x553475={'body':_0xab7983[_0x4ba3('0x2a')],'channel':_0x4ba3('0x2b')};var _0x3cb07f=_[_0x4ba3('0x2c')](_[_0x4ba3('0x2d')](db[_0x4ba3('0x2e')][_0x4ba3('0x2f')]),[_0x4ba3('0x30'),_0x4ba3('0x31'),_0x4ba3('0x32'),_0x4ba3('0x33')]);var _0x1c58d2=![];if(_0xab7983[_0x4ba3('0x2a')]['id']){delete _0xab7983[_0x4ba3('0x2a')]['id'];}if(_['isNil'](_0xab7983['body']['from'])){return _0x2577be(_0x2acc92['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x4ba3('0x34')](_0xab7983['body'][_0x4ba3('0x2a')])||_0xab7983['body'][_0x4ba3('0x2a')]===''){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x4ba3('0x35')));}if(_[_0x4ba3('0x34')](_0xab7983[_0x4ba3('0x2a')]['mapKey'])){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3cb07f));}if(!_[_0x4ba3('0x36')](_0x3cb07f,_0xab7983['body'][_0x4ba3('0x37')])){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x4ba3('0x38')+_0x3cb07f));}var _0x261a5e={};_0x261a5e[_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x37')]]=_0xab7983[_0x4ba3('0x2a')]['from'];return db[_0x4ba3('0x25')][_0x4ba3('0x26')]({'where':{'id':_0xab7983[_0x4ba3('0x39')]['id']},'include':[{'model':db[_0x4ba3('0x3a')],'as':_0x4ba3('0x3b'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x261a5e,'limit':0x1,'order':[[_0x4ba3('0x31'),_0x4ba3('0x3c')]]}]},{'model':db[_0x4ba3('0x3d')],'as':'Applications'},{'model':db[_0x4ba3('0x3e')],'as':_0x4ba3('0x3f'),'include':[{'model':db[_0x4ba3('0x40')],'as':'CloudProvider'}]}]})['then'](function(_0x34dc04){if(_0x34dc04&&_0x34dc04['List']){var _0x439acf=_0x34dc04[_0x4ba3('0x41')]({'plain':!![]});_0x553475[_0x4ba3('0x39')]=_[_0x4ba3('0x42')](_0x439acf,[_0x4ba3('0x43'),_0x4ba3('0x3b')]);_0x553475['account'][_0x4ba3('0x28')]=_0x34dc04[_0x4ba3('0x44')]();_0x553475['applications']=_0x439acf[_0x4ba3('0x43')];_0x553475[_0x4ba3('0x45')]=_0x439acf[_0x4ba3('0x3b')];_0x553475[_0x4ba3('0x46')]=_[_0x4ba3('0x47')](_0x553475['applications'],[_0x4ba3('0x48')],[_0x4ba3('0x49')]);if(_0x553475['account']&&_0x553475[_0x4ba3('0x39')][_0x4ba3('0x4a')]){_0x553475[_0x4ba3('0x46')][_0x4ba3('0x4b')]({'id':0x0,'priority':_0x553475[_0x4ba3('0x46')][_0x4ba3('0x4c')]+0x1,'app':_0x4ba3('0x4d'),'appdata':_0x4ba3('0x4a'),'interval':_0x4ba3('0x4e')});}if(_0x553475[_0x4ba3('0x39')][_0x4ba3('0x43')]){delete _0x553475[_0x4ba3('0x39')][_0x4ba3('0x43')];}if(_0x553475[_0x4ba3('0x39')][_0x4ba3('0x3b')]){delete _0x553475['account']['List'];}if(_0x439acf['List'][_0x4ba3('0x4f')][_0x4ba3('0x4c')]){return _0x439acf[_0x4ba3('0x3b')][_0x4ba3('0x4f')][0x0];}var _0x40af1d=_['defaults'](_0xab7983[_0x4ba3('0x2a')],{'firstName':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x50')],'ListId':_0x439acf[_0x4ba3('0x33')]});_0x40af1d[_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x37')]]=_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x50')];return db[_0x4ba3('0x2e')][_0x4ba3('0x51')](_0x40af1d);}else{throw new Error(_0x4ba3('0x52'));}})[_0x4ba3('0xf')](function(_0x317b9f){_0x553475[_0x4ba3('0x53')]=_0x317b9f;if(_0x317b9f){if(!_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x54')]){_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x54')]=rs[_0x4ba3('0x55')]()+'\x20'+_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['from'];}var _0x8ea419={'ContactId':_0x317b9f['id'],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id'],'inReplyTo':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x54')],'to':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x50')],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x56')],'attach':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x57')],'lastMsgAt':moment()[_0x4ba3('0x58')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x4ba3('0x59')][_0x4ba3('0x26')]({'where':{'closed':![],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id']},'include':[{'model':db[_0x4ba3('0x5a')],'as':_0x4ba3('0x5b'),'attributes':[_0x4ba3('0x54')],'where':{'messageId':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x5c')]}}]})[_0x4ba3('0xf')](function(_0x1afc5e){if(_0x1afc5e){return[_0x1afc5e,![]];}return db['MailInteraction'][_0x4ba3('0x51')](_0x8ea419)[_0x4ba3('0xf')](function(_0x55c03c){return[_0x55c03c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4ba3('0x5d')](function(_0x296bf6,_0x5c7c2f){if(_0x296bf6){_0x1c58d2=_0x5c7c2f;if(!_0x5c7c2f){return _0x296bf6[_0x4ba3('0x5e')]({'inReplyTo':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['messageId'],'to':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x50')],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x56')],'attach':_0x296bf6[_0x4ba3('0x57')]?_0x296bf6[_0x4ba3('0x57')]:_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x57')],'substatus':null,'substatusAt':moment()[_0x4ba3('0x58')](_0x4ba3('0x5f')),'lastMsgAt':moment()[_0x4ba3('0x58')](_0x4ba3('0x5f')),'lastMsgDirection':'in'});}else{return _0x296bf6;}}})[_0x4ba3('0xf')](function(_0x424477){_0x553475['interaction']=_0x424477['get']({'plain':!![]});_0x553475[_0x4ba3('0x60')]['created']=_0x1c58d2;return db[_0x4ba3('0x5a')][_0x4ba3('0x51')]({'body':_0xab7983[_0x4ba3('0x2a')]['body'],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id'],'MailInteractionId':_0x424477['id'],'direction':'in','ContactId':_0x553475[_0x4ba3('0x53')]['id'],'messageId':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x54')],'from':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x50')],'to':_0xab7983['body'][_0x4ba3('0x16')]['to'],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x56')],'attach':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x57')],'Attachments':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x61')],'originTo':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x62')],'originCc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x63')],'bcc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x64')],'ChatWebsiteId':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x65')]||null,'originChannel':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x66')]||_0x4ba3('0x67'),'ChatOfflineMessageId':_0xab7983['body']['message'][_0x4ba3('0x68')]||null},{'include':[{'model':db[_0x4ba3('0x69')],'as':_0x4ba3('0x6a')}]});})[_0x4ba3('0xf')](function(_0x37b966){_0x553475[_0x4ba3('0x16')]=_0x37b966;if(_0x553475[_0x4ba3('0x60')][_0x4ba3('0x6b')]){return db['User'][_0x4ba3('0x26')]({'attributes':['id','name'],'where':{'id':_0x553475[_0x4ba3('0x60')][_0x4ba3('0x6b')]}})[_0x4ba3('0xf')](function(_0x3c3638){if(_0x3c3638){_0x553475[_0x4ba3('0x46')][_0x4ba3('0x6c')]({'id':0x0,'priority':0x0,'app':_0x4ba3('0x6d'),'appdata':_0x3c3638[_0x4ba3('0x6e')]+','+(_0x553475['account'][_0x4ba3('0x6f')]||0xa),'interval':_0x4ba3('0x4e')});}return respondWithRpcPromise(_0x4ba3('0x70'),'startRouting',_0x553475);});}return respondWithRpcPromise(_0x4ba3('0x70'),_0x4ba3('0x71'),_0x553475);})[_0x4ba3('0xf')](function(_0x39d428){_0x349af4(_0x39d428);})[_0x4ba3('0x18')](function(_0x2569bc){_0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x2569bc['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f024375..26d9e4e 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 _0xe19e=['remove','removeListener','length','mailAccount:','./mailAccount.events'];(function(_0x58dc25,_0x49b9d5){var _0x21b0a7=function(_0x38a186){while(--_0x38a186){_0x58dc25['push'](_0x58dc25['shift']());}};_0x21b0a7(++_0x49b9d5);}(_0xe19e,0x180));var _0xee19=function(_0x5a99cd,_0x4adaa4){_0x5a99cd=_0x5a99cd-0x0;var _0x1a10e9=_0xe19e[_0x5a99cd];return _0x1a10e9;};'use strict';var MailAccountEvents=require(_0xee19('0x0'));var events=['save',_0xee19('0x1'),'update'];function createListener(_0x48d81c,_0x51d653){return function(_0x4418b8){_0x51d653['emit'](_0x48d81c,_0x4418b8);};}function removeListener(_0x1e72dc,_0xa2c8c6){return function(){MailAccountEvents[_0xee19('0x2')](_0x1e72dc,_0xa2c8c6);};}exports['register']=function(_0x457fd1){for(var _0x491cc3=0x0,_0x4b7b5b=events[_0xee19('0x3')];_0x491cc3<_0x4b7b5b;_0x491cc3++){var _0x2dea24=events[_0x491cc3];var _0x167143=createListener(_0xee19('0x4')+_0x2dea24,_0x457fd1);MailAccountEvents['on'](_0x2dea24,_0x167143);}}; \ No newline at end of file +var _0x83f6=['mailAccount:','./mailAccount.events','save','remove','emit','removeListener','register'];(function(_0x1d8edc,_0x3dc8c8){var _0x10d35f=function(_0x24dabd){while(--_0x24dabd){_0x1d8edc['push'](_0x1d8edc['shift']());}};_0x10d35f(++_0x3dc8c8);}(_0x83f6,0x1dd));var _0x683f=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x83f6[_0x3b5250];return _0xc844a1;};'use strict';var MailAccountEvents=require(_0x683f('0x0'));var events=[_0x683f('0x1'),_0x683f('0x2'),'update'];function createListener(_0x3e61f5,_0x3b83a7){return function(_0x6ccab){_0x3b83a7[_0x683f('0x3')](_0x3e61f5,_0x6ccab);};}function removeListener(_0x14a988,_0x5ccb79){return function(){MailAccountEvents[_0x683f('0x4')](_0x14a988,_0x5ccb79);};}exports[_0x683f('0x5')]=function(_0x36ba4c){for(var _0x59fe20=0x0,_0x32a955=events['length'];_0x59fe20<_0x32a955;_0x59fe20++){var _0x815ad=events[_0x59fe20];var _0x27760f=createListener(_0x683f('0x6')+_0x815ad,_0x36ba4c);MailAccountEvents['on'](_0x815ad,_0x27760f);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index af6e936..cb25262 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 _0x0c34=['./mailApplication.controller','get','/:id','isAuthenticated','show','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x8fb7a4,_0x607700){var _0x1fdca2=function(_0x300754){while(--_0x300754){_0x8fb7a4['push'](_0x8fb7a4['shift']());}};_0x1fdca2(++_0x607700);}(_0x0c34,0x1e8));var _0x40c3=function(_0x4ac29b,_0x4dc928){_0x4ac29b=_0x4ac29b-0x0;var _0x2fa46b=_0x0c34[_0x4ac29b];return _0x2fa46b;};'use strict';var multer=require(_0x40c3('0x0'));var util=require('util');var path=require(_0x40c3('0x1'));var timeout=require(_0x40c3('0x2'));var express=require(_0x40c3('0x3'));var router=express[_0x40c3('0x4')]();var fs_extra=require(_0x40c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x40c3('0x6'));var config=require('../../config/environment');var controller=require(_0x40c3('0x7'));router[_0x40c3('0x8')](_0x40c3('0x9'),auth[_0x40c3('0xa')](),controller[_0x40c3('0xb')]);router['put'](_0x40c3('0x9'),auth['isAuthenticated'](),controller[_0x40c3('0xc')]);router[_0x40c3('0xd')]('/:id',auth[_0x40c3('0xa')](),controller[_0x40c3('0xe')]);module['exports']=router; \ No newline at end of file +var _0x1779=['../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3fffac,_0x31a77b){var _0xcef7e8=function(_0x1b821a){while(--_0x1b821a){_0x3fffac['push'](_0x3fffac['shift']());}};_0xcef7e8(++_0x31a77b);}(_0x1779,0x109));var _0x9177=function(_0x5b6c96,_0x3f4f7b){_0x5b6c96=_0x5b6c96-0x0;var _0x5eed7d=_0x1779[_0x5b6c96];return _0x5eed7d;};'use strict';var multer=require(_0x9177('0x0'));var util=require('util');var path=require(_0x9177('0x1'));var timeout=require(_0x9177('0x2'));var express=require(_0x9177('0x3'));var router=express[_0x9177('0x4')]();var fs_extra=require(_0x9177('0x5'));var auth=require(_0x9177('0x6'));var interaction=require(_0x9177('0x7'));var config=require(_0x9177('0x8'));var controller=require(_0x9177('0x9'));router[_0x9177('0xa')](_0x9177('0xb'),auth[_0x9177('0xc')](),controller['show']);router[_0x9177('0xd')](_0x9177('0xb'),auth[_0x9177('0xc')](),controller[_0x9177('0xe')]);router[_0x9177('0xf')]('/:id',auth[_0x9177('0xc')](),controller[_0x9177('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 101cca4..df3ba0f 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 _0x081d=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x081d,0x19e));var _0xd081=function(_0x16a4b8,_0x42f23b){_0x16a4b8=_0x16a4b8-0x0;var _0x48cc58=_0x081d[_0x16a4b8];return _0x48cc58;};'use strict';var Sequelize=require(_0xd081('0x0'));module[_0xd081('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd081('0x2')],'allowNull':![],'defaultValue':_0xd081('0x3')},'appdata':{'type':Sequelize[_0xd081('0x4')]()},'description':{'type':Sequelize[_0xd081('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd081('0x5')}}; \ No newline at end of file +var _0x3a8f=['STRING','TEXT','exports','INTEGER'];(function(_0x43f352,_0x530e02){var _0x1378a4=function(_0xcb56d8){while(--_0xcb56d8){_0x43f352['push'](_0x43f352['shift']());}};_0x1378a4(++_0x530e02);}(_0x3a8f,0x1a2));var _0xf3a8=function(_0x3d474c,_0x23055c){_0x3d474c=_0x3d474c-0x0;var _0x103e55=_0x3a8f[_0x3d474c];return _0x103e55;};'use strict';var Sequelize=require('sequelize');module[_0xf3a8('0x0')]={'priority':{'type':Sequelize[_0xf3a8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf3a8('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf3a8('0x3')]()},'description':{'type':Sequelize[_0xf3a8('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 0676fb6..574c6a1 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 _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x2035e1,_0x35570e){var _0x400301=function(_0x3cc4f4){while(--_0x3cc4f4){_0x2035e1['push'](_0x2035e1['shift']());}};_0x400301(++_0x35570e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0xcb91[_0x5774be];return _0x4914b4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));}; \ No newline at end of file +var _0xe706=['limit','count','offset','set','Content-Range','json','apply','save','update','then','end','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','body','catch','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined'];(function(_0x11435c,_0x436ccf){var _0x556167=function(_0x56cf83){while(--_0x56cf83){_0x11435c['push'](_0x11435c['shift']());}};_0x556167(++_0x436ccf);}(_0xe706,0xa3));var _0x6e70=function(_0x2e748c,_0x55ec8e){_0x2e748c=_0x2e748c-0x0;var _0x37e219=_0xe706[_0x2e748c];return _0x37e219;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];function respondWithStatusCode(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xcc;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x1d')](_0x3b38f3);}return _0x27dd9b[_0x6e70('0x1e')](_0x3b38f3)['end']();};}function respondWithResult(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0xc8;return function(_0x257e81){if(_0x257e81){return _0x52737e['status'](_0x48bc72)['json'](_0x257e81);}};}function respondWithFilteredResult(_0x304716,_0x22c50c){return function(_0x5d9263){if(_0x5d9263){var _0x24f3ac=typeof _0x22c50c['offset']===_0x6e70('0x1f')&&typeof _0x22c50c[_0x6e70('0x20')]==='undefined';var _0x49029f=_0x5d9263[_0x6e70('0x21')];var _0x5ea7a5=_0x24f3ac?0x0:_0x22c50c[_0x6e70('0x22')];var _0x173afe=_0x24f3ac?_0x5d9263['count']:_0x22c50c['offset']+_0x22c50c[_0x6e70('0x20')];var _0x208e21;if(_0x173afe>=_0x49029f){_0x173afe=_0x49029f;_0x208e21=0xc8;}else{_0x208e21=0xce;}_0x304716[_0x6e70('0x1e')](_0x208e21);return _0x304716[_0x6e70('0x23')](_0x6e70('0x24'),_0x5ea7a5+'-'+_0x173afe+'/'+_0x49029f)[_0x6e70('0x25')](_0x5d9263);}return null;};}function patchUpdates(_0x1b2453){return function(_0x44a49f){try{jsonpatch[_0x6e70('0x26')](_0x44a49f,_0x1b2453,!![]);}catch(_0xb29a2a){return BPromise['reject'](_0xb29a2a);}return _0x44a49f[_0x6e70('0x27')]();};}function saveUpdates(_0x344b65,_0x27b294){return function(_0x502b2d){if(_0x502b2d){return _0x502b2d[_0x6e70('0x28')](_0x344b65)[_0x6e70('0x29')](function(_0x3337a6){return _0x3337a6;});}return null;};}function removeEntity(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(_0x538b9c){return _0x538b9c['destroy']()['then'](function(){_0x50da2c[_0x6e70('0x1e')](0xcc)[_0x6e70('0x2a')]();});}};}function handleEntityNotFound(_0x51d292,_0x3ecdf1){return function(_0x1196ed){if(!_0x1196ed){_0x51d292['sendStatus'](0x194);}return _0x1196ed;};}function handleError(_0x338ad6,_0x67fb43){_0x67fb43=_0x67fb43||0x1f4;return function(_0x2bb231){logger['error'](_0x2bb231['stack']);if(_0x2bb231[_0x6e70('0x2b')]){delete _0x2bb231[_0x6e70('0x2b')];}_0x338ad6[_0x6e70('0x1e')](_0x67fb43)[_0x6e70('0x2c')](_0x2bb231);};}exports[_0x6e70('0x2d')]=function(_0x5d772a,_0x1952ea){var _0x406f29={'raw':!![],'where':{'id':_0x5d772a[_0x6e70('0x2e')]['id']}},_0xecf336={};_0xecf336[_0x6e70('0x2f')]=_[_0x6e70('0x30')](db[_0x6e70('0x31')][_0x6e70('0x32')]);_0xecf336[_0x6e70('0x33')]=_[_0x6e70('0x30')](_0x5d772a['query']);_0xecf336[_0x6e70('0x34')]=_['intersection'](_0xecf336[_0x6e70('0x2f')],_0xecf336['query']);_0x406f29[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0xecf336[_0x6e70('0x2f')],qs['fields'](_0x5d772a[_0x6e70('0x33')][_0x6e70('0x37')]));_0x406f29['attributes']=_0x406f29[_0x6e70('0x35')][_0x6e70('0x38')]?_0x406f29['attributes']:_0xecf336[_0x6e70('0x2f')];if(_0x5d772a[_0x6e70('0x33')][_0x6e70('0x39')]){_0x406f29[_0x6e70('0x3a')]=[{'all':!![]}];}_0x406f29=_[_0x6e70('0x3b')]({},_0x406f29,_0x5d772a[_0x6e70('0x3c')]);return db[_0x6e70('0x31')][_0x6e70('0x3d')](_0x406f29)[_0x6e70('0x29')](handleEntityNotFound(_0x1952ea,null))[_0x6e70('0x29')](respondWithResult(_0x1952ea,null))['catch'](handleError(_0x1952ea,null));};exports[_0x6e70('0x28')]=function(_0x4795a0,_0x23cd1a){if(_0x4795a0[_0x6e70('0x3e')]['id']){delete _0x4795a0[_0x6e70('0x3e')]['id'];}return db[_0x6e70('0x31')][_0x6e70('0x3d')]({'where':{'id':_0x4795a0[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x23cd1a,null))[_0x6e70('0x29')](saveUpdates(_0x4795a0[_0x6e70('0x3e')],null))[_0x6e70('0x29')](respondWithResult(_0x23cd1a,null))[_0x6e70('0x3f')](handleError(_0x23cd1a,null));};exports[_0x6e70('0x40')]=function(_0x5594d3,_0x501b53){return db['MailApplication']['find']({'where':{'id':_0x5594d3[_0x6e70('0x2e')]['id']}})[_0x6e70('0x29')](handleEntityNotFound(_0x501b53,null))[_0x6e70('0x29')](removeEntity(_0x501b53,null))[_0x6e70('0x3f')](handleError(_0x501b53,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 06537c7..c298231 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 _0x6e9f=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','MailApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e9f,0x173));var _0xf6e9=function(_0x315d3e,_0x4ae0df){_0x315d3e=_0x315d3e-0x0;var _0x557a8a=_0x6e9f[_0x315d3e];return _0x557a8a;};'use strict';var _=require(_0xf6e9('0x0'));var util=require(_0xf6e9('0x1'));var logger=require(_0xf6e9('0x2'))(_0xf6e9('0x3'));var moment=require(_0xf6e9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf6e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf6e9('0x6'));var config=require(_0xf6e9('0x7'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x1b3050,_0x8a1917){return _0x1b3050[_0xf6e9('0x8')](_0xf6e9('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf6e9('0xa'),'collate':_0xf6e9('0xb')});}; \ No newline at end of file +var _0xdcb6=['exports','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xdcb6,0xc4));var _0x6dcb=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xdcb6[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0x6dcb('0x0'));var util=require('util');var logger=require(_0x6dcb('0x1'))(_0x6dcb('0x2'));var moment=require(_0x6dcb('0x3'));var BPromise=require(_0x6dcb('0x4'));var rp=require(_0x6dcb('0x5'));var fs=require('fs');var path=require(_0x6dcb('0x6'));var rimraf=require(_0x6dcb('0x7'));var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x6dcb('0x8')]=function(_0x36f8fc,_0x1de9c0){return _0x36f8fc['define'](_0x6dcb('0x9'),attributes,{'tableName':_0x6dcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6dcb('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index b6139b2..900057e 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 _0x3e88=['debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x3e88,0x143));var _0x83e8=function(_0x1aaf95,_0x2150c0){_0x1aaf95=_0x1aaf95-0x0;var _0x1a5651=_0x3e88[_0x1aaf95];return _0x1a5651;};'use strict';var _=require(_0x83e8('0x0'));var util=require(_0x83e8('0x1'));var moment=require(_0x83e8('0x2'));var BPromise=require(_0x83e8('0x3'));var rs=require(_0x83e8('0x4'));var fs=require('fs');var Redis=require(_0x83e8('0x5'));var db=require(_0x83e8('0x6'))['db'];var utils=require(_0x83e8('0x7'));var logger=require(_0x83e8('0x8'))(_0x83e8('0x9'));var config=require(_0x83e8('0xa'));var jayson=require(_0x83e8('0xb'));var client=jayson[_0x83e8('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x162188,_0x794c1,_0x403b7a){return new BPromise(function(_0x45f92f,_0x37e8cd){return client[_0x83e8('0xd')](_0x162188,_0x403b7a)[_0x83e8('0xe')](function(_0x2267bb){logger[_0x83e8('0xf')]('MailApplication,\x20%s,\x20%s',_0x794c1,_0x83e8('0x10'));logger[_0x83e8('0x11')](_0x83e8('0x12'),_0x794c1,_0x83e8('0x10'),JSON[_0x83e8('0x13')](_0x2267bb));if(_0x2267bb[_0x83e8('0x14')]){if(_0x2267bb['error'][_0x83e8('0x15')]===0x1f4){logger[_0x83e8('0x14')](_0x83e8('0x16'),_0x794c1,_0x2267bb[_0x83e8('0x14')][_0x83e8('0x17')]);return _0x37e8cd(_0x2267bb[_0x83e8('0x14')][_0x83e8('0x17')]);}logger['error'](_0x83e8('0x16'),_0x794c1,_0x2267bb[_0x83e8('0x14')][_0x83e8('0x17')]);return _0x45f92f(_0x2267bb['error'][_0x83e8('0x17')]);}else{logger[_0x83e8('0xf')](_0x83e8('0x16'),_0x794c1,_0x83e8('0x10'));_0x45f92f(_0x2267bb[_0x83e8('0x18')][_0x83e8('0x17')]);}})[_0x83e8('0x19')](function(_0x4ec21a){logger[_0x83e8('0x14')](_0x83e8('0x16'),_0x794c1,_0x4ec21a);_0x37e8cd(_0x4ec21a);});});}exports[_0x83e8('0x1a')]=function(_0x321cbf){var _0x1c028a=this;return new Promise(function(_0x18b54e,_0x6c85e4){return db[_0x83e8('0x1b')][_0x83e8('0x1c')](_0x321cbf[_0x83e8('0x1d')],{'raw':_0x321cbf[_0x83e8('0x1e')]?_0x321cbf[_0x83e8('0x1e')][_0x83e8('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321cbf['options']?_0x321cbf[_0x83e8('0x1e')][_0x83e8('0x20')]||null:null,'attributes':_0x321cbf[_0x83e8('0x1e')]?_0x321cbf[_0x83e8('0x1e')]['attributes']||null:null,'limit':_0x321cbf[_0x83e8('0x1e')]?_0x321cbf[_0x83e8('0x1e')][_0x83e8('0x21')]||null:null})[_0x83e8('0xe')](function(_0x53d57f){logger[_0x83e8('0xf')]('UpdateMailApplication',_0x321cbf);logger[_0x83e8('0x11')](_0x83e8('0x1a'),_0x321cbf,JSON[_0x83e8('0x13')](_0x53d57f));_0x18b54e(_0x53d57f);})[_0x83e8('0x19')](function(_0x37e489){logger[_0x83e8('0x14')](_0x83e8('0x1a'),_0x37e489[_0x83e8('0x17')],_0x321cbf);_0x6c85e4(_0x1c028a['error'](0x1f4,_0x37e489[_0x83e8('0x17')]));});});}; \ No newline at end of file +var _0x8af3=['code','message','result','catch','UpdateMailApplication','MailApplication','update','options','raw','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','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(_0x47819a,_0x3074b2){var _0x505b69=function(_0x21285b){while(--_0x21285b){_0x47819a['push'](_0x47819a['shift']());}};_0x505b69(++_0x3074b2);}(_0x8af3,0x7e));var _0x38af=function(_0x239a1f,_0x42b4e1){_0x239a1f=_0x239a1f-0x0;var _0x3fb920=_0x8af3[_0x239a1f];return _0x3fb920;};'use strict';var _=require(_0x38af('0x0'));var util=require('util');var moment=require(_0x38af('0x1'));var BPromise=require(_0x38af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x38af('0x3'));var db=require(_0x38af('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x38af('0x5'))(_0x38af('0x6'));var config=require('../../config/environment');var jayson=require(_0x38af('0x7'));var client=jayson[_0x38af('0x8')][_0x38af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1547dd,_0x5db547,_0x6df672){return new BPromise(function(_0x1b2766,_0x51b477){return client[_0x38af('0xa')](_0x1547dd,_0x6df672)[_0x38af('0xb')](function(_0x34b222){logger[_0x38af('0xc')](_0x38af('0xd'),_0x5db547,'request\x20sent');logger[_0x38af('0xe')](_0x38af('0xf'),_0x5db547,_0x38af('0x10'),JSON[_0x38af('0x11')](_0x34b222));if(_0x34b222[_0x38af('0x12')]){if(_0x34b222[_0x38af('0x12')][_0x38af('0x13')]===0x1f4){logger[_0x38af('0x12')](_0x38af('0xd'),_0x5db547,_0x34b222[_0x38af('0x12')][_0x38af('0x14')]);return _0x51b477(_0x34b222[_0x38af('0x12')][_0x38af('0x14')]);}logger['error'](_0x38af('0xd'),_0x5db547,_0x34b222[_0x38af('0x12')][_0x38af('0x14')]);return _0x1b2766(_0x34b222[_0x38af('0x12')][_0x38af('0x14')]);}else{logger[_0x38af('0xc')](_0x38af('0xd'),_0x5db547,'request\x20sent');_0x1b2766(_0x34b222[_0x38af('0x15')]['message']);}})[_0x38af('0x16')](function(_0x271ac2){logger[_0x38af('0x12')](_0x38af('0xd'),_0x5db547,_0x271ac2);_0x51b477(_0x271ac2);});});}exports[_0x38af('0x17')]=function(_0x39b8ae){var _0x2bd79c=this;return new Promise(function(_0x2f9296,_0x28fffc){return db[_0x38af('0x18')][_0x38af('0x19')](_0x39b8ae['body'],{'raw':_0x39b8ae['options']?_0x39b8ae[_0x38af('0x1a')][_0x38af('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39b8ae['options']?_0x39b8ae['options']['where']||null:null,'attributes':_0x39b8ae[_0x38af('0x1a')]?_0x39b8ae[_0x38af('0x1a')]['attributes']||null:null,'limit':_0x39b8ae[_0x38af('0x1a')]?_0x39b8ae[_0x38af('0x1a')][_0x38af('0x1c')]||null:null})[_0x38af('0xb')](function(_0x2696eb){logger[_0x38af('0xc')]('UpdateMailApplication',_0x39b8ae);logger[_0x38af('0xe')](_0x38af('0x17'),_0x39b8ae,JSON[_0x38af('0x11')](_0x2696eb));_0x2f9296(_0x2696eb);})[_0x38af('0x16')](function(_0x538501){logger[_0x38af('0x12')]('UpdateMailApplication',_0x538501[_0x38af('0x14')],_0x39b8ae);_0x28fffc(_0x2bd79c[_0x38af('0x12')](0x1f4,_0x538501[_0x38af('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 614867f..e70bb75 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 _0xc4d4=['index','get','describe','/:id','/:id/messages','getMessages','download','post','/:id/tags','mailinteraction:addtags','addTags','tracked','mail','mailinteraction:update','update','mailinteraction:destroy','destroy','delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated'];(function(_0x3caeb5,_0x219363){var _0x5eca7e=function(_0x4cae6b){while(--_0x4cae6b){_0x3caeb5['push'](_0x3caeb5['shift']());}};_0x5eca7e(++_0x219363);}(_0xc4d4,0x1ee));var _0x4c4d=function(_0x39a04c,_0x2b4002){_0x39a04c=_0x39a04c-0x0;var _0x580cb0=_0xc4d4[_0x39a04c];return _0x580cb0;};'use strict';var express=require(_0x4c4d('0x0'));var router=express[_0x4c4d('0x1')]();var auth=require(_0x4c4d('0x2'));var interaction=require(_0x4c4d('0x3'));var controller=require(_0x4c4d('0x4'));router['get']('/',auth[_0x4c4d('0x5')](),controller[_0x4c4d('0x6')]);router[_0x4c4d('0x7')]('/describe',auth[_0x4c4d('0x5')](),controller[_0x4c4d('0x8')]);router[_0x4c4d('0x7')](_0x4c4d('0x9'),auth[_0x4c4d('0x5')](),controller['show']);router['get'](_0x4c4d('0xa'),auth[_0x4c4d('0x5')](),controller[_0x4c4d('0xb')]);router[_0x4c4d('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x4c4d('0xc')]);router[_0x4c4d('0xd')]('/',auth[_0x4c4d('0x5')](),controller['create']);router[_0x4c4d('0xd')](_0x4c4d('0xa'),auth[_0x4c4d('0x5')](),controller['addMessage']);router[_0x4c4d('0xd')](_0x4c4d('0xe'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x4c4d('0xf')),controller[_0x4c4d('0x10')]);router['put'](_0x4c4d('0x9'),auth[_0x4c4d('0x5')](),interaction[_0x4c4d('0x11')](_0x4c4d('0x12'),_0x4c4d('0x13')),controller[_0x4c4d('0x14')]);router['delete']('/:id',auth[_0x4c4d('0x5')](),interaction[_0x4c4d('0x11')](_0x4c4d('0x12'),_0x4c4d('0x15')),controller[_0x4c4d('0x16')]);router[_0x4c4d('0x17')](_0x4c4d('0xe'),auth['isAuthenticated'](),controller['removeTags']);module[_0x4c4d('0x18')]=router; \ No newline at end of file +var _0xbbff=['express','Router','../../components/auth/service','get','index','/describe','isAuthenticated','describe','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','mailinteraction:addtags','addTags','/:id','mail','mailinteraction:update','update','delete','tracked','destroy','removeTags','exports'];(function(_0x19eb03,_0x152a05){var _0x25ab41=function(_0x15c6d4){while(--_0x15c6d4){_0x19eb03['push'](_0x19eb03['shift']());}};_0x25ab41(++_0x152a05);}(_0xbbff,0x1e6));var _0xfbbf=function(_0x33936c,_0x44c103){_0x33936c=_0x33936c-0x0;var _0x2ea7f4=_0xbbff[_0x33936c];return _0x2ea7f4;};'use strict';var express=require(_0xfbbf('0x0'));var router=express[_0xfbbf('0x1')]();var auth=require(_0xfbbf('0x2'));var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0xfbbf('0x3')]('/',auth['isAuthenticated'](),controller[_0xfbbf('0x4')]);router['get'](_0xfbbf('0x5'),auth[_0xfbbf('0x6')](),controller[_0xfbbf('0x7')]);router[_0xfbbf('0x3')]('/:id',auth['isAuthenticated'](),controller[_0xfbbf('0x8')]);router[_0xfbbf('0x3')](_0xfbbf('0x9'),auth['isAuthenticated'](),controller[_0xfbbf('0xa')]);router[_0xfbbf('0x3')](_0xfbbf('0xb'),auth[_0xfbbf('0x6')](),controller['download']);router[_0xfbbf('0xc')]('/',auth[_0xfbbf('0x6')](),controller[_0xfbbf('0xd')]);router[_0xfbbf('0xc')](_0xfbbf('0x9'),auth[_0xfbbf('0x6')](),controller[_0xfbbf('0xe')]);router[_0xfbbf('0xc')](_0xfbbf('0xf'),auth['isAuthenticated'](),interaction['tracked']('mail',_0xfbbf('0x10')),controller[_0xfbbf('0x11')]);router['put'](_0xfbbf('0x12'),auth['isAuthenticated'](),interaction['tracked'](_0xfbbf('0x13'),_0xfbbf('0x14')),controller[_0xfbbf('0x15')]);router[_0xfbbf('0x16')]('/:id',auth[_0xfbbf('0x6')](),interaction[_0xfbbf('0x17')]('mail','mailinteraction:destroy'),controller[_0xfbbf('0x18')]);router['delete'](_0xfbbf('0xf'),auth[_0xfbbf('0x6')](),controller[_0xfbbf('0x19')]);module[_0xfbbf('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 31842d1..7cc7ec5 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 _0x0734=['sequelize','iconv','exports','DATE','STRING','TEXT','long','ENUM','out','BOOLEAN'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x0734,0xfa));var _0x4073=function(_0x220892,_0xc6873f){_0x220892=_0x220892-0x0;var _0x43a676=_0x0734[_0x220892];return _0x43a676;};'use strict';var Sequelize=require(_0x4073('0x0'));var iconv=require(_0x4073('0x1'));module[_0x4073('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4073('0x3')]},'disposition':{'type':Sequelize[_0x4073('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4073('0x4')]},'note':{'type':Sequelize[_0x4073('0x4')]},'inReplyTo':{'type':Sequelize[_0x4073('0x4')](0x1fe)},'to':{'type':Sequelize[_0x4073('0x4')]},'cc':{'type':Sequelize[_0x4073('0x5')](_0x4073('0x6'))},'subject':{'type':Sequelize[_0x4073('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4073('0x3')]},'substatus':{'type':Sequelize[_0x4073('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x4073('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4073('0x7')]('in',_0x4073('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4073('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4073('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4073('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xac83=['out','sequelize','iconv','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0x5ae0a7,_0x3abe5b){var _0x31513c=function(_0x35f11a){while(--_0x35f11a){_0x5ae0a7['push'](_0x5ae0a7['shift']());}};_0x31513c(++_0x3abe5b);}(_0xac83,0xd9));var _0x3ac8=function(_0x1fd4d7,_0x2feafd){_0x1fd4d7=_0x1fd4d7-0x0;var _0x7efe8a=_0xac83[_0x1fd4d7];return _0x7efe8a;};'use strict';var Sequelize=require(_0x3ac8('0x0'));var iconv=require(_0x3ac8('0x1'));module['exports']={'closed':{'type':Sequelize[_0x3ac8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3ac8('0x3')]},'disposition':{'type':Sequelize[_0x3ac8('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3ac8('0x4')]},'note':{'type':Sequelize[_0x3ac8('0x4')]},'inReplyTo':{'type':Sequelize[_0x3ac8('0x4')](0x1fe)},'to':{'type':Sequelize[_0x3ac8('0x4')]},'cc':{'type':Sequelize[_0x3ac8('0x5')](_0x3ac8('0x6'))},'subject':{'type':Sequelize[_0x3ac8('0x5')]()},'attach':{'type':Sequelize[_0x3ac8('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3ac8('0x3')]},'substatus':{'type':Sequelize[_0x3ac8('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x3ac8('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3ac8('0x7')]('in',_0x3ac8('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3ac8('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3ac8('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index baafc3f..b48ed84 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 _0xc4c5=['MailMessage','ids','omit','getMessages','findOne','hasOwnProperty','nolimit','sort','where','MailInteractionId','filter','map','$gte','split','include','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','Attachments','Messages','bcc','createdAt','mkdirSync','each','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','writeFileSync','eml-format','rimraf','zip-dir','util','path','ioredis','../../components/interaction/service','../../config/logger','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','index','MailInteraction','rawAttributes','fieldName','type','key','findAll','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','create','find','body','describe','addMessage'];(function(_0x1741cb,_0x2cec67){var _0x345f0b=function(_0x462368){while(--_0x462368){_0x1741cb['push'](_0x1741cb['shift']());}};_0x345f0b(++_0x2cec67);}(_0xc4c5,0x108));var _0x5c4c=function(_0x289907,_0x2c4445){_0x289907=_0x289907-0x0;var _0x2a75ba=_0xc4c5[_0x289907];return _0x2a75ba;};'use strict';var emlformat=require(_0x5c4c('0x0'));var rimraf=require(_0x5c4c('0x1'));var zipdir=require(_0x5c4c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x5c4c('0x3'));var path=require(_0x5c4c('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x5c4c('0x5'));var interaction=require(_0x5c4c('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x5c4c('0x7'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config[_0x5c4c('0x8')]=_[_0x5c4c('0x9')](config[_0x5c4c('0x8')],{'host':_0x5c4c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5c4c('0xb'))[_0x5c4c('0xc')](socket);function respondWithStatusCode(_0x50e904,_0x1efe1f){_0x1efe1f=_0x1efe1f||0xcc;return function(_0x428764){if(_0x428764){return _0x50e904[_0x5c4c('0xd')](_0x1efe1f);}return _0x50e904['status'](_0x1efe1f)[_0x5c4c('0xe')]();};}function respondWithResult(_0x47b0b7,_0xa754da){_0xa754da=_0xa754da||0xc8;return function(_0x2c6823){if(_0x2c6823){return _0x47b0b7[_0x5c4c('0xf')](_0xa754da)[_0x5c4c('0x10')](_0x2c6823);}};}function respondWithFilteredResult(_0x3e4da7,_0x270f8a){return function(_0x3f8197){if(_0x3f8197){var _0x3d0145=typeof _0x270f8a[_0x5c4c('0x11')]===_0x5c4c('0x12')&&typeof _0x270f8a[_0x5c4c('0x13')]===_0x5c4c('0x12');var _0x318ff6=_0x3f8197['count'];var _0x11991a=_0x3d0145?0x0:_0x270f8a[_0x5c4c('0x11')];var _0x541583=_0x3d0145?_0x3f8197[_0x5c4c('0x14')]:_0x270f8a[_0x5c4c('0x11')]+_0x270f8a[_0x5c4c('0x13')];var _0x2dfc9b;if(_0x541583>=_0x318ff6){_0x541583=_0x318ff6;_0x2dfc9b=0xc8;}else{_0x2dfc9b=0xce;}_0x3e4da7[_0x5c4c('0xf')](_0x2dfc9b);return _0x3e4da7[_0x5c4c('0x15')](_0x5c4c('0x16'),_0x11991a+'-'+_0x541583+'/'+_0x318ff6)['json'](_0x3f8197);}return null;};}function saveUpdates(_0x59de29){return function(_0x4442bc){if(_0x4442bc){return _0x4442bc[_0x5c4c('0x17')](_0x59de29)['then'](function(_0x31eee3){return _0x31eee3;});}return null;};}function removeEntity(_0x50de95){return function(_0x4e39b1){if(_0x4e39b1){return _0x4e39b1[_0x5c4c('0x18')]()[_0x5c4c('0x19')](function(){_0x50de95[_0x5c4c('0xf')](0xcc)[_0x5c4c('0xe')]();});}};}function handleEntityNotFound(_0x2fb629){return function(_0x315d20){if(!_0x315d20){_0x2fb629['sendStatus'](0x194);}return _0x315d20;};}function handleError(_0x1368af,_0x231ea0){_0x231ea0=_0x231ea0||0x1f4;return function(_0x5a41cd){logger[_0x5c4c('0x1a')](_0x5a41cd[_0x5c4c('0x1b')]);if(_0x5a41cd['name']){delete _0x5a41cd[_0x5c4c('0x1c')];}_0x1368af['status'](_0x231ea0)[_0x5c4c('0x1d')](_0x5a41cd);};}exports[_0x5c4c('0x1e')]=function(_0x52b7d0,_0x23758d){var _0x373e5d={};var _0x242e3b=_['map'](db[_0x5c4c('0x1f')][_0x5c4c('0x20')],function(_0x36df7e){return{'name':_0x36df7e[_0x5c4c('0x21')],'type':_0x36df7e[_0x5c4c('0x22')][_0x5c4c('0x23')]};});_0x373e5d=qs['getOptions'](_0x242e3b,_0x52b7d0);return interaction[_0x5c4c('0x24')]('mail',_0x52b7d0[_0x5c4c('0x25')],_0x52b7d0[_0x5c4c('0x26')],_0x373e5d,_0x242e3b)['then'](respondWithFilteredResult(_0x23758d,_0x373e5d))[_0x5c4c('0x27')](handleError(_0x23758d,null));};exports[_0x5c4c('0x28')]=function(_0x859dd4,_0x2dc87b){var _0x5d532b={'raw':![],'where':{'id':_0x859dd4[_0x5c4c('0x29')]['id']}},_0x45e0a7={};_0x45e0a7[_0x5c4c('0x2a')]=_[_0x5c4c('0x2b')](db['MailInteraction']['rawAttributes']);_0x45e0a7['query']=_['keys'](_0x859dd4[_0x5c4c('0x25')]);_0x45e0a7[_0x5c4c('0x2c')]=_[_0x5c4c('0x2d')](_0x45e0a7['model'],_0x45e0a7[_0x5c4c('0x25')]);_0x5d532b[_0x5c4c('0x2e')]=_['intersection'](_0x45e0a7['model'],qs[_0x5c4c('0x2f')](_0x859dd4[_0x5c4c('0x25')]['fields']));_0x5d532b['attributes']=_0x5d532b[_0x5c4c('0x2e')][_0x5c4c('0x30')]?_0x5d532b[_0x5c4c('0x2e')]:_0x45e0a7[_0x5c4c('0x2a')];if(_0x859dd4['query'][_0x5c4c('0x31')]){_0x5d532b['include']=[{'all':!![]}];}_0x5d532b=_[_0x5c4c('0x32')]({},_0x5d532b,_0x859dd4[_0x5c4c('0x33')]);return db['MailInteraction']['find'](_0x5d532b)[_0x5c4c('0x19')](handleEntityNotFound(_0x2dc87b,null))[_0x5c4c('0x19')](respondWithResult(_0x2dc87b,null))['catch'](handleError(_0x2dc87b,null));};exports['create']=function(_0x23ee1a,_0x45f80a){return db[_0x5c4c('0x1f')][_0x5c4c('0x34')](_0x23ee1a['body'],{})[_0x5c4c('0x19')](respondWithResult(_0x45f80a,0xc9))[_0x5c4c('0x27')](handleError(_0x45f80a,null));};exports[_0x5c4c('0x17')]=function(_0x5a3291,_0x39cdb3){if(_0x5a3291['body']['id']){delete _0x5a3291['body']['id'];}return db[_0x5c4c('0x1f')][_0x5c4c('0x35')]({'where':{'id':_0x5a3291[_0x5c4c('0x29')]['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x39cdb3,null))[_0x5c4c('0x19')](saveUpdates(_0x5a3291[_0x5c4c('0x36')],null))[_0x5c4c('0x19')](respondWithResult(_0x39cdb3,null))['catch'](handleError(_0x39cdb3,null));};exports[_0x5c4c('0x18')]=function(_0x3eb1b1,_0x23a730){return db[_0x5c4c('0x1f')][_0x5c4c('0x35')]({'where':{'id':_0x3eb1b1[_0x5c4c('0x29')]['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x23a730,null))[_0x5c4c('0x19')](removeEntity(_0x23a730,null))[_0x5c4c('0x27')](handleError(_0x23a730,null));};exports['describe']=function(_0x1578f3,_0x2d5c4f){return db[_0x5c4c('0x1f')][_0x5c4c('0x37')]()[_0x5c4c('0x19')](respondWithResult(_0x2d5c4f,null))[_0x5c4c('0x27')](handleError(_0x2d5c4f,null));};exports[_0x5c4c('0x38')]=function(_0x14bf45,_0x52bade){return db[_0x5c4c('0x39')]['find']({'where':{'id':_0x14bf45['params']['id']}})['then'](handleEntityNotFound(_0x52bade,null))['then'](function(_0x4dfba5){if(_0x4dfba5){return _0x4dfba5[_0x5c4c('0x38')](_0x14bf45[_0x5c4c('0x36')][_0x5c4c('0x3a')],_[_0x5c4c('0x3b')](_0x14bf45[_0x5c4c('0x36')],['ids','id'])||{});}})[_0x5c4c('0x19')](respondWithResult(_0x52bade,null))[_0x5c4c('0x27')](handleError(_0x52bade,null));};exports[_0x5c4c('0x3c')]=function(_0x2d0e8a,_0x589566){var _0x503be6={'raw':![],'where':{}};var _0x34e896={};var _0x525dcd={'count':0x0,'rows':[]};return db[_0x5c4c('0x1f')][_0x5c4c('0x3d')]({'where':{'id':_0x2d0e8a[_0x5c4c('0x29')]['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x589566,null))[_0x5c4c('0x19')](function(_0x3edde1){if(_0x3edde1){_0x34e896[_0x5c4c('0x2a')]=_[_0x5c4c('0x2b')](db[_0x5c4c('0x39')]['rawAttributes']);_0x34e896[_0x5c4c('0x25')]=_['keys'](_0x2d0e8a[_0x5c4c('0x25')]);_0x34e896[_0x5c4c('0x2c')]=_[_0x5c4c('0x2d')](_0x34e896[_0x5c4c('0x2a')],_0x34e896[_0x5c4c('0x25')]);_0x503be6['attributes']=_[_0x5c4c('0x2d')](_0x34e896[_0x5c4c('0x2a')],qs['fields'](_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x2f')]));_0x503be6[_0x5c4c('0x2e')]=_0x503be6[_0x5c4c('0x2e')]['length']?_0x503be6[_0x5c4c('0x2e')]:_0x34e896['model'];if(!_0x2d0e8a['query'][_0x5c4c('0x3e')](_0x5c4c('0x3f'))){_0x503be6[_0x5c4c('0x13')]=qs['limit'](_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x13')]);_0x503be6[_0x5c4c('0x11')]=qs['offset'](_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x11')]);}_0x503be6['order']=qs[_0x5c4c('0x40')](_0x2d0e8a['query']['sort']);_0x503be6[_0x5c4c('0x41')]=qs[_0x5c4c('0x2c')](_['pick'](_0x2d0e8a[_0x5c4c('0x25')],_0x34e896[_0x5c4c('0x2c')]));_0x503be6[_0x5c4c('0x41')][_0x5c4c('0x42')]=_0x3edde1['id'];if(_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x43')]){_0x503be6[_0x5c4c('0x41')]=_[_0x5c4c('0x32')](_0x503be6[_0x5c4c('0x41')],{'$or':_[_0x5c4c('0x44')](_0x503be6[_0x5c4c('0x2e')],function(_0xc284d){var _0xbca93d={};_0xbca93d[_0xc284d]={'$like':'%'+_0x2d0e8a[_0x5c4c('0x25')][_0x5c4c('0x43')]+'%'};return _0xbca93d;})});}if(_0x2d0e8a['query'][_0x5c4c('0x45')]){var _0x323ab0=_0x2d0e8a['query'][_0x5c4c('0x45')][_0x5c4c('0x46')](',');var _0x1073bf={};_0x1073bf[_0x323ab0[0x0]]={'$gte':moment(_0x323ab0[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x503be6[_0x5c4c('0x41')]=_[_0x5c4c('0x32')](_0x503be6[_0x5c4c('0x41')],_0x1073bf);}_0x503be6=_['merge']({},_0x503be6,_0x2d0e8a[_0x5c4c('0x33')]);return db['MailMessage'][_0x5c4c('0x14')]({'where':_0x503be6[_0x5c4c('0x41')]})['then'](function(_0x18a268){_0x525dcd[_0x5c4c('0x14')]=_0x18a268;if(_0x2d0e8a[_0x5c4c('0x25')]['includeAll']){_0x503be6[_0x5c4c('0x47')]=[{'all':!![]}];}return db[_0x5c4c('0x39')][_0x5c4c('0x24')](_0x503be6);})[_0x5c4c('0x19')](function(_0x4d9310){if(_0x2d0e8a[_0x5c4c('0x25')]['inlineCss']==='true'){for(var _0x10b58f=0x0;_0x10b58f<_0x4d9310[_0x5c4c('0x30')];_0x10b58f++){_0x4d9310[_0x10b58f][_0x5c4c('0x36')]=juice(_0x4d9310[_0x10b58f]['body']);}}_0x525dcd[_0x5c4c('0x48')]=_0x4d9310;return _0x525dcd;});}})[_0x5c4c('0x19')](respondWithFilteredResult(_0x589566,_0x503be6))[_0x5c4c('0x27')](handleError(_0x589566,null));};exports[_0x5c4c('0x49')]=function(_0x3a26b0,_0x389edd){return db['MailInteraction'][_0x5c4c('0x35')]({'where':{'id':_0x3a26b0[_0x5c4c('0x29')]['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x389edd,null))[_0x5c4c('0x19')](function(_0x504746){if(_0x504746){return _0x504746[_0x5c4c('0x4a')](_0x3a26b0[_0x5c4c('0x36')][_0x5c4c('0x3a')],_[_0x5c4c('0x3b')](_0x3a26b0[_0x5c4c('0x36')],[_0x5c4c('0x3a'),'id'])||{})[_0x5c4c('0x4b')](function(){return db[_0x5c4c('0x4c')][_0x5c4c('0x24')]({'attributes':['id',_0x5c4c('0x1c'),_0x5c4c('0x4d')],'where':{'id':_0x3a26b0[_0x5c4c('0x36')][_0x5c4c('0x3a')]}});})[_0x5c4c('0x19')](function(_0x15ec37){socket[_0x5c4c('0x4e')](_0x5c4c('0x4f'),{'id':Number(_0x3a26b0[_0x5c4c('0x29')]['id']),'tags':_0x15ec37||[]});return{'id':Number(_0x3a26b0[_0x5c4c('0x29')]['id']),'tags':_0x15ec37||[]};});}})[_0x5c4c('0x19')](respondWithResult(_0x389edd,null))[_0x5c4c('0x27')](handleError(_0x389edd,null));};exports[_0x5c4c('0x50')]=function(_0x5b6655,_0x25bfd7){return db['MailInteraction'][_0x5c4c('0x35')]({'where':{'id':_0x5b6655['params']['id']}})[_0x5c4c('0x19')](handleEntityNotFound(_0x25bfd7,null))[_0x5c4c('0x19')](function(_0x3eb068){if(_0x3eb068){return _0x3eb068[_0x5c4c('0x50')](_0x5b6655['query'][_0x5c4c('0x3a')]);}})[_0x5c4c('0x19')](respondWithStatusCode(_0x25bfd7,null))[_0x5c4c('0x27')](handleError(_0x25bfd7,null));};exports[_0x5c4c('0x51')]=function(_0xa302b7,_0x2fdae0){var _0xe9ef7e=moment()[_0x5c4c('0x52')]()[_0x5c4c('0x53')]();var _0x570d2f=path[_0x5c4c('0x54')](config[_0x5c4c('0x55')],_0x5c4c('0x56'),_0x5c4c('0x57'),_0x5c4c('0x58'));var _0x38b74c=path[_0x5c4c('0x54')](config[_0x5c4c('0x55')],_0x5c4c('0x56'),_0x5c4c('0x57'),_0x5c4c('0x59'));var _0x412f78=path['join'](_0x570d2f,_0xe9ef7e);var _0x2d0fa5=util[_0x5c4c('0x5a')](_0x5c4c('0x5b'),_0xa302b7[_0x5c4c('0x29')]['id'],_0xe9ef7e);var _0xf8d48=path['join'](_0x570d2f,_0x2d0fa5);var _0x57d4b4=[];if(_0xa302b7[_0x5c4c('0x25')][_0x5c4c('0x59')]){_0x57d4b4[_0x5c4c('0x5c')]({'model':db['Attachment'],'as':_0x5c4c('0x5d'),'raw':!![]});}var _0x591228=[{'model':db[_0x5c4c('0x39')],'as':_0x5c4c('0x5e'),'attributes':['id',_0x5c4c('0x36'),'from','to','cc',_0x5c4c('0x5f'),'subject',_0x5c4c('0x60')],'where':{'secret':![]},'order':qs[_0x5c4c('0x40')]('id'),'include':_0x57d4b4}];return db[_0x5c4c('0x1f')][_0x5c4c('0x35')]({'where':{'id':_0xa302b7[_0x5c4c('0x29')]['id']},'include':_0x591228})['then'](handleEntityNotFound(_0x2fdae0,null))[_0x5c4c('0x19')](function(_0x181a6b){if(_0x181a6b&&_0x181a6b[_0x5c4c('0x5e')]){var _0x557da1=_0x181a6b['get']({'plain':!![]});fs[_0x5c4c('0x61')](_0x412f78);return BPromise[_0x5c4c('0x62')](_0x557da1[_0x5c4c('0x5e')],function(_0x11a614,_0x3866e9){var _0x4edd74={'from':_0x11a614[_0x5c4c('0x63')],'to':_0x11a614['to']||'missing.recipient@your.company.com','subject':_0x11a614['subject'],'html':htmlEntities[_0x5c4c('0x64')](_0x11a614[_0x5c4c('0x36')]),'headers':{'Date':moment(_0x11a614[_0x5c4c('0x60')])['format'](_0x5c4c('0x65'))},'attachments':[]};if(_0x11a614['cc']){_0x4edd74[_0x5c4c('0x66')]['Cc']=_0x11a614['cc'];}if(_0x11a614[_0x5c4c('0x5f')]){_0x4edd74[_0x5c4c('0x66')][_0x5c4c('0x67')]=_0x11a614[_0x5c4c('0x5f')];}return new BPromise(function(_0x53ae7a,_0x1fef9e){if(_0x11a614['Attachments']){for(var _0x25ba5c=0x0;_0x25ba5c<_0x11a614['Attachments'][_0x5c4c('0x30')];_0x25ba5c++){var _0xe1832=_0x11a614[_0x5c4c('0x5d')][_0x25ba5c];var _0x32c6c3=path['join'](_0x38b74c,_0xe1832['basename']);if(fs[_0x5c4c('0x68')](_0x32c6c3)){_0x4edd74['attachments'][_0x5c4c('0x5c')]({'name':_0xe1832[_0x5c4c('0x1c')],'contentType':_0xe1832['type'],'data':fs[_0x5c4c('0x69')](_0x32c6c3)});}}}emlformat['build'](_0x4edd74,function(_0x4fe3fe,_0x27a7c5){if(_0x4fe3fe)return _0x1fef9e(_0x4fe3fe);fs[_0x5c4c('0x6a')](path['join'](_0x412f78,util[_0x5c4c('0x5a')]('message%d.eml',_0x3866e9)),_0x27a7c5);return _0x53ae7a(_0x27a7c5);});});})['then'](function(){return new BPromise(function(_0x10fe83,_0xbc76c4){zipdir(_0x412f78,{'saveTo':_0xf8d48},function(_0x5ee7d1,_0x34f1eb){if(_0x5ee7d1)return _0xbc76c4(_0x5ee7d1);return _0x10fe83(_0x34f1eb);});})[_0x5c4c('0x19')](function(){return new BPromise(function(_0x39b5df,_0x71617b){rimraf(_0x412f78,function(_0x46407b){if(_0x46407b)_0x71617b(_0x46407b);return _0x39b5df();});});})['then'](function(){return _0x2fdae0[_0x5c4c('0x51')](_0xf8d48,_0x2d0fa5,function(_0x48376d){if(!_0x48376d)fs['unlinkSync'](_0xf8d48);});});});}else{return _0x2fdae0[_0x5c4c('0xd')](0xc8);}})[_0x5c4c('0x27')](handleError(_0x2fdae0,null));}; \ No newline at end of file +var _0xedd0=['transcript-%d-%s.zip','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','mkdirSync','each','decode','format','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','zip-dir','bluebird','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','register','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','destroy','then','error','stack','name','send','map','MailInteraction','rawAttributes','type','key','getOptions','findAll','query','user','catch','show','params','keys','filters','attributes','intersection','model','fields','length','merge','options','find','create','update','body','describe','addMessage','MailMessage','ids','omit','nolimit','order','where','pick','filter','$gte','includeAll','include','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','join','files','tmp','root','attachments'];(function(_0x524a5a,_0x9f0414){var _0x1475c3=function(_0xd01c04){while(--_0xd01c04){_0x524a5a['push'](_0x524a5a['shift']());}};_0x1475c3(++_0x9f0414);}(_0xedd0,0x7e));var _0x0edd=function(_0x17b5b4,_0x584e6e){_0x17b5b4=_0x17b5b4-0x0;var _0x5e6812=_0xedd0[_0x17b5b4];return _0x5e6812;};'use strict';var emlformat=require(_0x0edd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0edd('0x1'));var moment=require('moment');var BPromise=require(_0x0edd('0x2'));var util=require(_0x0edd('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0edd('0x4'));var juice=require(_0x0edd('0x5'));var Redis=require(_0x0edd('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x0edd('0x7'));var logger=require(_0x0edd('0x8'))(_0x0edd('0x9'));var config=require(_0x0edd('0xa'));var db=require(_0x0edd('0xb'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0x0edd('0xc')](config['redis'],{'host':_0x0edd('0xd'),'port':0x18eb});var socket=require(_0x0edd('0xe'))(new Redis(config[_0x0edd('0xf')]));require(_0x0edd('0x10'))[_0x0edd('0x11')](socket);function respondWithStatusCode(_0x1966ec,_0x1498e0){_0x1498e0=_0x1498e0||0xcc;return function(_0x2f9150){if(_0x2f9150){return _0x1966ec[_0x0edd('0x12')](_0x1498e0);}return _0x1966ec[_0x0edd('0x13')](_0x1498e0)[_0x0edd('0x14')]();};}function respondWithResult(_0x28dce6,_0x27e96b){_0x27e96b=_0x27e96b||0xc8;return function(_0x354adf){if(_0x354adf){return _0x28dce6[_0x0edd('0x13')](_0x27e96b)[_0x0edd('0x15')](_0x354adf);}};}function respondWithFilteredResult(_0x4bc0ed,_0x3be1fd){return function(_0x5c1ad5){if(_0x5c1ad5){var _0x5f6a92=typeof _0x3be1fd['offset']===_0x0edd('0x16')&&typeof _0x3be1fd[_0x0edd('0x17')]===_0x0edd('0x16');var _0x38cef4=_0x5c1ad5['count'];var _0x3fce9d=_0x5f6a92?0x0:_0x3be1fd[_0x0edd('0x18')];var _0x35ef02=_0x5f6a92?_0x5c1ad5[_0x0edd('0x19')]:_0x3be1fd['offset']+_0x3be1fd[_0x0edd('0x17')];var _0x23aabe;if(_0x35ef02>=_0x38cef4){_0x35ef02=_0x38cef4;_0x23aabe=0xc8;}else{_0x23aabe=0xce;}_0x4bc0ed[_0x0edd('0x13')](_0x23aabe);return _0x4bc0ed[_0x0edd('0x1a')](_0x0edd('0x1b'),_0x3fce9d+'-'+_0x35ef02+'/'+_0x38cef4)[_0x0edd('0x15')](_0x5c1ad5);}return null;};}function saveUpdates(_0x208a0e){return function(_0x53262a){if(_0x53262a){return _0x53262a['update'](_0x208a0e)['then'](function(_0x1a6921){return _0x1a6921;});}return null;};}function removeEntity(_0x191501){return function(_0x49a977){if(_0x49a977){return _0x49a977[_0x0edd('0x1c')]()[_0x0edd('0x1d')](function(){_0x191501[_0x0edd('0x13')](0xcc)[_0x0edd('0x14')]();});}};}function handleEntityNotFound(_0xfeaa5f){return function(_0x59ae6f){if(!_0x59ae6f){_0xfeaa5f['sendStatus'](0x194);}return _0x59ae6f;};}function handleError(_0x6b1cab,_0xae7ac3){_0xae7ac3=_0xae7ac3||0x1f4;return function(_0x1ac18d){logger[_0x0edd('0x1e')](_0x1ac18d[_0x0edd('0x1f')]);if(_0x1ac18d[_0x0edd('0x20')]){delete _0x1ac18d['name'];}_0x6b1cab[_0x0edd('0x13')](_0xae7ac3)[_0x0edd('0x21')](_0x1ac18d);};}exports['index']=function(_0x2444af,_0x15d734){var _0x4407e7={};var _0x44071b=_[_0x0edd('0x22')](db[_0x0edd('0x23')][_0x0edd('0x24')],function(_0x44ba5f){return{'name':_0x44ba5f['fieldName'],'type':_0x44ba5f[_0x0edd('0x25')][_0x0edd('0x26')]};});_0x4407e7=qs[_0x0edd('0x27')](_0x44071b,_0x2444af);return interaction[_0x0edd('0x28')]('mail',_0x2444af[_0x0edd('0x29')],_0x2444af[_0x0edd('0x2a')],_0x4407e7,_0x44071b)[_0x0edd('0x1d')](respondWithFilteredResult(_0x15d734,_0x4407e7))[_0x0edd('0x2b')](handleError(_0x15d734,null));};exports[_0x0edd('0x2c')]=function(_0x1c707b,_0x19fb97){var _0x31f895={'raw':![],'where':{'id':_0x1c707b[_0x0edd('0x2d')]['id']}},_0x4befcd={};_0x4befcd['model']=_['keys'](db[_0x0edd('0x23')][_0x0edd('0x24')]);_0x4befcd[_0x0edd('0x29')]=_[_0x0edd('0x2e')](_0x1c707b[_0x0edd('0x29')]);_0x4befcd[_0x0edd('0x2f')]=_['intersection'](_0x4befcd['model'],_0x4befcd[_0x0edd('0x29')]);_0x31f895[_0x0edd('0x30')]=_[_0x0edd('0x31')](_0x4befcd[_0x0edd('0x32')],qs['fields'](_0x1c707b[_0x0edd('0x29')][_0x0edd('0x33')]));_0x31f895[_0x0edd('0x30')]=_0x31f895['attributes'][_0x0edd('0x34')]?_0x31f895['attributes']:_0x4befcd['model'];if(_0x1c707b[_0x0edd('0x29')]['includeAll']){_0x31f895['include']=[{'all':!![]}];}_0x31f895=_[_0x0edd('0x35')]({},_0x31f895,_0x1c707b[_0x0edd('0x36')]);return db[_0x0edd('0x23')][_0x0edd('0x37')](_0x31f895)[_0x0edd('0x1d')](handleEntityNotFound(_0x19fb97,null))['then'](respondWithResult(_0x19fb97,null))['catch'](handleError(_0x19fb97,null));};exports[_0x0edd('0x38')]=function(_0x617610,_0x19ae59){return db['MailInteraction'][_0x0edd('0x38')](_0x617610['body'],{})[_0x0edd('0x1d')](respondWithResult(_0x19ae59,0xc9))[_0x0edd('0x2b')](handleError(_0x19ae59,null));};exports[_0x0edd('0x39')]=function(_0x1e2afc,_0x4d7acf){if(_0x1e2afc[_0x0edd('0x3a')]['id']){delete _0x1e2afc[_0x0edd('0x3a')]['id'];}return db[_0x0edd('0x23')][_0x0edd('0x37')]({'where':{'id':_0x1e2afc['params']['id']}})[_0x0edd('0x1d')](handleEntityNotFound(_0x4d7acf,null))[_0x0edd('0x1d')](saveUpdates(_0x1e2afc[_0x0edd('0x3a')],null))[_0x0edd('0x1d')](respondWithResult(_0x4d7acf,null))['catch'](handleError(_0x4d7acf,null));};exports[_0x0edd('0x1c')]=function(_0x261033,_0xd59f34){return db[_0x0edd('0x23')][_0x0edd('0x37')]({'where':{'id':_0x261033[_0x0edd('0x2d')]['id']}})['then'](handleEntityNotFound(_0xd59f34,null))[_0x0edd('0x1d')](removeEntity(_0xd59f34,null))['catch'](handleError(_0xd59f34,null));};exports[_0x0edd('0x3b')]=function(_0x7d62a,_0x5d9366){return db[_0x0edd('0x23')]['describe']()['then'](respondWithResult(_0x5d9366,null))[_0x0edd('0x2b')](handleError(_0x5d9366,null));};exports[_0x0edd('0x3c')]=function(_0x200778,_0x4892b1){return db[_0x0edd('0x3d')][_0x0edd('0x37')]({'where':{'id':_0x200778[_0x0edd('0x2d')]['id']}})[_0x0edd('0x1d')](handleEntityNotFound(_0x4892b1,null))[_0x0edd('0x1d')](function(_0x1a4f62){if(_0x1a4f62){return _0x1a4f62[_0x0edd('0x3c')](_0x200778[_0x0edd('0x3a')][_0x0edd('0x3e')],_[_0x0edd('0x3f')](_0x200778[_0x0edd('0x3a')],['ids','id'])||{});}})[_0x0edd('0x1d')](respondWithResult(_0x4892b1,null))[_0x0edd('0x2b')](handleError(_0x4892b1,null));};exports['getMessages']=function(_0x4df333,_0x46fbb5){var _0x2857e6={'raw':![],'where':{}};var _0x143139={};var _0x3ec4aa={'count':0x0,'rows':[]};return db[_0x0edd('0x23')]['findOne']({'where':{'id':_0x4df333[_0x0edd('0x2d')]['id']}})[_0x0edd('0x1d')](handleEntityNotFound(_0x46fbb5,null))[_0x0edd('0x1d')](function(_0x2f83ed){if(_0x2f83ed){_0x143139[_0x0edd('0x32')]=_[_0x0edd('0x2e')](db[_0x0edd('0x3d')][_0x0edd('0x24')]);_0x143139[_0x0edd('0x29')]=_[_0x0edd('0x2e')](_0x4df333[_0x0edd('0x29')]);_0x143139[_0x0edd('0x2f')]=_['intersection'](_0x143139[_0x0edd('0x32')],_0x143139[_0x0edd('0x29')]);_0x2857e6['attributes']=_[_0x0edd('0x31')](_0x143139['model'],qs[_0x0edd('0x33')](_0x4df333[_0x0edd('0x29')][_0x0edd('0x33')]));_0x2857e6[_0x0edd('0x30')]=_0x2857e6[_0x0edd('0x30')]['length']?_0x2857e6[_0x0edd('0x30')]:_0x143139[_0x0edd('0x32')];if(!_0x4df333[_0x0edd('0x29')]['hasOwnProperty'](_0x0edd('0x40'))){_0x2857e6[_0x0edd('0x17')]=qs[_0x0edd('0x17')](_0x4df333['query'][_0x0edd('0x17')]);_0x2857e6[_0x0edd('0x18')]=qs[_0x0edd('0x18')](_0x4df333['query'][_0x0edd('0x18')]);}_0x2857e6[_0x0edd('0x41')]=qs['sort'](_0x4df333[_0x0edd('0x29')]['sort']);_0x2857e6[_0x0edd('0x42')]=qs[_0x0edd('0x2f')](_[_0x0edd('0x43')](_0x4df333[_0x0edd('0x29')],_0x143139[_0x0edd('0x2f')]));_0x2857e6['where']['MailInteractionId']=_0x2f83ed['id'];if(_0x4df333['query'][_0x0edd('0x44')]){_0x2857e6[_0x0edd('0x42')]=_['merge'](_0x2857e6[_0x0edd('0x42')],{'$or':_[_0x0edd('0x22')](_0x2857e6[_0x0edd('0x30')],function(_0x29e3e7){var _0x208de6={};_0x208de6[_0x29e3e7]={'$like':'%'+_0x4df333['query'][_0x0edd('0x44')]+'%'};return _0x208de6;})});}if(_0x4df333[_0x0edd('0x29')][_0x0edd('0x45')]){var _0x1ad64c=_0x4df333[_0x0edd('0x29')]['$gte']['split'](',');var _0x3bd4ea={};_0x3bd4ea[_0x1ad64c[0x0]]={'$gte':moment(_0x1ad64c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2857e6[_0x0edd('0x42')]=_[_0x0edd('0x35')](_0x2857e6[_0x0edd('0x42')],_0x3bd4ea);}_0x2857e6=_[_0x0edd('0x35')]({},_0x2857e6,_0x4df333[_0x0edd('0x36')]);return db[_0x0edd('0x3d')]['count']({'where':_0x2857e6['where']})[_0x0edd('0x1d')](function(_0x217bac){_0x3ec4aa['count']=_0x217bac;if(_0x4df333['query'][_0x0edd('0x46')]){_0x2857e6[_0x0edd('0x47')]=[{'all':!![]}];}return db[_0x0edd('0x3d')][_0x0edd('0x28')](_0x2857e6);})['then'](function(_0x21682b){if(_0x4df333['query']['inlineCss']==='true'){for(var _0x2c4432=0x0;_0x2c4432<_0x21682b[_0x0edd('0x34')];_0x2c4432++){_0x21682b[_0x2c4432][_0x0edd('0x3a')]=juice(_0x21682b[_0x2c4432][_0x0edd('0x3a')]);}}_0x3ec4aa['rows']=_0x21682b;return _0x3ec4aa;});}})[_0x0edd('0x1d')](respondWithFilteredResult(_0x46fbb5,_0x2857e6))[_0x0edd('0x2b')](handleError(_0x46fbb5,null));};exports['addTags']=function(_0x486fa9,_0xb06d69){return db[_0x0edd('0x23')]['find']({'where':{'id':_0x486fa9[_0x0edd('0x2d')]['id']}})[_0x0edd('0x1d')](handleEntityNotFound(_0xb06d69,null))['then'](function(_0x35b567){if(_0x35b567){return _0x35b567[_0x0edd('0x48')](_0x486fa9[_0x0edd('0x3a')][_0x0edd('0x3e')],_['omit'](_0x486fa9[_0x0edd('0x3a')],[_0x0edd('0x3e'),'id'])||{})[_0x0edd('0x49')](function(){return db[_0x0edd('0x4a')][_0x0edd('0x28')]({'attributes':['id',_0x0edd('0x20'),_0x0edd('0x4b')],'where':{'id':_0x486fa9[_0x0edd('0x3a')]['ids']}});})[_0x0edd('0x1d')](function(_0x521f0e){socket[_0x0edd('0x4c')](_0x0edd('0x4d'),{'id':Number(_0x486fa9[_0x0edd('0x2d')]['id']),'tags':_0x521f0e||[]});return{'id':Number(_0x486fa9[_0x0edd('0x2d')]['id']),'tags':_0x521f0e||[]};});}})[_0x0edd('0x1d')](respondWithResult(_0xb06d69,null))[_0x0edd('0x2b')](handleError(_0xb06d69,null));};exports[_0x0edd('0x4e')]=function(_0x124565,_0x48f313){return db[_0x0edd('0x23')][_0x0edd('0x37')]({'where':{'id':_0x124565[_0x0edd('0x2d')]['id']}})[_0x0edd('0x1d')](handleEntityNotFound(_0x48f313,null))['then'](function(_0xf845f0){if(_0xf845f0){return _0xf845f0[_0x0edd('0x4e')](_0x124565[_0x0edd('0x29')]['ids']);}})[_0x0edd('0x1d')](respondWithStatusCode(_0x48f313,null))[_0x0edd('0x2b')](handleError(_0x48f313,null));};exports[_0x0edd('0x4f')]=function(_0x1cb270,_0x7c27f2){var _0x506e85=moment()[_0x0edd('0x50')]()['toString']();var _0x338e0f=path[_0x0edd('0x51')](config['root'],'server',_0x0edd('0x52'),_0x0edd('0x53'));var _0x230dc4=path[_0x0edd('0x51')](config[_0x0edd('0x54')],'server',_0x0edd('0x52'),_0x0edd('0x55'));var _0x2a7c50=path[_0x0edd('0x51')](_0x338e0f,_0x506e85);var _0x470e99=util['format'](_0x0edd('0x56'),_0x1cb270['params']['id'],_0x506e85);var _0x10920d=path[_0x0edd('0x51')](_0x338e0f,_0x470e99);var _0x6d4a50=[];if(_0x1cb270['query'][_0x0edd('0x55')]){_0x6d4a50[_0x0edd('0x57')]({'model':db[_0x0edd('0x58')],'as':_0x0edd('0x59'),'raw':!![]});}var _0x5681bf=[{'model':db[_0x0edd('0x3d')],'as':_0x0edd('0x5a'),'attributes':['id',_0x0edd('0x3a'),_0x0edd('0x5b'),'to','cc',_0x0edd('0x5c'),_0x0edd('0x5d'),_0x0edd('0x5e')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x6d4a50}];return db[_0x0edd('0x23')][_0x0edd('0x37')]({'where':{'id':_0x1cb270['params']['id']},'include':_0x5681bf})['then'](handleEntityNotFound(_0x7c27f2,null))[_0x0edd('0x1d')](function(_0x3b6e5b){if(_0x3b6e5b&&_0x3b6e5b[_0x0edd('0x5a')]){var _0x4dc555=_0x3b6e5b['get']({'plain':!![]});fs[_0x0edd('0x5f')](_0x2a7c50);return BPromise[_0x0edd('0x60')](_0x4dc555[_0x0edd('0x5a')],function(_0x4c7048,_0x1bc622){var _0x23113b={'from':_0x4c7048[_0x0edd('0x5b')],'to':_0x4c7048['to']||'missing.recipient@your.company.com','subject':_0x4c7048[_0x0edd('0x5d')],'html':htmlEntities[_0x0edd('0x61')](_0x4c7048[_0x0edd('0x3a')]),'headers':{'Date':moment(_0x4c7048[_0x0edd('0x5e')])[_0x0edd('0x62')](_0x0edd('0x63'))},'attachments':[]};if(_0x4c7048['cc']){_0x23113b['headers']['Cc']=_0x4c7048['cc'];}if(_0x4c7048[_0x0edd('0x5c')]){_0x23113b['headers']['Bcc']=_0x4c7048['bcc'];}return new BPromise(function(_0x86326,_0x562bd9){if(_0x4c7048[_0x0edd('0x59')]){for(var _0x4eba5b=0x0;_0x4eba5b<_0x4c7048[_0x0edd('0x59')]['length'];_0x4eba5b++){var _0x496839=_0x4c7048['Attachments'][_0x4eba5b];var _0x513191=path[_0x0edd('0x51')](_0x230dc4,_0x496839[_0x0edd('0x64')]);if(fs[_0x0edd('0x65')](_0x513191)){_0x23113b[_0x0edd('0x55')][_0x0edd('0x57')]({'name':_0x496839['name'],'contentType':_0x496839[_0x0edd('0x25')],'data':fs[_0x0edd('0x66')](_0x513191)});}}}emlformat[_0x0edd('0x67')](_0x23113b,function(_0x531650,_0x3810ef){if(_0x531650)return _0x562bd9(_0x531650);fs[_0x0edd('0x68')](path[_0x0edd('0x51')](_0x2a7c50,util[_0x0edd('0x62')]('message%d.eml',_0x1bc622)),_0x3810ef);return _0x86326(_0x3810ef);});});})[_0x0edd('0x1d')](function(){return new BPromise(function(_0x352e5f,_0x23159c){zipdir(_0x2a7c50,{'saveTo':_0x10920d},function(_0xa532be,_0x4e2030){if(_0xa532be)return _0x23159c(_0xa532be);return _0x352e5f(_0x4e2030);});})[_0x0edd('0x1d')](function(){return new BPromise(function(_0x36203c,_0x441f67){rimraf(_0x2a7c50,function(_0x421e63){if(_0x421e63)_0x441f67(_0x421e63);return _0x36203c();});});})[_0x0edd('0x1d')](function(){return _0x7c27f2[_0x0edd('0x4f')](_0x10920d,_0x470e99,function(_0x44108b){if(!_0x44108b)fs[_0x0edd('0x69')](_0x10920d);});});});}else{return _0x7c27f2[_0x0edd('0x12')](0xc8);}})[_0x0edd('0x2b')](handleError(_0x7c27f2,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 62375ae..2dd7eba 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 _0x4bc1=['length','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x31c19c,_0xbe4b70){var _0x1a87f7=function(_0x23cf92){while(--_0x23cf92){_0x31c19c['push'](_0x31c19c['shift']());}};_0x1a87f7(++_0xbe4b70);}(_0x4bc1,0x190));var _0x14bc=function(_0x155c2c,_0x5439b3){_0x155c2c=_0x155c2c-0x0;var _0x4b77e2=_0x4bc1[_0x155c2c];return _0x4b77e2;};'use strict';var EventEmitter=require(_0x14bc('0x0'));var MailInteraction=require(_0x14bc('0x1'))['db'][_0x14bc('0x2')];var MailMessage=require(_0x14bc('0x1'))['db'][_0x14bc('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x14bc('0x4')](0x0);var events={'afterCreate':_0x14bc('0x5'),'afterUpdate':_0x14bc('0x6'),'afterDestroy':_0x14bc('0x7')};function emitEvent(_0x1f3373){return function(_0x564016,_0xd1dce5,_0x4d1f62){_0x564016[_0x14bc('0x8')]({'attributes':['id'],'raw':!![]})[_0x14bc('0x9')](function(_0x22ece5){_0x564016[_0x14bc('0xa')](_0x14bc('0xb'),_0x22ece5[_0x14bc('0xc')](function(_0x24bbf2){return{'id':_0x24bbf2['id']};}));return MailMessage[_0x14bc('0xd')]({'where':{'MailInteractionId':_0x564016['id'],'direction':'in','read':![]},'raw':!![]});})[_0x14bc('0x9')](function(_0x334a10){_0x564016['setDataValue']('unreadMessages',_0x334a10[_0x14bc('0xe')]);MailInteractionEvents['emit'](_0x1f3373+':'+_0x564016['id'],_0x564016);MailInteractionEvents['emit'](_0x1f3373,_0x564016);_0x4d1f62(null);})['catch'](_0x4d1f62(null));};}for(var e in events){if(events[_0x14bc('0xf')](e)){var event=events[e];MailInteraction[_0x14bc('0x10')](e,emitEvent(event));}}module[_0x14bc('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x4b3a=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','Users','map','then','setDataValue'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4b3a,0x137));var _0xa4b3=function(_0x568cbc,_0x200d30){_0x568cbc=_0x568cbc-0x0;var _0x43be55=_0x4b3a[_0x568cbc];return _0x43be55;};'use strict';var EventEmitter=require(_0xa4b3('0x0'));var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require(_0xa4b3('0x1'))['db'][_0xa4b3('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xa4b3('0x3')](0x0);var events={'afterCreate':_0xa4b3('0x4'),'afterUpdate':_0xa4b3('0x5'),'afterDestroy':_0xa4b3('0x6')};function emitEvent(_0x2c43d5){return function(_0x2f8da5,_0x3c331,_0x1c7d0d){_0x2f8da5[_0xa4b3('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x21ab11){_0x2f8da5['setDataValue'](_0xa4b3('0x8'),_0x21ab11[_0xa4b3('0x9')](function(_0x2ba581){return{'id':_0x2ba581['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2f8da5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa4b3('0xa')](function(_0x53ca2f){_0x2f8da5[_0xa4b3('0xb')](_0xa4b3('0xc'),_0x53ca2f[_0xa4b3('0xd')]);MailInteractionEvents[_0xa4b3('0xe')](_0x2c43d5+':'+_0x2f8da5['id'],_0x2f8da5);MailInteractionEvents[_0xa4b3('0xe')](_0x2c43d5,_0x2f8da5);_0x1c7d0d(null);})[_0xa4b3('0xf')](_0x1c7d0d(null));};}for(var e in events){if(events[_0xa4b3('0x10')](e)){var event=events[e];MailInteraction[_0xa4b3('0x11')](e,emitEvent(event));}}module[_0xa4b3('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 8024d54..b9c25d0 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 _0x225d=['closedAt','changed','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x353c45,_0x151824){var _0x2af8ed=function(_0x173506){while(--_0x173506){_0x353c45['push'](_0x353c45['shift']());}};_0x2af8ed(++_0x151824);}(_0x225d,0xdb));var _0xd225=function(_0x466b78,_0x22380c){_0x466b78=_0x466b78-0x0;var _0x48af33=_0x225d[_0x466b78];return _0x48af33;};'use strict';var _=require(_0xd225('0x0'));var util=require(_0xd225('0x1'));var logger=require(_0xd225('0x2'))(_0xd225('0x3'));var moment=require(_0xd225('0x4'));var BPromise=require(_0xd225('0x5'));var rp=require(_0xd225('0x6'));var fs=require('fs');var path=require(_0xd225('0x7'));var rimraf=require(_0xd225('0x8'));var config=require(_0xd225('0x9'));var attributes=require(_0xd225('0xa'));module[_0xd225('0xb')]=function(_0x513ba0,_0x5d7b47){return _0x513ba0[_0xd225('0xc')]('MailInteraction',attributes,{'tableName':_0xd225('0xd'),'paranoid':![],'indexes':[{'name':_0xd225('0xe'),'fields':['subject','to'],'type':_0xd225('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xaaee5e,_0x16b5e2,_0x2a9ba2){if(_0xaaee5e[_0xd225('0x10')]){_0xaaee5e[_0xd225('0x11')]=moment()[_0xd225('0x12')](_0xd225('0x13'));}if(_0xaaee5e[_0xd225('0x14')]){_0xaaee5e[_0xd225('0x15')]=moment()[_0xd225('0x12')](_0xd225('0x13'));}_0x2a9ba2(null,_0x16b5e2);},'beforeUpdate':function(_0x4e472e,_0xbc5cc8,_0x55ffa1){if(_0x4e472e[_0xd225('0x16')](_0xd225('0x10'))){_0x4e472e['substatusAt']=_0x4e472e['substatus']?moment()[_0xd225('0x12')](_0xd225('0x13')):null;}if(_0x4e472e[_0xd225('0x16')](_0xd225('0x14'))){_0x4e472e['closedAt']=moment()['format'](_0xd225('0x13'));_0x4e472e['substatus']=null;_0x4e472e[_0xd225('0x11')]=null;}_0x55ffa1(null,_0x4e472e);},'afterUpdate':function(_0x45636b,_0x535163,_0x1d5851){var _0x41421a=_0x513ba0[_0xd225('0x17')];var _0x423a2a=_0x45636b[_0xd225('0x18')]({'plain':!![]});if(_0x423a2a[_0xd225('0x14')]){return _0x41421a[_0xd225('0x19')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x423a2a['id']}})[_0xd225('0x1a')](function(){_0x1d5851();})[_0xd225('0x1b')](function(_0x7bfb1e){_0x1d5851(_0x7bfb1e);});}else{_0x1d5851();}}},'charset':_0xd225('0x1c'),'collate':_0xd225('0x1d')});}; \ No newline at end of file +var _0x5541=['exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes'];(function(_0x232b6b,_0x584a67){var _0x2ce4a6=function(_0xfc4dc4){while(--_0xfc4dc4){_0x232b6b['push'](_0x232b6b['shift']());}};_0x2ce4a6(++_0x584a67);}(_0x5541,0xa6));var _0x1554=function(_0x408e38,_0x23cda8){_0x408e38=_0x408e38-0x0;var _0x426b0e=_0x5541[_0x408e38];return _0x426b0e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1554('0x0'))(_0x1554('0x1'));var moment=require(_0x1554('0x2'));var BPromise=require(_0x1554('0x3'));var rp=require(_0x1554('0x4'));var fs=require('fs');var path=require(_0x1554('0x5'));var rimraf=require(_0x1554('0x6'));var config=require('../../config/environment');var attributes=require(_0x1554('0x7'));module[_0x1554('0x8')]=function(_0x200bc4,_0xea2aa0){return _0x200bc4[_0x1554('0x9')](_0x1554('0xa'),attributes,{'tableName':_0x1554('0xb'),'paranoid':![],'indexes':[{'name':_0x1554('0xc'),'fields':[_0x1554('0xd'),'to'],'type':_0x1554('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xce0c0,_0x3adad0,_0x18a9bf){if(_0xce0c0['substatus']){_0xce0c0[_0x1554('0xf')]=moment()[_0x1554('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0xce0c0[_0x1554('0x11')]){_0xce0c0[_0x1554('0x12')]=moment()[_0x1554('0x10')](_0x1554('0x13'));}_0x18a9bf(null,_0x3adad0);},'beforeUpdate':function(_0x27063e,_0x320745,_0x34eee7){if(_0x27063e[_0x1554('0x14')]('substatus')){_0x27063e['substatusAt']=_0x27063e[_0x1554('0x15')]?moment()[_0x1554('0x10')](_0x1554('0x13')):null;}if(_0x27063e[_0x1554('0x14')](_0x1554('0x11'))){_0x27063e['closedAt']=moment()[_0x1554('0x10')](_0x1554('0x13'));_0x27063e[_0x1554('0x15')]=null;_0x27063e[_0x1554('0xf')]=null;}_0x34eee7(null,_0x27063e);},'afterUpdate':function(_0x4388a3,_0x160c73,_0x3a3157){var _0x2e40af=_0x200bc4[_0x1554('0x16')];var _0x49ee98=_0x4388a3[_0x1554('0x17')]({'plain':!![]});if(_0x49ee98[_0x1554('0x11')]){return _0x2e40af[_0x1554('0x18')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x49ee98['id']}})[_0x1554('0x19')](function(){_0x3a3157();})[_0x1554('0x1a')](function(_0x57613f){_0x3a3157(_0x57613f);});}else{_0x3a3157();}}},'charset':_0x1554('0x1b'),'collate':_0x1554('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 2940011..ac9b3b4 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 _0xe5e0=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','update','body','options','raw','where','limit','UpdateMailInteraction','AddTagsToMailInteraction','MailInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe5e0,0x1be));var _0x0e5e=function(_0x3bb0a3,_0x1163bf){_0x3bb0a3=_0x3bb0a3-0x0;var _0x1aeb1f=_0xe5e0[_0x3bb0a3];return _0x1aeb1f;};'use strict';var _=require(_0x0e5e('0x0'));var util=require(_0x0e5e('0x1'));var moment=require(_0x0e5e('0x2'));var BPromise=require(_0x0e5e('0x3'));var rs=require(_0x0e5e('0x4'));var fs=require('fs');var Redis=require(_0x0e5e('0x5'));var db=require(_0x0e5e('0x6'))['db'];var utils=require(_0x0e5e('0x7'));var logger=require(_0x0e5e('0x8'))('rpc');var config=require(_0x0e5e('0x9'));var jayson=require(_0x0e5e('0xa'));var client=jayson[_0x0e5e('0xb')]['http']({'port':0x232a});config[_0x0e5e('0xc')]=_[_0x0e5e('0xd')](config[_0x0e5e('0xc')],{'host':_0x0e5e('0xe'),'port':0x18eb});var socket=require(_0x0e5e('0xf'))(new Redis(config[_0x0e5e('0xc')]));require(_0x0e5e('0x10'))['register'](socket);function respondWithRpcPromise(_0x5d5366,_0x531bf8,_0x4241ea){return new BPromise(function(_0x17a208,_0x5a88de){return client['request'](_0x5d5366,_0x4241ea)[_0x0e5e('0x11')](function(_0x3ee826){logger[_0x0e5e('0x12')](_0x0e5e('0x13'),_0x531bf8,'request\x20sent');logger[_0x0e5e('0x14')](_0x0e5e('0x15'),_0x531bf8,'request\x20sent',JSON[_0x0e5e('0x16')](_0x3ee826));if(_0x3ee826[_0x0e5e('0x17')]){if(_0x3ee826[_0x0e5e('0x17')]['code']===0x1f4){logger[_0x0e5e('0x17')](_0x0e5e('0x13'),_0x531bf8,_0x3ee826[_0x0e5e('0x17')][_0x0e5e('0x18')]);return _0x5a88de(_0x3ee826[_0x0e5e('0x17')][_0x0e5e('0x18')]);}logger['error'](_0x0e5e('0x13'),_0x531bf8,_0x3ee826[_0x0e5e('0x17')][_0x0e5e('0x18')]);return _0x17a208(_0x3ee826[_0x0e5e('0x17')][_0x0e5e('0x18')]);}else{logger['info'](_0x0e5e('0x13'),_0x531bf8,_0x0e5e('0x19'));_0x17a208(_0x3ee826['result'][_0x0e5e('0x18')]);}})[_0x0e5e('0x1a')](function(_0x56cc12){logger[_0x0e5e('0x17')](_0x0e5e('0x13'),_0x531bf8,_0x56cc12);_0x5a88de(_0x56cc12);});});}exports['UpdateMailInteraction']=function(_0x422c08){var _0x485b97=this;return new Promise(function(_0x3659d9,_0x56dcc9){return db['MailInteraction'][_0x0e5e('0x1b')](_0x422c08[_0x0e5e('0x1c')],{'raw':_0x422c08[_0x0e5e('0x1d')]?_0x422c08[_0x0e5e('0x1d')][_0x0e5e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x422c08[_0x0e5e('0x1d')]?_0x422c08[_0x0e5e('0x1d')][_0x0e5e('0x1f')]||null:null,'attributes':_0x422c08[_0x0e5e('0x1d')]?_0x422c08[_0x0e5e('0x1d')]['attributes']||null:null,'limit':_0x422c08[_0x0e5e('0x1d')]?_0x422c08[_0x0e5e('0x1d')][_0x0e5e('0x20')]||null:null})[_0x0e5e('0x11')](function(_0x553208){logger[_0x0e5e('0x12')](_0x0e5e('0x21'),_0x422c08);logger['debug'](_0x0e5e('0x21'),_0x422c08,JSON['stringify'](_0x553208));_0x3659d9(_0x553208);})[_0x0e5e('0x1a')](function(_0x2f789a){logger['error'](_0x0e5e('0x21'),_0x2f789a[_0x0e5e('0x18')],_0x422c08);_0x56dcc9(_0x485b97[_0x0e5e('0x17')](0x1f4,_0x2f789a['message']));});});};exports[_0x0e5e('0x22')]=function(_0x57b970){return new Promise(function(_0x343eb2,_0x2d5cc0){return db[_0x0e5e('0x23')]['find']({'where':_0x57b970[_0x0e5e('0x1d')]?_0x57b970[_0x0e5e('0x1d')][_0x0e5e('0x1f')]||null:null})[_0x0e5e('0x11')](function(_0x348684){if(_0x348684){return _0x348684[_0x0e5e('0x24')](_0x57b970[_0x0e5e('0x1c')]['ids'],_[_0x0e5e('0x25')](_0x57b970[_0x0e5e('0x1c')],[_0x0e5e('0x26'),'id'])||{});}})[_0x0e5e('0x27')](function(_0x4f3d67){logger['info']('AddTags',_0x57b970);logger['debug'](_0x0e5e('0x28'),_0x57b970,JSON['stringify'](_0x4f3d67));_0x343eb2(_0x4f3d67);})[_0x0e5e('0x1a')](function(_0x40a27c){logger[_0x0e5e('0x17')]('AddTags',_0x40a27c[_0x0e5e('0x18')],_0x57b970);_0x2d5cc0(_this['error'](0x1f4,_0x40a27c['message']));});});}; \ No newline at end of file +var _0xa51f=['debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','body','options','raw','limit','stringify','catch','find','where','ids','AddTags','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','redis','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent'];(function(_0x4e922d,_0x2952ad){var _0x57a8e1=function(_0x5ec0df){while(--_0x5ec0df){_0x4e922d['push'](_0x4e922d['shift']());}};_0x57a8e1(++_0x2952ad);}(_0xa51f,0x1d9));var _0xfa51=function(_0x139eb2,_0x3d7e18){_0x139eb2=_0x139eb2-0x0;var _0x2a5657=_0xa51f[_0x139eb2];return _0x2a5657;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa51('0x0'));var BPromise=require('bluebird');var rs=require(_0xfa51('0x1'));var fs=require('fs');var Redis=require(_0xfa51('0x2'));var db=require(_0xfa51('0x3'))['db'];var utils=require(_0xfa51('0x4'));var logger=require('../../config/logger')(_0xfa51('0x5'));var config=require(_0xfa51('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa51('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xfa51('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xfa51('0x9'))(new Redis(config[_0xfa51('0x8')]));require(_0xfa51('0xa'))[_0xfa51('0xb')](socket);function respondWithRpcPromise(_0x312b40,_0xa77167,_0x4265c0){return new BPromise(function(_0x1e88a6,_0x3efc9d){return client[_0xfa51('0xc')](_0x312b40,_0x4265c0)[_0xfa51('0xd')](function(_0xd2d8b0){logger[_0xfa51('0xe')](_0xfa51('0xf'),_0xa77167,_0xfa51('0x10'));logger[_0xfa51('0x11')](_0xfa51('0x12'),_0xa77167,_0xfa51('0x10'),JSON['stringify'](_0xd2d8b0));if(_0xd2d8b0[_0xfa51('0x13')]){if(_0xd2d8b0['error'][_0xfa51('0x14')]===0x1f4){logger[_0xfa51('0x13')](_0xfa51('0xf'),_0xa77167,_0xd2d8b0[_0xfa51('0x13')][_0xfa51('0x15')]);return _0x3efc9d(_0xd2d8b0[_0xfa51('0x13')][_0xfa51('0x15')]);}logger[_0xfa51('0x13')]('MailInteraction,\x20%s,\x20%s',_0xa77167,_0xd2d8b0[_0xfa51('0x13')][_0xfa51('0x15')]);return _0x1e88a6(_0xd2d8b0[_0xfa51('0x13')][_0xfa51('0x15')]);}else{logger[_0xfa51('0xe')]('MailInteraction,\x20%s,\x20%s',_0xa77167,_0xfa51('0x10'));_0x1e88a6(_0xd2d8b0[_0xfa51('0x16')]['message']);}})['catch'](function(_0x3cc802){logger[_0xfa51('0x13')]('MailInteraction,\x20%s,\x20%s',_0xa77167,_0x3cc802);_0x3efc9d(_0x3cc802);});});}exports[_0xfa51('0x17')]=function(_0x218cb1){var _0xeb1822=this;return new Promise(function(_0x12b063,_0x3cac04){return db[_0xfa51('0x18')]['update'](_0x218cb1[_0xfa51('0x19')],{'raw':_0x218cb1['options']?_0x218cb1[_0xfa51('0x1a')][_0xfa51('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x218cb1[_0xfa51('0x1a')]?_0x218cb1[_0xfa51('0x1a')]['where']||null:null,'attributes':_0x218cb1[_0xfa51('0x1a')]?_0x218cb1[_0xfa51('0x1a')]['attributes']||null:null,'limit':_0x218cb1[_0xfa51('0x1a')]?_0x218cb1[_0xfa51('0x1a')][_0xfa51('0x1c')]||null:null})['then'](function(_0x37b629){logger[_0xfa51('0xe')]('UpdateMailInteraction',_0x218cb1);logger[_0xfa51('0x11')](_0xfa51('0x17'),_0x218cb1,JSON[_0xfa51('0x1d')](_0x37b629));_0x12b063(_0x37b629);})[_0xfa51('0x1e')](function(_0xdfd2b7){logger[_0xfa51('0x13')](_0xfa51('0x17'),_0xdfd2b7['message'],_0x218cb1);_0x3cac04(_0xeb1822['error'](0x1f4,_0xdfd2b7[_0xfa51('0x15')]));});});};exports['AddTagsToMailInteraction']=function(_0x5cc56e){return new Promise(function(_0x402b67,_0x48bc0d){return db[_0xfa51('0x18')][_0xfa51('0x1f')]({'where':_0x5cc56e[_0xfa51('0x1a')]?_0x5cc56e[_0xfa51('0x1a')][_0xfa51('0x20')]||null:null})['then'](function(_0xc67b3f){if(_0xc67b3f){return _0xc67b3f['addTags'](_0x5cc56e[_0xfa51('0x19')][_0xfa51('0x21')],_['omit'](_0x5cc56e[_0xfa51('0x19')],[_0xfa51('0x21'),'id'])||{});}})['spread'](function(_0x4f4c61){logger[_0xfa51('0xe')](_0xfa51('0x22'),_0x5cc56e);logger[_0xfa51('0x11')]('AddTags',_0x5cc56e,JSON[_0xfa51('0x1d')](_0x4f4c61));_0x402b67(_0x4f4c61);})[_0xfa51('0x1e')](function(_0x58c7b0){logger[_0xfa51('0x13')]('AddTags',_0x58c7b0[_0xfa51('0x15')],_0x5cc56e);_0x48bc0d(_this[_0xfa51('0x13')](0x1f4,_0x58c7b0[_0xfa51('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 13835b9..29cfdbd 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 _0x1cbc=['removeListener','length','mailInteraction:','save','remove'];(function(_0x5dce88,_0x3d6a44){var _0x14e9ad=function(_0x29b3d2){while(--_0x29b3d2){_0x5dce88['push'](_0x5dce88['shift']());}};_0x14e9ad(++_0x3d6a44);}(_0x1cbc,0x11b));var _0xc1cb=function(_0x11ea14,_0x5bddf5){_0x11ea14=_0x11ea14-0x0;var _0x5286f8=_0x1cbc[_0x11ea14];return _0x5286f8;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xc1cb('0x0'),_0xc1cb('0x1'),'update'];function createListener(_0x15d2d7,_0x15435b){return function(_0x19aab7){_0x15435b['emit'](_0x15d2d7,_0x19aab7);};}function removeListener(_0x2a7420,_0x2a79bc){return function(){MailInteractionEvents[_0xc1cb('0x2')](_0x2a7420,_0x2a79bc);};}exports['register']=function(_0xb66e1b){for(var _0x5c6e2c=0x0,_0x5c2b36=events[_0xc1cb('0x3')];_0x5c6e2c<_0x5c2b36;_0x5c6e2c++){var _0x5b81dc=events[_0x5c6e2c];var _0x35b4ea=createListener(_0xc1cb('0x4')+_0x5b81dc,_0xb66e1b);MailInteractionEvents['on'](_0x5b81dc,_0x35b4ea);}}; \ No newline at end of file +var _0xc62f=['length','./mailInteraction.events','save','remove','emit','removeListener'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xc62f,0xd3));var _0xfc62=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc62f[_0x14add3];return _0x4a174f;};'use strict';var MailInteractionEvents=require(_0xfc62('0x0'));var events=[_0xfc62('0x1'),_0xfc62('0x2'),'update'];function createListener(_0x20911c,_0x328828){return function(_0x10fb76){_0x328828[_0xfc62('0x3')](_0x20911c,_0x10fb76);};}function removeListener(_0x4afeb5,_0xb5adeb){return function(){MailInteractionEvents[_0xfc62('0x4')](_0x4afeb5,_0xb5adeb);};}exports['register']=function(_0x3cc9ee){for(var _0x2fb95c=0x0,_0x501877=events[_0xfc62('0x5')];_0x2fb95c<_0x501877;_0x2fb95c++){var _0x58d9a3=events[_0x2fb95c];var _0x1e5bb1=createListener('mailInteraction:'+_0x58d9a3,_0x3cc9ee);MailInteractionEvents['on'](_0x58d9a3,_0x1e5bb1);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index ab1c8fc..499eed3 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 _0x7072=['/:id/download','download','post','tracked','mail','mailmessage:create','create','put','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xbe2daa,_0x471877){var _0x4eebb6=function(_0x115706){while(--_0x115706){_0xbe2daa['push'](_0xbe2daa['shift']());}};_0x4eebb6(++_0x471877);}(_0x7072,0x138));var _0x2707=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x7072[_0x257642];return _0x3d813b;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2707('0x5'));var config=require('../../config/environment');var controller=require(_0x2707('0x6'));router[_0x2707('0x7')]('/',auth[_0x2707('0x8')](),controller[_0x2707('0x9')]);router[_0x2707('0x7')](_0x2707('0xa'),auth[_0x2707('0x8')](),controller[_0x2707('0xb')]);router[_0x2707('0x7')](_0x2707('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2707('0x7')](_0x2707('0xd'),auth[_0x2707('0x8')](),controller[_0x2707('0xe')]);router[_0x2707('0xf')]('/',auth[_0x2707('0x8')](),interaction[_0x2707('0x10')](_0x2707('0x11'),_0x2707('0x12')),controller[_0x2707('0x13')]);router[_0x2707('0x14')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['update']);router[_0x2707('0x14')]('/:id/accept',auth[_0x2707('0x8')](),controller[_0x2707('0x15')]);router[_0x2707('0x14')](_0x2707('0x16'),auth[_0x2707('0x8')](),controller['reject']);router[_0x2707('0x17')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['destroy']);module[_0x2707('0x18')]=router; \ No newline at end of file +var _0xb945=['exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','mail','create','put','update','/:id/accept','accept','delete','destroy'];(function(_0x430ea6,_0x58db3b){var _0x8c837=function(_0x1123ef){while(--_0x1123ef){_0x430ea6['push'](_0x430ea6['shift']());}};_0x8c837(++_0x58db3b);}(_0xb945,0x97));var _0x5b94=function(_0x1a4fd6,_0x58b002){_0x1a4fd6=_0x1a4fd6-0x0;var _0x4e41ff=_0xb945[_0x1a4fd6];return _0x4e41ff;};'use strict';var multer=require(_0x5b94('0x0'));var util=require('util');var path=require(_0x5b94('0x1'));var timeout=require('connect-timeout');var express=require(_0x5b94('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5b94('0x3'));var interaction=require(_0x5b94('0x4'));var config=require(_0x5b94('0x5'));var controller=require(_0x5b94('0x6'));router[_0x5b94('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b94('0x7')](_0x5b94('0x8'),auth[_0x5b94('0x9')](),controller[_0x5b94('0xa')]);router['get'](_0x5b94('0xb'),auth['isAuthenticated'](),controller[_0x5b94('0xc')]);router[_0x5b94('0x7')](_0x5b94('0xd'),auth[_0x5b94('0x9')](),controller[_0x5b94('0xe')]);router[_0x5b94('0xf')]('/',auth[_0x5b94('0x9')](),interaction['tracked'](_0x5b94('0x10'),'mailmessage:create'),controller[_0x5b94('0x11')]);router[_0x5b94('0x12')](_0x5b94('0xb'),auth[_0x5b94('0x9')](),controller[_0x5b94('0x13')]);router['put'](_0x5b94('0x14'),auth[_0x5b94('0x9')](),controller[_0x5b94('0x15')]);router[_0x5b94('0x12')]('/:id/reject',auth[_0x5b94('0x9')](),controller['reject']);router[_0x5b94('0x16')](_0x5b94('0xb'),auth['isAuthenticated'](),controller[_0x5b94('0x17')]);module[_0x5b94('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 5ab74fe..ebf6535 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 _0xf344=['STRING','DATE','INTEGER','ENUM','Chat','lodash','exports','TEXT','long','medium','BOOLEAN','out'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0xf344,0x89));var _0x4f34=function(_0x25d296,_0x566c1a){_0x25d296=_0x25d296-0x0;var _0x598705=_0xf344[_0x25d296];return _0x598705;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4f34('0x0'));module[_0x4f34('0x1')]={'body':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x4'))},'read':{'type':Sequelize[_0x4f34('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4f34('0x6')),'defaultValue':_0x4f34('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4f34('0x7')](0x1fe)},'from':{'type':Sequelize[_0x4f34('0x7')]},'to':{'type':Sequelize['TEXT'](_0x4f34('0x3'))},'cc':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3'))},'bcc':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x4f34('0x8')]},'attach':{'type':Sequelize[_0x4f34('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4f34('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4f34('0x8')]},'originTo':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3'))},'originCc':{'type':Sequelize[_0x4f34('0x2')](_0x4f34('0x3'))},'originChannel':{'type':Sequelize[_0x4f34('0xa')]('Email',_0x4f34('0xb')),'defaultValue':'Email','allowNull':![]}}; \ No newline at end of file +var _0x144e=['lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','sequelize'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x144e,0x151));var _0xe144=function(_0x13cde2,_0x4ff265){_0x13cde2=_0x13cde2-0x0;var _0x4286bc=_0x144e[_0x13cde2];return _0x4286bc;};'use strict';var Sequelize=require(_0xe144('0x0'));var _=require(_0xe144('0x1'));module[_0xe144('0x2')]={'body':{'type':Sequelize[_0xe144('0x3')](_0xe144('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe144('0x3')](_0xe144('0x5'))},'read':{'type':Sequelize[_0xe144('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe144('0x7')]('in','out'),'defaultValue':_0xe144('0x8'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xe144('0x9')]},'to':{'type':Sequelize[_0xe144('0x3')](_0xe144('0x4'))},'cc':{'type':Sequelize[_0xe144('0x3')](_0xe144('0x4'))},'bcc':{'type':Sequelize[_0xe144('0x3')](_0xe144('0x4'))},'subject':{'type':Sequelize[_0xe144('0x3')]},'sentAt':{'type':Sequelize[_0xe144('0xa')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe144('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xe144('0xa')]},'originTo':{'type':Sequelize[_0xe144('0x3')](_0xe144('0x4'))},'originCc':{'type':Sequelize[_0xe144('0x3')](_0xe144('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0xe144('0xb'),_0xe144('0xc')),'defaultValue':_0xe144('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 8bd2d5d..888f32e 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 _0x6f41=['http','request','then','info','MailMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','json','undefined','limit','offset','status','Content-Range','destroy','end','sendStatus','stack','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','MailMessage','count','include','findAll','rows','params','keys','includeAll','find','body','describe','create','direction','out','secret','MailAccount','findOne','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','attachments','join','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','sendMail','update','format','YYYY-MM-DD\x20HH:mm:ss','stringify','accept','read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','isNil','user','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','sequelize','download','toString','server','files','from','bcc','createdAt','Attachment','Attachments','decode','headers','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','client'];(function(_0x298cb8,_0x2e74ce){var _0x40b911=function(_0x5bbcba){while(--_0x5bbcba){_0x298cb8['push'](_0x298cb8['shift']());}};_0x40b911(++_0x2e74ce);}(_0x6f41,0x1b5));var _0x16f4=function(_0x3eb4df,_0x500f16){_0x3eb4df=_0x3eb4df-0x0;var _0x5a6c36=_0x6f41[_0x3eb4df];return _0x5a6c36;};'use strict';var emlformat=require(_0x16f4('0x0'));var moment=require(_0x16f4('0x1'));var BPromise=require(_0x16f4('0x2'));var util=require('util');var path=require(_0x16f4('0x3'));var fs=require('fs');var _=require(_0x16f4('0x4'));var Redis=require(_0x16f4('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x16f4('0x6'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require('../../config/environment');var db=require(_0x16f4('0x7'))['db'];config[_0x16f4('0x8')]=_[_0x16f4('0x9')](config[_0x16f4('0x8')],{'host':_0x16f4('0xa'),'port':0x18eb});var socket=require(_0x16f4('0xb'))(new Redis(config[_0x16f4('0x8')]));var htmlEntities=require(_0x16f4('0xc'));require(_0x16f4('0xd'))['register'](socket);var jayson=require(_0x16f4('0xe'));var client=jayson[_0x16f4('0xf')][_0x16f4('0x10')]({'port':0x232c});var client9003=jayson[_0x16f4('0xf')][_0x16f4('0x10')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2de6ec,_0x590525,_0x5628f8,_0x3c49b2){return new BPromise(function(_0x27e638,_0x505d93){var _0x4c80f7=_0x3c49b2||client;return _0x4c80f7[_0x16f4('0x11')](_0x2de6ec,_0x5628f8)[_0x16f4('0x12')](function(_0x482de8){logger[_0x16f4('0x13')](_0x16f4('0x14'),_0x590525,'request\x20sent');logger[_0x16f4('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x590525,_0x16f4('0x16'),JSON['stringify'](_0x482de8));if(_0x482de8[_0x16f4('0x17')]){if(_0x482de8['error']['code']===0x1f4){logger[_0x16f4('0x17')](_0x16f4('0x14'),_0x590525,_0x482de8[_0x16f4('0x17')][_0x16f4('0x18')]);return _0x505d93(_0x482de8[_0x16f4('0x17')][_0x16f4('0x18')]);}logger[_0x16f4('0x17')](_0x16f4('0x14'),_0x590525,_0x482de8['error'][_0x16f4('0x18')]);return _0x27e638(_0x482de8['error'][_0x16f4('0x18')]);}else{logger[_0x16f4('0x13')](_0x16f4('0x14'),_0x590525,_0x16f4('0x16'));_0x27e638(_0x482de8[_0x16f4('0x19')]['message']);}})[_0x16f4('0x1a')](function(_0x3ad78b){logger[_0x16f4('0x17')](_0x16f4('0x14'),_0x590525,_0x3ad78b);_0x505d93(_0x3ad78b);});});}function respondWithResult(_0x6d86d5,_0x425aba){_0x425aba=_0x425aba||0xc8;return function(_0x142b5d){if(_0x142b5d){return _0x6d86d5['status'](_0x425aba)[_0x16f4('0x1b')](_0x142b5d);}};}function respondWithFilteredResult(_0x314835,_0x3c533a){return function(_0x5bd60f){if(_0x5bd60f){var _0x225312=typeof _0x3c533a['offset']===_0x16f4('0x1c')&&typeof _0x3c533a[_0x16f4('0x1d')]===_0x16f4('0x1c');var _0x29835a=_0x5bd60f['count'];var _0x1cde8d=_0x225312?0x0:_0x3c533a[_0x16f4('0x1e')];var _0x1f9fe4=_0x225312?_0x5bd60f['count']:_0x3c533a[_0x16f4('0x1e')]+_0x3c533a['limit'];var _0xad782;if(_0x1f9fe4>=_0x29835a){_0x1f9fe4=_0x29835a;_0xad782=0xc8;}else{_0xad782=0xce;}_0x314835[_0x16f4('0x1f')](_0xad782);return _0x314835['set'](_0x16f4('0x20'),_0x1cde8d+'-'+_0x1f9fe4+'/'+_0x29835a)[_0x16f4('0x1b')](_0x5bd60f);}return null;};}function saveUpdates(_0x1b10c9){return function(_0x5ed91f){if(_0x5ed91f){return _0x5ed91f['update'](_0x1b10c9)['then'](function(_0x3d4466){return _0x3d4466;});}return null;};}function removeEntity(_0x20f407){return function(_0x4b101f){if(_0x4b101f){return _0x4b101f[_0x16f4('0x21')]()[_0x16f4('0x12')](function(){_0x20f407[_0x16f4('0x1f')](0xcc)[_0x16f4('0x22')]();});}};}function handleEntityNotFound(_0x3e9b87){return function(_0x31c402){if(!_0x31c402){_0x3e9b87[_0x16f4('0x23')](0x194);}return _0x31c402;};}function handleError(_0x2f5322,_0x584180){_0x584180=_0x584180||0x1f4;return function(_0x43a330){logger[_0x16f4('0x17')](_0x43a330[_0x16f4('0x24')]);if(_0x43a330['name']){delete _0x43a330['name'];}_0x2f5322[_0x16f4('0x1f')](_0x584180)['send'](_0x43a330);};}exports['index']=function(_0x2edb77,_0x46cc98){var _0x303ced={},_0x1b43ca={},_0x1bda5a={'count':0x0,'rows':[]};var _0x1578f7=_[_0x16f4('0x25')](db['MailMessage'][_0x16f4('0x26')],function(_0x320425){return{'name':_0x320425[_0x16f4('0x27')],'type':_0x320425[_0x16f4('0x28')][_0x16f4('0x29')]};});_0x1b43ca[_0x16f4('0x2a')]=_['map'](_0x1578f7,_0x16f4('0x2b'));_0x1b43ca['query']=_['keys'](_0x2edb77[_0x16f4('0x2c')]);_0x1b43ca[_0x16f4('0x2d')]=_[_0x16f4('0x2e')](_0x1b43ca[_0x16f4('0x2a')],_0x1b43ca[_0x16f4('0x2c')]);_0x303ced[_0x16f4('0x2f')]=_[_0x16f4('0x2e')](_0x1b43ca[_0x16f4('0x2a')],qs['fields'](_0x2edb77[_0x16f4('0x2c')][_0x16f4('0x30')]));_0x303ced[_0x16f4('0x2f')]=_0x303ced['attributes'][_0x16f4('0x31')]?_0x303ced[_0x16f4('0x2f')]:_0x1b43ca[_0x16f4('0x2a')];if(!_0x2edb77[_0x16f4('0x2c')][_0x16f4('0x32')](_0x16f4('0x33'))){_0x303ced['limit']=qs['limit'](_0x2edb77['query'][_0x16f4('0x1d')]);_0x303ced['offset']=qs['offset'](_0x2edb77[_0x16f4('0x2c')][_0x16f4('0x1e')]);}_0x303ced[_0x16f4('0x34')]=qs[_0x16f4('0x35')](_0x2edb77[_0x16f4('0x2c')]['sort']);_0x303ced[_0x16f4('0x36')]=qs[_0x16f4('0x2d')](_[_0x16f4('0x37')](_0x2edb77[_0x16f4('0x2c')],_0x1b43ca['filters']),_0x1578f7);if(_0x2edb77[_0x16f4('0x2c')]['filter']){_0x303ced[_0x16f4('0x36')]=_[_0x16f4('0x38')](_0x303ced[_0x16f4('0x36')],{'$or':_[_0x16f4('0x25')](_0x1578f7,function(_0x43d1e8){if(_0x43d1e8[_0x16f4('0x28')]!==_0x16f4('0x39')){var _0x57ca70={};_0x57ca70[_0x43d1e8[_0x16f4('0x2b')]]={'$like':'%'+_0x2edb77[_0x16f4('0x2c')]['filter']+'%'};return _0x57ca70;}})});}_0x303ced=_[_0x16f4('0x38')]({},_0x303ced,_0x2edb77[_0x16f4('0x3a')]);var _0x48a875={'where':_0x303ced['where']};return db[_0x16f4('0x3b')]['count'](_0x48a875)['then'](function(_0x1d7cf7){_0x1bda5a[_0x16f4('0x3c')]=_0x1d7cf7;if(_0x2edb77[_0x16f4('0x2c')]['includeAll']){_0x303ced[_0x16f4('0x3d')]=[{'all':!![]}];}return db[_0x16f4('0x3b')][_0x16f4('0x3e')](_0x303ced);})[_0x16f4('0x12')](function(_0xc67df1){_0x1bda5a[_0x16f4('0x3f')]=_0xc67df1;return _0x1bda5a;})[_0x16f4('0x12')](respondWithFilteredResult(_0x46cc98,_0x303ced))[_0x16f4('0x1a')](handleError(_0x46cc98,null));};exports['show']=function(_0x22dfa6,_0x3729c2){var _0x50646a={'raw':!![],'where':{'id':_0x22dfa6[_0x16f4('0x40')]['id']}},_0x337703={};_0x337703[_0x16f4('0x2a')]=_['keys'](db[_0x16f4('0x3b')]['rawAttributes']);_0x337703['query']=_[_0x16f4('0x41')](_0x22dfa6['query']);_0x337703['filters']=_[_0x16f4('0x2e')](_0x337703[_0x16f4('0x2a')],_0x337703[_0x16f4('0x2c')]);_0x50646a[_0x16f4('0x2f')]=_[_0x16f4('0x2e')](_0x337703['model'],qs[_0x16f4('0x30')](_0x22dfa6[_0x16f4('0x2c')][_0x16f4('0x30')]));_0x50646a[_0x16f4('0x2f')]=_0x50646a[_0x16f4('0x2f')][_0x16f4('0x31')]?_0x50646a[_0x16f4('0x2f')]:_0x337703[_0x16f4('0x2a')];if(_0x22dfa6['query'][_0x16f4('0x42')]){_0x50646a['include']=[{'all':!![]}];}_0x50646a=_['merge']({},_0x50646a,_0x22dfa6[_0x16f4('0x3a')]);return db['MailMessage'][_0x16f4('0x43')](_0x50646a)[_0x16f4('0x12')](handleEntityNotFound(_0x3729c2,null))[_0x16f4('0x12')](respondWithResult(_0x3729c2,null))[_0x16f4('0x1a')](handleError(_0x3729c2,null));};exports['update']=function(_0x25eeed,_0x53ecac){if(_0x25eeed[_0x16f4('0x44')]['id']){delete _0x25eeed[_0x16f4('0x44')]['id'];}return db['MailMessage'][_0x16f4('0x43')]({'where':{'id':_0x25eeed['params']['id']}})['then'](handleEntityNotFound(_0x53ecac,null))['then'](saveUpdates(_0x25eeed[_0x16f4('0x44')],null))['then'](respondWithResult(_0x53ecac,null))['catch'](handleError(_0x53ecac,null));};exports[_0x16f4('0x21')]=function(_0x4e1fb7,_0x1a4058){return db[_0x16f4('0x3b')][_0x16f4('0x43')]({'where':{'id':_0x4e1fb7[_0x16f4('0x40')]['id']}})[_0x16f4('0x12')](handleEntityNotFound(_0x1a4058,null))[_0x16f4('0x12')](removeEntity(_0x1a4058,null))[_0x16f4('0x1a')](handleError(_0x1a4058,null));};exports['describe']=function(_0x40c360,_0x58b78b){return db[_0x16f4('0x3b')][_0x16f4('0x45')]()[_0x16f4('0x12')](respondWithResult(_0x58b78b,null))[_0x16f4('0x1a')](handleError(_0x58b78b,null));};exports['create']=function(_0x441f7e,_0x5d478e){return db['MailMessage'][_0x16f4('0x46')](_0x441f7e[_0x16f4('0x44')])[_0x16f4('0x12')](function(_0x30a494){if(_0x30a494){if(_0x30a494[_0x16f4('0x47')]===_0x16f4('0x48')&&!_0x30a494[_0x16f4('0x49')]){var _0x2be620,_0xd45eb3,_0x396234;if(_0x441f7e[_0x16f4('0x44')]['to']){_0xd45eb3=_0x441f7e[_0x16f4('0x44')]['to']['split'](',')[0x0];}return db[_0x16f4('0x4a')][_0x16f4('0x4b')]({'where':{'id':_0x30a494['MailAccountId']},'include':[{'model':db[_0x16f4('0x4c')],'as':_0x16f4('0x4d'),'include':[{'model':db['CmContact'],'as':_0x16f4('0x4e'),'where':{'email':_0xd45eb3},'limit':0x1,'order':[[_0x16f4('0x4f'),_0x16f4('0x50')]]}]},{'model':db[_0x16f4('0x51')],'as':_0x16f4('0x52'),'raw':!![],'include':[{'model':db[_0x16f4('0x53')],'as':_0x16f4('0x53'),'raw':!![]}]}]})[_0x16f4('0x12')](function(_0x5ada75){_0x2be620=_0x5ada75;if(!_0x2be620||!_0x2be620['Smtp'])return;var _0x1dd2e9=_0x2be620['getSmtpOptions']();if(_0x441f7e[_0x16f4('0x44')][_0x16f4('0x54')]&&_0x441f7e[_0x16f4('0x44')][_0x16f4('0x54')][_0x16f4('0x31')]){for(var _0x178968=0x0;_0x178968<_0x441f7e['body'][_0x16f4('0x54')][_0x16f4('0x31')];_0x178968+=0x1){_0x441f7e['body'][_0x16f4('0x54')][_0x178968]={'filename':_0x441f7e['body'][_0x16f4('0x54')][_0x178968][_0x16f4('0x2b')],'path':path[_0x16f4('0x55')](config[_0x16f4('0x56')],_0x16f4('0x57'),_0x441f7e['body'][_0x16f4('0x54')][_0x178968][_0x16f4('0x58')])};}}_0x396234={'account':_0x1dd2e9,'message':_0x441f7e[_0x16f4('0x44')]};return;})[_0x16f4('0x12')](function(){if(_0x2be620[_0x16f4('0x4d')]){if(_0x2be620[_0x16f4('0x4d')][_0x16f4('0x4e')][_0x16f4('0x31')]){return _0x2be620[_0x16f4('0x4d')][_0x16f4('0x4e')][0x0];}else{return db[_0x16f4('0x59')][_0x16f4('0x46')](_['defaults'](_0x441f7e[_0x16f4('0x44')],{'firstName':_0x441f7e[_0x16f4('0x44')]['to'],'email':_0x441f7e['body']['to'],'phone':_0x441f7e[_0x16f4('0x44')]['to'],'ListId':_0x2be620[_0x16f4('0x5a')]}));}}else{throw new Error(_0x16f4('0x5b'));}})[_0x16f4('0x12')](function(){if(_0x396234){return respondWithRpcPromise('SendMail',_0x16f4('0x5c'),_0x396234,client9003)[_0x16f4('0x12')](function(_0x8da76e){return _0x30a494[_0x16f4('0x5d')]({'read':!![],'messageId':_0x8da76e['messageId'],'sentAt':moment()[_0x16f4('0x5e')](_0x16f4('0x5f'))});})[_0x16f4('0x1a')](function(_0x1c85ef){logger[_0x16f4('0x17')]('%s',JSON[_0x16f4('0x60')](_0x1c85ef));return _0x30a494;});}return _0x30a494;});}return _0x30a494;}})[_0x16f4('0x12')](respondWithResult(_0x5d478e,0xc9))['catch'](handleError(_0x5d478e,null));};exports[_0x16f4('0x61')]=function(_0xa0ee12,_0x540740){var _0x5c63b0={'agent':{},'channel':'mail'};if(_0xa0ee12[_0x16f4('0x44')]['id']){delete _0xa0ee12[_0x16f4('0x44')]['id'];}_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x62')]=!![];_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x63')]=moment()[_0x16f4('0x5e')](_0x16f4('0x5f'));_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')]=_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')]||_0xa0ee12['user']['id'];_0x5c63b0[_0x16f4('0x65')]['id']=_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')];return db[_0x16f4('0x3b')]['find']({'where':{'id':_0xa0ee12[_0x16f4('0x40')]['id'],'UserId':null}})[_0x16f4('0x12')](handleEntityNotFound(_0x540740,null))[_0x16f4('0x12')](saveUpdates(_0xa0ee12[_0x16f4('0x44')],null))[_0x16f4('0x12')](function(_0x1bb89c){if(_0x1bb89c){_0x5c63b0[_0x16f4('0x18')]=_0x1bb89c[_0x16f4('0x66')]({'plain':!![]});return db[_0x16f4('0x67')][_0x16f4('0x43')]({'where':{'id':_0x1bb89c[_0x16f4('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x540740,null))[_0x16f4('0x12')](function(_0x407457){if(_0x407457){return _0x407457['update']({'UserId':_0xa0ee12['body'][_0x16f4('0x64')],'read1stAt':_[_0x16f4('0x69')](_0x407457['read1stAt'])?moment()['format'](_0x16f4('0x5f')):undefined});}return null;})[_0x16f4('0x12')](function(_0x2a390d){if(_0x2a390d){_0x5c63b0['interaction']=_0x2a390d[_0x16f4('0x66')]({'plain':!![]});interaction_log[_0x16f4('0x13')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa0ee12[_0x16f4('0x6a')]['id'],_0xa0ee12[_0x16f4('0x6a')][_0x16f4('0x2b')],_0xa0ee12[_0x16f4('0x6a')]['role'],_0x5c63b0[_0x16f4('0x6b')]['id'],_0xa0ee12[_0x16f4('0x44')]?JSON[_0x16f4('0x60')](_0xa0ee12[_0x16f4('0x44')]):'null');return respondWithRpcPromise(_0x16f4('0x6c'),_0x16f4('0x6d'),_0x5c63b0);}return null;})[_0x16f4('0x12')](function(_0x4d4b2b){var _0x4e8ed9=_0x16f4('0x6e')+_0x4d4b2b[_0x16f4('0x18')][_0x16f4('0x6f')];return db['sequelize'][_0x16f4('0x2c')](_0x4e8ed9,{'type':db[_0x16f4('0x70')][_0x16f4('0x71')][_0x16f4('0x72')],'raw':!![]})[_0x16f4('0x12')](function(_0x5844c5){return _0x5844c5;});})[_0x16f4('0x12')](function(_0x5e6c48){if(_0x5e6c48){_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x73')]=_0x5e6c48[0x0];if(!_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')])return;return db[_0x16f4('0x74')][_0x16f4('0x43')]({'where':{'id':_0xa0ee12[_0x16f4('0x44')][_0x16f4('0x64')],'role':_0x16f4('0x65')},'attributes':['id',_0x16f4('0x2b'),_0x16f4('0x75'),'email',_0x16f4('0x76')],'raw':!![]});}return null;})['then'](function(_0x20f2bc){if(!_0x20f2bc)return null;_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x65')]=_0x20f2bc;return _0x5c63b0;})[_0x16f4('0x12')](function(_0x236008){if(_0x236008){if(_0xa0ee12[_0x16f4('0x44')]['manual']){_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x77')]=util[_0x16f4('0x5e')](_0x16f4('0x78'),_0xa0ee12[_0x16f4('0x6a')][_0x16f4('0x2b')]);_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x79')]=_0x5c63b0['channel'];_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x7a')]=_0x5c63b0[_0x16f4('0x79')];_0x5c63b0[_0x16f4('0x18')][_0x16f4('0x7b')]=_0x16f4('0x61');_0x5c63b0['message']['body']=htmlToText[_0x16f4('0x7c')](_0x5c63b0[_0x16f4('0x18')]['body']);return respondWithRpcPromise(_0x16f4('0x7d'),_0x16f4('0x7d'),{'event':_0x16f4('0x7e'),'message':_0x5c63b0[_0x16f4('0x18')]},client9002)['then'](function(){return _0x5c63b0;});}return _0x5c63b0;}return null;})[_0x16f4('0x12')](respondWithResult(_0x540740,null))[_0x16f4('0x1a')](handleError(_0x540740,null));};exports[_0x16f4('0x7f')]=function(_0x58a637,_0x361243){var _0xc0d5ff={'agent':{},'channel':_0x16f4('0x80')};if(_0x58a637['body']['id']){delete _0x58a637[_0x16f4('0x44')]['id'];}_0x58a637[_0x16f4('0x44')][_0x16f4('0x64')]=_0x58a637['body'][_0x16f4('0x64')]||_0x58a637[_0x16f4('0x6a')]['id'];_0xc0d5ff[_0x16f4('0x65')]['id']=_0x58a637[_0x16f4('0x44')]['UserId'];return db[_0x16f4('0x3b')]['find']({'where':{'id':_0x58a637[_0x16f4('0x40')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x361243,null))['then'](function(_0x373795){if(_0x373795){_0xc0d5ff[_0x16f4('0x18')]=_0x373795['get']({'plain':!![]});return db[_0x16f4('0x67')][_0x16f4('0x43')]({'where':{'id':_0x373795[_0x16f4('0x68')]}});}return null;})[_0x16f4('0x12')](handleEntityNotFound(_0x361243,null))[_0x16f4('0x12')](function(_0x172097){if(_0x172097){_0xc0d5ff[_0x16f4('0x6b')]=_0x172097[_0x16f4('0x66')]({'plain':!![]});interaction_log[_0x16f4('0x13')](_0x16f4('0x81'),_0x58a637['user']['id'],_0x58a637[_0x16f4('0x6a')][_0x16f4('0x2b')],_0x58a637[_0x16f4('0x6a')][_0x16f4('0x82')],_0xc0d5ff[_0x16f4('0x6b')]['id'],_0x58a637[_0x16f4('0x44')]?JSON[_0x16f4('0x60')](_0x58a637['body']):_0x16f4('0x83'));return respondWithRpcPromise(_0x16f4('0x84'),'rejectMessage',_0xc0d5ff);}return null;})[_0x16f4('0x12')](function(_0x3c5c37){var _0x1c7342=_0x16f4('0x6e')+_0x3c5c37['message']['ContactId'];return db[_0x16f4('0x85')][_0x16f4('0x2c')](_0x1c7342,{'type':db[_0x16f4('0x70')]['QueryTypes'][_0x16f4('0x72')],'raw':!![]})['then'](function(_0x2a63b9){return _0x2a63b9;});})['then'](function(_0x479e1e){if(_0x479e1e){_0xc0d5ff[_0x16f4('0x18')][_0x16f4('0x73')]=_0x479e1e[0x0];if(!_0x58a637[_0x16f4('0x44')][_0x16f4('0x64')])return;return db[_0x16f4('0x74')][_0x16f4('0x43')]({'where':{'id':_0x58a637['body']['UserId'],'role':_0x16f4('0x65')},'attributes':['id',_0x16f4('0x2b'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x16f4('0x12')](function(_0x55f4b7){if(!_0x55f4b7)return null;_0xc0d5ff[_0x16f4('0x18')]['agent']=_0x55f4b7;return _0xc0d5ff;})[_0x16f4('0x12')](function(_0x197dde){if(_0x197dde){_0x197dde[_0x16f4('0x18')][_0x16f4('0x77')]=util['format'](_0x16f4('0x78'),_0x58a637['user'][_0x16f4('0x2b')]);_0x197dde[_0x16f4('0x18')][_0x16f4('0x79')]=_0xc0d5ff[_0x16f4('0x79')];_0x197dde['message'][_0x16f4('0x7a')]=_0xc0d5ff[_0x16f4('0x79')];_0x197dde['message'][_0x16f4('0x7b')]='reject';_0x197dde[_0x16f4('0x18')][_0x16f4('0x44')]=htmlToText['fromString'](_0xc0d5ff[_0x16f4('0x18')][_0x16f4('0x44')]);respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0x197dde[_0x16f4('0x18')]},client9002);return _0xc0d5ff;}return null;})[_0x16f4('0x12')](respondWithResult(_0x361243,null))[_0x16f4('0x1a')](handleError(_0x361243,null));};exports[_0x16f4('0x86')]=function(_0xc6ae40,_0xbdd1a4){var _0x149ae1=moment()['unix']()[_0x16f4('0x87')]();var _0x3a7bda=path[_0x16f4('0x55')](config[_0x16f4('0x56')],_0x16f4('0x88'),_0x16f4('0x89'),'tmp');var _0x4528e3=path[_0x16f4('0x55')](config['root'],_0x16f4('0x88'),'files',_0x16f4('0x54'));var _0x4beeca=util['format']('message-%s.eml',_0x149ae1);return db[_0x16f4('0x3b')]['find']({'where':{'id':_0xc6ae40[_0x16f4('0x40')]['id']},'attributes':['id',_0x16f4('0x44'),_0x16f4('0x8a'),'to','cc',_0x16f4('0x8b'),'subject',_0x16f4('0x8c')],'include':_0xc6ae40[_0x16f4('0x2c')][_0x16f4('0x54')]?[{'model':db[_0x16f4('0x8d')],'as':_0x16f4('0x8e')}]:undefined})[_0x16f4('0x12')](handleEntityNotFound(_0xbdd1a4,null))[_0x16f4('0x12')](function(_0x3fbc62){if(_0x3fbc62){var _0x4b296d=_0x3fbc62;var _0x56fcf9={'from':_0x4b296d[_0x16f4('0x8a')],'to':_0x4b296d['to'],'subject':_0x4b296d['subject'],'html':htmlEntities[_0x16f4('0x8f')](_0x4b296d[_0x16f4('0x44')]),'headers':{'Date':moment(_0x4b296d[_0x16f4('0x8c')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x3fbc62['cc']){_0x56fcf9[_0x16f4('0x90')]['Cc']=_0x3fbc62['cc'];}if(_0x3fbc62[_0x16f4('0x8b')]){_0x56fcf9['headers']['Bcc']=_0x3fbc62[_0x16f4('0x8b')];}return new BPromise(function(_0xb92bad,_0x106922){if(_0x3fbc62[_0x16f4('0x8e')]){for(var _0x5bd5a3=0x0;_0x5bd5a3<_0x3fbc62[_0x16f4('0x8e')][_0x16f4('0x31')];_0x5bd5a3++){var _0x4f8dcb=_0x3fbc62[_0x16f4('0x8e')][_0x5bd5a3];var _0x4fc9da=path[_0x16f4('0x55')](_0x4528e3,_0x4f8dcb[_0x16f4('0x58')]);if(fs[_0x16f4('0x91')](_0x4fc9da)){_0x56fcf9[_0x16f4('0x54')][_0x16f4('0x92')]({'name':_0x4f8dcb[_0x16f4('0x2b')],'contentType':_0x4f8dcb[_0x16f4('0x28')],'data':fs[_0x16f4('0x93')](_0x4fc9da)});}}}emlformat[_0x16f4('0x94')](_0x56fcf9,function(_0x45c278,_0x18e316){if(_0x45c278)return _0x106922(_0x45c278);fs[_0x16f4('0x95')](path['join'](_0x3a7bda,_0x4beeca),_0x18e316);return _0xb92bad(_0x18e316);});});}})[_0x16f4('0x12')](function(_0x663750){if(_0x663750){return _0xbdd1a4[_0x16f4('0x86')](path[_0x16f4('0x55')](_0x3a7bda,_0x4beeca),_0x4beeca,function(_0x1796a7){if(!_0x1796a7)fs[_0x16f4('0x96')](path[_0x16f4('0x55')](_0x3a7bda,_0x4beeca));});}})[_0x16f4('0x1a')](handleError(_0xbdd1a4,null));}; \ No newline at end of file +var _0xe41c=['filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','findAll','rows','show','includeAll','include','options','find','update','body','describe','create','out','secret','split','MailAccount','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','params','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','email','internal','rejectmessage','download','unix','toString','server','files','bcc','subject','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','existsSync','push','readFileSync','unlinkSync','moment','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','html-entities','register','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','sendStatus','name','send','map','MailMessage','rawAttributes','type','key','model','query','keys'];(function(_0x3d4e16,_0xd5807a){var _0x238ad=function(_0x594776){while(--_0x594776){_0x3d4e16['push'](_0x3d4e16['shift']());}};_0x238ad(++_0xd5807a);}(_0xe41c,0x10d));var _0xce41=function(_0x52af63,_0x4b9a44){_0x52af63=_0x52af63-0x0;var _0x2e69af=_0xe41c[_0x52af63];return _0x2e69af;};'use strict';var emlformat=require('eml-format');var moment=require(_0xce41('0x0'));var BPromise=require('bluebird');var util=require(_0xce41('0x1'));var path=require(_0xce41('0x2'));var fs=require('fs');var _=require(_0xce41('0x3'));var Redis=require(_0xce41('0x4'));var htmlToText=require(_0xce41('0x5'));var qs=require(_0xce41('0x6'));var logger=require(_0xce41('0x7'))(_0xce41('0x8'));var interaction_log=require(_0xce41('0x7'))(_0xce41('0x9'));var config=require(_0xce41('0xa'));var db=require(_0xce41('0xb'))['db'];config[_0xce41('0xc')]=_[_0xce41('0xd')](config[_0xce41('0xc')],{'host':_0xce41('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));var htmlEntities=require(_0xce41('0xf'));require('./mailMessage.socket')[_0xce41('0x10')](socket);var jayson=require('jayson/promise');var client=jayson[_0xce41('0x11')][_0xce41('0x12')]({'port':0x232c});var client9003=jayson[_0xce41('0x11')][_0xce41('0x12')]({'port':0x232b});var client9002=jayson[_0xce41('0x11')][_0xce41('0x12')]({'port':0x232a});function respondWithRpcPromise(_0xbabd93,_0x50e723,_0x22ab56,_0x471559){return new BPromise(function(_0x1d3c19,_0x56c222){var _0x3fa422=_0x471559||client;return _0x3fa422[_0xce41('0x13')](_0xbabd93,_0x22ab56)[_0xce41('0x14')](function(_0x22ac20){logger['info'](_0xce41('0x15'),_0x50e723,_0xce41('0x16'));logger[_0xce41('0x17')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x50e723,_0xce41('0x16'),JSON[_0xce41('0x18')](_0x22ac20));if(_0x22ac20[_0xce41('0x19')]){if(_0x22ac20[_0xce41('0x19')][_0xce41('0x1a')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x50e723,_0x22ac20[_0xce41('0x19')][_0xce41('0x1b')]);return _0x56c222(_0x22ac20['error']['message']);}logger[_0xce41('0x19')]('MailMessage,\x20%s,\x20%s',_0x50e723,_0x22ac20[_0xce41('0x19')][_0xce41('0x1b')]);return _0x1d3c19(_0x22ac20[_0xce41('0x19')][_0xce41('0x1b')]);}else{logger[_0xce41('0x1c')](_0xce41('0x15'),_0x50e723,_0xce41('0x16'));_0x1d3c19(_0x22ac20['result'][_0xce41('0x1b')]);}})[_0xce41('0x1d')](function(_0x534299){logger[_0xce41('0x19')](_0xce41('0x15'),_0x50e723,_0x534299);_0x56c222(_0x534299);});});}function respondWithResult(_0x19b84a,_0x485095){_0x485095=_0x485095||0xc8;return function(_0x209bb1){if(_0x209bb1){return _0x19b84a[_0xce41('0x1e')](_0x485095)[_0xce41('0x1f')](_0x209bb1);}};}function respondWithFilteredResult(_0x2a95bd,_0x4626a1){return function(_0x1f4514){if(_0x1f4514){var _0x409423=typeof _0x4626a1[_0xce41('0x20')]===_0xce41('0x21')&&typeof _0x4626a1[_0xce41('0x22')]===_0xce41('0x21');var _0x2aea5c=_0x1f4514[_0xce41('0x23')];var _0x20ada3=_0x409423?0x0:_0x4626a1[_0xce41('0x20')];var _0x2f4d8e=_0x409423?_0x1f4514[_0xce41('0x23')]:_0x4626a1['offset']+_0x4626a1[_0xce41('0x22')];var _0x367401;if(_0x2f4d8e>=_0x2aea5c){_0x2f4d8e=_0x2aea5c;_0x367401=0xc8;}else{_0x367401=0xce;}_0x2a95bd[_0xce41('0x1e')](_0x367401);return _0x2a95bd[_0xce41('0x24')](_0xce41('0x25'),_0x20ada3+'-'+_0x2f4d8e+'/'+_0x2aea5c)[_0xce41('0x1f')](_0x1f4514);}return null;};}function saveUpdates(_0x5244e3){return function(_0x24c4a3){if(_0x24c4a3){return _0x24c4a3['update'](_0x5244e3)['then'](function(_0x224f30){return _0x224f30;});}return null;};}function removeEntity(_0x48303b){return function(_0x3e70cc){if(_0x3e70cc){return _0x3e70cc[_0xce41('0x26')]()[_0xce41('0x14')](function(){_0x48303b['status'](0xcc)[_0xce41('0x27')]();});}};}function handleEntityNotFound(_0xf8f21b){return function(_0x1df2f1){if(!_0x1df2f1){_0xf8f21b[_0xce41('0x28')](0x194);}return _0x1df2f1;};}function handleError(_0x28828e,_0x1a90bf){_0x1a90bf=_0x1a90bf||0x1f4;return function(_0x1755a3){logger[_0xce41('0x19')](_0x1755a3['stack']);if(_0x1755a3[_0xce41('0x29')]){delete _0x1755a3[_0xce41('0x29')];}_0x28828e['status'](_0x1a90bf)[_0xce41('0x2a')](_0x1755a3);};}exports['index']=function(_0x2aec85,_0x537eba){var _0x23f197={},_0xecb16c={},_0x1a10fd={'count':0x0,'rows':[]};var _0x3c335f=_[_0xce41('0x2b')](db[_0xce41('0x2c')][_0xce41('0x2d')],function(_0x110a67){return{'name':_0x110a67['fieldName'],'type':_0x110a67[_0xce41('0x2e')][_0xce41('0x2f')]};});_0xecb16c[_0xce41('0x30')]=_[_0xce41('0x2b')](_0x3c335f,'name');_0xecb16c[_0xce41('0x31')]=_[_0xce41('0x32')](_0x2aec85[_0xce41('0x31')]);_0xecb16c[_0xce41('0x33')]=_['intersection'](_0xecb16c['model'],_0xecb16c[_0xce41('0x31')]);_0x23f197[_0xce41('0x34')]=_[_0xce41('0x35')](_0xecb16c['model'],qs['fields'](_0x2aec85[_0xce41('0x31')][_0xce41('0x36')]));_0x23f197[_0xce41('0x34')]=_0x23f197['attributes'][_0xce41('0x37')]?_0x23f197[_0xce41('0x34')]:_0xecb16c[_0xce41('0x30')];if(!_0x2aec85[_0xce41('0x31')]['hasOwnProperty'](_0xce41('0x38'))){_0x23f197[_0xce41('0x22')]=qs[_0xce41('0x22')](_0x2aec85['query'][_0xce41('0x22')]);_0x23f197[_0xce41('0x20')]=qs[_0xce41('0x20')](_0x2aec85['query'][_0xce41('0x20')]);}_0x23f197[_0xce41('0x39')]=qs[_0xce41('0x3a')](_0x2aec85[_0xce41('0x31')]['sort']);_0x23f197[_0xce41('0x3b')]=qs[_0xce41('0x33')](_[_0xce41('0x3c')](_0x2aec85['query'],_0xecb16c[_0xce41('0x33')]),_0x3c335f);if(_0x2aec85[_0xce41('0x31')][_0xce41('0x3d')]){_0x23f197[_0xce41('0x3b')]=_[_0xce41('0x3e')](_0x23f197[_0xce41('0x3b')],{'$or':_[_0xce41('0x2b')](_0x3c335f,function(_0xb28533){if(_0xb28533[_0xce41('0x2e')]!=='VIRTUAL'){var _0xea09ff={};_0xea09ff[_0xb28533[_0xce41('0x29')]]={'$like':'%'+_0x2aec85[_0xce41('0x31')][_0xce41('0x3d')]+'%'};return _0xea09ff;}})});}_0x23f197=_['merge']({},_0x23f197,_0x2aec85['options']);var _0x77c1fb={'where':_0x23f197[_0xce41('0x3b')]};return db[_0xce41('0x2c')][_0xce41('0x23')](_0x77c1fb)[_0xce41('0x14')](function(_0x5579ab){_0x1a10fd['count']=_0x5579ab;if(_0x2aec85[_0xce41('0x31')]['includeAll']){_0x23f197['include']=[{'all':!![]}];}return db[_0xce41('0x2c')][_0xce41('0x3f')](_0x23f197);})[_0xce41('0x14')](function(_0xd29774){_0x1a10fd[_0xce41('0x40')]=_0xd29774;return _0x1a10fd;})[_0xce41('0x14')](respondWithFilteredResult(_0x537eba,_0x23f197))['catch'](handleError(_0x537eba,null));};exports[_0xce41('0x41')]=function(_0xc5ed62,_0x216bb7){var _0x59282c={'raw':!![],'where':{'id':_0xc5ed62['params']['id']}},_0x5d8288={};_0x5d8288['model']=_['keys'](db[_0xce41('0x2c')][_0xce41('0x2d')]);_0x5d8288[_0xce41('0x31')]=_[_0xce41('0x32')](_0xc5ed62['query']);_0x5d8288[_0xce41('0x33')]=_['intersection'](_0x5d8288[_0xce41('0x30')],_0x5d8288[_0xce41('0x31')]);_0x59282c['attributes']=_[_0xce41('0x35')](_0x5d8288[_0xce41('0x30')],qs['fields'](_0xc5ed62[_0xce41('0x31')]['fields']));_0x59282c[_0xce41('0x34')]=_0x59282c[_0xce41('0x34')][_0xce41('0x37')]?_0x59282c[_0xce41('0x34')]:_0x5d8288['model'];if(_0xc5ed62[_0xce41('0x31')][_0xce41('0x42')]){_0x59282c[_0xce41('0x43')]=[{'all':!![]}];}_0x59282c=_[_0xce41('0x3e')]({},_0x59282c,_0xc5ed62[_0xce41('0x44')]);return db[_0xce41('0x2c')][_0xce41('0x45')](_0x59282c)['then'](handleEntityNotFound(_0x216bb7,null))[_0xce41('0x14')](respondWithResult(_0x216bb7,null))[_0xce41('0x1d')](handleError(_0x216bb7,null));};exports[_0xce41('0x46')]=function(_0x2dd0c9,_0x4e74f8){if(_0x2dd0c9[_0xce41('0x47')]['id']){delete _0x2dd0c9[_0xce41('0x47')]['id'];}return db[_0xce41('0x2c')][_0xce41('0x45')]({'where':{'id':_0x2dd0c9['params']['id']}})[_0xce41('0x14')](handleEntityNotFound(_0x4e74f8,null))['then'](saveUpdates(_0x2dd0c9[_0xce41('0x47')],null))[_0xce41('0x14')](respondWithResult(_0x4e74f8,null))[_0xce41('0x1d')](handleError(_0x4e74f8,null));};exports[_0xce41('0x26')]=function(_0x2b41cd,_0x246110){return db[_0xce41('0x2c')]['find']({'where':{'id':_0x2b41cd['params']['id']}})[_0xce41('0x14')](handleEntityNotFound(_0x246110,null))[_0xce41('0x14')](removeEntity(_0x246110,null))[_0xce41('0x1d')](handleError(_0x246110,null));};exports[_0xce41('0x48')]=function(_0x5b04e4,_0x48da0c){return db[_0xce41('0x2c')][_0xce41('0x48')]()[_0xce41('0x14')](respondWithResult(_0x48da0c,null))[_0xce41('0x1d')](handleError(_0x48da0c,null));};exports[_0xce41('0x49')]=function(_0x3c1ff8,_0x3b8afe){return db[_0xce41('0x2c')][_0xce41('0x49')](_0x3c1ff8[_0xce41('0x47')])[_0xce41('0x14')](function(_0x493224){if(_0x493224){if(_0x493224['direction']===_0xce41('0x4a')&&!_0x493224[_0xce41('0x4b')]){var _0x27e6ac,_0x2d3f35,_0x1ae585;if(_0x3c1ff8['body']['to']){_0x2d3f35=_0x3c1ff8[_0xce41('0x47')]['to'][_0xce41('0x4c')](',')[0x0];}return db[_0xce41('0x4d')]['findOne']({'where':{'id':_0x493224[_0xce41('0x4e')]},'include':[{'model':db[_0xce41('0x4f')],'as':_0xce41('0x50'),'include':[{'model':db[_0xce41('0x51')],'as':_0xce41('0x52'),'where':{'email':_0x2d3f35},'limit':0x1,'order':[['updatedAt',_0xce41('0x53')]]}]},{'model':db[_0xce41('0x54')],'as':_0xce41('0x55'),'raw':!![],'include':[{'model':db[_0xce41('0x56')],'as':_0xce41('0x56'),'raw':!![]}]}]})[_0xce41('0x14')](function(_0x4d6080){_0x27e6ac=_0x4d6080;if(!_0x27e6ac||!_0x27e6ac['Smtp'])return;var _0x176727=_0x27e6ac[_0xce41('0x57')]();if(_0x3c1ff8[_0xce41('0x47')][_0xce41('0x58')]&&_0x3c1ff8[_0xce41('0x47')][_0xce41('0x58')][_0xce41('0x37')]){for(var _0x49204e=0x0;_0x49204e<_0x3c1ff8[_0xce41('0x47')][_0xce41('0x58')][_0xce41('0x37')];_0x49204e+=0x1){_0x3c1ff8['body'][_0xce41('0x58')][_0x49204e]={'filename':_0x3c1ff8[_0xce41('0x47')][_0xce41('0x58')][_0x49204e]['name'],'path':path[_0xce41('0x59')](config[_0xce41('0x5a')],_0xce41('0x5b'),_0x3c1ff8[_0xce41('0x47')]['attachments'][_0x49204e][_0xce41('0x5c')])};}}_0x1ae585={'account':_0x176727,'message':_0x3c1ff8[_0xce41('0x47')]};return;})[_0xce41('0x14')](function(){if(_0x27e6ac[_0xce41('0x50')]){if(_0x27e6ac[_0xce41('0x50')][_0xce41('0x52')][_0xce41('0x37')]){return _0x27e6ac[_0xce41('0x50')][_0xce41('0x52')][0x0];}else{return db['CmContact']['create'](_[_0xce41('0xd')](_0x3c1ff8[_0xce41('0x47')],{'firstName':_0x3c1ff8['body']['to'],'email':_0x3c1ff8[_0xce41('0x47')]['to'],'phone':_0x3c1ff8[_0xce41('0x47')]['to'],'ListId':_0x27e6ac['ListId']}));}}else{throw new Error(_0xce41('0x5d'));}})['then'](function(){if(_0x1ae585){return respondWithRpcPromise(_0xce41('0x5e'),_0xce41('0x5f'),_0x1ae585,client9003)['then'](function(_0x52ee38){return _0x493224['update']({'read':!![],'messageId':_0x52ee38[_0xce41('0x60')],'sentAt':moment()[_0xce41('0x61')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xce41('0x1d')](function(_0x5b6e06){logger[_0xce41('0x19')]('%s',JSON['stringify'](_0x5b6e06));return _0x493224;});}return _0x493224;});}return _0x493224;}})[_0xce41('0x14')](respondWithResult(_0x3b8afe,0xc9))['catch'](handleError(_0x3b8afe,null));};exports[_0xce41('0x62')]=function(_0x3f8dac,_0x2e2105){var _0x4be942={'agent':{},'channel':_0xce41('0x63')};if(_0x3f8dac['body']['id']){delete _0x3f8dac[_0xce41('0x47')]['id'];}_0x3f8dac[_0xce41('0x47')][_0xce41('0x64')]=!![];_0x3f8dac[_0xce41('0x47')][_0xce41('0x65')]=moment()[_0xce41('0x61')](_0xce41('0x66'));_0x3f8dac[_0xce41('0x47')][_0xce41('0x67')]=_0x3f8dac[_0xce41('0x47')][_0xce41('0x67')]||_0x3f8dac[_0xce41('0x68')]['id'];_0x4be942[_0xce41('0x69')]['id']=_0x3f8dac[_0xce41('0x47')][_0xce41('0x67')];return db[_0xce41('0x2c')][_0xce41('0x45')]({'where':{'id':_0x3f8dac[_0xce41('0x6a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e2105,null))[_0xce41('0x14')](saveUpdates(_0x3f8dac['body'],null))[_0xce41('0x14')](function(_0x57f5d6){if(_0x57f5d6){_0x4be942[_0xce41('0x1b')]=_0x57f5d6[_0xce41('0x6b')]({'plain':!![]});return db[_0xce41('0x6c')][_0xce41('0x45')]({'where':{'id':_0x57f5d6[_0xce41('0x6d')]}});}return null;})[_0xce41('0x14')](handleEntityNotFound(_0x2e2105,null))['then'](function(_0x433381){if(_0x433381){return _0x433381[_0xce41('0x46')]({'UserId':_0x3f8dac[_0xce41('0x47')][_0xce41('0x67')],'read1stAt':_[_0xce41('0x6e')](_0x433381[_0xce41('0x6f')])?moment()[_0xce41('0x61')](_0xce41('0x66')):undefined});}return null;})[_0xce41('0x14')](function(_0x51d470){if(_0x51d470){_0x4be942[_0xce41('0x70')]=_0x51d470['get']({'plain':!![]});interaction_log[_0xce41('0x1c')](_0xce41('0x71'),_0x3f8dac[_0xce41('0x68')]['id'],_0x3f8dac[_0xce41('0x68')][_0xce41('0x29')],_0x3f8dac[_0xce41('0x68')][_0xce41('0x72')],_0x4be942[_0xce41('0x70')]['id'],_0x3f8dac[_0xce41('0x47')]?JSON[_0xce41('0x18')](_0x3f8dac[_0xce41('0x47')]):_0xce41('0x73'));return respondWithRpcPromise(_0xce41('0x74'),_0xce41('0x75'),_0x4be942);}return null;})[_0xce41('0x14')](function(_0x3124aa){var _0x412b82='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3124aa['message'][_0xce41('0x76')];return db[_0xce41('0x77')][_0xce41('0x31')](_0x412b82,{'type':db['Sequelize'][_0xce41('0x78')][_0xce41('0x79')],'raw':!![]})[_0xce41('0x14')](function(_0xb5e4aa){return _0xb5e4aa;});})[_0xce41('0x14')](function(_0xdfad56){if(_0xdfad56){_0x4be942[_0xce41('0x1b')][_0xce41('0x7a')]=_0xdfad56[0x0];if(!_0x3f8dac[_0xce41('0x47')][_0xce41('0x67')])return;return db[_0xce41('0x7b')]['find']({'where':{'id':_0x3f8dac['body'][_0xce41('0x67')],'role':_0xce41('0x69')},'attributes':['id',_0xce41('0x29'),_0xce41('0x7c'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x56403f){if(!_0x56403f)return null;_0x4be942[_0xce41('0x1b')][_0xce41('0x69')]=_0x56403f;return _0x4be942;})[_0xce41('0x14')](function(_0x4d9a91){if(_0x4d9a91){if(_0x3f8dac[_0xce41('0x47')][_0xce41('0x7d')]){_0x4be942['message'][_0xce41('0x7e')]=util[_0xce41('0x61')](_0xce41('0x7f'),_0x3f8dac[_0xce41('0x68')][_0xce41('0x29')]);_0x4be942[_0xce41('0x1b')][_0xce41('0x80')]=_0x4be942[_0xce41('0x80')];_0x4be942['message'][_0xce41('0x81')]=_0x4be942[_0xce41('0x80')];_0x4be942[_0xce41('0x1b')][_0xce41('0x82')]=_0xce41('0x62');_0x4be942[_0xce41('0x1b')]['body']=htmlToText[_0xce41('0x83')](_0x4be942[_0xce41('0x1b')][_0xce41('0x47')]);return respondWithRpcPromise('EventManager',_0xce41('0x84'),{'event':_0xce41('0x85'),'message':_0x4be942[_0xce41('0x1b')]},client9002)['then'](function(){return _0x4be942;});}return _0x4be942;}return null;})[_0xce41('0x14')](respondWithResult(_0x2e2105,null))[_0xce41('0x1d')](handleError(_0x2e2105,null));};exports[_0xce41('0x86')]=function(_0x16e7ea,_0x34ec69){var _0x2b196d={'agent':{},'channel':_0xce41('0x63')};if(_0x16e7ea[_0xce41('0x47')]['id']){delete _0x16e7ea[_0xce41('0x47')]['id'];}_0x16e7ea[_0xce41('0x47')]['UserId']=_0x16e7ea['body']['UserId']||_0x16e7ea['user']['id'];_0x2b196d['agent']['id']=_0x16e7ea[_0xce41('0x47')]['UserId'];return db[_0xce41('0x2c')][_0xce41('0x45')]({'where':{'id':_0x16e7ea[_0xce41('0x6a')]['id'],'UserId':null}})[_0xce41('0x14')](handleEntityNotFound(_0x34ec69,null))[_0xce41('0x14')](function(_0x58fa66){if(_0x58fa66){_0x2b196d[_0xce41('0x1b')]=_0x58fa66[_0xce41('0x6b')]({'plain':!![]});return db[_0xce41('0x6c')][_0xce41('0x45')]({'where':{'id':_0x58fa66[_0xce41('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x34ec69,null))[_0xce41('0x14')](function(_0x28ce4e){if(_0x28ce4e){_0x2b196d['interaction']=_0x28ce4e[_0xce41('0x6b')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x16e7ea[_0xce41('0x68')]['id'],_0x16e7ea[_0xce41('0x68')][_0xce41('0x29')],_0x16e7ea[_0xce41('0x68')][_0xce41('0x72')],_0x2b196d['interaction']['id'],_0x16e7ea['body']?JSON[_0xce41('0x18')](_0x16e7ea[_0xce41('0x47')]):_0xce41('0x73'));return respondWithRpcPromise(_0xce41('0x87'),_0xce41('0x88'),_0x2b196d);}return null;})[_0xce41('0x14')](function(_0x1a47aa){var _0x12898c=_0xce41('0x89')+_0x1a47aa['message'][_0xce41('0x76')];return db['sequelize'][_0xce41('0x31')](_0x12898c,{'type':db[_0xce41('0x8a')]['QueryTypes'][_0xce41('0x79')],'raw':!![]})['then'](function(_0x40915d){return _0x40915d;});})[_0xce41('0x14')](function(_0x6c9e71){if(_0x6c9e71){_0x2b196d[_0xce41('0x1b')][_0xce41('0x7a')]=_0x6c9e71[0x0];if(!_0x16e7ea[_0xce41('0x47')][_0xce41('0x67')])return;return db[_0xce41('0x7b')][_0xce41('0x45')]({'where':{'id':_0x16e7ea[_0xce41('0x47')][_0xce41('0x67')],'role':'agent'},'attributes':['id',_0xce41('0x29'),_0xce41('0x7c'),_0xce41('0x8b'),_0xce41('0x8c')],'raw':!![]});}return null;})[_0xce41('0x14')](function(_0x260c85){if(!_0x260c85)return null;_0x2b196d[_0xce41('0x1b')][_0xce41('0x69')]=_0x260c85;return _0x2b196d;})[_0xce41('0x14')](function(_0x4302cd){if(_0x4302cd){_0x4302cd[_0xce41('0x1b')]['interface']=util['format'](_0xce41('0x7f'),_0x16e7ea[_0xce41('0x68')][_0xce41('0x29')]);_0x4302cd[_0xce41('0x1b')][_0xce41('0x80')]=_0x2b196d[_0xce41('0x80')];_0x4302cd[_0xce41('0x1b')][_0xce41('0x81')]=_0x2b196d[_0xce41('0x80')];_0x4302cd[_0xce41('0x1b')][_0xce41('0x82')]=_0xce41('0x86');_0x4302cd[_0xce41('0x1b')][_0xce41('0x47')]=htmlToText[_0xce41('0x83')](_0x2b196d['message'][_0xce41('0x47')]);respondWithRpcPromise('EventManager',_0xce41('0x84'),{'event':_0xce41('0x8d'),'message':_0x4302cd['message']},client9002);return _0x2b196d;}return null;})['then'](respondWithResult(_0x34ec69,null))[_0xce41('0x1d')](handleError(_0x34ec69,null));};exports[_0xce41('0x8e')]=function(_0x1a1852,_0x40cfeb){var _0xa4229f=moment()[_0xce41('0x8f')]()[_0xce41('0x90')]();var _0xb3bacc=path[_0xce41('0x59')](config['root'],_0xce41('0x91'),_0xce41('0x92'),'tmp');var _0x41229f=path['join'](config[_0xce41('0x5a')],'server',_0xce41('0x92'),'attachments');var _0x85a54b=util[_0xce41('0x61')]('message-%s.eml',_0xa4229f);return db[_0xce41('0x2c')][_0xce41('0x45')]({'where':{'id':_0x1a1852[_0xce41('0x6a')]['id']},'attributes':['id',_0xce41('0x47'),'from','to','cc',_0xce41('0x93'),_0xce41('0x94'),_0xce41('0x95')],'include':_0x1a1852[_0xce41('0x31')]['attachments']?[{'model':db[_0xce41('0x96')],'as':_0xce41('0x97')}]:undefined})['then'](handleEntityNotFound(_0x40cfeb,null))[_0xce41('0x14')](function(_0x17e8df){if(_0x17e8df){var _0x4f94ec=_0x17e8df;var _0x5c1b1b={'from':_0x4f94ec[_0xce41('0x98')],'to':_0x4f94ec['to'],'subject':_0x4f94ec[_0xce41('0x94')],'html':htmlEntities[_0xce41('0x99')](_0x4f94ec[_0xce41('0x47')]),'headers':{'Date':moment(_0x4f94ec[_0xce41('0x95')])[_0xce41('0x61')](_0xce41('0x9a'))},'attachments':[]};if(_0x17e8df['cc']){_0x5c1b1b['headers']['Cc']=_0x17e8df['cc'];}if(_0x17e8df[_0xce41('0x93')]){_0x5c1b1b['headers'][_0xce41('0x9b')]=_0x17e8df[_0xce41('0x93')];}return new BPromise(function(_0xb912d2,_0x1e839f){if(_0x17e8df[_0xce41('0x97')]){for(var _0x28ebed=0x0;_0x28ebed<_0x17e8df[_0xce41('0x97')][_0xce41('0x37')];_0x28ebed++){var _0x3839dd=_0x17e8df[_0xce41('0x97')][_0x28ebed];var _0xf90097=path[_0xce41('0x59')](_0x41229f,_0x3839dd[_0xce41('0x5c')]);if(fs[_0xce41('0x9c')](_0xf90097)){_0x5c1b1b[_0xce41('0x58')][_0xce41('0x9d')]({'name':_0x3839dd['name'],'contentType':_0x3839dd[_0xce41('0x2e')],'data':fs[_0xce41('0x9e')](_0xf90097)});}}}emlformat['build'](_0x5c1b1b,function(_0x13ab17,_0x4bd96c){if(_0x13ab17)return _0x1e839f(_0x13ab17);fs['writeFileSync'](path['join'](_0xb3bacc,_0x85a54b),_0x4bd96c);return _0xb912d2(_0x4bd96c);});});}})[_0xce41('0x14')](function(_0x37c36c){if(_0x37c36c){return _0x40cfeb[_0xce41('0x8e')](path[_0xce41('0x59')](_0xb3bacc,_0x85a54b),_0x85a54b,function(_0x460785){if(!_0x460785)fs[_0xce41('0x9f')](path[_0xce41('0x59')](_0xb3bacc,_0x85a54b));});}})[_0xce41('0x1d')](handleError(_0x40cfeb,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 8d5ec53..b3f1e68 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 _0xf111=['../../mysqldb','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3a7077,_0x1f9d15){var _0x3ad27d=function(_0x3e2ece){while(--_0x3e2ece){_0x3a7077['push'](_0x3a7077['shift']());}};_0x3ad27d(++_0x1f9d15);}(_0xf111,0x77));var _0x1f11=function(_0x375492,_0x4ed149){_0x375492=_0x375492-0x0;var _0x18ba5b=_0xf111[_0x375492];return _0x18ba5b;};'use strict';var EventEmitter=require(_0x1f11('0x0'));var MailMessage=require(_0x1f11('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1f11('0x2'),'afterUpdate':_0x1f11('0x3'),'afterDestroy':_0x1f11('0x4')};function emitEvent(_0x27e991){return function(_0x53939b,_0x5185b8,_0xc94731){MailMessageEvents[_0x1f11('0x5')](_0x27e991+':'+_0x53939b['id'],_0x53939b);MailMessageEvents[_0x1f11('0x5')](_0x27e991,_0x53939b);_0xc94731(null);};}for(var e in events){if(events[_0x1f11('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x1f11('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x821e=['../../mysqldb','setMaxListeners','save','emit','hook','exports','events'];(function(_0x5702fa,_0x1ddb0d){var _0xbe34af=function(_0x1c43b5){while(--_0x1c43b5){_0x5702fa['push'](_0x5702fa['shift']());}};_0xbe34af(++_0x1ddb0d);}(_0x821e,0xd8));var _0xe821=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x821e[_0x470e67];return _0x28bbde;};'use strict';var EventEmitter=require(_0xe821('0x0'));var MailMessage=require(_0xe821('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe821('0x2')](0x0);var events={'afterCreate':_0xe821('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4c286f){return function(_0x2d856e,_0x2155b8,_0x31d0ce){MailMessageEvents[_0xe821('0x4')](_0x4c286f+':'+_0x2d856e['id'],_0x2d856e);MailMessageEvents['emit'](_0x4c286f,_0x2d856e);_0x31d0ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xe821('0x5')](e,emitEvent(event));}}module[_0xe821('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 0f81f72..5590f5a 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 _0x6c99=['mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage'];(function(_0x2c5cbf,_0x4e4349){var _0x3efeae=function(_0x1f7db8){while(--_0x1f7db8){_0x2c5cbf['push'](_0x2c5cbf['shift']());}};_0x3efeae(++_0x4e4349);}(_0x6c99,0x106));var _0x96c9=function(_0x1a89a1,_0x56d889){_0x1a89a1=_0x1a89a1-0x0;var _0x3d5b46=_0x6c99[_0x1a89a1];return _0x3d5b46;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x96c9('0x0'))(_0x96c9('0x1'));var moment=require(_0x96c9('0x2'));var BPromise=require('bluebird');var rp=require(_0x96c9('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x96c9('0x4'));var rimraf=require(_0x96c9('0x5'));var config=require(_0x96c9('0x6'));var attributes=require(_0x96c9('0x7'));module['exports']=function(_0x430781,_0x1ddaf4){return _0x430781[_0x96c9('0x8')](_0x96c9('0x9'),attributes,{'tableName':_0x96c9('0xa'),'paranoid':![],'indexes':[{'name':_0x96c9('0xb'),'fields':['messageId']},{'name':_0x96c9('0xc'),'fields':[_0x96c9('0xd'),_0x96c9('0xe')],'type':_0x96c9('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47cc36,_0x4be861,_0x5840f0){if(_0x47cc36[_0x96c9('0x10')]){_0x47cc36[_0x96c9('0xd')]=htmlToText[_0x96c9('0x11')](_0x47cc36[_0x96c9('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5840f0(null,_0x4be861);},'afterCreate':function(_0x3ebdbc,_0x1313b5,_0x153d2f){var _0x32a6c6=_0x430781[_0x96c9('0x12')];var _0x522f1a=_0x3ebdbc['get']({'plain':!![]});if(_0x522f1a[_0x96c9('0x13')][_0x96c9('0x14')]()==='in'||_0x522f1a[_0x96c9('0x13')][_0x96c9('0x14')]()===_0x96c9('0x15')&&!_0x522f1a[_0x96c9('0x16')]&&!_[_0x96c9('0x17')](_0x522f1a[_0x96c9('0x18')])){_0x32a6c6[_0x96c9('0x19')]['findOne']({'where':{'id':_0x522f1a[_0x96c9('0x1a')]}})[_0x96c9('0x1b')](function(_0x385269){if(_0x385269){_0x385269[_0x96c9('0x1c')]({'lastMsgAt':_0x522f1a[_0x96c9('0x1d')],'lastMsgDirection':_0x522f1a[_0x96c9('0x13')][_0x96c9('0x14')]()});}})[_0x96c9('0x1e')](function(_0x1051c6){console[_0x96c9('0x1f')](_0x1051c6);});}_0x153d2f();}},'charset':_0x96c9('0x20'),'collate':_0x96c9('0x21')});}; \ No newline at end of file +var _0xf4e1=['../../config/logger','api','moment','html-to-text','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x4ffd20,_0x1e83b6){var _0x49b5e2=function(_0xfdd1a6){while(--_0xfdd1a6){_0x4ffd20['push'](_0x4ffd20['shift']());}};_0x49b5e2(++_0x1e83b6);}(_0xf4e1,0xff));var _0x1f4e=function(_0x392a16,_0x1c4c9d){_0x392a16=_0x392a16-0x0;var _0x3b33ef=_0xf4e1[_0x392a16];return _0x3b33ef;};'use strict';var _=require('lodash');var util=require(_0x1f4e('0x0'));var logger=require(_0x1f4e('0x1'))(_0x1f4e('0x2'));var moment=require(_0x1f4e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var htmlToText=require(_0x1f4e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1f4e('0x5'));var attributes=require(_0x1f4e('0x6'));module[_0x1f4e('0x7')]=function(_0x1800d5,_0x5d7051){return _0x1800d5[_0x1f4e('0x8')](_0x1f4e('0x9'),attributes,{'tableName':_0x1f4e('0xa'),'paranoid':![],'indexes':[{'name':_0x1f4e('0xb'),'fields':[_0x1f4e('0xb')]},{'name':'fti_mail_messages','fields':[_0x1f4e('0xc'),_0x1f4e('0xd')],'type':_0x1f4e('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x364b38,_0x14aa74,_0x31adc6){if(_0x364b38[_0x1f4e('0xf')]){_0x364b38[_0x1f4e('0xc')]=htmlToText[_0x1f4e('0x10')](_0x364b38[_0x1f4e('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x31adc6(null,_0x14aa74);},'afterCreate':function(_0x114413,_0x42f078,_0x459984){var _0xaa0dfa=_0x1800d5[_0x1f4e('0x11')];var _0x1ec4d5=_0x114413[_0x1f4e('0x12')]({'plain':!![]});if(_0x1ec4d5[_0x1f4e('0x13')][_0x1f4e('0x14')]()==='in'||_0x1ec4d5['direction'][_0x1f4e('0x14')]()===_0x1f4e('0x15')&&!_0x1ec4d5[_0x1f4e('0x16')]&&!_['isNil'](_0x1ec4d5[_0x1f4e('0x17')])){_0xaa0dfa[_0x1f4e('0x18')][_0x1f4e('0x19')]({'where':{'id':_0x1ec4d5['MailInteractionId']}})[_0x1f4e('0x1a')](function(_0x2ea648){if(_0x2ea648){_0x2ea648[_0x1f4e('0x1b')]({'lastMsgAt':_0x1ec4d5[_0x1f4e('0x1c')],'lastMsgDirection':_0x1ec4d5['direction'][_0x1f4e('0x14')]()});}})[_0x1f4e('0x1d')](function(_0x5c06b8){console['error'](_0x5c06b8);});}_0x459984();}},'charset':_0x1f4e('0x1e'),'collate':_0x1f4e('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 66c7628..e8b55d0 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 _0xda2d=['body','options','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','CreateMailMessage','MailMessage'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0xda2d,0x102));var _0xdda2=function(_0xe96b71,_0x50da82){_0xe96b71=_0xe96b71-0x0;var _0x21a511=_0xda2d[_0xe96b71];return _0x21a511;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});config[_0xdda2('0xa')]=_[_0xdda2('0xb')](config[_0xdda2('0xa')],{'host':_0xdda2('0xc'),'port':0x18eb});var socket=require(_0xdda2('0xd'))(new Redis(config['redis']));require(_0xdda2('0xe'))[_0xdda2('0xf')](socket);function respondWithRpcPromise(_0x4df6b8,_0x1c11b2,_0x2f3454){return new BPromise(function(_0x42d990,_0x346119){return client[_0xdda2('0x10')](_0x4df6b8,_0x2f3454)[_0xdda2('0x11')](function(_0x26fe81){logger[_0xdda2('0x12')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,'request\x20sent');logger['debug'](_0xdda2('0x13'),_0x1c11b2,_0xdda2('0x14'),JSON[_0xdda2('0x15')](_0x26fe81));if(_0x26fe81[_0xdda2('0x16')]){if(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x17')]===0x1f4){logger[_0xdda2('0x16')]('MailMessage,\x20%s,\x20%s',_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x346119(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x18')]);}logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x42d990(_0x26fe81['error'][_0xdda2('0x18')]);}else{logger['info'](_0xdda2('0x19'),_0x1c11b2,_0xdda2('0x14'));_0x42d990(_0x26fe81[_0xdda2('0x1a')][_0xdda2('0x18')]);}})[_0xdda2('0x1b')](function(_0x17015f){logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x17015f);_0x346119(_0x17015f);});});}exports[_0xdda2('0x1c')]=function(_0x337b0b){var _0x312ef1=this;return new Promise(function(_0x6fdede,_0x4eed30){return db[_0xdda2('0x1d')]['create'](_0x337b0b[_0xdda2('0x1e')],{'raw':_0x337b0b[_0xdda2('0x1f')]?_0x337b0b[_0xdda2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xdda2('0x11')](function(_0x5a9bb8){logger[_0xdda2('0x12')](_0xdda2('0x1c'),_0x337b0b);logger['debug'](_0xdda2('0x1c'),_0x337b0b,JSON[_0xdda2('0x15')](_0x5a9bb8));_0x6fdede(_0x5a9bb8);})[_0xdda2('0x1b')](function(_0x13b0f3){logger[_0xdda2('0x16')]('CreateMailMessage',_0x13b0f3[_0xdda2('0x18')],_0x337b0b);_0x4eed30(_0x312ef1[_0xdda2('0x16')](0x1f4,_0x13b0f3[_0xdda2('0x18')]));});});}; \ No newline at end of file +var _0x0972=['message','catch','CreateMailMessage','MailMessage','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x357fca,_0x1060d6){var _0x3beacf=function(_0x58d66c){while(--_0x58d66c){_0x357fca['push'](_0x357fca['shift']());}};_0x3beacf(++_0x1060d6);}(_0x0972,0x64));var _0x2097=function(_0xc401ba,_0x1e7d87){_0xc401ba=_0xc401ba-0x0;var _0x2212e6=_0x0972[_0xc401ba];return _0x2212e6;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});config[_0x2097('0xa')]=_['defaults'](config[_0x2097('0xa')],{'host':_0x2097('0xb'),'port':0x18eb});var socket=require(_0x2097('0xc'))(new Redis(config[_0x2097('0xa')]));require(_0x2097('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e0024,_0x3b8b76,_0x131f06){return new BPromise(function(_0x430754,_0x7baeb3){return client[_0x2097('0xe')](_0x2e0024,_0x131f06)[_0x2097('0xf')](function(_0x1d1166){logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));logger[_0x2097('0x13')](_0x2097('0x14'),_0x3b8b76,_0x2097('0x12'),JSON[_0x2097('0x15')](_0x1d1166));if(_0x1d1166[_0x2097('0x16')]){if(_0x1d1166[_0x2097('0x16')][_0x2097('0x17')]===0x1f4){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x1d1166['error'][_0x2097('0x18')]);return _0x7baeb3(_0x1d1166[_0x2097('0x16')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3b8b76,_0x1d1166[_0x2097('0x16')]['message']);return _0x430754(_0x1d1166[_0x2097('0x16')][_0x2097('0x18')]);}else{logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));_0x430754(_0x1d1166['result'][_0x2097('0x18')]);}})[_0x2097('0x19')](function(_0x451584){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x451584);_0x7baeb3(_0x451584);});});}exports[_0x2097('0x1a')]=function(_0x253f5d){var _0x46b5e0=this;return new Promise(function(_0x5d8b9e,_0x4d957e){return db[_0x2097('0x1b')]['create'](_0x253f5d[_0x2097('0x1c')],{'raw':_0x253f5d[_0x2097('0x1d')]?_0x253f5d['options'][_0x2097('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x2e17c8){logger[_0x2097('0x10')](_0x2097('0x1a'),_0x253f5d);logger[_0x2097('0x13')](_0x2097('0x1a'),_0x253f5d,JSON[_0x2097('0x15')](_0x2e17c8));_0x5d8b9e(_0x2e17c8);})['catch'](function(_0xae5f9){logger['error'](_0x2097('0x1a'),_0xae5f9[_0x2097('0x18')],_0x253f5d);_0x4d957e(_0x46b5e0[_0x2097('0x16')](0x1f4,_0xae5f9[_0x2097('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 0316bb5..96216ee 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 _0x5a38=['register','length','remove','update','emit','removeListener'];(function(_0x27e1c9,_0xda67a0){var _0x55b510=function(_0x2f1234){while(--_0x2f1234){_0x27e1c9['push'](_0x27e1c9['shift']());}};_0x55b510(++_0xda67a0);}(_0x5a38,0x16a));var _0x85a3=function(_0x4e96d8,_0x20304f){_0x4e96d8=_0x4e96d8-0x0;var _0x5cb02d=_0x5a38[_0x4e96d8];return _0x5cb02d;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x85a3('0x0'),_0x85a3('0x1')];function createListener(_0x1e5ac4,_0x228d94){return function(_0x1aa1c0){_0x228d94[_0x85a3('0x2')](_0x1e5ac4,_0x1aa1c0);};}function removeListener(_0x47bc8e,_0x33586d){return function(){MailMessageEvents[_0x85a3('0x3')](_0x47bc8e,_0x33586d);};}exports[_0x85a3('0x4')]=function(_0x2632e6){for(var _0x5971a9=0x0,_0xf18c15=events[_0x85a3('0x5')];_0x5971a9<_0xf18c15;_0x5971a9++){var _0x45bcc4=events[_0x5971a9];var _0xd26bac=createListener('mailMessage:'+_0x45bcc4,_0x2632e6);MailMessageEvents['on'](_0x45bcc4,_0xd26bac);}}; \ No newline at end of file +var _0x82a2=['./mailMessage.events','remove','update','emit','removeListener','mailMessage:'];(function(_0x29faf7,_0x37395d){var _0x499262=function(_0x205fe6){while(--_0x205fe6){_0x29faf7['push'](_0x29faf7['shift']());}};_0x499262(++_0x37395d);}(_0x82a2,0x17a));var _0x282a=function(_0x3fd16c,_0x59809c){_0x3fd16c=_0x3fd16c-0x0;var _0x2806f7=_0x82a2[_0x3fd16c];return _0x2806f7;};'use strict';var MailMessageEvents=require(_0x282a('0x0'));var events=['save',_0x282a('0x1'),_0x282a('0x2')];function createListener(_0x30cd99,_0x24e2e8){return function(_0x12f55d){_0x24e2e8[_0x282a('0x3')](_0x30cd99,_0x12f55d);};}function removeListener(_0x1b7f0f,_0x431bde){return function(){MailMessageEvents[_0x282a('0x4')](_0x1b7f0f,_0x431bde);};}exports['register']=function(_0x2cc807){for(var _0x4bf75f=0x0,_0x7bc1b5=events['length'];_0x4bf75f<_0x7bc1b5;_0x4bf75f++){var _0x48e7f4=events[_0x4bf75f];var _0x161255=createListener(_0x282a('0x5')+_0x48e7f4,_0x2cc807);MailMessageEvents['on'](_0x48e7f4,_0x161255);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b92acec..4412eb8 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 _0x2f81=['removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','/:id','update','destroy','delete','removeTeams'];(function(_0x2e25b5,_0x5cd8e2){var _0x10ba3a=function(_0x44e16a){while(--_0x44e16a){_0x2e25b5['push'](_0x2e25b5['shift']());}};_0x10ba3a(++_0x5cd8e2);}(_0x2f81,0x1d3));var _0x12f8=function(_0x2e9187,_0x3763f6){_0x2e9187=_0x2e9187-0x0;var _0x1fc3a8=_0x2f81[_0x2e9187];return _0x1fc3a8;};'use strict';var multer=require(_0x12f8('0x0'));var util=require(_0x12f8('0x1'));var path=require('path');var timeout=require(_0x12f8('0x2'));var express=require('express');var router=express[_0x12f8('0x3')]();var fs_extra=require(_0x12f8('0x4'));var auth=require(_0x12f8('0x5'));var interaction=require(_0x12f8('0x6'));var config=require(_0x12f8('0x7'));var controller=require(_0x12f8('0x8'));router[_0x12f8('0x9')]('/',auth[_0x12f8('0xa')](),controller[_0x12f8('0xb')]);router['get'](_0x12f8('0xc'),auth[_0x12f8('0xa')](),controller[_0x12f8('0xd')]);router[_0x12f8('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x12f8('0x9')](_0x12f8('0xe'),auth[_0x12f8('0xa')](),controller[_0x12f8('0xf')]);router[_0x12f8('0x9')](_0x12f8('0x10'),auth[_0x12f8('0xa')](),controller[_0x12f8('0x11')]);router[_0x12f8('0x9')](_0x12f8('0x12'),auth['isAuthenticated'](),controller['getAgents']);router[_0x12f8('0x13')]('/',auth['isAuthenticated'](),controller[_0x12f8('0x14')]);router['post'](_0x12f8('0x10'),auth[_0x12f8('0xa')](),controller[_0x12f8('0x15')]);router[_0x12f8('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x12f8('0x16')]);router[_0x12f8('0x17')](_0x12f8('0x18'),auth[_0x12f8('0xa')](),controller[_0x12f8('0x19')]);router['delete']('/:id',auth[_0x12f8('0xa')](),controller[_0x12f8('0x1a')]);router[_0x12f8('0x1b')](_0x12f8('0x10'),auth['isAuthenticated'](),controller[_0x12f8('0x1c')]);router[_0x12f8('0x1b')](_0x12f8('0x12'),auth[_0x12f8('0xa')](),controller[_0x12f8('0x1d')]);module[_0x12f8('0x1e')]=router; \ No newline at end of file +var _0xf85c=['/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','addAgents'];(function(_0x52d543,_0x4982e1){var _0x572ca0=function(_0x4af633){while(--_0x4af633){_0x52d543['push'](_0x52d543['shift']());}};_0x572ca0(++_0x4982e1);}(_0xf85c,0x1b4));var _0xcf85=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xf85c[_0x45bf86];return _0x1f02b7;};'use strict';var multer=require(_0xcf85('0x0'));var util=require(_0xcf85('0x1'));var path=require(_0xcf85('0x2'));var timeout=require(_0xcf85('0x3'));var express=require(_0xcf85('0x4'));var router=express[_0xcf85('0x5')]();var fs_extra=require(_0xcf85('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xcf85('0x7'));var config=require(_0xcf85('0x8'));var controller=require(_0xcf85('0x9'));router[_0xcf85('0xa')]('/',auth[_0xcf85('0xb')](),controller[_0xcf85('0xc')]);router[_0xcf85('0xa')](_0xcf85('0xd'),auth[_0xcf85('0xb')](),controller[_0xcf85('0xe')]);router[_0xcf85('0xa')]('/:id',auth[_0xcf85('0xb')](),controller[_0xcf85('0xf')]);router[_0xcf85('0xa')](_0xcf85('0x10'),auth['isAuthenticated'](),controller[_0xcf85('0x11')]);router[_0xcf85('0xa')](_0xcf85('0x12'),auth[_0xcf85('0xb')](),controller[_0xcf85('0x13')]);router[_0xcf85('0xa')](_0xcf85('0x14'),auth[_0xcf85('0xb')](),controller[_0xcf85('0x15')]);router['post']('/',auth[_0xcf85('0xb')](),controller[_0xcf85('0x16')]);router['post'](_0xcf85('0x12'),auth[_0xcf85('0xb')](),controller[_0xcf85('0x17')]);router[_0xcf85('0x18')](_0xcf85('0x14'),auth[_0xcf85('0xb')](),controller[_0xcf85('0x19')]);router['put'](_0xcf85('0x1a'),auth[_0xcf85('0xb')](),controller[_0xcf85('0x1b')]);router[_0xcf85('0x1c')](_0xcf85('0x1a'),auth[_0xcf85('0xb')](),controller[_0xcf85('0x1d')]);router[_0xcf85('0x1c')](_0xcf85('0x12'),auth['isAuthenticated'](),controller[_0xcf85('0x1e')]);router['delete']('/:id/users',auth[_0xcf85('0xb')](),controller[_0xcf85('0x1f')]);module[_0xcf85('0x20')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index a3767f2..079ece9 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 _0x1cf0=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x103e9d,_0x3cff63){var _0x137520=function(_0x361b36){while(--_0x361b36){_0x103e9d['push'](_0x103e9d['shift']());}};_0x137520(++_0x3cff63);}(_0x1cf0,0x6c));var _0x01cf=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x1cf0[_0x49d41c];return _0xb64c5f;};'use strict';var Sequelize=require(_0x01cf('0x0'));module[_0x01cf('0x1')]={'name':{'type':Sequelize[_0x01cf('0x2')],'unique':_0x01cf('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x01cf('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x01cf('0x5')](_0x01cf('0x6'),_0x01cf('0x7'),_0x01cf('0x8'))}}; \ No newline at end of file +var _0x7e9b=['sequelize','exports','STRING','rrmemory','beepall','roundrobin'];(function(_0x1fbf82,_0x5a47f3){var _0x2374a5=function(_0x2131cb){while(--_0x2131cb){_0x1fbf82['push'](_0x1fbf82['shift']());}};_0x2374a5(++_0x5a47f3);}(_0x7e9b,0x132));var _0xb7e9=function(_0x38c4a6,_0x17f461){_0x38c4a6=_0x38c4a6-0x0;var _0x13591a=_0x7e9b[_0x38c4a6];return _0x13591a;};'use strict';var Sequelize=require(_0xb7e9('0x0'));module[_0xb7e9('0x1')]={'name':{'type':Sequelize[_0xb7e9('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb7e9('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb7e9('0x3'),_0xb7e9('0x4'),_0xb7e9('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 8d4a2a6..6b7dee7 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 _0x7ada=['../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','get','MailQueues','UserProfileResource','end','error','stack','name','index','map','MailQueue','rawAttributes','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','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','update','describe','getMembers','findOne','UserMailQueue','sort','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','%s/%s','SIP','getTeams','Team','ids','online','interface','flatMap','Agents','transaction','addTeams','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','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'];(function(_0x39f9f2,_0x37fc06){var _0x3febf8=function(_0x2811f2){while(--_0x2811f2){_0x39f9f2['push'](_0x39f9f2['shift']());}};_0x3febf8(++_0x37fc06);}(_0x7ada,0x103));var _0xa7ad=function(_0x326def,_0x4084e){_0x326def=_0x326def-0x0;var _0x24345c=_0x7ada[_0x326def];return _0x24345c;};'use strict';var emlformat=require(_0xa7ad('0x0'));var rimraf=require(_0xa7ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa7ad('0x2'));var rp=require('request-promise');var moment=require(_0xa7ad('0x3'));var BPromise=require(_0xa7ad('0x4'));var Mustache=require('mustache');var util=require(_0xa7ad('0x5'));var path=require('path');var sox=require(_0xa7ad('0x6'));var csv=require(_0xa7ad('0x7'));var ejs=require(_0xa7ad('0x8'));var fs=require('fs');var fs_extra=require(_0xa7ad('0x9'));var _=require(_0xa7ad('0xa'));var squel=require(_0xa7ad('0xb'));var crypto=require(_0xa7ad('0xc'));var jsforce=require(_0xa7ad('0xd'));var deskjs=require(_0xa7ad('0xe'));var toCsv=require(_0xa7ad('0x7'));var querystring=require(_0xa7ad('0xf'));var Papa=require(_0xa7ad('0x10'));var Redis=require(_0xa7ad('0x11'));var authService=require(_0xa7ad('0x12'));var qs=require(_0xa7ad('0x13'));var as=require(_0xa7ad('0x14'));var hardwareService=require(_0xa7ad('0x15'));var logger=require(_0xa7ad('0x16'))(_0xa7ad('0x17'));var utils=require('../../config/utils');var config=require(_0xa7ad('0x18'));var licenseUtil=require(_0xa7ad('0x19'));var db=require('../../mysqldb')['db'];config[_0xa7ad('0x1a')]=_[_0xa7ad('0x1b')](config[_0xa7ad('0x1a')],{'host':_0xa7ad('0x1c'),'port':0x18eb});var socket=require(_0xa7ad('0x1d'))(new Redis(config[_0xa7ad('0x1a')]));require(_0xa7ad('0x1e'))[_0xa7ad('0x1f')](socket);function respondWithStatusCode(_0x33b381,_0x418155){_0x418155=_0x418155||0xcc;return function(_0x5d83d1){if(_0x5d83d1){return _0x33b381[_0xa7ad('0x20')](_0x418155);}return _0x33b381[_0xa7ad('0x21')](_0x418155)['end']();};}function respondWithResult(_0x54225d,_0x3d5141){_0x3d5141=_0x3d5141||0xc8;return function(_0x5b179a){if(_0x5b179a){return _0x54225d['status'](_0x3d5141)[_0xa7ad('0x22')](_0x5b179a);}};}function respondWithFilteredResult(_0x26cc8a,_0x54c133){return function(_0x2b7227){if(_0x2b7227){var _0x288f78=typeof _0x54c133[_0xa7ad('0x23')]===_0xa7ad('0x24')&&typeof _0x54c133[_0xa7ad('0x25')]===_0xa7ad('0x24');var _0x5634e4=_0x2b7227[_0xa7ad('0x26')];var _0x36fcb5=_0x288f78?0x0:_0x54c133[_0xa7ad('0x23')];var _0x36e9ab=_0x288f78?_0x2b7227[_0xa7ad('0x26')]:_0x54c133[_0xa7ad('0x23')]+_0x54c133[_0xa7ad('0x25')];var _0x41a84b;if(_0x36e9ab>=_0x5634e4){_0x36e9ab=_0x5634e4;_0x41a84b=0xc8;}else{_0x41a84b=0xce;}_0x26cc8a['status'](_0x41a84b);return _0x26cc8a['set'](_0xa7ad('0x27'),_0x36fcb5+'-'+_0x36e9ab+'/'+_0x5634e4)['json'](_0x2b7227);}return null;};}function patchUpdates(_0x51f17c){return function(_0x21b26c){try{jsonpatch[_0xa7ad('0x28')](_0x21b26c,_0x51f17c,!![]);}catch(_0x5f342d){return BPromise['reject'](_0x5f342d);}return _0x21b26c[_0xa7ad('0x29')]();};}function saveUpdates(_0x324544,_0x2e2c4f){return function(_0x33f870){if(_0x33f870){return _0x33f870['update'](_0x324544)[_0xa7ad('0x2a')](function(_0x41de73){return _0x41de73;});}return null;};}function removeEntity(_0xfe1c60,_0x4e1fc9){return function(_0x4c04aa){if(_0x4c04aa){return _0x4c04aa[_0xa7ad('0x2b')]()['then'](function(){var _0x41376c=_0x4c04aa[_0xa7ad('0x2c')]({'plain':!![]});var _0x43d2de=_0xa7ad('0x2d');return db[_0xa7ad('0x2e')]['destroy']({'where':{'type':_0x43d2de,'resourceId':_0x41376c['id']}})['then'](function(){return _0x4c04aa;});})['then'](function(){_0xfe1c60['status'](0xcc)[_0xa7ad('0x2f')]();});}};}function handleEntityNotFound(_0x5e8c65,_0x31ce67){return function(_0x406112){if(!_0x406112){_0x5e8c65['sendStatus'](0x194);}return _0x406112;};}function handleError(_0x3cceef,_0x50c54b){_0x50c54b=_0x50c54b||0x1f4;return function(_0x565891){logger[_0xa7ad('0x30')](_0x565891[_0xa7ad('0x31')]);if(_0x565891[_0xa7ad('0x32')]){delete _0x565891[_0xa7ad('0x32')];}_0x3cceef[_0xa7ad('0x21')](_0x50c54b)['send'](_0x565891);};}exports[_0xa7ad('0x33')]=function(_0x22e7fc,_0x4e8858){var _0x587103={},_0xf245a4={},_0x3f16ae={'count':0x0,'rows':[]};var _0x22a098=_[_0xa7ad('0x34')](db[_0xa7ad('0x35')][_0xa7ad('0x36')],function(_0x521f18){return{'name':_0x521f18['fieldName'],'type':_0x521f18[_0xa7ad('0x37')]['key']};});_0xf245a4[_0xa7ad('0x38')]=_[_0xa7ad('0x34')](_0x22a098,_0xa7ad('0x32'));_0xf245a4['query']=_[_0xa7ad('0x39')](_0x22e7fc[_0xa7ad('0x3a')]);_0xf245a4[_0xa7ad('0x3b')]=_[_0xa7ad('0x3c')](_0xf245a4[_0xa7ad('0x38')],_0xf245a4[_0xa7ad('0x3a')]);_0x587103['attributes']=_['intersection'](_0xf245a4[_0xa7ad('0x38')],qs['fields'](_0x22e7fc[_0xa7ad('0x3a')][_0xa7ad('0x3d')]));_0x587103[_0xa7ad('0x3e')]=_0x587103['attributes'][_0xa7ad('0x3f')]?_0x587103['attributes']:_0xf245a4['model'];if(!_0x22e7fc[_0xa7ad('0x3a')][_0xa7ad('0x40')](_0xa7ad('0x41'))){_0x587103[_0xa7ad('0x25')]=qs[_0xa7ad('0x25')](_0x22e7fc['query'][_0xa7ad('0x25')]);_0x587103['offset']=qs[_0xa7ad('0x23')](_0x22e7fc['query'][_0xa7ad('0x23')]);}_0x587103[_0xa7ad('0x42')]=qs['sort'](_0x22e7fc[_0xa7ad('0x3a')]['sort']);_0x587103[_0xa7ad('0x43')]=qs[_0xa7ad('0x3b')](_[_0xa7ad('0x44')](_0x22e7fc[_0xa7ad('0x3a')],_0xf245a4[_0xa7ad('0x3b')]),_0x22a098);if(_0x22e7fc[_0xa7ad('0x3a')][_0xa7ad('0x45')]){_0x587103[_0xa7ad('0x43')]=_['merge'](_0x587103[_0xa7ad('0x43')],{'$or':_[_0xa7ad('0x34')](_0x22a098,function(_0x27de42){if(_0x27de42[_0xa7ad('0x37')]!==_0xa7ad('0x46')){var _0x1b73c4={};_0x1b73c4[_0x27de42[_0xa7ad('0x32')]]={'$like':'%'+_0x22e7fc['query']['filter']+'%'};return _0x1b73c4;}})});}_0x587103=_[_0xa7ad('0x47')]({},_0x587103,_0x22e7fc[_0xa7ad('0x48')]);var _0x19362f={'where':_0x587103[_0xa7ad('0x43')]};return db['MailQueue'][_0xa7ad('0x26')](_0x19362f)[_0xa7ad('0x2a')](function(_0x3ad142){_0x3f16ae[_0xa7ad('0x26')]=_0x3ad142;if(_0x22e7fc[_0xa7ad('0x3a')]['includeAll']){_0x587103[_0xa7ad('0x49')]=[{'all':!![]}];}return db[_0xa7ad('0x35')][_0xa7ad('0x4a')](_0x587103);})[_0xa7ad('0x2a')](function(_0x112e05){_0x3f16ae[_0xa7ad('0x4b')]=_0x112e05;return _0x3f16ae;})['then'](respondWithFilteredResult(_0x4e8858,_0x587103))[_0xa7ad('0x4c')](handleError(_0x4e8858,null));};exports['show']=function(_0x4e28d2,_0x4466db){var _0x1b148a={'raw':!![],'where':{'id':_0x4e28d2[_0xa7ad('0x4d')]['id']}},_0x5a733={};_0x5a733[_0xa7ad('0x38')]=_[_0xa7ad('0x39')](db[_0xa7ad('0x35')][_0xa7ad('0x36')]);_0x5a733['query']=_[_0xa7ad('0x39')](_0x4e28d2[_0xa7ad('0x3a')]);_0x5a733[_0xa7ad('0x3b')]=_[_0xa7ad('0x3c')](_0x5a733[_0xa7ad('0x38')],_0x5a733['query']);_0x1b148a[_0xa7ad('0x3e')]=_[_0xa7ad('0x3c')](_0x5a733[_0xa7ad('0x38')],qs[_0xa7ad('0x3d')](_0x4e28d2[_0xa7ad('0x3a')]['fields']));_0x1b148a[_0xa7ad('0x3e')]=_0x1b148a[_0xa7ad('0x3e')][_0xa7ad('0x3f')]?_0x1b148a[_0xa7ad('0x3e')]:_0x5a733[_0xa7ad('0x38')];if(_0x4e28d2[_0xa7ad('0x3a')]['includeAll']){_0x1b148a[_0xa7ad('0x49')]=[{'all':!![]}];}_0x1b148a=_[_0xa7ad('0x47')]({},_0x1b148a,_0x4e28d2['options']);return db[_0xa7ad('0x35')][_0xa7ad('0x4e')](_0x1b148a)[_0xa7ad('0x2a')](handleEntityNotFound(_0x4466db,null))['then'](respondWithResult(_0x4466db,null))[_0xa7ad('0x4c')](handleError(_0x4466db,null));};exports[_0xa7ad('0x4f')]=function(_0x28e355,_0x1bc986){return db[_0xa7ad('0x35')][_0xa7ad('0x4f')](_0x28e355[_0xa7ad('0x50')],{})['then'](function(_0x53c145){var _0x4c6e40=_0x28e355[_0xa7ad('0x51')]['get']({'plain':!![]});if(!_0x4c6e40)throw new Error(_0xa7ad('0x52'));if(_0x4c6e40[_0xa7ad('0x53')]===_0xa7ad('0x51')){var _0x462c0c=_0x53c145[_0xa7ad('0x2c')]({'plain':!![]});var _0x3e4c35='MailQueues';return db['UserProfileSection'][_0xa7ad('0x4e')]({'where':{'name':_0x3e4c35,'userProfileId':_0x4c6e40[_0xa7ad('0x54')]},'raw':!![]})[_0xa7ad('0x2a')](function(_0x2133b8){if(_0x2133b8&&_0x2133b8[_0xa7ad('0x55')]===0x0){return db['UserProfileResource'][_0xa7ad('0x4f')]({'name':_0x462c0c[_0xa7ad('0x32')],'resourceId':_0x462c0c['id'],'type':_0x2133b8[_0xa7ad('0x32')],'sectionId':_0x2133b8['id']},{})['then'](function(){return _0x53c145;});}else{return _0x53c145;}})[_0xa7ad('0x4c')](function(_0x69353c){logger['error'](_0xa7ad('0x56'),_0x69353c);throw _0x69353c;});}return _0x53c145;})[_0xa7ad('0x2a')](respondWithResult(_0x1bc986,0xc9))[_0xa7ad('0x4c')](handleError(_0x1bc986,null));};exports[_0xa7ad('0x57')]=function(_0x190af6,_0x7fd642){if(_0x190af6['body']['id']){delete _0x190af6[_0xa7ad('0x50')]['id'];}return db[_0xa7ad('0x35')]['find']({'where':{'id':_0x190af6[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x7fd642,null))['then'](saveUpdates(_0x190af6[_0xa7ad('0x50')],null))[_0xa7ad('0x2a')](respondWithResult(_0x7fd642,null))[_0xa7ad('0x4c')](handleError(_0x7fd642,null));};exports[_0xa7ad('0x2b')]=function(_0x2f1729,_0x52f302){return db[_0xa7ad('0x35')][_0xa7ad('0x4e')]({'where':{'id':_0x2f1729['params']['id']}})['then'](handleEntityNotFound(_0x52f302,null))[_0xa7ad('0x2a')](removeEntity(_0x52f302,null))[_0xa7ad('0x4c')](handleError(_0x52f302,null));};exports['describe']=function(_0x41f31c,_0x44ca34){return db[_0xa7ad('0x35')][_0xa7ad('0x58')]()[_0xa7ad('0x2a')](respondWithResult(_0x44ca34,null))['catch'](handleError(_0x44ca34,null));};exports[_0xa7ad('0x59')]=function(_0x1ea022,_0x548538,_0xd0d679){var _0x4763ac={'raw':!![],'where':{}},_0x104fa9={},_0x5c4ddb;return db[_0xa7ad('0x35')][_0xa7ad('0x5a')]({'where':{'id':_0x1ea022[_0xa7ad('0x4d')]['id']}})['then'](handleEntityNotFound(_0x548538,null))[_0xa7ad('0x2a')](function(_0x51dc3a){if(_0x51dc3a){_0x5c4ddb=_0x51dc3a[_0xa7ad('0x2c')]({'plain':!![]});_0x104fa9[_0xa7ad('0x38')]=_['keys'](db[_0xa7ad('0x5b')][_0xa7ad('0x36')]);_0x104fa9[_0xa7ad('0x3a')]=_[_0xa7ad('0x39')](_0x1ea022['query']);_0x104fa9[_0xa7ad('0x3b')]=_['intersection'](_0x104fa9[_0xa7ad('0x38')],_0x104fa9['query']);_0x4763ac[_0xa7ad('0x3e')]=_[_0xa7ad('0x3c')](_0x104fa9[_0xa7ad('0x38')],qs[_0xa7ad('0x3d')](_0x1ea022['query'][_0xa7ad('0x3d')]));_0x4763ac[_0xa7ad('0x3e')]=_0x4763ac['attributes'][_0xa7ad('0x3f')]?_0x4763ac[_0xa7ad('0x3e')]:_0x104fa9[_0xa7ad('0x38')];if(!_0x1ea022[_0xa7ad('0x3a')][_0xa7ad('0x40')](_0xa7ad('0x41'))){_0x4763ac[_0xa7ad('0x25')]=qs[_0xa7ad('0x25')](_0x1ea022[_0xa7ad('0x3a')]['limit']);_0x4763ac['offset']=qs[_0xa7ad('0x23')](_0x1ea022[_0xa7ad('0x3a')][_0xa7ad('0x23')]);}_0x4763ac[_0xa7ad('0x42')]=qs[_0xa7ad('0x5c')](_0x1ea022[_0xa7ad('0x3a')][_0xa7ad('0x5c')]);_0x4763ac['where']=qs[_0xa7ad('0x3b')](_['pick'](_0x1ea022['query'],_0x104fa9[_0xa7ad('0x3b')]));_0x4763ac[_0xa7ad('0x43')][_0xa7ad('0x5d')]=_0x51dc3a['id'];if(_0x1ea022['query'][_0xa7ad('0x45')]){_0x4763ac['where']=_[_0xa7ad('0x47')](_0x4763ac[_0xa7ad('0x43')],{'$or':_['map'](_0x4763ac[_0xa7ad('0x3e')],function(_0x12e9df){var _0x252997={};_0x252997[_0x12e9df]={'$like':'%'+_0x1ea022[_0xa7ad('0x3a')][_0xa7ad('0x45')]+'%'};return _0x252997;})});}_0x4763ac=_['merge']({},_0x4763ac,_0x1ea022[_0xa7ad('0x48')]);return db['UserMailQueue'][_0xa7ad('0x4a')](_0x4763ac);}})[_0xa7ad('0x2a')](function(_0x43323a){if(_0x43323a){return db[_0xa7ad('0x5e')][_0xa7ad('0x5f')]({'where':{'id':_[_0xa7ad('0x34')](_0x43323a,_0xa7ad('0x60')),'role':_0xa7ad('0x61')},'attributes':['id',_0xa7ad('0x32'),_0xa7ad('0x62'),_0xa7ad('0x63'),'createdAt']});}})['then'](function(_0x46b9ea){if(_0x46b9ea){return{'count':_0x46b9ea[_0xa7ad('0x26')],'rows':_[_0xa7ad('0x34')](_0x46b9ea[_0xa7ad('0x4b')],function(_0x51bcf0){return{'membername':_0x51bcf0[_0xa7ad('0x32')],'UserId':_0x51bcf0['id'],'queue_name':_0x5c4ddb[_0xa7ad('0x32')],'MailQueueId':_0x5c4ddb['id'],'interface':util['format'](_0xa7ad('0x64'),_0xa7ad('0x65'),_0x51bcf0['name']),'penalty':0x0,'paused':_0x51bcf0[_0xa7ad('0x62')],'createdAt':_0x51bcf0['createdAt'],'updatedAt':_0x51bcf0[_0xa7ad('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x548538,_0x4763ac))[_0xa7ad('0x4c')](handleError(_0x548538,null));};exports[_0xa7ad('0x66')]=function(_0x16f5de,_0x3ed3af,_0x20d48d){var _0xbafc8f={};var _0x4100dd={};var _0x194d10;var _0x5c743e;return db[_0xa7ad('0x35')][_0xa7ad('0x5a')]({'where':{'id':_0x16f5de[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x3ed3af,null))['then'](function(_0x2b8b77){if(_0x2b8b77){_0x194d10=_0x2b8b77;_0x4100dd[_0xa7ad('0x38')]=_[_0xa7ad('0x39')](db[_0xa7ad('0x67')][_0xa7ad('0x36')]);_0x4100dd[_0xa7ad('0x3a')]=_[_0xa7ad('0x39')](_0x16f5de[_0xa7ad('0x3a')]);_0x4100dd[_0xa7ad('0x3b')]=_[_0xa7ad('0x3c')](_0x4100dd[_0xa7ad('0x38')],_0x4100dd[_0xa7ad('0x3a')]);_0xbafc8f[_0xa7ad('0x3e')]=_[_0xa7ad('0x3c')](_0x4100dd[_0xa7ad('0x38')],qs[_0xa7ad('0x3d')](_0x16f5de['query'][_0xa7ad('0x3d')]));_0xbafc8f[_0xa7ad('0x3e')]=_0xbafc8f[_0xa7ad('0x3e')]['length']?_0xbafc8f[_0xa7ad('0x3e')]:_0x4100dd[_0xa7ad('0x38')];_0xbafc8f[_0xa7ad('0x42')]=qs[_0xa7ad('0x5c')](_0x16f5de[_0xa7ad('0x3a')]['sort']);_0xbafc8f[_0xa7ad('0x43')]=qs[_0xa7ad('0x3b')](_[_0xa7ad('0x44')](_0x16f5de[_0xa7ad('0x3a')],_0x4100dd[_0xa7ad('0x3b')]));if(_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x45')]){_0xbafc8f[_0xa7ad('0x43')]=_[_0xa7ad('0x47')](_0xbafc8f['where'],{'$or':_[_0xa7ad('0x34')](_0xbafc8f[_0xa7ad('0x3e')],function(_0x5a95c7){var _0x254546={};_0x254546[_0x5a95c7]={'$like':'%'+_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x45')]+'%'};return _0x254546;})});}_0xbafc8f=_['merge']({},_0xbafc8f,_0x16f5de[_0xa7ad('0x48')]);return _0x194d10[_0xa7ad('0x66')](_0xbafc8f);}})[_0xa7ad('0x2a')](function(_0x3a7972){if(_0x3a7972){_0x5c743e=_0x3a7972[_0xa7ad('0x3f')];if(!_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x40')](_0xa7ad('0x41'))){_0xbafc8f[_0xa7ad('0x25')]=qs['limit'](_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x25')]);_0xbafc8f[_0xa7ad('0x23')]=qs['offset'](_0x16f5de[_0xa7ad('0x3a')][_0xa7ad('0x23')]);}return _0x194d10[_0xa7ad('0x66')](_0xbafc8f);}})[_0xa7ad('0x2a')](function(_0x34bf2e){if(_0x34bf2e){return _0x34bf2e?{'count':_0x5c743e,'rows':_0x34bf2e}:null;}})[_0xa7ad('0x2a')](respondWithResult(_0x3ed3af,null))[_0xa7ad('0x4c')](handleError(_0x3ed3af,null));};exports['addTeams']=function(_0x27f269,_0x5602e7,_0xaaf271){var _0x3d7cfc=_0x27f269['body'][_0xa7ad('0x68')];return db[_0xa7ad('0x67')][_0xa7ad('0x4a')]({'where':{'id':_0x3d7cfc},'attributes':['id'],'include':[{'model':db[_0xa7ad('0x5e')],'as':'Agents','attributes':['id',_0xa7ad('0x32'),_0xa7ad('0x69'),'voicePause',_0xa7ad('0x6a')],'raw':!![]}]})[_0xa7ad('0x2a')](function(_0x436268){if(_0x436268){var _0x5af571=_[_0xa7ad('0x6b')](_0x436268,function(_0x2cf829){var _0x548623=_0x2cf829[_0xa7ad('0x2c')]({'plain':!![]});return _0x548623[_0xa7ad('0x6c')];});return db[_0xa7ad('0x35')]['find']({'where':{'id':_0x27f269[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](function(_0x374d71){return db['sequelize'][_0xa7ad('0x6d')](function(_0x2b38c5){return _0x374d71[_0xa7ad('0x6e')](_0x3d7cfc,{'transaction':_0x2b38c5})[_0xa7ad('0x2a')](function(){return BPromise['each'](_0x5af571,function(_0x55e671){return db[_0xa7ad('0x5b')][_0xa7ad('0x6f')]({'where':{'UserId':_0x55e671['id'],'MailQueueId':_0x27f269[_0xa7ad('0x4d')]['id']},'transaction':_0x2b38c5});});})[_0xa7ad('0x2a')](function(){_0x5af571[_0xa7ad('0x70')](function(_0x5d568f){socket[_0xa7ad('0x71')](_0xa7ad('0x72'),{'UserId':_0x5d568f['id'],'MailQueueId':_0x374d71['id']});});});});});}})[_0xa7ad('0x2a')](respondWithStatusCode(_0x5602e7,null))[_0xa7ad('0x4c')](handleError(_0x5602e7,null));};exports[_0xa7ad('0x73')]=function(_0x49fc16,_0x2d1b12,_0x3dcaae){return db['Team']['findAll']({'where':{'id':_0x49fc16[_0xa7ad('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa7ad('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2d1b12,null))[_0xa7ad('0x2a')](function(_0x396c48){var _0x15b651=_['map'](_0x396c48,'id');var _0x34eb21=[];var _0x1f4416=[];var _0x1ba3e3=squel[_0xa7ad('0x74')]();_0x1ba3e3[_0xa7ad('0x75')](_0xa7ad('0x76'))[_0xa7ad('0x77')]('team_has_mail_queues','tq')[_0xa7ad('0x78')](_0xa7ad('0x79'),'ut',_0xa7ad('0x7a'))[_0xa7ad('0x43')](_0xa7ad('0x7b'),_0x49fc16['params']['id']);for(var _0x557979=0x0;_0x557979<_0x396c48[_0xa7ad('0x3f')];_0x557979+=0x1){let _0x517a22=_0x396c48[_0x557979];for(var _0x12dc00=0x0;_0x12dc00<_0x517a22[_0xa7ad('0x6c')][_0xa7ad('0x3f')];_0x12dc00+=0x1){let _0x385225=_0x517a22[_0xa7ad('0x6c')][_0x12dc00];var _0x2b3007=_0x1ba3e3[_0xa7ad('0x7c')]();_0x2b3007[_0xa7ad('0x43')]('ut.UserId\x20=\x20?',_0x385225['id']);_0x1f4416[_0xa7ad('0x7d')](db['sequelize'][_0xa7ad('0x3a')](_0x2b3007['toString'](),{'type':db[_0xa7ad('0x7e')][_0xa7ad('0x7f')][_0xa7ad('0x80')]})[_0xa7ad('0x2a')](function(_0x2d8513){if(_0x2d8513[_0xa7ad('0x3f')]===0x1){return _0x385225['id'];}else{var _0x37ed3f=_['every'](_[_0xa7ad('0x34')](_0x2d8513,_0xa7ad('0x81')),function(_0x476144){return _[_0xa7ad('0x82')](_0x15b651,_0x476144);});if(_0x37ed3f){return _0x385225['id'];}}}));}}return BPromise[_0xa7ad('0x83')](_0x1f4416)[_0xa7ad('0x2a')](function(_0x321c3b){_0x34eb21=_(_0x34eb21)[_0xa7ad('0x84')](_0x321c3b)[_0xa7ad('0x85')]()[_0xa7ad('0x86')]();return db[_0xa7ad('0x35')][_0xa7ad('0x4e')]({'where':{'id':_0x49fc16[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](function(_0x4f3d1a){return db[_0xa7ad('0x7e')]['transaction'](function(_0x49942a){return _0x4f3d1a[_0xa7ad('0x73')](_0x49fc16[_0xa7ad('0x3a')][_0xa7ad('0x68')],{'transaction':_0x49942a})[_0xa7ad('0x2a')](function(){if(!_['isEmpty'](_0x34eb21)){return _0x4f3d1a[_0xa7ad('0x87')](_0x34eb21,{'transaction':_0x49942a});}})[_0xa7ad('0x2a')](function(){_0x34eb21[_0xa7ad('0x70')](function(_0x53dddc){socket['emit'](_0xa7ad('0x88'),{'UserId':_0x53dddc,'MailQueueId':_0x4f3d1a['id']});});});});});});})[_0xa7ad('0x2a')](respondWithStatusCode(_0x2d1b12,null))[_0xa7ad('0x4c')](handleError(_0x2d1b12,null));};exports[_0xa7ad('0x89')]=function(_0x36d932,_0x2ceece,_0x354495){return db[_0xa7ad('0x35')][_0xa7ad('0x4e')]({'where':{'id':_0x36d932[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x2ceece,null))['then'](function(_0x15ba0d){if(_0x15ba0d){return _0x15ba0d[_0xa7ad('0x89')](_0x36d932[_0xa7ad('0x50')][_0xa7ad('0x68')],_[_0xa7ad('0x8a')](_0x36d932[_0xa7ad('0x50')],[_0xa7ad('0x68'),'id'])||{})[_0xa7ad('0x8b')](function(_0xf82a8e){for(var _0x1c7a14=0x0;_0x1c7a14<_0x36d932[_0xa7ad('0x50')][_0xa7ad('0x68')][_0xa7ad('0x3f')];_0x1c7a14+=0x1){socket[_0xa7ad('0x71')](_0xa7ad('0x72'),{'UserId':Number(_0x36d932['body'][_0xa7ad('0x68')][_0x1c7a14]),'MailQueueId':Number(_0x36d932[_0xa7ad('0x4d')]['id'])});}return _0xf82a8e;});}})[_0xa7ad('0x2a')](respondWithResult(_0x2ceece,null))[_0xa7ad('0x4c')](handleError(_0x2ceece,null));};exports[_0xa7ad('0x87')]=function(_0x5b9b48,_0x1a1a91,_0x13af3e){return db[_0xa7ad('0x35')][_0xa7ad('0x4e')]({'where':{'id':_0x5b9b48[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x1a1a91,null))[_0xa7ad('0x2a')](function(_0x217da0){if(_0x217da0){return _0x217da0[_0xa7ad('0x87')](_0x5b9b48[_0xa7ad('0x3a')][_0xa7ad('0x68')])[_0xa7ad('0x2a')](function(){if(_[_0xa7ad('0x8c')](_0x5b9b48['query']['ids'])){for(var _0x1dc0ed=0x0;_0x1dc0ed<_0x5b9b48['query'][_0xa7ad('0x68')][_0xa7ad('0x3f')];_0x1dc0ed+=0x1){socket[_0xa7ad('0x71')]('userMailQueue:remove',{'UserId':Number(_0x5b9b48[_0xa7ad('0x3a')][_0xa7ad('0x68')][_0x1dc0ed]),'MailQueueId':Number(_0x5b9b48[_0xa7ad('0x4d')]['id'])});}}else{socket[_0xa7ad('0x71')]('userMailQueue:remove',{'UserId':Number(_0x5b9b48['query']['ids']),'MailQueueId':Number(_0x5b9b48[_0xa7ad('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a1a91,null))['catch'](handleError(_0x1a1a91,null));};exports['getAgents']=function(_0x1708f1,_0x370585,_0x2bcd0c){var _0x104ddb={};var _0x21c1f6={};var _0x4dadc0;var _0x38879d;return db[_0xa7ad('0x35')]['findOne']({'where':{'id':_0x1708f1[_0xa7ad('0x4d')]['id']}})[_0xa7ad('0x2a')](handleEntityNotFound(_0x370585,null))['then'](function(_0x5ae108){if(_0x5ae108){_0x4dadc0=_0x5ae108;_0x21c1f6[_0xa7ad('0x38')]=_['keys'](db[_0xa7ad('0x5e')][_0xa7ad('0x36')]);_0x21c1f6[_0xa7ad('0x3a')]=_[_0xa7ad('0x39')](_0x1708f1[_0xa7ad('0x3a')]);_0x21c1f6[_0xa7ad('0x3b')]=_[_0xa7ad('0x3c')](_0x21c1f6['model'],_0x21c1f6['query']);_0x104ddb['attributes']=_['intersection'](_0x21c1f6[_0xa7ad('0x38')],qs[_0xa7ad('0x3d')](_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x3d')]));_0x104ddb[_0xa7ad('0x3e')]=_0x104ddb[_0xa7ad('0x3e')][_0xa7ad('0x3f')]?_0x104ddb[_0xa7ad('0x3e')]:_0x21c1f6[_0xa7ad('0x38')];_0x104ddb[_0xa7ad('0x42')]=qs[_0xa7ad('0x5c')](_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x5c')]);_0x104ddb[_0xa7ad('0x43')]=qs[_0xa7ad('0x3b')](_['pick'](_0x1708f1[_0xa7ad('0x3a')],_0x21c1f6[_0xa7ad('0x3b')]));if(_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x45')]){_0x104ddb[_0xa7ad('0x43')]=_[_0xa7ad('0x47')](_0x104ddb[_0xa7ad('0x43')],{'$or':_[_0xa7ad('0x34')](_0x104ddb[_0xa7ad('0x3e')],function(_0x3eb9c2){var _0x5bcad8={};_0x5bcad8[_0x3eb9c2]={'$like':'%'+_0x1708f1[_0xa7ad('0x3a')]['filter']+'%'};return _0x5bcad8;})});}_0x104ddb=_['merge']({},_0x104ddb,_0x1708f1['options']);return _0x4dadc0[_0xa7ad('0x8d')](_0x104ddb);}})[_0xa7ad('0x2a')](function(_0x4531af){if(_0x4531af){_0x38879d=_0x4531af[_0xa7ad('0x3f')];if(!_0x1708f1[_0xa7ad('0x3a')]['hasOwnProperty'](_0xa7ad('0x41'))){_0x104ddb[_0xa7ad('0x25')]=qs['limit'](_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x25')]);_0x104ddb['offset']=qs[_0xa7ad('0x23')](_0x1708f1[_0xa7ad('0x3a')][_0xa7ad('0x23')]);}return _0x4dadc0[_0xa7ad('0x8d')](_0x104ddb);}})[_0xa7ad('0x2a')](function(_0x1be1b9){if(_0x1be1b9){return _0x1be1b9?{'count':_0x38879d,'rows':_0x1be1b9}:null;}})['then'](respondWithResult(_0x370585,null))[_0xa7ad('0x4c')](handleError(_0x370585,null));}; \ No newline at end of file +var _0xd657=['localhost','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','MailQueues','destroy','stack','name','send','index','type','key','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','MailQueue','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','UserMailQueue','nolimit','pick','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','getTeams','addTeams','ids','Team','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','removeAgents','omit','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x28f46a,_0x3d1bc9){var _0x51e1ed=function(_0x23ff8f){while(--_0x23ff8f){_0x28f46a['push'](_0x28f46a['shift']());}};_0x51e1ed(++_0x3d1bc9);}(_0xd657,0x71));var _0x7d65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd657[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7d65('0x0'));var rimraf=require(_0x7d65('0x1'));var zipdir=require(_0x7d65('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d65('0x3'));var moment=require(_0x7d65('0x4'));var BPromise=require(_0x7d65('0x5'));var Mustache=require(_0x7d65('0x6'));var util=require(_0x7d65('0x7'));var path=require(_0x7d65('0x8'));var sox=require(_0x7d65('0x9'));var csv=require('to-csv');var ejs=require(_0x7d65('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d65('0xb'));var squel=require('squel');var crypto=require(_0x7d65('0xc'));var jsforce=require(_0x7d65('0xd'));var deskjs=require(_0x7d65('0xe'));var toCsv=require(_0x7d65('0xf'));var querystring=require(_0x7d65('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d65('0x11'));var qs=require(_0x7d65('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d65('0x13'));var logger=require(_0x7d65('0x14'))('api');var utils=require(_0x7d65('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7d65('0x16'));var db=require(_0x7d65('0x17'))['db'];config[_0x7d65('0x18')]=_[_0x7d65('0x19')](config[_0x7d65('0x18')],{'host':_0x7d65('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7d65('0x1b'))[_0x7d65('0x1c')](socket);function respondWithStatusCode(_0x254903,_0x1d7e42){_0x1d7e42=_0x1d7e42||0xcc;return function(_0x14cd42){if(_0x14cd42){return _0x254903[_0x7d65('0x1d')](_0x1d7e42);}return _0x254903[_0x7d65('0x1e')](_0x1d7e42)[_0x7d65('0x1f')]();};}function respondWithResult(_0x49d350,_0x1a5fc5){_0x1a5fc5=_0x1a5fc5||0xc8;return function(_0x4c1b96){if(_0x4c1b96){return _0x49d350['status'](_0x1a5fc5)['json'](_0x4c1b96);}};}function respondWithFilteredResult(_0x1d69af,_0x31fcf9){return function(_0x50adb7){if(_0x50adb7){var _0x2895f9=typeof _0x31fcf9[_0x7d65('0x20')]===_0x7d65('0x21')&&typeof _0x31fcf9['limit']===_0x7d65('0x21');var _0x85fbd5=_0x50adb7[_0x7d65('0x22')];var _0x5a013b=_0x2895f9?0x0:_0x31fcf9[_0x7d65('0x20')];var _0x31713e=_0x2895f9?_0x50adb7[_0x7d65('0x22')]:_0x31fcf9[_0x7d65('0x20')]+_0x31fcf9[_0x7d65('0x23')];var _0x133075;if(_0x31713e>=_0x85fbd5){_0x31713e=_0x85fbd5;_0x133075=0xc8;}else{_0x133075=0xce;}_0x1d69af[_0x7d65('0x1e')](_0x133075);return _0x1d69af[_0x7d65('0x24')](_0x7d65('0x25'),_0x5a013b+'-'+_0x31713e+'/'+_0x85fbd5)['json'](_0x50adb7);}return null;};}function patchUpdates(_0x547561){return function(_0x518fa3){try{jsonpatch[_0x7d65('0x26')](_0x518fa3,_0x547561,!![]);}catch(_0x44c475){return BPromise['reject'](_0x44c475);}return _0x518fa3[_0x7d65('0x27')]();};}function saveUpdates(_0x549fc6,_0x383311){return function(_0x42d00a){if(_0x42d00a){return _0x42d00a[_0x7d65('0x28')](_0x549fc6)[_0x7d65('0x29')](function(_0x40a687){return _0x40a687;});}return null;};}function removeEntity(_0x5ceee8,_0x8d13df){return function(_0x8c77d){if(_0x8c77d){return _0x8c77d['destroy']()[_0x7d65('0x29')](function(){var _0x196be4=_0x8c77d['get']({'plain':!![]});var _0x2c1e76=_0x7d65('0x2a');return db['UserProfileResource'][_0x7d65('0x2b')]({'where':{'type':_0x2c1e76,'resourceId':_0x196be4['id']}})[_0x7d65('0x29')](function(){return _0x8c77d;});})[_0x7d65('0x29')](function(){_0x5ceee8['status'](0xcc)[_0x7d65('0x1f')]();});}};}function handleEntityNotFound(_0x34f1ad,_0x596b98){return function(_0x2544a4){if(!_0x2544a4){_0x34f1ad[_0x7d65('0x1d')](0x194);}return _0x2544a4;};}function handleError(_0x7958c7,_0x1d417b){_0x1d417b=_0x1d417b||0x1f4;return function(_0x3838d3){logger['error'](_0x3838d3[_0x7d65('0x2c')]);if(_0x3838d3[_0x7d65('0x2d')]){delete _0x3838d3[_0x7d65('0x2d')];}_0x7958c7[_0x7d65('0x1e')](_0x1d417b)[_0x7d65('0x2e')](_0x3838d3);};}exports[_0x7d65('0x2f')]=function(_0xb6c8a7,_0x721f13){var _0xf840c4={},_0xa4594={},_0x2a8021={'count':0x0,'rows':[]};var _0x3c562f=_['map'](db['MailQueue']['rawAttributes'],function(_0x50b9d0){return{'name':_0x50b9d0['fieldName'],'type':_0x50b9d0[_0x7d65('0x30')][_0x7d65('0x31')]};});_0xa4594['model']=_[_0x7d65('0x32')](_0x3c562f,_0x7d65('0x2d'));_0xa4594[_0x7d65('0x33')]=_[_0x7d65('0x34')](_0xb6c8a7['query']);_0xa4594[_0x7d65('0x35')]=_['intersection'](_0xa4594['model'],_0xa4594['query']);_0xf840c4[_0x7d65('0x36')]=_[_0x7d65('0x37')](_0xa4594[_0x7d65('0x38')],qs[_0x7d65('0x39')](_0xb6c8a7[_0x7d65('0x33')][_0x7d65('0x39')]));_0xf840c4[_0x7d65('0x36')]=_0xf840c4[_0x7d65('0x36')][_0x7d65('0x3a')]?_0xf840c4[_0x7d65('0x36')]:_0xa4594[_0x7d65('0x38')];if(!_0xb6c8a7[_0x7d65('0x33')][_0x7d65('0x3b')]('nolimit')){_0xf840c4['limit']=qs['limit'](_0xb6c8a7['query']['limit']);_0xf840c4[_0x7d65('0x20')]=qs['offset'](_0xb6c8a7['query'][_0x7d65('0x20')]);}_0xf840c4[_0x7d65('0x3c')]=qs['sort'](_0xb6c8a7[_0x7d65('0x33')][_0x7d65('0x3d')]);_0xf840c4['where']=qs[_0x7d65('0x35')](_['pick'](_0xb6c8a7['query'],_0xa4594['filters']),_0x3c562f);if(_0xb6c8a7[_0x7d65('0x33')][_0x7d65('0x3e')]){_0xf840c4[_0x7d65('0x3f')]=_[_0x7d65('0x40')](_0xf840c4[_0x7d65('0x3f')],{'$or':_['map'](_0x3c562f,function(_0x40f500){if(_0x40f500[_0x7d65('0x30')]!==_0x7d65('0x41')){var _0x261d51={};_0x261d51[_0x40f500[_0x7d65('0x2d')]]={'$like':'%'+_0xb6c8a7[_0x7d65('0x33')]['filter']+'%'};return _0x261d51;}})});}_0xf840c4=_['merge']({},_0xf840c4,_0xb6c8a7[_0x7d65('0x42')]);var _0x2901cf={'where':_0xf840c4[_0x7d65('0x3f')]};return db[_0x7d65('0x43')][_0x7d65('0x22')](_0x2901cf)[_0x7d65('0x29')](function(_0x3bc609){_0x2a8021[_0x7d65('0x22')]=_0x3bc609;if(_0xb6c8a7[_0x7d65('0x33')][_0x7d65('0x44')]){_0xf840c4[_0x7d65('0x45')]=[{'all':!![]}];}return db[_0x7d65('0x43')][_0x7d65('0x46')](_0xf840c4);})['then'](function(_0x2bc41f){_0x2a8021[_0x7d65('0x47')]=_0x2bc41f;return _0x2a8021;})[_0x7d65('0x29')](respondWithFilteredResult(_0x721f13,_0xf840c4))[_0x7d65('0x48')](handleError(_0x721f13,null));};exports[_0x7d65('0x49')]=function(_0x42899f,_0x593db6){var _0x4ebb9f={'raw':!![],'where':{'id':_0x42899f['params']['id']}},_0x543b58={};_0x543b58[_0x7d65('0x38')]=_[_0x7d65('0x34')](db[_0x7d65('0x43')][_0x7d65('0x4a')]);_0x543b58[_0x7d65('0x33')]=_[_0x7d65('0x34')](_0x42899f[_0x7d65('0x33')]);_0x543b58[_0x7d65('0x35')]=_[_0x7d65('0x37')](_0x543b58[_0x7d65('0x38')],_0x543b58[_0x7d65('0x33')]);_0x4ebb9f['attributes']=_['intersection'](_0x543b58[_0x7d65('0x38')],qs[_0x7d65('0x39')](_0x42899f[_0x7d65('0x33')]['fields']));_0x4ebb9f[_0x7d65('0x36')]=_0x4ebb9f[_0x7d65('0x36')][_0x7d65('0x3a')]?_0x4ebb9f['attributes']:_0x543b58[_0x7d65('0x38')];if(_0x42899f[_0x7d65('0x33')][_0x7d65('0x44')]){_0x4ebb9f[_0x7d65('0x45')]=[{'all':!![]}];}_0x4ebb9f=_['merge']({},_0x4ebb9f,_0x42899f[_0x7d65('0x42')]);return db[_0x7d65('0x43')][_0x7d65('0x4b')](_0x4ebb9f)[_0x7d65('0x29')](handleEntityNotFound(_0x593db6,null))['then'](respondWithResult(_0x593db6,null))[_0x7d65('0x48')](handleError(_0x593db6,null));};exports[_0x7d65('0x4c')]=function(_0xf1343d,_0x259156){return db['MailQueue']['create'](_0xf1343d['body'],{})[_0x7d65('0x29')](function(_0x58eb0d){var _0x52e31b=_0xf1343d[_0x7d65('0x4d')]['get']({'plain':!![]});if(!_0x52e31b)throw new Error(_0x7d65('0x4e'));if(_0x52e31b['role']==='user'){var _0x94ba85=_0x58eb0d[_0x7d65('0x4f')]({'plain':!![]});var _0x11e5e0=_0x7d65('0x2a');return db[_0x7d65('0x50')][_0x7d65('0x4b')]({'where':{'name':_0x11e5e0,'userProfileId':_0x52e31b['userProfileId']},'raw':!![]})[_0x7d65('0x29')](function(_0x17679b){if(_0x17679b&&_0x17679b['autoAssociation']===0x0){return db[_0x7d65('0x51')][_0x7d65('0x4c')]({'name':_0x94ba85[_0x7d65('0x2d')],'resourceId':_0x94ba85['id'],'type':_0x17679b[_0x7d65('0x2d')],'sectionId':_0x17679b['id']},{})[_0x7d65('0x29')](function(){return _0x58eb0d;});}else{return _0x58eb0d;}})[_0x7d65('0x48')](function(_0x1c8b8b){logger['error'](_0x7d65('0x52'),_0x1c8b8b);throw _0x1c8b8b;});}return _0x58eb0d;})[_0x7d65('0x29')](respondWithResult(_0x259156,0xc9))[_0x7d65('0x48')](handleError(_0x259156,null));};exports[_0x7d65('0x28')]=function(_0x18c012,_0x169ce6){if(_0x18c012[_0x7d65('0x53')]['id']){delete _0x18c012[_0x7d65('0x53')]['id'];}return db[_0x7d65('0x43')][_0x7d65('0x4b')]({'where':{'id':_0x18c012[_0x7d65('0x54')]['id']}})[_0x7d65('0x29')](handleEntityNotFound(_0x169ce6,null))['then'](saveUpdates(_0x18c012[_0x7d65('0x53')],null))[_0x7d65('0x29')](respondWithResult(_0x169ce6,null))[_0x7d65('0x48')](handleError(_0x169ce6,null));};exports['destroy']=function(_0xd62b91,_0x365bfc){return db[_0x7d65('0x43')]['find']({'where':{'id':_0xd62b91['params']['id']}})[_0x7d65('0x29')](handleEntityNotFound(_0x365bfc,null))[_0x7d65('0x29')](removeEntity(_0x365bfc,null))[_0x7d65('0x48')](handleError(_0x365bfc,null));};exports[_0x7d65('0x55')]=function(_0x1184b5,_0x306452){return db[_0x7d65('0x43')][_0x7d65('0x55')]()[_0x7d65('0x29')](respondWithResult(_0x306452,null))[_0x7d65('0x48')](handleError(_0x306452,null));};exports['getMembers']=function(_0x4fc74f,_0x528956,_0xf26dfe){var _0x248040={'raw':!![],'where':{}},_0xf44a88={},_0x30a197;return db['MailQueue'][_0x7d65('0x56')]({'where':{'id':_0x4fc74f[_0x7d65('0x54')]['id']}})[_0x7d65('0x29')](handleEntityNotFound(_0x528956,null))[_0x7d65('0x29')](function(_0x23ea05){if(_0x23ea05){_0x30a197=_0x23ea05[_0x7d65('0x4f')]({'plain':!![]});_0xf44a88[_0x7d65('0x38')]=_['keys'](db[_0x7d65('0x57')][_0x7d65('0x4a')]);_0xf44a88['query']=_[_0x7d65('0x34')](_0x4fc74f['query']);_0xf44a88[_0x7d65('0x35')]=_[_0x7d65('0x37')](_0xf44a88[_0x7d65('0x38')],_0xf44a88['query']);_0x248040[_0x7d65('0x36')]=_[_0x7d65('0x37')](_0xf44a88[_0x7d65('0x38')],qs['fields'](_0x4fc74f[_0x7d65('0x33')][_0x7d65('0x39')]));_0x248040[_0x7d65('0x36')]=_0x248040[_0x7d65('0x36')][_0x7d65('0x3a')]?_0x248040[_0x7d65('0x36')]:_0xf44a88[_0x7d65('0x38')];if(!_0x4fc74f[_0x7d65('0x33')][_0x7d65('0x3b')](_0x7d65('0x58'))){_0x248040[_0x7d65('0x23')]=qs[_0x7d65('0x23')](_0x4fc74f['query'][_0x7d65('0x23')]);_0x248040[_0x7d65('0x20')]=qs[_0x7d65('0x20')](_0x4fc74f[_0x7d65('0x33')][_0x7d65('0x20')]);}_0x248040[_0x7d65('0x3c')]=qs['sort'](_0x4fc74f['query'][_0x7d65('0x3d')]);_0x248040[_0x7d65('0x3f')]=qs['filters'](_[_0x7d65('0x59')](_0x4fc74f['query'],_0xf44a88['filters']));_0x248040[_0x7d65('0x3f')][_0x7d65('0x5a')]=_0x23ea05['id'];if(_0x4fc74f[_0x7d65('0x33')]['filter']){_0x248040['where']=_['merge'](_0x248040[_0x7d65('0x3f')],{'$or':_['map'](_0x248040[_0x7d65('0x36')],function(_0x1fd170){var _0x28ab8f={};_0x28ab8f[_0x1fd170]={'$like':'%'+_0x4fc74f['query'][_0x7d65('0x3e')]+'%'};return _0x28ab8f;})});}_0x248040=_[_0x7d65('0x40')]({},_0x248040,_0x4fc74f[_0x7d65('0x42')]);return db[_0x7d65('0x57')]['findAll'](_0x248040);}})[_0x7d65('0x29')](function(_0x504ce3){if(_0x504ce3){return db[_0x7d65('0x5b')][_0x7d65('0x5c')]({'where':{'id':_[_0x7d65('0x32')](_0x504ce3,_0x7d65('0x5d')),'role':_0x7d65('0x5e')},'attributes':['id',_0x7d65('0x2d'),_0x7d65('0x5f'),_0x7d65('0x60'),_0x7d65('0x61')]});}})[_0x7d65('0x29')](function(_0x256017){if(_0x256017){return{'count':_0x256017[_0x7d65('0x22')],'rows':_[_0x7d65('0x32')](_0x256017['rows'],function(_0x4b09bd){return{'membername':_0x4b09bd[_0x7d65('0x2d')],'UserId':_0x4b09bd['id'],'queue_name':_0x30a197[_0x7d65('0x2d')],'MailQueueId':_0x30a197['id'],'interface':util[_0x7d65('0x62')]('%s/%s','SIP',_0x4b09bd[_0x7d65('0x2d')]),'penalty':0x0,'paused':_0x4b09bd[_0x7d65('0x5f')],'createdAt':_0x4b09bd[_0x7d65('0x61')],'updatedAt':_0x4b09bd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7d65('0x29')](respondWithFilteredResult(_0x528956,_0x248040))['catch'](handleError(_0x528956,null));};exports[_0x7d65('0x63')]=function(_0x115385,_0x7ded41,_0x5175e7){var _0x1d9074={};var _0x250446={};var _0x1a587f;var _0x2878fb;return db[_0x7d65('0x43')][_0x7d65('0x56')]({'where':{'id':_0x115385['params']['id']}})[_0x7d65('0x29')](handleEntityNotFound(_0x7ded41,null))['then'](function(_0x4000f6){if(_0x4000f6){_0x1a587f=_0x4000f6;_0x250446['model']=_['keys'](db['Team'][_0x7d65('0x4a')]);_0x250446[_0x7d65('0x33')]=_[_0x7d65('0x34')](_0x115385[_0x7d65('0x33')]);_0x250446[_0x7d65('0x35')]=_[_0x7d65('0x37')](_0x250446[_0x7d65('0x38')],_0x250446[_0x7d65('0x33')]);_0x1d9074[_0x7d65('0x36')]=_[_0x7d65('0x37')](_0x250446[_0x7d65('0x38')],qs[_0x7d65('0x39')](_0x115385[_0x7d65('0x33')][_0x7d65('0x39')]));_0x1d9074['attributes']=_0x1d9074[_0x7d65('0x36')][_0x7d65('0x3a')]?_0x1d9074[_0x7d65('0x36')]:_0x250446[_0x7d65('0x38')];_0x1d9074[_0x7d65('0x3c')]=qs['sort'](_0x115385[_0x7d65('0x33')][_0x7d65('0x3d')]);_0x1d9074[_0x7d65('0x3f')]=qs[_0x7d65('0x35')](_[_0x7d65('0x59')](_0x115385[_0x7d65('0x33')],_0x250446[_0x7d65('0x35')]));if(_0x115385[_0x7d65('0x33')][_0x7d65('0x3e')]){_0x1d9074[_0x7d65('0x3f')]=_[_0x7d65('0x40')](_0x1d9074[_0x7d65('0x3f')],{'$or':_['map'](_0x1d9074[_0x7d65('0x36')],function(_0x30f960){var _0x23bd63={};_0x23bd63[_0x30f960]={'$like':'%'+_0x115385[_0x7d65('0x33')][_0x7d65('0x3e')]+'%'};return _0x23bd63;})});}_0x1d9074=_[_0x7d65('0x40')]({},_0x1d9074,_0x115385[_0x7d65('0x42')]);return _0x1a587f[_0x7d65('0x63')](_0x1d9074);}})[_0x7d65('0x29')](function(_0x88a880){if(_0x88a880){_0x2878fb=_0x88a880[_0x7d65('0x3a')];if(!_0x115385[_0x7d65('0x33')][_0x7d65('0x3b')](_0x7d65('0x58'))){_0x1d9074[_0x7d65('0x23')]=qs['limit'](_0x115385[_0x7d65('0x33')][_0x7d65('0x23')]);_0x1d9074['offset']=qs[_0x7d65('0x20')](_0x115385[_0x7d65('0x33')]['offset']);}return _0x1a587f[_0x7d65('0x63')](_0x1d9074);}})[_0x7d65('0x29')](function(_0x2b2ee6){if(_0x2b2ee6){return _0x2b2ee6?{'count':_0x2878fb,'rows':_0x2b2ee6}:null;}})[_0x7d65('0x29')](respondWithResult(_0x7ded41,null))[_0x7d65('0x48')](handleError(_0x7ded41,null));};exports[_0x7d65('0x64')]=function(_0x3e702f,_0x3643af,_0x1128ea){var _0x551607=_0x3e702f['body'][_0x7d65('0x65')];return db[_0x7d65('0x66')]['findAll']({'where':{'id':_0x551607},'attributes':['id'],'include':[{'model':db[_0x7d65('0x5b')],'as':'Agents','attributes':['id',_0x7d65('0x2d'),'online',_0x7d65('0x67'),_0x7d65('0x68')],'raw':!![]}]})[_0x7d65('0x29')](function(_0x2ba0fe){if(_0x2ba0fe){var _0x2bd41c=_[_0x7d65('0x69')](_0x2ba0fe,function(_0x4caaef){var _0x5bf716=_0x4caaef[_0x7d65('0x4f')]({'plain':!![]});return _0x5bf716[_0x7d65('0x6a')];});return db['MailQueue']['find']({'where':{'id':_0x3e702f['params']['id']}})['then'](function(_0x3a4ac1){return db['sequelize'][_0x7d65('0x6b')](function(_0x2508ff){return _0x3a4ac1[_0x7d65('0x64')](_0x551607,{'transaction':_0x2508ff})[_0x7d65('0x29')](function(){return BPromise[_0x7d65('0x6c')](_0x2bd41c,function(_0x598e9d){return db['UserMailQueue'][_0x7d65('0x6d')]({'where':{'UserId':_0x598e9d['id'],'MailQueueId':_0x3e702f[_0x7d65('0x54')]['id']},'transaction':_0x2508ff});});})['then'](function(){_0x2bd41c[_0x7d65('0x6e')](function(_0x1b2ce5){socket[_0x7d65('0x6f')](_0x7d65('0x70'),{'UserId':_0x1b2ce5['id'],'MailQueueId':_0x3a4ac1['id']});});});});});}})['then'](respondWithStatusCode(_0x3643af,null))[_0x7d65('0x48')](handleError(_0x3643af,null));};exports[_0x7d65('0x71')]=function(_0x141faf,_0xc32834,_0x32a0a2){return db[_0x7d65('0x66')]['findAll']({'where':{'id':_0x141faf['query'][_0x7d65('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xc32834,null))['then'](function(_0x31c4b7){var _0x264f1c=_[_0x7d65('0x32')](_0x31c4b7,'id');var _0x4e1c45=[];var _0x424288=[];var _0x57e832=squel[_0x7d65('0x72')]();_0x57e832[_0x7d65('0x73')](_0x7d65('0x74'))[_0x7d65('0x75')]('team_has_mail_queues','tq')[_0x7d65('0x76')](_0x7d65('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7d65('0x3f')](_0x7d65('0x78'),_0x141faf[_0x7d65('0x54')]['id']);for(var _0x4747d7=0x0;_0x4747d7<_0x31c4b7[_0x7d65('0x3a')];_0x4747d7+=0x1){let _0x1b2894=_0x31c4b7[_0x4747d7];for(var _0x5d2b20=0x0;_0x5d2b20<_0x1b2894['Agents'][_0x7d65('0x3a')];_0x5d2b20+=0x1){let _0x4b9324=_0x1b2894['Agents'][_0x5d2b20];var _0x256fd0=_0x57e832[_0x7d65('0x79')]();_0x256fd0['where'](_0x7d65('0x7a'),_0x4b9324['id']);_0x424288[_0x7d65('0x7b')](db[_0x7d65('0x7c')][_0x7d65('0x33')](_0x256fd0['toString'](),{'type':db[_0x7d65('0x7c')][_0x7d65('0x7d')][_0x7d65('0x7e')]})[_0x7d65('0x29')](function(_0x16e3c7){if(_0x16e3c7[_0x7d65('0x3a')]===0x1){return _0x4b9324['id'];}else{var _0x37bad3=_[_0x7d65('0x7f')](_['map'](_0x16e3c7,_0x7d65('0x80')),function(_0x894684){return _[_0x7d65('0x81')](_0x264f1c,_0x894684);});if(_0x37bad3){return _0x4b9324['id'];}}}));}}return BPromise['all'](_0x424288)[_0x7d65('0x29')](function(_0x5a3421){_0x4e1c45=_(_0x4e1c45)[_0x7d65('0x82')](_0x5a3421)[_0x7d65('0x83')]()[_0x7d65('0x84')]();return db[_0x7d65('0x43')][_0x7d65('0x4b')]({'where':{'id':_0x141faf[_0x7d65('0x54')]['id']}})['then'](function(_0x5cba84){return db[_0x7d65('0x7c')][_0x7d65('0x6b')](function(_0xbc93a2){return _0x5cba84[_0x7d65('0x71')](_0x141faf[_0x7d65('0x33')]['ids'],{'transaction':_0xbc93a2})[_0x7d65('0x29')](function(){if(!_[_0x7d65('0x85')](_0x4e1c45)){return _0x5cba84[_0x7d65('0x86')](_0x4e1c45,{'transaction':_0xbc93a2});}})[_0x7d65('0x29')](function(){_0x4e1c45[_0x7d65('0x6e')](function(_0x5c4f2c){socket[_0x7d65('0x6f')]('userMailQueue:remove',{'UserId':_0x5c4f2c,'MailQueueId':_0x5cba84['id']});});});});});});})[_0x7d65('0x29')](respondWithStatusCode(_0xc32834,null))[_0x7d65('0x48')](handleError(_0xc32834,null));};exports['addAgents']=function(_0x5e940f,_0x1ec85a,_0x233b79){return db[_0x7d65('0x43')][_0x7d65('0x4b')]({'where':{'id':_0x5e940f[_0x7d65('0x54')]['id']}})[_0x7d65('0x29')](handleEntityNotFound(_0x1ec85a,null))[_0x7d65('0x29')](function(_0x34a685){if(_0x34a685){return _0x34a685['addAgents'](_0x5e940f['body'][_0x7d65('0x65')],_[_0x7d65('0x87')](_0x5e940f[_0x7d65('0x53')],[_0x7d65('0x65'),'id'])||{})['spread'](function(_0x3c2933){for(var _0x128d84=0x0;_0x128d84<_0x5e940f[_0x7d65('0x53')][_0x7d65('0x65')]['length'];_0x128d84+=0x1){socket[_0x7d65('0x6f')]('userMailQueue:save',{'UserId':Number(_0x5e940f[_0x7d65('0x53')][_0x7d65('0x65')][_0x128d84]),'MailQueueId':Number(_0x5e940f['params']['id'])});}return _0x3c2933;});}})[_0x7d65('0x29')](respondWithResult(_0x1ec85a,null))[_0x7d65('0x48')](handleError(_0x1ec85a,null));};exports['removeAgents']=function(_0xae465d,_0x47adc4,_0x3dfd76){return db[_0x7d65('0x43')][_0x7d65('0x4b')]({'where':{'id':_0xae465d[_0x7d65('0x54')]['id']}})[_0x7d65('0x29')](handleEntityNotFound(_0x47adc4,null))[_0x7d65('0x29')](function(_0x5b0a7e){if(_0x5b0a7e){return _0x5b0a7e[_0x7d65('0x86')](_0xae465d[_0x7d65('0x33')][_0x7d65('0x65')])[_0x7d65('0x29')](function(){if(_[_0x7d65('0x88')](_0xae465d['query']['ids'])){for(var _0xb4b492=0x0;_0xb4b492<_0xae465d[_0x7d65('0x33')][_0x7d65('0x65')][_0x7d65('0x3a')];_0xb4b492+=0x1){socket[_0x7d65('0x6f')](_0x7d65('0x89'),{'UserId':Number(_0xae465d['query'][_0x7d65('0x65')][_0xb4b492]),'MailQueueId':Number(_0xae465d['params']['id'])});}}else{socket[_0x7d65('0x6f')](_0x7d65('0x89'),{'UserId':Number(_0xae465d['query'][_0x7d65('0x65')]),'MailQueueId':Number(_0xae465d['params']['id'])});}});}})['then'](respondWithStatusCode(_0x47adc4,null))[_0x7d65('0x48')](handleError(_0x47adc4,null));};exports[_0x7d65('0x8a')]=function(_0x50bbb7,_0x384888,_0x1cdbda){var _0x1eda52={};var _0x4e54e5={};var _0x357032;var _0x2fbe8d;return db[_0x7d65('0x43')][_0x7d65('0x56')]({'where':{'id':_0x50bbb7[_0x7d65('0x54')]['id']}})[_0x7d65('0x29')](handleEntityNotFound(_0x384888,null))[_0x7d65('0x29')](function(_0x112b0e){if(_0x112b0e){_0x357032=_0x112b0e;_0x4e54e5[_0x7d65('0x38')]=_[_0x7d65('0x34')](db[_0x7d65('0x5b')][_0x7d65('0x4a')]);_0x4e54e5[_0x7d65('0x33')]=_[_0x7d65('0x34')](_0x50bbb7['query']);_0x4e54e5['filters']=_[_0x7d65('0x37')](_0x4e54e5[_0x7d65('0x38')],_0x4e54e5['query']);_0x1eda52[_0x7d65('0x36')]=_['intersection'](_0x4e54e5[_0x7d65('0x38')],qs[_0x7d65('0x39')](_0x50bbb7[_0x7d65('0x33')]['fields']));_0x1eda52['attributes']=_0x1eda52[_0x7d65('0x36')][_0x7d65('0x3a')]?_0x1eda52['attributes']:_0x4e54e5[_0x7d65('0x38')];_0x1eda52[_0x7d65('0x3c')]=qs['sort'](_0x50bbb7[_0x7d65('0x33')][_0x7d65('0x3d')]);_0x1eda52[_0x7d65('0x3f')]=qs[_0x7d65('0x35')](_[_0x7d65('0x59')](_0x50bbb7['query'],_0x4e54e5[_0x7d65('0x35')]));if(_0x50bbb7['query'][_0x7d65('0x3e')]){_0x1eda52[_0x7d65('0x3f')]=_[_0x7d65('0x40')](_0x1eda52[_0x7d65('0x3f')],{'$or':_[_0x7d65('0x32')](_0x1eda52['attributes'],function(_0x30a9e6){var _0x419c8c={};_0x419c8c[_0x30a9e6]={'$like':'%'+_0x50bbb7[_0x7d65('0x33')]['filter']+'%'};return _0x419c8c;})});}_0x1eda52=_[_0x7d65('0x40')]({},_0x1eda52,_0x50bbb7[_0x7d65('0x42')]);return _0x357032['getAgents'](_0x1eda52);}})[_0x7d65('0x29')](function(_0x3949b4){if(_0x3949b4){_0x2fbe8d=_0x3949b4[_0x7d65('0x3a')];if(!_0x50bbb7['query'][_0x7d65('0x3b')](_0x7d65('0x58'))){_0x1eda52[_0x7d65('0x23')]=qs['limit'](_0x50bbb7[_0x7d65('0x33')]['limit']);_0x1eda52[_0x7d65('0x20')]=qs['offset'](_0x50bbb7[_0x7d65('0x33')][_0x7d65('0x20')]);}return _0x357032[_0x7d65('0x8a')](_0x1eda52);}})['then'](function(_0x269ea6){if(_0x269ea6){return _0x269ea6?{'count':_0x2fbe8d,'rows':_0x269ea6}:null;}})['then'](respondWithResult(_0x384888,null))[_0x7d65('0x48')](handleError(_0x384888,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 5d3cb9d..c85a756 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 _0x6656=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x375efe,_0x27df2d){var _0x1d5db6=function(_0x43e15d){while(--_0x43e15d){_0x375efe['push'](_0x375efe['shift']());}};_0x1d5db6(++_0x27df2d);}(_0x6656,0x18e));var _0x6665=function(_0x55419e,_0x2d49f6){_0x55419e=_0x55419e-0x0;var _0x460121=_0x6656[_0x55419e];return _0x460121;};'use strict';var EventEmitter=require(_0x6665('0x0'));var MailQueue=require(_0x6665('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6665('0x2')](0x0);var events={'afterCreate':_0x6665('0x3'),'afterUpdate':_0x6665('0x4'),'afterDestroy':_0x6665('0x5')};function emitEvent(_0x28300c){return function(_0x4aebe5,_0x598d74,_0x13f8db){MailQueueEvents[_0x6665('0x6')](_0x28300c+':'+_0x4aebe5['id'],_0x4aebe5);MailQueueEvents[_0x6665('0x6')](_0x28300c,_0x4aebe5);_0x13f8db(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x6665('0x7')](e,emitEvent(event));}}module[_0x6665('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x0aa3=['events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0aa3,0x108));var _0x30aa=function(_0x46e1b5,_0x5e4456){_0x46e1b5=_0x46e1b5-0x0;var _0x5a1cfe=_0x0aa3[_0x46e1b5];return _0x5a1cfe;};'use strict';var EventEmitter=require(_0x30aa('0x0'));var MailQueue=require(_0x30aa('0x1'))['db'][_0x30aa('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x30aa('0x3')](0x0);var events={'afterCreate':_0x30aa('0x4'),'afterUpdate':_0x30aa('0x5'),'afterDestroy':_0x30aa('0x6')};function emitEvent(_0x4e1479){return function(_0x6acd1c,_0x4cf18e,_0xfdbde0){MailQueueEvents[_0x30aa('0x7')](_0x4e1479+':'+_0x6acd1c['id'],_0x6acd1c);MailQueueEvents[_0x30aa('0x7')](_0x4e1479,_0x6acd1c);_0xfdbde0(null);};}for(var e in events){if(events[_0x30aa('0x8')](e)){var event=events[e];MailQueue[_0x30aa('0x9')](e,emitEvent(event));}}module[_0x30aa('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f92bce3..e695dae 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 _0x31c7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','util','../../config/logger'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x31c7,0x1e4));var _0x731c=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x31c7[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var util=require(_0x731c('0x0'));var logger=require(_0x731c('0x1'))('api');var moment=require(_0x731c('0x2'));var BPromise=require(_0x731c('0x3'));var rp=require(_0x731c('0x4'));var fs=require('fs');var path=require(_0x731c('0x5'));var rimraf=require(_0x731c('0x6'));var config=require(_0x731c('0x7'));var attributes=require(_0x731c('0x8'));module['exports']=function(_0xe9fe03,_0x285a20){return _0xe9fe03['define']('MailQueue',attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfba8=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailQueue.attributes','exports','MailQueue','lodash'];(function(_0x34bcf6,_0x2cc521){var _0x54adc9=function(_0x2a8f15){while(--_0x2a8f15){_0x34bcf6['push'](_0x34bcf6['shift']());}};_0x54adc9(++_0x2cc521);}(_0xfba8,0x1d5));var _0x8fba=function(_0xfc404e,_0x521753){_0xfc404e=_0xfc404e-0x0;var _0x22d4c2=_0xfba8[_0xfc404e];return _0x22d4c2;};'use strict';var _=require(_0x8fba('0x0'));var util=require('util');var logger=require(_0x8fba('0x1'))('api');var moment=require(_0x8fba('0x2'));var BPromise=require(_0x8fba('0x3'));var rp=require(_0x8fba('0x4'));var fs=require('fs');var path=require(_0x8fba('0x5'));var rimraf=require(_0x8fba('0x6'));var config=require('../../config/environment');var attributes=require(_0x8fba('0x7'));module[_0x8fba('0x8')]=function(_0x1148a1,_0x5eeca0){return _0x1148a1['define'](_0x8fba('0x9'),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 cd7de67..45fd1de 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 _0xe075=['options','raw','where','attributes','limit','map','include','model','find','catch','ShowMailQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetMailQueue'];(function(_0x11a53c,_0x486647){var _0x119348=function(_0x416318){while(--_0x416318){_0x11a53c['push'](_0x11a53c['shift']());}};_0x119348(++_0x486647);}(_0xe075,0x143));var _0x5e07=function(_0x37c71b,_0x22b0fa){_0x37c71b=_0x37c71b-0x0;var _0x15e8df=_0xe075[_0x37c71b];return _0x15e8df;};'use strict';var _=require('lodash');var util=require(_0x5e07('0x0'));var moment=require(_0x5e07('0x1'));var BPromise=require(_0x5e07('0x2'));var rs=require(_0x5e07('0x3'));var fs=require('fs');var Redis=require(_0x5e07('0x4'));var db=require(_0x5e07('0x5'))['db'];var utils=require(_0x5e07('0x6'));var logger=require(_0x5e07('0x7'))(_0x5e07('0x8'));var config=require(_0x5e07('0x9'));var jayson=require(_0x5e07('0xa'));var client=jayson[_0x5e07('0xb')]['http']({'port':0x232a});config[_0x5e07('0xc')]=_[_0x5e07('0xd')](config['redis'],{'host':_0x5e07('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5e07('0xf'))[_0x5e07('0x10')](socket);function respondWithRpcPromise(_0x11a3d9,_0x5c1ac8,_0x452077){return new BPromise(function(_0x21d27f,_0x3faa6c){return client[_0x5e07('0x11')](_0x11a3d9,_0x452077)[_0x5e07('0x12')](function(_0x1a4368){logger[_0x5e07('0x13')](_0x5e07('0x14'),_0x5c1ac8,_0x5e07('0x15'));logger[_0x5e07('0x16')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x5c1ac8,_0x5e07('0x15'),JSON[_0x5e07('0x17')](_0x1a4368));if(_0x1a4368[_0x5e07('0x18')]){if(_0x1a4368[_0x5e07('0x18')][_0x5e07('0x19')]===0x1f4){logger[_0x5e07('0x18')](_0x5e07('0x14'),_0x5c1ac8,_0x1a4368[_0x5e07('0x18')][_0x5e07('0x1a')]);return _0x3faa6c(_0x1a4368[_0x5e07('0x18')]['message']);}logger[_0x5e07('0x18')](_0x5e07('0x14'),_0x5c1ac8,_0x1a4368[_0x5e07('0x18')][_0x5e07('0x1a')]);return _0x21d27f(_0x1a4368[_0x5e07('0x18')][_0x5e07('0x1a')]);}else{logger[_0x5e07('0x13')]('MailQueue,\x20%s,\x20%s',_0x5c1ac8,_0x5e07('0x15'));_0x21d27f(_0x1a4368['result'][_0x5e07('0x1a')]);}})['catch'](function(_0x32cda9){logger[_0x5e07('0x18')](_0x5e07('0x14'),_0x5c1ac8,_0x32cda9);_0x3faa6c(_0x32cda9);});});}exports[_0x5e07('0x1b')]=function(_0x3bbd9b){var _0x4c4af4=this;return new Promise(function(_0x16484b,_0x4bb2c3){return db['MailQueue']['findAll']({'raw':_0x3bbd9b[_0x5e07('0x1c')]?_0x3bbd9b[_0x5e07('0x1c')][_0x5e07('0x1d')]===undefined?!![]:![]:!![],'where':_0x3bbd9b[_0x5e07('0x1c')]?_0x3bbd9b[_0x5e07('0x1c')][_0x5e07('0x1e')]||null:null,'attributes':_0x3bbd9b['options']?_0x3bbd9b['options'][_0x5e07('0x1f')]||null:null,'limit':_0x3bbd9b['options']?_0x3bbd9b[_0x5e07('0x1c')][_0x5e07('0x20')]||null:null,'include':_0x3bbd9b[_0x5e07('0x1c')]?_0x3bbd9b[_0x5e07('0x1c')]['include']?_[_0x5e07('0x21')](_0x3bbd9b['options'][_0x5e07('0x22')],function(_0x289f95){return{'model':db[_0x289f95[_0x5e07('0x23')]],'as':_0x289f95['as'],'attributes':_0x289f95[_0x5e07('0x1f')],'include':_0x289f95['include']?_['map'](_0x289f95['include'],function(_0x4ae64d){return{'model':db[_0x4ae64d['model']],'as':_0x4ae64d['as'],'attributes':_0x4ae64d[_0x5e07('0x1f')],'include':_0x4ae64d['include']?_[_0x5e07('0x21')](_0x4ae64d[_0x5e07('0x22')],function(_0x1864ba){return{'model':db[_0x1864ba[_0x5e07('0x23')]],'as':_0x1864ba['as'],'attributes':_0x1864ba[_0x5e07('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e07('0x12')](function(_0x321ff8){logger[_0x5e07('0x13')](_0x5e07('0x1b'),_0x3bbd9b);logger[_0x5e07('0x16')](_0x5e07('0x1b'),_0x3bbd9b,JSON[_0x5e07('0x17')](_0x321ff8));_0x16484b(_0x321ff8);})['catch'](function(_0x297b31){logger['error']('GetMailQueue',_0x297b31[_0x5e07('0x1a')],_0x3bbd9b);_0x4bb2c3(_0x4c4af4[_0x5e07('0x18')](0x1f4,_0x297b31[_0x5e07('0x1a')]));});});};exports['ShowMailQueue']=function(_0x5c55ad){var _0x55a0c6=this;return new Promise(function(_0x332790,_0x52f012){return db['MailQueue'][_0x5e07('0x24')]({'raw':_0x5c55ad[_0x5e07('0x1c')]?_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c55ad[_0x5e07('0x1c')]?_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x1e')]||null:null,'attributes':_0x5c55ad[_0x5e07('0x1c')]?_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x1f')]||null:null,'include':_0x5c55ad[_0x5e07('0x1c')]?_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x22')]?_[_0x5e07('0x21')](_0x5c55ad[_0x5e07('0x1c')][_0x5e07('0x22')],function(_0x8d92e4){return{'model':db[_0x8d92e4['model']],'as':_0x8d92e4['as'],'attributes':_0x8d92e4[_0x5e07('0x1f')],'include':_0x8d92e4[_0x5e07('0x22')]?_[_0x5e07('0x21')](_0x8d92e4[_0x5e07('0x22')],function(_0x37f380){return{'model':db[_0x37f380[_0x5e07('0x23')]],'as':_0x37f380['as'],'attributes':_0x37f380['attributes'],'include':_0x37f380[_0x5e07('0x22')]?_[_0x5e07('0x21')](_0x37f380['include'],function(_0x2d7151){return{'model':db[_0x2d7151[_0x5e07('0x23')]],'as':_0x2d7151['as'],'attributes':_0x2d7151[_0x5e07('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x558359){logger[_0x5e07('0x13')]('ShowMailQueue',_0x5c55ad);logger['debug']('ShowMailQueue',_0x5c55ad,JSON[_0x5e07('0x17')](_0x558359));_0x332790(_0x558359);})[_0x5e07('0x25')](function(_0x1cae27){logger[_0x5e07('0x18')](_0x5e07('0x26'),_0x1cae27[_0x5e07('0x1a')],_0x5c55ad);_0x52f012(_0x55a0c6[_0x5e07('0x18')](0x1f4,_0x1cae27[_0x5e07('0x1a')]));});});}; \ No newline at end of file +var _0x9ec8=['request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','options','where','attributes','map','include','model','GetMailQueue','ShowMailQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s'];(function(_0x209e03,_0x592246){var _0x238b89=function(_0x4d7904){while(--_0x4d7904){_0x209e03['push'](_0x209e03['shift']());}};_0x238b89(++_0x592246);}(_0x9ec8,0xb8));var _0x89ec=function(_0x3cc9f9,_0x5790ea){_0x3cc9f9=_0x3cc9f9-0x0;var _0x1d0e5f=_0x9ec8[_0x3cc9f9];return _0x1d0e5f;};'use strict';var _=require(_0x89ec('0x0'));var util=require(_0x89ec('0x1'));var moment=require('moment');var BPromise=require(_0x89ec('0x2'));var rs=require(_0x89ec('0x3'));var fs=require('fs');var Redis=require(_0x89ec('0x4'));var db=require(_0x89ec('0x5'))['db'];var utils=require(_0x89ec('0x6'));var logger=require(_0x89ec('0x7'))(_0x89ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x89ec('0x9'));var client=jayson[_0x89ec('0xa')][_0x89ec('0xb')]({'port':0x232a});config[_0x89ec('0xc')]=_['defaults'](config[_0x89ec('0xc')],{'host':_0x89ec('0xd'),'port':0x18eb});var socket=require(_0x89ec('0xe'))(new Redis(config[_0x89ec('0xc')]));require(_0x89ec('0xf'))[_0x89ec('0x10')](socket);function respondWithRpcPromise(_0x58083d,_0x149591,_0x555732){return new BPromise(function(_0x492370,_0x1715ac){return client[_0x89ec('0x11')](_0x58083d,_0x555732)[_0x89ec('0x12')](function(_0xa41a79){logger[_0x89ec('0x13')](_0x89ec('0x14'),_0x149591,_0x89ec('0x15'));logger[_0x89ec('0x16')](_0x89ec('0x17'),_0x149591,_0x89ec('0x15'),JSON[_0x89ec('0x18')](_0xa41a79));if(_0xa41a79[_0x89ec('0x19')]){if(_0xa41a79[_0x89ec('0x19')][_0x89ec('0x1a')]===0x1f4){logger[_0x89ec('0x19')](_0x89ec('0x14'),_0x149591,_0xa41a79['error'][_0x89ec('0x1b')]);return _0x1715ac(_0xa41a79[_0x89ec('0x19')][_0x89ec('0x1b')]);}logger['error'](_0x89ec('0x14'),_0x149591,_0xa41a79['error'][_0x89ec('0x1b')]);return _0x492370(_0xa41a79['error'][_0x89ec('0x1b')]);}else{logger['info'](_0x89ec('0x14'),_0x149591,_0x89ec('0x15'));_0x492370(_0xa41a79[_0x89ec('0x1c')][_0x89ec('0x1b')]);}})[_0x89ec('0x1d')](function(_0x12ab04){logger[_0x89ec('0x19')](_0x89ec('0x14'),_0x149591,_0x12ab04);_0x1715ac(_0x12ab04);});});}exports['GetMailQueue']=function(_0xb78e7d){var _0x18ed4b=this;return new Promise(function(_0x5e51cc,_0x1bab5b){return db[_0x89ec('0x1e')]['findAll']({'raw':_0xb78e7d[_0x89ec('0x1f')]?_0xb78e7d[_0x89ec('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0xb78e7d['options']?_0xb78e7d[_0x89ec('0x1f')][_0x89ec('0x20')]||null:null,'attributes':_0xb78e7d[_0x89ec('0x1f')]?_0xb78e7d['options'][_0x89ec('0x21')]||null:null,'limit':_0xb78e7d[_0x89ec('0x1f')]?_0xb78e7d[_0x89ec('0x1f')]['limit']||null:null,'include':_0xb78e7d['options']?_0xb78e7d[_0x89ec('0x1f')]['include']?_[_0x89ec('0x22')](_0xb78e7d['options'][_0x89ec('0x23')],function(_0x4556f9){return{'model':db[_0x4556f9[_0x89ec('0x24')]],'as':_0x4556f9['as'],'attributes':_0x4556f9[_0x89ec('0x21')],'include':_0x4556f9[_0x89ec('0x23')]?_[_0x89ec('0x22')](_0x4556f9[_0x89ec('0x23')],function(_0x20989e){return{'model':db[_0x20989e[_0x89ec('0x24')]],'as':_0x20989e['as'],'attributes':_0x20989e[_0x89ec('0x21')],'include':_0x20989e['include']?_[_0x89ec('0x22')](_0x20989e[_0x89ec('0x23')],function(_0x27f48e){return{'model':db[_0x27f48e[_0x89ec('0x24')]],'as':_0x27f48e['as'],'attributes':_0x27f48e['attributes']};}):[]};}):[]};}):[]:[]})[_0x89ec('0x12')](function(_0x3da0c7){logger[_0x89ec('0x13')]('GetMailQueue',_0xb78e7d);logger[_0x89ec('0x16')](_0x89ec('0x25'),_0xb78e7d,JSON['stringify'](_0x3da0c7));_0x5e51cc(_0x3da0c7);})[_0x89ec('0x1d')](function(_0x3313a4){logger[_0x89ec('0x19')](_0x89ec('0x25'),_0x3313a4[_0x89ec('0x1b')],_0xb78e7d);_0x1bab5b(_0x18ed4b[_0x89ec('0x19')](0x1f4,_0x3313a4[_0x89ec('0x1b')]));});});};exports[_0x89ec('0x26')]=function(_0x128237){var _0x2cd11a=this;return new Promise(function(_0x3852b9,_0x38a73e){return db[_0x89ec('0x1e')][_0x89ec('0x27')]({'raw':_0x128237['options']?_0x128237[_0x89ec('0x1f')][_0x89ec('0x28')]===undefined?!![]:![]:!![],'where':_0x128237[_0x89ec('0x1f')]?_0x128237[_0x89ec('0x1f')][_0x89ec('0x20')]||null:null,'attributes':_0x128237['options']?_0x128237['options'][_0x89ec('0x21')]||null:null,'include':_0x128237[_0x89ec('0x1f')]?_0x128237[_0x89ec('0x1f')][_0x89ec('0x23')]?_['map'](_0x128237['options'][_0x89ec('0x23')],function(_0x926efc){return{'model':db[_0x926efc[_0x89ec('0x24')]],'as':_0x926efc['as'],'attributes':_0x926efc[_0x89ec('0x21')],'include':_0x926efc[_0x89ec('0x23')]?_[_0x89ec('0x22')](_0x926efc[_0x89ec('0x23')],function(_0x4b7d42){return{'model':db[_0x4b7d42[_0x89ec('0x24')]],'as':_0x4b7d42['as'],'attributes':_0x4b7d42[_0x89ec('0x21')],'include':_0x4b7d42[_0x89ec('0x23')]?_[_0x89ec('0x22')](_0x4b7d42[_0x89ec('0x23')],function(_0x3eb12c){return{'model':db[_0x3eb12c[_0x89ec('0x24')]],'as':_0x3eb12c['as'],'attributes':_0x3eb12c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4743cc){logger[_0x89ec('0x13')](_0x89ec('0x26'),_0x128237);logger['debug'](_0x89ec('0x26'),_0x128237,JSON[_0x89ec('0x18')](_0x4743cc));_0x3852b9(_0x4743cc);})[_0x89ec('0x1d')](function(_0x198a9c){logger[_0x89ec('0x19')](_0x89ec('0x26'),_0x198a9c[_0x89ec('0x1b')],_0x128237);_0x38a73e(_0x2cd11a[_0x89ec('0x19')](0x1f4,_0x198a9c[_0x89ec('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 5256abf..bb1008f 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 _0x8e78=['emit','removeListener','register','length','./mailQueue.events','save','remove','update'];(function(_0x3ddb7f,_0x14ed87){var _0x47c7d8=function(_0x422aa1){while(--_0x422aa1){_0x3ddb7f['push'](_0x3ddb7f['shift']());}};_0x47c7d8(++_0x14ed87);}(_0x8e78,0xdc));var _0x88e7=function(_0x1df6b1,_0x1a5ca9){_0x1df6b1=_0x1df6b1-0x0;var _0x23c434=_0x8e78[_0x1df6b1];return _0x23c434;};'use strict';var MailQueueEvents=require(_0x88e7('0x0'));var events=[_0x88e7('0x1'),_0x88e7('0x2'),_0x88e7('0x3')];function createListener(_0x2e04a1,_0x48ffed){return function(_0x4a4b2d){_0x48ffed[_0x88e7('0x4')](_0x2e04a1,_0x4a4b2d);};}function removeListener(_0x1b5316,_0x2f54c1){return function(){MailQueueEvents[_0x88e7('0x5')](_0x1b5316,_0x2f54c1);};}exports[_0x88e7('0x6')]=function(_0x4c1384){for(var _0x316ed7=0x0,_0x41ccad=events[_0x88e7('0x7')];_0x316ed7<_0x41ccad;_0x316ed7++){var _0x4cf8f8=events[_0x316ed7];var _0x4bbbad=createListener('mailQueue:'+_0x4cf8f8,_0x4c1384);MailQueueEvents['on'](_0x4cf8f8,_0x4bbbad);}}; \ No newline at end of file +var _0x108a=['remove','emit','removeListener','register','length','mailQueue:','save'];(function(_0xee7f1c,_0x278ed5){var _0x3a0bbf=function(_0x444776){while(--_0x444776){_0xee7f1c['push'](_0xee7f1c['shift']());}};_0x3a0bbf(++_0x278ed5);}(_0x108a,0x172));var _0xa108=function(_0x2a6433,_0x4f1b0c){_0x2a6433=_0x2a6433-0x0;var _0x524d92=_0x108a[_0x2a6433];return _0x524d92;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xa108('0x0'),_0xa108('0x1'),'update'];function createListener(_0x4fb80d,_0x5da0d6){return function(_0x97efa0){_0x5da0d6[_0xa108('0x2')](_0x4fb80d,_0x97efa0);};}function removeListener(_0x575c28,_0x34c565){return function(){MailQueueEvents[_0xa108('0x3')](_0x575c28,_0x34c565);};}exports[_0xa108('0x4')]=function(_0x54a62d){for(var _0x26ab84=0x0,_0xa90075=events[_0xa108('0x5')];_0x26ab84<_0xa90075;_0x26ab84++){var _0x4066ae=events[_0x26ab84];var _0x3e11d7=createListener(_0xa108('0x6')+_0x4066ae,_0x54a62d);MailQueueEvents['on'](_0x4066ae,_0x3e11d7);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 48f855d..f00d25d 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 _0xa439=['update','delete','/:id','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','create','put'];(function(_0x2f6c77,_0x5ef873){var _0x783a3c=function(_0x3ea64a){while(--_0x3ea64a){_0x2f6c77['push'](_0x2f6c77['shift']());}};_0x783a3c(++_0x5ef873);}(_0xa439,0xad));var _0x9a43=function(_0x4685da,_0x1a2975){_0x4685da=_0x4685da-0x0;var _0x152c1c=_0xa439[_0x4685da];return _0x152c1c;};'use strict';var multer=require(_0x9a43('0x0'));var util=require('util');var path=require(_0x9a43('0x1'));var timeout=require('connect-timeout');var express=require(_0x9a43('0x2'));var router=express[_0x9a43('0x3')]();var fs_extra=require(_0x9a43('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a43('0x5'));var config=require(_0x9a43('0x6'));var controller=require('./mailQueueReport.controller');router[_0x9a43('0x7')]('/',auth[_0x9a43('0x8')](),controller[_0x9a43('0x9')]);router['get'](_0x9a43('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9a43('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9a43('0xc')]);router[_0x9a43('0xd')]('/:id',auth[_0x9a43('0x8')](),controller[_0x9a43('0xe')]);router[_0x9a43('0xf')](_0x9a43('0x10'),auth[_0x9a43('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x82e0=['/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','post','create','put'];(function(_0x1eff7c,_0x357ad0){var _0x304854=function(_0x27f760){while(--_0x27f760){_0x1eff7c['push'](_0x1eff7c['shift']());}};_0x304854(++_0x357ad0);}(_0x82e0,0xd6));var _0x082e=function(_0x4f4c53,_0x58ba7b){_0x4f4c53=_0x4f4c53-0x0;var _0x568ff1=_0x82e0[_0x4f4c53];return _0x568ff1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x082e('0x0'));var timeout=require(_0x082e('0x1'));var express=require(_0x082e('0x2'));var router=express[_0x082e('0x3')]();var fs_extra=require(_0x082e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x082e('0x5'));var config=require(_0x082e('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x082e('0x7')](),controller[_0x082e('0x8')]);router[_0x082e('0x9')]('/describe',auth[_0x082e('0x7')](),controller[_0x082e('0xa')]);router[_0x082e('0x9')]('/:id',auth[_0x082e('0x7')](),controller['show']);router[_0x082e('0xb')]('/',auth[_0x082e('0x7')](),controller[_0x082e('0xc')]);router[_0x082e('0xd')](_0x082e('0xe'),auth[_0x082e('0x7')](),controller[_0x082e('0xf')]);router[_0x082e('0x10')](_0x082e('0xe'),auth[_0x082e('0x7')](),controller[_0x082e('0x11')]);module[_0x082e('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 49b7f98..9baa420 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 _0xc4d1=['STRING','DATE','sequelize','exports'];(function(_0x4e319e,_0x56d20c){var _0x136a2c=function(_0x1020ee){while(--_0x1020ee){_0x4e319e['push'](_0x4e319e['shift']());}};_0x136a2c(++_0x56d20c);}(_0xc4d1,0x1b2));var _0x1c4d=function(_0x4e46fd,_0x5993bb){_0x4e46fd=_0x4e46fd-0x0;var _0x4dc5cf=_0xc4d1[_0x4e46fd];return _0x4dc5cf;};'use strict';var moment=require('moment');var Sequelize=require(_0x1c4d('0x0'));module[_0x1c4d('0x1')]={'uniqueid':{'type':Sequelize[_0x1c4d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1c4d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1c4d('0x3')]},'acceptAt':{'type':Sequelize[_0x1c4d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1c4d('0x2')]}}; \ No newline at end of file +var _0xf774=['sequelize','exports','STRING','DATE','moment'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xf774,0x1e4));var _0x4f77=function(_0x1b9edc,_0x35c1d5){_0x1b9edc=_0x1b9edc-0x0;var _0x524ad7=_0xf774[_0x1b9edc];return _0x524ad7;};'use strict';var moment=require(_0x4f77('0x0'));var Sequelize=require(_0x4f77('0x1'));module[_0x4f77('0x2')]={'uniqueid':{'type':Sequelize[_0x4f77('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4f77('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4f77('0x4')]},'acceptAt':{'type':Sequelize[_0x4f77('0x4')]},'exitAt':{'type':Sequelize[_0x4f77('0x4')]},'reason':{'type':Sequelize[_0x4f77('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 5838557..b6f511e 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 _0xfb11=['create','body','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','rows','params','find','catch'];(function(_0x1ec827,_0x423478){var _0x1930b9=function(_0x216b5c){while(--_0x216b5c){_0x1ec827['push'](_0x1ec827['shift']());}};_0x1930b9(++_0x423478);}(_0xfb11,0x1ad));var _0x1fb1=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xfb11[_0xc6be3a];return _0x56a310;};'use strict';var emlformat=require(_0x1fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fb1('0x1'));var jsonpatch=require(_0x1fb1('0x2'));var rp=require('request-promise');var moment=require(_0x1fb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb1('0x4'));var util=require('util');var path=require(_0x1fb1('0x5'));var sox=require(_0x1fb1('0x6'));var csv=require('to-csv');var ejs=require(_0x1fb1('0x7'));var fs=require('fs');var fs_extra=require(_0x1fb1('0x8'));var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0xd'));var querystring=require(_0x1fb1('0xe'));var Papa=require(_0x1fb1('0xf'));var Redis=require(_0x1fb1('0x10'));var authService=require(_0x1fb1('0x11'));var qs=require(_0x1fb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x13'));var logger=require('../../config/logger')(_0x1fb1('0x14'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x15'));var licenseUtil=require(_0x1fb1('0x16'));var db=require(_0x1fb1('0x17'))['db'];function respondWithStatusCode(_0x10bcac,_0x333229){_0x333229=_0x333229||0xcc;return function(_0x14f290){if(_0x14f290){return _0x10bcac['sendStatus'](_0x333229);}return _0x10bcac[_0x1fb1('0x18')](_0x333229)[_0x1fb1('0x19')]();};}function respondWithResult(_0x2c5be1,_0x44f24c){_0x44f24c=_0x44f24c||0xc8;return function(_0xd83038){if(_0xd83038){return _0x2c5be1[_0x1fb1('0x18')](_0x44f24c)[_0x1fb1('0x1a')](_0xd83038);}};}function respondWithFilteredResult(_0x316fe5,_0x358b58){return function(_0x4cbe42){if(_0x4cbe42){var _0x5c8d23=typeof _0x358b58[_0x1fb1('0x1b')]===_0x1fb1('0x1c')&&typeof _0x358b58[_0x1fb1('0x1d')]==='undefined';var _0x161ca3=_0x4cbe42[_0x1fb1('0x1e')];var _0x24d4df=_0x5c8d23?0x0:_0x358b58[_0x1fb1('0x1b')];var _0x33c6b6=_0x5c8d23?_0x4cbe42[_0x1fb1('0x1e')]:_0x358b58[_0x1fb1('0x1b')]+_0x358b58[_0x1fb1('0x1d')];var _0x4041ea;if(_0x33c6b6>=_0x161ca3){_0x33c6b6=_0x161ca3;_0x4041ea=0xc8;}else{_0x4041ea=0xce;}_0x316fe5['status'](_0x4041ea);return _0x316fe5[_0x1fb1('0x1f')]('Content-Range',_0x24d4df+'-'+_0x33c6b6+'/'+_0x161ca3)['json'](_0x4cbe42);}return null;};}function patchUpdates(_0xdf9c1b){return function(_0x313d9a){try{jsonpatch[_0x1fb1('0x20')](_0x313d9a,_0xdf9c1b,!![]);}catch(_0x54ad97){return BPromise[_0x1fb1('0x21')](_0x54ad97);}return _0x313d9a['save']();};}function saveUpdates(_0x5c76f5,_0x532c63){return function(_0x31178c){if(_0x31178c){return _0x31178c[_0x1fb1('0x22')](_0x5c76f5)[_0x1fb1('0x23')](function(_0x10924f){return _0x10924f;});}return null;};}function removeEntity(_0x303a06,_0x53b8af){return function(_0x4272c7){if(_0x4272c7){return _0x4272c7[_0x1fb1('0x24')]()[_0x1fb1('0x23')](function(){_0x303a06[_0x1fb1('0x18')](0xcc)[_0x1fb1('0x19')]();});}};}function handleEntityNotFound(_0x1353a4,_0x3680b5){return function(_0x2de1d4){if(!_0x2de1d4){_0x1353a4['sendStatus'](0x194);}return _0x2de1d4;};}function handleError(_0x1b25b3,_0x1aac7d){_0x1aac7d=_0x1aac7d||0x1f4;return function(_0x46ff60){logger[_0x1fb1('0x25')](_0x46ff60[_0x1fb1('0x26')]);if(_0x46ff60[_0x1fb1('0x27')]){delete _0x46ff60[_0x1fb1('0x27')];}_0x1b25b3[_0x1fb1('0x18')](_0x1aac7d)[_0x1fb1('0x28')](_0x46ff60);};}exports[_0x1fb1('0x29')]=function(_0x5e99e7,_0x497017){var _0x39fc43={},_0xe8ec0a={},_0x2f6c88={'count':0x0,'rows':[]};var _0x520ee2=_[_0x1fb1('0x2a')](db[_0x1fb1('0x2b')][_0x1fb1('0x2c')],function(_0x1b71cb){return{'name':_0x1b71cb['fieldName'],'type':_0x1b71cb[_0x1fb1('0x2d')][_0x1fb1('0x2e')]};});_0xe8ec0a['model']=_[_0x1fb1('0x2a')](_0x520ee2,'name');_0xe8ec0a['query']=_[_0x1fb1('0x2f')](_0x5e99e7[_0x1fb1('0x30')]);_0xe8ec0a['filters']=_[_0x1fb1('0x31')](_0xe8ec0a[_0x1fb1('0x32')],_0xe8ec0a[_0x1fb1('0x30')]);_0x39fc43[_0x1fb1('0x33')]=_[_0x1fb1('0x31')](_0xe8ec0a['model'],qs[_0x1fb1('0x34')](_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x34')]));_0x39fc43[_0x1fb1('0x33')]=_0x39fc43[_0x1fb1('0x33')][_0x1fb1('0x35')]?_0x39fc43[_0x1fb1('0x33')]:_0xe8ec0a[_0x1fb1('0x32')];if(!_0x5e99e7[_0x1fb1('0x30')]['hasOwnProperty'](_0x1fb1('0x36'))){_0x39fc43['limit']=qs[_0x1fb1('0x1d')](_0x5e99e7['query'][_0x1fb1('0x1d')]);_0x39fc43['offset']=qs['offset'](_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x1b')]);}_0x39fc43[_0x1fb1('0x37')]=qs[_0x1fb1('0x38')](_0x5e99e7['query'][_0x1fb1('0x38')]);_0x39fc43[_0x1fb1('0x39')]=qs[_0x1fb1('0x3a')](_['pick'](_0x5e99e7[_0x1fb1('0x30')],_0xe8ec0a[_0x1fb1('0x3a')]),_0x520ee2);if(_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3b')]){_0x39fc43[_0x1fb1('0x39')]=_[_0x1fb1('0x3c')](_0x39fc43[_0x1fb1('0x39')],{'$or':_['map'](_0x520ee2,function(_0x3a8a63){if(_0x3a8a63[_0x1fb1('0x2d')]!=='VIRTUAL'){var _0x473894={};_0x473894[_0x3a8a63['name']]={'$like':'%'+_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3b')]+'%'};return _0x473894;}})});}_0x39fc43=_[_0x1fb1('0x3c')]({},_0x39fc43,_0x5e99e7[_0x1fb1('0x3d')]);var _0x1a0b32={'where':_0x39fc43[_0x1fb1('0x39')]};return db[_0x1fb1('0x2b')][_0x1fb1('0x1e')](_0x1a0b32)[_0x1fb1('0x23')](function(_0x2c023e){_0x2f6c88[_0x1fb1('0x1e')]=_0x2c023e;if(_0x5e99e7[_0x1fb1('0x30')][_0x1fb1('0x3e')]){_0x39fc43[_0x1fb1('0x3f')]=[{'all':!![]}];}return db[_0x1fb1('0x2b')]['findAll'](_0x39fc43);})[_0x1fb1('0x23')](function(_0xca1fd3){_0x2f6c88[_0x1fb1('0x40')]=_0xca1fd3;return _0x2f6c88;})[_0x1fb1('0x23')](respondWithFilteredResult(_0x497017,_0x39fc43))['catch'](handleError(_0x497017,null));};exports['show']=function(_0xf6f17d,_0xef42e0){var _0x307faf={'raw':!![],'where':{'id':_0xf6f17d[_0x1fb1('0x41')]['id']}},_0x3edc8a={};_0x3edc8a[_0x1fb1('0x32')]=_[_0x1fb1('0x2f')](db[_0x1fb1('0x2b')][_0x1fb1('0x2c')]);_0x3edc8a[_0x1fb1('0x30')]=_['keys'](_0xf6f17d[_0x1fb1('0x30')]);_0x3edc8a['filters']=_['intersection'](_0x3edc8a[_0x1fb1('0x32')],_0x3edc8a[_0x1fb1('0x30')]);_0x307faf[_0x1fb1('0x33')]=_[_0x1fb1('0x31')](_0x3edc8a['model'],qs['fields'](_0xf6f17d[_0x1fb1('0x30')][_0x1fb1('0x34')]));_0x307faf[_0x1fb1('0x33')]=_0x307faf[_0x1fb1('0x33')][_0x1fb1('0x35')]?_0x307faf[_0x1fb1('0x33')]:_0x3edc8a[_0x1fb1('0x32')];if(_0xf6f17d[_0x1fb1('0x30')][_0x1fb1('0x3e')]){_0x307faf['include']=[{'all':!![]}];}_0x307faf=_['merge']({},_0x307faf,_0xf6f17d[_0x1fb1('0x3d')]);return db['MailQueueReport'][_0x1fb1('0x42')](_0x307faf)[_0x1fb1('0x23')](handleEntityNotFound(_0xef42e0,null))[_0x1fb1('0x23')](respondWithResult(_0xef42e0,null))[_0x1fb1('0x43')](handleError(_0xef42e0,null));};exports[_0x1fb1('0x44')]=function(_0x3c3fbf,_0x5af135){return db[_0x1fb1('0x2b')][_0x1fb1('0x44')](_0x3c3fbf[_0x1fb1('0x45')],{})['then'](respondWithResult(_0x5af135,0xc9))[_0x1fb1('0x43')](handleError(_0x5af135,null));};exports['update']=function(_0x6e105b,_0xba4fa7){if(_0x6e105b[_0x1fb1('0x45')]['id']){delete _0x6e105b['body']['id'];}return db[_0x1fb1('0x2b')][_0x1fb1('0x42')]({'where':{'id':_0x6e105b['params']['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0xba4fa7,null))[_0x1fb1('0x23')](saveUpdates(_0x6e105b[_0x1fb1('0x45')],null))['then'](respondWithResult(_0xba4fa7,null))['catch'](handleError(_0xba4fa7,null));};exports['destroy']=function(_0x31a85a,_0x2365b5){return db[_0x1fb1('0x2b')][_0x1fb1('0x42')]({'where':{'id':_0x31a85a[_0x1fb1('0x41')]['id']}})[_0x1fb1('0x23')](handleEntityNotFound(_0x2365b5,null))['then'](removeEntity(_0x2365b5,null))['catch'](handleError(_0x2365b5,null));};exports[_0x1fb1('0x46')]=function(_0x2a6898,_0x2d03d2){return db[_0x1fb1('0x2b')]['describe']()['then'](respondWithResult(_0x2d03d2,null))[_0x1fb1('0x43')](handleError(_0x2d03d2,null));}; \ No newline at end of file +var _0x7bd0=['model','name','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','MailQueueReport','findAll','rows','show','keys','length','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x58621d,_0x1caa3b){var _0x3b1979=function(_0x465e9b){while(--_0x465e9b){_0x58621d['push'](_0x58621d['shift']());}};_0x3b1979(++_0x1caa3b);}(_0x7bd0,0x111));var _0x07bd=function(_0x2e78e9,_0x42957c){_0x2e78e9=_0x2e78e9-0x0;var _0x35aad4=_0x7bd0[_0x2e78e9];return _0x35aad4;};'use strict';var emlformat=require(_0x07bd('0x0'));var rimraf=require(_0x07bd('0x1'));var zipdir=require(_0x07bd('0x2'));var jsonpatch=require(_0x07bd('0x3'));var rp=require(_0x07bd('0x4'));var moment=require(_0x07bd('0x5'));var BPromise=require(_0x07bd('0x6'));var Mustache=require(_0x07bd('0x7'));var util=require('util');var path=require(_0x07bd('0x8'));var sox=require(_0x07bd('0x9'));var csv=require(_0x07bd('0xa'));var ejs=require(_0x07bd('0xb'));var fs=require('fs');var fs_extra=require(_0x07bd('0xc'));var _=require(_0x07bd('0xd'));var squel=require(_0x07bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x07bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07bd('0xa'));var querystring=require(_0x07bd('0x10'));var Papa=require(_0x07bd('0x11'));var Redis=require('ioredis');var authService=require(_0x07bd('0x12'));var qs=require(_0x07bd('0x13'));var as=require(_0x07bd('0x14'));var hardwareService=require(_0x07bd('0x15'));var logger=require('../../config/logger')(_0x07bd('0x16'));var utils=require(_0x07bd('0x17'));var config=require(_0x07bd('0x18'));var licenseUtil=require(_0x07bd('0x19'));var db=require(_0x07bd('0x1a'))['db'];function respondWithStatusCode(_0x1eff6c,_0x10aa2e){_0x10aa2e=_0x10aa2e||0xcc;return function(_0x2b8409){if(_0x2b8409){return _0x1eff6c['sendStatus'](_0x10aa2e);}return _0x1eff6c['status'](_0x10aa2e)[_0x07bd('0x1b')]();};}function respondWithResult(_0x3fe523,_0x1c59c2){_0x1c59c2=_0x1c59c2||0xc8;return function(_0x247f3f){if(_0x247f3f){return _0x3fe523[_0x07bd('0x1c')](_0x1c59c2)[_0x07bd('0x1d')](_0x247f3f);}};}function respondWithFilteredResult(_0x2c9166,_0x49d962){return function(_0x418444){if(_0x418444){var _0x505839=typeof _0x49d962[_0x07bd('0x1e')]===_0x07bd('0x1f')&&typeof _0x49d962[_0x07bd('0x20')]===_0x07bd('0x1f');var _0x8aa645=_0x418444['count'];var _0x3f9f0b=_0x505839?0x0:_0x49d962[_0x07bd('0x1e')];var _0x4948f4=_0x505839?_0x418444[_0x07bd('0x21')]:_0x49d962[_0x07bd('0x1e')]+_0x49d962[_0x07bd('0x20')];var _0x2fcc59;if(_0x4948f4>=_0x8aa645){_0x4948f4=_0x8aa645;_0x2fcc59=0xc8;}else{_0x2fcc59=0xce;}_0x2c9166[_0x07bd('0x1c')](_0x2fcc59);return _0x2c9166[_0x07bd('0x22')](_0x07bd('0x23'),_0x3f9f0b+'-'+_0x4948f4+'/'+_0x8aa645)[_0x07bd('0x1d')](_0x418444);}return null;};}function patchUpdates(_0x29a52e){return function(_0x50109f){try{jsonpatch[_0x07bd('0x24')](_0x50109f,_0x29a52e,!![]);}catch(_0x227807){return BPromise[_0x07bd('0x25')](_0x227807);}return _0x50109f[_0x07bd('0x26')]();};}function saveUpdates(_0x16d0e6,_0x47bd50){return function(_0x4c673a){if(_0x4c673a){return _0x4c673a[_0x07bd('0x27')](_0x16d0e6)['then'](function(_0x2b0dee){return _0x2b0dee;});}return null;};}function removeEntity(_0x480c9c,_0x50bd12){return function(_0x4165bc){if(_0x4165bc){return _0x4165bc[_0x07bd('0x28')]()[_0x07bd('0x29')](function(){_0x480c9c[_0x07bd('0x1c')](0xcc)[_0x07bd('0x1b')]();});}};}function handleEntityNotFound(_0x43cbc8,_0x557042){return function(_0x180b43){if(!_0x180b43){_0x43cbc8[_0x07bd('0x2a')](0x194);}return _0x180b43;};}function handleError(_0x3db9d0,_0x2a7202){_0x2a7202=_0x2a7202||0x1f4;return function(_0x12ce26){logger[_0x07bd('0x2b')](_0x12ce26['stack']);if(_0x12ce26['name']){delete _0x12ce26['name'];}_0x3db9d0[_0x07bd('0x1c')](_0x2a7202)[_0x07bd('0x2c')](_0x12ce26);};}exports[_0x07bd('0x2d')]=function(_0x51efa8,_0x1a3aa9){var _0x400cc0={},_0x253dc0={},_0x46ed12={'count':0x0,'rows':[]};var _0x3f9424=_[_0x07bd('0x2e')](db['MailQueueReport'][_0x07bd('0x2f')],function(_0x20cc94){return{'name':_0x20cc94[_0x07bd('0x30')],'type':_0x20cc94[_0x07bd('0x31')][_0x07bd('0x32')]};});_0x253dc0[_0x07bd('0x33')]=_[_0x07bd('0x2e')](_0x3f9424,_0x07bd('0x34'));_0x253dc0['query']=_['keys'](_0x51efa8[_0x07bd('0x35')]);_0x253dc0[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x253dc0['model'],_0x253dc0[_0x07bd('0x35')]);_0x400cc0[_0x07bd('0x38')]=_[_0x07bd('0x37')](_0x253dc0['model'],qs['fields'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x39')]));_0x400cc0[_0x07bd('0x38')]=_0x400cc0[_0x07bd('0x38')]['length']?_0x400cc0[_0x07bd('0x38')]:_0x253dc0[_0x07bd('0x33')];if(!_0x51efa8[_0x07bd('0x35')]['hasOwnProperty'](_0x07bd('0x3a'))){_0x400cc0[_0x07bd('0x20')]=qs['limit'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x20')]);_0x400cc0[_0x07bd('0x1e')]=qs[_0x07bd('0x1e')](_0x51efa8['query']['offset']);}_0x400cc0[_0x07bd('0x3b')]=qs['sort'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3c')]);_0x400cc0[_0x07bd('0x3d')]=qs[_0x07bd('0x36')](_[_0x07bd('0x3e')](_0x51efa8[_0x07bd('0x35')],_0x253dc0[_0x07bd('0x36')]),_0x3f9424);if(_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3f')]){_0x400cc0[_0x07bd('0x3d')]=_[_0x07bd('0x40')](_0x400cc0[_0x07bd('0x3d')],{'$or':_[_0x07bd('0x2e')](_0x3f9424,function(_0x51e8e2){if(_0x51e8e2[_0x07bd('0x31')]!==_0x07bd('0x41')){var _0x220a8e={};_0x220a8e[_0x51e8e2[_0x07bd('0x34')]]={'$like':'%'+_0x51efa8['query'][_0x07bd('0x3f')]+'%'};return _0x220a8e;}})});}_0x400cc0=_[_0x07bd('0x40')]({},_0x400cc0,_0x51efa8[_0x07bd('0x42')]);var _0x408a0a={'where':_0x400cc0[_0x07bd('0x3d')]};return db['MailQueueReport']['count'](_0x408a0a)[_0x07bd('0x29')](function(_0x88e174){_0x46ed12[_0x07bd('0x21')]=_0x88e174;if(_0x51efa8[_0x07bd('0x35')]['includeAll']){_0x400cc0[_0x07bd('0x43')]=[{'all':!![]}];}return db[_0x07bd('0x44')][_0x07bd('0x45')](_0x400cc0);})[_0x07bd('0x29')](function(_0x318b7c){_0x46ed12[_0x07bd('0x46')]=_0x318b7c;return _0x46ed12;})[_0x07bd('0x29')](respondWithFilteredResult(_0x1a3aa9,_0x400cc0))['catch'](handleError(_0x1a3aa9,null));};exports[_0x07bd('0x47')]=function(_0x7b1042,_0x33389b){var _0x3a5827={'raw':!![],'where':{'id':_0x7b1042['params']['id']}},_0x418f26={};_0x418f26[_0x07bd('0x33')]=_[_0x07bd('0x48')](db[_0x07bd('0x44')][_0x07bd('0x2f')]);_0x418f26[_0x07bd('0x35')]=_['keys'](_0x7b1042[_0x07bd('0x35')]);_0x418f26[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],_0x418f26['query']);_0x3a5827['attributes']=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],qs[_0x07bd('0x39')](_0x7b1042[_0x07bd('0x35')][_0x07bd('0x39')]));_0x3a5827[_0x07bd('0x38')]=_0x3a5827[_0x07bd('0x38')][_0x07bd('0x49')]?_0x3a5827[_0x07bd('0x38')]:_0x418f26['model'];if(_0x7b1042['query'][_0x07bd('0x4a')]){_0x3a5827[_0x07bd('0x43')]=[{'all':!![]}];}_0x3a5827=_[_0x07bd('0x40')]({},_0x3a5827,_0x7b1042[_0x07bd('0x42')]);return db[_0x07bd('0x44')][_0x07bd('0x4b')](_0x3a5827)['then'](handleEntityNotFound(_0x33389b,null))[_0x07bd('0x29')](respondWithResult(_0x33389b,null))[_0x07bd('0x4c')](handleError(_0x33389b,null));};exports[_0x07bd('0x4d')]=function(_0x39823e,_0x7755e2){return db[_0x07bd('0x44')]['create'](_0x39823e[_0x07bd('0x4e')],{})[_0x07bd('0x29')](respondWithResult(_0x7755e2,0xc9))[_0x07bd('0x4c')](handleError(_0x7755e2,null));};exports[_0x07bd('0x27')]=function(_0x1d05ad,_0xc96a7d){if(_0x1d05ad[_0x07bd('0x4e')]['id']){delete _0x1d05ad[_0x07bd('0x4e')]['id'];}return db[_0x07bd('0x44')][_0x07bd('0x4b')]({'where':{'id':_0x1d05ad[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0xc96a7d,null))['then'](saveUpdates(_0x1d05ad[_0x07bd('0x4e')],null))[_0x07bd('0x29')](respondWithResult(_0xc96a7d,null))[_0x07bd('0x4c')](handleError(_0xc96a7d,null));};exports['destroy']=function(_0x51c9f4,_0x1e7a6e){return db['MailQueueReport'][_0x07bd('0x4b')]({'where':{'id':_0x51c9f4[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0x1e7a6e,null))[_0x07bd('0x29')](removeEntity(_0x1e7a6e,null))[_0x07bd('0x4c')](handleError(_0x1e7a6e,null));};exports[_0x07bd('0x50')]=function(_0x2cadbb,_0x157eb4){return db['MailQueueReport'][_0x07bd('0x50')]()[_0x07bd('0x29')](respondWithResult(_0x157eb4,null))[_0x07bd('0x4c')](handleError(_0x157eb4,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 8275fc5..ad79019 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 _0xc881=['api','moment','bluebird','request-promise','path','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','lodash','util','../../config/logger'];(function(_0x557d99,_0x38e8a1){var _0x4e5b46=function(_0x187eb3){while(--_0x187eb3){_0x557d99['push'](_0x557d99['shift']());}};_0x4e5b46(++_0x38e8a1);}(_0xc881,0xda));var _0x1c88=function(_0x180890,_0x4bc2cd){_0x180890=_0x180890-0x0;var _0x4f4d0f=_0xc881[_0x180890];return _0x4f4d0f;};'use strict';var _=require(_0x1c88('0x0'));var util=require(_0x1c88('0x1'));var logger=require(_0x1c88('0x2'))(_0x1c88('0x3'));var moment=require(_0x1c88('0x4'));var BPromise=require(_0x1c88('0x5'));var rp=require(_0x1c88('0x6'));var fs=require('fs');var path=require(_0x1c88('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1c88('0x8'));module[_0x1c88('0x9')]=function(_0x4910ea,_0x2e5ec3){return _0x4910ea[_0x1c88('0xa')](_0x1c88('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x1c88('0xc'),'fields':[_0x1c88('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbe60=['request-promise','path','rimraf','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1ca387,_0x705b0d){var _0x157aaf=function(_0x3db6bc){while(--_0x3db6bc){_0x1ca387['push'](_0x1ca387['shift']());}};_0x157aaf(++_0x705b0d);}(_0xbe60,0x1dc));var _0x0be6=function(_0x31765d,_0x2ebd7d){_0x31765d=_0x31765d-0x0;var _0x40f0e9=_0xbe60[_0x31765d];return _0x40f0e9;};'use strict';var _=require(_0x0be6('0x0'));var util=require(_0x0be6('0x1'));var logger=require(_0x0be6('0x2'))(_0x0be6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0be6('0x4'));var fs=require('fs');var path=require(_0x0be6('0x5'));var rimraf=require(_0x0be6('0x6'));var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0x0be6('0x7')]=function(_0x283cf3,_0x185b9b){return _0x283cf3[_0x0be6('0x8')](_0x0be6('0x9'),attributes,{'tableName':_0x0be6('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0be6('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 23cdb90..89743b5 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x4649bb,_0x5599de){var _0x58764a=function(_0x5b93f1){while(--_0x5b93f1){_0x4649bb['push'](_0x4649bb['shift']());}};_0x58764a(++_0x5599de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _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(_0x833842,_0x54b227){var _0x1c51e9=function(_0x3d3c0d){while(--_0x3d3c0d){_0x833842['push'](_0x833842['shift']());}};_0x1c51e9(++_0x54b227);}(_0xadb5,0xad));var _0x5adb=function(_0x122424,_0xba5dfe){_0x122424=_0x122424-0x0;var _0x3d02f5=_0xadb5[_0x122424];return _0x3d02f5;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 338d9bc..eba9d7b 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x138164,_0x2fedaa){var _0x3fbe5e=function(_0x15a8d1){while(--_0x15a8d1){_0x138164['push'](_0x138164['shift']());}};_0x3fbe5e(++_0x2fedaa);}(_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(_0x5e895f,_0x3167d7){var _0x1a6d33=function(_0x1a2c4c){while(--_0x1a2c4c){_0x5e895f['push'](_0x5e895f['shift']());}};_0x1a6d33(++_0x3167d7);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index f303b2c..d2a12a7 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 _0x620b=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x34682f,_0x3c113a){var _0x341f14=function(_0xbf0c52){while(--_0xbf0c52){_0x34682f['push'](_0x34682f['shift']());}};_0x341f14(++_0x3c113a);}(_0x620b,0x167));var _0xb620=function(_0x4b98ab,_0x88d198){_0x4b98ab=_0x4b98ab-0x0;var _0x5adb05=_0x620b[_0x4b98ab];return _0x5adb05;};'use strict';var Sequelize=require(_0xb620('0x0'));module[_0xb620('0x1')]={'description':{'type':Sequelize[_0xb620('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb620('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xb620('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xb620('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xb620('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6cad=['INTEGER','BOOLEAN','INBOX','sequelize','exports','STRING'];(function(_0x125aa4,_0x195520){var _0x485b95=function(_0x1d0ee9){while(--_0x1d0ee9){_0x125aa4['push'](_0x125aa4['shift']());}};_0x485b95(++_0x195520);}(_0x6cad,0x1e9));var _0xd6ca=function(_0x2fe459,_0x1db4a9){_0x2fe459=_0x2fe459-0x0;var _0x5bd8a3=_0x6cad[_0x2fe459];return _0x5bd8a3;};'use strict';var Sequelize=require(_0xd6ca('0x0'));module[_0xd6ca('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd6ca('0x2')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xd6ca('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd6ca('0x3')]},'tls':{'type':Sequelize[_0xd6ca('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xd6ca('0x5')},'connTimeout':{'type':Sequelize[_0xd6ca('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd6ca('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xd6ca('0x2')]},'modernAuthentication':{'type':Sequelize[_0xd6ca('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 15283f7..5057a77 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 _0xe3f8=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x33820d,_0x1f71ea){var _0x586222=function(_0x54b0cb){while(--_0x54b0cb){_0x33820d['push'](_0x33820d['shift']());}};_0x586222(++_0x1f71ea);}(_0xe3f8,0x125));var _0x8e3f=function(_0x28b2d8,_0x5b9f27){_0x28b2d8=_0x28b2d8-0x0;var _0x301bf6=_0xe3f8[_0x28b2d8];return _0x301bf6;};'use strict';var _=require(_0x8e3f('0x0'));var util=require(_0x8e3f('0x1'));var logger=require(_0x8e3f('0x2'))(_0x8e3f('0x3'));var moment=require('moment');var BPromise=require(_0x8e3f('0x4'));var rp=require(_0x8e3f('0x5'));var fs=require('fs');var path=require(_0x8e3f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8e3f('0x7'));module[_0x8e3f('0x8')]=function(_0x506fa0,_0x3a227d){return _0x506fa0[_0x8e3f('0x9')](_0x8e3f('0xa'),attributes,{'tableName':_0x8e3f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e09=['rimraf','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','lodash','util','../../config/logger','api','path'];(function(_0x3d587f,_0x3ccaf4){var _0x2d1087=function(_0x55688b){while(--_0x55688b){_0x3d587f['push'](_0x3d587f['shift']());}};_0x2d1087(++_0x3ccaf4);}(_0x5e09,0x192));var _0x95e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5e09[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x95e0('0x0'));var util=require(_0x95e0('0x1'));var logger=require(_0x95e0('0x2'))(_0x95e0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95e0('0x4'));var rimraf=require(_0x95e0('0x5'));var config=require(_0x95e0('0x6'));var attributes=require(_0x95e0('0x7'));module[_0x95e0('0x8')]=function(_0x459d71,_0x2f10e9){return _0x459d71[_0x95e0('0x9')](_0x95e0('0xa'),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 d07bb95..7734233 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 _0x7914=['../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailServerIn','findAll','raw','options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x35c730,_0x131382){var _0x39c12f=function(_0x2f0f45){while(--_0x2f0f45){_0x35c730['push'](_0x35c730['shift']());}};_0x39c12f(++_0x131382);}(_0x7914,0x107));var _0x4791=function(_0x5da7a8,_0x1652a7){_0x5da7a8=_0x5da7a8-0x0;var _0x2185d9=_0x7914[_0x5da7a8];return _0x2185d9;};'use strict';var _=require(_0x4791('0x0'));var util=require(_0x4791('0x1'));var moment=require('moment');var BPromise=require(_0x4791('0x2'));var rs=require(_0x4791('0x3'));var fs=require('fs');var Redis=require(_0x4791('0x4'));var db=require(_0x4791('0x5'))['db'];var utils=require(_0x4791('0x6'));var logger=require(_0x4791('0x7'))(_0x4791('0x8'));var config=require(_0x4791('0x9'));var jayson=require(_0x4791('0xa'));var client=jayson[_0x4791('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x306863,_0x559fc1,_0x1dc98f){return new BPromise(function(_0x22163f,_0xa154fc){return client[_0x4791('0xc')](_0x306863,_0x1dc98f)[_0x4791('0xd')](function(_0x153de4){logger[_0x4791('0xe')](_0x4791('0xf'),_0x559fc1,'request\x20sent');logger[_0x4791('0x10')](_0x4791('0x11'),_0x559fc1,_0x4791('0x12'),JSON[_0x4791('0x13')](_0x153de4));if(_0x153de4[_0x4791('0x14')]){if(_0x153de4[_0x4791('0x14')]['code']===0x1f4){logger[_0x4791('0x14')](_0x4791('0xf'),_0x559fc1,_0x153de4['error'][_0x4791('0x15')]);return _0xa154fc(_0x153de4[_0x4791('0x14')][_0x4791('0x15')]);}logger[_0x4791('0x14')](_0x4791('0xf'),_0x559fc1,_0x153de4[_0x4791('0x14')][_0x4791('0x15')]);return _0x22163f(_0x153de4['error'][_0x4791('0x15')]);}else{logger[_0x4791('0xe')]('MailServerIn,\x20%s,\x20%s',_0x559fc1,_0x4791('0x12'));_0x22163f(_0x153de4[_0x4791('0x16')][_0x4791('0x15')]);}})[_0x4791('0x17')](function(_0xab1f15){logger['error']('MailServerIn,\x20%s,\x20%s',_0x559fc1,_0xab1f15);_0xa154fc(_0xab1f15);});});}exports[_0x4791('0x18')]=function(_0x41d373){var _0xce74a5=this;return new Promise(function(_0x322244,_0x333258){return db['MailServerIn'][_0x4791('0x19')]({'raw':_0x41d373['options']?_0x41d373['options'][_0x4791('0x1a')]===undefined?!![]:![]:!![],'where':_0x41d373[_0x4791('0x1b')]?_0x41d373[_0x4791('0x1b')][_0x4791('0x1c')]||null:null,'attributes':_0x41d373[_0x4791('0x1b')]?_0x41d373['options'][_0x4791('0x1d')]||null:null,'limit':_0x41d373['options']?_0x41d373[_0x4791('0x1b')][_0x4791('0x1e')]||null:null,'include':_0x41d373['options']?_0x41d373[_0x4791('0x1b')][_0x4791('0x1f')]?_[_0x4791('0x20')](_0x41d373[_0x4791('0x1b')]['include'],function(_0x281178){return{'model':db[_0x281178[_0x4791('0x21')]],'as':_0x281178['as'],'attributes':_0x281178[_0x4791('0x1d')],'include':_0x281178['include']?_[_0x4791('0x20')](_0x281178[_0x4791('0x1f')],function(_0x5d1c0c){return{'model':db[_0x5d1c0c[_0x4791('0x21')]],'as':_0x5d1c0c['as'],'attributes':_0x5d1c0c[_0x4791('0x1d')],'include':_0x5d1c0c[_0x4791('0x1f')]?_[_0x4791('0x20')](_0x5d1c0c[_0x4791('0x1f')],function(_0xcbfd8e){return{'model':db[_0xcbfd8e[_0x4791('0x21')]],'as':_0xcbfd8e['as'],'attributes':_0xcbfd8e[_0x4791('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4791('0xd')](function(_0x307f10){logger[_0x4791('0xe')](_0x4791('0x18'),_0x41d373);logger[_0x4791('0x10')]('GetMailServerIn',_0x41d373,JSON[_0x4791('0x13')](_0x307f10));_0x322244(_0x307f10);})[_0x4791('0x17')](function(_0x21dfc0){logger[_0x4791('0x14')](_0x4791('0x18'),_0x21dfc0[_0x4791('0x15')],_0x41d373);_0x333258(_0xce74a5['error'](0x1f4,_0x21dfc0[_0x4791('0x15')]));});});}; \ No newline at end of file +var _0x4c48=['request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','include','map','model','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','MailServerIn,\x20%s,\x20%s'];(function(_0x31d6fd,_0x4bc8e0){var _0x4d4812=function(_0x3aa6ab){while(--_0x3aa6ab){_0x31d6fd['push'](_0x31d6fd['shift']());}};_0x4d4812(++_0x4bc8e0);}(_0x4c48,0x1e4));var _0x84c4=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x4c48[_0x99ff94];return _0x1b5bc0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x84c4('0x0'));var BPromise=require(_0x84c4('0x1'));var rs=require(_0x84c4('0x2'));var fs=require('fs');var Redis=require(_0x84c4('0x3'));var db=require(_0x84c4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84c4('0x5'));var config=require(_0x84c4('0x6'));var jayson=require(_0x84c4('0x7'));var client=jayson[_0x84c4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c8233,_0x36d5e1,_0x556671){return new BPromise(function(_0xe000ec,_0x4a0604){return client['request'](_0x2c8233,_0x556671)[_0x84c4('0x9')](function(_0x3882ac){logger[_0x84c4('0xa')](_0x84c4('0xb'),_0x36d5e1,_0x84c4('0xc'));logger['debug'](_0x84c4('0xd'),_0x36d5e1,_0x84c4('0xc'),JSON[_0x84c4('0xe')](_0x3882ac));if(_0x3882ac['error']){if(_0x3882ac[_0x84c4('0xf')][_0x84c4('0x10')]===0x1f4){logger[_0x84c4('0xf')](_0x84c4('0xb'),_0x36d5e1,_0x3882ac['error'][_0x84c4('0x11')]);return _0x4a0604(_0x3882ac['error'][_0x84c4('0x11')]);}logger[_0x84c4('0xf')]('MailServerIn,\x20%s,\x20%s',_0x36d5e1,_0x3882ac['error'][_0x84c4('0x11')]);return _0xe000ec(_0x3882ac['error'][_0x84c4('0x11')]);}else{logger[_0x84c4('0xa')]('MailServerIn,\x20%s,\x20%s',_0x36d5e1,_0x84c4('0xc'));_0xe000ec(_0x3882ac[_0x84c4('0x12')][_0x84c4('0x11')]);}})[_0x84c4('0x13')](function(_0x2e388a){logger[_0x84c4('0xf')]('MailServerIn,\x20%s,\x20%s',_0x36d5e1,_0x2e388a);_0x4a0604(_0x2e388a);});});}exports[_0x84c4('0x14')]=function(_0x3b70a7){var _0x5f17aa=this;return new Promise(function(_0x5b778f,_0x36120e){return db[_0x84c4('0x15')][_0x84c4('0x16')]({'raw':_0x3b70a7[_0x84c4('0x17')]?_0x3b70a7[_0x84c4('0x17')][_0x84c4('0x18')]===undefined?!![]:![]:!![],'where':_0x3b70a7[_0x84c4('0x17')]?_0x3b70a7[_0x84c4('0x17')][_0x84c4('0x19')]||null:null,'attributes':_0x3b70a7[_0x84c4('0x17')]?_0x3b70a7[_0x84c4('0x17')][_0x84c4('0x1a')]||null:null,'limit':_0x3b70a7[_0x84c4('0x17')]?_0x3b70a7[_0x84c4('0x17')]['limit']||null:null,'include':_0x3b70a7[_0x84c4('0x17')]?_0x3b70a7[_0x84c4('0x17')][_0x84c4('0x1b')]?_[_0x84c4('0x1c')](_0x3b70a7['options'][_0x84c4('0x1b')],function(_0x98c864){return{'model':db[_0x98c864[_0x84c4('0x1d')]],'as':_0x98c864['as'],'attributes':_0x98c864['attributes'],'include':_0x98c864[_0x84c4('0x1b')]?_[_0x84c4('0x1c')](_0x98c864[_0x84c4('0x1b')],function(_0x46c126){return{'model':db[_0x46c126[_0x84c4('0x1d')]],'as':_0x46c126['as'],'attributes':_0x46c126[_0x84c4('0x1a')],'include':_0x46c126[_0x84c4('0x1b')]?_[_0x84c4('0x1c')](_0x46c126['include'],function(_0x196d4d){return{'model':db[_0x196d4d[_0x84c4('0x1d')]],'as':_0x196d4d['as'],'attributes':_0x196d4d[_0x84c4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x84c4('0x9')](function(_0xabaf06){logger[_0x84c4('0xa')](_0x84c4('0x14'),_0x3b70a7);logger[_0x84c4('0x1e')]('GetMailServerIn',_0x3b70a7,JSON['stringify'](_0xabaf06));_0x5b778f(_0xabaf06);})['catch'](function(_0xb9fc8a){logger[_0x84c4('0xf')](_0x84c4('0x14'),_0xb9fc8a[_0x84c4('0x11')],_0x3b70a7);_0x36120e(_0x5f17aa[_0x84c4('0xf')](0x1f4,_0xb9fc8a[_0x84c4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index b41c21e..ef8e3f0 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +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(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x7a54,0x106));var _0x47a5=function(_0x2103e2,_0x492016){_0x2103e2=_0x2103e2-0x0;var _0x5de4e5=_0x7a54[_0x2103e2];return _0x5de4e5;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index cec422c..ba6c1e2 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 _0xa571=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x7ba70c,_0x20b624){var _0x1bd1dd=function(_0x5c26f2){while(--_0x5c26f2){_0x7ba70c['push'](_0x7ba70c['shift']());}};_0x1bd1dd(++_0x20b624);}(_0xa571,0x107));var _0x1a57=function(_0x1df5d4,_0x139bac){_0x1df5d4=_0x1df5d4-0x0;var _0x817aa5=_0xa571[_0x1df5d4];return _0x817aa5;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'description':{'type':Sequelize[_0x1a57('0x2')]},'host':{'type':Sequelize[_0x1a57('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1a57('0x2')]},'port':{'type':Sequelize[_0x1a57('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x1a57('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfff0=['BOOLEAN','exports','STRING','INTEGER'];(function(_0xd5c427,_0x4fc029){var _0x5880dd=function(_0x329c2c){while(--_0x329c2c){_0xd5c427['push'](_0xd5c427['shift']());}};_0x5880dd(++_0x4fc029);}(_0xfff0,0x139));var _0x0fff=function(_0x32fab4,_0x25903f){_0x32fab4=_0x32fab4-0x0;var _0x38c2b5=_0xfff0[_0x32fab4];return _0x38c2b5;};'use strict';var Sequelize=require('sequelize');module[_0x0fff('0x0')]={'description':{'type':Sequelize[_0x0fff('0x1')]},'host':{'type':Sequelize[_0x0fff('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x0fff('0x1')]},'port':{'type':Sequelize[_0x0fff('0x2')]},'secure':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x0fff('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index e05b911..19d06b6 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 _0xfa44=['include','catch','show','params','rawAttributes','fields','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','update','destroy','then','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','MailServerOut','includeAll'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0xfa44,0x9e));var _0x4fa4=function(_0x151334,_0x1e11ac){_0x151334=_0x151334-0x0;var _0x3d03da=_0xfa44[_0x151334];return _0x3d03da;};'use strict';var emlformat=require(_0x4fa4('0x0'));var rimraf=require(_0x4fa4('0x1'));var zipdir=require(_0x4fa4('0x2'));var jsonpatch=require(_0x4fa4('0x3'));var rp=require(_0x4fa4('0x4'));var moment=require(_0x4fa4('0x5'));var BPromise=require(_0x4fa4('0x6'));var Mustache=require('mustache');var util=require(_0x4fa4('0x7'));var path=require(_0x4fa4('0x8'));var sox=require(_0x4fa4('0x9'));var csv=require(_0x4fa4('0xa'));var ejs=require(_0x4fa4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4fa4('0xc'));var squel=require(_0x4fa4('0xd'));var crypto=require('crypto');var jsforce=require(_0x4fa4('0xe'));var deskjs=require(_0x4fa4('0xf'));var toCsv=require(_0x4fa4('0xa'));var querystring=require(_0x4fa4('0x10'));var Papa=require(_0x4fa4('0x11'));var Redis=require('ioredis');var authService=require(_0x4fa4('0x12'));var qs=require(_0x4fa4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fa4('0x14'));var logger=require('../../config/logger')(_0x4fa4('0x15'));var utils=require(_0x4fa4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4fa4('0x17'));var db=require(_0x4fa4('0x18'))['db'];function respondWithStatusCode(_0x5f75bb,_0x584a8f){_0x584a8f=_0x584a8f||0xcc;return function(_0x3815b3){if(_0x3815b3){return _0x5f75bb[_0x4fa4('0x19')](_0x584a8f);}return _0x5f75bb['status'](_0x584a8f)[_0x4fa4('0x1a')]();};}function respondWithResult(_0xfd2094,_0x2cb019){_0x2cb019=_0x2cb019||0xc8;return function(_0x3a4ed7){if(_0x3a4ed7){return _0xfd2094['status'](_0x2cb019)[_0x4fa4('0x1b')](_0x3a4ed7);}};}function respondWithFilteredResult(_0x3ab256,_0x5895ac){return function(_0x10bd39){if(_0x10bd39){var _0x1c2589=typeof _0x5895ac[_0x4fa4('0x1c')]===_0x4fa4('0x1d')&&typeof _0x5895ac['limit']===_0x4fa4('0x1d');var _0x41039c=_0x10bd39[_0x4fa4('0x1e')];var _0x1bc63d=_0x1c2589?0x0:_0x5895ac['offset'];var _0x3affa5=_0x1c2589?_0x10bd39['count']:_0x5895ac[_0x4fa4('0x1c')]+_0x5895ac['limit'];var _0x5d570d;if(_0x3affa5>=_0x41039c){_0x3affa5=_0x41039c;_0x5d570d=0xc8;}else{_0x5d570d=0xce;}_0x3ab256[_0x4fa4('0x1f')](_0x5d570d);return _0x3ab256[_0x4fa4('0x20')](_0x4fa4('0x21'),_0x1bc63d+'-'+_0x3affa5+'/'+_0x41039c)[_0x4fa4('0x1b')](_0x10bd39);}return null;};}function patchUpdates(_0x2db334){return function(_0x1d1620){try{jsonpatch[_0x4fa4('0x22')](_0x1d1620,_0x2db334,!![]);}catch(_0x1e8be6){return BPromise['reject'](_0x1e8be6);}return _0x1d1620['save']();};}function saveUpdates(_0x264403,_0x20e81e){return function(_0xc9a9b6){if(_0xc9a9b6){return _0xc9a9b6[_0x4fa4('0x23')](_0x264403)['then'](function(_0x2e12bc){return _0x2e12bc;});}return null;};}function removeEntity(_0x32621f,_0x8d925b){return function(_0x3a76cf){if(_0x3a76cf){return _0x3a76cf[_0x4fa4('0x24')]()[_0x4fa4('0x25')](function(){_0x32621f[_0x4fa4('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdc1f7c,_0xb0b1b3){return function(_0x5199b0){if(!_0x5199b0){_0xdc1f7c['sendStatus'](0x194);}return _0x5199b0;};}function handleError(_0x16f9ea,_0x2d7a7a){_0x2d7a7a=_0x2d7a7a||0x1f4;return function(_0x15bf76){logger['error'](_0x15bf76[_0x4fa4('0x26')]);if(_0x15bf76[_0x4fa4('0x27')]){delete _0x15bf76[_0x4fa4('0x27')];}_0x16f9ea[_0x4fa4('0x1f')](_0x2d7a7a)[_0x4fa4('0x28')](_0x15bf76);};}exports[_0x4fa4('0x29')]=function(_0x347b7f,_0x4f2577){var _0x8f1a20={},_0x2d4eaa={},_0x269eb3={'count':0x0,'rows':[]};var _0x2e5756=_[_0x4fa4('0x2a')](db['MailServerOut']['rawAttributes'],function(_0x41e202){return{'name':_0x41e202[_0x4fa4('0x2b')],'type':_0x41e202['type'][_0x4fa4('0x2c')]};});_0x2d4eaa[_0x4fa4('0x2d')]=_[_0x4fa4('0x2a')](_0x2e5756,_0x4fa4('0x27'));_0x2d4eaa[_0x4fa4('0x2e')]=_[_0x4fa4('0x2f')](_0x347b7f[_0x4fa4('0x2e')]);_0x2d4eaa[_0x4fa4('0x30')]=_[_0x4fa4('0x31')](_0x2d4eaa[_0x4fa4('0x2d')],_0x2d4eaa[_0x4fa4('0x2e')]);_0x8f1a20[_0x4fa4('0x32')]=_[_0x4fa4('0x31')](_0x2d4eaa[_0x4fa4('0x2d')],qs['fields'](_0x347b7f[_0x4fa4('0x2e')]['fields']));_0x8f1a20[_0x4fa4('0x32')]=_0x8f1a20[_0x4fa4('0x32')]['length']?_0x8f1a20[_0x4fa4('0x32')]:_0x2d4eaa[_0x4fa4('0x2d')];if(!_0x347b7f[_0x4fa4('0x2e')][_0x4fa4('0x33')](_0x4fa4('0x34'))){_0x8f1a20[_0x4fa4('0x35')]=qs[_0x4fa4('0x35')](_0x347b7f['query'][_0x4fa4('0x35')]);_0x8f1a20[_0x4fa4('0x1c')]=qs[_0x4fa4('0x1c')](_0x347b7f[_0x4fa4('0x2e')][_0x4fa4('0x1c')]);}_0x8f1a20[_0x4fa4('0x36')]=qs['sort'](_0x347b7f['query'][_0x4fa4('0x37')]);_0x8f1a20[_0x4fa4('0x38')]=qs['filters'](_['pick'](_0x347b7f[_0x4fa4('0x2e')],_0x2d4eaa[_0x4fa4('0x30')]),_0x2e5756);if(_0x347b7f['query'][_0x4fa4('0x39')]){_0x8f1a20['where']=_[_0x4fa4('0x3a')](_0x8f1a20[_0x4fa4('0x38')],{'$or':_['map'](_0x2e5756,function(_0x73fc68){if(_0x73fc68[_0x4fa4('0x3b')]!==_0x4fa4('0x3c')){var _0x3ef501={};_0x3ef501[_0x73fc68[_0x4fa4('0x27')]]={'$like':'%'+_0x347b7f[_0x4fa4('0x2e')][_0x4fa4('0x39')]+'%'};return _0x3ef501;}})});}_0x8f1a20=_[_0x4fa4('0x3a')]({},_0x8f1a20,_0x347b7f[_0x4fa4('0x3d')]);var _0x476f73={'where':_0x8f1a20[_0x4fa4('0x38')]};return db[_0x4fa4('0x3e')][_0x4fa4('0x1e')](_0x476f73)['then'](function(_0x205ac1){_0x269eb3[_0x4fa4('0x1e')]=_0x205ac1;if(_0x347b7f[_0x4fa4('0x2e')][_0x4fa4('0x3f')]){_0x8f1a20[_0x4fa4('0x40')]=[{'all':!![]}];}return db[_0x4fa4('0x3e')]['findAll'](_0x8f1a20);})[_0x4fa4('0x25')](function(_0x400d72){_0x269eb3['rows']=_0x400d72;return _0x269eb3;})['then'](respondWithFilteredResult(_0x4f2577,_0x8f1a20))[_0x4fa4('0x41')](handleError(_0x4f2577,null));};exports[_0x4fa4('0x42')]=function(_0x1697a9,_0x19c27d){var _0x5d4d46={'raw':!![],'where':{'id':_0x1697a9[_0x4fa4('0x43')]['id']}},_0x542a46={};_0x542a46[_0x4fa4('0x2d')]=_[_0x4fa4('0x2f')](db['MailServerOut'][_0x4fa4('0x44')]);_0x542a46[_0x4fa4('0x2e')]=_[_0x4fa4('0x2f')](_0x1697a9['query']);_0x542a46['filters']=_[_0x4fa4('0x31')](_0x542a46['model'],_0x542a46[_0x4fa4('0x2e')]);_0x5d4d46[_0x4fa4('0x32')]=_[_0x4fa4('0x31')](_0x542a46[_0x4fa4('0x2d')],qs[_0x4fa4('0x45')](_0x1697a9[_0x4fa4('0x2e')][_0x4fa4('0x45')]));_0x5d4d46['attributes']=_0x5d4d46['attributes'][_0x4fa4('0x46')]?_0x5d4d46[_0x4fa4('0x32')]:_0x542a46['model'];if(_0x1697a9[_0x4fa4('0x2e')][_0x4fa4('0x3f')]){_0x5d4d46[_0x4fa4('0x40')]=[{'all':!![]}];}_0x5d4d46=_[_0x4fa4('0x3a')]({},_0x5d4d46,_0x1697a9[_0x4fa4('0x3d')]);return db['MailServerOut'][_0x4fa4('0x47')](_0x5d4d46)[_0x4fa4('0x25')](handleEntityNotFound(_0x19c27d,null))[_0x4fa4('0x25')](respondWithResult(_0x19c27d,null))[_0x4fa4('0x41')](handleError(_0x19c27d,null));};exports['create']=function(_0x507ecf,_0x143f22){return db[_0x4fa4('0x3e')][_0x4fa4('0x48')](_0x507ecf['body'],{})[_0x4fa4('0x25')](respondWithResult(_0x143f22,0xc9))[_0x4fa4('0x41')](handleError(_0x143f22,null));};exports['update']=function(_0x53998b,_0x55bcc4){if(_0x53998b['body']['id']){delete _0x53998b[_0x4fa4('0x49')]['id'];}return db[_0x4fa4('0x3e')]['find']({'where':{'id':_0x53998b[_0x4fa4('0x43')]['id']}})[_0x4fa4('0x25')](handleEntityNotFound(_0x55bcc4,null))['then'](saveUpdates(_0x53998b[_0x4fa4('0x49')],null))[_0x4fa4('0x25')](respondWithResult(_0x55bcc4,null))[_0x4fa4('0x41')](handleError(_0x55bcc4,null));};exports[_0x4fa4('0x24')]=function(_0xe1fed6,_0x5becb0){return db[_0x4fa4('0x3e')]['find']({'where':{'id':_0xe1fed6[_0x4fa4('0x43')]['id']}})[_0x4fa4('0x25')](handleEntityNotFound(_0x5becb0,null))[_0x4fa4('0x25')](removeEntity(_0x5becb0,null))[_0x4fa4('0x41')](handleError(_0x5becb0,null));}; \ No newline at end of file +var _0x362b=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','MailServerOut','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','include','find','create','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x50619a,_0x188bac){var _0x3e851f=function(_0x510b39){while(--_0x510b39){_0x50619a['push'](_0x50619a['shift']());}};_0x3e851f(++_0x188bac);}(_0x362b,0x16c));var _0xb362=function(_0x37f604,_0x5115d2){_0x37f604=_0x37f604-0x0;var _0x47cf21=_0x362b[_0x37f604];return _0x47cf21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb362('0x0'));var zipdir=require(_0xb362('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb362('0x2'));var moment=require(_0xb362('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb362('0x4'));var util=require(_0xb362('0x5'));var path=require(_0xb362('0x6'));var sox=require(_0xb362('0x7'));var csv=require(_0xb362('0x8'));var ejs=require(_0xb362('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb362('0xa'));var crypto=require(_0xb362('0xb'));var jsforce=require(_0xb362('0xc'));var deskjs=require(_0xb362('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb362('0xe'));var Papa=require(_0xb362('0xf'));var Redis=require(_0xb362('0x10'));var authService=require(_0xb362('0x11'));var qs=require(_0xb362('0x12'));var as=require(_0xb362('0x13'));var hardwareService=require(_0xb362('0x14'));var logger=require(_0xb362('0x15'))(_0xb362('0x16'));var utils=require(_0xb362('0x17'));var config=require(_0xb362('0x18'));var licenseUtil=require(_0xb362('0x19'));var db=require(_0xb362('0x1a'))['db'];function respondWithStatusCode(_0x1df6c0,_0x5375c5){_0x5375c5=_0x5375c5||0xcc;return function(_0x16d7e8){if(_0x16d7e8){return _0x1df6c0[_0xb362('0x1b')](_0x5375c5);}return _0x1df6c0[_0xb362('0x1c')](_0x5375c5)[_0xb362('0x1d')]();};}function respondWithResult(_0x10e023,_0x2573b6){_0x2573b6=_0x2573b6||0xc8;return function(_0x417465){if(_0x417465){return _0x10e023['status'](_0x2573b6)['json'](_0x417465);}};}function respondWithFilteredResult(_0x2c76fe,_0x4e75e7){return function(_0x5a5fe1){if(_0x5a5fe1){var _0x512c53=typeof _0x4e75e7[_0xb362('0x1e')]===_0xb362('0x1f')&&typeof _0x4e75e7[_0xb362('0x20')]===_0xb362('0x1f');var _0x3907b3=_0x5a5fe1[_0xb362('0x21')];var _0x5d3f02=_0x512c53?0x0:_0x4e75e7[_0xb362('0x1e')];var _0x359d63=_0x512c53?_0x5a5fe1[_0xb362('0x21')]:_0x4e75e7[_0xb362('0x1e')]+_0x4e75e7[_0xb362('0x20')];var _0x54958b;if(_0x359d63>=_0x3907b3){_0x359d63=_0x3907b3;_0x54958b=0xc8;}else{_0x54958b=0xce;}_0x2c76fe[_0xb362('0x1c')](_0x54958b);return _0x2c76fe['set'](_0xb362('0x22'),_0x5d3f02+'-'+_0x359d63+'/'+_0x3907b3)[_0xb362('0x23')](_0x5a5fe1);}return null;};}function patchUpdates(_0xcff6aa){return function(_0xb32644){try{jsonpatch[_0xb362('0x24')](_0xb32644,_0xcff6aa,!![]);}catch(_0x2ac0f7){return BPromise[_0xb362('0x25')](_0x2ac0f7);}return _0xb32644[_0xb362('0x26')]();};}function saveUpdates(_0x11f04c,_0x54338a){return function(_0x495ecd){if(_0x495ecd){return _0x495ecd['update'](_0x11f04c)[_0xb362('0x27')](function(_0x45b34e){return _0x45b34e;});}return null;};}function removeEntity(_0x34bbab,_0x23202e){return function(_0x51aa05){if(_0x51aa05){return _0x51aa05[_0xb362('0x28')]()[_0xb362('0x27')](function(){_0x34bbab[_0xb362('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270a60,_0x570756){return function(_0x388173){if(!_0x388173){_0x270a60[_0xb362('0x1b')](0x194);}return _0x388173;};}function handleError(_0x1b682e,_0x1cf566){_0x1cf566=_0x1cf566||0x1f4;return function(_0x25de27){logger[_0xb362('0x29')](_0x25de27[_0xb362('0x2a')]);if(_0x25de27[_0xb362('0x2b')]){delete _0x25de27[_0xb362('0x2b')];}_0x1b682e[_0xb362('0x1c')](_0x1cf566)['send'](_0x25de27);};}exports[_0xb362('0x2c')]=function(_0x3351d2,_0xea82d9){var _0x3b0b04={},_0x360f42={},_0x590d8f={'count':0x0,'rows':[]};var _0x2c0a51=_['map'](db[_0xb362('0x2d')]['rawAttributes'],function(_0x6fbf43){return{'name':_0x6fbf43[_0xb362('0x2e')],'type':_0x6fbf43[_0xb362('0x2f')][_0xb362('0x30')]};});_0x360f42[_0xb362('0x31')]=_[_0xb362('0x32')](_0x2c0a51,_0xb362('0x2b'));_0x360f42[_0xb362('0x33')]=_['keys'](_0x3351d2[_0xb362('0x33')]);_0x360f42[_0xb362('0x34')]=_[_0xb362('0x35')](_0x360f42['model'],_0x360f42['query']);_0x3b0b04['attributes']=_[_0xb362('0x35')](_0x360f42['model'],qs[_0xb362('0x36')](_0x3351d2[_0xb362('0x33')][_0xb362('0x36')]));_0x3b0b04[_0xb362('0x37')]=_0x3b0b04['attributes'][_0xb362('0x38')]?_0x3b0b04[_0xb362('0x37')]:_0x360f42[_0xb362('0x31')];if(!_0x3351d2[_0xb362('0x33')]['hasOwnProperty'](_0xb362('0x39'))){_0x3b0b04[_0xb362('0x20')]=qs[_0xb362('0x20')](_0x3351d2[_0xb362('0x33')][_0xb362('0x20')]);_0x3b0b04[_0xb362('0x1e')]=qs[_0xb362('0x1e')](_0x3351d2['query'][_0xb362('0x1e')]);}_0x3b0b04[_0xb362('0x3a')]=qs['sort'](_0x3351d2[_0xb362('0x33')][_0xb362('0x3b')]);_0x3b0b04[_0xb362('0x3c')]=qs['filters'](_[_0xb362('0x3d')](_0x3351d2[_0xb362('0x33')],_0x360f42[_0xb362('0x34')]),_0x2c0a51);if(_0x3351d2['query'][_0xb362('0x3e')]){_0x3b0b04[_0xb362('0x3c')]=_[_0xb362('0x3f')](_0x3b0b04[_0xb362('0x3c')],{'$or':_[_0xb362('0x32')](_0x2c0a51,function(_0x39a40c){if(_0x39a40c[_0xb362('0x2f')]!==_0xb362('0x40')){var _0x5113e0={};_0x5113e0[_0x39a40c['name']]={'$like':'%'+_0x3351d2['query'][_0xb362('0x3e')]+'%'};return _0x5113e0;}})});}_0x3b0b04=_[_0xb362('0x3f')]({},_0x3b0b04,_0x3351d2[_0xb362('0x41')]);var _0x274b8e={'where':_0x3b0b04[_0xb362('0x3c')]};return db[_0xb362('0x2d')][_0xb362('0x21')](_0x274b8e)[_0xb362('0x27')](function(_0x1834f5){_0x590d8f[_0xb362('0x21')]=_0x1834f5;if(_0x3351d2[_0xb362('0x33')][_0xb362('0x42')]){_0x3b0b04['include']=[{'all':!![]}];}return db[_0xb362('0x2d')][_0xb362('0x43')](_0x3b0b04);})['then'](function(_0xbb2fa){_0x590d8f[_0xb362('0x44')]=_0xbb2fa;return _0x590d8f;})['then'](respondWithFilteredResult(_0xea82d9,_0x3b0b04))[_0xb362('0x45')](handleError(_0xea82d9,null));};exports[_0xb362('0x46')]=function(_0x17b251,_0x2fa49b){var _0x3d1847={'raw':!![],'where':{'id':_0x17b251[_0xb362('0x47')]['id']}},_0x86735d={};_0x86735d[_0xb362('0x31')]=_['keys'](db[_0xb362('0x2d')][_0xb362('0x48')]);_0x86735d[_0xb362('0x33')]=_[_0xb362('0x49')](_0x17b251['query']);_0x86735d[_0xb362('0x34')]=_[_0xb362('0x35')](_0x86735d[_0xb362('0x31')],_0x86735d['query']);_0x3d1847[_0xb362('0x37')]=_[_0xb362('0x35')](_0x86735d[_0xb362('0x31')],qs[_0xb362('0x36')](_0x17b251[_0xb362('0x33')]['fields']));_0x3d1847[_0xb362('0x37')]=_0x3d1847['attributes'][_0xb362('0x38')]?_0x3d1847[_0xb362('0x37')]:_0x86735d['model'];if(_0x17b251[_0xb362('0x33')][_0xb362('0x42')]){_0x3d1847[_0xb362('0x4a')]=[{'all':!![]}];}_0x3d1847=_['merge']({},_0x3d1847,_0x17b251[_0xb362('0x41')]);return db[_0xb362('0x2d')][_0xb362('0x4b')](_0x3d1847)['then'](handleEntityNotFound(_0x2fa49b,null))[_0xb362('0x27')](respondWithResult(_0x2fa49b,null))[_0xb362('0x45')](handleError(_0x2fa49b,null));};exports['create']=function(_0x34dac0,_0x11c1d0){return db['MailServerOut'][_0xb362('0x4c')](_0x34dac0[_0xb362('0x4d')],{})[_0xb362('0x27')](respondWithResult(_0x11c1d0,0xc9))[_0xb362('0x45')](handleError(_0x11c1d0,null));};exports['update']=function(_0x34b59d,_0x51d5ce){if(_0x34b59d[_0xb362('0x4d')]['id']){delete _0x34b59d[_0xb362('0x4d')]['id'];}return db['MailServerOut'][_0xb362('0x4b')]({'where':{'id':_0x34b59d[_0xb362('0x47')]['id']}})[_0xb362('0x27')](handleEntityNotFound(_0x51d5ce,null))['then'](saveUpdates(_0x34b59d[_0xb362('0x4d')],null))[_0xb362('0x27')](respondWithResult(_0x51d5ce,null))[_0xb362('0x45')](handleError(_0x51d5ce,null));};exports[_0xb362('0x28')]=function(_0x22fe6b,_0x2d70a7){return db['MailServerOut'][_0xb362('0x4b')]({'where':{'id':_0x22fe6b[_0xb362('0x47')]['id']}})[_0xb362('0x27')](handleEntityNotFound(_0x2d70a7,null))['then'](removeEntity(_0x2d70a7,null))['catch'](handleError(_0x2d70a7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 8c4039a..652bacf 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 _0xa4c2=['rimraf','../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x598cd0,_0x157d6f){var _0x2370e7=function(_0x3216c2){while(--_0x3216c2){_0x598cd0['push'](_0x598cd0['shift']());}};_0x2370e7(++_0x157d6f);}(_0xa4c2,0x117));var _0x2a4c=function(_0x45f6ca,_0x431195){_0x45f6ca=_0x45f6ca-0x0;var _0x56dc03=_0xa4c2[_0x45f6ca];return _0x56dc03;};'use strict';var _=require(_0x2a4c('0x0'));var util=require(_0x2a4c('0x1'));var logger=require(_0x2a4c('0x2'))(_0x2a4c('0x3'));var moment=require(_0x2a4c('0x4'));var BPromise=require(_0x2a4c('0x5'));var rp=require(_0x2a4c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a4c('0x7'));var config=require(_0x2a4c('0x8'));var attributes=require(_0x2a4c('0x9'));module[_0x2a4c('0xa')]=function(_0x567790,_0x294251){return _0x567790[_0x2a4c('0xb')]('MailServerOut',attributes,{'tableName':_0x2a4c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf391=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','MailServerOut'];(function(_0x1d6037,_0x47f30c){var _0x342fc1=function(_0xc92586){while(--_0xc92586){_0x1d6037['push'](_0x1d6037['shift']());}};_0x342fc1(++_0x47f30c);}(_0xf391,0x1b8));var _0x1f39=function(_0x161729,_0x5743ed){_0x161729=_0x161729-0x0;var _0x3e93e6=_0xf391[_0x161729];return _0x3e93e6;};'use strict';var _=require(_0x1f39('0x0'));var util=require(_0x1f39('0x1'));var logger=require(_0x1f39('0x2'))(_0x1f39('0x3'));var moment=require(_0x1f39('0x4'));var BPromise=require(_0x1f39('0x5'));var rp=require(_0x1f39('0x6'));var fs=require('fs');var path=require(_0x1f39('0x7'));var rimraf=require('rimraf');var config=require(_0x1f39('0x8'));var attributes=require('./mailServerOut.attributes');module[_0x1f39('0x9')]=function(_0x818858,_0x2c5a87){return _0x818858['define'](_0x1f39('0xa'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 094d53f..c894c42 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 _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(_0x307713,_0x1eb964){var _0x3588cf=function(_0x37fa2a){while(--_0x37fa2a){_0x307713['push'](_0x307713['shift']());}};_0x3588cf(++_0x1eb964);}(_0xdb28,0x106));var _0x8db2=function(_0x174a64,_0x4674f4){_0x174a64=_0x174a64-0x0;var _0x862f7e=_0xdb28[_0x174a64];return _0x862f7e;};'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 +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xe7dfa7,_0x3d17ee){var _0x1a9fbf=function(_0x2ef98a){while(--_0x2ef98a){_0xe7dfa7['push'](_0xe7dfa7['shift']());}};_0x1a9fbf(++_0x3d17ee);}(_0x2ef3,0xba));var _0x32ef=function(_0x4cffdd,_0x4d20b6){_0x4cffdd=_0x4cffdd-0x0;var _0x694c3d=_0x2ef3[_0x4cffdd];return _0x694c3d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 0c4caa6..3b8f38d 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 _0x629d=['./mailSubstatus.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x37ec49,_0x38f646){var _0x5ac426=function(_0x3aafc9){while(--_0x3aafc9){_0x37ec49['push'](_0x37ec49['shift']());}};_0x5ac426(++_0x38f646);}(_0x629d,0x1bf));var _0xd629=function(_0xf0330b,_0x814253){_0xf0330b=_0xf0330b-0x0;var _0x538518=_0x629d[_0xf0330b];return _0x538518;};'use strict';var multer=require(_0xd629('0x0'));var util=require(_0xd629('0x1'));var path=require(_0xd629('0x2'));var timeout=require(_0xd629('0x3'));var express=require(_0xd629('0x4'));var router=express[_0xd629('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd629('0x6'));var interaction=require(_0xd629('0x7'));var config=require(_0xd629('0x8'));var controller=require(_0xd629('0x9'));router[_0xd629('0xa')]('/',auth[_0xd629('0xb')](),controller[_0xd629('0xc')]);router[_0xd629('0xa')]('/describe',auth[_0xd629('0xb')](),controller['describe']);router[_0xd629('0xa')](_0xd629('0xd'),auth[_0xd629('0xb')](),controller[_0xd629('0xe')]);router['post']('/',auth[_0xd629('0xb')](),controller['create']);router[_0xd629('0xf')](_0xd629('0xd'),auth[_0xd629('0xb')](),controller[_0xd629('0x10')]);router[_0xd629('0x11')](_0xd629('0xd'),auth[_0xd629('0xb')](),controller['destroy']);module[_0xd629('0x12')]=router; \ No newline at end of file +var _0xe66a=['connect-timeout','express','Router','../../components/auth/service','./mailSubstatus.controller','isAuthenticated','get','/describe','describe','/:id','show','create','delete','destroy','exports'];(function(_0x5451ca,_0x3d7838){var _0x3a7904=function(_0x58441a){while(--_0x58441a){_0x5451ca['push'](_0x5451ca['shift']());}};_0x3a7904(++_0x3d7838);}(_0xe66a,0x1d1));var _0xae66=function(_0x3f8416,_0x3906de){_0x3f8416=_0x3f8416-0x0;var _0x2ae509=_0xe66a[_0x3f8416];return _0x2ae509;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xae66('0x0'));var express=require(_0xae66('0x1'));var router=express[_0xae66('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xae66('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xae66('0x4'));router['get']('/',auth[_0xae66('0x5')](),controller['index']);router[_0xae66('0x6')](_0xae66('0x7'),auth[_0xae66('0x5')](),controller[_0xae66('0x8')]);router['get'](_0xae66('0x9'),auth[_0xae66('0x5')](),controller[_0xae66('0xa')]);router['post']('/',auth[_0xae66('0x5')](),controller[_0xae66('0xb')]);router['put'](_0xae66('0x9'),auth[_0xae66('0x5')](),controller['update']);router[_0xae66('0xc')](_0xae66('0x9'),auth['isAuthenticated'](),controller[_0xae66('0xd')]);module[_0xae66('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index c519c02..1443e3a 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 _0xbd10=['STRING','sequelize','exports'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xbd10,0x85));var _0x0bd1=function(_0x433adf,_0x3b863e){_0x433adf=_0x433adf-0x0;var _0x4a35e4=_0xbd10[_0x433adf];return _0x4a35e4;};'use strict';var Sequelize=require(_0x0bd1('0x0'));module[_0x0bd1('0x1')]={'name':{'type':Sequelize[_0x0bd1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0bd1('0x2')]}}; \ No newline at end of file +var _0x446c=['STRING','name','sequelize','exports'];(function(_0x26f2f2,_0x57a231){var _0x320289=function(_0x4c93e5){while(--_0x4c93e5){_0x26f2f2['push'](_0x26f2f2['shift']());}};_0x320289(++_0x57a231);}(_0x446c,0x156));var _0xc446=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x446c[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0xc446('0x0'));module[_0xc446('0x1')]={'name':{'type':Sequelize[_0xc446('0x2')],'unique':_0xc446('0x3'),'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 25b8dd9..53cc058 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 _0xd69e=['filter','VIRTUAL','merge','then','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','Content-Range','save','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1a2581,_0x44dab6){var _0x21ef3e=function(_0x26839e){while(--_0x26839e){_0x1a2581['push'](_0x1a2581['shift']());}};_0x21ef3e(++_0x44dab6);}(_0xd69e,0x13d));var _0xed69=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xd69e[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require(_0xed69('0x0'));var rimraf=require(_0xed69('0x1'));var zipdir=require(_0xed69('0x2'));var jsonpatch=require(_0xed69('0x3'));var rp=require('request-promise');var moment=require(_0xed69('0x4'));var BPromise=require(_0xed69('0x5'));var Mustache=require(_0xed69('0x6'));var util=require('util');var path=require(_0xed69('0x7'));var sox=require(_0xed69('0x8'));var csv=require(_0xed69('0x9'));var ejs=require(_0xed69('0xa'));var fs=require('fs');var fs_extra=require(_0xed69('0xb'));var _=require(_0xed69('0xc'));var squel=require(_0xed69('0xd'));var crypto=require(_0xed69('0xe'));var jsforce=require(_0xed69('0xf'));var deskjs=require(_0xed69('0x10'));var toCsv=require(_0xed69('0x9'));var querystring=require(_0xed69('0x11'));var Papa=require('papaparse');var Redis=require(_0xed69('0x12'));var authService=require(_0xed69('0x13'));var qs=require(_0xed69('0x14'));var as=require(_0xed69('0x15'));var hardwareService=require(_0xed69('0x16'));var logger=require(_0xed69('0x17'))(_0xed69('0x18'));var utils=require(_0xed69('0x19'));var config=require(_0xed69('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34f696,_0x364a0e){_0x364a0e=_0x364a0e||0xcc;return function(_0x12d53f){if(_0x12d53f){return _0x34f696[_0xed69('0x1b')](_0x364a0e);}return _0x34f696[_0xed69('0x1c')](_0x364a0e)['end']();};}function respondWithResult(_0x1c7b09,_0x20b3d8){_0x20b3d8=_0x20b3d8||0xc8;return function(_0x46dfd0){if(_0x46dfd0){return _0x1c7b09[_0xed69('0x1c')](_0x20b3d8)['json'](_0x46dfd0);}};}function respondWithFilteredResult(_0x4e52a2,_0x3b92a4){return function(_0x25fafd){if(_0x25fafd){var _0x581784=typeof _0x3b92a4[_0xed69('0x1d')]===_0xed69('0x1e')&&typeof _0x3b92a4['limit']===_0xed69('0x1e');var _0x2eeb8e=_0x25fafd[_0xed69('0x1f')];var _0x158d73=_0x581784?0x0:_0x3b92a4[_0xed69('0x1d')];var _0x1f5f20=_0x581784?_0x25fafd[_0xed69('0x1f')]:_0x3b92a4[_0xed69('0x1d')]+_0x3b92a4[_0xed69('0x20')];var _0xf1d430;if(_0x1f5f20>=_0x2eeb8e){_0x1f5f20=_0x2eeb8e;_0xf1d430=0xc8;}else{_0xf1d430=0xce;}_0x4e52a2[_0xed69('0x1c')](_0xf1d430);return _0x4e52a2['set'](_0xed69('0x21'),_0x158d73+'-'+_0x1f5f20+'/'+_0x2eeb8e)['json'](_0x25fafd);}return null;};}function patchUpdates(_0x5f20cd){return function(_0x3d550a){try{jsonpatch['apply'](_0x3d550a,_0x5f20cd,!![]);}catch(_0x14fdbe){return BPromise['reject'](_0x14fdbe);}return _0x3d550a[_0xed69('0x22')]();};}function saveUpdates(_0x5ba942,_0x432e88){return function(_0x540b9d){if(_0x540b9d){return _0x540b9d['update'](_0x5ba942)['then'](function(_0x405bdf){return _0x405bdf;});}return null;};}function removeEntity(_0x5ad0b0,_0x179535){return function(_0x5f0f00){if(_0x5f0f00){return _0x5f0f00['destroy']()['then'](function(){_0x5ad0b0['status'](0xcc)[_0xed69('0x23')]();});}};}function handleEntityNotFound(_0x1b68a7,_0x175ebe){return function(_0x402b71){if(!_0x402b71){_0x1b68a7['sendStatus'](0x194);}return _0x402b71;};}function handleError(_0xcb69f6,_0x50bad2){_0x50bad2=_0x50bad2||0x1f4;return function(_0x360e64){logger[_0xed69('0x24')](_0x360e64[_0xed69('0x25')]);if(_0x360e64['name']){delete _0x360e64[_0xed69('0x26')];}_0xcb69f6[_0xed69('0x1c')](_0x50bad2)[_0xed69('0x27')](_0x360e64);};}exports[_0xed69('0x28')]=function(_0x135705,_0x2c372b){var _0x54a6cf={},_0x1242b9={},_0xdc03be={'count':0x0,'rows':[]};var _0x2e058d=_[_0xed69('0x29')](db[_0xed69('0x2a')][_0xed69('0x2b')],function(_0x2d78d9){return{'name':_0x2d78d9['fieldName'],'type':_0x2d78d9['type'][_0xed69('0x2c')]};});_0x1242b9[_0xed69('0x2d')]=_[_0xed69('0x29')](_0x2e058d,_0xed69('0x26'));_0x1242b9[_0xed69('0x2e')]=_[_0xed69('0x2f')](_0x135705['query']);_0x1242b9[_0xed69('0x30')]=_[_0xed69('0x31')](_0x1242b9[_0xed69('0x2d')],_0x1242b9[_0xed69('0x2e')]);_0x54a6cf[_0xed69('0x32')]=_[_0xed69('0x31')](_0x1242b9[_0xed69('0x2d')],qs[_0xed69('0x33')](_0x135705[_0xed69('0x2e')]['fields']));_0x54a6cf['attributes']=_0x54a6cf[_0xed69('0x32')]['length']?_0x54a6cf[_0xed69('0x32')]:_0x1242b9[_0xed69('0x2d')];if(!_0x135705['query'][_0xed69('0x34')](_0xed69('0x35'))){_0x54a6cf['limit']=qs[_0xed69('0x20')](_0x135705[_0xed69('0x2e')]['limit']);_0x54a6cf[_0xed69('0x1d')]=qs[_0xed69('0x1d')](_0x135705['query'][_0xed69('0x1d')]);}_0x54a6cf[_0xed69('0x36')]=qs[_0xed69('0x37')](_0x135705[_0xed69('0x2e')]['sort']);_0x54a6cf[_0xed69('0x38')]=qs[_0xed69('0x30')](_[_0xed69('0x39')](_0x135705['query'],_0x1242b9[_0xed69('0x30')]),_0x2e058d);if(_0x135705[_0xed69('0x2e')][_0xed69('0x3a')]){_0x54a6cf[_0xed69('0x38')]=_['merge'](_0x54a6cf[_0xed69('0x38')],{'$or':_['map'](_0x2e058d,function(_0x58bfa7){if(_0x58bfa7['type']!==_0xed69('0x3b')){var _0x49f94d={};_0x49f94d[_0x58bfa7[_0xed69('0x26')]]={'$like':'%'+_0x135705[_0xed69('0x2e')]['filter']+'%'};return _0x49f94d;}})});}_0x54a6cf=_[_0xed69('0x3c')]({},_0x54a6cf,_0x135705['options']);var _0x559aa8={'where':_0x54a6cf[_0xed69('0x38')]};return db[_0xed69('0x2a')][_0xed69('0x1f')](_0x559aa8)[_0xed69('0x3d')](function(_0x2c7bbb){_0xdc03be[_0xed69('0x1f')]=_0x2c7bbb;if(_0x135705[_0xed69('0x2e')][_0xed69('0x3e')]){_0x54a6cf[_0xed69('0x3f')]=[{'all':!![]}];}return db['MailSubstatus'][_0xed69('0x40')](_0x54a6cf);})[_0xed69('0x3d')](function(_0xb4a1f4){_0xdc03be[_0xed69('0x41')]=_0xb4a1f4;return _0xdc03be;})['then'](respondWithFilteredResult(_0x2c372b,_0x54a6cf))['catch'](handleError(_0x2c372b,null));};exports[_0xed69('0x42')]=function(_0x2bb831,_0x406540){var _0x2154ae={'raw':!![],'where':{'id':_0x2bb831[_0xed69('0x43')]['id']}},_0x3674fc={};_0x3674fc[_0xed69('0x2d')]=_[_0xed69('0x2f')](db[_0xed69('0x2a')]['rawAttributes']);_0x3674fc['query']=_[_0xed69('0x2f')](_0x2bb831[_0xed69('0x2e')]);_0x3674fc[_0xed69('0x30')]=_['intersection'](_0x3674fc['model'],_0x3674fc[_0xed69('0x2e')]);_0x2154ae[_0xed69('0x32')]=_[_0xed69('0x31')](_0x3674fc['model'],qs[_0xed69('0x33')](_0x2bb831[_0xed69('0x2e')][_0xed69('0x33')]));_0x2154ae['attributes']=_0x2154ae[_0xed69('0x32')]['length']?_0x2154ae[_0xed69('0x32')]:_0x3674fc[_0xed69('0x2d')];if(_0x2bb831[_0xed69('0x2e')][_0xed69('0x3e')]){_0x2154ae[_0xed69('0x3f')]=[{'all':!![]}];}_0x2154ae=_['merge']({},_0x2154ae,_0x2bb831[_0xed69('0x44')]);return db[_0xed69('0x2a')]['find'](_0x2154ae)[_0xed69('0x3d')](handleEntityNotFound(_0x406540,null))['then'](respondWithResult(_0x406540,null))[_0xed69('0x45')](handleError(_0x406540,null));};exports[_0xed69('0x46')]=function(_0x1e3a24,_0x127f67){return db[_0xed69('0x2a')][_0xed69('0x46')](_0x1e3a24[_0xed69('0x47')],{})[_0xed69('0x3d')](respondWithResult(_0x127f67,0xc9))[_0xed69('0x45')](handleError(_0x127f67,null));};exports['update']=function(_0x214d96,_0x3e9166){if(_0x214d96[_0xed69('0x47')]['id']){delete _0x214d96[_0xed69('0x47')]['id'];}return db['MailSubstatus'][_0xed69('0x48')]({'where':{'id':_0x214d96[_0xed69('0x43')]['id']}})[_0xed69('0x3d')](handleEntityNotFound(_0x3e9166,null))[_0xed69('0x3d')](saveUpdates(_0x214d96['body'],null))[_0xed69('0x3d')](respondWithResult(_0x3e9166,null))[_0xed69('0x45')](handleError(_0x3e9166,null));};exports[_0xed69('0x49')]=function(_0x5cb032,_0x1dbebd){return db['MailSubstatus'][_0xed69('0x48')]({'where':{'id':_0x5cb032[_0xed69('0x43')]['id']}})[_0xed69('0x3d')](handleEntityNotFound(_0x1dbebd,null))['then'](removeEntity(_0x1dbebd,null))['catch'](handleError(_0x1dbebd,null));};exports[_0xed69('0x4a')]=function(_0x32ae71,_0x3772fd){return db[_0xed69('0x2a')][_0xed69('0x4a')]()[_0xed69('0x3d')](respondWithResult(_0x3772fd,null))[_0xed69('0x45')](handleError(_0x3772fd,null));}; \ No newline at end of file +var _0xcb61=['count','set','Content-Range','apply','update','then','destroy','end','error','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','length','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit'];(function(_0x564b26,_0x49b5c3){var _0x590df8=function(_0x52daf6){while(--_0x52daf6){_0x564b26['push'](_0x564b26['shift']());}};_0x590df8(++_0x49b5c3);}(_0xcb61,0x14a));var _0x1cb6=function(_0x194aaa,_0x4b4284){_0x194aaa=_0x194aaa-0x0;var _0x312608=_0xcb61[_0x194aaa];return _0x312608;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1cb6('0x0'));var zipdir=require(_0x1cb6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1cb6('0x2'));var moment=require(_0x1cb6('0x3'));var BPromise=require(_0x1cb6('0x4'));var Mustache=require('mustache');var util=require(_0x1cb6('0x5'));var path=require(_0x1cb6('0x6'));var sox=require(_0x1cb6('0x7'));var csv=require(_0x1cb6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1cb6('0x9'));var squel=require('squel');var crypto=require(_0x1cb6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1cb6('0x8'));var querystring=require(_0x1cb6('0xb'));var Papa=require(_0x1cb6('0xc'));var Redis=require(_0x1cb6('0xd'));var authService=require(_0x1cb6('0xe'));var qs=require(_0x1cb6('0xf'));var as=require(_0x1cb6('0x10'));var hardwareService=require(_0x1cb6('0x11'));var logger=require(_0x1cb6('0x12'))(_0x1cb6('0x13'));var utils=require(_0x1cb6('0x14'));var config=require(_0x1cb6('0x15'));var licenseUtil=require(_0x1cb6('0x16'));var db=require(_0x1cb6('0x17'))['db'];function respondWithStatusCode(_0x3c9729,_0x17a428){_0x17a428=_0x17a428||0xcc;return function(_0x162558){if(_0x162558){return _0x3c9729[_0x1cb6('0x18')](_0x17a428);}return _0x3c9729['status'](_0x17a428)['end']();};}function respondWithResult(_0xf7682d,_0x3f63cb){_0x3f63cb=_0x3f63cb||0xc8;return function(_0x17d2ee){if(_0x17d2ee){return _0xf7682d[_0x1cb6('0x19')](_0x3f63cb)[_0x1cb6('0x1a')](_0x17d2ee);}};}function respondWithFilteredResult(_0x3f52cc,_0x18a8d0){return function(_0x422e05){if(_0x422e05){var _0x18cb19=typeof _0x18a8d0[_0x1cb6('0x1b')]===_0x1cb6('0x1c')&&typeof _0x18a8d0[_0x1cb6('0x1d')]===_0x1cb6('0x1c');var _0x4f87ad=_0x422e05[_0x1cb6('0x1e')];var _0x5b26ab=_0x18cb19?0x0:_0x18a8d0[_0x1cb6('0x1b')];var _0x1cb5e9=_0x18cb19?_0x422e05[_0x1cb6('0x1e')]:_0x18a8d0[_0x1cb6('0x1b')]+_0x18a8d0['limit'];var _0x523038;if(_0x1cb5e9>=_0x4f87ad){_0x1cb5e9=_0x4f87ad;_0x523038=0xc8;}else{_0x523038=0xce;}_0x3f52cc[_0x1cb6('0x19')](_0x523038);return _0x3f52cc[_0x1cb6('0x1f')](_0x1cb6('0x20'),_0x5b26ab+'-'+_0x1cb5e9+'/'+_0x4f87ad)[_0x1cb6('0x1a')](_0x422e05);}return null;};}function patchUpdates(_0x28441e){return function(_0x3779b1){try{jsonpatch[_0x1cb6('0x21')](_0x3779b1,_0x28441e,!![]);}catch(_0x569cd8){return BPromise['reject'](_0x569cd8);}return _0x3779b1['save']();};}function saveUpdates(_0x15fdda,_0x20c7d3){return function(_0x15a3b3){if(_0x15a3b3){return _0x15a3b3[_0x1cb6('0x22')](_0x15fdda)[_0x1cb6('0x23')](function(_0x529fe5){return _0x529fe5;});}return null;};}function removeEntity(_0xef33b3,_0x24543f){return function(_0x1ef262){if(_0x1ef262){return _0x1ef262[_0x1cb6('0x24')]()[_0x1cb6('0x23')](function(){_0xef33b3[_0x1cb6('0x19')](0xcc)[_0x1cb6('0x25')]();});}};}function handleEntityNotFound(_0x12f652,_0x526cf7){return function(_0x3dc570){if(!_0x3dc570){_0x12f652[_0x1cb6('0x18')](0x194);}return _0x3dc570;};}function handleError(_0x159e53,_0xbfbcb0){_0xbfbcb0=_0xbfbcb0||0x1f4;return function(_0x1f1afc){logger[_0x1cb6('0x26')](_0x1f1afc['stack']);if(_0x1f1afc[_0x1cb6('0x27')]){delete _0x1f1afc[_0x1cb6('0x27')];}_0x159e53[_0x1cb6('0x19')](_0xbfbcb0)[_0x1cb6('0x28')](_0x1f1afc);};}exports['index']=function(_0x52504e,_0x52247a){var _0x2cccc9={},_0x5a4b60={},_0x26ba18={'count':0x0,'rows':[]};var _0x491bbf=_[_0x1cb6('0x29')](db[_0x1cb6('0x2a')][_0x1cb6('0x2b')],function(_0x2d7f13){return{'name':_0x2d7f13[_0x1cb6('0x2c')],'type':_0x2d7f13[_0x1cb6('0x2d')][_0x1cb6('0x2e')]};});_0x5a4b60[_0x1cb6('0x2f')]=_['map'](_0x491bbf,_0x1cb6('0x27'));_0x5a4b60['query']=_[_0x1cb6('0x30')](_0x52504e['query']);_0x5a4b60[_0x1cb6('0x31')]=_[_0x1cb6('0x32')](_0x5a4b60['model'],_0x5a4b60[_0x1cb6('0x33')]);_0x2cccc9[_0x1cb6('0x34')]=_[_0x1cb6('0x32')](_0x5a4b60[_0x1cb6('0x2f')],qs[_0x1cb6('0x35')](_0x52504e[_0x1cb6('0x33')][_0x1cb6('0x35')]));_0x2cccc9[_0x1cb6('0x34')]=_0x2cccc9[_0x1cb6('0x34')]['length']?_0x2cccc9['attributes']:_0x5a4b60[_0x1cb6('0x2f')];if(!_0x52504e[_0x1cb6('0x33')][_0x1cb6('0x36')]('nolimit')){_0x2cccc9[_0x1cb6('0x1d')]=qs[_0x1cb6('0x1d')](_0x52504e[_0x1cb6('0x33')][_0x1cb6('0x1d')]);_0x2cccc9[_0x1cb6('0x1b')]=qs[_0x1cb6('0x1b')](_0x52504e[_0x1cb6('0x33')][_0x1cb6('0x1b')]);}_0x2cccc9[_0x1cb6('0x37')]=qs['sort'](_0x52504e['query'][_0x1cb6('0x38')]);_0x2cccc9['where']=qs[_0x1cb6('0x31')](_['pick'](_0x52504e[_0x1cb6('0x33')],_0x5a4b60[_0x1cb6('0x31')]),_0x491bbf);if(_0x52504e[_0x1cb6('0x33')]['filter']){_0x2cccc9[_0x1cb6('0x39')]=_[_0x1cb6('0x3a')](_0x2cccc9[_0x1cb6('0x39')],{'$or':_[_0x1cb6('0x29')](_0x491bbf,function(_0x31b0be){if(_0x31b0be['type']!==_0x1cb6('0x3b')){var _0x55c739={};_0x55c739[_0x31b0be[_0x1cb6('0x27')]]={'$like':'%'+_0x52504e['query'][_0x1cb6('0x3c')]+'%'};return _0x55c739;}})});}_0x2cccc9=_['merge']({},_0x2cccc9,_0x52504e[_0x1cb6('0x3d')]);var _0x596b5f={'where':_0x2cccc9[_0x1cb6('0x39')]};return db[_0x1cb6('0x2a')][_0x1cb6('0x1e')](_0x596b5f)[_0x1cb6('0x23')](function(_0x4e49ec){_0x26ba18[_0x1cb6('0x1e')]=_0x4e49ec;if(_0x52504e[_0x1cb6('0x33')][_0x1cb6('0x3e')]){_0x2cccc9[_0x1cb6('0x3f')]=[{'all':!![]}];}return db[_0x1cb6('0x2a')]['findAll'](_0x2cccc9);})[_0x1cb6('0x23')](function(_0xe1a0bc){_0x26ba18['rows']=_0xe1a0bc;return _0x26ba18;})['then'](respondWithFilteredResult(_0x52247a,_0x2cccc9))[_0x1cb6('0x40')](handleError(_0x52247a,null));};exports[_0x1cb6('0x41')]=function(_0x150f5e,_0x8b76f9){var _0x529384={'raw':!![],'where':{'id':_0x150f5e[_0x1cb6('0x42')]['id']}},_0xe80f20={};_0xe80f20[_0x1cb6('0x2f')]=_[_0x1cb6('0x30')](db[_0x1cb6('0x2a')][_0x1cb6('0x2b')]);_0xe80f20[_0x1cb6('0x33')]=_[_0x1cb6('0x30')](_0x150f5e['query']);_0xe80f20[_0x1cb6('0x31')]=_[_0x1cb6('0x32')](_0xe80f20[_0x1cb6('0x2f')],_0xe80f20['query']);_0x529384[_0x1cb6('0x34')]=_['intersection'](_0xe80f20[_0x1cb6('0x2f')],qs['fields'](_0x150f5e['query']['fields']));_0x529384['attributes']=_0x529384[_0x1cb6('0x34')][_0x1cb6('0x43')]?_0x529384[_0x1cb6('0x34')]:_0xe80f20[_0x1cb6('0x2f')];if(_0x150f5e[_0x1cb6('0x33')]['includeAll']){_0x529384['include']=[{'all':!![]}];}_0x529384=_[_0x1cb6('0x3a')]({},_0x529384,_0x150f5e['options']);return db[_0x1cb6('0x2a')][_0x1cb6('0x44')](_0x529384)['then'](handleEntityNotFound(_0x8b76f9,null))[_0x1cb6('0x23')](respondWithResult(_0x8b76f9,null))[_0x1cb6('0x40')](handleError(_0x8b76f9,null));};exports[_0x1cb6('0x45')]=function(_0x25adda,_0x62b1ba){return db[_0x1cb6('0x2a')]['create'](_0x25adda['body'],{})[_0x1cb6('0x23')](respondWithResult(_0x62b1ba,0xc9))[_0x1cb6('0x40')](handleError(_0x62b1ba,null));};exports['update']=function(_0x38ea4a,_0x4eb697){if(_0x38ea4a[_0x1cb6('0x46')]['id']){delete _0x38ea4a[_0x1cb6('0x46')]['id'];}return db[_0x1cb6('0x2a')][_0x1cb6('0x44')]({'where':{'id':_0x38ea4a['params']['id']}})[_0x1cb6('0x23')](handleEntityNotFound(_0x4eb697,null))['then'](saveUpdates(_0x38ea4a[_0x1cb6('0x46')],null))[_0x1cb6('0x23')](respondWithResult(_0x4eb697,null))[_0x1cb6('0x40')](handleError(_0x4eb697,null));};exports['destroy']=function(_0x3bfb22,_0x4e9a15){return db[_0x1cb6('0x2a')][_0x1cb6('0x44')]({'where':{'id':_0x3bfb22[_0x1cb6('0x42')]['id']}})[_0x1cb6('0x23')](handleEntityNotFound(_0x4e9a15,null))[_0x1cb6('0x23')](removeEntity(_0x4e9a15,null))[_0x1cb6('0x40')](handleError(_0x4e9a15,null));};exports[_0x1cb6('0x47')]=function(_0x4b9e04,_0x1b262e){return db['MailSubstatus'][_0x1cb6('0x47')]()[_0x1cb6('0x23')](respondWithResult(_0x1b262e,null))[_0x1cb6('0x40')](handleError(_0x1b262e,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 1ad72fd..9dce4ed 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 _0x38cd=['setMaxListeners','update','emit','hook','events','../../mysqldb'];(function(_0x5cebc3,_0x3f0d41){var _0x595fa5=function(_0x455faa){while(--_0x455faa){_0x5cebc3['push'](_0x5cebc3['shift']());}};_0x595fa5(++_0x3f0d41);}(_0x38cd,0x14e));var _0xd38c=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x38cd[_0x2a6809];return _0x11c371;};'use strict';var EventEmitter=require(_0xd38c('0x0'));var MailSubstatus=require(_0xd38c('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xd38c('0x2')](0x0);var events={'afterUpdate':_0xd38c('0x3')};function emitEvent(_0x7f329a){return function(_0x27961d,_0x5cd796,_0x4bfca1){MailSubstatusEvents[_0xd38c('0x4')](_0x7f329a+':'+_0x27961d['id'],_0x27961d);MailSubstatusEvents[_0xd38c('0x4')](_0x7f329a,_0x27961d);_0x4bfca1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0xd38c('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xd188=['../../mysqldb','MailSubstatus','setMaxListeners','update','hasOwnProperty','hook','events'];(function(_0x444b69,_0x419e47){var _0x5edb98=function(_0x108701){while(--_0x108701){_0x444b69['push'](_0x444b69['shift']());}};_0x5edb98(++_0x419e47);}(_0xd188,0x18e));var _0x8d18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd188[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8d18('0x0'));var MailSubstatus=require(_0x8d18('0x1'))['db'][_0x8d18('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x8d18('0x3')](0x0);var events={'afterUpdate':_0x8d18('0x4')};function emitEvent(_0x212e9a){return function(_0x4cf2cc,_0x7a817b,_0x3ba634){MailSubstatusEvents['emit'](_0x212e9a+':'+_0x4cf2cc['id'],_0x4cf2cc);MailSubstatusEvents['emit'](_0x212e9a,_0x4cf2cc);_0x3ba634(null);};}for(var e in events){if(events[_0x8d18('0x5')](e)){var event=events[e];MailSubstatus[_0x8d18('0x6')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index a87abec..6fec4c8 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 _0x8d07=['exports','models','MailSubstatus','mail_substatuses','Condition','name','mailSubstatus','_previousDataValues','catch'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x8d07,0xe1));var _0x78d0=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x8d07[_0x54d4fe];return _0x1ab5bb;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x78d0('0x0')]=function(_0x77312a){var _0x3cb208=_0x77312a[_0x78d0('0x1')];return _0x77312a['define'](_0x78d0('0x2'),attributes,{'tableName':_0x78d0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x485575,_0x5797fd,_0xb2aca6){return _0x3cb208[_0x78d0('0x4')]['update']({'value':_0x485575[_0x78d0('0x5')]},{'where':{'field':_0x78d0('0x6'),'value':_0x485575[_0x78d0('0x7')]['name']}})['then'](function(){_0xb2aca6();})[_0x78d0('0x8')](function(_0x4d4f4a){_0xb2aca6(_0x4d4f4a);});}}});}; \ No newline at end of file +var _0x4964=['name','mailSubstatus','_previousDataValues','then','models','define','MailSubstatus','Condition','update'];(function(_0x131ed4,_0x5d0bca){var _0x563a27=function(_0x1ae111){while(--_0x1ae111){_0x131ed4['push'](_0x131ed4['shift']());}};_0x563a27(++_0x5d0bca);}(_0x4964,0xe5));var _0x4496=function(_0x403fa5,_0x1ef358){_0x403fa5=_0x403fa5-0x0;var _0x194704=_0x4964[_0x403fa5];return _0x194704;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x59a71a){var _0x2c5235=_0x59a71a[_0x4496('0x0')];return _0x59a71a[_0x4496('0x1')](_0x4496('0x2'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5d8604,_0x3c6516,_0x3a0910){return _0x2c5235[_0x4496('0x3')][_0x4496('0x4')]({'value':_0x5d8604[_0x4496('0x5')]},{'where':{'field':_0x4496('0x6'),'value':_0x5d8604[_0x4496('0x7')][_0x4496('0x5')]}})[_0x4496('0x8')](function(){_0x3a0910();})['catch'](function(_0x1045e7){_0x3a0910(_0x1045e7);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index e3b68b3..86db28b 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 _0xe436=['then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xe436,0x1af));var _0x6e43=function(_0x53f40c,_0x31521f){_0x53f40c=_0x53f40c-0x0;var _0x337cf8=_0xe436[_0x53f40c];return _0x337cf8;};'use strict';var _=require(_0x6e43('0x0'));var util=require(_0x6e43('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e43('0x2'));var fs=require('fs');var Redis=require(_0x6e43('0x3'));var db=require(_0x6e43('0x4'))['db'];var utils=require(_0x6e43('0x5'));var logger=require('../../config/logger')(_0x6e43('0x6'));var config=require(_0x6e43('0x7'));var jayson=require(_0x6e43('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x13ab71,_0x443123,_0x2d8620){return new BPromise(function(_0xc18be9,_0x159d07){return client[_0x6e43('0x9')](_0x13ab71,_0x2d8620)[_0x6e43('0xa')](function(_0x5815c9){logger[_0x6e43('0xb')](_0x6e43('0xc'),_0x443123,_0x6e43('0xd'));logger[_0x6e43('0xe')](_0x6e43('0xf'),_0x443123,'request\x20sent',JSON['stringify'](_0x5815c9));if(_0x5815c9['error']){if(_0x5815c9[_0x6e43('0x10')][_0x6e43('0x11')]===0x1f4){logger[_0x6e43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x443123,_0x5815c9[_0x6e43('0x10')][_0x6e43('0x12')]);return _0x159d07(_0x5815c9[_0x6e43('0x10')][_0x6e43('0x12')]);}logger[_0x6e43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x443123,_0x5815c9['error'][_0x6e43('0x12')]);return _0xc18be9(_0x5815c9[_0x6e43('0x10')][_0x6e43('0x12')]);}else{logger[_0x6e43('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x443123,_0x6e43('0xd'));_0xc18be9(_0x5815c9[_0x6e43('0x13')]['message']);}})[_0x6e43('0x14')](function(_0x551359){logger[_0x6e43('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x443123,_0x551359);_0x159d07(_0x551359);});});} \ No newline at end of file +var _0x0c7d=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird'];(function(_0x29dc2e,_0x2bd38b){var _0x5488e9=function(_0x26dd91){while(--_0x26dd91){_0x29dc2e['push'](_0x29dc2e['shift']());}};_0x5488e9(++_0x2bd38b);}(_0x0c7d,0x11b));var _0xd0c7=function(_0x514867,_0xbc5f43){_0x514867=_0x514867-0x0;var _0x3a1b64=_0x0c7d[_0x514867];return _0x3a1b64;};'use strict';var _=require(_0xd0c7('0x0'));var util=require(_0xd0c7('0x1'));var moment=require('moment');var BPromise=require(_0xd0c7('0x2'));var rs=require(_0xd0c7('0x3'));var fs=require('fs');var Redis=require(_0xd0c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0c7('0x5'));var logger=require(_0xd0c7('0x6'))(_0xd0c7('0x7'));var config=require(_0xd0c7('0x8'));var jayson=require(_0xd0c7('0x9'));var client=jayson[_0xd0c7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x437214,_0x53517d,_0x354320){return new BPromise(function(_0x17dcaa,_0x39b23a){return client[_0xd0c7('0xb')](_0x437214,_0x354320)['then'](function(_0x1cf8d0){logger['info'](_0xd0c7('0xc'),_0x53517d,_0xd0c7('0xd'));logger['debug'](_0xd0c7('0xe'),_0x53517d,_0xd0c7('0xd'),JSON[_0xd0c7('0xf')](_0x1cf8d0));if(_0x1cf8d0[_0xd0c7('0x10')]){if(_0x1cf8d0[_0xd0c7('0x10')][_0xd0c7('0x11')]===0x1f4){logger[_0xd0c7('0x10')](_0xd0c7('0xc'),_0x53517d,_0x1cf8d0['error'][_0xd0c7('0x12')]);return _0x39b23a(_0x1cf8d0['error'][_0xd0c7('0x12')]);}logger[_0xd0c7('0x10')](_0xd0c7('0xc'),_0x53517d,_0x1cf8d0[_0xd0c7('0x10')][_0xd0c7('0x12')]);return _0x17dcaa(_0x1cf8d0[_0xd0c7('0x10')][_0xd0c7('0x12')]);}else{logger[_0xd0c7('0x13')](_0xd0c7('0xc'),_0x53517d,'request\x20sent');_0x17dcaa(_0x1cf8d0[_0xd0c7('0x14')][_0xd0c7('0x12')]);}})[_0xd0c7('0x15')](function(_0x49eee6){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x53517d,_0x49eee6);_0x39b23a(_0x49eee6);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index f5b0972..a56e9fb 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 _0xba00=['../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b7b3b,_0x1a07db){var _0x17167b=function(_0x300dfd){while(--_0x300dfd){_0x2b7b3b['push'](_0x2b7b3b['shift']());}};_0x17167b(++_0x1a07db);}(_0xba00,0x1db));var _0x0ba0=function(_0x50d3cf,_0x507c77){_0x50d3cf=_0x50d3cf-0x0;var _0x618979=_0xba00[_0x50d3cf];return _0x618979;};'use strict';var multer=require(_0x0ba0('0x0'));var util=require(_0x0ba0('0x1'));var path=require(_0x0ba0('0x2'));var timeout=require(_0x0ba0('0x3'));var express=require(_0x0ba0('0x4'));var router=express[_0x0ba0('0x5')]();var fs_extra=require(_0x0ba0('0x6'));var auth=require(_0x0ba0('0x7'));var interaction=require(_0x0ba0('0x8'));var config=require(_0x0ba0('0x9'));var controller=require(_0x0ba0('0xa'));router[_0x0ba0('0xb')]('/',auth[_0x0ba0('0xc')](),controller[_0x0ba0('0xd')]);router[_0x0ba0('0xb')](_0x0ba0('0xe'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x0ba0('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x0ba0('0xf')]);router[_0x0ba0('0x10')]('/:id',auth[_0x0ba0('0xc')](),controller[_0x0ba0('0x11')]);router[_0x0ba0('0x12')](_0x0ba0('0x13'),auth[_0x0ba0('0xc')](),controller[_0x0ba0('0x14')]);module[_0x0ba0('0x15')]=router; \ No newline at end of file +var _0x682f=['index','get','/describe','describe','/:id','show','create','update','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x682f,0x15f));var _0xf682=function(_0x72d00e,_0x15dfe3){_0x72d00e=_0x72d00e-0x0;var _0x27f84b=_0x682f[_0x72d00e];return _0x27f84b;};'use strict';var multer=require(_0xf682('0x0'));var util=require(_0xf682('0x1'));var path=require(_0xf682('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf682('0x3')]();var fs_extra=require(_0xf682('0x4'));var auth=require(_0xf682('0x5'));var interaction=require(_0xf682('0x6'));var config=require(_0xf682('0x7'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0xf682('0x8')](),controller[_0xf682('0x9')]);router[_0xf682('0xa')](_0xf682('0xb'),auth[_0xf682('0x8')](),controller[_0xf682('0xc')]);router['get'](_0xf682('0xd'),auth['isAuthenticated'](),controller[_0xf682('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf682('0xf')]);router['put'](_0xf682('0xd'),auth[_0xf682('0x8')](),controller[_0xf682('0x10')]);router['delete'](_0xf682('0xd'),auth[_0xf682('0x8')](),controller[_0xf682('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 7e6c1f5..708e8f0 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4d3924,_0x327b56){var _0x844555=function(_0x387a6d){while(--_0x387a6d){_0x4d3924['push'](_0x4d3924['shift']());}};_0x844555(++_0x327b56);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x2df64b,_0x459cb4){var _0x1f496c=function(_0x45f580){while(--_0x45f580){_0x2df64b['push'](_0x2df64b['shift']());}};_0x1f496c(++_0x459cb4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0xf3cd[_0x1ee9a1];return _0x21270f;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 24317fe..7b10649 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 _0x59db=['model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','MailTransferReport','includeAll','include','findAll','show','fields','length','options','catch','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x38d92b,_0x1be181){var _0x56c746=function(_0x2d8a65){while(--_0x2d8a65){_0x38d92b['push'](_0x38d92b['shift']());}};_0x56c746(++_0x1be181);}(_0x59db,0x1e5));var _0xb59d=function(_0x5e6939,_0x3dcd8a){_0x5e6939=_0x5e6939-0x0;var _0x45d3f1=_0x59db[_0x5e6939];return _0x45d3f1;};'use strict';var emlformat=require(_0xb59d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb59d('0x1'));var jsonpatch=require(_0xb59d('0x2'));var rp=require('request-promise');var moment=require(_0xb59d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb59d('0x4'));var util=require(_0xb59d('0x5'));var path=require('path');var sox=require(_0xb59d('0x6'));var csv=require('to-csv');var ejs=require(_0xb59d('0x7'));var fs=require('fs');var fs_extra=require(_0xb59d('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb59d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xb59d('0xa'));var toCsv=require('to-csv');var querystring=require(_0xb59d('0xb'));var Papa=require(_0xb59d('0xc'));var Redis=require(_0xb59d('0xd'));var authService=require(_0xb59d('0xe'));var qs=require(_0xb59d('0xf'));var as=require(_0xb59d('0x10'));var hardwareService=require(_0xb59d('0x11'));var logger=require(_0xb59d('0x12'))(_0xb59d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb59d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54b6ba,_0x1b8ec5){_0x1b8ec5=_0x1b8ec5||0xcc;return function(_0x5ecf66){if(_0x5ecf66){return _0x54b6ba[_0xb59d('0x15')](_0x1b8ec5);}return _0x54b6ba[_0xb59d('0x16')](_0x1b8ec5)[_0xb59d('0x17')]();};}function respondWithResult(_0x75bff5,_0x22f01d){_0x22f01d=_0x22f01d||0xc8;return function(_0x271a4a){if(_0x271a4a){return _0x75bff5[_0xb59d('0x16')](_0x22f01d)[_0xb59d('0x18')](_0x271a4a);}};}function respondWithFilteredResult(_0x2d4ca4,_0x58ef69){return function(_0xb69300){if(_0xb69300){var _0x4bd144=typeof _0x58ef69[_0xb59d('0x19')]===_0xb59d('0x1a')&&typeof _0x58ef69[_0xb59d('0x1b')]===_0xb59d('0x1a');var _0x30439c=_0xb69300[_0xb59d('0x1c')];var _0x5161c6=_0x4bd144?0x0:_0x58ef69[_0xb59d('0x19')];var _0x278c0a=_0x4bd144?_0xb69300[_0xb59d('0x1c')]:_0x58ef69['offset']+_0x58ef69[_0xb59d('0x1b')];var _0x314e7d;if(_0x278c0a>=_0x30439c){_0x278c0a=_0x30439c;_0x314e7d=0xc8;}else{_0x314e7d=0xce;}_0x2d4ca4[_0xb59d('0x16')](_0x314e7d);return _0x2d4ca4[_0xb59d('0x1d')](_0xb59d('0x1e'),_0x5161c6+'-'+_0x278c0a+'/'+_0x30439c)[_0xb59d('0x18')](_0xb69300);}return null;};}function patchUpdates(_0x553694){return function(_0x2380e1){try{jsonpatch[_0xb59d('0x1f')](_0x2380e1,_0x553694,!![]);}catch(_0x14eec2){return BPromise[_0xb59d('0x20')](_0x14eec2);}return _0x2380e1[_0xb59d('0x21')]();};}function saveUpdates(_0x5d5ffe,_0x5078a9){return function(_0x5d6eab){if(_0x5d6eab){return _0x5d6eab[_0xb59d('0x22')](_0x5d5ffe)[_0xb59d('0x23')](function(_0x401659){return _0x401659;});}return null;};}function removeEntity(_0x18a758,_0x53dfa4){return function(_0x1cedf8){if(_0x1cedf8){return _0x1cedf8[_0xb59d('0x24')]()[_0xb59d('0x23')](function(){_0x18a758[_0xb59d('0x16')](0xcc)[_0xb59d('0x17')]();});}};}function handleEntityNotFound(_0x16f7bf,_0x21503b){return function(_0x382535){if(!_0x382535){_0x16f7bf['sendStatus'](0x194);}return _0x382535;};}function handleError(_0x5e5500,_0x399fad){_0x399fad=_0x399fad||0x1f4;return function(_0x396ed4){logger[_0xb59d('0x25')](_0x396ed4[_0xb59d('0x26')]);if(_0x396ed4[_0xb59d('0x27')]){delete _0x396ed4['name'];}_0x5e5500[_0xb59d('0x16')](_0x399fad)[_0xb59d('0x28')](_0x396ed4);};}exports[_0xb59d('0x29')]=function(_0x541f49,_0x28f5ac){var _0x2a0410={},_0x1fe372={},_0x3cd892={'count':0x0,'rows':[]};var _0x2492c1=_[_0xb59d('0x2a')](db['MailTransferReport'][_0xb59d('0x2b')],function(_0x57265e){return{'name':_0x57265e[_0xb59d('0x2c')],'type':_0x57265e[_0xb59d('0x2d')][_0xb59d('0x2e')]};});_0x1fe372[_0xb59d('0x2f')]=_[_0xb59d('0x2a')](_0x2492c1,'name');_0x1fe372[_0xb59d('0x30')]=_[_0xb59d('0x31')](_0x541f49['query']);_0x1fe372[_0xb59d('0x32')]=_[_0xb59d('0x33')](_0x1fe372['model'],_0x1fe372[_0xb59d('0x30')]);_0x2a0410[_0xb59d('0x34')]=_[_0xb59d('0x33')](_0x1fe372[_0xb59d('0x2f')],qs['fields'](_0x541f49['query']['fields']));_0x2a0410[_0xb59d('0x34')]=_0x2a0410[_0xb59d('0x34')]['length']?_0x2a0410[_0xb59d('0x34')]:_0x1fe372[_0xb59d('0x2f')];if(!_0x541f49[_0xb59d('0x30')][_0xb59d('0x35')](_0xb59d('0x36'))){_0x2a0410['limit']=qs[_0xb59d('0x1b')](_0x541f49[_0xb59d('0x30')]['limit']);_0x2a0410['offset']=qs[_0xb59d('0x19')](_0x541f49[_0xb59d('0x30')][_0xb59d('0x19')]);}_0x2a0410[_0xb59d('0x37')]=qs[_0xb59d('0x38')](_0x541f49[_0xb59d('0x30')][_0xb59d('0x38')]);_0x2a0410[_0xb59d('0x39')]=qs[_0xb59d('0x32')](_[_0xb59d('0x3a')](_0x541f49[_0xb59d('0x30')],_0x1fe372[_0xb59d('0x32')]),_0x2492c1);if(_0x541f49[_0xb59d('0x30')]['filter']){_0x2a0410['where']=_[_0xb59d('0x3b')](_0x2a0410[_0xb59d('0x39')],{'$or':_['map'](_0x2492c1,function(_0x4ef81b){if(_0x4ef81b[_0xb59d('0x2d')]!==_0xb59d('0x3c')){var _0x166639={};_0x166639[_0x4ef81b[_0xb59d('0x27')]]={'$like':'%'+_0x541f49['query'][_0xb59d('0x3d')]+'%'};return _0x166639;}})});}_0x2a0410=_[_0xb59d('0x3b')]({},_0x2a0410,_0x541f49['options']);var _0x423daf={'where':_0x2a0410['where']};return db[_0xb59d('0x3e')]['count'](_0x423daf)[_0xb59d('0x23')](function(_0x2156e1){_0x3cd892['count']=_0x2156e1;if(_0x541f49[_0xb59d('0x30')][_0xb59d('0x3f')]){_0x2a0410[_0xb59d('0x40')]=[{'all':!![]}];}return db['MailTransferReport'][_0xb59d('0x41')](_0x2a0410);})['then'](function(_0xdae73a){_0x3cd892['rows']=_0xdae73a;return _0x3cd892;})[_0xb59d('0x23')](respondWithFilteredResult(_0x28f5ac,_0x2a0410))['catch'](handleError(_0x28f5ac,null));};exports[_0xb59d('0x42')]=function(_0xb51730,_0x13663b){var _0x2ac95b={'raw':!![],'where':{'id':_0xb51730['params']['id']}},_0x215177={};_0x215177[_0xb59d('0x2f')]=_[_0xb59d('0x31')](db[_0xb59d('0x3e')]['rawAttributes']);_0x215177[_0xb59d('0x30')]=_[_0xb59d('0x31')](_0xb51730[_0xb59d('0x30')]);_0x215177[_0xb59d('0x32')]=_[_0xb59d('0x33')](_0x215177[_0xb59d('0x2f')],_0x215177[_0xb59d('0x30')]);_0x2ac95b[_0xb59d('0x34')]=_[_0xb59d('0x33')](_0x215177[_0xb59d('0x2f')],qs[_0xb59d('0x43')](_0xb51730['query'][_0xb59d('0x43')]));_0x2ac95b['attributes']=_0x2ac95b[_0xb59d('0x34')][_0xb59d('0x44')]?_0x2ac95b[_0xb59d('0x34')]:_0x215177[_0xb59d('0x2f')];if(_0xb51730[_0xb59d('0x30')][_0xb59d('0x3f')]){_0x2ac95b[_0xb59d('0x40')]=[{'all':!![]}];}_0x2ac95b=_[_0xb59d('0x3b')]({},_0x2ac95b,_0xb51730[_0xb59d('0x45')]);return db['MailTransferReport']['find'](_0x2ac95b)['then'](handleEntityNotFound(_0x13663b,null))[_0xb59d('0x23')](respondWithResult(_0x13663b,null))[_0xb59d('0x46')](handleError(_0x13663b,null));};exports[_0xb59d('0x47')]=function(_0x1e13d7,_0x5d3686){return db[_0xb59d('0x3e')][_0xb59d('0x47')](_0x1e13d7[_0xb59d('0x48')],{})[_0xb59d('0x23')](respondWithResult(_0x5d3686,0xc9))[_0xb59d('0x46')](handleError(_0x5d3686,null));};exports[_0xb59d('0x22')]=function(_0x321b79,_0x1706a1){if(_0x321b79[_0xb59d('0x48')]['id']){delete _0x321b79[_0xb59d('0x48')]['id'];}return db['MailTransferReport'][_0xb59d('0x49')]({'where':{'id':_0x321b79[_0xb59d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1706a1,null))[_0xb59d('0x23')](saveUpdates(_0x321b79[_0xb59d('0x48')],null))[_0xb59d('0x23')](respondWithResult(_0x1706a1,null))[_0xb59d('0x46')](handleError(_0x1706a1,null));};exports[_0xb59d('0x24')]=function(_0x2f0b35,_0xdb5bb){return db['MailTransferReport'][_0xb59d('0x49')]({'where':{'id':_0x2f0b35['params']['id']}})['then'](handleEntityNotFound(_0xdb5bb,null))[_0xb59d('0x23')](removeEntity(_0xdb5bb,null))[_0xb59d('0x46')](handleError(_0xdb5bb,null));};exports[_0xb59d('0x4b')]=function(_0x5438a7,_0x2eb132){return db[_0xb59d('0x3e')][_0xb59d('0x4b')]()[_0xb59d('0x23')](respondWithResult(_0x2eb132,null))[_0xb59d('0x46')](handleError(_0x2eb132,null));}; \ No newline at end of file +var _0x81cd=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','MailTransferReport','includeAll','include','intersection','length','find','catch','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x51168f,_0x27f5ae){var _0x276ee6=function(_0x3ceb26){while(--_0x3ceb26){_0x51168f['push'](_0x51168f['shift']());}};_0x276ee6(++_0x27f5ae);}(_0x81cd,0x16c));var _0xd81c=function(_0xf8aeae,_0x329750){_0xf8aeae=_0xf8aeae-0x0;var _0x236443=_0x81cd[_0xf8aeae];return _0x236443;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd81c('0x0'));var zipdir=require(_0xd81c('0x1'));var jsonpatch=require(_0xd81c('0x2'));var rp=require(_0xd81c('0x3'));var moment=require(_0xd81c('0x4'));var BPromise=require(_0xd81c('0x5'));var Mustache=require(_0xd81c('0x6'));var util=require('util');var path=require(_0xd81c('0x7'));var sox=require(_0xd81c('0x8'));var csv=require(_0xd81c('0x9'));var ejs=require(_0xd81c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd81c('0xb'));var squel=require('squel');var crypto=require(_0xd81c('0xc'));var jsforce=require(_0xd81c('0xd'));var deskjs=require(_0xd81c('0xe'));var toCsv=require(_0xd81c('0x9'));var querystring=require(_0xd81c('0xf'));var Papa=require(_0xd81c('0x10'));var Redis=require(_0xd81c('0x11'));var authService=require(_0xd81c('0x12'));var qs=require(_0xd81c('0x13'));var as=require(_0xd81c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd81c('0x15'))(_0xd81c('0x16'));var utils=require(_0xd81c('0x17'));var config=require(_0xd81c('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd81c('0x19'))['db'];function respondWithStatusCode(_0x52eb30,_0x3f5158){_0x3f5158=_0x3f5158||0xcc;return function(_0x1d4706){if(_0x1d4706){return _0x52eb30[_0xd81c('0x1a')](_0x3f5158);}return _0x52eb30[_0xd81c('0x1b')](_0x3f5158)['end']();};}function respondWithResult(_0x3183e2,_0xce2dc2){_0xce2dc2=_0xce2dc2||0xc8;return function(_0x1fb7a1){if(_0x1fb7a1){return _0x3183e2['status'](_0xce2dc2)[_0xd81c('0x1c')](_0x1fb7a1);}};}function respondWithFilteredResult(_0x4eebcf,_0x26a80e){return function(_0x49a983){if(_0x49a983){var _0x9f52f6=typeof _0x26a80e[_0xd81c('0x1d')]===_0xd81c('0x1e')&&typeof _0x26a80e[_0xd81c('0x1f')]===_0xd81c('0x1e');var _0x47bf1a=_0x49a983[_0xd81c('0x20')];var _0x41c138=_0x9f52f6?0x0:_0x26a80e[_0xd81c('0x1d')];var _0x37c84c=_0x9f52f6?_0x49a983[_0xd81c('0x20')]:_0x26a80e[_0xd81c('0x1d')]+_0x26a80e[_0xd81c('0x1f')];var _0x294dc4;if(_0x37c84c>=_0x47bf1a){_0x37c84c=_0x47bf1a;_0x294dc4=0xc8;}else{_0x294dc4=0xce;}_0x4eebcf[_0xd81c('0x1b')](_0x294dc4);return _0x4eebcf['set'](_0xd81c('0x21'),_0x41c138+'-'+_0x37c84c+'/'+_0x47bf1a)[_0xd81c('0x1c')](_0x49a983);}return null;};}function patchUpdates(_0x3af5a0){return function(_0x187ee8){try{jsonpatch[_0xd81c('0x22')](_0x187ee8,_0x3af5a0,!![]);}catch(_0x1b2393){return BPromise[_0xd81c('0x23')](_0x1b2393);}return _0x187ee8[_0xd81c('0x24')]();};}function saveUpdates(_0x2b878c,_0x445ad4){return function(_0x2b9534){if(_0x2b9534){return _0x2b9534['update'](_0x2b878c)[_0xd81c('0x25')](function(_0x46ea6a){return _0x46ea6a;});}return null;};}function removeEntity(_0x349dc0,_0x24cfd4){return function(_0xba6206){if(_0xba6206){return _0xba6206[_0xd81c('0x26')]()['then'](function(){_0x349dc0['status'](0xcc)[_0xd81c('0x27')]();});}};}function handleEntityNotFound(_0x5c47d0,_0x524397){return function(_0x41d172){if(!_0x41d172){_0x5c47d0[_0xd81c('0x1a')](0x194);}return _0x41d172;};}function handleError(_0x158ca0,_0x35e0d0){_0x35e0d0=_0x35e0d0||0x1f4;return function(_0x22d87a){logger[_0xd81c('0x28')](_0x22d87a[_0xd81c('0x29')]);if(_0x22d87a[_0xd81c('0x2a')]){delete _0x22d87a['name'];}_0x158ca0[_0xd81c('0x1b')](_0x35e0d0)[_0xd81c('0x2b')](_0x22d87a);};}exports[_0xd81c('0x2c')]=function(_0x4d2e57,_0x4932a6){var _0x1f9477={},_0x3b3bdb={},_0x35a54f={'count':0x0,'rows':[]};var _0x1b107a=_[_0xd81c('0x2d')](db['MailTransferReport'][_0xd81c('0x2e')],function(_0x3872a4){return{'name':_0x3872a4[_0xd81c('0x2f')],'type':_0x3872a4[_0xd81c('0x30')][_0xd81c('0x31')]};});_0x3b3bdb[_0xd81c('0x32')]=_[_0xd81c('0x2d')](_0x1b107a,_0xd81c('0x2a'));_0x3b3bdb['query']=_[_0xd81c('0x33')](_0x4d2e57[_0xd81c('0x34')]);_0x3b3bdb[_0xd81c('0x35')]=_['intersection'](_0x3b3bdb['model'],_0x3b3bdb[_0xd81c('0x34')]);_0x1f9477[_0xd81c('0x36')]=_['intersection'](_0x3b3bdb[_0xd81c('0x32')],qs[_0xd81c('0x37')](_0x4d2e57['query'][_0xd81c('0x37')]));_0x1f9477[_0xd81c('0x36')]=_0x1f9477[_0xd81c('0x36')]['length']?_0x1f9477[_0xd81c('0x36')]:_0x3b3bdb['model'];if(!_0x4d2e57['query'][_0xd81c('0x38')](_0xd81c('0x39'))){_0x1f9477[_0xd81c('0x1f')]=qs[_0xd81c('0x1f')](_0x4d2e57[_0xd81c('0x34')][_0xd81c('0x1f')]);_0x1f9477[_0xd81c('0x1d')]=qs[_0xd81c('0x1d')](_0x4d2e57[_0xd81c('0x34')][_0xd81c('0x1d')]);}_0x1f9477[_0xd81c('0x3a')]=qs[_0xd81c('0x3b')](_0x4d2e57[_0xd81c('0x34')][_0xd81c('0x3b')]);_0x1f9477[_0xd81c('0x3c')]=qs[_0xd81c('0x35')](_[_0xd81c('0x3d')](_0x4d2e57[_0xd81c('0x34')],_0x3b3bdb[_0xd81c('0x35')]),_0x1b107a);if(_0x4d2e57[_0xd81c('0x34')][_0xd81c('0x3e')]){_0x1f9477[_0xd81c('0x3c')]=_[_0xd81c('0x3f')](_0x1f9477[_0xd81c('0x3c')],{'$or':_[_0xd81c('0x2d')](_0x1b107a,function(_0x32901a){if(_0x32901a[_0xd81c('0x30')]!=='VIRTUAL'){var _0x5a54de={};_0x5a54de[_0x32901a['name']]={'$like':'%'+_0x4d2e57['query']['filter']+'%'};return _0x5a54de;}})});}_0x1f9477=_[_0xd81c('0x3f')]({},_0x1f9477,_0x4d2e57[_0xd81c('0x40')]);var _0x45a383={'where':_0x1f9477[_0xd81c('0x3c')]};return db[_0xd81c('0x41')]['count'](_0x45a383)[_0xd81c('0x25')](function(_0x515fef){_0x35a54f[_0xd81c('0x20')]=_0x515fef;if(_0x4d2e57[_0xd81c('0x34')][_0xd81c('0x42')]){_0x1f9477[_0xd81c('0x43')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x1f9477);})['then'](function(_0xa0557a){_0x35a54f['rows']=_0xa0557a;return _0x35a54f;})[_0xd81c('0x25')](respondWithFilteredResult(_0x4932a6,_0x1f9477))['catch'](handleError(_0x4932a6,null));};exports['show']=function(_0x2196eb,_0x2185aa){var _0x246bd5={'raw':!![],'where':{'id':_0x2196eb['params']['id']}},_0x81758e={};_0x81758e[_0xd81c('0x32')]=_[_0xd81c('0x33')](db[_0xd81c('0x41')][_0xd81c('0x2e')]);_0x81758e[_0xd81c('0x34')]=_[_0xd81c('0x33')](_0x2196eb[_0xd81c('0x34')]);_0x81758e[_0xd81c('0x35')]=_[_0xd81c('0x44')](_0x81758e[_0xd81c('0x32')],_0x81758e[_0xd81c('0x34')]);_0x246bd5[_0xd81c('0x36')]=_['intersection'](_0x81758e['model'],qs[_0xd81c('0x37')](_0x2196eb[_0xd81c('0x34')][_0xd81c('0x37')]));_0x246bd5[_0xd81c('0x36')]=_0x246bd5[_0xd81c('0x36')][_0xd81c('0x45')]?_0x246bd5[_0xd81c('0x36')]:_0x81758e[_0xd81c('0x32')];if(_0x2196eb[_0xd81c('0x34')]['includeAll']){_0x246bd5['include']=[{'all':!![]}];}_0x246bd5=_[_0xd81c('0x3f')]({},_0x246bd5,_0x2196eb[_0xd81c('0x40')]);return db[_0xd81c('0x41')][_0xd81c('0x46')](_0x246bd5)['then'](handleEntityNotFound(_0x2185aa,null))['then'](respondWithResult(_0x2185aa,null))[_0xd81c('0x47')](handleError(_0x2185aa,null));};exports['create']=function(_0x27df3e,_0x476be7){return db[_0xd81c('0x41')]['create'](_0x27df3e['body'],{})[_0xd81c('0x25')](respondWithResult(_0x476be7,0xc9))[_0xd81c('0x47')](handleError(_0x476be7,null));};exports['update']=function(_0x5e1195,_0x5990e8){if(_0x5e1195['body']['id']){delete _0x5e1195[_0xd81c('0x48')]['id'];}return db[_0xd81c('0x41')][_0xd81c('0x46')]({'where':{'id':_0x5e1195[_0xd81c('0x49')]['id']}})[_0xd81c('0x25')](handleEntityNotFound(_0x5990e8,null))[_0xd81c('0x25')](saveUpdates(_0x5e1195[_0xd81c('0x48')],null))['then'](respondWithResult(_0x5990e8,null))[_0xd81c('0x47')](handleError(_0x5990e8,null));};exports[_0xd81c('0x26')]=function(_0x237f56,_0x244d1b){return db['MailTransferReport'][_0xd81c('0x46')]({'where':{'id':_0x237f56[_0xd81c('0x49')]['id']}})['then'](handleEntityNotFound(_0x244d1b,null))[_0xd81c('0x25')](removeEntity(_0x244d1b,null))[_0xd81c('0x47')](handleError(_0x244d1b,null));};exports[_0xd81c('0x4a')]=function(_0x2c6835,_0x542626){return db[_0xd81c('0x41')]['describe']()[_0xd81c('0x25')](respondWithResult(_0x542626,null))[_0xd81c('0x47')](handleError(_0x542626,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 26b0a94..ccbfaa3 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 _0xe984=['../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xe984,0xe2));var _0x4e98=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xe984[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require(_0x4e98('0x0'));var logger=require(_0x4e98('0x1'))(_0x4e98('0x2'));var moment=require(_0x4e98('0x3'));var BPromise=require(_0x4e98('0x4'));var rp=require(_0x4e98('0x5'));var fs=require('fs');var path=require(_0x4e98('0x6'));var rimraf=require(_0x4e98('0x7'));var config=require(_0x4e98('0x8'));var attributes=require(_0x4e98('0x9'));module['exports']=function(_0x3288f5,_0x44ffad){return _0x3288f5[_0x4e98('0xa')](_0x4e98('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x4e98('0xc'),'fields':[_0x4e98('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb258=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb258,0x12b));var _0x8b25=function(_0x5270f4,_0x2dea48){_0x5270f4=_0x5270f4-0x0;var _0x17f368=_0xb258[_0x5270f4];return _0x17f368;};'use strict';var _=require(_0x8b25('0x0'));var util=require('util');var logger=require(_0x8b25('0x1'))(_0x8b25('0x2'));var moment=require('moment');var BPromise=require(_0x8b25('0x3'));var rp=require(_0x8b25('0x4'));var fs=require('fs');var path=require(_0x8b25('0x5'));var rimraf=require(_0x8b25('0x6'));var config=require(_0x8b25('0x7'));var attributes=require(_0x8b25('0x8'));module['exports']=function(_0x40d293,_0x3e10a5){return _0x40d293[_0x8b25('0x9')](_0x8b25('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x8b25('0xb'),'fields':[_0x8b25('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 592be51..873b5d3 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 _0x3d52=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x3d52,0x15b));var _0x23d5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23d5('0x0'));var util=require('util');var moment=require(_0x23d5('0x1'));var BPromise=require(_0x23d5('0x2'));var rs=require(_0x23d5('0x3'));var fs=require('fs');var Redis=require(_0x23d5('0x4'));var db=require(_0x23d5('0x5'))['db'];var utils=require(_0x23d5('0x6'));var logger=require(_0x23d5('0x7'))(_0x23d5('0x8'));var config=require(_0x23d5('0x9'));var jayson=require(_0x23d5('0xa'));var client=jayson['client'][_0x23d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37b047,_0x14c6c6,_0x50d2c8){return new BPromise(function(_0x481869,_0x18afc2){return client[_0x23d5('0xc')](_0x37b047,_0x50d2c8)[_0x23d5('0xd')](function(_0x4cd1bf){logger[_0x23d5('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x14c6c6,_0x23d5('0xf'));logger[_0x23d5('0x10')](_0x23d5('0x11'),_0x14c6c6,_0x23d5('0xf'),JSON[_0x23d5('0x12')](_0x4cd1bf));if(_0x4cd1bf[_0x23d5('0x13')]){if(_0x4cd1bf[_0x23d5('0x13')][_0x23d5('0x14')]===0x1f4){logger['error'](_0x23d5('0x15'),_0x14c6c6,_0x4cd1bf['error'][_0x23d5('0x16')]);return _0x18afc2(_0x4cd1bf['error'][_0x23d5('0x16')]);}logger[_0x23d5('0x13')](_0x23d5('0x15'),_0x14c6c6,_0x4cd1bf[_0x23d5('0x13')][_0x23d5('0x16')]);return _0x481869(_0x4cd1bf[_0x23d5('0x13')][_0x23d5('0x16')]);}else{logger[_0x23d5('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x14c6c6,_0x23d5('0xf'));_0x481869(_0x4cd1bf[_0x23d5('0x17')][_0x23d5('0x16')]);}})[_0x23d5('0x18')](function(_0x15c4f5){logger['error'](_0x23d5('0x15'),_0x14c6c6,_0x15c4f5);_0x18afc2(_0x15c4f5);});});} \ No newline at end of file +var _0x63be=['message','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x63be,0x144));var _0xe63b=function(_0x55a230,_0x35615a){_0x55a230=_0x55a230-0x0;var _0x43c6e8=_0x63be[_0x55a230];return _0x43c6e8;};'use strict';var _=require('lodash');var util=require(_0xe63b('0x0'));var moment=require(_0xe63b('0x1'));var BPromise=require('bluebird');var rs=require(_0xe63b('0x2'));var fs=require('fs');var Redis=require(_0xe63b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe63b('0x4'));var logger=require(_0xe63b('0x5'))(_0xe63b('0x6'));var config=require(_0xe63b('0x7'));var jayson=require(_0xe63b('0x8'));var client=jayson[_0xe63b('0x9')][_0xe63b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25d539,_0x3a477d,_0x3c825f){return new BPromise(function(_0x1ed828,_0x557db4){return client[_0xe63b('0xb')](_0x25d539,_0x3c825f)['then'](function(_0x455104){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x3a477d,_0xe63b('0xc'));logger[_0xe63b('0xd')](_0xe63b('0xe'),_0x3a477d,'request\x20sent',JSON['stringify'](_0x455104));if(_0x455104[_0xe63b('0xf')]){if(_0x455104[_0xe63b('0xf')][_0xe63b('0x10')]===0x1f4){logger[_0xe63b('0xf')](_0xe63b('0x11'),_0x3a477d,_0x455104[_0xe63b('0xf')][_0xe63b('0x12')]);return _0x557db4(_0x455104[_0xe63b('0xf')]['message']);}logger[_0xe63b('0xf')](_0xe63b('0x11'),_0x3a477d,_0x455104['error']['message']);return _0x1ed828(_0x455104[_0xe63b('0xf')]['message']);}else{logger['info'](_0xe63b('0x11'),_0x3a477d,_0xe63b('0xc'));_0x1ed828(_0x455104['result'][_0xe63b('0x12')]);}})['catch'](function(_0xc7af1c){logger[_0xe63b('0xf')](_0xe63b('0x11'),_0x3a477d,_0xc7af1c);_0x557db4(_0xc7af1c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 0c36841..6055075 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 _0x4c42=['get','isAuthenticated','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3efe54,_0x6bf466){var _0x17ccaa=function(_0x5989e0){while(--_0x5989e0){_0x3efe54['push'](_0x3efe54['shift']());}};_0x17ccaa(++_0x6bf466);}(_0x4c42,0xb6));var _0x24c4=function(_0xbb8d6f,_0x429e65){_0xbb8d6f=_0xbb8d6f-0x0;var _0x28aeab=_0x4c42[_0xbb8d6f];return _0x28aeab;};'use strict';var multer=require(_0x24c4('0x0'));var util=require(_0x24c4('0x1'));var path=require(_0x24c4('0x2'));var timeout=require(_0x24c4('0x3'));var express=require(_0x24c4('0x4'));var router=express['Router']();var fs_extra=require(_0x24c4('0x5'));var auth=require(_0x24c4('0x6'));var interaction=require(_0x24c4('0x7'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x24c4('0x8')]('/',auth[_0x24c4('0x9')](),controller['index']);router[_0x24c4('0x8')](_0x24c4('0xa'),auth[_0x24c4('0x9')](),controller[_0x24c4('0xb')]);router[_0x24c4('0x8')](_0x24c4('0xc'),auth[_0x24c4('0x9')](),controller[_0x24c4('0xd')]);router[_0x24c4('0xe')]('/',auth[_0x24c4('0x9')](),controller['create']);router['put'](_0x24c4('0xc'),auth[_0x24c4('0x9')](),controller[_0x24c4('0xf')]);router[_0x24c4('0x10')](_0x24c4('0xc'),auth[_0x24c4('0x9')](),controller[_0x24c4('0x11')]);module[_0x24c4('0x12')]=router; \ No newline at end of file +var _0xc78c=['Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xc78c,0x19f));var _0xcc78=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc78c[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xcc78('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcc78('0x1'));var express=require(_0xcc78('0x2'));var router=express[_0xcc78('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcc78('0x4'));var config=require(_0xcc78('0x5'));var controller=require('./memberReport.controller');router['get']('/',auth[_0xcc78('0x6')](),controller[_0xcc78('0x7')]);router[_0xcc78('0x8')](_0xcc78('0x9'),auth[_0xcc78('0x6')](),controller[_0xcc78('0xa')]);router['get'](_0xcc78('0xb'),auth[_0xcc78('0x6')](),controller[_0xcc78('0xc')]);router[_0xcc78('0xd')]('/',auth[_0xcc78('0x6')](),controller[_0xcc78('0xe')]);router['put'](_0xcc78('0xb'),auth[_0xcc78('0x6')](),controller[_0xcc78('0xf')]);router[_0xcc78('0x10')](_0xcc78('0xb'),auth['isAuthenticated'](),controller[_0xcc78('0x11')]);module[_0xcc78('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index ed33eba..1c43eaf 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 _0x6f94=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','setDataValue'];(function(_0x5db1ce,_0x57ab66){var _0xb62cbb=function(_0x33b753){while(--_0x33b753){_0x5db1ce['push'](_0x5db1ce['shift']());}};_0xb62cbb(++_0x57ab66);}(_0x6f94,0xe8));var _0x46f9=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x6f94[_0x2e4e19];return _0x9ba20b;};'use strict';var Sequelize=require(_0x46f9('0x0'));var moment=require('moment');module[_0x46f9('0x1')]={'channel':{'type':Sequelize[_0x46f9('0x2')]},'membername':{'type':Sequelize[_0x46f9('0x2')]},'interface':{'type':Sequelize[_0x46f9('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x46f9('0x3')},'duration':{'type':Sequelize[_0x46f9('0x4')]},'enterAt':{'type':Sequelize[_0x46f9('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x5b1781){var _0x49f906=moment(_0x5b1781);var _0x18504d=moment(this['getDataValue'](_0x46f9('0x6')));var _0x1d775f=_0x49f906['diff'](_0x18504d,'seconds');this[_0x46f9('0x7')]('exitAt',_0x5b1781);this[_0x46f9('0x7')]('duration',_0x1d775f>=0x0?_0x1d775f:null);}},'data1':{'type':Sequelize[_0x46f9('0x2')],'comment':_0x46f9('0x8')},'data2':{'type':Sequelize[_0x46f9('0x2')],'comment':_0x46f9('0x9')},'data3':{'type':Sequelize[_0x46f9('0x2')],'comment':_0x46f9('0xa')},'data4':{'type':Sequelize[_0x46f9('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize['STRING'],'comment':_0x46f9('0xb')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x46f9('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x13e7=['STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x32ffdf,_0x3b2d09){var _0x2bad7d=function(_0xd6a1e4){while(--_0xd6a1e4){_0x32ffdf['push'](_0x32ffdf['shift']());}};_0x2bad7d(++_0x3b2d09);}(_0x13e7,0x133));var _0x713e=function(_0x438912,_0x3f7f74){_0x438912=_0x438912-0x0;var _0x18112f=_0x13e7[_0x438912];return _0x18112f;};'use strict';var Sequelize=require(_0x713e('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x713e('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x713e('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x713e('0x3')]},'enterAt':{'type':Sequelize[_0x713e('0x4')]},'exitAt':{'type':Sequelize[_0x713e('0x4')],'set':function(_0xccb7e){var _0x465b77=moment(_0xccb7e);var _0x47c066=moment(this[_0x713e('0x5')]('enterAt'));var _0x4c62a9=_0x465b77[_0x713e('0x6')](_0x47c066,_0x713e('0x7'));this[_0x713e('0x8')](_0x713e('0x9'),_0xccb7e);this[_0x713e('0x8')](_0x713e('0xa'),_0x4c62a9>=0x0?_0x4c62a9:null);}},'data1':{'type':Sequelize[_0x713e('0x1')],'comment':_0x713e('0xb')},'data2':{'type':Sequelize[_0x713e('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x713e('0x1')],'comment':_0x713e('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0x713e('0xd')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x713e('0x3')]},'uniqueid':{'type':Sequelize[_0x713e('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 77e2748..fba41c2 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 _0x34e8=['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','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0x34e8,0x12c));var _0x834e=function(_0x3b5953,_0x38346b){_0x3b5953=_0x3b5953-0x0;var _0x13f6dc=_0x34e8[_0x3b5953];return _0x13f6dc;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));}; \ No newline at end of file +var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x3005e9,_0x523556){var _0x322638=function(_0x38d453){while(--_0x38d453){_0x3005e9['push'](_0x3005e9['shift']());}};_0x322638(++_0x523556);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 997739f..e86abae 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 _0x2436=['../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x145217,_0x2eb561){var _0x5c454b=function(_0x89d37b){while(--_0x89d37b){_0x145217['push'](_0x145217['shift']());}};_0x5c454b(++_0x2eb561);}(_0x2436,0x1e7));var _0x6243=function(_0xa54373,_0x393f2c){_0xa54373=_0xa54373-0x0;var _0xb12745=_0x2436[_0xa54373];return _0xb12745;};'use strict';var _=require('lodash');var util=require(_0x6243('0x0'));var logger=require(_0x6243('0x1'))(_0x6243('0x2'));var moment=require(_0x6243('0x3'));var BPromise=require(_0x6243('0x4'));var rp=require(_0x6243('0x5'));var fs=require('fs');var path=require(_0x6243('0x6'));var rimraf=require(_0x6243('0x7'));var config=require(_0x6243('0x8'));var attributes=require(_0x6243('0x9'));module['exports']=function(_0x33499e,_0x3b32d4){return _0x33499e[_0x6243('0xa')](_0x6243('0xb'),attributes,{'tableName':_0x6243('0xc'),'paranoid':![],'indexes':[{'name':_0x6243('0xd'),'fields':[_0x6243('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1fcf=['bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','membername','lodash','util','../../config/logger','api','moment'];(function(_0x1f3575,_0x37dd77){var _0xf95ca3=function(_0x2c5054){while(--_0x2c5054){_0x1f3575['push'](_0x1f3575['shift']());}};_0xf95ca3(++_0x37dd77);}(_0x1fcf,0x145));var _0xf1fc=function(_0x50726c,_0x4fdec4){_0x50726c=_0x50726c-0x0;var _0x325e0c=_0x1fcf[_0x50726c];return _0x325e0c;};'use strict';var _=require(_0xf1fc('0x0'));var util=require(_0xf1fc('0x1'));var logger=require(_0xf1fc('0x2'))(_0xf1fc('0x3'));var moment=require(_0xf1fc('0x4'));var BPromise=require(_0xf1fc('0x5'));var rp=require(_0xf1fc('0x6'));var fs=require('fs');var path=require(_0xf1fc('0x7'));var rimraf=require(_0xf1fc('0x8'));var config=require(_0xf1fc('0x9'));var attributes=require(_0xf1fc('0xa'));module[_0xf1fc('0xb')]=function(_0x4e21ac,_0xe83467){return _0x4e21ac[_0xf1fc('0xc')](_0xf1fc('0xd'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xf1fc('0xe'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index bbcfa4a..9a20212 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 _0x4da5=['debug','MemberReport','create','body','CreateMemberReport','UpdateMemberReport','update','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','options','raw','where','attributes','limit','include','model','map'];(function(_0x3bac80,_0x1cb360){var _0x36ff3f=function(_0x579f06){while(--_0x579f06){_0x3bac80['push'](_0x3bac80['shift']());}};_0x36ff3f(++_0x1cb360);}(_0x4da5,0x1b7));var _0x54da=function(_0x3a6c79,_0x3d67a2){_0x3a6c79=_0x3a6c79-0x0;var _0x164a87=_0x4da5[_0x3a6c79];return _0x164a87;};'use strict';var _=require('lodash');var util=require(_0x54da('0x0'));var moment=require(_0x54da('0x1'));var BPromise=require(_0x54da('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x54da('0x4'));var logger=require(_0x54da('0x5'))(_0x54da('0x6'));var config=require(_0x54da('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x54da('0x8')][_0x54da('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x259062,_0x1b2b5c,_0x2fe7cc){return new BPromise(function(_0x30c17d,_0x1e2c78){return client['request'](_0x259062,_0x2fe7cc)[_0x54da('0xa')](function(_0x3c4e06){logger[_0x54da('0xb')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'));logger['debug']('MemberReport,\x20%s,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'),JSON[_0x54da('0xd')](_0x3c4e06));if(_0x3c4e06[_0x54da('0xe')]){if(_0x3c4e06[_0x54da('0xe')][_0x54da('0xf')]===0x1f4){logger[_0x54da('0xe')](_0x54da('0x10'),_0x1b2b5c,_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);return _0x1e2c78(_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);}logger[_0x54da('0xe')](_0x54da('0x10'),_0x1b2b5c,_0x3c4e06['error'][_0x54da('0x11')]);return _0x30c17d(_0x3c4e06[_0x54da('0xe')][_0x54da('0x11')]);}else{logger[_0x54da('0xb')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x54da('0xc'));_0x30c17d(_0x3c4e06[_0x54da('0x12')][_0x54da('0x11')]);}})[_0x54da('0x13')](function(_0x20ff93){logger[_0x54da('0xe')]('MemberReport,\x20%s,\x20%s',_0x1b2b5c,_0x20ff93);_0x1e2c78(_0x20ff93);});});}exports[_0x54da('0x14')]=function(_0x14aa08){var _0x5d242e=this;return new Promise(function(_0x2cad22,_0x3a463c){return db['MemberReport']['findAll']({'raw':_0x14aa08[_0x54da('0x15')]?_0x14aa08['options'][_0x54da('0x16')]===undefined?!![]:![]:!![],'where':_0x14aa08[_0x54da('0x15')]?_0x14aa08['options'][_0x54da('0x17')]||null:null,'attributes':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x18')]||null:null,'limit':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x19')]||null:null,'include':_0x14aa08[_0x54da('0x15')]?_0x14aa08[_0x54da('0x15')][_0x54da('0x1a')]?_['map'](_0x14aa08[_0x54da('0x15')][_0x54da('0x1a')],function(_0x16b09a){return{'model':db[_0x16b09a[_0x54da('0x1b')]],'as':_0x16b09a['as'],'attributes':_0x16b09a[_0x54da('0x18')],'include':_0x16b09a[_0x54da('0x1a')]?_['map'](_0x16b09a[_0x54da('0x1a')],function(_0xef179d){return{'model':db[_0xef179d[_0x54da('0x1b')]],'as':_0xef179d['as'],'attributes':_0xef179d[_0x54da('0x18')],'include':_0xef179d[_0x54da('0x1a')]?_[_0x54da('0x1c')](_0xef179d['include'],function(_0x9ea13f){return{'model':db[_0x9ea13f['model']],'as':_0x9ea13f['as'],'attributes':_0x9ea13f[_0x54da('0x18')]};}):[]};}):[]};}):[]:[]})[_0x54da('0xa')](function(_0x77024e){logger['info']('GetMemberReport',_0x14aa08);logger[_0x54da('0x1d')](_0x54da('0x14'),_0x14aa08,JSON[_0x54da('0xd')](_0x77024e));_0x2cad22(_0x77024e);})['catch'](function(_0x1f69e6){logger[_0x54da('0xe')]('GetMemberReport',_0x1f69e6[_0x54da('0x11')],_0x14aa08);_0x3a463c(_0x5d242e[_0x54da('0xe')](0x1f4,_0x1f69e6[_0x54da('0x11')]));});});};exports['CreateMemberReport']=function(_0x4d142e){var _0x21784e=this;return new Promise(function(_0x54b666,_0x20a0c6){return db[_0x54da('0x1e')][_0x54da('0x1f')](_0x4d142e[_0x54da('0x20')],{'raw':_0x4d142e[_0x54da('0x15')]?_0x4d142e[_0x54da('0x15')][_0x54da('0x16')]===undefined?!![]:![]:!![]})[_0x54da('0xa')](function(_0x56d4fc){logger[_0x54da('0xb')](_0x54da('0x21'),_0x4d142e);logger['debug']('CreateMemberReport',_0x4d142e,JSON[_0x54da('0xd')](_0x56d4fc));_0x54b666(_0x56d4fc);})[_0x54da('0x13')](function(_0x3f3847){logger[_0x54da('0xe')](_0x54da('0x21'),_0x3f3847[_0x54da('0x11')],_0x4d142e);_0x20a0c6(_0x21784e[_0x54da('0xe')](0x1f4,_0x3f3847[_0x54da('0x11')]));});});};exports[_0x54da('0x22')]=function(_0xe2afc4){var _0x10f188=this;return new Promise(function(_0x361c6f,_0x5e58d3){return db[_0x54da('0x1e')][_0x54da('0x23')](_0xe2afc4['body'],{'raw':_0xe2afc4[_0x54da('0x15')]?_0xe2afc4[_0x54da('0x15')][_0x54da('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe2afc4[_0x54da('0x15')]?_0xe2afc4[_0x54da('0x15')]['where']||null:null,'attributes':_0xe2afc4['options']?_0xe2afc4[_0x54da('0x15')]['attributes']||null:null,'limit':_0xe2afc4['options']?_0xe2afc4['options'][_0x54da('0x19')]||null:null})[_0x54da('0xa')](function(_0x19cbb4){logger[_0x54da('0xb')](_0x54da('0x22'),_0xe2afc4);logger[_0x54da('0x1d')](_0x54da('0x22'),_0xe2afc4,JSON[_0x54da('0xd')](_0x19cbb4));_0x361c6f(_0x19cbb4);})[_0x54da('0x13')](function(_0x3885aa){logger[_0x54da('0xe')](_0x54da('0x22'),_0x3885aa[_0x54da('0x11')],_0xe2afc4);_0x5e58d3(_0x10f188[_0x54da('0xe')](0x1f4,_0x3885aa[_0x54da('0x11')]));});});}; \ No newline at end of file +var _0xe626=['CreateMemberReport','create','raw','UpdateMemberReport','update','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','map','include','model','then','debug'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0xe626,0x9d));var _0x6e62=function(_0x4f8d13,_0x14dca7){_0x4f8d13=_0x4f8d13-0x0;var _0x20b936=_0xe626[_0x4f8d13];return _0x20b936;};'use strict';var _=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var moment=require(_0x6e62('0x2'));var BPromise=require(_0x6e62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e62('0x4'));var db=require(_0x6e62('0x5'))['db'];var utils=require(_0x6e62('0x6'));var logger=require(_0x6e62('0x7'))(_0x6e62('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6e62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x157047,_0x55165e,_0x32fd89){return new BPromise(function(_0x1dfbaf,_0x16fa52){return client[_0x6e62('0xa')](_0x157047,_0x32fd89)['then'](function(_0xa6e8be){logger[_0x6e62('0xb')]('MemberReport,\x20%s,\x20%s',_0x55165e,_0x6e62('0xc'));logger['debug'](_0x6e62('0xd'),_0x55165e,'request\x20sent',JSON[_0x6e62('0xe')](_0xa6e8be));if(_0xa6e8be['error']){if(_0xa6e8be[_0x6e62('0xf')][_0x6e62('0x10')]===0x1f4){logger[_0x6e62('0xf')](_0x6e62('0x11'),_0x55165e,_0xa6e8be[_0x6e62('0xf')][_0x6e62('0x12')]);return _0x16fa52(_0xa6e8be[_0x6e62('0xf')]['message']);}logger['error'](_0x6e62('0x11'),_0x55165e,_0xa6e8be[_0x6e62('0xf')]['message']);return _0x1dfbaf(_0xa6e8be[_0x6e62('0xf')][_0x6e62('0x12')]);}else{logger[_0x6e62('0xb')](_0x6e62('0x11'),_0x55165e,'request\x20sent');_0x1dfbaf(_0xa6e8be[_0x6e62('0x13')][_0x6e62('0x12')]);}})[_0x6e62('0x14')](function(_0x35748b){logger[_0x6e62('0xf')](_0x6e62('0x11'),_0x55165e,_0x35748b);_0x16fa52(_0x35748b);});});}exports[_0x6e62('0x15')]=function(_0x45d7ee){var _0x474e58=this;return new Promise(function(_0x15bce5,_0x50c535){return db[_0x6e62('0x16')][_0x6e62('0x17')]({'raw':_0x45d7ee['options']?_0x45d7ee[_0x6e62('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x45d7ee[_0x6e62('0x18')]?_0x45d7ee[_0x6e62('0x18')][_0x6e62('0x19')]||null:null,'attributes':_0x45d7ee[_0x6e62('0x18')]?_0x45d7ee[_0x6e62('0x18')][_0x6e62('0x1a')]||null:null,'limit':_0x45d7ee[_0x6e62('0x18')]?_0x45d7ee[_0x6e62('0x18')][_0x6e62('0x1b')]||null:null,'include':_0x45d7ee[_0x6e62('0x18')]?_0x45d7ee[_0x6e62('0x18')]['include']?_[_0x6e62('0x1c')](_0x45d7ee['options'][_0x6e62('0x1d')],function(_0x3dad96){return{'model':db[_0x3dad96[_0x6e62('0x1e')]],'as':_0x3dad96['as'],'attributes':_0x3dad96[_0x6e62('0x1a')],'include':_0x3dad96[_0x6e62('0x1d')]?_[_0x6e62('0x1c')](_0x3dad96[_0x6e62('0x1d')],function(_0x3a1683){return{'model':db[_0x3a1683[_0x6e62('0x1e')]],'as':_0x3a1683['as'],'attributes':_0x3a1683[_0x6e62('0x1a')],'include':_0x3a1683['include']?_[_0x6e62('0x1c')](_0x3a1683['include'],function(_0x2f9c68){return{'model':db[_0x2f9c68[_0x6e62('0x1e')]],'as':_0x2f9c68['as'],'attributes':_0x2f9c68[_0x6e62('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6e62('0x1f')](function(_0x3b7dfa){logger[_0x6e62('0xb')]('GetMemberReport',_0x45d7ee);logger[_0x6e62('0x20')](_0x6e62('0x15'),_0x45d7ee,JSON[_0x6e62('0xe')](_0x3b7dfa));_0x15bce5(_0x3b7dfa);})['catch'](function(_0x58afab){logger[_0x6e62('0xf')]('GetMemberReport',_0x58afab['message'],_0x45d7ee);_0x50c535(_0x474e58['error'](0x1f4,_0x58afab['message']));});});};exports[_0x6e62('0x21')]=function(_0x4c6af1){var _0x2d9172=this;return new Promise(function(_0x5a8516,_0x1dc29e){return db[_0x6e62('0x16')][_0x6e62('0x22')](_0x4c6af1['body'],{'raw':_0x4c6af1['options']?_0x4c6af1[_0x6e62('0x18')][_0x6e62('0x23')]===undefined?!![]:![]:!![]})['then'](function(_0x5e2969){logger['info'](_0x6e62('0x21'),_0x4c6af1);logger['debug'](_0x6e62('0x21'),_0x4c6af1,JSON[_0x6e62('0xe')](_0x5e2969));_0x5a8516(_0x5e2969);})[_0x6e62('0x14')](function(_0xe525c){logger[_0x6e62('0xf')]('CreateMemberReport',_0xe525c['message'],_0x4c6af1);_0x1dc29e(_0x2d9172[_0x6e62('0xf')](0x1f4,_0xe525c[_0x6e62('0x12')]));});});};exports[_0x6e62('0x24')]=function(_0x372f72){var _0xf650a=this;return new Promise(function(_0xfe729c,_0x9c62b){return db[_0x6e62('0x16')][_0x6e62('0x25')](_0x372f72['body'],{'raw':_0x372f72[_0x6e62('0x18')]?_0x372f72[_0x6e62('0x18')][_0x6e62('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x372f72['options']?_0x372f72[_0x6e62('0x18')][_0x6e62('0x19')]||null:null,'attributes':_0x372f72['options']?_0x372f72[_0x6e62('0x18')][_0x6e62('0x1a')]||null:null,'limit':_0x372f72[_0x6e62('0x18')]?_0x372f72[_0x6e62('0x18')][_0x6e62('0x1b')]||null:null})['then'](function(_0x34f99e){logger[_0x6e62('0xb')](_0x6e62('0x24'),_0x372f72);logger[_0x6e62('0x20')](_0x6e62('0x24'),_0x372f72,JSON['stringify'](_0x34f99e));_0xfe729c(_0x34f99e);})[_0x6e62('0x14')](function(_0x6f8397){logger[_0x6e62('0xf')]('UpdateMemberReport',_0x6f8397[_0x6e62('0x12')],_0x372f72);_0x9c62b(_0xf650a[_0x6e62('0xf')](0x1f4,_0x6f8397['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 3ae9baa..e83740a 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 _0xe45e=['path','connect-timeout','Router','fs-extra','../../config/environment','get','exports','multer','util'];(function(_0x361ba7,_0x34bbcc){var _0x1e1ed5=function(_0x2c5330){while(--_0x2c5330){_0x361ba7['push'](_0x361ba7['shift']());}};_0x1e1ed5(++_0x34bbcc);}(_0xe45e,0x1c0));var _0xee45=function(_0x595013,_0x65a215){_0x595013=_0x595013-0x0;var _0x2a29e3=_0xe45e[_0x595013];return _0x2a29e3;};'use strict';var multer=require(_0xee45('0x0'));var util=require(_0xee45('0x1'));var path=require(_0xee45('0x2'));var timeout=require(_0xee45('0x3'));var express=require('express');var router=express[_0xee45('0x4')]();var fs_extra=require(_0xee45('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee45('0x6'));var controller=require('./migration.controller');router[_0xee45('0x7')]('/',controller['index']);module[_0xee45('0x8')]=router; \ No newline at end of file +var _0xb209=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./migration.controller','exports','multer','util','path'];(function(_0x1466a0,_0x3f41b3){var _0x5f55b2=function(_0x2926ae){while(--_0x2926ae){_0x1466a0['push'](_0x1466a0['shift']());}};_0x5f55b2(++_0x3f41b3);}(_0xb209,0x151));var _0x9b20=function(_0x33c9b7,_0x3ecdca){_0x33c9b7=_0x33c9b7-0x0;var _0x185e85=_0xb209[_0x33c9b7];return _0x185e85;};'use strict';var multer=require(_0x9b20('0x0'));var util=require(_0x9b20('0x1'));var path=require(_0x9b20('0x2'));var timeout=require(_0x9b20('0x3'));var express=require(_0x9b20('0x4'));var router=express[_0x9b20('0x5')]();var fs_extra=require(_0x9b20('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9b20('0x7'));var config=require('../../config/environment');var controller=require(_0x9b20('0x8'));router['get']('/',controller['index']);module[_0x9b20('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 2a39634..9b5a029 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 _0x1f30=['STRING','version','sequelize','exports'];(function(_0x3e8bf8,_0x4e76d6){var _0x3391ce=function(_0x4f32d6){while(--_0x4f32d6){_0x3e8bf8['push'](_0x3e8bf8['shift']());}};_0x3391ce(++_0x4e76d6);}(_0x1f30,0x17a));var _0x01f3=function(_0x269b2b,_0x182447){_0x269b2b=_0x269b2b-0x0;var _0xa61baf=_0x1f30[_0x269b2b];return _0xa61baf;};'use strict';var Sequelize=require(_0x01f3('0x0'));module[_0x01f3('0x1')]={'version':{'type':Sequelize[_0x01f3('0x2')],'unique':_0x01f3('0x3')}}; \ No newline at end of file +var _0x3996=['STRING','exports'];(function(_0x511a17,_0x203ada){var _0xfca535=function(_0x35e4de){while(--_0x35e4de){_0x511a17['push'](_0x511a17['shift']());}};_0xfca535(++_0x203ada);}(_0x3996,0xc1));var _0x6399=function(_0xc1c74e,_0x235988){_0xc1c74e=_0xc1c74e-0x0;var _0x5a02d8=_0x3996[_0xc1c74e];return _0x5a02d8;};'use strict';var Sequelize=require('sequelize');module[_0x6399('0x0')]={'version':{'type':Sequelize[_0x6399('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 77b06dc..1be72b6 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 _0x04f5=['keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query'];(function(_0x18b0c2,_0x127a3d){var _0x14b6ff=function(_0x484a49){while(--_0x484a49){_0x18b0c2['push'](_0x18b0c2['shift']());}};_0x14b6ff(++_0x127a3d);}(_0x04f5,0x9f));var _0x504f=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x04f5[_0x5d07ff];return _0x5226ad;};'use strict';var emlformat=require(_0x504f('0x0'));var rimraf=require(_0x504f('0x1'));var zipdir=require(_0x504f('0x2'));var jsonpatch=require(_0x504f('0x3'));var rp=require(_0x504f('0x4'));var moment=require('moment');var BPromise=require(_0x504f('0x5'));var Mustache=require(_0x504f('0x6'));var util=require('util');var path=require(_0x504f('0x7'));var sox=require(_0x504f('0x8'));var csv=require(_0x504f('0x9'));var ejs=require(_0x504f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x504f('0xb'));var squel=require('squel');var crypto=require(_0x504f('0xc'));var jsforce=require(_0x504f('0xd'));var deskjs=require(_0x504f('0xe'));var toCsv=require(_0x504f('0x9'));var querystring=require(_0x504f('0xf'));var Papa=require(_0x504f('0x10'));var Redis=require(_0x504f('0x11'));var authService=require(_0x504f('0x12'));var qs=require(_0x504f('0x13'));var as=require(_0x504f('0x14'));var hardwareService=require(_0x504f('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x504f('0x16'));var config=require(_0x504f('0x17'));var licenseUtil=require(_0x504f('0x18'));var db=require(_0x504f('0x19'))['db'];function respondWithStatusCode(_0x38d3a5,_0x1d494d){_0x1d494d=_0x1d494d||0xcc;return function(_0x2946bc){if(_0x2946bc){return _0x38d3a5[_0x504f('0x1a')](_0x1d494d);}return _0x38d3a5[_0x504f('0x1b')](_0x1d494d)[_0x504f('0x1c')]();};}function respondWithResult(_0xcf1606,_0x1a3cdc){_0x1a3cdc=_0x1a3cdc||0xc8;return function(_0x373a63){if(_0x373a63){return _0xcf1606[_0x504f('0x1b')](_0x1a3cdc)['json'](_0x373a63);}};}function respondWithFilteredResult(_0x33fae6,_0x2a4e17){return function(_0x2dec1a){if(_0x2dec1a){var _0x2bdac5=typeof _0x2a4e17[_0x504f('0x1d')]===_0x504f('0x1e')&&typeof _0x2a4e17[_0x504f('0x1f')]===_0x504f('0x1e');var _0x317da9=_0x2dec1a['count'];var _0x598c57=_0x2bdac5?0x0:_0x2a4e17['offset'];var _0xdce25b=_0x2bdac5?_0x2dec1a[_0x504f('0x20')]:_0x2a4e17[_0x504f('0x1d')]+_0x2a4e17['limit'];var _0x2b3c0b;if(_0xdce25b>=_0x317da9){_0xdce25b=_0x317da9;_0x2b3c0b=0xc8;}else{_0x2b3c0b=0xce;}_0x33fae6[_0x504f('0x1b')](_0x2b3c0b);return _0x33fae6['set'](_0x504f('0x21'),_0x598c57+'-'+_0xdce25b+'/'+_0x317da9)['json'](_0x2dec1a);}return null;};}function patchUpdates(_0x45a1a7){return function(_0x51dc54){try{jsonpatch[_0x504f('0x22')](_0x51dc54,_0x45a1a7,!![]);}catch(_0x45e47e){return BPromise[_0x504f('0x23')](_0x45e47e);}return _0x51dc54[_0x504f('0x24')]();};}function saveUpdates(_0xcb7c72,_0x3df5d7){return function(_0x2d32fb){if(_0x2d32fb){return _0x2d32fb[_0x504f('0x25')](_0xcb7c72)['then'](function(_0x499cd5){return _0x499cd5;});}return null;};}function removeEntity(_0x2a89e4,_0x31db03){return function(_0xd33db6){if(_0xd33db6){return _0xd33db6[_0x504f('0x26')]()['then'](function(){_0x2a89e4[_0x504f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502f2d,_0x39b3e0){return function(_0x319db2){if(!_0x319db2){_0x502f2d[_0x504f('0x1a')](0x194);}return _0x319db2;};}function handleError(_0x5e1051,_0x57a0af){_0x57a0af=_0x57a0af||0x1f4;return function(_0xaa39b6){logger[_0x504f('0x27')](_0xaa39b6[_0x504f('0x28')]);if(_0xaa39b6['name']){delete _0xaa39b6[_0x504f('0x29')];}_0x5e1051[_0x504f('0x1b')](_0x57a0af)[_0x504f('0x2a')](_0xaa39b6);};}exports[_0x504f('0x2b')]=function(_0x1c59db,_0x24d37e){var _0x4d947c={},_0x3dcbe4={},_0x28577a={'count':0x0,'rows':[]};var _0x271f8b=_[_0x504f('0x2c')](db[_0x504f('0x2d')][_0x504f('0x2e')],function(_0x7e0563){return{'name':_0x7e0563[_0x504f('0x2f')],'type':_0x7e0563[_0x504f('0x30')][_0x504f('0x31')]};});_0x3dcbe4['model']=_['map'](_0x271f8b,_0x504f('0x29'));_0x3dcbe4[_0x504f('0x32')]=_[_0x504f('0x33')](_0x1c59db[_0x504f('0x32')]);_0x3dcbe4[_0x504f('0x34')]=_[_0x504f('0x35')](_0x3dcbe4['model'],_0x3dcbe4['query']);_0x4d947c[_0x504f('0x36')]=_[_0x504f('0x35')](_0x3dcbe4[_0x504f('0x37')],qs[_0x504f('0x38')](_0x1c59db['query'][_0x504f('0x38')]));_0x4d947c['attributes']=_0x4d947c[_0x504f('0x36')]['length']?_0x4d947c['attributes']:_0x3dcbe4['model'];if(!_0x1c59db['query'][_0x504f('0x39')](_0x504f('0x3a'))){_0x4d947c['limit']=qs[_0x504f('0x1f')](_0x1c59db[_0x504f('0x32')]['limit']);_0x4d947c[_0x504f('0x1d')]=qs[_0x504f('0x1d')](_0x1c59db[_0x504f('0x32')]['offset']);}_0x4d947c['order']=qs[_0x504f('0x3b')](_0x1c59db['query'][_0x504f('0x3b')]);_0x4d947c[_0x504f('0x3c')]=qs[_0x504f('0x34')](_[_0x504f('0x3d')](_0x1c59db['query'],_0x3dcbe4['filters']),_0x271f8b);if(_0x1c59db[_0x504f('0x32')][_0x504f('0x3e')]){_0x4d947c[_0x504f('0x3c')]=_[_0x504f('0x3f')](_0x4d947c[_0x504f('0x3c')],{'$or':_['map'](_0x271f8b,function(_0x3350db){if(_0x3350db['type']!==_0x504f('0x40')){var _0x4f173a={};_0x4f173a[_0x3350db['name']]={'$like':'%'+_0x1c59db[_0x504f('0x32')][_0x504f('0x3e')]+'%'};return _0x4f173a;}})});}_0x4d947c=_[_0x504f('0x3f')]({},_0x4d947c,_0x1c59db['options']);var _0xfc5420={'where':_0x4d947c[_0x504f('0x3c')]};return db[_0x504f('0x2d')]['count'](_0xfc5420)[_0x504f('0x41')](function(_0x3f3fb6){_0x28577a[_0x504f('0x20')]=_0x3f3fb6;if(_0x1c59db[_0x504f('0x32')][_0x504f('0x42')]){_0x4d947c[_0x504f('0x43')]=[{'all':!![]}];}return db[_0x504f('0x2d')][_0x504f('0x44')](_0x4d947c);})['then'](function(_0x24b908){_0x28577a['rows']=_0x24b908;return _0x28577a;})[_0x504f('0x41')](respondWithFilteredResult(_0x24d37e,_0x4d947c))[_0x504f('0x45')](handleError(_0x24d37e,null));}; \ No newline at end of file +var _0x7243=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','index','Migration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0xe9c15a,_0x128c1c){var _0x3b543b=function(_0x435fc4){while(--_0x435fc4){_0xe9c15a['push'](_0xe9c15a['shift']());}};_0x3b543b(++_0x128c1c);}(_0x7243,0x7d));var _0x3724=function(_0x5e8220,_0x57de05){_0x5e8220=_0x5e8220-0x0;var _0x25884f=_0x7243[_0x5e8220];return _0x25884f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3724('0x0'));var zipdir=require(_0x3724('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3724('0x2'));var BPromise=require(_0x3724('0x3'));var Mustache=require(_0x3724('0x4'));var util=require(_0x3724('0x5'));var path=require(_0x3724('0x6'));var sox=require('sox');var csv=require(_0x3724('0x7'));var ejs=require(_0x3724('0x8'));var fs=require('fs');var fs_extra=require(_0x3724('0x9'));var _=require(_0x3724('0xa'));var squel=require(_0x3724('0xb'));var crypto=require(_0x3724('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3724('0xd'));var toCsv=require(_0x3724('0x7'));var querystring=require(_0x3724('0xe'));var Papa=require(_0x3724('0xf'));var Redis=require(_0x3724('0x10'));var authService=require(_0x3724('0x11'));var qs=require(_0x3724('0x12'));var as=require(_0x3724('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3724('0x14'))(_0x3724('0x15'));var utils=require(_0x3724('0x16'));var config=require(_0x3724('0x17'));var licenseUtil=require(_0x3724('0x18'));var db=require(_0x3724('0x19'))['db'];function respondWithStatusCode(_0x215755,_0x1625f3){_0x1625f3=_0x1625f3||0xcc;return function(_0x245837){if(_0x245837){return _0x215755[_0x3724('0x1a')](_0x1625f3);}return _0x215755['status'](_0x1625f3)['end']();};}function respondWithResult(_0x1b2604,_0x5b1495){_0x5b1495=_0x5b1495||0xc8;return function(_0x4ad4ec){if(_0x4ad4ec){return _0x1b2604[_0x3724('0x1b')](_0x5b1495)[_0x3724('0x1c')](_0x4ad4ec);}};}function respondWithFilteredResult(_0x44a4e3,_0x1c7741){return function(_0x4b0ae7){if(_0x4b0ae7){var _0x451869=typeof _0x1c7741[_0x3724('0x1d')]===_0x3724('0x1e')&&typeof _0x1c7741[_0x3724('0x1f')]===_0x3724('0x1e');var _0x1db760=_0x4b0ae7[_0x3724('0x20')];var _0x22a104=_0x451869?0x0:_0x1c7741[_0x3724('0x1d')];var _0x3a706e=_0x451869?_0x4b0ae7['count']:_0x1c7741['offset']+_0x1c7741[_0x3724('0x1f')];var _0x39322d;if(_0x3a706e>=_0x1db760){_0x3a706e=_0x1db760;_0x39322d=0xc8;}else{_0x39322d=0xce;}_0x44a4e3['status'](_0x39322d);return _0x44a4e3[_0x3724('0x21')](_0x3724('0x22'),_0x22a104+'-'+_0x3a706e+'/'+_0x1db760)[_0x3724('0x1c')](_0x4b0ae7);}return null;};}function patchUpdates(_0x35f85d){return function(_0x1d092e){try{jsonpatch[_0x3724('0x23')](_0x1d092e,_0x35f85d,!![]);}catch(_0x4a286f){return BPromise[_0x3724('0x24')](_0x4a286f);}return _0x1d092e[_0x3724('0x25')]();};}function saveUpdates(_0x39ef73,_0x1399fd){return function(_0x5c97a8){if(_0x5c97a8){return _0x5c97a8[_0x3724('0x26')](_0x39ef73)['then'](function(_0x5dce07){return _0x5dce07;});}return null;};}function removeEntity(_0xaf709b,_0x1703ce){return function(_0x4cc0e9){if(_0x4cc0e9){return _0x4cc0e9[_0x3724('0x27')]()[_0x3724('0x28')](function(){_0xaf709b[_0x3724('0x1b')](0xcc)[_0x3724('0x29')]();});}};}function handleEntityNotFound(_0x4785d2,_0x3b7cac){return function(_0x4a0c2f){if(!_0x4a0c2f){_0x4785d2['sendStatus'](0x194);}return _0x4a0c2f;};}function handleError(_0x44c80f,_0x1ab474){_0x1ab474=_0x1ab474||0x1f4;return function(_0x5d65be){logger[_0x3724('0x2a')](_0x5d65be[_0x3724('0x2b')]);if(_0x5d65be[_0x3724('0x2c')]){delete _0x5d65be[_0x3724('0x2c')];}_0x44c80f['status'](_0x1ab474)['send'](_0x5d65be);};}exports[_0x3724('0x2d')]=function(_0x119c8c,_0x26e60c){var _0x1da7a8={},_0x4a8f5b={},_0x31140c={'count':0x0,'rows':[]};var _0x2e465b=_['map'](db[_0x3724('0x2e')][_0x3724('0x2f')],function(_0xbf2050){return{'name':_0xbf2050[_0x3724('0x30')],'type':_0xbf2050[_0x3724('0x31')][_0x3724('0x32')]};});_0x4a8f5b[_0x3724('0x33')]=_[_0x3724('0x34')](_0x2e465b,_0x3724('0x2c'));_0x4a8f5b[_0x3724('0x35')]=_[_0x3724('0x36')](_0x119c8c[_0x3724('0x35')]);_0x4a8f5b[_0x3724('0x37')]=_[_0x3724('0x38')](_0x4a8f5b[_0x3724('0x33')],_0x4a8f5b[_0x3724('0x35')]);_0x1da7a8[_0x3724('0x39')]=_[_0x3724('0x38')](_0x4a8f5b['model'],qs[_0x3724('0x3a')](_0x119c8c['query']['fields']));_0x1da7a8['attributes']=_0x1da7a8['attributes'][_0x3724('0x3b')]?_0x1da7a8['attributes']:_0x4a8f5b[_0x3724('0x33')];if(!_0x119c8c[_0x3724('0x35')][_0x3724('0x3c')](_0x3724('0x3d'))){_0x1da7a8['limit']=qs[_0x3724('0x1f')](_0x119c8c[_0x3724('0x35')]['limit']);_0x1da7a8[_0x3724('0x1d')]=qs[_0x3724('0x1d')](_0x119c8c[_0x3724('0x35')][_0x3724('0x1d')]);}_0x1da7a8[_0x3724('0x3e')]=qs[_0x3724('0x3f')](_0x119c8c['query']['sort']);_0x1da7a8[_0x3724('0x40')]=qs[_0x3724('0x37')](_['pick'](_0x119c8c[_0x3724('0x35')],_0x4a8f5b[_0x3724('0x37')]),_0x2e465b);if(_0x119c8c['query'][_0x3724('0x41')]){_0x1da7a8[_0x3724('0x40')]=_['merge'](_0x1da7a8['where'],{'$or':_[_0x3724('0x34')](_0x2e465b,function(_0x5db868){if(_0x5db868[_0x3724('0x31')]!==_0x3724('0x42')){var _0x2afe2d={};_0x2afe2d[_0x5db868['name']]={'$like':'%'+_0x119c8c['query'][_0x3724('0x41')]+'%'};return _0x2afe2d;}})});}_0x1da7a8=_[_0x3724('0x43')]({},_0x1da7a8,_0x119c8c[_0x3724('0x44')]);var _0x4b7cbf={'where':_0x1da7a8[_0x3724('0x40')]};return db[_0x3724('0x2e')]['count'](_0x4b7cbf)[_0x3724('0x28')](function(_0x15cb34){_0x31140c['count']=_0x15cb34;if(_0x119c8c[_0x3724('0x35')]['includeAll']){_0x1da7a8[_0x3724('0x45')]=[{'all':!![]}];}return db['Migration'][_0x3724('0x46')](_0x1da7a8);})[_0x3724('0x28')](function(_0x8df92){_0x31140c[_0x3724('0x47')]=_0x8df92;return _0x31140c;})['then'](respondWithFilteredResult(_0x26e60c,_0x1da7a8))[_0x3724('0x48')](handleError(_0x26e60c,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a8129d5..da8975b 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 _0xdb42=['request-promise','path','rimraf','../../config/environment','./migration.attributes','define','Migration','migrations','lodash','util','../../config/logger','api','moment'];(function(_0x310a5f,_0x2bcecd){var _0xade9b=function(_0x7faa46){while(--_0x7faa46){_0x310a5f['push'](_0x310a5f['shift']());}};_0xade9b(++_0x2bcecd);}(_0xdb42,0x126));var _0x2db4=function(_0x8fd8d7,_0x377249){_0x8fd8d7=_0x8fd8d7-0x0;var _0x1e3503=_0xdb42[_0x8fd8d7];return _0x1e3503;};'use strict';var _=require(_0x2db4('0x0'));var util=require(_0x2db4('0x1'));var logger=require(_0x2db4('0x2'))(_0x2db4('0x3'));var moment=require(_0x2db4('0x4'));var BPromise=require('bluebird');var rp=require(_0x2db4('0x5'));var fs=require('fs');var path=require(_0x2db4('0x6'));var rimraf=require(_0x2db4('0x7'));var config=require(_0x2db4('0x8'));var attributes=require(_0x2db4('0x9'));module['exports']=function(_0x2ef57d,_0x18db6b){return _0x2ef57d[_0x2db4('0xa')](_0x2db4('0xb'),attributes,{'tableName':_0x2db4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1253=['exports','define','Migration','migrations','lodash','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x351663,_0x11ccc8){var _0x27df4d=function(_0x360242){while(--_0x360242){_0x351663['push'](_0x351663['shift']());}};_0x27df4d(++_0x11ccc8);}(_0x1253,0x108));var _0x3125=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1253[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3125('0x0'));var util=require('util');var logger=require(_0x3125('0x1'))(_0x3125('0x2'));var moment=require(_0x3125('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3125('0x4'));var config=require(_0x3125('0x5'));var attributes=require('./migration.attributes');module[_0x3125('0x6')]=function(_0x30c028,_0x5a864b){return _0x30c028[_0x3125('0x7')](_0x3125('0x8'),attributes,{'tableName':_0x3125('0x9'),'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 3df4336..2c9f127 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 _0xaa2d=['../../config/environment','jayson/promise','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x443246,_0x199405){var _0xf91625=function(_0x6c01ff){while(--_0x6c01ff){_0x443246['push'](_0x443246['shift']());}};_0xf91625(++_0x199405);}(_0xaa2d,0x11c));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xdaa2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaa2('0x1'));var db=require(_0xdaa2('0x2'))['db'];var utils=require(_0xdaa2('0x3'));var logger=require('../../config/logger')(_0xdaa2('0x4'));var config=require(_0xdaa2('0x5'));var jayson=require(_0xdaa2('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2422ff,_0x4ca453,_0x2e2af4){return new BPromise(function(_0x2b3589,_0x259599){return client['request'](_0x2422ff,_0x2e2af4)[_0xdaa2('0x7')](function(_0x4437cc){logger[_0xdaa2('0x8')](_0xdaa2('0x9'),_0x4ca453,_0xdaa2('0xa'));logger[_0xdaa2('0xb')]('Migration,\x20%s,\x20%s,\x20%s',_0x4ca453,'request\x20sent',JSON[_0xdaa2('0xc')](_0x4437cc));if(_0x4437cc['error']){if(_0x4437cc['error']['code']===0x1f4){logger[_0xdaa2('0xd')](_0xdaa2('0x9'),_0x4ca453,_0x4437cc['error'][_0xdaa2('0xe')]);return _0x259599(_0x4437cc[_0xdaa2('0xd')][_0xdaa2('0xe')]);}logger[_0xdaa2('0xd')](_0xdaa2('0x9'),_0x4ca453,_0x4437cc[_0xdaa2('0xd')][_0xdaa2('0xe')]);return _0x2b3589(_0x4437cc[_0xdaa2('0xd')][_0xdaa2('0xe')]);}else{logger[_0xdaa2('0x8')](_0xdaa2('0x9'),_0x4ca453,_0xdaa2('0xa'));_0x2b3589(_0x4437cc[_0xdaa2('0xf')][_0xdaa2('0xe')]);}})[_0xdaa2('0x10')](function(_0x14fe3c){logger['error'](_0xdaa2('0x9'),_0x4ca453,_0x14fe3c);_0x259599(_0x14fe3c);});});} \ No newline at end of file +var _0x834d=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util'];(function(_0x592b4c,_0x48291b){var _0x234b5b=function(_0x180d62){while(--_0x180d62){_0x592b4c['push'](_0x592b4c['shift']());}};_0x234b5b(++_0x48291b);}(_0x834d,0x140));var _0xd834=function(_0x49a90e,_0x5a0ee5){_0x49a90e=_0x49a90e-0x0;var _0x306a1b=_0x834d[_0x49a90e];return _0x306a1b;};'use strict';var _=require(_0xd834('0x0'));var util=require(_0xd834('0x1'));var moment=require('moment');var BPromise=require(_0xd834('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd834('0x3'))['db'];var utils=require(_0xd834('0x4'));var logger=require(_0xd834('0x5'))(_0xd834('0x6'));var config=require('../../config/environment');var jayson=require(_0xd834('0x7'));var client=jayson[_0xd834('0x8')][_0xd834('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42623d,_0x28907e,_0x256853){return new BPromise(function(_0x51c989,_0x6ab9ae){return client[_0xd834('0xa')](_0x42623d,_0x256853)[_0xd834('0xb')](function(_0x52ad61){logger[_0xd834('0xc')](_0xd834('0xd'),_0x28907e,'request\x20sent');logger[_0xd834('0xe')](_0xd834('0xf'),_0x28907e,'request\x20sent',JSON[_0xd834('0x10')](_0x52ad61));if(_0x52ad61[_0xd834('0x11')]){if(_0x52ad61[_0xd834('0x11')][_0xd834('0x12')]===0x1f4){logger[_0xd834('0x11')](_0xd834('0xd'),_0x28907e,_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);return _0x6ab9ae(_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);}logger[_0xd834('0x11')]('Migration,\x20%s,\x20%s',_0x28907e,_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);return _0x51c989(_0x52ad61[_0xd834('0x11')]['message']);}else{logger[_0xd834('0xc')](_0xd834('0xd'),_0x28907e,_0xd834('0x14'));_0x51c989(_0x52ad61[_0xd834('0x15')]['message']);}})[_0xd834('0x16')](function(_0x32d8c7){logger[_0xd834('0x11')](_0xd834('0xd'),_0x28907e,_0x32d8c7);_0x6ab9ae(_0x32d8c7);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index b42f9d7..b678675 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 _0x14a0=['../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x14a0,0x109));var _0x014a=function(_0x16a2d0,_0x428248){_0x16a2d0=_0x16a2d0-0x0;var _0x453d43=_0x14a0[_0x16a2d0];return _0x453d43;};'use strict';var multer=require(_0x014a('0x0'));var util=require(_0x014a('0x1'));var path=require(_0x014a('0x2'));var timeout=require(_0x014a('0x3'));var express=require(_0x014a('0x4'));var router=express[_0x014a('0x5')]();var fs_extra=require(_0x014a('0x6'));var auth=require(_0x014a('0x7'));var interaction=require(_0x014a('0x8'));var config=require('../../config/environment');var controller=require(_0x014a('0x9'));router[_0x014a('0xa')]('/',auth['isAuthenticated'](),controller[_0x014a('0xb')]);router[_0x014a('0xa')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0xe')]);router['post']('/',auth[_0x014a('0xd')](),controller[_0x014a('0xf')]);router[_0x014a('0x10')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')](_0x014a('0xc'),auth[_0x014a('0xd')](),controller[_0x014a('0x13')]);module[_0x014a('0x14')]=router; \ No newline at end of file +var _0x090a=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x090a,0x133));var _0xa090=function(_0x4cf321,_0x4ffb60){_0x4cf321=_0x4cf321-0x0;var _0x2f52f4=_0x090a[_0x4cf321];return _0x2f52f4;};'use strict';var multer=require(_0xa090('0x0'));var util=require(_0xa090('0x1'));var path=require('path');var timeout=require(_0xa090('0x2'));var express=require(_0xa090('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa090('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa090('0x5'));var controller=require(_0xa090('0x6'));router[_0xa090('0x7')]('/',auth[_0xa090('0x8')](),controller[_0xa090('0x9')]);router[_0xa090('0x7')](_0xa090('0xa'),auth[_0xa090('0x8')](),controller[_0xa090('0xb')]);router[_0xa090('0xc')]('/',auth[_0xa090('0x8')](),controller[_0xa090('0xd')]);router[_0xa090('0xe')](_0xa090('0xa'),auth[_0xa090('0x8')](),controller[_0xa090('0xf')]);router['delete'](_0xa090('0xa'),auth['isAuthenticated'](),controller[_0xa090('0x10')]);module[_0xa090('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 2a88a70..5b36d99 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 _0x6af0=['sequelize','exports','localnet','externip','stun','turn','STRING'];(function(_0x259a42,_0x2b4483){var _0x548d68=function(_0x47656e){while(--_0x47656e){_0x259a42['push'](_0x259a42['shift']());}};_0x548d68(++_0x2b4483);}(_0x6af0,0x134));var _0x06af=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x6af0[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0x06af('0x0'));module[_0x06af('0x1')]={'type':{'type':Sequelize['ENUM'](_0x06af('0x2'),_0x06af('0x3'),_0x06af('0x4'),_0x06af('0x5'))},'value':{'type':Sequelize[_0x06af('0x6')]},'username':{'type':Sequelize[_0x06af('0x6')]},'password':{'type':Sequelize[_0x06af('0x6')]}}; \ No newline at end of file +var _0xfe35=['stun','STRING','sequelize','exports','ENUM','localnet'];(function(_0x3daf40,_0x47b829){var _0x1f0082=function(_0x4fcb81){while(--_0x4fcb81){_0x3daf40['push'](_0x3daf40['shift']());}};_0x1f0082(++_0x47b829);}(_0xfe35,0x188));var _0x5fe3=function(_0x43b506,_0x14e1dd){_0x43b506=_0x43b506-0x0;var _0x451df2=_0xfe35[_0x43b506];return _0x451df2;};'use strict';var Sequelize=require(_0x5fe3('0x0'));module[_0x5fe3('0x1')]={'type':{'type':Sequelize[_0x5fe3('0x2')](_0x5fe3('0x3'),'externip',_0x5fe3('0x4'),'turn')},'value':{'type':Sequelize[_0x5fe3('0x5')]},'username':{'type':Sequelize[_0x5fe3('0x5')]},'password':{'type':Sequelize[_0x5fe3('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 655ee78..5c2d468 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 _0x3f25=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','render','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','server/files/templates/network.ejs','format','server/files/templates/turn_multiple.ejs','path','lodash','../../components/parsers/qs','api','jayson/promise','client','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','destroy','end','stack','name','Network','fieldName','type','model','map','query','filters','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f25,0x1b4));var _0x53f2=function(_0x2846cc,_0x12b673){_0x2846cc=_0x2846cc-0x0;var _0x58cd2a=_0x3f25[_0x2846cc];return _0x58cd2a;};'use strict';var util=require('util');var path=require(_0x53f2('0x0'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x53f2('0x1'));var qs=require(_0x53f2('0x2'));var logger=require('../../config/logger')(_0x53f2('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x53f2('0x4'));var client=jayson[_0x53f2('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d48de,_0x5a8ab2,_0x288a87,_0x6187fc){return new Promise(function(_0x3b0fea,_0x589ea3){var _0x928421=_0x6187fc||client;return _0x928421[_0x53f2('0x6')](_0x4d48de,_0x288a87)[_0x53f2('0x7')](function(_0x784bcf){logger['info'](_0x53f2('0x8'),_0x5a8ab2,_0x53f2('0x9'));logger[_0x53f2('0xa')](_0x53f2('0xb'),_0x5a8ab2,_0x53f2('0x9'),JSON['stringify'](_0x784bcf));if(_0x784bcf['error']){if(_0x784bcf[_0x53f2('0xc')][_0x53f2('0xd')]===0x1f4){logger[_0x53f2('0xc')]('Network,\x20%s,\x20%s',_0x5a8ab2,_0x784bcf[_0x53f2('0xc')][_0x53f2('0xe')]);return _0x589ea3(_0x784bcf[_0x53f2('0xc')][_0x53f2('0xe')]);}logger[_0x53f2('0xc')](_0x53f2('0x8'),_0x5a8ab2,_0x784bcf['error'][_0x53f2('0xe')]);return _0x3b0fea(_0x784bcf['error']['message']);}else{logger[_0x53f2('0xf')](_0x53f2('0x8'),_0x5a8ab2,'request\x20sent');_0x3b0fea(_0x784bcf[_0x53f2('0x10')]['message']);}})[_0x53f2('0x11')](function(_0x30daa4){logger[_0x53f2('0xc')](_0x53f2('0x8'),_0x5a8ab2,_0x30daa4);_0x589ea3(_0x30daa4);});});}function respondWithResult(_0x6d8af4,_0x2bf621){_0x2bf621=_0x2bf621||0xc8;return function(_0x4f5c13){if(_0x4f5c13){return _0x6d8af4[_0x53f2('0x12')](_0x2bf621)[_0x53f2('0x13')](_0x4f5c13);}};}function respondWithFilteredResult(_0x45acee,_0x5a5305){return function(_0x208fbc){if(_0x208fbc){var _0xb8da1=typeof _0x5a5305[_0x53f2('0x14')]===_0x53f2('0x15')&&typeof _0x5a5305[_0x53f2('0x16')]==='undefined';var _0x11506e=_0x208fbc[_0x53f2('0x17')];var _0x400819=_0xb8da1?0x0:_0x5a5305['offset'];var _0x48751e=_0xb8da1?_0x208fbc[_0x53f2('0x17')]:_0x5a5305[_0x53f2('0x14')]+_0x5a5305[_0x53f2('0x16')];var _0x79c9d5;if(_0x48751e>=_0x11506e){_0x48751e=_0x11506e;_0x79c9d5=0xc8;}else{_0x79c9d5=0xce;}_0x45acee[_0x53f2('0x12')](_0x79c9d5);return _0x45acee[_0x53f2('0x18')](_0x53f2('0x19'),_0x400819+'-'+_0x48751e+'/'+_0x11506e)[_0x53f2('0x13')](_0x208fbc);}return null;};}function saveUpdates(_0x57b9d2){return function(_0x270e28){if(_0x270e28){return _0x270e28['update'](_0x57b9d2)[_0x53f2('0x7')](function(_0x305fb2){return _0x305fb2;});}return null;};}function removeEntity(_0x5a9aaa){return function(_0x55e02c){if(_0x55e02c){return _0x55e02c[_0x53f2('0x1a')]()[_0x53f2('0x7')](function(){_0x5a9aaa[_0x53f2('0x12')](0xcc)[_0x53f2('0x1b')]();});}};}function handleEntityNotFound(_0xcb6735){return function(_0x1a4c07){if(!_0x1a4c07){_0xcb6735['sendStatus'](0x194);}return _0x1a4c07;};}function handleError(_0x369aad,_0x3fd55){_0x3fd55=_0x3fd55||0x1f4;return function(_0x83a32e){logger['error'](_0x83a32e[_0x53f2('0x1c')]);if(_0x83a32e[_0x53f2('0x1d')]){delete _0x83a32e['name'];}_0x369aad[_0x53f2('0x12')](_0x3fd55)['send'](_0x83a32e);};}exports['index']=function(_0x9243cc,_0x5c26be){var _0x4be84c={},_0x13ab22={},_0x373bc0={'count':0x0,'rows':[]};var _0x47fb46=_['map'](db[_0x53f2('0x1e')]['rawAttributes'],function(_0x473d39){return{'name':_0x473d39[_0x53f2('0x1f')],'type':_0x473d39[_0x53f2('0x20')]['key']};});_0x13ab22[_0x53f2('0x21')]=_[_0x53f2('0x22')](_0x47fb46,_0x53f2('0x1d'));_0x13ab22[_0x53f2('0x23')]=_['keys'](_0x9243cc[_0x53f2('0x23')]);_0x13ab22[_0x53f2('0x24')]=_[_0x53f2('0x25')](_0x13ab22[_0x53f2('0x21')],_0x13ab22[_0x53f2('0x23')]);_0x4be84c[_0x53f2('0x26')]=_['intersection'](_0x13ab22[_0x53f2('0x21')],qs[_0x53f2('0x27')](_0x9243cc[_0x53f2('0x23')]['fields']));_0x4be84c[_0x53f2('0x26')]=_0x4be84c['attributes'][_0x53f2('0x28')]?_0x4be84c[_0x53f2('0x26')]:_0x13ab22[_0x53f2('0x21')];if(!_0x9243cc[_0x53f2('0x23')][_0x53f2('0x29')](_0x53f2('0x2a'))){_0x4be84c[_0x53f2('0x16')]=qs[_0x53f2('0x16')](_0x9243cc[_0x53f2('0x23')][_0x53f2('0x16')]);_0x4be84c['offset']=qs[_0x53f2('0x14')](_0x9243cc['query'][_0x53f2('0x14')]);}_0x4be84c['order']=qs[_0x53f2('0x2b')](_0x9243cc[_0x53f2('0x23')][_0x53f2('0x2b')]);_0x4be84c[_0x53f2('0x2c')]=qs['filters'](_[_0x53f2('0x2d')](_0x9243cc[_0x53f2('0x23')],_0x13ab22['filters']),_0x47fb46);if(_0x9243cc[_0x53f2('0x23')]['filter']){_0x4be84c['where']=_['merge'](_0x4be84c[_0x53f2('0x2c')],{'$or':_[_0x53f2('0x22')](_0x47fb46,function(_0x43bda4){if(_0x43bda4[_0x53f2('0x20')]!=='VIRTUAL'){var _0x2499ba={};_0x2499ba[_0x43bda4[_0x53f2('0x1d')]]={'$like':'%'+_0x9243cc[_0x53f2('0x23')][_0x53f2('0x2e')]+'%'};return _0x2499ba;}})});}_0x4be84c=_[_0x53f2('0x2f')]({},_0x4be84c,_0x9243cc['options']);var _0x27c0c0={'where':_0x4be84c[_0x53f2('0x2c')]};return db[_0x53f2('0x1e')][_0x53f2('0x17')](_0x27c0c0)['then'](function(_0x3f437d){_0x373bc0[_0x53f2('0x17')]=_0x3f437d;if(_0x9243cc[_0x53f2('0x23')][_0x53f2('0x30')]){_0x4be84c[_0x53f2('0x31')]=[{'all':!![]}];}return db[_0x53f2('0x1e')][_0x53f2('0x32')](_0x4be84c);})[_0x53f2('0x7')](function(_0x53c798){_0x373bc0[_0x53f2('0x33')]=_0x53c798;return _0x373bc0;})[_0x53f2('0x7')](respondWithFilteredResult(_0x5c26be,_0x4be84c))[_0x53f2('0x11')](handleError(_0x5c26be,null));};exports[_0x53f2('0x34')]=function(_0x1a2a07,_0x5b1649){var _0x4a50b5={'raw':!![],'where':{'id':_0x1a2a07[_0x53f2('0x35')]['id']}},_0x184dd6={};_0x184dd6[_0x53f2('0x21')]=_['keys'](db[_0x53f2('0x1e')][_0x53f2('0x36')]);_0x184dd6[_0x53f2('0x23')]=_['keys'](_0x1a2a07[_0x53f2('0x23')]);_0x184dd6[_0x53f2('0x24')]=_[_0x53f2('0x25')](_0x184dd6['model'],_0x184dd6[_0x53f2('0x23')]);_0x4a50b5[_0x53f2('0x26')]=_[_0x53f2('0x25')](_0x184dd6['model'],qs[_0x53f2('0x27')](_0x1a2a07[_0x53f2('0x23')][_0x53f2('0x27')]));_0x4a50b5[_0x53f2('0x26')]=_0x4a50b5['attributes'][_0x53f2('0x28')]?_0x4a50b5[_0x53f2('0x26')]:_0x184dd6[_0x53f2('0x21')];if(_0x1a2a07[_0x53f2('0x23')]['includeAll']){_0x4a50b5['include']=[{'all':!![]}];}_0x4a50b5=_[_0x53f2('0x2f')]({},_0x4a50b5,_0x1a2a07['options']);return db['Network'][_0x53f2('0x37')](_0x4a50b5)[_0x53f2('0x7')](handleEntityNotFound(_0x5b1649,null))['then'](respondWithResult(_0x5b1649,null))[_0x53f2('0x11')](handleError(_0x5b1649,null));};exports[_0x53f2('0x38')]=function(_0x201bc2,_0x3f6cca){var _0x3ec732;return db['Network'][_0x53f2('0x38')](_0x201bc2[_0x53f2('0x39')],{'raw':!![]})[_0x53f2('0x7')](function(_0x1d8b90){_0x3ec732=_0x1d8b90;return db[_0x53f2('0x1e')][_0x53f2('0x32')]({'where':{'type':_0x201bc2[_0x53f2('0x39')][_0x53f2('0x20')]},'raw':!![]});})[_0x53f2('0x7')](function(_0x791015){if(_0x3ec732[_0x53f2('0x20')][_0x53f2('0x3a')]()==_0x53f2('0x3b')){var _0x1f76a8=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],_0x53f2('0x3f')),_0x53f2('0x40'));var _0x3098f4=ejs['render'](_0x1f76a8,{'networks':_0x791015||[]});fs[_0x53f2('0x41')](_0x53f2('0x42'),_0x3098f4);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x38'),{'module':_0x53f2('0x44')});}else if(_0x3ec732[_0x53f2('0x20')]['toUpperCase']()==_0x53f2('0x45')){var _0x317d52=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x53f2('0x40'));var _0x1452c6=ejs[_0x53f2('0x46')](_0x317d52,{'networks':_0x791015||[]});fs[_0x53f2('0x41')](_0x53f2('0x47'),_0x1452c6);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x38'),{'module':_0x53f2('0x44')});}else{var _0x2247e9=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],'server/files/templates/network.ejs'),'utf8');var _0x36dda4=ejs[_0x53f2('0x46')](_0x2247e9,{'networks':_0x791015||[]});fs[_0x53f2('0x41')](util['format'](_0x53f2('0x48'),_0x201bc2[_0x53f2('0x39')][_0x53f2('0x20')][_0x53f2('0x49')]()),_0x36dda4);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x38'),{'module':_0x53f2('0x4a')});}})[_0x53f2('0x7')](function(){return _0x3ec732;})[_0x53f2('0x7')](respondWithResult(_0x3f6cca,0xc9))[_0x53f2('0x11')](handleError(_0x3f6cca,null));};exports['update']=function(_0x22022a,_0x55fbda){var _0x346cbb;return db[_0x53f2('0x1e')]['find']({'where':{'id':_0x22022a[_0x53f2('0x35')]['id']}})[_0x53f2('0x7')](handleEntityNotFound(_0x55fbda,null))[_0x53f2('0x7')](saveUpdates(_0x22022a[_0x53f2('0x39')],null))[_0x53f2('0x7')](function(_0x2ca32d){if(_0x2ca32d){_0x346cbb=_0x2ca32d;return db['Network'][_0x53f2('0x32')]({'where':{'type':_0x346cbb['type']},'raw':!![]});}return null;})[_0x53f2('0x7')](function(_0x2562b2){if(_0x346cbb['type'][_0x53f2('0x3a')]()==_0x53f2('0x3b')){var _0x1e0287=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],_0x53f2('0x3f')),_0x53f2('0x40'));var _0x4fa090=ejs[_0x53f2('0x46')](_0x1e0287,{'networks':_0x2562b2||[]});fs['writeFileSync'](_0x53f2('0x42'),_0x4fa090);return respondWithRpcPromise('Reload',_0x53f2('0x4b'),{'module':_0x53f2('0x44')});}else if(_0x346cbb[_0x53f2('0x20')]['toUpperCase']()==_0x53f2('0x45')){var _0x458a16=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],'server/files/templates/turn_multiple.ejs'),_0x53f2('0x40'));var _0xa62136=ejs[_0x53f2('0x46')](_0x458a16,{'networks':_0x2562b2||[]});fs['writeFileSync'](_0x53f2('0x47'),_0xa62136);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x4b'),{'module':'res_stun_monitor.so'});}else{var _0x4d634b=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config['root'],_0x53f2('0x4c')),'utf8');var _0x119c28=ejs['render'](_0x4d634b,{'networks':_0x2562b2||[]});fs[_0x53f2('0x41')](util[_0x53f2('0x4d')]('/etc/asterisk/sip_xcally_%s.conf',_0x22022a['body'][_0x53f2('0x20')][_0x53f2('0x49')]()),_0x119c28);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x4b'),{'module':'chan_sip.so'});}})[_0x53f2('0x7')](function(_0x4ef944){if(_0x4ef944){return _0x346cbb;}return null;})[_0x53f2('0x7')](respondWithResult(_0x55fbda,null))[_0x53f2('0x11')](handleError(_0x55fbda,null));};exports[_0x53f2('0x1a')]=function(_0x5f1c40,_0x12858f){var _0x6a065e;return db[_0x53f2('0x1e')][_0x53f2('0x37')]({'where':{'id':_0x5f1c40['params']['id']}})['then'](function(_0x29b7cf){_0x6a065e=_0x29b7cf;return _0x29b7cf;})[_0x53f2('0x7')](handleEntityNotFound(_0x12858f,null))['then'](removeEntity(_0x12858f,null))[_0x53f2('0x7')](function(){if(_0x6a065e){return db[_0x53f2('0x1e')][_0x53f2('0x32')]({'where':{'type':_0x6a065e[_0x53f2('0x20')]},'raw':!![]});}})[_0x53f2('0x7')](function(_0x1409a3){if(_0x6a065e[_0x53f2('0x20')][_0x53f2('0x3a')]()=='STUN'){var _0x3ddf64=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],_0x53f2('0x3f')),_0x53f2('0x40'));var _0x164363=ejs['render'](_0x3ddf64,{'networks':_0x1409a3||[]});fs[_0x53f2('0x41')](_0x53f2('0x42'),_0x164363);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x1a'),{'module':_0x53f2('0x44')});}else if(_0x6a065e['type']['toUpperCase']()==_0x53f2('0x45')){var _0x238508=fs[_0x53f2('0x3c')](path[_0x53f2('0x3d')](config[_0x53f2('0x3e')],_0x53f2('0x4e')),_0x53f2('0x40'));var _0x5cbdd6=ejs['render'](_0x238508,{'networks':_0x1409a3||[]});fs[_0x53f2('0x41')](_0x53f2('0x47'),_0x5cbdd6);return respondWithRpcPromise(_0x53f2('0x43'),_0x53f2('0x1a'),{'module':'res_stun_monitor.so'});}else{var _0x487857=fs[_0x53f2('0x3c')](path['join'](config[_0x53f2('0x3e')],_0x53f2('0x4c')),'utf8');var _0x2f0fec=ejs[_0x53f2('0x46')](_0x487857,{'networks':_0x1409a3||[]});fs[_0x53f2('0x41')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x6a065e[_0x53f2('0x20')]['toLowerCase']()),_0x2f0fec);return respondWithRpcPromise('Reload',_0x53f2('0x1a'),{'module':_0x53f2('0x4a')});}})[_0x53f2('0x11')](handleError(_0x12858f,null));}; \ No newline at end of file +var _0x8ba2=['readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','utf8','format','/etc/asterisk/sip_xcally_%s.conf','body','chan_sip.so','toLowerCase','util','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','end','stack','name','send','rawAttributes','type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','Network','findAll','rows','params','options','find','create','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x8ba2,0x1ae));var _0x28ba=function(_0x4ddaca,_0x117ffb){_0x4ddaca=_0x4ddaca-0x0;var _0x2cab62=_0x8ba2[_0x4ddaca];return _0x2cab62;};'use strict';var util=require(_0x28ba('0x0'));var path=require(_0x28ba('0x1'));var ejs=require(_0x28ba('0x2'));var fs=require('fs');var _=require(_0x28ba('0x3'));var qs=require(_0x28ba('0x4'));var logger=require(_0x28ba('0x5'))(_0x28ba('0x6'));var config=require('../../config/environment');var db=require(_0x28ba('0x7'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x28ba('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18d091,_0x1abd69,_0x4d2f92,_0x5af626){return new Promise(function(_0x103b79,_0x1b9ea6){var _0x3584de=_0x5af626||client;return _0x3584de[_0x28ba('0x9')](_0x18d091,_0x4d2f92)[_0x28ba('0xa')](function(_0x1f17bb){logger[_0x28ba('0xb')](_0x28ba('0xc'),_0x1abd69,_0x28ba('0xd'));logger[_0x28ba('0xe')](_0x28ba('0xf'),_0x1abd69,_0x28ba('0xd'),JSON[_0x28ba('0x10')](_0x1f17bb));if(_0x1f17bb['error']){if(_0x1f17bb['error'][_0x28ba('0x11')]===0x1f4){logger[_0x28ba('0x12')](_0x28ba('0xc'),_0x1abd69,_0x1f17bb['error'][_0x28ba('0x13')]);return _0x1b9ea6(_0x1f17bb[_0x28ba('0x12')][_0x28ba('0x13')]);}logger['error']('Network,\x20%s,\x20%s',_0x1abd69,_0x1f17bb[_0x28ba('0x12')]['message']);return _0x103b79(_0x1f17bb[_0x28ba('0x12')][_0x28ba('0x13')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x1abd69,'request\x20sent');_0x103b79(_0x1f17bb['result'][_0x28ba('0x13')]);}})[_0x28ba('0x14')](function(_0x3ffa07){logger['error'](_0x28ba('0xc'),_0x1abd69,_0x3ffa07);_0x1b9ea6(_0x3ffa07);});});}function respondWithResult(_0x347abe,_0xeea684){_0xeea684=_0xeea684||0xc8;return function(_0x31e3f7){if(_0x31e3f7){return _0x347abe['status'](_0xeea684)[_0x28ba('0x15')](_0x31e3f7);}};}function respondWithFilteredResult(_0x41d9f7,_0x3eaaf3){return function(_0x2348c6){if(_0x2348c6){var _0x35cc35=typeof _0x3eaaf3[_0x28ba('0x16')]===_0x28ba('0x17')&&typeof _0x3eaaf3[_0x28ba('0x18')]===_0x28ba('0x17');var _0x3380ca=_0x2348c6['count'];var _0x154e47=_0x35cc35?0x0:_0x3eaaf3[_0x28ba('0x16')];var _0x59ca6b=_0x35cc35?_0x2348c6[_0x28ba('0x19')]:_0x3eaaf3[_0x28ba('0x16')]+_0x3eaaf3[_0x28ba('0x18')];var _0x282f2d;if(_0x59ca6b>=_0x3380ca){_0x59ca6b=_0x3380ca;_0x282f2d=0xc8;}else{_0x282f2d=0xce;}_0x41d9f7[_0x28ba('0x1a')](_0x282f2d);return _0x41d9f7[_0x28ba('0x1b')](_0x28ba('0x1c'),_0x154e47+'-'+_0x59ca6b+'/'+_0x3380ca)[_0x28ba('0x15')](_0x2348c6);}return null;};}function saveUpdates(_0xf106ff){return function(_0x3ab858){if(_0x3ab858){return _0x3ab858[_0x28ba('0x1d')](_0xf106ff)[_0x28ba('0xa')](function(_0x4b1a01){return _0x4b1a01;});}return null;};}function removeEntity(_0x98d638){return function(_0x591d74){if(_0x591d74){return _0x591d74[_0x28ba('0x1e')]()[_0x28ba('0xa')](function(){_0x98d638[_0x28ba('0x1a')](0xcc)[_0x28ba('0x1f')]();});}};}function handleEntityNotFound(_0x423a92){return function(_0x721f71){if(!_0x721f71){_0x423a92['sendStatus'](0x194);}return _0x721f71;};}function handleError(_0x131bd8,_0x6d12e3){_0x6d12e3=_0x6d12e3||0x1f4;return function(_0x163cf1){logger['error'](_0x163cf1[_0x28ba('0x20')]);if(_0x163cf1[_0x28ba('0x21')]){delete _0x163cf1['name'];}_0x131bd8[_0x28ba('0x1a')](_0x6d12e3)[_0x28ba('0x22')](_0x163cf1);};}exports['index']=function(_0x17951e,_0x1feb58){var _0x2d9a4e={},_0x1d44c6={},_0x1f2a23={'count':0x0,'rows':[]};var _0x4a10fc=_['map'](db['Network'][_0x28ba('0x23')],function(_0x175bc0){return{'name':_0x175bc0['fieldName'],'type':_0x175bc0[_0x28ba('0x24')][_0x28ba('0x25')]};});_0x1d44c6[_0x28ba('0x26')]=_[_0x28ba('0x27')](_0x4a10fc,_0x28ba('0x21'));_0x1d44c6[_0x28ba('0x28')]=_[_0x28ba('0x29')](_0x17951e[_0x28ba('0x28')]);_0x1d44c6['filters']=_['intersection'](_0x1d44c6[_0x28ba('0x26')],_0x1d44c6['query']);_0x2d9a4e[_0x28ba('0x2a')]=_[_0x28ba('0x2b')](_0x1d44c6['model'],qs[_0x28ba('0x2c')](_0x17951e[_0x28ba('0x28')]['fields']));_0x2d9a4e[_0x28ba('0x2a')]=_0x2d9a4e['attributes'][_0x28ba('0x2d')]?_0x2d9a4e[_0x28ba('0x2a')]:_0x1d44c6['model'];if(!_0x17951e['query'][_0x28ba('0x2e')]('nolimit')){_0x2d9a4e[_0x28ba('0x18')]=qs[_0x28ba('0x18')](_0x17951e[_0x28ba('0x28')][_0x28ba('0x18')]);_0x2d9a4e[_0x28ba('0x16')]=qs[_0x28ba('0x16')](_0x17951e['query']['offset']);}_0x2d9a4e['order']=qs[_0x28ba('0x2f')](_0x17951e[_0x28ba('0x28')][_0x28ba('0x2f')]);_0x2d9a4e[_0x28ba('0x30')]=qs[_0x28ba('0x31')](_[_0x28ba('0x32')](_0x17951e[_0x28ba('0x28')],_0x1d44c6[_0x28ba('0x31')]),_0x4a10fc);if(_0x17951e['query'][_0x28ba('0x33')]){_0x2d9a4e['where']=_[_0x28ba('0x34')](_0x2d9a4e['where'],{'$or':_['map'](_0x4a10fc,function(_0x552788){if(_0x552788[_0x28ba('0x24')]!==_0x28ba('0x35')){var _0x5e6177={};_0x5e6177[_0x552788[_0x28ba('0x21')]]={'$like':'%'+_0x17951e[_0x28ba('0x28')]['filter']+'%'};return _0x5e6177;}})});}_0x2d9a4e=_[_0x28ba('0x34')]({},_0x2d9a4e,_0x17951e['options']);var _0x127daf={'where':_0x2d9a4e[_0x28ba('0x30')]};return db['Network'][_0x28ba('0x19')](_0x127daf)[_0x28ba('0xa')](function(_0x3455b0){_0x1f2a23[_0x28ba('0x19')]=_0x3455b0;if(_0x17951e[_0x28ba('0x28')][_0x28ba('0x36')]){_0x2d9a4e[_0x28ba('0x37')]=[{'all':!![]}];}return db[_0x28ba('0x38')][_0x28ba('0x39')](_0x2d9a4e);})[_0x28ba('0xa')](function(_0x1cf7a9){_0x1f2a23[_0x28ba('0x3a')]=_0x1cf7a9;return _0x1f2a23;})[_0x28ba('0xa')](respondWithFilteredResult(_0x1feb58,_0x2d9a4e))[_0x28ba('0x14')](handleError(_0x1feb58,null));};exports['show']=function(_0x45239d,_0x3fe3c2){var _0x117c29={'raw':!![],'where':{'id':_0x45239d[_0x28ba('0x3b')]['id']}},_0x312cf7={};_0x312cf7['model']=_[_0x28ba('0x29')](db['Network'][_0x28ba('0x23')]);_0x312cf7[_0x28ba('0x28')]=_['keys'](_0x45239d['query']);_0x312cf7['filters']=_[_0x28ba('0x2b')](_0x312cf7[_0x28ba('0x26')],_0x312cf7[_0x28ba('0x28')]);_0x117c29[_0x28ba('0x2a')]=_[_0x28ba('0x2b')](_0x312cf7[_0x28ba('0x26')],qs[_0x28ba('0x2c')](_0x45239d[_0x28ba('0x28')]['fields']));_0x117c29[_0x28ba('0x2a')]=_0x117c29['attributes']['length']?_0x117c29[_0x28ba('0x2a')]:_0x312cf7[_0x28ba('0x26')];if(_0x45239d[_0x28ba('0x28')][_0x28ba('0x36')]){_0x117c29[_0x28ba('0x37')]=[{'all':!![]}];}_0x117c29=_['merge']({},_0x117c29,_0x45239d[_0x28ba('0x3c')]);return db[_0x28ba('0x38')][_0x28ba('0x3d')](_0x117c29)[_0x28ba('0xa')](handleEntityNotFound(_0x3fe3c2,null))['then'](respondWithResult(_0x3fe3c2,null))[_0x28ba('0x14')](handleError(_0x3fe3c2,null));};exports[_0x28ba('0x3e')]=function(_0x52f58c,_0x479a76){var _0x5389f2;return db[_0x28ba('0x38')][_0x28ba('0x3e')](_0x52f58c['body'],{'raw':!![]})[_0x28ba('0xa')](function(_0x1d10e7){_0x5389f2=_0x1d10e7;return db['Network'][_0x28ba('0x39')]({'where':{'type':_0x52f58c['body'][_0x28ba('0x24')]},'raw':!![]});})[_0x28ba('0xa')](function(_0x50e8a1){if(_0x5389f2[_0x28ba('0x24')][_0x28ba('0x3f')]()==_0x28ba('0x40')){var _0x3e7e3a=fs['readFileSync'](path[_0x28ba('0x41')](config[_0x28ba('0x42')],_0x28ba('0x43')),'utf8');var _0xd49825=ejs[_0x28ba('0x44')](_0x3e7e3a,{'networks':_0x50e8a1||[]});fs[_0x28ba('0x45')](_0x28ba('0x46'),_0xd49825);return respondWithRpcPromise(_0x28ba('0x47'),_0x28ba('0x3e'),{'module':_0x28ba('0x48')});}else if(_0x5389f2[_0x28ba('0x24')]['toUpperCase']()==_0x28ba('0x49')){var _0x4a4d4f=fs[_0x28ba('0x4a')](path[_0x28ba('0x41')](config['root'],_0x28ba('0x4b')),'utf8');var _0x389867=ejs['render'](_0x4a4d4f,{'networks':_0x50e8a1||[]});fs['writeFileSync'](_0x28ba('0x4c'),_0x389867);return respondWithRpcPromise(_0x28ba('0x47'),_0x28ba('0x3e'),{'module':_0x28ba('0x48')});}else{var _0x4b9beb=fs[_0x28ba('0x4a')](path[_0x28ba('0x41')](config[_0x28ba('0x42')],_0x28ba('0x4d')),_0x28ba('0x4e'));var _0x3e58a9=ejs[_0x28ba('0x44')](_0x4b9beb,{'networks':_0x50e8a1||[]});fs[_0x28ba('0x45')](util[_0x28ba('0x4f')](_0x28ba('0x50'),_0x52f58c[_0x28ba('0x51')][_0x28ba('0x24')]['toLowerCase']()),_0x3e58a9);return respondWithRpcPromise(_0x28ba('0x47'),_0x28ba('0x3e'),{'module':_0x28ba('0x52')});}})[_0x28ba('0xa')](function(){return _0x5389f2;})[_0x28ba('0xa')](respondWithResult(_0x479a76,0xc9))['catch'](handleError(_0x479a76,null));};exports['update']=function(_0x3df049,_0x9f578){var _0x17970f;return db[_0x28ba('0x38')]['find']({'where':{'id':_0x3df049[_0x28ba('0x3b')]['id']}})['then'](handleEntityNotFound(_0x9f578,null))[_0x28ba('0xa')](saveUpdates(_0x3df049[_0x28ba('0x51')],null))[_0x28ba('0xa')](function(_0x467cca){if(_0x467cca){_0x17970f=_0x467cca;return db['Network'][_0x28ba('0x39')]({'where':{'type':_0x17970f[_0x28ba('0x24')]},'raw':!![]});}return null;})[_0x28ba('0xa')](function(_0x24762b){if(_0x17970f[_0x28ba('0x24')][_0x28ba('0x3f')]()==_0x28ba('0x40')){var _0x169991=fs[_0x28ba('0x4a')](path[_0x28ba('0x41')](config[_0x28ba('0x42')],_0x28ba('0x43')),'utf8');var _0x493060=ejs[_0x28ba('0x44')](_0x169991,{'networks':_0x24762b||[]});fs[_0x28ba('0x45')]('/etc/asterisk/stun_xcally.conf',_0x493060);return respondWithRpcPromise('Reload',_0x28ba('0x1d'),{'module':'res_stun_monitor.so'});}else if(_0x17970f[_0x28ba('0x24')][_0x28ba('0x3f')]()==_0x28ba('0x49')){var _0x2b98ae=fs['readFileSync'](path['join'](config[_0x28ba('0x42')],_0x28ba('0x4b')),_0x28ba('0x4e'));var _0x10fdf8=ejs['render'](_0x2b98ae,{'networks':_0x24762b||[]});fs[_0x28ba('0x45')]('/etc/asterisk/turn_xcally.conf',_0x10fdf8);return respondWithRpcPromise(_0x28ba('0x47'),_0x28ba('0x1d'),{'module':_0x28ba('0x48')});}else{var _0x1c4711=fs['readFileSync'](path[_0x28ba('0x41')](config[_0x28ba('0x42')],_0x28ba('0x4d')),_0x28ba('0x4e'));var _0x1344b0=ejs['render'](_0x1c4711,{'networks':_0x24762b||[]});fs[_0x28ba('0x45')](util[_0x28ba('0x4f')](_0x28ba('0x50'),_0x3df049[_0x28ba('0x51')][_0x28ba('0x24')]['toLowerCase']()),_0x1344b0);return respondWithRpcPromise(_0x28ba('0x47'),_0x28ba('0x1d'),{'module':_0x28ba('0x52')});}})[_0x28ba('0xa')](function(_0x481df7){if(_0x481df7){return _0x17970f;}return null;})['then'](respondWithResult(_0x9f578,null))[_0x28ba('0x14')](handleError(_0x9f578,null));};exports[_0x28ba('0x1e')]=function(_0x5948f6,_0x5c1f7a){var _0x21fb4c;return db[_0x28ba('0x38')][_0x28ba('0x3d')]({'where':{'id':_0x5948f6[_0x28ba('0x3b')]['id']}})[_0x28ba('0xa')](function(_0x2038ef){_0x21fb4c=_0x2038ef;return _0x2038ef;})[_0x28ba('0xa')](handleEntityNotFound(_0x5c1f7a,null))[_0x28ba('0xa')](removeEntity(_0x5c1f7a,null))[_0x28ba('0xa')](function(){if(_0x21fb4c){return db['Network'][_0x28ba('0x39')]({'where':{'type':_0x21fb4c[_0x28ba('0x24')]},'raw':!![]});}})[_0x28ba('0xa')](function(_0x5416e7){if(_0x21fb4c[_0x28ba('0x24')][_0x28ba('0x3f')]()=='STUN'){var _0x40d974=fs['readFileSync'](path[_0x28ba('0x41')](config['root'],_0x28ba('0x43')),'utf8');var _0x5ceacc=ejs[_0x28ba('0x44')](_0x40d974,{'networks':_0x5416e7||[]});fs[_0x28ba('0x45')](_0x28ba('0x46'),_0x5ceacc);return respondWithRpcPromise('Reload',_0x28ba('0x1e'),{'module':_0x28ba('0x48')});}else if(_0x21fb4c[_0x28ba('0x24')]['toUpperCase']()=='TURN'){var _0x6af4c3=fs[_0x28ba('0x4a')](path[_0x28ba('0x41')](config[_0x28ba('0x42')],_0x28ba('0x4b')),'utf8');var _0x452f95=ejs['render'](_0x6af4c3,{'networks':_0x5416e7||[]});fs[_0x28ba('0x45')](_0x28ba('0x4c'),_0x452f95);return respondWithRpcPromise(_0x28ba('0x47'),_0x28ba('0x1e'),{'module':_0x28ba('0x48')});}else{var _0x42164d=fs[_0x28ba('0x4a')](path['join'](config[_0x28ba('0x42')],_0x28ba('0x4d')),_0x28ba('0x4e'));var _0x347326=ejs[_0x28ba('0x44')](_0x42164d,{'networks':_0x5416e7||[]});fs[_0x28ba('0x45')](util[_0x28ba('0x4f')](_0x28ba('0x50'),_0x21fb4c['type'][_0x28ba('0x53')]()),_0x347326);return respondWithRpcPromise(_0x28ba('0x47'),'destroy',{'module':'chan_sip.so'});}})[_0x28ba('0x14')](handleError(_0x5c1f7a,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 6beb2b2..b44d2f5 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 _0xaaa2=['./network.attributes','exports','define','network','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x1d1e32,_0x5165c5){var _0xcd5a5a=function(_0x8fb8f8){while(--_0x8fb8f8){_0x1d1e32['push'](_0x1d1e32['shift']());}};_0xcd5a5a(++_0x5165c5);}(_0xaaa2,0xac));var _0x2aaa=function(_0xd0c01c,_0x309801){_0xd0c01c=_0xd0c01c-0x0;var _0x2962f8=_0xaaa2[_0xd0c01c];return _0x2962f8;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var logger=require(_0x2aaa('0x2'))(_0x2aaa('0x3'));var moment=require(_0x2aaa('0x4'));var BPromise=require(_0x2aaa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2aaa('0x6'));var rimraf=require('rimraf');var config=require(_0x2aaa('0x7'));var attributes=require(_0x2aaa('0x8'));module[_0x2aaa('0x9')]=function(_0x25cb1d,_0x1ef101){return _0x25cb1d[_0x2aaa('0xa')]('Network',attributes,{'tableName':_0x2aaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb248=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./network.attributes','exports','define','network'];(function(_0x2e4f8b,_0x1feecf){var _0x2b44d2=function(_0x5025e5){while(--_0x5025e5){_0x2e4f8b['push'](_0x2e4f8b['shift']());}};_0x2b44d2(++_0x1feecf);}(_0xb248,0xc6));var _0x8b24=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xb248[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x8b24('0x0'));var util=require('util');var logger=require(_0x8b24('0x1'))(_0x8b24('0x2'));var moment=require(_0x8b24('0x3'));var BPromise=require(_0x8b24('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b24('0x5'));var rimraf=require(_0x8b24('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b24('0x7'));module[_0x8b24('0x8')]=function(_0x4cc3c4,_0x6da5b7){return _0x4cc3c4[_0x8b24('0x9')]('Network',attributes,{'tableName':_0x8b24('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 26d68ff..36bd96c 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(_0x7408fa,_0x3171d0){var _0x3aba03=function(_0x1736cd){while(--_0x1736cd){_0x7408fa['push'](_0x7408fa['shift']());}};_0x3aba03(++_0x3171d0);}(_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 +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(_0x10a36a,_0x591dea){var _0xd9c529=function(_0x273242){while(--_0x273242){_0x10a36a['push'](_0x10a36a['shift']());}};_0xd9c529(++_0x591dea);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index a953953..7eac38e 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 _0xd89d=['addDisposition','/:id/canned_answers','/:id/notify','notify','addApplications','/:id/send','send','put','delete','destroy','removeAnswers','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','getAgents','post','create'];(function(_0x352af2,_0x11acf7){var _0x3b35aa=function(_0x593709){while(--_0x593709){_0x352af2['push'](_0x352af2['shift']());}};_0x3b35aa(++_0x11acf7);}(_0xd89d,0x11c));var _0xdd89=function(_0x34bd36,_0x4ca7fd){_0x34bd36=_0x34bd36-0x0;var _0x28e775=_0xd89d[_0x34bd36];return _0x28e775;};'use strict';var multer=require('multer');var util=require(_0xdd89('0x0'));var path=require(_0xdd89('0x1'));var timeout=require(_0xdd89('0x2'));var express=require(_0xdd89('0x3'));var router=express['Router']();var fs_extra=require(_0xdd89('0x4'));var auth=require(_0xdd89('0x5'));var interaction=require(_0xdd89('0x6'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xdd89('0x7')]('/',auth[_0xdd89('0x8')](),controller[_0xdd89('0x9')]);router['get']('/describe',auth[_0xdd89('0x8')](),controller[_0xdd89('0xa')]);router['get'](_0xdd89('0xb'),auth[_0xdd89('0x8')](),controller['show']);router[_0xdd89('0x7')](_0xdd89('0xc'),auth[_0xdd89('0x8')](),controller[_0xdd89('0xd')]);router[_0xdd89('0x7')]('/:id/canned_answers',auth[_0xdd89('0x8')](),controller[_0xdd89('0xe')]);router[_0xdd89('0x7')](_0xdd89('0xf'),auth['isAuthenticated'](),controller[_0xdd89('0x10')]);router[_0xdd89('0x7')](_0xdd89('0x11'),auth[_0xdd89('0x8')](),controller[_0xdd89('0x12')]);router[_0xdd89('0x7')]('/:id/users',auth[_0xdd89('0x8')](),controller[_0xdd89('0x13')]);router[_0xdd89('0x14')]('/',auth[_0xdd89('0x8')](),controller[_0xdd89('0x15')]);router[_0xdd89('0x14')](_0xdd89('0xc'),auth['isAuthenticated'](),controller[_0xdd89('0x16')]);router['post'](_0xdd89('0x17'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0xdd89('0x18'),controller[_0xdd89('0x19')]);router[_0xdd89('0x14')](_0xdd89('0xf'),auth[_0xdd89('0x8')](),controller[_0xdd89('0x1a')]);router['post']('/:id/users',auth[_0xdd89('0x8')](),controller['addAgents']);router['post'](_0xdd89('0x1b'),auth[_0xdd89('0x8')](),controller[_0xdd89('0x1c')]);router[_0xdd89('0x1d')](_0xdd89('0xb'),auth[_0xdd89('0x8')](),controller['update']);router[_0xdd89('0x1e')](_0xdd89('0xb'),auth['isAuthenticated'](),controller[_0xdd89('0x1f')]);router['delete'](_0xdd89('0xc'),auth[_0xdd89('0x8')](),controller['removeDispositions']);router[_0xdd89('0x1e')](_0xdd89('0x17'),auth[_0xdd89('0x8')](),controller[_0xdd89('0x20')]);router[_0xdd89('0x1e')]('/:id/users',auth[_0xdd89('0x8')](),controller['removeAgents']);module[_0xdd89('0x21')]=router; \ No newline at end of file +var _0x13e8=['../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','getInteractions','getAgents','post','/:id/canned_answers','notify','addApplications','/:id/users','addAgents','/:id/send','put','update','delete','destroy','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x13e8,0x12c));var _0x813e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x13e8[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x813e('0x0'));var util=require(_0x813e('0x1'));var path=require('path');var timeout=require(_0x813e('0x2'));var express=require(_0x813e('0x3'));var router=express[_0x813e('0x4')]();var fs_extra=require(_0x813e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x813e('0x6'));var config=require(_0x813e('0x7'));var controller=require(_0x813e('0x8'));router[_0x813e('0x9')]('/',auth['isAuthenticated'](),controller[_0x813e('0xa')]);router[_0x813e('0x9')](_0x813e('0xb'),auth[_0x813e('0xc')](),controller[_0x813e('0xd')]);router[_0x813e('0x9')](_0x813e('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x813e('0x9')](_0x813e('0xf'),auth[_0x813e('0xc')](),controller[_0x813e('0x10')]);router[_0x813e('0x9')]('/:id/canned_answers',auth[_0x813e('0xc')](),controller[_0x813e('0x11')]);router[_0x813e('0x9')]('/:id/applications',auth[_0x813e('0xc')](),controller['getApplications']);router[_0x813e('0x9')](_0x813e('0x12'),auth[_0x813e('0xc')](),controller[_0x813e('0x13')]);router[_0x813e('0x9')]('/:id/users',auth[_0x813e('0xc')](),controller[_0x813e('0x14')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x813e('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x813e('0x15')](_0x813e('0x16'),auth[_0x813e('0xc')](),controller['addAnswer']);router[_0x813e('0x15')]('/:id/notify',controller[_0x813e('0x17')]);router[_0x813e('0x15')]('/:id/applications',auth[_0x813e('0xc')](),controller[_0x813e('0x18')]);router[_0x813e('0x15')](_0x813e('0x19'),auth['isAuthenticated'](),controller[_0x813e('0x1a')]);router[_0x813e('0x15')](_0x813e('0x1b'),auth['isAuthenticated'](),controller['send']);router[_0x813e('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x813e('0x1d')]);router[_0x813e('0x1e')](_0x813e('0xe'),auth[_0x813e('0xc')](),controller[_0x813e('0x1f')]);router['delete']('/:id/dispositions',auth[_0x813e('0xc')](),controller['removeDispositions']);router[_0x813e('0x1e')](_0x813e('0x16'),auth[_0x813e('0xc')](),controller['removeAnswers']);router[_0x813e('0x1e')]('/:id/users',auth['isAuthenticated'](),controller[_0x813e('0x20')]);module[_0x813e('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 01124b8..03df946 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 _0x6c0a=['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','mandatoryDisposition'];(function(_0x152547,_0x23189c){var _0x1f828d=function(_0xdff426){while(--_0xdff426){_0x152547['push'](_0x152547['shift']());}};_0x1f828d(++_0x23189c);}(_0x6c0a,0x10e));var _0xa6c0=function(_0x4409a3,_0x1cb281){_0x4409a3=_0x4409a3-0x0;var _0x2cb3c4=_0x6c0a[_0x4409a3];return _0x2cb3c4;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xa6c0('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xa6c0('0x1')],'defaultValue':function(){return rs[_0xa6c0('0x2')]();}},'replyUri':{'type':Sequelize[_0xa6c0('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xa6c0('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa6c0('0x3')],'defaultValue':function(){return _0xa6c0('0x4');}},'notificationSound':{'type':Sequelize[_0xa6c0('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa6c0('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xa6c0('0x1')]},'queueTransfer':{'type':Sequelize[_0xa6c0('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa6c0('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa6c0('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xa6c0('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xa6c0('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x51fab1){if(!_0x51fab1)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0xa6c0('0x8'),_0x51fab1);}}}; \ No newline at end of file +var _0x45f4=['generate','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','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x2714ec,_0x36daa4){var _0x2608e5=function(_0x408468){while(--_0x408468){_0x2714ec['push'](_0x2714ec['shift']());}};_0x2608e5(++_0x36daa4);}(_0x45f4,0x1d7));var _0x445f=function(_0x39e309,_0x1b260b){_0x39e309=_0x39e309-0x0;var _0x180c8a=_0x45f4[_0x39e309];return _0x180c8a;};'use strict';var Sequelize=require(_0x445f('0x0'));var rs=require(_0x445f('0x1'));module[_0x445f('0x2')]={'name':{'type':Sequelize[_0x445f('0x3')],'unique':_0x445f('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x445f('0x3')]},'token':{'type':Sequelize[_0x445f('0x3')],'defaultValue':function(){return rs[_0x445f('0x5')]();}},'replyUri':{'type':Sequelize[_0x445f('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x445f('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x445f('0x6')],'defaultValue':function(){return _0x445f('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x445f('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x445f('0x3')]},'queueTransfer':{'type':Sequelize[_0x445f('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x445f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x445f('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x445f('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x445f('0xa'),'set':function(_0x181389){if(!_0x181389)this[_0x445f('0xb')](_0x445f('0xc'),null);this['setDataValue'](_0x445f('0xd'),_0x181389);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 880c7e2..b942930 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 _0x661c=['params','keys','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','Contacts','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','messageId','interaction','created','autoclose','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','Contact','fullname','internal','Tags','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','push','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','destroy','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','count','include','OpenchannelAccount','findAll','rows','show'];(function(_0x11dd7e,_0x37a73e){var _0x509608=function(_0x40a010){while(--_0x40a010){_0x11dd7e['push'](_0x11dd7e['shift']());}};_0x509608(++_0x37a73e);}(_0x661c,0x122));var _0xc661=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x661c[_0x35885a];return _0xe86249;};'use strict';var emlformat=require(_0xc661('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc661('0x1'));var rp=require('request-promise');var moment=require(_0xc661('0x2'));var BPromise=require(_0xc661('0x3'));var Mustache=require(_0xc661('0x4'));var util=require(_0xc661('0x5'));var path=require(_0xc661('0x6'));var sox=require(_0xc661('0x7'));var csv=require(_0xc661('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc661('0x9'));var squel=require('squel');var crypto=require(_0xc661('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc661('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc661('0xc'));var Papa=require(_0xc661('0xd'));var Redis=require(_0xc661('0xe'));var authService=require(_0xc661('0xf'));var qs=require(_0xc661('0x10'));var as=require(_0xc661('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc661('0x12'))('api');var utils=require(_0xc661('0x13'));var config=require(_0xc661('0x14'));var licenseUtil=require(_0xc661('0x15'));var db=require(_0xc661('0x16'))['db'];config['redis']=_[_0xc661('0x17')](config[_0xc661('0x18')],{'host':_0xc661('0x19'),'port':0x18eb});var socket=require(_0xc661('0x1a'))(new Redis(config['redis']));require(_0xc661('0x1b'))[_0xc661('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc661('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc661('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x2223ff,_0x5565f1,_0x518b08,_0x3587b8){return new BPromise(function(_0x52a291,_0x52dcfc){var _0x437eae=_0x3587b8||client;return _0x437eae['request'](_0x2223ff,_0x518b08)[_0xc661('0x1f')](function(_0x39e90a){logger[_0xc661('0x20')](_0xc661('0x21'),_0x5565f1,_0xc661('0x22'));logger[_0xc661('0x23')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5565f1,_0xc661('0x22'),JSON['stringify'](_0x39e90a));if(_0x39e90a[_0xc661('0x24')]){if(_0x39e90a[_0xc661('0x24')]['code']===0x1f4){logger[_0xc661('0x24')](_0xc661('0x21'),_0x5565f1,_0x39e90a[_0xc661('0x24')][_0xc661('0x25')]);return _0x52dcfc(_0x39e90a[_0xc661('0x24')][_0xc661('0x25')]);}logger[_0xc661('0x24')](_0xc661('0x21'),_0x5565f1,_0x39e90a[_0xc661('0x24')][_0xc661('0x25')]);return _0x52a291(_0x39e90a[_0xc661('0x24')][_0xc661('0x25')]);}else{logger[_0xc661('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x5565f1,_0xc661('0x22'));_0x52a291(_0x39e90a[_0xc661('0x26')]['message']);}})[_0xc661('0x27')](function(_0x3eb48d){logger[_0xc661('0x24')](_0xc661('0x21'),_0x5565f1,_0x3eb48d);_0x52dcfc(_0x3eb48d);});});}function respondWithStatusCode(_0x2072e9,_0x245e42){_0x245e42=_0x245e42||0xcc;return function(_0x564bce){if(_0x564bce){return _0x2072e9[_0xc661('0x28')](_0x245e42);}return _0x2072e9['status'](_0x245e42)[_0xc661('0x29')]();};}function respondWithResult(_0x31d76c,_0x57d9a2){_0x57d9a2=_0x57d9a2||0xc8;return function(_0x58f9f8){if(_0x58f9f8){return _0x31d76c[_0xc661('0x2a')](_0x57d9a2)[_0xc661('0x2b')](_0x58f9f8);}};}function respondWithFilteredResult(_0x116db6,_0x5037d6){return function(_0x57d4a1){if(_0x57d4a1){var _0x2d5ab2=typeof _0x5037d6[_0xc661('0x2c')]===_0xc661('0x2d')&&typeof _0x5037d6[_0xc661('0x2e')]===_0xc661('0x2d');var _0x31da9a=_0x57d4a1['count'];var _0x17ba32=_0x2d5ab2?0x0:_0x5037d6['offset'];var _0x222092=_0x2d5ab2?_0x57d4a1['count']:_0x5037d6[_0xc661('0x2c')]+_0x5037d6[_0xc661('0x2e')];var _0x37b5f5;if(_0x222092>=_0x31da9a){_0x222092=_0x31da9a;_0x37b5f5=0xc8;}else{_0x37b5f5=0xce;}_0x116db6[_0xc661('0x2a')](_0x37b5f5);return _0x116db6[_0xc661('0x2f')](_0xc661('0x30'),_0x17ba32+'-'+_0x222092+'/'+_0x31da9a)[_0xc661('0x2b')](_0x57d4a1);}return null;};}function patchUpdates(_0x680732){return function(_0x2a6f59){try{jsonpatch[_0xc661('0x31')](_0x2a6f59,_0x680732,!![]);}catch(_0x4ccc5c){return BPromise[_0xc661('0x32')](_0x4ccc5c);}return _0x2a6f59['save']();};}function saveUpdates(_0x52493f,_0x4b6901){return function(_0x43e9ae){if(_0x43e9ae){return _0x43e9ae[_0xc661('0x33')](_0x52493f)['then'](function(_0x4b3f90){return _0x4b3f90;});}return null;};}function removeEntity(_0xac0cc6,_0x2954f3){return function(_0x17a3ae){if(_0x17a3ae){return _0x17a3ae[_0xc661('0x34')]()[_0xc661('0x1f')](function(){var _0xe4ff76=_0x17a3ae['get']({'plain':!![]});var _0x49b009='OpenchannelAccounts';return db[_0xc661('0x35')][_0xc661('0x34')]({'where':{'type':_0x49b009,'resourceId':_0xe4ff76['id']}})[_0xc661('0x1f')](function(){return _0x17a3ae;});})['then'](function(){_0xac0cc6[_0xc661('0x2a')](0xcc)[_0xc661('0x29')]();});}};}function handleEntityNotFound(_0x2fa605,_0x4a2cad){return function(_0x24bc2e){if(!_0x24bc2e){_0x2fa605[_0xc661('0x28')](0x194);}return _0x24bc2e;};}function handleError(_0x4cd027,_0x3c09ad){_0x3c09ad=_0x3c09ad||0x1f4;return function(_0x12a3e5){logger[_0xc661('0x24')](_0x12a3e5[_0xc661('0x36')]);if(_0x12a3e5['name']){delete _0x12a3e5[_0xc661('0x37')];}_0x4cd027['status'](_0x3c09ad)[_0xc661('0x38')](_0x12a3e5);};}exports[_0xc661('0x39')]=function(_0x3fef9a,_0x44ed2d){var _0x227f27={'include':[{'model':db[_0xc661('0x3a')],'as':_0xc661('0x3b')}]},_0xe576b1={},_0x303346={'count':0x0,'rows':[]};var _0x2f470d=_[_0xc661('0x3c')](db['OpenchannelAccount'][_0xc661('0x3d')],function(_0x1ba0d5){return{'name':_0x1ba0d5[_0xc661('0x3e')],'type':_0x1ba0d5[_0xc661('0x3f')][_0xc661('0x40')]};});_0xe576b1[_0xc661('0x41')]=_['map'](_0x2f470d,_0xc661('0x37'));_0xe576b1['query']=_['keys'](_0x3fef9a[_0xc661('0x42')]);_0xe576b1['filters']=_[_0xc661('0x43')](_0xe576b1[_0xc661('0x41')],_0xe576b1[_0xc661('0x42')]);_0x227f27[_0xc661('0x44')]=_[_0xc661('0x43')](_0xe576b1[_0xc661('0x41')],qs[_0xc661('0x45')](_0x3fef9a[_0xc661('0x42')][_0xc661('0x45')]));_0x227f27[_0xc661('0x44')]=_0x227f27[_0xc661('0x44')][_0xc661('0x46')]?_0x227f27[_0xc661('0x44')]:_0xe576b1[_0xc661('0x41')];if(!_0x3fef9a[_0xc661('0x42')][_0xc661('0x47')](_0xc661('0x48'))){_0x227f27['limit']=qs['limit'](_0x3fef9a[_0xc661('0x42')][_0xc661('0x2e')]);_0x227f27['offset']=qs['offset'](_0x3fef9a[_0xc661('0x42')][_0xc661('0x2c')]);}_0x227f27[_0xc661('0x49')]=qs['sort'](_0x3fef9a[_0xc661('0x42')][_0xc661('0x4a')]);_0x227f27[_0xc661('0x4b')]=qs[_0xc661('0x4c')](_['pick'](_0x3fef9a[_0xc661('0x42')],_0xe576b1[_0xc661('0x4c')]),_0x2f470d);if(_0x3fef9a[_0xc661('0x42')][_0xc661('0x4d')]){_0x227f27[_0xc661('0x4b')]=_[_0xc661('0x4e')](_0x227f27[_0xc661('0x4b')],{'$or':_['map'](_0x2f470d,function(_0x5f52dd){if(_0x5f52dd[_0xc661('0x3f')]!==_0xc661('0x4f')){var _0x2327c7={};_0x2327c7[_0x5f52dd[_0xc661('0x37')]]={'$like':'%'+_0x3fef9a['query'][_0xc661('0x4d')]+'%'};return _0x2327c7;}})});}_0x227f27=_[_0xc661('0x4e')]({},_0x227f27,_0x3fef9a['options']);var _0x9f18a9={'where':_0x227f27[_0xc661('0x4b')]};return db['OpenchannelAccount']['count'](_0x9f18a9)[_0xc661('0x1f')](function(_0x38fb40){_0x303346[_0xc661('0x50')]=_0x38fb40;if(_0x3fef9a['query']['includeAll']){_0x227f27[_0xc661('0x51')]=[{'all':!![]}];}return db[_0xc661('0x52')][_0xc661('0x53')](_0x227f27);})['then'](function(_0x34fe31){_0x303346[_0xc661('0x54')]=_0x34fe31;return _0x303346;})[_0xc661('0x1f')](respondWithFilteredResult(_0x44ed2d,_0x227f27))[_0xc661('0x27')](handleError(_0x44ed2d,null));};exports[_0xc661('0x55')]=function(_0x3262ba,_0x5d0360){var _0x4d1b67={'raw':![],'where':{'id':_0x3262ba[_0xc661('0x56')]['id']},'include':[{'model':db[_0xc661('0x3a')],'as':_0xc661('0x3b')}]},_0x35106f={};_0x35106f['model']=_[_0xc661('0x57')](db['OpenchannelAccount']['rawAttributes']);_0x35106f[_0xc661('0x42')]=_[_0xc661('0x57')](_0x3262ba[_0xc661('0x42')]);_0x35106f[_0xc661('0x4c')]=_['intersection'](_0x35106f[_0xc661('0x41')],_0x35106f[_0xc661('0x42')]);_0x4d1b67[_0xc661('0x44')]=_['intersection'](_0x35106f[_0xc661('0x41')],qs[_0xc661('0x45')](_0x3262ba[_0xc661('0x42')]['fields']));_0x4d1b67[_0xc661('0x44')]=_0x4d1b67[_0xc661('0x44')][_0xc661('0x46')]?_0x4d1b67[_0xc661('0x44')]:_0x35106f[_0xc661('0x41')];if(_0x3262ba[_0xc661('0x42')][_0xc661('0x58')]){_0x4d1b67[_0xc661('0x51')]=[{'all':!![]}];}_0x4d1b67=_['merge']({},_0x4d1b67,_0x3262ba[_0xc661('0x59')]);return db['OpenchannelAccount'][_0xc661('0x5a')](_0x4d1b67)[_0xc661('0x1f')](handleEntityNotFound(_0x5d0360,null))[_0xc661('0x1f')](respondWithResult(_0x5d0360,null))['catch'](handleError(_0x5d0360,null));};exports[_0xc661('0x5b')]=function(_0x594129,_0xab396e){return db[_0xc661('0x52')][_0xc661('0x5b')](_0x594129[_0xc661('0x5c')],{})['then'](function(_0x5f1d23){var _0xe221c2=_0x594129[_0xc661('0x5d')][_0xc661('0x5e')]({'plain':!![]});if(!_0xe221c2)throw new Error(_0xc661('0x5f'));if(_0xe221c2[_0xc661('0x60')]===_0xc661('0x5d')){var _0x16c3c1=_0x5f1d23[_0xc661('0x5e')]({'plain':!![]});var _0x35a9a0='OpenchannelAccounts';return db[_0xc661('0x61')][_0xc661('0x5a')]({'where':{'name':_0x35a9a0,'userProfileId':_0xe221c2[_0xc661('0x62')]},'raw':!![]})[_0xc661('0x1f')](function(_0x5dd091){if(_0x5dd091&&_0x5dd091['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16c3c1['name'],'resourceId':_0x16c3c1['id'],'type':_0x5dd091[_0xc661('0x37')],'sectionId':_0x5dd091['id']},{})[_0xc661('0x1f')](function(){return _0x5f1d23;});}else{return _0x5f1d23;}})[_0xc661('0x27')](function(_0x16bbf0){logger[_0xc661('0x24')](_0xc661('0x63'),_0x16bbf0);throw _0x16bbf0;});}return _0x5f1d23;})[_0xc661('0x1f')](respondWithResult(_0xab396e,0xc9))[_0xc661('0x27')](handleError(_0xab396e,null));};exports[_0xc661('0x33')]=function(_0x6c42e3,_0x3a3d4a){if(_0x6c42e3[_0xc661('0x5c')]['id']){delete _0x6c42e3['body']['id'];}return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x6c42e3[_0xc661('0x56')]['id']},'include':[{'model':db[_0xc661('0x3a')],'as':_0xc661('0x3b')}]})[_0xc661('0x1f')](handleEntityNotFound(_0x3a3d4a,null))['then'](saveUpdates(_0x6c42e3['body'],null))[_0xc661('0x1f')](respondWithResult(_0x3a3d4a,null))[_0xc661('0x27')](handleError(_0x3a3d4a,null));};exports['destroy']=function(_0x539901,_0x3210f1){return db[_0xc661('0x52')]['find']({'where':{'id':_0x539901[_0xc661('0x56')]['id']}})['then'](handleEntityNotFound(_0x3210f1,null))['then'](removeEntity(_0x3210f1,null))[_0xc661('0x27')](handleError(_0x3210f1,null));};exports[_0xc661('0x64')]=function(_0x3acbe9,_0x3aa301){return db[_0xc661('0x52')]['describe']()[_0xc661('0x1f')](respondWithResult(_0x3aa301,null))[_0xc661('0x27')](handleError(_0x3aa301,null));};exports[_0xc661('0x65')]=function(_0x4ff589,_0x2a847a,_0x28fe39){if(_0x4ff589[_0xc661('0x5c')]['id']){delete _0x4ff589[_0xc661('0x5c')]['id'];}return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x4ff589[_0xc661('0x56')]['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x2a847a,null))[_0xc661('0x1f')](function(_0x5bfa68){if(_0x5bfa68){_0x4ff589[_0xc661('0x5c')][_0xc661('0x66')]=_0x5bfa68['id'];return db['Disposition'][_0xc661('0x5b')](_0x4ff589[_0xc661('0x5c')]);}})[_0xc661('0x1f')](respondWithResult(_0x2a847a,null))[_0xc661('0x27')](handleError(_0x2a847a,null));};exports[_0xc661('0x67')]=function(_0x376e69,_0x5cb80d,_0x108ab7){var _0x2c1f1a={'raw':![],'where':{}};var _0x5525f4={};var _0x211e30={'count':0x0,'rows':[]};return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x376e69['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x5cb80d,null))['then'](function(_0x3fa513){if(_0x3fa513){_0x5525f4[_0xc661('0x41')]=_[_0xc661('0x57')](db[_0xc661('0x69')][_0xc661('0x3d')]);_0x5525f4[_0xc661('0x42')]=_[_0xc661('0x57')](_0x376e69[_0xc661('0x42')]);_0x5525f4[_0xc661('0x4c')]=_[_0xc661('0x43')](_0x5525f4['model'],_0x5525f4[_0xc661('0x42')]);_0x2c1f1a[_0xc661('0x44')]=_['intersection'](_0x5525f4[_0xc661('0x41')],qs[_0xc661('0x45')](_0x376e69[_0xc661('0x42')][_0xc661('0x45')]));_0x2c1f1a[_0xc661('0x44')]=_0x2c1f1a[_0xc661('0x44')][_0xc661('0x46')]?_0x2c1f1a[_0xc661('0x44')]:_0x5525f4[_0xc661('0x41')];if(!_0x376e69['query']['hasOwnProperty'](_0xc661('0x48'))){_0x2c1f1a[_0xc661('0x2e')]=qs['limit'](_0x376e69[_0xc661('0x42')][_0xc661('0x2e')]);_0x2c1f1a[_0xc661('0x2c')]=qs[_0xc661('0x2c')](_0x376e69[_0xc661('0x42')][_0xc661('0x2c')]);}_0x2c1f1a['order']=qs[_0xc661('0x4a')](_0x376e69[_0xc661('0x42')][_0xc661('0x4a')]);_0x2c1f1a['where']=qs[_0xc661('0x4c')](_[_0xc661('0x6a')](_0x376e69[_0xc661('0x42')],_0x5525f4[_0xc661('0x4c')]));_0x2c1f1a['where'][_0xc661('0x66')]=_0x3fa513['id'];if(_0x376e69[_0xc661('0x42')][_0xc661('0x4d')]){_0x2c1f1a[_0xc661('0x4b')]=_[_0xc661('0x4e')](_0x2c1f1a['where'],{'$or':_['map'](_0x2c1f1a['attributes'],function(_0x15d724){var _0x3f62a5={};_0x3f62a5[_0x15d724]={'$like':'%'+_0x376e69[_0xc661('0x42')][_0xc661('0x4d')]+'%'};return _0x3f62a5;})});}_0x2c1f1a=_[_0xc661('0x4e')]({},_0x2c1f1a,_0x376e69[_0xc661('0x59')]);return db[_0xc661('0x69')][_0xc661('0x50')]({'where':_0x2c1f1a[_0xc661('0x4b')]})['then'](function(_0x272983){_0x211e30[_0xc661('0x50')]=_0x272983;if(_0x376e69[_0xc661('0x42')][_0xc661('0x58')]){_0x2c1f1a[_0xc661('0x51')]=[{'all':!![]}];}return db[_0xc661('0x69')]['findAll'](_0x2c1f1a);})[_0xc661('0x1f')](function(_0x36fec3){_0x211e30[_0xc661('0x54')]=_0x36fec3;return _0x211e30;});}})[_0xc661('0x1f')](respondWithFilteredResult(_0x5cb80d,_0x2c1f1a))[_0xc661('0x27')](handleError(_0x5cb80d,null));};exports[_0xc661('0x6b')]=function(_0x123461,_0x2446c0,_0x183dc0){return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x123461['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x2446c0,null))[_0xc661('0x1f')](function(_0x4e1bda){if(_0x4e1bda){return _0x4e1bda[_0xc661('0x6b')](_0x123461[_0xc661('0x42')]['ids']);}})[_0xc661('0x1f')](respondWithStatusCode(_0x2446c0,null))['catch'](handleError(_0x2446c0,null));};exports[_0xc661('0x6c')]=function(_0x3acc27,_0x504f03,_0x2e1245){if(_0x3acc27[_0xc661('0x5c')]['id']){delete _0x3acc27[_0xc661('0x5c')]['id'];}return db['OpenchannelAccount'][_0xc661('0x5a')]({'where':{'id':_0x3acc27[_0xc661('0x56')]['id']}})['then'](handleEntityNotFound(_0x504f03,null))[_0xc661('0x1f')](function(_0xccdc54){if(_0xccdc54){_0x3acc27[_0xc661('0x5c')][_0xc661('0x66')]=_0xccdc54['id'];return db[_0xc661('0x6d')][_0xc661('0x5b')](_0x3acc27['body']);}})[_0xc661('0x1f')](respondWithResult(_0x504f03,null))[_0xc661('0x27')](handleError(_0x504f03,null));};exports[_0xc661('0x6e')]=function(_0x47208d,_0x1bade3,_0x9fb245){var _0xd54a6e={'raw':![],'where':{}};var _0x58f4ce={};var _0x2e7272={'count':0x0,'rows':[]};return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x47208d['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x1bade3,null))[_0xc661('0x1f')](function(_0x1606f2){if(_0x1606f2){_0x58f4ce[_0xc661('0x41')]=_[_0xc661('0x57')](db[_0xc661('0x6d')]['rawAttributes']);_0x58f4ce[_0xc661('0x42')]=_[_0xc661('0x57')](_0x47208d['query']);_0x58f4ce[_0xc661('0x4c')]=_[_0xc661('0x43')](_0x58f4ce['model'],_0x58f4ce['query']);_0xd54a6e['attributes']=_[_0xc661('0x43')](_0x58f4ce[_0xc661('0x41')],qs[_0xc661('0x45')](_0x47208d['query'][_0xc661('0x45')]));_0xd54a6e[_0xc661('0x44')]=_0xd54a6e[_0xc661('0x44')]['length']?_0xd54a6e[_0xc661('0x44')]:_0x58f4ce['model'];if(!_0x47208d[_0xc661('0x42')][_0xc661('0x47')](_0xc661('0x48'))){_0xd54a6e['limit']=qs[_0xc661('0x2e')](_0x47208d['query'][_0xc661('0x2e')]);_0xd54a6e['offset']=qs['offset'](_0x47208d['query'][_0xc661('0x2c')]);}_0xd54a6e[_0xc661('0x49')]=qs[_0xc661('0x4a')](_0x47208d[_0xc661('0x42')][_0xc661('0x4a')]);_0xd54a6e[_0xc661('0x4b')]=qs[_0xc661('0x4c')](_[_0xc661('0x6a')](_0x47208d[_0xc661('0x42')],_0x58f4ce[_0xc661('0x4c')]));_0xd54a6e[_0xc661('0x4b')][_0xc661('0x66')]=_0x1606f2['id'];if(_0x47208d[_0xc661('0x42')][_0xc661('0x4d')]){_0xd54a6e[_0xc661('0x4b')]=_[_0xc661('0x4e')](_0xd54a6e[_0xc661('0x4b')],{'$or':_['map'](_0xd54a6e[_0xc661('0x44')],function(_0x441d75){var _0xcebd18={};_0xcebd18[_0x441d75]={'$like':'%'+_0x47208d[_0xc661('0x42')][_0xc661('0x4d')]+'%'};return _0xcebd18;})});}_0xd54a6e=_[_0xc661('0x4e')]({},_0xd54a6e,_0x47208d[_0xc661('0x59')]);return db[_0xc661('0x6d')][_0xc661('0x50')]({'where':_0xd54a6e['where']})[_0xc661('0x1f')](function(_0x2dcdb1){_0x2e7272[_0xc661('0x50')]=_0x2dcdb1;if(_0x47208d[_0xc661('0x42')][_0xc661('0x58')]){_0xd54a6e['include']=[{'all':!![]}];}return db[_0xc661('0x6d')][_0xc661('0x53')](_0xd54a6e);})['then'](function(_0x5207c0){_0x2e7272[_0xc661('0x54')]=_0x5207c0;return _0x2e7272;});}})['then'](respondWithFilteredResult(_0x1bade3,_0xd54a6e))['catch'](handleError(_0x1bade3,null));};exports[_0xc661('0x6f')]=function(_0x12d270,_0x7c6293,_0x4d5dc1){return db[_0xc661('0x52')]['find']({'where':{'id':_0x12d270[_0xc661('0x56')]['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x7c6293,null))[_0xc661('0x1f')](function(_0x5eccac){if(_0x5eccac){return _0x5eccac['removeAnswers'](_0x12d270[_0xc661('0x42')][_0xc661('0x70')]);}})[_0xc661('0x1f')](respondWithStatusCode(_0x7c6293,null))[_0xc661('0x27')](handleError(_0x7c6293,null));};exports[_0xc661('0x71')]=function(_0x592c8b,_0x32a616,_0x18ae2d){var _0x13d01a={'body':_0x592c8b[_0xc661('0x5c')],'channel':_0xc661('0x72')};var _0x508eea=[];var _0x1bd3bc=[];var _0x41906d={};var _0x1a0fce=![];return db[_0xc661('0x73')]['describe']()[_0xc661('0x1f')](function(_0x56b9f1){if(!_0x56b9f1){throw new db[(_0xc661('0x74'))]['ValidationError']('no\x20available\x20attributes');}_0x508eea=_[_0xc661('0x75')](_[_0xc661('0x57')](_0x56b9f1),[_0xc661('0x76'),_0xc661('0x77')]);_0x1bd3bc=_['difference'](_['keys'](_0x56b9f1),['createdAt',_0xc661('0x77'),_0xc661('0x78'),'ListId']);if(_0x592c8b[_0xc661('0x5c')]['id']){delete _0x592c8b[_0xc661('0x5c')]['id'];}if(_[_0xc661('0x79')](_0x592c8b[_0xc661('0x5c')][_0xc661('0x7a')])){throw new db[(_0xc661('0x74'))][(_0xc661('0x7b'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x592c8b[_0xc661('0x5c')][_0xc661('0x5c')])||_0x592c8b[_0xc661('0x5c')][_0xc661('0x5c')]===''){throw new db[(_0xc661('0x74'))][(_0xc661('0x7b'))](_0xc661('0x7c'));}if(_[_0xc661('0x79')](_0x592c8b[_0xc661('0x5c')][_0xc661('0x7d')])){throw new db[(_0xc661('0x74'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1bd3bc);}if(!_[_0xc661('0x7e')](_0x1bd3bc,_0x592c8b[_0xc661('0x5c')][_0xc661('0x7d')])){throw new db[(_0xc661('0x74'))][(_0xc661('0x7b'))](_0xc661('0x7f')+_0x1bd3bc);}_0x41906d[_0x592c8b[_0xc661('0x5c')][_0xc661('0x7d')]]=_0x592c8b['body']['from'];})[_0xc661('0x1f')](function(){return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x592c8b[_0xc661('0x56')]['id']},'include':[{'model':db[_0xc661('0x80')],'as':_0xc661('0x81'),'include':[{'model':db[_0xc661('0x73')],'as':'Contacts','where':_0x41906d,'limit':0x1,'order':[[_0xc661('0x77'),_0xc661('0x82')]]}]},{'model':db[_0xc661('0x83')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x32a616,null))[_0xc661('0x1f')](function(_0x45b8a8){if(_0x45b8a8&&_0x45b8a8['List']){_0x13d01a[_0xc661('0x84')]=_0x45b8a8;_0x13d01a[_0xc661('0x85')]=_0x45b8a8[_0xc661('0x86')];_0x13d01a[_0xc661('0x87')]=_0x45b8a8['List'];_0x13d01a[_0xc661('0x85')]=_[_0xc661('0x88')](_0x13d01a[_0xc661('0x85')],[_0xc661('0x89')],[_0xc661('0x8a')]);if(_0x13d01a[_0xc661('0x84')][_0xc661('0x86')]){delete _0x13d01a[_0xc661('0x84')][_0xc661('0x86')];}if(_0x13d01a['account'][_0xc661('0x81')]&&_0x13d01a[_0xc661('0x84')]['List']['Contacts'][_0xc661('0x46')]){return _0x13d01a[_0xc661('0x84')][_0xc661('0x81')][_0xc661('0x8b')][0x0];}var _0x22f4f8=_[_0xc661('0x17')](_0x592c8b['body'],{'firstName':_0x592c8b['body'][_0xc661('0x7a')],'ListId':_0x45b8a8[_0xc661('0x8c')]});_0x22f4f8[_0x592c8b['body'][_0xc661('0x7d')]]=_0x592c8b[_0xc661('0x5c')][_0xc661('0x7a')];return db['CmContact']['create'](_0x22f4f8,{'fields':_0x508eea,'raw':!![]});}})[_0xc661('0x1f')](handleEntityNotFound(_0x32a616,null))['then'](function(_0x53b7bc){_0x13d01a[_0xc661('0x8d')]=_0x53b7bc;if(_0x53b7bc){var _0x3c9171={'ContactId':_0x53b7bc['id'],'OpenchannelAccountId':_0x592c8b[_0xc661('0x56')]['id'],'from':(_0x53b7bc[_0xc661('0x8e')]||'')+'\x20'+(_0x53b7bc[_0xc661('0x8f')]||'')};var _0x56a81e={'OpenchannelAccountId':_0x592c8b[_0xc661('0x56')]['id'],'closed':![]};if(_0x592c8b[_0xc661('0x5c')]['threadId']){_0x56a81e['threadId']=_0x592c8b[_0xc661('0x5c')][_0xc661('0x90')];return db[_0xc661('0x91')][_0xc661('0x5a')]({'where':_0x56a81e})[_0xc661('0x1f')](function(_0x17a11d){if(_0x17a11d){return[_0x17a11d,![]];}_0x3c9171[_0xc661('0x90')]=_0x592c8b[_0xc661('0x5c')][_0xc661('0x90')];_0x3c9171['externalUrl']=_0x592c8b[_0xc661('0x5c')][_0xc661('0x92')];return db['OpenchannelInteraction'][_0xc661('0x5b')](_0x3c9171)[_0xc661('0x1f')](function(_0x5ca3bd){return[_0x5ca3bd,!![]];});});}else{_0x56a81e[_0xc661('0x90')]=null;}_0x56a81e['ContactId']=_0x53b7bc['id'];return db[_0xc661('0x91')][_0xc661('0x5a')]({'where':_0x56a81e})[_0xc661('0x1f')](function(_0x25049a){if(_0x25049a){return[_0x25049a,![]];}return db[_0xc661('0x91')][_0xc661('0x5b')](_0x3c9171)[_0xc661('0x1f')](function(_0x5176ee){return[_0x5176ee,!![]];});});}})['spread'](function(_0x3c0c64,_0x3901ab){if(_0x3c0c64){_0x1a0fce=_0x3901ab;if(!_0x3901ab){var _0x1e3f08={'from':(_0x13d01a[_0xc661('0x8d')][_0xc661('0x8e')]||'')+'\x20'+(_0x13d01a['contact'][_0xc661('0x8f')]||'')};if(_0x592c8b[_0xc661('0x5c')][_0xc661('0x90')]&&_0x592c8b[_0xc661('0x5c')][_0xc661('0x93')]&&_0x592c8b[_0xc661('0x5c')][_0xc661('0x90')]!=_0x592c8b[_0xc661('0x5c')][_0xc661('0x93')]){_0x1e3f08['threadId']=_0x592c8b[_0xc661('0x5c')][_0xc661('0x93')];}return _0x3c0c64[_0xc661('0x33')](_0x1e3f08);}else{return _0x3c0c64;}}})[_0xc661('0x1f')](function(_0x52bce1){_0x13d01a[_0xc661('0x94')]=_0x52bce1[_0xc661('0x5e')]({'plain':!![]});_0x13d01a[_0xc661('0x94')][_0xc661('0x95')]=_0x1a0fce;if(_0x13d01a['interaction'][_0xc661('0x95')]){if(_0x13d01a['account'][_0xc661('0x96')]){_0x13d01a[_0xc661('0x85')]['push']({'id':0x0,'priority':_0x13d01a[_0xc661('0x85')]['length']+0x1,'app':'close','appdata':_0xc661('0x97'),'interval':_0xc661('0x98')});}}return db[_0xc661('0x99')]['create']({'body':_0x592c8b[_0xc661('0x5c')][_0xc661('0x5c')],'OpenchannelAccountId':_0x592c8b[_0xc661('0x56')]['id'],'OpenchannelInteractionId':_0x52bce1['id'],'direction':'in','ContactId':_0x13d01a[_0xc661('0x8d')]['id'],'AttachmentId':_0x592c8b[_0xc661('0x5c')]['AttachmentId']});})[_0xc661('0x1f')](function(_0x27a676){_0x13d01a[_0xc661('0x25')]=_0x27a676;if(_0x13d01a[_0xc661('0x94')][_0xc661('0x9a')]){return db[_0xc661('0x9b')][_0xc661('0x5a')]({'attributes':['id',_0xc661('0x37')],'where':{'id':_0x13d01a[_0xc661('0x94')][_0xc661('0x9a')]}})[_0xc661('0x1f')](function(_0x160775){if(_0x160775){_0x13d01a[_0xc661('0x85')][_0xc661('0x9c')]({'id':0x0,'priority':0x0,'app':_0xc661('0x9d'),'appdata':_0x160775[_0xc661('0x37')]+','+(_0x13d01a['account'][_0xc661('0x9e')]||0xa),'interval':'*,*,*,*'});_0x13d01a[_0xc661('0x9f')]=![];}return respondWithRpcPromise(_0xc661('0xa0'),_0xc661('0xa1'),_0x13d01a);});}return respondWithRpcPromise('Start',_0xc661('0xa1'),_0x13d01a);})[_0xc661('0x1f')](function(_0x30af82){respondWithRpcPromise(_0xc661('0xa2'),_0xc661('0xa2'),{'event':_0xc661('0x71'),'message':_0x30af82},client9002);return _0x30af82;})[_0xc661('0x1f')](respondWithResult(_0x32a616,null))[_0xc661('0x27')](handleError(_0x32a616,null));};exports[_0xc661('0xa3')]=function(_0x542841,_0x24bd2c){var _0x4784b3=_0x542841[_0xc661('0x56')]['id'];var _0x1841b2=_0x542841['body'];var _0x505be6=0xc8;var _0x482c72=null;return db[_0xc661('0xa4')][_0xc661('0xa5')]({'isolationLevel':db[_0xc661('0xa4')]['Transaction']['ISOLATION_LEVELS'][_0xc661('0xa6')]},function(_0x4e135f){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4784b3},'transaction':_0x4e135f})[_0xc661('0x1f')](function(_0x52730d){if(_0x52730d){return db[_0xc661('0x83')][_0xc661('0x34')]({'where':{'OpenchannelAccountId':_0x4784b3},'transaction':_0x4e135f})[_0xc661('0x1f')](function(){var _0xeb0476=_['map'](_0x1841b2,function(_0x2b56f1){_0x2b56f1[_0xc661('0x66')]=_0x4784b3;return _0x2b56f1;});return db['OpenchannelApplication']['bulkCreate'](_0xeb0476,{'transaction':_0x4e135f});});}else{_0x505be6=0x194;_0x482c72=[];}});})['then'](function(){if(_0x505be6!==0x194){return db[_0xc661('0x83')][_0xc661('0xa7')]({'where':{'OpenchannelAccountId':_0x4784b3},'order':_0xc661('0x89')})[_0xc661('0x1f')](function(_0x5db96f){_0x482c72=_0x5db96f;});}})[_0xc661('0x27')](function(_0x26d1d0){_0x505be6=0x1f4;logger[_0xc661('0x24')](_0x26d1d0[_0xc661('0x36')]);if(_0x26d1d0[_0xc661('0x37')]){delete _0x26d1d0[_0xc661('0x37')];}_0x482c72=_0x26d1d0;})[_0xc661('0xa8')](function(){if(_0x482c72===null){_0x24bd2c['sendStatus'](_0x505be6);}else{if(_0x505be6===0x1f4){_0x24bd2c['status'](_0x505be6)[_0xc661('0x38')](_0x482c72);}else{_0x24bd2c['status'](_0x505be6)['json'](_0x482c72);}}});};exports['getApplications']=function(_0x9833be,_0x409464,_0xc3232b){var _0x30a8c7={};var _0x2a23e6={};var _0x4b563c;var _0x4d8c9a;return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x9833be[_0xc661('0x56')]['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x409464,null))[_0xc661('0x1f')](function(_0x5c4a48){if(_0x5c4a48){_0x4b563c=_0x5c4a48;_0x2a23e6['model']=_['keys'](db[_0xc661('0x83')][_0xc661('0x3d')]);_0x2a23e6[_0xc661('0x42')]=_[_0xc661('0x57')](_0x9833be[_0xc661('0x42')]);_0x2a23e6[_0xc661('0x4c')]=_[_0xc661('0x43')](_0x2a23e6[_0xc661('0x41')],_0x2a23e6['query']);_0x30a8c7[_0xc661('0x44')]=_[_0xc661('0x43')](_0x2a23e6[_0xc661('0x41')],qs['fields'](_0x9833be[_0xc661('0x42')][_0xc661('0x45')]));_0x30a8c7['attributes']=_0x30a8c7[_0xc661('0x44')]['length']?_0x30a8c7[_0xc661('0x44')]:_0x2a23e6[_0xc661('0x41')];_0x30a8c7[_0xc661('0x49')]=qs[_0xc661('0x4a')](_0x9833be[_0xc661('0x42')][_0xc661('0x4a')]);_0x30a8c7[_0xc661('0x4b')]=qs['filters'](_['pick'](_0x9833be['query'],_0x2a23e6['filters']));if(_0x9833be[_0xc661('0x42')]['filter']){_0x30a8c7['where']=_['merge'](_0x30a8c7[_0xc661('0x4b')],{'$or':_['map'](_0x30a8c7[_0xc661('0x44')],function(_0x357b0d){var _0x3d77d9={};_0x3d77d9[_0x357b0d]={'$like':'%'+_0x9833be['query'][_0xc661('0x4d')]+'%'};return _0x3d77d9;})});}_0x30a8c7=_[_0xc661('0x4e')]({},_0x30a8c7,_0x9833be['options']);return _0x4b563c[_0xc661('0xa9')](_0x30a8c7);}})[_0xc661('0x1f')](function(_0x3c1273){if(_0x3c1273){_0x4d8c9a=_0x3c1273['length'];if(!_0x9833be[_0xc661('0x42')]['hasOwnProperty'](_0xc661('0x48'))){_0x30a8c7[_0xc661('0x2e')]=qs[_0xc661('0x2e')](_0x9833be[_0xc661('0x42')][_0xc661('0x2e')]);_0x30a8c7[_0xc661('0x2c')]=qs[_0xc661('0x2c')](_0x9833be[_0xc661('0x42')]['offset']);}return _0x4b563c[_0xc661('0xa9')](_0x30a8c7);}})[_0xc661('0x1f')](function(_0x141a38){if(_0x141a38){return _0x141a38?{'count':_0x4d8c9a,'rows':_0x141a38}:null;}})[_0xc661('0x1f')](respondWithResult(_0x409464,null))['catch'](handleError(_0x409464,null));};exports['getInteractions']=function(_0x17d5de,_0x31b0d2,_0x221455){var _0x3e1d16={'raw':![],'where':{}};var _0x2e5419={};var _0x1edac7={'count':0x0,'rows':[]};return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x17d5de[_0xc661('0x56')]['id']}})['then'](handleEntityNotFound(_0x31b0d2,null))[_0xc661('0x1f')](function(_0x57f869){if(_0x57f869){_0x2e5419[_0xc661('0x41')]=_[_0xc661('0x57')](db[_0xc661('0x91')]['rawAttributes']);_0x2e5419[_0xc661('0x42')]=_[_0xc661('0x57')](_0x17d5de[_0xc661('0x42')]);_0x2e5419[_0xc661('0x4c')]=_[_0xc661('0x43')](_0x2e5419[_0xc661('0x41')],_0x2e5419[_0xc661('0x42')]);_0x3e1d16['attributes']=_['intersection'](_0x2e5419[_0xc661('0x41')],qs[_0xc661('0x45')](_0x17d5de[_0xc661('0x42')][_0xc661('0x45')]));_0x3e1d16['attributes']=_0x3e1d16['attributes']['length']?_0x3e1d16[_0xc661('0x44')]:_0x2e5419['model'];if(!_0x17d5de['query']['hasOwnProperty'](_0xc661('0x48'))){_0x3e1d16[_0xc661('0x2e')]=qs[_0xc661('0x2e')](_0x17d5de[_0xc661('0x42')][_0xc661('0x2e')]);_0x3e1d16[_0xc661('0x2c')]=qs[_0xc661('0x2c')](_0x17d5de[_0xc661('0x42')]['offset']);}_0x3e1d16['order']=qs['sort'](_0x17d5de[_0xc661('0x42')][_0xc661('0x4a')]);_0x3e1d16[_0xc661('0x4b')]=qs[_0xc661('0x4c')](_[_0xc661('0x6a')](_0x17d5de[_0xc661('0x42')],_0x2e5419[_0xc661('0x4c')]));_0x3e1d16[_0xc661('0x4b')][_0xc661('0x66')]=_0x57f869['id'];if(_0x17d5de['query'][_0xc661('0x4d')]){_0x3e1d16['where']=_[_0xc661('0x4e')](_0x3e1d16[_0xc661('0x4b')],{'$or':_[_0xc661('0x3c')](_0x3e1d16[_0xc661('0x44')],function(_0x2436e9){var _0x33e384={};_0x33e384[_0x2436e9]={'$like':'%'+_0x17d5de[_0xc661('0x42')]['filter']+'%'};return _0x33e384;})});}_0x3e1d16=_[_0xc661('0x4e')]({},_0x3e1d16,_0x17d5de[_0xc661('0x59')]);return db[_0xc661('0x91')][_0xc661('0x50')]({'where':_0x3e1d16[_0xc661('0x4b')]})['then'](function(_0x859646){_0x1edac7[_0xc661('0x50')]=_0x859646;if(_0x17d5de[_0xc661('0x42')][_0xc661('0x58')]){_0x3e1d16[_0xc661('0x51')]=[{'model':db[_0xc661('0x73')],'as':_0xc661('0xaa'),'required':![]},{'model':db[_0xc661('0x9b')],'as':'Owner','attributes':[_0xc661('0x37'),_0xc661('0xab'),_0xc661('0xac')],'required':![]},{'model':db['Tag'],'as':_0xc661('0xad'),'attributes':['id','name',_0xc661('0xae')],'where':_0x17d5de[_0xc661('0x42')]['tag']?{'id':_0x17d5de[_0xc661('0x42')][_0xc661('0xaf')]}:undefined,'required':_0x17d5de['query'][_0xc661('0xaf')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xc661('0x53')](_0x3e1d16);})[_0xc661('0x1f')](function(_0x2c7c8a){_0x1edac7['rows']=_0x2c7c8a;return _0x1edac7;});}})['then'](respondWithFilteredResult(_0x31b0d2,_0x3e1d16))['catch'](handleError(_0x31b0d2,null));};exports[_0xc661('0xb0')]=function(_0x226b05,_0x4b2428,_0x2e0b36){return db['OpenchannelAccount'][_0xc661('0x5a')]({'where':{'id':_0x226b05['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x4b2428,null))[_0xc661('0x1f')](function(_0x1dbb0f){if(_0x1dbb0f){return _0x1dbb0f[_0xc661('0xb0')](_0x226b05[_0xc661('0x5c')]['ids'],_['omit'](_0x226b05[_0xc661('0x5c')],[_0xc661('0x70'),'id'])||{})[_0xc661('0xb1')](function(_0x5deba0){for(var _0x2f9cef=0x0;_0x2f9cef<_0x226b05[_0xc661('0x5c')][_0xc661('0x70')][_0xc661('0x46')];_0x2f9cef+=0x1){socket[_0xc661('0xb2')](_0xc661('0xb3'),{'UserId':Number(_0x226b05[_0xc661('0x5c')][_0xc661('0x70')][_0x2f9cef]),'OpenchannelAccountId':Number(_0x226b05['params']['id'])});}return _0x5deba0;});}})[_0xc661('0x1f')](respondWithResult(_0x4b2428,null))[_0xc661('0x27')](handleError(_0x4b2428,null));};exports[_0xc661('0xb4')]=function(_0x30224d,_0x5c0e29,_0x1f0c71){return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x30224d['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x5c0e29,null))[_0xc661('0x1f')](function(_0x79ab54){if(_0x79ab54){return _0x79ab54[_0xc661('0xb4')](_0x30224d[_0xc661('0x42')]['ids'])[_0xc661('0x1f')](function(){if(_[_0xc661('0xb5')](_0x30224d[_0xc661('0x42')][_0xc661('0x70')])){for(var _0x5087c7=0x0;_0x5087c7<_0x30224d[_0xc661('0x42')][_0xc661('0x70')][_0xc661('0x46')];_0x5087c7+=0x1){socket[_0xc661('0xb2')](_0xc661('0xb6'),{'UserId':Number(_0x30224d[_0xc661('0x42')][_0xc661('0x70')][_0x5087c7]),'OpenchannelAccountId':Number(_0x30224d[_0xc661('0x56')]['id'])});}}else{socket[_0xc661('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x30224d['query'][_0xc661('0x70')]),'OpenchannelAccountId':Number(_0x30224d[_0xc661('0x56')]['id'])});}});}})[_0xc661('0x1f')](respondWithStatusCode(_0x5c0e29,null))[_0xc661('0x27')](handleError(_0x5c0e29,null));};exports[_0xc661('0xb7')]=function(_0x1ebbbc,_0x35ce67,_0x231280){var _0x183f0c={};var _0x3fad92={};var _0x44fcb0;var _0x4f354b;return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x1ebbbc[_0xc661('0x56')]['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x35ce67,null))[_0xc661('0x1f')](function(_0x1deafc){if(_0x1deafc){_0x44fcb0=_0x1deafc;_0x3fad92['model']=_[_0xc661('0x57')](db[_0xc661('0x9b')][_0xc661('0x3d')]);_0x3fad92['query']=_[_0xc661('0x57')](_0x1ebbbc[_0xc661('0x42')]);_0x3fad92[_0xc661('0x4c')]=_['intersection'](_0x3fad92[_0xc661('0x41')],_0x3fad92[_0xc661('0x42')]);_0x183f0c[_0xc661('0x44')]=_[_0xc661('0x43')](_0x3fad92[_0xc661('0x41')],qs['fields'](_0x1ebbbc[_0xc661('0x42')]['fields']));_0x183f0c[_0xc661('0x44')]=_0x183f0c['attributes'][_0xc661('0x46')]?_0x183f0c['attributes']:_0x3fad92[_0xc661('0x41')];_0x183f0c['order']=qs['sort'](_0x1ebbbc['query'][_0xc661('0x4a')]);_0x183f0c[_0xc661('0x4b')]=qs[_0xc661('0x4c')](_['pick'](_0x1ebbbc[_0xc661('0x42')],_0x3fad92['filters']));if(_0x1ebbbc[_0xc661('0x42')][_0xc661('0x4d')]){_0x183f0c[_0xc661('0x4b')]=_[_0xc661('0x4e')](_0x183f0c[_0xc661('0x4b')],{'$or':_[_0xc661('0x3c')](_0x183f0c[_0xc661('0x44')],function(_0x479c4){var _0x91d8f2={};_0x91d8f2[_0x479c4]={'$like':'%'+_0x1ebbbc[_0xc661('0x42')]['filter']+'%'};return _0x91d8f2;})});}_0x183f0c=_[_0xc661('0x4e')]({},_0x183f0c,_0x1ebbbc[_0xc661('0x59')]);return _0x44fcb0['getAgents'](_0x183f0c);}})[_0xc661('0x1f')](function(_0x481133){if(_0x481133){_0x4f354b=_0x481133[_0xc661('0x46')];if(!_0x1ebbbc['query'][_0xc661('0x47')](_0xc661('0x48'))){_0x183f0c['limit']=qs[_0xc661('0x2e')](_0x1ebbbc[_0xc661('0x42')][_0xc661('0x2e')]);_0x183f0c[_0xc661('0x2c')]=qs[_0xc661('0x2c')](_0x1ebbbc[_0xc661('0x42')]['offset']);}return _0x44fcb0[_0xc661('0xb7')](_0x183f0c);}})[_0xc661('0x1f')](function(_0x264ec1){if(_0x264ec1){return _0x264ec1?{'count':_0x4f354b,'rows':_0x264ec1}:null;}})[_0xc661('0x1f')](respondWithResult(_0x35ce67,null))[_0xc661('0x27')](handleError(_0x35ce67,null));};exports[_0xc661('0x38')]=function(_0x46279c,_0x151b50,_0x1c69af){var _0x2a3c7f,_0x25a04d,_0x1bb40b;if(_[_0xc661('0x79')](_0x46279c['body'][_0xc661('0x5c')])||_0x46279c[_0xc661('0x5c')][_0xc661('0x5c')]===''){throw new db['Sequelize']['ValidationError'](_0xc661('0x7c'));}if(_[_0xc661('0x79')](_0x46279c[_0xc661('0x5c')]['to'])){}_0x2a3c7f=_0x46279c['body']['to'];return db[_0xc661('0x52')][_0xc661('0x68')]({'where':{'id':_0x46279c['params']['id']}})[_0xc661('0x1f')](handleEntityNotFound(_0x151b50,null))[_0xc661('0x1f')](function(_0x57f93c){if(_0x57f93c){return db[_0xc661('0x52')][_0xc661('0x5a')]({'where':{'id':_0x57f93c['id']},'include':[{'model':db[_0xc661('0x80')],'as':_0xc661('0x81'),'include':[{'model':db['CmContact'],'as':_0xc661('0x8b'),'where':{[_0x57f93c[_0xc661('0x7d')]]:_0x2a3c7f},'limit':0x1,'order':[['updatedAt',_0xc661('0x82')]]}]}]})[_0xc661('0x1f')](handleEntityNotFound(_0x151b50,null))[_0xc661('0x1f')](function(_0x445901){if(_0x445901&&_0x445901[_0xc661('0x81')]){_0x25a04d=_0x445901[_0xc661('0x5e')]({'plain':!![]});if(_0x25a04d[_0xc661('0x81')]&&_0x25a04d[_0xc661('0x81')][_0xc661('0x8b')]['length']){return _0x25a04d['List'][_0xc661('0x8b')][0x0];}return db[_0xc661('0x73')]['create'](_[_0xc661('0x17')](_0x46279c[_0xc661('0x5c')],{'firstName':_0x2a3c7f,[_0x445901[_0xc661('0x7d')]]:_0x2a3c7f,'phone':_0x2a3c7f,'ListId':_0x25a04d[_0xc661('0x8c')]}));}})[_0xc661('0x1f')](handleEntityNotFound(_0x151b50,null))[_0xc661('0x1f')](function(_0x4995ea){if(_0x4995ea){_0x1bb40b=_0x4995ea;return db[_0xc661('0x91')][_0xc661('0x5a')]({'where':{'ContactId':_0x1bb40b['id'],'closed':![],'OpenchannelAccountId':_0x25a04d['id']}})[_0xc661('0x1f')](function(_0x24e8b3){if(_0x24e8b3){return[_0x24e8b3,![]];}return db['OpenchannelInteraction'][_0xc661('0x5b')]({'UserId':_0x46279c['user']['id'],'ContactId':_0x1bb40b['id'],'OpenchannelAccountId':_0x25a04d['id'],'lastMsgDirection':_0xc661('0xb8'),'firstMsgDirection':'out','Messages':[_[_0xc661('0x4e')](_0x46279c['body'],{'read':![],'body':_0x46279c[_0xc661('0x5c')][_0xc661('0x5c')],'OpenchannelAccountId':_0x25a04d['id'],'UserId':_0x46279c['user']['id'],'ContactId':_0x1bb40b['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xc661('0x1f')](function(_0x498a0a){return[_0x498a0a,!![]];});});}})['spread'](function(_0x16ee72,_0x5759ea){if(_0x5759ea){return _0x16ee72;}return db[_0xc661('0x99')][_0xc661('0x5b')](_[_0xc661('0x4e')](_0x46279c[_0xc661('0x5c')],{'read':![],'body':_0x46279c[_0xc661('0x5c')][_0xc661('0x5c')],'OpenchannelAccountId':_0x25a04d['id'],'OpenchannelInteractionId':_0x16ee72['id'],'UserId':_0x46279c[_0xc661('0x5d')]['id'],'ContactId':_0x1bb40b['id']}))[_0xc661('0x1f')](function(_0x307e5b){_0x16ee72[_0xc661('0xb9')]['Messages']=[];_0x16ee72[_0xc661('0xb9')][_0xc661('0xba')][_0xc661('0xbb')](_0x307e5b[_0xc661('0xb9')]);return _0x16ee72;});});}})[_0xc661('0x1f')](respondWithResult(_0x151b50,null))[_0xc661('0x27')](handleError(_0x151b50,null));}; \ No newline at end of file +var _0xb95a=['map','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','Pause','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpenchannelAccountId','Disposition','findOne','order','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','openchannel','Sequelize','createdAt','updatedAt','difference','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmContact','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','orderBy','asc','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','Start','EventManager','notify','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xb95a,0x13b));var _0xab95=function(_0x56cba2,_0x2b1cd8){_0x56cba2=_0x56cba2-0x0;var _0x1060c8=_0xb95a[_0x56cba2];return _0x1060c8;};'use strict';var emlformat=require(_0xab95('0x0'));var rimraf=require(_0xab95('0x1'));var zipdir=require(_0xab95('0x2'));var jsonpatch=require(_0xab95('0x3'));var rp=require(_0xab95('0x4'));var moment=require(_0xab95('0x5'));var BPromise=require(_0xab95('0x6'));var Mustache=require(_0xab95('0x7'));var util=require(_0xab95('0x8'));var path=require(_0xab95('0x9'));var sox=require(_0xab95('0xa'));var csv=require(_0xab95('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab95('0xc'));var _=require(_0xab95('0xd'));var squel=require(_0xab95('0xe'));var crypto=require('crypto');var jsforce=require(_0xab95('0xf'));var deskjs=require(_0xab95('0x10'));var toCsv=require(_0xab95('0xb'));var querystring=require(_0xab95('0x11'));var Papa=require(_0xab95('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xab95('0x13'));var as=require(_0xab95('0x14'));var hardwareService=require(_0xab95('0x15'));var logger=require('../../config/logger')(_0xab95('0x16'));var utils=require(_0xab95('0x17'));var config=require(_0xab95('0x18'));var licenseUtil=require(_0xab95('0x19'));var db=require(_0xab95('0x1a'))['db'];config[_0xab95('0x1b')]=_[_0xab95('0x1c')](config[_0xab95('0x1b')],{'host':_0xab95('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xab95('0x1b')]));require(_0xab95('0x1e'))[_0xab95('0x1f')](socket);var jayson=require(_0xab95('0x20'));var client=jayson[_0xab95('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xab95('0x21')][_0xab95('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x29a86f,_0x37851b,_0x4dcbd3,_0x7d66d7){return new BPromise(function(_0x182d34,_0x1ca1f4){var _0x20380a=_0x7d66d7||client;return _0x20380a['request'](_0x29a86f,_0x4dcbd3)[_0xab95('0x23')](function(_0x5dae74){logger[_0xab95('0x24')](_0xab95('0x25'),_0x37851b,_0xab95('0x26'));logger[_0xab95('0x27')](_0xab95('0x28'),_0x37851b,'request\x20sent',JSON['stringify'](_0x5dae74));if(_0x5dae74[_0xab95('0x29')]){if(_0x5dae74[_0xab95('0x29')][_0xab95('0x2a')]===0x1f4){logger[_0xab95('0x29')](_0xab95('0x25'),_0x37851b,_0x5dae74[_0xab95('0x29')][_0xab95('0x2b')]);return _0x1ca1f4(_0x5dae74['error'][_0xab95('0x2b')]);}logger[_0xab95('0x29')](_0xab95('0x25'),_0x37851b,_0x5dae74['error'][_0xab95('0x2b')]);return _0x182d34(_0x5dae74[_0xab95('0x29')][_0xab95('0x2b')]);}else{logger[_0xab95('0x24')](_0xab95('0x25'),_0x37851b,'request\x20sent');_0x182d34(_0x5dae74[_0xab95('0x2c')][_0xab95('0x2b')]);}})[_0xab95('0x2d')](function(_0x44dd57){logger[_0xab95('0x29')](_0xab95('0x25'),_0x37851b,_0x44dd57);_0x1ca1f4(_0x44dd57);});});}function respondWithStatusCode(_0x55108e,_0x53e14f){_0x53e14f=_0x53e14f||0xcc;return function(_0x405d45){if(_0x405d45){return _0x55108e['sendStatus'](_0x53e14f);}return _0x55108e[_0xab95('0x2e')](_0x53e14f)[_0xab95('0x2f')]();};}function respondWithResult(_0xf0caeb,_0x39f683){_0x39f683=_0x39f683||0xc8;return function(_0x1a0245){if(_0x1a0245){return _0xf0caeb[_0xab95('0x2e')](_0x39f683)[_0xab95('0x30')](_0x1a0245);}};}function respondWithFilteredResult(_0x3efc76,_0x598eff){return function(_0x4c9702){if(_0x4c9702){var _0x4d98d6=typeof _0x598eff[_0xab95('0x31')]==='undefined'&&typeof _0x598eff[_0xab95('0x32')]===_0xab95('0x33');var _0x3313a8=_0x4c9702['count'];var _0x14c3a5=_0x4d98d6?0x0:_0x598eff['offset'];var _0x1d2c4b=_0x4d98d6?_0x4c9702[_0xab95('0x34')]:_0x598eff[_0xab95('0x31')]+_0x598eff[_0xab95('0x32')];var _0x3508ab;if(_0x1d2c4b>=_0x3313a8){_0x1d2c4b=_0x3313a8;_0x3508ab=0xc8;}else{_0x3508ab=0xce;}_0x3efc76[_0xab95('0x2e')](_0x3508ab);return _0x3efc76[_0xab95('0x35')](_0xab95('0x36'),_0x14c3a5+'-'+_0x1d2c4b+'/'+_0x3313a8)[_0xab95('0x30')](_0x4c9702);}return null;};}function patchUpdates(_0xedd1a1){return function(_0x1bbf2f){try{jsonpatch[_0xab95('0x37')](_0x1bbf2f,_0xedd1a1,!![]);}catch(_0x197381){return BPromise[_0xab95('0x38')](_0x197381);}return _0x1bbf2f['save']();};}function saveUpdates(_0x411982,_0x46bf7e){return function(_0x466845){if(_0x466845){return _0x466845[_0xab95('0x39')](_0x411982)[_0xab95('0x23')](function(_0x18e3ef){return _0x18e3ef;});}return null;};}function removeEntity(_0x440f2b,_0x3948e5){return function(_0xe9122e){if(_0xe9122e){return _0xe9122e[_0xab95('0x3a')]()[_0xab95('0x23')](function(){var _0x516167=_0xe9122e[_0xab95('0x3b')]({'plain':!![]});var _0x4dff5b='OpenchannelAccounts';return db[_0xab95('0x3c')]['destroy']({'where':{'type':_0x4dff5b,'resourceId':_0x516167['id']}})[_0xab95('0x23')](function(){return _0xe9122e;});})['then'](function(){_0x440f2b[_0xab95('0x2e')](0xcc)[_0xab95('0x2f')]();});}};}function handleEntityNotFound(_0x323308,_0x2a7189){return function(_0x22de52){if(!_0x22de52){_0x323308[_0xab95('0x3d')](0x194);}return _0x22de52;};}function handleError(_0x5c079d,_0x493283){_0x493283=_0x493283||0x1f4;return function(_0x2e4cd0){logger[_0xab95('0x29')](_0x2e4cd0[_0xab95('0x3e')]);if(_0x2e4cd0['name']){delete _0x2e4cd0[_0xab95('0x3f')];}_0x5c079d[_0xab95('0x2e')](_0x493283)[_0xab95('0x40')](_0x2e4cd0);};}exports[_0xab95('0x41')]=function(_0x26735d,_0x5a3b95){var _0x7e78ff={'include':[{'model':db['Pause'],'as':_0xab95('0x42')}]},_0x2cab53={},_0x423c3a={'count':0x0,'rows':[]};var _0x5ce3d9=_['map'](db[_0xab95('0x43')][_0xab95('0x44')],function(_0x4b8554){return{'name':_0x4b8554[_0xab95('0x45')],'type':_0x4b8554[_0xab95('0x46')]['key']};});_0x2cab53['model']=_[_0xab95('0x47')](_0x5ce3d9,_0xab95('0x3f'));_0x2cab53[_0xab95('0x48')]=_[_0xab95('0x49')](_0x26735d['query']);_0x2cab53['filters']=_['intersection'](_0x2cab53['model'],_0x2cab53['query']);_0x7e78ff[_0xab95('0x4a')]=_[_0xab95('0x4b')](_0x2cab53[_0xab95('0x4c')],qs['fields'](_0x26735d[_0xab95('0x48')][_0xab95('0x4d')]));_0x7e78ff[_0xab95('0x4a')]=_0x7e78ff[_0xab95('0x4a')][_0xab95('0x4e')]?_0x7e78ff['attributes']:_0x2cab53['model'];if(!_0x26735d[_0xab95('0x48')][_0xab95('0x4f')](_0xab95('0x50'))){_0x7e78ff[_0xab95('0x32')]=qs[_0xab95('0x32')](_0x26735d[_0xab95('0x48')][_0xab95('0x32')]);_0x7e78ff[_0xab95('0x31')]=qs[_0xab95('0x31')](_0x26735d[_0xab95('0x48')][_0xab95('0x31')]);}_0x7e78ff['order']=qs['sort'](_0x26735d[_0xab95('0x48')][_0xab95('0x51')]);_0x7e78ff[_0xab95('0x52')]=qs[_0xab95('0x53')](_[_0xab95('0x54')](_0x26735d[_0xab95('0x48')],_0x2cab53[_0xab95('0x53')]),_0x5ce3d9);if(_0x26735d[_0xab95('0x48')][_0xab95('0x55')]){_0x7e78ff['where']=_[_0xab95('0x56')](_0x7e78ff['where'],{'$or':_['map'](_0x5ce3d9,function(_0x12fe77){if(_0x12fe77[_0xab95('0x46')]!==_0xab95('0x57')){var _0x573208={};_0x573208[_0x12fe77[_0xab95('0x3f')]]={'$like':'%'+_0x26735d[_0xab95('0x48')]['filter']+'%'};return _0x573208;}})});}_0x7e78ff=_[_0xab95('0x56')]({},_0x7e78ff,_0x26735d['options']);var _0x470535={'where':_0x7e78ff[_0xab95('0x52')]};return db[_0xab95('0x43')]['count'](_0x470535)['then'](function(_0x19e862){_0x423c3a[_0xab95('0x34')]=_0x19e862;if(_0x26735d[_0xab95('0x48')][_0xab95('0x58')]){_0x7e78ff[_0xab95('0x59')]=[{'all':!![]}];}return db[_0xab95('0x43')][_0xab95('0x5a')](_0x7e78ff);})[_0xab95('0x23')](function(_0x30d15d){_0x423c3a['rows']=_0x30d15d;return _0x423c3a;})['then'](respondWithFilteredResult(_0x5a3b95,_0x7e78ff))[_0xab95('0x2d')](handleError(_0x5a3b95,null));};exports[_0xab95('0x5b')]=function(_0x3e7228,_0x10b5d7){var _0x298d50={'raw':![],'where':{'id':_0x3e7228[_0xab95('0x5c')]['id']},'include':[{'model':db[_0xab95('0x5d')],'as':'mandatoryDispositionPause'}]},_0x36bee9={};_0x36bee9[_0xab95('0x4c')]=_[_0xab95('0x49')](db[_0xab95('0x43')]['rawAttributes']);_0x36bee9[_0xab95('0x48')]=_[_0xab95('0x49')](_0x3e7228[_0xab95('0x48')]);_0x36bee9['filters']=_['intersection'](_0x36bee9[_0xab95('0x4c')],_0x36bee9[_0xab95('0x48')]);_0x298d50['attributes']=_[_0xab95('0x4b')](_0x36bee9[_0xab95('0x4c')],qs[_0xab95('0x4d')](_0x3e7228['query'][_0xab95('0x4d')]));_0x298d50[_0xab95('0x4a')]=_0x298d50[_0xab95('0x4a')][_0xab95('0x4e')]?_0x298d50['attributes']:_0x36bee9['model'];if(_0x3e7228[_0xab95('0x48')]['includeAll']){_0x298d50[_0xab95('0x59')]=[{'all':!![]}];}_0x298d50=_[_0xab95('0x56')]({},_0x298d50,_0x3e7228[_0xab95('0x5e')]);return db[_0xab95('0x43')][_0xab95('0x5f')](_0x298d50)[_0xab95('0x23')](handleEntityNotFound(_0x10b5d7,null))['then'](respondWithResult(_0x10b5d7,null))[_0xab95('0x2d')](handleError(_0x10b5d7,null));};exports[_0xab95('0x60')]=function(_0x3b5eba,_0x39c8dd){return db[_0xab95('0x43')][_0xab95('0x60')](_0x3b5eba[_0xab95('0x61')],{})['then'](function(_0x328a28){var _0x16015d=_0x3b5eba['user']['get']({'plain':!![]});if(!_0x16015d)throw new Error(_0xab95('0x62'));if(_0x16015d[_0xab95('0x63')]===_0xab95('0x64')){var _0x12fc03=_0x328a28['get']({'plain':!![]});var _0x14edfa=_0xab95('0x65');return db[_0xab95('0x66')]['find']({'where':{'name':_0x14edfa,'userProfileId':_0x16015d[_0xab95('0x67')]},'raw':!![]})[_0xab95('0x23')](function(_0x2731d8){if(_0x2731d8&&_0x2731d8[_0xab95('0x68')]===0x0){return db[_0xab95('0x3c')][_0xab95('0x60')]({'name':_0x12fc03[_0xab95('0x3f')],'resourceId':_0x12fc03['id'],'type':_0x2731d8[_0xab95('0x3f')],'sectionId':_0x2731d8['id']},{})[_0xab95('0x23')](function(){return _0x328a28;});}else{return _0x328a28;}})[_0xab95('0x2d')](function(_0x383537){logger[_0xab95('0x29')](_0xab95('0x69'),_0x383537);throw _0x383537;});}return _0x328a28;})['then'](respondWithResult(_0x39c8dd,0xc9))[_0xab95('0x2d')](handleError(_0x39c8dd,null));};exports['update']=function(_0x4faefb,_0x3790bd){if(_0x4faefb[_0xab95('0x61')]['id']){delete _0x4faefb[_0xab95('0x61')]['id'];}return db[_0xab95('0x43')][_0xab95('0x5f')]({'where':{'id':_0x4faefb[_0xab95('0x5c')]['id']},'include':[{'model':db[_0xab95('0x5d')],'as':_0xab95('0x42')}]})[_0xab95('0x23')](handleEntityNotFound(_0x3790bd,null))[_0xab95('0x23')](saveUpdates(_0x4faefb[_0xab95('0x61')],null))['then'](respondWithResult(_0x3790bd,null))[_0xab95('0x2d')](handleError(_0x3790bd,null));};exports[_0xab95('0x3a')]=function(_0x22bdcc,_0x2b3a12){return db[_0xab95('0x43')][_0xab95('0x5f')]({'where':{'id':_0x22bdcc[_0xab95('0x5c')]['id']}})[_0xab95('0x23')](handleEntityNotFound(_0x2b3a12,null))[_0xab95('0x23')](removeEntity(_0x2b3a12,null))['catch'](handleError(_0x2b3a12,null));};exports[_0xab95('0x6a')]=function(_0x4ed455,_0x53ebfb){return db[_0xab95('0x43')][_0xab95('0x6a')]()[_0xab95('0x23')](respondWithResult(_0x53ebfb,null))[_0xab95('0x2d')](handleError(_0x53ebfb,null));};exports[_0xab95('0x6b')]=function(_0x579b4d,_0x186d26,_0x18a8b7){if(_0x579b4d[_0xab95('0x61')]['id']){delete _0x579b4d['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x579b4d[_0xab95('0x5c')]['id']}})['then'](handleEntityNotFound(_0x186d26,null))[_0xab95('0x23')](function(_0x46203d){if(_0x46203d){_0x579b4d['body'][_0xab95('0x6c')]=_0x46203d['id'];return db[_0xab95('0x6d')][_0xab95('0x60')](_0x579b4d[_0xab95('0x61')]);}})[_0xab95('0x23')](respondWithResult(_0x186d26,null))[_0xab95('0x2d')](handleError(_0x186d26,null));};exports['getDispositions']=function(_0x5cbbb0,_0x5b0812,_0x5c81ef){var _0x350859={'raw':![],'where':{}};var _0x3b8dc3={};var _0x43794a={'count':0x0,'rows':[]};return db[_0xab95('0x43')][_0xab95('0x6e')]({'where':{'id':_0x5cbbb0['params']['id']}})['then'](handleEntityNotFound(_0x5b0812,null))[_0xab95('0x23')](function(_0x121ffc){if(_0x121ffc){_0x3b8dc3[_0xab95('0x4c')]=_[_0xab95('0x49')](db[_0xab95('0x6d')][_0xab95('0x44')]);_0x3b8dc3[_0xab95('0x48')]=_[_0xab95('0x49')](_0x5cbbb0[_0xab95('0x48')]);_0x3b8dc3[_0xab95('0x53')]=_[_0xab95('0x4b')](_0x3b8dc3[_0xab95('0x4c')],_0x3b8dc3[_0xab95('0x48')]);_0x350859[_0xab95('0x4a')]=_[_0xab95('0x4b')](_0x3b8dc3[_0xab95('0x4c')],qs[_0xab95('0x4d')](_0x5cbbb0[_0xab95('0x48')]['fields']));_0x350859['attributes']=_0x350859[_0xab95('0x4a')]['length']?_0x350859['attributes']:_0x3b8dc3['model'];if(!_0x5cbbb0[_0xab95('0x48')][_0xab95('0x4f')](_0xab95('0x50'))){_0x350859['limit']=qs[_0xab95('0x32')](_0x5cbbb0['query']['limit']);_0x350859[_0xab95('0x31')]=qs['offset'](_0x5cbbb0['query'][_0xab95('0x31')]);}_0x350859[_0xab95('0x6f')]=qs[_0xab95('0x51')](_0x5cbbb0['query']['sort']);_0x350859[_0xab95('0x52')]=qs['filters'](_[_0xab95('0x54')](_0x5cbbb0[_0xab95('0x48')],_0x3b8dc3[_0xab95('0x53')]));_0x350859[_0xab95('0x52')]['OpenchannelAccountId']=_0x121ffc['id'];if(_0x5cbbb0['query'][_0xab95('0x55')]){_0x350859[_0xab95('0x52')]=_['merge'](_0x350859[_0xab95('0x52')],{'$or':_[_0xab95('0x47')](_0x350859['attributes'],function(_0x54aed6){var _0x378a8e={};_0x378a8e[_0x54aed6]={'$like':'%'+_0x5cbbb0['query']['filter']+'%'};return _0x378a8e;})});}_0x350859=_[_0xab95('0x56')]({},_0x350859,_0x5cbbb0['options']);return db[_0xab95('0x6d')]['count']({'where':_0x350859[_0xab95('0x52')]})[_0xab95('0x23')](function(_0xf4bd1){_0x43794a[_0xab95('0x34')]=_0xf4bd1;if(_0x5cbbb0[_0xab95('0x48')][_0xab95('0x58')]){_0x350859[_0xab95('0x59')]=[{'all':!![]}];}return db[_0xab95('0x6d')][_0xab95('0x5a')](_0x350859);})[_0xab95('0x23')](function(_0x20ea3e){_0x43794a[_0xab95('0x70')]=_0x20ea3e;return _0x43794a;});}})[_0xab95('0x23')](respondWithFilteredResult(_0x5b0812,_0x350859))[_0xab95('0x2d')](handleError(_0x5b0812,null));};exports[_0xab95('0x71')]=function(_0x29b331,_0x5431b4,_0x46efd1){return db['OpenchannelAccount'][_0xab95('0x5f')]({'where':{'id':_0x29b331['params']['id']}})[_0xab95('0x23')](handleEntityNotFound(_0x5431b4,null))['then'](function(_0xb1776c){if(_0xb1776c){return _0xb1776c[_0xab95('0x71')](_0x29b331[_0xab95('0x48')][_0xab95('0x72')]);}})[_0xab95('0x23')](respondWithStatusCode(_0x5431b4,null))[_0xab95('0x2d')](handleError(_0x5431b4,null));};exports['addAnswer']=function(_0x661076,_0x5582e4,_0x55a9e5){if(_0x661076[_0xab95('0x61')]['id']){delete _0x661076[_0xab95('0x61')]['id'];}return db[_0xab95('0x43')][_0xab95('0x5f')]({'where':{'id':_0x661076[_0xab95('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5582e4,null))[_0xab95('0x23')](function(_0x2f8448){if(_0x2f8448){_0x661076[_0xab95('0x61')][_0xab95('0x6c')]=_0x2f8448['id'];return db[_0xab95('0x73')][_0xab95('0x60')](_0x661076[_0xab95('0x61')]);}})[_0xab95('0x23')](respondWithResult(_0x5582e4,null))[_0xab95('0x2d')](handleError(_0x5582e4,null));};exports[_0xab95('0x74')]=function(_0x3eb34d,_0x22799c,_0x28db74){var _0x3b4f42={'raw':![],'where':{}};var _0x2ce3db={};var _0xe7cef2={'count':0x0,'rows':[]};return db[_0xab95('0x43')][_0xab95('0x6e')]({'where':{'id':_0x3eb34d['params']['id']}})[_0xab95('0x23')](handleEntityNotFound(_0x22799c,null))[_0xab95('0x23')](function(_0x22baae){if(_0x22baae){_0x2ce3db['model']=_[_0xab95('0x49')](db[_0xab95('0x73')][_0xab95('0x44')]);_0x2ce3db['query']=_[_0xab95('0x49')](_0x3eb34d[_0xab95('0x48')]);_0x2ce3db[_0xab95('0x53')]=_['intersection'](_0x2ce3db['model'],_0x2ce3db[_0xab95('0x48')]);_0x3b4f42[_0xab95('0x4a')]=_[_0xab95('0x4b')](_0x2ce3db[_0xab95('0x4c')],qs[_0xab95('0x4d')](_0x3eb34d[_0xab95('0x48')][_0xab95('0x4d')]));_0x3b4f42[_0xab95('0x4a')]=_0x3b4f42[_0xab95('0x4a')][_0xab95('0x4e')]?_0x3b4f42['attributes']:_0x2ce3db[_0xab95('0x4c')];if(!_0x3eb34d['query'][_0xab95('0x4f')](_0xab95('0x50'))){_0x3b4f42[_0xab95('0x32')]=qs['limit'](_0x3eb34d['query'][_0xab95('0x32')]);_0x3b4f42[_0xab95('0x31')]=qs[_0xab95('0x31')](_0x3eb34d[_0xab95('0x48')][_0xab95('0x31')]);}_0x3b4f42['order']=qs[_0xab95('0x51')](_0x3eb34d['query']['sort']);_0x3b4f42['where']=qs[_0xab95('0x53')](_[_0xab95('0x54')](_0x3eb34d['query'],_0x2ce3db[_0xab95('0x53')]));_0x3b4f42[_0xab95('0x52')][_0xab95('0x6c')]=_0x22baae['id'];if(_0x3eb34d[_0xab95('0x48')][_0xab95('0x55')]){_0x3b4f42[_0xab95('0x52')]=_['merge'](_0x3b4f42[_0xab95('0x52')],{'$or':_[_0xab95('0x47')](_0x3b4f42[_0xab95('0x4a')],function(_0x3f29e5){var _0x5bd87a={};_0x5bd87a[_0x3f29e5]={'$like':'%'+_0x3eb34d[_0xab95('0x48')][_0xab95('0x55')]+'%'};return _0x5bd87a;})});}_0x3b4f42=_['merge']({},_0x3b4f42,_0x3eb34d['options']);return db[_0xab95('0x73')][_0xab95('0x34')]({'where':_0x3b4f42['where']})[_0xab95('0x23')](function(_0x12518e){_0xe7cef2[_0xab95('0x34')]=_0x12518e;if(_0x3eb34d[_0xab95('0x48')][_0xab95('0x58')]){_0x3b4f42[_0xab95('0x59')]=[{'all':!![]}];}return db[_0xab95('0x73')][_0xab95('0x5a')](_0x3b4f42);})[_0xab95('0x23')](function(_0x50721b){_0xe7cef2[_0xab95('0x70')]=_0x50721b;return _0xe7cef2;});}})[_0xab95('0x23')](respondWithFilteredResult(_0x22799c,_0x3b4f42))[_0xab95('0x2d')](handleError(_0x22799c,null));};exports['removeAnswers']=function(_0x457374,_0x2ca527,_0x228d8f){return db[_0xab95('0x43')][_0xab95('0x5f')]({'where':{'id':_0x457374[_0xab95('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2ca527,null))[_0xab95('0x23')](function(_0x594d38){if(_0x594d38){return _0x594d38[_0xab95('0x75')](_0x457374[_0xab95('0x48')][_0xab95('0x72')]);}})[_0xab95('0x23')](respondWithStatusCode(_0x2ca527,null))[_0xab95('0x2d')](handleError(_0x2ca527,null));};exports['notify']=function(_0x1fdb46,_0x4255a7,_0x4a3397){var _0x581beb={'body':_0x1fdb46[_0xab95('0x61')],'channel':_0xab95('0x76')};var _0x5d6836=[];var _0x6b86dd=[];var _0x120c51={};var _0x33ec58=![];return db['CmContact'][_0xab95('0x6a')]()[_0xab95('0x23')](function(_0x127446){if(!_0x127446){throw new db[(_0xab95('0x77'))]['ValidationError']('no\x20available\x20attributes');}_0x5d6836=_['difference'](_[_0xab95('0x49')](_0x127446),[_0xab95('0x78'),_0xab95('0x79')]);_0x6b86dd=_[_0xab95('0x7a')](_[_0xab95('0x49')](_0x127446),[_0xab95('0x78'),_0xab95('0x79'),_0xab95('0x7b'),_0xab95('0x7c')]);if(_0x1fdb46[_0xab95('0x61')]['id']){delete _0x1fdb46[_0xab95('0x61')]['id'];}if(_['isNil'](_0x1fdb46[_0xab95('0x61')][_0xab95('0x7d')])){throw new db[(_0xab95('0x77'))][(_0xab95('0x7e'))](_0xab95('0x7f'));}if(_[_0xab95('0x80')](_0x1fdb46[_0xab95('0x61')][_0xab95('0x61')])||_0x1fdb46['body'][_0xab95('0x61')]===''){throw new db[(_0xab95('0x77'))][(_0xab95('0x7e'))](_0xab95('0x81'));}if(_['isNil'](_0x1fdb46[_0xab95('0x61')][_0xab95('0x82')])){throw new db[(_0xab95('0x77'))][(_0xab95('0x7e'))](_0xab95('0x83')+_0x6b86dd);}if(!_[_0xab95('0x84')](_0x6b86dd,_0x1fdb46[_0xab95('0x61')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6b86dd);}_0x120c51[_0x1fdb46[_0xab95('0x61')][_0xab95('0x82')]]=_0x1fdb46[_0xab95('0x61')][_0xab95('0x7d')];})[_0xab95('0x23')](function(){return db[_0xab95('0x43')][_0xab95('0x5f')]({'where':{'id':_0x1fdb46[_0xab95('0x5c')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xab95('0x85')],'as':_0xab95('0x86'),'where':_0x120c51,'limit':0x1,'order':[['updatedAt',_0xab95('0x87')]]}]},{'model':db[_0xab95('0x88')],'as':_0xab95('0x89')}]});})[_0xab95('0x23')](handleEntityNotFound(_0x4255a7,null))[_0xab95('0x23')](function(_0x2d4bd8){if(_0x2d4bd8&&_0x2d4bd8[_0xab95('0x8a')]){_0x581beb[_0xab95('0x8b')]=_0x2d4bd8;_0x581beb[_0xab95('0x8c')]=_0x2d4bd8[_0xab95('0x89')];_0x581beb[_0xab95('0x8d')]=_0x2d4bd8[_0xab95('0x8a')];_0x581beb[_0xab95('0x8c')]=_[_0xab95('0x8e')](_0x581beb[_0xab95('0x8c')],['priority'],[_0xab95('0x8f')]);if(_0x581beb[_0xab95('0x8b')][_0xab95('0x89')]){delete _0x581beb[_0xab95('0x8b')][_0xab95('0x89')];}if(_0x581beb[_0xab95('0x8b')]['List']&&_0x581beb['account'][_0xab95('0x8a')][_0xab95('0x86')]['length']){return _0x581beb['account'][_0xab95('0x8a')][_0xab95('0x86')][0x0];}var _0x1ab89d=_['defaults'](_0x1fdb46[_0xab95('0x61')],{'firstName':_0x1fdb46[_0xab95('0x61')]['from'],'ListId':_0x2d4bd8[_0xab95('0x7c')]});_0x1ab89d[_0x1fdb46[_0xab95('0x61')][_0xab95('0x82')]]=_0x1fdb46[_0xab95('0x61')][_0xab95('0x7d')];return db['CmContact'][_0xab95('0x60')](_0x1ab89d,{'fields':_0x5d6836,'raw':!![]});}})[_0xab95('0x23')](handleEntityNotFound(_0x4255a7,null))['then'](function(_0x37dd09){_0x581beb[_0xab95('0x90')]=_0x37dd09;if(_0x37dd09){var _0x59dbe4={'ContactId':_0x37dd09['id'],'OpenchannelAccountId':_0x1fdb46['params']['id'],'from':(_0x37dd09[_0xab95('0x91')]||'')+'\x20'+(_0x37dd09[_0xab95('0x92')]||'')};var _0x14655d={'OpenchannelAccountId':_0x1fdb46['params']['id'],'closed':![]};if(_0x1fdb46[_0xab95('0x61')][_0xab95('0x93')]){_0x14655d[_0xab95('0x93')]=_0x1fdb46['body']['threadId'];return db['OpenchannelInteraction'][_0xab95('0x5f')]({'where':_0x14655d})['then'](function(_0x2b44d8){if(_0x2b44d8){return[_0x2b44d8,![]];}_0x59dbe4[_0xab95('0x93')]=_0x1fdb46[_0xab95('0x61')][_0xab95('0x93')];_0x59dbe4['externalUrl']=_0x1fdb46[_0xab95('0x61')][_0xab95('0x94')];return db[_0xab95('0x95')]['create'](_0x59dbe4)[_0xab95('0x23')](function(_0x5121d5){return[_0x5121d5,!![]];});});}else{_0x14655d[_0xab95('0x93')]=null;}_0x14655d[_0xab95('0x96')]=_0x37dd09['id'];return db[_0xab95('0x95')][_0xab95('0x5f')]({'where':_0x14655d})[_0xab95('0x23')](function(_0xf521e6){if(_0xf521e6){return[_0xf521e6,![]];}return db['OpenchannelInteraction']['create'](_0x59dbe4)[_0xab95('0x23')](function(_0x15b6c5){return[_0x15b6c5,!![]];});});}})[_0xab95('0x97')](function(_0x8c091f,_0x51b6d3){if(_0x8c091f){_0x33ec58=_0x51b6d3;if(!_0x51b6d3){var _0x5d813b={'from':(_0x581beb['contact'][_0xab95('0x91')]||'')+'\x20'+(_0x581beb[_0xab95('0x90')][_0xab95('0x92')]||'')};if(_0x1fdb46[_0xab95('0x61')][_0xab95('0x93')]&&_0x1fdb46[_0xab95('0x61')][_0xab95('0x98')]&&_0x1fdb46[_0xab95('0x61')][_0xab95('0x93')]!=_0x1fdb46[_0xab95('0x61')]['messageId']){_0x5d813b[_0xab95('0x93')]=_0x1fdb46[_0xab95('0x61')][_0xab95('0x98')];}return _0x8c091f['update'](_0x5d813b);}else{return _0x8c091f;}}})[_0xab95('0x23')](function(_0x2bbee5){_0x581beb[_0xab95('0x99')]=_0x2bbee5['get']({'plain':!![]});_0x581beb[_0xab95('0x99')][_0xab95('0x9a')]=_0x33ec58;if(_0x581beb[_0xab95('0x99')][_0xab95('0x9a')]){if(_0x581beb['account'][_0xab95('0x9b')]){_0x581beb[_0xab95('0x8c')][_0xab95('0x9c')]({'id':0x0,'priority':_0x581beb[_0xab95('0x8c')]['length']+0x1,'app':_0xab95('0x9d'),'appdata':'unmanaged','interval':_0xab95('0x9e')});}}return db['OpenchannelMessage'][_0xab95('0x60')]({'body':_0x1fdb46['body'][_0xab95('0x61')],'OpenchannelAccountId':_0x1fdb46['params']['id'],'OpenchannelInteractionId':_0x2bbee5['id'],'direction':'in','ContactId':_0x581beb['contact']['id'],'AttachmentId':_0x1fdb46[_0xab95('0x61')]['AttachmentId']});})['then'](function(_0x54f8bd){_0x581beb[_0xab95('0x2b')]=_0x54f8bd;if(_0x581beb[_0xab95('0x99')][_0xab95('0x9f')]){return db[_0xab95('0xa0')]['find']({'attributes':['id',_0xab95('0x3f')],'where':{'id':_0x581beb[_0xab95('0x99')][_0xab95('0x9f')]}})[_0xab95('0x23')](function(_0x481aea){if(_0x481aea){_0x581beb['applications'][_0xab95('0xa1')]({'id':0x0,'priority':0x0,'app':_0xab95('0xa2'),'appdata':_0x481aea[_0xab95('0x3f')]+','+(_0x581beb[_0xab95('0x8b')]['waitForTheAssignedAgent']||0xa),'interval':_0xab95('0x9e')});_0x581beb['forcedOwnership']=![];}return respondWithRpcPromise(_0xab95('0xa3'),'startRouting',_0x581beb);});}return respondWithRpcPromise('Start','startRouting',_0x581beb);})[_0xab95('0x23')](function(_0xe2455e){respondWithRpcPromise(_0xab95('0xa4'),_0xab95('0xa4'),{'event':_0xab95('0xa5'),'message':_0xe2455e},client9002);return _0xe2455e;})['then'](respondWithResult(_0x4255a7,null))['catch'](handleError(_0x4255a7,null));};exports['addApplications']=function(_0x365624,_0x226745){var _0x13eeb4=_0x365624[_0xab95('0x5c')]['id'];var _0xc62c27=_0x365624[_0xab95('0x61')];var _0x11e03e=0xc8;var _0x2cba0a=null;return db[_0xab95('0xa6')][_0xab95('0xa7')]({'isolationLevel':db[_0xab95('0xa6')]['Transaction'][_0xab95('0xa8')][_0xab95('0xa9')]},function(_0x5ab22f){return db[_0xab95('0x43')][_0xab95('0x6e')]({'where':{'id':_0x13eeb4},'transaction':_0x5ab22f})[_0xab95('0x23')](function(_0x5c815a){if(_0x5c815a){return db[_0xab95('0x88')]['destroy']({'where':{'OpenchannelAccountId':_0x13eeb4},'transaction':_0x5ab22f})[_0xab95('0x23')](function(){var _0x3fc611=_[_0xab95('0x47')](_0xc62c27,function(_0x2a90e8){_0x2a90e8['OpenchannelAccountId']=_0x13eeb4;return _0x2a90e8;});return db[_0xab95('0x88')][_0xab95('0xaa')](_0x3fc611,{'transaction':_0x5ab22f});});}else{_0x11e03e=0x194;_0x2cba0a=[];}});})[_0xab95('0x23')](function(){if(_0x11e03e!==0x194){return db[_0xab95('0x88')][_0xab95('0xab')]({'where':{'OpenchannelAccountId':_0x13eeb4},'order':_0xab95('0xac')})[_0xab95('0x23')](function(_0x194c6e){_0x2cba0a=_0x194c6e;});}})[_0xab95('0x2d')](function(_0x2a5f28){_0x11e03e=0x1f4;logger[_0xab95('0x29')](_0x2a5f28[_0xab95('0x3e')]);if(_0x2a5f28[_0xab95('0x3f')]){delete _0x2a5f28[_0xab95('0x3f')];}_0x2cba0a=_0x2a5f28;})[_0xab95('0xad')](function(){if(_0x2cba0a===null){_0x226745[_0xab95('0x3d')](_0x11e03e);}else{if(_0x11e03e===0x1f4){_0x226745['status'](_0x11e03e)[_0xab95('0x40')](_0x2cba0a);}else{_0x226745[_0xab95('0x2e')](_0x11e03e)[_0xab95('0x30')](_0x2cba0a);}}});};exports[_0xab95('0xae')]=function(_0xec7a14,_0x4b4bad,_0x1a81cd){var _0x448c8d={};var _0xdd008c={};var _0x1493fe;var _0x369ef4;return db[_0xab95('0x43')][_0xab95('0x6e')]({'where':{'id':_0xec7a14['params']['id']}})['then'](handleEntityNotFound(_0x4b4bad,null))[_0xab95('0x23')](function(_0x127776){if(_0x127776){_0x1493fe=_0x127776;_0xdd008c[_0xab95('0x4c')]=_[_0xab95('0x49')](db['OpenchannelApplication'][_0xab95('0x44')]);_0xdd008c[_0xab95('0x48')]=_['keys'](_0xec7a14['query']);_0xdd008c['filters']=_[_0xab95('0x4b')](_0xdd008c[_0xab95('0x4c')],_0xdd008c['query']);_0x448c8d[_0xab95('0x4a')]=_[_0xab95('0x4b')](_0xdd008c[_0xab95('0x4c')],qs[_0xab95('0x4d')](_0xec7a14[_0xab95('0x48')][_0xab95('0x4d')]));_0x448c8d['attributes']=_0x448c8d[_0xab95('0x4a')][_0xab95('0x4e')]?_0x448c8d[_0xab95('0x4a')]:_0xdd008c[_0xab95('0x4c')];_0x448c8d[_0xab95('0x6f')]=qs[_0xab95('0x51')](_0xec7a14[_0xab95('0x48')][_0xab95('0x51')]);_0x448c8d[_0xab95('0x52')]=qs[_0xab95('0x53')](_[_0xab95('0x54')](_0xec7a14[_0xab95('0x48')],_0xdd008c[_0xab95('0x53')]));if(_0xec7a14[_0xab95('0x48')]['filter']){_0x448c8d[_0xab95('0x52')]=_['merge'](_0x448c8d[_0xab95('0x52')],{'$or':_['map'](_0x448c8d[_0xab95('0x4a')],function(_0x43d903){var _0x14075d={};_0x14075d[_0x43d903]={'$like':'%'+_0xec7a14[_0xab95('0x48')][_0xab95('0x55')]+'%'};return _0x14075d;})});}_0x448c8d=_[_0xab95('0x56')]({},_0x448c8d,_0xec7a14[_0xab95('0x5e')]);return _0x1493fe['getApplications'](_0x448c8d);}})['then'](function(_0x9f0fea){if(_0x9f0fea){_0x369ef4=_0x9f0fea[_0xab95('0x4e')];if(!_0xec7a14[_0xab95('0x48')][_0xab95('0x4f')]('nolimit')){_0x448c8d[_0xab95('0x32')]=qs['limit'](_0xec7a14['query'][_0xab95('0x32')]);_0x448c8d[_0xab95('0x31')]=qs['offset'](_0xec7a14['query'][_0xab95('0x31')]);}return _0x1493fe[_0xab95('0xae')](_0x448c8d);}})[_0xab95('0x23')](function(_0x1e8edb){if(_0x1e8edb){return _0x1e8edb?{'count':_0x369ef4,'rows':_0x1e8edb}:null;}})[_0xab95('0x23')](respondWithResult(_0x4b4bad,null))[_0xab95('0x2d')](handleError(_0x4b4bad,null));};exports[_0xab95('0xaf')]=function(_0x16e274,_0x28e867,_0x54f2c8){var _0x41f0c6={'raw':![],'where':{}};var _0x306455={};var _0x568d1d={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x16e274[_0xab95('0x5c')]['id']}})[_0xab95('0x23')](handleEntityNotFound(_0x28e867,null))['then'](function(_0x545cc8){if(_0x545cc8){_0x306455[_0xab95('0x4c')]=_[_0xab95('0x49')](db['OpenchannelInteraction'][_0xab95('0x44')]);_0x306455[_0xab95('0x48')]=_[_0xab95('0x49')](_0x16e274[_0xab95('0x48')]);_0x306455[_0xab95('0x53')]=_[_0xab95('0x4b')](_0x306455[_0xab95('0x4c')],_0x306455[_0xab95('0x48')]);_0x41f0c6[_0xab95('0x4a')]=_[_0xab95('0x4b')](_0x306455[_0xab95('0x4c')],qs[_0xab95('0x4d')](_0x16e274[_0xab95('0x48')][_0xab95('0x4d')]));_0x41f0c6['attributes']=_0x41f0c6[_0xab95('0x4a')][_0xab95('0x4e')]?_0x41f0c6[_0xab95('0x4a')]:_0x306455[_0xab95('0x4c')];if(!_0x16e274[_0xab95('0x48')][_0xab95('0x4f')]('nolimit')){_0x41f0c6[_0xab95('0x32')]=qs['limit'](_0x16e274[_0xab95('0x48')][_0xab95('0x32')]);_0x41f0c6[_0xab95('0x31')]=qs[_0xab95('0x31')](_0x16e274[_0xab95('0x48')][_0xab95('0x31')]);}_0x41f0c6[_0xab95('0x6f')]=qs[_0xab95('0x51')](_0x16e274[_0xab95('0x48')]['sort']);_0x41f0c6['where']=qs[_0xab95('0x53')](_[_0xab95('0x54')](_0x16e274['query'],_0x306455[_0xab95('0x53')]));_0x41f0c6['where'][_0xab95('0x6c')]=_0x545cc8['id'];if(_0x16e274[_0xab95('0x48')]['filter']){_0x41f0c6[_0xab95('0x52')]=_[_0xab95('0x56')](_0x41f0c6['where'],{'$or':_[_0xab95('0x47')](_0x41f0c6['attributes'],function(_0x4c04b0){var _0x43a2a2={};_0x43a2a2[_0x4c04b0]={'$like':'%'+_0x16e274[_0xab95('0x48')]['filter']+'%'};return _0x43a2a2;})});}_0x41f0c6=_[_0xab95('0x56')]({},_0x41f0c6,_0x16e274['options']);return db['OpenchannelInteraction'][_0xab95('0x34')]({'where':_0x41f0c6[_0xab95('0x52')]})[_0xab95('0x23')](function(_0x52e1f4){_0x568d1d[_0xab95('0x34')]=_0x52e1f4;if(_0x16e274['query'][_0xab95('0x58')]){_0x41f0c6[_0xab95('0x59')]=[{'model':db[_0xab95('0x85')],'as':_0xab95('0xb0'),'required':![]},{'model':db[_0xab95('0xa0')],'as':'Owner','attributes':[_0xab95('0x3f'),_0xab95('0xb1'),_0xab95('0xb2')],'required':![]},{'model':db[_0xab95('0xb3')],'as':_0xab95('0xb4'),'attributes':['id',_0xab95('0x3f'),'color'],'where':_0x16e274[_0xab95('0x48')][_0xab95('0xb5')]?{'id':_0x16e274[_0xab95('0x48')]['tag']}:undefined,'required':_0x16e274['query'][_0xab95('0xb5')]?!![]:![]}];}return db[_0xab95('0x95')][_0xab95('0x5a')](_0x41f0c6);})[_0xab95('0x23')](function(_0x3f991c){_0x568d1d[_0xab95('0x70')]=_0x3f991c;return _0x568d1d;});}})[_0xab95('0x23')](respondWithFilteredResult(_0x28e867,_0x41f0c6))[_0xab95('0x2d')](handleError(_0x28e867,null));};exports['addAgents']=function(_0x371d15,_0x1532de,_0x2127cd){return db['OpenchannelAccount'][_0xab95('0x5f')]({'where':{'id':_0x371d15[_0xab95('0x5c')]['id']}})[_0xab95('0x23')](handleEntityNotFound(_0x1532de,null))[_0xab95('0x23')](function(_0x5b1640){if(_0x5b1640){return _0x5b1640[_0xab95('0xb6')](_0x371d15[_0xab95('0x61')]['ids'],_['omit'](_0x371d15[_0xab95('0x61')],['ids','id'])||{})['spread'](function(_0x1d7872){for(var _0x2c4640=0x0;_0x2c4640<_0x371d15['body'][_0xab95('0x72')]['length'];_0x2c4640+=0x1){socket[_0xab95('0xb7')](_0xab95('0xb8'),{'UserId':Number(_0x371d15['body'][_0xab95('0x72')][_0x2c4640]),'OpenchannelAccountId':Number(_0x371d15['params']['id'])});}return _0x1d7872;});}})[_0xab95('0x23')](respondWithResult(_0x1532de,null))[_0xab95('0x2d')](handleError(_0x1532de,null));};exports[_0xab95('0xb9')]=function(_0xd4b59c,_0x1aca78,_0x35f48e){return db[_0xab95('0x43')][_0xab95('0x5f')]({'where':{'id':_0xd4b59c[_0xab95('0x5c')]['id']}})[_0xab95('0x23')](handleEntityNotFound(_0x1aca78,null))[_0xab95('0x23')](function(_0x350468){if(_0x350468){return _0x350468[_0xab95('0xb9')](_0xd4b59c['query'][_0xab95('0x72')])[_0xab95('0x23')](function(){if(_[_0xab95('0xba')](_0xd4b59c[_0xab95('0x48')][_0xab95('0x72')])){for(var _0x528898=0x0;_0x528898<_0xd4b59c['query'][_0xab95('0x72')][_0xab95('0x4e')];_0x528898+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0xd4b59c['query']['ids'][_0x528898]),'OpenchannelAccountId':Number(_0xd4b59c['params']['id'])});}}else{socket[_0xab95('0xb7')](_0xab95('0xbb'),{'UserId':Number(_0xd4b59c[_0xab95('0x48')][_0xab95('0x72')]),'OpenchannelAccountId':Number(_0xd4b59c['params']['id'])});}});}})[_0xab95('0x23')](respondWithStatusCode(_0x1aca78,null))[_0xab95('0x2d')](handleError(_0x1aca78,null));};exports['getAgents']=function(_0x23a86f,_0x215d57,_0x53c380){var _0x57e216={};var _0x1e1547={};var _0x19de9f;var _0x6adc70;return db['OpenchannelAccount'][_0xab95('0x6e')]({'where':{'id':_0x23a86f[_0xab95('0x5c')]['id']}})[_0xab95('0x23')](handleEntityNotFound(_0x215d57,null))[_0xab95('0x23')](function(_0x129f0c){if(_0x129f0c){_0x19de9f=_0x129f0c;_0x1e1547['model']=_[_0xab95('0x49')](db['User']['rawAttributes']);_0x1e1547['query']=_[_0xab95('0x49')](_0x23a86f['query']);_0x1e1547['filters']=_['intersection'](_0x1e1547[_0xab95('0x4c')],_0x1e1547[_0xab95('0x48')]);_0x57e216[_0xab95('0x4a')]=_[_0xab95('0x4b')](_0x1e1547[_0xab95('0x4c')],qs[_0xab95('0x4d')](_0x23a86f[_0xab95('0x48')]['fields']));_0x57e216[_0xab95('0x4a')]=_0x57e216['attributes'][_0xab95('0x4e')]?_0x57e216[_0xab95('0x4a')]:_0x1e1547['model'];_0x57e216['order']=qs['sort'](_0x23a86f['query']['sort']);_0x57e216[_0xab95('0x52')]=qs[_0xab95('0x53')](_[_0xab95('0x54')](_0x23a86f[_0xab95('0x48')],_0x1e1547[_0xab95('0x53')]));if(_0x23a86f[_0xab95('0x48')][_0xab95('0x55')]){_0x57e216[_0xab95('0x52')]=_['merge'](_0x57e216[_0xab95('0x52')],{'$or':_[_0xab95('0x47')](_0x57e216[_0xab95('0x4a')],function(_0x2d3171){var _0x195a60={};_0x195a60[_0x2d3171]={'$like':'%'+_0x23a86f[_0xab95('0x48')][_0xab95('0x55')]+'%'};return _0x195a60;})});}_0x57e216=_[_0xab95('0x56')]({},_0x57e216,_0x23a86f[_0xab95('0x5e')]);return _0x19de9f[_0xab95('0xbc')](_0x57e216);}})[_0xab95('0x23')](function(_0x2dc997){if(_0x2dc997){_0x6adc70=_0x2dc997['length'];if(!_0x23a86f[_0xab95('0x48')]['hasOwnProperty']('nolimit')){_0x57e216[_0xab95('0x32')]=qs[_0xab95('0x32')](_0x23a86f[_0xab95('0x48')]['limit']);_0x57e216['offset']=qs[_0xab95('0x31')](_0x23a86f[_0xab95('0x48')][_0xab95('0x31')]);}return _0x19de9f[_0xab95('0xbc')](_0x57e216);}})[_0xab95('0x23')](function(_0x2b183f){if(_0x2b183f){return _0x2b183f?{'count':_0x6adc70,'rows':_0x2b183f}:null;}})[_0xab95('0x23')](respondWithResult(_0x215d57,null))['catch'](handleError(_0x215d57,null));};exports[_0xab95('0x40')]=function(_0x3a3011,_0x1f8704,_0x39fbd5){var _0x3ce89a,_0x4c4026,_0x1c289c;if(_[_0xab95('0x80')](_0x3a3011[_0xab95('0x61')][_0xab95('0x61')])||_0x3a3011[_0xab95('0x61')]['body']===''){throw new db[(_0xab95('0x77'))][(_0xab95('0x7e'))](_0xab95('0x81'));}if(_[_0xab95('0x80')](_0x3a3011[_0xab95('0x61')]['to'])){}_0x3ce89a=_0x3a3011['body']['to'];return db[_0xab95('0x43')]['findOne']({'where':{'id':_0x3a3011[_0xab95('0x5c')]['id']}})[_0xab95('0x23')](handleEntityNotFound(_0x1f8704,null))[_0xab95('0x23')](function(_0x506d99){if(_0x506d99){return db['OpenchannelAccount'][_0xab95('0x5f')]({'where':{'id':_0x506d99['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xab95('0x85')],'as':_0xab95('0x86'),'where':{[_0x506d99['mapKey']]:_0x3ce89a},'limit':0x1,'order':[[_0xab95('0x79'),_0xab95('0x87')]]}]}]})['then'](handleEntityNotFound(_0x1f8704,null))[_0xab95('0x23')](function(_0x52dc82){if(_0x52dc82&&_0x52dc82[_0xab95('0x8a')]){_0x4c4026=_0x52dc82[_0xab95('0x3b')]({'plain':!![]});if(_0x4c4026[_0xab95('0x8a')]&&_0x4c4026[_0xab95('0x8a')][_0xab95('0x86')][_0xab95('0x4e')]){return _0x4c4026[_0xab95('0x8a')][_0xab95('0x86')][0x0];}return db['CmContact'][_0xab95('0x60')](_['defaults'](_0x3a3011['body'],{'firstName':_0x3ce89a,[_0x52dc82[_0xab95('0x82')]]:_0x3ce89a,'phone':_0x3ce89a,'ListId':_0x4c4026[_0xab95('0x7c')]}));}})[_0xab95('0x23')](handleEntityNotFound(_0x1f8704,null))['then'](function(_0xfdb7fe){if(_0xfdb7fe){_0x1c289c=_0xfdb7fe;return db[_0xab95('0x95')]['find']({'where':{'ContactId':_0x1c289c['id'],'closed':![],'OpenchannelAccountId':_0x4c4026['id']}})[_0xab95('0x23')](function(_0x269f2e){if(_0x269f2e){return[_0x269f2e,![]];}return db['OpenchannelInteraction'][_0xab95('0x60')]({'UserId':_0x3a3011['user']['id'],'ContactId':_0x1c289c['id'],'OpenchannelAccountId':_0x4c4026['id'],'lastMsgDirection':'out','firstMsgDirection':_0xab95('0xbd'),'Messages':[_['merge'](_0x3a3011[_0xab95('0x61')],{'read':![],'body':_0x3a3011[_0xab95('0x61')][_0xab95('0x61')],'OpenchannelAccountId':_0x4c4026['id'],'UserId':_0x3a3011[_0xab95('0x64')]['id'],'ContactId':_0x1c289c['id']})]},{'include':[{'model':db[_0xab95('0xbe')],'as':_0xab95('0xbf')}]})[_0xab95('0x23')](function(_0x44f216){return[_0x44f216,!![]];});});}})[_0xab95('0x97')](function(_0x24470f,_0x4fdd28){if(_0x4fdd28){return _0x24470f;}return db[_0xab95('0xbe')][_0xab95('0x60')](_[_0xab95('0x56')](_0x3a3011[_0xab95('0x61')],{'read':![],'body':_0x3a3011['body']['body'],'OpenchannelAccountId':_0x4c4026['id'],'OpenchannelInteractionId':_0x24470f['id'],'UserId':_0x3a3011[_0xab95('0x64')]['id'],'ContactId':_0x1c289c['id']}))[_0xab95('0x23')](function(_0x28bd86){_0x24470f[_0xab95('0xc0')]['Messages']=[];_0x24470f[_0xab95('0xc0')][_0xab95('0xbf')][_0xab95('0x9c')](_0x28bd86['dataValues']);return _0x24470f;});});}})[_0xab95('0x23')](respondWithResult(_0x1f8704,null))[_0xab95('0x2d')](handleError(_0x1f8704,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 86841c9..51a898e 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 _0x6f7a=['events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x32734f,_0x5c0a00){_0x32734f=_0x32734f-0x0;var _0x334813=_0x6f7a[_0x32734f];return _0x334813;};'use strict';var EventEmitter=require(_0xa6f7('0x0'));var OpenchannelAccount=require(_0xa6f7('0x1'))['db'][_0xa6f7('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa6f7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa6f7('0x4'),'afterDestroy':_0xa6f7('0x5')};function emitEvent(_0x12ecb8){return function(_0x1da6dc,_0x22e529,_0x1f5922){OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8+':'+_0x1da6dc['id'],_0x1da6dc);OpenchannelAccountEvents[_0xa6f7('0x6')](_0x12ecb8,_0x1da6dc);_0x1f5922(null);};}for(var e in events){if(events[_0xa6f7('0x7')](e)){var event=events[e];OpenchannelAccount[_0xa6f7('0x8')](e,emitEvent(event));}}module[_0xa6f7('0x9')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x6e6c=['../../mysqldb','setMaxListeners','save','emit','hook','exports','events'];(function(_0xb4b52b,_0x485ad3){var _0x187696=function(_0x22159b){while(--_0x22159b){_0xb4b52b['push'](_0xb4b52b['shift']());}};_0x187696(++_0x485ad3);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xc6e6('0x0'));var OpenchannelAccount=require(_0xc6e6('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xc6e6('0x2')](0x0);var events={'afterCreate':_0xc6e6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e97f5){return function(_0x5a9e2b,_0x40b7e1,_0x4b13f0){OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5+':'+_0x5a9e2b['id'],_0x5a9e2b);OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5,_0x5a9e2b);_0x4b13f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc6e6('0x5')](e,emitEvent(event));}}module[_0xc6e6('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index e1d6f93..626ee58 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(_0x39c509,_0x2cc96d){var _0x263cbf=function(_0x148876){while(--_0x148876){_0x39c509['push'](_0x39c509['shift']());}};_0x263cbf(++_0x2cc96d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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(_0x937fb2,_0x258e12){var _0x8b53c=function(_0x22d797){while(--_0x22d797){_0x937fb2['push'](_0x937fb2['shift']());}};_0x8b53c(++_0x258e12);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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 4be28ae..09645c9 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 _0x80ed=['../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3b1f6e,_0x3ab93c){var _0x3993e0=function(_0x35c4d2){while(--_0x35c4d2){_0x3b1f6e['push'](_0x3b1f6e['shift']());}};_0x3993e0(++_0x3ab93c);}(_0x80ed,0x11c));var _0xd80e=function(_0x5ad88,_0x282d37){_0x5ad88=_0x5ad88-0x0;var _0x5992ed=_0x80ed[_0x5ad88];return _0x5992ed;};'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')]('OpenchannelAccount,\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);});});} \ No newline at end of file +var _0xf7b4=['result','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xf7b4,0x152));var _0x4f7b=function(_0x37dd8b,_0x57b8da){_0x37dd8b=_0x37dd8b-0x0;var _0xb1cc6c=_0xf7b4[_0x37dd8b];return _0xb1cc6c;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});config[_0x4f7b('0xa')]=_[_0x4f7b('0xb')](config[_0x4f7b('0xa')],{'host':_0x4f7b('0xc'),'port':0x18eb});var socket=require(_0x4f7b('0xd'))(new Redis(config[_0x4f7b('0xa')]));require('./openchannelAccount.socket')[_0x4f7b('0xe')](socket);function respondWithRpcPromise(_0x1016e0,_0x479208,_0xdd1aab){return new BPromise(function(_0x3a3d6c,_0x408e01){return client[_0x4f7b('0xf')](_0x1016e0,_0xdd1aab)[_0x4f7b('0x10')](function(_0x55d69f){logger[_0x4f7b('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x479208,'request\x20sent');logger[_0x4f7b('0x12')](_0x4f7b('0x13'),_0x479208,_0x4f7b('0x14'),JSON[_0x4f7b('0x15')](_0x55d69f));if(_0x55d69f['error']){if(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x17')]===0x1f4){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x408e01(_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);}logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x55d69f[_0x4f7b('0x16')][_0x4f7b('0x19')]);return _0x3a3d6c(_0x55d69f['error'][_0x4f7b('0x19')]);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x479208,_0x4f7b('0x14'));_0x3a3d6c(_0x55d69f[_0x4f7b('0x1a')]['message']);}})[_0x4f7b('0x1b')](function(_0x24c460){logger[_0x4f7b('0x16')](_0x4f7b('0x18'),_0x479208,_0x24c460);_0x408e01(_0x24c460);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index dc8a926..e531bb7 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 _0xdb76=['remove','update','emit','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x54cfa2,_0x360080){var _0x2536e2=function(_0x14e8f1){while(--_0x14e8f1){_0x54cfa2['push'](_0x54cfa2['shift']());}};_0x2536e2(++_0x360080);}(_0xdb76,0x1be));var _0x6db7=function(_0x47101e,_0xec2261){_0x47101e=_0x47101e-0x0;var _0x757e41=_0xdb76[_0x47101e];return _0x757e41;};'use strict';var OpenchannelAccountEvents=require(_0x6db7('0x0'));var events=[_0x6db7('0x1'),_0x6db7('0x2'),_0x6db7('0x3')];function createListener(_0x27d5fd,_0x4fee62){return function(_0x448591){_0x4fee62[_0x6db7('0x4')](_0x27d5fd,_0x448591);};}function removeListener(_0x3e17d8,_0x40f6ce){return function(){OpenchannelAccountEvents['removeListener'](_0x3e17d8,_0x40f6ce);};}exports[_0x6db7('0x5')]=function(_0x7bba2d){for(var _0x8a8fe2=0x0,_0x417e71=events[_0x6db7('0x6')];_0x8a8fe2<_0x417e71;_0x8a8fe2++){var _0x58f6e4=events[_0x8a8fe2];var _0x1c7f92=createListener(_0x6db7('0x7')+_0x58f6e4,_0x7bba2d);OpenchannelAccountEvents['on'](_0x58f6e4,_0x1c7f92);}}; \ No newline at end of file +var _0x76a3=['emit','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x3149df,_0x426ea9){var _0x570cd1=function(_0x1f484f){while(--_0x1f484f){_0x3149df['push'](_0x3149df['shift']());}};_0x570cd1(++_0x426ea9);}(_0x76a3,0xf8));var _0x376a=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x76a3[_0x25662e];return _0x59b7bc;};'use strict';var OpenchannelAccountEvents=require(_0x376a('0x0'));var events=[_0x376a('0x1'),_0x376a('0x2'),_0x376a('0x3')];function createListener(_0x22eb04,_0x13385a){return function(_0x36d708){_0x13385a[_0x376a('0x4')](_0x22eb04,_0x36d708);};}function removeListener(_0x8bdd7f,_0x17f183){return function(){OpenchannelAccountEvents['removeListener'](_0x8bdd7f,_0x17f183);};}exports['register']=function(_0x19ea68){for(var _0x22904c=0x0,_0x139dbc=events[_0x376a('0x5')];_0x22904c<_0x139dbc;_0x22904c++){var _0x548516=events[_0x22904c];var _0x3e2261=createListener(_0x376a('0x6')+_0x548516,_0x19ea68);OpenchannelAccountEvents['on'](_0x548516,_0x3e2261);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 33fd0dc..5e26427 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 _0x7b56=['util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','multer'];(function(_0x2a7e7f,_0x307432){var _0xdce505=function(_0x2b271f){while(--_0x2b271f){_0x2a7e7f['push'](_0x2a7e7f['shift']());}};_0xdce505(++_0x307432);}(_0x7b56,0x65));var _0x67b5=function(_0x4a6c78,_0x296701){_0x4a6c78=_0x4a6c78-0x0;var _0x5f017c=_0x7b56[_0x4a6c78];return _0x5f017c;};'use strict';var multer=require(_0x67b5('0x0'));var util=require(_0x67b5('0x1'));var path=require('path');var timeout=require(_0x67b5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x67b5('0x3'));var auth=require(_0x67b5('0x4'));var interaction=require(_0x67b5('0x5'));var config=require(_0x67b5('0x6'));var controller=require(_0x67b5('0x7'));router[_0x67b5('0x8')]('/',auth[_0x67b5('0x9')](),controller[_0x67b5('0xa')]);router[_0x67b5('0x8')](_0x67b5('0xb'),auth[_0x67b5('0x9')](),controller[_0x67b5('0xc')]);router[_0x67b5('0xd')]('/',auth[_0x67b5('0x9')](),controller[_0x67b5('0xe')]);router['put'](_0x67b5('0xb'),auth[_0x67b5('0x9')](),controller[_0x67b5('0xf')]);router[_0x67b5('0x10')](_0x67b5('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0f67=['util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4ebc83,_0x39dc62){var _0x689bea=function(_0x2b42c2){while(--_0x2b42c2){_0x4ebc83['push'](_0x4ebc83['shift']());}};_0x689bea(++_0x39dc62);}(_0x0f67,0x109));var _0x70f6=function(_0xf59389,_0x36dbc2){_0xf59389=_0xf59389-0x0;var _0x5ec992=_0x0f67[_0xf59389];return _0x5ec992;};'use strict';var multer=require(_0x70f6('0x0'));var util=require(_0x70f6('0x1'));var path=require(_0x70f6('0x2'));var timeout=require('connect-timeout');var express=require(_0x70f6('0x3'));var router=express['Router']();var fs_extra=require(_0x70f6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x70f6('0x5'));var config=require(_0x70f6('0x6'));var controller=require(_0x70f6('0x7'));router[_0x70f6('0x8')]('/',auth[_0x70f6('0x9')](),controller[_0x70f6('0xa')]);router[_0x70f6('0x8')](_0x70f6('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x70f6('0xc')]('/',auth[_0x70f6('0x9')](),controller[_0x70f6('0xd')]);router[_0x70f6('0xe')](_0x70f6('0xb'),auth[_0x70f6('0x9')](),controller[_0x70f6('0xf')]);router[_0x70f6('0x10')](_0x70f6('0xb'),auth[_0x70f6('0x9')](),controller[_0x70f6('0x11')]);module[_0x70f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 8183101..f005faf 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 _0xb583=['exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0xb583,0x9b));var _0x3b58=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xb583[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module[_0x3b58('0x0')]={'priority':{'type':Sequelize[_0x3b58('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3b58('0x2')],'allowNull':![],'defaultValue':_0x3b58('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3b58('0x2')]},'interval':{'type':Sequelize[_0x3b58('0x2')],'defaultValue':_0x3b58('0x4')}}; \ No newline at end of file +var _0x61b4=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x2e9b3e,_0x1cbfa7){var _0x21ded2=function(_0x8d8474){while(--_0x8d8474){_0x2e9b3e['push'](_0x2e9b3e['shift']());}};_0x21ded2(++_0x1cbfa7);}(_0x61b4,0xf2));var _0x461b=function(_0xf86099,_0x13b63a){_0xf86099=_0xf86099-0x0;var _0xc331d7=_0x61b4[_0xf86099];return _0xc331d7;};'use strict';var Sequelize=require(_0x461b('0x0'));module[_0x461b('0x1')]={'priority':{'type':Sequelize[_0x461b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x461b('0x3')],'allowNull':![],'defaultValue':_0x461b('0x4')},'appdata':{'type':Sequelize[_0x461b('0x5')]()},'description':{'type':Sequelize[_0x461b('0x3')]},'interval':{'type':Sequelize[_0x461b('0x3')],'defaultValue':_0x461b('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index dc57f42..bbed9ed 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 _0x635a=['json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','send','map','rawAttributes','fieldName','key','model','name','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','merge','type','VIRTUAL','OpenchannelApplication','includeAll','include','findAll','catch','params','options','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x635a,0x186));var _0xa635=function(_0x1f7e74,_0xa04705){_0x1f7e74=_0x1f7e74-0x0;var _0x231be2=_0x635a[_0x1f7e74];return _0x231be2;};'use strict';var emlformat=require(_0xa635('0x0'));var rimraf=require(_0xa635('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa635('0x2'));var moment=require('moment');var BPromise=require(_0xa635('0x3'));var Mustache=require(_0xa635('0x4'));var util=require('util');var path=require(_0xa635('0x5'));var sox=require(_0xa635('0x6'));var csv=require(_0xa635('0x7'));var ejs=require(_0xa635('0x8'));var fs=require('fs');var fs_extra=require(_0xa635('0x9'));var _=require('lodash');var squel=require(_0xa635('0xa'));var crypto=require(_0xa635('0xb'));var jsforce=require(_0xa635('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa635('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa635('0xd'));var as=require(_0xa635('0xe'));var hardwareService=require(_0xa635('0xf'));var logger=require(_0xa635('0x10'))(_0xa635('0x11'));var utils=require(_0xa635('0x12'));var config=require(_0xa635('0x13'));var licenseUtil=require(_0xa635('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d7e7b,_0x26c603){_0x26c603=_0x26c603||0xcc;return function(_0x400e17){if(_0x400e17){return _0x5d7e7b[_0xa635('0x15')](_0x26c603);}return _0x5d7e7b[_0xa635('0x16')](_0x26c603)[_0xa635('0x17')]();};}function respondWithResult(_0x30a072,_0x372530){_0x372530=_0x372530||0xc8;return function(_0x6a563d){if(_0x6a563d){return _0x30a072[_0xa635('0x16')](_0x372530)[_0xa635('0x18')](_0x6a563d);}};}function respondWithFilteredResult(_0x4c75b6,_0x2256b0){return function(_0x452909){if(_0x452909){var _0x2e0469=typeof _0x2256b0[_0xa635('0x19')]==='undefined'&&typeof _0x2256b0[_0xa635('0x1a')]===_0xa635('0x1b');var _0x265fd9=_0x452909['count'];var _0x3bb660=_0x2e0469?0x0:_0x2256b0[_0xa635('0x19')];var _0x5505bf=_0x2e0469?_0x452909[_0xa635('0x1c')]:_0x2256b0[_0xa635('0x19')]+_0x2256b0[_0xa635('0x1a')];var _0x3de9f0;if(_0x5505bf>=_0x265fd9){_0x5505bf=_0x265fd9;_0x3de9f0=0xc8;}else{_0x3de9f0=0xce;}_0x4c75b6[_0xa635('0x16')](_0x3de9f0);return _0x4c75b6[_0xa635('0x1d')](_0xa635('0x1e'),_0x3bb660+'-'+_0x5505bf+'/'+_0x265fd9)[_0xa635('0x18')](_0x452909);}return null;};}function patchUpdates(_0x3d3ddb){return function(_0x165af4){try{jsonpatch[_0xa635('0x1f')](_0x165af4,_0x3d3ddb,!![]);}catch(_0xe40f08){return BPromise[_0xa635('0x20')](_0xe40f08);}return _0x165af4[_0xa635('0x21')]();};}function saveUpdates(_0x612260,_0x152a31){return function(_0x339ddc){if(_0x339ddc){return _0x339ddc['update'](_0x612260)[_0xa635('0x22')](function(_0x79cbc7){return _0x79cbc7;});}return null;};}function removeEntity(_0x41e6b8,_0x1f2cf1){return function(_0x211d32){if(_0x211d32){return _0x211d32[_0xa635('0x23')]()[_0xa635('0x22')](function(){_0x41e6b8['status'](0xcc)[_0xa635('0x17')]();});}};}function handleEntityNotFound(_0xb6a5cb,_0x2a2a32){return function(_0x6c0d3){if(!_0x6c0d3){_0xb6a5cb[_0xa635('0x15')](0x194);}return _0x6c0d3;};}function handleError(_0x492e7b,_0x52026b){_0x52026b=_0x52026b||0x1f4;return function(_0x172a06){logger[_0xa635('0x24')](_0x172a06[_0xa635('0x25')]);if(_0x172a06['name']){delete _0x172a06['name'];}_0x492e7b[_0xa635('0x16')](_0x52026b)[_0xa635('0x26')](_0x172a06);};}exports['index']=function(_0x4e0454,_0x6b6682){var _0x3203bf={},_0x1ecc39={},_0x26b450={'count':0x0,'rows':[]};var _0x45856e=_[_0xa635('0x27')](db['OpenchannelApplication'][_0xa635('0x28')],function(_0xeec824){return{'name':_0xeec824[_0xa635('0x29')],'type':_0xeec824['type'][_0xa635('0x2a')]};});_0x1ecc39[_0xa635('0x2b')]=_['map'](_0x45856e,_0xa635('0x2c'));_0x1ecc39['query']=_[_0xa635('0x2d')](_0x4e0454[_0xa635('0x2e')]);_0x1ecc39['filters']=_['intersection'](_0x1ecc39['model'],_0x1ecc39[_0xa635('0x2e')]);_0x3203bf['attributes']=_[_0xa635('0x2f')](_0x1ecc39[_0xa635('0x2b')],qs['fields'](_0x4e0454[_0xa635('0x2e')][_0xa635('0x30')]));_0x3203bf[_0xa635('0x31')]=_0x3203bf['attributes'][_0xa635('0x32')]?_0x3203bf[_0xa635('0x31')]:_0x1ecc39[_0xa635('0x2b')];if(!_0x4e0454['query'][_0xa635('0x33')]('nolimit')){_0x3203bf[_0xa635('0x1a')]=qs[_0xa635('0x1a')](_0x4e0454['query'][_0xa635('0x1a')]);_0x3203bf['offset']=qs[_0xa635('0x19')](_0x4e0454[_0xa635('0x2e')]['offset']);}_0x3203bf['order']=qs[_0xa635('0x34')](_0x4e0454[_0xa635('0x2e')]['sort']);_0x3203bf[_0xa635('0x35')]=qs[_0xa635('0x36')](_[_0xa635('0x37')](_0x4e0454[_0xa635('0x2e')],_0x1ecc39[_0xa635('0x36')]),_0x45856e);if(_0x4e0454['query']['filter']){_0x3203bf['where']=_[_0xa635('0x38')](_0x3203bf[_0xa635('0x35')],{'$or':_[_0xa635('0x27')](_0x45856e,function(_0x4d3d2f){if(_0x4d3d2f[_0xa635('0x39')]!==_0xa635('0x3a')){var _0x234dd7={};_0x234dd7[_0x4d3d2f['name']]={'$like':'%'+_0x4e0454[_0xa635('0x2e')]['filter']+'%'};return _0x234dd7;}})});}_0x3203bf=_[_0xa635('0x38')]({},_0x3203bf,_0x4e0454['options']);var _0x49caaa={'where':_0x3203bf[_0xa635('0x35')]};return db[_0xa635('0x3b')][_0xa635('0x1c')](_0x49caaa)['then'](function(_0x5398ef){_0x26b450[_0xa635('0x1c')]=_0x5398ef;if(_0x4e0454[_0xa635('0x2e')][_0xa635('0x3c')]){_0x3203bf[_0xa635('0x3d')]=[{'all':!![]}];}return db[_0xa635('0x3b')][_0xa635('0x3e')](_0x3203bf);})[_0xa635('0x22')](function(_0x3eb0e3){_0x26b450['rows']=_0x3eb0e3;return _0x26b450;})[_0xa635('0x22')](respondWithFilteredResult(_0x6b6682,_0x3203bf))[_0xa635('0x3f')](handleError(_0x6b6682,null));};exports['show']=function(_0x3f14bf,_0x35e67f){var _0x480c00={'raw':!![],'where':{'id':_0x3f14bf[_0xa635('0x40')]['id']}},_0x2a36f5={};_0x2a36f5[_0xa635('0x2b')]=_[_0xa635('0x2d')](db['OpenchannelApplication'][_0xa635('0x28')]);_0x2a36f5['query']=_[_0xa635('0x2d')](_0x3f14bf[_0xa635('0x2e')]);_0x2a36f5[_0xa635('0x36')]=_[_0xa635('0x2f')](_0x2a36f5[_0xa635('0x2b')],_0x2a36f5['query']);_0x480c00[_0xa635('0x31')]=_[_0xa635('0x2f')](_0x2a36f5[_0xa635('0x2b')],qs[_0xa635('0x30')](_0x3f14bf[_0xa635('0x2e')]['fields']));_0x480c00[_0xa635('0x31')]=_0x480c00[_0xa635('0x31')][_0xa635('0x32')]?_0x480c00[_0xa635('0x31')]:_0x2a36f5[_0xa635('0x2b')];if(_0x3f14bf[_0xa635('0x2e')]['includeAll']){_0x480c00[_0xa635('0x3d')]=[{'all':!![]}];}_0x480c00=_[_0xa635('0x38')]({},_0x480c00,_0x3f14bf[_0xa635('0x41')]);return db[_0xa635('0x3b')][_0xa635('0x42')](_0x480c00)[_0xa635('0x22')](handleEntityNotFound(_0x35e67f,null))[_0xa635('0x22')](respondWithResult(_0x35e67f,null))['catch'](handleError(_0x35e67f,null));};exports[_0xa635('0x43')]=function(_0x191d64,_0x35af63){return db[_0xa635('0x3b')][_0xa635('0x43')](_0x191d64['body'],{})[_0xa635('0x22')](respondWithResult(_0x35af63,0xc9))[_0xa635('0x3f')](handleError(_0x35af63,null));};exports['update']=function(_0x30e51d,_0xdb3466){if(_0x30e51d[_0xa635('0x44')]['id']){delete _0x30e51d['body']['id'];}return db['OpenchannelApplication'][_0xa635('0x42')]({'where':{'id':_0x30e51d[_0xa635('0x40')]['id']}})[_0xa635('0x22')](handleEntityNotFound(_0xdb3466,null))[_0xa635('0x22')](saveUpdates(_0x30e51d['body'],null))[_0xa635('0x22')](respondWithResult(_0xdb3466,null))[_0xa635('0x3f')](handleError(_0xdb3466,null));};exports[_0xa635('0x23')]=function(_0x122be9,_0x971a51){return db[_0xa635('0x3b')][_0xa635('0x42')]({'where':{'id':_0x122be9[_0xa635('0x40')]['id']}})['then'](handleEntityNotFound(_0x971a51,null))['then'](removeEntity(_0x971a51,null))[_0xa635('0x3f')](handleError(_0x971a51,null));}; \ No newline at end of file +var _0xdb18=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','then','error','stack','name','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x539ec1,_0x570641){var _0x2996b8=function(_0xd05a43){while(--_0xd05a43){_0x539ec1['push'](_0x539ec1['shift']());}};_0x2996b8(++_0x570641);}(_0xdb18,0x191));var _0x8db1=function(_0x4ab012,_0x41c388){_0x4ab012=_0x4ab012-0x0;var _0x179547=_0xdb18[_0x4ab012];return _0x179547;};'use strict';var emlformat=require(_0x8db1('0x0'));var rimraf=require(_0x8db1('0x1'));var zipdir=require(_0x8db1('0x2'));var jsonpatch=require(_0x8db1('0x3'));var rp=require(_0x8db1('0x4'));var moment=require(_0x8db1('0x5'));var BPromise=require(_0x8db1('0x6'));var Mustache=require(_0x8db1('0x7'));var util=require(_0x8db1('0x8'));var path=require(_0x8db1('0x9'));var sox=require('sox');var csv=require(_0x8db1('0xa'));var ejs=require(_0x8db1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8db1('0xc'));var squel=require(_0x8db1('0xd'));var crypto=require(_0x8db1('0xe'));var jsforce=require(_0x8db1('0xf'));var deskjs=require(_0x8db1('0x10'));var toCsv=require(_0x8db1('0xa'));var querystring=require(_0x8db1('0x11'));var Papa=require(_0x8db1('0x12'));var Redis=require(_0x8db1('0x13'));var authService=require(_0x8db1('0x14'));var qs=require(_0x8db1('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8db1('0x16'));var logger=require(_0x8db1('0x17'))(_0x8db1('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8db1('0x19'));var db=require(_0x8db1('0x1a'))['db'];function respondWithStatusCode(_0x4e8b27,_0x2b99c5){_0x2b99c5=_0x2b99c5||0xcc;return function(_0x30a254){if(_0x30a254){return _0x4e8b27[_0x8db1('0x1b')](_0x2b99c5);}return _0x4e8b27[_0x8db1('0x1c')](_0x2b99c5)[_0x8db1('0x1d')]();};}function respondWithResult(_0x6080d2,_0x2dd141){_0x2dd141=_0x2dd141||0xc8;return function(_0x48ae6e){if(_0x48ae6e){return _0x6080d2[_0x8db1('0x1c')](_0x2dd141)['json'](_0x48ae6e);}};}function respondWithFilteredResult(_0x25d306,_0x1d0a07){return function(_0x26f3aa){if(_0x26f3aa){var _0x4db8e4=typeof _0x1d0a07[_0x8db1('0x1e')]==='undefined'&&typeof _0x1d0a07[_0x8db1('0x1f')]===_0x8db1('0x20');var _0x4a1588=_0x26f3aa[_0x8db1('0x21')];var _0x177b73=_0x4db8e4?0x0:_0x1d0a07[_0x8db1('0x1e')];var _0x26e26b=_0x4db8e4?_0x26f3aa[_0x8db1('0x21')]:_0x1d0a07[_0x8db1('0x1e')]+_0x1d0a07[_0x8db1('0x1f')];var _0x507018;if(_0x26e26b>=_0x4a1588){_0x26e26b=_0x4a1588;_0x507018=0xc8;}else{_0x507018=0xce;}_0x25d306[_0x8db1('0x1c')](_0x507018);return _0x25d306[_0x8db1('0x22')](_0x8db1('0x23'),_0x177b73+'-'+_0x26e26b+'/'+_0x4a1588)['json'](_0x26f3aa);}return null;};}function patchUpdates(_0x113252){return function(_0x3566c6){try{jsonpatch[_0x8db1('0x24')](_0x3566c6,_0x113252,!![]);}catch(_0x553b24){return BPromise['reject'](_0x553b24);}return _0x3566c6['save']();};}function saveUpdates(_0x236795,_0x20d1ec){return function(_0x7cad33){if(_0x7cad33){return _0x7cad33['update'](_0x236795)[_0x8db1('0x25')](function(_0x46cc58){return _0x46cc58;});}return null;};}function removeEntity(_0x50869b,_0x5c1d3e){return function(_0x522aa3){if(_0x522aa3){return _0x522aa3['destroy']()[_0x8db1('0x25')](function(){_0x50869b[_0x8db1('0x1c')](0xcc)[_0x8db1('0x1d')]();});}};}function handleEntityNotFound(_0x539118,_0x296fd8){return function(_0x128c7a){if(!_0x128c7a){_0x539118['sendStatus'](0x194);}return _0x128c7a;};}function handleError(_0xe63c81,_0x69b511){_0x69b511=_0x69b511||0x1f4;return function(_0x134b4a){logger[_0x8db1('0x26')](_0x134b4a[_0x8db1('0x27')]);if(_0x134b4a[_0x8db1('0x28')]){delete _0x134b4a[_0x8db1('0x28')];}_0xe63c81['status'](_0x69b511)['send'](_0x134b4a);};}exports[_0x8db1('0x29')]=function(_0x482ac0,_0x11828a){var _0x1de1d6={},_0x3e7f9c={},_0x569a06={'count':0x0,'rows':[]};var _0x347279=_['map'](db[_0x8db1('0x2a')][_0x8db1('0x2b')],function(_0x128e93){return{'name':_0x128e93[_0x8db1('0x2c')],'type':_0x128e93[_0x8db1('0x2d')][_0x8db1('0x2e')]};});_0x3e7f9c[_0x8db1('0x2f')]=_[_0x8db1('0x30')](_0x347279,_0x8db1('0x28'));_0x3e7f9c['query']=_[_0x8db1('0x31')](_0x482ac0['query']);_0x3e7f9c[_0x8db1('0x32')]=_[_0x8db1('0x33')](_0x3e7f9c[_0x8db1('0x2f')],_0x3e7f9c[_0x8db1('0x34')]);_0x1de1d6['attributes']=_['intersection'](_0x3e7f9c[_0x8db1('0x2f')],qs[_0x8db1('0x35')](_0x482ac0[_0x8db1('0x34')][_0x8db1('0x35')]));_0x1de1d6[_0x8db1('0x36')]=_0x1de1d6[_0x8db1('0x36')][_0x8db1('0x37')]?_0x1de1d6[_0x8db1('0x36')]:_0x3e7f9c[_0x8db1('0x2f')];if(!_0x482ac0[_0x8db1('0x34')][_0x8db1('0x38')](_0x8db1('0x39'))){_0x1de1d6[_0x8db1('0x1f')]=qs['limit'](_0x482ac0['query'][_0x8db1('0x1f')]);_0x1de1d6[_0x8db1('0x1e')]=qs[_0x8db1('0x1e')](_0x482ac0[_0x8db1('0x34')][_0x8db1('0x1e')]);}_0x1de1d6[_0x8db1('0x3a')]=qs[_0x8db1('0x3b')](_0x482ac0[_0x8db1('0x34')]['sort']);_0x1de1d6[_0x8db1('0x3c')]=qs['filters'](_[_0x8db1('0x3d')](_0x482ac0[_0x8db1('0x34')],_0x3e7f9c[_0x8db1('0x32')]),_0x347279);if(_0x482ac0[_0x8db1('0x34')][_0x8db1('0x3e')]){_0x1de1d6[_0x8db1('0x3c')]=_[_0x8db1('0x3f')](_0x1de1d6['where'],{'$or':_['map'](_0x347279,function(_0x15d0d8){if(_0x15d0d8['type']!==_0x8db1('0x40')){var _0x1812b0={};_0x1812b0[_0x15d0d8[_0x8db1('0x28')]]={'$like':'%'+_0x482ac0[_0x8db1('0x34')][_0x8db1('0x3e')]+'%'};return _0x1812b0;}})});}_0x1de1d6=_['merge']({},_0x1de1d6,_0x482ac0[_0x8db1('0x41')]);var _0x2b78c7={'where':_0x1de1d6[_0x8db1('0x3c')]};return db[_0x8db1('0x2a')]['count'](_0x2b78c7)[_0x8db1('0x25')](function(_0x170aa0){_0x569a06['count']=_0x170aa0;if(_0x482ac0[_0x8db1('0x34')][_0x8db1('0x42')]){_0x1de1d6[_0x8db1('0x43')]=[{'all':!![]}];}return db[_0x8db1('0x2a')][_0x8db1('0x44')](_0x1de1d6);})[_0x8db1('0x25')](function(_0x2db075){_0x569a06[_0x8db1('0x45')]=_0x2db075;return _0x569a06;})[_0x8db1('0x25')](respondWithFilteredResult(_0x11828a,_0x1de1d6))[_0x8db1('0x46')](handleError(_0x11828a,null));};exports[_0x8db1('0x47')]=function(_0x37ec59,_0x492b36){var _0x4da07b={'raw':!![],'where':{'id':_0x37ec59[_0x8db1('0x48')]['id']}},_0x36790b={};_0x36790b[_0x8db1('0x2f')]=_['keys'](db[_0x8db1('0x2a')][_0x8db1('0x2b')]);_0x36790b[_0x8db1('0x34')]=_[_0x8db1('0x31')](_0x37ec59['query']);_0x36790b[_0x8db1('0x32')]=_[_0x8db1('0x33')](_0x36790b[_0x8db1('0x2f')],_0x36790b['query']);_0x4da07b['attributes']=_[_0x8db1('0x33')](_0x36790b[_0x8db1('0x2f')],qs[_0x8db1('0x35')](_0x37ec59[_0x8db1('0x34')][_0x8db1('0x35')]));_0x4da07b[_0x8db1('0x36')]=_0x4da07b[_0x8db1('0x36')][_0x8db1('0x37')]?_0x4da07b[_0x8db1('0x36')]:_0x36790b['model'];if(_0x37ec59['query'][_0x8db1('0x42')]){_0x4da07b[_0x8db1('0x43')]=[{'all':!![]}];}_0x4da07b=_[_0x8db1('0x3f')]({},_0x4da07b,_0x37ec59[_0x8db1('0x41')]);return db[_0x8db1('0x2a')][_0x8db1('0x49')](_0x4da07b)[_0x8db1('0x25')](handleEntityNotFound(_0x492b36,null))[_0x8db1('0x25')](respondWithResult(_0x492b36,null))[_0x8db1('0x46')](handleError(_0x492b36,null));};exports[_0x8db1('0x4a')]=function(_0x12b854,_0x38ef57){return db['OpenchannelApplication'][_0x8db1('0x4a')](_0x12b854['body'],{})[_0x8db1('0x25')](respondWithResult(_0x38ef57,0xc9))['catch'](handleError(_0x38ef57,null));};exports[_0x8db1('0x4b')]=function(_0x43d5a2,_0x3408fe){if(_0x43d5a2['body']['id']){delete _0x43d5a2['body']['id'];}return db['OpenchannelApplication'][_0x8db1('0x49')]({'where':{'id':_0x43d5a2[_0x8db1('0x48')]['id']}})[_0x8db1('0x25')](handleEntityNotFound(_0x3408fe,null))[_0x8db1('0x25')](saveUpdates(_0x43d5a2['body'],null))[_0x8db1('0x25')](respondWithResult(_0x3408fe,null))[_0x8db1('0x46')](handleError(_0x3408fe,null));};exports[_0x8db1('0x4c')]=function(_0x5065e9,_0x130696){return db[_0x8db1('0x2a')][_0x8db1('0x49')]({'where':{'id':_0x5065e9[_0x8db1('0x48')]['id']}})[_0x8db1('0x25')](handleEntityNotFound(_0x130696,null))[_0x8db1('0x25')](removeEntity(_0x130696,null))[_0x8db1('0x46')](handleError(_0x130696,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index fea1939..30aa492 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 _0xb4f4=['bluebird','path','rimraf','./openchannelApplication.attributes','exports','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4aaa44,_0x53f64f){var _0x5d9de4=function(_0x5681e7){while(--_0x5681e7){_0x4aaa44['push'](_0x4aaa44['shift']());}};_0x5d9de4(++_0x53f64f);}(_0xb4f4,0x164));var _0x4b4f=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xb4f4[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x4b4f('0x0'));var util=require(_0x4b4f('0x1'));var logger=require(_0x4b4f('0x2'))(_0x4b4f('0x3'));var moment=require('moment');var BPromise=require(_0x4b4f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b4f('0x5'));var rimraf=require(_0x4b4f('0x6'));var config=require('../../config/environment');var attributes=require(_0x4b4f('0x7'));module[_0x4b4f('0x8')]=function(_0x407dc8,_0x4bb33b){return _0x407dc8['define']('OpenchannelApplication',attributes,{'tableName':_0x4b4f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4b4f('0xa'),'collate':_0x4b4f('0xb')});}; \ No newline at end of file +var _0xf59c=['OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0xf59c,0x17a));var _0xcf59=function(_0x44ddca,_0x592b1b){_0x44ddca=_0x44ddca-0x0;var _0xd5ce4d=_0xf59c[_0x44ddca];return _0xd5ce4d;};'use strict';var _=require(_0xcf59('0x0'));var util=require(_0xcf59('0x1'));var logger=require(_0xcf59('0x2'))(_0xcf59('0x3'));var moment=require(_0xcf59('0x4'));var BPromise=require(_0xcf59('0x5'));var rp=require(_0xcf59('0x6'));var fs=require('fs');var path=require(_0xcf59('0x7'));var rimraf=require(_0xcf59('0x8'));var config=require(_0xcf59('0x9'));var attributes=require('./openchannelApplication.attributes');module[_0xcf59('0xa')]=function(_0x1daf21,_0x485358){return _0x1daf21[_0xcf59('0xb')](_0xcf59('0xc'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcf59('0xd'),'collate':_0xcf59('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 6f6b629..c53adf6 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 _0xac5c=['OpenchannelApplication','update','body','options','raw','limit','then','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x2f3de5,_0x261691){var _0x42dda0=function(_0x41780d){while(--_0x41780d){_0x2f3de5['push'](_0x2f3de5['shift']());}};_0x42dda0(++_0x261691);}(_0xac5c,0x15c));var _0xcac5=function(_0x2eb410,_0x3acba2){_0x2eb410=_0x2eb410-0x0;var _0x2aaf7f=_0xac5c[_0x2eb410];return _0x2aaf7f;};'use strict';var _=require(_0xcac5('0x0'));var util=require(_0xcac5('0x1'));var moment=require(_0xcac5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcac5('0x3'));var db=require(_0xcac5('0x4'))['db'];var utils=require(_0xcac5('0x5'));var logger=require(_0xcac5('0x6'))(_0xcac5('0x7'));var config=require(_0xcac5('0x8'));var jayson=require(_0xcac5('0x9'));var client=jayson[_0xcac5('0xa')][_0xcac5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12c136,_0xb22fa6,_0x5d33a9){return new BPromise(function(_0x4b425d,_0x5d0d70){return client['request'](_0x12c136,_0x5d33a9)['then'](function(_0x172abb){logger[_0xcac5('0xc')](_0xcac5('0xd'),_0xb22fa6,_0xcac5('0xe'));logger[_0xcac5('0xf')](_0xcac5('0x10'),_0xb22fa6,'request\x20sent',JSON[_0xcac5('0x11')](_0x172abb));if(_0x172abb[_0xcac5('0x12')]){if(_0x172abb[_0xcac5('0x12')][_0xcac5('0x13')]===0x1f4){logger[_0xcac5('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0xb22fa6,_0x172abb[_0xcac5('0x12')]['message']);return _0x5d0d70(_0x172abb[_0xcac5('0x12')][_0xcac5('0x14')]);}logger[_0xcac5('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0xb22fa6,_0x172abb[_0xcac5('0x12')][_0xcac5('0x14')]);return _0x4b425d(_0x172abb[_0xcac5('0x12')][_0xcac5('0x14')]);}else{logger[_0xcac5('0xc')](_0xcac5('0xd'),_0xb22fa6,'request\x20sent');_0x4b425d(_0x172abb[_0xcac5('0x15')]['message']);}})[_0xcac5('0x16')](function(_0x4bd285){logger[_0xcac5('0x12')](_0xcac5('0xd'),_0xb22fa6,_0x4bd285);_0x5d0d70(_0x4bd285);});});}exports[_0xcac5('0x17')]=function(_0x263eee){var _0x39def4=this;return new Promise(function(_0x5d20b5,_0x229968){return db[_0xcac5('0x18')][_0xcac5('0x19')](_0x263eee[_0xcac5('0x1a')],{'raw':_0x263eee[_0xcac5('0x1b')]?_0x263eee['options'][_0xcac5('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x263eee[_0xcac5('0x1b')]?_0x263eee['options']['where']||null:null,'attributes':_0x263eee[_0xcac5('0x1b')]?_0x263eee[_0xcac5('0x1b')]['attributes']||null:null,'limit':_0x263eee[_0xcac5('0x1b')]?_0x263eee[_0xcac5('0x1b')][_0xcac5('0x1d')]||null:null})[_0xcac5('0x1e')](function(_0x256c53){logger['info']('UpdateOpenchannelApplication',_0x263eee);logger[_0xcac5('0xf')](_0xcac5('0x17'),_0x263eee,JSON[_0xcac5('0x11')](_0x256c53));_0x5d20b5(_0x256c53);})[_0xcac5('0x16')](function(_0x1bdb02){logger[_0xcac5('0x12')](_0xcac5('0x17'),_0x1bdb02[_0xcac5('0x14')],_0x263eee);_0x229968(_0x39def4[_0xcac5('0x12')](0x1f4,_0x1bdb02[_0xcac5('0x14')]));});});}; \ No newline at end of file +var _0x652f=['info','request\x20sent','error','code','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then'];(function(_0x31116a,_0x530c21){var _0x439b6b=function(_0x5c3b54){while(--_0x5c3b54){_0x31116a['push'](_0x31116a['shift']());}};_0x439b6b(++_0x530c21);}(_0x652f,0xf1));var _0xf652=function(_0x5e4ad6,_0x4858d0){_0x5e4ad6=_0x5e4ad6-0x0;var _0x155877=_0x652f[_0x5e4ad6];return _0x155877;};'use strict';var _=require('lodash');var util=require(_0xf652('0x0'));var moment=require('moment');var BPromise=require(_0xf652('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf652('0x2'));var db=require(_0xf652('0x3'))['db'];var utils=require(_0xf652('0x4'));var logger=require(_0xf652('0x5'))('rpc');var config=require(_0xf652('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf652('0x7')][_0xf652('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x581d9f,_0x5335a0,_0x534241){return new BPromise(function(_0x124695,_0x1d07b9){return client[_0xf652('0x9')](_0x581d9f,_0x534241)[_0xf652('0xa')](function(_0x201ec3){logger[_0xf652('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x5335a0,_0xf652('0xc'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x5335a0,_0xf652('0xc'),JSON['stringify'](_0x201ec3));if(_0x201ec3[_0xf652('0xd')]){if(_0x201ec3[_0xf652('0xd')][_0xf652('0xe')]===0x1f4){logger[_0xf652('0xd')](_0xf652('0xf'),_0x5335a0,_0x201ec3[_0xf652('0xd')]['message']);return _0x1d07b9(_0x201ec3[_0xf652('0xd')][_0xf652('0x10')]);}logger[_0xf652('0xd')](_0xf652('0xf'),_0x5335a0,_0x201ec3[_0xf652('0xd')][_0xf652('0x10')]);return _0x124695(_0x201ec3[_0xf652('0xd')]['message']);}else{logger[_0xf652('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x5335a0,_0xf652('0xc'));_0x124695(_0x201ec3[_0xf652('0x11')][_0xf652('0x10')]);}})[_0xf652('0x12')](function(_0x16a952){logger[_0xf652('0xd')](_0xf652('0xf'),_0x5335a0,_0x16a952);_0x1d07b9(_0x16a952);});});}exports[_0xf652('0x13')]=function(_0x2f53f8){var _0x58f4fe=this;return new Promise(function(_0x40e956,_0x59646b){return db[_0xf652('0x14')][_0xf652('0x15')](_0x2f53f8['body'],{'raw':_0x2f53f8['options']?_0x2f53f8[_0xf652('0x16')][_0xf652('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f53f8[_0xf652('0x16')]?_0x2f53f8['options'][_0xf652('0x18')]||null:null,'attributes':_0x2f53f8[_0xf652('0x16')]?_0x2f53f8[_0xf652('0x16')][_0xf652('0x19')]||null:null,'limit':_0x2f53f8[_0xf652('0x16')]?_0x2f53f8['options'][_0xf652('0x1a')]||null:null})[_0xf652('0xa')](function(_0x4777cb){logger['info'](_0xf652('0x13'),_0x2f53f8);logger[_0xf652('0x1b')](_0xf652('0x13'),_0x2f53f8,JSON['stringify'](_0x4777cb));_0x40e956(_0x4777cb);})[_0xf652('0x12')](function(_0x153c93){logger['error'](_0xf652('0x13'),_0x153c93[_0xf652('0x10')],_0x2f53f8);_0x59646b(_0x58f4fe[_0xf652('0xd')](0x1f4,_0x153c93['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 10933ed..4b18ea8 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 _0x7c25=['openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','describe','getMessages','/:id/download','download','post','tracked'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0x7c25,0x16a));var _0x57c2=function(_0x228243,_0x2eb0e1){_0x228243=_0x228243-0x0;var _0x761356=_0x7c25[_0x228243];return _0x761356;};'use strict';var multer=require(_0x57c2('0x0'));var util=require(_0x57c2('0x1'));var path=require(_0x57c2('0x2'));var timeout=require(_0x57c2('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x57c2('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x57c2('0x5'));var config=require(_0x57c2('0x6'));var controller=require(_0x57c2('0x7'));router[_0x57c2('0x8')]('/',auth[_0x57c2('0x9')](),controller['index']);router[_0x57c2('0x8')]('/describe',auth[_0x57c2('0x9')](),controller[_0x57c2('0xa')]);router[_0x57c2('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/messages',auth[_0x57c2('0x9')](),controller[_0x57c2('0xb')]);router[_0x57c2('0x8')](_0x57c2('0xc'),auth[_0x57c2('0x9')](),controller[_0x57c2('0xd')]);router[_0x57c2('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/messages',auth[_0x57c2('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x57c2('0x9')](),interaction[_0x57c2('0xf')](_0x57c2('0x10'),_0x57c2('0x11')),controller[_0x57c2('0x12')]);router['put'](_0x57c2('0x13'),auth['isAuthenticated'](),interaction[_0x57c2('0xf')]('openchannel',_0x57c2('0x14')),controller[_0x57c2('0x15')]);router[_0x57c2('0x16')](_0x57c2('0x13'),auth[_0x57c2('0x9')](),interaction[_0x57c2('0xf')]('openchannel',_0x57c2('0x17')),controller[_0x57c2('0x18')]);router[_0x57c2('0x16')](_0x57c2('0x19'),auth[_0x57c2('0x9')](),controller[_0x57c2('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xd240=['openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','index','/describe','get','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xd240,0x13e));var _0x0d24=function(_0x561be2,_0x42e8e4){_0x561be2=_0x561be2-0x0;var _0x41a37f=_0xd240[_0x561be2];return _0x41a37f;};'use strict';var multer=require(_0x0d24('0x0'));var util=require(_0x0d24('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0d24('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0d24('0x3'));var interaction=require(_0x0d24('0x4'));var config=require('../../config/environment');var controller=require(_0x0d24('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d24('0x6')]);router['get'](_0x0d24('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x0d24('0x8')](_0x0d24('0x9'),auth['isAuthenticated'](),controller[_0x0d24('0xa')]);router[_0x0d24('0x8')](_0x0d24('0xb'),auth[_0x0d24('0xc')](),controller[_0x0d24('0xd')]);router['get'](_0x0d24('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x0d24('0xf')]('/',auth[_0x0d24('0xc')](),controller[_0x0d24('0x10')]);router[_0x0d24('0xf')](_0x0d24('0xb'),auth[_0x0d24('0xc')](),controller[_0x0d24('0x11')]);router['post'](_0x0d24('0x12'),auth[_0x0d24('0xc')](),interaction[_0x0d24('0x13')](_0x0d24('0x14'),_0x0d24('0x15')),controller['addTags']);router[_0x0d24('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x0d24('0x13')](_0x0d24('0x14'),_0x0d24('0x17')),controller[_0x0d24('0x18')]);router['delete'](_0x0d24('0x9'),auth['isAuthenticated'](),interaction[_0x0d24('0x13')](_0x0d24('0x14'),'openchannelinteraction:destroy'),controller[_0x0d24('0x19')]);router['delete'](_0x0d24('0x12'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index ace05ba..bff48e6 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 _0xcb99=['BOOLEAN','STRING','ENUM','out','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xcb99,0x8b));var _0x9cb9=function(_0x1ce7cf,_0x1706be){_0x1ce7cf=_0x1ce7cf-0x0;var _0x38fe5a=_0xcb99[_0x1ce7cf];return _0x38fe5a;};'use strict';var Sequelize=require(_0x9cb9('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9cb9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9cb9('0x2')]},'thirdDisposition':{'type':Sequelize[_0x9cb9('0x2')]},'note':{'type':Sequelize[_0x9cb9('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x9cb9('0x2')]},'externalUrl':{'type':Sequelize[_0x9cb9('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9cb9('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x9cb9('0x3')]('in',_0x9cb9('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9cb9('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x9cb9('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x22fb=['ENUM','out','BOOLEAN','STRING','DATE'];(function(_0x3f23c0,_0x4d4253){var _0x168bbb=function(_0x4409c1){while(--_0x4409c1){_0x3f23c0['push'](_0x3f23c0['shift']());}};_0x168bbb(++_0x4d4253);}(_0x22fb,0x192));var _0xb22f=function(_0x4e288c,_0x3dfeae){_0x4e288c=_0x4e288c-0x0;var _0x4710df=_0x22fb[_0x4e288c];return _0x4710df;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xb22f('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb22f('0x1')]},'secondDisposition':{'type':Sequelize[_0xb22f('0x1')]},'thirdDisposition':{'type':Sequelize[_0xb22f('0x1')]},'note':{'type':Sequelize[_0xb22f('0x1')]},'read1stAt':{'type':Sequelize[_0xb22f('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xb22f('0x1')]},'lastMsgAt':{'type':Sequelize[_0xb22f('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xb22f('0x3')]('in',_0xb22f('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xb22f('0x3')]('in',_0xb22f('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xb22f('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 8994f14..c16e6b0 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 _0x28b0=['createPdfFromHTML','download','Unable\x20to\x20delete\x20zip\x20file','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../mysqldb','redis','defaults','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','catch','show','from','params','keys','filters','intersection','model','attributes','fields','length','include','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','format','merge','includeAll','setTags','omit','spread','Tag','color','emit','removeTags','server','tmp','join','root','attachments','transcript-%d-%s.zip','push','User','fullname','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','createdAt','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','Public','Private','Messages','map','existsSync','createReadStream','createWriteStream','basename','System','Contact','lastName','out','value','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x2e60b7,_0x4ae25e){var _0x2bbba1=function(_0x5045e0){while(--_0x5045e0){_0x2e60b7['push'](_0x2e60b7['shift']());}};_0x2bbba1(++_0x4ae25e);}(_0x28b0,0x174));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x028b('0x0'));var moment=require(_0x028b('0x1'));var util=require(_0x028b('0x2'));var path=require(_0x028b('0x3'));var ejs=require(_0x028b('0x4'));var fs=require('fs');var _=require(_0x028b('0x5'));var Redis=require(_0x028b('0x6'));var interaction=require(_0x028b('0x7'));var qs=require(_0x028b('0x8'));var pdf=require(_0x028b('0x9'));var logger=require('../../config/logger')(_0x028b('0xa'));var config=require('../../config/environment');var db=require(_0x028b('0xb'))['db'];config[_0x028b('0xc')]=_[_0x028b('0xd')](config[_0x028b('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x028b('0xc')]));require(_0x028b('0xe'))[_0x028b('0xf')](socket);function respondWithStatusCode(_0x27f053,_0x1cd8fc){_0x1cd8fc=_0x1cd8fc||0xcc;return function(_0x16181b){if(_0x16181b){return _0x27f053[_0x028b('0x10')](_0x1cd8fc);}return _0x27f053[_0x028b('0x11')](_0x1cd8fc)[_0x028b('0x12')]();};}function respondWithResult(_0x238b7d,_0x5683a7){_0x5683a7=_0x5683a7||0xc8;return function(_0x274b51){if(_0x274b51){return _0x238b7d[_0x028b('0x11')](_0x5683a7)[_0x028b('0x13')](_0x274b51);}};}function respondWithFilteredResult(_0x11b9f2,_0x52dd6c){return function(_0x99aed1){if(_0x99aed1){var _0x44da97=typeof _0x52dd6c[_0x028b('0x14')]===_0x028b('0x15')&&typeof _0x52dd6c[_0x028b('0x16')]===_0x028b('0x15');var _0x24c3d9=_0x99aed1['count'];var _0x2e3182=_0x44da97?0x0:_0x52dd6c[_0x028b('0x14')];var _0x5e519c=_0x44da97?_0x99aed1[_0x028b('0x17')]:_0x52dd6c['offset']+_0x52dd6c[_0x028b('0x16')];var _0x4ca9ff;if(_0x5e519c>=_0x24c3d9){_0x5e519c=_0x24c3d9;_0x4ca9ff=0xc8;}else{_0x4ca9ff=0xce;}_0x11b9f2['status'](_0x4ca9ff);return _0x11b9f2[_0x028b('0x18')](_0x028b('0x19'),_0x2e3182+'-'+_0x5e519c+'/'+_0x24c3d9)[_0x028b('0x13')](_0x99aed1);}return null;};}function saveUpdates(_0x412ff8){return function(_0x2fb4b7){if(_0x2fb4b7){return _0x2fb4b7[_0x028b('0x1a')](_0x412ff8)[_0x028b('0x1b')](function(_0x189720){return _0x189720;});}return null;};}function removeEntity(_0x4bd0b6){return function(_0x2f2307){if(_0x2f2307){return _0x2f2307[_0x028b('0x1c')]()[_0x028b('0x1b')](function(){_0x4bd0b6[_0x028b('0x11')](0xcc)[_0x028b('0x12')]();});}};}function handleEntityNotFound(_0xd49aba){return function(_0x2b6b80){if(!_0x2b6b80){_0xd49aba[_0x028b('0x10')](0x194);}return _0x2b6b80;};}function handleError(_0x502da2,_0x1ee638){_0x1ee638=_0x1ee638||0x1f4;return function(_0x456e8c){logger['error'](_0x456e8c[_0x028b('0x1d')]);if(_0x456e8c['name']){delete _0x456e8c[_0x028b('0x1e')];}_0x502da2[_0x028b('0x11')](_0x1ee638)['send'](_0x456e8c);};}exports[_0x028b('0x1f')]=function(_0x391c03,_0x9b8422){var _0x785f8c={};var _0x3b9b8b=_['map'](db[_0x028b('0x20')][_0x028b('0x21')],function(_0x3ddc82){return{'name':_0x3ddc82[_0x028b('0x22')],'type':_0x3ddc82[_0x028b('0x23')][_0x028b('0x24')]};});_0x785f8c=qs[_0x028b('0x25')](_0x3b9b8b,_0x391c03);return interaction[_0x028b('0x26')](_0x028b('0x27'),_0x391c03[_0x028b('0x28')],_0x391c03['user'],_0x785f8c,_0x3b9b8b)[_0x028b('0x1b')](respondWithFilteredResult(_0x9b8422,_0x785f8c))[_0x028b('0x29')](handleError(_0x9b8422,null));};exports[_0x028b('0x2a')]=function(_0x40d099,_0x169782){var _0xa1a55a={};if(_0x40d099['query']['type']&&_0x40d099[_0x028b('0x28')]['type']==='from'){_0xa1a55a[_0x028b('0x2b')]=_0x40d099['params']['id'];}else{_0xa1a55a['id']=_0x40d099[_0x028b('0x2c')]['id'];}var _0x3cf451={'raw':![],'where':_0xa1a55a},_0x1e42bb={};_0x1e42bb['model']=_[_0x028b('0x2d')](db[_0x028b('0x20')][_0x028b('0x21')]);_0x1e42bb[_0x028b('0x28')]=_[_0x028b('0x2d')](_0x40d099['query']);_0x1e42bb[_0x028b('0x2e')]=_[_0x028b('0x2f')](_0x1e42bb[_0x028b('0x30')],_0x1e42bb['query']);_0x3cf451[_0x028b('0x31')]=_['intersection'](_0x1e42bb[_0x028b('0x30')],qs[_0x028b('0x32')](_0x40d099[_0x028b('0x28')][_0x028b('0x32')]));_0x3cf451[_0x028b('0x31')]=_0x3cf451[_0x028b('0x31')][_0x028b('0x33')]?_0x3cf451[_0x028b('0x31')]:_0x1e42bb[_0x028b('0x30')];if(_0x40d099[_0x028b('0x28')]['includeAll']){_0x3cf451[_0x028b('0x34')]=[{'all':!![]}];}_0x3cf451=_['merge']({},_0x3cf451,_0x40d099[_0x028b('0x35')]);return db['OpenchannelInteraction'][_0x028b('0x36')](_0x3cf451)['then'](handleEntityNotFound(_0x169782,null))[_0x028b('0x1b')](respondWithResult(_0x169782,null))[_0x028b('0x29')](handleError(_0x169782,null));};exports['create']=function(_0xc96ac2,_0x2a3719){return db[_0x028b('0x20')][_0x028b('0x37')](_0xc96ac2['body'],{})[_0x028b('0x1b')](respondWithResult(_0x2a3719,0xc9))[_0x028b('0x29')](handleError(_0x2a3719,null));};exports['update']=function(_0x19833f,_0x5c3ab5){if(_0x19833f['body']['id']){delete _0x19833f[_0x028b('0x38')]['id'];}return db[_0x028b('0x20')][_0x028b('0x36')]({'where':{'id':_0x19833f['params']['id']}})[_0x028b('0x1b')](handleEntityNotFound(_0x5c3ab5,null))[_0x028b('0x1b')](saveUpdates(_0x19833f['body'],null))[_0x028b('0x1b')](respondWithResult(_0x5c3ab5,null))[_0x028b('0x29')](handleError(_0x5c3ab5,null));};exports[_0x028b('0x1c')]=function(_0x16236d,_0x5d30b8){return db['OpenchannelInteraction'][_0x028b('0x36')]({'where':{'id':_0x16236d[_0x028b('0x2c')]['id']}})[_0x028b('0x1b')](handleEntityNotFound(_0x5d30b8,null))['then'](removeEntity(_0x5d30b8,null))['catch'](handleError(_0x5d30b8,null));};exports[_0x028b('0x39')]=function(_0x46e304,_0x3c175d){return db[_0x028b('0x20')][_0x028b('0x39')]()['then'](respondWithResult(_0x3c175d,null))['catch'](handleError(_0x3c175d,null));};exports[_0x028b('0x3a')]=function(_0x1c995f,_0x4dc494){return db[_0x028b('0x3b')]['find']({'where':{'id':_0x1c995f['params']['id']}})[_0x028b('0x1b')](handleEntityNotFound(_0x4dc494,null))[_0x028b('0x1b')](function(_0x1f0100){if(_0x1f0100){return _0x1f0100['addMessage'](_0x1c995f[_0x028b('0x38')][_0x028b('0x3c')],_['omit'](_0x1c995f[_0x028b('0x38')],[_0x028b('0x3c'),'id'])||{});}})[_0x028b('0x1b')](respondWithResult(_0x4dc494,null))[_0x028b('0x29')](handleError(_0x4dc494,null));};exports[_0x028b('0x3d')]=function(_0x9fc541,_0x1a5548){var _0x17e359={'raw':![],'where':{}};var _0x49eb15={};var _0x204ffd={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x028b('0x3e')]({'where':{'id':_0x9fc541[_0x028b('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1a5548,null))[_0x028b('0x1b')](function(_0xc4ebc6){if(_0xc4ebc6){_0x49eb15['model']=_[_0x028b('0x2d')](db['OpenchannelMessage'][_0x028b('0x21')]);_0x49eb15[_0x028b('0x28')]=_[_0x028b('0x2d')](_0x9fc541['query']);_0x49eb15[_0x028b('0x2e')]=_[_0x028b('0x2f')](_0x49eb15[_0x028b('0x30')],_0x49eb15[_0x028b('0x28')]);_0x17e359['attributes']=_[_0x028b('0x2f')](_0x49eb15[_0x028b('0x30')],qs['fields'](_0x9fc541[_0x028b('0x28')][_0x028b('0x32')]));_0x17e359[_0x028b('0x31')]=_0x17e359['attributes'][_0x028b('0x33')]?_0x17e359[_0x028b('0x31')]:_0x49eb15[_0x028b('0x30')];if(!_0x9fc541['query'][_0x028b('0x3f')](_0x028b('0x40'))){_0x17e359[_0x028b('0x16')]=qs[_0x028b('0x16')](_0x9fc541['query']['limit']);_0x17e359[_0x028b('0x14')]=qs[_0x028b('0x14')](_0x9fc541['query'][_0x028b('0x14')]);}_0x17e359[_0x028b('0x41')]=qs[_0x028b('0x42')](_0x9fc541['query']['sort']);_0x17e359[_0x028b('0x43')]=qs['filters'](_[_0x028b('0x44')](_0x9fc541[_0x028b('0x28')],_0x49eb15[_0x028b('0x2e')]));_0x17e359[_0x028b('0x43')][_0x028b('0x45')]=_0xc4ebc6['id'];if(_0x9fc541[_0x028b('0x28')][_0x028b('0x46')]){_0x17e359[_0x028b('0x43')]=_['merge'](_0x17e359[_0x028b('0x43')],{'$or':_['map'](_0x17e359[_0x028b('0x31')],function(_0x598238){var _0xcae47c={};_0xcae47c[_0x598238]={'$like':'%'+_0x9fc541[_0x028b('0x28')]['filter']+'%'};return _0xcae47c;})});}if(_0x9fc541['query'][_0x028b('0x47')]){var _0x32fd02=_0x9fc541['query'][_0x028b('0x47')]['split'](',');var _0x470dc0={};_0x470dc0[_0x32fd02[0x0]]={'$gte':moment(_0x32fd02[0x1])[_0x028b('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x17e359[_0x028b('0x43')]=_[_0x028b('0x49')](_0x17e359[_0x028b('0x43')],_0x470dc0);}_0x17e359=_[_0x028b('0x49')]({},_0x17e359,_0x9fc541['options']);return db[_0x028b('0x3b')][_0x028b('0x17')]({'where':_0x17e359['where']})[_0x028b('0x1b')](function(_0x16f72d){_0x204ffd[_0x028b('0x17')]=_0x16f72d;if(_0x9fc541[_0x028b('0x28')][_0x028b('0x4a')]){_0x17e359[_0x028b('0x34')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x028b('0x26')](_0x17e359);})['then'](function(_0xcd7b6b){_0x204ffd['rows']=_0xcd7b6b;return _0x204ffd;});}})[_0x028b('0x1b')](respondWithFilteredResult(_0x1a5548,_0x17e359))['catch'](handleError(_0x1a5548,null));};exports['addTags']=function(_0xf7fa0b,_0x4c74e4){return db['OpenchannelInteraction'][_0x028b('0x36')]({'where':{'id':_0xf7fa0b['params']['id']}})['then'](handleEntityNotFound(_0x4c74e4,null))[_0x028b('0x1b')](function(_0x2c6f17){if(_0x2c6f17){return _0x2c6f17[_0x028b('0x4b')](_0xf7fa0b[_0x028b('0x38')][_0x028b('0x3c')],_[_0x028b('0x4c')](_0xf7fa0b[_0x028b('0x38')],[_0x028b('0x3c'),'id'])||{})[_0x028b('0x4d')](function(){return db[_0x028b('0x4e')][_0x028b('0x26')]({'attributes':['id',_0x028b('0x1e'),_0x028b('0x4f')],'where':{'id':_0xf7fa0b[_0x028b('0x38')][_0x028b('0x3c')]}});})[_0x028b('0x1b')](function(_0x174be7){socket[_0x028b('0x50')]('openchannelInteractionTags:save',{'id':Number(_0xf7fa0b[_0x028b('0x2c')]['id']),'tags':_0x174be7||[]});return{'id':Number(_0xf7fa0b[_0x028b('0x2c')]['id']),'tags':_0x174be7||[]};});}})['then'](respondWithResult(_0x4c74e4,null))['catch'](handleError(_0x4c74e4,null));};exports['removeTags']=function(_0x55f89b,_0x24ceae){return db[_0x028b('0x20')]['find']({'where':{'id':_0x55f89b[_0x028b('0x2c')]['id']}})[_0x028b('0x1b')](handleEntityNotFound(_0x24ceae,null))[_0x028b('0x1b')](function(_0x202896){if(_0x202896){return _0x202896[_0x028b('0x51')](_0x55f89b[_0x028b('0x28')][_0x028b('0x3c')]);}})[_0x028b('0x1b')](respondWithStatusCode(_0x24ceae,null))[_0x028b('0x29')](handleError(_0x24ceae,null));};exports['download']=function(_0x40c986,_0x441c14){var _0x260c52=moment()['unix']()['toString']();var _0x1690d7=path['join'](config['root'],_0x028b('0x52'),'files',_0x028b('0x53'));var _0x335113=path[_0x028b('0x54')](config[_0x028b('0x55')],_0x028b('0x52'),'files',_0x028b('0x56'));var _0x53a306=path['join'](_0x1690d7,_0x260c52);var _0x2fcc65=util[_0x028b('0x48')](_0x028b('0x57'),_0x40c986[_0x028b('0x2c')]['id'],_0x260c52);var _0x191edc=path[_0x028b('0x54')](_0x1690d7,_0x2fcc65);var _0x6ca8f2=[];_0x6ca8f2[_0x028b('0x58')]({'model':db[_0x028b('0x59')],'as':_0x028b('0x59'),'attributes':['id',_0x028b('0x5a')],'raw':!![]});_0x6ca8f2[_0x028b('0x58')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x40c986[_0x028b('0x28')][_0x028b('0x56')]){_0x6ca8f2[_0x028b('0x58')]({'model':db[_0x028b('0x5b')],'as':_0x028b('0x5b'),'raw':!![]});}var _0x386a8f=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x028b('0x38'),'createdAt',_0x028b('0x5c'),'secret','read'],'include':_0x6ca8f2}];_0x386a8f['push']({'model':db[_0x028b('0x5d')],'as':_0x028b('0x5e'),'attributes':['id',_0x028b('0x1e')]});_0x386a8f[_0x028b('0x58')]({'model':db['User'],'as':_0x028b('0x5f'),'attributes':['id',_0x028b('0x5a')]});return db[_0x028b('0x20')][_0x028b('0x36')]({'where':{'id':_0x40c986[_0x028b('0x2c')]['id']},'include':_0x386a8f})[_0x028b('0x1b')](handleEntityNotFound(_0x441c14,null))['then'](function(_0x32bfa4){if(_0x32bfa4){var _0x49837e=_0x32bfa4[_0x028b('0x60')]({'plain':!![]});fs[_0x028b('0x61')](_0x53a306);var _0x59a186={'channel':_0x028b('0x62'),'account':_0x49837e[_0x028b('0x5e')][_0x028b('0x1e')],'agent':_0x49837e[_0x028b('0x5f')]?_0x49837e[_0x028b('0x5f')][_0x028b('0x5a')]:'N.A.','createdAt':moment(_0x49837e[_0x028b('0x63')])['format'](_0x028b('0x64'))[_0x028b('0x65')](),'closedAt':_0x49837e[_0x028b('0x66')]?moment(_0x49837e[_0x028b('0x67')])[_0x028b('0x48')](_0x028b('0x64'))[_0x028b('0x65')]():'','disposition':_0x49837e['disposition'],'visibility':_0x49837e['threadId']?_0x028b('0x68'):_0x028b('0x69'),'messages':_(_0x49837e[_0x028b('0x6a')])[_0x028b('0x46')]({'secret':![]})[_0x028b('0x6b')](function(_0x3eccc5){if(_0x3eccc5[_0x028b('0x5b')]){var _0x490f63=path[_0x028b('0x54')](_0x335113,_0x3eccc5['Attachment']['basename']);if(fs[_0x028b('0x6c')](_0x490f63)){fs[_0x028b('0x6d')](_0x490f63)['pipe'](fs[_0x028b('0x6e')](path[_0x028b('0x54')](_0x53a306,_0x3eccc5[_0x028b('0x5b')][_0x028b('0x6f')])));}}return{'date':moment(_0x3eccc5[_0x028b('0x63')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x028b('0x65')](),'sender':_0x3eccc5[_0x028b('0x5c')]==='out'?_0x3eccc5['User']?_0x3eccc5[_0x028b('0x59')]['fullname']:_0x028b('0x70'):_0x3eccc5[_0x028b('0x71')]['firstName']+(_0x3eccc5[_0x028b('0x71')][_0x028b('0x72')]?'\x20'+_0x3eccc5[_0x028b('0x71')][_0x028b('0x72')]:''),'body':_0x3eccc5[_0x028b('0x5b')]?_0x3eccc5[_0x028b('0x5b')]['basename']:_0x3eccc5[_0x028b('0x38')],'direction':_0x3eccc5['direction']===_0x028b('0x73')?'A':'C','secret':_0x3eccc5['secret'],'read':_0x3eccc5['read'],'attachment':_0x3eccc5['Attachment']};})[_0x028b('0x74')]()};return ejs['renderFile'](path[_0x028b('0x54')](config[_0x028b('0x55')],_0x028b('0x52'),'views',_0x028b('0x75')),{'interaction':_0x59a186})[_0x028b('0x1b')](function(_0x17fc31){var _0x5d0d4a=path[_0x028b('0x54')](_0x53a306,_0x028b('0x76')+_0x49837e['id']+'-'+_0x260c52+_0x028b('0x77'));var _0x3d7f65={'path':_0x5d0d4a,'channel':_0x028b('0x62'),'interactionId':_0x49837e['id']};return pdf[_0x028b('0x78')](_0x17fc31,_0x3d7f65);})['then'](function(){return new Promise(function(_0x5ebd0c,_0x3db283){zipdir(_0x53a306,{'saveTo':_0x191edc},function(_0x49a654,_0x4a7c35){if(_0x49a654)return _0x3db283(_0x49a654);return _0x5ebd0c(_0x4a7c35);});})['then'](function(){return new Promise(function(_0x2619be,_0x5ec57d){rimraf(_0x53a306,function(_0x2237e7){if(_0x2237e7)_0x5ec57d(_0x2237e7);return _0x2619be();});});})[_0x028b('0x1b')](function(){return _0x441c14[_0x028b('0x79')](_0x191edc,_0x2fcc65,function(_0xd227a2){if(_0xd227a2){logger['error'](_0x028b('0x7a'),_0xd227a2);}else{fs['unlinkSync'](_0x191edc);}});});});}else{return _0x441c14['sendStatus'](0xc8);}})[_0x028b('0x29')](handleError(_0x441c14,null));}; \ No newline at end of file +var _0xe649=['pipe','createWriteStream','out','System','Contact','read','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','end','offset','undefined','limit','count','json','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','findAll','openchannel','query','catch','from','params','model','keys','filters','attributes','intersection','fields','includeAll','include','options','find','create','body','update','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','where','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','merge','rows','addTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','lastName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','closedAt','disposition','threadId','Public','filter','basename','existsSync'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe649,0x18a));var _0x9e64=function(_0x374d93,_0x3ff575){_0x374d93=_0x374d93-0x0;var _0x2bcde2=_0xe649[_0x374d93];return _0x2bcde2;};'use strict';var rimraf=require(_0x9e64('0x0'));var zipdir=require(_0x9e64('0x1'));var moment=require(_0x9e64('0x2'));var util=require(_0x9e64('0x3'));var path=require(_0x9e64('0x4'));var ejs=require(_0x9e64('0x5'));var fs=require('fs');var _=require(_0x9e64('0x6'));var Redis=require('ioredis');var interaction=require(_0x9e64('0x7'));var qs=require(_0x9e64('0x8'));var pdf=require(_0x9e64('0x9'));var logger=require(_0x9e64('0xa'))(_0x9e64('0xb'));var config=require(_0x9e64('0xc'));var db=require(_0x9e64('0xd'))['db'];config['redis']=_[_0x9e64('0xe')](config[_0x9e64('0xf')],{'host':_0x9e64('0x10'),'port':0x18eb});var socket=require(_0x9e64('0x11'))(new Redis(config[_0x9e64('0xf')]));require('./openchannelInteraction.socket')[_0x9e64('0x12')](socket);function respondWithStatusCode(_0x4b9839,_0x32c710){_0x32c710=_0x32c710||0xcc;return function(_0x3c52e6){if(_0x3c52e6){return _0x4b9839['sendStatus'](_0x32c710);}return _0x4b9839[_0x9e64('0x13')](_0x32c710)[_0x9e64('0x14')]();};}function respondWithResult(_0x53c311,_0x3f85eb){_0x3f85eb=_0x3f85eb||0xc8;return function(_0x375901){if(_0x375901){return _0x53c311[_0x9e64('0x13')](_0x3f85eb)['json'](_0x375901);}};}function respondWithFilteredResult(_0x412316,_0x32dacc){return function(_0x11243f){if(_0x11243f){var _0x53198c=typeof _0x32dacc[_0x9e64('0x15')]===_0x9e64('0x16')&&typeof _0x32dacc[_0x9e64('0x17')]==='undefined';var _0x43ca38=_0x11243f[_0x9e64('0x18')];var _0x4dc875=_0x53198c?0x0:_0x32dacc[_0x9e64('0x15')];var _0x345287=_0x53198c?_0x11243f['count']:_0x32dacc[_0x9e64('0x15')]+_0x32dacc[_0x9e64('0x17')];var _0x3c2b73;if(_0x345287>=_0x43ca38){_0x345287=_0x43ca38;_0x3c2b73=0xc8;}else{_0x3c2b73=0xce;}_0x412316[_0x9e64('0x13')](_0x3c2b73);return _0x412316['set']('Content-Range',_0x4dc875+'-'+_0x345287+'/'+_0x43ca38)[_0x9e64('0x19')](_0x11243f);}return null;};}function saveUpdates(_0x189bb0){return function(_0x392a12){if(_0x392a12){return _0x392a12['update'](_0x189bb0)[_0x9e64('0x1a')](function(_0x416aae){return _0x416aae;});}return null;};}function removeEntity(_0x5d17c5){return function(_0x55cdf4){if(_0x55cdf4){return _0x55cdf4[_0x9e64('0x1b')]()[_0x9e64('0x1a')](function(){_0x5d17c5[_0x9e64('0x13')](0xcc)[_0x9e64('0x14')]();});}};}function handleEntityNotFound(_0x5615b0){return function(_0x41dfd0){if(!_0x41dfd0){_0x5615b0[_0x9e64('0x1c')](0x194);}return _0x41dfd0;};}function handleError(_0x1e0210,_0x199d77){_0x199d77=_0x199d77||0x1f4;return function(_0x3c1ebc){logger[_0x9e64('0x1d')](_0x3c1ebc[_0x9e64('0x1e')]);if(_0x3c1ebc[_0x9e64('0x1f')]){delete _0x3c1ebc[_0x9e64('0x1f')];}_0x1e0210[_0x9e64('0x13')](_0x199d77)[_0x9e64('0x20')](_0x3c1ebc);};}exports[_0x9e64('0x21')]=function(_0x30ce53,_0x453bcb){var _0x1e6c04={};var _0x566bfa=_['map'](db[_0x9e64('0x22')][_0x9e64('0x23')],function(_0x38066d){return{'name':_0x38066d[_0x9e64('0x24')],'type':_0x38066d[_0x9e64('0x25')][_0x9e64('0x26')]};});_0x1e6c04=qs['getOptions'](_0x566bfa,_0x30ce53);return interaction[_0x9e64('0x27')](_0x9e64('0x28'),_0x30ce53[_0x9e64('0x29')],_0x30ce53['user'],_0x1e6c04,_0x566bfa)[_0x9e64('0x1a')](respondWithFilteredResult(_0x453bcb,_0x1e6c04))[_0x9e64('0x2a')](handleError(_0x453bcb,null));};exports['show']=function(_0x5df9c0,_0x4a45dd){var _0x7d0a56={};if(_0x5df9c0[_0x9e64('0x29')]['type']&&_0x5df9c0[_0x9e64('0x29')]['type']===_0x9e64('0x2b')){_0x7d0a56[_0x9e64('0x2b')]=_0x5df9c0[_0x9e64('0x2c')]['id'];}else{_0x7d0a56['id']=_0x5df9c0[_0x9e64('0x2c')]['id'];}var _0x392d1c={'raw':![],'where':_0x7d0a56},_0x22f34c={};_0x22f34c[_0x9e64('0x2d')]=_['keys'](db[_0x9e64('0x22')][_0x9e64('0x23')]);_0x22f34c[_0x9e64('0x29')]=_[_0x9e64('0x2e')](_0x5df9c0[_0x9e64('0x29')]);_0x22f34c[_0x9e64('0x2f')]=_['intersection'](_0x22f34c[_0x9e64('0x2d')],_0x22f34c[_0x9e64('0x29')]);_0x392d1c[_0x9e64('0x30')]=_[_0x9e64('0x31')](_0x22f34c[_0x9e64('0x2d')],qs[_0x9e64('0x32')](_0x5df9c0[_0x9e64('0x29')][_0x9e64('0x32')]));_0x392d1c[_0x9e64('0x30')]=_0x392d1c[_0x9e64('0x30')]['length']?_0x392d1c[_0x9e64('0x30')]:_0x22f34c[_0x9e64('0x2d')];if(_0x5df9c0[_0x9e64('0x29')][_0x9e64('0x33')]){_0x392d1c[_0x9e64('0x34')]=[{'all':!![]}];}_0x392d1c=_['merge']({},_0x392d1c,_0x5df9c0[_0x9e64('0x35')]);return db[_0x9e64('0x22')][_0x9e64('0x36')](_0x392d1c)[_0x9e64('0x1a')](handleEntityNotFound(_0x4a45dd,null))[_0x9e64('0x1a')](respondWithResult(_0x4a45dd,null))['catch'](handleError(_0x4a45dd,null));};exports[_0x9e64('0x37')]=function(_0x40d5d4,_0x9ce725){return db[_0x9e64('0x22')][_0x9e64('0x37')](_0x40d5d4[_0x9e64('0x38')],{})[_0x9e64('0x1a')](respondWithResult(_0x9ce725,0xc9))[_0x9e64('0x2a')](handleError(_0x9ce725,null));};exports[_0x9e64('0x39')]=function(_0xa11a1f,_0x133461){if(_0xa11a1f[_0x9e64('0x38')]['id']){delete _0xa11a1f[_0x9e64('0x38')]['id'];}return db[_0x9e64('0x22')]['find']({'where':{'id':_0xa11a1f['params']['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0x133461,null))[_0x9e64('0x1a')](saveUpdates(_0xa11a1f[_0x9e64('0x38')],null))[_0x9e64('0x1a')](respondWithResult(_0x133461,null))[_0x9e64('0x2a')](handleError(_0x133461,null));};exports[_0x9e64('0x1b')]=function(_0x2a9bec,_0x4ffc33){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2a9bec[_0x9e64('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4ffc33,null))[_0x9e64('0x1a')](removeEntity(_0x4ffc33,null))[_0x9e64('0x2a')](handleError(_0x4ffc33,null));};exports[_0x9e64('0x3a')]=function(_0x3dfd07,_0x64eb71){return db[_0x9e64('0x22')][_0x9e64('0x3a')]()[_0x9e64('0x1a')](respondWithResult(_0x64eb71,null))[_0x9e64('0x2a')](handleError(_0x64eb71,null));};exports['addMessage']=function(_0x7400dd,_0x3424a0){return db[_0x9e64('0x3b')]['find']({'where':{'id':_0x7400dd[_0x9e64('0x2c')]['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0x3424a0,null))[_0x9e64('0x1a')](function(_0x53710c){if(_0x53710c){return _0x53710c[_0x9e64('0x3c')](_0x7400dd[_0x9e64('0x38')][_0x9e64('0x3d')],_[_0x9e64('0x3e')](_0x7400dd['body'],['ids','id'])||{});}})[_0x9e64('0x1a')](respondWithResult(_0x3424a0,null))[_0x9e64('0x2a')](handleError(_0x3424a0,null));};exports[_0x9e64('0x3f')]=function(_0x36b694,_0xeacd34){var _0x5cf660={'raw':![],'where':{}};var _0x27b28a={};var _0x516343={'count':0x0,'rows':[]};return db[_0x9e64('0x22')][_0x9e64('0x40')]({'where':{'id':_0x36b694[_0x9e64('0x2c')]['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0xeacd34,null))[_0x9e64('0x1a')](function(_0xa363c7){if(_0xa363c7){_0x27b28a['model']=_[_0x9e64('0x2e')](db[_0x9e64('0x3b')][_0x9e64('0x23')]);_0x27b28a[_0x9e64('0x29')]=_[_0x9e64('0x2e')](_0x36b694[_0x9e64('0x29')]);_0x27b28a['filters']=_[_0x9e64('0x31')](_0x27b28a[_0x9e64('0x2d')],_0x27b28a[_0x9e64('0x29')]);_0x5cf660[_0x9e64('0x30')]=_['intersection'](_0x27b28a[_0x9e64('0x2d')],qs[_0x9e64('0x32')](_0x36b694[_0x9e64('0x29')]['fields']));_0x5cf660[_0x9e64('0x30')]=_0x5cf660[_0x9e64('0x30')]['length']?_0x5cf660[_0x9e64('0x30')]:_0x27b28a[_0x9e64('0x2d')];if(!_0x36b694['query'][_0x9e64('0x41')]('nolimit')){_0x5cf660[_0x9e64('0x17')]=qs['limit'](_0x36b694[_0x9e64('0x29')]['limit']);_0x5cf660['offset']=qs[_0x9e64('0x15')](_0x36b694[_0x9e64('0x29')][_0x9e64('0x15')]);}_0x5cf660[_0x9e64('0x42')]=qs[_0x9e64('0x43')](_0x36b694[_0x9e64('0x29')]['sort']);_0x5cf660[_0x9e64('0x44')]=qs[_0x9e64('0x2f')](_['pick'](_0x36b694['query'],_0x27b28a[_0x9e64('0x2f')]));_0x5cf660[_0x9e64('0x44')]['OpenchannelInteractionId']=_0xa363c7['id'];if(_0x36b694[_0x9e64('0x29')]['filter']){_0x5cf660[_0x9e64('0x44')]=_['merge'](_0x5cf660[_0x9e64('0x44')],{'$or':_[_0x9e64('0x45')](_0x5cf660['attributes'],function(_0x25f3cb){var _0x54413d={};_0x54413d[_0x25f3cb]={'$like':'%'+_0x36b694[_0x9e64('0x29')]['filter']+'%'};return _0x54413d;})});}if(_0x36b694[_0x9e64('0x29')][_0x9e64('0x46')]){var _0x1638fd=_0x36b694[_0x9e64('0x29')][_0x9e64('0x46')]['split'](',');var _0x343672={};_0x343672[_0x1638fd[0x0]]={'$gte':moment(_0x1638fd[0x1])[_0x9e64('0x47')](_0x9e64('0x48'))};_0x5cf660[_0x9e64('0x44')]=_[_0x9e64('0x49')](_0x5cf660[_0x9e64('0x44')],_0x343672);}_0x5cf660=_[_0x9e64('0x49')]({},_0x5cf660,_0x36b694[_0x9e64('0x35')]);return db['OpenchannelMessage'][_0x9e64('0x18')]({'where':_0x5cf660[_0x9e64('0x44')]})[_0x9e64('0x1a')](function(_0x319ea9){_0x516343[_0x9e64('0x18')]=_0x319ea9;if(_0x36b694['query'][_0x9e64('0x33')]){_0x5cf660['include']=[{'all':!![]}];}return db[_0x9e64('0x3b')][_0x9e64('0x27')](_0x5cf660);})[_0x9e64('0x1a')](function(_0x2200cc){_0x516343[_0x9e64('0x4a')]=_0x2200cc;return _0x516343;});}})[_0x9e64('0x1a')](respondWithFilteredResult(_0xeacd34,_0x5cf660))['catch'](handleError(_0xeacd34,null));};exports[_0x9e64('0x4b')]=function(_0x3fc0e9,_0x4d86e4){return db[_0x9e64('0x22')]['find']({'where':{'id':_0x3fc0e9[_0x9e64('0x2c')]['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0x4d86e4,null))[_0x9e64('0x1a')](function(_0x402975){if(_0x402975){return _0x402975['setTags'](_0x3fc0e9['body']['ids'],_[_0x9e64('0x3e')](_0x3fc0e9['body'],[_0x9e64('0x3d'),'id'])||{})['spread'](function(){return db[_0x9e64('0x4c')][_0x9e64('0x27')]({'attributes':['id',_0x9e64('0x1f'),_0x9e64('0x4d')],'where':{'id':_0x3fc0e9[_0x9e64('0x38')][_0x9e64('0x3d')]}});})[_0x9e64('0x1a')](function(_0x17e7ab){socket[_0x9e64('0x4e')](_0x9e64('0x4f'),{'id':Number(_0x3fc0e9['params']['id']),'tags':_0x17e7ab||[]});return{'id':Number(_0x3fc0e9['params']['id']),'tags':_0x17e7ab||[]};});}})[_0x9e64('0x1a')](respondWithResult(_0x4d86e4,null))[_0x9e64('0x2a')](handleError(_0x4d86e4,null));};exports['removeTags']=function(_0x48bef4,_0x22f4f4){return db[_0x9e64('0x22')]['find']({'where':{'id':_0x48bef4[_0x9e64('0x2c')]['id']}})[_0x9e64('0x1a')](handleEntityNotFound(_0x22f4f4,null))[_0x9e64('0x1a')](function(_0x5316a5){if(_0x5316a5){return _0x5316a5[_0x9e64('0x50')](_0x48bef4['query'][_0x9e64('0x3d')]);}})[_0x9e64('0x1a')](respondWithStatusCode(_0x22f4f4,null))[_0x9e64('0x2a')](handleError(_0x22f4f4,null));};exports[_0x9e64('0x51')]=function(_0x473b2b,_0x2632d2){var _0x5b1149=moment()[_0x9e64('0x52')]()[_0x9e64('0x53')]();var _0x12811d=path[_0x9e64('0x54')](config[_0x9e64('0x55')],'server',_0x9e64('0x56'),_0x9e64('0x57'));var _0x7195a1=path[_0x9e64('0x54')](config[_0x9e64('0x55')],_0x9e64('0x58'),_0x9e64('0x56'),_0x9e64('0x59'));var _0x518a71=path[_0x9e64('0x54')](_0x12811d,_0x5b1149);var _0x5ac678=util[_0x9e64('0x47')](_0x9e64('0x5a'),_0x473b2b['params']['id'],_0x5b1149);var _0x46aa93=path['join'](_0x12811d,_0x5ac678);var _0x51b3e3=[];_0x51b3e3[_0x9e64('0x5b')]({'model':db[_0x9e64('0x5c')],'as':_0x9e64('0x5c'),'attributes':['id',_0x9e64('0x5d')],'raw':!![]});_0x51b3e3[_0x9e64('0x5b')]({'model':db[_0x9e64('0x5e')],'as':'Contact','attributes':['id','firstName',_0x9e64('0x5f')],'raw':!![]});if(_0x473b2b[_0x9e64('0x29')]['attachments']){_0x51b3e3[_0x9e64('0x5b')]({'model':db[_0x9e64('0x60')],'as':_0x9e64('0x60'),'raw':!![]});}var _0x58040c=[{'model':db[_0x9e64('0x3b')],'as':_0x9e64('0x61'),'attributes':['id','body',_0x9e64('0x62'),_0x9e64('0x63'),_0x9e64('0x64'),'read'],'include':_0x51b3e3}];_0x58040c[_0x9e64('0x5b')]({'model':db[_0x9e64('0x65')],'as':_0x9e64('0x66'),'attributes':['id',_0x9e64('0x1f')]});_0x58040c[_0x9e64('0x5b')]({'model':db[_0x9e64('0x5c')],'as':_0x9e64('0x67'),'attributes':['id',_0x9e64('0x5d')]});return db[_0x9e64('0x22')]['find']({'where':{'id':_0x473b2b[_0x9e64('0x2c')]['id']},'include':_0x58040c})[_0x9e64('0x1a')](handleEntityNotFound(_0x2632d2,null))[_0x9e64('0x1a')](function(_0x2e5032){if(_0x2e5032){var _0x35d8fc=_0x2e5032[_0x9e64('0x68')]({'plain':!![]});fs[_0x9e64('0x69')](_0x518a71);var _0xe99d40={'channel':_0x9e64('0x6a'),'account':_0x35d8fc[_0x9e64('0x66')][_0x9e64('0x1f')],'agent':_0x35d8fc['Owner']?_0x35d8fc[_0x9e64('0x67')][_0x9e64('0x5d')]:'N.A.','createdAt':moment(_0x35d8fc['createdAt'])[_0x9e64('0x47')](_0x9e64('0x48'))[_0x9e64('0x53')](),'closedAt':_0x35d8fc['closed']?moment(_0x35d8fc[_0x9e64('0x6b')])[_0x9e64('0x47')](_0x9e64('0x48'))['toString']():'','disposition':_0x35d8fc[_0x9e64('0x6c')],'visibility':_0x35d8fc[_0x9e64('0x6d')]?_0x9e64('0x6e'):'Private','messages':_(_0x35d8fc[_0x9e64('0x61')])[_0x9e64('0x6f')]({'secret':![]})[_0x9e64('0x45')](function(_0x527286){if(_0x527286[_0x9e64('0x60')]){var _0x6413ec=path[_0x9e64('0x54')](_0x7195a1,_0x527286[_0x9e64('0x60')][_0x9e64('0x70')]);if(fs[_0x9e64('0x71')](_0x6413ec)){fs['createReadStream'](_0x6413ec)[_0x9e64('0x72')](fs[_0x9e64('0x73')](path[_0x9e64('0x54')](_0x518a71,_0x527286[_0x9e64('0x60')]['basename'])));}}return{'date':moment(_0x527286[_0x9e64('0x62')])['format'](_0x9e64('0x48'))[_0x9e64('0x53')](),'sender':_0x527286['direction']===_0x9e64('0x74')?_0x527286['User']?_0x527286['User'][_0x9e64('0x5d')]:_0x9e64('0x75'):_0x527286[_0x9e64('0x76')]['firstName']+(_0x527286[_0x9e64('0x76')]['lastName']?'\x20'+_0x527286['Contact']['lastName']:''),'body':_0x527286[_0x9e64('0x60')]?_0x527286['Attachment'][_0x9e64('0x70')]:_0x527286[_0x9e64('0x38')],'direction':_0x527286[_0x9e64('0x63')]===_0x9e64('0x74')?'A':'C','secret':_0x527286[_0x9e64('0x64')],'read':_0x527286[_0x9e64('0x77')],'attachment':_0x527286[_0x9e64('0x60')]};})[_0x9e64('0x78')]()};return ejs[_0x9e64('0x79')](path[_0x9e64('0x54')](config[_0x9e64('0x55')],_0x9e64('0x58'),'views',_0x9e64('0x7a')),{'interaction':_0xe99d40})[_0x9e64('0x1a')](function(_0x5ee1e6){var _0x1a1882=path[_0x9e64('0x54')](_0x518a71,_0x9e64('0x7b')+_0x35d8fc['id']+'-'+_0x5b1149+_0x9e64('0x7c'));var _0x3e086a={'path':_0x1a1882,'channel':'Openchannel','interactionId':_0x35d8fc['id']};return pdf[_0x9e64('0x7d')](_0x5ee1e6,_0x3e086a);})[_0x9e64('0x1a')](function(){return new Promise(function(_0x5ab91d,_0x446e69){zipdir(_0x518a71,{'saveTo':_0x46aa93},function(_0x599bd3,_0x24c297){if(_0x599bd3)return _0x446e69(_0x599bd3);return _0x5ab91d(_0x24c297);});})[_0x9e64('0x1a')](function(){return new Promise(function(_0x3df97c,_0xe22301){rimraf(_0x518a71,function(_0x506d69){if(_0x506d69)_0xe22301(_0x506d69);return _0x3df97c();});});})[_0x9e64('0x1a')](function(){return _0x2632d2['download'](_0x46aa93,_0x5ac678,function(_0x46850d){if(_0x46850d){logger[_0x9e64('0x1d')]('Unable\x20to\x20delete\x20zip\x20file',_0x46850d);}else{fs[_0x9e64('0x7e')](_0x46aa93);}});});});}else{return _0x2632d2[_0x9e64('0x1c')](0xc8);}})[_0x9e64('0x2a')](handleError(_0x2632d2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index e1a8c5f..60b5243 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 _0x6c34=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6c34,0x10b));var _0x46c3=function(_0x2b034b,_0x8ee798){_0x2b034b=_0x2b034b-0x0;var _0x5e4653=_0x6c34[_0x2b034b];return _0x5e4653;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x46c3('0x0'))['db'][_0x46c3('0x1')];var OpenchannelMessage=require(_0x46c3('0x0'))['db'][_0x46c3('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x46c3('0x3')](0x0);var events={'afterCreate':_0x46c3('0x4'),'afterUpdate':_0x46c3('0x5'),'afterDestroy':_0x46c3('0x6')};function emitEvent(_0x15259f){return function(_0x59c25b,_0x1e4d34,_0x1dd932){_0x59c25b[_0x46c3('0x7')]({'attributes':['id'],'raw':!![]})[_0x46c3('0x8')](function(_0x95b372){_0x59c25b[_0x46c3('0x9')](_0x46c3('0xa'),_0x95b372['map'](function(_0x3c58ed){return{'id':_0x3c58ed['id']};}));return OpenchannelMessage[_0x46c3('0xb')]({'where':{'OpenchannelInteractionId':_0x59c25b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x46c3('0x8')](function(_0x579190){_0x59c25b[_0x46c3('0x9')](_0x46c3('0xc'),_0x579190[_0x46c3('0xd')]);OpenchannelInteractionEvents[_0x46c3('0xe')](_0x15259f+':'+_0x59c25b['id'],_0x59c25b);OpenchannelInteractionEvents[_0x46c3('0xe')](_0x15259f,_0x59c25b);_0x1dd932(null);})['catch'](_0x1dd932(null));};}for(var e in events){if(events[_0x46c3('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x46c3('0x10')](e,emitEvent(event));}}module[_0x46c3('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x31fe=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31fe,0x173));var _0xe31f=function(_0x127ec5,_0xbc3cd0){_0x127ec5=_0x127ec5-0x0;var _0x3f5c20=_0x31fe[_0x127ec5];return _0x3f5c20;};'use strict';var EventEmitter=require(_0xe31f('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xe31f('0x1')];var OpenchannelMessage=require(_0xe31f('0x2'))['db'][_0xe31f('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe31f('0x4')](0x0);var events={'afterCreate':_0xe31f('0x5'),'afterUpdate':'update','afterDestroy':_0xe31f('0x6')};function emitEvent(_0xea53d8){return function(_0x89f77c,_0x3a3d36,_0x1a27cf){_0x89f77c[_0xe31f('0x7')]({'attributes':['id'],'raw':!![]})[_0xe31f('0x8')](function(_0x2c6a40){_0x89f77c[_0xe31f('0x9')](_0xe31f('0xa'),_0x2c6a40[_0xe31f('0xb')](function(_0x4dfb0d){return{'id':_0x4dfb0d['id']};}));return OpenchannelMessage[_0xe31f('0xc')]({'where':{'OpenchannelInteractionId':_0x89f77c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe31f('0x8')](function(_0x7d6d5){_0x89f77c[_0xe31f('0x9')](_0xe31f('0xd'),_0x7d6d5[_0xe31f('0xe')]);OpenchannelInteractionEvents['emit'](_0xea53d8+':'+_0x89f77c['id'],_0x89f77c);OpenchannelInteractionEvents[_0xe31f('0xf')](_0xea53d8,_0x89f77c);_0x1a27cf(null);})[_0xe31f('0x10')](_0x1a27cf(null));};}for(var e in events){if(events[_0xe31f('0x11')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3aebea6..d904c28 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 _0x7449=['utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions'];(function(_0x138711,_0x202fd3){var _0x31c01d=function(_0x581830){while(--_0x581830){_0x138711['push'](_0x138711['shift']());}};_0x31c01d(++_0x202fd3);}(_0x7449,0x14b));var _0x9744=function(_0x47dc95,_0x117d17){_0x47dc95=_0x47dc95-0x0;var _0x504325=_0x7449[_0x47dc95];return _0x504325;};'use strict';var _=require(_0x9744('0x0'));var util=require(_0x9744('0x1'));var logger=require(_0x9744('0x2'))(_0x9744('0x3'));var moment=require('moment');var BPromise=require(_0x9744('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9744('0x5'));var rimraf=require('rimraf');var config=require(_0x9744('0x6'));var attributes=require(_0x9744('0x7'));module[_0x9744('0x8')]=function(_0x17bd44,_0x51c031){return _0x17bd44['define'](_0x9744('0x9'),attributes,{'tableName':_0x9744('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9744('0xb'),'collate':_0x9744('0xc'),'hooks':{'beforeUpdate':function(_0x3d1177,_0xd161b,_0x17d571){if(_0x3d1177[_0x9744('0xd')](_0x9744('0xe'))){_0x3d1177[_0x9744('0xf')]=moment()[_0x9744('0x10')](_0x9744('0x11'));}_0x17d571(null,_0x3d1177);}}});}; \ No newline at end of file +var _0x41d0=['OpenchannelInteraction','utf8mb4','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x41d0,0x1c6));var _0x041d=function(_0x175f79,_0x7fed9){_0x175f79=_0x175f79-0x0;var _0x5005da=_0x41d0[_0x175f79];return _0x5005da;};'use strict';var _=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var logger=require(_0x041d('0x2'))(_0x041d('0x3'));var moment=require('moment');var BPromise=require(_0x041d('0x4'));var rp=require(_0x041d('0x5'));var fs=require('fs');var path=require(_0x041d('0x6'));var rimraf=require(_0x041d('0x7'));var config=require(_0x041d('0x8'));var attributes=require(_0x041d('0x9'));module[_0x041d('0xa')]=function(_0x14907f,_0x196419){return _0x14907f['define'](_0x041d('0xb'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x041d('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0xd7e3b6,_0x965a31,_0x556017){if(_0xd7e3b6['changed']('closed')){_0xd7e3b6[_0x041d('0xd')]=moment()['format'](_0x041d('0xe'));}_0x556017(null,_0xd7e3b6);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index d435a6b..bbdab51 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 _0x8cd6=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','body','options','limit','info','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','debug','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x466af3,_0x4d3ed8){var _0x4ae6f0=function(_0x18d8dd){while(--_0x18d8dd){_0x466af3['push'](_0x466af3['shift']());}};_0x4ae6f0(++_0x4d3ed8);}(_0x8cd6,0x186));var _0x68cd=function(_0x5e9850,_0x291edf){_0x5e9850=_0x5e9850-0x0;var _0x2d3d96=_0x8cd6[_0x5e9850];return _0x2d3d96;};'use strict';var _=require(_0x68cd('0x0'));var util=require('util');var moment=require(_0x68cd('0x1'));var BPromise=require('bluebird');var rs=require(_0x68cd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68cd('0x3'))['db'];var utils=require(_0x68cd('0x4'));var logger=require(_0x68cd('0x5'))(_0x68cd('0x6'));var config=require(_0x68cd('0x7'));var jayson=require(_0x68cd('0x8'));var client=jayson[_0x68cd('0x9')][_0x68cd('0xa')]({'port':0x232a});config[_0x68cd('0xb')]=_['defaults'](config['redis'],{'host':_0x68cd('0xc'),'port':0x18eb});var socket=require(_0x68cd('0xd'))(new Redis(config[_0x68cd('0xb')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x1c2f7a,_0x487054,_0x13ac6d){return new BPromise(function(_0x32690b,_0xfbaf9c){return client[_0x68cd('0xe')](_0x1c2f7a,_0x13ac6d)[_0x68cd('0xf')](function(_0x337dab){logger['info'](_0x68cd('0x10'),_0x487054,_0x68cd('0x11'));logger['debug'](_0x68cd('0x12'),_0x487054,_0x68cd('0x11'),JSON['stringify'](_0x337dab));if(_0x337dab[_0x68cd('0x13')]){if(_0x337dab['error']['code']===0x1f4){logger[_0x68cd('0x13')](_0x68cd('0x10'),_0x487054,_0x337dab[_0x68cd('0x13')]['message']);return _0xfbaf9c(_0x337dab[_0x68cd('0x13')][_0x68cd('0x14')]);}logger[_0x68cd('0x13')](_0x68cd('0x10'),_0x487054,_0x337dab[_0x68cd('0x13')]['message']);return _0x32690b(_0x337dab[_0x68cd('0x13')]['message']);}else{logger['info'](_0x68cd('0x10'),_0x487054,_0x68cd('0x11'));_0x32690b(_0x337dab[_0x68cd('0x15')][_0x68cd('0x14')]);}})[_0x68cd('0x16')](function(_0x38a25d){logger[_0x68cd('0x13')](_0x68cd('0x10'),_0x487054,_0x38a25d);_0xfbaf9c(_0x38a25d);});});}exports['UpdateOpenchannelInteraction']=function(_0x2857d9){var _0x56ebaa=this;return new Promise(function(_0x267c9d,_0x3bfe5d){return db['OpenchannelInteraction'][_0x68cd('0x17')](_0x2857d9[_0x68cd('0x18')],{'raw':_0x2857d9['options']?_0x2857d9[_0x68cd('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2857d9[_0x68cd('0x19')]?_0x2857d9[_0x68cd('0x19')]['where']||null:null,'attributes':_0x2857d9[_0x68cd('0x19')]?_0x2857d9['options']['attributes']||null:null,'limit':_0x2857d9['options']?_0x2857d9[_0x68cd('0x19')][_0x68cd('0x1a')]||null:null})[_0x68cd('0xf')](function(_0x241745){logger[_0x68cd('0x1b')](_0x68cd('0x1c'),_0x2857d9);logger['debug'](_0x68cd('0x1c'),_0x2857d9,JSON[_0x68cd('0x1d')](_0x241745));_0x267c9d(_0x241745);})[_0x68cd('0x16')](function(_0x4b6d59){logger[_0x68cd('0x13')](_0x68cd('0x1c'),_0x4b6d59['message'],_0x2857d9);_0x3bfe5d(_0x56ebaa[_0x68cd('0x13')](0x1f4,_0x4b6d59['message']));});});};exports[_0x68cd('0x1e')]=function(_0x4e034a){return new Promise(function(_0x36793d,_0xb1ff59){return db['OpenchannelInteraction'][_0x68cd('0x1f')]({'where':_0x4e034a[_0x68cd('0x19')]?_0x4e034a[_0x68cd('0x19')]['where']||null:null})[_0x68cd('0xf')](function(_0x3644d8){if(_0x3644d8){return _0x3644d8['addTags'](_0x4e034a['body'][_0x68cd('0x20')],_[_0x68cd('0x21')](_0x4e034a[_0x68cd('0x18')],[_0x68cd('0x20'),'id'])||{});}})['spread'](function(_0x52522e){logger['info'](_0x68cd('0x22'),_0x4e034a);logger[_0x68cd('0x23')](_0x68cd('0x22'),_0x4e034a,JSON[_0x68cd('0x1d')](_0x52522e));_0x36793d(_0x52522e);})['catch'](function(_0xf7525a){logger[_0x68cd('0x13')](_0x68cd('0x22'),_0xf7525a[_0x68cd('0x14')],_0x4e034a);_0xb1ff59(_this[_0x68cd('0x13')](0x1f4,_0xf7525a[_0x68cd('0x14')]));});});}; \ No newline at end of file +var _0x9010=['register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','raw','options','where','attributes','AddTagsToOpenchannelInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket'];(function(_0x9ace37,_0x4d1159){var _0x23ecc0=function(_0xda11a){while(--_0xda11a){_0x9ace37['push'](_0x9ace37['shift']());}};_0x23ecc0(++_0x4d1159);}(_0x9010,0x1dd));var _0x0901=function(_0xf00f1a,_0x373169){_0xf00f1a=_0xf00f1a-0x0;var _0x2051d7=_0x9010[_0xf00f1a];return _0x2051d7;};'use strict';var _=require(_0x0901('0x0'));var util=require(_0x0901('0x1'));var moment=require(_0x0901('0x2'));var BPromise=require(_0x0901('0x3'));var rs=require(_0x0901('0x4'));var fs=require('fs');var Redis=require(_0x0901('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0901('0x6'))(_0x0901('0x7'));var config=require(_0x0901('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0901('0x9')][_0x0901('0xa')]({'port':0x232a});config[_0x0901('0xb')]=_['defaults'](config[_0x0901('0xb')],{'host':_0x0901('0xc'),'port':0x18eb});var socket=require(_0x0901('0xd'))(new Redis(config['redis']));require(_0x0901('0xe'))[_0x0901('0xf')](socket);function respondWithRpcPromise(_0x45ab44,_0x253529,_0x12226c){return new BPromise(function(_0x373443,_0x17bfb7){return client[_0x0901('0x10')](_0x45ab44,_0x12226c)[_0x0901('0x11')](function(_0x3d3609){logger[_0x0901('0x12')](_0x0901('0x13'),_0x253529,'request\x20sent');logger[_0x0901('0x14')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x253529,_0x0901('0x15'),JSON[_0x0901('0x16')](_0x3d3609));if(_0x3d3609[_0x0901('0x17')]){if(_0x3d3609[_0x0901('0x17')][_0x0901('0x18')]===0x1f4){logger['error'](_0x0901('0x13'),_0x253529,_0x3d3609[_0x0901('0x17')][_0x0901('0x19')]);return _0x17bfb7(_0x3d3609[_0x0901('0x17')][_0x0901('0x19')]);}logger[_0x0901('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x253529,_0x3d3609[_0x0901('0x17')][_0x0901('0x19')]);return _0x373443(_0x3d3609[_0x0901('0x17')]['message']);}else{logger[_0x0901('0x12')](_0x0901('0x13'),_0x253529,'request\x20sent');_0x373443(_0x3d3609[_0x0901('0x1a')][_0x0901('0x19')]);}})[_0x0901('0x1b')](function(_0x1aa4e4){logger['error'](_0x0901('0x13'),_0x253529,_0x1aa4e4);_0x17bfb7(_0x1aa4e4);});});}exports[_0x0901('0x1c')]=function(_0x2f0502){var _0x166f8c=this;return new Promise(function(_0x40b449,_0x28425f){return db[_0x0901('0x1d')][_0x0901('0x1e')](_0x2f0502[_0x0901('0x1f')],{'raw':_0x2f0502['options']?_0x2f0502['options'][_0x0901('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f0502[_0x0901('0x21')]?_0x2f0502[_0x0901('0x21')][_0x0901('0x22')]||null:null,'attributes':_0x2f0502[_0x0901('0x21')]?_0x2f0502[_0x0901('0x21')][_0x0901('0x23')]||null:null,'limit':_0x2f0502['options']?_0x2f0502[_0x0901('0x21')]['limit']||null:null})[_0x0901('0x11')](function(_0x2852c7){logger[_0x0901('0x12')](_0x0901('0x1c'),_0x2f0502);logger[_0x0901('0x14')](_0x0901('0x1c'),_0x2f0502,JSON['stringify'](_0x2852c7));_0x40b449(_0x2852c7);})['catch'](function(_0x104d65){logger[_0x0901('0x17')](_0x0901('0x1c'),_0x104d65[_0x0901('0x19')],_0x2f0502);_0x28425f(_0x166f8c[_0x0901('0x17')](0x1f4,_0x104d65['message']));});});};exports[_0x0901('0x24')]=function(_0x29761d){return new Promise(function(_0x4d801c,_0x1acea4){return db['OpenchannelInteraction']['find']({'where':_0x29761d['options']?_0x29761d['options'][_0x0901('0x22')]||null:null})[_0x0901('0x11')](function(_0x1607f2){if(_0x1607f2){return _0x1607f2[_0x0901('0x25')](_0x29761d['body']['ids'],_['omit'](_0x29761d[_0x0901('0x1f')],[_0x0901('0x26'),'id'])||{});}})[_0x0901('0x27')](function(_0x275004){logger['info'](_0x0901('0x28'),_0x29761d);logger['debug']('AddTags',_0x29761d,JSON[_0x0901('0x16')](_0x275004));_0x4d801c(_0x275004);})['catch'](function(_0xcbef9){logger[_0x0901('0x17')](_0x0901('0x28'),_0xcbef9[_0x0901('0x19')],_0x29761d);_0x1acea4(_this['error'](0x1f4,_0xcbef9[_0x0901('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index e3f8a30..4063d8c 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 _0xc6c8=['save','update','emit','removeListener','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x3c50ca,_0x540b1a){var _0x58685e=function(_0x33fb52){while(--_0x33fb52){_0x3c50ca['push'](_0x3c50ca['shift']());}};_0x58685e(++_0x540b1a);}(_0xc6c8,0x1aa));var _0x8c6c=function(_0x3d16f0,_0x3272b1){_0x3d16f0=_0x3d16f0-0x0;var _0x3cf21b=_0xc6c8[_0x3d16f0];return _0x3cf21b;};'use strict';var OpenchannelInteractionEvents=require(_0x8c6c('0x0'));var events=[_0x8c6c('0x1'),'remove',_0x8c6c('0x2')];function createListener(_0x2ba533,_0x238d04){return function(_0xd5b154){_0x238d04[_0x8c6c('0x3')](_0x2ba533,_0xd5b154);};}function removeListener(_0x7d98ff,_0x250927){return function(){OpenchannelInteractionEvents[_0x8c6c('0x4')](_0x7d98ff,_0x250927);};}exports['register']=function(_0x1955f3){for(var _0x397c7e=0x0,_0x2da388=events[_0x8c6c('0x5')];_0x397c7e<_0x2da388;_0x397c7e++){var _0x2fbf5b=events[_0x397c7e];var _0x39c127=createListener(_0x8c6c('0x6')+_0x2fbf5b,_0x1955f3);OpenchannelInteractionEvents['on'](_0x2fbf5b,_0x39c127);}}; \ No newline at end of file +var _0x3f4f=['openchannelInteraction:','./openchannelInteraction.events','update','emit','register','length'];(function(_0xcfe86e,_0x369338){var _0x244a5a=function(_0x479312){while(--_0x479312){_0xcfe86e['push'](_0xcfe86e['shift']());}};_0x244a5a(++_0x369338);}(_0x3f4f,0x139));var _0xf3f4=function(_0x39700a,_0x127c4e){_0x39700a=_0x39700a-0x0;var _0x30310f=_0x3f4f[_0x39700a];return _0x30310f;};'use strict';var OpenchannelInteractionEvents=require(_0xf3f4('0x0'));var events=['save','remove',_0xf3f4('0x1')];function createListener(_0x3e5637,_0x104932){return function(_0x4ba2ff){_0x104932[_0xf3f4('0x2')](_0x3e5637,_0x4ba2ff);};}function removeListener(_0x4bbdef,_0x5ed10e){return function(){OpenchannelInteractionEvents['removeListener'](_0x4bbdef,_0x5ed10e);};}exports[_0xf3f4('0x3')]=function(_0x2b55ba){for(var _0xa96d48=0x0,_0x563b97=events[_0xf3f4('0x4')];_0xa96d48<_0x563b97;_0xa96d48++){var _0x4e7b50=events[_0xa96d48];var _0x96ca4d=createListener(_0xf3f4('0x5')+_0x4e7b50,_0x2b55ba);OpenchannelInteractionEvents['on'](_0x4e7b50,_0x96ca4d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 1d386ea..31a4aab 100644 --- a/server/api/openchannelMessage/index.js +++ b/server/api/openchannelMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x70e0,0x17b));var _0x070e=function(_0x1f7073,_0x3bb338){_0x1f7073=_0x1f7073-0x0;var _0x3edccf=_0x70e0[_0x1f7073];return _0x3edccf;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x43b681,_0xd40e73){var _0x41ffa0=function(_0x32d350){while(--_0x32d350){_0x43b681['push'](_0x43b681['shift']());}};_0x41ffa0(++_0xd40e73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 74b17bc..b305b3f 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 _0x3495=['TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize','exports'];(function(_0x320d18,_0x7a06d9){var _0x18166f=function(_0x15c016){while(--_0x15c016){_0x320d18['push'](_0x320d18['shift']());}};_0x18166f(++_0x7a06d9);}(_0x3495,0x1de));var _0x5349=function(_0x2824b4,_0x2efdb4){_0x2824b4=_0x2824b4-0x0;var _0x9669c8=_0x3495[_0x2824b4];return _0x9669c8;};'use strict';var Sequelize=require(_0x5349('0x0'));module[_0x5349('0x1')]={'body':{'type':Sequelize[_0x5349('0x2')](_0x5349('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5349('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5349('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5349('0x5')]('in',_0x5349('0x6')),'defaultValue':_0x5349('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x5349('0x7')]},'providerResponse':{'type':Sequelize[_0x5349('0x2')]}}; \ No newline at end of file +var _0x8f4c=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3c5ceb,_0xafb909){var _0x5e6d75=function(_0x36f05e){while(--_0x36f05e){_0x3c5ceb['push'](_0x3c5ceb['shift']());}};_0x5e6d75(++_0xafb909);}(_0x8f4c,0x113));var _0xc8f4=function(_0x577a2e,_0x3816f0){_0x577a2e=_0x577a2e-0x0;var _0x3ac138=_0x8f4c[_0x577a2e];return _0x3ac138;};'use strict';var Sequelize=require(_0xc8f4('0x0'));module[_0xc8f4('0x1')]={'body':{'type':Sequelize[_0xc8f4('0x2')](_0xc8f4('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xc8f4('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc8f4('0x5')),'defaultValue':_0xc8f4('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xc8f4('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc8f4('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index dd17c55..18d2427 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 _0x7a3e=['squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','client','http','request','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','destroy','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','EventManager','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','ejs','fs-extra','lodash'];(function(_0x35466b,_0x41c842){var _0x35a9bf=function(_0x3f7777){while(--_0x3f7777){_0x35466b['push'](_0x35466b['shift']());}};_0x35a9bf(++_0x41c842);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x618e4e,_0x1193eb){_0x618e4e=_0x618e4e-0x0;var _0x25affc=_0x7a3e[_0x618e4e];return _0x25affc;};'use strict';var emlformat=require(_0xe7a3('0x0'));var rimraf=require(_0xe7a3('0x1'));var zipdir=require(_0xe7a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7a3('0x3'));var moment=require(_0xe7a3('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe7a3('0x5'));var path=require(_0xe7a3('0x6'));var sox=require(_0xe7a3('0x7'));var csv=require('to-csv');var ejs=require(_0xe7a3('0x8'));var fs=require('fs');var fs_extra=require(_0xe7a3('0x9'));var _=require(_0xe7a3('0xa'));var squel=require(_0xe7a3('0xb'));var crypto=require(_0xe7a3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe7a3('0xd'));var toCsv=require(_0xe7a3('0xe'));var querystring=require(_0xe7a3('0xf'));var Papa=require(_0xe7a3('0x10'));var Redis=require('ioredis');var authService=require(_0xe7a3('0x11'));var qs=require(_0xe7a3('0x12'));var as=require(_0xe7a3('0x13'));var hardwareService=require(_0xe7a3('0x14'));var logger=require(_0xe7a3('0x15'))(_0xe7a3('0x16'));var utils=require(_0xe7a3('0x17'));var config=require(_0xe7a3('0x18'));var licenseUtil=require(_0xe7a3('0x19'));var db=require(_0xe7a3('0x1a'))['db'];config[_0xe7a3('0x1b')]=_[_0xe7a3('0x1c')](config['redis'],{'host':_0xe7a3('0x1d'),'port':0x18eb});var socket=require(_0xe7a3('0x1e'))(new Redis(config[_0xe7a3('0x1b')]));require(_0xe7a3('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xe7a3('0x20')][_0xe7a3('0x21')]({'port':0x232c});var client9002=jayson[_0xe7a3('0x20')][_0xe7a3('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xb53629,_0x2c8d77,_0x3da8ba,_0x6e2615){return new BPromise(function(_0x4b3bd3,_0xd87bab){var _0x57060a=_0x6e2615||client;return _0x57060a[_0xe7a3('0x22')](_0xb53629,_0x3da8ba)['then'](function(_0x568a6c){logger[_0xe7a3('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x2c8d77,_0xe7a3('0x24'));logger[_0xe7a3('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2c8d77,_0xe7a3('0x24'),JSON[_0xe7a3('0x26')](_0x568a6c));if(_0x568a6c[_0xe7a3('0x27')]){if(_0x568a6c['error'][_0xe7a3('0x28')]===0x1f4){logger[_0xe7a3('0x27')](_0xe7a3('0x29'),_0x2c8d77,_0x568a6c['error'][_0xe7a3('0x2a')]);return _0xd87bab(_0x568a6c['error'][_0xe7a3('0x2a')]);}logger[_0xe7a3('0x27')](_0xe7a3('0x29'),_0x2c8d77,_0x568a6c[_0xe7a3('0x27')][_0xe7a3('0x2a')]);return _0x4b3bd3(_0x568a6c[_0xe7a3('0x27')][_0xe7a3('0x2a')]);}else{logger[_0xe7a3('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x2c8d77,_0xe7a3('0x24'));_0x4b3bd3(_0x568a6c[_0xe7a3('0x2b')][_0xe7a3('0x2a')]);}})['catch'](function(_0x1afeaf){logger[_0xe7a3('0x27')](_0xe7a3('0x29'),_0x2c8d77,_0x1afeaf);_0xd87bab(_0x1afeaf);});});}function respondWithStatusCode(_0x3252a8,_0x31e27c){_0x31e27c=_0x31e27c||0xcc;return function(_0x58e43b){if(_0x58e43b){return _0x3252a8[_0xe7a3('0x2c')](_0x31e27c);}return _0x3252a8[_0xe7a3('0x2d')](_0x31e27c)['end']();};}function respondWithResult(_0x42d035,_0x59ab12){_0x59ab12=_0x59ab12||0xc8;return function(_0x294593){if(_0x294593){return _0x42d035[_0xe7a3('0x2d')](_0x59ab12)[_0xe7a3('0x2e')](_0x294593);}};}function respondWithFilteredResult(_0xf952e5,_0x54cfbc){return function(_0x385b38){if(_0x385b38){var _0x36fa2e=typeof _0x54cfbc[_0xe7a3('0x2f')]===_0xe7a3('0x30')&&typeof _0x54cfbc[_0xe7a3('0x31')]===_0xe7a3('0x30');var _0x753914=_0x385b38[_0xe7a3('0x32')];var _0x3fe1c2=_0x36fa2e?0x0:_0x54cfbc[_0xe7a3('0x2f')];var _0x37f51d=_0x36fa2e?_0x385b38[_0xe7a3('0x32')]:_0x54cfbc['offset']+_0x54cfbc[_0xe7a3('0x31')];var _0x444618;if(_0x37f51d>=_0x753914){_0x37f51d=_0x753914;_0x444618=0xc8;}else{_0x444618=0xce;}_0xf952e5['status'](_0x444618);return _0xf952e5[_0xe7a3('0x33')]('Content-Range',_0x3fe1c2+'-'+_0x37f51d+'/'+_0x753914)['json'](_0x385b38);}return null;};}function patchUpdates(_0x567f44){return function(_0x1a40e0){try{jsonpatch[_0xe7a3('0x34')](_0x1a40e0,_0x567f44,!![]);}catch(_0x46d4f2){return BPromise[_0xe7a3('0x35')](_0x46d4f2);}return _0x1a40e0['save']();};}function saveUpdates(_0x2fcb02,_0x3aff03){return function(_0xbfeea6){if(_0xbfeea6){return _0xbfeea6[_0xe7a3('0x36')](_0x2fcb02)['then'](function(_0x4583ae){return _0x4583ae;});}return null;};}function removeEntity(_0x401702,_0x2133c5){return function(_0x3c01f1){if(_0x3c01f1){return _0x3c01f1['destroy']()[_0xe7a3('0x37')](function(){_0x401702[_0xe7a3('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xef827f,_0x335c58){return function(_0x2d0b99){if(!_0x2d0b99){_0xef827f[_0xe7a3('0x2c')](0x194);}return _0x2d0b99;};}function handleError(_0x1df65f,_0x16781e){_0x16781e=_0x16781e||0x1f4;return function(_0x422bdb){logger[_0xe7a3('0x27')](_0x422bdb[_0xe7a3('0x38')]);if(_0x422bdb['name']){delete _0x422bdb[_0xe7a3('0x39')];}_0x1df65f[_0xe7a3('0x2d')](_0x16781e)[_0xe7a3('0x3a')](_0x422bdb);};}exports[_0xe7a3('0x3b')]=function(_0x5b89c0,_0x4659da){var _0x64c50={},_0x32d34f={},_0x5e3085={'count':0x0,'rows':[]};var _0x499d52=_[_0xe7a3('0x3c')](db[_0xe7a3('0x3d')][_0xe7a3('0x3e')],function(_0x136696){return{'name':_0x136696[_0xe7a3('0x3f')],'type':_0x136696[_0xe7a3('0x40')][_0xe7a3('0x41')]};});_0x32d34f[_0xe7a3('0x42')]=_[_0xe7a3('0x3c')](_0x499d52,'name');_0x32d34f[_0xe7a3('0x43')]=_[_0xe7a3('0x44')](_0x5b89c0['query']);_0x32d34f[_0xe7a3('0x45')]=_[_0xe7a3('0x46')](_0x32d34f[_0xe7a3('0x42')],_0x32d34f[_0xe7a3('0x43')]);_0x64c50['attributes']=_[_0xe7a3('0x46')](_0x32d34f[_0xe7a3('0x42')],qs[_0xe7a3('0x47')](_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x47')]));_0x64c50[_0xe7a3('0x48')]=_0x64c50[_0xe7a3('0x48')]['length']?_0x64c50[_0xe7a3('0x48')]:_0x32d34f['model'];if(!_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x49')](_0xe7a3('0x4a'))){_0x64c50[_0xe7a3('0x31')]=qs[_0xe7a3('0x31')](_0x5b89c0[_0xe7a3('0x43')]['limit']);_0x64c50[_0xe7a3('0x2f')]=qs['offset'](_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x2f')]);}_0x64c50[_0xe7a3('0x4b')]=qs['sort'](_0x5b89c0[_0xe7a3('0x43')]['sort']);_0x64c50['where']=qs['filters'](_[_0xe7a3('0x4c')](_0x5b89c0[_0xe7a3('0x43')],_0x32d34f[_0xe7a3('0x45')]),_0x499d52);if(_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x4d')]){_0x64c50[_0xe7a3('0x4e')]=_[_0xe7a3('0x4f')](_0x64c50[_0xe7a3('0x4e')],{'$or':_['map'](_0x499d52,function(_0x75caa9){if(_0x75caa9[_0xe7a3('0x40')]!==_0xe7a3('0x50')){var _0x4d6471={};_0x4d6471[_0x75caa9[_0xe7a3('0x39')]]={'$like':'%'+_0x5b89c0[_0xe7a3('0x43')][_0xe7a3('0x4d')]+'%'};return _0x4d6471;}})});}_0x64c50=_[_0xe7a3('0x4f')]({},_0x64c50,_0x5b89c0[_0xe7a3('0x51')]);var _0x114705={'where':_0x64c50[_0xe7a3('0x4e')]};return db['OpenchannelMessage']['count'](_0x114705)[_0xe7a3('0x37')](function(_0x3e5e0e){_0x5e3085[_0xe7a3('0x32')]=_0x3e5e0e;if(_0x5b89c0['query'][_0xe7a3('0x52')]){_0x64c50['include']=[{'all':!![]}];}return db[_0xe7a3('0x3d')][_0xe7a3('0x53')](_0x64c50);})[_0xe7a3('0x37')](function(_0x572ae7){_0x5e3085[_0xe7a3('0x54')]=_0x572ae7;return _0x5e3085;})[_0xe7a3('0x37')](respondWithFilteredResult(_0x4659da,_0x64c50))[_0xe7a3('0x55')](handleError(_0x4659da,null));};exports[_0xe7a3('0x56')]=function(_0x4d170c,_0x22636e){var _0x4536cd={'raw':!![],'where':{'id':_0x4d170c[_0xe7a3('0x57')]['id']}},_0x1429a3={};_0x1429a3[_0xe7a3('0x42')]=_['keys'](db[_0xe7a3('0x3d')][_0xe7a3('0x3e')]);_0x1429a3[_0xe7a3('0x43')]=_[_0xe7a3('0x44')](_0x4d170c[_0xe7a3('0x43')]);_0x1429a3[_0xe7a3('0x45')]=_[_0xe7a3('0x46')](_0x1429a3['model'],_0x1429a3[_0xe7a3('0x43')]);_0x4536cd[_0xe7a3('0x48')]=_['intersection'](_0x1429a3[_0xe7a3('0x42')],qs['fields'](_0x4d170c[_0xe7a3('0x43')][_0xe7a3('0x47')]));_0x4536cd['attributes']=_0x4536cd[_0xe7a3('0x48')][_0xe7a3('0x58')]?_0x4536cd[_0xe7a3('0x48')]:_0x1429a3[_0xe7a3('0x42')];if(_0x4d170c[_0xe7a3('0x43')]['includeAll']){_0x4536cd[_0xe7a3('0x59')]=[{'all':!![]}];}_0x4536cd=_[_0xe7a3('0x4f')]({},_0x4536cd,_0x4d170c['options']);return db[_0xe7a3('0x3d')][_0xe7a3('0x5a')](_0x4536cd)[_0xe7a3('0x37')](handleEntityNotFound(_0x22636e,null))[_0xe7a3('0x37')](respondWithResult(_0x22636e,null))[_0xe7a3('0x55')](handleError(_0x22636e,null));};exports[_0xe7a3('0x5b')]=function(_0x356d98,_0x3ea24b){return db[_0xe7a3('0x3d')]['create'](_0x356d98[_0xe7a3('0x5c')],{})['then'](respondWithResult(_0x3ea24b,0xc9))[_0xe7a3('0x55')](handleError(_0x3ea24b,null));};exports[_0xe7a3('0x36')]=function(_0x211a74,_0x11845c){if(_0x211a74[_0xe7a3('0x5c')]['id']){delete _0x211a74[_0xe7a3('0x5c')]['id'];}return db[_0xe7a3('0x3d')][_0xe7a3('0x5a')]({'where':{'id':_0x211a74[_0xe7a3('0x57')]['id']}})['then'](handleEntityNotFound(_0x11845c,null))[_0xe7a3('0x37')](saveUpdates(_0x211a74[_0xe7a3('0x5c')],null))[_0xe7a3('0x37')](respondWithResult(_0x11845c,null))[_0xe7a3('0x55')](handleError(_0x11845c,null));};exports[_0xe7a3('0x5d')]=function(_0x4d5618,_0x3d9157){return db[_0xe7a3('0x3d')]['find']({'where':{'id':_0x4d5618[_0xe7a3('0x57')]['id']}})['then'](handleEntityNotFound(_0x3d9157,null))[_0xe7a3('0x37')](removeEntity(_0x3d9157,null))['catch'](handleError(_0x3d9157,null));};exports[_0xe7a3('0x5e')]=function(_0x10c9c6,_0x5063dd){return db[_0xe7a3('0x3d')]['describe']()[_0xe7a3('0x37')](respondWithResult(_0x5063dd,null))[_0xe7a3('0x55')](handleError(_0x5063dd,null));};var interaction_log=require('../../config/logger')(_0xe7a3('0x5f'));exports[_0xe7a3('0x60')]=function(_0x17db38,_0x27edf2,_0x37bcb4){var _0x132633={'agent':{},'channel':_0xe7a3('0x61')};if(_0x17db38[_0xe7a3('0x5c')]['id']){delete _0x17db38[_0xe7a3('0x5c')]['id'];}_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x62')]=!![];_0x17db38[_0xe7a3('0x5c')]['readAt']=moment()[_0xe7a3('0x63')](_0xe7a3('0x64'));_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x65')]=_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x65')]||_0x17db38['user']['id'];_0x132633[_0xe7a3('0x66')]['id']=_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x65')];return db[_0xe7a3('0x3d')]['find']({'where':{'id':_0x17db38[_0xe7a3('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27edf2,null))['then'](saveUpdates(_0x17db38[_0xe7a3('0x5c')],null))['then'](function(_0x5a865c){if(_0x5a865c){_0x132633[_0xe7a3('0x2a')]=_0x5a865c[_0xe7a3('0x67')]({'plain':!![]});return db[_0xe7a3('0x68')][_0xe7a3('0x5a')]({'where':{'id':_0x5a865c[_0xe7a3('0x69')]}});}return null;})[_0xe7a3('0x37')](handleEntityNotFound(_0x27edf2,null))[_0xe7a3('0x37')](function(_0x259744){if(_0x259744){return _0x259744[_0xe7a3('0x36')]({'UserId':_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x65')],'read1stAt':_[_0xe7a3('0x6a')](_0x259744[_0xe7a3('0x6b')])?moment()[_0xe7a3('0x63')](_0xe7a3('0x64')):undefined});}return null;})[_0xe7a3('0x37')](function(_0x673c11){if(_0x673c11){_0x132633['interaction']=_0x673c11[_0xe7a3('0x67')]({'plain':!![]});interaction_log[_0xe7a3('0x23')](_0xe7a3('0x6c'),_0x17db38[_0xe7a3('0x6d')]['id'],_0x17db38[_0xe7a3('0x6d')]['name'],_0x17db38[_0xe7a3('0x6d')][_0xe7a3('0x6e')],_0x132633[_0xe7a3('0x6f')]['id'],_0x17db38[_0xe7a3('0x5c')]?JSON['stringify'](_0x17db38[_0xe7a3('0x5c')]):'null');return respondWithRpcPromise(_0xe7a3('0x70'),_0xe7a3('0x71'),_0x132633);}return null;})[_0xe7a3('0x37')](function(_0x168376){var _0x3809d1=_0xe7a3('0x72')+_0x168376[_0xe7a3('0x2a')][_0xe7a3('0x73')];return db[_0xe7a3('0x74')]['query'](_0x3809d1,{'type':db[_0xe7a3('0x75')][_0xe7a3('0x76')]['SELECT'],'raw':!![]})['then'](function(_0x200b62){return _0x200b62;});})[_0xe7a3('0x37')](function(_0x14cbee){if(_0x14cbee){_0x132633[_0xe7a3('0x2a')][_0xe7a3('0x77')]=_0x14cbee[0x0];if(!_0x17db38['body'][_0xe7a3('0x65')])return;return db[_0xe7a3('0x78')][_0xe7a3('0x5a')]({'where':{'id':_0x17db38['body'][_0xe7a3('0x65')],'role':_0xe7a3('0x66')},'attributes':['id',_0xe7a3('0x39'),_0xe7a3('0x79'),_0xe7a3('0x7a'),_0xe7a3('0x7b')],'raw':!![]});}return null;})[_0xe7a3('0x37')](function(_0x515d02){if(!_0x515d02)return null;_0x132633[_0xe7a3('0x2a')][_0xe7a3('0x66')]=_0x515d02;return _0x132633;})[_0xe7a3('0x37')](function(_0x1df2e3){if(_0x1df2e3){if(_0x17db38[_0xe7a3('0x5c')][_0xe7a3('0x7c')]){_0x132633[_0xe7a3('0x2a')][_0xe7a3('0x7d')]=util[_0xe7a3('0x63')](_0xe7a3('0x7e'),_0x17db38['user'][_0xe7a3('0x39')]);_0x132633['message'][_0xe7a3('0x7f')]=_0x132633[_0xe7a3('0x7f')];_0x132633[_0xe7a3('0x2a')][_0xe7a3('0x80')]=_0x132633[_0xe7a3('0x7f')];_0x132633[_0xe7a3('0x2a')]['event']=_0xe7a3('0x60');return respondWithRpcPromise('EventManager','EventManager',{'event':_0xe7a3('0x81'),'message':_0x132633[_0xe7a3('0x2a')]},client9002)['then'](function(){return _0x132633;});}return _0x132633;}return null;})['then'](respondWithResult(_0x27edf2,null))[_0xe7a3('0x55')](handleError(_0x27edf2,null));};var interaction_log=require(_0xe7a3('0x15'))(_0xe7a3('0x5f'));exports[_0xe7a3('0x35')]=function(_0x3121d6,_0x27583a,_0x440cb1){var _0x111f86={'agent':{},'channel':_0xe7a3('0x61')};if(_0x3121d6['body']['id']){delete _0x3121d6['body']['id'];}_0x3121d6[_0xe7a3('0x5c')][_0xe7a3('0x65')]=_0x3121d6[_0xe7a3('0x5c')]['UserId']||_0x3121d6[_0xe7a3('0x6d')]['id'];_0x111f86[_0xe7a3('0x66')]['id']=_0x3121d6[_0xe7a3('0x5c')][_0xe7a3('0x65')];return db[_0xe7a3('0x3d')][_0xe7a3('0x5a')]({'where':{'id':_0x3121d6[_0xe7a3('0x57')]['id'],'UserId':null}})[_0xe7a3('0x37')](handleEntityNotFound(_0x27583a,null))[_0xe7a3('0x37')](function(_0x4288b7){if(_0x4288b7){_0x111f86[_0xe7a3('0x2a')]=_0x4288b7[_0xe7a3('0x67')]({'plain':!![]});return db[_0xe7a3('0x68')][_0xe7a3('0x5a')]({'where':{'id':_0x4288b7[_0xe7a3('0x69')]}});}return null;})[_0xe7a3('0x37')](handleEntityNotFound(_0x27583a,null))['then'](function(_0x4a03f8){if(_0x4a03f8){_0x111f86[_0xe7a3('0x6f')]=_0x4a03f8[_0xe7a3('0x67')]({'plain':!![]});interaction_log[_0xe7a3('0x23')](_0xe7a3('0x82'),_0x3121d6['user']['id'],_0x3121d6['user'][_0xe7a3('0x39')],_0x3121d6[_0xe7a3('0x6d')]['role'],_0x111f86['interaction']['id'],_0x3121d6[_0xe7a3('0x5c')]?JSON[_0xe7a3('0x26')](_0x3121d6[_0xe7a3('0x5c')]):'null');return respondWithRpcPromise(_0xe7a3('0x83'),_0xe7a3('0x84'),_0x111f86);}return null;})[_0xe7a3('0x37')](function(_0x18dc64){var _0x2d622e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x18dc64['message'][_0xe7a3('0x73')];return db['sequelize'][_0xe7a3('0x43')](_0x2d622e,{'type':db[_0xe7a3('0x75')][_0xe7a3('0x76')]['SELECT'],'raw':!![]})[_0xe7a3('0x37')](function(_0x19f01e){return _0x19f01e;});})[_0xe7a3('0x37')](function(_0x8c1331){if(_0x8c1331){_0x111f86['message'][_0xe7a3('0x77')]=_0x8c1331[0x0];if(!_0x3121d6['body']['UserId'])return;return db['User']['find']({'where':{'id':_0x3121d6[_0xe7a3('0x5c')][_0xe7a3('0x65')],'role':_0xe7a3('0x66')},'attributes':['id','name',_0xe7a3('0x79'),'email',_0xe7a3('0x7b')],'raw':!![]});}return null;})[_0xe7a3('0x37')](function(_0x33130b){if(!_0x33130b)return null;_0x111f86[_0xe7a3('0x2a')][_0xe7a3('0x66')]=_0x33130b;return _0x111f86;})['then'](function(_0x2b752c){if(_0x2b752c){_0x2b752c['message'][_0xe7a3('0x7d')]=util[_0xe7a3('0x63')]('SIP/%s',_0x3121d6[_0xe7a3('0x6d')][_0xe7a3('0x39')]);_0x2b752c[_0xe7a3('0x2a')][_0xe7a3('0x7f')]=_0x111f86['channel'];_0x2b752c[_0xe7a3('0x2a')][_0xe7a3('0x80')]=_0x111f86[_0xe7a3('0x7f')];_0x2b752c[_0xe7a3('0x2a')][_0xe7a3('0x85')]=_0xe7a3('0x35');respondWithRpcPromise(_0xe7a3('0x86'),_0xe7a3('0x86'),{'event':'rejectmessage','message':_0x2b752c[_0xe7a3('0x2a')]},client9002);return _0x111f86;}return null;})[_0xe7a3('0x37')](respondWithResult(_0x27583a,null))[_0xe7a3('0x55')](handleError(_0x27583a,null));}; \ No newline at end of file +var _0x6c2c=['EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','contact','User','SIP/%s','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','model','keys','intersection','query','attributes','fields','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','OpenchannelMessage','rawAttributes','length','create','body','find','describe','openchannel-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','OpenchannelInteraction','OpenchannelInteractionId','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','fullname','email','internal','manual','interface','channel','motionChannel'];(function(_0x527220,_0x29484a){var _0x2b3efb=function(_0x1e6972){while(--_0x1e6972){_0x527220['push'](_0x527220['shift']());}};_0x2b3efb(++_0x29484a);}(_0x6c2c,0x8e));var _0xc6c2=function(_0x2ad37,_0x1a781f){_0x2ad37=_0x2ad37-0x0;var _0x2a9b14=_0x6c2c[_0x2ad37];return _0x2a9b14;};'use strict';var emlformat=require(_0xc6c2('0x0'));var rimraf=require(_0xc6c2('0x1'));var zipdir=require(_0xc6c2('0x2'));var jsonpatch=require(_0xc6c2('0x3'));var rp=require(_0xc6c2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6c2('0x5'));var util=require(_0xc6c2('0x6'));var path=require(_0xc6c2('0x7'));var sox=require(_0xc6c2('0x8'));var csv=require(_0xc6c2('0x9'));var ejs=require(_0xc6c2('0xa'));var fs=require('fs');var fs_extra=require(_0xc6c2('0xb'));var _=require('lodash');var squel=require(_0xc6c2('0xc'));var crypto=require(_0xc6c2('0xd'));var jsforce=require(_0xc6c2('0xe'));var deskjs=require(_0xc6c2('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc6c2('0x10'));var Papa=require(_0xc6c2('0x11'));var Redis=require(_0xc6c2('0x12'));var authService=require(_0xc6c2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc6c2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc6c2('0x15'))('api');var utils=require(_0xc6c2('0x16'));var config=require(_0xc6c2('0x17'));var licenseUtil=require(_0xc6c2('0x18'));var db=require(_0xc6c2('0x19'))['db'];config[_0xc6c2('0x1a')]=_['defaults'](config[_0xc6c2('0x1a')],{'host':_0xc6c2('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc6c2('0x1a')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0xc6c2('0x1c'));var client=jayson[_0xc6c2('0x1d')][_0xc6c2('0x1e')]({'port':0x232c});var client9002=jayson[_0xc6c2('0x1d')][_0xc6c2('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x16ed10,_0x513adc,_0x56988b,_0x4875c7){return new BPromise(function(_0x39db89,_0x35f767){var _0xa392d4=_0x4875c7||client;return _0xa392d4['request'](_0x16ed10,_0x56988b)[_0xc6c2('0x1f')](function(_0x2e55e3){logger[_0xc6c2('0x20')](_0xc6c2('0x21'),_0x513adc,_0xc6c2('0x22'));logger['debug'](_0xc6c2('0x23'),_0x513adc,_0xc6c2('0x22'),JSON['stringify'](_0x2e55e3));if(_0x2e55e3['error']){if(_0x2e55e3['error'][_0xc6c2('0x24')]===0x1f4){logger[_0xc6c2('0x25')](_0xc6c2('0x21'),_0x513adc,_0x2e55e3['error'][_0xc6c2('0x26')]);return _0x35f767(_0x2e55e3['error'][_0xc6c2('0x26')]);}logger[_0xc6c2('0x25')](_0xc6c2('0x21'),_0x513adc,_0x2e55e3[_0xc6c2('0x25')][_0xc6c2('0x26')]);return _0x39db89(_0x2e55e3['error'][_0xc6c2('0x26')]);}else{logger[_0xc6c2('0x20')](_0xc6c2('0x21'),_0x513adc,_0xc6c2('0x22'));_0x39db89(_0x2e55e3[_0xc6c2('0x27')]['message']);}})[_0xc6c2('0x28')](function(_0x49318d){logger[_0xc6c2('0x25')](_0xc6c2('0x21'),_0x513adc,_0x49318d);_0x35f767(_0x49318d);});});}function respondWithStatusCode(_0x5e7628,_0x13cf0f){_0x13cf0f=_0x13cf0f||0xcc;return function(_0xb313d8){if(_0xb313d8){return _0x5e7628['sendStatus'](_0x13cf0f);}return _0x5e7628[_0xc6c2('0x29')](_0x13cf0f)[_0xc6c2('0x2a')]();};}function respondWithResult(_0x338e87,_0x263b87){_0x263b87=_0x263b87||0xc8;return function(_0x178883){if(_0x178883){return _0x338e87[_0xc6c2('0x29')](_0x263b87)[_0xc6c2('0x2b')](_0x178883);}};}function respondWithFilteredResult(_0x2d5f4e,_0x35ba05){return function(_0x465e58){if(_0x465e58){var _0x4230ea=typeof _0x35ba05['offset']==='undefined'&&typeof _0x35ba05[_0xc6c2('0x2c')]==='undefined';var _0x5345d8=_0x465e58[_0xc6c2('0x2d')];var _0x3ba2c9=_0x4230ea?0x0:_0x35ba05[_0xc6c2('0x2e')];var _0x42881b=_0x4230ea?_0x465e58[_0xc6c2('0x2d')]:_0x35ba05[_0xc6c2('0x2e')]+_0x35ba05['limit'];var _0x82ac97;if(_0x42881b>=_0x5345d8){_0x42881b=_0x5345d8;_0x82ac97=0xc8;}else{_0x82ac97=0xce;}_0x2d5f4e[_0xc6c2('0x29')](_0x82ac97);return _0x2d5f4e[_0xc6c2('0x2f')](_0xc6c2('0x30'),_0x3ba2c9+'-'+_0x42881b+'/'+_0x5345d8)[_0xc6c2('0x2b')](_0x465e58);}return null;};}function patchUpdates(_0x8afe8d){return function(_0xf761d){try{jsonpatch[_0xc6c2('0x31')](_0xf761d,_0x8afe8d,!![]);}catch(_0x104219){return BPromise[_0xc6c2('0x32')](_0x104219);}return _0xf761d[_0xc6c2('0x33')]();};}function saveUpdates(_0xc97707,_0x12c00f){return function(_0x2f33e2){if(_0x2f33e2){return _0x2f33e2[_0xc6c2('0x34')](_0xc97707)[_0xc6c2('0x1f')](function(_0x58547f){return _0x58547f;});}return null;};}function removeEntity(_0x5bfc01,_0xc9bedd){return function(_0x131503){if(_0x131503){return _0x131503[_0xc6c2('0x35')]()['then'](function(){_0x5bfc01[_0xc6c2('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x205ef,_0x3f21d8){return function(_0x475398){if(!_0x475398){_0x205ef['sendStatus'](0x194);}return _0x475398;};}function handleError(_0x951ea6,_0x3b1b9e){_0x3b1b9e=_0x3b1b9e||0x1f4;return function(_0x300a54){logger[_0xc6c2('0x25')](_0x300a54[_0xc6c2('0x36')]);if(_0x300a54['name']){delete _0x300a54[_0xc6c2('0x37')];}_0x951ea6[_0xc6c2('0x29')](_0x3b1b9e)[_0xc6c2('0x38')](_0x300a54);};}exports['index']=function(_0xa16cb1,_0x1d91df){var _0x4b1717={},_0xad3c86={},_0x2ea213={'count':0x0,'rows':[]};var _0xba07e3=_[_0xc6c2('0x39')](db['OpenchannelMessage']['rawAttributes'],function(_0x17de52){return{'name':_0x17de52['fieldName'],'type':_0x17de52['type']['key']};});_0xad3c86[_0xc6c2('0x3a')]=_['map'](_0xba07e3,_0xc6c2('0x37'));_0xad3c86['query']=_[_0xc6c2('0x3b')](_0xa16cb1['query']);_0xad3c86['filters']=_[_0xc6c2('0x3c')](_0xad3c86[_0xc6c2('0x3a')],_0xad3c86[_0xc6c2('0x3d')]);_0x4b1717[_0xc6c2('0x3e')]=_['intersection'](_0xad3c86[_0xc6c2('0x3a')],qs[_0xc6c2('0x3f')](_0xa16cb1[_0xc6c2('0x3d')]['fields']));_0x4b1717[_0xc6c2('0x3e')]=_0x4b1717[_0xc6c2('0x3e')]['length']?_0x4b1717[_0xc6c2('0x3e')]:_0xad3c86[_0xc6c2('0x3a')];if(!_0xa16cb1[_0xc6c2('0x3d')][_0xc6c2('0x40')]('nolimit')){_0x4b1717[_0xc6c2('0x2c')]=qs[_0xc6c2('0x2c')](_0xa16cb1[_0xc6c2('0x3d')][_0xc6c2('0x2c')]);_0x4b1717[_0xc6c2('0x2e')]=qs[_0xc6c2('0x2e')](_0xa16cb1[_0xc6c2('0x3d')][_0xc6c2('0x2e')]);}_0x4b1717['order']=qs[_0xc6c2('0x41')](_0xa16cb1[_0xc6c2('0x3d')]['sort']);_0x4b1717[_0xc6c2('0x42')]=qs[_0xc6c2('0x43')](_['pick'](_0xa16cb1[_0xc6c2('0x3d')],_0xad3c86[_0xc6c2('0x43')]),_0xba07e3);if(_0xa16cb1[_0xc6c2('0x3d')][_0xc6c2('0x44')]){_0x4b1717[_0xc6c2('0x42')]=_[_0xc6c2('0x45')](_0x4b1717['where'],{'$or':_[_0xc6c2('0x39')](_0xba07e3,function(_0xc52555){if(_0xc52555['type']!==_0xc6c2('0x46')){var _0x12b329={};_0x12b329[_0xc52555[_0xc6c2('0x37')]]={'$like':'%'+_0xa16cb1['query'][_0xc6c2('0x44')]+'%'};return _0x12b329;}})});}_0x4b1717=_[_0xc6c2('0x45')]({},_0x4b1717,_0xa16cb1[_0xc6c2('0x47')]);var _0x409a62={'where':_0x4b1717['where']};return db['OpenchannelMessage'][_0xc6c2('0x2d')](_0x409a62)[_0xc6c2('0x1f')](function(_0x37b2ba){_0x2ea213[_0xc6c2('0x2d')]=_0x37b2ba;if(_0xa16cb1[_0xc6c2('0x3d')][_0xc6c2('0x48')]){_0x4b1717[_0xc6c2('0x49')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xc6c2('0x4a')](_0x4b1717);})[_0xc6c2('0x1f')](function(_0x165043){_0x2ea213[_0xc6c2('0x4b')]=_0x165043;return _0x2ea213;})[_0xc6c2('0x1f')](respondWithFilteredResult(_0x1d91df,_0x4b1717))[_0xc6c2('0x28')](handleError(_0x1d91df,null));};exports[_0xc6c2('0x4c')]=function(_0x36f3cc,_0x3f774e){var _0x4c25c5={'raw':!![],'where':{'id':_0x36f3cc[_0xc6c2('0x4d')]['id']}},_0x2728dd={};_0x2728dd[_0xc6c2('0x3a')]=_[_0xc6c2('0x3b')](db[_0xc6c2('0x4e')][_0xc6c2('0x4f')]);_0x2728dd['query']=_['keys'](_0x36f3cc[_0xc6c2('0x3d')]);_0x2728dd['filters']=_[_0xc6c2('0x3c')](_0x2728dd['model'],_0x2728dd[_0xc6c2('0x3d')]);_0x4c25c5[_0xc6c2('0x3e')]=_[_0xc6c2('0x3c')](_0x2728dd[_0xc6c2('0x3a')],qs[_0xc6c2('0x3f')](_0x36f3cc[_0xc6c2('0x3d')]['fields']));_0x4c25c5[_0xc6c2('0x3e')]=_0x4c25c5[_0xc6c2('0x3e')][_0xc6c2('0x50')]?_0x4c25c5[_0xc6c2('0x3e')]:_0x2728dd[_0xc6c2('0x3a')];if(_0x36f3cc[_0xc6c2('0x3d')][_0xc6c2('0x48')]){_0x4c25c5['include']=[{'all':!![]}];}_0x4c25c5=_['merge']({},_0x4c25c5,_0x36f3cc['options']);return db['OpenchannelMessage']['find'](_0x4c25c5)[_0xc6c2('0x1f')](handleEntityNotFound(_0x3f774e,null))['then'](respondWithResult(_0x3f774e,null))[_0xc6c2('0x28')](handleError(_0x3f774e,null));};exports[_0xc6c2('0x51')]=function(_0x2a20fc,_0x3e7739){return db[_0xc6c2('0x4e')][_0xc6c2('0x51')](_0x2a20fc[_0xc6c2('0x52')],{})['then'](respondWithResult(_0x3e7739,0xc9))[_0xc6c2('0x28')](handleError(_0x3e7739,null));};exports['update']=function(_0x26d279,_0xe1c8fe){if(_0x26d279[_0xc6c2('0x52')]['id']){delete _0x26d279[_0xc6c2('0x52')]['id'];}return db['OpenchannelMessage']['find']({'where':{'id':_0x26d279[_0xc6c2('0x4d')]['id']}})[_0xc6c2('0x1f')](handleEntityNotFound(_0xe1c8fe,null))['then'](saveUpdates(_0x26d279[_0xc6c2('0x52')],null))['then'](respondWithResult(_0xe1c8fe,null))[_0xc6c2('0x28')](handleError(_0xe1c8fe,null));};exports[_0xc6c2('0x35')]=function(_0x178209,_0x59403d){return db['OpenchannelMessage'][_0xc6c2('0x53')]({'where':{'id':_0x178209[_0xc6c2('0x4d')]['id']}})[_0xc6c2('0x1f')](handleEntityNotFound(_0x59403d,null))['then'](removeEntity(_0x59403d,null))[_0xc6c2('0x28')](handleError(_0x59403d,null));};exports['describe']=function(_0x4dae5f,_0x370da7){return db[_0xc6c2('0x4e')][_0xc6c2('0x54')]()[_0xc6c2('0x1f')](respondWithResult(_0x370da7,null))[_0xc6c2('0x28')](handleError(_0x370da7,null));};var interaction_log=require(_0xc6c2('0x15'))(_0xc6c2('0x55'));exports[_0xc6c2('0x56')]=function(_0xc884c0,_0x22f16b,_0x4c7880){var _0x354ecf={'agent':{},'channel':'openchannel'};if(_0xc884c0['body']['id']){delete _0xc884c0[_0xc6c2('0x52')]['id'];}_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x57')]=!![];_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x58')]=moment()[_0xc6c2('0x59')](_0xc6c2('0x5a'));_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x5b')]=_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x5b')]||_0xc884c0['user']['id'];_0x354ecf[_0xc6c2('0x5c')]['id']=_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x5b')];return db[_0xc6c2('0x4e')][_0xc6c2('0x53')]({'where':{'id':_0xc884c0['params']['id'],'UserId':null}})[_0xc6c2('0x1f')](handleEntityNotFound(_0x22f16b,null))[_0xc6c2('0x1f')](saveUpdates(_0xc884c0[_0xc6c2('0x52')],null))[_0xc6c2('0x1f')](function(_0x55d2b9){if(_0x55d2b9){_0x354ecf[_0xc6c2('0x26')]=_0x55d2b9[_0xc6c2('0x5d')]({'plain':!![]});return db[_0xc6c2('0x5e')][_0xc6c2('0x53')]({'where':{'id':_0x55d2b9[_0xc6c2('0x5f')]}});}return null;})[_0xc6c2('0x1f')](handleEntityNotFound(_0x22f16b,null))[_0xc6c2('0x1f')](function(_0x13e404){if(_0x13e404){return _0x13e404['update']({'UserId':_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x5b')],'read1stAt':_['isNil'](_0x13e404[_0xc6c2('0x60')])?moment()['format'](_0xc6c2('0x5a')):undefined});}return null;})['then'](function(_0x4f9480){if(_0x4f9480){_0x354ecf[_0xc6c2('0x61')]=_0x4f9480[_0xc6c2('0x5d')]({'plain':!![]});interaction_log[_0xc6c2('0x20')](_0xc6c2('0x62'),_0xc884c0[_0xc6c2('0x63')]['id'],_0xc884c0[_0xc6c2('0x63')][_0xc6c2('0x37')],_0xc884c0[_0xc6c2('0x63')][_0xc6c2('0x64')],_0x354ecf[_0xc6c2('0x61')]['id'],_0xc884c0['body']?JSON[_0xc6c2('0x65')](_0xc884c0['body']):_0xc6c2('0x66'));return respondWithRpcPromise(_0xc6c2('0x67'),_0xc6c2('0x68'),_0x354ecf);}return null;})[_0xc6c2('0x1f')](function(_0x2cb9d0){var _0x4409df=_0xc6c2('0x69')+_0x2cb9d0[_0xc6c2('0x26')][_0xc6c2('0x6a')];return db['sequelize'][_0xc6c2('0x3d')](_0x4409df,{'type':db['Sequelize'][_0xc6c2('0x6b')][_0xc6c2('0x6c')],'raw':!![]})[_0xc6c2('0x1f')](function(_0x59137f){return _0x59137f;});})[_0xc6c2('0x1f')](function(_0x19f2a8){if(_0x19f2a8){_0x354ecf[_0xc6c2('0x26')]['contact']=_0x19f2a8[0x0];if(!_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x5b')])return;return db['User'][_0xc6c2('0x53')]({'where':{'id':_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x5b')],'role':_0xc6c2('0x5c')},'attributes':['id',_0xc6c2('0x37'),_0xc6c2('0x6d'),_0xc6c2('0x6e'),_0xc6c2('0x6f')],'raw':!![]});}return null;})[_0xc6c2('0x1f')](function(_0x42512a){if(!_0x42512a)return null;_0x354ecf[_0xc6c2('0x26')][_0xc6c2('0x5c')]=_0x42512a;return _0x354ecf;})[_0xc6c2('0x1f')](function(_0x398278){if(_0x398278){if(_0xc884c0[_0xc6c2('0x52')][_0xc6c2('0x70')]){_0x354ecf[_0xc6c2('0x26')][_0xc6c2('0x71')]=util[_0xc6c2('0x59')]('SIP/%s',_0xc884c0[_0xc6c2('0x63')][_0xc6c2('0x37')]);_0x354ecf['message'][_0xc6c2('0x72')]=_0x354ecf['channel'];_0x354ecf['message'][_0xc6c2('0x73')]=_0x354ecf[_0xc6c2('0x72')];_0x354ecf[_0xc6c2('0x26')]['event']=_0xc6c2('0x56');return respondWithRpcPromise(_0xc6c2('0x74'),_0xc6c2('0x74'),{'event':_0xc6c2('0x75'),'message':_0x354ecf['message']},client9002)[_0xc6c2('0x1f')](function(){return _0x354ecf;});}return _0x354ecf;}return null;})['then'](respondWithResult(_0x22f16b,null))[_0xc6c2('0x28')](handleError(_0x22f16b,null));};var interaction_log=require('../../config/logger')(_0xc6c2('0x55'));exports[_0xc6c2('0x32')]=function(_0x1bf07e,_0x28f527,_0x6152e2){var _0x271464={'agent':{},'channel':_0xc6c2('0x76')};if(_0x1bf07e[_0xc6c2('0x52')]['id']){delete _0x1bf07e[_0xc6c2('0x52')]['id'];}_0x1bf07e[_0xc6c2('0x52')][_0xc6c2('0x5b')]=_0x1bf07e[_0xc6c2('0x52')][_0xc6c2('0x5b')]||_0x1bf07e[_0xc6c2('0x63')]['id'];_0x271464[_0xc6c2('0x5c')]['id']=_0x1bf07e[_0xc6c2('0x52')][_0xc6c2('0x5b')];return db[_0xc6c2('0x4e')][_0xc6c2('0x53')]({'where':{'id':_0x1bf07e['params']['id'],'UserId':null}})[_0xc6c2('0x1f')](handleEntityNotFound(_0x28f527,null))['then'](function(_0x28307e){if(_0x28307e){_0x271464[_0xc6c2('0x26')]=_0x28307e['get']({'plain':!![]});return db[_0xc6c2('0x5e')][_0xc6c2('0x53')]({'where':{'id':_0x28307e[_0xc6c2('0x5f')]}});}return null;})[_0xc6c2('0x1f')](handleEntityNotFound(_0x28f527,null))[_0xc6c2('0x1f')](function(_0x190c18){if(_0x190c18){_0x271464[_0xc6c2('0x61')]=_0x190c18[_0xc6c2('0x5d')]({'plain':!![]});interaction_log[_0xc6c2('0x20')](_0xc6c2('0x77'),_0x1bf07e[_0xc6c2('0x63')]['id'],_0x1bf07e[_0xc6c2('0x63')][_0xc6c2('0x37')],_0x1bf07e[_0xc6c2('0x63')][_0xc6c2('0x64')],_0x271464[_0xc6c2('0x61')]['id'],_0x1bf07e['body']?JSON[_0xc6c2('0x65')](_0x1bf07e['body']):'null');return respondWithRpcPromise(_0xc6c2('0x78'),_0xc6c2('0x79'),_0x271464);}return null;})[_0xc6c2('0x1f')](function(_0x22a27b){var _0x27e2b0=_0xc6c2('0x69')+_0x22a27b[_0xc6c2('0x26')][_0xc6c2('0x6a')];return db[_0xc6c2('0x7a')][_0xc6c2('0x3d')](_0x27e2b0,{'type':db[_0xc6c2('0x7b')][_0xc6c2('0x6b')]['SELECT'],'raw':!![]})[_0xc6c2('0x1f')](function(_0x219f0a){return _0x219f0a;});})[_0xc6c2('0x1f')](function(_0x4052d6){if(_0x4052d6){_0x271464['message'][_0xc6c2('0x7c')]=_0x4052d6[0x0];if(!_0x1bf07e[_0xc6c2('0x52')][_0xc6c2('0x5b')])return;return db[_0xc6c2('0x7d')][_0xc6c2('0x53')]({'where':{'id':_0x1bf07e[_0xc6c2('0x52')][_0xc6c2('0x5b')],'role':_0xc6c2('0x5c')},'attributes':['id',_0xc6c2('0x37'),_0xc6c2('0x6d'),_0xc6c2('0x6e'),'internal'],'raw':!![]});}return null;})[_0xc6c2('0x1f')](function(_0x5a1fdf){if(!_0x5a1fdf)return null;_0x271464[_0xc6c2('0x26')]['agent']=_0x5a1fdf;return _0x271464;})[_0xc6c2('0x1f')](function(_0x5e12f0){if(_0x5e12f0){_0x5e12f0[_0xc6c2('0x26')]['interface']=util['format'](_0xc6c2('0x7e'),_0x1bf07e[_0xc6c2('0x63')][_0xc6c2('0x37')]);_0x5e12f0[_0xc6c2('0x26')]['channel']=_0x271464['channel'];_0x5e12f0[_0xc6c2('0x26')][_0xc6c2('0x73')]=_0x271464[_0xc6c2('0x72')];_0x5e12f0[_0xc6c2('0x26')][_0xc6c2('0x7f')]='reject';respondWithRpcPromise('EventManager',_0xc6c2('0x74'),{'event':_0xc6c2('0x80'),'message':_0x5e12f0['message']},client9002);return _0x271464;}return null;})['then'](respondWithResult(_0x28f527,null))[_0xc6c2('0x28')](handleError(_0x28f527,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ed02ba2..64a49bb 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 _0xf93f=['remove','emit','hasOwnProperty','save','update'];(function(_0x3eecf6,_0x2f4038){var _0x1458a4=function(_0x5b3fb6){while(--_0x5b3fb6){_0x3eecf6['push'](_0x3eecf6['shift']());}};_0x1458a4(++_0x2f4038);}(_0xf93f,0x111));var _0xff93=function(_0x26e0d9,_0x3bbeff){_0x26e0d9=_0x26e0d9-0x0;var _0x3ed4bb=_0xf93f[_0x26e0d9];return _0x3ed4bb;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xff93('0x0'),'afterUpdate':_0xff93('0x1'),'afterDestroy':_0xff93('0x2')};function emitEvent(_0x1b6101){return function(_0x304155,_0x209a30,_0x15a64){OpenchannelMessageEvents[_0xff93('0x3')](_0x1b6101+':'+_0x304155['id'],_0x304155);OpenchannelMessageEvents[_0xff93('0x3')](_0x1b6101,_0x304155);_0x15a64(null);};}for(var e in events){if(events[_0xff93('0x4')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x6cc1=['events','../../mysqldb','OpenchannelMessage','update','emit','hasOwnProperty'];(function(_0x375946,_0x19d105){var _0x3b091c=function(_0x1fe143){while(--_0x1fe143){_0x375946['push'](_0x375946['shift']());}};_0x3b091c(++_0x19d105);}(_0x6cc1,0xfc));var _0x16cc=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x6cc1[_0x5f1617];return _0x3af5da;};'use strict';var EventEmitter=require(_0x16cc('0x0'));var OpenchannelMessage=require(_0x16cc('0x1'))['db'][_0x16cc('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x16cc('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4aef6e){return function(_0x446ac7,_0x371dbf,_0x495d88){OpenchannelMessageEvents[_0x16cc('0x4')](_0x4aef6e+':'+_0x446ac7['id'],_0x446ac7);OpenchannelMessageEvents['emit'](_0x4aef6e,_0x446ac7);_0x495d88(null);};}for(var e in events){if(events[_0x16cc('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](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 29c40cf..4216f4a 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 _0x87a3=['Interaction','omit','POST','method','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length'];(function(_0x27995d,_0x2715be){var _0x45f0b2=function(_0x1580f2){while(--_0x1580f2){_0x27995d['push'](_0x27995d['shift']());}};_0x45f0b2(++_0x2715be);}(_0x87a3,0x1bc));var _0x387a=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x87a3[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0x387a('0x0'));var util=require('util');var logger=require(_0x387a('0x1'))('api');var moment=require(_0x387a('0x2'));var BPromise=require(_0x387a('0x3'));var rp=require(_0x387a('0x4'));var fs=require('fs');var path=require(_0x387a('0x5'));var rimraf=require(_0x387a('0x6'));var config=require(_0x387a('0x7'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x519ac7,_0x2dde0b){return _0x519ac7[_0x387a('0x8')](_0x387a('0x9'),attributes,{'tableName':_0x387a('0xa'),'paranoid':![],'indexes':[{'name':_0x387a('0xb'),'fields':[_0x387a('0xc')],'type':_0x387a('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x534a33,_0x177dc3,_0x84b877){var _0x585df6=_0x519ac7['models'];var _0x517d79=_0x534a33[_0x387a('0xe')]({'plain':!![]});if(_0x517d79[_0x387a('0xf')][_0x387a('0x10')]()==='in'||_0x517d79['direction']['toLowerCase']()===_0x387a('0x11')&&!_0x517d79[_0x387a('0x12')]&&!_['isNil'](_0x517d79[_0x387a('0x13')])){_0x585df6[_0x387a('0x14')][_0x387a('0x15')]({'where':{'id':_0x517d79[_0x387a('0x16')]}})[_0x387a('0x17')](function(_0x3968d1){if(_0x3968d1){_0x3968d1[_0x387a('0x18')]({'lastMsgAt':_0x517d79[_0x387a('0x19')],'lastMsgDirection':_0x517d79[_0x387a('0xf')][_0x387a('0x10')]()});}})[_0x387a('0x1a')](function(_0x2da0c2){console[_0x387a('0x1b')](_0x2da0c2);});}if(_0x517d79[_0x387a('0xf')]===_0x387a('0x11')&&!_0x517d79[_0x387a('0x12')]){var _0x526f47;_0x585df6[_0x387a('0x1c')][_0x387a('0x1d')]()[_0x387a('0x17')](function(_0x4bf56b){return _0x585df6[_0x387a('0x1e')][_0x387a('0x1f')]({'where':{'id':_0x517d79[_0x387a('0x20')]},'include':[{'model':_0x585df6['OpenchannelInteraction'],'as':_0x387a('0x21'),'where':{'id':_0x517d79[_0x387a('0x16')]},'limit':0x1,'include':[{'model':_0x585df6[_0x387a('0x1c')],'as':_0x387a('0x22'),'attributes':_[_0x387a('0x23')](_0x4bf56b)}]}]});})[_0x387a('0x17')](function(_0x3bf487){_0x526f47=_0x3bf487[_0x387a('0xe')]({'plain':!![]});if(_0x526f47&&_0x526f47[_0x387a('0x24')]){logger[_0x387a('0x25')](_0x387a('0x26'),_0x387a('0x27'),util['format'](_0x387a('0x28'),_0x517d79['id'],_0x526f47[_0x387a('0x24')]));if(_0x526f47[_0x387a('0x21')]&&_0x526f47['Interactions'][_0x387a('0x29')]){_0x517d79[_0x387a('0x2a')]=_[_0x387a('0x2b')](_0x526f47['Interactions'][0x0],'Contact');_0x517d79[_0x387a('0x22')]=_0x526f47[_0x387a('0x21')][0x0][_0x387a('0x22')];}var _0x177dc3={'method':_0x387a('0x2c'),'uri':encodeURI(_0x526f47[_0x387a('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x177dc3[_0x387a('0x2d')]){case _0x387a('0x2e'):_0x177dc3['qs']=_0x517d79;break;case _0x387a('0x2c'):_0x177dc3[_0x387a('0xc')]=_0x517d79;break;}return rp(_0x177dc3)[_0x387a('0x17')](function(_0x46151e){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x387a('0x27'),util[_0x387a('0x2f')](_0x387a('0x30'),_0x517d79['id'],_0x526f47[_0x387a('0x24')]));if(_0x46151e[_0x387a('0xc')]['threadId']&&_0x46151e['body'][_0x387a('0x31')]!=_0x517d79[_0x387a('0x2a')]['threadId']){return _0x585df6[_0x387a('0x14')]['update']({'threadId':_0x46151e['body'][_0x387a('0x31')]},{'where':{'id':_0x517d79['Interaction']['id']}});}else{return;}})[_0x387a('0x17')](function(){return _0x534a33[_0x387a('0x18')]({'read':!![]});})[_0x387a('0x1a')](function(_0x198412){logger[_0x387a('0x1b')](_0x387a('0x26'),_0x387a('0x27'),util[_0x387a('0x32')](_0x198412,{'showHidden':![],'depth':null}));_0x84b877();});}else{_0x84b877();}})[_0x387a('0x33')](function(){_0x84b877();});}else{_0x84b877();}}},'charset':_0x387a('0x34'),'collate':_0x387a('0x35')});}; \ No newline at end of file +var _0xeb92=['Contact','then','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','fti_openchannel_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','update','catch','error','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact'];(function(_0x550672,_0x5ed3e5){var _0x4b5261=function(_0x4cddde){while(--_0x4cddde){_0x550672['push'](_0x550672['shift']());}};_0x4b5261(++_0x5ed3e5);}(_0xeb92,0xa8));var _0x2eb9=function(_0x5d2c81,_0x4c907f){_0x5d2c81=_0x5d2c81-0x0;var _0x26b4e6=_0xeb92[_0x5d2c81];return _0x26b4e6;};'use strict';var _=require(_0x2eb9('0x0'));var util=require('util');var logger=require(_0x2eb9('0x1'))(_0x2eb9('0x2'));var moment=require(_0x2eb9('0x3'));var BPromise=require(_0x2eb9('0x4'));var rp=require(_0x2eb9('0x5'));var fs=require('fs');var path=require(_0x2eb9('0x6'));var rimraf=require(_0x2eb9('0x7'));var config=require(_0x2eb9('0x8'));var attributes=require(_0x2eb9('0x9'));module[_0x2eb9('0xa')]=function(_0x211e5a,_0x5aa07f){return _0x211e5a['define'](_0x2eb9('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x2eb9('0xc'),'fields':[_0x2eb9('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f4178,_0x1db994,_0xe72f36){var _0x3bd2a1=_0x211e5a['models'];var _0x117f5f=_0x2f4178[_0x2eb9('0xe')]({'plain':!![]});if(_0x117f5f[_0x2eb9('0xf')][_0x2eb9('0x10')]()==='in'||_0x117f5f[_0x2eb9('0xf')]['toLowerCase']()===_0x2eb9('0x11')&&!_0x117f5f[_0x2eb9('0x12')]&&!_[_0x2eb9('0x13')](_0x117f5f[_0x2eb9('0x14')])){_0x3bd2a1['OpenchannelInteraction'][_0x2eb9('0x15')]({'where':{'id':_0x117f5f[_0x2eb9('0x16')]}})['then'](function(_0x3b9e8e){if(_0x3b9e8e){_0x3b9e8e[_0x2eb9('0x17')]({'lastMsgAt':_0x117f5f['createdAt'],'lastMsgDirection':_0x117f5f[_0x2eb9('0xf')][_0x2eb9('0x10')]()});}})[_0x2eb9('0x18')](function(_0x58dd8c){console[_0x2eb9('0x19')](_0x58dd8c);});}if(_0x117f5f[_0x2eb9('0xf')]===_0x2eb9('0x11')&&!_0x117f5f[_0x2eb9('0x12')]){var _0x2b9b75;_0x3bd2a1['CmContact'][_0x2eb9('0x1a')]()['then'](function(_0x4b608d){return _0x3bd2a1[_0x2eb9('0x1b')][_0x2eb9('0x1c')]({'where':{'id':_0x117f5f[_0x2eb9('0x1d')]},'include':[{'model':_0x3bd2a1['OpenchannelInteraction'],'as':_0x2eb9('0x1e'),'where':{'id':_0x117f5f['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x3bd2a1[_0x2eb9('0x1f')],'as':_0x2eb9('0x20'),'attributes':_['keys'](_0x4b608d)}]}]});})[_0x2eb9('0x21')](function(_0x5bfd94){_0x2b9b75=_0x5bfd94[_0x2eb9('0xe')]({'plain':!![]});if(_0x2b9b75&&_0x2b9b75[_0x2eb9('0x22')]){logger[_0x2eb9('0x23')](_0x2eb9('0x24'),_0x2eb9('0x25'),util[_0x2eb9('0x26')](_0x2eb9('0x27'),_0x117f5f['id'],_0x2b9b75[_0x2eb9('0x22')]));if(_0x2b9b75[_0x2eb9('0x1e')]&&_0x2b9b75['Interactions']['length']){_0x117f5f[_0x2eb9('0x28')]=_[_0x2eb9('0x29')](_0x2b9b75['Interactions'][0x0],_0x2eb9('0x20'));_0x117f5f['Contact']=_0x2b9b75[_0x2eb9('0x1e')][0x0]['Contact'];}var _0x1db994={'method':_0x2eb9('0x2a'),'uri':encodeURI(_0x2b9b75[_0x2eb9('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1db994[_0x2eb9('0x2b')]){case _0x2eb9('0x2c'):_0x1db994['qs']=_0x117f5f;break;case _0x2eb9('0x2a'):_0x1db994[_0x2eb9('0xd')]=_0x117f5f;break;}return rp(_0x1db994)[_0x2eb9('0x21')](function(_0x432842){logger['info'](_0x2eb9('0x24'),_0x2eb9('0x25'),util[_0x2eb9('0x26')](_0x2eb9('0x2d'),_0x117f5f['id'],_0x2b9b75[_0x2eb9('0x22')]));if(_0x432842['body'][_0x2eb9('0x2e')]&&_0x432842[_0x2eb9('0xd')]['threadId']!=_0x117f5f[_0x2eb9('0x28')][_0x2eb9('0x2e')]){return _0x3bd2a1['OpenchannelInteraction']['update']({'threadId':_0x432842[_0x2eb9('0xd')][_0x2eb9('0x2e')]},{'where':{'id':_0x117f5f[_0x2eb9('0x28')]['id']}});}else{return;}})[_0x2eb9('0x21')](function(){return _0x2f4178[_0x2eb9('0x17')]({'read':!![]});})['catch'](function(_0x4c77c8){logger[_0x2eb9('0x19')](_0x2eb9('0x24'),'afterCreate',util[_0x2eb9('0x2f')](_0x4c77c8,{'showHidden':![],'depth':null}));_0xe72f36();});}else{_0xe72f36();}})[_0x2eb9('0x30')](function(){_0xe72f36();});}else{_0xe72f36();}}},'charset':_0x2eb9('0x31'),'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 1779f06..0a86c37 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(_0xa6171c,_0x40def5){var _0x246939=function(_0x28b280){while(--_0x28b280){_0xa6171c['push'](_0xa6171c['shift']());}};_0x246939(++_0x40def5);}(_0x7a54,0x106));var _0x47a5=function(_0x3ddce4,_0x2c7d75){_0x3ddce4=_0x3ddce4-0x0;var _0xe7e1c1=_0x7a54[_0x3ddce4];return _0xe7e1c1;};'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 _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(_0x507d58,_0x4288a9){var _0x6cd4a0=function(_0x215e5b){while(--_0x215e5b){_0x507d58['push'](_0x507d58['shift']());}};_0x6cd4a0(++_0x4288a9);}(_0x7a54,0x106));var _0x47a5=function(_0x402f7c,_0x2df520){_0x402f7c=_0x402f7c-0x0;var _0x3aa0e6=_0x7a54[_0x402f7c];return _0x3aa0e6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ac2512b..cc4b550 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 _0x192f=['length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','register'];(function(_0x142db6,_0x5a1395){var _0x256363=function(_0x530ac4){while(--_0x530ac4){_0x142db6['push'](_0x142db6['shift']());}};_0x256363(++_0x5a1395);}(_0x192f,0x19a));var _0xf192=function(_0x3e1113,_0x105275){_0x3e1113=_0x3e1113-0x0;var _0x36da2f=_0x192f[_0x3e1113];return _0x36da2f;};'use strict';var OpenchannelMessageEvents=require(_0xf192('0x0'));var events=[_0xf192('0x1'),_0xf192('0x2'),_0xf192('0x3')];function createListener(_0x39a88b,_0x429b9f){return function(_0x2049d6){_0x429b9f[_0xf192('0x4')](_0x39a88b,_0x2049d6);};}function removeListener(_0x500020,_0x52b247){return function(){OpenchannelMessageEvents['removeListener'](_0x500020,_0x52b247);};}exports[_0xf192('0x5')]=function(_0x379046){for(var _0x583b71=0x0,_0x3d68e4=events[_0xf192('0x6')];_0x583b71<_0x3d68e4;_0x583b71++){var _0x3a0448=events[_0x583b71];var _0x1cf5c5=createListener(_0xf192('0x7')+_0x3a0448,_0x379046);OpenchannelMessageEvents['on'](_0x3a0448,_0x1cf5c5);}}; \ No newline at end of file +var _0x13c8=['save','remove','emit','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x13c8,0xa0));var _0x813c=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0x13c8[_0x56a871];return _0x124954;};'use strict';var OpenchannelMessageEvents=require(_0x813c('0x0'));var events=[_0x813c('0x1'),_0x813c('0x2'),'update'];function createListener(_0x4f090b,_0x190bcd){return function(_0x1838fc){_0x190bcd[_0x813c('0x3')](_0x4f090b,_0x1838fc);};}function removeListener(_0x267c0b,_0x542451){return function(){OpenchannelMessageEvents['removeListener'](_0x267c0b,_0x542451);};}exports[_0x813c('0x4')]=function(_0x2f831e){for(var _0x419708=0x0,_0x84cd24=events[_0x813c('0x5')];_0x419708<_0x84cd24;_0x419708++){var _0x6316b1=events[_0x419708];var _0xe0bc37=createListener(_0x813c('0x6')+_0x6316b1,_0x2f831e);OpenchannelMessageEvents['on'](_0x6316b1,_0xe0bc37);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 3ea520a..fb2d639 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 _0xeb92=['exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeAgents'];(function(_0x544072,_0xc41ee1){var _0x590bf6=function(_0x41107f){while(--_0x41107f){_0x544072['push'](_0x544072['shift']());}};_0x590bf6(++_0xc41ee1);}(_0xeb92,0x1dd));var _0x2eb9=function(_0x3e5e55,_0x2f060f){_0x3e5e55=_0x3e5e55-0x0;var _0x2ca158=_0xeb92[_0x3e5e55];return _0x2ca158;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2eb9('0x0'));var timeout=require(_0x2eb9('0x1'));var express=require(_0x2eb9('0x2'));var router=express[_0x2eb9('0x3')]();var fs_extra=require(_0x2eb9('0x4'));var auth=require(_0x2eb9('0x5'));var interaction=require(_0x2eb9('0x6'));var config=require('../../config/environment');var controller=require(_0x2eb9('0x7'));router[_0x2eb9('0x8')]('/',auth['isAuthenticated'](),controller[_0x2eb9('0x9')]);router[_0x2eb9('0x8')](_0x2eb9('0xa'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0xc')]);router[_0x2eb9('0x8')](_0x2eb9('0xd'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0xe')]);router[_0x2eb9('0x8')](_0x2eb9('0xf'),auth['isAuthenticated'](),controller[_0x2eb9('0x10')]);router[_0x2eb9('0x8')](_0x2eb9('0x11'),auth[_0x2eb9('0xb')](),controller['getTeams']);router[_0x2eb9('0x8')](_0x2eb9('0x12'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0x13')]);router[_0x2eb9('0x14')]('/',auth[_0x2eb9('0xb')](),controller['create']);router[_0x2eb9('0x14')](_0x2eb9('0x11'),auth['isAuthenticated'](),controller[_0x2eb9('0x15')]);router['post'](_0x2eb9('0x12'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0x16')]);router[_0x2eb9('0x17')](_0x2eb9('0xd'),auth[_0x2eb9('0xb')](),controller[_0x2eb9('0x18')]);router[_0x2eb9('0x19')](_0x2eb9('0xd'),auth[_0x2eb9('0xb')](),controller['destroy']);router['delete'](_0x2eb9('0x11'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x2eb9('0x19')](_0x2eb9('0x12'),auth['isAuthenticated'](),controller[_0x2eb9('0x1a')]);module[_0x2eb9('0x1b')]=router; \ No newline at end of file +var _0xe9d6=['delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','update'];(function(_0x3aef17,_0x1563c2){var _0x2ca07b=function(_0x45d548){while(--_0x45d548){_0x3aef17['push'](_0x3aef17['shift']());}};_0x2ca07b(++_0x1563c2);}(_0xe9d6,0x19b));var _0x6e9d=function(_0x2cbf99,_0xa9ef9a){_0x2cbf99=_0x2cbf99-0x0;var _0x4d472a=_0xe9d6[_0x2cbf99];return _0x4d472a;};'use strict';var multer=require(_0x6e9d('0x0'));var util=require('util');var path=require(_0x6e9d('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e9d('0x2'));var router=express[_0x6e9d('0x3')]();var fs_extra=require(_0x6e9d('0x4'));var auth=require(_0x6e9d('0x5'));var interaction=require(_0x6e9d('0x6'));var config=require(_0x6e9d('0x7'));var controller=require(_0x6e9d('0x8'));router[_0x6e9d('0x9')]('/',auth[_0x6e9d('0xa')](),controller[_0x6e9d('0xb')]);router['get']('/describe',auth[_0x6e9d('0xa')](),controller[_0x6e9d('0xc')]);router[_0x6e9d('0x9')](_0x6e9d('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x6e9d('0x9')](_0x6e9d('0xe'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0xf')]);router['get']('/:id/teams',auth[_0x6e9d('0xa')](),controller['getTeams']);router['get'](_0x6e9d('0x10'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x11')]);router[_0x6e9d('0x12')]('/',auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x13')]);router[_0x6e9d('0x12')](_0x6e9d('0x14'),auth['isAuthenticated'](),controller['addTeams']);router[_0x6e9d('0x12')](_0x6e9d('0x10'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x15')]);router[_0x6e9d('0x16')]('/:id',auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x17')]);router[_0x6e9d('0x18')]('/:id',auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x19')]);router[_0x6e9d('0x18')](_0x6e9d('0x14'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x1a')]);router['delete'](_0x6e9d('0x10'),auth[_0x6e9d('0xa')](),controller[_0x6e9d('0x1b')]);module[_0x6e9d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 4cc3243..7e8c9f3 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 _0xc1a3=['ENUM','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc1a3,0x170));var _0x3c1a=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xc1a3[_0x11005e];return _0x29338f;};'use strict';var Sequelize=require(_0x3c1a('0x0'));module['exports']={'name':{'type':Sequelize[_0x3c1a('0x1')],'unique':_0x3c1a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3c1a('0x1')]},'timeout':{'type':Sequelize[_0x3c1a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3c1a('0x4')]('rrmemory','beepall',_0x3c1a('0x5'))}}; \ No newline at end of file +var _0x8198=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x21d7ca,_0x3d8286){var _0x13f015=function(_0x760076){while(--_0x760076){_0x21d7ca['push'](_0x21d7ca['shift']());}};_0x13f015(++_0x3d8286);}(_0x8198,0x1bc));var _0x8819=function(_0x10dc60,_0x2fcce1){_0x10dc60=_0x10dc60-0x0;var _0x47dec5=_0x8198[_0x10dc60];return _0x47dec5;};'use strict';var Sequelize=require(_0x8819('0x0'));module[_0x8819('0x1')]={'name':{'type':Sequelize[_0x8819('0x2')],'unique':_0x8819('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8819('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8819('0x5'),_0x8819('0x6'),_0x8819('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 2f49095..5f55da2 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 _0xcf56=['../../config/license/util','redis','defaults','socket.io-emitter','./openchannelQueue.socket','sendStatus','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','status','error','stack','name','map','OpenchannelQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','UserOpenchannelQueue','pick','User','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','nolimit','addTeams','ids','Team','Agents','online','each','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','every','TeamId','includes','union','transaction','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment'];(function(_0x1732e5,_0xf24e30){var _0xc77fdf=function(_0x402ce5){while(--_0x402ce5){_0x1732e5['push'](_0x1732e5['shift']());}};_0xc77fdf(++_0xf24e30);}(_0xcf56,0x181));var _0x6cf5=function(_0x404fb7,_0x3a13ff){_0x404fb7=_0x404fb7-0x0;var _0x140296=_0xcf56[_0x404fb7];return _0x140296;};'use strict';var emlformat=require(_0x6cf5('0x0'));var rimraf=require(_0x6cf5('0x1'));var zipdir=require(_0x6cf5('0x2'));var jsonpatch=require(_0x6cf5('0x3'));var rp=require(_0x6cf5('0x4'));var moment=require(_0x6cf5('0x5'));var BPromise=require(_0x6cf5('0x6'));var Mustache=require(_0x6cf5('0x7'));var util=require('util');var path=require(_0x6cf5('0x8'));var sox=require(_0x6cf5('0x9'));var csv=require('to-csv');var ejs=require(_0x6cf5('0xa'));var fs=require('fs');var fs_extra=require(_0x6cf5('0xb'));var _=require(_0x6cf5('0xc'));var squel=require(_0x6cf5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6cf5('0xe'));var toCsv=require(_0x6cf5('0xf'));var querystring=require(_0x6cf5('0x10'));var Papa=require(_0x6cf5('0x11'));var Redis=require(_0x6cf5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6cf5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf5('0x14'));var logger=require('../../config/logger')(_0x6cf5('0x15'));var utils=require('../../config/utils');var config=require(_0x6cf5('0x16'));var licenseUtil=require(_0x6cf5('0x17'));var db=require('../../mysqldb')['db'];config[_0x6cf5('0x18')]=_[_0x6cf5('0x19')](config[_0x6cf5('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6cf5('0x1a'))(new Redis(config[_0x6cf5('0x18')]));require(_0x6cf5('0x1b'))['register'](socket);function respondWithStatusCode(_0x5081cc,_0x128534){_0x128534=_0x128534||0xcc;return function(_0x2b3080){if(_0x2b3080){return _0x5081cc[_0x6cf5('0x1c')](_0x128534);}return _0x5081cc['status'](_0x128534)[_0x6cf5('0x1d')]();};}function respondWithResult(_0x579efc,_0x54934f){_0x54934f=_0x54934f||0xc8;return function(_0x43fba2){if(_0x43fba2){return _0x579efc['status'](_0x54934f)[_0x6cf5('0x1e')](_0x43fba2);}};}function respondWithFilteredResult(_0x2a2f44,_0x4e1937){return function(_0x4b3e57){if(_0x4b3e57){var _0x54afed=typeof _0x4e1937[_0x6cf5('0x1f')]===_0x6cf5('0x20')&&typeof _0x4e1937[_0x6cf5('0x21')]==='undefined';var _0x4a6822=_0x4b3e57[_0x6cf5('0x22')];var _0x57ee8f=_0x54afed?0x0:_0x4e1937[_0x6cf5('0x1f')];var _0x46f1cc=_0x54afed?_0x4b3e57[_0x6cf5('0x22')]:_0x4e1937[_0x6cf5('0x1f')]+_0x4e1937[_0x6cf5('0x21')];var _0x3a08f0;if(_0x46f1cc>=_0x4a6822){_0x46f1cc=_0x4a6822;_0x3a08f0=0xc8;}else{_0x3a08f0=0xce;}_0x2a2f44['status'](_0x3a08f0);return _0x2a2f44['set'](_0x6cf5('0x23'),_0x57ee8f+'-'+_0x46f1cc+'/'+_0x4a6822)['json'](_0x4b3e57);}return null;};}function patchUpdates(_0x58fad0){return function(_0x5bed8c){try{jsonpatch[_0x6cf5('0x24')](_0x5bed8c,_0x58fad0,!![]);}catch(_0x1cb51b){return BPromise[_0x6cf5('0x25')](_0x1cb51b);}return _0x5bed8c[_0x6cf5('0x26')]();};}function saveUpdates(_0x333bab,_0x589bcd){return function(_0x4a19fc){if(_0x4a19fc){return _0x4a19fc[_0x6cf5('0x27')](_0x333bab)[_0x6cf5('0x28')](function(_0xe13f35){return _0xe13f35;});}return null;};}function removeEntity(_0x41c9ef,_0x5dada0){return function(_0x1797e3){if(_0x1797e3){return _0x1797e3[_0x6cf5('0x29')]()[_0x6cf5('0x28')](function(){var _0x2c6a99=_0x1797e3[_0x6cf5('0x2a')]({'plain':!![]});var _0xf7fe95=_0x6cf5('0x2b');return db[_0x6cf5('0x2c')][_0x6cf5('0x29')]({'where':{'type':_0xf7fe95,'resourceId':_0x2c6a99['id']}})[_0x6cf5('0x28')](function(){return _0x1797e3;});})[_0x6cf5('0x28')](function(){_0x41c9ef[_0x6cf5('0x2d')](0xcc)[_0x6cf5('0x1d')]();});}};}function handleEntityNotFound(_0x11b2ae,_0x23354a){return function(_0x4bacc1){if(!_0x4bacc1){_0x11b2ae[_0x6cf5('0x1c')](0x194);}return _0x4bacc1;};}function handleError(_0x5a9751,_0x144056){_0x144056=_0x144056||0x1f4;return function(_0xdab9d1){logger[_0x6cf5('0x2e')](_0xdab9d1[_0x6cf5('0x2f')]);if(_0xdab9d1[_0x6cf5('0x30')]){delete _0xdab9d1[_0x6cf5('0x30')];}_0x5a9751[_0x6cf5('0x2d')](_0x144056)['send'](_0xdab9d1);};}exports['index']=function(_0x65254,_0x27336c){var _0x4bd3c3={},_0xcf7a41={},_0x5eff59={'count':0x0,'rows':[]};var _0x46c9b7=_[_0x6cf5('0x31')](db[_0x6cf5('0x32')][_0x6cf5('0x33')],function(_0x536d11){return{'name':_0x536d11['fieldName'],'type':_0x536d11[_0x6cf5('0x34')][_0x6cf5('0x35')]};});_0xcf7a41[_0x6cf5('0x36')]=_[_0x6cf5('0x31')](_0x46c9b7,_0x6cf5('0x30'));_0xcf7a41[_0x6cf5('0x37')]=_[_0x6cf5('0x38')](_0x65254[_0x6cf5('0x37')]);_0xcf7a41[_0x6cf5('0x39')]=_[_0x6cf5('0x3a')](_0xcf7a41[_0x6cf5('0x36')],_0xcf7a41[_0x6cf5('0x37')]);_0x4bd3c3[_0x6cf5('0x3b')]=_[_0x6cf5('0x3a')](_0xcf7a41['model'],qs[_0x6cf5('0x3c')](_0x65254[_0x6cf5('0x37')][_0x6cf5('0x3c')]));_0x4bd3c3[_0x6cf5('0x3b')]=_0x4bd3c3[_0x6cf5('0x3b')][_0x6cf5('0x3d')]?_0x4bd3c3[_0x6cf5('0x3b')]:_0xcf7a41[_0x6cf5('0x36')];if(!_0x65254['query'][_0x6cf5('0x3e')]('nolimit')){_0x4bd3c3[_0x6cf5('0x21')]=qs[_0x6cf5('0x21')](_0x65254[_0x6cf5('0x37')][_0x6cf5('0x21')]);_0x4bd3c3[_0x6cf5('0x1f')]=qs[_0x6cf5('0x1f')](_0x65254[_0x6cf5('0x37')]['offset']);}_0x4bd3c3[_0x6cf5('0x3f')]=qs[_0x6cf5('0x40')](_0x65254['query'][_0x6cf5('0x40')]);_0x4bd3c3[_0x6cf5('0x41')]=qs[_0x6cf5('0x39')](_['pick'](_0x65254[_0x6cf5('0x37')],_0xcf7a41[_0x6cf5('0x39')]),_0x46c9b7);if(_0x65254[_0x6cf5('0x37')][_0x6cf5('0x42')]){_0x4bd3c3['where']=_['merge'](_0x4bd3c3[_0x6cf5('0x41')],{'$or':_[_0x6cf5('0x31')](_0x46c9b7,function(_0x457169){if(_0x457169[_0x6cf5('0x34')]!==_0x6cf5('0x43')){var _0x43925b={};_0x43925b[_0x457169[_0x6cf5('0x30')]]={'$like':'%'+_0x65254['query'][_0x6cf5('0x42')]+'%'};return _0x43925b;}})});}_0x4bd3c3=_[_0x6cf5('0x44')]({},_0x4bd3c3,_0x65254[_0x6cf5('0x45')]);var _0x3a1737={'where':_0x4bd3c3['where']};return db[_0x6cf5('0x32')]['count'](_0x3a1737)[_0x6cf5('0x28')](function(_0x21a1e3){_0x5eff59['count']=_0x21a1e3;if(_0x65254[_0x6cf5('0x37')]['includeAll']){_0x4bd3c3[_0x6cf5('0x46')]=[{'all':!![]}];}return db[_0x6cf5('0x32')][_0x6cf5('0x47')](_0x4bd3c3);})[_0x6cf5('0x28')](function(_0x1c9cf1){_0x5eff59[_0x6cf5('0x48')]=_0x1c9cf1;return _0x5eff59;})[_0x6cf5('0x28')](respondWithFilteredResult(_0x27336c,_0x4bd3c3))[_0x6cf5('0x49')](handleError(_0x27336c,null));};exports[_0x6cf5('0x4a')]=function(_0x482924,_0xbef03f){var _0x551680={'raw':!![],'where':{'id':_0x482924['params']['id']}},_0x4e1417={};_0x4e1417[_0x6cf5('0x36')]=_[_0x6cf5('0x38')](db['OpenchannelQueue'][_0x6cf5('0x33')]);_0x4e1417[_0x6cf5('0x37')]=_[_0x6cf5('0x38')](_0x482924[_0x6cf5('0x37')]);_0x4e1417[_0x6cf5('0x39')]=_[_0x6cf5('0x3a')](_0x4e1417[_0x6cf5('0x36')],_0x4e1417[_0x6cf5('0x37')]);_0x551680[_0x6cf5('0x3b')]=_[_0x6cf5('0x3a')](_0x4e1417[_0x6cf5('0x36')],qs[_0x6cf5('0x3c')](_0x482924[_0x6cf5('0x37')][_0x6cf5('0x3c')]));_0x551680[_0x6cf5('0x3b')]=_0x551680[_0x6cf5('0x3b')]['length']?_0x551680[_0x6cf5('0x3b')]:_0x4e1417['model'];if(_0x482924['query'][_0x6cf5('0x4b')]){_0x551680[_0x6cf5('0x46')]=[{'all':!![]}];}_0x551680=_['merge']({},_0x551680,_0x482924[_0x6cf5('0x45')]);return db[_0x6cf5('0x32')][_0x6cf5('0x4c')](_0x551680)[_0x6cf5('0x28')](handleEntityNotFound(_0xbef03f,null))[_0x6cf5('0x28')](respondWithResult(_0xbef03f,null))[_0x6cf5('0x49')](handleError(_0xbef03f,null));};exports['create']=function(_0x11ad5d,_0x31689b){return db[_0x6cf5('0x32')]['create'](_0x11ad5d[_0x6cf5('0x4d')],{})[_0x6cf5('0x28')](function(_0x582d2b){var _0x28fe9b=_0x11ad5d['user'][_0x6cf5('0x2a')]({'plain':!![]});if(!_0x28fe9b)throw new Error(_0x6cf5('0x4e'));if(_0x28fe9b[_0x6cf5('0x4f')]===_0x6cf5('0x50')){var _0x4b1e36=_0x582d2b[_0x6cf5('0x2a')]({'plain':!![]});var _0x412f31=_0x6cf5('0x2b');return db[_0x6cf5('0x51')][_0x6cf5('0x4c')]({'where':{'name':_0x412f31,'userProfileId':_0x28fe9b['userProfileId']},'raw':!![]})[_0x6cf5('0x28')](function(_0x34e00d){if(_0x34e00d&&_0x34e00d[_0x6cf5('0x52')]===0x0){return db[_0x6cf5('0x2c')]['create']({'name':_0x4b1e36['name'],'resourceId':_0x4b1e36['id'],'type':_0x34e00d['name'],'sectionId':_0x34e00d['id']},{})['then'](function(){return _0x582d2b;});}else{return _0x582d2b;}})[_0x6cf5('0x49')](function(_0x2bac2a){logger[_0x6cf5('0x2e')](_0x6cf5('0x53'),_0x2bac2a);throw _0x2bac2a;});}return _0x582d2b;})[_0x6cf5('0x28')](respondWithResult(_0x31689b,0xc9))[_0x6cf5('0x49')](handleError(_0x31689b,null));};exports[_0x6cf5('0x27')]=function(_0x53bd59,_0x1b9974){if(_0x53bd59[_0x6cf5('0x4d')]['id']){delete _0x53bd59[_0x6cf5('0x4d')]['id'];}return db[_0x6cf5('0x32')]['find']({'where':{'id':_0x53bd59[_0x6cf5('0x54')]['id']}})['then'](handleEntityNotFound(_0x1b9974,null))[_0x6cf5('0x28')](saveUpdates(_0x53bd59[_0x6cf5('0x4d')],null))['then'](respondWithResult(_0x1b9974,null))[_0x6cf5('0x49')](handleError(_0x1b9974,null));};exports[_0x6cf5('0x29')]=function(_0x2e9b5e,_0x2f9220){return db[_0x6cf5('0x32')]['find']({'where':{'id':_0x2e9b5e[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x2f9220,null))[_0x6cf5('0x28')](removeEntity(_0x2f9220,null))['catch'](handleError(_0x2f9220,null));};exports['describe']=function(_0x1e0565,_0x14372f){return db[_0x6cf5('0x32')]['describe']()[_0x6cf5('0x28')](respondWithResult(_0x14372f,null))[_0x6cf5('0x49')](handleError(_0x14372f,null));};exports[_0x6cf5('0x55')]=function(_0x1a2ec9,_0x3278c3,_0x5a5e71){var _0x727186={'raw':!![],'where':{}},_0x44780f={},_0x5139e0;return db[_0x6cf5('0x32')]['findOne']({'where':{'id':_0x1a2ec9['params']['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x3278c3,null))['then'](function(_0x10a388){if(_0x10a388){_0x5139e0=_0x10a388[_0x6cf5('0x2a')]({'plain':!![]});_0x44780f['model']=_[_0x6cf5('0x38')](db[_0x6cf5('0x56')][_0x6cf5('0x33')]);_0x44780f[_0x6cf5('0x37')]=_[_0x6cf5('0x38')](_0x1a2ec9[_0x6cf5('0x37')]);_0x44780f[_0x6cf5('0x39')]=_[_0x6cf5('0x3a')](_0x44780f[_0x6cf5('0x36')],_0x44780f[_0x6cf5('0x37')]);_0x727186['attributes']=_[_0x6cf5('0x3a')](_0x44780f[_0x6cf5('0x36')],qs[_0x6cf5('0x3c')](_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x3c')]));_0x727186[_0x6cf5('0x3b')]=_0x727186[_0x6cf5('0x3b')][_0x6cf5('0x3d')]?_0x727186['attributes']:_0x44780f[_0x6cf5('0x36')];if(!_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x3e')]('nolimit')){_0x727186[_0x6cf5('0x21')]=qs[_0x6cf5('0x21')](_0x1a2ec9[_0x6cf5('0x37')]['limit']);_0x727186[_0x6cf5('0x1f')]=qs['offset'](_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x1f')]);}_0x727186[_0x6cf5('0x3f')]=qs['sort'](_0x1a2ec9[_0x6cf5('0x37')]['sort']);_0x727186[_0x6cf5('0x41')]=qs[_0x6cf5('0x39')](_[_0x6cf5('0x57')](_0x1a2ec9[_0x6cf5('0x37')],_0x44780f['filters']));_0x727186['where']['OpenchannelQueueId']=_0x10a388['id'];if(_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x42')]){_0x727186[_0x6cf5('0x41')]=_[_0x6cf5('0x44')](_0x727186[_0x6cf5('0x41')],{'$or':_[_0x6cf5('0x31')](_0x727186[_0x6cf5('0x3b')],function(_0x396876){var _0x306457={};_0x306457[_0x396876]={'$like':'%'+_0x1a2ec9[_0x6cf5('0x37')][_0x6cf5('0x42')]+'%'};return _0x306457;})});}_0x727186=_[_0x6cf5('0x44')]({},_0x727186,_0x1a2ec9[_0x6cf5('0x45')]);return db[_0x6cf5('0x56')][_0x6cf5('0x47')](_0x727186);}})[_0x6cf5('0x28')](function(_0x22531f){if(_0x22531f){return db[_0x6cf5('0x58')][_0x6cf5('0x59')]({'where':{'id':_['map'](_0x22531f,_0x6cf5('0x5a')),'role':_0x6cf5('0x5b')},'attributes':['id',_0x6cf5('0x30'),_0x6cf5('0x5c'),'updatedAt',_0x6cf5('0x5d')]});}})[_0x6cf5('0x28')](function(_0x2fd560){if(_0x2fd560){return{'count':_0x2fd560[_0x6cf5('0x22')],'rows':_['map'](_0x2fd560['rows'],function(_0x2be9f5){return{'membername':_0x2be9f5['name'],'UserId':_0x2be9f5['id'],'queue_name':_0x5139e0['name'],'OpenchannelQueueId':_0x5139e0['id'],'interface':util[_0x6cf5('0x5e')](_0x6cf5('0x5f'),_0x6cf5('0x60'),_0x2be9f5[_0x6cf5('0x30')]),'penalty':0x0,'paused':_0x2be9f5[_0x6cf5('0x5c')],'createdAt':_0x2be9f5[_0x6cf5('0x5d')],'updatedAt':_0x2be9f5[_0x6cf5('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3278c3,_0x727186))[_0x6cf5('0x49')](handleError(_0x3278c3,null));};exports[_0x6cf5('0x62')]=function(_0x1c2868,_0x3ddb78,_0x5451d1){var _0x516947={};var _0x1ff2bf={};var _0x2d1fce;var _0x45e7a3;return db[_0x6cf5('0x32')]['findOne']({'where':{'id':_0x1c2868[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x3ddb78,null))[_0x6cf5('0x28')](function(_0x2b9f){if(_0x2b9f){_0x2d1fce=_0x2b9f;_0x1ff2bf[_0x6cf5('0x36')]=_['keys'](db['Team']['rawAttributes']);_0x1ff2bf[_0x6cf5('0x37')]=_[_0x6cf5('0x38')](_0x1c2868[_0x6cf5('0x37')]);_0x1ff2bf[_0x6cf5('0x39')]=_[_0x6cf5('0x3a')](_0x1ff2bf[_0x6cf5('0x36')],_0x1ff2bf[_0x6cf5('0x37')]);_0x516947['attributes']=_[_0x6cf5('0x3a')](_0x1ff2bf[_0x6cf5('0x36')],qs[_0x6cf5('0x3c')](_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x3c')]));_0x516947['attributes']=_0x516947[_0x6cf5('0x3b')][_0x6cf5('0x3d')]?_0x516947['attributes']:_0x1ff2bf[_0x6cf5('0x36')];_0x516947[_0x6cf5('0x3f')]=qs[_0x6cf5('0x40')](_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x40')]);_0x516947[_0x6cf5('0x41')]=qs[_0x6cf5('0x39')](_[_0x6cf5('0x57')](_0x1c2868[_0x6cf5('0x37')],_0x1ff2bf['filters']));if(_0x1c2868['query'][_0x6cf5('0x42')]){_0x516947[_0x6cf5('0x41')]=_[_0x6cf5('0x44')](_0x516947[_0x6cf5('0x41')],{'$or':_[_0x6cf5('0x31')](_0x516947[_0x6cf5('0x3b')],function(_0x519821){var _0x4d7da0={};_0x4d7da0[_0x519821]={'$like':'%'+_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x42')]+'%'};return _0x4d7da0;})});}_0x516947=_[_0x6cf5('0x44')]({},_0x516947,_0x1c2868[_0x6cf5('0x45')]);return _0x2d1fce['getTeams'](_0x516947);}})[_0x6cf5('0x28')](function(_0xfc0692){if(_0xfc0692){_0x45e7a3=_0xfc0692[_0x6cf5('0x3d')];if(!_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x3e')](_0x6cf5('0x63'))){_0x516947[_0x6cf5('0x21')]=qs[_0x6cf5('0x21')](_0x1c2868[_0x6cf5('0x37')][_0x6cf5('0x21')]);_0x516947[_0x6cf5('0x1f')]=qs[_0x6cf5('0x1f')](_0x1c2868[_0x6cf5('0x37')]['offset']);}return _0x2d1fce[_0x6cf5('0x62')](_0x516947);}})[_0x6cf5('0x28')](function(_0x1c0892){if(_0x1c0892){return _0x1c0892?{'count':_0x45e7a3,'rows':_0x1c0892}:null;}})[_0x6cf5('0x28')](respondWithResult(_0x3ddb78,null))['catch'](handleError(_0x3ddb78,null));};exports[_0x6cf5('0x64')]=function(_0x14fb8c,_0xf07884,_0x29906f){var _0x369a10=_0x14fb8c[_0x6cf5('0x4d')][_0x6cf5('0x65')];return db[_0x6cf5('0x66')]['findAll']({'where':{'id':_0x369a10},'attributes':['id'],'include':[{'model':db[_0x6cf5('0x58')],'as':_0x6cf5('0x67'),'attributes':['id','name',_0x6cf5('0x68'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x259f26){if(_0x259f26){var _0x436bec=_['flatMap'](_0x259f26,function(_0x17dac6){var _0x3d4799=_0x17dac6[_0x6cf5('0x2a')]({'plain':!![]});return _0x3d4799[_0x6cf5('0x67')];});return db['OpenchannelQueue'][_0x6cf5('0x4c')]({'where':{'id':_0x14fb8c[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](function(_0x3815b3){return db['sequelize']['transaction'](function(_0x34ab9a){return _0x3815b3[_0x6cf5('0x64')](_0x369a10,{'transaction':_0x34ab9a})[_0x6cf5('0x28')](function(){return BPromise[_0x6cf5('0x69')](_0x436bec,function(_0x3e665f){return db[_0x6cf5('0x56')][_0x6cf5('0x6a')]({'where':{'UserId':_0x3e665f['id'],'OpenchannelQueueId':_0x14fb8c[_0x6cf5('0x54')]['id']},'transaction':_0x34ab9a});});})[_0x6cf5('0x28')](function(){_0x436bec['forEach'](function(_0x5b7be1){socket[_0x6cf5('0x6b')](_0x6cf5('0x6c'),{'UserId':_0x5b7be1['id'],'OpenchannelQueueId':_0x3815b3['id']});});});});});}})[_0x6cf5('0x28')](respondWithStatusCode(_0xf07884,null))[_0x6cf5('0x49')](handleError(_0xf07884,null));};exports[_0x6cf5('0x6d')]=function(_0x309c98,_0x57bc16,_0xa760c9){return db[_0x6cf5('0x66')][_0x6cf5('0x47')]({'where':{'id':_0x309c98[_0x6cf5('0x37')][_0x6cf5('0x65')]},'attributes':['id'],'include':[{'model':db[_0x6cf5('0x58')],'as':_0x6cf5('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x57bc16,null))[_0x6cf5('0x28')](function(_0x46567){var _0x3c51ee=_['map'](_0x46567,'id');var _0x109324=[];var _0x1eb360=[];var _0x2169f0=squel[_0x6cf5('0x6e')]();_0x2169f0[_0x6cf5('0x6f')](_0x6cf5('0x70'))['from'](_0x6cf5('0x71'),'tq')[_0x6cf5('0x72')](_0x6cf5('0x73'),'ut',_0x6cf5('0x74'))['where'](_0x6cf5('0x75'),_0x309c98[_0x6cf5('0x54')]['id']);for(var _0x2ff7e7=0x0;_0x2ff7e7<_0x46567[_0x6cf5('0x3d')];_0x2ff7e7+=0x1){let _0x11229d=_0x46567[_0x2ff7e7];for(var _0x5b1835=0x0;_0x5b1835<_0x11229d[_0x6cf5('0x67')][_0x6cf5('0x3d')];_0x5b1835+=0x1){let _0x57fe71=_0x11229d[_0x6cf5('0x67')][_0x5b1835];var _0x597690=_0x2169f0[_0x6cf5('0x76')]();_0x597690[_0x6cf5('0x41')](_0x6cf5('0x77'),_0x57fe71['id']);_0x1eb360[_0x6cf5('0x78')](db[_0x6cf5('0x79')][_0x6cf5('0x37')](_0x597690[_0x6cf5('0x7a')](),{'type':db[_0x6cf5('0x79')]['QueryTypes']['SELECT']})[_0x6cf5('0x28')](function(_0xc4ef5){if(_0xc4ef5[_0x6cf5('0x3d')]===0x1){return _0x57fe71['id'];}else{var _0x567dc2=_[_0x6cf5('0x7b')](_[_0x6cf5('0x31')](_0xc4ef5,_0x6cf5('0x7c')),function(_0x398229){return _[_0x6cf5('0x7d')](_0x3c51ee,_0x398229);});if(_0x567dc2){return _0x57fe71['id'];}}}));}}return BPromise['all'](_0x1eb360)['then'](function(_0x38d90a){_0x109324=_(_0x109324)[_0x6cf5('0x7e')](_0x38d90a)['compact']()['value']();return db['OpenchannelQueue'][_0x6cf5('0x4c')]({'where':{'id':_0x309c98[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](function(_0x56fe8b){return db[_0x6cf5('0x79')][_0x6cf5('0x7f')](function(_0x476556){return _0x56fe8b[_0x6cf5('0x6d')](_0x309c98[_0x6cf5('0x37')][_0x6cf5('0x65')],{'transaction':_0x476556})['then'](function(){if(!_['isEmpty'](_0x109324)){return _0x56fe8b[_0x6cf5('0x80')](_0x109324,{'transaction':_0x476556});}})[_0x6cf5('0x28')](function(){_0x109324[_0x6cf5('0x81')](function(_0x5a0a2e){socket[_0x6cf5('0x6b')](_0x6cf5('0x82'),{'UserId':_0x5a0a2e,'OpenchannelQueueId':_0x56fe8b['id']});});});});});});})['then'](respondWithStatusCode(_0x57bc16,null))['catch'](handleError(_0x57bc16,null));};exports['addAgents']=function(_0x36c601,_0x392a43,_0x125f96){return db['OpenchannelQueue'][_0x6cf5('0x4c')]({'where':{'id':_0x36c601[_0x6cf5('0x54')]['id']}})['then'](handleEntityNotFound(_0x392a43,null))['then'](function(_0xe08c97){if(_0xe08c97){return _0xe08c97[_0x6cf5('0x83')](_0x36c601[_0x6cf5('0x4d')][_0x6cf5('0x65')],_[_0x6cf5('0x84')](_0x36c601[_0x6cf5('0x4d')],['ids','id'])||{})[_0x6cf5('0x85')](function(_0x46a77d){for(var _0x58859d=0x0;_0x58859d<_0x36c601[_0x6cf5('0x4d')][_0x6cf5('0x65')]['length'];_0x58859d+=0x1){socket[_0x6cf5('0x6b')](_0x6cf5('0x6c'),{'UserId':Number(_0x36c601[_0x6cf5('0x4d')][_0x6cf5('0x65')][_0x58859d]),'OpenchannelQueueId':Number(_0x36c601[_0x6cf5('0x54')]['id'])});}return _0x46a77d;});}})[_0x6cf5('0x28')](respondWithResult(_0x392a43,null))[_0x6cf5('0x49')](handleError(_0x392a43,null));};exports['removeAgents']=function(_0x4b0f53,_0x3d3224,_0x3b86ce){return db[_0x6cf5('0x32')][_0x6cf5('0x4c')]({'where':{'id':_0x4b0f53[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x3d3224,null))['then'](function(_0xb3dd24){if(_0xb3dd24){return _0xb3dd24[_0x6cf5('0x80')](_0x4b0f53['query'][_0x6cf5('0x65')])[_0x6cf5('0x28')](function(){if(_['isArray'](_0x4b0f53[_0x6cf5('0x37')][_0x6cf5('0x65')])){for(var _0x5f0b23=0x0;_0x5f0b23<_0x4b0f53['query']['ids'][_0x6cf5('0x3d')];_0x5f0b23+=0x1){socket[_0x6cf5('0x6b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4b0f53[_0x6cf5('0x37')]['ids'][_0x5f0b23]),'OpenchannelQueueId':Number(_0x4b0f53[_0x6cf5('0x54')]['id'])});}}else{socket[_0x6cf5('0x6b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4b0f53['query'][_0x6cf5('0x65')]),'OpenchannelQueueId':Number(_0x4b0f53[_0x6cf5('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x3d3224,null))[_0x6cf5('0x49')](handleError(_0x3d3224,null));};exports[_0x6cf5('0x86')]=function(_0x1e1caa,_0x1434f1,_0x2fd2ef){var _0xba39fe={};var _0x2be56e={};var _0x512f03;var _0x4c933c;return db[_0x6cf5('0x32')][_0x6cf5('0x87')]({'where':{'id':_0x1e1caa[_0x6cf5('0x54')]['id']}})[_0x6cf5('0x28')](handleEntityNotFound(_0x1434f1,null))[_0x6cf5('0x28')](function(_0x43dd40){if(_0x43dd40){_0x512f03=_0x43dd40;_0x2be56e[_0x6cf5('0x36')]=_[_0x6cf5('0x38')](db[_0x6cf5('0x58')][_0x6cf5('0x33')]);_0x2be56e[_0x6cf5('0x37')]=_['keys'](_0x1e1caa['query']);_0x2be56e['filters']=_[_0x6cf5('0x3a')](_0x2be56e[_0x6cf5('0x36')],_0x2be56e['query']);_0xba39fe['attributes']=_[_0x6cf5('0x3a')](_0x2be56e['model'],qs[_0x6cf5('0x3c')](_0x1e1caa[_0x6cf5('0x37')]['fields']));_0xba39fe[_0x6cf5('0x3b')]=_0xba39fe['attributes'][_0x6cf5('0x3d')]?_0xba39fe[_0x6cf5('0x3b')]:_0x2be56e[_0x6cf5('0x36')];_0xba39fe[_0x6cf5('0x3f')]=qs[_0x6cf5('0x40')](_0x1e1caa[_0x6cf5('0x37')]['sort']);_0xba39fe['where']=qs[_0x6cf5('0x39')](_[_0x6cf5('0x57')](_0x1e1caa['query'],_0x2be56e[_0x6cf5('0x39')]));if(_0x1e1caa[_0x6cf5('0x37')][_0x6cf5('0x42')]){_0xba39fe[_0x6cf5('0x41')]=_[_0x6cf5('0x44')](_0xba39fe[_0x6cf5('0x41')],{'$or':_[_0x6cf5('0x31')](_0xba39fe[_0x6cf5('0x3b')],function(_0x33c318){var _0x2ae56a={};_0x2ae56a[_0x33c318]={'$like':'%'+_0x1e1caa[_0x6cf5('0x37')][_0x6cf5('0x42')]+'%'};return _0x2ae56a;})});}_0xba39fe=_[_0x6cf5('0x44')]({},_0xba39fe,_0x1e1caa[_0x6cf5('0x45')]);return _0x512f03[_0x6cf5('0x86')](_0xba39fe);}})[_0x6cf5('0x28')](function(_0x1d4b0c){if(_0x1d4b0c){_0x4c933c=_0x1d4b0c['length'];if(!_0x1e1caa[_0x6cf5('0x37')][_0x6cf5('0x3e')](_0x6cf5('0x63'))){_0xba39fe[_0x6cf5('0x21')]=qs[_0x6cf5('0x21')](_0x1e1caa[_0x6cf5('0x37')][_0x6cf5('0x21')]);_0xba39fe[_0x6cf5('0x1f')]=qs[_0x6cf5('0x1f')](_0x1e1caa['query'][_0x6cf5('0x1f')]);}return _0x512f03[_0x6cf5('0x86')](_0xba39fe);}})['then'](function(_0x244587){if(_0x244587){return _0x244587?{'count':_0x4c933c,'rows':_0x244587}:null;}})['then'](respondWithResult(_0x1434f1,null))[_0x6cf5('0x49')](handleError(_0x1434f1,null));}; \ No newline at end of file +var _0xfe21=['then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','keys','find','catch','create','body','user','role','userProfileId','autoAssociation','update','params','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','%s/%s','createdAt','getTeams','Team','ids','online','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','Agents','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','omit','spread','userOpenchannelQueue:save','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','reject','save'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xfe21,0x64));var _0x1fe2=function(_0x2eb3e1,_0x5a950c){_0x2eb3e1=_0x2eb3e1-0x0;var _0x33f1ac=_0xfe21[_0x2eb3e1];return _0x33f1ac;};'use strict';var emlformat=require(_0x1fe2('0x0'));var rimraf=require(_0x1fe2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fe2('0x2'));var rp=require(_0x1fe2('0x3'));var moment=require(_0x1fe2('0x4'));var BPromise=require(_0x1fe2('0x5'));var Mustache=require('mustache');var util=require(_0x1fe2('0x6'));var path=require(_0x1fe2('0x7'));var sox=require(_0x1fe2('0x8'));var csv=require('to-csv');var ejs=require(_0x1fe2('0x9'));var fs=require('fs');var fs_extra=require(_0x1fe2('0xa'));var _=require('lodash');var squel=require(_0x1fe2('0xb'));var crypto=require('crypto');var jsforce=require(_0x1fe2('0xc'));var deskjs=require(_0x1fe2('0xd'));var toCsv=require(_0x1fe2('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1fe2('0xf'));var authService=require(_0x1fe2('0x10'));var qs=require(_0x1fe2('0x11'));var as=require(_0x1fe2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fe2('0x13'))(_0x1fe2('0x14'));var utils=require('../../config/utils');var config=require(_0x1fe2('0x15'));var licenseUtil=require(_0x1fe2('0x16'));var db=require(_0x1fe2('0x17'))['db'];config[_0x1fe2('0x18')]=_[_0x1fe2('0x19')](config[_0x1fe2('0x18')],{'host':_0x1fe2('0x1a'),'port':0x18eb});var socket=require(_0x1fe2('0x1b'))(new Redis(config[_0x1fe2('0x18')]));require(_0x1fe2('0x1c'))['register'](socket);function respondWithStatusCode(_0x51b082,_0x330a45){_0x330a45=_0x330a45||0xcc;return function(_0x1e0b1c){if(_0x1e0b1c){return _0x51b082[_0x1fe2('0x1d')](_0x330a45);}return _0x51b082['status'](_0x330a45)[_0x1fe2('0x1e')]();};}function respondWithResult(_0x4a9cad,_0xc4b291){_0xc4b291=_0xc4b291||0xc8;return function(_0x32d23b){if(_0x32d23b){return _0x4a9cad[_0x1fe2('0x1f')](_0xc4b291)[_0x1fe2('0x20')](_0x32d23b);}};}function respondWithFilteredResult(_0x40de6e,_0x348b20){return function(_0x100055){if(_0x100055){var _0x3e3210=typeof _0x348b20[_0x1fe2('0x21')]==='undefined'&&typeof _0x348b20[_0x1fe2('0x22')]==='undefined';var _0x1729cf=_0x100055[_0x1fe2('0x23')];var _0x1aebdb=_0x3e3210?0x0:_0x348b20[_0x1fe2('0x21')];var _0x1c31e5=_0x3e3210?_0x100055[_0x1fe2('0x23')]:_0x348b20['offset']+_0x348b20[_0x1fe2('0x22')];var _0x3dd471;if(_0x1c31e5>=_0x1729cf){_0x1c31e5=_0x1729cf;_0x3dd471=0xc8;}else{_0x3dd471=0xce;}_0x40de6e[_0x1fe2('0x1f')](_0x3dd471);return _0x40de6e[_0x1fe2('0x24')](_0x1fe2('0x25'),_0x1aebdb+'-'+_0x1c31e5+'/'+_0x1729cf)[_0x1fe2('0x20')](_0x100055);}return null;};}function patchUpdates(_0x5b1918){return function(_0xb4f432){try{jsonpatch[_0x1fe2('0x26')](_0xb4f432,_0x5b1918,!![]);}catch(_0x45039e){return BPromise[_0x1fe2('0x27')](_0x45039e);}return _0xb4f432[_0x1fe2('0x28')]();};}function saveUpdates(_0x23512e,_0x4a8371){return function(_0x4bb07d){if(_0x4bb07d){return _0x4bb07d['update'](_0x23512e)[_0x1fe2('0x29')](function(_0xebab06){return _0xebab06;});}return null;};}function removeEntity(_0x59dcd2,_0x235e5c){return function(_0x22216f){if(_0x22216f){return _0x22216f[_0x1fe2('0x2a')]()['then'](function(){var _0x5a4cc6=_0x22216f[_0x1fe2('0x2b')]({'plain':!![]});var _0x502d78=_0x1fe2('0x2c');return db[_0x1fe2('0x2d')][_0x1fe2('0x2a')]({'where':{'type':_0x502d78,'resourceId':_0x5a4cc6['id']}})[_0x1fe2('0x29')](function(){return _0x22216f;});})[_0x1fe2('0x29')](function(){_0x59dcd2[_0x1fe2('0x1f')](0xcc)[_0x1fe2('0x1e')]();});}};}function handleEntityNotFound(_0x20cb72,_0x5ff517){return function(_0x2c509a){if(!_0x2c509a){_0x20cb72[_0x1fe2('0x1d')](0x194);}return _0x2c509a;};}function handleError(_0x522405,_0x56f8b0){_0x56f8b0=_0x56f8b0||0x1f4;return function(_0x712c9f){logger[_0x1fe2('0x2e')](_0x712c9f[_0x1fe2('0x2f')]);if(_0x712c9f[_0x1fe2('0x30')]){delete _0x712c9f[_0x1fe2('0x30')];}_0x522405[_0x1fe2('0x1f')](_0x56f8b0)[_0x1fe2('0x31')](_0x712c9f);};}exports[_0x1fe2('0x32')]=function(_0x492a1a,_0x4a45e5){var _0x2e0c73={},_0x327614={},_0x32d9f8={'count':0x0,'rows':[]};var _0x57f3d8=_[_0x1fe2('0x33')](db[_0x1fe2('0x34')][_0x1fe2('0x35')],function(_0x5aaaba){return{'name':_0x5aaaba[_0x1fe2('0x36')],'type':_0x5aaaba[_0x1fe2('0x37')][_0x1fe2('0x38')]};});_0x327614[_0x1fe2('0x39')]=_['map'](_0x57f3d8,_0x1fe2('0x30'));_0x327614['query']=_['keys'](_0x492a1a[_0x1fe2('0x3a')]);_0x327614['filters']=_[_0x1fe2('0x3b')](_0x327614[_0x1fe2('0x39')],_0x327614[_0x1fe2('0x3a')]);_0x2e0c73[_0x1fe2('0x3c')]=_[_0x1fe2('0x3b')](_0x327614[_0x1fe2('0x39')],qs[_0x1fe2('0x3d')](_0x492a1a[_0x1fe2('0x3a')][_0x1fe2('0x3d')]));_0x2e0c73[_0x1fe2('0x3c')]=_0x2e0c73[_0x1fe2('0x3c')][_0x1fe2('0x3e')]?_0x2e0c73[_0x1fe2('0x3c')]:_0x327614['model'];if(!_0x492a1a[_0x1fe2('0x3a')][_0x1fe2('0x3f')](_0x1fe2('0x40'))){_0x2e0c73[_0x1fe2('0x22')]=qs['limit'](_0x492a1a[_0x1fe2('0x3a')][_0x1fe2('0x22')]);_0x2e0c73['offset']=qs['offset'](_0x492a1a[_0x1fe2('0x3a')][_0x1fe2('0x21')]);}_0x2e0c73[_0x1fe2('0x41')]=qs['sort'](_0x492a1a[_0x1fe2('0x3a')][_0x1fe2('0x42')]);_0x2e0c73[_0x1fe2('0x43')]=qs[_0x1fe2('0x44')](_[_0x1fe2('0x45')](_0x492a1a['query'],_0x327614[_0x1fe2('0x44')]),_0x57f3d8);if(_0x492a1a[_0x1fe2('0x3a')]['filter']){_0x2e0c73[_0x1fe2('0x43')]=_[_0x1fe2('0x46')](_0x2e0c73['where'],{'$or':_['map'](_0x57f3d8,function(_0x531a74){if(_0x531a74[_0x1fe2('0x37')]!==_0x1fe2('0x47')){var _0x2fd9c4={};_0x2fd9c4[_0x531a74['name']]={'$like':'%'+_0x492a1a[_0x1fe2('0x3a')][_0x1fe2('0x48')]+'%'};return _0x2fd9c4;}})});}_0x2e0c73=_[_0x1fe2('0x46')]({},_0x2e0c73,_0x492a1a[_0x1fe2('0x49')]);var _0x178d55={'where':_0x2e0c73[_0x1fe2('0x43')]};return db['OpenchannelQueue'][_0x1fe2('0x23')](_0x178d55)[_0x1fe2('0x29')](function(_0x486a14){_0x32d9f8[_0x1fe2('0x23')]=_0x486a14;if(_0x492a1a[_0x1fe2('0x3a')][_0x1fe2('0x4a')]){_0x2e0c73[_0x1fe2('0x4b')]=[{'all':!![]}];}return db[_0x1fe2('0x34')]['findAll'](_0x2e0c73);})[_0x1fe2('0x29')](function(_0x297fdc){_0x32d9f8['rows']=_0x297fdc;return _0x32d9f8;})[_0x1fe2('0x29')](respondWithFilteredResult(_0x4a45e5,_0x2e0c73))['catch'](handleError(_0x4a45e5,null));};exports['show']=function(_0x135eb9,_0x546ce5){var _0x2d89ec={'raw':!![],'where':{'id':_0x135eb9['params']['id']}},_0x374f05={};_0x374f05[_0x1fe2('0x39')]=_['keys'](db[_0x1fe2('0x34')][_0x1fe2('0x35')]);_0x374f05[_0x1fe2('0x3a')]=_[_0x1fe2('0x4c')](_0x135eb9[_0x1fe2('0x3a')]);_0x374f05[_0x1fe2('0x44')]=_[_0x1fe2('0x3b')](_0x374f05['model'],_0x374f05[_0x1fe2('0x3a')]);_0x2d89ec[_0x1fe2('0x3c')]=_['intersection'](_0x374f05[_0x1fe2('0x39')],qs[_0x1fe2('0x3d')](_0x135eb9[_0x1fe2('0x3a')]['fields']));_0x2d89ec[_0x1fe2('0x3c')]=_0x2d89ec['attributes'][_0x1fe2('0x3e')]?_0x2d89ec[_0x1fe2('0x3c')]:_0x374f05[_0x1fe2('0x39')];if(_0x135eb9['query'][_0x1fe2('0x4a')]){_0x2d89ec[_0x1fe2('0x4b')]=[{'all':!![]}];}_0x2d89ec=_[_0x1fe2('0x46')]({},_0x2d89ec,_0x135eb9[_0x1fe2('0x49')]);return db[_0x1fe2('0x34')][_0x1fe2('0x4d')](_0x2d89ec)[_0x1fe2('0x29')](handleEntityNotFound(_0x546ce5,null))[_0x1fe2('0x29')](respondWithResult(_0x546ce5,null))[_0x1fe2('0x4e')](handleError(_0x546ce5,null));};exports[_0x1fe2('0x4f')]=function(_0x5dd626,_0x3d96a7){return db[_0x1fe2('0x34')][_0x1fe2('0x4f')](_0x5dd626[_0x1fe2('0x50')],{})[_0x1fe2('0x29')](function(_0x4a00d6){var _0x99156a=_0x5dd626[_0x1fe2('0x51')][_0x1fe2('0x2b')]({'plain':!![]});if(!_0x99156a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x99156a[_0x1fe2('0x52')]===_0x1fe2('0x51')){var _0x28f223=_0x4a00d6[_0x1fe2('0x2b')]({'plain':!![]});var _0x3ebaf7='OpenchannelQueues';return db['UserProfileSection'][_0x1fe2('0x4d')]({'where':{'name':_0x3ebaf7,'userProfileId':_0x99156a[_0x1fe2('0x53')]},'raw':!![]})['then'](function(_0x4f5fb1){if(_0x4f5fb1&&_0x4f5fb1[_0x1fe2('0x54')]===0x0){return db[_0x1fe2('0x2d')][_0x1fe2('0x4f')]({'name':_0x28f223[_0x1fe2('0x30')],'resourceId':_0x28f223['id'],'type':_0x4f5fb1['name'],'sectionId':_0x4f5fb1['id']},{})[_0x1fe2('0x29')](function(){return _0x4a00d6;});}else{return _0x4a00d6;}})['catch'](function(_0x4bdf17){logger[_0x1fe2('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bdf17);throw _0x4bdf17;});}return _0x4a00d6;})[_0x1fe2('0x29')](respondWithResult(_0x3d96a7,0xc9))[_0x1fe2('0x4e')](handleError(_0x3d96a7,null));};exports[_0x1fe2('0x55')]=function(_0x5062e3,_0x551413){if(_0x5062e3[_0x1fe2('0x50')]['id']){delete _0x5062e3[_0x1fe2('0x50')]['id'];}return db[_0x1fe2('0x34')]['find']({'where':{'id':_0x5062e3[_0x1fe2('0x56')]['id']}})['then'](handleEntityNotFound(_0x551413,null))[_0x1fe2('0x29')](saveUpdates(_0x5062e3[_0x1fe2('0x50')],null))['then'](respondWithResult(_0x551413,null))[_0x1fe2('0x4e')](handleError(_0x551413,null));};exports[_0x1fe2('0x2a')]=function(_0x4e3d07,_0x397106){return db['OpenchannelQueue'][_0x1fe2('0x4d')]({'where':{'id':_0x4e3d07[_0x1fe2('0x56')]['id']}})[_0x1fe2('0x29')](handleEntityNotFound(_0x397106,null))[_0x1fe2('0x29')](removeEntity(_0x397106,null))[_0x1fe2('0x4e')](handleError(_0x397106,null));};exports[_0x1fe2('0x57')]=function(_0x515602,_0x3e3d17){return db['OpenchannelQueue'][_0x1fe2('0x57')]()[_0x1fe2('0x29')](respondWithResult(_0x3e3d17,null))[_0x1fe2('0x4e')](handleError(_0x3e3d17,null));};exports[_0x1fe2('0x58')]=function(_0x13ca90,_0x5f531f,_0x34b829){var _0x1c281d={'raw':!![],'where':{}},_0x4a4863={},_0x5547d7;return db['OpenchannelQueue'][_0x1fe2('0x59')]({'where':{'id':_0x13ca90[_0x1fe2('0x56')]['id']}})[_0x1fe2('0x29')](handleEntityNotFound(_0x5f531f,null))[_0x1fe2('0x29')](function(_0x505884){if(_0x505884){_0x5547d7=_0x505884[_0x1fe2('0x2b')]({'plain':!![]});_0x4a4863[_0x1fe2('0x39')]=_[_0x1fe2('0x4c')](db[_0x1fe2('0x5a')][_0x1fe2('0x35')]);_0x4a4863[_0x1fe2('0x3a')]=_['keys'](_0x13ca90[_0x1fe2('0x3a')]);_0x4a4863[_0x1fe2('0x44')]=_['intersection'](_0x4a4863[_0x1fe2('0x39')],_0x4a4863[_0x1fe2('0x3a')]);_0x1c281d['attributes']=_[_0x1fe2('0x3b')](_0x4a4863['model'],qs[_0x1fe2('0x3d')](_0x13ca90[_0x1fe2('0x3a')]['fields']));_0x1c281d['attributes']=_0x1c281d[_0x1fe2('0x3c')][_0x1fe2('0x3e')]?_0x1c281d[_0x1fe2('0x3c')]:_0x4a4863[_0x1fe2('0x39')];if(!_0x13ca90['query'][_0x1fe2('0x3f')]('nolimit')){_0x1c281d[_0x1fe2('0x22')]=qs[_0x1fe2('0x22')](_0x13ca90['query'][_0x1fe2('0x22')]);_0x1c281d[_0x1fe2('0x21')]=qs[_0x1fe2('0x21')](_0x13ca90[_0x1fe2('0x3a')][_0x1fe2('0x21')]);}_0x1c281d[_0x1fe2('0x41')]=qs[_0x1fe2('0x42')](_0x13ca90[_0x1fe2('0x3a')][_0x1fe2('0x42')]);_0x1c281d['where']=qs['filters'](_[_0x1fe2('0x45')](_0x13ca90[_0x1fe2('0x3a')],_0x4a4863[_0x1fe2('0x44')]));_0x1c281d[_0x1fe2('0x43')][_0x1fe2('0x5b')]=_0x505884['id'];if(_0x13ca90[_0x1fe2('0x3a')][_0x1fe2('0x48')]){_0x1c281d[_0x1fe2('0x43')]=_[_0x1fe2('0x46')](_0x1c281d[_0x1fe2('0x43')],{'$or':_[_0x1fe2('0x33')](_0x1c281d[_0x1fe2('0x3c')],function(_0x25a5e1){var _0x146f09={};_0x146f09[_0x25a5e1]={'$like':'%'+_0x13ca90['query'][_0x1fe2('0x48')]+'%'};return _0x146f09;})});}_0x1c281d=_[_0x1fe2('0x46')]({},_0x1c281d,_0x13ca90[_0x1fe2('0x49')]);return db[_0x1fe2('0x5a')][_0x1fe2('0x5c')](_0x1c281d);}})[_0x1fe2('0x29')](function(_0x4acbc6){if(_0x4acbc6){return db[_0x1fe2('0x5d')][_0x1fe2('0x5e')]({'where':{'id':_[_0x1fe2('0x33')](_0x4acbc6,_0x1fe2('0x5f')),'role':_0x1fe2('0x60')},'attributes':['id',_0x1fe2('0x30'),_0x1fe2('0x61'),_0x1fe2('0x62'),'createdAt']});}})[_0x1fe2('0x29')](function(_0x576d1c){if(_0x576d1c){return{'count':_0x576d1c[_0x1fe2('0x23')],'rows':_[_0x1fe2('0x33')](_0x576d1c[_0x1fe2('0x63')],function(_0x46aec0){return{'membername':_0x46aec0[_0x1fe2('0x30')],'UserId':_0x46aec0['id'],'queue_name':_0x5547d7[_0x1fe2('0x30')],'OpenchannelQueueId':_0x5547d7['id'],'interface':util[_0x1fe2('0x64')](_0x1fe2('0x65'),'SIP',_0x46aec0['name']),'penalty':0x0,'paused':_0x46aec0[_0x1fe2('0x61')],'createdAt':_0x46aec0[_0x1fe2('0x66')],'updatedAt':_0x46aec0[_0x1fe2('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5f531f,_0x1c281d))[_0x1fe2('0x4e')](handleError(_0x5f531f,null));};exports[_0x1fe2('0x67')]=function(_0x18f597,_0x766e64,_0x3c71b1){var _0x5001ef={};var _0xba0652={};var _0x407a6f;var _0x3c3fb7;return db[_0x1fe2('0x34')][_0x1fe2('0x59')]({'where':{'id':_0x18f597['params']['id']}})[_0x1fe2('0x29')](handleEntityNotFound(_0x766e64,null))[_0x1fe2('0x29')](function(_0x37c210){if(_0x37c210){_0x407a6f=_0x37c210;_0xba0652[_0x1fe2('0x39')]=_['keys'](db[_0x1fe2('0x68')][_0x1fe2('0x35')]);_0xba0652[_0x1fe2('0x3a')]=_[_0x1fe2('0x4c')](_0x18f597['query']);_0xba0652['filters']=_[_0x1fe2('0x3b')](_0xba0652[_0x1fe2('0x39')],_0xba0652[_0x1fe2('0x3a')]);_0x5001ef['attributes']=_[_0x1fe2('0x3b')](_0xba0652[_0x1fe2('0x39')],qs[_0x1fe2('0x3d')](_0x18f597['query'][_0x1fe2('0x3d')]));_0x5001ef[_0x1fe2('0x3c')]=_0x5001ef['attributes'][_0x1fe2('0x3e')]?_0x5001ef['attributes']:_0xba0652['model'];_0x5001ef[_0x1fe2('0x41')]=qs[_0x1fe2('0x42')](_0x18f597['query'][_0x1fe2('0x42')]);_0x5001ef['where']=qs[_0x1fe2('0x44')](_['pick'](_0x18f597[_0x1fe2('0x3a')],_0xba0652[_0x1fe2('0x44')]));if(_0x18f597[_0x1fe2('0x3a')][_0x1fe2('0x48')]){_0x5001ef['where']=_[_0x1fe2('0x46')](_0x5001ef['where'],{'$or':_['map'](_0x5001ef[_0x1fe2('0x3c')],function(_0x4530cc){var _0x5b8062={};_0x5b8062[_0x4530cc]={'$like':'%'+_0x18f597['query'][_0x1fe2('0x48')]+'%'};return _0x5b8062;})});}_0x5001ef=_[_0x1fe2('0x46')]({},_0x5001ef,_0x18f597[_0x1fe2('0x49')]);return _0x407a6f[_0x1fe2('0x67')](_0x5001ef);}})[_0x1fe2('0x29')](function(_0xfe9d83){if(_0xfe9d83){_0x3c3fb7=_0xfe9d83[_0x1fe2('0x3e')];if(!_0x18f597[_0x1fe2('0x3a')][_0x1fe2('0x3f')](_0x1fe2('0x40'))){_0x5001ef[_0x1fe2('0x22')]=qs[_0x1fe2('0x22')](_0x18f597[_0x1fe2('0x3a')]['limit']);_0x5001ef[_0x1fe2('0x21')]=qs[_0x1fe2('0x21')](_0x18f597['query']['offset']);}return _0x407a6f[_0x1fe2('0x67')](_0x5001ef);}})[_0x1fe2('0x29')](function(_0x35deb6){if(_0x35deb6){return _0x35deb6?{'count':_0x3c3fb7,'rows':_0x35deb6}:null;}})[_0x1fe2('0x29')](respondWithResult(_0x766e64,null))['catch'](handleError(_0x766e64,null));};exports['addTeams']=function(_0x20550d,_0x27db00,_0x55ea77){var _0x5e0a3c=_0x20550d['body'][_0x1fe2('0x69')];return db['Team'][_0x1fe2('0x5c')]({'where':{'id':_0x5e0a3c},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x1fe2('0x6a'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x400268){if(_0x400268){var _0x2ed3f6=_[_0x1fe2('0x6b')](_0x400268,function(_0x20a43e){var _0xead55b=_0x20a43e[_0x1fe2('0x2b')]({'plain':!![]});return _0xead55b['Agents'];});return db[_0x1fe2('0x34')][_0x1fe2('0x4d')]({'where':{'id':_0x20550d[_0x1fe2('0x56')]['id']}})['then'](function(_0x181c02){return db[_0x1fe2('0x6c')][_0x1fe2('0x6d')](function(_0x21b262){return _0x181c02[_0x1fe2('0x6e')](_0x5e0a3c,{'transaction':_0x21b262})[_0x1fe2('0x29')](function(){return BPromise[_0x1fe2('0x6f')](_0x2ed3f6,function(_0x2528fa){return db['UserOpenchannelQueue'][_0x1fe2('0x70')]({'where':{'UserId':_0x2528fa['id'],'OpenchannelQueueId':_0x20550d[_0x1fe2('0x56')]['id']},'transaction':_0x21b262});});})[_0x1fe2('0x29')](function(){_0x2ed3f6[_0x1fe2('0x71')](function(_0x27d767){socket[_0x1fe2('0x72')]('userOpenchannelQueue:save',{'UserId':_0x27d767['id'],'OpenchannelQueueId':_0x181c02['id']});});});});});}})['then'](respondWithStatusCode(_0x27db00,null))[_0x1fe2('0x4e')](handleError(_0x27db00,null));};exports[_0x1fe2('0x73')]=function(_0x141502,_0x48780d,_0xbdad9d){return db[_0x1fe2('0x68')][_0x1fe2('0x5c')]({'where':{'id':_0x141502[_0x1fe2('0x3a')][_0x1fe2('0x69')]},'attributes':['id'],'include':[{'model':db[_0x1fe2('0x5d')],'as':_0x1fe2('0x74'),'attributes':['id'],'raw':!![]}]})[_0x1fe2('0x29')](handleEntityNotFound(_0x48780d,null))['then'](function(_0xcd396a){var _0x4b03b6=_[_0x1fe2('0x33')](_0xcd396a,'id');var _0x404ba9=[];var _0x365aba=[];var _0x2dbbc8=squel[_0x1fe2('0x75')]();_0x2dbbc8[_0x1fe2('0x76')]('tq.TeamId')[_0x1fe2('0x77')]('team_has_openchannel_queues','tq')[_0x1fe2('0x78')](_0x1fe2('0x79'),'ut',_0x1fe2('0x7a'))[_0x1fe2('0x43')](_0x1fe2('0x7b'),_0x141502[_0x1fe2('0x56')]['id']);for(var _0x39a4e7=0x0;_0x39a4e7<_0xcd396a[_0x1fe2('0x3e')];_0x39a4e7+=0x1){let _0x2354c7=_0xcd396a[_0x39a4e7];for(var _0x59c27b=0x0;_0x59c27b<_0x2354c7[_0x1fe2('0x74')][_0x1fe2('0x3e')];_0x59c27b+=0x1){let _0x46546c=_0x2354c7[_0x1fe2('0x74')][_0x59c27b];var _0x383f68=_0x2dbbc8[_0x1fe2('0x7c')]();_0x383f68[_0x1fe2('0x43')](_0x1fe2('0x7d'),_0x46546c['id']);_0x365aba['push'](db[_0x1fe2('0x6c')][_0x1fe2('0x3a')](_0x383f68[_0x1fe2('0x7e')](),{'type':db[_0x1fe2('0x6c')][_0x1fe2('0x7f')]['SELECT']})[_0x1fe2('0x29')](function(_0x2c16a3){if(_0x2c16a3[_0x1fe2('0x3e')]===0x1){return _0x46546c['id'];}else{var _0x5a0ccd=_['every'](_[_0x1fe2('0x33')](_0x2c16a3,_0x1fe2('0x80')),function(_0x344d50){return _[_0x1fe2('0x81')](_0x4b03b6,_0x344d50);});if(_0x5a0ccd){return _0x46546c['id'];}}}));}}return BPromise[_0x1fe2('0x82')](_0x365aba)[_0x1fe2('0x29')](function(_0x205954){_0x404ba9=_(_0x404ba9)[_0x1fe2('0x83')](_0x205954)[_0x1fe2('0x84')]()[_0x1fe2('0x85')]();return db['OpenchannelQueue'][_0x1fe2('0x4d')]({'where':{'id':_0x141502[_0x1fe2('0x56')]['id']}})['then'](function(_0x284356){return db[_0x1fe2('0x6c')]['transaction'](function(_0x29cacf){return _0x284356[_0x1fe2('0x73')](_0x141502[_0x1fe2('0x3a')][_0x1fe2('0x69')],{'transaction':_0x29cacf})['then'](function(){if(!_[_0x1fe2('0x86')](_0x404ba9)){return _0x284356[_0x1fe2('0x87')](_0x404ba9,{'transaction':_0x29cacf});}})[_0x1fe2('0x29')](function(){_0x404ba9[_0x1fe2('0x71')](function(_0x260bc8){socket[_0x1fe2('0x72')]('userOpenchannelQueue:remove',{'UserId':_0x260bc8,'OpenchannelQueueId':_0x284356['id']});});});});});});})[_0x1fe2('0x29')](respondWithStatusCode(_0x48780d,null))[_0x1fe2('0x4e')](handleError(_0x48780d,null));};exports['addAgents']=function(_0x2fa26b,_0xb27b9f,_0x5e7646){return db['OpenchannelQueue']['find']({'where':{'id':_0x2fa26b[_0x1fe2('0x56')]['id']}})[_0x1fe2('0x29')](handleEntityNotFound(_0xb27b9f,null))['then'](function(_0x446b81){if(_0x446b81){return _0x446b81['addAgents'](_0x2fa26b[_0x1fe2('0x50')][_0x1fe2('0x69')],_[_0x1fe2('0x88')](_0x2fa26b[_0x1fe2('0x50')],[_0x1fe2('0x69'),'id'])||{})[_0x1fe2('0x89')](function(_0x2bfc71){for(var _0xf41ac5=0x0;_0xf41ac5<_0x2fa26b['body']['ids'][_0x1fe2('0x3e')];_0xf41ac5+=0x1){socket[_0x1fe2('0x72')](_0x1fe2('0x8a'),{'UserId':Number(_0x2fa26b[_0x1fe2('0x50')]['ids'][_0xf41ac5]),'OpenchannelQueueId':Number(_0x2fa26b[_0x1fe2('0x56')]['id'])});}return _0x2bfc71;});}})[_0x1fe2('0x29')](respondWithResult(_0xb27b9f,null))['catch'](handleError(_0xb27b9f,null));};exports[_0x1fe2('0x87')]=function(_0x12d84e,_0x20980b,_0x1f7300){return db[_0x1fe2('0x34')]['find']({'where':{'id':_0x12d84e[_0x1fe2('0x56')]['id']}})[_0x1fe2('0x29')](handleEntityNotFound(_0x20980b,null))[_0x1fe2('0x29')](function(_0x45408f){if(_0x45408f){return _0x45408f[_0x1fe2('0x87')](_0x12d84e[_0x1fe2('0x3a')][_0x1fe2('0x69')])[_0x1fe2('0x29')](function(){if(_['isArray'](_0x12d84e[_0x1fe2('0x3a')][_0x1fe2('0x69')])){for(var _0x190747=0x0;_0x190747<_0x12d84e[_0x1fe2('0x3a')]['ids'][_0x1fe2('0x3e')];_0x190747+=0x1){socket[_0x1fe2('0x72')](_0x1fe2('0x8b'),{'UserId':Number(_0x12d84e[_0x1fe2('0x3a')][_0x1fe2('0x69')][_0x190747]),'OpenchannelQueueId':Number(_0x12d84e[_0x1fe2('0x56')]['id'])});}}else{socket[_0x1fe2('0x72')](_0x1fe2('0x8b'),{'UserId':Number(_0x12d84e[_0x1fe2('0x3a')][_0x1fe2('0x69')]),'OpenchannelQueueId':Number(_0x12d84e[_0x1fe2('0x56')]['id'])});}});}})[_0x1fe2('0x29')](respondWithStatusCode(_0x20980b,null))['catch'](handleError(_0x20980b,null));};exports['getAgents']=function(_0x15d7ff,_0x38b142,_0x5c3231){var _0x427083={};var _0x357d4d={};var _0x43464c;var _0x3b1c0b;return db[_0x1fe2('0x34')]['findOne']({'where':{'id':_0x15d7ff['params']['id']}})[_0x1fe2('0x29')](handleEntityNotFound(_0x38b142,null))[_0x1fe2('0x29')](function(_0x41c68c){if(_0x41c68c){_0x43464c=_0x41c68c;_0x357d4d['model']=_[_0x1fe2('0x4c')](db[_0x1fe2('0x5d')]['rawAttributes']);_0x357d4d[_0x1fe2('0x3a')]=_[_0x1fe2('0x4c')](_0x15d7ff[_0x1fe2('0x3a')]);_0x357d4d[_0x1fe2('0x44')]=_[_0x1fe2('0x3b')](_0x357d4d[_0x1fe2('0x39')],_0x357d4d['query']);_0x427083[_0x1fe2('0x3c')]=_[_0x1fe2('0x3b')](_0x357d4d[_0x1fe2('0x39')],qs[_0x1fe2('0x3d')](_0x15d7ff[_0x1fe2('0x3a')][_0x1fe2('0x3d')]));_0x427083[_0x1fe2('0x3c')]=_0x427083[_0x1fe2('0x3c')][_0x1fe2('0x3e')]?_0x427083[_0x1fe2('0x3c')]:_0x357d4d[_0x1fe2('0x39')];_0x427083[_0x1fe2('0x41')]=qs[_0x1fe2('0x42')](_0x15d7ff[_0x1fe2('0x3a')][_0x1fe2('0x42')]);_0x427083['where']=qs[_0x1fe2('0x44')](_[_0x1fe2('0x45')](_0x15d7ff[_0x1fe2('0x3a')],_0x357d4d['filters']));if(_0x15d7ff[_0x1fe2('0x3a')]['filter']){_0x427083['where']=_[_0x1fe2('0x46')](_0x427083[_0x1fe2('0x43')],{'$or':_[_0x1fe2('0x33')](_0x427083['attributes'],function(_0x2cfbfa){var _0x1e90ab={};_0x1e90ab[_0x2cfbfa]={'$like':'%'+_0x15d7ff[_0x1fe2('0x3a')][_0x1fe2('0x48')]+'%'};return _0x1e90ab;})});}_0x427083=_['merge']({},_0x427083,_0x15d7ff[_0x1fe2('0x49')]);return _0x43464c[_0x1fe2('0x8c')](_0x427083);}})[_0x1fe2('0x29')](function(_0x243243){if(_0x243243){_0x3b1c0b=_0x243243['length'];if(!_0x15d7ff[_0x1fe2('0x3a')]['hasOwnProperty'](_0x1fe2('0x40'))){_0x427083[_0x1fe2('0x22')]=qs[_0x1fe2('0x22')](_0x15d7ff[_0x1fe2('0x3a')]['limit']);_0x427083[_0x1fe2('0x21')]=qs[_0x1fe2('0x21')](_0x15d7ff[_0x1fe2('0x3a')][_0x1fe2('0x21')]);}return _0x43464c['getAgents'](_0x427083);}})[_0x1fe2('0x29')](function(_0x5c355b){if(_0x5c355b){return _0x5c355b?{'count':_0x3b1c0b,'rows':_0x5c355b}:null;}})['then'](respondWithResult(_0x38b142,null))['catch'](handleError(_0x38b142,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6330bde..40ea3d3 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 _0xeca8=['OpenchannelQueue','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xeca8,0x193));var _0x8eca=function(_0x2dcc88,_0xc89492){_0x2dcc88=_0x2dcc88-0x0;var _0x2a8268=_0xeca8[_0x2dcc88];return _0x2a8268;};'use strict';var EventEmitter=require(_0x8eca('0x0'));var OpenchannelQueue=require(_0x8eca('0x1'))['db'][_0x8eca('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8eca('0x3'),'afterUpdate':'update','afterDestroy':_0x8eca('0x4')};function emitEvent(_0xf522e0){return function(_0x3f4392,_0x1c1ce3,_0x43e4f3){OpenchannelQueueEvents[_0x8eca('0x5')](_0xf522e0+':'+_0x3f4392['id'],_0x3f4392);OpenchannelQueueEvents['emit'](_0xf522e0,_0x3f4392);_0x43e4f3(null);};}for(var e in events){if(events[_0x8eca('0x6')](e)){var event=events[e];OpenchannelQueue[_0x8eca('0x7')](e,emitEvent(event));}}module[_0x8eca('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xf139=['emit','exports','events','../../mysqldb','OpenchannelQueue','remove'];(function(_0x7702c,_0x196b74){var _0x1b562a=function(_0x322514){while(--_0x322514){_0x7702c['push'](_0x7702c['shift']());}};_0x1b562a(++_0x196b74);}(_0xf139,0x12e));var _0x9f13=function(_0x4fe1df,_0x5b1e24){_0x4fe1df=_0x4fe1df-0x0;var _0x5ca46e=_0xf139[_0x4fe1df];return _0x5ca46e;};'use strict';var EventEmitter=require(_0x9f13('0x0'));var OpenchannelQueue=require(_0x9f13('0x1'))['db'][_0x9f13('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9f13('0x3')};function emitEvent(_0x494788){return function(_0x2ae51b,_0x3f8c14,_0x9001a5){OpenchannelQueueEvents[_0x9f13('0x4')](_0x494788+':'+_0x2ae51b['id'],_0x2ae51b);OpenchannelQueueEvents[_0x9f13('0x4')](_0x494788,_0x2ae51b);_0x9001a5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x9f13('0x5')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index c22cc73..9082382 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 _0x753b=['request-promise','path','rimraf','../../config/environment','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api'];(function(_0xddeb96,_0x1c3406){var _0x1f270c=function(_0x2632ad){while(--_0x2632ad){_0xddeb96['push'](_0xddeb96['shift']());}};_0x1f270c(++_0x1c3406);}(_0x753b,0x11a));var _0xb753=function(_0x2bcf5e,_0x5d9059){_0x2bcf5e=_0x2bcf5e-0x0;var _0x94e486=_0x753b[_0x2bcf5e];return _0x94e486;};'use strict';var _=require(_0xb753('0x0'));var util=require(_0xb753('0x1'));var logger=require(_0xb753('0x2'))(_0xb753('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb753('0x4'));var fs=require('fs');var path=require(_0xb753('0x5'));var rimraf=require(_0xb753('0x6'));var config=require(_0xb753('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xb753('0x8')]=function(_0x5bfc3a,_0x3e1cf8){return _0x5bfc3a['define'](_0xb753('0x9'),attributes,{'tableName':_0xb753('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb67c=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','moment'];(function(_0xb8d9bc,_0x1cea27){var _0x2fbc8e=function(_0x15b2c4){while(--_0x15b2c4){_0xb8d9bc['push'](_0xb8d9bc['shift']());}};_0x2fbc8e(++_0x1cea27);}(_0xb67c,0x1ad));var _0xcb67=function(_0x49fbb1,_0x4e7b6d){_0x49fbb1=_0x49fbb1-0x0;var _0x599efc=_0xb67c[_0x49fbb1];return _0x599efc;};'use strict';var _=require('lodash');var util=require(_0xcb67('0x0'));var logger=require(_0xcb67('0x1'))('api');var moment=require(_0xcb67('0x2'));var BPromise=require(_0xcb67('0x3'));var rp=require(_0xcb67('0x4'));var fs=require('fs');var path=require(_0xcb67('0x5'));var rimraf=require(_0xcb67('0x6'));var config=require(_0xcb67('0x7'));var attributes=require('./openchannelQueue.attributes');module[_0xcb67('0x8')]=function(_0x33c46a,_0x296f71){return _0x33c46a[_0xcb67('0x9')](_0xcb67('0xa'),attributes,{'tableName':_0xcb67('0xb'),'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 4bda98d..dac1936 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 _0xff75=['attributes','map','catch','ShowOpenchannelQueue','find','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','then','info','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','OpenchannelQueue,\x20%s,\x20%s','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','limit','include'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0xff75,0x13e));var _0x5ff7=function(_0x557c0b,_0x19f527){_0x557c0b=_0x557c0b-0x0;var _0x25806a=_0xff75[_0x557c0b];return _0x25806a;};'use strict';var _=require(_0x5ff7('0x0'));var util=require(_0x5ff7('0x1'));var moment=require(_0x5ff7('0x2'));var BPromise=require(_0x5ff7('0x3'));var rs=require(_0x5ff7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ff7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ff7('0x6'));var config=require(_0x5ff7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ff7('0x8')][_0x5ff7('0x9')]({'port':0x232a});config[_0x5ff7('0xa')]=_[_0x5ff7('0xb')](config[_0x5ff7('0xa')],{'host':_0x5ff7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ff7('0xa')]));require(_0x5ff7('0xd'))[_0x5ff7('0xe')](socket);function respondWithRpcPromise(_0x1282f2,_0x1134f2,_0x26bb4a){return new BPromise(function(_0x2b5b4f,_0x5bd076){return client[_0x5ff7('0xf')](_0x1282f2,_0x26bb4a)[_0x5ff7('0x10')](function(_0x1ff2a2){logger[_0x5ff7('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0x1134f2,'request\x20sent');logger[_0x5ff7('0x12')](_0x5ff7('0x13'),_0x1134f2,_0x5ff7('0x14'),JSON[_0x5ff7('0x15')](_0x1ff2a2));if(_0x1ff2a2['error']){if(_0x1ff2a2[_0x5ff7('0x16')]['code']===0x1f4){logger[_0x5ff7('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x1134f2,_0x1ff2a2[_0x5ff7('0x16')][_0x5ff7('0x17')]);return _0x5bd076(_0x1ff2a2['error']['message']);}logger['error'](_0x5ff7('0x18'),_0x1134f2,_0x1ff2a2[_0x5ff7('0x16')][_0x5ff7('0x17')]);return _0x2b5b4f(_0x1ff2a2[_0x5ff7('0x16')][_0x5ff7('0x17')]);}else{logger[_0x5ff7('0x11')](_0x5ff7('0x18'),_0x1134f2,'request\x20sent');_0x2b5b4f(_0x1ff2a2['result'][_0x5ff7('0x17')]);}})['catch'](function(_0x31f28c){logger['error'](_0x5ff7('0x18'),_0x1134f2,_0x31f28c);_0x5bd076(_0x31f28c);});});}exports[_0x5ff7('0x19')]=function(_0x3fd29f){var _0x27907d=this;return new Promise(function(_0x7d891,_0x21a78b){return db[_0x5ff7('0x1a')][_0x5ff7('0x1b')]({'raw':_0x3fd29f[_0x5ff7('0x1c')]?_0x3fd29f[_0x5ff7('0x1c')][_0x5ff7('0x1d')]===undefined?!![]:![]:!![],'where':_0x3fd29f[_0x5ff7('0x1c')]?_0x3fd29f['options'][_0x5ff7('0x1e')]||null:null,'attributes':_0x3fd29f[_0x5ff7('0x1c')]?_0x3fd29f[_0x5ff7('0x1c')]['attributes']||null:null,'limit':_0x3fd29f[_0x5ff7('0x1c')]?_0x3fd29f[_0x5ff7('0x1c')][_0x5ff7('0x1f')]||null:null,'include':_0x3fd29f['options']?_0x3fd29f[_0x5ff7('0x1c')][_0x5ff7('0x20')]?_['map'](_0x3fd29f['options']['include'],function(_0x16379f){return{'model':db[_0x16379f['model']],'as':_0x16379f['as'],'attributes':_0x16379f[_0x5ff7('0x21')],'include':_0x16379f[_0x5ff7('0x20')]?_[_0x5ff7('0x22')](_0x16379f[_0x5ff7('0x20')],function(_0x37bf6c){return{'model':db[_0x37bf6c['model']],'as':_0x37bf6c['as'],'attributes':_0x37bf6c['attributes'],'include':_0x37bf6c[_0x5ff7('0x20')]?_[_0x5ff7('0x22')](_0x37bf6c['include'],function(_0x2ff153){return{'model':db[_0x2ff153['model']],'as':_0x2ff153['as'],'attributes':_0x2ff153[_0x5ff7('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1868d2){logger[_0x5ff7('0x11')](_0x5ff7('0x19'),_0x3fd29f);logger['debug'](_0x5ff7('0x19'),_0x3fd29f,JSON[_0x5ff7('0x15')](_0x1868d2));_0x7d891(_0x1868d2);})[_0x5ff7('0x23')](function(_0x266bc0){logger[_0x5ff7('0x16')]('GetOpenchannelQueue',_0x266bc0[_0x5ff7('0x17')],_0x3fd29f);_0x21a78b(_0x27907d[_0x5ff7('0x16')](0x1f4,_0x266bc0[_0x5ff7('0x17')]));});});};exports[_0x5ff7('0x24')]=function(_0x49de35){var _0x200914=this;return new Promise(function(_0x5274c3,_0x48a87a){return db['OpenchannelQueue'][_0x5ff7('0x25')]({'raw':_0x49de35['options']?_0x49de35['options'][_0x5ff7('0x1d')]===undefined?!![]:![]:!![],'where':_0x49de35[_0x5ff7('0x1c')]?_0x49de35[_0x5ff7('0x1c')][_0x5ff7('0x1e')]||null:null,'attributes':_0x49de35[_0x5ff7('0x1c')]?_0x49de35[_0x5ff7('0x1c')][_0x5ff7('0x21')]||null:null,'include':_0x49de35[_0x5ff7('0x1c')]?_0x49de35[_0x5ff7('0x1c')]['include']?_[_0x5ff7('0x22')](_0x49de35[_0x5ff7('0x1c')][_0x5ff7('0x20')],function(_0x3e67fc){return{'model':db[_0x3e67fc[_0x5ff7('0x26')]],'as':_0x3e67fc['as'],'attributes':_0x3e67fc[_0x5ff7('0x21')],'include':_0x3e67fc[_0x5ff7('0x20')]?_[_0x5ff7('0x22')](_0x3e67fc[_0x5ff7('0x20')],function(_0x4bfd29){return{'model':db[_0x4bfd29['model']],'as':_0x4bfd29['as'],'attributes':_0x4bfd29[_0x5ff7('0x21')],'include':_0x4bfd29['include']?_[_0x5ff7('0x22')](_0x4bfd29[_0x5ff7('0x20')],function(_0xb62c9e){return{'model':db[_0xb62c9e[_0x5ff7('0x26')]],'as':_0xb62c9e['as'],'attributes':_0xb62c9e[_0x5ff7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5ff7('0x10')](function(_0x4a1c6f){logger[_0x5ff7('0x11')]('ShowOpenchannelQueue',_0x49de35);logger[_0x5ff7('0x12')]('ShowOpenchannelQueue',_0x49de35,JSON['stringify'](_0x4a1c6f));_0x5274c3(_0x4a1c6f);})['catch'](function(_0x5d2765){logger['error']('ShowOpenchannelQueue',_0x5d2765[_0x5ff7('0x17')],_0x49de35);_0x48a87a(_0x200914[_0x5ff7('0x16')](0x1f4,_0x5d2765[_0x5ff7('0x17')]));});});}; \ No newline at end of file +var _0x7bf8=['include','map','model','attributes','GetOpenchannelQueue','debug','stringify','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','OpenchannelQueue','options','where','limit'];(function(_0x3a9856,_0xcaa25c){var _0x5828e2=function(_0x3caa91){while(--_0x3caa91){_0x3a9856['push'](_0x3a9856['shift']());}};_0x5828e2(++_0xcaa25c);}(_0x7bf8,0x183));var _0x87bf=function(_0x589c09,_0x2f07e9){_0x589c09=_0x589c09-0x0;var _0x4a45d5=_0x7bf8[_0x589c09];return _0x4a45d5;};'use strict';var _=require(_0x87bf('0x0'));var util=require(_0x87bf('0x1'));var moment=require(_0x87bf('0x2'));var BPromise=require(_0x87bf('0x3'));var rs=require(_0x87bf('0x4'));var fs=require('fs');var Redis=require(_0x87bf('0x5'));var db=require(_0x87bf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x87bf('0x7'))(_0x87bf('0x8'));var config=require(_0x87bf('0x9'));var jayson=require(_0x87bf('0xa'));var client=jayson[_0x87bf('0xb')][_0x87bf('0xc')]({'port':0x232a});config[_0x87bf('0xd')]=_[_0x87bf('0xe')](config[_0x87bf('0xd')],{'host':_0x87bf('0xf'),'port':0x18eb});var socket=require(_0x87bf('0x10'))(new Redis(config[_0x87bf('0xd')]));require(_0x87bf('0x11'))[_0x87bf('0x12')](socket);function respondWithRpcPromise(_0x592a22,_0x5c8d82,_0x6e35c0){return new BPromise(function(_0x380ed6,_0xba70ac){return client[_0x87bf('0x13')](_0x592a22,_0x6e35c0)[_0x87bf('0x14')](function(_0x40f2e6){logger['info'](_0x87bf('0x15'),_0x5c8d82,_0x87bf('0x16'));logger['debug'](_0x87bf('0x17'),_0x5c8d82,_0x87bf('0x16'),JSON['stringify'](_0x40f2e6));if(_0x40f2e6[_0x87bf('0x18')]){if(_0x40f2e6[_0x87bf('0x18')][_0x87bf('0x19')]===0x1f4){logger[_0x87bf('0x18')](_0x87bf('0x15'),_0x5c8d82,_0x40f2e6['error'][_0x87bf('0x1a')]);return _0xba70ac(_0x40f2e6[_0x87bf('0x18')][_0x87bf('0x1a')]);}logger[_0x87bf('0x18')](_0x87bf('0x15'),_0x5c8d82,_0x40f2e6[_0x87bf('0x18')][_0x87bf('0x1a')]);return _0x380ed6(_0x40f2e6[_0x87bf('0x18')][_0x87bf('0x1a')]);}else{logger[_0x87bf('0x1b')]('OpenchannelQueue,\x20%s,\x20%s',_0x5c8d82,_0x87bf('0x16'));_0x380ed6(_0x40f2e6['result'][_0x87bf('0x1a')]);}})[_0x87bf('0x1c')](function(_0x1f251a){logger['error'](_0x87bf('0x15'),_0x5c8d82,_0x1f251a);_0xba70ac(_0x1f251a);});});}exports['GetOpenchannelQueue']=function(_0x5a5e13){var _0x341041=this;return new Promise(function(_0x1ae247,_0x4cdf03){return db[_0x87bf('0x1d')]['findAll']({'raw':_0x5a5e13[_0x87bf('0x1e')]?_0x5a5e13[_0x87bf('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5a5e13['options']?_0x5a5e13[_0x87bf('0x1e')][_0x87bf('0x1f')]||null:null,'attributes':_0x5a5e13[_0x87bf('0x1e')]?_0x5a5e13['options']['attributes']||null:null,'limit':_0x5a5e13['options']?_0x5a5e13[_0x87bf('0x1e')][_0x87bf('0x20')]||null:null,'include':_0x5a5e13[_0x87bf('0x1e')]?_0x5a5e13[_0x87bf('0x1e')][_0x87bf('0x21')]?_[_0x87bf('0x22')](_0x5a5e13['options'][_0x87bf('0x21')],function(_0x1ffac9){return{'model':db[_0x1ffac9[_0x87bf('0x23')]],'as':_0x1ffac9['as'],'attributes':_0x1ffac9['attributes'],'include':_0x1ffac9[_0x87bf('0x21')]?_['map'](_0x1ffac9[_0x87bf('0x21')],function(_0x41e5ef){return{'model':db[_0x41e5ef[_0x87bf('0x23')]],'as':_0x41e5ef['as'],'attributes':_0x41e5ef[_0x87bf('0x24')],'include':_0x41e5ef['include']?_[_0x87bf('0x22')](_0x41e5ef[_0x87bf('0x21')],function(_0x169b34){return{'model':db[_0x169b34[_0x87bf('0x23')]],'as':_0x169b34['as'],'attributes':_0x169b34[_0x87bf('0x24')]};}):[]};}):[]};}):[]:[]})[_0x87bf('0x14')](function(_0x19603f){logger[_0x87bf('0x1b')](_0x87bf('0x25'),_0x5a5e13);logger[_0x87bf('0x26')](_0x87bf('0x25'),_0x5a5e13,JSON[_0x87bf('0x27')](_0x19603f));_0x1ae247(_0x19603f);})[_0x87bf('0x1c')](function(_0x5b00d2){logger[_0x87bf('0x18')]('GetOpenchannelQueue',_0x5b00d2[_0x87bf('0x1a')],_0x5a5e13);_0x4cdf03(_0x341041['error'](0x1f4,_0x5b00d2[_0x87bf('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x3c55fa){var _0x2e55ab=this;return new Promise(function(_0x2cfb65,_0x38248f){return db[_0x87bf('0x1d')][_0x87bf('0x28')]({'raw':_0x3c55fa[_0x87bf('0x1e')]?_0x3c55fa['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c55fa[_0x87bf('0x1e')]?_0x3c55fa[_0x87bf('0x1e')][_0x87bf('0x1f')]||null:null,'attributes':_0x3c55fa[_0x87bf('0x1e')]?_0x3c55fa[_0x87bf('0x1e')][_0x87bf('0x24')]||null:null,'include':_0x3c55fa[_0x87bf('0x1e')]?_0x3c55fa[_0x87bf('0x1e')][_0x87bf('0x21')]?_['map'](_0x3c55fa[_0x87bf('0x1e')][_0x87bf('0x21')],function(_0x12285a){return{'model':db[_0x12285a[_0x87bf('0x23')]],'as':_0x12285a['as'],'attributes':_0x12285a['attributes'],'include':_0x12285a[_0x87bf('0x21')]?_[_0x87bf('0x22')](_0x12285a['include'],function(_0x28faf0){return{'model':db[_0x28faf0[_0x87bf('0x23')]],'as':_0x28faf0['as'],'attributes':_0x28faf0[_0x87bf('0x24')],'include':_0x28faf0[_0x87bf('0x21')]?_[_0x87bf('0x22')](_0x28faf0[_0x87bf('0x21')],function(_0x983799){return{'model':db[_0x983799[_0x87bf('0x23')]],'as':_0x983799['as'],'attributes':_0x983799['attributes']};}):[]};}):[]};}):[]:[]})[_0x87bf('0x14')](function(_0x21156e){logger[_0x87bf('0x1b')](_0x87bf('0x29'),_0x3c55fa);logger[_0x87bf('0x26')](_0x87bf('0x29'),_0x3c55fa,JSON[_0x87bf('0x27')](_0x21156e));_0x2cfb65(_0x21156e);})[_0x87bf('0x1c')](function(_0x2358c9){logger[_0x87bf('0x18')](_0x87bf('0x29'),_0x2358c9[_0x87bf('0x1a')],_0x3c55fa);_0x38248f(_0x2e55ab['error'](0x1f4,_0x2358c9['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 602d589..d596681 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 _0xcac3=['update','removeListener','register','length','openchannelQueue:','save','remove'];(function(_0x512788,_0x2ba055){var _0x4e6a78=function(_0x54ed14){while(--_0x54ed14){_0x512788['push'](_0x512788['shift']());}};_0x4e6a78(++_0x2ba055);}(_0xcac3,0x1a9));var _0x3cac=function(_0x15c7ab,_0x317c91){_0x15c7ab=_0x15c7ab-0x0;var _0x2ba2cc=_0xcac3[_0x15c7ab];return _0x2ba2cc;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x3cac('0x0'),_0x3cac('0x1'),_0x3cac('0x2')];function createListener(_0x407434,_0x9d44f4){return function(_0x6fe7b6){_0x9d44f4['emit'](_0x407434,_0x6fe7b6);};}function removeListener(_0x405fca,_0x5267fc){return function(){OpenchannelQueueEvents[_0x3cac('0x3')](_0x405fca,_0x5267fc);};}exports[_0x3cac('0x4')]=function(_0x1252c8){for(var _0x476b9a=0x0,_0x2168a0=events[_0x3cac('0x5')];_0x476b9a<_0x2168a0;_0x476b9a++){var _0x411520=events[_0x476b9a];var _0x78de28=createListener(_0x3cac('0x6')+_0x411520,_0x1252c8);OpenchannelQueueEvents['on'](_0x411520,_0x78de28);}}; \ No newline at end of file +var _0x576b=['removeListener','register','length','./openchannelQueue.events','save'];(function(_0x58976f,_0x7e24c1){var _0x1571d3=function(_0x17e3bb){while(--_0x17e3bb){_0x58976f['push'](_0x58976f['shift']());}};_0x1571d3(++_0x7e24c1);}(_0x576b,0x9e));var _0xb576=function(_0x376949,_0x4763c9){_0x376949=_0x376949-0x0;var _0x296181=_0x576b[_0x376949];return _0x296181;};'use strict';var OpenchannelQueueEvents=require(_0xb576('0x0'));var events=[_0xb576('0x1'),'remove','update'];function createListener(_0x20ace7,_0x423977){return function(_0x340cdc){_0x423977['emit'](_0x20ace7,_0x340cdc);};}function removeListener(_0x332f46,_0x1b3db6){return function(){OpenchannelQueueEvents[_0xb576('0x2')](_0x332f46,_0x1b3db6);};}exports[_0xb576('0x3')]=function(_0x411023){for(var _0x4dd07d=0x0,_0x1a6229=events[_0xb576('0x4')];_0x4dd07d<_0x1a6229;_0x4dd07d++){var _0x18a86d=events[_0x4dd07d];var _0xef164b=createListener('openchannelQueue:'+_0x18a86d,_0x411023);OpenchannelQueueEvents['on'](_0x18a86d,_0xef164b);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index b94c644..727f1cd 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 _0x8b9e=['isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x8b9e,0x1ab));var _0xe8b9=function(_0x1db794,_0x13bc92){_0x1db794=_0x1db794-0x0;var _0x1940fc=_0x8b9e[_0x1db794];return _0x1940fc;};'use strict';var multer=require(_0xe8b9('0x0'));var util=require(_0xe8b9('0x1'));var path=require(_0xe8b9('0x2'));var timeout=require(_0xe8b9('0x3'));var express=require(_0xe8b9('0x4'));var router=express[_0xe8b9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe8b9('0x6'));var config=require(_0xe8b9('0x7'));var controller=require(_0xe8b9('0x8'));router[_0xe8b9('0x9')]('/',auth[_0xe8b9('0xa')](),controller['index']);router[_0xe8b9('0x9')](_0xe8b9('0xb'),auth[_0xe8b9('0xa')](),controller[_0xe8b9('0xc')]);router[_0xe8b9('0x9')](_0xe8b9('0xd'),auth[_0xe8b9('0xa')](),controller[_0xe8b9('0xe')]);router['post']('/',auth[_0xe8b9('0xa')](),controller[_0xe8b9('0xf')]);router[_0xe8b9('0x10')](_0xe8b9('0xd'),auth[_0xe8b9('0xa')](),controller['update']);router[_0xe8b9('0x11')](_0xe8b9('0xd'),auth[_0xe8b9('0xa')](),controller[_0xe8b9('0x12')]);module['exports']=router; \ No newline at end of file +var _0x8948=['../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1b055e,_0xbef283){var _0x26bd13=function(_0x5bf80d){while(--_0x5bf80d){_0x1b055e['push'](_0x1b055e['shift']());}};_0x26bd13(++_0xbef283);}(_0x8948,0x13d));var _0x8894=function(_0x5af865,_0x1a8657){_0x5af865=_0x5af865-0x0;var _0x1cdc3e=_0x8948[_0x5af865];return _0x1cdc3e;};'use strict';var multer=require(_0x8894('0x0'));var util=require('util');var path=require(_0x8894('0x1'));var timeout=require(_0x8894('0x2'));var express=require(_0x8894('0x3'));var router=express[_0x8894('0x4')]();var fs_extra=require(_0x8894('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8894('0x6'));var controller=require(_0x8894('0x7'));router[_0x8894('0x8')]('/',auth[_0x8894('0x9')](),controller['index']);router[_0x8894('0x8')](_0x8894('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x8894('0x8')]('/:id',auth[_0x8894('0x9')](),controller['show']);router['post']('/',auth[_0x8894('0x9')](),controller[_0x8894('0xb')]);router[_0x8894('0xc')](_0x8894('0xd'),auth[_0x8894('0x9')](),controller[_0x8894('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8894('0xf')]);module[_0x8894('0x10')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b5469d9..2691060 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 _0xf6ca=['DATE','moment','sequelize','exports','STRING'];(function(_0x1828c3,_0x36d621){var _0x2bb9a6=function(_0x1a254b){while(--_0x1a254b){_0x1828c3['push'](_0x1828c3['shift']());}};_0x2bb9a6(++_0x36d621);}(_0xf6ca,0x11e));var _0xaf6c=function(_0x5d7198,_0x1dcd71){_0x5d7198=_0x5d7198-0x0;var _0x1522e8=_0xf6ca[_0x5d7198];return _0x1522e8;};'use strict';var moment=require(_0xaf6c('0x0'));var Sequelize=require(_0xaf6c('0x1'));module[_0xaf6c('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xaf6c('0x3')]},'joinAt':{'type':Sequelize[_0xaf6c('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xaf6c('0x4')]},'exitAt':{'type':Sequelize[_0xaf6c('0x4')]},'reason':{'type':Sequelize[_0xaf6c('0x3')]}}; \ No newline at end of file +var _0x9404=['DATE','moment','sequelize','STRING'];(function(_0x23c262,_0x74765a){var _0x9b913f=function(_0x3ecb98){while(--_0x3ecb98){_0x23c262['push'](_0x23c262['shift']());}};_0x9b913f(++_0x74765a);}(_0x9404,0x101));var _0x4940=function(_0x52a876,_0x1f8fc5){_0x52a876=_0x52a876-0x0;var _0x5ca83f=_0x9404[_0x52a876];return _0x5ca83f;};'use strict';var moment=require(_0x4940('0x0'));var Sequelize=require(_0x4940('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4940('0x2')]},'joinAt':{'type':Sequelize[_0x4940('0x3')]},'leaveAt':{'type':Sequelize[_0x4940('0x3')]},'acceptAt':{'type':Sequelize[_0x4940('0x3')]},'exitAt':{'type':Sequelize[_0x4940('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 8eb8af7..47d3df0 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 _0xca5b=['rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','params','describe','eml-format'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xca5b,0x12b));var _0xbca5=function(_0x4454c3,_0x24c130){_0x4454c3=_0x4454c3-0x0;var _0x195fa6=_0xca5b[_0x4454c3];return _0x195fa6;};'use strict';var emlformat=require(_0xbca5('0x0'));var rimraf=require(_0xbca5('0x1'));var zipdir=require(_0xbca5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbca5('0x3'));var moment=require(_0xbca5('0x4'));var BPromise=require(_0xbca5('0x5'));var Mustache=require('mustache');var util=require(_0xbca5('0x6'));var path=require(_0xbca5('0x7'));var sox=require(_0xbca5('0x8'));var csv=require(_0xbca5('0x9'));var ejs=require(_0xbca5('0xa'));var fs=require('fs');var fs_extra=require(_0xbca5('0xb'));var _=require('lodash');var squel=require(_0xbca5('0xc'));var crypto=require(_0xbca5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbca5('0x9'));var querystring=require(_0xbca5('0xe'));var Papa=require(_0xbca5('0xf'));var Redis=require(_0xbca5('0x10'));var authService=require(_0xbca5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbca5('0x12'));var hardwareService=require(_0xbca5('0x13'));var logger=require(_0xbca5('0x14'))(_0xbca5('0x15'));var utils=require(_0xbca5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbca5('0x17'));var db=require(_0xbca5('0x18'))['db'];function respondWithStatusCode(_0x2e993e,_0x197c87){_0x197c87=_0x197c87||0xcc;return function(_0x3b05e1){if(_0x3b05e1){return _0x2e993e[_0xbca5('0x19')](_0x197c87);}return _0x2e993e[_0xbca5('0x1a')](_0x197c87)['end']();};}function respondWithResult(_0x59caf6,_0x2cbb53){_0x2cbb53=_0x2cbb53||0xc8;return function(_0x11562f){if(_0x11562f){return _0x59caf6[_0xbca5('0x1a')](_0x2cbb53)[_0xbca5('0x1b')](_0x11562f);}};}function respondWithFilteredResult(_0xafee97,_0x2fed65){return function(_0x4c57f6){if(_0x4c57f6){var _0x1f77f6=typeof _0x2fed65[_0xbca5('0x1c')]===_0xbca5('0x1d')&&typeof _0x2fed65[_0xbca5('0x1e')]===_0xbca5('0x1d');var _0x3b49c7=_0x4c57f6[_0xbca5('0x1f')];var _0x2121bc=_0x1f77f6?0x0:_0x2fed65['offset'];var _0x29d479=_0x1f77f6?_0x4c57f6[_0xbca5('0x1f')]:_0x2fed65[_0xbca5('0x1c')]+_0x2fed65[_0xbca5('0x1e')];var _0x2634b1;if(_0x29d479>=_0x3b49c7){_0x29d479=_0x3b49c7;_0x2634b1=0xc8;}else{_0x2634b1=0xce;}_0xafee97[_0xbca5('0x1a')](_0x2634b1);return _0xafee97['set'](_0xbca5('0x20'),_0x2121bc+'-'+_0x29d479+'/'+_0x3b49c7)['json'](_0x4c57f6);}return null;};}function patchUpdates(_0x3c1f5b){return function(_0x6d9cb1){try{jsonpatch['apply'](_0x6d9cb1,_0x3c1f5b,!![]);}catch(_0x586eca){return BPromise[_0xbca5('0x21')](_0x586eca);}return _0x6d9cb1[_0xbca5('0x22')]();};}function saveUpdates(_0xe9285f,_0x24a2ab){return function(_0x288e64){if(_0x288e64){return _0x288e64[_0xbca5('0x23')](_0xe9285f)[_0xbca5('0x24')](function(_0x3aaa84){return _0x3aaa84;});}return null;};}function removeEntity(_0x9b3263,_0x3b1a15){return function(_0x39a1d0){if(_0x39a1d0){return _0x39a1d0[_0xbca5('0x25')]()[_0xbca5('0x24')](function(){_0x9b3263[_0xbca5('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x520019,_0x2abb11){return function(_0x1f2fc2){if(!_0x1f2fc2){_0x520019[_0xbca5('0x19')](0x194);}return _0x1f2fc2;};}function handleError(_0x21572a,_0x39e3d0){_0x39e3d0=_0x39e3d0||0x1f4;return function(_0xd3e1f9){logger['error'](_0xd3e1f9['stack']);if(_0xd3e1f9[_0xbca5('0x26')]){delete _0xd3e1f9[_0xbca5('0x26')];}_0x21572a[_0xbca5('0x1a')](_0x39e3d0)[_0xbca5('0x27')](_0xd3e1f9);};}exports[_0xbca5('0x28')]=function(_0x16b7af,_0x302b27){var _0x5ac3fb={},_0x45fb34={},_0x47c772={'count':0x0,'rows':[]};var _0x209f9f=_[_0xbca5('0x29')](db[_0xbca5('0x2a')][_0xbca5('0x2b')],function(_0xb21bea){return{'name':_0xb21bea[_0xbca5('0x2c')],'type':_0xb21bea[_0xbca5('0x2d')][_0xbca5('0x2e')]};});_0x45fb34[_0xbca5('0x2f')]=_[_0xbca5('0x29')](_0x209f9f,_0xbca5('0x26'));_0x45fb34['query']=_['keys'](_0x16b7af[_0xbca5('0x30')]);_0x45fb34[_0xbca5('0x31')]=_[_0xbca5('0x32')](_0x45fb34[_0xbca5('0x2f')],_0x45fb34[_0xbca5('0x30')]);_0x5ac3fb['attributes']=_[_0xbca5('0x32')](_0x45fb34[_0xbca5('0x2f')],qs[_0xbca5('0x33')](_0x16b7af[_0xbca5('0x30')][_0xbca5('0x33')]));_0x5ac3fb[_0xbca5('0x34')]=_0x5ac3fb[_0xbca5('0x34')][_0xbca5('0x35')]?_0x5ac3fb[_0xbca5('0x34')]:_0x45fb34['model'];if(!_0x16b7af[_0xbca5('0x30')]['hasOwnProperty'](_0xbca5('0x36'))){_0x5ac3fb['limit']=qs[_0xbca5('0x1e')](_0x16b7af[_0xbca5('0x30')]['limit']);_0x5ac3fb['offset']=qs[_0xbca5('0x1c')](_0x16b7af['query'][_0xbca5('0x1c')]);}_0x5ac3fb[_0xbca5('0x37')]=qs[_0xbca5('0x38')](_0x16b7af[_0xbca5('0x30')][_0xbca5('0x38')]);_0x5ac3fb[_0xbca5('0x39')]=qs['filters'](_[_0xbca5('0x3a')](_0x16b7af[_0xbca5('0x30')],_0x45fb34[_0xbca5('0x31')]),_0x209f9f);if(_0x16b7af[_0xbca5('0x30')][_0xbca5('0x3b')]){_0x5ac3fb['where']=_[_0xbca5('0x3c')](_0x5ac3fb[_0xbca5('0x39')],{'$or':_[_0xbca5('0x29')](_0x209f9f,function(_0x4a483d){if(_0x4a483d[_0xbca5('0x2d')]!==_0xbca5('0x3d')){var _0x53c0e3={};_0x53c0e3[_0x4a483d[_0xbca5('0x26')]]={'$like':'%'+_0x16b7af[_0xbca5('0x30')][_0xbca5('0x3b')]+'%'};return _0x53c0e3;}})});}_0x5ac3fb=_[_0xbca5('0x3c')]({},_0x5ac3fb,_0x16b7af[_0xbca5('0x3e')]);var _0x3bf3b9={'where':_0x5ac3fb[_0xbca5('0x39')]};return db[_0xbca5('0x2a')][_0xbca5('0x1f')](_0x3bf3b9)[_0xbca5('0x24')](function(_0x1f092a){_0x47c772[_0xbca5('0x1f')]=_0x1f092a;if(_0x16b7af[_0xbca5('0x30')]['includeAll']){_0x5ac3fb[_0xbca5('0x3f')]=[{'all':!![]}];}return db[_0xbca5('0x2a')][_0xbca5('0x40')](_0x5ac3fb);})[_0xbca5('0x24')](function(_0xf956b2){_0x47c772[_0xbca5('0x41')]=_0xf956b2;return _0x47c772;})['then'](respondWithFilteredResult(_0x302b27,_0x5ac3fb))[_0xbca5('0x42')](handleError(_0x302b27,null));};exports[_0xbca5('0x43')]=function(_0x2b1d9a,_0x440c00){var _0xa80968={'raw':!![],'where':{'id':_0x2b1d9a['params']['id']}},_0x1c4cfd={};_0x1c4cfd[_0xbca5('0x2f')]=_[_0xbca5('0x44')](db['OpenchannelQueueReport'][_0xbca5('0x2b')]);_0x1c4cfd[_0xbca5('0x30')]=_[_0xbca5('0x44')](_0x2b1d9a['query']);_0x1c4cfd[_0xbca5('0x31')]=_[_0xbca5('0x32')](_0x1c4cfd[_0xbca5('0x2f')],_0x1c4cfd[_0xbca5('0x30')]);_0xa80968[_0xbca5('0x34')]=_['intersection'](_0x1c4cfd[_0xbca5('0x2f')],qs[_0xbca5('0x33')](_0x2b1d9a[_0xbca5('0x30')][_0xbca5('0x33')]));_0xa80968[_0xbca5('0x34')]=_0xa80968[_0xbca5('0x34')][_0xbca5('0x35')]?_0xa80968['attributes']:_0x1c4cfd['model'];if(_0x2b1d9a[_0xbca5('0x30')][_0xbca5('0x45')]){_0xa80968[_0xbca5('0x3f')]=[{'all':!![]}];}_0xa80968=_[_0xbca5('0x3c')]({},_0xa80968,_0x2b1d9a['options']);return db[_0xbca5('0x2a')][_0xbca5('0x46')](_0xa80968)[_0xbca5('0x24')](handleEntityNotFound(_0x440c00,null))['then'](respondWithResult(_0x440c00,null))[_0xbca5('0x42')](handleError(_0x440c00,null));};exports['create']=function(_0x341417,_0x12aacb){return db[_0xbca5('0x2a')][_0xbca5('0x47')](_0x341417[_0xbca5('0x48')],{})[_0xbca5('0x24')](respondWithResult(_0x12aacb,0xc9))[_0xbca5('0x42')](handleError(_0x12aacb,null));};exports[_0xbca5('0x23')]=function(_0x3ea9c2,_0x36c971){if(_0x3ea9c2['body']['id']){delete _0x3ea9c2['body']['id'];}return db[_0xbca5('0x2a')][_0xbca5('0x46')]({'where':{'id':_0x3ea9c2[_0xbca5('0x49')]['id']}})[_0xbca5('0x24')](handleEntityNotFound(_0x36c971,null))[_0xbca5('0x24')](saveUpdates(_0x3ea9c2[_0xbca5('0x48')],null))['then'](respondWithResult(_0x36c971,null))[_0xbca5('0x42')](handleError(_0x36c971,null));};exports['destroy']=function(_0x491642,_0x3171fe){return db[_0xbca5('0x2a')][_0xbca5('0x46')]({'where':{'id':_0x491642['params']['id']}})[_0xbca5('0x24')](handleEntityNotFound(_0x3171fe,null))[_0xbca5('0x24')](removeEntity(_0x3171fe,null))[_0xbca5('0x42')](handleError(_0x3171fe,null));};exports[_0xbca5('0x4a')]=function(_0x3625d5,_0x51a2a7){return db['OpenchannelQueueReport']['describe']()['then'](respondWithResult(_0x51a2a7,null))[_0xbca5('0x42')](handleError(_0x51a2a7,null));}; \ No newline at end of file +var _0xf9c8=['model','query','filters','intersection','fields','attributes','length','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xf9c8,0x69));var _0x8f9c=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xf9c8[_0x4e93a9];return _0x43013c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8f9c('0x0'));var zipdir=require(_0x8f9c('0x1'));var jsonpatch=require(_0x8f9c('0x2'));var rp=require(_0x8f9c('0x3'));var moment=require(_0x8f9c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8f9c('0x5'));var util=require(_0x8f9c('0x6'));var path=require(_0x8f9c('0x7'));var sox=require(_0x8f9c('0x8'));var csv=require(_0x8f9c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f9c('0xa'));var squel=require(_0x8f9c('0xb'));var crypto=require(_0x8f9c('0xc'));var jsforce=require(_0x8f9c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8f9c('0x9'));var querystring=require(_0x8f9c('0xe'));var Papa=require(_0x8f9c('0xf'));var Redis=require(_0x8f9c('0x10'));var authService=require(_0x8f9c('0x11'));var qs=require(_0x8f9c('0x12'));var as=require(_0x8f9c('0x13'));var hardwareService=require(_0x8f9c('0x14'));var logger=require(_0x8f9c('0x15'))(_0x8f9c('0x16'));var utils=require(_0x8f9c('0x17'));var config=require(_0x8f9c('0x18'));var licenseUtil=require(_0x8f9c('0x19'));var db=require(_0x8f9c('0x1a'))['db'];function respondWithStatusCode(_0x4c7f28,_0x488843){_0x488843=_0x488843||0xcc;return function(_0x518bd5){if(_0x518bd5){return _0x4c7f28['sendStatus'](_0x488843);}return _0x4c7f28['status'](_0x488843)[_0x8f9c('0x1b')]();};}function respondWithResult(_0x20ddfc,_0x3fa361){_0x3fa361=_0x3fa361||0xc8;return function(_0x560688){if(_0x560688){return _0x20ddfc[_0x8f9c('0x1c')](_0x3fa361)[_0x8f9c('0x1d')](_0x560688);}};}function respondWithFilteredResult(_0x3b9f59,_0x7fb972){return function(_0x189e30){if(_0x189e30){var _0x14472e=typeof _0x7fb972[_0x8f9c('0x1e')]===_0x8f9c('0x1f')&&typeof _0x7fb972[_0x8f9c('0x20')]==='undefined';var _0x3cf48f=_0x189e30[_0x8f9c('0x21')];var _0x3e1eed=_0x14472e?0x0:_0x7fb972[_0x8f9c('0x1e')];var _0x7c68b5=_0x14472e?_0x189e30[_0x8f9c('0x21')]:_0x7fb972[_0x8f9c('0x1e')]+_0x7fb972[_0x8f9c('0x20')];var _0x3a2ab1;if(_0x7c68b5>=_0x3cf48f){_0x7c68b5=_0x3cf48f;_0x3a2ab1=0xc8;}else{_0x3a2ab1=0xce;}_0x3b9f59[_0x8f9c('0x1c')](_0x3a2ab1);return _0x3b9f59[_0x8f9c('0x22')](_0x8f9c('0x23'),_0x3e1eed+'-'+_0x7c68b5+'/'+_0x3cf48f)['json'](_0x189e30);}return null;};}function patchUpdates(_0x4a1180){return function(_0x5c4378){try{jsonpatch[_0x8f9c('0x24')](_0x5c4378,_0x4a1180,!![]);}catch(_0x336787){return BPromise[_0x8f9c('0x25')](_0x336787);}return _0x5c4378[_0x8f9c('0x26')]();};}function saveUpdates(_0x4fe508,_0x27ae1a){return function(_0x50ec6d){if(_0x50ec6d){return _0x50ec6d[_0x8f9c('0x27')](_0x4fe508)['then'](function(_0x5f1a5f){return _0x5f1a5f;});}return null;};}function removeEntity(_0x3075fe,_0x4f7d39){return function(_0x114b8){if(_0x114b8){return _0x114b8[_0x8f9c('0x28')]()[_0x8f9c('0x29')](function(){_0x3075fe[_0x8f9c('0x1c')](0xcc)[_0x8f9c('0x1b')]();});}};}function handleEntityNotFound(_0xed9488,_0x45586f){return function(_0x908e9c){if(!_0x908e9c){_0xed9488[_0x8f9c('0x2a')](0x194);}return _0x908e9c;};}function handleError(_0x1e934a,_0x2c452c){_0x2c452c=_0x2c452c||0x1f4;return function(_0x1ada3e){logger[_0x8f9c('0x2b')](_0x1ada3e[_0x8f9c('0x2c')]);if(_0x1ada3e[_0x8f9c('0x2d')]){delete _0x1ada3e[_0x8f9c('0x2d')];}_0x1e934a[_0x8f9c('0x1c')](_0x2c452c)[_0x8f9c('0x2e')](_0x1ada3e);};}exports[_0x8f9c('0x2f')]=function(_0x1413c9,_0x17bc4f){var _0x2a8024={},_0x4cfdca={},_0xe2375e={'count':0x0,'rows':[]};var _0xf28ea0=_[_0x8f9c('0x30')](db[_0x8f9c('0x31')][_0x8f9c('0x32')],function(_0x20f3a7){return{'name':_0x20f3a7['fieldName'],'type':_0x20f3a7[_0x8f9c('0x33')][_0x8f9c('0x34')]};});_0x4cfdca[_0x8f9c('0x35')]=_[_0x8f9c('0x30')](_0xf28ea0,_0x8f9c('0x2d'));_0x4cfdca[_0x8f9c('0x36')]=_['keys'](_0x1413c9[_0x8f9c('0x36')]);_0x4cfdca[_0x8f9c('0x37')]=_['intersection'](_0x4cfdca['model'],_0x4cfdca[_0x8f9c('0x36')]);_0x2a8024['attributes']=_[_0x8f9c('0x38')](_0x4cfdca[_0x8f9c('0x35')],qs[_0x8f9c('0x39')](_0x1413c9[_0x8f9c('0x36')][_0x8f9c('0x39')]));_0x2a8024[_0x8f9c('0x3a')]=_0x2a8024[_0x8f9c('0x3a')][_0x8f9c('0x3b')]?_0x2a8024[_0x8f9c('0x3a')]:_0x4cfdca[_0x8f9c('0x35')];if(!_0x1413c9['query']['hasOwnProperty']('nolimit')){_0x2a8024['limit']=qs[_0x8f9c('0x20')](_0x1413c9[_0x8f9c('0x36')][_0x8f9c('0x20')]);_0x2a8024[_0x8f9c('0x1e')]=qs['offset'](_0x1413c9[_0x8f9c('0x36')][_0x8f9c('0x1e')]);}_0x2a8024[_0x8f9c('0x3c')]=qs['sort'](_0x1413c9[_0x8f9c('0x36')]['sort']);_0x2a8024[_0x8f9c('0x3d')]=qs[_0x8f9c('0x37')](_[_0x8f9c('0x3e')](_0x1413c9[_0x8f9c('0x36')],_0x4cfdca[_0x8f9c('0x37')]),_0xf28ea0);if(_0x1413c9[_0x8f9c('0x36')][_0x8f9c('0x3f')]){_0x2a8024[_0x8f9c('0x3d')]=_[_0x8f9c('0x40')](_0x2a8024[_0x8f9c('0x3d')],{'$or':_[_0x8f9c('0x30')](_0xf28ea0,function(_0x3be6e0){if(_0x3be6e0['type']!==_0x8f9c('0x41')){var _0x2c7e29={};_0x2c7e29[_0x3be6e0['name']]={'$like':'%'+_0x1413c9[_0x8f9c('0x36')][_0x8f9c('0x3f')]+'%'};return _0x2c7e29;}})});}_0x2a8024=_[_0x8f9c('0x40')]({},_0x2a8024,_0x1413c9['options']);var _0x2c409a={'where':_0x2a8024[_0x8f9c('0x3d')]};return db[_0x8f9c('0x31')]['count'](_0x2c409a)[_0x8f9c('0x29')](function(_0x49f2d1){_0xe2375e['count']=_0x49f2d1;if(_0x1413c9[_0x8f9c('0x36')][_0x8f9c('0x42')]){_0x2a8024[_0x8f9c('0x43')]=[{'all':!![]}];}return db[_0x8f9c('0x31')][_0x8f9c('0x44')](_0x2a8024);})[_0x8f9c('0x29')](function(_0x474a09){_0xe2375e[_0x8f9c('0x45')]=_0x474a09;return _0xe2375e;})['then'](respondWithFilteredResult(_0x17bc4f,_0x2a8024))[_0x8f9c('0x46')](handleError(_0x17bc4f,null));};exports[_0x8f9c('0x47')]=function(_0x5b868c,_0x1ac6ec){var _0x302789={'raw':!![],'where':{'id':_0x5b868c[_0x8f9c('0x48')]['id']}},_0x19b9c6={};_0x19b9c6[_0x8f9c('0x35')]=_[_0x8f9c('0x49')](db[_0x8f9c('0x31')][_0x8f9c('0x32')]);_0x19b9c6[_0x8f9c('0x36')]=_['keys'](_0x5b868c[_0x8f9c('0x36')]);_0x19b9c6[_0x8f9c('0x37')]=_['intersection'](_0x19b9c6[_0x8f9c('0x35')],_0x19b9c6[_0x8f9c('0x36')]);_0x302789[_0x8f9c('0x3a')]=_['intersection'](_0x19b9c6[_0x8f9c('0x35')],qs[_0x8f9c('0x39')](_0x5b868c['query'][_0x8f9c('0x39')]));_0x302789[_0x8f9c('0x3a')]=_0x302789[_0x8f9c('0x3a')][_0x8f9c('0x3b')]?_0x302789['attributes']:_0x19b9c6[_0x8f9c('0x35')];if(_0x5b868c[_0x8f9c('0x36')][_0x8f9c('0x42')]){_0x302789[_0x8f9c('0x43')]=[{'all':!![]}];}_0x302789=_['merge']({},_0x302789,_0x5b868c[_0x8f9c('0x4a')]);return db[_0x8f9c('0x31')][_0x8f9c('0x4b')](_0x302789)['then'](handleEntityNotFound(_0x1ac6ec,null))[_0x8f9c('0x29')](respondWithResult(_0x1ac6ec,null))[_0x8f9c('0x46')](handleError(_0x1ac6ec,null));};exports[_0x8f9c('0x4c')]=function(_0x265e06,_0x2b27e9){return db[_0x8f9c('0x31')]['create'](_0x265e06[_0x8f9c('0x4d')],{})[_0x8f9c('0x29')](respondWithResult(_0x2b27e9,0xc9))[_0x8f9c('0x46')](handleError(_0x2b27e9,null));};exports['update']=function(_0x5014b2,_0x548397){if(_0x5014b2[_0x8f9c('0x4d')]['id']){delete _0x5014b2['body']['id'];}return db[_0x8f9c('0x31')]['find']({'where':{'id':_0x5014b2[_0x8f9c('0x48')]['id']}})['then'](handleEntityNotFound(_0x548397,null))['then'](saveUpdates(_0x5014b2[_0x8f9c('0x4d')],null))[_0x8f9c('0x29')](respondWithResult(_0x548397,null))[_0x8f9c('0x46')](handleError(_0x548397,null));};exports['destroy']=function(_0x528052,_0x218fa9){return db[_0x8f9c('0x31')][_0x8f9c('0x4b')]({'where':{'id':_0x528052[_0x8f9c('0x48')]['id']}})['then'](handleEntityNotFound(_0x218fa9,null))['then'](removeEntity(_0x218fa9,null))[_0x8f9c('0x46')](handleError(_0x218fa9,null));};exports[_0x8f9c('0x4e')]=function(_0x5e2fff,_0x17e175){return db['OpenchannelQueueReport'][_0x8f9c('0x4e')]()[_0x8f9c('0x29')](respondWithResult(_0x17e175,null))[_0x8f9c('0x46')](handleError(_0x17e175,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 0454f74..5c2813f 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x814b,0x1a2));var _0xb814=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0x814b[_0x5b3b9b];return _0x47c1d7;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x472306,_0x2a775e){var _0x182c13=function(_0x47e88a){while(--_0x47e88a){_0x472306['push'](_0x472306['shift']());}};_0x182c13(++_0x2a775e);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab4c4,_0x1b4b0a){_0x5ab4c4=_0x5ab4c4-0x0;var _0x3d4003=_0x7a54[_0x5ab4c4];return _0x3d4003;};'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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 64b2677..f73d2de 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 _0x94df=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','update','where','UpdateOpenchannelQueueReport','debug','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94df,0xa3));var _0xf94d=function(_0x2757a7,_0x5e59ea){_0x2757a7=_0x2757a7-0x0;var _0x213a80=_0x94df[_0x2757a7];return _0x213a80;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var moment=require(_0xf94d('0x2'));var BPromise=require(_0xf94d('0x3'));var rs=require(_0xf94d('0x4'));var fs=require('fs');var Redis=require(_0xf94d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf94d('0x6'));var logger=require(_0xf94d('0x7'))(_0xf94d('0x8'));var config=require(_0xf94d('0x9'));var jayson=require(_0xf94d('0xa'));var client=jayson[_0xf94d('0xb')][_0xf94d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18a11a,_0x1ebc19,_0xf285b5){return new BPromise(function(_0x1832e9,_0x504670){return client[_0xf94d('0xd')](_0x18a11a,_0xf285b5)[_0xf94d('0xe')](function(_0x145f5b){logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));logger['debug'](_0xf94d('0x12'),_0x1ebc19,_0xf94d('0x11'),JSON[_0xf94d('0x13')](_0x145f5b));if(_0x145f5b[_0xf94d('0x14')]){if(_0x145f5b[_0xf94d('0x14')]['code']===0x1f4){logger['error'](_0xf94d('0x10'),_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x504670(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}logger[_0xf94d('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1ebc19,_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);return _0x1832e9(_0x145f5b[_0xf94d('0x14')][_0xf94d('0x15')]);}else{logger[_0xf94d('0xf')](_0xf94d('0x10'),_0x1ebc19,_0xf94d('0x11'));_0x1832e9(_0x145f5b[_0xf94d('0x16')]['message']);}})[_0xf94d('0x17')](function(_0x5cd967){logger[_0xf94d('0x14')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1ebc19,_0x5cd967);_0x504670(_0x5cd967);});});}exports[_0xf94d('0x18')]=function(_0x559e0c){var _0x30d231=this;return new Promise(function(_0x3bf001,_0x510eef){return db[_0xf94d('0x19')]['create'](_0x559e0c[_0xf94d('0x1a')],{'raw':_0x559e0c['options']?_0x559e0c[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![]})[_0xf94d('0xe')](function(_0x2ede5b){logger['info'](_0xf94d('0x18'),_0x559e0c);logger['debug'](_0xf94d('0x18'),_0x559e0c,JSON[_0xf94d('0x13')](_0x2ede5b));_0x3bf001(_0x2ede5b);})[_0xf94d('0x17')](function(_0x56e5f5){logger[_0xf94d('0x14')](_0xf94d('0x18'),_0x56e5f5[_0xf94d('0x15')],_0x559e0c);_0x510eef(_0x30d231[_0xf94d('0x14')](0x1f4,_0x56e5f5[_0xf94d('0x15')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x301d2e){var _0x51f7f8=this;return new Promise(function(_0x4701e1,_0x2564a3){return db[_0xf94d('0x19')][_0xf94d('0x1d')](_0x301d2e[_0xf94d('0x1a')],{'raw':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')][_0xf94d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')][_0xf94d('0x1e')]||null:null,'attributes':_0x301d2e[_0xf94d('0x1b')]?_0x301d2e[_0xf94d('0x1b')]['attributes']||null:null,'limit':_0x301d2e['options']?_0x301d2e['options']['limit']||null:null})[_0xf94d('0xe')](function(_0x1e8242){logger['info'](_0xf94d('0x1f'),_0x301d2e);logger[_0xf94d('0x20')](_0xf94d('0x1f'),_0x301d2e,JSON['stringify'](_0x1e8242));_0x4701e1(_0x1e8242);})[_0xf94d('0x17')](function(_0x5ab0c8){logger[_0xf94d('0x14')](_0xf94d('0x1f'),_0x5ab0c8['message'],_0x301d2e);_0x2564a3(_0x51f7f8[_0xf94d('0x14')](0x1f4,_0x5ab0c8['message']));});});}; \ No newline at end of file +var _0x7334=['jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','CreateOpenchannelQueueReport','create','body','options','raw','catch','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5bd4fa,_0x1be13f){var _0x1599cb=function(_0x5b1e23){while(--_0x5b1e23){_0x5bd4fa['push'](_0x5bd4fa['shift']());}};_0x1599cb(++_0x1be13f);}(_0x7334,0x184));var _0x4733=function(_0x3e02dd,_0x1094cf){_0x3e02dd=_0x3e02dd-0x0;var _0x2a22ce=_0x7334[_0x3e02dd];return _0x2a22ce;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});}exports[_0x4733('0x17')]=function(_0x1d2fb6){var _0x2aa223=this;return new Promise(function(_0x384e0c,_0x579f67){return db['OpenchannelQueueReport'][_0x4733('0x18')](_0x1d2fb6[_0x4733('0x19')],{'raw':_0x1d2fb6['options']?_0x1d2fb6[_0x4733('0x1a')][_0x4733('0x1b')]===undefined?!![]:![]:!![]})[_0x4733('0xc')](function(_0x7a4e0){logger['info'](_0x4733('0x17'),_0x1d2fb6);logger[_0x4733('0xf')]('CreateOpenchannelQueueReport',_0x1d2fb6,JSON[_0x4733('0x11')](_0x7a4e0));_0x384e0c(_0x7a4e0);})[_0x4733('0x1c')](function(_0x478e34){logger[_0x4733('0x12')](_0x4733('0x17'),_0x478e34[_0x4733('0x14')],_0x1d2fb6);_0x579f67(_0x2aa223[_0x4733('0x12')](0x1f4,_0x478e34[_0x4733('0x14')]));});});};exports[_0x4733('0x1d')]=function(_0x180049){var _0x2bb78f=this;return new Promise(function(_0x523697,_0x3e6976){return db[_0x4733('0x1e')][_0x4733('0x1f')](_0x180049[_0x4733('0x19')],{'raw':_0x180049[_0x4733('0x1a')]?_0x180049[_0x4733('0x1a')][_0x4733('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x180049[_0x4733('0x1a')]?_0x180049[_0x4733('0x1a')][_0x4733('0x20')]||null:null,'attributes':_0x180049['options']?_0x180049[_0x4733('0x1a')]['attributes']||null:null,'limit':_0x180049['options']?_0x180049[_0x4733('0x1a')]['limit']||null:null})[_0x4733('0xc')](function(_0x479989){logger['info']('UpdateOpenchannelQueueReport',_0x180049);logger[_0x4733('0xf')](_0x4733('0x1d'),_0x180049,JSON[_0x4733('0x11')](_0x479989));_0x523697(_0x479989);})[_0x4733('0x1c')](function(_0x4fee4a){logger['error']('UpdateOpenchannelQueueReport',_0x4fee4a[_0x4733('0x14')],_0x180049);_0x3e6976(_0x2bb78f['error'](0x1f4,_0x4fee4a['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 2884951..1205f03 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 _0x111b=['index','/describe','isAuthenticated','/:id','show','create','delete','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x111b,0xca));var _0xb111=function(_0x59a675,_0x56c5a1){_0x59a675=_0x59a675-0x0;var _0x1be9ab=_0x111b[_0x59a675];return _0x1be9ab;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb111('0x0'));var express=require(_0xb111('0x1'));var router=express[_0xb111('0x2')]();var fs_extra=require(_0xb111('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb111('0x4'));var config=require(_0xb111('0x5'));var controller=require(_0xb111('0x6'));router[_0xb111('0x7')]('/',auth['isAuthenticated'](),controller[_0xb111('0x8')]);router[_0xb111('0x7')](_0xb111('0x9'),auth[_0xb111('0xa')](),controller['describe']);router[_0xb111('0x7')](_0xb111('0xb'),auth['isAuthenticated'](),controller[_0xb111('0xc')]);router['post']('/',auth[_0xb111('0xa')](),controller[_0xb111('0xd')]);router['put'](_0xb111('0xb'),auth[_0xb111('0xa')](),controller['update']);router[_0xb111('0xe')]('/:id',auth[_0xb111('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xacc3=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54fad1,_0x7876f7){var _0x23eb72=function(_0x35ce80){while(--_0x35ce80){_0x54fad1['push'](_0x54fad1['shift']());}};_0x23eb72(++_0x7876f7);}(_0xacc3,0x1c7));var _0x3acc=function(_0x524c92,_0x1259c4){_0x524c92=_0x524c92-0x0;var _0x3740d6=_0xacc3[_0x524c92];return _0x3740d6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3acc('0x0'));var timeout=require('connect-timeout');var express=require(_0x3acc('0x1'));var router=express[_0x3acc('0x2')]();var fs_extra=require(_0x3acc('0x3'));var auth=require(_0x3acc('0x4'));var interaction=require(_0x3acc('0x5'));var config=require(_0x3acc('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x3acc('0x7')]('/',auth['isAuthenticated'](),controller[_0x3acc('0x8')]);router[_0x3acc('0x7')](_0x3acc('0x9'),auth[_0x3acc('0xa')](),controller[_0x3acc('0xb')]);router[_0x3acc('0x7')](_0x3acc('0xc'),auth['isAuthenticated'](),controller[_0x3acc('0xd')]);router['post']('/',auth[_0x3acc('0xa')](),controller[_0x3acc('0xe')]);router[_0x3acc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3acc('0x10')]);router[_0x3acc('0x11')]('/:id',auth[_0x3acc('0xa')](),controller[_0x3acc('0x12')]);module[_0x3acc('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 272f3ff..862f3e8 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x193e6f,_0x4c1342){var _0x1703fb=function(_0x5db883){while(--_0x5db883){_0x193e6f['push'](_0x193e6f['shift']());}};_0x1703fb(++_0x4c1342);}(_0xaa88,0x137));var _0x8aa8=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xaa88[_0x43941d];return _0x27b82a;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x1ac898,_0x19253b){var _0x681940=function(_0x57731b){while(--_0x57731b){_0x1ac898['push'](_0x1ac898['shift']());}};_0x681940(++_0x19253b);}(_0x4b84,0x1cc));var _0x44b8=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0x4b84[_0x24fa1a];return _0xc5621f;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 2867961..679893a 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 _0x2553=['mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird'];(function(_0x45ed09,_0x4deb08){var _0x1938a5=function(_0x4b11be){while(--_0x4b11be){_0x45ed09['push'](_0x45ed09['shift']());}};_0x1938a5(++_0x4deb08);}(_0x2553,0x1d5));var _0x3255=function(_0x5b17b4,_0x5a3221){_0x5b17b4=_0x5b17b4-0x0;var _0x55af79=_0x2553[_0x5b17b4];return _0x55af79;};'use strict';var emlformat=require(_0x3255('0x0'));var rimraf=require(_0x3255('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3255('0x2'));var rp=require('request-promise');var moment=require(_0x3255('0x3'));var BPromise=require(_0x3255('0x4'));var Mustache=require(_0x3255('0x5'));var util=require(_0x3255('0x6'));var path=require('path');var sox=require(_0x3255('0x7'));var csv=require(_0x3255('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3255('0x9'));var _=require(_0x3255('0xa'));var squel=require(_0x3255('0xb'));var crypto=require(_0x3255('0xc'));var jsforce=require(_0x3255('0xd'));var deskjs=require(_0x3255('0xe'));var toCsv=require(_0x3255('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3255('0xf'));var authService=require(_0x3255('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3255('0x11'));var hardwareService=require(_0x3255('0x12'));var logger=require(_0x3255('0x13'))(_0x3255('0x14'));var utils=require(_0x3255('0x15'));var config=require(_0x3255('0x16'));var licenseUtil=require(_0x3255('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x551dc9,_0x37a5b9){_0x37a5b9=_0x37a5b9||0xcc;return function(_0xc5f560){if(_0xc5f560){return _0x551dc9[_0x3255('0x18')](_0x37a5b9);}return _0x551dc9[_0x3255('0x19')](_0x37a5b9)['end']();};}function respondWithResult(_0x4abcf2,_0x35b866){_0x35b866=_0x35b866||0xc8;return function(_0x548452){if(_0x548452){return _0x4abcf2[_0x3255('0x19')](_0x35b866)[_0x3255('0x1a')](_0x548452);}};}function respondWithFilteredResult(_0x49b975,_0x31a961){return function(_0x66d65){if(_0x66d65){var _0x4d3478=typeof _0x31a961['offset']==='undefined'&&typeof _0x31a961['limit']===_0x3255('0x1b');var _0x3883db=_0x66d65[_0x3255('0x1c')];var _0x345d46=_0x4d3478?0x0:_0x31a961['offset'];var _0x33a305=_0x4d3478?_0x66d65[_0x3255('0x1c')]:_0x31a961['offset']+_0x31a961[_0x3255('0x1d')];var _0x534f4c;if(_0x33a305>=_0x3883db){_0x33a305=_0x3883db;_0x534f4c=0xc8;}else{_0x534f4c=0xce;}_0x49b975['status'](_0x534f4c);return _0x49b975[_0x3255('0x1e')](_0x3255('0x1f'),_0x345d46+'-'+_0x33a305+'/'+_0x3883db)[_0x3255('0x1a')](_0x66d65);}return null;};}function patchUpdates(_0x557a47){return function(_0x11bfba){try{jsonpatch[_0x3255('0x20')](_0x11bfba,_0x557a47,!![]);}catch(_0x1d8aac){return BPromise[_0x3255('0x21')](_0x1d8aac);}return _0x11bfba[_0x3255('0x22')]();};}function saveUpdates(_0x395693,_0x5b42cb){return function(_0x1e1b5b){if(_0x1e1b5b){return _0x1e1b5b[_0x3255('0x23')](_0x395693)['then'](function(_0x21c621){return _0x21c621;});}return null;};}function removeEntity(_0x5c3b91,_0x3364ca){return function(_0x3993cf){if(_0x3993cf){return _0x3993cf[_0x3255('0x24')]()[_0x3255('0x25')](function(){_0x5c3b91[_0x3255('0x19')](0xcc)[_0x3255('0x26')]();});}};}function handleEntityNotFound(_0x5f296b,_0x51ecaf){return function(_0x5f3c55){if(!_0x5f3c55){_0x5f296b[_0x3255('0x18')](0x194);}return _0x5f3c55;};}function handleError(_0xf393ed,_0x102f35){_0x102f35=_0x102f35||0x1f4;return function(_0x386098){logger[_0x3255('0x27')](_0x386098['stack']);if(_0x386098[_0x3255('0x28')]){delete _0x386098[_0x3255('0x28')];}_0xf393ed[_0x3255('0x19')](_0x102f35)[_0x3255('0x29')](_0x386098);};}exports[_0x3255('0x2a')]=function(_0x333828,_0x5ac05b){var _0x14371b={},_0x13eb69={},_0x12a588={'count':0x0,'rows':[]};var _0x3c676c=_[_0x3255('0x2b')](db['OpenchannelTransferReport'][_0x3255('0x2c')],function(_0x4fecf0){return{'name':_0x4fecf0[_0x3255('0x2d')],'type':_0x4fecf0[_0x3255('0x2e')][_0x3255('0x2f')]};});_0x13eb69[_0x3255('0x30')]=_[_0x3255('0x2b')](_0x3c676c,_0x3255('0x28'));_0x13eb69['query']=_['keys'](_0x333828[_0x3255('0x31')]);_0x13eb69[_0x3255('0x32')]=_[_0x3255('0x33')](_0x13eb69['model'],_0x13eb69[_0x3255('0x31')]);_0x14371b[_0x3255('0x34')]=_[_0x3255('0x33')](_0x13eb69['model'],qs[_0x3255('0x35')](_0x333828['query'][_0x3255('0x35')]));_0x14371b[_0x3255('0x34')]=_0x14371b['attributes'][_0x3255('0x36')]?_0x14371b['attributes']:_0x13eb69[_0x3255('0x30')];if(!_0x333828['query'][_0x3255('0x37')](_0x3255('0x38'))){_0x14371b['limit']=qs[_0x3255('0x1d')](_0x333828[_0x3255('0x31')][_0x3255('0x1d')]);_0x14371b[_0x3255('0x39')]=qs['offset'](_0x333828[_0x3255('0x31')]['offset']);}_0x14371b[_0x3255('0x3a')]=qs[_0x3255('0x3b')](_0x333828[_0x3255('0x31')][_0x3255('0x3b')]);_0x14371b['where']=qs[_0x3255('0x32')](_[_0x3255('0x3c')](_0x333828['query'],_0x13eb69[_0x3255('0x32')]),_0x3c676c);if(_0x333828[_0x3255('0x31')][_0x3255('0x3d')]){_0x14371b[_0x3255('0x3e')]=_[_0x3255('0x3f')](_0x14371b[_0x3255('0x3e')],{'$or':_[_0x3255('0x2b')](_0x3c676c,function(_0x105dcc){if(_0x105dcc[_0x3255('0x2e')]!==_0x3255('0x40')){var _0x43e877={};_0x43e877[_0x105dcc[_0x3255('0x28')]]={'$like':'%'+_0x333828[_0x3255('0x31')][_0x3255('0x3d')]+'%'};return _0x43e877;}})});}_0x14371b=_[_0x3255('0x3f')]({},_0x14371b,_0x333828[_0x3255('0x41')]);var _0x5bff6b={'where':_0x14371b[_0x3255('0x3e')]};return db[_0x3255('0x42')][_0x3255('0x1c')](_0x5bff6b)[_0x3255('0x25')](function(_0x544589){_0x12a588['count']=_0x544589;if(_0x333828[_0x3255('0x31')][_0x3255('0x43')]){_0x14371b[_0x3255('0x44')]=[{'all':!![]}];}return db[_0x3255('0x42')][_0x3255('0x45')](_0x14371b);})[_0x3255('0x25')](function(_0x2c774e){_0x12a588[_0x3255('0x46')]=_0x2c774e;return _0x12a588;})[_0x3255('0x25')](respondWithFilteredResult(_0x5ac05b,_0x14371b))[_0x3255('0x47')](handleError(_0x5ac05b,null));};exports[_0x3255('0x48')]=function(_0x543e7a,_0x3fb971){var _0x1d54fa={'raw':!![],'where':{'id':_0x543e7a[_0x3255('0x49')]['id']}},_0x1576fc={};_0x1576fc[_0x3255('0x30')]=_[_0x3255('0x4a')](db[_0x3255('0x42')][_0x3255('0x2c')]);_0x1576fc[_0x3255('0x31')]=_[_0x3255('0x4a')](_0x543e7a[_0x3255('0x31')]);_0x1576fc['filters']=_['intersection'](_0x1576fc[_0x3255('0x30')],_0x1576fc[_0x3255('0x31')]);_0x1d54fa[_0x3255('0x34')]=_['intersection'](_0x1576fc[_0x3255('0x30')],qs['fields'](_0x543e7a[_0x3255('0x31')][_0x3255('0x35')]));_0x1d54fa[_0x3255('0x34')]=_0x1d54fa['attributes'][_0x3255('0x36')]?_0x1d54fa[_0x3255('0x34')]:_0x1576fc[_0x3255('0x30')];if(_0x543e7a[_0x3255('0x31')]['includeAll']){_0x1d54fa[_0x3255('0x44')]=[{'all':!![]}];}_0x1d54fa=_['merge']({},_0x1d54fa,_0x543e7a['options']);return db[_0x3255('0x42')][_0x3255('0x4b')](_0x1d54fa)[_0x3255('0x25')](handleEntityNotFound(_0x3fb971,null))[_0x3255('0x25')](respondWithResult(_0x3fb971,null))['catch'](handleError(_0x3fb971,null));};exports[_0x3255('0x4c')]=function(_0xff6912,_0xc45113){return db[_0x3255('0x42')][_0x3255('0x4c')](_0xff6912[_0x3255('0x4d')],{})[_0x3255('0x25')](respondWithResult(_0xc45113,0xc9))[_0x3255('0x47')](handleError(_0xc45113,null));};exports[_0x3255('0x23')]=function(_0x26efbd,_0x484850){if(_0x26efbd[_0x3255('0x4d')]['id']){delete _0x26efbd[_0x3255('0x4d')]['id'];}return db[_0x3255('0x42')][_0x3255('0x4b')]({'where':{'id':_0x26efbd[_0x3255('0x49')]['id']}})[_0x3255('0x25')](handleEntityNotFound(_0x484850,null))[_0x3255('0x25')](saveUpdates(_0x26efbd[_0x3255('0x4d')],null))[_0x3255('0x25')](respondWithResult(_0x484850,null))[_0x3255('0x47')](handleError(_0x484850,null));};exports[_0x3255('0x24')]=function(_0x22b5c4,_0x5dcd15){return db['OpenchannelTransferReport'][_0x3255('0x4b')]({'where':{'id':_0x22b5c4[_0x3255('0x49')]['id']}})[_0x3255('0x25')](handleEntityNotFound(_0x5dcd15,null))[_0x3255('0x25')](removeEntity(_0x5dcd15,null))['catch'](handleError(_0x5dcd15,null));};exports[_0x3255('0x4e')]=function(_0x56b38e,_0x37cfdc){return db[_0x3255('0x42')][_0x3255('0x4e')]()[_0x3255('0x25')](respondWithResult(_0x37cfdc,null))[_0x3255('0x47')](handleError(_0x37cfdc,null));}; \ No newline at end of file +var _0xb22e=['pick','filter','merge','where','options','OpenchannelTransferReport','include','catch','params','length','includeAll','find','create','body','update','destroy','describe','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x3e43a0,_0x55ddeb){var _0x3aef89=function(_0x312fc8){while(--_0x312fc8){_0x3e43a0['push'](_0x3e43a0['shift']());}};_0x3aef89(++_0x55ddeb);}(_0xb22e,0xa3));var _0xeb22=function(_0x2e34a1,_0x104160){_0x2e34a1=_0x2e34a1-0x0;var _0x1f3cc6=_0xb22e[_0x2e34a1];return _0x1f3cc6;};'use strict';var emlformat=require(_0xeb22('0x0'));var rimraf=require(_0xeb22('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeb22('0x2'));var Mustache=require(_0xeb22('0x3'));var util=require('util');var path=require(_0xeb22('0x4'));var sox=require(_0xeb22('0x5'));var csv=require(_0xeb22('0x6'));var ejs=require(_0xeb22('0x7'));var fs=require('fs');var fs_extra=require(_0xeb22('0x8'));var _=require('lodash');var squel=require(_0xeb22('0x9'));var crypto=require(_0xeb22('0xa'));var jsforce=require(_0xeb22('0xb'));var deskjs=require(_0xeb22('0xc'));var toCsv=require(_0xeb22('0x6'));var querystring=require(_0xeb22('0xd'));var Papa=require(_0xeb22('0xe'));var Redis=require('ioredis');var authService=require(_0xeb22('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeb22('0x10'));var logger=require(_0xeb22('0x11'))(_0xeb22('0x12'));var utils=require('../../config/utils');var config=require(_0xeb22('0x13'));var licenseUtil=require(_0xeb22('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x162e1f,_0x776fdc){_0x776fdc=_0x776fdc||0xcc;return function(_0x399ae5){if(_0x399ae5){return _0x162e1f[_0xeb22('0x15')](_0x776fdc);}return _0x162e1f[_0xeb22('0x16')](_0x776fdc)[_0xeb22('0x17')]();};}function respondWithResult(_0x6a5209,_0x6285b7){_0x6285b7=_0x6285b7||0xc8;return function(_0x2b3474){if(_0x2b3474){return _0x6a5209[_0xeb22('0x16')](_0x6285b7)[_0xeb22('0x18')](_0x2b3474);}};}function respondWithFilteredResult(_0xf39dfc,_0x3f963c){return function(_0x38f47b){if(_0x38f47b){var _0x194c08=typeof _0x3f963c[_0xeb22('0x19')]===_0xeb22('0x1a')&&typeof _0x3f963c[_0xeb22('0x1b')]===_0xeb22('0x1a');var _0x1352b4=_0x38f47b[_0xeb22('0x1c')];var _0x2152a7=_0x194c08?0x0:_0x3f963c[_0xeb22('0x19')];var _0xd8e2cc=_0x194c08?_0x38f47b[_0xeb22('0x1c')]:_0x3f963c['offset']+_0x3f963c[_0xeb22('0x1b')];var _0x2ff458;if(_0xd8e2cc>=_0x1352b4){_0xd8e2cc=_0x1352b4;_0x2ff458=0xc8;}else{_0x2ff458=0xce;}_0xf39dfc[_0xeb22('0x16')](_0x2ff458);return _0xf39dfc[_0xeb22('0x1d')](_0xeb22('0x1e'),_0x2152a7+'-'+_0xd8e2cc+'/'+_0x1352b4)['json'](_0x38f47b);}return null;};}function patchUpdates(_0x52e1e3){return function(_0xc36961){try{jsonpatch[_0xeb22('0x1f')](_0xc36961,_0x52e1e3,!![]);}catch(_0x388e60){return BPromise[_0xeb22('0x20')](_0x388e60);}return _0xc36961[_0xeb22('0x21')]();};}function saveUpdates(_0x10a185,_0x1a3980){return function(_0x586040){if(_0x586040){return _0x586040['update'](_0x10a185)[_0xeb22('0x22')](function(_0x4b29f4){return _0x4b29f4;});}return null;};}function removeEntity(_0x52f261,_0x31720c){return function(_0x114c8a){if(_0x114c8a){return _0x114c8a['destroy']()[_0xeb22('0x22')](function(){_0x52f261[_0xeb22('0x16')](0xcc)[_0xeb22('0x17')]();});}};}function handleEntityNotFound(_0xbb6895,_0x204fa6){return function(_0x4eecfb){if(!_0x4eecfb){_0xbb6895[_0xeb22('0x15')](0x194);}return _0x4eecfb;};}function handleError(_0x53db5f,_0x312f08){_0x312f08=_0x312f08||0x1f4;return function(_0x18c2ba){logger[_0xeb22('0x23')](_0x18c2ba[_0xeb22('0x24')]);if(_0x18c2ba[_0xeb22('0x25')]){delete _0x18c2ba[_0xeb22('0x25')];}_0x53db5f[_0xeb22('0x16')](_0x312f08)[_0xeb22('0x26')](_0x18c2ba);};}exports[_0xeb22('0x27')]=function(_0x19a9a7,_0xfa3d31){var _0x2ca21c={},_0x47b394={},_0x2e6ee3={'count':0x0,'rows':[]};var _0x7e09f5=_['map'](db['OpenchannelTransferReport'][_0xeb22('0x28')],function(_0x89fc51){return{'name':_0x89fc51[_0xeb22('0x29')],'type':_0x89fc51[_0xeb22('0x2a')][_0xeb22('0x2b')]};});_0x47b394[_0xeb22('0x2c')]=_[_0xeb22('0x2d')](_0x7e09f5,_0xeb22('0x25'));_0x47b394['query']=_[_0xeb22('0x2e')](_0x19a9a7['query']);_0x47b394[_0xeb22('0x2f')]=_[_0xeb22('0x30')](_0x47b394[_0xeb22('0x2c')],_0x47b394[_0xeb22('0x31')]);_0x2ca21c[_0xeb22('0x32')]=_[_0xeb22('0x30')](_0x47b394[_0xeb22('0x2c')],qs[_0xeb22('0x33')](_0x19a9a7['query'][_0xeb22('0x33')]));_0x2ca21c[_0xeb22('0x32')]=_0x2ca21c[_0xeb22('0x32')]['length']?_0x2ca21c[_0xeb22('0x32')]:_0x47b394[_0xeb22('0x2c')];if(!_0x19a9a7['query'][_0xeb22('0x34')](_0xeb22('0x35'))){_0x2ca21c['limit']=qs[_0xeb22('0x1b')](_0x19a9a7[_0xeb22('0x31')]['limit']);_0x2ca21c[_0xeb22('0x19')]=qs['offset'](_0x19a9a7['query'][_0xeb22('0x19')]);}_0x2ca21c[_0xeb22('0x36')]=qs[_0xeb22('0x37')](_0x19a9a7[_0xeb22('0x31')][_0xeb22('0x37')]);_0x2ca21c['where']=qs[_0xeb22('0x2f')](_[_0xeb22('0x38')](_0x19a9a7[_0xeb22('0x31')],_0x47b394[_0xeb22('0x2f')]),_0x7e09f5);if(_0x19a9a7[_0xeb22('0x31')][_0xeb22('0x39')]){_0x2ca21c['where']=_[_0xeb22('0x3a')](_0x2ca21c[_0xeb22('0x3b')],{'$or':_[_0xeb22('0x2d')](_0x7e09f5,function(_0xbe2736){if(_0xbe2736['type']!=='VIRTUAL'){var _0x5ac5b2={};_0x5ac5b2[_0xbe2736['name']]={'$like':'%'+_0x19a9a7['query'][_0xeb22('0x39')]+'%'};return _0x5ac5b2;}})});}_0x2ca21c=_['merge']({},_0x2ca21c,_0x19a9a7[_0xeb22('0x3c')]);var _0x5cf642={'where':_0x2ca21c[_0xeb22('0x3b')]};return db[_0xeb22('0x3d')][_0xeb22('0x1c')](_0x5cf642)[_0xeb22('0x22')](function(_0x50c035){_0x2e6ee3[_0xeb22('0x1c')]=_0x50c035;if(_0x19a9a7[_0xeb22('0x31')]['includeAll']){_0x2ca21c[_0xeb22('0x3e')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x2ca21c);})[_0xeb22('0x22')](function(_0x276c99){_0x2e6ee3['rows']=_0x276c99;return _0x2e6ee3;})[_0xeb22('0x22')](respondWithFilteredResult(_0xfa3d31,_0x2ca21c))[_0xeb22('0x3f')](handleError(_0xfa3d31,null));};exports['show']=function(_0xd64e85,_0x50ecc1){var _0x1c6aeb={'raw':!![],'where':{'id':_0xd64e85[_0xeb22('0x40')]['id']}},_0x4c7338={};_0x4c7338[_0xeb22('0x2c')]=_['keys'](db[_0xeb22('0x3d')][_0xeb22('0x28')]);_0x4c7338[_0xeb22('0x31')]=_[_0xeb22('0x2e')](_0xd64e85[_0xeb22('0x31')]);_0x4c7338['filters']=_[_0xeb22('0x30')](_0x4c7338[_0xeb22('0x2c')],_0x4c7338[_0xeb22('0x31')]);_0x1c6aeb[_0xeb22('0x32')]=_['intersection'](_0x4c7338[_0xeb22('0x2c')],qs[_0xeb22('0x33')](_0xd64e85[_0xeb22('0x31')]['fields']));_0x1c6aeb[_0xeb22('0x32')]=_0x1c6aeb[_0xeb22('0x32')][_0xeb22('0x41')]?_0x1c6aeb['attributes']:_0x4c7338[_0xeb22('0x2c')];if(_0xd64e85[_0xeb22('0x31')][_0xeb22('0x42')]){_0x1c6aeb[_0xeb22('0x3e')]=[{'all':!![]}];}_0x1c6aeb=_[_0xeb22('0x3a')]({},_0x1c6aeb,_0xd64e85['options']);return db['OpenchannelTransferReport'][_0xeb22('0x43')](_0x1c6aeb)[_0xeb22('0x22')](handleEntityNotFound(_0x50ecc1,null))['then'](respondWithResult(_0x50ecc1,null))[_0xeb22('0x3f')](handleError(_0x50ecc1,null));};exports[_0xeb22('0x44')]=function(_0x2d3dfb,_0x2cea3c){return db[_0xeb22('0x3d')][_0xeb22('0x44')](_0x2d3dfb[_0xeb22('0x45')],{})[_0xeb22('0x22')](respondWithResult(_0x2cea3c,0xc9))[_0xeb22('0x3f')](handleError(_0x2cea3c,null));};exports[_0xeb22('0x46')]=function(_0x188517,_0x212f59){if(_0x188517[_0xeb22('0x45')]['id']){delete _0x188517[_0xeb22('0x45')]['id'];}return db['OpenchannelTransferReport'][_0xeb22('0x43')]({'where':{'id':_0x188517['params']['id']}})[_0xeb22('0x22')](handleEntityNotFound(_0x212f59,null))[_0xeb22('0x22')](saveUpdates(_0x188517[_0xeb22('0x45')],null))[_0xeb22('0x22')](respondWithResult(_0x212f59,null))[_0xeb22('0x3f')](handleError(_0x212f59,null));};exports[_0xeb22('0x47')]=function(_0x197b90,_0x18a070){return db[_0xeb22('0x3d')][_0xeb22('0x43')]({'where':{'id':_0x197b90[_0xeb22('0x40')]['id']}})[_0xeb22('0x22')](handleEntityNotFound(_0x18a070,null))[_0xeb22('0x22')](removeEntity(_0x18a070,null))[_0xeb22('0x3f')](handleError(_0x18a070,null));};exports[_0xeb22('0x48')]=function(_0x52d4e6,_0x4c3c31){return db[_0xeb22('0x3d')][_0xeb22('0x48')]()[_0xeb22('0x22')](respondWithResult(_0x4c3c31,null))[_0xeb22('0x3f')](handleError(_0x4c3c31,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 70f68f7..a892d55 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 _0xc5f7=['../../config/logger','api','moment','bluebird','request-promise','path','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util'];(function(_0x157de9,_0x1a3dc3){var _0x13b471=function(_0x4ab559){while(--_0x4ab559){_0x157de9['push'](_0x157de9['shift']());}};_0x13b471(++_0x1a3dc3);}(_0xc5f7,0xcb));var _0x7c5f=function(_0x30c483,_0x44dcd4){_0x30c483=_0x30c483-0x0;var _0x2067bb=_0xc5f7[_0x30c483];return _0x2067bb;};'use strict';var _=require('lodash');var util=require(_0x7c5f('0x0'));var logger=require(_0x7c5f('0x1'))(_0x7c5f('0x2'));var moment=require(_0x7c5f('0x3'));var BPromise=require(_0x7c5f('0x4'));var rp=require(_0x7c5f('0x5'));var fs=require('fs');var path=require(_0x7c5f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7c5f('0x7'));module[_0x7c5f('0x8')]=function(_0x2dd2d0,_0x380e95){return _0x2dd2d0['define'](_0x7c5f('0x9'),attributes,{'tableName':_0x7c5f('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7c5f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7610=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer'];(function(_0x202952,_0x4c04ce){var _0x40edd9=function(_0x4139d9){while(--_0x4139d9){_0x202952['push'](_0x202952['shift']());}};_0x40edd9(++_0x4c04ce);}(_0x7610,0x1a5));var _0x0761=function(_0x945fab,_0x42756a){_0x945fab=_0x945fab-0x0;var _0x313135=_0x7610[_0x945fab];return _0x313135;};'use strict';var _=require(_0x0761('0x0'));var util=require(_0x0761('0x1'));var logger=require(_0x0761('0x2'))(_0x0761('0x3'));var moment=require(_0x0761('0x4'));var BPromise=require(_0x0761('0x5'));var rp=require(_0x0761('0x6'));var fs=require('fs');var path=require(_0x0761('0x7'));var rimraf=require(_0x0761('0x8'));var config=require(_0x0761('0x9'));var attributes=require(_0x0761('0xa'));module['exports']=function(_0x50dc52,_0xbfd3be){return _0x50dc52[_0x0761('0xb')](_0x0761('0xc'),attributes,{'tableName':_0x0761('0xd'),'paranoid':![],'indexes':[{'name':_0x0761('0xe'),'fields':[_0x0761('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 534a6d7..ab504bc 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 _0xc18a=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0xb1271e,_0x4cd506){var _0x45d761=function(_0x4b2493){while(--_0x4b2493){_0xb1271e['push'](_0xb1271e['shift']());}};_0x45d761(++_0x4cd506);}(_0xc18a,0x1cf));var _0xac18=function(_0x326cf6,_0x29b9dd){_0x326cf6=_0x326cf6-0x0;var _0x27c42e=_0xc18a[_0x326cf6];return _0x27c42e;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var moment=require(_0xac18('0x2'));var BPromise=require(_0xac18('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac18('0x4'));var db=require(_0xac18('0x5'))['db'];var utils=require(_0xac18('0x6'));var logger=require(_0xac18('0x7'))(_0xac18('0x8'));var config=require(_0xac18('0x9'));var jayson=require(_0xac18('0xa'));var client=jayson[_0xac18('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xab6cb,_0x268fa1,_0x542a9){return new BPromise(function(_0x2bf4b8,_0xd3c4bc){return client[_0xac18('0xc')](_0xab6cb,_0x542a9)[_0xac18('0xd')](function(_0x223d7f){logger[_0xac18('0xe')](_0xac18('0xf'),_0x268fa1,_0xac18('0x10'));logger[_0xac18('0x11')](_0xac18('0x12'),_0x268fa1,_0xac18('0x10'),JSON['stringify'](_0x223d7f));if(_0x223d7f[_0xac18('0x13')]){if(_0x223d7f['error'][_0xac18('0x14')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x268fa1,_0x223d7f[_0xac18('0x13')]['message']);return _0xd3c4bc(_0x223d7f['error'][_0xac18('0x15')]);}logger[_0xac18('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x268fa1,_0x223d7f[_0xac18('0x13')][_0xac18('0x15')]);return _0x2bf4b8(_0x223d7f['error'][_0xac18('0x15')]);}else{logger['info'](_0xac18('0xf'),_0x268fa1,'request\x20sent');_0x2bf4b8(_0x223d7f['result'][_0xac18('0x15')]);}})[_0xac18('0x16')](function(_0x519c07){logger['error'](_0xac18('0xf'),_0x268fa1,_0x519c07);_0xd3c4bc(_0x519c07);});});} \ No newline at end of file +var _0xae30=['result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','info'];(function(_0x433145,_0x39f021){var _0x3357de=function(_0x5668c3){while(--_0x5668c3){_0x433145['push'](_0x433145['shift']());}};_0x3357de(++_0x39f021);}(_0xae30,0x10a));var _0x0ae3=function(_0x5b2155,_0x11bf44){_0x5b2155=_0x5b2155-0x0;var _0x1fd657=_0xae30[_0x5b2155];return _0x1fd657;};'use strict';var _=require(_0x0ae3('0x0'));var util=require(_0x0ae3('0x1'));var moment=require(_0x0ae3('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae3('0x3'));var fs=require('fs');var Redis=require(_0x0ae3('0x4'));var db=require(_0x0ae3('0x5'))['db'];var utils=require(_0x0ae3('0x6'));var logger=require('../../config/logger')(_0x0ae3('0x7'));var config=require(_0x0ae3('0x8'));var jayson=require(_0x0ae3('0x9'));var client=jayson[_0x0ae3('0xa')][_0x0ae3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xda3853,_0x2b81f4,_0x15b7e2){return new BPromise(function(_0x32ea6e,_0x34e783){return client[_0x0ae3('0xc')](_0xda3853,_0x15b7e2)[_0x0ae3('0xd')](function(_0x32ca2c){logger['info'](_0x0ae3('0xe'),_0x2b81f4,_0x0ae3('0xf'));logger['debug']('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2b81f4,_0x0ae3('0xf'),JSON[_0x0ae3('0x10')](_0x32ca2c));if(_0x32ca2c[_0x0ae3('0x11')]){if(_0x32ca2c[_0x0ae3('0x11')]['code']===0x1f4){logger['error'](_0x0ae3('0xe'),_0x2b81f4,_0x32ca2c[_0x0ae3('0x11')]['message']);return _0x34e783(_0x32ca2c['error'][_0x0ae3('0x12')]);}logger['error'](_0x0ae3('0xe'),_0x2b81f4,_0x32ca2c[_0x0ae3('0x11')][_0x0ae3('0x12')]);return _0x32ea6e(_0x32ca2c[_0x0ae3('0x11')][_0x0ae3('0x12')]);}else{logger[_0x0ae3('0x13')](_0x0ae3('0xe'),_0x2b81f4,'request\x20sent');_0x32ea6e(_0x32ca2c[_0x0ae3('0x14')]['message']);}})[_0x0ae3('0x15')](function(_0x254a0f){logger[_0x0ae3('0x11')](_0x0ae3('0xe'),_0x2b81f4,_0x254a0f);_0x34e783(_0x254a0f);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 3037838..d812760 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 _0x9f1b=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0xc15e2f,_0xea0b1e){var _0x45fa06=function(_0x6c126c){while(--_0x6c126c){_0xc15e2f['push'](_0xc15e2f['shift']());}};_0x45fa06(++_0xea0b1e);}(_0x9f1b,0xbd));var _0xb9f1=function(_0x1ffbae,_0x20a4d9){_0x1ffbae=_0x1ffbae-0x0;var _0x5ad985=_0x9f1b[_0x1ffbae];return _0x5ad985;};'use strict';var multer=require('multer');var util=require(_0xb9f1('0x0'));var path=require('path');var timeout=require(_0xb9f1('0x1'));var express=require(_0xb9f1('0x2'));var router=express['Router']();var fs_extra=require(_0xb9f1('0x3'));var auth=require(_0xb9f1('0x4'));var interaction=require(_0xb9f1('0x5'));var config=require(_0xb9f1('0x6'));var controller=require(_0xb9f1('0x7'));router[_0xb9f1('0x8')]('/',auth[_0xb9f1('0x9')](),controller['index']);router[_0xb9f1('0x8')](_0xb9f1('0xa'),auth[_0xb9f1('0x9')](),controller[_0xb9f1('0xb')]);router[_0xb9f1('0xc')]('/',auth[_0xb9f1('0x9')](),controller[_0xb9f1('0xd')]);router[_0xb9f1('0xe')]('/:id',auth[_0xb9f1('0x9')](),controller[_0xb9f1('0xf')]);router[_0xb9f1('0x10')](_0xb9f1('0xa'),auth[_0xb9f1('0x9')](),controller[_0xb9f1('0x11')]);module[_0xb9f1('0x12')]=router; \ No newline at end of file +var _0x6d26=['../../components/auth/service','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','show','post','create','put','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d26,0xe4));var _0x66d2=function(_0x1f4acb,_0x1aedfd){_0x1f4acb=_0x1f4acb-0x0;var _0x51a2ad=_0x6d26[_0x1f4acb];return _0x51a2ad;};'use strict';var multer=require(_0x66d2('0x0'));var util=require(_0x66d2('0x1'));var path=require('path');var timeout=require(_0x66d2('0x2'));var express=require(_0x66d2('0x3'));var router=express[_0x66d2('0x4')]();var fs_extra=require(_0x66d2('0x5'));var auth=require(_0x66d2('0x6'));var interaction=require(_0x66d2('0x7'));var config=require('../../config/environment');var controller=require(_0x66d2('0x8'));router[_0x66d2('0x9')]('/',auth[_0x66d2('0xa')](),controller[_0x66d2('0xb')]);router[_0x66d2('0x9')]('/:id',auth[_0x66d2('0xa')](),controller[_0x66d2('0xc')]);router[_0x66d2('0xd')]('/',auth['isAuthenticated'](),controller[_0x66d2('0xe')]);router[_0x66d2('0xf')](_0x66d2('0x10'),auth[_0x66d2('0xa')](),controller['update']);router['delete'](_0x66d2('0x10'),auth[_0x66d2('0xa')](),controller['destroy']);module[_0x66d2('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 9c368b7..27f45e6 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 _0xd7d4=['name','STRING','exports'];(function(_0x452db0,_0x5cf2d4){var _0x29130d=function(_0x161686){while(--_0x161686){_0x452db0['push'](_0x452db0['shift']());}};_0x29130d(++_0x5cf2d4);}(_0xd7d4,0x1c4));var _0x4d7d=function(_0x1dfa63,_0x362bd4){_0x1dfa63=_0x1dfa63-0x0;var _0x26f2a9=_0xd7d4[_0x1dfa63];return _0x26f2a9;};'use strict';var Sequelize=require('sequelize');module[_0x4d7d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4d7d('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4d7d('0x2')]}}; \ No newline at end of file +var _0xdd2c=['name','STRING','sequelize'];(function(_0x3d5409,_0x295eab){var _0x1a7b69=function(_0x23f85f){while(--_0x23f85f){_0x3d5409['push'](_0x3d5409['shift']());}};_0x1a7b69(++_0x295eab);}(_0xdd2c,0x1b2));var _0xcdd2=function(_0x4e966d,_0x59dad3){_0x4e966d=_0x4e966d-0x0;var _0x317cfd=_0xdd2c[_0x4e966d];return _0x317cfd;};'use strict';var Sequelize=require(_0xcdd2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcdd2('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xcdd2('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 695d175..cc3c716 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 _0x9ed8=['options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Pauses','userProfileId','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','to-csv','fs-extra','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','Pause','fieldName','type','key','model','keys','intersection','attributes','fields','length','query','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','rows','show','rawAttributes'];(function(_0x50c7d6,_0x43aaed){var _0x4e1b11=function(_0x247a15){while(--_0x247a15){_0x50c7d6['push'](_0x50c7d6['shift']());}};_0x4e1b11(++_0x43aaed);}(_0x9ed8,0x1e6));var _0x89ed=function(_0x43a3c4,_0x56035b){_0x43a3c4=_0x43a3c4-0x0;var _0x1b6661=_0x9ed8[_0x43a3c4];return _0x1b6661;};'use strict';var emlformat=require(_0x89ed('0x0'));var rimraf=require(_0x89ed('0x1'));var zipdir=require(_0x89ed('0x2'));var jsonpatch=require(_0x89ed('0x3'));var rp=require(_0x89ed('0x4'));var moment=require(_0x89ed('0x5'));var BPromise=require(_0x89ed('0x6'));var Mustache=require(_0x89ed('0x7'));var util=require('util');var path=require(_0x89ed('0x8'));var sox=require('sox');var csv=require(_0x89ed('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89ed('0xa'));var _=require('lodash');var squel=require(_0x89ed('0xb'));var crypto=require(_0x89ed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x89ed('0xd'));var toCsv=require(_0x89ed('0x9'));var querystring=require('querystring');var Papa=require(_0x89ed('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x89ed('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89ed('0x10'));var logger=require(_0x89ed('0x11'))(_0x89ed('0x12'));var utils=require(_0x89ed('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5903c0,_0x5365c9){_0x5365c9=_0x5365c9||0xcc;return function(_0x174dc6){if(_0x174dc6){return _0x5903c0[_0x89ed('0x14')](_0x5365c9);}return _0x5903c0[_0x89ed('0x15')](_0x5365c9)[_0x89ed('0x16')]();};}function respondWithResult(_0x106353,_0x59d76c){_0x59d76c=_0x59d76c||0xc8;return function(_0x53b9b5){if(_0x53b9b5){return _0x106353[_0x89ed('0x15')](_0x59d76c)['json'](_0x53b9b5);}};}function respondWithFilteredResult(_0x2f8247,_0x137e07){return function(_0x38ca99){if(_0x38ca99){var _0x97df6f=typeof _0x137e07[_0x89ed('0x17')]==='undefined'&&typeof _0x137e07[_0x89ed('0x18')]===_0x89ed('0x19');var _0x476746=_0x38ca99[_0x89ed('0x1a')];var _0x280545=_0x97df6f?0x0:_0x137e07[_0x89ed('0x17')];var _0x85c19f=_0x97df6f?_0x38ca99[_0x89ed('0x1a')]:_0x137e07[_0x89ed('0x17')]+_0x137e07['limit'];var _0x1bdd83;if(_0x85c19f>=_0x476746){_0x85c19f=_0x476746;_0x1bdd83=0xc8;}else{_0x1bdd83=0xce;}_0x2f8247[_0x89ed('0x15')](_0x1bdd83);return _0x2f8247[_0x89ed('0x1b')](_0x89ed('0x1c'),_0x280545+'-'+_0x85c19f+'/'+_0x476746)[_0x89ed('0x1d')](_0x38ca99);}return null;};}function patchUpdates(_0x417f3a){return function(_0x59f80a){try{jsonpatch[_0x89ed('0x1e')](_0x59f80a,_0x417f3a,!![]);}catch(_0x36485b){return BPromise['reject'](_0x36485b);}return _0x59f80a[_0x89ed('0x1f')]();};}function saveUpdates(_0x11f5b3,_0x29d863){return function(_0x26ddf2){if(_0x26ddf2){return _0x26ddf2[_0x89ed('0x20')](_0x11f5b3)[_0x89ed('0x21')](function(_0x1f88c9){return _0x1f88c9;});}return null;};}function removeEntity(_0x45c5d9,_0x4ccca6){return function(_0x19fa40){if(_0x19fa40){return _0x19fa40[_0x89ed('0x22')]()[_0x89ed('0x21')](function(){var _0x1cda90=_0x19fa40[_0x89ed('0x23')]({'plain':!![]});var _0x308bf2='Pauses';return db[_0x89ed('0x24')][_0x89ed('0x22')]({'where':{'type':_0x308bf2,'resourceId':_0x1cda90['id']}})[_0x89ed('0x21')](function(){return _0x19fa40;});})[_0x89ed('0x21')](function(){_0x45c5d9[_0x89ed('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x449ee6,_0x48b000){return function(_0x1b096e){if(!_0x1b096e){_0x449ee6[_0x89ed('0x14')](0x194);}return _0x1b096e;};}function handleError(_0x44ecaa,_0xe40b72){_0xe40b72=_0xe40b72||0x1f4;return function(_0x2b8f4c){logger[_0x89ed('0x25')](_0x2b8f4c[_0x89ed('0x26')]);if(_0x2b8f4c[_0x89ed('0x27')]){delete _0x2b8f4c['name'];}_0x44ecaa[_0x89ed('0x15')](_0xe40b72)[_0x89ed('0x28')](_0x2b8f4c);};}exports[_0x89ed('0x29')]=function(_0x3cf520,_0x3190c5){var _0x4a1525={},_0x23a26e={},_0x16df00={'count':0x0,'rows':[]};var _0x4e0cc7=_[_0x89ed('0x2a')](db[_0x89ed('0x2b')]['rawAttributes'],function(_0x5cd209){return{'name':_0x5cd209[_0x89ed('0x2c')],'type':_0x5cd209[_0x89ed('0x2d')][_0x89ed('0x2e')]};});_0x23a26e[_0x89ed('0x2f')]=_[_0x89ed('0x2a')](_0x4e0cc7,_0x89ed('0x27'));_0x23a26e['query']=_[_0x89ed('0x30')](_0x3cf520['query']);_0x23a26e['filters']=_[_0x89ed('0x31')](_0x23a26e[_0x89ed('0x2f')],_0x23a26e['query']);_0x4a1525[_0x89ed('0x32')]=_['intersection'](_0x23a26e['model'],qs[_0x89ed('0x33')](_0x3cf520['query'][_0x89ed('0x33')]));_0x4a1525[_0x89ed('0x32')]=_0x4a1525[_0x89ed('0x32')][_0x89ed('0x34')]?_0x4a1525[_0x89ed('0x32')]:_0x23a26e[_0x89ed('0x2f')];if(!_0x3cf520[_0x89ed('0x35')]['hasOwnProperty'](_0x89ed('0x36'))){_0x4a1525[_0x89ed('0x18')]=qs[_0x89ed('0x18')](_0x3cf520[_0x89ed('0x35')][_0x89ed('0x18')]);_0x4a1525['offset']=qs[_0x89ed('0x17')](_0x3cf520[_0x89ed('0x35')][_0x89ed('0x17')]);}_0x4a1525[_0x89ed('0x37')]=qs[_0x89ed('0x38')](_0x3cf520['query'][_0x89ed('0x38')]);_0x4a1525[_0x89ed('0x39')]=qs[_0x89ed('0x3a')](_[_0x89ed('0x3b')](_0x3cf520[_0x89ed('0x35')],_0x23a26e[_0x89ed('0x3a')]),_0x4e0cc7);if(_0x3cf520[_0x89ed('0x35')][_0x89ed('0x3c')]){_0x4a1525[_0x89ed('0x39')]=_['merge'](_0x4a1525[_0x89ed('0x39')],{'$or':_[_0x89ed('0x2a')](_0x4e0cc7,function(_0x2fc38c){if(_0x2fc38c['type']!=='VIRTUAL'){var _0x522143={};_0x522143[_0x2fc38c[_0x89ed('0x27')]]={'$like':'%'+_0x3cf520[_0x89ed('0x35')][_0x89ed('0x3c')]+'%'};return _0x522143;}})});}_0x4a1525=_[_0x89ed('0x3d')]({},_0x4a1525,_0x3cf520['options']);var _0x21601a={'where':_0x4a1525[_0x89ed('0x39')]};return db[_0x89ed('0x2b')][_0x89ed('0x1a')](_0x21601a)['then'](function(_0x4e29b7){_0x16df00[_0x89ed('0x1a')]=_0x4e29b7;if(_0x3cf520[_0x89ed('0x35')][_0x89ed('0x3e')]){_0x4a1525[_0x89ed('0x3f')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x4a1525);})[_0x89ed('0x21')](function(_0x57d78c){_0x16df00[_0x89ed('0x40')]=_0x57d78c;return _0x16df00;})[_0x89ed('0x21')](respondWithFilteredResult(_0x3190c5,_0x4a1525))['catch'](handleError(_0x3190c5,null));};exports[_0x89ed('0x41')]=function(_0x37f122,_0x1cbcfb){var _0x2c4122={'raw':!![],'where':{'id':_0x37f122['params']['id']}},_0x1ad6bc={};_0x1ad6bc[_0x89ed('0x2f')]=_[_0x89ed('0x30')](db[_0x89ed('0x2b')][_0x89ed('0x42')]);_0x1ad6bc['query']=_['keys'](_0x37f122[_0x89ed('0x35')]);_0x1ad6bc['filters']=_[_0x89ed('0x31')](_0x1ad6bc[_0x89ed('0x2f')],_0x1ad6bc[_0x89ed('0x35')]);_0x2c4122[_0x89ed('0x32')]=_[_0x89ed('0x31')](_0x1ad6bc['model'],qs[_0x89ed('0x33')](_0x37f122[_0x89ed('0x35')]['fields']));_0x2c4122[_0x89ed('0x32')]=_0x2c4122['attributes']['length']?_0x2c4122[_0x89ed('0x32')]:_0x1ad6bc['model'];if(_0x37f122[_0x89ed('0x35')][_0x89ed('0x3e')]){_0x2c4122[_0x89ed('0x3f')]=[{'all':!![]}];}_0x2c4122=_[_0x89ed('0x3d')]({},_0x2c4122,_0x37f122[_0x89ed('0x43')]);return db[_0x89ed('0x2b')][_0x89ed('0x44')](_0x2c4122)['then'](handleEntityNotFound(_0x1cbcfb,null))[_0x89ed('0x21')](respondWithResult(_0x1cbcfb,null))[_0x89ed('0x45')](handleError(_0x1cbcfb,null));};exports[_0x89ed('0x46')]=function(_0x1fc39f,_0x1a0deb){return db[_0x89ed('0x2b')][_0x89ed('0x46')](_0x1fc39f[_0x89ed('0x47')],{})['then'](function(_0x4a5413){var _0x34278a=_0x1fc39f[_0x89ed('0x48')][_0x89ed('0x23')]({'plain':!![]});if(!_0x34278a)throw new Error(_0x89ed('0x49'));if(_0x34278a['role']===_0x89ed('0x48')){var _0x7c35f1=_0x4a5413[_0x89ed('0x23')]({'plain':!![]});var _0x17b14f=_0x89ed('0x4a');return db['UserProfileSection'][_0x89ed('0x44')]({'where':{'name':_0x17b14f,'userProfileId':_0x34278a[_0x89ed('0x4b')]},'raw':!![]})[_0x89ed('0x21')](function(_0x4891c3){if(_0x4891c3&&_0x4891c3[_0x89ed('0x4c')]===0x0){return db[_0x89ed('0x24')]['create']({'name':_0x7c35f1['name'],'resourceId':_0x7c35f1['id'],'type':_0x4891c3['name'],'sectionId':_0x4891c3['id']},{})['then'](function(){return _0x4a5413;});}else{return _0x4a5413;}})[_0x89ed('0x45')](function(_0x312b9f){logger[_0x89ed('0x25')](_0x89ed('0x4d'),_0x312b9f);throw _0x312b9f;});}return _0x4a5413;})['then'](respondWithResult(_0x1a0deb,0xc9))[_0x89ed('0x45')](handleError(_0x1a0deb,null));};exports[_0x89ed('0x20')]=function(_0x2f57d1,_0x4da075){if(_0x2f57d1[_0x89ed('0x47')]['id']){delete _0x2f57d1[_0x89ed('0x47')]['id'];}return db['Pause']['find']({'where':{'id':_0x2f57d1[_0x89ed('0x4e')]['id']}})[_0x89ed('0x21')](handleEntityNotFound(_0x4da075,null))[_0x89ed('0x21')](saveUpdates(_0x2f57d1[_0x89ed('0x47')],null))[_0x89ed('0x21')](respondWithResult(_0x4da075,null))[_0x89ed('0x45')](handleError(_0x4da075,null));};exports[_0x89ed('0x22')]=function(_0x45bbd6,_0x2896d7){return db[_0x89ed('0x2b')]['find']({'where':{'id':_0x45bbd6[_0x89ed('0x4e')]['id']}})[_0x89ed('0x21')](handleEntityNotFound(_0x2896d7,null))['then'](removeEntity(_0x2896d7,null))[_0x89ed('0x45')](handleError(_0x2896d7,null));}; \ No newline at end of file +var _0x75dc=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','index','map','Pause','rawAttributes','type','key','model','query','keys','attributes'];(function(_0x353643,_0x568495){var _0x394b32=function(_0x3924ae){while(--_0x3924ae){_0x353643['push'](_0x353643['shift']());}};_0x394b32(++_0x568495);}(_0x75dc,0xcb));var _0xc75d=function(_0x31b11d,_0x5d7fa9){_0x31b11d=_0x31b11d-0x0;var _0x1c1668=_0x75dc[_0x31b11d];return _0x1c1668;};'use strict';var emlformat=require(_0xc75d('0x0'));var rimraf=require(_0xc75d('0x1'));var zipdir=require(_0xc75d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc75d('0x3'));var moment=require('moment');var BPromise=require(_0xc75d('0x4'));var Mustache=require(_0xc75d('0x5'));var util=require(_0xc75d('0x6'));var path=require(_0xc75d('0x7'));var sox=require(_0xc75d('0x8'));var csv=require(_0xc75d('0x9'));var ejs=require(_0xc75d('0xa'));var fs=require('fs');var fs_extra=require(_0xc75d('0xb'));var _=require(_0xc75d('0xc'));var squel=require(_0xc75d('0xd'));var crypto=require(_0xc75d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc75d('0xf'));var toCsv=require(_0xc75d('0x9'));var querystring=require(_0xc75d('0x10'));var Papa=require(_0xc75d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc75d('0x12'));var as=require(_0xc75d('0x13'));var hardwareService=require(_0xc75d('0x14'));var logger=require('../../config/logger')(_0xc75d('0x15'));var utils=require(_0xc75d('0x16'));var config=require(_0xc75d('0x17'));var licenseUtil=require(_0xc75d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27e98e,_0x217980){_0x217980=_0x217980||0xcc;return function(_0x4c2fad){if(_0x4c2fad){return _0x27e98e[_0xc75d('0x19')](_0x217980);}return _0x27e98e['status'](_0x217980)[_0xc75d('0x1a')]();};}function respondWithResult(_0x5c80f6,_0x313019){_0x313019=_0x313019||0xc8;return function(_0x126f61){if(_0x126f61){return _0x5c80f6['status'](_0x313019)['json'](_0x126f61);}};}function respondWithFilteredResult(_0x1a3af3,_0x344fec){return function(_0x14da10){if(_0x14da10){var _0x1ba0c2=typeof _0x344fec[_0xc75d('0x1b')]===_0xc75d('0x1c')&&typeof _0x344fec[_0xc75d('0x1d')]==='undefined';var _0x5d7806=_0x14da10['count'];var _0x598bce=_0x1ba0c2?0x0:_0x344fec['offset'];var _0x5625f9=_0x1ba0c2?_0x14da10[_0xc75d('0x1e')]:_0x344fec[_0xc75d('0x1b')]+_0x344fec[_0xc75d('0x1d')];var _0x4b537c;if(_0x5625f9>=_0x5d7806){_0x5625f9=_0x5d7806;_0x4b537c=0xc8;}else{_0x4b537c=0xce;}_0x1a3af3[_0xc75d('0x1f')](_0x4b537c);return _0x1a3af3[_0xc75d('0x20')](_0xc75d('0x21'),_0x598bce+'-'+_0x5625f9+'/'+_0x5d7806)[_0xc75d('0x22')](_0x14da10);}return null;};}function patchUpdates(_0x5abaff){return function(_0x36e497){try{jsonpatch[_0xc75d('0x23')](_0x36e497,_0x5abaff,!![]);}catch(_0x533741){return BPromise['reject'](_0x533741);}return _0x36e497['save']();};}function saveUpdates(_0x3cd2c4,_0xb8be8f){return function(_0x5ea4e7){if(_0x5ea4e7){return _0x5ea4e7[_0xc75d('0x24')](_0x3cd2c4)[_0xc75d('0x25')](function(_0x2053dd){return _0x2053dd;});}return null;};}function removeEntity(_0x326570,_0x112e39){return function(_0x1052aa){if(_0x1052aa){return _0x1052aa[_0xc75d('0x26')]()[_0xc75d('0x25')](function(){var _0x1bf2c5=_0x1052aa[_0xc75d('0x27')]({'plain':!![]});var _0x3108f1=_0xc75d('0x28');return db[_0xc75d('0x29')][_0xc75d('0x26')]({'where':{'type':_0x3108f1,'resourceId':_0x1bf2c5['id']}})['then'](function(){return _0x1052aa;});})['then'](function(){_0x326570[_0xc75d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec1b1,_0x341561){return function(_0x2bd44d){if(!_0x2bd44d){_0x4ec1b1[_0xc75d('0x19')](0x194);}return _0x2bd44d;};}function handleError(_0x264402,_0x5b4618){_0x5b4618=_0x5b4618||0x1f4;return function(_0x2cf9bd){logger[_0xc75d('0x2a')](_0x2cf9bd[_0xc75d('0x2b')]);if(_0x2cf9bd['name']){delete _0x2cf9bd[_0xc75d('0x2c')];}_0x264402[_0xc75d('0x1f')](_0x5b4618)['send'](_0x2cf9bd);};}exports[_0xc75d('0x2d')]=function(_0x2840d3,_0x3edf53){var _0x5d32ef={},_0x24d952={},_0x22e6c5={'count':0x0,'rows':[]};var _0x5e3699=_[_0xc75d('0x2e')](db[_0xc75d('0x2f')][_0xc75d('0x30')],function(_0x34a559){return{'name':_0x34a559['fieldName'],'type':_0x34a559[_0xc75d('0x31')][_0xc75d('0x32')]};});_0x24d952[_0xc75d('0x33')]=_['map'](_0x5e3699,_0xc75d('0x2c'));_0x24d952[_0xc75d('0x34')]=_[_0xc75d('0x35')](_0x2840d3['query']);_0x24d952['filters']=_['intersection'](_0x24d952['model'],_0x24d952[_0xc75d('0x34')]);_0x5d32ef[_0xc75d('0x36')]=_[_0xc75d('0x37')](_0x24d952['model'],qs[_0xc75d('0x38')](_0x2840d3[_0xc75d('0x34')][_0xc75d('0x38')]));_0x5d32ef[_0xc75d('0x36')]=_0x5d32ef['attributes'][_0xc75d('0x39')]?_0x5d32ef['attributes']:_0x24d952[_0xc75d('0x33')];if(!_0x2840d3[_0xc75d('0x34')][_0xc75d('0x3a')](_0xc75d('0x3b'))){_0x5d32ef['limit']=qs[_0xc75d('0x1d')](_0x2840d3[_0xc75d('0x34')]['limit']);_0x5d32ef['offset']=qs[_0xc75d('0x1b')](_0x2840d3[_0xc75d('0x34')][_0xc75d('0x1b')]);}_0x5d32ef[_0xc75d('0x3c')]=qs[_0xc75d('0x3d')](_0x2840d3[_0xc75d('0x34')][_0xc75d('0x3d')]);_0x5d32ef[_0xc75d('0x3e')]=qs[_0xc75d('0x3f')](_[_0xc75d('0x40')](_0x2840d3[_0xc75d('0x34')],_0x24d952['filters']),_0x5e3699);if(_0x2840d3[_0xc75d('0x34')][_0xc75d('0x41')]){_0x5d32ef['where']=_['merge'](_0x5d32ef[_0xc75d('0x3e')],{'$or':_[_0xc75d('0x2e')](_0x5e3699,function(_0x31d3fe){if(_0x31d3fe[_0xc75d('0x31')]!==_0xc75d('0x42')){var _0x574ef0={};_0x574ef0[_0x31d3fe[_0xc75d('0x2c')]]={'$like':'%'+_0x2840d3[_0xc75d('0x34')]['filter']+'%'};return _0x574ef0;}})});}_0x5d32ef=_[_0xc75d('0x43')]({},_0x5d32ef,_0x2840d3[_0xc75d('0x44')]);var _0x1dbd95={'where':_0x5d32ef[_0xc75d('0x3e')]};return db[_0xc75d('0x2f')][_0xc75d('0x1e')](_0x1dbd95)['then'](function(_0x5ea1d9){_0x22e6c5['count']=_0x5ea1d9;if(_0x2840d3[_0xc75d('0x34')][_0xc75d('0x45')]){_0x5d32ef['include']=[{'all':!![]}];}return db['Pause'][_0xc75d('0x46')](_0x5d32ef);})[_0xc75d('0x25')](function(_0x5c5942){_0x22e6c5[_0xc75d('0x47')]=_0x5c5942;return _0x22e6c5;})[_0xc75d('0x25')](respondWithFilteredResult(_0x3edf53,_0x5d32ef))[_0xc75d('0x48')](handleError(_0x3edf53,null));};exports[_0xc75d('0x49')]=function(_0x42c335,_0xf4d772){var _0x500e7a={'raw':!![],'where':{'id':_0x42c335[_0xc75d('0x4a')]['id']}},_0x212448={};_0x212448[_0xc75d('0x33')]=_[_0xc75d('0x35')](db['Pause']['rawAttributes']);_0x212448[_0xc75d('0x34')]=_[_0xc75d('0x35')](_0x42c335[_0xc75d('0x34')]);_0x212448['filters']=_[_0xc75d('0x37')](_0x212448[_0xc75d('0x33')],_0x212448['query']);_0x500e7a[_0xc75d('0x36')]=_[_0xc75d('0x37')](_0x212448[_0xc75d('0x33')],qs[_0xc75d('0x38')](_0x42c335[_0xc75d('0x34')][_0xc75d('0x38')]));_0x500e7a[_0xc75d('0x36')]=_0x500e7a[_0xc75d('0x36')][_0xc75d('0x39')]?_0x500e7a['attributes']:_0x212448['model'];if(_0x42c335['query'][_0xc75d('0x45')]){_0x500e7a[_0xc75d('0x4b')]=[{'all':!![]}];}_0x500e7a=_['merge']({},_0x500e7a,_0x42c335[_0xc75d('0x44')]);return db[_0xc75d('0x2f')]['find'](_0x500e7a)[_0xc75d('0x25')](handleEntityNotFound(_0xf4d772,null))[_0xc75d('0x25')](respondWithResult(_0xf4d772,null))['catch'](handleError(_0xf4d772,null));};exports[_0xc75d('0x4c')]=function(_0x55166a,_0x5c1790){return db[_0xc75d('0x2f')]['create'](_0x55166a[_0xc75d('0x4d')],{})[_0xc75d('0x25')](function(_0x368bf9){var _0x4d100c=_0x55166a[_0xc75d('0x4e')][_0xc75d('0x27')]({'plain':!![]});if(!_0x4d100c)throw new Error(_0xc75d('0x4f'));if(_0x4d100c[_0xc75d('0x50')]==='user'){var _0x2d1ea6=_0x368bf9[_0xc75d('0x27')]({'plain':!![]});var _0x21f262=_0xc75d('0x28');return db[_0xc75d('0x51')][_0xc75d('0x52')]({'where':{'name':_0x21f262,'userProfileId':_0x4d100c[_0xc75d('0x53')]},'raw':!![]})['then'](function(_0x23f662){if(_0x23f662&&_0x23f662[_0xc75d('0x54')]===0x0){return db[_0xc75d('0x29')]['create']({'name':_0x2d1ea6[_0xc75d('0x2c')],'resourceId':_0x2d1ea6['id'],'type':_0x23f662[_0xc75d('0x2c')],'sectionId':_0x23f662['id']},{})[_0xc75d('0x25')](function(){return _0x368bf9;});}else{return _0x368bf9;}})[_0xc75d('0x48')](function(_0x5d6548){logger['error'](_0xc75d('0x55'),_0x5d6548);throw _0x5d6548;});}return _0x368bf9;})[_0xc75d('0x25')](respondWithResult(_0x5c1790,0xc9))[_0xc75d('0x48')](handleError(_0x5c1790,null));};exports[_0xc75d('0x24')]=function(_0x2433ef,_0x15f8ea){if(_0x2433ef['body']['id']){delete _0x2433ef[_0xc75d('0x4d')]['id'];}return db[_0xc75d('0x2f')][_0xc75d('0x52')]({'where':{'id':_0x2433ef[_0xc75d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x15f8ea,null))['then'](saveUpdates(_0x2433ef[_0xc75d('0x4d')],null))[_0xc75d('0x25')](respondWithResult(_0x15f8ea,null))[_0xc75d('0x48')](handleError(_0x15f8ea,null));};exports['destroy']=function(_0xdc671f,_0x28070c){return db[_0xc75d('0x2f')]['find']({'where':{'id':_0xdc671f[_0xc75d('0x4a')]['id']}})[_0xc75d('0x25')](handleEntityNotFound(_0x28070c,null))[_0xc75d('0x25')](removeEntity(_0x28070c,null))[_0xc75d('0x48')](handleError(_0x28070c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4a65791..1738495 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 _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0xa9a64f,_0x58ce52){var _0x405904=function(_0xdc1898){while(--_0xdc1898){_0xa9a64f['push'](_0xa9a64f['shift']());}};_0x405904(++_0x58ce52);}(_0xe14b,0x93));var _0xbe14=function(_0x5cb665,_0x39e787){_0x5cb665=_0x5cb665-0x0;var _0x13ef84=_0xe14b[_0x5cb665];return _0x13ef84;};'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 diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 15c2450..2cd108a 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x34e89c,_0x3e95dd){var _0x37db46=function(_0xeb0fb8){while(--_0xeb0fb8){_0x34e89c['push'](_0x34e89c['shift']());}};_0x37db46(++_0x3e95dd);}(_0xb10b,0x12a));var _0xbb10=function(_0x17db61,_0x364236){_0x17db61=_0x17db61-0x0;var _0x7ac96b=_0xb10b[_0x17db61];return _0x7ac96b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0xe64cd1,_0x34d8dd){var _0x2f7ac6=function(_0x1e23a2){while(--_0x1e23a2){_0xe64cd1['push'](_0xe64cd1['shift']());}};_0x2f7ac6(++_0x34d8dd);}(_0x7a54,0x106));var _0x47a5=function(_0x462874,_0xb9a976){_0x462874=_0x462874-0x0;var _0x52f064=_0x7a54[_0x462874];return _0x52f064;};'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 82bc6cf..2eb3c63 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 _0x4c4e=['webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook'];(function(_0x40b598,_0x4dda7e){var _0xd574fd=function(_0x4ea633){while(--_0x4ea633){_0x40b598['push'](_0x40b598['shift']());}};_0xd574fd(++_0x4dda7e);}(_0x4c4e,0x152));var _0xe4c4=function(_0xb51f6c,_0x4e3071){_0xb51f6c=_0xb51f6c-0x0;var _0x21b617=_0x4c4e[_0xb51f6c];return _0x21b617;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['show']);router['get'](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);var upload=multer({'storage':multer[_0xe4c4('0x10')]({'destination':function(_0x333c08,_0x2f4d5f,_0x50264f){_0x50264f(null,path[_0xe4c4('0x11')](config[_0xe4c4('0x12')],_0xe4c4('0x13')));},'filename':function(_0x2483d0,_0x50bfab,_0x262083){_0x50bfab[_0xe4c4('0x14')]=_0x50bfab['originalname'][_0xe4c4('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x262083(null,util[_0xe4c4('0x16')]('%s-%s%s',path[_0xe4c4('0x17')](_0x50bfab[_0xe4c4('0x14')],path['extname'](_0x50bfab[_0xe4c4('0x14')])),Date[_0xe4c4('0x18')](),path[_0xe4c4('0x19')](_0x50bfab[_0xe4c4('0x14')])));}})});router[_0xe4c4('0x1a')]('/',upload[_0xe4c4('0x1b')](_0xe4c4('0x1c')),controller[_0xe4c4('0x1d')]);router[_0xe4c4('0x1a')](_0xe4c4('0xb'),controller[_0xe4c4('0x1e')]);router[_0xe4c4('0x1f')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x20')]);router['delete'](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x21')]);module[_0xe4c4('0x22')]=router; \ No newline at end of file +var _0x55e0=['webhookPost','update','delete','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','post','file','upload','/webhook'];(function(_0x490033,_0x27f4e7){var _0x2269bf=function(_0x332e3d){while(--_0x332e3d){_0x490033['push'](_0x490033['shift']());}};_0x2269bf(++_0x27f4e7);}(_0x55e0,0xdc));var _0x055e=function(_0x1a1eab,_0x28d992){_0x1a1eab=_0x1a1eab-0x0;var _0x260bb7=_0x55e0[_0x1a1eab];return _0x260bb7;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x055e('0x4'));var auth=require(_0x055e('0x5'));var interaction=require(_0x055e('0x6'));var config=require(_0x055e('0x7'));var controller=require(_0x055e('0x8'));router[_0x055e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x055e('0x9')]('/webhook',controller[_0x055e('0xa')]);router[_0x055e('0x9')](_0x055e('0xb'),auth[_0x055e('0xc')](),controller[_0x055e('0xd')]);router['get'](_0x055e('0xe'),auth[_0x055e('0xc')](),controller[_0x055e('0xf')]);var upload=multer({'storage':multer[_0x055e('0x10')]({'destination':function(_0x238068,_0x5237d9,_0x56c78a){_0x56c78a(null,path[_0x055e('0x11')](config['root'],_0x055e('0x12')));},'filename':function(_0x466da3,_0x72d424,_0x101bc3){_0x72d424[_0x055e('0x13')]=_0x72d424[_0x055e('0x13')][_0x055e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x101bc3(null,util['format'](_0x055e('0x15'),path[_0x055e('0x16')](_0x72d424[_0x055e('0x13')],path[_0x055e('0x17')](_0x72d424[_0x055e('0x13')])),Date['now'](),path[_0x055e('0x17')](_0x72d424[_0x055e('0x13')])));}})});router[_0x055e('0x18')]('/',upload['single'](_0x055e('0x19')),controller[_0x055e('0x1a')]);router[_0x055e('0x18')](_0x055e('0x1b'),controller[_0x055e('0x1c')]);router['put'](_0x055e('0xb'),auth[_0x055e('0xc')](),controller[_0x055e('0x1d')]);router[_0x055e('0x1e')]('/:id',auth[_0x055e('0xc')](),controller[_0x055e('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index fa1d135..7cca552 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 _0x7f43=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x7f43,0x6f));var _0x37f4=function(_0x4267df,_0x5ada59){_0x4267df=_0x4267df-0x0;var _0x1dd02f=_0x7f43[_0x4267df];return _0x1dd02f;};'use strict';var Sequelize=require(_0x37f4('0x0'));module['exports']={'name':{'type':Sequelize[_0x37f4('0x1')]},'type':{'type':Sequelize[_0x37f4('0x2')](_0x37f4('0x3'),_0x37f4('0x4'))},'description':{'type':Sequelize[_0x37f4('0x5')]},'version':{'type':Sequelize[_0x37f4('0x5')]},'path':{'type':Sequelize[_0x37f4('0x1')],'comment':_0x37f4('0x6')},'active':{'type':Sequelize[_0x37f4('0x7')],'defaultValue':0x0,'comment':_0x37f4('0x8')},'sidebar':{'type':Sequelize[_0x37f4('0x2')](_0x37f4('0x9'),_0x37f4('0xa'),'always',_0x37f4('0xb')),'defaultValue':_0x37f4('0xc'),'comment':_0x37f4('0xd')},'icon':{'type':Sequelize[_0x37f4('0x1')]},'adminUrl':{'type':Sequelize[_0x37f4('0x1')]},'agentUrl':{'type':Sequelize[_0x37f4('0x1')]},'scriptName':{'type':Sequelize[_0x37f4('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9c13=['agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x9c13,0x12a));var _0x39c1=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0x9c13[_0x576e2b];return _0x46461a;};'use strict';var Sequelize=require(_0x39c1('0x0'));module[_0x39c1('0x1')]={'name':{'type':Sequelize[_0x39c1('0x2')]},'type':{'type':Sequelize[_0x39c1('0x3')](_0x39c1('0x4'),_0x39c1('0x5'))},'description':{'type':Sequelize[_0x39c1('0x6')]},'version':{'type':Sequelize[_0x39c1('0x6')]},'path':{'type':Sequelize[_0x39c1('0x2')],'comment':_0x39c1('0x7')},'active':{'type':Sequelize[_0x39c1('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x39c1('0x3')](_0x39c1('0x9'),_0x39c1('0xa'),_0x39c1('0xb'),_0x39c1('0xc')),'defaultValue':_0x39c1('0xb'),'comment':_0x39c1('0xd')},'icon':{'type':Sequelize[_0x39c1('0x2')]},'adminUrl':{'type':Sequelize[_0x39c1('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x39c1('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index e313ccd..e8eedba 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 _0x1e38=['code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','node_modules/**/*','attachments/**/*','close','Plugin\x20not\x20found','format','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','some','Plugin\x20manifest\x20missing','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','script','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','dirname','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','send','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','UserProfileResource','destroy','then','error','map','Plugin','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','include','rows','show','params','keys','options','find','catch','download','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning'];(function(_0x3c6305,_0x43dde1){var _0x22685a=function(_0x3e55c5){while(--_0x3e55c5){_0x3c6305['push'](_0x3c6305['shift']());}};_0x22685a(++_0x43dde1);}(_0x1e38,0x1b3));var _0x81e3=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x1e38[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x81e3('0x0'));var jsonpatch=require(_0x81e3('0x1'));var rp=require(_0x81e3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x81e3('0x3'));var util=require(_0x81e3('0x4'));var path=require(_0x81e3('0x5'));var sox=require('sox');var csv=require(_0x81e3('0x6'));var ejs=require(_0x81e3('0x7'));var fs=require('fs');var fs_extra=require(_0x81e3('0x8'));var _=require(_0x81e3('0x9'));var squel=require(_0x81e3('0xa'));var crypto=require(_0x81e3('0xb'));var jsforce=require(_0x81e3('0xc'));var deskjs=require(_0x81e3('0xd'));var toCsv=require(_0x81e3('0x6'));var querystring=require('querystring');var Papa=require(_0x81e3('0xe'));var extract=require(_0x81e3('0xf'));var rimraf=require('rimraf');var archiver=require(_0x81e3('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x81e3('0x11'));var as=require(_0x81e3('0x12'));var hardwareService=require(_0x81e3('0x13'));var logger=require(_0x81e3('0x14'))(_0x81e3('0x15'));var utils=require(_0x81e3('0x16'));var config=require(_0x81e3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x81e3('0x18'))['db'];config['redis']=_[_0x81e3('0x19')](config[_0x81e3('0x1a')],{'host':_0x81e3('0x1b'),'port':0x18eb});var socket=require(_0x81e3('0x1c'))(new Redis(config[_0x81e3('0x1a')]));require('./plugin.socket')[_0x81e3('0x1d')](socket);function respondWithStatusCode(_0x25aa88,_0x515379){_0x515379=_0x515379||0xcc;return function(_0x5a07da){if(_0x5a07da){return _0x25aa88[_0x81e3('0x1e')](_0x515379);}return _0x25aa88[_0x81e3('0x1f')](_0x515379)[_0x81e3('0x20')]();};}function respondWithResult(_0x3d4799,_0xe12ee5){_0xe12ee5=_0xe12ee5||0xc8;return function(_0x1c026b){if(_0x1c026b){return _0x3d4799[_0x81e3('0x1f')](_0xe12ee5)[_0x81e3('0x21')](_0x1c026b);}};}function respondWithFilteredResult(_0x410801,_0x5bbc7d){return function(_0x229112){if(_0x229112){var _0x4d2900=typeof _0x5bbc7d['offset']===_0x81e3('0x22')&&typeof _0x5bbc7d[_0x81e3('0x23')]===_0x81e3('0x22');var _0x5cc51c=_0x229112[_0x81e3('0x24')];var _0x321743=_0x4d2900?0x0:_0x5bbc7d[_0x81e3('0x25')];var _0x388b82=_0x4d2900?_0x229112[_0x81e3('0x24')]:_0x5bbc7d[_0x81e3('0x25')]+_0x5bbc7d[_0x81e3('0x23')];var _0x112ce1;if(_0x388b82>=_0x5cc51c){_0x388b82=_0x5cc51c;_0x112ce1=0xc8;}else{_0x112ce1=0xce;}_0x410801[_0x81e3('0x1f')](_0x112ce1);return _0x410801[_0x81e3('0x26')](_0x81e3('0x27'),_0x321743+'-'+_0x388b82+'/'+_0x5cc51c)[_0x81e3('0x21')](_0x229112);}return null;};}function patchUpdates(_0x19408a){return function(_0x1528d6){try{jsonpatch[_0x81e3('0x28')](_0x1528d6,_0x19408a,!![]);}catch(_0x44bd6e){return BPromise[_0x81e3('0x29')](_0x44bd6e);}return _0x1528d6[_0x81e3('0x2a')]();};}function saveUpdates(_0x4d9f78,_0x2092fc){return function(_0x2e4320){if(_0x2e4320){return _0x2e4320['update'](_0x4d9f78)['then'](function(_0x2839c2){return _0x2839c2;});}return null;};}function removeEntity(_0x9b0b30,_0x4e7bbc){return function(_0x557908){if(_0x557908){return _0x557908['destroy']()['then'](function(){var _0x37aec3=_0x557908['get']({'plain':!![]});var _0x4b3eab='Plugins';return db[_0x81e3('0x2b')][_0x81e3('0x2c')]({'where':{'type':_0x4b3eab,'resourceId':_0x37aec3['id']}})['then'](function(){return _0x557908;});})[_0x81e3('0x2d')](function(){_0x9b0b30['status'](0xcc)[_0x81e3('0x20')]();});}};}function handleEntityNotFound(_0x4c0821,_0x8686d3){return function(_0x5ef9ac){if(!_0x5ef9ac){_0x4c0821['sendStatus'](0x194);}return _0x5ef9ac;};}function handleError(_0x31cfea,_0x4a315f){_0x4a315f=_0x4a315f||0x1f4;return function(_0x57c2d8){logger[_0x81e3('0x2e')](_0x57c2d8['stack']);if(_0x57c2d8['name']){delete _0x57c2d8['name'];}_0x31cfea[_0x81e3('0x1f')](_0x4a315f)['send'](_0x57c2d8);};}exports['index']=function(_0x10234e,_0x361d43){var _0x71f2e={},_0x45f327={},_0x20f22b={'count':0x0,'rows':[]};var _0x2cb506=_[_0x81e3('0x2f')](db[_0x81e3('0x30')][_0x81e3('0x31')],function(_0x1e8af2){return{'name':_0x1e8af2[_0x81e3('0x32')],'type':_0x1e8af2[_0x81e3('0x33')]['key']};});_0x45f327[_0x81e3('0x34')]=_['map'](_0x2cb506,_0x81e3('0x35'));_0x45f327[_0x81e3('0x36')]=_['keys'](_0x10234e[_0x81e3('0x36')]);_0x45f327[_0x81e3('0x37')]=_[_0x81e3('0x38')](_0x45f327[_0x81e3('0x34')],_0x45f327['query']);_0x71f2e[_0x81e3('0x39')]=_[_0x81e3('0x38')](_0x45f327['model'],qs['fields'](_0x10234e['query'][_0x81e3('0x3a')]));_0x71f2e['attributes']=_0x71f2e[_0x81e3('0x39')][_0x81e3('0x3b')]?_0x71f2e[_0x81e3('0x39')]:_0x45f327['model'];if(!_0x10234e[_0x81e3('0x36')]['hasOwnProperty']('nolimit')){_0x71f2e[_0x81e3('0x23')]=qs['limit'](_0x10234e[_0x81e3('0x36')][_0x81e3('0x23')]);_0x71f2e[_0x81e3('0x25')]=qs[_0x81e3('0x25')](_0x10234e[_0x81e3('0x36')][_0x81e3('0x25')]);}_0x71f2e[_0x81e3('0x3c')]=qs['sort'](_0x10234e[_0x81e3('0x36')][_0x81e3('0x3d')]);_0x71f2e[_0x81e3('0x3e')]=qs[_0x81e3('0x37')](_[_0x81e3('0x3f')](_0x10234e[_0x81e3('0x36')],_0x45f327[_0x81e3('0x37')]),_0x2cb506);if(_0x10234e['query']['filter']){_0x71f2e[_0x81e3('0x3e')]=_[_0x81e3('0x40')](_0x71f2e[_0x81e3('0x3e')],{'$or':_[_0x81e3('0x2f')](_0x2cb506,function(_0x252dbe){if(_0x252dbe[_0x81e3('0x33')]!==_0x81e3('0x41')){var _0x19163e={};_0x19163e[_0x252dbe['name']]={'$like':'%'+_0x10234e[_0x81e3('0x36')][_0x81e3('0x42')]+'%'};return _0x19163e;}})});}_0x71f2e=_[_0x81e3('0x40')]({},_0x71f2e,_0x10234e['options']);var _0x3eab91={'where':_0x71f2e[_0x81e3('0x3e')]};return db[_0x81e3('0x30')]['count'](_0x3eab91)[_0x81e3('0x2d')](function(_0x245602){_0x20f22b[_0x81e3('0x24')]=_0x245602;if(_0x10234e[_0x81e3('0x36')]['includeAll']){_0x71f2e[_0x81e3('0x43')]=[{'all':!![]}];}return db[_0x81e3('0x30')]['findAll'](_0x71f2e);})[_0x81e3('0x2d')](function(_0x3acd78){_0x20f22b[_0x81e3('0x44')]=_0x3acd78;return _0x20f22b;})[_0x81e3('0x2d')](respondWithFilteredResult(_0x361d43,_0x71f2e))['catch'](handleError(_0x361d43,null));};exports[_0x81e3('0x45')]=function(_0x1bcd53,_0xbb50c8){var _0x33db64={'raw':!![],'where':{'id':_0x1bcd53[_0x81e3('0x46')]['id']}},_0x28d6c5={};_0x28d6c5[_0x81e3('0x34')]=_[_0x81e3('0x47')](db[_0x81e3('0x30')][_0x81e3('0x31')]);_0x28d6c5[_0x81e3('0x36')]=_[_0x81e3('0x47')](_0x1bcd53[_0x81e3('0x36')]);_0x28d6c5[_0x81e3('0x37')]=_[_0x81e3('0x38')](_0x28d6c5[_0x81e3('0x34')],_0x28d6c5[_0x81e3('0x36')]);_0x33db64[_0x81e3('0x39')]=_[_0x81e3('0x38')](_0x28d6c5['model'],qs[_0x81e3('0x3a')](_0x1bcd53[_0x81e3('0x36')][_0x81e3('0x3a')]));_0x33db64[_0x81e3('0x39')]=_0x33db64[_0x81e3('0x39')]['length']?_0x33db64[_0x81e3('0x39')]:_0x28d6c5[_0x81e3('0x34')];if(_0x1bcd53[_0x81e3('0x36')]['includeAll']){_0x33db64['include']=[{'all':!![]}];}_0x33db64=_[_0x81e3('0x40')]({},_0x33db64,_0x1bcd53[_0x81e3('0x48')]);return db[_0x81e3('0x30')][_0x81e3('0x49')](_0x33db64)[_0x81e3('0x2d')](handleEntityNotFound(_0xbb50c8,null))[_0x81e3('0x2d')](respondWithResult(_0xbb50c8,null))[_0x81e3('0x4a')](handleError(_0xbb50c8,null));};exports[_0x81e3('0x4b')]=function(_0x1c9530,_0x120b89,_0x3ba8e0){return db['Plugin'][_0x81e3('0x49')]({'where':{'id':_0x1c9530[_0x81e3('0x46')]['id']},'attributes':[_0x81e3('0x35'),_0x81e3('0x5')],'raw':!![]})[_0x81e3('0x2d')](handleEntityNotFound(_0x120b89,null))[_0x81e3('0x2d')](function(_0x33fc17){if(_0x33fc17){var _0x37da14=path[_0x81e3('0x4c')](config[_0x81e3('0x4d')],_0x81e3('0x4e'),util['format'](_0x81e3('0x4f'),path[_0x81e3('0x50')](_0x33fc17[_0x81e3('0x5')])));var _0x271b7f=fs[_0x81e3('0x51')](_0x37da14);var _0x188b17=archiver(_0x81e3('0x52'),{'zlib':{'level':0x9}});_0x188b17['on'](_0x81e3('0x53'),function(_0x5a1e35){if(_0x5a1e35[_0x81e3('0x54')]===_0x81e3('0x55')){logger[_0x81e3('0x2e')](_0x5a1e35);}else{throw new db['Sequelize'][(_0x81e3('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x188b17['on'](_0x81e3('0x2e'),function(_0x396bcd){throw new db[(_0x81e3('0x57'))][(_0x81e3('0x56'))](_0x81e3('0x58'));});_0x188b17[_0x81e3('0x59')](_0x271b7f);_0x188b17[_0x81e3('0x5a')](_0x81e3('0x5b'),{'cwd':path[_0x81e3('0x4c')](config[_0x81e3('0x4d')],'server/files/plugins',path['dirname'](_0x33fc17[_0x81e3('0x5')])),'ignore':[path['join'](path[_0x81e3('0x50')](_0x33fc17[_0x81e3('0x5')]),_0x81e3('0x5c')),path[_0x81e3('0x4c')](path[_0x81e3('0x50')](_0x33fc17[_0x81e3('0x5')]),_0x81e3('0x5d'))],'nodir':!![]})['finalize']();_0x271b7f['on'](_0x81e3('0x5e'),function(){if(!fs['existsSync'](_0x37da14)){throw new db['Sequelize'][(_0x81e3('0x56'))](_0x81e3('0x5f'));}return _0x120b89['download'](_0x37da14,util[_0x81e3('0x60')](_0x81e3('0x4f'),path[_0x81e3('0x50')](_0x33fc17['path'])),function(_0x3da9ef){if(_0x3da9ef){throw new db[(_0x81e3('0x57'))][(_0x81e3('0x56'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x81e3('0x61')](_0x37da14);logger['info']('Download\x20completed');logger[_0x81e3('0x62')](_0x81e3('0x63'));});});}return null;})[_0x81e3('0x4a')](handleError(_0x120b89,null));};exports[_0x81e3('0x64')]=function(_0x1ef872,_0x49b5dd,_0x5531ff){var _0x387a94=path[_0x81e3('0x50')](_0x1ef872[_0x81e3('0x65')][_0x81e3('0x66')],path[_0x81e3('0x67')](_0x1ef872[_0x81e3('0x65')][_0x81e3('0x66')]));var _0xd622b6=path[_0x81e3('0x4c')](config[_0x81e3('0x4d')],_0x81e3('0x4e'),_0x1ef872[_0x81e3('0x65')][_0x81e3('0x66')]);var _0x57a08e=path[_0x81e3('0x4c')](config[_0x81e3('0x4d')],_0x81e3('0x4e'),_0x387a94);logger[_0x81e3('0x62')](_0x81e3('0x68'),_0xd622b6);logger[_0x81e3('0x62')](_0x81e3('0x69'),_0x57a08e);try{fs['chmodSync'](_0xd622b6,parseInt(_0x81e3('0x6a'),0x8));extract(_0xd622b6,{'dir':_0x57a08e},function(_0x292668){if(_0x292668){logger['error'](_0x292668);handleError(_0x292668,!![]);};var _0x1820e3=fs[_0x81e3('0x6b')](_0x57a08e);if(_0x1820e3['length']>0x1){removeReferences(_0xd622b6,_0x57a08e);logger[_0x81e3('0x2e')]('Invalid\x20plugin\x20structure');return _0x5531ff(new Error('Invalid\x20plugin\x20structure'));}var _0x1ab683=fs[_0x81e3('0x6c')](path['join'](_0x57a08e,_0x1820e3[0x0]));if(_0x1ab683[_0x81e3('0x6d')]()){removeReferences(_0xd622b6,_0x57a08e);logger[_0x81e3('0x2e')]('Invalid\x20plugin\x20structure');return _0x5531ff(new Error(_0x81e3('0x6e')));}if(_0x1ab683[_0x81e3('0x6f')]()){var _0x57b3ba=fs[_0x81e3('0x6b')](path[_0x81e3('0x4c')](_0x57a08e,_0x1820e3[0x0]));if(_0x57b3ba[_0x81e3('0x3b')]===0x0){removeReferences(_0xd622b6,_0x57a08e);logger[_0x81e3('0x2e')](_0x81e3('0x6e'));return _0x5531ff(new Error(_0x81e3('0x6e')));}var _0x324486=_0x57b3ba[_0x81e3('0x70')](function(_0x221d67){return _0x221d67==='manifest.json';});if(!_0x324486){return _0x5531ff(new Error(_0x81e3('0x71')));}var _0x2930b6=fs['readFileSync'](path[_0x81e3('0x4c')](_0x57a08e,_0x1820e3[0x0],_0x81e3('0x72')));var _0x47ab8f=JSON[_0x81e3('0x73')](_0x2930b6);if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x35')]){return _0x5531ff(new Error(_0x81e3('0x74')));}if(_0x81e3('0x22')==typeof _0x47ab8f['type']){return _0x5531ff(new Error(_0x81e3('0x75')));}if('undefined'==typeof _0x47ab8f[_0x81e3('0x76')]){return _0x5531ff(new Error(_0x81e3('0x77')));}if(_0x81e3('0x22')==typeof _0x47ab8f['parameters']){return _0x5531ff(new Error(_0x81e3('0x78')));}if(_0x47ab8f[_0x81e3('0x33')]===_0x81e3('0x79')){if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x7b')]){return _0x5531ff(new Error(_0x81e3('0x7c')));}if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x7a')]['views'][_0x81e3('0x7d')]&&_0x81e3('0x22')==typeof _0x47ab8f['parameters'][_0x81e3('0x7b')][_0x81e3('0x7e')]){return _0x5531ff(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x47ab8f[_0x81e3('0x33')]==='script'){if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x7a')]['scriptName']){return _0x5531ff(new Error(_0x81e3('0x7f')));}if(_0x81e3('0x22')==typeof _0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x80')]){return _0x5531ff(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x5531ff(new Error(_0x81e3('0x81')));}var _0x5cfa03=_0x47ab8f[_0x81e3('0x35')];var _0x2451f7=_0x47ab8f[_0x81e3('0x82')];var _0x141262=_0x47ab8f['type'];var _0x1b9902=_0x47ab8f[_0x81e3('0x83')]?_0x47ab8f[_0x81e3('0x83')]:_0x81e3('0x84');var _0x6fd8fd=_0x47ab8f[_0x81e3('0x85')]?_0x47ab8f[_0x81e3('0x85')]:_0x81e3('0x86');var _0x15fd86='';var _0x50400e='';var _0x1cf32a='';var _0x32be1c='';var _0x4a44e2=_0x47ab8f[_0x81e3('0x76')];if(_0x141262===_0x81e3('0x79')){if(_0x81e3('0x22')!=typeof _0x47ab8f[_0x81e3('0x7a')]['views']['admin']){var _0x16bf3c=_0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x7b')][_0x81e3('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x16bf3c)){_0x15fd86=path[_0x81e3('0x4c')](_0x81e3('0x87'),_0x387a94,_0x1820e3[0x0],_0x16bf3c);}else{_0x15fd86=_0x16bf3c;}}else{logger[_0x81e3('0x62')](_0x81e3('0x88'));}if(_0x81e3('0x22')!=typeof _0x47ab8f['parameters'][_0x81e3('0x7b')]['agent']){var _0x163de7=_0x47ab8f['parameters']['views'][_0x81e3('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x81e3('0x89')](_0x163de7)){_0x50400e=path['join'](_0x81e3('0x87'),_0x387a94,_0x1820e3[0x0],_0x163de7);}else{_0x50400e=_0x163de7;}}else{logger[_0x81e3('0x62')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x141262===_0x81e3('0x8a')){_0x1cf32a=_0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x8b')];_0x32be1c=_0x47ab8f[_0x81e3('0x7a')]['scriptPath'];if(_0x81e3('0x22')!=typeof _0x47ab8f[_0x81e3('0x7a')]['views']){if(_0x81e3('0x22')!=typeof _0x47ab8f['parameters'][_0x81e3('0x7b')][_0x81e3('0x7d')]){var _0x16bf3c=_0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x81e3('0x89')](_0x16bf3c)){_0x15fd86=path['join'](_0x81e3('0x87'),_0x387a94,_0x1820e3[0x0],_0x16bf3c);}else{_0x15fd86=_0x16bf3c;}}if(_0x81e3('0x22')!=typeof _0x47ab8f[_0x81e3('0x7a')][_0x81e3('0x7b')][_0x81e3('0x7e')]){var _0x163de7=_0x47ab8f['parameters']['views'][_0x81e3('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x163de7)){_0x50400e=path['join'](_0x81e3('0x87'),_0x387a94,_0x1820e3[0x0],_0x163de7);}else{_0x50400e=_0x163de7;}}}}var _0x3d35af={'name':_0x5cfa03,'description':_0x2451f7,'path':path['join'](_0x387a94,_0x1820e3[0x0]),'type':_0x141262,'sidebar':_0x1b9902,'icon':_0x6fd8fd,'adminUrl':_0x15fd86,'agentUrl':_0x50400e,'scriptName':_0x1cf32a,'scriptPath':_0x32be1c,'version':_0x4a44e2};removeReferences(_0xd622b6,null);return db[_0x81e3('0x30')][_0x81e3('0x8c')](_0x3d35af)[_0x81e3('0x2d')](function(_0x35e821){var _0x522241={'role':_0x1ef872[_0x81e3('0x8d')][_0x81e3('0x8e')],'userProfileId':_0x1ef872[_0x81e3('0x8d')][_0x81e3('0x8f')]};if(!_0x522241)throw new Error(_0x81e3('0x90'));if(_0x522241[_0x81e3('0x8e')]===_0x81e3('0x91')){var _0x40949a=_0x35e821[_0x81e3('0x92')]({'plain':!![]});return db[_0x81e3('0x93')][_0x81e3('0x49')]({'where':{'name':_0x81e3('0x94'),'userProfileId':_0x522241[_0x81e3('0x8f')]},'raw':!![]})[_0x81e3('0x2d')](function(_0x41e76a){if(_0x41e76a&&_0x41e76a[_0x81e3('0x95')]===0x0){return db['UserProfileResource'][_0x81e3('0x8c')]({'name':_0x40949a[_0x81e3('0x35')],'resourceId':_0x40949a['id'],'type':_0x41e76a['name'],'sectionId':_0x41e76a['id']},{})[_0x81e3('0x2d')](function(){return _0x35e821;});}else{return _0x35e821;}})[_0x81e3('0x4a')](function(_0x5bf608){logger['error'](_0x81e3('0x96'),_0x5bf608);throw _0x5bf608;});}return _0x35e821;})[_0x81e3('0x2d')](respondWithResult(_0x49b5dd,null))[_0x81e3('0x4a')](handleError(_0x49b5dd,null));}});}catch(_0x4f27fe){_0x49b5dd[_0x81e3('0x1f')](0x1f4)['send'](_0x4f27fe);}};function removeReferences(_0x38168f,_0x586bab){try{if(_0x38168f){fs[_0x81e3('0x61')](_0x38168f);logger['info'](_0x81e3('0x97'));}if(_0x586bab){rimraf(_0x586bab,function(){});logger[_0x81e3('0x62')](_0x81e3('0x98'));}}catch(_0x1e39ef){logger[_0x81e3('0x2e')](_0x1e39ef);}}exports[_0x81e3('0x99')]=function(_0x157c75,_0xef1721,_0x534228){return db[_0x81e3('0x30')][_0x81e3('0x49')]({'where':{'id':_0x157c75[_0x81e3('0x46')]['id']}})[_0x81e3('0x2d')](handleEntityNotFound(_0xef1721,null))['then'](saveUpdates(_0x157c75[_0x81e3('0x8d')],null))[_0x81e3('0x2d')](respondWithResult(_0xef1721,null))[_0x81e3('0x4a')](handleError(_0xef1721,null));};exports[_0x81e3('0x9a')]=function(_0x48f9ee,_0x59b166,_0x3ad954){return db[_0x81e3('0x30')][_0x81e3('0x49')]({'where':{'id':_0x48f9ee[_0x81e3('0x46')]['id']}})[_0x81e3('0x2d')](function(_0x4fcb85){if(_0x4fcb85){return _0x4fcb85[_0x81e3('0x2c')]();}})[_0x81e3('0x2d')](function(_0x1b9a56){rimraf(path['join'](config[_0x81e3('0x4d')],'server/files/plugins',path[_0x81e3('0x9b')](_0x1b9a56['path'])),function(){});return _0x1b9a56;})[_0x81e3('0x2d')](handleEntityNotFound(_0x59b166,null))[_0x81e3('0x2d')](respondWithStatusCode(_0x59b166,null))[_0x81e3('0x4a')](handleError(_0x59b166,null));};exports[_0x81e3('0x9c')]=function(_0x561c51,_0x832934,_0x4ab85f){return BPromise[_0x81e3('0x9d')]()[_0x81e3('0x2d')](function(){if(!_0x561c51[_0x81e3('0x36')][_0x81e3('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x561c51['query']['port']){throw new Error(_0x81e3('0x9e'));}var _0x3fcc5d=_0x561c51[_0x81e3('0x36')]['hostname']?_0x561c51['query']['hostname']+':'+_0x561c51['query'][_0x81e3('0x9f')]:_0x81e3('0xa0')+_0x561c51[_0x81e3('0x36')][_0x81e3('0x9f')];var _0x1457d1=_0x561c51[_0x81e3('0x36')][_0x81e3('0x21')]?_0x561c51[_0x81e3('0x36')]['json']:!![];var _0x8412e8=_0x561c51[_0x81e3('0x36')][_0x81e3('0xa1')]?_0x561c51[_0x81e3('0x36')][_0x81e3('0xa1')]:null;var _0x478761={'method':_0x561c51[_0x81e3('0xa2')],'uri':util[_0x81e3('0x60')](_0x81e3('0xa3'),_0x3fcc5d,_0x561c51[_0x81e3('0x36')]['path']),'json':_0x1457d1,'resolveWithFullResponse':!![],'encoding':_0x8412e8,'qs':_0x561c51['query']};if(_0x561c51[_0x81e3('0xa4')]){_0x478761[_0x81e3('0xa4')]=_0x561c51['headers'];if(_0x478761['headers'][_0x81e3('0xa5')]){delete _0x478761[_0x81e3('0xa4')]['content-length'];}}if(_0x478761[_0x81e3('0xa4')][_0x81e3('0xa6')]){delete _0x478761[_0x81e3('0xa4')][_0x81e3('0xa6')];}return rp(_0x478761);})[_0x81e3('0x2d')](function(_0x45d1c4){if(_0x45d1c4){_0x832934[_0x81e3('0x26')](_0x45d1c4[_0x81e3('0xa4')]);logger[_0x81e3('0x62')](_0x45d1c4['body']);if(_[_0x81e3('0xa7')](_0x561c51[_0x81e3('0x36')]['path'],_0x81e3('0x4b'))&&_0x45d1c4[_0x81e3('0xa8')]==0x1f4){return _0x832934[_0x81e3('0x1e')](_0x45d1c4['statusCode']);}else{return _0x832934[_0x81e3('0x1f')](_0x45d1c4[_0x81e3('0xa8')])[_0x81e3('0xa9')](_0x45d1c4[_0x81e3('0x8d')]);}}else{return _0x832934[_0x81e3('0x1e')](0xc8);}})[_0x81e3('0x4a')](handleError(_0x832934,null));};exports[_0x81e3('0xaa')]=function(_0x2a0f92,_0x69333a,_0x4f3feb){return BPromise[_0x81e3('0x9d')]()[_0x81e3('0x2d')](function(){if(!_0x2a0f92['query'][_0x81e3('0x5')]){throw new Error(_0x81e3('0xab'));}if(!_0x2a0f92['query'][_0x81e3('0x9f')]){throw new Error(_0x81e3('0x9e'));}var _0x304bfe=_0x2a0f92[_0x81e3('0x36')]['hostname']?_0x2a0f92[_0x81e3('0x36')][_0x81e3('0xac')]+':'+_0x2a0f92[_0x81e3('0x36')]['port']:_0x81e3('0xa0')+_0x2a0f92[_0x81e3('0x36')]['port'];var _0x3a83c6=_0x2a0f92[_0x81e3('0x36')]['json']?_0x2a0f92['query'][_0x81e3('0x21')]:!![];var _0x53a7e5=_0x2a0f92[_0x81e3('0x36')][_0x81e3('0xa1')]?_0x2a0f92[_0x81e3('0x36')]['encoding']:null;var _0x54e9ab={'method':_0x2a0f92[_0x81e3('0xa2')],'uri':util[_0x81e3('0x60')](_0x81e3('0xa3'),_0x304bfe,_0x2a0f92[_0x81e3('0x36')][_0x81e3('0x5')]),'json':_0x3a83c6,'resolveWithFullResponse':!![],'encoding':_0x53a7e5,'body':_0x2a0f92[_0x81e3('0x8d')]};if(_0x2a0f92[_0x81e3('0xa4')]){_0x54e9ab[_0x81e3('0xa4')]=_0x2a0f92[_0x81e3('0xa4')];if(_0x54e9ab['headers'][_0x81e3('0xa5')]){delete _0x54e9ab[_0x81e3('0xa4')][_0x81e3('0xa5')];}}if(_0x54e9ab[_0x81e3('0xa4')][_0x81e3('0xa6')]){delete _0x54e9ab[_0x81e3('0xa4')][_0x81e3('0xa6')];}return rp(_0x54e9ab);})[_0x81e3('0x2d')](function(_0x28d837){if(_0x28d837){_0x69333a[_0x81e3('0x26')](_0x28d837[_0x81e3('0xa4')]);logger[_0x81e3('0x62')](_0x28d837[_0x81e3('0x8d')]);return _0x69333a['status'](_0x28d837[_0x81e3('0xa8')])[_0x81e3('0xa9')](_0x28d837[_0x81e3('0x8d')]);}else{return _0x69333a[_0x81e3('0x1e')](0xc8);}})[_0x81e3('0x4a')](handleError(_0x69333a,null));}; \ No newline at end of file +var _0x4b0a=['parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Plugins','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','destroy','dirname','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','hostname','http://localhost:','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','extract-zip','rimraf','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','end','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','sendStatus','error','name','send','index','Plugin','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0x4827fe,_0x2333f6){var _0x30d357=function(_0x1131f0){while(--_0x1131f0){_0x4827fe['push'](_0x4827fe['shift']());}};_0x30d357(++_0x2333f6);}(_0x4b0a,0xd5));var _0xa4b0=function(_0x70bdb5,_0x12a342){_0x70bdb5=_0x70bdb5-0x0;var _0x1232f9=_0x4b0a[_0x70bdb5];return _0x1232f9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa4b0('0x0'));var rp=require(_0xa4b0('0x1'));var moment=require(_0xa4b0('0x2'));var BPromise=require(_0xa4b0('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa4b0('0x4'));var sox=require(_0xa4b0('0x5'));var csv=require(_0xa4b0('0x6'));var ejs=require(_0xa4b0('0x7'));var fs=require('fs');var fs_extra=require(_0xa4b0('0x8'));var _=require(_0xa4b0('0x9'));var squel=require(_0xa4b0('0xa'));var crypto=require(_0xa4b0('0xb'));var jsforce=require(_0xa4b0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa4b0('0x6'));var querystring=require(_0xa4b0('0xd'));var Papa=require(_0xa4b0('0xe'));var extract=require(_0xa4b0('0xf'));var rimraf=require(_0xa4b0('0x10'));var archiver=require(_0xa4b0('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa4b0('0x12'));var as=require(_0xa4b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4b0('0x14'))('api');var utils=require(_0xa4b0('0x15'));var config=require(_0xa4b0('0x16'));var licenseUtil=require(_0xa4b0('0x17'));var db=require(_0xa4b0('0x18'))['db'];config[_0xa4b0('0x19')]=_[_0xa4b0('0x1a')](config[_0xa4b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa4b0('0x1b'))(new Redis(config[_0xa4b0('0x19')]));require(_0xa4b0('0x1c'))[_0xa4b0('0x1d')](socket);function respondWithStatusCode(_0x259f5e,_0x5128be){_0x5128be=_0x5128be||0xcc;return function(_0x553007){if(_0x553007){return _0x259f5e['sendStatus'](_0x5128be);}return _0x259f5e['status'](_0x5128be)[_0xa4b0('0x1e')]();};}function respondWithResult(_0x2801dd,_0x4e652d){_0x4e652d=_0x4e652d||0xc8;return function(_0xfdc6cc){if(_0xfdc6cc){return _0x2801dd[_0xa4b0('0x1f')](_0x4e652d)[_0xa4b0('0x20')](_0xfdc6cc);}};}function respondWithFilteredResult(_0x2ee2f1,_0x5a7ff2){return function(_0x61182c){if(_0x61182c){var _0xf17c9b=typeof _0x5a7ff2['offset']===_0xa4b0('0x21')&&typeof _0x5a7ff2[_0xa4b0('0x22')]===_0xa4b0('0x21');var _0x51bb3e=_0x61182c[_0xa4b0('0x23')];var _0xf09c93=_0xf17c9b?0x0:_0x5a7ff2[_0xa4b0('0x24')];var _0x48918d=_0xf17c9b?_0x61182c[_0xa4b0('0x23')]:_0x5a7ff2[_0xa4b0('0x24')]+_0x5a7ff2[_0xa4b0('0x22')];var _0x3863ed;if(_0x48918d>=_0x51bb3e){_0x48918d=_0x51bb3e;_0x3863ed=0xc8;}else{_0x3863ed=0xce;}_0x2ee2f1[_0xa4b0('0x1f')](_0x3863ed);return _0x2ee2f1[_0xa4b0('0x25')]('Content-Range',_0xf09c93+'-'+_0x48918d+'/'+_0x51bb3e)['json'](_0x61182c);}return null;};}function patchUpdates(_0x32cc37){return function(_0x3ffd17){try{jsonpatch[_0xa4b0('0x26')](_0x3ffd17,_0x32cc37,!![]);}catch(_0x264370){return BPromise[_0xa4b0('0x27')](_0x264370);}return _0x3ffd17[_0xa4b0('0x28')]();};}function saveUpdates(_0xbde146,_0x10f691){return function(_0x876a){if(_0x876a){return _0x876a[_0xa4b0('0x29')](_0xbde146)[_0xa4b0('0x2a')](function(_0x651fca){return _0x651fca;});}return null;};}function removeEntity(_0xbcedee,_0x17bcee){return function(_0x543321){if(_0x543321){return _0x543321['destroy']()[_0xa4b0('0x2a')](function(){var _0x59f38e=_0x543321['get']({'plain':!![]});var _0x643ef7='Plugins';return db['UserProfileResource']['destroy']({'where':{'type':_0x643ef7,'resourceId':_0x59f38e['id']}})['then'](function(){return _0x543321;});})[_0xa4b0('0x2a')](function(){_0xbcedee[_0xa4b0('0x1f')](0xcc)[_0xa4b0('0x1e')]();});}};}function handleEntityNotFound(_0x2d58d5,_0x37a4db){return function(_0x3735fc){if(!_0x3735fc){_0x2d58d5[_0xa4b0('0x2b')](0x194);}return _0x3735fc;};}function handleError(_0x108f87,_0x2547ce){_0x2547ce=_0x2547ce||0x1f4;return function(_0x591f0e){logger[_0xa4b0('0x2c')](_0x591f0e['stack']);if(_0x591f0e[_0xa4b0('0x2d')]){delete _0x591f0e['name'];}_0x108f87[_0xa4b0('0x1f')](_0x2547ce)[_0xa4b0('0x2e')](_0x591f0e);};}exports[_0xa4b0('0x2f')]=function(_0x49fd8d,_0x38bff3){var _0x5ef974={},_0x47a0e1={},_0x15e6d3={'count':0x0,'rows':[]};var _0x16e0a5=_['map'](db[_0xa4b0('0x30')][_0xa4b0('0x31')],function(_0x21e69f){return{'name':_0x21e69f[_0xa4b0('0x32')],'type':_0x21e69f[_0xa4b0('0x33')]['key']};});_0x47a0e1[_0xa4b0('0x34')]=_[_0xa4b0('0x35')](_0x16e0a5,_0xa4b0('0x2d'));_0x47a0e1[_0xa4b0('0x36')]=_[_0xa4b0('0x37')](_0x49fd8d[_0xa4b0('0x36')]);_0x47a0e1['filters']=_[_0xa4b0('0x38')](_0x47a0e1[_0xa4b0('0x34')],_0x47a0e1[_0xa4b0('0x36')]);_0x5ef974[_0xa4b0('0x39')]=_[_0xa4b0('0x38')](_0x47a0e1['model'],qs[_0xa4b0('0x3a')](_0x49fd8d[_0xa4b0('0x36')][_0xa4b0('0x3a')]));_0x5ef974[_0xa4b0('0x39')]=_0x5ef974[_0xa4b0('0x39')][_0xa4b0('0x3b')]?_0x5ef974[_0xa4b0('0x39')]:_0x47a0e1[_0xa4b0('0x34')];if(!_0x49fd8d[_0xa4b0('0x36')]['hasOwnProperty'](_0xa4b0('0x3c'))){_0x5ef974[_0xa4b0('0x22')]=qs[_0xa4b0('0x22')](_0x49fd8d[_0xa4b0('0x36')]['limit']);_0x5ef974[_0xa4b0('0x24')]=qs['offset'](_0x49fd8d['query'][_0xa4b0('0x24')]);}_0x5ef974['order']=qs[_0xa4b0('0x3d')](_0x49fd8d['query'][_0xa4b0('0x3d')]);_0x5ef974[_0xa4b0('0x3e')]=qs['filters'](_[_0xa4b0('0x3f')](_0x49fd8d['query'],_0x47a0e1['filters']),_0x16e0a5);if(_0x49fd8d['query'][_0xa4b0('0x40')]){_0x5ef974[_0xa4b0('0x3e')]=_[_0xa4b0('0x41')](_0x5ef974[_0xa4b0('0x3e')],{'$or':_['map'](_0x16e0a5,function(_0x4442f9){if(_0x4442f9[_0xa4b0('0x33')]!==_0xa4b0('0x42')){var _0x9452e0={};_0x9452e0[_0x4442f9[_0xa4b0('0x2d')]]={'$like':'%'+_0x49fd8d[_0xa4b0('0x36')][_0xa4b0('0x40')]+'%'};return _0x9452e0;}})});}_0x5ef974=_[_0xa4b0('0x41')]({},_0x5ef974,_0x49fd8d[_0xa4b0('0x43')]);var _0x34b31f={'where':_0x5ef974[_0xa4b0('0x3e')]};return db[_0xa4b0('0x30')][_0xa4b0('0x23')](_0x34b31f)[_0xa4b0('0x2a')](function(_0x6082c7){_0x15e6d3[_0xa4b0('0x23')]=_0x6082c7;if(_0x49fd8d[_0xa4b0('0x36')][_0xa4b0('0x44')]){_0x5ef974['include']=[{'all':!![]}];}return db[_0xa4b0('0x30')][_0xa4b0('0x45')](_0x5ef974);})[_0xa4b0('0x2a')](function(_0x42e312){_0x15e6d3[_0xa4b0('0x46')]=_0x42e312;return _0x15e6d3;})[_0xa4b0('0x2a')](respondWithFilteredResult(_0x38bff3,_0x5ef974))[_0xa4b0('0x47')](handleError(_0x38bff3,null));};exports['show']=function(_0x5bcd3a,_0x7876a8){var _0x59390f={'raw':!![],'where':{'id':_0x5bcd3a[_0xa4b0('0x48')]['id']}},_0x3aaddb={};_0x3aaddb[_0xa4b0('0x34')]=_[_0xa4b0('0x37')](db[_0xa4b0('0x30')][_0xa4b0('0x31')]);_0x3aaddb[_0xa4b0('0x36')]=_[_0xa4b0('0x37')](_0x5bcd3a['query']);_0x3aaddb['filters']=_[_0xa4b0('0x38')](_0x3aaddb[_0xa4b0('0x34')],_0x3aaddb[_0xa4b0('0x36')]);_0x59390f['attributes']=_[_0xa4b0('0x38')](_0x3aaddb['model'],qs[_0xa4b0('0x3a')](_0x5bcd3a[_0xa4b0('0x36')][_0xa4b0('0x3a')]));_0x59390f['attributes']=_0x59390f['attributes'][_0xa4b0('0x3b')]?_0x59390f[_0xa4b0('0x39')]:_0x3aaddb['model'];if(_0x5bcd3a[_0xa4b0('0x36')][_0xa4b0('0x44')]){_0x59390f[_0xa4b0('0x49')]=[{'all':!![]}];}_0x59390f=_[_0xa4b0('0x41')]({},_0x59390f,_0x5bcd3a['options']);return db[_0xa4b0('0x30')][_0xa4b0('0x4a')](_0x59390f)[_0xa4b0('0x2a')](handleEntityNotFound(_0x7876a8,null))[_0xa4b0('0x2a')](respondWithResult(_0x7876a8,null))['catch'](handleError(_0x7876a8,null));};exports[_0xa4b0('0x4b')]=function(_0x235fa4,_0x45992a,_0x2b3f19){return db[_0xa4b0('0x30')][_0xa4b0('0x4a')]({'where':{'id':_0x235fa4[_0xa4b0('0x48')]['id']},'attributes':['name',_0xa4b0('0x4')],'raw':!![]})[_0xa4b0('0x2a')](handleEntityNotFound(_0x45992a,null))[_0xa4b0('0x2a')](function(_0x1a576f){if(_0x1a576f){var _0x3b9f4b=path[_0xa4b0('0x4c')](config[_0xa4b0('0x4d')],_0xa4b0('0x4e'),util[_0xa4b0('0x4f')](_0xa4b0('0x50'),path[_0xa4b0('0x51')](_0x1a576f['path'])));var _0x243437=fs[_0xa4b0('0x52')](_0x3b9f4b);var _0x1510b9=archiver(_0xa4b0('0x53'),{'zlib':{'level':0x9}});_0x1510b9['on']('warning',function(_0x4bde79){if(_0x4bde79[_0xa4b0('0x54')]===_0xa4b0('0x55')){logger[_0xa4b0('0x2c')](_0x4bde79);}else{throw new db['Sequelize'][(_0xa4b0('0x56'))](_0xa4b0('0x57'));}});_0x1510b9['on'](_0xa4b0('0x2c'),function(_0x18a547){throw new db[(_0xa4b0('0x58'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x1510b9[_0xa4b0('0x59')](_0x243437);_0x1510b9[_0xa4b0('0x5a')](_0xa4b0('0x5b'),{'cwd':path[_0xa4b0('0x4c')](config[_0xa4b0('0x4d')],_0xa4b0('0x4e'),path['dirname'](_0x1a576f[_0xa4b0('0x4')])),'ignore':[path[_0xa4b0('0x4c')](path[_0xa4b0('0x51')](_0x1a576f[_0xa4b0('0x4')]),'node_modules/**/*'),path[_0xa4b0('0x4c')](path[_0xa4b0('0x51')](_0x1a576f[_0xa4b0('0x4')]),_0xa4b0('0x5c'))],'nodir':!![]})[_0xa4b0('0x5d')]();_0x243437['on'](_0xa4b0('0x5e'),function(){if(!fs[_0xa4b0('0x5f')](_0x3b9f4b)){throw new db['Sequelize'][(_0xa4b0('0x56'))](_0xa4b0('0x60'));}return _0x45992a[_0xa4b0('0x4b')](_0x3b9f4b,util[_0xa4b0('0x4f')](_0xa4b0('0x50'),path[_0xa4b0('0x51')](_0x1a576f[_0xa4b0('0x4')])),function(_0x13f07b){if(_0x13f07b){throw new db['Sequelize'][(_0xa4b0('0x56'))](_0xa4b0('0x61'));}fs['unlinkSync'](_0x3b9f4b);logger[_0xa4b0('0x62')](_0xa4b0('0x63'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0xa4b0('0x47')](handleError(_0x45992a,null));};exports['upload']=function(_0x2d85e0,_0x2a311a,_0x1505b3){var _0x2c2e39=path[_0xa4b0('0x51')](_0x2d85e0['file'][_0xa4b0('0x64')],path[_0xa4b0('0x65')](_0x2d85e0[_0xa4b0('0x66')][_0xa4b0('0x64')]));var _0x1a59fd=path['join'](config[_0xa4b0('0x4d')],_0xa4b0('0x4e'),_0x2d85e0[_0xa4b0('0x66')][_0xa4b0('0x64')]);var _0x480320=path[_0xa4b0('0x4c')](config[_0xa4b0('0x4d')],_0xa4b0('0x4e'),_0x2c2e39);logger[_0xa4b0('0x62')](_0xa4b0('0x67'),_0x1a59fd);logger[_0xa4b0('0x62')](_0xa4b0('0x68'),_0x480320);try{fs['chmodSync'](_0x1a59fd,parseInt(_0xa4b0('0x69'),0x8));extract(_0x1a59fd,{'dir':_0x480320},function(_0x4d3f7b){if(_0x4d3f7b){logger[_0xa4b0('0x2c')](_0x4d3f7b);handleError(_0x4d3f7b,!![]);};var _0x2d7763=fs[_0xa4b0('0x6a')](_0x480320);if(_0x2d7763[_0xa4b0('0x3b')]>0x1){removeReferences(_0x1a59fd,_0x480320);logger[_0xa4b0('0x2c')](_0xa4b0('0x6b'));return _0x1505b3(new Error(_0xa4b0('0x6b')));}var _0x259cec=fs[_0xa4b0('0x6c')](path[_0xa4b0('0x4c')](_0x480320,_0x2d7763[0x0]));if(_0x259cec[_0xa4b0('0x6d')]()){removeReferences(_0x1a59fd,_0x480320);logger[_0xa4b0('0x2c')](_0xa4b0('0x6b'));return _0x1505b3(new Error(_0xa4b0('0x6b')));}if(_0x259cec[_0xa4b0('0x6e')]()){var _0x388c28=fs[_0xa4b0('0x6a')](path[_0xa4b0('0x4c')](_0x480320,_0x2d7763[0x0]));if(_0x388c28[_0xa4b0('0x3b')]===0x0){removeReferences(_0x1a59fd,_0x480320);logger['error'](_0xa4b0('0x6b'));return _0x1505b3(new Error(_0xa4b0('0x6b')));}var _0x4564cb=_0x388c28[_0xa4b0('0x6f')](function(_0x51f94e){return _0x51f94e===_0xa4b0('0x70');});if(!_0x4564cb){return _0x1505b3(new Error(_0xa4b0('0x71')));}var _0x385d32=fs[_0xa4b0('0x72')](path[_0xa4b0('0x4c')](_0x480320,_0x2d7763[0x0],'manifest.json'));var _0x145c95=JSON[_0xa4b0('0x73')](_0x385d32);if(_0xa4b0('0x21')==typeof _0x145c95['name']){return _0x1505b3(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0xa4b0('0x21')==typeof _0x145c95[_0xa4b0('0x33')]){return _0x1505b3(new Error(_0xa4b0('0x74')));}if(_0xa4b0('0x21')==typeof _0x145c95[_0xa4b0('0x75')]){return _0x1505b3(new Error(_0xa4b0('0x76')));}if(_0xa4b0('0x21')==typeof _0x145c95[_0xa4b0('0x77')]){return _0x1505b3(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x145c95['type']===_0xa4b0('0x78')){if(_0xa4b0('0x21')==typeof _0x145c95[_0xa4b0('0x77')][_0xa4b0('0x79')]){return _0x1505b3(new Error(_0xa4b0('0x7a')));}if(_0xa4b0('0x21')==typeof _0x145c95['parameters'][_0xa4b0('0x79')][_0xa4b0('0x7b')]&&_0xa4b0('0x21')==typeof _0x145c95[_0xa4b0('0x77')]['views'][_0xa4b0('0x7c')]){return _0x1505b3(new Error(_0xa4b0('0x7d')));}}else if(_0x145c95[_0xa4b0('0x33')]===_0xa4b0('0x7e')){if('undefined'==typeof _0x145c95[_0xa4b0('0x77')][_0xa4b0('0x7f')]){return _0x1505b3(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xa4b0('0x21')==typeof _0x145c95[_0xa4b0('0x77')][_0xa4b0('0x80')]){return _0x1505b3(new Error(_0xa4b0('0x81')));}}else{return _0x1505b3(new Error(_0xa4b0('0x82')));}var _0x27985f=_0x145c95[_0xa4b0('0x2d')];var _0xed2038=_0x145c95[_0xa4b0('0x83')];var _0x3f21c4=_0x145c95[_0xa4b0('0x33')];var _0x24fdd3=_0x145c95[_0xa4b0('0x84')]?_0x145c95[_0xa4b0('0x84')]:_0xa4b0('0x85');var _0x11dab2=_0x145c95['icon']?_0x145c95[_0xa4b0('0x86')]:_0xa4b0('0x87');var _0x1dbf5c='';var _0xca0783='';var _0xf116a6='';var _0x10b237='';var _0x31f2b1=_0x145c95['version'];if(_0x3f21c4===_0xa4b0('0x78')){if(_0xa4b0('0x21')!=typeof _0x145c95['parameters']['views'][_0xa4b0('0x7b')]){var _0x1b76ed=_0x145c95[_0xa4b0('0x77')][_0xa4b0('0x79')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xa4b0('0x88')](_0x1b76ed)){_0x1dbf5c=path[_0xa4b0('0x4c')]('plugins',_0x2c2e39,_0x2d7763[0x0],_0x1b76ed);}else{_0x1dbf5c=_0x1b76ed;}}else{logger[_0xa4b0('0x62')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x145c95[_0xa4b0('0x77')][_0xa4b0('0x79')][_0xa4b0('0x7c')]){var _0x4b6fc1=_0x145c95[_0xa4b0('0x77')]['views'][_0xa4b0('0x7c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4b6fc1)){_0xca0783=path[_0xa4b0('0x4c')](_0xa4b0('0x89'),_0x2c2e39,_0x2d7763[0x0],_0x4b6fc1);}else{_0xca0783=_0x4b6fc1;}}else{logger[_0xa4b0('0x62')](_0xa4b0('0x8a'));}}else if(_0x3f21c4===_0xa4b0('0x7e')){_0xf116a6=_0x145c95[_0xa4b0('0x77')]['scriptName'];_0x10b237=_0x145c95[_0xa4b0('0x77')][_0xa4b0('0x80')];if(_0xa4b0('0x21')!=typeof _0x145c95[_0xa4b0('0x77')][_0xa4b0('0x79')]){if(_0xa4b0('0x21')!=typeof _0x145c95[_0xa4b0('0x77')][_0xa4b0('0x79')][_0xa4b0('0x7b')]){var _0x1b76ed=_0x145c95[_0xa4b0('0x77')][_0xa4b0('0x79')][_0xa4b0('0x7b')];if(!/^(f|ht)tps?:\/\//i[_0xa4b0('0x88')](_0x1b76ed)){_0x1dbf5c=path[_0xa4b0('0x4c')](_0xa4b0('0x89'),_0x2c2e39,_0x2d7763[0x0],_0x1b76ed);}else{_0x1dbf5c=_0x1b76ed;}}if(_0xa4b0('0x21')!=typeof _0x145c95[_0xa4b0('0x77')][_0xa4b0('0x79')][_0xa4b0('0x7c')]){var _0x4b6fc1=_0x145c95['parameters'][_0xa4b0('0x79')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xa4b0('0x88')](_0x4b6fc1)){_0xca0783=path[_0xa4b0('0x4c')](_0xa4b0('0x89'),_0x2c2e39,_0x2d7763[0x0],_0x4b6fc1);}else{_0xca0783=_0x4b6fc1;}}}}var _0x15950c={'name':_0x27985f,'description':_0xed2038,'path':path['join'](_0x2c2e39,_0x2d7763[0x0]),'type':_0x3f21c4,'sidebar':_0x24fdd3,'icon':_0x11dab2,'adminUrl':_0x1dbf5c,'agentUrl':_0xca0783,'scriptName':_0xf116a6,'scriptPath':_0x10b237,'version':_0x31f2b1};removeReferences(_0x1a59fd,null);return db['Plugin']['create'](_0x15950c)[_0xa4b0('0x2a')](function(_0x50d601){var _0x2550bc={'role':_0x2d85e0['body']['role'],'userProfileId':_0x2d85e0[_0xa4b0('0x8b')][_0xa4b0('0x8c')]};if(!_0x2550bc)throw new Error(_0xa4b0('0x8d'));if(_0x2550bc['role']===_0xa4b0('0x8e')){var _0x29d494=_0x50d601[_0xa4b0('0x8f')]({'plain':!![]});return db['UserProfileSection'][_0xa4b0('0x4a')]({'where':{'name':_0xa4b0('0x90'),'userProfileId':_0x2550bc[_0xa4b0('0x8c')]},'raw':!![]})['then'](function(_0x447c75){if(_0x447c75&&_0x447c75['autoAssociation']===0x0){return db[_0xa4b0('0x91')][_0xa4b0('0x92')]({'name':_0x29d494['name'],'resourceId':_0x29d494['id'],'type':_0x447c75[_0xa4b0('0x2d')],'sectionId':_0x447c75['id']},{})[_0xa4b0('0x2a')](function(){return _0x50d601;});}else{return _0x50d601;}})[_0xa4b0('0x47')](function(_0x5d24d1){logger[_0xa4b0('0x2c')](_0xa4b0('0x93'),_0x5d24d1);throw _0x5d24d1;});}return _0x50d601;})[_0xa4b0('0x2a')](respondWithResult(_0x2a311a,null))[_0xa4b0('0x47')](handleError(_0x2a311a,null));}});}catch(_0x1688b4){_0x2a311a[_0xa4b0('0x1f')](0x1f4)[_0xa4b0('0x2e')](_0x1688b4);}};function removeReferences(_0x54f1c3,_0x29ac6c){try{if(_0x54f1c3){fs['unlinkSync'](_0x54f1c3);logger[_0xa4b0('0x62')](_0xa4b0('0x94'));}if(_0x29ac6c){rimraf(_0x29ac6c,function(){});logger[_0xa4b0('0x62')]('Extracted\x20folder\x20removed');}}catch(_0x6e318){logger[_0xa4b0('0x2c')](_0x6e318);}}exports[_0xa4b0('0x29')]=function(_0x254885,_0x499425,_0x2e91eb){return db[_0xa4b0('0x30')]['find']({'where':{'id':_0x254885['params']['id']}})[_0xa4b0('0x2a')](handleEntityNotFound(_0x499425,null))[_0xa4b0('0x2a')](saveUpdates(_0x254885[_0xa4b0('0x8b')],null))[_0xa4b0('0x2a')](respondWithResult(_0x499425,null))[_0xa4b0('0x47')](handleError(_0x499425,null));};exports[_0xa4b0('0x95')]=function(_0x196485,_0x320b9e,_0x2113e5){return db[_0xa4b0('0x30')][_0xa4b0('0x4a')]({'where':{'id':_0x196485[_0xa4b0('0x48')]['id']}})[_0xa4b0('0x2a')](function(_0x13b81b){if(_0x13b81b){return _0x13b81b[_0xa4b0('0x96')]();}})['then'](function(_0x461266){rimraf(path[_0xa4b0('0x4c')](config[_0xa4b0('0x4d')],_0xa4b0('0x4e'),path[_0xa4b0('0x97')](_0x461266[_0xa4b0('0x4')])),function(){});return _0x461266;})[_0xa4b0('0x2a')](handleEntityNotFound(_0x320b9e,null))[_0xa4b0('0x2a')](respondWithStatusCode(_0x320b9e,null))[_0xa4b0('0x47')](handleError(_0x320b9e,null));};exports['webhookGet']=function(_0x33fb01,_0x3be1af,_0x374c20){return BPromise[_0xa4b0('0x98')]()[_0xa4b0('0x2a')](function(){if(!_0x33fb01[_0xa4b0('0x36')][_0xa4b0('0x4')]){throw new Error(_0xa4b0('0x99'));}if(!_0x33fb01[_0xa4b0('0x36')]['port']){throw new Error(_0xa4b0('0x9a'));}var _0x26e3c1=_0x33fb01[_0xa4b0('0x36')]['hostname']?_0x33fb01[_0xa4b0('0x36')]['hostname']+':'+_0x33fb01[_0xa4b0('0x36')]['port']:'http://localhost:'+_0x33fb01[_0xa4b0('0x36')]['port'];var _0x14517f=_0x33fb01[_0xa4b0('0x36')][_0xa4b0('0x20')]?_0x33fb01[_0xa4b0('0x36')][_0xa4b0('0x20')]:!![];var _0x26ae8a=_0x33fb01[_0xa4b0('0x36')][_0xa4b0('0x9b')]?_0x33fb01['query'][_0xa4b0('0x9b')]:null;var _0x1ba1c2={'method':_0x33fb01[_0xa4b0('0x9c')],'uri':util[_0xa4b0('0x4f')](_0xa4b0('0x9d'),_0x26e3c1,_0x33fb01[_0xa4b0('0x36')][_0xa4b0('0x4')]),'json':_0x14517f,'resolveWithFullResponse':!![],'encoding':_0x26ae8a,'qs':_0x33fb01['query']};if(_0x33fb01[_0xa4b0('0x9e')]){_0x1ba1c2[_0xa4b0('0x9e')]=_0x33fb01[_0xa4b0('0x9e')];if(_0x1ba1c2[_0xa4b0('0x9e')][_0xa4b0('0x9f')]){delete _0x1ba1c2[_0xa4b0('0x9e')]['content-length'];}}if(_0x1ba1c2[_0xa4b0('0x9e')][_0xa4b0('0xa0')]){delete _0x1ba1c2['headers'][_0xa4b0('0xa0')];}return rp(_0x1ba1c2);})[_0xa4b0('0x2a')](function(_0x3c5002){if(_0x3c5002){_0x3be1af['set'](_0x3c5002['headers']);logger[_0xa4b0('0x62')](_0x3c5002[_0xa4b0('0x8b')]);if(_[_0xa4b0('0xa1')](_0x33fb01[_0xa4b0('0x36')][_0xa4b0('0x4')],_0xa4b0('0x4b'))&&_0x3c5002[_0xa4b0('0xa2')]==0x1f4){return _0x3be1af[_0xa4b0('0x2b')](_0x3c5002[_0xa4b0('0xa2')]);}else{return _0x3be1af[_0xa4b0('0x1f')](_0x3c5002[_0xa4b0('0xa2')])[_0xa4b0('0x2e')](_0x3c5002[_0xa4b0('0x8b')]);}}else{return _0x3be1af['sendStatus'](0xc8);}})[_0xa4b0('0x47')](handleError(_0x3be1af,null));};exports[_0xa4b0('0xa3')]=function(_0x1c0dc3,_0x53279e,_0x344260){return BPromise[_0xa4b0('0x98')]()[_0xa4b0('0x2a')](function(){if(!_0x1c0dc3['query'][_0xa4b0('0x4')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1c0dc3[_0xa4b0('0x36')]['port']){throw new Error(_0xa4b0('0x9a'));}var _0x3f0265=_0x1c0dc3[_0xa4b0('0x36')][_0xa4b0('0xa4')]?_0x1c0dc3['query'][_0xa4b0('0xa4')]+':'+_0x1c0dc3[_0xa4b0('0x36')]['port']:_0xa4b0('0xa5')+_0x1c0dc3[_0xa4b0('0x36')]['port'];var _0x224698=_0x1c0dc3[_0xa4b0('0x36')][_0xa4b0('0x20')]?_0x1c0dc3[_0xa4b0('0x36')][_0xa4b0('0x20')]:!![];var _0x1a0aef=_0x1c0dc3['query'][_0xa4b0('0x9b')]?_0x1c0dc3[_0xa4b0('0x36')][_0xa4b0('0x9b')]:null;var _0x241a4d={'method':_0x1c0dc3['method'],'uri':util[_0xa4b0('0x4f')](_0xa4b0('0x9d'),_0x3f0265,_0x1c0dc3[_0xa4b0('0x36')][_0xa4b0('0x4')]),'json':_0x224698,'resolveWithFullResponse':!![],'encoding':_0x1a0aef,'body':_0x1c0dc3[_0xa4b0('0x8b')]};if(_0x1c0dc3[_0xa4b0('0x9e')]){_0x241a4d[_0xa4b0('0x9e')]=_0x1c0dc3[_0xa4b0('0x9e')];if(_0x241a4d['headers'][_0xa4b0('0x9f')]){delete _0x241a4d[_0xa4b0('0x9e')][_0xa4b0('0x9f')];}}if(_0x241a4d[_0xa4b0('0x9e')]['content-type']){delete _0x241a4d[_0xa4b0('0x9e')][_0xa4b0('0xa0')];}return rp(_0x241a4d);})['then'](function(_0xc2bf17){if(_0xc2bf17){_0x53279e[_0xa4b0('0x25')](_0xc2bf17[_0xa4b0('0x9e')]);logger[_0xa4b0('0x62')](_0xc2bf17[_0xa4b0('0x8b')]);return _0x53279e[_0xa4b0('0x1f')](_0xc2bf17['statusCode'])[_0xa4b0('0x2e')](_0xc2bf17['body']);}else{return _0x53279e[_0xa4b0('0x2b')](0xc8);}})[_0xa4b0('0x47')](handleError(_0x53279e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 97adb8c..aecc01e 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 _0x8a8b=['events','setMaxListeners','save','remove','emit','hook'];(function(_0x244b7c,_0x164a27){var _0x566dcf=function(_0x528024){while(--_0x528024){_0x244b7c['push'](_0x244b7c['shift']());}};_0x566dcf(++_0x164a27);}(_0x8a8b,0xae));var _0xb8a8=function(_0x2d8948,_0x3213ca){_0x2d8948=_0x2d8948-0x0;var _0x35a057=_0x8a8b[_0x2d8948];return _0x35a057;};'use strict';var EventEmitter=require(_0xb8a8('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xb8a8('0x1')](0x0);var events={'afterCreate':_0xb8a8('0x2'),'afterUpdate':'update','afterDestroy':_0xb8a8('0x3')};function emitEvent(_0x5710bc){return function(_0xca9854,_0x4fe301,_0x4043fd){PluginEvents[_0xb8a8('0x4')](_0x5710bc+':'+_0xca9854['id'],_0xca9854);PluginEvents[_0xb8a8('0x4')](_0x5710bc,_0xca9854);_0x4043fd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0xb8a8('0x5')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0xbbbd=['hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x150aa9,_0x496f40){var _0x13c1ae=function(_0x52ae0a){while(--_0x52ae0a){_0x150aa9['push'](_0x150aa9['shift']());}};_0x13c1ae(++_0x496f40);}(_0xbbbd,0x86));var _0xdbbb=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xbbbd[_0xbf8ebe];return _0x1e25e8;};'use strict';var EventEmitter=require(_0xdbbb('0x0'));var Plugin=require(_0xdbbb('0x1'))['db'][_0xdbbb('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xdbbb('0x3')](0x0);var events={'afterCreate':_0xdbbb('0x4'),'afterUpdate':_0xdbbb('0x5'),'afterDestroy':_0xdbbb('0x6')};function emitEvent(_0x3351fb){return function(_0x3b665d,_0x114d3a,_0x1cd8ad){PluginEvents[_0xdbbb('0x7')](_0x3351fb+':'+_0x3b665d['id'],_0x3b665d);PluginEvents['emit'](_0x3351fb,_0x3b665d);_0x1cd8ad(null);};}for(var e in events){if(events[_0xdbbb('0x8')](e)){var event=events[e];Plugin[_0xdbbb('0x9')](e,emitEvent(event));}}module[_0xdbbb('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 003f498..6b01443 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 _0x0fd4=['path','rimraf','../../config/environment','./plugin.attributes','Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3b3676,_0x475b6e){var _0x520f66=function(_0x5477f1){while(--_0x5477f1){_0x3b3676['push'](_0x3b3676['shift']());}};_0x520f66(++_0x475b6e);}(_0x0fd4,0xa1));var _0x40fd=function(_0x2b4448,_0x5bcc69){_0x2b4448=_0x2b4448-0x0;var _0xb4b465=_0x0fd4[_0x2b4448];return _0xb4b465;};'use strict';var _=require(_0x40fd('0x0'));var util=require(_0x40fd('0x1'));var logger=require(_0x40fd('0x2'))(_0x40fd('0x3'));var moment=require(_0x40fd('0x4'));var BPromise=require(_0x40fd('0x5'));var rp=require(_0x40fd('0x6'));var fs=require('fs');var path=require(_0x40fd('0x7'));var rimraf=require(_0x40fd('0x8'));var config=require(_0x40fd('0x9'));var attributes=require(_0x40fd('0xa'));module['exports']=function(_0x49d4c6,_0x216f33){return _0x49d4c6['define'](_0x40fd('0xb'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaeda=['exports','define','Plugin','plugins','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./plugin.attributes'];(function(_0x48e4e7,_0x3d8556){var _0x15c462=function(_0x25270e){while(--_0x25270e){_0x48e4e7['push'](_0x48e4e7['shift']());}};_0x15c462(++_0x3d8556);}(_0xaeda,0x1b4));var _0xaaed=function(_0x1822b3,_0x557bf0){_0x1822b3=_0x1822b3-0x0;var _0xe074a5=_0xaeda[_0x1822b3];return _0xe074a5;};'use strict';var _=require(_0xaaed('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaaed('0x1'));var moment=require(_0xaaed('0x2'));var BPromise=require(_0xaaed('0x3'));var rp=require(_0xaaed('0x4'));var fs=require('fs');var path=require(_0xaaed('0x5'));var rimraf=require('rimraf');var config=require(_0xaaed('0x6'));var attributes=require(_0xaaed('0x7'));module[_0xaaed('0x8')]=function(_0x3a4241,_0x3d815d){return _0x3a4241[_0xaaed('0x9')](_0xaaed('0xa'),attributes,{'tableName':_0xaaed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 46fd0d8..89fd2d5 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 _0x9a09=['Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','create','body','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4dd5e4,_0x29bed0){var _0x2049cb=function(_0x3befe4){while(--_0x3befe4){_0x4dd5e4['push'](_0x4dd5e4['shift']());}};_0x2049cb(++_0x29bed0);}(_0x9a09,0x19d));var _0x99a0=function(_0x4a0a7d,_0x277822){_0x4a0a7d=_0x4a0a7d-0x0;var _0x4eb3e5=_0x9a09[_0x4a0a7d];return _0x4eb3e5;};'use strict';var _=require(_0x99a0('0x0'));var util=require(_0x99a0('0x1'));var moment=require(_0x99a0('0x2'));var BPromise=require(_0x99a0('0x3'));var rs=require(_0x99a0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x99a0('0x5'));var logger=require(_0x99a0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x99a0('0x7')][_0x99a0('0x8')]({'port':0x232a});config[_0x99a0('0x9')]=_[_0x99a0('0xa')](config['redis'],{'host':_0x99a0('0xb'),'port':0x18eb});var socket=require(_0x99a0('0xc'))(new Redis(config[_0x99a0('0x9')]));require(_0x99a0('0xd'))[_0x99a0('0xe')](socket);function respondWithRpcPromise(_0xce117a,_0x362e61,_0x5a8e52){return new BPromise(function(_0x57945a,_0x11cb98){return client[_0x99a0('0xf')](_0xce117a,_0x5a8e52)[_0x99a0('0x10')](function(_0xebe2cb){logger[_0x99a0('0x11')](_0x99a0('0x12'),_0x362e61,_0x99a0('0x13'));logger[_0x99a0('0x14')](_0x99a0('0x15'),_0x362e61,'request\x20sent',JSON['stringify'](_0xebe2cb));if(_0xebe2cb[_0x99a0('0x16')]){if(_0xebe2cb[_0x99a0('0x16')][_0x99a0('0x17')]===0x1f4){logger['error'](_0x99a0('0x12'),_0x362e61,_0xebe2cb[_0x99a0('0x16')]['message']);return _0x11cb98(_0xebe2cb[_0x99a0('0x16')][_0x99a0('0x18')]);}logger[_0x99a0('0x16')](_0x99a0('0x12'),_0x362e61,_0xebe2cb[_0x99a0('0x16')]['message']);return _0x57945a(_0xebe2cb[_0x99a0('0x16')][_0x99a0('0x18')]);}else{logger['info'](_0x99a0('0x12'),_0x362e61,_0x99a0('0x13'));_0x57945a(_0xebe2cb[_0x99a0('0x19')][_0x99a0('0x18')]);}})[_0x99a0('0x1a')](function(_0x274bd6){logger[_0x99a0('0x16')]('Plugin,\x20%s,\x20%s',_0x362e61,_0x274bd6);_0x11cb98(_0x274bd6);});});}exports[_0x99a0('0x1b')]=function(_0x40f319){var _0x2d02e0=this;return new Promise(function(_0x2146ae,_0x254250){return db['Plugin'][_0x99a0('0x1c')](_0x40f319[_0x99a0('0x1d')],{'raw':_0x40f319['options']?_0x40f319['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x22953a){logger[_0x99a0('0x11')](_0x99a0('0x1b'),_0x40f319);logger['debug'](_0x99a0('0x1b'),_0x40f319,JSON[_0x99a0('0x1e')](_0x22953a));_0x2146ae(_0x22953a);})['catch'](function(_0x45f429){logger[_0x99a0('0x16')](_0x99a0('0x1b'),_0x45f429[_0x99a0('0x18')],_0x40f319);_0x254250(_0x2d02e0['error'](0x1f4,_0x45f429[_0x99a0('0x18')]));});});}; \ No newline at end of file +var _0x51b7=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreatePlugin','Plugin','options','raw','lodash','util'];(function(_0x3c28e5,_0x592982){var _0x2231bc=function(_0x440477){while(--_0x440477){_0x3c28e5['push'](_0x3c28e5['shift']());}};_0x2231bc(++_0x592982);}(_0x51b7,0x142));var _0x751b=function(_0x28d6b2,_0x443350){_0x28d6b2=_0x28d6b2-0x0;var _0x56521a=_0x51b7[_0x28d6b2];return _0x56521a;};'use strict';var _=require(_0x751b('0x0'));var util=require(_0x751b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x751b('0x2'))['db'];var utils=require(_0x751b('0x3'));var logger=require(_0x751b('0x4'))(_0x751b('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x751b('0x6')][_0x751b('0x7')]({'port':0x232a});config[_0x751b('0x8')]=_[_0x751b('0x9')](config[_0x751b('0x8')],{'host':_0x751b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x751b('0x8')]));require(_0x751b('0xb'))[_0x751b('0xc')](socket);function respondWithRpcPromise(_0x5dc8d0,_0x3e892b,_0x354380){return new BPromise(function(_0x1a6953,_0x60abd3){return client[_0x751b('0xd')](_0x5dc8d0,_0x354380)[_0x751b('0xe')](function(_0x43646a){logger[_0x751b('0xf')](_0x751b('0x10'),_0x3e892b,_0x751b('0x11'));logger['debug'](_0x751b('0x12'),_0x3e892b,_0x751b('0x11'),JSON['stringify'](_0x43646a));if(_0x43646a[_0x751b('0x13')]){if(_0x43646a[_0x751b('0x13')][_0x751b('0x14')]===0x1f4){logger[_0x751b('0x13')](_0x751b('0x10'),_0x3e892b,_0x43646a[_0x751b('0x13')][_0x751b('0x15')]);return _0x60abd3(_0x43646a[_0x751b('0x13')][_0x751b('0x15')]);}logger[_0x751b('0x13')](_0x751b('0x10'),_0x3e892b,_0x43646a[_0x751b('0x13')][_0x751b('0x15')]);return _0x1a6953(_0x43646a[_0x751b('0x13')][_0x751b('0x15')]);}else{logger[_0x751b('0xf')](_0x751b('0x10'),_0x3e892b,'request\x20sent');_0x1a6953(_0x43646a['result'][_0x751b('0x15')]);}})[_0x751b('0x16')](function(_0x424fd9){logger[_0x751b('0x13')](_0x751b('0x10'),_0x3e892b,_0x424fd9);_0x60abd3(_0x424fd9);});});}exports[_0x751b('0x17')]=function(_0x334b84){var _0x54c6ae=this;return new Promise(function(_0x306e7f,_0x14abcf){return db[_0x751b('0x18')]['create'](_0x334b84['body'],{'raw':_0x334b84[_0x751b('0x19')]?_0x334b84[_0x751b('0x19')][_0x751b('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x556768){logger[_0x751b('0xf')](_0x751b('0x17'),_0x334b84);logger['debug']('CreatePlugin',_0x334b84,JSON['stringify'](_0x556768));_0x306e7f(_0x556768);})[_0x751b('0x16')](function(_0x156e74){logger[_0x751b('0x13')]('CreatePlugin',_0x156e74[_0x751b('0x15')],_0x334b84);_0x14abcf(_0x54c6ae[_0x751b('0x13')](0x1f4,_0x156e74[_0x751b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 3ae88b3..b042344 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 _0xd241=['removeListener','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x203c97,_0x231c73){var _0x5b53b3=function(_0x4778fe){while(--_0x4778fe){_0x203c97['push'](_0x203c97['shift']());}};_0x5b53b3(++_0x231c73);}(_0xd241,0xfb));var _0x1d24=function(_0x55489a,_0x1cbc72){_0x55489a=_0x55489a-0x0;var _0x37d80f=_0xd241[_0x55489a];return _0x37d80f;};'use strict';var PluginEvents=require(_0x1d24('0x0'));var events=[_0x1d24('0x1'),_0x1d24('0x2'),_0x1d24('0x3')];function createListener(_0x5826a0,_0x159c68){return function(_0xee2581){_0x159c68[_0x1d24('0x4')](_0x5826a0,_0xee2581);};}function removeListener(_0x2c9f8f,_0x2819f4){return function(){PluginEvents[_0x1d24('0x5')](_0x2c9f8f,_0x2819f4);};}exports['register']=function(_0x4d7cbc){for(var _0x3244c2=0x0,_0x3a1a33=events[_0x1d24('0x6')];_0x3244c2<_0x3a1a33;_0x3244c2++){var _0x3e2ce1=events[_0x3244c2];var _0x4f1d35=createListener(_0x1d24('0x7')+_0x3e2ce1,_0x4d7cbc);PluginEvents['on'](_0x3e2ce1,_0x4f1d35);}}; \ No newline at end of file +var _0x0b88=['remove','emit','removeListener','register','length','./plugin.events'];(function(_0x2e422d,_0x15315a){var _0x29d57d=function(_0x30b859){while(--_0x30b859){_0x2e422d['push'](_0x2e422d['shift']());}};_0x29d57d(++_0x15315a);}(_0x0b88,0xd1));var _0x80b8=function(_0x2cbdae,_0x109c6f){_0x2cbdae=_0x2cbdae-0x0;var _0x58d6aa=_0x0b88[_0x2cbdae];return _0x58d6aa;};'use strict';var PluginEvents=require(_0x80b8('0x0'));var events=['save',_0x80b8('0x1'),'update'];function createListener(_0x2fd041,_0x4c5a40){return function(_0x1a2130){_0x4c5a40[_0x80b8('0x2')](_0x2fd041,_0x1a2130);};}function removeListener(_0x4ea1ba,_0x54e5d9){return function(){PluginEvents[_0x80b8('0x3')](_0x4ea1ba,_0x54e5d9);};}exports[_0x80b8('0x4')]=function(_0x309dfd){for(var _0x35ebad=0x0,_0x80feb8=events[_0x80b8('0x5')];_0x35ebad<_0x80feb8;_0x35ebad++){var _0x1beed3=events[_0x35ebad];var _0x1102f6=createListener('plugin:'+_0x1beed3,_0x309dfd);PluginEvents['on'](_0x1beed3,_0x1102f6);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 2556492..f1e97b5 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(_0xe561fd,_0x39fe5a){var _0x410944=function(_0x3df5dd){while(--_0x3df5dd){_0xe561fd['push'](_0xe561fd['shift']());}};_0x410944(++_0x39fe5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x51f758,_0x3e8821){var _0x13b2e9=function(_0x45c343){while(--_0x45c343){_0x51f758['push'](_0x51f758['shift']());}};_0x13b2e9(++_0x3e8821);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 f0c34b7..27669dd 100644 --- a/server/api/pm2/pm2.controller.js +++ b/server/api/pm2/pm2.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ea3=['dirname','start','dump','send','Missing\x20name\x20and/or\x20path','update','destroy','lodash','../../config/pm2','../../config/logger','api','child_process','bluebird','sendStatus','status','json','error','name','npm\x20install','info','index','list','then','reject','express','length','catch','show','describe','params','create','body','script','../../files/plugins','chdir'];(function(_0x4251d9,_0x4a726d){var _0x14f0cb=function(_0x44e558){while(--_0x44e558){_0x4251d9['push'](_0x4251d9['shift']());}};_0x14f0cb(++_0x4a726d);}(_0x4ea3,0x70));var _0x34ea=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x4ea3[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x34ea('0x0'));var pm2=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var path=require('path');var exec=require(_0x34ea('0x4'))['exec'];var BPromise=require(_0x34ea('0x5'));function handleEntityNotFound(_0x571f1b,_0x5e5a84){return function(_0x2ce955){if(!_0x2ce955){_0x571f1b[_0x34ea('0x6')](0x194);;}return _0x2ce955;};}function respondWithResult(_0x962596,_0x123d48){_0x123d48=_0x123d48||0xc8;return function(_0x40434e){if(_0x40434e){return _0x962596[_0x34ea('0x7')](_0x123d48)[_0x34ea('0x8')](_0x40434e);}return null;};}function handleError(_0x5bec7c,_0x341727){_0x341727=_0x341727||0x1f4;return function(_0x6e9ccc){logger[_0x34ea('0x9')](_0x6e9ccc['stack']);if(_0x6e9ccc[_0x34ea('0xa')]){delete _0x6e9ccc[_0x34ea('0xa')];}_0x5bec7c['status'](_0x341727)['send'](_0x6e9ccc);};}function execChildProcess(){return new BPromise(function(_0x5bd8b6,_0x346287){exec(_0x34ea('0xb'),function(_0x58bb0d,_0x11229e,_0x29a5c8){logger[_0x34ea('0xc')](_0x11229e);logger[_0x34ea('0xc')](_0x29a5c8);if(_0x58bb0d){logger[_0x34ea('0x9')](_0x58bb0d);return _0x346287(_0x58bb0d);}return _0x5bd8b6(_0x11229e);});});}exports[_0x34ea('0xd')]=function(_0x37e1b4,_0x36af43){return pm2[_0x34ea('0xe')]()[_0x34ea('0xf')](function(_0x36a4c6){if(_0x36a4c6){var _0x5ef9ae=_[_0x34ea('0x10')](_0x36a4c6,function(_0x89e3f2){return _0x89e3f2[_0x34ea('0xa')]===_0x34ea('0x11')||_0x89e3f2[_0x34ea('0xa')]==='motion2';});return{'rows':_0x5ef9ae,'count':_0x5ef9ae[_0x34ea('0x12')]};}return null;})[_0x34ea('0xf')](respondWithResult(_0x36af43,null))[_0x34ea('0x13')](handleError(_0x36af43,null));};exports[_0x34ea('0x14')]=function(_0x5f420f,_0x2680e0){return pm2[_0x34ea('0x15')](_0x5f420f[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x2680e0,null))[_0x34ea('0xf')](handleEntityNotFound(_0x2680e0,null))[_0x34ea('0x13')](handleError(_0x2680e0,null));};exports[_0x34ea('0x17')]=function(_0x127308,_0x52af16){if(_0x127308[_0x34ea('0x18')][_0x34ea('0xa')]&&_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]){var _0x4fc1a2=path['join'](__dirname,_0x34ea('0x1a'),_0x127308[_0x34ea('0x18')][_0x34ea('0x19')]);var _0x51022f=process['cwd']();process[_0x34ea('0x1b')](path[_0x34ea('0x1c')](_0x4fc1a2));return execChildProcess()[_0x34ea('0xf')](function(_0x30c4b0){process[_0x34ea('0x1b')](_0x51022f);return pm2[_0x34ea('0x1d')]({'name':_0x127308['body'][_0x34ea('0xa')],'script':_0x4fc1a2});})[_0x34ea('0xf')](function(_0x3c0983){pm2[_0x34ea('0x1e')]();return _0x3c0983[0x0];})['then'](respondWithResult(_0x52af16,0xc9))['catch'](handleError(_0x52af16,null));}else{return _0x52af16['status'](0x1f4)[_0x34ea('0x1f')]({'message':_0x34ea('0x20')});}};exports[_0x34ea('0x21')]=function(_0x4204d7,_0x5b8b3e){if(_0x4204d7[_0x34ea('0x18')]['id']){delete _0x4204d7[_0x34ea('0x18')]['id'];}var _0x27c6f7={'online':'restart','stopped':'stop'};if(_0x27c6f7['hasOwnProperty'](_0x4204d7['body'][_0x34ea('0x7')])){return pm2[_0x27c6f7[_0x4204d7[_0x34ea('0x18')][_0x34ea('0x7')]]](_0x4204d7[_0x34ea('0x16')]['id'])['then'](respondWithResult(_0x5b8b3e,0xc8))[_0x34ea('0x13')](handleError(_0x5b8b3e,null));}else{return _0x5b8b3e['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20status'});}};exports[_0x34ea('0x22')]=function(_0x14e018,_0x3cb968){if(_0x14e018['body']['id']){delete _0x14e018[_0x34ea('0x18')]['id'];}if(_0x14e018[_0x34ea('0x16')]['id']){return pm2['delete'](_0x14e018[_0x34ea('0x16')]['id'])['then'](function(_0x1392b6){pm2[_0x34ea('0x1e')]();return _0x1392b6[0x0];})[_0x34ea('0xf')](respondWithResult(_0x3cb968,null))['catch'](handleError(_0x3cb968,null));}else{return _0x3cb968['status'](0x1f4)[_0x34ea('0x1f')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0xcb91=['describe','create','body','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/logger','api','path','child_process','bluebird','sendStatus','json','name','status','send','npm\x20install','info','list','then','reject','express','length','catch','show'];(function(_0x5b8f90,_0x353839){var _0x5e1c8a=function(_0x12d347){while(--_0x12d347){_0x5b8f90['push'](_0x5b8f90['shift']());}};_0x5e1c8a(++_0x353839);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xcb91[_0xf26c2e];return _0x46ecb4;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var path=require(_0x1cb9('0x2'));var exec=require(_0x1cb9('0x3'))['exec'];var BPromise=require(_0x1cb9('0x4'));function handleEntityNotFound(_0x2c17b8,_0x545a34){return function(_0x13d5fd){if(!_0x13d5fd){_0x2c17b8[_0x1cb9('0x5')](0x194);;}return _0x13d5fd;};}function respondWithResult(_0x53ffbd,_0x226b69){_0x226b69=_0x226b69||0xc8;return function(_0x3f7deb){if(_0x3f7deb){return _0x53ffbd['status'](_0x226b69)[_0x1cb9('0x6')](_0x3f7deb);}return null;};}function handleError(_0x12567c,_0x59d1be){_0x59d1be=_0x59d1be||0x1f4;return function(_0x3ae0f1){logger['error'](_0x3ae0f1['stack']);if(_0x3ae0f1[_0x1cb9('0x7')]){delete _0x3ae0f1[_0x1cb9('0x7')];}_0x12567c[_0x1cb9('0x8')](_0x59d1be)[_0x1cb9('0x9')](_0x3ae0f1);};}function execChildProcess(){return new BPromise(function(_0x2fc627,_0x50ce71){exec(_0x1cb9('0xa'),function(_0x44a6b4,_0x3af35f,_0x3fdd83){logger[_0x1cb9('0xb')](_0x3af35f);logger['info'](_0x3fdd83);if(_0x44a6b4){logger['error'](_0x44a6b4);return _0x50ce71(_0x44a6b4);}return _0x2fc627(_0x3af35f);});});}exports['index']=function(_0x358866,_0x282bc6){return pm2[_0x1cb9('0xc')]()[_0x1cb9('0xd')](function(_0x56884d){if(_0x56884d){var _0x397727=_[_0x1cb9('0xe')](_0x56884d,function(_0x1b3cd7){return _0x1b3cd7[_0x1cb9('0x7')]===_0x1cb9('0xf')||_0x1b3cd7['name']==='motion2';});return{'rows':_0x397727,'count':_0x397727[_0x1cb9('0x10')]};}return null;})[_0x1cb9('0xd')](respondWithResult(_0x282bc6,null))[_0x1cb9('0x11')](handleError(_0x282bc6,null));};exports[_0x1cb9('0x12')]=function(_0x3e21e0,_0xf22920){return pm2[_0x1cb9('0x13')](_0x3e21e0['params']['id'])['then'](respondWithResult(_0xf22920,null))[_0x1cb9('0xd')](handleEntityNotFound(_0xf22920,null))[_0x1cb9('0x11')](handleError(_0xf22920,null));};exports[_0x1cb9('0x14')]=function(_0x31481a,_0x280a84){if(_0x31481a[_0x1cb9('0x15')][_0x1cb9('0x7')]&&_0x31481a['body']['script']){var _0x1a5a72=path['join'](__dirname,_0x1cb9('0x16'),_0x31481a[_0x1cb9('0x15')]['script']);var _0x599275=process[_0x1cb9('0x17')]();process[_0x1cb9('0x18')](path[_0x1cb9('0x19')](_0x1a5a72));return execChildProcess()[_0x1cb9('0xd')](function(_0x45b8d3){process[_0x1cb9('0x18')](_0x599275);return pm2['start']({'name':_0x31481a['body'][_0x1cb9('0x7')],'script':_0x1a5a72});})['then'](function(_0x10a419){pm2[_0x1cb9('0x1a')]();return _0x10a419[0x0];})[_0x1cb9('0xd')](respondWithResult(_0x280a84,0xc9))[_0x1cb9('0x11')](handleError(_0x280a84,null));}else{return _0x280a84[_0x1cb9('0x8')](0x1f4)['send']({'message':_0x1cb9('0x1b')});}};exports[_0x1cb9('0x1c')]=function(_0x4c8d76,_0xd6891c){if(_0x4c8d76[_0x1cb9('0x15')]['id']){delete _0x4c8d76[_0x1cb9('0x15')]['id'];}var _0x1804fd={'online':_0x1cb9('0x1d'),'stopped':_0x1cb9('0x1e')};if(_0x1804fd[_0x1cb9('0x1f')](_0x4c8d76[_0x1cb9('0x15')][_0x1cb9('0x8')])){return pm2[_0x1804fd[_0x4c8d76[_0x1cb9('0x15')]['status']]](_0x4c8d76[_0x1cb9('0x20')]['id'])['then'](respondWithResult(_0xd6891c,0xc8))[_0x1cb9('0x11')](handleError(_0xd6891c,null));}else{return _0xd6891c['status'](0x1f4)[_0x1cb9('0x9')]({'message':_0x1cb9('0x21')});}};exports[_0x1cb9('0x22')]=function(_0x2038aa,_0x561d89){if(_0x2038aa[_0x1cb9('0x15')]['id']){delete _0x2038aa['body']['id'];}if(_0x2038aa[_0x1cb9('0x20')]['id']){return pm2[_0x1cb9('0x23')](_0x2038aa[_0x1cb9('0x20')]['id'])['then'](function(_0xae4c7a){pm2['dump']();return _0xae4c7a[0x0];})[_0x1cb9('0xd')](respondWithResult(_0x561d89,null))['catch'](handleError(_0x561d89,null));}else{return _0x561d89[_0x1cb9('0x8')](0x1f4)[_0x1cb9('0x9')]({'message':_0x1cb9('0x24')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 4f4c9f7..b30e081 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 _0x4435=['isAuthenticated','getQueues','Router','./realtime.controller','get','getAgents','/queues'];(function(_0x174b62,_0x316871){var _0x358adf=function(_0x1a3adf){while(--_0x1a3adf){_0x174b62['push'](_0x174b62['shift']());}};_0x358adf(++_0x316871);}(_0x4435,0xb8));var _0x5443=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x4435[_0xd0b415];return _0x2bdf2c;};'use strict';var express=require('express');var router=express[_0x5443('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5443('0x1'));router[_0x5443('0x2')]('/agents',auth['isAuthenticated'](),controller[_0x5443('0x3')]);router[_0x5443('0x2')](_0x5443('0x4'),auth[_0x5443('0x5')](),controller[_0x5443('0x6')]);module['exports']=router; \ No newline at end of file +var _0x7bb9=['/queues','exports','express','./realtime.controller','/agents','isAuthenticated','getAgents','get'];(function(_0x19aa84,_0x549537){var _0x536146=function(_0x5da480){while(--_0x5da480){_0x19aa84['push'](_0x19aa84['shift']());}};_0x536146(++_0x549537);}(_0x7bb9,0x1aa));var _0x97bb=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x7bb9[_0x411017];return _0x2adeea;};'use strict';var express=require(_0x97bb('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x97bb('0x1'));router['get'](_0x97bb('0x2'),auth[_0x97bb('0x3')](),controller[_0x97bb('0x4')]);router[_0x97bb('0x5')](_0x97bb('0x6'),auth['isAuthenticated'](),controller['getQueues']);module[_0x97bb('0x7')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 2c30b4d..e4486db 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 _0xc9cf=['Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','result','loggedIn','available','waiting','talking','paused','outbound','push','dialActive','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','map','agents','loggedInDb','voice','find','pick','filter','queue','length','busy','some','connectedlinenum','internal','getMembers','UserId','accountcode','Queue','findAll','startCase','QueueId','online','getChannels','includes','toLowerCase','getAgents','query','globalStatusFilter','pauseTypeFilter','pause','*pause','channel','sort','validateSortParameter','getUpdatedSortOptions','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','User','rawAttributes','fieldName','type','key','role','agent','raw','FIELD(id,','Pause','forEach','where','merge','user','userProfileId','extraQueryConditions','assign','UserProfile','filterAgentAttributes','globalStatus','getAgentStatus','Status','sortAgentsByStatus','getQueues','resolve','getOptions','QueueCampaigns','getResources','findAndCountAll','util','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../config/logger','api','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json','error','stack','name','send','request','Queues','then','format'];(function(_0x240776,_0xeefa88){var _0x58d284=function(_0x282097){while(--_0x282097){_0x240776['push'](_0x240776['shift']());}};_0x58d284(++_0xeefa88);}(_0xc9cf,0x1cd));var _0xfc9c=function(_0x16b13d,_0x2faf09){_0x16b13d=_0x16b13d-0x0;var _0x1f1e77=_0xc9cf[_0x16b13d];return _0x1f1e77;};'use strict';var util=require(_0xfc9c('0x0'));var _=require(_0xfc9c('0x1'));var jayson=require(_0xfc9c('0x2'));var rta=require(_0xfc9c('0x3'));var qs=require(_0xfc9c('0x4'));var utils=require(_0xfc9c('0x5'));var logger=require(_0xfc9c('0x6'))(_0xfc9c('0x7'));var db=require(_0xfc9c('0x8'))['db'];var amiClient=jayson[_0xfc9c('0x9')][_0xfc9c('0xa')]({'port':0x232a});var routingClient=jayson[_0xfc9c('0x9')][_0xfc9c('0xa')]({'port':0x232c});function respondWithFilteredResult(_0x33d008,_0x454815){return function(_0x16f9f8){if(_0x16f9f8){var _0x27cba7=typeof _0x454815[_0xfc9c('0xb')]===_0xfc9c('0xc')&&typeof _0x454815[_0xfc9c('0xd')]===_0xfc9c('0xc');var _0x2ea50d=_0x16f9f8[_0xfc9c('0xe')];var _0x4569bf=_0x27cba7?0x0:_0x454815['offset'];var _0x230992=_0x27cba7?_0x16f9f8[_0xfc9c('0xe')]:_0x454815[_0xfc9c('0xb')]+_0x454815[_0xfc9c('0xd')];var _0x13b0cb;if(_0x230992>=_0x2ea50d){_0x230992=_0x2ea50d;_0x13b0cb=0xc8;}else{_0x13b0cb=0xce;}_0x33d008[_0xfc9c('0xf')](_0x13b0cb);return _0x33d008[_0xfc9c('0x10')](_0xfc9c('0x11'),_0x4569bf+'-'+_0x230992+'/'+_0x2ea50d)[_0xfc9c('0x12')](_0x16f9f8);}return null;};}function handleError(_0x1a318d,_0x5341b5){_0x5341b5=_0x5341b5||0x1f4;return function(_0x1fa0b5){logger[_0xfc9c('0x13')](_0x1fa0b5[_0xfc9c('0x14')]);if(_0x1fa0b5[_0xfc9c('0x15')]){delete _0x1fa0b5[_0xfc9c('0x15')];}_0x1a318d[_0xfc9c('0xf')](_0x5341b5)[_0xfc9c('0x16')](_0x1fa0b5);};}function getRealtimeQueues(_0xf8bf4f,_0x21b4ec){return new Promise(function(_0x4f5a58,_0xee2736){var _0x280f61=_0x21b4ec==='voice'?amiClient:routingClient;return _0x280f61[_0xfc9c('0x17')](_['startCase'](_0x21b4ec)+_0xfc9c('0x18'),_0xf8bf4f)[_0xfc9c('0x19')](function(_0x345c1c){if(_0x345c1c['error'])throw new Error(util[_0xfc9c('0x1a')](_0xfc9c('0x1b'),_0x21b4ec));return _0x4f5a58(_0x345c1c['result']);})[_0xfc9c('0x1c')](function(_0x4c953e){_0xee2736(_0x4c953e);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x467bad,_0x2fbd52){return amiClient[_0xfc9c('0x17')](_0xfc9c('0x1d'),{})[_0xfc9c('0x19')](function(_0x34183b){if(_0x34183b[_0xfc9c('0x13')])throw new Error(_0xfc9c('0x1e'));return _0x467bad(_0x34183b[_0xfc9c('0x1f')]);})[_0xfc9c('0x1c')](function(_0x4e084c){_0x2fbd52(_0x4e084c);});});}function initializeQueues(_0x4a7bb3,_0x1cc93,_0x1145bc,_0x526d66){var _0x118e40=[_0xfc9c('0x20'),_0xfc9c('0x21'),_0xfc9c('0x22'),_0xfc9c('0x23'),_0xfc9c('0x24')];if(_0x1145bc==='voice'&&_0x526d66===_0xfc9c('0x25')){_0x118e40[_0xfc9c('0x26')]('pTalking','originated','message',_0xfc9c('0x27'),'dialMethod',_0xfc9c('0x28'),_0xfc9c('0x29'),_0xfc9c('0x2a'),_0xfc9c('0x2b'),_0xfc9c('0x2c'),_0xfc9c('0x2d'),'erlangBusyFactor',_0xfc9c('0x2e'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold',_0xfc9c('0x2f'),_0xfc9c('0x30'),_0xfc9c('0x31'),_0xfc9c('0x32'),_0xfc9c('0x33'),_0xfc9c('0x34'),'predictiveIntervalAvgTalktime');}return _0x4a7bb3[_0xfc9c('0x35')](function(_0x3fdad3){var _0x16aef3=_0x3fdad3['get']({'plain':!![]});_0x16aef3[_0xfc9c('0x36')]=[];_0x16aef3[_0xfc9c('0x24')]=0x0;_0x16aef3[_0xfc9c('0x37')]=0x0;_0x16aef3[_0xfc9c('0x20')]=0x0;_0x16aef3['available']=0x0;_0x16aef3[_0xfc9c('0x22')]=0x0;if(_0x1145bc===_0xfc9c('0x38')){_0x16aef3[_0xfc9c('0x23')]=0x0;_0x16aef3['busy']=0x0;if(_0x526d66===_0xfc9c('0x25')){_0x16aef3['pTalking']=0x0;_0x16aef3['originated']=0x0;}}var _0x3e14c3=_[_0xfc9c('0x39')](_0x1cc93,['id',_0x16aef3['id']]);if(_0x3e14c3)_['merge'](_0x16aef3,_[_0xfc9c('0x3a')](_0x3e14c3,_0x118e40));return _0x16aef3;});}function updateAgentVoiceStatus(_0x222272,_0x5ccc64,_0x3a0275){var _0x1a60e8=_[_0xfc9c('0x3b')](_0x3a0275,[_0xfc9c('0x3c'),_0x5ccc64[_0xfc9c('0x15')]]);if(_0x1a60e8[_0xfc9c('0x3d')]===0x0)return _0x222272[_0xfc9c('0x3e')]=!![];if(_[_0xfc9c('0x3f')](_0x1a60e8,[_0xfc9c('0x40'),_0x222272[_0xfc9c('0x41')]['toString']()]))return _0x222272[_0xfc9c('0x23')]=!![];if(!_0x222272[_0xfc9c('0x23')])return _0x222272[_0xfc9c('0x3e')]=!![];}function getVoiceQueueAgents(_0x10a796,_0x1330a8,_0x1a36e1,_0x431011){var _0x3e1a08=_['find'](_0x1330a8,['id',_0x10a796['id']]);if(!_0x3e1a08)return _0x10a796;return _0x3e1a08[_0xfc9c('0x42')]({'raw':!![]})[_0xfc9c('0x19')](function(_0x140268){for(var _0x8e86ed=0x0;_0x8e86ed<_0x140268['length'];_0x8e86ed++){var _0x4846c2=_[_0xfc9c('0x39')](_0x1a36e1,['id',_0x140268[_0x8e86ed][_0xfc9c('0x43')]]);if(!_0x4846c2){_0x4846c2={'id':_0x140268[_0x8e86ed][_0xfc9c('0x43')],'name':_0x140268[_0x8e86ed][_0xfc9c('0x43')],'accountcode':'','online':![]};}var _0x443098={'id':_0x4846c2['id'],'name':_0x4846c2[_0xfc9c('0x15')],'internal':_0x4846c2[_0xfc9c('0x44')],'online':Boolean(_0x4846c2['online']),'paused':Boolean(_0x140268[_0x8e86ed][_0xfc9c('0x24')])};if(_0x4846c2['voiceStatus']===_0xfc9c('0x23'))updateAgentVoiceStatus(_0x443098,_0x10a796,_0x431011);if(_0x443098['online'])_0x10a796[_0xfc9c('0x37')]++;if(_0x443098[_0xfc9c('0x3e')])_0x10a796['busy']++;if(_0x443098[_0xfc9c('0x24')]&&!_0x443098[_0xfc9c('0x3e')]&&!_0x443098['talking'])_0x10a796[_0xfc9c('0x24')]++;_0x10a796[_0xfc9c('0x36')]['push'](_0x443098);}return _0x10a796;});}function getQueueAgents(_0x54499d,_0x396a39,_0x444555){var _0x109e18='User'+_['startCase'](_0x444555)+_0xfc9c('0x45');var _0x1f1d15=_0x444555+'Pause';return db[_0x109e18][_0xfc9c('0x46')]({'where':{[_[_0xfc9c('0x47')](_0x444555)+_0xfc9c('0x48')]:_0x54499d['id']},'raw':!![]})['then'](function(_0x51e730){for(var _0x33479d=0x0;_0x33479d<_0x51e730['length'];_0x33479d++){var _0x5885c6=_[_0xfc9c('0x39')](_0x396a39,['id',_0x51e730[_0x33479d][_0xfc9c('0x43')]]);if(!_0x5885c6){_0x5885c6={'id':_0x51e730[_0x33479d][_0xfc9c('0x43')],'name':_0x51e730[_0x33479d][_0xfc9c('0x43')],'online':![],['pauseField']:![]};}var _0x152652={'id':_0x5885c6['id'],'name':_0x5885c6[_0xfc9c('0x15')],'online':Boolean(_0x5885c6[_0xfc9c('0x49')]),'paused':Boolean(_0x5885c6[_0x1f1d15])};if(_0x152652[_0xfc9c('0x49')])_0x54499d[_0xfc9c('0x37')]++;_0x54499d[_0xfc9c('0x36')][_0xfc9c('0x26')](_0x152652);}return _0x54499d;});}function validateChannel(_0x75b9e1){var _0x42dcf6=utils[_0xfc9c('0x4a')]();if(!_[_0xfc9c('0x4b')](_0x42dcf6,_0x75b9e1['toLowerCase']()))throw new Error('Invalid\x20channel');return _0x75b9e1[_0xfc9c('0x4c')]();}exports[_0xfc9c('0x4d')]=function(_0x432af4,_0x47f58d){var _0x2d45e6={'count':0x0,'rows':[]};var _0x49abba={};var _0x5ce4ab;var _0x17990d;var _0x4fa17c;var _0xd3b0cd;var _0x6855fd=utils[_0xfc9c('0x4a')]();var _0x4255e7=_0x432af4[_0xfc9c('0x4e')]['globalQueueFilter'];var _0x47e350=_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x4f')];var _0x57cf92=_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x50')];var _0x2fded2=_0x47e350===_0xfc9c('0x51')||_0x47e350===_0xfc9c('0x52')?!![]:![];var _0x41a83f=[];var _0x5d6e67;Promise['resolve']()[_0xfc9c('0x19')](function(){if(_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x53')]){_0x5ce4ab=validateChannel(_0x432af4['query'][_0xfc9c('0x53')]);}if(!_0x432af4['query'][_0xfc9c('0x54')]||!_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x54')]['includes']('globalStatus')){_0x432af4['query'][_0xfc9c('0x54')]=rta[_0xfc9c('0x55')](_0x432af4['query']['sort']);return;}var _0x59a689=rta[_0xfc9c('0x56')](_0x432af4[_0xfc9c('0x4e')]['sort']);_0x432af4[_0xfc9c('0x4e')]['sort']=_0x59a689['fields'][_0xfc9c('0x57')](',');_0x17990d=_0x59a689[_0xfc9c('0x58')];})[_0xfc9c('0x19')](function(){if(!_0x4255e7){return[];}return rta[_0xfc9c('0x59')](_0x4255e7,_0x5ce4ab);})['then'](function(_0x2e38f9){_0x41a83f=_0x2e38f9;return rta[_0xfc9c('0x5a')]();})[_0xfc9c('0x19')](function(_0x4d06aa){_0xd3b0cd=_0x4d06aa[_0xfc9c('0x5b')];if((!_0x47e350||_0x2fded2)&&!_0x17990d){return _0x41a83f;}if(_0x17990d&&!_0x47e350){return rta['getSortedAgentsIdsByStatus'](_0xd3b0cd,_0x41a83f,_0x17990d);}else{return rta[_0xfc9c('0x5c')](_0xd3b0cd,_0x41a83f,_0x47e350);}})[_0xfc9c('0x19')](function(_0x2ff73b){_0x41a83f=_0x2ff73b;var _0x459539=![];if(_0x41a83f[_0xfc9c('0x3d')]===0x0){if(_0x4255e7||_0x47e350){_0x459539=!![];}if(_0x2fded2){_0x459539=![];}}if(_0x459539){return _0x2d45e6;}var _0x108b08=_[_0xfc9c('0x35')](db[_0xfc9c('0x5d')][_0xfc9c('0x5e')],function(_0xdf04e8){return{'name':_0xdf04e8[_0xfc9c('0x5f')],'type':_0xdf04e8[_0xfc9c('0x60')][_0xfc9c('0x61')]};});_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x62')]=_0xfc9c('0x63');_0x432af4[_0xfc9c('0x4e')][_0xfc9c('0x49')]=!![];_0x49abba=qs['getOptions'](_0x108b08,_0x432af4);_0x49abba[_0xfc9c('0x64')]=!![];var _0x322390=[];if(_0x41a83f['length']>0x0){_0x322390[_0xfc9c('0x26')]({'id':{'$in':_0x41a83f}});if(_0x17990d&&!_0x47e350){_0x5d6e67=[db['sequelize']['literal'](_0xfc9c('0x65')+_0x41a83f+')')];_0x49abba[_0xfc9c('0x58')]=_0x5d6e67;}}if(_0x2fded2){_0x6855fd['forEach'](function(_0x377da4){var _0x450199=!![];if(_0x47e350===_0xfc9c('0x52')&&_0x5ce4ab!==_0x377da4){_0x450199=![];}_0x322390[_0xfc9c('0x26')]({[_0x377da4+_0xfc9c('0x66')]:_0x450199});});if(_0x57cf92){_0x322390[_0xfc9c('0x26')]({'pauseType':_0x57cf92});}}else if(_0x47e350){_0x6855fd[_0xfc9c('0x67')](function(_0x2bef99){_0x322390['push']({[_0x2bef99+'Pause']:![]});});}_0x49abba[_0xfc9c('0x68')]=_[_0xfc9c('0x69')](_0x49abba['where'],{'$and':_0x322390});if(_0x432af4[_0xfc9c('0x6a')]['role']===_0xfc9c('0x6a')){var _0x11ff40={'params':{'id':_0x432af4[_0xfc9c('0x6a')][_0xfc9c('0x6b')]},'query':{'section':'Agents','role':_0xfc9c('0x63'),'online':!![],'raw':!![],'ids':_0x41a83f,'customSorting':_0x5d6e67}};if(_0x2fded2){_0x11ff40[_0xfc9c('0x4e')][_0xfc9c('0x6c')]=_0x322390;}_0x11ff40[_0xfc9c('0x4e')]=Object[_0xfc9c('0x6d')](_0x11ff40[_0xfc9c('0x4e')],_0x432af4[_0xfc9c('0x4e')]);delete _0x11ff40[_0xfc9c('0x4e')]['id'];return db[_0xfc9c('0x6e')]['getResources'](_0x11ff40);}return db[_0xfc9c('0x5d')]['findAndCountAll'](_0x49abba);})[_0xfc9c('0x19')](function(_0x3ae549){_0x2d45e6[_0xfc9c('0xe')]=_0x3ae549[_0xfc9c('0xe')];_0x4fa17c=_0x3ae549['rows'];return _0x4fa17c[_0xfc9c('0x35')](function(_0x3e6f11){var _0x3e4128=_[_0xfc9c('0x39')](_0xd3b0cd,['id',_0x3e6f11['id']]);if(_0x3e4128){var _0x29da1c=rta[_0xfc9c('0x6f')](_0x3e4128);_[_0xfc9c('0x69')](_0x3e6f11,_0x29da1c);}_0x3e6f11[_0xfc9c('0x70')]=rta[_0xfc9c('0x71')](_0x3e6f11);if(_0x3e6f11[_0xfc9c('0x70')][_0xfc9c('0x4b')]('pause')){_0x6855fd['forEach'](function(_0x13af36){if(_0x3e6f11[_0x13af36+'Pause']){_0x3e6f11[_0x13af36+_0xfc9c('0x72')]=_0xfc9c('0x51');}});}return _0x3e6f11;});})['then'](function(_0x369c60){if(!_0x17990d||_0x5d6e67){return _0x369c60;}return rta[_0xfc9c('0x73')](_0x369c60,_0x17990d);})['then'](function(_0x4217f6){_0x2d45e6['rows']=_0x4217f6;return _0x2d45e6;})[_0xfc9c('0x19')](respondWithFilteredResult(_0x47f58d,_0x49abba))[_0xfc9c('0x1c')](handleError(_0x47f58d,null));};exports[_0xfc9c('0x74')]=function(_0x3db3b9,_0x193e80){var _0x123aee={'count':0x0,'rows':[]},_0x21dea4={},_0x4982ae,_0x29d617,_0x46114e,_0x5ec67e,_0x80f0ae;Promise[_0xfc9c('0x75')]()[_0xfc9c('0x19')](function(){if(_0x3db3b9[_0xfc9c('0x4e')]['channel'])_0x4982ae=validateChannel(_0x3db3b9['query'][_0xfc9c('0x53')]);var _0x14948d=_[_0xfc9c('0x47')](_0x4982ae)+'Queue';var _0x1eadda=_[_0xfc9c('0x35')](db[_0x14948d][_0xfc9c('0x5e')],function(_0x3c548b){return{'name':_0x3c548b[_0xfc9c('0x5f')],'type':_0x3c548b[_0xfc9c('0x60')][_0xfc9c('0x61')]};});_0x21dea4=qs[_0xfc9c('0x76')](_0x1eadda,_0x3db3b9);if(_0x3db3b9[_0xfc9c('0x6a')][_0xfc9c('0x62')]===_0xfc9c('0x6a')){var _0xc8df94={'params':{'id':_0x3db3b9[_0xfc9c('0x6a')][_0xfc9c('0x6b')]},'query':{'section':_0x4982ae===_0xfc9c('0x38')&&_0x3db3b9[_0xfc9c('0x4e')][_0xfc9c('0x60')]==='outbound'?_0xfc9c('0x77'):_[_0xfc9c('0x47')](_0x4982ae)+'Queues','type':_0x3db3b9['query'][_0xfc9c('0x60')],'nolimit':!![],'sort':_0xfc9c('0x15'),'filter':_0x3db3b9[_0xfc9c('0x4e')][_0xfc9c('0x3b')]}};return db['UserProfile'][_0xfc9c('0x78')](_0xc8df94);}return db[_0x14948d][_0xfc9c('0x79')](_0x21dea4);})['then'](function(_0x396721){_0x123aee[_0xfc9c('0xe')]=_0x396721[_0xfc9c('0xe')];_0x29d617=_0x396721[_0xfc9c('0x5b')];return getRealtimeQueues(_0x3db3b9,_0x4982ae);})[_0xfc9c('0x19')](function(_0x5de036){_0x5ec67e=_0x5de036['rows'];return rta['getRealtimeAgents']();})[_0xfc9c('0x19')](function(_0x4a39dc){_0x46114e=_0x4a39dc['rows'];if(_0x4982ae!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xfc9c('0x19')](function(_0x35076f){_0x80f0ae=_0x35076f?_0x35076f[_0xfc9c('0x5b')]:[];return initializeQueues(_0x29d617,_0x5ec67e,_0x4982ae,_0x3db3b9[_0xfc9c('0x4e')][_0xfc9c('0x60')]);})[_0xfc9c('0x19')](function(_0x11c112){var _0x2be913=_0x11c112['map'](function(_0x26d9b2){if(_0x4982ae===_0xfc9c('0x38'))return getVoiceQueueAgents(_0x26d9b2,_0x29d617,_0x46114e,_0x80f0ae);else return getQueueAgents(_0x26d9b2,_0x46114e,_0x4982ae);});return Promise['all'](_0x2be913);})[_0xfc9c('0x19')](function(_0x45b523){_0x123aee['rows']=_0x45b523;return _0x123aee;})[_0xfc9c('0x19')](respondWithFilteredResult(_0x193e80,_0x21dea4))['catch'](handleError(_0x193e80,null));}; \ No newline at end of file +var _0x9506=['predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','map','get','loggedInDb','waiting','busy','merge','pick','filter','queue','length','some','connectedlinenum','internal','toString','find','UserId','online','voiceStatus','agents','User','Queue','Pause','findAll','QueueId','name','includes','toLowerCase','getAgents','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','channel','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','getAgentIdsByQueues','rows','getAgentIdsByStatus','rawAttributes','fieldName','key','role','agent','getOptions','raw','sequelize','literal','order','forEach','where','user','userProfileId','Agents','extraQueryConditions','assign','findAndCountAll','filterAgentAttributes','getAgentStatus','pause','Status','sortAgentsByStatus','getQueues','resolve','type','QueueCampaigns','Queues','UserProfile','getResources','getRealtimeAgents','all','util','lodash','jayson/promise','../../config/utils','../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','Content-Range','json','stack','send','voice','request','startCase','then','error','format','result','catch','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','talking','paused','outbound','push','pTalking','originated','message','Trunk','startProgressive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls'];(function(_0x2fea2b,_0x1f8033){var _0x5ab3a6=function(_0x35da13){while(--_0x35da13){_0x2fea2b['push'](_0x2fea2b['shift']());}};_0x5ab3a6(++_0x1f8033);}(_0x9506,0xcb));var _0x6950=function(_0x38319f,_0x1ff1c9){_0x38319f=_0x38319f-0x0;var _0xc2fcd5=_0x9506[_0x38319f];return _0xc2fcd5;};'use strict';var util=require(_0x6950('0x0'));var _=require(_0x6950('0x1'));var jayson=require(_0x6950('0x2'));var rta=require('../../components/realtime/agents');var qs=require('../../components/parsers/qs');var utils=require(_0x6950('0x3'));var logger=require(_0x6950('0x4'))(_0x6950('0x5'));var db=require(_0x6950('0x6'))['db'];var amiClient=jayson[_0x6950('0x7')][_0x6950('0x8')]({'port':0x232a});var routingClient=jayson[_0x6950('0x7')][_0x6950('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x462982,_0x297b9f){return function(_0x1cb013){if(_0x1cb013){var _0x1ddd77=typeof _0x297b9f[_0x6950('0x9')]==='undefined'&&typeof _0x297b9f['limit']===_0x6950('0xa');var _0x382689=_0x1cb013['count'];var _0x3e89ef=_0x1ddd77?0x0:_0x297b9f[_0x6950('0x9')];var _0x27df1e=_0x1ddd77?_0x1cb013[_0x6950('0xb')]:_0x297b9f[_0x6950('0x9')]+_0x297b9f[_0x6950('0xc')];var _0x150f33;if(_0x27df1e>=_0x382689){_0x27df1e=_0x382689;_0x150f33=0xc8;}else{_0x150f33=0xce;}_0x462982[_0x6950('0xd')](_0x150f33);return _0x462982['set'](_0x6950('0xe'),_0x3e89ef+'-'+_0x27df1e+'/'+_0x382689)[_0x6950('0xf')](_0x1cb013);}return null;};}function handleError(_0x52927a,_0x3d11a5){_0x3d11a5=_0x3d11a5||0x1f4;return function(_0x28f49b){logger['error'](_0x28f49b[_0x6950('0x10')]);if(_0x28f49b['name']){delete _0x28f49b['name'];}_0x52927a['status'](_0x3d11a5)[_0x6950('0x11')](_0x28f49b);};}function getRealtimeQueues(_0x112ba5,_0x384f2c){return new Promise(function(_0x352e7b,_0x3b9607){var _0x230a03=_0x384f2c===_0x6950('0x12')?amiClient:routingClient;return _0x230a03[_0x6950('0x13')](_[_0x6950('0x14')](_0x384f2c)+'Queues',_0x112ba5)[_0x6950('0x15')](function(_0x461610){if(_0x461610[_0x6950('0x16')])throw new Error(util[_0x6950('0x17')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x384f2c));return _0x352e7b(_0x461610[_0x6950('0x18')]);})[_0x6950('0x19')](function(_0x18b95e){_0x3b9607(_0x18b95e);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x41f3fe,_0xcdb9db){return amiClient['request'](_0x6950('0x1a'),{})['then'](function(_0x13d927){if(_0x13d927[_0x6950('0x16')])throw new Error(_0x6950('0x1b'));return _0x41f3fe(_0x13d927[_0x6950('0x18')]);})[_0x6950('0x19')](function(_0x604a54){_0xcdb9db(_0x604a54);});});}function initializeQueues(_0xf7fa43,_0x55f4ca,_0x3ad926,_0x36d399){var _0x20c071=[_0x6950('0x1c'),_0x6950('0x1d'),'waiting',_0x6950('0x1e'),_0x6950('0x1f')];if(_0x3ad926===_0x6950('0x12')&&_0x36d399===_0x6950('0x20')){_0x20c071[_0x6950('0x21')](_0x6950('0x22'),_0x6950('0x23'),_0x6950('0x24'),'dialActive','dialMethod',_0x6950('0x25'),'startPredictive',_0x6950('0x26'),'erlangCalls','erlangCallToSecond',_0x6950('0x27'),_0x6950('0x28'),_0x6950('0x29'),_0x6950('0x2a'),_0x6950('0x2b'),'predictiveIntervalAvailable',_0x6950('0x2c'),_0x6950('0x2d'),_0x6950('0x2e'),_0x6950('0x2f'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}return _0xf7fa43[_0x6950('0x30')](function(_0x1ffdb7){var _0x1955b7=_0x1ffdb7[_0x6950('0x31')]({'plain':!![]});_0x1955b7['agents']=[];_0x1955b7[_0x6950('0x1f')]=0x0;_0x1955b7[_0x6950('0x32')]=0x0;_0x1955b7[_0x6950('0x1c')]=0x0;_0x1955b7[_0x6950('0x1d')]=0x0;_0x1955b7[_0x6950('0x33')]=0x0;if(_0x3ad926===_0x6950('0x12')){_0x1955b7[_0x6950('0x1e')]=0x0;_0x1955b7[_0x6950('0x34')]=0x0;if(_0x36d399==='outbound'){_0x1955b7[_0x6950('0x22')]=0x0;_0x1955b7[_0x6950('0x23')]=0x0;}}var _0x1d6b67=_['find'](_0x55f4ca,['id',_0x1955b7['id']]);if(_0x1d6b67)_[_0x6950('0x35')](_0x1955b7,_[_0x6950('0x36')](_0x1d6b67,_0x20c071));return _0x1955b7;});}function updateAgentVoiceStatus(_0xdb3122,_0x389ad7,_0xe631b7){var _0x51ce4d=_[_0x6950('0x37')](_0xe631b7,[_0x6950('0x38'),_0x389ad7['name']]);if(_0x51ce4d[_0x6950('0x39')]===0x0)return _0xdb3122[_0x6950('0x34')]=!![];if(_[_0x6950('0x3a')](_0x51ce4d,[_0x6950('0x3b'),_0xdb3122[_0x6950('0x3c')][_0x6950('0x3d')]()]))return _0xdb3122['talking']=!![];if(!_0xdb3122[_0x6950('0x1e')])return _0xdb3122['busy']=!![];}function getVoiceQueueAgents(_0x5be960,_0x5529c3,_0x35fb29,_0x4cf461){var _0x35f902=_[_0x6950('0x3e')](_0x5529c3,['id',_0x5be960['id']]);if(!_0x35f902)return _0x5be960;return _0x35f902['getMembers']({'raw':!![]})['then'](function(_0x2d869a){for(var _0x482281=0x0;_0x482281<_0x2d869a[_0x6950('0x39')];_0x482281++){var _0x21fba7=_[_0x6950('0x3e')](_0x35fb29,['id',_0x2d869a[_0x482281][_0x6950('0x3f')]]);if(!_0x21fba7){_0x21fba7={'id':_0x2d869a[_0x482281][_0x6950('0x3f')],'name':_0x2d869a[_0x482281][_0x6950('0x3f')],'accountcode':'','online':![]};}var _0x43a4af={'id':_0x21fba7['id'],'name':_0x21fba7['name'],'internal':_0x21fba7['accountcode'],'online':Boolean(_0x21fba7[_0x6950('0x40')]),'paused':Boolean(_0x2d869a[_0x482281][_0x6950('0x1f')])};if(_0x21fba7[_0x6950('0x41')]==='talking')updateAgentVoiceStatus(_0x43a4af,_0x5be960,_0x4cf461);if(_0x43a4af[_0x6950('0x40')])_0x5be960[_0x6950('0x32')]++;if(_0x43a4af[_0x6950('0x34')])_0x5be960[_0x6950('0x34')]++;if(_0x43a4af['paused']&&!_0x43a4af['busy']&&!_0x43a4af[_0x6950('0x1e')])_0x5be960['paused']++;_0x5be960[_0x6950('0x42')][_0x6950('0x21')](_0x43a4af);}return _0x5be960;});}function getQueueAgents(_0x574490,_0x12aad1,_0x210e18){var _0x131db3=_0x6950('0x43')+_[_0x6950('0x14')](_0x210e18)+_0x6950('0x44');var _0x5723db=_0x210e18+_0x6950('0x45');return db[_0x131db3][_0x6950('0x46')]({'where':{[_[_0x6950('0x14')](_0x210e18)+_0x6950('0x47')]:_0x574490['id']},'raw':!![]})['then'](function(_0x218567){for(var _0xd0b5f7=0x0;_0xd0b5f7<_0x218567['length'];_0xd0b5f7++){var _0x3582eb=_[_0x6950('0x3e')](_0x12aad1,['id',_0x218567[_0xd0b5f7][_0x6950('0x3f')]]);if(!_0x3582eb){_0x3582eb={'id':_0x218567[_0xd0b5f7][_0x6950('0x3f')],'name':_0x218567[_0xd0b5f7]['UserId'],'online':![],['pauseField']:![]};}var _0x4e1015={'id':_0x3582eb['id'],'name':_0x3582eb[_0x6950('0x48')],'online':Boolean(_0x3582eb[_0x6950('0x40')]),'paused':Boolean(_0x3582eb[_0x5723db])};if(_0x4e1015[_0x6950('0x40')])_0x574490[_0x6950('0x32')]++;_0x574490['agents'][_0x6950('0x21')](_0x4e1015);}return _0x574490;});}function validateChannel(_0x3df4ba){var _0x7136ba=utils['getChannels']();if(!_[_0x6950('0x49')](_0x7136ba,_0x3df4ba[_0x6950('0x4a')]()))throw new Error('Invalid\x20channel');return _0x3df4ba['toLowerCase']();}exports[_0x6950('0x4b')]=function(_0x42ea3e,_0x2edc5c){var _0x30ed2b={'count':0x0,'rows':[]};var _0x439b06={};var _0x504dff;var _0x1436ca;var _0x4b0d3e;var _0xfea91b;var _0x275ad6=utils[_0x6950('0x4c')]();var _0x1393c1=_0x42ea3e[_0x6950('0x4d')][_0x6950('0x4e')];var _0x1855ba=_0x42ea3e['query'][_0x6950('0x4f')];var _0x404847=_0x42ea3e['query'][_0x6950('0x50')];var _0x52588a=_0x1855ba==='pause'||_0x1855ba===_0x6950('0x51')?!![]:![];var _0x551888=[];var _0x3db7a9;Promise['resolve']()[_0x6950('0x15')](function(){if(_0x42ea3e[_0x6950('0x4d')][_0x6950('0x52')]){_0x504dff=validateChannel(_0x42ea3e[_0x6950('0x4d')][_0x6950('0x52')]);}if(!_0x42ea3e[_0x6950('0x4d')]['sort']||!_0x42ea3e['query'][_0x6950('0x53')][_0x6950('0x49')](_0x6950('0x54'))){_0x42ea3e[_0x6950('0x4d')][_0x6950('0x53')]=rta[_0x6950('0x55')](_0x42ea3e['query'][_0x6950('0x53')]);return;}var _0x4bc1ed=rta[_0x6950('0x56')](_0x42ea3e['query'][_0x6950('0x53')]);_0x42ea3e[_0x6950('0x4d')][_0x6950('0x53')]=_0x4bc1ed[_0x6950('0x57')][_0x6950('0x58')](',');_0x1436ca=_0x4bc1ed['order'];})['then'](function(){if(!_0x1393c1){return[];}return rta[_0x6950('0x59')](_0x1393c1,_0x504dff);})['then'](function(_0x2a01e8){_0x551888=_0x2a01e8;return rta['getRealtimeAgents']();})['then'](function(_0xc9fdb6){_0xfea91b=_0xc9fdb6[_0x6950('0x5a')];if((!_0x1855ba||_0x52588a)&&!_0x1436ca){return _0x551888;}if(_0x1436ca&&!_0x1855ba){return rta['getSortedAgentsIdsByStatus'](_0xfea91b,_0x551888,_0x1436ca);}else{return rta[_0x6950('0x5b')](_0xfea91b,_0x551888,_0x1855ba);}})['then'](function(_0x1de3ae){_0x551888=_0x1de3ae;var _0x55998e=![];if(_0x551888['length']===0x0){if(_0x1393c1||_0x1855ba){_0x55998e=!![];}if(_0x52588a){_0x55998e=![];}}if(_0x55998e){return _0x30ed2b;}var _0x1b97ee=_['map'](db['User'][_0x6950('0x5c')],function(_0x4c05c1){return{'name':_0x4c05c1[_0x6950('0x5d')],'type':_0x4c05c1['type'][_0x6950('0x5e')]};});_0x42ea3e[_0x6950('0x4d')][_0x6950('0x5f')]=_0x6950('0x60');_0x42ea3e['query'][_0x6950('0x40')]=!![];_0x439b06=qs[_0x6950('0x61')](_0x1b97ee,_0x42ea3e);_0x439b06[_0x6950('0x62')]=!![];var _0x29cd1b=[];if(_0x551888['length']>0x0){_0x29cd1b[_0x6950('0x21')]({'id':{'$in':_0x551888}});if(_0x1436ca&&!_0x1855ba){_0x3db7a9=[db[_0x6950('0x63')][_0x6950('0x64')]('FIELD(id,'+_0x551888+')')];_0x439b06[_0x6950('0x65')]=_0x3db7a9;}}if(_0x52588a){_0x275ad6[_0x6950('0x66')](function(_0x22ab10){var _0x2e54b9=!![];if(_0x1855ba===_0x6950('0x51')&&_0x504dff!==_0x22ab10){_0x2e54b9=![];}_0x29cd1b[_0x6950('0x21')]({[_0x22ab10+_0x6950('0x45')]:_0x2e54b9});});if(_0x404847){_0x29cd1b[_0x6950('0x21')]({'pauseType':_0x404847});}}else if(_0x1855ba){_0x275ad6['forEach'](function(_0x49c036){_0x29cd1b[_0x6950('0x21')]({[_0x49c036+_0x6950('0x45')]:![]});});}_0x439b06['where']=_['merge'](_0x439b06[_0x6950('0x67')],{'$and':_0x29cd1b});if(_0x42ea3e[_0x6950('0x68')][_0x6950('0x5f')]==='user'){var _0x4acbec={'params':{'id':_0x42ea3e[_0x6950('0x68')][_0x6950('0x69')]},'query':{'section':_0x6950('0x6a'),'role':_0x6950('0x60'),'online':!![],'raw':!![],'ids':_0x551888,'customSorting':_0x3db7a9}};if(_0x52588a){_0x4acbec[_0x6950('0x4d')][_0x6950('0x6b')]=_0x29cd1b;}_0x4acbec[_0x6950('0x4d')]=Object[_0x6950('0x6c')](_0x4acbec[_0x6950('0x4d')],_0x42ea3e[_0x6950('0x4d')]);delete _0x4acbec[_0x6950('0x4d')]['id'];return db['UserProfile']['getResources'](_0x4acbec);}return db[_0x6950('0x43')][_0x6950('0x6d')](_0x439b06);})[_0x6950('0x15')](function(_0x2fc4a2){_0x30ed2b['count']=_0x2fc4a2[_0x6950('0xb')];_0x4b0d3e=_0x2fc4a2[_0x6950('0x5a')];return _0x4b0d3e[_0x6950('0x30')](function(_0x1e9220){var _0x3e1f1d=_[_0x6950('0x3e')](_0xfea91b,['id',_0x1e9220['id']]);if(_0x3e1f1d){var _0x276cd0=rta[_0x6950('0x6e')](_0x3e1f1d);_['merge'](_0x1e9220,_0x276cd0);}_0x1e9220[_0x6950('0x54')]=rta[_0x6950('0x6f')](_0x1e9220);if(_0x1e9220['globalStatus']['includes'](_0x6950('0x70'))){_0x275ad6[_0x6950('0x66')](function(_0x3fa7ca){if(_0x1e9220[_0x3fa7ca+_0x6950('0x45')]){_0x1e9220[_0x3fa7ca+_0x6950('0x71')]=_0x6950('0x70');}});}return _0x1e9220;});})['then'](function(_0x733445){if(!_0x1436ca||_0x3db7a9){return _0x733445;}return rta[_0x6950('0x72')](_0x733445,_0x1436ca);})[_0x6950('0x15')](function(_0x215667){_0x30ed2b[_0x6950('0x5a')]=_0x215667;return _0x30ed2b;})['then'](respondWithFilteredResult(_0x2edc5c,_0x439b06))[_0x6950('0x19')](handleError(_0x2edc5c,null));};exports[_0x6950('0x73')]=function(_0x5f457b,_0x962f72){var _0x4c9ba3={'count':0x0,'rows':[]},_0x4b2eff={},_0x1f5fae,_0x498e23,_0x59df0e,_0x1459af,_0x42268c;Promise[_0x6950('0x74')]()['then'](function(){if(_0x5f457b[_0x6950('0x4d')]['channel'])_0x1f5fae=validateChannel(_0x5f457b[_0x6950('0x4d')][_0x6950('0x52')]);var _0x45ce93=_[_0x6950('0x14')](_0x1f5fae)+'Queue';var _0x20bf06=_[_0x6950('0x30')](db[_0x45ce93][_0x6950('0x5c')],function(_0x16e757){return{'name':_0x16e757[_0x6950('0x5d')],'type':_0x16e757[_0x6950('0x75')]['key']};});_0x4b2eff=qs['getOptions'](_0x20bf06,_0x5f457b);if(_0x5f457b['user']['role']==='user'){var _0x57db5d={'params':{'id':_0x5f457b['user'][_0x6950('0x69')]},'query':{'section':_0x1f5fae===_0x6950('0x12')&&_0x5f457b[_0x6950('0x4d')][_0x6950('0x75')]===_0x6950('0x20')?_0x6950('0x76'):_[_0x6950('0x14')](_0x1f5fae)+_0x6950('0x77'),'type':_0x5f457b[_0x6950('0x4d')][_0x6950('0x75')],'nolimit':!![],'sort':_0x6950('0x48'),'filter':_0x5f457b[_0x6950('0x4d')]['filter']}};return db[_0x6950('0x78')][_0x6950('0x79')](_0x57db5d);}return db[_0x45ce93][_0x6950('0x6d')](_0x4b2eff);})['then'](function(_0x539d9f){_0x4c9ba3[_0x6950('0xb')]=_0x539d9f['count'];_0x498e23=_0x539d9f[_0x6950('0x5a')];return getRealtimeQueues(_0x5f457b,_0x1f5fae);})[_0x6950('0x15')](function(_0x2aaf2b){_0x1459af=_0x2aaf2b[_0x6950('0x5a')];return rta[_0x6950('0x7a')]();})[_0x6950('0x15')](function(_0x198bfb){_0x59df0e=_0x198bfb[_0x6950('0x5a')];if(_0x1f5fae!=_0x6950('0x12'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0x2dbe92){_0x42268c=_0x2dbe92?_0x2dbe92[_0x6950('0x5a')]:[];return initializeQueues(_0x498e23,_0x1459af,_0x1f5fae,_0x5f457b[_0x6950('0x4d')][_0x6950('0x75')]);})[_0x6950('0x15')](function(_0x24b854){var _0x33700d=_0x24b854[_0x6950('0x30')](function(_0x51e503){if(_0x1f5fae===_0x6950('0x12'))return getVoiceQueueAgents(_0x51e503,_0x498e23,_0x59df0e,_0x42268c);else return getQueueAgents(_0x51e503,_0x59df0e,_0x1f5fae);});return Promise[_0x6950('0x7b')](_0x33700d);})['then'](function(_0x4a80ba){_0x4c9ba3[_0x6950('0x5a')]=_0x4a80ba;return _0x4c9ba3;})[_0x6950('0x15')](respondWithFilteredResult(_0x962f72,_0x4b2eff))[_0x6950('0x19')](handleError(_0x962f72,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 4f6074c..4f94240 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xad0aaa,_0x4943c8){var _0x168b18=function(_0x6e6e35){while(--_0x6e6e35){_0xad0aaa['push'](_0xad0aaa['shift']());}};_0x168b18(++_0x4943c8);}(_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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x582d49,_0x450adc){var _0x59fe50=function(_0x1c5d7c){while(--_0x1c5d7c){_0x582d49['push'](_0x582d49['shift']());}};_0x59fe50(++_0x450adc);}(_0xedd9,0xfc));var _0x9edd=function(_0x563cff,_0x1ecf25){_0x563cff=_0x563cff-0x0;var _0x323d61=_0xedd9[_0x563cff];return _0x323d61;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 97396d6..254dc5e 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 _0x4b47=['sequelize','INTEGER','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b47,0x1b4));var _0x74b4=function(_0xb10104,_0x178e9d){_0xb10104=_0xb10104-0x0;var _0x3c747a=_0x4b47[_0xb10104];return _0x3c747a;};'use strict';var Sequelize=require(_0x74b4('0x0'));module['exports']={'state':{'type':Sequelize[_0x74b4('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x74b4('0x2')]},'scheduledat':{'type':Sequelize[_0x74b4('0x3')]},'uniqueid':{'type':Sequelize[_0x74b4('0x2')]},'starttime':{'type':Sequelize[_0x74b4('0x3')]},'responsetime':{'type':Sequelize[_0x74b4('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x74b4('0x2')]},'membername':{'type':Sequelize[_0x74b4('0x2')]}}; \ No newline at end of file +var _0x744c=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x744c,0xa0));var _0xc744=function(_0xdd0313,_0x251c2b){_0xdd0313=_0xdd0313-0x0;var _0x2bd7e8=_0x744c[_0xdd0313];return _0x2bd7e8;};'use strict';var Sequelize=require(_0xc744('0x0'));module[_0xc744('0x1')]={'state':{'type':Sequelize[_0xc744('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc744('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xc744('0x3')]},'starttime':{'type':Sequelize[_0xc744('0x4')]},'responsetime':{'type':Sequelize[_0xc744('0x4')]},'ringtime':{'type':Sequelize[_0xc744('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xc744('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index a6cf44e..782e264 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 _0xd7e6=['rimraf','./reportAgentPreview.attributes','define','ReportAgentPreview','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5643c9,_0x37ef1a){var _0x392b68=function(_0x3a6ec1){while(--_0x3a6ec1){_0x5643c9['push'](_0x5643c9['shift']());}};_0x392b68(++_0x37ef1a);}(_0xd7e6,0xb4));var _0x6d7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd7e6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6d7e('0x0'));var util=require('util');var logger=require(_0x6d7e('0x1'))(_0x6d7e('0x2'));var moment=require(_0x6d7e('0x3'));var BPromise=require(_0x6d7e('0x4'));var rp=require(_0x6d7e('0x5'));var fs=require('fs');var path=require(_0x6d7e('0x6'));var rimraf=require(_0x6d7e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d7e('0x8'));module['exports']=function(_0x1061d4,_0x37e89b){return _0x1061d4[_0x6d7e('0x9')](_0x6d7e('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ea=['exports','define','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','moment','request-promise','path','./reportAgentPreview.attributes'];(function(_0x4a5494,_0x3ad336){var _0x57cbb5=function(_0xa5a1ac){while(--_0xa5a1ac){_0x4a5494['push'](_0x4a5494['shift']());}};_0x57cbb5(++_0x3ad336);}(_0x46ea,0x101));var _0xa46e=function(_0x51e2b0,_0x3ca232){_0x51e2b0=_0x51e2b0-0x0;var _0x30561d=_0x46ea[_0x51e2b0];return _0x30561d;};'use strict';var _=require(_0xa46e('0x0'));var util=require('util');var logger=require(_0xa46e('0x1'))(_0xa46e('0x2'));var moment=require(_0xa46e('0x3'));var BPromise=require('bluebird');var rp=require(_0xa46e('0x4'));var fs=require('fs');var path=require(_0xa46e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa46e('0x6'));module[_0xa46e('0x7')]=function(_0x1bcc85,_0x4cacf8){return _0x1bcc85[_0xa46e('0x8')](_0xa46e('0x9'),attributes,{'tableName':_0xa46e('0xa'),'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 2ff3cbe..629b756 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 _0x75e7=['result','catch','create','body','raw','CreateReportAgentPreview','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x75e7,0x1c8));var _0x775e=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x75e7[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0x775e('0x0'));var util=require('util');var moment=require(_0x775e('0x1'));var BPromise=require(_0x775e('0x2'));var rs=require(_0x775e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x775e('0x4'));var logger=require(_0x775e('0x5'))(_0x775e('0x6'));var config=require(_0x775e('0x7'));var jayson=require(_0x775e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5c79df,_0x2c4e57,_0x5d45f2){return new BPromise(function(_0x368124,_0x5bff10){return client[_0x775e('0x9')](_0x5c79df,_0x5d45f2)['then'](function(_0x508892){logger[_0x775e('0xa')](_0x775e('0xb'),_0x2c4e57,_0x775e('0xc'));logger[_0x775e('0xd')](_0x775e('0xe'),_0x2c4e57,'request\x20sent',JSON[_0x775e('0xf')](_0x508892));if(_0x508892[_0x775e('0x10')]){if(_0x508892[_0x775e('0x10')][_0x775e('0x11')]===0x1f4){logger['error'](_0x775e('0xb'),_0x2c4e57,_0x508892[_0x775e('0x10')]['message']);return _0x5bff10(_0x508892[_0x775e('0x10')]['message']);}logger[_0x775e('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x2c4e57,_0x508892[_0x775e('0x10')][_0x775e('0x12')]);return _0x368124(_0x508892[_0x775e('0x10')][_0x775e('0x12')]);}else{logger[_0x775e('0xa')](_0x775e('0xb'),_0x2c4e57,_0x775e('0xc'));_0x368124(_0x508892[_0x775e('0x13')][_0x775e('0x12')]);}})[_0x775e('0x14')](function(_0x336f7c){logger[_0x775e('0x10')](_0x775e('0xb'),_0x2c4e57,_0x336f7c);_0x5bff10(_0x336f7c);});});}exports['CreateReportAgentPreview']=function(_0x18c71b){var _0xd921bb=this;return new Promise(function(_0x1fa4b8,_0x5afd77){return db['ReportAgentPreview'][_0x775e('0x15')](_0x18c71b[_0x775e('0x16')],{'raw':_0x18c71b['options']?_0x18c71b['options'][_0x775e('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5ab0b6){logger[_0x775e('0xa')](_0x775e('0x18'),_0x18c71b);logger[_0x775e('0xd')]('CreateReportAgentPreview',_0x18c71b,JSON[_0x775e('0xf')](_0x5ab0b6));_0x1fa4b8(_0x5ab0b6);})[_0x775e('0x14')](function(_0x415526){logger[_0x775e('0x10')](_0x775e('0x18'),_0x415526[_0x775e('0x12')],_0x18c71b);_0x5afd77(_0xd921bb[_0x775e('0x10')](0x1f4,_0x415526[_0x775e('0x12')]));});});}; \ No newline at end of file +var _0xf644=['request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ReportAgentPreview','create','body','options','CreateReportAgentPreview','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','info','ReportAgentPreview,\x20%s,\x20%s'];(function(_0x2e4268,_0xa33028){var _0x56fe9d=function(_0x67990){while(--_0x67990){_0x2e4268['push'](_0x2e4268['shift']());}};_0x56fe9d(++_0xa33028);}(_0xf644,0x194));var _0x4f64=function(_0x2ac25c,_0x307905){_0x2ac25c=_0x2ac25c-0x0;var _0x3fa92c=_0xf644[_0x2ac25c];return _0x3fa92c;};'use strict';var _=require(_0x4f64('0x0'));var util=require(_0x4f64('0x1'));var moment=require(_0x4f64('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f64('0x3'));var db=require(_0x4f64('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f64('0x5'))('rpc');var config=require(_0x4f64('0x6'));var jayson=require(_0x4f64('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc7f1d0,_0x446dbb,_0x49d01f){return new BPromise(function(_0x11e0f1,_0x36660f){return client[_0x4f64('0x8')](_0xc7f1d0,_0x49d01f)[_0x4f64('0x9')](function(_0x2e4279){logger[_0x4f64('0xa')](_0x4f64('0xb'),_0x446dbb,_0x4f64('0xc'));logger[_0x4f64('0xd')](_0x4f64('0xe'),_0x446dbb,_0x4f64('0xc'),JSON[_0x4f64('0xf')](_0x2e4279));if(_0x2e4279[_0x4f64('0x10')]){if(_0x2e4279[_0x4f64('0x10')][_0x4f64('0x11')]===0x1f4){logger[_0x4f64('0x10')](_0x4f64('0xb'),_0x446dbb,_0x2e4279[_0x4f64('0x10')][_0x4f64('0x12')]);return _0x36660f(_0x2e4279[_0x4f64('0x10')]['message']);}logger[_0x4f64('0x10')](_0x4f64('0xb'),_0x446dbb,_0x2e4279[_0x4f64('0x10')][_0x4f64('0x12')]);return _0x11e0f1(_0x2e4279[_0x4f64('0x10')][_0x4f64('0x12')]);}else{logger[_0x4f64('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x446dbb,_0x4f64('0xc'));_0x11e0f1(_0x2e4279[_0x4f64('0x13')][_0x4f64('0x12')]);}})[_0x4f64('0x14')](function(_0x17719e){logger[_0x4f64('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x446dbb,_0x17719e);_0x36660f(_0x17719e);});});}exports['CreateReportAgentPreview']=function(_0xae9cc6){var _0x1e5834=this;return new Promise(function(_0x434612,_0x325c07){return db[_0x4f64('0x15')][_0x4f64('0x16')](_0xae9cc6[_0x4f64('0x17')],{'raw':_0xae9cc6[_0x4f64('0x18')]?_0xae9cc6[_0x4f64('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4f64('0x9')](function(_0x13659a){logger[_0x4f64('0xa')](_0x4f64('0x19'),_0xae9cc6);logger['debug'](_0x4f64('0x19'),_0xae9cc6,JSON['stringify'](_0x13659a));_0x434612(_0x13659a);})[_0x4f64('0x14')](function(_0x202dca){logger[_0x4f64('0x10')](_0x4f64('0x19'),_0x202dca[_0x4f64('0x12')],_0xae9cc6);_0x325c07(_0x1e5834['error'](0x1f4,_0x202dca[_0x4f64('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 5e498d6..01fc561 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 _0xc326=['/outbound/channels','outboundChannels','agents','/agents/:id/capacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound'];(function(_0x5d63d9,_0x5aa58d){var _0x580c02=function(_0x1c95ec){while(--_0x1c95ec){_0x5d63d9['push'](_0x5d63d9['shift']());}};_0x580c02(++_0x5aa58d);}(_0xc326,0xdf));var _0x6c32=function(_0x5e5deb,_0x21867a){_0x5e5deb=_0x5e5deb-0x0;var _0x3556e0=_0xc326[_0x5e5deb];return _0x3556e0;};'use strict';var multer=require(_0x6c32('0x0'));var util=require(_0x6c32('0x1'));var path=require(_0x6c32('0x2'));var express=require(_0x6c32('0x3'));var router=express[_0x6c32('0x4')]();var auth=require(_0x6c32('0x5'));var controller=require('./rpc.controller');router[_0x6c32('0x6')](_0x6c32('0x7'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x9')]);router['get'](_0x6c32('0xa'),auth[_0x6c32('0x8')](),controller[_0x6c32('0xb')]);router[_0x6c32('0x6')](_0x6c32('0xc'),auth[_0x6c32('0x8')](),controller[_0x6c32('0xd')]);router[_0x6c32('0x6')](_0x6c32('0xe'),auth[_0x6c32('0x8')](),controller[_0x6c32('0xf')]);router['get'](_0x6c32('0x10'),auth[_0x6c32('0x8')](),controller['chatQueues']);router[_0x6c32('0x6')](_0x6c32('0x11'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x12')]);router[_0x6c32('0x6')](_0x6c32('0x13'),auth[_0x6c32('0x8')](),controller['mailAccounts']);router[_0x6c32('0x6')](_0x6c32('0x14'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x15')]);router[_0x6c32('0x6')](_0x6c32('0x16'),auth['isAuthenticated'](),controller[_0x6c32('0x17')]);router[_0x6c32('0x6')]('/whatsapp/queues',auth['isAuthenticated'](),controller[_0x6c32('0x18')]);router[_0x6c32('0x6')](_0x6c32('0x19'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x1a')]);router[_0x6c32('0x6')](_0x6c32('0x1b'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x1c')]);router[_0x6c32('0x6')](_0x6c32('0x1d'),auth['isAuthenticated'](),controller[_0x6c32('0x1e')]);router[_0x6c32('0x6')](_0x6c32('0x1f'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x20')]);router[_0x6c32('0x6')](_0x6c32('0x21'),auth[_0x6c32('0x8')](),controller['voiceQueuesChannelHangup']);router['get'](_0x6c32('0x22'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x23')]);router[_0x6c32('0x6')](_0x6c32('0x24'),auth['isAuthenticated'](),controller[_0x6c32('0x25')]);router[_0x6c32('0x26')](_0x6c32('0x24'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x27')]);router[_0x6c32('0x6')]('/outbound',auth[_0x6c32('0x8')](),controller[_0x6c32('0x28')]);router['get'](_0x6c32('0x29'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x2a')]);router[_0x6c32('0x6')]('/agents',auth[_0x6c32('0x8')](),controller[_0x6c32('0x2b')]);router[_0x6c32('0x26')](_0x6c32('0x2c'),auth[_0x6c32('0x8')](),controller['agentCapacity']);router[_0x6c32('0x6')]('/telephones',auth[_0x6c32('0x8')](),controller[_0x6c32('0x2d')]);router[_0x6c32('0x6')](_0x6c32('0x2e'),auth['isAuthenticated'](),controller[_0x6c32('0x2f')]);router['get'](_0x6c32('0x30'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x31')]);router[_0x6c32('0x6')](_0x6c32('0x32'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x33')]);router['get']('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x6c32('0x34')]);router[_0x6c32('0x6')](_0x6c32('0x35'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x36')]);router[_0x6c32('0x6')](_0x6c32('0x37'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x38')]);router[_0x6c32('0x6')](_0x6c32('0x39'),auth[_0x6c32('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x6c32('0x6')](_0x6c32('0x3a'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x3b')]);router[_0x6c32('0x6')](_0x6c32('0x3c'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router[_0x6c32('0x6')](_0x6c32('0x3d'),auth[_0x6c32('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x6c32('0x3e')](_0x6c32('0x3f'),auth['isAuthenticated'](),controller[_0x6c32('0x40')](_0x6c32('0x41')));router[_0x6c32('0x6')](_0x6c32('0x42'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x43')]);router[_0x6c32('0x3e')](_0x6c32('0x44'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x40')](_0x6c32('0x45')));router[_0x6c32('0x6')](_0x6c32('0x46'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x47')]);router[_0x6c32('0x3e')](_0x6c32('0x48'),auth['isAuthenticated'](),controller[_0x6c32('0x40')](_0x6c32('0x49')));router[_0x6c32('0x6')](_0x6c32('0x4a'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x4b')]);router[_0x6c32('0x3e')](_0x6c32('0x4c'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x40')](_0x6c32('0x4d')));router[_0x6c32('0x6')](_0x6c32('0x4e'),auth[_0x6c32('0x8')](),controller[_0x6c32('0x4f')]);router[_0x6c32('0x3e')](_0x6c32('0x50'),auth['isAuthenticated'](),controller[_0x6c32('0x40')](_0x6c32('0x51')));router[_0x6c32('0x3e')](_0x6c32('0x52'),auth['isAuthenticated'](),controller[_0x6c32('0x40')](_0x6c32('0x53')));router[_0x6c32('0x6')]('/sms/queues/:id',auth[_0x6c32('0x8')](),controller['showSmsQueues']);router['get'](_0x6c32('0x54'),auth['isAuthenticated'](),controller[_0x6c32('0x55')]);router[_0x6c32('0x3e')]('/agents/:id/notify',auth[_0x6c32('0x8')](),controller[_0x6c32('0x56')]);module[_0x6c32('0x57')]=router; \ No newline at end of file +var _0x12a1=['voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','agents','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/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','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','/sms/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels'];(function(_0x3f0b45,_0x5311eb){var _0x49eba1=function(_0x20c0d1){while(--_0x20c0d1){_0x3f0b45['push'](_0x3f0b45['shift']());}};_0x49eba1(++_0x5311eb);}(_0x12a1,0xd3));var _0x112a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12a1[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x112a('0x0'));var path=require('path');var express=require(_0x112a('0x1'));var router=express[_0x112a('0x2')]();var auth=require(_0x112a('0x3'));var controller=require(_0x112a('0x4'));router[_0x112a('0x5')](_0x112a('0x6'),auth['isAuthenticated'](),controller['voiceChannels']);router['get'](_0x112a('0x7'),auth[_0x112a('0x8')](),controller['voiceChannelMixMonitor']);router[_0x112a('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x112a('0x5')](_0x112a('0x9'),auth[_0x112a('0x8')](),controller[_0x112a('0xa')]);router[_0x112a('0x5')](_0x112a('0xb'),auth['isAuthenticated'](),controller['chatQueues']);router[_0x112a('0x5')](_0x112a('0xc'),auth['isAuthenticated'](),controller[_0x112a('0xd')]);router[_0x112a('0x5')]('/mail/accounts',auth[_0x112a('0x8')](),controller[_0x112a('0xe')]);router[_0x112a('0x5')](_0x112a('0xf'),auth[_0x112a('0x8')](),controller['openchannelQueues']);router[_0x112a('0x5')](_0x112a('0x10'),auth[_0x112a('0x8')](),controller['smsQueues']);router[_0x112a('0x5')]('/whatsapp/queues',auth[_0x112a('0x8')](),controller[_0x112a('0x11')]);router[_0x112a('0x5')](_0x112a('0x12'),auth[_0x112a('0x8')](),controller[_0x112a('0x13')]);router[_0x112a('0x5')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x112a('0x14')]);router['get'](_0x112a('0x15'),auth[_0x112a('0x8')](),controller[_0x112a('0x16')]);router[_0x112a('0x5')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x112a('0x17')]);router[_0x112a('0x5')](_0x112a('0x18'),auth['isAuthenticated'](),controller[_0x112a('0x19')]);router['get'](_0x112a('0x1a'),auth[_0x112a('0x8')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x112a('0x1b'),auth[_0x112a('0x8')](),controller[_0x112a('0x1c')]);router[_0x112a('0x1d')](_0x112a('0x1b'),auth[_0x112a('0x8')](),controller[_0x112a('0x1e')]);router[_0x112a('0x5')](_0x112a('0x1f'),auth['isAuthenticated'](),controller['outbound']);router['get'](_0x112a('0x20'),auth[_0x112a('0x8')](),controller[_0x112a('0x21')]);router['get']('/agents',auth[_0x112a('0x8')](),controller[_0x112a('0x22')]);router[_0x112a('0x1d')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x112a('0x23')]);router['get'](_0x112a('0x24'),auth[_0x112a('0x8')](),controller['telephones']);router[_0x112a('0x5')](_0x112a('0x25'),auth[_0x112a('0x8')](),controller[_0x112a('0x26')]);router[_0x112a('0x5')](_0x112a('0x27'),auth['isAuthenticated'](),controller[_0x112a('0x28')]);router['get'](_0x112a('0x29'),auth[_0x112a('0x8')](),controller[_0x112a('0x2a')]);router[_0x112a('0x5')](_0x112a('0x2b'),auth['isAuthenticated'](),controller[_0x112a('0x2c')]);router['get'](_0x112a('0x2d'),auth[_0x112a('0x8')](),controller[_0x112a('0x2e')]);router[_0x112a('0x5')](_0x112a('0x2f'),auth['isAuthenticated'](),controller[_0x112a('0x30')]);router[_0x112a('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0x112a('0x8')](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x112a('0x31'),auth['isAuthenticated'](),controller[_0x112a('0x32')]);router[_0x112a('0x5')](_0x112a('0x33'),auth[_0x112a('0x8')](),controller[_0x112a('0x34')]);router[_0x112a('0x5')](_0x112a('0x35'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x112a('0x36')](_0x112a('0x37'),auth[_0x112a('0x8')](),controller[_0x112a('0x38')](_0x112a('0x39')));router['get'](_0x112a('0x3a'),auth[_0x112a('0x8')](),controller[_0x112a('0x3b')]);router['post'](_0x112a('0x3c'),auth[_0x112a('0x8')](),controller['queueNotify'](_0x112a('0x3d')));router[_0x112a('0x5')](_0x112a('0x3e'),auth[_0x112a('0x8')](),controller['showChatQueues']);router[_0x112a('0x36')](_0x112a('0x3f'),auth['isAuthenticated'](),controller[_0x112a('0x38')](_0x112a('0x40')));router['get'](_0x112a('0x41'),auth['isAuthenticated'](),controller[_0x112a('0x42')]);router[_0x112a('0x36')]('/openchannel/queues/:id/notify',auth[_0x112a('0x8')](),controller[_0x112a('0x38')]('openchannel'));router['get'](_0x112a('0x43'),auth[_0x112a('0x8')](),controller[_0x112a('0x44')]);router[_0x112a('0x36')]('/sms/queues/:id/notify',auth[_0x112a('0x8')](),controller[_0x112a('0x38')](_0x112a('0x45')));router[_0x112a('0x36')](_0x112a('0x46'),auth['isAuthenticated'](),controller[_0x112a('0x38')](_0x112a('0x47')));router[_0x112a('0x5')](_0x112a('0x48'),auth[_0x112a('0x8')](),controller['showSmsQueues']);router[_0x112a('0x5')](_0x112a('0x49'),auth['isAuthenticated'](),controller[_0x112a('0x4a')]);router[_0x112a('0x36')](_0x112a('0x4b'),auth[_0x112a('0x8')](),controller[_0x112a('0x4c')]);module[_0x112a('0x4d')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 1f86199..85ab137 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 _0x5fc3=['openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','value','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','code','message','result','catch','status','json','sendStatus','name','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','format','length','updateAttributes','MemberReport','findOrCreate','INTERACTION','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','capacity','telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions'];(function(_0xff8a3,_0x15e756){var _0x178234=function(_0x29c5be){while(--_0x29c5be){_0xff8a3['push'](_0xff8a3['shift']());}};_0x178234(++_0x15e756);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x5fc3[_0x2b5b44];return _0x32cb66;};'use strict';var BPromise=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var _=require('lodash');var util=require(_0x35fc('0x2'));var db=require(_0x35fc('0x3'))['db'];var logger=require(_0x35fc('0x4'))(_0x35fc('0x5'));var jayson=require(_0x35fc('0x6'));var amiClient=jayson['client'][_0x35fc('0x7')]({'port':0x232a});var mailClient=jayson[_0x35fc('0x8')][_0x35fc('0x7')]({'port':0x232b});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){var _0x1e5f90=_0x16e153?_0x16e153:amiClient;return _0x1e5f90[_0x35fc('0x9')](_0x19a0d1,_0x508b32)[_0x35fc('0xa')](function(_0x2051ab){if(_0x2051ab['error']){if(_0x2051ab[_0x35fc('0xb')][_0x35fc('0xc')]===0x1f4){return _0xc72d93(_0x2051ab['error'][_0x35fc('0xd')]);}return _0x27524f(_0x2051ab[_0x35fc('0xb')]['message']);}else{_0x27524f(_0x2051ab[_0x35fc('0xe')]);}})[_0x35fc('0xf')](function(_0x5469f5){_0xc72d93(_0x5469f5);});});}function respondWithResult(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xc8;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x10')](_0x409357)[_0x35fc('0x11')](_0x5d462a);}return _0x4cbe74[_0x35fc('0x12')](0x194);};}function handleError(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0x1f4;return function(_0x5cfe94){logger['error'](_0x5cfe94['stack']);if(_0x5cfe94['name']){delete _0x5cfe94[_0x35fc('0x13')];}_0x29730f[_0x35fc('0x10')](_0x38d9f2)[_0x35fc('0x14')](_0x5cfe94);};}function findById(_0x154958){return function(_0x227a49){if(!_[_0x35fc('0x15')](_0x154958)&&!_['isNil'](_0x227a49)&&!_[_0x35fc('0x15')](_0x227a49[_0x35fc('0x16')])){return _['find'](_0x227a49[_0x35fc('0x16')],function(_0x363e47){return _0x363e47['id']==_0x154958;});}return null;};}exports[_0x35fc('0x17')]=function(_0x5f56c6,_0x1a86e9){return respondWithRpcPromise(_0x35fc('0x18'),_0x5f56c6[_0x35fc('0x19')])['then'](respondWithResult(_0x1a86e9,null))[_0x35fc('0xf')](handleError(_0x1a86e9,null));};exports[_0x35fc('0x1a')]=function(_0x3229d1,_0x251a1f){return respondWithRpcPromise(_0x35fc('0x1b'),_[_0x35fc('0x1c')](_0x3229d1[_0x35fc('0x19')],_0x3229d1[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x251a1f,null))[_0x35fc('0xf')](handleError(_0x251a1f,null));};exports['voiceChannelStopMixMonitor']=function(_0x323aee,_0xd5399f){return respondWithRpcPromise(_0x35fc('0x1e'),_[_0x35fc('0x1c')](_0x323aee[_0x35fc('0x19')],_0x323aee['params']))[_0x35fc('0xa')](respondWithResult(_0xd5399f,null))[_0x35fc('0xf')](handleError(_0xd5399f,null));};exports['voiceQueues']=function(_0x265324,_0x5a93df){return respondWithRpcPromise(_0x35fc('0x1f'),_0x265324['query'])[_0x35fc('0xa')](respondWithResult(_0x5a93df,null))['catch'](handleError(_0x5a93df,null));};exports[_0x35fc('0x20')]=function(_0xdfab9f,_0x5cb986){return respondWithRpcPromise('VoiceQueues',_0xdfab9f[_0x35fc('0x19')])['then'](findById(_0xdfab9f[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x5cb986,null))['catch'](handleError(_0x5cb986,null));};exports[_0x35fc('0x21')]=function(_0x645eac,_0x383837){return respondWithRpcPromise(_0x35fc('0x22'),_[_0x35fc('0x1c')](_0x645eac[_0x35fc('0x23')],_0x645eac[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x383837,null))['catch'](handleError(_0x383837,null));};exports[_0x35fc('0x24')]=function(_0x220931,_0x22af18){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x35fc('0x1c')](_0x220931[_0x35fc('0x19')],_0x220931[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x22af18,null))[_0x35fc('0xf')](handleError(_0x22af18,null));};exports[_0x35fc('0x25')]=function(_0x222ddb,_0x37b435){return respondWithRpcPromise(_0x35fc('0x26'),_0x222ddb[_0x35fc('0x19')])['then'](respondWithResult(_0x37b435,null))['catch'](handleError(_0x37b435,null));};exports[_0x35fc('0x27')]=function(_0x4af5fe,_0x37b394){return respondWithRpcPromise(_0x35fc('0x28'),_[_0x35fc('0x1c')](_0x4af5fe[_0x35fc('0x19')],_0x4af5fe[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x37b394,null))['catch'](handleError(_0x37b394,null));};exports[_0x35fc('0x29')]=function(_0x330a14,_0x46b9ef){return respondWithRpcPromise(_0x35fc('0x2a'),_[_0x35fc('0x1c')](_0x330a14[_0x35fc('0x19')],_0x330a14['params']))[_0x35fc('0xa')](respondWithResult(_0x46b9ef,null))[_0x35fc('0xf')](handleError(_0x46b9ef,null));};exports[_0x35fc('0x2b')]=function(_0x52f53d,_0x2c657d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x35fc('0x1c')](_0x52f53d[_0x35fc('0x19')],_0x52f53d[_0x35fc('0x1d')]))[_0x35fc('0xa')](respondWithResult(_0x2c657d,null))['catch'](handleError(_0x2c657d,null));};exports['outbound']=function(_0x59e4fb,_0x20f5fe){return respondWithRpcPromise('Outbound',_0x59e4fb[_0x35fc('0x19')])['then'](respondWithResult(_0x20f5fe,null))[_0x35fc('0xf')](handleError(_0x20f5fe,null));};exports[_0x35fc('0x2c')]=function(_0x2ca9ac,_0x22b724){return respondWithRpcPromise(_0x35fc('0x2d'),_0x2ca9ac[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x22b724,null))['catch'](handleError(_0x22b724,null));};exports[_0x35fc('0x2e')]=function(_0x16087d,_0x4e0ce3){var _0x1feda5;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d[_0x35fc('0x19')])[_0x35fc('0xa')](function(_0x813866){_0x1feda5=_0x813866;return respondWithRpcPromise(_0x35fc('0x2f'),_0x16087d['query'],routingClient);})[_0x35fc('0xa')](function(_0x267858){return _[_0x35fc('0x1c')]({},_0x267858,_0x1feda5);})['then'](respondWithResult(_0x4e0ce3,null))[_0x35fc('0xf')](handleError(_0x4e0ce3,null));};exports[_0x35fc('0x30')]=function(_0x596919,_0x237548){if(_0x596919[_0x35fc('0x23')]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]&&_0x596919[_0x35fc('0x32')]&&_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]){for(var _0x3ec51f in _0x596919['body']['interaction']){if(_0x596919[_0x35fc('0x23')][_0x35fc('0x31')]['hasOwnProperty'](_0x3ec51f)){db['MemberReport']['findAll']({'where':{'channel':_0x3ec51f,'membername':_0x596919[_0x35fc('0x32')][_0x35fc('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]&&_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length']?{'$notIn':_0x596919['body']['interaction'][_0x3ec51f]}:{'$ne':null}}})['then'](function(_0x56bdb9){var _0xb26e3f=moment()[_0x35fc('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x119925=0x0,_0x56cf1f=_0x56bdb9[_0x35fc('0x34')];_0x119925<_0x56cf1f;_0x119925+=0x1){_0x56bdb9[_0x119925][_0x35fc('0x35')]({'exitAt':_0xb26e3f});}});for(var _0x350237=0x0;_0x350237<_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f]['length'];_0x350237+=0x1){db[_0x35fc('0x36')][_0x35fc('0x37')]({'where':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'type':_0x35fc('0x38'),'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237],'exitAt':null},'defaults':{'channel':_0x3ec51f,'membername':_0x596919['user'][_0x35fc('0x13')],'interface':_['isNil'](_0x596919['user'][_0x35fc('0x39')])?util[_0x35fc('0x33')](_0x35fc('0x3a'),_0x596919[_0x35fc('0x32')][_0x35fc('0x13')]):_0x596919[_0x35fc('0x32')][_0x35fc('0x39')],'type':_0x35fc('0x38'),'enterAt':moment()['format'](_0x35fc('0x3b')),'role':_0x35fc('0x3c'),'internal':_0x596919[_0x35fc('0x32')][_0x35fc('0x3d')],'uniqueid':_0x596919[_0x35fc('0x23')][_0x35fc('0x31')][_0x3ec51f][_0x350237]}});}}}}return respondWithRpcPromise(_0x35fc('0x3e'),{'id':_0x596919[_0x35fc('0x1d')]['id'],'capacity':_0x596919[_0x35fc('0x23')][_0x35fc('0x3f')]},routingClient)[_0x35fc('0xa')](respondWithResult(_0x237548,null))[_0x35fc('0xf')](handleError(_0x237548,null));};exports[_0x35fc('0x40')]=function(_0x3146e2,_0x59c666){return respondWithRpcPromise('Telephones',_0x3146e2[_0x35fc('0x19')])[_0x35fc('0xa')](respondWithResult(_0x59c666,null))[_0x35fc('0xf')](handleError(_0x59c666,null));};exports[_0x35fc('0x41')]=function(_0x3ee296,_0x3e6494){return respondWithRpcPromise('Trunks',_0x3ee296['query'])[_0x35fc('0xa')](respondWithResult(_0x3e6494,null))[_0x35fc('0xf')](handleError(_0x3e6494,null));};exports[_0x35fc('0x42')]=function(_0x38bc78,_0x5b2595){return respondWithRpcPromise(_0x35fc('0x43'),_0x38bc78[_0x35fc('0x19')])['then'](respondWithResult(_0x5b2595,null))[_0x35fc('0xf')](handleError(_0x5b2595,null));};exports[_0x35fc('0x44')]=function(_0x590faa,_0x3e12e4){return respondWithRpcPromise(_0x35fc('0x45'),_0x590faa[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x3e12e4,null))['catch'](handleError(_0x3e12e4,null));};exports['showChatQueues']=function(_0x502a15,_0x240338){return respondWithRpcPromise(_0x35fc('0x45'),_0x502a15['query'],routingClient)[_0x35fc('0xa')](findById(_0x502a15[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x240338,null))[_0x35fc('0xf')](handleError(_0x240338,null));};exports[_0x35fc('0x46')]=function(_0x538be0,_0x2d9d45){return respondWithRpcPromise(_0x35fc('0x47'),_0x538be0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x2d9d45,null))[_0x35fc('0xf')](handleError(_0x2d9d45,null));};exports[_0x35fc('0x48')]=function(_0x47fb1a,_0x35a676){return respondWithRpcPromise(_0x35fc('0x47'),_0x47fb1a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x47fb1a[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x35a676,null))[_0x35fc('0xf')](handleError(_0x35a676,null));};exports[_0x35fc('0x49')]=function(_0x53a79d,_0x10a5b8){return respondWithRpcPromise(_0x35fc('0x4a'),_0x53a79d[_0x35fc('0x19')],mailClient)['then'](respondWithResult(_0x10a5b8,null))[_0x35fc('0xf')](handleError(_0x10a5b8,null));};exports['openchannelQueues']=function(_0x4ceacc,_0x5d4a39){return respondWithRpcPromise(_0x35fc('0x4b'),_0x4ceacc[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x5d4a39,null))[_0x35fc('0xf')](handleError(_0x5d4a39,null));};exports[_0x35fc('0x4c')]=function(_0x4bbea0,_0x579f5a){return respondWithRpcPromise('OpenchannelQueues',_0x4bbea0['query'],routingClient)['then'](findById(_0x4bbea0[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x579f5a,null))[_0x35fc('0xf')](handleError(_0x579f5a,null));};exports[_0x35fc('0x4d')]=function(_0x511e8b,_0x458eb8){return respondWithRpcPromise(_0x35fc('0x4e'),_0x511e8b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x458eb8,null))[_0x35fc('0xf')](handleError(_0x458eb8,null));};exports[_0x35fc('0x4f')]=function(_0x27071b,_0x2127e0){return respondWithRpcPromise(_0x35fc('0x4e'),_0x27071b['query'],routingClient)[_0x35fc('0xa')](findById(_0x27071b['params']['id']))[_0x35fc('0xa')](respondWithResult(_0x2127e0,null))[_0x35fc('0xf')](handleError(_0x2127e0,null));};exports[_0x35fc('0x50')]=function(_0x2bc76c,_0x4bdde7){return respondWithRpcPromise(_0x35fc('0x51'),_0x2bc76c['query'],routingClient)['then'](respondWithResult(_0x4bdde7,null))['catch'](handleError(_0x4bdde7,null));};exports[_0x35fc('0x52')]=function(_0x5dfeb7,_0x3c9027){return respondWithRpcPromise('WhatsappQueues',_0x5dfeb7[_0x35fc('0x19')],routingClient)['then'](findById(_0x5dfeb7[_0x35fc('0x1d')]['id']))[_0x35fc('0xa')](respondWithResult(_0x3c9027,null))[_0x35fc('0xf')](handleError(_0x3c9027,null));};exports[_0x35fc('0x53')]=function(_0x5c2ec0,_0x3d0ecc){return respondWithRpcPromise(_0x35fc('0x54'),_0x5c2ec0[_0x35fc('0x19')],routingClient)['then'](respondWithResult(_0x3d0ecc,null))[_0x35fc('0xf')](handleError(_0x3d0ecc,null));};exports[_0x35fc('0x55')]=function(_0x37764b,_0x3c1b56){return respondWithRpcPromise(_0x35fc('0x54'),_0x37764b[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](findById(_0x37764b[_0x35fc('0x1d')]['id']))['then'](respondWithResult(_0x3c1b56,null))[_0x35fc('0xf')](handleError(_0x3c1b56,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d){return respondWithRpcPromise(_0x35fc('0x57'),_0x2600d2[_0x35fc('0x19')])['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports[_0x35fc('0x58')]=function(_0x4835c2,_0x223ad3){return respondWithRpcPromise(_0x35fc('0x59'),_0x4835c2[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x223ad3,null))[_0x35fc('0xf')](handleError(_0x223ad3,null));};exports[_0x35fc('0x5a')]=function(_0x13f602,_0x104b1d){return respondWithRpcPromise(_0x35fc('0x5b'),_0x13f602[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x104b1d,null))[_0x35fc('0xf')](handleError(_0x104b1d,null));};exports[_0x35fc('0x5c')]=function(_0x9f034e,_0x184f28){return respondWithRpcPromise(_0x35fc('0x5d'),_0x9f034e[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x184f28,null))[_0x35fc('0xf')](handleError(_0x184f28,null));};exports[_0x35fc('0x5e')]=function(_0x4ba1b0,_0x1797d0){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ba1b0[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](function(_0x2185ce){if(_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')]!==undefined){var _0x3f56f4=_(_0x2185ce[_0x35fc('0x16')])[_0x35fc('0x60')]([_0x4ba1b0[_0x35fc('0x19')][_0x35fc('0x5f')],_0x4ba1b0[_0x35fc('0x1d')]['id']])['map'](_0x35fc('0x61'))[_0x35fc('0x62')]()[_0x35fc('0x63')]();return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x41a6de){return _0x3f56f4['indexOf'](_0x41a6de[_0x35fc('0x61')])>-0x1;});}else{return _0x2185ce[_0x35fc('0x16')][_0x35fc('0x60')](function(_0x23206d){return _0x23206d[_0x35fc('0x61')]===parseInt(_0x4ba1b0[_0x35fc('0x1d')]['id']);});}})[_0x35fc('0xa')](respondWithResult(_0x1797d0,null))[_0x35fc('0xf')](handleError(_0x1797d0,null));};exports[_0x35fc('0x64')]=function(_0x5f23d8,_0x28f02b){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x5f23d8[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0x28f02b,null))['catch'](handleError(_0x28f02b,null));};exports[_0x35fc('0x65')]=function(_0x41002a,_0xcaa49){return respondWithRpcPromise(_0x35fc('0x66'),_0x41002a[_0x35fc('0x19')],routingClient)[_0x35fc('0xa')](respondWithResult(_0xcaa49,null))[_0x35fc('0xf')](handleError(_0xcaa49,null));};exports[_0x35fc('0x67')]=function(_0x25ee61,_0x5806bf){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x25ee61['query'],routingClient)['then'](respondWithResult(_0x5806bf,null))[_0x35fc('0xf')](handleError(_0x5806bf,null));};exports[_0x35fc('0x68')]=function(_0x8fc410){return function(_0x1f5cbc,_0x35ef53){var _0x4f535a,_0x226fdf;var _0x19682e=_[_0x35fc('0x69')](_0x8fc410);var _0x169ea2=_0x8fc410==='chat'?_0x35fc('0x6a'):_0x35fc('0x6b');return db[_0x19682e+_0x35fc('0x6c')]['findOne']({'raw':!![],'where':{'id':_0x1f5cbc[_0x35fc('0x1d')]['id']}})[_0x35fc('0xa')](function(_0x319033){if(_[_0x35fc('0x15')](_0x319033)){throw new Error(_0x19682e+_0x35fc('0x6d'));}_0x4f535a=_0x319033;return db[_0x19682e+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x1f5cbc[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x19682e+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x19682e+_0x169ea2],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x221c5b){if(_[_0x35fc('0x15')](_0x221c5b)){throw new Error(_0x19682e+'\x20Message\x20not\x20found');}_0x226fdf=_0x221c5b;return _0x221c5b[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x4855ee={'uniqueid':_0x8fc410+'.'+_0x226fdf['id']+'.'+_0x226fdf[_0x35fc('0x70')]['id'],'FromUserId':_0x1f5cbc['user']['id'],'type':_0x35fc('0x72')};_0x4855ee[_0x19682e+_0x35fc('0x73')]=_0x226fdf['id'];_0x4855ee[_0x19682e+_0x35fc('0x74')]=_0x226fdf['Interaction']['id'];_0x4855ee[_0x35fc('0x75')+_0x19682e+_0x169ea2+'Id']=_0x226fdf[_0x35fc('0x6b')]['id'];_0x4855ee['To'+_0x19682e+_0x35fc('0x76')]=_0x4f535a['id'];return db[_0x19682e+_0x35fc('0x77')][_0x35fc('0x78')](_0x4855ee);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x8fc410,'interaction':_0x226fdf['Interaction'],'message':_0x226fdf,'account':_0x226fdf[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x4f535a[_0x35fc('0x13')]+','+(_0x226fdf[_0x35fc('0x6b')][_0x35fc('0x79')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})['then'](respondWithResult(_0x35ef53,null))[_0x35fc('0xf')](handleError(_0x35ef53,null));};};exports[_0x35fc('0x7b')]=function(_0x312827,_0x47c507){var _0x128286,_0x175cc7;if(_[_0x35fc('0x15')](_0x312827['body']['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x32b9e1=_0x312827[_0x35fc('0x23')][_0x35fc('0x7c')];var _0x3858a9=_['capitalize'](_0x32b9e1);var _0x3ead4e=_0x32b9e1===_0x35fc('0x7d')?'Website':'Account';return db[_0x35fc('0x7e')][_0x35fc('0x6f')]({'raw':!![],'where':{'id':_0x312827[_0x35fc('0x1d')]['id'],'role':'agent'}})['then'](function(_0x134e60){if(_[_0x35fc('0x15')](_0x134e60)){throw new Error('Agent\x20not\x20found');}_0x128286=_0x134e60;return db[_0x3858a9+_0x35fc('0x6e')][_0x35fc('0x6f')]({'where':{'id':_0x312827[_0x35fc('0x23')]['messageId']},'include':[{'model':db[_0x3858a9+_0x35fc('0x70')],'as':_0x35fc('0x70')},{'model':db[_0x3858a9+_0x3ead4e],'as':_0x35fc('0x6b')}]});})[_0x35fc('0xa')](function(_0x4fd676){if(_[_0x35fc('0x15')](_0x4fd676)){throw new Error(_0x3858a9+_0x35fc('0x7f'));}_0x175cc7=_0x4fd676;return _0x4fd676[_0x35fc('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x96dfc={'uniqueid':_0x32b9e1+'.'+_0x175cc7['id']+'.'+_0x175cc7[_0x35fc('0x70')]['id'],'FromUserId':_0x312827[_0x35fc('0x32')]['id'],'type':'queue','ToUserId':_0x128286['id']};_0x96dfc[_0x3858a9+_0x35fc('0x73')]=_0x175cc7['id'];_0x96dfc[_0x3858a9+_0x35fc('0x74')]=_0x175cc7['Interaction']['id'];_0x96dfc[_0x35fc('0x75')+_0x3858a9+_0x3ead4e+'Id']=_0x175cc7[_0x35fc('0x6b')]['id'];return db[_0x3858a9+_0x35fc('0x77')][_0x35fc('0x78')](_0x96dfc);})[_0x35fc('0xa')](function(){return respondWithRpcPromise(_0x35fc('0x80'),{'channel':_0x32b9e1,'interaction':_0x175cc7[_0x35fc('0x70')],'message':_0x175cc7,'account':_0x175cc7[_0x35fc('0x6b')],'applications':[{'id':0x0,'priority':0x1,'app':_0x35fc('0x3c'),'appdata':_0x128286['name']+','+(_0x175cc7[_0x35fc('0x6b')][_0x35fc('0x81')]||0x12c),'interval':_0x35fc('0x7a')}]},routingClient);})[_0x35fc('0xa')](respondWithResult(_0x47c507,null))['catch'](handleError(_0x47c507,null));}; \ No newline at end of file +var _0x2675=['request','error','result','catch','status','json','sendStatus','name','send','isNil','rows','find','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','then','voiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','updateVoiceQueue','body','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','merge','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format','MemberReport','findOrCreate','interface','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','showOpenchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','filter','type','map','queue_id','indexOf','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Agent\x20not\x20found','Message','findOne','agentTransferTimeout','bluebird','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x8a0d94,_0x16fcee){var _0x48f382=function(_0x46ab83){while(--_0x46ab83){_0x8a0d94['push'](_0x8a0d94['shift']());}};_0x48f382(++_0x16fcee);}(_0x2675,0x75));var _0x5267=function(_0x4a61d4,_0x4827b1){_0x4a61d4=_0x4a61d4-0x0;var _0x316ec0=_0x2675[_0x4a61d4];return _0x316ec0;};'use strict';var BPromise=require(_0x5267('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var db=require(_0x5267('0x1'))['db'];var logger=require(_0x5267('0x2'))('api');var jayson=require(_0x5267('0x3'));var amiClient=jayson[_0x5267('0x4')]['http']({'port':0x232a});var mailClient=jayson[_0x5267('0x4')][_0x5267('0x5')]({'port':0x232b});var routingClient=jayson[_0x5267('0x4')][_0x5267('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){var _0x506fd7=_0x527c16?_0x527c16:amiClient;return _0x506fd7[_0x5267('0x6')](_0x20f065,_0xc56cd5)['then'](function(_0x3ff4e9){if(_0x3ff4e9[_0x5267('0x7')]){if(_0x3ff4e9[_0x5267('0x7')]['code']===0x1f4){return _0x46bfdf(_0x3ff4e9[_0x5267('0x7')]['message']);}return _0x9e0a27(_0x3ff4e9[_0x5267('0x7')]['message']);}else{_0x9e0a27(_0x3ff4e9[_0x5267('0x8')]);}})[_0x5267('0x9')](function(_0x268a8a){_0x46bfdf(_0x268a8a);});});}function respondWithResult(_0x1f9be3,_0x1d7090){_0x1d7090=_0x1d7090||0xc8;return function(_0x1171b9){if(_0x1171b9){return _0x1f9be3[_0x5267('0xa')](_0x1d7090)[_0x5267('0xb')](_0x1171b9);}return _0x1f9be3[_0x5267('0xc')](0x194);};}function handleError(_0x1e2d3b,_0x16e5a7){_0x16e5a7=_0x16e5a7||0x1f4;return function(_0x29349a){logger[_0x5267('0x7')](_0x29349a['stack']);if(_0x29349a['name']){delete _0x29349a[_0x5267('0xd')];}_0x1e2d3b[_0x5267('0xa')](_0x16e5a7)[_0x5267('0xe')](_0x29349a);};}function findById(_0x3f5344){return function(_0x46b2c2){if(!_[_0x5267('0xf')](_0x3f5344)&&!_[_0x5267('0xf')](_0x46b2c2)&&!_[_0x5267('0xf')](_0x46b2c2[_0x5267('0x10')])){return _[_0x5267('0x11')](_0x46b2c2[_0x5267('0x10')],function(_0x1ab03){return _0x1ab03['id']==_0x3f5344;});}return null;};}exports['voiceChannels']=function(_0x18f32e,_0x2afd38){return respondWithRpcPromise('VoiceChannels',_0x18f32e[_0x5267('0x12')])['then'](respondWithResult(_0x2afd38,null))[_0x5267('0x9')](handleError(_0x2afd38,null));};exports[_0x5267('0x13')]=function(_0x39c0c3,_0x2a9f99){return respondWithRpcPromise(_0x5267('0x14'),_['merge'](_0x39c0c3[_0x5267('0x12')],_0x39c0c3['params']))[_0x5267('0x15')](respondWithResult(_0x2a9f99,null))[_0x5267('0x9')](handleError(_0x2a9f99,null));};exports[_0x5267('0x16')]=function(_0x56dd95,_0x499f19){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x56dd95['query'],_0x56dd95[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x499f19,null))[_0x5267('0x9')](handleError(_0x499f19,null));};exports[_0x5267('0x18')]=function(_0x11c8ea,_0x40d1be){return respondWithRpcPromise(_0x5267('0x19'),_0x11c8ea[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x40d1be,null))['catch'](handleError(_0x40d1be,null));};exports['showVoiceQueues']=function(_0x354111,_0x472938){return respondWithRpcPromise('VoiceQueues',_0x354111[_0x5267('0x12')])['then'](findById(_0x354111['params']['id']))[_0x5267('0x15')](respondWithResult(_0x472938,null))[_0x5267('0x9')](handleError(_0x472938,null));};exports[_0x5267('0x1a')]=function(_0x2d2ace,_0x33c431){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x2d2ace[_0x5267('0x1b')],_0x2d2ace[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x33c431,null))['catch'](handleError(_0x33c431,null));};exports['voiceQueuesPreview']=function(_0xbe7922,_0x3ef2a8){return respondWithRpcPromise(_0x5267('0x1c'),_['merge'](_0xbe7922['query'],_0xbe7922[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x3ef2a8,null))[_0x5267('0x9')](handleError(_0x3ef2a8,null));};exports[_0x5267('0x1d')]=function(_0x5bbb83,_0x33e456){return respondWithRpcPromise(_0x5267('0x1e'),_0x5bbb83[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x33e456,null))[_0x5267('0x9')](handleError(_0x33e456,null));};exports[_0x5267('0x1f')]=function(_0x341bae,_0x1dda95){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x341bae[_0x5267('0x12')],_0x341bae['params']))[_0x5267('0x15')](respondWithResult(_0x1dda95,null))[_0x5267('0x9')](handleError(_0x1dda95,null));};exports[_0x5267('0x20')]=function(_0x3a729c,_0x4ac4a0){return respondWithRpcPromise(_0x5267('0x21'),_[_0x5267('0x22')](_0x3a729c[_0x5267('0x12')],_0x3a729c[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x4ac4a0,null))[_0x5267('0x9')](handleError(_0x4ac4a0,null));};exports[_0x5267('0x23')]=function(_0xa0ea89,_0x484b77){return respondWithRpcPromise(_0x5267('0x24'),_['merge'](_0xa0ea89[_0x5267('0x12')],_0xa0ea89[_0x5267('0x17')]))[_0x5267('0x15')](respondWithResult(_0x484b77,null))[_0x5267('0x9')](handleError(_0x484b77,null));};exports[_0x5267('0x25')]=function(_0x33ecd7,_0x465ad9){return respondWithRpcPromise('Outbound',_0x33ecd7[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0x465ad9,null))[_0x5267('0x9')](handleError(_0x465ad9,null));};exports[_0x5267('0x26')]=function(_0x82cea7,_0x21eabf){return respondWithRpcPromise(_0x5267('0x27'),_0x82cea7['query'])[_0x5267('0x15')](respondWithResult(_0x21eabf,null))['catch'](handleError(_0x21eabf,null));};exports[_0x5267('0x28')]=function(_0x5c0cdf,_0x4dee66){var _0x51bddd;return respondWithRpcPromise(_0x5267('0x29'),_0x5c0cdf['query'])[_0x5267('0x15')](function(_0x146476){_0x51bddd=_0x146476;return respondWithRpcPromise(_0x5267('0x29'),_0x5c0cdf[_0x5267('0x12')],routingClient);})['then'](function(_0x456b33){return _[_0x5267('0x22')]({},_0x456b33,_0x51bddd);})['then'](respondWithResult(_0x4dee66,null))['catch'](handleError(_0x4dee66,null));};exports[_0x5267('0x2a')]=function(_0x560cdf,_0x12df83){if(_0x560cdf[_0x5267('0x1b')]&&_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')]&&_0x560cdf[_0x5267('0x2c')]&&_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')]){for(var _0x5697b3 in _0x560cdf['body'][_0x5267('0x2b')]){if(_0x560cdf['body'][_0x5267('0x2b')][_0x5267('0x2d')](_0x5697b3)){db['MemberReport'][_0x5267('0x2e')]({'where':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')],'type':_0x5267('0x2f'),'exitAt':null,'uniqueid':_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')][_0x5697b3]&&_0x560cdf[_0x5267('0x1b')][_0x5267('0x2b')][_0x5697b3][_0x5267('0x30')]?{'$notIn':_0x560cdf['body'][_0x5267('0x2b')][_0x5697b3]}:{'$ne':null}}})[_0x5267('0x15')](function(_0x19b015){var _0x45241a=moment()[_0x5267('0x31')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3d15ac=0x0,_0x4e0132=_0x19b015[_0x5267('0x30')];_0x3d15ac<_0x4e0132;_0x3d15ac+=0x1){_0x19b015[_0x3d15ac]['updateAttributes']({'exitAt':_0x45241a});}});for(var _0x4ae9f9=0x0;_0x4ae9f9<_0x560cdf[_0x5267('0x1b')]['interaction'][_0x5697b3][_0x5267('0x30')];_0x4ae9f9+=0x1){db[_0x5267('0x32')][_0x5267('0x33')]({'where':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')]['name'],'type':_0x5267('0x2f'),'uniqueid':_0x560cdf['body']['interaction'][_0x5697b3][_0x4ae9f9],'exitAt':null},'defaults':{'channel':_0x5697b3,'membername':_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')],'interface':_['isNil'](_0x560cdf['user'][_0x5267('0x34')])?util[_0x5267('0x31')](_0x5267('0x35'),_0x560cdf[_0x5267('0x2c')][_0x5267('0xd')]):_0x560cdf[_0x5267('0x2c')][_0x5267('0x34')],'type':_0x5267('0x2f'),'enterAt':moment()[_0x5267('0x31')](_0x5267('0x36')),'role':_0x5267('0x37'),'internal':_0x560cdf[_0x5267('0x2c')][_0x5267('0x38')],'uniqueid':_0x560cdf[_0x5267('0x1b')]['interaction'][_0x5697b3][_0x4ae9f9]}});}}}}return respondWithRpcPromise(_0x5267('0x39'),{'id':_0x560cdf[_0x5267('0x17')]['id'],'capacity':_0x560cdf[_0x5267('0x1b')]['capacity']},routingClient)[_0x5267('0x15')](respondWithResult(_0x12df83,null))[_0x5267('0x9')](handleError(_0x12df83,null));};exports[_0x5267('0x3a')]=function(_0x2a97f1,_0x119546){return respondWithRpcPromise(_0x5267('0x3b'),_0x2a97f1['query'])[_0x5267('0x15')](respondWithResult(_0x119546,null))['catch'](handleError(_0x119546,null));};exports[_0x5267('0x3c')]=function(_0x30fcd2,_0xa49fd7){return respondWithRpcPromise(_0x5267('0x3d'),_0x30fcd2[_0x5267('0x12')])[_0x5267('0x15')](respondWithResult(_0xa49fd7,null))[_0x5267('0x9')](handleError(_0xa49fd7,null));};exports['campaigns']=function(_0x57ca8f,_0x200855){return respondWithRpcPromise(_0x5267('0x3e'),_0x57ca8f['query'])[_0x5267('0x15')](respondWithResult(_0x200855,null))['catch'](handleError(_0x200855,null));};exports['chatQueues']=function(_0x1eeb21,_0x79cee1){return respondWithRpcPromise(_0x5267('0x3f'),_0x1eeb21[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x79cee1,null))[_0x5267('0x9')](handleError(_0x79cee1,null));};exports[_0x5267('0x40')]=function(_0x3fd8f9,_0xf0b5a9){return respondWithRpcPromise(_0x5267('0x3f'),_0x3fd8f9['query'],routingClient)[_0x5267('0x15')](findById(_0x3fd8f9[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0xf0b5a9,null))[_0x5267('0x9')](handleError(_0xf0b5a9,null));};exports[_0x5267('0x41')]=function(_0x34c205,_0x552211){return respondWithRpcPromise(_0x5267('0x42'),_0x34c205['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x552211,null))[_0x5267('0x9')](handleError(_0x552211,null));};exports[_0x5267('0x43')]=function(_0x4a72c3,_0x1593ce){return respondWithRpcPromise(_0x5267('0x42'),_0x4a72c3[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0x4a72c3[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x1593ce,null))['catch'](handleError(_0x1593ce,null));};exports[_0x5267('0x44')]=function(_0x190d02,_0x186667){return respondWithRpcPromise(_0x5267('0x45'),_0x190d02['query'],mailClient)['then'](respondWithResult(_0x186667,null))[_0x5267('0x9')](handleError(_0x186667,null));};exports['openchannelQueues']=function(_0x3f5cda,_0x47059c){return respondWithRpcPromise('OpenchannelQueues',_0x3f5cda['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x47059c,null))[_0x5267('0x9')](handleError(_0x47059c,null));};exports[_0x5267('0x46')]=function(_0x537f75,_0x457dca){return respondWithRpcPromise(_0x5267('0x47'),_0x537f75[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0x537f75['params']['id']))['then'](respondWithResult(_0x457dca,null))['catch'](handleError(_0x457dca,null));};exports[_0x5267('0x48')]=function(_0x2457a3,_0x45ee25){return respondWithRpcPromise(_0x5267('0x49'),_0x2457a3[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x45ee25,null))[_0x5267('0x9')](handleError(_0x45ee25,null));};exports[_0x5267('0x4a')]=function(_0x486b02,_0x1ddfad){return respondWithRpcPromise(_0x5267('0x49'),_0x486b02['query'],routingClient)[_0x5267('0x15')](findById(_0x486b02[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x1ddfad,null))[_0x5267('0x9')](handleError(_0x1ddfad,null));};exports[_0x5267('0x4b')]=function(_0xde1ecd,_0x4915f4){return respondWithRpcPromise(_0x5267('0x4c'),_0xde1ecd[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x4915f4,null))[_0x5267('0x9')](handleError(_0x4915f4,null));};exports[_0x5267('0x4d')]=function(_0xd9bcf9,_0x4aac32){return respondWithRpcPromise(_0x5267('0x4c'),_0xd9bcf9[_0x5267('0x12')],routingClient)[_0x5267('0x15')](findById(_0xd9bcf9[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x4aac32,null))[_0x5267('0x9')](handleError(_0x4aac32,null));};exports['faxQueues']=function(_0x283423,_0x41299c){return respondWithRpcPromise(_0x5267('0x4e'),_0x283423[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x41299c,null))['catch'](handleError(_0x41299c,null));};exports['showFaxQueues']=function(_0x910f97,_0x5cca85){return respondWithRpcPromise(_0x5267('0x4e'),_0x910f97['query'],routingClient)[_0x5267('0x15')](findById(_0x910f97[_0x5267('0x17')]['id']))[_0x5267('0x15')](respondWithResult(_0x5cca85,null))[_0x5267('0x9')](handleError(_0x5cca85,null));};exports[_0x5267('0x4f')]=function(_0xa92aa5,_0x21338f){return respondWithRpcPromise(_0x5267('0x50'),_0xa92aa5['query'])['then'](respondWithResult(_0x21338f,null))['catch'](handleError(_0x21338f,null));};exports[_0x5267('0x51')]=function(_0x28a101,_0x2ab2be){return respondWithRpcPromise(_0x5267('0x52'),_0x28a101['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x2ab2be,null))[_0x5267('0x9')](handleError(_0x2ab2be,null));};exports[_0x5267('0x53')]=function(_0xc3ac3f,_0x5a0e73){return respondWithRpcPromise(_0x5267('0x54'),_0xc3ac3f[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x5a0e73,null))[_0x5267('0x9')](handleError(_0x5a0e73,null));};exports[_0x5267('0x55')]=function(_0x4a9995,_0x47e235){return respondWithRpcPromise(_0x5267('0x56'),_0x4a9995[_0x5267('0x12')],routingClient)['then'](respondWithResult(_0x47e235,null))['catch'](handleError(_0x47e235,null));};exports[_0x5267('0x57')]=function(_0x2e7f8a,_0x35b302){return respondWithRpcPromise(_0x5267('0x56'),_0x2e7f8a[_0x5267('0x12')],routingClient)['then'](function(_0x4643ae){if(_0x2e7f8a[_0x5267('0x12')]['type']!==undefined){var _0x26c628=_(_0x4643ae[_0x5267('0x10')])[_0x5267('0x58')]([_0x2e7f8a[_0x5267('0x12')][_0x5267('0x59')],_0x2e7f8a[_0x5267('0x17')]['id']])[_0x5267('0x5a')](_0x5267('0x5b'))['uniq']()['value']();return _0x4643ae[_0x5267('0x10')][_0x5267('0x58')](function(_0x3f729f){return _0x26c628[_0x5267('0x5c')](_0x3f729f['queue_id'])>-0x1;});}else{return _0x4643ae[_0x5267('0x10')]['filter'](function(_0x2988a1){return _0x2988a1[_0x5267('0x5b')]===parseInt(_0x2e7f8a[_0x5267('0x17')]['id']);});}})[_0x5267('0x15')](respondWithResult(_0x35b302,null))['catch'](handleError(_0x35b302,null));};exports['smsQueuesWaitingInteractions']=function(_0x3a67a0,_0x3e2cf5){return respondWithRpcPromise(_0x5267('0x5d'),_0x3a67a0[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x3e2cf5,null))[_0x5267('0x9')](handleError(_0x3e2cf5,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x1b8d72,_0x4a05c9){return respondWithRpcPromise(_0x5267('0x5e'),_0x1b8d72['query'],routingClient)[_0x5267('0x15')](respondWithResult(_0x4a05c9,null))[_0x5267('0x9')](handleError(_0x4a05c9,null));};exports[_0x5267('0x5f')]=function(_0x87aa90,_0x164cc1){return respondWithRpcPromise(_0x5267('0x60'),_0x87aa90[_0x5267('0x12')],routingClient)[_0x5267('0x15')](respondWithResult(_0x164cc1,null))[_0x5267('0x9')](handleError(_0x164cc1,null));};exports[_0x5267('0x61')]=function(_0x555c8){return function(_0x531bb9,_0x40c7b5){var _0x14baf4,_0x4d9ec9;var _0xde179f=_[_0x5267('0x62')](_0x555c8);var _0x3ebda6=_0x555c8===_0x5267('0x63')?_0x5267('0x64'):_0x5267('0x65');return db[_0xde179f+_0x5267('0x66')]['findOne']({'raw':!![],'where':{'id':_0x531bb9[_0x5267('0x17')]['id']}})[_0x5267('0x15')](function(_0x2543a4){if(_[_0x5267('0xf')](_0x2543a4)){throw new Error(_0xde179f+_0x5267('0x67'));}_0x14baf4=_0x2543a4;return db[_0xde179f+'Message']['findOne']({'where':{'id':_0x531bb9[_0x5267('0x1b')][_0x5267('0x68')]},'include':[{'model':db[_0xde179f+_0x5267('0x69')],'as':_0x5267('0x69')},{'model':db[_0xde179f+_0x3ebda6],'as':'Account'}]});})[_0x5267('0x15')](function(_0x3cc775){if(_[_0x5267('0xf')](_0x3cc775)){throw new Error(_0xde179f+_0x5267('0x6a'));}_0x4d9ec9=_0x3cc775;return _0x3cc775[_0x5267('0x6b')]({'read':0x0,'readAt':null,'UserId':null});})[_0x5267('0x15')](function(){var _0x2b38f2={'uniqueid':_0x555c8+'.'+_0x4d9ec9['id']+'.'+_0x4d9ec9[_0x5267('0x69')]['id'],'FromUserId':_0x531bb9[_0x5267('0x2c')]['id'],'type':_0x5267('0x6c')};_0x2b38f2[_0xde179f+_0x5267('0x6d')]=_0x4d9ec9['id'];_0x2b38f2[_0xde179f+_0x5267('0x6e')]=_0x4d9ec9[_0x5267('0x69')]['id'];_0x2b38f2['From'+_0xde179f+_0x3ebda6+'Id']=_0x4d9ec9[_0x5267('0x65')]['id'];_0x2b38f2['To'+_0xde179f+_0x5267('0x6f')]=_0x14baf4['id'];return db[_0xde179f+_0x5267('0x70')][_0x5267('0x71')](_0x2b38f2);})[_0x5267('0x15')](function(){return respondWithRpcPromise(_0x5267('0x72'),{'channel':_0x555c8,'interaction':_0x4d9ec9[_0x5267('0x69')],'message':_0x4d9ec9,'account':_0x4d9ec9[_0x5267('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5267('0x6c'),'appdata':_0x14baf4[_0x5267('0xd')]+','+(_0x4d9ec9[_0x5267('0x65')][_0x5267('0x73')]||0x12c),'interval':_0x5267('0x74')}]},routingClient);})[_0x5267('0x15')](respondWithResult(_0x40c7b5,null))[_0x5267('0x9')](handleError(_0x40c7b5,null));};};exports[_0x5267('0x75')]=function(_0x28884b,_0x35a4a3){var _0x7ecf0e,_0x676556;if(_[_0x5267('0xf')](_0x28884b[_0x5267('0x1b')][_0x5267('0x76')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x339f3f=_0x28884b[_0x5267('0x1b')][_0x5267('0x76')];var _0x405eb4=_[_0x5267('0x62')](_0x339f3f);var _0x557749=_0x339f3f===_0x5267('0x63')?_0x5267('0x64'):'Account';return db['User']['findOne']({'raw':!![],'where':{'id':_0x28884b[_0x5267('0x17')]['id'],'role':'agent'}})[_0x5267('0x15')](function(_0x54422c){if(_['isNil'](_0x54422c)){throw new Error(_0x5267('0x77'));}_0x7ecf0e=_0x54422c;return db[_0x405eb4+_0x5267('0x78')][_0x5267('0x79')]({'where':{'id':_0x28884b[_0x5267('0x1b')][_0x5267('0x68')]},'include':[{'model':db[_0x405eb4+'Interaction'],'as':'Interaction'},{'model':db[_0x405eb4+_0x557749],'as':_0x5267('0x65')}]});})[_0x5267('0x15')](function(_0x1a6245){if(_[_0x5267('0xf')](_0x1a6245)){throw new Error(_0x405eb4+_0x5267('0x6a'));}_0x676556=_0x1a6245;return _0x1a6245['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x5267('0x15')](function(){var _0x5bece1={'uniqueid':_0x339f3f+'.'+_0x676556['id']+'.'+_0x676556['Interaction']['id'],'FromUserId':_0x28884b[_0x5267('0x2c')]['id'],'type':'queue','ToUserId':_0x7ecf0e['id']};_0x5bece1[_0x405eb4+'MessageId']=_0x676556['id'];_0x5bece1[_0x405eb4+_0x5267('0x6e')]=_0x676556[_0x5267('0x69')]['id'];_0x5bece1['From'+_0x405eb4+_0x557749+'Id']=_0x676556['Account']['id'];return db[_0x405eb4+'TransferReport'][_0x5267('0x71')](_0x5bece1);})['then'](function(){return respondWithRpcPromise(_0x5267('0x72'),{'channel':_0x339f3f,'interaction':_0x676556['Interaction'],'message':_0x676556,'account':_0x676556[_0x5267('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x5267('0x37'),'appdata':_0x7ecf0e['name']+','+(_0x676556[_0x5267('0x65')][_0x5267('0x7a')]||0x12c),'interval':_0x5267('0x74')}]},routingClient);})[_0x5267('0x15')](respondWithResult(_0x35a4a3,null))[_0x5267('0x9')](handleError(_0x35a4a3,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 7a09f0f..2fd3922 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 _0x1bf2=['delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','/:id','/:id/run','post','create','put','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1bf2,0xaa));var _0x21bf=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x1bf2[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x21bf('0x0'));var util=require(_0x21bf('0x1'));var path=require(_0x21bf('0x2'));var timeout=require(_0x21bf('0x3'));var express=require(_0x21bf('0x4'));var router=express[_0x21bf('0x5')]();var fs_extra=require(_0x21bf('0x6'));var auth=require(_0x21bf('0x7'));var interaction=require(_0x21bf('0x8'));var config=require(_0x21bf('0x9'));var controller=require(_0x21bf('0xa'));router[_0x21bf('0xb')]('/',auth[_0x21bf('0xc')](),controller['index']);router[_0x21bf('0xb')](_0x21bf('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x21bf('0xb')](_0x21bf('0xe'),auth[_0x21bf('0xc')](),controller['run']);router[_0x21bf('0xf')]('/',auth[_0x21bf('0xc')](),controller[_0x21bf('0x10')]);router[_0x21bf('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x21bf('0x12')]);router[_0x21bf('0x13')](_0x21bf('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x21bf('0x14')]=router; \ No newline at end of file +var _0xe096=['/:id','/:id/run','post','create','put','update','destroy','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe096,0x1ab));var _0x6e09=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0xe096[_0x1b51ea];return _0x18bbdc;};'use strict';var multer=require('multer');var util=require(_0x6e09('0x0'));var path=require(_0x6e09('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6e09('0x2')]();var fs_extra=require(_0x6e09('0x3'));var auth=require(_0x6e09('0x4'));var interaction=require(_0x6e09('0x5'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x6e09('0x6')]('/',auth[_0x6e09('0x7')](),controller['index']);router[_0x6e09('0x6')](_0x6e09('0x8'),auth[_0x6e09('0x7')](),controller['show']);router[_0x6e09('0x6')](_0x6e09('0x9'),auth[_0x6e09('0x7')](),controller['run']);router[_0x6e09('0xa')]('/',auth[_0x6e09('0x7')](),controller[_0x6e09('0xb')]);router[_0x6e09('0xc')]('/:id',auth[_0x6e09('0x7')](),controller[_0x6e09('0xd')]);router['delete'](_0x6e09('0x8'),auth[_0x6e09('0x7')](),controller[_0x6e09('0xe')]);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 4c12986..d71153b 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 _0xcd03=['ENUM','years','quarters','months','weeks','days','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xcd03,0x19c));var _0x3cd0=function(_0x35c8f5,_0x399f44){_0x35c8f5=_0x35c8f5-0x0;var _0xb5c718=_0xcd03[_0x35c8f5];return _0xb5c718;};'use strict';var Sequelize=require(_0x3cd0('0x0'));module[_0x3cd0('0x1')]={'name':{'type':Sequelize[_0x3cd0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3cd0('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3cd0('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x3cd0('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3cd0('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x3cd0('0x6')](_0x3cd0('0x7'),_0x3cd0('0x8'),_0x3cd0('0x9'),_0x3cd0('0xa'),_0x3cd0('0xb'),'hours',_0x3cd0('0xc')),'allowNull':![],'defaultValue':_0x3cd0('0xb')},'output':{'type':Sequelize['ENUM'](_0x3cd0('0xd'),_0x3cd0('0xe'),_0x3cd0('0xf')),'allowNull':![],'defaultValue':_0x3cd0('0xd')},'type':{'type':Sequelize[_0x3cd0('0x6')](_0x3cd0('0x10'),_0x3cd0('0x11')),'allowNull':![],'defaultValue':_0x3cd0('0x10')},'sendMail':{'type':Sequelize[_0x3cd0('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x3cd0('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x3cd0('0x12')]},'sendIfEmpty':{'type':Sequelize[_0x3cd0('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa83c=['custom','TEXT','BOOLEAN','sequelize','exports','STRING','DATE','INTEGER','ENUM','years','quarters','days','minutes','pdf','xlsx'];(function(_0x580a67,_0x15fcd3){var _0x2a0ae8=function(_0x9acdea){while(--_0x9acdea){_0x580a67['push'](_0x580a67['shift']());}};_0x2a0ae8(++_0x15fcd3);}(_0xa83c,0x111));var _0xca83=function(_0x8a7e38,_0x473a5d){_0x8a7e38=_0x8a7e38-0x0;var _0x228609=_0xa83c[_0x8a7e38];return _0x228609;};'use strict';var Sequelize=require(_0xca83('0x0'));module[_0xca83('0x1')]={'name':{'type':Sequelize[_0xca83('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xca83('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xca83('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xca83('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xca83('0x5')](_0xca83('0x6'),_0xca83('0x7'),'months','weeks',_0xca83('0x8'),'hours',_0xca83('0x9')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xca83('0x5')]('csv',_0xca83('0xa'),_0xca83('0xb')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0xca83('0xc'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xca83('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xca83('0xd')]},'sendIfEmpty':{'type':Sequelize[_0xca83('0xe')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index ebae378..636a090 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 _0xb061=['offset','undefined','limit','Content-Range','json','apply','reject','update','then','destroy','get','Scheduler','end','sendStatus','error','name','send','index','Schedule','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','count','include','rows','catch','show','params','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','run','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xb061,0x8a));var _0x1b06=function(_0x2ac512,_0x18d0fc){_0x2ac512=_0x2ac512-0x0;var _0x41a20e=_0xb061[_0x2ac512];return _0x41a20e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b06('0x0'));var zipdir=require(_0x1b06('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b06('0x2'));var moment=require(_0x1b06('0x3'));var BPromise=require(_0x1b06('0x4'));var Mustache=require(_0x1b06('0x5'));var util=require(_0x1b06('0x6'));var path=require(_0x1b06('0x7'));var sox=require(_0x1b06('0x8'));var csv=require(_0x1b06('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b06('0xa'));var _=require(_0x1b06('0xb'));var squel=require(_0x1b06('0xc'));var crypto=require(_0x1b06('0xd'));var jsforce=require(_0x1b06('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x1b06('0x9'));var querystring=require(_0x1b06('0xf'));var Papa=require(_0x1b06('0x10'));var Redis=require(_0x1b06('0x11'));var authService=require(_0x1b06('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1b06('0x13'));var hardwareService=require(_0x1b06('0x14'));var logger=require(_0x1b06('0x15'))(_0x1b06('0x16'));var utils=require(_0x1b06('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1b06('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d6c1e,_0xbd4c6e){_0xbd4c6e=_0xbd4c6e||0xcc;return function(_0x4a34b5){if(_0x4a34b5){return _0x1d6c1e['sendStatus'](_0xbd4c6e);}return _0x1d6c1e['status'](_0xbd4c6e)['end']();};}function respondWithResult(_0x4b4f9c,_0x55c1e0){_0x55c1e0=_0x55c1e0||0xc8;return function(_0x159a4f){if(_0x159a4f){return _0x4b4f9c[_0x1b06('0x19')](_0x55c1e0)['json'](_0x159a4f);}};}function respondWithFilteredResult(_0xf1e477,_0x1091c2){return function(_0xd9d4f){if(_0xd9d4f){var _0x51df2f=typeof _0x1091c2[_0x1b06('0x1a')]===_0x1b06('0x1b')&&typeof _0x1091c2[_0x1b06('0x1c')]===_0x1b06('0x1b');var _0x2f4562=_0xd9d4f['count'];var _0x4de98e=_0x51df2f?0x0:_0x1091c2[_0x1b06('0x1a')];var _0x28de02=_0x51df2f?_0xd9d4f['count']:_0x1091c2[_0x1b06('0x1a')]+_0x1091c2[_0x1b06('0x1c')];var _0x58c106;if(_0x28de02>=_0x2f4562){_0x28de02=_0x2f4562;_0x58c106=0xc8;}else{_0x58c106=0xce;}_0xf1e477['status'](_0x58c106);return _0xf1e477['set'](_0x1b06('0x1d'),_0x4de98e+'-'+_0x28de02+'/'+_0x2f4562)[_0x1b06('0x1e')](_0xd9d4f);}return null;};}function patchUpdates(_0x21b4ea){return function(_0x3a927e){try{jsonpatch[_0x1b06('0x1f')](_0x3a927e,_0x21b4ea,!![]);}catch(_0x1fcfa9){return BPromise[_0x1b06('0x20')](_0x1fcfa9);}return _0x3a927e['save']();};}function saveUpdates(_0x215376,_0x396236){return function(_0x586cc7){if(_0x586cc7){return _0x586cc7[_0x1b06('0x21')](_0x215376)[_0x1b06('0x22')](function(_0x492f45){return _0x492f45;});}return null;};}function removeEntity(_0x4196dc,_0x2debe2){return function(_0x223aca){if(_0x223aca){return _0x223aca[_0x1b06('0x23')]()[_0x1b06('0x22')](function(){var _0x590c4d=_0x223aca[_0x1b06('0x24')]({'plain':!![]});var _0x23b4e7=_0x1b06('0x25');return db['UserProfileResource'][_0x1b06('0x23')]({'where':{'type':_0x23b4e7,'resourceId':_0x590c4d['id']}})[_0x1b06('0x22')](function(){return _0x223aca;});})[_0x1b06('0x22')](function(){_0x4196dc[_0x1b06('0x19')](0xcc)[_0x1b06('0x26')]();});}};}function handleEntityNotFound(_0x5e9713,_0x5d738a){return function(_0x527ac4){if(!_0x527ac4){_0x5e9713[_0x1b06('0x27')](0x194);}return _0x527ac4;};}function handleError(_0x4073a1,_0x3d4aa3){_0x3d4aa3=_0x3d4aa3||0x1f4;return function(_0xb52f74){logger[_0x1b06('0x28')](_0xb52f74['stack']);if(_0xb52f74[_0x1b06('0x29')]){delete _0xb52f74[_0x1b06('0x29')];}_0x4073a1[_0x1b06('0x19')](_0x3d4aa3)[_0x1b06('0x2a')](_0xb52f74);};}exports[_0x1b06('0x2b')]=function(_0x28bae3,_0x2d2268){var _0x40f706={},_0x23ea33={},_0x4b5a7c={'count':0x0,'rows':[]};var _0x36043b=_['map'](db[_0x1b06('0x2c')][_0x1b06('0x2d')],function(_0x3d5d43){return{'name':_0x3d5d43['fieldName'],'type':_0x3d5d43['type']['key']};});_0x23ea33[_0x1b06('0x2e')]=_['map'](_0x36043b,_0x1b06('0x29'));_0x23ea33[_0x1b06('0x2f')]=_['keys'](_0x28bae3[_0x1b06('0x2f')]);_0x23ea33[_0x1b06('0x30')]=_[_0x1b06('0x31')](_0x23ea33[_0x1b06('0x2e')],_0x23ea33[_0x1b06('0x2f')]);_0x40f706[_0x1b06('0x32')]=_[_0x1b06('0x31')](_0x23ea33['model'],qs[_0x1b06('0x33')](_0x28bae3['query']['fields']));_0x40f706[_0x1b06('0x32')]=_0x40f706['attributes'][_0x1b06('0x34')]?_0x40f706[_0x1b06('0x32')]:_0x23ea33['model'];if(!_0x28bae3[_0x1b06('0x2f')][_0x1b06('0x35')](_0x1b06('0x36'))){_0x40f706[_0x1b06('0x1c')]=qs[_0x1b06('0x1c')](_0x28bae3[_0x1b06('0x2f')]['limit']);_0x40f706['offset']=qs[_0x1b06('0x1a')](_0x28bae3[_0x1b06('0x2f')][_0x1b06('0x1a')]);}_0x40f706[_0x1b06('0x37')]=qs[_0x1b06('0x38')](_0x28bae3['query'][_0x1b06('0x38')]);_0x40f706[_0x1b06('0x39')]=qs[_0x1b06('0x30')](_[_0x1b06('0x3a')](_0x28bae3[_0x1b06('0x2f')],_0x23ea33[_0x1b06('0x30')]),_0x36043b);if(_0x28bae3['query'][_0x1b06('0x3b')]){_0x40f706['where']=_[_0x1b06('0x3c')](_0x40f706[_0x1b06('0x39')],{'$or':_[_0x1b06('0x3d')](_0x36043b,function(_0x4d4c66){if(_0x4d4c66[_0x1b06('0x3e')]!==_0x1b06('0x3f')){var _0x2e6c0c={};_0x2e6c0c[_0x4d4c66[_0x1b06('0x29')]]={'$like':'%'+_0x28bae3['query']['filter']+'%'};return _0x2e6c0c;}})});}_0x40f706=_[_0x1b06('0x3c')]({},_0x40f706,_0x28bae3[_0x1b06('0x40')]);var _0x37a721={'where':_0x40f706[_0x1b06('0x39')]};return db[_0x1b06('0x2c')][_0x1b06('0x41')](_0x37a721)[_0x1b06('0x22')](function(_0x28076b){_0x4b5a7c[_0x1b06('0x41')]=_0x28076b;if(_0x28bae3[_0x1b06('0x2f')]['includeAll']){_0x40f706[_0x1b06('0x42')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x40f706);})[_0x1b06('0x22')](function(_0x14959a){_0x4b5a7c[_0x1b06('0x43')]=_0x14959a;return _0x4b5a7c;})[_0x1b06('0x22')](respondWithFilteredResult(_0x2d2268,_0x40f706))[_0x1b06('0x44')](handleError(_0x2d2268,null));};exports[_0x1b06('0x45')]=function(_0x132019,_0x45c76c){var _0x1fd0be={'raw':![],'where':{'id':_0x132019[_0x1b06('0x46')]['id']}},_0x1aa5ef={};_0x1aa5ef[_0x1b06('0x2e')]=_[_0x1b06('0x47')](db[_0x1b06('0x2c')][_0x1b06('0x2d')]);_0x1aa5ef[_0x1b06('0x2f')]=_[_0x1b06('0x47')](_0x132019[_0x1b06('0x2f')]);_0x1aa5ef['filters']=_[_0x1b06('0x31')](_0x1aa5ef[_0x1b06('0x2e')],_0x1aa5ef['query']);_0x1fd0be[_0x1b06('0x32')]=_[_0x1b06('0x31')](_0x1aa5ef[_0x1b06('0x2e')],qs['fields'](_0x132019['query'][_0x1b06('0x33')]));_0x1fd0be[_0x1b06('0x32')]=_0x1fd0be[_0x1b06('0x32')][_0x1b06('0x34')]?_0x1fd0be[_0x1b06('0x32')]:_0x1aa5ef[_0x1b06('0x2e')];if(_0x132019['query'][_0x1b06('0x48')]){_0x1fd0be[_0x1b06('0x42')]=[{'all':!![]}];}_0x1fd0be=_['merge']({},_0x1fd0be,_0x132019['options']);return db[_0x1b06('0x2c')][_0x1b06('0x49')](_0x1fd0be)[_0x1b06('0x22')](handleEntityNotFound(_0x45c76c,null))[_0x1b06('0x22')](respondWithResult(_0x45c76c,null))[_0x1b06('0x44')](handleError(_0x45c76c,null));};exports[_0x1b06('0x4a')]=function(_0xa96c6,_0x324812){return db[_0x1b06('0x2c')][_0x1b06('0x4a')](_0xa96c6[_0x1b06('0x4b')],{})[_0x1b06('0x22')](function(_0x599dbb){var _0x16f853=_0xa96c6['user'][_0x1b06('0x24')]({'plain':!![]});if(!_0x16f853)throw new Error(_0x1b06('0x4c'));if(_0x16f853[_0x1b06('0x4d')]==='user'){var _0x5229d4=_0x599dbb[_0x1b06('0x24')]({'plain':!![]});var _0x3428f3='Scheduler';return db[_0x1b06('0x4e')][_0x1b06('0x49')]({'where':{'name':_0x3428f3,'userProfileId':_0x16f853[_0x1b06('0x4f')]},'raw':!![]})[_0x1b06('0x22')](function(_0x367e8d){if(_0x367e8d&&_0x367e8d['autoAssociation']===0x0){return db[_0x1b06('0x50')][_0x1b06('0x4a')]({'name':_0x5229d4[_0x1b06('0x29')],'resourceId':_0x5229d4['id'],'type':_0x367e8d[_0x1b06('0x29')],'sectionId':_0x367e8d['id']},{})[_0x1b06('0x22')](function(){return _0x599dbb;});}else{return _0x599dbb;}})[_0x1b06('0x44')](function(_0x5be7a4){logger[_0x1b06('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5be7a4);throw _0x5be7a4;});}return _0x599dbb;})[_0x1b06('0x22')](respondWithResult(_0x324812,0xc9))['catch'](handleError(_0x324812,null));};exports['update']=function(_0x1fe464,_0x20754f){if(_0x1fe464['body']['id']){delete _0x1fe464[_0x1b06('0x4b')]['id'];}return db[_0x1b06('0x2c')]['find']({'where':{'id':_0x1fe464['params']['id']}})[_0x1b06('0x22')](handleEntityNotFound(_0x20754f,null))[_0x1b06('0x22')](saveUpdates(_0x1fe464[_0x1b06('0x4b')],null))[_0x1b06('0x22')](respondWithResult(_0x20754f,null))[_0x1b06('0x44')](handleError(_0x20754f,null));};exports[_0x1b06('0x23')]=function(_0x2600be,_0x12d854){return db[_0x1b06('0x2c')][_0x1b06('0x49')]({'where':{'id':_0x2600be[_0x1b06('0x46')]['id']}})[_0x1b06('0x22')](handleEntityNotFound(_0x12d854,null))[_0x1b06('0x22')](removeEntity(_0x12d854,null))[_0x1b06('0x44')](handleError(_0x12d854,null));};exports[_0x1b06('0x51')]=function(_0x500805,_0x21f8cb,_0x4e9e2d){var _0x34be66=require('../../config/schedule');return db[_0x1b06('0x2c')]['find']({'where':{'id':_0x500805[_0x1b06('0x46')]['id']},'raw':!![]})[_0x1b06('0x22')](handleEntityNotFound(_0x21f8cb,null))[_0x1b06('0x22')](function(){_0x34be66[_0x1b06('0x51')](_0x500805['params']['id']);})['then'](respondWithStatusCode(_0x21f8cb,null))['catch'](handleError(_0x21f8cb,null));}; \ No newline at end of file +var _0xff4d=['keys','fields','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','then','destroy','get','Scheduler','error','stack','name','send','map','Schedule','rawAttributes','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','catch','show','params'];(function(_0xdb66e5,_0x3c7910){var _0x23a039=function(_0x4473a1){while(--_0x4473a1){_0xdb66e5['push'](_0xdb66e5['shift']());}};_0x23a039(++_0x3c7910);}(_0xff4d,0xb1));var _0xdff4=function(_0x5384ae,_0x32e603){_0x5384ae=_0x5384ae-0x0;var _0x4bcf2d=_0xff4d[_0x5384ae];return _0x4bcf2d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdff4('0x0'));var zipdir=require(_0xdff4('0x1'));var jsonpatch=require(_0xdff4('0x2'));var rp=require(_0xdff4('0x3'));var moment=require(_0xdff4('0x4'));var BPromise=require(_0xdff4('0x5'));var Mustache=require(_0xdff4('0x6'));var util=require(_0xdff4('0x7'));var path=require('path');var sox=require(_0xdff4('0x8'));var csv=require(_0xdff4('0x9'));var ejs=require(_0xdff4('0xa'));var fs=require('fs');var fs_extra=require(_0xdff4('0xb'));var _=require(_0xdff4('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdff4('0xd'));var deskjs=require(_0xdff4('0xe'));var toCsv=require(_0xdff4('0x9'));var querystring=require(_0xdff4('0xf'));var Papa=require(_0xdff4('0x10'));var Redis=require(_0xdff4('0x11'));var authService=require(_0xdff4('0x12'));var qs=require(_0xdff4('0x13'));var as=require(_0xdff4('0x14'));var hardwareService=require(_0xdff4('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdff4('0x16'));var licenseUtil=require(_0xdff4('0x17'));var db=require(_0xdff4('0x18'))['db'];function respondWithStatusCode(_0x53ee0d,_0x260eaf){_0x260eaf=_0x260eaf||0xcc;return function(_0x404354){if(_0x404354){return _0x53ee0d[_0xdff4('0x19')](_0x260eaf);}return _0x53ee0d[_0xdff4('0x1a')](_0x260eaf)[_0xdff4('0x1b')]();};}function respondWithResult(_0x16fbd5,_0x1601da){_0x1601da=_0x1601da||0xc8;return function(_0x4f0691){if(_0x4f0691){return _0x16fbd5[_0xdff4('0x1a')](_0x1601da)['json'](_0x4f0691);}};}function respondWithFilteredResult(_0x1bbf37,_0x2ca551){return function(_0x5c55de){if(_0x5c55de){var _0x3524c1=typeof _0x2ca551['offset']===_0xdff4('0x1c')&&typeof _0x2ca551[_0xdff4('0x1d')]===_0xdff4('0x1c');var _0x439555=_0x5c55de[_0xdff4('0x1e')];var _0xac3efd=_0x3524c1?0x0:_0x2ca551['offset'];var _0x234c90=_0x3524c1?_0x5c55de[_0xdff4('0x1e')]:_0x2ca551[_0xdff4('0x1f')]+_0x2ca551[_0xdff4('0x1d')];var _0x55d952;if(_0x234c90>=_0x439555){_0x234c90=_0x439555;_0x55d952=0xc8;}else{_0x55d952=0xce;}_0x1bbf37[_0xdff4('0x1a')](_0x55d952);return _0x1bbf37['set'](_0xdff4('0x20'),_0xac3efd+'-'+_0x234c90+'/'+_0x439555)[_0xdff4('0x21')](_0x5c55de);}return null;};}function patchUpdates(_0x30de81){return function(_0x38f319){try{jsonpatch['apply'](_0x38f319,_0x30de81,!![]);}catch(_0x1814d6){return BPromise['reject'](_0x1814d6);}return _0x38f319['save']();};}function saveUpdates(_0x36b42a,_0x5eb063){return function(_0x39938c){if(_0x39938c){return _0x39938c['update'](_0x36b42a)[_0xdff4('0x22')](function(_0x546a35){return _0x546a35;});}return null;};}function removeEntity(_0xf14e43,_0x2b331b){return function(_0x7dee5e){if(_0x7dee5e){return _0x7dee5e[_0xdff4('0x23')]()[_0xdff4('0x22')](function(){var _0xffdee1=_0x7dee5e[_0xdff4('0x24')]({'plain':!![]});var _0x3d243a=_0xdff4('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x3d243a,'resourceId':_0xffdee1['id']}})[_0xdff4('0x22')](function(){return _0x7dee5e;});})[_0xdff4('0x22')](function(){_0xf14e43[_0xdff4('0x1a')](0xcc)[_0xdff4('0x1b')]();});}};}function handleEntityNotFound(_0x2b889f,_0x56c629){return function(_0x328dd7){if(!_0x328dd7){_0x2b889f['sendStatus'](0x194);}return _0x328dd7;};}function handleError(_0x1cba7e,_0x5ba017){_0x5ba017=_0x5ba017||0x1f4;return function(_0x132a28){logger[_0xdff4('0x26')](_0x132a28[_0xdff4('0x27')]);if(_0x132a28[_0xdff4('0x28')]){delete _0x132a28['name'];}_0x1cba7e[_0xdff4('0x1a')](_0x5ba017)[_0xdff4('0x29')](_0x132a28);};}exports['index']=function(_0x148063,_0x50ad36){var _0x40712d={},_0x3fcd38={},_0x271a5b={'count':0x0,'rows':[]};var _0x481542=_[_0xdff4('0x2a')](db[_0xdff4('0x2b')][_0xdff4('0x2c')],function(_0x44449b){return{'name':_0x44449b['fieldName'],'type':_0x44449b['type'][_0xdff4('0x2d')]};});_0x3fcd38[_0xdff4('0x2e')]=_[_0xdff4('0x2a')](_0x481542,'name');_0x3fcd38['query']=_['keys'](_0x148063[_0xdff4('0x2f')]);_0x3fcd38[_0xdff4('0x30')]=_[_0xdff4('0x31')](_0x3fcd38[_0xdff4('0x2e')],_0x3fcd38[_0xdff4('0x2f')]);_0x40712d[_0xdff4('0x32')]=_['intersection'](_0x3fcd38['model'],qs['fields'](_0x148063[_0xdff4('0x2f')]['fields']));_0x40712d['attributes']=_0x40712d['attributes'][_0xdff4('0x33')]?_0x40712d[_0xdff4('0x32')]:_0x3fcd38[_0xdff4('0x2e')];if(!_0x148063['query'][_0xdff4('0x34')](_0xdff4('0x35'))){_0x40712d[_0xdff4('0x1d')]=qs[_0xdff4('0x1d')](_0x148063[_0xdff4('0x2f')][_0xdff4('0x1d')]);_0x40712d['offset']=qs[_0xdff4('0x1f')](_0x148063[_0xdff4('0x2f')][_0xdff4('0x1f')]);}_0x40712d[_0xdff4('0x36')]=qs['sort'](_0x148063[_0xdff4('0x2f')][_0xdff4('0x37')]);_0x40712d[_0xdff4('0x38')]=qs[_0xdff4('0x30')](_[_0xdff4('0x39')](_0x148063[_0xdff4('0x2f')],_0x3fcd38['filters']),_0x481542);if(_0x148063['query'][_0xdff4('0x3a')]){_0x40712d['where']=_[_0xdff4('0x3b')](_0x40712d[_0xdff4('0x38')],{'$or':_['map'](_0x481542,function(_0x31fece){if(_0x31fece[_0xdff4('0x3c')]!==_0xdff4('0x3d')){var _0x313134={};_0x313134[_0x31fece[_0xdff4('0x28')]]={'$like':'%'+_0x148063[_0xdff4('0x2f')][_0xdff4('0x3a')]+'%'};return _0x313134;}})});}_0x40712d=_[_0xdff4('0x3b')]({},_0x40712d,_0x148063['options']);var _0x24980e={'where':_0x40712d[_0xdff4('0x38')]};return db[_0xdff4('0x2b')]['count'](_0x24980e)[_0xdff4('0x22')](function(_0x48b36d){_0x271a5b[_0xdff4('0x1e')]=_0x48b36d;if(_0x148063['query']['includeAll']){_0x40712d[_0xdff4('0x3e')]=[{'all':!![]}];}return db['Schedule']['findAll'](_0x40712d);})[_0xdff4('0x22')](function(_0x2bd2){_0x271a5b['rows']=_0x2bd2;return _0x271a5b;})[_0xdff4('0x22')](respondWithFilteredResult(_0x50ad36,_0x40712d))[_0xdff4('0x3f')](handleError(_0x50ad36,null));};exports[_0xdff4('0x40')]=function(_0x3262d0,_0x4c401d){var _0x247fc5={'raw':![],'where':{'id':_0x3262d0[_0xdff4('0x41')]['id']}},_0x30d268={};_0x30d268[_0xdff4('0x2e')]=_[_0xdff4('0x42')](db[_0xdff4('0x2b')]['rawAttributes']);_0x30d268[_0xdff4('0x2f')]=_[_0xdff4('0x42')](_0x3262d0[_0xdff4('0x2f')]);_0x30d268[_0xdff4('0x30')]=_[_0xdff4('0x31')](_0x30d268[_0xdff4('0x2e')],_0x30d268[_0xdff4('0x2f')]);_0x247fc5[_0xdff4('0x32')]=_[_0xdff4('0x31')](_0x30d268['model'],qs[_0xdff4('0x43')](_0x3262d0[_0xdff4('0x2f')][_0xdff4('0x43')]));_0x247fc5['attributes']=_0x247fc5[_0xdff4('0x32')]['length']?_0x247fc5[_0xdff4('0x32')]:_0x30d268['model'];if(_0x3262d0[_0xdff4('0x2f')][_0xdff4('0x44')]){_0x247fc5[_0xdff4('0x3e')]=[{'all':!![]}];}_0x247fc5=_[_0xdff4('0x3b')]({},_0x247fc5,_0x3262d0[_0xdff4('0x45')]);return db['Schedule'][_0xdff4('0x46')](_0x247fc5)['then'](handleEntityNotFound(_0x4c401d,null))[_0xdff4('0x22')](respondWithResult(_0x4c401d,null))[_0xdff4('0x3f')](handleError(_0x4c401d,null));};exports['create']=function(_0x55e55a,_0x53756f){return db[_0xdff4('0x2b')][_0xdff4('0x47')](_0x55e55a[_0xdff4('0x48')],{})[_0xdff4('0x22')](function(_0x2b2bd3){var _0x5aa58b=_0x55e55a[_0xdff4('0x49')]['get']({'plain':!![]});if(!_0x5aa58b)throw new Error(_0xdff4('0x4a'));if(_0x5aa58b[_0xdff4('0x4b')]==='user'){var _0x2aed78=_0x2b2bd3[_0xdff4('0x24')]({'plain':!![]});var _0x4f7720=_0xdff4('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x4f7720,'userProfileId':_0x5aa58b[_0xdff4('0x4c')]},'raw':!![]})['then'](function(_0x2aa320){if(_0x2aa320&&_0x2aa320[_0xdff4('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x2aed78['name'],'resourceId':_0x2aed78['id'],'type':_0x2aa320['name'],'sectionId':_0x2aa320['id']},{})[_0xdff4('0x22')](function(){return _0x2b2bd3;});}else{return _0x2b2bd3;}})[_0xdff4('0x3f')](function(_0x255eec){logger[_0xdff4('0x26')](_0xdff4('0x4e'),_0x255eec);throw _0x255eec;});}return _0x2b2bd3;})[_0xdff4('0x22')](respondWithResult(_0x53756f,0xc9))[_0xdff4('0x3f')](handleError(_0x53756f,null));};exports['update']=function(_0x3af38e,_0x47e235){if(_0x3af38e[_0xdff4('0x48')]['id']){delete _0x3af38e[_0xdff4('0x48')]['id'];}return db[_0xdff4('0x2b')][_0xdff4('0x46')]({'where':{'id':_0x3af38e['params']['id']}})[_0xdff4('0x22')](handleEntityNotFound(_0x47e235,null))[_0xdff4('0x22')](saveUpdates(_0x3af38e[_0xdff4('0x48')],null))[_0xdff4('0x22')](respondWithResult(_0x47e235,null))[_0xdff4('0x3f')](handleError(_0x47e235,null));};exports[_0xdff4('0x23')]=function(_0x5db266,_0x33a61d){return db['Schedule'][_0xdff4('0x46')]({'where':{'id':_0x5db266[_0xdff4('0x41')]['id']}})[_0xdff4('0x22')](handleEntityNotFound(_0x33a61d,null))[_0xdff4('0x22')](removeEntity(_0x33a61d,null))[_0xdff4('0x3f')](handleError(_0x33a61d,null));};exports[_0xdff4('0x4f')]=function(_0xdc0d99,_0x5d92b1,_0x1fd331){var _0x439a46=require(_0xdff4('0x50'));return db[_0xdff4('0x2b')]['find']({'where':{'id':_0xdc0d99[_0xdff4('0x41')]['id']},'raw':!![]})[_0xdff4('0x22')](handleEntityNotFound(_0x5d92b1,null))[_0xdff4('0x22')](function(){_0x439a46[_0xdff4('0x4f')](_0xdc0d99[_0xdff4('0x41')]['id']);})[_0xdff4('0x22')](respondWithStatusCode(_0x5d92b1,null))[_0xdff4('0x3f')](handleError(_0x5d92b1,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c2a89a9..db96818 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 _0x9158=['path','rimraf','../../config/environment','exports','define','Schedule','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3e4eaf,_0x1eed89){var _0x423ee9=function(_0x3501ca){while(--_0x3501ca){_0x3e4eaf['push'](_0x3e4eaf['shift']());}};_0x423ee9(++_0x1eed89);}(_0x9158,0x186));var _0x8915=function(_0x196a21,_0x331324){_0x196a21=_0x196a21-0x0;var _0xf08524=_0x9158[_0x196a21];return _0xf08524;};'use strict';var _=require(_0x8915('0x0'));var util=require(_0x8915('0x1'));var logger=require('../../config/logger')(_0x8915('0x2'));var moment=require(_0x8915('0x3'));var BPromise=require(_0x8915('0x4'));var rp=require(_0x8915('0x5'));var fs=require('fs');var path=require(_0x8915('0x6'));var rimraf=require(_0x8915('0x7'));var config=require(_0x8915('0x8'));var attributes=require('./schedule.attributes');module[_0x8915('0x9')]=function(_0x2adfeb,_0x3fee21){return _0x2adfeb[_0x8915('0xa')](_0x8915('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f08=['../../config/logger','api','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x4f08,0x10f));var _0x84f0=function(_0x16fb70,_0x3e97f1){_0x16fb70=_0x16fb70-0x0;var _0x2e1aa1=_0x4f08[_0x16fb70];return _0x2e1aa1;};'use strict';var _=require(_0x84f0('0x0'));var util=require(_0x84f0('0x1'));var logger=require(_0x84f0('0x2'))(_0x84f0('0x3'));var moment=require('moment');var BPromise=require(_0x84f0('0x4'));var rp=require(_0x84f0('0x5'));var fs=require('fs');var path=require(_0x84f0('0x6'));var rimraf=require(_0x84f0('0x7'));var config=require('../../config/environment');var attributes=require(_0x84f0('0x8'));module[_0x84f0('0x9')]=function(_0x117089,_0x271c2d){return _0x117089[_0x84f0('0xa')](_0x84f0('0xb'),attributes,{'tableName':_0x84f0('0xc'),'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 61a893e..d185c79 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 _0xc785=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','ioredis'];(function(_0x1a13c7,_0x590def){var _0x5bf588=function(_0x3604fb){while(--_0x3604fb){_0x1a13c7['push'](_0x1a13c7['shift']());}};_0x5bf588(++_0x590def);}(_0xc785,0xbc));var _0x5c78=function(_0xbbcd81,_0x4ae16e){_0xbbcd81=_0xbbcd81-0x0;var _0x5f7d4c=_0xc785[_0xbbcd81];return _0x5f7d4c;};'use strict';var _=require(_0x5c78('0x0'));var util=require(_0x5c78('0x1'));var moment=require(_0x5c78('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c78('0x3'));var db=require(_0x5c78('0x4'))['db'];var utils=require(_0x5c78('0x5'));var logger=require(_0x5c78('0x6'))(_0x5c78('0x7'));var config=require(_0x5c78('0x8'));var jayson=require(_0x5c78('0x9'));var client=jayson[_0x5c78('0xa')][_0x5c78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17308c,_0x8bf36f,_0x19a096){return new BPromise(function(_0x12019b,_0x55e4aa){return client['request'](_0x17308c,_0x19a096)[_0x5c78('0xc')](function(_0x4af369){logger[_0x5c78('0xd')](_0x5c78('0xe'),_0x8bf36f,'request\x20sent');logger[_0x5c78('0xf')](_0x5c78('0x10'),_0x8bf36f,'request\x20sent',JSON[_0x5c78('0x11')](_0x4af369));if(_0x4af369[_0x5c78('0x12')]){if(_0x4af369[_0x5c78('0x12')][_0x5c78('0x13')]===0x1f4){logger['error'](_0x5c78('0xe'),_0x8bf36f,_0x4af369[_0x5c78('0x12')]['message']);return _0x55e4aa(_0x4af369['error'][_0x5c78('0x14')]);}logger[_0x5c78('0x12')]('Schedule,\x20%s,\x20%s',_0x8bf36f,_0x4af369[_0x5c78('0x12')]['message']);return _0x12019b(_0x4af369[_0x5c78('0x12')][_0x5c78('0x14')]);}else{logger['info'](_0x5c78('0xe'),_0x8bf36f,_0x5c78('0x15'));_0x12019b(_0x4af369[_0x5c78('0x16')][_0x5c78('0x14')]);}})[_0x5c78('0x17')](function(_0x1e2e1f){logger[_0x5c78('0x12')]('Schedule,\x20%s,\x20%s',_0x8bf36f,_0x1e2e1f);_0x55e4aa(_0x1e2e1f);});});} \ No newline at end of file +var _0x5724=['request\x20sent','debug','stringify','error','message','catch','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Schedule,\x20%s,\x20%s'];(function(_0x1d6f78,_0x714918){var _0x1f335e=function(_0x1b8b19){while(--_0x1b8b19){_0x1d6f78['push'](_0x1d6f78['shift']());}};_0x1f335e(++_0x714918);}(_0x5724,0x1b6));var _0x4572=function(_0x50288c,_0x2b9a31){_0x50288c=_0x50288c-0x0;var _0x50de60=_0x5724[_0x50288c];return _0x50de60;};'use strict';var _=require(_0x4572('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4572('0x1'));var rs=require(_0x4572('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4572('0x3'));var logger=require(_0x4572('0x4'))(_0x4572('0x5'));var config=require(_0x4572('0x6'));var jayson=require(_0x4572('0x7'));var client=jayson['client'][_0x4572('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31f712,_0x18fa4c,_0x491126){return new BPromise(function(_0x5ec596,_0x2b7a72){return client[_0x4572('0x9')](_0x31f712,_0x491126)[_0x4572('0xa')](function(_0x2b24ea){logger['info'](_0x4572('0xb'),_0x18fa4c,_0x4572('0xc'));logger[_0x4572('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x18fa4c,'request\x20sent',JSON[_0x4572('0xe')](_0x2b24ea));if(_0x2b24ea[_0x4572('0xf')]){if(_0x2b24ea[_0x4572('0xf')]['code']===0x1f4){logger['error'](_0x4572('0xb'),_0x18fa4c,_0x2b24ea[_0x4572('0xf')]['message']);return _0x2b7a72(_0x2b24ea[_0x4572('0xf')][_0x4572('0x10')]);}logger[_0x4572('0xf')](_0x4572('0xb'),_0x18fa4c,_0x2b24ea[_0x4572('0xf')][_0x4572('0x10')]);return _0x5ec596(_0x2b24ea[_0x4572('0xf')][_0x4572('0x10')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x18fa4c,_0x4572('0xc'));_0x5ec596(_0x2b24ea['result'][_0x4572('0x10')]);}})[_0x4572('0x11')](function(_0x329783){logger[_0x4572('0xf')](_0x4572('0xb'),_0x18fa4c,_0x329783);_0x2b7a72(_0x329783);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8527348..5f1844b 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 _0xe16a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe','show','/:id/download','download','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x19924d,_0x5b11a5){var _0x2889c9=function(_0x335c69){while(--_0x335c69){_0x19924d['push'](_0x19924d['shift']());}};_0x2889c9(++_0x5b11a5);}(_0xe16a,0x11e));var _0xae16=function(_0x2d76cd,_0x1a07a3){_0x2d76cd=_0x2d76cd-0x0;var _0x4747c2=_0xe16a[_0x2d76cd];return _0x4747c2;};'use strict';var multer=require(_0xae16('0x0'));var util=require(_0xae16('0x1'));var path=require(_0xae16('0x2'));var timeout=require(_0xae16('0x3'));var express=require(_0xae16('0x4'));var router=express[_0xae16('0x5')]();var fs_extra=require(_0xae16('0x6'));var auth=require(_0xae16('0x7'));var interaction=require(_0xae16('0x8'));var config=require('../../config/environment');var controller=require(_0xae16('0x9'));router[_0xae16('0xa')]('/',auth[_0xae16('0xb')](),controller['index']);router[_0xae16('0xa')](_0xae16('0xc'),auth[_0xae16('0xb')](),controller['describe']);router[_0xae16('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xae16('0xd')]);router[_0xae16('0xa')](_0xae16('0xe'),auth[_0xae16('0xb')](),controller[_0xae16('0xf')]);router[_0xae16('0x10')]('/',auth['isAuthenticated'](),controller[_0xae16('0x11')]);router[_0xae16('0x12')]('/:id',auth[_0xae16('0xb')](),controller[_0xae16('0x13')]);router[_0xae16('0x14')](_0xae16('0x15'),auth[_0xae16('0xb')](),controller[_0xae16('0x16')]);module[_0xae16('0x17')]=router; \ No newline at end of file +var _0xae98=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','get','index','isAuthenticated','describe','show','/:id/download','download','post','create','put','/:id','delete','destroy','exports'];(function(_0x3cd93c,_0x44307b){var _0x2fc1cb=function(_0x4d753b){while(--_0x4d753b){_0x3cd93c['push'](_0x3cd93c['shift']());}};_0x2fc1cb(++_0x44307b);}(_0xae98,0x1e4));var _0x8ae9=function(_0x4504b9,_0x3659af){_0x4504b9=_0x4504b9-0x0;var _0x3bc27d=_0xae98[_0x4504b9];return _0x3bc27d;};'use strict';var multer=require(_0x8ae9('0x0'));var util=require('util');var path=require(_0x8ae9('0x1'));var timeout=require(_0x8ae9('0x2'));var express=require(_0x8ae9('0x3'));var router=express[_0x8ae9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8ae9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8ae9('0x6'));var controller=require(_0x8ae9('0x7'));router[_0x8ae9('0x8')]('/',auth['isAuthenticated'](),controller[_0x8ae9('0x9')]);router[_0x8ae9('0x8')]('/describe',auth[_0x8ae9('0xa')](),controller[_0x8ae9('0xb')]);router[_0x8ae9('0x8')]('/:id',auth[_0x8ae9('0xa')](),controller[_0x8ae9('0xc')]);router[_0x8ae9('0x8')](_0x8ae9('0xd'),auth[_0x8ae9('0xa')](),controller[_0x8ae9('0xe')]);router[_0x8ae9('0xf')]('/',auth[_0x8ae9('0xa')](),controller[_0x8ae9('0x10')]);router[_0x8ae9('0x11')](_0x8ae9('0x12'),auth[_0x8ae9('0xa')](),controller['update']);router[_0x8ae9('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8ae9('0x14')]);module[_0x8ae9('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index eb0441c..c50feec 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 _0x1681=['getDataValue','value','STRING','replace','INTEGER','setDataValue','subtract','duration','DATE','startedAt','format','toString','closedAt','createdAt','MM-DD-YYYY\x20HH:mm','path','../../config/environment','exports','VIRTUAL'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x1681,0x12c));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0x1168('0x0'));var config=require(_0x1168('0x1'));module[_0x1168('0x2')]={'format':{'type':Sequelize[_0x1168('0x3')],'get':function(){return this[_0x1168('0x4')](_0x1168('0x5'))?path['extname'](this['getDataValue'](_0x1168('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x1168('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x1168('0x6')],'set':function(_0x1d0634){var _0x5e6752=_0x1d0634[_0x1168('0x7')](/\\/g,'/');this['setDataValue'](_0x1168('0x5'),_0x5e6752);}},'rating':{'type':Sequelize[_0x1168('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x38096f){this[_0x1168('0x9')]('startedAt',moment()[_0x1168('0xa')](_0x38096f,'ms'));this[_0x1168('0x9')]('closedAt',moment());this['setDataValue'](_0x1168('0xb'),_0x38096f);}},'startedAt':{'type':Sequelize[_0x1168('0xc')],'get':function(){return moment(this[_0x1168('0x4')](_0x1168('0xd')))[_0x1168('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x1168('0xf')]();}},'closedAt':{'type':Sequelize[_0x1168('0xc')],'get':function(){return moment(this[_0x1168('0x4')](_0x1168('0x10')))[_0x1168('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x1168('0xf')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1168('0x4')](_0x1168('0x11')))['format'](_0x1168('0x12'))[_0x1168('0xf')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x1168('0x4')]('updatedAt'))[_0x1168('0xe')](_0x1168('0x12'))['toString']();}}}; \ No newline at end of file +var _0x6df9=['extname','value','STRING','replace','setDataValue','INTEGER','startedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','updatedAt','sequelize','moment','../../config/environment','getDataValue'];(function(_0x6a555d,_0x57335f){var _0x28020b=function(_0x3db4e5){while(--_0x3db4e5){_0x6a555d['push'](_0x6a555d['shift']());}};_0x28020b(++_0x57335f);}(_0x6df9,0x84));var _0x96df=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6df9[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x96df('0x0'));var moment=require(_0x96df('0x1'));var path=require('path');var config=require(_0x96df('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x96df('0x3')]('value')?path[_0x96df('0x4')](this['getDataValue'](_0x96df('0x5'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x96df('0x6')]},'value':{'type':Sequelize[_0x96df('0x6')],'set':function(_0x5cf09d){var _0x302764=_0x5cf09d[_0x96df('0x7')](/\\/g,'/');this[_0x96df('0x8')](_0x96df('0x5'),_0x302764);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x96df('0x9')],'set':function(_0x1df012){this['setDataValue'](_0x96df('0xa'),moment()['subtract'](_0x1df012,'ms'));this[_0x96df('0x8')]('closedAt',moment());this['setDataValue']('duration',_0x1df012);}},'startedAt':{'type':Sequelize[_0x96df('0xb')],'get':function(){return moment(this[_0x96df('0x3')](_0x96df('0xa')))[_0x96df('0xc')](_0x96df('0xd'))[_0x96df('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x96df('0x3')](_0x96df('0xf')))[_0x96df('0xc')](_0x96df('0xd'))[_0x96df('0xe')]();}},'createdAt':{'type':Sequelize[_0x96df('0xb')],'get':function(){return moment(this['getDataValue']('createdAt'))['format'](_0x96df('0xd'))[_0x96df('0xe')]();}},'updatedAt':{'type':Sequelize[_0x96df('0xb')],'get':function(){return moment(this[_0x96df('0x3')](_0x96df('0x10')))[_0x96df('0xc')](_0x96df('0xd'))[_0x96df('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index cd2b553..95b8d92 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 _0xac9d=['extname','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','root','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename'];(function(_0xe230f6,_0x506e40){var _0x3382b0=function(_0xcf8ce8){while(--_0xcf8ce8){_0xe230f6['push'](_0xe230f6['shift']());}};_0x3382b0(++_0x506e40);}(_0xac9d,0x14d));var _0xdac9=function(_0x34473f,_0x2b9c5c){_0x34473f=_0x34473f-0x0;var _0x25cf6f=_0xac9d[_0x34473f];return _0x25cf6f;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b')),[_0xdac9('0x35')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x170afd[_0xdac9('0x36')]);_0x3eed7a[_0xdac9('0x38')]=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a['query']);_0x4c4e21['attributes']=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],qs[_0xdac9('0x3a')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x3a')]));_0x4c4e21['attributes']=_0x4c4e21[_0xdac9('0x3b')]['length']?_0x4c4e21[_0xdac9('0x3b')]:_0x3eed7a[_0xdac9('0x33')];if(!_0x170afd['query'][_0xdac9('0x3c')]('nolimit')){_0x4c4e21['limit']=qs[_0xdac9('0x20')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x36')]['offset']);}_0x4c4e21[_0xdac9('0x3d')]=qs[_0xdac9('0x3e')](_0x170afd['query'][_0xdac9('0x3e')]);_0x4c4e21[_0xdac9('0x3f')]=qs[_0xdac9('0x38')](_[_0xdac9('0x40')](_0x170afd[_0xdac9('0x36')],_0x3eed7a[_0xdac9('0x38')]),_0x13efba);if(_0x170afd[_0xdac9('0x36')]['filter']){_0x4c4e21[_0xdac9('0x3f')]=_[_0xdac9('0x41')](_0x4c4e21[_0xdac9('0x3f')],{'$or':_['map'](_0x13efba,function(_0x9c732e){if(_0x9c732e[_0xdac9('0x31')]!==_0xdac9('0x42')){var _0x1d6f88={};_0x1d6f88[_0x9c732e['name']]={'$like':'%'+_0x170afd['query'][_0xdac9('0x43')]+'%'};return _0x1d6f88;}})});}_0x4c4e21=_[_0xdac9('0x41')]({},_0x4c4e21,_0x170afd[_0xdac9('0x44')]);var _0x260f0e={'where':_0x4c4e21[_0xdac9('0x3f')]};return db['ScreenRecording'][_0xdac9('0x21')](_0x260f0e)['then'](function(_0xd74baf){_0x3505c5[_0xdac9('0x21')]=_0xd74baf;if(_0x170afd[_0xdac9('0x36')][_0xdac9('0x45')]){_0x4c4e21[_0xdac9('0x46')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x47')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x11362d){_0x3505c5[_0xdac9('0x48')]=_0x11362d;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x49')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x4a')]=function(_0x441676,_0x5335ae){var _0x3857cf={'raw':![],'where':{'id':_0x441676['params']['id']}},_0x272b52={};_0x272b52[_0xdac9('0x33')]=_[_0xdac9('0x37')](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x272b52[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x441676['query']);_0x272b52[_0xdac9('0x38')]=_['intersection'](_0x272b52[_0xdac9('0x33')],_0x272b52[_0xdac9('0x36')]);_0x3857cf[_0xdac9('0x3b')]=_[_0xdac9('0x39')](_0x272b52['model'],qs['fields'](_0x441676['query'][_0xdac9('0x3a')]));_0x3857cf['attributes']=_0x3857cf['attributes'][_0xdac9('0x4b')]?_0x3857cf[_0xdac9('0x3b')]:_0x272b52['model'];if(_0x441676['query'][_0xdac9('0x45')]){_0x3857cf[_0xdac9('0x46')]=[{'all':!![]}];}_0x3857cf=_[_0xdac9('0x41')]({},_0x3857cf,_0x441676[_0xdac9('0x44')]);return db[_0xdac9('0x2e')][_0xdac9('0x4c')](_0x3857cf)[_0xdac9('0x26')](handleEntityNotFound(_0x5335ae,null))[_0xdac9('0x26')](respondWithResult(_0x5335ae,null))['catch'](handleError(_0x5335ae,null));};exports[_0xdac9('0x4d')]=function(_0x3bd946,_0xfa104f){return db[_0xdac9('0x2e')][_0xdac9('0x4d')](_0x3bd946[_0xdac9('0x4e')],{})[_0xdac9('0x26')](respondWithResult(_0xfa104f,0xc9))[_0xdac9('0x49')](handleError(_0xfa104f,null));};exports[_0xdac9('0x25')]=function(_0x242c24,_0x257e48){if(_0x242c24[_0xdac9('0x4e')]['id']){delete _0x242c24[_0xdac9('0x4e')]['id'];}delete _0x242c24[_0xdac9('0x4e')]['duration'];delete _0x242c24['body']['createdAt'];delete _0x242c24[_0xdac9('0x4e')][_0xdac9('0x4f')];delete _0x242c24['body'][_0xdac9('0x50')];return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':{'id':_0x242c24['params']['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x257e48,null))[_0xdac9('0x26')](saveUpdates(_0x242c24['body'],null))['then'](respondWithResult(_0x257e48,null))[_0xdac9('0x49')](handleError(_0x257e48,null));};exports[_0xdac9('0x51')]=function(_0x222de9,_0x370532){return db[_0xdac9('0x2e')][_0xdac9('0x51')]()[_0xdac9('0x26')](respondWithResult(_0x370532,null))[_0xdac9('0x49')](handleError(_0x370532,null));};exports[_0xdac9('0x52')]=function(_0x41579a,_0x10a2cc,_0x32b5f5){var _0xecb50a=require(_0xdac9('0x53'));var _0x35a378=![];var _0x5d0b43={};if(_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]&&_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]===_0xdac9('0x54')){_0x5d0b43[_0xdac9('0x54')]=_0x41579a['params']['id'];}else{_0x5d0b43['id']=_0x41579a[_0xdac9('0x55')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':_0x5d0b43,'attributes':['id',_0xdac9('0x50')],'raw':!![]})[_0xdac9('0x26')](handleEntityNotFound(_0x10a2cc,null))[_0xdac9('0x26')](function(_0x1eec39){if(_0x1eec39){var _0x243862=path[_0xdac9('0x56')](config['root'],_0xdac9('0x57'),_0x1eec39[_0xdac9('0x50')]);var _0x3cab26=util[_0xdac9('0x35')](_0xdac9('0x58'),_0x243862);if(fs[_0xdac9('0x59')](_0x3cab26)){_0x35a378=!![];return _0xecb50a['decryptFile'](_0x3cab26,_0x243862,config['secrets'][_0xdac9('0x5a')])[_0xdac9('0x26')](function(){return _0x1eec39;});}return _0x1eec39;}})[_0xdac9('0x26')](function(_0x46017d){if(_0x46017d){var _0x1c1f5f=path[_0xdac9('0x56')](config['root'],'server/files/screen_recordings',_0x46017d['value']);if(!fs[_0xdac9('0x59')](_0x1c1f5f)){throw new db[(_0xdac9('0x5b'))][(_0xdac9('0x5c'))](_0xdac9('0x5d'));}if(_0x46017d['filename']){return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,_0x46017d[_0xdac9('0x5e')]+path[_0xdac9('0x5f')](_0x1c1f5f),function(){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}else{return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,function(_0x496d9c){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}}})['catch'](function(_0x60b64e){if(_0x60b64e['message']===_0xdac9('0x5d')){_0x10a2cc[_0xdac9('0x1b')](0x194)[_0xdac9('0x61')](_0xdac9('0x62'));}else{return handleError(_0x10a2cc,null);}});};exports[_0xdac9('0x27')]=function(_0x40dec7,_0x232440){return db['ScreenRecording']['find']({'where':{'id':_0x40dec7['params']['id']}})[_0xdac9('0x26')](function(_0x42ba53){if(_[_0xdac9('0x63')](_0x42ba53)){throw new ReferenceError(_0xdac9('0x64'));}return _0x42ba53;})[_0xdac9('0x26')](function(_0x29df1d){var _0x288e7e=path['join'](config[_0xdac9('0x65')],'server/files/screen_recordings',_0x29df1d['value']);logger[_0xdac9('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x288e7e);if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')]('File:\x20\x22'+_0x288e7e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdac9('0x67')](_0x288e7e);}_0x288e7e=_0x288e7e+_0xdac9('0x68');if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')](_0xdac9('0x69')+_0x288e7e+_0xdac9('0x6a'));fs[_0xdac9('0x67')](_0x288e7e);}return _0x29df1d;})[_0xdac9('0x26')](function(_0xef4531){if(!_0xef4531)throw new InternalError();return _0xef4531[_0xdac9('0x27')]();})[_0xdac9('0x26')](function(){_0x232440[_0xdac9('0x1b')](0xcc)[_0xdac9('0x1c')]();})['catch'](handleError(_0x232440,null));}; \ No newline at end of file +var _0xa41a=['unlink','message','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','index','map','rawAttributes','type','key','differenceBy','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','params','include','find','catch','create','body','createdAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','secrets','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname'];(function(_0x22187c,_0x437fee){var _0x441234=function(_0x50905b){while(--_0x50905b){_0x22187c['push'](_0x22187c['shift']());}};_0x441234(++_0x437fee);}(_0xa41a,0x6b));var _0xaa41=function(_0x5bb5c2,_0x159f20){_0x5bb5c2=_0x5bb5c2-0x0;var _0x4cb77b=_0xa41a[_0x5bb5c2];return _0x4cb77b;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xcc;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0x19')](_0x518b5b);}return _0x1d0a54[_0xaa41('0x1a')](_0x518b5b)[_0xaa41('0x1b')]();};}function respondWithResult(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0xc8;return function(_0x1e9d7f){if(_0x1e9d7f){return _0x6f9ade[_0xaa41('0x1a')](_0x4eaf81)[_0xaa41('0x1c')](_0x1e9d7f);}};}function respondWithFilteredResult(_0x1ef7d9,_0x2a6988){return function(_0x2005ae){if(_0x2005ae){var _0x1e1e02=typeof _0x2a6988['offset']===_0xaa41('0x1d')&&typeof _0x2a6988[_0xaa41('0x1e')]===_0xaa41('0x1d');var _0x391b01=_0x2005ae[_0xaa41('0x1f')];var _0xd20ddf=_0x1e1e02?0x0:_0x2a6988[_0xaa41('0x20')];var _0x46e6d3=_0x1e1e02?_0x2005ae[_0xaa41('0x1f')]:_0x2a6988['offset']+_0x2a6988['limit'];var _0x1f502a;if(_0x46e6d3>=_0x391b01){_0x46e6d3=_0x391b01;_0x1f502a=0xc8;}else{_0x1f502a=0xce;}_0x1ef7d9[_0xaa41('0x1a')](_0x1f502a);return _0x1ef7d9[_0xaa41('0x21')]('Content-Range',_0xd20ddf+'-'+_0x46e6d3+'/'+_0x391b01)[_0xaa41('0x1c')](_0x2005ae);}return null;};}function patchUpdates(_0x1f692b){return function(_0x4e768e){try{jsonpatch['apply'](_0x4e768e,_0x1f692b,!![]);}catch(_0x1b1910){return BPromise['reject'](_0x1b1910);}return _0x4e768e[_0xaa41('0x22')]();};}function saveUpdates(_0x209c83,_0x3e2175){return function(_0x1f27f3){if(_0x1f27f3){return _0x1f27f3[_0xaa41('0x23')](_0x209c83)['then'](function(_0x43c430){return _0x43c430;});}return null;};}function removeEntity(_0x43a85c,_0x448a21){return function(_0x21f596){if(_0x21f596){return _0x21f596[_0xaa41('0x24')]()[_0xaa41('0x25')](function(){_0x43a85c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aec5,_0x527cac){return function(_0x493a10){if(!_0x493a10){_0x16aec5[_0xaa41('0x19')](0x194);}return _0x493a10;};}function handleError(_0x59707f,_0x536bed){_0x536bed=_0x536bed||0x1f4;return function(_0x2d0ac0){logger[_0xaa41('0x26')](_0x2d0ac0[_0xaa41('0x27')]);if(_0x2d0ac0[_0xaa41('0x28')]){delete _0x2d0ac0[_0xaa41('0x28')];}_0x59707f[_0xaa41('0x1a')](_0x536bed)['send'](_0x2d0ac0);};}exports[_0xaa41('0x29')]=function(_0x1f0275,_0x63c18c){var _0x9a16e3={},_0x1d8c2b={},_0x4466a3={'count':0x0,'rows':[]};var _0x30f88e=_[_0xaa41('0x2a')](db['ScreenRecording'][_0xaa41('0x2b')],function(_0x48b48b){return{'name':_0x48b48b['fieldName'],'type':_0x48b48b[_0xaa41('0x2c')][_0xaa41('0x2d')]};});_0x1d8c2b['model']=_[_0xaa41('0x2e')](_[_0xaa41('0x2a')](_0x30f88e,'name'),['format']);_0x1d8c2b['query']=_[_0xaa41('0x2f')](_0x1f0275[_0xaa41('0x30')]);_0x1d8c2b[_0xaa41('0x31')]=_[_0xaa41('0x32')](_0x1d8c2b['model'],_0x1d8c2b[_0xaa41('0x30')]);_0x9a16e3[_0xaa41('0x33')]=_[_0xaa41('0x32')](_0x1d8c2b['model'],qs[_0xaa41('0x34')](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x34')]));_0x9a16e3['attributes']=_0x9a16e3[_0xaa41('0x33')][_0xaa41('0x35')]?_0x9a16e3['attributes']:_0x1d8c2b[_0xaa41('0x36')];if(!_0x1f0275[_0xaa41('0x30')][_0xaa41('0x37')]('nolimit')){_0x9a16e3[_0xaa41('0x1e')]=qs['limit'](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x1e')]);_0x9a16e3[_0xaa41('0x20')]=qs['offset'](_0x1f0275['query']['offset']);}_0x9a16e3[_0xaa41('0x38')]=qs[_0xaa41('0x39')](_0x1f0275[_0xaa41('0x30')][_0xaa41('0x39')]);_0x9a16e3['where']=qs['filters'](_[_0xaa41('0x3a')](_0x1f0275[_0xaa41('0x30')],_0x1d8c2b[_0xaa41('0x31')]),_0x30f88e);if(_0x1f0275[_0xaa41('0x30')][_0xaa41('0x3b')]){_0x9a16e3[_0xaa41('0x3c')]=_[_0xaa41('0x3d')](_0x9a16e3['where'],{'$or':_[_0xaa41('0x2a')](_0x30f88e,function(_0x5cf689){if(_0x5cf689[_0xaa41('0x2c')]!==_0xaa41('0x3e')){var _0x57f1bf={};_0x57f1bf[_0x5cf689['name']]={'$like':'%'+_0x1f0275[_0xaa41('0x30')][_0xaa41('0x3b')]+'%'};return _0x57f1bf;}})});}_0x9a16e3=_['merge']({},_0x9a16e3,_0x1f0275[_0xaa41('0x3f')]);var _0x563687={'where':_0x9a16e3[_0xaa41('0x3c')]};return db[_0xaa41('0x40')][_0xaa41('0x1f')](_0x563687)[_0xaa41('0x25')](function(_0x3e6cac){_0x4466a3[_0xaa41('0x1f')]=_0x3e6cac;if(_0x1f0275[_0xaa41('0x30')][_0xaa41('0x41')]){_0x9a16e3['include']=[{'all':!![]}];}return db[_0xaa41('0x40')][_0xaa41('0x42')](_0x9a16e3);})[_0xaa41('0x25')](function(_0x398c35){_0x4466a3[_0xaa41('0x43')]=_0x398c35;return _0x4466a3;})[_0xaa41('0x25')](respondWithFilteredResult(_0x63c18c,_0x9a16e3))['catch'](handleError(_0x63c18c,null));};exports['show']=function(_0x87e2f4,_0x4f9086){var _0x1ed366={'raw':![],'where':{'id':_0x87e2f4[_0xaa41('0x44')]['id']}},_0x215896={};_0x215896[_0xaa41('0x36')]=_[_0xaa41('0x2f')](db[_0xaa41('0x40')][_0xaa41('0x2b')]);_0x215896['query']=_[_0xaa41('0x2f')](_0x87e2f4['query']);_0x215896['filters']=_[_0xaa41('0x32')](_0x215896['model'],_0x215896['query']);_0x1ed366['attributes']=_[_0xaa41('0x32')](_0x215896['model'],qs[_0xaa41('0x34')](_0x87e2f4[_0xaa41('0x30')]['fields']));_0x1ed366['attributes']=_0x1ed366[_0xaa41('0x33')][_0xaa41('0x35')]?_0x1ed366[_0xaa41('0x33')]:_0x215896[_0xaa41('0x36')];if(_0x87e2f4[_0xaa41('0x30')][_0xaa41('0x41')]){_0x1ed366[_0xaa41('0x45')]=[{'all':!![]}];}_0x1ed366=_[_0xaa41('0x3d')]({},_0x1ed366,_0x87e2f4[_0xaa41('0x3f')]);return db['ScreenRecording'][_0xaa41('0x46')](_0x1ed366)[_0xaa41('0x25')](handleEntityNotFound(_0x4f9086,null))[_0xaa41('0x25')](respondWithResult(_0x4f9086,null))[_0xaa41('0x47')](handleError(_0x4f9086,null));};exports[_0xaa41('0x48')]=function(_0x1d6112,_0x538b12){return db[_0xaa41('0x40')][_0xaa41('0x48')](_0x1d6112[_0xaa41('0x49')],{})[_0xaa41('0x25')](respondWithResult(_0x538b12,0xc9))['catch'](handleError(_0x538b12,null));};exports[_0xaa41('0x23')]=function(_0x5787f3,_0x49fedd){if(_0x5787f3[_0xaa41('0x49')]['id']){delete _0x5787f3[_0xaa41('0x49')]['id'];}delete _0x5787f3[_0xaa41('0x49')]['duration'];delete _0x5787f3[_0xaa41('0x49')][_0xaa41('0x4a')];delete _0x5787f3[_0xaa41('0x49')]['closedAt'];delete _0x5787f3[_0xaa41('0x49')][_0xaa41('0x4b')];return db[_0xaa41('0x40')][_0xaa41('0x46')]({'where':{'id':_0x5787f3[_0xaa41('0x44')]['id']}})[_0xaa41('0x25')](handleEntityNotFound(_0x49fedd,null))[_0xaa41('0x25')](saveUpdates(_0x5787f3[_0xaa41('0x49')],null))['then'](respondWithResult(_0x49fedd,null))[_0xaa41('0x47')](handleError(_0x49fedd,null));};exports['describe']=function(_0x5ae65e,_0x1bdcd6){return db[_0xaa41('0x40')][_0xaa41('0x4c')]()[_0xaa41('0x25')](respondWithResult(_0x1bdcd6,null))[_0xaa41('0x47')](handleError(_0x1bdcd6,null));};exports[_0xaa41('0x4d')]=function(_0x48c4c7,_0x3c5082,_0x519e39){var _0xecb54=require(_0xaa41('0x4e'));var _0x1d518f=![];var _0x4f9e92={};if(_0x48c4c7[_0xaa41('0x30')][_0xaa41('0x2c')]&&_0x48c4c7['query'][_0xaa41('0x2c')]===_0xaa41('0x4f')){_0x4f9e92[_0xaa41('0x4f')]=_0x48c4c7['params']['id'];}else{_0x4f9e92['id']=_0x48c4c7[_0xaa41('0x44')]['id'];}return db[_0xaa41('0x40')]['find']({'where':_0x4f9e92,'attributes':['id','value'],'raw':!![]})[_0xaa41('0x25')](handleEntityNotFound(_0x3c5082,null))[_0xaa41('0x25')](function(_0x3a29d2){if(_0x3a29d2){var _0x4d20c6=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x3a29d2[_0xaa41('0x4b')]);var _0x2abb78=util['format'](_0xaa41('0x53'),_0x4d20c6);if(fs['existsSync'](_0x2abb78)){_0x1d518f=!![];return _0xecb54['decryptFile'](_0x2abb78,_0x4d20c6,config[_0xaa41('0x54')]['recording'])[_0xaa41('0x25')](function(){return _0x3a29d2;});}return _0x3a29d2;}})[_0xaa41('0x25')](function(_0x169ddf){if(_0x169ddf){var _0x5e83e1=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x169ddf[_0xaa41('0x4b')]);if(!fs[_0xaa41('0x55')](_0x5e83e1)){throw new db[(_0xaa41('0x56'))][(_0xaa41('0x57'))](_0xaa41('0x58'));}if(_0x169ddf[_0xaa41('0x59')]){return _0x3c5082['download'](_0x5e83e1,_0x169ddf[_0xaa41('0x59')]+path[_0xaa41('0x5a')](_0x5e83e1),function(){if(_0x1d518f){fs[_0xaa41('0x5b')](_0x5e83e1);}});}else{return _0x3c5082['download'](_0x5e83e1,function(_0x3fe47a){if(_0x1d518f){fs[_0xaa41('0x5b')](_0x5e83e1);}});}}})[_0xaa41('0x47')](function(_0x134579){if(_0x134579[_0xaa41('0x5c')]===_0xaa41('0x58')){_0x3c5082[_0xaa41('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x3c5082,null);}});};exports['destroy']=function(_0x540325,_0x4ec357){return db['ScreenRecording'][_0xaa41('0x46')]({'where':{'id':_0x540325['params']['id']}})['then'](function(_0x24c6f3){if(_[_0xaa41('0x5d')](_0x24c6f3)){throw new ReferenceError(_0xaa41('0x5e'));}return _0x24c6f3;})[_0xaa41('0x25')](function(_0x5cabc4){var _0x244d41=path[_0xaa41('0x50')](config[_0xaa41('0x51')],_0xaa41('0x52'),_0x5cabc4[_0xaa41('0x4b')]);logger[_0xaa41('0x5f')](_0xaa41('0x60'),_0x244d41);if(!_[_0xaa41('0x5d')](_0x5cabc4[_0xaa41('0x4b')])&&fs['existsSync'](_0x244d41)){logger[_0xaa41('0x5f')](_0xaa41('0x61')+_0x244d41+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x244d41);}_0x244d41=_0x244d41+'.cypher';if(!_[_0xaa41('0x5d')](_0x5cabc4['value'])&&fs[_0xaa41('0x55')](_0x244d41)){logger['info'](_0xaa41('0x61')+_0x244d41+_0xaa41('0x62'));fs['unlinkSync'](_0x244d41);}return _0x5cabc4;})[_0xaa41('0x25')](function(_0x33efc5){if(!_0x33efc5)throw new InternalError();return _0x33efc5[_0xaa41('0x24')]();})[_0xaa41('0x25')](function(){_0x4ec357['status'](0xcc)['end']();})[_0xaa41('0x47')](handleError(_0x4ec357,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 8cbcad5..dacd690 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 _0xad35=['ScreenRecording','interactionid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x5e4a31,_0x2d2c4b){var _0x27eaaf=function(_0x43cd5e){while(--_0x43cd5e){_0x5e4a31['push'](_0x5e4a31['shift']());}};_0x27eaaf(++_0x2d2c4b);}(_0xad35,0xfe));var _0x5ad3=function(_0x213b32,_0x1c1bf5){_0x213b32=_0x213b32-0x0;var _0x4e6767=_0xad35[_0x213b32];return _0x4e6767;};'use strict';var _=require(_0x5ad3('0x0'));var util=require(_0x5ad3('0x1'));var logger=require(_0x5ad3('0x2'))(_0x5ad3('0x3'));var moment=require('moment');var BPromise=require(_0x5ad3('0x4'));var rp=require(_0x5ad3('0x5'));var fs=require('fs');var path=require(_0x5ad3('0x6'));var rimraf=require(_0x5ad3('0x7'));var config=require(_0x5ad3('0x8'));var attributes=require(_0x5ad3('0x9'));module['exports']=function(_0x344e02,_0x216c79){return _0x344e02['define'](_0x5ad3('0xa'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x5ad3('0xb'),'fields':[_0x5ad3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb00f=['interactionid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./screenRecording.attributes','exports','define','ScreenRecording'];(function(_0x9f50a5,_0x57242b){var _0x2bbde3=function(_0x3e3334){while(--_0x3e3334){_0x9f50a5['push'](_0x9f50a5['shift']());}};_0x2bbde3(++_0x57242b);}(_0xb00f,0x1bb));var _0xfb00=function(_0x1cdfc7,_0x423c10){_0x1cdfc7=_0x1cdfc7-0x0;var _0x292c56=_0xb00f[_0x1cdfc7];return _0x292c56;};'use strict';var _=require(_0xfb00('0x0'));var util=require('util');var logger=require(_0xfb00('0x1'))(_0xfb00('0x2'));var moment=require(_0xfb00('0x3'));var BPromise=require(_0xfb00('0x4'));var rp=require(_0xfb00('0x5'));var fs=require('fs');var path=require(_0xfb00('0x6'));var rimraf=require(_0xfb00('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb00('0x8'));module[_0xfb00('0x9')]=function(_0x3d3059,_0x44f66a){return _0x3d3059[_0xfb00('0xa')](_0xfb00('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xfb00('0xc'),'fields':[_0xfb00('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 6509d42..3695c48 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 _0xe45c=['then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0xe45c,0x164));var _0xce45=function(_0x1a3b62,_0x58cd31){_0x1a3b62=_0x1a3b62-0x0;var _0x26edab=_0xe45c[_0x1a3b62];return _0x26edab;};'use strict';var _=require(_0xce45('0x0'));var util=require('util');var moment=require(_0xce45('0x1'));var BPromise=require('bluebird');var rs=require(_0xce45('0x2'));var fs=require('fs');var Redis=require(_0xce45('0x3'));var db=require(_0xce45('0x4'))['db'];var utils=require(_0xce45('0x5'));var logger=require(_0xce45('0x6'))('rpc');var config=require(_0xce45('0x7'));var jayson=require(_0xce45('0x8'));var client=jayson[_0xce45('0x9')][_0xce45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x546bdc,_0x4237a1,_0x1baf96){return new BPromise(function(_0x17b458,_0x7ec422){return client[_0xce45('0xb')](_0x546bdc,_0x1baf96)[_0xce45('0xc')](function(_0x4cf612){logger[_0xce45('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x4237a1,_0xce45('0xe'));logger[_0xce45('0xf')](_0xce45('0x10'),_0x4237a1,_0xce45('0xe'),JSON['stringify'](_0x4cf612));if(_0x4cf612['error']){if(_0x4cf612[_0xce45('0x11')][_0xce45('0x12')]===0x1f4){logger[_0xce45('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4237a1,_0x4cf612[_0xce45('0x11')]['message']);return _0x7ec422(_0x4cf612[_0xce45('0x11')][_0xce45('0x13')]);}logger[_0xce45('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4237a1,_0x4cf612[_0xce45('0x11')][_0xce45('0x13')]);return _0x17b458(_0x4cf612[_0xce45('0x11')][_0xce45('0x13')]);}else{logger[_0xce45('0xd')](_0xce45('0x14'),_0x4237a1,_0xce45('0xe'));_0x17b458(_0x4cf612[_0xce45('0x15')][_0xce45('0x13')]);}})[_0xce45('0x16')](function(_0x27a5db){logger[_0xce45('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x4237a1,_0x27a5db);_0x7ec422(_0x27a5db);});});} \ No newline at end of file +var _0xe2e4=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xe2e4,0x102));var _0x4e2e=function(_0x60b4b5,_0x4b9f3c){_0x60b4b5=_0x60b4b5-0x0;var _0x5ce041=_0xe2e4[_0x60b4b5];return _0x5ce041;};'use strict';var _=require(_0x4e2e('0x0'));var util=require(_0x4e2e('0x1'));var moment=require(_0x4e2e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e2e('0x3'));var db=require(_0x4e2e('0x4'))['db'];var utils=require(_0x4e2e('0x5'));var logger=require(_0x4e2e('0x6'))(_0x4e2e('0x7'));var config=require('../../config/environment');var jayson=require(_0x4e2e('0x8'));var client=jayson[_0x4e2e('0x9')][_0x4e2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5aa270,_0x1d4f70,_0x327258){return new BPromise(function(_0xee48ad,_0x5ed194){return client[_0x4e2e('0xb')](_0x5aa270,_0x327258)[_0x4e2e('0xc')](function(_0x22fe76){logger[_0x4e2e('0xd')](_0x4e2e('0xe'),_0x1d4f70,_0x4e2e('0xf'));logger['debug']('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1d4f70,'request\x20sent',JSON[_0x4e2e('0x10')](_0x22fe76));if(_0x22fe76[_0x4e2e('0x11')]){if(_0x22fe76['error'][_0x4e2e('0x12')]===0x1f4){logger[_0x4e2e('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x1d4f70,_0x22fe76['error']['message']);return _0x5ed194(_0x22fe76['error']['message']);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x1d4f70,_0x22fe76[_0x4e2e('0x11')][_0x4e2e('0x13')]);return _0xee48ad(_0x22fe76[_0x4e2e('0x11')][_0x4e2e('0x13')]);}else{logger['info'](_0x4e2e('0xe'),_0x1d4f70,'request\x20sent');_0xee48ad(_0x22fe76[_0x4e2e('0x14')][_0x4e2e('0x13')]);}})[_0x4e2e('0x15')](function(_0x5031f0){logger[_0x4e2e('0x11')](_0x4e2e('0xe'),_0x1d4f70,_0x5031f0);_0x5ed194(_0x5031f0);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index e6c1a5a..674be02 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 _0xbe92=['single','file','addLogo','root','server/files/images/logos/','addLogoLogin','preferred','addPreferred','/:id/favicon','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getFavicon','diskStorage','join','format','%s%s','logo','extname','originalname','post'];(function(_0x40ff75,_0x7040dd){var _0x46e629=function(_0x50c700){while(--_0x50c700){_0x40ff75['push'](_0x40ff75['shift']());}};_0x46e629(++_0x7040dd);}(_0xbe92,0x139));var _0x2be9=function(_0x545a56,_0x4246c6){_0x545a56=_0x545a56-0x0;var _0xa82334=_0xbe92[_0x545a56];return _0xa82334;};'use strict';var multer=require('multer');var util=require(_0x2be9('0x0'));var path=require(_0x2be9('0x1'));var timeout=require(_0x2be9('0x2'));var express=require(_0x2be9('0x3'));var router=express[_0x2be9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2be9('0x5'));var interaction=require(_0x2be9('0x6'));var config=require(_0x2be9('0x7'));var controller=require(_0x2be9('0x8'));router[_0x2be9('0x9')]('/',auth[_0x2be9('0xa')](),controller[_0x2be9('0xb')]);router[_0x2be9('0x9')](_0x2be9('0xc'),controller[_0x2be9('0xd')]);router[_0x2be9('0x9')](_0x2be9('0xe'),controller[_0x2be9('0xf')]);router[_0x2be9('0x9')](_0x2be9('0x10'),controller[_0x2be9('0x11')]);router['get'](_0x2be9('0x12'),controller['getLogoLogin']);router['get'](_0x2be9('0x13'),controller[_0x2be9('0x14')]);router['get'](_0x2be9('0x15'),controller['getPreferred']);router['get']('/:id/favicon',controller[_0x2be9('0x16')]);var upload=multer({'storage':multer[_0x2be9('0x17')]({'destination':function(_0x20c444,_0x7bba89,_0x30e2d9){_0x30e2d9(null,path[_0x2be9('0x18')](config['root'],'server/files/images/logos/'));},'filename':function(_0x2e060e,_0x5039db,_0x4a91e8){_0x4a91e8(null,util[_0x2be9('0x19')](_0x2be9('0x1a'),_0x2be9('0x1b'),path[_0x2be9('0x1c')](_0x5039db[_0x2be9('0x1d')])));}})});router[_0x2be9('0x1e')](_0x2be9('0x10'),upload[_0x2be9('0x1f')](_0x2be9('0x20')),controller[_0x2be9('0x21')]);var upload=multer({'storage':multer[_0x2be9('0x17')]({'destination':function(_0x4ab87e,_0x125ef5,_0x2adf42){_0x2adf42(null,path['join'](config[_0x2be9('0x22')],_0x2be9('0x23')));},'filename':function(_0x1356ce,_0x219c74,_0x5735f5){_0x5735f5(null,util[_0x2be9('0x19')](_0x2be9('0x1a'),'logologin',path[_0x2be9('0x1c')](_0x219c74[_0x2be9('0x1d')])));}})});router['post']('/:id/logo_login',upload[_0x2be9('0x1f')](_0x2be9('0x20')),controller[_0x2be9('0x24')]);var upload=multer({'storage':multer[_0x2be9('0x17')]({'destination':function(_0x2b42c4,_0x251307,_0x1364b9){_0x1364b9(null,path['join'](config['root'],_0x2be9('0x23')));},'filename':function(_0x14be5c,_0x2adb60,_0x4f43bf){_0x4f43bf(null,util['format'](_0x2be9('0x1a'),_0x2be9('0x25'),path[_0x2be9('0x1c')](_0x2adb60[_0x2be9('0x1d')])));}})});router['post'](_0x2be9('0x15'),upload[_0x2be9('0x1f')](_0x2be9('0x20')),controller[_0x2be9('0x26')]);var upload=multer({'storage':multer[_0x2be9('0x17')]({'destination':function(_0x51b583,_0x1b8a44,_0x45c8af){_0x45c8af(null,path[_0x2be9('0x18')](config[_0x2be9('0x22')],_0x2be9('0x23')));},'filename':function(_0x310fc0,_0x2c061f,_0x3a612a){_0x3a612a(null,util['format'](_0x2be9('0x1a'),'favicon',path[_0x2be9('0x1c')](_0x2c061f[_0x2be9('0x1d')])));}})});router['post'](_0x2be9('0x27'),upload[_0x2be9('0x1f')](_0x2be9('0x20')),controller['addFavicon']);router[_0x2be9('0x28')]('/:id',auth[_0x2be9('0xa')](),controller[_0x2be9('0x29')]);module[_0x2be9('0x2a')]=router; \ No newline at end of file +var _0x87f1=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','/:id/favicon','join','root','format','%s%s','extname','originalname','post','addLogo','diskStorage','server/files/images/logos/','logologin','file','addLogoLogin','single','addPreferred','favicon','addFavicon','put','isAuthenticated','update'];(function(_0x4a7134,_0x45eafc){var _0x81421f=function(_0x6229b1){while(--_0x6229b1){_0x4a7134['push'](_0x4a7134['shift']());}};_0x81421f(++_0x45eafc);}(_0x87f1,0xf7));var _0x187f=function(_0xe61a7a,_0x1a681f){_0xe61a7a=_0xe61a7a-0x0;var _0x5bf20c=_0x87f1[_0xe61a7a];return _0x5bf20c;};'use strict';var multer=require(_0x187f('0x0'));var util=require(_0x187f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x187f('0x2'));var router=express[_0x187f('0x3')]();var fs_extra=require(_0x187f('0x4'));var auth=require(_0x187f('0x5'));var interaction=require(_0x187f('0x6'));var config=require(_0x187f('0x7'));var controller=require(_0x187f('0x8'));router[_0x187f('0x9')]('/',auth['isAuthenticated'](),controller[_0x187f('0xa')]);router[_0x187f('0x9')]('/now',controller['getDate']);router[_0x187f('0x9')](_0x187f('0xb'),controller[_0x187f('0xc')]);router[_0x187f('0x9')](_0x187f('0xd'),controller[_0x187f('0xe')]);router[_0x187f('0x9')](_0x187f('0xf'),controller[_0x187f('0x10')]);router[_0x187f('0x9')]('/:id/gdpr',controller[_0x187f('0x11')]);router[_0x187f('0x9')](_0x187f('0x12'),controller['getPreferred']);router['get'](_0x187f('0x13'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x609634,_0x464d86,_0x2b8443){_0x2b8443(null,path[_0x187f('0x14')](config[_0x187f('0x15')],'server/files/images/logos/'));},'filename':function(_0x4f13b0,_0x2452f8,_0xa19b3f){_0xa19b3f(null,util[_0x187f('0x16')](_0x187f('0x17'),'logo',path[_0x187f('0x18')](_0x2452f8[_0x187f('0x19')])));}})});router[_0x187f('0x1a')](_0x187f('0xd'),upload['single']('file'),controller[_0x187f('0x1b')]);var upload=multer({'storage':multer[_0x187f('0x1c')]({'destination':function(_0x46d59e,_0x469d26,_0x29d230){_0x29d230(null,path[_0x187f('0x14')](config[_0x187f('0x15')],_0x187f('0x1d')));},'filename':function(_0x25dd15,_0xd1ae86,_0x120a6c){_0x120a6c(null,util['format']('%s%s',_0x187f('0x1e'),path[_0x187f('0x18')](_0xd1ae86[_0x187f('0x19')])));}})});router[_0x187f('0x1a')](_0x187f('0xf'),upload['single'](_0x187f('0x1f')),controller[_0x187f('0x20')]);var upload=multer({'storage':multer[_0x187f('0x1c')]({'destination':function(_0x438fd5,_0xaaf8fd,_0x3da8b3){_0x3da8b3(null,path[_0x187f('0x14')](config[_0x187f('0x15')],'server/files/images/logos/'));},'filename':function(_0x155b7f,_0x414a1f,_0x3a2a7f){_0x3a2a7f(null,util[_0x187f('0x16')](_0x187f('0x17'),'preferred',path[_0x187f('0x18')](_0x414a1f[_0x187f('0x19')])));}})});router[_0x187f('0x1a')]('/:id/preferred',upload[_0x187f('0x21')]('file'),controller[_0x187f('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x62e767,_0x5cb80d,_0x36fef0){_0x36fef0(null,path[_0x187f('0x14')](config[_0x187f('0x15')],'server/files/images/logos/'));},'filename':function(_0x125be0,_0x5b79a0,_0x1480a8){_0x1480a8(null,util[_0x187f('0x16')](_0x187f('0x17'),_0x187f('0x23'),path['extname'](_0x5b79a0[_0x187f('0x19')])));}})});router[_0x187f('0x1a')](_0x187f('0x13'),upload[_0x187f('0x21')](_0x187f('0x1f')),controller[_0x187f('0x24')]);router[_0x187f('0x25')](_0x187f('0xb'),auth[_0x187f('0x26')](),controller[_0x187f('0x27')]);module[_0x187f('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 277b445..87273ec 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(_0x5479a9,_0x48805f){var _0x2745b6=function(_0x2b4ee0){while(--_0x2b4ee0){_0x5479a9['push'](_0x5479a9['shift']());}};_0x2745b6(++_0x48805f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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(_0x2fc3e2,_0x58af38){var _0x3006cc=function(_0x95cf12){while(--_0x95cf12){_0x2fc3e2['push'](_0x2fc3e2['shift']());}};_0x3006cc(++_0x58af38);}(_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')]={'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 9cc690f..0b902ef 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 _0x9649=['attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join','upperFirst','default_logo.svg','Sequelize','\x20not\x20found','download','getLogoLogin','preferred','default_loginLogo.svg','default','gdpr','securePassword','addPreferred','getPreferred','defaultFavicon','default_preferred.png','ValidationError','getFavicon','custom','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','undefined','count','offset','limit','apply','reject','save','update','destroy','then','stack','name','map','Setting','rawAttributes','type','key','model','keys','query','filters','intersection'];(function(_0x271db0,_0x41252a){var _0x368781=function(_0x312311){while(--_0x312311){_0x271db0['push'](_0x271db0['shift']());}};_0x368781(++_0x41252a);}(_0x9649,0x19f));var _0x9964=function(_0x367312,_0x2987f7){_0x367312=_0x367312-0x0;var _0x56948f=_0x9649[_0x367312];return _0x56948f;};'use strict';var emlformat=require(_0x9964('0x0'));var rimraf=require(_0x9964('0x1'));var zipdir=require(_0x9964('0x2'));var jsonpatch=require(_0x9964('0x3'));var rp=require('request-promise');var moment=require(_0x9964('0x4'));var BPromise=require(_0x9964('0x5'));var Mustache=require('mustache');var util=require(_0x9964('0x6'));var path=require('path');var sox=require(_0x9964('0x7'));var csv=require(_0x9964('0x8'));var ejs=require(_0x9964('0x9'));var fs=require('fs');var fs_extra=require(_0x9964('0xa'));var _=require(_0x9964('0xb'));var squel=require(_0x9964('0xc'));var crypto=require(_0x9964('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9964('0xe'));var toCsv=require(_0x9964('0x8'));var querystring=require('querystring');var Papa=require(_0x9964('0xf'));var Redis=require(_0x9964('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9964('0x11'));var hardwareService=require(_0x9964('0x12'));var logger=require(_0x9964('0x13'))(_0x9964('0x14'));var utils=require(_0x9964('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9964('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9964('0x17'));var client=jayson[_0x9964('0x18')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15414d,_0x39ef74,_0x5aa1a8,_0x1fd4b4){return new BPromise(function(_0x463dbf,_0x11dfc9){var _0x46688a=_0x1fd4b4||client;return _0x46688a[_0x9964('0x19')](_0x15414d,_0x5aa1a8)['then'](function(_0x411544){logger[_0x9964('0x1a')]('Setting,\x20%s,\x20%s',_0x39ef74,_0x9964('0x1b'));logger[_0x9964('0x1c')]('Setting,\x20%s,\x20%s,\x20%s',_0x39ef74,_0x9964('0x1b'),JSON[_0x9964('0x1d')](_0x411544));if(_0x411544[_0x9964('0x1e')]){if(_0x411544[_0x9964('0x1e')]['code']===0x1f4){logger[_0x9964('0x1e')](_0x9964('0x1f'),_0x39ef74,_0x411544['error'][_0x9964('0x20')]);return _0x11dfc9(_0x411544[_0x9964('0x1e')][_0x9964('0x20')]);}logger[_0x9964('0x1e')](_0x9964('0x1f'),_0x39ef74,_0x411544[_0x9964('0x1e')][_0x9964('0x20')]);return _0x463dbf(_0x411544[_0x9964('0x1e')][_0x9964('0x20')]);}else{logger[_0x9964('0x1a')]('Setting,\x20%s,\x20%s',_0x39ef74,_0x9964('0x1b'));_0x463dbf(_0x411544[_0x9964('0x21')]['message']);}})[_0x9964('0x22')](function(_0x47912c){logger[_0x9964('0x1e')](_0x9964('0x1f'),_0x39ef74,_0x47912c);_0x11dfc9(_0x47912c);});});}function respondWithStatusCode(_0x1c5e34,_0x167525){_0x167525=_0x167525||0xcc;return function(_0x2d049c){if(_0x2d049c){return _0x1c5e34[_0x9964('0x23')](_0x167525);}return _0x1c5e34['status'](_0x167525)[_0x9964('0x24')]();};}function respondWithResult(_0x378e34,_0x5961e9){_0x5961e9=_0x5961e9||0xc8;return function(_0x1b05a8){if(_0x1b05a8){return _0x378e34[_0x9964('0x25')](_0x5961e9)[_0x9964('0x26')](_0x1b05a8);}};}function respondWithFilteredResult(_0x1399e0,_0x26cd95){return function(_0x5a5793){if(_0x5a5793){var _0x13df3d=typeof _0x26cd95['offset']===_0x9964('0x27')&&typeof _0x26cd95['limit']===_0x9964('0x27');var _0x5dc789=_0x5a5793[_0x9964('0x28')];var _0x162b83=_0x13df3d?0x0:_0x26cd95[_0x9964('0x29')];var _0x44a38f=_0x13df3d?_0x5a5793[_0x9964('0x28')]:_0x26cd95[_0x9964('0x29')]+_0x26cd95[_0x9964('0x2a')];var _0x2f6068;if(_0x44a38f>=_0x5dc789){_0x44a38f=_0x5dc789;_0x2f6068=0xc8;}else{_0x2f6068=0xce;}_0x1399e0[_0x9964('0x25')](_0x2f6068);return _0x1399e0['set']('Content-Range',_0x162b83+'-'+_0x44a38f+'/'+_0x5dc789)['json'](_0x5a5793);}return null;};}function patchUpdates(_0x483092){return function(_0x36220b){try{jsonpatch[_0x9964('0x2b')](_0x36220b,_0x483092,!![]);}catch(_0x4efb43){return BPromise[_0x9964('0x2c')](_0x4efb43);}return _0x36220b[_0x9964('0x2d')]();};}function saveUpdates(_0x3092b2,_0x17a244){return function(_0x9d4eaf){if(_0x9d4eaf){return _0x9d4eaf[_0x9964('0x2e')](_0x3092b2)['then'](function(_0x5f8cda){return _0x5f8cda;});}return null;};}function removeEntity(_0x2eae45,_0x59ab78){return function(_0xbd2537){if(_0xbd2537){return _0xbd2537[_0x9964('0x2f')]()[_0x9964('0x30')](function(){_0x2eae45[_0x9964('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b7a0,_0x445be2){return function(_0x4e517c){if(!_0x4e517c){_0x55b7a0['sendStatus'](0x194);}return _0x4e517c;};}function handleError(_0x193c9a,_0xca41d2){_0xca41d2=_0xca41d2||0x1f4;return function(_0x5d28d8){logger['error'](_0x5d28d8[_0x9964('0x31')]);if(_0x5d28d8[_0x9964('0x32')]){delete _0x5d28d8['name'];}_0x193c9a[_0x9964('0x25')](_0xca41d2)['send'](_0x5d28d8);};}exports['index']=function(_0x57f4ff,_0x469813){var _0x36626c={},_0x168f41={},_0x1df24e={'count':0x0,'rows':[]};var _0x2cdbbc=_[_0x9964('0x33')](db[_0x9964('0x34')][_0x9964('0x35')],function(_0x131073){return{'name':_0x131073['fieldName'],'type':_0x131073[_0x9964('0x36')][_0x9964('0x37')]};});_0x168f41[_0x9964('0x38')]=_[_0x9964('0x33')](_0x2cdbbc,'name');_0x168f41['query']=_[_0x9964('0x39')](_0x57f4ff[_0x9964('0x3a')]);_0x168f41[_0x9964('0x3b')]=_[_0x9964('0x3c')](_0x168f41[_0x9964('0x38')],_0x168f41['query']);_0x36626c[_0x9964('0x3d')]=_[_0x9964('0x3c')](_0x168f41[_0x9964('0x38')],qs[_0x9964('0x3e')](_0x57f4ff[_0x9964('0x3a')][_0x9964('0x3e')]));_0x36626c[_0x9964('0x3d')]=_0x36626c[_0x9964('0x3d')][_0x9964('0x3f')]?_0x36626c[_0x9964('0x3d')]:_0x168f41[_0x9964('0x38')];if(!_0x57f4ff[_0x9964('0x3a')][_0x9964('0x40')](_0x9964('0x41'))){_0x36626c[_0x9964('0x2a')]=qs[_0x9964('0x2a')](_0x57f4ff['query'][_0x9964('0x2a')]);_0x36626c['offset']=qs[_0x9964('0x29')](_0x57f4ff[_0x9964('0x3a')][_0x9964('0x29')]);}_0x36626c['order']=qs[_0x9964('0x42')](_0x57f4ff['query'][_0x9964('0x42')]);_0x36626c['where']=qs[_0x9964('0x3b')](_[_0x9964('0x43')](_0x57f4ff[_0x9964('0x3a')],_0x168f41[_0x9964('0x3b')]),_0x2cdbbc);if(_0x57f4ff[_0x9964('0x3a')][_0x9964('0x44')]){_0x36626c[_0x9964('0x45')]=_[_0x9964('0x46')](_0x36626c['where'],{'$or':_[_0x9964('0x33')](_0x2cdbbc,function(_0x3d236e){if(_0x3d236e[_0x9964('0x36')]!==_0x9964('0x47')){var _0xcce717={};_0xcce717[_0x3d236e[_0x9964('0x32')]]={'$like':'%'+_0x57f4ff[_0x9964('0x3a')][_0x9964('0x44')]+'%'};return _0xcce717;}})});}_0x36626c=_[_0x9964('0x46')]({},_0x36626c,_0x57f4ff[_0x9964('0x48')]);var _0x5acdc5={'where':_0x36626c['where']};return db[_0x9964('0x34')]['count'](_0x5acdc5)[_0x9964('0x30')](function(_0x53c6a8){_0x1df24e['count']=_0x53c6a8;if(_0x57f4ff['query'][_0x9964('0x49')]){_0x36626c[_0x9964('0x4a')]=[{'all':!![]}];}return db[_0x9964('0x34')]['findAll'](_0x36626c);})['then'](function(_0x652882){_0x1df24e['rows']=_0x652882;return _0x1df24e;})[_0x9964('0x30')](respondWithFilteredResult(_0x469813,_0x36626c))[_0x9964('0x22')](handleError(_0x469813,null));};exports[_0x9964('0x4b')]=function(_0x1d8192,_0x41c9ff){var _0x5b0fa7={'raw':![],'where':{'id':_0x1d8192[_0x9964('0x4c')]['id']}},_0x521d03={};_0x521d03[_0x9964('0x38')]=_[_0x9964('0x39')](db[_0x9964('0x34')][_0x9964('0x35')]);_0x521d03['query']=_[_0x9964('0x39')](_0x1d8192[_0x9964('0x3a')]);_0x521d03[_0x9964('0x3b')]=_['intersection'](_0x521d03[_0x9964('0x38')],_0x521d03[_0x9964('0x3a')]);_0x5b0fa7[_0x9964('0x3d')]=_[_0x9964('0x3c')](_0x521d03[_0x9964('0x38')],qs[_0x9964('0x3e')](_0x1d8192[_0x9964('0x3a')][_0x9964('0x3e')]));_0x5b0fa7['attributes']=_0x5b0fa7[_0x9964('0x3d')]['length']?_0x5b0fa7['attributes']:_0x521d03[_0x9964('0x38')];if(_0x1d8192['query'][_0x9964('0x49')]){_0x5b0fa7[_0x9964('0x4a')]=[{'all':!![]}];}_0x5b0fa7=_[_0x9964('0x46')]({},_0x5b0fa7,_0x1d8192['options']);return db[_0x9964('0x34')][_0x9964('0x4d')](_0x5b0fa7)[_0x9964('0x30')](handleEntityNotFound(_0x41c9ff,null))[_0x9964('0x30')](respondWithResult(_0x41c9ff,null))[_0x9964('0x22')](handleError(_0x41c9ff,null));};exports[_0x9964('0x2e')]=function(_0x25db0d,_0x33f359){if(_0x25db0d[_0x9964('0x4e')]['id']){delete _0x25db0d['body']['id'];}return db[_0x9964('0x34')]['find']({'where':{'id':_0x25db0d[_0x9964('0x4c')]['id']}})[_0x9964('0x30')](handleEntityNotFound(_0x33f359,null))[_0x9964('0x30')](saveUpdates(_0x25db0d['body'],null))[_0x9964('0x30')](respondWithResult(_0x33f359,null))[_0x9964('0x22')](handleError(_0x33f359,null));};exports[_0x9964('0x4f')]=function(_0x375ad6,_0xaf7e23,_0x4b1571){if(_0x375ad6[_0x9964('0x50')]&&_0x375ad6[_0x9964('0x50')][_0x9964('0x51')]){_0x375ad6[_0x9964('0x4e')][_0x9964('0x52')]=_0x375ad6['file']['filename'];}return db['Setting']['find']({'where':{'id':_0x375ad6[_0x9964('0x4c')]['id']}})['then'](handleEntityNotFound(_0xaf7e23,null))['then'](saveUpdates(_0x375ad6['body'],null))[_0x9964('0x30')](respondWithResult(_0xaf7e23,null))['catch'](handleError(_0xaf7e23,null));};exports[_0x9964('0x53')]=function(_0x1cc5e4,_0x464ab1,_0x4e0316){if(_0x1cc5e4[_0x9964('0x50')]&&_0x1cc5e4['file']['filename']){_0x1cc5e4[_0x9964('0x4e')][_0x9964('0x54')]=_0x1cc5e4[_0x9964('0x50')]['filename'];}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x1cc5e4[_0x9964('0x4c')]['id']}})['then'](handleEntityNotFound(_0x464ab1,null))[_0x9964('0x30')](saveUpdates(_0x1cc5e4[_0x9964('0x4e')],null))[_0x9964('0x30')](respondWithResult(_0x464ab1,null))['catch'](handleError(_0x464ab1,null));};var utilLicense=require('../../config/license/util');exports[_0x9964('0x55')]=function(_0x471b8f,_0x34fe6e,_0x1d7a9a){var _0x3001d7=_0x9964('0x56');var _0x2e3870={'custom':![]};return utilLicense[_0x9964('0x57')]()[_0x9964('0x30')](function(_0x37d2ec){if(_0x37d2ec){_0x2e3870=_0x37d2ec;}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x471b8f[_0x9964('0x4c')]['id']},'attributes':[_0x9964('0x52'),_0x9964('0x54'),'preferred',_0x9964('0x58'),_0x9964('0x59'),_0x9964('0x5a'),_0x9964('0x5b'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x34fe6e,null))['then'](function(_0x4ad690){if(_0x4ad690){var _0x4e374e=_0x4ad690[_0x9964('0x52')]&&fs[_0x9964('0x5c')](path['join'](config[_0x9964('0x5d')],_0x3001d7,_[_0x9964('0x5e')](_0x4ad690[_0x9964('0x52')])))?path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x3001d7,_['toLower'](_0x4ad690[_0x9964('0x52')])):path[_0x9964('0x5f')](config['root'],_0x3001d7,_[_0x9964('0x5e')]('default_logo.svg'));var _0x27a396='default'+_[_0x9964('0x60')](_0x9964('0x52'));if(_0x4ad690[_0x27a396]||!_0x2e3870['custom']){_0x4e374e=path[_0x9964('0x5f')](config['root'],_0x3001d7,_['toLower'](_0x9964('0x61')));}if(!fs['existsSync'](_0x4e374e)){throw new db[(_0x9964('0x62'))]['ValidationError'](_[_0x9964('0x60')]('logo')+_0x9964('0x63'));}return _0x34fe6e[_0x9964('0x64')](_0x4e374e);}})[_0x9964('0x22')](handleError(_0x34fe6e,null));};var utilLicense=require(_0x9964('0x16'));exports[_0x9964('0x65')]=function(_0x145086,_0x4a53b1,_0x32c5a7){var _0x2d90c9=_0x9964('0x56');var _0x5800ea={'custom':![]};return utilLicense[_0x9964('0x57')]()[_0x9964('0x30')](function(_0x35d32b){if(_0x35d32b){_0x5800ea=_0x35d32b;}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x145086[_0x9964('0x4c')]['id']},'attributes':[_0x9964('0x52'),_0x9964('0x54'),_0x9964('0x66'),_0x9964('0x58'),_0x9964('0x59'),'defaultLoginLogo',_0x9964('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x9964('0x30')](handleEntityNotFound(_0x4a53b1,null))[_0x9964('0x30')](function(_0x19fbef){if(_0x19fbef){var _0xcb9b08=_0x19fbef['loginLogo']&&fs[_0x9964('0x5c')](path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x2d90c9,_[_0x9964('0x5e')](_0x19fbef[_0x9964('0x54')])))?path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x2d90c9,_[_0x9964('0x5e')](_0x19fbef[_0x9964('0x54')])):path[_0x9964('0x5f')](config['root'],_0x2d90c9,_[_0x9964('0x5e')](_0x9964('0x67')));var _0xc45929=_0x9964('0x68')+_[_0x9964('0x60')](_0x9964('0x54'));if(_0x19fbef[_0xc45929]||!_0x5800ea['custom']){_0xcb9b08=path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x2d90c9,_[_0x9964('0x5e')](_0x9964('0x67')));}if(!fs['existsSync'](_0xcb9b08)){throw new db['Sequelize']['ValidationError'](_[_0x9964('0x60')](_0x9964('0x54'))+'\x20not\x20found');}return _0x4a53b1[_0x9964('0x64')](_0xcb9b08);}})[_0x9964('0x22')](handleError(_0x4a53b1,null));};exports[_0x9964('0x69')]=function(_0x49cff4,_0x379ada){return db[_0x9964('0x34')]['find']({'where':{'id':_0x49cff4[_0x9964('0x4c')]['id']},'attributes':[_0x9964('0x6a')]})['then'](respondWithResult(_0x379ada,null))[_0x9964('0x22')](handleError(_0x379ada,null));};exports[_0x9964('0x6b')]=function(_0x16df9f,_0x34c85e,_0x2a94a3){if(_0x16df9f['file']&&_0x16df9f[_0x9964('0x50')]['filename']){_0x16df9f[_0x9964('0x4e')][_0x9964('0x66')]=_0x16df9f['file'][_0x9964('0x51')];}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x16df9f[_0x9964('0x4c')]['id']}})['then'](handleEntityNotFound(_0x34c85e,null))[_0x9964('0x30')](saveUpdates(_0x16df9f[_0x9964('0x4e')],null))[_0x9964('0x30')](respondWithResult(_0x34c85e,null))[_0x9964('0x22')](handleError(_0x34c85e,null));};var utilLicense=require(_0x9964('0x16'));exports[_0x9964('0x6c')]=function(_0x128882,_0x11dce5,_0x41200c){var _0x224f60=_0x9964('0x56');var _0x16b018={'custom':![]};return utilLicense['getLicense']()[_0x9964('0x30')](function(_0x56e3bf){if(_0x56e3bf){_0x16b018=_0x56e3bf;}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x128882['params']['id']},'attributes':[_0x9964('0x52'),_0x9964('0x54'),_0x9964('0x66'),_0x9964('0x58'),_0x9964('0x59'),_0x9964('0x5a'),_0x9964('0x5b'),_0x9964('0x6d')],'raw':!![]});})['then'](handleEntityNotFound(_0x11dce5,null))[_0x9964('0x30')](function(_0x14e6e8){if(_0x14e6e8){var _0x342d35=_0x14e6e8['preferred']&&fs[_0x9964('0x5c')](path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x224f60,_['toLower'](_0x14e6e8[_0x9964('0x66')])))?path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x224f60,_[_0x9964('0x5e')](_0x14e6e8[_0x9964('0x66')])):path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x224f60,_[_0x9964('0x5e')](_0x9964('0x6e')));var _0x5cf819=_0x9964('0x68')+_[_0x9964('0x60')](_0x9964('0x66'));if(_0x14e6e8[_0x5cf819]||!_0x16b018['custom']||!_0x16b018[_0x9964('0x66')]){_0x342d35=path['join'](config[_0x9964('0x5d')],_0x224f60,_[_0x9964('0x5e')](_0x9964('0x6e')));}if(!fs['existsSync'](_0x342d35)){throw new db[(_0x9964('0x62'))][(_0x9964('0x6f'))](_[_0x9964('0x60')]('preferred')+_0x9964('0x63'));}return _0x11dce5[_0x9964('0x64')](_0x342d35);}})[_0x9964('0x22')](handleError(_0x11dce5,null));};exports['addFavicon']=function(_0x14db69,_0x22e298,_0x1bdedf){if(_0x14db69['file']&&_0x14db69[_0x9964('0x50')][_0x9964('0x51')]){_0x14db69[_0x9964('0x4e')]['favicon']=_0x14db69[_0x9964('0x50')][_0x9964('0x51')];}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0x14db69[_0x9964('0x4c')]['id']}})[_0x9964('0x30')](handleEntityNotFound(_0x22e298,null))['then'](saveUpdates(_0x14db69[_0x9964('0x4e')],null))[_0x9964('0x30')](respondWithResult(_0x22e298,null))[_0x9964('0x22')](handleError(_0x22e298,null));};var utilLicense=require(_0x9964('0x16'));exports[_0x9964('0x70')]=function(_0xc3da2e,_0x233fac,_0x5e2b2f){var _0x26e9de=_0x9964('0x56');var _0x1570fc={'custom':![]};return utilLicense[_0x9964('0x57')]()[_0x9964('0x30')](function(_0x49ff89){if(_0x49ff89){_0x1570fc=_0x49ff89;}return db[_0x9964('0x34')][_0x9964('0x4d')]({'where':{'id':_0xc3da2e[_0x9964('0x4c')]['id']},'attributes':[_0x9964('0x52'),'loginLogo','preferred','favicon','defaultLogo',_0x9964('0x5a'),_0x9964('0x5b'),_0x9964('0x6d')],'raw':!![]});})[_0x9964('0x30')](handleEntityNotFound(_0x233fac,null))[_0x9964('0x30')](function(_0xf61611){if(_0xf61611){var _0x9f6bcf=_0xf61611['favicon']&&fs['existsSync'](path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x26e9de,_[_0x9964('0x5e')](_0xf61611[_0x9964('0x58')])))?path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x26e9de,_[_0x9964('0x5e')](_0xf61611['favicon'])):path['join'](config['root'],_0x26e9de,_['toLower']('default_favicon.ico'));var _0x4783a5=_0x9964('0x68')+_[_0x9964('0x60')](_0x9964('0x58'));if(_0xf61611[_0x4783a5]||!_0x1570fc[_0x9964('0x71')]){_0x9f6bcf=path[_0x9964('0x5f')](config[_0x9964('0x5d')],_0x26e9de,_[_0x9964('0x5e')]('default_favicon.ico'));}if(!fs[_0x9964('0x5c')](_0x9f6bcf)){throw new db['Sequelize'][(_0x9964('0x6f'))](_[_0x9964('0x60')](_0x9964('0x58'))+'\x20not\x20found');}return _0x233fac[_0x9964('0x64')](_0x9f6bcf);}})['catch'](handleError(_0x233fac,null));};exports[_0x9964('0x72')]=function(_0x2c2d39,_0x2b8be7){var _0xd7906f={'offset':moment()[_0x9964('0x73')]()};_0xd7906f['now']=moment()[_0x9964('0x73')](_0xd7906f[_0x9964('0x29')])[_0x9964('0x74')](_0x9964('0x75'));return _0x2b8be7[_0x9964('0x25')](0xc8)[_0x9964('0x76')](_0xd7906f);}; \ No newline at end of file +var _0xc718=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','keys','include','options','find','update','body','file','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','logo','default_logo.svg','default','upperFirst','Sequelize','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','custom','ValidationError','gdpr','securePassword','addPreferred','getPreferred','favicon','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','destroy','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length'];(function(_0x4d12af,_0x466438){var _0x40bcac=function(_0x120dc2){while(--_0x120dc2){_0x4d12af['push'](_0x4d12af['shift']());}};_0x40bcac(++_0x466438);}(_0xc718,0xb6));var _0x8c71=function(_0x31c2ff,_0x56a0bd){_0x31c2ff=_0x31c2ff-0x0;var _0x5c936a=_0xc718[_0x31c2ff];return _0x5c936a;};'use strict';var emlformat=require(_0x8c71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c71('0x1'));var jsonpatch=require(_0x8c71('0x2'));var rp=require('request-promise');var moment=require(_0x8c71('0x3'));var BPromise=require(_0x8c71('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c71('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c71('0x6'));var _=require('lodash');var squel=require(_0x8c71('0x7'));var crypto=require(_0x8c71('0x8'));var jsforce=require(_0x8c71('0x9'));var deskjs=require(_0x8c71('0xa'));var toCsv=require(_0x8c71('0xb'));var querystring=require('querystring');var Papa=require(_0x8c71('0xc'));var Redis=require(_0x8c71('0xd'));var authService=require(_0x8c71('0xe'));var qs=require(_0x8c71('0xf'));var as=require(_0x8c71('0x10'));var hardwareService=require(_0x8c71('0x11'));var logger=require(_0x8c71('0x12'))(_0x8c71('0x13'));var utils=require(_0x8c71('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8c71('0x15'));var db=require(_0x8c71('0x16'))['db'];var jayson=require(_0x8c71('0x17'));var client=jayson[_0x8c71('0x18')][_0x8c71('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x244644,_0xa05caf,_0x2b26f1,_0xccdc43){return new BPromise(function(_0x1a29b7,_0x38fd39){var _0x310a66=_0xccdc43||client;return _0x310a66[_0x8c71('0x1a')](_0x244644,_0x2b26f1)[_0x8c71('0x1b')](function(_0x2c56a3){logger[_0x8c71('0x1c')](_0x8c71('0x1d'),_0xa05caf,_0x8c71('0x1e'));logger['debug'](_0x8c71('0x1f'),_0xa05caf,_0x8c71('0x1e'),JSON['stringify'](_0x2c56a3));if(_0x2c56a3['error']){if(_0x2c56a3[_0x8c71('0x20')][_0x8c71('0x21')]===0x1f4){logger[_0x8c71('0x20')](_0x8c71('0x1d'),_0xa05caf,_0x2c56a3['error'][_0x8c71('0x22')]);return _0x38fd39(_0x2c56a3['error'][_0x8c71('0x22')]);}logger[_0x8c71('0x20')]('Setting,\x20%s,\x20%s',_0xa05caf,_0x2c56a3[_0x8c71('0x20')][_0x8c71('0x22')]);return _0x1a29b7(_0x2c56a3[_0x8c71('0x20')][_0x8c71('0x22')]);}else{logger[_0x8c71('0x1c')](_0x8c71('0x1d'),_0xa05caf,'request\x20sent');_0x1a29b7(_0x2c56a3[_0x8c71('0x23')]['message']);}})['catch'](function(_0x41726a){logger[_0x8c71('0x20')]('Setting,\x20%s,\x20%s',_0xa05caf,_0x41726a);_0x38fd39(_0x41726a);});});}function respondWithStatusCode(_0x428e71,_0xc22d7b){_0xc22d7b=_0xc22d7b||0xcc;return function(_0x5370e6){if(_0x5370e6){return _0x428e71['sendStatus'](_0xc22d7b);}return _0x428e71[_0x8c71('0x24')](_0xc22d7b)[_0x8c71('0x25')]();};}function respondWithResult(_0x2e39ce,_0x911372){_0x911372=_0x911372||0xc8;return function(_0x332bce){if(_0x332bce){return _0x2e39ce[_0x8c71('0x24')](_0x911372)['json'](_0x332bce);}};}function respondWithFilteredResult(_0x3c4d5d,_0x4b07dd){return function(_0x4c12af){if(_0x4c12af){var _0x4f69ce=typeof _0x4b07dd[_0x8c71('0x26')]==='undefined'&&typeof _0x4b07dd[_0x8c71('0x27')]===_0x8c71('0x28');var _0x362cab=_0x4c12af['count'];var _0x1c11a2=_0x4f69ce?0x0:_0x4b07dd[_0x8c71('0x26')];var _0x4d7072=_0x4f69ce?_0x4c12af[_0x8c71('0x29')]:_0x4b07dd['offset']+_0x4b07dd[_0x8c71('0x27')];var _0x2291e7;if(_0x4d7072>=_0x362cab){_0x4d7072=_0x362cab;_0x2291e7=0xc8;}else{_0x2291e7=0xce;}_0x3c4d5d[_0x8c71('0x24')](_0x2291e7);return _0x3c4d5d[_0x8c71('0x2a')](_0x8c71('0x2b'),_0x1c11a2+'-'+_0x4d7072+'/'+_0x362cab)[_0x8c71('0x2c')](_0x4c12af);}return null;};}function patchUpdates(_0x2fc088){return function(_0x5b6f0c){try{jsonpatch['apply'](_0x5b6f0c,_0x2fc088,!![]);}catch(_0x291ebd){return BPromise[_0x8c71('0x2d')](_0x291ebd);}return _0x5b6f0c[_0x8c71('0x2e')]();};}function saveUpdates(_0x55dfad,_0x33947c){return function(_0xd16a31){if(_0xd16a31){return _0xd16a31['update'](_0x55dfad)[_0x8c71('0x1b')](function(_0x795447){return _0x795447;});}return null;};}function removeEntity(_0x3da3a5,_0x55dbc4){return function(_0x5c3772){if(_0x5c3772){return _0x5c3772[_0x8c71('0x2f')]()['then'](function(){_0x3da3a5[_0x8c71('0x24')](0xcc)[_0x8c71('0x25')]();});}};}function handleEntityNotFound(_0x1a8151,_0x1f6805){return function(_0x133a6a){if(!_0x133a6a){_0x1a8151[_0x8c71('0x30')](0x194);}return _0x133a6a;};}function handleError(_0x253a28,_0x42a6b1){_0x42a6b1=_0x42a6b1||0x1f4;return function(_0x42645f){logger[_0x8c71('0x20')](_0x42645f[_0x8c71('0x31')]);if(_0x42645f[_0x8c71('0x32')]){delete _0x42645f[_0x8c71('0x32')];}_0x253a28['status'](_0x42a6b1)[_0x8c71('0x33')](_0x42645f);};}exports[_0x8c71('0x34')]=function(_0xfcde3d,_0x13d4e6){var _0x275729={},_0x3baebc={},_0x1da280={'count':0x0,'rows':[]};var _0x455ee4=_[_0x8c71('0x35')](db[_0x8c71('0x36')][_0x8c71('0x37')],function(_0x15f40f){return{'name':_0x15f40f[_0x8c71('0x38')],'type':_0x15f40f[_0x8c71('0x39')][_0x8c71('0x3a')]};});_0x3baebc[_0x8c71('0x3b')]=_['map'](_0x455ee4,_0x8c71('0x32'));_0x3baebc[_0x8c71('0x3c')]=_['keys'](_0xfcde3d['query']);_0x3baebc[_0x8c71('0x3d')]=_[_0x8c71('0x3e')](_0x3baebc[_0x8c71('0x3b')],_0x3baebc['query']);_0x275729[_0x8c71('0x3f')]=_[_0x8c71('0x3e')](_0x3baebc[_0x8c71('0x3b')],qs[_0x8c71('0x40')](_0xfcde3d[_0x8c71('0x3c')][_0x8c71('0x40')]));_0x275729[_0x8c71('0x3f')]=_0x275729[_0x8c71('0x3f')][_0x8c71('0x41')]?_0x275729[_0x8c71('0x3f')]:_0x3baebc[_0x8c71('0x3b')];if(!_0xfcde3d[_0x8c71('0x3c')][_0x8c71('0x42')](_0x8c71('0x43'))){_0x275729[_0x8c71('0x27')]=qs[_0x8c71('0x27')](_0xfcde3d[_0x8c71('0x3c')][_0x8c71('0x27')]);_0x275729[_0x8c71('0x26')]=qs['offset'](_0xfcde3d[_0x8c71('0x3c')][_0x8c71('0x26')]);}_0x275729[_0x8c71('0x44')]=qs[_0x8c71('0x45')](_0xfcde3d[_0x8c71('0x3c')][_0x8c71('0x45')]);_0x275729[_0x8c71('0x46')]=qs[_0x8c71('0x3d')](_[_0x8c71('0x47')](_0xfcde3d['query'],_0x3baebc[_0x8c71('0x3d')]),_0x455ee4);if(_0xfcde3d[_0x8c71('0x3c')][_0x8c71('0x48')]){_0x275729[_0x8c71('0x46')]=_[_0x8c71('0x49')](_0x275729[_0x8c71('0x46')],{'$or':_[_0x8c71('0x35')](_0x455ee4,function(_0x1cc5d5){if(_0x1cc5d5[_0x8c71('0x39')]!==_0x8c71('0x4a')){var _0x2d1487={};_0x2d1487[_0x1cc5d5[_0x8c71('0x32')]]={'$like':'%'+_0xfcde3d[_0x8c71('0x3c')][_0x8c71('0x48')]+'%'};return _0x2d1487;}})});}_0x275729=_[_0x8c71('0x49')]({},_0x275729,_0xfcde3d['options']);var _0xff0a9b={'where':_0x275729['where']};return db['Setting'][_0x8c71('0x29')](_0xff0a9b)['then'](function(_0x560b9f){_0x1da280[_0x8c71('0x29')]=_0x560b9f;if(_0xfcde3d[_0x8c71('0x3c')][_0x8c71('0x4b')]){_0x275729['include']=[{'all':!![]}];}return db[_0x8c71('0x36')]['findAll'](_0x275729);})['then'](function(_0x1d3b56){_0x1da280[_0x8c71('0x4c')]=_0x1d3b56;return _0x1da280;})[_0x8c71('0x1b')](respondWithFilteredResult(_0x13d4e6,_0x275729))[_0x8c71('0x4d')](handleError(_0x13d4e6,null));};exports['show']=function(_0x2b99a2,_0x5e3eed){var _0x283362={'raw':![],'where':{'id':_0x2b99a2[_0x8c71('0x4e')]['id']}},_0x2807e4={};_0x2807e4[_0x8c71('0x3b')]=_['keys'](db[_0x8c71('0x36')][_0x8c71('0x37')]);_0x2807e4['query']=_[_0x8c71('0x4f')](_0x2b99a2[_0x8c71('0x3c')]);_0x2807e4[_0x8c71('0x3d')]=_[_0x8c71('0x3e')](_0x2807e4[_0x8c71('0x3b')],_0x2807e4[_0x8c71('0x3c')]);_0x283362['attributes']=_['intersection'](_0x2807e4[_0x8c71('0x3b')],qs['fields'](_0x2b99a2['query'][_0x8c71('0x40')]));_0x283362[_0x8c71('0x3f')]=_0x283362[_0x8c71('0x3f')][_0x8c71('0x41')]?_0x283362[_0x8c71('0x3f')]:_0x2807e4[_0x8c71('0x3b')];if(_0x2b99a2['query'][_0x8c71('0x4b')]){_0x283362[_0x8c71('0x50')]=[{'all':!![]}];}_0x283362=_[_0x8c71('0x49')]({},_0x283362,_0x2b99a2[_0x8c71('0x51')]);return db[_0x8c71('0x36')][_0x8c71('0x52')](_0x283362)['then'](handleEntityNotFound(_0x5e3eed,null))['then'](respondWithResult(_0x5e3eed,null))[_0x8c71('0x4d')](handleError(_0x5e3eed,null));};exports[_0x8c71('0x53')]=function(_0x336940,_0x17e39f){if(_0x336940['body']['id']){delete _0x336940[_0x8c71('0x54')]['id'];}return db[_0x8c71('0x36')][_0x8c71('0x52')]({'where':{'id':_0x336940[_0x8c71('0x4e')]['id']}})['then'](handleEntityNotFound(_0x17e39f,null))['then'](saveUpdates(_0x336940[_0x8c71('0x54')],null))[_0x8c71('0x1b')](respondWithResult(_0x17e39f,null))[_0x8c71('0x4d')](handleError(_0x17e39f,null));};exports['addLogo']=function(_0x2ade7f,_0x3b203c,_0x4e2a9d){if(_0x2ade7f['file']&&_0x2ade7f[_0x8c71('0x55')][_0x8c71('0x56')]){_0x2ade7f[_0x8c71('0x54')]['logo']=_0x2ade7f[_0x8c71('0x55')][_0x8c71('0x56')];}return db['Setting'][_0x8c71('0x52')]({'where':{'id':_0x2ade7f['params']['id']}})['then'](handleEntityNotFound(_0x3b203c,null))[_0x8c71('0x1b')](saveUpdates(_0x2ade7f[_0x8c71('0x54')],null))['then'](respondWithResult(_0x3b203c,null))[_0x8c71('0x4d')](handleError(_0x3b203c,null));};exports[_0x8c71('0x57')]=function(_0xefffe9,_0x1b66dc,_0x13547e){if(_0xefffe9['file']&&_0xefffe9['file'][_0x8c71('0x56')]){_0xefffe9[_0x8c71('0x54')][_0x8c71('0x58')]=_0xefffe9[_0x8c71('0x55')][_0x8c71('0x56')];}return db[_0x8c71('0x36')][_0x8c71('0x52')]({'where':{'id':_0xefffe9['params']['id']}})[_0x8c71('0x1b')](handleEntityNotFound(_0x1b66dc,null))[_0x8c71('0x1b')](saveUpdates(_0xefffe9[_0x8c71('0x54')],null))['then'](respondWithResult(_0x1b66dc,null))[_0x8c71('0x4d')](handleError(_0x1b66dc,null));};var utilLicense=require(_0x8c71('0x15'));exports[_0x8c71('0x59')]=function(_0x162d6d,_0x54a3cf,_0x516fdb){var _0x80f1a6=_0x8c71('0x5a');var _0x2a51b0={'custom':![]};return utilLicense[_0x8c71('0x5b')]()[_0x8c71('0x1b')](function(_0x3abb42){if(_0x3abb42){_0x2a51b0=_0x3abb42;}return db[_0x8c71('0x36')]['find']({'where':{'id':_0x162d6d[_0x8c71('0x4e')]['id']},'attributes':['logo','loginLogo',_0x8c71('0x5c'),'favicon',_0x8c71('0x5d'),_0x8c71('0x5e'),_0x8c71('0x5f'),_0x8c71('0x60')],'raw':!![]});})[_0x8c71('0x1b')](handleEntityNotFound(_0x54a3cf,null))[_0x8c71('0x1b')](function(_0xea7888){if(_0xea7888){var _0x5101c3=_0xea7888['logo']&&fs[_0x8c71('0x61')](path[_0x8c71('0x62')](config[_0x8c71('0x63')],_0x80f1a6,_[_0x8c71('0x64')](_0xea7888[_0x8c71('0x65')])))?path['join'](config[_0x8c71('0x63')],_0x80f1a6,_[_0x8c71('0x64')](_0xea7888[_0x8c71('0x65')])):path[_0x8c71('0x62')](config[_0x8c71('0x63')],_0x80f1a6,_[_0x8c71('0x64')](_0x8c71('0x66')));var _0x262662=_0x8c71('0x67')+_[_0x8c71('0x68')](_0x8c71('0x65'));if(_0xea7888[_0x262662]||!_0x2a51b0['custom']){_0x5101c3=path[_0x8c71('0x62')](config['root'],_0x80f1a6,_[_0x8c71('0x64')](_0x8c71('0x66')));}if(!fs[_0x8c71('0x61')](_0x5101c3)){throw new db[(_0x8c71('0x69'))]['ValidationError'](_[_0x8c71('0x68')]('logo')+_0x8c71('0x6a'));}return _0x54a3cf[_0x8c71('0x6b')](_0x5101c3);}})[_0x8c71('0x4d')](handleError(_0x54a3cf,null));};var utilLicense=require(_0x8c71('0x15'));exports[_0x8c71('0x6c')]=function(_0x1fa5a5,_0x2697ac,_0x365caa){var _0x3a2658=_0x8c71('0x5a');var _0x4a23a8={'custom':![]};return utilLicense[_0x8c71('0x5b')]()[_0x8c71('0x1b')](function(_0x3e67c9){if(_0x3e67c9){_0x4a23a8=_0x3e67c9;}return db[_0x8c71('0x36')][_0x8c71('0x52')]({'where':{'id':_0x1fa5a5[_0x8c71('0x4e')]['id']},'attributes':[_0x8c71('0x65'),_0x8c71('0x58'),_0x8c71('0x5c'),'favicon',_0x8c71('0x5d'),_0x8c71('0x5e'),'defaultPreferred',_0x8c71('0x60')],'raw':!![]});})[_0x8c71('0x1b')](handleEntityNotFound(_0x2697ac,null))[_0x8c71('0x1b')](function(_0x325dfe){if(_0x325dfe){var _0x36163b=_0x325dfe[_0x8c71('0x58')]&&fs[_0x8c71('0x61')](path[_0x8c71('0x62')](config['root'],_0x3a2658,_[_0x8c71('0x64')](_0x325dfe[_0x8c71('0x58')])))?path[_0x8c71('0x62')](config[_0x8c71('0x63')],_0x3a2658,_[_0x8c71('0x64')](_0x325dfe[_0x8c71('0x58')])):path[_0x8c71('0x62')](config[_0x8c71('0x63')],_0x3a2658,_[_0x8c71('0x64')](_0x8c71('0x6d')));var _0x6b830c='default'+_[_0x8c71('0x68')](_0x8c71('0x58'));if(_0x325dfe[_0x6b830c]||!_0x4a23a8[_0x8c71('0x6e')]){_0x36163b=path[_0x8c71('0x62')](config['root'],_0x3a2658,_[_0x8c71('0x64')]('default_loginLogo.svg'));}if(!fs[_0x8c71('0x61')](_0x36163b)){throw new db[(_0x8c71('0x69'))][(_0x8c71('0x6f'))](_[_0x8c71('0x68')]('loginLogo')+_0x8c71('0x6a'));}return _0x2697ac[_0x8c71('0x6b')](_0x36163b);}})['catch'](handleError(_0x2697ac,null));};exports[_0x8c71('0x70')]=function(_0x2dd6eb,_0x3f4bbb){return db['Setting'][_0x8c71('0x52')]({'where':{'id':_0x2dd6eb[_0x8c71('0x4e')]['id']},'attributes':[_0x8c71('0x71')]})['then'](respondWithResult(_0x3f4bbb,null))[_0x8c71('0x4d')](handleError(_0x3f4bbb,null));};exports[_0x8c71('0x72')]=function(_0x379573,_0xa2b911,_0x19dc8a){if(_0x379573[_0x8c71('0x55')]&&_0x379573[_0x8c71('0x55')][_0x8c71('0x56')]){_0x379573[_0x8c71('0x54')][_0x8c71('0x5c')]=_0x379573[_0x8c71('0x55')][_0x8c71('0x56')];}return db[_0x8c71('0x36')]['find']({'where':{'id':_0x379573[_0x8c71('0x4e')]['id']}})['then'](handleEntityNotFound(_0xa2b911,null))[_0x8c71('0x1b')](saveUpdates(_0x379573['body'],null))[_0x8c71('0x1b')](respondWithResult(_0xa2b911,null))[_0x8c71('0x4d')](handleError(_0xa2b911,null));};var utilLicense=require(_0x8c71('0x15'));exports[_0x8c71('0x73')]=function(_0x3b289d,_0x2adfd4,_0x3bf94b){var _0x542c7b=_0x8c71('0x5a');var _0x499cd1={'custom':![]};return utilLicense[_0x8c71('0x5b')]()[_0x8c71('0x1b')](function(_0x4a7682){if(_0x4a7682){_0x499cd1=_0x4a7682;}return db[_0x8c71('0x36')][_0x8c71('0x52')]({'where':{'id':_0x3b289d[_0x8c71('0x4e')]['id']},'attributes':[_0x8c71('0x65'),_0x8c71('0x58'),_0x8c71('0x5c'),_0x8c71('0x74'),_0x8c71('0x5d'),'defaultLoginLogo',_0x8c71('0x5f'),_0x8c71('0x60')],'raw':!![]});})['then'](handleEntityNotFound(_0x2adfd4,null))[_0x8c71('0x1b')](function(_0x3e47d9){if(_0x3e47d9){var _0x1d014d=_0x3e47d9[_0x8c71('0x5c')]&&fs[_0x8c71('0x61')](path[_0x8c71('0x62')](config['root'],_0x542c7b,_['toLower'](_0x3e47d9[_0x8c71('0x5c')])))?path[_0x8c71('0x62')](config[_0x8c71('0x63')],_0x542c7b,_[_0x8c71('0x64')](_0x3e47d9['preferred'])):path['join'](config[_0x8c71('0x63')],_0x542c7b,_[_0x8c71('0x64')]('default_preferred.png'));var _0x555a11=_0x8c71('0x67')+_[_0x8c71('0x68')](_0x8c71('0x5c'));if(_0x3e47d9[_0x555a11]||!_0x499cd1[_0x8c71('0x6e')]||!_0x499cd1[_0x8c71('0x5c')]){_0x1d014d=path['join'](config['root'],_0x542c7b,_['toLower']('default_preferred.png'));}if(!fs[_0x8c71('0x61')](_0x1d014d)){throw new db['Sequelize'][(_0x8c71('0x6f'))](_['upperFirst'](_0x8c71('0x5c'))+_0x8c71('0x6a'));}return _0x2adfd4[_0x8c71('0x6b')](_0x1d014d);}})['catch'](handleError(_0x2adfd4,null));};exports[_0x8c71('0x75')]=function(_0x1cc498,_0x5e3a52,_0x357a20){if(_0x1cc498['file']&&_0x1cc498[_0x8c71('0x55')]['filename']){_0x1cc498['body']['favicon']=_0x1cc498['file'][_0x8c71('0x56')];}return db['Setting']['find']({'where':{'id':_0x1cc498[_0x8c71('0x4e')]['id']}})[_0x8c71('0x1b')](handleEntityNotFound(_0x5e3a52,null))[_0x8c71('0x1b')](saveUpdates(_0x1cc498['body'],null))[_0x8c71('0x1b')](respondWithResult(_0x5e3a52,null))[_0x8c71('0x4d')](handleError(_0x5e3a52,null));};var utilLicense=require(_0x8c71('0x15'));exports[_0x8c71('0x76')]=function(_0x4494d4,_0x5ad9cf,_0x12bb60){var _0x271e13='server/files/images/logos';var _0x433003={'custom':![]};return utilLicense[_0x8c71('0x5b')]()[_0x8c71('0x1b')](function(_0x56f49a){if(_0x56f49a){_0x433003=_0x56f49a;}return db[_0x8c71('0x36')]['find']({'where':{'id':_0x4494d4['params']['id']},'attributes':[_0x8c71('0x65'),'loginLogo',_0x8c71('0x5c'),'favicon',_0x8c71('0x5d'),_0x8c71('0x5e'),_0x8c71('0x5f'),_0x8c71('0x60')],'raw':!![]});})[_0x8c71('0x1b')](handleEntityNotFound(_0x5ad9cf,null))['then'](function(_0x5f1314){if(_0x5f1314){var _0x3a8810=_0x5f1314[_0x8c71('0x74')]&&fs[_0x8c71('0x61')](path['join'](config[_0x8c71('0x63')],_0x271e13,_['toLower'](_0x5f1314[_0x8c71('0x74')])))?path['join'](config['root'],_0x271e13,_[_0x8c71('0x64')](_0x5f1314[_0x8c71('0x74')])):path['join'](config[_0x8c71('0x63')],_0x271e13,_[_0x8c71('0x64')](_0x8c71('0x77')));var _0xec5386=_0x8c71('0x67')+_[_0x8c71('0x68')](_0x8c71('0x74'));if(_0x5f1314[_0xec5386]||!_0x433003['custom']){_0x3a8810=path[_0x8c71('0x62')](config[_0x8c71('0x63')],_0x271e13,_[_0x8c71('0x64')]('default_favicon.ico'));}if(!fs['existsSync'](_0x3a8810)){throw new db[(_0x8c71('0x69'))][(_0x8c71('0x6f'))](_['upperFirst'](_0x8c71('0x74'))+_0x8c71('0x6a'));}return _0x5ad9cf['download'](_0x3a8810);}})[_0x8c71('0x4d')](handleError(_0x5ad9cf,null));};exports[_0x8c71('0x78')]=function(_0x542123,_0x392b78){var _0x11dadb={'offset':moment()['utcOffset']()};_0x11dadb['now']=moment()[_0x8c71('0x79')](_0x11dadb[_0x8c71('0x26')])[_0x8c71('0x7a')](_0x8c71('0x7b'));return _0x392b78[_0x8c71('0x24')](0xc8)['send'](_0x11dadb);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 16bce7b..3ae6907 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x008c,0x188));var _0xc008=function(_0x482611,_0x33356d){_0x482611=_0x482611-0x0;var _0x4aeb3a=_0x008c[_0x482611];return _0x4aeb3a;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x5d8987,_0x14d054){var _0x2997eb=function(_0x56f92a){while(--_0x56f92a){_0x5d8987['push'](_0x5d8987['shift']());}};_0x2997eb(++_0x14d054);}(_0x3e74,0x175));var _0x43e7=function(_0x964650,_0x3539be){_0x964650=_0x964650-0x0;var _0x14a224=_0x3e74[_0x964650];return _0x14a224;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 73dd05c..5e2aaa2 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 _0x1312=['message','info','result','catch','ShowSetting','Setting','find','options','where','include','map','model','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x1312,0x148));var _0x2131=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x1312[_0x274dd7];return _0x148829;};'use strict';var _=require(_0x2131('0x0'));var util=require(_0x2131('0x1'));var moment=require('moment');var BPromise=require(_0x2131('0x2'));var rs=require(_0x2131('0x3'));var fs=require('fs');var Redis=require(_0x2131('0x4'));var db=require(_0x2131('0x5'))['db'];var utils=require(_0x2131('0x6'));var logger=require(_0x2131('0x7'))(_0x2131('0x8'));var config=require(_0x2131('0x9'));var jayson=require(_0x2131('0xa'));var client=jayson[_0x2131('0xb')][_0x2131('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b225e,_0x154746,_0xcf8894){return new BPromise(function(_0xa9f9aa,_0x33a402){return client[_0x2131('0xd')](_0x1b225e,_0xcf8894)[_0x2131('0xe')](function(_0x1271f6){logger['info'](_0x2131('0xf'),_0x154746,_0x2131('0x10'));logger[_0x2131('0x11')](_0x2131('0x12'),_0x154746,_0x2131('0x10'),JSON[_0x2131('0x13')](_0x1271f6));if(_0x1271f6['error']){if(_0x1271f6[_0x2131('0x14')][_0x2131('0x15')]===0x1f4){logger[_0x2131('0x14')](_0x2131('0xf'),_0x154746,_0x1271f6[_0x2131('0x14')]['message']);return _0x33a402(_0x1271f6[_0x2131('0x14')]['message']);}logger['error'](_0x2131('0xf'),_0x154746,_0x1271f6[_0x2131('0x14')][_0x2131('0x16')]);return _0xa9f9aa(_0x1271f6[_0x2131('0x14')][_0x2131('0x16')]);}else{logger[_0x2131('0x17')](_0x2131('0xf'),_0x154746,_0x2131('0x10'));_0xa9f9aa(_0x1271f6[_0x2131('0x18')][_0x2131('0x16')]);}})[_0x2131('0x19')](function(_0x111a53){logger[_0x2131('0x14')]('Setting,\x20%s,\x20%s',_0x154746,_0x111a53);_0x33a402(_0x111a53);});});}exports[_0x2131('0x1a')]=function(_0x4574cb){var _0x3ce9ff=this;return new Promise(function(_0x260928,_0x291b40){return db[_0x2131('0x1b')][_0x2131('0x1c')]({'raw':_0x4574cb[_0x2131('0x1d')]?_0x4574cb[_0x2131('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4574cb[_0x2131('0x1d')]?_0x4574cb[_0x2131('0x1d')][_0x2131('0x1e')]||null:null,'attributes':_0x4574cb['options']?_0x4574cb['options']['attributes']||null:null,'include':_0x4574cb[_0x2131('0x1d')]?_0x4574cb[_0x2131('0x1d')][_0x2131('0x1f')]?_[_0x2131('0x20')](_0x4574cb[_0x2131('0x1d')][_0x2131('0x1f')],function(_0x3df3a4){return{'model':db[_0x3df3a4[_0x2131('0x21')]],'as':_0x3df3a4['as'],'attributes':_0x3df3a4[_0x2131('0x22')],'include':_0x3df3a4[_0x2131('0x1f')]?_[_0x2131('0x20')](_0x3df3a4['include'],function(_0x594b6c){return{'model':db[_0x594b6c[_0x2131('0x21')]],'as':_0x594b6c['as'],'attributes':_0x594b6c[_0x2131('0x22')],'include':_0x594b6c[_0x2131('0x1f')]?_[_0x2131('0x20')](_0x594b6c[_0x2131('0x1f')],function(_0x490e98){return{'model':db[_0x490e98[_0x2131('0x21')]],'as':_0x490e98['as'],'attributes':_0x490e98[_0x2131('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2131('0xe')](function(_0xaf18f7){logger['info'](_0x2131('0x1a'),_0x4574cb);logger[_0x2131('0x11')](_0x2131('0x1a'),_0x4574cb,JSON[_0x2131('0x13')](_0xaf18f7));_0x260928(_0xaf18f7);})['catch'](function(_0x54a5d4){logger[_0x2131('0x14')]('ShowSetting',_0x54a5d4[_0x2131('0x16')],_0x4574cb);_0x291b40(_0x3ce9ff[_0x2131('0x14')](0x1f4,_0x54a5d4[_0x2131('0x16')]));});});}; \ No newline at end of file +var _0x9d1e=['info','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','message','Setting,\x20%s,\x20%s','result','catch','ShowSetting','Setting','find','options','where','attributes','include','model'];(function(_0x3feed7,_0x209f8e){var _0x38fbcd=function(_0x23694b){while(--_0x23694b){_0x3feed7['push'](_0x3feed7['shift']());}};_0x38fbcd(++_0x209f8e);}(_0x9d1e,0x1e7));var _0xe9d1=function(_0x286b83,_0x3e3e6c){_0x286b83=_0x286b83-0x0;var _0x5e3653=_0x9d1e[_0x286b83];return _0x5e3653;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe9d1('0x0'));var BPromise=require(_0xe9d1('0x1'));var rs=require(_0xe9d1('0x2'));var fs=require('fs');var Redis=require(_0xe9d1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9d1('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe9d1('0x5'));var jayson=require(_0xe9d1('0x6'));var client=jayson[_0xe9d1('0x7')][_0xe9d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d87d1,_0x48eccd,_0x4916fc){return new BPromise(function(_0x42f2f3,_0x2634e7){return client[_0xe9d1('0x9')](_0x1d87d1,_0x4916fc)[_0xe9d1('0xa')](function(_0x4f7607){logger['info']('Setting,\x20%s,\x20%s',_0x48eccd,_0xe9d1('0xb'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x48eccd,_0xe9d1('0xb'),JSON[_0xe9d1('0xc')](_0x4f7607));if(_0x4f7607[_0xe9d1('0xd')]){if(_0x4f7607[_0xe9d1('0xd')]['code']===0x1f4){logger[_0xe9d1('0xd')]('Setting,\x20%s,\x20%s',_0x48eccd,_0x4f7607[_0xe9d1('0xd')][_0xe9d1('0xe')]);return _0x2634e7(_0x4f7607[_0xe9d1('0xd')][_0xe9d1('0xe')]);}logger[_0xe9d1('0xd')](_0xe9d1('0xf'),_0x48eccd,_0x4f7607[_0xe9d1('0xd')][_0xe9d1('0xe')]);return _0x42f2f3(_0x4f7607['error'][_0xe9d1('0xe')]);}else{logger['info'](_0xe9d1('0xf'),_0x48eccd,_0xe9d1('0xb'));_0x42f2f3(_0x4f7607[_0xe9d1('0x10')]['message']);}})[_0xe9d1('0x11')](function(_0x1376bb){logger[_0xe9d1('0xd')](_0xe9d1('0xf'),_0x48eccd,_0x1376bb);_0x2634e7(_0x1376bb);});});}exports[_0xe9d1('0x12')]=function(_0x1165e8){var _0x56ee3f=this;return new Promise(function(_0x2b7058,_0x466cd2){return db[_0xe9d1('0x13')][_0xe9d1('0x14')]({'raw':_0x1165e8[_0xe9d1('0x15')]?_0x1165e8[_0xe9d1('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1165e8[_0xe9d1('0x15')]?_0x1165e8[_0xe9d1('0x15')][_0xe9d1('0x16')]||null:null,'attributes':_0x1165e8[_0xe9d1('0x15')]?_0x1165e8[_0xe9d1('0x15')][_0xe9d1('0x17')]||null:null,'include':_0x1165e8[_0xe9d1('0x15')]?_0x1165e8[_0xe9d1('0x15')][_0xe9d1('0x18')]?_['map'](_0x1165e8[_0xe9d1('0x15')][_0xe9d1('0x18')],function(_0x43f948){return{'model':db[_0x43f948[_0xe9d1('0x19')]],'as':_0x43f948['as'],'attributes':_0x43f948[_0xe9d1('0x17')],'include':_0x43f948[_0xe9d1('0x18')]?_['map'](_0x43f948[_0xe9d1('0x18')],function(_0x34d1fa){return{'model':db[_0x34d1fa[_0xe9d1('0x19')]],'as':_0x34d1fa['as'],'attributes':_0x34d1fa['attributes'],'include':_0x34d1fa[_0xe9d1('0x18')]?_['map'](_0x34d1fa[_0xe9d1('0x18')],function(_0x2e2fa6){return{'model':db[_0x2e2fa6[_0xe9d1('0x19')]],'as':_0x2e2fa6['as'],'attributes':_0x2e2fa6[_0xe9d1('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24c370){logger[_0xe9d1('0x1a')]('ShowSetting',_0x1165e8);logger['debug'](_0xe9d1('0x12'),_0x1165e8,JSON[_0xe9d1('0xc')](_0x24c370));_0x2b7058(_0x24c370);})['catch'](function(_0x13422f){logger[_0xe9d1('0xd')](_0xe9d1('0x12'),_0x13422f[_0xe9d1('0xe')],_0x1165e8);_0x466cd2(_0x56ee3f[_0xe9d1('0xd')](0x1f4,_0x13422f[_0xe9d1('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index f021be4..7643e37 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(_0x462545,_0x3c0f1b){var _0x680d51=function(_0x22727b){while(--_0x22727b){_0x462545['push'](_0x462545['shift']());}};_0x680d51(++_0x3c0f1b);}(_0x326f,0xd1));var _0xf326=function(_0x3cb7df,_0x50838f){_0x3cb7df=_0x3cb7df-0x0;var _0x4956fb=_0x326f[_0x3cb7df];return _0x4956fb;};'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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x1ec836,_0x1ce2d6){var _0x4baf71=function(_0x5b640e){while(--_0x5b640e){_0x1ec836['push'](_0x1ec836['shift']());}};_0x4baf71(++_0x1ce2d6);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 97ae4a9..41cdb13 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 _0xe8c8=['exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xe8c8,0x11d));var _0x8e8c=function(_0x3a8ce5,_0x1d30cc){_0x3a8ce5=_0x3a8ce5-0x0;var _0xa3f226=_0xe8c8[_0x3a8ce5];return _0xa3f226;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x8e8c('0x0')]={'name':{'type':Sequelize[_0x8e8c('0x1')],'unique':_0x8e8c('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x8e8c('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x8e8c('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x8e8c('0x1')],'defaultValue':function(){return rs[_0x8e8c('0x3')]();}},'phone':{'type':Sequelize[_0x8e8c('0x1')]},'type':{'type':Sequelize[_0x8e8c('0x4')](_0x8e8c('0x5'),_0x8e8c('0x6'),'connectel',_0x8e8c('0x7'),_0x8e8c('0x8'),'clickatell','bandwidth',_0x8e8c('0x9'),'infobip',_0x8e8c('0xa'))},'accountSid':{'type':Sequelize[_0x8e8c('0x1')]},'authId':{'type':Sequelize[_0x8e8c('0x1')]},'authToken':{'type':Sequelize[_0x8e8c('0x1')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x8e8c('0x1')]},'password':{'type':Sequelize[_0x8e8c('0x1')]},'apiKey':{'type':Sequelize[_0x8e8c('0x1')]},'applicationId':{'type':Sequelize[_0x8e8c('0x1')]},'accountId':{'type':Sequelize[_0x8e8c('0x1')]},'senderString':{'type':Sequelize[_0x8e8c('0x1')]},'deliveryReport':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0x8e8c('0x1')]},'notificationTemplate':{'type':Sequelize[_0x8e8c('0xc')],'defaultValue':function(){return _0x8e8c('0xd');}},'notificationSound':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8e8c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8e8c('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x8e8c('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x8e8c('0xb')],'defaultValue':![],'comment':_0x8e8c('0x10'),'set':function(_0x27399e){if(!_0x27399e)this[_0x8e8c('0x11')](_0x8e8c('0x12'),null);this['setDataValue']('mandatoryDisposition',_0x27399e);}}}; \ No newline at end of file +var _0x3994=['csc','infobip','intelepeer','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','skebby','connectel','clicksend','bandwidth'];(function(_0xdf41d1,_0x5e1e6c){var _0x385fab=function(_0x325290){while(--_0x325290){_0xdf41d1['push'](_0xdf41d1['shift']());}};_0x385fab(++_0x5e1e6c);}(_0x3994,0x145));var _0x4399=function(_0x40a6ae,_0x57b41c){_0x40a6ae=_0x40a6ae-0x0;var _0x397841=_0x3994[_0x40a6ae];return _0x397841;};'use strict';var Sequelize=require(_0x4399('0x0'));var rs=require(_0x4399('0x1'));module[_0x4399('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x4399('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x4399('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x4399('0x3')],'defaultValue':function(){return rs[_0x4399('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x4399('0x5')](_0x4399('0x6'),_0x4399('0x7'),_0x4399('0x8'),_0x4399('0x9'),'plivo','clickatell',_0x4399('0xa'),_0x4399('0xb'),_0x4399('0xc'),_0x4399('0xd'))},'accountSid':{'type':Sequelize[_0x4399('0x3')]},'authId':{'type':Sequelize[_0x4399('0x3')]},'authToken':{'type':Sequelize[_0x4399('0x3')]},'smsMethod':{'type':Sequelize[_0x4399('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x4399('0x3')]},'applicationId':{'type':Sequelize[_0x4399('0x3')]},'accountId':{'type':Sequelize[_0x4399('0x3')]},'senderString':{'type':Sequelize[_0x4399('0x3')]},'deliveryReport':{'type':Sequelize[_0x4399('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x4399('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4399('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4399('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4399('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4399('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4399('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4399('0xf')],'comment':_0x4399('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x4399('0xe')],'defaultValue':![],'comment':_0x4399('0x11'),'set':function(_0x263bc1){if(!_0x263bc1)this[_0x4399('0x12')](_0x4399('0x13'),null);this[_0x4399('0x12')](_0x4399('0x14'),_0x263bc1);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index e3d9e41..a0eba58 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 _0xfb87=['mobile','From','Body','messageId','MessageSid','skebby','sender','text','connectel','from','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','refid','isNil','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','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','send','json','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','getApplications','length','Contact','Owner','fullname','internal','Tag','color','to\x20is\x20mandatory','List','user','out','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','status_code','DELIVERED','groupName','clickatell','intelepeer','redif','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','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','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','apply','update','then','destroy','get','name','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','filter','options','include','rows','keys','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','nolimit','findAll','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','sms','SmsApplication','applications','priority','asc','account','Applications','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xfb87,0x6d));var _0x7fb8=function(_0x154b19,_0x21e4cf){_0x154b19=_0x154b19-0x0;var _0x10f433=_0xfb87[_0x154b19];return _0x10f433;};'use strict';var emlformat=require(_0x7fb8('0x0'));var rimraf=require(_0x7fb8('0x1'));var zipdir=require(_0x7fb8('0x2'));var jsonpatch=require(_0x7fb8('0x3'));var rp=require(_0x7fb8('0x4'));var moment=require(_0x7fb8('0x5'));var BPromise=require(_0x7fb8('0x6'));var Mustache=require('mustache');var util=require(_0x7fb8('0x7'));var path=require(_0x7fb8('0x8'));var sox=require(_0x7fb8('0x9'));var csv=require(_0x7fb8('0xa'));var ejs=require(_0x7fb8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7fb8('0xc'));var squel=require('squel');var crypto=require(_0x7fb8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7fb8('0xe'));var Redis=require('ioredis');var authService=require(_0x7fb8('0xf'));var qs=require(_0x7fb8('0x10'));var as=require(_0x7fb8('0x11'));var hardwareService=require(_0x7fb8('0x12'));var logger=require(_0x7fb8('0x13'))('api');var utils=require(_0x7fb8('0x14'));var config=require(_0x7fb8('0x15'));var licenseUtil=require(_0x7fb8('0x16'));var db=require('../../mysqldb')['db'];config[_0x7fb8('0x17')]=_[_0x7fb8('0x18')](config[_0x7fb8('0x17')],{'host':_0x7fb8('0x19'),'port':0x18eb});var socket=require(_0x7fb8('0x1a'))(new Redis(config[_0x7fb8('0x17')]));require('./smsAccount.socket')[_0x7fb8('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7fb8('0x1c')][_0x7fb8('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x55b3d7,_0x4f3dd8,_0x53fc92,_0x10dde9){return new BPromise(function(_0x18fe47,_0x1261c3){var _0x5e5eed=_0x10dde9||client;return _0x5e5eed[_0x7fb8('0x1e')](_0x55b3d7,_0x53fc92)['then'](function(_0x391e10){logger[_0x7fb8('0x1f')](_0x7fb8('0x20'),_0x4f3dd8,_0x7fb8('0x21'));logger['debug'](_0x7fb8('0x22'),_0x4f3dd8,_0x7fb8('0x21'),JSON[_0x7fb8('0x23')](_0x391e10));if(_0x391e10['error']){if(_0x391e10[_0x7fb8('0x24')]['code']===0x1f4){logger['error'](_0x7fb8('0x20'),_0x4f3dd8,_0x391e10[_0x7fb8('0x24')][_0x7fb8('0x25')]);return _0x1261c3(_0x391e10[_0x7fb8('0x24')][_0x7fb8('0x25')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x4f3dd8,_0x391e10['error'][_0x7fb8('0x25')]);return _0x18fe47(_0x391e10[_0x7fb8('0x24')]['message']);}else{logger[_0x7fb8('0x1f')](_0x7fb8('0x20'),_0x4f3dd8,_0x7fb8('0x21'));_0x18fe47(_0x391e10[_0x7fb8('0x26')][_0x7fb8('0x25')]);}})[_0x7fb8('0x27')](function(_0x3294d2){logger[_0x7fb8('0x24')](_0x7fb8('0x20'),_0x4f3dd8,_0x3294d2);_0x1261c3(_0x3294d2);});});}function respondWithStatusCode(_0x45290e,_0x1dc05a){_0x1dc05a=_0x1dc05a||0xcc;return function(_0x36ed49){if(_0x36ed49){return _0x45290e[_0x7fb8('0x28')](_0x1dc05a);}return _0x45290e[_0x7fb8('0x29')](_0x1dc05a)[_0x7fb8('0x2a')]();};}function respondWithResult(_0x5a462f,_0x1e2a9b){_0x1e2a9b=_0x1e2a9b||0xc8;return function(_0x237ffc){if(_0x237ffc){return _0x5a462f[_0x7fb8('0x29')](_0x1e2a9b)['json'](_0x237ffc);}};}function respondWithFilteredResult(_0x574a68,_0x34ecad){return function(_0x40ddaa){if(_0x40ddaa){var _0x200b86=typeof _0x34ecad[_0x7fb8('0x2b')]==='undefined'&&typeof _0x34ecad[_0x7fb8('0x2c')]===_0x7fb8('0x2d');var _0x1f3ede=_0x40ddaa[_0x7fb8('0x2e')];var _0x2ee0c9=_0x200b86?0x0:_0x34ecad[_0x7fb8('0x2b')];var _0x410388=_0x200b86?_0x40ddaa['count']:_0x34ecad[_0x7fb8('0x2b')]+_0x34ecad['limit'];var _0xeca158;if(_0x410388>=_0x1f3ede){_0x410388=_0x1f3ede;_0xeca158=0xc8;}else{_0xeca158=0xce;}_0x574a68[_0x7fb8('0x29')](_0xeca158);return _0x574a68[_0x7fb8('0x2f')]('Content-Range',_0x2ee0c9+'-'+_0x410388+'/'+_0x1f3ede)['json'](_0x40ddaa);}return null;};}function patchUpdates(_0x419f51){return function(_0x16dead){try{jsonpatch[_0x7fb8('0x30')](_0x16dead,_0x419f51,!![]);}catch(_0x788991){return BPromise['reject'](_0x788991);}return _0x16dead['save']();};}function saveUpdates(_0x27aad3,_0x171318){return function(_0x49dfe3){if(_0x49dfe3){return _0x49dfe3[_0x7fb8('0x31')](_0x27aad3)[_0x7fb8('0x32')](function(_0x2c1549){return _0x2c1549;});}return null;};}function removeEntity(_0x51e1ad,_0xa411ed){return function(_0x3a320c){if(_0x3a320c){return _0x3a320c[_0x7fb8('0x33')]()[_0x7fb8('0x32')](function(){var _0x3c02fb=_0x3a320c[_0x7fb8('0x34')]({'plain':!![]});var _0x418d5f='SmsAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x418d5f,'resourceId':_0x3c02fb['id']}})[_0x7fb8('0x32')](function(){return _0x3a320c;});})[_0x7fb8('0x32')](function(){_0x51e1ad[_0x7fb8('0x29')](0xcc)[_0x7fb8('0x2a')]();});}};}function handleEntityNotFound(_0x2b2925,_0x2c5b38){return function(_0x45ef42){if(!_0x45ef42){_0x2b2925[_0x7fb8('0x28')](0x194);}return _0x45ef42;};}function handleError(_0x115d9e,_0x2f75cb){_0x2f75cb=_0x2f75cb||0x1f4;return function(_0x5c9674){logger[_0x7fb8('0x24')](_0x5c9674['stack']);if(_0x5c9674[_0x7fb8('0x35')]){delete _0x5c9674[_0x7fb8('0x35')];}_0x115d9e[_0x7fb8('0x29')](_0x2f75cb)['send'](_0x5c9674);};}exports[_0x7fb8('0x36')]=function(_0x3e8f67,_0xf3d579){var _0x3019df={'include':[{'model':db[_0x7fb8('0x37')],'as':_0x7fb8('0x38')}]},_0x5d39f1={},_0x128e26={'count':0x0,'rows':[]};var _0x8d8c76=_['map'](db[_0x7fb8('0x39')][_0x7fb8('0x3a')],function(_0x3bdd02){return{'name':_0x3bdd02[_0x7fb8('0x3b')],'type':_0x3bdd02[_0x7fb8('0x3c')][_0x7fb8('0x3d')]};});_0x5d39f1[_0x7fb8('0x3e')]=_[_0x7fb8('0x3f')](_0x8d8c76,_0x7fb8('0x35'));_0x5d39f1[_0x7fb8('0x40')]=_['keys'](_0x3e8f67['query']);_0x5d39f1[_0x7fb8('0x41')]=_[_0x7fb8('0x42')](_0x5d39f1[_0x7fb8('0x3e')],_0x5d39f1['query']);_0x3019df[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x5d39f1['model'],qs[_0x7fb8('0x44')](_0x3e8f67['query']['fields']));_0x3019df['attributes']=_0x3019df[_0x7fb8('0x43')]['length']?_0x3019df[_0x7fb8('0x43')]:_0x5d39f1[_0x7fb8('0x3e')];if(!_0x3e8f67[_0x7fb8('0x40')][_0x7fb8('0x45')]('nolimit')){_0x3019df[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x3e8f67[_0x7fb8('0x40')][_0x7fb8('0x2c')]);_0x3019df[_0x7fb8('0x2b')]=qs[_0x7fb8('0x2b')](_0x3e8f67[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}_0x3019df[_0x7fb8('0x46')]=qs[_0x7fb8('0x47')](_0x3e8f67['query']['sort']);_0x3019df['where']=qs[_0x7fb8('0x41')](_[_0x7fb8('0x48')](_0x3e8f67[_0x7fb8('0x40')],_0x5d39f1[_0x7fb8('0x41')]),_0x8d8c76);if(_0x3e8f67[_0x7fb8('0x40')]['filter']){_0x3019df[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x3019df[_0x7fb8('0x49')],{'$or':_[_0x7fb8('0x3f')](_0x8d8c76,function(_0x2ca264){if(_0x2ca264[_0x7fb8('0x3c')]!=='VIRTUAL'){var _0x4bd686={};_0x4bd686[_0x2ca264[_0x7fb8('0x35')]]={'$like':'%'+_0x3e8f67[_0x7fb8('0x40')][_0x7fb8('0x4b')]+'%'};return _0x4bd686;}})});}_0x3019df=_[_0x7fb8('0x4a')]({},_0x3019df,_0x3e8f67[_0x7fb8('0x4c')]);var _0x43b3ef={'where':_0x3019df[_0x7fb8('0x49')]};return db[_0x7fb8('0x39')]['count'](_0x43b3ef)[_0x7fb8('0x32')](function(_0x1b0b27){_0x128e26[_0x7fb8('0x2e')]=_0x1b0b27;if(_0x3e8f67[_0x7fb8('0x40')]['includeAll']){_0x3019df[_0x7fb8('0x4d')]=[{'all':!![]}];}return db[_0x7fb8('0x39')]['findAll'](_0x3019df);})[_0x7fb8('0x32')](function(_0xc3df65){_0x128e26[_0x7fb8('0x4e')]=_0xc3df65;return _0x128e26;})[_0x7fb8('0x32')](respondWithFilteredResult(_0xf3d579,_0x3019df))[_0x7fb8('0x27')](handleError(_0xf3d579,null));};exports['show']=function(_0x8c7ff7,_0x3791e5){var _0x4efc5={'raw':![],'where':{'id':_0x8c7ff7['params']['id']},'include':[{'model':db[_0x7fb8('0x37')],'as':_0x7fb8('0x38')}]},_0x5b3ee7={};_0x5b3ee7[_0x7fb8('0x3e')]=_[_0x7fb8('0x4f')](db[_0x7fb8('0x39')][_0x7fb8('0x3a')]);_0x5b3ee7[_0x7fb8('0x40')]=_[_0x7fb8('0x4f')](_0x8c7ff7[_0x7fb8('0x40')]);_0x5b3ee7[_0x7fb8('0x41')]=_['intersection'](_0x5b3ee7[_0x7fb8('0x3e')],_0x5b3ee7[_0x7fb8('0x40')]);_0x4efc5[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x5b3ee7[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x8c7ff7['query'][_0x7fb8('0x44')]));_0x4efc5[_0x7fb8('0x43')]=_0x4efc5[_0x7fb8('0x43')]['length']?_0x4efc5[_0x7fb8('0x43')]:_0x5b3ee7[_0x7fb8('0x3e')];if(_0x8c7ff7[_0x7fb8('0x40')][_0x7fb8('0x50')]){_0x4efc5[_0x7fb8('0x4d')]=[{'all':!![]}];}_0x4efc5=_[_0x7fb8('0x4a')]({},_0x4efc5,_0x8c7ff7[_0x7fb8('0x4c')]);return db[_0x7fb8('0x39')][_0x7fb8('0x51')](_0x4efc5)[_0x7fb8('0x32')](handleEntityNotFound(_0x3791e5,null))[_0x7fb8('0x32')](respondWithResult(_0x3791e5,null))[_0x7fb8('0x27')](handleError(_0x3791e5,null));};exports[_0x7fb8('0x52')]=function(_0x2c4e1d,_0x8b9eec){return db[_0x7fb8('0x39')]['create'](_0x2c4e1d[_0x7fb8('0x53')],{})[_0x7fb8('0x32')](function(_0x1f639f){var _0x30c702=_0x2c4e1d['user'][_0x7fb8('0x34')]({'plain':!![]});if(!_0x30c702)throw new Error(_0x7fb8('0x54'));if(_0x30c702['role']==='user'){var _0x64d8dc=_0x1f639f['get']({'plain':!![]});var _0x3d1942=_0x7fb8('0x55');return db['UserProfileSection'][_0x7fb8('0x51')]({'where':{'name':_0x3d1942,'userProfileId':_0x30c702[_0x7fb8('0x56')]},'raw':!![]})['then'](function(_0x5186ae){if(_0x5186ae&&_0x5186ae[_0x7fb8('0x57')]===0x0){return db[_0x7fb8('0x58')]['create']({'name':_0x64d8dc[_0x7fb8('0x35')],'resourceId':_0x64d8dc['id'],'type':_0x5186ae['name'],'sectionId':_0x5186ae['id']},{})[_0x7fb8('0x32')](function(){return _0x1f639f;});}else{return _0x1f639f;}})[_0x7fb8('0x27')](function(_0x36b1a5){logger['error'](_0x7fb8('0x59'),_0x36b1a5);throw _0x36b1a5;});}return _0x1f639f;})[_0x7fb8('0x32')](respondWithResult(_0x8b9eec,0xc9))[_0x7fb8('0x27')](handleError(_0x8b9eec,null));};exports['update']=function(_0x58e0c8,_0x11918b){if(_0x58e0c8[_0x7fb8('0x53')]['id']){delete _0x58e0c8[_0x7fb8('0x53')]['id'];}return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x58e0c8[_0x7fb8('0x5a')]['id']},'include':[{'model':db[_0x7fb8('0x37')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x11918b,null))[_0x7fb8('0x32')](saveUpdates(_0x58e0c8[_0x7fb8('0x53')],null))[_0x7fb8('0x32')](respondWithResult(_0x11918b,null))['catch'](handleError(_0x11918b,null));};exports[_0x7fb8('0x33')]=function(_0x8ad055,_0x2aa0e4){return db[_0x7fb8('0x39')]['find']({'where':{'id':_0x8ad055['params']['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x2aa0e4,null))['then'](removeEntity(_0x2aa0e4,null))[_0x7fb8('0x27')](handleError(_0x2aa0e4,null));};exports[_0x7fb8('0x5b')]=function(_0x307dd9,_0x1246ac){return db['SmsAccount']['describe']()[_0x7fb8('0x32')](respondWithResult(_0x1246ac,null))['catch'](handleError(_0x1246ac,null));};exports[_0x7fb8('0x5c')]=function(_0x183df4,_0x4caa1b,_0x2e9e10){if(_0x183df4[_0x7fb8('0x53')]['id']){delete _0x183df4['body']['id'];}return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x183df4[_0x7fb8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4caa1b,null))['then'](function(_0x3527f8){if(_0x3527f8){_0x183df4[_0x7fb8('0x53')][_0x7fb8('0x5d')]=_0x3527f8['id'];return db[_0x7fb8('0x5e')]['create'](_0x183df4[_0x7fb8('0x53')]);}})[_0x7fb8('0x32')](respondWithResult(_0x4caa1b,null))[_0x7fb8('0x27')](handleError(_0x4caa1b,null));};exports[_0x7fb8('0x5f')]=function(_0x5e01a1,_0x491249,_0xef20d3){var _0x24e86d={'raw':![],'where':{}};var _0x3c958c={};var _0x5c682f={'count':0x0,'rows':[]};return db[_0x7fb8('0x39')]['findOne']({'where':{'id':_0x5e01a1['params']['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x491249,null))[_0x7fb8('0x32')](function(_0x113d72){if(_0x113d72){_0x3c958c['model']=_[_0x7fb8('0x4f')](db[_0x7fb8('0x5e')][_0x7fb8('0x3a')]);_0x3c958c[_0x7fb8('0x40')]=_[_0x7fb8('0x4f')](_0x5e01a1[_0x7fb8('0x40')]);_0x3c958c['filters']=_['intersection'](_0x3c958c['model'],_0x3c958c[_0x7fb8('0x40')]);_0x24e86d[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x3c958c[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x44')]));_0x24e86d[_0x7fb8('0x43')]=_0x24e86d['attributes']['length']?_0x24e86d[_0x7fb8('0x43')]:_0x3c958c[_0x7fb8('0x3e')];if(!_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x45')](_0x7fb8('0x60'))){_0x24e86d[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x2c')]);_0x24e86d[_0x7fb8('0x2b')]=qs[_0x7fb8('0x2b')](_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}_0x24e86d[_0x7fb8('0x46')]=qs[_0x7fb8('0x47')](_0x5e01a1[_0x7fb8('0x40')]['sort']);_0x24e86d[_0x7fb8('0x49')]=qs[_0x7fb8('0x41')](_[_0x7fb8('0x48')](_0x5e01a1[_0x7fb8('0x40')],_0x3c958c[_0x7fb8('0x41')]));_0x24e86d[_0x7fb8('0x49')]['SmsAccountId']=_0x113d72['id'];if(_0x5e01a1['query'][_0x7fb8('0x4b')]){_0x24e86d[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x24e86d[_0x7fb8('0x49')],{'$or':_[_0x7fb8('0x3f')](_0x24e86d[_0x7fb8('0x43')],function(_0x28ad30){var _0x54335b={};_0x54335b[_0x28ad30]={'$like':'%'+_0x5e01a1[_0x7fb8('0x40')][_0x7fb8('0x4b')]+'%'};return _0x54335b;})});}_0x24e86d=_[_0x7fb8('0x4a')]({},_0x24e86d,_0x5e01a1[_0x7fb8('0x4c')]);return db[_0x7fb8('0x5e')][_0x7fb8('0x2e')]({'where':_0x24e86d['where']})['then'](function(_0x58c99d){_0x5c682f['count']=_0x58c99d;if(_0x5e01a1['query'][_0x7fb8('0x50')]){_0x24e86d[_0x7fb8('0x4d')]=[{'all':!![]}];}return db['Disposition'][_0x7fb8('0x61')](_0x24e86d);})[_0x7fb8('0x32')](function(_0x352106){_0x5c682f[_0x7fb8('0x4e')]=_0x352106;return _0x5c682f;});}})['then'](respondWithFilteredResult(_0x491249,_0x24e86d))['catch'](handleError(_0x491249,null));};exports[_0x7fb8('0x62')]=function(_0x17105a,_0x1cde8d,_0x990020){return db['SmsAccount'][_0x7fb8('0x51')]({'where':{'id':_0x17105a[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x1cde8d,null))[_0x7fb8('0x32')](function(_0x3569e0){if(_0x3569e0){return _0x3569e0[_0x7fb8('0x62')](_0x17105a[_0x7fb8('0x40')][_0x7fb8('0x63')]);}})[_0x7fb8('0x32')](respondWithStatusCode(_0x1cde8d,null))[_0x7fb8('0x27')](handleError(_0x1cde8d,null));};exports[_0x7fb8('0x64')]=function(_0x5a25cd,_0x1fe493,_0x30a7c3){if(_0x5a25cd['body']['id']){delete _0x5a25cd[_0x7fb8('0x53')]['id'];}return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x5a25cd['params']['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x1fe493,null))[_0x7fb8('0x32')](function(_0x3bfb72){if(_0x3bfb72){_0x5a25cd[_0x7fb8('0x53')]['SmsAccountId']=_0x3bfb72['id'];return db[_0x7fb8('0x65')][_0x7fb8('0x52')](_0x5a25cd[_0x7fb8('0x53')]);}})[_0x7fb8('0x32')](respondWithResult(_0x1fe493,null))['catch'](handleError(_0x1fe493,null));};exports['getAnswers']=function(_0x57b180,_0x2c6c96,_0x39bde2){var _0x332eb4={'raw':![],'where':{}};var _0x53d3da={};var _0x309d73={'count':0x0,'rows':[]};return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x57b180[_0x7fb8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2c6c96,null))[_0x7fb8('0x32')](function(_0x1501e2){if(_0x1501e2){_0x53d3da[_0x7fb8('0x3e')]=_[_0x7fb8('0x4f')](db['CannedAnswer'][_0x7fb8('0x3a')]);_0x53d3da['query']=_['keys'](_0x57b180[_0x7fb8('0x40')]);_0x53d3da[_0x7fb8('0x41')]=_[_0x7fb8('0x42')](_0x53d3da['model'],_0x53d3da[_0x7fb8('0x40')]);_0x332eb4[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x53d3da[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x57b180['query']['fields']));_0x332eb4[_0x7fb8('0x43')]=_0x332eb4[_0x7fb8('0x43')]['length']?_0x332eb4[_0x7fb8('0x43')]:_0x53d3da[_0x7fb8('0x3e')];if(!_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x45')]('nolimit')){_0x332eb4[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x57b180['query']['limit']);_0x332eb4['offset']=qs['offset'](_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}_0x332eb4[_0x7fb8('0x46')]=qs[_0x7fb8('0x47')](_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x47')]);_0x332eb4[_0x7fb8('0x49')]=qs['filters'](_['pick'](_0x57b180[_0x7fb8('0x40')],_0x53d3da[_0x7fb8('0x41')]));_0x332eb4[_0x7fb8('0x49')][_0x7fb8('0x5d')]=_0x1501e2['id'];if(_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x4b')]){_0x332eb4[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x332eb4[_0x7fb8('0x49')],{'$or':_['map'](_0x332eb4['attributes'],function(_0x1ae349){var _0x125211={};_0x125211[_0x1ae349]={'$like':'%'+_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x4b')]+'%'};return _0x125211;})});}_0x332eb4=_[_0x7fb8('0x4a')]({},_0x332eb4,_0x57b180[_0x7fb8('0x4c')]);return db[_0x7fb8('0x65')][_0x7fb8('0x2e')]({'where':_0x332eb4['where']})[_0x7fb8('0x32')](function(_0xe63bbf){_0x309d73['count']=_0xe63bbf;if(_0x57b180[_0x7fb8('0x40')][_0x7fb8('0x50')]){_0x332eb4[_0x7fb8('0x4d')]=[{'all':!![]}];}return db[_0x7fb8('0x65')][_0x7fb8('0x61')](_0x332eb4);})[_0x7fb8('0x32')](function(_0x5aa042){_0x309d73[_0x7fb8('0x4e')]=_0x5aa042;return _0x309d73;});}})[_0x7fb8('0x32')](respondWithFilteredResult(_0x2c6c96,_0x332eb4))['catch'](handleError(_0x2c6c96,null));};exports['removeAnswers']=function(_0x478a2f,_0x292f53,_0x17b6ef){return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x478a2f[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x292f53,null))[_0x7fb8('0x32')](function(_0x44c30e){if(_0x44c30e){return _0x44c30e[_0x7fb8('0x67')](_0x478a2f[_0x7fb8('0x40')][_0x7fb8('0x63')]);}})[_0x7fb8('0x32')](respondWithStatusCode(_0x292f53,null))[_0x7fb8('0x27')](handleError(_0x292f53,null));};exports[_0x7fb8('0x68')]=function(_0x19ac4e,_0x4c831f,_0x43f2f){var _0x5b3d8d={'channel':_0x7fb8('0x69')};var _0x1f2cc0=[];var _0x21cc7a=[];var _0x2b1793={};return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x19ac4e['params']['id']},'include':[{'model':db[_0x7fb8('0x6a')],'as':'Applications'}]})[_0x7fb8('0x32')](handleEntityNotFound(_0x4c831f,null))[_0x7fb8('0x32')](function(_0x15f32e){_0x5b3d8d['account']=_0x15f32e;_0x5b3d8d[_0x7fb8('0x6b')]=_['orderBy'](_0x15f32e['Applications'],[_0x7fb8('0x6c')],[_0x7fb8('0x6d')]);if(_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x6f')]){delete _0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x6f')];}return db[_0x7fb8('0x70')]['describe']();})[_0x7fb8('0x32')](function(_0x807519){if(!_0x807519){throw new db['Sequelize'][(_0x7fb8('0x71'))](_0x7fb8('0x72'));}_0x1f2cc0=_['difference'](_[_0x7fb8('0x4f')](_0x807519),[_0x7fb8('0x73'),_0x7fb8('0x74')]);_0x21cc7a=_[_0x7fb8('0x75')](_[_0x7fb8('0x4f')](_0x807519),['createdAt',_0x7fb8('0x74'),_0x7fb8('0x76'),_0x7fb8('0x77')]);_0x5b3d8d[_0x7fb8('0x53')]={'mapKey':_0x7fb8('0x78')};if(_0x5b3d8d['account'][_0x7fb8('0x3c')]){switch(_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x3c')]){case'twilio':_0x5b3d8d['body']['from']=_0x19ac4e['body'][_0x7fb8('0x79')];_0x5b3d8d['body'][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x7a')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x7b')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x7c')];break;case _0x7fb8('0x7d'):_0x5b3d8d[_0x7fb8('0x53')]['from']='+'+_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x7e')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e['body'][_0x7fb8('0x7f')];break;case _0x7fb8('0x80'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e['body']['from'];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x25')];break;case _0x7fb8('0x82'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e['body'][_0x7fb8('0x81')];_0x5b3d8d[_0x7fb8('0x53')]['body']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x53')];_0x5b3d8d['body']['messageId']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x83')];break;case _0x7fb8('0x84'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x79')];_0x5b3d8d[_0x7fb8('0x53')]['body']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x85')];_0x5b3d8d[_0x7fb8('0x53')]['messageId']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x86')];break;case _0x7fb8('0x87'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]='+'+_0x19ac4e['body'][_0x7fb8('0x88')][0x0]['from'];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x88')][0x0][_0x7fb8('0x7f')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x7b')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x88')][0x0][_0x7fb8('0x7b')];break;case _0x7fb8('0x89'):_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e['body'][_0x7fb8('0x8a')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x8b')][_0x7fb8('0x25')];break;case'clickatell':_0x5b3d8d[_0x7fb8('0x53')]['from']=_0x19ac4e['body'][_0x7fb8('0x8c')];_0x5b3d8d['body'][_0x7fb8('0x53')]=_0x19ac4e['body'][_0x7fb8('0x7f')];_0x5b3d8d['body'][_0x7fb8('0x7b')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x8d')];break;case _0x7fb8('0x8e'):_0x5b3d8d['body']['messageId']=_0x19ac4e[_0x7fb8('0x53')][0x0][_0x7fb8('0x25')]['id'];_0x5b3d8d[_0x7fb8('0x53')]['from']=_0x19ac4e[_0x7fb8('0x53')][0x0]['message'][_0x7fb8('0x81')];_0x5b3d8d['body'][_0x7fb8('0x53')]=_0x19ac4e['body'][0x0][_0x7fb8('0x25')]['text'];break;case'intelepeer':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x81')];_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x25')];_0x5b3d8d[_0x7fb8('0x53')]['messageId']=_0x19ac4e[_0x7fb8('0x53')][_0x7fb8('0x8f')];break;}}if(_0x5b3d8d[_0x7fb8('0x53')]['id']){delete _0x5b3d8d[_0x7fb8('0x53')]['id'];}if(_[_0x7fb8('0x90')](_0x5b3d8d['body'][_0x7fb8('0x81')])){throw new db[(_0x7fb8('0x91'))][(_0x7fb8('0x71'))](_0x7fb8('0x92'));}if(_[_0x7fb8('0x90')](_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')])||_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x53')]===''){throw new db[(_0x7fb8('0x91'))][(_0x7fb8('0x71'))](_0x7fb8('0x93'));}if(_[_0x7fb8('0x90')](_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x94')])){throw new db[(_0x7fb8('0x91'))][(_0x7fb8('0x71'))](_0x7fb8('0x95')+_0x21cc7a);}if(!_[_0x7fb8('0x96')](_0x21cc7a,_0x5b3d8d['body'][_0x7fb8('0x94')])){throw new db[(_0x7fb8('0x91'))]['ValidationError'](_0x7fb8('0x97')+_0x21cc7a);}_0x2b1793[_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x94')]]=_0x5b3d8d[_0x7fb8('0x53')]['from'];return db[_0x7fb8('0x98')]['find']({'where':{'id':_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x77')]},'include':[{'model':db[_0x7fb8('0x70')],'as':'Contacts','where':_0x2b1793,'limit':0x1,'order':[[_0x7fb8('0x74'),_0x7fb8('0x99')]]}]});})[_0x7fb8('0x32')](handleEntityNotFound(_0x4c831f,null))['then'](function(_0x760b2e){if(_0x760b2e){_0x5b3d8d[_0x7fb8('0x9a')]=_[_0x7fb8('0x9b')](_0x760b2e,['Contacts']);if(_0x760b2e[_0x7fb8('0x9c')]['length']){return _0x760b2e[_0x7fb8('0x9c')][0x0];}var _0x42b578=_[_0x7fb8('0x18')](_0x5b3d8d['body'],{'firstName':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')],'ListId':_0x760b2e['id']});_0x42b578[_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x94')]]=_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')];return db['CmContact'][_0x7fb8('0x52')](_0x42b578,{'fields':_0x1f2cc0,'raw':!![]});}})[_0x7fb8('0x32')](handleEntityNotFound(_0x4c831f,null))[_0x7fb8('0x32')](function(_0x16d079){if(_0x16d079){_0x5b3d8d[_0x7fb8('0x9d')]=_0x16d079;var _0x4f4a96={'ContactId':_0x16d079['id'],'phone':_0x5b3d8d[_0x7fb8('0x53')]['from'],'SmsAccountId':_0x19ac4e[_0x7fb8('0x5a')]['id']};var _0x14db54={'ContactId':_0x16d079['id'],'SmsAccountId':_0x19ac4e['params']['id'],'closed':![]};return db[_0x7fb8('0x9e')][_0x7fb8('0x51')]({'where':_0x14db54})['then'](function(_0x10b926){if(_0x10b926){return[_0x10b926,![]];}return db['SmsInteraction'][_0x7fb8('0x52')](_0x4f4a96)['then'](function(_0x1faa08){return[_0x1faa08,!![]];});});}})[_0x7fb8('0x9f')](function(_0x320d5d,_0x523e99){_0x5b3d8d[_0x7fb8('0xa0')]=_0x320d5d[_0x7fb8('0x34')]({'plain':!![]});_0x5b3d8d[_0x7fb8('0xa0')][_0x7fb8('0xa1')]=![];if(_0x523e99){if(_0x5b3d8d['account'][_0x7fb8('0xa2')]){_0x5b3d8d[_0x7fb8('0x6b')][_0x7fb8('0xa3')]({'id':0x0,'priority':_0x5b3d8d[_0x7fb8('0x6b')]['length']+0x1,'app':_0x7fb8('0xa4'),'appdata':'unmanaged','interval':_0x7fb8('0xa5')});}_0x5b3d8d['interaction']['created']=!![];}return db[_0x7fb8('0xa6')]['create']({'phone':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x81')],'messageId':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0x7b')],'body':_0x5b3d8d[_0x7fb8('0x53')]['body'],'SmsAccountId':_0x19ac4e[_0x7fb8('0x5a')]['id'],'SmsInteractionId':_0x320d5d['id'],'direction':'in','ContactId':_0x320d5d['ContactId'],'AttachmentId':_0x5b3d8d[_0x7fb8('0x53')][_0x7fb8('0xa7')]});})[_0x7fb8('0x32')](function(_0xedf7bc){_0x5b3d8d['message']=_0xedf7bc;if(_0x5b3d8d[_0x7fb8('0xa0')]['UserId']){return db[_0x7fb8('0xa8')][_0x7fb8('0x51')]({'attributes':['id','name'],'where':{'id':_0x5b3d8d[_0x7fb8('0xa0')][_0x7fb8('0xa9')]}})[_0x7fb8('0x32')](function(_0x501587){if(_0x501587){_0x5b3d8d[_0x7fb8('0x6b')][_0x7fb8('0xaa')]({'id':0x0,'priority':0x0,'app':_0x7fb8('0xab'),'appdata':_0x501587[_0x7fb8('0x35')]+','+(_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0xac')]||0xa),'interval':_0x7fb8('0xa5')});}return respondWithRpcPromise(_0x7fb8('0xad'),'startRouting',_0x5b3d8d);});}return respondWithRpcPromise(_0x7fb8('0xad'),_0x7fb8('0xae'),_0x5b3d8d);})[_0x7fb8('0x32')](function(_0x5b6f41){if(_0x5b6f41){var _0x52410c=0xc8;var _0xda316='receiveMessage';logger[_0x7fb8('0x1f')](_0x7fb8('0x22'),_0xda316,_0x52410c,'entity\x20found');logger[_0x7fb8('0xaf')](_0x7fb8('0xb0'),_0xda316,_0x52410c,'entity\x20found',JSON[_0x7fb8('0x23')](_0x5b6f41));if(_0x5b3d8d[_0x7fb8('0x6e')][_0x7fb8('0x3c')]===_0x7fb8('0xb1')){return _0x4c831f['status'](_0x52410c)['set'](_0x7fb8('0xb2'),_0x7fb8('0xb3'))[_0x7fb8('0xb4')]('\x0a');}else{return _0x4c831f[_0x7fb8('0x29')](_0x52410c)[_0x7fb8('0xb5')](_0x5b6f41);}}})[_0x7fb8('0x27')](handleError(_0x4c831f,null));};exports[_0x7fb8('0xb6')]=function(_0x12e039,_0x509c79){var _0x586381=_0x12e039[_0x7fb8('0x5a')]['id'];var _0xeadfa5=_0x12e039[_0x7fb8('0x53')];var _0x5b9a20=0xc8;var _0x56ded2=null;return db[_0x7fb8('0xb7')][_0x7fb8('0xb8')]({'isolationLevel':db[_0x7fb8('0xb7')][_0x7fb8('0xb9')][_0x7fb8('0xba')][_0x7fb8('0xbb')]},function(_0x466fed){return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x586381},'transaction':_0x466fed})[_0x7fb8('0x32')](function(_0x50c93f){if(_0x50c93f){return db[_0x7fb8('0x6a')]['destroy']({'where':{'SmsAccountId':_0x586381},'transaction':_0x466fed})[_0x7fb8('0x32')](function(){var _0x157159=_[_0x7fb8('0x3f')](_0xeadfa5,function(_0x336b89){_0x336b89[_0x7fb8('0x5d')]=_0x586381;return _0x336b89;});return db[_0x7fb8('0x6a')][_0x7fb8('0xbc')](_0x157159,{'transaction':_0x466fed});});}else{_0x5b9a20=0x194;_0x56ded2=[];}});})[_0x7fb8('0x32')](function(){if(_0x5b9a20!==0x194){return db[_0x7fb8('0x6a')][_0x7fb8('0xbd')]({'where':{'SmsAccountId':_0x586381},'order':_0x7fb8('0x6c')})[_0x7fb8('0x32')](function(_0x29af9b){_0x56ded2=_0x29af9b;});}})[_0x7fb8('0x27')](function(_0x266b5f){_0x5b9a20=0x1f4;logger[_0x7fb8('0x24')](_0x266b5f[_0x7fb8('0xbe')]);if(_0x266b5f['name']){delete _0x266b5f['name'];}_0x56ded2=_0x266b5f;})['finally'](function(){if(_0x56ded2===null){_0x509c79[_0x7fb8('0x28')](_0x5b9a20);}else{if(_0x5b9a20===0x1f4){_0x509c79[_0x7fb8('0x29')](_0x5b9a20)['send'](_0x56ded2);}else{_0x509c79[_0x7fb8('0x29')](_0x5b9a20)[_0x7fb8('0xb5')](_0x56ded2);}}});};exports[_0x7fb8('0xbf')]=function(_0x3d85f4,_0x12fe79,_0x3ac25c){var _0x378bca={};var _0x2a4c76={};var _0x52df0a;var _0xdaab19;return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x3d85f4['params']['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x12fe79,null))['then'](function(_0x57696b){if(_0x57696b){_0x52df0a=_0x57696b;_0x2a4c76['model']=_[_0x7fb8('0x4f')](db[_0x7fb8('0x6a')][_0x7fb8('0x3a')]);_0x2a4c76['query']=_['keys'](_0x3d85f4[_0x7fb8('0x40')]);_0x2a4c76[_0x7fb8('0x41')]=_[_0x7fb8('0x42')](_0x2a4c76['model'],_0x2a4c76[_0x7fb8('0x40')]);_0x378bca['attributes']=_['intersection'](_0x2a4c76[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x3d85f4[_0x7fb8('0x40')]['fields']));_0x378bca[_0x7fb8('0x43')]=_0x378bca[_0x7fb8('0x43')][_0x7fb8('0xc0')]?_0x378bca[_0x7fb8('0x43')]:_0x2a4c76[_0x7fb8('0x3e')];_0x378bca['order']=qs['sort'](_0x3d85f4['query'][_0x7fb8('0x47')]);_0x378bca[_0x7fb8('0x49')]=qs[_0x7fb8('0x41')](_['pick'](_0x3d85f4['query'],_0x2a4c76[_0x7fb8('0x41')]));if(_0x3d85f4['query'][_0x7fb8('0x4b')]){_0x378bca[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x378bca[_0x7fb8('0x49')],{'$or':_['map'](_0x378bca['attributes'],function(_0x1a876b){var _0x20f11d={};_0x20f11d[_0x1a876b]={'$like':'%'+_0x3d85f4['query'][_0x7fb8('0x4b')]+'%'};return _0x20f11d;})});}_0x378bca=_['merge']({},_0x378bca,_0x3d85f4['options']);return _0x52df0a[_0x7fb8('0xbf')](_0x378bca);}})['then'](function(_0x6e55a9){if(_0x6e55a9){_0xdaab19=_0x6e55a9[_0x7fb8('0xc0')];if(!_0x3d85f4[_0x7fb8('0x40')][_0x7fb8('0x45')](_0x7fb8('0x60'))){_0x378bca[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x3d85f4[_0x7fb8('0x40')]['limit']);_0x378bca[_0x7fb8('0x2b')]=qs['offset'](_0x3d85f4['query'][_0x7fb8('0x2b')]);}return _0x52df0a[_0x7fb8('0xbf')](_0x378bca);}})[_0x7fb8('0x32')](function(_0x4e20ca){if(_0x4e20ca){return _0x4e20ca?{'count':_0xdaab19,'rows':_0x4e20ca}:null;}})[_0x7fb8('0x32')](respondWithResult(_0x12fe79,null))['catch'](handleError(_0x12fe79,null));};exports['getInteractions']=function(_0x57f2a0,_0xf696ee,_0x17ddb1){var _0x18ab64={'raw':![],'where':{}};var _0x1f55e1={};var _0x23ccf1={'count':0x0,'rows':[]};return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x57f2a0[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0xf696ee,null))[_0x7fb8('0x32')](function(_0x4eca40){if(_0x4eca40){_0x1f55e1[_0x7fb8('0x3e')]=_[_0x7fb8('0x4f')](db['SmsInteraction'][_0x7fb8('0x3a')]);_0x1f55e1[_0x7fb8('0x40')]=_['keys'](_0x57f2a0['query']);_0x1f55e1[_0x7fb8('0x41')]=_['intersection'](_0x1f55e1[_0x7fb8('0x3e')],_0x1f55e1[_0x7fb8('0x40')]);_0x18ab64['attributes']=_[_0x7fb8('0x42')](_0x1f55e1[_0x7fb8('0x3e')],qs[_0x7fb8('0x44')](_0x57f2a0[_0x7fb8('0x40')][_0x7fb8('0x44')]));_0x18ab64[_0x7fb8('0x43')]=_0x18ab64[_0x7fb8('0x43')][_0x7fb8('0xc0')]?_0x18ab64[_0x7fb8('0x43')]:_0x1f55e1[_0x7fb8('0x3e')];if(!_0x57f2a0[_0x7fb8('0x40')][_0x7fb8('0x45')](_0x7fb8('0x60'))){_0x18ab64[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x57f2a0['query']['limit']);_0x18ab64[_0x7fb8('0x2b')]=qs[_0x7fb8('0x2b')](_0x57f2a0[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}_0x18ab64['order']=qs[_0x7fb8('0x47')](_0x57f2a0[_0x7fb8('0x40')][_0x7fb8('0x47')]);_0x18ab64[_0x7fb8('0x49')]=qs[_0x7fb8('0x41')](_[_0x7fb8('0x48')](_0x57f2a0[_0x7fb8('0x40')],_0x1f55e1[_0x7fb8('0x41')]));_0x18ab64[_0x7fb8('0x49')]['SmsAccountId']=_0x4eca40['id'];if(_0x57f2a0['query']['filter']){_0x18ab64['where']=_[_0x7fb8('0x4a')](_0x18ab64['where'],{'$or':_[_0x7fb8('0x3f')](_0x18ab64[_0x7fb8('0x43')],function(_0x514ea4){var _0x3e88dc={};_0x3e88dc[_0x514ea4]={'$like':'%'+_0x57f2a0[_0x7fb8('0x40')]['filter']+'%'};return _0x3e88dc;})});}_0x18ab64=_[_0x7fb8('0x4a')]({},_0x18ab64,_0x57f2a0['options']);return db['SmsInteraction'][_0x7fb8('0x2e')]({'where':_0x18ab64[_0x7fb8('0x49')]})[_0x7fb8('0x32')](function(_0x5306d0){_0x23ccf1[_0x7fb8('0x2e')]=_0x5306d0;if(_0x57f2a0['query'][_0x7fb8('0x50')]){_0x18ab64[_0x7fb8('0x4d')]=[{'model':db[_0x7fb8('0x70')],'as':_0x7fb8('0xc1'),'required':![]},{'model':db[_0x7fb8('0xa8')],'as':_0x7fb8('0xc2'),'attributes':['name',_0x7fb8('0xc3'),_0x7fb8('0xc4')],'required':![]},{'model':db[_0x7fb8('0xc5')],'as':'Tags','attributes':['id','name',_0x7fb8('0xc6')],'where':_0x57f2a0['query']['tag']?{'id':_0x57f2a0['query']['tag']}:undefined,'required':_0x57f2a0[_0x7fb8('0x40')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x7fb8('0x61')](_0x18ab64);})[_0x7fb8('0x32')](function(_0x32992b){_0x23ccf1[_0x7fb8('0x4e')]=_0x32992b;return _0x23ccf1;});}})[_0x7fb8('0x32')](respondWithFilteredResult(_0xf696ee,_0x18ab64))['catch'](handleError(_0xf696ee,null));};exports['send']=function(_0x30f6b8,_0x59d9bd,_0x5d8c2e){var _0x548bd4,_0x4bf452,_0x22d297;if(_[_0x7fb8('0x90')](_0x30f6b8[_0x7fb8('0x53')][_0x7fb8('0x53')])||_0x30f6b8[_0x7fb8('0x53')][_0x7fb8('0x53')]===''){throw new db[(_0x7fb8('0x91'))][(_0x7fb8('0x71'))](_0x7fb8('0x93'));}if(_['isNil'](_0x30f6b8['body']['to'])){throw new db[(_0x7fb8('0x91'))]['ValidationError'](_0x7fb8('0xc7'));}_0x548bd4=_0x30f6b8['body']['to'];return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0x30f6b8[_0x7fb8('0x5a')]['id']},'include':[{'model':db[_0x7fb8('0x98')],'as':_0x7fb8('0xc8'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x548bd4},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x7fb8('0x32')](handleEntityNotFound(_0x59d9bd,null))[_0x7fb8('0x32')](function(_0x1b1fe7){if(_0x1b1fe7&&_0x1b1fe7[_0x7fb8('0xc8')]){_0x4bf452=_0x1b1fe7['get']({'plain':!![]});if(_0x4bf452[_0x7fb8('0xc8')]&&_0x4bf452[_0x7fb8('0xc8')][_0x7fb8('0x9c')][_0x7fb8('0xc0')]){return _0x4bf452['List'][_0x7fb8('0x9c')][0x0];}return db[_0x7fb8('0x70')]['create'](_[_0x7fb8('0x18')](_0x30f6b8[_0x7fb8('0x53')],{'firstName':_0x548bd4,'mobile':_0x548bd4,'phone':_0x548bd4,'ListId':_0x4bf452[_0x7fb8('0x77')]}));}})[_0x7fb8('0x32')](handleEntityNotFound(_0x59d9bd,null))[_0x7fb8('0x32')](function(_0x24989f){if(_0x24989f){_0x22d297=_0x24989f;return db['SmsInteraction'][_0x7fb8('0x51')]({'where':{'ContactId':_0x22d297['id'],'closed':![],'SmsAccountId':_0x4bf452['id']}})[_0x7fb8('0x32')](function(_0x427fc4){if(_0x427fc4){return[_0x427fc4,![]];}return db[_0x7fb8('0x9e')][_0x7fb8('0x52')]({'UserId':_0x30f6b8[_0x7fb8('0xc9')]['id'],'ContactId':_0x22d297['id'],'SmsAccountId':_0x4bf452['id'],'phone':_0x548bd4,'firstMsgDirection':_0x7fb8('0xca'),'Messages':[_[_0x7fb8('0x4a')](_0x30f6b8[_0x7fb8('0x53')],{'read':![],'body':_0x30f6b8[_0x7fb8('0x53')][_0x7fb8('0x53')],'phone':_0x548bd4,'SmsAccountId':_0x4bf452['id'],'UserId':_0x30f6b8['user']['id'],'ContactId':_0x22d297['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x7fb8('0xcb')}]})[_0x7fb8('0x32')](function(_0x26bd70){return[_0x26bd70,!![]];});});}})['spread'](function(_0x344810,_0x1067d9){if(_0x1067d9){return _0x344810;}return db[_0x7fb8('0xa6')][_0x7fb8('0x52')](_['merge'](_0x30f6b8[_0x7fb8('0x53')],{'read':![],'body':_0x30f6b8['body'][_0x7fb8('0x53')],'phone':_0x548bd4,'SmsAccountId':_0x4bf452['id'],'SmsInteractionId':_0x344810['id'],'UserId':_0x30f6b8['user']['id'],'ContactId':_0x22d297['id']}))[_0x7fb8('0x32')](function(_0x2ae5e7){_0x344810[_0x7fb8('0xcc')][_0x7fb8('0xcb')]=[];_0x344810['dataValues']['Messages']['push'](_0x2ae5e7[_0x7fb8('0xcc')]);return _0x344810;});})[_0x7fb8('0x32')](respondWithResult(_0x59d9bd,null))['catch'](handleError(_0x59d9bd,null));};exports[_0x7fb8('0x29')]=function(_0x5b0cb8,_0x2f8351,_0x2da3ac){if(_0x5b0cb8['body']['id']){delete _0x5b0cb8[_0x7fb8('0x53')]['id'];}var _0x34ab01,_0x123789,_0x4d2497;return db['SmsAccount']['find']({'where':{'id':_0x5b0cb8[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x2f8351,null))[_0x7fb8('0x32')](function(_0x351d79){if(_0x351d79){_0x4d2497=_0x351d79;logger[_0x7fb8('0xaf')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fb8('0x29'),'received\x20delivery\x20report\x20from',_0x351d79[_0x7fb8('0x3c')],util[_0x7fb8('0xcd')](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));switch(_0x351d79[_0x7fb8('0x3c')]){case _0x7fb8('0x7d'):if(_0x5b0cb8['body'][_0x7fb8('0xce')]&&_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')]){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')];return db[_0x7fb8('0xa6')][_0x7fb8('0x51')]({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xce')]}});}break;case _0x7fb8('0x80'):if(_0x5b0cb8[_0x7fb8('0x53')]['requestid']&&_0x5b0cb8['body'][_0x7fb8('0xcf')]){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xcf')];return db[_0x7fb8('0xa6')]['find']({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')]['requestid']}});}break;case _0x7fb8('0x82'):if(_0x5b0cb8['body'][_0x7fb8('0x83')]&&_0x5b0cb8[_0x7fb8('0x53')]['status_code']){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xd0')];return db[_0x7fb8('0xa6')]['find']({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x83')]}});}break;case _0x7fb8('0x87'):var _0x10ffc5=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x88')][0x0];if(_0x10ffc5[_0x7fb8('0x7b')]&&_0x10ffc5[_0x7fb8('0x29')]['groupName']===_0x7fb8('0xd1')){_0x123789=_0x10ffc5[_0x7fb8('0x29')][_0x7fb8('0xd2')];return db['SmsMessage'][_0x7fb8('0x51')]({'where':{'messageId':_0x10ffc5['messageId']}});}break;case _0x7fb8('0xd3'):if(_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x7b')]&&_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')]){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')];return db[_0x7fb8('0xa6')][_0x7fb8('0x51')]({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')]['messageId']}});}break;case _0x7fb8('0x8e'):if(_0x5b0cb8[_0x7fb8('0x53')][0x0][_0x7fb8('0x25')]['id']){_0x123789=_0x5b0cb8[_0x7fb8('0x53')][0x0][_0x7fb8('0x3c')];return db[_0x7fb8('0xa6')][_0x7fb8('0x51')]({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')][0x0]['message']['id']}});}break;case _0x7fb8('0xd4'):if(_0x5b0cb8['body'][_0x7fb8('0xd5')]&&_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x29')]){_0x123789=_0x5b0cb8['body'][_0x7fb8('0x29')];return db[_0x7fb8('0xa6')]['find']({'where':{'messageId':_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xd5')]}});}break;}}})['then'](handleEntityNotFound(_0x2f8351,null))[_0x7fb8('0x32')](function(_0x44b51d){if(_0x44b51d){_0x34ab01=_0x44b51d;switch(_0x4d2497['type']){case _0x7fb8('0x7d'):if(_0x123789==='DELIVERED'){return _0x34ab01['update']({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0x7d'),util['inspect'](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case _0x7fb8('0x80'):if(_0x123789==='1'){return _0x34ab01[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0x7d'),util['inspect'](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case _0x7fb8('0x82'):if(!_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0xd6')]&&_0x123789>=0xc8&&_0x123789<=0xce){return _0x34ab01[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fb8('0x29'),'clicksend',util['inspect'](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case _0x7fb8('0x87'):var _0x2d4265=_0x5b0cb8[_0x7fb8('0x53')][_0x7fb8('0x88')][0x0];if(_0x2d4265[_0x7fb8('0x29')][_0x7fb8('0xd2')]===_0x7fb8('0xd1')){return _0x34ab01[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7fb8('0x29'),'infobip',util['inspect'](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x123789==_0x7fb8('0xd7')||_0x123789=='RECEIVED_BY_RECIPIENT'){return _0x34ab01[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0xd3'),util[_0x7fb8('0xcd')](_0x5b0cb8[_0x7fb8('0x53')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x123789==_0x7fb8('0xd8')){return _0x34ab01['update']({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),'bandwidth',util[_0x7fb8('0xcd')](_0x5b0cb8['body'],{'showHidden':![],'depth':null}));}break;case _0x7fb8('0xd4'):if(_0x123789===_0x7fb8('0xd9')||_0x123789===_0x7fb8('0xda')){return _0x34ab01['update']({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),'intelepeer',util[_0x7fb8('0xcd')](_0x5b0cb8['body'],{'showHidden':![],'depth':null}));}break;}return _0x34ab01;}})[_0x7fb8('0x32')](respondWithResult(_0x2f8351,null))['catch'](handleError(_0x2f8351,null));};exports['statusGet']=function(_0x5c630b,_0x16a98d,_0x55f565){var _0x1e026b,_0x19d226,_0x451e2d;return db['SmsAccount']['find']({'where':{'id':_0x5c630b[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x16a98d,null))[_0x7fb8('0x32')](function(_0x19eba7){if(_0x19eba7){_0x451e2d=_0x19eba7;logger[_0x7fb8('0xaf')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0xdb'),_0x19eba7['type'],util[_0x7fb8('0xcd')](_0x5c630b[_0x7fb8('0x40')],{'showHidden':![],'depth':null}));switch(_0x19eba7['type']){case'csc':if(_0x5c630b[_0x7fb8('0x40')][_0x7fb8('0xdc')]&&_0x5c630b[_0x7fb8('0x40')][_0x7fb8('0xdd')]){_0x19d226=_0x5c630b[_0x7fb8('0x40')][_0x7fb8('0xdd')];return db[_0x7fb8('0xa6')]['find']({'where':{'messageId':_0x5c630b[_0x7fb8('0x40')][_0x7fb8('0xdc')]}});}break;}}})[_0x7fb8('0x32')](handleEntityNotFound(_0x16a98d,null))['then'](function(_0x1046a3){if(_0x1046a3){_0x1e026b=_0x1046a3;switch(_0x451e2d[_0x7fb8('0x3c')]){case _0x7fb8('0x89'):if(_0x19d226==='2'||_0x19d226==='6'){return _0x1e026b[_0x7fb8('0x31')]({'read':!![]});}else{logger[_0x7fb8('0x24')](_0x7fb8('0x22'),_0x7fb8('0x29'),_0x7fb8('0x89'),util[_0x7fb8('0xcd')](_0x5c630b[_0x7fb8('0x40')],{'showHidden':![],'depth':null}));};break;}return _0x1e026b;}})['then'](respondWithResult(_0x16a98d,null))['catch'](handleError(_0x16a98d,null));};exports[_0x7fb8('0xde')]=function(_0xd7b6b1,_0x30f933,_0x30e19d){return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0xd7b6b1[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x30f933,null))[_0x7fb8('0x32')](function(_0x44c590){if(_0x44c590){return _0x44c590['addAgents'](_0xd7b6b1[_0x7fb8('0x53')][_0x7fb8('0x63')],_['omit'](_0xd7b6b1['body'],[_0x7fb8('0x63'),'id'])||{})[_0x7fb8('0x9f')](function(_0x1e7f61){for(var _0x5a10cf=0x0;_0x5a10cf<_0xd7b6b1[_0x7fb8('0x53')][_0x7fb8('0x63')][_0x7fb8('0xc0')];_0x5a10cf+=0x1){socket[_0x7fb8('0xdf')](_0x7fb8('0xe0'),{'UserId':Number(_0xd7b6b1[_0x7fb8('0x53')]['ids'][_0x5a10cf]),'SmsAccountId':Number(_0xd7b6b1[_0x7fb8('0x5a')]['id'])});}return _0x1e7f61;});}})[_0x7fb8('0x32')](respondWithResult(_0x30f933,null))[_0x7fb8('0x27')](handleError(_0x30f933,null));};exports[_0x7fb8('0xe1')]=function(_0xe625d0,_0x56f5fc,_0x2d8760){return db[_0x7fb8('0x39')][_0x7fb8('0x51')]({'where':{'id':_0xe625d0[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x56f5fc,null))[_0x7fb8('0x32')](function(_0xa7f1f1){if(_0xa7f1f1){return _0xa7f1f1[_0x7fb8('0xe1')](_0xe625d0[_0x7fb8('0x40')][_0x7fb8('0x63')])[_0x7fb8('0x32')](function(){if(_[_0x7fb8('0xe2')](_0xe625d0[_0x7fb8('0x40')]['ids'])){for(var _0x30942f=0x0;_0x30942f<_0xe625d0[_0x7fb8('0x40')][_0x7fb8('0x63')]['length'];_0x30942f+=0x1){socket['emit'](_0x7fb8('0xe3'),{'UserId':Number(_0xe625d0[_0x7fb8('0x40')]['ids'][_0x30942f]),'SmsAccountId':Number(_0xe625d0[_0x7fb8('0x5a')]['id'])});}}else{socket['emit'](_0x7fb8('0xe3'),{'UserId':Number(_0xe625d0[_0x7fb8('0x40')][_0x7fb8('0x63')]),'SmsAccountId':Number(_0xe625d0['params']['id'])});}});}})[_0x7fb8('0x32')](respondWithStatusCode(_0x56f5fc,null))['catch'](handleError(_0x56f5fc,null));};exports[_0x7fb8('0xe4')]=function(_0x395384,_0x9d6a57,_0x24f910){var _0x46dbaf={};var _0x16db44={};var _0x34eb46;var _0x403078;return db[_0x7fb8('0x39')][_0x7fb8('0x66')]({'where':{'id':_0x395384[_0x7fb8('0x5a')]['id']}})[_0x7fb8('0x32')](handleEntityNotFound(_0x9d6a57,null))[_0x7fb8('0x32')](function(_0x478e39){if(_0x478e39){_0x34eb46=_0x478e39;_0x16db44[_0x7fb8('0x3e')]=_['keys'](db[_0x7fb8('0xa8')][_0x7fb8('0x3a')]);_0x16db44['query']=_[_0x7fb8('0x4f')](_0x395384[_0x7fb8('0x40')]);_0x16db44[_0x7fb8('0x41')]=_[_0x7fb8('0x42')](_0x16db44['model'],_0x16db44[_0x7fb8('0x40')]);_0x46dbaf[_0x7fb8('0x43')]=_[_0x7fb8('0x42')](_0x16db44['model'],qs[_0x7fb8('0x44')](_0x395384[_0x7fb8('0x40')][_0x7fb8('0x44')]));_0x46dbaf[_0x7fb8('0x43')]=_0x46dbaf[_0x7fb8('0x43')][_0x7fb8('0xc0')]?_0x46dbaf[_0x7fb8('0x43')]:_0x16db44[_0x7fb8('0x3e')];_0x46dbaf[_0x7fb8('0x46')]=qs['sort'](_0x395384[_0x7fb8('0x40')][_0x7fb8('0x47')]);_0x46dbaf[_0x7fb8('0x49')]=qs[_0x7fb8('0x41')](_['pick'](_0x395384[_0x7fb8('0x40')],_0x16db44['filters']));if(_0x395384[_0x7fb8('0x40')]['filter']){_0x46dbaf[_0x7fb8('0x49')]=_[_0x7fb8('0x4a')](_0x46dbaf[_0x7fb8('0x49')],{'$or':_['map'](_0x46dbaf[_0x7fb8('0x43')],function(_0x5459aa){var _0x1d990d={};_0x1d990d[_0x5459aa]={'$like':'%'+_0x395384[_0x7fb8('0x40')][_0x7fb8('0x4b')]+'%'};return _0x1d990d;})});}_0x46dbaf=_[_0x7fb8('0x4a')]({},_0x46dbaf,_0x395384[_0x7fb8('0x4c')]);return _0x34eb46[_0x7fb8('0xe4')](_0x46dbaf);}})[_0x7fb8('0x32')](function(_0x2c2d5c){if(_0x2c2d5c){_0x403078=_0x2c2d5c['length'];if(!_0x395384['query']['hasOwnProperty'](_0x7fb8('0x60'))){_0x46dbaf[_0x7fb8('0x2c')]=qs[_0x7fb8('0x2c')](_0x395384[_0x7fb8('0x40')][_0x7fb8('0x2c')]);_0x46dbaf[_0x7fb8('0x2b')]=qs[_0x7fb8('0x2b')](_0x395384[_0x7fb8('0x40')][_0x7fb8('0x2b')]);}return _0x34eb46['getAgents'](_0x46dbaf);}})['then'](function(_0x37d242){if(_0x37d242){return _0x37d242?{'count':_0x403078,'rows':_0x37d242}:null;}})[_0x7fb8('0x32')](respondWithResult(_0x9d6a57,null))['catch'](handleError(_0x9d6a57,null));}; \ No newline at end of file +var _0xe3ef=['message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','client','http','request','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','SmsAccount','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','update','find','params','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','sms','Applications','account','applications','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','MessageSid','skebby','sender','text','connectel','clicksend','messageId','message_id','plivo','Text','MessageUUID','infobip','results','csc','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','send','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','SmsApplication','bulkCreate','finally','getApplications','getInteractions','Contact','Owner','internal','Tags','color','tag','DESC','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','state'];(function(_0x28b746,_0x66db64){var _0x259a66=function(_0x43f979){while(--_0x43f979){_0x28b746['push'](_0x28b746['shift']());}};_0x259a66(++_0x66db64);}(_0xe3ef,0xef));var _0xfe3e=function(_0xa23d13,_0x3563e3){_0xa23d13=_0xa23d13-0x0;var _0x43e8c6=_0xe3ef[_0xa23d13];return _0x43e8c6;};'use strict';var emlformat=require(_0xfe3e('0x0'));var rimraf=require(_0xfe3e('0x1'));var zipdir=require(_0xfe3e('0x2'));var jsonpatch=require(_0xfe3e('0x3'));var rp=require('request-promise');var moment=require(_0xfe3e('0x4'));var BPromise=require(_0xfe3e('0x5'));var Mustache=require(_0xfe3e('0x6'));var util=require(_0xfe3e('0x7'));var path=require(_0xfe3e('0x8'));var sox=require(_0xfe3e('0x9'));var csv=require('to-csv');var ejs=require(_0xfe3e('0xa'));var fs=require('fs');var fs_extra=require(_0xfe3e('0xb'));var _=require(_0xfe3e('0xc'));var squel=require(_0xfe3e('0xd'));var crypto=require(_0xfe3e('0xe'));var jsforce=require(_0xfe3e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xfe3e('0x10'));var querystring=require(_0xfe3e('0x11'));var Papa=require(_0xfe3e('0x12'));var Redis=require(_0xfe3e('0x13'));var authService=require(_0xfe3e('0x14'));var qs=require(_0xfe3e('0x15'));var as=require(_0xfe3e('0x16'));var hardwareService=require(_0xfe3e('0x17'));var logger=require('../../config/logger')(_0xfe3e('0x18'));var utils=require('../../config/utils');var config=require(_0xfe3e('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe3e('0x1a'))['db'];config[_0xfe3e('0x1b')]=_[_0xfe3e('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe3e('0x1d'))(new Redis(config[_0xfe3e('0x1b')]));require(_0xfe3e('0x1e'))[_0xfe3e('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfe3e('0x20')][_0xfe3e('0x21')]({'port':0x232c});function respondWithRpcPromise(_0xea3122,_0x13771d,_0xdddf89,_0xe67f3a){return new BPromise(function(_0x1405b7,_0x5f4aa){var _0x22cd13=_0xe67f3a||client;return _0x22cd13[_0xfe3e('0x22')](_0xea3122,_0xdddf89)[_0xfe3e('0x23')](function(_0x4706d0){logger['info'](_0xfe3e('0x24'),_0x13771d,'request\x20sent');logger[_0xfe3e('0x25')](_0xfe3e('0x26'),_0x13771d,_0xfe3e('0x27'),JSON[_0xfe3e('0x28')](_0x4706d0));if(_0x4706d0['error']){if(_0x4706d0['error'][_0xfe3e('0x29')]===0x1f4){logger[_0xfe3e('0x2a')](_0xfe3e('0x24'),_0x13771d,_0x4706d0['error'][_0xfe3e('0x2b')]);return _0x5f4aa(_0x4706d0[_0xfe3e('0x2a')][_0xfe3e('0x2b')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x13771d,_0x4706d0[_0xfe3e('0x2a')][_0xfe3e('0x2b')]);return _0x1405b7(_0x4706d0[_0xfe3e('0x2a')][_0xfe3e('0x2b')]);}else{logger['info'](_0xfe3e('0x24'),_0x13771d,'request\x20sent');_0x1405b7(_0x4706d0[_0xfe3e('0x2c')][_0xfe3e('0x2b')]);}})[_0xfe3e('0x2d')](function(_0x3f8a71){logger[_0xfe3e('0x2a')](_0xfe3e('0x24'),_0x13771d,_0x3f8a71);_0x5f4aa(_0x3f8a71);});});}function respondWithStatusCode(_0xc069dc,_0x538723){_0x538723=_0x538723||0xcc;return function(_0x4024a2){if(_0x4024a2){return _0xc069dc[_0xfe3e('0x2e')](_0x538723);}return _0xc069dc[_0xfe3e('0x2f')](_0x538723)[_0xfe3e('0x30')]();};}function respondWithResult(_0x954747,_0x5800a6){_0x5800a6=_0x5800a6||0xc8;return function(_0x2f53fb){if(_0x2f53fb){return _0x954747[_0xfe3e('0x2f')](_0x5800a6)['json'](_0x2f53fb);}};}function respondWithFilteredResult(_0x911396,_0x830a4c){return function(_0x3bc2ce){if(_0x3bc2ce){var _0x1d17c9=typeof _0x830a4c['offset']==='undefined'&&typeof _0x830a4c[_0xfe3e('0x31')]==='undefined';var _0x4b690a=_0x3bc2ce['count'];var _0x2b639f=_0x1d17c9?0x0:_0x830a4c['offset'];var _0x27fed6=_0x1d17c9?_0x3bc2ce[_0xfe3e('0x32')]:_0x830a4c['offset']+_0x830a4c[_0xfe3e('0x31')];var _0x571297;if(_0x27fed6>=_0x4b690a){_0x27fed6=_0x4b690a;_0x571297=0xc8;}else{_0x571297=0xce;}_0x911396['status'](_0x571297);return _0x911396[_0xfe3e('0x33')](_0xfe3e('0x34'),_0x2b639f+'-'+_0x27fed6+'/'+_0x4b690a)[_0xfe3e('0x35')](_0x3bc2ce);}return null;};}function patchUpdates(_0x3fec22){return function(_0x4f4988){try{jsonpatch[_0xfe3e('0x36')](_0x4f4988,_0x3fec22,!![]);}catch(_0x1a74d5){return BPromise[_0xfe3e('0x37')](_0x1a74d5);}return _0x4f4988[_0xfe3e('0x38')]();};}function saveUpdates(_0x5823aa,_0x5cfc16){return function(_0x2c3a98){if(_0x2c3a98){return _0x2c3a98['update'](_0x5823aa)['then'](function(_0x91f8bb){return _0x91f8bb;});}return null;};}function removeEntity(_0x13b80e,_0x1f5d24){return function(_0x51ff2d){if(_0x51ff2d){return _0x51ff2d[_0xfe3e('0x39')]()[_0xfe3e('0x23')](function(){var _0x271cc6=_0x51ff2d[_0xfe3e('0x3a')]({'plain':!![]});var _0x258cd7=_0xfe3e('0x3b');return db[_0xfe3e('0x3c')][_0xfe3e('0x39')]({'where':{'type':_0x258cd7,'resourceId':_0x271cc6['id']}})[_0xfe3e('0x23')](function(){return _0x51ff2d;});})['then'](function(){_0x13b80e[_0xfe3e('0x2f')](0xcc)[_0xfe3e('0x30')]();});}};}function handleEntityNotFound(_0x3b29e0,_0x59248f){return function(_0x15cb2f){if(!_0x15cb2f){_0x3b29e0[_0xfe3e('0x2e')](0x194);}return _0x15cb2f;};}function handleError(_0x328c73,_0x467d0f){_0x467d0f=_0x467d0f||0x1f4;return function(_0x2ccd11){logger[_0xfe3e('0x2a')](_0x2ccd11[_0xfe3e('0x3d')]);if(_0x2ccd11[_0xfe3e('0x3e')]){delete _0x2ccd11[_0xfe3e('0x3e')];}_0x328c73[_0xfe3e('0x2f')](_0x467d0f)['send'](_0x2ccd11);};}exports[_0xfe3e('0x3f')]=function(_0x22b001,_0x39ea48){var _0x133800={'include':[{'model':db[_0xfe3e('0x40')],'as':_0xfe3e('0x41')}]},_0x243696={},_0x5064e2={'count':0x0,'rows':[]};var _0x2f3d97=_['map'](db[_0xfe3e('0x42')]['rawAttributes'],function(_0x52ec3e){return{'name':_0x52ec3e[_0xfe3e('0x43')],'type':_0x52ec3e['type'][_0xfe3e('0x44')]};});_0x243696[_0xfe3e('0x45')]=_[_0xfe3e('0x46')](_0x2f3d97,_0xfe3e('0x3e'));_0x243696[_0xfe3e('0x47')]=_[_0xfe3e('0x48')](_0x22b001[_0xfe3e('0x47')]);_0x243696[_0xfe3e('0x49')]=_[_0xfe3e('0x4a')](_0x243696['model'],_0x243696[_0xfe3e('0x47')]);_0x133800[_0xfe3e('0x4b')]=_[_0xfe3e('0x4a')](_0x243696[_0xfe3e('0x45')],qs['fields'](_0x22b001[_0xfe3e('0x47')][_0xfe3e('0x4c')]));_0x133800[_0xfe3e('0x4b')]=_0x133800['attributes'][_0xfe3e('0x4d')]?_0x133800['attributes']:_0x243696[_0xfe3e('0x45')];if(!_0x22b001['query'][_0xfe3e('0x4e')](_0xfe3e('0x4f'))){_0x133800[_0xfe3e('0x31')]=qs[_0xfe3e('0x31')](_0x22b001[_0xfe3e('0x47')]['limit']);_0x133800[_0xfe3e('0x50')]=qs[_0xfe3e('0x50')](_0x22b001[_0xfe3e('0x47')][_0xfe3e('0x50')]);}_0x133800[_0xfe3e('0x51')]=qs[_0xfe3e('0x52')](_0x22b001['query'][_0xfe3e('0x52')]);_0x133800[_0xfe3e('0x53')]=qs[_0xfe3e('0x49')](_[_0xfe3e('0x54')](_0x22b001[_0xfe3e('0x47')],_0x243696[_0xfe3e('0x49')]),_0x2f3d97);if(_0x22b001[_0xfe3e('0x47')][_0xfe3e('0x55')]){_0x133800[_0xfe3e('0x53')]=_[_0xfe3e('0x56')](_0x133800[_0xfe3e('0x53')],{'$or':_['map'](_0x2f3d97,function(_0x3f8977){if(_0x3f8977[_0xfe3e('0x57')]!==_0xfe3e('0x58')){var _0x44068a={};_0x44068a[_0x3f8977[_0xfe3e('0x3e')]]={'$like':'%'+_0x22b001[_0xfe3e('0x47')][_0xfe3e('0x55')]+'%'};return _0x44068a;}})});}_0x133800=_[_0xfe3e('0x56')]({},_0x133800,_0x22b001['options']);var _0x7da73d={'where':_0x133800[_0xfe3e('0x53')]};return db['SmsAccount']['count'](_0x7da73d)[_0xfe3e('0x23')](function(_0x4cb965){_0x5064e2['count']=_0x4cb965;if(_0x22b001['query'][_0xfe3e('0x59')]){_0x133800[_0xfe3e('0x5a')]=[{'all':!![]}];}return db['SmsAccount'][_0xfe3e('0x5b')](_0x133800);})[_0xfe3e('0x23')](function(_0x33d9fc){_0x5064e2[_0xfe3e('0x5c')]=_0x33d9fc;return _0x5064e2;})[_0xfe3e('0x23')](respondWithFilteredResult(_0x39ea48,_0x133800))['catch'](handleError(_0x39ea48,null));};exports[_0xfe3e('0x5d')]=function(_0x3dd7c1,_0x1c7024){var _0x173437={'raw':![],'where':{'id':_0x3dd7c1['params']['id']},'include':[{'model':db[_0xfe3e('0x40')],'as':_0xfe3e('0x41')}]},_0x327271={};_0x327271['model']=_[_0xfe3e('0x48')](db[_0xfe3e('0x42')][_0xfe3e('0x5e')]);_0x327271[_0xfe3e('0x47')]=_['keys'](_0x3dd7c1[_0xfe3e('0x47')]);_0x327271[_0xfe3e('0x49')]=_['intersection'](_0x327271[_0xfe3e('0x45')],_0x327271[_0xfe3e('0x47')]);_0x173437[_0xfe3e('0x4b')]=_[_0xfe3e('0x4a')](_0x327271[_0xfe3e('0x45')],qs[_0xfe3e('0x4c')](_0x3dd7c1[_0xfe3e('0x47')][_0xfe3e('0x4c')]));_0x173437['attributes']=_0x173437[_0xfe3e('0x4b')]['length']?_0x173437[_0xfe3e('0x4b')]:_0x327271[_0xfe3e('0x45')];if(_0x3dd7c1['query'][_0xfe3e('0x59')]){_0x173437[_0xfe3e('0x5a')]=[{'all':!![]}];}_0x173437=_[_0xfe3e('0x56')]({},_0x173437,_0x3dd7c1[_0xfe3e('0x5f')]);return db[_0xfe3e('0x42')]['find'](_0x173437)[_0xfe3e('0x23')](handleEntityNotFound(_0x1c7024,null))['then'](respondWithResult(_0x1c7024,null))['catch'](handleError(_0x1c7024,null));};exports[_0xfe3e('0x60')]=function(_0xd85697,_0xcb54c1){return db[_0xfe3e('0x42')][_0xfe3e('0x60')](_0xd85697[_0xfe3e('0x61')],{})['then'](function(_0x4524fd){var _0x5407c8=_0xd85697[_0xfe3e('0x62')]['get']({'plain':!![]});if(!_0x5407c8)throw new Error(_0xfe3e('0x63'));if(_0x5407c8[_0xfe3e('0x64')]==='user'){var _0x33958a=_0x4524fd[_0xfe3e('0x3a')]({'plain':!![]});var _0x4702d9=_0xfe3e('0x3b');return db['UserProfileSection']['find']({'where':{'name':_0x4702d9,'userProfileId':_0x5407c8[_0xfe3e('0x65')]},'raw':!![]})[_0xfe3e('0x23')](function(_0xe8969f){if(_0xe8969f&&_0xe8969f[_0xfe3e('0x66')]===0x0){return db[_0xfe3e('0x3c')][_0xfe3e('0x60')]({'name':_0x33958a[_0xfe3e('0x3e')],'resourceId':_0x33958a['id'],'type':_0xe8969f['name'],'sectionId':_0xe8969f['id']},{})[_0xfe3e('0x23')](function(){return _0x4524fd;});}else{return _0x4524fd;}})[_0xfe3e('0x2d')](function(_0x47c090){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47c090);throw _0x47c090;});}return _0x4524fd;})['then'](respondWithResult(_0xcb54c1,0xc9))[_0xfe3e('0x2d')](handleError(_0xcb54c1,null));};exports[_0xfe3e('0x67')]=function(_0x15aea7,_0x1ea3d2){if(_0x15aea7[_0xfe3e('0x61')]['id']){delete _0x15aea7[_0xfe3e('0x61')]['id'];}return db[_0xfe3e('0x42')][_0xfe3e('0x68')]({'where':{'id':_0x15aea7['params']['id']},'include':[{'model':db[_0xfe3e('0x40')],'as':_0xfe3e('0x41')}]})['then'](handleEntityNotFound(_0x1ea3d2,null))[_0xfe3e('0x23')](saveUpdates(_0x15aea7[_0xfe3e('0x61')],null))[_0xfe3e('0x23')](respondWithResult(_0x1ea3d2,null))[_0xfe3e('0x2d')](handleError(_0x1ea3d2,null));};exports[_0xfe3e('0x39')]=function(_0x4550d4,_0x211fdb){return db[_0xfe3e('0x42')]['find']({'where':{'id':_0x4550d4[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x211fdb,null))[_0xfe3e('0x23')](removeEntity(_0x211fdb,null))[_0xfe3e('0x2d')](handleError(_0x211fdb,null));};exports[_0xfe3e('0x6a')]=function(_0x42fc03,_0x1643fc){return db['SmsAccount'][_0xfe3e('0x6a')]()['then'](respondWithResult(_0x1643fc,null))[_0xfe3e('0x2d')](handleError(_0x1643fc,null));};exports[_0xfe3e('0x6b')]=function(_0x206d8e,_0x30f6ad,_0x617c89){if(_0x206d8e[_0xfe3e('0x61')]['id']){delete _0x206d8e[_0xfe3e('0x61')]['id'];}return db[_0xfe3e('0x42')][_0xfe3e('0x68')]({'where':{'id':_0x206d8e[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x30f6ad,null))[_0xfe3e('0x23')](function(_0x1a2bb8){if(_0x1a2bb8){_0x206d8e[_0xfe3e('0x61')][_0xfe3e('0x6c')]=_0x1a2bb8['id'];return db['Disposition'][_0xfe3e('0x60')](_0x206d8e[_0xfe3e('0x61')]);}})['then'](respondWithResult(_0x30f6ad,null))[_0xfe3e('0x2d')](handleError(_0x30f6ad,null));};exports[_0xfe3e('0x6d')]=function(_0x36a479,_0x27b735,_0x94131){var _0x1f43dd={'raw':![],'where':{}};var _0x3581b5={};var _0x14d228={'count':0x0,'rows':[]};return db[_0xfe3e('0x42')][_0xfe3e('0x6e')]({'where':{'id':_0x36a479[_0xfe3e('0x69')]['id']}})['then'](handleEntityNotFound(_0x27b735,null))[_0xfe3e('0x23')](function(_0x7d1744){if(_0x7d1744){_0x3581b5[_0xfe3e('0x45')]=_[_0xfe3e('0x48')](db[_0xfe3e('0x6f')][_0xfe3e('0x5e')]);_0x3581b5['query']=_[_0xfe3e('0x48')](_0x36a479[_0xfe3e('0x47')]);_0x3581b5['filters']=_[_0xfe3e('0x4a')](_0x3581b5[_0xfe3e('0x45')],_0x3581b5['query']);_0x1f43dd[_0xfe3e('0x4b')]=_[_0xfe3e('0x4a')](_0x3581b5[_0xfe3e('0x45')],qs[_0xfe3e('0x4c')](_0x36a479['query'][_0xfe3e('0x4c')]));_0x1f43dd[_0xfe3e('0x4b')]=_0x1f43dd[_0xfe3e('0x4b')][_0xfe3e('0x4d')]?_0x1f43dd[_0xfe3e('0x4b')]:_0x3581b5['model'];if(!_0x36a479['query'][_0xfe3e('0x4e')]('nolimit')){_0x1f43dd[_0xfe3e('0x31')]=qs[_0xfe3e('0x31')](_0x36a479[_0xfe3e('0x47')][_0xfe3e('0x31')]);_0x1f43dd[_0xfe3e('0x50')]=qs[_0xfe3e('0x50')](_0x36a479['query'][_0xfe3e('0x50')]);}_0x1f43dd[_0xfe3e('0x51')]=qs['sort'](_0x36a479[_0xfe3e('0x47')][_0xfe3e('0x52')]);_0x1f43dd[_0xfe3e('0x53')]=qs[_0xfe3e('0x49')](_[_0xfe3e('0x54')](_0x36a479[_0xfe3e('0x47')],_0x3581b5[_0xfe3e('0x49')]));_0x1f43dd[_0xfe3e('0x53')][_0xfe3e('0x6c')]=_0x7d1744['id'];if(_0x36a479['query'][_0xfe3e('0x55')]){_0x1f43dd[_0xfe3e('0x53')]=_[_0xfe3e('0x56')](_0x1f43dd['where'],{'$or':_[_0xfe3e('0x46')](_0x1f43dd['attributes'],function(_0x4518d3){var _0x4cc825={};_0x4cc825[_0x4518d3]={'$like':'%'+_0x36a479[_0xfe3e('0x47')][_0xfe3e('0x55')]+'%'};return _0x4cc825;})});}_0x1f43dd=_['merge']({},_0x1f43dd,_0x36a479[_0xfe3e('0x5f')]);return db[_0xfe3e('0x6f')]['count']({'where':_0x1f43dd['where']})[_0xfe3e('0x23')](function(_0x326539){_0x14d228[_0xfe3e('0x32')]=_0x326539;if(_0x36a479['query']['includeAll']){_0x1f43dd[_0xfe3e('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0xfe3e('0x5b')](_0x1f43dd);})[_0xfe3e('0x23')](function(_0x561f6a){_0x14d228[_0xfe3e('0x5c')]=_0x561f6a;return _0x14d228;});}})[_0xfe3e('0x23')](respondWithFilteredResult(_0x27b735,_0x1f43dd))[_0xfe3e('0x2d')](handleError(_0x27b735,null));};exports[_0xfe3e('0x70')]=function(_0x468437,_0x325a5e,_0x496e59){return db[_0xfe3e('0x42')]['find']({'where':{'id':_0x468437[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x325a5e,null))[_0xfe3e('0x23')](function(_0x1e7513){if(_0x1e7513){return _0x1e7513['removeDispositions'](_0x468437[_0xfe3e('0x47')][_0xfe3e('0x71')]);}})[_0xfe3e('0x23')](respondWithStatusCode(_0x325a5e,null))[_0xfe3e('0x2d')](handleError(_0x325a5e,null));};exports['addAnswer']=function(_0x5ab654,_0x4edb09,_0x2b2493){if(_0x5ab654['body']['id']){delete _0x5ab654[_0xfe3e('0x61')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x5ab654[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x4edb09,null))['then'](function(_0x1557b0){if(_0x1557b0){_0x5ab654['body'][_0xfe3e('0x6c')]=_0x1557b0['id'];return db['CannedAnswer'][_0xfe3e('0x60')](_0x5ab654[_0xfe3e('0x61')]);}})[_0xfe3e('0x23')](respondWithResult(_0x4edb09,null))['catch'](handleError(_0x4edb09,null));};exports[_0xfe3e('0x72')]=function(_0x26b800,_0x4b0632,_0x63f73){var _0x33a814={'raw':![],'where':{}};var _0x54fe71={};var _0x410e1e={'count':0x0,'rows':[]};return db[_0xfe3e('0x42')][_0xfe3e('0x6e')]({'where':{'id':_0x26b800['params']['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x4b0632,null))['then'](function(_0x5e0ee7){if(_0x5e0ee7){_0x54fe71['model']=_[_0xfe3e('0x48')](db[_0xfe3e('0x73')][_0xfe3e('0x5e')]);_0x54fe71[_0xfe3e('0x47')]=_['keys'](_0x26b800[_0xfe3e('0x47')]);_0x54fe71[_0xfe3e('0x49')]=_['intersection'](_0x54fe71[_0xfe3e('0x45')],_0x54fe71[_0xfe3e('0x47')]);_0x33a814[_0xfe3e('0x4b')]=_['intersection'](_0x54fe71[_0xfe3e('0x45')],qs[_0xfe3e('0x4c')](_0x26b800[_0xfe3e('0x47')]['fields']));_0x33a814['attributes']=_0x33a814[_0xfe3e('0x4b')][_0xfe3e('0x4d')]?_0x33a814[_0xfe3e('0x4b')]:_0x54fe71['model'];if(!_0x26b800[_0xfe3e('0x47')][_0xfe3e('0x4e')](_0xfe3e('0x4f'))){_0x33a814['limit']=qs[_0xfe3e('0x31')](_0x26b800[_0xfe3e('0x47')][_0xfe3e('0x31')]);_0x33a814[_0xfe3e('0x50')]=qs['offset'](_0x26b800[_0xfe3e('0x47')][_0xfe3e('0x50')]);}_0x33a814[_0xfe3e('0x51')]=qs['sort'](_0x26b800[_0xfe3e('0x47')]['sort']);_0x33a814[_0xfe3e('0x53')]=qs[_0xfe3e('0x49')](_['pick'](_0x26b800[_0xfe3e('0x47')],_0x54fe71[_0xfe3e('0x49')]));_0x33a814[_0xfe3e('0x53')][_0xfe3e('0x6c')]=_0x5e0ee7['id'];if(_0x26b800[_0xfe3e('0x47')]['filter']){_0x33a814[_0xfe3e('0x53')]=_[_0xfe3e('0x56')](_0x33a814['where'],{'$or':_[_0xfe3e('0x46')](_0x33a814[_0xfe3e('0x4b')],function(_0x44e104){var _0x180573={};_0x180573[_0x44e104]={'$like':'%'+_0x26b800['query'][_0xfe3e('0x55')]+'%'};return _0x180573;})});}_0x33a814=_['merge']({},_0x33a814,_0x26b800[_0xfe3e('0x5f')]);return db[_0xfe3e('0x73')][_0xfe3e('0x32')]({'where':_0x33a814['where']})[_0xfe3e('0x23')](function(_0x55d356){_0x410e1e['count']=_0x55d356;if(_0x26b800[_0xfe3e('0x47')][_0xfe3e('0x59')]){_0x33a814['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xfe3e('0x5b')](_0x33a814);})['then'](function(_0x57d196){_0x410e1e[_0xfe3e('0x5c')]=_0x57d196;return _0x410e1e;});}})['then'](respondWithFilteredResult(_0x4b0632,_0x33a814))[_0xfe3e('0x2d')](handleError(_0x4b0632,null));};exports[_0xfe3e('0x74')]=function(_0x4beb8e,_0x1b8b45,_0x317de8){return db[_0xfe3e('0x42')][_0xfe3e('0x68')]({'where':{'id':_0x4beb8e[_0xfe3e('0x69')]['id']}})['then'](handleEntityNotFound(_0x1b8b45,null))[_0xfe3e('0x23')](function(_0x56897c){if(_0x56897c){return _0x56897c[_0xfe3e('0x74')](_0x4beb8e['query']['ids']);}})[_0xfe3e('0x23')](respondWithStatusCode(_0x1b8b45,null))[_0xfe3e('0x2d')](handleError(_0x1b8b45,null));};exports[_0xfe3e('0x75')]=function(_0x52b2a2,_0x25bc81,_0x84faeb){var _0x2b00fc={'channel':_0xfe3e('0x76')};var _0x13dd7a=[];var _0x148f87=[];var _0x1cae87={};return db[_0xfe3e('0x42')]['find']({'where':{'id':_0x52b2a2[_0xfe3e('0x69')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xfe3e('0x77')}]})[_0xfe3e('0x23')](handleEntityNotFound(_0x25bc81,null))[_0xfe3e('0x23')](function(_0x2cac3d){_0x2b00fc[_0xfe3e('0x78')]=_0x2cac3d;_0x2b00fc[_0xfe3e('0x79')]=_['orderBy'](_0x2cac3d[_0xfe3e('0x77')],[_0xfe3e('0x7a')],['asc']);if(_0x2b00fc[_0xfe3e('0x78')][_0xfe3e('0x77')]){delete _0x2b00fc[_0xfe3e('0x78')][_0xfe3e('0x77')];}return db[_0xfe3e('0x7b')]['describe']();})['then'](function(_0x52c2d0){if(!_0x52c2d0){throw new db[(_0xfe3e('0x7c'))][(_0xfe3e('0x7d'))](_0xfe3e('0x7e'));}_0x13dd7a=_[_0xfe3e('0x7f')](_['keys'](_0x52c2d0),[_0xfe3e('0x80'),'updatedAt']);_0x148f87=_[_0xfe3e('0x7f')](_[_0xfe3e('0x48')](_0x52c2d0),[_0xfe3e('0x80'),_0xfe3e('0x81'),'CompanyId',_0xfe3e('0x82')]);_0x2b00fc[_0xfe3e('0x61')]={'mapKey':_0xfe3e('0x83')};if(_0x2b00fc[_0xfe3e('0x78')]['type']){switch(_0x2b00fc[_0xfe3e('0x78')]['type']){case _0xfe3e('0x84'):_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')]=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x86')];_0x2b00fc['body'][_0xfe3e('0x61')]=_0x52b2a2[_0xfe3e('0x61')]['Body'];_0x2b00fc[_0xfe3e('0x61')]['messageId']=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x87')];break;case _0xfe3e('0x88'):_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')]='+'+_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x89')];_0x2b00fc['body'][_0xfe3e('0x61')]=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x8a')];break;case _0xfe3e('0x8b'):_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')]=_0x52b2a2['body'][_0xfe3e('0x85')];_0x2b00fc[_0xfe3e('0x61')]['body']=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x2b')];break;case _0xfe3e('0x8c'):_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')]=_0x52b2a2[_0xfe3e('0x61')]['from'];_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x61')]=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x61')];_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x8d')]=_0x52b2a2['body'][_0xfe3e('0x8e')];break;case _0xfe3e('0x8f'):_0x2b00fc['body'][_0xfe3e('0x85')]=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x86')];_0x2b00fc[_0xfe3e('0x61')]['body']=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x90')];_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x8d')]=_0x52b2a2['body'][_0xfe3e('0x91')];break;case _0xfe3e('0x92'):_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')]='+'+_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x93')][0x0][_0xfe3e('0x85')];_0x2b00fc[_0xfe3e('0x61')]['body']=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x93')][0x0][_0xfe3e('0x8a')];_0x2b00fc[_0xfe3e('0x61')]['messageId']=_0x52b2a2[_0xfe3e('0x61')]['results'][0x0][_0xfe3e('0x8d')];break;case _0xfe3e('0x94'):_0x2b00fc['body'][_0xfe3e('0x85')]=_0x52b2a2['body']['originatingAddress'];_0x2b00fc[_0xfe3e('0x61')]['body']=_0x52b2a2[_0xfe3e('0x61')]['segmentedMessage'][_0xfe3e('0x2b')];break;case _0xfe3e('0x95'):_0x2b00fc['body'][_0xfe3e('0x85')]=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x96')];_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x61')]=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x8a')];_0x2b00fc['body']['messageId']=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x97')];break;case _0xfe3e('0x98'):_0x2b00fc['body'][_0xfe3e('0x8d')]=_0x52b2a2[_0xfe3e('0x61')][0x0]['message']['id'];_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')]=_0x52b2a2[_0xfe3e('0x61')][0x0][_0xfe3e('0x2b')][_0xfe3e('0x85')];_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x61')]=_0x52b2a2[_0xfe3e('0x61')][0x0][_0xfe3e('0x2b')]['text'];break;case _0xfe3e('0x99'):_0x2b00fc['body']['from']=_0x52b2a2['body'][_0xfe3e('0x85')];_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x61')]=_0x52b2a2[_0xfe3e('0x61')][_0xfe3e('0x2b')];_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x8d')]=_0x52b2a2[_0xfe3e('0x61')]['refid'];break;}}if(_0x2b00fc['body']['id']){delete _0x2b00fc[_0xfe3e('0x61')]['id'];}if(_[_0xfe3e('0x9a')](_0x2b00fc[_0xfe3e('0x61')]['from'])){throw new db['Sequelize']['ValidationError'](_0xfe3e('0x9b'));}if(_['isNil'](_0x2b00fc[_0xfe3e('0x61')]['body'])||_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x61')]===''){throw new db[(_0xfe3e('0x7c'))]['ValidationError'](_0xfe3e('0x9c'));}if(_['isNil'](_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x9d')])){throw new db[(_0xfe3e('0x7c'))][(_0xfe3e('0x7d'))](_0xfe3e('0x9e')+_0x148f87);}if(!_[_0xfe3e('0x9f')](_0x148f87,_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x9d')])){throw new db[(_0xfe3e('0x7c'))][(_0xfe3e('0x7d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x148f87);}_0x1cae87[_0x2b00fc[_0xfe3e('0x61')]['mapKey']]=_0x2b00fc['body'][_0xfe3e('0x85')];return db[_0xfe3e('0xa0')][_0xfe3e('0x68')]({'where':{'id':_0x2b00fc[_0xfe3e('0x78')][_0xfe3e('0x82')]},'include':[{'model':db[_0xfe3e('0x7b')],'as':_0xfe3e('0xa1'),'where':_0x1cae87,'limit':0x1,'order':[[_0xfe3e('0x81'),'DESC']]}]});})[_0xfe3e('0x23')](handleEntityNotFound(_0x25bc81,null))['then'](function(_0x138585){if(_0x138585){_0x2b00fc[_0xfe3e('0xa2')]=_[_0xfe3e('0xa3')](_0x138585,['Contacts']);if(_0x138585[_0xfe3e('0xa1')][_0xfe3e('0x4d')]){return _0x138585['Contacts'][0x0];}var _0x531fe7=_[_0xfe3e('0x1c')](_0x2b00fc[_0xfe3e('0x61')],{'firstName':_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')],'ListId':_0x138585['id']});_0x531fe7[_0x2b00fc['body'][_0xfe3e('0x9d')]]=_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')];return db[_0xfe3e('0x7b')][_0xfe3e('0x60')](_0x531fe7,{'fields':_0x13dd7a,'raw':!![]});}})[_0xfe3e('0x23')](handleEntityNotFound(_0x25bc81,null))[_0xfe3e('0x23')](function(_0x5451c5){if(_0x5451c5){_0x2b00fc[_0xfe3e('0xa4')]=_0x5451c5;var _0x4dca9c={'ContactId':_0x5451c5['id'],'phone':_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x85')],'SmsAccountId':_0x52b2a2[_0xfe3e('0x69')]['id']};var _0x3be976={'ContactId':_0x5451c5['id'],'SmsAccountId':_0x52b2a2[_0xfe3e('0x69')]['id'],'closed':![]};return db[_0xfe3e('0xa5')][_0xfe3e('0x68')]({'where':_0x3be976})[_0xfe3e('0x23')](function(_0x2cf2f2){if(_0x2cf2f2){return[_0x2cf2f2,![]];}return db[_0xfe3e('0xa5')]['create'](_0x4dca9c)[_0xfe3e('0x23')](function(_0x118a37){return[_0x118a37,!![]];});});}})[_0xfe3e('0xa6')](function(_0x5d0ce6,_0x133092){_0x2b00fc['interaction']=_0x5d0ce6[_0xfe3e('0x3a')]({'plain':!![]});_0x2b00fc[_0xfe3e('0xa7')][_0xfe3e('0xa8')]=![];if(_0x133092){if(_0x2b00fc['account'][_0xfe3e('0xa9')]){_0x2b00fc['applications'][_0xfe3e('0xaa')]({'id':0x0,'priority':_0x2b00fc[_0xfe3e('0x79')][_0xfe3e('0x4d')]+0x1,'app':_0xfe3e('0xab'),'appdata':_0xfe3e('0xac'),'interval':_0xfe3e('0xad')});}_0x2b00fc['interaction'][_0xfe3e('0xa8')]=!![];}return db[_0xfe3e('0xae')]['create']({'phone':_0x2b00fc['body']['from'],'messageId':_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0x8d')],'body':_0x2b00fc['body'][_0xfe3e('0x61')],'SmsAccountId':_0x52b2a2[_0xfe3e('0x69')]['id'],'SmsInteractionId':_0x5d0ce6['id'],'direction':'in','ContactId':_0x5d0ce6[_0xfe3e('0xaf')],'AttachmentId':_0x2b00fc[_0xfe3e('0x61')][_0xfe3e('0xb0')]});})[_0xfe3e('0x23')](function(_0x2da7af){_0x2b00fc[_0xfe3e('0x2b')]=_0x2da7af;if(_0x2b00fc[_0xfe3e('0xa7')][_0xfe3e('0xb1')]){return db[_0xfe3e('0xb2')]['find']({'attributes':['id',_0xfe3e('0x3e')],'where':{'id':_0x2b00fc[_0xfe3e('0xa7')][_0xfe3e('0xb1')]}})[_0xfe3e('0x23')](function(_0x19d3ac){if(_0x19d3ac){_0x2b00fc['applications'][_0xfe3e('0xb3')]({'id':0x0,'priority':0x0,'app':_0xfe3e('0xb4'),'appdata':_0x19d3ac[_0xfe3e('0x3e')]+','+(_0x2b00fc['account']['waitForTheAssignedAgent']||0xa),'interval':_0xfe3e('0xad')});}return respondWithRpcPromise(_0xfe3e('0xb5'),_0xfe3e('0xb6'),_0x2b00fc);});}return respondWithRpcPromise(_0xfe3e('0xb5'),'startRouting',_0x2b00fc);})[_0xfe3e('0x23')](function(_0x502283){if(_0x502283){var _0x2b9342=0xc8;var _0x45bac3=_0xfe3e('0xb7');logger['info'](_0xfe3e('0x26'),_0x45bac3,_0x2b9342,_0xfe3e('0xb8'));logger[_0xfe3e('0x25')](_0xfe3e('0xb9'),_0x45bac3,_0x2b9342,_0xfe3e('0xb8'),JSON[_0xfe3e('0x28')](_0x502283));if(_0x2b00fc[_0xfe3e('0x78')][_0xfe3e('0x57')]===_0xfe3e('0x84')){return _0x25bc81[_0xfe3e('0x2f')](_0x2b9342)[_0xfe3e('0x33')]('Content-Type',_0xfe3e('0xba'))[_0xfe3e('0xbb')](_0xfe3e('0xbc'));}else{return _0x25bc81['status'](_0x2b9342)[_0xfe3e('0x35')](_0x502283);}}})[_0xfe3e('0x2d')](handleError(_0x25bc81,null));};exports[_0xfe3e('0xbd')]=function(_0x2a0191,_0x342404){var _0x1ef9e8=_0x2a0191[_0xfe3e('0x69')]['id'];var _0x519d78=_0x2a0191['body'];var _0x26849c=0xc8;var _0x249d12=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xfe3e('0xbe')][_0xfe3e('0xbf')][_0xfe3e('0xc0')]['READ_COMMITTED']},function(_0x1f6baf){return db[_0xfe3e('0x42')]['findOne']({'where':{'id':_0x1ef9e8},'transaction':_0x1f6baf})[_0xfe3e('0x23')](function(_0x300a83){if(_0x300a83){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x1ef9e8},'transaction':_0x1f6baf})[_0xfe3e('0x23')](function(){var _0x75afdc=_[_0xfe3e('0x46')](_0x519d78,function(_0x17251d){_0x17251d[_0xfe3e('0x6c')]=_0x1ef9e8;return _0x17251d;});return db[_0xfe3e('0xc1')][_0xfe3e('0xc2')](_0x75afdc,{'transaction':_0x1f6baf});});}else{_0x26849c=0x194;_0x249d12=[];}});})[_0xfe3e('0x23')](function(){if(_0x26849c!==0x194){return db[_0xfe3e('0xc1')]['findAndCountAll']({'where':{'SmsAccountId':_0x1ef9e8},'order':_0xfe3e('0x7a')})[_0xfe3e('0x23')](function(_0x23a3df){_0x249d12=_0x23a3df;});}})[_0xfe3e('0x2d')](function(_0xbcade3){_0x26849c=0x1f4;logger['error'](_0xbcade3[_0xfe3e('0x3d')]);if(_0xbcade3[_0xfe3e('0x3e')]){delete _0xbcade3[_0xfe3e('0x3e')];}_0x249d12=_0xbcade3;})[_0xfe3e('0xc3')](function(){if(_0x249d12===null){_0x342404[_0xfe3e('0x2e')](_0x26849c);}else{if(_0x26849c===0x1f4){_0x342404['status'](_0x26849c)[_0xfe3e('0xbb')](_0x249d12);}else{_0x342404[_0xfe3e('0x2f')](_0x26849c)[_0xfe3e('0x35')](_0x249d12);}}});};exports[_0xfe3e('0xc4')]=function(_0x1a439d,_0x256150,_0x5cf5b8){var _0x3712e9={};var _0x16bb7a={};var _0x192aff;var _0x32ac67;return db['SmsAccount'][_0xfe3e('0x6e')]({'where':{'id':_0x1a439d[_0xfe3e('0x69')]['id']}})['then'](handleEntityNotFound(_0x256150,null))[_0xfe3e('0x23')](function(_0x4ff349){if(_0x4ff349){_0x192aff=_0x4ff349;_0x16bb7a[_0xfe3e('0x45')]=_['keys'](db['SmsApplication'][_0xfe3e('0x5e')]);_0x16bb7a[_0xfe3e('0x47')]=_[_0xfe3e('0x48')](_0x1a439d[_0xfe3e('0x47')]);_0x16bb7a[_0xfe3e('0x49')]=_[_0xfe3e('0x4a')](_0x16bb7a[_0xfe3e('0x45')],_0x16bb7a['query']);_0x3712e9[_0xfe3e('0x4b')]=_[_0xfe3e('0x4a')](_0x16bb7a[_0xfe3e('0x45')],qs[_0xfe3e('0x4c')](_0x1a439d[_0xfe3e('0x47')][_0xfe3e('0x4c')]));_0x3712e9[_0xfe3e('0x4b')]=_0x3712e9[_0xfe3e('0x4b')][_0xfe3e('0x4d')]?_0x3712e9[_0xfe3e('0x4b')]:_0x16bb7a[_0xfe3e('0x45')];_0x3712e9[_0xfe3e('0x51')]=qs['sort'](_0x1a439d[_0xfe3e('0x47')][_0xfe3e('0x52')]);_0x3712e9[_0xfe3e('0x53')]=qs['filters'](_[_0xfe3e('0x54')](_0x1a439d[_0xfe3e('0x47')],_0x16bb7a[_0xfe3e('0x49')]));if(_0x1a439d[_0xfe3e('0x47')][_0xfe3e('0x55')]){_0x3712e9[_0xfe3e('0x53')]=_[_0xfe3e('0x56')](_0x3712e9['where'],{'$or':_[_0xfe3e('0x46')](_0x3712e9[_0xfe3e('0x4b')],function(_0x55271f){var _0x3a1f21={};_0x3a1f21[_0x55271f]={'$like':'%'+_0x1a439d[_0xfe3e('0x47')]['filter']+'%'};return _0x3a1f21;})});}_0x3712e9=_[_0xfe3e('0x56')]({},_0x3712e9,_0x1a439d[_0xfe3e('0x5f')]);return _0x192aff['getApplications'](_0x3712e9);}})[_0xfe3e('0x23')](function(_0x40c39e){if(_0x40c39e){_0x32ac67=_0x40c39e[_0xfe3e('0x4d')];if(!_0x1a439d[_0xfe3e('0x47')][_0xfe3e('0x4e')]('nolimit')){_0x3712e9[_0xfe3e('0x31')]=qs[_0xfe3e('0x31')](_0x1a439d['query'][_0xfe3e('0x31')]);_0x3712e9['offset']=qs[_0xfe3e('0x50')](_0x1a439d['query'][_0xfe3e('0x50')]);}return _0x192aff[_0xfe3e('0xc4')](_0x3712e9);}})[_0xfe3e('0x23')](function(_0x420737){if(_0x420737){return _0x420737?{'count':_0x32ac67,'rows':_0x420737}:null;}})[_0xfe3e('0x23')](respondWithResult(_0x256150,null))['catch'](handleError(_0x256150,null));};exports[_0xfe3e('0xc5')]=function(_0x3ed3e9,_0x402809,_0x1fe66c){var _0x592535={'raw':![],'where':{}};var _0x93702={};var _0x9ce7bd={'count':0x0,'rows':[]};return db[_0xfe3e('0x42')][_0xfe3e('0x6e')]({'where':{'id':_0x3ed3e9[_0xfe3e('0x69')]['id']}})['then'](handleEntityNotFound(_0x402809,null))[_0xfe3e('0x23')](function(_0x547789){if(_0x547789){_0x93702[_0xfe3e('0x45')]=_[_0xfe3e('0x48')](db['SmsInteraction'][_0xfe3e('0x5e')]);_0x93702[_0xfe3e('0x47')]=_[_0xfe3e('0x48')](_0x3ed3e9[_0xfe3e('0x47')]);_0x93702['filters']=_[_0xfe3e('0x4a')](_0x93702['model'],_0x93702[_0xfe3e('0x47')]);_0x592535[_0xfe3e('0x4b')]=_[_0xfe3e('0x4a')](_0x93702[_0xfe3e('0x45')],qs[_0xfe3e('0x4c')](_0x3ed3e9[_0xfe3e('0x47')][_0xfe3e('0x4c')]));_0x592535['attributes']=_0x592535[_0xfe3e('0x4b')][_0xfe3e('0x4d')]?_0x592535['attributes']:_0x93702[_0xfe3e('0x45')];if(!_0x3ed3e9[_0xfe3e('0x47')][_0xfe3e('0x4e')](_0xfe3e('0x4f'))){_0x592535[_0xfe3e('0x31')]=qs[_0xfe3e('0x31')](_0x3ed3e9[_0xfe3e('0x47')][_0xfe3e('0x31')]);_0x592535['offset']=qs[_0xfe3e('0x50')](_0x3ed3e9[_0xfe3e('0x47')]['offset']);}_0x592535[_0xfe3e('0x51')]=qs['sort'](_0x3ed3e9[_0xfe3e('0x47')][_0xfe3e('0x52')]);_0x592535[_0xfe3e('0x53')]=qs['filters'](_[_0xfe3e('0x54')](_0x3ed3e9[_0xfe3e('0x47')],_0x93702['filters']));_0x592535[_0xfe3e('0x53')][_0xfe3e('0x6c')]=_0x547789['id'];if(_0x3ed3e9['query'][_0xfe3e('0x55')]){_0x592535[_0xfe3e('0x53')]=_[_0xfe3e('0x56')](_0x592535['where'],{'$or':_[_0xfe3e('0x46')](_0x592535[_0xfe3e('0x4b')],function(_0x9cd71b){var _0x3e673a={};_0x3e673a[_0x9cd71b]={'$like':'%'+_0x3ed3e9[_0xfe3e('0x47')]['filter']+'%'};return _0x3e673a;})});}_0x592535=_['merge']({},_0x592535,_0x3ed3e9[_0xfe3e('0x5f')]);return db[_0xfe3e('0xa5')][_0xfe3e('0x32')]({'where':_0x592535[_0xfe3e('0x53')]})['then'](function(_0x3708e7){_0x9ce7bd[_0xfe3e('0x32')]=_0x3708e7;if(_0x3ed3e9[_0xfe3e('0x47')]['includeAll']){_0x592535[_0xfe3e('0x5a')]=[{'model':db[_0xfe3e('0x7b')],'as':_0xfe3e('0xc6'),'required':![]},{'model':db[_0xfe3e('0xb2')],'as':_0xfe3e('0xc7'),'attributes':[_0xfe3e('0x3e'),'fullname',_0xfe3e('0xc8')],'required':![]},{'model':db['Tag'],'as':_0xfe3e('0xc9'),'attributes':['id','name',_0xfe3e('0xca')],'where':_0x3ed3e9[_0xfe3e('0x47')][_0xfe3e('0xcb')]?{'id':_0x3ed3e9[_0xfe3e('0x47')][_0xfe3e('0xcb')]}:undefined,'required':_0x3ed3e9[_0xfe3e('0x47')][_0xfe3e('0xcb')]?!![]:![]}];}return db[_0xfe3e('0xa5')][_0xfe3e('0x5b')](_0x592535);})['then'](function(_0x361845){_0x9ce7bd[_0xfe3e('0x5c')]=_0x361845;return _0x9ce7bd;});}})[_0xfe3e('0x23')](respondWithFilteredResult(_0x402809,_0x592535))[_0xfe3e('0x2d')](handleError(_0x402809,null));};exports[_0xfe3e('0xbb')]=function(_0x2e4f2a,_0x150758,_0x23cc7d){var _0x38e152,_0x166470,_0x3131df;if(_[_0xfe3e('0x9a')](_0x2e4f2a[_0xfe3e('0x61')]['body'])||_0x2e4f2a[_0xfe3e('0x61')][_0xfe3e('0x61')]===''){throw new db[(_0xfe3e('0x7c'))][(_0xfe3e('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfe3e('0x9a')](_0x2e4f2a[_0xfe3e('0x61')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x38e152=_0x2e4f2a[_0xfe3e('0x61')]['to'];return db['SmsAccount'][_0xfe3e('0x68')]({'where':{'id':_0x2e4f2a[_0xfe3e('0x69')]['id']},'include':[{'model':db[_0xfe3e('0xa0')],'as':'List','include':[{'model':db[_0xfe3e('0x7b')],'as':_0xfe3e('0xa1'),'where':{'mobile':_0x38e152},'limit':0x1,'order':[['updatedAt',_0xfe3e('0xcc')]]}]}]})[_0xfe3e('0x23')](handleEntityNotFound(_0x150758,null))[_0xfe3e('0x23')](function(_0x1857ca){if(_0x1857ca&&_0x1857ca[_0xfe3e('0xcd')]){_0x166470=_0x1857ca[_0xfe3e('0x3a')]({'plain':!![]});if(_0x166470[_0xfe3e('0xcd')]&&_0x166470[_0xfe3e('0xcd')]['Contacts'][_0xfe3e('0x4d')]){return _0x166470[_0xfe3e('0xcd')][_0xfe3e('0xa1')][0x0];}return db['CmContact'][_0xfe3e('0x60')](_[_0xfe3e('0x1c')](_0x2e4f2a[_0xfe3e('0x61')],{'firstName':_0x38e152,'mobile':_0x38e152,'phone':_0x38e152,'ListId':_0x166470[_0xfe3e('0x82')]}));}})[_0xfe3e('0x23')](handleEntityNotFound(_0x150758,null))[_0xfe3e('0x23')](function(_0x7b6e56){if(_0x7b6e56){_0x3131df=_0x7b6e56;return db[_0xfe3e('0xa5')]['find']({'where':{'ContactId':_0x3131df['id'],'closed':![],'SmsAccountId':_0x166470['id']}})[_0xfe3e('0x23')](function(_0x599423){if(_0x599423){return[_0x599423,![]];}return db[_0xfe3e('0xa5')]['create']({'UserId':_0x2e4f2a[_0xfe3e('0x62')]['id'],'ContactId':_0x3131df['id'],'SmsAccountId':_0x166470['id'],'phone':_0x38e152,'firstMsgDirection':_0xfe3e('0xce'),'Messages':[_[_0xfe3e('0x56')](_0x2e4f2a[_0xfe3e('0x61')],{'read':![],'body':_0x2e4f2a[_0xfe3e('0x61')][_0xfe3e('0x61')],'phone':_0x38e152,'SmsAccountId':_0x166470['id'],'UserId':_0x2e4f2a[_0xfe3e('0x62')]['id'],'ContactId':_0x3131df['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xfe3e('0xcf')}]})['then'](function(_0x793156){return[_0x793156,!![]];});});}})['spread'](function(_0x3e6905,_0x1f1064){if(_0x1f1064){return _0x3e6905;}return db[_0xfe3e('0xae')]['create'](_[_0xfe3e('0x56')](_0x2e4f2a[_0xfe3e('0x61')],{'read':![],'body':_0x2e4f2a[_0xfe3e('0x61')][_0xfe3e('0x61')],'phone':_0x38e152,'SmsAccountId':_0x166470['id'],'SmsInteractionId':_0x3e6905['id'],'UserId':_0x2e4f2a['user']['id'],'ContactId':_0x3131df['id']}))[_0xfe3e('0x23')](function(_0x28438c){_0x3e6905[_0xfe3e('0xd0')][_0xfe3e('0xcf')]=[];_0x3e6905[_0xfe3e('0xd0')]['Messages']['push'](_0x28438c[_0xfe3e('0xd0')]);return _0x3e6905;});})[_0xfe3e('0x23')](respondWithResult(_0x150758,null))[_0xfe3e('0x2d')](handleError(_0x150758,null));};exports[_0xfe3e('0x2f')]=function(_0x871a24,_0x2d7b89,_0x44e074){if(_0x871a24['body']['id']){delete _0x871a24[_0xfe3e('0x61')]['id'];}var _0xd27568,_0x42081c,_0x176e83;return db[_0xfe3e('0x42')][_0xfe3e('0x68')]({'where':{'id':_0x871a24[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x2d7b89,null))['then'](function(_0x51448a){if(_0x51448a){_0x176e83=_0x51448a;logger[_0xfe3e('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe3e('0x2f'),_0xfe3e('0xd1'),_0x51448a[_0xfe3e('0x57')],util[_0xfe3e('0xd2')](_0x871a24[_0xfe3e('0x61')],{'showHidden':![],'depth':null}));switch(_0x51448a[_0xfe3e('0x57')]){case _0xfe3e('0x88'):if(_0x871a24['body'][_0xfe3e('0xd3')]&&_0x871a24[_0xfe3e('0x61')][_0xfe3e('0x2f')]){_0x42081c=_0x871a24[_0xfe3e('0x61')][_0xfe3e('0x2f')];return db[_0xfe3e('0xae')][_0xfe3e('0x68')]({'where':{'messageId':_0x871a24['body'][_0xfe3e('0xd3')]}});}break;case _0xfe3e('0x8b'):if(_0x871a24[_0xfe3e('0x61')][_0xfe3e('0xd4')]&&_0x871a24[_0xfe3e('0x61')][_0xfe3e('0xd5')]){_0x42081c=_0x871a24[_0xfe3e('0x61')][_0xfe3e('0xd5')];return db[_0xfe3e('0xae')]['find']({'where':{'messageId':_0x871a24[_0xfe3e('0x61')][_0xfe3e('0xd4')]}});}break;case _0xfe3e('0x8c'):if(_0x871a24[_0xfe3e('0x61')][_0xfe3e('0x8e')]&&_0x871a24[_0xfe3e('0x61')][_0xfe3e('0xd6')]){_0x42081c=_0x871a24['body'][_0xfe3e('0xd6')];return db[_0xfe3e('0xae')]['find']({'where':{'messageId':_0x871a24['body'][_0xfe3e('0x8e')]}});}break;case _0xfe3e('0x92'):var _0x872d07=_0x871a24['body']['results'][0x0];if(_0x872d07['messageId']&&_0x872d07[_0xfe3e('0x2f')][_0xfe3e('0xd7')]===_0xfe3e('0xd8')){_0x42081c=_0x872d07['status']['groupName'];return db['SmsMessage'][_0xfe3e('0x68')]({'where':{'messageId':_0x872d07[_0xfe3e('0x8d')]}});}break;case _0xfe3e('0x95'):if(_0x871a24['body']['messageId']&&_0x871a24[_0xfe3e('0x61')]['status']){_0x42081c=_0x871a24['body'][_0xfe3e('0x2f')];return db['SmsMessage'][_0xfe3e('0x68')]({'where':{'messageId':_0x871a24['body'][_0xfe3e('0x8d')]}});}break;case _0xfe3e('0x98'):if(_0x871a24[_0xfe3e('0x61')][0x0][_0xfe3e('0x2b')]['id']){_0x42081c=_0x871a24[_0xfe3e('0x61')][0x0][_0xfe3e('0x57')];return db[_0xfe3e('0xae')]['find']({'where':{'messageId':_0x871a24['body'][0x0]['message']['id']}});}break;case'intelepeer':if(_0x871a24[_0xfe3e('0x61')]['redif']&&_0x871a24[_0xfe3e('0x61')][_0xfe3e('0x2f')]){_0x42081c=_0x871a24[_0xfe3e('0x61')]['status'];return db[_0xfe3e('0xae')][_0xfe3e('0x68')]({'where':{'messageId':_0x871a24[_0xfe3e('0x61')][_0xfe3e('0xd9')]}});}break;}}})[_0xfe3e('0x23')](handleEntityNotFound(_0x2d7b89,null))[_0xfe3e('0x23')](function(_0x420cca){if(_0x420cca){_0xd27568=_0x420cca;switch(_0x176e83[_0xfe3e('0x57')]){case _0xfe3e('0x88'):if(_0x42081c===_0xfe3e('0xd8')){return _0xd27568[_0xfe3e('0x67')]({'read':!![]});}else{logger[_0xfe3e('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe3e('0x2f'),_0xfe3e('0x88'),util[_0xfe3e('0xd2')](_0x871a24[_0xfe3e('0x61')],{'showHidden':![],'depth':null}));}break;case _0xfe3e('0x8b'):if(_0x42081c==='1'){return _0xd27568['update']({'read':!![]});}else{logger[_0xfe3e('0x2a')](_0xfe3e('0x26'),_0xfe3e('0x2f'),_0xfe3e('0x88'),util['inspect'](_0x871a24['body'],{'showHidden':![],'depth':null}));}break;case _0xfe3e('0x8c'):if(!_0x871a24[_0xfe3e('0x61')][_0xfe3e('0xda')]&&_0x42081c>=0xc8&&_0x42081c<=0xce){return _0xd27568[_0xfe3e('0x67')]({'read':!![]});}else{logger[_0xfe3e('0x2a')](_0xfe3e('0x26'),_0xfe3e('0x2f'),_0xfe3e('0x8c'),util['inspect'](_0x871a24[_0xfe3e('0x61')],{'showHidden':![],'depth':null}));}break;case _0xfe3e('0x92'):var _0x18f864=_0x871a24[_0xfe3e('0x61')][_0xfe3e('0x93')][0x0];if(_0x18f864[_0xfe3e('0x2f')]['groupName']===_0xfe3e('0xd8')){return _0xd27568['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xfe3e('0x92'),util[_0xfe3e('0xd2')](_0x871a24[_0xfe3e('0x61')],{'showHidden':![],'depth':null}));}break;case _0xfe3e('0x95'):if(_0x42081c==_0xfe3e('0xdb')||_0x42081c==_0xfe3e('0xdc')){return _0xd27568[_0xfe3e('0x67')]({'read':!![]});}else{logger[_0xfe3e('0x2a')](_0xfe3e('0x26'),_0xfe3e('0x2f'),_0xfe3e('0x95'),util[_0xfe3e('0xd2')](_0x871a24[_0xfe3e('0x61')],{'showHidden':![],'depth':null}));}break;case _0xfe3e('0x98'):if(_0x42081c==_0xfe3e('0xdd')){return _0xd27568['update']({'read':!![]});}else{logger['error'](_0xfe3e('0x26'),_0xfe3e('0x2f'),'bandwidth',util[_0xfe3e('0xd2')](_0x871a24['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x42081c==='DELIVRD'||_0x42081c===_0xfe3e('0xde')){return _0xd27568[_0xfe3e('0x67')]({'read':!![]});}else{logger[_0xfe3e('0x2a')](_0xfe3e('0x26'),_0xfe3e('0x2f'),'intelepeer',util['inspect'](_0x871a24[_0xfe3e('0x61')],{'showHidden':![],'depth':null}));}break;}return _0xd27568;}})[_0xfe3e('0x23')](respondWithResult(_0x2d7b89,null))[_0xfe3e('0x2d')](handleError(_0x2d7b89,null));};exports[_0xfe3e('0xdf')]=function(_0x3ceaed,_0x5c6697,_0x15b7cf){var _0x51ab6f,_0x2ea535,_0x3d2489;return db[_0xfe3e('0x42')][_0xfe3e('0x68')]({'where':{'id':_0x3ceaed[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x5c6697,null))['then'](function(_0x410dba){if(_0x410dba){_0x3d2489=_0x410dba;logger[_0xfe3e('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x410dba[_0xfe3e('0x57')],util[_0xfe3e('0xd2')](_0x3ceaed[_0xfe3e('0x47')],{'showHidden':![],'depth':null}));switch(_0x410dba[_0xfe3e('0x57')]){case _0xfe3e('0x94'):if(_0x3ceaed[_0xfe3e('0x47')]['message-id']&&_0x3ceaed[_0xfe3e('0x47')][_0xfe3e('0xe0')]){_0x2ea535=_0x3ceaed[_0xfe3e('0x47')]['state'];return db['SmsMessage'][_0xfe3e('0x68')]({'where':{'messageId':_0x3ceaed[_0xfe3e('0x47')][_0xfe3e('0xe1')]}});}break;}}})[_0xfe3e('0x23')](handleEntityNotFound(_0x5c6697,null))['then'](function(_0x4a6c84){if(_0x4a6c84){_0x51ab6f=_0x4a6c84;switch(_0x3d2489[_0xfe3e('0x57')]){case _0xfe3e('0x94'):if(_0x2ea535==='2'||_0x2ea535==='6'){return _0x51ab6f['update']({'read':!![]});}else{logger['error'](_0xfe3e('0x26'),_0xfe3e('0x2f'),_0xfe3e('0x94'),util[_0xfe3e('0xd2')](_0x3ceaed['query'],{'showHidden':![],'depth':null}));};break;}return _0x51ab6f;}})[_0xfe3e('0x23')](respondWithResult(_0x5c6697,null))[_0xfe3e('0x2d')](handleError(_0x5c6697,null));};exports[_0xfe3e('0xe2')]=function(_0x429f23,_0xecada9,_0x1c67c8){return db[_0xfe3e('0x42')][_0xfe3e('0x68')]({'where':{'id':_0x429f23[_0xfe3e('0x69')]['id']}})['then'](handleEntityNotFound(_0xecada9,null))[_0xfe3e('0x23')](function(_0x247ae9){if(_0x247ae9){return _0x247ae9['addAgents'](_0x429f23[_0xfe3e('0x61')]['ids'],_[_0xfe3e('0xa3')](_0x429f23['body'],[_0xfe3e('0x71'),'id'])||{})[_0xfe3e('0xa6')](function(_0x2428ce){for(var _0x432473=0x0;_0x432473<_0x429f23[_0xfe3e('0x61')][_0xfe3e('0x71')]['length'];_0x432473+=0x1){socket[_0xfe3e('0xe3')]('userSmsAccount:save',{'UserId':Number(_0x429f23[_0xfe3e('0x61')][_0xfe3e('0x71')][_0x432473]),'SmsAccountId':Number(_0x429f23[_0xfe3e('0x69')]['id'])});}return _0x2428ce;});}})[_0xfe3e('0x23')](respondWithResult(_0xecada9,null))[_0xfe3e('0x2d')](handleError(_0xecada9,null));};exports['removeAgents']=function(_0x2e3d79,_0x23acaa,_0x3d137a){return db[_0xfe3e('0x42')][_0xfe3e('0x68')]({'where':{'id':_0x2e3d79[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x23acaa,null))[_0xfe3e('0x23')](function(_0x158363){if(_0x158363){return _0x158363[_0xfe3e('0xe4')](_0x2e3d79[_0xfe3e('0x47')][_0xfe3e('0x71')])[_0xfe3e('0x23')](function(){if(_[_0xfe3e('0xe5')](_0x2e3d79[_0xfe3e('0x47')][_0xfe3e('0x71')])){for(var _0x414d0c=0x0;_0x414d0c<_0x2e3d79[_0xfe3e('0x47')][_0xfe3e('0x71')][_0xfe3e('0x4d')];_0x414d0c+=0x1){socket['emit'](_0xfe3e('0xe6'),{'UserId':Number(_0x2e3d79[_0xfe3e('0x47')]['ids'][_0x414d0c]),'SmsAccountId':Number(_0x2e3d79['params']['id'])});}}else{socket[_0xfe3e('0xe3')](_0xfe3e('0xe6'),{'UserId':Number(_0x2e3d79[_0xfe3e('0x47')][_0xfe3e('0x71')]),'SmsAccountId':Number(_0x2e3d79[_0xfe3e('0x69')]['id'])});}});}})[_0xfe3e('0x23')](respondWithStatusCode(_0x23acaa,null))[_0xfe3e('0x2d')](handleError(_0x23acaa,null));};exports[_0xfe3e('0xe7')]=function(_0x4ec41a,_0x469c95,_0x4ff04b){var _0x8cb187={};var _0x56adc7={};var _0x2e275b;var _0xd4d1af;return db[_0xfe3e('0x42')]['findOne']({'where':{'id':_0x4ec41a[_0xfe3e('0x69')]['id']}})[_0xfe3e('0x23')](handleEntityNotFound(_0x469c95,null))[_0xfe3e('0x23')](function(_0x48d555){if(_0x48d555){_0x2e275b=_0x48d555;_0x56adc7[_0xfe3e('0x45')]=_[_0xfe3e('0x48')](db[_0xfe3e('0xb2')][_0xfe3e('0x5e')]);_0x56adc7['query']=_[_0xfe3e('0x48')](_0x4ec41a[_0xfe3e('0x47')]);_0x56adc7[_0xfe3e('0x49')]=_[_0xfe3e('0x4a')](_0x56adc7[_0xfe3e('0x45')],_0x56adc7[_0xfe3e('0x47')]);_0x8cb187[_0xfe3e('0x4b')]=_['intersection'](_0x56adc7['model'],qs['fields'](_0x4ec41a['query'][_0xfe3e('0x4c')]));_0x8cb187[_0xfe3e('0x4b')]=_0x8cb187[_0xfe3e('0x4b')]['length']?_0x8cb187[_0xfe3e('0x4b')]:_0x56adc7[_0xfe3e('0x45')];_0x8cb187[_0xfe3e('0x51')]=qs[_0xfe3e('0x52')](_0x4ec41a[_0xfe3e('0x47')][_0xfe3e('0x52')]);_0x8cb187[_0xfe3e('0x53')]=qs[_0xfe3e('0x49')](_[_0xfe3e('0x54')](_0x4ec41a[_0xfe3e('0x47')],_0x56adc7[_0xfe3e('0x49')]));if(_0x4ec41a[_0xfe3e('0x47')]['filter']){_0x8cb187[_0xfe3e('0x53')]=_[_0xfe3e('0x56')](_0x8cb187['where'],{'$or':_['map'](_0x8cb187[_0xfe3e('0x4b')],function(_0x47e610){var _0x357639={};_0x357639[_0x47e610]={'$like':'%'+_0x4ec41a[_0xfe3e('0x47')][_0xfe3e('0x55')]+'%'};return _0x357639;})});}_0x8cb187=_[_0xfe3e('0x56')]({},_0x8cb187,_0x4ec41a[_0xfe3e('0x5f')]);return _0x2e275b['getAgents'](_0x8cb187);}})['then'](function(_0x1be45a){if(_0x1be45a){_0xd4d1af=_0x1be45a[_0xfe3e('0x4d')];if(!_0x4ec41a[_0xfe3e('0x47')][_0xfe3e('0x4e')](_0xfe3e('0x4f'))){_0x8cb187[_0xfe3e('0x31')]=qs[_0xfe3e('0x31')](_0x4ec41a['query']['limit']);_0x8cb187[_0xfe3e('0x50')]=qs[_0xfe3e('0x50')](_0x4ec41a[_0xfe3e('0x47')][_0xfe3e('0x50')]);}return _0x2e275b['getAgents'](_0x8cb187);}})[_0xfe3e('0x23')](function(_0xf726a5){if(_0xf726a5){return _0xf726a5?{'count':_0xd4d1af,'rows':_0xf726a5}:null;}})['then'](respondWithResult(_0x469c95,null))[_0xfe3e('0x2d')](handleError(_0x469c95,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 0da9b50..2acaae2 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 _0xa40a=['remove','emit','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x212a2e,_0x5bc358){var _0x19e9c6=function(_0x308afc){while(--_0x308afc){_0x212a2e['push'](_0x212a2e['shift']());}};_0x19e9c6(++_0x5bc358);}(_0xa40a,0x133));var _0xaa40=function(_0x25a614,_0xbefde7){_0x25a614=_0x25a614-0x0;var _0x10407e=_0xa40a[_0x25a614];return _0x10407e;};'use strict';var EventEmitter=require(_0xaa40('0x0'));var SmsAccount=require(_0xaa40('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xaa40('0x2')](0x0);var events={'afterCreate':_0xaa40('0x3'),'afterUpdate':_0xaa40('0x4'),'afterDestroy':_0xaa40('0x5')};function emitEvent(_0x564c06){return function(_0x681405,_0xb8f52,_0x4cbda0){SmsAccountEvents[_0xaa40('0x6')](_0x564c06+':'+_0x681405['id'],_0x681405);SmsAccountEvents['emit'](_0x564c06,_0x681405);_0x4cbda0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xaa40('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x4e32=['SmsAccount','update','remove','emit','hasOwnProperty','events'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x4e32,0x14f));var _0x24e3=function(_0x1d2309,_0x2dbfd1){_0x1d2309=_0x1d2309-0x0;var _0x1cfb02=_0x4e32[_0x1d2309];return _0x1cfb02;};'use strict';var EventEmitter=require(_0x24e3('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x24e3('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x24e3('0x2'),'afterDestroy':_0x24e3('0x3')};function emitEvent(_0x45de83){return function(_0x8dcc6e,_0xdbee3f,_0x26014b){SmsAccountEvents['emit'](_0x45de83+':'+_0x8dcc6e['id'],_0x8dcc6e);SmsAccountEvents[_0x24e3('0x4')](_0x45de83,_0x8dcc6e);_0x26014b(null);};}for(var e in events){if(events[_0x24e3('0x5')](e)){var event=events[e];SmsAccount['hook'](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 9f35d9d..44a655b 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 _0xeb63=['SmsAccount','util','api','moment','path','rimraf','exports','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeb63,0x1b1));var _0x3eb6=function(_0x410e0f,_0x409b52){_0x410e0f=_0x410e0f-0x0;var _0x29c16b=_0xeb63[_0x410e0f];return _0x29c16b;};'use strict';var _=require('lodash');var util=require(_0x3eb6('0x0'));var logger=require('../../config/logger')(_0x3eb6('0x1'));var moment=require(_0x3eb6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3eb6('0x3'));var rimraf=require(_0x3eb6('0x4'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x3eb6('0x5')]=function(_0x59b682,_0x2890ae){return _0x59b682[_0x3eb6('0x6')](_0x3eb6('0x7'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5df=['request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','../../config/logger','api'];(function(_0x1efaf0,_0x19ee59){var _0x26fe0b=function(_0x15f7d4){while(--_0x15f7d4){_0x1efaf0['push'](_0x1efaf0['shift']());}};_0x26fe0b(++_0x19ee59);}(_0xc5df,0x80));var _0xfc5d=function(_0x58e533,_0x2a0f75){_0x58e533=_0x58e533-0x0;var _0x27d3da=_0xc5df[_0x58e533];return _0x27d3da;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfc5d('0x0'))(_0xfc5d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfc5d('0x2'));var fs=require('fs');var path=require(_0xfc5d('0x3'));var rimraf=require(_0xfc5d('0x4'));var config=require(_0xfc5d('0x5'));var attributes=require(_0xfc5d('0x6'));module['exports']=function(_0x1c8057,_0x2df24e){return _0x1c8057[_0xfc5d('0x7')](_0xfc5d('0x8'),attributes,{'tableName':_0xfc5d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 764106c..426f76b 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 _0xae3b=['then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','model','map','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsAccount.socket','request'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xae3b,0x190));var _0xbae3=function(_0x4d799e,_0x23a294){_0x4d799e=_0x4d799e-0x0;var _0x390621=_0xae3b[_0x4d799e];return _0x390621;};'use strict';var _=require(_0xbae3('0x0'));var util=require(_0xbae3('0x1'));var moment=require(_0xbae3('0x2'));var BPromise=require(_0xbae3('0x3'));var rs=require(_0xbae3('0x4'));var fs=require('fs');var Redis=require(_0xbae3('0x5'));var db=require(_0xbae3('0x6'))['db'];var utils=require(_0xbae3('0x7'));var logger=require(_0xbae3('0x8'))(_0xbae3('0x9'));var config=require(_0xbae3('0xa'));var jayson=require(_0xbae3('0xb'));var client=jayson['client'][_0xbae3('0xc')]({'port':0x232a});config[_0xbae3('0xd')]=_[_0xbae3('0xe')](config[_0xbae3('0xd')],{'host':_0xbae3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbae3('0xd')]));require(_0xbae3('0x10'))['register'](socket);function respondWithRpcPromise(_0xe77ee0,_0xfb2f04,_0x1f7173){return new BPromise(function(_0x2f12f5,_0x5e2948){return client[_0xbae3('0x11')](_0xe77ee0,_0x1f7173)[_0xbae3('0x12')](function(_0xb2626a){logger['info'](_0xbae3('0x13'),_0xfb2f04,_0xbae3('0x14'));logger[_0xbae3('0x15')](_0xbae3('0x16'),_0xfb2f04,_0xbae3('0x14'),JSON[_0xbae3('0x17')](_0xb2626a));if(_0xb2626a[_0xbae3('0x18')]){if(_0xb2626a[_0xbae3('0x18')]['code']===0x1f4){logger[_0xbae3('0x18')]('SmsAccount,\x20%s,\x20%s',_0xfb2f04,_0xb2626a[_0xbae3('0x18')][_0xbae3('0x19')]);return _0x5e2948(_0xb2626a['error'][_0xbae3('0x19')]);}logger[_0xbae3('0x18')]('SmsAccount,\x20%s,\x20%s',_0xfb2f04,_0xb2626a[_0xbae3('0x18')][_0xbae3('0x19')]);return _0x2f12f5(_0xb2626a['error'][_0xbae3('0x19')]);}else{logger['info'](_0xbae3('0x13'),_0xfb2f04,_0xbae3('0x14'));_0x2f12f5(_0xb2626a[_0xbae3('0x1a')][_0xbae3('0x19')]);}})['catch'](function(_0x16b98d){logger[_0xbae3('0x18')](_0xbae3('0x13'),_0xfb2f04,_0x16b98d);_0x5e2948(_0x16b98d);});});}exports[_0xbae3('0x1b')]=function(_0x2b631e){var _0x4abfee=this;return new Promise(function(_0x29b4f3,_0x1f8e9d){return db[_0xbae3('0x1c')]['find']({'raw':_0x2b631e[_0xbae3('0x1d')]?_0x2b631e['options'][_0xbae3('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b631e[_0xbae3('0x1d')]?_0x2b631e[_0xbae3('0x1d')][_0xbae3('0x1f')]||null:null,'attributes':_0x2b631e[_0xbae3('0x1d')]?_0x2b631e[_0xbae3('0x1d')][_0xbae3('0x20')]||null:null,'include':_0x2b631e[_0xbae3('0x1d')]?_0x2b631e[_0xbae3('0x1d')][_0xbae3('0x21')]?_['map'](_0x2b631e[_0xbae3('0x1d')][_0xbae3('0x21')],function(_0x53ae27){return{'model':db[_0x53ae27[_0xbae3('0x22')]],'as':_0x53ae27['as'],'attributes':_0x53ae27[_0xbae3('0x20')],'include':_0x53ae27['include']?_[_0xbae3('0x23')](_0x53ae27['include'],function(_0x1cb164){return{'model':db[_0x1cb164['model']],'as':_0x1cb164['as'],'attributes':_0x1cb164[_0xbae3('0x20')],'include':_0x1cb164['include']?_[_0xbae3('0x23')](_0x1cb164[_0xbae3('0x21')],function(_0x3210db){return{'model':db[_0x3210db[_0xbae3('0x22')]],'as':_0x3210db['as'],'attributes':_0x3210db[_0xbae3('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbae3('0x12')](function(_0x27e13d){logger[_0xbae3('0x24')]('ShowSmsAccount',_0x2b631e);logger[_0xbae3('0x15')](_0xbae3('0x1b'),_0x2b631e,JSON[_0xbae3('0x17')](_0x27e13d));_0x29b4f3(_0x27e13d);})[_0xbae3('0x25')](function(_0x3ad480){logger[_0xbae3('0x18')](_0xbae3('0x1b'),_0x3ad480[_0xbae3('0x19')],_0x2b631e);_0x1f8e9d(_0x4abfee[_0xbae3('0x18')](0x1f4,_0x3ad480['message']));});});}; \ No newline at end of file +var _0xd5e8=['http','defaults','redis','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','options','raw','where','attributes','include','map','model','debug','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f67c4,_0x4cd85c){var _0x2eb0dd=function(_0x13cd09){while(--_0x13cd09){_0x3f67c4['push'](_0x3f67c4['shift']());}};_0x2eb0dd(++_0x4cd85c);}(_0xd5e8,0xc7));var _0x8d5e=function(_0x17b186,_0x24e761){_0x17b186=_0x17b186-0x0;var _0x1864cc=_0xd5e8[_0x17b186];return _0x1864cc;};'use strict';var _=require(_0x8d5e('0x0'));var util=require('util');var moment=require(_0x8d5e('0x1'));var BPromise=require(_0x8d5e('0x2'));var rs=require(_0x8d5e('0x3'));var fs=require('fs');var Redis=require(_0x8d5e('0x4'));var db=require(_0x8d5e('0x5'))['db'];var utils=require(_0x8d5e('0x6'));var logger=require('../../config/logger')(_0x8d5e('0x7'));var config=require(_0x8d5e('0x8'));var jayson=require(_0x8d5e('0x9'));var client=jayson[_0x8d5e('0xa')][_0x8d5e('0xb')]({'port':0x232a});config['redis']=_[_0x8d5e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8d5e('0xd')]));require(_0x8d5e('0xe'))['register'](socket);function respondWithRpcPromise(_0x1549b7,_0x20d6e7,_0x2601f0){return new BPromise(function(_0x5af3d4,_0x22ed0b){return client[_0x8d5e('0xf')](_0x1549b7,_0x2601f0)[_0x8d5e('0x10')](function(_0x147def){logger[_0x8d5e('0x11')](_0x8d5e('0x12'),_0x20d6e7,_0x8d5e('0x13'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x20d6e7,_0x8d5e('0x13'),JSON[_0x8d5e('0x14')](_0x147def));if(_0x147def[_0x8d5e('0x15')]){if(_0x147def['error'][_0x8d5e('0x16')]===0x1f4){logger[_0x8d5e('0x15')](_0x8d5e('0x12'),_0x20d6e7,_0x147def['error'][_0x8d5e('0x17')]);return _0x22ed0b(_0x147def[_0x8d5e('0x15')][_0x8d5e('0x17')]);}logger[_0x8d5e('0x15')](_0x8d5e('0x12'),_0x20d6e7,_0x147def[_0x8d5e('0x15')][_0x8d5e('0x17')]);return _0x5af3d4(_0x147def[_0x8d5e('0x15')]['message']);}else{logger[_0x8d5e('0x11')](_0x8d5e('0x12'),_0x20d6e7,'request\x20sent');_0x5af3d4(_0x147def[_0x8d5e('0x18')][_0x8d5e('0x17')]);}})['catch'](function(_0x2e2936){logger['error'](_0x8d5e('0x12'),_0x20d6e7,_0x2e2936);_0x22ed0b(_0x2e2936);});});}exports[_0x8d5e('0x19')]=function(_0x255b34){var _0x47bff2=this;return new Promise(function(_0x5cbd71,_0xc2e33e){return db[_0x8d5e('0x1a')]['find']({'raw':_0x255b34[_0x8d5e('0x1b')]?_0x255b34[_0x8d5e('0x1b')][_0x8d5e('0x1c')]===undefined?!![]:![]:!![],'where':_0x255b34[_0x8d5e('0x1b')]?_0x255b34[_0x8d5e('0x1b')][_0x8d5e('0x1d')]||null:null,'attributes':_0x255b34[_0x8d5e('0x1b')]?_0x255b34['options'][_0x8d5e('0x1e')]||null:null,'include':_0x255b34['options']?_0x255b34[_0x8d5e('0x1b')][_0x8d5e('0x1f')]?_[_0x8d5e('0x20')](_0x255b34[_0x8d5e('0x1b')]['include'],function(_0x25f1a5){return{'model':db[_0x25f1a5['model']],'as':_0x25f1a5['as'],'attributes':_0x25f1a5[_0x8d5e('0x1e')],'include':_0x25f1a5[_0x8d5e('0x1f')]?_[_0x8d5e('0x20')](_0x25f1a5['include'],function(_0x88481a){return{'model':db[_0x88481a[_0x8d5e('0x21')]],'as':_0x88481a['as'],'attributes':_0x88481a[_0x8d5e('0x1e')],'include':_0x88481a[_0x8d5e('0x1f')]?_[_0x8d5e('0x20')](_0x88481a['include'],function(_0x28c7b6){return{'model':db[_0x28c7b6[_0x8d5e('0x21')]],'as':_0x28c7b6['as'],'attributes':_0x28c7b6[_0x8d5e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8d5e('0x10')](function(_0x46122a){logger['info'](_0x8d5e('0x19'),_0x255b34);logger[_0x8d5e('0x22')](_0x8d5e('0x19'),_0x255b34,JSON['stringify'](_0x46122a));_0x5cbd71(_0x46122a);})['catch'](function(_0x39ea2d){logger[_0x8d5e('0x15')](_0x8d5e('0x19'),_0x39ea2d['message'],_0x255b34);_0xc2e33e(_0x47bff2['error'](0x1f4,_0x39ea2d[_0x8d5e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 1cd842c..4d9c277 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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 590831f..f2803b7 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(_0x25e723,_0x34afbd){var _0xca7c69=function(_0x16f1a4){while(--_0x16f1a4){_0x25e723['push'](_0x25e723['shift']());}};_0xca7c69(++_0x34afbd);}(_0xedd9,0xfc));var _0x9edd=function(_0x5c9682,_0x3e8840){_0x5c9682=_0x5c9682-0x0;var _0x43d8e7=_0xedd9[_0x5c9682];return _0x43d8e7;};'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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4a5c11,_0x204ec0){var _0x230f14=function(_0x49840b){while(--_0x49840b){_0x4a5c11['push'](_0x4a5c11['shift']());}};_0x230f14(++_0x204ec0);}(_0x34e8,0x12c));var _0x834e=function(_0x5d7280,_0x2b446a){_0x5d7280=_0x5d7280-0x0;var _0x200055=_0x34e8[_0x5d7280];return _0x200055;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 65104ef..7bf3cd4 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 _0x416c=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x12867f,_0x44b08a){var _0xf984ee=function(_0x2805d7){while(--_0x2805d7){_0x12867f['push'](_0x12867f['shift']());}};_0xf984ee(++_0x44b08a);}(_0x416c,0x1c8));var _0xc416=function(_0x179165,_0x4c82fd){_0x179165=_0x179165-0x0;var _0x227a4f=_0x416c[_0x179165];return _0x227a4f;};'use strict';var Sequelize=require(_0xc416('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc416('0x1')],'allowNull':![],'defaultValue':_0xc416('0x2')},'appdata':{'type':Sequelize[_0xc416('0x3')]()},'description':{'type':Sequelize[_0xc416('0x1')]},'interval':{'type':Sequelize[_0xc416('0x1')],'defaultValue':_0xc416('0x4')}}; \ No newline at end of file +var _0x4fc5=['INTEGER','STRING','noop','*,*,*,*','sequelize','exports'];(function(_0x309b6a,_0xaba765){var _0x4f24b1=function(_0x14208b){while(--_0x14208b){_0x309b6a['push'](_0x309b6a['shift']());}};_0x4f24b1(++_0xaba765);}(_0x4fc5,0x100));var _0x54fc=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x4fc5[_0x557fd2];return _0x1b54a2;};'use strict';var Sequelize=require(_0x54fc('0x0'));module[_0x54fc('0x1')]={'priority':{'type':Sequelize[_0x54fc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x54fc('0x3')],'allowNull':![],'defaultValue':_0x54fc('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x54fc('0x3')],'defaultValue':_0x54fc('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index dcda7de..36d475c 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 _0x1766=['name','send','map','SmsApplication','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','error'];(function(_0x509341,_0x52a61b){var _0x514071=function(_0x266a6c){while(--_0x266a6c){_0x509341['push'](_0x509341['shift']());}};_0x514071(++_0x52a61b);}(_0x1766,0x6c));var _0x6176=function(_0x2aaeb2,_0x1b745e){_0x2aaeb2=_0x2aaeb2-0x0;var _0x58bf5b=_0x1766[_0x2aaeb2];return _0x58bf5b;};'use strict';var emlformat=require(_0x6176('0x0'));var rimraf=require(_0x6176('0x1'));var zipdir=require(_0x6176('0x2'));var jsonpatch=require(_0x6176('0x3'));var rp=require('request-promise');var moment=require(_0x6176('0x4'));var BPromise=require(_0x6176('0x5'));var Mustache=require('mustache');var util=require(_0x6176('0x6'));var path=require(_0x6176('0x7'));var sox=require(_0x6176('0x8'));var csv=require(_0x6176('0x9'));var ejs=require(_0x6176('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6176('0xb'));var squel=require(_0x6176('0xc'));var crypto=require('crypto');var jsforce=require(_0x6176('0xd'));var deskjs=require(_0x6176('0xe'));var toCsv=require(_0x6176('0x9'));var querystring=require('querystring');var Papa=require(_0x6176('0xf'));var Redis=require(_0x6176('0x10'));var authService=require(_0x6176('0x11'));var qs=require(_0x6176('0x12'));var as=require(_0x6176('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6176('0x14'))('api');var utils=require(_0x6176('0x15'));var config=require(_0x6176('0x16'));var licenseUtil=require(_0x6176('0x17'));var db=require(_0x6176('0x18'))['db'];function respondWithStatusCode(_0x1e52e9,_0x4211b6){_0x4211b6=_0x4211b6||0xcc;return function(_0x146368){if(_0x146368){return _0x1e52e9[_0x6176('0x19')](_0x4211b6);}return _0x1e52e9[_0x6176('0x1a')](_0x4211b6)[_0x6176('0x1b')]();};}function respondWithResult(_0x39d69b,_0x4975dc){_0x4975dc=_0x4975dc||0xc8;return function(_0x3c7453){if(_0x3c7453){return _0x39d69b[_0x6176('0x1a')](_0x4975dc)['json'](_0x3c7453);}};}function respondWithFilteredResult(_0xe2ff28,_0x3e2b13){return function(_0x458826){if(_0x458826){var _0x8bfce6=typeof _0x3e2b13[_0x6176('0x1c')]===_0x6176('0x1d')&&typeof _0x3e2b13[_0x6176('0x1e')]===_0x6176('0x1d');var _0x3e1c2=_0x458826[_0x6176('0x1f')];var _0x53a8f0=_0x8bfce6?0x0:_0x3e2b13[_0x6176('0x1c')];var _0x315943=_0x8bfce6?_0x458826['count']:_0x3e2b13['offset']+_0x3e2b13[_0x6176('0x1e')];var _0x7638a4;if(_0x315943>=_0x3e1c2){_0x315943=_0x3e1c2;_0x7638a4=0xc8;}else{_0x7638a4=0xce;}_0xe2ff28[_0x6176('0x1a')](_0x7638a4);return _0xe2ff28[_0x6176('0x20')](_0x6176('0x21'),_0x53a8f0+'-'+_0x315943+'/'+_0x3e1c2)['json'](_0x458826);}return null;};}function patchUpdates(_0x5e9434){return function(_0x37d354){try{jsonpatch['apply'](_0x37d354,_0x5e9434,!![]);}catch(_0x50d3d4){return BPromise[_0x6176('0x22')](_0x50d3d4);}return _0x37d354[_0x6176('0x23')]();};}function saveUpdates(_0x834ab0,_0x449594){return function(_0x2ebbcc){if(_0x2ebbcc){return _0x2ebbcc['update'](_0x834ab0)[_0x6176('0x24')](function(_0x555c34){return _0x555c34;});}return null;};}function removeEntity(_0x4acda6,_0x51a8f0){return function(_0x91d641){if(_0x91d641){return _0x91d641['destroy']()[_0x6176('0x24')](function(){_0x4acda6[_0x6176('0x1a')](0xcc)[_0x6176('0x1b')]();});}};}function handleEntityNotFound(_0x412157,_0x2ad7f0){return function(_0x2f21b7){if(!_0x2f21b7){_0x412157[_0x6176('0x19')](0x194);}return _0x2f21b7;};}function handleError(_0x2fd716,_0x408d3b){_0x408d3b=_0x408d3b||0x1f4;return function(_0x240a38){logger[_0x6176('0x25')](_0x240a38['stack']);if(_0x240a38[_0x6176('0x26')]){delete _0x240a38[_0x6176('0x26')];}_0x2fd716[_0x6176('0x1a')](_0x408d3b)[_0x6176('0x27')](_0x240a38);};}exports['index']=function(_0x56c733,_0x5c0bb){var _0x7ded52={},_0x1d6a15={},_0x412516={'count':0x0,'rows':[]};var _0x3ae756=_[_0x6176('0x28')](db[_0x6176('0x29')][_0x6176('0x2a')],function(_0x5407fa){return{'name':_0x5407fa['fieldName'],'type':_0x5407fa[_0x6176('0x2b')][_0x6176('0x2c')]};});_0x1d6a15['model']=_[_0x6176('0x28')](_0x3ae756,_0x6176('0x26'));_0x1d6a15[_0x6176('0x2d')]=_['keys'](_0x56c733['query']);_0x1d6a15[_0x6176('0x2e')]=_[_0x6176('0x2f')](_0x1d6a15[_0x6176('0x30')],_0x1d6a15[_0x6176('0x2d')]);_0x7ded52[_0x6176('0x31')]=_['intersection'](_0x1d6a15[_0x6176('0x30')],qs[_0x6176('0x32')](_0x56c733[_0x6176('0x2d')][_0x6176('0x32')]));_0x7ded52[_0x6176('0x31')]=_0x7ded52[_0x6176('0x31')][_0x6176('0x33')]?_0x7ded52['attributes']:_0x1d6a15['model'];if(!_0x56c733[_0x6176('0x2d')][_0x6176('0x34')](_0x6176('0x35'))){_0x7ded52[_0x6176('0x1e')]=qs[_0x6176('0x1e')](_0x56c733[_0x6176('0x2d')][_0x6176('0x1e')]);_0x7ded52[_0x6176('0x1c')]=qs[_0x6176('0x1c')](_0x56c733['query'][_0x6176('0x1c')]);}_0x7ded52['order']=qs[_0x6176('0x36')](_0x56c733['query'][_0x6176('0x36')]);_0x7ded52[_0x6176('0x37')]=qs['filters'](_['pick'](_0x56c733['query'],_0x1d6a15['filters']),_0x3ae756);if(_0x56c733[_0x6176('0x2d')][_0x6176('0x38')]){_0x7ded52[_0x6176('0x37')]=_[_0x6176('0x39')](_0x7ded52[_0x6176('0x37')],{'$or':_['map'](_0x3ae756,function(_0x278047){if(_0x278047[_0x6176('0x2b')]!==_0x6176('0x3a')){var _0x36912e={};_0x36912e[_0x278047[_0x6176('0x26')]]={'$like':'%'+_0x56c733[_0x6176('0x2d')]['filter']+'%'};return _0x36912e;}})});}_0x7ded52=_[_0x6176('0x39')]({},_0x7ded52,_0x56c733[_0x6176('0x3b')]);var _0x2434a3={'where':_0x7ded52[_0x6176('0x37')]};return db['SmsApplication'][_0x6176('0x1f')](_0x2434a3)[_0x6176('0x24')](function(_0x351927){_0x412516[_0x6176('0x1f')]=_0x351927;if(_0x56c733[_0x6176('0x2d')][_0x6176('0x3c')]){_0x7ded52['include']=[{'all':!![]}];}return db['SmsApplication'][_0x6176('0x3d')](_0x7ded52);})[_0x6176('0x24')](function(_0x88f26e){_0x412516[_0x6176('0x3e')]=_0x88f26e;return _0x412516;})[_0x6176('0x24')](respondWithFilteredResult(_0x5c0bb,_0x7ded52))[_0x6176('0x3f')](handleError(_0x5c0bb,null));};exports[_0x6176('0x40')]=function(_0x4a8c85,_0x446fb5){var _0x4cb68b={'raw':!![],'where':{'id':_0x4a8c85[_0x6176('0x41')]['id']}},_0x43f1a9={};_0x43f1a9[_0x6176('0x30')]=_['keys'](db[_0x6176('0x29')][_0x6176('0x2a')]);_0x43f1a9[_0x6176('0x2d')]=_[_0x6176('0x42')](_0x4a8c85[_0x6176('0x2d')]);_0x43f1a9['filters']=_[_0x6176('0x2f')](_0x43f1a9['model'],_0x43f1a9[_0x6176('0x2d')]);_0x4cb68b['attributes']=_[_0x6176('0x2f')](_0x43f1a9['model'],qs[_0x6176('0x32')](_0x4a8c85[_0x6176('0x2d')]['fields']));_0x4cb68b['attributes']=_0x4cb68b[_0x6176('0x31')][_0x6176('0x33')]?_0x4cb68b[_0x6176('0x31')]:_0x43f1a9[_0x6176('0x30')];if(_0x4a8c85[_0x6176('0x2d')][_0x6176('0x3c')]){_0x4cb68b[_0x6176('0x43')]=[{'all':!![]}];}_0x4cb68b=_['merge']({},_0x4cb68b,_0x4a8c85[_0x6176('0x3b')]);return db['SmsApplication'][_0x6176('0x44')](_0x4cb68b)['then'](handleEntityNotFound(_0x446fb5,null))[_0x6176('0x24')](respondWithResult(_0x446fb5,null))[_0x6176('0x3f')](handleError(_0x446fb5,null));};exports['create']=function(_0x18d27e,_0x487dd9){return db[_0x6176('0x29')][_0x6176('0x45')](_0x18d27e[_0x6176('0x46')],{})['then'](respondWithResult(_0x487dd9,0xc9))[_0x6176('0x3f')](handleError(_0x487dd9,null));};exports[_0x6176('0x47')]=function(_0xbf4aa7,_0x15a18f){if(_0xbf4aa7['body']['id']){delete _0xbf4aa7[_0x6176('0x46')]['id'];}return db[_0x6176('0x29')][_0x6176('0x44')]({'where':{'id':_0xbf4aa7[_0x6176('0x41')]['id']}})['then'](handleEntityNotFound(_0x15a18f,null))[_0x6176('0x24')](saveUpdates(_0xbf4aa7[_0x6176('0x46')],null))[_0x6176('0x24')](respondWithResult(_0x15a18f,null))[_0x6176('0x3f')](handleError(_0x15a18f,null));};exports[_0x6176('0x48')]=function(_0x183c30,_0x4f1cfc){return db[_0x6176('0x29')]['find']({'where':{'id':_0x183c30['params']['id']}})['then'](handleEntityNotFound(_0x4f1cfc,null))[_0x6176('0x24')](removeEntity(_0x4f1cfc,null))['catch'](handleError(_0x4f1cfc,null));}; \ No newline at end of file +var _0xa85d=['filters','pick','filter','merge','VIRTUAL','options','include','SmsApplication','rows','catch','show','params','intersection','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0xef5c3d,_0x539f9b){var _0x1fa935=function(_0x28073c){while(--_0x28073c){_0xef5c3d['push'](_0xef5c3d['shift']());}};_0x1fa935(++_0x539f9b);}(_0xa85d,0xa8));var _0xda85=function(_0x5266e7,_0x97b16b){_0x5266e7=_0x5266e7-0x0;var _0x5470f1=_0xa85d[_0x5266e7];return _0x5470f1;};'use strict';var emlformat=require(_0xda85('0x0'));var rimraf=require(_0xda85('0x1'));var zipdir=require(_0xda85('0x2'));var jsonpatch=require(_0xda85('0x3'));var rp=require(_0xda85('0x4'));var moment=require('moment');var BPromise=require(_0xda85('0x5'));var Mustache=require(_0xda85('0x6'));var util=require(_0xda85('0x7'));var path=require(_0xda85('0x8'));var sox=require(_0xda85('0x9'));var csv=require('to-csv');var ejs=require(_0xda85('0xa'));var fs=require('fs');var fs_extra=require(_0xda85('0xb'));var _=require(_0xda85('0xc'));var squel=require('squel');var crypto=require(_0xda85('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xda85('0xe'));var toCsv=require(_0xda85('0xf'));var querystring=require(_0xda85('0x10'));var Papa=require(_0xda85('0x11'));var Redis=require(_0xda85('0x12'));var authService=require(_0xda85('0x13'));var qs=require(_0xda85('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda85('0x15'));var logger=require(_0xda85('0x16'))('api');var utils=require(_0xda85('0x17'));var config=require(_0xda85('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xda85('0x19'))['db'];function respondWithStatusCode(_0x400878,_0x5259d2){_0x5259d2=_0x5259d2||0xcc;return function(_0x3ea0a7){if(_0x3ea0a7){return _0x400878['sendStatus'](_0x5259d2);}return _0x400878[_0xda85('0x1a')](_0x5259d2)['end']();};}function respondWithResult(_0x468a16,_0x313896){_0x313896=_0x313896||0xc8;return function(_0x277949){if(_0x277949){return _0x468a16[_0xda85('0x1a')](_0x313896)[_0xda85('0x1b')](_0x277949);}};}function respondWithFilteredResult(_0x4e9cad,_0x453c96){return function(_0x114c2d){if(_0x114c2d){var _0x257fe6=typeof _0x453c96[_0xda85('0x1c')]===_0xda85('0x1d')&&typeof _0x453c96['limit']===_0xda85('0x1d');var _0x47bb7f=_0x114c2d[_0xda85('0x1e')];var _0x5e1754=_0x257fe6?0x0:_0x453c96['offset'];var _0x1b5e1c=_0x257fe6?_0x114c2d[_0xda85('0x1e')]:_0x453c96[_0xda85('0x1c')]+_0x453c96[_0xda85('0x1f')];var _0x5be9dc;if(_0x1b5e1c>=_0x47bb7f){_0x1b5e1c=_0x47bb7f;_0x5be9dc=0xc8;}else{_0x5be9dc=0xce;}_0x4e9cad[_0xda85('0x1a')](_0x5be9dc);return _0x4e9cad[_0xda85('0x20')](_0xda85('0x21'),_0x5e1754+'-'+_0x1b5e1c+'/'+_0x47bb7f)[_0xda85('0x1b')](_0x114c2d);}return null;};}function patchUpdates(_0x278872){return function(_0x52a0d9){try{jsonpatch[_0xda85('0x22')](_0x52a0d9,_0x278872,!![]);}catch(_0xaea941){return BPromise[_0xda85('0x23')](_0xaea941);}return _0x52a0d9[_0xda85('0x24')]();};}function saveUpdates(_0x29c752,_0xd432f1){return function(_0xafe4d8){if(_0xafe4d8){return _0xafe4d8[_0xda85('0x25')](_0x29c752)[_0xda85('0x26')](function(_0x3f744f){return _0x3f744f;});}return null;};}function removeEntity(_0x4210de,_0xe35378){return function(_0x2b234c){if(_0x2b234c){return _0x2b234c[_0xda85('0x27')]()[_0xda85('0x26')](function(){_0x4210de[_0xda85('0x1a')](0xcc)[_0xda85('0x28')]();});}};}function handleEntityNotFound(_0x3fafd2,_0x13bd46){return function(_0x521439){if(!_0x521439){_0x3fafd2[_0xda85('0x29')](0x194);}return _0x521439;};}function handleError(_0x23b392,_0x52d7e7){_0x52d7e7=_0x52d7e7||0x1f4;return function(_0x248a84){logger[_0xda85('0x2a')](_0x248a84['stack']);if(_0x248a84[_0xda85('0x2b')]){delete _0x248a84[_0xda85('0x2b')];}_0x23b392['status'](_0x52d7e7)[_0xda85('0x2c')](_0x248a84);};}exports[_0xda85('0x2d')]=function(_0x28a186,_0xc0a56d){var _0x5dd7a2={},_0x5caff6={},_0x3791b9={'count':0x0,'rows':[]};var _0xdca159=_[_0xda85('0x2e')](db['SmsApplication'][_0xda85('0x2f')],function(_0x42fc05){return{'name':_0x42fc05[_0xda85('0x30')],'type':_0x42fc05[_0xda85('0x31')]['key']};});_0x5caff6['model']=_[_0xda85('0x2e')](_0xdca159,'name');_0x5caff6[_0xda85('0x32')]=_[_0xda85('0x33')](_0x28a186[_0xda85('0x32')]);_0x5caff6['filters']=_['intersection'](_0x5caff6[_0xda85('0x34')],_0x5caff6[_0xda85('0x32')]);_0x5dd7a2[_0xda85('0x35')]=_['intersection'](_0x5caff6[_0xda85('0x34')],qs['fields'](_0x28a186['query'][_0xda85('0x36')]));_0x5dd7a2[_0xda85('0x35')]=_0x5dd7a2[_0xda85('0x35')][_0xda85('0x37')]?_0x5dd7a2[_0xda85('0x35')]:_0x5caff6[_0xda85('0x34')];if(!_0x28a186[_0xda85('0x32')][_0xda85('0x38')](_0xda85('0x39'))){_0x5dd7a2[_0xda85('0x1f')]=qs[_0xda85('0x1f')](_0x28a186[_0xda85('0x32')][_0xda85('0x1f')]);_0x5dd7a2[_0xda85('0x1c')]=qs[_0xda85('0x1c')](_0x28a186[_0xda85('0x32')][_0xda85('0x1c')]);}_0x5dd7a2['order']=qs[_0xda85('0x3a')](_0x28a186[_0xda85('0x32')][_0xda85('0x3a')]);_0x5dd7a2[_0xda85('0x3b')]=qs[_0xda85('0x3c')](_[_0xda85('0x3d')](_0x28a186[_0xda85('0x32')],_0x5caff6[_0xda85('0x3c')]),_0xdca159);if(_0x28a186['query'][_0xda85('0x3e')]){_0x5dd7a2['where']=_[_0xda85('0x3f')](_0x5dd7a2[_0xda85('0x3b')],{'$or':_['map'](_0xdca159,function(_0x17e4aa){if(_0x17e4aa[_0xda85('0x31')]!==_0xda85('0x40')){var _0x58d295={};_0x58d295[_0x17e4aa[_0xda85('0x2b')]]={'$like':'%'+_0x28a186[_0xda85('0x32')][_0xda85('0x3e')]+'%'};return _0x58d295;}})});}_0x5dd7a2=_[_0xda85('0x3f')]({},_0x5dd7a2,_0x28a186[_0xda85('0x41')]);var _0x5d6b63={'where':_0x5dd7a2['where']};return db['SmsApplication'][_0xda85('0x1e')](_0x5d6b63)[_0xda85('0x26')](function(_0x422784){_0x3791b9['count']=_0x422784;if(_0x28a186[_0xda85('0x32')]['includeAll']){_0x5dd7a2[_0xda85('0x42')]=[{'all':!![]}];}return db[_0xda85('0x43')]['findAll'](_0x5dd7a2);})[_0xda85('0x26')](function(_0x2b0585){_0x3791b9[_0xda85('0x44')]=_0x2b0585;return _0x3791b9;})[_0xda85('0x26')](respondWithFilteredResult(_0xc0a56d,_0x5dd7a2))[_0xda85('0x45')](handleError(_0xc0a56d,null));};exports[_0xda85('0x46')]=function(_0x38484b,_0x22b756){var _0x1c6d03={'raw':!![],'where':{'id':_0x38484b[_0xda85('0x47')]['id']}},_0x4e495c={};_0x4e495c['model']=_[_0xda85('0x33')](db['SmsApplication'][_0xda85('0x2f')]);_0x4e495c[_0xda85('0x32')]=_['keys'](_0x38484b[_0xda85('0x32')]);_0x4e495c['filters']=_[_0xda85('0x48')](_0x4e495c[_0xda85('0x34')],_0x4e495c[_0xda85('0x32')]);_0x1c6d03[_0xda85('0x35')]=_[_0xda85('0x48')](_0x4e495c[_0xda85('0x34')],qs[_0xda85('0x36')](_0x38484b['query']['fields']));_0x1c6d03[_0xda85('0x35')]=_0x1c6d03[_0xda85('0x35')]['length']?_0x1c6d03[_0xda85('0x35')]:_0x4e495c[_0xda85('0x34')];if(_0x38484b[_0xda85('0x32')]['includeAll']){_0x1c6d03['include']=[{'all':!![]}];}_0x1c6d03=_[_0xda85('0x3f')]({},_0x1c6d03,_0x38484b[_0xda85('0x41')]);return db['SmsApplication'][_0xda85('0x49')](_0x1c6d03)[_0xda85('0x26')](handleEntityNotFound(_0x22b756,null))[_0xda85('0x26')](respondWithResult(_0x22b756,null))[_0xda85('0x45')](handleError(_0x22b756,null));};exports['create']=function(_0x195fe4,_0x242c03){return db[_0xda85('0x43')][_0xda85('0x4a')](_0x195fe4[_0xda85('0x4b')],{})['then'](respondWithResult(_0x242c03,0xc9))[_0xda85('0x45')](handleError(_0x242c03,null));};exports['update']=function(_0x3aabe1,_0x31eb57){if(_0x3aabe1[_0xda85('0x4b')]['id']){delete _0x3aabe1['body']['id'];}return db[_0xda85('0x43')]['find']({'where':{'id':_0x3aabe1[_0xda85('0x47')]['id']}})['then'](handleEntityNotFound(_0x31eb57,null))[_0xda85('0x26')](saveUpdates(_0x3aabe1['body'],null))[_0xda85('0x26')](respondWithResult(_0x31eb57,null))[_0xda85('0x45')](handleError(_0x31eb57,null));};exports[_0xda85('0x27')]=function(_0x1fa316,_0x4a0f7c){return db[_0xda85('0x43')][_0xda85('0x49')]({'where':{'id':_0x1fa316[_0xda85('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a0f7c,null))[_0xda85('0x26')](removeEntity(_0x4a0f7c,null))[_0xda85('0x45')](handleError(_0x4a0f7c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 5c0f8b2..22e6833 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 _0xe8d3=['api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','sms_applications','utf8mb4','lodash','util'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0xe8d3,0x9a));var _0x3e8d=function(_0x1872c1,_0x325e84){_0x1872c1=_0x1872c1-0x0;var _0x2c40e3=_0xe8d3[_0x1872c1];return _0x2c40e3;};'use strict';var _=require(_0x3e8d('0x0'));var util=require(_0x3e8d('0x1'));var logger=require('../../config/logger')(_0x3e8d('0x2'));var moment=require(_0x3e8d('0x3'));var BPromise=require(_0x3e8d('0x4'));var rp=require(_0x3e8d('0x5'));var fs=require('fs');var path=require(_0x3e8d('0x6'));var rimraf=require(_0x3e8d('0x7'));var config=require('../../config/environment');var attributes=require(_0x3e8d('0x8'));module[_0x3e8d('0x9')]=function(_0x3a2fce,_0xd961b7){return _0x3a2fce[_0x3e8d('0xa')]('SmsApplication',attributes,{'tableName':_0x3e8d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e8d('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2bff=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x11c221,_0x65c6a5){var _0x26deef=function(_0x2fa41a){while(--_0x2fa41a){_0x11c221['push'](_0x11c221['shift']());}};_0x26deef(++_0x65c6a5);}(_0x2bff,0x1b6));var _0xf2bf=function(_0x517667,_0x537ce1){_0x517667=_0x517667-0x0;var _0x5d0c88=_0x2bff[_0x517667];return _0x5d0c88;};'use strict';var _=require(_0xf2bf('0x0'));var util=require(_0xf2bf('0x1'));var logger=require('../../config/logger')(_0xf2bf('0x2'));var moment=require(_0xf2bf('0x3'));var BPromise=require(_0xf2bf('0x4'));var rp=require(_0xf2bf('0x5'));var fs=require('fs');var path=require(_0xf2bf('0x6'));var rimraf=require('rimraf');var config=require(_0xf2bf('0x7'));var attributes=require('./smsApplication.attributes');module[_0xf2bf('0x8')]=function(_0x37b398,_0x51cb1c){return _0x37b398[_0xf2bf('0x9')](_0xf2bf('0xa'),attributes,{'tableName':_0xf2bf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2bf('0xc'),'collate':_0xf2bf('0xd')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index b582bc3..a4a3ca7 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 _0xda81=['then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request'];(function(_0x162167,_0x52203f){var _0x13fda6=function(_0x47848e){while(--_0x47848e){_0x162167['push'](_0x162167['shift']());}};_0x13fda6(++_0x52203f);}(_0xda81,0x1c3));var _0x1da8=function(_0x461675,_0x203a06){_0x461675=_0x461675-0x0;var _0x436eca=_0xda81[_0x461675];return _0x436eca;};'use strict';var _=require(_0x1da8('0x0'));var util=require(_0x1da8('0x1'));var moment=require(_0x1da8('0x2'));var BPromise=require('bluebird');var rs=require(_0x1da8('0x3'));var fs=require('fs');var Redis=require(_0x1da8('0x4'));var db=require(_0x1da8('0x5'))['db'];var utils=require(_0x1da8('0x6'));var logger=require('../../config/logger')(_0x1da8('0x7'));var config=require(_0x1da8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1da8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x891482,_0x2c2bb4,_0xea1eb1){return new BPromise(function(_0x1a3278,_0x11dc1e){return client[_0x1da8('0xa')](_0x891482,_0xea1eb1)[_0x1da8('0xb')](function(_0x17a7fc){logger[_0x1da8('0xc')]('SmsApplication,\x20%s,\x20%s',_0x2c2bb4,_0x1da8('0xd'));logger[_0x1da8('0xe')](_0x1da8('0xf'),_0x2c2bb4,_0x1da8('0xd'),JSON[_0x1da8('0x10')](_0x17a7fc));if(_0x17a7fc['error']){if(_0x17a7fc[_0x1da8('0x11')]['code']===0x1f4){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x11dc1e(_0x17a7fc[_0x1da8('0x11')]['message']);}logger[_0x1da8('0x11')]('SmsApplication,\x20%s,\x20%s',_0x2c2bb4,_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);return _0x1a3278(_0x17a7fc[_0x1da8('0x11')][_0x1da8('0x13')]);}else{logger[_0x1da8('0xc')](_0x1da8('0x12'),_0x2c2bb4,'request\x20sent');_0x1a3278(_0x17a7fc[_0x1da8('0x14')][_0x1da8('0x13')]);}})[_0x1da8('0x15')](function(_0x197b09){logger[_0x1da8('0x11')](_0x1da8('0x12'),_0x2c2bb4,_0x197b09);_0x11dc1e(_0x197b09);});});} \ No newline at end of file +var _0xac41=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x478087,_0x109fb2){var _0x54bff1=function(_0x4589b3){while(--_0x4589b3){_0x478087['push'](_0x478087['shift']());}};_0x54bff1(++_0x109fb2);}(_0xac41,0xdd));var _0x1ac4=function(_0x1f8428,_0x2778d3){_0x1f8428=_0x1f8428-0x0;var _0x6e0f12=_0xac41[_0x1f8428];return _0x6e0f12;};'use strict';var _=require(_0x1ac4('0x0'));var util=require(_0x1ac4('0x1'));var moment=require(_0x1ac4('0x2'));var BPromise=require(_0x1ac4('0x3'));var rs=require(_0x1ac4('0x4'));var fs=require('fs');var Redis=require(_0x1ac4('0x5'));var db=require(_0x1ac4('0x6'))['db'];var utils=require(_0x1ac4('0x7'));var logger=require('../../config/logger')(_0x1ac4('0x8'));var config=require(_0x1ac4('0x9'));var jayson=require(_0x1ac4('0xa'));var client=jayson[_0x1ac4('0xb')][_0x1ac4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ad173,_0x18703d,_0x1c9bed){return new BPromise(function(_0x1c7e79,_0x245861){return client[_0x1ac4('0xd')](_0x2ad173,_0x1c9bed)[_0x1ac4('0xe')](function(_0x454972){logger[_0x1ac4('0xf')](_0x1ac4('0x10'),_0x18703d,_0x1ac4('0x11'));logger['debug'](_0x1ac4('0x12'),_0x18703d,'request\x20sent',JSON[_0x1ac4('0x13')](_0x454972));if(_0x454972[_0x1ac4('0x14')]){if(_0x454972['error'][_0x1ac4('0x15')]===0x1f4){logger[_0x1ac4('0x14')]('SmsApplication,\x20%s,\x20%s',_0x18703d,_0x454972[_0x1ac4('0x14')]['message']);return _0x245861(_0x454972['error']['message']);}logger[_0x1ac4('0x14')](_0x1ac4('0x10'),_0x18703d,_0x454972[_0x1ac4('0x14')][_0x1ac4('0x16')]);return _0x1c7e79(_0x454972[_0x1ac4('0x14')][_0x1ac4('0x16')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x18703d,_0x1ac4('0x11'));_0x1c7e79(_0x454972[_0x1ac4('0x17')][_0x1ac4('0x16')]);}})['catch'](function(_0x477db7){logger[_0x1ac4('0x14')](_0x1ac4('0x10'),_0x18703d,_0x477db7);_0x245861(_0x477db7);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 9751f7e..0135bfe 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 _0x1775=['/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','delete','smsinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1775,0x1db));var _0x5177=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1775[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x5177('0x0'));var path=require(_0x5177('0x1'));var timeout=require(_0x5177('0x2'));var express=require(_0x5177('0x3'));var router=express[_0x5177('0x4')]();var fs_extra=require(_0x5177('0x5'));var auth=require(_0x5177('0x6'));var interaction=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var controller=require(_0x5177('0x9'));router[_0x5177('0xa')]('/',auth[_0x5177('0xb')](),controller[_0x5177('0xc')]);router[_0x5177('0xa')](_0x5177('0xd'),auth[_0x5177('0xb')](),controller[_0x5177('0xe')]);router[_0x5177('0xa')](_0x5177('0xf'),auth[_0x5177('0xb')](),controller[_0x5177('0x10')]);router[_0x5177('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5177('0x11')]);router[_0x5177('0xa')](_0x5177('0x12'),auth[_0x5177('0xb')](),controller[_0x5177('0x13')]);router['post']('/',auth[_0x5177('0xb')](),controller[_0x5177('0x14')]);router[_0x5177('0x15')](_0x5177('0x16'),auth[_0x5177('0xb')](),controller[_0x5177('0x17')]);router[_0x5177('0x15')](_0x5177('0x18'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1b')),controller[_0x5177('0x1c')]);router[_0x5177('0x1d')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')](_0x5177('0x1a'),_0x5177('0x1e')),controller['update']);router[_0x5177('0x1f')](_0x5177('0xf'),auth[_0x5177('0xb')](),interaction[_0x5177('0x19')]('sms',_0x5177('0x20')),controller[_0x5177('0x21')]);router[_0x5177('0x1f')]('/:id/tags',auth[_0x5177('0xb')](),controller['removeTags']);module[_0x5177('0x22')]=router; \ No newline at end of file +var _0x5c00=['smsinteraction:addtags','addTags','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','sms'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x5c00,0x17e));var _0x05c0=function(_0x1f2f61,_0x586f2f){_0x1f2f61=_0x1f2f61-0x0;var _0x10dabc=_0x5c00[_0x1f2f61];return _0x10dabc;};'use strict';var multer=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var path=require(_0x05c0('0x2'));var timeout=require('connect-timeout');var express=require(_0x05c0('0x3'));var router=express['Router']();var fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./smsInteraction.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/describe',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/download',auth[_0x05c0('0x9')](),controller['download']);router[_0x05c0('0xf')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0x10')]);router['post'](_0x05c0('0xd'),auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0xf')](_0x05c0('0x12'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x15')),controller[_0x05c0('0x16')]);router['put'](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction[_0x05c0('0x13')](_0x05c0('0x14'),_0x05c0('0x18')),controller[_0x05c0('0x19')]);router[_0x05c0('0x1a')](_0x05c0('0x17'),auth[_0x05c0('0x9')](),interaction['tracked'](_0x05c0('0x14'),_0x05c0('0x1b')),controller[_0x05c0('0x1c')]);router['delete'](_0x05c0('0x12'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x1d')]);module[_0x05c0('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 6617a0d..f878b01 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 _0x8e0f=['moment','exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x4cafb1,_0x2954df){var _0x5d0869=function(_0x43667a){while(--_0x43667a){_0x4cafb1['push'](_0x4cafb1['shift']());}};_0x5d0869(++_0x2954df);}(_0x8e0f,0x12f));var _0xf8e0=function(_0x5ecb3a,_0xc4eac7){_0x5ecb3a=_0x5ecb3a-0x0;var _0x351a0f=_0x8e0f[_0x5ecb3a];return _0x351a0f;};'use strict';var Sequelize=require(_0xf8e0('0x0'));var moment=require(_0xf8e0('0x1'));module[_0xf8e0('0x2')]={'closed':{'type':Sequelize[_0xf8e0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf8e0('0x4')]},'disposition':{'type':Sequelize[_0xf8e0('0x5')]},'secondDisposition':{'type':Sequelize[_0xf8e0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xf8e0('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf8e0('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf8e0('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf8e0('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xf8e0('0x6')]('in',_0xf8e0('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf8e0('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0048=['STRING','ENUM','out','moment','exports','DATE'];(function(_0x1a9aa5,_0x4cc924){var _0xd29deb=function(_0x19045b){while(--_0x19045b){_0x1a9aa5['push'](_0x1a9aa5['shift']());}};_0xd29deb(++_0x4cc924);}(_0x0048,0x129));var _0x8004=function(_0x472ded,_0x7b9b67){_0x472ded=_0x472ded-0x0;var _0x4cdf81=_0x0048[_0x472ded];return _0x4cdf81;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8004('0x0'));module[_0x8004('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8004('0x2')]},'disposition':{'type':Sequelize[_0x8004('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x8004('0x3')]},'note':{'type':Sequelize[_0x8004('0x3')]},'phone':{'type':Sequelize[_0x8004('0x3')]},'read1stAt':{'type':Sequelize[_0x8004('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8004('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x8004('0x4')]('in',_0x8004('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ad61ed4..1d92e52 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 _0xd363=['then','error','name','send','index','map','SmsInteraction','fieldName','type','key','getOptions','query','show','params','keys','filters','intersection','model','attributes','fields','options','catch','create','body','find','destroy','describe','addMessage','ids','omit','getMessages','SmsMessage','rawAttributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','rows','setTags','spread','Tag','findAll','color','smsInteractionTags:save','removeTags','download','unix','toString','root','files','tmp','join','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','secret','read','push','SmsAccount','Owner','get','Sms','Account','N.A.','closed','disposition','out','direction','value','renderFile','server','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update'];(function(_0x23bf47,_0x4b5d9a){var _0x568e5d=function(_0x9723b4){while(--_0x9723b4){_0x23bf47['push'](_0x23bf47['shift']());}};_0x568e5d(++_0x4b5d9a);}(_0xd363,0xdb));var _0x3d36=function(_0x380168,_0x40546c){_0x380168=_0x380168-0x0;var _0x12e86d=_0xd363[_0x380168];return _0x12e86d;};'use strict';var rimraf=require(_0x3d36('0x0'));var zipdir=require(_0x3d36('0x1'));var moment=require(_0x3d36('0x2'));var BPromise=require(_0x3d36('0x3'));var util=require(_0x3d36('0x4'));var path=require(_0x3d36('0x5'));var ejs=require(_0x3d36('0x6'));var fs=require('fs');var _=require(_0x3d36('0x7'));var Redis=require(_0x3d36('0x8'));var interaction=require(_0x3d36('0x9'));var qs=require('../../components/parsers/qs');var pdf=require(_0x3d36('0xa'));var logger=require(_0x3d36('0xb'))(_0x3d36('0xc'));var config=require('../../config/environment');var db=require(_0x3d36('0xd'))['db'];config[_0x3d36('0xe')]=_[_0x3d36('0xf')](config[_0x3d36('0xe')],{'host':_0x3d36('0x10'),'port':0x18eb});var socket=require(_0x3d36('0x11'))(new Redis(config[_0x3d36('0xe')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x108f14,_0x340e74){_0x340e74=_0x340e74||0xcc;return function(_0x49edde){if(_0x49edde){return _0x108f14[_0x3d36('0x12')](_0x340e74);}return _0x108f14[_0x3d36('0x13')](_0x340e74)[_0x3d36('0x14')]();};}function respondWithResult(_0x518674,_0x5aa76c){_0x5aa76c=_0x5aa76c||0xc8;return function(_0x3a2364){if(_0x3a2364){return _0x518674[_0x3d36('0x13')](_0x5aa76c)[_0x3d36('0x15')](_0x3a2364);}};}function respondWithFilteredResult(_0x3fa61b,_0x570992){return function(_0x4c21ad){if(_0x4c21ad){var _0x5849c3=typeof _0x570992[_0x3d36('0x16')]==='undefined'&&typeof _0x570992[_0x3d36('0x17')]===_0x3d36('0x18');var _0x1c4d76=_0x4c21ad[_0x3d36('0x19')];var _0x2650f4=_0x5849c3?0x0:_0x570992[_0x3d36('0x16')];var _0x3b1709=_0x5849c3?_0x4c21ad['count']:_0x570992['offset']+_0x570992[_0x3d36('0x17')];var _0x13a787;if(_0x3b1709>=_0x1c4d76){_0x3b1709=_0x1c4d76;_0x13a787=0xc8;}else{_0x13a787=0xce;}_0x3fa61b['status'](_0x13a787);return _0x3fa61b[_0x3d36('0x1a')](_0x3d36('0x1b'),_0x2650f4+'-'+_0x3b1709+'/'+_0x1c4d76)[_0x3d36('0x15')](_0x4c21ad);}return null;};}function saveUpdates(_0x376cde){return function(_0x581f11){if(_0x581f11){return _0x581f11[_0x3d36('0x1c')](_0x376cde)[_0x3d36('0x1d')](function(_0x15d939){return _0x15d939;});}return null;};}function removeEntity(_0x506261){return function(_0x37adb4){if(_0x37adb4){return _0x37adb4['destroy']()['then'](function(){_0x506261['status'](0xcc)[_0x3d36('0x14')]();});}};}function handleEntityNotFound(_0x2bf6e2){return function(_0x3addf4){if(!_0x3addf4){_0x2bf6e2[_0x3d36('0x12')](0x194);}return _0x3addf4;};}function handleError(_0x5dee08,_0x107aa6){_0x107aa6=_0x107aa6||0x1f4;return function(_0x561b6c){logger[_0x3d36('0x1e')](_0x561b6c['stack']);if(_0x561b6c[_0x3d36('0x1f')]){delete _0x561b6c['name'];}_0x5dee08[_0x3d36('0x13')](_0x107aa6)[_0x3d36('0x20')](_0x561b6c);};}exports[_0x3d36('0x21')]=function(_0x55e173,_0x3ff06b){var _0x150ba0={};var _0x10ff3c=_[_0x3d36('0x22')](db[_0x3d36('0x23')]['rawAttributes'],function(_0xcb1a5){return{'name':_0xcb1a5[_0x3d36('0x24')],'type':_0xcb1a5[_0x3d36('0x25')][_0x3d36('0x26')]};});_0x150ba0=qs[_0x3d36('0x27')](_0x10ff3c,_0x55e173);return interaction['findAll']('sms',_0x55e173[_0x3d36('0x28')],_0x55e173['user'],_0x150ba0,_0x10ff3c)[_0x3d36('0x1d')](respondWithFilteredResult(_0x3ff06b,_0x150ba0))['catch'](handleError(_0x3ff06b,null));};exports[_0x3d36('0x29')]=function(_0x3f46e5,_0x4e53cf){var _0x37a859={'raw':![],'where':{'id':_0x3f46e5[_0x3d36('0x2a')]['id']}},_0xbe5712={};_0xbe5712['model']=_[_0x3d36('0x2b')](db[_0x3d36('0x23')]['rawAttributes']);_0xbe5712[_0x3d36('0x28')]=_['keys'](_0x3f46e5[_0x3d36('0x28')]);_0xbe5712[_0x3d36('0x2c')]=_[_0x3d36('0x2d')](_0xbe5712[_0x3d36('0x2e')],_0xbe5712['query']);_0x37a859[_0x3d36('0x2f')]=_['intersection'](_0xbe5712[_0x3d36('0x2e')],qs[_0x3d36('0x30')](_0x3f46e5[_0x3d36('0x28')][_0x3d36('0x30')]));_0x37a859[_0x3d36('0x2f')]=_0x37a859['attributes']['length']?_0x37a859[_0x3d36('0x2f')]:_0xbe5712[_0x3d36('0x2e')];if(_0x3f46e5[_0x3d36('0x28')]['includeAll']){_0x37a859['include']=[{'all':!![]}];}_0x37a859=_['merge']({},_0x37a859,_0x3f46e5[_0x3d36('0x31')]);return db[_0x3d36('0x23')]['find'](_0x37a859)[_0x3d36('0x1d')](handleEntityNotFound(_0x4e53cf,null))['then'](respondWithResult(_0x4e53cf,null))[_0x3d36('0x32')](handleError(_0x4e53cf,null));};exports[_0x3d36('0x33')]=function(_0x17f968,_0x5cd440){return db[_0x3d36('0x23')]['create'](_0x17f968[_0x3d36('0x34')],{})[_0x3d36('0x1d')](respondWithResult(_0x5cd440,0xc9))[_0x3d36('0x32')](handleError(_0x5cd440,null));};exports[_0x3d36('0x1c')]=function(_0x36a5b9,_0x226431){if(_0x36a5b9['body']['id']){delete _0x36a5b9['body']['id'];}return db[_0x3d36('0x23')][_0x3d36('0x35')]({'where':{'id':_0x36a5b9[_0x3d36('0x2a')]['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0x226431,null))[_0x3d36('0x1d')](saveUpdates(_0x36a5b9['body'],null))['then'](respondWithResult(_0x226431,null))[_0x3d36('0x32')](handleError(_0x226431,null));};exports[_0x3d36('0x36')]=function(_0x2c2546,_0x36f31a){return db[_0x3d36('0x23')][_0x3d36('0x35')]({'where':{'id':_0x2c2546['params']['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0x36f31a,null))['then'](removeEntity(_0x36f31a,null))['catch'](handleError(_0x36f31a,null));};exports['describe']=function(_0x5b3193,_0x29be92){return db['SmsInteraction'][_0x3d36('0x37')]()[_0x3d36('0x1d')](respondWithResult(_0x29be92,null))['catch'](handleError(_0x29be92,null));};exports[_0x3d36('0x38')]=function(_0x5b93f0,_0x4b6c26){return db['SmsMessage'][_0x3d36('0x35')]({'where':{'id':_0x5b93f0[_0x3d36('0x2a')]['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0x4b6c26,null))[_0x3d36('0x1d')](function(_0x3102bc){if(_0x3102bc){return _0x3102bc['addMessage'](_0x5b93f0[_0x3d36('0x34')][_0x3d36('0x39')],_[_0x3d36('0x3a')](_0x5b93f0[_0x3d36('0x34')],['ids','id'])||{});}})[_0x3d36('0x1d')](respondWithResult(_0x4b6c26,null))['catch'](handleError(_0x4b6c26,null));};exports[_0x3d36('0x3b')]=function(_0x11f872,_0x6dfc62){var _0xe1d90c={'raw':![],'where':{}};var _0x540a7b={};var _0x1affc7={'count':0x0,'rows':[]};return db[_0x3d36('0x23')]['findOne']({'where':{'id':_0x11f872[_0x3d36('0x2a')]['id']}})['then'](handleEntityNotFound(_0x6dfc62,null))['then'](function(_0x5b0292){if(_0x5b0292){_0x540a7b['model']=_[_0x3d36('0x2b')](db[_0x3d36('0x3c')][_0x3d36('0x3d')]);_0x540a7b[_0x3d36('0x28')]=_[_0x3d36('0x2b')](_0x11f872[_0x3d36('0x28')]);_0x540a7b['filters']=_[_0x3d36('0x2d')](_0x540a7b[_0x3d36('0x2e')],_0x540a7b[_0x3d36('0x28')]);_0xe1d90c['attributes']=_[_0x3d36('0x2d')](_0x540a7b['model'],qs['fields'](_0x11f872[_0x3d36('0x28')][_0x3d36('0x30')]));_0xe1d90c[_0x3d36('0x2f')]=_0xe1d90c[_0x3d36('0x2f')][_0x3d36('0x3e')]?_0xe1d90c[_0x3d36('0x2f')]:_0x540a7b[_0x3d36('0x2e')];if(!_0x11f872['query'][_0x3d36('0x3f')](_0x3d36('0x40'))){_0xe1d90c['limit']=qs[_0x3d36('0x17')](_0x11f872[_0x3d36('0x28')][_0x3d36('0x17')]);_0xe1d90c[_0x3d36('0x16')]=qs[_0x3d36('0x16')](_0x11f872[_0x3d36('0x28')][_0x3d36('0x16')]);}_0xe1d90c[_0x3d36('0x41')]=qs[_0x3d36('0x42')](_0x11f872['query'][_0x3d36('0x42')]);_0xe1d90c[_0x3d36('0x43')]=qs[_0x3d36('0x2c')](_[_0x3d36('0x44')](_0x11f872[_0x3d36('0x28')],_0x540a7b[_0x3d36('0x2c')]));_0xe1d90c['where']['SmsInteractionId']=_0x5b0292['id'];if(_0x11f872[_0x3d36('0x28')][_0x3d36('0x45')]){_0xe1d90c['where']=_[_0x3d36('0x46')](_0xe1d90c[_0x3d36('0x43')],{'$or':_[_0x3d36('0x22')](_0xe1d90c[_0x3d36('0x2f')],function(_0x1a1647){var _0x46a848={};_0x46a848[_0x1a1647]={'$like':'%'+_0x11f872[_0x3d36('0x28')]['filter']+'%'};return _0x46a848;})});}if(_0x11f872[_0x3d36('0x28')][_0x3d36('0x47')]){var _0x55cd2d=_0x11f872[_0x3d36('0x28')][_0x3d36('0x47')][_0x3d36('0x48')](',');var _0x1d0ae7={};_0x1d0ae7[_0x55cd2d[0x0]]={'$gte':moment(_0x55cd2d[0x1])[_0x3d36('0x49')](_0x3d36('0x4a'))};_0xe1d90c[_0x3d36('0x43')]=_[_0x3d36('0x46')](_0xe1d90c[_0x3d36('0x43')],_0x1d0ae7);}_0xe1d90c=_[_0x3d36('0x46')]({},_0xe1d90c,_0x11f872[_0x3d36('0x31')]);return db[_0x3d36('0x3c')]['count']({'where':_0xe1d90c[_0x3d36('0x43')]})['then'](function(_0x4d1e4a){_0x1affc7[_0x3d36('0x19')]=_0x4d1e4a;if(_0x11f872[_0x3d36('0x28')][_0x3d36('0x4b')]){_0xe1d90c[_0x3d36('0x4c')]=[{'all':!![]}];}return db[_0x3d36('0x3c')]['findAll'](_0xe1d90c);})[_0x3d36('0x1d')](function(_0x3136d9){_0x1affc7[_0x3d36('0x4d')]=_0x3136d9;return _0x1affc7;});}})[_0x3d36('0x1d')](respondWithFilteredResult(_0x6dfc62,_0xe1d90c))[_0x3d36('0x32')](handleError(_0x6dfc62,null));};exports['addTags']=function(_0x5737b9,_0x5d1046){return db['SmsInteraction']['find']({'where':{'id':_0x5737b9['params']['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0x5d1046,null))[_0x3d36('0x1d')](function(_0x4e506a){if(_0x4e506a){return _0x4e506a[_0x3d36('0x4e')](_0x5737b9['body'][_0x3d36('0x39')],_[_0x3d36('0x3a')](_0x5737b9[_0x3d36('0x34')],[_0x3d36('0x39'),'id'])||{})[_0x3d36('0x4f')](function(){return db[_0x3d36('0x50')][_0x3d36('0x51')]({'attributes':['id',_0x3d36('0x1f'),_0x3d36('0x52')],'where':{'id':_0x5737b9[_0x3d36('0x34')][_0x3d36('0x39')]}});})[_0x3d36('0x1d')](function(_0xccc5d0){socket['emit'](_0x3d36('0x53'),{'id':Number(_0x5737b9[_0x3d36('0x2a')]['id']),'tags':_0xccc5d0||[]});return{'id':Number(_0x5737b9[_0x3d36('0x2a')]['id']),'tags':_0xccc5d0||[]};});}})[_0x3d36('0x1d')](respondWithResult(_0x5d1046,null))[_0x3d36('0x32')](handleError(_0x5d1046,null));};exports[_0x3d36('0x54')]=function(_0x10e9a0,_0xf1387c){return db['SmsInteraction']['find']({'where':{'id':_0x10e9a0[_0x3d36('0x2a')]['id']}})[_0x3d36('0x1d')](handleEntityNotFound(_0xf1387c,null))[_0x3d36('0x1d')](function(_0x3877a4){if(_0x3877a4){return _0x3877a4[_0x3d36('0x54')](_0x10e9a0['query']['ids']);}})[_0x3d36('0x1d')](respondWithStatusCode(_0xf1387c,null))[_0x3d36('0x32')](handleError(_0xf1387c,null));};exports[_0x3d36('0x55')]=function(_0xefa4c6,_0x3e5e88){var _0x36c2ab=moment()[_0x3d36('0x56')]()[_0x3d36('0x57')]();var _0x44f350=path['join'](config[_0x3d36('0x58')],'server',_0x3d36('0x59'),_0x3d36('0x5a'));var _0x3aecad=path[_0x3d36('0x5b')](_0x44f350,_0x36c2ab);var _0x537a49=util['format'](_0x3d36('0x5c'),_0xefa4c6['params']['id'],_0x36c2ab);var _0x20299d=path['join'](_0x44f350,_0x537a49);var _0x4e810d=[];_0x4e810d['push']({'model':db[_0x3d36('0x5d')],'as':_0x3d36('0x5d'),'attributes':['id',_0x3d36('0x5e')],'raw':!![]});_0x4e810d['push']({'model':db[_0x3d36('0x5f')],'as':_0x3d36('0x60'),'attributes':['id',_0x3d36('0x61'),_0x3d36('0x62')],'raw':!![]});var _0x215b4f=[{'model':db[_0x3d36('0x3c')],'as':_0x3d36('0x63'),'attributes':['id',_0x3d36('0x34'),_0x3d36('0x64'),'direction',_0x3d36('0x65'),_0x3d36('0x66')],'include':_0x4e810d}];_0x215b4f[_0x3d36('0x67')]({'model':db[_0x3d36('0x68')],'as':'Account','attributes':['id',_0x3d36('0x1f')]});_0x215b4f[_0x3d36('0x67')]({'model':db['User'],'as':_0x3d36('0x69'),'attributes':['id',_0x3d36('0x5e')]});return db['SmsInteraction'][_0x3d36('0x35')]({'where':{'id':_0xefa4c6['params']['id']},'include':_0x215b4f})[_0x3d36('0x1d')](handleEntityNotFound(_0x3e5e88,null))[_0x3d36('0x1d')](function(_0x23fc66){if(_0x23fc66){var _0x517818=_0x23fc66[_0x3d36('0x6a')]({'plain':!![]});fs['mkdirSync'](_0x3aecad);var _0x3da5a5={'channel':_0x3d36('0x6b'),'account':_0x517818[_0x3d36('0x6c')][_0x3d36('0x1f')],'agent':_0x517818['Owner']?_0x517818[_0x3d36('0x69')][_0x3d36('0x5e')]:_0x3d36('0x6d'),'createdAt':moment(_0x517818[_0x3d36('0x64')])[_0x3d36('0x49')](_0x3d36('0x4a'))[_0x3d36('0x57')](),'closedAt':_0x517818[_0x3d36('0x6e')]?moment(_0x517818['closedAt'])[_0x3d36('0x49')](_0x3d36('0x4a'))['toString']():'','disposition':_0x517818[_0x3d36('0x6f')],'messages':_(_0x517818[_0x3d36('0x63')])[_0x3d36('0x45')]({'secret':![]})[_0x3d36('0x22')](function(_0x525da9){return{'date':moment(_0x525da9[_0x3d36('0x64')])[_0x3d36('0x49')](_0x3d36('0x4a'))[_0x3d36('0x57')](),'sender':_0x525da9['direction']===_0x3d36('0x70')?_0x525da9['User']?_0x525da9[_0x3d36('0x5d')][_0x3d36('0x5e')]:'System':_0x525da9[_0x3d36('0x60')]['firstName']+(_0x525da9[_0x3d36('0x60')][_0x3d36('0x62')]?'\x20'+_0x525da9[_0x3d36('0x60')]['lastName']:''),'body':_0x525da9[_0x3d36('0x34')],'direction':_0x525da9[_0x3d36('0x71')]===_0x3d36('0x70')?'A':'C','secret':_0x525da9['secret'],'read':_0x525da9[_0x3d36('0x66')]};})[_0x3d36('0x72')]()};return ejs[_0x3d36('0x73')](path[_0x3d36('0x5b')](config[_0x3d36('0x58')],_0x3d36('0x74'),_0x3d36('0x75'),_0x3d36('0x76')),{'interaction':_0x3da5a5})['then'](function(_0x13cce3){var _0x54e2e3=path[_0x3d36('0x5b')](_0x3aecad,_0x3d36('0x77')+_0x517818['id']+'-'+_0x36c2ab+_0x3d36('0x78'));var _0x20c542={'path':_0x54e2e3,'channel':'Sms','interactionId':_0x517818['id']};return pdf[_0x3d36('0x79')](_0x13cce3,_0x20c542);})[_0x3d36('0x1d')](function(){return new BPromise(function(_0x2e07a5,_0x24ebd0){zipdir(_0x3aecad,{'saveTo':_0x20299d},function(_0x486d39,_0x42da7f){if(_0x486d39)return _0x24ebd0(_0x486d39);return _0x2e07a5(_0x42da7f);});})[_0x3d36('0x1d')](function(){return new BPromise(function(_0x30bff8,_0x2dcf51){rimraf(_0x3aecad,function(_0x1144d5){if(_0x1144d5)_0x2dcf51(_0x1144d5);return _0x30bff8();});});})[_0x3d36('0x1d')](function(){return _0x3e5e88[_0x3d36('0x55')](_0x20299d,_0x537a49,function(_0x5d884e){if(_0x5d884e){console[_0x3d36('0x7a')]('err',_0x5d884e);}else{fs[_0x3d36('0x7b')](_0x20299d);}});});});}else{return _0x3e5e88[_0x3d36('0x12')](0xc8);}})[_0x3d36('0x32')](handleError(_0x3e5e88,null));}; \ No newline at end of file +var _0x6764=['register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','index','SmsInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','sms','user','catch','show','params','keys','query','filters','intersection','model','attributes','fields','length','includeAll','merge','options','find','create','body','destroy','describe','addMessage','SmsMessage','ids','findOne','hasOwnProperty','nolimit','order','sort','where','pick','SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','omit','spread','Tag','name','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Messages','direction','read','SmsAccount','Owner','mkdirSync','Sms','Account','N.A.','createdAt','toString','disposition','map','System','Contact','out','secret','renderFile','root','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','moment','util','path','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket'];(function(_0x44b8ba,_0x44d3ba){var _0x13e22b=function(_0x3d7b07){while(--_0x3d7b07){_0x44b8ba['push'](_0x44b8ba['shift']());}};_0x13e22b(++_0x44d3ba);}(_0x6764,0x1dc));var _0x4676=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x6764[_0x1035c1];return _0x308d67;};'use strict';var rimraf=require(_0x4676('0x0'));var zipdir=require(_0x4676('0x1'));var moment=require(_0x4676('0x2'));var BPromise=require('bluebird');var util=require(_0x4676('0x3'));var path=require(_0x4676('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x4676('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x4676('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x4676('0x7'))(_0x4676('0x8'));var config=require(_0x4676('0x9'));var db=require(_0x4676('0xa'))['db'];config[_0x4676('0xb')]=_[_0x4676('0xc')](config[_0x4676('0xb')],{'host':_0x4676('0xd'),'port':0x18eb});var socket=require(_0x4676('0xe'))(new Redis(config['redis']));require(_0x4676('0xf'))[_0x4676('0x10')](socket);function respondWithStatusCode(_0x163e34,_0x3edd3c){_0x3edd3c=_0x3edd3c||0xcc;return function(_0x54d7e3){if(_0x54d7e3){return _0x163e34[_0x4676('0x11')](_0x3edd3c);}return _0x163e34[_0x4676('0x12')](_0x3edd3c)[_0x4676('0x13')]();};}function respondWithResult(_0x121f1d,_0x49992b){_0x49992b=_0x49992b||0xc8;return function(_0x53cdaa){if(_0x53cdaa){return _0x121f1d[_0x4676('0x12')](_0x49992b)[_0x4676('0x14')](_0x53cdaa);}};}function respondWithFilteredResult(_0xd454af,_0x46d3cd){return function(_0x59e141){if(_0x59e141){var _0x574c2c=typeof _0x46d3cd[_0x4676('0x15')]===_0x4676('0x16')&&typeof _0x46d3cd[_0x4676('0x17')]==='undefined';var _0x5dc096=_0x59e141[_0x4676('0x18')];var _0x18faa7=_0x574c2c?0x0:_0x46d3cd[_0x4676('0x15')];var _0x2ad23d=_0x574c2c?_0x59e141[_0x4676('0x18')]:_0x46d3cd['offset']+_0x46d3cd['limit'];var _0x28c708;if(_0x2ad23d>=_0x5dc096){_0x2ad23d=_0x5dc096;_0x28c708=0xc8;}else{_0x28c708=0xce;}_0xd454af[_0x4676('0x12')](_0x28c708);return _0xd454af[_0x4676('0x19')](_0x4676('0x1a'),_0x18faa7+'-'+_0x2ad23d+'/'+_0x5dc096)['json'](_0x59e141);}return null;};}function saveUpdates(_0x558c65){return function(_0x184a16){if(_0x184a16){return _0x184a16[_0x4676('0x1b')](_0x558c65)[_0x4676('0x1c')](function(_0x41ddab){return _0x41ddab;});}return null;};}function removeEntity(_0x71ea65){return function(_0x141af2){if(_0x141af2){return _0x141af2['destroy']()[_0x4676('0x1c')](function(){_0x71ea65[_0x4676('0x12')](0xcc)[_0x4676('0x13')]();});}};}function handleEntityNotFound(_0xb2125){return function(_0x3e5d37){if(!_0x3e5d37){_0xb2125[_0x4676('0x11')](0x194);}return _0x3e5d37;};}function handleError(_0x2238bd,_0x82261b){_0x82261b=_0x82261b||0x1f4;return function(_0x22b158){logger[_0x4676('0x1d')](_0x22b158[_0x4676('0x1e')]);if(_0x22b158['name']){delete _0x22b158['name'];}_0x2238bd[_0x4676('0x12')](_0x82261b)['send'](_0x22b158);};}exports[_0x4676('0x1f')]=function(_0x46c28c,_0x33e106){var _0x7c2228={};var _0x8ebd4c=_['map'](db[_0x4676('0x20')][_0x4676('0x21')],function(_0x1ac6fd){return{'name':_0x1ac6fd[_0x4676('0x22')],'type':_0x1ac6fd[_0x4676('0x23')][_0x4676('0x24')]};});_0x7c2228=qs[_0x4676('0x25')](_0x8ebd4c,_0x46c28c);return interaction[_0x4676('0x26')](_0x4676('0x27'),_0x46c28c['query'],_0x46c28c[_0x4676('0x28')],_0x7c2228,_0x8ebd4c)[_0x4676('0x1c')](respondWithFilteredResult(_0x33e106,_0x7c2228))[_0x4676('0x29')](handleError(_0x33e106,null));};exports[_0x4676('0x2a')]=function(_0x32beea,_0x19a47c){var _0x3cf572={'raw':![],'where':{'id':_0x32beea[_0x4676('0x2b')]['id']}},_0x1f763f={};_0x1f763f['model']=_[_0x4676('0x2c')](db[_0x4676('0x20')][_0x4676('0x21')]);_0x1f763f[_0x4676('0x2d')]=_[_0x4676('0x2c')](_0x32beea[_0x4676('0x2d')]);_0x1f763f[_0x4676('0x2e')]=_[_0x4676('0x2f')](_0x1f763f[_0x4676('0x30')],_0x1f763f[_0x4676('0x2d')]);_0x3cf572[_0x4676('0x31')]=_[_0x4676('0x2f')](_0x1f763f[_0x4676('0x30')],qs[_0x4676('0x32')](_0x32beea['query'][_0x4676('0x32')]));_0x3cf572['attributes']=_0x3cf572[_0x4676('0x31')][_0x4676('0x33')]?_0x3cf572[_0x4676('0x31')]:_0x1f763f['model'];if(_0x32beea['query'][_0x4676('0x34')]){_0x3cf572['include']=[{'all':!![]}];}_0x3cf572=_[_0x4676('0x35')]({},_0x3cf572,_0x32beea[_0x4676('0x36')]);return db[_0x4676('0x20')][_0x4676('0x37')](_0x3cf572)[_0x4676('0x1c')](handleEntityNotFound(_0x19a47c,null))[_0x4676('0x1c')](respondWithResult(_0x19a47c,null))[_0x4676('0x29')](handleError(_0x19a47c,null));};exports[_0x4676('0x38')]=function(_0xcd9374,_0x87818c){return db[_0x4676('0x20')][_0x4676('0x38')](_0xcd9374[_0x4676('0x39')],{})[_0x4676('0x1c')](respondWithResult(_0x87818c,0xc9))[_0x4676('0x29')](handleError(_0x87818c,null));};exports[_0x4676('0x1b')]=function(_0x27e933,_0x6a4321){if(_0x27e933[_0x4676('0x39')]['id']){delete _0x27e933['body']['id'];}return db[_0x4676('0x20')]['find']({'where':{'id':_0x27e933[_0x4676('0x2b')]['id']}})['then'](handleEntityNotFound(_0x6a4321,null))[_0x4676('0x1c')](saveUpdates(_0x27e933[_0x4676('0x39')],null))[_0x4676('0x1c')](respondWithResult(_0x6a4321,null))[_0x4676('0x29')](handleError(_0x6a4321,null));};exports[_0x4676('0x3a')]=function(_0x1da375,_0x33312e){return db[_0x4676('0x20')][_0x4676('0x37')]({'where':{'id':_0x1da375[_0x4676('0x2b')]['id']}})[_0x4676('0x1c')](handleEntityNotFound(_0x33312e,null))[_0x4676('0x1c')](removeEntity(_0x33312e,null))[_0x4676('0x29')](handleError(_0x33312e,null));};exports[_0x4676('0x3b')]=function(_0x461d62,_0x30b109){return db[_0x4676('0x20')][_0x4676('0x3b')]()['then'](respondWithResult(_0x30b109,null))[_0x4676('0x29')](handleError(_0x30b109,null));};exports[_0x4676('0x3c')]=function(_0x35ad09,_0x500006){return db[_0x4676('0x3d')][_0x4676('0x37')]({'where':{'id':_0x35ad09['params']['id']}})[_0x4676('0x1c')](handleEntityNotFound(_0x500006,null))['then'](function(_0x1cafbb){if(_0x1cafbb){return _0x1cafbb[_0x4676('0x3c')](_0x35ad09['body'][_0x4676('0x3e')],_['omit'](_0x35ad09[_0x4676('0x39')],[_0x4676('0x3e'),'id'])||{});}})[_0x4676('0x1c')](respondWithResult(_0x500006,null))[_0x4676('0x29')](handleError(_0x500006,null));};exports['getMessages']=function(_0x11fec4,_0x208f3d){var _0x39383a={'raw':![],'where':{}};var _0x553b53={};var _0x51fcaa={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x4676('0x3f')]({'where':{'id':_0x11fec4[_0x4676('0x2b')]['id']}})[_0x4676('0x1c')](handleEntityNotFound(_0x208f3d,null))[_0x4676('0x1c')](function(_0x520e78){if(_0x520e78){_0x553b53['model']=_[_0x4676('0x2c')](db['SmsMessage']['rawAttributes']);_0x553b53['query']=_[_0x4676('0x2c')](_0x11fec4[_0x4676('0x2d')]);_0x553b53[_0x4676('0x2e')]=_['intersection'](_0x553b53['model'],_0x553b53[_0x4676('0x2d')]);_0x39383a[_0x4676('0x31')]=_[_0x4676('0x2f')](_0x553b53[_0x4676('0x30')],qs[_0x4676('0x32')](_0x11fec4[_0x4676('0x2d')][_0x4676('0x32')]));_0x39383a[_0x4676('0x31')]=_0x39383a[_0x4676('0x31')][_0x4676('0x33')]?_0x39383a[_0x4676('0x31')]:_0x553b53[_0x4676('0x30')];if(!_0x11fec4[_0x4676('0x2d')][_0x4676('0x40')](_0x4676('0x41'))){_0x39383a[_0x4676('0x17')]=qs[_0x4676('0x17')](_0x11fec4[_0x4676('0x2d')][_0x4676('0x17')]);_0x39383a[_0x4676('0x15')]=qs[_0x4676('0x15')](_0x11fec4[_0x4676('0x2d')][_0x4676('0x15')]);}_0x39383a[_0x4676('0x42')]=qs[_0x4676('0x43')](_0x11fec4[_0x4676('0x2d')]['sort']);_0x39383a[_0x4676('0x44')]=qs[_0x4676('0x2e')](_[_0x4676('0x45')](_0x11fec4[_0x4676('0x2d')],_0x553b53['filters']));_0x39383a[_0x4676('0x44')][_0x4676('0x46')]=_0x520e78['id'];if(_0x11fec4[_0x4676('0x2d')][_0x4676('0x47')]){_0x39383a['where']=_[_0x4676('0x35')](_0x39383a[_0x4676('0x44')],{'$or':_['map'](_0x39383a[_0x4676('0x31')],function(_0x589d53){var _0x5ed1e4={};_0x5ed1e4[_0x589d53]={'$like':'%'+_0x11fec4['query']['filter']+'%'};return _0x5ed1e4;})});}if(_0x11fec4['query'][_0x4676('0x48')]){var _0x1562f7=_0x11fec4[_0x4676('0x2d')]['$gte']['split'](',');var _0x360d5f={};_0x360d5f[_0x1562f7[0x0]]={'$gte':moment(_0x1562f7[0x1])[_0x4676('0x49')](_0x4676('0x4a'))};_0x39383a[_0x4676('0x44')]=_[_0x4676('0x35')](_0x39383a['where'],_0x360d5f);}_0x39383a=_[_0x4676('0x35')]({},_0x39383a,_0x11fec4['options']);return db['SmsMessage'][_0x4676('0x18')]({'where':_0x39383a[_0x4676('0x44')]})[_0x4676('0x1c')](function(_0x50ffb3){_0x51fcaa[_0x4676('0x18')]=_0x50ffb3;if(_0x11fec4['query'][_0x4676('0x34')]){_0x39383a['include']=[{'all':!![]}];}return db['SmsMessage'][_0x4676('0x26')](_0x39383a);})[_0x4676('0x1c')](function(_0x5f492d){_0x51fcaa[_0x4676('0x4b')]=_0x5f492d;return _0x51fcaa;});}})[_0x4676('0x1c')](respondWithFilteredResult(_0x208f3d,_0x39383a))[_0x4676('0x29')](handleError(_0x208f3d,null));};exports[_0x4676('0x4c')]=function(_0x1573d9,_0x515b1f){return db[_0x4676('0x20')][_0x4676('0x37')]({'where':{'id':_0x1573d9[_0x4676('0x2b')]['id']}})[_0x4676('0x1c')](handleEntityNotFound(_0x515b1f,null))['then'](function(_0x2db6f0){if(_0x2db6f0){return _0x2db6f0['setTags'](_0x1573d9[_0x4676('0x39')][_0x4676('0x3e')],_[_0x4676('0x4d')](_0x1573d9[_0x4676('0x39')],[_0x4676('0x3e'),'id'])||{})[_0x4676('0x4e')](function(){return db[_0x4676('0x4f')][_0x4676('0x26')]({'attributes':['id',_0x4676('0x50'),'color'],'where':{'id':_0x1573d9[_0x4676('0x39')]['ids']}});})[_0x4676('0x1c')](function(_0x4365dd){socket[_0x4676('0x51')](_0x4676('0x52'),{'id':Number(_0x1573d9[_0x4676('0x2b')]['id']),'tags':_0x4365dd||[]});return{'id':Number(_0x1573d9[_0x4676('0x2b')]['id']),'tags':_0x4365dd||[]};});}})[_0x4676('0x1c')](respondWithResult(_0x515b1f,null))[_0x4676('0x29')](handleError(_0x515b1f,null));};exports[_0x4676('0x53')]=function(_0xf59d9,_0x50cbfd){return db[_0x4676('0x20')][_0x4676('0x37')]({'where':{'id':_0xf59d9[_0x4676('0x2b')]['id']}})[_0x4676('0x1c')](handleEntityNotFound(_0x50cbfd,null))[_0x4676('0x1c')](function(_0x59f49f){if(_0x59f49f){return _0x59f49f['removeTags'](_0xf59d9[_0x4676('0x2d')]['ids']);}})['then'](respondWithStatusCode(_0x50cbfd,null))[_0x4676('0x29')](handleError(_0x50cbfd,null));};exports[_0x4676('0x54')]=function(_0x4ae3b4,_0x33d108){var _0xb7176b=moment()[_0x4676('0x55')]()['toString']();var _0x3051d0=path[_0x4676('0x56')](config['root'],_0x4676('0x57'),_0x4676('0x58'),_0x4676('0x59'));var _0x21fb8=path[_0x4676('0x56')](_0x3051d0,_0xb7176b);var _0x180f6c=util[_0x4676('0x49')](_0x4676('0x5a'),_0x4ae3b4[_0x4676('0x2b')]['id'],_0xb7176b);var _0x10abe6=path[_0x4676('0x56')](_0x3051d0,_0x180f6c);var _0x4564cf=[];_0x4564cf[_0x4676('0x5b')]({'model':db[_0x4676('0x5c')],'as':_0x4676('0x5c'),'attributes':['id',_0x4676('0x5d')],'raw':!![]});_0x4564cf[_0x4676('0x5b')]({'model':db[_0x4676('0x5e')],'as':'Contact','attributes':['id',_0x4676('0x5f'),_0x4676('0x60')],'raw':!![]});var _0x4f91e4=[{'model':db[_0x4676('0x3d')],'as':_0x4676('0x61'),'attributes':['id',_0x4676('0x39'),'createdAt',_0x4676('0x62'),'secret',_0x4676('0x63')],'include':_0x4564cf}];_0x4f91e4[_0x4676('0x5b')]({'model':db[_0x4676('0x64')],'as':'Account','attributes':['id',_0x4676('0x50')]});_0x4f91e4['push']({'model':db['User'],'as':_0x4676('0x65'),'attributes':['id',_0x4676('0x5d')]});return db[_0x4676('0x20')][_0x4676('0x37')]({'where':{'id':_0x4ae3b4[_0x4676('0x2b')]['id']},'include':_0x4f91e4})['then'](handleEntityNotFound(_0x33d108,null))['then'](function(_0x3a4f56){if(_0x3a4f56){var _0x2ffce6=_0x3a4f56['get']({'plain':!![]});fs[_0x4676('0x66')](_0x21fb8);var _0x5a1fc3={'channel':_0x4676('0x67'),'account':_0x2ffce6[_0x4676('0x68')]['name'],'agent':_0x2ffce6['Owner']?_0x2ffce6[_0x4676('0x65')][_0x4676('0x5d')]:_0x4676('0x69'),'createdAt':moment(_0x2ffce6[_0x4676('0x6a')])[_0x4676('0x49')](_0x4676('0x4a'))[_0x4676('0x6b')](),'closedAt':_0x2ffce6['closed']?moment(_0x2ffce6['closedAt'])['format'](_0x4676('0x4a'))['toString']():'','disposition':_0x2ffce6[_0x4676('0x6c')],'messages':_(_0x2ffce6[_0x4676('0x61')])[_0x4676('0x47')]({'secret':![]})[_0x4676('0x6d')](function(_0x6f1bd2){return{'date':moment(_0x6f1bd2[_0x4676('0x6a')])[_0x4676('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4676('0x6b')](),'sender':_0x6f1bd2[_0x4676('0x62')]==='out'?_0x6f1bd2[_0x4676('0x5c')]?_0x6f1bd2[_0x4676('0x5c')][_0x4676('0x5d')]:_0x4676('0x6e'):_0x6f1bd2['Contact'][_0x4676('0x5f')]+(_0x6f1bd2['Contact'][_0x4676('0x60')]?'\x20'+_0x6f1bd2[_0x4676('0x6f')]['lastName']:''),'body':_0x6f1bd2[_0x4676('0x39')],'direction':_0x6f1bd2[_0x4676('0x62')]===_0x4676('0x70')?'A':'C','secret':_0x6f1bd2[_0x4676('0x71')],'read':_0x6f1bd2[_0x4676('0x63')]};})['value']()};return ejs[_0x4676('0x72')](path[_0x4676('0x56')](config[_0x4676('0x73')],_0x4676('0x57'),'views',_0x4676('0x74')),{'interaction':_0x5a1fc3})['then'](function(_0x2dcaec){var _0x1f0a73=path[_0x4676('0x56')](_0x21fb8,_0x4676('0x75')+_0x2ffce6['id']+'-'+_0xb7176b+_0x4676('0x76'));var _0x400749={'path':_0x1f0a73,'channel':_0x4676('0x67'),'interactionId':_0x2ffce6['id']};return pdf[_0x4676('0x77')](_0x2dcaec,_0x400749);})[_0x4676('0x1c')](function(){return new BPromise(function(_0x3e5a22,_0x15a9d4){zipdir(_0x21fb8,{'saveTo':_0x10abe6},function(_0x59f69f,_0x5f1f86){if(_0x59f69f)return _0x15a9d4(_0x59f69f);return _0x3e5a22(_0x5f1f86);});})['then'](function(){return new BPromise(function(_0x3b1937,_0x15dc3f){rimraf(_0x21fb8,function(_0x20d42a){if(_0x20d42a)_0x15dc3f(_0x20d42a);return _0x3b1937();});});})[_0x4676('0x1c')](function(){return _0x33d108[_0x4676('0x54')](_0x10abe6,_0x180f6c,function(_0x34e7e8){if(_0x34e7e8){console[_0x4676('0x78')](_0x4676('0x79'),_0x34e7e8);}else{fs[_0x4676('0x7a')](_0x10abe6);}});});});}else{return _0x33d108[_0x4676('0x11')](0xc8);}})[_0x4676('0x29')](handleError(_0x33d108,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 2a7dc58..16836c3 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 _0xd914=['length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages'];(function(_0x2af2f1,_0x367db3){var _0x7677fc=function(_0x8367e9){while(--_0x8367e9){_0x2af2f1['push'](_0x2af2f1['shift']());}};_0x7677fc(++_0x367db3);}(_0xd914,0x17f));var _0x4d91=function(_0x3f8a03,_0x319b9c){_0x3f8a03=_0x3f8a03-0x0;var _0x147fb2=_0xd914[_0x3f8a03];return _0x147fb2;};'use strict';var EventEmitter=require(_0x4d91('0x0'));var SmsInteraction=require(_0x4d91('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4d91('0x1'))['db'][_0x4d91('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4d91('0x3')](0x0);var events={'afterCreate':_0x4d91('0x4'),'afterUpdate':_0x4d91('0x5'),'afterDestroy':_0x4d91('0x6')};function emitEvent(_0x4875a2){return function(_0x1b256e,_0x5d8af4,_0x3ab6f8){_0x1b256e[_0x4d91('0x7')]({'attributes':['id'],'raw':!![]})[_0x4d91('0x8')](function(_0x27c0d5){_0x1b256e[_0x4d91('0x9')](_0x4d91('0xa'),_0x27c0d5[_0x4d91('0xb')](function(_0x2a3ca1){return{'id':_0x2a3ca1['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x1b256e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4d91('0x8')](function(_0xa4bb25){_0x1b256e[_0x4d91('0x9')](_0x4d91('0xc'),_0xa4bb25[_0x4d91('0xd')]);SmsInteractionEvents[_0x4d91('0xe')](_0x4875a2+':'+_0x1b256e['id'],_0x1b256e);SmsInteractionEvents['emit'](_0x4875a2,_0x1b256e);_0x3ab6f8(null);})['catch'](_0x3ab6f8(null));};}for(var e in events){if(events[_0x4d91('0xf')](e)){var event=events[e];SmsInteraction[_0x4d91('0x10')](e,emitEvent(event));}}module[_0x4d91('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x351d=['length','emit','catch','hook','events','SmsInteraction','../../mysqldb','SmsMessage','save','remove','getUsers','setDataValue','map','unreadMessages'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x351d,0x90));var _0xd351=function(_0x1619e3,_0x917165){_0x1619e3=_0x1619e3-0x0;var _0x4796d4=_0x351d[_0x1619e3];return _0x4796d4;};'use strict';var EventEmitter=require(_0xd351('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xd351('0x1')];var SmsMessage=require(_0xd351('0x2'))['db'][_0xd351('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd351('0x4'),'afterUpdate':'update','afterDestroy':_0xd351('0x5')};function emitEvent(_0x151391){return function(_0x49610f,_0x1cd581,_0x45e9e5){_0x49610f[_0xd351('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x16b3f7){_0x49610f[_0xd351('0x7')]('Users',_0x16b3f7[_0xd351('0x8')](function(_0xb4f580){return{'id':_0xb4f580['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x49610f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x44bf81){_0x49610f['setDataValue'](_0xd351('0x9'),_0x44bf81[_0xd351('0xa')]);SmsInteractionEvents['emit'](_0x151391+':'+_0x49610f['id'],_0x49610f);SmsInteractionEvents[_0xd351('0xb')](_0x151391,_0x49610f);_0x45e9e5(null);})[_0xd351('0xc')](_0x45e9e5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xd351('0xd')](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 772dbfb..e5361bf 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 _0xef99=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x47d841,_0x36ad89){var _0x13348a=function(_0x25ba88){while(--_0x25ba88){_0x47d841['push'](_0x47d841['shift']());}};_0x13348a(++_0x36ad89);}(_0xef99,0xd1));var _0x9ef9=function(_0x3eaa48,_0x5d3e94){_0x3eaa48=_0x3eaa48-0x0;var _0x1a9ab5=_0xef99[_0x3eaa48];return _0x1a9ab5;};'use strict';var _=require(_0x9ef9('0x0'));var util=require(_0x9ef9('0x1'));var logger=require(_0x9ef9('0x2'))(_0x9ef9('0x3'));var moment=require(_0x9ef9('0x4'));var BPromise=require(_0x9ef9('0x5'));var rp=require(_0x9ef9('0x6'));var fs=require('fs');var path=require(_0x9ef9('0x7'));var rimraf=require(_0x9ef9('0x8'));var config=require(_0x9ef9('0x9'));var attributes=require(_0x9ef9('0xa'));module[_0x9ef9('0xb')]=function(_0x504719,_0x54e9e6){return _0x504719[_0x9ef9('0xc')](_0x9ef9('0xd'),attributes,{'tableName':_0x9ef9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2dd721,_0x47b5c5,_0x4fa033){if(_0x2dd721[_0x9ef9('0xf')](_0x9ef9('0x10'))){_0x2dd721[_0x9ef9('0x11')]=moment()['format'](_0x9ef9('0x12'));}_0x4fa033(null,_0x2dd721);}}});}; \ No newline at end of file +var _0x5a11=['SmsInteraction','closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./smsInteraction.attributes','exports','define'];(function(_0x543064,_0x202f8b){var _0xe676be=function(_0x297c34){while(--_0x297c34){_0x543064['push'](_0x543064['shift']());}};_0xe676be(++_0x202f8b);}(_0x5a11,0xc6));var _0x15a1=function(_0x156e46,_0x212834){_0x156e46=_0x156e46-0x0;var _0x463630=_0x5a11[_0x156e46];return _0x463630;};'use strict';var _=require(_0x15a1('0x0'));var util=require(_0x15a1('0x1'));var logger=require(_0x15a1('0x2'))(_0x15a1('0x3'));var moment=require(_0x15a1('0x4'));var BPromise=require(_0x15a1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15a1('0x6'));var attributes=require(_0x15a1('0x7'));module[_0x15a1('0x8')]=function(_0x5b6af6,_0x117695){return _0x5b6af6[_0x15a1('0x9')](_0x15a1('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x157f25,_0x412a73,_0x2e2916){if(_0x157f25['changed']('closed')){_0x157f25[_0x15a1('0xb')]=moment()[_0x15a1('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2e2916(null,_0x157f25);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 50b7696..3983f88 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 _0xd9f6=['request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','attributes','limit','then','stringify','find','addTags','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','info'];(function(_0x507c64,_0x5c7b96){var _0x2d83e1=function(_0xeec886){while(--_0xeec886){_0x507c64['push'](_0x507c64['shift']());}};_0x2d83e1(++_0x5c7b96);}(_0xd9f6,0xe0));var _0x6d9f=function(_0x4cd739,_0x1a8a12){_0x4cd739=_0x4cd739-0x0;var _0x1b163f=_0xd9f6[_0x4cd739];return _0x1b163f;};'use strict';var _=require(_0x6d9f('0x0'));var util=require('util');var moment=require(_0x6d9f('0x1'));var BPromise=require(_0x6d9f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d9f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d9f('0x4'))('rpc');var config=require(_0x6d9f('0x5'));var jayson=require(_0x6d9f('0x6'));var client=jayson[_0x6d9f('0x7')][_0x6d9f('0x8')]({'port':0x232a});config[_0x6d9f('0x9')]=_['defaults'](config[_0x6d9f('0x9')],{'host':_0x6d9f('0xa'),'port':0x18eb});var socket=require(_0x6d9f('0xb'))(new Redis(config[_0x6d9f('0x9')]));require(_0x6d9f('0xc'))[_0x6d9f('0xd')](socket);function respondWithRpcPromise(_0x1fa002,_0x479215,_0x50fff6){return new BPromise(function(_0x212151,_0x2f70e5){return client[_0x6d9f('0xe')](_0x1fa002,_0x50fff6)['then'](function(_0x464355){logger[_0x6d9f('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x479215,_0x6d9f('0x10'));logger[_0x6d9f('0x11')](_0x6d9f('0x12'),_0x479215,_0x6d9f('0x10'),JSON['stringify'](_0x464355));if(_0x464355[_0x6d9f('0x13')]){if(_0x464355[_0x6d9f('0x13')][_0x6d9f('0x14')]===0x1f4){logger['error'](_0x6d9f('0x15'),_0x479215,_0x464355['error'][_0x6d9f('0x16')]);return _0x2f70e5(_0x464355[_0x6d9f('0x13')]['message']);}logger['error'](_0x6d9f('0x15'),_0x479215,_0x464355[_0x6d9f('0x13')][_0x6d9f('0x16')]);return _0x212151(_0x464355[_0x6d9f('0x13')][_0x6d9f('0x16')]);}else{logger['info'](_0x6d9f('0x15'),_0x479215,_0x6d9f('0x10'));_0x212151(_0x464355[_0x6d9f('0x17')][_0x6d9f('0x16')]);}})[_0x6d9f('0x18')](function(_0x1bf46d){logger[_0x6d9f('0x13')](_0x6d9f('0x15'),_0x479215,_0x1bf46d);_0x2f70e5(_0x1bf46d);});});}exports[_0x6d9f('0x19')]=function(_0xab94fb){var _0x120899=this;return new Promise(function(_0x4b676d,_0x28a26d){return db[_0x6d9f('0x1a')][_0x6d9f('0x1b')](_0xab94fb[_0x6d9f('0x1c')],{'raw':_0xab94fb[_0x6d9f('0x1d')]?_0xab94fb[_0x6d9f('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab94fb['options']?_0xab94fb[_0x6d9f('0x1d')][_0x6d9f('0x1e')]||null:null,'attributes':_0xab94fb[_0x6d9f('0x1d')]?_0xab94fb['options'][_0x6d9f('0x1f')]||null:null,'limit':_0xab94fb[_0x6d9f('0x1d')]?_0xab94fb[_0x6d9f('0x1d')][_0x6d9f('0x20')]||null:null})[_0x6d9f('0x21')](function(_0x50f5b8){logger['info'](_0x6d9f('0x19'),_0xab94fb);logger[_0x6d9f('0x11')]('UpdateSmsInteraction',_0xab94fb,JSON[_0x6d9f('0x22')](_0x50f5b8));_0x4b676d(_0x50f5b8);})[_0x6d9f('0x18')](function(_0x4ce368){logger[_0x6d9f('0x13')](_0x6d9f('0x19'),_0x4ce368['message'],_0xab94fb);_0x28a26d(_0x120899[_0x6d9f('0x13')](0x1f4,_0x4ce368[_0x6d9f('0x16')]));});});};exports['AddTagsToSmsInteraction']=function(_0x184bff){return new Promise(function(_0x3b08e3,_0x24aa10){return db[_0x6d9f('0x1a')][_0x6d9f('0x23')]({'where':_0x184bff['options']?_0x184bff['options'][_0x6d9f('0x1e')]||null:null})['then'](function(_0x4d869f){if(_0x4d869f){return _0x4d869f[_0x6d9f('0x24')](_0x184bff[_0x6d9f('0x1c')]['ids'],_[_0x6d9f('0x25')](_0x184bff['body'],['ids','id'])||{});}})[_0x6d9f('0x26')](function(_0x4420a4){logger[_0x6d9f('0xf')](_0x6d9f('0x27'),_0x184bff);logger['debug'](_0x6d9f('0x27'),_0x184bff,JSON['stringify'](_0x4420a4));_0x3b08e3(_0x4420a4);})[_0x6d9f('0x18')](function(_0x5373a4){logger[_0x6d9f('0x13')](_0x6d9f('0x27'),_0x5373a4[_0x6d9f('0x16')],_0x184bff);_0x24aa10(_this[_0x6d9f('0x13')](0x1f4,_0x5373a4['message']));});});}; \ No newline at end of file +var _0xe47a=['catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','AddTagsToSmsInteraction','find','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result'];(function(_0x303d75,_0x3ea3e4){var _0x3471c7=function(_0x331c3a){while(--_0x331c3a){_0x303d75['push'](_0x303d75['shift']());}};_0x3471c7(++_0x3ea3e4);}(_0xe47a,0x147));var _0xae47=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xe47a[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xae47('0x0'));var util=require('util');var moment=require(_0xae47('0x1'));var BPromise=require(_0xae47('0x2'));var rs=require(_0xae47('0x3'));var fs=require('fs');var Redis=require(_0xae47('0x4'));var db=require(_0xae47('0x5'))['db'];var utils=require(_0xae47('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xae47('0x7')][_0xae47('0x8')]({'port':0x232a});config[_0xae47('0x9')]=_[_0xae47('0xa')](config[_0xae47('0x9')],{'host':_0xae47('0xb'),'port':0x18eb});var socket=require(_0xae47('0xc'))(new Redis(config[_0xae47('0x9')]));require('./smsInteraction.socket')[_0xae47('0xd')](socket);function respondWithRpcPromise(_0x3110d0,_0x1a1b1f,_0x3c7bca){return new BPromise(function(_0x548ffd,_0x5ef756){return client[_0xae47('0xe')](_0x3110d0,_0x3c7bca)[_0xae47('0xf')](function(_0x59f1fd){logger['info'](_0xae47('0x10'),_0x1a1b1f,_0xae47('0x11'));logger[_0xae47('0x12')](_0xae47('0x13'),_0x1a1b1f,'request\x20sent',JSON['stringify'](_0x59f1fd));if(_0x59f1fd[_0xae47('0x14')]){if(_0x59f1fd[_0xae47('0x14')]['code']===0x1f4){logger[_0xae47('0x14')](_0xae47('0x10'),_0x1a1b1f,_0x59f1fd[_0xae47('0x14')][_0xae47('0x15')]);return _0x5ef756(_0x59f1fd['error']['message']);}logger['error'](_0xae47('0x10'),_0x1a1b1f,_0x59f1fd[_0xae47('0x14')]['message']);return _0x548ffd(_0x59f1fd[_0xae47('0x14')]['message']);}else{logger[_0xae47('0x16')](_0xae47('0x10'),_0x1a1b1f,_0xae47('0x11'));_0x548ffd(_0x59f1fd[_0xae47('0x17')]['message']);}})[_0xae47('0x18')](function(_0x2874d1){logger[_0xae47('0x14')](_0xae47('0x10'),_0x1a1b1f,_0x2874d1);_0x5ef756(_0x2874d1);});});}exports[_0xae47('0x19')]=function(_0x453650){var _0x441dc7=this;return new Promise(function(_0xaad69a,_0x42bc5c){return db[_0xae47('0x1a')][_0xae47('0x1b')](_0x453650[_0xae47('0x1c')],{'raw':_0x453650[_0xae47('0x1d')]?_0x453650[_0xae47('0x1d')][_0xae47('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x453650[_0xae47('0x1d')]?_0x453650[_0xae47('0x1d')][_0xae47('0x1f')]||null:null,'attributes':_0x453650['options']?_0x453650[_0xae47('0x1d')]['attributes']||null:null,'limit':_0x453650[_0xae47('0x1d')]?_0x453650[_0xae47('0x1d')][_0xae47('0x20')]||null:null})[_0xae47('0xf')](function(_0x740e93){logger[_0xae47('0x16')](_0xae47('0x19'),_0x453650);logger[_0xae47('0x12')](_0xae47('0x19'),_0x453650,JSON['stringify'](_0x740e93));_0xaad69a(_0x740e93);})[_0xae47('0x18')](function(_0x4894ab){logger['error'](_0xae47('0x19'),_0x4894ab[_0xae47('0x15')],_0x453650);_0x42bc5c(_0x441dc7[_0xae47('0x14')](0x1f4,_0x4894ab[_0xae47('0x15')]));});});};exports[_0xae47('0x21')]=function(_0x3f5224){return new Promise(function(_0x2d4c3c,_0x439931){return db[_0xae47('0x1a')][_0xae47('0x22')]({'where':_0x3f5224[_0xae47('0x1d')]?_0x3f5224[_0xae47('0x1d')][_0xae47('0x1f')]||null:null})['then'](function(_0x4d7e96){if(_0x4d7e96){return _0x4d7e96['addTags'](_0x3f5224[_0xae47('0x1c')][_0xae47('0x23')],_[_0xae47('0x24')](_0x3f5224['body'],[_0xae47('0x23'),'id'])||{});}})[_0xae47('0x25')](function(_0x4309d9){logger[_0xae47('0x16')](_0xae47('0x26'),_0x3f5224);logger[_0xae47('0x12')](_0xae47('0x26'),_0x3f5224,JSON['stringify'](_0x4309d9));_0x2d4c3c(_0x4309d9);})[_0xae47('0x18')](function(_0x3aa357){logger[_0xae47('0x14')](_0xae47('0x26'),_0x3aa357[_0xae47('0x15')],_0x3f5224);_0x439931(_this[_0xae47('0x14')](0x1f4,_0x3aa357[_0xae47('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 2c64caf..956212b 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 _0x0dd2=['register','length','smsInteraction:','save','remove','update','emit'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0dd2,0xc7));var _0x20dd=function(_0x1a9b94,_0x4d763e){_0x1a9b94=_0x1a9b94-0x0;var _0x379102=_0x0dd2[_0x1a9b94];return _0x379102;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x20dd('0x0'),_0x20dd('0x1'),_0x20dd('0x2')];function createListener(_0x486c06,_0x3fc558){return function(_0x407276){_0x3fc558[_0x20dd('0x3')](_0x486c06,_0x407276);};}function removeListener(_0x32990d,_0x10bb23){return function(){SmsInteractionEvents['removeListener'](_0x32990d,_0x10bb23);};}exports[_0x20dd('0x4')]=function(_0x3d6549){for(var _0x490d52=0x0,_0x48174a=events[_0x20dd('0x5')];_0x490d52<_0x48174a;_0x490d52++){var _0x4331cb=events[_0x490d52];var _0xbd5ba9=createListener(_0x20dd('0x6')+_0x4331cb,_0x3d6549);SmsInteractionEvents['on'](_0x4331cb,_0xbd5ba9);}}; \ No newline at end of file +var _0x3a50=['emit','removeListener','length','smsInteraction:','save','remove','update'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3a50,0xdd));var _0x03a5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3a50[_0x57b54c];return _0x59cc19;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x03a5('0x0'),_0x03a5('0x1'),_0x03a5('0x2')];function createListener(_0x40246b,_0x2ec53){return function(_0x3c0116){_0x2ec53[_0x03a5('0x3')](_0x40246b,_0x3c0116);};}function removeListener(_0x5b5538,_0x1673c9){return function(){SmsInteractionEvents[_0x03a5('0x4')](_0x5b5538,_0x1673c9);};}exports['register']=function(_0x1f2cd6){for(var _0x564f74=0x0,_0x1a3227=events[_0x03a5('0x5')];_0x564f74<_0x1a3227;_0x564f74++){var _0x26a1d5=events[_0x564f74];var _0x1e4f2e=createListener(_0x03a5('0x6')+_0x26a1d5,_0x1f2cd6);SmsInteractionEvents['on'](_0x26a1d5,_0x1e4f2e);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 2def893..d156bf5 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 _0xb34a=['tracked','sms','post','/:id/status','update','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x99f728,_0x1e6124){var _0x42e733=function(_0x144423){while(--_0x144423){_0x99f728['push'](_0x99f728['shift']());}};_0x42e733(++_0x1e6124);}(_0xb34a,0x1ce));var _0xab34=function(_0x439092,_0x224456){_0x439092=_0x439092-0x0;var _0x280b44=_0xb34a[_0x439092];return _0x280b44;};'use strict';var multer=require(_0xab34('0x0'));var util=require(_0xab34('0x1'));var path=require(_0xab34('0x2'));var timeout=require(_0xab34('0x3'));var express=require(_0xab34('0x4'));var router=express[_0xab34('0x5')]();var fs_extra=require(_0xab34('0x6'));var auth=require(_0xab34('0x7'));var interaction=require(_0xab34('0x8'));var config=require(_0xab34('0x9'));var controller=require(_0xab34('0xa'));router[_0xab34('0xb')]('/',auth[_0xab34('0xc')](),controller[_0xab34('0xd')]);router[_0xab34('0xb')](_0xab34('0xe'),auth[_0xab34('0xc')](),controller[_0xab34('0xf')]);router[_0xab34('0xb')](_0xab34('0x10'),auth[_0xab34('0xc')](),controller[_0xab34('0x11')]);router['post']('/',auth[_0xab34('0xc')](),interaction[_0xab34('0x12')](_0xab34('0x13'),'smsmessage:create'),controller['create']);router[_0xab34('0x14')](_0xab34('0x15'),controller['status']);router['put'](_0xab34('0x10'),auth[_0xab34('0xc')](),controller[_0xab34('0x16')]);router[_0xab34('0x17')](_0xab34('0x18'),auth[_0xab34('0xc')](),controller[_0xab34('0x19')]);router[_0xab34('0x17')]('/:id/reject',auth[_0xab34('0xc')](),controller[_0xab34('0x1a')]);router[_0xab34('0x1b')](_0xab34('0x10'),auth[_0xab34('0xc')](),controller[_0xab34('0x1c')]);module[_0xab34('0x1d')]=router; \ No newline at end of file +var _0xc4dd=['isAuthenticated','/describe','describe','/:id','show','post','sms','smsmessage:create','status','update','put','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xc4dd,0xad));var _0xdc4d=function(_0x4fdc1f,_0x806088){_0x4fdc1f=_0x4fdc1f-0x0;var _0xb5c85e=_0xc4dd[_0x4fdc1f];return _0xb5c85e;};'use strict';var multer=require(_0xdc4d('0x0'));var util=require(_0xdc4d('0x1'));var path=require(_0xdc4d('0x2'));var timeout=require('connect-timeout');var express=require(_0xdc4d('0x3'));var router=express[_0xdc4d('0x4')]();var fs_extra=require(_0xdc4d('0x5'));var auth=require(_0xdc4d('0x6'));var interaction=require(_0xdc4d('0x7'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0xdc4d('0x8')]('/',auth[_0xdc4d('0x9')](),controller['index']);router[_0xdc4d('0x8')](_0xdc4d('0xa'),auth['isAuthenticated'](),controller[_0xdc4d('0xb')]);router[_0xdc4d('0x8')](_0xdc4d('0xc'),auth[_0xdc4d('0x9')](),controller[_0xdc4d('0xd')]);router[_0xdc4d('0xe')]('/',auth[_0xdc4d('0x9')](),interaction['tracked'](_0xdc4d('0xf'),_0xdc4d('0x10')),controller['create']);router[_0xdc4d('0xe')]('/:id/status',controller[_0xdc4d('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xdc4d('0x12')]);router[_0xdc4d('0x13')](_0xdc4d('0x14'),auth['isAuthenticated'](),controller[_0xdc4d('0x15')]);router[_0xdc4d('0x13')](_0xdc4d('0x16'),auth['isAuthenticated'](),controller[_0xdc4d('0x17')]);router['delete']('/:id',auth[_0xdc4d('0x9')](),controller[_0xdc4d('0x18')]);module[_0xdc4d('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 06add92..4c98b14 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 _0x2aa0=['out','STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0x4c514a,_0x452eac){var _0x559a76=function(_0x2699e3){while(--_0x2699e3){_0x4c514a['push'](_0x4c514a['shift']());}};_0x559a76(++_0x452eac);}(_0x2aa0,0x6c));var _0x02aa=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x2aa0[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x02aa('0x0'));module[_0x02aa('0x1')]={'body':{'type':Sequelize['TEXT'](_0x02aa('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x02aa('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x02aa('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x02aa('0x5')](0xbe)},'phone':{'type':Sequelize[_0x02aa('0x5')]},'readAt':{'type':Sequelize[_0x02aa('0x6')]},'secret':{'type':Sequelize[_0x02aa('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x02aa('0x5')]},'providerResponse':{'type':Sequelize[_0x02aa('0x7')]}}; \ No newline at end of file +var _0x4294=['out','STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN'];(function(_0xb353a4,_0x38b1e6){var _0x4d0334=function(_0x1ec39b){while(--_0x1ec39b){_0xb353a4['push'](_0xb353a4['shift']());}};_0x4d0334(++_0x38b1e6);}(_0x4294,0x6c));var _0x4429=function(_0x3c11ab,_0x136119){_0x3c11ab=_0x3c11ab-0x0;var _0x251c95=_0x4294[_0x3c11ab];return _0x251c95;};'use strict';var Sequelize=require(_0x4429('0x0'));module[_0x4429('0x1')]={'body':{'type':Sequelize['TEXT'](_0x4429('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4429('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4429('0x4')),'defaultValue':_0x4429('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4429('0x5')](0xbe)},'phone':{'type':Sequelize[_0x4429('0x5')]},'readAt':{'type':Sequelize[_0x4429('0x6')]},'secret':{'type':Sequelize[_0x4429('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4429('0x5')]},'providerResponse':{'type':Sequelize[_0x4429('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 6c40f0c..0a67206 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 _0xa8d9=['interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','body','describe','sms-interactions','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt'];(function(_0x5e77b8,_0x4fa504){var _0x988deb=function(_0x29880f){while(--_0x29880f){_0x5e77b8['push'](_0x5e77b8['shift']());}};_0x988deb(++_0x4fa504);}(_0xa8d9,0x1f1));var _0x9a8d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9a8d('0x0'));var rimraf=require(_0x9a8d('0x1'));var zipdir=require(_0x9a8d('0x2'));var jsonpatch=require(_0x9a8d('0x3'));var rp=require(_0x9a8d('0x4'));var moment=require('moment');var BPromise=require(_0x9a8d('0x5'));var Mustache=require(_0x9a8d('0x6'));var util=require('util');var path=require(_0x9a8d('0x7'));var sox=require(_0x9a8d('0x8'));var csv=require(_0x9a8d('0x9'));var ejs=require(_0x9a8d('0xa'));var fs=require('fs');var fs_extra=require(_0x9a8d('0xb'));var _=require('lodash');var squel=require(_0x9a8d('0xc'));var crypto=require(_0x9a8d('0xd'));var jsforce=require(_0x9a8d('0xe'));var deskjs=require(_0x9a8d('0xf'));var toCsv=require(_0x9a8d('0x9'));var querystring=require('querystring');var Papa=require(_0x9a8d('0x10'));var Redis=require(_0x9a8d('0x11'));var authService=require(_0x9a8d('0x12'));var qs=require(_0x9a8d('0x13'));var as=require(_0x9a8d('0x14'));var hardwareService=require(_0x9a8d('0x15'));var logger=require(_0x9a8d('0x16'))(_0x9a8d('0x17'));var utils=require(_0x9a8d('0x18'));var config=require(_0x9a8d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9a8d('0x1a')]=_[_0x9a8d('0x1b')](config[_0x9a8d('0x1a')],{'host':_0x9a8d('0x1c'),'port':0x18eb});var socket=require(_0x9a8d('0x1d'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x9a8d('0x1e')](socket);var jayson=require(_0x9a8d('0x1f'));var client=jayson[_0x9a8d('0x20')][_0x9a8d('0x21')]({'port':0x232c});var client9002=jayson[_0x9a8d('0x20')][_0x9a8d('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x59e984,_0x419173,_0x37c632,_0xf0e398){return new BPromise(function(_0x290fb7,_0x32d491){var _0x9df34d=_0xf0e398||client;return _0x9df34d[_0x9a8d('0x22')](_0x59e984,_0x37c632)[_0x9a8d('0x23')](function(_0x5565f8){logger[_0x9a8d('0x24')]('SmsMessage,\x20%s,\x20%s',_0x419173,_0x9a8d('0x25'));logger[_0x9a8d('0x26')](_0x9a8d('0x27'),_0x419173,_0x9a8d('0x25'),JSON['stringify'](_0x5565f8));if(_0x5565f8[_0x9a8d('0x28')]){if(_0x5565f8[_0x9a8d('0x28')]['code']===0x1f4){logger['error'](_0x9a8d('0x29'),_0x419173,_0x5565f8[_0x9a8d('0x28')]['message']);return _0x32d491(_0x5565f8[_0x9a8d('0x28')][_0x9a8d('0x2a')]);}logger['error'](_0x9a8d('0x29'),_0x419173,_0x5565f8[_0x9a8d('0x28')]['message']);return _0x290fb7(_0x5565f8[_0x9a8d('0x28')][_0x9a8d('0x2a')]);}else{logger[_0x9a8d('0x24')]('SmsMessage,\x20%s,\x20%s',_0x419173,_0x9a8d('0x25'));_0x290fb7(_0x5565f8[_0x9a8d('0x2b')][_0x9a8d('0x2a')]);}})['catch'](function(_0xa1b0c5){logger[_0x9a8d('0x28')](_0x9a8d('0x29'),_0x419173,_0xa1b0c5);_0x32d491(_0xa1b0c5);});});}function respondWithStatusCode(_0x4750ad,_0x1dd21f){_0x1dd21f=_0x1dd21f||0xcc;return function(_0x260019){if(_0x260019){return _0x4750ad['sendStatus'](_0x1dd21f);}return _0x4750ad[_0x9a8d('0x2c')](_0x1dd21f)[_0x9a8d('0x2d')]();};}function respondWithResult(_0x50af6b,_0x404d2f){_0x404d2f=_0x404d2f||0xc8;return function(_0x5dbb2a){if(_0x5dbb2a){return _0x50af6b[_0x9a8d('0x2c')](_0x404d2f)[_0x9a8d('0x2e')](_0x5dbb2a);}};}function respondWithFilteredResult(_0x3dde53,_0x50ef61){return function(_0x2da3ce){if(_0x2da3ce){var _0x41eb5e=typeof _0x50ef61[_0x9a8d('0x2f')]===_0x9a8d('0x30')&&typeof _0x50ef61[_0x9a8d('0x31')]===_0x9a8d('0x30');var _0x1bc1e3=_0x2da3ce['count'];var _0x15056c=_0x41eb5e?0x0:_0x50ef61['offset'];var _0x3b5051=_0x41eb5e?_0x2da3ce[_0x9a8d('0x32')]:_0x50ef61[_0x9a8d('0x2f')]+_0x50ef61[_0x9a8d('0x31')];var _0x492864;if(_0x3b5051>=_0x1bc1e3){_0x3b5051=_0x1bc1e3;_0x492864=0xc8;}else{_0x492864=0xce;}_0x3dde53[_0x9a8d('0x2c')](_0x492864);return _0x3dde53[_0x9a8d('0x33')](_0x9a8d('0x34'),_0x15056c+'-'+_0x3b5051+'/'+_0x1bc1e3)[_0x9a8d('0x2e')](_0x2da3ce);}return null;};}function patchUpdates(_0xf96ea2){return function(_0x32bc4d){try{jsonpatch[_0x9a8d('0x35')](_0x32bc4d,_0xf96ea2,!![]);}catch(_0x57b998){return BPromise[_0x9a8d('0x36')](_0x57b998);}return _0x32bc4d[_0x9a8d('0x37')]();};}function saveUpdates(_0x3210de,_0x487ee8){return function(_0x404617){if(_0x404617){return _0x404617[_0x9a8d('0x38')](_0x3210de)[_0x9a8d('0x23')](function(_0xe0e5df){return _0xe0e5df;});}return null;};}function removeEntity(_0x239207,_0x39d37a){return function(_0x46b0a6){if(_0x46b0a6){return _0x46b0a6[_0x9a8d('0x39')]()['then'](function(){_0x239207[_0x9a8d('0x2c')](0xcc)[_0x9a8d('0x2d')]();});}};}function handleEntityNotFound(_0xfface4,_0x59a02e){return function(_0x542fc3){if(!_0x542fc3){_0xfface4[_0x9a8d('0x3a')](0x194);}return _0x542fc3;};}function handleError(_0x5f5958,_0x5a1f0b){_0x5a1f0b=_0x5a1f0b||0x1f4;return function(_0x4c2a6c){logger['error'](_0x4c2a6c[_0x9a8d('0x3b')]);if(_0x4c2a6c[_0x9a8d('0x3c')]){delete _0x4c2a6c[_0x9a8d('0x3c')];}_0x5f5958[_0x9a8d('0x2c')](_0x5a1f0b)[_0x9a8d('0x3d')](_0x4c2a6c);};}exports[_0x9a8d('0x3e')]=function(_0x5c1864,_0x4a6b89){var _0x46620c={},_0x20adbd={},_0x23fec3={'count':0x0,'rows':[]};var _0xe986b7=_[_0x9a8d('0x3f')](db[_0x9a8d('0x40')][_0x9a8d('0x41')],function(_0x407f52){return{'name':_0x407f52[_0x9a8d('0x42')],'type':_0x407f52[_0x9a8d('0x43')][_0x9a8d('0x44')]};});_0x20adbd[_0x9a8d('0x45')]=_['map'](_0xe986b7,_0x9a8d('0x3c'));_0x20adbd[_0x9a8d('0x46')]=_['keys'](_0x5c1864['query']);_0x20adbd[_0x9a8d('0x47')]=_[_0x9a8d('0x48')](_0x20adbd[_0x9a8d('0x45')],_0x20adbd['query']);_0x46620c[_0x9a8d('0x49')]=_[_0x9a8d('0x48')](_0x20adbd[_0x9a8d('0x45')],qs[_0x9a8d('0x4a')](_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x4a')]));_0x46620c[_0x9a8d('0x49')]=_0x46620c[_0x9a8d('0x49')][_0x9a8d('0x4b')]?_0x46620c[_0x9a8d('0x49')]:_0x20adbd[_0x9a8d('0x45')];if(!_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x4c')](_0x9a8d('0x4d'))){_0x46620c[_0x9a8d('0x31')]=qs[_0x9a8d('0x31')](_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x31')]);_0x46620c['offset']=qs[_0x9a8d('0x2f')](_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x2f')]);}_0x46620c['order']=qs['sort'](_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x4e')]);_0x46620c[_0x9a8d('0x4f')]=qs[_0x9a8d('0x47')](_[_0x9a8d('0x50')](_0x5c1864[_0x9a8d('0x46')],_0x20adbd['filters']),_0xe986b7);if(_0x5c1864['query'][_0x9a8d('0x51')]){_0x46620c[_0x9a8d('0x4f')]=_['merge'](_0x46620c[_0x9a8d('0x4f')],{'$or':_['map'](_0xe986b7,function(_0x58a657){if(_0x58a657[_0x9a8d('0x43')]!==_0x9a8d('0x52')){var _0xdfc4b3={};_0xdfc4b3[_0x58a657[_0x9a8d('0x3c')]]={'$like':'%'+_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x51')]+'%'};return _0xdfc4b3;}})});}_0x46620c=_[_0x9a8d('0x53')]({},_0x46620c,_0x5c1864[_0x9a8d('0x54')]);var _0x4f564a={'where':_0x46620c[_0x9a8d('0x4f')]};return db[_0x9a8d('0x40')]['count'](_0x4f564a)['then'](function(_0x46faa1){_0x23fec3['count']=_0x46faa1;if(_0x5c1864[_0x9a8d('0x46')][_0x9a8d('0x55')]){_0x46620c[_0x9a8d('0x56')]=[{'all':!![]}];}return db[_0x9a8d('0x40')][_0x9a8d('0x57')](_0x46620c);})['then'](function(_0x2dc79c){_0x23fec3[_0x9a8d('0x58')]=_0x2dc79c;return _0x23fec3;})[_0x9a8d('0x23')](respondWithFilteredResult(_0x4a6b89,_0x46620c))['catch'](handleError(_0x4a6b89,null));};exports['show']=function(_0x511045,_0x1b88a1){var _0x5059e5={'raw':!![],'where':{'id':_0x511045[_0x9a8d('0x59')]['id']}},_0x44502d={};_0x44502d[_0x9a8d('0x45')]=_[_0x9a8d('0x5a')](db[_0x9a8d('0x40')][_0x9a8d('0x41')]);_0x44502d[_0x9a8d('0x46')]=_[_0x9a8d('0x5a')](_0x511045[_0x9a8d('0x46')]);_0x44502d[_0x9a8d('0x47')]=_[_0x9a8d('0x48')](_0x44502d['model'],_0x44502d['query']);_0x5059e5[_0x9a8d('0x49')]=_['intersection'](_0x44502d[_0x9a8d('0x45')],qs[_0x9a8d('0x4a')](_0x511045[_0x9a8d('0x46')][_0x9a8d('0x4a')]));_0x5059e5['attributes']=_0x5059e5[_0x9a8d('0x49')][_0x9a8d('0x4b')]?_0x5059e5['attributes']:_0x44502d['model'];if(_0x511045['query'][_0x9a8d('0x55')]){_0x5059e5['include']=[{'all':!![]}];}_0x5059e5=_[_0x9a8d('0x53')]({},_0x5059e5,_0x511045[_0x9a8d('0x54')]);return db[_0x9a8d('0x40')][_0x9a8d('0x5b')](_0x5059e5)['then'](handleEntityNotFound(_0x1b88a1,null))['then'](respondWithResult(_0x1b88a1,null))[_0x9a8d('0x5c')](handleError(_0x1b88a1,null));};exports['create']=function(_0x1c98b7,_0x31cf9f){return db[_0x9a8d('0x40')]['create'](_0x1c98b7[_0x9a8d('0x5d')],{})[_0x9a8d('0x23')](respondWithResult(_0x31cf9f,0xc9))[_0x9a8d('0x5c')](handleError(_0x31cf9f,null));};exports[_0x9a8d('0x38')]=function(_0x473d66,_0x37a116){if(_0x473d66[_0x9a8d('0x5d')]['id']){delete _0x473d66['body']['id'];}return db[_0x9a8d('0x40')][_0x9a8d('0x5b')]({'where':{'id':_0x473d66[_0x9a8d('0x59')]['id']}})[_0x9a8d('0x23')](handleEntityNotFound(_0x37a116,null))[_0x9a8d('0x23')](saveUpdates(_0x473d66[_0x9a8d('0x5d')],null))[_0x9a8d('0x23')](respondWithResult(_0x37a116,null))[_0x9a8d('0x5c')](handleError(_0x37a116,null));};exports[_0x9a8d('0x39')]=function(_0x2a9b3f,_0x1339de){return db['SmsMessage'][_0x9a8d('0x5b')]({'where':{'id':_0x2a9b3f[_0x9a8d('0x59')]['id']}})[_0x9a8d('0x23')](handleEntityNotFound(_0x1339de,null))[_0x9a8d('0x23')](removeEntity(_0x1339de,null))[_0x9a8d('0x5c')](handleError(_0x1339de,null));};exports[_0x9a8d('0x5e')]=function(_0x4e4842,_0x5b148b){return db[_0x9a8d('0x40')][_0x9a8d('0x5e')]()[_0x9a8d('0x23')](respondWithResult(_0x5b148b,null))[_0x9a8d('0x5c')](handleError(_0x5b148b,null));};var interaction_log=require(_0x9a8d('0x16'))(_0x9a8d('0x5f'));exports['accept']=function(_0x21f2e5,_0x41b61a,_0x5ef3d4){var _0x548868={'agent':{},'channel':_0x9a8d('0x60')};if(_0x21f2e5[_0x9a8d('0x5d')]['id']){delete _0x21f2e5[_0x9a8d('0x5d')]['id'];}_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x61')]=!![];_0x21f2e5[_0x9a8d('0x5d')]['readAt']=moment()[_0x9a8d('0x62')](_0x9a8d('0x63'));_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x64')]=_0x21f2e5[_0x9a8d('0x5d')]['UserId']||_0x21f2e5[_0x9a8d('0x65')]['id'];_0x548868[_0x9a8d('0x66')]['id']=_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x64')];return db['SmsMessage']['find']({'where':{'id':_0x21f2e5[_0x9a8d('0x59')]['id'],'UserId':null}})[_0x9a8d('0x23')](handleEntityNotFound(_0x41b61a,null))[_0x9a8d('0x23')](saveUpdates(_0x21f2e5[_0x9a8d('0x5d')],null))[_0x9a8d('0x23')](function(_0x2c5142){if(_0x2c5142){_0x548868[_0x9a8d('0x2a')]=_0x2c5142[_0x9a8d('0x67')]({'plain':!![]});return db[_0x9a8d('0x68')][_0x9a8d('0x5b')]({'where':{'id':_0x2c5142[_0x9a8d('0x69')]}});}return null;})[_0x9a8d('0x23')](handleEntityNotFound(_0x41b61a,null))[_0x9a8d('0x23')](function(_0x112c85){if(_0x112c85){return _0x112c85[_0x9a8d('0x38')]({'UserId':_0x21f2e5['body'][_0x9a8d('0x64')],'read1stAt':_['isNil'](_0x112c85[_0x9a8d('0x6a')])?moment()['format'](_0x9a8d('0x63')):undefined});}return null;})[_0x9a8d('0x23')](function(_0x502f3e){if(_0x502f3e){_0x548868[_0x9a8d('0x6b')]=_0x502f3e[_0x9a8d('0x67')]({'plain':!![]});interaction_log[_0x9a8d('0x24')](_0x9a8d('0x6c'),_0x21f2e5['user']['id'],_0x21f2e5[_0x9a8d('0x65')][_0x9a8d('0x3c')],_0x21f2e5['user'][_0x9a8d('0x6d')],_0x548868[_0x9a8d('0x6b')]['id'],_0x21f2e5[_0x9a8d('0x5d')]?JSON[_0x9a8d('0x6e')](_0x21f2e5[_0x9a8d('0x5d')]):_0x9a8d('0x6f'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x548868);}return null;})[_0x9a8d('0x23')](function(_0x8833e4){var _0x229e1a=_0x9a8d('0x70')+_0x8833e4[_0x9a8d('0x2a')][_0x9a8d('0x71')];return db['sequelize'][_0x9a8d('0x46')](_0x229e1a,{'type':db[_0x9a8d('0x72')][_0x9a8d('0x73')][_0x9a8d('0x74')],'raw':!![]})[_0x9a8d('0x23')](function(_0x1f57a9){return _0x1f57a9;});})['then'](function(_0x298939){if(_0x298939){_0x548868['message'][_0x9a8d('0x75')]=_0x298939[0x0];if(!_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x64')])return;return db[_0x9a8d('0x76')]['find']({'where':{'id':_0x21f2e5['body'][_0x9a8d('0x64')],'role':_0x9a8d('0x66')},'attributes':['id',_0x9a8d('0x3c'),_0x9a8d('0x77'),_0x9a8d('0x78'),_0x9a8d('0x79')],'raw':!![]});}return null;})['then'](function(_0x443b7b){if(!_0x443b7b)return null;_0x548868['message'][_0x9a8d('0x66')]=_0x443b7b;return _0x548868;})[_0x9a8d('0x23')](function(_0x5d0315){if(_0x5d0315){if(_0x21f2e5[_0x9a8d('0x5d')][_0x9a8d('0x7a')]){_0x548868[_0x9a8d('0x2a')][_0x9a8d('0x7b')]=util['format'](_0x9a8d('0x7c'),_0x21f2e5[_0x9a8d('0x65')][_0x9a8d('0x3c')]);_0x548868['message'][_0x9a8d('0x7d')]=_0x548868[_0x9a8d('0x7d')];_0x548868[_0x9a8d('0x2a')][_0x9a8d('0x7e')]=_0x548868[_0x9a8d('0x7d')];_0x548868[_0x9a8d('0x2a')][_0x9a8d('0x7f')]=_0x9a8d('0x80');return respondWithRpcPromise('EventManager',_0x9a8d('0x81'),{'event':_0x9a8d('0x82'),'message':_0x548868[_0x9a8d('0x2a')]},client9002)[_0x9a8d('0x23')](function(){return _0x548868;});}return _0x548868;}return null;})[_0x9a8d('0x23')](respondWithResult(_0x41b61a,null))['catch'](handleError(_0x41b61a,null));};var interaction_log=require(_0x9a8d('0x16'))(_0x9a8d('0x5f'));exports[_0x9a8d('0x36')]=function(_0x54d865,_0x5b91f1,_0x3e2bd3){var _0x1c4bf4={'agent':{},'channel':_0x9a8d('0x60')};if(_0x54d865['body']['id']){delete _0x54d865[_0x9a8d('0x5d')]['id'];}_0x54d865[_0x9a8d('0x5d')][_0x9a8d('0x64')]=_0x54d865[_0x9a8d('0x5d')][_0x9a8d('0x64')]||_0x54d865[_0x9a8d('0x65')]['id'];_0x1c4bf4[_0x9a8d('0x66')]['id']=_0x54d865['body'][_0x9a8d('0x64')];return db[_0x9a8d('0x40')][_0x9a8d('0x5b')]({'where':{'id':_0x54d865[_0x9a8d('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5b91f1,null))[_0x9a8d('0x23')](function(_0x1d0855){if(_0x1d0855){_0x1c4bf4['message']=_0x1d0855['get']({'plain':!![]});return db['SmsInteraction'][_0x9a8d('0x5b')]({'where':{'id':_0x1d0855[_0x9a8d('0x69')]}});}return null;})[_0x9a8d('0x23')](handleEntityNotFound(_0x5b91f1,null))[_0x9a8d('0x23')](function(_0x13355b){if(_0x13355b){_0x1c4bf4[_0x9a8d('0x6b')]=_0x13355b[_0x9a8d('0x67')]({'plain':!![]});interaction_log[_0x9a8d('0x24')](_0x9a8d('0x83'),_0x54d865[_0x9a8d('0x65')]['id'],_0x54d865['user'][_0x9a8d('0x3c')],_0x54d865['user'][_0x9a8d('0x6d')],_0x1c4bf4[_0x9a8d('0x6b')]['id'],_0x54d865['body']?JSON['stringify'](_0x54d865['body']):'null');return respondWithRpcPromise(_0x9a8d('0x84'),_0x9a8d('0x85'),_0x1c4bf4);}return null;})[_0x9a8d('0x23')](function(_0x265366){var _0x5d9e05='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x265366['message']['ContactId'];return db['sequelize'][_0x9a8d('0x46')](_0x5d9e05,{'type':db[_0x9a8d('0x72')][_0x9a8d('0x73')][_0x9a8d('0x74')],'raw':!![]})['then'](function(_0x4ce659){return _0x4ce659;});})[_0x9a8d('0x23')](function(_0x314ffd){if(_0x314ffd){_0x1c4bf4[_0x9a8d('0x2a')][_0x9a8d('0x75')]=_0x314ffd[0x0];if(!_0x54d865[_0x9a8d('0x5d')]['UserId'])return;return db[_0x9a8d('0x76')][_0x9a8d('0x5b')]({'where':{'id':_0x54d865[_0x9a8d('0x5d')][_0x9a8d('0x64')],'role':_0x9a8d('0x66')},'attributes':['id',_0x9a8d('0x3c'),_0x9a8d('0x77'),_0x9a8d('0x78'),_0x9a8d('0x79')],'raw':!![]});}return null;})[_0x9a8d('0x23')](function(_0x51eb8e){if(!_0x51eb8e)return null;_0x1c4bf4['message']['agent']=_0x51eb8e;return _0x1c4bf4;})[_0x9a8d('0x23')](function(_0x8c4d84){if(_0x8c4d84){_0x8c4d84[_0x9a8d('0x2a')][_0x9a8d('0x7b')]=util[_0x9a8d('0x62')](_0x9a8d('0x7c'),_0x54d865[_0x9a8d('0x65')][_0x9a8d('0x3c')]);_0x8c4d84[_0x9a8d('0x2a')][_0x9a8d('0x7d')]=_0x1c4bf4[_0x9a8d('0x7d')];_0x8c4d84[_0x9a8d('0x2a')][_0x9a8d('0x7e')]=_0x1c4bf4['channel'];_0x8c4d84[_0x9a8d('0x2a')]['event']=_0x9a8d('0x36');respondWithRpcPromise('EventManager',_0x9a8d('0x81'),{'event':_0x9a8d('0x86'),'message':_0x8c4d84[_0x9a8d('0x2a')]},client9002);return _0x1c4bf4;}return null;})[_0x9a8d('0x23')](respondWithResult(_0x5b91f1,null))['catch'](handleError(_0x5b91f1,null));};exports[_0x9a8d('0x2c')]=function(_0x4358e1,_0x1d32f4,_0x2bdf2f){if(_0x4358e1[_0x9a8d('0x5d')]['id']){delete _0x4358e1['body']['id'];}var _0x36892e;return db[_0x9a8d('0x40')]['find']({'where':{'id':_0x4358e1[_0x9a8d('0x59')]['id']}})[_0x9a8d('0x23')](handleEntityNotFound(_0x1d32f4,null))[_0x9a8d('0x23')](function(_0x41329e){if(_0x41329e){_0x36892e=_0x41329e;return db[_0x9a8d('0x87')][_0x9a8d('0x5b')]({'where':{'id':_0x41329e['SmsAccountId']}});}})[_0x9a8d('0x23')](handleEntityNotFound(_0x1d32f4,null))['then'](function(_0x5f03ba){if(_0x5f03ba){logger[_0x9a8d('0x26')](_0x9a8d('0x27'),'status',_0x9a8d('0x88'),_0x5f03ba[_0x9a8d('0x43')],util['inspect'](_0x4358e1[_0x9a8d('0x5d')],{'showHidden':![],'depth':null}));switch(_0x5f03ba['type']){case'twilio':if(_0x4358e1[_0x9a8d('0x5d')][_0x9a8d('0x89')]&&_0x4358e1['body'][_0x9a8d('0x89')]===_0x36892e[_0x9a8d('0x8a')]){return _0x36892e[_0x9a8d('0x38')]({'read':!![]});}else{logger[_0x9a8d('0x28')](_0x9a8d('0x8b'),'status',_0x9a8d('0x8c'),util[_0x9a8d('0x8d')](_0x4358e1[_0x9a8d('0x5d')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x4358e1[_0x9a8d('0x5d')][_0x9a8d('0x8e')]&&_0x4358e1['body'][_0x9a8d('0x8e')]===_0x36892e[_0x9a8d('0x8a')]&&_[_0x9a8d('0x8f')]([_0x9a8d('0x90'),_0x9a8d('0x91')],_0x4358e1['body'][_0x9a8d('0x92')])>=0x0){return _0x36892e[_0x9a8d('0x38')]({'read':!![]});}else{logger[_0x9a8d('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9a8d('0x2c'),_0x9a8d('0x93'),util['inspect'](_0x4358e1[_0x9a8d('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x9a8d('0x94'):var _0x50e7a7=_0x4358e1[_0x9a8d('0x5d')][_0x9a8d('0x95')][0x0];if(_0x50e7a7[_0x9a8d('0x2c')]['groupName']===_0x9a8d('0x96')){return _0x36892e[_0x9a8d('0x38')]({'read':!![]});}else{logger[_0x9a8d('0x28')](_0x9a8d('0x8b'),_0x9a8d('0x2c'),_0x9a8d('0x94'),util[_0x9a8d('0x8d')](_0x4358e1[_0x9a8d('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x36892e;}})[_0x9a8d('0x23')](respondWithResult(_0x1d32f4,null))[_0x9a8d('0x5c')](handleError(_0x1d32f4,null));}; \ No newline at end of file +var _0x8ff4=['crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','map','SmsMessage','fieldName','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','rows','show','params','model','rawAttributes','find','create','body','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','SmsInteraction','SmsInteractionId','update','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','ContactId','sequelize','QueryTypes','contact','User','agent','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','sms-interactions','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','email','interface','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','infobip','results','groupName','DELIVERED','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x5442a5,_0x4110f1){var _0x130af0=function(_0x457ec2){while(--_0x457ec2){_0x5442a5['push'](_0x5442a5['shift']());}};_0x130af0(++_0x4110f1);}(_0x8ff4,0x11f));var _0x48ff=function(_0x1ac6e5,_0x40f47f){_0x1ac6e5=_0x1ac6e5-0x0;var _0x5877dc=_0x8ff4[_0x1ac6e5];return _0x5877dc;};'use strict';var emlformat=require(_0x48ff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x48ff('0x1'));var rp=require(_0x48ff('0x2'));var moment=require('moment');var BPromise=require(_0x48ff('0x3'));var Mustache=require(_0x48ff('0x4'));var util=require(_0x48ff('0x5'));var path=require(_0x48ff('0x6'));var sox=require(_0x48ff('0x7'));var csv=require(_0x48ff('0x8'));var ejs=require(_0x48ff('0x9'));var fs=require('fs');var fs_extra=require(_0x48ff('0xa'));var _=require(_0x48ff('0xb'));var squel=require(_0x48ff('0xc'));var crypto=require(_0x48ff('0xd'));var jsforce=require(_0x48ff('0xe'));var deskjs=require(_0x48ff('0xf'));var toCsv=require(_0x48ff('0x8'));var querystring=require('querystring');var Papa=require(_0x48ff('0x10'));var Redis=require(_0x48ff('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x48ff('0x12'));var as=require(_0x48ff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48ff('0x14'))(_0x48ff('0x15'));var utils=require('../../config/utils');var config=require(_0x48ff('0x16'));var licenseUtil=require(_0x48ff('0x17'));var db=require(_0x48ff('0x18'))['db'];config[_0x48ff('0x19')]=_[_0x48ff('0x1a')](config[_0x48ff('0x19')],{'host':_0x48ff('0x1b'),'port':0x18eb});var socket=require(_0x48ff('0x1c'))(new Redis(config[_0x48ff('0x19')]));require(_0x48ff('0x1d'))[_0x48ff('0x1e')](socket);var jayson=require(_0x48ff('0x1f'));var client=jayson[_0x48ff('0x20')][_0x48ff('0x21')]({'port':0x232c});var client9002=jayson['client'][_0x48ff('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x376471,_0x59408e,_0x265e6e,_0x2f8d8a){return new BPromise(function(_0x637378,_0x5066b9){var _0x99d4d6=_0x2f8d8a||client;return _0x99d4d6[_0x48ff('0x22')](_0x376471,_0x265e6e)['then'](function(_0x29012c){logger[_0x48ff('0x23')]('SmsMessage,\x20%s,\x20%s',_0x59408e,_0x48ff('0x24'));logger[_0x48ff('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x59408e,_0x48ff('0x24'),JSON[_0x48ff('0x26')](_0x29012c));if(_0x29012c[_0x48ff('0x27')]){if(_0x29012c['error']['code']===0x1f4){logger[_0x48ff('0x27')]('SmsMessage,\x20%s,\x20%s',_0x59408e,_0x29012c[_0x48ff('0x27')][_0x48ff('0x28')]);return _0x5066b9(_0x29012c[_0x48ff('0x27')][_0x48ff('0x28')]);}logger[_0x48ff('0x27')](_0x48ff('0x29'),_0x59408e,_0x29012c[_0x48ff('0x27')][_0x48ff('0x28')]);return _0x637378(_0x29012c['error'][_0x48ff('0x28')]);}else{logger[_0x48ff('0x23')]('SmsMessage,\x20%s,\x20%s',_0x59408e,_0x48ff('0x24'));_0x637378(_0x29012c[_0x48ff('0x2a')][_0x48ff('0x28')]);}})[_0x48ff('0x2b')](function(_0x1d49da){logger[_0x48ff('0x27')]('SmsMessage,\x20%s,\x20%s',_0x59408e,_0x1d49da);_0x5066b9(_0x1d49da);});});}function respondWithStatusCode(_0x3fc525,_0x38167f){_0x38167f=_0x38167f||0xcc;return function(_0x50b27c){if(_0x50b27c){return _0x3fc525[_0x48ff('0x2c')](_0x38167f);}return _0x3fc525[_0x48ff('0x2d')](_0x38167f)[_0x48ff('0x2e')]();};}function respondWithResult(_0xb3da23,_0x3e8bca){_0x3e8bca=_0x3e8bca||0xc8;return function(_0x31043f){if(_0x31043f){return _0xb3da23[_0x48ff('0x2d')](_0x3e8bca)[_0x48ff('0x2f')](_0x31043f);}};}function respondWithFilteredResult(_0x2b92ad,_0x2c9dee){return function(_0x18fb72){if(_0x18fb72){var _0x4d45fd=typeof _0x2c9dee[_0x48ff('0x30')]===_0x48ff('0x31')&&typeof _0x2c9dee[_0x48ff('0x32')]===_0x48ff('0x31');var _0x51dc06=_0x18fb72[_0x48ff('0x33')];var _0x486f1c=_0x4d45fd?0x0:_0x2c9dee[_0x48ff('0x30')];var _0x4d9634=_0x4d45fd?_0x18fb72[_0x48ff('0x33')]:_0x2c9dee[_0x48ff('0x30')]+_0x2c9dee[_0x48ff('0x32')];var _0x3f07f1;if(_0x4d9634>=_0x51dc06){_0x4d9634=_0x51dc06;_0x3f07f1=0xc8;}else{_0x3f07f1=0xce;}_0x2b92ad[_0x48ff('0x2d')](_0x3f07f1);return _0x2b92ad[_0x48ff('0x34')]('Content-Range',_0x486f1c+'-'+_0x4d9634+'/'+_0x51dc06)[_0x48ff('0x2f')](_0x18fb72);}return null;};}function patchUpdates(_0x6fa03c){return function(_0x17a503){try{jsonpatch[_0x48ff('0x35')](_0x17a503,_0x6fa03c,!![]);}catch(_0x272c1c){return BPromise[_0x48ff('0x36')](_0x272c1c);}return _0x17a503[_0x48ff('0x37')]();};}function saveUpdates(_0x5af089,_0x417b65){return function(_0x3ff3df){if(_0x3ff3df){return _0x3ff3df['update'](_0x5af089)[_0x48ff('0x38')](function(_0x233983){return _0x233983;});}return null;};}function removeEntity(_0x33e90e,_0x23d867){return function(_0x2f0954){if(_0x2f0954){return _0x2f0954[_0x48ff('0x39')]()[_0x48ff('0x38')](function(){_0x33e90e[_0x48ff('0x2d')](0xcc)[_0x48ff('0x2e')]();});}};}function handleEntityNotFound(_0x23a36a,_0x393820){return function(_0x23d70f){if(!_0x23d70f){_0x23a36a[_0x48ff('0x2c')](0x194);}return _0x23d70f;};}function handleError(_0x3718a0,_0x58955d){_0x58955d=_0x58955d||0x1f4;return function(_0x1a1cbe){logger[_0x48ff('0x27')](_0x1a1cbe[_0x48ff('0x3a')]);if(_0x1a1cbe[_0x48ff('0x3b')]){delete _0x1a1cbe['name'];}_0x3718a0['status'](_0x58955d)[_0x48ff('0x3c')](_0x1a1cbe);};}exports['index']=function(_0x49bd8c,_0x907224){var _0x1415c7={},_0x453fc6={},_0x309fc2={'count':0x0,'rows':[]};var _0x487fef=_[_0x48ff('0x3d')](db[_0x48ff('0x3e')]['rawAttributes'],function(_0x1c47c8){return{'name':_0x1c47c8[_0x48ff('0x3f')],'type':_0x1c47c8['type'][_0x48ff('0x40')]};});_0x453fc6['model']=_[_0x48ff('0x3d')](_0x487fef,_0x48ff('0x3b'));_0x453fc6[_0x48ff('0x41')]=_[_0x48ff('0x42')](_0x49bd8c[_0x48ff('0x41')]);_0x453fc6['filters']=_[_0x48ff('0x43')](_0x453fc6['model'],_0x453fc6[_0x48ff('0x41')]);_0x1415c7[_0x48ff('0x44')]=_['intersection'](_0x453fc6['model'],qs[_0x48ff('0x45')](_0x49bd8c['query'][_0x48ff('0x45')]));_0x1415c7[_0x48ff('0x44')]=_0x1415c7[_0x48ff('0x44')][_0x48ff('0x46')]?_0x1415c7['attributes']:_0x453fc6['model'];if(!_0x49bd8c[_0x48ff('0x41')][_0x48ff('0x47')]('nolimit')){_0x1415c7[_0x48ff('0x32')]=qs[_0x48ff('0x32')](_0x49bd8c[_0x48ff('0x41')][_0x48ff('0x32')]);_0x1415c7[_0x48ff('0x30')]=qs[_0x48ff('0x30')](_0x49bd8c['query'][_0x48ff('0x30')]);}_0x1415c7[_0x48ff('0x48')]=qs[_0x48ff('0x49')](_0x49bd8c['query'][_0x48ff('0x49')]);_0x1415c7[_0x48ff('0x4a')]=qs[_0x48ff('0x4b')](_['pick'](_0x49bd8c[_0x48ff('0x41')],_0x453fc6[_0x48ff('0x4b')]),_0x487fef);if(_0x49bd8c[_0x48ff('0x41')][_0x48ff('0x4c')]){_0x1415c7[_0x48ff('0x4a')]=_[_0x48ff('0x4d')](_0x1415c7['where'],{'$or':_['map'](_0x487fef,function(_0x1bd4a6){if(_0x1bd4a6[_0x48ff('0x4e')]!=='VIRTUAL'){var _0x4fdcf9={};_0x4fdcf9[_0x1bd4a6[_0x48ff('0x3b')]]={'$like':'%'+_0x49bd8c[_0x48ff('0x41')][_0x48ff('0x4c')]+'%'};return _0x4fdcf9;}})});}_0x1415c7=_['merge']({},_0x1415c7,_0x49bd8c[_0x48ff('0x4f')]);var _0x49525d={'where':_0x1415c7['where']};return db[_0x48ff('0x3e')][_0x48ff('0x33')](_0x49525d)[_0x48ff('0x38')](function(_0x44acf1){_0x309fc2[_0x48ff('0x33')]=_0x44acf1;if(_0x49bd8c[_0x48ff('0x41')][_0x48ff('0x50')]){_0x1415c7[_0x48ff('0x51')]=[{'all':!![]}];}return db['SmsMessage'][_0x48ff('0x52')](_0x1415c7);})[_0x48ff('0x38')](function(_0x46277d){_0x309fc2[_0x48ff('0x53')]=_0x46277d;return _0x309fc2;})['then'](respondWithFilteredResult(_0x907224,_0x1415c7))['catch'](handleError(_0x907224,null));};exports[_0x48ff('0x54')]=function(_0x1fe92f,_0x36d7f0){var _0x319955={'raw':!![],'where':{'id':_0x1fe92f[_0x48ff('0x55')]['id']}},_0x4aa32d={};_0x4aa32d[_0x48ff('0x56')]=_[_0x48ff('0x42')](db[_0x48ff('0x3e')][_0x48ff('0x57')]);_0x4aa32d[_0x48ff('0x41')]=_[_0x48ff('0x42')](_0x1fe92f[_0x48ff('0x41')]);_0x4aa32d[_0x48ff('0x4b')]=_[_0x48ff('0x43')](_0x4aa32d['model'],_0x4aa32d['query']);_0x319955[_0x48ff('0x44')]=_['intersection'](_0x4aa32d[_0x48ff('0x56')],qs['fields'](_0x1fe92f[_0x48ff('0x41')]['fields']));_0x319955[_0x48ff('0x44')]=_0x319955[_0x48ff('0x44')]['length']?_0x319955['attributes']:_0x4aa32d['model'];if(_0x1fe92f[_0x48ff('0x41')][_0x48ff('0x50')]){_0x319955[_0x48ff('0x51')]=[{'all':!![]}];}_0x319955=_[_0x48ff('0x4d')]({},_0x319955,_0x1fe92f[_0x48ff('0x4f')]);return db[_0x48ff('0x3e')][_0x48ff('0x58')](_0x319955)[_0x48ff('0x38')](handleEntityNotFound(_0x36d7f0,null))['then'](respondWithResult(_0x36d7f0,null))[_0x48ff('0x2b')](handleError(_0x36d7f0,null));};exports[_0x48ff('0x59')]=function(_0x42b290,_0x4235bc){return db[_0x48ff('0x3e')][_0x48ff('0x59')](_0x42b290[_0x48ff('0x5a')],{})[_0x48ff('0x38')](respondWithResult(_0x4235bc,0xc9))['catch'](handleError(_0x4235bc,null));};exports['update']=function(_0x308851,_0x449f4d){if(_0x308851[_0x48ff('0x5a')]['id']){delete _0x308851[_0x48ff('0x5a')]['id'];}return db[_0x48ff('0x3e')]['find']({'where':{'id':_0x308851[_0x48ff('0x55')]['id']}})['then'](handleEntityNotFound(_0x449f4d,null))[_0x48ff('0x38')](saveUpdates(_0x308851[_0x48ff('0x5a')],null))[_0x48ff('0x38')](respondWithResult(_0x449f4d,null))[_0x48ff('0x2b')](handleError(_0x449f4d,null));};exports[_0x48ff('0x39')]=function(_0x374a59,_0x589e71){return db[_0x48ff('0x3e')]['find']({'where':{'id':_0x374a59[_0x48ff('0x55')]['id']}})['then'](handleEntityNotFound(_0x589e71,null))[_0x48ff('0x38')](removeEntity(_0x589e71,null))[_0x48ff('0x2b')](handleError(_0x589e71,null));};exports['describe']=function(_0x4a7293,_0x3440b3){return db[_0x48ff('0x3e')]['describe']()['then'](respondWithResult(_0x3440b3,null))[_0x48ff('0x2b')](handleError(_0x3440b3,null));};var interaction_log=require(_0x48ff('0x14'))('sms-interactions');exports[_0x48ff('0x5b')]=function(_0x26e902,_0x5dd5ce,_0x1a303f){var _0x24026e={'agent':{},'channel':_0x48ff('0x5c')};if(_0x26e902[_0x48ff('0x5a')]['id']){delete _0x26e902[_0x48ff('0x5a')]['id'];}_0x26e902[_0x48ff('0x5a')][_0x48ff('0x5d')]=!![];_0x26e902[_0x48ff('0x5a')][_0x48ff('0x5e')]=moment()[_0x48ff('0x5f')](_0x48ff('0x60'));_0x26e902['body']['UserId']=_0x26e902[_0x48ff('0x5a')][_0x48ff('0x61')]||_0x26e902['user']['id'];_0x24026e['agent']['id']=_0x26e902[_0x48ff('0x5a')][_0x48ff('0x61')];return db['SmsMessage'][_0x48ff('0x58')]({'where':{'id':_0x26e902[_0x48ff('0x55')]['id'],'UserId':null}})[_0x48ff('0x38')](handleEntityNotFound(_0x5dd5ce,null))[_0x48ff('0x38')](saveUpdates(_0x26e902[_0x48ff('0x5a')],null))[_0x48ff('0x38')](function(_0x315413){if(_0x315413){_0x24026e[_0x48ff('0x28')]=_0x315413['get']({'plain':!![]});return db[_0x48ff('0x62')][_0x48ff('0x58')]({'where':{'id':_0x315413[_0x48ff('0x63')]}});}return null;})[_0x48ff('0x38')](handleEntityNotFound(_0x5dd5ce,null))[_0x48ff('0x38')](function(_0x5a9bfc){if(_0x5a9bfc){return _0x5a9bfc[_0x48ff('0x64')]({'UserId':_0x26e902[_0x48ff('0x5a')][_0x48ff('0x61')],'read1stAt':_[_0x48ff('0x65')](_0x5a9bfc[_0x48ff('0x66')])?moment()[_0x48ff('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x48ff('0x38')](function(_0x3ef9c6){if(_0x3ef9c6){_0x24026e[_0x48ff('0x67')]=_0x3ef9c6[_0x48ff('0x68')]({'plain':!![]});interaction_log[_0x48ff('0x23')](_0x48ff('0x69'),_0x26e902[_0x48ff('0x6a')]['id'],_0x26e902[_0x48ff('0x6a')][_0x48ff('0x3b')],_0x26e902[_0x48ff('0x6a')][_0x48ff('0x6b')],_0x24026e[_0x48ff('0x67')]['id'],_0x26e902[_0x48ff('0x5a')]?JSON[_0x48ff('0x26')](_0x26e902[_0x48ff('0x5a')]):_0x48ff('0x6c'));return respondWithRpcPromise('AcceptMessage',_0x48ff('0x6d'),_0x24026e);}return null;})[_0x48ff('0x38')](function(_0xd8eafc){var _0x21f422='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd8eafc[_0x48ff('0x28')][_0x48ff('0x6e')];return db[_0x48ff('0x6f')][_0x48ff('0x41')](_0x21f422,{'type':db['Sequelize'][_0x48ff('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x3d50d3){return _0x3d50d3;});})[_0x48ff('0x38')](function(_0x407ccb){if(_0x407ccb){_0x24026e[_0x48ff('0x28')][_0x48ff('0x71')]=_0x407ccb[0x0];if(!_0x26e902[_0x48ff('0x5a')][_0x48ff('0x61')])return;return db[_0x48ff('0x72')][_0x48ff('0x58')]({'where':{'id':_0x26e902[_0x48ff('0x5a')][_0x48ff('0x61')],'role':_0x48ff('0x73')},'attributes':['id','name',_0x48ff('0x74'),'email',_0x48ff('0x75')],'raw':!![]});}return null;})[_0x48ff('0x38')](function(_0x5603ef){if(!_0x5603ef)return null;_0x24026e[_0x48ff('0x28')][_0x48ff('0x73')]=_0x5603ef;return _0x24026e;})[_0x48ff('0x38')](function(_0x21c46f){if(_0x21c46f){if(_0x26e902[_0x48ff('0x5a')][_0x48ff('0x76')]){_0x24026e[_0x48ff('0x28')]['interface']=util[_0x48ff('0x5f')](_0x48ff('0x77'),_0x26e902['user'][_0x48ff('0x3b')]);_0x24026e[_0x48ff('0x28')][_0x48ff('0x78')]=_0x24026e[_0x48ff('0x78')];_0x24026e[_0x48ff('0x28')][_0x48ff('0x79')]=_0x24026e[_0x48ff('0x78')];_0x24026e['message'][_0x48ff('0x7a')]=_0x48ff('0x5b');return respondWithRpcPromise(_0x48ff('0x7b'),_0x48ff('0x7b'),{'event':'acceptmessage','message':_0x24026e[_0x48ff('0x28')]},client9002)['then'](function(){return _0x24026e;});}return _0x24026e;}return null;})[_0x48ff('0x38')](respondWithResult(_0x5dd5ce,null))[_0x48ff('0x2b')](handleError(_0x5dd5ce,null));};var interaction_log=require(_0x48ff('0x14'))(_0x48ff('0x7c'));exports[_0x48ff('0x36')]=function(_0x3870d2,_0x5e84f1,_0x59c94b){var _0x144fd2={'agent':{},'channel':'sms'};if(_0x3870d2[_0x48ff('0x5a')]['id']){delete _0x3870d2[_0x48ff('0x5a')]['id'];}_0x3870d2[_0x48ff('0x5a')][_0x48ff('0x61')]=_0x3870d2[_0x48ff('0x5a')][_0x48ff('0x61')]||_0x3870d2[_0x48ff('0x6a')]['id'];_0x144fd2[_0x48ff('0x73')]['id']=_0x3870d2[_0x48ff('0x5a')]['UserId'];return db[_0x48ff('0x3e')][_0x48ff('0x58')]({'where':{'id':_0x3870d2[_0x48ff('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5e84f1,null))[_0x48ff('0x38')](function(_0x11c74b){if(_0x11c74b){_0x144fd2[_0x48ff('0x28')]=_0x11c74b[_0x48ff('0x68')]({'plain':!![]});return db[_0x48ff('0x62')][_0x48ff('0x58')]({'where':{'id':_0x11c74b[_0x48ff('0x63')]}});}return null;})[_0x48ff('0x38')](handleEntityNotFound(_0x5e84f1,null))[_0x48ff('0x38')](function(_0x256b6a){if(_0x256b6a){_0x144fd2[_0x48ff('0x67')]=_0x256b6a[_0x48ff('0x68')]({'plain':!![]});interaction_log[_0x48ff('0x23')](_0x48ff('0x7d'),_0x3870d2[_0x48ff('0x6a')]['id'],_0x3870d2[_0x48ff('0x6a')][_0x48ff('0x3b')],_0x3870d2[_0x48ff('0x6a')][_0x48ff('0x6b')],_0x144fd2[_0x48ff('0x67')]['id'],_0x3870d2['body']?JSON[_0x48ff('0x26')](_0x3870d2[_0x48ff('0x5a')]):_0x48ff('0x6c'));return respondWithRpcPromise('RejectMessage',_0x48ff('0x7e'),_0x144fd2);}return null;})[_0x48ff('0x38')](function(_0x2715da){var _0x2fbb10=_0x48ff('0x7f')+_0x2715da['message'][_0x48ff('0x6e')];return db[_0x48ff('0x6f')][_0x48ff('0x41')](_0x2fbb10,{'type':db['Sequelize'][_0x48ff('0x70')][_0x48ff('0x80')],'raw':!![]})[_0x48ff('0x38')](function(_0x21fee8){return _0x21fee8;});})[_0x48ff('0x38')](function(_0x2bff32){if(_0x2bff32){_0x144fd2[_0x48ff('0x28')][_0x48ff('0x71')]=_0x2bff32[0x0];if(!_0x3870d2['body'][_0x48ff('0x61')])return;return db[_0x48ff('0x72')][_0x48ff('0x58')]({'where':{'id':_0x3870d2[_0x48ff('0x5a')]['UserId'],'role':_0x48ff('0x73')},'attributes':['id',_0x48ff('0x3b'),'fullname',_0x48ff('0x81'),_0x48ff('0x75')],'raw':!![]});}return null;})['then'](function(_0x1222aa){if(!_0x1222aa)return null;_0x144fd2[_0x48ff('0x28')]['agent']=_0x1222aa;return _0x144fd2;})[_0x48ff('0x38')](function(_0x2d9766){if(_0x2d9766){_0x2d9766['message'][_0x48ff('0x82')]=util[_0x48ff('0x5f')]('SIP/%s',_0x3870d2[_0x48ff('0x6a')][_0x48ff('0x3b')]);_0x2d9766['message'][_0x48ff('0x78')]=_0x144fd2[_0x48ff('0x78')];_0x2d9766[_0x48ff('0x28')][_0x48ff('0x79')]=_0x144fd2[_0x48ff('0x78')];_0x2d9766[_0x48ff('0x28')]['event']=_0x48ff('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0x48ff('0x83'),'message':_0x2d9766[_0x48ff('0x28')]},client9002);return _0x144fd2;}return null;})['then'](respondWithResult(_0x5e84f1,null))[_0x48ff('0x2b')](handleError(_0x5e84f1,null));};exports[_0x48ff('0x2d')]=function(_0x164f7a,_0xd737b0,_0xabfd5f){if(_0x164f7a[_0x48ff('0x5a')]['id']){delete _0x164f7a[_0x48ff('0x5a')]['id'];}var _0x107d6f;return db[_0x48ff('0x3e')][_0x48ff('0x58')]({'where':{'id':_0x164f7a['params']['id']}})[_0x48ff('0x38')](handleEntityNotFound(_0xd737b0,null))[_0x48ff('0x38')](function(_0x43db5e){if(_0x43db5e){_0x107d6f=_0x43db5e;return db[_0x48ff('0x84')][_0x48ff('0x58')]({'where':{'id':_0x43db5e['SmsAccountId']}});}})[_0x48ff('0x38')](handleEntityNotFound(_0xd737b0,null))[_0x48ff('0x38')](function(_0x1f3b67){if(_0x1f3b67){logger[_0x48ff('0x25')](_0x48ff('0x85'),_0x48ff('0x2d'),_0x48ff('0x86'),_0x1f3b67['type'],util[_0x48ff('0x87')](_0x164f7a[_0x48ff('0x5a')],{'showHidden':![],'depth':null}));switch(_0x1f3b67[_0x48ff('0x4e')]){case _0x48ff('0x88'):if(_0x164f7a[_0x48ff('0x5a')][_0x48ff('0x89')]&&_0x164f7a[_0x48ff('0x5a')][_0x48ff('0x89')]===_0x107d6f[_0x48ff('0x8a')]){return _0x107d6f[_0x48ff('0x64')]({'read':!![]});}else{logger[_0x48ff('0x27')](_0x48ff('0x8b'),'status',_0x48ff('0x88'),util['inspect'](_0x164f7a['body'],{'showHidden':![],'depth':null}));}break;case _0x48ff('0x8c'):if(_0x164f7a[_0x48ff('0x5a')][_0x48ff('0x8d')]&&_0x164f7a['body']['MessageUUID']===_0x107d6f[_0x48ff('0x8a')]&&_[_0x48ff('0x8e')]([_0x48ff('0x8f'),_0x48ff('0x90')],_0x164f7a['body'][_0x48ff('0x91')])>=0x0){return _0x107d6f[_0x48ff('0x64')]({'read':!![]});}else{logger['error'](_0x48ff('0x8b'),_0x48ff('0x2d'),'plivio',util[_0x48ff('0x87')](_0x164f7a['body'],{'showHidden':![],'depth':null}));}break;case _0x48ff('0x92'):var _0x99f468=_0x164f7a['body'][_0x48ff('0x93')][0x0];if(_0x99f468[_0x48ff('0x2d')][_0x48ff('0x94')]===_0x48ff('0x95')){return _0x107d6f[_0x48ff('0x64')]({'read':!![]});}else{logger[_0x48ff('0x27')](_0x48ff('0x8b'),_0x48ff('0x2d'),'infobip',util[_0x48ff('0x87')](_0x164f7a[_0x48ff('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x107d6f;}})[_0x48ff('0x38')](respondWithResult(_0xd737b0,null))[_0x48ff('0x2b')](handleError(_0xd737b0,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index aec1b04..bf969f1 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 _0x1486=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x301038,_0x44026e){var _0x27e231=function(_0x110d25){while(--_0x110d25){_0x301038['push'](_0x301038['shift']());}};_0x27e231(++_0x44026e);}(_0x1486,0x135));var _0x6148=function(_0x31cf55,_0x269351){_0x31cf55=_0x31cf55-0x0;var _0x35955c=_0x1486[_0x31cf55];return _0x35955c;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x6148('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6148('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6148('0x2'),'afterDestroy':_0x6148('0x3')};function emitEvent(_0x21e14e){return function(_0x29d4bf,_0x5d383a,_0x492693){SmsMessageEvents[_0x6148('0x4')](_0x21e14e+':'+_0x29d4bf['id'],_0x29d4bf);SmsMessageEvents[_0x6148('0x4')](_0x21e14e,_0x29d4bf);_0x492693(null);};}for(var e in events){if(events[_0x6148('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0x6148('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x2070=['SmsMessage','setMaxListeners','save','remove','emit','hook'];(function(_0x1e83fb,_0x295af8){var _0x27915f=function(_0x5b1815){while(--_0x5b1815){_0x1e83fb['push'](_0x1e83fb['shift']());}};_0x27915f(++_0x295af8);}(_0x2070,0x78));var _0x0207=function(_0x1eb7ce,_0x12ad57){_0x1eb7ce=_0x1eb7ce-0x0;var _0x60a83d=_0x2070[_0x1eb7ce];return _0x60a83d;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0x0207('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0207('0x1')](0x0);var events={'afterCreate':_0x0207('0x2'),'afterUpdate':'update','afterDestroy':_0x0207('0x3')};function emitEvent(_0x2d904c){return function(_0x142b21,_0x4e3d59,_0x3b92bc){SmsMessageEvents[_0x0207('0x4')](_0x2d904c+':'+_0x142b21['id'],_0x142b21);SmsMessageEvents[_0x0207('0x4')](_0x2d904c,_0x142b21);_0x3b92bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x0207('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index c3271bd..1bbb613 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 _0xa70f=['infobip','Missing\x20parameters:\x20base_url','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','sms','POST','user_key','total_sent','internal_order_id','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','data','message_id','update','clickSend','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','plivo','baseUrl','/auth/1/session','/sms/2/text/advanced','/api/sms/messages/','application/json','IBSSO\x20'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xa70f,0x9a));var _0xfa70=function(_0x72254b,_0x5f4dba){_0x72254b=_0x72254b-0x0;var _0x22fc14=_0xa70f[_0x72254b];return _0x22fc14;};'use strict';var _=require(_0xfa70('0x0'));var util=require(_0xfa70('0x1'));var logger=require('../../config/logger')(_0xfa70('0x2'));var moment=require(_0xfa70('0x3'));var BPromise=require(_0xfa70('0x4'));var rp=require(_0xfa70('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfa70('0x6'));var config=require(_0xfa70('0x7'));var attributes=require(_0xfa70('0x8'));module['exports']=function(_0x5790b0,_0xe07164){return _0x5790b0[_0xfa70('0x9')](_0xfa70('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xfa70('0xb')]},{'name':_0xfa70('0xc'),'fields':[_0xfa70('0xd')],'type':_0xfa70('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc7a2a8,_0x38b67a,_0x55fcb4){var _0x5a4281=_0x5790b0[_0xfa70('0xf')];var _0x18c8c1=_0xc7a2a8['get']({'plain':!![]});if(_0x18c8c1[_0xfa70('0x10')][_0xfa70('0x11')]()==='in'||_0x18c8c1['direction'][_0xfa70('0x11')]()===_0xfa70('0x12')&&!_0x18c8c1[_0xfa70('0x13')]&&!_['isNil'](_0x18c8c1['UserId'])&&!_[_0xfa70('0x14')](_0x18c8c1[_0xfa70('0x15')])){_0x5a4281[_0xfa70('0x16')][_0xfa70('0x17')]({'where':{'id':_0x18c8c1[_0xfa70('0x15')]}})[_0xfa70('0x18')](function(_0x3eeabd){if(_0x3eeabd){_0x3eeabd['update']({'lastMsgAt':_0x18c8c1[_0xfa70('0x19')],'lastMsgDirection':_0x18c8c1[_0xfa70('0x10')][_0xfa70('0x11')]()});}})[_0xfa70('0x1a')](function(_0x465dab){console[_0xfa70('0x1b')](_0x465dab);});}if(_0x18c8c1[_0xfa70('0x10')]==='out'&&!_0x18c8c1[_0xfa70('0x13')]){var _0x428a12;_0x5a4281[_0xfa70('0x1c')]['find']({'where':{'id':_0x18c8c1[_0xfa70('0x1d')]},'raw':!![]})[_0xfa70('0x18')](function(_0x2f52d3){_0x428a12=_0x2f52d3;if(_0x428a12&&_0x428a12[_0xfa70('0x1e')]){switch(_0x428a12[_0xfa70('0x1e')]){case _0xfa70('0x1f'):var _0x463230=require('twilio');if(_0x428a12['accountSid']&&_0x428a12[_0xfa70('0x20')]&&_0x428a12[_0xfa70('0x21')]){var _0xe443b1=new _0x463230(_0x428a12[_0xfa70('0x22')],_0x428a12[_0xfa70('0x20')]);_0xe443b1[_0xfa70('0x23')][_0xfa70('0x24')]({'body':_0x18c8c1[_0xfa70('0xd')],'to':_0x18c8c1[_0xfa70('0x21')],'from':_0x428a12[_0xfa70('0x21')],'statusCallback':_0x428a12[_0xfa70('0x25')]+'/api/sms/messages/'+_0x18c8c1['id']+_0xfa70('0x26')+_0x428a12[_0xfa70('0x27')]})[_0xfa70('0x18')](function(_0x11ccd4){if(_0x11ccd4['sid']){return _0xc7a2a8['update']({'messageId':_0x11ccd4[_0xfa70('0x28')]});}})[_0xfa70('0x1a')](function(_0x929e82){logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x1f'),util[_0xfa70('0x2b')](_0x929e82,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x1f'),_0xfa70('0x2c'));}break;case'skebby':var _0x1ecdc6=_0xfa70('0x2d');if(_0x428a12[_0xfa70('0x2e')]&&_0x428a12[_0xfa70('0x2f')]){var _0x40d2be={'recipient':[_0x18c8c1[_0xfa70('0x21')]],'message':_0x18c8c1['body'],'message_type':_0x428a12['smsMethod']};if(_0x428a12['smsMethod']&&_0x428a12[_0xfa70('0x30')]!=='SI'){_0x40d2be[_0xfa70('0x31')]=_0x428a12['phone'];}var _0x445155={'url':_0x1ecdc6+_0xfa70('0x32')+_0x428a12[_0xfa70('0x2e')]+'&password='+_0x428a12[_0xfa70('0x2f')],'method':_0xfa70('0x33')};rp(_0x445155)[_0xfa70('0x18')](function(_0x1ef8ad){var _0x19bca1=_0x1ef8ad['split'](';');var _0x1c7c15={'user_key':_0x19bca1[0x0],'session_key':_0x19bca1[0x1]};_0x445155={'url':_0x1ecdc6+_0xfa70('0x34'),'method':_0xfa70('0x35'),'headers':{'user_key':_0x1c7c15[_0xfa70('0x36')],'Session_key':_0x1c7c15['session_key']},'json':!![],'body':_0x40d2be};return rp(_0x445155);})[_0xfa70('0x18')](function(_0x356976){if(_0x356976[_0xfa70('0x37')]>=0x1){var _0x253bb6={'messageId':_0x356976[_0xfa70('0x38')]};if(_0x428a12['smsMethod']!=='GP'||!_0x428a12['deliveryReport']){_0x253bb6[_0xfa70('0x39')]=!![];}return _0xc7a2a8['update'](_0x253bb6);}else{return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3a'),util[_0xfa70('0x2b')](_0x356976,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5ed322){return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3a'),util[_0xfa70('0x2b')](_0x5ed322,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3a'),_0xfa70('0x3b'));}break;case _0xfa70('0x3c'):if(_0x428a12['authToken']){var _0x595c9a={'recipient':_0x18c8c1[_0xfa70('0x21')],'message':_0x18c8c1[_0xfa70('0xd')],'sender':_0x428a12[_0xfa70('0x3d')]||_0x428a12[_0xfa70('0x21')],'authorization':_0x428a12[_0xfa70('0x20')]};var _0x38b67a={'method':_0xfa70('0x35'),'uri':_0xfa70('0x3e'),'body':_0x595c9a,'json':!![]};rp(_0x38b67a)['then'](function(_0x4877c2){var _0x4309f9={'messageId':_0x4877c2[_0xfa70('0x3f')]};if(!_0x428a12[_0xfa70('0x40')]){_0x4309f9[_0xfa70('0x39')]=!![];}return _0xc7a2a8['update'](_0x4309f9);})[_0xfa70('0x1a')](function(_0x4c6abf){logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3c'),util[_0xfa70('0x2b')](_0x4c6abf,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x3c'),_0xfa70('0x41'));}break;case _0xfa70('0x42'):if(_0x428a12[_0xfa70('0x2e')]&&_0x428a12['password']){var _0x595c9a={'messages':[{'source':'xCALLY\x20Motion','to':_0x18c8c1[_0xfa70('0x21')],'body':_0x18c8c1[_0xfa70('0xd')],'from':_0x428a12['senderString']||_0x428a12['phone']}]};var _0x5ba81e=util[_0xfa70('0x43')]('%s:%s',_0x428a12[_0xfa70('0x2e')],_0x428a12[_0xfa70('0x2f')]);var _0x38b67a={'method':'POST','uri':_0xfa70('0x44'),'body':_0x595c9a,'headers':{'Authorization':util[_0xfa70('0x43')](_0xfa70('0x45'),new Buffer(_0x5ba81e)[_0xfa70('0x46')](_0xfa70('0x47')))},'json':!![]};rp(_0x38b67a)[_0xfa70('0x18')](function(_0x6542a1){if(_0x6542a1['http_code']>=0xc8&&_0x6542a1['http_code']<=0xce){if(_0x6542a1['data']&&_0x6542a1[_0xfa70('0x48')]['queued_count']>0x0){var _0x50fb00=_['head'](_0x6542a1[_0xfa70('0x48')][_0xfa70('0x23')]);var _0x3d984c={'messageId':_0x50fb00[_0xfa70('0x49')]};if(!_0x428a12[_0xfa70('0x40')]){_0x3d984c['read']=!![];}return _0xc7a2a8[_0xfa70('0x4a')](_0x3d984c);}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x4b'),util[_0xfa70('0x2b')](_0x6542a1,{'showHidden':![],'depth':null}));}}else{logger[_0xfa70('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfa70('0x2a'),'clickSend',util[_0xfa70('0x2b')](_0x6542a1,{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x483390){logger[_0xfa70('0x1b')](_0xfa70('0x29'),'afterCreate',_0xfa70('0x4b'),util['inspect'](_0x483390,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x4b'),_0xfa70('0x3b'));}break;case'plivo':if(_0x428a12[_0xfa70('0x4c')]&&_0x428a12['authToken']){var _0x595c9a={'dst':_0x18c8c1[_0xfa70('0x21')],'text':_0x18c8c1[_0xfa70('0xd')],'src':_0x428a12[_0xfa70('0x3d')]||_0x428a12[_0xfa70('0x21')],'url':_0x428a12['remote']+'/api/sms/messages/'+_0x18c8c1['id']+'/status?token='+_0x428a12['token']};var _0x5ba81e=util[_0xfa70('0x43')](_0xfa70('0x4d'),_0x428a12[_0xfa70('0x4c')],_0x428a12['authToken']);var _0x38b67a={'method':_0xfa70('0x35'),'uri':util[_0xfa70('0x43')](_0xfa70('0x4e'),_0x428a12[_0xfa70('0x4c')]),'body':_0x595c9a,'headers':{'Authorization':util[_0xfa70('0x43')](_0xfa70('0x45'),new Buffer(_0x5ba81e)[_0xfa70('0x46')](_0xfa70('0x47')))},'json':!![]};rp(_0x38b67a)[_0xfa70('0x18')](function(_0x32bd04){var _0x56b53a={'messageId':_0x32bd04['message_uuid'][0x0]};return _0xc7a2a8[_0xfa70('0x4a')](_0x56b53a);})[_0xfa70('0x1a')](function(_0x1ba928){logger[_0xfa70('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfa70('0x2a'),_0xfa70('0x4f'),util[_0xfa70('0x2b')](_0x1ba928,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x428a12[_0xfa70('0x2e')]&&_0x428a12[_0xfa70('0x2f')]){if(_0x428a12[_0xfa70('0x50')]){var _0x28e8ca={'method':'POST','uri':_0x428a12[_0xfa70('0x50')]+_0xfa70('0x51'),'body':{'username':_0x428a12['username'],'password':_0x428a12[_0xfa70('0x2f')]},'json':!![]};return rp(_0x28e8ca)['then'](function(_0x188fb2){var _0x2a81e4={'method':_0xfa70('0x35'),'uri':_0x428a12[_0xfa70('0x50')]+_0xfa70('0x52'),'body':{'messages':[{'from':_0x428a12['phone'],'destinations':[{'to':_0x18c8c1['phone']}],'text':_0x18c8c1[_0xfa70('0xd')],'notifyUrl':_0x428a12[_0xfa70('0x25')]+_0xfa70('0x53')+_0x18c8c1['id']+_0xfa70('0x26')+_0x428a12[_0xfa70('0x27')],'notifyContentType':_0xfa70('0x54'),'callbackData':_0x428a12[_0xfa70('0x21')]+';'+_0x18c8c1[_0xfa70('0xd')]}]},'headers':{'Authorization':_0xfa70('0x55')+_0x188fb2[_0xfa70('0x27')]},'json':!![]};return rp(_0x2a81e4)['then'](function(_0x2174bb){if(_0x2174bb[_0xfa70('0x23')]){var _0x193551={'messageId':_0x2174bb[_0xfa70('0x23')][0x0][_0xfa70('0xb')]};if(!_0x428a12[_0xfa70('0x40')]){_0x193551['read']=!![];}return _0xc7a2a8[_0xfa70('0x4a')](_0x193551);}else{return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x56'),util[_0xfa70('0x2b')](_0x2174bb,{'showHidden':![],'depth':null}));}});})[_0xfa70('0x1a')](function(_0x22ee29){return logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x56'),util['inspect'](_0x22ee29,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),'afterCreate','infobip',_0xfa70('0x57'));}}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),'afterCreate',_0xfa70('0x56'),_0xfa70('0x3b'));}break;case'csc':var _0x1f4eac=require(_0xfa70('0x58'));if(_0x428a12[_0xfa70('0x59')]){var _0x2584fb={};_0x2584fb[_0xfa70('0x5a')]=_0x428a12[_0xfa70('0x2e')];_0x2584fb[_0xfa70('0x21')]=_0x18c8c1[_0xfa70('0x21')];_0x2584fb[_0xfa70('0x31')]=_0x428a12['phone'];_0x2584fb[_0xfa70('0x5b')]=_0x18c8c1['body'];_0x2584fb[_0xfa70('0x5c')]=+new Date();var _0x4c5a91='';var _0x1b6493='';var _0x367fa2=Object[_0xfa70('0x5d')](_0x2584fb);_0x367fa2[_0xfa70('0x5e')]();for(var _0x494b3f=0x0;_0x494b3f<_0x367fa2[_0xfa70('0x5f')];_0x494b3f++){if(_0x4c5a91!=''){_0x4c5a91+='&';}_0x4c5a91+=_0x367fa2[_0x494b3f]+'='+encodeURIComponent(_0x2584fb[_0x367fa2[_0x494b3f]]);_0x1b6493+=_0x2584fb[_0x367fa2[_0x494b3f]];}_0x1b6493+=_0x428a12['apiKey'];_0x1b6493=_0x1f4eac[_0xfa70('0x60')](_0xfa70('0x61'))['update'](_0x1b6493)[_0xfa70('0x62')](_0xfa70('0x63'));if(_0x4c5a91!==''){_0x4c5a91+='&';}_0x4c5a91+=_0xfa70('0x64')+_0x1b6493;var _0x445155={'method':_0xfa70('0x33'),'uri':_0x428a12[_0xfa70('0x50')]+'/external/get/send.php?'+_0x4c5a91,'json':!![]};return rp(_0x445155)['then'](function(_0xf8864c){var _0x1a3987=Object['keys'](_0xf8864c);if(_0xf8864c[_0x1a3987[0x0]][_0xfa70('0x1b')]&&parseInt(_0xf8864c[_0x1a3987[0x0]][_0xfa70('0x1b')])===0x0){var _0x59ca78={'messageId':_0xf8864c[_0x1a3987[0x0]]['id_sms']};if(!_0x428a12[_0xfa70('0x40')]){_0x59ca78[_0xfa70('0x39')]=!![];}return _0xc7a2a8['update'](_0x59ca78);}else{return logger[_0xfa70('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util['inspect'](_0xf8864c[_0xfa70('0x1b')],{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x302104){return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x65'),util[_0xfa70('0x2b')](_0x302104,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x65'),_0xfa70('0x66'));}break;case _0xfa70('0x67'):if(_0x428a12[_0xfa70('0x59')]){var _0x1a06ed={'method':_0xfa70('0x35'),'uri':_0xfa70('0x68'),'headers':{'Authorization':_0x428a12[_0xfa70('0x59')]},'body':{'content':_0x18c8c1[_0xfa70('0xd')],'to':[_0x18c8c1[_0xfa70('0x21')]],'from':_0x428a12['phone'],'binary':![],'clientMessageId':_0xfa70('0x69'),'charset':_0xfa70('0x6a')},'json':!![]};rp(_0x1a06ed)[_0xfa70('0x18')](function(_0x1e02b7){if(!_0x1e02b7[_0xfa70('0x1b')]){var _0x39be43={'messageId':_0x1e02b7[_0xfa70('0x23')][0x0]['apiMessageId']};if(!_0x428a12[_0xfa70('0x40')]){_0x39be43['read']=!![];}return _0xc7a2a8['update'](_0x39be43);}else{return logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),'clickatell',util[_0xfa70('0x2b')](_0x1e02b7[_0xfa70('0x1b')],{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x194281){return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x67'),util[_0xfa70('0x2b')](_0x194281,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x67'),_0xfa70('0x66'));}break;case _0xfa70('0x6b'):if(_0x428a12[_0xfa70('0x2e')]&&_0x428a12[_0xfa70('0x2f')]){var _0x5ba81e=util['format']('%s:%s',_0x428a12[_0xfa70('0x2e')],_0x428a12[_0xfa70('0x2f')]);var _0x38b67a={'method':_0xfa70('0x35'),'uri':_0xfa70('0x6c')+_0x428a12[_0xfa70('0x6d')]+'/messages','body':{'to':[_0x18c8c1[_0xfa70('0x21')]],'text':_0x18c8c1[_0xfa70('0xd')],'from':_0x428a12[_0xfa70('0x21')],'applicationId':_0x428a12[_0xfa70('0x6e')]},'headers':{'Authorization':util[_0xfa70('0x43')](_0xfa70('0x45'),new Buffer(_0x5ba81e)[_0xfa70('0x46')](_0xfa70('0x47')))},'json':!![]};rp(_0x38b67a)[_0xfa70('0x18')](function(_0x4fdd35){if(_0x4fdd35['id']){var _0x5e870b={'messageId':_0x4fdd35['id']};return _0xc7a2a8[_0xfa70('0x4a')](_0x5e870b);}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),'afterCreate',_0xfa70('0x6b'),util['inspect'](_0x4fdd35,{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x11c4d6){logger[_0xfa70('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfa70('0x2a'),_0xfa70('0x6b'),util['inspect'](_0x11c4d6,{'showHidden':![],'depth':null}));});}else{logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x6b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xfa70('0x6f'):if(_0x428a12[_0xfa70('0x59')]){var _0x1f4192={};var _0x445155={'method':_0xfa70('0x35'),'uri':_0xfa70('0x70'),'headers':{'Authorization':_0xfa70('0x71')+_0x428a12[_0xfa70('0x59')],'Content-Type':_0xfa70('0x54')},'body':{'from':_0x428a12[_0xfa70('0x21')],'to':_0x18c8c1[_0xfa70('0x21')],'text':_0x18c8c1[_0xfa70('0xd')]},'json':!![]};return rp(_0x445155)[_0xfa70('0x18')](function(_0x5a9623){if(_0x5a9623[_0xfa70('0x72')]==0xca){_0x1f4192[_0xfa70('0x73')]=_0x5a9623;var _0x14bbc9={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xfa70('0x71')+_0x428a12[_0xfa70('0x59')],'Content-Type':'application/json'},'body':{'refid':_0x1f4192[_0xfa70('0x73')]['refid']},'json':!![]};return rp(_0x14bbc9)[_0xfa70('0x18')](function(_0x484c9b){_0x1f4192['status']=_0x484c9b;var _0x11bdff={'messageId':_0x1f4192[_0xfa70('0x73')][_0xfa70('0x74')],'read':!![]};return _0xc7a2a8['update'](_0x11bdff);});}else{return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x6f'),util[_0xfa70('0x2b')](_0x5a9623,{'showHidden':![],'depth':null}));}})[_0xfa70('0x1a')](function(_0x2e34cf){return logger['error'](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x6f'),util[_0xfa70('0x2b')](_0x2e34cf,{'showHidden':![],'depth':null}));});}else{return logger[_0xfa70('0x1b')](_0xfa70('0x29'),_0xfa70('0x2a'),_0xfa70('0x6f'),_0xfa70('0x75'));}break;}}})[_0xfa70('0x76')](function(){_0x55fcb4();});}else{_0x55fcb4();}}},'charset':'utf8mb4','collate':_0xfa70('0x77')});}; \ No newline at end of file +var _0x1a74=['createdAt','catch','error','SmsAccount','find','type','twilio','authToken','messages','create','phone','/api/sms/messages/','/status?token=','sid','update','afterCreate','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','password','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','user_key','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','plivo','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','authId','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','token','Missing\x20parameters:\x20base_url','crypto','login','timestamp','keys','length','createHash','md5','digest','signature=','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','apiKey','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','findOne','then'];(function(_0x1b71db,_0x223f67){var _0x47dfd1=function(_0x1aa0e8){while(--_0x1aa0e8){_0x1b71db['push'](_0x1b71db['shift']());}};_0x47dfd1(++_0x223f67);}(_0x1a74,0x1bf));var _0x41a7=function(_0x859d2,_0x70c7f1){_0x859d2=_0x859d2-0x0;var _0x3edc05=_0x1a74[_0x859d2];return _0x3edc05;};'use strict';var _=require(_0x41a7('0x0'));var util=require(_0x41a7('0x1'));var logger=require('../../config/logger')(_0x41a7('0x2'));var moment=require(_0x41a7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x41a7('0x4'));var rimraf=require(_0x41a7('0x5'));var config=require('../../config/environment');var attributes=require(_0x41a7('0x6'));module[_0x41a7('0x7')]=function(_0x4c1214,_0x118f2e){return _0x4c1214[_0x41a7('0x8')](_0x41a7('0x9'),attributes,{'tableName':_0x41a7('0xa'),'paranoid':![],'indexes':[{'name':_0x41a7('0xb'),'fields':[_0x41a7('0xb')]},{'name':'fti_sms_messages','fields':[_0x41a7('0xc')],'type':_0x41a7('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x879086,_0x46a0b9,_0x4b5fe3){var _0x51baa4=_0x4c1214[_0x41a7('0xe')];var _0x46a501=_0x879086[_0x41a7('0xf')]({'plain':!![]});if(_0x46a501[_0x41a7('0x10')][_0x41a7('0x11')]()==='in'||_0x46a501[_0x41a7('0x10')]['toLowerCase']()===_0x41a7('0x12')&&!_0x46a501[_0x41a7('0x13')]&&!_[_0x41a7('0x14')](_0x46a501[_0x41a7('0x15')])&&!_[_0x41a7('0x14')](_0x46a501[_0x41a7('0x16')])){_0x51baa4['SmsInteraction'][_0x41a7('0x17')]({'where':{'id':_0x46a501[_0x41a7('0x16')]}})[_0x41a7('0x18')](function(_0x4d6c6a){if(_0x4d6c6a){_0x4d6c6a['update']({'lastMsgAt':_0x46a501[_0x41a7('0x19')],'lastMsgDirection':_0x46a501[_0x41a7('0x10')][_0x41a7('0x11')]()});}})[_0x41a7('0x1a')](function(_0x3cbe90){console[_0x41a7('0x1b')](_0x3cbe90);});}if(_0x46a501['direction']===_0x41a7('0x12')&&!_0x46a501[_0x41a7('0x13')]){var _0x4ec644;_0x51baa4[_0x41a7('0x1c')][_0x41a7('0x1d')]({'where':{'id':_0x46a501['SmsAccountId']},'raw':!![]})['then'](function(_0x17df4a){_0x4ec644=_0x17df4a;if(_0x4ec644&&_0x4ec644[_0x41a7('0x1e')]){switch(_0x4ec644[_0x41a7('0x1e')]){case'twilio':var _0x3fc34c=require(_0x41a7('0x1f'));if(_0x4ec644['accountSid']&&_0x4ec644['authToken']&&_0x4ec644['phone']){var _0x1494f4=new _0x3fc34c(_0x4ec644['accountSid'],_0x4ec644[_0x41a7('0x20')]);_0x1494f4[_0x41a7('0x21')][_0x41a7('0x22')]({'body':_0x46a501['body'],'to':_0x46a501[_0x41a7('0x23')],'from':_0x4ec644[_0x41a7('0x23')],'statusCallback':_0x4ec644['remote']+_0x41a7('0x24')+_0x46a501['id']+_0x41a7('0x25')+_0x4ec644['token']})['then'](function(_0x507e74){if(_0x507e74[_0x41a7('0x26')]){return _0x879086[_0x41a7('0x27')]({'messageId':_0x507e74[_0x41a7('0x26')]});}})[_0x41a7('0x1a')](function(_0x31d13c){logger[_0x41a7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x41a7('0x28'),_0x41a7('0x1f'),util[_0x41a7('0x29')](_0x31d13c,{'showHidden':![],'depth':null}));});}else{logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x1f'),_0x41a7('0x2b'));}break;case'skebby':var _0x25155f='https://api.skebby.it/API/v1.0/REST/';if(_0x4ec644['username']&&_0x4ec644[_0x41a7('0x2c')]){var _0x47b52c={'recipient':[_0x46a501[_0x41a7('0x23')]],'message':_0x46a501[_0x41a7('0xc')],'message_type':_0x4ec644[_0x41a7('0x2d')]};if(_0x4ec644['smsMethod']&&_0x4ec644[_0x41a7('0x2d')]!=='SI'){_0x47b52c[_0x41a7('0x2e')]=_0x4ec644[_0x41a7('0x23')];}var _0x2720a6={'url':_0x25155f+_0x41a7('0x2f')+_0x4ec644[_0x41a7('0x30')]+_0x41a7('0x31')+_0x4ec644[_0x41a7('0x2c')],'method':_0x41a7('0x32')};rp(_0x2720a6)[_0x41a7('0x18')](function(_0x1609ab){var _0x308742=_0x1609ab[_0x41a7('0x33')](';');var _0x55f425={'user_key':_0x308742[0x0],'session_key':_0x308742[0x1]};_0x2720a6={'url':_0x25155f+_0x41a7('0x34'),'method':_0x41a7('0x35'),'headers':{'user_key':_0x55f425[_0x41a7('0x36')],'Session_key':_0x55f425['session_key']},'json':!![],'body':_0x47b52c};return rp(_0x2720a6);})[_0x41a7('0x18')](function(_0x47a676){if(_0x47a676['total_sent']>=0x1){var _0x3ab9e6={'messageId':_0x47a676['internal_order_id']};if(_0x4ec644[_0x41a7('0x2d')]!=='GP'||!_0x4ec644[_0x41a7('0x37')]){_0x3ab9e6[_0x41a7('0x38')]=!![];}return _0x879086['update'](_0x3ab9e6);}else{return logger['error'](_0x41a7('0x2a'),_0x41a7('0x28'),'skebby',util['inspect'](_0x47a676,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5dcee2){return logger[_0x41a7('0x1b')](_0x41a7('0x2a'),'afterCreate','skebby',util[_0x41a7('0x29')](_0x5dcee2,{'showHidden':![],'depth':null}));});}else{logger[_0x41a7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x41a7('0x28'),_0x41a7('0x39'),_0x41a7('0x3a'));}break;case'connectel':if(_0x4ec644[_0x41a7('0x20')]){var _0xa68f0c={'recipient':_0x46a501[_0x41a7('0x23')],'message':_0x46a501[_0x41a7('0xc')],'sender':_0x4ec644['senderString']||_0x4ec644[_0x41a7('0x23')],'authorization':_0x4ec644['authToken']};var _0x46a0b9={'method':_0x41a7('0x35'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0xa68f0c,'json':!![]};rp(_0x46a0b9)[_0x41a7('0x18')](function(_0x57a962){var _0x229b9c={'messageId':_0x57a962[_0x41a7('0x3b')]};if(!_0x4ec644[_0x41a7('0x37')]){_0x229b9c['read']=!![];}return _0x879086[_0x41a7('0x27')](_0x229b9c);})['catch'](function(_0x511ab5){logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x3c'),util['inspect'](_0x511ab5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x3c'),_0x41a7('0x3d'));}break;case _0x41a7('0x3e'):if(_0x4ec644[_0x41a7('0x30')]&&_0x4ec644[_0x41a7('0x2c')]){var _0xa68f0c={'messages':[{'source':_0x41a7('0x3f'),'to':_0x46a501['phone'],'body':_0x46a501[_0x41a7('0xc')],'from':_0x4ec644[_0x41a7('0x40')]||_0x4ec644['phone']}]};var _0x365702=util[_0x41a7('0x41')]('%s:%s',_0x4ec644[_0x41a7('0x30')],_0x4ec644['password']);var _0x46a0b9={'method':'POST','uri':_0x41a7('0x42'),'body':_0xa68f0c,'headers':{'Authorization':util['format'](_0x41a7('0x43'),new Buffer(_0x365702)[_0x41a7('0x44')](_0x41a7('0x45')))},'json':!![]};rp(_0x46a0b9)['then'](function(_0x59b3c7){if(_0x59b3c7[_0x41a7('0x46')]>=0xc8&&_0x59b3c7['http_code']<=0xce){if(_0x59b3c7[_0x41a7('0x47')]&&_0x59b3c7['data'][_0x41a7('0x48')]>0x0){var _0x58159d=_[_0x41a7('0x49')](_0x59b3c7[_0x41a7('0x47')][_0x41a7('0x21')]);var _0x257318={'messageId':_0x58159d['message_id']};if(!_0x4ec644[_0x41a7('0x37')]){_0x257318[_0x41a7('0x38')]=!![];}return _0x879086[_0x41a7('0x27')](_0x257318);}else{logger[_0x41a7('0x1b')](_0x41a7('0x2a'),'afterCreate',_0x41a7('0x4a'),util[_0x41a7('0x29')](_0x59b3c7,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x41a7('0x2a'),'afterCreate',_0x41a7('0x4a'),util['inspect'](_0x59b3c7,{'showHidden':![],'depth':null}));}})[_0x41a7('0x1a')](function(_0x50aaaa){logger['error'](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x4a'),util[_0x41a7('0x29')](_0x50aaaa,{'showHidden':![],'depth':null}));});}else{logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x4a'),_0x41a7('0x3a'));}break;case _0x41a7('0x4b'):if(_0x4ec644['authId']&&_0x4ec644[_0x41a7('0x20')]){var _0xa68f0c={'dst':_0x46a501[_0x41a7('0x23')],'text':_0x46a501[_0x41a7('0xc')],'src':_0x4ec644[_0x41a7('0x40')]||_0x4ec644[_0x41a7('0x23')],'url':_0x4ec644['remote']+'/api/sms/messages/'+_0x46a501['id']+_0x41a7('0x25')+_0x4ec644['token']};var _0x365702=util[_0x41a7('0x41')](_0x41a7('0x4c'),_0x4ec644['authId'],_0x4ec644[_0x41a7('0x20')]);var _0x46a0b9={'method':_0x41a7('0x35'),'uri':util[_0x41a7('0x41')](_0x41a7('0x4d'),_0x4ec644[_0x41a7('0x4e')]),'body':_0xa68f0c,'headers':{'Authorization':util['format'](_0x41a7('0x43'),new Buffer(_0x365702)[_0x41a7('0x44')]('base64'))},'json':!![]};rp(_0x46a0b9)['then'](function(_0x138b20){var _0x3034b1={'messageId':_0x138b20[_0x41a7('0x4f')][0x0]};return _0x879086[_0x41a7('0x27')](_0x3034b1);})['catch'](function(_0x49bd6a){logger['error'](_0x41a7('0x2a'),_0x41a7('0x28'),'plivo',util[_0x41a7('0x29')](_0x49bd6a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x4b'),_0x41a7('0x50'));}break;case _0x41a7('0x51'):if(_0x4ec644[_0x41a7('0x30')]&&_0x4ec644['password']){if(_0x4ec644[_0x41a7('0x52')]){var _0x99a17a={'method':'POST','uri':_0x4ec644[_0x41a7('0x52')]+_0x41a7('0x53'),'body':{'username':_0x4ec644[_0x41a7('0x30')],'password':_0x4ec644['password']},'json':!![]};return rp(_0x99a17a)[_0x41a7('0x18')](function(_0x3b0aea){var _0x2fe6cd={'method':_0x41a7('0x35'),'uri':_0x4ec644['baseUrl']+_0x41a7('0x54'),'body':{'messages':[{'from':_0x4ec644[_0x41a7('0x23')],'destinations':[{'to':_0x46a501[_0x41a7('0x23')]}],'text':_0x46a501[_0x41a7('0xc')],'notifyUrl':_0x4ec644['remote']+_0x41a7('0x24')+_0x46a501['id']+'/status?token='+_0x4ec644['token'],'notifyContentType':'application/json','callbackData':_0x4ec644[_0x41a7('0x23')]+';'+_0x46a501[_0x41a7('0xc')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3b0aea[_0x41a7('0x55')]},'json':!![]};return rp(_0x2fe6cd)[_0x41a7('0x18')](function(_0x5db740){if(_0x5db740[_0x41a7('0x21')]){var _0x3cd0ec={'messageId':_0x5db740['messages'][0x0][_0x41a7('0xb')]};if(!_0x4ec644[_0x41a7('0x37')]){_0x3cd0ec['read']=!![];}return _0x879086[_0x41a7('0x27')](_0x3cd0ec);}else{return logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x51'),util[_0x41a7('0x29')](_0x5db740,{'showHidden':![],'depth':null}));}});})[_0x41a7('0x1a')](function(_0xfb79f4){return logger['error'](_0x41a7('0x2a'),'afterCreate',_0x41a7('0x51'),util[_0x41a7('0x29')](_0xfb79f4,{'showHidden':![],'depth':null}));});}else{logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x51'),_0x41a7('0x56'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip','Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x2ca2d2=require(_0x41a7('0x57'));if(_0x4ec644['apiKey']){var _0x5f4191={};_0x5f4191[_0x41a7('0x58')]=_0x4ec644['username'];_0x5f4191[_0x41a7('0x23')]=_0x46a501[_0x41a7('0x23')];_0x5f4191[_0x41a7('0x2e')]=_0x4ec644[_0x41a7('0x23')];_0x5f4191['text']=_0x46a501[_0x41a7('0xc')];_0x5f4191[_0x41a7('0x59')]=+new Date();var _0x252bf0='';var _0x30b06b='';var _0x31f8df=Object[_0x41a7('0x5a')](_0x5f4191);_0x31f8df['sort']();for(var _0x56e221=0x0;_0x56e221<_0x31f8df[_0x41a7('0x5b')];_0x56e221++){if(_0x252bf0!=''){_0x252bf0+='&';}_0x252bf0+=_0x31f8df[_0x56e221]+'='+encodeURIComponent(_0x5f4191[_0x31f8df[_0x56e221]]);_0x30b06b+=_0x5f4191[_0x31f8df[_0x56e221]];}_0x30b06b+=_0x4ec644['apiKey'];_0x30b06b=_0x2ca2d2[_0x41a7('0x5c')](_0x41a7('0x5d'))['update'](_0x30b06b)[_0x41a7('0x5e')]('hex');if(_0x252bf0!==''){_0x252bf0+='&';}_0x252bf0+=_0x41a7('0x5f')+_0x30b06b;var _0x2720a6={'method':_0x41a7('0x32'),'uri':_0x4ec644[_0x41a7('0x52')]+'/external/get/send.php?'+_0x252bf0,'json':!![]};return rp(_0x2720a6)[_0x41a7('0x18')](function(_0x6ea8f7){var _0x1e8071=Object[_0x41a7('0x5a')](_0x6ea8f7);if(_0x6ea8f7[_0x1e8071[0x0]]['error']&&parseInt(_0x6ea8f7[_0x1e8071[0x0]][_0x41a7('0x1b')])===0x0){var _0x5ea45b={'messageId':_0x6ea8f7[_0x1e8071[0x0]]['id_sms']};if(!_0x4ec644[_0x41a7('0x37')]){_0x5ea45b[_0x41a7('0x38')]=!![];}return _0x879086[_0x41a7('0x27')](_0x5ea45b);}else{return logger[_0x41a7('0x1b')](_0x41a7('0x2a'),'afterCreate',_0x41a7('0x60'),util[_0x41a7('0x29')](_0x6ea8f7[_0x41a7('0x1b')],{'showHidden':![],'depth':null}));}})[_0x41a7('0x1a')](function(_0x132c7e){return logger[_0x41a7('0x1b')](_0x41a7('0x2a'),'afterCreate','csc',util[_0x41a7('0x29')](_0x132c7e,{'showHidden':![],'depth':null}));});}else{logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x60'),_0x41a7('0x61'));}break;case _0x41a7('0x62'):if(_0x4ec644['apiKey']){var _0x1364d2={'method':_0x41a7('0x35'),'uri':_0x41a7('0x63'),'headers':{'Authorization':_0x4ec644['apiKey']},'body':{'content':_0x46a501['body'],'to':[_0x46a501[_0x41a7('0x23')]],'from':_0x4ec644[_0x41a7('0x23')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x1364d2)[_0x41a7('0x18')](function(_0x3cab){if(!_0x3cab[_0x41a7('0x1b')]){var _0x401951={'messageId':_0x3cab['messages'][0x0][_0x41a7('0x64')]};if(!_0x4ec644[_0x41a7('0x37')]){_0x401951[_0x41a7('0x38')]=!![];}return _0x879086[_0x41a7('0x27')](_0x401951);}else{return logger[_0x41a7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x41a7('0x28'),_0x41a7('0x62'),util[_0x41a7('0x29')](_0x3cab[_0x41a7('0x1b')],{'showHidden':![],'depth':null}));}})[_0x41a7('0x1a')](function(_0x124e02){return logger[_0x41a7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x41a7('0x28'),_0x41a7('0x62'),util['inspect'](_0x124e02,{'showHidden':![],'depth':null}));});}else{logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x62'),_0x41a7('0x61'));}break;case _0x41a7('0x65'):if(_0x4ec644['username']&&_0x4ec644[_0x41a7('0x2c')]){var _0x365702=util[_0x41a7('0x41')](_0x41a7('0x4c'),_0x4ec644[_0x41a7('0x30')],_0x4ec644[_0x41a7('0x2c')]);var _0x46a0b9={'method':_0x41a7('0x35'),'uri':_0x41a7('0x66')+_0x4ec644[_0x41a7('0x67')]+_0x41a7('0x68'),'body':{'to':[_0x46a501[_0x41a7('0x23')]],'text':_0x46a501[_0x41a7('0xc')],'from':_0x4ec644[_0x41a7('0x23')],'applicationId':_0x4ec644[_0x41a7('0x69')]},'headers':{'Authorization':util[_0x41a7('0x41')](_0x41a7('0x43'),new Buffer(_0x365702)[_0x41a7('0x44')]('base64'))},'json':!![]};rp(_0x46a0b9)[_0x41a7('0x18')](function(_0x2a6b52){if(_0x2a6b52['id']){var _0x52ff65={'messageId':_0x2a6b52['id']};return _0x879086['update'](_0x52ff65);}else{logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x65'),util[_0x41a7('0x29')](_0x2a6b52,{'showHidden':![],'depth':null}));}})[_0x41a7('0x1a')](function(_0x38df7e){logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),_0x41a7('0x65'),util[_0x41a7('0x29')](_0x38df7e,{'showHidden':![],'depth':null}));});}else{logger[_0x41a7('0x1b')](_0x41a7('0x2a'),_0x41a7('0x28'),'bandwidth',_0x41a7('0x3a'));}break;case'intelepeer':if(_0x4ec644[_0x41a7('0x6a')]){var _0x3fdc13={};var _0x2720a6={'method':_0x41a7('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x41a7('0x6b')+_0x4ec644[_0x41a7('0x6a')],'Content-Type':_0x41a7('0x6c')},'body':{'from':_0x4ec644[_0x41a7('0x23')],'to':_0x46a501[_0x41a7('0x23')],'text':_0x46a501[_0x41a7('0xc')]},'json':!![]};return rp(_0x2720a6)['then'](function(_0x2bed84){if(_0x2bed84[_0x41a7('0x6d')]==0xca){_0x3fdc13[_0x41a7('0x6e')]=_0x2bed84;var _0x120dee={'method':'POST','uri':_0x41a7('0x6f'),'headers':{'Authorization':_0x41a7('0x6b')+_0x4ec644[_0x41a7('0x6a')],'Content-Type':'application/json'},'body':{'refid':_0x3fdc13[_0x41a7('0x6e')][_0x41a7('0x70')]},'json':!![]};return rp(_0x120dee)[_0x41a7('0x18')](function(_0x2ba7d1){_0x3fdc13[_0x41a7('0x71')]=_0x2ba7d1;var _0x388549={'messageId':_0x3fdc13[_0x41a7('0x6e')][_0x41a7('0x70')],'read':!![]};return _0x879086[_0x41a7('0x27')](_0x388549);});}else{return logger['error'](_0x41a7('0x2a'),'afterCreate',_0x41a7('0x72'),util[_0x41a7('0x29')](_0x2bed84,{'showHidden':![],'depth':null}));}})[_0x41a7('0x1a')](function(_0x4f1c35){return logger['error'](_0x41a7('0x2a'),_0x41a7('0x28'),'intelepeer',util['inspect'](_0x4f1c35,{'showHidden':![],'depth':null}));});}else{return logger[_0x41a7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x41a7('0x28'),_0x41a7('0x72'),'Token\x20not\x20received');}break;}}})[_0x41a7('0x73')](function(){_0x4b5fe3();});}else{_0x4b5fe3();}}},'charset':_0x41a7('0x74'),'collate':_0x41a7('0x75')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 85d3b32..ce89432 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 _0x78da=['SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4ed15f,_0x1d0298){var _0x27dd0f=function(_0x33b7f4){while(--_0x33b7f4){_0x4ed15f['push'](_0x4ed15f['shift']());}};_0x27dd0f(++_0x1d0298);}(_0x78da,0x1a4));var _0xa78d=function(_0xbc10a8,_0x35d4d5){_0xbc10a8=_0xbc10a8-0x0;var _0x1ac0c3=_0x78da[_0xbc10a8];return _0x1ac0c3;};'use strict';var _=require(_0xa78d('0x0'));var util=require(_0xa78d('0x1'));var moment=require(_0xa78d('0x2'));var BPromise=require(_0xa78d('0x3'));var rs=require(_0xa78d('0x4'));var fs=require('fs');var Redis=require(_0xa78d('0x5'));var db=require(_0xa78d('0x6'))['db'];var utils=require(_0xa78d('0x7'));var logger=require('../../config/logger')(_0xa78d('0x8'));var config=require(_0xa78d('0x9'));var jayson=require(_0xa78d('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xa78d('0xb')](config[_0xa78d('0xc')],{'host':_0xa78d('0xd'),'port':0x18eb});var socket=require(_0xa78d('0xe'))(new Redis(config[_0xa78d('0xc')]));require('./smsMessage.socket')[_0xa78d('0xf')](socket);function respondWithRpcPromise(_0x287a89,_0x3997a4,_0x156bf6){return new BPromise(function(_0x4352b3,_0x48e261){return client[_0xa78d('0x10')](_0x287a89,_0x156bf6)[_0xa78d('0x11')](function(_0x3c5047){logger[_0xa78d('0x12')](_0xa78d('0x13'),_0x3997a4,_0xa78d('0x14'));logger[_0xa78d('0x15')](_0xa78d('0x16'),_0x3997a4,_0xa78d('0x14'),JSON[_0xa78d('0x17')](_0x3c5047));if(_0x3c5047[_0xa78d('0x18')]){if(_0x3c5047['error'][_0xa78d('0x19')]===0x1f4){logger[_0xa78d('0x18')]('SmsMessage,\x20%s,\x20%s',_0x3997a4,_0x3c5047[_0xa78d('0x18')][_0xa78d('0x1a')]);return _0x48e261(_0x3c5047[_0xa78d('0x18')][_0xa78d('0x1a')]);}logger[_0xa78d('0x18')]('SmsMessage,\x20%s,\x20%s',_0x3997a4,_0x3c5047[_0xa78d('0x18')][_0xa78d('0x1a')]);return _0x4352b3(_0x3c5047[_0xa78d('0x18')]['message']);}else{logger[_0xa78d('0x12')]('SmsMessage,\x20%s,\x20%s',_0x3997a4,_0xa78d('0x14'));_0x4352b3(_0x3c5047[_0xa78d('0x1b')][_0xa78d('0x1a')]);}})[_0xa78d('0x1c')](function(_0x1e5e03){logger['error'](_0xa78d('0x13'),_0x3997a4,_0x1e5e03);_0x48e261(_0x1e5e03);});});}exports[_0xa78d('0x1d')]=function(_0x70b7){var _0x53cbd9=this;return new Promise(function(_0x58d000,_0x4550a3){return db[_0xa78d('0x1e')]['create'](_0x70b7[_0xa78d('0x1f')],{'raw':_0x70b7[_0xa78d('0x20')]?_0x70b7[_0xa78d('0x20')][_0xa78d('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x521598){logger[_0xa78d('0x12')](_0xa78d('0x1d'),_0x70b7);logger[_0xa78d('0x15')](_0xa78d('0x1d'),_0x70b7,JSON[_0xa78d('0x17')](_0x521598));_0x58d000(_0x521598);})['catch'](function(_0x1c3907){logger[_0xa78d('0x18')](_0xa78d('0x1d'),_0x1c3907[_0xa78d('0x1a')],_0x70b7);_0x4550a3(_0x53cbd9[_0xa78d('0x18')](0x1f4,_0x1c3907[_0xa78d('0x1a')]));});});}; \ No newline at end of file +var _0x68a6=['then','info','SmsMessage,\x20%s,\x20%s,\x20%s','code','error','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','options','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x40432b,_0x485b16){var _0x1a1fee=function(_0x1969c7){while(--_0x1969c7){_0x40432b['push'](_0x40432b['shift']());}};_0x1a1fee(++_0x485b16);}(_0x68a6,0x12f));var _0x668a=function(_0x3f4669,_0x55d536){_0x3f4669=_0x3f4669-0x0;var _0x550b5c=_0x68a6[_0x3f4669];return _0x550b5c;};'use strict';var _=require(_0x668a('0x0'));var util=require('util');var moment=require(_0x668a('0x1'));var BPromise=require(_0x668a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x668a('0x3'))['db'];var utils=require(_0x668a('0x4'));var logger=require(_0x668a('0x5'))(_0x668a('0x6'));var config=require(_0x668a('0x7'));var jayson=require(_0x668a('0x8'));var client=jayson[_0x668a('0x9')][_0x668a('0xa')]({'port':0x232a});config[_0x668a('0xb')]=_[_0x668a('0xc')](config[_0x668a('0xb')],{'host':_0x668a('0xd'),'port':0x18eb});var socket=require(_0x668a('0xe'))(new Redis(config[_0x668a('0xb')]));require('./smsMessage.socket')[_0x668a('0xf')](socket);function respondWithRpcPromise(_0x22d750,_0x1afd80,_0x6e579b){return new BPromise(function(_0x18d323,_0x331fc2){return client['request'](_0x22d750,_0x6e579b)[_0x668a('0x10')](function(_0x251ec5){logger[_0x668a('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1afd80,'request\x20sent');logger['debug'](_0x668a('0x12'),_0x1afd80,'request\x20sent',JSON['stringify'](_0x251ec5));if(_0x251ec5['error']){if(_0x251ec5['error'][_0x668a('0x13')]===0x1f4){logger[_0x668a('0x14')](_0x668a('0x15'),_0x1afd80,_0x251ec5[_0x668a('0x14')][_0x668a('0x16')]);return _0x331fc2(_0x251ec5['error'][_0x668a('0x16')]);}logger[_0x668a('0x14')](_0x668a('0x15'),_0x1afd80,_0x251ec5[_0x668a('0x14')][_0x668a('0x16')]);return _0x18d323(_0x251ec5[_0x668a('0x14')][_0x668a('0x16')]);}else{logger[_0x668a('0x11')](_0x668a('0x15'),_0x1afd80,'request\x20sent');_0x18d323(_0x251ec5[_0x668a('0x17')][_0x668a('0x16')]);}})[_0x668a('0x18')](function(_0x20448b){logger[_0x668a('0x14')]('SmsMessage,\x20%s,\x20%s',_0x1afd80,_0x20448b);_0x331fc2(_0x20448b);});});}exports[_0x668a('0x19')]=function(_0x674063){var _0x17dc2b=this;return new Promise(function(_0x54b46a,_0x1f82af){return db[_0x668a('0x1a')]['create'](_0x674063['body'],{'raw':_0x674063[_0x668a('0x1b')]?_0x674063[_0x668a('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e7d90){logger[_0x668a('0x11')](_0x668a('0x19'),_0x674063);logger[_0x668a('0x1c')](_0x668a('0x19'),_0x674063,JSON['stringify'](_0x4e7d90));_0x54b46a(_0x4e7d90);})['catch'](function(_0x2e2c86){logger['error']('CreateSmsMessage',_0x2e2c86[_0x668a('0x16')],_0x674063);_0x1f82af(_0x17dc2b[_0x668a('0x14')](0x1f4,_0x2e2c86[_0x668a('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c0c5423..c0e663a 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 _0xe345=['removeListener','register','length','./smsMessage.events','save','remove','update','emit'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xe345,0x1cb));var _0x5e34=function(_0x58ae23,_0x296dfe){_0x58ae23=_0x58ae23-0x0;var _0x3b047f=_0xe345[_0x58ae23];return _0x3b047f;};'use strict';var SmsMessageEvents=require(_0x5e34('0x0'));var events=[_0x5e34('0x1'),_0x5e34('0x2'),_0x5e34('0x3')];function createListener(_0x598c38,_0x57e7ce){return function(_0x1ddaa6){_0x57e7ce[_0x5e34('0x4')](_0x598c38,_0x1ddaa6);};}function removeListener(_0x33dc4f,_0x51390f){return function(){SmsMessageEvents[_0x5e34('0x5')](_0x33dc4f,_0x51390f);};}exports[_0x5e34('0x6')]=function(_0xb2224f){for(var _0x248305=0x0,_0x3db3db=events[_0x5e34('0x7')];_0x248305<_0x3db3db;_0x248305++){var _0x4a2f8e=events[_0x248305];var _0x7927a3=createListener('smsMessage:'+_0x4a2f8e,_0xb2224f);SmsMessageEvents['on'](_0x4a2f8e,_0x7927a3);}}; \ No newline at end of file +var _0x9fa9=['remove','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x2d304a,_0x1df8fb){var _0x3d8136=function(_0x4980a9){while(--_0x4980a9){_0x2d304a['push'](_0x2d304a['shift']());}};_0x3d8136(++_0x1df8fb);}(_0x9fa9,0xde));var _0x99fa=function(_0x581e09,_0x19fa61){_0x581e09=_0x581e09-0x0;var _0x306a17=_0x9fa9[_0x581e09];return _0x306a17;};'use strict';var SmsMessageEvents=require(_0x99fa('0x0'));var events=[_0x99fa('0x1'),_0x99fa('0x2'),'update'];function createListener(_0xec1723,_0x2122e3){return function(_0x352be9){_0x2122e3['emit'](_0xec1723,_0x352be9);};}function removeListener(_0x2279c9,_0x5670bc){return function(){SmsMessageEvents[_0x99fa('0x3')](_0x2279c9,_0x5670bc);};}exports[_0x99fa('0x4')]=function(_0x3b390e){for(var _0x5f0555=0x0,_0x32a398=events[_0x99fa('0x5')];_0x5f0555<_0x32a398;_0x5f0555++){var _0x557c0e=events[_0x5f0555];var _0x116fe1=createListener(_0x99fa('0x6')+_0x557c0e,_0x3b390e);SmsMessageEvents['on'](_0x557c0e,_0x116fe1);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 084238f..87d5eeb 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 _0x691c=['create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0x691c,0xe3));var _0xc691=function(_0x4a0a2e,_0x3897b1){_0x4a0a2e=_0x4a0a2e-0x0;var _0x20d54c=_0x691c[_0x4a0a2e];return _0x20d54c;};'use strict';var multer=require(_0xc691('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc691('0x1'));var express=require(_0xc691('0x2'));var router=express[_0xc691('0x3')]();var fs_extra=require(_0xc691('0x4'));var auth=require(_0xc691('0x5'));var interaction=require(_0xc691('0x6'));var config=require(_0xc691('0x7'));var controller=require('./smsQueue.controller');router[_0xc691('0x8')]('/',auth['isAuthenticated'](),controller[_0xc691('0x9')]);router[_0xc691('0x8')](_0xc691('0xa'),auth[_0xc691('0xb')](),controller[_0xc691('0xc')]);router[_0xc691('0x8')](_0xc691('0xd'),auth[_0xc691('0xb')](),controller[_0xc691('0xe')]);router['get']('/:id/members',auth[_0xc691('0xb')](),controller[_0xc691('0xf')]);router[_0xc691('0x8')](_0xc691('0x10'),auth[_0xc691('0xb')](),controller[_0xc691('0x11')]);router[_0xc691('0x8')](_0xc691('0x12'),auth[_0xc691('0xb')](),controller[_0xc691('0x13')]);router[_0xc691('0x14')]('/',auth['isAuthenticated'](),controller[_0xc691('0x15')]);router['post'](_0xc691('0x10'),auth[_0xc691('0xb')](),controller[_0xc691('0x16')]);router[_0xc691('0x14')]('/:id/users',auth[_0xc691('0xb')](),controller[_0xc691('0x17')]);router[_0xc691('0x18')](_0xc691('0xd'),auth[_0xc691('0xb')](),controller[_0xc691('0x19')]);router[_0xc691('0x1a')](_0xc691('0xd'),auth[_0xc691('0xb')](),controller[_0xc691('0x1b')]);router['delete']('/:id/teams',auth[_0xc691('0xb')](),controller[_0xc691('0x1c')]);router['delete']('/:id/users',auth[_0xc691('0xb')](),controller[_0xc691('0x1d')]);module[_0xc691('0x1e')]=router; \ No newline at end of file +var _0xfe55=['getAgents','post','create','addAgents','put','update','removeTeams','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','/:id','isAuthenticated','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xfe55,0x1db));var _0x5fe5=function(_0x28f1de,_0x355054){_0x28f1de=_0x28f1de-0x0;var _0x5b5dad=_0xfe55[_0x28f1de];return _0x5b5dad;};'use strict';var multer=require(_0x5fe5('0x0'));var util=require(_0x5fe5('0x1'));var path=require(_0x5fe5('0x2'));var timeout=require(_0x5fe5('0x3'));var express=require(_0x5fe5('0x4'));var router=express[_0x5fe5('0x5')]();var fs_extra=require(_0x5fe5('0x6'));var auth=require(_0x5fe5('0x7'));var interaction=require(_0x5fe5('0x8'));var config=require(_0x5fe5('0x9'));var controller=require(_0x5fe5('0xa'));router[_0x5fe5('0xb')]('/',auth['isAuthenticated'](),controller[_0x5fe5('0xc')]);router[_0x5fe5('0xb')](_0x5fe5('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x5fe5('0xb')](_0x5fe5('0xe'),auth[_0x5fe5('0xf')](),controller['show']);router[_0x5fe5('0xb')](_0x5fe5('0x10'),auth[_0x5fe5('0xf')](),controller[_0x5fe5('0x11')]);router['get'](_0x5fe5('0x12'),auth['isAuthenticated'](),controller[_0x5fe5('0x13')]);router[_0x5fe5('0xb')](_0x5fe5('0x14'),auth[_0x5fe5('0xf')](),controller[_0x5fe5('0x15')]);router[_0x5fe5('0x16')]('/',auth[_0x5fe5('0xf')](),controller[_0x5fe5('0x17')]);router[_0x5fe5('0x16')](_0x5fe5('0x12'),auth[_0x5fe5('0xf')](),controller['addTeams']);router[_0x5fe5('0x16')]('/:id/users',auth[_0x5fe5('0xf')](),controller[_0x5fe5('0x18')]);router[_0x5fe5('0x19')](_0x5fe5('0xe'),auth['isAuthenticated'](),controller[_0x5fe5('0x1a')]);router['delete'](_0x5fe5('0xe'),auth[_0x5fe5('0xf')](),controller['destroy']);router['delete']('/:id/teams',auth[_0x5fe5('0xf')](),controller[_0x5fe5('0x1b')]);router[_0x5fe5('0x1c')](_0x5fe5('0x14'),auth[_0x5fe5('0xf')](),controller[_0x5fe5('0x1d')]);module[_0x5fe5('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 30e6cfb..d1fe961 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 _0x0e82=['rrmemory','beepall','roundrobin','exports','name','STRING','ENUM'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0e82,0xab));var _0x20e8=function(_0x393eac,_0x4505f3){_0x393eac=_0x393eac-0x0;var _0x37a891=_0x0e82[_0x393eac];return _0x37a891;};'use strict';var Sequelize=require('sequelize');module[_0x20e8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x20e8('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x20e8('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x20e8('0x3')](_0x20e8('0x4'),_0x20e8('0x5'),_0x20e8('0x6'))}}; \ No newline at end of file +var _0x8ed9=['beepall','sequelize','exports','name','STRING','ENUM'];(function(_0x4ee1a8,_0x26aedb){var _0x1bd2f9=function(_0x195c42){while(--_0x195c42){_0x4ee1a8['push'](_0x4ee1a8['shift']());}};_0x1bd2f9(++_0x26aedb);}(_0x8ed9,0x1e7));var _0x98ed=function(_0x3dd991,_0x4bef12){_0x3dd991=_0x3dd991-0x0;var _0x251609=_0x8ed9[_0x3dd991];return _0x251609;};'use strict';var Sequelize=require(_0x98ed('0x0'));module[_0x98ed('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x98ed('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x98ed('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x98ed('0x4')]('rrmemory',_0x98ed('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 7153364..c743e46 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 _0xc7bd=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','status','end','json','undefined','count','offset','set','save','update','then','destroy','get','SmsQueues','sendStatus','error','stack','name','send','index','SmsQueue','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','filters','SmsQueueId','UserSmsQueue','findAll','User','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','ids','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','rawAttributes','getAgents','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x532fc1,_0x3f9c8f){var _0xd58d79=function(_0x209293){while(--_0x209293){_0x532fc1['push'](_0x532fc1['shift']());}};_0xd58d79(++_0x3f9c8f);}(_0xc7bd,0x86));var _0xdc7b=function(_0x43149d,_0x28322a){_0x43149d=_0x43149d-0x0;var _0x2ee89e=_0xc7bd[_0x43149d];return _0x2ee89e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc7b('0x0'));var zipdir=require(_0xdc7b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc7b('0x2'));var moment=require('moment');var BPromise=require(_0xdc7b('0x3'));var Mustache=require('mustache');var util=require(_0xdc7b('0x4'));var path=require(_0xdc7b('0x5'));var sox=require(_0xdc7b('0x6'));var csv=require(_0xdc7b('0x7'));var ejs=require(_0xdc7b('0x8'));var fs=require('fs');var fs_extra=require(_0xdc7b('0x9'));var _=require(_0xdc7b('0xa'));var squel=require('squel');var crypto=require(_0xdc7b('0xb'));var jsforce=require(_0xdc7b('0xc'));var deskjs=require(_0xdc7b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc7b('0xe'));var Redis=require(_0xdc7b('0xf'));var authService=require(_0xdc7b('0x10'));var qs=require(_0xdc7b('0x11'));var as=require(_0xdc7b('0x12'));var hardwareService=require(_0xdc7b('0x13'));var logger=require('../../config/logger')(_0xdc7b('0x14'));var utils=require(_0xdc7b('0x15'));var config=require(_0xdc7b('0x16'));var licenseUtil=require(_0xdc7b('0x17'));var db=require(_0xdc7b('0x18'))['db'];config[_0xdc7b('0x19')]=_['defaults'](config[_0xdc7b('0x19')],{'host':_0xdc7b('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc7b('0x19')]));require('./smsQueue.socket')[_0xdc7b('0x1b')](socket);function respondWithStatusCode(_0x23d458,_0x22e150){_0x22e150=_0x22e150||0xcc;return function(_0x355090){if(_0x355090){return _0x23d458['sendStatus'](_0x22e150);}return _0x23d458[_0xdc7b('0x1c')](_0x22e150)[_0xdc7b('0x1d')]();};}function respondWithResult(_0x5e0281,_0x35c671){_0x35c671=_0x35c671||0xc8;return function(_0x12b8ca){if(_0x12b8ca){return _0x5e0281[_0xdc7b('0x1c')](_0x35c671)[_0xdc7b('0x1e')](_0x12b8ca);}};}function respondWithFilteredResult(_0x19b289,_0x3fc4f0){return function(_0x39cb1c){if(_0x39cb1c){var _0x25334e=typeof _0x3fc4f0['offset']===_0xdc7b('0x1f')&&typeof _0x3fc4f0['limit']===_0xdc7b('0x1f');var _0x5bcc30=_0x39cb1c[_0xdc7b('0x20')];var _0x435c3a=_0x25334e?0x0:_0x3fc4f0[_0xdc7b('0x21')];var _0x372728=_0x25334e?_0x39cb1c[_0xdc7b('0x20')]:_0x3fc4f0['offset']+_0x3fc4f0['limit'];var _0x500458;if(_0x372728>=_0x5bcc30){_0x372728=_0x5bcc30;_0x500458=0xc8;}else{_0x500458=0xce;}_0x19b289[_0xdc7b('0x1c')](_0x500458);return _0x19b289[_0xdc7b('0x22')]('Content-Range',_0x435c3a+'-'+_0x372728+'/'+_0x5bcc30)[_0xdc7b('0x1e')](_0x39cb1c);}return null;};}function patchUpdates(_0x25ec2e){return function(_0x144a3c){try{jsonpatch['apply'](_0x144a3c,_0x25ec2e,!![]);}catch(_0x3c1783){return BPromise['reject'](_0x3c1783);}return _0x144a3c[_0xdc7b('0x23')]();};}function saveUpdates(_0x2a1fca,_0x213d0c){return function(_0x46255c){if(_0x46255c){return _0x46255c[_0xdc7b('0x24')](_0x2a1fca)[_0xdc7b('0x25')](function(_0x10c260){return _0x10c260;});}return null;};}function removeEntity(_0x626ed6,_0x4e97c9){return function(_0x5b6ad7){if(_0x5b6ad7){return _0x5b6ad7[_0xdc7b('0x26')]()[_0xdc7b('0x25')](function(){var _0x21d40b=_0x5b6ad7[_0xdc7b('0x27')]({'plain':!![]});var _0x52b346=_0xdc7b('0x28');return db['UserProfileResource'][_0xdc7b('0x26')]({'where':{'type':_0x52b346,'resourceId':_0x21d40b['id']}})[_0xdc7b('0x25')](function(){return _0x5b6ad7;});})[_0xdc7b('0x25')](function(){_0x626ed6['status'](0xcc)[_0xdc7b('0x1d')]();});}};}function handleEntityNotFound(_0x102288,_0x2cfd85){return function(_0x1eefbb){if(!_0x1eefbb){_0x102288[_0xdc7b('0x29')](0x194);}return _0x1eefbb;};}function handleError(_0x4fb2a8,_0x3d3751){_0x3d3751=_0x3d3751||0x1f4;return function(_0x1f795d){logger[_0xdc7b('0x2a')](_0x1f795d[_0xdc7b('0x2b')]);if(_0x1f795d['name']){delete _0x1f795d[_0xdc7b('0x2c')];}_0x4fb2a8[_0xdc7b('0x1c')](_0x3d3751)[_0xdc7b('0x2d')](_0x1f795d);};}exports[_0xdc7b('0x2e')]=function(_0x4ad851,_0x18df1f){var _0x12a3b8={},_0x3092a1={},_0x1d805d={'count':0x0,'rows':[]};var _0x195d45=_['map'](db[_0xdc7b('0x2f')]['rawAttributes'],function(_0xff18c6){return{'name':_0xff18c6[_0xdc7b('0x30')],'type':_0xff18c6[_0xdc7b('0x31')]['key']};});_0x3092a1[_0xdc7b('0x32')]=_[_0xdc7b('0x33')](_0x195d45,_0xdc7b('0x2c'));_0x3092a1['query']=_[_0xdc7b('0x34')](_0x4ad851[_0xdc7b('0x35')]);_0x3092a1['filters']=_[_0xdc7b('0x36')](_0x3092a1['model'],_0x3092a1[_0xdc7b('0x35')]);_0x12a3b8[_0xdc7b('0x37')]=_['intersection'](_0x3092a1[_0xdc7b('0x32')],qs[_0xdc7b('0x38')](_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x38')]));_0x12a3b8[_0xdc7b('0x37')]=_0x12a3b8[_0xdc7b('0x37')][_0xdc7b('0x39')]?_0x12a3b8[_0xdc7b('0x37')]:_0x3092a1['model'];if(!_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x3a')](_0xdc7b('0x3b'))){_0x12a3b8['limit']=qs['limit'](_0x4ad851['query'][_0xdc7b('0x3c')]);_0x12a3b8[_0xdc7b('0x21')]=qs[_0xdc7b('0x21')](_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x21')]);}_0x12a3b8[_0xdc7b('0x3d')]=qs[_0xdc7b('0x3e')](_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x3e')]);_0x12a3b8[_0xdc7b('0x3f')]=qs['filters'](_[_0xdc7b('0x40')](_0x4ad851[_0xdc7b('0x35')],_0x3092a1['filters']),_0x195d45);if(_0x4ad851['query'][_0xdc7b('0x41')]){_0x12a3b8[_0xdc7b('0x3f')]=_[_0xdc7b('0x42')](_0x12a3b8[_0xdc7b('0x3f')],{'$or':_[_0xdc7b('0x33')](_0x195d45,function(_0x265df8){if(_0x265df8[_0xdc7b('0x31')]!==_0xdc7b('0x43')){var _0x151a4e={};_0x151a4e[_0x265df8[_0xdc7b('0x2c')]]={'$like':'%'+_0x4ad851['query'][_0xdc7b('0x41')]+'%'};return _0x151a4e;}})});}_0x12a3b8=_[_0xdc7b('0x42')]({},_0x12a3b8,_0x4ad851[_0xdc7b('0x44')]);var _0x517246={'where':_0x12a3b8[_0xdc7b('0x3f')]};return db[_0xdc7b('0x2f')][_0xdc7b('0x20')](_0x517246)[_0xdc7b('0x25')](function(_0x398133){_0x1d805d[_0xdc7b('0x20')]=_0x398133;if(_0x4ad851[_0xdc7b('0x35')][_0xdc7b('0x45')]){_0x12a3b8[_0xdc7b('0x46')]=[{'all':!![]}];}return db[_0xdc7b('0x2f')]['findAll'](_0x12a3b8);})[_0xdc7b('0x25')](function(_0x131643){_0x1d805d[_0xdc7b('0x47')]=_0x131643;return _0x1d805d;})[_0xdc7b('0x25')](respondWithFilteredResult(_0x18df1f,_0x12a3b8))[_0xdc7b('0x48')](handleError(_0x18df1f,null));};exports['show']=function(_0x21b0ac,_0xe1d379){var _0xc8470c={'raw':!![],'where':{'id':_0x21b0ac[_0xdc7b('0x49')]['id']}},_0x577ce0={};_0x577ce0[_0xdc7b('0x32')]=_[_0xdc7b('0x34')](db[_0xdc7b('0x2f')]['rawAttributes']);_0x577ce0['query']=_[_0xdc7b('0x34')](_0x21b0ac['query']);_0x577ce0['filters']=_[_0xdc7b('0x36')](_0x577ce0[_0xdc7b('0x32')],_0x577ce0[_0xdc7b('0x35')]);_0xc8470c[_0xdc7b('0x37')]=_[_0xdc7b('0x36')](_0x577ce0[_0xdc7b('0x32')],qs['fields'](_0x21b0ac['query'][_0xdc7b('0x38')]));_0xc8470c[_0xdc7b('0x37')]=_0xc8470c[_0xdc7b('0x37')][_0xdc7b('0x39')]?_0xc8470c[_0xdc7b('0x37')]:_0x577ce0[_0xdc7b('0x32')];if(_0x21b0ac[_0xdc7b('0x35')][_0xdc7b('0x45')]){_0xc8470c[_0xdc7b('0x46')]=[{'all':!![]}];}_0xc8470c=_[_0xdc7b('0x42')]({},_0xc8470c,_0x21b0ac[_0xdc7b('0x44')]);return db['SmsQueue'][_0xdc7b('0x4a')](_0xc8470c)[_0xdc7b('0x25')](handleEntityNotFound(_0xe1d379,null))['then'](respondWithResult(_0xe1d379,null))['catch'](handleError(_0xe1d379,null));};exports[_0xdc7b('0x4b')]=function(_0x3a6b7f,_0x1c063e){return db[_0xdc7b('0x2f')][_0xdc7b('0x4b')](_0x3a6b7f[_0xdc7b('0x4c')],{})[_0xdc7b('0x25')](function(_0x36ef7e){var _0x594f6c=_0x3a6b7f['user'][_0xdc7b('0x27')]({'plain':!![]});if(!_0x594f6c)throw new Error(_0xdc7b('0x4d'));if(_0x594f6c[_0xdc7b('0x4e')]==='user'){var _0x5e8331=_0x36ef7e[_0xdc7b('0x27')]({'plain':!![]});var _0x1ecaf0='SmsQueues';return db[_0xdc7b('0x4f')][_0xdc7b('0x4a')]({'where':{'name':_0x1ecaf0,'userProfileId':_0x594f6c['userProfileId']},'raw':!![]})[_0xdc7b('0x25')](function(_0x29ef3d){if(_0x29ef3d&&_0x29ef3d[_0xdc7b('0x50')]===0x0){return db[_0xdc7b('0x51')]['create']({'name':_0x5e8331[_0xdc7b('0x2c')],'resourceId':_0x5e8331['id'],'type':_0x29ef3d[_0xdc7b('0x2c')],'sectionId':_0x29ef3d['id']},{})[_0xdc7b('0x25')](function(){return _0x36ef7e;});}else{return _0x36ef7e;}})[_0xdc7b('0x48')](function(_0x5bd3af){logger[_0xdc7b('0x2a')](_0xdc7b('0x52'),_0x5bd3af);throw _0x5bd3af;});}return _0x36ef7e;})[_0xdc7b('0x25')](respondWithResult(_0x1c063e,0xc9))['catch'](handleError(_0x1c063e,null));};exports[_0xdc7b('0x24')]=function(_0x3bfc4c,_0x1733fa){if(_0x3bfc4c[_0xdc7b('0x4c')]['id']){delete _0x3bfc4c[_0xdc7b('0x4c')]['id'];}return db['SmsQueue'][_0xdc7b('0x4a')]({'where':{'id':_0x3bfc4c[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](handleEntityNotFound(_0x1733fa,null))[_0xdc7b('0x25')](saveUpdates(_0x3bfc4c[_0xdc7b('0x4c')],null))[_0xdc7b('0x25')](respondWithResult(_0x1733fa,null))[_0xdc7b('0x48')](handleError(_0x1733fa,null));};exports[_0xdc7b('0x26')]=function(_0x5993cf,_0x71dca4){return db[_0xdc7b('0x2f')][_0xdc7b('0x4a')]({'where':{'id':_0x5993cf[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](handleEntityNotFound(_0x71dca4,null))[_0xdc7b('0x25')](removeEntity(_0x71dca4,null))[_0xdc7b('0x48')](handleError(_0x71dca4,null));};exports[_0xdc7b('0x53')]=function(_0xfeeda4,_0x44e093){return db[_0xdc7b('0x2f')][_0xdc7b('0x53')]()['then'](respondWithResult(_0x44e093,null))[_0xdc7b('0x48')](handleError(_0x44e093,null));};exports['getMembers']=function(_0x2e2eef,_0x475708,_0x5ef37d){var _0x3dd54e={'raw':!![],'where':{}},_0xd13ed5={},_0x383d83;return db[_0xdc7b('0x2f')][_0xdc7b('0x54')]({'where':{'id':_0x2e2eef[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](handleEntityNotFound(_0x475708,null))[_0xdc7b('0x25')](function(_0x20e41d){if(_0x20e41d){_0x383d83=_0x20e41d[_0xdc7b('0x27')]({'plain':!![]});_0xd13ed5[_0xdc7b('0x32')]=_[_0xdc7b('0x34')](db['UserSmsQueue']['rawAttributes']);_0xd13ed5[_0xdc7b('0x35')]=_[_0xdc7b('0x34')](_0x2e2eef['query']);_0xd13ed5['filters']=_['intersection'](_0xd13ed5[_0xdc7b('0x32')],_0xd13ed5[_0xdc7b('0x35')]);_0x3dd54e['attributes']=_[_0xdc7b('0x36')](_0xd13ed5[_0xdc7b('0x32')],qs[_0xdc7b('0x38')](_0x2e2eef[_0xdc7b('0x35')][_0xdc7b('0x38')]));_0x3dd54e[_0xdc7b('0x37')]=_0x3dd54e[_0xdc7b('0x37')][_0xdc7b('0x39')]?_0x3dd54e[_0xdc7b('0x37')]:_0xd13ed5[_0xdc7b('0x32')];if(!_0x2e2eef[_0xdc7b('0x35')]['hasOwnProperty']('nolimit')){_0x3dd54e[_0xdc7b('0x3c')]=qs['limit'](_0x2e2eef[_0xdc7b('0x35')][_0xdc7b('0x3c')]);_0x3dd54e['offset']=qs[_0xdc7b('0x21')](_0x2e2eef['query'][_0xdc7b('0x21')]);}_0x3dd54e[_0xdc7b('0x3d')]=qs['sort'](_0x2e2eef[_0xdc7b('0x35')][_0xdc7b('0x3e')]);_0x3dd54e[_0xdc7b('0x3f')]=qs[_0xdc7b('0x55')](_[_0xdc7b('0x40')](_0x2e2eef[_0xdc7b('0x35')],_0xd13ed5[_0xdc7b('0x55')]));_0x3dd54e['where'][_0xdc7b('0x56')]=_0x20e41d['id'];if(_0x2e2eef[_0xdc7b('0x35')]['filter']){_0x3dd54e[_0xdc7b('0x3f')]=_[_0xdc7b('0x42')](_0x3dd54e['where'],{'$or':_[_0xdc7b('0x33')](_0x3dd54e[_0xdc7b('0x37')],function(_0x4e7590){var _0x346b8c={};_0x346b8c[_0x4e7590]={'$like':'%'+_0x2e2eef['query']['filter']+'%'};return _0x346b8c;})});}_0x3dd54e=_[_0xdc7b('0x42')]({},_0x3dd54e,_0x2e2eef[_0xdc7b('0x44')]);return db[_0xdc7b('0x57')][_0xdc7b('0x58')](_0x3dd54e);}})[_0xdc7b('0x25')](function(_0x5bf580){if(_0x5bf580){return db[_0xdc7b('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x5bf580,_0xdc7b('0x5a')),'role':_0xdc7b('0x5b')},'attributes':['id',_0xdc7b('0x2c'),_0xdc7b('0x5c'),_0xdc7b('0x5d'),_0xdc7b('0x5e')]});}})[_0xdc7b('0x25')](function(_0xc7577c){if(_0xc7577c){return{'count':_0xc7577c[_0xdc7b('0x20')],'rows':_[_0xdc7b('0x33')](_0xc7577c[_0xdc7b('0x47')],function(_0xc60a5e){return{'membername':_0xc60a5e[_0xdc7b('0x2c')],'UserId':_0xc60a5e['id'],'queue_name':_0x383d83['name'],'SmsQueueId':_0x383d83['id'],'interface':util['format'](_0xdc7b('0x5f'),_0xdc7b('0x60'),_0xc60a5e['name']),'penalty':0x0,'paused':_0xc60a5e[_0xdc7b('0x5c')],'createdAt':_0xc60a5e['createdAt'],'updatedAt':_0xc60a5e[_0xdc7b('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdc7b('0x25')](respondWithFilteredResult(_0x475708,_0x3dd54e))[_0xdc7b('0x48')](handleError(_0x475708,null));};exports[_0xdc7b('0x61')]=function(_0x307e8c,_0x4130bb,_0x3ecdc4){var _0x842451={};var _0x31c684={};var _0x2958d8;var _0x5b8574;return db[_0xdc7b('0x2f')]['findOne']({'where':{'id':_0x307e8c[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](handleEntityNotFound(_0x4130bb,null))[_0xdc7b('0x25')](function(_0x41ce02){if(_0x41ce02){_0x2958d8=_0x41ce02;_0x31c684[_0xdc7b('0x32')]=_['keys'](db[_0xdc7b('0x62')]['rawAttributes']);_0x31c684[_0xdc7b('0x35')]=_[_0xdc7b('0x34')](_0x307e8c['query']);_0x31c684[_0xdc7b('0x55')]=_[_0xdc7b('0x36')](_0x31c684['model'],_0x31c684[_0xdc7b('0x35')]);_0x842451['attributes']=_[_0xdc7b('0x36')](_0x31c684['model'],qs[_0xdc7b('0x38')](_0x307e8c[_0xdc7b('0x35')][_0xdc7b('0x38')]));_0x842451[_0xdc7b('0x37')]=_0x842451['attributes'][_0xdc7b('0x39')]?_0x842451[_0xdc7b('0x37')]:_0x31c684[_0xdc7b('0x32')];_0x842451[_0xdc7b('0x3d')]=qs['sort'](_0x307e8c[_0xdc7b('0x35')][_0xdc7b('0x3e')]);_0x842451['where']=qs[_0xdc7b('0x55')](_[_0xdc7b('0x40')](_0x307e8c['query'],_0x31c684[_0xdc7b('0x55')]));if(_0x307e8c[_0xdc7b('0x35')][_0xdc7b('0x41')]){_0x842451['where']=_[_0xdc7b('0x42')](_0x842451['where'],{'$or':_[_0xdc7b('0x33')](_0x842451['attributes'],function(_0x4a9a20){var _0x3de7c7={};_0x3de7c7[_0x4a9a20]={'$like':'%'+_0x307e8c['query']['filter']+'%'};return _0x3de7c7;})});}_0x842451=_[_0xdc7b('0x42')]({},_0x842451,_0x307e8c['options']);return _0x2958d8[_0xdc7b('0x61')](_0x842451);}})[_0xdc7b('0x25')](function(_0x3b8b1f){if(_0x3b8b1f){_0x5b8574=_0x3b8b1f[_0xdc7b('0x39')];if(!_0x307e8c['query'][_0xdc7b('0x3a')](_0xdc7b('0x3b'))){_0x842451[_0xdc7b('0x3c')]=qs[_0xdc7b('0x3c')](_0x307e8c['query'][_0xdc7b('0x3c')]);_0x842451['offset']=qs['offset'](_0x307e8c['query'][_0xdc7b('0x21')]);}return _0x2958d8[_0xdc7b('0x61')](_0x842451);}})[_0xdc7b('0x25')](function(_0x4dd710){if(_0x4dd710){return _0x4dd710?{'count':_0x5b8574,'rows':_0x4dd710}:null;}})[_0xdc7b('0x25')](respondWithResult(_0x4130bb,null))[_0xdc7b('0x48')](handleError(_0x4130bb,null));};exports[_0xdc7b('0x63')]=function(_0x57cd68,_0x448e2b,_0x359acc){var _0x5da655=_0x57cd68[_0xdc7b('0x4c')]['ids'];return db[_0xdc7b('0x62')][_0xdc7b('0x58')]({'where':{'id':_0x5da655},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdc7b('0x64'),'attributes':['id',_0xdc7b('0x2c'),_0xdc7b('0x65'),_0xdc7b('0x66'),_0xdc7b('0x67')],'raw':!![]}]})[_0xdc7b('0x25')](function(_0x2936e1){if(_0x2936e1){var _0x34f4d9=_[_0xdc7b('0x68')](_0x2936e1,function(_0x4a4b0c){var _0x4d336d=_0x4a4b0c[_0xdc7b('0x27')]({'plain':!![]});return _0x4d336d[_0xdc7b('0x64')];});return db[_0xdc7b('0x2f')]['find']({'where':{'id':_0x57cd68[_0xdc7b('0x49')]['id']}})[_0xdc7b('0x25')](function(_0x28f80b){return db[_0xdc7b('0x69')][_0xdc7b('0x6a')](function(_0x34f897){return _0x28f80b[_0xdc7b('0x63')](_0x5da655,{'transaction':_0x34f897})[_0xdc7b('0x25')](function(){return BPromise[_0xdc7b('0x6b')](_0x34f4d9,function(_0x42be7e){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x42be7e['id'],'SmsQueueId':_0x57cd68[_0xdc7b('0x49')]['id']},'transaction':_0x34f897});});})[_0xdc7b('0x25')](function(){_0x34f4d9[_0xdc7b('0x6c')](function(_0x34a94e){socket[_0xdc7b('0x6d')](_0xdc7b('0x6e'),{'UserId':_0x34a94e['id'],'SmsQueueId':_0x28f80b['id']});});});});});}})[_0xdc7b('0x25')](respondWithStatusCode(_0x448e2b,null))[_0xdc7b('0x48')](handleError(_0x448e2b,null));};exports['removeTeams']=function(_0x46370b,_0x1b307a,_0x301e1a){return db[_0xdc7b('0x62')][_0xdc7b('0x58')]({'where':{'id':_0x46370b[_0xdc7b('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xdc7b('0x59')],'as':_0xdc7b('0x64'),'attributes':['id'],'raw':!![]}]})[_0xdc7b('0x25')](handleEntityNotFound(_0x1b307a,null))['then'](function(_0x43a3d5){var _0x3a6704=_['map'](_0x43a3d5,'id');var _0x525099=[];var _0x58f693=[];var _0x551760=squel[_0xdc7b('0x6f')]();_0x551760[_0xdc7b('0x70')](_0xdc7b('0x71'))[_0xdc7b('0x72')](_0xdc7b('0x73'),'tq')[_0xdc7b('0x74')](_0xdc7b('0x75'),'ut',_0xdc7b('0x76'))[_0xdc7b('0x3f')](_0xdc7b('0x77'),_0x46370b[_0xdc7b('0x49')]['id']);for(var _0x2b78ab=0x0;_0x2b78ab<_0x43a3d5[_0xdc7b('0x39')];_0x2b78ab+=0x1){let _0x8501da=_0x43a3d5[_0x2b78ab];for(var _0xc4133f=0x0;_0xc4133f<_0x8501da['Agents'][_0xdc7b('0x39')];_0xc4133f+=0x1){let _0x19bfd5=_0x8501da['Agents'][_0xc4133f];var _0x2c728f=_0x551760[_0xdc7b('0x78')]();_0x2c728f[_0xdc7b('0x3f')](_0xdc7b('0x79'),_0x19bfd5['id']);_0x58f693[_0xdc7b('0x7a')](db[_0xdc7b('0x69')][_0xdc7b('0x35')](_0x2c728f[_0xdc7b('0x7b')](),{'type':db[_0xdc7b('0x69')][_0xdc7b('0x7c')][_0xdc7b('0x7d')]})[_0xdc7b('0x25')](function(_0x35d52a){if(_0x35d52a['length']===0x1){return _0x19bfd5['id'];}else{var _0x580f97=_[_0xdc7b('0x7e')](_[_0xdc7b('0x33')](_0x35d52a,_0xdc7b('0x7f')),function(_0x1740c9){return _[_0xdc7b('0x80')](_0x3a6704,_0x1740c9);});if(_0x580f97){return _0x19bfd5['id'];}}}));}}return BPromise[_0xdc7b('0x81')](_0x58f693)['then'](function(_0xecf498){_0x525099=_(_0x525099)[_0xdc7b('0x82')](_0xecf498)[_0xdc7b('0x83')]()[_0xdc7b('0x84')]();return db[_0xdc7b('0x2f')][_0xdc7b('0x4a')]({'where':{'id':_0x46370b[_0xdc7b('0x49')]['id']}})['then'](function(_0x46966f){return db['sequelize'][_0xdc7b('0x6a')](function(_0x59d808){return _0x46966f['removeTeams'](_0x46370b[_0xdc7b('0x35')][_0xdc7b('0x85')],{'transaction':_0x59d808})[_0xdc7b('0x25')](function(){if(!_[_0xdc7b('0x86')](_0x525099)){return _0x46966f[_0xdc7b('0x87')](_0x525099,{'transaction':_0x59d808});}})[_0xdc7b('0x25')](function(){_0x525099['forEach'](function(_0x493557){socket['emit'](_0xdc7b('0x88'),{'UserId':_0x493557,'SmsQueueId':_0x46966f['id']});});});});});});})[_0xdc7b('0x25')](respondWithStatusCode(_0x1b307a,null))[_0xdc7b('0x48')](handleError(_0x1b307a,null));};exports[_0xdc7b('0x89')]=function(_0x342b32,_0xee0d8b,_0x160638){return db[_0xdc7b('0x2f')][_0xdc7b('0x4a')]({'where':{'id':_0x342b32[_0xdc7b('0x49')]['id']}})['then'](handleEntityNotFound(_0xee0d8b,null))['then'](function(_0x413a5a){if(_0x413a5a){return _0x413a5a[_0xdc7b('0x89')](_0x342b32[_0xdc7b('0x4c')][_0xdc7b('0x85')],_[_0xdc7b('0x8a')](_0x342b32['body'],['ids','id'])||{})[_0xdc7b('0x8b')](function(_0x11bd50){for(var _0x455e65=0x0;_0x455e65<_0x342b32[_0xdc7b('0x4c')][_0xdc7b('0x85')]['length'];_0x455e65+=0x1){socket[_0xdc7b('0x6d')](_0xdc7b('0x6e'),{'UserId':Number(_0x342b32['body']['ids'][_0x455e65]),'SmsQueueId':Number(_0x342b32[_0xdc7b('0x49')]['id'])});}return _0x11bd50;});}})[_0xdc7b('0x25')](respondWithResult(_0xee0d8b,null))['catch'](handleError(_0xee0d8b,null));};exports[_0xdc7b('0x87')]=function(_0x470a0f,_0x41ca82,_0x33f255){return db[_0xdc7b('0x2f')][_0xdc7b('0x4a')]({'where':{'id':_0x470a0f['params']['id']}})['then'](handleEntityNotFound(_0x41ca82,null))[_0xdc7b('0x25')](function(_0x1f86bf){if(_0x1f86bf){return _0x1f86bf[_0xdc7b('0x87')](_0x470a0f['query'][_0xdc7b('0x85')])['then'](function(){if(_['isArray'](_0x470a0f[_0xdc7b('0x35')][_0xdc7b('0x85')])){for(var _0x3d3c8e=0x0;_0x3d3c8e<_0x470a0f[_0xdc7b('0x35')][_0xdc7b('0x85')][_0xdc7b('0x39')];_0x3d3c8e+=0x1){socket[_0xdc7b('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x470a0f[_0xdc7b('0x35')]['ids'][_0x3d3c8e]),'SmsQueueId':Number(_0x470a0f[_0xdc7b('0x49')]['id'])});}}else{socket[_0xdc7b('0x6d')](_0xdc7b('0x88'),{'UserId':Number(_0x470a0f[_0xdc7b('0x35')][_0xdc7b('0x85')]),'SmsQueueId':Number(_0x470a0f[_0xdc7b('0x49')]['id'])});}});}})[_0xdc7b('0x25')](respondWithStatusCode(_0x41ca82,null))['catch'](handleError(_0x41ca82,null));};exports['getAgents']=function(_0x39d63d,_0x563791,_0x3d0ed0){var _0x3b123d={};var _0x1e0213={};var _0x14b37a;var _0x1906d6;return db['SmsQueue'][_0xdc7b('0x54')]({'where':{'id':_0x39d63d[_0xdc7b('0x49')]['id']}})['then'](handleEntityNotFound(_0x563791,null))[_0xdc7b('0x25')](function(_0x1fbb70){if(_0x1fbb70){_0x14b37a=_0x1fbb70;_0x1e0213['model']=_[_0xdc7b('0x34')](db[_0xdc7b('0x59')][_0xdc7b('0x8c')]);_0x1e0213['query']=_[_0xdc7b('0x34')](_0x39d63d[_0xdc7b('0x35')]);_0x1e0213[_0xdc7b('0x55')]=_[_0xdc7b('0x36')](_0x1e0213['model'],_0x1e0213[_0xdc7b('0x35')]);_0x3b123d[_0xdc7b('0x37')]=_['intersection'](_0x1e0213[_0xdc7b('0x32')],qs[_0xdc7b('0x38')](_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x38')]));_0x3b123d['attributes']=_0x3b123d['attributes'][_0xdc7b('0x39')]?_0x3b123d[_0xdc7b('0x37')]:_0x1e0213['model'];_0x3b123d[_0xdc7b('0x3d')]=qs[_0xdc7b('0x3e')](_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x3e')]);_0x3b123d[_0xdc7b('0x3f')]=qs[_0xdc7b('0x55')](_[_0xdc7b('0x40')](_0x39d63d[_0xdc7b('0x35')],_0x1e0213['filters']));if(_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x41')]){_0x3b123d[_0xdc7b('0x3f')]=_[_0xdc7b('0x42')](_0x3b123d[_0xdc7b('0x3f')],{'$or':_['map'](_0x3b123d[_0xdc7b('0x37')],function(_0x2eba4d){var _0xd577c0={};_0xd577c0[_0x2eba4d]={'$like':'%'+_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x41')]+'%'};return _0xd577c0;})});}_0x3b123d=_[_0xdc7b('0x42')]({},_0x3b123d,_0x39d63d[_0xdc7b('0x44')]);return _0x14b37a['getAgents'](_0x3b123d);}})['then'](function(_0x4f6e8d){if(_0x4f6e8d){_0x1906d6=_0x4f6e8d[_0xdc7b('0x39')];if(!_0x39d63d[_0xdc7b('0x35')][_0xdc7b('0x3a')](_0xdc7b('0x3b'))){_0x3b123d[_0xdc7b('0x3c')]=qs['limit'](_0x39d63d[_0xdc7b('0x35')]['limit']);_0x3b123d[_0xdc7b('0x21')]=qs[_0xdc7b('0x21')](_0x39d63d['query'][_0xdc7b('0x21')]);}return _0x14b37a[_0xdc7b('0x8d')](_0x3b123d);}})[_0xdc7b('0x25')](function(_0x117f05){if(_0x117f05){return _0x117f05?{'count':_0x1906d6,'rows':_0x117f05}:null;}})['then'](respondWithResult(_0x563791,null))[_0xdc7b('0x48')](handleError(_0x563791,null));}; \ No newline at end of file +var _0x41d9=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','SmsQueues','destroy','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length','order','where','pick','type','VIRTUAL','filter','merge','includeAll','include','rows','catch','show','keys','intersection','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','sort','SmsQueueId','findAll','User','findAndCountAll','UserId','agent','smsPause','format','%s/%s','SIP','createdAt','getTeams','Team','nolimit','ids','Agents','online','voicePause','flatMap','transaction','emit','userSmsQueue:save','removeTeams','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','removeAgents','userSmsQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x4bcf38,_0x3c12be){var _0x4a89be=function(_0x3215a6){while(--_0x3215a6){_0x4bcf38['push'](_0x4bcf38['shift']());}};_0x4a89be(++_0x3c12be);}(_0x41d9,0x85));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x941d('0x0'));var rimraf=require(_0x941d('0x1'));var zipdir=require(_0x941d('0x2'));var jsonpatch=require(_0x941d('0x3'));var rp=require(_0x941d('0x4'));var moment=require(_0x941d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x941d('0x6'));var util=require(_0x941d('0x7'));var path=require(_0x941d('0x8'));var sox=require(_0x941d('0x9'));var csv=require(_0x941d('0xa'));var ejs=require(_0x941d('0xb'));var fs=require('fs');var fs_extra=require(_0x941d('0xc'));var _=require(_0x941d('0xd'));var squel=require(_0x941d('0xe'));var crypto=require(_0x941d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x941d('0x10'));var toCsv=require(_0x941d('0xa'));var querystring=require(_0x941d('0x11'));var Papa=require(_0x941d('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x941d('0x13'));var as=require(_0x941d('0x14'));var hardwareService=require(_0x941d('0x15'));var logger=require(_0x941d('0x16'))(_0x941d('0x17'));var utils=require(_0x941d('0x18'));var config=require(_0x941d('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x941d('0x1a')]=_[_0x941d('0x1b')](config['redis'],{'host':_0x941d('0x1c'),'port':0x18eb});var socket=require(_0x941d('0x1d'))(new Redis(config[_0x941d('0x1a')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x1ed1bc,_0xbac14b){_0xbac14b=_0xbac14b||0xcc;return function(_0xff2497){if(_0xff2497){return _0x1ed1bc[_0x941d('0x1e')](_0xbac14b);}return _0x1ed1bc[_0x941d('0x1f')](_0xbac14b)[_0x941d('0x20')]();};}function respondWithResult(_0x597d96,_0x1a4991){_0x1a4991=_0x1a4991||0xc8;return function(_0x2a5fc7){if(_0x2a5fc7){return _0x597d96[_0x941d('0x1f')](_0x1a4991)[_0x941d('0x21')](_0x2a5fc7);}};}function respondWithFilteredResult(_0xeb01ef,_0x31da14){return function(_0x3ce41c){if(_0x3ce41c){var _0x2717af=typeof _0x31da14[_0x941d('0x22')]===_0x941d('0x23')&&typeof _0x31da14[_0x941d('0x24')]===_0x941d('0x23');var _0x3922af=_0x3ce41c[_0x941d('0x25')];var _0x45a4a6=_0x2717af?0x0:_0x31da14[_0x941d('0x22')];var _0x4e2ee2=_0x2717af?_0x3ce41c[_0x941d('0x25')]:_0x31da14[_0x941d('0x22')]+_0x31da14['limit'];var _0x35039f;if(_0x4e2ee2>=_0x3922af){_0x4e2ee2=_0x3922af;_0x35039f=0xc8;}else{_0x35039f=0xce;}_0xeb01ef[_0x941d('0x1f')](_0x35039f);return _0xeb01ef[_0x941d('0x26')](_0x941d('0x27'),_0x45a4a6+'-'+_0x4e2ee2+'/'+_0x3922af)[_0x941d('0x21')](_0x3ce41c);}return null;};}function patchUpdates(_0x37badc){return function(_0x40ed59){try{jsonpatch[_0x941d('0x28')](_0x40ed59,_0x37badc,!![]);}catch(_0x1e0cae){return BPromise[_0x941d('0x29')](_0x1e0cae);}return _0x40ed59[_0x941d('0x2a')]();};}function saveUpdates(_0x220d4c,_0x5335d8){return function(_0x388ff5){if(_0x388ff5){return _0x388ff5[_0x941d('0x2b')](_0x220d4c)[_0x941d('0x2c')](function(_0x287a90){return _0x287a90;});}return null;};}function removeEntity(_0x12c334,_0x120b07){return function(_0x24c8bf){if(_0x24c8bf){return _0x24c8bf['destroy']()[_0x941d('0x2c')](function(){var _0x4a9642=_0x24c8bf[_0x941d('0x2d')]({'plain':!![]});var _0xa02949=_0x941d('0x2e');return db['UserProfileResource'][_0x941d('0x2f')]({'where':{'type':_0xa02949,'resourceId':_0x4a9642['id']}})['then'](function(){return _0x24c8bf;});})['then'](function(){_0x12c334['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x49988f,_0x2a0766){return function(_0x48b37a){if(!_0x48b37a){_0x49988f[_0x941d('0x1e')](0x194);}return _0x48b37a;};}function handleError(_0x3d3ab4,_0x510101){_0x510101=_0x510101||0x1f4;return function(_0x43ff12){logger['error'](_0x43ff12[_0x941d('0x30')]);if(_0x43ff12[_0x941d('0x31')]){delete _0x43ff12['name'];}_0x3d3ab4[_0x941d('0x1f')](_0x510101)[_0x941d('0x32')](_0x43ff12);};}exports[_0x941d('0x33')]=function(_0x225a9c,_0x20113d){var _0x5eed23={},_0x18c028={},_0x1eb58a={'count':0x0,'rows':[]};var _0x499ea3=_[_0x941d('0x34')](db[_0x941d('0x35')][_0x941d('0x36')],function(_0x4535c4){return{'name':_0x4535c4[_0x941d('0x37')],'type':_0x4535c4['type'][_0x941d('0x38')]};});_0x18c028[_0x941d('0x39')]=_[_0x941d('0x34')](_0x499ea3,_0x941d('0x31'));_0x18c028[_0x941d('0x3a')]=_['keys'](_0x225a9c['query']);_0x18c028[_0x941d('0x3b')]=_['intersection'](_0x18c028['model'],_0x18c028['query']);_0x5eed23[_0x941d('0x3c')]=_['intersection'](_0x18c028[_0x941d('0x39')],qs['fields'](_0x225a9c['query'][_0x941d('0x3d')]));_0x5eed23[_0x941d('0x3c')]=_0x5eed23['attributes'][_0x941d('0x3e')]?_0x5eed23[_0x941d('0x3c')]:_0x18c028[_0x941d('0x39')];if(!_0x225a9c['query']['hasOwnProperty']('nolimit')){_0x5eed23[_0x941d('0x24')]=qs[_0x941d('0x24')](_0x225a9c[_0x941d('0x3a')][_0x941d('0x24')]);_0x5eed23['offset']=qs[_0x941d('0x22')](_0x225a9c[_0x941d('0x3a')][_0x941d('0x22')]);}_0x5eed23[_0x941d('0x3f')]=qs['sort'](_0x225a9c[_0x941d('0x3a')]['sort']);_0x5eed23[_0x941d('0x40')]=qs[_0x941d('0x3b')](_[_0x941d('0x41')](_0x225a9c['query'],_0x18c028[_0x941d('0x3b')]),_0x499ea3);if(_0x225a9c[_0x941d('0x3a')]['filter']){_0x5eed23[_0x941d('0x40')]=_['merge'](_0x5eed23[_0x941d('0x40')],{'$or':_[_0x941d('0x34')](_0x499ea3,function(_0x14545b){if(_0x14545b[_0x941d('0x42')]!==_0x941d('0x43')){var _0x1e715c={};_0x1e715c[_0x14545b[_0x941d('0x31')]]={'$like':'%'+_0x225a9c[_0x941d('0x3a')][_0x941d('0x44')]+'%'};return _0x1e715c;}})});}_0x5eed23=_[_0x941d('0x45')]({},_0x5eed23,_0x225a9c['options']);var _0x1b3902={'where':_0x5eed23['where']};return db['SmsQueue'][_0x941d('0x25')](_0x1b3902)[_0x941d('0x2c')](function(_0x9d3f3e){_0x1eb58a[_0x941d('0x25')]=_0x9d3f3e;if(_0x225a9c['query'][_0x941d('0x46')]){_0x5eed23[_0x941d('0x47')]=[{'all':!![]}];}return db[_0x941d('0x35')]['findAll'](_0x5eed23);})[_0x941d('0x2c')](function(_0x1da77e){_0x1eb58a[_0x941d('0x48')]=_0x1da77e;return _0x1eb58a;})[_0x941d('0x2c')](respondWithFilteredResult(_0x20113d,_0x5eed23))[_0x941d('0x49')](handleError(_0x20113d,null));};exports[_0x941d('0x4a')]=function(_0x59866a,_0x40d49e){var _0x1f6459={'raw':!![],'where':{'id':_0x59866a['params']['id']}},_0x1bd09a={};_0x1bd09a['model']=_[_0x941d('0x4b')](db[_0x941d('0x35')][_0x941d('0x36')]);_0x1bd09a[_0x941d('0x3a')]=_[_0x941d('0x4b')](_0x59866a[_0x941d('0x3a')]);_0x1bd09a['filters']=_[_0x941d('0x4c')](_0x1bd09a['model'],_0x1bd09a['query']);_0x1f6459[_0x941d('0x3c')]=_['intersection'](_0x1bd09a[_0x941d('0x39')],qs[_0x941d('0x3d')](_0x59866a['query']['fields']));_0x1f6459['attributes']=_0x1f6459[_0x941d('0x3c')]['length']?_0x1f6459[_0x941d('0x3c')]:_0x1bd09a['model'];if(_0x59866a[_0x941d('0x3a')]['includeAll']){_0x1f6459[_0x941d('0x47')]=[{'all':!![]}];}_0x1f6459=_[_0x941d('0x45')]({},_0x1f6459,_0x59866a[_0x941d('0x4d')]);return db[_0x941d('0x35')]['find'](_0x1f6459)[_0x941d('0x2c')](handleEntityNotFound(_0x40d49e,null))[_0x941d('0x2c')](respondWithResult(_0x40d49e,null))[_0x941d('0x49')](handleError(_0x40d49e,null));};exports[_0x941d('0x4e')]=function(_0x36baec,_0x1fb394){return db[_0x941d('0x35')][_0x941d('0x4e')](_0x36baec[_0x941d('0x4f')],{})[_0x941d('0x2c')](function(_0x45db11){var _0x55061a=_0x36baec[_0x941d('0x50')]['get']({'plain':!![]});if(!_0x55061a)throw new Error(_0x941d('0x51'));if(_0x55061a[_0x941d('0x52')]===_0x941d('0x50')){var _0x393d9e=_0x45db11['get']({'plain':!![]});var _0x3802b4='SmsQueues';return db[_0x941d('0x53')]['find']({'where':{'name':_0x3802b4,'userProfileId':_0x55061a[_0x941d('0x54')]},'raw':!![]})['then'](function(_0x525339){if(_0x525339&&_0x525339[_0x941d('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x393d9e[_0x941d('0x31')],'resourceId':_0x393d9e['id'],'type':_0x525339[_0x941d('0x31')],'sectionId':_0x525339['id']},{})[_0x941d('0x2c')](function(){return _0x45db11;});}else{return _0x45db11;}})[_0x941d('0x49')](function(_0x4137a7){logger[_0x941d('0x56')](_0x941d('0x57'),_0x4137a7);throw _0x4137a7;});}return _0x45db11;})['then'](respondWithResult(_0x1fb394,0xc9))[_0x941d('0x49')](handleError(_0x1fb394,null));};exports['update']=function(_0xd3d272,_0x5e4d94){if(_0xd3d272['body']['id']){delete _0xd3d272[_0x941d('0x4f')]['id'];}return db[_0x941d('0x35')][_0x941d('0x58')]({'where':{'id':_0xd3d272[_0x941d('0x59')]['id']}})[_0x941d('0x2c')](handleEntityNotFound(_0x5e4d94,null))[_0x941d('0x2c')](saveUpdates(_0xd3d272[_0x941d('0x4f')],null))['then'](respondWithResult(_0x5e4d94,null))[_0x941d('0x49')](handleError(_0x5e4d94,null));};exports[_0x941d('0x2f')]=function(_0xfa3c0c,_0x2b270a){return db[_0x941d('0x35')][_0x941d('0x58')]({'where':{'id':_0xfa3c0c[_0x941d('0x59')]['id']}})[_0x941d('0x2c')](handleEntityNotFound(_0x2b270a,null))[_0x941d('0x2c')](removeEntity(_0x2b270a,null))[_0x941d('0x49')](handleError(_0x2b270a,null));};exports[_0x941d('0x5a')]=function(_0x33cca5,_0x587c9b){return db[_0x941d('0x35')][_0x941d('0x5a')]()[_0x941d('0x2c')](respondWithResult(_0x587c9b,null))[_0x941d('0x49')](handleError(_0x587c9b,null));};exports[_0x941d('0x5b')]=function(_0x458b31,_0x3e4cf5,_0x14dc3f){var _0x1dcbcb={'raw':!![],'where':{}},_0x34537b={},_0x4311cc;return db[_0x941d('0x35')][_0x941d('0x5c')]({'where':{'id':_0x458b31[_0x941d('0x59')]['id']}})[_0x941d('0x2c')](handleEntityNotFound(_0x3e4cf5,null))[_0x941d('0x2c')](function(_0x4c7dee){if(_0x4c7dee){_0x4311cc=_0x4c7dee['get']({'plain':!![]});_0x34537b[_0x941d('0x39')]=_['keys'](db[_0x941d('0x5d')][_0x941d('0x36')]);_0x34537b[_0x941d('0x3a')]=_[_0x941d('0x4b')](_0x458b31[_0x941d('0x3a')]);_0x34537b[_0x941d('0x3b')]=_[_0x941d('0x4c')](_0x34537b[_0x941d('0x39')],_0x34537b[_0x941d('0x3a')]);_0x1dcbcb[_0x941d('0x3c')]=_[_0x941d('0x4c')](_0x34537b['model'],qs[_0x941d('0x3d')](_0x458b31['query'][_0x941d('0x3d')]));_0x1dcbcb[_0x941d('0x3c')]=_0x1dcbcb[_0x941d('0x3c')][_0x941d('0x3e')]?_0x1dcbcb[_0x941d('0x3c')]:_0x34537b[_0x941d('0x39')];if(!_0x458b31[_0x941d('0x3a')][_0x941d('0x5e')]('nolimit')){_0x1dcbcb['limit']=qs[_0x941d('0x24')](_0x458b31[_0x941d('0x3a')]['limit']);_0x1dcbcb[_0x941d('0x22')]=qs[_0x941d('0x22')](_0x458b31[_0x941d('0x3a')][_0x941d('0x22')]);}_0x1dcbcb['order']=qs[_0x941d('0x5f')](_0x458b31[_0x941d('0x3a')]['sort']);_0x1dcbcb['where']=qs['filters'](_[_0x941d('0x41')](_0x458b31['query'],_0x34537b[_0x941d('0x3b')]));_0x1dcbcb[_0x941d('0x40')][_0x941d('0x60')]=_0x4c7dee['id'];if(_0x458b31[_0x941d('0x3a')][_0x941d('0x44')]){_0x1dcbcb[_0x941d('0x40')]=_[_0x941d('0x45')](_0x1dcbcb[_0x941d('0x40')],{'$or':_[_0x941d('0x34')](_0x1dcbcb[_0x941d('0x3c')],function(_0x5d7d12){var _0x27e61c={};_0x27e61c[_0x5d7d12]={'$like':'%'+_0x458b31[_0x941d('0x3a')]['filter']+'%'};return _0x27e61c;})});}_0x1dcbcb=_['merge']({},_0x1dcbcb,_0x458b31['options']);return db[_0x941d('0x5d')][_0x941d('0x61')](_0x1dcbcb);}})[_0x941d('0x2c')](function(_0x168b5b){if(_0x168b5b){return db[_0x941d('0x62')][_0x941d('0x63')]({'where':{'id':_[_0x941d('0x34')](_0x168b5b,_0x941d('0x64')),'role':_0x941d('0x65')},'attributes':['id',_0x941d('0x31'),_0x941d('0x66'),'updatedAt','createdAt']});}})[_0x941d('0x2c')](function(_0x4798ec){if(_0x4798ec){return{'count':_0x4798ec['count'],'rows':_['map'](_0x4798ec[_0x941d('0x48')],function(_0x1a9fea){return{'membername':_0x1a9fea[_0x941d('0x31')],'UserId':_0x1a9fea['id'],'queue_name':_0x4311cc[_0x941d('0x31')],'SmsQueueId':_0x4311cc['id'],'interface':util[_0x941d('0x67')](_0x941d('0x68'),_0x941d('0x69'),_0x1a9fea[_0x941d('0x31')]),'penalty':0x0,'paused':_0x1a9fea[_0x941d('0x66')],'createdAt':_0x1a9fea[_0x941d('0x6a')],'updatedAt':_0x1a9fea['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x941d('0x2c')](respondWithFilteredResult(_0x3e4cf5,_0x1dcbcb))['catch'](handleError(_0x3e4cf5,null));};exports[_0x941d('0x6b')]=function(_0x62802,_0x567cfc,_0x83c059){var _0x5dc289={};var _0x198bb1={};var _0x46522a;var _0x42b4a5;return db[_0x941d('0x35')][_0x941d('0x5c')]({'where':{'id':_0x62802[_0x941d('0x59')]['id']}})[_0x941d('0x2c')](handleEntityNotFound(_0x567cfc,null))[_0x941d('0x2c')](function(_0xf7eaf0){if(_0xf7eaf0){_0x46522a=_0xf7eaf0;_0x198bb1[_0x941d('0x39')]=_['keys'](db[_0x941d('0x6c')][_0x941d('0x36')]);_0x198bb1[_0x941d('0x3a')]=_['keys'](_0x62802[_0x941d('0x3a')]);_0x198bb1[_0x941d('0x3b')]=_[_0x941d('0x4c')](_0x198bb1[_0x941d('0x39')],_0x198bb1[_0x941d('0x3a')]);_0x5dc289[_0x941d('0x3c')]=_[_0x941d('0x4c')](_0x198bb1[_0x941d('0x39')],qs[_0x941d('0x3d')](_0x62802[_0x941d('0x3a')][_0x941d('0x3d')]));_0x5dc289[_0x941d('0x3c')]=_0x5dc289[_0x941d('0x3c')][_0x941d('0x3e')]?_0x5dc289[_0x941d('0x3c')]:_0x198bb1[_0x941d('0x39')];_0x5dc289[_0x941d('0x3f')]=qs[_0x941d('0x5f')](_0x62802['query']['sort']);_0x5dc289[_0x941d('0x40')]=qs[_0x941d('0x3b')](_['pick'](_0x62802[_0x941d('0x3a')],_0x198bb1[_0x941d('0x3b')]));if(_0x62802['query'][_0x941d('0x44')]){_0x5dc289[_0x941d('0x40')]=_[_0x941d('0x45')](_0x5dc289[_0x941d('0x40')],{'$or':_[_0x941d('0x34')](_0x5dc289[_0x941d('0x3c')],function(_0x7dd5ea){var _0x1b0b07={};_0x1b0b07[_0x7dd5ea]={'$like':'%'+_0x62802[_0x941d('0x3a')][_0x941d('0x44')]+'%'};return _0x1b0b07;})});}_0x5dc289=_[_0x941d('0x45')]({},_0x5dc289,_0x62802[_0x941d('0x4d')]);return _0x46522a[_0x941d('0x6b')](_0x5dc289);}})[_0x941d('0x2c')](function(_0x14c405){if(_0x14c405){_0x42b4a5=_0x14c405[_0x941d('0x3e')];if(!_0x62802[_0x941d('0x3a')][_0x941d('0x5e')](_0x941d('0x6d'))){_0x5dc289[_0x941d('0x24')]=qs[_0x941d('0x24')](_0x62802[_0x941d('0x3a')]['limit']);_0x5dc289[_0x941d('0x22')]=qs['offset'](_0x62802[_0x941d('0x3a')][_0x941d('0x22')]);}return _0x46522a['getTeams'](_0x5dc289);}})[_0x941d('0x2c')](function(_0x14eeb8){if(_0x14eeb8){return _0x14eeb8?{'count':_0x42b4a5,'rows':_0x14eeb8}:null;}})['then'](respondWithResult(_0x567cfc,null))[_0x941d('0x49')](handleError(_0x567cfc,null));};exports['addTeams']=function(_0x4b7e6c,_0x298242,_0x321fc6){var _0x80abef=_0x4b7e6c['body'][_0x941d('0x6e')];return db[_0x941d('0x6c')][_0x941d('0x61')]({'where':{'id':_0x80abef},'attributes':['id'],'include':[{'model':db[_0x941d('0x62')],'as':_0x941d('0x6f'),'attributes':['id',_0x941d('0x31'),_0x941d('0x70'),_0x941d('0x71'),'interface'],'raw':!![]}]})[_0x941d('0x2c')](function(_0xd052ab){if(_0xd052ab){var _0x588f12=_[_0x941d('0x72')](_0xd052ab,function(_0x30bb82){var _0x4ad3f9=_0x30bb82[_0x941d('0x2d')]({'plain':!![]});return _0x4ad3f9['Agents'];});return db[_0x941d('0x35')]['find']({'where':{'id':_0x4b7e6c[_0x941d('0x59')]['id']}})[_0x941d('0x2c')](function(_0x3f51f9){return db['sequelize'][_0x941d('0x73')](function(_0x567679){return _0x3f51f9['addTeams'](_0x80abef,{'transaction':_0x567679})[_0x941d('0x2c')](function(){return BPromise['each'](_0x588f12,function(_0x11ff5c){return db[_0x941d('0x5d')]['findOrCreate']({'where':{'UserId':_0x11ff5c['id'],'SmsQueueId':_0x4b7e6c[_0x941d('0x59')]['id']},'transaction':_0x567679});});})[_0x941d('0x2c')](function(){_0x588f12['forEach'](function(_0xfcd99e){socket[_0x941d('0x74')](_0x941d('0x75'),{'UserId':_0xfcd99e['id'],'SmsQueueId':_0x3f51f9['id']});});});});});}})[_0x941d('0x2c')](respondWithStatusCode(_0x298242,null))[_0x941d('0x49')](handleError(_0x298242,null));};exports[_0x941d('0x76')]=function(_0x4d018e,_0x539dca,_0x5e12b5){return db['Team'][_0x941d('0x61')]({'where':{'id':_0x4d018e[_0x941d('0x3a')][_0x941d('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x941d('0x62')],'as':_0x941d('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x941d('0x2c')](handleEntityNotFound(_0x539dca,null))[_0x941d('0x2c')](function(_0x391c79){var _0x4319e6=_[_0x941d('0x34')](_0x391c79,'id');var _0x5f4304=[];var _0x2d685f=[];var _0x33f10e=squel['select']();_0x33f10e[_0x941d('0x77')](_0x941d('0x78'))[_0x941d('0x79')](_0x941d('0x7a'),'tq')['join'](_0x941d('0x7b'),'ut',_0x941d('0x7c'))['where'](_0x941d('0x7d'),_0x4d018e[_0x941d('0x59')]['id']);for(var _0x839116=0x0;_0x839116<_0x391c79[_0x941d('0x3e')];_0x839116+=0x1){let _0x2ae260=_0x391c79[_0x839116];for(var _0x100050=0x0;_0x100050<_0x2ae260[_0x941d('0x6f')][_0x941d('0x3e')];_0x100050+=0x1){let _0x410903=_0x2ae260['Agents'][_0x100050];var _0x311035=_0x33f10e[_0x941d('0x7e')]();_0x311035[_0x941d('0x40')](_0x941d('0x7f'),_0x410903['id']);_0x2d685f['push'](db[_0x941d('0x80')]['query'](_0x311035[_0x941d('0x81')](),{'type':db[_0x941d('0x80')][_0x941d('0x82')][_0x941d('0x83')]})[_0x941d('0x2c')](function(_0x479131){if(_0x479131[_0x941d('0x3e')]===0x1){return _0x410903['id'];}else{var _0x1452dd=_[_0x941d('0x84')](_['map'](_0x479131,_0x941d('0x85')),function(_0x1397d6){return _[_0x941d('0x86')](_0x4319e6,_0x1397d6);});if(_0x1452dd){return _0x410903['id'];}}}));}}return BPromise['all'](_0x2d685f)[_0x941d('0x2c')](function(_0x525e80){_0x5f4304=_(_0x5f4304)[_0x941d('0x87')](_0x525e80)[_0x941d('0x88')]()['value']();return db['SmsQueue'][_0x941d('0x58')]({'where':{'id':_0x4d018e[_0x941d('0x59')]['id']}})[_0x941d('0x2c')](function(_0x4ceb6a){return db[_0x941d('0x80')][_0x941d('0x73')](function(_0xcca66b){return _0x4ceb6a[_0x941d('0x76')](_0x4d018e[_0x941d('0x3a')][_0x941d('0x6e')],{'transaction':_0xcca66b})[_0x941d('0x2c')](function(){if(!_['isEmpty'](_0x5f4304)){return _0x4ceb6a[_0x941d('0x89')](_0x5f4304,{'transaction':_0xcca66b});}})[_0x941d('0x2c')](function(){_0x5f4304['forEach'](function(_0x254f68){socket['emit'](_0x941d('0x8a'),{'UserId':_0x254f68,'SmsQueueId':_0x4ceb6a['id']});});});});});});})[_0x941d('0x2c')](respondWithStatusCode(_0x539dca,null))['catch'](handleError(_0x539dca,null));};exports[_0x941d('0x8b')]=function(_0x1d0a88,_0x22e97a,_0x477bbd){return db['SmsQueue']['find']({'where':{'id':_0x1d0a88[_0x941d('0x59')]['id']}})['then'](handleEntityNotFound(_0x22e97a,null))[_0x941d('0x2c')](function(_0x4a6e80){if(_0x4a6e80){return _0x4a6e80['addAgents'](_0x1d0a88[_0x941d('0x4f')][_0x941d('0x6e')],_['omit'](_0x1d0a88['body'],[_0x941d('0x6e'),'id'])||{})['spread'](function(_0x4d1e8a){for(var _0x254289=0x0;_0x254289<_0x1d0a88[_0x941d('0x4f')]['ids'][_0x941d('0x3e')];_0x254289+=0x1){socket[_0x941d('0x74')](_0x941d('0x75'),{'UserId':Number(_0x1d0a88['body'][_0x941d('0x6e')][_0x254289]),'SmsQueueId':Number(_0x1d0a88[_0x941d('0x59')]['id'])});}return _0x4d1e8a;});}})[_0x941d('0x2c')](respondWithResult(_0x22e97a,null))[_0x941d('0x49')](handleError(_0x22e97a,null));};exports[_0x941d('0x89')]=function(_0x1237eb,_0x4f3897,_0x47903a){return db[_0x941d('0x35')]['find']({'where':{'id':_0x1237eb[_0x941d('0x59')]['id']}})[_0x941d('0x2c')](handleEntityNotFound(_0x4f3897,null))[_0x941d('0x2c')](function(_0x1d3827){if(_0x1d3827){return _0x1d3827[_0x941d('0x89')](_0x1237eb[_0x941d('0x3a')][_0x941d('0x6e')])['then'](function(){if(_[_0x941d('0x8c')](_0x1237eb[_0x941d('0x3a')][_0x941d('0x6e')])){for(var _0x2bf523=0x0;_0x2bf523<_0x1237eb[_0x941d('0x3a')]['ids'][_0x941d('0x3e')];_0x2bf523+=0x1){socket['emit'](_0x941d('0x8a'),{'UserId':Number(_0x1237eb['query'][_0x941d('0x6e')][_0x2bf523]),'SmsQueueId':Number(_0x1237eb[_0x941d('0x59')]['id'])});}}else{socket[_0x941d('0x74')](_0x941d('0x8a'),{'UserId':Number(_0x1237eb['query']['ids']),'SmsQueueId':Number(_0x1237eb[_0x941d('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f3897,null))[_0x941d('0x49')](handleError(_0x4f3897,null));};exports['getAgents']=function(_0xee9d67,_0x3c5266,_0x3f3092){var _0x49604d={};var _0x320a38={};var _0x36a22a;var _0x274cd9;return db[_0x941d('0x35')]['findOne']({'where':{'id':_0xee9d67[_0x941d('0x59')]['id']}})[_0x941d('0x2c')](handleEntityNotFound(_0x3c5266,null))[_0x941d('0x2c')](function(_0x39632b){if(_0x39632b){_0x36a22a=_0x39632b;_0x320a38[_0x941d('0x39')]=_[_0x941d('0x4b')](db['User'][_0x941d('0x36')]);_0x320a38['query']=_[_0x941d('0x4b')](_0xee9d67[_0x941d('0x3a')]);_0x320a38[_0x941d('0x3b')]=_[_0x941d('0x4c')](_0x320a38[_0x941d('0x39')],_0x320a38[_0x941d('0x3a')]);_0x49604d[_0x941d('0x3c')]=_[_0x941d('0x4c')](_0x320a38['model'],qs[_0x941d('0x3d')](_0xee9d67['query'][_0x941d('0x3d')]));_0x49604d[_0x941d('0x3c')]=_0x49604d[_0x941d('0x3c')][_0x941d('0x3e')]?_0x49604d['attributes']:_0x320a38['model'];_0x49604d[_0x941d('0x3f')]=qs[_0x941d('0x5f')](_0xee9d67['query'][_0x941d('0x5f')]);_0x49604d[_0x941d('0x40')]=qs['filters'](_[_0x941d('0x41')](_0xee9d67[_0x941d('0x3a')],_0x320a38['filters']));if(_0xee9d67['query'][_0x941d('0x44')]){_0x49604d[_0x941d('0x40')]=_[_0x941d('0x45')](_0x49604d[_0x941d('0x40')],{'$or':_[_0x941d('0x34')](_0x49604d['attributes'],function(_0x14885a){var _0x459bc0={};_0x459bc0[_0x14885a]={'$like':'%'+_0xee9d67[_0x941d('0x3a')]['filter']+'%'};return _0x459bc0;})});}_0x49604d=_['merge']({},_0x49604d,_0xee9d67[_0x941d('0x4d')]);return _0x36a22a[_0x941d('0x8d')](_0x49604d);}})[_0x941d('0x2c')](function(_0x33f84a){if(_0x33f84a){_0x274cd9=_0x33f84a[_0x941d('0x3e')];if(!_0xee9d67['query'][_0x941d('0x5e')](_0x941d('0x6d'))){_0x49604d['limit']=qs[_0x941d('0x24')](_0xee9d67[_0x941d('0x3a')]['limit']);_0x49604d[_0x941d('0x22')]=qs[_0x941d('0x22')](_0xee9d67[_0x941d('0x3a')][_0x941d('0x22')]);}return _0x36a22a[_0x941d('0x8d')](_0x49604d);}})[_0x941d('0x2c')](function(_0x205ff3){if(_0x205ff3){return _0x205ff3?{'count':_0x274cd9,'rows':_0x205ff3}:null;}})[_0x941d('0x2c')](respondWithResult(_0x3c5266,null))['catch'](handleError(_0x3c5266,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 144ee4a..9c4c12f 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 _0x6628=['exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x18f90c,_0x3f7c22){var _0x483815=function(_0x846270){while(--_0x846270){_0x18f90c['push'](_0x18f90c['shift']());}};_0x483815(++_0x3f7c22);}(_0x6628,0xac));var _0x8662=function(_0x50f54b,_0x3990ab){_0x50f54b=_0x50f54b-0x0;var _0x48c8f7=_0x6628[_0x50f54b];return _0x48c8f7;};'use strict';var EventEmitter=require(_0x8662('0x0'));var SmsQueue=require(_0x8662('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8662('0x2'),'afterUpdate':_0x8662('0x3'),'afterDestroy':_0x8662('0x4')};function emitEvent(_0x509856){return function(_0x43355a,_0x501a11,_0x5f0d35){SmsQueueEvents[_0x8662('0x5')](_0x509856+':'+_0x43355a['id'],_0x43355a);SmsQueueEvents['emit'](_0x509856,_0x43355a);_0x5f0d35(null);};}for(var e in events){if(events[_0x8662('0x6')](e)){var event=events[e];SmsQueue[_0x8662('0x7')](e,emitEvent(event));}}module[_0x8662('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x564f=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x564f,0x195));var _0xf564=function(_0x469a8d,_0xc45998){_0x469a8d=_0x469a8d-0x0;var _0x1e58dc=_0x564f[_0x469a8d];return _0x1e58dc;};'use strict';var EventEmitter=require(_0xf564('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf564('0x1')](0x0);var events={'afterCreate':_0xf564('0x2'),'afterUpdate':_0xf564('0x3'),'afterDestroy':_0xf564('0x4')};function emitEvent(_0x536c53){return function(_0x45cb43,_0x2c076f,_0x4f4b06){SmsQueueEvents[_0xf564('0x5')](_0x536c53+':'+_0x45cb43['id'],_0x45cb43);SmsQueueEvents[_0xf564('0x5')](_0x536c53,_0x45cb43);_0x4f4b06(null);};}for(var e in events){if(events[_0xf564('0x6')](e)){var event=events[e];SmsQueue[_0xf564('0x7')](e,emitEvent(event));}}module[_0xf564('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 17456a7..4f2bdf4 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 _0x4011=['moment','bluebird','request-promise','path','../../config/environment','define','sms_queues','../../config/logger','api'];(function(_0x2f3d36,_0xc2c5af){var _0x3beb8e=function(_0x34aaf4){while(--_0x34aaf4){_0x2f3d36['push'](_0x2f3d36['shift']());}};_0x3beb8e(++_0xc2c5af);}(_0x4011,0x1d2));var _0x1401=function(_0x39abf6,_0x5cd4f1){_0x39abf6=_0x39abf6-0x0;var _0x2af92d=_0x4011[_0x39abf6];return _0x2af92d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1401('0x0'))(_0x1401('0x1'));var moment=require(_0x1401('0x2'));var BPromise=require(_0x1401('0x3'));var rp=require(_0x1401('0x4'));var fs=require('fs');var path=require(_0x1401('0x5'));var rimraf=require('rimraf');var config=require(_0x1401('0x6'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x5610e9,_0x644e16){return _0x5610e9[_0x1401('0x7')]('SmsQueue',attributes,{'tableName':_0x1401('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x103d=['request-promise','path','rimraf','./smsQueue.attributes','define','SmsQueue','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3c5c37,_0x3f5565){var _0x423010=function(_0x2e7918){while(--_0x2e7918){_0x3c5c37['push'](_0x3c5c37['shift']());}};_0x423010(++_0x3f5565);}(_0x103d,0xe2));var _0xd103=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x103d[_0xd1d19a];return _0x52a79d;};'use strict';var _=require(_0xd103('0x0'));var util=require('util');var logger=require(_0xd103('0x1'))(_0xd103('0x2'));var moment=require(_0xd103('0x3'));var BPromise=require(_0xd103('0x4'));var rp=require(_0xd103('0x5'));var fs=require('fs');var path=require(_0xd103('0x6'));var rimraf=require(_0xd103('0x7'));var config=require('../../config/environment');var attributes=require(_0xd103('0x8'));module['exports']=function(_0x7b6d34,_0x50da8a){return _0x7b6d34[_0xd103('0x9')](_0xd103('0xa'),attributes,{'tableName':'sms_queues','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 e0bd13c..fa88124 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 _0xd4e4=['client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','map','model','include','find','ShowSmsQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3199cc,_0x18479b){var _0x395f8b=function(_0x11f326){while(--_0x11f326){_0x3199cc['push'](_0x3199cc['shift']());}};_0x395f8b(++_0x18479b);}(_0xd4e4,0x173));var _0x4d4e=function(_0x215926,_0x3206a4){_0x215926=_0x215926-0x0;var _0x499161=_0xd4e4[_0x215926];return _0x499161;};'use strict';var _=require(_0x4d4e('0x0'));var util=require('util');var moment=require(_0x4d4e('0x1'));var BPromise=require(_0x4d4e('0x2'));var rs=require(_0x4d4e('0x3'));var fs=require('fs');var Redis=require(_0x4d4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d4e('0x5'));var logger=require(_0x4d4e('0x6'))(_0x4d4e('0x7'));var config=require('../../config/environment');var jayson=require(_0x4d4e('0x8'));var client=jayson[_0x4d4e('0x9')][_0x4d4e('0xa')]({'port':0x232a});config[_0x4d4e('0xb')]=_[_0x4d4e('0xc')](config[_0x4d4e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4d4e('0xd'))(new Redis(config[_0x4d4e('0xb')]));require('./smsQueue.socket')[_0x4d4e('0xe')](socket);function respondWithRpcPromise(_0x32cf9c,_0x3c073d,_0x22631a){return new BPromise(function(_0x53ab26,_0x408852){return client[_0x4d4e('0xf')](_0x32cf9c,_0x22631a)[_0x4d4e('0x10')](function(_0x37de4f){logger[_0x4d4e('0x11')](_0x4d4e('0x12'),_0x3c073d,'request\x20sent');logger[_0x4d4e('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3c073d,_0x4d4e('0x14'),JSON[_0x4d4e('0x15')](_0x37de4f));if(_0x37de4f[_0x4d4e('0x16')]){if(_0x37de4f[_0x4d4e('0x16')][_0x4d4e('0x17')]===0x1f4){logger[_0x4d4e('0x16')](_0x4d4e('0x12'),_0x3c073d,_0x37de4f[_0x4d4e('0x16')][_0x4d4e('0x18')]);return _0x408852(_0x37de4f[_0x4d4e('0x16')][_0x4d4e('0x18')]);}logger[_0x4d4e('0x16')](_0x4d4e('0x12'),_0x3c073d,_0x37de4f[_0x4d4e('0x16')]['message']);return _0x53ab26(_0x37de4f[_0x4d4e('0x16')]['message']);}else{logger[_0x4d4e('0x11')](_0x4d4e('0x12'),_0x3c073d,'request\x20sent');_0x53ab26(_0x37de4f[_0x4d4e('0x19')][_0x4d4e('0x18')]);}})[_0x4d4e('0x1a')](function(_0x33fbbb){logger['error'](_0x4d4e('0x12'),_0x3c073d,_0x33fbbb);_0x408852(_0x33fbbb);});});}exports[_0x4d4e('0x1b')]=function(_0x3bef92){var _0x20bc9a=this;return new Promise(function(_0x18501d,_0x53689a){return db[_0x4d4e('0x1c')]['findAll']({'raw':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92[_0x4d4e('0x1d')][_0x4d4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92['options'][_0x4d4e('0x1f')]||null:null,'attributes':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92['options'][_0x4d4e('0x20')]||null:null,'limit':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92[_0x4d4e('0x1d')]['limit']||null:null,'include':_0x3bef92[_0x4d4e('0x1d')]?_0x3bef92['options']['include']?_[_0x4d4e('0x21')](_0x3bef92[_0x4d4e('0x1d')]['include'],function(_0x1a7f74){return{'model':db[_0x1a7f74[_0x4d4e('0x22')]],'as':_0x1a7f74['as'],'attributes':_0x1a7f74[_0x4d4e('0x20')],'include':_0x1a7f74[_0x4d4e('0x23')]?_[_0x4d4e('0x21')](_0x1a7f74[_0x4d4e('0x23')],function(_0x3ddefe){return{'model':db[_0x3ddefe[_0x4d4e('0x22')]],'as':_0x3ddefe['as'],'attributes':_0x3ddefe[_0x4d4e('0x20')],'include':_0x3ddefe[_0x4d4e('0x23')]?_[_0x4d4e('0x21')](_0x3ddefe[_0x4d4e('0x23')],function(_0x5e1284){return{'model':db[_0x5e1284[_0x4d4e('0x22')]],'as':_0x5e1284['as'],'attributes':_0x5e1284[_0x4d4e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x890cb2){logger['info']('GetSmsQueue',_0x3bef92);logger['debug'](_0x4d4e('0x1b'),_0x3bef92,JSON[_0x4d4e('0x15')](_0x890cb2));_0x18501d(_0x890cb2);})[_0x4d4e('0x1a')](function(_0x15be30){logger['error'](_0x4d4e('0x1b'),_0x15be30['message'],_0x3bef92);_0x53689a(_0x20bc9a['error'](0x1f4,_0x15be30['message']));});});};exports['ShowSmsQueue']=function(_0x5fb741){var _0x24f484=this;return new Promise(function(_0x185cdf,_0x5de6e7){return db[_0x4d4e('0x1c')][_0x4d4e('0x24')]({'raw':_0x5fb741['options']?_0x5fb741[_0x4d4e('0x1d')][_0x4d4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x5fb741[_0x4d4e('0x1d')]?_0x5fb741[_0x4d4e('0x1d')][_0x4d4e('0x1f')]||null:null,'attributes':_0x5fb741[_0x4d4e('0x1d')]?_0x5fb741['options'][_0x4d4e('0x20')]||null:null,'include':_0x5fb741[_0x4d4e('0x1d')]?_0x5fb741[_0x4d4e('0x1d')]['include']?_[_0x4d4e('0x21')](_0x5fb741[_0x4d4e('0x1d')][_0x4d4e('0x23')],function(_0x262d5e){return{'model':db[_0x262d5e[_0x4d4e('0x22')]],'as':_0x262d5e['as'],'attributes':_0x262d5e['attributes'],'include':_0x262d5e['include']?_[_0x4d4e('0x21')](_0x262d5e[_0x4d4e('0x23')],function(_0x1719fd){return{'model':db[_0x1719fd[_0x4d4e('0x22')]],'as':_0x1719fd['as'],'attributes':_0x1719fd[_0x4d4e('0x20')],'include':_0x1719fd[_0x4d4e('0x23')]?_[_0x4d4e('0x21')](_0x1719fd[_0x4d4e('0x23')],function(_0xbdd497){return{'model':db[_0xbdd497[_0x4d4e('0x22')]],'as':_0xbdd497['as'],'attributes':_0xbdd497[_0x4d4e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4d4e('0x10')](function(_0x2527c4){logger[_0x4d4e('0x11')]('ShowSmsQueue',_0x5fb741);logger[_0x4d4e('0x13')]('ShowSmsQueue',_0x5fb741,JSON[_0x4d4e('0x15')](_0x2527c4));_0x185cdf(_0x2527c4);})['catch'](function(_0x3fbdb5){logger[_0x4d4e('0x16')](_0x4d4e('0x25'),_0x3fbdb5['message'],_0x5fb741);_0x5de6e7(_0x24f484['error'](0x1f4,_0x3fbdb5[_0x4d4e('0x18')]));});});}; \ No newline at end of file +var _0xf5f8=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','SmsQueue','options','where','map','include','attributes','model','info','catch','ShowSmsQueue','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x913ef3,_0x96e9f9){var _0x1dd174=function(_0x4f7f84){while(--_0x4f7f84){_0x913ef3['push'](_0x913ef3['shift']());}};_0x1dd174(++_0x96e9f9);}(_0xf5f8,0x1db));var _0x8f5f=function(_0x5a26aa,_0x11765d){_0x5a26aa=_0x5a26aa-0x0;var _0x1cac6b=_0xf5f8[_0x5a26aa];return _0x1cac6b;};'use strict';var _=require(_0x8f5f('0x0'));var util=require(_0x8f5f('0x1'));var moment=require(_0x8f5f('0x2'));var BPromise=require(_0x8f5f('0x3'));var rs=require(_0x8f5f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f5f('0x5'))['db'];var utils=require(_0x8f5f('0x6'));var logger=require(_0x8f5f('0x7'))(_0x8f5f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8f5f('0x9')][_0x8f5f('0xa')]({'port':0x232a});config[_0x8f5f('0xb')]=_[_0x8f5f('0xc')](config[_0x8f5f('0xb')],{'host':_0x8f5f('0xd'),'port':0x18eb});var socket=require(_0x8f5f('0xe'))(new Redis(config[_0x8f5f('0xb')]));require(_0x8f5f('0xf'))[_0x8f5f('0x10')](socket);function respondWithRpcPromise(_0x4b01d3,_0x38f150,_0x48ab99){return new BPromise(function(_0x334262,_0x39b253){return client[_0x8f5f('0x11')](_0x4b01d3,_0x48ab99)[_0x8f5f('0x12')](function(_0x313b2c){logger['info'](_0x8f5f('0x13'),_0x38f150,_0x8f5f('0x14'));logger[_0x8f5f('0x15')](_0x8f5f('0x16'),_0x38f150,'request\x20sent',JSON[_0x8f5f('0x17')](_0x313b2c));if(_0x313b2c[_0x8f5f('0x18')]){if(_0x313b2c[_0x8f5f('0x18')][_0x8f5f('0x19')]===0x1f4){logger[_0x8f5f('0x18')](_0x8f5f('0x13'),_0x38f150,_0x313b2c[_0x8f5f('0x18')][_0x8f5f('0x1a')]);return _0x39b253(_0x313b2c[_0x8f5f('0x18')]['message']);}logger['error'](_0x8f5f('0x13'),_0x38f150,_0x313b2c[_0x8f5f('0x18')][_0x8f5f('0x1a')]);return _0x334262(_0x313b2c[_0x8f5f('0x18')][_0x8f5f('0x1a')]);}else{logger['info'](_0x8f5f('0x13'),_0x38f150,_0x8f5f('0x14'));_0x334262(_0x313b2c[_0x8f5f('0x1b')][_0x8f5f('0x1a')]);}})['catch'](function(_0x4cf8da){logger['error'](_0x8f5f('0x13'),_0x38f150,_0x4cf8da);_0x39b253(_0x4cf8da);});});}exports[_0x8f5f('0x1c')]=function(_0x1ee7a2){var _0xca482b=this;return new Promise(function(_0x3912d3,_0x4bfc92){return db[_0x8f5f('0x1d')]['findAll']({'raw':_0x1ee7a2[_0x8f5f('0x1e')]?_0x1ee7a2['options']['raw']===undefined?!![]:![]:!![],'where':_0x1ee7a2[_0x8f5f('0x1e')]?_0x1ee7a2[_0x8f5f('0x1e')][_0x8f5f('0x1f')]||null:null,'attributes':_0x1ee7a2[_0x8f5f('0x1e')]?_0x1ee7a2['options']['attributes']||null:null,'limit':_0x1ee7a2['options']?_0x1ee7a2[_0x8f5f('0x1e')]['limit']||null:null,'include':_0x1ee7a2['options']?_0x1ee7a2[_0x8f5f('0x1e')]['include']?_[_0x8f5f('0x20')](_0x1ee7a2['options'][_0x8f5f('0x21')],function(_0x27f264){return{'model':db[_0x27f264['model']],'as':_0x27f264['as'],'attributes':_0x27f264[_0x8f5f('0x22')],'include':_0x27f264[_0x8f5f('0x21')]?_[_0x8f5f('0x20')](_0x27f264['include'],function(_0x379a1a){return{'model':db[_0x379a1a[_0x8f5f('0x23')]],'as':_0x379a1a['as'],'attributes':_0x379a1a['attributes'],'include':_0x379a1a[_0x8f5f('0x21')]?_[_0x8f5f('0x20')](_0x379a1a['include'],function(_0x4909e2){return{'model':db[_0x4909e2[_0x8f5f('0x23')]],'as':_0x4909e2['as'],'attributes':_0x4909e2[_0x8f5f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8f5f('0x12')](function(_0x304f66){logger[_0x8f5f('0x24')](_0x8f5f('0x1c'),_0x1ee7a2);logger['debug'](_0x8f5f('0x1c'),_0x1ee7a2,JSON[_0x8f5f('0x17')](_0x304f66));_0x3912d3(_0x304f66);})[_0x8f5f('0x25')](function(_0x5f4041){logger[_0x8f5f('0x18')](_0x8f5f('0x1c'),_0x5f4041[_0x8f5f('0x1a')],_0x1ee7a2);_0x4bfc92(_0xca482b['error'](0x1f4,_0x5f4041['message']));});});};exports[_0x8f5f('0x26')]=function(_0x276116){var _0xdb6cce=this;return new Promise(function(_0x56e9b9,_0x3bdc8f){return db[_0x8f5f('0x1d')]['find']({'raw':_0x276116[_0x8f5f('0x1e')]?_0x276116[_0x8f5f('0x1e')][_0x8f5f('0x27')]===undefined?!![]:![]:!![],'where':_0x276116[_0x8f5f('0x1e')]?_0x276116[_0x8f5f('0x1e')][_0x8f5f('0x1f')]||null:null,'attributes':_0x276116[_0x8f5f('0x1e')]?_0x276116['options'][_0x8f5f('0x22')]||null:null,'include':_0x276116[_0x8f5f('0x1e')]?_0x276116[_0x8f5f('0x1e')][_0x8f5f('0x21')]?_[_0x8f5f('0x20')](_0x276116[_0x8f5f('0x1e')][_0x8f5f('0x21')],function(_0x1c14d5){return{'model':db[_0x1c14d5[_0x8f5f('0x23')]],'as':_0x1c14d5['as'],'attributes':_0x1c14d5[_0x8f5f('0x22')],'include':_0x1c14d5[_0x8f5f('0x21')]?_['map'](_0x1c14d5[_0x8f5f('0x21')],function(_0xb8a2b5){return{'model':db[_0xb8a2b5[_0x8f5f('0x23')]],'as':_0xb8a2b5['as'],'attributes':_0xb8a2b5['attributes'],'include':_0xb8a2b5[_0x8f5f('0x21')]?_['map'](_0xb8a2b5[_0x8f5f('0x21')],function(_0x32b4a1){return{'model':db[_0x32b4a1[_0x8f5f('0x23')]],'as':_0x32b4a1['as'],'attributes':_0x32b4a1[_0x8f5f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8f5f('0x12')](function(_0x3b6760){logger[_0x8f5f('0x24')](_0x8f5f('0x26'),_0x276116);logger['debug'](_0x8f5f('0x26'),_0x276116,JSON[_0x8f5f('0x17')](_0x3b6760));_0x56e9b9(_0x3b6760);})['catch'](function(_0x293af3){logger['error'](_0x8f5f('0x26'),_0x293af3[_0x8f5f('0x1a')],_0x276116);_0x3bdc8f(_0xdb6cce['error'](0x1f4,_0x293af3[_0x8f5f('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 1c7a3ef..049ffd3 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 _0xd152=['smsQueue:','./smsQueue.events','update','emit','register','length'];(function(_0x3ff82c,_0x326326){var _0x430c6a=function(_0x47dd2c){while(--_0x47dd2c){_0x3ff82c['push'](_0x3ff82c['shift']());}};_0x430c6a(++_0x326326);}(_0xd152,0x1c3));var _0x2d15=function(_0x46c57c,_0x4a4e22){_0x46c57c=_0x46c57c-0x0;var _0x59dc46=_0xd152[_0x46c57c];return _0x59dc46;};'use strict';var SmsQueueEvents=require(_0x2d15('0x0'));var events=['save','remove',_0x2d15('0x1')];function createListener(_0x5ca67e,_0x546b77){return function(_0x4a3d76){_0x546b77[_0x2d15('0x2')](_0x5ca67e,_0x4a3d76);};}function removeListener(_0x291c90,_0x2ec825){return function(){SmsQueueEvents['removeListener'](_0x291c90,_0x2ec825);};}exports[_0x2d15('0x3')]=function(_0xf2f6af){for(var _0x1a0e5c=0x0,_0xeae154=events[_0x2d15('0x4')];_0x1a0e5c<_0xeae154;_0x1a0e5c++){var _0x596639=events[_0x1a0e5c];var _0x34dddb=createListener(_0x2d15('0x5')+_0x596639,_0xf2f6af);SmsQueueEvents['on'](_0x596639,_0x34dddb);}}; \ No newline at end of file +var _0xc0ba=['emit','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0xc0ba,0x159));var _0xac0b=function(_0x3998ff,_0x58f511){_0x3998ff=_0x3998ff-0x0;var _0xfd997d=_0xc0ba[_0x3998ff];return _0xfd997d;};'use strict';var SmsQueueEvents=require(_0xac0b('0x0'));var events=[_0xac0b('0x1'),_0xac0b('0x2'),'update'];function createListener(_0x5e8d17,_0x529695){return function(_0x3762bf){_0x529695[_0xac0b('0x3')](_0x5e8d17,_0x3762bf);};}function removeListener(_0x4d3091,_0x5769d3){return function(){SmsQueueEvents['removeListener'](_0x4d3091,_0x5769d3);};}exports['register']=function(_0x38ec6a){for(var _0x1de6fe=0x0,_0x46b7f9=events[_0xac0b('0x4')];_0x1de6fe<_0x46b7f9;_0x1de6fe++){var _0x1de42f=events[_0x1de6fe];var _0x2ea172=createListener(_0xac0b('0x5')+_0x1de42f,_0x38ec6a);SmsQueueEvents['on'](_0x1de42f,_0x2ea172);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 3a3574c..c4e630a 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 _0x9cd2=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x9cd2,0x85));var _0x29cd=function(_0x127783,_0x258715){_0x127783=_0x127783-0x0;var _0x14f298=_0x9cd2[_0x127783];return _0x14f298;};'use strict';var multer=require(_0x29cd('0x0'));var util=require('util');var path=require(_0x29cd('0x1'));var timeout=require(_0x29cd('0x2'));var express=require(_0x29cd('0x3'));var router=express[_0x29cd('0x4')]();var fs_extra=require(_0x29cd('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29cd('0x6'));var controller=require(_0x29cd('0x7'));router[_0x29cd('0x8')]('/',auth[_0x29cd('0x9')](),controller[_0x29cd('0xa')]);router[_0x29cd('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x29cd('0xb')]);router['get'](_0x29cd('0xc'),auth[_0x29cd('0x9')](),controller[_0x29cd('0xd')]);router[_0x29cd('0xe')]('/',auth[_0x29cd('0x9')](),controller[_0x29cd('0xf')]);router[_0x29cd('0x10')](_0x29cd('0xc'),auth['isAuthenticated'](),controller[_0x29cd('0x11')]);router[_0x29cd('0x12')](_0x29cd('0xc'),auth[_0x29cd('0x9')](),controller[_0x29cd('0x13')]);module[_0x29cd('0x14')]=router; \ No newline at end of file +var _0xe946=['post','put','delete','/:id','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','show'];(function(_0x2c4b06,_0x5e8a08){var _0x3669d5=function(_0x1700a4){while(--_0x1700a4){_0x2c4b06['push'](_0x2c4b06['shift']());}};_0x3669d5(++_0x5e8a08);}(_0xe946,0x18d));var _0x6e94=function(_0x56af4d,_0x135847){_0x56af4d=_0x56af4d-0x0;var _0x5f2a2f=_0xe946[_0x56af4d];return _0x5f2a2f;};'use strict';var multer=require('multer');var util=require(_0x6e94('0x0'));var path=require(_0x6e94('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e94('0x2'));var router=express[_0x6e94('0x3')]();var fs_extra=require(_0x6e94('0x4'));var auth=require(_0x6e94('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6e94('0x6'));var controller=require('./smsQueueReport.controller');router[_0x6e94('0x7')]('/',auth[_0x6e94('0x8')](),controller['index']);router[_0x6e94('0x7')](_0x6e94('0x9'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x6e94('0x8')](),controller[_0x6e94('0xa')]);router[_0x6e94('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6e94('0xc')]('/:id',auth[_0x6e94('0x8')](),controller['update']);router[_0x6e94('0xd')](_0x6e94('0xe'),auth[_0x6e94('0x8')](),controller[_0x6e94('0xf')]);module[_0x6e94('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index dee8f81..82ab31f 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 _0xd10c=['exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd10c,0x1c3));var _0xcd10=function(_0x4de310,_0x1990c2){_0x4de310=_0x4de310-0x0;var _0x4201d1=_0xd10c[_0x4de310];return _0x4201d1;};'use strict';var moment=require(_0xcd10('0x0'));var Sequelize=require('sequelize');module[_0xcd10('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xcd10('0x2')]},'joinAt':{'type':Sequelize[_0xcd10('0x3')]},'leaveAt':{'type':Sequelize[_0xcd10('0x3')]},'acceptAt':{'type':Sequelize[_0xcd10('0x3')]},'exitAt':{'type':Sequelize[_0xcd10('0x3')]},'reason':{'type':Sequelize[_0xcd10('0x2')]}}; \ No newline at end of file +var _0xfaf3=['STRING','DATE'];(function(_0x3d7b87,_0x40a471){var _0x368a82=function(_0x4f76e6){while(--_0x4f76e6){_0x3d7b87['push'](_0x3d7b87['shift']());}};_0x368a82(++_0x40a471);}(_0xfaf3,0x118));var _0x3faf=function(_0x4f5a2f,_0x502279){_0x4f5a2f=_0x4f5a2f-0x0;var _0x597ad6=_0xfaf3[_0x4f5a2f];return _0x597ad6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x3faf('0x0')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x3faf('0x1')]},'leaveAt':{'type':Sequelize[_0x3faf('0x1')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3faf('0x1')]},'reason':{'type':Sequelize[_0x3faf('0x0')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 27f5a27..efb148e 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 _0xd379=['findAll','rows','catch','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','where','filters','merge','options','include','SmsQueueReport'];(function(_0x32dae7,_0x5adb01){var _0x5388a5=function(_0x4ea990){while(--_0x4ea990){_0x32dae7['push'](_0x32dae7['shift']());}};_0x5388a5(++_0x5adb01);}(_0xd379,0x91));var _0x9d37=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd379[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9d37('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d37('0x1'));var jsonpatch=require(_0x9d37('0x2'));var rp=require(_0x9d37('0x3'));var moment=require(_0x9d37('0x4'));var BPromise=require(_0x9d37('0x5'));var Mustache=require(_0x9d37('0x6'));var util=require(_0x9d37('0x7'));var path=require(_0x9d37('0x8'));var sox=require('sox');var csv=require(_0x9d37('0x9'));var ejs=require(_0x9d37('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d37('0xb'));var squel=require(_0x9d37('0xc'));var crypto=require(_0x9d37('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9d37('0xe'));var toCsv=require(_0x9d37('0x9'));var querystring=require(_0x9d37('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9d37('0x10'));var qs=require(_0x9d37('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d37('0x12'));var logger=require('../../config/logger')(_0x9d37('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f52f0,_0xa4d6c1){_0xa4d6c1=_0xa4d6c1||0xcc;return function(_0x5dd392){if(_0x5dd392){return _0x4f52f0[_0x9d37('0x14')](_0xa4d6c1);}return _0x4f52f0[_0x9d37('0x15')](_0xa4d6c1)[_0x9d37('0x16')]();};}function respondWithResult(_0x7f46dc,_0x31fc17){_0x31fc17=_0x31fc17||0xc8;return function(_0x378829){if(_0x378829){return _0x7f46dc['status'](_0x31fc17)[_0x9d37('0x17')](_0x378829);}};}function respondWithFilteredResult(_0x8000a3,_0x1dd025){return function(_0x2c8fdf){if(_0x2c8fdf){var _0x136e14=typeof _0x1dd025[_0x9d37('0x18')]==='undefined'&&typeof _0x1dd025['limit']==='undefined';var _0x11e33a=_0x2c8fdf['count'];var _0x5e7ce5=_0x136e14?0x0:_0x1dd025['offset'];var _0x303cac=_0x136e14?_0x2c8fdf[_0x9d37('0x19')]:_0x1dd025[_0x9d37('0x18')]+_0x1dd025[_0x9d37('0x1a')];var _0x223555;if(_0x303cac>=_0x11e33a){_0x303cac=_0x11e33a;_0x223555=0xc8;}else{_0x223555=0xce;}_0x8000a3['status'](_0x223555);return _0x8000a3[_0x9d37('0x1b')](_0x9d37('0x1c'),_0x5e7ce5+'-'+_0x303cac+'/'+_0x11e33a)[_0x9d37('0x17')](_0x2c8fdf);}return null;};}function patchUpdates(_0x50a1e9){return function(_0x3e9745){try{jsonpatch['apply'](_0x3e9745,_0x50a1e9,!![]);}catch(_0x5b8044){return BPromise[_0x9d37('0x1d')](_0x5b8044);}return _0x3e9745[_0x9d37('0x1e')]();};}function saveUpdates(_0x5da3ae,_0x5cc1e5){return function(_0x39ac6c){if(_0x39ac6c){return _0x39ac6c[_0x9d37('0x1f')](_0x5da3ae)[_0x9d37('0x20')](function(_0x264f1d){return _0x264f1d;});}return null;};}function removeEntity(_0x1b0bfc,_0x3abc25){return function(_0x131def){if(_0x131def){return _0x131def[_0x9d37('0x21')]()[_0x9d37('0x20')](function(){_0x1b0bfc[_0x9d37('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340f5d,_0x32fa75){return function(_0x2a9f55){if(!_0x2a9f55){_0x340f5d[_0x9d37('0x14')](0x194);}return _0x2a9f55;};}function handleError(_0x769eb1,_0x2c37b5){_0x2c37b5=_0x2c37b5||0x1f4;return function(_0x4595a8){logger[_0x9d37('0x22')](_0x4595a8[_0x9d37('0x23')]);if(_0x4595a8[_0x9d37('0x24')]){delete _0x4595a8[_0x9d37('0x24')];}_0x769eb1[_0x9d37('0x15')](_0x2c37b5)[_0x9d37('0x25')](_0x4595a8);};}exports[_0x9d37('0x26')]=function(_0x5516d2,_0x21ca72){var _0x9cce16={},_0x42fcff={},_0x26b6ba={'count':0x0,'rows':[]};var _0x24cd9=_[_0x9d37('0x27')](db['SmsQueueReport'][_0x9d37('0x28')],function(_0x4829a6){return{'name':_0x4829a6[_0x9d37('0x29')],'type':_0x4829a6[_0x9d37('0x2a')][_0x9d37('0x2b')]};});_0x42fcff['model']=_[_0x9d37('0x27')](_0x24cd9,_0x9d37('0x24'));_0x42fcff[_0x9d37('0x2c')]=_[_0x9d37('0x2d')](_0x5516d2['query']);_0x42fcff['filters']=_[_0x9d37('0x2e')](_0x42fcff[_0x9d37('0x2f')],_0x42fcff['query']);_0x9cce16[_0x9d37('0x30')]=_[_0x9d37('0x2e')](_0x42fcff['model'],qs['fields'](_0x5516d2[_0x9d37('0x2c')][_0x9d37('0x31')]));_0x9cce16[_0x9d37('0x30')]=_0x9cce16['attributes']['length']?_0x9cce16['attributes']:_0x42fcff[_0x9d37('0x2f')];if(!_0x5516d2[_0x9d37('0x2c')][_0x9d37('0x32')](_0x9d37('0x33'))){_0x9cce16['limit']=qs[_0x9d37('0x1a')](_0x5516d2[_0x9d37('0x2c')]['limit']);_0x9cce16[_0x9d37('0x18')]=qs[_0x9d37('0x18')](_0x5516d2[_0x9d37('0x2c')][_0x9d37('0x18')]);}_0x9cce16[_0x9d37('0x34')]=qs['sort'](_0x5516d2[_0x9d37('0x2c')]['sort']);_0x9cce16[_0x9d37('0x35')]=qs[_0x9d37('0x36')](_['pick'](_0x5516d2['query'],_0x42fcff[_0x9d37('0x36')]),_0x24cd9);if(_0x5516d2[_0x9d37('0x2c')]['filter']){_0x9cce16[_0x9d37('0x35')]=_[_0x9d37('0x37')](_0x9cce16[_0x9d37('0x35')],{'$or':_[_0x9d37('0x27')](_0x24cd9,function(_0x5c4259){if(_0x5c4259[_0x9d37('0x2a')]!=='VIRTUAL'){var _0x333d2b={};_0x333d2b[_0x5c4259[_0x9d37('0x24')]]={'$like':'%'+_0x5516d2[_0x9d37('0x2c')]['filter']+'%'};return _0x333d2b;}})});}_0x9cce16=_[_0x9d37('0x37')]({},_0x9cce16,_0x5516d2[_0x9d37('0x38')]);var _0x5bbb9f={'where':_0x9cce16[_0x9d37('0x35')]};return db['SmsQueueReport']['count'](_0x5bbb9f)[_0x9d37('0x20')](function(_0x475809){_0x26b6ba[_0x9d37('0x19')]=_0x475809;if(_0x5516d2['query']['includeAll']){_0x9cce16[_0x9d37('0x39')]=[{'all':!![]}];}return db[_0x9d37('0x3a')][_0x9d37('0x3b')](_0x9cce16);})['then'](function(_0x5f472b){_0x26b6ba[_0x9d37('0x3c')]=_0x5f472b;return _0x26b6ba;})[_0x9d37('0x20')](respondWithFilteredResult(_0x21ca72,_0x9cce16))[_0x9d37('0x3d')](handleError(_0x21ca72,null));};exports['show']=function(_0x23199f,_0x32ac33){var _0x5e59b3={'raw':!![],'where':{'id':_0x23199f['params']['id']}},_0x2664e1={};_0x2664e1['model']=_['keys'](db[_0x9d37('0x3a')][_0x9d37('0x28')]);_0x2664e1[_0x9d37('0x2c')]=_[_0x9d37('0x2d')](_0x23199f[_0x9d37('0x2c')]);_0x2664e1[_0x9d37('0x36')]=_[_0x9d37('0x2e')](_0x2664e1[_0x9d37('0x2f')],_0x2664e1[_0x9d37('0x2c')]);_0x5e59b3[_0x9d37('0x30')]=_['intersection'](_0x2664e1[_0x9d37('0x2f')],qs['fields'](_0x23199f[_0x9d37('0x2c')][_0x9d37('0x31')]));_0x5e59b3['attributes']=_0x5e59b3[_0x9d37('0x30')][_0x9d37('0x3e')]?_0x5e59b3[_0x9d37('0x30')]:_0x2664e1[_0x9d37('0x2f')];if(_0x23199f[_0x9d37('0x2c')]['includeAll']){_0x5e59b3[_0x9d37('0x39')]=[{'all':!![]}];}_0x5e59b3=_['merge']({},_0x5e59b3,_0x23199f[_0x9d37('0x38')]);return db[_0x9d37('0x3a')][_0x9d37('0x3f')](_0x5e59b3)[_0x9d37('0x20')](handleEntityNotFound(_0x32ac33,null))[_0x9d37('0x20')](respondWithResult(_0x32ac33,null))['catch'](handleError(_0x32ac33,null));};exports['create']=function(_0x354465,_0xf097a3){return db[_0x9d37('0x3a')][_0x9d37('0x40')](_0x354465[_0x9d37('0x41')],{})[_0x9d37('0x20')](respondWithResult(_0xf097a3,0xc9))[_0x9d37('0x3d')](handleError(_0xf097a3,null));};exports[_0x9d37('0x1f')]=function(_0x38ab50,_0x7bbec5){if(_0x38ab50[_0x9d37('0x41')]['id']){delete _0x38ab50[_0x9d37('0x41')]['id'];}return db[_0x9d37('0x3a')][_0x9d37('0x3f')]({'where':{'id':_0x38ab50['params']['id']}})[_0x9d37('0x20')](handleEntityNotFound(_0x7bbec5,null))[_0x9d37('0x20')](saveUpdates(_0x38ab50[_0x9d37('0x41')],null))[_0x9d37('0x20')](respondWithResult(_0x7bbec5,null))[_0x9d37('0x3d')](handleError(_0x7bbec5,null));};exports[_0x9d37('0x21')]=function(_0x26db23,_0x445b02){return db[_0x9d37('0x3a')][_0x9d37('0x3f')]({'where':{'id':_0x26db23[_0x9d37('0x42')]['id']}})[_0x9d37('0x20')](handleEntityNotFound(_0x445b02,null))[_0x9d37('0x20')](removeEntity(_0x445b02,null))[_0x9d37('0x3d')](handleError(_0x445b02,null));};exports[_0x9d37('0x43')]=function(_0x1bef58,_0x4d2758){return db['SmsQueueReport'][_0x9d37('0x43')]()[_0x9d37('0x20')](respondWithResult(_0x4d2758,null))[_0x9d37('0x3d')](handleError(_0x4d2758,null));}; \ No newline at end of file +var _0x5c63=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','index','map','SmsQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','sort','pick','filter','where','VIRTUAL','includeAll','include','findAll','catch','show','params','rawAttributes','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce'];(function(_0x789cb0,_0x26758a){var _0x25046b=function(_0x5e2544){while(--_0x5e2544){_0x789cb0['push'](_0x789cb0['shift']());}};_0x25046b(++_0x26758a);}(_0x5c63,0x10f));var _0x35c6=function(_0x1f354a,_0x2e915d){_0x1f354a=_0x1f354a-0x0;var _0x5909d1=_0x5c63[_0x1f354a];return _0x5909d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35c6('0x0'));var zipdir=require(_0x35c6('0x1'));var jsonpatch=require(_0x35c6('0x2'));var rp=require(_0x35c6('0x3'));var moment=require(_0x35c6('0x4'));var BPromise=require(_0x35c6('0x5'));var Mustache=require('mustache');var util=require(_0x35c6('0x6'));var path=require(_0x35c6('0x7'));var sox=require('sox');var csv=require(_0x35c6('0x8'));var ejs=require(_0x35c6('0x9'));var fs=require('fs');var fs_extra=require(_0x35c6('0xa'));var _=require('lodash');var squel=require(_0x35c6('0xb'));var crypto=require('crypto');var jsforce=require(_0x35c6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x35c6('0xd'));var Papa=require(_0x35c6('0xe'));var Redis=require(_0x35c6('0xf'));var authService=require(_0x35c6('0x10'));var qs=require(_0x35c6('0x11'));var as=require(_0x35c6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35c6('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x35c6('0x14'));var licenseUtil=require(_0x35c6('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dbc56,_0x254b29){_0x254b29=_0x254b29||0xcc;return function(_0x24eb04){if(_0x24eb04){return _0x5dbc56['sendStatus'](_0x254b29);}return _0x5dbc56[_0x35c6('0x16')](_0x254b29)[_0x35c6('0x17')]();};}function respondWithResult(_0x55a77c,_0x333d27){_0x333d27=_0x333d27||0xc8;return function(_0x342a3c){if(_0x342a3c){return _0x55a77c['status'](_0x333d27)[_0x35c6('0x18')](_0x342a3c);}};}function respondWithFilteredResult(_0x1059b5,_0x506349){return function(_0x5eb06c){if(_0x5eb06c){var _0x80b84a=typeof _0x506349[_0x35c6('0x19')]===_0x35c6('0x1a')&&typeof _0x506349['limit']===_0x35c6('0x1a');var _0x4e574a=_0x5eb06c[_0x35c6('0x1b')];var _0x304515=_0x80b84a?0x0:_0x506349[_0x35c6('0x19')];var _0x2ec883=_0x80b84a?_0x5eb06c[_0x35c6('0x1b')]:_0x506349[_0x35c6('0x19')]+_0x506349['limit'];var _0x1df867;if(_0x2ec883>=_0x4e574a){_0x2ec883=_0x4e574a;_0x1df867=0xc8;}else{_0x1df867=0xce;}_0x1059b5['status'](_0x1df867);return _0x1059b5[_0x35c6('0x1c')](_0x35c6('0x1d'),_0x304515+'-'+_0x2ec883+'/'+_0x4e574a)[_0x35c6('0x18')](_0x5eb06c);}return null;};}function patchUpdates(_0x3171c8){return function(_0x16a5f5){try{jsonpatch['apply'](_0x16a5f5,_0x3171c8,!![]);}catch(_0x573c09){return BPromise[_0x35c6('0x1e')](_0x573c09);}return _0x16a5f5[_0x35c6('0x1f')]();};}function saveUpdates(_0x4f4c6b,_0x101e59){return function(_0x25306d){if(_0x25306d){return _0x25306d[_0x35c6('0x20')](_0x4f4c6b)['then'](function(_0x55ba1e){return _0x55ba1e;});}return null;};}function removeEntity(_0x78d618,_0x3e3605){return function(_0x8e4453){if(_0x8e4453){return _0x8e4453[_0x35c6('0x21')]()[_0x35c6('0x22')](function(){_0x78d618[_0x35c6('0x16')](0xcc)[_0x35c6('0x17')]();});}};}function handleEntityNotFound(_0x43b4d4,_0x46e9b5){return function(_0x421371){if(!_0x421371){_0x43b4d4['sendStatus'](0x194);}return _0x421371;};}function handleError(_0x4fe8dd,_0x21c4f8){_0x21c4f8=_0x21c4f8||0x1f4;return function(_0x3859af){logger[_0x35c6('0x23')](_0x3859af[_0x35c6('0x24')]);if(_0x3859af[_0x35c6('0x25')]){delete _0x3859af['name'];}_0x4fe8dd[_0x35c6('0x16')](_0x21c4f8)['send'](_0x3859af);};}exports[_0x35c6('0x26')]=function(_0x42811b,_0x484085){var _0x30edf8={},_0x27787a={},_0x57904b={'count':0x0,'rows':[]};var _0xd22408=_[_0x35c6('0x27')](db[_0x35c6('0x28')]['rawAttributes'],function(_0x5d8c64){return{'name':_0x5d8c64[_0x35c6('0x29')],'type':_0x5d8c64[_0x35c6('0x2a')][_0x35c6('0x2b')]};});_0x27787a[_0x35c6('0x2c')]=_[_0x35c6('0x27')](_0xd22408,_0x35c6('0x25'));_0x27787a[_0x35c6('0x2d')]=_[_0x35c6('0x2e')](_0x42811b[_0x35c6('0x2d')]);_0x27787a[_0x35c6('0x2f')]=_[_0x35c6('0x30')](_0x27787a['model'],_0x27787a[_0x35c6('0x2d')]);_0x30edf8['attributes']=_[_0x35c6('0x30')](_0x27787a[_0x35c6('0x2c')],qs['fields'](_0x42811b[_0x35c6('0x2d')][_0x35c6('0x31')]));_0x30edf8[_0x35c6('0x32')]=_0x30edf8[_0x35c6('0x32')][_0x35c6('0x33')]?_0x30edf8['attributes']:_0x27787a[_0x35c6('0x2c')];if(!_0x42811b[_0x35c6('0x2d')]['hasOwnProperty'](_0x35c6('0x34'))){_0x30edf8[_0x35c6('0x35')]=qs[_0x35c6('0x35')](_0x42811b[_0x35c6('0x2d')][_0x35c6('0x35')]);_0x30edf8[_0x35c6('0x19')]=qs[_0x35c6('0x19')](_0x42811b[_0x35c6('0x2d')][_0x35c6('0x19')]);}_0x30edf8['order']=qs[_0x35c6('0x36')](_0x42811b[_0x35c6('0x2d')]['sort']);_0x30edf8['where']=qs[_0x35c6('0x2f')](_[_0x35c6('0x37')](_0x42811b[_0x35c6('0x2d')],_0x27787a[_0x35c6('0x2f')]),_0xd22408);if(_0x42811b[_0x35c6('0x2d')][_0x35c6('0x38')]){_0x30edf8[_0x35c6('0x39')]=_['merge'](_0x30edf8[_0x35c6('0x39')],{'$or':_[_0x35c6('0x27')](_0xd22408,function(_0x23017f){if(_0x23017f['type']!==_0x35c6('0x3a')){var _0x3bb860={};_0x3bb860[_0x23017f[_0x35c6('0x25')]]={'$like':'%'+_0x42811b[_0x35c6('0x2d')][_0x35c6('0x38')]+'%'};return _0x3bb860;}})});}_0x30edf8=_['merge']({},_0x30edf8,_0x42811b['options']);var _0x5d3407={'where':_0x30edf8[_0x35c6('0x39')]};return db[_0x35c6('0x28')][_0x35c6('0x1b')](_0x5d3407)['then'](function(_0x4d67d2){_0x57904b['count']=_0x4d67d2;if(_0x42811b['query'][_0x35c6('0x3b')]){_0x30edf8[_0x35c6('0x3c')]=[{'all':!![]}];}return db[_0x35c6('0x28')][_0x35c6('0x3d')](_0x30edf8);})[_0x35c6('0x22')](function(_0x3d47f0){_0x57904b['rows']=_0x3d47f0;return _0x57904b;})['then'](respondWithFilteredResult(_0x484085,_0x30edf8))[_0x35c6('0x3e')](handleError(_0x484085,null));};exports[_0x35c6('0x3f')]=function(_0x2f4a7f,_0x1edc19){var _0x12ede7={'raw':!![],'where':{'id':_0x2f4a7f[_0x35c6('0x40')]['id']}},_0x2e9ca5={};_0x2e9ca5[_0x35c6('0x2c')]=_[_0x35c6('0x2e')](db[_0x35c6('0x28')][_0x35c6('0x41')]);_0x2e9ca5[_0x35c6('0x2d')]=_[_0x35c6('0x2e')](_0x2f4a7f[_0x35c6('0x2d')]);_0x2e9ca5[_0x35c6('0x2f')]=_['intersection'](_0x2e9ca5['model'],_0x2e9ca5['query']);_0x12ede7[_0x35c6('0x32')]=_['intersection'](_0x2e9ca5[_0x35c6('0x2c')],qs['fields'](_0x2f4a7f[_0x35c6('0x2d')]['fields']));_0x12ede7[_0x35c6('0x32')]=_0x12ede7[_0x35c6('0x32')]['length']?_0x12ede7[_0x35c6('0x32')]:_0x2e9ca5[_0x35c6('0x2c')];if(_0x2f4a7f[_0x35c6('0x2d')][_0x35c6('0x3b')]){_0x12ede7['include']=[{'all':!![]}];}_0x12ede7=_[_0x35c6('0x42')]({},_0x12ede7,_0x2f4a7f['options']);return db['SmsQueueReport'][_0x35c6('0x43')](_0x12ede7)[_0x35c6('0x22')](handleEntityNotFound(_0x1edc19,null))[_0x35c6('0x22')](respondWithResult(_0x1edc19,null))[_0x35c6('0x3e')](handleError(_0x1edc19,null));};exports[_0x35c6('0x44')]=function(_0x2972c4,_0x33b3ba){return db[_0x35c6('0x28')][_0x35c6('0x44')](_0x2972c4[_0x35c6('0x45')],{})[_0x35c6('0x22')](respondWithResult(_0x33b3ba,0xc9))['catch'](handleError(_0x33b3ba,null));};exports[_0x35c6('0x20')]=function(_0x482a44,_0x38ca68){if(_0x482a44[_0x35c6('0x45')]['id']){delete _0x482a44[_0x35c6('0x45')]['id'];}return db[_0x35c6('0x28')]['find']({'where':{'id':_0x482a44[_0x35c6('0x40')]['id']}})[_0x35c6('0x22')](handleEntityNotFound(_0x38ca68,null))['then'](saveUpdates(_0x482a44[_0x35c6('0x45')],null))[_0x35c6('0x22')](respondWithResult(_0x38ca68,null))[_0x35c6('0x3e')](handleError(_0x38ca68,null));};exports['destroy']=function(_0x27fc7a,_0x4dfb7e){return db[_0x35c6('0x28')][_0x35c6('0x43')]({'where':{'id':_0x27fc7a[_0x35c6('0x40')]['id']}})[_0x35c6('0x22')](handleEntityNotFound(_0x4dfb7e,null))[_0x35c6('0x22')](removeEntity(_0x4dfb7e,null))[_0x35c6('0x3e')](handleError(_0x4dfb7e,null));};exports[_0x35c6('0x46')]=function(_0x4de5f4,_0x26a823){return db[_0x35c6('0x28')][_0x35c6('0x46')]()[_0x35c6('0x22')](respondWithResult(_0x26a823,null))[_0x35c6('0x3e')](handleError(_0x26a823,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index b618881..6308735 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x59b9f3,_0x512b03){var _0x4461aa=function(_0x483952){while(--_0x483952){_0x59b9f3['push'](_0x59b9f3['shift']());}};_0x4461aa(++_0x512b03);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0xbf231d,_0x44232c){var _0x58689d=function(_0x32f7c2){while(--_0x32f7c2){_0xbf231d['push'](_0xbf231d['shift']());}};_0x58689d(++_0x44232c);}(_0xb7e7,0x121));var _0x7b7e=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb7e7[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b756ad4..f4e46ab 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 _0x2b17=['catch','UpdateSmsQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsQueueReport,\x20%s,\x20%s','message','SmsQueueReport','create','options','raw','CreateSmsQueueReport'];(function(_0x4aa181,_0x219426){var _0x446c0f=function(_0x395a26){while(--_0x395a26){_0x4aa181['push'](_0x4aa181['shift']());}};_0x446c0f(++_0x219426);}(_0x2b17,0x6a));var _0x72b1=function(_0xbee21a,_0xc3456b){_0xbee21a=_0xbee21a-0x0;var _0x83c6e4=_0x2b17[_0xbee21a];return _0x83c6e4;};'use strict';var _=require(_0x72b1('0x0'));var util=require('util');var moment=require(_0x72b1('0x1'));var BPromise=require(_0x72b1('0x2'));var rs=require(_0x72b1('0x3'));var fs=require('fs');var Redis=require(_0x72b1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x72b1('0x5'));var logger=require(_0x72b1('0x6'))(_0x72b1('0x7'));var config=require(_0x72b1('0x8'));var jayson=require(_0x72b1('0x9'));var client=jayson[_0x72b1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dc8fb,_0x2878fb,_0x1db07e){return new BPromise(function(_0x39eccd,_0x568123){return client[_0x72b1('0xb')](_0x1dc8fb,_0x1db07e)[_0x72b1('0xc')](function(_0x40118c){logger[_0x72b1('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x2878fb,'request\x20sent');logger[_0x72b1('0xe')](_0x72b1('0xf'),_0x2878fb,_0x72b1('0x10'),JSON[_0x72b1('0x11')](_0x40118c));if(_0x40118c[_0x72b1('0x12')]){if(_0x40118c['error']['code']===0x1f4){logger['error'](_0x72b1('0x13'),_0x2878fb,_0x40118c['error'][_0x72b1('0x14')]);return _0x568123(_0x40118c[_0x72b1('0x12')][_0x72b1('0x14')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2878fb,_0x40118c[_0x72b1('0x12')][_0x72b1('0x14')]);return _0x39eccd(_0x40118c['error'][_0x72b1('0x14')]);}else{logger[_0x72b1('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x2878fb,_0x72b1('0x10'));_0x39eccd(_0x40118c['result'][_0x72b1('0x14')]);}})['catch'](function(_0x75eda3){logger[_0x72b1('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x2878fb,_0x75eda3);_0x568123(_0x75eda3);});});}exports['CreateSmsQueueReport']=function(_0x285326){var _0x2bec1d=this;return new Promise(function(_0x234bff,_0x16234f){return db[_0x72b1('0x15')][_0x72b1('0x16')](_0x285326['body'],{'raw':_0x285326[_0x72b1('0x17')]?_0x285326['options'][_0x72b1('0x18')]===undefined?!![]:![]:!![]})[_0x72b1('0xc')](function(_0x12cf91){logger[_0x72b1('0xd')](_0x72b1('0x19'),_0x285326);logger[_0x72b1('0xe')]('CreateSmsQueueReport',_0x285326,JSON['stringify'](_0x12cf91));_0x234bff(_0x12cf91);})[_0x72b1('0x1a')](function(_0x1eee53){logger[_0x72b1('0x12')](_0x72b1('0x19'),_0x1eee53[_0x72b1('0x14')],_0x285326);_0x16234f(_0x2bec1d[_0x72b1('0x12')](0x1f4,_0x1eee53[_0x72b1('0x14')]));});});};exports[_0x72b1('0x1b')]=function(_0x347db8){var _0x5b7e51=this;return new Promise(function(_0x4feaa1,_0x13664f){return db[_0x72b1('0x15')][_0x72b1('0x1c')](_0x347db8[_0x72b1('0x1d')],{'raw':_0x347db8[_0x72b1('0x17')]?_0x347db8[_0x72b1('0x17')][_0x72b1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x347db8[_0x72b1('0x17')]?_0x347db8['options'][_0x72b1('0x1e')]||null:null,'attributes':_0x347db8[_0x72b1('0x17')]?_0x347db8[_0x72b1('0x17')][_0x72b1('0x1f')]||null:null,'limit':_0x347db8[_0x72b1('0x17')]?_0x347db8[_0x72b1('0x17')][_0x72b1('0x20')]||null:null})[_0x72b1('0xc')](function(_0x13e9be){logger[_0x72b1('0xd')](_0x72b1('0x1b'),_0x347db8);logger[_0x72b1('0xe')](_0x72b1('0x1b'),_0x347db8,JSON[_0x72b1('0x11')](_0x13e9be));_0x4feaa1(_0x13e9be);})[_0x72b1('0x1a')](function(_0x502363){logger['error'](_0x72b1('0x1b'),_0x502363[_0x72b1('0x14')],_0x347db8);_0x13664f(_0x5b7e51['error'](0x1f4,_0x502363[_0x72b1('0x14')]));});});}; \ No newline at end of file +var _0xf52a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateSmsQueueReport','create','raw','SmsQueueReport','update','body','options','where','attributes','limit','UpdateSmsQueueReport'];(function(_0x32c651,_0x4dfe40){var _0xca828c=function(_0x5a627e){while(--_0x5a627e){_0x32c651['push'](_0x32c651['shift']());}};_0xca828c(++_0x4dfe40);}(_0xf52a,0x14b));var _0xaf52=function(_0x50c948,_0x3e8328){_0x50c948=_0x50c948-0x0;var _0x510781=_0xf52a[_0x50c948];return _0x510781;};'use strict';var _=require(_0xaf52('0x0'));var util=require(_0xaf52('0x1'));var moment=require(_0xaf52('0x2'));var BPromise=require(_0xaf52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf52('0x4'));var db=require(_0xaf52('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaf52('0x6'));var config=require(_0xaf52('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaf52('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38a5c0,_0x1f576d,_0x182798){return new BPromise(function(_0x93b2a8,_0x9517c1){return client[_0xaf52('0x9')](_0x38a5c0,_0x182798)[_0xaf52('0xa')](function(_0x4ffa24){logger['info'](_0xaf52('0xb'),_0x1f576d,'request\x20sent');logger[_0xaf52('0xc')](_0xaf52('0xd'),_0x1f576d,_0xaf52('0xe'),JSON[_0xaf52('0xf')](_0x4ffa24));if(_0x4ffa24[_0xaf52('0x10')]){if(_0x4ffa24[_0xaf52('0x10')][_0xaf52('0x11')]===0x1f4){logger['error'](_0xaf52('0xb'),_0x1f576d,_0x4ffa24[_0xaf52('0x10')]['message']);return _0x9517c1(_0x4ffa24[_0xaf52('0x10')][_0xaf52('0x12')]);}logger[_0xaf52('0x10')](_0xaf52('0xb'),_0x1f576d,_0x4ffa24[_0xaf52('0x10')][_0xaf52('0x12')]);return _0x93b2a8(_0x4ffa24[_0xaf52('0x10')][_0xaf52('0x12')]);}else{logger[_0xaf52('0x13')](_0xaf52('0xb'),_0x1f576d,_0xaf52('0xe'));_0x93b2a8(_0x4ffa24[_0xaf52('0x14')][_0xaf52('0x12')]);}})['catch'](function(_0x29be18){logger[_0xaf52('0x10')](_0xaf52('0xb'),_0x1f576d,_0x29be18);_0x9517c1(_0x29be18);});});}exports[_0xaf52('0x15')]=function(_0x7ec8f9){var _0x4fceb6=this;return new Promise(function(_0x3aaf53,_0x133d58){return db['SmsQueueReport'][_0xaf52('0x16')](_0x7ec8f9['body'],{'raw':_0x7ec8f9['options']?_0x7ec8f9['options'][_0xaf52('0x17')]===undefined?!![]:![]:!![]})[_0xaf52('0xa')](function(_0xc3910b){logger[_0xaf52('0x13')]('CreateSmsQueueReport',_0x7ec8f9);logger[_0xaf52('0xc')](_0xaf52('0x15'),_0x7ec8f9,JSON[_0xaf52('0xf')](_0xc3910b));_0x3aaf53(_0xc3910b);})['catch'](function(_0x364e82){logger[_0xaf52('0x10')](_0xaf52('0x15'),_0x364e82['message'],_0x7ec8f9);_0x133d58(_0x4fceb6[_0xaf52('0x10')](0x1f4,_0x364e82[_0xaf52('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x1c1340){var _0x48bf16=this;return new Promise(function(_0x2ab262,_0xfaa5a7){return db[_0xaf52('0x18')][_0xaf52('0x19')](_0x1c1340[_0xaf52('0x1a')],{'raw':_0x1c1340[_0xaf52('0x1b')]?_0x1c1340[_0xaf52('0x1b')][_0xaf52('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1340[_0xaf52('0x1b')]?_0x1c1340[_0xaf52('0x1b')][_0xaf52('0x1c')]||null:null,'attributes':_0x1c1340[_0xaf52('0x1b')]?_0x1c1340['options'][_0xaf52('0x1d')]||null:null,'limit':_0x1c1340[_0xaf52('0x1b')]?_0x1c1340['options'][_0xaf52('0x1e')]||null:null})[_0xaf52('0xa')](function(_0x45b0a9){logger['info'](_0xaf52('0x1f'),_0x1c1340);logger[_0xaf52('0xc')]('UpdateSmsQueueReport',_0x1c1340,JSON['stringify'](_0x45b0a9));_0x2ab262(_0x45b0a9);})[_0xaf52('0x20')](function(_0x37878d){logger[_0xaf52('0x10')](_0xaf52('0x1f'),_0x37878d[_0xaf52('0x12')],_0x1c1340);_0xfaa5a7(_0x48bf16[_0xaf52('0x10')](0x1f4,_0x37878d[_0xaf52('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 06e3fa3..236fe58 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 _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0xca9e,0x136));var _0xeca9=function(_0x53e6f0,_0x1352e3){_0x53e6f0=_0x53e6f0-0x0;var _0x55726a=_0xca9e[_0x53e6f0];return _0x55726a;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router; \ No newline at end of file +var _0x8ce1=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x4d8a2d,_0x1c2617){var _0x2f0ba1=function(_0x411ade){while(--_0x411ade){_0x4d8a2d['push'](_0x4d8a2d['shift']());}};_0x2f0ba1(++_0x1c2617);}(_0x8ce1,0x183));var _0x18ce=function(_0x3f60de,_0x2e9b6f){_0x3f60de=_0x3f60de-0x0;var _0x172c39=_0x8ce1[_0x3f60de];return _0x172c39;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0xb')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller['show']);router[_0x18ce('0x11')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);router[_0x18ce('0x15')](_0x18ce('0x10'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 39b4145..7170712 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3dcc55,_0x1b08fa){var _0xd8cdee=function(_0xff9f96){while(--_0xff9f96){_0x3dcc55['push'](_0x3dcc55['shift']());}};_0xd8cdee(++_0x1b08fa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x95adfd,_0xbfe14c){_0x95adfd=_0x95adfd-0x0;var _0x5e28b2=_0xf4eb[_0x95adfd];return _0x5e28b2;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x5a3ff5,_0x102eea){var _0xe2034a=function(_0x5438be){while(--_0x5438be){_0x5a3ff5['push'](_0x5a3ff5['shift']());}};_0xe2034a(++_0x102eea);}(_0xaa88,0x137));var _0x8aa8=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xaa88[_0x2074db];return _0x27324c;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index e2800ec..a877af0 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 _0x87f3=['sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x87f3,0x1d1));var _0x387f=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x87f3[_0x247fa1];return _0x244f35;};'use strict';var emlformat=require(_0x387f('0x0'));var rimraf=require(_0x387f('0x1'));var zipdir=require(_0x387f('0x2'));var jsonpatch=require(_0x387f('0x3'));var rp=require('request-promise');var moment=require(_0x387f('0x4'));var BPromise=require(_0x387f('0x5'));var Mustache=require(_0x387f('0x6'));var util=require(_0x387f('0x7'));var path=require(_0x387f('0x8'));var sox=require(_0x387f('0x9'));var csv=require('to-csv');var ejs=require(_0x387f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x387f('0xb'));var squel=require('squel');var crypto=require(_0x387f('0xc'));var jsforce=require(_0x387f('0xd'));var deskjs=require(_0x387f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x387f('0xf'));var Papa=require(_0x387f('0x10'));var Redis=require(_0x387f('0x11'));var authService=require(_0x387f('0x12'));var qs=require(_0x387f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x387f('0x14'));var logger=require(_0x387f('0x15'))('api');var utils=require(_0x387f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x387f('0x17'));var db=require(_0x387f('0x18'))['db'];function respondWithStatusCode(_0x21f781,_0x15ef40){_0x15ef40=_0x15ef40||0xcc;return function(_0x3027c6){if(_0x3027c6){return _0x21f781[_0x387f('0x19')](_0x15ef40);}return _0x21f781[_0x387f('0x1a')](_0x15ef40)[_0x387f('0x1b')]();};}function respondWithResult(_0x14ea37,_0x41a058){_0x41a058=_0x41a058||0xc8;return function(_0x36ed75){if(_0x36ed75){return _0x14ea37[_0x387f('0x1a')](_0x41a058)[_0x387f('0x1c')](_0x36ed75);}};}function respondWithFilteredResult(_0x4b0717,_0x1e6e3b){return function(_0x320e54){if(_0x320e54){var _0x44fe73=typeof _0x1e6e3b[_0x387f('0x1d')]===_0x387f('0x1e')&&typeof _0x1e6e3b[_0x387f('0x1f')]===_0x387f('0x1e');var _0x39a034=_0x320e54[_0x387f('0x20')];var _0x4287e5=_0x44fe73?0x0:_0x1e6e3b[_0x387f('0x1d')];var _0x30a17e=_0x44fe73?_0x320e54[_0x387f('0x20')]:_0x1e6e3b['offset']+_0x1e6e3b['limit'];var _0x2bbcf7;if(_0x30a17e>=_0x39a034){_0x30a17e=_0x39a034;_0x2bbcf7=0xc8;}else{_0x2bbcf7=0xce;}_0x4b0717[_0x387f('0x1a')](_0x2bbcf7);return _0x4b0717[_0x387f('0x21')]('Content-Range',_0x4287e5+'-'+_0x30a17e+'/'+_0x39a034)[_0x387f('0x1c')](_0x320e54);}return null;};}function patchUpdates(_0x5c90f5){return function(_0x5a157d){try{jsonpatch[_0x387f('0x22')](_0x5a157d,_0x5c90f5,!![]);}catch(_0x3ea7bd){return BPromise[_0x387f('0x23')](_0x3ea7bd);}return _0x5a157d[_0x387f('0x24')]();};}function saveUpdates(_0xbba430,_0x4bba47){return function(_0x269572){if(_0x269572){return _0x269572[_0x387f('0x25')](_0xbba430)['then'](function(_0x418acc){return _0x418acc;});}return null;};}function removeEntity(_0x1ebed7,_0x5a9f72){return function(_0x2e5d04){if(_0x2e5d04){return _0x2e5d04[_0x387f('0x26')]()[_0x387f('0x27')](function(){_0x1ebed7['status'](0xcc)[_0x387f('0x1b')]();});}};}function handleEntityNotFound(_0x356fa8,_0xde5395){return function(_0x51b591){if(!_0x51b591){_0x356fa8[_0x387f('0x19')](0x194);}return _0x51b591;};}function handleError(_0x3d8ab4,_0x35232e){_0x35232e=_0x35232e||0x1f4;return function(_0x234367){logger[_0x387f('0x28')](_0x234367[_0x387f('0x29')]);if(_0x234367[_0x387f('0x2a')]){delete _0x234367[_0x387f('0x2a')];}_0x3d8ab4['status'](_0x35232e)[_0x387f('0x2b')](_0x234367);};}exports['index']=function(_0x3a4ec2,_0x3ba0d2){var _0x4acddf={},_0x51787c={},_0x4794b0={'count':0x0,'rows':[]};var _0x3f8910=_[_0x387f('0x2c')](db[_0x387f('0x2d')][_0x387f('0x2e')],function(_0x9edec5){return{'name':_0x9edec5[_0x387f('0x2f')],'type':_0x9edec5[_0x387f('0x30')][_0x387f('0x31')]};});_0x51787c[_0x387f('0x32')]=_['map'](_0x3f8910,_0x387f('0x2a'));_0x51787c[_0x387f('0x33')]=_[_0x387f('0x34')](_0x3a4ec2['query']);_0x51787c['filters']=_[_0x387f('0x35')](_0x51787c[_0x387f('0x32')],_0x51787c['query']);_0x4acddf['attributes']=_[_0x387f('0x35')](_0x51787c[_0x387f('0x32')],qs[_0x387f('0x36')](_0x3a4ec2[_0x387f('0x33')][_0x387f('0x36')]));_0x4acddf['attributes']=_0x4acddf[_0x387f('0x37')][_0x387f('0x38')]?_0x4acddf['attributes']:_0x51787c[_0x387f('0x32')];if(!_0x3a4ec2['query'][_0x387f('0x39')](_0x387f('0x3a'))){_0x4acddf[_0x387f('0x1f')]=qs['limit'](_0x3a4ec2[_0x387f('0x33')][_0x387f('0x1f')]);_0x4acddf[_0x387f('0x1d')]=qs[_0x387f('0x1d')](_0x3a4ec2[_0x387f('0x33')][_0x387f('0x1d')]);}_0x4acddf[_0x387f('0x3b')]=qs[_0x387f('0x3c')](_0x3a4ec2['query'][_0x387f('0x3c')]);_0x4acddf[_0x387f('0x3d')]=qs[_0x387f('0x3e')](_[_0x387f('0x3f')](_0x3a4ec2['query'],_0x51787c['filters']),_0x3f8910);if(_0x3a4ec2[_0x387f('0x33')][_0x387f('0x40')]){_0x4acddf['where']=_['merge'](_0x4acddf['where'],{'$or':_['map'](_0x3f8910,function(_0x381cee){if(_0x381cee[_0x387f('0x30')]!==_0x387f('0x41')){var _0x2919d8={};_0x2919d8[_0x381cee[_0x387f('0x2a')]]={'$like':'%'+_0x3a4ec2['query']['filter']+'%'};return _0x2919d8;}})});}_0x4acddf=_[_0x387f('0x42')]({},_0x4acddf,_0x3a4ec2['options']);var _0x3e88d6={'where':_0x4acddf['where']};return db[_0x387f('0x2d')][_0x387f('0x20')](_0x3e88d6)['then'](function(_0x468c6f){_0x4794b0['count']=_0x468c6f;if(_0x3a4ec2['query'][_0x387f('0x43')]){_0x4acddf[_0x387f('0x44')]=[{'all':!![]}];}return db[_0x387f('0x2d')][_0x387f('0x45')](_0x4acddf);})[_0x387f('0x27')](function(_0x51942e){_0x4794b0[_0x387f('0x46')]=_0x51942e;return _0x4794b0;})[_0x387f('0x27')](respondWithFilteredResult(_0x3ba0d2,_0x4acddf))['catch'](handleError(_0x3ba0d2,null));};exports[_0x387f('0x47')]=function(_0x2c1177,_0x3f805a){var _0x44baed={'raw':!![],'where':{'id':_0x2c1177[_0x387f('0x48')]['id']}},_0x2d9c59={};_0x2d9c59[_0x387f('0x32')]=_[_0x387f('0x34')](db['SmsTransferReport'][_0x387f('0x2e')]);_0x2d9c59[_0x387f('0x33')]=_[_0x387f('0x34')](_0x2c1177[_0x387f('0x33')]);_0x2d9c59[_0x387f('0x3e')]=_['intersection'](_0x2d9c59['model'],_0x2d9c59['query']);_0x44baed['attributes']=_[_0x387f('0x35')](_0x2d9c59[_0x387f('0x32')],qs['fields'](_0x2c1177[_0x387f('0x33')][_0x387f('0x36')]));_0x44baed['attributes']=_0x44baed[_0x387f('0x37')]['length']?_0x44baed[_0x387f('0x37')]:_0x2d9c59[_0x387f('0x32')];if(_0x2c1177[_0x387f('0x33')][_0x387f('0x43')]){_0x44baed[_0x387f('0x44')]=[{'all':!![]}];}_0x44baed=_[_0x387f('0x42')]({},_0x44baed,_0x2c1177[_0x387f('0x49')]);return db[_0x387f('0x2d')][_0x387f('0x4a')](_0x44baed)['then'](handleEntityNotFound(_0x3f805a,null))[_0x387f('0x27')](respondWithResult(_0x3f805a,null))['catch'](handleError(_0x3f805a,null));};exports[_0x387f('0x4b')]=function(_0x35676c,_0x49da7c){return db['SmsTransferReport']['create'](_0x35676c['body'],{})['then'](respondWithResult(_0x49da7c,0xc9))['catch'](handleError(_0x49da7c,null));};exports[_0x387f('0x25')]=function(_0x1ad163,_0x51f570){if(_0x1ad163[_0x387f('0x4c')]['id']){delete _0x1ad163['body']['id'];}return db[_0x387f('0x2d')][_0x387f('0x4a')]({'where':{'id':_0x1ad163[_0x387f('0x48')]['id']}})['then'](handleEntityNotFound(_0x51f570,null))[_0x387f('0x27')](saveUpdates(_0x1ad163[_0x387f('0x4c')],null))[_0x387f('0x27')](respondWithResult(_0x51f570,null))[_0x387f('0x4d')](handleError(_0x51f570,null));};exports[_0x387f('0x26')]=function(_0x81d88,_0x5b7644){return db['SmsTransferReport'][_0x387f('0x4a')]({'where':{'id':_0x81d88['params']['id']}})[_0x387f('0x27')](handleEntityNotFound(_0x5b7644,null))['then'](removeEntity(_0x5b7644,null))[_0x387f('0x4d')](handleError(_0x5b7644,null));};exports['describe']=function(_0x4c97df,_0x35c5d9){return db[_0x387f('0x2d')][_0x387f('0x4e')]()['then'](respondWithResult(_0x35c5d9,null))[_0x387f('0x4d')](handleError(_0x35c5d9,null));}; \ No newline at end of file +var _0x501b=['include','rows','show','params','includeAll','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','destroy','then','error','stack','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options'];(function(_0x58d5bb,_0x2e2ace){var _0x5915ce=function(_0x31994b){while(--_0x31994b){_0x58d5bb['push'](_0x58d5bb['shift']());}};_0x5915ce(++_0x2e2ace);}(_0x501b,0x13e));var _0xb501=function(_0x56c194,_0x37c948){_0x56c194=_0x56c194-0x0;var _0x30dc3b=_0x501b[_0x56c194];return _0x30dc3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb501('0x0'));var zipdir=require(_0xb501('0x1'));var jsonpatch=require(_0xb501('0x2'));var rp=require('request-promise');var moment=require(_0xb501('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb501('0x4'));var util=require('util');var path=require(_0xb501('0x5'));var sox=require(_0xb501('0x6'));var csv=require('to-csv');var ejs=require(_0xb501('0x7'));var fs=require('fs');var fs_extra=require(_0xb501('0x8'));var _=require(_0xb501('0x9'));var squel=require(_0xb501('0xa'));var crypto=require(_0xb501('0xb'));var jsforce=require(_0xb501('0xc'));var deskjs=require(_0xb501('0xd'));var toCsv=require(_0xb501('0xe'));var querystring=require('querystring');var Papa=require(_0xb501('0xf'));var Redis=require(_0xb501('0x10'));var authService=require(_0xb501('0x11'));var qs=require(_0xb501('0x12'));var as=require(_0xb501('0x13'));var hardwareService=require(_0xb501('0x14'));var logger=require(_0xb501('0x15'))(_0xb501('0x16'));var utils=require(_0xb501('0x17'));var config=require(_0xb501('0x18'));var licenseUtil=require(_0xb501('0x19'));var db=require(_0xb501('0x1a'))['db'];function respondWithStatusCode(_0x42861e,_0x45733a){_0x45733a=_0x45733a||0xcc;return function(_0x12adf8){if(_0x12adf8){return _0x42861e[_0xb501('0x1b')](_0x45733a);}return _0x42861e[_0xb501('0x1c')](_0x45733a)[_0xb501('0x1d')]();};}function respondWithResult(_0x4063c5,_0x1c4d19){_0x1c4d19=_0x1c4d19||0xc8;return function(_0x5b83b4){if(_0x5b83b4){return _0x4063c5[_0xb501('0x1c')](_0x1c4d19)[_0xb501('0x1e')](_0x5b83b4);}};}function respondWithFilteredResult(_0x148fcd,_0x3f0fce){return function(_0x4b91cf){if(_0x4b91cf){var _0x12fc20=typeof _0x3f0fce[_0xb501('0x1f')]===_0xb501('0x20')&&typeof _0x3f0fce[_0xb501('0x21')]==='undefined';var _0x5f022d=_0x4b91cf['count'];var _0x5e10ab=_0x12fc20?0x0:_0x3f0fce['offset'];var _0x3c9643=_0x12fc20?_0x4b91cf[_0xb501('0x22')]:_0x3f0fce[_0xb501('0x1f')]+_0x3f0fce[_0xb501('0x21')];var _0x148994;if(_0x3c9643>=_0x5f022d){_0x3c9643=_0x5f022d;_0x148994=0xc8;}else{_0x148994=0xce;}_0x148fcd[_0xb501('0x1c')](_0x148994);return _0x148fcd['set'](_0xb501('0x23'),_0x5e10ab+'-'+_0x3c9643+'/'+_0x5f022d)[_0xb501('0x1e')](_0x4b91cf);}return null;};}function patchUpdates(_0x28c11b){return function(_0x482408){try{jsonpatch['apply'](_0x482408,_0x28c11b,!![]);}catch(_0x3a5782){return BPromise['reject'](_0x3a5782);}return _0x482408['save']();};}function saveUpdates(_0x2db013,_0x2be69d){return function(_0x19c4c0){if(_0x19c4c0){return _0x19c4c0[_0xb501('0x24')](_0x2db013)['then'](function(_0x522b02){return _0x522b02;});}return null;};}function removeEntity(_0x336253,_0x4875a3){return function(_0x37c3b2){if(_0x37c3b2){return _0x37c3b2[_0xb501('0x25')]()[_0xb501('0x26')](function(){_0x336253['status'](0xcc)[_0xb501('0x1d')]();});}};}function handleEntityNotFound(_0x18b03d,_0x420ed1){return function(_0x16f7fa){if(!_0x16f7fa){_0x18b03d[_0xb501('0x1b')](0x194);}return _0x16f7fa;};}function handleError(_0x3236c8,_0x3e65e4){_0x3e65e4=_0x3e65e4||0x1f4;return function(_0x4efb3d){logger[_0xb501('0x27')](_0x4efb3d[_0xb501('0x28')]);if(_0x4efb3d['name']){delete _0x4efb3d['name'];}_0x3236c8['status'](_0x3e65e4)[_0xb501('0x29')](_0x4efb3d);};}exports[_0xb501('0x2a')]=function(_0x5299d8,_0x3a6ecb){var _0x514007={},_0x5a0a67={},_0x552260={'count':0x0,'rows':[]};var _0x296dc1=_[_0xb501('0x2b')](db[_0xb501('0x2c')][_0xb501('0x2d')],function(_0xc481a4){return{'name':_0xc481a4[_0xb501('0x2e')],'type':_0xc481a4[_0xb501('0x2f')][_0xb501('0x30')]};});_0x5a0a67[_0xb501('0x31')]=_[_0xb501('0x2b')](_0x296dc1,_0xb501('0x32'));_0x5a0a67[_0xb501('0x33')]=_[_0xb501('0x34')](_0x5299d8[_0xb501('0x33')]);_0x5a0a67[_0xb501('0x35')]=_[_0xb501('0x36')](_0x5a0a67[_0xb501('0x31')],_0x5a0a67['query']);_0x514007[_0xb501('0x37')]=_['intersection'](_0x5a0a67[_0xb501('0x31')],qs[_0xb501('0x38')](_0x5299d8[_0xb501('0x33')][_0xb501('0x38')]));_0x514007[_0xb501('0x37')]=_0x514007['attributes'][_0xb501('0x39')]?_0x514007['attributes']:_0x5a0a67[_0xb501('0x31')];if(!_0x5299d8[_0xb501('0x33')][_0xb501('0x3a')](_0xb501('0x3b'))){_0x514007[_0xb501('0x21')]=qs['limit'](_0x5299d8[_0xb501('0x33')]['limit']);_0x514007[_0xb501('0x1f')]=qs[_0xb501('0x1f')](_0x5299d8['query'][_0xb501('0x1f')]);}_0x514007[_0xb501('0x3c')]=qs[_0xb501('0x3d')](_0x5299d8[_0xb501('0x33')][_0xb501('0x3d')]);_0x514007[_0xb501('0x3e')]=qs['filters'](_[_0xb501('0x3f')](_0x5299d8['query'],_0x5a0a67[_0xb501('0x35')]),_0x296dc1);if(_0x5299d8[_0xb501('0x33')]['filter']){_0x514007[_0xb501('0x3e')]=_[_0xb501('0x40')](_0x514007[_0xb501('0x3e')],{'$or':_[_0xb501('0x2b')](_0x296dc1,function(_0x3396e9){if(_0x3396e9[_0xb501('0x2f')]!==_0xb501('0x41')){var _0x1fafd1={};_0x1fafd1[_0x3396e9['name']]={'$like':'%'+_0x5299d8[_0xb501('0x33')]['filter']+'%'};return _0x1fafd1;}})});}_0x514007=_[_0xb501('0x40')]({},_0x514007,_0x5299d8[_0xb501('0x42')]);var _0x59bed8={'where':_0x514007['where']};return db['SmsTransferReport']['count'](_0x59bed8)[_0xb501('0x26')](function(_0x240c5f){_0x552260[_0xb501('0x22')]=_0x240c5f;if(_0x5299d8['query']['includeAll']){_0x514007[_0xb501('0x43')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x514007);})[_0xb501('0x26')](function(_0x5d287c){_0x552260[_0xb501('0x44')]=_0x5d287c;return _0x552260;})['then'](respondWithFilteredResult(_0x3a6ecb,_0x514007))['catch'](handleError(_0x3a6ecb,null));};exports[_0xb501('0x45')]=function(_0x13c304,_0x3bfde8){var _0x3f036d={'raw':!![],'where':{'id':_0x13c304[_0xb501('0x46')]['id']}},_0x10d9a7={};_0x10d9a7[_0xb501('0x31')]=_[_0xb501('0x34')](db[_0xb501('0x2c')][_0xb501('0x2d')]);_0x10d9a7[_0xb501('0x33')]=_[_0xb501('0x34')](_0x13c304[_0xb501('0x33')]);_0x10d9a7[_0xb501('0x35')]=_['intersection'](_0x10d9a7[_0xb501('0x31')],_0x10d9a7[_0xb501('0x33')]);_0x3f036d['attributes']=_[_0xb501('0x36')](_0x10d9a7['model'],qs[_0xb501('0x38')](_0x13c304[_0xb501('0x33')][_0xb501('0x38')]));_0x3f036d[_0xb501('0x37')]=_0x3f036d[_0xb501('0x37')][_0xb501('0x39')]?_0x3f036d[_0xb501('0x37')]:_0x10d9a7[_0xb501('0x31')];if(_0x13c304[_0xb501('0x33')][_0xb501('0x47')]){_0x3f036d[_0xb501('0x43')]=[{'all':!![]}];}_0x3f036d=_[_0xb501('0x40')]({},_0x3f036d,_0x13c304[_0xb501('0x42')]);return db['SmsTransferReport'][_0xb501('0x48')](_0x3f036d)[_0xb501('0x26')](handleEntityNotFound(_0x3bfde8,null))[_0xb501('0x26')](respondWithResult(_0x3bfde8,null))[_0xb501('0x49')](handleError(_0x3bfde8,null));};exports[_0xb501('0x4a')]=function(_0x30dc88,_0x254141){return db[_0xb501('0x2c')][_0xb501('0x4a')](_0x30dc88['body'],{})[_0xb501('0x26')](respondWithResult(_0x254141,0xc9))[_0xb501('0x49')](handleError(_0x254141,null));};exports[_0xb501('0x24')]=function(_0x1404c6,_0x3c9379){if(_0x1404c6[_0xb501('0x4b')]['id']){delete _0x1404c6[_0xb501('0x4b')]['id'];}return db[_0xb501('0x2c')][_0xb501('0x48')]({'where':{'id':_0x1404c6[_0xb501('0x46')]['id']}})[_0xb501('0x26')](handleEntityNotFound(_0x3c9379,null))['then'](saveUpdates(_0x1404c6[_0xb501('0x4b')],null))['then'](respondWithResult(_0x3c9379,null))[_0xb501('0x49')](handleError(_0x3c9379,null));};exports[_0xb501('0x25')]=function(_0x4337a0,_0xb86fdd){return db[_0xb501('0x2c')][_0xb501('0x48')]({'where':{'id':_0x4337a0['params']['id']}})['then'](handleEntityNotFound(_0xb86fdd,null))[_0xb501('0x26')](removeEntity(_0xb86fdd,null))[_0xb501('0x49')](handleError(_0xb86fdd,null));};exports[_0xb501('0x4c')]=function(_0x1ef9ad,_0x4c9647){return db['SmsTransferReport'][_0xb501('0x4c')]()[_0xb501('0x26')](respondWithResult(_0x4c9647,null))['catch'](handleError(_0x4c9647,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 56038dc..6356374 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 _0x20a8=['report_sms_transfer','uniqueid','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsTransferReport'];(function(_0x4088bd,_0x334965){var _0x1f20f5=function(_0xb879e1){while(--_0xb879e1){_0x4088bd['push'](_0x4088bd['shift']());}};_0x1f20f5(++_0x334965);}(_0x20a8,0x115));var _0x820a=function(_0x255a4d,_0x29068c){_0x255a4d=_0x255a4d-0x0;var _0x108184=_0x20a8[_0x255a4d];return _0x108184;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x820a('0x0'));var moment=require(_0x820a('0x1'));var BPromise=require(_0x820a('0x2'));var rp=require(_0x820a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x820a('0x4'));var config=require(_0x820a('0x5'));var attributes=require('./smsTransferReport.attributes');module[_0x820a('0x6')]=function(_0x6312ec,_0x276f7b){return _0x6312ec[_0x820a('0x7')](_0x820a('0x8'),attributes,{'tableName':_0x820a('0x9'),'paranoid':![],'indexes':[{'name':_0x820a('0xa'),'fields':[_0x820a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd0e2=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','report_sms_transfer','uniqueid'];(function(_0x2f037f,_0x2958c5){var _0x2d1573=function(_0x34146e){while(--_0x34146e){_0x2f037f['push'](_0x2f037f['shift']());}};_0x2d1573(++_0x2958c5);}(_0xd0e2,0x1ad));var _0x2d0e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd0e2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2d0e('0x0'));var util=require(_0x2d0e('0x1'));var logger=require(_0x2d0e('0x2'))(_0x2d0e('0x3'));var moment=require(_0x2d0e('0x4'));var BPromise=require(_0x2d0e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d0e('0x6'));var rimraf=require(_0x2d0e('0x7'));var config=require(_0x2d0e('0x8'));var attributes=require(_0x2d0e('0x9'));module['exports']=function(_0xf8e63b,_0x397aa7){return _0xf8e63b[_0x2d0e('0xa')]('SmsTransferReport',attributes,{'tableName':_0x2d0e('0xb'),'paranoid':![],'indexes':[{'name':_0x2d0e('0xc'),'fields':[_0x2d0e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 8ce8999..64a3724 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 _0x8d0a=['SmsTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c8ddb,_0x3a61ef){var _0x47b29e=function(_0x25c134){while(--_0x25c134){_0x4c8ddb['push'](_0x4c8ddb['shift']());}};_0x47b29e(++_0x3a61ef);}(_0x8d0a,0x65));var _0xa8d0=function(_0x3ec960,_0x484f07){_0x3ec960=_0x3ec960-0x0;var _0x5f2052=_0x8d0a[_0x3ec960];return _0x5f2052;};'use strict';var _=require(_0xa8d0('0x0'));var util=require('util');var moment=require(_0xa8d0('0x1'));var BPromise=require(_0xa8d0('0x2'));var rs=require(_0xa8d0('0x3'));var fs=require('fs');var Redis=require(_0xa8d0('0x4'));var db=require(_0xa8d0('0x5'))['db'];var utils=require(_0xa8d0('0x6'));var logger=require(_0xa8d0('0x7'))(_0xa8d0('0x8'));var config=require(_0xa8d0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa8d0('0xa')][_0xa8d0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f95a7,_0x1f8b78,_0x3ee6b4){return new BPromise(function(_0x55ffc0,_0x508238){return client[_0xa8d0('0xc')](_0x1f95a7,_0x3ee6b4)[_0xa8d0('0xd')](function(_0x49e137){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x1f8b78,_0xa8d0('0xe'));logger['debug'](_0xa8d0('0xf'),_0x1f8b78,_0xa8d0('0xe'),JSON[_0xa8d0('0x10')](_0x49e137));if(_0x49e137[_0xa8d0('0x11')]){if(_0x49e137[_0xa8d0('0x11')][_0xa8d0('0x12')]===0x1f4){logger[_0xa8d0('0x11')](_0xa8d0('0x13'),_0x1f8b78,_0x49e137[_0xa8d0('0x11')][_0xa8d0('0x14')]);return _0x508238(_0x49e137[_0xa8d0('0x11')]['message']);}logger[_0xa8d0('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x1f8b78,_0x49e137['error'][_0xa8d0('0x14')]);return _0x55ffc0(_0x49e137[_0xa8d0('0x11')]['message']);}else{logger[_0xa8d0('0x15')](_0xa8d0('0x13'),_0x1f8b78,_0xa8d0('0xe'));_0x55ffc0(_0x49e137[_0xa8d0('0x16')][_0xa8d0('0x14')]);}})[_0xa8d0('0x17')](function(_0x4ef7bf){logger[_0xa8d0('0x11')](_0xa8d0('0x13'),_0x1f8b78,_0x4ef7bf);_0x508238(_0x4ef7bf);});});} \ No newline at end of file +var _0xaa5c=['client','http','then','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','lodash','util','moment','bluebird','../../config/logger','jayson/promise'];(function(_0x2e993b,_0x1ec8a1){var _0x27c503=function(_0x1d28ee){while(--_0x1d28ee){_0x2e993b['push'](_0x2e993b['shift']());}};_0x27c503(++_0x1ec8a1);}(_0xaa5c,0x1f2));var _0xcaa5=function(_0x22d75f,_0x25bd11){_0x22d75f=_0x22d75f-0x0;var _0x2ae675=_0xaa5c[_0x22d75f];return _0x2ae675;};'use strict';var _=require(_0xcaa5('0x0'));var util=require(_0xcaa5('0x1'));var moment=require(_0xcaa5('0x2'));var BPromise=require(_0xcaa5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcaa5('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcaa5('0x5'));var client=jayson[_0xcaa5('0x6')][_0xcaa5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5f56bc,_0x3d0a81,_0x24edf5){return new BPromise(function(_0xb27ac1,_0x1b8683){return client['request'](_0x5f56bc,_0x24edf5)[_0xcaa5('0x8')](function(_0x11b4d1){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x3d0a81,_0xcaa5('0x9'));logger[_0xcaa5('0xa')](_0xcaa5('0xb'),_0x3d0a81,'request\x20sent',JSON[_0xcaa5('0xc')](_0x11b4d1));if(_0x11b4d1['error']){if(_0x11b4d1[_0xcaa5('0xd')][_0xcaa5('0xe')]===0x1f4){logger[_0xcaa5('0xd')](_0xcaa5('0xf'),_0x3d0a81,_0x11b4d1[_0xcaa5('0xd')][_0xcaa5('0x10')]);return _0x1b8683(_0x11b4d1[_0xcaa5('0xd')]['message']);}logger[_0xcaa5('0xd')](_0xcaa5('0xf'),_0x3d0a81,_0x11b4d1[_0xcaa5('0xd')][_0xcaa5('0x10')]);return _0xb27ac1(_0x11b4d1[_0xcaa5('0xd')][_0xcaa5('0x10')]);}else{logger[_0xcaa5('0x11')](_0xcaa5('0xf'),_0x3d0a81,_0xcaa5('0x9'));_0xb27ac1(_0x11b4d1['result'][_0xcaa5('0x10')]);}})['catch'](function(_0x17e3d2){logger[_0xcaa5('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x3d0a81,_0x17e3d2);_0x1b8683(_0x17e3d2);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 7167e6f..dd5f144 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 _0x9de2=['fs-extra','../../components/auth/service','./sound.controller','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','now','file','create','put','update','delete','multer','connect-timeout','express'];(function(_0x2bbdfa,_0x960043){var _0x42f870=function(_0x2162c8){while(--_0x2162c8){_0x2bbdfa['push'](_0x2bbdfa['shift']());}};_0x42f870(++_0x960043);}(_0x9de2,0x101));var _0x29de=function(_0x128b20,_0x495b28){_0x128b20=_0x128b20-0x0;var _0x3c3259=_0x9de2[_0x128b20];return _0x3c3259;};'use strict';var multer=require(_0x29de('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x29de('0x1'));var express=require(_0x29de('0x2'));var router=express['Router']();var fs_extra=require(_0x29de('0x3'));var auth=require(_0x29de('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x29de('0x5'));router[_0x29de('0x6')]('/',auth[_0x29de('0x7')](),controller[_0x29de('0x8')]);router['get'](_0x29de('0x9'),auth[_0x29de('0x7')](),controller['show']);router[_0x29de('0x6')](_0x29de('0xa'),auth[_0x29de('0x7')](),controller[_0x29de('0xb')]);var upload=multer({'storage':multer[_0x29de('0xc')]({'destination':function(_0x4ae24e,_0x593cbd,_0x3c2165){_0x3c2165(null,path[_0x29de('0xd')](config['root'],_0x29de('0xe')));},'filename':function(_0x3cffaa,_0xa0169f,_0x297b63){_0xa0169f[_0x29de('0xf')]=_0xa0169f['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x297b63(null,util[_0x29de('0x10')](_0x29de('0x11'),path[_0x29de('0x12')](_0xa0169f['originalname'],path[_0x29de('0x13')](_0xa0169f[_0x29de('0xf')])),Date[_0x29de('0x14')](),path['extname'](_0xa0169f['originalname'])));}})});router['post']('/',upload['single'](_0x29de('0x15')),controller[_0x29de('0x16')]);router[_0x29de('0x17')]('/:id',auth[_0x29de('0x7')](),controller[_0x29de('0x18')]);router[_0x29de('0x19')](_0x29de('0x9'),auth['isAuthenticated'](),controller[_0x29de('0x19')]);module['exports']=router; \ No newline at end of file +var _0x53ad=['put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','format','basename','extname','single','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x53ad,0x109));var _0xd53a=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x53ad[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0xd53a('0x0'));var util=require(_0xd53a('0x1'));var path=require(_0xd53a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd53a('0x3'));var router=express[_0xd53a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd53a('0x5'));var config=require(_0xd53a('0x6'));var controller=require(_0xd53a('0x7'));router[_0xd53a('0x8')]('/',auth[_0xd53a('0x9')](),controller[_0xd53a('0xa')]);router[_0xd53a('0x8')](_0xd53a('0xb'),auth[_0xd53a('0x9')](),controller[_0xd53a('0xc')]);router[_0xd53a('0x8')](_0xd53a('0xd'),auth['isAuthenticated'](),controller[_0xd53a('0xe')]);var upload=multer({'storage':multer[_0xd53a('0xf')]({'destination':function(_0x3c245e,_0x1af753,_0x57f1f3){_0x57f1f3(null,path[_0xd53a('0x10')](config['root'],_0xd53a('0x11')));},'filename':function(_0x2709c3,_0x95777,_0x39edd5){_0x95777[_0xd53a('0x12')]=_0x95777[_0xd53a('0x12')][_0xd53a('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x39edd5(null,util[_0xd53a('0x14')]('%s-%s%s',path[_0xd53a('0x15')](_0x95777['originalname'],path[_0xd53a('0x16')](_0x95777[_0xd53a('0x12')])),Date['now'](),path[_0xd53a('0x16')](_0x95777[_0xd53a('0x12')])));}})});router['post']('/',upload[_0xd53a('0x17')]('file'),controller[_0xd53a('0x18')]);router[_0xd53a('0x19')](_0xd53a('0xb'),auth[_0xd53a('0x9')](),controller[_0xd53a('0x1a')]);router[_0xd53a('0x1b')](_0xd53a('0xb'),auth[_0xd53a('0x9')](),controller[_0xd53a('0x1b')]);module[_0xd53a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 9cef2db..d96b16e 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 _0x8103=['BIGINT','INTEGER','FLOAT','sequelize','exports','STRING','name'];(function(_0x37646c,_0xe91c4e){var _0x2dae3f=function(_0x2dad77){while(--_0x2dad77){_0x37646c['push'](_0x37646c['shift']());}};_0x2dae3f(++_0xe91c4e);}(_0x8103,0x1c3));var _0x3810=function(_0x10d60e,_0x464eb4){_0x10d60e=_0x10d60e-0x0;var _0xe16e80=_0x8103[_0x10d60e];return _0xe16e80;};'use strict';var Sequelize=require(_0x3810('0x0'));module[_0x3810('0x1')]={'name':{'type':Sequelize[_0x3810('0x2')],'unique':_0x3810('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x3810('0x2')]},'display_name':{'type':Sequelize[_0x3810('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x3810('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x3810('0x4')]},'original_channelCount':{'type':Sequelize[_0x3810('0x5')]},'original_bitRate':{'type':Sequelize[_0x3810('0x4')]},'original_sampleRate':{'type':Sequelize[_0x3810('0x5')]},'converted_format':{'type':Sequelize[_0x3810('0x2')]},'converted_duration':{'type':Sequelize[_0x3810('0x6')]},'converted_sampleCount':{'type':Sequelize[_0x3810('0x4')]},'converted_channelCount':{'type':Sequelize[_0x3810('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x3810('0x5')]}}; \ No newline at end of file +var _0xc7fb=['BIGINT','INTEGER','sequelize','exports','name','STRING','FLOAT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7fb,0xd4));var _0xbc7f=function(_0x595a30,_0x5eff22){_0x595a30=_0x595a30-0x0;var _0xd9250c=_0xc7fb[_0x595a30];return _0xd9250c;};'use strict';var Sequelize=require(_0xbc7f('0x0'));module[_0xbc7f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbc7f('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xbc7f('0x3')]},'display_name':{'type':Sequelize[_0xbc7f('0x3')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xbc7f('0x3')]},'original_duration':{'type':Sequelize[_0xbc7f('0x4')]},'original_sampleCount':{'type':Sequelize[_0xbc7f('0x5')]},'original_channelCount':{'type':Sequelize[_0xbc7f('0x6')]},'original_bitRate':{'type':Sequelize[_0xbc7f('0x5')]},'original_sampleRate':{'type':Sequelize[_0xbc7f('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xbc7f('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 63667e2..fc4d004 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 _0x1e78=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','then','destroy','Sounds','UserProfileResource','send','index','Sound','fieldName','key','map','name','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','catch','length','find','params','save_name','existsSync','server/files/sounds/converted','converted_format','ValidationError','Sound\x20not\x20found','join','format','%s.%s','create','file','originalname','extname','basename','filename','substring','root','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','error','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_bitRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','original_format','unlinkSync'];(function(_0x38d92b,_0x1be181){var _0x56c746=function(_0x2d8a65){while(--_0x2d8a65){_0x38d92b['push'](_0x38d92b['shift']());}};_0x56c746(++_0x1be181);}(_0x1e78,0xf8));var _0x81e7=function(_0x420c36,_0xc8683b){_0x420c36=_0x420c36-0x0;var _0x410c0b=_0x1e78[_0x420c36];return _0x410c0b;};'use strict';var emlformat=require(_0x81e7('0x0'));var rimraf=require(_0x81e7('0x1'));var zipdir=require(_0x81e7('0x2'));var jsonpatch=require(_0x81e7('0x3'));var rp=require(_0x81e7('0x4'));var moment=require(_0x81e7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x81e7('0x6'));var util=require('util');var path=require(_0x81e7('0x7'));var sox=require('sox');var csv=require(_0x81e7('0x8'));var ejs=require(_0x81e7('0x9'));var fs=require('fs');var fs_extra=require(_0x81e7('0xa'));var _=require('lodash');var squel=require(_0x81e7('0xb'));var crypto=require(_0x81e7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x81e7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x81e7('0xe'));var Papa=require(_0x81e7('0xf'));var Redis=require(_0x81e7('0x10'));var authService=require(_0x81e7('0x11'));var qs=require(_0x81e7('0x12'));var as=require(_0x81e7('0x13'));var hardwareService=require(_0x81e7('0x14'));var logger=require('../../config/logger')(_0x81e7('0x15'));var utils=require(_0x81e7('0x16'));var config=require(_0x81e7('0x17'));var licenseUtil=require(_0x81e7('0x18'));var db=require(_0x81e7('0x19'))['db'];function respondWithStatusCode(_0x1a71c7,_0x467f52){_0x467f52=_0x467f52||0xcc;return function(_0x520f94){if(_0x520f94){return _0x1a71c7[_0x81e7('0x1a')](_0x467f52);}return _0x1a71c7[_0x81e7('0x1b')](_0x467f52)[_0x81e7('0x1c')]();};}function respondWithResult(_0x1838ae,_0x412306){_0x412306=_0x412306||0xc8;return function(_0xdec4a6){if(_0xdec4a6){return _0x1838ae[_0x81e7('0x1b')](_0x412306)[_0x81e7('0x1d')](_0xdec4a6);}};}function respondWithFilteredResult(_0x771929,_0x261159){return function(_0x27662a){if(_0x27662a){var _0x178ef2=typeof _0x261159['offset']==='undefined'&&typeof _0x261159[_0x81e7('0x1e')]===_0x81e7('0x1f');var _0x38e492=_0x27662a['count'];var _0x1e5e43=_0x178ef2?0x0:_0x261159[_0x81e7('0x20')];var _0x23bd8f=_0x178ef2?_0x27662a[_0x81e7('0x21')]:_0x261159[_0x81e7('0x20')]+_0x261159[_0x81e7('0x1e')];var _0x4306c5;if(_0x23bd8f>=_0x38e492){_0x23bd8f=_0x38e492;_0x4306c5=0xc8;}else{_0x4306c5=0xce;}_0x771929[_0x81e7('0x1b')](_0x4306c5);return _0x771929[_0x81e7('0x22')](_0x81e7('0x23'),_0x1e5e43+'-'+_0x23bd8f+'/'+_0x38e492)[_0x81e7('0x1d')](_0x27662a);}return null;};}function patchUpdates(_0x573483){return function(_0xdd9550){try{jsonpatch[_0x81e7('0x24')](_0xdd9550,_0x573483,!![]);}catch(_0x5d3f30){return BPromise[_0x81e7('0x25')](_0x5d3f30);}return _0xdd9550[_0x81e7('0x26')]();};}function saveUpdates(_0x194c1d,_0x14dee4){return function(_0x47e8d8){if(_0x47e8d8){return _0x47e8d8['update'](_0x194c1d)[_0x81e7('0x27')](function(_0x8ca850){return _0x8ca850;});}return null;};}function removeEntity(_0x2d1d13,_0x8ee2ef){return function(_0x33bc47){if(_0x33bc47){return _0x33bc47[_0x81e7('0x28')]()['then'](function(){var _0x1c8b77=_0x33bc47['get']({'plain':!![]});var _0x2769e5=_0x81e7('0x29');return db[_0x81e7('0x2a')][_0x81e7('0x28')]({'where':{'type':_0x2769e5,'resourceId':_0x1c8b77['id']}})[_0x81e7('0x27')](function(){return _0x33bc47;});})[_0x81e7('0x27')](function(){_0x2d1d13[_0x81e7('0x1b')](0xcc)[_0x81e7('0x1c')]();});}};}function handleEntityNotFound(_0x59e3c6,_0x51cfce){return function(_0x517f18){if(!_0x517f18){_0x59e3c6['sendStatus'](0x194);}return _0x517f18;};}function handleError(_0x4a1ab0,_0x2fb1c8){_0x2fb1c8=_0x2fb1c8||0x1f4;return function(_0x945d75){logger['error'](_0x945d75['stack']);if(_0x945d75['name']){delete _0x945d75['name'];}_0x4a1ab0['status'](_0x2fb1c8)[_0x81e7('0x2b')](_0x945d75);};}exports[_0x81e7('0x2c')]=function(_0x33c51d,_0xeb00c6){var _0x337d51={},_0x2dd427={},_0x12c32c={'count':0x0,'rows':[]};var _0x54607f=_['map'](db[_0x81e7('0x2d')]['rawAttributes'],function(_0x192d1a){return{'name':_0x192d1a[_0x81e7('0x2e')],'type':_0x192d1a['type'][_0x81e7('0x2f')]};});_0x2dd427['model']=_[_0x81e7('0x30')](_0x54607f,_0x81e7('0x31'));_0x2dd427[_0x81e7('0x32')]=_[_0x81e7('0x33')](_0x33c51d[_0x81e7('0x32')]);_0x2dd427['filters']=_[_0x81e7('0x34')](_0x2dd427[_0x81e7('0x35')],_0x2dd427['query']);_0x337d51[_0x81e7('0x36')]=_[_0x81e7('0x34')](_0x2dd427[_0x81e7('0x35')],qs['fields'](_0x33c51d['query'][_0x81e7('0x37')]));_0x337d51['attributes']=_0x337d51['attributes']['length']?_0x337d51['attributes']:_0x2dd427[_0x81e7('0x35')];if(!_0x33c51d[_0x81e7('0x32')][_0x81e7('0x38')](_0x81e7('0x39'))){_0x337d51[_0x81e7('0x1e')]=qs['limit'](_0x33c51d[_0x81e7('0x32')][_0x81e7('0x1e')]);_0x337d51['offset']=qs[_0x81e7('0x20')](_0x33c51d[_0x81e7('0x32')][_0x81e7('0x20')]);}_0x337d51['order']=qs[_0x81e7('0x3a')](_0x33c51d[_0x81e7('0x32')][_0x81e7('0x3a')]);_0x337d51[_0x81e7('0x3b')]=qs[_0x81e7('0x3c')](_[_0x81e7('0x3d')](_0x33c51d['query'],_0x2dd427[_0x81e7('0x3c')]),_0x54607f);if(_0x33c51d[_0x81e7('0x32')][_0x81e7('0x3e')]){_0x337d51['where']=_['merge'](_0x337d51[_0x81e7('0x3b')],{'$or':_[_0x81e7('0x30')](_0x54607f,function(_0x1cff0a){if(_0x1cff0a[_0x81e7('0x3f')]!=='VIRTUAL'){var _0x20a659={};_0x20a659[_0x1cff0a[_0x81e7('0x31')]]={'$like':'%'+_0x33c51d[_0x81e7('0x32')]['filter']+'%'};return _0x20a659;}})});}_0x337d51=_[_0x81e7('0x40')]({},_0x337d51,_0x33c51d[_0x81e7('0x41')]);var _0x2cdcdb={'where':_0x337d51['where']};return db[_0x81e7('0x2d')]['count'](_0x2cdcdb)[_0x81e7('0x27')](function(_0x4346b6){_0x12c32c[_0x81e7('0x21')]=_0x4346b6;if(_0x33c51d[_0x81e7('0x32')][_0x81e7('0x42')]){_0x337d51[_0x81e7('0x43')]=[{'all':!![]}];}return db['Sound'][_0x81e7('0x44')](_0x337d51);})[_0x81e7('0x27')](function(_0x2d83e8){_0x12c32c['rows']=_0x2d83e8;return _0x12c32c;})[_0x81e7('0x27')](respondWithFilteredResult(_0xeb00c6,_0x337d51))[_0x81e7('0x45')](handleError(_0xeb00c6,null));};exports['show']=function(_0x1866e1,_0x3ccffe){var _0x45b5fd={'raw':!![],'where':{'id':_0x1866e1['params']['id']}},_0x5cb529={};_0x5cb529[_0x81e7('0x35')]=_['keys'](db[_0x81e7('0x2d')]['rawAttributes']);_0x5cb529[_0x81e7('0x32')]=_[_0x81e7('0x33')](_0x1866e1['query']);_0x5cb529[_0x81e7('0x3c')]=_[_0x81e7('0x34')](_0x5cb529[_0x81e7('0x35')],_0x5cb529[_0x81e7('0x32')]);_0x45b5fd[_0x81e7('0x36')]=_[_0x81e7('0x34')](_0x5cb529[_0x81e7('0x35')],qs['fields'](_0x1866e1['query'][_0x81e7('0x37')]));_0x45b5fd[_0x81e7('0x36')]=_0x45b5fd[_0x81e7('0x36')][_0x81e7('0x46')]?_0x45b5fd[_0x81e7('0x36')]:_0x5cb529[_0x81e7('0x35')];if(_0x1866e1['query'][_0x81e7('0x42')]){_0x45b5fd[_0x81e7('0x43')]=[{'all':!![]}];}_0x45b5fd=_[_0x81e7('0x40')]({},_0x45b5fd,_0x1866e1['options']);return db[_0x81e7('0x2d')][_0x81e7('0x47')](_0x45b5fd)[_0x81e7('0x27')](handleEntityNotFound(_0x3ccffe,null))[_0x81e7('0x27')](respondWithResult(_0x3ccffe,null))['catch'](handleError(_0x3ccffe,null));};exports['download']=function(_0x59f317,_0xd67615,_0x33b401){return db[_0x81e7('0x2d')][_0x81e7('0x47')]({'where':{'id':_0x59f317[_0x81e7('0x48')]['id']},'attributes':[_0x81e7('0x31'),_0x81e7('0x49'),'converted_format'],'raw':!![]})[_0x81e7('0x27')](handleEntityNotFound(_0xd67615,null))[_0x81e7('0x27')](function(_0x407298){if(_0x407298){if(!fs[_0x81e7('0x4a')](path['join'](config['root'],_0x81e7('0x4b'),_0x407298['save_name']+'.'+_0x407298[_0x81e7('0x4c')]))){throw new db['Sequelize'][(_0x81e7('0x4d'))](_0x81e7('0x4e'));}return _0xd67615['download'](path[_0x81e7('0x4f')](config['root'],'server/files/sounds/converted',util[_0x81e7('0x50')](_0x81e7('0x51'),_0x407298[_0x81e7('0x49')],_0x407298['converted_format'])),util['format']('%s.%s',_0x407298[_0x81e7('0x31')],_0x407298[_0x81e7('0x4c')]));}return null;})[_0x81e7('0x45')](handleError(_0xd67615,null));};exports[_0x81e7('0x52')]=function(_0x2ee359,_0x2b1b24,_0x5d5ba4){var _0x21c039={'name':path['basename'](_0x2ee359[_0x81e7('0x53')][_0x81e7('0x54')],path[_0x81e7('0x55')](_0x2ee359[_0x81e7('0x53')]['originalname'])),'save_name':path[_0x81e7('0x56')](_0x2ee359['file'][_0x81e7('0x57')],path[_0x81e7('0x55')](_0x2ee359[_0x81e7('0x53')][_0x81e7('0x57')])),'original_format':path[_0x81e7('0x55')](_0x2ee359[_0x81e7('0x53')][_0x81e7('0x54')])[_0x81e7('0x58')](0x1),'converted_format':'wav'};var _0x5e0a7b=path[_0x81e7('0x4f')](config[_0x81e7('0x59')],_0x81e7('0x5a'),_0x2ee359[_0x81e7('0x53')]['filename']);var _0x1b076a=path['join'](config['root'],'server/files/sounds/converted',util[_0x81e7('0x50')](_0x81e7('0x51'),path[_0x81e7('0x56')](_0x2ee359[_0x81e7('0x53')][_0x81e7('0x57')],path['extname'](_0x2ee359['file'][_0x81e7('0x57')])),_0x21c039['converted_format']));logger[_0x81e7('0x5b')](_0x81e7('0x5c'),_0x5e0a7b);logger[_0x81e7('0x5b')](_0x81e7('0x5d'),_0x1b076a);try{fs['chmodSync'](_0x5e0a7b,parseInt(_0x81e7('0x5e'),0x8));var _0x3ccf24=sox[_0x81e7('0x5f')](_0x5e0a7b,_0x1b076a,{'sampleRate':0x1f40,'format':_0x81e7('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ccf24['on'](_0x81e7('0x61'),function(_0x102fb5){fs['unlinkSync'](_0x5e0a7b);_0x2b1b24[_0x81e7('0x1b')](0x1f4)['send'](_0x102fb5);});_0x3ccf24['on'](_0x81e7('0x62'),function(_0x154b66){_0x21c039[_0x81e7('0x63')]=isNaN(_0x154b66[_0x81e7('0x64')])?null:_0x154b66[_0x81e7('0x64')]*0x3e8;_0x21c039[_0x81e7('0x65')]=isNaN(_0x154b66[_0x81e7('0x66')])?null:_0x154b66[_0x81e7('0x66')];_0x21c039[_0x81e7('0x67')]=isNaN(_0x154b66[_0x81e7('0x68')])?null:_0x154b66[_0x81e7('0x68')];_0x21c039[_0x81e7('0x69')]=isNaN(_0x154b66[_0x81e7('0x6a')])?null:_0x154b66[_0x81e7('0x6a')];_0x21c039[_0x81e7('0x6b')]=isNaN(_0x154b66[_0x81e7('0x6c')])?null:_0x154b66[_0x81e7('0x6c')];});_0x3ccf24['on'](_0x81e7('0x6d'),function(_0x46504c){_0x21c039['converted_duration']=isNaN(_0x46504c[_0x81e7('0x64')])?null:_0x46504c[_0x81e7('0x64')]*0x3e8;_0x21c039[_0x81e7('0x6e')]=isNaN(_0x46504c[_0x81e7('0x66')])?null:_0x46504c[_0x81e7('0x66')];_0x21c039['converted_channelCount']=isNaN(_0x46504c[_0x81e7('0x68')])?null:_0x46504c[_0x81e7('0x68')];_0x21c039[_0x81e7('0x6f')]=isNaN(_0x46504c[_0x81e7('0x6a')])?null:_0x46504c[_0x81e7('0x6a')];_0x21c039['converted_sampleRate']=isNaN(_0x46504c[_0x81e7('0x6c')])?null:_0x46504c['sampleRate'];});_0x3ccf24['on'](_0x81e7('0x1c'),function(){fs[_0x81e7('0x70')](_0x1b076a,parseInt(_0x81e7('0x5e'),0x8));return db[_0x81e7('0x2d')]['create'](_0x21c039)['then'](function(_0x405ee9){var _0x5dfff3={'role':_0x2ee359[_0x81e7('0x71')][_0x81e7('0x72')],'userProfileId':_0x2ee359[_0x81e7('0x71')][_0x81e7('0x73')]};if(!_0x5dfff3)throw new Error(_0x81e7('0x74'));if(_0x5dfff3['role']==='user'){var _0x74f94d=_0x405ee9['get']({'plain':!![]});return db[_0x81e7('0x75')][_0x81e7('0x47')]({'where':{'name':'Sounds','userProfileId':_0x5dfff3['userProfileId']},'raw':!![]})['then'](function(_0x55b731){if(_0x55b731&&_0x55b731[_0x81e7('0x76')]===0x0){return db[_0x81e7('0x2a')]['create']({'name':_0x74f94d['name'],'resourceId':_0x74f94d['id'],'type':_0x55b731['name'],'sectionId':_0x55b731['id']},{})['then'](function(){return _0x405ee9;});}else{return _0x405ee9;}})[_0x81e7('0x45')](function(_0xfec30){logger[_0x81e7('0x61')](_0x81e7('0x77'),_0xfec30);throw _0xfec30;});}return _0x405ee9;})[_0x81e7('0x27')](respondWithResult(_0x2b1b24,null))[_0x81e7('0x45')](handleError(_0x2b1b24,null));});_0x3ccf24[_0x81e7('0x78')]();}catch(_0x36c9c3){_0x2b1b24['status'](0x1f4)[_0x81e7('0x2b')](_0x36c9c3);}};exports[_0x81e7('0x79')]=function(_0x29db84,_0x123c07,_0x48acbe){return db['Sound'][_0x81e7('0x47')]({'where':{'id':_0x29db84[_0x81e7('0x48')]['id']}})[_0x81e7('0x27')](handleEntityNotFound(_0x123c07,null))[_0x81e7('0x27')](saveUpdates(_[_0x81e7('0x3d')](_0x29db84[_0x81e7('0x71')],['name','description']),null))[_0x81e7('0x27')](respondWithResult(_0x123c07,null))['catch'](handleError(_0x123c07,null));};exports['delete']=function(_0x3a80f1,_0x582a58,_0x31555c){return db[_0x81e7('0x2d')][_0x81e7('0x47')]({'where':{'id':_0x3a80f1[_0x81e7('0x48')]['id']}})[_0x81e7('0x27')](function(_0x235fad){if(_0x235fad){return _0x235fad[_0x81e7('0x28')]();}})[_0x81e7('0x27')](function(_0x851583){var _0x36d464=path['join'](config[_0x81e7('0x59')],_0x81e7('0x5a'),util[_0x81e7('0x50')]('%s.%s',_0x851583['save_name'],_0x851583[_0x81e7('0x7a')]));var _0x53b1fc=path[_0x81e7('0x4f')](config[_0x81e7('0x59')],'server/files/sounds/converted',util['format']('%s.%s',_0x851583[_0x81e7('0x49')],_0x851583[_0x81e7('0x4c')]));fs['unlinkSync'](_0x36d464);fs[_0x81e7('0x7b')](_0x53b1fc);return _0x851583;})[_0x81e7('0x27')](function(_0x3801c1){if(_0x3801c1){return _0x582a58[_0x81e7('0x1b')](0xcc)[_0x81e7('0x1c')]();}})[_0x81e7('0x27')](handleEntityNotFound(_0x582a58,null))['catch'](handleError(_0x582a58,null));}; \ No newline at end of file +var _0xe6ef=['src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','sampleRate','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','original_format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','then','destroy','UserProfileResource','error','stack','name','send','index','Sound','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','keys','includeAll','find','save_name','converted_format','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','download','join','root','format','%s.%s','create','basename','originalname','extname','file','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0xe6ef,0x186));var _0xfe6e=function(_0x5a7f66,_0x4c82b3){_0x5a7f66=_0x5a7f66-0x0;var _0x3e5205=_0xe6ef[_0x5a7f66];return _0x3e5205;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe6e('0x0'));var zipdir=require(_0xfe6e('0x1'));var jsonpatch=require(_0xfe6e('0x2'));var rp=require(_0xfe6e('0x3'));var moment=require('moment');var BPromise=require(_0xfe6e('0x4'));var Mustache=require(_0xfe6e('0x5'));var util=require(_0xfe6e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xfe6e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe6e('0x8'));var _=require('lodash');var squel=require(_0xfe6e('0x9'));var crypto=require(_0xfe6e('0xa'));var jsforce=require(_0xfe6e('0xb'));var deskjs=require(_0xfe6e('0xc'));var toCsv=require(_0xfe6e('0x7'));var querystring=require(_0xfe6e('0xd'));var Papa=require(_0xfe6e('0xe'));var Redis=require(_0xfe6e('0xf'));var authService=require(_0xfe6e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe6e('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xfe6e('0x12'));var licenseUtil=require(_0xfe6e('0x13'));var db=require(_0xfe6e('0x14'))['db'];function respondWithStatusCode(_0x387d18,_0xcbdf5){_0xcbdf5=_0xcbdf5||0xcc;return function(_0x3919e8){if(_0x3919e8){return _0x387d18[_0xfe6e('0x15')](_0xcbdf5);}return _0x387d18[_0xfe6e('0x16')](_0xcbdf5)[_0xfe6e('0x17')]();};}function respondWithResult(_0x4e347b,_0x4c07db){_0x4c07db=_0x4c07db||0xc8;return function(_0x77f493){if(_0x77f493){return _0x4e347b[_0xfe6e('0x16')](_0x4c07db)['json'](_0x77f493);}};}function respondWithFilteredResult(_0x20bb48,_0x71cb19){return function(_0x55d823){if(_0x55d823){var _0x90a4eb=typeof _0x71cb19[_0xfe6e('0x18')]===_0xfe6e('0x19')&&typeof _0x71cb19[_0xfe6e('0x1a')]===_0xfe6e('0x19');var _0xdffb62=_0x55d823[_0xfe6e('0x1b')];var _0xdef300=_0x90a4eb?0x0:_0x71cb19[_0xfe6e('0x18')];var _0x5822bd=_0x90a4eb?_0x55d823[_0xfe6e('0x1b')]:_0x71cb19[_0xfe6e('0x18')]+_0x71cb19[_0xfe6e('0x1a')];var _0x39e3f4;if(_0x5822bd>=_0xdffb62){_0x5822bd=_0xdffb62;_0x39e3f4=0xc8;}else{_0x39e3f4=0xce;}_0x20bb48[_0xfe6e('0x16')](_0x39e3f4);return _0x20bb48['set']('Content-Range',_0xdef300+'-'+_0x5822bd+'/'+_0xdffb62)[_0xfe6e('0x1c')](_0x55d823);}return null;};}function patchUpdates(_0x2aa6b2){return function(_0x475dcf){try{jsonpatch[_0xfe6e('0x1d')](_0x475dcf,_0x2aa6b2,!![]);}catch(_0x1a263e){return BPromise[_0xfe6e('0x1e')](_0x1a263e);}return _0x475dcf[_0xfe6e('0x1f')]();};}function saveUpdates(_0x1a8693,_0x594bce){return function(_0x1f0081){if(_0x1f0081){return _0x1f0081['update'](_0x1a8693)[_0xfe6e('0x20')](function(_0xd7782b){return _0xd7782b;});}return null;};}function removeEntity(_0x16ee84,_0x8e611b){return function(_0x5d39d6){if(_0x5d39d6){return _0x5d39d6[_0xfe6e('0x21')]()[_0xfe6e('0x20')](function(){var _0x466605=_0x5d39d6['get']({'plain':!![]});var _0x2f3599='Sounds';return db[_0xfe6e('0x22')][_0xfe6e('0x21')]({'where':{'type':_0x2f3599,'resourceId':_0x466605['id']}})[_0xfe6e('0x20')](function(){return _0x5d39d6;});})[_0xfe6e('0x20')](function(){_0x16ee84[_0xfe6e('0x16')](0xcc)[_0xfe6e('0x17')]();});}};}function handleEntityNotFound(_0x2ae501,_0x10345e){return function(_0x388b15){if(!_0x388b15){_0x2ae501[_0xfe6e('0x15')](0x194);}return _0x388b15;};}function handleError(_0x485ded,_0x19c739){_0x19c739=_0x19c739||0x1f4;return function(_0x22990f){logger[_0xfe6e('0x23')](_0x22990f[_0xfe6e('0x24')]);if(_0x22990f[_0xfe6e('0x25')]){delete _0x22990f[_0xfe6e('0x25')];}_0x485ded[_0xfe6e('0x16')](_0x19c739)[_0xfe6e('0x26')](_0x22990f);};}exports[_0xfe6e('0x27')]=function(_0x5862bd,_0x4afc07){var _0x277b5d={},_0x3e6477={},_0x464f03={'count':0x0,'rows':[]};var _0x18545c=_['map'](db[_0xfe6e('0x28')][_0xfe6e('0x29')],function(_0x28161e){return{'name':_0x28161e[_0xfe6e('0x2a')],'type':_0x28161e['type'][_0xfe6e('0x2b')]};});_0x3e6477['model']=_[_0xfe6e('0x2c')](_0x18545c,'name');_0x3e6477[_0xfe6e('0x2d')]=_['keys'](_0x5862bd[_0xfe6e('0x2d')]);_0x3e6477[_0xfe6e('0x2e')]=_[_0xfe6e('0x2f')](_0x3e6477[_0xfe6e('0x30')],_0x3e6477[_0xfe6e('0x2d')]);_0x277b5d[_0xfe6e('0x31')]=_[_0xfe6e('0x2f')](_0x3e6477[_0xfe6e('0x30')],qs[_0xfe6e('0x32')](_0x5862bd[_0xfe6e('0x2d')][_0xfe6e('0x32')]));_0x277b5d[_0xfe6e('0x31')]=_0x277b5d['attributes'][_0xfe6e('0x33')]?_0x277b5d[_0xfe6e('0x31')]:_0x3e6477[_0xfe6e('0x30')];if(!_0x5862bd[_0xfe6e('0x2d')][_0xfe6e('0x34')]('nolimit')){_0x277b5d[_0xfe6e('0x1a')]=qs['limit'](_0x5862bd['query'][_0xfe6e('0x1a')]);_0x277b5d[_0xfe6e('0x18')]=qs['offset'](_0x5862bd[_0xfe6e('0x2d')][_0xfe6e('0x18')]);}_0x277b5d['order']=qs['sort'](_0x5862bd[_0xfe6e('0x2d')][_0xfe6e('0x35')]);_0x277b5d[_0xfe6e('0x36')]=qs[_0xfe6e('0x2e')](_[_0xfe6e('0x37')](_0x5862bd[_0xfe6e('0x2d')],_0x3e6477[_0xfe6e('0x2e')]),_0x18545c);if(_0x5862bd['query']['filter']){_0x277b5d[_0xfe6e('0x36')]=_[_0xfe6e('0x38')](_0x277b5d[_0xfe6e('0x36')],{'$or':_[_0xfe6e('0x2c')](_0x18545c,function(_0x22670c){if(_0x22670c[_0xfe6e('0x39')]!==_0xfe6e('0x3a')){var _0x2fe99a={};_0x2fe99a[_0x22670c['name']]={'$like':'%'+_0x5862bd['query'][_0xfe6e('0x3b')]+'%'};return _0x2fe99a;}})});}_0x277b5d=_[_0xfe6e('0x38')]({},_0x277b5d,_0x5862bd[_0xfe6e('0x3c')]);var _0x6a13fa={'where':_0x277b5d[_0xfe6e('0x36')]};return db[_0xfe6e('0x28')][_0xfe6e('0x1b')](_0x6a13fa)['then'](function(_0x518327){_0x464f03[_0xfe6e('0x1b')]=_0x518327;if(_0x5862bd[_0xfe6e('0x2d')]['includeAll']){_0x277b5d[_0xfe6e('0x3d')]=[{'all':!![]}];}return db[_0xfe6e('0x28')][_0xfe6e('0x3e')](_0x277b5d);})['then'](function(_0xcc086b){_0x464f03[_0xfe6e('0x3f')]=_0xcc086b;return _0x464f03;})['then'](respondWithFilteredResult(_0x4afc07,_0x277b5d))[_0xfe6e('0x40')](handleError(_0x4afc07,null));};exports['show']=function(_0x129b6c,_0x1a229d){var _0x532564={'raw':!![],'where':{'id':_0x129b6c['params']['id']}},_0x5f008a={};_0x5f008a[_0xfe6e('0x30')]=_[_0xfe6e('0x41')](db[_0xfe6e('0x28')][_0xfe6e('0x29')]);_0x5f008a[_0xfe6e('0x2d')]=_[_0xfe6e('0x41')](_0x129b6c[_0xfe6e('0x2d')]);_0x5f008a[_0xfe6e('0x2e')]=_[_0xfe6e('0x2f')](_0x5f008a['model'],_0x5f008a['query']);_0x532564[_0xfe6e('0x31')]=_[_0xfe6e('0x2f')](_0x5f008a[_0xfe6e('0x30')],qs[_0xfe6e('0x32')](_0x129b6c['query'][_0xfe6e('0x32')]));_0x532564[_0xfe6e('0x31')]=_0x532564[_0xfe6e('0x31')][_0xfe6e('0x33')]?_0x532564['attributes']:_0x5f008a[_0xfe6e('0x30')];if(_0x129b6c[_0xfe6e('0x2d')][_0xfe6e('0x42')]){_0x532564['include']=[{'all':!![]}];}_0x532564=_[_0xfe6e('0x38')]({},_0x532564,_0x129b6c[_0xfe6e('0x3c')]);return db[_0xfe6e('0x28')][_0xfe6e('0x43')](_0x532564)[_0xfe6e('0x20')](handleEntityNotFound(_0x1a229d,null))['then'](respondWithResult(_0x1a229d,null))[_0xfe6e('0x40')](handleError(_0x1a229d,null));};exports['download']=function(_0x443955,_0x186d9d,_0x37c256){return db['Sound'][_0xfe6e('0x43')]({'where':{'id':_0x443955['params']['id']},'attributes':['name',_0xfe6e('0x44'),_0xfe6e('0x45')],'raw':!![]})['then'](handleEntityNotFound(_0x186d9d,null))['then'](function(_0x255ef3){if(_0x255ef3){if(!fs['existsSync'](path['join'](config['root'],_0xfe6e('0x46'),_0x255ef3[_0xfe6e('0x44')]+'.'+_0x255ef3[_0xfe6e('0x45')]))){throw new db[(_0xfe6e('0x47'))][(_0xfe6e('0x48'))](_0xfe6e('0x49'));}return _0x186d9d[_0xfe6e('0x4a')](path[_0xfe6e('0x4b')](config[_0xfe6e('0x4c')],_0xfe6e('0x46'),util[_0xfe6e('0x4d')](_0xfe6e('0x4e'),_0x255ef3[_0xfe6e('0x44')],_0x255ef3[_0xfe6e('0x45')])),util[_0xfe6e('0x4d')](_0xfe6e('0x4e'),_0x255ef3[_0xfe6e('0x25')],_0x255ef3['converted_format']));}return null;})[_0xfe6e('0x40')](handleError(_0x186d9d,null));};exports[_0xfe6e('0x4f')]=function(_0x4fad77,_0x547cd5,_0x647571){var _0x49e3c7={'name':path[_0xfe6e('0x50')](_0x4fad77['file'][_0xfe6e('0x51')],path[_0xfe6e('0x52')](_0x4fad77[_0xfe6e('0x53')][_0xfe6e('0x51')])),'save_name':path['basename'](_0x4fad77[_0xfe6e('0x53')][_0xfe6e('0x54')],path['extname'](_0x4fad77['file'][_0xfe6e('0x54')])),'original_format':path[_0xfe6e('0x52')](_0x4fad77[_0xfe6e('0x53')]['originalname'])[_0xfe6e('0x55')](0x1),'converted_format':'wav'};var _0x2dc324=path[_0xfe6e('0x4b')](config[_0xfe6e('0x4c')],_0xfe6e('0x56'),_0x4fad77['file'][_0xfe6e('0x54')]);var _0x435589=path[_0xfe6e('0x4b')](config[_0xfe6e('0x4c')],_0xfe6e('0x46'),util[_0xfe6e('0x4d')]('%s.%s',path['basename'](_0x4fad77['file'][_0xfe6e('0x54')],path[_0xfe6e('0x52')](_0x4fad77[_0xfe6e('0x53')][_0xfe6e('0x54')])),_0x49e3c7[_0xfe6e('0x45')]));logger[_0xfe6e('0x57')](_0xfe6e('0x58'),_0x2dc324);logger[_0xfe6e('0x57')](_0xfe6e('0x59'),_0x435589);try{fs['chmodSync'](_0x2dc324,parseInt(_0xfe6e('0x5a'),0x8));var _0x7344d0=sox[_0xfe6e('0x5b')](_0x2dc324,_0x435589,{'sampleRate':0x1f40,'format':_0xfe6e('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x7344d0['on']('error',function(_0x202d06){fs[_0xfe6e('0x5d')](_0x2dc324);_0x547cd5[_0xfe6e('0x16')](0x1f4)[_0xfe6e('0x26')](_0x202d06);});_0x7344d0['on'](_0xfe6e('0x5e'),function(_0x213c58){_0x49e3c7['original_duration']=isNaN(_0x213c58[_0xfe6e('0x5f')])?null:_0x213c58[_0xfe6e('0x5f')]*0x3e8;_0x49e3c7[_0xfe6e('0x60')]=isNaN(_0x213c58[_0xfe6e('0x61')])?null:_0x213c58['sampleCount'];_0x49e3c7[_0xfe6e('0x62')]=isNaN(_0x213c58[_0xfe6e('0x63')])?null:_0x213c58[_0xfe6e('0x63')];_0x49e3c7[_0xfe6e('0x64')]=isNaN(_0x213c58['bitRate'])?null:_0x213c58['bitRate'];_0x49e3c7[_0xfe6e('0x65')]=isNaN(_0x213c58['sampleRate'])?null:_0x213c58['sampleRate'];});_0x7344d0['on'](_0xfe6e('0x66'),function(_0x2f4afe){_0x49e3c7[_0xfe6e('0x67')]=isNaN(_0x2f4afe['duration'])?null:_0x2f4afe[_0xfe6e('0x5f')]*0x3e8;_0x49e3c7['converted_sampleCount']=isNaN(_0x2f4afe[_0xfe6e('0x61')])?null:_0x2f4afe[_0xfe6e('0x61')];_0x49e3c7[_0xfe6e('0x68')]=isNaN(_0x2f4afe[_0xfe6e('0x63')])?null:_0x2f4afe[_0xfe6e('0x63')];_0x49e3c7[_0xfe6e('0x69')]=isNaN(_0x2f4afe[_0xfe6e('0x6a')])?null:_0x2f4afe[_0xfe6e('0x6a')];_0x49e3c7[_0xfe6e('0x6b')]=isNaN(_0x2f4afe[_0xfe6e('0x6c')])?null:_0x2f4afe[_0xfe6e('0x6c')];});_0x7344d0['on']('end',function(){fs['chmodSync'](_0x435589,parseInt('0777',0x8));return db['Sound'][_0xfe6e('0x4f')](_0x49e3c7)[_0xfe6e('0x20')](function(_0x54371a){var _0x2525a1={'role':_0x4fad77['body']['role'],'userProfileId':_0x4fad77['body'][_0xfe6e('0x6d')]};if(!_0x2525a1)throw new Error(_0xfe6e('0x6e'));if(_0x2525a1[_0xfe6e('0x6f')]===_0xfe6e('0x70')){var _0x55a39e=_0x54371a[_0xfe6e('0x71')]({'plain':!![]});return db[_0xfe6e('0x72')]['find']({'where':{'name':_0xfe6e('0x73'),'userProfileId':_0x2525a1[_0xfe6e('0x6d')]},'raw':!![]})[_0xfe6e('0x20')](function(_0x2e5616){if(_0x2e5616&&_0x2e5616[_0xfe6e('0x74')]===0x0){return db['UserProfileResource'][_0xfe6e('0x4f')]({'name':_0x55a39e[_0xfe6e('0x25')],'resourceId':_0x55a39e['id'],'type':_0x2e5616[_0xfe6e('0x25')],'sectionId':_0x2e5616['id']},{})[_0xfe6e('0x20')](function(){return _0x54371a;});}else{return _0x54371a;}})[_0xfe6e('0x40')](function(_0x5065b9){logger[_0xfe6e('0x23')](_0xfe6e('0x75'),_0x5065b9);throw _0x5065b9;});}return _0x54371a;})['then'](respondWithResult(_0x547cd5,null))['catch'](handleError(_0x547cd5,null));});_0x7344d0['start']();}catch(_0x3ede12){_0x547cd5[_0xfe6e('0x16')](0x1f4)[_0xfe6e('0x26')](_0x3ede12);}};exports[_0xfe6e('0x76')]=function(_0x9ca379,_0x37c2a7,_0x29bd04){return db['Sound'][_0xfe6e('0x43')]({'where':{'id':_0x9ca379['params']['id']}})[_0xfe6e('0x20')](handleEntityNotFound(_0x37c2a7,null))[_0xfe6e('0x20')](saveUpdates(_['pick'](_0x9ca379['body'],[_0xfe6e('0x25'),_0xfe6e('0x77')]),null))['then'](respondWithResult(_0x37c2a7,null))[_0xfe6e('0x40')](handleError(_0x37c2a7,null));};exports['delete']=function(_0x526a92,_0x100072,_0x21c14c){return db[_0xfe6e('0x28')]['find']({'where':{'id':_0x526a92['params']['id']}})[_0xfe6e('0x20')](function(_0x2496f3){if(_0x2496f3){return _0x2496f3['destroy']();}})[_0xfe6e('0x20')](function(_0x3f58f6){var _0x4c8494=path[_0xfe6e('0x4b')](config[_0xfe6e('0x4c')],_0xfe6e('0x56'),util[_0xfe6e('0x4d')](_0xfe6e('0x4e'),_0x3f58f6[_0xfe6e('0x44')],_0x3f58f6[_0xfe6e('0x78')]));var _0x3fb3b1=path[_0xfe6e('0x4b')](config[_0xfe6e('0x4c')],_0xfe6e('0x46'),util[_0xfe6e('0x4d')](_0xfe6e('0x4e'),_0x3f58f6[_0xfe6e('0x44')],_0x3f58f6['converted_format']));fs[_0xfe6e('0x5d')](_0x4c8494);fs[_0xfe6e('0x5d')](_0x3fb3b1);return _0x3f58f6;})['then'](function(_0x549648){if(_0x549648){return _0x100072[_0xfe6e('0x16')](0xcc)['end']();}})[_0xfe6e('0x20')](handleEntityNotFound(_0x100072,null))[_0xfe6e('0x40')](handleError(_0x100072,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 1a12291..d7b0de0 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 _0x6cec=['../../config/environment','exports','Sound','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x401f2e,_0x119d0d){var _0x4ef876=function(_0x5bb365){while(--_0x5bb365){_0x401f2e['push'](_0x401f2e['shift']());}};_0x4ef876(++_0x119d0d);}(_0x6cec,0x123));var _0xc6ce=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x6cec[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xc6ce('0x0'));var util=require('util');var logger=require(_0xc6ce('0x1'))(_0xc6ce('0x2'));var moment=require('moment');var BPromise=require(_0xc6ce('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6ce('0x4'));var rimraf=require(_0xc6ce('0x5'));var config=require(_0xc6ce('0x6'));var attributes=require('./sound.attributes');module[_0xc6ce('0x7')]=function(_0x2840de,_0x469302){return _0x2840de['define'](_0xc6ce('0x8'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe98e=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./sound.attributes','exports','Sound','tools_sounds'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xe98e,0xfc));var _0xee98=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe98e[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xee98('0x0'));var util=require(_0xee98('0x1'));var logger=require(_0xee98('0x2'))(_0xee98('0x3'));var moment=require(_0xee98('0x4'));var BPromise=require('bluebird');var rp=require(_0xee98('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee98('0x6'));var config=require(_0xee98('0x7'));var attributes=require(_0xee98('0x8'));module[_0xee98('0x9')]=function(_0x25a801,_0x308729){return _0x25a801['define'](_0xee98('0xa'),attributes,{'tableName':_0xee98('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 9ad1391..e38e5c4 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 _0x35f0=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowSound','Sound','options','raw','attributes','include','map','model','stringify','lodash'];(function(_0xf7bfa4,_0x504c7a){var _0x12c7f1=function(_0x4d4100){while(--_0x4d4100){_0xf7bfa4['push'](_0xf7bfa4['shift']());}};_0x12c7f1(++_0x504c7a);}(_0x35f0,0x1ec));var _0x035f=function(_0x109da9,_0x4f10de){_0x109da9=_0x109da9-0x0;var _0x1dcd2f=_0x35f0[_0x109da9];return _0x1dcd2f;};'use strict';var _=require(_0x035f('0x0'));var util=require(_0x035f('0x1'));var moment=require('moment');var BPromise=require(_0x035f('0x2'));var rs=require(_0x035f('0x3'));var fs=require('fs');var Redis=require(_0x035f('0x4'));var db=require(_0x035f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x035f('0x6'))('rpc');var config=require(_0x035f('0x7'));var jayson=require(_0x035f('0x8'));var client=jayson[_0x035f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3be4f8,_0x249263,_0x530346){return new BPromise(function(_0x45d3e6,_0x948c7a){return client['request'](_0x3be4f8,_0x530346)[_0x035f('0xa')](function(_0x98b337){logger[_0x035f('0xb')](_0x035f('0xc'),_0x249263,_0x035f('0xd'));logger[_0x035f('0xe')]('Sound,\x20%s,\x20%s,\x20%s',_0x249263,_0x035f('0xd'),JSON['stringify'](_0x98b337));if(_0x98b337[_0x035f('0xf')]){if(_0x98b337[_0x035f('0xf')][_0x035f('0x10')]===0x1f4){logger['error'](_0x035f('0xc'),_0x249263,_0x98b337['error'][_0x035f('0x11')]);return _0x948c7a(_0x98b337['error'][_0x035f('0x11')]);}logger[_0x035f('0xf')](_0x035f('0xc'),_0x249263,_0x98b337[_0x035f('0xf')]['message']);return _0x45d3e6(_0x98b337[_0x035f('0xf')][_0x035f('0x11')]);}else{logger['info'](_0x035f('0xc'),_0x249263,_0x035f('0xd'));_0x45d3e6(_0x98b337[_0x035f('0x12')][_0x035f('0x11')]);}})[_0x035f('0x13')](function(_0x4027d5){logger[_0x035f('0xf')](_0x035f('0xc'),_0x249263,_0x4027d5);_0x948c7a(_0x4027d5);});});}exports[_0x035f('0x14')]=function(_0x342a52){var _0x15e57e=this;return new Promise(function(_0x3c8a01,_0x21288b){return db[_0x035f('0x15')]['find']({'raw':_0x342a52['options']?_0x342a52[_0x035f('0x16')][_0x035f('0x17')]===undefined?!![]:![]:!![],'where':_0x342a52[_0x035f('0x16')]?_0x342a52['options']['where']||null:null,'attributes':_0x342a52[_0x035f('0x16')]?_0x342a52[_0x035f('0x16')][_0x035f('0x18')]||null:null,'include':_0x342a52[_0x035f('0x16')]?_0x342a52[_0x035f('0x16')][_0x035f('0x19')]?_[_0x035f('0x1a')](_0x342a52[_0x035f('0x16')][_0x035f('0x19')],function(_0x14a098){return{'model':db[_0x14a098[_0x035f('0x1b')]],'as':_0x14a098['as'],'attributes':_0x14a098[_0x035f('0x18')],'include':_0x14a098[_0x035f('0x19')]?_[_0x035f('0x1a')](_0x14a098[_0x035f('0x19')],function(_0x25846e){return{'model':db[_0x25846e['model']],'as':_0x25846e['as'],'attributes':_0x25846e[_0x035f('0x18')],'include':_0x25846e[_0x035f('0x19')]?_['map'](_0x25846e[_0x035f('0x19')],function(_0x4cba55){return{'model':db[_0x4cba55['model']],'as':_0x4cba55['as'],'attributes':_0x4cba55[_0x035f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x035f('0xa')](function(_0x285a22){logger[_0x035f('0xb')](_0x035f('0x14'),_0x342a52);logger['debug'](_0x035f('0x14'),_0x342a52,JSON[_0x035f('0x1c')](_0x285a22));_0x3c8a01(_0x285a22);})[_0x035f('0x13')](function(_0x30f963){logger['error'](_0x035f('0x14'),_0x30f963['message'],_0x342a52);_0x21288b(_0x15e57e['error'](0x1f4,_0x30f963['message']));});});}; \ No newline at end of file +var _0x3e41=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Sound','find','options','raw','where','map','model','attributes','include','ShowSound'];(function(_0x211fef,_0x4ab716){var _0x5447bf=function(_0x306ea3){while(--_0x306ea3){_0x211fef['push'](_0x211fef['shift']());}};_0x5447bf(++_0x4ab716);}(_0x3e41,0xe8));var _0x13e4=function(_0x11ab4f,_0x5f4fdc){_0x11ab4f=_0x11ab4f-0x0;var _0x11d747=_0x3e41[_0x11ab4f];return _0x11d747;};'use strict';var _=require(_0x13e4('0x0'));var util=require(_0x13e4('0x1'));var moment=require(_0x13e4('0x2'));var BPromise=require(_0x13e4('0x3'));var rs=require(_0x13e4('0x4'));var fs=require('fs');var Redis=require(_0x13e4('0x5'));var db=require(_0x13e4('0x6'))['db'];var utils=require(_0x13e4('0x7'));var logger=require(_0x13e4('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x13e4('0x9'));var client=jayson[_0x13e4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x350c4b,_0x2dd749,_0xca390b){return new BPromise(function(_0x2b79d5,_0x515e4a){return client['request'](_0x350c4b,_0xca390b)[_0x13e4('0xb')](function(_0x4231c8){logger['info'](_0x13e4('0xc'),_0x2dd749,_0x13e4('0xd'));logger[_0x13e4('0xe')](_0x13e4('0xf'),_0x2dd749,'request\x20sent',JSON[_0x13e4('0x10')](_0x4231c8));if(_0x4231c8[_0x13e4('0x11')]){if(_0x4231c8['error'][_0x13e4('0x12')]===0x1f4){logger['error']('Sound,\x20%s,\x20%s',_0x2dd749,_0x4231c8[_0x13e4('0x11')][_0x13e4('0x13')]);return _0x515e4a(_0x4231c8['error'][_0x13e4('0x13')]);}logger[_0x13e4('0x11')](_0x13e4('0xc'),_0x2dd749,_0x4231c8[_0x13e4('0x11')][_0x13e4('0x13')]);return _0x2b79d5(_0x4231c8[_0x13e4('0x11')][_0x13e4('0x13')]);}else{logger[_0x13e4('0x14')]('Sound,\x20%s,\x20%s',_0x2dd749,_0x13e4('0xd'));_0x2b79d5(_0x4231c8[_0x13e4('0x15')][_0x13e4('0x13')]);}})['catch'](function(_0x15dd09){logger[_0x13e4('0x11')]('Sound,\x20%s,\x20%s',_0x2dd749,_0x15dd09);_0x515e4a(_0x15dd09);});});}exports['ShowSound']=function(_0x2b7810){var _0x9d2121=this;return new Promise(function(_0x3e5596,_0x2a4e9d){return db[_0x13e4('0x16')][_0x13e4('0x17')]({'raw':_0x2b7810[_0x13e4('0x18')]?_0x2b7810[_0x13e4('0x18')][_0x13e4('0x19')]===undefined?!![]:![]:!![],'where':_0x2b7810['options']?_0x2b7810[_0x13e4('0x18')][_0x13e4('0x1a')]||null:null,'attributes':_0x2b7810[_0x13e4('0x18')]?_0x2b7810[_0x13e4('0x18')]['attributes']||null:null,'include':_0x2b7810['options']?_0x2b7810[_0x13e4('0x18')]['include']?_[_0x13e4('0x1b')](_0x2b7810['options']['include'],function(_0x21822a){return{'model':db[_0x21822a[_0x13e4('0x1c')]],'as':_0x21822a['as'],'attributes':_0x21822a[_0x13e4('0x1d')],'include':_0x21822a[_0x13e4('0x1e')]?_[_0x13e4('0x1b')](_0x21822a[_0x13e4('0x1e')],function(_0x228ed2){return{'model':db[_0x228ed2[_0x13e4('0x1c')]],'as':_0x228ed2['as'],'attributes':_0x228ed2[_0x13e4('0x1d')],'include':_0x228ed2[_0x13e4('0x1e')]?_[_0x13e4('0x1b')](_0x228ed2[_0x13e4('0x1e')],function(_0x4d5783){return{'model':db[_0x4d5783['model']],'as':_0x4d5783['as'],'attributes':_0x4d5783[_0x13e4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x13e4('0xb')](function(_0x2ef135){logger[_0x13e4('0x14')](_0x13e4('0x1f'),_0x2b7810);logger[_0x13e4('0xe')]('ShowSound',_0x2b7810,JSON[_0x13e4('0x10')](_0x2ef135));_0x3e5596(_0x2ef135);})[_0x13e4('0x20')](function(_0x497e1d){logger['error'](_0x13e4('0x1f'),_0x497e1d[_0x13e4('0x13')],_0x2b7810);_0x2a4e9d(_0x9d2121[_0x13e4('0x11')](0x1f4,_0x497e1d[_0x13e4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0f97944..1e01248 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x308375,_0x3a93cc){var _0x18d40c=function(_0x21bbbf){while(--_0x21bbbf){_0x308375['push'](_0x308375['shift']());}};_0x18d40c(++_0x3a93cc);}(_0x0b0e,0x187));var _0xe0b0=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x0b0e[_0xc82d1a];return _0x32fad2;};'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('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x50b40f,_0x3fb633){var _0x30d6b9=function(_0x5a488b){while(--_0x5a488b){_0x50b40f['push'](_0x50b40f['shift']());}};_0x30d6b9(++_0x3fb633);}(_0xb7e7,0x121));var _0x7b7e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb7e7[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 677fdf2..06cf0a4 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 _0x26e9=['exports','STRING','TEXT','medium','out','sequelize'];(function(_0x319677,_0x2ca70f){var _0x589198=function(_0x2c127f){while(--_0x2c127f){_0x319677['push'](_0x319677['shift']());}};_0x589198(++_0x2ca70f);}(_0x26e9,0x10d));var _0x926e=function(_0x52f975,_0x305404){_0x52f975=_0x52f975-0x0;var _0x1b15a3=_0x26e9[_0x52f975];return _0x1b15a3;};'use strict';var Sequelize=require(_0x926e('0x0'));module[_0x926e('0x1')]={'uniqueid':{'type':Sequelize[_0x926e('0x2')]},'body':{'type':Sequelize[_0x926e('0x3')](_0x926e('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x926e('0x5')),'defaultValue':_0x926e('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0x926e('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x891c=['out','TEXT','sequelize','exports','medium','ENUM'];(function(_0x3782f1,_0xdb9da7){var _0x59aa2c=function(_0x3ecfb1){while(--_0x3ecfb1){_0x3782f1['push'](_0x3782f1['shift']());}};_0x59aa2c(++_0xdb9da7);}(_0x891c,0x188));var _0xc891=function(_0x160b19,_0x44248d){_0x160b19=_0x160b19-0x0;var _0x1bacb2=_0x891c[_0x160b19];return _0x1bacb2;};'use strict';var Sequelize=require(_0xc891('0x0'));module[_0xc891('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0xc891('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xc891('0x3')]('in',_0xc891('0x4')),'defaultValue':_0xc891('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc891('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 46cab23..27aa2ba 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 _0x9845=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x2592fc,_0x4f0c82){var _0x3fb81d=function(_0x8c50c3){while(--_0x8c50c3){_0x2592fc['push'](_0x2592fc['shift']());}};_0x3fb81d(++_0x4f0c82);}(_0x9845,0x1e2));var _0x5984=function(_0x2afb08,_0x324211){_0x2afb08=_0x2afb08-0x0;var _0x38cc5a=_0x9845[_0x2afb08];return _0x38cc5a;};'use strict';var emlformat=require(_0x5984('0x0'));var rimraf=require(_0x5984('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5984('0x2'));var rp=require(_0x5984('0x3'));var moment=require(_0x5984('0x4'));var BPromise=require(_0x5984('0x5'));var Mustache=require(_0x5984('0x6'));var util=require('util');var path=require(_0x5984('0x7'));var sox=require(_0x5984('0x8'));var csv=require(_0x5984('0x9'));var ejs=require(_0x5984('0xa'));var fs=require('fs');var fs_extra=require(_0x5984('0xb'));var _=require('lodash');var squel=require(_0x5984('0xc'));var crypto=require(_0x5984('0xd'));var jsforce=require(_0x5984('0xe'));var deskjs=require(_0x5984('0xf'));var toCsv=require(_0x5984('0x9'));var querystring=require('querystring');var Papa=require(_0x5984('0x10'));var Redis=require(_0x5984('0x11'));var authService=require(_0x5984('0x12'));var qs=require(_0x5984('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5984('0x14'));var logger=require(_0x5984('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5984('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5984('0x17'))['db'];function respondWithStatusCode(_0x1487a3,_0x20e728){_0x20e728=_0x20e728||0xcc;return function(_0x5218e4){if(_0x5218e4){return _0x1487a3[_0x5984('0x18')](_0x20e728);}return _0x1487a3['status'](_0x20e728)[_0x5984('0x19')]();};}function respondWithResult(_0x173e56,_0x25aa3f){_0x25aa3f=_0x25aa3f||0xc8;return function(_0x4e6faa){if(_0x4e6faa){return _0x173e56['status'](_0x25aa3f)[_0x5984('0x1a')](_0x4e6faa);}};}function respondWithFilteredResult(_0x5d85a7,_0x3894f2){return function(_0x37036b){if(_0x37036b){var _0x198aef=typeof _0x3894f2['offset']===_0x5984('0x1b')&&typeof _0x3894f2['limit']===_0x5984('0x1b');var _0x328885=_0x37036b[_0x5984('0x1c')];var _0x5715f5=_0x198aef?0x0:_0x3894f2[_0x5984('0x1d')];var _0x4c0cdf=_0x198aef?_0x37036b[_0x5984('0x1c')]:_0x3894f2[_0x5984('0x1d')]+_0x3894f2[_0x5984('0x1e')];var _0x5d52f3;if(_0x4c0cdf>=_0x328885){_0x4c0cdf=_0x328885;_0x5d52f3=0xc8;}else{_0x5d52f3=0xce;}_0x5d85a7[_0x5984('0x1f')](_0x5d52f3);return _0x5d85a7['set'](_0x5984('0x20'),_0x5715f5+'-'+_0x4c0cdf+'/'+_0x328885)['json'](_0x37036b);}return null;};}function patchUpdates(_0x484110){return function(_0xcbf8e4){try{jsonpatch[_0x5984('0x21')](_0xcbf8e4,_0x484110,!![]);}catch(_0x4e8f3a){return BPromise['reject'](_0x4e8f3a);}return _0xcbf8e4[_0x5984('0x22')]();};}function saveUpdates(_0x13d8c0,_0x3712b9){return function(_0x12b66c){if(_0x12b66c){return _0x12b66c[_0x5984('0x23')](_0x13d8c0)[_0x5984('0x24')](function(_0x47ea79){return _0x47ea79;});}return null;};}function removeEntity(_0xfb2b58,_0x51c4ab){return function(_0x160396){if(_0x160396){return _0x160396[_0x5984('0x25')]()[_0x5984('0x24')](function(){_0xfb2b58[_0x5984('0x1f')](0xcc)[_0x5984('0x19')]();});}};}function handleEntityNotFound(_0x59247c,_0x24be01){return function(_0x192805){if(!_0x192805){_0x59247c[_0x5984('0x18')](0x194);}return _0x192805;};}function handleError(_0x271a2a,_0x196384){_0x196384=_0x196384||0x1f4;return function(_0x951f0b){logger[_0x5984('0x26')](_0x951f0b[_0x5984('0x27')]);if(_0x951f0b['name']){delete _0x951f0b[_0x5984('0x28')];}_0x271a2a[_0x5984('0x1f')](_0x196384)['send'](_0x951f0b);};}exports[_0x5984('0x29')]=function(_0x1327da,_0x51a2f2){var _0x20dcfe={},_0x4d4c68={},_0x3a3004={'count':0x0,'rows':[]};var _0x103724=_[_0x5984('0x2a')](db[_0x5984('0x2b')][_0x5984('0x2c')],function(_0x986fe9){return{'name':_0x986fe9[_0x5984('0x2d')],'type':_0x986fe9['type']['key']};});_0x4d4c68[_0x5984('0x2e')]=_['map'](_0x103724,'name');_0x4d4c68[_0x5984('0x2f')]=_['keys'](_0x1327da[_0x5984('0x2f')]);_0x4d4c68[_0x5984('0x30')]=_['intersection'](_0x4d4c68[_0x5984('0x2e')],_0x4d4c68[_0x5984('0x2f')]);_0x20dcfe['attributes']=_[_0x5984('0x31')](_0x4d4c68[_0x5984('0x2e')],qs[_0x5984('0x32')](_0x1327da[_0x5984('0x2f')][_0x5984('0x32')]));_0x20dcfe[_0x5984('0x33')]=_0x20dcfe[_0x5984('0x33')][_0x5984('0x34')]?_0x20dcfe[_0x5984('0x33')]:_0x4d4c68['model'];if(!_0x1327da['query'][_0x5984('0x35')]('nolimit')){_0x20dcfe[_0x5984('0x1e')]=qs['limit'](_0x1327da[_0x5984('0x2f')][_0x5984('0x1e')]);_0x20dcfe[_0x5984('0x1d')]=qs[_0x5984('0x1d')](_0x1327da[_0x5984('0x2f')][_0x5984('0x1d')]);}_0x20dcfe['order']=qs[_0x5984('0x36')](_0x1327da[_0x5984('0x2f')][_0x5984('0x36')]);_0x20dcfe[_0x5984('0x37')]=qs[_0x5984('0x30')](_['pick'](_0x1327da[_0x5984('0x2f')],_0x4d4c68['filters']),_0x103724);if(_0x1327da[_0x5984('0x2f')][_0x5984('0x38')]){_0x20dcfe[_0x5984('0x37')]=_[_0x5984('0x39')](_0x20dcfe['where'],{'$or':_[_0x5984('0x2a')](_0x103724,function(_0x33b2a6){if(_0x33b2a6['type']!==_0x5984('0x3a')){var _0x3d9245={};_0x3d9245[_0x33b2a6[_0x5984('0x28')]]={'$like':'%'+_0x1327da['query'][_0x5984('0x38')]+'%'};return _0x3d9245;}})});}_0x20dcfe=_[_0x5984('0x39')]({},_0x20dcfe,_0x1327da[_0x5984('0x3b')]);var _0x115ebc={'where':_0x20dcfe[_0x5984('0x37')]};return db[_0x5984('0x2b')][_0x5984('0x1c')](_0x115ebc)[_0x5984('0x24')](function(_0x43c532){_0x3a3004['count']=_0x43c532;if(_0x1327da[_0x5984('0x2f')][_0x5984('0x3c')]){_0x20dcfe['include']=[{'all':!![]}];}return db[_0x5984('0x2b')][_0x5984('0x3d')](_0x20dcfe);})[_0x5984('0x24')](function(_0xe5cf31){_0x3a3004[_0x5984('0x3e')]=_0xe5cf31;return _0x3a3004;})['then'](respondWithFilteredResult(_0x51a2f2,_0x20dcfe))[_0x5984('0x3f')](handleError(_0x51a2f2,null));};exports[_0x5984('0x40')]=function(_0x4b89f1,_0xdd5e69){var _0x293a14={'raw':!![],'where':{'id':_0x4b89f1[_0x5984('0x41')]['id']}},_0x5202ea={};_0x5202ea[_0x5984('0x2e')]=_[_0x5984('0x42')](db['SquareMessage'][_0x5984('0x2c')]);_0x5202ea[_0x5984('0x2f')]=_[_0x5984('0x42')](_0x4b89f1[_0x5984('0x2f')]);_0x5202ea[_0x5984('0x30')]=_['intersection'](_0x5202ea[_0x5984('0x2e')],_0x5202ea['query']);_0x293a14[_0x5984('0x33')]=_[_0x5984('0x31')](_0x5202ea[_0x5984('0x2e')],qs[_0x5984('0x32')](_0x4b89f1[_0x5984('0x2f')][_0x5984('0x32')]));_0x293a14['attributes']=_0x293a14[_0x5984('0x33')][_0x5984('0x34')]?_0x293a14[_0x5984('0x33')]:_0x5202ea[_0x5984('0x2e')];if(_0x4b89f1['query']['includeAll']){_0x293a14[_0x5984('0x43')]=[{'all':!![]}];}_0x293a14=_[_0x5984('0x39')]({},_0x293a14,_0x4b89f1[_0x5984('0x3b')]);return db[_0x5984('0x2b')]['find'](_0x293a14)[_0x5984('0x24')](handleEntityNotFound(_0xdd5e69,null))[_0x5984('0x24')](respondWithResult(_0xdd5e69,null))[_0x5984('0x3f')](handleError(_0xdd5e69,null));};exports['create']=function(_0x2e8a14,_0x5b1631){return db['SquareMessage'][_0x5984('0x44')](_0x2e8a14[_0x5984('0x45')],{})[_0x5984('0x24')](respondWithResult(_0x5b1631,0xc9))[_0x5984('0x3f')](handleError(_0x5b1631,null));};exports[_0x5984('0x23')]=function(_0x4a6ff8,_0x391073){if(_0x4a6ff8[_0x5984('0x45')]['id']){delete _0x4a6ff8[_0x5984('0x45')]['id'];}return db[_0x5984('0x2b')][_0x5984('0x46')]({'where':{'id':_0x4a6ff8['params']['id']}})[_0x5984('0x24')](handleEntityNotFound(_0x391073,null))[_0x5984('0x24')](saveUpdates(_0x4a6ff8[_0x5984('0x45')],null))[_0x5984('0x24')](respondWithResult(_0x391073,null))[_0x5984('0x3f')](handleError(_0x391073,null));};exports[_0x5984('0x25')]=function(_0x8cd397,_0x5cbc04){return db[_0x5984('0x2b')][_0x5984('0x46')]({'where':{'id':_0x8cd397[_0x5984('0x41')]['id']}})[_0x5984('0x24')](handleEntityNotFound(_0x5cbc04,null))[_0x5984('0x24')](removeEntity(_0x5cbc04,null))[_0x5984('0x3f')](handleError(_0x5cbc04,null));}; \ No newline at end of file +var _0x9c36=['then','destroy','sendStatus','error','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','params','intersection','options','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x9c36,0xbf));var _0x69c3=function(_0x525633,_0x2fa8f8){_0x525633=_0x525633-0x0;var _0x5eef1f=_0x9c36[_0x525633];return _0x5eef1f;};'use strict';var emlformat=require(_0x69c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x69c3('0x1'));var jsonpatch=require(_0x69c3('0x2'));var rp=require(_0x69c3('0x3'));var moment=require(_0x69c3('0x4'));var BPromise=require(_0x69c3('0x5'));var Mustache=require(_0x69c3('0x6'));var util=require(_0x69c3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x69c3('0x8'));var ejs=require(_0x69c3('0x9'));var fs=require('fs');var fs_extra=require(_0x69c3('0xa'));var _=require(_0x69c3('0xb'));var squel=require('squel');var crypto=require(_0x69c3('0xc'));var jsforce=require(_0x69c3('0xd'));var deskjs=require(_0x69c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x69c3('0xf'));var Papa=require(_0x69c3('0x10'));var Redis=require(_0x69c3('0x11'));var authService=require(_0x69c3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x69c3('0x13'));var hardwareService=require(_0x69c3('0x14'));var logger=require(_0x69c3('0x15'))(_0x69c3('0x16'));var utils=require('../../config/utils');var config=require(_0x69c3('0x17'));var licenseUtil=require(_0x69c3('0x18'));var db=require(_0x69c3('0x19'))['db'];function respondWithStatusCode(_0x5d8462,_0x9cc727){_0x9cc727=_0x9cc727||0xcc;return function(_0xb76c14){if(_0xb76c14){return _0x5d8462['sendStatus'](_0x9cc727);}return _0x5d8462[_0x69c3('0x1a')](_0x9cc727)[_0x69c3('0x1b')]();};}function respondWithResult(_0x13e6d5,_0x4a7f3c){_0x4a7f3c=_0x4a7f3c||0xc8;return function(_0x447b43){if(_0x447b43){return _0x13e6d5['status'](_0x4a7f3c)[_0x69c3('0x1c')](_0x447b43);}};}function respondWithFilteredResult(_0x3f5ca7,_0x4f039d){return function(_0x348716){if(_0x348716){var _0x4d3de0=typeof _0x4f039d[_0x69c3('0x1d')]===_0x69c3('0x1e')&&typeof _0x4f039d[_0x69c3('0x1f')]===_0x69c3('0x1e');var _0x29007f=_0x348716['count'];var _0x254102=_0x4d3de0?0x0:_0x4f039d['offset'];var _0x2423c5=_0x4d3de0?_0x348716[_0x69c3('0x20')]:_0x4f039d['offset']+_0x4f039d[_0x69c3('0x1f')];var _0x6d8117;if(_0x2423c5>=_0x29007f){_0x2423c5=_0x29007f;_0x6d8117=0xc8;}else{_0x6d8117=0xce;}_0x3f5ca7[_0x69c3('0x1a')](_0x6d8117);return _0x3f5ca7[_0x69c3('0x21')](_0x69c3('0x22'),_0x254102+'-'+_0x2423c5+'/'+_0x29007f)[_0x69c3('0x1c')](_0x348716);}return null;};}function patchUpdates(_0x2dac50){return function(_0x261262){try{jsonpatch['apply'](_0x261262,_0x2dac50,!![]);}catch(_0x4de9d2){return BPromise['reject'](_0x4de9d2);}return _0x261262[_0x69c3('0x23')]();};}function saveUpdates(_0x41b5d1,_0x4e8354){return function(_0x22ad82){if(_0x22ad82){return _0x22ad82[_0x69c3('0x24')](_0x41b5d1)[_0x69c3('0x25')](function(_0x55bf5b){return _0x55bf5b;});}return null;};}function removeEntity(_0x1cabc8,_0x1bb8bc){return function(_0xe92b55){if(_0xe92b55){return _0xe92b55[_0x69c3('0x26')]()['then'](function(){_0x1cabc8[_0x69c3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17af97,_0x133a51){return function(_0x243f09){if(!_0x243f09){_0x17af97[_0x69c3('0x27')](0x194);}return _0x243f09;};}function handleError(_0x56bef9,_0x8cb97e){_0x8cb97e=_0x8cb97e||0x1f4;return function(_0x1ad52a){logger[_0x69c3('0x28')](_0x1ad52a['stack']);if(_0x1ad52a['name']){delete _0x1ad52a[_0x69c3('0x29')];}_0x56bef9[_0x69c3('0x1a')](_0x8cb97e)[_0x69c3('0x2a')](_0x1ad52a);};}exports[_0x69c3('0x2b')]=function(_0x119f5e,_0x2599b5){var _0x3dd4df={},_0x47bc51={},_0x27205f={'count':0x0,'rows':[]};var _0x54ed96=_[_0x69c3('0x2c')](db[_0x69c3('0x2d')][_0x69c3('0x2e')],function(_0x244315){return{'name':_0x244315[_0x69c3('0x2f')],'type':_0x244315[_0x69c3('0x30')][_0x69c3('0x31')]};});_0x47bc51[_0x69c3('0x32')]=_[_0x69c3('0x2c')](_0x54ed96,'name');_0x47bc51[_0x69c3('0x33')]=_[_0x69c3('0x34')](_0x119f5e['query']);_0x47bc51[_0x69c3('0x35')]=_['intersection'](_0x47bc51[_0x69c3('0x32')],_0x47bc51[_0x69c3('0x33')]);_0x3dd4df['attributes']=_['intersection'](_0x47bc51['model'],qs[_0x69c3('0x36')](_0x119f5e[_0x69c3('0x33')]['fields']));_0x3dd4df[_0x69c3('0x37')]=_0x3dd4df[_0x69c3('0x37')][_0x69c3('0x38')]?_0x3dd4df[_0x69c3('0x37')]:_0x47bc51['model'];if(!_0x119f5e[_0x69c3('0x33')][_0x69c3('0x39')]('nolimit')){_0x3dd4df[_0x69c3('0x1f')]=qs[_0x69c3('0x1f')](_0x119f5e[_0x69c3('0x33')][_0x69c3('0x1f')]);_0x3dd4df[_0x69c3('0x1d')]=qs[_0x69c3('0x1d')](_0x119f5e[_0x69c3('0x33')][_0x69c3('0x1d')]);}_0x3dd4df[_0x69c3('0x3a')]=qs['sort'](_0x119f5e[_0x69c3('0x33')][_0x69c3('0x3b')]);_0x3dd4df[_0x69c3('0x3c')]=qs[_0x69c3('0x35')](_['pick'](_0x119f5e['query'],_0x47bc51['filters']),_0x54ed96);if(_0x119f5e[_0x69c3('0x33')]['filter']){_0x3dd4df['where']=_['merge'](_0x3dd4df[_0x69c3('0x3c')],{'$or':_[_0x69c3('0x2c')](_0x54ed96,function(_0xeb8aa1){if(_0xeb8aa1['type']!==_0x69c3('0x3d')){var _0x4326d9={};_0x4326d9[_0xeb8aa1[_0x69c3('0x29')]]={'$like':'%'+_0x119f5e[_0x69c3('0x33')][_0x69c3('0x3e')]+'%'};return _0x4326d9;}})});}_0x3dd4df=_[_0x69c3('0x3f')]({},_0x3dd4df,_0x119f5e['options']);var _0x58cb15={'where':_0x3dd4df['where']};return db[_0x69c3('0x2d')][_0x69c3('0x20')](_0x58cb15)[_0x69c3('0x25')](function(_0x599a15){_0x27205f[_0x69c3('0x20')]=_0x599a15;if(_0x119f5e[_0x69c3('0x33')][_0x69c3('0x40')]){_0x3dd4df[_0x69c3('0x41')]=[{'all':!![]}];}return db[_0x69c3('0x2d')][_0x69c3('0x42')](_0x3dd4df);})[_0x69c3('0x25')](function(_0x4ff07e){_0x27205f[_0x69c3('0x43')]=_0x4ff07e;return _0x27205f;})[_0x69c3('0x25')](respondWithFilteredResult(_0x2599b5,_0x3dd4df))[_0x69c3('0x44')](handleError(_0x2599b5,null));};exports[_0x69c3('0x45')]=function(_0x420ae7,_0x488b3a){var _0x2554ec={'raw':!![],'where':{'id':_0x420ae7[_0x69c3('0x46')]['id']}},_0x107878={};_0x107878['model']=_[_0x69c3('0x34')](db[_0x69c3('0x2d')][_0x69c3('0x2e')]);_0x107878[_0x69c3('0x33')]=_[_0x69c3('0x34')](_0x420ae7[_0x69c3('0x33')]);_0x107878['filters']=_[_0x69c3('0x47')](_0x107878[_0x69c3('0x32')],_0x107878[_0x69c3('0x33')]);_0x2554ec['attributes']=_['intersection'](_0x107878[_0x69c3('0x32')],qs[_0x69c3('0x36')](_0x420ae7[_0x69c3('0x33')][_0x69c3('0x36')]));_0x2554ec[_0x69c3('0x37')]=_0x2554ec[_0x69c3('0x37')][_0x69c3('0x38')]?_0x2554ec['attributes']:_0x107878[_0x69c3('0x32')];if(_0x420ae7[_0x69c3('0x33')][_0x69c3('0x40')]){_0x2554ec[_0x69c3('0x41')]=[{'all':!![]}];}_0x2554ec=_[_0x69c3('0x3f')]({},_0x2554ec,_0x420ae7[_0x69c3('0x48')]);return db[_0x69c3('0x2d')]['find'](_0x2554ec)[_0x69c3('0x25')](handleEntityNotFound(_0x488b3a,null))[_0x69c3('0x25')](respondWithResult(_0x488b3a,null))[_0x69c3('0x44')](handleError(_0x488b3a,null));};exports['create']=function(_0x57b443,_0x55db96){return db[_0x69c3('0x2d')][_0x69c3('0x49')](_0x57b443[_0x69c3('0x4a')],{})[_0x69c3('0x25')](respondWithResult(_0x55db96,0xc9))[_0x69c3('0x44')](handleError(_0x55db96,null));};exports[_0x69c3('0x24')]=function(_0x1d0fe4,_0x4e2281){if(_0x1d0fe4[_0x69c3('0x4a')]['id']){delete _0x1d0fe4[_0x69c3('0x4a')]['id'];}return db[_0x69c3('0x2d')][_0x69c3('0x4b')]({'where':{'id':_0x1d0fe4[_0x69c3('0x46')]['id']}})[_0x69c3('0x25')](handleEntityNotFound(_0x4e2281,null))[_0x69c3('0x25')](saveUpdates(_0x1d0fe4[_0x69c3('0x4a')],null))[_0x69c3('0x25')](respondWithResult(_0x4e2281,null))[_0x69c3('0x44')](handleError(_0x4e2281,null));};exports[_0x69c3('0x26')]=function(_0x4c9784,_0xe30e3){return db[_0x69c3('0x2d')]['find']({'where':{'id':_0x4c9784['params']['id']}})[_0x69c3('0x25')](handleEntityNotFound(_0xe30e3,null))[_0x69c3('0x25')](removeEntity(_0xe30e3,null))[_0x69c3('0x44')](handleError(_0xe30e3,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 9dc50c4..d4c5ba5 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 _0xd6f4=['./squareMessage.attributes','define','SquareMessage','square_messages','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xd6f4,0x88));var _0x4d6f=function(_0x330c18,_0x5a2f1c){_0x330c18=_0x330c18-0x0;var _0xeca3fd=_0xd6f4[_0x330c18];return _0xeca3fd;};'use strict';var _=require('lodash');var util=require(_0x4d6f('0x0'));var logger=require('../../config/logger')(_0x4d6f('0x1'));var moment=require(_0x4d6f('0x2'));var BPromise=require(_0x4d6f('0x3'));var rp=require(_0x4d6f('0x4'));var fs=require('fs');var path=require(_0x4d6f('0x5'));var rimraf=require('rimraf');var config=require(_0x4d6f('0x6'));var attributes=require(_0x4d6f('0x7'));module['exports']=function(_0x4e58e8,_0x410a63){return _0x4e58e8[_0x4d6f('0x8')](_0x4d6f('0x9'),attributes,{'tableName':_0x4d6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcf49=['SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','define'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xcf49,0x1c2));var _0x9cf4=function(_0x1c0781,_0x4a19f1){_0x1c0781=_0x1c0781-0x0;var _0x1f577e=_0xcf49[_0x1c0781];return _0x1f577e;};'use strict';var _=require(_0x9cf4('0x0'));var util=require(_0x9cf4('0x1'));var logger=require(_0x9cf4('0x2'))(_0x9cf4('0x3'));var moment=require(_0x9cf4('0x4'));var BPromise=require(_0x9cf4('0x5'));var rp=require(_0x9cf4('0x6'));var fs=require('fs');var path=require(_0x9cf4('0x7'));var rimraf=require(_0x9cf4('0x8'));var config=require(_0x9cf4('0x9'));var attributes=require(_0x9cf4('0xa'));module['exports']=function(_0x3651da,_0x247f7b){return _0x3651da[_0x9cf4('0xb')](_0x9cf4('0xc'),attributes,{'tableName':_0x9cf4('0xd'),'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 897ae65..c2111ea 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 _0xce16=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','result','CreateSquareMessage','body','options','raw','lodash','util','moment'];(function(_0x15c4ab,_0x409fe0){var _0x1b668d=function(_0x437833){while(--_0x437833){_0x15c4ab['push'](_0x15c4ab['shift']());}};_0x1b668d(++_0x409fe0);}(_0xce16,0x1a6));var _0x6ce1=function(_0x8f44f4,_0x10cdd6){_0x8f44f4=_0x8f44f4-0x0;var _0xd0cd4=_0xce16[_0x8f44f4];return _0xd0cd4;};'use strict';var _=require(_0x6ce1('0x0'));var util=require(_0x6ce1('0x1'));var moment=require(_0x6ce1('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ce1('0x3'));var fs=require('fs');var Redis=require(_0x6ce1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6ce1('0x5'));var logger=require(_0x6ce1('0x6'))(_0x6ce1('0x7'));var config=require('../../config/environment');var jayson=require(_0x6ce1('0x8'));var client=jayson[_0x6ce1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xac1cc5,_0x4f8420,_0x33bb30){return new BPromise(function(_0x313c51,_0x46a1a5){return client[_0x6ce1('0xa')](_0xac1cc5,_0x33bb30)[_0x6ce1('0xb')](function(_0x557451){logger[_0x6ce1('0xc')]('SquareMessage,\x20%s,\x20%s',_0x4f8420,_0x6ce1('0xd'));logger[_0x6ce1('0xe')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x4f8420,_0x6ce1('0xd'),JSON[_0x6ce1('0xf')](_0x557451));if(_0x557451[_0x6ce1('0x10')]){if(_0x557451[_0x6ce1('0x10')][_0x6ce1('0x11')]===0x1f4){logger[_0x6ce1('0x10')]('SquareMessage,\x20%s,\x20%s',_0x4f8420,_0x557451[_0x6ce1('0x10')][_0x6ce1('0x12')]);return _0x46a1a5(_0x557451[_0x6ce1('0x10')]['message']);}logger[_0x6ce1('0x10')](_0x6ce1('0x13'),_0x4f8420,_0x557451[_0x6ce1('0x10')][_0x6ce1('0x12')]);return _0x313c51(_0x557451['error'][_0x6ce1('0x12')]);}else{logger[_0x6ce1('0xc')]('SquareMessage,\x20%s,\x20%s',_0x4f8420,_0x6ce1('0xd'));_0x313c51(_0x557451[_0x6ce1('0x14')][_0x6ce1('0x12')]);}})['catch'](function(_0x874542){logger[_0x6ce1('0x10')](_0x6ce1('0x13'),_0x4f8420,_0x874542);_0x46a1a5(_0x874542);});});}exports[_0x6ce1('0x15')]=function(_0x489e96){var _0x5b92c0=this;return new Promise(function(_0x30f5f6,_0x5f08cc){return db['SquareMessage']['create'](_0x489e96[_0x6ce1('0x16')],{'raw':_0x489e96[_0x6ce1('0x17')]?_0x489e96[_0x6ce1('0x17')][_0x6ce1('0x18')]===undefined?!![]:![]:!![]})[_0x6ce1('0xb')](function(_0x584301){logger[_0x6ce1('0xc')](_0x6ce1('0x15'),_0x489e96);logger[_0x6ce1('0xe')]('CreateSquareMessage',_0x489e96,JSON['stringify'](_0x584301));_0x30f5f6(_0x584301);})['catch'](function(_0x19db40){logger[_0x6ce1('0x10')](_0x6ce1('0x15'),_0x19db40[_0x6ce1('0x12')],_0x489e96);_0x5f08cc(_0x5b92c0[_0x6ce1('0x10')](0x1f4,_0x19db40[_0x6ce1('0x12')]));});});}; \ No newline at end of file +var _0xbc10=['request\x20sent','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','info','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x45641d,_0x19c929){var _0x41030b=function(_0x5f2274){while(--_0x5f2274){_0x45641d['push'](_0x45641d['shift']());}};_0x41030b(++_0x19c929);}(_0xbc10,0xc6));var _0x0bc1=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbc10[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0bc1('0x0'));var util=require(_0x0bc1('0x1'));var moment=require(_0x0bc1('0x2'));var BPromise=require(_0x0bc1('0x3'));var rs=require(_0x0bc1('0x4'));var fs=require('fs');var Redis=require(_0x0bc1('0x5'));var db=require(_0x0bc1('0x6'))['db'];var utils=require(_0x0bc1('0x7'));var logger=require(_0x0bc1('0x8'))('rpc');var config=require(_0x0bc1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0bc1('0xa')][_0x0bc1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2f96d,_0x5b3472,_0x6870f7){return new BPromise(function(_0x2f2e27,_0x57551d){return client[_0x0bc1('0xc')](_0xa2f96d,_0x6870f7)[_0x0bc1('0xd')](function(_0x3b13fe){logger['info'](_0x0bc1('0xe'),_0x5b3472,'request\x20sent');logger['debug'](_0x0bc1('0xf'),_0x5b3472,'request\x20sent',JSON['stringify'](_0x3b13fe));if(_0x3b13fe['error']){if(_0x3b13fe[_0x0bc1('0x10')][_0x0bc1('0x11')]===0x1f4){logger['error']('SquareMessage,\x20%s,\x20%s',_0x5b3472,_0x3b13fe[_0x0bc1('0x10')][_0x0bc1('0x12')]);return _0x57551d(_0x3b13fe['error'][_0x0bc1('0x12')]);}logger[_0x0bc1('0x10')](_0x0bc1('0xe'),_0x5b3472,_0x3b13fe[_0x0bc1('0x10')]['message']);return _0x2f2e27(_0x3b13fe[_0x0bc1('0x10')][_0x0bc1('0x12')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x5b3472,_0x0bc1('0x13'));_0x2f2e27(_0x3b13fe[_0x0bc1('0x14')][_0x0bc1('0x12')]);}})[_0x0bc1('0x15')](function(_0x2f37d2){logger[_0x0bc1('0x10')]('SquareMessage,\x20%s,\x20%s',_0x5b3472,_0x2f37d2);_0x57551d(_0x2f37d2);});});}exports[_0x0bc1('0x16')]=function(_0x15a9af){var _0x4e14ae=this;return new Promise(function(_0x5767c7,_0x4c3fbb){return db[_0x0bc1('0x17')][_0x0bc1('0x18')](_0x15a9af[_0x0bc1('0x19')],{'raw':_0x15a9af[_0x0bc1('0x1a')]?_0x15a9af[_0x0bc1('0x1a')][_0x0bc1('0x1b')]===undefined?!![]:![]:!![]})[_0x0bc1('0xd')](function(_0x5f5dae){logger[_0x0bc1('0x1c')]('CreateSquareMessage',_0x15a9af);logger[_0x0bc1('0x1d')]('CreateSquareMessage',_0x15a9af,JSON[_0x0bc1('0x1e')](_0x5f5dae));_0x5767c7(_0x5f5dae);})[_0x0bc1('0x15')](function(_0x18e139){logger[_0x0bc1('0x10')](_0x0bc1('0x16'),_0x18e139['message'],_0x15a9af);_0x4c3fbb(_0x4e14ae[_0x0bc1('0x10')](0x1f4,_0x18e139['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index e338e38..205016f 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 _0xdeb9=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test'];(function(_0x88c2d6,_0x11046e){var _0x1bbe1d=function(_0x5f0527){while(--_0x5f0527){_0x88c2d6['push'](_0x88c2d6['shift']());}};_0x1bbe1d(++_0x11046e);}(_0xdeb9,0x1d3));var _0x9deb=function(_0x11fdb2,_0x2b74db){_0x11fdb2=_0x11fdb2-0x0;var _0x3bd188=_0xdeb9[_0x11fdb2];return _0x3bd188;};'use strict';var multer=require(_0x9deb('0x0'));var util=require(_0x9deb('0x1'));var path=require(_0x9deb('0x2'));var timeout=require(_0x9deb('0x3'));var express=require('express');var router=express[_0x9deb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9deb('0x5'));var interaction=require(_0x9deb('0x6'));var config=require(_0x9deb('0x7'));var controller=require(_0x9deb('0x8'));router[_0x9deb('0x9')]('/',auth[_0x9deb('0xa')](),controller[_0x9deb('0xb')]);router[_0x9deb('0x9')](_0x9deb('0xc'),auth[_0x9deb('0xa')](),controller['show']);router[_0x9deb('0x9')](_0x9deb('0xd'),auth[_0x9deb('0xa')](),timeout(_0x9deb('0xe')),controller[_0x9deb('0xf')]);router[_0x9deb('0x10')]('/',auth[_0x9deb('0xa')](),controller[_0x9deb('0x11')]);router[_0x9deb('0x12')](_0x9deb('0xc'),auth[_0x9deb('0xa')](),controller[_0x9deb('0x13')]);router[_0x9deb('0x14')](_0x9deb('0xc'),auth[_0x9deb('0xa')](),controller[_0x9deb('0x15')]);module[_0x9deb('0x16')]=router; \ No newline at end of file +var _0xfb24=['put','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id/test','15s','test','create'];(function(_0x4819e1,_0x44d88e){var _0xca4f58=function(_0x494088){while(--_0x494088){_0x4819e1['push'](_0x4819e1['shift']());}};_0xca4f58(++_0x44d88e);}(_0xfb24,0x92));var _0x4fb2=function(_0x5aed89,_0x679fa6){_0x5aed89=_0x5aed89-0x0;var _0x50e863=_0xfb24[_0x5aed89];return _0x50e863;};'use strict';var multer=require(_0x4fb2('0x0'));var util=require(_0x4fb2('0x1'));var path=require('path');var timeout=require(_0x4fb2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4fb2('0x3'));var auth=require(_0x4fb2('0x4'));var interaction=require(_0x4fb2('0x5'));var config=require(_0x4fb2('0x6'));var controller=require(_0x4fb2('0x7'));router[_0x4fb2('0x8')]('/',auth[_0x4fb2('0x9')](),controller['index']);router[_0x4fb2('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4fb2('0x8')](_0x4fb2('0xa'),auth['isAuthenticated'](),timeout(_0x4fb2('0xb')),controller[_0x4fb2('0xc')]);router['post']('/',auth[_0x4fb2('0x9')](),controller[_0x4fb2('0xd')]);router[_0x4fb2('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4fb2('0xf')]('/:id',auth[_0x4fb2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index cf47a1e..855cf0f 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 _0x02e7=['name','sequelize','exports','STRING'];(function(_0x22d892,_0x2eae86){var _0x10a257=function(_0x50a658){while(--_0x50a658){_0x22d892['push'](_0x22d892['shift']());}};_0x10a257(++_0x2eae86);}(_0x02e7,0x17d));var _0x702e=function(_0x363d40,_0x3b3d61){_0x363d40=_0x363d40-0x0;var _0x9f330a=_0x02e7[_0x363d40];return _0x9f330a;};'use strict';var Sequelize=require(_0x702e('0x0'));module[_0x702e('0x1')]={'name':{'type':Sequelize[_0x702e('0x2')],'unique':_0x702e('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x702e('0x2')]}}; \ No newline at end of file +var _0x3423=['STRING','sequelize','exports'];(function(_0x4575b9,_0x8c2789){var _0x3125b4=function(_0x770b31){while(--_0x770b31){_0x4575b9['push'](_0x4575b9['shift']());}};_0x3125b4(++_0x8c2789);}(_0x3423,0x1a2));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3342('0x0'));module[_0x3342('0x1')]={'name':{'type':Sequelize[_0x3342('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3342('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 36dd221..bf810c5 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 _0xba01=['save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','filters','filter','where','merge','map','options','SquareOdbc','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x637800,_0x336c24){var _0x28ad13=function(_0xa03005){while(--_0xa03005){_0x637800['push'](_0x637800['shift']());}};_0x28ad13(++_0x336c24);}(_0xba01,0xe1));var _0x1ba0=function(_0x2838fa,_0x55938a){_0x2838fa=_0x2838fa-0x0;var _0x291c8b=_0xba01[_0x2838fa];return _0x291c8b;};'use strict';var emlformat=require(_0x1ba0('0x0'));var rimraf=require(_0x1ba0('0x1'));var zipdir=require(_0x1ba0('0x2'));var jsonpatch=require(_0x1ba0('0x3'));var rp=require(_0x1ba0('0x4'));var moment=require(_0x1ba0('0x5'));var BPromise=require(_0x1ba0('0x6'));var Mustache=require(_0x1ba0('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1ba0('0x8'));var csv=require(_0x1ba0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ba0('0xa'));var squel=require(_0x1ba0('0xb'));var crypto=require(_0x1ba0('0xc'));var jsforce=require(_0x1ba0('0xd'));var deskjs=require(_0x1ba0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1ba0('0xf'));var Redis=require('ioredis');var authService=require(_0x1ba0('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1ba0('0x11'));var hardwareService=require(_0x1ba0('0x12'));var logger=require(_0x1ba0('0x13'))(_0x1ba0('0x14'));var utils=require('../../config/utils');var config=require(_0x1ba0('0x15'));var licenseUtil=require(_0x1ba0('0x16'));var db=require(_0x1ba0('0x17'))['db'];function respondWithStatusCode(_0x434018,_0x2594eb){_0x2594eb=_0x2594eb||0xcc;return function(_0x3aea71){if(_0x3aea71){return _0x434018[_0x1ba0('0x18')](_0x2594eb);}return _0x434018[_0x1ba0('0x19')](_0x2594eb)[_0x1ba0('0x1a')]();};}function respondWithResult(_0x325e12,_0x4c372b){_0x4c372b=_0x4c372b||0xc8;return function(_0x3a5ddd){if(_0x3a5ddd){return _0x325e12[_0x1ba0('0x19')](_0x4c372b)['json'](_0x3a5ddd);}};}function respondWithFilteredResult(_0x3eafb9,_0x8cae14){return function(_0x1463f6){if(_0x1463f6){var _0x6753dd=typeof _0x8cae14[_0x1ba0('0x1b')]===_0x1ba0('0x1c')&&typeof _0x8cae14[_0x1ba0('0x1d')]===_0x1ba0('0x1c');var _0x1324de=_0x1463f6[_0x1ba0('0x1e')];var _0x4f0853=_0x6753dd?0x0:_0x8cae14[_0x1ba0('0x1b')];var _0x3fc68e=_0x6753dd?_0x1463f6['count']:_0x8cae14['offset']+_0x8cae14[_0x1ba0('0x1d')];var _0x10f335;if(_0x3fc68e>=_0x1324de){_0x3fc68e=_0x1324de;_0x10f335=0xc8;}else{_0x10f335=0xce;}_0x3eafb9[_0x1ba0('0x19')](_0x10f335);return _0x3eafb9[_0x1ba0('0x1f')](_0x1ba0('0x20'),_0x4f0853+'-'+_0x3fc68e+'/'+_0x1324de)[_0x1ba0('0x21')](_0x1463f6);}return null;};}function patchUpdates(_0x397852){return function(_0x4e583f){try{jsonpatch[_0x1ba0('0x22')](_0x4e583f,_0x397852,!![]);}catch(_0x3c4f79){return BPromise[_0x1ba0('0x23')](_0x3c4f79);}return _0x4e583f[_0x1ba0('0x24')]();};}function saveUpdates(_0x45f91c,_0xd4abcd){return function(_0x28eeee){if(_0x28eeee){return _0x28eeee[_0x1ba0('0x25')](_0x45f91c)[_0x1ba0('0x26')](function(_0x40ebf5){return _0x40ebf5;});}return null;};}function removeEntity(_0x28fe1b,_0x1a15bc){return function(_0x285765){if(_0x285765){return _0x285765[_0x1ba0('0x27')]()['then'](function(){var _0x5a9b4e=_0x285765[_0x1ba0('0x28')]({'plain':!![]});var _0x69c2e8=_0x1ba0('0x29');return db[_0x1ba0('0x2a')][_0x1ba0('0x27')]({'where':{'type':_0x69c2e8,'resourceId':_0x5a9b4e['id']}})[_0x1ba0('0x26')](function(){return _0x285765;});})[_0x1ba0('0x26')](function(){_0x28fe1b[_0x1ba0('0x19')](0xcc)[_0x1ba0('0x1a')]();});}};}function handleEntityNotFound(_0x5d08fa,_0x47ccf3){return function(_0x9e89b6){if(!_0x9e89b6){_0x5d08fa['sendStatus'](0x194);}return _0x9e89b6;};}function handleError(_0x4ab358,_0x4d0b2e){_0x4d0b2e=_0x4d0b2e||0x1f4;return function(_0x181896){logger[_0x1ba0('0x2b')](_0x181896[_0x1ba0('0x2c')]);if(_0x181896[_0x1ba0('0x2d')]){delete _0x181896[_0x1ba0('0x2d')];}_0x4ab358[_0x1ba0('0x19')](_0x4d0b2e)['send'](_0x181896);};}exports[_0x1ba0('0x2e')]=function(_0x39b3dc,_0x506983){var _0xc31537={},_0x2ae3f8={},_0x287ac3={'count':0x0,'rows':[]};var _0x56c0cd=_['map'](db['SquareOdbc'][_0x1ba0('0x2f')],function(_0x1f94b5){return{'name':_0x1f94b5[_0x1ba0('0x30')],'type':_0x1f94b5[_0x1ba0('0x31')][_0x1ba0('0x32')]};});_0x2ae3f8[_0x1ba0('0x33')]=_['map'](_0x56c0cd,'name');_0x2ae3f8['query']=_[_0x1ba0('0x34')](_0x39b3dc[_0x1ba0('0x35')]);_0x2ae3f8['filters']=_['intersection'](_0x2ae3f8[_0x1ba0('0x33')],_0x2ae3f8['query']);_0xc31537[_0x1ba0('0x36')]=_[_0x1ba0('0x37')](_0x2ae3f8[_0x1ba0('0x33')],qs['fields'](_0x39b3dc[_0x1ba0('0x35')][_0x1ba0('0x38')]));_0xc31537['attributes']=_0xc31537[_0x1ba0('0x36')][_0x1ba0('0x39')]?_0xc31537[_0x1ba0('0x36')]:_0x2ae3f8[_0x1ba0('0x33')];if(!_0x39b3dc['query']['hasOwnProperty'](_0x1ba0('0x3a'))){_0xc31537[_0x1ba0('0x1d')]=qs[_0x1ba0('0x1d')](_0x39b3dc[_0x1ba0('0x35')][_0x1ba0('0x1d')]);_0xc31537[_0x1ba0('0x1b')]=qs[_0x1ba0('0x1b')](_0x39b3dc['query']['offset']);}_0xc31537[_0x1ba0('0x3b')]=qs[_0x1ba0('0x3c')](_0x39b3dc[_0x1ba0('0x35')][_0x1ba0('0x3c')]);_0xc31537['where']=qs['filters'](_['pick'](_0x39b3dc['query'],_0x2ae3f8[_0x1ba0('0x3d')]),_0x56c0cd);if(_0x39b3dc['query'][_0x1ba0('0x3e')]){_0xc31537[_0x1ba0('0x3f')]=_[_0x1ba0('0x40')](_0xc31537[_0x1ba0('0x3f')],{'$or':_[_0x1ba0('0x41')](_0x56c0cd,function(_0x4f7a7e){if(_0x4f7a7e[_0x1ba0('0x31')]!=='VIRTUAL'){var _0x4d2bd6={};_0x4d2bd6[_0x4f7a7e['name']]={'$like':'%'+_0x39b3dc['query'][_0x1ba0('0x3e')]+'%'};return _0x4d2bd6;}})});}_0xc31537=_['merge']({},_0xc31537,_0x39b3dc[_0x1ba0('0x42')]);var _0x5d4df1={'where':_0xc31537['where']};return db[_0x1ba0('0x43')][_0x1ba0('0x1e')](_0x5d4df1)['then'](function(_0x106178){_0x287ac3[_0x1ba0('0x1e')]=_0x106178;if(_0x39b3dc[_0x1ba0('0x35')][_0x1ba0('0x44')]){_0xc31537[_0x1ba0('0x45')]=[{'all':!![]}];}return db[_0x1ba0('0x43')][_0x1ba0('0x46')](_0xc31537);})['then'](function(_0x3ad19c){_0x287ac3[_0x1ba0('0x47')]=_0x3ad19c;return _0x287ac3;})[_0x1ba0('0x26')](respondWithFilteredResult(_0x506983,_0xc31537))[_0x1ba0('0x48')](handleError(_0x506983,null));};exports['show']=function(_0x24618b,_0x5199b6){var _0x3fd635={'raw':!![],'where':{'id':_0x24618b[_0x1ba0('0x49')]['id']}},_0x4d7049={};_0x4d7049[_0x1ba0('0x33')]=_[_0x1ba0('0x34')](db['SquareOdbc'][_0x1ba0('0x2f')]);_0x4d7049['query']=_[_0x1ba0('0x34')](_0x24618b[_0x1ba0('0x35')]);_0x4d7049[_0x1ba0('0x3d')]=_['intersection'](_0x4d7049[_0x1ba0('0x33')],_0x4d7049[_0x1ba0('0x35')]);_0x3fd635['attributes']=_[_0x1ba0('0x37')](_0x4d7049[_0x1ba0('0x33')],qs[_0x1ba0('0x38')](_0x24618b['query'][_0x1ba0('0x38')]));_0x3fd635['attributes']=_0x3fd635[_0x1ba0('0x36')]['length']?_0x3fd635[_0x1ba0('0x36')]:_0x4d7049['model'];if(_0x24618b[_0x1ba0('0x35')][_0x1ba0('0x44')]){_0x3fd635['include']=[{'all':!![]}];}_0x3fd635=_[_0x1ba0('0x40')]({},_0x3fd635,_0x24618b['options']);return db['SquareOdbc']['find'](_0x3fd635)[_0x1ba0('0x26')](handleEntityNotFound(_0x5199b6,null))['then'](respondWithResult(_0x5199b6,null))[_0x1ba0('0x48')](handleError(_0x5199b6,null));};exports[_0x1ba0('0x4a')]=function(_0x33b4b1,_0x5c2542){return db[_0x1ba0('0x43')][_0x1ba0('0x4a')](_0x33b4b1[_0x1ba0('0x4b')],{})[_0x1ba0('0x26')](function(_0x213c8f){var _0x16ead5=_0x33b4b1[_0x1ba0('0x4c')][_0x1ba0('0x28')]({'plain':!![]});if(!_0x16ead5)throw new Error(_0x1ba0('0x4d'));if(_0x16ead5['role']===_0x1ba0('0x4c')){var _0x25924c=_0x213c8f['get']({'plain':!![]});var _0x5b4083=_0x1ba0('0x29');return db[_0x1ba0('0x4e')][_0x1ba0('0x4f')]({'where':{'name':_0x5b4083,'userProfileId':_0x16ead5['userProfileId']},'raw':!![]})['then'](function(_0x221059){if(_0x221059&&_0x221059[_0x1ba0('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x25924c[_0x1ba0('0x2d')],'resourceId':_0x25924c['id'],'type':_0x221059[_0x1ba0('0x2d')],'sectionId':_0x221059['id']},{})[_0x1ba0('0x26')](function(){return _0x213c8f;});}else{return _0x213c8f;}})[_0x1ba0('0x48')](function(_0xec61a5){logger[_0x1ba0('0x2b')](_0x1ba0('0x51'),_0xec61a5);throw _0xec61a5;});}return _0x213c8f;})[_0x1ba0('0x26')](respondWithResult(_0x5c2542,0xc9))['catch'](handleError(_0x5c2542,null));};exports[_0x1ba0('0x25')]=function(_0x3ec2dc,_0x48be37){if(_0x3ec2dc[_0x1ba0('0x4b')]['id']){delete _0x3ec2dc['body']['id'];}return db[_0x1ba0('0x43')][_0x1ba0('0x4f')]({'where':{'id':_0x3ec2dc[_0x1ba0('0x49')]['id']}})['then'](handleEntityNotFound(_0x48be37,null))['then'](saveUpdates(_0x3ec2dc[_0x1ba0('0x4b')],null))[_0x1ba0('0x26')](respondWithResult(_0x48be37,null))[_0x1ba0('0x48')](handleError(_0x48be37,null));};exports['destroy']=function(_0x5ef2c7,_0x5d11e9){return db[_0x1ba0('0x43')][_0x1ba0('0x4f')]({'where':{'id':_0x5ef2c7[_0x1ba0('0x49')]['id']}})[_0x1ba0('0x26')](handleEntityNotFound(_0x5d11e9,null))[_0x1ba0('0x26')](removeEntity(_0x5d11e9,null))[_0x1ba0('0x48')](handleError(_0x5d11e9,null));};exports[_0x1ba0('0x52')]=function(_0x1a33e4,_0x9bd7f4,_0x4173a6){var _0x1fa15f;return db['SquareOdbc'][_0x1ba0('0x4f')]({'where':{'id':_0x1a33e4[_0x1ba0('0x49')]['id']},'attributes':['id',_0x1ba0('0x53')]})[_0x1ba0('0x26')](handleEntityNotFound(_0x9bd7f4,null))[_0x1ba0('0x26')](function(_0x2b65eb){if(_0x2b65eb){var _0x106dd9=require(_0x1ba0('0x54'))();_0x106dd9[_0x1ba0('0x55')](_0x2b65eb['dsn']);_0x106dd9[_0x1ba0('0x56')]();return _0x2b65eb;}})[_0x1ba0('0x26')](respondWithResult(_0x9bd7f4,null))['catch'](handleError(_0x9bd7f4,null));}; \ No newline at end of file +var _0x6ea5=['fields','attributes','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','odbc','openSync','dsn','closeSync','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ODBC','destroy','error','stack','name','send','SquareOdbc','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model'];(function(_0x56ffb6,_0x27eab6){var _0x40b63=function(_0x201567){while(--_0x201567){_0x56ffb6['push'](_0x56ffb6['shift']());}};_0x40b63(++_0x27eab6);}(_0x6ea5,0xcd));var _0x56ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ea5[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x56ea('0x0'));var zipdir=require(_0x56ea('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x56ea('0x2'));var Mustache=require(_0x56ea('0x3'));var util=require(_0x56ea('0x4'));var path=require(_0x56ea('0x5'));var sox=require('sox');var csv=require(_0x56ea('0x6'));var ejs=require(_0x56ea('0x7'));var fs=require('fs');var fs_extra=require(_0x56ea('0x8'));var _=require(_0x56ea('0x9'));var squel=require(_0x56ea('0xa'));var crypto=require('crypto');var jsforce=require(_0x56ea('0xb'));var deskjs=require(_0x56ea('0xc'));var toCsv=require(_0x56ea('0x6'));var querystring=require(_0x56ea('0xd'));var Papa=require(_0x56ea('0xe'));var Redis=require('ioredis');var authService=require(_0x56ea('0xf'));var qs=require(_0x56ea('0x10'));var as=require(_0x56ea('0x11'));var hardwareService=require(_0x56ea('0x12'));var logger=require('../../config/logger')(_0x56ea('0x13'));var utils=require(_0x56ea('0x14'));var config=require(_0x56ea('0x15'));var licenseUtil=require(_0x56ea('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e4b20,_0x4eb7f6){_0x4eb7f6=_0x4eb7f6||0xcc;return function(_0x155924){if(_0x155924){return _0x5e4b20[_0x56ea('0x17')](_0x4eb7f6);}return _0x5e4b20[_0x56ea('0x18')](_0x4eb7f6)[_0x56ea('0x19')]();};}function respondWithResult(_0x42e369,_0x10f6a2){_0x10f6a2=_0x10f6a2||0xc8;return function(_0xa7b7b){if(_0xa7b7b){return _0x42e369[_0x56ea('0x18')](_0x10f6a2)[_0x56ea('0x1a')](_0xa7b7b);}};}function respondWithFilteredResult(_0x202797,_0x29cccb){return function(_0x44c6b5){if(_0x44c6b5){var _0x1e7174=typeof _0x29cccb[_0x56ea('0x1b')]===_0x56ea('0x1c')&&typeof _0x29cccb[_0x56ea('0x1d')]==='undefined';var _0x5b88b8=_0x44c6b5[_0x56ea('0x1e')];var _0x403d7e=_0x1e7174?0x0:_0x29cccb[_0x56ea('0x1b')];var _0x58568c=_0x1e7174?_0x44c6b5['count']:_0x29cccb[_0x56ea('0x1b')]+_0x29cccb[_0x56ea('0x1d')];var _0x2cb7cc;if(_0x58568c>=_0x5b88b8){_0x58568c=_0x5b88b8;_0x2cb7cc=0xc8;}else{_0x2cb7cc=0xce;}_0x202797[_0x56ea('0x18')](_0x2cb7cc);return _0x202797[_0x56ea('0x1f')](_0x56ea('0x20'),_0x403d7e+'-'+_0x58568c+'/'+_0x5b88b8)[_0x56ea('0x1a')](_0x44c6b5);}return null;};}function patchUpdates(_0x39e337){return function(_0x31af78){try{jsonpatch[_0x56ea('0x21')](_0x31af78,_0x39e337,!![]);}catch(_0x550956){return BPromise[_0x56ea('0x22')](_0x550956);}return _0x31af78[_0x56ea('0x23')]();};}function saveUpdates(_0x402676,_0x316ef7){return function(_0x1b82c1){if(_0x1b82c1){return _0x1b82c1[_0x56ea('0x24')](_0x402676)['then'](function(_0x2fac9c){return _0x2fac9c;});}return null;};}function removeEntity(_0x3e12fa,_0x2eff40){return function(_0x1ff874){if(_0x1ff874){return _0x1ff874['destroy']()[_0x56ea('0x25')](function(){var _0x213a49=_0x1ff874[_0x56ea('0x26')]({'plain':!![]});var _0x5611dc=_0x56ea('0x27');return db['UserProfileResource'][_0x56ea('0x28')]({'where':{'type':_0x5611dc,'resourceId':_0x213a49['id']}})[_0x56ea('0x25')](function(){return _0x1ff874;});})[_0x56ea('0x25')](function(){_0x3e12fa['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bc885,_0x1a580a){return function(_0xa7493e){if(!_0xa7493e){_0x4bc885['sendStatus'](0x194);}return _0xa7493e;};}function handleError(_0x3f28bb,_0x1fab7e){_0x1fab7e=_0x1fab7e||0x1f4;return function(_0x33762d){logger[_0x56ea('0x29')](_0x33762d[_0x56ea('0x2a')]);if(_0x33762d[_0x56ea('0x2b')]){delete _0x33762d[_0x56ea('0x2b')];}_0x3f28bb[_0x56ea('0x18')](_0x1fab7e)[_0x56ea('0x2c')](_0x33762d);};}exports['index']=function(_0xd11632,_0x1a5b01){var _0x20b221={},_0x3a242b={},_0xd4a589={'count':0x0,'rows':[]};var _0x1cf178=_['map'](db[_0x56ea('0x2d')][_0x56ea('0x2e')],function(_0x54998a){return{'name':_0x54998a[_0x56ea('0x2f')],'type':_0x54998a[_0x56ea('0x30')][_0x56ea('0x31')]};});_0x3a242b['model']=_[_0x56ea('0x32')](_0x1cf178,_0x56ea('0x2b'));_0x3a242b[_0x56ea('0x33')]=_[_0x56ea('0x34')](_0xd11632['query']);_0x3a242b[_0x56ea('0x35')]=_['intersection'](_0x3a242b['model'],_0x3a242b[_0x56ea('0x33')]);_0x20b221['attributes']=_[_0x56ea('0x36')](_0x3a242b[_0x56ea('0x37')],qs[_0x56ea('0x38')](_0xd11632[_0x56ea('0x33')][_0x56ea('0x38')]));_0x20b221['attributes']=_0x20b221[_0x56ea('0x39')]['length']?_0x20b221['attributes']:_0x3a242b[_0x56ea('0x37')];if(!_0xd11632[_0x56ea('0x33')]['hasOwnProperty']('nolimit')){_0x20b221[_0x56ea('0x1d')]=qs[_0x56ea('0x1d')](_0xd11632['query'][_0x56ea('0x1d')]);_0x20b221[_0x56ea('0x1b')]=qs[_0x56ea('0x1b')](_0xd11632['query']['offset']);}_0x20b221[_0x56ea('0x3a')]=qs[_0x56ea('0x3b')](_0xd11632['query'][_0x56ea('0x3b')]);_0x20b221[_0x56ea('0x3c')]=qs[_0x56ea('0x35')](_[_0x56ea('0x3d')](_0xd11632['query'],_0x3a242b[_0x56ea('0x35')]),_0x1cf178);if(_0xd11632[_0x56ea('0x33')]['filter']){_0x20b221[_0x56ea('0x3c')]=_[_0x56ea('0x3e')](_0x20b221[_0x56ea('0x3c')],{'$or':_['map'](_0x1cf178,function(_0x81c1f2){if(_0x81c1f2['type']!=='VIRTUAL'){var _0x3d53c4={};_0x3d53c4[_0x81c1f2[_0x56ea('0x2b')]]={'$like':'%'+_0xd11632[_0x56ea('0x33')][_0x56ea('0x3f')]+'%'};return _0x3d53c4;}})});}_0x20b221=_[_0x56ea('0x3e')]({},_0x20b221,_0xd11632[_0x56ea('0x40')]);var _0x2a522f={'where':_0x20b221['where']};return db[_0x56ea('0x2d')][_0x56ea('0x1e')](_0x2a522f)['then'](function(_0xfe2dda){_0xd4a589[_0x56ea('0x1e')]=_0xfe2dda;if(_0xd11632[_0x56ea('0x33')][_0x56ea('0x41')]){_0x20b221[_0x56ea('0x42')]=[{'all':!![]}];}return db[_0x56ea('0x2d')][_0x56ea('0x43')](_0x20b221);})[_0x56ea('0x25')](function(_0x412e9f){_0xd4a589[_0x56ea('0x44')]=_0x412e9f;return _0xd4a589;})[_0x56ea('0x25')](respondWithFilteredResult(_0x1a5b01,_0x20b221))[_0x56ea('0x45')](handleError(_0x1a5b01,null));};exports['show']=function(_0x2c53a4,_0xfe51e4){var _0x40444f={'raw':!![],'where':{'id':_0x2c53a4['params']['id']}},_0x2b74a3={};_0x2b74a3[_0x56ea('0x37')]=_[_0x56ea('0x34')](db[_0x56ea('0x2d')][_0x56ea('0x2e')]);_0x2b74a3['query']=_[_0x56ea('0x34')](_0x2c53a4[_0x56ea('0x33')]);_0x2b74a3[_0x56ea('0x35')]=_[_0x56ea('0x36')](_0x2b74a3[_0x56ea('0x37')],_0x2b74a3[_0x56ea('0x33')]);_0x40444f[_0x56ea('0x39')]=_[_0x56ea('0x36')](_0x2b74a3[_0x56ea('0x37')],qs[_0x56ea('0x38')](_0x2c53a4[_0x56ea('0x33')][_0x56ea('0x38')]));_0x40444f['attributes']=_0x40444f[_0x56ea('0x39')][_0x56ea('0x46')]?_0x40444f[_0x56ea('0x39')]:_0x2b74a3[_0x56ea('0x37')];if(_0x2c53a4[_0x56ea('0x33')]['includeAll']){_0x40444f['include']=[{'all':!![]}];}_0x40444f=_[_0x56ea('0x3e')]({},_0x40444f,_0x2c53a4[_0x56ea('0x40')]);return db[_0x56ea('0x2d')][_0x56ea('0x47')](_0x40444f)[_0x56ea('0x25')](handleEntityNotFound(_0xfe51e4,null))[_0x56ea('0x25')](respondWithResult(_0xfe51e4,null))[_0x56ea('0x45')](handleError(_0xfe51e4,null));};exports[_0x56ea('0x48')]=function(_0x2b9a7a,_0x2eab9f){return db[_0x56ea('0x2d')][_0x56ea('0x48')](_0x2b9a7a[_0x56ea('0x49')],{})[_0x56ea('0x25')](function(_0x54a029){var _0x11c5f3=_0x2b9a7a['user'][_0x56ea('0x26')]({'plain':!![]});if(!_0x11c5f3)throw new Error(_0x56ea('0x4a'));if(_0x11c5f3[_0x56ea('0x4b')]===_0x56ea('0x4c')){var _0x619d3e=_0x54a029['get']({'plain':!![]});var _0x25fbd1=_0x56ea('0x27');return db[_0x56ea('0x4d')][_0x56ea('0x47')]({'where':{'name':_0x25fbd1,'userProfileId':_0x11c5f3[_0x56ea('0x4e')]},'raw':!![]})[_0x56ea('0x25')](function(_0x275a31){if(_0x275a31&&_0x275a31['autoAssociation']===0x0){return db[_0x56ea('0x4f')][_0x56ea('0x48')]({'name':_0x619d3e[_0x56ea('0x2b')],'resourceId':_0x619d3e['id'],'type':_0x275a31[_0x56ea('0x2b')],'sectionId':_0x275a31['id']},{})[_0x56ea('0x25')](function(){return _0x54a029;});}else{return _0x54a029;}})[_0x56ea('0x45')](function(_0x45e926){logger[_0x56ea('0x29')](_0x56ea('0x50'),_0x45e926);throw _0x45e926;});}return _0x54a029;})[_0x56ea('0x25')](respondWithResult(_0x2eab9f,0xc9))['catch'](handleError(_0x2eab9f,null));};exports['update']=function(_0x4b7166,_0x45ecaa){if(_0x4b7166[_0x56ea('0x49')]['id']){delete _0x4b7166[_0x56ea('0x49')]['id'];}return db[_0x56ea('0x2d')][_0x56ea('0x47')]({'where':{'id':_0x4b7166[_0x56ea('0x51')]['id']}})['then'](handleEntityNotFound(_0x45ecaa,null))[_0x56ea('0x25')](saveUpdates(_0x4b7166['body'],null))[_0x56ea('0x25')](respondWithResult(_0x45ecaa,null))[_0x56ea('0x45')](handleError(_0x45ecaa,null));};exports['destroy']=function(_0x48e6a3,_0x11f384){return db[_0x56ea('0x2d')][_0x56ea('0x47')]({'where':{'id':_0x48e6a3[_0x56ea('0x51')]['id']}})[_0x56ea('0x25')](handleEntityNotFound(_0x11f384,null))[_0x56ea('0x25')](removeEntity(_0x11f384,null))['catch'](handleError(_0x11f384,null));};exports[_0x56ea('0x52')]=function(_0x36414d,_0x367beb,_0x24f064){var _0x25b3f3;return db[_0x56ea('0x2d')][_0x56ea('0x47')]({'where':{'id':_0x36414d[_0x56ea('0x51')]['id']},'attributes':['id','dsn']})[_0x56ea('0x25')](handleEntityNotFound(_0x367beb,null))[_0x56ea('0x25')](function(_0x2a59b9){if(_0x2a59b9){var _0x3ca84b=require(_0x56ea('0x53'))();_0x3ca84b[_0x56ea('0x54')](_0x2a59b9[_0x56ea('0x55')]);_0x3ca84b[_0x56ea('0x56')]();return _0x2a59b9;}})[_0x56ea('0x25')](respondWithResult(_0x367beb,null))[_0x56ea('0x45')](handleError(_0x367beb,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 704c9f9..a95b678 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 _0xab90=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','lodash'];(function(_0x1c24c6,_0x5c26ed){var _0x26949a=function(_0x3298db){while(--_0x3298db){_0x1c24c6['push'](_0x1c24c6['shift']());}};_0x26949a(++_0x5c26ed);}(_0xab90,0x9b));var _0x0ab9=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xab90[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x0ab9('0x0'));var util=require(_0x0ab9('0x1'));var logger=require(_0x0ab9('0x2'))(_0x0ab9('0x3'));var moment=require(_0x0ab9('0x4'));var BPromise=require(_0x0ab9('0x5'));var rp=require(_0x0ab9('0x6'));var fs=require('fs');var path=require(_0x0ab9('0x7'));var rimraf=require(_0x0ab9('0x8'));var config=require('../../config/environment');var attributes=require(_0x0ab9('0x9'));module[_0x0ab9('0xa')]=function(_0x27da93,_0xab56e7){return _0x27da93[_0x0ab9('0xb')](_0x0ab9('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbee2=['lodash','util','../../config/logger','bluebird','path','../../config/environment','exports','define','SquareOdbc','square_odbc'];(function(_0x11d1b7,_0x3b2eaf){var _0x4d6a70=function(_0x1bb36e){while(--_0x1bb36e){_0x11d1b7['push'](_0x11d1b7['shift']());}};_0x4d6a70(++_0x3b2eaf);}(_0xbee2,0x1e0));var _0x2bee=function(_0x996bc8,_0x291e01){_0x996bc8=_0x996bc8-0x0;var _0x20b0ea=_0xbee2[_0x996bc8];return _0x20b0ea;};'use strict';var _=require(_0x2bee('0x0'));var util=require(_0x2bee('0x1'));var logger=require(_0x2bee('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2bee('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2bee('0x4'));var rimraf=require('rimraf');var config=require(_0x2bee('0x5'));var attributes=require('./squareOdbc.attributes');module[_0x2bee('0x6')]=function(_0x187287,_0x2531e0){return _0x187287[_0x2bee('0x7')](_0x2bee('0x8'),attributes,{'tableName':_0x2bee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index fc30efb..2402132 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 _0x696f=['include','map','model','catch','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x696f,0x1a8));var _0xf696=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x696f[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xf696('0x0'));var util=require(_0xf696('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf696('0x2'))['db'];var utils=require(_0xf696('0x3'));var logger=require('../../config/logger')(_0xf696('0x4'));var config=require(_0xf696('0x5'));var jayson=require(_0xf696('0x6'));var client=jayson[_0xf696('0x7')][_0xf696('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ce52f,_0x3d6994,_0x4c8650){return new BPromise(function(_0x28523e,_0x314c3d){return client[_0xf696('0x9')](_0x4ce52f,_0x4c8650)[_0xf696('0xa')](function(_0x557ca0){logger[_0xf696('0xb')](_0xf696('0xc'),_0x3d6994,'request\x20sent');logger[_0xf696('0xd')](_0xf696('0xe'),_0x3d6994,_0xf696('0xf'),JSON['stringify'](_0x557ca0));if(_0x557ca0[_0xf696('0x10')]){if(_0x557ca0['error'][_0xf696('0x11')]===0x1f4){logger[_0xf696('0x10')](_0xf696('0xc'),_0x3d6994,_0x557ca0[_0xf696('0x10')][_0xf696('0x12')]);return _0x314c3d(_0x557ca0[_0xf696('0x10')][_0xf696('0x12')]);}logger['error'](_0xf696('0xc'),_0x3d6994,_0x557ca0[_0xf696('0x10')][_0xf696('0x12')]);return _0x28523e(_0x557ca0[_0xf696('0x10')][_0xf696('0x12')]);}else{logger['info'](_0xf696('0xc'),_0x3d6994,'request\x20sent');_0x28523e(_0x557ca0[_0xf696('0x13')][_0xf696('0x12')]);}})['catch'](function(_0x4f1c3b){logger[_0xf696('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x3d6994,_0x4f1c3b);_0x314c3d(_0x4f1c3b);});});}exports[_0xf696('0x14')]=function(_0x265c88){var _0x122d59=this;return new Promise(function(_0x3c7683,_0x49d196){return db[_0xf696('0x15')]['find']({'raw':_0x265c88[_0xf696('0x16')]?_0x265c88['options'][_0xf696('0x17')]===undefined?!![]:![]:!![],'where':_0x265c88['options']?_0x265c88[_0xf696('0x16')][_0xf696('0x18')]||null:null,'attributes':_0x265c88['options']?_0x265c88[_0xf696('0x16')][_0xf696('0x19')]||null:null,'include':_0x265c88[_0xf696('0x16')]?_0x265c88[_0xf696('0x16')][_0xf696('0x1a')]?_[_0xf696('0x1b')](_0x265c88[_0xf696('0x16')][_0xf696('0x1a')],function(_0x229037){return{'model':db[_0x229037[_0xf696('0x1c')]],'as':_0x229037['as'],'attributes':_0x229037[_0xf696('0x19')],'include':_0x229037[_0xf696('0x1a')]?_[_0xf696('0x1b')](_0x229037[_0xf696('0x1a')],function(_0x3c8e5a){return{'model':db[_0x3c8e5a[_0xf696('0x1c')]],'as':_0x3c8e5a['as'],'attributes':_0x3c8e5a[_0xf696('0x19')],'include':_0x3c8e5a[_0xf696('0x1a')]?_['map'](_0x3c8e5a[_0xf696('0x1a')],function(_0x56c77f){return{'model':db[_0x56c77f[_0xf696('0x1c')]],'as':_0x56c77f['as'],'attributes':_0x56c77f[_0xf696('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf696('0xa')](function(_0x204e18){logger[_0xf696('0xb')](_0xf696('0x14'),_0x265c88);logger['debug'](_0xf696('0x14'),_0x265c88,JSON['stringify'](_0x204e18));_0x3c7683(_0x204e18);})[_0xf696('0x1d')](function(_0xeaec40){logger[_0xf696('0x10')](_0xf696('0x14'),_0xeaec40[_0xf696('0x12')],_0x265c88);_0x49d196(_0x122d59['error'](0x1f4,_0xeaec40[_0xf696('0x12')]));});});}; \ No newline at end of file +var _0xb871=['include','map','model','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','options','raw','attributes'];(function(_0x4de655,_0x5eb7d0){var _0x47d8c2=function(_0x10cdd8){while(--_0x10cdd8){_0x4de655['push'](_0x4de655['shift']());}};_0x47d8c2(++_0x5eb7d0);}(_0xb871,0x80));var _0x1b87=function(_0x5d82d9,_0x3d7694){_0x5d82d9=_0x5d82d9-0x0;var _0x3dfd86=_0xb871[_0x5d82d9];return _0x3dfd86;};'use strict';var _=require(_0x1b87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1b87('0x1'));var rs=require(_0x1b87('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1b87('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b87('0x4'))(_0x1b87('0x5'));var config=require(_0x1b87('0x6'));var jayson=require(_0x1b87('0x7'));var client=jayson[_0x1b87('0x8')][_0x1b87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x63e7e4,_0x53ddab,_0x1a2c32){return new BPromise(function(_0x4babaa,_0x49d521){return client[_0x1b87('0xa')](_0x63e7e4,_0x1a2c32)[_0x1b87('0xb')](function(_0xfb1996){logger[_0x1b87('0xc')](_0x1b87('0xd'),_0x53ddab,_0x1b87('0xe'));logger[_0x1b87('0xf')](_0x1b87('0x10'),_0x53ddab,_0x1b87('0xe'),JSON[_0x1b87('0x11')](_0xfb1996));if(_0xfb1996['error']){if(_0xfb1996[_0x1b87('0x12')][_0x1b87('0x13')]===0x1f4){logger[_0x1b87('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x53ddab,_0xfb1996[_0x1b87('0x12')]['message']);return _0x49d521(_0xfb1996['error'][_0x1b87('0x14')]);}logger[_0x1b87('0x12')](_0x1b87('0xd'),_0x53ddab,_0xfb1996[_0x1b87('0x12')][_0x1b87('0x14')]);return _0x4babaa(_0xfb1996[_0x1b87('0x12')][_0x1b87('0x14')]);}else{logger[_0x1b87('0xc')](_0x1b87('0xd'),_0x53ddab,_0x1b87('0xe'));_0x4babaa(_0xfb1996[_0x1b87('0x15')]['message']);}})['catch'](function(_0x50662b){logger['error'](_0x1b87('0xd'),_0x53ddab,_0x50662b);_0x49d521(_0x50662b);});});}exports[_0x1b87('0x16')]=function(_0x28a22c){var _0x1dcda7=this;return new Promise(function(_0x36ed99,_0xcc3104){return db[_0x1b87('0x17')]['find']({'raw':_0x28a22c[_0x1b87('0x18')]?_0x28a22c['options'][_0x1b87('0x19')]===undefined?!![]:![]:!![],'where':_0x28a22c['options']?_0x28a22c[_0x1b87('0x18')]['where']||null:null,'attributes':_0x28a22c[_0x1b87('0x18')]?_0x28a22c['options'][_0x1b87('0x1a')]||null:null,'include':_0x28a22c[_0x1b87('0x18')]?_0x28a22c[_0x1b87('0x18')][_0x1b87('0x1b')]?_[_0x1b87('0x1c')](_0x28a22c[_0x1b87('0x18')][_0x1b87('0x1b')],function(_0xa721d9){return{'model':db[_0xa721d9[_0x1b87('0x1d')]],'as':_0xa721d9['as'],'attributes':_0xa721d9[_0x1b87('0x1a')],'include':_0xa721d9['include']?_['map'](_0xa721d9[_0x1b87('0x1b')],function(_0x14dea8){return{'model':db[_0x14dea8[_0x1b87('0x1d')]],'as':_0x14dea8['as'],'attributes':_0x14dea8[_0x1b87('0x1a')],'include':_0x14dea8[_0x1b87('0x1b')]?_[_0x1b87('0x1c')](_0x14dea8['include'],function(_0x101393){return{'model':db[_0x101393[_0x1b87('0x1d')]],'as':_0x101393['as'],'attributes':_0x101393['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b87('0xb')](function(_0x26871c){logger[_0x1b87('0xc')]('ShowSquareOdbc',_0x28a22c);logger[_0x1b87('0xf')]('ShowSquareOdbc',_0x28a22c,JSON[_0x1b87('0x11')](_0x26871c));_0x36ed99(_0x26871c);})[_0x1b87('0x1e')](function(_0x4f8dfb){logger['error']('ShowSquareOdbc',_0x4f8dfb[_0x1b87('0x14')],_0x28a22c);_0xcc3104(_0x1dcda7[_0x1b87('0x12')](0x1f4,_0x4f8dfb['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 02787a7..d66c66e 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 _0xd821=['destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','show','post','put','/:id','update','delete'];(function(_0x10518c,_0x10d736){var _0x126166=function(_0x117cfc){while(--_0x117cfc){_0x10518c['push'](_0x10518c['shift']());}};_0x126166(++_0x10d736);}(_0xd821,0xb6));var _0x1d82=function(_0xd42c2b,_0x2ab8f7){_0xd42c2b=_0xd42c2b-0x0;var _0x59a230=_0xd821[_0xd42c2b];return _0x59a230;};'use strict';var multer=require('multer');var util=require(_0x1d82('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d82('0x1'));var router=express[_0x1d82('0x2')]();var fs_extra=require(_0x1d82('0x3'));var auth=require(_0x1d82('0x4'));var interaction=require(_0x1d82('0x5'));var config=require(_0x1d82('0x6'));var controller=require(_0x1d82('0x7'));router[_0x1d82('0x8')]('/',auth[_0x1d82('0x9')](),controller['index']);router[_0x1d82('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1d82('0xa')]);router[_0x1d82('0xb')]('/',auth[_0x1d82('0x9')](),controller['create']);router[_0x1d82('0xc')](_0x1d82('0xd'),auth['isAuthenticated'](),controller[_0x1d82('0xe')]);router[_0x1d82('0xf')]('/:id',auth[_0x1d82('0x9')](),controller[_0x1d82('0x10')]);module[_0x1d82('0x11')]=router; \ No newline at end of file +var _0x3dae=['isAuthenticated','index','/:id','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x4d0b2a,_0x3a3ce3){var _0x156ab3=function(_0x24cd18){while(--_0x24cd18){_0x4d0b2a['push'](_0x4d0b2a['shift']());}};_0x156ab3(++_0x3a3ce3);}(_0x3dae,0xbc));var _0xe3da=function(_0x678b2f,_0x57b754){_0x678b2f=_0x678b2f-0x0;var _0x591c34=_0x3dae[_0x678b2f];return _0x591c34;};'use strict';var multer=require(_0xe3da('0x0'));var util=require(_0xe3da('0x1'));var path=require(_0xe3da('0x2'));var timeout=require(_0xe3da('0x3'));var express=require('express');var router=express[_0xe3da('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe3da('0x5'));var interaction=require(_0xe3da('0x6'));var config=require(_0xe3da('0x7'));var controller=require(_0xe3da('0x8'));router[_0xe3da('0x9')]('/',auth[_0xe3da('0xa')](),controller[_0xe3da('0xb')]);router['get'](_0xe3da('0xc'),auth[_0xe3da('0xa')](),controller['show']);router['post']('/',auth[_0xe3da('0xa')](),controller[_0xe3da('0xd')]);router[_0xe3da('0xe')](_0xe3da('0xc'),auth[_0xe3da('0xa')](),controller[_0xe3da('0xf')]);router[_0xe3da('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xe3da('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 3084807..a4f55e3 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 _0x9749=['exports','STRING','TEXT','getDataValue','preproduction','toString','utf8','BLOB','long','production','DATE'];(function(_0x5d24b1,_0x33b379){var _0x56d0d2=function(_0x332388){while(--_0x332388){_0x5d24b1['push'](_0x5d24b1['shift']());}};_0x56d0d2(++_0x33b379);}(_0x9749,0x1e4));var _0x9974=function(_0x476ebb,_0x17a1aa){_0x476ebb=_0x476ebb-0x0;var _0x48618e=_0x9749[_0x476ebb];return _0x48618e;};'use strict';var Sequelize=require('sequelize');module[_0x9974('0x0')]={'name':{'type':Sequelize[_0x9974('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x9974('0x1')]},'notes':{'type':Sequelize[_0x9974('0x2')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0x9974('0x3')]('preproduction')){return this[_0x9974('0x3')](_0x9974('0x4'))[_0x9974('0x5')](_0x9974('0x6'));}}},'production':{'type':Sequelize[_0x9974('0x7')](_0x9974('0x8')),'get':function(){if(this['getDataValue'](_0x9974('0x9'))){return this[_0x9974('0x3')]('production')[_0x9974('0x5')]('utf8');}}},'savedAt':{'type':Sequelize[_0x9974('0xa')]},'publishedAt':{'type':Sequelize[_0x9974('0xa')]}}; \ No newline at end of file +var _0x12b6=['DATE','sequelize','exports','STRING','BLOB','long','preproduction','getDataValue','toString','production'];(function(_0x4bb503,_0x3553a0){var _0x24a543=function(_0x26e2f2){while(--_0x26e2f2){_0x4bb503['push'](_0x4bb503['shift']());}};_0x24a543(++_0x3553a0);}(_0x12b6,0x1b9));var _0x612b=function(_0x592f46,_0x268ae3){_0x592f46=_0x592f46-0x0;var _0x225678=_0x12b6[_0x592f46];return _0x225678;};'use strict';var Sequelize=require(_0x612b('0x0'));module[_0x612b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x612b('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x612b('0x3')](_0x612b('0x4')),'get':function(){if(this['getDataValue'](_0x612b('0x5'))){return this[_0x612b('0x6')]('preproduction')[_0x612b('0x7')]('utf8');}}},'production':{'type':Sequelize[_0x612b('0x3')](_0x612b('0x4')),'get':function(){if(this[_0x612b('0x6')](_0x612b('0x8'))){return this[_0x612b('0x6')](_0x612b('0x8'))[_0x612b('0x7')]('utf8');}}},'savedAt':{'type':Sequelize[_0x612b('0x9')]},'publishedAt':{'type':Sequelize[_0x612b('0x9')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 983447f..2ed07fd 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 _0xc4a7=['hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','production','lodash','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','stringify','end','sendStatus','error','name','send','map','SquareProject','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes'];(function(_0x38ad10,_0x1f2749){var _0x83bcce=function(_0x4569c0){while(--_0x4569c0){_0x38ad10['push'](_0x38ad10['shift']());}};_0x83bcce(++_0x1f2749);}(_0xc4a7,0xae));var _0x7c4a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc4a7[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x7c4a('0x0'));var Redis=require('ioredis');var qs=require(_0x7c4a('0x1'));var logger=require(_0x7c4a('0x2'))('api');var config=require(_0x7c4a('0x3'));var db=require(_0x7c4a('0x4'))['db'];config[_0x7c4a('0x5')]=_[_0x7c4a('0x6')](config[_0x7c4a('0x5')],{'host':_0x7c4a('0x7'),'port':0x18eb});var socket=require(_0x7c4a('0x8'))(new Redis(config[_0x7c4a('0x5')]));require(_0x7c4a('0x9'))[_0x7c4a('0xa')](socket);function respondWithResult(_0x144c5f,_0x2e5cda){_0x2e5cda=_0x2e5cda||0xc8;return function(_0x3fa060){if(_0x3fa060){return _0x144c5f[_0x7c4a('0xb')](_0x2e5cda)[_0x7c4a('0xc')](_0x3fa060);}};}function respondWithFilteredResult(_0x4c2b2a,_0x204e0c){return function(_0x2ee78d){if(_0x2ee78d){var _0x3233a6=typeof _0x204e0c[_0x7c4a('0xd')]===_0x7c4a('0xe')&&typeof _0x204e0c[_0x7c4a('0xf')]===_0x7c4a('0xe');var _0x1386eb=_0x2ee78d[_0x7c4a('0x10')];var _0x17e9b8=_0x3233a6?0x0:_0x204e0c[_0x7c4a('0xd')];var _0x2859de=_0x3233a6?_0x2ee78d['count']:_0x204e0c[_0x7c4a('0xd')]+_0x204e0c[_0x7c4a('0xf')];var _0x22a362;if(_0x2859de>=_0x1386eb){_0x2859de=_0x1386eb;_0x22a362=0xc8;}else{_0x22a362=0xce;}_0x4c2b2a[_0x7c4a('0xb')](_0x22a362);return _0x4c2b2a[_0x7c4a('0x11')](_0x7c4a('0x12'),_0x17e9b8+'-'+_0x2859de+'/'+_0x1386eb)[_0x7c4a('0xc')](_0x2ee78d);}return null;};}function saveUpdates(_0x343dd8){return function(_0x5227a7){if(_0x5227a7){return _0x5227a7[_0x7c4a('0x13')](_0x343dd8)[_0x7c4a('0x14')](function(_0x467c58){return _0x467c58;});}return null;};}function removeEntity(_0x549884){return function(_0x5da5ea){if(_0x5da5ea){return _0x5da5ea[_0x7c4a('0x15')]()[_0x7c4a('0x14')](function(){var _0x11de1c=_0x5da5ea[_0x7c4a('0x16')]({'plain':!![]});var _0x45854b=_0x7c4a('0x17');return db[_0x7c4a('0x18')][_0x7c4a('0x15')]({'where':{'type':_0x45854b,'resourceId':_0x11de1c['id']}})[_0x7c4a('0x14')](function(){return _0x5da5ea;});})['then'](function(){var _0x542480=new Redis(config[_0x7c4a('0x5')]);_0x542480[_0x7c4a('0x19')](_0x7c4a('0x1a'),JSON[_0x7c4a('0x1b')]({'id':_0x5da5ea['id'],'deleted':!![]}));})[_0x7c4a('0x14')](function(){_0x549884['status'](0xcc)[_0x7c4a('0x1c')]();});}};}function handleEntityNotFound(_0x113fc8){return function(_0x2ebf56){if(!_0x2ebf56){_0x113fc8[_0x7c4a('0x1d')](0x194);}return _0x2ebf56;};}function handleError(_0x1d0026,_0x4b6a10){_0x4b6a10=_0x4b6a10||0x1f4;return function(_0x109148){logger[_0x7c4a('0x1e')](_0x109148['stack']);if(_0x109148[_0x7c4a('0x1f')]){delete _0x109148[_0x7c4a('0x1f')];}_0x1d0026[_0x7c4a('0xb')](_0x4b6a10)[_0x7c4a('0x20')](_0x109148);};}exports['index']=function(_0x4dff70,_0x1d9bb9){var _0x715a5f={},_0x207f5c={},_0x187273={'count':0x0,'rows':[]};var _0xa2d5e0=_[_0x7c4a('0x21')](db[_0x7c4a('0x22')]['rawAttributes'],function(_0x3fc425){return{'name':_0x3fc425[_0x7c4a('0x23')],'type':_0x3fc425[_0x7c4a('0x24')][_0x7c4a('0x25')]};});_0x207f5c[_0x7c4a('0x26')]=_[_0x7c4a('0x21')](_0xa2d5e0,_0x7c4a('0x1f'));_0x207f5c[_0x7c4a('0x27')]=_[_0x7c4a('0x28')](_0x4dff70[_0x7c4a('0x27')]);_0x207f5c[_0x7c4a('0x29')]=_[_0x7c4a('0x2a')](_0x207f5c[_0x7c4a('0x26')],_0x207f5c[_0x7c4a('0x27')]);_0x715a5f['attributes']=_[_0x7c4a('0x2a')](_0x207f5c[_0x7c4a('0x26')],qs[_0x7c4a('0x2b')](_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0x2b')]));_0x715a5f[_0x7c4a('0x2c')]=_0x715a5f[_0x7c4a('0x2c')]['length']?_0x715a5f['attributes']:_0x207f5c[_0x7c4a('0x26')];if(!_0x4dff70['query'][_0x7c4a('0x2d')]('nolimit')){_0x715a5f['limit']=qs['limit'](_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0xf')]);_0x715a5f['offset']=qs[_0x7c4a('0xd')](_0x4dff70['query'][_0x7c4a('0xd')]);}_0x715a5f[_0x7c4a('0x2e')]=qs[_0x7c4a('0x2f')](_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0x2f')]);_0x715a5f['where']=qs[_0x7c4a('0x29')](_[_0x7c4a('0x30')](_0x4dff70['query'],_0x207f5c[_0x7c4a('0x29')]),_0xa2d5e0);if(_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0x31')]){_0x715a5f[_0x7c4a('0x32')]=_[_0x7c4a('0x33')](_0x715a5f['where'],{'$or':_[_0x7c4a('0x21')](_0xa2d5e0,function(_0x318b6d){if(_0x318b6d[_0x7c4a('0x24')]!==_0x7c4a('0x34')){var _0x472190={};_0x472190[_0x318b6d[_0x7c4a('0x1f')]]={'$like':'%'+_0x4dff70['query'][_0x7c4a('0x31')]+'%'};return _0x472190;}})});}_0x715a5f=_[_0x7c4a('0x33')]({},_0x715a5f,_0x4dff70[_0x7c4a('0x35')]);var _0x27cc29={'where':_0x715a5f[_0x7c4a('0x32')]};return db[_0x7c4a('0x22')][_0x7c4a('0x10')](_0x27cc29)['then'](function(_0x360f3a){_0x187273['count']=_0x360f3a;if(_0x4dff70[_0x7c4a('0x27')][_0x7c4a('0x36')]){_0x715a5f[_0x7c4a('0x37')]=[{'all':!![]}];}return db[_0x7c4a('0x22')][_0x7c4a('0x38')](_0x715a5f);})['then'](function(_0x46a168){_0x187273[_0x7c4a('0x39')]=_0x46a168;return _0x187273;})[_0x7c4a('0x14')](respondWithFilteredResult(_0x1d9bb9,_0x715a5f))[_0x7c4a('0x3a')](handleError(_0x1d9bb9,null));};exports[_0x7c4a('0x3b')]=function(_0x5746da,_0xc6725a){var _0x11f9aa={'raw':![],'where':{'id':_0x5746da[_0x7c4a('0x3c')]['id']}},_0x4fa0c3={};_0x4fa0c3[_0x7c4a('0x26')]=_['keys'](db[_0x7c4a('0x22')][_0x7c4a('0x3d')]);_0x4fa0c3[_0x7c4a('0x27')]=_[_0x7c4a('0x28')](_0x5746da[_0x7c4a('0x27')]);_0x4fa0c3[_0x7c4a('0x29')]=_[_0x7c4a('0x2a')](_0x4fa0c3['model'],_0x4fa0c3[_0x7c4a('0x27')]);_0x11f9aa[_0x7c4a('0x2c')]=_[_0x7c4a('0x2a')](_0x4fa0c3['model'],qs['fields'](_0x5746da[_0x7c4a('0x27')][_0x7c4a('0x2b')]));_0x11f9aa[_0x7c4a('0x2c')]=_0x11f9aa[_0x7c4a('0x2c')]['length']?_0x11f9aa[_0x7c4a('0x2c')]:_0x4fa0c3['model'];if(_0x5746da[_0x7c4a('0x27')]['includeAll']){_0x11f9aa[_0x7c4a('0x37')]=[{'all':!![]}];}_0x11f9aa=_['merge']({},_0x11f9aa,_0x5746da[_0x7c4a('0x35')]);return db[_0x7c4a('0x22')][_0x7c4a('0x3e')](_0x11f9aa)[_0x7c4a('0x14')](handleEntityNotFound(_0xc6725a,null))[_0x7c4a('0x14')](respondWithResult(_0xc6725a,null))[_0x7c4a('0x3a')](handleError(_0xc6725a,null));};exports[_0x7c4a('0x3f')]=function(_0x2527d5,_0x5b464a){return db[_0x7c4a('0x22')][_0x7c4a('0x3f')](_0x2527d5['body'],{})[_0x7c4a('0x14')](function(_0x13c5a0){var _0x2b049e=_0x2527d5[_0x7c4a('0x40')]['get']({'plain':!![]});if(!_0x2b049e)throw new Error(_0x7c4a('0x41'));if(_0x2b049e[_0x7c4a('0x42')]===_0x7c4a('0x40')){var _0x3c82dd=_0x13c5a0[_0x7c4a('0x16')]({'plain':!![]});var _0x195afd=_0x7c4a('0x17');return db[_0x7c4a('0x43')][_0x7c4a('0x3e')]({'where':{'name':_0x195afd,'userProfileId':_0x2b049e[_0x7c4a('0x44')]},'raw':!![]})['then'](function(_0x22b148){if(_0x22b148&&_0x22b148[_0x7c4a('0x45')]===0x0){return db['UserProfileResource'][_0x7c4a('0x3f')]({'name':_0x3c82dd['name'],'resourceId':_0x3c82dd['id'],'type':_0x22b148[_0x7c4a('0x1f')],'sectionId':_0x22b148['id']},{})[_0x7c4a('0x14')](function(){return _0x13c5a0;});}else{return _0x13c5a0;}})[_0x7c4a('0x3a')](function(_0x227b1c){logger[_0x7c4a('0x1e')](_0x7c4a('0x46'),_0x227b1c);throw _0x227b1c;});}return _0x13c5a0;})[_0x7c4a('0x14')](respondWithResult(_0x5b464a,0xc9))['catch'](handleError(_0x5b464a,null));};exports[_0x7c4a('0x13')]=function(_0x2b3619,_0x335abb){if(_0x2b3619[_0x7c4a('0x47')]['id']){delete _0x2b3619['body']['id'];}return db[_0x7c4a('0x22')]['find']({'where':{'id':_0x2b3619[_0x7c4a('0x3c')]['id']}})[_0x7c4a('0x14')](handleEntityNotFound(_0x335abb,null))[_0x7c4a('0x14')](saveUpdates(_0x2b3619[_0x7c4a('0x47')],null))[_0x7c4a('0x14')](function(_0x51211f){if(!_0x51211f)return;var _0x58523b=_0x51211f[_0x7c4a('0x16')]({'plain':!![]});return _0x58523b;})[_0x7c4a('0x14')](function(_0x3f96ba){var _0x22a21f=new Redis(config['redis']);_0x22a21f[_0x7c4a('0x19')]('agi',JSON[_0x7c4a('0x1b')](_['pick'](_0x3f96ba,['id','name',_0x7c4a('0x48')])));return _0x3f96ba;})['then'](respondWithResult(_0x335abb,null))[_0x7c4a('0x3a')](handleError(_0x335abb,null));};exports[_0x7c4a('0x15')]=function(_0x44b189,_0x519a6b){return db[_0x7c4a('0x22')]['find']({'where':{'id':_0x44b189[_0x7c4a('0x3c')]['id']}})[_0x7c4a('0x14')](handleEntityNotFound(_0x519a6b,null))['then'](removeEntity(_0x519a6b,null))[_0x7c4a('0x3a')](handleError(_0x519a6b,null));}; \ No newline at end of file +var _0x0843=['show','params','rawAttributes','options','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','limit','count','set','Content-Range','update','destroy','then','SquareProjects','UserProfileResource','publish','agi','end','sendStatus','error','stack','name','map','SquareProject','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch'];(function(_0xaa4342,_0x4149f9){var _0x5ac7d6=function(_0x2c9f3b){while(--_0x2c9f3b){_0xaa4342['push'](_0xaa4342['shift']());}};_0x5ac7d6(++_0x4149f9);}(_0x0843,0xde));var _0x3084=function(_0x2913e7,_0x5268a6){_0x2913e7=_0x2913e7-0x0;var _0x52f254=_0x0843[_0x2913e7];return _0x52f254;};'use strict';var _=require(_0x3084('0x0'));var Redis=require(_0x3084('0x1'));var qs=require(_0x3084('0x2'));var logger=require('../../config/logger')(_0x3084('0x3'));var config=require(_0x3084('0x4'));var db=require(_0x3084('0x5'))['db'];config[_0x3084('0x6')]=_['defaults'](config['redis'],{'host':_0x3084('0x7'),'port':0x18eb});var socket=require(_0x3084('0x8'))(new Redis(config[_0x3084('0x6')]));require(_0x3084('0x9'))[_0x3084('0xa')](socket);function respondWithResult(_0x5ebc9b,_0x59af42){_0x59af42=_0x59af42||0xc8;return function(_0x558b54){if(_0x558b54){return _0x5ebc9b[_0x3084('0xb')](_0x59af42)[_0x3084('0xc')](_0x558b54);}};}function respondWithFilteredResult(_0x2e70dc,_0x27f79a){return function(_0xeccab3){if(_0xeccab3){var _0x3f08d7=typeof _0x27f79a[_0x3084('0xd')]==='undefined'&&typeof _0x27f79a[_0x3084('0xe')]==='undefined';var _0x26caec=_0xeccab3['count'];var _0x56f4d2=_0x3f08d7?0x0:_0x27f79a[_0x3084('0xd')];var _0x3df02d=_0x3f08d7?_0xeccab3[_0x3084('0xf')]:_0x27f79a[_0x3084('0xd')]+_0x27f79a[_0x3084('0xe')];var _0x5a5806;if(_0x3df02d>=_0x26caec){_0x3df02d=_0x26caec;_0x5a5806=0xc8;}else{_0x5a5806=0xce;}_0x2e70dc[_0x3084('0xb')](_0x5a5806);return _0x2e70dc[_0x3084('0x10')](_0x3084('0x11'),_0x56f4d2+'-'+_0x3df02d+'/'+_0x26caec)[_0x3084('0xc')](_0xeccab3);}return null;};}function saveUpdates(_0x147d81){return function(_0x4f125b){if(_0x4f125b){return _0x4f125b[_0x3084('0x12')](_0x147d81)['then'](function(_0xaf7fac){return _0xaf7fac;});}return null;};}function removeEntity(_0x40785a){return function(_0x183e92){if(_0x183e92){return _0x183e92[_0x3084('0x13')]()[_0x3084('0x14')](function(){var _0x37b6da=_0x183e92['get']({'plain':!![]});var _0x241af9=_0x3084('0x15');return db[_0x3084('0x16')][_0x3084('0x13')]({'where':{'type':_0x241af9,'resourceId':_0x37b6da['id']}})[_0x3084('0x14')](function(){return _0x183e92;});})[_0x3084('0x14')](function(){var _0x40ca6a=new Redis(config[_0x3084('0x6')]);_0x40ca6a[_0x3084('0x17')](_0x3084('0x18'),JSON['stringify']({'id':_0x183e92['id'],'deleted':!![]}));})[_0x3084('0x14')](function(){_0x40785a[_0x3084('0xb')](0xcc)[_0x3084('0x19')]();});}};}function handleEntityNotFound(_0x2c0330){return function(_0x46caf8){if(!_0x46caf8){_0x2c0330[_0x3084('0x1a')](0x194);}return _0x46caf8;};}function handleError(_0x220d26,_0x5b65c4){_0x5b65c4=_0x5b65c4||0x1f4;return function(_0x511986){logger[_0x3084('0x1b')](_0x511986[_0x3084('0x1c')]);if(_0x511986[_0x3084('0x1d')]){delete _0x511986[_0x3084('0x1d')];}_0x220d26['status'](_0x5b65c4)['send'](_0x511986);};}exports['index']=function(_0x5a5b53,_0x547d34){var _0x1410dd={},_0x29141a={},_0x4c50b6={'count':0x0,'rows':[]};var _0x913acf=_[_0x3084('0x1e')](db[_0x3084('0x1f')]['rawAttributes'],function(_0x284393){return{'name':_0x284393[_0x3084('0x20')],'type':_0x284393[_0x3084('0x21')][_0x3084('0x22')]};});_0x29141a[_0x3084('0x23')]=_[_0x3084('0x1e')](_0x913acf,'name');_0x29141a[_0x3084('0x24')]=_[_0x3084('0x25')](_0x5a5b53[_0x3084('0x24')]);_0x29141a[_0x3084('0x26')]=_[_0x3084('0x27')](_0x29141a[_0x3084('0x23')],_0x29141a['query']);_0x1410dd[_0x3084('0x28')]=_['intersection'](_0x29141a[_0x3084('0x23')],qs[_0x3084('0x29')](_0x5a5b53['query']['fields']));_0x1410dd['attributes']=_0x1410dd[_0x3084('0x28')][_0x3084('0x2a')]?_0x1410dd[_0x3084('0x28')]:_0x29141a[_0x3084('0x23')];if(!_0x5a5b53[_0x3084('0x24')]['hasOwnProperty'](_0x3084('0x2b'))){_0x1410dd['limit']=qs[_0x3084('0xe')](_0x5a5b53[_0x3084('0x24')][_0x3084('0xe')]);_0x1410dd['offset']=qs[_0x3084('0xd')](_0x5a5b53[_0x3084('0x24')][_0x3084('0xd')]);}_0x1410dd['order']=qs['sort'](_0x5a5b53[_0x3084('0x24')][_0x3084('0x2c')]);_0x1410dd[_0x3084('0x2d')]=qs['filters'](_[_0x3084('0x2e')](_0x5a5b53[_0x3084('0x24')],_0x29141a[_0x3084('0x26')]),_0x913acf);if(_0x5a5b53['query'][_0x3084('0x2f')]){_0x1410dd['where']=_['merge'](_0x1410dd['where'],{'$or':_[_0x3084('0x1e')](_0x913acf,function(_0x46e4b6){if(_0x46e4b6[_0x3084('0x21')]!=='VIRTUAL'){var _0x26ddd2={};_0x26ddd2[_0x46e4b6[_0x3084('0x1d')]]={'$like':'%'+_0x5a5b53[_0x3084('0x24')][_0x3084('0x2f')]+'%'};return _0x26ddd2;}})});}_0x1410dd=_[_0x3084('0x30')]({},_0x1410dd,_0x5a5b53['options']);var _0x2fdc4a={'where':_0x1410dd[_0x3084('0x2d')]};return db['SquareProject'][_0x3084('0xf')](_0x2fdc4a)[_0x3084('0x14')](function(_0x3dfbca){_0x4c50b6['count']=_0x3dfbca;if(_0x5a5b53[_0x3084('0x24')][_0x3084('0x31')]){_0x1410dd[_0x3084('0x32')]=[{'all':!![]}];}return db[_0x3084('0x1f')][_0x3084('0x33')](_0x1410dd);})['then'](function(_0x2e6a73){_0x4c50b6[_0x3084('0x34')]=_0x2e6a73;return _0x4c50b6;})['then'](respondWithFilteredResult(_0x547d34,_0x1410dd))[_0x3084('0x35')](handleError(_0x547d34,null));};exports[_0x3084('0x36')]=function(_0x757a37,_0x3f2638){var _0x261508={'raw':![],'where':{'id':_0x757a37[_0x3084('0x37')]['id']}},_0x5ea58e={};_0x5ea58e['model']=_[_0x3084('0x25')](db[_0x3084('0x1f')][_0x3084('0x38')]);_0x5ea58e[_0x3084('0x24')]=_['keys'](_0x757a37[_0x3084('0x24')]);_0x5ea58e[_0x3084('0x26')]=_[_0x3084('0x27')](_0x5ea58e['model'],_0x5ea58e[_0x3084('0x24')]);_0x261508[_0x3084('0x28')]=_['intersection'](_0x5ea58e[_0x3084('0x23')],qs[_0x3084('0x29')](_0x757a37[_0x3084('0x24')][_0x3084('0x29')]));_0x261508['attributes']=_0x261508[_0x3084('0x28')]['length']?_0x261508[_0x3084('0x28')]:_0x5ea58e[_0x3084('0x23')];if(_0x757a37['query'][_0x3084('0x31')]){_0x261508[_0x3084('0x32')]=[{'all':!![]}];}_0x261508=_['merge']({},_0x261508,_0x757a37[_0x3084('0x39')]);return db['SquareProject'][_0x3084('0x3a')](_0x261508)['then'](handleEntityNotFound(_0x3f2638,null))[_0x3084('0x14')](respondWithResult(_0x3f2638,null))[_0x3084('0x35')](handleError(_0x3f2638,null));};exports[_0x3084('0x3b')]=function(_0x2c348c,_0x3ab9b2){return db[_0x3084('0x1f')][_0x3084('0x3b')](_0x2c348c[_0x3084('0x3c')],{})[_0x3084('0x14')](function(_0x25f55a){var _0x5d4324=_0x2c348c[_0x3084('0x3d')]['get']({'plain':!![]});if(!_0x5d4324)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d4324[_0x3084('0x3e')]==='user'){var _0x8d7ef1=_0x25f55a[_0x3084('0x3f')]({'plain':!![]});var _0xc2980b='SquareProjects';return db[_0x3084('0x40')]['find']({'where':{'name':_0xc2980b,'userProfileId':_0x5d4324[_0x3084('0x41')]},'raw':!![]})[_0x3084('0x14')](function(_0x56ebed){if(_0x56ebed&&_0x56ebed[_0x3084('0x42')]===0x0){return db[_0x3084('0x16')]['create']({'name':_0x8d7ef1[_0x3084('0x1d')],'resourceId':_0x8d7ef1['id'],'type':_0x56ebed[_0x3084('0x1d')],'sectionId':_0x56ebed['id']},{})[_0x3084('0x14')](function(){return _0x25f55a;});}else{return _0x25f55a;}})[_0x3084('0x35')](function(_0x38d4be){logger[_0x3084('0x1b')](_0x3084('0x43'),_0x38d4be);throw _0x38d4be;});}return _0x25f55a;})['then'](respondWithResult(_0x3ab9b2,0xc9))[_0x3084('0x35')](handleError(_0x3ab9b2,null));};exports[_0x3084('0x12')]=function(_0x1a878b,_0x5081d0){if(_0x1a878b[_0x3084('0x3c')]['id']){delete _0x1a878b['body']['id'];}return db[_0x3084('0x1f')]['find']({'where':{'id':_0x1a878b['params']['id']}})['then'](handleEntityNotFound(_0x5081d0,null))[_0x3084('0x14')](saveUpdates(_0x1a878b[_0x3084('0x3c')],null))['then'](function(_0x284712){if(!_0x284712)return;var _0x20be60=_0x284712[_0x3084('0x3f')]({'plain':!![]});return _0x20be60;})[_0x3084('0x14')](function(_0x307283){var _0x4d267a=new Redis(config[_0x3084('0x6')]);_0x4d267a[_0x3084('0x17')](_0x3084('0x18'),JSON[_0x3084('0x44')](_[_0x3084('0x2e')](_0x307283,['id',_0x3084('0x1d'),'production'])));return _0x307283;})[_0x3084('0x14')](respondWithResult(_0x5081d0,null))[_0x3084('0x35')](handleError(_0x5081d0,null));};exports[_0x3084('0x13')]=function(_0x49722a,_0x4d0a05){return db[_0x3084('0x1f')][_0x3084('0x3a')]({'where':{'id':_0x49722a['params']['id']}})['then'](handleEntityNotFound(_0x4d0a05,null))['then'](removeEntity(_0x4d0a05,null))['catch'](handleError(_0x4d0a05,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 953daaf..596abaf 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 _0x5511=['events','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x144e1d,_0x409a01){var _0x15fc15=function(_0x58b87f){while(--_0x58b87f){_0x144e1d['push'](_0x144e1d['shift']());}};_0x15fc15(++_0x409a01);}(_0x5511,0x1ce));var _0x1551=function(_0x44df7c,_0x4eea04){_0x44df7c=_0x44df7c-0x0;var _0x96d079=_0x5511[_0x44df7c];return _0x96d079;};'use strict';var EventEmitter=require(_0x1551('0x0'));var SquareProject=require('../../mysqldb')['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1551('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1551('0x2'),'afterDestroy':'remove'};function emitEvent(_0xb48652){return function(_0x1c94ca,_0x28d623,_0x498ce0){SquareProjectEvents['emit'](_0xb48652+':'+_0x1c94ca['id'],_0x1c94ca);SquareProjectEvents[_0x1551('0x3')](_0xb48652,_0x1c94ca);_0x498ce0(null);};}for(var e in events){if(events[_0x1551('0x4')](e)){var event=events[e];SquareProject[_0x1551('0x5')](e,emitEvent(event));}}module[_0x1551('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0xe94c=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x5c969d,_0x4a4a15){var _0x567960=function(_0x2722ab){while(--_0x2722ab){_0x5c969d['push'](_0x5c969d['shift']());}};_0x567960(++_0x4a4a15);}(_0xe94c,0x1bd));var _0xce94=function(_0x326af2,_0x563ac8){_0x326af2=_0x326af2-0x0;var _0x275944=_0xe94c[_0x326af2];return _0x275944;};'use strict';var EventEmitter=require(_0xce94('0x0'));var SquareProject=require(_0xce94('0x1'))['db'][_0xce94('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xce94('0x3')](0x0);var events={'afterCreate':_0xce94('0x4'),'afterUpdate':_0xce94('0x5'),'afterDestroy':_0xce94('0x6')};function emitEvent(_0x5f454a){return function(_0x1d7bd0,_0x2520dd,_0x5d9d31){SquareProjectEvents[_0xce94('0x7')](_0x5f454a+':'+_0x1d7bd0['id'],_0x1d7bd0);SquareProjectEvents[_0xce94('0x7')](_0x5f454a,_0x1d7bd0);_0x5d9d31(null);};}for(var e in events){if(events[_0xce94('0x8')](e)){var event=events[e];SquareProject[_0xce94('0x9')](e,emitEvent(event));}}module[_0xce94('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index bb92662..fd08643 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 _0xd19b=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','exports','define','SquareProject','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','format'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0xd19b,0x90));var _0xbd19=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0xd19b[_0x10b48a];return _0x2c4533;};'use strict';var _=require(_0xbd19('0x0'));var util=require(_0xbd19('0x1'));var logger=require(_0xbd19('0x2'))(_0xbd19('0x3'));var moment=require(_0xbd19('0x4'));var BPromise=require(_0xbd19('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd19('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0xbd19('0x7')]=function(_0x5e8627,_0x58c5e9){return _0x5e8627[_0xbd19('0x8')](_0xbd19('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54171f,_0x16900d,_0x4bd9e5){if(_0x54171f[_0xbd19('0xa')](_0xbd19('0xb'))){_0x54171f[_0xbd19('0xc')]=moment()['format'](_0xbd19('0xd'));}if(_0x54171f[_0xbd19('0xa')]('production')){_0x54171f[_0xbd19('0xe')]=moment()[_0xbd19('0xf')](_0xbd19('0xd'));}_0x4bd9e5(null,_0x54171f);}}});}; \ No newline at end of file +var _0x0a64=['square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x28808b,_0x55d2a9){var _0x259636=function(_0x5e962c){while(--_0x5e962c){_0x28808b['push'](_0x28808b['shift']());}};_0x259636(++_0x55d2a9);}(_0x0a64,0x1c8));var _0x40a6=function(_0x5b791d,_0x49cc81){_0x5b791d=_0x5b791d-0x0;var _0xdd1c36=_0x0a64[_0x5b791d];return _0xdd1c36;};'use strict';var _=require(_0x40a6('0x0'));var util=require(_0x40a6('0x1'));var logger=require(_0x40a6('0x2'))('api');var moment=require('moment');var BPromise=require(_0x40a6('0x3'));var rp=require(_0x40a6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x40a6('0x5'));var config=require(_0x40a6('0x6'));var attributes=require('./squareProject.attributes');module[_0x40a6('0x7')]=function(_0x7a94b2,_0x17b3bb){return _0x7a94b2['define']('SquareProject',attributes,{'tableName':_0x40a6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45850a,_0x155793,_0x1f75f8){if(_0x45850a[_0x40a6('0x9')](_0x40a6('0xa'))){_0x45850a[_0x40a6('0xb')]=moment()[_0x40a6('0xc')](_0x40a6('0xd'));}if(_0x45850a[_0x40a6('0x9')](_0x40a6('0xe'))){_0x45850a[_0x40a6('0xf')]=moment()['format'](_0x40a6('0xd'));}_0x1f75f8(null,_0x45850a);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b9c6e0e..6817648 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 _0x299c=['../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','attributes','limit','include','model','map','then','info','debug','stringify','error','ShowSquareProject','find','where','catch','message','lodash','ioredis','../../mysqldb'];(function(_0x4e0b8c,_0x443f31){var _0x633ecc=function(_0x1f1f36){while(--_0x1f1f36){_0x4e0b8c['push'](_0x4e0b8c['shift']());}};_0x633ecc(++_0x443f31);}(_0x299c,0xb1));var _0xc299=function(_0x39be73,_0x31a022){_0x39be73=_0x39be73-0x0;var _0x14b572=_0x299c[_0x39be73];return _0x14b572;};'use strict';var _=require(_0xc299('0x0'));var Redis=require(_0xc299('0x1'));var db=require(_0xc299('0x2'))['db'];var logger=require(_0xc299('0x3'))('rpc');var config=require(_0xc299('0x4'));config[_0xc299('0x5')]=_[_0xc299('0x6')](config[_0xc299('0x5')],{'host':_0xc299('0x7'),'port':0x18eb});var socket=require(_0xc299('0x8'))(new Redis(config[_0xc299('0x5')]));require('./squareProject.socket')[_0xc299('0x9')](socket);exports[_0xc299('0xa')]=function(_0x306577){var _0x1c5c9c=this;return new Promise(function(_0x39824e,_0x18f2b6){return db[_0xc299('0xb')][_0xc299('0xc')]({'raw':_0x306577['options']?_0x306577[_0xc299('0xd')][_0xc299('0xe')]===undefined?!![]:![]:!![],'where':_0x306577[_0xc299('0xd')]?_0x306577[_0xc299('0xd')]['where']||null:null,'attributes':_0x306577[_0xc299('0xd')]?_0x306577['options'][_0xc299('0xf')]||null:null,'limit':_0x306577[_0xc299('0xd')]?_0x306577[_0xc299('0xd')][_0xc299('0x10')]||null:null,'include':_0x306577[_0xc299('0xd')]?_0x306577[_0xc299('0xd')]['include']?_['map'](_0x306577[_0xc299('0xd')][_0xc299('0x11')],function(_0x59a2ce){return{'model':db[_0x59a2ce[_0xc299('0x12')]],'as':_0x59a2ce['as'],'attributes':_0x59a2ce['attributes'],'include':_0x59a2ce['include']?_[_0xc299('0x13')](_0x59a2ce[_0xc299('0x11')],function(_0x33cc1e){return{'model':db[_0x33cc1e['model']],'as':_0x33cc1e['as'],'attributes':_0x33cc1e[_0xc299('0xf')],'include':_0x33cc1e['include']?_['map'](_0x33cc1e[_0xc299('0x11')],function(_0x12dc08){return{'model':db[_0x12dc08[_0xc299('0x12')]],'as':_0x12dc08['as'],'attributes':_0x12dc08[_0xc299('0xf')]};}):[]};}):[]};}):[]:[]})[_0xc299('0x14')](function(_0x323820){logger[_0xc299('0x15')](_0xc299('0xa'),_0x306577);logger[_0xc299('0x16')](_0xc299('0xa'),_0x306577,JSON[_0xc299('0x17')](_0x323820));_0x39824e(_0x323820);})['catch'](function(_0x26a80c){logger['error'](_0xc299('0xa'),_0x26a80c['message'],_0x306577);_0x18f2b6(_0x1c5c9c[_0xc299('0x18')](0x1f4,_0x26a80c['message']));});});};exports[_0xc299('0x19')]=function(_0x432588){var _0x494fa5=this;return new Promise(function(_0x3896d8,_0x4733da){return db['SquareProject'][_0xc299('0x1a')]({'raw':_0x432588['options']?_0x432588['options'][_0xc299('0xe')]===undefined?!![]:![]:!![],'where':_0x432588[_0xc299('0xd')]?_0x432588[_0xc299('0xd')][_0xc299('0x1b')]||null:null,'attributes':_0x432588['options']?_0x432588[_0xc299('0xd')]['attributes']||null:null,'include':_0x432588[_0xc299('0xd')]?_0x432588[_0xc299('0xd')][_0xc299('0x11')]?_[_0xc299('0x13')](_0x432588['options']['include'],function(_0x16091c){return{'model':db[_0x16091c['model']],'as':_0x16091c['as'],'attributes':_0x16091c[_0xc299('0xf')],'include':_0x16091c['include']?_[_0xc299('0x13')](_0x16091c[_0xc299('0x11')],function(_0x2f84b8){return{'model':db[_0x2f84b8[_0xc299('0x12')]],'as':_0x2f84b8['as'],'attributes':_0x2f84b8[_0xc299('0xf')],'include':_0x2f84b8[_0xc299('0x11')]?_['map'](_0x2f84b8[_0xc299('0x11')],function(_0x1d5f3b){return{'model':db[_0x1d5f3b[_0xc299('0x12')]],'as':_0x1d5f3b['as'],'attributes':_0x1d5f3b[_0xc299('0xf')]};}):[]};}):[]};}):[]:[]})[_0xc299('0x14')](function(_0x1514d4){logger['info'](_0xc299('0x19'),_0x432588);logger[_0xc299('0x16')](_0xc299('0x19'),_0x432588,JSON[_0xc299('0x17')](_0x1514d4));_0x3896d8(_0x1514d4);})[_0xc299('0x1c')](function(_0x4b116b){logger[_0xc299('0x18')](_0xc299('0x19'),_0x4b116b['message'],_0x432588);_0x4733da(_0x494fa5[_0xc299('0x18')](0x1f4,_0x4b116b[_0xc299('0x1d')]));});});}; \ No newline at end of file +var _0xcbb6=['redis','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','map','include','model','then','catch','message','error','info','ShowSquareProject','debug','stringify','../../config/logger','rpc','../../config/environment'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xcbb6,0x19d));var _0x6cbb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xcbb6[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0x6cbb('0x0'))(_0x6cbb('0x1'));var config=require(_0x6cbb('0x2'));config[_0x6cbb('0x3')]=_['defaults'](config['redis'],{'host':_0x6cbb('0x4'),'port':0x18eb});var socket=require(_0x6cbb('0x5'))(new Redis(config[_0x6cbb('0x3')]));require('./squareProject.socket')[_0x6cbb('0x6')](socket);exports[_0x6cbb('0x7')]=function(_0xc1b6cd){var _0x5a4112=this;return new Promise(function(_0x26e68b,_0x55c7a3){return db[_0x6cbb('0x8')][_0x6cbb('0x9')]({'raw':_0xc1b6cd[_0x6cbb('0xa')]?_0xc1b6cd['options'][_0x6cbb('0xb')]===undefined?!![]:![]:!![],'where':_0xc1b6cd[_0x6cbb('0xa')]?_0xc1b6cd['options'][_0x6cbb('0xc')]||null:null,'attributes':_0xc1b6cd[_0x6cbb('0xa')]?_0xc1b6cd[_0x6cbb('0xa')][_0x6cbb('0xd')]||null:null,'limit':_0xc1b6cd[_0x6cbb('0xa')]?_0xc1b6cd[_0x6cbb('0xa')][_0x6cbb('0xe')]||null:null,'include':_0xc1b6cd['options']?_0xc1b6cd[_0x6cbb('0xa')]['include']?_[_0x6cbb('0xf')](_0xc1b6cd[_0x6cbb('0xa')][_0x6cbb('0x10')],function(_0x224495){return{'model':db[_0x224495['model']],'as':_0x224495['as'],'attributes':_0x224495[_0x6cbb('0xd')],'include':_0x224495['include']?_['map'](_0x224495[_0x6cbb('0x10')],function(_0x5e301c){return{'model':db[_0x5e301c[_0x6cbb('0x11')]],'as':_0x5e301c['as'],'attributes':_0x5e301c['attributes'],'include':_0x5e301c[_0x6cbb('0x10')]?_['map'](_0x5e301c[_0x6cbb('0x10')],function(_0xda0071){return{'model':db[_0xda0071['model']],'as':_0xda0071['as'],'attributes':_0xda0071[_0x6cbb('0xd')]};}):[]};}):[]};}):[]:[]})[_0x6cbb('0x12')](function(_0x136759){logger['info']('GetSquareProjects',_0xc1b6cd);logger['debug'](_0x6cbb('0x7'),_0xc1b6cd,JSON['stringify'](_0x136759));_0x26e68b(_0x136759);})[_0x6cbb('0x13')](function(_0x40c77f){logger['error'](_0x6cbb('0x7'),_0x40c77f[_0x6cbb('0x14')],_0xc1b6cd);_0x55c7a3(_0x5a4112[_0x6cbb('0x15')](0x1f4,_0x40c77f[_0x6cbb('0x14')]));});});};exports['ShowSquareProject']=function(_0x5c8845){var _0x4eae85=this;return new Promise(function(_0x1a0d73,_0x47b1dd){return db['SquareProject']['find']({'raw':_0x5c8845['options']?_0x5c8845[_0x6cbb('0xa')][_0x6cbb('0xb')]===undefined?!![]:![]:!![],'where':_0x5c8845[_0x6cbb('0xa')]?_0x5c8845['options'][_0x6cbb('0xc')]||null:null,'attributes':_0x5c8845[_0x6cbb('0xa')]?_0x5c8845['options'][_0x6cbb('0xd')]||null:null,'include':_0x5c8845[_0x6cbb('0xa')]?_0x5c8845['options'][_0x6cbb('0x10')]?_['map'](_0x5c8845[_0x6cbb('0xa')][_0x6cbb('0x10')],function(_0x2ffd46){return{'model':db[_0x2ffd46[_0x6cbb('0x11')]],'as':_0x2ffd46['as'],'attributes':_0x2ffd46[_0x6cbb('0xd')],'include':_0x2ffd46[_0x6cbb('0x10')]?_[_0x6cbb('0xf')](_0x2ffd46[_0x6cbb('0x10')],function(_0xa65c9d){return{'model':db[_0xa65c9d[_0x6cbb('0x11')]],'as':_0xa65c9d['as'],'attributes':_0xa65c9d[_0x6cbb('0xd')],'include':_0xa65c9d[_0x6cbb('0x10')]?_[_0x6cbb('0xf')](_0xa65c9d[_0x6cbb('0x10')],function(_0x2424fc){return{'model':db[_0x2424fc[_0x6cbb('0x11')]],'as':_0x2424fc['as'],'attributes':_0x2424fc['attributes']};}):[]};}):[]};}):[]:[]})[_0x6cbb('0x12')](function(_0x95b974){logger[_0x6cbb('0x16')](_0x6cbb('0x17'),_0x5c8845);logger[_0x6cbb('0x18')](_0x6cbb('0x17'),_0x5c8845,JSON[_0x6cbb('0x19')](_0x95b974));_0x1a0d73(_0x95b974);})[_0x6cbb('0x13')](function(_0x8d15a9){logger[_0x6cbb('0x15')](_0x6cbb('0x17'),_0x8d15a9[_0x6cbb('0x14')],_0x5c8845);_0x47b1dd(_0x4eae85[_0x6cbb('0x15')](0x1f4,_0x8d15a9['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 82e357a..7cefb4c 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 _0x4b8c=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove'];(function(_0x5a0e5a,_0x5dbdf0){var _0x52c110=function(_0x4645da){while(--_0x4645da){_0x5a0e5a['push'](_0x5a0e5a['shift']());}};_0x52c110(++_0x5dbdf0);}(_0x4b8c,0x10d));var _0xc4b8=function(_0x5d4077,_0x3f4c6b){_0x5d4077=_0x5d4077-0x0;var _0x1eb14b=_0x4b8c[_0x5d4077];return _0x1eb14b;};'use strict';var SquareProjectEvents=require(_0xc4b8('0x0'));var events=[_0xc4b8('0x1'),_0xc4b8('0x2'),'update'];function createListener(_0xe8de2b,_0x364473){return function(_0x1328de){_0x364473[_0xc4b8('0x3')](_0xe8de2b,_0x1328de);};}function removeListener(_0x1dd239,_0x46816c){return function(){SquareProjectEvents[_0xc4b8('0x4')](_0x1dd239,_0x46816c);};}exports[_0xc4b8('0x5')]=function(_0x1040ec){for(var _0x575b81=0x0,_0x4b189b=events[_0xc4b8('0x6')];_0x575b81<_0x4b189b;_0x575b81++){var _0x233243=events[_0x575b81];var _0x5c2791=createListener(_0xc4b8('0x7')+_0x233243,_0x1040ec);SquareProjectEvents['on'](_0x233243,_0x5c2791);}}; \ No newline at end of file +var _0x4dee=['update','emit','removeListener','register','squareProject:','./squareProject.events','save','remove'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0x4dee,0xfd));var _0xe4de=function(_0x10dd63,_0x6c3075){_0x10dd63=_0x10dd63-0x0;var _0x130b34=_0x4dee[_0x10dd63];return _0x130b34;};'use strict';var SquareProjectEvents=require(_0xe4de('0x0'));var events=[_0xe4de('0x1'),_0xe4de('0x2'),_0xe4de('0x3')];function createListener(_0x1b8fd3,_0x3e370f){return function(_0x5909fd){_0x3e370f[_0xe4de('0x4')](_0x1b8fd3,_0x5909fd);};}function removeListener(_0x152a0f,_0x30f72e){return function(){SquareProjectEvents[_0xe4de('0x5')](_0x152a0f,_0x30f72e);};}exports[_0xe4de('0x6')]=function(_0x9e4988){for(var _0x26dc4f=0x0,_0x1d5690=events['length'];_0x26dc4f<_0x1d5690;_0x26dc4f++){var _0x5678f6=events[_0x26dc4f];var _0x529f36=createListener(_0xe4de('0x7')+_0x5678f6,_0x9e4988);SquareProjectEvents['on'](_0x5678f6,_0x529f36);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 4417142..567a735 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x1305db,_0x1222c9){var _0x4b71d3=function(_0x3b68cb){while(--_0x3b68cb){_0x1305db['push'](_0x1305db['shift']());}};_0x4b71d3(++_0x1222c9);}(_0x5fab,0x177));var _0xb5fa=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x5fab[_0x5f309e];return _0x487b5e;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var fs_extra=require(_0xb5fa('0x5'));var auth=require(_0xb5fa('0x6'));var interaction=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var controller=require(_0xb5fa('0x9'));router[_0xb5fa('0xa')]('/',auth[_0xb5fa('0xb')](),controller['index']);router['get'](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xd')]);router['get'](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);router[_0xb5fa('0x11')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xc'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc4aa=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','put','delete'];(function(_0x5978d1,_0x4eb993){var _0x357d63=function(_0x8263b8){while(--_0x8263b8){_0x5978d1['push'](_0x5978d1['shift']());}};_0x357d63(++_0x4eb993);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['show']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/:id',auth[_0xac4a('0x9')](),controller['update']);router[_0xac4a('0x10')]('/:id',auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);module[_0xac4a('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 3a7f6af..4a50419 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 _0x814b=['substring','lastIndexOf','sequelize','exports','STRING','VIRTUAL','getDataValue','savePath'];(function(_0x1d041e,_0x19c235){var _0xa30ea9=function(_0x5d7714){while(--_0x5d7714){_0x1d041e['push'](_0x1d041e['shift']());}};_0xa30ea9(++_0x19c235);}(_0x814b,0x1a2));var _0xb814=function(_0xc84e3,_0xd631b){_0xc84e3=_0xc84e3-0x0;var _0x437a90=_0x814b[_0xc84e3];return _0x437a90;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'uniqueid':{'type':Sequelize[_0xb814('0x2')]},'callerid':{'type':Sequelize[_0xb814('0x2')]},'calleridname':{'type':Sequelize[_0xb814('0x2')]},'context':{'type':Sequelize[_0xb814('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb814('0x2')]},'accountcode':{'type':Sequelize[_0xb814('0x2')]},'dnid':{'type':Sequelize[_0xb814('0x2')]},'projectName':{'type':Sequelize[_0xb814('0x2')]},'saveName':{'type':Sequelize[_0xb814('0x2')]},'filename':{'type':Sequelize[_0xb814('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb814('0x3')],'get':function(){var _0x2e6272='';var _0x5c8539=this[_0xb814('0x4')](_0xb814('0x5'));if(_0x5c8539){_0x2e6272=_0x5c8539[_0xb814('0x6')](_0x5c8539[_0xb814('0x7')]('.'));}return _0x2e6272;}}}; \ No newline at end of file +var _0x7217=['lastIndexOf','sequelize','STRING','VIRTUAL','getDataValue','savePath','substring'];(function(_0x4efe20,_0x506084){var _0x264693=function(_0xb3b594){while(--_0xb3b594){_0x4efe20['push'](_0x4efe20['shift']());}};_0x264693(++_0x506084);}(_0x7217,0x19e));var _0x7721=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7217[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')]},'callerid':{'type':Sequelize[_0x7721('0x1')]},'calleridname':{'type':Sequelize[_0x7721('0x1')]},'context':{'type':Sequelize[_0x7721('0x1')]},'extension':{'type':Sequelize[_0x7721('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x7721('0x1')]},'projectName':{'type':Sequelize[_0x7721('0x1')]},'saveName':{'type':Sequelize[_0x7721('0x1')]},'filename':{'type':Sequelize[_0x7721('0x1')]},'savePath':{'type':Sequelize[_0x7721('0x1')]},'format':{'type':Sequelize[_0x7721('0x2')],'get':function(){var _0x18ab6b='';var _0x21f680=this[_0x7721('0x3')](_0x7721('0x4'));if(_0x21f680){_0x18ab6b=_0x21f680[_0x7721('0x5')](_0x21f680[_0x7721('0x6')]('.'));}return _0x18ab6b;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 71285af..b95e753 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 _0x28a3=['VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','create','body','find','download','../../components/encryptor','uniqueid','filename','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','extname','message','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','end','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x4b19b3,_0x59b162){var _0x2780e7=function(_0x5edd11){while(--_0x5edd11){_0x4b19b3['push'](_0x4b19b3['shift']());}};_0x2780e7(++_0x59b162);}(_0x28a3,0x14e));var _0x328a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x28a3[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x328a('0x0'));var zipdir=require(_0x328a('0x1'));var jsonpatch=require(_0x328a('0x2'));var rp=require(_0x328a('0x3'));var moment=require(_0x328a('0x4'));var BPromise=require(_0x328a('0x5'));var Mustache=require(_0x328a('0x6'));var util=require(_0x328a('0x7'));var path=require(_0x328a('0x8'));var sox=require(_0x328a('0x9'));var csv=require('to-csv');var ejs=require(_0x328a('0xa'));var fs=require('fs');var fs_extra=require(_0x328a('0xb'));var _=require(_0x328a('0xc'));var squel=require(_0x328a('0xd'));var crypto=require(_0x328a('0xe'));var jsforce=require(_0x328a('0xf'));var deskjs=require(_0x328a('0x10'));var toCsv=require(_0x328a('0x11'));var querystring=require(_0x328a('0x12'));var Papa=require(_0x328a('0x13'));var Redis=require(_0x328a('0x14'));var authService=require(_0x328a('0x15'));var qs=require(_0x328a('0x16'));var as=require(_0x328a('0x17'));var hardwareService=require(_0x328a('0x18'));var logger=require(_0x328a('0x19'))(_0x328a('0x1a'));var utils=require(_0x328a('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0x328a('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cb63d,_0x373297){_0x373297=_0x373297||0xcc;return function(_0x5bc5d7){if(_0x5bc5d7){return _0x4cb63d[_0x328a('0x1d')](_0x373297);}return _0x4cb63d[_0x328a('0x1e')](_0x373297)['end']();};}function respondWithResult(_0xfadb12,_0x2cf4e5){_0x2cf4e5=_0x2cf4e5||0xc8;return function(_0x162242){if(_0x162242){return _0xfadb12[_0x328a('0x1e')](_0x2cf4e5)[_0x328a('0x1f')](_0x162242);}};}function respondWithFilteredResult(_0x3125d7,_0x122cbd){return function(_0x6548ef){if(_0x6548ef){var _0x3fc381=typeof _0x122cbd[_0x328a('0x20')]===_0x328a('0x21')&&typeof _0x122cbd[_0x328a('0x22')]==='undefined';var _0x206eac=_0x6548ef[_0x328a('0x23')];var _0x54fe52=_0x3fc381?0x0:_0x122cbd[_0x328a('0x20')];var _0x1bdf29=_0x3fc381?_0x6548ef['count']:_0x122cbd['offset']+_0x122cbd[_0x328a('0x22')];var _0x2416b3;if(_0x1bdf29>=_0x206eac){_0x1bdf29=_0x206eac;_0x2416b3=0xc8;}else{_0x2416b3=0xce;}_0x3125d7[_0x328a('0x1e')](_0x2416b3);return _0x3125d7['set']('Content-Range',_0x54fe52+'-'+_0x1bdf29+'/'+_0x206eac)['json'](_0x6548ef);}return null;};}function patchUpdates(_0x2d5547){return function(_0x3ffff5){try{jsonpatch[_0x328a('0x24')](_0x3ffff5,_0x2d5547,!![]);}catch(_0xff6410){return BPromise['reject'](_0xff6410);}return _0x3ffff5[_0x328a('0x25')]();};}function saveUpdates(_0x5413bb,_0x51c162){return function(_0x2cb846){if(_0x2cb846){return _0x2cb846[_0x328a('0x26')](_0x5413bb)[_0x328a('0x27')](function(_0x334d58){return _0x334d58;});}return null;};}function removeEntity(_0x5b165f,_0x3ffecf){return function(_0x4744fa){if(_0x4744fa){return _0x4744fa[_0x328a('0x28')]()['then'](function(){_0x5b165f['status'](0xcc)[_0x328a('0x29')]();});}};}function handleEntityNotFound(_0xc2be7f,_0x221754){return function(_0x1e0b75){if(!_0x1e0b75){_0xc2be7f[_0x328a('0x1d')](0x194);}return _0x1e0b75;};}function handleError(_0x2d59b1,_0x10f8cd){_0x10f8cd=_0x10f8cd||0x1f4;return function(_0x551d36){logger['error'](_0x551d36[_0x328a('0x2a')]);if(_0x551d36['name']){delete _0x551d36[_0x328a('0x2b')];}_0x2d59b1['status'](_0x10f8cd)[_0x328a('0x2c')](_0x551d36);};}exports[_0x328a('0x2d')]=function(_0x366e55,_0x58c5b5){var _0x536eac={},_0x28d545={},_0x1bb9fe={'count':0x0,'rows':[]};var _0xfd3934=_[_0x328a('0x2e')](db[_0x328a('0x2f')][_0x328a('0x30')],function(_0x36dc5d){return{'name':_0x36dc5d[_0x328a('0x31')],'type':_0x36dc5d[_0x328a('0x32')]['key']};});_0x28d545[_0x328a('0x33')]=_[_0x328a('0x2e')](_0xfd3934,_0x328a('0x2b'));_0x28d545[_0x328a('0x34')]=_[_0x328a('0x35')](_0x366e55[_0x328a('0x34')]);_0x28d545['filters']=_['intersection'](_0x28d545[_0x328a('0x33')],_0x28d545[_0x328a('0x34')]);_0x536eac[_0x328a('0x36')]=_[_0x328a('0x37')](_0x28d545['model'],qs[_0x328a('0x38')](_0x366e55[_0x328a('0x34')]['fields']));_0x536eac['attributes']=_0x536eac[_0x328a('0x36')][_0x328a('0x39')]?_0x536eac[_0x328a('0x36')]:_0x28d545[_0x328a('0x33')];if(!_0x366e55['query']['hasOwnProperty'](_0x328a('0x3a'))){_0x536eac['limit']=qs['limit'](_0x366e55[_0x328a('0x34')][_0x328a('0x22')]);_0x536eac['offset']=qs[_0x328a('0x20')](_0x366e55[_0x328a('0x34')][_0x328a('0x20')]);}_0x536eac[_0x328a('0x3b')]=qs[_0x328a('0x3c')](_0x366e55[_0x328a('0x34')][_0x328a('0x3c')]);_0x536eac[_0x328a('0x3d')]=qs[_0x328a('0x3e')](_[_0x328a('0x3f')](_0x366e55[_0x328a('0x34')],_0x28d545[_0x328a('0x3e')]),_0xfd3934);if(_0x366e55[_0x328a('0x34')][_0x328a('0x40')]){_0x536eac[_0x328a('0x3d')]=_[_0x328a('0x41')](_0x536eac['where'],{'$or':_['map'](_0xfd3934,function(_0x46bd40){if(_0x46bd40['type']!==_0x328a('0x42')){var _0x56ce08={};_0x56ce08[_0x46bd40['name']]={'$like':'%'+_0x366e55[_0x328a('0x34')][_0x328a('0x40')]+'%'};return _0x56ce08;}})});}_0x536eac=_[_0x328a('0x41')]({},_0x536eac,_0x366e55['options']);var _0x2ab266={'where':_0x536eac['where']};return db[_0x328a('0x2f')][_0x328a('0x23')](_0x2ab266)['then'](function(_0xdc4d5d){_0x1bb9fe[_0x328a('0x23')]=_0xdc4d5d;if(_0x366e55[_0x328a('0x34')]['includeAll']){_0x536eac[_0x328a('0x43')]=[{'all':!![]}];}return db[_0x328a('0x2f')][_0x328a('0x44')](_0x536eac);})[_0x328a('0x27')](function(_0x5e17b7){_0x1bb9fe[_0x328a('0x45')]=_0x5e17b7;return _0x1bb9fe;})[_0x328a('0x27')](respondWithFilteredResult(_0x58c5b5,_0x536eac))[_0x328a('0x46')](handleError(_0x58c5b5,null));};exports[_0x328a('0x47')]=function(_0x514eeb,_0x21ab9f){var _0x4618c3={'raw':!![],'where':{'id':_0x514eeb[_0x328a('0x48')]['id']}},_0x49c051={};_0x49c051['model']=_['keys'](db['SquareRecording'][_0x328a('0x30')]);_0x49c051[_0x328a('0x34')]=_[_0x328a('0x35')](_0x514eeb[_0x328a('0x34')]);_0x49c051[_0x328a('0x3e')]=_['intersection'](_0x49c051['model'],_0x49c051['query']);_0x4618c3[_0x328a('0x36')]=_[_0x328a('0x37')](_0x49c051[_0x328a('0x33')],qs['fields'](_0x514eeb['query'][_0x328a('0x38')]));_0x4618c3['attributes']=_0x4618c3[_0x328a('0x36')][_0x328a('0x39')]?_0x4618c3[_0x328a('0x36')]:_0x49c051[_0x328a('0x33')];if(_0x514eeb[_0x328a('0x34')][_0x328a('0x49')]){_0x4618c3[_0x328a('0x43')]=[{'all':!![]}];}_0x4618c3=_['merge']({},_0x4618c3,_0x514eeb[_0x328a('0x4a')]);return db[_0x328a('0x2f')]['find'](_0x4618c3)[_0x328a('0x27')](handleEntityNotFound(_0x21ab9f,null))['then'](respondWithResult(_0x21ab9f,null))[_0x328a('0x46')](handleError(_0x21ab9f,null));};exports[_0x328a('0x4b')]=function(_0x1da26a,_0xf1bb9a){return db['SquareRecording']['create'](_0x1da26a[_0x328a('0x4c')],{})[_0x328a('0x27')](respondWithResult(_0xf1bb9a,0xc9))[_0x328a('0x46')](handleError(_0xf1bb9a,null));};exports[_0x328a('0x26')]=function(_0x267a00,_0x2cc0fe){if(_0x267a00[_0x328a('0x4c')]['id']){delete _0x267a00['body']['id'];}return db['SquareRecording'][_0x328a('0x4d')]({'where':{'id':_0x267a00[_0x328a('0x48')]['id']}})[_0x328a('0x27')](handleEntityNotFound(_0x2cc0fe,null))[_0x328a('0x27')](saveUpdates(_0x267a00[_0x328a('0x4c')],null))[_0x328a('0x27')](respondWithResult(_0x2cc0fe,null))['catch'](handleError(_0x2cc0fe,null));};exports[_0x328a('0x4e')]=function(_0x2e04aa,_0x4f7063,_0x53b8b7){var _0x2d91d7=require(_0x328a('0x4f'));var _0x5479d6=![];var _0x53ba2d={};if(_0x2e04aa[_0x328a('0x34')][_0x328a('0x32')]&&_0x2e04aa[_0x328a('0x34')][_0x328a('0x32')]===_0x328a('0x50')){_0x53ba2d[_0x328a('0x50')]=_0x2e04aa[_0x328a('0x48')]['id'];}else{_0x53ba2d['id']=_0x2e04aa[_0x328a('0x48')]['id'];}return db[_0x328a('0x2f')][_0x328a('0x4d')]({'where':_0x53ba2d,'attributes':['id','savePath',_0x328a('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x4f7063,null))['then'](function(_0x57bffd){if(_0x57bffd){var _0x24bd74=_0x57bffd[_0x328a('0x52')];var _0x59ac03=util[_0x328a('0x53')](_0x328a('0x54'),_0x24bd74);if(fs[_0x328a('0x55')](_0x59ac03)){_0x5479d6=!![];return _0x2d91d7['decryptFile'](_0x59ac03,_0x24bd74,config[_0x328a('0x56')][_0x328a('0x57')])[_0x328a('0x27')](function(){return _0x57bffd;});}return _0x57bffd;}})[_0x328a('0x27')](function(_0x1c937c){if(_0x1c937c){var _0x42ff47=_0x1c937c[_0x328a('0x52')];if(!fs[_0x328a('0x55')](_0x42ff47)){throw new db[(_0x328a('0x58'))][(_0x328a('0x59'))]('SquareRecording\x20not\x20found');}if(_0x1c937c['filename']){return _0x4f7063[_0x328a('0x4e')](_0x42ff47,_0x1c937c[_0x328a('0x51')]+path[_0x328a('0x5a')](_0x42ff47),function(){if(_0x5479d6){fs['unlink'](_0x42ff47);}});}else{return _0x4f7063[_0x328a('0x4e')](_0x42ff47,function(_0x3fa4d8){if(_0x5479d6){fs['unlink'](_0x42ff47);}});}}})[_0x328a('0x46')](function(_0x366f06){if(_0x366f06[_0x328a('0x5b')]==='SquareRecording\x20not\x20found'){_0x4f7063[_0x328a('0x1e')](0x194)[_0x328a('0x2c')](_0x328a('0x5c'));}else{return handleError(_0x4f7063,null);}});};exports['destroy']=function(_0x117e62,_0x582d90){return db['SquareRecording'][_0x328a('0x4d')]({'where':{'id':_0x117e62[_0x328a('0x48')]['id']}})[_0x328a('0x27')](function(_0xe11ed){if(_['isNil'](_0xe11ed)){throw new ReferenceError('Entity\x20not\x20found');}return _0xe11ed;})['then'](function(_0x5d28b5){var _0x3d8b20=_0x5d28b5[_0x328a('0x52')];logger['info'](_0x328a('0x5d'),_0x3d8b20);if(!_[_0x328a('0x5e')](_0x5d28b5['savePath'])&&fs['existsSync'](_0x3d8b20)){logger[_0x328a('0x5f')](_0x328a('0x60')+_0x3d8b20+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x328a('0x61')](_0x3d8b20);}_0x3d8b20=_0x3d8b20+_0x328a('0x62');if(!_['isNil'](_0x5d28b5[_0x328a('0x52')])&&fs[_0x328a('0x55')](_0x3d8b20)){logger[_0x328a('0x5f')](_0x328a('0x60')+_0x3d8b20+_0x328a('0x63'));fs[_0x328a('0x61')](_0x3d8b20);}return _0x5d28b5;})[_0x328a('0x27')](function(_0x1952b8){if(!_0x1952b8)throw new InternalError();return _0x1952b8[_0x328a('0x28')]();})[_0x328a('0x27')](function(){_0x582d90[_0x328a('0x1e')](0xcc)['end']();})[_0x328a('0x46')](handleError(_0x582d90,null));}; \ No newline at end of file +var _0x6c87=['apply','reject','update','then','destroy','end','error','name','send','SquareRecording','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','merge','filter','options','includeAll','include','show','params','length','catch','create','body','find','../../components/encryptor','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','download','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x6c87,0x14d));var _0x76c8=function(_0x5ee28e,_0x456e71){_0x5ee28e=_0x5ee28e-0x0;var _0xc29bf1=_0x6c87[_0x5ee28e];return _0xc29bf1;};'use strict';var emlformat=require(_0x76c8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x76c8('0x1'));var rp=require(_0x76c8('0x2'));var moment=require('moment');var BPromise=require(_0x76c8('0x3'));var Mustache=require('mustache');var util=require(_0x76c8('0x4'));var path=require(_0x76c8('0x5'));var sox=require(_0x76c8('0x6'));var csv=require(_0x76c8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76c8('0x8'));var _=require(_0x76c8('0x9'));var squel=require(_0x76c8('0xa'));var crypto=require('crypto');var jsforce=require(_0x76c8('0xb'));var deskjs=require(_0x76c8('0xc'));var toCsv=require(_0x76c8('0x7'));var querystring=require(_0x76c8('0xd'));var Papa=require(_0x76c8('0xe'));var Redis=require(_0x76c8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x76c8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x76c8('0x11'));var logger=require('../../config/logger')(_0x76c8('0x12'));var utils=require(_0x76c8('0x13'));var config=require(_0x76c8('0x14'));var licenseUtil=require(_0x76c8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b0c71,_0x4da69e){_0x4da69e=_0x4da69e||0xcc;return function(_0x2127f4){if(_0x2127f4){return _0x2b0c71[_0x76c8('0x16')](_0x4da69e);}return _0x2b0c71[_0x76c8('0x17')](_0x4da69e)['end']();};}function respondWithResult(_0x3b9d52,_0x3dcfe6){_0x3dcfe6=_0x3dcfe6||0xc8;return function(_0x57374a){if(_0x57374a){return _0x3b9d52[_0x76c8('0x17')](_0x3dcfe6)[_0x76c8('0x18')](_0x57374a);}};}function respondWithFilteredResult(_0x1b4c64,_0x304a10){return function(_0x6bb4df){if(_0x6bb4df){var _0x302299=typeof _0x304a10[_0x76c8('0x19')]===_0x76c8('0x1a')&&typeof _0x304a10[_0x76c8('0x1b')]===_0x76c8('0x1a');var _0x593215=_0x6bb4df[_0x76c8('0x1c')];var _0x489fd6=_0x302299?0x0:_0x304a10[_0x76c8('0x19')];var _0x53b508=_0x302299?_0x6bb4df[_0x76c8('0x1c')]:_0x304a10[_0x76c8('0x19')]+_0x304a10['limit'];var _0x39cdd8;if(_0x53b508>=_0x593215){_0x53b508=_0x593215;_0x39cdd8=0xc8;}else{_0x39cdd8=0xce;}_0x1b4c64[_0x76c8('0x17')](_0x39cdd8);return _0x1b4c64[_0x76c8('0x1d')](_0x76c8('0x1e'),_0x489fd6+'-'+_0x53b508+'/'+_0x593215)[_0x76c8('0x18')](_0x6bb4df);}return null;};}function patchUpdates(_0x234ea5){return function(_0x4ee701){try{jsonpatch[_0x76c8('0x1f')](_0x4ee701,_0x234ea5,!![]);}catch(_0x38e630){return BPromise[_0x76c8('0x20')](_0x38e630);}return _0x4ee701['save']();};}function saveUpdates(_0x3fe21d,_0x276f2a){return function(_0x17e9b8){if(_0x17e9b8){return _0x17e9b8[_0x76c8('0x21')](_0x3fe21d)[_0x76c8('0x22')](function(_0x2fede3){return _0x2fede3;});}return null;};}function removeEntity(_0x5a193e,_0x5564d2){return function(_0x1c590c){if(_0x1c590c){return _0x1c590c[_0x76c8('0x23')]()[_0x76c8('0x22')](function(){_0x5a193e['status'](0xcc)[_0x76c8('0x24')]();});}};}function handleEntityNotFound(_0x29678a,_0x48e2e6){return function(_0x1d3d97){if(!_0x1d3d97){_0x29678a[_0x76c8('0x16')](0x194);}return _0x1d3d97;};}function handleError(_0x23fe16,_0x17dedd){_0x17dedd=_0x17dedd||0x1f4;return function(_0x4be671){logger[_0x76c8('0x25')](_0x4be671['stack']);if(_0x4be671[_0x76c8('0x26')]){delete _0x4be671[_0x76c8('0x26')];}_0x23fe16[_0x76c8('0x17')](_0x17dedd)[_0x76c8('0x27')](_0x4be671);};}exports['index']=function(_0x4d857b,_0x53a004){var _0x49ef8b={},_0x3d4cf6={},_0x20b682={'count':0x0,'rows':[]};var _0x1ffba5=_['map'](db[_0x76c8('0x28')][_0x76c8('0x29')],function(_0x45a146){return{'name':_0x45a146[_0x76c8('0x2a')],'type':_0x45a146[_0x76c8('0x2b')][_0x76c8('0x2c')]};});_0x3d4cf6['model']=_[_0x76c8('0x2d')](_0x1ffba5,_0x76c8('0x26'));_0x3d4cf6[_0x76c8('0x2e')]=_[_0x76c8('0x2f')](_0x4d857b['query']);_0x3d4cf6[_0x76c8('0x30')]=_[_0x76c8('0x31')](_0x3d4cf6[_0x76c8('0x32')],_0x3d4cf6['query']);_0x49ef8b['attributes']=_['intersection'](_0x3d4cf6[_0x76c8('0x32')],qs[_0x76c8('0x33')](_0x4d857b[_0x76c8('0x2e')][_0x76c8('0x33')]));_0x49ef8b[_0x76c8('0x34')]=_0x49ef8b[_0x76c8('0x34')]['length']?_0x49ef8b[_0x76c8('0x34')]:_0x3d4cf6['model'];if(!_0x4d857b[_0x76c8('0x2e')]['hasOwnProperty']('nolimit')){_0x49ef8b[_0x76c8('0x1b')]=qs[_0x76c8('0x1b')](_0x4d857b['query']['limit']);_0x49ef8b[_0x76c8('0x19')]=qs[_0x76c8('0x19')](_0x4d857b['query'][_0x76c8('0x19')]);}_0x49ef8b[_0x76c8('0x35')]=qs[_0x76c8('0x36')](_0x4d857b['query'][_0x76c8('0x36')]);_0x49ef8b[_0x76c8('0x37')]=qs[_0x76c8('0x30')](_[_0x76c8('0x38')](_0x4d857b['query'],_0x3d4cf6['filters']),_0x1ffba5);if(_0x4d857b[_0x76c8('0x2e')]['filter']){_0x49ef8b[_0x76c8('0x37')]=_[_0x76c8('0x39')](_0x49ef8b[_0x76c8('0x37')],{'$or':_['map'](_0x1ffba5,function(_0x418119){if(_0x418119[_0x76c8('0x2b')]!=='VIRTUAL'){var _0x307286={};_0x307286[_0x418119[_0x76c8('0x26')]]={'$like':'%'+_0x4d857b[_0x76c8('0x2e')][_0x76c8('0x3a')]+'%'};return _0x307286;}})});}_0x49ef8b=_[_0x76c8('0x39')]({},_0x49ef8b,_0x4d857b[_0x76c8('0x3b')]);var _0x20038b={'where':_0x49ef8b[_0x76c8('0x37')]};return db[_0x76c8('0x28')][_0x76c8('0x1c')](_0x20038b)['then'](function(_0x5e933d){_0x20b682[_0x76c8('0x1c')]=_0x5e933d;if(_0x4d857b[_0x76c8('0x2e')][_0x76c8('0x3c')]){_0x49ef8b[_0x76c8('0x3d')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x49ef8b);})[_0x76c8('0x22')](function(_0x3afff){_0x20b682['rows']=_0x3afff;return _0x20b682;})[_0x76c8('0x22')](respondWithFilteredResult(_0x53a004,_0x49ef8b))['catch'](handleError(_0x53a004,null));};exports[_0x76c8('0x3e')]=function(_0x21da44,_0x35b1a3){var _0x1de85b={'raw':!![],'where':{'id':_0x21da44[_0x76c8('0x3f')]['id']}},_0x30dd9b={};_0x30dd9b[_0x76c8('0x32')]=_['keys'](db[_0x76c8('0x28')][_0x76c8('0x29')]);_0x30dd9b[_0x76c8('0x2e')]=_['keys'](_0x21da44[_0x76c8('0x2e')]);_0x30dd9b[_0x76c8('0x30')]=_[_0x76c8('0x31')](_0x30dd9b[_0x76c8('0x32')],_0x30dd9b['query']);_0x1de85b[_0x76c8('0x34')]=_[_0x76c8('0x31')](_0x30dd9b[_0x76c8('0x32')],qs[_0x76c8('0x33')](_0x21da44[_0x76c8('0x2e')]['fields']));_0x1de85b[_0x76c8('0x34')]=_0x1de85b[_0x76c8('0x34')][_0x76c8('0x40')]?_0x1de85b['attributes']:_0x30dd9b[_0x76c8('0x32')];if(_0x21da44[_0x76c8('0x2e')][_0x76c8('0x3c')]){_0x1de85b[_0x76c8('0x3d')]=[{'all':!![]}];}_0x1de85b=_[_0x76c8('0x39')]({},_0x1de85b,_0x21da44['options']);return db[_0x76c8('0x28')]['find'](_0x1de85b)[_0x76c8('0x22')](handleEntityNotFound(_0x35b1a3,null))[_0x76c8('0x22')](respondWithResult(_0x35b1a3,null))[_0x76c8('0x41')](handleError(_0x35b1a3,null));};exports[_0x76c8('0x42')]=function(_0x52ff18,_0x34e70f){return db[_0x76c8('0x28')]['create'](_0x52ff18[_0x76c8('0x43')],{})[_0x76c8('0x22')](respondWithResult(_0x34e70f,0xc9))[_0x76c8('0x41')](handleError(_0x34e70f,null));};exports[_0x76c8('0x21')]=function(_0x3b6814,_0x5e9f97){if(_0x3b6814['body']['id']){delete _0x3b6814[_0x76c8('0x43')]['id'];}return db[_0x76c8('0x28')][_0x76c8('0x44')]({'where':{'id':_0x3b6814[_0x76c8('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5e9f97,null))[_0x76c8('0x22')](saveUpdates(_0x3b6814[_0x76c8('0x43')],null))['then'](respondWithResult(_0x5e9f97,null))[_0x76c8('0x41')](handleError(_0x5e9f97,null));};exports['download']=function(_0x33a479,_0x5b4aec,_0x282abc){var _0x2cadd6=require(_0x76c8('0x45'));var _0x55dc37=![];var _0x3bdb5a={};if(_0x33a479['query'][_0x76c8('0x2b')]&&_0x33a479[_0x76c8('0x2e')][_0x76c8('0x2b')]==='uniqueid'){_0x3bdb5a['uniqueid']=_0x33a479['params']['id'];}else{_0x3bdb5a['id']=_0x33a479[_0x76c8('0x3f')]['id'];}return db[_0x76c8('0x28')]['find']({'where':_0x3bdb5a,'attributes':['id',_0x76c8('0x46'),'filename'],'raw':!![]})[_0x76c8('0x22')](handleEntityNotFound(_0x5b4aec,null))[_0x76c8('0x22')](function(_0x3f7d79){if(_0x3f7d79){var _0x4b3dba=_0x3f7d79[_0x76c8('0x46')];var _0x3caa92=util['format'](_0x76c8('0x47'),_0x4b3dba);if(fs[_0x76c8('0x48')](_0x3caa92)){_0x55dc37=!![];return _0x2cadd6[_0x76c8('0x49')](_0x3caa92,_0x4b3dba,config[_0x76c8('0x4a')][_0x76c8('0x4b')])[_0x76c8('0x22')](function(){return _0x3f7d79;});}return _0x3f7d79;}})[_0x76c8('0x22')](function(_0x3e41f6){if(_0x3e41f6){var _0x226230=_0x3e41f6[_0x76c8('0x46')];if(!fs[_0x76c8('0x48')](_0x226230)){throw new db[(_0x76c8('0x4c'))][(_0x76c8('0x4d'))](_0x76c8('0x4e'));}if(_0x3e41f6[_0x76c8('0x4f')]){return _0x5b4aec[_0x76c8('0x50')](_0x226230,_0x3e41f6[_0x76c8('0x4f')]+path['extname'](_0x226230),function(){if(_0x55dc37){fs[_0x76c8('0x51')](_0x226230);}});}else{return _0x5b4aec['download'](_0x226230,function(_0x375df6){if(_0x55dc37){fs[_0x76c8('0x51')](_0x226230);}});}}})[_0x76c8('0x41')](function(_0x433ebe){if(_0x433ebe[_0x76c8('0x52')]==='SquareRecording\x20not\x20found'){_0x5b4aec[_0x76c8('0x17')](0x194)['send'](_0x76c8('0x53'));}else{return handleError(_0x5b4aec,null);}});};exports[_0x76c8('0x23')]=function(_0x2177e9,_0x4d9118){return db[_0x76c8('0x28')][_0x76c8('0x44')]({'where':{'id':_0x2177e9['params']['id']}})['then'](function(_0x5effdd){if(_[_0x76c8('0x54')](_0x5effdd)){throw new ReferenceError(_0x76c8('0x55'));}return _0x5effdd;})['then'](function(_0x4f68b8){var _0x26fb9d=_0x4f68b8[_0x76c8('0x46')];logger[_0x76c8('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x26fb9d);if(!_[_0x76c8('0x54')](_0x4f68b8['savePath'])&&fs[_0x76c8('0x48')](_0x26fb9d)){logger[_0x76c8('0x56')](_0x76c8('0x57')+_0x26fb9d+_0x76c8('0x58'));fs['unlinkSync'](_0x26fb9d);}_0x26fb9d=_0x26fb9d+_0x76c8('0x59');if(!_[_0x76c8('0x54')](_0x4f68b8['savePath'])&&fs[_0x76c8('0x48')](_0x26fb9d)){logger[_0x76c8('0x56')](_0x76c8('0x57')+_0x26fb9d+_0x76c8('0x58'));fs[_0x76c8('0x5a')](_0x26fb9d);}return _0x4f68b8;})[_0x76c8('0x22')](function(_0x1e549f){if(!_0x1e549f)throw new InternalError();return _0x1e549f['destroy']();})[_0x76c8('0x22')](function(){_0x4d9118[_0x76c8('0x17')](0xcc)['end']();})[_0x76c8('0x41')](handleError(_0x4d9118,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 905be8c..4925cb8 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 _0x63a6=['rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','util','../../config/logger','moment','bluebird','path'];(function(_0x4b32d5,_0xd28713){var _0x1ab2b6=function(_0x4b2336){while(--_0x4b2336){_0x4b32d5['push'](_0x4b32d5['shift']());}};_0x1ab2b6(++_0xd28713);}(_0x63a6,0x1c7));var _0x663a=function(_0xc3b595,_0x4108fd){_0xc3b595=_0xc3b595-0x0;var _0x26befa=_0x63a6[_0xc3b595];return _0x26befa;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var logger=require(_0x663a('0x1'))('api');var moment=require(_0x663a('0x2'));var BPromise=require(_0x663a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663a('0x4'));var rimraf=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var attributes=require(_0x663a('0x7'));module['exports']=function(_0x5aab49,_0x5907e8){return _0x5aab49[_0x663a('0x8')](_0x663a('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9666=['./squareRecording.attributes','exports','define','SquareRecording','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x9666,0x17a));var _0x6966=function(_0xdfe41,_0x472a37){_0xdfe41=_0xdfe41-0x0;var _0x4d1c76=_0x9666[_0xdfe41];return _0x4d1c76;};'use strict';var _=require(_0x6966('0x0'));var util=require(_0x6966('0x1'));var logger=require(_0x6966('0x2'))(_0x6966('0x3'));var moment=require('moment');var BPromise=require(_0x6966('0x4'));var rp=require(_0x6966('0x5'));var fs=require('fs');var path=require(_0x6966('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6966('0x7'));module[_0x6966('0x8')]=function(_0x7194a6,_0x17198b){return _0x7194a6[_0x6966('0x9')](_0x6966('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 65bda46..f48263e 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 _0xdfd9=['client','http','request','then','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','CreateSquareRecording','SquareRecording','create','body','options','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x13cbed,_0x1c57d8){var _0x39c603=function(_0x4f6d63){while(--_0x4f6d63){_0x13cbed['push'](_0x13cbed['shift']());}};_0x39c603(++_0x1c57d8);}(_0xdfd9,0x6a));var _0x9dfd=function(_0x264083,_0x56107e){_0x264083=_0x264083-0x0;var _0x5513f9=_0xdfd9[_0x264083];return _0x5513f9;};'use strict';var _=require(_0x9dfd('0x0'));var util=require(_0x9dfd('0x1'));var moment=require(_0x9dfd('0x2'));var BPromise=require(_0x9dfd('0x3'));var rs=require(_0x9dfd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dfd('0x5'))['db'];var utils=require(_0x9dfd('0x6'));var logger=require(_0x9dfd('0x7'))(_0x9dfd('0x8'));var config=require(_0x9dfd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9dfd('0xa')][_0x9dfd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3801eb,_0x55a8,_0x3e2563){return new BPromise(function(_0xb5832f,_0x3d54db){return client[_0x9dfd('0xc')](_0x3801eb,_0x3e2563)[_0x9dfd('0xd')](function(_0x2c708e){logger[_0x9dfd('0xe')](_0x9dfd('0xf'),_0x55a8,'request\x20sent');logger[_0x9dfd('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x55a8,_0x9dfd('0x11'),JSON[_0x9dfd('0x12')](_0x2c708e));if(_0x2c708e[_0x9dfd('0x13')]){if(_0x2c708e[_0x9dfd('0x13')][_0x9dfd('0x14')]===0x1f4){logger[_0x9dfd('0x13')]('SquareRecording,\x20%s,\x20%s',_0x55a8,_0x2c708e[_0x9dfd('0x13')]['message']);return _0x3d54db(_0x2c708e[_0x9dfd('0x13')]['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x55a8,_0x2c708e[_0x9dfd('0x13')][_0x9dfd('0x15')]);return _0xb5832f(_0x2c708e[_0x9dfd('0x13')][_0x9dfd('0x15')]);}else{logger['info'](_0x9dfd('0xf'),_0x55a8,_0x9dfd('0x11'));_0xb5832f(_0x2c708e[_0x9dfd('0x16')][_0x9dfd('0x15')]);}})['catch'](function(_0x5cd7a8){logger[_0x9dfd('0x13')](_0x9dfd('0xf'),_0x55a8,_0x5cd7a8);_0x3d54db(_0x5cd7a8);});});}exports[_0x9dfd('0x17')]=function(_0x373010){var _0x2ab601=this;return new Promise(function(_0x25461f,_0x5dec86){return db[_0x9dfd('0x18')][_0x9dfd('0x19')](_0x373010[_0x9dfd('0x1a')],{'raw':_0x373010['options']?_0x373010[_0x9dfd('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x9dfd('0xd')](function(_0xd4cf3c){logger[_0x9dfd('0xe')](_0x9dfd('0x17'),_0x373010);logger['debug'](_0x9dfd('0x17'),_0x373010,JSON[_0x9dfd('0x12')](_0xd4cf3c));_0x25461f(_0xd4cf3c);})[_0x9dfd('0x1c')](function(_0x3bd0e1){logger[_0x9dfd('0x13')]('CreateSquareRecording',_0x3bd0e1[_0x9dfd('0x15')],_0x373010);_0x5dec86(_0x2ab601['error'](0x1f4,_0x3bd0e1[_0x9dfd('0x15')]));});});}; \ No newline at end of file +var _0x3d17=['SquareRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateSquareRecording','body','options','lodash','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x379947,_0x5bbded){var _0x325d45=function(_0x16b2c6){while(--_0x16b2c6){_0x379947['push'](_0x379947['shift']());}};_0x325d45(++_0x5bbded);}(_0x3d17,0x99));var _0x73d1=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0x3d17[_0x5e2152];return _0x5ddcf6;};'use strict';var _=require(_0x73d1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x73d1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x73d1('0x2'));var logger=require(_0x73d1('0x3'))(_0x73d1('0x4'));var config=require(_0x73d1('0x5'));var jayson=require(_0x73d1('0x6'));var client=jayson[_0x73d1('0x7')][_0x73d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5339f5,_0xa60278,_0x1459b7){return new BPromise(function(_0x78ced4,_0x1f7ba6){return client[_0x73d1('0x9')](_0x5339f5,_0x1459b7)[_0x73d1('0xa')](function(_0x5ae635){logger[_0x73d1('0xb')](_0x73d1('0xc'),_0xa60278,_0x73d1('0xd'));logger[_0x73d1('0xe')](_0x73d1('0xf'),_0xa60278,_0x73d1('0xd'),JSON[_0x73d1('0x10')](_0x5ae635));if(_0x5ae635['error']){if(_0x5ae635['error'][_0x73d1('0x11')]===0x1f4){logger[_0x73d1('0x12')]('SquareRecording,\x20%s,\x20%s',_0xa60278,_0x5ae635[_0x73d1('0x12')][_0x73d1('0x13')]);return _0x1f7ba6(_0x5ae635[_0x73d1('0x12')][_0x73d1('0x13')]);}logger[_0x73d1('0x12')](_0x73d1('0xc'),_0xa60278,_0x5ae635['error']['message']);return _0x78ced4(_0x5ae635[_0x73d1('0x12')][_0x73d1('0x13')]);}else{logger[_0x73d1('0xb')]('SquareRecording,\x20%s,\x20%s',_0xa60278,_0x73d1('0xd'));_0x78ced4(_0x5ae635['result']['message']);}})[_0x73d1('0x14')](function(_0x32da06){logger[_0x73d1('0x12')](_0x73d1('0xc'),_0xa60278,_0x32da06);_0x1f7ba6(_0x32da06);});});}exports[_0x73d1('0x15')]=function(_0x43454b){var _0x3305ab=this;return new Promise(function(_0x171bad,_0x4c880b){return db['SquareRecording']['create'](_0x43454b[_0x73d1('0x16')],{'raw':_0x43454b['options']?_0x43454b[_0x73d1('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x73d1('0xa')](function(_0x513067){logger[_0x73d1('0xb')](_0x73d1('0x15'),_0x43454b);logger['debug'](_0x73d1('0x15'),_0x43454b,JSON[_0x73d1('0x10')](_0x513067));_0x171bad(_0x513067);})[_0x73d1('0x14')](function(_0x10df7b){logger['error']('CreateSquareRecording',_0x10df7b[_0x73d1('0x13')],_0x43454b);_0x4c880b(_0x3305ab[_0x73d1('0x12')](0x1f4,_0x10df7b[_0x73d1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 8ab46bf..a66b0fd 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 _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(_0x49c68e,_0x1c1673){var _0x33032b=function(_0x42ac31){while(--_0x42ac31){_0x49c68e['push'](_0x49c68e['shift']());}};_0x33032b(++_0x1c1673);}(_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 +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(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index e088f09..222a7d1 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 _0x3c03=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c03,0x1f4));var _0x33c0=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3c03[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x33c0('0x0'));module[_0x33c0('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x33c0('0x2')]},'channel':{'type':Sequelize[_0x33c0('0x2')]},'language':{'type':Sequelize[_0x33c0('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x33c0('0x2')]},'callerid':{'type':Sequelize[_0x33c0('0x2')]},'calleridname':{'type':Sequelize[_0x33c0('0x2')]},'callingpres':{'type':Sequelize[_0x33c0('0x2')]},'callingani2':{'type':Sequelize[_0x33c0('0x2')]},'callington':{'type':Sequelize[_0x33c0('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x33c0('0x2')]},'rdnis':{'type':Sequelize[_0x33c0('0x2')]},'context':{'type':Sequelize[_0x33c0('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x33c0('0x2')]},'enhanced':{'type':Sequelize[_0x33c0('0x2')]},'accountcode':{'type':Sequelize[_0x33c0('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x33c0('0x2')]},'joinAt':{'type':Sequelize[_0x33c0('0x3')]},'leaveAt':{'type':Sequelize[_0x33c0('0x3')]},'bot':{'type':Sequelize[_0x33c0('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x71f4=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x15d36a,_0x378e01){var _0x684f7a=function(_0x1d1cc1){while(--_0x1d1cc1){_0x15d36a['push'](_0x15d36a['shift']());}};_0x684f7a(++_0x378e01);}(_0x71f4,0x1e5));var _0x471f=function(_0x4ece23,_0x2eb4ee){_0x4ece23=_0x4ece23-0x0;var _0x36aeb3=_0x71f4[_0x4ece23];return _0x36aeb3;};'use strict';var Sequelize=require(_0x471f('0x0'));module[_0x471f('0x1')]={'network':{'type':Sequelize[_0x471f('0x2')]},'network_script':{'type':Sequelize[_0x471f('0x2')]},'request':{'type':Sequelize[_0x471f('0x2')]},'channel':{'type':Sequelize[_0x471f('0x2')]},'language':{'type':Sequelize[_0x471f('0x2')]},'type':{'type':Sequelize[_0x471f('0x2')]},'uniqueid':{'type':Sequelize[_0x471f('0x2')]},'version':{'type':Sequelize[_0x471f('0x2')]},'callerid':{'type':Sequelize[_0x471f('0x2')]},'calleridname':{'type':Sequelize[_0x471f('0x2')]},'callingpres':{'type':Sequelize[_0x471f('0x2')]},'callingani2':{'type':Sequelize[_0x471f('0x2')]},'callington':{'type':Sequelize[_0x471f('0x2')]},'callingtns':{'type':Sequelize[_0x471f('0x2')]},'dnid':{'type':Sequelize[_0x471f('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x471f('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x471f('0x2')]},'enhanced':{'type':Sequelize[_0x471f('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x471f('0x2')]},'project_name':{'type':Sequelize[_0x471f('0x2')]},'joinAt':{'type':Sequelize[_0x471f('0x3')]},'leaveAt':{'type':Sequelize[_0x471f('0x3')]},'bot':{'type':Sequelize[_0x471f('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 861851c..99e20a8 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 _0xb82a=['destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SquareReport','includeAll','include','catch','show','params','options','create','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xb82a,0xc1));var _0xab82=function(_0x5f2543,_0x353740){_0x5f2543=_0x5f2543-0x0;var _0x420ebc=_0xb82a[_0x5f2543];return _0x420ebc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab82('0x0'));var zipdir=require(_0xab82('0x1'));var jsonpatch=require(_0xab82('0x2'));var rp=require(_0xab82('0x3'));var moment=require('moment');var BPromise=require(_0xab82('0x4'));var Mustache=require('mustache');var util=require(_0xab82('0x5'));var path=require(_0xab82('0x6'));var sox=require(_0xab82('0x7'));var csv=require(_0xab82('0x8'));var ejs=require(_0xab82('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab82('0xa'));var squel=require(_0xab82('0xb'));var crypto=require(_0xab82('0xc'));var jsforce=require(_0xab82('0xd'));var deskjs=require(_0xab82('0xe'));var toCsv=require(_0xab82('0x8'));var querystring=require(_0xab82('0xf'));var Papa=require(_0xab82('0x10'));var Redis=require(_0xab82('0x11'));var authService=require(_0xab82('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab82('0x13'));var logger=require('../../config/logger')(_0xab82('0x14'));var utils=require(_0xab82('0x15'));var config=require(_0xab82('0x16'));var licenseUtil=require(_0xab82('0x17'));var db=require(_0xab82('0x18'))['db'];function respondWithStatusCode(_0x2c88a8,_0x35bd25){_0x35bd25=_0x35bd25||0xcc;return function(_0x1f75ec){if(_0x1f75ec){return _0x2c88a8[_0xab82('0x19')](_0x35bd25);}return _0x2c88a8[_0xab82('0x1a')](_0x35bd25)[_0xab82('0x1b')]();};}function respondWithResult(_0x37fa2f,_0x17c269){_0x17c269=_0x17c269||0xc8;return function(_0x19737d){if(_0x19737d){return _0x37fa2f['status'](_0x17c269)[_0xab82('0x1c')](_0x19737d);}};}function respondWithFilteredResult(_0x5102cf,_0x20c7a2){return function(_0x2d6375){if(_0x2d6375){var _0x3163e4=typeof _0x20c7a2[_0xab82('0x1d')]===_0xab82('0x1e')&&typeof _0x20c7a2[_0xab82('0x1f')]===_0xab82('0x1e');var _0x328405=_0x2d6375[_0xab82('0x20')];var _0x564334=_0x3163e4?0x0:_0x20c7a2[_0xab82('0x1d')];var _0x3d2612=_0x3163e4?_0x2d6375[_0xab82('0x20')]:_0x20c7a2[_0xab82('0x1d')]+_0x20c7a2[_0xab82('0x1f')];var _0x18cc15;if(_0x3d2612>=_0x328405){_0x3d2612=_0x328405;_0x18cc15=0xc8;}else{_0x18cc15=0xce;}_0x5102cf[_0xab82('0x1a')](_0x18cc15);return _0x5102cf[_0xab82('0x21')](_0xab82('0x22'),_0x564334+'-'+_0x3d2612+'/'+_0x328405)[_0xab82('0x1c')](_0x2d6375);}return null;};}function patchUpdates(_0x4742b4){return function(_0x4afcf6){try{jsonpatch['apply'](_0x4afcf6,_0x4742b4,!![]);}catch(_0xdf3da9){return BPromise[_0xab82('0x23')](_0xdf3da9);}return _0x4afcf6[_0xab82('0x24')]();};}function saveUpdates(_0x178d56,_0x4c4cdb){return function(_0x47c89a){if(_0x47c89a){return _0x47c89a['update'](_0x178d56)[_0xab82('0x25')](function(_0x6a6202){return _0x6a6202;});}return null;};}function removeEntity(_0x2c4dff,_0x53696a){return function(_0x42b254){if(_0x42b254){return _0x42b254[_0xab82('0x26')]()[_0xab82('0x25')](function(){_0x2c4dff[_0xab82('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x510dab,_0x1e64c8){return function(_0x48ce4e){if(!_0x48ce4e){_0x510dab[_0xab82('0x19')](0x194);}return _0x48ce4e;};}function handleError(_0x283b1d,_0x22af5a){_0x22af5a=_0x22af5a||0x1f4;return function(_0x55169a){logger[_0xab82('0x27')](_0x55169a[_0xab82('0x28')]);if(_0x55169a['name']){delete _0x55169a[_0xab82('0x29')];}_0x283b1d[_0xab82('0x1a')](_0x22af5a)[_0xab82('0x2a')](_0x55169a);};}exports[_0xab82('0x2b')]=function(_0x55ee34,_0x54934d){var _0x504a7b={},_0x38e5e4={},_0x3726d1={'count':0x0,'rows':[]};var _0x401781=_[_0xab82('0x2c')](db['SquareReport'][_0xab82('0x2d')],function(_0x3d7e57){return{'name':_0x3d7e57[_0xab82('0x2e')],'type':_0x3d7e57['type']['key']};});_0x38e5e4[_0xab82('0x2f')]=_[_0xab82('0x2c')](_0x401781,_0xab82('0x29'));_0x38e5e4[_0xab82('0x30')]=_[_0xab82('0x31')](_0x55ee34['query']);_0x38e5e4[_0xab82('0x32')]=_[_0xab82('0x33')](_0x38e5e4[_0xab82('0x2f')],_0x38e5e4['query']);_0x504a7b['attributes']=_[_0xab82('0x33')](_0x38e5e4[_0xab82('0x2f')],qs[_0xab82('0x34')](_0x55ee34[_0xab82('0x30')]['fields']));_0x504a7b[_0xab82('0x35')]=_0x504a7b[_0xab82('0x35')][_0xab82('0x36')]?_0x504a7b['attributes']:_0x38e5e4[_0xab82('0x2f')];if(!_0x55ee34[_0xab82('0x30')][_0xab82('0x37')](_0xab82('0x38'))){_0x504a7b[_0xab82('0x1f')]=qs[_0xab82('0x1f')](_0x55ee34['query'][_0xab82('0x1f')]);_0x504a7b['offset']=qs[_0xab82('0x1d')](_0x55ee34[_0xab82('0x30')][_0xab82('0x1d')]);}_0x504a7b[_0xab82('0x39')]=qs[_0xab82('0x3a')](_0x55ee34['query'][_0xab82('0x3a')]);_0x504a7b[_0xab82('0x3b')]=qs[_0xab82('0x32')](_[_0xab82('0x3c')](_0x55ee34[_0xab82('0x30')],_0x38e5e4['filters']),_0x401781);if(_0x55ee34['query'][_0xab82('0x3d')]){_0x504a7b[_0xab82('0x3b')]=_[_0xab82('0x3e')](_0x504a7b[_0xab82('0x3b')],{'$or':_[_0xab82('0x2c')](_0x401781,function(_0x30e1d2){if(_0x30e1d2[_0xab82('0x3f')]!==_0xab82('0x40')){var _0x4ef765={};_0x4ef765[_0x30e1d2[_0xab82('0x29')]]={'$like':'%'+_0x55ee34['query'][_0xab82('0x3d')]+'%'};return _0x4ef765;}})});}_0x504a7b=_[_0xab82('0x3e')]({},_0x504a7b,_0x55ee34['options']);var _0x39d6be={'where':_0x504a7b['where']};return db[_0xab82('0x41')][_0xab82('0x20')](_0x39d6be)['then'](function(_0x1bbd63){_0x3726d1[_0xab82('0x20')]=_0x1bbd63;if(_0x55ee34['query'][_0xab82('0x42')]){_0x504a7b[_0xab82('0x43')]=[{'all':!![]}];}return db[_0xab82('0x41')]['findAll'](_0x504a7b);})['then'](function(_0x5d13b6){_0x3726d1['rows']=_0x5d13b6;return _0x3726d1;})[_0xab82('0x25')](respondWithFilteredResult(_0x54934d,_0x504a7b))[_0xab82('0x44')](handleError(_0x54934d,null));};exports[_0xab82('0x45')]=function(_0x4096a4,_0x33b70f){var _0x34da06={'raw':!![],'where':{'id':_0x4096a4[_0xab82('0x46')]['id']}},_0x370977={};_0x370977[_0xab82('0x2f')]=_[_0xab82('0x31')](db['SquareReport'][_0xab82('0x2d')]);_0x370977[_0xab82('0x30')]=_[_0xab82('0x31')](_0x4096a4[_0xab82('0x30')]);_0x370977[_0xab82('0x32')]=_[_0xab82('0x33')](_0x370977[_0xab82('0x2f')],_0x370977[_0xab82('0x30')]);_0x34da06[_0xab82('0x35')]=_[_0xab82('0x33')](_0x370977['model'],qs[_0xab82('0x34')](_0x4096a4[_0xab82('0x30')][_0xab82('0x34')]));_0x34da06[_0xab82('0x35')]=_0x34da06[_0xab82('0x35')][_0xab82('0x36')]?_0x34da06['attributes']:_0x370977[_0xab82('0x2f')];if(_0x4096a4['query']['includeAll']){_0x34da06[_0xab82('0x43')]=[{'all':!![]}];}_0x34da06=_[_0xab82('0x3e')]({},_0x34da06,_0x4096a4[_0xab82('0x47')]);return db[_0xab82('0x41')]['find'](_0x34da06)[_0xab82('0x25')](handleEntityNotFound(_0x33b70f,null))['then'](respondWithResult(_0x33b70f,null))[_0xab82('0x44')](handleError(_0x33b70f,null));};exports[_0xab82('0x48')]=function(_0x4bd619,_0x140590){return db[_0xab82('0x41')][_0xab82('0x48')](_0x4bd619['body'],{})[_0xab82('0x25')](respondWithResult(_0x140590,0xc9))['catch'](handleError(_0x140590,null));};exports[_0xab82('0x49')]=function(_0x2e4499,_0x27fae4){if(_0x2e4499[_0xab82('0x4a')]['id']){delete _0x2e4499[_0xab82('0x4a')]['id'];}return db[_0xab82('0x41')][_0xab82('0x4b')]({'where':{'id':_0x2e4499[_0xab82('0x46')]['id']}})['then'](handleEntityNotFound(_0x27fae4,null))[_0xab82('0x25')](saveUpdates(_0x2e4499[_0xab82('0x4a')],null))[_0xab82('0x25')](respondWithResult(_0x27fae4,null))[_0xab82('0x44')](handleError(_0x27fae4,null));};exports[_0xab82('0x26')]=function(_0x389cc2,_0x2f0bf3){return db[_0xab82('0x41')]['find']({'where':{'id':_0x389cc2['params']['id']}})[_0xab82('0x25')](handleEntityNotFound(_0x2f0bf3,null))[_0xab82('0x25')](removeEntity(_0x2f0bf3,null))[_0xab82('0x44')](handleError(_0x2f0bf3,null));};exports[_0xab82('0x4c')]=function(_0x4a67fa,_0x1cdcdf){return db[_0xab82('0x41')][_0xab82('0x4c')]()[_0xab82('0x25')](respondWithResult(_0x1cdcdf,null))['catch'](handleError(_0x1cdcdf,null));}; \ No newline at end of file +var _0x4f13=['filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','length','include','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','SquareReport','fieldName','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f13,0x146));var _0x34f1=function(_0x511bf0,_0x193086){_0x511bf0=_0x511bf0-0x0;var _0x53513c=_0x4f13[_0x511bf0];return _0x53513c;};'use strict';var emlformat=require(_0x34f1('0x0'));var rimraf=require(_0x34f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x34f1('0x2'));var rp=require(_0x34f1('0x3'));var moment=require(_0x34f1('0x4'));var BPromise=require(_0x34f1('0x5'));var Mustache=require(_0x34f1('0x6'));var util=require('util');var path=require('path');var sox=require(_0x34f1('0x7'));var csv=require('to-csv');var ejs=require(_0x34f1('0x8'));var fs=require('fs');var fs_extra=require(_0x34f1('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x34f1('0xa'));var jsforce=require(_0x34f1('0xb'));var deskjs=require(_0x34f1('0xc'));var toCsv=require(_0x34f1('0xd'));var querystring=require(_0x34f1('0xe'));var Papa=require(_0x34f1('0xf'));var Redis=require('ioredis');var authService=require(_0x34f1('0x10'));var qs=require(_0x34f1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34f1('0x12'));var logger=require(_0x34f1('0x13'))(_0x34f1('0x14'));var utils=require(_0x34f1('0x15'));var config=require(_0x34f1('0x16'));var licenseUtil=require(_0x34f1('0x17'));var db=require(_0x34f1('0x18'))['db'];function respondWithStatusCode(_0x1daa37,_0xbb4d3f){_0xbb4d3f=_0xbb4d3f||0xcc;return function(_0xeb3def){if(_0xeb3def){return _0x1daa37[_0x34f1('0x19')](_0xbb4d3f);}return _0x1daa37[_0x34f1('0x1a')](_0xbb4d3f)[_0x34f1('0x1b')]();};}function respondWithResult(_0x598fa3,_0x3bea60){_0x3bea60=_0x3bea60||0xc8;return function(_0x1dad77){if(_0x1dad77){return _0x598fa3[_0x34f1('0x1a')](_0x3bea60)[_0x34f1('0x1c')](_0x1dad77);}};}function respondWithFilteredResult(_0x234830,_0x43fb4c){return function(_0xd6b40b){if(_0xd6b40b){var _0x10060c=typeof _0x43fb4c[_0x34f1('0x1d')]===_0x34f1('0x1e')&&typeof _0x43fb4c['limit']===_0x34f1('0x1e');var _0x34fe12=_0xd6b40b[_0x34f1('0x1f')];var _0x222ab8=_0x10060c?0x0:_0x43fb4c[_0x34f1('0x1d')];var _0x133d60=_0x10060c?_0xd6b40b[_0x34f1('0x1f')]:_0x43fb4c[_0x34f1('0x1d')]+_0x43fb4c[_0x34f1('0x20')];var _0x599154;if(_0x133d60>=_0x34fe12){_0x133d60=_0x34fe12;_0x599154=0xc8;}else{_0x599154=0xce;}_0x234830[_0x34f1('0x1a')](_0x599154);return _0x234830[_0x34f1('0x21')](_0x34f1('0x22'),_0x222ab8+'-'+_0x133d60+'/'+_0x34fe12)[_0x34f1('0x1c')](_0xd6b40b);}return null;};}function patchUpdates(_0xcff29){return function(_0x135ef4){try{jsonpatch[_0x34f1('0x23')](_0x135ef4,_0xcff29,!![]);}catch(_0x35122b){return BPromise['reject'](_0x35122b);}return _0x135ef4['save']();};}function saveUpdates(_0x1326b2,_0x1e8290){return function(_0x4cc8eb){if(_0x4cc8eb){return _0x4cc8eb[_0x34f1('0x24')](_0x1326b2)[_0x34f1('0x25')](function(_0x937e15){return _0x937e15;});}return null;};}function removeEntity(_0x18b10d,_0x32acf7){return function(_0x377104){if(_0x377104){return _0x377104[_0x34f1('0x26')]()[_0x34f1('0x25')](function(){_0x18b10d['status'](0xcc)[_0x34f1('0x1b')]();});}};}function handleEntityNotFound(_0x2f81a7,_0x5eb855){return function(_0x192ec9){if(!_0x192ec9){_0x2f81a7[_0x34f1('0x19')](0x194);}return _0x192ec9;};}function handleError(_0x377b72,_0x3ae986){_0x3ae986=_0x3ae986||0x1f4;return function(_0x4f2b4d){logger[_0x34f1('0x27')](_0x4f2b4d[_0x34f1('0x28')]);if(_0x4f2b4d[_0x34f1('0x29')]){delete _0x4f2b4d['name'];}_0x377b72['status'](_0x3ae986)[_0x34f1('0x2a')](_0x4f2b4d);};}exports[_0x34f1('0x2b')]=function(_0x31e2fc,_0x2da0be){var _0x49bb85={},_0xa0f827={},_0xa8eafa={'count':0x0,'rows':[]};var _0x28ea78=_[_0x34f1('0x2c')](db[_0x34f1('0x2d')]['rawAttributes'],function(_0x13a921){return{'name':_0x13a921[_0x34f1('0x2e')],'type':_0x13a921['type']['key']};});_0xa0f827['model']=_[_0x34f1('0x2c')](_0x28ea78,'name');_0xa0f827[_0x34f1('0x2f')]=_[_0x34f1('0x30')](_0x31e2fc['query']);_0xa0f827[_0x34f1('0x31')]=_[_0x34f1('0x32')](_0xa0f827['model'],_0xa0f827[_0x34f1('0x2f')]);_0x49bb85['attributes']=_[_0x34f1('0x32')](_0xa0f827[_0x34f1('0x33')],qs['fields'](_0x31e2fc[_0x34f1('0x2f')][_0x34f1('0x34')]));_0x49bb85[_0x34f1('0x35')]=_0x49bb85[_0x34f1('0x35')]['length']?_0x49bb85['attributes']:_0xa0f827[_0x34f1('0x33')];if(!_0x31e2fc[_0x34f1('0x2f')]['hasOwnProperty'](_0x34f1('0x36'))){_0x49bb85[_0x34f1('0x20')]=qs[_0x34f1('0x20')](_0x31e2fc[_0x34f1('0x2f')][_0x34f1('0x20')]);_0x49bb85['offset']=qs[_0x34f1('0x1d')](_0x31e2fc[_0x34f1('0x2f')]['offset']);}_0x49bb85[_0x34f1('0x37')]=qs[_0x34f1('0x38')](_0x31e2fc[_0x34f1('0x2f')][_0x34f1('0x38')]);_0x49bb85[_0x34f1('0x39')]=qs[_0x34f1('0x31')](_[_0x34f1('0x3a')](_0x31e2fc[_0x34f1('0x2f')],_0xa0f827['filters']),_0x28ea78);if(_0x31e2fc[_0x34f1('0x2f')][_0x34f1('0x3b')]){_0x49bb85[_0x34f1('0x39')]=_[_0x34f1('0x3c')](_0x49bb85[_0x34f1('0x39')],{'$or':_[_0x34f1('0x2c')](_0x28ea78,function(_0x2bd049){if(_0x2bd049[_0x34f1('0x3d')]!==_0x34f1('0x3e')){var _0x369de0={};_0x369de0[_0x2bd049[_0x34f1('0x29')]]={'$like':'%'+_0x31e2fc[_0x34f1('0x2f')][_0x34f1('0x3b')]+'%'};return _0x369de0;}})});}_0x49bb85=_[_0x34f1('0x3c')]({},_0x49bb85,_0x31e2fc[_0x34f1('0x3f')]);var _0x374b97={'where':_0x49bb85[_0x34f1('0x39')]};return db[_0x34f1('0x2d')][_0x34f1('0x1f')](_0x374b97)['then'](function(_0x36794e){_0xa8eafa[_0x34f1('0x1f')]=_0x36794e;if(_0x31e2fc[_0x34f1('0x2f')][_0x34f1('0x40')]){_0x49bb85['include']=[{'all':!![]}];}return db[_0x34f1('0x2d')][_0x34f1('0x41')](_0x49bb85);})[_0x34f1('0x25')](function(_0x3a0f9f){_0xa8eafa[_0x34f1('0x42')]=_0x3a0f9f;return _0xa8eafa;})[_0x34f1('0x25')](respondWithFilteredResult(_0x2da0be,_0x49bb85))[_0x34f1('0x43')](handleError(_0x2da0be,null));};exports[_0x34f1('0x44')]=function(_0x4d0b2e,_0x542159){var _0x5d9df6={'raw':!![],'where':{'id':_0x4d0b2e['params']['id']}},_0x1df8f5={};_0x1df8f5[_0x34f1('0x33')]=_['keys'](db[_0x34f1('0x2d')][_0x34f1('0x45')]);_0x1df8f5[_0x34f1('0x2f')]=_[_0x34f1('0x30')](_0x4d0b2e[_0x34f1('0x2f')]);_0x1df8f5[_0x34f1('0x31')]=_[_0x34f1('0x32')](_0x1df8f5['model'],_0x1df8f5[_0x34f1('0x2f')]);_0x5d9df6['attributes']=_[_0x34f1('0x32')](_0x1df8f5[_0x34f1('0x33')],qs[_0x34f1('0x34')](_0x4d0b2e['query'][_0x34f1('0x34')]));_0x5d9df6[_0x34f1('0x35')]=_0x5d9df6[_0x34f1('0x35')][_0x34f1('0x46')]?_0x5d9df6[_0x34f1('0x35')]:_0x1df8f5[_0x34f1('0x33')];if(_0x4d0b2e['query'][_0x34f1('0x40')]){_0x5d9df6[_0x34f1('0x47')]=[{'all':!![]}];}_0x5d9df6=_['merge']({},_0x5d9df6,_0x4d0b2e[_0x34f1('0x3f')]);return db[_0x34f1('0x2d')][_0x34f1('0x48')](_0x5d9df6)[_0x34f1('0x25')](handleEntityNotFound(_0x542159,null))['then'](respondWithResult(_0x542159,null))[_0x34f1('0x43')](handleError(_0x542159,null));};exports['create']=function(_0x2f624a,_0x15835f){return db['SquareReport'][_0x34f1('0x49')](_0x2f624a['body'],{})[_0x34f1('0x25')](respondWithResult(_0x15835f,0xc9))[_0x34f1('0x43')](handleError(_0x15835f,null));};exports['update']=function(_0x12868d,_0x5d301d){if(_0x12868d[_0x34f1('0x4a')]['id']){delete _0x12868d[_0x34f1('0x4a')]['id'];}return db[_0x34f1('0x2d')][_0x34f1('0x48')]({'where':{'id':_0x12868d[_0x34f1('0x4b')]['id']}})[_0x34f1('0x25')](handleEntityNotFound(_0x5d301d,null))[_0x34f1('0x25')](saveUpdates(_0x12868d[_0x34f1('0x4a')],null))[_0x34f1('0x25')](respondWithResult(_0x5d301d,null))['catch'](handleError(_0x5d301d,null));};exports[_0x34f1('0x26')]=function(_0x3d41a5,_0x32b2a6){return db['SquareReport'][_0x34f1('0x48')]({'where':{'id':_0x3d41a5[_0x34f1('0x4b')]['id']}})['then'](handleEntityNotFound(_0x32b2a6,null))[_0x34f1('0x25')](removeEntity(_0x32b2a6,null))[_0x34f1('0x43')](handleError(_0x32b2a6,null));};exports[_0x34f1('0x4c')]=function(_0x188883,_0x51e553){return db[_0x34f1('0x2d')][_0x34f1('0x4c')]()[_0x34f1('0x25')](respondWithResult(_0x51e553,null))[_0x34f1('0x43')](handleError(_0x51e553,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5055bfb..12160a9 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 _0xad5f=['SquareReport','report_square','uniqueid','project_name','leaveAt','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5e2525,_0x39e00a){var _0x2328a6=function(_0x55078d){while(--_0x55078d){_0x5e2525['push'](_0x5e2525['shift']());}};_0x2328a6(++_0x39e00a);}(_0xad5f,0x18b));var _0xfad5=function(_0x1db153,_0x1ab5d){_0x1db153=_0x1db153-0x0;var _0x530cbe=_0xad5f[_0x1db153];return _0x530cbe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfad5('0x0'))(_0xfad5('0x1'));var moment=require(_0xfad5('0x2'));var BPromise=require('bluebird');var rp=require(_0xfad5('0x3'));var fs=require('fs');var path=require(_0xfad5('0x4'));var rimraf=require(_0xfad5('0x5'));var config=require(_0xfad5('0x6'));var attributes=require('./squareReport.attributes');module[_0xfad5('0x7')]=function(_0x35db19,_0x3a9632){return _0x35db19['define'](_0xfad5('0x8'),attributes,{'tableName':_0xfad5('0x9'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xfad5('0xa'),_0xfad5('0xb')]},{'name':'leaveAt','fields':[_0xfad5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a4f=['path','rimraf','./squareReport.attributes','define','SquareReport','report_square','uniqueid','leaveAt','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2a0c4e,_0x22467d){var _0x38c169=function(_0x560b17){while(--_0x560b17){_0x2a0c4e['push'](_0x2a0c4e['shift']());}};_0x38c169(++_0x22467d);}(_0x8a4f,0x12e));var _0xf8a4=function(_0x224cc3,_0x51a08){_0x224cc3=_0x224cc3-0x0;var _0x28f1e7=_0x8a4f[_0x224cc3];return _0x28f1e7;};'use strict';var _=require(_0xf8a4('0x0'));var util=require(_0xf8a4('0x1'));var logger=require(_0xf8a4('0x2'))('api');var moment=require(_0xf8a4('0x3'));var BPromise=require(_0xf8a4('0x4'));var rp=require(_0xf8a4('0x5'));var fs=require('fs');var path=require(_0xf8a4('0x6'));var rimraf=require(_0xf8a4('0x7'));var config=require('../../config/environment');var attributes=require(_0xf8a4('0x8'));module['exports']=function(_0x2859b1,_0x5a276c){return _0x2859b1[_0xf8a4('0x9')](_0xf8a4('0xa'),attributes,{'tableName':_0xf8a4('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xf8a4('0xc'),'project_name']},{'name':_0xf8a4('0xd'),'fields':[_0xf8a4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index ba1f78f..7215ac8 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 _0x9170=['then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareReport','create','body','options','catch','UpdateSquareReport','SquareReport','update','raw','where','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x9170,0x1a3));var _0x0917=function(_0x55074e,_0x307bdb){_0x55074e=_0x55074e-0x0;var _0x46c714=_0x9170[_0x55074e];return _0x46c714;};'use strict';var _=require(_0x0917('0x0'));var util=require(_0x0917('0x1'));var moment=require(_0x0917('0x2'));var BPromise=require(_0x0917('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0917('0x4'))['db'];var utils=require(_0x0917('0x5'));var logger=require(_0x0917('0x6'))(_0x0917('0x7'));var config=require(_0x0917('0x8'));var jayson=require(_0x0917('0x9'));var client=jayson[_0x0917('0xa')][_0x0917('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c3c47,_0x575f5e,_0x15a889){return new BPromise(function(_0x261ed4,_0x39b5d2){return client[_0x0917('0xc')](_0x1c3c47,_0x15a889)[_0x0917('0xd')](function(_0x32b52b){logger[_0x0917('0xe')](_0x0917('0xf'),_0x575f5e,_0x0917('0x10'));logger[_0x0917('0x11')](_0x0917('0x12'),_0x575f5e,_0x0917('0x10'),JSON[_0x0917('0x13')](_0x32b52b));if(_0x32b52b['error']){if(_0x32b52b[_0x0917('0x14')][_0x0917('0x15')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x575f5e,_0x32b52b[_0x0917('0x14')]['message']);return _0x39b5d2(_0x32b52b[_0x0917('0x14')][_0x0917('0x16')]);}logger[_0x0917('0x14')](_0x0917('0xf'),_0x575f5e,_0x32b52b[_0x0917('0x14')][_0x0917('0x16')]);return _0x261ed4(_0x32b52b[_0x0917('0x14')][_0x0917('0x16')]);}else{logger['info'](_0x0917('0xf'),_0x575f5e,_0x0917('0x10'));_0x261ed4(_0x32b52b[_0x0917('0x17')][_0x0917('0x16')]);}})['catch'](function(_0x4d39fc){logger[_0x0917('0x14')]('SquareReport,\x20%s,\x20%s',_0x575f5e,_0x4d39fc);_0x39b5d2(_0x4d39fc);});});}exports[_0x0917('0x18')]=function(_0x224f18){var _0x27181c=this;return new Promise(function(_0x4ac488,_0x57e168){return db['SquareReport'][_0x0917('0x19')](_0x224f18[_0x0917('0x1a')],{'raw':_0x224f18['options']?_0x224f18[_0x0917('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0917('0xd')](function(_0x191aa9){logger[_0x0917('0xe')](_0x0917('0x18'),_0x224f18);logger[_0x0917('0x11')](_0x0917('0x18'),_0x224f18,JSON[_0x0917('0x13')](_0x191aa9));_0x4ac488(_0x191aa9);})[_0x0917('0x1c')](function(_0x46405d){logger['error'](_0x0917('0x18'),_0x46405d[_0x0917('0x16')],_0x224f18);_0x57e168(_0x27181c[_0x0917('0x14')](0x1f4,_0x46405d[_0x0917('0x16')]));});});};exports[_0x0917('0x1d')]=function(_0x4eb6dd){var _0x5cb043=this;return new Promise(function(_0x53815c,_0x3ccfa1){return db[_0x0917('0x1e')][_0x0917('0x1f')](_0x4eb6dd['body'],{'raw':_0x4eb6dd[_0x0917('0x1b')]?_0x4eb6dd[_0x0917('0x1b')][_0x0917('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eb6dd[_0x0917('0x1b')]?_0x4eb6dd[_0x0917('0x1b')][_0x0917('0x21')]||null:null,'attributes':_0x4eb6dd[_0x0917('0x1b')]?_0x4eb6dd['options'][_0x0917('0x22')]||null:null,'limit':_0x4eb6dd[_0x0917('0x1b')]?_0x4eb6dd[_0x0917('0x1b')][_0x0917('0x23')]||null:null})['then'](function(_0x2812b7){logger['info'](_0x0917('0x1d'),_0x4eb6dd);logger['debug']('UpdateSquareReport',_0x4eb6dd,JSON[_0x0917('0x13')](_0x2812b7));_0x53815c(_0x2812b7);})[_0x0917('0x1c')](function(_0x1bce05){logger[_0x0917('0x14')](_0x0917('0x1d'),_0x1bce05[_0x0917('0x16')],_0x4eb6dd);_0x3ccfa1(_0x5cb043['error'](0x1f4,_0x1bce05['message']));});});}; \ No newline at end of file +var _0xf4ce=['client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SquareReport','options','raw','then','CreateSquareReport','debug','UpdateSquareReport','update','body','where','attributes','limit','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xe7ce7f,_0xc3ae44){var _0x2c6dca=function(_0x246c59){while(--_0x246c59){_0xe7ce7f['push'](_0xe7ce7f['shift']());}};_0x2c6dca(++_0xc3ae44);}(_0xf4ce,0xd8));var _0xef4c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf4ce[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xef4c('0x0'));var util=require(_0xef4c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xef4c('0x2'));var db=require(_0xef4c('0x3'))['db'];var utils=require(_0xef4c('0x4'));var logger=require(_0xef4c('0x5'))(_0xef4c('0x6'));var config=require('../../config/environment');var jayson=require(_0xef4c('0x7'));var client=jayson[_0xef4c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27084b,_0x5bad21,_0x3c9201){return new BPromise(function(_0x39e61d,_0x131a24){return client[_0xef4c('0x9')](_0x27084b,_0x3c9201)['then'](function(_0x26f11f){logger[_0xef4c('0xa')](_0xef4c('0xb'),_0x5bad21,_0xef4c('0xc'));logger['debug'](_0xef4c('0xd'),_0x5bad21,'request\x20sent',JSON[_0xef4c('0xe')](_0x26f11f));if(_0x26f11f[_0xef4c('0xf')]){if(_0x26f11f['error'][_0xef4c('0x10')]===0x1f4){logger[_0xef4c('0xf')]('SquareReport,\x20%s,\x20%s',_0x5bad21,_0x26f11f[_0xef4c('0xf')][_0xef4c('0x11')]);return _0x131a24(_0x26f11f['error'][_0xef4c('0x11')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x5bad21,_0x26f11f[_0xef4c('0xf')]['message']);return _0x39e61d(_0x26f11f[_0xef4c('0xf')][_0xef4c('0x11')]);}else{logger['info'](_0xef4c('0xb'),_0x5bad21,_0xef4c('0xc'));_0x39e61d(_0x26f11f[_0xef4c('0x12')][_0xef4c('0x11')]);}})['catch'](function(_0x23da45){logger[_0xef4c('0xf')](_0xef4c('0xb'),_0x5bad21,_0x23da45);_0x131a24(_0x23da45);});});}exports['CreateSquareReport']=function(_0x159eb5){var _0x421295=this;return new Promise(function(_0x2628f1,_0x3890d1){return db[_0xef4c('0x13')]['create'](_0x159eb5['body'],{'raw':_0x159eb5[_0xef4c('0x14')]?_0x159eb5['options'][_0xef4c('0x15')]===undefined?!![]:![]:!![]})[_0xef4c('0x16')](function(_0x373e9b){logger[_0xef4c('0xa')](_0xef4c('0x17'),_0x159eb5);logger[_0xef4c('0x18')]('CreateSquareReport',_0x159eb5,JSON[_0xef4c('0xe')](_0x373e9b));_0x2628f1(_0x373e9b);})['catch'](function(_0xa70cee){logger['error']('CreateSquareReport',_0xa70cee[_0xef4c('0x11')],_0x159eb5);_0x3890d1(_0x421295[_0xef4c('0xf')](0x1f4,_0xa70cee['message']));});});};exports[_0xef4c('0x19')]=function(_0x760131){var _0x46cd9d=this;return new Promise(function(_0x438cbb,_0x5b8c8b){return db['SquareReport'][_0xef4c('0x1a')](_0x760131[_0xef4c('0x1b')],{'raw':_0x760131[_0xef4c('0x14')]?_0x760131[_0xef4c('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x760131[_0xef4c('0x14')]?_0x760131[_0xef4c('0x14')][_0xef4c('0x1c')]||null:null,'attributes':_0x760131[_0xef4c('0x14')]?_0x760131['options'][_0xef4c('0x1d')]||null:null,'limit':_0x760131[_0xef4c('0x14')]?_0x760131['options'][_0xef4c('0x1e')]||null:null})[_0xef4c('0x16')](function(_0x25ec3f){logger['info'](_0xef4c('0x19'),_0x760131);logger['debug'](_0xef4c('0x19'),_0x760131,JSON[_0xef4c('0xe')](_0x25ec3f));_0x438cbb(_0x25ec3f);})[_0xef4c('0x1f')](function(_0x4416de){logger[_0xef4c('0xf')](_0xef4c('0x19'),_0x4416de['message'],_0x760131);_0x5b8c8b(_0x46cd9d[_0xef4c('0xf')](0x1f4,_0x4416de[_0xef4c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b6bdf0c..bdc8d5d 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 _0x3c36=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','post','create'];(function(_0x3a5d52,_0x8dfc74){var _0x3efc01=function(_0x1dece6){while(--_0x1dece6){_0x3a5d52['push'](_0x3a5d52['shift']());}};_0x3efc01(++_0x8dfc74);}(_0x3c36,0x181));var _0x63c3=function(_0x1fe66c,_0x3ff70b){_0x1fe66c=_0x1fe66c-0x0;var _0x5c4632=_0x3c36[_0x1fe66c];return _0x5c4632;};'use strict';var multer=require(_0x63c3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x63c3('0x1'));var express=require(_0x63c3('0x2'));var router=express[_0x63c3('0x3')]();var fs_extra=require(_0x63c3('0x4'));var auth=require(_0x63c3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x63c3('0x6'));var controller=require(_0x63c3('0x7'));router[_0x63c3('0x8')]('/',auth[_0x63c3('0x9')](),controller[_0x63c3('0xa')]);router['get'](_0x63c3('0xb'),auth[_0x63c3('0x9')](),controller['describe']);router[_0x63c3('0x8')](_0x63c3('0xc'),auth[_0x63c3('0x9')](),controller['show']);router[_0x63c3('0xd')]('/',auth['isAuthenticated'](),controller[_0x63c3('0xe')]);router['put'](_0x63c3('0xc'),auth[_0x63c3('0x9')](),controller['update']);router['delete'](_0x63c3('0xc'),auth[_0x63c3('0x9')](),controller['destroy']);module[_0x63c3('0xf')]=router; \ No newline at end of file +var _0x007e=['./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','show','post','create','update','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x007e,0x1c6));var _0xe007=function(_0x40fa52,_0x43c9de){_0x40fa52=_0x40fa52-0x0;var _0x5ee717=_0x007e[_0x40fa52];return _0x5ee717;};'use strict';var multer=require('multer');var util=require(_0xe007('0x0'));var path=require(_0xe007('0x1'));var timeout=require(_0xe007('0x2'));var express=require(_0xe007('0x3'));var router=express['Router']();var fs_extra=require(_0xe007('0x4'));var auth=require(_0xe007('0x5'));var interaction=require(_0xe007('0x6'));var config=require(_0xe007('0x7'));var controller=require(_0xe007('0x8'));router[_0xe007('0x9')]('/',auth['isAuthenticated'](),controller[_0xe007('0xa')]);router[_0xe007('0x9')](_0xe007('0xb'),auth[_0xe007('0xc')](),controller[_0xe007('0xd')]);router[_0xe007('0x9')]('/:id',auth[_0xe007('0xc')](),controller[_0xe007('0xe')]);router[_0xe007('0xf')]('/',auth[_0xe007('0xc')](),controller[_0xe007('0x10')]);router['put']('/:id',auth[_0xe007('0xc')](),controller[_0xe007('0x11')]);router['delete'](_0xe007('0x12'),auth[_0xe007('0xc')](),controller[_0xe007('0x13')]);module[_0xe007('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 695aa11..8ef5139 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 _0x8aac=['TEXT','sequelize','exports','STRING'];(function(_0x35fb56,_0x5dadff){var _0x2fd52c=function(_0x97bd3f){while(--_0x97bd3f){_0x35fb56['push'](_0x35fb56['shift']());}};_0x2fd52c(++_0x5dadff);}(_0x8aac,0x1e1));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8aa('0x0'));module[_0xc8aa('0x1')]={'uniqueid':{'type':Sequelize[_0xc8aa('0x2')]},'node':{'type':Sequelize[_0xc8aa('0x2')]},'application':{'type':Sequelize[_0xc8aa('0x2')]},'data':{'type':Sequelize[_0xc8aa('0x3')]},'project_name':{'type':Sequelize[_0xc8aa('0x2')]},'callerid':{'type':Sequelize[_0xc8aa('0x2')]}}; \ No newline at end of file +var _0x2ca8=['STRING','TEXT'];(function(_0x3525d7,_0x43616f){var _0x4efe53=function(_0x57f997){while(--_0x57f997){_0x3525d7['push'](_0x3525d7['shift']());}};_0x4efe53(++_0x43616f);}(_0x2ca8,0x1f2));var _0x82ca=function(_0x5e71d2,_0x293b00){_0x5e71d2=_0x5e71d2-0x0;var _0x477de2=_0x2ca8[_0x5e71d2];return _0x477de2;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x82ca('0x0')]},'node':{'type':Sequelize[_0x82ca('0x0')]},'application':{'type':Sequelize[_0x82ca('0x0')]},'data':{'type':Sequelize[_0x82ca('0x1')]},'project_name':{'type':Sequelize[_0x82ca('0x0')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 2d94705..beacc4d 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 _0x1e43=['../../mysqldb','sendStatus','status','end','json','offset','limit','count','save','update','then','destroy','error','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','create','body','find','params','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x128313,_0x50691d){var _0x77a919=function(_0x320065){while(--_0x320065){_0x128313['push'](_0x128313['shift']());}};_0x77a919(++_0x50691d);}(_0x1e43,0x1d1));var _0x31e4=function(_0x592e40,_0x2ed011){_0x592e40=_0x592e40-0x0;var _0x5d4288=_0x1e43[_0x592e40];return _0x5d4288;};'use strict';var emlformat=require(_0x31e4('0x0'));var rimraf=require(_0x31e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x31e4('0x2'));var moment=require(_0x31e4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x31e4('0x4'));var path=require(_0x31e4('0x5'));var sox=require(_0x31e4('0x6'));var csv=require(_0x31e4('0x7'));var ejs=require(_0x31e4('0x8'));var fs=require('fs');var fs_extra=require(_0x31e4('0x9'));var _=require(_0x31e4('0xa'));var squel=require(_0x31e4('0xb'));var crypto=require('crypto');var jsforce=require(_0x31e4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x31e4('0x7'));var querystring=require(_0x31e4('0xd'));var Papa=require(_0x31e4('0xe'));var Redis=require(_0x31e4('0xf'));var authService=require(_0x31e4('0x10'));var qs=require(_0x31e4('0x11'));var as=require(_0x31e4('0x12'));var hardwareService=require(_0x31e4('0x13'));var logger=require(_0x31e4('0x14'))(_0x31e4('0x15'));var utils=require(_0x31e4('0x16'));var config=require(_0x31e4('0x17'));var licenseUtil=require(_0x31e4('0x18'));var db=require(_0x31e4('0x19'))['db'];function respondWithStatusCode(_0x3efa2f,_0x4a25e0){_0x4a25e0=_0x4a25e0||0xcc;return function(_0x508cb9){if(_0x508cb9){return _0x3efa2f[_0x31e4('0x1a')](_0x4a25e0);}return _0x3efa2f[_0x31e4('0x1b')](_0x4a25e0)[_0x31e4('0x1c')]();};}function respondWithResult(_0x231bdb,_0x30fced){_0x30fced=_0x30fced||0xc8;return function(_0x2af530){if(_0x2af530){return _0x231bdb[_0x31e4('0x1b')](_0x30fced)[_0x31e4('0x1d')](_0x2af530);}};}function respondWithFilteredResult(_0x4d32c2,_0x37ac09){return function(_0x5e67a0){if(_0x5e67a0){var _0x2299ab=typeof _0x37ac09[_0x31e4('0x1e')]==='undefined'&&typeof _0x37ac09[_0x31e4('0x1f')]==='undefined';var _0x310135=_0x5e67a0[_0x31e4('0x20')];var _0x2fca3f=_0x2299ab?0x0:_0x37ac09[_0x31e4('0x1e')];var _0x20b8c7=_0x2299ab?_0x5e67a0[_0x31e4('0x20')]:_0x37ac09[_0x31e4('0x1e')]+_0x37ac09[_0x31e4('0x1f')];var _0x88373d;if(_0x20b8c7>=_0x310135){_0x20b8c7=_0x310135;_0x88373d=0xc8;}else{_0x88373d=0xce;}_0x4d32c2['status'](_0x88373d);return _0x4d32c2['set']('Content-Range',_0x2fca3f+'-'+_0x20b8c7+'/'+_0x310135)[_0x31e4('0x1d')](_0x5e67a0);}return null;};}function patchUpdates(_0x1eb228){return function(_0x108049){try{jsonpatch['apply'](_0x108049,_0x1eb228,!![]);}catch(_0x31b458){return BPromise['reject'](_0x31b458);}return _0x108049[_0x31e4('0x21')]();};}function saveUpdates(_0x1ff4c5,_0x133686){return function(_0xecb9a3){if(_0xecb9a3){return _0xecb9a3[_0x31e4('0x22')](_0x1ff4c5)[_0x31e4('0x23')](function(_0x769307){return _0x769307;});}return null;};}function removeEntity(_0x321183,_0x1146ec){return function(_0x924ba8){if(_0x924ba8){return _0x924ba8[_0x31e4('0x24')]()['then'](function(){_0x321183[_0x31e4('0x1b')](0xcc)[_0x31e4('0x1c')]();});}};}function handleEntityNotFound(_0x36c6a9,_0x7f7e18){return function(_0x1da1ec){if(!_0x1da1ec){_0x36c6a9['sendStatus'](0x194);}return _0x1da1ec;};}function handleError(_0x54f71b,_0x234690){_0x234690=_0x234690||0x1f4;return function(_0x926b9c){logger[_0x31e4('0x25')](_0x926b9c['stack']);if(_0x926b9c[_0x31e4('0x26')]){delete _0x926b9c[_0x31e4('0x26')];}_0x54f71b['status'](_0x234690)[_0x31e4('0x27')](_0x926b9c);};}exports['index']=function(_0x3d1ebb,_0x411908){var _0x151321={},_0x10dfec={},_0x1ebb36={'count':0x0,'rows':[]};var _0x32269e=_[_0x31e4('0x28')](db[_0x31e4('0x29')][_0x31e4('0x2a')],function(_0x13ccde){return{'name':_0x13ccde[_0x31e4('0x2b')],'type':_0x13ccde[_0x31e4('0x2c')][_0x31e4('0x2d')]};});_0x10dfec[_0x31e4('0x2e')]=_['map'](_0x32269e,_0x31e4('0x26'));_0x10dfec[_0x31e4('0x2f')]=_[_0x31e4('0x30')](_0x3d1ebb[_0x31e4('0x2f')]);_0x10dfec[_0x31e4('0x31')]=_[_0x31e4('0x32')](_0x10dfec['model'],_0x10dfec['query']);_0x151321[_0x31e4('0x33')]=_[_0x31e4('0x32')](_0x10dfec['model'],qs[_0x31e4('0x34')](_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x34')]));_0x151321[_0x31e4('0x33')]=_0x151321['attributes'][_0x31e4('0x35')]?_0x151321[_0x31e4('0x33')]:_0x10dfec[_0x31e4('0x2e')];if(!_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x36')](_0x31e4('0x37'))){_0x151321[_0x31e4('0x1f')]=qs[_0x31e4('0x1f')](_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x1f')]);_0x151321[_0x31e4('0x1e')]=qs['offset'](_0x3d1ebb[_0x31e4('0x2f')]['offset']);}_0x151321['order']=qs[_0x31e4('0x38')](_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x38')]);_0x151321[_0x31e4('0x39')]=qs['filters'](_['pick'](_0x3d1ebb[_0x31e4('0x2f')],_0x10dfec[_0x31e4('0x31')]),_0x32269e);if(_0x3d1ebb['query']['filter']){_0x151321[_0x31e4('0x39')]=_[_0x31e4('0x3a')](_0x151321[_0x31e4('0x39')],{'$or':_['map'](_0x32269e,function(_0x9577ad){if(_0x9577ad['type']!==_0x31e4('0x3b')){var _0x3fe065={};_0x3fe065[_0x9577ad[_0x31e4('0x26')]]={'$like':'%'+_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x3c')]+'%'};return _0x3fe065;}})});}_0x151321=_[_0x31e4('0x3a')]({},_0x151321,_0x3d1ebb[_0x31e4('0x3d')]);var _0xb0bb82={'where':_0x151321[_0x31e4('0x39')]};return db[_0x31e4('0x29')][_0x31e4('0x20')](_0xb0bb82)[_0x31e4('0x23')](function(_0x10e65a){_0x1ebb36[_0x31e4('0x20')]=_0x10e65a;if(_0x3d1ebb[_0x31e4('0x2f')][_0x31e4('0x3e')]){_0x151321[_0x31e4('0x3f')]=[{'all':!![]}];}return db[_0x31e4('0x29')]['findAll'](_0x151321);})[_0x31e4('0x23')](function(_0x12548f){_0x1ebb36[_0x31e4('0x40')]=_0x12548f;return _0x1ebb36;})[_0x31e4('0x23')](respondWithFilteredResult(_0x411908,_0x151321))[_0x31e4('0x41')](handleError(_0x411908,null));};exports['show']=function(_0x1bcd45,_0xe37ac4){var _0x5d05b6={'raw':!![],'where':{'id':_0x1bcd45['params']['id']}},_0x39ca23={};_0x39ca23['model']=_[_0x31e4('0x30')](db[_0x31e4('0x29')][_0x31e4('0x2a')]);_0x39ca23[_0x31e4('0x2f')]=_[_0x31e4('0x30')](_0x1bcd45[_0x31e4('0x2f')]);_0x39ca23['filters']=_[_0x31e4('0x32')](_0x39ca23[_0x31e4('0x2e')],_0x39ca23[_0x31e4('0x2f')]);_0x5d05b6[_0x31e4('0x33')]=_[_0x31e4('0x32')](_0x39ca23[_0x31e4('0x2e')],qs[_0x31e4('0x34')](_0x1bcd45[_0x31e4('0x2f')][_0x31e4('0x34')]));_0x5d05b6[_0x31e4('0x33')]=_0x5d05b6[_0x31e4('0x33')][_0x31e4('0x35')]?_0x5d05b6[_0x31e4('0x33')]:_0x39ca23[_0x31e4('0x2e')];if(_0x1bcd45['query'][_0x31e4('0x3e')]){_0x5d05b6[_0x31e4('0x3f')]=[{'all':!![]}];}_0x5d05b6=_['merge']({},_0x5d05b6,_0x1bcd45['options']);return db[_0x31e4('0x29')]['find'](_0x5d05b6)[_0x31e4('0x23')](handleEntityNotFound(_0xe37ac4,null))[_0x31e4('0x23')](respondWithResult(_0xe37ac4,null))['catch'](handleError(_0xe37ac4,null));};exports[_0x31e4('0x42')]=function(_0x1c5077,_0xac211){return db[_0x31e4('0x29')]['create'](_0x1c5077[_0x31e4('0x43')],{})[_0x31e4('0x23')](respondWithResult(_0xac211,0xc9))[_0x31e4('0x41')](handleError(_0xac211,null));};exports['update']=function(_0x1e80a4,_0x48bbf2){if(_0x1e80a4[_0x31e4('0x43')]['id']){delete _0x1e80a4[_0x31e4('0x43')]['id'];}return db[_0x31e4('0x29')][_0x31e4('0x44')]({'where':{'id':_0x1e80a4[_0x31e4('0x45')]['id']}})[_0x31e4('0x23')](handleEntityNotFound(_0x48bbf2,null))['then'](saveUpdates(_0x1e80a4['body'],null))[_0x31e4('0x23')](respondWithResult(_0x48bbf2,null))[_0x31e4('0x41')](handleError(_0x48bbf2,null));};exports['destroy']=function(_0x105f46,_0x3127e3){return db[_0x31e4('0x29')][_0x31e4('0x44')]({'where':{'id':_0x105f46[_0x31e4('0x45')]['id']}})['then'](handleEntityNotFound(_0x3127e3,null))['then'](removeEntity(_0x3127e3,null))[_0x31e4('0x41')](handleError(_0x3127e3,null));};exports['describe']=function(_0x45a37a,_0x370bfa){return db[_0x31e4('0x29')]['describe']()[_0x31e4('0x23')](respondWithResult(_0x370bfa,null))[_0x31e4('0x41')](handleError(_0x370bfa,null));}; \ No newline at end of file +var _0xa5a2=['sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','limit','set','Content-Range','apply','reject','update','then','error','stack','name','send','map','SquareDetailsReport','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa5a2,0x121));var _0x2a5a=function(_0x3f7d1b,_0x56cd39){_0x3f7d1b=_0x3f7d1b-0x0;var _0x53578c=_0xa5a2[_0x3f7d1b];return _0x53578c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a5a('0x0'));var zipdir=require(_0x2a5a('0x1'));var jsonpatch=require(_0x2a5a('0x2'));var rp=require('request-promise');var moment=require(_0x2a5a('0x3'));var BPromise=require(_0x2a5a('0x4'));var Mustache=require(_0x2a5a('0x5'));var util=require(_0x2a5a('0x6'));var path=require('path');var sox=require(_0x2a5a('0x7'));var csv=require(_0x2a5a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2a5a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x2a5a('0xa'));var toCsv=require(_0x2a5a('0x8'));var querystring=require(_0x2a5a('0xb'));var Papa=require(_0x2a5a('0xc'));var Redis=require(_0x2a5a('0xd'));var authService=require(_0x2a5a('0xe'));var qs=require(_0x2a5a('0xf'));var as=require(_0x2a5a('0x10'));var hardwareService=require(_0x2a5a('0x11'));var logger=require(_0x2a5a('0x12'))(_0x2a5a('0x13'));var utils=require('../../config/utils');var config=require(_0x2a5a('0x14'));var licenseUtil=require(_0x2a5a('0x15'));var db=require(_0x2a5a('0x16'))['db'];function respondWithStatusCode(_0x2cf443,_0x5f2ef4){_0x5f2ef4=_0x5f2ef4||0xcc;return function(_0xb97c74){if(_0xb97c74){return _0x2cf443[_0x2a5a('0x17')](_0x5f2ef4);}return _0x2cf443[_0x2a5a('0x18')](_0x5f2ef4)[_0x2a5a('0x19')]();};}function respondWithResult(_0x4c862c,_0x468d9e){_0x468d9e=_0x468d9e||0xc8;return function(_0xd6cc20){if(_0xd6cc20){return _0x4c862c['status'](_0x468d9e)[_0x2a5a('0x1a')](_0xd6cc20);}};}function respondWithFilteredResult(_0x358d0b,_0x4c6ff6){return function(_0x154a03){if(_0x154a03){var _0x2c88bc=typeof _0x4c6ff6['offset']===_0x2a5a('0x1b')&&typeof _0x4c6ff6['limit']===_0x2a5a('0x1b');var _0x314332=_0x154a03['count'];var _0x190c55=_0x2c88bc?0x0:_0x4c6ff6['offset'];var _0x396c5e=_0x2c88bc?_0x154a03['count']:_0x4c6ff6[_0x2a5a('0x1c')]+_0x4c6ff6[_0x2a5a('0x1d')];var _0x46541f;if(_0x396c5e>=_0x314332){_0x396c5e=_0x314332;_0x46541f=0xc8;}else{_0x46541f=0xce;}_0x358d0b[_0x2a5a('0x18')](_0x46541f);return _0x358d0b[_0x2a5a('0x1e')](_0x2a5a('0x1f'),_0x190c55+'-'+_0x396c5e+'/'+_0x314332)['json'](_0x154a03);}return null;};}function patchUpdates(_0x1214bf){return function(_0x3a63e8){try{jsonpatch[_0x2a5a('0x20')](_0x3a63e8,_0x1214bf,!![]);}catch(_0x1c3d10){return BPromise[_0x2a5a('0x21')](_0x1c3d10);}return _0x3a63e8['save']();};}function saveUpdates(_0x3df72f,_0x1f687c){return function(_0x2d555c){if(_0x2d555c){return _0x2d555c[_0x2a5a('0x22')](_0x3df72f)[_0x2a5a('0x23')](function(_0x376307){return _0x376307;});}return null;};}function removeEntity(_0x134faa,_0x3f53db){return function(_0x22c21c){if(_0x22c21c){return _0x22c21c['destroy']()[_0x2a5a('0x23')](function(){_0x134faa['status'](0xcc)[_0x2a5a('0x19')]();});}};}function handleEntityNotFound(_0x3eef3d,_0x174fbf){return function(_0x100297){if(!_0x100297){_0x3eef3d[_0x2a5a('0x17')](0x194);}return _0x100297;};}function handleError(_0x3a3b81,_0x2d4c62){_0x2d4c62=_0x2d4c62||0x1f4;return function(_0x379467){logger[_0x2a5a('0x24')](_0x379467[_0x2a5a('0x25')]);if(_0x379467[_0x2a5a('0x26')]){delete _0x379467['name'];}_0x3a3b81['status'](_0x2d4c62)[_0x2a5a('0x27')](_0x379467);};}exports['index']=function(_0x5339f2,_0x1cbbb8){var _0x18a425={},_0x231846={},_0xfc1cd0={'count':0x0,'rows':[]};var _0x531097=_[_0x2a5a('0x28')](db[_0x2a5a('0x29')]['rawAttributes'],function(_0x47911d){return{'name':_0x47911d['fieldName'],'type':_0x47911d[_0x2a5a('0x2a')][_0x2a5a('0x2b')]};});_0x231846[_0x2a5a('0x2c')]=_[_0x2a5a('0x28')](_0x531097,_0x2a5a('0x26'));_0x231846[_0x2a5a('0x2d')]=_[_0x2a5a('0x2e')](_0x5339f2[_0x2a5a('0x2d')]);_0x231846['filters']=_[_0x2a5a('0x2f')](_0x231846['model'],_0x231846[_0x2a5a('0x2d')]);_0x18a425[_0x2a5a('0x30')]=_['intersection'](_0x231846['model'],qs[_0x2a5a('0x31')](_0x5339f2[_0x2a5a('0x2d')][_0x2a5a('0x31')]));_0x18a425[_0x2a5a('0x30')]=_0x18a425[_0x2a5a('0x30')][_0x2a5a('0x32')]?_0x18a425[_0x2a5a('0x30')]:_0x231846[_0x2a5a('0x2c')];if(!_0x5339f2[_0x2a5a('0x2d')]['hasOwnProperty'](_0x2a5a('0x33'))){_0x18a425[_0x2a5a('0x1d')]=qs[_0x2a5a('0x1d')](_0x5339f2[_0x2a5a('0x2d')][_0x2a5a('0x1d')]);_0x18a425[_0x2a5a('0x1c')]=qs[_0x2a5a('0x1c')](_0x5339f2[_0x2a5a('0x2d')][_0x2a5a('0x1c')]);}_0x18a425[_0x2a5a('0x34')]=qs[_0x2a5a('0x35')](_0x5339f2[_0x2a5a('0x2d')][_0x2a5a('0x35')]);_0x18a425['where']=qs[_0x2a5a('0x36')](_[_0x2a5a('0x37')](_0x5339f2[_0x2a5a('0x2d')],_0x231846[_0x2a5a('0x36')]),_0x531097);if(_0x5339f2['query'][_0x2a5a('0x38')]){_0x18a425[_0x2a5a('0x39')]=_[_0x2a5a('0x3a')](_0x18a425[_0x2a5a('0x39')],{'$or':_[_0x2a5a('0x28')](_0x531097,function(_0x217548){if(_0x217548[_0x2a5a('0x2a')]!==_0x2a5a('0x3b')){var _0x577dee={};_0x577dee[_0x217548[_0x2a5a('0x26')]]={'$like':'%'+_0x5339f2['query']['filter']+'%'};return _0x577dee;}})});}_0x18a425=_[_0x2a5a('0x3a')]({},_0x18a425,_0x5339f2[_0x2a5a('0x3c')]);var _0x48cf5e={'where':_0x18a425['where']};return db[_0x2a5a('0x29')][_0x2a5a('0x3d')](_0x48cf5e)[_0x2a5a('0x23')](function(_0x35ffff){_0xfc1cd0[_0x2a5a('0x3d')]=_0x35ffff;if(_0x5339f2[_0x2a5a('0x2d')][_0x2a5a('0x3e')]){_0x18a425[_0x2a5a('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x2a5a('0x40')](_0x18a425);})[_0x2a5a('0x23')](function(_0x4d4a0c){_0xfc1cd0[_0x2a5a('0x41')]=_0x4d4a0c;return _0xfc1cd0;})[_0x2a5a('0x23')](respondWithFilteredResult(_0x1cbbb8,_0x18a425))[_0x2a5a('0x42')](handleError(_0x1cbbb8,null));};exports[_0x2a5a('0x43')]=function(_0x422ad8,_0x398963){var _0x5bbdab={'raw':!![],'where':{'id':_0x422ad8[_0x2a5a('0x44')]['id']}},_0x146185={};_0x146185[_0x2a5a('0x2c')]=_[_0x2a5a('0x2e')](db[_0x2a5a('0x29')][_0x2a5a('0x45')]);_0x146185[_0x2a5a('0x2d')]=_['keys'](_0x422ad8[_0x2a5a('0x2d')]);_0x146185[_0x2a5a('0x36')]=_[_0x2a5a('0x2f')](_0x146185[_0x2a5a('0x2c')],_0x146185[_0x2a5a('0x2d')]);_0x5bbdab[_0x2a5a('0x30')]=_[_0x2a5a('0x2f')](_0x146185[_0x2a5a('0x2c')],qs[_0x2a5a('0x31')](_0x422ad8['query'][_0x2a5a('0x31')]));_0x5bbdab[_0x2a5a('0x30')]=_0x5bbdab[_0x2a5a('0x30')][_0x2a5a('0x32')]?_0x5bbdab['attributes']:_0x146185['model'];if(_0x422ad8[_0x2a5a('0x2d')]['includeAll']){_0x5bbdab[_0x2a5a('0x3f')]=[{'all':!![]}];}_0x5bbdab=_[_0x2a5a('0x3a')]({},_0x5bbdab,_0x422ad8[_0x2a5a('0x3c')]);return db[_0x2a5a('0x29')][_0x2a5a('0x46')](_0x5bbdab)[_0x2a5a('0x23')](handleEntityNotFound(_0x398963,null))[_0x2a5a('0x23')](respondWithResult(_0x398963,null))[_0x2a5a('0x42')](handleError(_0x398963,null));};exports[_0x2a5a('0x47')]=function(_0x4421c9,_0xfb360c){return db['SquareDetailsReport'][_0x2a5a('0x47')](_0x4421c9['body'],{})[_0x2a5a('0x23')](respondWithResult(_0xfb360c,0xc9))['catch'](handleError(_0xfb360c,null));};exports[_0x2a5a('0x22')]=function(_0x3e4828,_0x664bd5){if(_0x3e4828[_0x2a5a('0x48')]['id']){delete _0x3e4828[_0x2a5a('0x48')]['id'];}return db['SquareDetailsReport'][_0x2a5a('0x46')]({'where':{'id':_0x3e4828[_0x2a5a('0x44')]['id']}})[_0x2a5a('0x23')](handleEntityNotFound(_0x664bd5,null))[_0x2a5a('0x23')](saveUpdates(_0x3e4828[_0x2a5a('0x48')],null))[_0x2a5a('0x23')](respondWithResult(_0x664bd5,null))[_0x2a5a('0x42')](handleError(_0x664bd5,null));};exports['destroy']=function(_0x207179,_0x167235){return db[_0x2a5a('0x29')][_0x2a5a('0x46')]({'where':{'id':_0x207179[_0x2a5a('0x44')]['id']}})[_0x2a5a('0x23')](handleEntityNotFound(_0x167235,null))[_0x2a5a('0x23')](removeEntity(_0x167235,null))[_0x2a5a('0x42')](handleError(_0x167235,null));};exports[_0x2a5a('0x49')]=function(_0x18f05d,_0x14dc2b){return db['SquareDetailsReport'][_0x2a5a('0x49')]()['then'](respondWithResult(_0x14dc2b,null))[_0x2a5a('0x42')](handleError(_0x14dc2b,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 1480ec1..e10bea9 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 _0xa0e6=['request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','bluebird'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa0e6,0xa2));var _0x6a0e=function(_0x38bc73,_0x15d23b){_0x38bc73=_0x38bc73-0x0;var _0x39029c=_0xa0e6[_0x38bc73];return _0x39029c;};'use strict';var _=require(_0x6a0e('0x0'));var util=require('util');var logger=require(_0x6a0e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6a0e('0x2'));var rp=require(_0x6a0e('0x3'));var fs=require('fs');var path=require(_0x6a0e('0x4'));var rimraf=require(_0x6a0e('0x5'));var config=require(_0x6a0e('0x6'));var attributes=require(_0x6a0e('0x7'));module['exports']=function(_0xa88ef,_0x1cca8d){return _0xa88ef[_0x6a0e('0x8')](_0x6a0e('0x9'),attributes,{'tableName':_0x6a0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2a8=['../../config/logger','api','moment','path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','util'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd2a8,0x1f3));var _0x8d2a=function(_0x1564c8,_0x2a0c9b){_0x1564c8=_0x1564c8-0x0;var _0x4a6252=_0xd2a8[_0x1564c8];return _0x4a6252;};'use strict';var _=require('lodash');var util=require(_0x8d2a('0x0'));var logger=require(_0x8d2a('0x1'))(_0x8d2a('0x2'));var moment=require(_0x8d2a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d2a('0x4'));var rimraf=require(_0x8d2a('0x5'));var config=require('../../config/environment');var attributes=require(_0x8d2a('0x6'));module[_0x8d2a('0x7')]=function(_0x11d28d,_0x123d8e){return _0x11d28d[_0x8d2a('0x8')](_0x8d2a('0x9'),attributes,{'tableName':'report_square_details','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 3104c54..be56501 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 _0x536f=['../../config/utils','../../config/logger','../../config/environment','client','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','CreateSquareDetailsReport','SquareDetailsReport','create','options','debug','catch','lodash','ioredis','../../mysqldb'];(function(_0x5d7de9,_0x5c2549){var _0x464f90=function(_0x4ffe83){while(--_0x4ffe83){_0x5d7de9['push'](_0x5d7de9['shift']());}};_0x464f90(++_0x5c2549);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf536('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf536('0x1'));var db=require(_0xf536('0x2'))['db'];var utils=require(_0xf536('0x3'));var logger=require(_0xf536('0x4'))('rpc');var config=require(_0xf536('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf536('0x6')][_0xf536('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2fc517,_0x486ee3,_0x5952b7){return new BPromise(function(_0x3b5191,_0x422541){return client[_0xf536('0x8')](_0x2fc517,_0x5952b7)[_0xf536('0x9')](function(_0x4f2eaf){logger['info'](_0xf536('0xa'),_0x486ee3,_0xf536('0xb'));logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x486ee3,_0xf536('0xb'),JSON[_0xf536('0xc')](_0x4f2eaf));if(_0x4f2eaf[_0xf536('0xd')]){if(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xe')]===0x1f4){logger['error'](_0xf536('0xa'),_0x486ee3,_0x4f2eaf['error'][_0xf536('0xf')]);return _0x422541(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);}logger[_0xf536('0xd')](_0xf536('0xa'),_0x486ee3,_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);return _0x3b5191(_0x4f2eaf[_0xf536('0xd')][_0xf536('0xf')]);}else{logger[_0xf536('0x10')](_0xf536('0xa'),_0x486ee3,_0xf536('0xb'));_0x3b5191(_0x4f2eaf['result'][_0xf536('0xf')]);}})['catch'](function(_0x238b9d){logger['error'](_0xf536('0xa'),_0x486ee3,_0x238b9d);_0x422541(_0x238b9d);});});}exports[_0xf536('0x11')]=function(_0xbca324){var _0x19756b=this;return new Promise(function(_0x4532a0,_0x189334){return db[_0xf536('0x12')][_0xf536('0x13')](_0xbca324['body'],{'raw':_0xbca324[_0xf536('0x14')]?_0xbca324[_0xf536('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x466f95){logger[_0xf536('0x10')](_0xf536('0x11'),_0xbca324);logger[_0xf536('0x15')](_0xf536('0x11'),_0xbca324,JSON[_0xf536('0xc')](_0x466f95));_0x4532a0(_0x466f95);})[_0xf536('0x16')](function(_0xe1d6a8){logger[_0xf536('0xd')](_0xf536('0x11'),_0xe1d6a8['message'],_0xbca324);_0x189334(_0x19756b[_0xf536('0xd')](0x1f4,_0xe1d6a8[_0xf536('0xf')]));});});}; \ No newline at end of file +var _0xd237=['info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd237,0x14f));var _0x7d23=function(_0x58d937,_0x3550de){_0x58d937=_0x58d937-0x0;var _0x445496=_0xd237[_0x58d937];return _0x445496;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});}exports[_0x7d23('0x17')]=function(_0x506a3b){var _0x313471=this;return new Promise(function(_0x3d6a7b,_0x49ce32){return db[_0x7d23('0x18')][_0x7d23('0x19')](_0x506a3b[_0x7d23('0x1a')],{'raw':_0x506a3b['options']?_0x506a3b['options'][_0x7d23('0x1b')]===undefined?!![]:![]:!![]})[_0x7d23('0xc')](function(_0x56b0ba){logger[_0x7d23('0xd')]('CreateSquareDetailsReport',_0x506a3b);logger[_0x7d23('0xf')]('CreateSquareDetailsReport',_0x506a3b,JSON[_0x7d23('0x1c')](_0x56b0ba));_0x3d6a7b(_0x56b0ba);})[_0x7d23('0x16')](function(_0x59522b){logger[_0x7d23('0x12')](_0x7d23('0x17'),_0x59522b[_0x7d23('0x14')],_0x506a3b);_0x49ce32(_0x313471['error'](0x1f4,_0x59522b[_0x7d23('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index fdd7d5a..e2a3e11 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 _0x3023=['get','/process/:pid/kill','exports','express','Router','../../components/auth/service','isAuthenticated','index'];(function(_0x48777e,_0x4f2067){var _0x496f73=function(_0x41c814){while(--_0x41c814){_0x48777e['push'](_0x48777e['shift']());}};_0x496f73(++_0x4f2067);}(_0x3023,0xe3));var _0x3302=function(_0x13963b,_0x522396){_0x13963b=_0x13963b-0x0;var _0x36ee75=_0x3023[_0x13963b];return _0x36ee75;};'use strict';var express=require(_0x3302('0x0'));var router=express[_0x3302('0x1')]();var auth=require(_0x3302('0x2'));var controller=require('./system.controller');router['get']('/',auth[_0x3302('0x3')](),controller[_0x3302('0x4')]);router[_0x3302('0x5')](_0x3302('0x6'),auth[_0x3302('0x3')](),controller['killProcess']);module[_0x3302('0x7')]=router; \ No newline at end of file +var _0x36b4=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x8b4aaa,_0xac342){var _0x38b4c5=function(_0x1de6dc){while(--_0x1de6dc){_0x8b4aaa['push'](_0x8b4aaa['shift']());}};_0x38b4c5(++_0xac342);}(_0x36b4,0xbc));var _0x436b=function(_0x4d8a7a,_0x1c277e){_0x4d8a7a=_0x4d8a7a-0x0;var _0x10492a=_0x36b4[_0x4d8a7a];return _0x10492a;};'use strict';var express=require(_0x436b('0x0'));var router=express[_0x436b('0x1')]();var auth=require(_0x436b('0x2'));var controller=require(_0x436b('0x3'));router[_0x436b('0x4')]('/',auth[_0x436b('0x5')](),controller[_0x436b('0x6')]);router['get'](_0x436b('0x7'),auth[_0x436b('0x5')](),controller[_0x436b('0x8')]);module[_0x436b('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index bd62caf..9f38673 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 _0x8389=['exec','../../config/logger','api','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process'];(function(_0x1e2866,_0xb1ddc3){var _0x16fcf4=function(_0x3f3cf4){while(--_0x3f3cf4){_0x1e2866['push'](_0x1e2866['shift']());}};_0x16fcf4(++_0xb1ddc3);}(_0x8389,0x14e));var _0x9838=function(_0xafc1d1,_0x56b26f){_0xafc1d1=_0xafc1d1-0x0;var _0x3e9a55=_0x8389[_0xafc1d1];return _0x3e9a55;};'use strict';var info=require(_0x9838('0x0'));var exec=require(_0x9838('0x1'))[_0x9838('0x2')];var logger=require(_0x9838('0x3'))(_0x9838('0x4'));var util=require(_0x9838('0x5'));var BPromise=require(_0x9838('0x6'));var _=require('lodash');function handleError(_0x95ea1b,_0xdb9699,_0x460b0d){_0xdb9699=_0xdb9699||0x1f4;return function(_0x3bb501){logger[_0x9838('0x7')](_0x9838('0x8'),_0x460b0d,_0xdb9699,util[_0x9838('0x9')](_0x3bb501,{'showHidden':![],'depth':null}));delete _0x3bb501['name'];_0x95ea1b[_0x9838('0xa')](_0xdb9699)['send'](_0x3bb501);};}exports[_0x9838('0xb')]=function(_0x1f29e5,_0x23cadf){return info[_0x9838('0xc')]()[_0x9838('0xd')](function(_0x279bbb){return _0x23cadf[_0x9838('0xa')](0xc8)[_0x9838('0xe')](_0x279bbb);})[_0x9838('0xf')](function(_0x50b9ea){return _0x23cadf['status'](0x1f4)['json'](_0x50b9ea);});};exports[_0x9838('0x10')]=function(_0x286484,_0x34b46f){var _0x1dbb9b=[_0x9838('0x11')];return new BPromise(function(_0x3ff484,_0x371ff3){return exec(util[_0x9838('0x12')](_0x9838('0x13'),_0x286484[_0x9838('0x14')]['pid']),function(_0x360028,_0x3a0437,_0x4a77d8){if(_0x360028){return _0x371ff3(_0x360028);}return _0x3ff484(_0x3a0437);});})[_0x9838('0xd')](function(_0x44e8b9){var _0x55bfbf=![];var _0x4c87ad=_0x44e8b9[_0x9838('0x15')](/\n/);for(var _0x4b1f50=0x0,_0x59f0e2=_0x1dbb9b[_0x9838('0x16')];_0x4b1f50<_0x59f0e2,_0x55bfbf===![];_0x4b1f50+=0x1){if(_0x44e8b9['indexOf'](_0x1dbb9b[_0x4b1f50])>=0x0){_0x55bfbf=!![];}}if(!_0x55bfbf){throw new Error(util['format'](_0x9838('0x17'),_0x286484[_0x9838('0x14')][_0x9838('0x18')]));}process[_0x9838('0x19')](_0x286484[_0x9838('0x14')][_0x9838('0x18')],_0x9838('0x1a'));return _0x34b46f[_0x9838('0xa')](0xc8)[_0x9838('0xe')]({'message':util[_0x9838('0x12')](_0x9838('0x1b'),_0x286484[_0x9838('0x14')][_0x9838('0x18')])});})['catch'](handleError(_0x34b46f,null,'killProcess'));}; \ No newline at end of file +var _0x209a=['../../config/logger','api','util','lodash','error','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process'];(function(_0x4c4158,_0x123def){var _0x48adcd=function(_0x14bf11){while(--_0x14bf11){_0x4c4158['push'](_0x4c4158['shift']());}};_0x48adcd(++_0x123def);}(_0x209a,0x1da));var _0xa209=function(_0x780968,_0x17a1dc){_0x780968=_0x780968-0x0;var _0x3de199=_0x209a[_0x780968];return _0x3de199;};'use strict';var info=require(_0xa209('0x0'));var exec=require(_0xa209('0x1'))['exec'];var logger=require(_0xa209('0x2'))(_0xa209('0x3'));var util=require(_0xa209('0x4'));var BPromise=require('bluebird');var _=require(_0xa209('0x5'));function handleError(_0x1d4aa0,_0x4fbf2e,_0x4346cf){_0x4fbf2e=_0x4fbf2e||0x1f4;return function(_0x168eca){logger[_0xa209('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4346cf,_0x4fbf2e,util[_0xa209('0x7')](_0x168eca,{'showHidden':![],'depth':null}));delete _0x168eca[_0xa209('0x8')];_0x1d4aa0[_0xa209('0x9')](_0x4fbf2e)[_0xa209('0xa')](_0x168eca);};}exports[_0xa209('0xb')]=function(_0x2b3c76,_0x137720){return info[_0xa209('0xc')]()[_0xa209('0xd')](function(_0x4d4ca9){return _0x137720[_0xa209('0x9')](0xc8)[_0xa209('0xe')](_0x4d4ca9);})[_0xa209('0xf')](function(_0x5cd883){return _0x137720[_0xa209('0x9')](0x1f4)[_0xa209('0xe')](_0x5cd883);});};exports[_0xa209('0x10')]=function(_0x48bf89,_0x4746cd){var _0x56edd4=[_0xa209('0x11')];return new BPromise(function(_0x1f67ad,_0x556a70){return exec(util[_0xa209('0x12')](_0xa209('0x13'),_0x48bf89[_0xa209('0x14')][_0xa209('0x15')]),function(_0x123f8a,_0x5506dd,_0x4d21de){if(_0x123f8a){return _0x556a70(_0x123f8a);}return _0x1f67ad(_0x5506dd);});})[_0xa209('0xd')](function(_0x485143){var _0x59b53e=![];var _0xb6e48e=_0x485143[_0xa209('0x16')](/\n/);for(var _0xcbef7d=0x0,_0x1cfb6c=_0x56edd4[_0xa209('0x17')];_0xcbef7d<_0x1cfb6c,_0x59b53e===![];_0xcbef7d+=0x1){if(_0x485143[_0xa209('0x18')](_0x56edd4[_0xcbef7d])>=0x0){_0x59b53e=!![];}}if(!_0x59b53e){throw new Error(util[_0xa209('0x12')](_0xa209('0x19'),_0x48bf89[_0xa209('0x14')][_0xa209('0x15')]));}process['kill'](_0x48bf89['params'][_0xa209('0x15')],_0xa209('0x1a'));return _0x4746cd[_0xa209('0x9')](0xc8)[_0xa209('0xe')]({'message':util[_0xa209('0x12')](_0xa209('0x1b'),_0x48bf89['params'][_0xa209('0x15')])});})[_0xa209('0xf')](handleError(_0x4746cd,null,_0xa209('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index c0b1be4..7d57f62 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 _0x48fa=['show','post','create','put','/:id','update','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48fa,0x127));var _0xa48f=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x48fa[_0x4a53d];return _0x27410e;};'use strict';var multer=require(_0xa48f('0x0'));var util=require(_0xa48f('0x1'));var path=require(_0xa48f('0x2'));var timeout=require(_0xa48f('0x3'));var express=require(_0xa48f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa48f('0x5'));var config=require(_0xa48f('0x6'));var controller=require(_0xa48f('0x7'));router['get']('/',auth[_0xa48f('0x8')](),controller[_0xa48f('0x9')]);router[_0xa48f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xa48f('0xb')]);router[_0xa48f('0xc')]('/',auth['isAuthenticated'](),controller[_0xa48f('0xd')]);router[_0xa48f('0xe')](_0xa48f('0xf'),auth[_0xa48f('0x8')](),controller[_0xa48f('0x10')]);router['delete'](_0xa48f('0xf'),auth[_0xa48f('0x8')](),controller[_0xa48f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2a84=['../../config/environment','./tag.controller','get','index','/:id','isAuthenticated','post','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x46ba25,_0x4de47f){var _0x3a00c7=function(_0xcd6eda){while(--_0xcd6eda){_0x46ba25['push'](_0x46ba25['shift']());}};_0x3a00c7(++_0x4de47f);}(_0x2a84,0x170));var _0x42a8=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2a84[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x42a8('0x0'));var util=require(_0x42a8('0x1'));var path=require('path');var timeout=require(_0x42a8('0x2'));var express=require(_0x42a8('0x3'));var router=express[_0x42a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x42a8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42a8('0x6'));var controller=require(_0x42a8('0x7'));router[_0x42a8('0x8')]('/',auth['isAuthenticated'](),controller[_0x42a8('0x9')]);router['get'](_0x42a8('0xa'),auth[_0x42a8('0xb')](),controller['show']);router[_0x42a8('0xc')]('/',auth[_0x42a8('0xb')](),controller['create']);router[_0x42a8('0xd')](_0x42a8('0xa'),auth['isAuthenticated'](),controller[_0x42a8('0xe')]);router[_0x42a8('0xf')](_0x42a8('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x42a8('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 36b0d7e..9b636e1 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 _0x7d25=['name','#0091EA','exports','STRING'];(function(_0x4dfcfe,_0x3a8926){var _0x3dcad5=function(_0x1b1471){while(--_0x1b1471){_0x4dfcfe['push'](_0x4dfcfe['shift']());}};_0x3dcad5(++_0x3a8926);}(_0x7d25,0x8a));var _0x57d2=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x7d25[_0x556927];return _0x5f1235;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'name':{'type':Sequelize[_0x57d2('0x1')],'unique':_0x57d2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x57d2('0x1')],'defaultValue':_0x57d2('0x3')},'description':{'type':Sequelize[_0x57d2('0x1')]}}; \ No newline at end of file +var _0xb350=['#0091EA','sequelize','exports','STRING','name'];(function(_0x14fe62,_0x59b270){var _0x477655=function(_0x36cc8f){while(--_0x36cc8f){_0x14fe62['push'](_0x14fe62['shift']());}};_0x477655(++_0x59b270);}(_0xb350,0x6f));var _0x0b35=function(_0x559335,_0x3f211b){_0x559335=_0x559335-0x0;var _0x44f033=_0xb350[_0x559335];return _0x44f033;};'use strict';var Sequelize=require(_0x0b35('0x0'));module[_0x0b35('0x1')]={'name':{'type':Sequelize[_0x0b35('0x2')],'unique':_0x0b35('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x0b35('0x4')},'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 fcaebaa..19d4510 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 _0xb821=['create','body','user','get','role','Tags','find','catch','update','rimraf','zip-dir','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','include','findAll','show','params','keys','includeAll','options'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb821,0xa7));var _0x1b82=function(_0x391730,_0x3f5410){_0x391730=_0x391730-0x0;var _0x408dfe=_0xb821[_0x391730];return _0x408dfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b82('0x0'));var zipdir=require(_0x1b82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1b82('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1b82('0x3'));var path=require(_0x1b82('0x4'));var sox=require(_0x1b82('0x5'));var csv=require(_0x1b82('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b82('0x7'));var _=require(_0x1b82('0x8'));var squel=require(_0x1b82('0x9'));var crypto=require(_0x1b82('0xa'));var jsforce=require(_0x1b82('0xb'));var deskjs=require(_0x1b82('0xc'));var toCsv=require(_0x1b82('0x6'));var querystring=require(_0x1b82('0xd'));var Papa=require(_0x1b82('0xe'));var Redis=require('ioredis');var authService=require(_0x1b82('0xf'));var qs=require(_0x1b82('0x10'));var as=require(_0x1b82('0x11'));var hardwareService=require(_0x1b82('0x12'));var logger=require(_0x1b82('0x13'))(_0x1b82('0x14'));var utils=require(_0x1b82('0x15'));var config=require(_0x1b82('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b82('0x17'))['db'];function respondWithStatusCode(_0x241d11,_0x2391f5){_0x2391f5=_0x2391f5||0xcc;return function(_0x61b6eb){if(_0x61b6eb){return _0x241d11['sendStatus'](_0x2391f5);}return _0x241d11[_0x1b82('0x18')](_0x2391f5)['end']();};}function respondWithResult(_0x54915f,_0x1e553a){_0x1e553a=_0x1e553a||0xc8;return function(_0x4bf75b){if(_0x4bf75b){return _0x54915f[_0x1b82('0x18')](_0x1e553a)[_0x1b82('0x19')](_0x4bf75b);}};}function respondWithFilteredResult(_0x5d4cf1,_0x46c2cf){return function(_0x5dab7d){if(_0x5dab7d){var _0x563261=typeof _0x46c2cf[_0x1b82('0x1a')]==='undefined'&&typeof _0x46c2cf[_0x1b82('0x1b')]===_0x1b82('0x1c');var _0xf42818=_0x5dab7d['count'];var _0x514082=_0x563261?0x0:_0x46c2cf[_0x1b82('0x1a')];var _0x5d66c3=_0x563261?_0x5dab7d[_0x1b82('0x1d')]:_0x46c2cf[_0x1b82('0x1a')]+_0x46c2cf[_0x1b82('0x1b')];var _0x594a63;if(_0x5d66c3>=_0xf42818){_0x5d66c3=_0xf42818;_0x594a63=0xc8;}else{_0x594a63=0xce;}_0x5d4cf1[_0x1b82('0x18')](_0x594a63);return _0x5d4cf1[_0x1b82('0x1e')](_0x1b82('0x1f'),_0x514082+'-'+_0x5d66c3+'/'+_0xf42818)[_0x1b82('0x19')](_0x5dab7d);}return null;};}function patchUpdates(_0x10d45c){return function(_0x47e99b){try{jsonpatch[_0x1b82('0x20')](_0x47e99b,_0x10d45c,!![]);}catch(_0x1892b0){return BPromise[_0x1b82('0x21')](_0x1892b0);}return _0x47e99b[_0x1b82('0x22')]();};}function saveUpdates(_0x26e481,_0x31fd64){return function(_0x2d07f4){if(_0x2d07f4){return _0x2d07f4['update'](_0x26e481)[_0x1b82('0x23')](function(_0x233740){return _0x233740;});}return null;};}function removeEntity(_0x5b8d09,_0x561d78){return function(_0x225b81){if(_0x225b81){return _0x225b81[_0x1b82('0x24')]()['then'](function(){var _0x3a1226=_0x225b81['get']({'plain':!![]});var _0x5cd458='Tags';return db[_0x1b82('0x25')][_0x1b82('0x24')]({'where':{'type':_0x5cd458,'resourceId':_0x3a1226['id']}})[_0x1b82('0x23')](function(){return _0x225b81;});})[_0x1b82('0x23')](function(){_0x5b8d09['status'](0xcc)[_0x1b82('0x26')]();});}};}function handleEntityNotFound(_0x165b45,_0x1b5260){return function(_0x7455e8){if(!_0x7455e8){_0x165b45[_0x1b82('0x27')](0x194);}return _0x7455e8;};}function handleError(_0x1b8b6f,_0x223b6a){_0x223b6a=_0x223b6a||0x1f4;return function(_0x21ea34){logger[_0x1b82('0x28')](_0x21ea34[_0x1b82('0x29')]);if(_0x21ea34[_0x1b82('0x2a')]){delete _0x21ea34[_0x1b82('0x2a')];}_0x1b8b6f[_0x1b82('0x18')](_0x223b6a)['send'](_0x21ea34);};}exports[_0x1b82('0x2b')]=function(_0x2931d0,_0x155a34){var _0x457dbb={},_0x18e4ff={},_0x115ce7={'count':0x0,'rows':[]};var _0xd3c4a=_[_0x1b82('0x2c')](db[_0x1b82('0x2d')][_0x1b82('0x2e')],function(_0x501ab0){return{'name':_0x501ab0[_0x1b82('0x2f')],'type':_0x501ab0[_0x1b82('0x30')][_0x1b82('0x31')]};});_0x18e4ff[_0x1b82('0x32')]=_['map'](_0xd3c4a,_0x1b82('0x2a'));_0x18e4ff[_0x1b82('0x33')]=_['keys'](_0x2931d0[_0x1b82('0x33')]);_0x18e4ff[_0x1b82('0x34')]=_[_0x1b82('0x35')](_0x18e4ff['model'],_0x18e4ff['query']);_0x457dbb[_0x1b82('0x36')]=_['intersection'](_0x18e4ff['model'],qs[_0x1b82('0x37')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x37')]));_0x457dbb['attributes']=_0x457dbb[_0x1b82('0x36')][_0x1b82('0x38')]?_0x457dbb[_0x1b82('0x36')]:_0x18e4ff[_0x1b82('0x32')];if(!_0x2931d0['query'][_0x1b82('0x39')](_0x1b82('0x3a'))){_0x457dbb[_0x1b82('0x1b')]=qs['limit'](_0x2931d0['query'][_0x1b82('0x1b')]);_0x457dbb['offset']=qs[_0x1b82('0x1a')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x1a')]);}_0x457dbb[_0x1b82('0x3b')]=qs[_0x1b82('0x3c')](_0x2931d0[_0x1b82('0x33')][_0x1b82('0x3c')]);_0x457dbb[_0x1b82('0x3d')]=qs['filters'](_['pick'](_0x2931d0[_0x1b82('0x33')],_0x18e4ff['filters']),_0xd3c4a);if(_0x2931d0[_0x1b82('0x33')]['filter']){_0x457dbb[_0x1b82('0x3d')]=_[_0x1b82('0x3e')](_0x457dbb[_0x1b82('0x3d')],{'$or':_[_0x1b82('0x2c')](_0xd3c4a,function(_0x2af0bd){if(_0x2af0bd[_0x1b82('0x30')]!=='VIRTUAL'){var _0x17d214={};_0x17d214[_0x2af0bd['name']]={'$like':'%'+_0x2931d0[_0x1b82('0x33')]['filter']+'%'};return _0x17d214;}})});}_0x457dbb=_[_0x1b82('0x3e')]({},_0x457dbb,_0x2931d0['options']);var _0x5aeac1={'where':_0x457dbb[_0x1b82('0x3d')]};return db[_0x1b82('0x2d')][_0x1b82('0x1d')](_0x5aeac1)[_0x1b82('0x23')](function(_0x3eb429){_0x115ce7['count']=_0x3eb429;if(_0x2931d0[_0x1b82('0x33')]['includeAll']){_0x457dbb[_0x1b82('0x3f')]=[{'all':!![]}];}return db[_0x1b82('0x2d')][_0x1b82('0x40')](_0x457dbb);})[_0x1b82('0x23')](function(_0x365ab4){_0x115ce7['rows']=_0x365ab4;return _0x115ce7;})[_0x1b82('0x23')](respondWithFilteredResult(_0x155a34,_0x457dbb))['catch'](handleError(_0x155a34,null));};exports[_0x1b82('0x41')]=function(_0x14b3ab,_0x5a50ba){var _0xa88eb2={'raw':!![],'where':{'id':_0x14b3ab[_0x1b82('0x42')]['id']}},_0x225f6b={};_0x225f6b[_0x1b82('0x32')]=_[_0x1b82('0x43')](db[_0x1b82('0x2d')][_0x1b82('0x2e')]);_0x225f6b['query']=_[_0x1b82('0x43')](_0x14b3ab['query']);_0x225f6b[_0x1b82('0x34')]=_[_0x1b82('0x35')](_0x225f6b[_0x1b82('0x32')],_0x225f6b[_0x1b82('0x33')]);_0xa88eb2[_0x1b82('0x36')]=_[_0x1b82('0x35')](_0x225f6b[_0x1b82('0x32')],qs[_0x1b82('0x37')](_0x14b3ab[_0x1b82('0x33')][_0x1b82('0x37')]));_0xa88eb2[_0x1b82('0x36')]=_0xa88eb2[_0x1b82('0x36')][_0x1b82('0x38')]?_0xa88eb2[_0x1b82('0x36')]:_0x225f6b['model'];if(_0x14b3ab['query'][_0x1b82('0x44')]){_0xa88eb2['include']=[{'all':!![]}];}_0xa88eb2=_[_0x1b82('0x3e')]({},_0xa88eb2,_0x14b3ab[_0x1b82('0x45')]);return db[_0x1b82('0x2d')]['find'](_0xa88eb2)[_0x1b82('0x23')](handleEntityNotFound(_0x5a50ba,null))['then'](respondWithResult(_0x5a50ba,null))['catch'](handleError(_0x5a50ba,null));};exports[_0x1b82('0x46')]=function(_0x2aadf7,_0x242324){return db['Tag'][_0x1b82('0x46')](_0x2aadf7[_0x1b82('0x47')],{})['then'](function(_0x5ca898){var _0x106282=_0x2aadf7[_0x1b82('0x48')][_0x1b82('0x49')]({'plain':!![]});if(!_0x106282)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x106282[_0x1b82('0x4a')]===_0x1b82('0x48')){var _0x31fb5d=_0x5ca898[_0x1b82('0x49')]({'plain':!![]});var _0xbba448=_0x1b82('0x4b');return db['UserProfileSection'][_0x1b82('0x4c')]({'where':{'name':_0xbba448,'userProfileId':_0x106282['userProfileId']},'raw':!![]})[_0x1b82('0x23')](function(_0x247cb7){if(_0x247cb7&&_0x247cb7['autoAssociation']===0x0){return db[_0x1b82('0x25')]['create']({'name':_0x31fb5d[_0x1b82('0x2a')],'resourceId':_0x31fb5d['id'],'type':_0x247cb7[_0x1b82('0x2a')],'sectionId':_0x247cb7['id']},{})[_0x1b82('0x23')](function(){return _0x5ca898;});}else{return _0x5ca898;}})[_0x1b82('0x4d')](function(_0xd46842){logger[_0x1b82('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd46842);throw _0xd46842;});}return _0x5ca898;})['then'](respondWithResult(_0x242324,0xc9))[_0x1b82('0x4d')](handleError(_0x242324,null));};exports[_0x1b82('0x4e')]=function(_0x1b9e81,_0x26c1ec){if(_0x1b9e81[_0x1b82('0x47')]['id']){delete _0x1b9e81[_0x1b82('0x47')]['id'];}return db[_0x1b82('0x2d')][_0x1b82('0x4c')]({'where':{'id':_0x1b9e81['params']['id']}})['then'](handleEntityNotFound(_0x26c1ec,null))['then'](saveUpdates(_0x1b9e81[_0x1b82('0x47')],null))[_0x1b82('0x23')](respondWithResult(_0x26c1ec,null))[_0x1b82('0x4d')](handleError(_0x26c1ec,null));};exports[_0x1b82('0x24')]=function(_0x1eb4a4,_0x15b0d3){return db[_0x1b82('0x2d')]['find']({'where':{'id':_0x1eb4a4[_0x1b82('0x42')]['id']}})[_0x1b82('0x23')](handleEntityNotFound(_0x15b0d3,null))[_0x1b82('0x23')](removeEntity(_0x15b0d3,null))[_0x1b82('0x4d')](handleError(_0x15b0d3,null));}; \ No newline at end of file +var _0x50a6=['Tag','show','params','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','apply','reject','save','then','destroy','get','Tags','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filters','merge','VIRTUAL','filter','options'];(function(_0x35c3e7,_0x453182){var _0xcc6721=function(_0x56fc80){while(--_0x56fc80){_0x35c3e7['push'](_0x35c3e7['shift']());}};_0xcc6721(++_0x453182);}(_0x50a6,0xa4));var _0x650a=function(_0x549555,_0x5c2217){_0x549555=_0x549555-0x0;var _0x259593=_0x50a6[_0x549555];return _0x259593;};'use strict';var emlformat=require(_0x650a('0x0'));var rimraf=require(_0x650a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x650a('0x2'));var moment=require('moment');var BPromise=require(_0x650a('0x3'));var Mustache=require(_0x650a('0x4'));var util=require(_0x650a('0x5'));var path=require('path');var sox=require(_0x650a('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x650a('0x7'));var _=require(_0x650a('0x8'));var squel=require(_0x650a('0x9'));var crypto=require(_0x650a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x650a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x650a('0xc'));var Papa=require(_0x650a('0xd'));var Redis=require('ioredis');var authService=require(_0x650a('0xe'));var qs=require(_0x650a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x650a('0x10'));var logger=require('../../config/logger')(_0x650a('0x11'));var utils=require('../../config/utils');var config=require(_0x650a('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x650a('0x13'))['db'];function respondWithStatusCode(_0x48077a,_0x33e73d){_0x33e73d=_0x33e73d||0xcc;return function(_0x163e5f){if(_0x163e5f){return _0x48077a[_0x650a('0x14')](_0x33e73d);}return _0x48077a['status'](_0x33e73d)[_0x650a('0x15')]();};}function respondWithResult(_0x3919a7,_0x2f727d){_0x2f727d=_0x2f727d||0xc8;return function(_0x15f2fd){if(_0x15f2fd){return _0x3919a7[_0x650a('0x16')](_0x2f727d)[_0x650a('0x17')](_0x15f2fd);}};}function respondWithFilteredResult(_0x5b7c74,_0x2460a3){return function(_0x4fdd82){if(_0x4fdd82){var _0x1f94ab=typeof _0x2460a3[_0x650a('0x18')]===_0x650a('0x19')&&typeof _0x2460a3['limit']==='undefined';var _0x5285e0=_0x4fdd82['count'];var _0x2ad2d7=_0x1f94ab?0x0:_0x2460a3[_0x650a('0x18')];var _0x41d2fa=_0x1f94ab?_0x4fdd82[_0x650a('0x1a')]:_0x2460a3[_0x650a('0x18')]+_0x2460a3['limit'];var _0x4eba86;if(_0x41d2fa>=_0x5285e0){_0x41d2fa=_0x5285e0;_0x4eba86=0xc8;}else{_0x4eba86=0xce;}_0x5b7c74[_0x650a('0x16')](_0x4eba86);return _0x5b7c74[_0x650a('0x1b')]('Content-Range',_0x2ad2d7+'-'+_0x41d2fa+'/'+_0x5285e0)[_0x650a('0x17')](_0x4fdd82);}return null;};}function patchUpdates(_0x385ecd){return function(_0x59b5e4){try{jsonpatch[_0x650a('0x1c')](_0x59b5e4,_0x385ecd,!![]);}catch(_0x1ceedd){return BPromise[_0x650a('0x1d')](_0x1ceedd);}return _0x59b5e4[_0x650a('0x1e')]();};}function saveUpdates(_0x5163fe,_0x489a5f){return function(_0x88531d){if(_0x88531d){return _0x88531d['update'](_0x5163fe)[_0x650a('0x1f')](function(_0x1d471d){return _0x1d471d;});}return null;};}function removeEntity(_0xb12c52,_0x469e53){return function(_0x2ed256){if(_0x2ed256){return _0x2ed256[_0x650a('0x20')]()[_0x650a('0x1f')](function(){var _0x322eba=_0x2ed256[_0x650a('0x21')]({'plain':!![]});var _0x2761a8=_0x650a('0x22');return db[_0x650a('0x23')][_0x650a('0x20')]({'where':{'type':_0x2761a8,'resourceId':_0x322eba['id']}})[_0x650a('0x1f')](function(){return _0x2ed256;});})[_0x650a('0x1f')](function(){_0xb12c52[_0x650a('0x16')](0xcc)[_0x650a('0x15')]();});}};}function handleEntityNotFound(_0x12fdb4,_0x4c1df6){return function(_0x2290a7){if(!_0x2290a7){_0x12fdb4[_0x650a('0x14')](0x194);}return _0x2290a7;};}function handleError(_0x558002,_0x5dee27){_0x5dee27=_0x5dee27||0x1f4;return function(_0x1c6845){logger[_0x650a('0x24')](_0x1c6845[_0x650a('0x25')]);if(_0x1c6845[_0x650a('0x26')]){delete _0x1c6845[_0x650a('0x26')];}_0x558002[_0x650a('0x16')](_0x5dee27)['send'](_0x1c6845);};}exports[_0x650a('0x27')]=function(_0x1c8621,_0x199c86){var _0x18c197={},_0x25a47c={},_0x3e15ba={'count':0x0,'rows':[]};var _0x436e28=_[_0x650a('0x28')](db['Tag'][_0x650a('0x29')],function(_0x3c2eda){return{'name':_0x3c2eda[_0x650a('0x2a')],'type':_0x3c2eda['type'][_0x650a('0x2b')]};});_0x25a47c[_0x650a('0x2c')]=_['map'](_0x436e28,_0x650a('0x26'));_0x25a47c[_0x650a('0x2d')]=_[_0x650a('0x2e')](_0x1c8621['query']);_0x25a47c['filters']=_['intersection'](_0x25a47c[_0x650a('0x2c')],_0x25a47c[_0x650a('0x2d')]);_0x18c197[_0x650a('0x2f')]=_[_0x650a('0x30')](_0x25a47c['model'],qs[_0x650a('0x31')](_0x1c8621[_0x650a('0x2d')]['fields']));_0x18c197[_0x650a('0x2f')]=_0x18c197[_0x650a('0x2f')][_0x650a('0x32')]?_0x18c197[_0x650a('0x2f')]:_0x25a47c[_0x650a('0x2c')];if(!_0x1c8621['query'][_0x650a('0x33')]('nolimit')){_0x18c197[_0x650a('0x34')]=qs[_0x650a('0x34')](_0x1c8621['query'][_0x650a('0x34')]);_0x18c197[_0x650a('0x18')]=qs['offset'](_0x1c8621[_0x650a('0x2d')][_0x650a('0x18')]);}_0x18c197[_0x650a('0x35')]=qs['sort'](_0x1c8621[_0x650a('0x2d')][_0x650a('0x36')]);_0x18c197[_0x650a('0x37')]=qs[_0x650a('0x38')](_['pick'](_0x1c8621[_0x650a('0x2d')],_0x25a47c[_0x650a('0x38')]),_0x436e28);if(_0x1c8621[_0x650a('0x2d')]['filter']){_0x18c197['where']=_[_0x650a('0x39')](_0x18c197[_0x650a('0x37')],{'$or':_['map'](_0x436e28,function(_0x1acbe5){if(_0x1acbe5['type']!==_0x650a('0x3a')){var _0x39b00b={};_0x39b00b[_0x1acbe5[_0x650a('0x26')]]={'$like':'%'+_0x1c8621[_0x650a('0x2d')][_0x650a('0x3b')]+'%'};return _0x39b00b;}})});}_0x18c197=_['merge']({},_0x18c197,_0x1c8621[_0x650a('0x3c')]);var _0x5ba502={'where':_0x18c197[_0x650a('0x37')]};return db[_0x650a('0x3d')][_0x650a('0x1a')](_0x5ba502)[_0x650a('0x1f')](function(_0x1c5c6c){_0x3e15ba[_0x650a('0x1a')]=_0x1c5c6c;if(_0x1c8621[_0x650a('0x2d')]['includeAll']){_0x18c197['include']=[{'all':!![]}];}return db[_0x650a('0x3d')]['findAll'](_0x18c197);})['then'](function(_0x1e0868){_0x3e15ba['rows']=_0x1e0868;return _0x3e15ba;})[_0x650a('0x1f')](respondWithFilteredResult(_0x199c86,_0x18c197))['catch'](handleError(_0x199c86,null));};exports[_0x650a('0x3e')]=function(_0x9a53ec,_0x1855c9){var _0x233a5f={'raw':!![],'where':{'id':_0x9a53ec[_0x650a('0x3f')]['id']}},_0x409495={};_0x409495[_0x650a('0x2c')]=_[_0x650a('0x2e')](db[_0x650a('0x3d')][_0x650a('0x29')]);_0x409495[_0x650a('0x2d')]=_[_0x650a('0x2e')](_0x9a53ec['query']);_0x409495[_0x650a('0x38')]=_[_0x650a('0x30')](_0x409495[_0x650a('0x2c')],_0x409495[_0x650a('0x2d')]);_0x233a5f[_0x650a('0x2f')]=_[_0x650a('0x30')](_0x409495['model'],qs[_0x650a('0x31')](_0x9a53ec[_0x650a('0x2d')][_0x650a('0x31')]));_0x233a5f[_0x650a('0x2f')]=_0x233a5f[_0x650a('0x2f')][_0x650a('0x32')]?_0x233a5f['attributes']:_0x409495['model'];if(_0x9a53ec[_0x650a('0x2d')][_0x650a('0x40')]){_0x233a5f[_0x650a('0x41')]=[{'all':!![]}];}_0x233a5f=_['merge']({},_0x233a5f,_0x9a53ec[_0x650a('0x3c')]);return db['Tag'][_0x650a('0x42')](_0x233a5f)[_0x650a('0x1f')](handleEntityNotFound(_0x1855c9,null))['then'](respondWithResult(_0x1855c9,null))[_0x650a('0x43')](handleError(_0x1855c9,null));};exports[_0x650a('0x44')]=function(_0x39e8e6,_0x47ec0d){return db[_0x650a('0x3d')][_0x650a('0x44')](_0x39e8e6[_0x650a('0x45')],{})['then'](function(_0x17a40d){var _0x3f2151=_0x39e8e6[_0x650a('0x46')][_0x650a('0x21')]({'plain':!![]});if(!_0x3f2151)throw new Error(_0x650a('0x47'));if(_0x3f2151['role']==='user'){var _0x215f2e=_0x17a40d[_0x650a('0x21')]({'plain':!![]});var _0x5b2907=_0x650a('0x22');return db[_0x650a('0x48')][_0x650a('0x42')]({'where':{'name':_0x5b2907,'userProfileId':_0x3f2151[_0x650a('0x49')]},'raw':!![]})[_0x650a('0x1f')](function(_0x8bef2c){if(_0x8bef2c&&_0x8bef2c['autoAssociation']===0x0){return db[_0x650a('0x23')][_0x650a('0x44')]({'name':_0x215f2e[_0x650a('0x26')],'resourceId':_0x215f2e['id'],'type':_0x8bef2c[_0x650a('0x26')],'sectionId':_0x8bef2c['id']},{})[_0x650a('0x1f')](function(){return _0x17a40d;});}else{return _0x17a40d;}})['catch'](function(_0x45346f){logger[_0x650a('0x24')](_0x650a('0x4a'),_0x45346f);throw _0x45346f;});}return _0x17a40d;})[_0x650a('0x1f')](respondWithResult(_0x47ec0d,0xc9))['catch'](handleError(_0x47ec0d,null));};exports['update']=function(_0xd782e9,_0x225fd6){if(_0xd782e9['body']['id']){delete _0xd782e9[_0x650a('0x45')]['id'];}return db[_0x650a('0x3d')][_0x650a('0x42')]({'where':{'id':_0xd782e9[_0x650a('0x3f')]['id']}})[_0x650a('0x1f')](handleEntityNotFound(_0x225fd6,null))[_0x650a('0x1f')](saveUpdates(_0xd782e9[_0x650a('0x45')],null))[_0x650a('0x1f')](respondWithResult(_0x225fd6,null))[_0x650a('0x43')](handleError(_0x225fd6,null));};exports[_0x650a('0x20')]=function(_0x304e50,_0x15db69){return db[_0x650a('0x3d')][_0x650a('0x42')]({'where':{'id':_0x304e50[_0x650a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x15db69,null))['then'](removeEntity(_0x15db69,null))[_0x650a('0x43')](handleError(_0x15db69,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6c014c4..7afadef 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 _0xead3=['rimraf','../../config/environment','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xb860cb,_0x581959){var _0x2d14bf=function(_0x386991){while(--_0x386991){_0xb860cb['push'](_0xb860cb['shift']());}};_0x2d14bf(++_0x581959);}(_0xead3,0xcc));var _0x3ead=function(_0x2c7061,_0x324fa7){_0x2c7061=_0x2c7061-0x0;var _0x576748=_0xead3[_0x2c7061];return _0x576748;};'use strict';var _=require('lodash');var util=require(_0x3ead('0x0'));var logger=require(_0x3ead('0x1'))(_0x3ead('0x2'));var moment=require(_0x3ead('0x3'));var BPromise=require(_0x3ead('0x4'));var rp=require(_0x3ead('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ead('0x6'));var config=require(_0x3ead('0x7'));var attributes=require('./tag.attributes');module['exports']=function(_0x103e08,_0x2bf61d){return _0x103e08['define'](_0x3ead('0x8'),attributes,{'tableName':_0x3ead('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbfa=['rimraf','../../config/environment','./tag.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5300b6,_0x4a5846){var _0x58980e=function(_0x1bdee5){while(--_0x1bdee5){_0x5300b6['push'](_0x5300b6['shift']());}};_0x58980e(++_0x4a5846);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x4f75b5,_0x4db76d){_0x4f75b5=_0x4f75b5-0x0;var _0x5c263b=_0xbbfa[_0x4f75b5];return _0x5c263b;};'use strict';var _=require(_0xabbf('0x0'));var util=require('util');var logger=require(_0xabbf('0x1'))('api');var moment=require(_0xabbf('0x2'));var BPromise=require(_0xabbf('0x3'));var rp=require(_0xabbf('0x4'));var fs=require('fs');var path=require(_0xabbf('0x5'));var rimraf=require(_0xabbf('0x6'));var config=require(_0xabbf('0x7'));var attributes=require(_0xabbf('0x8'));module[_0xabbf('0x9')]=function(_0x120840,_0x7d0c02){return _0x120840[_0xabbf('0xa')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 261db6f..07786c5 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 _0x5db8=['info','Tag,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x5db8,0xbb));var _0x85db=function(_0x4884a7,_0x18e38a){_0x4884a7=_0x4884a7-0x0;var _0x56b60e=_0x5db8[_0x4884a7];return _0x56b60e;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var moment=require(_0x85db('0x2'));var BPromise=require('bluebird');var rs=require(_0x85db('0x3'));var fs=require('fs');var Redis=require(_0x85db('0x4'));var db=require(_0x85db('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85db('0x6'));var config=require(_0x85db('0x7'));var jayson=require(_0x85db('0x8'));var client=jayson[_0x85db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489b13,_0x2b9f25,_0x3a10dd){return new BPromise(function(_0xc6fd00,_0x308988){return client['request'](_0x489b13,_0x3a10dd)[_0x85db('0xa')](function(_0x54f0c1){logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));logger[_0x85db('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x2b9f25,'request\x20sent',JSON['stringify'](_0x54f0c1));if(_0x54f0c1[_0x85db('0xf')]){if(_0x54f0c1[_0x85db('0xf')]['code']===0x1f4){logger[_0x85db('0xf')]('Tag,\x20%s,\x20%s',_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0x308988(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0xc6fd00(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}else{logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));_0xc6fd00(_0x54f0c1['result'][_0x85db('0x10')]);}})[_0x85db('0x11')](function(_0x11e7da){logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x11e7da);_0x308988(_0x11e7da);});});} \ No newline at end of file +var _0x222f=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x107469,_0x6e974e){var _0x531225=function(_0x4ec207){while(--_0x4ec207){_0x107469['push'](_0x107469['shift']());}};_0x531225(++_0x6e974e);}(_0x222f,0x1a4));var _0xf222=function(_0x1a08ad,_0x21d209){_0x1a08ad=_0x1a08ad-0x0;var _0x521649=_0x222f[_0x1a08ad];return _0x521649;};'use strict';var _=require(_0xf222('0x0'));var util=require(_0xf222('0x1'));var moment=require(_0xf222('0x2'));var BPromise=require(_0xf222('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf222('0x4'))['db'];var utils=require(_0xf222('0x5'));var logger=require(_0xf222('0x6'))(_0xf222('0x7'));var config=require('../../config/environment');var jayson=require(_0xf222('0x8'));var client=jayson['client'][_0xf222('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f129,_0x518ebb,_0xf5a105){return new BPromise(function(_0x302d7a,_0x4aceb4){return client[_0xf222('0xa')](_0x26f129,_0xf5a105)[_0xf222('0xb')](function(_0x878804){logger[_0xf222('0xc')](_0xf222('0xd'),_0x518ebb,_0xf222('0xe'));logger['debug'](_0xf222('0xf'),_0x518ebb,_0xf222('0xe'),JSON[_0xf222('0x10')](_0x878804));if(_0x878804[_0xf222('0x11')]){if(_0x878804['error'][_0xf222('0x12')]===0x1f4){logger[_0xf222('0x11')](_0xf222('0xd'),_0x518ebb,_0x878804[_0xf222('0x11')][_0xf222('0x13')]);return _0x4aceb4(_0x878804[_0xf222('0x11')][_0xf222('0x13')]);}logger[_0xf222('0x11')]('Tag,\x20%s,\x20%s',_0x518ebb,_0x878804['error'][_0xf222('0x13')]);return _0x302d7a(_0x878804[_0xf222('0x11')]['message']);}else{logger[_0xf222('0xc')](_0xf222('0xd'),_0x518ebb,_0xf222('0xe'));_0x302d7a(_0x878804[_0xf222('0x14')][_0xf222('0x13')]);}})[_0xf222('0x15')](function(_0x30b646){logger['error'](_0xf222('0xd'),_0x518ebb,_0x30b646);_0x4aceb4(_0x30b646);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 6141ccd..b9896d6 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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var 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 a7e6676..e3b8510 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x3b938d,_0x5512f8){var _0x230c60=function(_0x55c3dc){while(--_0x55c3dc){_0x3b938d['push'](_0x3b938d['shift']());}};_0x230c60(++_0x5512f8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x20edf7,_0x708545){var _0x5b3412=function(_0x5c1a39){while(--_0x5c1a39){_0x20edf7['push'](_0x20edf7['shift']());}};_0x5b3412(++_0x708545);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 74ad7d7..7644173 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 _0x90db=['then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','options','Team','includeAll','include','findAll','rows','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','QueryTypes','SELECT','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','UserSmsQueue','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','Teams','getQueues','findOne','isValidChannel','channel','capitalize','toLowerCase','Queue','order','addQueues','ValidationError','add','Queues','ids','Unknown\x20channel','addAgents','isArray','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','online','voicePause','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','TeamVoiceQueue','all','TeamVoicePrefix','spread','removeAgents','Mail','Queue:remove','getAgents','hasOwnProperty','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','save','update'];(function(_0x52338b,_0x295a6c){var _0x546138=function(_0x4afbba){while(--_0x4afbba){_0x52338b['push'](_0x52338b['shift']());}};_0x546138(++_0x295a6c);}(_0x90db,0x1a4));var _0xb90d=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x90db[_0x134c2e];return _0x2825db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb90d('0x0'));var zipdir=require(_0xb90d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb90d('0x2'));var moment=require(_0xb90d('0x3'));var BPromise=require(_0xb90d('0x4'));var Mustache=require(_0xb90d('0x5'));var util=require(_0xb90d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb90d('0x7'));var fs=require('fs');var fs_extra=require(_0xb90d('0x8'));var _=require(_0xb90d('0x9'));var squel=require(_0xb90d('0xa'));var crypto=require('crypto');var jsforce=require(_0xb90d('0xb'));var deskjs=require(_0xb90d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb90d('0xd'));var Papa=require('papaparse');var Redis=require(_0xb90d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb90d('0xf'));var as=require(_0xb90d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb90d('0x11'))(_0xb90d('0x12'));var utils=require(_0xb90d('0x13'));var config=require(_0xb90d('0x14'));var licenseUtil=require(_0xb90d('0x15'));var db=require(_0xb90d('0x16'))['db'];config[_0xb90d('0x17')]=_[_0xb90d('0x18')](config[_0xb90d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xb90d('0x19'))(new Redis(config['redis']));require(_0xb90d('0x1a'))[_0xb90d('0x1b')](socket);function respondWithStatusCode(_0x46d04d,_0x1b5bdd){_0x1b5bdd=_0x1b5bdd||0xcc;return function(_0x17a708){if(_0x17a708){return _0x46d04d[_0xb90d('0x1c')](_0x1b5bdd);}return _0x46d04d[_0xb90d('0x1d')](_0x1b5bdd)[_0xb90d('0x1e')]();};}function respondWithResult(_0x1829f0,_0x151d31){_0x151d31=_0x151d31||0xc8;return function(_0x14d32b){if(_0x14d32b){return _0x1829f0[_0xb90d('0x1d')](_0x151d31)[_0xb90d('0x1f')](_0x14d32b);}};}function respondWithFilteredResult(_0x36589a,_0x495fe5){return function(_0x4f47ac){if(_0x4f47ac){var _0x2388c6=typeof _0x495fe5[_0xb90d('0x20')]==='undefined'&&typeof _0x495fe5[_0xb90d('0x21')]==='undefined';var _0x12bd58=_0x4f47ac['count'];var _0x52dcce=_0x2388c6?0x0:_0x495fe5[_0xb90d('0x20')];var _0x478512=_0x2388c6?_0x4f47ac[_0xb90d('0x22')]:_0x495fe5[_0xb90d('0x20')]+_0x495fe5[_0xb90d('0x21')];var _0x1ceeee;if(_0x478512>=_0x12bd58){_0x478512=_0x12bd58;_0x1ceeee=0xc8;}else{_0x1ceeee=0xce;}_0x36589a['status'](_0x1ceeee);return _0x36589a['set'](_0xb90d('0x23'),_0x52dcce+'-'+_0x478512+'/'+_0x12bd58)[_0xb90d('0x1f')](_0x4f47ac);}return null;};}function patchUpdates(_0x15a54f){return function(_0x332942){try{jsonpatch[_0xb90d('0x24')](_0x332942,_0x15a54f,!![]);}catch(_0x1c1fc6){return BPromise['reject'](_0x1c1fc6);}return _0x332942[_0xb90d('0x25')]();};}function saveUpdates(_0x79f630,_0x948a10){return function(_0x590329){if(_0x590329){return _0x590329[_0xb90d('0x26')](_0x79f630)[_0xb90d('0x27')](function(_0x2cac6e){return _0x2cac6e;});}return null;};}function handleEntityNotFound(_0x5a7e40,_0x4803de){return function(_0x3c9da5){if(!_0x3c9da5){_0x5a7e40['sendStatus'](0x194);}return _0x3c9da5;};}function handleError(_0x216a8f,_0x25893e){_0x25893e=_0x25893e||0x1f4;return function(_0x243e55){logger[_0xb90d('0x28')](_0x243e55[_0xb90d('0x29')]);if(_0x243e55[_0xb90d('0x2a')]){delete _0x243e55[_0xb90d('0x2a')];}_0x216a8f[_0xb90d('0x1d')](_0x25893e)[_0xb90d('0x2b')](_0x243e55);};}exports[_0xb90d('0x2c')]=function(_0x10d5e1,_0x3b9f19){var _0x6fc04e={},_0x3cd64a={},_0x5ab90f={'count':0x0,'rows':[]};var _0x5ccead=_[_0xb90d('0x2d')](db['Team'][_0xb90d('0x2e')],function(_0x4fe41a){return{'name':_0x4fe41a['fieldName'],'type':_0x4fe41a[_0xb90d('0x2f')][_0xb90d('0x30')]};});_0x3cd64a[_0xb90d('0x31')]=_['map'](_0x5ccead,_0xb90d('0x2a'));_0x3cd64a[_0xb90d('0x32')]=_[_0xb90d('0x33')](_0x10d5e1['query']);_0x3cd64a[_0xb90d('0x34')]=_[_0xb90d('0x35')](_0x3cd64a[_0xb90d('0x31')],_0x3cd64a[_0xb90d('0x32')]);_0x6fc04e[_0xb90d('0x36')]=_[_0xb90d('0x35')](_0x3cd64a['model'],qs['fields'](_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x37')]));_0x6fc04e[_0xb90d('0x36')]=_0x6fc04e[_0xb90d('0x36')][_0xb90d('0x38')]?_0x6fc04e[_0xb90d('0x36')]:_0x3cd64a['model'];if(!_0x10d5e1['query']['hasOwnProperty'](_0xb90d('0x39'))){_0x6fc04e[_0xb90d('0x21')]=qs[_0xb90d('0x21')](_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x21')]);_0x6fc04e['offset']=qs[_0xb90d('0x20')](_0x10d5e1['query'][_0xb90d('0x20')]);}_0x6fc04e['order']=qs[_0xb90d('0x3a')](_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x3a')]);_0x6fc04e['where']=qs['filters'](_[_0xb90d('0x3b')](_0x10d5e1[_0xb90d('0x32')],_0x3cd64a[_0xb90d('0x34')]),_0x5ccead);if(_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x3c')]){_0x6fc04e[_0xb90d('0x3d')]=_[_0xb90d('0x3e')](_0x6fc04e['where'],{'$or':_[_0xb90d('0x2d')](_0x5ccead,function(_0xa671f2){if(_0xa671f2[_0xb90d('0x2f')]!=='VIRTUAL'){var _0x460d0f={};_0x460d0f[_0xa671f2['name']]={'$like':'%'+_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x3c')]+'%'};return _0x460d0f;}})});}_0x6fc04e=_[_0xb90d('0x3e')]({},_0x6fc04e,_0x10d5e1[_0xb90d('0x3f')]);var _0x408e1c={'where':_0x6fc04e['where']};return db[_0xb90d('0x40')][_0xb90d('0x22')](_0x408e1c)[_0xb90d('0x27')](function(_0x499425){_0x5ab90f['count']=_0x499425;if(_0x10d5e1[_0xb90d('0x32')][_0xb90d('0x41')]){_0x6fc04e[_0xb90d('0x42')]=[{'all':!![]}];}return db[_0xb90d('0x40')][_0xb90d('0x43')](_0x6fc04e);})[_0xb90d('0x27')](function(_0x3d9f89){_0x5ab90f[_0xb90d('0x44')]=_0x3d9f89;return _0x5ab90f;})[_0xb90d('0x27')](respondWithFilteredResult(_0x3b9f19,_0x6fc04e))[_0xb90d('0x45')](handleError(_0x3b9f19,null));};exports[_0xb90d('0x46')]=function(_0x51d892,_0x4e8fe4){var _0x65e393={'raw':![],'where':{'id':_0x51d892['params']['id']}},_0x3ef1c1={};_0x3ef1c1[_0xb90d('0x31')]=_['keys'](db[_0xb90d('0x40')][_0xb90d('0x2e')]);_0x3ef1c1[_0xb90d('0x32')]=_[_0xb90d('0x33')](_0x51d892[_0xb90d('0x32')]);_0x3ef1c1[_0xb90d('0x34')]=_[_0xb90d('0x35')](_0x3ef1c1['model'],_0x3ef1c1['query']);_0x65e393['attributes']=_[_0xb90d('0x35')](_0x3ef1c1[_0xb90d('0x31')],qs[_0xb90d('0x37')](_0x51d892['query']['fields']));_0x65e393[_0xb90d('0x36')]=_0x65e393[_0xb90d('0x36')]['length']?_0x65e393[_0xb90d('0x36')]:_0x3ef1c1[_0xb90d('0x31')];if(_0x51d892['query'][_0xb90d('0x41')]){_0x65e393[_0xb90d('0x42')]=[{'all':!![]}];}_0x65e393=_[_0xb90d('0x3e')]({},_0x65e393,_0x51d892['options']);return db[_0xb90d('0x40')][_0xb90d('0x47')](_0x65e393)[_0xb90d('0x27')](handleEntityNotFound(_0x4e8fe4,null))[_0xb90d('0x27')](respondWithResult(_0x4e8fe4,null))[_0xb90d('0x45')](handleError(_0x4e8fe4,null));};exports[_0xb90d('0x48')]=function(_0x224b0e,_0xf0dc80){return db[_0xb90d('0x40')][_0xb90d('0x48')](_0x224b0e['body'],{})[_0xb90d('0x27')](function(_0x5b1731){var _0x3d0420=_0x224b0e['user']['get']({'plain':!![]});if(!_0x3d0420)throw new Error(_0xb90d('0x49'));if(_0x3d0420['role']===_0xb90d('0x4a')){var _0xe1e0dd=_0x5b1731[_0xb90d('0x4b')]({'plain':!![]});var _0x4fc275='Teams';return db[_0xb90d('0x4c')]['find']({'where':{'name':_0x4fc275,'userProfileId':_0x3d0420['userProfileId']},'raw':!![]})[_0xb90d('0x27')](function(_0x206df7){if(_0x206df7&&_0x206df7[_0xb90d('0x4d')]===0x0){return db[_0xb90d('0x4e')][_0xb90d('0x48')]({'name':_0xe1e0dd['name'],'resourceId':_0xe1e0dd['id'],'type':_0x206df7[_0xb90d('0x2a')],'sectionId':_0x206df7['id']},{})[_0xb90d('0x27')](function(){return _0x5b1731;});}else{return _0x5b1731;}})[_0xb90d('0x45')](function(_0x13bbbb){logger[_0xb90d('0x28')](_0xb90d('0x4f'),_0x13bbbb);throw _0x13bbbb;});}return _0x5b1731;})[_0xb90d('0x27')](respondWithResult(_0xf0dc80,0xc9))[_0xb90d('0x45')](handleError(_0xf0dc80,null));};exports[_0xb90d('0x26')]=function(_0x18b872,_0x47327b){if(_0x18b872['body']['id']){delete _0x18b872[_0xb90d('0x50')]['id'];}return db[_0xb90d('0x40')]['find']({'where':{'id':_0x18b872[_0xb90d('0x51')]['id']}})['then'](handleEntityNotFound(_0x47327b,null))[_0xb90d('0x27')](saveUpdates(_0x18b872[_0xb90d('0x50')],null))[_0xb90d('0x27')](respondWithResult(_0x47327b,null))[_0xb90d('0x45')](handleError(_0x47327b,null));};exports[_0xb90d('0x52')]=function(_0x556c87,_0x5fdcea){var _0x4ef9e9=_0x556c87['params']['id'];var _0x506e5d=[];return db['sequelize']['transaction'](function(_0x420b62){var _0x1178b6=_0xb90d('0x53')+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x1178b6,{'type':db['Sequelize'][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62})[_0xb90d('0x27')](function(_0x2c36db){_0x506e5d=_[_0xb90d('0x2d')](_0x2c36db,function(_0x50c041){return Number(_0x50c041['UserId']);});})[_0xb90d('0x27')](function(){var _0x625afe=_0xb90d('0x57')+_0x4ef9e9;return db[_0xb90d('0x54')]['query'](_0x625afe,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x1c6731){var _0x31b09d=_[_0xb90d('0x2d')](_0x1c6731,function(_0xe701c2){return Number(_0xe701c2[_0xb90d('0x59')]);});return db[_0xb90d('0x5a')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'VoiceQueueId':{'$in':_0x31b09d}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x170a7a=_0xb90d('0x5b')+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x170a7a,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})['then'](function(_0xf5ba46){var _0x5ee83f=_[_0xb90d('0x2d')](_0xf5ba46,function(_0x5a8205){return Number(_0x5a8205[_0xb90d('0x5c')]);});return db[_0xb90d('0x5d')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'MailQueueId':{'$in':_0x5ee83f}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x582c18='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ef9e9;return db[_0xb90d('0x54')]['query'](_0x582c18,{'type':db['Sequelize'][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x5f0121){var _0x309372=_[_0xb90d('0x2d')](_0x5f0121,function(_0x476225){return Number(_0x476225['SmsQueueId']);});return db[_0xb90d('0x5e')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'SmsQueueId':{'$in':_0x309372}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x1a7839='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x1a7839,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x1a5790){var _0x62052b=_['map'](_0x1a5790,function(_0x3f672f){return Number(_0x3f672f[_0xb90d('0x5f')]);});return db['UserChatQueue'][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'ChatQueueId':{'$in':_0x62052b}},'transaction':_0x420b62});})['then'](function(){var _0x54d646=_0xb90d('0x60')+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x54d646,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')]['SELECT'],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x50f76d){var _0x2bc071=_[_0xb90d('0x2d')](_0x50f76d,function(_0x2cee8a){return Number(_0x2cee8a[_0xb90d('0x61')]);});return db['UserFaxQueue'][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'FaxQueueId':{'$in':_0x2bc071}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x16dcbc='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x16dcbc,{'type':db[_0xb90d('0x58')][_0xb90d('0x55')]['SELECT'],'raw':!![],'transaction':_0x420b62});})['then'](function(_0x4d8013){var _0x101522=_['map'](_0x4d8013,function(_0x2d9ffd){return Number(_0x2d9ffd[_0xb90d('0x62')]);});return db[_0xb90d('0x63')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'OpenchannelQueueId':{'$in':_0x101522}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){var _0x4f33a0=_0xb90d('0x64')+_0x4ef9e9;return db[_0xb90d('0x54')][_0xb90d('0x32')](_0x4f33a0,{'type':db[_0xb90d('0x58')]['QueryTypes'][_0xb90d('0x56')],'raw':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x4a9487){var _0x5a8f54=_[_0xb90d('0x2d')](_0x4a9487,function(_0x61306d){return Number(_0x61306d[_0xb90d('0x65')]);});return db[_0xb90d('0x66')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'WhatsappQueueId':{'$in':_0x5a8f54}},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){return db['TeamVoicePrefix'][_0xb90d('0x47')]({'where':{'TeamId':_0x4ef9e9}});})[_0xb90d('0x27')](function(_0x36a531){if(_0x36a531===null){return;}return db[_0xb90d('0x67')][_0xb90d('0x52')]({'where':{'UserId':{'$in':_0x506e5d},'VoicePrefixId':_0x36a531[_0xb90d('0x68')]},'transaction':_0x420b62});})[_0xb90d('0x27')](function(){return db[_0xb90d('0x40')][_0xb90d('0x52')]({'where':{'id':_0x4ef9e9},'cascade':!![],'transaction':_0x420b62});})[_0xb90d('0x27')](function(_0x56ddfe){if(_0x56ddfe===0x0){_0x5fdcea[_0xb90d('0x1c')](0x194);}else{return db['UserProfileResource'][_0xb90d('0x52')]({'where':{'type':_0xb90d('0x69'),'resourceId':_0x4ef9e9},'cascade':!![],'transaction':_0x420b62})[_0xb90d('0x27')](function(){_0x5fdcea[_0xb90d('0x1d')](0xcc)['end']();});}})[_0xb90d('0x45')](function(_0x329a69){_0x5fdcea[_0xb90d('0x1d')](0x1f4)[_0xb90d('0x2b')](_0x329a69);});});};exports[_0xb90d('0x6a')]=function(_0x57c8f5,_0x563045,_0x5d5f6d){return db[_0xb90d('0x40')][_0xb90d('0x6b')]({'where':{'id':_0x57c8f5[_0xb90d('0x51')]['id']}})['then'](handleEntityNotFound(_0x563045,null))[_0xb90d('0x27')](function(_0x160273){if(!_0x57c8f5[_0xb90d('0x32')]['channel']||!utils[_0xb90d('0x6c')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x6d')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}var _0x3a948f={};var _0x1e3b83={};_0x1e3b83[_0xb90d('0x31')]=_[_0xb90d('0x33')](db[_[_0xb90d('0x6e')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x6d')][_0xb90d('0x6f')]())+_0xb90d('0x70')][_0xb90d('0x2e')]);_0x1e3b83[_0xb90d('0x32')]=_[_0xb90d('0x33')](_0x57c8f5['query']);_0x1e3b83[_0xb90d('0x34')]=_[_0xb90d('0x35')](_0x1e3b83['model'],_0x1e3b83[_0xb90d('0x32')]);_0x3a948f[_0xb90d('0x36')]=_[_0xb90d('0x35')](_0x1e3b83[_0xb90d('0x31')],qs[_0xb90d('0x37')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x37')]));_0x3a948f[_0xb90d('0x36')]=_0x3a948f[_0xb90d('0x36')][_0xb90d('0x38')]?_0x3a948f[_0xb90d('0x36')]:_0x1e3b83[_0xb90d('0x31')];_0x3a948f['limit']=qs[_0xb90d('0x21')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x21')]);_0x3a948f[_0xb90d('0x20')]=qs[_0xb90d('0x20')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x20')]);_0x3a948f[_0xb90d('0x71')]=qs[_0xb90d('0x3a')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x3a')]);_0x3a948f[_0xb90d('0x3d')]=qs[_0xb90d('0x34')](_['pick'](_0x57c8f5['query'],_0x1e3b83[_0xb90d('0x34')]));_0x3a948f=_[_0xb90d('0x3e')]({},_0x3a948f,_0x57c8f5[_0xb90d('0x3f')]);return _0x160273[_0xb90d('0x4b')+_[_0xb90d('0x6e')](_0x57c8f5[_0xb90d('0x32')][_0xb90d('0x6d')]['toLowerCase']())+'Queues'](_0x3a948f);})[_0xb90d('0x27')](respondWithResult(_0x563045,null))[_0xb90d('0x45')](handleError(_0x563045,null));};exports[_0xb90d('0x72')]=function(_0x647291,_0x3db5c9,_0x58419e){return db[_0xb90d('0x40')][_0xb90d('0x6b')]({'where':{'id':_0x647291['params']['id']}})[_0xb90d('0x27')](function(_0x79895c){if(_0x79895c){if(!_0x647291[_0xb90d('0x50')][_0xb90d('0x6d')]||!utils[_0xb90d('0x6c')](_0x647291['body'][_0xb90d('0x6d')])){throw new db[(_0xb90d('0x58'))][(_0xb90d('0x73'))]('Unknown\x20channel');}return _0x79895c[_0xb90d('0x74')+_['capitalize'](_0x647291[_0xb90d('0x50')][_0xb90d('0x6d')][_0xb90d('0x6f')]())+_0xb90d('0x75')](_0x647291['body'][_0xb90d('0x76')]);}return null;})[_0xb90d('0x27')](handleEntityNotFound(_0x3db5c9,null))['then'](respondWithStatusCode(_0x3db5c9,null))['catch'](handleError(_0x3db5c9,null));};exports['removeQueues']=function(_0x2d63b6,_0x3355ca,_0x5e4c22){return db['Team'][_0xb90d('0x6b')]({'where':{'id':_0x2d63b6[_0xb90d('0x51')]['id']}})[_0xb90d('0x27')](function(_0x455e26){if(_0x455e26){if(!_0x2d63b6['query'][_0xb90d('0x6d')]||!utils[_0xb90d('0x6c')](_0x2d63b6[_0xb90d('0x32')][_0xb90d('0x6d')])){throw new db[(_0xb90d('0x58'))]['ValidationError'](_0xb90d('0x77'));}return _0x455e26['remove'+_[_0xb90d('0x6e')](_0x2d63b6[_0xb90d('0x32')][_0xb90d('0x6d')][_0xb90d('0x6f')]())+_0xb90d('0x75')](_0x2d63b6[_0xb90d('0x32')][_0xb90d('0x76')]);}return null;})[_0xb90d('0x27')](handleEntityNotFound(_0x3355ca,null))[_0xb90d('0x27')](respondWithStatusCode(_0x3355ca,null))[_0xb90d('0x45')](handleError(_0x3355ca,null));};exports[_0xb90d('0x78')]=function(_0x5c431f,_0x324974){var _0x4d1c65=_[_0xb90d('0x79')](_0x5c431f['body'][_0xb90d('0x76')])?_0x5c431f['body']['ids']:[_0x5c431f[_0xb90d('0x50')][_0xb90d('0x76')]];var _0x25b894=_0x5c431f[_0xb90d('0x51')]['id'];return db['Team']['find']({'where':{'id':_0x25b894}})[_0xb90d('0x27')](handleEntityNotFound(_0x324974,null))[_0xb90d('0x27')](function(_0x3cd949){if(_0x3cd949){var _0x5eb243=[_0xb90d('0x7a'),_0xb90d('0x7b'),'Mail',_0xb90d('0x7c'),_0xb90d('0x7d'),_0xb90d('0x7e'),_0xb90d('0x7f')];return db[_0xb90d('0x54')][_0xb90d('0x80')](function(_0x2be2b8){var _0x66945d=_[_0xb90d('0x2d')](_0x5eb243,function(_0x687154){var _0x1dc543={'attributes':['id','name']};if(_0x687154===_0xb90d('0x7a')){_0x1dc543[_0xb90d('0x81')]={'attributes':[_0xb90d('0x82')]};}return _0x3cd949[_0xb90d('0x4b')+_0x687154+_0xb90d('0x75')](_0x1dc543)[_0xb90d('0x27')](function(_0x5f5ca1){var _0x412eae=_[_0xb90d('0x2d')](_0x5f5ca1,function(_0x47b05d){var _0x4b30a8=_[_0xb90d('0x2d')](_0x4d1c65,function(_0x25a38b){var _0x3b1dfa={'where':{'UserId':_0x25a38b,[_0x687154+_0xb90d('0x83')]:_0x47b05d['id']},'transaction':_0x2be2b8};if(_0x687154===_0xb90d('0x7a')){_0x3b1dfa[_0xb90d('0x18')]={'penalty':_0x47b05d['TeamVoiceQueue'][_0xb90d('0x82')]};}return db[_0xb90d('0x84')+_0x687154+'Queue'][_0xb90d('0x85')](_0x3b1dfa)[_0xb90d('0x27')](function(){socket[_0xb90d('0x86')]('user'+_0x687154+_0xb90d('0x87'),{'UserId':_0x25a38b,[_0x687154+_0xb90d('0x83')]:_0x47b05d['id']});if(_0x687154!==_0xb90d('0x7a')){return;}return db[_0xb90d('0x84')][_0xb90d('0x43')]({'where':{'id':_0x4d1c65,'online':0x1},'attributes':['id',_0xb90d('0x2a'),_0xb90d('0x88'),_0xb90d('0x89'),'interface'],'raw':!![]})['then'](function(_0x25dc31){var _0x17208a=_[_0xb90d('0x2d')](_0x25dc31,function(_0x596d3a){return db[_0xb90d('0x8a')][_0xb90d('0x8b')]({'membername':_0x596d3a[_0xb90d('0x2a')],'UserId':_0x596d3a['id'],'queue_name':_0x47b05d[_0xb90d('0x2a')],'VoiceQueueId':_0x47b05d['id'],'interface':_[_0xb90d('0x8c')](_0x596d3a[_0xb90d('0x8d')])?util[_0xb90d('0x8e')](_0xb90d('0x8f'),_0x596d3a[_0xb90d('0x2a')]):_0x596d3a[_0xb90d('0x8d')],'paused':_0x596d3a[_0xb90d('0x89')]||![],'penalty':_0x47b05d[_0xb90d('0x90')][_0xb90d('0x82')]},{'transaction':_0x2be2b8});});return Promise[_0xb90d('0x91')](_0x17208a);});});});return Promise[_0xb90d('0x91')](_0x4b30a8);});return Promise[_0xb90d('0x91')](_0x412eae);})[_0xb90d('0x27')](function(){return db[_0xb90d('0x92')][_0xb90d('0x6b')]({'where':{'teamId':_0x25b894}})['then'](function(_0x1f501f){if(_0x1f501f){var _0x53d600=_[_0xb90d('0x2d')](_0x4d1c65,function(_0x3337e0){db[_0xb90d('0x67')][_0xb90d('0x8b')]({'UserId':_0x3337e0,'VoicePrefixId':_0x1f501f[_0xb90d('0x68')]});});return Promise['all'](_0x53d600);}});});});return Promise[_0xb90d('0x91')](_0x66945d)[_0xb90d('0x27')](function(){return _0x3cd949[_0xb90d('0x78')](_0x4d1c65,{'transaction':_0x2be2b8})[_0xb90d('0x93')](function(_0x2ac749){return _0x2ac749;});});});}})[_0xb90d('0x27')](respondWithResult(_0x324974,null))[_0xb90d('0x45')](handleError(_0x324974,null));};exports[_0xb90d('0x94')]=function(_0x2b0ac5,_0x38f576){var _0x2cd07c=_[_0xb90d('0x79')](_0x2b0ac5[_0xb90d('0x32')][_0xb90d('0x76')])?_0x2b0ac5[_0xb90d('0x32')]['ids']:[_0x2b0ac5[_0xb90d('0x32')][_0xb90d('0x76')]];var _0x3106f2=_0x2b0ac5[_0xb90d('0x51')]['id'];return db[_0xb90d('0x40')]['find']({'where':{'id':_0x3106f2}})[_0xb90d('0x27')](handleEntityNotFound(_0x38f576,null))['then'](function(_0x2e10b7){if(_0x2e10b7){var _0x24fdf3=[_0xb90d('0x7a'),_0xb90d('0x7b'),_0xb90d('0x95'),'Sms','Fax','Openchannel','Whatsapp'];return db['sequelize'][_0xb90d('0x80')](function(_0x447e7b){var _0x31ba9f=_[_0xb90d('0x2d')](_0x24fdf3,function(_0x2a36f8){var _0x90551a={'attributes':['id',_0xb90d('0x2a')]};return _0x2e10b7[_0xb90d('0x4b')+_0x2a36f8+_0xb90d('0x75')](_0x90551a)[_0xb90d('0x27')](function(_0x339b40){var _0xe0dc0a=_[_0xb90d('0x2d')](_0x339b40,function(_0x3a5152){return _0x3a5152[_0xb90d('0x94')](_0x2cd07c,{'transaction':_0x447e7b})[_0xb90d('0x27')](function(){var _0x324b66=_[_0xb90d('0x2d')](_0x2cd07c,function(_0x5d8a38){socket['emit'](_0xb90d('0x4a')+_0x2a36f8+_0xb90d('0x96'),{'UserId':Number(_0x5d8a38),[_0x2a36f8+_0xb90d('0x83')]:_0x3a5152['id']});if(_0x2a36f8!==_0xb90d('0x7a')){return;}return db['UserVoiceQueueRt'][_0xb90d('0x52')]({'where':{'VoiceQueueId':_0x3a5152['id'],'UserId':_0x5d8a38},'transaction':_0x447e7b});});return Promise['all'](_0x324b66);});});return Promise[_0xb90d('0x91')](_0xe0dc0a);});});return Promise[_0xb90d('0x91')](_0x31ba9f)[_0xb90d('0x27')](function(){return _0x2e10b7['removeAgents'](_0x2cd07c,{'transaction':_0x447e7b});})[_0xb90d('0x27')](function(){return db[_0xb90d('0x92')][_0xb90d('0x6b')]({'where':{'teamId':_0x3106f2}})[_0xb90d('0x27')](function(_0x2459c3){if(_0x2459c3){var _0x5b933f=_[_0xb90d('0x2d')](_0x2cd07c,function(_0x3d1fbc){db[_0xb90d('0x67')][_0xb90d('0x52')]({'where':{'UserId':_0x3d1fbc,'VoicePrefixId':_0x2459c3[_0xb90d('0x68')]}});});return Promise['all'](_0x5b933f);}});});});}})[_0xb90d('0x27')](respondWithStatusCode(_0x38f576,null))[_0xb90d('0x45')](handleError(_0x38f576,null));};exports[_0xb90d('0x97')]=function(_0x23cbe1,_0x5c2ff7,_0x3aebb9){var _0x20505c={};var _0x98d3e9={};var _0x214eec;var _0x1d6573;return db['Team'][_0xb90d('0x6b')]({'where':{'id':_0x23cbe1[_0xb90d('0x51')]['id']}})[_0xb90d('0x27')](handleEntityNotFound(_0x5c2ff7,null))[_0xb90d('0x27')](function(_0x1948e9){if(_0x1948e9){_0x214eec=_0x1948e9;_0x98d3e9['model']=_['keys'](db[_0xb90d('0x84')][_0xb90d('0x2e')]);_0x98d3e9[_0xb90d('0x32')]=_[_0xb90d('0x33')](_0x23cbe1[_0xb90d('0x32')]);_0x98d3e9[_0xb90d('0x34')]=_[_0xb90d('0x35')](_0x98d3e9['model'],_0x98d3e9[_0xb90d('0x32')]);_0x20505c[_0xb90d('0x36')]=_[_0xb90d('0x35')](_0x98d3e9[_0xb90d('0x31')],qs[_0xb90d('0x37')](_0x23cbe1[_0xb90d('0x32')][_0xb90d('0x37')]));_0x20505c[_0xb90d('0x36')]=_0x20505c[_0xb90d('0x36')][_0xb90d('0x38')]?_0x20505c[_0xb90d('0x36')]:_0x98d3e9[_0xb90d('0x31')];_0x20505c[_0xb90d('0x71')]=qs['sort'](_0x23cbe1['query'][_0xb90d('0x3a')]);_0x20505c['where']=qs['filters'](_[_0xb90d('0x3b')](_0x23cbe1['query'],_0x98d3e9[_0xb90d('0x34')]));if(_0x23cbe1[_0xb90d('0x32')][_0xb90d('0x3c')]){_0x20505c[_0xb90d('0x3d')]=_['merge'](_0x20505c[_0xb90d('0x3d')],{'$or':_['map'](_0x20505c[_0xb90d('0x36')],function(_0x5f15d8){var _0x5195ff={};_0x5195ff[_0x5f15d8]={'$like':'%'+_0x23cbe1['query'][_0xb90d('0x3c')]+'%'};return _0x5195ff;})});}_0x20505c=_['merge']({},_0x20505c,_0x23cbe1[_0xb90d('0x3f')]);return _0x214eec[_0xb90d('0x97')](_0x20505c);}})[_0xb90d('0x27')](function(_0x66fc41){if(_0x66fc41){_0x1d6573=_0x66fc41['length'];if(!_0x23cbe1['query'][_0xb90d('0x98')](_0xb90d('0x39'))){_0x20505c[_0xb90d('0x21')]=qs[_0xb90d('0x21')](_0x23cbe1[_0xb90d('0x32')][_0xb90d('0x21')]);_0x20505c[_0xb90d('0x20')]=qs[_0xb90d('0x20')](_0x23cbe1[_0xb90d('0x32')][_0xb90d('0x20')]);}return _0x214eec[_0xb90d('0x97')](_0x20505c);}})[_0xb90d('0x27')](function(_0x3116b4){if(_0x3116b4){return _0x3116b4?{'count':_0x1d6573,'rows':_0x3116b4}:null;}})['then'](respondWithResult(_0x5c2ff7,null))['catch'](handleError(_0x5c2ff7,null));}; \ No newline at end of file +var _0x9d03=['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','defaults','redis','socket.io-emitter','./team.socket','register','status','end','offset','undefined','limit','count','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Team','includeAll','include','findAll','rows','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Teams','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','params','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','toLowerCase','Queue','capitalize','Queues','addQueues','Unknown\x20channel','add','removeQueues','addAgents','isArray','ids','Voice','Chat','Mail','Sms','Fax','Openchannel','penalty','findOrCreate','emit','Queue:save','QueueId','upsert','interface','format','voicePause','TeamVoiceQueue','all','removeAgents','Queue:remove','UserVoiceQueueRt','getAgents','User','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce'];(function(_0x6dc204,_0x1f3313){var _0xa8505f=function(_0x5a6b56){while(--_0x5a6b56){_0x6dc204['push'](_0x6dc204['shift']());}};_0xa8505f(++_0x1f3313);}(_0x9d03,0x120));var _0x39d0=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9d03[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x39d0('0x0'));var rimraf=require(_0x39d0('0x1'));var zipdir=require(_0x39d0('0x2'));var jsonpatch=require(_0x39d0('0x3'));var rp=require(_0x39d0('0x4'));var moment=require(_0x39d0('0x5'));var BPromise=require(_0x39d0('0x6'));var Mustache=require(_0x39d0('0x7'));var util=require(_0x39d0('0x8'));var path=require(_0x39d0('0x9'));var sox=require(_0x39d0('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x39d0('0xb'));var squel=require(_0x39d0('0xc'));var crypto=require('crypto');var jsforce=require(_0x39d0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x39d0('0xe'));var querystring=require(_0x39d0('0xf'));var Papa=require(_0x39d0('0x10'));var Redis=require(_0x39d0('0x11'));var authService=require(_0x39d0('0x12'));var qs=require(_0x39d0('0x13'));var as=require(_0x39d0('0x14'));var hardwareService=require(_0x39d0('0x15'));var logger=require(_0x39d0('0x16'))(_0x39d0('0x17'));var utils=require('../../config/utils');var config=require(_0x39d0('0x18'));var licenseUtil=require(_0x39d0('0x19'));var db=require(_0x39d0('0x1a'))['db'];config['redis']=_[_0x39d0('0x1b')](config[_0x39d0('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x39d0('0x1d'))(new Redis(config[_0x39d0('0x1c')]));require(_0x39d0('0x1e'))[_0x39d0('0x1f')](socket);function respondWithStatusCode(_0x35e4f5,_0x1fd87e){_0x1fd87e=_0x1fd87e||0xcc;return function(_0x4b93c4){if(_0x4b93c4){return _0x35e4f5['sendStatus'](_0x1fd87e);}return _0x35e4f5[_0x39d0('0x20')](_0x1fd87e)[_0x39d0('0x21')]();};}function respondWithResult(_0x4d8625,_0x363579){_0x363579=_0x363579||0xc8;return function(_0x1a7801){if(_0x1a7801){return _0x4d8625['status'](_0x363579)['json'](_0x1a7801);}};}function respondWithFilteredResult(_0xf8b6a8,_0x466675){return function(_0x38caac){if(_0x38caac){var _0x57e1eb=typeof _0x466675[_0x39d0('0x22')]===_0x39d0('0x23')&&typeof _0x466675[_0x39d0('0x24')]===_0x39d0('0x23');var _0x16aed9=_0x38caac[_0x39d0('0x25')];var _0x142b97=_0x57e1eb?0x0:_0x466675[_0x39d0('0x22')];var _0x25d971=_0x57e1eb?_0x38caac[_0x39d0('0x25')]:_0x466675['offset']+_0x466675[_0x39d0('0x24')];var _0x4ac584;if(_0x25d971>=_0x16aed9){_0x25d971=_0x16aed9;_0x4ac584=0xc8;}else{_0x4ac584=0xce;}_0xf8b6a8[_0x39d0('0x20')](_0x4ac584);return _0xf8b6a8['set']('Content-Range',_0x142b97+'-'+_0x25d971+'/'+_0x16aed9)['json'](_0x38caac);}return null;};}function patchUpdates(_0x26a246){return function(_0x508d8c){try{jsonpatch['apply'](_0x508d8c,_0x26a246,!![]);}catch(_0x442e4f){return BPromise['reject'](_0x442e4f);}return _0x508d8c['save']();};}function saveUpdates(_0x21579c,_0x20e2b7){return function(_0x5b9caf){if(_0x5b9caf){return _0x5b9caf[_0x39d0('0x26')](_0x21579c)[_0x39d0('0x27')](function(_0x23a3ce){return _0x23a3ce;});}return null;};}function handleEntityNotFound(_0x481db4,_0x4652ac){return function(_0x362618){if(!_0x362618){_0x481db4[_0x39d0('0x28')](0x194);}return _0x362618;};}function handleError(_0x10fd29,_0x2aa10e){_0x2aa10e=_0x2aa10e||0x1f4;return function(_0x16f49e){logger[_0x39d0('0x29')](_0x16f49e[_0x39d0('0x2a')]);if(_0x16f49e[_0x39d0('0x2b')]){delete _0x16f49e[_0x39d0('0x2b')];}_0x10fd29[_0x39d0('0x20')](_0x2aa10e)[_0x39d0('0x2c')](_0x16f49e);};}exports[_0x39d0('0x2d')]=function(_0x4d01ab,_0x2c87df){var _0x595018={},_0xe9049c={},_0x52ee6f={'count':0x0,'rows':[]};var _0x2e8c46=_[_0x39d0('0x2e')](db['Team'][_0x39d0('0x2f')],function(_0x2a0caf){return{'name':_0x2a0caf['fieldName'],'type':_0x2a0caf[_0x39d0('0x30')][_0x39d0('0x31')]};});_0xe9049c[_0x39d0('0x32')]=_[_0x39d0('0x2e')](_0x2e8c46,_0x39d0('0x2b'));_0xe9049c['query']=_[_0x39d0('0x33')](_0x4d01ab[_0x39d0('0x34')]);_0xe9049c[_0x39d0('0x35')]=_['intersection'](_0xe9049c[_0x39d0('0x32')],_0xe9049c['query']);_0x595018[_0x39d0('0x36')]=_[_0x39d0('0x37')](_0xe9049c[_0x39d0('0x32')],qs[_0x39d0('0x38')](_0x4d01ab[_0x39d0('0x34')][_0x39d0('0x38')]));_0x595018[_0x39d0('0x36')]=_0x595018['attributes'][_0x39d0('0x39')]?_0x595018[_0x39d0('0x36')]:_0xe9049c[_0x39d0('0x32')];if(!_0x4d01ab[_0x39d0('0x34')][_0x39d0('0x3a')](_0x39d0('0x3b'))){_0x595018[_0x39d0('0x24')]=qs[_0x39d0('0x24')](_0x4d01ab[_0x39d0('0x34')]['limit']);_0x595018[_0x39d0('0x22')]=qs['offset'](_0x4d01ab['query'][_0x39d0('0x22')]);}_0x595018['order']=qs[_0x39d0('0x3c')](_0x4d01ab[_0x39d0('0x34')][_0x39d0('0x3c')]);_0x595018[_0x39d0('0x3d')]=qs[_0x39d0('0x35')](_[_0x39d0('0x3e')](_0x4d01ab[_0x39d0('0x34')],_0xe9049c[_0x39d0('0x35')]),_0x2e8c46);if(_0x4d01ab[_0x39d0('0x34')]['filter']){_0x595018[_0x39d0('0x3d')]=_[_0x39d0('0x3f')](_0x595018[_0x39d0('0x3d')],{'$or':_[_0x39d0('0x2e')](_0x2e8c46,function(_0x375092){if(_0x375092[_0x39d0('0x30')]!==_0x39d0('0x40')){var _0x396527={};_0x396527[_0x375092[_0x39d0('0x2b')]]={'$like':'%'+_0x4d01ab[_0x39d0('0x34')][_0x39d0('0x41')]+'%'};return _0x396527;}})});}_0x595018=_['merge']({},_0x595018,_0x4d01ab[_0x39d0('0x42')]);var _0x3a8372={'where':_0x595018[_0x39d0('0x3d')]};return db[_0x39d0('0x43')]['count'](_0x3a8372)[_0x39d0('0x27')](function(_0x2a67bd){_0x52ee6f[_0x39d0('0x25')]=_0x2a67bd;if(_0x4d01ab['query'][_0x39d0('0x44')]){_0x595018[_0x39d0('0x45')]=[{'all':!![]}];}return db[_0x39d0('0x43')][_0x39d0('0x46')](_0x595018);})[_0x39d0('0x27')](function(_0x401943){_0x52ee6f[_0x39d0('0x47')]=_0x401943;return _0x52ee6f;})[_0x39d0('0x27')](respondWithFilteredResult(_0x2c87df,_0x595018))[_0x39d0('0x48')](handleError(_0x2c87df,null));};exports['show']=function(_0x3d40b8,_0x50f1d6){var _0x42159b={'raw':![],'where':{'id':_0x3d40b8['params']['id']}},_0x557229={};_0x557229[_0x39d0('0x32')]=_[_0x39d0('0x33')](db[_0x39d0('0x43')]['rawAttributes']);_0x557229[_0x39d0('0x34')]=_[_0x39d0('0x33')](_0x3d40b8[_0x39d0('0x34')]);_0x557229[_0x39d0('0x35')]=_[_0x39d0('0x37')](_0x557229[_0x39d0('0x32')],_0x557229[_0x39d0('0x34')]);_0x42159b[_0x39d0('0x36')]=_[_0x39d0('0x37')](_0x557229[_0x39d0('0x32')],qs[_0x39d0('0x38')](_0x3d40b8['query'][_0x39d0('0x38')]));_0x42159b[_0x39d0('0x36')]=_0x42159b[_0x39d0('0x36')]['length']?_0x42159b['attributes']:_0x557229['model'];if(_0x3d40b8[_0x39d0('0x34')]['includeAll']){_0x42159b[_0x39d0('0x45')]=[{'all':!![]}];}_0x42159b=_['merge']({},_0x42159b,_0x3d40b8[_0x39d0('0x42')]);return db['Team']['find'](_0x42159b)[_0x39d0('0x27')](handleEntityNotFound(_0x50f1d6,null))['then'](respondWithResult(_0x50f1d6,null))[_0x39d0('0x48')](handleError(_0x50f1d6,null));};exports[_0x39d0('0x49')]=function(_0xd94832,_0xc0e4ae){return db[_0x39d0('0x43')][_0x39d0('0x49')](_0xd94832[_0x39d0('0x4a')],{})['then'](function(_0x2df875){var _0x50b1b3=_0xd94832['user'][_0x39d0('0x4b')]({'plain':!![]});if(!_0x50b1b3)throw new Error(_0x39d0('0x4c'));if(_0x50b1b3['role']===_0x39d0('0x4d')){var _0x579c7a=_0x2df875[_0x39d0('0x4b')]({'plain':!![]});var _0x21cd0d=_0x39d0('0x4e');return db[_0x39d0('0x4f')][_0x39d0('0x50')]({'where':{'name':_0x21cd0d,'userProfileId':_0x50b1b3[_0x39d0('0x51')]},'raw':!![]})[_0x39d0('0x27')](function(_0x292009){if(_0x292009&&_0x292009[_0x39d0('0x52')]===0x0){return db[_0x39d0('0x53')][_0x39d0('0x49')]({'name':_0x579c7a['name'],'resourceId':_0x579c7a['id'],'type':_0x292009[_0x39d0('0x2b')],'sectionId':_0x292009['id']},{})[_0x39d0('0x27')](function(){return _0x2df875;});}else{return _0x2df875;}})[_0x39d0('0x48')](function(_0x567ef3){logger[_0x39d0('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x567ef3);throw _0x567ef3;});}return _0x2df875;})[_0x39d0('0x27')](respondWithResult(_0xc0e4ae,0xc9))[_0x39d0('0x48')](handleError(_0xc0e4ae,null));};exports[_0x39d0('0x26')]=function(_0x3c0d46,_0x306f99){if(_0x3c0d46[_0x39d0('0x4a')]['id']){delete _0x3c0d46[_0x39d0('0x4a')]['id'];}return db[_0x39d0('0x43')][_0x39d0('0x50')]({'where':{'id':_0x3c0d46[_0x39d0('0x54')]['id']}})[_0x39d0('0x27')](handleEntityNotFound(_0x306f99,null))[_0x39d0('0x27')](saveUpdates(_0x3c0d46['body'],null))[_0x39d0('0x27')](respondWithResult(_0x306f99,null))[_0x39d0('0x48')](handleError(_0x306f99,null));};exports[_0x39d0('0x55')]=function(_0x2e8653,_0xfb0e73){var _0x44d077=_0x2e8653[_0x39d0('0x54')]['id'];var _0x37db55=[];return db['sequelize'][_0x39d0('0x56')](function(_0x2ac654){var _0x4c603e=_0x39d0('0x57')+_0x44d077;return db[_0x39d0('0x58')][_0x39d0('0x34')](_0x4c603e,{'type':db[_0x39d0('0x59')][_0x39d0('0x5a')]['SELECT'],'raw':!![],'transaction':_0x2ac654})[_0x39d0('0x27')](function(_0x5164fe){_0x37db55=_['map'](_0x5164fe,function(_0x32b4a6){return Number(_0x32b4a6[_0x39d0('0x5b')]);});})[_0x39d0('0x27')](function(){var _0x7b90c1=_0x39d0('0x5c')+_0x44d077;return db['sequelize']['query'](_0x7b90c1,{'type':db[_0x39d0('0x59')][_0x39d0('0x5a')][_0x39d0('0x5d')],'raw':!![],'transaction':_0x2ac654});})[_0x39d0('0x27')](function(_0x14f19b){var _0x112b3a=_['map'](_0x14f19b,function(_0x4cc452){return Number(_0x4cc452[_0x39d0('0x5e')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x37db55},'VoiceQueueId':{'$in':_0x112b3a}},'transaction':_0x2ac654});})[_0x39d0('0x27')](function(){var _0x447e39=_0x39d0('0x5f')+_0x44d077;return db['sequelize'][_0x39d0('0x34')](_0x447e39,{'type':db['Sequelize'][_0x39d0('0x5a')][_0x39d0('0x5d')],'raw':!![],'transaction':_0x2ac654});})[_0x39d0('0x27')](function(_0x330c26){var _0x27023a=_['map'](_0x330c26,function(_0x17b777){return Number(_0x17b777['MailQueueId']);});return db[_0x39d0('0x60')][_0x39d0('0x55')]({'where':{'UserId':{'$in':_0x37db55},'MailQueueId':{'$in':_0x27023a}},'transaction':_0x2ac654});})[_0x39d0('0x27')](function(){var _0x4ccb8d=_0x39d0('0x61')+_0x44d077;return db[_0x39d0('0x58')][_0x39d0('0x34')](_0x4ccb8d,{'type':db['Sequelize'][_0x39d0('0x5a')]['SELECT'],'raw':!![],'transaction':_0x2ac654});})[_0x39d0('0x27')](function(_0x3a9443){var _0x42db26=_['map'](_0x3a9443,function(_0x5065b5){return Number(_0x5065b5['SmsQueueId']);});return db[_0x39d0('0x62')]['destroy']({'where':{'UserId':{'$in':_0x37db55},'SmsQueueId':{'$in':_0x42db26}},'transaction':_0x2ac654});})['then'](function(){var _0xe883d5=_0x39d0('0x63')+_0x44d077;return db[_0x39d0('0x58')][_0x39d0('0x34')](_0xe883d5,{'type':db['Sequelize'][_0x39d0('0x5a')][_0x39d0('0x5d')],'raw':!![],'transaction':_0x2ac654});})['then'](function(_0x753a42){var _0xef7c57=_[_0x39d0('0x2e')](_0x753a42,function(_0x408abd){return Number(_0x408abd[_0x39d0('0x64')]);});return db[_0x39d0('0x65')]['destroy']({'where':{'UserId':{'$in':_0x37db55},'ChatQueueId':{'$in':_0xef7c57}},'transaction':_0x2ac654});})[_0x39d0('0x27')](function(){var _0x588dc0='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x44d077;return db[_0x39d0('0x58')][_0x39d0('0x34')](_0x588dc0,{'type':db[_0x39d0('0x59')][_0x39d0('0x5a')][_0x39d0('0x5d')],'raw':!![],'transaction':_0x2ac654});})['then'](function(_0x1f049f){var _0x427097=_[_0x39d0('0x2e')](_0x1f049f,function(_0x19a6cc){return Number(_0x19a6cc[_0x39d0('0x66')]);});return db[_0x39d0('0x67')]['destroy']({'where':{'UserId':{'$in':_0x37db55},'FaxQueueId':{'$in':_0x427097}},'transaction':_0x2ac654});})['then'](function(){var _0x2d08d4=_0x39d0('0x68')+_0x44d077;return db[_0x39d0('0x58')]['query'](_0x2d08d4,{'type':db['Sequelize'][_0x39d0('0x5a')][_0x39d0('0x5d')],'raw':!![],'transaction':_0x2ac654});})[_0x39d0('0x27')](function(_0xa8df25){var _0x12725a=_[_0x39d0('0x2e')](_0xa8df25,function(_0x56d341){return Number(_0x56d341[_0x39d0('0x69')]);});return db[_0x39d0('0x6a')][_0x39d0('0x55')]({'where':{'UserId':{'$in':_0x37db55},'OpenchannelQueueId':{'$in':_0x12725a}},'transaction':_0x2ac654});})[_0x39d0('0x27')](function(){var _0x355c12=_0x39d0('0x6b')+_0x44d077;return db[_0x39d0('0x58')][_0x39d0('0x34')](_0x355c12,{'type':db['Sequelize'][_0x39d0('0x5a')]['SELECT'],'raw':!![],'transaction':_0x2ac654});})[_0x39d0('0x27')](function(_0x21ea41){var _0x155701=_[_0x39d0('0x2e')](_0x21ea41,function(_0x5dd892){return Number(_0x5dd892[_0x39d0('0x6c')]);});return db[_0x39d0('0x6d')][_0x39d0('0x55')]({'where':{'UserId':{'$in':_0x37db55},'WhatsappQueueId':{'$in':_0x155701}},'transaction':_0x2ac654});})[_0x39d0('0x27')](function(){return db['TeamVoicePrefix'][_0x39d0('0x50')]({'where':{'TeamId':_0x44d077}});})['then'](function(_0x4d078f){if(_0x4d078f===null){return;}return db[_0x39d0('0x6e')][_0x39d0('0x55')]({'where':{'UserId':{'$in':_0x37db55},'VoicePrefixId':_0x4d078f[_0x39d0('0x6f')]},'transaction':_0x2ac654});})[_0x39d0('0x27')](function(){return db[_0x39d0('0x43')][_0x39d0('0x55')]({'where':{'id':_0x44d077},'cascade':!![],'transaction':_0x2ac654});})[_0x39d0('0x27')](function(_0x4a25dc){if(_0x4a25dc===0x0){_0xfb0e73['sendStatus'](0x194);}else{return db[_0x39d0('0x53')][_0x39d0('0x55')]({'where':{'type':_0x39d0('0x4e'),'resourceId':_0x44d077},'cascade':!![],'transaction':_0x2ac654})[_0x39d0('0x27')](function(){_0xfb0e73['status'](0xcc)['end']();});}})[_0x39d0('0x48')](function(_0x3db4c8){_0xfb0e73[_0x39d0('0x20')](0x1f4)['send'](_0x3db4c8);});});};exports[_0x39d0('0x70')]=function(_0x52d2d6,_0x3aea66,_0x462345){return db[_0x39d0('0x43')][_0x39d0('0x71')]({'where':{'id':_0x52d2d6['params']['id']}})[_0x39d0('0x27')](handleEntityNotFound(_0x3aea66,null))[_0x39d0('0x27')](function(_0x53b35f){if(!_0x52d2d6[_0x39d0('0x34')][_0x39d0('0x72')]||!utils[_0x39d0('0x73')](_0x52d2d6[_0x39d0('0x34')][_0x39d0('0x72')])){throw new db[(_0x39d0('0x59'))][(_0x39d0('0x74'))]('Unknown\x20channel');}var _0x5cabf7={};var _0x22d819={};_0x22d819['model']=_['keys'](db[_['capitalize'](_0x52d2d6[_0x39d0('0x34')][_0x39d0('0x72')][_0x39d0('0x75')]())+_0x39d0('0x76')][_0x39d0('0x2f')]);_0x22d819['query']=_['keys'](_0x52d2d6[_0x39d0('0x34')]);_0x22d819[_0x39d0('0x35')]=_[_0x39d0('0x37')](_0x22d819['model'],_0x22d819[_0x39d0('0x34')]);_0x5cabf7[_0x39d0('0x36')]=_['intersection'](_0x22d819[_0x39d0('0x32')],qs[_0x39d0('0x38')](_0x52d2d6[_0x39d0('0x34')][_0x39d0('0x38')]));_0x5cabf7[_0x39d0('0x36')]=_0x5cabf7[_0x39d0('0x36')][_0x39d0('0x39')]?_0x5cabf7['attributes']:_0x22d819[_0x39d0('0x32')];_0x5cabf7[_0x39d0('0x24')]=qs[_0x39d0('0x24')](_0x52d2d6[_0x39d0('0x34')][_0x39d0('0x24')]);_0x5cabf7[_0x39d0('0x22')]=qs[_0x39d0('0x22')](_0x52d2d6[_0x39d0('0x34')][_0x39d0('0x22')]);_0x5cabf7['order']=qs[_0x39d0('0x3c')](_0x52d2d6['query'][_0x39d0('0x3c')]);_0x5cabf7['where']=qs[_0x39d0('0x35')](_[_0x39d0('0x3e')](_0x52d2d6['query'],_0x22d819[_0x39d0('0x35')]));_0x5cabf7=_['merge']({},_0x5cabf7,_0x52d2d6[_0x39d0('0x42')]);return _0x53b35f['get'+_[_0x39d0('0x77')](_0x52d2d6[_0x39d0('0x34')][_0x39d0('0x72')]['toLowerCase']())+_0x39d0('0x78')](_0x5cabf7);})[_0x39d0('0x27')](respondWithResult(_0x3aea66,null))[_0x39d0('0x48')](handleError(_0x3aea66,null));};exports[_0x39d0('0x79')]=function(_0x57ac19,_0x11e16d,_0x123d43){return db['Team'][_0x39d0('0x71')]({'where':{'id':_0x57ac19[_0x39d0('0x54')]['id']}})[_0x39d0('0x27')](function(_0x26cbb9){if(_0x26cbb9){if(!_0x57ac19[_0x39d0('0x4a')][_0x39d0('0x72')]||!utils['isValidChannel'](_0x57ac19[_0x39d0('0x4a')]['channel'])){throw new db[(_0x39d0('0x59'))]['ValidationError'](_0x39d0('0x7a'));}return _0x26cbb9[_0x39d0('0x7b')+_[_0x39d0('0x77')](_0x57ac19[_0x39d0('0x4a')]['channel']['toLowerCase']())+_0x39d0('0x78')](_0x57ac19[_0x39d0('0x4a')]['ids']);}return null;})[_0x39d0('0x27')](handleEntityNotFound(_0x11e16d,null))[_0x39d0('0x27')](respondWithStatusCode(_0x11e16d,null))[_0x39d0('0x48')](handleError(_0x11e16d,null));};exports[_0x39d0('0x7c')]=function(_0x2b7dc4,_0x29acd8,_0x580e67){return db['Team'][_0x39d0('0x71')]({'where':{'id':_0x2b7dc4[_0x39d0('0x54')]['id']}})['then'](function(_0x49e237){if(_0x49e237){if(!_0x2b7dc4[_0x39d0('0x34')]['channel']||!utils[_0x39d0('0x73')](_0x2b7dc4['query'][_0x39d0('0x72')])){throw new db[(_0x39d0('0x59'))][(_0x39d0('0x74'))](_0x39d0('0x7a'));}return _0x49e237['remove'+_[_0x39d0('0x77')](_0x2b7dc4[_0x39d0('0x34')][_0x39d0('0x72')][_0x39d0('0x75')]())+_0x39d0('0x78')](_0x2b7dc4['query']['ids']);}return null;})[_0x39d0('0x27')](handleEntityNotFound(_0x29acd8,null))[_0x39d0('0x27')](respondWithStatusCode(_0x29acd8,null))[_0x39d0('0x48')](handleError(_0x29acd8,null));};exports[_0x39d0('0x7d')]=function(_0x5689fe,_0x5cf150){var _0xbe6938=_[_0x39d0('0x7e')](_0x5689fe[_0x39d0('0x4a')][_0x39d0('0x7f')])?_0x5689fe[_0x39d0('0x4a')][_0x39d0('0x7f')]:[_0x5689fe[_0x39d0('0x4a')][_0x39d0('0x7f')]];var _0x85baa9=_0x5689fe['params']['id'];return db[_0x39d0('0x43')]['find']({'where':{'id':_0x85baa9}})[_0x39d0('0x27')](handleEntityNotFound(_0x5cf150,null))[_0x39d0('0x27')](function(_0x354d82){if(_0x354d82){var _0x44c057=[_0x39d0('0x80'),_0x39d0('0x81'),_0x39d0('0x82'),_0x39d0('0x83'),_0x39d0('0x84'),_0x39d0('0x85'),'Whatsapp'];return db[_0x39d0('0x58')]['transaction'](function(_0x5ef2d6){var _0x6f361b=_['map'](_0x44c057,function(_0x5acfe6){var _0x300f37={'attributes':['id',_0x39d0('0x2b')]};if(_0x5acfe6===_0x39d0('0x80')){_0x300f37['through']={'attributes':[_0x39d0('0x86')]};}return _0x354d82[_0x39d0('0x4b')+_0x5acfe6+_0x39d0('0x78')](_0x300f37)[_0x39d0('0x27')](function(_0x380c95){var _0xf3598b=_[_0x39d0('0x2e')](_0x380c95,function(_0xda285d){var _0x440ff3=_[_0x39d0('0x2e')](_0xbe6938,function(_0x119fc7){var _0x28d0cf={'where':{'UserId':_0x119fc7,[_0x5acfe6+'QueueId']:_0xda285d['id']},'transaction':_0x5ef2d6};if(_0x5acfe6==='Voice'){_0x28d0cf['defaults']={'penalty':_0xda285d['TeamVoiceQueue'][_0x39d0('0x86')]};}return db['User'+_0x5acfe6+_0x39d0('0x76')][_0x39d0('0x87')](_0x28d0cf)['then'](function(){socket[_0x39d0('0x88')](_0x39d0('0x4d')+_0x5acfe6+_0x39d0('0x89'),{'UserId':_0x119fc7,[_0x5acfe6+_0x39d0('0x8a')]:_0xda285d['id']});if(_0x5acfe6!==_0x39d0('0x80')){return;}return db['User'][_0x39d0('0x46')]({'where':{'id':_0xbe6938,'online':0x1},'attributes':['id',_0x39d0('0x2b'),'online','voicePause','interface'],'raw':!![]})['then'](function(_0x33c3b5){var _0x31ef0c=_['map'](_0x33c3b5,function(_0x558c44){return db['UserVoiceQueueRt'][_0x39d0('0x8b')]({'membername':_0x558c44[_0x39d0('0x2b')],'UserId':_0x558c44['id'],'queue_name':_0xda285d[_0x39d0('0x2b')],'VoiceQueueId':_0xda285d['id'],'interface':_['isNil'](_0x558c44[_0x39d0('0x8c')])?util[_0x39d0('0x8d')]('SIP/%s',_0x558c44[_0x39d0('0x2b')]):_0x558c44[_0x39d0('0x8c')],'paused':_0x558c44[_0x39d0('0x8e')]||![],'penalty':_0xda285d[_0x39d0('0x8f')][_0x39d0('0x86')]},{'transaction':_0x5ef2d6});});return Promise[_0x39d0('0x90')](_0x31ef0c);});});});return Promise[_0x39d0('0x90')](_0x440ff3);});return Promise[_0x39d0('0x90')](_0xf3598b);})['then'](function(){return db['TeamVoicePrefix'][_0x39d0('0x71')]({'where':{'teamId':_0x85baa9}})[_0x39d0('0x27')](function(_0x5c53d8){if(_0x5c53d8){var _0x142671=_[_0x39d0('0x2e')](_0xbe6938,function(_0x1d7745){db[_0x39d0('0x6e')][_0x39d0('0x8b')]({'UserId':_0x1d7745,'VoicePrefixId':_0x5c53d8[_0x39d0('0x6f')]});});return Promise[_0x39d0('0x90')](_0x142671);}});});});return Promise[_0x39d0('0x90')](_0x6f361b)[_0x39d0('0x27')](function(){return _0x354d82[_0x39d0('0x7d')](_0xbe6938,{'transaction':_0x5ef2d6})['spread'](function(_0x5d5c0a){return _0x5d5c0a;});});});}})[_0x39d0('0x27')](respondWithResult(_0x5cf150,null))[_0x39d0('0x48')](handleError(_0x5cf150,null));};exports[_0x39d0('0x91')]=function(_0x251981,_0x414a98){var _0x3a3cc2=_[_0x39d0('0x7e')](_0x251981[_0x39d0('0x34')][_0x39d0('0x7f')])?_0x251981['query'][_0x39d0('0x7f')]:[_0x251981[_0x39d0('0x34')][_0x39d0('0x7f')]];var _0x455c4a=_0x251981[_0x39d0('0x54')]['id'];return db['Team'][_0x39d0('0x50')]({'where':{'id':_0x455c4a}})[_0x39d0('0x27')](handleEntityNotFound(_0x414a98,null))[_0x39d0('0x27')](function(_0x37f593){if(_0x37f593){var _0x2ca438=[_0x39d0('0x80'),_0x39d0('0x81'),'Mail',_0x39d0('0x83'),_0x39d0('0x84'),'Openchannel','Whatsapp'];return db[_0x39d0('0x58')][_0x39d0('0x56')](function(_0x537305){var _0x24fe11=_[_0x39d0('0x2e')](_0x2ca438,function(_0x3ba706){var _0x1fb5e2={'attributes':['id',_0x39d0('0x2b')]};return _0x37f593[_0x39d0('0x4b')+_0x3ba706+_0x39d0('0x78')](_0x1fb5e2)[_0x39d0('0x27')](function(_0x3cec33){var _0x5db10e=_[_0x39d0('0x2e')](_0x3cec33,function(_0x354659){return _0x354659[_0x39d0('0x91')](_0x3a3cc2,{'transaction':_0x537305})[_0x39d0('0x27')](function(){var _0x41e651=_[_0x39d0('0x2e')](_0x3a3cc2,function(_0x58fce0){socket[_0x39d0('0x88')](_0x39d0('0x4d')+_0x3ba706+_0x39d0('0x92'),{'UserId':Number(_0x58fce0),[_0x3ba706+'QueueId']:_0x354659['id']});if(_0x3ba706!==_0x39d0('0x80')){return;}return db[_0x39d0('0x93')][_0x39d0('0x55')]({'where':{'VoiceQueueId':_0x354659['id'],'UserId':_0x58fce0},'transaction':_0x537305});});return Promise[_0x39d0('0x90')](_0x41e651);});});return Promise[_0x39d0('0x90')](_0x5db10e);});});return Promise[_0x39d0('0x90')](_0x24fe11)['then'](function(){return _0x37f593[_0x39d0('0x91')](_0x3a3cc2,{'transaction':_0x537305});})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x455c4a}})[_0x39d0('0x27')](function(_0x20af5a){if(_0x20af5a){var _0x3155df=_['map'](_0x3a3cc2,function(_0x3e6762){db[_0x39d0('0x6e')]['destroy']({'where':{'UserId':_0x3e6762,'VoicePrefixId':_0x20af5a['VoicePrefixId']}});});return Promise[_0x39d0('0x90')](_0x3155df);}});});});}})[_0x39d0('0x27')](respondWithStatusCode(_0x414a98,null))['catch'](handleError(_0x414a98,null));};exports[_0x39d0('0x94')]=function(_0x4ab02e,_0x1e31a0,_0x525ecf){var _0x5a5773={};var _0x131ee2={};var _0x4918cf;var _0x2dd47c;return db['Team']['findOne']({'where':{'id':_0x4ab02e[_0x39d0('0x54')]['id']}})['then'](handleEntityNotFound(_0x1e31a0,null))[_0x39d0('0x27')](function(_0x3ac34f){if(_0x3ac34f){_0x4918cf=_0x3ac34f;_0x131ee2[_0x39d0('0x32')]=_['keys'](db[_0x39d0('0x95')]['rawAttributes']);_0x131ee2[_0x39d0('0x34')]=_[_0x39d0('0x33')](_0x4ab02e[_0x39d0('0x34')]);_0x131ee2[_0x39d0('0x35')]=_[_0x39d0('0x37')](_0x131ee2[_0x39d0('0x32')],_0x131ee2[_0x39d0('0x34')]);_0x5a5773[_0x39d0('0x36')]=_[_0x39d0('0x37')](_0x131ee2['model'],qs[_0x39d0('0x38')](_0x4ab02e[_0x39d0('0x34')][_0x39d0('0x38')]));_0x5a5773['attributes']=_0x5a5773[_0x39d0('0x36')]['length']?_0x5a5773['attributes']:_0x131ee2['model'];_0x5a5773[_0x39d0('0x96')]=qs[_0x39d0('0x3c')](_0x4ab02e[_0x39d0('0x34')][_0x39d0('0x3c')]);_0x5a5773['where']=qs['filters'](_[_0x39d0('0x3e')](_0x4ab02e[_0x39d0('0x34')],_0x131ee2['filters']));if(_0x4ab02e[_0x39d0('0x34')][_0x39d0('0x41')]){_0x5a5773[_0x39d0('0x3d')]=_[_0x39d0('0x3f')](_0x5a5773[_0x39d0('0x3d')],{'$or':_['map'](_0x5a5773[_0x39d0('0x36')],function(_0x42a09a){var _0x2f0548={};_0x2f0548[_0x42a09a]={'$like':'%'+_0x4ab02e['query'][_0x39d0('0x41')]+'%'};return _0x2f0548;})});}_0x5a5773=_[_0x39d0('0x3f')]({},_0x5a5773,_0x4ab02e[_0x39d0('0x42')]);return _0x4918cf[_0x39d0('0x94')](_0x5a5773);}})[_0x39d0('0x27')](function(_0x53b8c1){if(_0x53b8c1){_0x2dd47c=_0x53b8c1[_0x39d0('0x39')];if(!_0x4ab02e[_0x39d0('0x34')][_0x39d0('0x3a')](_0x39d0('0x3b'))){_0x5a5773[_0x39d0('0x24')]=qs[_0x39d0('0x24')](_0x4ab02e[_0x39d0('0x34')]['limit']);_0x5a5773[_0x39d0('0x22')]=qs['offset'](_0x4ab02e[_0x39d0('0x34')][_0x39d0('0x22')]);}return _0x4918cf[_0x39d0('0x94')](_0x5a5773);}})['then'](function(_0xc783e7){if(_0xc783e7){return _0xc783e7?{'count':_0x2dd47c,'rows':_0xc783e7}:null;}})[_0x39d0('0x27')](respondWithResult(_0x1e31a0,null))['catch'](handleError(_0x1e31a0,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0decb25..3768721 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 _0x8089=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','remove','emit'];(function(_0x549daf,_0x22ae61){var _0x513d31=function(_0xe11d95){while(--_0xe11d95){_0x549daf['push'](_0x549daf['shift']());}};_0x513d31(++_0x22ae61);}(_0x8089,0x158));var _0x9808=function(_0x665225,_0x2255e8){_0x665225=_0x665225-0x0;var _0x4d0bec=_0x8089[_0x665225];return _0x4d0bec;};'use strict';var EventEmitter=require(_0x9808('0x0'));var Team=require(_0x9808('0x1'))['db'][_0x9808('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x9808('0x3')](0x0);var events={'afterCreate':_0x9808('0x4'),'afterUpdate':'update','afterDestroy':_0x9808('0x5')};function emitEvent(_0x225213){return function(_0x13cf4d,_0x8fee5e,_0x3f9f5f){TeamEvents[_0x9808('0x6')](_0x225213+':'+_0x13cf4d['id'],_0x13cf4d);TeamEvents[_0x9808('0x6')](_0x225213,_0x13cf4d);_0x3f9f5f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x9808('0x7')](e,emitEvent(event));}}module[_0x9808('0x8')]=TeamEvents; \ No newline at end of file +var _0x51c1=['events','../../mysqldb','Team','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x1c8c07,_0x2579af){var _0x4aa88f=function(_0x2ad13d){while(--_0x2ad13d){_0x1c8c07['push'](_0x1c8c07['shift']());}};_0x4aa88f(++_0x2579af);}(_0x51c1,0x14d));var _0x151c=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x51c1[_0x46a38b];return _0x346e75;};'use strict';var EventEmitter=require(_0x151c('0x0'));var Team=require(_0x151c('0x1'))['db'][_0x151c('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x151c('0x3')](0x0);var events={'afterCreate':_0x151c('0x4'),'afterUpdate':_0x151c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x30c639){return function(_0x991fa6,_0xa704c4,_0x328635){TeamEvents[_0x151c('0x6')](_0x30c639+':'+_0x991fa6['id'],_0x991fa6);TeamEvents[_0x151c('0x6')](_0x30c639,_0x991fa6);_0x328635(null);};}for(var e in events){if(events[_0x151c('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x151c('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index ab7caaa..be30e7a 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 _0x31ae=['teams','Chat','Mail','Openchannel','Sms','Voice','Whatsapp','all','get','then','map','channel','catch','exports','define','Team'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31ae,0x88));var _0xe31a=function(_0x3c5503,_0x2b568d){_0x3c5503=_0x3c5503-0x0;var _0x5571a6=_0x31ae[_0x3c5503];return _0x5571a6;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x5c0565,_0x4b6ca0){var _0x150858=_0xe31a('0x0')+_0x4b6ca0+'Queues';return _0x5c0565[_0x150858]()[_0xe31a('0x1')](function(_0x3b2bd0){return _[_0xe31a('0x2')](_0x3b2bd0,function(_0x42d954){_0x42d954['setDataValue'](_0xe31a('0x3'),_0x4b6ca0);return _0x42d954;});})[_0xe31a('0x4')](function(_0x31b08e){throw _0x31b08e;});}module[_0xe31a('0x5')]=function(_0x2f1ab0){return _0x2f1ab0[_0xe31a('0x6')](_0xe31a('0x7'),attributes,{'tableName':_0xe31a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x50e632=this;var _0x382d93=[_0xe31a('0x9'),'Fax',_0xe31a('0xa'),_0xe31a('0xb'),_0xe31a('0xc'),_0xe31a('0xd'),_0xe31a('0xe')];return Promise['resolve']()[_0xe31a('0x1')](function(){var _0x3f1c25=_[_0xe31a('0x2')](_0x382d93,function(_0x59c2ee){return getQueuesByChannel(_0x50e632,_0x59c2ee);});return Promise[_0xe31a('0xf')](_0x3f1c25);})['catch'](function(_0x54674b){throw _0x54674b;});}}});}; \ No newline at end of file +var _0x9ebc=['all','get','then','map','setDataValue','channel','catch','exports','define','teams','Chat','Fax','Openchannel','Voice','resolve'];(function(_0x25d2fb,_0x18a774){var _0x1ded53=function(_0x4c0715){while(--_0x4c0715){_0x25d2fb['push'](_0x25d2fb['shift']());}};_0x1ded53(++_0x18a774);}(_0x9ebc,0x1b4));var _0xc9eb=function(_0x310690,_0xe580d5){_0x310690=_0x310690-0x0;var _0x10ccb9=_0x9ebc[_0x310690];return _0x10ccb9;};'use strict';var _=require('lodash');var attributes=require('./team.attributes');function getQueuesByChannel(_0x64f7c8,_0x48cef9){var _0x2e07d2=_0xc9eb('0x0')+_0x48cef9+'Queues';return _0x64f7c8[_0x2e07d2]()[_0xc9eb('0x1')](function(_0xe23ac5){return _[_0xc9eb('0x2')](_0xe23ac5,function(_0x47cf3c){_0x47cf3c[_0xc9eb('0x3')](_0xc9eb('0x4'),_0x48cef9);return _0x47cf3c;});})[_0xc9eb('0x5')](function(_0x37e08e){throw _0x37e08e;});}module[_0xc9eb('0x6')]=function(_0x16cd93){return _0x16cd93[_0xc9eb('0x7')]('Team',attributes,{'tableName':_0xc9eb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x12eb23=this;var _0x3f2a5d=[_0xc9eb('0x9'),_0xc9eb('0xa'),'Mail',_0xc9eb('0xb'),'Sms',_0xc9eb('0xc'),'Whatsapp'];return Promise[_0xc9eb('0xd')]()[_0xc9eb('0x1')](function(){var _0xc392ae=_[_0xc9eb('0x2')](_0x3f2a5d,function(_0xd7598b){return getQueuesByChannel(_0x12eb23,_0xd7598b);});return Promise[_0xc9eb('0xe')](_0xc392ae);})[_0xc9eb('0x5')](function(_0x54cefb){throw _0x54cefb;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index b483305..6a73b60 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 _0x74b6=['catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2cd9ed,_0x5b50f3){var _0x44d6ba=function(_0x1b989e){while(--_0x1b989e){_0x2cd9ed['push'](_0x2cd9ed['shift']());}};_0x44d6ba(++_0x5b50f3);}(_0x74b6,0x178));var _0x674b=function(_0x4ccfd7,_0x3681f8){_0x4ccfd7=_0x4ccfd7-0x0;var _0x2ee3db=_0x74b6[_0x4ccfd7];return _0x2ee3db;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x674b('0x0'));var BPromise=require(_0x674b('0x1'));var rs=require(_0x674b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x674b('0x3'))['db'];var utils=require(_0x674b('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x674b('0x5'));var jayson=require(_0x674b('0x6'));var client=jayson['client'][_0x674b('0x7')]({'port':0x232a});config[_0x674b('0x8')]=_['defaults'](config[_0x674b('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x674b('0x9'))(new Redis(config[_0x674b('0x8')]));require(_0x674b('0xa'))[_0x674b('0xb')](socket);function respondWithRpcPromise(_0x47bda1,_0x11476f,_0x2a5825){return new BPromise(function(_0x31341d,_0x4a7caa){return client[_0x674b('0xc')](_0x47bda1,_0x2a5825)[_0x674b('0xd')](function(_0x39235a){logger[_0x674b('0xe')](_0x674b('0xf'),_0x11476f,'request\x20sent');logger[_0x674b('0x10')](_0x674b('0x11'),_0x11476f,_0x674b('0x12'),JSON[_0x674b('0x13')](_0x39235a));if(_0x39235a['error']){if(_0x39235a[_0x674b('0x14')][_0x674b('0x15')]===0x1f4){logger[_0x674b('0x14')](_0x674b('0xf'),_0x11476f,_0x39235a[_0x674b('0x14')]['message']);return _0x4a7caa(_0x39235a[_0x674b('0x14')]['message']);}logger[_0x674b('0x14')](_0x674b('0xf'),_0x11476f,_0x39235a[_0x674b('0x14')][_0x674b('0x16')]);return _0x31341d(_0x39235a[_0x674b('0x14')][_0x674b('0x16')]);}else{logger[_0x674b('0xe')](_0x674b('0xf'),_0x11476f,_0x674b('0x12'));_0x31341d(_0x39235a[_0x674b('0x17')]['message']);}})[_0x674b('0x18')](function(_0x5acd41){logger[_0x674b('0x14')]('Team,\x20%s,\x20%s',_0x11476f,_0x5acd41);_0x4a7caa(_0x5acd41);});});} \ No newline at end of file +var _0x90c3=['debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','then','Team,\x20%s,\x20%s'];(function(_0x220008,_0x19d6cf){var _0x540d32=function(_0x4fd2f7){while(--_0x4fd2f7){_0x220008['push'](_0x220008['shift']());}};_0x540d32(++_0x19d6cf);}(_0x90c3,0x192));var _0x390c=function(_0x486562,_0x3690f3){_0x486562=_0x486562-0x0;var _0x1162f9=_0x90c3[_0x486562];return _0x1162f9;};'use strict';var _=require(_0x390c('0x0'));var util=require(_0x390c('0x1'));var moment=require('moment');var BPromise=require(_0x390c('0x2'));var rs=require(_0x390c('0x3'));var fs=require('fs');var Redis=require(_0x390c('0x4'));var db=require(_0x390c('0x5'))['db'];var utils=require(_0x390c('0x6'));var logger=require(_0x390c('0x7'))('rpc');var config=require(_0x390c('0x8'));var jayson=require(_0x390c('0x9'));var client=jayson[_0x390c('0xa')]['http']({'port':0x232a});config[_0x390c('0xb')]=_[_0x390c('0xc')](config[_0x390c('0xb')],{'host':_0x390c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x390c('0xb')]));require('./team.socket')[_0x390c('0xe')](socket);function respondWithRpcPromise(_0x5144cd,_0x59322e,_0x136800){return new BPromise(function(_0x5e3307,_0x57e85b){return client[_0x390c('0xf')](_0x5144cd,_0x136800)[_0x390c('0x10')](function(_0x1af91d){logger['info'](_0x390c('0x11'),_0x59322e,'request\x20sent');logger[_0x390c('0x12')](_0x390c('0x13'),_0x59322e,'request\x20sent',JSON[_0x390c('0x14')](_0x1af91d));if(_0x1af91d[_0x390c('0x15')]){if(_0x1af91d[_0x390c('0x15')][_0x390c('0x16')]===0x1f4){logger[_0x390c('0x15')](_0x390c('0x11'),_0x59322e,_0x1af91d[_0x390c('0x15')][_0x390c('0x17')]);return _0x57e85b(_0x1af91d['error'][_0x390c('0x17')]);}logger[_0x390c('0x15')](_0x390c('0x11'),_0x59322e,_0x1af91d[_0x390c('0x15')]['message']);return _0x5e3307(_0x1af91d[_0x390c('0x15')][_0x390c('0x17')]);}else{logger[_0x390c('0x18')]('Team,\x20%s,\x20%s',_0x59322e,_0x390c('0x19'));_0x5e3307(_0x1af91d[_0x390c('0x1a')][_0x390c('0x17')]);}})[_0x390c('0x1b')](function(_0x3d9cd5){logger['error'](_0x390c('0x11'),_0x59322e,_0x3d9cd5);_0x57e85b(_0x3d9cd5);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index b870be0..d338a6d 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 _0x46d1=['team:','./team.events','save','remove','update','removeListener','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x46d1,0xbe));var _0x146d=function(_0x16b6c8,_0x50cb52){_0x16b6c8=_0x16b6c8-0x0;var _0x196c4e=_0x46d1[_0x16b6c8];return _0x196c4e;};'use strict';var TeamEvents=require(_0x146d('0x0'));var events=[_0x146d('0x1'),_0x146d('0x2'),_0x146d('0x3')];function createListener(_0x3f4105,_0x3b4d39){return function(_0x4766e6){_0x3b4d39['emit'](_0x3f4105,_0x4766e6);};}function removeListener(_0x28792c,_0x430bb9){return function(){TeamEvents[_0x146d('0x4')](_0x28792c,_0x430bb9);};}exports['register']=function(_0x3a122d){for(var _0x5aa0d8=0x0,_0x88a7fe=events[_0x146d('0x5')];_0x5aa0d8<_0x88a7fe;_0x5aa0d8++){var _0x37e0ca=events[_0x5aa0d8];var _0x4b67f2=createListener(_0x146d('0x6')+_0x37e0ca,_0x3a122d);TeamEvents['on'](_0x37e0ca,_0x4b67f2);}}; \ No newline at end of file +var _0x1572=['update','emit','removeListener','register','length','./team.events','save','remove'];(function(_0x24487f,_0x9b3ea0){var _0x456456=function(_0x2ba373){while(--_0x2ba373){_0x24487f['push'](_0x24487f['shift']());}};_0x456456(++_0x9b3ea0);}(_0x1572,0xf5));var _0x2157=function(_0x32fa75,_0x1153ae){_0x32fa75=_0x32fa75-0x0;var _0x22501c=_0x1572[_0x32fa75];return _0x22501c;};'use strict';var TeamEvents=require(_0x2157('0x0'));var events=[_0x2157('0x1'),_0x2157('0x2'),_0x2157('0x3')];function createListener(_0x11c390,_0x18c6ec){return function(_0x9a039b){_0x18c6ec[_0x2157('0x4')](_0x11c390,_0x9a039b);};}function removeListener(_0x214311,_0x30e5c6){return function(){TeamEvents[_0x2157('0x5')](_0x214311,_0x30e5c6);};}exports[_0x2157('0x6')]=function(_0x2f13ab){for(var _0x9e1c46=0x0,_0x286be0=events[_0x2157('0x7')];_0x9e1c46<_0x286be0;_0x9e1c46++){var _0x471e09=events[_0x9e1c46];var _0x91bf75=createListener('team:'+_0x471e09,_0x2f13ab);TeamEvents['on'](_0x471e09,_0x91bf75);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 74c110d..eac1e8e 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 _0x7c21=['exports','INTEGER','sequelize'];(function(_0x19c37a,_0x26827a){var _0x38fae9=function(_0x1b558f){while(--_0x1b558f){_0x19c37a['push'](_0x19c37a['shift']());}};_0x38fae9(++_0x26827a);}(_0x7c21,0x1e2));var _0x17c2=function(_0x3f8c4,_0xbce0dc){_0x3f8c4=_0x3f8c4-0x0;var _0xcaa405=_0x7c21[_0x3f8c4];return _0xcaa405;};'use strict';var Sequelize=require(_0x17c2('0x0'));module[_0x17c2('0x1')]={'TeamId':{'type':Sequelize[_0x17c2('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xb32d=['sequelize','exports','INTEGER'];(function(_0x260bd7,_0x3912e9){var _0x533577=function(_0x546e4e){while(--_0x546e4e){_0x260bd7['push'](_0x260bd7['shift']());}};_0x533577(++_0x3912e9);}(_0xb32d,0x1da));var _0xdb32=function(_0x11c06e,_0x1cb9c7){_0x11c06e=_0x11c06e-0x0;var _0x20a7dc=_0xb32d[_0x11c06e];return _0x20a7dc;};'use strict';var Sequelize=require(_0xdb32('0x0'));module[_0xdb32('0x1')]={'TeamId':{'type':Sequelize[_0xdb32('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xdb32('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 5d7c57c..2542673 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 _0xabad=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabad,0x150));var _0xdaba=function(_0x319d77,_0x445f72){_0x319d77=_0x319d77-0x0;var _0x1dd41c=_0xabad[_0x319d77];return _0x1dd41c;};'use strict';var _=require(_0xdaba('0x0'));var util=require('util');var logger=require(_0xdaba('0x1'))(_0xdaba('0x2'));var moment=require(_0xdaba('0x3'));var BPromise=require('bluebird');var rp=require(_0xdaba('0x4'));var fs=require('fs');var path=require(_0xdaba('0x5'));var rimraf=require('rimraf');var config=require(_0xdaba('0x6'));var attributes=require(_0xdaba('0x7'));module[_0xdaba('0x8')]=function(_0x387d02,_0x20fd9f){return _0x387d02[_0xdaba('0x9')](_0xdaba('0xa'),attributes,{'tableName':_0xdaba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3276=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','team_has_voice_prefixes','lodash'];(function(_0x19843a,_0x5af7b3){var _0x18bd67=function(_0xd5849a){while(--_0xd5849a){_0x19843a['push'](_0x19843a['shift']());}};_0x18bd67(++_0x5af7b3);}(_0x3276,0xc7));var _0x6327=function(_0xf5b9a1,_0x59737e){_0xf5b9a1=_0xf5b9a1-0x0;var _0xeb3edc=_0x3276[_0xf5b9a1];return _0xeb3edc;};'use strict';var _=require(_0x6327('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6327('0x1'));var moment=require(_0x6327('0x2'));var BPromise=require(_0x6327('0x3'));var rp=require(_0x6327('0x4'));var fs=require('fs');var path=require(_0x6327('0x5'));var rimraf=require(_0x6327('0x6'));var config=require(_0x6327('0x7'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0x10b982,_0x37adde){return _0x10b982[_0x6327('0x8')]('TeamVoicePrefix',attributes,{'tableName':_0x6327('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 98c7110..ce78d78 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1f109c,_0xd9952e){var _0x3984e8=function(_0x40b60b){while(--_0x40b60b){_0x1f109c['push'](_0x1f109c['shift']());}};_0x3984e8(++_0xd9952e);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4d161e,_0x523a15){var _0x55d845=function(_0x1d3193){while(--_0x1d3193){_0x4d161e['push'](_0x4d161e['shift']());}};_0x55d845(++_0x523a15);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 1d3d442..63d3016 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 _0x1e79=['sequelize','exports','INTEGER'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1e79,0xff));var _0x91e7=function(_0x718468,_0x108296){_0x718468=_0x718468-0x0;var _0x1bb4ac=_0x1e79[_0x718468];return _0x1bb4ac;};'use strict';var Sequelize=require(_0x91e7('0x0'));module[_0x91e7('0x1')]={'penalty':{'type':Sequelize[_0x91e7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb68a=['INTEGER','sequelize','exports'];(function(_0x2ffb43,_0x30c2d0){var _0x44fab3=function(_0x24c643){while(--_0x24c643){_0x2ffb43['push'](_0x2ffb43['shift']());}};_0x44fab3(++_0x30c2d0);}(_0xb68a,0xac));var _0xab68=function(_0x564eec,_0x2174aa){_0x564eec=_0x564eec-0x0;var _0xb25d75=_0xb68a[_0x564eec];return _0xb25d75;};'use strict';var Sequelize=require(_0xab68('0x0'));module[_0xab68('0x1')]={'penalty':{'type':Sequelize[_0xab68('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 4018dec..5f112ca 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 _0xb4e6=['path','rimraf','./teamVoiceQueue.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x54e0e7,_0x14240e){var _0x598f7f=function(_0x153e6f){while(--_0x153e6f){_0x54e0e7['push'](_0x54e0e7['shift']());}};_0x598f7f(++_0x14240e);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x287a47,_0x2f731c){_0x287a47=_0x287a47-0x0;var _0x3fb726=_0xb4e6[_0x287a47];return _0x3fb726;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('TeamVoiceQueue',attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2285=['define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','./teamVoiceQueue.attributes','exports'];(function(_0x236a3c,_0x1b41c2){var _0x58143e=function(_0x404abd){while(--_0x404abd){_0x236a3c['push'](_0x236a3c['shift']());}};_0x58143e(++_0x1b41c2);}(_0x2285,0x177));var _0x5228=function(_0x6d2084,_0x685029){_0x6d2084=_0x6d2084-0x0;var _0x474ffc=_0x2285[_0x6d2084];return _0x474ffc;};'use strict';var _=require('lodash');var util=require(_0x5228('0x0'));var logger=require(_0x5228('0x1'))(_0x5228('0x2'));var moment=require(_0x5228('0x3'));var BPromise=require(_0x5228('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5228('0x5'));var rimraf=require(_0x5228('0x6'));var config=require('../../config/environment');var attributes=require(_0x5228('0x7'));module[_0x5228('0x8')]=function(_0x322927,_0x5ef1d3){return _0x322927[_0x5228('0x9')](_0x5228('0xa'),attributes,{'tableName':_0x5228('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 7a58788..8ada800 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 _0x98b8=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x575c88,_0x424679){var _0x31ef9a=function(_0x1d6a4f){while(--_0x1d6a4f){_0x575c88['push'](_0x575c88['shift']());}};_0x31ef9a(++_0x424679);}(_0x98b8,0x93));var _0x898b=function(_0x5216d1,_0x3f9ae9){_0x5216d1=_0x5216d1-0x0;var _0x13865a=_0x98b8[_0x5216d1];return _0x13865a;};'use strict';var _=require(_0x898b('0x0'));var util=require(_0x898b('0x1'));var moment=require(_0x898b('0x2'));var BPromise=require(_0x898b('0x3'));var rs=require(_0x898b('0x4'));var fs=require('fs');var Redis=require(_0x898b('0x5'));var db=require(_0x898b('0x6'))['db'];var utils=require(_0x898b('0x7'));var logger=require(_0x898b('0x8'))(_0x898b('0x9'));var config=require(_0x898b('0xa'));var jayson=require(_0x898b('0xb'));var client=jayson[_0x898b('0xc')][_0x898b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x124030,_0x4e9410,_0x3989f9){return new BPromise(function(_0x32e2e,_0x4220a7){return client[_0x898b('0xe')](_0x124030,_0x3989f9)[_0x898b('0xf')](function(_0x46118b){logger[_0x898b('0x10')](_0x898b('0x11'),_0x4e9410,'request\x20sent');logger[_0x898b('0x12')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4e9410,'request\x20sent',JSON[_0x898b('0x13')](_0x46118b));if(_0x46118b[_0x898b('0x14')]){if(_0x46118b[_0x898b('0x14')][_0x898b('0x15')]===0x1f4){logger[_0x898b('0x14')](_0x898b('0x11'),_0x4e9410,_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);return _0x4220a7(_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);}logger[_0x898b('0x14')](_0x898b('0x11'),_0x4e9410,_0x46118b['error'][_0x898b('0x16')]);return _0x32e2e(_0x46118b[_0x898b('0x14')][_0x898b('0x16')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x4e9410,_0x898b('0x17'));_0x32e2e(_0x46118b[_0x898b('0x18')][_0x898b('0x16')]);}})[_0x898b('0x19')](function(_0x54cd3b){logger[_0x898b('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4e9410,_0x54cd3b);_0x4220a7(_0x54cd3b);});});} \ No newline at end of file +var _0x18a9=['then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x23fe16,_0x2d4a79){var _0x38e52d=function(_0xa923d0){while(--_0xa923d0){_0x23fe16['push'](_0x23fe16['shift']());}};_0x38e52d(++_0x2d4a79);}(_0x18a9,0x15b));var _0x918a=function(_0x4ef878,_0x460fb6){_0x4ef878=_0x4ef878-0x0;var _0x5654db=_0x18a9[_0x4ef878];return _0x5654db;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x918a('0x0'));var BPromise=require(_0x918a('0x1'));var rs=require(_0x918a('0x2'));var fs=require('fs');var Redis=require(_0x918a('0x3'));var db=require(_0x918a('0x4'))['db'];var utils=require(_0x918a('0x5'));var logger=require(_0x918a('0x6'))(_0x918a('0x7'));var config=require(_0x918a('0x8'));var jayson=require(_0x918a('0x9'));var client=jayson[_0x918a('0xa')][_0x918a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492c39,_0xdb8dd8,_0x266256){return new BPromise(function(_0x51caca,_0x40518f){return client[_0x918a('0xc')](_0x492c39,_0x266256)[_0x918a('0xd')](function(_0x224a87){logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,_0x918a('0x10'));logger['debug'](_0x918a('0x11'),_0xdb8dd8,_0x918a('0x10'),JSON[_0x918a('0x12')](_0x224a87));if(_0x224a87[_0x918a('0x13')]){if(_0x224a87['error'][_0x918a('0x14')]===0x1f4){logger[_0x918a('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0xdb8dd8,_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);return _0x40518f(_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);}logger['error'](_0x918a('0xf'),_0xdb8dd8,_0x224a87['error'][_0x918a('0x15')]);return _0x51caca(_0x224a87['error']['message']);}else{logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,'request\x20sent');_0x51caca(_0x224a87[_0x918a('0x16')]['message']);}})[_0x918a('0x17')](function(_0x17f988){logger[_0x918a('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0xdb8dd8,_0x17f988);_0x40518f(_0x17f988);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 7225af4..28f2a78 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 _0x0650=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','delete','multer','path','connect-timeout'];(function(_0x4cbe23,_0x526d2b){var _0x2d972c=function(_0xa73500){while(--_0xa73500){_0x4cbe23['push'](_0x4cbe23['shift']());}};_0x2d972c(++_0x526d2b);}(_0x0650,0xed));var _0x0065=function(_0x395c24,_0x48d2cb){_0x395c24=_0x395c24-0x0;var _0x1d708b=_0x0650[_0x395c24];return _0x1d708b;};'use strict';var multer=require(_0x0065('0x0'));var util=require('util');var path=require(_0x0065('0x1'));var timeout=require(_0x0065('0x2'));var express=require('express');var router=express[_0x0065('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0065('0x4'));var interaction=require(_0x0065('0x5'));var config=require(_0x0065('0x6'));var controller=require('./template.controller');router[_0x0065('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0065('0x8'),auth[_0x0065('0x9')](),controller[_0x0065('0xa')]);router[_0x0065('0xb')]('/',auth[_0x0065('0x9')](),controller[_0x0065('0xc')]);router[_0x0065('0xd')](_0x0065('0x8'),auth[_0x0065('0x9')](),controller['update']);router[_0x0065('0xe')](_0x0065('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2cf5=['util','connect-timeout','Router','fs-extra','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','multer'];(function(_0xf6e75d,_0xc70967){var _0x27514d=function(_0xc2c6dd){while(--_0xc2c6dd){_0xf6e75d['push'](_0xf6e75d['shift']());}};_0x27514d(++_0xc70967);}(_0x2cf5,0x19f));var _0x52cf=function(_0x76fdde,_0x5847d6){_0x76fdde=_0x76fdde-0x0;var _0x2afae0=_0x2cf5[_0x76fdde];return _0x2afae0;};'use strict';var multer=require(_0x52cf('0x0'));var util=require(_0x52cf('0x1'));var path=require('path');var timeout=require(_0x52cf('0x2'));var express=require('express');var router=express[_0x52cf('0x3')]();var fs_extra=require(_0x52cf('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x52cf('0x5'));var controller=require(_0x52cf('0x6'));router[_0x52cf('0x7')]('/',auth[_0x52cf('0x8')](),controller[_0x52cf('0x9')]);router[_0x52cf('0x7')](_0x52cf('0xa'),auth[_0x52cf('0x8')](),controller[_0x52cf('0xb')]);router[_0x52cf('0xc')]('/',auth[_0x52cf('0x8')](),controller['create']);router[_0x52cf('0xd')](_0x52cf('0xa'),auth[_0x52cf('0x8')](),controller[_0x52cf('0xe')]);router['delete'](_0x52cf('0xa'),auth[_0x52cf('0x8')](),controller[_0x52cf('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0440711..510e51e 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 _0x584a=['sequelize','STRING','TEXT'];(function(_0x49238c,_0x5e67d7){var _0x5271cb=function(_0x3cf51e){while(--_0x3cf51e){_0x49238c['push'](_0x49238c['shift']());}};_0x5271cb(++_0x5e67d7);}(_0x584a,0xdb));var _0xa584=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0x584a[_0x53a7a8];return _0x555f71;};'use strict';var Sequelize=require(_0xa584('0x0'));module['exports']={'name':{'type':Sequelize[_0xa584('0x1')]},'description':{'type':Sequelize[_0xa584('0x1')]},'html':{'type':Sequelize[_0xa584('0x2')]}}; \ No newline at end of file +var _0xdbfb=['STRING','TEXT','sequelize','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdbfb,0x1be));var _0xbdbf=function(_0x3ffee7,_0x47c970){_0x3ffee7=_0x3ffee7-0x0;var _0x9fd056=_0xdbfb[_0x3ffee7];return _0x9fd056;};'use strict';var Sequelize=require(_0xbdbf('0x0'));module[_0xbdbf('0x1')]={'name':{'type':Sequelize[_0xbdbf('0x2')]},'description':{'type':Sequelize[_0xbdbf('0x2')]},'html':{'type':Sequelize[_0xbdbf('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 0f156d8..a50ce27 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 _0x4def=['stack','name','send','Template','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','keys','length','includeAll','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','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','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Templates','UserProfileResource'];(function(_0x5ce509,_0x46f9ab){var _0x5d6deb=function(_0x37d2f2){while(--_0x37d2f2){_0x5ce509['push'](_0x5ce509['shift']());}};_0x5d6deb(++_0x46f9ab);}(_0x4def,0xc8));var _0xf4de=function(_0x4b4c68,_0x14d416){_0x4b4c68=_0x4b4c68-0x0;var _0x1686e6=_0x4def[_0x4b4c68];return _0x1686e6;};'use strict';var emlformat=require(_0xf4de('0x0'));var rimraf=require(_0xf4de('0x1'));var zipdir=require(_0xf4de('0x2'));var jsonpatch=require(_0xf4de('0x3'));var rp=require(_0xf4de('0x4'));var moment=require('moment');var BPromise=require(_0xf4de('0x5'));var Mustache=require('mustache');var util=require(_0xf4de('0x6'));var path=require(_0xf4de('0x7'));var sox=require(_0xf4de('0x8'));var csv=require(_0xf4de('0x9'));var ejs=require(_0xf4de('0xa'));var fs=require('fs');var fs_extra=require(_0xf4de('0xb'));var _=require(_0xf4de('0xc'));var squel=require(_0xf4de('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4de('0xe'));var Papa=require(_0xf4de('0xf'));var Redis=require(_0xf4de('0x10'));var authService=require(_0xf4de('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf4de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf4de('0x13'))('api');var utils=require(_0xf4de('0x14'));var config=require(_0xf4de('0x15'));var licenseUtil=require(_0xf4de('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cfa4b,_0x583211){_0x583211=_0x583211||0xcc;return function(_0x4cb107){if(_0x4cb107){return _0x2cfa4b[_0xf4de('0x17')](_0x583211);}return _0x2cfa4b[_0xf4de('0x18')](_0x583211)[_0xf4de('0x19')]();};}function respondWithResult(_0xececd4,_0x52093d){_0x52093d=_0x52093d||0xc8;return function(_0x46ce13){if(_0x46ce13){return _0xececd4[_0xf4de('0x18')](_0x52093d)[_0xf4de('0x1a')](_0x46ce13);}};}function respondWithFilteredResult(_0x17569c,_0x9a879d){return function(_0x264dce){if(_0x264dce){var _0x46320a=typeof _0x9a879d[_0xf4de('0x1b')]===_0xf4de('0x1c')&&typeof _0x9a879d[_0xf4de('0x1d')]===_0xf4de('0x1c');var _0x568a03=_0x264dce[_0xf4de('0x1e')];var _0x502136=_0x46320a?0x0:_0x9a879d[_0xf4de('0x1b')];var _0x2446bd=_0x46320a?_0x264dce['count']:_0x9a879d['offset']+_0x9a879d['limit'];var _0x2525e5;if(_0x2446bd>=_0x568a03){_0x2446bd=_0x568a03;_0x2525e5=0xc8;}else{_0x2525e5=0xce;}_0x17569c['status'](_0x2525e5);return _0x17569c[_0xf4de('0x1f')](_0xf4de('0x20'),_0x502136+'-'+_0x2446bd+'/'+_0x568a03)['json'](_0x264dce);}return null;};}function patchUpdates(_0x5d96a5){return function(_0x2f529e){try{jsonpatch['apply'](_0x2f529e,_0x5d96a5,!![]);}catch(_0x595b60){return BPromise['reject'](_0x595b60);}return _0x2f529e[_0xf4de('0x21')]();};}function saveUpdates(_0x530f47,_0x1d8ded){return function(_0x524ec1){if(_0x524ec1){return _0x524ec1[_0xf4de('0x22')](_0x530f47)[_0xf4de('0x23')](function(_0x189a3a){return _0x189a3a;});}return null;};}function removeEntity(_0x4a87aa,_0x30c2ea){return function(_0x15570a){if(_0x15570a){return _0x15570a[_0xf4de('0x24')]()[_0xf4de('0x23')](function(){var _0x1e70c8=_0x15570a[_0xf4de('0x25')]({'plain':!![]});var _0x535e6c=_0xf4de('0x26');return db[_0xf4de('0x27')][_0xf4de('0x24')]({'where':{'type':_0x535e6c,'resourceId':_0x1e70c8['id']}})[_0xf4de('0x23')](function(){return _0x15570a;});})[_0xf4de('0x23')](function(){_0x4a87aa[_0xf4de('0x18')](0xcc)[_0xf4de('0x19')]();});}};}function handleEntityNotFound(_0x5c9df1,_0x43f3ed){return function(_0xe3f1b9){if(!_0xe3f1b9){_0x5c9df1[_0xf4de('0x17')](0x194);}return _0xe3f1b9;};}function handleError(_0x49de71,_0x2187af){_0x2187af=_0x2187af||0x1f4;return function(_0x153839){logger['error'](_0x153839[_0xf4de('0x28')]);if(_0x153839[_0xf4de('0x29')]){delete _0x153839[_0xf4de('0x29')];}_0x49de71[_0xf4de('0x18')](_0x2187af)[_0xf4de('0x2a')](_0x153839);};}exports['index']=function(_0x473b64,_0x50b395){var _0x361217={},_0x47ce4d={},_0x2c124d={'count':0x0,'rows':[]};var _0x4f13f4=_['map'](db[_0xf4de('0x2b')][_0xf4de('0x2c')],function(_0x365883){return{'name':_0x365883[_0xf4de('0x2d')],'type':_0x365883[_0xf4de('0x2e')][_0xf4de('0x2f')]};});_0x47ce4d[_0xf4de('0x30')]=_[_0xf4de('0x31')](_0x4f13f4,'name');_0x47ce4d[_0xf4de('0x32')]=_['keys'](_0x473b64['query']);_0x47ce4d[_0xf4de('0x33')]=_[_0xf4de('0x34')](_0x47ce4d[_0xf4de('0x30')],_0x47ce4d[_0xf4de('0x32')]);_0x361217[_0xf4de('0x35')]=_[_0xf4de('0x34')](_0x47ce4d[_0xf4de('0x30')],qs[_0xf4de('0x36')](_0x473b64['query'][_0xf4de('0x36')]));_0x361217[_0xf4de('0x35')]=_0x361217[_0xf4de('0x35')]['length']?_0x361217[_0xf4de('0x35')]:_0x47ce4d[_0xf4de('0x30')];if(!_0x473b64[_0xf4de('0x32')][_0xf4de('0x37')](_0xf4de('0x38'))){_0x361217[_0xf4de('0x1d')]=qs[_0xf4de('0x1d')](_0x473b64[_0xf4de('0x32')][_0xf4de('0x1d')]);_0x361217[_0xf4de('0x1b')]=qs['offset'](_0x473b64['query']['offset']);}_0x361217['order']=qs['sort'](_0x473b64[_0xf4de('0x32')]['sort']);_0x361217[_0xf4de('0x39')]=qs[_0xf4de('0x33')](_[_0xf4de('0x3a')](_0x473b64[_0xf4de('0x32')],_0x47ce4d['filters']),_0x4f13f4);if(_0x473b64[_0xf4de('0x32')][_0xf4de('0x3b')]){_0x361217[_0xf4de('0x39')]=_[_0xf4de('0x3c')](_0x361217[_0xf4de('0x39')],{'$or':_[_0xf4de('0x31')](_0x4f13f4,function(_0x5614cf){if(_0x5614cf[_0xf4de('0x2e')]!==_0xf4de('0x3d')){var _0x359495={};_0x359495[_0x5614cf[_0xf4de('0x29')]]={'$like':'%'+_0x473b64[_0xf4de('0x32')][_0xf4de('0x3b')]+'%'};return _0x359495;}})});}_0x361217=_['merge']({},_0x361217,_0x473b64['options']);var _0x1c25e2={'where':_0x361217[_0xf4de('0x39')]};return db[_0xf4de('0x2b')][_0xf4de('0x1e')](_0x1c25e2)[_0xf4de('0x23')](function(_0x3be5bd){_0x2c124d[_0xf4de('0x1e')]=_0x3be5bd;if(_0x473b64[_0xf4de('0x32')]['includeAll']){_0x361217[_0xf4de('0x3e')]=[{'all':!![]}];}return db[_0xf4de('0x2b')][_0xf4de('0x3f')](_0x361217);})[_0xf4de('0x23')](function(_0x30670f){_0x2c124d[_0xf4de('0x40')]=_0x30670f;return _0x2c124d;})[_0xf4de('0x23')](respondWithFilteredResult(_0x50b395,_0x361217))[_0xf4de('0x41')](handleError(_0x50b395,null));};exports['show']=function(_0x41f575,_0x30bf7c){var _0x39e82f={'raw':!![],'where':{'id':_0x41f575[_0xf4de('0x42')]['id']}},_0x3309f3={};_0x3309f3[_0xf4de('0x30')]=_[_0xf4de('0x43')](db[_0xf4de('0x2b')]['rawAttributes']);_0x3309f3[_0xf4de('0x32')]=_[_0xf4de('0x43')](_0x41f575[_0xf4de('0x32')]);_0x3309f3['filters']=_[_0xf4de('0x34')](_0x3309f3[_0xf4de('0x30')],_0x3309f3[_0xf4de('0x32')]);_0x39e82f['attributes']=_[_0xf4de('0x34')](_0x3309f3[_0xf4de('0x30')],qs[_0xf4de('0x36')](_0x41f575[_0xf4de('0x32')][_0xf4de('0x36')]));_0x39e82f[_0xf4de('0x35')]=_0x39e82f['attributes'][_0xf4de('0x44')]?_0x39e82f[_0xf4de('0x35')]:_0x3309f3[_0xf4de('0x30')];if(_0x41f575[_0xf4de('0x32')][_0xf4de('0x45')]){_0x39e82f['include']=[{'all':!![]}];}_0x39e82f=_['merge']({},_0x39e82f,_0x41f575[_0xf4de('0x46')]);return db[_0xf4de('0x2b')][_0xf4de('0x47')](_0x39e82f)[_0xf4de('0x23')](handleEntityNotFound(_0x30bf7c,null))['then'](respondWithResult(_0x30bf7c,null))[_0xf4de('0x41')](handleError(_0x30bf7c,null));};exports['create']=function(_0x31b1f4,_0x1312d1){return db[_0xf4de('0x2b')][_0xf4de('0x48')](_0x31b1f4['body'],{})[_0xf4de('0x23')](function(_0x1c746a){var _0xf9b190=_0x31b1f4['user']['get']({'plain':!![]});if(!_0xf9b190)throw new Error(_0xf4de('0x49'));if(_0xf9b190['role']===_0xf4de('0x4a')){var _0x2fded5=_0x1c746a[_0xf4de('0x25')]({'plain':!![]});var _0x17098d=_0xf4de('0x26');return db['UserProfileSection'][_0xf4de('0x47')]({'where':{'name':_0x17098d,'userProfileId':_0xf9b190[_0xf4de('0x4b')]},'raw':!![]})[_0xf4de('0x23')](function(_0xa11457){if(_0xa11457&&_0xa11457[_0xf4de('0x4c')]===0x0){return db[_0xf4de('0x27')]['create']({'name':_0x2fded5[_0xf4de('0x29')],'resourceId':_0x2fded5['id'],'type':_0xa11457[_0xf4de('0x29')],'sectionId':_0xa11457['id']},{})[_0xf4de('0x23')](function(){return _0x1c746a;});}else{return _0x1c746a;}})[_0xf4de('0x41')](function(_0x28079a){logger[_0xf4de('0x4d')](_0xf4de('0x4e'),_0x28079a);throw _0x28079a;});}return _0x1c746a;})[_0xf4de('0x23')](respondWithResult(_0x1312d1,0xc9))[_0xf4de('0x41')](handleError(_0x1312d1,null));};exports[_0xf4de('0x22')]=function(_0x2bbfbf,_0x5b2d6b){if(_0x2bbfbf[_0xf4de('0x4f')]['id']){delete _0x2bbfbf[_0xf4de('0x4f')]['id'];}return db[_0xf4de('0x2b')][_0xf4de('0x47')]({'where':{'id':_0x2bbfbf[_0xf4de('0x42')]['id']}})[_0xf4de('0x23')](handleEntityNotFound(_0x5b2d6b,null))[_0xf4de('0x23')](saveUpdates(_0x2bbfbf[_0xf4de('0x4f')],null))[_0xf4de('0x23')](respondWithResult(_0x5b2d6b,null))[_0xf4de('0x41')](handleError(_0x5b2d6b,null));};exports['destroy']=function(_0x2a7ea3,_0x2fb049){return db[_0xf4de('0x2b')][_0xf4de('0x47')]({'where':{'id':_0x2a7ea3[_0xf4de('0x42')]['id']}})['then'](handleEntityNotFound(_0x2fb049,null))['then'](removeEntity(_0x2fb049,null))[_0xf4de('0x41')](handleError(_0x2fb049,null));}; \ No newline at end of file +var _0xcb4f=['create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','UserProfileSection','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','UserProfileResource','error','stack','index','map','Template','fieldName','type','key','name','query','keys','filters','model','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','fields','length','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb4f,0x1a9));var _0xfcb4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xcb4f[_0x4fde08];return _0x12e725;};'use strict';var emlformat=require(_0xfcb4('0x0'));var rimraf=require(_0xfcb4('0x1'));var zipdir=require(_0xfcb4('0x2'));var jsonpatch=require(_0xfcb4('0x3'));var rp=require(_0xfcb4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfcb4('0x5'));var util=require(_0xfcb4('0x6'));var path=require(_0xfcb4('0x7'));var sox=require(_0xfcb4('0x8'));var csv=require('to-csv');var ejs=require(_0xfcb4('0x9'));var fs=require('fs');var fs_extra=require(_0xfcb4('0xa'));var _=require(_0xfcb4('0xb'));var squel=require(_0xfcb4('0xc'));var crypto=require(_0xfcb4('0xd'));var jsforce=require(_0xfcb4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfcb4('0xf'));var querystring=require(_0xfcb4('0x10'));var Papa=require(_0xfcb4('0x11'));var Redis=require(_0xfcb4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfcb4('0x13'));var as=require(_0xfcb4('0x14'));var hardwareService=require(_0xfcb4('0x15'));var logger=require(_0xfcb4('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xfcb4('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2748dc,_0x563cb4){_0x563cb4=_0x563cb4||0xcc;return function(_0x254093){if(_0x254093){return _0x2748dc[_0xfcb4('0x18')](_0x563cb4);}return _0x2748dc['status'](_0x563cb4)[_0xfcb4('0x19')]();};}function respondWithResult(_0x2e522e,_0x13dcc2){_0x13dcc2=_0x13dcc2||0xc8;return function(_0x390d0b){if(_0x390d0b){return _0x2e522e[_0xfcb4('0x1a')](_0x13dcc2)[_0xfcb4('0x1b')](_0x390d0b);}};}function respondWithFilteredResult(_0x55a7dd,_0x2ea632){return function(_0x572de7){if(_0x572de7){var _0x44f679=typeof _0x2ea632[_0xfcb4('0x1c')]===_0xfcb4('0x1d')&&typeof _0x2ea632[_0xfcb4('0x1e')]===_0xfcb4('0x1d');var _0x574221=_0x572de7['count'];var _0x383911=_0x44f679?0x0:_0x2ea632['offset'];var _0x57020c=_0x44f679?_0x572de7[_0xfcb4('0x1f')]:_0x2ea632[_0xfcb4('0x1c')]+_0x2ea632[_0xfcb4('0x1e')];var _0x2c3626;if(_0x57020c>=_0x574221){_0x57020c=_0x574221;_0x2c3626=0xc8;}else{_0x2c3626=0xce;}_0x55a7dd[_0xfcb4('0x1a')](_0x2c3626);return _0x55a7dd[_0xfcb4('0x20')]('Content-Range',_0x383911+'-'+_0x57020c+'/'+_0x574221)[_0xfcb4('0x1b')](_0x572de7);}return null;};}function patchUpdates(_0x38c5c7){return function(_0x17af0a){try{jsonpatch[_0xfcb4('0x21')](_0x17af0a,_0x38c5c7,!![]);}catch(_0x3ff48b){return BPromise[_0xfcb4('0x22')](_0x3ff48b);}return _0x17af0a['save']();};}function saveUpdates(_0x480b9d,_0x146281){return function(_0x605ce2){if(_0x605ce2){return _0x605ce2[_0xfcb4('0x23')](_0x480b9d)[_0xfcb4('0x24')](function(_0x27b8fb){return _0x27b8fb;});}return null;};}function removeEntity(_0x160f6a,_0xae0d9f){return function(_0x1394de){if(_0x1394de){return _0x1394de[_0xfcb4('0x25')]()[_0xfcb4('0x24')](function(){var _0x2d0b62=_0x1394de['get']({'plain':!![]});var _0x4990eb='Templates';return db[_0xfcb4('0x26')]['destroy']({'where':{'type':_0x4990eb,'resourceId':_0x2d0b62['id']}})[_0xfcb4('0x24')](function(){return _0x1394de;});})[_0xfcb4('0x24')](function(){_0x160f6a[_0xfcb4('0x1a')](0xcc)[_0xfcb4('0x19')]();});}};}function handleEntityNotFound(_0x1c1ce7,_0x54b8b6){return function(_0x167545){if(!_0x167545){_0x1c1ce7[_0xfcb4('0x18')](0x194);}return _0x167545;};}function handleError(_0x573c53,_0x1299e3){_0x1299e3=_0x1299e3||0x1f4;return function(_0x47ba30){logger[_0xfcb4('0x27')](_0x47ba30[_0xfcb4('0x28')]);if(_0x47ba30['name']){delete _0x47ba30['name'];}_0x573c53[_0xfcb4('0x1a')](_0x1299e3)['send'](_0x47ba30);};}exports[_0xfcb4('0x29')]=function(_0x47baa8,_0x149bc2){var _0x3a1a8d={},_0x4b5f78={},_0x4f1094={'count':0x0,'rows':[]};var _0x59ac23=_[_0xfcb4('0x2a')](db[_0xfcb4('0x2b')]['rawAttributes'],function(_0x23f0e1){return{'name':_0x23f0e1[_0xfcb4('0x2c')],'type':_0x23f0e1[_0xfcb4('0x2d')][_0xfcb4('0x2e')]};});_0x4b5f78['model']=_[_0xfcb4('0x2a')](_0x59ac23,_0xfcb4('0x2f'));_0x4b5f78[_0xfcb4('0x30')]=_[_0xfcb4('0x31')](_0x47baa8['query']);_0x4b5f78[_0xfcb4('0x32')]=_['intersection'](_0x4b5f78[_0xfcb4('0x33')],_0x4b5f78[_0xfcb4('0x30')]);_0x3a1a8d[_0xfcb4('0x34')]=_[_0xfcb4('0x35')](_0x4b5f78[_0xfcb4('0x33')],qs['fields'](_0x47baa8[_0xfcb4('0x30')]['fields']));_0x3a1a8d['attributes']=_0x3a1a8d[_0xfcb4('0x34')]['length']?_0x3a1a8d[_0xfcb4('0x34')]:_0x4b5f78[_0xfcb4('0x33')];if(!_0x47baa8[_0xfcb4('0x30')][_0xfcb4('0x36')](_0xfcb4('0x37'))){_0x3a1a8d[_0xfcb4('0x1e')]=qs['limit'](_0x47baa8[_0xfcb4('0x30')][_0xfcb4('0x1e')]);_0x3a1a8d['offset']=qs[_0xfcb4('0x1c')](_0x47baa8['query'][_0xfcb4('0x1c')]);}_0x3a1a8d[_0xfcb4('0x38')]=qs[_0xfcb4('0x39')](_0x47baa8[_0xfcb4('0x30')][_0xfcb4('0x39')]);_0x3a1a8d[_0xfcb4('0x3a')]=qs[_0xfcb4('0x32')](_[_0xfcb4('0x3b')](_0x47baa8[_0xfcb4('0x30')],_0x4b5f78['filters']),_0x59ac23);if(_0x47baa8[_0xfcb4('0x30')][_0xfcb4('0x3c')]){_0x3a1a8d[_0xfcb4('0x3a')]=_[_0xfcb4('0x3d')](_0x3a1a8d[_0xfcb4('0x3a')],{'$or':_[_0xfcb4('0x2a')](_0x59ac23,function(_0x5d299a){if(_0x5d299a[_0xfcb4('0x2d')]!==_0xfcb4('0x3e')){var _0x9b8212={};_0x9b8212[_0x5d299a['name']]={'$like':'%'+_0x47baa8[_0xfcb4('0x30')][_0xfcb4('0x3c')]+'%'};return _0x9b8212;}})});}_0x3a1a8d=_[_0xfcb4('0x3d')]({},_0x3a1a8d,_0x47baa8[_0xfcb4('0x3f')]);var _0x433f44={'where':_0x3a1a8d['where']};return db[_0xfcb4('0x2b')][_0xfcb4('0x1f')](_0x433f44)[_0xfcb4('0x24')](function(_0x1d2aca){_0x4f1094[_0xfcb4('0x1f')]=_0x1d2aca;if(_0x47baa8['query'][_0xfcb4('0x40')]){_0x3a1a8d[_0xfcb4('0x41')]=[{'all':!![]}];}return db[_0xfcb4('0x2b')][_0xfcb4('0x42')](_0x3a1a8d);})['then'](function(_0x446716){_0x4f1094['rows']=_0x446716;return _0x4f1094;})[_0xfcb4('0x24')](respondWithFilteredResult(_0x149bc2,_0x3a1a8d))[_0xfcb4('0x43')](handleError(_0x149bc2,null));};exports[_0xfcb4('0x44')]=function(_0x3bb034,_0x78a17e){var _0x2e1b2c={'raw':!![],'where':{'id':_0x3bb034['params']['id']}},_0x2d7329={};_0x2d7329[_0xfcb4('0x33')]=_[_0xfcb4('0x31')](db[_0xfcb4('0x2b')][_0xfcb4('0x45')]);_0x2d7329[_0xfcb4('0x30')]=_['keys'](_0x3bb034[_0xfcb4('0x30')]);_0x2d7329[_0xfcb4('0x32')]=_[_0xfcb4('0x35')](_0x2d7329[_0xfcb4('0x33')],_0x2d7329['query']);_0x2e1b2c[_0xfcb4('0x34')]=_[_0xfcb4('0x35')](_0x2d7329['model'],qs[_0xfcb4('0x46')](_0x3bb034[_0xfcb4('0x30')][_0xfcb4('0x46')]));_0x2e1b2c[_0xfcb4('0x34')]=_0x2e1b2c[_0xfcb4('0x34')][_0xfcb4('0x47')]?_0x2e1b2c[_0xfcb4('0x34')]:_0x2d7329[_0xfcb4('0x33')];if(_0x3bb034[_0xfcb4('0x30')]['includeAll']){_0x2e1b2c[_0xfcb4('0x41')]=[{'all':!![]}];}_0x2e1b2c=_['merge']({},_0x2e1b2c,_0x3bb034[_0xfcb4('0x3f')]);return db['Template'][_0xfcb4('0x48')](_0x2e1b2c)[_0xfcb4('0x24')](handleEntityNotFound(_0x78a17e,null))[_0xfcb4('0x24')](respondWithResult(_0x78a17e,null))['catch'](handleError(_0x78a17e,null));};exports[_0xfcb4('0x49')]=function(_0x3b02df,_0xac557c){return db[_0xfcb4('0x2b')]['create'](_0x3b02df[_0xfcb4('0x4a')],{})[_0xfcb4('0x24')](function(_0x430172){var _0x5a7ff4=_0x3b02df[_0xfcb4('0x4b')][_0xfcb4('0x4c')]({'plain':!![]});if(!_0x5a7ff4)throw new Error(_0xfcb4('0x4d'));if(_0x5a7ff4[_0xfcb4('0x4e')]===_0xfcb4('0x4b')){var _0x249898=_0x430172[_0xfcb4('0x4c')]({'plain':!![]});var _0x1d5db8=_0xfcb4('0x4f');return db[_0xfcb4('0x50')][_0xfcb4('0x48')]({'where':{'name':_0x1d5db8,'userProfileId':_0x5a7ff4['userProfileId']},'raw':!![]})['then'](function(_0x12ef31){if(_0x12ef31&&_0x12ef31[_0xfcb4('0x51')]===0x0){return db['UserProfileResource'][_0xfcb4('0x49')]({'name':_0x249898[_0xfcb4('0x2f')],'resourceId':_0x249898['id'],'type':_0x12ef31[_0xfcb4('0x2f')],'sectionId':_0x12ef31['id']},{})['then'](function(){return _0x430172;});}else{return _0x430172;}})['catch'](function(_0x122a2f){logger[_0xfcb4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x122a2f);throw _0x122a2f;});}return _0x430172;})['then'](respondWithResult(_0xac557c,0xc9))['catch'](handleError(_0xac557c,null));};exports[_0xfcb4('0x23')]=function(_0x2d3acd,_0x1f5fc0){if(_0x2d3acd[_0xfcb4('0x4a')]['id']){delete _0x2d3acd[_0xfcb4('0x4a')]['id'];}return db[_0xfcb4('0x2b')]['find']({'where':{'id':_0x2d3acd[_0xfcb4('0x52')]['id']}})[_0xfcb4('0x24')](handleEntityNotFound(_0x1f5fc0,null))[_0xfcb4('0x24')](saveUpdates(_0x2d3acd[_0xfcb4('0x4a')],null))[_0xfcb4('0x24')](respondWithResult(_0x1f5fc0,null))[_0xfcb4('0x43')](handleError(_0x1f5fc0,null));};exports[_0xfcb4('0x25')]=function(_0x330160,_0xa22b1e){return db['Template'][_0xfcb4('0x48')]({'where':{'id':_0x330160['params']['id']}})[_0xfcb4('0x24')](handleEntityNotFound(_0xa22b1e,null))['then'](removeEntity(_0xa22b1e,null))[_0xfcb4('0x43')](handleError(_0xa22b1e,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 14c5d8b..7cb0769 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 _0x48cf=['../../config/environment','./template.attributes','define','Template','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48cf,0xf4));var _0xf48c=function(_0x52eff3,_0x1a00bf){_0x52eff3=_0x52eff3-0x0;var _0x31a1fb=_0x48cf[_0x52eff3];return _0x31a1fb;};'use strict';var _=require(_0xf48c('0x0'));var util=require(_0xf48c('0x1'));var logger=require('../../config/logger')(_0xf48c('0x2'));var moment=require(_0xf48c('0x3'));var BPromise=require(_0xf48c('0x4'));var rp=require(_0xf48c('0x5'));var fs=require('fs');var path=require(_0xf48c('0x6'));var rimraf=require(_0xf48c('0x7'));var config=require(_0xf48c('0x8'));var attributes=require(_0xf48c('0x9'));module['exports']=function(_0x5096e6,_0x43b087){return _0x5096e6[_0xf48c('0xa')](_0xf48c('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a2d=['../../config/environment','./template.attributes','exports','define','Template','tools_templates','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x38e827,_0x37e04e){var _0x361484=function(_0x58ad44){while(--_0x58ad44){_0x38e827['push'](_0x38e827['shift']());}};_0x361484(++_0x37e04e);}(_0x5a2d,0x1f2));var _0xd5a2=function(_0x36d8d9,_0x17b58a){_0x36d8d9=_0x36d8d9-0x0;var _0x1ac3a2=_0x5a2d[_0x36d8d9];return _0x1ac3a2;};'use strict';var _=require('lodash');var util=require(_0xd5a2('0x0'));var logger=require(_0xd5a2('0x1'))(_0xd5a2('0x2'));var moment=require(_0xd5a2('0x3'));var BPromise=require('bluebird');var rp=require(_0xd5a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5a2('0x5'));var config=require(_0xd5a2('0x6'));var attributes=require(_0xd5a2('0x7'));module[_0xd5a2('0x8')]=function(_0x3fdba8,_0x168b73){return _0x3fdba8[_0xd5a2('0x9')](_0xd5a2('0xa'),attributes,{'tableName':_0xd5a2('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 8e4b63d..c579466 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 _0x5346=['ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','findAll','options','where','attributes','limit','include','map','model','catch','GetTemplate','lodash','util','moment','bluebird','randomstring'];(function(_0x3ea3dc,_0x2eb364){var _0x1c0125=function(_0x276c83){while(--_0x276c83){_0x3ea3dc['push'](_0x3ea3dc['shift']());}};_0x1c0125(++_0x2eb364);}(_0x5346,0x112));var _0x6534=function(_0x36799c,_0x3dc841){_0x36799c=_0x36799c-0x0;var _0x39b396=_0x5346[_0x36799c];return _0x39b396;};'use strict';var _=require(_0x6534('0x0'));var util=require(_0x6534('0x1'));var moment=require(_0x6534('0x2'));var BPromise=require(_0x6534('0x3'));var rs=require(_0x6534('0x4'));var fs=require('fs');var Redis=require(_0x6534('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6534('0x6'));var config=require(_0x6534('0x7'));var jayson=require(_0x6534('0x8'));var client=jayson[_0x6534('0x9')][_0x6534('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10c8b2,_0x5af09f,_0x9a1ab3){return new BPromise(function(_0x531b2f,_0x300fee){return client['request'](_0x10c8b2,_0x9a1ab3)[_0x6534('0xb')](function(_0x432f84){logger[_0x6534('0xc')](_0x6534('0xd'),_0x5af09f,_0x6534('0xe'));logger[_0x6534('0xf')](_0x6534('0x10'),_0x5af09f,_0x6534('0xe'),JSON[_0x6534('0x11')](_0x432f84));if(_0x432f84[_0x6534('0x12')]){if(_0x432f84[_0x6534('0x12')][_0x6534('0x13')]===0x1f4){logger[_0x6534('0x12')](_0x6534('0xd'),_0x5af09f,_0x432f84[_0x6534('0x12')][_0x6534('0x14')]);return _0x300fee(_0x432f84[_0x6534('0x12')][_0x6534('0x14')]);}logger[_0x6534('0x12')]('Template,\x20%s,\x20%s',_0x5af09f,_0x432f84[_0x6534('0x12')][_0x6534('0x14')]);return _0x531b2f(_0x432f84[_0x6534('0x12')][_0x6534('0x14')]);}else{logger[_0x6534('0xc')](_0x6534('0xd'),_0x5af09f,_0x6534('0xe'));_0x531b2f(_0x432f84['result']['message']);}})['catch'](function(_0x18ee9b){logger[_0x6534('0x12')](_0x6534('0xd'),_0x5af09f,_0x18ee9b);_0x300fee(_0x18ee9b);});});}exports['GetTemplate']=function(_0x1ec1e6){var _0x287971=this;return new Promise(function(_0x580931,_0x4a21eb){return db['Template'][_0x6534('0x15')]({'raw':_0x1ec1e6['options']?_0x1ec1e6[_0x6534('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1ec1e6['options']?_0x1ec1e6['options'][_0x6534('0x17')]||null:null,'attributes':_0x1ec1e6[_0x6534('0x16')]?_0x1ec1e6[_0x6534('0x16')][_0x6534('0x18')]||null:null,'limit':_0x1ec1e6['options']?_0x1ec1e6[_0x6534('0x16')][_0x6534('0x19')]||null:null,'include':_0x1ec1e6[_0x6534('0x16')]?_0x1ec1e6['options'][_0x6534('0x1a')]?_[_0x6534('0x1b')](_0x1ec1e6[_0x6534('0x16')][_0x6534('0x1a')],function(_0x1a7bda){return{'model':db[_0x1a7bda[_0x6534('0x1c')]],'as':_0x1a7bda['as'],'attributes':_0x1a7bda[_0x6534('0x18')],'include':_0x1a7bda[_0x6534('0x1a')]?_[_0x6534('0x1b')](_0x1a7bda[_0x6534('0x1a')],function(_0x42caae){return{'model':db[_0x42caae[_0x6534('0x1c')]],'as':_0x42caae['as'],'attributes':_0x42caae[_0x6534('0x18')],'include':_0x42caae[_0x6534('0x1a')]?_['map'](_0x42caae[_0x6534('0x1a')],function(_0x463f21){return{'model':db[_0x463f21[_0x6534('0x1c')]],'as':_0x463f21['as'],'attributes':_0x463f21['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x25ca7f){logger[_0x6534('0xc')]('GetTemplate',_0x1ec1e6);logger[_0x6534('0xf')]('GetTemplate',_0x1ec1e6,JSON[_0x6534('0x11')](_0x25ca7f));_0x580931(_0x25ca7f);})[_0x6534('0x1d')](function(_0x3e2a53){logger[_0x6534('0x12')](_0x6534('0x1e'),_0x3e2a53[_0x6534('0x14')],_0x1ec1e6);_0x4a21eb(_0x287971[_0x6534('0x12')](0x1f4,_0x3e2a53['message']));});});}; \ No newline at end of file +var _0xbaf3=['http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x3087e3,_0x5f3edf){var _0x4a1f60=function(_0x119f15){while(--_0x119f15){_0x3087e3['push'](_0x3087e3['shift']());}};_0x4a1f60(++_0x5f3edf);}(_0xbaf3,0x1df));var _0x3baf=function(_0x4fcabf,_0x3536af){_0x4fcabf=_0x4fcabf-0x0;var _0xe9651=_0xbaf3[_0x4fcabf];return _0xe9651;};'use strict';var _=require(_0x3baf('0x0'));var util=require(_0x3baf('0x1'));var moment=require(_0x3baf('0x2'));var BPromise=require(_0x3baf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3baf('0x4'));var db=require(_0x3baf('0x5'))['db'];var utils=require(_0x3baf('0x6'));var logger=require('../../config/logger')(_0x3baf('0x7'));var config=require(_0x3baf('0x8'));var jayson=require(_0x3baf('0x9'));var client=jayson[_0x3baf('0xa')][_0x3baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x518d8d,_0x2775d0,_0x514868){return new BPromise(function(_0x430daf,_0x11ca2a){return client[_0x3baf('0xc')](_0x518d8d,_0x514868)[_0x3baf('0xd')](function(_0x251262){logger[_0x3baf('0xe')](_0x3baf('0xf'),_0x2775d0,_0x3baf('0x10'));logger[_0x3baf('0x11')](_0x3baf('0x12'),_0x2775d0,_0x3baf('0x10'),JSON[_0x3baf('0x13')](_0x251262));if(_0x251262[_0x3baf('0x14')]){if(_0x251262[_0x3baf('0x14')][_0x3baf('0x15')]===0x1f4){logger[_0x3baf('0x14')](_0x3baf('0xf'),_0x2775d0,_0x251262[_0x3baf('0x14')]['message']);return _0x11ca2a(_0x251262[_0x3baf('0x14')][_0x3baf('0x16')]);}logger[_0x3baf('0x14')](_0x3baf('0xf'),_0x2775d0,_0x251262[_0x3baf('0x14')][_0x3baf('0x16')]);return _0x430daf(_0x251262[_0x3baf('0x14')][_0x3baf('0x16')]);}else{logger[_0x3baf('0xe')](_0x3baf('0xf'),_0x2775d0,_0x3baf('0x10'));_0x430daf(_0x251262['result'][_0x3baf('0x16')]);}})[_0x3baf('0x17')](function(_0x5817bb){logger['error'](_0x3baf('0xf'),_0x2775d0,_0x5817bb);_0x11ca2a(_0x5817bb);});});}exports[_0x3baf('0x18')]=function(_0xf92cad){var _0x2d8b8a=this;return new Promise(function(_0x2158cb,_0x32bbc9){return db[_0x3baf('0x19')][_0x3baf('0x1a')]({'raw':_0xf92cad[_0x3baf('0x1b')]?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x1c')]===undefined?!![]:![]:!![],'where':_0xf92cad[_0x3baf('0x1b')]?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x1d')]||null:null,'attributes':_0xf92cad['options']?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x1e')]||null:null,'limit':_0xf92cad[_0x3baf('0x1b')]?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x1f')]||null:null,'include':_0xf92cad['options']?_0xf92cad[_0x3baf('0x1b')][_0x3baf('0x20')]?_['map'](_0xf92cad[_0x3baf('0x1b')]['include'],function(_0x25482e){return{'model':db[_0x25482e['model']],'as':_0x25482e['as'],'attributes':_0x25482e[_0x3baf('0x1e')],'include':_0x25482e[_0x3baf('0x20')]?_['map'](_0x25482e['include'],function(_0x43dcfb){return{'model':db[_0x43dcfb[_0x3baf('0x21')]],'as':_0x43dcfb['as'],'attributes':_0x43dcfb[_0x3baf('0x1e')],'include':_0x43dcfb[_0x3baf('0x20')]?_[_0x3baf('0x22')](_0x43dcfb[_0x3baf('0x20')],function(_0x3ae7ea){return{'model':db[_0x3ae7ea['model']],'as':_0x3ae7ea['as'],'attributes':_0x3ae7ea[_0x3baf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3baf('0xd')](function(_0x92f83d){logger['info'](_0x3baf('0x18'),_0xf92cad);logger[_0x3baf('0x11')](_0x3baf('0x18'),_0xf92cad,JSON[_0x3baf('0x13')](_0x92f83d));_0x2158cb(_0x92f83d);})[_0x3baf('0x17')](function(_0x20d55){logger[_0x3baf('0x14')](_0x3baf('0x18'),_0x20d55[_0x3baf('0x16')],_0xf92cad);_0x32bbc9(_0x2d8b8a[_0x3baf('0x14')](0x1f4,_0x20d55[_0x3baf('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 61e6e57..a05edea 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 _0x676b=['./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getActions','post','addAllCondition','addAnyCondition','addAction','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x676b,0x6d));var _0xb676=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0x676b[_0x257495];return _0x3849aa;};'use strict';var multer=require('multer');var util=require(_0xb676('0x0'));var path=require(_0xb676('0x1'));var timeout=require(_0xb676('0x2'));var express=require('express');var router=express[_0xb676('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb676('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb676('0x5'));var controller=require(_0xb676('0x6'));router[_0xb676('0x7')]('/',auth[_0xb676('0x8')](),controller['index']);router[_0xb676('0x7')](_0xb676('0x9'),auth[_0xb676('0x8')](),controller['show']);router[_0xb676('0x7')](_0xb676('0xa'),auth['isAuthenticated'](),controller[_0xb676('0xb')]);router[_0xb676('0x7')](_0xb676('0xc'),auth[_0xb676('0x8')](),controller['getAnyConditions']);router['get']('/:id/actions',auth[_0xb676('0x8')](),controller[_0xb676('0xd')]);router[_0xb676('0xe')]('/',auth[_0xb676('0x8')](),controller['create']);router['post'](_0xb676('0xa'),auth['isAuthenticated'](),controller[_0xb676('0xf')]);router[_0xb676('0xe')](_0xb676('0xc'),auth[_0xb676('0x8')](),controller[_0xb676('0x10')]);router[_0xb676('0xe')]('/:id/actions',auth[_0xb676('0x8')](),controller[_0xb676('0x11')]);router[_0xb676('0x12')](_0xb676('0x9'),auth['isAuthenticated'](),controller[_0xb676('0x13')]);router[_0xb676('0x14')](_0xb676('0x9'),auth[_0xb676('0x8')](),controller[_0xb676('0x15')]);module[_0xb676('0x16')]=router; \ No newline at end of file +var _0x0b95=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','getAllConditions','/:id/any_conditions','getActions','post','create','/:id/all_conditions','addAnyCondition','put','delete','destroy','exports'];(function(_0x3473e4,_0x120b11){var _0x55ff34=function(_0x307bb4){while(--_0x307bb4){_0x3473e4['push'](_0x3473e4['shift']());}};_0x55ff34(++_0x120b11);}(_0x0b95,0x198));var _0x50b9=function(_0x37d39d,_0x24fd57){_0x37d39d=_0x37d39d-0x0;var _0x4bcec2=_0x0b95[_0x37d39d];return _0x4bcec2;};'use strict';var multer=require('multer');var util=require(_0x50b9('0x0'));var path=require(_0x50b9('0x1'));var timeout=require(_0x50b9('0x2'));var express=require(_0x50b9('0x3'));var router=express[_0x50b9('0x4')]();var fs_extra=require(_0x50b9('0x5'));var auth=require(_0x50b9('0x6'));var interaction=require(_0x50b9('0x7'));var config=require('../../config/environment');var controller=require('./trigger.controller');router['get']('/',auth[_0x50b9('0x8')](),controller[_0x50b9('0x9')]);router[_0x50b9('0xa')](_0x50b9('0xb'),auth['isAuthenticated'](),controller[_0x50b9('0xc')]);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x50b9('0xd')]);router['get'](_0x50b9('0xe'),auth[_0x50b9('0x8')](),controller['getAnyConditions']);router[_0x50b9('0xa')]('/:id/actions',auth[_0x50b9('0x8')](),controller[_0x50b9('0xf')]);router[_0x50b9('0x10')]('/',auth[_0x50b9('0x8')](),controller[_0x50b9('0x11')]);router[_0x50b9('0x10')](_0x50b9('0x12'),auth[_0x50b9('0x8')](),controller['addAllCondition']);router[_0x50b9('0x10')](_0x50b9('0xe'),auth[_0x50b9('0x8')](),controller[_0x50b9('0x13')]);router[_0x50b9('0x10')]('/:id/actions',auth[_0x50b9('0x8')](),controller['addAction']);router[_0x50b9('0x14')](_0x50b9('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x50b9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x50b9('0x16')]);module[_0x50b9('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index c3f9830..8687eda 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 _0x8fce=['exports','STRING','BOOLEAN','sequelize'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x8fce,0x1b7));var _0xe8fc=function(_0x2b05fa,_0x481073){_0x2b05fa=_0x2b05fa-0x0;var _0x25633c=_0x8fce[_0x2b05fa];return _0x25633c;};'use strict';var Sequelize=require(_0xe8fc('0x0'));module[_0xe8fc('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe8fc('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe8fc('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5993=['BOOLEAN','sequelize','exports','STRING'];(function(_0x330266,_0x210602){var _0x321409=function(_0x3e8398){while(--_0x3e8398){_0x330266['push'](_0x330266['shift']());}};_0x321409(++_0x210602);}(_0x5993,0x71));var _0x3599=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0x5993[_0x2459fd];return _0x364cd2;};'use strict';var Sequelize=require(_0x3599('0x0'));module[_0x3599('0x1')]={'name':{'type':Sequelize[_0x3599('0x2')]},'channel':{'type':Sequelize[_0x3599('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x3599('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index ed92467..4669d6c 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 _0x123a=['keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','getAnyConditions','TriggerId','Action','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','status','error','stack','name','send','index','map','Trigger','fieldName','key','query'];(function(_0x3946d1,_0x19771f){var _0x410bcf=function(_0x49c13d){while(--_0x49c13d){_0x3946d1['push'](_0x3946d1['shift']());}};_0x410bcf(++_0x19771f);}(_0x123a,0x1c2));var _0xa123=function(_0xe5f6d8,_0x14d787){_0xe5f6d8=_0xe5f6d8-0x0;var _0x239ce6=_0x123a[_0xe5f6d8];return _0x239ce6;};'use strict';var emlformat=require(_0xa123('0x0'));var rimraf=require(_0xa123('0x1'));var zipdir=require(_0xa123('0x2'));var jsonpatch=require(_0xa123('0x3'));var rp=require(_0xa123('0x4'));var moment=require(_0xa123('0x5'));var BPromise=require(_0xa123('0x6'));var Mustache=require(_0xa123('0x7'));var util=require(_0xa123('0x8'));var path=require(_0xa123('0x9'));var sox=require(_0xa123('0xa'));var csv=require('to-csv');var ejs=require(_0xa123('0xb'));var fs=require('fs');var fs_extra=require(_0xa123('0xc'));var _=require(_0xa123('0xd'));var squel=require('squel');var crypto=require(_0xa123('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa123('0xf'));var toCsv=require(_0xa123('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa123('0x11'));var authService=require(_0xa123('0x12'));var qs=require(_0xa123('0x13'));var as=require(_0xa123('0x14'));var hardwareService=require(_0xa123('0x15'));var logger=require(_0xa123('0x16'))(_0xa123('0x17'));var utils=require(_0xa123('0x18'));var config=require(_0xa123('0x19'));var licenseUtil=require(_0xa123('0x1a'));var db=require(_0xa123('0x1b'))['db'];function respondWithStatusCode(_0x5c4d88,_0x3a1106){_0x3a1106=_0x3a1106||0xcc;return function(_0x4f931e){if(_0x4f931e){return _0x5c4d88[_0xa123('0x1c')](_0x3a1106);}return _0x5c4d88['status'](_0x3a1106)[_0xa123('0x1d')]();};}function respondWithResult(_0x17f616,_0x131dff){_0x131dff=_0x131dff||0xc8;return function(_0x241d93){if(_0x241d93){return _0x17f616['status'](_0x131dff)[_0xa123('0x1e')](_0x241d93);}};}function respondWithFilteredResult(_0xbc81a4,_0x4bd484){return function(_0x1152c9){if(_0x1152c9){var _0x4fd6d5=typeof _0x4bd484[_0xa123('0x1f')]===_0xa123('0x20')&&typeof _0x4bd484['limit']===_0xa123('0x20');var _0x340950=_0x1152c9[_0xa123('0x21')];var _0x1210f5=_0x4fd6d5?0x0:_0x4bd484[_0xa123('0x1f')];var _0x14a08c=_0x4fd6d5?_0x1152c9[_0xa123('0x21')]:_0x4bd484[_0xa123('0x1f')]+_0x4bd484['limit'];var _0x8de153;if(_0x14a08c>=_0x340950){_0x14a08c=_0x340950;_0x8de153=0xc8;}else{_0x8de153=0xce;}_0xbc81a4['status'](_0x8de153);return _0xbc81a4['set'](_0xa123('0x22'),_0x1210f5+'-'+_0x14a08c+'/'+_0x340950)[_0xa123('0x1e')](_0x1152c9);}return null;};}function patchUpdates(_0x525cc8){return function(_0x2a6588){try{jsonpatch[_0xa123('0x23')](_0x2a6588,_0x525cc8,!![]);}catch(_0x40e930){return BPromise[_0xa123('0x24')](_0x40e930);}return _0x2a6588[_0xa123('0x25')]();};}function saveUpdates(_0x2e29f0,_0x6de225){return function(_0x38f026){if(_0x38f026){return _0x38f026[_0xa123('0x26')](_0x2e29f0)[_0xa123('0x27')](function(_0x357ff2){return _0x357ff2;});}return null;};}function removeEntity(_0x46e0f3,_0xdc104a){return function(_0x12f394){if(_0x12f394){return _0x12f394[_0xa123('0x28')]()[_0xa123('0x27')](function(){var _0x5d0707=_0x12f394[_0xa123('0x29')]({'plain':!![]});var _0x1c93c3=_0xa123('0x2a');return db[_0xa123('0x2b')][_0xa123('0x28')]({'where':{'type':_0x1c93c3,'resourceId':_0x5d0707['id']}})['then'](function(){return _0x12f394;});})[_0xa123('0x27')](function(){_0x46e0f3[_0xa123('0x2c')](0xcc)[_0xa123('0x1d')]();});}};}function handleEntityNotFound(_0x107c73,_0x34a69f){return function(_0x343394){if(!_0x343394){_0x107c73[_0xa123('0x1c')](0x194);}return _0x343394;};}function handleError(_0x4a8256,_0x575d46){_0x575d46=_0x575d46||0x1f4;return function(_0x514d49){logger[_0xa123('0x2d')](_0x514d49[_0xa123('0x2e')]);if(_0x514d49[_0xa123('0x2f')]){delete _0x514d49[_0xa123('0x2f')];}_0x4a8256[_0xa123('0x2c')](_0x575d46)[_0xa123('0x30')](_0x514d49);};}exports[_0xa123('0x31')]=function(_0x57a4e9,_0x1ad027){var _0x4f6d16={},_0x2e0d14={},_0x43e3e2={'count':0x0,'rows':[]};var _0x512b6f=_[_0xa123('0x32')](db[_0xa123('0x33')]['rawAttributes'],function(_0x342cf3){return{'name':_0x342cf3[_0xa123('0x34')],'type':_0x342cf3['type'][_0xa123('0x35')]};});_0x2e0d14['model']=_[_0xa123('0x32')](_0x512b6f,'name');_0x2e0d14[_0xa123('0x36')]=_[_0xa123('0x37')](_0x57a4e9['query']);_0x2e0d14[_0xa123('0x38')]=_[_0xa123('0x39')](_0x2e0d14[_0xa123('0x3a')],_0x2e0d14[_0xa123('0x36')]);_0x4f6d16[_0xa123('0x3b')]=_[_0xa123('0x39')](_0x2e0d14[_0xa123('0x3a')],qs[_0xa123('0x3c')](_0x57a4e9[_0xa123('0x36')]['fields']));_0x4f6d16[_0xa123('0x3b')]=_0x4f6d16[_0xa123('0x3b')][_0xa123('0x3d')]?_0x4f6d16[_0xa123('0x3b')]:_0x2e0d14[_0xa123('0x3a')];if(!_0x57a4e9['query'][_0xa123('0x3e')](_0xa123('0x3f'))){_0x4f6d16[_0xa123('0x40')]=qs[_0xa123('0x40')](_0x57a4e9[_0xa123('0x36')][_0xa123('0x40')]);_0x4f6d16[_0xa123('0x1f')]=qs['offset'](_0x57a4e9[_0xa123('0x36')]['offset']);}_0x4f6d16[_0xa123('0x41')]=qs[_0xa123('0x42')](_0x57a4e9[_0xa123('0x36')]['sort']);_0x4f6d16['where']=qs['filters'](_[_0xa123('0x43')](_0x57a4e9[_0xa123('0x36')],_0x2e0d14[_0xa123('0x38')]),_0x512b6f);if(_0x57a4e9[_0xa123('0x36')][_0xa123('0x44')]){_0x4f6d16[_0xa123('0x45')]=_[_0xa123('0x46')](_0x4f6d16[_0xa123('0x45')],{'$or':_[_0xa123('0x32')](_0x512b6f,function(_0x39a6e1){if(_0x39a6e1[_0xa123('0x47')]!=='VIRTUAL'){var _0x129921={};_0x129921[_0x39a6e1['name']]={'$like':'%'+_0x57a4e9['query'][_0xa123('0x44')]+'%'};return _0x129921;}})});}_0x4f6d16=_[_0xa123('0x46')]({},_0x4f6d16,_0x57a4e9[_0xa123('0x48')]);var _0x985a7b={'where':_0x4f6d16[_0xa123('0x45')]};return db[_0xa123('0x33')]['count'](_0x985a7b)[_0xa123('0x27')](function(_0x751b51){_0x43e3e2[_0xa123('0x21')]=_0x751b51;if(_0x57a4e9['query']['includeAll']){_0x4f6d16['include']=[{'all':!![]}];}return db[_0xa123('0x33')][_0xa123('0x49')](_0x4f6d16);})[_0xa123('0x27')](function(_0x49a270){_0x43e3e2[_0xa123('0x4a')]=_0x49a270;return _0x43e3e2;})[_0xa123('0x27')](respondWithFilteredResult(_0x1ad027,_0x4f6d16))[_0xa123('0x4b')](handleError(_0x1ad027,null));};exports[_0xa123('0x4c')]=function(_0x469add,_0x51917c){var _0xb341b0={'raw':![],'where':{'id':_0x469add[_0xa123('0x4d')]['id']}},_0x5591e0={};_0x5591e0[_0xa123('0x3a')]=_['keys'](db[_0xa123('0x33')][_0xa123('0x4e')]);_0x5591e0[_0xa123('0x36')]=_[_0xa123('0x37')](_0x469add[_0xa123('0x36')]);_0x5591e0[_0xa123('0x38')]=_[_0xa123('0x39')](_0x5591e0['model'],_0x5591e0[_0xa123('0x36')]);_0xb341b0[_0xa123('0x3b')]=_[_0xa123('0x39')](_0x5591e0[_0xa123('0x3a')],qs['fields'](_0x469add[_0xa123('0x36')][_0xa123('0x3c')]));_0xb341b0[_0xa123('0x3b')]=_0xb341b0[_0xa123('0x3b')][_0xa123('0x3d')]?_0xb341b0[_0xa123('0x3b')]:_0x5591e0['model'];if(_0x469add[_0xa123('0x36')][_0xa123('0x4f')]){_0xb341b0[_0xa123('0x50')]=[{'all':!![]}];}_0xb341b0=_[_0xa123('0x46')]({},_0xb341b0,_0x469add[_0xa123('0x48')]);return db[_0xa123('0x33')][_0xa123('0x51')](_0xb341b0)['then'](handleEntityNotFound(_0x51917c,null))['then'](respondWithResult(_0x51917c,null))['catch'](handleError(_0x51917c,null));};exports[_0xa123('0x52')]=function(_0x30041a,_0x4497bc){return db[_0xa123('0x33')][_0xa123('0x52')](_0x30041a[_0xa123('0x53')],{})['then'](function(_0x1a6bce){var _0x31ceb8=_0x30041a[_0xa123('0x54')]['get']({'plain':!![]});if(!_0x31ceb8)throw new Error(_0xa123('0x55'));if(_0x31ceb8['role']==='user'){var _0x41b8fd=_0x1a6bce[_0xa123('0x29')]({'plain':!![]});var _0x5a0727=_0xa123('0x2a');return db[_0xa123('0x56')][_0xa123('0x51')]({'where':{'name':_0x5a0727,'userProfileId':_0x31ceb8[_0xa123('0x57')]},'raw':!![]})[_0xa123('0x27')](function(_0x20d044){if(_0x20d044&&_0x20d044[_0xa123('0x58')]===0x0){return db[_0xa123('0x2b')][_0xa123('0x52')]({'name':_0x41b8fd[_0xa123('0x2f')],'resourceId':_0x41b8fd['id'],'type':_0x20d044[_0xa123('0x2f')],'sectionId':_0x20d044['id']},{})[_0xa123('0x27')](function(){return _0x1a6bce;});}else{return _0x1a6bce;}})['catch'](function(_0x25f8b0){logger[_0xa123('0x2d')](_0xa123('0x59'),_0x25f8b0);throw _0x25f8b0;});}return _0x1a6bce;})['then'](respondWithResult(_0x4497bc,0xc9))[_0xa123('0x4b')](handleError(_0x4497bc,null));};exports[_0xa123('0x26')]=function(_0x1a575c,_0x464bb2){if(_0x1a575c[_0xa123('0x53')]['id']){delete _0x1a575c[_0xa123('0x53')]['id'];}return db[_0xa123('0x33')][_0xa123('0x51')]({'where':{'id':_0x1a575c['params']['id']}})['then'](handleEntityNotFound(_0x464bb2,null))[_0xa123('0x27')](saveUpdates(_0x1a575c[_0xa123('0x53')],null))[_0xa123('0x27')](respondWithResult(_0x464bb2,null))['catch'](handleError(_0x464bb2,null));};exports[_0xa123('0x28')]=function(_0x2dcdc2,_0x1c51d4){return db[_0xa123('0x33')]['find']({'where':{'id':_0x2dcdc2[_0xa123('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c51d4,null))[_0xa123('0x27')](removeEntity(_0x1c51d4,null))[_0xa123('0x4b')](handleError(_0x1c51d4,null));};exports[_0xa123('0x5a')]=function(_0x38f05c,_0x2e71a9,_0x5b040d){if(_0x38f05c[_0xa123('0x53')]['id']){delete _0x38f05c['body']['id'];}return db[_0xa123('0x33')][_0xa123('0x51')]({'where':{'id':_0x38f05c['params']['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x2e71a9,null))[_0xa123('0x27')](function(_0xca00f8){if(_0xca00f8){_0x38f05c[_0xa123('0x53')][_0xa123('0x5b')]=_0xca00f8['id'];return db['Condition'][_0xa123('0x52')](_0x38f05c[_0xa123('0x53')]);}})[_0xa123('0x27')](respondWithResult(_0x2e71a9,null))[_0xa123('0x4b')](handleError(_0x2e71a9,null));};exports[_0xa123('0x5c')]=function(_0x407ba2,_0x615e05,_0x307e85){if(_0x407ba2[_0xa123('0x53')]['id']){delete _0x407ba2[_0xa123('0x53')]['id'];}return db['Trigger']['find']({'where':{'id':_0x407ba2['params']['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x615e05,null))[_0xa123('0x27')](function(_0x5bf9a1){if(_0x5bf9a1){_0x407ba2[_0xa123('0x53')][_0xa123('0x5d')]=_0x5bf9a1['id'];return db[_0xa123('0x5e')]['create'](_0x407ba2['body']);}})['then'](respondWithResult(_0x615e05,null))[_0xa123('0x4b')](handleError(_0x615e05,null));};exports[_0xa123('0x5f')]=function(_0x34a01b,_0x98d058,_0x47a7eb){var _0x5b4a12={};var _0x1a7907={};var _0x106e01;var _0x2fb0cb;return db[_0xa123('0x33')]['findOne']({'where':{'id':_0x34a01b['params']['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x98d058,null))[_0xa123('0x27')](function(_0x24a790){if(_0x24a790){_0x106e01=_0x24a790;_0x1a7907['model']=_[_0xa123('0x37')](db[_0xa123('0x5e')][_0xa123('0x4e')]);_0x1a7907[_0xa123('0x36')]=_['keys'](_0x34a01b[_0xa123('0x36')]);_0x1a7907['filters']=_['intersection'](_0x1a7907[_0xa123('0x3a')],_0x1a7907[_0xa123('0x36')]);_0x5b4a12['attributes']=_['intersection'](_0x1a7907['model'],qs['fields'](_0x34a01b['query'][_0xa123('0x3c')]));_0x5b4a12['attributes']=_0x5b4a12[_0xa123('0x3b')][_0xa123('0x3d')]?_0x5b4a12['attributes']:_0x1a7907[_0xa123('0x3a')];_0x5b4a12[_0xa123('0x41')]=qs[_0xa123('0x42')](_0x34a01b[_0xa123('0x36')][_0xa123('0x42')]);_0x5b4a12[_0xa123('0x45')]=qs[_0xa123('0x38')](_[_0xa123('0x43')](_0x34a01b[_0xa123('0x36')],_0x1a7907['filters']));if(_0x34a01b[_0xa123('0x36')][_0xa123('0x44')]){_0x5b4a12[_0xa123('0x45')]=_[_0xa123('0x46')](_0x5b4a12[_0xa123('0x45')],{'$or':_[_0xa123('0x32')](_0x5b4a12[_0xa123('0x3b')],function(_0x45340e){var _0xafd11d={};_0xafd11d[_0x45340e]={'$like':'%'+_0x34a01b[_0xa123('0x36')][_0xa123('0x44')]+'%'};return _0xafd11d;})});}_0x5b4a12=_[_0xa123('0x46')]({},_0x5b4a12,_0x34a01b[_0xa123('0x48')]);return _0x106e01[_0xa123('0x5f')](_0x5b4a12);}})[_0xa123('0x27')](function(_0x229fcb){if(_0x229fcb){_0x2fb0cb=_0x229fcb[_0xa123('0x3d')];if(!_0x34a01b[_0xa123('0x36')][_0xa123('0x3e')](_0xa123('0x3f'))){_0x5b4a12['limit']=qs[_0xa123('0x40')](_0x34a01b[_0xa123('0x36')]['limit']);_0x5b4a12['offset']=qs[_0xa123('0x1f')](_0x34a01b[_0xa123('0x36')][_0xa123('0x1f')]);}return _0x106e01['getAllConditions'](_0x5b4a12);}})[_0xa123('0x27')](function(_0x40a2e2){if(_0x40a2e2){return _0x40a2e2?{'count':_0x2fb0cb,'rows':_0x40a2e2}:null;}})[_0xa123('0x27')](respondWithResult(_0x98d058,null))[_0xa123('0x4b')](handleError(_0x98d058,null));};exports[_0xa123('0x60')]=function(_0x48ca37,_0x31a64c,_0x3beb6a){var _0x179231={};var _0x3dcf9f={};var _0x15ae5f;var _0x54a84f;return db[_0xa123('0x33')]['findOne']({'where':{'id':_0x48ca37['params']['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x31a64c,null))[_0xa123('0x27')](function(_0x2fc53c){if(_0x2fc53c){_0x15ae5f=_0x2fc53c;_0x3dcf9f['model']=_[_0xa123('0x37')](db[_0xa123('0x5e')][_0xa123('0x4e')]);_0x3dcf9f[_0xa123('0x36')]=_[_0xa123('0x37')](_0x48ca37[_0xa123('0x36')]);_0x3dcf9f[_0xa123('0x38')]=_['intersection'](_0x3dcf9f[_0xa123('0x3a')],_0x3dcf9f[_0xa123('0x36')]);_0x179231[_0xa123('0x3b')]=_['intersection'](_0x3dcf9f[_0xa123('0x3a')],qs[_0xa123('0x3c')](_0x48ca37['query'][_0xa123('0x3c')]));_0x179231['attributes']=_0x179231['attributes'][_0xa123('0x3d')]?_0x179231[_0xa123('0x3b')]:_0x3dcf9f[_0xa123('0x3a')];_0x179231[_0xa123('0x41')]=qs[_0xa123('0x42')](_0x48ca37[_0xa123('0x36')]['sort']);_0x179231['where']=qs[_0xa123('0x38')](_['pick'](_0x48ca37[_0xa123('0x36')],_0x3dcf9f[_0xa123('0x38')]));if(_0x48ca37[_0xa123('0x36')][_0xa123('0x44')]){_0x179231[_0xa123('0x45')]=_[_0xa123('0x46')](_0x179231[_0xa123('0x45')],{'$or':_[_0xa123('0x32')](_0x179231[_0xa123('0x3b')],function(_0x1c21e5){var _0x1dc0df={};_0x1dc0df[_0x1c21e5]={'$like':'%'+_0x48ca37['query'][_0xa123('0x44')]+'%'};return _0x1dc0df;})});}_0x179231=_[_0xa123('0x46')]({},_0x179231,_0x48ca37[_0xa123('0x48')]);return _0x15ae5f[_0xa123('0x60')](_0x179231);}})[_0xa123('0x27')](function(_0x474057){if(_0x474057){_0x54a84f=_0x474057[_0xa123('0x3d')];if(!_0x48ca37[_0xa123('0x36')][_0xa123('0x3e')](_0xa123('0x3f'))){_0x179231['limit']=qs['limit'](_0x48ca37[_0xa123('0x36')]['limit']);_0x179231['offset']=qs['offset'](_0x48ca37[_0xa123('0x36')][_0xa123('0x1f')]);}return _0x15ae5f['getAnyConditions'](_0x179231);}})[_0xa123('0x27')](function(_0x37168d){if(_0x37168d){return _0x37168d?{'count':_0x54a84f,'rows':_0x37168d}:null;}})[_0xa123('0x27')](respondWithResult(_0x31a64c,null))[_0xa123('0x4b')](handleError(_0x31a64c,null));};exports['addAction']=function(_0x5652b4,_0x401373,_0x2c49c9){if(_0x5652b4[_0xa123('0x53')]['id']){delete _0x5652b4['body']['id'];}return db['Trigger'][_0xa123('0x51')]({'where':{'id':_0x5652b4[_0xa123('0x4d')]['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x401373,null))[_0xa123('0x27')](function(_0x3a8d26){if(_0x3a8d26){_0x5652b4[_0xa123('0x53')][_0xa123('0x61')]=_0x3a8d26['id'];return db[_0xa123('0x62')][_0xa123('0x52')](_0x5652b4[_0xa123('0x53')]);}})[_0xa123('0x27')](respondWithResult(_0x401373,null))[_0xa123('0x4b')](handleError(_0x401373,null));};exports[_0xa123('0x63')]=function(_0x9076a2,_0x1d5659,_0x2b1643){var _0x26dab1={};var _0x103c1b={};var _0x58006;var _0x10e630;return db[_0xa123('0x33')][_0xa123('0x64')]({'where':{'id':_0x9076a2[_0xa123('0x4d')]['id']}})[_0xa123('0x27')](handleEntityNotFound(_0x1d5659,null))[_0xa123('0x27')](function(_0x47b2b9){if(_0x47b2b9){_0x58006=_0x47b2b9;_0x103c1b['model']=_['keys'](db[_0xa123('0x62')][_0xa123('0x4e')]);_0x103c1b[_0xa123('0x36')]=_['keys'](_0x9076a2[_0xa123('0x36')]);_0x103c1b[_0xa123('0x38')]=_['intersection'](_0x103c1b[_0xa123('0x3a')],_0x103c1b[_0xa123('0x36')]);_0x26dab1[_0xa123('0x3b')]=_[_0xa123('0x39')](_0x103c1b[_0xa123('0x3a')],qs[_0xa123('0x3c')](_0x9076a2[_0xa123('0x36')][_0xa123('0x3c')]));_0x26dab1['attributes']=_0x26dab1[_0xa123('0x3b')][_0xa123('0x3d')]?_0x26dab1[_0xa123('0x3b')]:_0x103c1b[_0xa123('0x3a')];_0x26dab1[_0xa123('0x41')]=qs[_0xa123('0x42')](_0x9076a2[_0xa123('0x36')][_0xa123('0x42')]);_0x26dab1[_0xa123('0x45')]=qs[_0xa123('0x38')](_[_0xa123('0x43')](_0x9076a2['query'],_0x103c1b[_0xa123('0x38')]));if(_0x9076a2[_0xa123('0x36')][_0xa123('0x44')]){_0x26dab1['where']=_['merge'](_0x26dab1[_0xa123('0x45')],{'$or':_[_0xa123('0x32')](_0x26dab1[_0xa123('0x3b')],function(_0x1261c4){var _0x552b97={};_0x552b97[_0x1261c4]={'$like':'%'+_0x9076a2[_0xa123('0x36')][_0xa123('0x44')]+'%'};return _0x552b97;})});}_0x26dab1=_[_0xa123('0x46')]({},_0x26dab1,_0x9076a2['options']);return _0x58006['getActions'](_0x26dab1);}})[_0xa123('0x27')](function(_0x1bba32){if(_0x1bba32){_0x10e630=_0x1bba32[_0xa123('0x3d')];if(!_0x9076a2['query'][_0xa123('0x3e')](_0xa123('0x3f'))){_0x26dab1[_0xa123('0x40')]=qs[_0xa123('0x40')](_0x9076a2[_0xa123('0x36')][_0xa123('0x40')]);_0x26dab1[_0xa123('0x1f')]=qs[_0xa123('0x1f')](_0x9076a2['query'][_0xa123('0x1f')]);}return _0x58006['getActions'](_0x26dab1);}})[_0xa123('0x27')](function(_0x47e0ff){if(_0x47e0ff){return _0x47e0ff?{'count':_0x10e630,'rows':_0x47e0ff}:null;}})[_0xa123('0x27')](respondWithResult(_0x1d5659,null))[_0xa123('0x4b')](handleError(_0x1d5659,null));}; \ No newline at end of file +var _0x5525=['role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','filter','nolimit','length','pick','getAnyConditions','addAction','TriggerId','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','Triggers','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','order','sort','where','type','VIRTUAL','includeAll','include','Trigger','findAll','rows','catch','show','params','merge','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4df17c,_0x2d2b61){var _0x4e79b5=function(_0x2134a5){while(--_0x2134a5){_0x4df17c['push'](_0x4df17c['shift']());}};_0x4e79b5(++_0x2d2b61);}(_0x5525,0x1ec));var _0x5552=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5525[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x5552('0x0'));var rimraf=require(_0x5552('0x1'));var zipdir=require(_0x5552('0x2'));var jsonpatch=require(_0x5552('0x3'));var rp=require('request-promise');var moment=require(_0x5552('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5552('0x5'));var util=require(_0x5552('0x6'));var path=require(_0x5552('0x7'));var sox=require(_0x5552('0x8'));var csv=require('to-csv');var ejs=require(_0x5552('0x9'));var fs=require('fs');var fs_extra=require(_0x5552('0xa'));var _=require(_0x5552('0xb'));var squel=require('squel');var crypto=require(_0x5552('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5552('0xd'));var toCsv=require(_0x5552('0xe'));var querystring=require(_0x5552('0xf'));var Papa=require(_0x5552('0x10'));var Redis=require(_0x5552('0x11'));var authService=require(_0x5552('0x12'));var qs=require(_0x5552('0x13'));var as=require(_0x5552('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5552('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5552('0x16'));var db=require(_0x5552('0x17'))['db'];function respondWithStatusCode(_0x2ffdb1,_0x302ad4){_0x302ad4=_0x302ad4||0xcc;return function(_0x3b4c69){if(_0x3b4c69){return _0x2ffdb1[_0x5552('0x18')](_0x302ad4);}return _0x2ffdb1[_0x5552('0x19')](_0x302ad4)[_0x5552('0x1a')]();};}function respondWithResult(_0x3586d9,_0x4213fb){_0x4213fb=_0x4213fb||0xc8;return function(_0x5488de){if(_0x5488de){return _0x3586d9[_0x5552('0x19')](_0x4213fb)[_0x5552('0x1b')](_0x5488de);}};}function respondWithFilteredResult(_0x156f63,_0x968894){return function(_0x4bfc85){if(_0x4bfc85){var _0x48fa43=typeof _0x968894[_0x5552('0x1c')]==='undefined'&&typeof _0x968894[_0x5552('0x1d')]===_0x5552('0x1e');var _0x539b81=_0x4bfc85[_0x5552('0x1f')];var _0x3891ad=_0x48fa43?0x0:_0x968894['offset'];var _0x1e03db=_0x48fa43?_0x4bfc85[_0x5552('0x1f')]:_0x968894[_0x5552('0x1c')]+_0x968894[_0x5552('0x1d')];var _0x438559;if(_0x1e03db>=_0x539b81){_0x1e03db=_0x539b81;_0x438559=0xc8;}else{_0x438559=0xce;}_0x156f63[_0x5552('0x19')](_0x438559);return _0x156f63[_0x5552('0x20')](_0x5552('0x21'),_0x3891ad+'-'+_0x1e03db+'/'+_0x539b81)['json'](_0x4bfc85);}return null;};}function patchUpdates(_0x3fa605){return function(_0x6b3df9){try{jsonpatch['apply'](_0x6b3df9,_0x3fa605,!![]);}catch(_0x533444){return BPromise['reject'](_0x533444);}return _0x6b3df9['save']();};}function saveUpdates(_0xe2c9c6,_0x38fc67){return function(_0x3daf08){if(_0x3daf08){return _0x3daf08[_0x5552('0x22')](_0xe2c9c6)[_0x5552('0x23')](function(_0x52171b){return _0x52171b;});}return null;};}function removeEntity(_0x3bce0e,_0x3835c2){return function(_0x1ca9fa){if(_0x1ca9fa){return _0x1ca9fa['destroy']()[_0x5552('0x23')](function(){var _0x3aa159=_0x1ca9fa['get']({'plain':!![]});var _0x17aa0d=_0x5552('0x24');return db[_0x5552('0x25')]['destroy']({'where':{'type':_0x17aa0d,'resourceId':_0x3aa159['id']}})[_0x5552('0x23')](function(){return _0x1ca9fa;});})[_0x5552('0x23')](function(){_0x3bce0e[_0x5552('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16ddfe,_0x972ae2){return function(_0x5383cb){if(!_0x5383cb){_0x16ddfe[_0x5552('0x18')](0x194);}return _0x5383cb;};}function handleError(_0x5ae974,_0x30edc2){_0x30edc2=_0x30edc2||0x1f4;return function(_0x190fee){logger['error'](_0x190fee[_0x5552('0x26')]);if(_0x190fee[_0x5552('0x27')]){delete _0x190fee[_0x5552('0x27')];}_0x5ae974[_0x5552('0x19')](_0x30edc2)[_0x5552('0x28')](_0x190fee);};}exports['index']=function(_0x42c3c6,_0x2ac196){var _0x4adc38={},_0xee1bd8={},_0x17a668={'count':0x0,'rows':[]};var _0x72d50c=_[_0x5552('0x29')](db['Trigger'][_0x5552('0x2a')],function(_0x406be4){return{'name':_0x406be4[_0x5552('0x2b')],'type':_0x406be4['type'][_0x5552('0x2c')]};});_0xee1bd8[_0x5552('0x2d')]=_[_0x5552('0x29')](_0x72d50c,_0x5552('0x27'));_0xee1bd8[_0x5552('0x2e')]=_[_0x5552('0x2f')](_0x42c3c6[_0x5552('0x2e')]);_0xee1bd8[_0x5552('0x30')]=_['intersection'](_0xee1bd8[_0x5552('0x2d')],_0xee1bd8['query']);_0x4adc38[_0x5552('0x31')]=_[_0x5552('0x32')](_0xee1bd8['model'],qs[_0x5552('0x33')](_0x42c3c6[_0x5552('0x2e')][_0x5552('0x33')]));_0x4adc38[_0x5552('0x31')]=_0x4adc38[_0x5552('0x31')]['length']?_0x4adc38[_0x5552('0x31')]:_0xee1bd8[_0x5552('0x2d')];if(!_0x42c3c6[_0x5552('0x2e')]['hasOwnProperty']('nolimit')){_0x4adc38['limit']=qs[_0x5552('0x1d')](_0x42c3c6[_0x5552('0x2e')][_0x5552('0x1d')]);_0x4adc38[_0x5552('0x1c')]=qs[_0x5552('0x1c')](_0x42c3c6['query'][_0x5552('0x1c')]);}_0x4adc38[_0x5552('0x34')]=qs[_0x5552('0x35')](_0x42c3c6['query'][_0x5552('0x35')]);_0x4adc38['where']=qs[_0x5552('0x30')](_['pick'](_0x42c3c6[_0x5552('0x2e')],_0xee1bd8['filters']),_0x72d50c);if(_0x42c3c6[_0x5552('0x2e')]['filter']){_0x4adc38['where']=_['merge'](_0x4adc38[_0x5552('0x36')],{'$or':_[_0x5552('0x29')](_0x72d50c,function(_0x18df66){if(_0x18df66[_0x5552('0x37')]!==_0x5552('0x38')){var _0xeaf84f={};_0xeaf84f[_0x18df66[_0x5552('0x27')]]={'$like':'%'+_0x42c3c6['query']['filter']+'%'};return _0xeaf84f;}})});}_0x4adc38=_['merge']({},_0x4adc38,_0x42c3c6['options']);var _0x51d009={'where':_0x4adc38['where']};return db['Trigger']['count'](_0x51d009)[_0x5552('0x23')](function(_0x29ad73){_0x17a668['count']=_0x29ad73;if(_0x42c3c6[_0x5552('0x2e')][_0x5552('0x39')]){_0x4adc38[_0x5552('0x3a')]=[{'all':!![]}];}return db[_0x5552('0x3b')][_0x5552('0x3c')](_0x4adc38);})['then'](function(_0x5df1b3){_0x17a668[_0x5552('0x3d')]=_0x5df1b3;return _0x17a668;})[_0x5552('0x23')](respondWithFilteredResult(_0x2ac196,_0x4adc38))[_0x5552('0x3e')](handleError(_0x2ac196,null));};exports[_0x5552('0x3f')]=function(_0x19b7b4,_0x209790){var _0x5b1a0e={'raw':![],'where':{'id':_0x19b7b4[_0x5552('0x40')]['id']}},_0x490e3e={};_0x490e3e[_0x5552('0x2d')]=_[_0x5552('0x2f')](db[_0x5552('0x3b')][_0x5552('0x2a')]);_0x490e3e[_0x5552('0x2e')]=_['keys'](_0x19b7b4['query']);_0x490e3e[_0x5552('0x30')]=_['intersection'](_0x490e3e[_0x5552('0x2d')],_0x490e3e[_0x5552('0x2e')]);_0x5b1a0e['attributes']=_[_0x5552('0x32')](_0x490e3e[_0x5552('0x2d')],qs['fields'](_0x19b7b4[_0x5552('0x2e')]['fields']));_0x5b1a0e[_0x5552('0x31')]=_0x5b1a0e[_0x5552('0x31')]['length']?_0x5b1a0e[_0x5552('0x31')]:_0x490e3e['model'];if(_0x19b7b4[_0x5552('0x2e')][_0x5552('0x39')]){_0x5b1a0e[_0x5552('0x3a')]=[{'all':!![]}];}_0x5b1a0e=_[_0x5552('0x41')]({},_0x5b1a0e,_0x19b7b4[_0x5552('0x42')]);return db[_0x5552('0x3b')]['find'](_0x5b1a0e)[_0x5552('0x23')](handleEntityNotFound(_0x209790,null))[_0x5552('0x23')](respondWithResult(_0x209790,null))[_0x5552('0x3e')](handleError(_0x209790,null));};exports[_0x5552('0x43')]=function(_0x41ed64,_0x1dd489){return db['Trigger']['create'](_0x41ed64[_0x5552('0x44')],{})['then'](function(_0x4b06c1){var _0x5ce3b9=_0x41ed64[_0x5552('0x45')][_0x5552('0x46')]({'plain':!![]});if(!_0x5ce3b9)throw new Error(_0x5552('0x47'));if(_0x5ce3b9[_0x5552('0x48')]===_0x5552('0x45')){var _0x2025d2=_0x4b06c1['get']({'plain':!![]});var _0x35adc1=_0x5552('0x24');return db['UserProfileSection'][_0x5552('0x49')]({'where':{'name':_0x35adc1,'userProfileId':_0x5ce3b9[_0x5552('0x4a')]},'raw':!![]})[_0x5552('0x23')](function(_0x4a544a){if(_0x4a544a&&_0x4a544a[_0x5552('0x4b')]===0x0){return db[_0x5552('0x25')]['create']({'name':_0x2025d2['name'],'resourceId':_0x2025d2['id'],'type':_0x4a544a[_0x5552('0x27')],'sectionId':_0x4a544a['id']},{})['then'](function(){return _0x4b06c1;});}else{return _0x4b06c1;}})[_0x5552('0x3e')](function(_0x3683a6){logger['error'](_0x5552('0x4c'),_0x3683a6);throw _0x3683a6;});}return _0x4b06c1;})[_0x5552('0x23')](respondWithResult(_0x1dd489,0xc9))[_0x5552('0x3e')](handleError(_0x1dd489,null));};exports[_0x5552('0x22')]=function(_0x26a181,_0x19df70){if(_0x26a181['body']['id']){delete _0x26a181[_0x5552('0x44')]['id'];}return db[_0x5552('0x3b')][_0x5552('0x49')]({'where':{'id':_0x26a181['params']['id']}})[_0x5552('0x23')](handleEntityNotFound(_0x19df70,null))[_0x5552('0x23')](saveUpdates(_0x26a181[_0x5552('0x44')],null))[_0x5552('0x23')](respondWithResult(_0x19df70,null))['catch'](handleError(_0x19df70,null));};exports[_0x5552('0x4d')]=function(_0xa875cd,_0x7212aa){return db[_0x5552('0x3b')][_0x5552('0x49')]({'where':{'id':_0xa875cd['params']['id']}})['then'](handleEntityNotFound(_0x7212aa,null))['then'](removeEntity(_0x7212aa,null))[_0x5552('0x3e')](handleError(_0x7212aa,null));};exports[_0x5552('0x4e')]=function(_0x2340c9,_0x287531,_0x2f1321){if(_0x2340c9[_0x5552('0x44')]['id']){delete _0x2340c9[_0x5552('0x44')]['id'];}return db[_0x5552('0x3b')][_0x5552('0x49')]({'where':{'id':_0x2340c9[_0x5552('0x40')]['id']}})[_0x5552('0x23')](handleEntityNotFound(_0x287531,null))[_0x5552('0x23')](function(_0x77d38a){if(_0x77d38a){_0x2340c9[_0x5552('0x44')][_0x5552('0x4f')]=_0x77d38a['id'];return db[_0x5552('0x50')]['create'](_0x2340c9[_0x5552('0x44')]);}})[_0x5552('0x23')](respondWithResult(_0x287531,null))[_0x5552('0x3e')](handleError(_0x287531,null));};exports['addAnyCondition']=function(_0x574a78,_0x6f6700,_0xa86364){if(_0x574a78[_0x5552('0x44')]['id']){delete _0x574a78[_0x5552('0x44')]['id'];}return db['Trigger'][_0x5552('0x49')]({'where':{'id':_0x574a78[_0x5552('0x40')]['id']}})[_0x5552('0x23')](handleEntityNotFound(_0x6f6700,null))[_0x5552('0x23')](function(_0x145a82){if(_0x145a82){_0x574a78[_0x5552('0x44')][_0x5552('0x51')]=_0x145a82['id'];return db[_0x5552('0x50')][_0x5552('0x43')](_0x574a78['body']);}})['then'](respondWithResult(_0x6f6700,null))[_0x5552('0x3e')](handleError(_0x6f6700,null));};exports[_0x5552('0x52')]=function(_0xf3d155,_0x54248a,_0x2870e7){var _0x5a616a={};var _0x4da9d0={};var _0x55be42;var _0x119c35;return db['Trigger'][_0x5552('0x53')]({'where':{'id':_0xf3d155['params']['id']}})['then'](handleEntityNotFound(_0x54248a,null))[_0x5552('0x23')](function(_0x233589){if(_0x233589){_0x55be42=_0x233589;_0x4da9d0['model']=_[_0x5552('0x2f')](db[_0x5552('0x50')][_0x5552('0x2a')]);_0x4da9d0[_0x5552('0x2e')]=_['keys'](_0xf3d155[_0x5552('0x2e')]);_0x4da9d0[_0x5552('0x30')]=_[_0x5552('0x32')](_0x4da9d0[_0x5552('0x2d')],_0x4da9d0[_0x5552('0x2e')]);_0x5a616a[_0x5552('0x31')]=_['intersection'](_0x4da9d0[_0x5552('0x2d')],qs['fields'](_0xf3d155[_0x5552('0x2e')][_0x5552('0x33')]));_0x5a616a['attributes']=_0x5a616a['attributes']['length']?_0x5a616a[_0x5552('0x31')]:_0x4da9d0[_0x5552('0x2d')];_0x5a616a[_0x5552('0x34')]=qs['sort'](_0xf3d155[_0x5552('0x2e')][_0x5552('0x35')]);_0x5a616a['where']=qs[_0x5552('0x30')](_['pick'](_0xf3d155[_0x5552('0x2e')],_0x4da9d0[_0x5552('0x30')]));if(_0xf3d155[_0x5552('0x2e')][_0x5552('0x54')]){_0x5a616a[_0x5552('0x36')]=_[_0x5552('0x41')](_0x5a616a[_0x5552('0x36')],{'$or':_[_0x5552('0x29')](_0x5a616a[_0x5552('0x31')],function(_0x302bc9){var _0xbd6f9b={};_0xbd6f9b[_0x302bc9]={'$like':'%'+_0xf3d155[_0x5552('0x2e')]['filter']+'%'};return _0xbd6f9b;})});}_0x5a616a=_[_0x5552('0x41')]({},_0x5a616a,_0xf3d155[_0x5552('0x42')]);return _0x55be42[_0x5552('0x52')](_0x5a616a);}})[_0x5552('0x23')](function(_0x365a1d){if(_0x365a1d){_0x119c35=_0x365a1d['length'];if(!_0xf3d155['query']['hasOwnProperty'](_0x5552('0x55'))){_0x5a616a[_0x5552('0x1d')]=qs[_0x5552('0x1d')](_0xf3d155[_0x5552('0x2e')][_0x5552('0x1d')]);_0x5a616a['offset']=qs[_0x5552('0x1c')](_0xf3d155[_0x5552('0x2e')][_0x5552('0x1c')]);}return _0x55be42[_0x5552('0x52')](_0x5a616a);}})[_0x5552('0x23')](function(_0x1a7e10){if(_0x1a7e10){return _0x1a7e10?{'count':_0x119c35,'rows':_0x1a7e10}:null;}})[_0x5552('0x23')](respondWithResult(_0x54248a,null))[_0x5552('0x3e')](handleError(_0x54248a,null));};exports['getAnyConditions']=function(_0x55802d,_0x3ebcb5,_0x409d36){var _0x3631a2={};var _0x670748={};var _0x3c59e3;var _0x1a3cd1;return db[_0x5552('0x3b')][_0x5552('0x53')]({'where':{'id':_0x55802d[_0x5552('0x40')]['id']}})[_0x5552('0x23')](handleEntityNotFound(_0x3ebcb5,null))[_0x5552('0x23')](function(_0x491119){if(_0x491119){_0x3c59e3=_0x491119;_0x670748[_0x5552('0x2d')]=_[_0x5552('0x2f')](db[_0x5552('0x50')][_0x5552('0x2a')]);_0x670748[_0x5552('0x2e')]=_[_0x5552('0x2f')](_0x55802d[_0x5552('0x2e')]);_0x670748[_0x5552('0x30')]=_[_0x5552('0x32')](_0x670748[_0x5552('0x2d')],_0x670748[_0x5552('0x2e')]);_0x3631a2[_0x5552('0x31')]=_[_0x5552('0x32')](_0x670748[_0x5552('0x2d')],qs[_0x5552('0x33')](_0x55802d[_0x5552('0x2e')][_0x5552('0x33')]));_0x3631a2[_0x5552('0x31')]=_0x3631a2[_0x5552('0x31')][_0x5552('0x56')]?_0x3631a2[_0x5552('0x31')]:_0x670748['model'];_0x3631a2[_0x5552('0x34')]=qs[_0x5552('0x35')](_0x55802d[_0x5552('0x2e')][_0x5552('0x35')]);_0x3631a2[_0x5552('0x36')]=qs[_0x5552('0x30')](_[_0x5552('0x57')](_0x55802d['query'],_0x670748[_0x5552('0x30')]));if(_0x55802d[_0x5552('0x2e')][_0x5552('0x54')]){_0x3631a2[_0x5552('0x36')]=_[_0x5552('0x41')](_0x3631a2[_0x5552('0x36')],{'$or':_[_0x5552('0x29')](_0x3631a2['attributes'],function(_0x16ea81){var _0x3e2663={};_0x3e2663[_0x16ea81]={'$like':'%'+_0x55802d[_0x5552('0x2e')][_0x5552('0x54')]+'%'};return _0x3e2663;})});}_0x3631a2=_[_0x5552('0x41')]({},_0x3631a2,_0x55802d[_0x5552('0x42')]);return _0x3c59e3[_0x5552('0x58')](_0x3631a2);}})[_0x5552('0x23')](function(_0x152418){if(_0x152418){_0x1a3cd1=_0x152418['length'];if(!_0x55802d[_0x5552('0x2e')]['hasOwnProperty'](_0x5552('0x55'))){_0x3631a2['limit']=qs[_0x5552('0x1d')](_0x55802d[_0x5552('0x2e')][_0x5552('0x1d')]);_0x3631a2[_0x5552('0x1c')]=qs[_0x5552('0x1c')](_0x55802d[_0x5552('0x2e')][_0x5552('0x1c')]);}return _0x3c59e3[_0x5552('0x58')](_0x3631a2);}})[_0x5552('0x23')](function(_0x5a9c4e){if(_0x5a9c4e){return _0x5a9c4e?{'count':_0x1a3cd1,'rows':_0x5a9c4e}:null;}})['then'](respondWithResult(_0x3ebcb5,null))['catch'](handleError(_0x3ebcb5,null));};exports[_0x5552('0x59')]=function(_0x3edf27,_0x5b4425,_0x1d607c){if(_0x3edf27[_0x5552('0x44')]['id']){delete _0x3edf27[_0x5552('0x44')]['id'];}return db[_0x5552('0x3b')][_0x5552('0x49')]({'where':{'id':_0x3edf27[_0x5552('0x40')]['id']}})[_0x5552('0x23')](handleEntityNotFound(_0x5b4425,null))['then'](function(_0x3b50ea){if(_0x3b50ea){_0x3edf27[_0x5552('0x44')][_0x5552('0x5a')]=_0x3b50ea['id'];return db[_0x5552('0x5b')][_0x5552('0x43')](_0x3edf27[_0x5552('0x44')]);}})['then'](respondWithResult(_0x5b4425,null))['catch'](handleError(_0x5b4425,null));};exports[_0x5552('0x5c')]=function(_0xcfb3c2,_0x1cb034,_0x1a9e3c){var _0x317075={};var _0x1f1e64={};var _0x524d24;var _0x20bdfa;return db[_0x5552('0x3b')][_0x5552('0x53')]({'where':{'id':_0xcfb3c2['params']['id']}})['then'](handleEntityNotFound(_0x1cb034,null))[_0x5552('0x23')](function(_0x529a98){if(_0x529a98){_0x524d24=_0x529a98;_0x1f1e64[_0x5552('0x2d')]=_[_0x5552('0x2f')](db[_0x5552('0x5b')]['rawAttributes']);_0x1f1e64[_0x5552('0x2e')]=_[_0x5552('0x2f')](_0xcfb3c2[_0x5552('0x2e')]);_0x1f1e64[_0x5552('0x30')]=_[_0x5552('0x32')](_0x1f1e64[_0x5552('0x2d')],_0x1f1e64[_0x5552('0x2e')]);_0x317075[_0x5552('0x31')]=_[_0x5552('0x32')](_0x1f1e64['model'],qs[_0x5552('0x33')](_0xcfb3c2[_0x5552('0x2e')]['fields']));_0x317075[_0x5552('0x31')]=_0x317075[_0x5552('0x31')]['length']?_0x317075[_0x5552('0x31')]:_0x1f1e64[_0x5552('0x2d')];_0x317075['order']=qs[_0x5552('0x35')](_0xcfb3c2[_0x5552('0x2e')][_0x5552('0x35')]);_0x317075[_0x5552('0x36')]=qs[_0x5552('0x30')](_[_0x5552('0x57')](_0xcfb3c2[_0x5552('0x2e')],_0x1f1e64[_0x5552('0x30')]));if(_0xcfb3c2[_0x5552('0x2e')][_0x5552('0x54')]){_0x317075['where']=_[_0x5552('0x41')](_0x317075[_0x5552('0x36')],{'$or':_[_0x5552('0x29')](_0x317075['attributes'],function(_0xf32099){var _0xf8e6b6={};_0xf8e6b6[_0xf32099]={'$like':'%'+_0xcfb3c2[_0x5552('0x2e')][_0x5552('0x54')]+'%'};return _0xf8e6b6;})});}_0x317075=_['merge']({},_0x317075,_0xcfb3c2[_0x5552('0x42')]);return _0x524d24[_0x5552('0x5c')](_0x317075);}})[_0x5552('0x23')](function(_0x50fd87){if(_0x50fd87){_0x20bdfa=_0x50fd87[_0x5552('0x56')];if(!_0xcfb3c2[_0x5552('0x2e')][_0x5552('0x5d')](_0x5552('0x55'))){_0x317075[_0x5552('0x1d')]=qs[_0x5552('0x1d')](_0xcfb3c2[_0x5552('0x2e')][_0x5552('0x1d')]);_0x317075['offset']=qs[_0x5552('0x1c')](_0xcfb3c2[_0x5552('0x2e')]['offset']);}return _0x524d24[_0x5552('0x5c')](_0x317075);}})[_0x5552('0x23')](function(_0x3478a3){if(_0x3478a3){return _0x3478a3?{'count':_0x20bdfa,'rows':_0x3478a3}:null;}})[_0x5552('0x23')](respondWithResult(_0x1cb034,null))[_0x5552('0x3e')](handleError(_0x1cb034,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 2455519..2655d62 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 _0x1fdc=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','api','moment'];(function(_0x2808ee,_0x4bd9bb){var _0x4a6eb8=function(_0x8e36e8){while(--_0x8e36e8){_0x2808ee['push'](_0x2808ee['shift']());}};_0x4a6eb8(++_0x4bd9bb);}(_0x1fdc,0x8b));var _0xc1fd=function(_0x12b8ec,_0x1655be){_0x12b8ec=_0x12b8ec-0x0;var _0x21af77=_0x1fdc[_0x12b8ec];return _0x21af77;};'use strict';var _=require(_0xc1fd('0x0'));var util=require(_0xc1fd('0x1'));var logger=require('../../config/logger')(_0xc1fd('0x2'));var moment=require(_0xc1fd('0x3'));var BPromise=require(_0xc1fd('0x4'));var rp=require(_0xc1fd('0x5'));var fs=require('fs');var path=require(_0xc1fd('0x6'));var rimraf=require(_0xc1fd('0x7'));var config=require(_0xc1fd('0x8'));var attributes=require('./trigger.attributes');module[_0xc1fd('0x9')]=function(_0x141dab,_0x43cd02){return _0x141dab[_0xc1fd('0xa')](_0xc1fd('0xb'),attributes,{'tableName':_0xc1fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd691=['exports','tools_triggers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x3df12f,_0xe54256){var _0x49a2db=function(_0x3b7bb8){while(--_0x3b7bb8){_0x3df12f['push'](_0x3df12f['shift']());}};_0x49a2db(++_0xe54256);}(_0xd691,0xe6));var _0x1d69=function(_0x5ea82f,_0x41ef96){_0x5ea82f=_0x5ea82f-0x0;var _0x2f38b6=_0xd691[_0x5ea82f];return _0x2f38b6;};'use strict';var _=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var logger=require(_0x1d69('0x2'))('api');var moment=require(_0x1d69('0x3'));var BPromise=require(_0x1d69('0x4'));var rp=require(_0x1d69('0x5'));var fs=require('fs');var path=require(_0x1d69('0x6'));var rimraf=require(_0x1d69('0x7'));var config=require(_0x1d69('0x8'));var attributes=require(_0x1d69('0x9'));module[_0x1d69('0xa')]=function(_0xdbf1f2,_0x3b36f5){return _0xdbf1f2['define']('Trigger',attributes,{'tableName':_0x1d69('0xb'),'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 da93668..8a436f8 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 _0x9e01=['lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetTrigger','Trigger','findAll','options','raw','attributes','include','map','model','then','debug','ShowTrigger','find','where','catch'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9e01,0x7c));var _0x19e0=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x9e01[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x19e0('0x0'));var util=require(_0x19e0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x19e0('0x2'));var fs=require('fs');var Redis=require(_0x19e0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x19e0('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x19e0('0x5'));var jayson=require(_0x19e0('0x6'));var client=jayson[_0x19e0('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x447820,_0x36eb70,_0x30efbc){return new BPromise(function(_0x5c1ddc,_0xe69aba){return client['request'](_0x447820,_0x30efbc)['then'](function(_0x4f2bb2){logger[_0x19e0('0x8')](_0x19e0('0x9'),_0x36eb70,_0x19e0('0xa'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x36eb70,_0x19e0('0xa'),JSON[_0x19e0('0xb')](_0x4f2bb2));if(_0x4f2bb2[_0x19e0('0xc')]){if(_0x4f2bb2[_0x19e0('0xc')][_0x19e0('0xd')]===0x1f4){logger['error'](_0x19e0('0x9'),_0x36eb70,_0x4f2bb2[_0x19e0('0xc')][_0x19e0('0xe')]);return _0xe69aba(_0x4f2bb2[_0x19e0('0xc')][_0x19e0('0xe')]);}logger['error'](_0x19e0('0x9'),_0x36eb70,_0x4f2bb2[_0x19e0('0xc')]['message']);return _0x5c1ddc(_0x4f2bb2[_0x19e0('0xc')][_0x19e0('0xe')]);}else{logger[_0x19e0('0x8')](_0x19e0('0x9'),_0x36eb70,'request\x20sent');_0x5c1ddc(_0x4f2bb2[_0x19e0('0xf')][_0x19e0('0xe')]);}})['catch'](function(_0xa027e5){logger[_0x19e0('0xc')]('Trigger,\x20%s,\x20%s',_0x36eb70,_0xa027e5);_0xe69aba(_0xa027e5);});});}exports[_0x19e0('0x10')]=function(_0x2c820a){var _0x5a998a=this;return new Promise(function(_0xe6545c,_0x3d381e){return db[_0x19e0('0x11')][_0x19e0('0x12')]({'raw':_0x2c820a[_0x19e0('0x13')]?_0x2c820a[_0x19e0('0x13')][_0x19e0('0x14')]===undefined?!![]:![]:!![],'where':_0x2c820a[_0x19e0('0x13')]?_0x2c820a['options']['where']||null:null,'attributes':_0x2c820a['options']?_0x2c820a[_0x19e0('0x13')][_0x19e0('0x15')]||null:null,'limit':_0x2c820a[_0x19e0('0x13')]?_0x2c820a['options']['limit']||null:null,'include':_0x2c820a['options']?_0x2c820a[_0x19e0('0x13')][_0x19e0('0x16')]?_[_0x19e0('0x17')](_0x2c820a['options'][_0x19e0('0x16')],function(_0x20f7f7){return{'model':db[_0x20f7f7[_0x19e0('0x18')]],'as':_0x20f7f7['as'],'attributes':_0x20f7f7[_0x19e0('0x15')],'include':_0x20f7f7[_0x19e0('0x16')]?_[_0x19e0('0x17')](_0x20f7f7[_0x19e0('0x16')],function(_0x5a4928){return{'model':db[_0x5a4928['model']],'as':_0x5a4928['as'],'attributes':_0x5a4928[_0x19e0('0x15')],'include':_0x5a4928[_0x19e0('0x16')]?_[_0x19e0('0x17')](_0x5a4928['include'],function(_0x51708b){return{'model':db[_0x51708b[_0x19e0('0x18')]],'as':_0x51708b['as'],'attributes':_0x51708b[_0x19e0('0x15')]};}):[]};}):[]};}):[]:[]})[_0x19e0('0x19')](function(_0x304bde){logger[_0x19e0('0x8')]('GetTrigger',_0x2c820a);logger[_0x19e0('0x1a')]('GetTrigger',_0x2c820a,JSON[_0x19e0('0xb')](_0x304bde));_0xe6545c(_0x304bde);})['catch'](function(_0x2043b2){logger[_0x19e0('0xc')](_0x19e0('0x10'),_0x2043b2[_0x19e0('0xe')],_0x2c820a);_0x3d381e(_0x5a998a['error'](0x1f4,_0x2043b2[_0x19e0('0xe')]));});});};exports[_0x19e0('0x1b')]=function(_0x5571ac){var _0x4b7f89=this;return new Promise(function(_0x55cb95,_0x2eac81){return db[_0x19e0('0x11')][_0x19e0('0x1c')]({'raw':_0x5571ac[_0x19e0('0x13')]?_0x5571ac[_0x19e0('0x13')][_0x19e0('0x14')]===undefined?!![]:![]:!![],'where':_0x5571ac[_0x19e0('0x13')]?_0x5571ac[_0x19e0('0x13')][_0x19e0('0x1d')]||null:null,'attributes':_0x5571ac[_0x19e0('0x13')]?_0x5571ac[_0x19e0('0x13')][_0x19e0('0x15')]||null:null,'include':_0x5571ac[_0x19e0('0x13')]?_0x5571ac[_0x19e0('0x13')]['include']?_[_0x19e0('0x17')](_0x5571ac['options'][_0x19e0('0x16')],function(_0x2c5b9b){return{'model':db[_0x2c5b9b[_0x19e0('0x18')]],'as':_0x2c5b9b['as'],'attributes':_0x2c5b9b['attributes'],'include':_0x2c5b9b['include']?_[_0x19e0('0x17')](_0x2c5b9b[_0x19e0('0x16')],function(_0x1f1b77){return{'model':db[_0x1f1b77['model']],'as':_0x1f1b77['as'],'attributes':_0x1f1b77[_0x19e0('0x15')],'include':_0x1f1b77[_0x19e0('0x16')]?_[_0x19e0('0x17')](_0x1f1b77[_0x19e0('0x16')],function(_0x489721){return{'model':db[_0x489721[_0x19e0('0x18')]],'as':_0x489721['as'],'attributes':_0x489721[_0x19e0('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x220b81){logger[_0x19e0('0x8')](_0x19e0('0x1b'),_0x5571ac);logger['debug'](_0x19e0('0x1b'),_0x5571ac,JSON[_0x19e0('0xb')](_0x220b81));_0x55cb95(_0x220b81);})[_0x19e0('0x1e')](function(_0x9ade08){logger[_0x19e0('0xc')](_0x19e0('0x1b'),_0x9ade08['message'],_0x5571ac);_0x2eac81(_0x4b7f89[_0x19e0('0xc')](0x1f4,_0x9ade08[_0x19e0('0xe')]));});});}; \ No newline at end of file +var _0x826c=['jayson/promise','http','request','then','info','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Trigger','options','where','attributes','limit','include','model','map','GetTrigger','ShowTrigger','find','debug','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x119b3e,_0x588d50){var _0x1169ae=function(_0x377422){while(--_0x377422){_0x119b3e['push'](_0x119b3e['shift']());}};_0x1169ae(++_0x588d50);}(_0x826c,0x1ca));var _0xc826=function(_0x17fb10,_0x4cd9e9){_0x17fb10=_0x17fb10-0x0;var _0x54d75b=_0x826c[_0x17fb10];return _0x54d75b;};'use strict';var _=require(_0xc826('0x0'));var util=require(_0xc826('0x1'));var moment=require('moment');var BPromise=require(_0xc826('0x2'));var rs=require(_0xc826('0x3'));var fs=require('fs');var Redis=require(_0xc826('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc826('0x5'))('rpc');var config=require(_0xc826('0x6'));var jayson=require(_0xc826('0x7'));var client=jayson['client'][_0xc826('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e6f3e,_0x41a8f5,_0x2eff57){return new BPromise(function(_0x19dc22,_0x4a969a){return client[_0xc826('0x9')](_0x5e6f3e,_0x2eff57)[_0xc826('0xa')](function(_0x400805){logger[_0xc826('0xb')](_0xc826('0xc'),_0x41a8f5,'request\x20sent');logger['debug'](_0xc826('0xd'),_0x41a8f5,'request\x20sent',JSON[_0xc826('0xe')](_0x400805));if(_0x400805[_0xc826('0xf')]){if(_0x400805[_0xc826('0xf')]['code']===0x1f4){logger[_0xc826('0xf')](_0xc826('0xc'),_0x41a8f5,_0x400805[_0xc826('0xf')]['message']);return _0x4a969a(_0x400805[_0xc826('0xf')][_0xc826('0x10')]);}logger[_0xc826('0xf')](_0xc826('0xc'),_0x41a8f5,_0x400805[_0xc826('0xf')]['message']);return _0x19dc22(_0x400805[_0xc826('0xf')][_0xc826('0x10')]);}else{logger[_0xc826('0xb')](_0xc826('0xc'),_0x41a8f5,'request\x20sent');_0x19dc22(_0x400805[_0xc826('0x11')]['message']);}})[_0xc826('0x12')](function(_0x42cc74){logger[_0xc826('0xf')](_0xc826('0xc'),_0x41a8f5,_0x42cc74);_0x4a969a(_0x42cc74);});});}exports['GetTrigger']=function(_0x3a16df){var _0x16f8dc=this;return new Promise(function(_0x101273,_0xb25799){return db[_0xc826('0x13')]['findAll']({'raw':_0x3a16df['options']?_0x3a16df['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a16df[_0xc826('0x14')]?_0x3a16df[_0xc826('0x14')][_0xc826('0x15')]||null:null,'attributes':_0x3a16df['options']?_0x3a16df[_0xc826('0x14')][_0xc826('0x16')]||null:null,'limit':_0x3a16df['options']?_0x3a16df[_0xc826('0x14')][_0xc826('0x17')]||null:null,'include':_0x3a16df[_0xc826('0x14')]?_0x3a16df[_0xc826('0x14')][_0xc826('0x18')]?_['map'](_0x3a16df[_0xc826('0x14')][_0xc826('0x18')],function(_0x2a41a9){return{'model':db[_0x2a41a9[_0xc826('0x19')]],'as':_0x2a41a9['as'],'attributes':_0x2a41a9[_0xc826('0x16')],'include':_0x2a41a9[_0xc826('0x18')]?_[_0xc826('0x1a')](_0x2a41a9[_0xc826('0x18')],function(_0x5179f3){return{'model':db[_0x5179f3[_0xc826('0x19')]],'as':_0x5179f3['as'],'attributes':_0x5179f3[_0xc826('0x16')],'include':_0x5179f3[_0xc826('0x18')]?_[_0xc826('0x1a')](_0x5179f3['include'],function(_0x7ad6d0){return{'model':db[_0x7ad6d0['model']],'as':_0x7ad6d0['as'],'attributes':_0x7ad6d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xc826('0xa')](function(_0x5c1d4b){logger['info'](_0xc826('0x1b'),_0x3a16df);logger['debug'](_0xc826('0x1b'),_0x3a16df,JSON[_0xc826('0xe')](_0x5c1d4b));_0x101273(_0x5c1d4b);})[_0xc826('0x12')](function(_0x4cdebf){logger[_0xc826('0xf')](_0xc826('0x1b'),_0x4cdebf[_0xc826('0x10')],_0x3a16df);_0xb25799(_0x16f8dc[_0xc826('0xf')](0x1f4,_0x4cdebf[_0xc826('0x10')]));});});};exports[_0xc826('0x1c')]=function(_0x289e7e){var _0x34f327=this;return new Promise(function(_0x1c4582,_0x2a9370){return db[_0xc826('0x13')][_0xc826('0x1d')]({'raw':_0x289e7e[_0xc826('0x14')]?_0x289e7e[_0xc826('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x289e7e['options']?_0x289e7e[_0xc826('0x14')][_0xc826('0x15')]||null:null,'attributes':_0x289e7e[_0xc826('0x14')]?_0x289e7e['options'][_0xc826('0x16')]||null:null,'include':_0x289e7e['options']?_0x289e7e[_0xc826('0x14')][_0xc826('0x18')]?_[_0xc826('0x1a')](_0x289e7e[_0xc826('0x14')][_0xc826('0x18')],function(_0x17791c){return{'model':db[_0x17791c[_0xc826('0x19')]],'as':_0x17791c['as'],'attributes':_0x17791c[_0xc826('0x16')],'include':_0x17791c[_0xc826('0x18')]?_['map'](_0x17791c['include'],function(_0x717464){return{'model':db[_0x717464[_0xc826('0x19')]],'as':_0x717464['as'],'attributes':_0x717464[_0xc826('0x16')],'include':_0x717464[_0xc826('0x18')]?_[_0xc826('0x1a')](_0x717464[_0xc826('0x18')],function(_0x540fd6){return{'model':db[_0x540fd6['model']],'as':_0x540fd6['as'],'attributes':_0x540fd6[_0xc826('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x542f84){logger['info'](_0xc826('0x1c'),_0x289e7e);logger[_0xc826('0x1e')](_0xc826('0x1c'),_0x289e7e,JSON[_0xc826('0xe')](_0x542f84));_0x1c4582(_0x542f84);})[_0xc826('0x12')](function(_0x538123){logger[_0xc826('0xf')]('ShowTrigger',_0x538123['message'],_0x289e7e);_0x2a9370(_0x34f327[_0xc826('0xf')](0x1f4,_0x538123['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index b999fed..0d50f1f 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 _0x1fea=['./trunk.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x335395,_0x5a5706){var _0x5774a3=function(_0x473620){while(--_0x473620){_0x335395['push'](_0x335395['shift']());}};_0x5774a3(++_0x5a5706);}(_0x1fea,0xde));var _0xa1fe=function(_0x1d3236,_0x309f10){_0x1d3236=_0x1d3236-0x0;var _0x18459e=_0x1fea[_0x1d3236];return _0x18459e;};'use strict';var multer=require(_0xa1fe('0x0'));var util=require(_0xa1fe('0x1'));var path=require(_0xa1fe('0x2'));var timeout=require(_0xa1fe('0x3'));var express=require(_0xa1fe('0x4'));var router=express[_0xa1fe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa1fe('0x6'));var interaction=require(_0xa1fe('0x7'));var config=require(_0xa1fe('0x8'));var controller=require(_0xa1fe('0x9'));router[_0xa1fe('0xa')]('/',auth[_0xa1fe('0xb')](),controller[_0xa1fe('0xc')]);router[_0xa1fe('0xa')](_0xa1fe('0xd'),auth[_0xa1fe('0xb')](),controller[_0xa1fe('0xe')]);router['post']('/:id/clone',auth[_0xa1fe('0xb')](),controller['clone']);router['post']('/',auth[_0xa1fe('0xb')](),controller[_0xa1fe('0xf')]);router[_0xa1fe('0x10')](_0xa1fe('0xd'),auth[_0xa1fe('0xb')](),controller[_0xa1fe('0x11')]);router[_0xa1fe('0x12')](_0xa1fe('0xd'),auth['isAuthenticated'](),controller[_0xa1fe('0x13')]);module[_0xa1fe('0x14')]=router; \ No newline at end of file +var _0x4d92=['destroy','exports','multer','util','path','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','show','post','/:id/clone','create','put','update'];(function(_0xd0c837,_0x99ac23){var _0x5a55d6=function(_0x630d40){while(--_0x630d40){_0xd0c837['push'](_0xd0c837['shift']());}};_0x5a55d6(++_0x99ac23);}(_0x4d92,0x146));var _0x24d9=function(_0x4052c0,_0x4271ab){_0x4052c0=_0x4052c0-0x0;var _0x296f04=_0x4d92[_0x4052c0];return _0x296f04;};'use strict';var multer=require(_0x24d9('0x0'));var util=require(_0x24d9('0x1'));var path=require(_0x24d9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x24d9('0x3'));var config=require(_0x24d9('0x4'));var controller=require(_0x24d9('0x5'));router['get']('/',auth[_0x24d9('0x6')](),controller[_0x24d9('0x7')]);router[_0x24d9('0x8')](_0x24d9('0x9'),auth[_0x24d9('0x6')](),controller[_0x24d9('0xa')]);router[_0x24d9('0xb')](_0x24d9('0xc'),auth[_0x24d9('0x6')](),controller['clone']);router[_0x24d9('0xb')]('/',auth[_0x24d9('0x6')](),controller[_0x24d9('0xd')]);router[_0x24d9('0xe')](_0x24d9('0x9'),auth[_0x24d9('0x6')](),controller[_0x24d9('0xf')]);router['delete'](_0x24d9('0x9'),auth[_0x24d9('0x6')](),controller[_0x24d9('0x10')]);module[_0x24d9('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index eb7ac0f..3e7c6e7 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 _0x0f27=['fingerprint','certificate','active','passive','actpass','dynamic','nonat','update','update,nonat','BOOLEAN','exports','STRING','name','friend','user','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0x0f27,0xde));var _0x70f2=function(_0x4a4d8e,_0x22a7a9){_0x4a4d8e=_0x4a4d8e-0x0;var _0x1a5cb4=_0x0f27[_0x4a4d8e];return _0x1a5cb4;};'use strict';var Sequelize=require('sequelize');module[_0x70f2('0x0')]={'name':{'type':Sequelize[_0x70f2('0x1')],'allowNull':![],'unique':_0x70f2('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x70f2('0x3'),_0x70f2('0x4'),'peer'),'allowNull':![],'defaultValue':_0x70f2('0x3')},'context':{'type':Sequelize[_0x70f2('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x6'),'ALLOWED_PASSED_SCREEN',_0x70f2('0x7'),'ALLOWED',_0x70f2('0x8'),_0x70f2('0x9'),_0x70f2('0xa'),_0x70f2('0xb'))},'deny':{'type':Sequelize[_0x70f2('0x1')]},'permit':{'type':Sequelize[_0x70f2('0x1')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':_0x70f2('0xc'),'set':function(_0x4f7599){this[_0x70f2('0xd')]('transport',_0x4f7599?_0x4f7599[_0x70f2('0xe')](','):null);},'get':function(){return this[_0x70f2('0xf')](_0x70f2('0x10'))?this[_0x70f2('0xf')]('transport')['split'](','):null;},'comment':_0x70f2('0x11')},'dtmfmode':{'type':Sequelize[_0x70f2('0x5')]('rfc2833',_0x70f2('0x12'),_0x70f2('0x13'),_0x70f2('0x14'),'auto'),'defaultValue':_0x70f2('0x15')},'directmedia':{'type':Sequelize['ENUM']('yes','no','nonat','update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x70f2('0x1')]},'directmediadeny':{'type':Sequelize[_0x70f2('0x1')]},'nat':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x3555b0){this['setDataValue'](_0x70f2('0x17'),_0x3555b0?_0x3555b0[_0x70f2('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x70f2('0x17'))?this[_0x70f2('0xf')](_0x70f2('0x17'))[_0x70f2('0x18')](','):null;},'comment':_0x70f2('0x19')},'callgroup':{'type':Sequelize[_0x70f2('0x1')]},'namedcallgroup':{'type':Sequelize[_0x70f2('0x1')]},'pickupgroup':{'type':Sequelize[_0x70f2('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x70f2('0x1')]},'language':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':_0x70f2('0x1a')},'allow':{'type':Sequelize[_0x70f2('0x1')],'allowNull':![],'defaultValue':_0x70f2('0x1b'),'set':function(_0x52cdfa){this[_0x70f2('0xd')](_0x70f2('0x1c'),_0x52cdfa?_0x52cdfa['join'](';'):_0x70f2('0x1b'));},'get':function(){return this['getDataValue'](_0x70f2('0x1c'))?this[_0x70f2('0xf')](_0x70f2('0x1c'))[_0x70f2('0x18')](';'):null;},'comment':_0x70f2('0x1d')},'autoframing':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'insecure':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':_0x70f2('0x1e'),'set':function(_0xb2d1e9){this[_0x70f2('0xd')]('insecure',_0xb2d1e9?_0xb2d1e9[_0x70f2('0xe')](','):null);},'get':function(){return this[_0x70f2('0xf')](_0x70f2('0x1f'))?this[_0x70f2('0xf')](_0x70f2('0x1f'))['split'](','):null;},'comment':_0x70f2('0x20')},'trustrpid':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x21'))},'promiscredir':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'accountcode':{'type':Sequelize[_0x70f2('0x22')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':_0x70f2('0x23')},'amaflags':{'type':Sequelize[_0x70f2('0x1')]},'callcounter':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':_0x70f2('0x16')},'busylevel':{'type':Sequelize[_0x70f2('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'allowsubscribe':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'allowtransfer':{'type':Sequelize[_0x70f2('0x5')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x70f2('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x70f2('0x1')]},'template':{'type':Sequelize[_0x70f2('0x1')]},'videosupport':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x70f2('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'mailbox':{'type':Sequelize[_0x70f2('0x1')]},'session_timers':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x25'),_0x70f2('0x26'),_0x70f2('0x27'))},'session_expires':{'type':Sequelize[_0x70f2('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x70f2('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x28'),_0x70f2('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x70f2('0x1')]},'regexten':{'type':Sequelize[_0x70f2('0x1')]},'fromdomain':{'type':Sequelize[_0x70f2('0x1')]},'fromuser':{'type':Sequelize[_0x70f2('0x1')]},'port':{'type':Sequelize[_0x70f2('0x22')](0x5)},'qualify':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no'),'defaultValue':_0x70f2('0x16')},'keepalive':{'type':Sequelize[_0x70f2('0x22')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x70f2('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x70f2('0x1')]},'callbackextension':{'type':Sequelize[_0x70f2('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x70f2('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x70f2('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x70f2('0x1')]},'maxforwards':{'type':Sequelize[_0x70f2('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x70f2('0x16'),'no')},'force_avp':{'type':Sequelize[_0x70f2('0x5')]('yes','no')},'icesupport':{'type':Sequelize[_0x70f2('0x5')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x70f2('0x5')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x2b'),_0x70f2('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x70f2('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x70f2('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x70f2('0x1')]},'dtlscafile':{'type':Sequelize[_0x70f2('0x1')]},'dtlscapath':{'type':Sequelize[_0x70f2('0x1')]},'dtlssetup':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x2d'),_0x70f2('0x2e'),_0x70f2('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0x70f2('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x70f2('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'subscribemwi':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no')},'vmexten':{'type':Sequelize[_0x70f2('0x1')]},'mohinterpret':{'type':Sequelize[_0x70f2('0x1')]},'mohsuggest':{'type':Sequelize[_0x70f2('0x1')]},'parkinglot':{'type':Sequelize[_0x70f2('0x1')]},'description':{'type':Sequelize[_0x70f2('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x70f2('0x30')},'canreinvite':{'type':Sequelize[_0x70f2('0x5')](_0x70f2('0x16'),'no',_0x70f2('0x31'),_0x70f2('0x32'),_0x70f2('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x70f2('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x70f2('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x70f2('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0xb444=['exports','STRING','name','ENUM','friend','user','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','transport','join','getDataValue','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','accept','refuse','originate','uac','uas','pai','fingerprint','dynamic','update,nonat','BOOLEAN','sequelize'];(function(_0x130813,_0x3fbc67){var _0x42d8f5=function(_0x36ed25){while(--_0x36ed25){_0x130813['push'](_0x130813['shift']());}};_0x42d8f5(++_0x3fbc67);}(_0xb444,0x19d));var _0x4b44=function(_0x52a139,_0x4225f4){_0x52a139=_0x52a139-0x0;var _0x4ce1ef=_0xb444[_0x52a139];return _0x4ce1ef;};'use strict';var Sequelize=require(_0x4b44('0x0'));module[_0x4b44('0x1')]={'name':{'type':Sequelize[_0x4b44('0x2')],'allowNull':![],'unique':_0x4b44('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x5'),_0x4b44('0x6'),'peer'),'allowNull':![],'defaultValue':_0x4b44('0x5')},'context':{'type':Sequelize[_0x4b44('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x7'),_0x4b44('0x8'),'ALLOWED_FAILED_SCREEN',_0x4b44('0x9'),_0x4b44('0xa'),_0x4b44('0xb'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x4b44('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x4b44('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x4b44('0x2')]},'transport':{'type':Sequelize[_0x4b44('0x2')],'defaultValue':_0x4b44('0xc'),'set':function(_0x398463){this['setDataValue'](_0x4b44('0xd'),_0x398463?_0x398463[_0x4b44('0xe')](','):null);},'get':function(){return this[_0x4b44('0xf')]('transport')?this[_0x4b44('0xf')](_0x4b44('0xd'))[_0x4b44('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x4b44('0x11'),_0x4b44('0x12'),_0x4b44('0x13'),_0x4b44('0x14'),_0x4b44('0x15')),'defaultValue':_0x4b44('0x11')},'directmedia':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no',_0x4b44('0x17'),_0x4b44('0x18'),_0x4b44('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4b44('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x4b44('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0xcb9561){this[_0x4b44('0x1a')](_0x4b44('0x1b'),_0xcb9561?_0xcb9561[_0x4b44('0xe')](','):null);},'get':function(){return this[_0x4b44('0xf')](_0x4b44('0x1b'))?this[_0x4b44('0xf')]('nat')[_0x4b44('0x10')](','):null;},'comment':_0x4b44('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x4b44('0x2')]},'pickupgroup':{'type':Sequelize[_0x4b44('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4b44('0x2')]},'language':{'type':Sequelize[_0x4b44('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4b44('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4b44('0x2')],'defaultValue':_0x4b44('0x1d')},'allow':{'type':Sequelize[_0x4b44('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x4ab192){this['setDataValue'](_0x4b44('0x1e'),_0x4ab192?_0x4ab192[_0x4b44('0xe')](';'):_0x4b44('0x1f'));},'get':function(){return this['getDataValue']('allow')?this[_0x4b44('0xf')](_0x4b44('0x1e'))[_0x4b44('0x10')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x4b44('0x4')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x299716){this[_0x4b44('0x1a')](_0x4b44('0x20'),_0x299716?_0x299716[_0x4b44('0xe')](','):null);},'get':function(){return this[_0x4b44('0xf')](_0x4b44('0x20'))?this['getDataValue'](_0x4b44('0x20'))[_0x4b44('0x10')](','):null;},'comment':_0x4b44('0x21')},'trustrpid':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4b44('0x4')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no',_0x4b44('0x22'))},'promiscredir':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no')},'useclientcode':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no')},'accountcode':{'type':Sequelize[_0x4b44('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x4b44('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no'),'defaultValue':_0x4b44('0x16')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x4b44('0x16'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no')},'subscribecontext':{'type':Sequelize[_0x4b44('0x2')]},'template':{'type':Sequelize[_0x4b44('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x4b44('0x16'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4b44('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x24'),_0x4b44('0x25'),_0x4b44('0x26'))},'session_expires':{'type':Sequelize[_0x4b44('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x4b44('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x27'),_0x4b44('0x28')),'defaultValue':_0x4b44('0x28')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x4b44('0x2')]},'fromdomain':{'type':Sequelize[_0x4b44('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4b44('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x4b44('0x16'),'no'),'defaultValue':_0x4b44('0x16')},'keepalive':{'type':Sequelize[_0x4b44('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x4b44('0x2')]},'defaultuser':{'type':Sequelize[_0x4b44('0x2')]},'rtptimeout':{'type':Sequelize[_0x4b44('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x4b44('0x4')]('yes','no',_0x4b44('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4b44('0x2')]},'callbackextension':{'type':Sequelize[_0x4b44('0x2')]},'timert1':{'type':Sequelize[_0x4b44('0x23')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x4b44('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x4b44('0x2')]},'contactdeny':{'type':Sequelize[_0x4b44('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x4b44('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x4b44('0x16'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x4b44('0x16'),'no')},'force_avp':{'type':Sequelize['ENUM']('yes','no')},'icesupport':{'type':Sequelize[_0x4b44('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x4b44('0x4')]('yes','no',_0x4b44('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x4b44('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4b44('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x4b44('0x2')]},'dtlscipher':{'type':Sequelize[_0x4b44('0x2')]},'dtlscafile':{'type':Sequelize[_0x4b44('0x2')]},'dtlscapath':{'type':Sequelize[_0x4b44('0x2')]},'dtlssetup':{'type':Sequelize[_0x4b44('0x4')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4b44('0x2')]},'recordofffeature':{'type':Sequelize[_0x4b44('0x2')]},'call_limit':{'type':Sequelize[_0x4b44('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4b44('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no')},'vmexten':{'type':Sequelize[_0x4b44('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x4b44('0x2')]},'parkinglot':{'type':Sequelize[_0x4b44('0x2')]},'description':{'type':Sequelize[_0x4b44('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x4b44('0x2b')},'canreinvite':{'type':Sequelize[_0x4b44('0x4')](_0x4b44('0x16'),'no',_0x4b44('0x17'),'update',_0x4b44('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x4b44('0x2')]},'active':{'type':Sequelize[_0x4b44('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 065e3b8..326e061 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 _0x98a8=['../../mysqldb','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','map','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trunk','include','show','params','keys','rawAttributes','includeAll','clone','find','createdAt','updatedAt','body','omit','create','user','role','UserProfileSection','userProfileId','autoAssociation','findAll','readFileSync','root','server/files/templates/trunk.ejs','join','server/files/templates/registry.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x1e7fbd,_0x394862){var _0xf289eb=function(_0x5ec249){while(--_0x5ec249){_0x1e7fbd['push'](_0x1e7fbd['shift']());}};_0xf289eb(++_0x394862);}(_0x98a8,0x12c));var _0x898a=function(_0x587b7d,_0x2e2431){_0x587b7d=_0x587b7d-0x0;var _0xd5f7f8=_0x98a8[_0x587b7d];return _0xd5f7f8;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];var jayson=require(_0x898a('0x19'));var client=jayson[_0x898a('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5bfded,_0x5b5c9c,_0x373d53,_0x1f5be4){return new BPromise(function(_0xb24335,_0x116fbe){var _0x1873e9=_0x1f5be4||client;return _0x1873e9[_0x898a('0x1b')](_0x5bfded,_0x373d53)['then'](function(_0x47033c){logger['info'](_0x898a('0x1c'),_0x5b5c9c,'request\x20sent');logger[_0x898a('0x1d')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5b5c9c,_0x898a('0x1e'),JSON['stringify'](_0x47033c));if(_0x47033c[_0x898a('0x1f')]){if(_0x47033c[_0x898a('0x1f')][_0x898a('0x20')]===0x1f4){logger['error'](_0x898a('0x1c'),_0x5b5c9c,_0x47033c['error']['message']);return _0x116fbe(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x5b5c9c,_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);return _0xb24335(_0x47033c[_0x898a('0x1f')][_0x898a('0x21')]);}else{logger[_0x898a('0x22')](_0x898a('0x1c'),_0x5b5c9c,_0x898a('0x1e'));_0xb24335(_0x47033c['result'][_0x898a('0x21')]);}})[_0x898a('0x23')](function(_0x11cae2){logger[_0x898a('0x1f')](_0x898a('0x1c'),_0x5b5c9c,_0x11cae2);_0x116fbe(_0x11cae2);});});}function respondWithStatusCode(_0x310bfa,_0x4e254d){_0x4e254d=_0x4e254d||0xcc;return function(_0x274cdf){if(_0x274cdf){return _0x310bfa[_0x898a('0x24')](_0x4e254d);}return _0x310bfa[_0x898a('0x25')](_0x4e254d)[_0x898a('0x26')]();};}function respondWithResult(_0x3901ab,_0x1426e3){_0x1426e3=_0x1426e3||0xc8;return function(_0x5b7719){if(_0x5b7719){return _0x3901ab[_0x898a('0x25')](_0x1426e3)['json'](_0x5b7719);}};}function respondWithFilteredResult(_0x513c6b,_0x53ddb2){return function(_0x3678be){if(_0x3678be){var _0x1f4d86=typeof _0x53ddb2[_0x898a('0x27')]===_0x898a('0x28')&&typeof _0x53ddb2[_0x898a('0x29')]===_0x898a('0x28');var _0x398e98=_0x3678be[_0x898a('0x2a')];var _0xd31922=_0x1f4d86?0x0:_0x53ddb2['offset'];var _0x4b3e68=_0x1f4d86?_0x3678be['count']:_0x53ddb2[_0x898a('0x27')]+_0x53ddb2[_0x898a('0x29')];var _0x3b7704;if(_0x4b3e68>=_0x398e98){_0x4b3e68=_0x398e98;_0x3b7704=0xc8;}else{_0x3b7704=0xce;}_0x513c6b[_0x898a('0x25')](_0x3b7704);return _0x513c6b[_0x898a('0x2b')](_0x898a('0x2c'),_0xd31922+'-'+_0x4b3e68+'/'+_0x398e98)[_0x898a('0x2d')](_0x3678be);}return null;};}function patchUpdates(_0xf74645){return function(_0x18773a){try{jsonpatch[_0x898a('0x2e')](_0x18773a,_0xf74645,!![]);}catch(_0x44c5d2){return BPromise[_0x898a('0x2f')](_0x44c5d2);}return _0x18773a['save']();};}function saveUpdates(_0x7a1eb5,_0x17a5f3){return function(_0x26eead){if(_0x26eead){return _0x26eead[_0x898a('0x30')](_0x7a1eb5)[_0x898a('0x31')](function(_0x47af5b){return _0x47af5b;});}return null;};}function removeEntity(_0x48cefb,_0x20a3fe){return function(_0x1e2fd4){if(_0x1e2fd4){return _0x1e2fd4[_0x898a('0x32')]()['then'](function(){var _0x105477=_0x1e2fd4[_0x898a('0x33')]({'plain':!![]});var _0x5eafc7=_0x898a('0x34');return db[_0x898a('0x35')][_0x898a('0x32')]({'where':{'type':_0x5eafc7,'resourceId':_0x105477['id']}})[_0x898a('0x31')](function(){return _0x1e2fd4;});})[_0x898a('0x31')](function(){_0x48cefb['status'](0xcc)[_0x898a('0x26')]();});}};}function handleEntityNotFound(_0x5baf5b,_0x573eb3){return function(_0x14e2dc){if(!_0x14e2dc){_0x5baf5b['sendStatus'](0x194);}return _0x14e2dc;};}function handleError(_0x3c9588,_0x4b3aac){_0x4b3aac=_0x4b3aac||0x1f4;return function(_0x37cb11){logger['error'](_0x37cb11[_0x898a('0x36')]);if(_0x37cb11[_0x898a('0x37')]){delete _0x37cb11[_0x898a('0x37')];}_0x3c9588['status'](_0x4b3aac)['send'](_0x37cb11);};}exports['index']=function(_0x1575d2,_0x429c32){var _0x5a228f={},_0xdd019d={},_0x3d3463={'count':0x0,'rows':[]};var _0xe84f7e=_[_0x898a('0x38')](db['Trunk']['rawAttributes'],function(_0x3aed01){return{'name':_0x3aed01[_0x898a('0x39')],'type':_0x3aed01['type']['key']};});_0xdd019d[_0x898a('0x3a')]=_[_0x898a('0x38')](_0xe84f7e,_0x898a('0x37'));_0xdd019d[_0x898a('0x3b')]=_['keys'](_0x1575d2[_0x898a('0x3b')]);_0xdd019d[_0x898a('0x3c')]=_['intersection'](_0xdd019d['model'],_0xdd019d['query']);_0x5a228f[_0x898a('0x3d')]=_[_0x898a('0x3e')](_0xdd019d[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x3f')]));_0x5a228f[_0x898a('0x3d')]=_0x5a228f[_0x898a('0x3d')][_0x898a('0x40')]?_0x5a228f[_0x898a('0x3d')]:_0xdd019d[_0x898a('0x3a')];if(!_0x1575d2[_0x898a('0x3b')][_0x898a('0x41')](_0x898a('0x42'))){_0x5a228f[_0x898a('0x29')]=qs['limit'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x29')]);_0x5a228f[_0x898a('0x27')]=qs['offset'](_0x1575d2[_0x898a('0x3b')][_0x898a('0x27')]);}_0x5a228f[_0x898a('0x43')]=qs[_0x898a('0x44')](_0x1575d2[_0x898a('0x3b')][_0x898a('0x44')]);_0x5a228f[_0x898a('0x45')]=qs[_0x898a('0x3c')](_['pick'](_0x1575d2[_0x898a('0x3b')],_0xdd019d[_0x898a('0x3c')]),_0xe84f7e);if(_0x1575d2[_0x898a('0x3b')][_0x898a('0x46')]){_0x5a228f['where']=_[_0x898a('0x47')](_0x5a228f[_0x898a('0x45')],{'$or':_['map'](_0xe84f7e,function(_0x241677){if(_0x241677['type']!==_0x898a('0x48')){var _0x5137c4={};_0x5137c4[_0x241677['name']]={'$like':'%'+_0x1575d2[_0x898a('0x3b')]['filter']+'%'};return _0x5137c4;}})});}_0x5a228f=_[_0x898a('0x47')]({},_0x5a228f,_0x1575d2[_0x898a('0x49')]);var _0x4d6ac0={'where':_0x5a228f[_0x898a('0x45')]};return db[_0x898a('0x4a')]['count'](_0x4d6ac0)[_0x898a('0x31')](function(_0x199437){_0x3d3463[_0x898a('0x2a')]=_0x199437;if(_0x1575d2[_0x898a('0x3b')]['includeAll']){_0x5a228f[_0x898a('0x4b')]=[{'all':!![]}];}return db[_0x898a('0x4a')]['findAll'](_0x5a228f);})[_0x898a('0x31')](function(_0x1d8c16){_0x3d3463['rows']=_0x1d8c16;return _0x3d3463;})[_0x898a('0x31')](respondWithFilteredResult(_0x429c32,_0x5a228f))['catch'](handleError(_0x429c32,null));};exports[_0x898a('0x4c')]=function(_0x41f291,_0x32ccb9){var _0x50f9e3={'raw':![],'where':{'id':_0x41f291[_0x898a('0x4d')]['id']}},_0x2f6cb3={};_0x2f6cb3[_0x898a('0x3a')]=_[_0x898a('0x4e')](db['Trunk'][_0x898a('0x4f')]);_0x2f6cb3['query']=_[_0x898a('0x4e')](_0x41f291[_0x898a('0x3b')]);_0x2f6cb3[_0x898a('0x3c')]=_['intersection'](_0x2f6cb3[_0x898a('0x3a')],_0x2f6cb3[_0x898a('0x3b')]);_0x50f9e3[_0x898a('0x3d')]=_['intersection'](_0x2f6cb3['model'],qs[_0x898a('0x3f')](_0x41f291[_0x898a('0x3b')][_0x898a('0x3f')]));_0x50f9e3[_0x898a('0x3d')]=_0x50f9e3[_0x898a('0x3d')][_0x898a('0x40')]?_0x50f9e3[_0x898a('0x3d')]:_0x2f6cb3[_0x898a('0x3a')];if(_0x41f291[_0x898a('0x3b')][_0x898a('0x50')]){_0x50f9e3[_0x898a('0x4b')]=[{'all':!![]}];}_0x50f9e3=_['merge']({},_0x50f9e3,_0x41f291[_0x898a('0x49')]);return db[_0x898a('0x4a')]['find'](_0x50f9e3)[_0x898a('0x31')](handleEntityNotFound(_0x32ccb9,null))['then'](respondWithResult(_0x32ccb9,null))['catch'](handleError(_0x32ccb9,null));};exports[_0x898a('0x51')]=function(_0x124f9b,_0x209529){var _0x5bfd61={'where':{'id':_0x124f9b[_0x898a('0x4d')]['id']}},_0x556fd8={};_0x556fd8[_0x898a('0x3a')]=_['keys'](db[_0x898a('0x4a')][_0x898a('0x4f')]);_0x5bfd61['attributes']=_[_0x898a('0x3e')](_0x556fd8[_0x898a('0x3a')],qs[_0x898a('0x3f')](_0x124f9b['query'][_0x898a('0x3f')]));_0x5bfd61[_0x898a('0x3d')]=_0x5bfd61[_0x898a('0x3d')][_0x898a('0x40')]?_0x5bfd61[_0x898a('0x3d')]:_0x556fd8[_0x898a('0x3a')];if(_0x124f9b['query'][_0x898a('0x50')]){_0x5bfd61['include']=[{'all':!![]}];}_0x5bfd61=_[_0x898a('0x47')]({},_0x5bfd61,_0x124f9b[_0x898a('0x49')]);return db[_0x898a('0x4a')][_0x898a('0x52')](_0x5bfd61)[_0x898a('0x31')](handleEntityNotFound(_0x209529,null))[_0x898a('0x31')](function(_0x2486a5){if(_0x2486a5){var _0x75ff57=_0x2486a5[_0x898a('0x33')]({'plain':!![]});_0x75ff57=qs['omit'](_0x75ff57,['id',_0x898a('0x53'),_0x898a('0x54')]);_0x124f9b[_0x898a('0x55')]=_[_0x898a('0x56')](_0x124f9b[_0x898a('0x55')],['id',_0x898a('0x53'),_0x898a('0x54')]);return db[_0x898a('0x4a')][_0x898a('0x57')](_[_0x898a('0x47')](_0x75ff57,_0x124f9b[_0x898a('0x55')]),{'include':_0x124f9b[_0x898a('0x3b')][_0x898a('0x50')]?[{'all':!![]}]:undefined})[_0x898a('0x31')](function(_0x22f9ba){var _0x5f42ae=_0x124f9b[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x5f42ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f42ae[_0x898a('0x59')]===_0x898a('0x58')){var _0x5f0944=_0x22f9ba[_0x898a('0x33')]({'plain':!![]});var _0x1daecd=_0x898a('0x34');return db[_0x898a('0x5a')]['find']({'where':{'name':_0x1daecd,'userProfileId':_0x5f42ae[_0x898a('0x5b')]},'raw':!![]})[_0x898a('0x31')](function(_0x137935){if(_0x137935&&_0x137935[_0x898a('0x5c')]===0x0){return db['UserProfileResource'][_0x898a('0x57')]({'name':_0x5f0944[_0x898a('0x37')],'resourceId':_0x5f0944['id'],'type':_0x137935['name'],'sectionId':_0x137935['id']},{})[_0x898a('0x31')](function(){return _0x22f9ba;});}else{return _0x22f9ba;}})[_0x898a('0x23')](function(_0x5b7019){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7019);throw _0x5b7019;});}return _0x22f9ba;});}})[_0x898a('0x31')](respondWithResult(_0x209529,0xc9))['catch'](handleError(_0x209529,null));};exports['create']=function(_0x5ed35e,_0xfdd6d8,_0x473f5c){var _0x3909c5;return db[_0x898a('0x4a')]['create'](_0x5ed35e['body'],{'raw':!![]})[_0x898a('0x31')](function(_0x232be0){_0x3909c5=_0x232be0;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x41cf94){var _0x30051d=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x42fda8=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),_0x898a('0x63'));var _0x3bcc3d=ejs[_0x898a('0x64')](_0x30051d,{'trunks':_0x41cf94||[]});fs[_0x898a('0x65')](_0x898a('0x66'),_0x3bcc3d);if(_0x3909c5[_0x898a('0x67')]){var _0x307849=ejs[_0x898a('0x64')](_0x42fda8,{'trunks':_0x41cf94||[]});fs['writeFileSync'](_0x898a('0x68'),_0x307849);}})['then'](function(){return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x57'),{'module':_0x898a('0x6a')});})['then'](function(){var _0x31102d=_0x5ed35e[_0x898a('0x58')][_0x898a('0x33')]({'plain':!![]});if(!_0x31102d)throw new Error(_0x898a('0x6b'));if(_0x31102d[_0x898a('0x59')]==='user'){var _0x4b9487=_0x3909c5[_0x898a('0x33')]({'plain':!![]});return db[_0x898a('0x5a')][_0x898a('0x52')]({'where':{'name':_0x898a('0x34'),'userProfileId':_0x31102d['userProfileId']},'raw':!![]})[_0x898a('0x31')](function(_0x3d3451){if(_0x3d3451&&_0x3d3451[_0x898a('0x5c')]===0x0){return db[_0x898a('0x35')][_0x898a('0x57')]({'name':_0x4b9487[_0x898a('0x37')],'resourceId':_0x4b9487['id'],'type':_0x3d3451[_0x898a('0x37')],'sectionId':_0x3d3451['id']},{})[_0x898a('0x31')](function(){return _0x3909c5;});}else{return _0x3909c5;}})['catch'](function(_0x32a207){logger[_0x898a('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32a207);throw _0x32a207;});}return _0x3909c5;})[_0x898a('0x31')](respondWithResult(_0xfdd6d8,0xc9))['catch'](handleError(_0xfdd6d8,null));};exports[_0x898a('0x30')]=function(_0x4b2575,_0x2471d8,_0x387f2c){var _0x3b07dc;return db[_0x898a('0x4a')][_0x898a('0x52')]({'where':{'id':_0x4b2575[_0x898a('0x4d')]['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x2471d8,null))[_0x898a('0x31')](saveUpdates(_0x4b2575[_0x898a('0x55')],null))['then'](function(_0x3fe54b){if(_0x3fe54b){_0x3b07dc=_0x3fe54b;return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});}})[_0x898a('0x31')](function(_0x290972){if(_0x290972){var _0x1d594b=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x4fad03=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config['root'],'server/files/templates/registry.ejs'),_0x898a('0x63'));var _0x4a79a4=ejs[_0x898a('0x64')](_0x1d594b,{'trunks':_0x290972||[]});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4a79a4);var _0x3f6815=ejs[_0x898a('0x64')](_0x4fad03,{'trunks':_0x290972||[]});fs[_0x898a('0x65')](_0x898a('0x68'),_0x3f6815);return respondWithRpcPromise(_0x898a('0x69'),_0x898a('0x30'),{'module':_0x898a('0x6a')});}return null;})['then'](function(_0x3237e8){if(_0x3237e8){return _0x3b07dc;}})[_0x898a('0x31')](respondWithResult(_0x2471d8,null))[_0x898a('0x23')](handleError(_0x2471d8,null));};exports['destroy']=function(_0x27560f,_0x61247c,_0x5c6247){var _0x39e917;return db['Trunk']['find']({'where':{'id':_0x27560f['params']['id']}})[_0x898a('0x31')](handleEntityNotFound(_0x61247c,null))[_0x898a('0x31')](removeEntity(_0x61247c,null))[_0x898a('0x31')](function(){return db[_0x898a('0x4a')][_0x898a('0x5d')]({'raw':!![]});})[_0x898a('0x31')](function(_0x12e54b){var _0x50dd52=fs[_0x898a('0x5e')](path['join'](config[_0x898a('0x5f')],_0x898a('0x60')),'utf8');var _0x24670c=fs[_0x898a('0x5e')](path[_0x898a('0x61')](config[_0x898a('0x5f')],_0x898a('0x62')),'utf8');var _0x5847cb=ejs['render'](_0x50dd52,{'trunks':_0x12e54b});var _0x3b8fb5=ejs[_0x898a('0x64')](_0x24670c,{'trunks':_0x12e54b});fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5847cb);fs[_0x898a('0x65')]('/etc/asterisk/sip_xcally_registers.conf',_0x3b8fb5);return respondWithRpcPromise('Reload',_0x898a('0x32'),{'module':_0x898a('0x6a')});})[_0x898a('0x23')](handleError(_0x61247c,null));}; \ No newline at end of file +var _0xa41a=['server/files/templates/registry.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','destroy','get','UserProfileResource','end','name','send','map','Trunk','fieldName','type','key','query','intersection','model','attributes','fields','length','order','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','createdAt','updatedAt','body','create','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','Trunks','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Reload'];(function(_0x25ae65,_0x550dbd){var _0x3bddb9=function(_0x46896d){while(--_0x46896d){_0x25ae65['push'](_0x25ae65['shift']());}};_0x3bddb9(++_0x550dbd);}(_0xa41a,0x6b));var _0xaa41=function(_0x39e19e,_0x5d539e){_0x39e19e=_0x39e19e-0x0;var _0xec1beb=_0xa41a[_0x39e19e];return _0xec1beb;};'use strict';var emlformat=require(_0xaa41('0x0'));var rimraf=require(_0xaa41('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa41('0x2'));var rp=require(_0xaa41('0x3'));var moment=require(_0xaa41('0x4'));var BPromise=require(_0xaa41('0x5'));var Mustache=require(_0xaa41('0x6'));var util=require(_0xaa41('0x7'));var path=require(_0xaa41('0x8'));var sox=require(_0xaa41('0x9'));var csv=require('to-csv');var ejs=require(_0xaa41('0xa'));var fs=require('fs');var fs_extra=require(_0xaa41('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xe'));var querystring=require(_0xaa41('0xf'));var Papa=require(_0xaa41('0x10'));var Redis=require(_0xaa41('0x11'));var authService=require(_0xaa41('0x12'));var qs=require(_0xaa41('0x13'));var as=require(_0xaa41('0x14'));var hardwareService=require(_0xaa41('0x15'));var logger=require(_0xaa41('0x16'))('api');var utils=require(_0xaa41('0x17'));var config=require(_0xaa41('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xaa41('0x19'));var client=jayson['client'][_0xaa41('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x12d9e6,_0x2f64bc,_0x889d44,_0x6f9ade){return new BPromise(function(_0x4eaf81,_0x1e9d7f){var _0x178170=_0x6f9ade||client;return _0x178170[_0xaa41('0x1b')](_0x12d9e6,_0x889d44)[_0xaa41('0x1c')](function(_0x2a6988){logger[_0xaa41('0x1d')](_0xaa41('0x1e'),_0x2f64bc,'request\x20sent');logger[_0xaa41('0x1f')](_0xaa41('0x20'),_0x2f64bc,_0xaa41('0x21'),JSON[_0xaa41('0x22')](_0x2a6988));if(_0x2a6988[_0xaa41('0x23')]){if(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x24')]===0x1f4){logger[_0xaa41('0x23')](_0xaa41('0x1e'),_0x2f64bc,_0x2a6988['error']['message']);return _0x1e9d7f(_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);}logger[_0xaa41('0x23')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0x2a6988[_0xaa41('0x23')][_0xaa41('0x25')]);return _0x4eaf81(_0x2a6988['error']['message']);}else{logger[_0xaa41('0x1d')]('Trunk,\x20%s,\x20%s',_0x2f64bc,_0xaa41('0x21'));_0x4eaf81(_0x2a6988[_0xaa41('0x26')][_0xaa41('0x25')]);}})[_0xaa41('0x27')](function(_0x1d623c){logger['error'](_0xaa41('0x1e'),_0x2f64bc,_0x1d623c);_0x1e9d7f(_0x1d623c);});});}function respondWithStatusCode(_0x43a85c,_0x448a21){_0x448a21=_0x448a21||0xcc;return function(_0x21f596){if(_0x21f596){return _0x43a85c[_0xaa41('0x28')](_0x448a21);}return _0x43a85c[_0xaa41('0x29')](_0x448a21)['end']();};}function respondWithResult(_0x5795f4,_0x16aec5){_0x16aec5=_0x16aec5||0xc8;return function(_0x527cac){if(_0x527cac){return _0x5795f4['status'](_0x16aec5)[_0xaa41('0x2a')](_0x527cac);}};}function respondWithFilteredResult(_0x59707f,_0x536bed){return function(_0x2d0ac0){if(_0x2d0ac0){var _0x9c8c21=typeof _0x536bed[_0xaa41('0x2b')]===_0xaa41('0x2c')&&typeof _0x536bed[_0xaa41('0x2d')]===_0xaa41('0x2c');var _0x57ef96=_0x2d0ac0[_0xaa41('0x2e')];var _0x1f0275=_0x9c8c21?0x0:_0x536bed[_0xaa41('0x2b')];var _0x9a16e3=_0x9c8c21?_0x2d0ac0[_0xaa41('0x2e')]:_0x536bed[_0xaa41('0x2b')]+_0x536bed[_0xaa41('0x2d')];var _0x104a95;if(_0x9a16e3>=_0x57ef96){_0x9a16e3=_0x57ef96;_0x104a95=0xc8;}else{_0x104a95=0xce;}_0x59707f['status'](_0x104a95);return _0x59707f[_0xaa41('0x2f')]('Content-Range',_0x1f0275+'-'+_0x9a16e3+'/'+_0x57ef96)['json'](_0x2d0ac0);}return null;};}function patchUpdates(_0x714537){return function(_0x1176bd){try{jsonpatch['apply'](_0x1176bd,_0x714537,!![]);}catch(_0x392b5d){return BPromise[_0xaa41('0x30')](_0x392b5d);}return _0x1176bd['save']();};}function saveUpdates(_0x5022fb,_0x5c25fb){return function(_0x1cf3da){if(_0x1cf3da){return _0x1cf3da[_0xaa41('0x31')](_0x5022fb)[_0xaa41('0x1c')](function(_0x38afc4){return _0x38afc4;});}return null;};}function removeEntity(_0x58f203,_0x289c4a){return function(_0x45c8fe){if(_0x45c8fe){return _0x45c8fe[_0xaa41('0x32')]()['then'](function(){var _0x387c55=_0x45c8fe[_0xaa41('0x33')]({'plain':!![]});var _0x321eb7='Trunks';return db[_0xaa41('0x34')][_0xaa41('0x32')]({'where':{'type':_0x321eb7,'resourceId':_0x387c55['id']}})['then'](function(){return _0x45c8fe;});})[_0xaa41('0x1c')](function(){_0x58f203[_0xaa41('0x29')](0xcc)[_0xaa41('0x35')]();});}};}function handleEntityNotFound(_0x5cec87,_0x22b272){return function(_0x48335f){if(!_0x48335f){_0x5cec87[_0xaa41('0x28')](0x194);}return _0x48335f;};}function handleError(_0x199b24,_0xf13742){_0xf13742=_0xf13742||0x1f4;return function(_0x49b77a){logger['error'](_0x49b77a['stack']);if(_0x49b77a[_0xaa41('0x36')]){delete _0x49b77a[_0xaa41('0x36')];}_0x199b24[_0xaa41('0x29')](_0xf13742)[_0xaa41('0x37')](_0x49b77a);};}exports['index']=function(_0x53a2e4,_0x267999){var _0x5673c={},_0x951e52={},_0x4e8d2e={'count':0x0,'rows':[]};var _0xba115a=_[_0xaa41('0x38')](db[_0xaa41('0x39')]['rawAttributes'],function(_0x3adc28){return{'name':_0x3adc28[_0xaa41('0x3a')],'type':_0x3adc28[_0xaa41('0x3b')][_0xaa41('0x3c')]};});_0x951e52['model']=_['map'](_0xba115a,_0xaa41('0x36'));_0x951e52[_0xaa41('0x3d')]=_['keys'](_0x53a2e4[_0xaa41('0x3d')]);_0x951e52['filters']=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],_0x951e52[_0xaa41('0x3d')]);_0x5673c[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x951e52[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x53a2e4[_0xaa41('0x3d')]['fields']));_0x5673c[_0xaa41('0x40')]=_0x5673c[_0xaa41('0x40')][_0xaa41('0x42')]?_0x5673c[_0xaa41('0x40')]:_0x951e52[_0xaa41('0x3f')];if(!_0x53a2e4[_0xaa41('0x3d')]['hasOwnProperty']('nolimit')){_0x5673c[_0xaa41('0x2d')]=qs['limit'](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2d')]);_0x5673c[_0xaa41('0x2b')]=qs[_0xaa41('0x2b')](_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x2b')]);}_0x5673c[_0xaa41('0x43')]=qs['sort'](_0x53a2e4[_0xaa41('0x3d')]['sort']);_0x5673c['where']=qs[_0xaa41('0x44')](_['pick'](_0x53a2e4['query'],_0x951e52['filters']),_0xba115a);if(_0x53a2e4[_0xaa41('0x3d')]['filter']){_0x5673c[_0xaa41('0x45')]=_[_0xaa41('0x46')](_0x5673c['where'],{'$or':_['map'](_0xba115a,function(_0xe58f5e){if(_0xe58f5e[_0xaa41('0x3b')]!==_0xaa41('0x47')){var _0x2af8ba={};_0x2af8ba[_0xe58f5e[_0xaa41('0x36')]]={'$like':'%'+_0x53a2e4[_0xaa41('0x3d')][_0xaa41('0x48')]+'%'};return _0x2af8ba;}})});}_0x5673c=_[_0xaa41('0x46')]({},_0x5673c,_0x53a2e4[_0xaa41('0x49')]);var _0x4e1ac4={'where':_0x5673c[_0xaa41('0x45')]};return db[_0xaa41('0x39')][_0xaa41('0x2e')](_0x4e1ac4)[_0xaa41('0x1c')](function(_0x206d86){_0x4e8d2e[_0xaa41('0x2e')]=_0x206d86;if(_0x53a2e4['query'][_0xaa41('0x4a')]){_0x5673c[_0xaa41('0x4b')]=[{'all':!![]}];}return db[_0xaa41('0x39')][_0xaa41('0x4c')](_0x5673c);})['then'](function(_0x23bc61){_0x4e8d2e['rows']=_0x23bc61;return _0x4e8d2e;})['then'](respondWithFilteredResult(_0x267999,_0x5673c))[_0xaa41('0x27')](handleError(_0x267999,null));};exports[_0xaa41('0x4d')]=function(_0x3e16ef,_0x4ca114){var _0xb4773b={'raw':![],'where':{'id':_0x3e16ef[_0xaa41('0x4e')]['id']}},_0x3e1a73={};_0x3e1a73['model']=_[_0xaa41('0x4f')](db[_0xaa41('0x39')][_0xaa41('0x50')]);_0x3e1a73[_0xaa41('0x3d')]=_[_0xaa41('0x4f')](_0x3e16ef[_0xaa41('0x3d')]);_0x3e1a73[_0xaa41('0x44')]=_[_0xaa41('0x3e')](_0x3e1a73['model'],_0x3e1a73[_0xaa41('0x3d')]);_0xb4773b['attributes']=_['intersection'](_0x3e1a73[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x41')]));_0xb4773b[_0xaa41('0x40')]=_0xb4773b[_0xaa41('0x40')][_0xaa41('0x42')]?_0xb4773b[_0xaa41('0x40')]:_0x3e1a73['model'];if(_0x3e16ef[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0xb4773b[_0xaa41('0x4b')]=[{'all':!![]}];}_0xb4773b=_['merge']({},_0xb4773b,_0x3e16ef[_0xaa41('0x49')]);return db[_0xaa41('0x39')]['find'](_0xb4773b)[_0xaa41('0x1c')](handleEntityNotFound(_0x4ca114,null))[_0xaa41('0x1c')](respondWithResult(_0x4ca114,null))[_0xaa41('0x27')](handleError(_0x4ca114,null));};exports['clone']=function(_0x2cf32c,_0xc8e626){var _0x4e3b13={'where':{'id':_0x2cf32c[_0xaa41('0x4e')]['id']}},_0x49789a={};_0x49789a[_0xaa41('0x3f')]=_[_0xaa41('0x4f')](db['Trunk'][_0xaa41('0x50')]);_0x4e3b13[_0xaa41('0x40')]=_[_0xaa41('0x3e')](_0x49789a[_0xaa41('0x3f')],qs[_0xaa41('0x41')](_0x2cf32c['query'][_0xaa41('0x41')]));_0x4e3b13['attributes']=_0x4e3b13['attributes'][_0xaa41('0x42')]?_0x4e3b13['attributes']:_0x49789a[_0xaa41('0x3f')];if(_0x2cf32c[_0xaa41('0x3d')][_0xaa41('0x4a')]){_0x4e3b13['include']=[{'all':!![]}];}_0x4e3b13=_[_0xaa41('0x46')]({},_0x4e3b13,_0x2cf32c[_0xaa41('0x49')]);return db[_0xaa41('0x39')][_0xaa41('0x51')](_0x4e3b13)[_0xaa41('0x1c')](handleEntityNotFound(_0xc8e626,null))[_0xaa41('0x1c')](function(_0xc56018){if(_0xc56018){var _0x337059=_0xc56018[_0xaa41('0x33')]({'plain':!![]});_0x337059=qs['omit'](_0x337059,['id',_0xaa41('0x52'),_0xaa41('0x53')]);_0x2cf32c[_0xaa41('0x54')]=_['omit'](_0x2cf32c[_0xaa41('0x54')],['id',_0xaa41('0x52'),_0xaa41('0x53')]);return db[_0xaa41('0x39')][_0xaa41('0x55')](_[_0xaa41('0x46')](_0x337059,_0x2cf32c[_0xaa41('0x54')]),{'include':_0x2cf32c['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x540325){var _0x4ec357=_0x2cf32c['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x4ec357)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ec357['role']===_0xaa41('0x56')){var _0x40a524=_0x540325[_0xaa41('0x33')]({'plain':!![]});var _0x312eee='Trunks';return db[_0xaa41('0x57')][_0xaa41('0x51')]({'where':{'name':_0x312eee,'userProfileId':_0x4ec357[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0xa71432){if(_0xa71432&&_0xa71432[_0xaa41('0x59')]===0x0){return db[_0xaa41('0x34')][_0xaa41('0x55')]({'name':_0x40a524[_0xaa41('0x36')],'resourceId':_0x40a524['id'],'type':_0xa71432['name'],'sectionId':_0xa71432['id']},{})[_0xaa41('0x1c')](function(){return _0x540325;});}else{return _0x540325;}})[_0xaa41('0x27')](function(_0x50170f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50170f);throw _0x50170f;});}return _0x540325;});}})[_0xaa41('0x1c')](respondWithResult(_0xc8e626,0xc9))['catch'](handleError(_0xc8e626,null));};exports[_0xaa41('0x55')]=function(_0x5c8028,_0x5423b6,_0x18d18b){var _0x4b1ec4;return db[_0xaa41('0x39')][_0xaa41('0x55')](_0x5c8028[_0xaa41('0x54')],{'raw':!![]})[_0xaa41('0x1c')](function(_0x5a2683){_0x4b1ec4=_0x5a2683;return db['Trunk'][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x4d6d0c){var _0x5954ba=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x5a385e=fs[_0xaa41('0x5a')](path['join'](config['root'],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x19ec63=ejs[_0xaa41('0x5f')](_0x5954ba,{'trunks':_0x4d6d0c||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x19ec63);if(_0x4b1ec4[_0xaa41('0x61')]){var _0x19ed68=ejs[_0xaa41('0x5f')](_0x5a385e,{'trunks':_0x4d6d0c||[]});fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x19ed68);}})[_0xaa41('0x1c')](function(){return respondWithRpcPromise('Reload',_0xaa41('0x55'),{'module':_0xaa41('0x64')});})[_0xaa41('0x1c')](function(){var _0x175ca9=_0x5c8028['user'][_0xaa41('0x33')]({'plain':!![]});if(!_0x175ca9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x175ca9[_0xaa41('0x65')]===_0xaa41('0x56')){var _0x2b9e68=_0x4b1ec4[_0xaa41('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xaa41('0x51')]({'where':{'name':_0xaa41('0x66'),'userProfileId':_0x175ca9[_0xaa41('0x58')]},'raw':!![]})[_0xaa41('0x1c')](function(_0x59052d){if(_0x59052d&&_0x59052d[_0xaa41('0x59')]===0x0){return db['UserProfileResource'][_0xaa41('0x55')]({'name':_0x2b9e68[_0xaa41('0x36')],'resourceId':_0x2b9e68['id'],'type':_0x59052d['name'],'sectionId':_0x59052d['id']},{})[_0xaa41('0x1c')](function(){return _0x4b1ec4;});}else{return _0x4b1ec4;}})[_0xaa41('0x27')](function(_0x2ba160){logger[_0xaa41('0x23')](_0xaa41('0x67'),_0x2ba160);throw _0x2ba160;});}return _0x4b1ec4;})[_0xaa41('0x1c')](respondWithResult(_0x5423b6,0xc9))[_0xaa41('0x27')](handleError(_0x5423b6,null));};exports[_0xaa41('0x31')]=function(_0x33b5f4,_0x3d4f1e,_0x25a064){var _0x59a30b;return db[_0xaa41('0x39')][_0xaa41('0x51')]({'where':{'id':_0x33b5f4[_0xaa41('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3d4f1e,null))['then'](saveUpdates(_0x33b5f4[_0xaa41('0x54')],null))[_0xaa41('0x1c')](function(_0x59fd6a){if(_0x59fd6a){_0x59a30b=_0x59fd6a;return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});}})['then'](function(_0x305050){if(_0x305050){var _0x3dd47e=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config[_0xaa41('0x5c')],_0xaa41('0x5d')),_0xaa41('0x5e'));var _0x1472be=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],'server/files/templates/registry.ejs'),_0xaa41('0x5e'));var _0x44154f=ejs[_0xaa41('0x5f')](_0x3dd47e,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x60'),_0x44154f);var _0x404c38=ejs[_0xaa41('0x5f')](_0x1472be,{'trunks':_0x305050||[]});fs['writeFileSync'](_0xaa41('0x63'),_0x404c38);return respondWithRpcPromise(_0xaa41('0x68'),'update',{'module':_0xaa41('0x64')});}return null;})['then'](function(_0x53faf4){if(_0x53faf4){return _0x59a30b;}})[_0xaa41('0x1c')](respondWithResult(_0x3d4f1e,null))[_0xaa41('0x27')](handleError(_0x3d4f1e,null));};exports['destroy']=function(_0x5a8cb0,_0x241e1a,_0x1726ec){var _0x3c189d;return db[_0xaa41('0x39')]['find']({'where':{'id':_0x5a8cb0[_0xaa41('0x4e')]['id']}})[_0xaa41('0x1c')](handleEntityNotFound(_0x241e1a,null))[_0xaa41('0x1c')](removeEntity(_0x241e1a,null))['then'](function(){return db[_0xaa41('0x39')][_0xaa41('0x4c')]({'raw':!![]});})[_0xaa41('0x1c')](function(_0x5697b6){var _0x183b36=fs['readFileSync'](path['join'](config[_0xaa41('0x5c')],_0xaa41('0x5d')),'utf8');var _0x399fbd=fs[_0xaa41('0x5a')](path[_0xaa41('0x5b')](config['root'],_0xaa41('0x69')),_0xaa41('0x5e'));var _0x1a2deb=ejs[_0xaa41('0x5f')](_0x183b36,{'trunks':_0x5697b6});var _0x38f5d0=ejs['render'](_0x399fbd,{'trunks':_0x5697b6});fs[_0xaa41('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x1a2deb);fs[_0xaa41('0x62')](_0xaa41('0x63'),_0x38f5d0);return respondWithRpcPromise(_0xaa41('0x68'),_0xaa41('0x32'),{'module':_0xaa41('0x64')});})[_0xaa41('0x27')](handleError(_0x241e1a,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 7eac831..36b5ffd 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 _0xe181=['exports','Trunk','lodash','util','../../config/logger','moment','request-promise','rimraf','./trunk.attributes'];(function(_0x1c6656,_0x4bbbff){var _0x43640b=function(_0x106780){while(--_0x106780){_0x1c6656['push'](_0x1c6656['shift']());}};_0x43640b(++_0x4bbbff);}(_0xe181,0x92));var _0x1e18=function(_0x6bb814,_0x17196b){_0x6bb814=_0x6bb814-0x0;var _0x3c4bf6=_0xe181[_0x6bb814];return _0x3c4bf6;};'use strict';var _=require(_0x1e18('0x0'));var util=require(_0x1e18('0x1'));var logger=require(_0x1e18('0x2'))('api');var moment=require(_0x1e18('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e18('0x5'));var config=require('../../config/environment');var attributes=require(_0x1e18('0x6'));module[_0x1e18('0x7')]=function(_0x1d0b20,_0xb6ecca){return _0x1d0b20['define'](_0x1e18('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2efc=['../../config/logger','api','bluebird','request-promise','path','rimraf','exports','Trunk','tools_trunks','util'];(function(_0x416928,_0x1078dc){var _0x21f8d6=function(_0x5125eb){while(--_0x5125eb){_0x416928['push'](_0x416928['shift']());}};_0x21f8d6(++_0x1078dc);}(_0x2efc,0xdb));var _0xc2ef=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x2efc[_0x20ef64];return _0x3707d8;};'use strict';var _=require('lodash');var util=require(_0xc2ef('0x0'));var logger=require(_0xc2ef('0x1'))(_0xc2ef('0x2'));var moment=require('moment');var BPromise=require(_0xc2ef('0x3'));var rp=require(_0xc2ef('0x4'));var fs=require('fs');var path=require(_0xc2ef('0x5'));var rimraf=require(_0xc2ef('0x6'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0xc2ef('0x7')]=function(_0x254e13,_0x3af94e){return _0x254e13['define'](_0xc2ef('0x8'),attributes,{'tableName':_0xc2ef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 6f7bb81..ec87d1b 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 _0xf64a=['find','raw','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','findAll','options','where','limit','map','include','model','attributes','GetTrunk','Trunk'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf64a,0x19a));var _0xaf64=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0xf64a[_0x4b784d];return _0x2cdeaf;};'use strict';var _=require(_0xaf64('0x0'));var util=require(_0xaf64('0x1'));var moment=require(_0xaf64('0x2'));var BPromise=require(_0xaf64('0x3'));var rs=require(_0xaf64('0x4'));var fs=require('fs');var Redis=require(_0xaf64('0x5'));var db=require(_0xaf64('0x6'))['db'];var utils=require(_0xaf64('0x7'));var logger=require(_0xaf64('0x8'))(_0xaf64('0x9'));var config=require(_0xaf64('0xa'));var jayson=require(_0xaf64('0xb'));var client=jayson['client'][_0xaf64('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb49bc1,_0x25f1fd,_0x21e968){return new BPromise(function(_0x5c5f0f,_0x5206cb){return client[_0xaf64('0xd')](_0xb49bc1,_0x21e968)[_0xaf64('0xe')](function(_0x421b25){logger[_0xaf64('0xf')](_0xaf64('0x10'),_0x25f1fd,'request\x20sent');logger[_0xaf64('0x11')]('Trunk,\x20%s,\x20%s,\x20%s',_0x25f1fd,_0xaf64('0x12'),JSON[_0xaf64('0x13')](_0x421b25));if(_0x421b25[_0xaf64('0x14')]){if(_0x421b25[_0xaf64('0x14')]['code']===0x1f4){logger[_0xaf64('0x14')](_0xaf64('0x10'),_0x25f1fd,_0x421b25['error'][_0xaf64('0x15')]);return _0x5206cb(_0x421b25[_0xaf64('0x14')][_0xaf64('0x15')]);}logger[_0xaf64('0x14')](_0xaf64('0x10'),_0x25f1fd,_0x421b25[_0xaf64('0x14')][_0xaf64('0x15')]);return _0x5c5f0f(_0x421b25['error'][_0xaf64('0x15')]);}else{logger[_0xaf64('0xf')](_0xaf64('0x10'),_0x25f1fd,'request\x20sent');_0x5c5f0f(_0x421b25[_0xaf64('0x16')][_0xaf64('0x15')]);}})[_0xaf64('0x17')](function(_0x43085c){logger['error'](_0xaf64('0x10'),_0x25f1fd,_0x43085c);_0x5206cb(_0x43085c);});});}exports['GetTrunk']=function(_0x50b0ea){var _0x504ff3=this;return new Promise(function(_0x56dcd2,_0x54a198){return db['Trunk'][_0xaf64('0x18')]({'raw':_0x50b0ea[_0xaf64('0x19')]?_0x50b0ea[_0xaf64('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x50b0ea['options']?_0x50b0ea[_0xaf64('0x19')][_0xaf64('0x1a')]||null:null,'attributes':_0x50b0ea[_0xaf64('0x19')]?_0x50b0ea['options']['attributes']||null:null,'limit':_0x50b0ea[_0xaf64('0x19')]?_0x50b0ea[_0xaf64('0x19')][_0xaf64('0x1b')]||null:null,'include':_0x50b0ea[_0xaf64('0x19')]?_0x50b0ea[_0xaf64('0x19')]['include']?_[_0xaf64('0x1c')](_0x50b0ea[_0xaf64('0x19')][_0xaf64('0x1d')],function(_0x1f1e59){return{'model':db[_0x1f1e59[_0xaf64('0x1e')]],'as':_0x1f1e59['as'],'attributes':_0x1f1e59[_0xaf64('0x1f')],'include':_0x1f1e59[_0xaf64('0x1d')]?_[_0xaf64('0x1c')](_0x1f1e59['include'],function(_0x30d615){return{'model':db[_0x30d615[_0xaf64('0x1e')]],'as':_0x30d615['as'],'attributes':_0x30d615[_0xaf64('0x1f')],'include':_0x30d615[_0xaf64('0x1d')]?_[_0xaf64('0x1c')](_0x30d615[_0xaf64('0x1d')],function(_0x57b734){return{'model':db[_0x57b734['model']],'as':_0x57b734['as'],'attributes':_0x57b734['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf64('0xe')](function(_0x5517d0){logger[_0xaf64('0xf')]('GetTrunk',_0x50b0ea);logger[_0xaf64('0x11')](_0xaf64('0x20'),_0x50b0ea,JSON[_0xaf64('0x13')](_0x5517d0));_0x56dcd2(_0x5517d0);})[_0xaf64('0x17')](function(_0x453ac6){logger['error'](_0xaf64('0x20'),_0x453ac6['message'],_0x50b0ea);_0x54a198(_0x504ff3[_0xaf64('0x14')](0x1f4,_0x453ac6[_0xaf64('0x15')]));});});};exports['ShowTrunk']=function(_0x4e75a7){var _0x522ff7=this;return new Promise(function(_0x4484ed,_0x5c0810){return db[_0xaf64('0x21')][_0xaf64('0x22')]({'raw':_0x4e75a7[_0xaf64('0x19')]?_0x4e75a7['options'][_0xaf64('0x23')]===undefined?!![]:![]:!![],'where':_0x4e75a7['options']?_0x4e75a7[_0xaf64('0x19')][_0xaf64('0x1a')]||null:null,'attributes':_0x4e75a7[_0xaf64('0x19')]?_0x4e75a7['options'][_0xaf64('0x1f')]||null:null,'include':_0x4e75a7['options']?_0x4e75a7[_0xaf64('0x19')][_0xaf64('0x1d')]?_[_0xaf64('0x1c')](_0x4e75a7[_0xaf64('0x19')][_0xaf64('0x1d')],function(_0x52ba7a){return{'model':db[_0x52ba7a[_0xaf64('0x1e')]],'as':_0x52ba7a['as'],'attributes':_0x52ba7a[_0xaf64('0x1f')],'include':_0x52ba7a['include']?_['map'](_0x52ba7a[_0xaf64('0x1d')],function(_0x2a6ea1){return{'model':db[_0x2a6ea1['model']],'as':_0x2a6ea1['as'],'attributes':_0x2a6ea1['attributes'],'include':_0x2a6ea1[_0xaf64('0x1d')]?_[_0xaf64('0x1c')](_0x2a6ea1['include'],function(_0x452cb8){return{'model':db[_0x452cb8[_0xaf64('0x1e')]],'as':_0x452cb8['as'],'attributes':_0x452cb8['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf64('0xe')](function(_0x699ba4){logger[_0xaf64('0xf')](_0xaf64('0x24'),_0x4e75a7);logger[_0xaf64('0x11')]('ShowTrunk',_0x4e75a7,JSON['stringify'](_0x699ba4));_0x4484ed(_0x699ba4);})[_0xaf64('0x17')](function(_0x186b7e){logger[_0xaf64('0x14')]('ShowTrunk',_0x186b7e[_0xaf64('0x15')],_0x4e75a7);_0x5c0810(_0x522ff7['error'](0x1f4,_0x186b7e[_0xaf64('0x15')]));});});}; \ No newline at end of file +var _0x15ec=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','Trunk','findAll','options','raw','attributes','limit','include','map','model','debug','GetTrunk','ShowTrunk','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x333329,_0x128176){var _0x4798f4=function(_0x289824){while(--_0x289824){_0x333329['push'](_0x333329['shift']());}};_0x4798f4(++_0x128176);}(_0x15ec,0x157));var _0xc15e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x15ec[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xc15e('0x0'));var util=require('util');var moment=require(_0xc15e('0x1'));var BPromise=require('bluebird');var rs=require(_0xc15e('0x2'));var fs=require('fs');var Redis=require(_0xc15e('0x3'));var db=require(_0xc15e('0x4'))['db'];var utils=require(_0xc15e('0x5'));var logger=require(_0xc15e('0x6'))(_0xc15e('0x7'));var config=require(_0xc15e('0x8'));var jayson=require(_0xc15e('0x9'));var client=jayson[_0xc15e('0xa')][_0xc15e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54d2c3,_0x194957,_0x4c37f8){return new BPromise(function(_0x65e791,_0x5b8f91){return client[_0xc15e('0xc')](_0x54d2c3,_0x4c37f8)[_0xc15e('0xd')](function(_0x433c47){logger[_0xc15e('0xe')](_0xc15e('0xf'),_0x194957,_0xc15e('0x10'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x194957,_0xc15e('0x10'),JSON[_0xc15e('0x11')](_0x433c47));if(_0x433c47[_0xc15e('0x12')]){if(_0x433c47['error'][_0xc15e('0x13')]===0x1f4){logger[_0xc15e('0x12')](_0xc15e('0xf'),_0x194957,_0x433c47[_0xc15e('0x12')][_0xc15e('0x14')]);return _0x5b8f91(_0x433c47['error'][_0xc15e('0x14')]);}logger[_0xc15e('0x12')](_0xc15e('0xf'),_0x194957,_0x433c47[_0xc15e('0x12')][_0xc15e('0x14')]);return _0x65e791(_0x433c47[_0xc15e('0x12')][_0xc15e('0x14')]);}else{logger[_0xc15e('0xe')]('Trunk,\x20%s,\x20%s',_0x194957,'request\x20sent');_0x65e791(_0x433c47['result'][_0xc15e('0x14')]);}})[_0xc15e('0x15')](function(_0x5a3079){logger[_0xc15e('0x12')]('Trunk,\x20%s,\x20%s',_0x194957,_0x5a3079);_0x5b8f91(_0x5a3079);});});}exports['GetTrunk']=function(_0x3106fd){var _0x53fa63=this;return new Promise(function(_0x57c50b,_0x2f7dcd){return db[_0xc15e('0x16')][_0xc15e('0x17')]({'raw':_0x3106fd['options']?_0x3106fd[_0xc15e('0x18')][_0xc15e('0x19')]===undefined?!![]:![]:!![],'where':_0x3106fd[_0xc15e('0x18')]?_0x3106fd[_0xc15e('0x18')]['where']||null:null,'attributes':_0x3106fd[_0xc15e('0x18')]?_0x3106fd['options'][_0xc15e('0x1a')]||null:null,'limit':_0x3106fd[_0xc15e('0x18')]?_0x3106fd['options'][_0xc15e('0x1b')]||null:null,'include':_0x3106fd[_0xc15e('0x18')]?_0x3106fd[_0xc15e('0x18')][_0xc15e('0x1c')]?_[_0xc15e('0x1d')](_0x3106fd[_0xc15e('0x18')][_0xc15e('0x1c')],function(_0xee9a7d){return{'model':db[_0xee9a7d[_0xc15e('0x1e')]],'as':_0xee9a7d['as'],'attributes':_0xee9a7d['attributes'],'include':_0xee9a7d[_0xc15e('0x1c')]?_['map'](_0xee9a7d['include'],function(_0x29919a){return{'model':db[_0x29919a[_0xc15e('0x1e')]],'as':_0x29919a['as'],'attributes':_0x29919a['attributes'],'include':_0x29919a[_0xc15e('0x1c')]?_[_0xc15e('0x1d')](_0x29919a[_0xc15e('0x1c')],function(_0x531c93){return{'model':db[_0x531c93[_0xc15e('0x1e')]],'as':_0x531c93['as'],'attributes':_0x531c93[_0xc15e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc15e('0xd')](function(_0x68c093){logger[_0xc15e('0xe')]('GetTrunk',_0x3106fd);logger[_0xc15e('0x1f')](_0xc15e('0x20'),_0x3106fd,JSON['stringify'](_0x68c093));_0x57c50b(_0x68c093);})['catch'](function(_0x269a25){logger['error'](_0xc15e('0x20'),_0x269a25[_0xc15e('0x14')],_0x3106fd);_0x2f7dcd(_0x53fa63[_0xc15e('0x12')](0x1f4,_0x269a25[_0xc15e('0x14')]));});});};exports[_0xc15e('0x21')]=function(_0x25e331){var _0x39edf2=this;return new Promise(function(_0x5750a2,_0xeddad2){return db[_0xc15e('0x16')][_0xc15e('0x22')]({'raw':_0x25e331['options']?_0x25e331['options']['raw']===undefined?!![]:![]:!![],'where':_0x25e331['options']?_0x25e331[_0xc15e('0x18')]['where']||null:null,'attributes':_0x25e331[_0xc15e('0x18')]?_0x25e331[_0xc15e('0x18')][_0xc15e('0x1a')]||null:null,'include':_0x25e331[_0xc15e('0x18')]?_0x25e331[_0xc15e('0x18')][_0xc15e('0x1c')]?_[_0xc15e('0x1d')](_0x25e331[_0xc15e('0x18')]['include'],function(_0x27bd78){return{'model':db[_0x27bd78[_0xc15e('0x1e')]],'as':_0x27bd78['as'],'attributes':_0x27bd78[_0xc15e('0x1a')],'include':_0x27bd78[_0xc15e('0x1c')]?_['map'](_0x27bd78[_0xc15e('0x1c')],function(_0x3d4069){return{'model':db[_0x3d4069['model']],'as':_0x3d4069['as'],'attributes':_0x3d4069[_0xc15e('0x1a')],'include':_0x3d4069[_0xc15e('0x1c')]?_['map'](_0x3d4069['include'],function(_0x354eb1){return{'model':db[_0x354eb1['model']],'as':_0x354eb1['as'],'attributes':_0x354eb1[_0xc15e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc15e('0xd')](function(_0x5b9a5c){logger[_0xc15e('0xe')]('ShowTrunk',_0x25e331);logger['debug'](_0xc15e('0x21'),_0x25e331,JSON['stringify'](_0x5b9a5c));_0x5750a2(_0x5b9a5c);})[_0xc15e('0x15')](function(_0x3b05fd){logger['error'](_0xc15e('0x21'),_0x3b05fd[_0xc15e('0x14')],_0x25e331);_0xeddad2(_0x39edf2[_0xc15e('0x12')](0x1f4,_0x3b05fd[_0xc15e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 4dc9a50..c49fd61 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 _0xf649=['isAuthenticated','exports','express','../../components/auth/service','./user-setting.controller','/:id'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf649,0x1d0));var _0x9f64=function(_0x18d1bc,_0xc79a86){_0x18d1bc=_0x18d1bc-0x0;var _0x55d0d6=_0xf649[_0x18d1bc];return _0x55d0d6;};'use strict';var express=require(_0x9f64('0x0'));var router=express['Router']();var auth=require(_0x9f64('0x1'));var controller=require(_0x9f64('0x2'));router['put'](_0x9f64('0x3'),auth[_0x9f64('0x4')](),controller['update']);module[_0x9f64('0x5')]=router; \ No newline at end of file +var _0xf618=['./user-setting.controller','put','/:id','update'];(function(_0x3c3144,_0x5764dc){var _0x398869=function(_0x4c33f6){while(--_0x4c33f6){_0x3c3144['push'](_0x3c3144['shift']());}};_0x398869(++_0x5764dc);}(_0xf618,0x120));var _0x8f61=function(_0x13db75,_0x4d0d5f){_0x13db75=_0x13db75-0x0;var _0x1b1571=_0xf618[_0x13db75];return _0x1b1571;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x8f61('0x0'));router[_0x8f61('0x1')](_0x8f61('0x2'),auth['isAuthenticated'](),controller[_0x8f61('0x3')]);module['exports']=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 8bfcb03..9f4e508 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 _0x7f2a=['TEXT','DATE','INTEGER','UserId','sequelize','error','warning','info','debug','exports','BOOLEAN'];(function(_0x6ce94,_0x1b3464){var _0x137074=function(_0x3a7f29){while(--_0x3a7f29){_0x6ce94['push'](_0x6ce94['shift']());}};_0x137074(++_0x1b3464);}(_0x7f2a,0xbf));var _0xa7f2=function(_0x48bba2,_0x1b103f){_0x48bba2=_0x48bba2-0x0;var _0x51a83d=_0x7f2a[_0x48bba2];return _0x51a83d;};'use strict';var Sequelize=require(_0xa7f2('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xa7f2('0x1'),_0xa7f2('0x2'),_0xa7f2('0x3'),_0xa7f2('0x4')];module[_0xa7f2('0x5')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xa7f2('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xa7f2('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xa7f2('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xa7f2('0x9')],'unique':_0xa7f2('0xa')}}; \ No newline at end of file +var _0x46f8=['info','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','sequelize','error','warning'];(function(_0x2dcb3e,_0x26414d){var _0x884bc5=function(_0x30b958){while(--_0x30b958){_0x2dcb3e['push'](_0x2dcb3e['shift']());}};_0x884bc5(++_0x26414d);}(_0x46f8,0xa7));var _0x846f=function(_0x22e91b,_0x5c12c1){_0x22e91b=_0x22e91b-0x0;var _0x4f7a8e=_0x46f8[_0x22e91b];return _0x4f7a8e;};'use strict';var Sequelize=require(_0x846f('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x846f('0x1'),_0x846f('0x2'),_0x846f('0x3'),'debug'];module[_0x846f('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x846f('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x846f('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x846f('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x846f('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x846f('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x846f('0x9')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index cc0f23a..f7a6f3b 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 _0x1f38=['ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','name','send','user','role','admin','params','Invalid\x20user\x20setting\x20id','UserSetting','find','body','catch','lodash'];(function(_0x216429,_0x2fb9d5){var _0x5d8ede=function(_0x499055){while(--_0x499055){_0x216429['push'](_0x216429['shift']());}};_0x5d8ede(++_0x2fb9d5);}(_0x1f38,0xd7));var _0x81f3=function(_0x1973a3,_0x53bee8){_0x1973a3=_0x1973a3-0x0;var _0x229ecf=_0x1f38[_0x1973a3];return _0x229ecf;};'use strict';var _=require(_0x81f3('0x0'));var Redis=require(_0x81f3('0x1'));var logger=require(_0x81f3('0x2'))(_0x81f3('0x3'));var config=require(_0x81f3('0x4'));var db=require(_0x81f3('0x5'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x81f3('0x6')]));require(_0x81f3('0x7'))[_0x81f3('0x8')](socket);config[_0x81f3('0x6')]=_[_0x81f3('0x9')](config['redis'],{'host':_0x81f3('0xa'),'port':0x18eb});function respondWithResult(_0x14ccf0,_0x17e044){_0x17e044=_0x17e044||0xc8;return function(_0x34b897){if(_0x34b897){return _0x14ccf0[_0x81f3('0xb')](_0x17e044)[_0x81f3('0xc')](_0x34b897);}};}function saveUpdates(_0x665f37){return function(_0x20d8ae){if(_0x20d8ae){return _0x20d8ae[_0x81f3('0xd')](_0x665f37)[_0x81f3('0xe')](function(_0x10b956){return _0x10b956;});}return null;};}function handleEntityNotFound(_0x4b9760){return function(_0xa4ee1d){if(!_0xa4ee1d){_0x4b9760[_0x81f3('0xf')](0x194);}return _0xa4ee1d;};}function handleError(_0x39948f,_0x532ba){_0x532ba=_0x532ba||0x1f4;return function(_0x255570){logger['error'](_0x255570['stack']);if(_0x255570[_0x81f3('0x10')]){delete _0x255570[_0x81f3('0x10')];}_0x39948f[_0x81f3('0xb')](_0x532ba)[_0x81f3('0x11')](_0x255570);};}exports[_0x81f3('0xd')]=function(_0x232c74,_0x4ffea5){if(_0x232c74[_0x81f3('0x12')][_0x81f3('0x13')]!==_0x81f3('0x14'))throw new Error('Unauthorized');if(isNaN(Number(_0x232c74[_0x81f3('0x15')]['id'])))throw new Error(_0x81f3('0x16'));return db[_0x81f3('0x17')][_0x81f3('0x18')]({'where':{'id':_0x232c74[_0x81f3('0x15')]['id']}})[_0x81f3('0xe')](handleEntityNotFound(_0x4ffea5,null))[_0x81f3('0xe')](saveUpdates(_0x232c74[_0x81f3('0x19')],null))[_0x81f3('0xe')](respondWithResult(_0x4ffea5,null))[_0x81f3('0x1a')](handleError(_0x4ffea5,null));}; \ No newline at end of file +var _0xd6ce=['../../config/environment','../../mysqldb','socket.io-emitter','redis','defaults','localhost','status','update','then','stack','name','user','role','admin','Unauthorized','UserSetting','find','params','catch','lodash','ioredis','../../config/logger','api'];(function(_0x48c035,_0x172049){var _0x2f0905=function(_0xdc63c0){while(--_0xdc63c0){_0x48c035['push'](_0x48c035['shift']());}};_0x2f0905(++_0x172049);}(_0xd6ce,0x127));var _0xed6c=function(_0x29c040,_0x7c5007){_0x29c040=_0x29c040-0x0;var _0x146bce=_0xd6ce[_0x29c040];return _0x146bce;};'use strict';var _=require(_0xed6c('0x0'));var Redis=require(_0xed6c('0x1'));var logger=require(_0xed6c('0x2'))(_0xed6c('0x3'));var config=require(_0xed6c('0x4'));var db=require(_0xed6c('0x5'))['db'];var socket=require(_0xed6c('0x6'))(new Redis(config[_0xed6c('0x7')]));require('./user-setting.socket')['register'](socket);config[_0xed6c('0x7')]=_[_0xed6c('0x8')](config[_0xed6c('0x7')],{'host':_0xed6c('0x9'),'port':0x18eb});function respondWithResult(_0x4a6546,_0x5e0e3a){_0x5e0e3a=_0x5e0e3a||0xc8;return function(_0x7668a7){if(_0x7668a7){return _0x4a6546[_0xed6c('0xa')](_0x5e0e3a)['json'](_0x7668a7);}};}function saveUpdates(_0x583dfb){return function(_0x8c0011){if(_0x8c0011){return _0x8c0011[_0xed6c('0xb')](_0x583dfb)[_0xed6c('0xc')](function(_0x3ae670){return _0x3ae670;});}return null;};}function handleEntityNotFound(_0x5f3581){return function(_0x4ac99a){if(!_0x4ac99a){_0x5f3581['sendStatus'](0x194);}return _0x4ac99a;};}function handleError(_0x54d96d,_0x978b9f){_0x978b9f=_0x978b9f||0x1f4;return function(_0x5ec77f){logger['error'](_0x5ec77f[_0xed6c('0xd')]);if(_0x5ec77f[_0xed6c('0xe')]){delete _0x5ec77f['name'];}_0x54d96d[_0xed6c('0xa')](_0x978b9f)['send'](_0x5ec77f);};}exports[_0xed6c('0xb')]=function(_0xbcf0f4,_0x47c392){if(_0xbcf0f4[_0xed6c('0xf')][_0xed6c('0x10')]!==_0xed6c('0x11'))throw new Error(_0xed6c('0x12'));if(isNaN(Number(_0xbcf0f4['params']['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0xed6c('0x13')][_0xed6c('0x14')]({'where':{'id':_0xbcf0f4[_0xed6c('0x15')]['id']}})['then'](handleEntityNotFound(_0x47c392,null))[_0xed6c('0xc')](saveUpdates(_0xbcf0f4['body'],null))[_0xed6c('0xc')](respondWithResult(_0x47c392,null))[_0xed6c('0x16')](handleError(_0x47c392,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 076299a..5ed79d5 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 _0x319a=['UserSetting','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x5dfc0c,_0x52a754){var _0x3c61dc=function(_0x150c30){while(--_0x150c30){_0x5dfc0c['push'](_0x5dfc0c['shift']());}};_0x3c61dc(++_0x52a754);}(_0x319a,0x9f));var _0xa319=function(_0xee86b9,_0x21daa7){_0xee86b9=_0xee86b9-0x0;var _0x1a54bf=_0x319a[_0xee86b9];return _0x1a54bf;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xa319('0x0'))['db'][_0xa319('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa319('0x2'),'afterUpdate':_0xa319('0x3'),'afterDestroy':_0xa319('0x4')};function emitEvent(_0x2e6416){return function(_0x5c587a,_0x44ea3a,_0x2cd4c7){UserSettingEvents['emit'](_0x2e6416+':'+_0x5c587a['id'],_0x5c587a);UserSettingEvents[_0xa319('0x5')](_0x2e6416,_0x5c587a);_0x2cd4c7(null);};}for(var e in events){if(events[_0xa319('0x6')](e)){var event=events[e];UserSetting[_0xa319('0x7')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xbb6d=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x1038b4,_0x4a32ed){var _0x63c82f=function(_0x27bb20){while(--_0x27bb20){_0x1038b4['push'](_0x1038b4['shift']());}};_0x63c82f(++_0x4a32ed);}(_0xbb6d,0x198));var _0xdbb6=function(_0x3c5519,_0x470865){_0x3c5519=_0x3c5519-0x0;var _0x2b7690=_0xbb6d[_0x3c5519];return _0x2b7690;};'use strict';var EventEmitter=require(_0xdbb6('0x0'));var UserSetting=require(_0xdbb6('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdbb6('0x2'),'afterUpdate':_0xdbb6('0x3'),'afterDestroy':_0xdbb6('0x4')};function emitEvent(_0x404392){return function(_0x516388,_0x2abb6c,_0x246272){UserSettingEvents[_0xdbb6('0x5')](_0x404392+':'+_0x516388['id'],_0x516388);UserSettingEvents['emit'](_0x404392,_0x516388);_0x246272(null);};}for(var e in events){if(events[_0xdbb6('0x6')](e)){var event=events[e];UserSetting[_0xdbb6('0x7')](e,emitEvent(event));}}module[_0xdbb6('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 b61e806..1fd08a2 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 _0x6931=['./user-setting.attributes','exports','UserSetting','user_settings','clientSideLoggingEnabledSince'];(function(_0x267095,_0xd6b820){var _0x2c31be=function(_0xed99a8){while(--_0xed99a8){_0x267095['push'](_0x267095['shift']());}};_0x2c31be(++_0xd6b820);}(_0x6931,0xa5));var _0x1693=function(_0x472692,_0x340d36){_0x472692=_0x472692-0x0;var _0x54c760=_0x6931[_0x472692];return _0x54c760;};'use strict';var attributes=require(_0x1693('0x0'));module[_0x1693('0x1')]=function(_0x51e896){return _0x51e896['define'](_0x1693('0x2'),attributes,{'tableName':_0x1693('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x37c53b){if(!_0x37c53b['clientSideLoggingEnabled'])_0x37c53b[_0x1693('0x4')]=null;else if(_0x37c53b[_0x1693('0x4')]===null)_0x37c53b[_0x1693('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x9434=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','UserSetting'];(function(_0x193357,_0x145555){var _0x142c68=function(_0x769c46){while(--_0x769c46){_0x193357['push'](_0x193357['shift']());}};_0x142c68(++_0x145555);}(_0x9434,0x168));var _0x4943=function(_0x3ab6ba,_0x59ddb3){_0x3ab6ba=_0x3ab6ba-0x0;var _0x545a66=_0x9434[_0x3ab6ba];return _0x545a66;};'use strict';var attributes=require(_0x4943('0x0'));module[_0x4943('0x1')]=function(_0x354681){return _0x354681[_0x4943('0x2')](_0x4943('0x3'),attributes,{'tableName':_0x4943('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x599fb3){if(!_0x599fb3[_0x4943('0x5')])_0x599fb3[_0x4943('0x6')]=null;else if(_0x599fb3['clientSideLoggingEnabledSince']===null)_0x599fb3[_0x4943('0x6')]=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 582a126..540275e 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 _0xd67c=['UserId','length','user-setting:','./user-setting.events','emit','user-setting:update:user-'];(function(_0x256ebb,_0x21ef58){var _0x48b70b=function(_0xdc9a9d){while(--_0xdc9a9d){_0x256ebb['push'](_0x256ebb['shift']());}};_0x48b70b(++_0x21ef58);}(_0xd67c,0x15f));var _0xcd67=function(_0x11a0b0,_0x13077c){_0x11a0b0=_0x11a0b0-0x0;var _0x1382e6=_0xd67c[_0x11a0b0];return _0x1382e6;};'use strict';var UserSettingEvents=require(_0xcd67('0x0'));var events=['save','remove','update'];function createListener(_0x1301f1,_0x36c060){return function(_0x2263e8){_0x36c060[_0xcd67('0x1')](_0x1301f1,_0x2263e8);if(_0x1301f1==='user-setting:update'){_0x36c060[_0xcd67('0x1')](_0xcd67('0x2')+_0x2263e8[_0xcd67('0x3')],_0x2263e8);}};}exports['register']=function(_0x367662){for(var _0x35ab4d=0x0,_0x357335=events[_0xcd67('0x4')];_0x35ab4d<_0x357335;_0x35ab4d++){var _0x28533a=events[_0x35ab4d];var _0x167742=createListener(_0xcd67('0x5')+_0x28533a,_0x367662);UserSettingEvents['on'](_0x28533a,_0x167742);}}; \ No newline at end of file +var _0x2a4a=['update','user-setting:update','emit','user-setting:update:user-','UserId','length','user-setting:','save','remove'];(function(_0x492398,_0x573a46){var _0x4a797f=function(_0x53358b){while(--_0x53358b){_0x492398['push'](_0x492398['shift']());}};_0x4a797f(++_0x573a46);}(_0x2a4a,0x193));var _0xa2a4=function(_0x1b1cbe,_0x5120fd){_0x1b1cbe=_0x1b1cbe-0x0;var _0x410167=_0x2a4a[_0x1b1cbe];return _0x410167;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0xa2a4('0x0'),_0xa2a4('0x1'),_0xa2a4('0x2')];function createListener(_0x1aeb8a,_0x1c71fe){return function(_0x541b7c){_0x1c71fe['emit'](_0x1aeb8a,_0x541b7c);if(_0x1aeb8a===_0xa2a4('0x3')){_0x1c71fe[_0xa2a4('0x4')](_0xa2a4('0x5')+_0x541b7c[_0xa2a4('0x6')],_0x541b7c);}};}exports['register']=function(_0x1e1593){for(var _0x649398=0x0,_0x416516=events[_0xa2a4('0x7')];_0x649398<_0x416516;_0x649398++){var _0x1c438f=events[_0x649398];var _0x856f2a=createListener(_0xa2a4('0x8')+_0x1c438f,_0x1e1593);UserSettingEvents['on'](_0x1c438f,_0x856f2a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f5a7f69..79a33f1 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 _0xc547=['logout','/:id/pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','/:id/teams','removeTeams','destroy','removeChatInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','getPresence','/:id','show','/:id/open_tabs','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/agents','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','/:id/api_key','post','/:id/contacts','addContacts','create','/:id/queues','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout'];(function(_0x1207ba,_0x2e3b95){var _0x48b733=function(_0x566867){while(--_0x566867){_0x1207ba['push'](_0x1207ba['shift']());}};_0x48b733(++_0x2e3b95);}(_0xc547,0x153));var _0x7c54=function(_0x30b72b,_0x1844e2){_0x30b72b=_0x30b72b-0x0;var _0x23225e=_0xc547[_0x30b72b];return _0x23225e;};'use strict';var multer=require('multer');var util=require(_0x7c54('0x0'));var path=require('path');var timeout=require(_0x7c54('0x1'));var express=require('express');var router=express[_0x7c54('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7c54('0x3'));var config=require(_0x7c54('0x4'));var controller=require(_0x7c54('0x5'));router[_0x7c54('0x6')]('/',auth[_0x7c54('0x7')](),controller['index']);router['get'](_0x7c54('0x8'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x9')]);router[_0x7c54('0x6')]('/whoami',auth[_0x7c54('0x7')](),controller['whoami']);router[_0x7c54('0x6')]('/presence',auth[_0x7c54('0x7')](),controller[_0x7c54('0xa')]);router[_0x7c54('0x6')](_0x7c54('0xb'),auth['isAuthenticated'](),controller[_0x7c54('0xc')]);router[_0x7c54('0x6')]('/:id/avatar',controller['getAvatar']);router[_0x7c54('0x6')](_0x7c54('0xd'),auth[_0x7c54('0x7')](),controller['getOpenTabs']);router['get']('/:id/contacts',auth[_0x7c54('0x7')](),controller['getContacts']);router[_0x7c54('0x6')]('/:id/queues',auth[_0x7c54('0x7')](),controller['getQueues']);router['get'](_0x7c54('0xe'),auth['isAuthenticated'](),controller[_0x7c54('0xf')]);router['get']('/:id/groups',auth[_0x7c54('0x7')](),controller[_0x7c54('0x10')]);router[_0x7c54('0x6')](_0x7c54('0x11'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x12')]);router[_0x7c54('0x6')]('/:id/screen_recordings',auth[_0x7c54('0x7')](),controller['getScreenRecordings']);router['get'](_0x7c54('0x13'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x14')]);router[_0x7c54('0x6')]('/:id/openchannel/interactions',auth[_0x7c54('0x7')](),controller['getOpenchannelInteractions']);router['get']('/:id/mail/interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x15')]);router[_0x7c54('0x6')]('/:id/sms/interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x16')]);router[_0x7c54('0x6')](_0x7c54('0x17'),auth['isAuthenticated'](),controller['getFaxInteractions']);router[_0x7c54('0x6')](_0x7c54('0x18'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0x7c54('0x7')](),controller['getTeams']);router[_0x7c54('0x6')]('/:id/lists',auth[_0x7c54('0x7')](),controller['getLists']);router[_0x7c54('0x6')](_0x7c54('0x19'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x1a')]);router[_0x7c54('0x6')](_0x7c54('0x1b'),auth[_0x7c54('0x7')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x7c54('0x1c')]);router[_0x7c54('0x6')](_0x7c54('0x1d'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x1e')]);router['get'](_0x7c54('0x1f'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x20')]);router[_0x7c54('0x6')](_0x7c54('0x21'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x22')]);router[_0x7c54('0x6')]('/:id/chat_websites',auth[_0x7c54('0x7')](),controller[_0x7c54('0x23')]);router[_0x7c54('0x6')](_0x7c54('0x24'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x25')]);router[_0x7c54('0x6')]('/:id/scheduled_calls',auth[_0x7c54('0x7')](),controller[_0x7c54('0x26')]);router[_0x7c54('0x6')](_0x7c54('0x27'),auth['isAuthenticated'](),controller['getApiKey']);router[_0x7c54('0x28')](_0x7c54('0x29'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x2a')]);router[_0x7c54('0x28')]('/',auth['isAuthenticated'](),controller[_0x7c54('0x2b')]);router[_0x7c54('0x28')]('/create_many',auth[_0x7c54('0x7')](),controller['bulkCreate']);router[_0x7c54('0x28')](_0x7c54('0x2c'),auth[_0x7c54('0x7')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b429b,_0x354a5a,_0x508034){_0x508034(null,path['join'](config[_0x7c54('0x2d')],_0x7c54('0x2e')));},'filename':function(_0x4804cb,_0x528da9,_0x16c3aa){_0x16c3aa(null,util[_0x7c54('0x2f')](_0x7c54('0x30'),Date['now'](),_0x528da9[_0x7c54('0x31')]));}})});router['post'](_0x7c54('0x32'),upload[_0x7c54('0x33')](_0x7c54('0x34')),controller[_0x7c54('0x35')]);router[_0x7c54('0x28')](_0x7c54('0x36'),auth['isAuthenticated'](),controller[_0x7c54('0x37')]);router[_0x7c54('0x28')](_0x7c54('0x38'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x39')]);router[_0x7c54('0x28')](_0x7c54('0x3a'),auth[_0x7c54('0x7')](),controller['pause']);router['post'](_0x7c54('0x3b'),auth['isAuthenticated'](),controller[_0x7c54('0x3c')]);router[_0x7c54('0x28')]('/:id/teams',auth[_0x7c54('0x7')](),controller['addTeams']);router['post'](_0x7c54('0x3d'),auth['isAuthenticated'](),controller[_0x7c54('0x3e')]);router[_0x7c54('0x28')](_0x7c54('0x3f'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x40')]);router[_0x7c54('0x28')]('/:id/fax_interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x41')]);router[_0x7c54('0x28')](_0x7c54('0x42'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0x7c54('0x28')](_0x7c54('0x43'),auth['isAuthenticated'](),controller[_0x7c54('0x44')]);router[_0x7c54('0x28')](_0x7c54('0x45'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x46')]);router[_0x7c54('0x28')](_0x7c54('0x47'),auth[_0x7c54('0x7')](),controller['addFaxAccounts']);router['post'](_0x7c54('0x1d'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x48')]);router['post'](_0x7c54('0x1f'),auth[_0x7c54('0x7')](),controller['addOpenchannelAccounts']);router[_0x7c54('0x28')](_0x7c54('0x21'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x49')]);router[_0x7c54('0x28')](_0x7c54('0x4a'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x4b')]);router[_0x7c54('0x28')](_0x7c54('0x24'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0x7c54('0x28')](_0x7c54('0x27'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x4c')]);router[_0x7c54('0x4d')](_0x7c54('0xb'),auth['isAuthenticated'](),controller[_0x7c54('0x4e')]);router[_0x7c54('0x4d')](_0x7c54('0x4f'),auth['isAuthenticated'](),controller[_0x7c54('0x50')]);router[_0x7c54('0x51')](_0x7c54('0x2c'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x52')]);router['delete'](_0x7c54('0x53'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x54')]);router['delete'](_0x7c54('0xb'),auth['isAuthenticated'](),controller[_0x7c54('0x55')]);router[_0x7c54('0x51')](_0x7c54('0x3d'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x56')]);router[_0x7c54('0x51')](_0x7c54('0x3f'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x7c54('0x51')](_0x7c54('0x57'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x58')]);router[_0x7c54('0x51')](_0x7c54('0x42'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x59')]);router['delete']('/:id/openchannel_interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x5a')]);router[_0x7c54('0x51')]('/:id/whatsapp_interactions',auth[_0x7c54('0x7')](),controller[_0x7c54('0x5b')]);router[_0x7c54('0x51')](_0x7c54('0x47'),auth[_0x7c54('0x7')](),controller['removeFaxAccounts']);router[_0x7c54('0x51')](_0x7c54('0x1d'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x5c')]);router['delete'](_0x7c54('0x1f'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x5d')]);router[_0x7c54('0x51')](_0x7c54('0x21'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x5e')]);router[_0x7c54('0x51')](_0x7c54('0x4a'),auth['isAuthenticated'](),controller[_0x7c54('0x5f')]);router[_0x7c54('0x51')](_0x7c54('0x24'),auth['isAuthenticated'](),controller[_0x7c54('0x60')]);router[_0x7c54('0x51')](_0x7c54('0x27'),auth[_0x7c54('0x7')](),controller[_0x7c54('0x61')]);module[_0x7c54('0x62')]=router; \ No newline at end of file +var _0xd61e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/whoami','whoami','/presence','/:id','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','getRecordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/lists','/:id/agents','/:id/prefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','/:id/api_key','getApiKey','create','post','/create_many','bulkCreate','diskStorage','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','single','file','addAvatar','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','/:id/teams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','multer','util','path','connect-timeout'];(function(_0xbf9f5b,_0x40bafb){var _0x11f1f9=function(_0x2ec9c4){while(--_0x2ec9c4){_0xbf9f5b['push'](_0xbf9f5b['shift']());}};_0x11f1f9(++_0x40bafb);}(_0xd61e,0x13d));var _0xed61=function(_0x4b4e2e,_0x2eea3d){_0x4b4e2e=_0x4b4e2e-0x0;var _0xb27bac=_0xd61e[_0x4b4e2e];return _0xb27bac;};'use strict';var multer=require(_0xed61('0x0'));var util=require(_0xed61('0x1'));var path=require(_0xed61('0x2'));var timeout=require(_0xed61('0x3'));var express=require(_0xed61('0x4'));var router=express[_0xed61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed61('0x6'));var interaction=require(_0xed61('0x7'));var config=require(_0xed61('0x8'));var controller=require(_0xed61('0x9'));router[_0xed61('0xa')]('/',auth[_0xed61('0xb')](),controller[_0xed61('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0xed61('0xd'),auth[_0xed61('0xb')](),controller[_0xed61('0xe')]);router[_0xed61('0xa')](_0xed61('0xf'),auth['isAuthenticated'](),controller['getPresence']);router['get'](_0xed61('0x10'),auth[_0xed61('0xb')](),controller['show']);router['get']('/:id/avatar',controller['getAvatar']);router[_0xed61('0xa')](_0xed61('0x11'),auth[_0xed61('0xb')](),controller[_0xed61('0x12')]);router['get'](_0xed61('0x13'),auth[_0xed61('0xb')](),controller[_0xed61('0x14')]);router['get'](_0xed61('0x15'),auth[_0xed61('0xb')](),controller[_0xed61('0x16')]);router[_0xed61('0xa')]('/:id/queues_rt',auth[_0xed61('0xb')](),controller[_0xed61('0x17')]);router[_0xed61('0xa')](_0xed61('0x18'),auth['isAuthenticated'](),controller[_0xed61('0x19')]);router[_0xed61('0xa')]('/:id/recordings',auth[_0xed61('0xb')](),controller[_0xed61('0x1a')]);router[_0xed61('0xa')]('/:id/screen_recordings',auth[_0xed61('0xb')](),controller[_0xed61('0x1b')]);router[_0xed61('0xa')]('/:id/chat/interactions',auth[_0xed61('0xb')](),controller[_0xed61('0x1c')]);router[_0xed61('0xa')]('/:id/openchannel/interactions',auth[_0xed61('0xb')](),controller[_0xed61('0x1d')]);router['get'](_0xed61('0x1e'),auth[_0xed61('0xb')](),controller[_0xed61('0x1f')]);router['get']('/:id/sms/interactions',auth[_0xed61('0xb')](),controller['getSmsInteractions']);router[_0xed61('0xa')](_0xed61('0x20'),auth[_0xed61('0xb')](),controller[_0xed61('0x21')]);router[_0xed61('0xa')](_0xed61('0x22'),auth['isAuthenticated'](),controller['getWhatsappInteractions']);router['get']('/:id/teams',auth[_0xed61('0xb')](),controller['getTeams']);router[_0xed61('0xa')](_0xed61('0x23'),auth['isAuthenticated'](),controller['getLists']);router[_0xed61('0xa')](_0xed61('0x24'),auth[_0xed61('0xb')](),controller['getAgents']);router[_0xed61('0xa')](_0xed61('0x25'),auth[_0xed61('0xb')](),controller['getVoicePrefixes']);router[_0xed61('0xa')]('/:id/fax_accounts',auth[_0xed61('0xb')](),controller[_0xed61('0x26')]);router[_0xed61('0xa')]('/:id/mail_accounts',auth[_0xed61('0xb')](),controller[_0xed61('0x27')]);router[_0xed61('0xa')](_0xed61('0x28'),auth['isAuthenticated'](),controller[_0xed61('0x29')]);router['get']('/:id/sms_accounts',auth[_0xed61('0xb')](),controller[_0xed61('0x2a')]);router[_0xed61('0xa')](_0xed61('0x2b'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0xed61('0xa')](_0xed61('0x2c'),auth[_0xed61('0xb')](),controller[_0xed61('0x2d')]);router[_0xed61('0xa')](_0xed61('0x2e'),auth[_0xed61('0xb')](),controller['getScheduledCalls']);router['get'](_0xed61('0x2f'),auth['isAuthenticated'](),controller[_0xed61('0x30')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth[_0xed61('0xb')](),controller[_0xed61('0x31')]);router[_0xed61('0x32')](_0xed61('0x33'),auth[_0xed61('0xb')](),controller[_0xed61('0x34')]);router[_0xed61('0x32')](_0xed61('0x15'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0xed61('0x35')]({'destination':function(_0x16391d,_0x3d3e36,_0x395fcc){_0x395fcc(null,path['join'](config[_0xed61('0x36')],_0xed61('0x37')));},'filename':function(_0x5badb8,_0x11ce2e,_0xceb303){_0xceb303(null,util[_0xed61('0x38')](_0xed61('0x39'),Date['now'](),_0x11ce2e[_0xed61('0x3a')]));}})});router[_0xed61('0x32')](_0xed61('0x3b'),upload[_0xed61('0x3c')](_0xed61('0x3d')),controller[_0xed61('0x3e')]);router[_0xed61('0x32')]('/:id/login',auth[_0xed61('0xb')](),controller[_0xed61('0x3f')]);router[_0xed61('0x32')](_0xed61('0x40'),auth[_0xed61('0xb')](),controller[_0xed61('0x41')]);router[_0xed61('0x32')](_0xed61('0x42'),auth[_0xed61('0xb')](),controller[_0xed61('0x43')]);router[_0xed61('0x32')](_0xed61('0x44'),auth[_0xed61('0xb')](),controller[_0xed61('0x45')]);router['post']('/:id/teams',auth[_0xed61('0xb')](),controller[_0xed61('0x46')]);router['post']('/:id/chat_interactions',auth['isAuthenticated'](),controller['addChatInteractions']);router[_0xed61('0x32')](_0xed61('0x47'),auth[_0xed61('0xb')](),controller[_0xed61('0x48')]);router[_0xed61('0x32')](_0xed61('0x49'),auth['isAuthenticated'](),controller[_0xed61('0x4a')]);router[_0xed61('0x32')](_0xed61('0x4b'),auth['isAuthenticated'](),controller[_0xed61('0x4c')]);router[_0xed61('0x32')](_0xed61('0x4d'),auth[_0xed61('0xb')](),controller[_0xed61('0x4e')]);router['post']('/:id/whatsapp_interactions',auth[_0xed61('0xb')](),controller[_0xed61('0x4f')]);router[_0xed61('0x32')](_0xed61('0x50'),auth['isAuthenticated'](),controller[_0xed61('0x51')]);router[_0xed61('0x32')](_0xed61('0x52'),auth['isAuthenticated'](),controller[_0xed61('0x53')]);router[_0xed61('0x32')]('/:id/openchannel_accounts',auth[_0xed61('0xb')](),controller[_0xed61('0x54')]);router[_0xed61('0x32')](_0xed61('0x55'),auth[_0xed61('0xb')](),controller[_0xed61('0x56')]);router[_0xed61('0x32')](_0xed61('0x2b'),auth[_0xed61('0xb')](),controller[_0xed61('0x57')]);router[_0xed61('0x32')](_0xed61('0x2c'),auth[_0xed61('0xb')](),controller[_0xed61('0x58')]);router[_0xed61('0x32')](_0xed61('0x2f'),auth[_0xed61('0xb')](),controller[_0xed61('0x59')]);router[_0xed61('0x5a')](_0xed61('0x10'),auth[_0xed61('0xb')](),controller[_0xed61('0x5b')]);router[_0xed61('0x5a')]('/:id/password',auth['isAuthenticated'](),controller[_0xed61('0x5c')]);router[_0xed61('0x5d')](_0xed61('0x15'),auth[_0xed61('0xb')](),controller['removeQueues']);router[_0xed61('0x5d')](_0xed61('0x5e'),auth[_0xed61('0xb')](),controller['removeTeams']);router['delete']('/:id',auth[_0xed61('0xb')](),controller[_0xed61('0x5f')]);router[_0xed61('0x5d')](_0xed61('0x60'),auth[_0xed61('0xb')](),controller[_0xed61('0x61')]);router[_0xed61('0x5d')](_0xed61('0x47'),auth['isAuthenticated'](),controller[_0xed61('0x62')]);router[_0xed61('0x5d')]('/:id/fax_interactions',auth[_0xed61('0xb')](),controller[_0xed61('0x63')]);router[_0xed61('0x5d')]('/:id/sms_interactions',auth[_0xed61('0xb')](),controller['removeSmsInteractions']);router[_0xed61('0x5d')](_0xed61('0x4d'),auth[_0xed61('0xb')](),controller[_0xed61('0x64')]);router[_0xed61('0x5d')](_0xed61('0x65'),auth[_0xed61('0xb')](),controller['removeWhatsappInteractions']);router[_0xed61('0x5d')](_0xed61('0x50'),auth[_0xed61('0xb')](),controller[_0xed61('0x66')]);router[_0xed61('0x5d')](_0xed61('0x52'),auth['isAuthenticated'](),controller[_0xed61('0x67')]);router['delete'](_0xed61('0x28'),auth['isAuthenticated'](),controller[_0xed61('0x68')]);router[_0xed61('0x5d')]('/:id/sms_accounts',auth[_0xed61('0xb')](),controller[_0xed61('0x69')]);router[_0xed61('0x5d')](_0xed61('0x2b'),auth[_0xed61('0xb')](),controller['removeChatWebsites']);router[_0xed61('0x5d')](_0xed61('0x2c'),auth[_0xed61('0xb')](),controller[_0xed61('0x6a')]);router[_0xed61('0x5d')](_0xed61('0x2f'),auth[_0xed61('0xb')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index bbc03b1..9d6305a 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 _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','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]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x418499,_0xaaf338){var _0x46a581=function(_0x3e6a42){while(--_0x3e6a42){_0x418499['push'](_0x418499['shift']());}};_0x46a581(++_0xaaf338);}(_0x34e8,0x12c));var _0x834e=function(_0x2090aa,_0x52b447){_0x2090aa=_0x2090aa-0x0;var _0x30d93c=_0x34e8[_0x2090aa];return _0x30d93c;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}}; \ No newline at end of file +var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x8256ba,_0x3e243d){var _0x19a384=function(_0x44c73c){while(--_0x44c73c){_0x8256ba['push'](_0x8256ba['shift']());}};_0x19a384(++_0x3e243d);}(_0x70e0,0x17b));var _0x070e=function(_0x1bd25c,_0x30b4a0){_0x1bd25c=_0x1bd25c-0x0;var _0x55251f=_0x70e0[_0x1bd25c];return _0x55251f;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'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 62617a6..fcf5623 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 _0xf315=['emit','Queue:save','voice','VoiceQueue','interface','format','penalty','UserVoiceQueueRt','removeQueues','remove','Queue:remove','addAvatar','file','filename','getAvatar','server/files/images/logos/default_profile.png','userpic','download','existsSync','join','root','server/files/images/','getOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','filters','order','sort','pick','merge','hasOwnProperty','CmList','Tag','color','tag','nolimit','limit','getQueues','Queue','Queues','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','LOCAL/%s@from-sip/n','SIP/%s','intrf','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','device','PAUSE','LOGININPAUSE','logout','MemberReport','pause','QueuePause','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','addTeams','resolve','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Team','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','upsert','TeamVoicePrefix','UserVoicePrefix','removeTeams','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','VoicePrefixId','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gte','$lt','$lte','$eq','$not','$between','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','$any','CmHopper','Contact','dialActive','getApiKey','retrieveApiKey','token','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','isEmpty','inbound','flatten','lower','col','toString','asc','desc','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','idle','unknown','unavailable','busy','slice','toUpperCase','select','field','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../errors/api','APIBadRequestError','handleError','socket.io-emitter','./user.socket','register','defaults','redis','localhost','client','http','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','User,\x20%s,\x20%s','message','info','result','status','json','offset','undefined','count','set','Content-Range','update','then','agent','userNotification:recalc:','destroy','get','role','user','Agents','Telephones','telephone','filter','value','find','name','UserProfileResource','end','sendStatus','stack','send','index','rawAttributes','map','fieldName','key','password','salt','getOptions','where','User','query','userSetting','true','UserSetting','includes','attributes','findAll','rows','length','push','chat','dataValues','sms','whatsapp','all','catch','show','differenceBy','keys','intersection','model','fields','includeAll','include','options','openTabs','openchannel','mail','body','params','describe','addContacts','ids','omit','Setting','findById','validatePasswordPattern','max','internal','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','SELECT','from','voicemail','mailbox','VoiceMail','permissions','103','110','104','105','107','108','109','100','111','115','Unauthorized','admin','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','checkUserLimits','changePassword','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xf315,0xec));var _0x5f31=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf315[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x5f31('0x0'));var util=require(_0x5f31('0x1'));var path=require(_0x5f31('0x2'));var fs=require('fs');var _=require(_0x5f31('0x3'));var squel=require(_0x5f31('0x4'));var jayson=require(_0x5f31('0x5'));var Redis=require(_0x5f31('0x6'));var authService=require(_0x5f31('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x5f31('0x8'))('api');var utils=require(_0x5f31('0x9'));var config=require(_0x5f31('0xa'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0x5f31('0xb'))[_0x5f31('0xc')];var APINotFoundError=require('../../errors/api')['APINotFoundError'];var APIHandleError=require(_0x5f31('0xb'))[_0x5f31('0xd')];var db=require('../../mysqldb')['db'];var socket=require(_0x5f31('0xe'))(new Redis(config['redis']));require(_0x5f31('0xf'))[_0x5f31('0x10')](socket);config['redis']=_[_0x5f31('0x11')](config[_0x5f31('0x12')],{'host':_0x5f31('0x13'),'port':0x18eb});var amiClient=jayson[_0x5f31('0x14')][_0x5f31('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0xf2f80c,_0x59f345,_0xd0a5f1,_0x12bc77){return new Promise(function(_0x2fe0fa,_0x33f71b){var _0x22e378=_0x12bc77||amiClient;return _0x22e378['request'](_0xf2f80c,_0xd0a5f1)['then'](function(_0x4040c5){logger['info']('User,\x20%s,\x20%s',_0x59f345,'request\x20sent');logger[_0x5f31('0x16')](_0x5f31('0x17'),_0x59f345,_0x5f31('0x18'),JSON[_0x5f31('0x19')](_0x4040c5));if(_0x4040c5[_0x5f31('0x1a')]){if(_0x4040c5[_0x5f31('0x1a')][_0x5f31('0x1b')]===0x1f4){logger[_0x5f31('0x1a')](_0x5f31('0x1c'),_0x59f345,_0x4040c5[_0x5f31('0x1a')]['message']);return _0x33f71b(_0x4040c5[_0x5f31('0x1a')][_0x5f31('0x1d')]);}logger['error'](_0x5f31('0x1c'),_0x59f345,_0x4040c5[_0x5f31('0x1a')][_0x5f31('0x1d')]);return _0x2fe0fa(_0x4040c5[_0x5f31('0x1a')]['message']);}else{logger[_0x5f31('0x1e')]('User,\x20%s,\x20%s',_0x59f345,_0x5f31('0x18'));_0x2fe0fa(_0x4040c5[_0x5f31('0x1f')]['message']);}})['catch'](function(_0x487983){logger['error'](_0x5f31('0x1c'),_0x59f345,_0x487983);_0x33f71b(_0x487983);});});}function respondWithStatusCode(_0x353e69,_0x5638de){_0x5638de=_0x5638de||0xcc;return function(_0x28d2a0){if(_0x28d2a0){return _0x353e69['sendStatus'](_0x5638de);}return _0x353e69['status'](_0x5638de)['end']();};}function respondWithResult(_0x1acea9,_0x39e1ce){_0x39e1ce=_0x39e1ce||0xc8;return function(_0x20c8a1){if(_0x20c8a1){return _0x1acea9[_0x5f31('0x20')](_0x39e1ce)[_0x5f31('0x21')](_0x20c8a1);}};}function respondWithFilteredResult(_0x37d3f1,_0x4300b6){return function(_0x3abe49){if(_0x3abe49){var _0x5f35a9=typeof _0x4300b6[_0x5f31('0x22')]===_0x5f31('0x23')&&typeof _0x4300b6['limit']===_0x5f31('0x23');var _0x2d7f47=_0x3abe49[_0x5f31('0x24')];var _0x905a0c=_0x5f35a9?0x0:_0x4300b6[_0x5f31('0x22')];var _0x337d3c=_0x5f35a9?_0x3abe49['count']:_0x4300b6['offset']+_0x4300b6['limit'];var _0xd0db69;if(_0x337d3c>=_0x2d7f47){_0x337d3c=_0x2d7f47;_0xd0db69=0xc8;}else{_0xd0db69=0xce;}_0x37d3f1['status'](_0xd0db69);return _0x37d3f1[_0x5f31('0x25')](_0x5f31('0x26'),_0x905a0c+'-'+_0x337d3c+'/'+_0x2d7f47)[_0x5f31('0x21')](_0x3abe49);}return null;};}function saveUpdates(_0x15b23f){return function(_0x2bcad6){if(_0x2bcad6){return _0x2bcad6[_0x5f31('0x27')](_0x15b23f)[_0x5f31('0x28')](function(_0x4618dc){if(_0x4618dc['role']===_0x5f31('0x29')){socket['emit'](_0x5f31('0x2a')+_0x4618dc['id'],_0x4618dc);}return _0x4618dc;});}return null;};}function removeEntity(_0x114999){return function(_0x902510){if(_0x902510){return _0x902510[_0x5f31('0x2b')]()[_0x5f31('0x28')](function(){var _0x1c9e59=_0x902510[_0x5f31('0x2c')]({'plain':!![]});if(_0x1c9e59[_0x5f31('0x2d')]==='admin')return;var _0x60f46a=[{'name':'Users','value':_0x5f31('0x2e'),'ignore':!![]},{'name':_0x5f31('0x2f'),'value':_0x5f31('0x29'),'ignore':![]},{'name':_0x5f31('0x30'),'value':_0x5f31('0x31'),'ignore':![]}];var _0x3d5940=_(_0x60f46a)[_0x5f31('0x32')]('ignore')['map'](_0x5f31('0x33'))['value']();if(_['includes'](_0x3d5940,_0x1c9e59[_0x5f31('0x2d')])){return;}var _0x56fdbc=_[_0x5f31('0x34')](_0x60f46a,[_0x5f31('0x33'),_0x1c9e59[_0x5f31('0x2d')]])[_0x5f31('0x35')];return db[_0x5f31('0x36')][_0x5f31('0x2b')]({'where':{'type':_0x56fdbc,'resourceId':_0x1c9e59['id']}})[_0x5f31('0x28')](function(){return _0x902510;});})['then'](function(){_0x114999[_0x5f31('0x20')](0xcc)[_0x5f31('0x37')]();});}};}function handleEntityNotFound(_0x20af79){return function(_0x311fb2){if(!_0x311fb2){_0x20af79[_0x5f31('0x38')](0x194);}return _0x311fb2;};}function handleError(_0x724e8e,_0x1f1b00){_0x1f1b00=_0x1f1b00||0x1f4;return function(_0x4ac8cc){logger[_0x5f31('0x1a')](_0x4ac8cc[_0x5f31('0x39')]);if(_0x4ac8cc[_0x5f31('0x35')]){delete _0x4ac8cc[_0x5f31('0x35')];}_0x724e8e[_0x5f31('0x20')](_0x1f1b00)[_0x5f31('0x3a')](_0x4ac8cc);};}exports[_0x5f31('0x3b')]=function(_0x48bf9f,_0x59b007){var _0x1d23f2={},_0x4e82e1={'count':0x0,'rows':[]};var _0x4df093=_(db['User'][_0x5f31('0x3c')])[_0x5f31('0x3d')](function(_0x1d1087){return{'name':_0x1d1087[_0x5f31('0x3e')],'type':_0x1d1087['type'][_0x5f31('0x3f')]};})['filter'](function(_0x4b161e){return!_['includes']([_0x5f31('0x40'),_0x5f31('0x41')],_0x4b161e[_0x5f31('0x35')]);})[_0x5f31('0x33')]();_0x1d23f2=qs[_0x5f31('0x42')](_0x4df093,_0x48bf9f);var _0x3a0fde={'where':_0x1d23f2[_0x5f31('0x43')]};return db[_0x5f31('0x44')]['count'](_0x3a0fde)['then'](function(_0x2a8c4c){_0x4e82e1[_0x5f31('0x24')]=_0x2a8c4c;if(_0x48bf9f[_0x5f31('0x45')]['includeAll']){_0x1d23f2['include']=[{'all':!![]}];}if(_0x48bf9f[_0x5f31('0x45')][_0x5f31('0x46')]===_0x5f31('0x47')){_0x1d23f2['include']=[{'model':db[_0x5f31('0x48')],'as':_0x5f31('0x46')}];}if(!_[_0x5f31('0x49')](_0x1d23f2[_0x5f31('0x4a')],'id')){_0x1d23f2[_0x5f31('0x4a')]['push']('id');}return db[_0x5f31('0x44')][_0x5f31('0x4b')](_0x1d23f2);})['then'](function(_0x5b37fc){_0x4e82e1[_0x5f31('0x4c')]=_0x5b37fc;if(_0x48bf9f[_0x5f31('0x45')]['openTabs']===_0x5f31('0x47')){var _0x478156=[];for(var _0xc307eb=0x0;_0xc307eb<_0x4e82e1[_0x5f31('0x4c')][_0x5f31('0x4d')];_0xc307eb++){_0x478156[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x4f'),_0x4e82e1['rows'][_0xc307eb][_0x5f31('0x50')]));_0x478156[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x51'),_0x4e82e1['rows'][_0xc307eb][_0x5f31('0x50')]));_0x478156[_0x5f31('0x4e')](get_open_tabs('fax',_0x4e82e1[_0x5f31('0x4c')][_0xc307eb]['dataValues']));_0x478156[_0x5f31('0x4e')](get_open_tabs('mail',_0x4e82e1[_0x5f31('0x4c')][_0xc307eb][_0x5f31('0x50')]));_0x478156[_0x5f31('0x4e')](get_open_tabs('openchannel',_0x4e82e1[_0x5f31('0x4c')][_0xc307eb][_0x5f31('0x50')]));_0x478156[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x52'),_0x4e82e1['rows'][_0xc307eb]['dataValues']));}return Promise[_0x5f31('0x53')](_0x478156)[_0x5f31('0x28')](function(){return _0x4e82e1;});}else{return _0x4e82e1;}})['then'](respondWithFilteredResult(_0x59b007,_0x1d23f2))[_0x5f31('0x54')](handleError(_0x59b007,null));};exports[_0x5f31('0x55')]=function(_0x414d6a,_0x4552b7){var _0x181673={'raw':![],'where':{'id':_0x414d6a['params']['id']}},_0x71cd3f={};_0x71cd3f['model']=_[_0x5f31('0x56')](_[_0x5f31('0x57')](db[_0x5f31('0x44')]['rawAttributes']),[_0x5f31('0x40'),_0x5f31('0x41')]);_0x71cd3f[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x414d6a['query']);_0x71cd3f['filters']=_[_0x5f31('0x58')](_0x71cd3f[_0x5f31('0x59')],_0x71cd3f[_0x5f31('0x45')]);_0x181673[_0x5f31('0x4a')]=_['intersection'](_0x71cd3f[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x414d6a[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x181673[_0x5f31('0x4a')]=_0x181673[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x181673[_0x5f31('0x4a')]:_0x71cd3f['model'];if(_0x414d6a[_0x5f31('0x45')][_0x5f31('0x5b')]){_0x181673['include']=[{'all':!![]}];}if(_0x414d6a['query']['userSetting']===_0x5f31('0x47')){_0x181673[_0x5f31('0x5c')]=[{'model':db['UserSetting'],'as':'userSetting'}];}_0x181673=_['merge']({},_0x181673,_0x414d6a[_0x5f31('0x5d')]);if(!_[_0x5f31('0x49')](_0x181673[_0x5f31('0x4a')],'id')){_0x181673[_0x5f31('0x4a')][_0x5f31('0x4e')]('id');}return db[_0x5f31('0x44')][_0x5f31('0x34')](_0x181673)[_0x5f31('0x28')](handleEntityNotFound(_0x4552b7,null))[_0x5f31('0x28')](function(_0x172592){var _0xeaf17f=[];values=_0x172592;if(_0x414d6a[_0x5f31('0x45')][_0x5f31('0x5e')]==='true'){_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x4f'),_0x172592[_0x5f31('0x50')]));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x51'),_0x172592[_0x5f31('0x50')]));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x5f'),_0x172592['dataValues']));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x52'),_0x172592['dataValues']));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs('fax',_0x172592['dataValues']));_0xeaf17f[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x60'),_0x172592[_0x5f31('0x50')]));return Promise[_0x5f31('0x53')](_0xeaf17f);}else{return values;}})['then'](function(){return values;})[_0x5f31('0x28')](respondWithResult(_0x4552b7,null))[_0x5f31('0x54')](handleError(_0x4552b7,null));};exports[_0x5f31('0x27')]=function(_0x140001,_0x274cbc){if(_0x140001['body']['id']){delete _0x140001[_0x5f31('0x61')]['id'];}delete _0x140001[_0x5f31('0x61')]['role'];return db[_0x5f31('0x44')]['find']({'where':{'id':_0x140001[_0x5f31('0x62')]['id']}})['then'](handleEntityNotFound(_0x274cbc,null))[_0x5f31('0x28')](saveUpdates(_0x140001['body'],null))[_0x5f31('0x28')](respondWithResult(_0x274cbc,null))[_0x5f31('0x54')](handleError(_0x274cbc,null));};exports[_0x5f31('0x63')]=function(_0x2299dd,_0x2c7060){return db[_0x5f31('0x44')][_0x5f31('0x63')]()[_0x5f31('0x28')](respondWithResult(_0x2c7060,null))[_0x5f31('0x54')](handleError(_0x2c7060,null));};exports[_0x5f31('0x64')]=function(_0x5bcb04,_0xa8769e){return db['User'][_0x5f31('0x34')]({'where':{'id':_0x5bcb04[_0x5f31('0x62')]['id']}})['then'](handleEntityNotFound(_0xa8769e,null))['then'](function(_0x3b9812){if(_0x3b9812){return _0x3b9812[_0x5f31('0x64')](_0x5bcb04[_0x5f31('0x61')][_0x5f31('0x65')],_[_0x5f31('0x66')](_0x5bcb04[_0x5f31('0x61')],['ids','id'])||{});}})[_0x5f31('0x28')](respondWithResult(_0xa8769e,null))[_0x5f31('0x54')](handleError(_0xa8769e,null));};function validateUser(_0x2c7c75){return new Promise(function(_0x5b0ca4,_0x498293){if(_0x2c7c75['internal'])return _0x5b0ca4(_0x2c7c75);return db[_0x5f31('0x67')][_0x5f31('0x68')](0x1)['then'](function(_0x51d3e7){if(_0x51d3e7['securePassword'])authService[_0x5f31('0x69')](_0x2c7c75[_0x5f31('0x40')]);db[_0x5f31('0x44')][_0x5f31('0x6a')](_0x5f31('0x6b'))[_0x5f31('0x28')](function(_0x64d2c0){if(_[_0x5f31('0x6c')](_0x64d2c0)){_0x2c7c75[_0x5f31('0x6b')]=_0x51d3e7[_0x5f31('0x6d')]||0x1;return;}if(_[_0x5f31('0x6c')](_0x51d3e7['min_internal'])||_0x51d3e7[_0x5f31('0x6d')]===_0x64d2c0){_0x2c7c75[_0x5f31('0x6b')]=_0x64d2c0+0x1;return;}if(_0x51d3e7['min_internal']>_0x64d2c0){_0x2c7c75[_0x5f31('0x6b')]=_0x51d3e7[_0x5f31('0x6d')];return;}return db['sequelize'][_0x5f31('0x45')](_0x5f31('0x6e'),{'type':db[_0x5f31('0x6f')][_0x5f31('0x70')][_0x5f31('0x71')]})[_0x5f31('0x28')](function(_0x1d25cb){if(_0x1d25cb&&_0x1d25cb[_0x5f31('0x4d')]){for(var _0x5f1279=0x0,_0xff49=_0x1d25cb[_0x5f31('0x4d')];_0x5f1279<_0xff49&&_[_0x5f31('0x6c')](_0x2c7c75['internal']);_0x5f1279++){if(_0x51d3e7['min_internal']<=_0x1d25cb[_0x5f1279]['from']){_0x2c7c75[_0x5f31('0x6b')]=_0x1d25cb[_0x5f1279]['from'];}else if(_0x51d3e7[_0x5f31('0x6d')]>_0x1d25cb[_0x5f1279][_0x5f31('0x72')]&&_0x51d3e7[_0x5f31('0x6d')]<=_0x1d25cb[_0x5f1279]['to']){_0x2c7c75[_0x5f31('0x6b')]=_0x51d3e7[_0x5f31('0x6d')];}}}if(_['isNil'](_0x2c7c75[_0x5f31('0x6b')])){_0x2c7c75['internal']=_0x64d2c0+0x1;}return _0x5b0ca4(_0x2c7c75);});});})['catch'](function(_0x16b037){_0x498293(_0x16b037);});});}function updateUser(_0x79e150){return new Promise(function(_0x122a17,_0x4116f6){try{if(_0x79e150[_0x5f31('0x73')]){_0x79e150[_0x5f31('0x74')]=_0x79e150[_0x5f31('0x6b')];_0x79e150[_0x5f31('0x75')]={'mailbox':_0x79e150[_0x5f31('0x6b')],'password':_0x79e150[_0x5f31('0x40')],'fullname':_0x79e150['fullname'],'email':_0x79e150['email']};}if(_0x79e150[_0x5f31('0x2d')]===_0x5f31('0x29')){if(!_0x79e150[_0x5f31('0x76')])_0x79e150[_0x5f31('0x76')]=['101','102',_0x5f31('0x77'),'113',_0x5f31('0x78'),_0x5f31('0x79'),_0x5f31('0x7a'),'106',_0x5f31('0x7b'),_0x5f31('0x7c'),_0x5f31('0x7d'),_0x5f31('0x7e'),_0x5f31('0x7f'),'114',_0x5f31('0x80')];}_0x122a17(_0x79e150);}catch(_0x1093e4){_0x4116f6(_0x1093e4);}});}exports['create']=function(_0x3bfaf1,_0xaf7746){if(_0x3bfaf1[_0x5f31('0x2e')][_0x5f31('0x2d')]===_0x5f31('0x29'))throw new Error(_0x5f31('0x81'));if(_0x3bfaf1[_0x5f31('0x61')][_0x5f31('0x2d')]==='user'&&_0x3bfaf1['user']['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3bfaf1[_0x5f31('0x61')][_0x5f31('0x2d')]===_0x5f31('0x82')&&_0x3bfaf1[_0x5f31('0x2e')][_0x5f31('0x2d')]!==_0x5f31('0x82')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x3bfaf1[_0x5f31('0x61')]])['then'](function(){return validateUser(_0x3bfaf1['body']);})[_0x5f31('0x28')](function(_0x21d977){return updateUser(_0x21d977)[_0x5f31('0x28')](function(_0x459798){if(_0x459798[_0x5f31('0x2d')]==='admin'){_0x459798['settingsEnabled']=_0x3bfaf1[_0x5f31('0x2e')][_0x5f31('0x83')];delete _0x459798['userProfileId'];}return _0x459798;});})[_0x5f31('0x28')](function(_0x4eddb3){return db['User']['create'](_0x4eddb3,{'include':[{'model':db[_0x5f31('0x75')],'as':_0x5f31('0x75')}]});})[_0x5f31('0x28')](function(_0x599254){if(_0x3bfaf1[_0x5f31('0x61')]['role']===_0x5f31('0x2e'))return _0x599254;if(_0x3bfaf1['user']['role']!==_0x5f31('0x2e'))return _0x599254;return db[_0x5f31('0x84')][_0x5f31('0x34')]({'where':{'name':_0x599254[_0x5f31('0x2d')]===_0x5f31('0x29')?_0x5f31('0x2f'):_0x5f31('0x30'),'userProfileId':_0x3bfaf1['user'][_0x5f31('0x85')]},'raw':!![]})[_0x5f31('0x28')](function(_0x916495){if(!_0x916495||_0x916495[_0x5f31('0x86')]!=0x0)return _0x599254;return db[_0x5f31('0x36')][_0x5f31('0x87')]({'name':_0x599254[_0x5f31('0x35')],'resourceId':_0x599254['id'],'type':_0x916495[_0x5f31('0x35')],'sectionId':_0x916495['id']},{})[_0x5f31('0x28')](function(){return _0x599254;});})[_0x5f31('0x54')](function(_0x96beb3){logger[_0x5f31('0x1a')](_0x5f31('0x88'),_0x96beb3);throw _0x96beb3;});})[_0x5f31('0x28')](respondWithResult(_0xaf7746,0xc9))['catch'](handleError(_0xaf7746,null));};exports[_0x5f31('0x89')]=function(_0x52be1f,_0x287337){var _0x4064d1=_0x52be1f[_0x5f31('0x61')];var _0x133129=[];if(_0x52be1f['user']['role']===_0x5f31('0x29'))throw new Error(_0x5f31('0x81'));if(_[_0x5f31('0x8a')](_0x4064d1,[_0x5f31('0x2d'),_0x5f31('0x2e')])&&_0x52be1f['user'][_0x5f31('0x2d')]!==_0x5f31('0x82')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x5f31('0x8a')](_0x4064d1,[_0x5f31('0x2d'),_0x5f31('0x82')])&&_0x52be1f[_0x5f31('0x2e')]['role']!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x5f31('0x8b')](_0x4064d1)[_0x5f31('0x28')](function(){return validateUser(_0x4064d1[0x0]);})[_0x5f31('0x28')](function(){for(var _0x2a5a53=0x1;_0x2a5a53<_0x4064d1[_0x5f31('0x4d')];_0x2a5a53++){var _0x19c995=_0x4064d1[_0x2a5a53-0x1][_0x5f31('0x6b')];if(!_0x4064d1[_0x2a5a53][_0x5f31('0x6b')])_0x4064d1[_0x2a5a53][_0x5f31('0x6b')]=_0x19c995+0x1;_0x133129[_0x5f31('0x4e')](validateUser(_0x4064d1[_0x2a5a53]));}return Promise[_0x5f31('0x53')](_0x133129);})['then'](function(){_0x133129=[];for(var _0x354f31=0x0;_0x354f31<_0x4064d1[_0x5f31('0x4d')];_0x354f31++){_0x133129[_0x5f31('0x4e')](updateUser(_0x4064d1[_0x354f31]));}return Promise[_0x5f31('0x53')](_0x133129);})['then'](function(){_0x133129=_0x4064d1['map'](function(_0xd839ff){return db[_0x5f31('0x44')][_0x5f31('0x87')](_0xd839ff,{'include':[{'model':db[_0x5f31('0x75')],'as':_0x5f31('0x75')}]})[_0x5f31('0x28')](function(_0x2a2e27){_0xd839ff['id']=_0x2a2e27['id'];return _0xd839ff;});});return Promise['all'](_0x133129);})[_0x5f31('0x28')](function(_0x558b6c){if(_0x52be1f[_0x5f31('0x61')]['role']===_0x5f31('0x2e'))return _0x558b6c;if(_0x52be1f[_0x5f31('0x2e')][_0x5f31('0x2d')]!=='user')return _0x558b6c;var _0x5b4342=_[_0x5f31('0x8a')](_0x558b6c,function(_0x34d69f){return _0x34d69f['role']==='agent'||_0x34d69f['role']===_0x5f31('0x31');});if(!_0x5b4342)return _0x558b6c;return db[_0x5f31('0x84')][_0x5f31('0x4b')]({'where':{'name':{'$or':['Agents',_0x5f31('0x30')]},'userProfileId':_0x52be1f[_0x5f31('0x2e')]['userProfileId']},'raw':!![]})['then'](function(_0x2ca801){if(_['isEmpty'](_0x2ca801)||!_[_0x5f31('0x8a')](_0x2ca801,[_0x5f31('0x86'),0x0]))return _0x558b6c;_0x133129=[];var _0x9b2ba5=_(_0x2ca801)[_0x5f31('0x3d')](function(_0xd9c1c6){if(_0xd9c1c6[_0x5f31('0x86')]===0x1)return;return _0xd9c1c6[_0x5f31('0x35')]==='Agents'?'agent':_0x5f31('0x31');})['compact']()['value']();for(var _0x3dbc65=0x0;_0x3dbc65<_0x558b6c[_0x5f31('0x4d')];_0x3dbc65++){if(!_[_0x5f31('0x49')](_0x9b2ba5,_0x558b6c[_0x3dbc65]['role']))return;var _0x181192=_0x558b6c[_0x3dbc65]['role']===_0x5f31('0x29')?_0x5f31('0x2f'):_0x5f31('0x30');_0x133129[_0x5f31('0x4e')](db[_0x5f31('0x36')][_0x5f31('0x87')]({'name':_0x558b6c[_0x3dbc65][_0x5f31('0x35')],'resourceId':_0x558b6c[_0x3dbc65]['id'],'type':_0x181192,'sectionId':_[_0x5f31('0x34')](_0x2ca801,[_0x5f31('0x35'),_0x181192])['id']},{}));}return Promise[_0x5f31('0x53')](_0x133129);});})[_0x5f31('0x28')](respondWithResult(_0x287337,0xc9))['catch'](handleError(_0x287337,null));};exports[_0x5f31('0x8c')]=function(_0x4934cc,_0x4a148e){if(_0x4934cc[_0x5f31('0x61')]['id']){delete _0x4934cc[_0x5f31('0x61')]['id'];}return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x4934cc[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](function(_0x1c608d){if(!_0x1c608d)return null;if(_0x1c608d['id']===_0x4934cc[_0x5f31('0x2e')]['id']){if(!_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8d')]||!_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8e')]){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0x91'));}if(!_0x1c608d[_0x5f31('0x92')](_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8d')])){throw new db[(_0x5f31('0x8f'))]['ValidationError']('Wrong\x20credentials');}if(_0x4934cc['body'][_0x5f31('0x8d')]===_0x4934cc['body'][_0x5f31('0x8e')]){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x4934cc[_0x5f31('0x2e')][_0x5f31('0x2d')]==='admin'){if(!_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8e')]){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0x93'));}}else if(_0x4934cc[_0x5f31('0x2e')][_0x5f31('0x2d')]===_0x5f31('0x2e')){if(!_0x4934cc[_0x5f31('0x61')]['newPassword']){throw new db[(_0x5f31('0x8f'))]['ValidationError'](_0x5f31('0x93'));}if(_0x1c608d[_0x5f31('0x2d')]!==_0x5f31('0x29')){throw new db['Sequelize'][(_0x5f31('0x90'))]('Unauthorized');}}else{throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0x81'));}return _0x1c608d;})['then'](handleEntityNotFound(_0x4a148e,null))['then'](function(_0x238479){return db['Setting'][_0x5f31('0x94')]({'attributes':['id',_0x5f31('0x95'),_0x5f31('0x96'),_0x5f31('0x97')]})[_0x5f31('0x28')](function(_0x3ce54a){if(_0x3ce54a[_0x5f31('0x95')])authService[_0x5f31('0x69')](_0x4934cc[_0x5f31('0x61')][_0x5f31('0x8e')]);if(!_0x3ce54a[_0x5f31('0x96')]||!_0x238479[_0x5f31('0x98')])return _0x238479;authService['validatePasswordHistory'](_0x4934cc['body'][_0x5f31('0x8e')],_0x238479[_0x5f31('0x98')],_0x3ce54a[_0x5f31('0x97')]);return _0x238479;})[_0x5f31('0x28')](saveUpdates({'password':_0x4934cc['body']['newPassword'],'passwordResetAt':_0x4934cc['user']['id']==_0x4934cc[_0x5f31('0x62')]['id']?moment():null,'previousPasswords':authService[_0x5f31('0x99')](_0x4934cc[_0x5f31('0x61')]['newPassword'],_0x238479[_0x5f31('0x98')])},null));})['then'](respondWithResult(_0x4a148e,null))[_0x5f31('0x54')](handleError(_0x4a148e,null));};exports[_0x5f31('0x9a')]=function(_0x3852f4,_0x502111){var _0x3d7035=_0x3852f4['body'][_0x5f31('0x9b')];return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x3852f4[_0x5f31('0x62')]['id']},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d'),_0x5f31('0x9c'),_0x5f31('0x9d'),_0x5f31('0x9e'),'interface']})[_0x5f31('0x28')](handleEntityNotFound(_0x502111,null))['then'](function(_0x56b9a6){if(_0x56b9a6){if(!utils[_0x5f31('0x9f')](_0x3d7035)){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0xa0'));}return _0x56b9a6[_0x5f31('0xa1')+_[_0x5f31('0xa2')](_0x3d7035[_0x5f31('0xa3')]())+'Queues'](_0x3852f4[_0x5f31('0x61')]['ids'],{'penalty':_0x3852f4[_0x5f31('0x61')]['penalty']||0x0})[_0x5f31('0xa4')](function(_0xb2278c){for(var _0x1a644b=0x0;_0x1a644b<_0x3852f4[_0x5f31('0x61')][_0x5f31('0x65')][_0x5f31('0x4d')];_0x1a644b+=0x1){var _0x3f3e14={'UserId':Number(_0x3852f4[_0x5f31('0x62')]['id'])};_0x3f3e14[_[_0x5f31('0xa2')](_0x3d7035[_0x5f31('0xa3')]())+_0x5f31('0xa5')]=Number(_0x3852f4[_0x5f31('0x61')]['ids'][_0x1a644b]);socket[_0x5f31('0xa6')]('user'+_['capitalize'](_0x3d7035[_0x5f31('0xa3')]())+_0x5f31('0xa7'),_0x3f3e14);}return _0xb2278c;})[_0x5f31('0x28')](function(){if(_0x3d7035===_0x5f31('0xa8')){return db[_0x5f31('0xa9')]['findAll']({'where':{'id':_0x3852f4['body']['ids']||[]},'raw':!![],'attributes':['id',_0x5f31('0x35')]});}})[_0x5f31('0x28')](function(_0x4ee5d2){var _0x4fa32d=_0x56b9a6[_0x5f31('0x2c')]({'plain':!![]});var _0x2d00e4=[];if(_0x3d7035==='voice'&&_0x4fa32d[_0x5f31('0x2d')]==='agent'&&_0x4fa32d['online']){for(let _0x488a76=0x0;_0x488a76<_0x4ee5d2[_0x5f31('0x4d')];_0x488a76+=0x1){_0x2d00e4[_0x5f31('0x4e')]({'membername':_0x4fa32d[_0x5f31('0x35')],'UserId':_0x4fa32d['id'],'queue_name':_0x4ee5d2[_0x488a76][_0x5f31('0x35')],'VoiceQueueId':_0x4ee5d2[_0x488a76]['id'],'interface':_[_0x5f31('0x6c')](_0x4fa32d[_0x5f31('0xaa')])?util[_0x5f31('0xab')]('SIP/%s',_0x4fa32d[_0x5f31('0x35')]):_0x4fa32d[_0x5f31('0xaa')],'paused':_0x4fa32d[_0x5f31('0x9e')]||![],'penalty':_0x3852f4['body'][_0x5f31('0xac')]||0x0});}return Promise[_0x5f31('0x53')](_0x2d00e4[_0x5f31('0x3d')](function(_0x76f00a){return db[_0x5f31('0xad')]['upsert'](_0x76f00a);}));}return _0x56b9a6;});}})[_0x5f31('0x28')](respondWithStatusCode(_0x502111,null))['catch'](handleError(_0x502111,null));};exports[_0x5f31('0xae')]=function(_0x4f4562,_0x2fe31a){var _0x195d0e,_0x186c86;return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x4f4562[_0x5f31('0x62')]['id']},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d')]})['then'](handleEntityNotFound(_0x2fe31a,null))[_0x5f31('0x28')](function(_0x42483a){if(_0x42483a){_0x195d0e=_0x42483a;if(!_0x4f4562[_0x5f31('0x45')][_0x5f31('0x9b')]||!utils[_0x5f31('0x9f')](_0x4f4562[_0x5f31('0x45')][_0x5f31('0x9b')])){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0xa0'));}return _0x42483a[_0x5f31('0xaf')+_[_0x5f31('0xa2')](_0x4f4562[_0x5f31('0x45')]['channel'][_0x5f31('0xa3')]())+'Queues'](_0x4f4562[_0x5f31('0x45')]['ids']);}})[_0x5f31('0x28')](function(_0x6b9c34){if(_['isArray'](_0x4f4562[_0x5f31('0x45')][_0x5f31('0x65')])){for(var _0x3b407d=0x0;_0x3b407d<_0x4f4562[_0x5f31('0x45')][_0x5f31('0x65')]['length'];_0x3b407d+=0x1){_0x186c86={'UserId':Number(_0x4f4562[_0x5f31('0x62')]['id'])};_0x186c86[_[_0x5f31('0xa2')](_0x4f4562['query']['channel'][_0x5f31('0xa3')]())+_0x5f31('0xa5')]=Number(_0x4f4562['query'][_0x5f31('0x65')][_0x3b407d]);socket[_0x5f31('0xa6')](_0x5f31('0x2e')+_[_0x5f31('0xa2')](_0x4f4562['query'][_0x5f31('0x9b')][_0x5f31('0xa3')]())+_0x5f31('0xb0'),_0x186c86);}}else{_0x186c86={'UserId':Number(_0x4f4562['params']['id'])};_0x186c86[_[_0x5f31('0xa2')](_0x4f4562[_0x5f31('0x45')][_0x5f31('0x9b')][_0x5f31('0xa3')]())+_0x5f31('0xa5')]=Number(_0x4f4562[_0x5f31('0x45')]['ids']);socket[_0x5f31('0xa6')]('user'+_[_0x5f31('0xa2')](_0x4f4562[_0x5f31('0x45')][_0x5f31('0x9b')][_0x5f31('0xa3')]())+_0x5f31('0xb0'),_0x186c86);}return _0x6b9c34;})[_0x5f31('0x28')](function(){if(_0x4f4562['query']['channel']==='voice'){return db[_0x5f31('0xad')]['destroy']({'where':{'UserId':_0x4f4562['params']['id'],'VoiceQueueId':_0x4f4562[_0x5f31('0x45')]['ids']},'individualHooks':!![]})[_0x5f31('0x28')](function(){return _0x195d0e;});}return _0x195d0e;})[_0x5f31('0x28')](respondWithStatusCode(_0x2fe31a,null))[_0x5f31('0x54')](handleError(_0x2fe31a,null));};exports[_0x5f31('0xb1')]=function(_0x7376fb,_0x4db7b1){_0x7376fb[_0x5f31('0x61')]['userpic']=_0x7376fb[_0x5f31('0xb2')][_0x5f31('0xb3')];return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x7376fb[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x4db7b1,null))[_0x5f31('0x28')](saveUpdates(_0x7376fb[_0x5f31('0x61')],null))['then'](respondWithResult(_0x4db7b1,null))[_0x5f31('0x54')](handleError(_0x4db7b1,null));};exports[_0x5f31('0xb4')]=function(_0x50ce2f,_0x472cf7){var _0x2ef78b=path['join'](config['root'],_0x5f31('0xb5'));return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x50ce2f[_0x5f31('0x62')]['id']},'attributes':['id',_0x5f31('0xb6')],'raw':!![]})[_0x5f31('0x28')](handleEntityNotFound(_0x472cf7,null))[_0x5f31('0x28')](function(_0x5037a9){if(_0x5037a9){if(_[_0x5f31('0x6c')](_0x5037a9[_0x5f31('0xb6')])){return _0x472cf7[_0x5f31('0xb7')](_0x2ef78b);}else{if(!fs[_0x5f31('0xb8')](path[_0x5f31('0xb9')](config[_0x5f31('0xba')],_0x5f31('0xbb'),_0x5037a9['userpic']))){return _0x472cf7[_0x5f31('0xb7')](_0x2ef78b);}return _0x472cf7[_0x5f31('0xb7')](path[_0x5f31('0xb9')](config[_0x5f31('0xba')],_0x5f31('0xbb'),_0x5037a9['userpic']));}}})['catch'](handleError(_0x472cf7,null));};exports[_0x5f31('0xbc')]=function(_0x5b14de,_0x348899){return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x5b14de[_0x5f31('0x62')]['id']},'attributes':['id']})[_0x5f31('0x28')](handleEntityNotFound(_0x348899,null))[_0x5f31('0x28')](function(_0x37c646){var _0x3f8fa4=[];values=_0x37c646[_0x5f31('0x50')];_0x3f8fa4[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x4f'),_0x37c646[_0x5f31('0x50')]));_0x3f8fa4[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x51'),_0x37c646[_0x5f31('0x50')]));_0x3f8fa4[_0x5f31('0x4e')](get_open_tabs(_0x5f31('0x5f'),_0x37c646['dataValues']));_0x3f8fa4['push'](get_open_tabs(_0x5f31('0x52'),_0x37c646[_0x5f31('0x50')]));_0x3f8fa4['push'](get_open_tabs('fax',_0x37c646['dataValues']));_0x3f8fa4[_0x5f31('0x4e')](get_open_tabs('mail',_0x37c646[_0x5f31('0x50')]));return Promise['all'](_0x3f8fa4);})['then'](function(_0x6c8d2e){if(_0x6c8d2e){var _0x5f408a=_[_0x5f31('0x3d')](values['ChatOpenTabs'],function(_0x1848e7){return{'channel':_0x5f31('0xbd'),'id':_0x1848e7['id'],'createdAt':_0x1848e7[_0x5f31('0xbe')]};});var _0x587e07=_['map'](values['FaxOpenTabs'],function(_0x42d49e){return{'channel':_0x5f31('0xbf'),'id':_0x42d49e['id'],'createdAt':_0x42d49e[_0x5f31('0xbe')]};});var _0x111671=_[_0x5f31('0x3d')](values[_0x5f31('0xc0')],function(_0x574f80){return{'channel':'OPENCHANNEL','id':_0x574f80['id'],'createdAt':_0x574f80['createdAt']};});var _0x2c6f31=_['map'](values[_0x5f31('0xc1')],function(_0x524d1b){return{'channel':_0x5f31('0xc2'),'id':_0x524d1b['id'],'createdAt':_0x524d1b[_0x5f31('0xbe')]};});var _0x3bb49a=_['map'](values[_0x5f31('0xc3')],function(_0x12bedd){return{'channel':_0x5f31('0xc4'),'id':_0x12bedd['id'],'createdAt':_0x12bedd[_0x5f31('0xbe')]};});var _0x39af48=_[_0x5f31('0x3d')](values[_0x5f31('0xc5')],function(_0x42ea02){return{'channel':_0x5f31('0xc6'),'id':_0x42ea02['id'],'createdAt':_0x42ea02[_0x5f31('0xbe')]};});var _0x392704=_[_0x5f31('0xc7')](_0x5f408a,_0x587e07,_0x111671,_0x2c6f31,_0x3bb49a,_0x39af48);var _0x3199d0={'count':_0x392704['length'],'rows':_0x392704};return _0x3199d0;}else return null;})[_0x5f31('0x28')](respondWithResult(_0x348899,null))['catch'](handleError(_0x348899,null));};exports[_0x5f31('0xc8')]=function(_0x5d9d32,_0x4c0db8){var _0x4f61c5={};var _0x1968a4={};var _0x338abe;var _0x8305d4;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x5d9d32[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x4c0db8,null))['then'](function(_0x45f89a){if(_0x45f89a){_0x338abe=_0x45f89a;_0x1968a4[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xc9')][_0x5f31('0x3c')]);_0x1968a4['query']=_['keys'](_0x5d9d32[_0x5f31('0x45')]);_0x1968a4[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x1968a4[_0x5f31('0x59')],_0x1968a4[_0x5f31('0x45')]);_0x4f61c5['attributes']=_[_0x5f31('0x58')](_0x1968a4[_0x5f31('0x59')],qs['fields'](_0x5d9d32[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x4f61c5['attributes']=_0x4f61c5['attributes'][_0x5f31('0x4d')]?_0x4f61c5[_0x5f31('0x4a')]:_0x1968a4[_0x5f31('0x59')];_0x4f61c5[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x5d9d32[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x4f61c5[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x5d9d32[_0x5f31('0x45')],_0x1968a4[_0x5f31('0xca')]));if(_0x5d9d32['query'][_0x5f31('0x32')]){_0x4f61c5['where']=_['merge'](_0x4f61c5[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x4f61c5[_0x5f31('0x4a')],function(_0x3d4656){var _0x2653ff={};_0x2653ff[_0x3d4656]={'$like':'%'+_0x5d9d32[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x2653ff;})});}_0x4f61c5=_[_0x5f31('0xce')]({},_0x4f61c5,_0x5d9d32[_0x5f31('0x5d')]);return _0x338abe['getContacts'](_0x4f61c5);}})[_0x5f31('0x28')](function(_0xe86e87){if(_0xe86e87){_0x8305d4=_0xe86e87['length'];if(_0x5d9d32[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0x5b'))){_0x4f61c5[_0x5f31('0x5c')]=[{'model':db[_0x5f31('0xd0')],'as':'List','required':![]},{'model':db[_0x5f31('0xd1')],'as':'Tags','attributes':['id',_0x5f31('0x35'),_0x5f31('0xd2')],'where':_0x5d9d32[_0x5f31('0x45')][_0x5f31('0xd3')]?{'id':_0x5d9d32['query']['tag']}:undefined,'required':_0x5d9d32[_0x5f31('0x45')][_0x5f31('0xd3')]?!![]:![]}];}if(!_0x5d9d32[_0x5f31('0x45')]['hasOwnProperty'](_0x5f31('0xd4'))){_0x4f61c5[_0x5f31('0xd5')]=qs['limit'](_0x5d9d32['query'][_0x5f31('0xd5')]);_0x4f61c5[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x5d9d32[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x338abe[_0x5f31('0xc8')](_0x4f61c5);}})['then'](function(_0x53da25){if(_0x53da25){return _0x53da25?{'count':_0x8305d4,'rows':_0x53da25}:null;}})['then'](respondWithResult(_0x4c0db8,null))[_0x5f31('0x54')](handleError(_0x4c0db8,null));};exports[_0x5f31('0xd6')]=function(_0x838017,_0xb5e189){var _0x1c0787;var _0x2e84fd={};var _0x43ce17;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x838017['params']['id']},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d')]})[_0x5f31('0x28')](handleEntityNotFound(_0xb5e189,null))[_0x5f31('0x28')](function(_0x5abb0e){if(!utils[_0x5f31('0x9f')](_0x838017['query'][_0x5f31('0x9b')])){throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0xa0'));}_0x1c0787=_0x5abb0e;var _0x1b58a0={};_0x1b58a0[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_['capitalize'](_0x838017[_0x5f31('0x45')][_0x5f31('0x9b')])+_0x5f31('0xd7')][_0x5f31('0x3c')]);_0x1b58a0[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x838017['query']);_0x1b58a0['filters']=_[_0x5f31('0x58')](_0x1b58a0['model'],_0x1b58a0[_0x5f31('0x45')]);_0x2e84fd[_0x5f31('0x4a')]=_['intersection'](_0x1b58a0[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x838017[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x2e84fd[_0x5f31('0x4a')]=_0x2e84fd[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x2e84fd[_0x5f31('0x4a')]:_0x1b58a0[_0x5f31('0x59')];_0x2e84fd[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x838017['query']['sort']);_0x2e84fd[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x838017[_0x5f31('0x45')],_0x1b58a0[_0x5f31('0xca')]));if(_0x838017[_0x5f31('0x45')][_0x5f31('0x32')]){_0x2e84fd[_0x5f31('0x43')]=_['merge'](_0x2e84fd[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x2e84fd[_0x5f31('0x4a')],function(_0x3baff0){var _0x557c79={};_0x557c79[_0x3baff0]={'$like':'%'+_0x838017[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x557c79;})});}_0x2e84fd=_[_0x5f31('0xce')]({},_0x2e84fd,_0x838017[_0x5f31('0x5d')]);switch(_0x1c0787['role']){case _0x5f31('0x82'):return db[_[_0x5f31('0xa2')](_0x838017['query'][_0x5f31('0x9b')])+_0x5f31('0xd7')][_0x5f31('0x4b')](_0x2e84fd);case _0x5f31('0x2e'):case _0x5f31('0x29'):return _0x1c0787[_0x5f31('0x2c')+_[_0x5f31('0xa2')](_0x838017[_0x5f31('0x45')][_0x5f31('0x9b')])+_0x5f31('0xd8')](_0x2e84fd);default:throw new db['Sequelize'][(_0x5f31('0x90'))](_0x5f31('0xd9'));}})[_0x5f31('0x28')](function(_0x36c6df){_0x43ce17=_0x36c6df['length'];if(!_0x838017[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x2e84fd[_0x5f31('0xd5')]=qs['limit'](_0x838017[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x2e84fd[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x838017[_0x5f31('0x45')]['offset']);}switch(_0x1c0787['role']){case _0x5f31('0x82'):return db[_[_0x5f31('0xa2')](_0x838017[_0x5f31('0x45')][_0x5f31('0x9b')])+'Queue'][_0x5f31('0x4b')](_0x2e84fd);case _0x5f31('0x2e'):case _0x5f31('0x29'):return _0x1c0787[_0x5f31('0x2c')+_[_0x5f31('0xa2')](_0x838017[_0x5f31('0x45')][_0x5f31('0x9b')])+_0x5f31('0xd8')](_0x2e84fd);}})['then'](function(_0x28034d){return{'count':_0x43ce17,'rows':_0x28034d};})[_0x5f31('0x28')](respondWithResult(_0xb5e189,null))[_0x5f31('0x54')](handleError(_0xb5e189,null));};exports[_0x5f31('0xda')]=function(_0x228e30,_0x21b3f3){var _0x2e3e1e={};var _0xe20453={};var _0x22a49d;var _0x35e91e;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x228e30[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x21b3f3,null))[_0x5f31('0x28')](function(_0x241a4b){if(_0x241a4b){_0x22a49d=_0x241a4b;_0xe20453[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xad')][_0x5f31('0x3c')]);_0xe20453[_0x5f31('0x45')]=_['keys'](_0x228e30['query']);_0xe20453[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0xe20453[_0x5f31('0x59')],_0xe20453[_0x5f31('0x45')]);_0x2e3e1e[_0x5f31('0x4a')]=_['intersection'](_0xe20453[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x228e30[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x2e3e1e[_0x5f31('0x4a')]=_0x2e3e1e[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x2e3e1e[_0x5f31('0x4a')]:_0xe20453[_0x5f31('0x59')];_0x2e3e1e[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x228e30[_0x5f31('0x45')]['sort']);_0x2e3e1e['where']=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x228e30[_0x5f31('0x45')],_0xe20453[_0x5f31('0xca')]));if(_0x228e30[_0x5f31('0x45')]['filter']){_0x2e3e1e[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x2e3e1e[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x2e3e1e['attributes'],function(_0x1eb907){var _0x46af6e={};_0x46af6e[_0x1eb907]={'$like':'%'+_0x228e30[_0x5f31('0x45')]['filter']+'%'};return _0x46af6e;})});}_0x2e3e1e=_['merge']({},_0x2e3e1e,_0x228e30['options']);return _0x22a49d[_0x5f31('0xda')](_0x2e3e1e);}})[_0x5f31('0x28')](function(_0x1c8c08){if(_0x1c8c08){_0x35e91e=_0x1c8c08[_0x5f31('0x4d')];if(!_0x228e30[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x2e3e1e['limit']=qs[_0x5f31('0xd5')](_0x228e30[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x2e3e1e[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x228e30[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x22a49d[_0x5f31('0xda')](_0x2e3e1e);}})[_0x5f31('0x28')](function(_0x21b259){if(_0x21b259){return _0x21b259?{'count':_0x35e91e,'rows':_0x21b259}:null;}})['then'](respondWithResult(_0x21b3f3,null))[_0x5f31('0x54')](handleError(_0x21b3f3,null));};exports[_0x5f31('0xdb')]=function(_0xde5b4f,_0x11deb3){var _0x507031={};var _0x370941={};var _0x4a8038;var _0x2ea4e1;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0xde5b4f[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x11deb3,null))[_0x5f31('0x28')](function(_0x385106){if(_0x385106){_0x4a8038=_0x385106;_0x370941[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xdc')]['rawAttributes']);_0x370941[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0xde5b4f[_0x5f31('0x45')]);_0x370941[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x370941[_0x5f31('0x59')],_0x370941[_0x5f31('0x45')]);_0x507031[_0x5f31('0x4a')]=_[_0x5f31('0x58')](_0x370941[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0xde5b4f[_0x5f31('0x45')]['fields']));_0x507031['attributes']=_0x507031['attributes'][_0x5f31('0x4d')]?_0x507031['attributes']:_0x370941['model'];_0x507031['order']=qs[_0x5f31('0xcc')](_0xde5b4f[_0x5f31('0x45')]['sort']);_0x507031['where']=qs[_0x5f31('0xca')](_['pick'](_0xde5b4f[_0x5f31('0x45')],_0x370941[_0x5f31('0xca')]));if(_0xde5b4f[_0x5f31('0x45')]['filter']){_0x507031[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x507031[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x507031[_0x5f31('0x4a')],function(_0x1e2cb1){var _0x21df9f={};_0x21df9f[_0x1e2cb1]={'$like':'%'+_0xde5b4f[_0x5f31('0x45')]['filter']+'%'};return _0x21df9f;})});}_0x507031=_[_0x5f31('0xce')]({},_0x507031,_0xde5b4f['options']);return _0x4a8038[_0x5f31('0xdb')](_0x507031);}})[_0x5f31('0x28')](function(_0x53ede8){if(_0x53ede8){_0x2ea4e1=_0x53ede8[_0x5f31('0x4d')];if(!_0xde5b4f[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x507031['limit']=qs['limit'](_0xde5b4f[_0x5f31('0x45')]['limit']);_0x507031[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0xde5b4f['query'][_0x5f31('0x22')]);}return _0x4a8038[_0x5f31('0xdb')](_0x507031);}})[_0x5f31('0x28')](function(_0x2c82b9){if(_0x2c82b9){return _0x2c82b9?{'count':_0x2ea4e1,'rows':_0x2c82b9}:null;}})['then'](respondWithResult(_0x11deb3,null))['catch'](handleError(_0x11deb3,null));};exports['getRecordings']=function(_0x956620,_0x4351d7){var _0x4626af={'raw':!![],'where':{}};var _0x15a7cb={};var _0x46d841={'count':0x0,'rows':[]};return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x956620['params']['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x4351d7,null))[_0x5f31('0x28')](function(_0x3cc1ac){if(_0x3cc1ac){_0x15a7cb[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xdd')][_0x5f31('0x3c')]);_0x15a7cb['query']=_[_0x5f31('0x57')](_0x956620['query']);_0x15a7cb[_0x5f31('0xca')]=_['intersection'](_0x15a7cb['model'],_0x15a7cb[_0x5f31('0x45')]);_0x4626af['attributes']=_[_0x5f31('0x58')](_0x15a7cb[_0x5f31('0x59')],qs['fields'](_0x956620[_0x5f31('0x45')]['fields']));_0x4626af[_0x5f31('0x4a')]=_0x4626af['attributes'][_0x5f31('0x4d')]?_0x4626af[_0x5f31('0x4a')]:_0x15a7cb[_0x5f31('0x59')];if(!_0x956620[_0x5f31('0x45')][_0x5f31('0xcf')]('nolimit')){_0x4626af['limit']=qs['limit'](_0x956620[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x4626af[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x956620[_0x5f31('0x45')][_0x5f31('0x22')]);}_0x4626af[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x956620[_0x5f31('0x45')]['sort']);_0x4626af[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x956620[_0x5f31('0x45')],_0x15a7cb[_0x5f31('0xca')]));_0x4626af[_0x5f31('0x43')][_0x5f31('0xde')]=_0x3cc1ac['id'];if(_0x956620[_0x5f31('0x45')][_0x5f31('0x32')]){_0x4626af['where']=_['merge'](_0x4626af['where'],{'$or':_[_0x5f31('0x3d')](_0x4626af[_0x5f31('0x4a')],function(_0xeb72f3){var _0x136cd0={};_0x136cd0[_0xeb72f3]={'$like':'%'+_0x956620[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x136cd0;})});}_0x4626af=_[_0x5f31('0xce')]({},_0x4626af,_0x956620[_0x5f31('0x5d')]);return db[_0x5f31('0xdd')][_0x5f31('0x24')]({'where':_0x4626af[_0x5f31('0x43')]})[_0x5f31('0x28')](function(_0x461f06){_0x46d841[_0x5f31('0x24')]=_0x461f06;if(_0x956620['query'][_0x5f31('0x5b')]){_0x4626af['include']=[{'all':!![]}];}return db[_0x5f31('0xdd')][_0x5f31('0x4b')](_0x4626af);})['then'](function(_0x4283c3){_0x46d841['rows']=_0x4283c3;return _0x46d841;});}})[_0x5f31('0x28')](respondWithFilteredResult(_0x4351d7,_0x4626af))[_0x5f31('0x54')](handleError(_0x4351d7,null));};exports[_0x5f31('0xdf')]=function(_0x8b2ddf,_0x3ef433){var _0x6b47e7={'raw':!![],'where':{}};var _0x13b2c1={};var _0x3b1327={'count':0x0,'rows':[]};return db[_0x5f31('0x44')]['findOne']({'where':{'id':_0x8b2ddf[_0x5f31('0x62')]['id']}})['then'](handleEntityNotFound(_0x3ef433,null))['then'](function(_0x1369f5){if(_0x1369f5){_0x13b2c1['model']=_[_0x5f31('0x57')](db[_0x5f31('0xe0')]['rawAttributes']);_0x13b2c1[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x8b2ddf[_0x5f31('0x45')]);_0x13b2c1[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x13b2c1[_0x5f31('0x59')],_0x13b2c1[_0x5f31('0x45')]);_0x6b47e7['attributes']=_[_0x5f31('0x58')](_0x13b2c1[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x8b2ddf['query'][_0x5f31('0x5a')]));_0x6b47e7['attributes']=_0x6b47e7[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x6b47e7[_0x5f31('0x4a')]:_0x13b2c1['model'];if(!_0x8b2ddf[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x6b47e7[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x8b2ddf[_0x5f31('0x45')]['limit']);_0x6b47e7[_0x5f31('0x22')]=qs['offset'](_0x8b2ddf['query']['offset']);}_0x6b47e7['order']=qs[_0x5f31('0xcc')](_0x8b2ddf['query'][_0x5f31('0xcc')]);_0x6b47e7[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_['pick'](_0x8b2ddf['query'],_0x13b2c1[_0x5f31('0xca')]));_0x6b47e7[_0x5f31('0x43')][_0x5f31('0xde')]=_0x1369f5['id'];if(_0x8b2ddf['query'][_0x5f31('0x32')]){_0x6b47e7[_0x5f31('0x43')]=_['merge'](_0x6b47e7[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x6b47e7[_0x5f31('0x4a')],function(_0x5bed2e){var _0x3649b3={};_0x3649b3[_0x5bed2e]={'$like':'%'+_0x8b2ddf[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x3649b3;})});}_0x6b47e7=_[_0x5f31('0xce')]({},_0x6b47e7,_0x8b2ddf['options']);return db[_0x5f31('0xe0')][_0x5f31('0x24')]({'where':_0x6b47e7[_0x5f31('0x43')]})[_0x5f31('0x28')](function(_0x3d5fb0){_0x3b1327[_0x5f31('0x24')]=_0x3d5fb0;if(_0x8b2ddf[_0x5f31('0x45')]['includeAll']){_0x6b47e7[_0x5f31('0x5c')]=[{'all':!![]}];}return db['ScreenRecording'][_0x5f31('0x4b')](_0x6b47e7);})['then'](function(_0x26193a){_0x3b1327[_0x5f31('0x4c')]=_0x26193a;return _0x3b1327;});}})[_0x5f31('0x28')](respondWithFilteredResult(_0x3ef433,_0x6b47e7))[_0x5f31('0x54')](handleError(_0x3ef433,null));};exports[_0x5f31('0xe1')]=function(_0xb420f2,_0x12eb1b){var _0x4d5e8e={};var _0x22f8da={};var _0x656d1;var _0x53fe1f;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0xb420f2['params']['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x12eb1b,null))[_0x5f31('0x28')](function(_0x3a22b6){if(_0x3a22b6){_0x656d1=_0x3a22b6;_0x22f8da['model']=_[_0x5f31('0x57')](db[_0x5f31('0xe2')][_0x5f31('0x3c')]);_0x22f8da[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0xb420f2['query']);_0x22f8da[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x22f8da[_0x5f31('0x59')],_0x22f8da[_0x5f31('0x45')]);_0x4d5e8e['attributes']=_[_0x5f31('0x58')](_0x22f8da[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0xb420f2[_0x5f31('0x45')]['fields']));_0x4d5e8e[_0x5f31('0x4a')]=_0x4d5e8e['attributes'][_0x5f31('0x4d')]?_0x4d5e8e['attributes']:_0x22f8da[_0x5f31('0x59')];_0x4d5e8e['order']=qs[_0x5f31('0xcc')](_0xb420f2[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x4d5e8e[_0x5f31('0x43')]=qs['filters'](_[_0x5f31('0xcd')](_0xb420f2[_0x5f31('0x45')],_0x22f8da[_0x5f31('0xca')]));if(_0xb420f2[_0x5f31('0x45')]['filter']){_0x4d5e8e[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x4d5e8e[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x4d5e8e[_0x5f31('0x4a')],function(_0x146f6d){var _0x1fb095={};_0x1fb095[_0x146f6d]={'$like':'%'+_0xb420f2[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x1fb095;})});}_0x4d5e8e=_[_0x5f31('0xce')]({},_0x4d5e8e,_0xb420f2[_0x5f31('0x5d')]);return _0x656d1[_0x5f31('0xe1')](_0x4d5e8e);}})[_0x5f31('0x28')](function(_0x27b1c2){if(_0x27b1c2){_0x53fe1f=_0x27b1c2[_0x5f31('0x4d')];if(!_0xb420f2[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x4d5e8e[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0xb420f2[_0x5f31('0x45')]['limit']);_0x4d5e8e[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0xb420f2[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x656d1[_0x5f31('0xe1')](_0x4d5e8e);}})['then'](function(_0x4d69d1){if(_0x4d69d1){return _0x4d69d1?{'count':_0x53fe1f,'rows':_0x4d69d1}:null;}})['then'](respondWithResult(_0x12eb1b,null))['catch'](handleError(_0x12eb1b,null));};exports[_0x5f31('0xe3')]=function(_0x24fa67,_0x8fe09c){var _0x13a00d={};var _0x4272eb={};var _0x243837;var _0x179f9c;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x24fa67[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x8fe09c,null))[_0x5f31('0x28')](function(_0x480c4f){if(_0x480c4f){_0x243837=_0x480c4f;_0x4272eb[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xe4')][_0x5f31('0x3c')]);_0x4272eb[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x24fa67[_0x5f31('0x45')]);_0x4272eb[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x4272eb[_0x5f31('0x59')],_0x4272eb[_0x5f31('0x45')]);_0x13a00d[_0x5f31('0x4a')]=_['intersection'](_0x4272eb[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x24fa67[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x13a00d[_0x5f31('0x4a')]=_0x13a00d[_0x5f31('0x4a')]['length']?_0x13a00d['attributes']:_0x4272eb['model'];_0x13a00d['order']=qs[_0x5f31('0xcc')](_0x24fa67[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x13a00d['where']=qs['filters'](_[_0x5f31('0xcd')](_0x24fa67[_0x5f31('0x45')],_0x4272eb[_0x5f31('0xca')]));if(_0x24fa67[_0x5f31('0x45')][_0x5f31('0x32')]){_0x13a00d['where']=_['merge'](_0x13a00d[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x13a00d[_0x5f31('0x4a')],function(_0x3a53a9){var _0x333b89={};_0x333b89[_0x3a53a9]={'$like':'%'+_0x24fa67['query'][_0x5f31('0x32')]+'%'};return _0x333b89;})});}_0x13a00d=_[_0x5f31('0xce')]({},_0x13a00d,_0x24fa67[_0x5f31('0x5d')]);return _0x243837[_0x5f31('0xe3')](_0x13a00d);}})['then'](function(_0xac43ef){if(_0xac43ef){_0x179f9c=_0xac43ef[_0x5f31('0x4d')];if(!_0x24fa67[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x13a00d[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x24fa67[_0x5f31('0x45')]['limit']);_0x13a00d['offset']=qs[_0x5f31('0x22')](_0x24fa67[_0x5f31('0x45')]['offset']);}return _0x243837[_0x5f31('0xe3')](_0x13a00d);}})[_0x5f31('0x28')](function(_0xb516ae){if(_0xb516ae){return _0xb516ae?{'count':_0x179f9c,'rows':_0xb516ae}:null;}})['then'](respondWithResult(_0x8fe09c,null))[_0x5f31('0x54')](handleError(_0x8fe09c,null));};exports[_0x5f31('0xe5')]=function(_0x6bb6ef,_0x4126d7){var _0x1c3bdc={'raw':!![],'where':{}};var _0x315144={};var _0x9c19da={'count':0x0,'rows':[]};return db[_0x5f31('0x44')]['findOne']({'where':{'id':_0x6bb6ef[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x4126d7,null))['then'](function(_0x395f17){if(_0x395f17){_0x315144[_0x5f31('0x59')]=_[_0x5f31('0x57')](db['MailInteraction'][_0x5f31('0x3c')]);_0x315144[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x6bb6ef['query']);_0x315144[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x315144[_0x5f31('0x59')],_0x315144['query']);_0x1c3bdc['attributes']=_[_0x5f31('0x58')](_0x315144[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x6bb6ef['query']['fields']));_0x1c3bdc['attributes']=_0x1c3bdc[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x1c3bdc['attributes']:_0x315144['model'];if(!_0x6bb6ef['query'][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x1c3bdc[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x6bb6ef[_0x5f31('0x45')]['limit']);_0x1c3bdc[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x6bb6ef[_0x5f31('0x45')][_0x5f31('0x22')]);}_0x1c3bdc[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x6bb6ef[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x1c3bdc['where']=qs[_0x5f31('0xca')](_['pick'](_0x6bb6ef[_0x5f31('0x45')],_0x315144[_0x5f31('0xca')]));_0x1c3bdc[_0x5f31('0x43')][_0x5f31('0xde')]=_0x395f17['id'];if(_0x6bb6ef[_0x5f31('0x45')]['filter']){_0x1c3bdc[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x1c3bdc[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x1c3bdc[_0x5f31('0x4a')],function(_0x37fc7c){var _0x1a9e9f={};_0x1a9e9f[_0x37fc7c]={'$like':'%'+_0x6bb6ef[_0x5f31('0x45')]['filter']+'%'};return _0x1a9e9f;})});}_0x1c3bdc=_[_0x5f31('0xce')]({},_0x1c3bdc,_0x6bb6ef[_0x5f31('0x5d')]);return db[_0x5f31('0xe6')][_0x5f31('0x24')]({'where':_0x1c3bdc[_0x5f31('0x43')]})[_0x5f31('0x28')](function(_0x3f7e89){_0x9c19da[_0x5f31('0x24')]=_0x3f7e89;if(_0x6bb6ef['query'][_0x5f31('0x5b')]){_0x1c3bdc[_0x5f31('0x5c')]=[{'all':!![]}];}return db[_0x5f31('0xe6')][_0x5f31('0x4b')](_0x1c3bdc);})[_0x5f31('0x28')](function(_0x505c88){_0x9c19da[_0x5f31('0x4c')]=_0x505c88;return _0x9c19da;});}})[_0x5f31('0x28')](respondWithFilteredResult(_0x4126d7,_0x1c3bdc))[_0x5f31('0x54')](handleError(_0x4126d7,null));};exports[_0x5f31('0xe7')]=function(_0x43f99f,_0x49057c){var _0x412681={};var _0x211585={};var _0x16ab22;var _0x334e28;return db['User'][_0x5f31('0x94')]({'where':{'id':_0x43f99f[_0x5f31('0x62')]['id']}})['then'](handleEntityNotFound(_0x49057c,null))[_0x5f31('0x28')](function(_0x72935c){if(_0x72935c){_0x16ab22=_0x72935c;_0x211585[_0x5f31('0x59')]=_['keys'](db[_0x5f31('0xe8')][_0x5f31('0x3c')]);_0x211585['query']=_[_0x5f31('0x57')](_0x43f99f[_0x5f31('0x45')]);_0x211585[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x211585[_0x5f31('0x59')],_0x211585['query']);_0x412681[_0x5f31('0x4a')]=_['intersection'](_0x211585[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x43f99f[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x412681[_0x5f31('0x4a')]=_0x412681[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x412681[_0x5f31('0x4a')]:_0x211585[_0x5f31('0x59')];_0x412681[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x43f99f[_0x5f31('0x45')]['sort']);_0x412681[_0x5f31('0x43')]=qs['filters'](_['pick'](_0x43f99f['query'],_0x211585[_0x5f31('0xca')]));if(_0x43f99f[_0x5f31('0x45')]['filter']){_0x412681[_0x5f31('0x43')]=_['merge'](_0x412681[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x412681[_0x5f31('0x4a')],function(_0x234fb1){var _0x567b31={};_0x567b31[_0x234fb1]={'$like':'%'+_0x43f99f[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x567b31;})});}_0x412681=_['merge']({},_0x412681,_0x43f99f[_0x5f31('0x5d')]);return _0x16ab22[_0x5f31('0xe7')](_0x412681);}})[_0x5f31('0x28')](function(_0x1380c6){if(_0x1380c6){_0x334e28=_0x1380c6['length'];if(!_0x43f99f[_0x5f31('0x45')]['hasOwnProperty']('nolimit')){_0x412681[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x43f99f[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x412681[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x43f99f[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x16ab22['getSmsInteractions'](_0x412681);}})['then'](function(_0x18a0d1){if(_0x18a0d1){return _0x18a0d1?{'count':_0x334e28,'rows':_0x18a0d1}:null;}})[_0x5f31('0x28')](respondWithResult(_0x49057c,null))[_0x5f31('0x54')](handleError(_0x49057c,null));};exports[_0x5f31('0xe9')]=function(_0x415e30,_0x5b94c8){var _0x3bc18a={};var _0x2e36a5={};var _0x2a141e;var _0x3c79df;return db['User'][_0x5f31('0x94')]({'where':{'id':_0x415e30['params']['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x5b94c8,null))['then'](function(_0x4d1fc1){if(_0x4d1fc1){_0x2a141e=_0x4d1fc1;_0x2e36a5['model']=_[_0x5f31('0x57')](db[_0x5f31('0xea')][_0x5f31('0x3c')]);_0x2e36a5['query']=_[_0x5f31('0x57')](_0x415e30[_0x5f31('0x45')]);_0x2e36a5[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x2e36a5[_0x5f31('0x59')],_0x2e36a5[_0x5f31('0x45')]);_0x3bc18a[_0x5f31('0x4a')]=_[_0x5f31('0x58')](_0x2e36a5[_0x5f31('0x59')],qs['fields'](_0x415e30['query']['fields']));_0x3bc18a[_0x5f31('0x4a')]=_0x3bc18a['attributes']['length']?_0x3bc18a['attributes']:_0x2e36a5['model'];_0x3bc18a[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x415e30[_0x5f31('0x45')][_0x5f31('0xcc')]);_0x3bc18a[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x415e30[_0x5f31('0x45')],_0x2e36a5['filters']));if(_0x415e30['query'][_0x5f31('0x32')]){_0x3bc18a[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x3bc18a[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x3bc18a['attributes'],function(_0x3387a1){var _0x4bd21a={};_0x4bd21a[_0x3387a1]={'$like':'%'+_0x415e30[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x4bd21a;})});}_0x3bc18a=_['merge']({},_0x3bc18a,_0x415e30[_0x5f31('0x5d')]);return _0x2a141e[_0x5f31('0xe9')](_0x3bc18a);}})[_0x5f31('0x28')](function(_0x2a1d30){if(_0x2a1d30){_0x3c79df=_0x2a1d30[_0x5f31('0x4d')];if(!_0x415e30[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x3bc18a[_0x5f31('0xd5')]=qs['limit'](_0x415e30[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x3bc18a[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x415e30[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x2a141e['getFaxInteractions'](_0x3bc18a);}})['then'](function(_0x1172e0){if(_0x1172e0){return _0x1172e0?{'count':_0x3c79df,'rows':_0x1172e0}:null;}})[_0x5f31('0x28')](respondWithResult(_0x5b94c8,null))[_0x5f31('0x54')](handleError(_0x5b94c8,null));};exports[_0x5f31('0xeb')]=function(_0x5424b6,_0x366294){var _0x528614={};var _0x26f98a={};var _0x504be0;var _0x45020c;return db[_0x5f31('0x44')]['findOne']({'where':{'id':_0x5424b6[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x366294,null))[_0x5f31('0x28')](function(_0x496691){if(_0x496691){_0x504be0=_0x496691;_0x26f98a[_0x5f31('0x59')]=_[_0x5f31('0x57')](db[_0x5f31('0xec')][_0x5f31('0x3c')]);_0x26f98a[_0x5f31('0x45')]=_['keys'](_0x5424b6[_0x5f31('0x45')]);_0x26f98a[_0x5f31('0xca')]=_['intersection'](_0x26f98a[_0x5f31('0x59')],_0x26f98a[_0x5f31('0x45')]);_0x528614['attributes']=_[_0x5f31('0x58')](_0x26f98a[_0x5f31('0x59')],qs['fields'](_0x5424b6[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x528614[_0x5f31('0x4a')]=_0x528614[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x528614[_0x5f31('0x4a')]:_0x26f98a[_0x5f31('0x59')];_0x528614['order']=qs[_0x5f31('0xcc')](_0x5424b6['query'][_0x5f31('0xcc')]);_0x528614[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x5424b6['query'],_0x26f98a['filters']));if(_0x5424b6[_0x5f31('0x45')][_0x5f31('0x32')]){_0x528614[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x528614['where'],{'$or':_[_0x5f31('0x3d')](_0x528614[_0x5f31('0x4a')],function(_0x53ea63){var _0x1f3e7b={};_0x1f3e7b[_0x53ea63]={'$like':'%'+_0x5424b6['query'][_0x5f31('0x32')]+'%'};return _0x1f3e7b;})});}_0x528614=_[_0x5f31('0xce')]({},_0x528614,_0x5424b6[_0x5f31('0x5d')]);return _0x504be0['getWhatsappInteractions'](_0x528614);}})[_0x5f31('0x28')](function(_0x21d6fc){if(_0x21d6fc){_0x45020c=_0x21d6fc['length'];if(!_0x5424b6['query'][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x528614[_0x5f31('0xd5')]=qs[_0x5f31('0xd5')](_0x5424b6[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x528614[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0x5424b6['query']['offset']);}return _0x504be0['getWhatsappInteractions'](_0x528614);}})[_0x5f31('0x28')](function(_0x4ff2a8){if(_0x4ff2a8){return _0x4ff2a8?{'count':_0x45020c,'rows':_0x4ff2a8}:null;}})[_0x5f31('0x28')](respondWithResult(_0x366294,null))[_0x5f31('0x54')](handleError(_0x366294,null));};exports[_0x5f31('0xed')]=function(_0x5a2e98,_0x1e3324,_0x1bf8be){var _0x4299f3;var _0x17964b;var _0x17e673;var _0x11d55e=!_['isNil'](_0x5a2e98[_0x5f31('0x62')]['id'])?_0x5a2e98[_0x5f31('0x62')]['id']:!_[_0x5f31('0x6c')](_0x5a2e98[_0x5f31('0x2e')]['id'])?_0x5a2e98[_0x5f31('0x2e')]['id']:null;return db['User'][_0x5f31('0x34')]({'where':{'id':_0x11d55e,'role':{'$or':['admin',_0x5f31('0x2e'),_0x5f31('0x29')]}},'attributes':['id','name',_0x5f31('0xee'),'mobile',_0x5f31('0x2d'),_0x5f31('0x6b'),_0x5f31('0x9d')]})[_0x5f31('0x28')](function(_0x47f154){if(_0x47f154){if(_0x47f154[_0x5f31('0x2d')]==='agent'){_0x4299f3=_0x47f154;if(_0x5a2e98[_0x5f31('0x61')][_0x5f31('0xaa')]){_0x17e673=util[_0x5f31('0xab')](_0x5f31('0xef'),_0x4299f3[_0x5a2e98['body'][_0x5f31('0xaa')]]);}else if(_0x5a2e98[_0x5f31('0x61')]['intrf']){_0x17e673=util[_0x5f31('0xab')](_0x5f31('0xf0'),_0x5a2e98['body'][_0x5f31('0xf1')]);}else{_0x17e673=util[_0x5f31('0xab')](_0x5f31('0xf0'),_0x4299f3[_0x5f31('0x35')]);}socket['to'](util[_0x5f31('0xab')](_0x5f31('0xf2'),_0x4299f3[_0x5f31('0x35')]))[_0x5f31('0xa6')](_0x5f31('0xf3'),{'user':{'id':_0x4299f3['id'],'name':_0x4299f3[_0x5f31('0x35')]},'ip':_0x5a2e98[_0x5f31('0xf4')]['x-forwarded-for']||_0x5a2e98[_0x5f31('0xf5')][_0x5f31('0xf6')]||_0x5a2e98['socket'][_0x5f31('0xf6')]||_0x5a2e98['connection'][_0x5f31('0xf7')][_0x5f31('0xf6')]});return db[_0x5f31('0xad')][_0x5f31('0x2b')]({'where':{'membername':_0x4299f3['name']},'individualHooks':!![]});}}else{throw new db[(_0x5f31('0x8f'))][(_0x5f31('0x90'))](_0x5f31('0xf8'));}})[_0x5f31('0x28')](function(){if(_0x4299f3){return _0x4299f3[_0x5f31('0xf9')]({'raw':!![]});}})['then'](function(_0x1200ba){if(_0x4299f3){if(_0x1200ba){_0x17964b=_0x1200ba;if(_0x17964b[_0x5f31('0x4d')]){var _0x8d5b01=_0x17964b[_0x5f31('0x3d')](function(_0xc49bf4){var _0x2f4ffa={'membername':_0x4299f3[_0x5f31('0x35')],'UserId':_0x4299f3['id'],'queue_name':_0xc49bf4[_0x5f31('0x35')],'VoiceQueueId':_0xc49bf4['id'],'interface':_0x17e673,'paused':_0x4299f3[_0x5f31('0x9d')]||![],'penalty':_0xc49bf4[_0x5f31('0xfa')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x2f4ffa);});return Promise[_0x5f31('0x53')](_0x8d5b01);}}}})['then'](function(){if(_0x4299f3){return db['MemberReport'][_0x5f31('0x4b')]({'where':{'membername':_0x4299f3['name'],'exitAt':null}});}})[_0x5f31('0x28')](function(_0x7a7860){if(_0x4299f3){var _0x6614b1=[];_0x7a7860[_0x5f31('0xfb')](function(_0x5a679e){_0x6614b1[_0x5f31('0x4e')](_0x5a679e['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x5f31('0x53')](_0x6614b1);}})[_0x5f31('0x28')](function(){if(_0x4299f3){var _0x1cf4e3=[];var _0x280fa8=[];var _0x2ad128=utils[_0x5f31('0xfc')]();var _0x57ae3c={'membername':_0x4299f3[_0x5f31('0x35')],'interface':_0x17e673,'enterAt':moment()['format'](_0x5f31('0xfd')),'role':_0x4299f3['role'],'internal':_0x4299f3[_0x5f31('0x6b')]};_0x2ad128[_0x5f31('0xfb')](function(_0x1af979){_0x1cf4e3[_0x5f31('0x4e')](_[_0x5f31('0xce')]({'channel':_0x1af979,'type':'LOGIN','data1':_0x5a2e98[_0x5f31('0x61')][_0x5f31('0xfe')],'data2':_0x17e673},_0x57ae3c));if(_0x4299f3[_0x5f31('0x9d')]){_0x280fa8[_0x5f31('0x4e')](_['merge']({'channel':_0x1af979,'type':_0x5f31('0xff'),'data1':_0x5f31('0x100')},_0x57ae3c));}});return db['MemberReport'][_0x5f31('0x89')](_0x1cf4e3[_0x5f31('0xc7')](_0x280fa8),{'individualHooks':!![]});}})['then'](function(){if(_0x4299f3){return _0x4299f3['update']({'online':!![],'lastLoginAt':moment()[_0x5f31('0xab')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4299f3[_0x5f31('0x9d')]||![],'mailPause':_0x4299f3['loginInPause']||![],'chatPause':_0x4299f3['loginInPause']||![],'faxPause':_0x4299f3['loginInPause']||![],'smsPause':_0x4299f3[_0x5f31('0x9d')]||![],'openchannelPause':_0x4299f3[_0x5f31('0x9d')]||![],'whatsappPause':_0x4299f3['loginInPause']||![],'pauseType':_0x4299f3[_0x5f31('0x9d')]?_0x5f31('0x100'):null,'interface':_0x17e673,'lastPauseAt':moment()['format'](_0x5f31('0xfd'))});}})[_0x5f31('0x28')](function(_0x205162){if(_0x5a2e98['isMiddleware']){return _0x1bf8be();}else{return Promise['resolve'](_0x205162)['then'](respondWithResult(_0x1e3324,null));}})[_0x5f31('0x54')](handleError(_0x1e3324,null));};exports[_0x5f31('0x101')]=function(_0x4e9ae3,_0x3a6021){var _0x66c628;return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x4e9ae3[_0x5f31('0x62')]['id'],'role':_0x5f31('0x29')},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d')]})[_0x5f31('0x28')](handleEntityNotFound(_0x3a6021,null))[_0x5f31('0x28')](function(_0xdb7e76){if(_0xdb7e76){_0x66c628=_0xdb7e76;return db[_0x5f31('0xad')][_0x5f31('0x2b')]({'where':{'membername':_0x66c628['name']},'individualHooks':!![]});}})[_0x5f31('0x28')](function(){return db[_0x5f31('0x102')]['findAll']({'where':{'membername':_0x66c628[_0x5f31('0x35')],'exitAt':null}});})[_0x5f31('0x28')](function(_0x524bd1){var _0x2cca91=[];_0x524bd1['forEach'](function(_0x13f934){_0x2cca91['push'](_0x13f934[_0x5f31('0x27')]({'exitAt':moment()[_0x5f31('0xab')](_0x5f31('0xfd'))}));});return Promise[_0x5f31('0x53')](_0x2cca91);})[_0x5f31('0x28')](function(){return _0x66c628[_0x5f31('0x27')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x5f31('0x28')](respondWithResult(_0x3a6021,null))[_0x5f31('0x54')](handleError(_0x3a6021,null));};exports[_0x5f31('0x103')]=function(_0x52f005,_0x222247){var _0x2e2869;return db['UserVoiceQueueRt'][_0x5f31('0x27')]({'paused':0x1},{'where':{'UserId':_0x52f005[_0x5f31('0x62')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x5f31('0x44')][_0x5f31('0x34')]({'where':{'id':_0x52f005['params']['id'],'role':_0x5f31('0x29')},'attributes':['id',_0x5f31('0x35'),_0x5f31('0x2d'),_0x5f31('0x6b'),'interface',_0x5f31('0x9c')]});})[_0x5f31('0x28')](handleEntityNotFound(_0x222247,null))[_0x5f31('0x28')](function(_0x5e7fb5){if(_0x5e7fb5){_0x2e2869=_0x5e7fb5;return respondWithRpcPromise(_0x5f31('0x104'),'pause',{'id':_0x2e2869['id'],'name':_0x2e2869[_0x5f31('0x35')],'pause':!![]});}})[_0x5f31('0x28')](function(){if(_0x2e2869){return db[_0x5f31('0x102')][_0x5f31('0x4b')]({'where':{'membername':_0x2e2869[_0x5f31('0x35')],'type':_0x5f31('0xff'),'exitAt':null}});}})[_0x5f31('0x28')](function(_0x5a0abb){if(_0x5a0abb[_0x5f31('0x4d')]){var _0x2c6442=moment()[_0x5f31('0xab')](_0x5f31('0xfd'));for(var _0x2a3d15=0x0,_0x479886=_0x5a0abb[_0x5f31('0x4d')];_0x2a3d15<_0x479886;_0x2a3d15++){_0x5a0abb[_0x2a3d15]['updateAttributes']({'exitAt':_0x2c6442});}}})[_0x5f31('0x28')](function(){var _0x4cdf3e=[];var _0x459e25=utils[_0x5f31('0xfc')]();_0x459e25['forEach'](function(_0x2b8428){_0x4cdf3e[_0x5f31('0x4e')]({'channel':_0x2b8428,'membername':_0x2e2869[_0x5f31('0x35')],'interface':_[_0x5f31('0x6c')](_0x2e2869[_0x5f31('0xaa')])?util[_0x5f31('0xab')](_0x5f31('0xf0'),_0x2e2869[_0x5f31('0x35')]):_0x2e2869[_0x5f31('0xaa')],'type':_0x5f31('0xff'),'enterAt':moment()[_0x5f31('0xab')](_0x5f31('0xfd')),'data1':_0x52f005[_0x5f31('0x61')][_0x5f31('0x105')]||_0x5f31('0x106'),'role':_0x2e2869['role'],'internal':_0x2e2869['internal']});});return db['MemberReport'][_0x5f31('0x89')](_0x4cdf3e,{'individualHooks':!![]});})[_0x5f31('0x28')](function(){return _0x2e2869[_0x5f31('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x52f005[_0x5f31('0x61')][_0x5f31('0x105')]||_0x5f31('0x106'),'lastPauseAt':moment()[_0x5f31('0xab')](_0x5f31('0xfd'))});})[_0x5f31('0x28')](respondWithResult(_0x222247,null))[_0x5f31('0x54')](handleError(_0x222247,null));};exports[_0x5f31('0x107')]=function(_0x184bcb,_0x5205d7){if(_0x184bcb['body'][_0x5f31('0x9b')]&&!utils[_0x5f31('0x9f')](_0x184bcb[_0x5f31('0x61')][_0x5f31('0x9b')])){throw new APIBadRequestError(util[_0x5f31('0xab')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x184bcb['body'][_0x5f31('0x9b')]));}return db['User'][_0x5f31('0x34')]({'where':{'id':_0x184bcb[_0x5f31('0x62')]['id']},'attributes':['id',_0x5f31('0x35'),'role',_0x5f31('0x6b'),_0x5f31('0xaa'),_0x5f31('0x9c'),_0x5f31('0x9e'),_0x5f31('0x108'),_0x5f31('0x109'),_0x5f31('0x10a'),_0x5f31('0x10b'),_0x5f31('0x10c'),_0x5f31('0x10d'),_0x5f31('0x10e'),_0x5f31('0x10f')]})['then'](function(_0x15aace){if(!_0x15aace){throw new APINotFoundError(util['format'](_0x5f31('0x110'),_0x184bcb[_0x5f31('0x62')]['id']));}return _0x15aace[_0x5f31('0x107')](_0x184bcb[_0x5f31('0x61')]['channel']);})[_0x5f31('0x28')](respondWithResult(_0x5205d7,null))[_0x5f31('0x54')](APIHandleError(_0x5205d7));};exports[_0x5f31('0x111')]=function(_0xa816c8,_0x5da145){var _0x3ad1a2={};var _0x4451fc={};var _0x425a62;var _0x81af45;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0xa816c8[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x5da145,null))[_0x5f31('0x28')](function(_0x59f62e){if(_0x59f62e){_0x425a62=_0x59f62e;_0x4451fc['model']=_[_0x5f31('0x57')](db['Team'][_0x5f31('0x3c')]);_0x4451fc['query']=_['keys'](_0xa816c8[_0x5f31('0x45')]);_0x4451fc[_0x5f31('0xca')]=_[_0x5f31('0x58')](_0x4451fc[_0x5f31('0x59')],_0x4451fc[_0x5f31('0x45')]);_0x3ad1a2['attributes']=_[_0x5f31('0x58')](_0x4451fc[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0xa816c8[_0x5f31('0x45')][_0x5f31('0x5a')]));_0x3ad1a2[_0x5f31('0x4a')]=_0x3ad1a2[_0x5f31('0x4a')][_0x5f31('0x4d')]?_0x3ad1a2['attributes']:_0x4451fc[_0x5f31('0x59')];_0x3ad1a2['order']=qs[_0x5f31('0xcc')](_0xa816c8[_0x5f31('0x45')]['sort']);_0x3ad1a2['where']=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0xa816c8[_0x5f31('0x45')],_0x4451fc[_0x5f31('0xca')]));if(_0xa816c8[_0x5f31('0x45')][_0x5f31('0x32')]){_0x3ad1a2[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x3ad1a2[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x3ad1a2[_0x5f31('0x4a')],function(_0x570681){var _0x4a2e37={};_0x4a2e37[_0x570681]={'$like':'%'+_0xa816c8[_0x5f31('0x45')]['filter']+'%'};return _0x4a2e37;})});}_0x3ad1a2=_[_0x5f31('0xce')]({},_0x3ad1a2,_0xa816c8[_0x5f31('0x5d')]);return _0x425a62[_0x5f31('0x111')](_0x3ad1a2);}})[_0x5f31('0x28')](function(_0x799260){if(_0x799260){_0x81af45=_0x799260[_0x5f31('0x4d')];if(!_0xa816c8[_0x5f31('0x45')][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x3ad1a2[_0x5f31('0xd5')]=qs['limit'](_0xa816c8[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x3ad1a2[_0x5f31('0x22')]=qs[_0x5f31('0x22')](_0xa816c8[_0x5f31('0x45')][_0x5f31('0x22')]);}return _0x425a62[_0x5f31('0x111')](_0x3ad1a2);}})['then'](function(_0x9b1ce){if(_0x9b1ce){return _0x9b1ce?{'count':_0x81af45,'rows':_0x9b1ce}:null;}})[_0x5f31('0x28')](respondWithResult(_0x5da145,null))[_0x5f31('0x54')](handleError(_0x5da145,null));};exports[_0x5f31('0x112')]=function(_0x1dabf4,_0x4f9b33){var _0x3be62e=_0x1dabf4[_0x5f31('0x62')]['id'];var _0x166426=_0x1dabf4['body']?_0x1dabf4[_0x5f31('0x61')]['ids']:null;var _0x2eac16=[];return Promise[_0x5f31('0x113')]()['then'](function(){if(!_0x166426)throw new APIBadRequestError(_0x5f31('0x114'));})[_0x5f31('0x28')](function(){return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x3be62e}});})[_0x5f31('0x28')](function(_0x41ca2c){if(!_0x41ca2c)throw new APINotFoundError(util[_0x5f31('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x1dabf4[_0x5f31('0x62')]['id']));return db[_0x5f31('0x6f')][_0x5f31('0x115')](function(_0x898557){return _0x41ca2c[_0x5f31('0x112')](_0x166426,{'transaction':_0x898557})['then'](function(){return db[_0x5f31('0x116')]['findAll']({'where':{'id':{'$in':_0x166426}}});})[_0x5f31('0x28')](function(_0x50dd26){var _0x2e02df=_['map'](_0x50dd26,function(_0x2643e3){return _0x2643e3[_0x5f31('0x117')]();});return Promise['all'](_0x2e02df);})[_0x5f31('0x28')](function(_0x5b4047){_0x2eac16=_[_0x5f31('0x118')](_0x5b4047);var _0x458fe4=_[_0x5f31('0x3d')](_0x2eac16,function(_0x3bc937){return _0x3bc937[_0x5f31('0x119')](_0x41ca2c['id'],{'transaction':_0x898557});});return Promise['all'](_0x458fe4);})[_0x5f31('0x28')](function(){if(!_0x41ca2c[_0x5f31('0x9c')])return;var _0x318e8f=_[_0x5f31('0x32')](_0x2eac16,function(_0x47bd35){return _0x47bd35[_0x5f31('0x11a')](_0x5f31('0x9b'))===_0x5f31('0x11b');});var _0xef886d=_[_0x5f31('0x3d')](_0x318e8f,function(_0x56a2bc){return db[_0x5f31('0xad')][_0x5f31('0x11c')]({'membername':_0x41ca2c['name'],'UserId':_0x41ca2c['id'],'queue_name':_0x56a2bc[_0x5f31('0x35')],'VoiceQueueId':_0x56a2bc['id'],'interface':_[_0x5f31('0x6c')](_0x41ca2c[_0x5f31('0xaa')])?util[_0x5f31('0xab')]('SIP/%s',_0x41ca2c['name']):_0x41ca2c[_0x5f31('0xaa')],'paused':_0x41ca2c[_0x5f31('0x9e')]||![],'penalty':_0x41ca2c['penalty']},{'transaction':_0x898557});});return Promise[_0x5f31('0x53')](_0xef886d);})['then'](function(){return db[_0x5f31('0x11d')][_0x5f31('0x4b')]({'where':{'teamId':{'$in':_0x166426}}});})['then'](function(_0x2aba69){var _0x5bacb9=_[_0x5f31('0x3d')](_0x2aba69,function(_0x58f3bb){return db[_0x5f31('0x11e')][_0x5f31('0x87')]({'UserId':_0x41ca2c['id'],'VoicePrefixId':_0x58f3bb['VoicePrefixId']},{'transaction':_0x898557});});return Promise[_0x5f31('0x53')](_0x5bacb9);});});})[_0x5f31('0x28')](function(){for(var _0xeb38cf=0x0;_0xeb38cf<_0x2eac16[_0x5f31('0x4d')];_0xeb38cf++){var _0x34bf42=_0x2eac16[_0xeb38cf][_0x5f31('0x11a')]('channel');var _0x3f24c7=_0x34bf42+_0x5f31('0xa5');socket['emit'](_0x5f31('0x2e')+_0x34bf42+_0x5f31('0xa7'),{'UserId':_0x3be62e,['queueField']:_0x2eac16[_0xeb38cf]['id']});}})[_0x5f31('0x28')](respondWithStatusCode(_0x4f9b33,null))[_0x5f31('0x54')](APIHandleError(_0x4f9b33));};exports[_0x5f31('0x11f')]=function(_0x2d3bc8,_0x4755d9){var _0x35b4db=_0x2d3bc8[_0x5f31('0x62')]['id'];var _0x4cabae=null;if(_0x2d3bc8[_0x5f31('0x45')][_0x5f31('0x65')]){_0x4cabae=_[_0x5f31('0x120')](_0x2d3bc8[_0x5f31('0x45')]['ids'])?_0x2d3bc8[_0x5f31('0x45')][_0x5f31('0x65')]:[_0x2d3bc8[_0x5f31('0x45')]['ids']];}var _0x234784=[];return Promise[_0x5f31('0x113')]()[_0x5f31('0x28')](function(){if(!_0x4cabae)throw new APIBadRequestError(_0x5f31('0x121'));})[_0x5f31('0x28')](function(){return db[_0x5f31('0x44')]['findOne']({'where':{'id':_0x35b4db}});})['then'](function(_0x158425){if(!_0x158425)throw new APINotFoundError(util[_0x5f31('0xab')](_0x5f31('0x110'),_0x2d3bc8[_0x5f31('0x62')]['id']));return db[_0x5f31('0x6f')][_0x5f31('0x115')](function(_0x4eef8c){return _0x158425['removeTeams'](_0x4cabae,{'transaction':_0x4eef8c})[_0x5f31('0x28')](function(){return db['Team'][_0x5f31('0x4b')]({'where':{'id':{'$in':_0x4cabae}}});})[_0x5f31('0x28')](function(_0x393c5e){var _0x27e49a=_['map'](_0x393c5e,function(_0x36e722){return _0x36e722['getAssociatedQueues']();});return Promise['all'](_0x27e49a);})[_0x5f31('0x28')](function(_0x647b8c){_0x234784=_[_0x5f31('0x118')](_0x647b8c);var _0x12d724=_['map'](_0x234784,function(_0x81f215){return _0x81f215[_0x5f31('0x122')](_0x158425['id'],{'transaction':_0x4eef8c});});return Promise[_0x5f31('0x53')](_0x12d724);})['then'](function(){if(!_0x158425[_0x5f31('0x9c')])return;var _0x56e76b=_[_0x5f31('0x32')](_0x234784,function(_0x3fa33f){return _0x3fa33f[_0x5f31('0x11a')]('channel')===_0x5f31('0x11b');});var _0x21a1a4=_[_0x5f31('0x3d')](_0x56e76b,function(_0x2bfb88){return db['UserVoiceQueueRt'][_0x5f31('0x2b')]({'where':{'VoiceQueueId':_0x2bfb88['id'],'UserId':_0x158425['id']},'transaction':_0x4eef8c});});return Promise[_0x5f31('0x53')](_0x21a1a4);})[_0x5f31('0x28')](function(){return db[_0x5f31('0x11d')]['findAll']({'where':{'teamId':{'$in':_0x4cabae}}});})[_0x5f31('0x28')](function(_0x528ec9){var _0x550e14=_[_0x5f31('0x3d')](_0x528ec9,function(_0x29b1d2){return db[_0x5f31('0x11e')][_0x5f31('0x2b')]({'where':{'UserId':_0x158425['id'],'VoicePrefixId':_0x29b1d2[_0x5f31('0x123')]}},{'transaction':_0x4eef8c});});return Promise[_0x5f31('0x53')](_0x550e14);});});})[_0x5f31('0x28')](function(){for(var _0x18892d=0x0;_0x18892d<_0x234784[_0x5f31('0x4d')];_0x18892d++){var _0x15d188=_0x234784[_0x18892d]['getDataValue'](_0x5f31('0x9b'));var _0x5416de=_0x15d188+_0x5f31('0xa5');socket[_0x5f31('0xa6')](_0x5f31('0x2e')+_0x15d188+_0x5f31('0xb0'),{'UserId':_0x35b4db,['queueField']:_0x234784[_0x18892d]['id']});}})[_0x5f31('0x28')](respondWithStatusCode(_0x4755d9,null))[_0x5f31('0x54')](APIHandleError(_0x4755d9));};exports[_0x5f31('0x124')]=function(_0x186ef8,_0x124f33){var _0x122ad1={};var _0x381a20={};var _0x2b09ff;var _0x2cbd9b;return db['User'][_0x5f31('0x94')]({'where':{'id':_0x186ef8[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x124f33,null))[_0x5f31('0x28')](function(_0x51192a){if(_0x51192a){_0x2b09ff=_0x51192a;_0x381a20['model']=_[_0x5f31('0x57')](db['CmList'][_0x5f31('0x3c')]);_0x381a20['query']=_['keys'](_0x186ef8[_0x5f31('0x45')]);_0x381a20['filters']=_[_0x5f31('0x58')](_0x381a20[_0x5f31('0x59')],_0x381a20[_0x5f31('0x45')]);_0x122ad1['attributes']=_['intersection'](_0x381a20['model'],qs[_0x5f31('0x5a')](_0x186ef8['query']['fields']));_0x122ad1[_0x5f31('0x4a')]=_0x122ad1[_0x5f31('0x4a')]['length']?_0x122ad1[_0x5f31('0x4a')]:_0x381a20[_0x5f31('0x59')];_0x122ad1[_0x5f31('0xcb')]=qs[_0x5f31('0xcc')](_0x186ef8['query'][_0x5f31('0xcc')]);_0x122ad1[_0x5f31('0x43')]=qs[_0x5f31('0xca')](_['pick'](_0x186ef8[_0x5f31('0x45')],_0x381a20[_0x5f31('0xca')]));if(_0x186ef8[_0x5f31('0x45')][_0x5f31('0x32')]){_0x122ad1['where']=_[_0x5f31('0xce')](_0x122ad1['where'],{'$or':_[_0x5f31('0x3d')](_0x122ad1[_0x5f31('0x4a')],function(_0xef44d6){var _0x9f3dc6={};_0x9f3dc6[_0xef44d6]={'$like':'%'+_0x186ef8[_0x5f31('0x45')]['filter']+'%'};return _0x9f3dc6;})});}_0x122ad1=_['merge']({},_0x122ad1,_0x186ef8[_0x5f31('0x5d')]);return _0x2b09ff[_0x5f31('0x124')](_0x122ad1);}})[_0x5f31('0x28')](function(_0x2748e8){if(_0x2748e8){_0x2cbd9b=_0x2748e8[_0x5f31('0x4d')];if(!_0x186ef8['query'][_0x5f31('0xcf')](_0x5f31('0xd4'))){_0x122ad1[_0x5f31('0xd5')]=qs['limit'](_0x186ef8[_0x5f31('0x45')][_0x5f31('0xd5')]);_0x122ad1['offset']=qs['offset'](_0x186ef8['query'][_0x5f31('0x22')]);}return _0x2b09ff[_0x5f31('0x124')](_0x122ad1);}})[_0x5f31('0x28')](function(_0x5beb47){if(_0x5beb47){return _0x5beb47?{'count':_0x2cbd9b,'rows':_0x5beb47}:null;}})[_0x5f31('0x28')](respondWithResult(_0x124f33,null))[_0x5f31('0x54')](handleError(_0x124f33,null));};exports[_0x5f31('0x125')]=function(_0x1a61bf,_0x5175c2){var _0x5aeae6={};var _0x52c8e8={};var _0x12a1ef;return db[_0x5f31('0x44')][_0x5f31('0x94')]({'where':{'id':_0x1a61bf[_0x5f31('0x62')]['id']}})[_0x5f31('0x28')](handleEntityNotFound(_0x5175c2,null))['then'](function(_0x562ef5){if(_0x562ef5){_0x12a1ef=_0x562ef5;_0x52c8e8[_0x5f31('0x59')]=_['keys'](db[_0x5f31('0x44')]['rawAttributes']);_0x52c8e8[_0x5f31('0x45')]=_[_0x5f31('0x57')](_0x1a61bf['query']);_0x52c8e8[_0x5f31('0xca')]=_['intersection'](_0x52c8e8[_0x5f31('0x59')],_0x52c8e8[_0x5f31('0x45')]);_0x5aeae6['attributes']=_[_0x5f31('0x58')](_0x52c8e8[_0x5f31('0x59')],qs[_0x5f31('0x5a')](_0x1a61bf[_0x5f31('0x45')]['fields']));_0x5aeae6[_0x5f31('0x4a')]=_0x5aeae6['attributes'][_0x5f31('0x4d')]?_0x5aeae6[_0x5f31('0x4a')]:_0x52c8e8[_0x5f31('0x59')];_0x5aeae6[_0x5f31('0xcb')]=qs['sort'](_0x1a61bf['query']['sort']);_0x5aeae6['where']=qs[_0x5f31('0xca')](_[_0x5f31('0xcd')](_0x1a61bf[_0x5f31('0x45')],_0x52c8e8['filters']));if(_0x1a61bf['query'][_0x5f31('0x32')]){_0x5aeae6[_0x5f31('0x43')]=_[_0x5f31('0xce')](_0x5aeae6[_0x5f31('0x43')],{'$or':_[_0x5f31('0x3d')](_0x5aeae6[_0x5f31('0x4a')],function(_0x3a751a){var _0x24f235={};_0x24f235[_0x3a751a]={'$like':'%'+_0x1a61bf[_0x5f31('0x45')][_0x5f31('0x32')]+'%'};return _0x24f235;})});}_0x5aeae6[_0x5f31('0x59')]=db[_0x5f31('0x44')];_0x5aeae6['as']=_0x5f31('0x2f');_0x5aeae6=_[_0x5f31('0xce')]({},_0x5aeae6,_0x1a61bf[_0x5f31('0x5d')]);return _0x12a1ef['getVoiceQueues']({'include':[_0x5aeae6]});}})[_0x5f31('0x28')](function(_0x346511){if(_0x346511){var _0x16f0bb={},_0x32b00a=[];for(var _0x481952=0x0;_0x481952<_0x346511['length'];_0x481952+=0x1){for(var _0x201996=0x0,_0x488b2e;_0x201996<_0x346511[_0x481952]['Agents']['length'];_0x201996+=0x1){_0x488b2e=_0x346511[_0x481952]['Agents'][_0x201996][_0x5f31('0x2c')]({'plain':!![]});_0x16f0bb[_0x488b2e['id']]=_0x488b2e;}}_0x16f0bb=_['values'](_0x16f0bb);for(var _0x3786cf=qs['offset'](_0x1a61bf[_0x5f31('0x45')]['offset']);_0x3786cf<_0x16f0bb[_0x5f31('0x4d')]&&_0x32b00a[_0x5f31('0x4d')]=_0x9af316){_0x2d6f40=_0x9af316;_0x4e4a37=0xc8;}else{_0x4e4a37=0xce;}_0x1e3235[_0x45b1('0x23')](_0x4e4a37);return _0x1e3235[_0x45b1('0x2a')]('Content-Range',_0x54d2eb+'-'+_0x2d6f40+'/'+_0x9af316)[_0x45b1('0x25')](_0x84c623);}return null;};}function saveUpdates(_0x349955){return function(_0x7d6e1c){if(_0x7d6e1c){return _0x7d6e1c[_0x45b1('0x2b')](_0x349955)[_0x45b1('0x18')](function(_0x1aeb8a){if(_0x1aeb8a[_0x45b1('0x2c')]===_0x45b1('0x2d')){socket[_0x45b1('0x2e')](_0x45b1('0x2f')+_0x1aeb8a['id'],_0x1aeb8a);}return _0x1aeb8a;});}return null;};}function removeEntity(_0x5b5558){return function(_0x4c09ca){if(_0x4c09ca){return _0x4c09ca['destroy']()[_0x45b1('0x18')](function(){var _0x2db144=_0x4c09ca[_0x45b1('0x30')]({'plain':!![]});if(_0x2db144['role']==='admin')return;var _0x25b7af=[{'name':_0x45b1('0x31'),'value':_0x45b1('0x32'),'ignore':!![]},{'name':_0x45b1('0x33'),'value':_0x45b1('0x2d'),'ignore':![]},{'name':'Telephones','value':_0x45b1('0x34'),'ignore':![]}];var _0x184793=_(_0x25b7af)[_0x45b1('0x35')](_0x45b1('0x36'))[_0x45b1('0x37')](_0x45b1('0x38'))[_0x45b1('0x38')]();if(_['includes'](_0x184793,_0x2db144[_0x45b1('0x2c')])){return;}var _0x41aa29=_[_0x45b1('0x39')](_0x25b7af,[_0x45b1('0x38'),_0x2db144['role']])[_0x45b1('0x3a')];return db[_0x45b1('0x3b')][_0x45b1('0x3c')]({'where':{'type':_0x41aa29,'resourceId':_0x2db144['id']}})[_0x45b1('0x18')](function(){return _0x4c09ca;});})[_0x45b1('0x18')](function(){_0x5b5558[_0x45b1('0x23')](0xcc)[_0x45b1('0x24')]();});}};}function handleEntityNotFound(_0x293241){return function(_0x59b283){if(!_0x59b283){_0x293241[_0x45b1('0x22')](0x194);}return _0x59b283;};}function handleError(_0x581f9f,_0x9f8ee3){_0x9f8ee3=_0x9f8ee3||0x1f4;return function(_0x3b835f){logger[_0x45b1('0x1c')](_0x3b835f[_0x45b1('0x3d')]);if(_0x3b835f[_0x45b1('0x3a')]){delete _0x3b835f[_0x45b1('0x3a')];}_0x581f9f[_0x45b1('0x23')](_0x9f8ee3)[_0x45b1('0x3e')](_0x3b835f);};}exports['index']=function(_0x183ab0,_0x20a3fa){var _0x3df1e9={},_0x4bd421={'count':0x0,'rows':[]};var _0x2dcaa0=_(db[_0x45b1('0x3f')][_0x45b1('0x40')])['map'](function(_0x42b949){return{'name':_0x42b949['fieldName'],'type':_0x42b949[_0x45b1('0x41')][_0x45b1('0x42')]};})['filter'](function(_0xb10dc4){return!_[_0x45b1('0x43')]([_0x45b1('0x44'),'salt'],_0xb10dc4[_0x45b1('0x3a')]);})[_0x45b1('0x38')]();_0x3df1e9=qs[_0x45b1('0x45')](_0x2dcaa0,_0x183ab0);var _0x57a9b6={'where':_0x3df1e9[_0x45b1('0x46')]};return db['User']['count'](_0x57a9b6)['then'](function(_0x298390){_0x4bd421[_0x45b1('0x28')]=_0x298390;if(_0x183ab0[_0x45b1('0x47')][_0x45b1('0x48')]){_0x3df1e9[_0x45b1('0x49')]=[{'all':!![]}];}if(_0x183ab0[_0x45b1('0x47')][_0x45b1('0x4a')]==='true'){_0x3df1e9[_0x45b1('0x49')]=[{'model':db[_0x45b1('0x4b')],'as':'userSetting'}];}if(!_['includes'](_0x3df1e9['attributes'],'id')){_0x3df1e9[_0x45b1('0x4c')][_0x45b1('0x4d')]('id');}return db[_0x45b1('0x3f')][_0x45b1('0x4e')](_0x3df1e9);})['then'](function(_0x5393fe){_0x4bd421['rows']=_0x5393fe;if(_0x183ab0[_0x45b1('0x47')]['openTabs']===_0x45b1('0x4f')){var _0x529f07=[];for(var _0x33aba3=0x0;_0x33aba3<_0x4bd421[_0x45b1('0x50')][_0x45b1('0x51')];_0x33aba3++){_0x529f07['push'](get_open_tabs('chat',_0x4bd421[_0x45b1('0x50')][_0x33aba3][_0x45b1('0x52')]));_0x529f07['push'](get_open_tabs('sms',_0x4bd421['rows'][_0x33aba3][_0x45b1('0x52')]));_0x529f07['push'](get_open_tabs(_0x45b1('0x53'),_0x4bd421[_0x45b1('0x50')][_0x33aba3][_0x45b1('0x52')]));_0x529f07['push'](get_open_tabs('mail',_0x4bd421[_0x45b1('0x50')][_0x33aba3][_0x45b1('0x52')]));_0x529f07[_0x45b1('0x4d')](get_open_tabs('openchannel',_0x4bd421[_0x45b1('0x50')][_0x33aba3][_0x45b1('0x52')]));_0x529f07['push'](get_open_tabs('whatsapp',_0x4bd421[_0x45b1('0x50')][_0x33aba3]['dataValues']));}return Promise[_0x45b1('0x54')](_0x529f07)['then'](function(){return _0x4bd421;});}else{return _0x4bd421;}})[_0x45b1('0x18')](respondWithFilteredResult(_0x20a3fa,_0x3df1e9))[_0x45b1('0x21')](handleError(_0x20a3fa,null));};exports[_0x45b1('0x55')]=function(_0x1feb05,_0xc72740){var _0x34406d={'raw':![],'where':{'id':_0x1feb05[_0x45b1('0x56')]['id']}},_0x5b5fe1={};_0x5b5fe1[_0x45b1('0x57')]=_['differenceBy'](_[_0x45b1('0x58')](db[_0x45b1('0x3f')][_0x45b1('0x40')]),[_0x45b1('0x44'),_0x45b1('0x59')]);_0x5b5fe1['query']=_['keys'](_0x1feb05[_0x45b1('0x47')]);_0x5b5fe1[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x5b5fe1[_0x45b1('0x57')],_0x5b5fe1[_0x45b1('0x47')]);_0x34406d[_0x45b1('0x4c')]=_['intersection'](_0x5b5fe1['model'],qs['fields'](_0x1feb05['query'][_0x45b1('0x5c')]));_0x34406d[_0x45b1('0x4c')]=_0x34406d[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x34406d[_0x45b1('0x4c')]:_0x5b5fe1[_0x45b1('0x57')];if(_0x1feb05[_0x45b1('0x47')][_0x45b1('0x48')]){_0x34406d[_0x45b1('0x49')]=[{'all':!![]}];}if(_0x1feb05['query'][_0x45b1('0x4a')]===_0x45b1('0x4f')){_0x34406d['include']=[{'model':db[_0x45b1('0x4b')],'as':_0x45b1('0x4a')}];}_0x34406d=_['merge']({},_0x34406d,_0x1feb05['options']);if(!_[_0x45b1('0x43')](_0x34406d[_0x45b1('0x4c')],'id')){_0x34406d['attributes'][_0x45b1('0x4d')]('id');}return db[_0x45b1('0x3f')]['find'](_0x34406d)['then'](handleEntityNotFound(_0xc72740,null))[_0x45b1('0x18')](function(_0x5f49c9){var _0xeb92df=[];values=_0x5f49c9;if(_0x1feb05['query'][_0x45b1('0x5d')]===_0x45b1('0x4f')){_0xeb92df[_0x45b1('0x4d')](get_open_tabs(_0x45b1('0x5e'),_0x5f49c9[_0x45b1('0x52')]));_0xeb92df[_0x45b1('0x4d')](get_open_tabs(_0x45b1('0x5f'),_0x5f49c9[_0x45b1('0x52')]));_0xeb92df[_0x45b1('0x4d')](get_open_tabs(_0x45b1('0x60'),_0x5f49c9[_0x45b1('0x52')]));_0xeb92df['push'](get_open_tabs('whatsapp',_0x5f49c9[_0x45b1('0x52')]));_0xeb92df[_0x45b1('0x4d')](get_open_tabs('fax',_0x5f49c9[_0x45b1('0x52')]));_0xeb92df['push'](get_open_tabs(_0x45b1('0x61'),_0x5f49c9['dataValues']));return Promise['all'](_0xeb92df);}else{return values;}})[_0x45b1('0x18')](function(){return values;})[_0x45b1('0x18')](respondWithResult(_0xc72740,null))[_0x45b1('0x21')](handleError(_0xc72740,null));};exports[_0x45b1('0x2b')]=function(_0x8e1800,_0x721d0a){if(_0x8e1800['body']['id']){delete _0x8e1800[_0x45b1('0x62')]['id'];}delete _0x8e1800[_0x45b1('0x62')][_0x45b1('0x2c')];return db[_0x45b1('0x3f')][_0x45b1('0x39')]({'where':{'id':_0x8e1800[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x721d0a,null))[_0x45b1('0x18')](saveUpdates(_0x8e1800['body'],null))[_0x45b1('0x18')](respondWithResult(_0x721d0a,null))[_0x45b1('0x21')](handleError(_0x721d0a,null));};exports[_0x45b1('0x63')]=function(_0x45a688,_0x532b58){return db[_0x45b1('0x3f')][_0x45b1('0x63')]()[_0x45b1('0x18')](respondWithResult(_0x532b58,null))[_0x45b1('0x21')](handleError(_0x532b58,null));};exports[_0x45b1('0x64')]=function(_0x574564,_0x58bdd9){return db[_0x45b1('0x3f')]['find']({'where':{'id':_0x574564[_0x45b1('0x56')]['id']}})['then'](handleEntityNotFound(_0x58bdd9,null))[_0x45b1('0x18')](function(_0x4a01d5){if(_0x4a01d5){return _0x4a01d5[_0x45b1('0x64')](_0x574564[_0x45b1('0x62')][_0x45b1('0x65')],_[_0x45b1('0x66')](_0x574564[_0x45b1('0x62')],[_0x45b1('0x65'),'id'])||{});}})[_0x45b1('0x18')](respondWithResult(_0x58bdd9,null))[_0x45b1('0x21')](handleError(_0x58bdd9,null));};function validateUser(_0x4341c3){return new Promise(function(_0x58891b,_0xe57ba1){if(_0x4341c3['internal'])return _0x58891b(_0x4341c3);return db['Setting'][_0x45b1('0x67')](0x1)['then'](function(_0x4e28f5){if(_0x4e28f5['securePassword'])authService[_0x45b1('0x68')](_0x4341c3[_0x45b1('0x44')]);db['User'][_0x45b1('0x69')](_0x45b1('0x6a'))[_0x45b1('0x18')](function(_0x1195fd){if(_[_0x45b1('0x6b')](_0x1195fd)){_0x4341c3['internal']=_0x4e28f5[_0x45b1('0x6c')]||0x1;return;}if(_['isNil'](_0x4e28f5[_0x45b1('0x6c')])||_0x4e28f5[_0x45b1('0x6c')]===_0x1195fd){_0x4341c3['internal']=_0x1195fd+0x1;return;}if(_0x4e28f5[_0x45b1('0x6c')]>_0x1195fd){_0x4341c3[_0x45b1('0x6a')]=_0x4e28f5[_0x45b1('0x6c')];return;}return db['sequelize'][_0x45b1('0x47')](_0x45b1('0x6d'),{'type':db[_0x45b1('0x6e')][_0x45b1('0x6f')]['SELECT']})['then'](function(_0x568159){if(_0x568159&&_0x568159[_0x45b1('0x51')]){for(var _0x2535f5=0x0,_0x5e1acb=_0x568159['length'];_0x2535f5<_0x5e1acb&&_[_0x45b1('0x6b')](_0x4341c3[_0x45b1('0x6a')]);_0x2535f5++){if(_0x4e28f5[_0x45b1('0x6c')]<=_0x568159[_0x2535f5][_0x45b1('0x70')]){_0x4341c3[_0x45b1('0x6a')]=_0x568159[_0x2535f5][_0x45b1('0x70')];}else if(_0x4e28f5[_0x45b1('0x6c')]>_0x568159[_0x2535f5]['from']&&_0x4e28f5[_0x45b1('0x6c')]<=_0x568159[_0x2535f5]['to']){_0x4341c3[_0x45b1('0x6a')]=_0x4e28f5['min_internal'];}}}if(_[_0x45b1('0x6b')](_0x4341c3['internal'])){_0x4341c3['internal']=_0x1195fd+0x1;}return _0x58891b(_0x4341c3);});});})['catch'](function(_0xd6b861){_0xe57ba1(_0xd6b861);});});}function updateUser(_0x3376ef){return new Promise(function(_0x260c96,_0x394499){try{if(_0x3376ef[_0x45b1('0x71')]){_0x3376ef[_0x45b1('0x72')]=_0x3376ef[_0x45b1('0x6a')];_0x3376ef[_0x45b1('0x73')]={'mailbox':_0x3376ef[_0x45b1('0x6a')],'password':_0x3376ef[_0x45b1('0x44')],'fullname':_0x3376ef[_0x45b1('0x74')],'email':_0x3376ef[_0x45b1('0x75')]};}if(_0x3376ef[_0x45b1('0x2c')]==='agent'){if(!_0x3376ef[_0x45b1('0x76')])_0x3376ef[_0x45b1('0x76')]=[_0x45b1('0x77'),_0x45b1('0x78'),'103',_0x45b1('0x79'),_0x45b1('0x7a'),_0x45b1('0x7b'),_0x45b1('0x7c'),_0x45b1('0x7d'),'107','108',_0x45b1('0x7e'),_0x45b1('0x7f'),_0x45b1('0x80'),_0x45b1('0x81'),_0x45b1('0x82')];}_0x260c96(_0x3376ef);}catch(_0x45015e){_0x394499(_0x45015e);}});}exports[_0x45b1('0x83')]=function(_0x2d8c87,_0x14b63d){if(_0x2d8c87[_0x45b1('0x32')][_0x45b1('0x2c')]===_0x45b1('0x2d'))throw new Error(_0x45b1('0x84'));if(_0x2d8c87[_0x45b1('0x62')][_0x45b1('0x2c')]===_0x45b1('0x32')&&_0x2d8c87[_0x45b1('0x32')][_0x45b1('0x2c')]!==_0x45b1('0x85')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x2d8c87[_0x45b1('0x62')][_0x45b1('0x2c')]===_0x45b1('0x85')&&_0x2d8c87[_0x45b1('0x32')][_0x45b1('0x2c')]!==_0x45b1('0x85')){throw new Error(_0x45b1('0x86'));}return licenseUtil[_0x45b1('0x87')]([_0x2d8c87['body']])[_0x45b1('0x18')](function(){return validateUser(_0x2d8c87[_0x45b1('0x62')]);})[_0x45b1('0x18')](function(_0xbb8f3f){return updateUser(_0xbb8f3f)[_0x45b1('0x18')](function(_0x198888){if(_0x198888['role']==='admin'){_0x198888[_0x45b1('0x88')]=_0x2d8c87[_0x45b1('0x32')]['settingsEnabled'];delete _0x198888[_0x45b1('0x89')];}return _0x198888;});})[_0x45b1('0x18')](function(_0x36c77f){return db['User'][_0x45b1('0x83')](_0x36c77f,{'include':[{'model':db[_0x45b1('0x73')],'as':_0x45b1('0x73')}]});})['then'](function(_0x37431e){if(_0x2d8c87['body'][_0x45b1('0x2c')]==='user')return _0x37431e;if(_0x2d8c87[_0x45b1('0x32')][_0x45b1('0x2c')]!=='user')return _0x37431e;return db[_0x45b1('0x8a')]['find']({'where':{'name':_0x37431e[_0x45b1('0x2c')]===_0x45b1('0x2d')?'Agents':_0x45b1('0x8b'),'userProfileId':_0x2d8c87[_0x45b1('0x32')][_0x45b1('0x89')]},'raw':!![]})['then'](function(_0x209115){if(!_0x209115||_0x209115[_0x45b1('0x8c')]!=0x0)return _0x37431e;return db['UserProfileResource'][_0x45b1('0x83')]({'name':_0x37431e[_0x45b1('0x3a')],'resourceId':_0x37431e['id'],'type':_0x209115[_0x45b1('0x3a')],'sectionId':_0x209115['id']},{})[_0x45b1('0x18')](function(){return _0x37431e;});})[_0x45b1('0x21')](function(_0x15da38){logger[_0x45b1('0x1c')](_0x45b1('0x8d'),_0x15da38);throw _0x15da38;});})['then'](respondWithResult(_0x14b63d,0xc9))[_0x45b1('0x21')](handleError(_0x14b63d,null));};exports['bulkCreate']=function(_0x570af9,_0x15e515){var _0x52d9be=_0x570af9[_0x45b1('0x62')];var _0x3e4635=[];if(_0x570af9[_0x45b1('0x32')][_0x45b1('0x2c')]==='agent')throw new Error(_0x45b1('0x84'));if(_[_0x45b1('0x8e')](_0x52d9be,['role',_0x45b1('0x32')])&&_0x570af9['user']['role']!==_0x45b1('0x85')){throw new Error(_0x45b1('0x8f'));}if(_[_0x45b1('0x8e')](_0x52d9be,['role',_0x45b1('0x85')])&&_0x570af9[_0x45b1('0x32')][_0x45b1('0x2c')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x52d9be)['then'](function(){return validateUser(_0x52d9be[0x0]);})[_0x45b1('0x18')](function(){for(var _0xaee297=0x1;_0xaee297<_0x52d9be['length'];_0xaee297++){var _0x46f981=_0x52d9be[_0xaee297-0x1][_0x45b1('0x6a')];if(!_0x52d9be[_0xaee297][_0x45b1('0x6a')])_0x52d9be[_0xaee297]['internal']=_0x46f981+0x1;_0x3e4635[_0x45b1('0x4d')](validateUser(_0x52d9be[_0xaee297]));}return Promise['all'](_0x3e4635);})[_0x45b1('0x18')](function(){_0x3e4635=[];for(var _0x3af32b=0x0;_0x3af32b<_0x52d9be[_0x45b1('0x51')];_0x3af32b++){_0x3e4635[_0x45b1('0x4d')](updateUser(_0x52d9be[_0x3af32b]));}return Promise['all'](_0x3e4635);})[_0x45b1('0x18')](function(){_0x3e4635=_0x52d9be['map'](function(_0xc482c6){return db['User']['create'](_0xc482c6,{'include':[{'model':db['VoiceMail'],'as':_0x45b1('0x73')}]})[_0x45b1('0x18')](function(_0x1ff044){_0xc482c6['id']=_0x1ff044['id'];return _0xc482c6;});});return Promise['all'](_0x3e4635);})[_0x45b1('0x18')](function(_0x757e6b){if(_0x570af9['body'][_0x45b1('0x2c')]===_0x45b1('0x32'))return _0x757e6b;if(_0x570af9[_0x45b1('0x32')][_0x45b1('0x2c')]!==_0x45b1('0x32'))return _0x757e6b;var _0x52e7a9=_['some'](_0x757e6b,function(_0x353ad7){return _0x353ad7[_0x45b1('0x2c')]===_0x45b1('0x2d')||_0x353ad7['role']===_0x45b1('0x34');});if(!_0x52e7a9)return _0x757e6b;return db[_0x45b1('0x8a')][_0x45b1('0x4e')]({'where':{'name':{'$or':[_0x45b1('0x33'),_0x45b1('0x8b')]},'userProfileId':_0x570af9['user'][_0x45b1('0x89')]},'raw':!![]})[_0x45b1('0x18')](function(_0x2a6fc7){if(_['isEmpty'](_0x2a6fc7)||!_[_0x45b1('0x8e')](_0x2a6fc7,[_0x45b1('0x8c'),0x0]))return _0x757e6b;_0x3e4635=[];var _0x4c1b49=_(_0x2a6fc7)['map'](function(_0x452273){if(_0x452273[_0x45b1('0x8c')]===0x1)return;return _0x452273['name']===_0x45b1('0x33')?_0x45b1('0x2d'):_0x45b1('0x34');})['compact']()[_0x45b1('0x38')]();for(var _0x3933cf=0x0;_0x3933cf<_0x757e6b[_0x45b1('0x51')];_0x3933cf++){if(!_[_0x45b1('0x43')](_0x4c1b49,_0x757e6b[_0x3933cf][_0x45b1('0x2c')]))return;var _0x46924a=_0x757e6b[_0x3933cf][_0x45b1('0x2c')]===_0x45b1('0x2d')?_0x45b1('0x33'):'Telephones';_0x3e4635[_0x45b1('0x4d')](db[_0x45b1('0x3b')]['create']({'name':_0x757e6b[_0x3933cf][_0x45b1('0x3a')],'resourceId':_0x757e6b[_0x3933cf]['id'],'type':_0x46924a,'sectionId':_[_0x45b1('0x39')](_0x2a6fc7,['name',_0x46924a])['id']},{}));}return Promise[_0x45b1('0x54')](_0x3e4635);});})['then'](respondWithResult(_0x15e515,0xc9))['catch'](handleError(_0x15e515,null));};exports[_0x45b1('0x90')]=function(_0x1ff139,_0x1377cb){if(_0x1ff139[_0x45b1('0x62')]['id']){delete _0x1ff139[_0x45b1('0x62')]['id'];}return db[_0x45b1('0x3f')][_0x45b1('0x39')]({'where':{'id':_0x1ff139[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](function(_0x191a14){if(!_0x191a14)return null;if(_0x191a14['id']===_0x1ff139[_0x45b1('0x32')]['id']){if(!_0x1ff139[_0x45b1('0x62')][_0x45b1('0x91')]||!_0x1ff139['body'][_0x45b1('0x92')]){throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0x95'));}if(!_0x191a14[_0x45b1('0x96')](_0x1ff139[_0x45b1('0x62')]['oldPassword'])){throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0x97'));}if(_0x1ff139['body'][_0x45b1('0x91')]===_0x1ff139[_0x45b1('0x62')][_0x45b1('0x92')]){throw new db[(_0x45b1('0x93'))]['ValidationError'](_0x45b1('0x98'));}}else if(_0x1ff139[_0x45b1('0x32')][_0x45b1('0x2c')]==='admin'){if(!_0x1ff139[_0x45b1('0x62')][_0x45b1('0x92')]){throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x1ff139['user'][_0x45b1('0x2c')]===_0x45b1('0x32')){if(!_0x1ff139[_0x45b1('0x62')]['newPassword']){throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0x99'));}if(_0x191a14[_0x45b1('0x2c')]!=='agent'){throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0x84'));}}else{throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0x84'));}return _0x191a14;})['then'](handleEntityNotFound(_0x1377cb,null))['then'](function(_0x2dbadb){return db[_0x45b1('0x9a')]['findOne']({'attributes':['id','securePassword',_0x45b1('0x9b'),'passwordHistoryLimit']})[_0x45b1('0x18')](function(_0xfee84e){if(_0xfee84e[_0x45b1('0x9c')])authService[_0x45b1('0x68')](_0x1ff139[_0x45b1('0x62')]['newPassword']);if(!_0xfee84e[_0x45b1('0x9b')]||!_0x2dbadb[_0x45b1('0x9d')])return _0x2dbadb;authService[_0x45b1('0x9e')](_0x1ff139[_0x45b1('0x62')]['newPassword'],_0x2dbadb[_0x45b1('0x9d')],_0xfee84e[_0x45b1('0x9f')]);return _0x2dbadb;})['then'](saveUpdates({'password':_0x1ff139[_0x45b1('0x62')][_0x45b1('0x92')],'passwordResetAt':_0x1ff139['user']['id']==_0x1ff139['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x1ff139['body'][_0x45b1('0x92')],_0x2dbadb['previousPasswords'])},null));})['then'](respondWithResult(_0x1377cb,null))[_0x45b1('0x21')](handleError(_0x1377cb,null));};exports['addQueues']=function(_0x591ec1,_0x4c9ce6){var _0x343e13=_0x591ec1[_0x45b1('0x62')][_0x45b1('0xa0')];return db[_0x45b1('0x3f')][_0x45b1('0x39')]({'where':{'id':_0x591ec1[_0x45b1('0x56')]['id']},'attributes':['id',_0x45b1('0x3a'),_0x45b1('0x2c'),_0x45b1('0xa1'),_0x45b1('0xa2'),'voicePause',_0x45b1('0xa3')]})['then'](handleEntityNotFound(_0x4c9ce6,null))[_0x45b1('0x18')](function(_0x4710be){if(_0x4710be){if(!utils['isValidChannel'](_0x343e13)){throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0xa4'));}return _0x4710be[_0x45b1('0xa5')+_['capitalize'](_0x343e13[_0x45b1('0xa6')]())+'Queues'](_0x591ec1[_0x45b1('0x62')][_0x45b1('0x65')],{'penalty':_0x591ec1[_0x45b1('0x62')][_0x45b1('0xa7')]||0x0})[_0x45b1('0xa8')](function(_0x3e990d){for(var _0x186153=0x0;_0x186153<_0x591ec1[_0x45b1('0x62')]['ids'][_0x45b1('0x51')];_0x186153+=0x1){var _0x5a3454={'UserId':Number(_0x591ec1[_0x45b1('0x56')]['id'])};_0x5a3454[_[_0x45b1('0xa9')](_0x343e13[_0x45b1('0xa6')]())+_0x45b1('0xaa')]=Number(_0x591ec1[_0x45b1('0x62')]['ids'][_0x186153]);socket['emit'](_0x45b1('0x32')+_[_0x45b1('0xa9')](_0x343e13['toLowerCase']())+_0x45b1('0xab'),_0x5a3454);}return _0x3e990d;})['then'](function(){if(_0x343e13===_0x45b1('0xac')){return db[_0x45b1('0xad')][_0x45b1('0x4e')]({'where':{'id':_0x591ec1['body'][_0x45b1('0x65')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x45b1('0x18')](function(_0x19ddcb){var _0x19f053=_0x4710be[_0x45b1('0x30')]({'plain':!![]});var _0x32a860=[];if(_0x343e13===_0x45b1('0xac')&&_0x19f053[_0x45b1('0x2c')]==='agent'&&_0x19f053[_0x45b1('0xa1')]){for(let _0x146363=0x0;_0x146363<_0x19ddcb[_0x45b1('0x51')];_0x146363+=0x1){_0x32a860[_0x45b1('0x4d')]({'membername':_0x19f053[_0x45b1('0x3a')],'UserId':_0x19f053['id'],'queue_name':_0x19ddcb[_0x146363][_0x45b1('0x3a')],'VoiceQueueId':_0x19ddcb[_0x146363]['id'],'interface':_[_0x45b1('0x6b')](_0x19f053[_0x45b1('0xa3')])?util[_0x45b1('0xae')](_0x45b1('0xaf'),_0x19f053[_0x45b1('0x3a')]):_0x19f053[_0x45b1('0xa3')],'paused':_0x19f053[_0x45b1('0xb0')]||![],'penalty':_0x591ec1['body']['penalty']||0x0});}return Promise[_0x45b1('0x54')](_0x32a860[_0x45b1('0x37')](function(_0x50cd93){return db['UserVoiceQueueRt'][_0x45b1('0xb1')](_0x50cd93);}));}return _0x4710be;});}})[_0x45b1('0x18')](respondWithStatusCode(_0x4c9ce6,null))[_0x45b1('0x21')](handleError(_0x4c9ce6,null));};exports[_0x45b1('0xb2')]=function(_0x50ad6c,_0x3f68e8){var _0x5aec63,_0xcce087;return db[_0x45b1('0x3f')][_0x45b1('0x39')]({'where':{'id':_0x50ad6c[_0x45b1('0x56')]['id']},'attributes':['id',_0x45b1('0x3a'),_0x45b1('0x2c')]})[_0x45b1('0x18')](handleEntityNotFound(_0x3f68e8,null))[_0x45b1('0x18')](function(_0x4d0632){if(_0x4d0632){_0x5aec63=_0x4d0632;if(!_0x50ad6c[_0x45b1('0x47')]['channel']||!utils[_0x45b1('0xb3')](_0x50ad6c['query'][_0x45b1('0xa0')])){throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0xa4'));}return _0x4d0632['remove'+_[_0x45b1('0xa9')](_0x50ad6c[_0x45b1('0x47')][_0x45b1('0xa0')][_0x45b1('0xa6')]())+'Queues'](_0x50ad6c['query']['ids']);}})[_0x45b1('0x18')](function(_0x5d8e30){if(_['isArray'](_0x50ad6c[_0x45b1('0x47')][_0x45b1('0x65')])){for(var _0x3e971a=0x0;_0x3e971a<_0x50ad6c[_0x45b1('0x47')][_0x45b1('0x65')][_0x45b1('0x51')];_0x3e971a+=0x1){_0xcce087={'UserId':Number(_0x50ad6c[_0x45b1('0x56')]['id'])};_0xcce087[_['capitalize'](_0x50ad6c['query'][_0x45b1('0xa0')]['toLowerCase']())+_0x45b1('0xaa')]=Number(_0x50ad6c['query'][_0x45b1('0x65')][_0x3e971a]);socket[_0x45b1('0x2e')]('user'+_[_0x45b1('0xa9')](_0x50ad6c[_0x45b1('0x47')][_0x45b1('0xa0')]['toLowerCase']())+'Queue:remove',_0xcce087);}}else{_0xcce087={'UserId':Number(_0x50ad6c['params']['id'])};_0xcce087[_[_0x45b1('0xa9')](_0x50ad6c[_0x45b1('0x47')][_0x45b1('0xa0')][_0x45b1('0xa6')]())+_0x45b1('0xaa')]=Number(_0x50ad6c[_0x45b1('0x47')][_0x45b1('0x65')]);socket['emit']('user'+_[_0x45b1('0xa9')](_0x50ad6c['query'][_0x45b1('0xa0')]['toLowerCase']())+_0x45b1('0xb4'),_0xcce087);}return _0x5d8e30;})['then'](function(){if(_0x50ad6c[_0x45b1('0x47')][_0x45b1('0xa0')]===_0x45b1('0xac')){return db[_0x45b1('0xb5')][_0x45b1('0x3c')]({'where':{'UserId':_0x50ad6c[_0x45b1('0x56')]['id'],'VoiceQueueId':_0x50ad6c[_0x45b1('0x47')][_0x45b1('0x65')]},'individualHooks':!![]})['then'](function(){return _0x5aec63;});}return _0x5aec63;})['then'](respondWithStatusCode(_0x3f68e8,null))[_0x45b1('0x21')](handleError(_0x3f68e8,null));};exports[_0x45b1('0xb6')]=function(_0x38f4bf,_0x3a710d){_0x38f4bf['body'][_0x45b1('0xb7')]=_0x38f4bf[_0x45b1('0xb8')][_0x45b1('0xb9')];return db[_0x45b1('0x3f')][_0x45b1('0x39')]({'where':{'id':_0x38f4bf[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x3a710d,null))[_0x45b1('0x18')](saveUpdates(_0x38f4bf['body'],null))[_0x45b1('0x18')](respondWithResult(_0x3a710d,null))['catch'](handleError(_0x3a710d,null));};exports['getAvatar']=function(_0x2a3c6b,_0x3ea4ec){var _0x576b16=path[_0x45b1('0xba')](config['root'],_0x45b1('0xbb'));return db[_0x45b1('0x3f')][_0x45b1('0x39')]({'where':{'id':_0x2a3c6b['params']['id']},'attributes':['id',_0x45b1('0xb7')],'raw':!![]})['then'](handleEntityNotFound(_0x3ea4ec,null))[_0x45b1('0x18')](function(_0x59f22d){if(_0x59f22d){if(_[_0x45b1('0x6b')](_0x59f22d['userpic'])){return _0x3ea4ec[_0x45b1('0xbc')](_0x576b16);}else{if(!fs['existsSync'](path[_0x45b1('0xba')](config['root'],_0x45b1('0xbd'),_0x59f22d[_0x45b1('0xb7')]))){return _0x3ea4ec[_0x45b1('0xbc')](_0x576b16);}return _0x3ea4ec[_0x45b1('0xbc')](path[_0x45b1('0xba')](config['root'],_0x45b1('0xbd'),_0x59f22d[_0x45b1('0xb7')]));}}})[_0x45b1('0x21')](handleError(_0x3ea4ec,null));};exports[_0x45b1('0xbe')]=function(_0x4d8269,_0x4e67e0){return db['User'][_0x45b1('0x39')]({'where':{'id':_0x4d8269[_0x45b1('0x56')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4e67e0,null))[_0x45b1('0x18')](function(_0x59d90d){var _0x2651f1=[];values=_0x59d90d[_0x45b1('0x52')];_0x2651f1['push'](get_open_tabs(_0x45b1('0x5e'),_0x59d90d[_0x45b1('0x52')]));_0x2651f1[_0x45b1('0x4d')](get_open_tabs(_0x45b1('0x5f'),_0x59d90d[_0x45b1('0x52')]));_0x2651f1[_0x45b1('0x4d')](get_open_tabs(_0x45b1('0x60'),_0x59d90d[_0x45b1('0x52')]));_0x2651f1[_0x45b1('0x4d')](get_open_tabs('whatsapp',_0x59d90d[_0x45b1('0x52')]));_0x2651f1[_0x45b1('0x4d')](get_open_tabs(_0x45b1('0x53'),_0x59d90d[_0x45b1('0x52')]));_0x2651f1[_0x45b1('0x4d')](get_open_tabs(_0x45b1('0x61'),_0x59d90d[_0x45b1('0x52')]));return Promise['all'](_0x2651f1);})[_0x45b1('0x18')](function(_0xd51549){if(_0xd51549){var _0x596546=_['map'](values['ChatOpenTabs'],function(_0x5f39f5){return{'channel':'CHAT','id':_0x5f39f5['id'],'createdAt':_0x5f39f5[_0x45b1('0xbf')]};});var _0x59594a=_[_0x45b1('0x37')](values[_0x45b1('0xc0')],function(_0x4a9eae){return{'channel':_0x45b1('0xc1'),'id':_0x4a9eae['id'],'createdAt':_0x4a9eae[_0x45b1('0xbf')]};});var _0x3cdd5b=_[_0x45b1('0x37')](values[_0x45b1('0xc2')],function(_0x2ae700){return{'channel':_0x45b1('0xc3'),'id':_0x2ae700['id'],'createdAt':_0x2ae700['createdAt']};});var _0x44016e=_['map'](values[_0x45b1('0xc4')],function(_0x2efced){return{'channel':'MAIL','id':_0x2efced['id'],'createdAt':_0x2efced[_0x45b1('0xbf')]};});var _0x3aaf64=_[_0x45b1('0x37')](values[_0x45b1('0xc5')],function(_0xb830e0){return{'channel':_0x45b1('0xc6'),'id':_0xb830e0['id'],'createdAt':_0xb830e0[_0x45b1('0xbf')]};});var _0x444d5d=_[_0x45b1('0x37')](values[_0x45b1('0xc7')],function(_0x1272d1){return{'channel':_0x45b1('0xc8'),'id':_0x1272d1['id'],'createdAt':_0x1272d1[_0x45b1('0xbf')]};});var _0x486b88=_[_0x45b1('0xc9')](_0x596546,_0x59594a,_0x3cdd5b,_0x44016e,_0x3aaf64,_0x444d5d);var _0x20c7f3={'count':_0x486b88[_0x45b1('0x51')],'rows':_0x486b88};return _0x20c7f3;}else return null;})[_0x45b1('0x18')](respondWithResult(_0x4e67e0,null))[_0x45b1('0x21')](handleError(_0x4e67e0,null));};exports[_0x45b1('0xca')]=function(_0x144478,_0x565240){var _0x321ed8={};var _0x203b9e={};var _0x3e3b21;var _0x35e87d;return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x144478['params']['id']}})['then'](handleEntityNotFound(_0x565240,null))['then'](function(_0x582a98){if(_0x582a98){_0x3e3b21=_0x582a98;_0x203b9e['model']=_[_0x45b1('0x58')](db[_0x45b1('0xcc')][_0x45b1('0x40')]);_0x203b9e['query']=_[_0x45b1('0x58')](_0x144478[_0x45b1('0x47')]);_0x203b9e['filters']=_[_0x45b1('0x5b')](_0x203b9e[_0x45b1('0x57')],_0x203b9e[_0x45b1('0x47')]);_0x321ed8['attributes']=_[_0x45b1('0x5b')](_0x203b9e[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x144478[_0x45b1('0x47')][_0x45b1('0x5c')]));_0x321ed8['attributes']=_0x321ed8[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x321ed8[_0x45b1('0x4c')]:_0x203b9e[_0x45b1('0x57')];_0x321ed8[_0x45b1('0xcd')]=qs[_0x45b1('0xce')](_0x144478[_0x45b1('0x47')][_0x45b1('0xce')]);_0x321ed8[_0x45b1('0x46')]=qs['filters'](_[_0x45b1('0xcf')](_0x144478[_0x45b1('0x47')],_0x203b9e[_0x45b1('0x5a')]));if(_0x144478[_0x45b1('0x47')][_0x45b1('0x35')]){_0x321ed8['where']=_[_0x45b1('0xd0')](_0x321ed8[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x321ed8[_0x45b1('0x4c')],function(_0x2e7e4e){var _0x4fb9b3={};_0x4fb9b3[_0x2e7e4e]={'$like':'%'+_0x144478[_0x45b1('0x47')]['filter']+'%'};return _0x4fb9b3;})});}_0x321ed8=_['merge']({},_0x321ed8,_0x144478[_0x45b1('0xd1')]);return _0x3e3b21[_0x45b1('0xca')](_0x321ed8);}})[_0x45b1('0x18')](function(_0xd3a8fb){if(_0xd3a8fb){_0x35e87d=_0xd3a8fb[_0x45b1('0x51')];if(_0x144478[_0x45b1('0x47')][_0x45b1('0xd2')](_0x45b1('0x48'))){_0x321ed8[_0x45b1('0x49')]=[{'model':db[_0x45b1('0xd3')],'as':_0x45b1('0xd4'),'required':![]},{'model':db[_0x45b1('0xd5')],'as':'Tags','attributes':['id',_0x45b1('0x3a'),_0x45b1('0xd6')],'where':_0x144478[_0x45b1('0x47')][_0x45b1('0xd7')]?{'id':_0x144478['query'][_0x45b1('0xd7')]}:undefined,'required':_0x144478[_0x45b1('0x47')][_0x45b1('0xd7')]?!![]:![]}];}if(!_0x144478[_0x45b1('0x47')]['hasOwnProperty'](_0x45b1('0xd8'))){_0x321ed8[_0x45b1('0x29')]=qs[_0x45b1('0x29')](_0x144478['query'][_0x45b1('0x29')]);_0x321ed8['offset']=qs['offset'](_0x144478['query'][_0x45b1('0x26')]);}return _0x3e3b21[_0x45b1('0xca')](_0x321ed8);}})[_0x45b1('0x18')](function(_0x5518cb){if(_0x5518cb){return _0x5518cb?{'count':_0x35e87d,'rows':_0x5518cb}:null;}})[_0x45b1('0x18')](respondWithResult(_0x565240,null))[_0x45b1('0x21')](handleError(_0x565240,null));};exports[_0x45b1('0xd9')]=function(_0x14cf5e,_0x241df9){var _0x2ca3f3;var _0x5f2c1a={};var _0xc89135;return db[_0x45b1('0x3f')]['findOne']({'where':{'id':_0x14cf5e[_0x45b1('0x56')]['id']},'attributes':['id',_0x45b1('0x3a'),_0x45b1('0x2c')]})[_0x45b1('0x18')](handleEntityNotFound(_0x241df9,null))[_0x45b1('0x18')](function(_0x5b05a7){if(!utils['isValidChannel'](_0x14cf5e[_0x45b1('0x47')]['channel'])){throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0xa4'));}_0x2ca3f3=_0x5b05a7;var _0x367719={};_0x367719['model']=_[_0x45b1('0x58')](db[_[_0x45b1('0xa9')](_0x14cf5e[_0x45b1('0x47')]['channel'])+'Queue']['rawAttributes']);_0x367719['query']=_[_0x45b1('0x58')](_0x14cf5e['query']);_0x367719[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x367719[_0x45b1('0x57')],_0x367719[_0x45b1('0x47')]);_0x5f2c1a[_0x45b1('0x4c')]=_[_0x45b1('0x5b')](_0x367719[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x14cf5e['query'][_0x45b1('0x5c')]));_0x5f2c1a['attributes']=_0x5f2c1a[_0x45b1('0x4c')]['length']?_0x5f2c1a[_0x45b1('0x4c')]:_0x367719['model'];_0x5f2c1a[_0x45b1('0xcd')]=qs[_0x45b1('0xce')](_0x14cf5e['query'][_0x45b1('0xce')]);_0x5f2c1a[_0x45b1('0x46')]=qs[_0x45b1('0x5a')](_[_0x45b1('0xcf')](_0x14cf5e[_0x45b1('0x47')],_0x367719['filters']));if(_0x14cf5e['query'][_0x45b1('0x35')]){_0x5f2c1a['where']=_[_0x45b1('0xd0')](_0x5f2c1a[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x5f2c1a[_0x45b1('0x4c')],function(_0x56fa2f){var _0x528f13={};_0x528f13[_0x56fa2f]={'$like':'%'+_0x14cf5e[_0x45b1('0x47')][_0x45b1('0x35')]+'%'};return _0x528f13;})});}_0x5f2c1a=_['merge']({},_0x5f2c1a,_0x14cf5e[_0x45b1('0xd1')]);switch(_0x2ca3f3[_0x45b1('0x2c')]){case _0x45b1('0x85'):return db[_['capitalize'](_0x14cf5e[_0x45b1('0x47')][_0x45b1('0xa0')])+_0x45b1('0xda')][_0x45b1('0x4e')](_0x5f2c1a);case _0x45b1('0x32'):case _0x45b1('0x2d'):return _0x2ca3f3[_0x45b1('0x30')+_[_0x45b1('0xa9')](_0x14cf5e[_0x45b1('0x47')][_0x45b1('0xa0')])+'Queues'](_0x5f2c1a);default:throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))]('Unknown\x20role');}})[_0x45b1('0x18')](function(_0x35517c){_0xc89135=_0x35517c[_0x45b1('0x51')];if(!_0x14cf5e['query']['hasOwnProperty'](_0x45b1('0xd8'))){_0x5f2c1a[_0x45b1('0x29')]=qs[_0x45b1('0x29')](_0x14cf5e[_0x45b1('0x47')]['limit']);_0x5f2c1a['offset']=qs['offset'](_0x14cf5e[_0x45b1('0x47')][_0x45b1('0x26')]);}switch(_0x2ca3f3['role']){case _0x45b1('0x85'):return db[_['capitalize'](_0x14cf5e[_0x45b1('0x47')][_0x45b1('0xa0')])+_0x45b1('0xda')][_0x45b1('0x4e')](_0x5f2c1a);case _0x45b1('0x32'):case _0x45b1('0x2d'):return _0x2ca3f3['get'+_[_0x45b1('0xa9')](_0x14cf5e[_0x45b1('0x47')][_0x45b1('0xa0')])+'Queues'](_0x5f2c1a);}})['then'](function(_0x250562){return{'count':_0xc89135,'rows':_0x250562};})[_0x45b1('0x18')](respondWithResult(_0x241df9,null))['catch'](handleError(_0x241df9,null));};exports[_0x45b1('0xdb')]=function(_0x4b4fa2,_0x2c8b93){var _0x2eabf5={};var _0x41e75e={};var _0x12b20e;var _0x59d2c8;return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x4b4fa2[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x2c8b93,null))[_0x45b1('0x18')](function(_0x192cd3){if(_0x192cd3){_0x12b20e=_0x192cd3;_0x41e75e[_0x45b1('0x57')]=_['keys'](db[_0x45b1('0xb5')][_0x45b1('0x40')]);_0x41e75e[_0x45b1('0x47')]=_['keys'](_0x4b4fa2[_0x45b1('0x47')]);_0x41e75e[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x41e75e['model'],_0x41e75e['query']);_0x2eabf5['attributes']=_[_0x45b1('0x5b')](_0x41e75e[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x4b4fa2[_0x45b1('0x47')][_0x45b1('0x5c')]));_0x2eabf5[_0x45b1('0x4c')]=_0x2eabf5[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x2eabf5[_0x45b1('0x4c')]:_0x41e75e['model'];_0x2eabf5['order']=qs['sort'](_0x4b4fa2[_0x45b1('0x47')]['sort']);_0x2eabf5[_0x45b1('0x46')]=qs[_0x45b1('0x5a')](_['pick'](_0x4b4fa2[_0x45b1('0x47')],_0x41e75e[_0x45b1('0x5a')]));if(_0x4b4fa2[_0x45b1('0x47')][_0x45b1('0x35')]){_0x2eabf5['where']=_[_0x45b1('0xd0')](_0x2eabf5[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x2eabf5[_0x45b1('0x4c')],function(_0x5725ac){var _0x41f7d4={};_0x41f7d4[_0x5725ac]={'$like':'%'+_0x4b4fa2[_0x45b1('0x47')][_0x45b1('0x35')]+'%'};return _0x41f7d4;})});}_0x2eabf5=_['merge']({},_0x2eabf5,_0x4b4fa2[_0x45b1('0xd1')]);return _0x12b20e[_0x45b1('0xdb')](_0x2eabf5);}})[_0x45b1('0x18')](function(_0x3b8241){if(_0x3b8241){_0x59d2c8=_0x3b8241['length'];if(!_0x4b4fa2[_0x45b1('0x47')][_0x45b1('0xd2')](_0x45b1('0xd8'))){_0x2eabf5[_0x45b1('0x29')]=qs['limit'](_0x4b4fa2[_0x45b1('0x47')][_0x45b1('0x29')]);_0x2eabf5[_0x45b1('0x26')]=qs[_0x45b1('0x26')](_0x4b4fa2[_0x45b1('0x47')][_0x45b1('0x26')]);}return _0x12b20e[_0x45b1('0xdb')](_0x2eabf5);}})[_0x45b1('0x18')](function(_0x1c06a7){if(_0x1c06a7){return _0x1c06a7?{'count':_0x59d2c8,'rows':_0x1c06a7}:null;}})[_0x45b1('0x18')](respondWithResult(_0x2c8b93,null))['catch'](handleError(_0x2c8b93,null));};exports[_0x45b1('0xdc')]=function(_0x39cfb4,_0x4afc30){var _0x33465b={};var _0x5eac76={};var _0x265c6d;var _0x1839cb;return db[_0x45b1('0x3f')]['findOne']({'where':{'id':_0x39cfb4[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x4afc30,null))['then'](function(_0x3c0163){if(_0x3c0163){_0x265c6d=_0x3c0163;_0x5eac76[_0x45b1('0x57')]=_[_0x45b1('0x58')](db[_0x45b1('0xdd')]['rawAttributes']);_0x5eac76[_0x45b1('0x47')]=_[_0x45b1('0x58')](_0x39cfb4[_0x45b1('0x47')]);_0x5eac76[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x5eac76[_0x45b1('0x57')],_0x5eac76[_0x45b1('0x47')]);_0x33465b[_0x45b1('0x4c')]=_[_0x45b1('0x5b')](_0x5eac76[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x39cfb4[_0x45b1('0x47')][_0x45b1('0x5c')]));_0x33465b[_0x45b1('0x4c')]=_0x33465b['attributes'][_0x45b1('0x51')]?_0x33465b[_0x45b1('0x4c')]:_0x5eac76[_0x45b1('0x57')];_0x33465b[_0x45b1('0xcd')]=qs[_0x45b1('0xce')](_0x39cfb4[_0x45b1('0x47')][_0x45b1('0xce')]);_0x33465b['where']=qs[_0x45b1('0x5a')](_['pick'](_0x39cfb4[_0x45b1('0x47')],_0x5eac76[_0x45b1('0x5a')]));if(_0x39cfb4[_0x45b1('0x47')][_0x45b1('0x35')]){_0x33465b[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x33465b['where'],{'$or':_['map'](_0x33465b[_0x45b1('0x4c')],function(_0xc8a6bc){var _0x3380e2={};_0x3380e2[_0xc8a6bc]={'$like':'%'+_0x39cfb4['query']['filter']+'%'};return _0x3380e2;})});}_0x33465b=_[_0x45b1('0xd0')]({},_0x33465b,_0x39cfb4[_0x45b1('0xd1')]);return _0x265c6d[_0x45b1('0xdc')](_0x33465b);}})[_0x45b1('0x18')](function(_0x45affc){if(_0x45affc){_0x1839cb=_0x45affc[_0x45b1('0x51')];if(!_0x39cfb4[_0x45b1('0x47')][_0x45b1('0xd2')]('nolimit')){_0x33465b[_0x45b1('0x29')]=qs[_0x45b1('0x29')](_0x39cfb4[_0x45b1('0x47')][_0x45b1('0x29')]);_0x33465b[_0x45b1('0x26')]=qs[_0x45b1('0x26')](_0x39cfb4[_0x45b1('0x47')][_0x45b1('0x26')]);}return _0x265c6d[_0x45b1('0xdc')](_0x33465b);}})[_0x45b1('0x18')](function(_0x5ebbf7){if(_0x5ebbf7){return _0x5ebbf7?{'count':_0x1839cb,'rows':_0x5ebbf7}:null;}})[_0x45b1('0x18')](respondWithResult(_0x4afc30,null))[_0x45b1('0x21')](handleError(_0x4afc30,null));};exports[_0x45b1('0xde')]=function(_0x321414,_0x5336f0){var _0x2a5f3f={'raw':!![],'where':{}};var _0x37604d={};var _0x3055e9={'count':0x0,'rows':[]};return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x321414[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x5336f0,null))[_0x45b1('0x18')](function(_0x1ac0b0){if(_0x1ac0b0){_0x37604d['model']=_[_0x45b1('0x58')](db[_0x45b1('0xdf')][_0x45b1('0x40')]);_0x37604d[_0x45b1('0x47')]=_[_0x45b1('0x58')](_0x321414[_0x45b1('0x47')]);_0x37604d[_0x45b1('0x5a')]=_['intersection'](_0x37604d['model'],_0x37604d[_0x45b1('0x47')]);_0x2a5f3f[_0x45b1('0x4c')]=_[_0x45b1('0x5b')](_0x37604d[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x321414[_0x45b1('0x47')]['fields']));_0x2a5f3f[_0x45b1('0x4c')]=_0x2a5f3f[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x2a5f3f[_0x45b1('0x4c')]:_0x37604d['model'];if(!_0x321414['query'][_0x45b1('0xd2')]('nolimit')){_0x2a5f3f[_0x45b1('0x29')]=qs[_0x45b1('0x29')](_0x321414[_0x45b1('0x47')][_0x45b1('0x29')]);_0x2a5f3f[_0x45b1('0x26')]=qs[_0x45b1('0x26')](_0x321414[_0x45b1('0x47')][_0x45b1('0x26')]);}_0x2a5f3f['order']=qs[_0x45b1('0xce')](_0x321414['query'][_0x45b1('0xce')]);_0x2a5f3f[_0x45b1('0x46')]=qs[_0x45b1('0x5a')](_[_0x45b1('0xcf')](_0x321414[_0x45b1('0x47')],_0x37604d[_0x45b1('0x5a')]));_0x2a5f3f['where'][_0x45b1('0xe0')]=_0x1ac0b0['id'];if(_0x321414[_0x45b1('0x47')]['filter']){_0x2a5f3f[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x2a5f3f[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x2a5f3f[_0x45b1('0x4c')],function(_0x2254bb){var _0x3d065f={};_0x3d065f[_0x2254bb]={'$like':'%'+_0x321414[_0x45b1('0x47')][_0x45b1('0x35')]+'%'};return _0x3d065f;})});}_0x2a5f3f=_['merge']({},_0x2a5f3f,_0x321414['options']);return db[_0x45b1('0xdf')][_0x45b1('0x28')]({'where':_0x2a5f3f[_0x45b1('0x46')]})[_0x45b1('0x18')](function(_0x439d05){_0x3055e9[_0x45b1('0x28')]=_0x439d05;if(_0x321414[_0x45b1('0x47')][_0x45b1('0x48')]){_0x2a5f3f[_0x45b1('0x49')]=[{'all':!![]}];}return db[_0x45b1('0xdf')][_0x45b1('0x4e')](_0x2a5f3f);})[_0x45b1('0x18')](function(_0x5aa440){_0x3055e9[_0x45b1('0x50')]=_0x5aa440;return _0x3055e9;});}})['then'](respondWithFilteredResult(_0x5336f0,_0x2a5f3f))[_0x45b1('0x21')](handleError(_0x5336f0,null));};exports[_0x45b1('0xe1')]=function(_0x147bb8,_0x3ebb1f){var _0x29c260={'raw':!![],'where':{}};var _0x4a89cd={};var _0x2f97f8={'count':0x0,'rows':[]};return db[_0x45b1('0x3f')]['findOne']({'where':{'id':_0x147bb8[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x3ebb1f,null))[_0x45b1('0x18')](function(_0x5756ef){if(_0x5756ef){_0x4a89cd['model']=_[_0x45b1('0x58')](db[_0x45b1('0xe2')][_0x45b1('0x40')]);_0x4a89cd[_0x45b1('0x47')]=_[_0x45b1('0x58')](_0x147bb8['query']);_0x4a89cd[_0x45b1('0x5a')]=_['intersection'](_0x4a89cd[_0x45b1('0x57')],_0x4a89cd[_0x45b1('0x47')]);_0x29c260[_0x45b1('0x4c')]=_[_0x45b1('0x5b')](_0x4a89cd[_0x45b1('0x57')],qs['fields'](_0x147bb8['query'][_0x45b1('0x5c')]));_0x29c260[_0x45b1('0x4c')]=_0x29c260['attributes']['length']?_0x29c260[_0x45b1('0x4c')]:_0x4a89cd[_0x45b1('0x57')];if(!_0x147bb8[_0x45b1('0x47')][_0x45b1('0xd2')](_0x45b1('0xd8'))){_0x29c260[_0x45b1('0x29')]=qs[_0x45b1('0x29')](_0x147bb8[_0x45b1('0x47')][_0x45b1('0x29')]);_0x29c260['offset']=qs['offset'](_0x147bb8[_0x45b1('0x47')][_0x45b1('0x26')]);}_0x29c260[_0x45b1('0xcd')]=qs[_0x45b1('0xce')](_0x147bb8[_0x45b1('0x47')][_0x45b1('0xce')]);_0x29c260['where']=qs['filters'](_[_0x45b1('0xcf')](_0x147bb8['query'],_0x4a89cd[_0x45b1('0x5a')]));_0x29c260[_0x45b1('0x46')]['UserId']=_0x5756ef['id'];if(_0x147bb8[_0x45b1('0x47')][_0x45b1('0x35')]){_0x29c260[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x29c260[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x29c260['attributes'],function(_0x4ea497){var _0x40bd9e={};_0x40bd9e[_0x4ea497]={'$like':'%'+_0x147bb8['query'][_0x45b1('0x35')]+'%'};return _0x40bd9e;})});}_0x29c260=_[_0x45b1('0xd0')]({},_0x29c260,_0x147bb8[_0x45b1('0xd1')]);return db['ScreenRecording']['count']({'where':_0x29c260['where']})[_0x45b1('0x18')](function(_0x4f96a7){_0x2f97f8[_0x45b1('0x28')]=_0x4f96a7;if(_0x147bb8[_0x45b1('0x47')][_0x45b1('0x48')]){_0x29c260[_0x45b1('0x49')]=[{'all':!![]}];}return db[_0x45b1('0xe2')][_0x45b1('0x4e')](_0x29c260);})[_0x45b1('0x18')](function(_0x3b1985){_0x2f97f8[_0x45b1('0x50')]=_0x3b1985;return _0x2f97f8;});}})[_0x45b1('0x18')](respondWithFilteredResult(_0x3ebb1f,_0x29c260))[_0x45b1('0x21')](handleError(_0x3ebb1f,null));};exports[_0x45b1('0xe3')]=function(_0x2dd8e4,_0x3badd1){var _0x53c2cd={};var _0x51cdc4={};var _0x11c83d;var _0x270ee0;return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x2dd8e4[_0x45b1('0x56')]['id']}})['then'](handleEntityNotFound(_0x3badd1,null))[_0x45b1('0x18')](function(_0x11337a){if(_0x11337a){_0x11c83d=_0x11337a;_0x51cdc4[_0x45b1('0x57')]=_[_0x45b1('0x58')](db['ChatInteraction'][_0x45b1('0x40')]);_0x51cdc4[_0x45b1('0x47')]=_[_0x45b1('0x58')](_0x2dd8e4[_0x45b1('0x47')]);_0x51cdc4[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x51cdc4['model'],_0x51cdc4[_0x45b1('0x47')]);_0x53c2cd[_0x45b1('0x4c')]=_[_0x45b1('0x5b')](_0x51cdc4[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x2dd8e4['query'][_0x45b1('0x5c')]));_0x53c2cd[_0x45b1('0x4c')]=_0x53c2cd[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x53c2cd[_0x45b1('0x4c')]:_0x51cdc4[_0x45b1('0x57')];_0x53c2cd[_0x45b1('0xcd')]=qs[_0x45b1('0xce')](_0x2dd8e4[_0x45b1('0x47')]['sort']);_0x53c2cd['where']=qs['filters'](_[_0x45b1('0xcf')](_0x2dd8e4[_0x45b1('0x47')],_0x51cdc4['filters']));if(_0x2dd8e4['query'][_0x45b1('0x35')]){_0x53c2cd[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x53c2cd[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x53c2cd[_0x45b1('0x4c')],function(_0xd7500){var _0x39794f={};_0x39794f[_0xd7500]={'$like':'%'+_0x2dd8e4[_0x45b1('0x47')]['filter']+'%'};return _0x39794f;})});}_0x53c2cd=_['merge']({},_0x53c2cd,_0x2dd8e4[_0x45b1('0xd1')]);return _0x11c83d[_0x45b1('0xe3')](_0x53c2cd);}})[_0x45b1('0x18')](function(_0x4f40fb){if(_0x4f40fb){_0x270ee0=_0x4f40fb[_0x45b1('0x51')];if(!_0x2dd8e4['query'][_0x45b1('0xd2')](_0x45b1('0xd8'))){_0x53c2cd[_0x45b1('0x29')]=qs[_0x45b1('0x29')](_0x2dd8e4[_0x45b1('0x47')][_0x45b1('0x29')]);_0x53c2cd[_0x45b1('0x26')]=qs[_0x45b1('0x26')](_0x2dd8e4[_0x45b1('0x47')][_0x45b1('0x26')]);}return _0x11c83d['getChatInteractions'](_0x53c2cd);}})[_0x45b1('0x18')](function(_0x328e5e){if(_0x328e5e){return _0x328e5e?{'count':_0x270ee0,'rows':_0x328e5e}:null;}})[_0x45b1('0x18')](respondWithResult(_0x3badd1,null))['catch'](handleError(_0x3badd1,null));};exports[_0x45b1('0xe4')]=function(_0x536293,_0x31425f){var _0x1e8f5e={};var _0x159eca={};var _0x347969;var _0x2ccbc6;return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x536293[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x31425f,null))[_0x45b1('0x18')](function(_0x505857){if(_0x505857){_0x347969=_0x505857;_0x159eca['model']=_[_0x45b1('0x58')](db['OpenchannelInteraction']['rawAttributes']);_0x159eca['query']=_[_0x45b1('0x58')](_0x536293['query']);_0x159eca[_0x45b1('0x5a')]=_['intersection'](_0x159eca['model'],_0x159eca[_0x45b1('0x47')]);_0x1e8f5e[_0x45b1('0x4c')]=_['intersection'](_0x159eca[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x536293['query']['fields']));_0x1e8f5e[_0x45b1('0x4c')]=_0x1e8f5e[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x1e8f5e[_0x45b1('0x4c')]:_0x159eca[_0x45b1('0x57')];_0x1e8f5e[_0x45b1('0xcd')]=qs['sort'](_0x536293[_0x45b1('0x47')][_0x45b1('0xce')]);_0x1e8f5e[_0x45b1('0x46')]=qs['filters'](_[_0x45b1('0xcf')](_0x536293[_0x45b1('0x47')],_0x159eca['filters']));if(_0x536293[_0x45b1('0x47')][_0x45b1('0x35')]){_0x1e8f5e[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x1e8f5e[_0x45b1('0x46')],{'$or':_['map'](_0x1e8f5e[_0x45b1('0x4c')],function(_0x52da4a){var _0x55b92b={};_0x55b92b[_0x52da4a]={'$like':'%'+_0x536293[_0x45b1('0x47')]['filter']+'%'};return _0x55b92b;})});}_0x1e8f5e=_[_0x45b1('0xd0')]({},_0x1e8f5e,_0x536293[_0x45b1('0xd1')]);return _0x347969[_0x45b1('0xe4')](_0x1e8f5e);}})['then'](function(_0xb3383d){if(_0xb3383d){_0x2ccbc6=_0xb3383d[_0x45b1('0x51')];if(!_0x536293[_0x45b1('0x47')]['hasOwnProperty']('nolimit')){_0x1e8f5e['limit']=qs['limit'](_0x536293[_0x45b1('0x47')][_0x45b1('0x29')]);_0x1e8f5e['offset']=qs[_0x45b1('0x26')](_0x536293[_0x45b1('0x47')][_0x45b1('0x26')]);}return _0x347969[_0x45b1('0xe4')](_0x1e8f5e);}})[_0x45b1('0x18')](function(_0x30502b){if(_0x30502b){return _0x30502b?{'count':_0x2ccbc6,'rows':_0x30502b}:null;}})['then'](respondWithResult(_0x31425f,null))[_0x45b1('0x21')](handleError(_0x31425f,null));};exports['getMailInteractions']=function(_0x467916,_0xe4dc6e){var _0x276ffb={'raw':!![],'where':{}};var _0x1935ee={};var _0x4d36b4={'count':0x0,'rows':[]};return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x467916['params']['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0xe4dc6e,null))['then'](function(_0x52bae6){if(_0x52bae6){_0x1935ee[_0x45b1('0x57')]=_[_0x45b1('0x58')](db[_0x45b1('0xe5')]['rawAttributes']);_0x1935ee[_0x45b1('0x47')]=_[_0x45b1('0x58')](_0x467916['query']);_0x1935ee[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x1935ee['model'],_0x1935ee[_0x45b1('0x47')]);_0x276ffb[_0x45b1('0x4c')]=_[_0x45b1('0x5b')](_0x1935ee['model'],qs['fields'](_0x467916['query'][_0x45b1('0x5c')]));_0x276ffb[_0x45b1('0x4c')]=_0x276ffb['attributes'][_0x45b1('0x51')]?_0x276ffb[_0x45b1('0x4c')]:_0x1935ee[_0x45b1('0x57')];if(!_0x467916[_0x45b1('0x47')][_0x45b1('0xd2')]('nolimit')){_0x276ffb[_0x45b1('0x29')]=qs['limit'](_0x467916['query']['limit']);_0x276ffb[_0x45b1('0x26')]=qs['offset'](_0x467916['query'][_0x45b1('0x26')]);}_0x276ffb[_0x45b1('0xcd')]=qs['sort'](_0x467916[_0x45b1('0x47')][_0x45b1('0xce')]);_0x276ffb[_0x45b1('0x46')]=qs[_0x45b1('0x5a')](_[_0x45b1('0xcf')](_0x467916['query'],_0x1935ee[_0x45b1('0x5a')]));_0x276ffb[_0x45b1('0x46')]['UserId']=_0x52bae6['id'];if(_0x467916['query'][_0x45b1('0x35')]){_0x276ffb[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x276ffb[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x276ffb[_0x45b1('0x4c')],function(_0x165c5a){var _0x5f0fc4={};_0x5f0fc4[_0x165c5a]={'$like':'%'+_0x467916[_0x45b1('0x47')]['filter']+'%'};return _0x5f0fc4;})});}_0x276ffb=_[_0x45b1('0xd0')]({},_0x276ffb,_0x467916[_0x45b1('0xd1')]);return db[_0x45b1('0xe5')]['count']({'where':_0x276ffb[_0x45b1('0x46')]})[_0x45b1('0x18')](function(_0x39ea83){_0x4d36b4[_0x45b1('0x28')]=_0x39ea83;if(_0x467916['query'][_0x45b1('0x48')]){_0x276ffb[_0x45b1('0x49')]=[{'all':!![]}];}return db[_0x45b1('0xe5')][_0x45b1('0x4e')](_0x276ffb);})[_0x45b1('0x18')](function(_0x76b4b){_0x4d36b4[_0x45b1('0x50')]=_0x76b4b;return _0x4d36b4;});}})[_0x45b1('0x18')](respondWithFilteredResult(_0xe4dc6e,_0x276ffb))[_0x45b1('0x21')](handleError(_0xe4dc6e,null));};exports['getSmsInteractions']=function(_0x57bc46,_0x4e3c07){var _0x227d96={};var _0x3418d5={};var _0x253679;var _0x4a342f;return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x57bc46[_0x45b1('0x56')]['id']}})['then'](handleEntityNotFound(_0x4e3c07,null))[_0x45b1('0x18')](function(_0x2d936f){if(_0x2d936f){_0x253679=_0x2d936f;_0x3418d5[_0x45b1('0x57')]=_[_0x45b1('0x58')](db[_0x45b1('0xe6')][_0x45b1('0x40')]);_0x3418d5[_0x45b1('0x47')]=_['keys'](_0x57bc46[_0x45b1('0x47')]);_0x3418d5[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x3418d5['model'],_0x3418d5[_0x45b1('0x47')]);_0x227d96[_0x45b1('0x4c')]=_[_0x45b1('0x5b')](_0x3418d5['model'],qs[_0x45b1('0x5c')](_0x57bc46['query'][_0x45b1('0x5c')]));_0x227d96[_0x45b1('0x4c')]=_0x227d96[_0x45b1('0x4c')]['length']?_0x227d96[_0x45b1('0x4c')]:_0x3418d5[_0x45b1('0x57')];_0x227d96['order']=qs[_0x45b1('0xce')](_0x57bc46[_0x45b1('0x47')][_0x45b1('0xce')]);_0x227d96[_0x45b1('0x46')]=qs['filters'](_[_0x45b1('0xcf')](_0x57bc46[_0x45b1('0x47')],_0x3418d5[_0x45b1('0x5a')]));if(_0x57bc46['query'][_0x45b1('0x35')]){_0x227d96[_0x45b1('0x46')]=_['merge'](_0x227d96[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x227d96[_0x45b1('0x4c')],function(_0x13035a){var _0x5d197a={};_0x5d197a[_0x13035a]={'$like':'%'+_0x57bc46['query'][_0x45b1('0x35')]+'%'};return _0x5d197a;})});}_0x227d96=_['merge']({},_0x227d96,_0x57bc46['options']);return _0x253679[_0x45b1('0xe7')](_0x227d96);}})['then'](function(_0x2726ad){if(_0x2726ad){_0x4a342f=_0x2726ad[_0x45b1('0x51')];if(!_0x57bc46[_0x45b1('0x47')][_0x45b1('0xd2')](_0x45b1('0xd8'))){_0x227d96[_0x45b1('0x29')]=qs[_0x45b1('0x29')](_0x57bc46['query']['limit']);_0x227d96['offset']=qs['offset'](_0x57bc46[_0x45b1('0x47')][_0x45b1('0x26')]);}return _0x253679[_0x45b1('0xe7')](_0x227d96);}})['then'](function(_0x1f17e2){if(_0x1f17e2){return _0x1f17e2?{'count':_0x4a342f,'rows':_0x1f17e2}:null;}})[_0x45b1('0x18')](respondWithResult(_0x4e3c07,null))[_0x45b1('0x21')](handleError(_0x4e3c07,null));};exports[_0x45b1('0xe8')]=function(_0x616bf4,_0x180260){var _0x5906de={};var _0x4f8a8f={};var _0x587c22;var _0x1c2d4;return db[_0x45b1('0x3f')]['findOne']({'where':{'id':_0x616bf4[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x180260,null))[_0x45b1('0x18')](function(_0x4db39f){if(_0x4db39f){_0x587c22=_0x4db39f;_0x4f8a8f['model']=_[_0x45b1('0x58')](db[_0x45b1('0xe9')]['rawAttributes']);_0x4f8a8f['query']=_[_0x45b1('0x58')](_0x616bf4['query']);_0x4f8a8f[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x4f8a8f[_0x45b1('0x57')],_0x4f8a8f[_0x45b1('0x47')]);_0x5906de[_0x45b1('0x4c')]=_['intersection'](_0x4f8a8f[_0x45b1('0x57')],qs['fields'](_0x616bf4[_0x45b1('0x47')][_0x45b1('0x5c')]));_0x5906de[_0x45b1('0x4c')]=_0x5906de['attributes']['length']?_0x5906de[_0x45b1('0x4c')]:_0x4f8a8f[_0x45b1('0x57')];_0x5906de[_0x45b1('0xcd')]=qs['sort'](_0x616bf4[_0x45b1('0x47')][_0x45b1('0xce')]);_0x5906de[_0x45b1('0x46')]=qs[_0x45b1('0x5a')](_['pick'](_0x616bf4[_0x45b1('0x47')],_0x4f8a8f['filters']));if(_0x616bf4[_0x45b1('0x47')][_0x45b1('0x35')]){_0x5906de['where']=_[_0x45b1('0xd0')](_0x5906de[_0x45b1('0x46')],{'$or':_['map'](_0x5906de[_0x45b1('0x4c')],function(_0x354cda){var _0x24be06={};_0x24be06[_0x354cda]={'$like':'%'+_0x616bf4['query']['filter']+'%'};return _0x24be06;})});}_0x5906de=_['merge']({},_0x5906de,_0x616bf4[_0x45b1('0xd1')]);return _0x587c22['getFaxInteractions'](_0x5906de);}})[_0x45b1('0x18')](function(_0x105fcb){if(_0x105fcb){_0x1c2d4=_0x105fcb[_0x45b1('0x51')];if(!_0x616bf4[_0x45b1('0x47')][_0x45b1('0xd2')](_0x45b1('0xd8'))){_0x5906de[_0x45b1('0x29')]=qs[_0x45b1('0x29')](_0x616bf4[_0x45b1('0x47')][_0x45b1('0x29')]);_0x5906de[_0x45b1('0x26')]=qs['offset'](_0x616bf4[_0x45b1('0x47')][_0x45b1('0x26')]);}return _0x587c22[_0x45b1('0xe8')](_0x5906de);}})[_0x45b1('0x18')](function(_0x3620e){if(_0x3620e){return _0x3620e?{'count':_0x1c2d4,'rows':_0x3620e}:null;}})['then'](respondWithResult(_0x180260,null))[_0x45b1('0x21')](handleError(_0x180260,null));};exports[_0x45b1('0xea')]=function(_0x3eb895,_0xc190bd){var _0x4d6397={};var _0x59a315={};var _0x54ec7b;var _0x41ac49;return db[_0x45b1('0x3f')]['findOne']({'where':{'id':_0x3eb895[_0x45b1('0x56')]['id']}})['then'](handleEntityNotFound(_0xc190bd,null))[_0x45b1('0x18')](function(_0x28abed){if(_0x28abed){_0x54ec7b=_0x28abed;_0x59a315[_0x45b1('0x57')]=_['keys'](db[_0x45b1('0xeb')][_0x45b1('0x40')]);_0x59a315['query']=_[_0x45b1('0x58')](_0x3eb895[_0x45b1('0x47')]);_0x59a315[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x59a315[_0x45b1('0x57')],_0x59a315[_0x45b1('0x47')]);_0x4d6397[_0x45b1('0x4c')]=_['intersection'](_0x59a315[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x3eb895['query']['fields']));_0x4d6397[_0x45b1('0x4c')]=_0x4d6397[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x4d6397[_0x45b1('0x4c')]:_0x59a315[_0x45b1('0x57')];_0x4d6397['order']=qs[_0x45b1('0xce')](_0x3eb895[_0x45b1('0x47')]['sort']);_0x4d6397['where']=qs['filters'](_[_0x45b1('0xcf')](_0x3eb895[_0x45b1('0x47')],_0x59a315['filters']));if(_0x3eb895[_0x45b1('0x47')][_0x45b1('0x35')]){_0x4d6397[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x4d6397['where'],{'$or':_['map'](_0x4d6397[_0x45b1('0x4c')],function(_0x670a5c){var _0x2d306d={};_0x2d306d[_0x670a5c]={'$like':'%'+_0x3eb895[_0x45b1('0x47')][_0x45b1('0x35')]+'%'};return _0x2d306d;})});}_0x4d6397=_[_0x45b1('0xd0')]({},_0x4d6397,_0x3eb895[_0x45b1('0xd1')]);return _0x54ec7b[_0x45b1('0xea')](_0x4d6397);}})[_0x45b1('0x18')](function(_0x2d9230){if(_0x2d9230){_0x41ac49=_0x2d9230[_0x45b1('0x51')];if(!_0x3eb895[_0x45b1('0x47')]['hasOwnProperty'](_0x45b1('0xd8'))){_0x4d6397[_0x45b1('0x29')]=qs['limit'](_0x3eb895[_0x45b1('0x47')][_0x45b1('0x29')]);_0x4d6397['offset']=qs['offset'](_0x3eb895['query'][_0x45b1('0x26')]);}return _0x54ec7b[_0x45b1('0xea')](_0x4d6397);}})[_0x45b1('0x18')](function(_0x487eb6){if(_0x487eb6){return _0x487eb6?{'count':_0x41ac49,'rows':_0x487eb6}:null;}})[_0x45b1('0x18')](respondWithResult(_0xc190bd,null))['catch'](handleError(_0xc190bd,null));};exports['login']=function(_0x4efc54,_0x119c4a,_0x39a547){var _0x3b9b04;var _0x4247bd;var _0x52d9d3;var _0x4bcc00=!_[_0x45b1('0x6b')](_0x4efc54[_0x45b1('0x56')]['id'])?_0x4efc54[_0x45b1('0x56')]['id']:!_[_0x45b1('0x6b')](_0x4efc54[_0x45b1('0x32')]['id'])?_0x4efc54['user']['id']:null;return db['User'][_0x45b1('0x39')]({'where':{'id':_0x4bcc00,'role':{'$or':[_0x45b1('0x85'),_0x45b1('0x32'),_0x45b1('0x2d')]}},'attributes':['id',_0x45b1('0x3a'),_0x45b1('0xec'),'mobile',_0x45b1('0x2c'),_0x45b1('0x6a'),_0x45b1('0xa2')]})[_0x45b1('0x18')](function(_0x376527){if(_0x376527){if(_0x376527[_0x45b1('0x2c')]===_0x45b1('0x2d')){_0x3b9b04=_0x376527;if(_0x4efc54[_0x45b1('0x62')]['interface']){_0x52d9d3=util[_0x45b1('0xae')](_0x45b1('0xed'),_0x3b9b04[_0x4efc54[_0x45b1('0x62')][_0x45b1('0xa3')]]);}else if(_0x4efc54['body'][_0x45b1('0xee')]){_0x52d9d3=util['format'](_0x45b1('0xaf'),_0x4efc54[_0x45b1('0x62')]['intrf']);}else{_0x52d9d3=util[_0x45b1('0xae')](_0x45b1('0xaf'),_0x3b9b04[_0x45b1('0x3a')]);}socket['to'](util[_0x45b1('0xae')]('user:%s',_0x3b9b04[_0x45b1('0x3a')]))[_0x45b1('0x2e')](_0x45b1('0xef'),{'user':{'id':_0x3b9b04['id'],'name':_0x3b9b04[_0x45b1('0x3a')]},'ip':_0x4efc54['headers'][_0x45b1('0xf0')]||_0x4efc54[_0x45b1('0xf1')][_0x45b1('0xf2')]||_0x4efc54[_0x45b1('0xf3')]['remoteAddress']||_0x4efc54[_0x45b1('0xf1')][_0x45b1('0xf3')][_0x45b1('0xf2')]});return db[_0x45b1('0xb5')][_0x45b1('0x3c')]({'where':{'membername':_0x3b9b04[_0x45b1('0x3a')]},'individualHooks':!![]});}}else{throw new db[(_0x45b1('0x93'))][(_0x45b1('0x94'))](_0x45b1('0xf4'));}})[_0x45b1('0x18')](function(){if(_0x3b9b04){return _0x3b9b04['getVoiceQueues']({'raw':!![]});}})[_0x45b1('0x18')](function(_0x1416f3){if(_0x3b9b04){if(_0x1416f3){_0x4247bd=_0x1416f3;if(_0x4247bd[_0x45b1('0x51')]){var _0x423d6f=_0x4247bd['map'](function(_0x3a485a){var _0x1f9b32={'membername':_0x3b9b04[_0x45b1('0x3a')],'UserId':_0x3b9b04['id'],'queue_name':_0x3a485a[_0x45b1('0x3a')],'VoiceQueueId':_0x3a485a['id'],'interface':_0x52d9d3,'paused':_0x3b9b04['loginInPause']||![],'penalty':_0x3a485a[_0x45b1('0xf5')]||0x0};return db['UserVoiceQueueRt'][_0x45b1('0xb1')](_0x1f9b32);});return Promise[_0x45b1('0x54')](_0x423d6f);}}}})[_0x45b1('0x18')](function(){if(_0x3b9b04){return db[_0x45b1('0xf6')][_0x45b1('0x4e')]({'where':{'membername':_0x3b9b04[_0x45b1('0x3a')],'exitAt':null}});}})[_0x45b1('0x18')](function(_0x48fc47){if(_0x3b9b04){var _0x398114=[];_0x48fc47[_0x45b1('0xf7')](function(_0x380f77){_0x398114[_0x45b1('0x4d')](_0x380f77[_0x45b1('0x2b')]({'exitAt':moment()[_0x45b1('0xae')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x45b1('0x54')](_0x398114);}})[_0x45b1('0x18')](function(){if(_0x3b9b04){var _0x4432df=[];var _0x44c451=[];var _0x11a1ff=utils[_0x45b1('0xf8')]();var _0x5b558e={'membername':_0x3b9b04[_0x45b1('0x3a')],'interface':_0x52d9d3,'enterAt':moment()[_0x45b1('0xae')](_0x45b1('0xf9')),'role':_0x3b9b04[_0x45b1('0x2c')],'internal':_0x3b9b04[_0x45b1('0x6a')]};_0x11a1ff[_0x45b1('0xf7')](function(_0x5a0972){_0x4432df[_0x45b1('0x4d')](_[_0x45b1('0xd0')]({'channel':_0x5a0972,'type':_0x45b1('0xfa'),'data1':_0x4efc54[_0x45b1('0x62')][_0x45b1('0xfb')],'data2':_0x52d9d3},_0x5b558e));if(_0x3b9b04[_0x45b1('0xa2')]){_0x44c451['push'](_['merge']({'channel':_0x5a0972,'type':'PAUSE','data1':'LOGININPAUSE'},_0x5b558e));}});return db[_0x45b1('0xf6')][_0x45b1('0xfc')](_0x4432df['concat'](_0x44c451),{'individualHooks':!![]});}})[_0x45b1('0x18')](function(){if(_0x3b9b04){return _0x3b9b04[_0x45b1('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x45b1('0xae')](_0x45b1('0xf9')),'voicePause':_0x3b9b04['loginInPause']||![],'mailPause':_0x3b9b04[_0x45b1('0xa2')]||![],'chatPause':_0x3b9b04['loginInPause']||![],'faxPause':_0x3b9b04[_0x45b1('0xa2')]||![],'smsPause':_0x3b9b04[_0x45b1('0xa2')]||![],'openchannelPause':_0x3b9b04[_0x45b1('0xa2')]||![],'whatsappPause':_0x3b9b04[_0x45b1('0xa2')]||![],'pauseType':_0x3b9b04['loginInPause']?'LOGININPAUSE':null,'interface':_0x52d9d3,'lastPauseAt':moment()[_0x45b1('0xae')](_0x45b1('0xf9'))});}})[_0x45b1('0x18')](function(_0x5ce4c5){if(_0x4efc54[_0x45b1('0xfd')]){return _0x39a547();}else{return Promise[_0x45b1('0xfe')](_0x5ce4c5)[_0x45b1('0x18')](respondWithResult(_0x119c4a,null));}})[_0x45b1('0x21')](handleError(_0x119c4a,null));};exports['logout']=function(_0x4997b8,_0x25f293){var _0x25a895;return db[_0x45b1('0x3f')][_0x45b1('0x39')]({'where':{'id':_0x4997b8[_0x45b1('0x56')]['id'],'role':_0x45b1('0x2d')},'attributes':['id','name','role']})[_0x45b1('0x18')](handleEntityNotFound(_0x25f293,null))[_0x45b1('0x18')](function(_0x56305b){if(_0x56305b){_0x25a895=_0x56305b;return db['UserVoiceQueueRt'][_0x45b1('0x3c')]({'where':{'membername':_0x25a895[_0x45b1('0x3a')]},'individualHooks':!![]});}})['then'](function(){return db[_0x45b1('0xf6')][_0x45b1('0x4e')]({'where':{'membername':_0x25a895[_0x45b1('0x3a')],'exitAt':null}});})[_0x45b1('0x18')](function(_0x479f02){var _0x562349=[];_0x479f02[_0x45b1('0xf7')](function(_0x44fc6b){_0x562349[_0x45b1('0x4d')](_0x44fc6b[_0x45b1('0x2b')]({'exitAt':moment()[_0x45b1('0xae')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x45b1('0x54')](_0x562349);})[_0x45b1('0x18')](function(){return _0x25a895[_0x45b1('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x25f293,null))['catch'](handleError(_0x25f293,null));};exports[_0x45b1('0xff')]=function(_0x59f7e1,_0x4f944a){var _0x1fad8f;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x59f7e1[_0x45b1('0x56')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x45b1('0x3f')][_0x45b1('0x39')]({'where':{'id':_0x59f7e1[_0x45b1('0x56')]['id'],'role':_0x45b1('0x2d')},'attributes':['id',_0x45b1('0x3a'),_0x45b1('0x2c'),_0x45b1('0x6a'),'interface',_0x45b1('0xa1')]});})[_0x45b1('0x18')](handleEntityNotFound(_0x4f944a,null))[_0x45b1('0x18')](function(_0x157181){if(_0x157181){_0x1fad8f=_0x157181;return respondWithRpcPromise(_0x45b1('0x100'),_0x45b1('0xff'),{'id':_0x1fad8f['id'],'name':_0x1fad8f['name'],'pause':!![]});}})[_0x45b1('0x18')](function(){if(_0x1fad8f){return db[_0x45b1('0xf6')]['findAll']({'where':{'membername':_0x1fad8f[_0x45b1('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0x45b1('0x18')](function(_0x2c638a){if(_0x2c638a[_0x45b1('0x51')]){var _0x4de898=moment()[_0x45b1('0xae')](_0x45b1('0xf9'));for(var _0x10b68f=0x0,_0x2b7cff=_0x2c638a[_0x45b1('0x51')];_0x10b68f<_0x2b7cff;_0x10b68f++){_0x2c638a[_0x10b68f]['updateAttributes']({'exitAt':_0x4de898});}}})[_0x45b1('0x18')](function(){var _0xa86aba=[];var _0x168ac9=utils[_0x45b1('0xf8')]();_0x168ac9[_0x45b1('0xf7')](function(_0x2d02a6){_0xa86aba['push']({'channel':_0x2d02a6,'membername':_0x1fad8f[_0x45b1('0x3a')],'interface':_[_0x45b1('0x6b')](_0x1fad8f[_0x45b1('0xa3')])?util[_0x45b1('0xae')](_0x45b1('0xaf'),_0x1fad8f[_0x45b1('0x3a')]):_0x1fad8f[_0x45b1('0xa3')],'type':_0x45b1('0x101'),'enterAt':moment()[_0x45b1('0xae')](_0x45b1('0xf9')),'data1':_0x59f7e1[_0x45b1('0x62')][_0x45b1('0x41')]||_0x45b1('0x102'),'role':_0x1fad8f['role'],'internal':_0x1fad8f[_0x45b1('0x6a')]});});return db[_0x45b1('0xf6')]['bulkCreate'](_0xa86aba,{'individualHooks':!![]});})['then'](function(){return _0x1fad8f[_0x45b1('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x59f7e1[_0x45b1('0x62')]['type']||_0x45b1('0x102'),'lastPauseAt':moment()[_0x45b1('0xae')](_0x45b1('0xf9'))});})[_0x45b1('0x18')](respondWithResult(_0x4f944a,null))[_0x45b1('0x21')](handleError(_0x4f944a,null));};exports[_0x45b1('0x103')]=function(_0x245afd,_0x5274d5){if(_0x245afd['body'][_0x45b1('0xa0')]&&!utils['isValidChannel'](_0x245afd[_0x45b1('0x62')][_0x45b1('0xa0')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x245afd[_0x45b1('0x62')]['channel']));}return db['User']['find']({'where':{'id':_0x245afd[_0x45b1('0x56')]['id']},'attributes':['id',_0x45b1('0x3a'),'role',_0x45b1('0x6a'),_0x45b1('0xa3'),_0x45b1('0xa1'),_0x45b1('0xb0'),_0x45b1('0x104'),_0x45b1('0x105'),_0x45b1('0x106'),_0x45b1('0x107'),_0x45b1('0x108'),_0x45b1('0x109'),_0x45b1('0x10a'),_0x45b1('0x10b')]})[_0x45b1('0x18')](function(_0x5cfef9){if(!_0x5cfef9){throw new APINotFoundError(util[_0x45b1('0xae')](_0x45b1('0x10c'),_0x245afd[_0x45b1('0x56')]['id']));}return _0x5cfef9[_0x45b1('0x103')](_0x245afd['body'][_0x45b1('0xa0')]);})['then'](respondWithResult(_0x5274d5,null))[_0x45b1('0x21')](APIHandleError(_0x5274d5));};exports['getTeams']=function(_0x105b97,_0x1ebff8){var _0x15a41d={};var _0x284a16={};var _0x4e7b01;var _0x30690e;return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x105b97[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x1ebff8,null))['then'](function(_0x2b1d58){if(_0x2b1d58){_0x4e7b01=_0x2b1d58;_0x284a16[_0x45b1('0x57')]=_[_0x45b1('0x58')](db[_0x45b1('0x10d')][_0x45b1('0x40')]);_0x284a16[_0x45b1('0x47')]=_['keys'](_0x105b97['query']);_0x284a16[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x284a16[_0x45b1('0x57')],_0x284a16[_0x45b1('0x47')]);_0x15a41d['attributes']=_['intersection'](_0x284a16[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x105b97[_0x45b1('0x47')][_0x45b1('0x5c')]));_0x15a41d[_0x45b1('0x4c')]=_0x15a41d[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x15a41d['attributes']:_0x284a16[_0x45b1('0x57')];_0x15a41d[_0x45b1('0xcd')]=qs[_0x45b1('0xce')](_0x105b97[_0x45b1('0x47')][_0x45b1('0xce')]);_0x15a41d['where']=qs[_0x45b1('0x5a')](_[_0x45b1('0xcf')](_0x105b97[_0x45b1('0x47')],_0x284a16[_0x45b1('0x5a')]));if(_0x105b97['query'][_0x45b1('0x35')]){_0x15a41d[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x15a41d['where'],{'$or':_['map'](_0x15a41d[_0x45b1('0x4c')],function(_0x2bd985){var _0x5203fa={};_0x5203fa[_0x2bd985]={'$like':'%'+_0x105b97[_0x45b1('0x47')][_0x45b1('0x35')]+'%'};return _0x5203fa;})});}_0x15a41d=_['merge']({},_0x15a41d,_0x105b97['options']);return _0x4e7b01[_0x45b1('0x10e')](_0x15a41d);}})['then'](function(_0x30d0f9){if(_0x30d0f9){_0x30690e=_0x30d0f9[_0x45b1('0x51')];if(!_0x105b97[_0x45b1('0x47')][_0x45b1('0xd2')](_0x45b1('0xd8'))){_0x15a41d['limit']=qs[_0x45b1('0x29')](_0x105b97[_0x45b1('0x47')][_0x45b1('0x29')]);_0x15a41d[_0x45b1('0x26')]=qs[_0x45b1('0x26')](_0x105b97['query']['offset']);}return _0x4e7b01[_0x45b1('0x10e')](_0x15a41d);}})[_0x45b1('0x18')](function(_0x4a788d){if(_0x4a788d){return _0x4a788d?{'count':_0x30690e,'rows':_0x4a788d}:null;}})[_0x45b1('0x18')](respondWithResult(_0x1ebff8,null))[_0x45b1('0x21')](handleError(_0x1ebff8,null));};exports['addTeams']=function(_0x39bffc,_0x420d65){var _0x155e0b=_0x39bffc['params']['id'];var _0x42adbe=_0x39bffc[_0x45b1('0x62')]?_0x39bffc[_0x45b1('0x62')][_0x45b1('0x65')]:null;var _0x5624e5=[];return Promise['resolve']()[_0x45b1('0x18')](function(){if(!_0x42adbe)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x45b1('0x18')](function(){return db[_0x45b1('0x3f')]['findOne']({'where':{'id':_0x155e0b}});})[_0x45b1('0x18')](function(_0x466551){if(!_0x466551)throw new APINotFoundError(util[_0x45b1('0xae')](_0x45b1('0x10c'),_0x39bffc[_0x45b1('0x56')]['id']));return db[_0x45b1('0x6e')][_0x45b1('0x10f')](function(_0x50488c){return _0x466551['addTeams'](_0x42adbe,{'transaction':_0x50488c})[_0x45b1('0x18')](function(){return db['Team'][_0x45b1('0x4e')]({'where':{'id':{'$in':_0x42adbe}}});})[_0x45b1('0x18')](function(_0x5906e3){var _0x464592=_[_0x45b1('0x37')](_0x5906e3,function(_0x2b2fe9){return _0x2b2fe9[_0x45b1('0x110')]();});return Promise['all'](_0x464592);})[_0x45b1('0x18')](function(_0x104974){_0x5624e5=_['flattenDeep'](_0x104974);var _0x542347=_[_0x45b1('0x37')](_0x5624e5,function(_0x98dc15){return _0x98dc15['addAgent'](_0x466551['id'],{'transaction':_0x50488c});});return Promise[_0x45b1('0x54')](_0x542347);})[_0x45b1('0x18')](function(){if(!_0x466551['online'])return;var _0x33d6e9=_['filter'](_0x5624e5,function(_0x2a9859){return _0x2a9859['getDataValue'](_0x45b1('0xa0'))===_0x45b1('0x111');});var _0x15c11a=_[_0x45b1('0x37')](_0x33d6e9,function(_0x2b4b2d){return db[_0x45b1('0xb5')][_0x45b1('0xb1')]({'membername':_0x466551['name'],'UserId':_0x466551['id'],'queue_name':_0x2b4b2d[_0x45b1('0x3a')],'VoiceQueueId':_0x2b4b2d['id'],'interface':_['isNil'](_0x466551[_0x45b1('0xa3')])?util[_0x45b1('0xae')](_0x45b1('0xaf'),_0x466551[_0x45b1('0x3a')]):_0x466551['interface'],'paused':_0x466551[_0x45b1('0xb0')]||![],'penalty':_0x466551[_0x45b1('0xa7')]},{'transaction':_0x50488c});});return Promise['all'](_0x15c11a);})[_0x45b1('0x18')](function(){return db[_0x45b1('0x112')][_0x45b1('0x4e')]({'where':{'teamId':{'$in':_0x42adbe}}});})['then'](function(_0x269812){var _0x2102e3=_[_0x45b1('0x37')](_0x269812,function(_0x2dadd1){return db[_0x45b1('0x113')]['create']({'UserId':_0x466551['id'],'VoicePrefixId':_0x2dadd1[_0x45b1('0x114')]},{'transaction':_0x50488c});});return Promise[_0x45b1('0x54')](_0x2102e3);});});})[_0x45b1('0x18')](function(){for(var _0x8d74df=0x0;_0x8d74df<_0x5624e5[_0x45b1('0x51')];_0x8d74df++){var _0x1adef9=_0x5624e5[_0x8d74df][_0x45b1('0x115')](_0x45b1('0xa0'));var _0x36b25c=_0x1adef9+_0x45b1('0xaa');socket[_0x45b1('0x2e')](_0x45b1('0x32')+_0x1adef9+_0x45b1('0xab'),{'UserId':_0x155e0b,['queueField']:_0x5624e5[_0x8d74df]['id']});}})['then'](respondWithStatusCode(_0x420d65,null))[_0x45b1('0x21')](APIHandleError(_0x420d65));};exports['removeTeams']=function(_0x24f2af,_0x5a5346){var _0x1c26cb=_0x24f2af[_0x45b1('0x56')]['id'];var _0x2e7ecd=null;if(_0x24f2af[_0x45b1('0x47')][_0x45b1('0x65')]){_0x2e7ecd=_[_0x45b1('0x116')](_0x24f2af[_0x45b1('0x47')][_0x45b1('0x65')])?_0x24f2af[_0x45b1('0x47')][_0x45b1('0x65')]:[_0x24f2af[_0x45b1('0x47')]['ids']];}var _0xc59f73=[];return Promise[_0x45b1('0xfe')]()[_0x45b1('0x18')](function(){if(!_0x2e7ecd)throw new APIBadRequestError(_0x45b1('0x117'));})[_0x45b1('0x18')](function(){return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x1c26cb}});})[_0x45b1('0x18')](function(_0x274083){if(!_0x274083)throw new APINotFoundError(util[_0x45b1('0xae')]('User\x20with\x20id\x20%s\x20not\x20found',_0x24f2af[_0x45b1('0x56')]['id']));return db[_0x45b1('0x6e')][_0x45b1('0x10f')](function(_0x11d088){return _0x274083['removeTeams'](_0x2e7ecd,{'transaction':_0x11d088})[_0x45b1('0x18')](function(){return db[_0x45b1('0x10d')]['findAll']({'where':{'id':{'$in':_0x2e7ecd}}});})[_0x45b1('0x18')](function(_0x5a8032){var _0x522b72=_[_0x45b1('0x37')](_0x5a8032,function(_0x2e7d13){return _0x2e7d13[_0x45b1('0x110')]();});return Promise[_0x45b1('0x54')](_0x522b72);})[_0x45b1('0x18')](function(_0x50ca8b){_0xc59f73=_[_0x45b1('0x118')](_0x50ca8b);var _0x3e6797=_['map'](_0xc59f73,function(_0x2f1dc8){return _0x2f1dc8[_0x45b1('0x119')](_0x274083['id'],{'transaction':_0x11d088});});return Promise[_0x45b1('0x54')](_0x3e6797);})[_0x45b1('0x18')](function(){if(!_0x274083[_0x45b1('0xa1')])return;var _0x5a5c43=_[_0x45b1('0x35')](_0xc59f73,function(_0x11d09a){return _0x11d09a[_0x45b1('0x115')]('channel')===_0x45b1('0x111');});var _0x821481=_[_0x45b1('0x37')](_0x5a5c43,function(_0x3873ea){return db[_0x45b1('0xb5')][_0x45b1('0x3c')]({'where':{'VoiceQueueId':_0x3873ea['id'],'UserId':_0x274083['id']},'transaction':_0x11d088});});return Promise['all'](_0x821481);})[_0x45b1('0x18')](function(){return db[_0x45b1('0x112')][_0x45b1('0x4e')]({'where':{'teamId':{'$in':_0x2e7ecd}}});})[_0x45b1('0x18')](function(_0x2f46ab){var _0x7ecb2e=_['map'](_0x2f46ab,function(_0x51acad){return db['UserVoicePrefix'][_0x45b1('0x3c')]({'where':{'UserId':_0x274083['id'],'VoicePrefixId':_0x51acad[_0x45b1('0x114')]}},{'transaction':_0x11d088});});return Promise[_0x45b1('0x54')](_0x7ecb2e);});});})[_0x45b1('0x18')](function(){for(var _0x5803f4=0x0;_0x5803f4<_0xc59f73[_0x45b1('0x51')];_0x5803f4++){var _0x7ae639=_0xc59f73[_0x5803f4][_0x45b1('0x115')](_0x45b1('0xa0'));var _0x965b0c=_0x7ae639+_0x45b1('0xaa');socket[_0x45b1('0x2e')]('user'+_0x7ae639+'Queue:remove',{'UserId':_0x1c26cb,['queueField']:_0xc59f73[_0x5803f4]['id']});}})[_0x45b1('0x18')](respondWithStatusCode(_0x5a5346,null))[_0x45b1('0x21')](APIHandleError(_0x5a5346));};exports[_0x45b1('0x11a')]=function(_0x39bf5c,_0x4d9884){var _0x3e44d0={};var _0x5b3847={};var _0x1aca6c;var _0xfe1a4c;return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x39bf5c[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x4d9884,null))[_0x45b1('0x18')](function(_0x12849d){if(_0x12849d){_0x1aca6c=_0x12849d;_0x5b3847[_0x45b1('0x57')]=_[_0x45b1('0x58')](db[_0x45b1('0xd3')][_0x45b1('0x40')]);_0x5b3847['query']=_[_0x45b1('0x58')](_0x39bf5c[_0x45b1('0x47')]);_0x5b3847['filters']=_[_0x45b1('0x5b')](_0x5b3847[_0x45b1('0x57')],_0x5b3847[_0x45b1('0x47')]);_0x3e44d0['attributes']=_[_0x45b1('0x5b')](_0x5b3847[_0x45b1('0x57')],qs['fields'](_0x39bf5c[_0x45b1('0x47')][_0x45b1('0x5c')]));_0x3e44d0['attributes']=_0x3e44d0[_0x45b1('0x4c')][_0x45b1('0x51')]?_0x3e44d0[_0x45b1('0x4c')]:_0x5b3847[_0x45b1('0x57')];_0x3e44d0[_0x45b1('0xcd')]=qs[_0x45b1('0xce')](_0x39bf5c[_0x45b1('0x47')]['sort']);_0x3e44d0['where']=qs['filters'](_[_0x45b1('0xcf')](_0x39bf5c[_0x45b1('0x47')],_0x5b3847[_0x45b1('0x5a')]));if(_0x39bf5c[_0x45b1('0x47')]['filter']){_0x3e44d0['where']=_['merge'](_0x3e44d0['where'],{'$or':_[_0x45b1('0x37')](_0x3e44d0[_0x45b1('0x4c')],function(_0x53774e){var _0x530ae6={};_0x530ae6[_0x53774e]={'$like':'%'+_0x39bf5c['query'][_0x45b1('0x35')]+'%'};return _0x530ae6;})});}_0x3e44d0=_[_0x45b1('0xd0')]({},_0x3e44d0,_0x39bf5c[_0x45b1('0xd1')]);return _0x1aca6c[_0x45b1('0x11a')](_0x3e44d0);}})['then'](function(_0x56478b){if(_0x56478b){_0xfe1a4c=_0x56478b[_0x45b1('0x51')];if(!_0x39bf5c[_0x45b1('0x47')][_0x45b1('0xd2')]('nolimit')){_0x3e44d0['limit']=qs['limit'](_0x39bf5c[_0x45b1('0x47')][_0x45b1('0x29')]);_0x3e44d0[_0x45b1('0x26')]=qs[_0x45b1('0x26')](_0x39bf5c[_0x45b1('0x47')][_0x45b1('0x26')]);}return _0x1aca6c['getLists'](_0x3e44d0);}})[_0x45b1('0x18')](function(_0x4e0cd3){if(_0x4e0cd3){return _0x4e0cd3?{'count':_0xfe1a4c,'rows':_0x4e0cd3}:null;}})['then'](respondWithResult(_0x4d9884,null))[_0x45b1('0x21')](handleError(_0x4d9884,null));};exports[_0x45b1('0x11b')]=function(_0x32033d,_0x2e5b5f){var _0x457faa={};var _0x3ce4b4={};var _0x4176f9;return db[_0x45b1('0x3f')][_0x45b1('0xcb')]({'where':{'id':_0x32033d[_0x45b1('0x56')]['id']}})[_0x45b1('0x18')](handleEntityNotFound(_0x2e5b5f,null))[_0x45b1('0x18')](function(_0x36ad31){if(_0x36ad31){_0x4176f9=_0x36ad31;_0x3ce4b4[_0x45b1('0x57')]=_[_0x45b1('0x58')](db[_0x45b1('0x3f')][_0x45b1('0x40')]);_0x3ce4b4[_0x45b1('0x47')]=_[_0x45b1('0x58')](_0x32033d[_0x45b1('0x47')]);_0x3ce4b4[_0x45b1('0x5a')]=_[_0x45b1('0x5b')](_0x3ce4b4['model'],_0x3ce4b4['query']);_0x457faa[_0x45b1('0x4c')]=_[_0x45b1('0x5b')](_0x3ce4b4[_0x45b1('0x57')],qs[_0x45b1('0x5c')](_0x32033d[_0x45b1('0x47')][_0x45b1('0x5c')]));_0x457faa[_0x45b1('0x4c')]=_0x457faa['attributes'][_0x45b1('0x51')]?_0x457faa[_0x45b1('0x4c')]:_0x3ce4b4[_0x45b1('0x57')];_0x457faa[_0x45b1('0xcd')]=qs[_0x45b1('0xce')](_0x32033d['query'][_0x45b1('0xce')]);_0x457faa[_0x45b1('0x46')]=qs[_0x45b1('0x5a')](_[_0x45b1('0xcf')](_0x32033d[_0x45b1('0x47')],_0x3ce4b4['filters']));if(_0x32033d[_0x45b1('0x47')][_0x45b1('0x35')]){_0x457faa[_0x45b1('0x46')]=_[_0x45b1('0xd0')](_0x457faa[_0x45b1('0x46')],{'$or':_[_0x45b1('0x37')](_0x457faa[_0x45b1('0x4c')],function(_0x11bafc){var _0x1c5ee6={};_0x1c5ee6[_0x11bafc]={'$like':'%'+_0x32033d[_0x45b1('0x47')][_0x45b1('0x35')]+'%'};return _0x1c5ee6;})});}_0x457faa['model']=db[_0x45b1('0x3f')];_0x457faa['as']=_0x45b1('0x33');_0x457faa=_[_0x45b1('0xd0')]({},_0x457faa,_0x32033d[_0x45b1('0xd1')]);return _0x4176f9[_0x45b1('0x11c')]({'include':[_0x457faa]});}})[_0x45b1('0x18')](function(_0x4d13a3){if(_0x4d13a3){var _0x4355c1={},_0x369681=[];for(var _0x16fc8a=0x0;_0x16fc8a<_0x4d13a3['length'];_0x16fc8a+=0x1){for(var _0x108596=0x0,_0x1f64ab;_0x108596<_0x4d13a3[_0x16fc8a][_0x45b1('0x33')][_0x45b1('0x51')];_0x108596+=0x1){_0x1f64ab=_0x4d13a3[_0x16fc8a][_0x45b1('0x33')][_0x108596][_0x45b1('0x30')]({'plain':!![]});_0x4355c1[_0x1f64ab['id']]=_0x1f64ab;}}_0x4355c1=_[_0x45b1('0x11d')](_0x4355c1);for(var _0x4fd53d=qs['offset'](_0x32033d['query'][_0x45b1('0x26')]);_0x4fd53d<_0x4355c1[_0x45b1('0x51')]&&_0x369681[_0x45b1('0x51')]=_0x30de0d['agents']){throw new Error(_0x8cb5('0x4e'));}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){return db[_0x8cb5('0x4f')]['destroy']({'where':{'membername':_0x4db2d4['name']},'individualHooks':!![]});}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){return _0x4db2d4[_0x8cb5('0x50')]({'raw':!![]});}})[_0x8cb5('0x17')](function(_0x22d883){if(_0x4db2d4){if(_0x22d883){var _0x3ab76f=[];_0x5efd59=_0x22d883;if(_0x5efd59[_0x8cb5('0x25')]){for(var _0x33825d=0x0;_0x33825d<_0x5efd59[_0x8cb5('0x25')];_0x33825d++){_0x3ab76f['push'](db['UserVoiceQueueRt'][_0x8cb5('0x51')]({'membername':_0x4db2d4['name'],'UserId':_0x4db2d4['id'],'queue_name':_0x5efd59[_0x33825d]['name'],'VoiceQueueId':_0x5efd59[_0x33825d]['id'],'interface':_0x394e29,'paused':_0x4db2d4['loginInPause']||![],'penalty':_0x5efd59[_0x33825d]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x3ab76f);}}}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){return db['MemberReport'][_0x8cb5('0x24')]({'where':{'membername':_0x4db2d4[_0x8cb5('0x2d')],'exitAt':null}});}})[_0x8cb5('0x17')](function(_0x312f5c){if(_0x4db2d4){if(_0x312f5c&&_0x312f5c[_0x8cb5('0x25')]){var _0x2af7fc=[];_0x312f5c[_0x8cb5('0x29')](function(_0x4abb48){_0x2af7fc['push'](_0x4abb48[_0x8cb5('0x22')]({'exitAt':moment()[_0x8cb5('0x26')](_0x8cb5('0x27'))}));});return BPromise['all'](_0x2af7fc);}}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){var _0x55bfcb=[];var _0x3c4cac=[];var _0x4c4d3b=utils[_0x8cb5('0x28')]();var _0x115a53={'membername':_0x4db2d4[_0x8cb5('0x2d')],'interface':_0x394e29,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x4db2d4[_0x8cb5('0x20')],'internal':_0x4db2d4[_0x8cb5('0x21')]};_0x4c4d3b[_0x8cb5('0x29')](function(_0xf2d2bf){_0x55bfcb['push'](_[_0x8cb5('0x52')]({'channel':_0xf2d2bf,'type':_0x8cb5('0x53'),'data1':_0x8cb5('0x54'),'data2':_0x394e29},_0x115a53));if(_0x4db2d4[_0x8cb5('0x48')]){_0x3c4cac[_0x8cb5('0x2a')](_[_0x8cb5('0x52')]({'channel':_0xf2d2bf,'type':'PAUSE','data1':_0x8cb5('0x55')},_0x115a53));}});return db[_0x8cb5('0x23')][_0x8cb5('0x31')](_0x55bfcb[_0x8cb5('0x56')](_0x3c4cac),{'individualHooks':!![]});}})[_0x8cb5('0x17')](function(){if(_0x4db2d4){return _0x4db2d4[_0x8cb5('0x22')]({'online':!![],'lastLoginAt':moment()[_0x8cb5('0x26')](_0x8cb5('0x27')),'voicePause':_0x4db2d4[_0x8cb5('0x48')]||![],'mailPause':_0x4db2d4['loginInPause']||![],'chatPause':_0x4db2d4[_0x8cb5('0x48')]||![],'faxPause':_0x4db2d4[_0x8cb5('0x48')]||![],'smsPause':_0x4db2d4[_0x8cb5('0x48')]||![],'openchannelPause':_0x4db2d4[_0x8cb5('0x48')]||![],'pauseType':_0x4db2d4['loginInPause']?_0x8cb5('0x55'):null,'lastPauseAt':moment()[_0x8cb5('0x26')](_0x8cb5('0x27')),'interface':_0x394e29});}})[_0x8cb5('0x17')](function(_0x1545f7){_0x2f373f(_0x1545f7);})[_0x8cb5('0x1e')](function(_0x4d2494){_0x69aa7c(_0x46ea38[_0x8cb5('0x1b')](0x1f4,_0x4d2494[_0x8cb5('0x1c')]));});});}; \ No newline at end of file +var _0xa11b=['mobile','phone','loginInPause','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','PAUSE','LOGININPAUSE','bulkCreate','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','findAll','raw','options','where','limit','include','map','model','attributes','then','info','GetUser','stringify','catch','error','message','ShowUser','User','find','debug','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','length','updateAttributes','getChannels','push','format','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','uniqueid','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','voicePause','mailPause','chatPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params','system','LogoutUser','findOne','destroy','MemberReport','forEach','all'];(function(_0x2b7fe1,_0x278871){var _0x4232ca=function(_0x449d14){while(--_0x449d14){_0x2b7fe1['push'](_0x2b7fe1['shift']());}};_0x4232ca(++_0x278871);}(_0xa11b,0x69));var _0xba11=function(_0x73caba,_0x42f145){_0x73caba=_0x73caba-0x0;var _0x134e0d=_0xa11b[_0x73caba];return _0x134e0d;};'use strict';var _=require(_0xba11('0x0'));var util=require(_0xba11('0x1'));var moment=require(_0xba11('0x2'));var BPromise=require(_0xba11('0x3'));var Redis=require(_0xba11('0x4'));var db=require(_0xba11('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xba11('0x6'))(_0xba11('0x7'));var config=require(_0xba11('0x8'));config[_0xba11('0x9')]=_[_0xba11('0xa')](config[_0xba11('0x9')],{'host':_0xba11('0xb'),'port':0x18eb});var socket=require(_0xba11('0xc'))(new Redis(config[_0xba11('0x9')]));require(_0xba11('0xd'))[_0xba11('0xe')](socket);exports['GetUser']=function(_0x36c44f){var _0x2c4e24=this;return new Promise(function(_0x16a7f8,_0x2a8d68){return db['User'][_0xba11('0xf')]({'raw':_0x36c44f['options']?_0x36c44f['options'][_0xba11('0x10')]===undefined?!![]:![]:!![],'where':_0x36c44f['options']?_0x36c44f[_0xba11('0x11')][_0xba11('0x12')]||null:null,'attributes':_0x36c44f[_0xba11('0x11')]?_0x36c44f[_0xba11('0x11')]['attributes']||null:null,'limit':_0x36c44f[_0xba11('0x11')]?_0x36c44f[_0xba11('0x11')][_0xba11('0x13')]||null:null,'include':_0x36c44f[_0xba11('0x11')]?_0x36c44f[_0xba11('0x11')][_0xba11('0x14')]?_[_0xba11('0x15')](_0x36c44f[_0xba11('0x11')][_0xba11('0x14')],function(_0xeacbcc){return{'model':db[_0xeacbcc[_0xba11('0x16')]],'as':_0xeacbcc['as'],'attributes':_0xeacbcc['attributes'],'include':_0xeacbcc['include']?_[_0xba11('0x15')](_0xeacbcc[_0xba11('0x14')],function(_0x41dccc){return{'model':db[_0x41dccc[_0xba11('0x16')]],'as':_0x41dccc['as'],'attributes':_0x41dccc[_0xba11('0x17')],'include':_0x41dccc[_0xba11('0x14')]?_[_0xba11('0x15')](_0x41dccc[_0xba11('0x14')],function(_0x4b3649){return{'model':db[_0x4b3649[_0xba11('0x16')]],'as':_0x4b3649['as'],'attributes':_0x4b3649[_0xba11('0x17')]};}):[]};}):[]};}):[]:[]})[_0xba11('0x18')](function(_0x450b23){logger[_0xba11('0x19')]('GetUser',_0x36c44f);logger['debug'](_0xba11('0x1a'),_0x36c44f,JSON[_0xba11('0x1b')](_0x450b23));_0x16a7f8(_0x450b23);})[_0xba11('0x1c')](function(_0x2d0dc1){logger[_0xba11('0x1d')](_0xba11('0x1a'),_0x2d0dc1[_0xba11('0x1e')],_0x36c44f);_0x2a8d68(_0x2c4e24['error'](0x1f4,_0x2d0dc1[_0xba11('0x1e')]));});});};exports[_0xba11('0x1f')]=function(_0x47e803){var _0x3fa24b=this;return new Promise(function(_0xa062e0,_0x22cf17){return db[_0xba11('0x20')][_0xba11('0x21')]({'raw':_0x47e803[_0xba11('0x11')]?_0x47e803[_0xba11('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x47e803['options']?_0x47e803['options']['where']||null:null,'attributes':_0x47e803[_0xba11('0x11')]?_0x47e803[_0xba11('0x11')][_0xba11('0x17')]||null:null,'include':_0x47e803[_0xba11('0x11')]?_0x47e803['options'][_0xba11('0x14')]?_[_0xba11('0x15')](_0x47e803[_0xba11('0x11')][_0xba11('0x14')],function(_0x5a6a86){return{'model':db[_0x5a6a86[_0xba11('0x16')]],'as':_0x5a6a86['as'],'attributes':_0x5a6a86[_0xba11('0x17')],'include':_0x5a6a86[_0xba11('0x14')]?_['map'](_0x5a6a86[_0xba11('0x14')],function(_0x105107){return{'model':db[_0x105107['model']],'as':_0x105107['as'],'attributes':_0x105107[_0xba11('0x17')],'include':_0x105107[_0xba11('0x14')]?_['map'](_0x105107[_0xba11('0x14')],function(_0x3441b3){return{'model':db[_0x3441b3[_0xba11('0x16')]],'as':_0x3441b3['as'],'attributes':_0x3441b3[_0xba11('0x17')]};}):[]};}):[]};}):[]:[]})[_0xba11('0x18')](function(_0x70cf31){logger[_0xba11('0x19')]('ShowUser',_0x47e803);logger[_0xba11('0x22')](_0xba11('0x1f'),_0x47e803,JSON[_0xba11('0x1b')](_0x70cf31));_0xa062e0(_0x70cf31);})['catch'](function(_0x55917a){logger[_0xba11('0x1d')](_0xba11('0x1f'),_0x55917a[_0xba11('0x1e')],_0x47e803);_0x22cf17(_0x3fa24b[_0xba11('0x1d')](0x1f4,_0x55917a[_0xba11('0x1e')]));});});};exports[_0xba11('0x23')]=function(_0x1fe044){var _0x4b3052=this;return new Promise(function(_0xc7a61f,_0x1c6da3){var _0x47b7fe;return db[_0xba11('0x20')][_0xba11('0x21')]({'where':_0x1fe044[_0xba11('0x11')][_0xba11('0x12')]||{},'attributes':['id',_0xba11('0x24'),_0xba11('0x25'),_0xba11('0x26'),_0xba11('0x27')]})[_0xba11('0x18')](function(_0x46c30a){if(_0x46c30a){_0x47b7fe=_0x46c30a;return db[_0xba11('0x28')][_0xba11('0x29')]({'paused':0x1},{'where':{'UserId':_0x47b7fe['id']},'individualHooks':!![]});}})[_0xba11('0x18')](function(){if(_0x47b7fe){return db['MemberReport'][_0xba11('0xf')]({'where':{'membername':_0x47b7fe[_0xba11('0x24')],'type':'PAUSE','exitAt':null}});}})[_0xba11('0x18')](function(_0x1d543c){if(_0x47b7fe){if(_0x1d543c&&_0x1d543c[_0xba11('0x2a')]){var _0x1354dc=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2962d5=0x0,_0x33cce2=_0x1d543c[_0xba11('0x2a')];_0x2962d5<_0x33cce2;_0x2962d5++){_0x1d543c[_0x2962d5][_0xba11('0x2b')]({'exitAt':_0x1354dc});}}}})['then'](function(){if(_0x47b7fe){var _0x14df2d=[];var _0x2dc35e=utils[_0xba11('0x2c')]();_0x2dc35e['forEach'](function(_0xed2839){_0x14df2d[_0xba11('0x2d')]({'channel':_0xed2839,'membername':_0x47b7fe[_0xba11('0x24')],'interface':_['isNil'](_0x47b7fe[_0xba11('0x27')])?util[_0xba11('0x2e')](_0xba11('0x2f'),_0x47b7fe[_0xba11('0x24')]):_0x47b7fe['interface'],'type':'PAUSE','enterAt':moment()[_0xba11('0x2e')](_0xba11('0x30')),'data1':_0x1fe044[_0xba11('0x31')][_0xba11('0x32')]||_0xba11('0x33'),'role':_0x47b7fe[_0xba11('0x25')],'internal':_0x47b7fe[_0xba11('0x26')],'uniqueid':_0x1fe044[_0xba11('0x31')][_0xba11('0x34')]||null});});return db['MemberReport']['bulkCreate'](_0x14df2d,{'individualHooks':!![]});}})[_0xba11('0x18')](function(){if(_0x47b7fe){return _0x47b7fe[_0xba11('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x1fe044[_0xba11('0x31')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xba11('0x2e')](_0xba11('0x30'))});}})[_0xba11('0x18')](function(_0x45bcb2){_0xc7a61f(_0x45bcb2);})['catch'](function(_0x7b4ec4){_0x1c6da3(_0x4b3052[_0xba11('0x1d')](0x1f4,_0x7b4ec4[_0xba11('0x1e')]));});});};exports[_0xba11('0x35')]=function(_0x22ac98){var _0xb8fe3e=this;return new Promise(function(_0xb4c60c,_0xaecd4){if(_0x22ac98[_0xba11('0x31')][_0xba11('0x36')]&&!utils[_0xba11('0x37')](_0x22ac98[_0xba11('0x31')][_0xba11('0x36')])){throw new Error(util[_0xba11('0x2e')](_0xba11('0x38'),_0x22ac98['body'][_0xba11('0x36')]));}return db[_0xba11('0x20')]['findOne']({'where':_0x22ac98[_0xba11('0x11')][_0xba11('0x12')]||{},'attributes':['id',_0xba11('0x24'),'role',_0xba11('0x26'),_0xba11('0x27'),'online',_0xba11('0x39'),_0xba11('0x3a'),_0xba11('0x3b'),'faxPause',_0xba11('0x3c'),_0xba11('0x3d'),_0xba11('0x3e'),'pauseType',_0xba11('0x3f')]})[_0xba11('0x18')](function(_0x4f702d){if(!_0x4f702d){throw new Error(util[_0xba11('0x2e')](_0xba11('0x40'),_0x22ac98[_0xba11('0x41')]['id']));}return _0x4f702d['unpause'](_0x22ac98[_0xba11('0x31')][_0xba11('0x36')],_0xba11('0x42'));})['then'](function(_0x5b04f1){_0xb4c60c(_0x5b04f1);})['catch'](function(_0x8e9453){_0xaecd4(_0xb8fe3e[_0xba11('0x1d')](0x1f4,_0x8e9453[_0xba11('0x1e')]));});});};exports[_0xba11('0x43')]=function(_0xd607ce){var _0x30a1ad=this;return new Promise(function(_0x5bc904,_0x3d8e69){var _0x4b816c;return db[_0xba11('0x20')][_0xba11('0x44')]({'where':_0xd607ce[_0xba11('0x11')][_0xba11('0x12')]||{},'attributes':['id',_0xba11('0x24')]})['then'](function(_0x5aba30){if(_0x5aba30){_0x4b816c=_0x5aba30;return db[_0xba11('0x28')][_0xba11('0x45')]({'where':{'membername':_0x4b816c[_0xba11('0x24')]},'individualHooks':!![]});}})['then'](function(){if(_0x4b816c){return db[_0xba11('0x46')][_0xba11('0xf')]({'where':{'membername':_0x4b816c[_0xba11('0x24')],'exitAt':null}});}})[_0xba11('0x18')](function(_0x145b85){if(_0x4b816c){if(_0x145b85&&_0x145b85[_0xba11('0x2a')]){var _0x7135f7=[];_0x145b85[_0xba11('0x47')](function(_0x192b37){_0x7135f7['push'](_0x192b37[_0xba11('0x29')]({'exitAt':moment()[_0xba11('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xba11('0x48')](_0x7135f7);}}})['then'](function(){if(_0x4b816c){return _0x4b816c[_0xba11('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xba11('0x18')](function(_0x467004){_0x5bc904(_0x467004);})[_0xba11('0x1c')](function(_0x43843){_0x3d8e69(_0x30a1ad[_0xba11('0x1d')](0x1f4,_0x43843[_0xba11('0x1e')]));});});};exports['LoginUser']=function(_0x164925){var _0x26d5f6=this;return new Promise(function(_0x4d583c,_0x3834bd){var _0x4563a9;var _0x437db5;var _0x3be6b9;var _0x78ff4;return db[_0xba11('0x20')][_0xba11('0x44')]({'where':_0x164925['options'][_0xba11('0x12')]||{},'attributes':['id',_0xba11('0x24'),'role',_0xba11('0x49'),_0xba11('0x4a'),_0xba11('0x26'),_0xba11('0x4b'),_0xba11('0x27')]})[_0xba11('0x18')](function(_0x407784){if(_0x407784){_0x4563a9=_0x407784;_0x78ff4=_0x164925[_0xba11('0x31')]['interface']?_0x164925['body'][_0xba11('0x27')]:util[_0xba11('0x2e')](_0xba11('0x2f'),_0x4563a9[_0xba11('0x24')]);return db[_0xba11('0x20')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4563a9['id']}}});}})['then'](function(_0x4cd724){if(_0x4cd724){_0x3be6b9=_0x4cd724;return require('../../config/license/util')[_0xba11('0x4c')]();}})[_0xba11('0x18')](function(_0x472745){if(_0x472745&&_0x472745['agents']&&_0x3be6b9>=_0x472745[_0xba11('0x4d')]){throw new Error(_0xba11('0x4e'));}})[_0xba11('0x18')](function(){if(_0x4563a9){return db[_0xba11('0x28')][_0xba11('0x45')]({'where':{'membername':_0x4563a9['name']},'individualHooks':!![]});}})['then'](function(){if(_0x4563a9){return _0x4563a9[_0xba11('0x4f')]({'raw':!![]});}})['then'](function(_0x3f5575){if(_0x4563a9){if(_0x3f5575){var _0x4fc11d=[];_0x437db5=_0x3f5575;if(_0x437db5[_0xba11('0x2a')]){for(var _0xbdf7ef=0x0;_0xbdf7ef<_0x437db5[_0xba11('0x2a')];_0xbdf7ef++){_0x4fc11d[_0xba11('0x2d')](db[_0xba11('0x28')][_0xba11('0x50')]({'membername':_0x4563a9[_0xba11('0x24')],'UserId':_0x4563a9['id'],'queue_name':_0x437db5[_0xbdf7ef][_0xba11('0x24')],'VoiceQueueId':_0x437db5[_0xbdf7ef]['id'],'interface':_0x78ff4,'paused':_0x4563a9[_0xba11('0x4b')]||![],'penalty':_0x437db5[_0xbdf7ef][_0xba11('0x51')]||0x0}));}return BPromise[_0xba11('0x48')](_0x4fc11d);}}}})[_0xba11('0x18')](function(){if(_0x4563a9){return db['MemberReport']['findAll']({'where':{'membername':_0x4563a9[_0xba11('0x24')],'exitAt':null}});}})[_0xba11('0x18')](function(_0x538e30){if(_0x4563a9){if(_0x538e30&&_0x538e30[_0xba11('0x2a')]){var _0xb94015=[];_0x538e30[_0xba11('0x47')](function(_0x2e9511){_0xb94015[_0xba11('0x2d')](_0x2e9511[_0xba11('0x29')]({'exitAt':moment()[_0xba11('0x2e')](_0xba11('0x30'))}));});return BPromise[_0xba11('0x48')](_0xb94015);}}})[_0xba11('0x18')](function(){if(_0x4563a9){var _0xe9d372=[];var _0x42f1c0=[];var _0x471b08=utils[_0xba11('0x2c')]();var _0x549941={'membername':_0x4563a9[_0xba11('0x24')],'interface':_0x78ff4,'enterAt':moment()['format'](_0xba11('0x30')),'role':_0x4563a9['role'],'internal':_0x4563a9[_0xba11('0x26')]};_0x471b08[_0xba11('0x47')](function(_0x4ff0e8){_0xe9d372[_0xba11('0x2d')](_[_0xba11('0x52')]({'channel':_0x4ff0e8,'type':_0xba11('0x53'),'data1':_0xba11('0x54'),'data2':_0x78ff4},_0x549941));if(_0x4563a9['loginInPause']){_0x42f1c0[_0xba11('0x2d')](_[_0xba11('0x52')]({'channel':_0x4ff0e8,'type':_0xba11('0x55'),'data1':_0xba11('0x56')},_0x549941));}});return db[_0xba11('0x46')][_0xba11('0x57')](_0xe9d372[_0xba11('0x58')](_0x42f1c0),{'individualHooks':!![]});}})['then'](function(){if(_0x4563a9){return _0x4563a9[_0xba11('0x29')]({'online':!![],'lastLoginAt':moment()['format'](_0xba11('0x30')),'voicePause':_0x4563a9[_0xba11('0x4b')]||![],'mailPause':_0x4563a9[_0xba11('0x4b')]||![],'chatPause':_0x4563a9[_0xba11('0x4b')]||![],'faxPause':_0x4563a9[_0xba11('0x4b')]||![],'smsPause':_0x4563a9[_0xba11('0x4b')]||![],'openchannelPause':_0x4563a9[_0xba11('0x4b')]||![],'pauseType':_0x4563a9['loginInPause']?_0xba11('0x56'):null,'lastPauseAt':moment()[_0xba11('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x78ff4});}})['then'](function(_0x51d274){_0x4d583c(_0x51d274);})[_0xba11('0x1c')](function(_0x23344b){_0x3834bd(_0x26d5f6[_0xba11('0x1d')](0x1f4,_0x23344b[_0xba11('0x1e')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 142ce58..20c5fc4 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 _0x2f8a=['update','emit','length','save'];(function(_0xd45ed0,_0x482068){var _0x17f4ea=function(_0x3074eb){while(--_0x3074eb){_0xd45ed0['push'](_0xd45ed0['shift']());}};_0x17f4ea(++_0x482068);}(_0x2f8a,0x1d7));var _0xa2f8=function(_0x32ce4f,_0x11a0b8){_0x32ce4f=_0x32ce4f-0x0;var _0x53a7f9=_0x2f8a[_0x32ce4f];return _0x53a7f9;};'use strict';var UserEvents=require('./user.events');var events=[_0xa2f8('0x0'),'remove',_0xa2f8('0x1')];function createListener(_0x5c69c6,_0x1598f6){return function(_0x1666c2){_0x1598f6[_0xa2f8('0x2')](_0x5c69c6,_0x1666c2);};}function removeListener(_0x13ed01,_0x345061){return function(){UserEvents['removeListener'](_0x13ed01,_0x345061);};}exports['register']=function(_0xf0d6ed){for(var _0x4d59b6=0x0,_0x21de8d=events[_0xa2f8('0x3')];_0x4d59b6<_0x21de8d;_0x4d59b6++){var _0x2886f1=events[_0x4d59b6];var _0x23e340=createListener('user:'+_0x2886f1,_0xf0d6ed);UserEvents['on'](_0x2886f1,_0x23e340);}}; \ No newline at end of file +var _0x369a=['register','length','user:','remove','update','emit'];(function(_0x35a819,_0x5bac0a){var _0x51f10c=function(_0x2035ea){while(--_0x2035ea){_0x35a819['push'](_0x35a819['shift']());}};_0x51f10c(++_0x5bac0a);}(_0x369a,0xcf));var _0xa369=function(_0x41477e,_0x4ff3f1){_0x41477e=_0x41477e-0x0;var _0x3ef007=_0x369a[_0x41477e];return _0x3ef007;};'use strict';var UserEvents=require('./user.events');var events=['save',_0xa369('0x0'),_0xa369('0x1')];function createListener(_0x1fc8df,_0x37c05e){return function(_0x2da0a7){_0x37c05e[_0xa369('0x2')](_0x1fc8df,_0x2da0a7);};}function removeListener(_0x95d1f5,_0xb4c1c4){return function(){UserEvents['removeListener'](_0x95d1f5,_0xb4c1c4);};}exports[_0xa369('0x3')]=function(_0x5af8aa){for(var _0x509fa7=0x0,_0x5b04ce=events[_0xa369('0x4')];_0x509fa7<_0x5b04ce;_0x509fa7++){var _0x15f195=events[_0x509fa7];var _0x3898c1=createListener(_0xa369('0x5')+_0x15f195,_0x5af8aa);UserEvents['on'](_0x15f195,_0x3898c1);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 9774367..ea95587 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2041a4,_0x55946d){var _0x5464b8=function(_0x5c6d2f){while(--_0x5c6d2f){_0x2041a4['push'](_0x2041a4['shift']());}};_0x5464b8(++_0x55946d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x196982,_0x4ba1e7){var _0x4d8b33=function(_0x1ea4e4){while(--_0x1ea4e4){_0x196982['push'](_0x196982['shift']());}};_0x4d8b33(++_0x4ba1e7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index afc28b8..e41c0c9 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 _0xd7f0=['INTEGER','sequelize','exports'];(function(_0x2d74e4,_0x4543c4){var _0x4868cb=function(_0x3366b9){while(--_0x3366b9){_0x2d74e4['push'](_0x2d74e4['shift']());}};_0x4868cb(++_0x4543c4);}(_0xd7f0,0x145));var _0x0d7f=function(_0x571ecc,_0x57f9c8){_0x571ecc=_0x571ecc-0x0;var _0x411653=_0xd7f0[_0x571ecc];return _0x411653;};'use strict';var Sequelize=require(_0x0d7f('0x0'));module[_0x0d7f('0x1')]={'penalty':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x18c3=['INTEGER','sequelize','exports'];(function(_0x5bf0d7,_0x102884){var _0x33ceb5=function(_0x261b30){while(--_0x261b30){_0x5bf0d7['push'](_0x5bf0d7['shift']());}};_0x33ceb5(++_0x102884);}(_0x18c3,0x136));var _0x318c=function(_0x106237,_0xa9e23a){_0x106237=_0x106237-0x0;var _0x4b15c5=_0x18c3[_0x106237];return _0x4b15c5;};'use strict';var Sequelize=require(_0x318c('0x0'));module[_0x318c('0x1')]={'penalty':{'type':Sequelize[_0x318c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 8972023..409fac6 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 _0x247e=['exports','define','UserChatQueue','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x77651c,_0x2bd29b){var _0x1cba5d=function(_0x241ab3){while(--_0x241ab3){_0x77651c['push'](_0x77651c['shift']());}};_0x1cba5d(++_0x2bd29b);}(_0x247e,0xcb));var _0xe247=function(_0xe2c701,_0x42c78d){_0xe2c701=_0xe2c701-0x0;var _0x36db09=_0x247e[_0xe2c701];return _0x36db09;};'use strict';var _=require('lodash');var util=require(_0xe247('0x0'));var logger=require('../../config/logger')(_0xe247('0x1'));var moment=require(_0xe247('0x2'));var BPromise=require(_0xe247('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe247('0x4'));var rimraf=require(_0xe247('0x5'));var config=require(_0xe247('0x6'));var attributes=require('./userChatQueue.attributes');module[_0xe247('0x7')]=function(_0x283e33,_0x16c855){return _0x283e33[_0xe247('0x8')](_0xe247('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2f0=['bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment'];(function(_0x469d12,_0x2fdb73){var _0x42ca37=function(_0x542ace){while(--_0x542ace){_0x469d12['push'](_0x469d12['shift']());}};_0x42ca37(++_0x2fdb73);}(_0xe2f0,0x122));var _0x0e2f=function(_0x54fc1f,_0x1703c2){_0x54fc1f=_0x54fc1f-0x0;var _0x53f699=_0xe2f0[_0x54fc1f];return _0x53f699;};'use strict';var _=require(_0x0e2f('0x0'));var util=require('util');var logger=require(_0x0e2f('0x1'))(_0x0e2f('0x2'));var moment=require(_0x0e2f('0x3'));var BPromise=require(_0x0e2f('0x4'));var rp=require(_0x0e2f('0x5'));var fs=require('fs');var path=require(_0x0e2f('0x6'));var rimraf=require(_0x0e2f('0x7'));var config=require(_0x0e2f('0x8'));var attributes=require(_0x0e2f('0x9'));module[_0x0e2f('0xa')]=function(_0x52585b,_0x5711ac){return _0x52585b[_0x0e2f('0xb')](_0x0e2f('0xc'),attributes,{'tableName':_0x0e2f('0xd'),'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 7993dc5..4dda1ae 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 _0xdb4b=['info','debug','stringify','error','message','UserChatQueue,\x20%s,\x20%s','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x565e4d,_0x23d683){var _0x47e665=function(_0x85d9e){while(--_0x85d9e){_0x565e4d['push'](_0x565e4d['shift']());}};_0x47e665(++_0x23d683);}(_0xdb4b,0x15d));var _0xbdb4=function(_0xcd3806,_0x3182ad){_0xcd3806=_0xcd3806-0x0;var _0x5e3594=_0xdb4b[_0xcd3806];return _0x5e3594;};'use strict';var _=require(_0xbdb4('0x0'));var util=require('util');var moment=require(_0xbdb4('0x1'));var BPromise=require(_0xbdb4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdb4('0x3'));var db=require(_0xbdb4('0x4'))['db'];var utils=require(_0xbdb4('0x5'));var logger=require(_0xbdb4('0x6'))(_0xbdb4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbdb4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x463394,_0x4432a5,_0x16cc80){return new BPromise(function(_0x52bbd1,_0x406d05){return client[_0xbdb4('0x9')](_0x463394,_0x16cc80)[_0xbdb4('0xa')](function(_0x130b66){logger[_0xbdb4('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x4432a5,'request\x20sent');logger[_0xbdb4('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x4432a5,'request\x20sent',JSON[_0xbdb4('0xd')](_0x130b66));if(_0x130b66[_0xbdb4('0xe')]){if(_0x130b66[_0xbdb4('0xe')]['code']===0x1f4){logger[_0xbdb4('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x4432a5,_0x130b66['error'][_0xbdb4('0xf')]);return _0x406d05(_0x130b66['error'][_0xbdb4('0xf')]);}logger['error'](_0xbdb4('0x10'),_0x4432a5,_0x130b66['error']['message']);return _0x52bbd1(_0x130b66[_0xbdb4('0xe')][_0xbdb4('0xf')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x4432a5,_0xbdb4('0x11'));_0x52bbd1(_0x130b66[_0xbdb4('0x12')][_0xbdb4('0xf')]);}})[_0xbdb4('0x13')](function(_0x1e4d63){logger[_0xbdb4('0xe')](_0xbdb4('0x10'),_0x4432a5,_0x1e4d63);_0x406d05(_0x1e4d63);});});} \ No newline at end of file +var _0xc463=['debug','stringify','error','message','UserChatQueue,\x20%s,\x20%s','result','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x33bfd3,_0x688263){var _0x45d02c=function(_0x37a74f){while(--_0x37a74f){_0x33bfd3['push'](_0x33bfd3['shift']());}};_0x45d02c(++_0x688263);}(_0xc463,0x72));var _0x3c46=function(_0x544ded,_0x2cd874){_0x544ded=_0x544ded-0x0;var _0x598372=_0xc463[_0x544ded];return _0x598372;};'use strict';var _=require('lodash');var util=require(_0x3c46('0x0'));var moment=require('moment');var BPromise=require(_0x3c46('0x1'));var rs=require(_0x3c46('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3c46('0x3'))(_0x3c46('0x4'));var config=require(_0x3c46('0x5'));var jayson=require(_0x3c46('0x6'));var client=jayson[_0x3c46('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc397fc,_0x3590d1,_0x5cfc7d){return new BPromise(function(_0x3c5f41,_0x1477b4){return client[_0x3c46('0x8')](_0xc397fc,_0x5cfc7d)[_0x3c46('0x9')](function(_0x22c7b4){logger[_0x3c46('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x3590d1,_0x3c46('0xb'));logger[_0x3c46('0xc')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x3590d1,_0x3c46('0xb'),JSON[_0x3c46('0xd')](_0x22c7b4));if(_0x22c7b4['error']){if(_0x22c7b4[_0x3c46('0xe')]['code']===0x1f4){logger[_0x3c46('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x3590d1,_0x22c7b4[_0x3c46('0xe')][_0x3c46('0xf')]);return _0x1477b4(_0x22c7b4[_0x3c46('0xe')][_0x3c46('0xf')]);}logger[_0x3c46('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x3590d1,_0x22c7b4['error'][_0x3c46('0xf')]);return _0x3c5f41(_0x22c7b4[_0x3c46('0xe')][_0x3c46('0xf')]);}else{logger['info'](_0x3c46('0x10'),_0x3590d1,_0x3c46('0xb'));_0x3c5f41(_0x22c7b4[_0x3c46('0x11')][_0x3c46('0xf')]);}})['catch'](function(_0x1d7e8c){logger['error'](_0x3c46('0x10'),_0x3590d1,_0x1d7e8c);_0x1477b4(_0x1d7e8c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 14b5afa..9dcbe48 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2e11ea,_0x30a954){var _0x3dd60a=function(_0xefac15){while(--_0xefac15){_0x2e11ea['push'](_0x2e11ea['shift']());}};_0x3dd60a(++_0x30a954);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4622cc,_0x42cba0){var _0x3bebba=function(_0x333157){while(--_0x333157){_0x4622cc['push'](_0x4622cc['shift']());}};_0x3bebba(++_0x42cba0);}(_0xe706,0xa3));var _0x6e70=function(_0x24f9d9,_0x6b4d81){_0x24f9d9=_0x24f9d9-0x0;var _0x392b6c=_0xe706[_0x24f9d9];return _0x392b6c;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f129427..d470654 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 _0xea90=['INTEGER','sequelize'];(function(_0x2f4635,_0x5b5805){var _0x197052=function(_0x1659cc){while(--_0x1659cc){_0x2f4635['push'](_0x2f4635['shift']());}};_0x197052(++_0x5b5805);}(_0xea90,0x18d));var _0x0ea9=function(_0x192f9f,_0x3052e7){_0x192f9f=_0x192f9f-0x0;var _0x1465a7=_0xea90[_0x192f9f];return _0x1465a7;};'use strict';var Sequelize=require(_0x0ea9('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0ea9('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb508=['sequelize','exports','INTEGER','STRING'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0xb508,0xa8));var _0x8b50=function(_0x123a90,_0x1bb8d6){_0x123a90=_0x123a90-0x0;var _0x583560=_0xb508[_0x123a90];return _0x583560;};'use strict';var Sequelize=require(_0x8b50('0x0'));module[_0x8b50('0x1')]={'penalty':{'type':Sequelize[_0x8b50('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8b50('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index b4fef9c..bf19bb3 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 _0xff82=['exports','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userFaxQueue.attributes'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xff82,0xbe));var _0x2ff8=function(_0x230682,_0x96cff4){_0x230682=_0x230682-0x0;var _0x51e1c9=_0xff82[_0x230682];return _0x51e1c9;};'use strict';var _=require(_0x2ff8('0x0'));var util=require('util');var logger=require(_0x2ff8('0x1'))(_0x2ff8('0x2'));var moment=require(_0x2ff8('0x3'));var BPromise=require(_0x2ff8('0x4'));var rp=require(_0x2ff8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2ff8('0x6'));var attributes=require(_0x2ff8('0x7'));module[_0x2ff8('0x8')]=function(_0x45c31f,_0x191025){return _0x45c31f['define'](_0x2ff8('0x9'),attributes,{'tableName':_0x2ff8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0476=['UserFaxQueue','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userFaxQueue.attributes','exports','define'];(function(_0x38db27,_0x17bce4){var _0x443bd6=function(_0x4c0258){while(--_0x4c0258){_0x38db27['push'](_0x38db27['shift']());}};_0x443bd6(++_0x17bce4);}(_0x0476,0xfe));var _0x6047=function(_0xd93b26,_0x12bbf2){_0xd93b26=_0xd93b26-0x0;var _0x25f668=_0x0476[_0xd93b26];return _0x25f668;};'use strict';var _=require('lodash');var util=require(_0x6047('0x0'));var logger=require(_0x6047('0x1'))('api');var moment=require(_0x6047('0x2'));var BPromise=require(_0x6047('0x3'));var rp=require(_0x6047('0x4'));var fs=require('fs');var path=require(_0x6047('0x5'));var rimraf=require(_0x6047('0x6'));var config=require('../../config/environment');var attributes=require(_0x6047('0x7'));module[_0x6047('0x8')]=function(_0x19e161,_0x4a8e04){return _0x19e161[_0x6047('0x9')](_0x6047('0xa'),attributes,{'tableName':'user_has_fax_queues','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 643fe37..43d82f3 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 _0x3973=['info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0xf363f0,_0x3b5eeb){var _0x55a386=function(_0x548349){while(--_0x548349){_0xf363f0['push'](_0xf363f0['shift']());}};_0x55a386(++_0x3b5eeb);}(_0x3973,0x72));var _0x3397=function(_0x325034,_0x4f082d){_0x325034=_0x325034-0x0;var _0x39f373=_0x3973[_0x325034];return _0x39f373;};'use strict';var _=require(_0x3397('0x0'));var util=require(_0x3397('0x1'));var moment=require(_0x3397('0x2'));var BPromise=require(_0x3397('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3397('0x4'));var db=require(_0x3397('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3397('0x6'))(_0x3397('0x7'));var config=require(_0x3397('0x8'));var jayson=require(_0x3397('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58762a,_0x3d6a0a,_0x1fa1a8){return new BPromise(function(_0x48d6b7,_0x4a3f7f){return client[_0x3397('0xa')](_0x58762a,_0x1fa1a8)[_0x3397('0xb')](function(_0x110f16){logger[_0x3397('0xc')](_0x3397('0xd'),_0x3d6a0a,_0x3397('0xe'));logger[_0x3397('0xf')](_0x3397('0x10'),_0x3d6a0a,'request\x20sent',JSON[_0x3397('0x11')](_0x110f16));if(_0x110f16[_0x3397('0x12')]){if(_0x110f16['error'][_0x3397('0x13')]===0x1f4){logger[_0x3397('0x12')](_0x3397('0xd'),_0x3d6a0a,_0x110f16[_0x3397('0x12')][_0x3397('0x14')]);return _0x4a3f7f(_0x110f16['error'][_0x3397('0x14')]);}logger['error'](_0x3397('0xd'),_0x3d6a0a,_0x110f16['error'][_0x3397('0x14')]);return _0x48d6b7(_0x110f16[_0x3397('0x12')]['message']);}else{logger[_0x3397('0xc')](_0x3397('0xd'),_0x3d6a0a,_0x3397('0xe'));_0x48d6b7(_0x110f16['result'][_0x3397('0x14')]);}})['catch'](function(_0x434ba4){logger['error'](_0x3397('0xd'),_0x3d6a0a,_0x434ba4);_0x4a3f7f(_0x434ba4);});});} \ No newline at end of file +var _0x82ff=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x178bf7,_0x4e1f61){var _0x7080d6=function(_0xe253bb){while(--_0xe253bb){_0x178bf7['push'](_0x178bf7['shift']());}};_0x7080d6(++_0x4e1f61);}(_0x82ff,0xc1));var _0xf82f=function(_0xf4f34a,_0x44c29f){_0xf4f34a=_0xf4f34a-0x0;var _0x31316f=_0x82ff[_0xf4f34a];return _0x31316f;};'use strict';var _=require(_0xf82f('0x0'));var util=require(_0xf82f('0x1'));var moment=require(_0xf82f('0x2'));var BPromise=require(_0xf82f('0x3'));var rs=require(_0xf82f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf82f('0x5'))['db'];var utils=require(_0xf82f('0x6'));var logger=require('../../config/logger')(_0xf82f('0x7'));var config=require('../../config/environment');var jayson=require(_0xf82f('0x8'));var client=jayson[_0xf82f('0x9')][_0xf82f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x155c1b,_0x4bd1c4,_0x13eed3){return new BPromise(function(_0x926d7b,_0xc0b934){return client['request'](_0x155c1b,_0x13eed3)['then'](function(_0x32e19d){logger[_0xf82f('0xb')](_0xf82f('0xc'),_0x4bd1c4,_0xf82f('0xd'));logger[_0xf82f('0xe')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4bd1c4,_0xf82f('0xd'),JSON[_0xf82f('0xf')](_0x32e19d));if(_0x32e19d['error']){if(_0x32e19d['error'][_0xf82f('0x10')]===0x1f4){logger['error'](_0xf82f('0xc'),_0x4bd1c4,_0x32e19d[_0xf82f('0x11')][_0xf82f('0x12')]);return _0xc0b934(_0x32e19d[_0xf82f('0x11')][_0xf82f('0x12')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4bd1c4,_0x32e19d[_0xf82f('0x11')][_0xf82f('0x12')]);return _0x926d7b(_0x32e19d[_0xf82f('0x11')][_0xf82f('0x12')]);}else{logger['info'](_0xf82f('0xc'),_0x4bd1c4,_0xf82f('0xd'));_0x926d7b(_0x32e19d[_0xf82f('0x13')][_0xf82f('0x12')]);}})[_0xf82f('0x14')](function(_0x5d54a6){logger['error'](_0xf82f('0xc'),_0x4bd1c4,_0x5d54a6);_0xc0b934(_0x5d54a6);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index e1c28e3..cbe6a69 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x641f18,_0x2919e8){var _0x16eefe=function(_0x578a89){while(--_0x578a89){_0x641f18['push'](_0x641f18['shift']());}};_0x16eefe(++_0x2919e8);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x32dfab,_0x461927){var _0x5e8bd3=function(_0x196e8e){while(--_0x196e8e){_0x32dfab['push'](_0x32dfab['shift']());}};_0x5e8bd3(++_0x461927);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 1991244..50d8031 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 _0x86ce=['sequelize','exports'];(function(_0x308213,_0x224541){var _0x2e1619=function(_0x972b51){while(--_0x972b51){_0x308213['push'](_0x308213['shift']());}};_0x2e1619(++_0x224541);}(_0x86ce,0x174));var _0xe86c=function(_0x1591d4,_0x4ea3bd){_0x1591d4=_0x1591d4-0x0;var _0x4c46bb=_0x86ce[_0x1591d4];return _0x4c46bb;};'use strict';var Sequelize=require(_0xe86c('0x0'));module[_0xe86c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xaf3c=['INTEGER','sequelize'];(function(_0x4109ca,_0x182541){var _0x3b2fdb=function(_0xef5963){while(--_0xef5963){_0x4109ca['push'](_0x4109ca['shift']());}};_0x3b2fdb(++_0x182541);}(_0xaf3c,0x109));var _0xcaf3=function(_0x11de95,_0x16df12){_0x11de95=_0x11de95-0x0;var _0x5627c8=_0xaf3c[_0x11de95];return _0x5627c8;};'use strict';var Sequelize=require(_0xcaf3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcaf3('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index dfb7e7a..3743208 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 _0x3eb7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','lodash','util','../../config/logger'];(function(_0x5e4c34,_0x387a28){var _0xfd8fb0=function(_0x1fed41){while(--_0x1fed41){_0x5e4c34['push'](_0x5e4c34['shift']());}};_0xfd8fb0(++_0x387a28);}(_0x3eb7,0x15c));var _0x73eb=function(_0x2d4ef8,_0x59358b){_0x2d4ef8=_0x2d4ef8-0x0;var _0xea511a=_0x3eb7[_0x2d4ef8];return _0xea511a;};'use strict';var _=require(_0x73eb('0x0'));var util=require(_0x73eb('0x1'));var logger=require(_0x73eb('0x2'))(_0x73eb('0x3'));var moment=require(_0x73eb('0x4'));var BPromise=require(_0x73eb('0x5'));var rp=require(_0x73eb('0x6'));var fs=require('fs');var path=require(_0x73eb('0x7'));var rimraf=require(_0x73eb('0x8'));var config=require(_0x73eb('0x9'));var attributes=require(_0x73eb('0xa'));module['exports']=function(_0x2f6ff1,_0x311cd8){return _0x2f6ff1[_0x73eb('0xb')](_0x73eb('0xc'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x884d=['define','UserMailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userMailQueue.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x884d,0x9e));var _0xd884=function(_0x352e36,_0x6148d2){_0x352e36=_0x352e36-0x0;var _0xe68d7f=_0x884d[_0x352e36];return _0xe68d7f;};'use strict';var _=require(_0xd884('0x0'));var util=require(_0xd884('0x1'));var logger=require(_0xd884('0x2'))(_0xd884('0x3'));var moment=require(_0xd884('0x4'));var BPromise=require(_0xd884('0x5'));var rp=require(_0xd884('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd884('0x7'));var config=require('../../config/environment');var attributes=require(_0xd884('0x8'));module[_0xd884('0x9')]=function(_0x346f92,_0x187fd8){return _0x346f92[_0xd884('0xa')](_0xd884('0xb'),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 03e83fc..e832151 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 _0x8ef6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3afe0f,_0x458547){var _0x2791de=function(_0x25b83c){while(--_0x25b83c){_0x3afe0f['push'](_0x3afe0f['shift']());}};_0x2791de(++_0x458547);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1c210b,_0x35c01){_0x1c210b=_0x1c210b-0x0;var _0x294e4f=_0x8ef6[_0x1c210b];return _0x294e4f;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var BPromise=require(_0x68ef('0x3'));var rs=require(_0x68ef('0x4'));var fs=require('fs');var Redis=require(_0x68ef('0x5'));var db=require(_0x68ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x68ef('0x7'))(_0x68ef('0x8'));var config=require(_0x68ef('0x9'));var jayson=require(_0x68ef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c2ff3,_0x4740e8,_0x2de776){return new BPromise(function(_0x4eb5eb,_0x228967){return client[_0x68ef('0xb')](_0x3c2ff3,_0x2de776)[_0x68ef('0xc')](function(_0x22ae26){logger[_0x68ef('0xd')](_0x68ef('0xe'),_0x4740e8,_0x68ef('0xf'));logger[_0x68ef('0x10')](_0x68ef('0x11'),_0x4740e8,_0x68ef('0xf'),JSON[_0x68ef('0x12')](_0x22ae26));if(_0x22ae26[_0x68ef('0x13')]){if(_0x22ae26['error'][_0x68ef('0x14')]===0x1f4){logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);return _0x228967(_0x22ae26[_0x68ef('0x13')]['message']);}logger[_0x68ef('0x13')](_0x68ef('0xe'),_0x4740e8,_0x22ae26[_0x68ef('0x13')]['message']);return _0x4eb5eb(_0x22ae26[_0x68ef('0x13')][_0x68ef('0x15')]);}else{logger[_0x68ef('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x68ef('0xf'));_0x4eb5eb(_0x22ae26[_0x68ef('0x16')][_0x68ef('0x15')]);}})[_0x68ef('0x17')](function(_0x5c4456){logger[_0x68ef('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x4740e8,_0x5c4456);_0x228967(_0x5c4456);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4c51b7,_0x5f3b62){var _0x1bd56a=function(_0x22dce7){while(--_0x22dce7){_0x4c51b7['push'](_0x4c51b7['shift']());}};_0x1bd56a(++_0x5f3b62);}(_0x00bb,0x1d8));var _0xb00b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x00bb[_0x411add];return _0x238242;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 5140891..76f5515 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 _0xc923=['../../components/interaction/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','util','path','Router','fs-extra'];(function(_0x136a01,_0x3e0f10){var _0x39ccee=function(_0x1fa530){while(--_0x1fa530){_0x136a01['push'](_0x136a01['shift']());}};_0x39ccee(++_0x3e0f10);}(_0xc923,0x1b4));var _0x3c92=function(_0x5dba24,_0x2867d2){_0x5dba24=_0x5dba24-0x0;var _0x1c23cb=_0xc923[_0x5dba24];return _0x1c23cb;};'use strict';var multer=require('multer');var util=require(_0x3c92('0x0'));var path=require(_0x3c92('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3c92('0x2')]();var fs_extra=require(_0x3c92('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3c92('0x4'));var config=require(_0x3c92('0x5'));var controller=require('./userNotification.controller');router[_0x3c92('0x6')]('/',auth[_0x3c92('0x7')](),controller[_0x3c92('0x8')]);module[_0x3c92('0x9')]=router; \ No newline at end of file +var _0x395d=['./userNotification.controller','post','sendUserNotification','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ebbee,_0x42bf47){var _0x7b9fdd=function(_0x32252a){while(--_0x32252a){_0x3ebbee['push'](_0x3ebbee['shift']());}};_0x7b9fdd(++_0x42bf47);}(_0x395d,0x18a));var _0xd395=function(_0x39fa14,_0x27d773){_0x39fa14=_0x39fa14-0x0;var _0x4352af=_0x395d[_0x39fa14];return _0x4352af;};'use strict';var multer=require(_0xd395('0x0'));var util=require('util');var path=require(_0xd395('0x1'));var timeout=require(_0xd395('0x2'));var express=require(_0xd395('0x3'));var router=express[_0xd395('0x4')]();var fs_extra=require(_0xd395('0x5'));var auth=require(_0xd395('0x6'));var interaction=require(_0xd395('0x7'));var config=require(_0xd395('0x8'));var controller=require(_0xd395('0x9'));router[_0xd395('0xa')]('/',auth['isAuthenticated'](),controller[_0xd395('0xb')]);module[_0xd395('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 2d622fd..7754cc3 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 _0xdd30=['STRING','BOOLEAN','exports','TEXT'];(function(_0x938070,_0x558037){var _0x8b6b38=function(_0x2a9ff5){while(--_0x2a9ff5){_0x938070['push'](_0x938070['shift']());}};_0x8b6b38(++_0x558037);}(_0xdd30,0x1ba));var _0x0dd3=function(_0x257d1d,_0x55c66a){_0x257d1d=_0x257d1d-0x0;var _0x4cdea5=_0xdd30[_0x257d1d];return _0x4cdea5;};'use strict';var Sequelize=require('sequelize');module[_0x0dd3('0x0')]={'body':{'type':Sequelize[_0x0dd3('0x1')]},'senderName':{'type':Sequelize[_0x0dd3('0x2')]},'recipientsId':{'type':Sequelize[_0x0dd3('0x1')]},'recipientsDescription':{'type':Sequelize[_0x0dd3('0x2')]},'beep':{'type':Sequelize[_0x0dd3('0x3')]}}; \ No newline at end of file +var _0x72dd=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x72dd,0x18a));var _0xd72d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x72dd[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0xd72d('0x0'));module[_0xd72d('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0xd72d('0x2')]},'recipientsDescription':{'type':Sequelize[_0xd72d('0x3')]},'beep':{'type':Sequelize[_0xd72d('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 116b566..99f62ba 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 _0xa45e=['faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','destroy','then','error','stack','name','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue'];(function(_0x3e6480,_0x4b7e13){var _0x55beef=function(_0x3fea62){while(--_0x3fea62){_0x3e6480['push'](_0x3e6480['shift']());}};_0x55beef(++_0x4b7e13);}(_0xa45e,0x16f));var _0xea45=function(_0x3c5e8b,_0x53a259){_0x3c5e8b=_0x3c5e8b-0x0;var _0x5217d7=_0xa45e[_0x3c5e8b];return _0x5217d7;};'use strict';var emlformat=require(_0xea45('0x0'));var rimraf=require(_0xea45('0x1'));var zipdir=require(_0xea45('0x2'));var jsonpatch=require(_0xea45('0x3'));var rp=require(_0xea45('0x4'));var moment=require(_0xea45('0x5'));var BPromise=require(_0xea45('0x6'));var Mustache=require(_0xea45('0x7'));var util=require(_0xea45('0x8'));var path=require(_0xea45('0x9'));var sox=require(_0xea45('0xa'));var csv=require(_0xea45('0xb'));var ejs=require(_0xea45('0xc'));var fs=require('fs');var fs_extra=require(_0xea45('0xd'));var _=require(_0xea45('0xe'));var squel=require(_0xea45('0xf'));var crypto=require(_0xea45('0x10'));var jsforce=require(_0xea45('0x11'));var deskjs=require(_0xea45('0x12'));var toCsv=require(_0xea45('0xb'));var querystring=require(_0xea45('0x13'));var Papa=require(_0xea45('0x14'));var Redis=require(_0xea45('0x15'));var authService=require(_0xea45('0x16'));var qs=require(_0xea45('0x17'));var as=require(_0xea45('0x18'));var hardwareService=require(_0xea45('0x19'));var logger=require(_0xea45('0x1a'))(_0xea45('0x1b'));var utils=require(_0xea45('0x1c'));var config=require('../../config/environment');var licenseUtil=require(_0xea45('0x1d'));var db=require(_0xea45('0x1e'))['db'];config[_0xea45('0x1f')]=_[_0xea45('0x20')](config[_0xea45('0x1f')],{'host':_0xea45('0x21'),'port':0x18eb});var socket=require(_0xea45('0x22'))(new Redis(config[_0xea45('0x1f')]));require(_0xea45('0x23'))[_0xea45('0x24')](socket);function respondWithStatusCode(_0x5ab008,_0x5254d6){_0x5254d6=_0x5254d6||0xcc;return function(_0x565b10){if(_0x565b10){return _0x5ab008[_0xea45('0x25')](_0x5254d6);}return _0x5ab008[_0xea45('0x26')](_0x5254d6)[_0xea45('0x27')]();};}function respondWithResult(_0x19e032,_0x2bf07c){_0x2bf07c=_0x2bf07c||0xc8;return function(_0x163721){if(_0x163721){return _0x19e032['status'](_0x2bf07c)['json'](_0x163721);}};}function respondWithFilteredResult(_0x571393,_0x112cf4){return function(_0x514b59){if(_0x514b59){var _0x2a1443=typeof _0x112cf4[_0xea45('0x28')]===_0xea45('0x29')&&typeof _0x112cf4['limit']===_0xea45('0x29');var _0x1bccec=_0x514b59[_0xea45('0x2a')];var _0x230e9c=_0x2a1443?0x0:_0x112cf4[_0xea45('0x28')];var _0xb28d6f=_0x2a1443?_0x514b59[_0xea45('0x2a')]:_0x112cf4[_0xea45('0x28')]+_0x112cf4[_0xea45('0x2b')];var _0x6a433;if(_0xb28d6f>=_0x1bccec){_0xb28d6f=_0x1bccec;_0x6a433=0xc8;}else{_0x6a433=0xce;}_0x571393[_0xea45('0x26')](_0x6a433);return _0x571393[_0xea45('0x2c')](_0xea45('0x2d'),_0x230e9c+'-'+_0xb28d6f+'/'+_0x1bccec)[_0xea45('0x2e')](_0x514b59);}return null;};}function patchUpdates(_0x3534bf){return function(_0x5df6a0){try{jsonpatch[_0xea45('0x2f')](_0x5df6a0,_0x3534bf,!![]);}catch(_0x521e29){return BPromise[_0xea45('0x30')](_0x521e29);}return _0x5df6a0[_0xea45('0x31')]();};}function saveUpdates(_0x1cd5d4,_0x55fe5e){return function(_0x4ed527){if(_0x4ed527){return _0x4ed527['update'](_0x1cd5d4)['then'](function(_0x3769e4){return _0x3769e4;});}return null;};}function removeEntity(_0x60dbb5,_0x13fe82){return function(_0x486a6e){if(_0x486a6e){return _0x486a6e[_0xea45('0x32')]()[_0xea45('0x33')](function(){_0x60dbb5[_0xea45('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc665,_0x49c69f){return function(_0x47557e){if(!_0x47557e){_0x2dc665[_0xea45('0x25')](0x194);}return _0x47557e;};}function handleError(_0x474194,_0x11cb0a){_0x11cb0a=_0x11cb0a||0x1f4;return function(_0x47577e){logger[_0xea45('0x34')](_0x47577e[_0xea45('0x35')]);if(_0x47577e[_0xea45('0x36')]){delete _0x47577e[_0xea45('0x36')];}_0x474194[_0xea45('0x26')](_0x11cb0a)['send'](_0x47577e);};}exports['sendUserNotification']=function(_0x3f65fd,_0x2ff085,_0x36dca9){if(!_0x3f65fd[_0xea45('0x37')][_0xea45('0x38')](_0xea45('0x39'))&&!_0x3f65fd[_0xea45('0x37')]['hasOwnProperty'](_0xea45('0x3a'))){throw new db[(_0xea45('0x3b'))][(_0xea45('0x3c'))](_0xea45('0x3d'));}else{if(_0x3f65fd[_0xea45('0x37')][_0xea45('0x38')]('TemplateId')&&!_0x3f65fd[_0xea45('0x37')][_0xea45('0x38')](_0xea45('0x3e'))){throw new db[(_0xea45('0x3b'))]['ValidationError'](_0xea45('0x3f'));}if(!_0x3f65fd['body'][_0xea45('0x38')](_0xea45('0x40'))){throw new db[(_0xea45('0x3b'))]['ValidationError'](_0xea45('0x41'));}else{try{var _0x3764a4=JSON[_0xea45('0x42')](_0x3f65fd[_0xea45('0x37')][_0xea45('0x40')]);}catch(_0x41c8bc){logger['error'](_0x41c8bc);throw new db[(_0xea45('0x3b'))]['ValidationError'](_0xea45('0x43'));}var _0x13a7db=[_0xea45('0x44'),_0xea45('0x45'),'mailqueue',_0xea45('0x46'),_0xea45('0x47'),_0xea45('0x48'),_0xea45('0x49'),_0xea45('0x4a'),_0xea45('0x4b')];if(_[_0xea45('0x4c')](_0x3764a4,function(_0x203351){return!_['includes'](_0x13a7db,_0x203351[_0xea45('0x4d')][_0xea45('0x4e')]());})){throw new db[(_0xea45('0x3b'))]['ValidationError'](_0xea45('0x4f'));}}}var _0x405472={};_0x405472[_0xea45('0x50')]=_0x3f65fd['body'][_0xea45('0x38')](_0xea45('0x50'))?_0x3f65fd[_0xea45('0x37')][_0xea45('0x50')]:_0x3f65fd['user'][_0xea45('0x51')];_0x405472['recipientsDescription']=_['isEmpty'](_0x3f65fd[_0xea45('0x37')][_0xea45('0x52')])?null:_0x3f65fd[_0xea45('0x37')][_0xea45('0x52')];_0x405472[_0xea45('0x53')]=_0x3f65fd[_0xea45('0x37')][_0xea45('0x53')]||![];_0x405472[_0xea45('0x54')]=_0x3f65fd[_0xea45('0x4b')]['id'];return getContent(_0x3f65fd['body'])[_0xea45('0x33')](function(_0x3f8ab2){_0x405472['body']=_0x3f8ab2;return getRecipients(_0x3764a4);})[_0xea45('0x33')](function(_0xf1c034){_0x405472['recipientsId']=_['sortBy'](_0xf1c034)['join'](',');return db[_0xea45('0x55')][_0xea45('0x56')](function(_0x41e509){return db[_0xea45('0x57')]['create'](_0x405472,{'raw':!![],'transaction':_0x41e509})[_0xea45('0x33')](function(_0x4174fe){var _0x25a5c5={'sender':_0x405472[_0xea45('0x50')],'description':_0x405472[_0xea45('0x52')],'content':_0x405472[_0xea45('0x37')],'beep':_0x405472[_0xea45('0x53')]};_0xf1c034[_0xea45('0x58')](function(_0x45b1e7){_0x25a5c5[_0xea45('0x59')]=_0x45b1e7;socket[_0xea45('0x5a')](_0xea45('0x5b'),_0x25a5c5);});return _0x4174fe;});});})[_0xea45('0x33')](respondWithResult(_0x2ff085,0xc9))[_0xea45('0x5c')](handleError(_0x2ff085,null));};function getContent(_0x11a51b){return new BPromise(function(_0xfee26,_0x4bcd49){if(_0x11a51b[_0xea45('0x39')]){_0xfee26(_0x11a51b[_0xea45('0x39')]);return;}return db[_0xea45('0x5d')][_0xea45('0x5e')]({'attributes':[_0xea45('0x5f')],'where':{'id':_0x11a51b[_0xea45('0x3a')]},'raw':!![]})[_0xea45('0x33')](function(_0x5e959c){if(!_0x5e959c)throw new db[(_0xea45('0x3b'))][(_0xea45('0x3c'))](_0xea45('0x60'));var _0x19c4e8=Mustache[_0xea45('0x61')](_0x5e959c['html'],_0x11a51b[_0xea45('0x3e')]);_0xfee26(_0x19c4e8);})[_0xea45('0x5c')](function(_0x57b517){_0x4bcd49(_0x57b517);});});}function getRecipients(_0x234df2){return new BPromise(function(_0x2925e3,_0x512ec8){var _0x2131cd=[];var _0x2322c8=[];_0x234df2[_0xea45('0x58')](function(_0x1dad8d){var _0x586e32=_[_0xea45('0x62')](_0x1dad8d[_0xea45('0x4d')][_0xea45('0x4e')]());if(_0x586e32==='User'){_0x2131cd=_[_0xea45('0x63')](_0x2131cd,_0x1dad8d[_0xea45('0x64')]);}else{if(_['includes'](_0x586e32,_0xea45('0x65')))_0x586e32=_0x586e32[_0xea45('0x66')](_0xea45('0x65'),_0xea45('0x67'));_0x1dad8d[_0xea45('0x64')][_0xea45('0x58')](function(_0x49357e){_0x2322c8[_0xea45('0x68')](getAgents(_0x586e32,_0x49357e));});}});return BPromise[_0xea45('0x69')](_0x2322c8)[_0xea45('0x33')](function(_0x104867){_0x2131cd=_[_0xea45('0x63')](_0x2131cd,_[_0xea45('0x6a')](_0x104867));_0x2925e3(_0x2131cd);})['catch'](function(_0x1ffd84){_0x512ec8(_0x1ffd84);});});}function getAgents(_0x6a9ec0,_0x42cbfe){return new BPromise(function(_0x7c332e,_0x21bfd7){return db[_0x6a9ec0]['findOne']({'where':{'id':_0x42cbfe}})[_0xea45('0x33')](function(_0x162aee){return _0x162aee[_0xea45('0x6b')]({'attributes':['id'],'raw':!![]})[_0xea45('0x33')](function(_0x3742bf){var _0x5568bc=_[_0xea45('0x6c')](_0x3742bf,'id');_0x7c332e(_0x5568bc);});})[_0xea45('0x5c')](function(_0x4e8eaf){_0x21bfd7(_0x4e8eaf);});});} \ No newline at end of file +var _0x1969=['join','sequelize','UserNotification','create','forEach','recipient','userNotification:send','Template','findOne','html','TemplateId','render','catch','startCase','User','union','queue','replace','Queue','ids','push','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./userNotification.socket','register','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','destroy','then','end','stack','name','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','user','recipientsId','sortBy'];(function(_0x5ac758,_0x4e413b){var _0x27e6ff=function(_0x297575){while(--_0x297575){_0x5ac758['push'](_0x5ac758['shift']());}};_0x27e6ff(++_0x4e413b);}(_0x1969,0x7c));var _0x9196=function(_0x2c0409,_0x3c00a6){_0x2c0409=_0x2c0409-0x0;var _0x107b6b=_0x1969[_0x2c0409];return _0x107b6b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9196('0x0'));var zipdir=require(_0x9196('0x1'));var jsonpatch=require(_0x9196('0x2'));var rp=require(_0x9196('0x3'));var moment=require(_0x9196('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9196('0x5'));var util=require('util');var path=require(_0x9196('0x6'));var sox=require(_0x9196('0x7'));var csv=require(_0x9196('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9196('0x9'));var _=require(_0x9196('0xa'));var squel=require(_0x9196('0xb'));var crypto=require(_0x9196('0xc'));var jsforce=require(_0x9196('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9196('0x8'));var querystring=require(_0x9196('0xe'));var Papa=require(_0x9196('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9196('0x10'));var as=require(_0x9196('0x11'));var hardwareService=require(_0x9196('0x12'));var logger=require(_0x9196('0x13'))(_0x9196('0x14'));var utils=require(_0x9196('0x15'));var config=require(_0x9196('0x16'));var licenseUtil=require(_0x9196('0x17'));var db=require(_0x9196('0x18'))['db'];config['redis']=_[_0x9196('0x19')](config[_0x9196('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x9196('0x1b'))(new Redis(config[_0x9196('0x1a')]));require(_0x9196('0x1c'))[_0x9196('0x1d')](socket);function respondWithStatusCode(_0x3e9843,_0x117bba){_0x117bba=_0x117bba||0xcc;return function(_0x81bcd6){if(_0x81bcd6){return _0x3e9843['sendStatus'](_0x117bba);}return _0x3e9843[_0x9196('0x1e')](_0x117bba)['end']();};}function respondWithResult(_0x356082,_0x54d76a){_0x54d76a=_0x54d76a||0xc8;return function(_0x1b171d){if(_0x1b171d){return _0x356082[_0x9196('0x1e')](_0x54d76a)['json'](_0x1b171d);}};}function respondWithFilteredResult(_0x2054e1,_0x38ec07){return function(_0x3e039f){if(_0x3e039f){var _0x5a292d=typeof _0x38ec07['offset']===_0x9196('0x1f')&&typeof _0x38ec07[_0x9196('0x20')]==='undefined';var _0x3850b7=_0x3e039f[_0x9196('0x21')];var _0x25f1de=_0x5a292d?0x0:_0x38ec07[_0x9196('0x22')];var _0x24a742=_0x5a292d?_0x3e039f[_0x9196('0x21')]:_0x38ec07[_0x9196('0x22')]+_0x38ec07[_0x9196('0x20')];var _0x1048fa;if(_0x24a742>=_0x3850b7){_0x24a742=_0x3850b7;_0x1048fa=0xc8;}else{_0x1048fa=0xce;}_0x2054e1['status'](_0x1048fa);return _0x2054e1[_0x9196('0x23')](_0x9196('0x24'),_0x25f1de+'-'+_0x24a742+'/'+_0x3850b7)[_0x9196('0x25')](_0x3e039f);}return null;};}function patchUpdates(_0x1b60dc){return function(_0x7beda){try{jsonpatch['apply'](_0x7beda,_0x1b60dc,!![]);}catch(_0x41dbd7){return BPromise[_0x9196('0x26')](_0x41dbd7);}return _0x7beda[_0x9196('0x27')]();};}function saveUpdates(_0x243962,_0xbf1a7){return function(_0x168578){if(_0x168578){return _0x168578['update'](_0x243962)['then'](function(_0xe4282){return _0xe4282;});}return null;};}function removeEntity(_0x556fd9,_0x384266){return function(_0x2313a2){if(_0x2313a2){return _0x2313a2[_0x9196('0x28')]()[_0x9196('0x29')](function(){_0x556fd9[_0x9196('0x1e')](0xcc)[_0x9196('0x2a')]();});}};}function handleEntityNotFound(_0x59d866,_0x462669){return function(_0x443178){if(!_0x443178){_0x59d866['sendStatus'](0x194);}return _0x443178;};}function handleError(_0x144c7f,_0x270be6){_0x270be6=_0x270be6||0x1f4;return function(_0x45c67d){logger['error'](_0x45c67d[_0x9196('0x2b')]);if(_0x45c67d[_0x9196('0x2c')]){delete _0x45c67d[_0x9196('0x2c')];}_0x144c7f[_0x9196('0x1e')](_0x270be6)['send'](_0x45c67d);};}exports[_0x9196('0x2d')]=function(_0x4f4fd5,_0x414115,_0x40f949){if(!_0x4f4fd5[_0x9196('0x2e')][_0x9196('0x2f')](_0x9196('0x30'))&&!_0x4f4fd5['body'][_0x9196('0x2f')]('TemplateId')){throw new db[(_0x9196('0x31'))][(_0x9196('0x32'))](_0x9196('0x33'));}else{if(_0x4f4fd5[_0x9196('0x2e')]['hasOwnProperty']('TemplateId')&&!_0x4f4fd5[_0x9196('0x2e')][_0x9196('0x2f')]('view')){throw new db[(_0x9196('0x31'))][(_0x9196('0x32'))](_0x9196('0x34'));}if(!_0x4f4fd5[_0x9196('0x2e')]['hasOwnProperty'](_0x9196('0x35'))){throw new db[(_0x9196('0x31'))]['ValidationError'](_0x9196('0x36'));}else{try{var _0x495901=JSON[_0x9196('0x37')](_0x4f4fd5[_0x9196('0x2e')][_0x9196('0x35')]);}catch(_0x25d480){logger['error'](_0x25d480);throw new db[(_0x9196('0x31'))][(_0x9196('0x32'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x91399b=[_0x9196('0x38'),_0x9196('0x39'),'mailqueue',_0x9196('0x3a'),_0x9196('0x3b'),_0x9196('0x3c'),_0x9196('0x3d'),_0x9196('0x3e'),'user'];if(_[_0x9196('0x3f')](_0x495901,function(_0x5133e6){return!_['includes'](_0x91399b,_0x5133e6[_0x9196('0x40')][_0x9196('0x41')]());})){throw new db[(_0x9196('0x31'))][(_0x9196('0x32'))](_0x9196('0x42'));}}}var _0x428f16={};_0x428f16[_0x9196('0x43')]=_0x4f4fd5[_0x9196('0x2e')][_0x9196('0x2f')](_0x9196('0x43'))?_0x4f4fd5[_0x9196('0x2e')]['senderName']:_0x4f4fd5['user'][_0x9196('0x44')];_0x428f16['recipientsDescription']=_[_0x9196('0x45')](_0x4f4fd5[_0x9196('0x2e')]['recipientsDescription'])?null:_0x4f4fd5[_0x9196('0x2e')][_0x9196('0x46')];_0x428f16[_0x9196('0x47')]=_0x4f4fd5[_0x9196('0x2e')]['beep']||![];_0x428f16[_0x9196('0x48')]=_0x4f4fd5[_0x9196('0x49')]['id'];return getContent(_0x4f4fd5[_0x9196('0x2e')])[_0x9196('0x29')](function(_0x1b1ed6){_0x428f16['body']=_0x1b1ed6;return getRecipients(_0x495901);})[_0x9196('0x29')](function(_0x4bd8c0){_0x428f16[_0x9196('0x4a')]=_[_0x9196('0x4b')](_0x4bd8c0)[_0x9196('0x4c')](',');return db[_0x9196('0x4d')]['transaction'](function(_0x4984fd){return db[_0x9196('0x4e')][_0x9196('0x4f')](_0x428f16,{'raw':!![],'transaction':_0x4984fd})[_0x9196('0x29')](function(_0x49b873){var _0x39115c={'sender':_0x428f16['senderName'],'description':_0x428f16[_0x9196('0x46')],'content':_0x428f16[_0x9196('0x2e')],'beep':_0x428f16[_0x9196('0x47')]};_0x4bd8c0[_0x9196('0x50')](function(_0x394f69){_0x39115c[_0x9196('0x51')]=_0x394f69;socket['emit'](_0x9196('0x52'),_0x39115c);});return _0x49b873;});});})[_0x9196('0x29')](respondWithResult(_0x414115,0xc9))['catch'](handleError(_0x414115,null));};function getContent(_0x191b0d){return new BPromise(function(_0x8a0d5f,_0x257644){if(_0x191b0d[_0x9196('0x30')]){_0x8a0d5f(_0x191b0d[_0x9196('0x30')]);return;}return db[_0x9196('0x53')][_0x9196('0x54')]({'attributes':[_0x9196('0x55')],'where':{'id':_0x191b0d[_0x9196('0x56')]},'raw':!![]})[_0x9196('0x29')](function(_0x12df4d){if(!_0x12df4d)throw new db[(_0x9196('0x31'))][(_0x9196('0x32'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x298d53=Mustache[_0x9196('0x57')](_0x12df4d[_0x9196('0x55')],_0x191b0d['view']);_0x8a0d5f(_0x298d53);})[_0x9196('0x58')](function(_0x50a91b){_0x257644(_0x50a91b);});});}function getRecipients(_0xc6b407){return new BPromise(function(_0x2683e1,_0x59aeab){var _0x37421e=[];var _0x100d77=[];_0xc6b407[_0x9196('0x50')](function(_0x3138d3){var _0x46d030=_[_0x9196('0x59')](_0x3138d3[_0x9196('0x40')][_0x9196('0x41')]());if(_0x46d030===_0x9196('0x5a')){_0x37421e=_[_0x9196('0x5b')](_0x37421e,_0x3138d3['ids']);}else{if(_['includes'](_0x46d030,_0x9196('0x5c')))_0x46d030=_0x46d030[_0x9196('0x5d')]('queue',_0x9196('0x5e'));_0x3138d3[_0x9196('0x5f')][_0x9196('0x50')](function(_0x3e4008){_0x100d77[_0x9196('0x60')](getAgents(_0x46d030,_0x3e4008));});}});return BPromise['all'](_0x100d77)[_0x9196('0x29')](function(_0x454f29){_0x37421e=_[_0x9196('0x5b')](_0x37421e,_[_0x9196('0x61')](_0x454f29));_0x2683e1(_0x37421e);})['catch'](function(_0x505920){_0x59aeab(_0x505920);});});}function getAgents(_0xcb57d2,_0x454519){return new BPromise(function(_0x4846eb,_0x1ede0d){return db[_0xcb57d2][_0x9196('0x54')]({'where':{'id':_0x454519}})['then'](function(_0x4b21aa){return _0x4b21aa[_0x9196('0x62')]({'attributes':['id'],'raw':!![]})[_0x9196('0x29')](function(_0xe5f8d8){var _0x29e720=_[_0x9196('0x63')](_0xe5f8d8,'id');_0x4846eb(_0x29e720);});})[_0x9196('0x58')](function(_0x6aeda9){_0x1ede0d(_0x6aeda9);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index cf30ac0..4fcdd4c 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 _0x9a12=['UserNotification','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x388531,_0x5a9979){var _0x36414c=function(_0x21865a){while(--_0x21865a){_0x388531['push'](_0x388531['shift']());}};_0x36414c(++_0x5a9979);}(_0x9a12,0x156));var _0x29a1=function(_0x18cfc7,_0x27371b){_0x18cfc7=_0x18cfc7-0x0;var _0x3d0e73=_0x9a12[_0x18cfc7];return _0x3d0e73;};'use strict';var EventEmitter=require(_0x29a1('0x0'));var UserNotification=require(_0x29a1('0x1'))['db'][_0x29a1('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29a1('0x3'),'afterUpdate':_0x29a1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5d795b){return function(_0x3f4c88,_0x1d6470,_0x184a71){UserNotificationEvents[_0x29a1('0x5')](_0x5d795b+':'+_0x3f4c88['id'],_0x3f4c88);UserNotificationEvents[_0x29a1('0x5')](_0x5d795b,_0x3f4c88);_0x184a71(null);};}for(var e in events){if(events[_0x29a1('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x29a1('0x7')]=UserNotificationEvents; \ No newline at end of file +var _0x368e=['hasOwnProperty','hook','exports','events','save','remove'];(function(_0x42655e,_0xa29e96){var _0xabd052=function(_0x4bd2b6){while(--_0x4bd2b6){_0x42655e['push'](_0x42655e['shift']());}};_0xabd052(++_0xa29e96);}(_0x368e,0x15f));var _0xe368=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x368e[_0x39bc44];return _0x2916d8;};'use strict';var EventEmitter=require(_0xe368('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe368('0x1'),'afterUpdate':'update','afterDestroy':_0xe368('0x2')};function emitEvent(_0x10e89c){return function(_0x1ae56d,_0x2eaa5c,_0x480dd8){UserNotificationEvents['emit'](_0x10e89c+':'+_0x1ae56d['id'],_0x1ae56d);UserNotificationEvents['emit'](_0x10e89c,_0x1ae56d);_0x480dd8(null);};}for(var e in events){if(events[_0xe368('0x3')](e)){var event=events[e];UserNotification[_0xe368('0x4')](e,emitEvent(event));}}module[_0xe368('0x5')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 41942f7..17fda19 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 _0x4a57=['path','rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x2d380a,_0x4e2ba3){var _0x1ee691=function(_0x3303ab){while(--_0x3303ab){_0x2d380a['push'](_0x2d380a['shift']());}};_0x1ee691(++_0x4e2ba3);}(_0x4a57,0xff));var _0x74a5=function(_0x1754db,_0x3e32f7){_0x1754db=_0x1754db-0x0;var _0x273e77=_0x4a57[_0x1754db];return _0x273e77;};'use strict';var _=require('lodash');var util=require(_0x74a5('0x0'));var logger=require(_0x74a5('0x1'))(_0x74a5('0x2'));var moment=require(_0x74a5('0x3'));var BPromise=require('bluebird');var rp=require(_0x74a5('0x4'));var fs=require('fs');var path=require(_0x74a5('0x5'));var rimraf=require(_0x74a5('0x6'));var config=require(_0x74a5('0x7'));var attributes=require(_0x74a5('0x8'));module['exports']=function(_0x2af11b,_0x11d36c){return _0x2af11b[_0x74a5('0x9')](_0x74a5('0xa'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x74a5('0xb'),'collate':_0x74a5('0xc')});}; \ No newline at end of file +var _0xf948=['request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird'];(function(_0x271a80,_0x268bac){var _0xf8233e=function(_0x825987){while(--_0x825987){_0x271a80['push'](_0x271a80['shift']());}};_0xf8233e(++_0x268bac);}(_0xf948,0x79));var _0x8f94=function(_0x535563,_0x5866f7){_0x535563=_0x535563-0x0;var _0x4cfa9b=_0xf948[_0x535563];return _0x4cfa9b;};'use strict';var _=require(_0x8f94('0x0'));var util=require(_0x8f94('0x1'));var logger=require(_0x8f94('0x2'))(_0x8f94('0x3'));var moment=require('moment');var BPromise=require(_0x8f94('0x4'));var rp=require(_0x8f94('0x5'));var fs=require('fs');var path=require(_0x8f94('0x6'));var rimraf=require(_0x8f94('0x7'));var config=require('../../config/environment');var attributes=require(_0x8f94('0x8'));module[_0x8f94('0x9')]=function(_0x85cf13,_0x2a89b5){return _0x85cf13[_0x8f94('0xa')](_0x8f94('0xb'),attributes,{'tableName':_0x8f94('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8f94('0xd')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 5c8487a..87b8103 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 _0xb5f4=['./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter'];(function(_0x3a60e9,_0x441453){var _0x51a476=function(_0x36a41c){while(--_0x36a41c){_0x3a60e9['push'](_0x3a60e9['shift']());}};_0x51a476(++_0x441453);}(_0xb5f4,0x1e9));var _0x4b5f=function(_0x27a4b2,_0x231b8d){_0x27a4b2=_0x27a4b2-0x0;var _0x189df2=_0xb5f4[_0x27a4b2];return _0x189df2;};'use strict';var _=require(_0x4b5f('0x0'));var util=require(_0x4b5f('0x1'));var moment=require(_0x4b5f('0x2'));var BPromise=require(_0x4b5f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b5f('0x4'));var db=require(_0x4b5f('0x5'))['db'];var utils=require(_0x4b5f('0x6'));var logger=require(_0x4b5f('0x7'))(_0x4b5f('0x8'));var config=require(_0x4b5f('0x9'));var jayson=require(_0x4b5f('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x4b5f('0xb')]=_[_0x4b5f('0xc')](config['redis'],{'host':_0x4b5f('0xd'),'port':0x18eb});var socket=require(_0x4b5f('0xe'))(new Redis(config['redis']));require(_0x4b5f('0xf'))[_0x4b5f('0x10')](socket);function respondWithRpcPromise(_0x5cab36,_0x359f4c,_0x405722){return new BPromise(function(_0x32724d,_0x5dd717){return client[_0x4b5f('0x11')](_0x5cab36,_0x405722)[_0x4b5f('0x12')](function(_0x1494c7){logger[_0x4b5f('0x13')](_0x4b5f('0x14'),_0x359f4c,_0x4b5f('0x15'));logger['debug'](_0x4b5f('0x16'),_0x359f4c,'request\x20sent',JSON[_0x4b5f('0x17')](_0x1494c7));if(_0x1494c7['error']){if(_0x1494c7[_0x4b5f('0x18')]['code']===0x1f4){logger[_0x4b5f('0x18')](_0x4b5f('0x14'),_0x359f4c,_0x1494c7['error'][_0x4b5f('0x19')]);return _0x5dd717(_0x1494c7[_0x4b5f('0x18')][_0x4b5f('0x19')]);}logger['error'](_0x4b5f('0x14'),_0x359f4c,_0x1494c7['error'][_0x4b5f('0x19')]);return _0x32724d(_0x1494c7[_0x4b5f('0x18')]['message']);}else{logger[_0x4b5f('0x13')](_0x4b5f('0x14'),_0x359f4c,_0x4b5f('0x15'));_0x32724d(_0x1494c7[_0x4b5f('0x1a')][_0x4b5f('0x19')]);}})[_0x4b5f('0x1b')](function(_0xa6c0ad){logger[_0x4b5f('0x18')](_0x4b5f('0x14'),_0x359f4c,_0xa6c0ad);_0x5dd717(_0xa6c0ad);});});} \ No newline at end of file +var _0x60ca=['register','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket'];(function(_0x31c04d,_0x59a5d5){var _0x3fd81b=function(_0x4c05dc){while(--_0x4c05dc){_0x31c04d['push'](_0x31c04d['shift']());}};_0x3fd81b(++_0x59a5d5);}(_0x60ca,0xad));var _0xa60c=function(_0x5aeb1b,_0x5d28e4){_0x5aeb1b=_0x5aeb1b-0x0;var _0x270575=_0x60ca[_0x5aeb1b];return _0x270575;};'use strict';var _=require(_0xa60c('0x0'));var util=require(_0xa60c('0x1'));var moment=require(_0xa60c('0x2'));var BPromise=require(_0xa60c('0x3'));var rs=require(_0xa60c('0x4'));var fs=require('fs');var Redis=require(_0xa60c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa60c('0x6'));var logger=require('../../config/logger')(_0xa60c('0x7'));var config=require(_0xa60c('0x8'));var jayson=require(_0xa60c('0x9'));var client=jayson['client'][_0xa60c('0xa')]({'port':0x232a});config[_0xa60c('0xb')]=_[_0xa60c('0xc')](config[_0xa60c('0xb')],{'host':_0xa60c('0xd'),'port':0x18eb});var socket=require(_0xa60c('0xe'))(new Redis(config[_0xa60c('0xb')]));require(_0xa60c('0xf'))[_0xa60c('0x10')](socket);function respondWithRpcPromise(_0x1f9ed9,_0x3853eb,_0x135356){return new BPromise(function(_0x88600b,_0x101fdc){return client['request'](_0x1f9ed9,_0x135356)[_0xa60c('0x11')](function(_0x185acc){logger[_0xa60c('0x12')](_0xa60c('0x13'),_0x3853eb,_0xa60c('0x14'));logger['debug'](_0xa60c('0x15'),_0x3853eb,_0xa60c('0x14'),JSON[_0xa60c('0x16')](_0x185acc));if(_0x185acc[_0xa60c('0x17')]){if(_0x185acc[_0xa60c('0x17')]['code']===0x1f4){logger[_0xa60c('0x17')](_0xa60c('0x13'),_0x3853eb,_0x185acc['error']['message']);return _0x101fdc(_0x185acc['error'][_0xa60c('0x18')]);}logger[_0xa60c('0x17')](_0xa60c('0x13'),_0x3853eb,_0x185acc[_0xa60c('0x17')][_0xa60c('0x18')]);return _0x88600b(_0x185acc[_0xa60c('0x17')]['message']);}else{logger[_0xa60c('0x12')](_0xa60c('0x13'),_0x3853eb,_0xa60c('0x14'));_0x88600b(_0x185acc[_0xa60c('0x19')][_0xa60c('0x18')]);}})[_0xa60c('0x1a')](function(_0x49c770){logger['error'](_0xa60c('0x13'),_0x3853eb,_0x49c770);_0x101fdc(_0x49c770);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 22caa9f..02674de 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 _0x9bc7=['emit','removeListener','length','./userNotification.events','remove','update'];(function(_0xe17667,_0x4b64fe){var _0x25ff01=function(_0x16c1c4){while(--_0x16c1c4){_0xe17667['push'](_0xe17667['shift']());}};_0x25ff01(++_0x4b64fe);}(_0x9bc7,0x7b));var _0x79bc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9bc7[_0x397e5f];return _0x5302b8;};'use strict';var UserNotificationEvents=require(_0x79bc('0x0'));var events=['save',_0x79bc('0x1'),_0x79bc('0x2')];function createListener(_0x4d1ac9,_0x53cbbc){return function(_0x3620ec){_0x53cbbc[_0x79bc('0x3')](_0x4d1ac9,_0x3620ec);};}function removeListener(_0xa91be1,_0x559191){return function(){UserNotificationEvents[_0x79bc('0x4')](_0xa91be1,_0x559191);};}exports['register']=function(_0x5afdb2){for(var _0x5b73f2=0x0,_0x41c86d=events[_0x79bc('0x5')];_0x5b73f2<_0x41c86d;_0x5b73f2++){var _0x25df68=events[_0x5b73f2];var _0x425aef=createListener('userNotification:'+_0x25df68,_0x5afdb2);UserNotificationEvents['on'](_0x25df68,_0x425aef);}}; \ No newline at end of file +var _0x26b0=['remove','update','userNotification:'];(function(_0x84ef1,_0x4066de){var _0x35348e=function(_0x28e5e6){while(--_0x28e5e6){_0x84ef1['push'](_0x84ef1['shift']());}};_0x35348e(++_0x4066de);}(_0x26b0,0x1b3));var _0x026b=function(_0x260f23,_0x2d90ee){_0x260f23=_0x260f23-0x0;var _0x222dc1=_0x26b0[_0x260f23];return _0x222dc1;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save',_0x026b('0x0'),_0x026b('0x1')];function createListener(_0x26f2d1,_0x527af8){return function(_0x1f272a){_0x527af8['emit'](_0x26f2d1,_0x1f272a);};}function removeListener(_0x57689a,_0x2a941c){return function(){UserNotificationEvents['removeListener'](_0x57689a,_0x2a941c);};}exports['register']=function(_0x5539de){for(var _0x383620=0x0,_0x8e3618=events['length'];_0x383620<_0x8e3618;_0x383620++){var _0x2bd5ed=events[_0x383620];var _0x34f5c6=createListener(_0x026b('0x2')+_0x2bd5ed,_0x5539de);UserNotificationEvents['on'](_0x2bd5ed,_0x34f5c6);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index bd3a03c..54314c6 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6f8dc5,_0x15d9c7){var _0x2748e7=function(_0x38f3cb){while(--_0x38f3cb){_0x6f8dc5['push'](_0x6f8dc5['shift']());}};_0x2748e7(++_0x15d9c7);}(_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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x26a626,_0x9f79a3){var _0x430f65=function(_0x4d1a69){while(--_0x4d1a69){_0x26a626['push'](_0x26a626['shift']());}};_0x430f65(++_0x9f79a3);}(_0x70e0,0x17b));var _0x070e=function(_0x4dbfcb,_0x5e0cae){_0x4dbfcb=_0x4dbfcb-0x0;var _0xca3789=_0x70e0[_0x4dbfcb];return _0xca3789;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 6f1f2d6..1c059b5 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 _0xc213=['sequelize','exports','INTEGER'];(function(_0x2d5b64,_0x525685){var _0x311393=function(_0x8b0f75){while(--_0x8b0f75){_0x2d5b64['push'](_0x2d5b64['shift']());}};_0x311393(++_0x525685);}(_0xc213,0x19b));var _0x3c21=function(_0x2b0800,_0x3da853){_0x2b0800=_0x2b0800-0x0;var _0x1e044b=_0xc213[_0x2b0800];return _0x1e044b;};'use strict';var Sequelize=require(_0x3c21('0x0'));module[_0x3c21('0x1')]={'penalty':{'type':Sequelize[_0x3c21('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8303=['sequelize','exports'];(function(_0x452817,_0x2c6d5f){var _0x104ae3=function(_0x56e7a1){while(--_0x56e7a1){_0x452817['push'](_0x452817['shift']());}};_0x104ae3(++_0x2c6d5f);}(_0x8303,0x176));var _0x3830=function(_0x34229c,_0x44df84){_0x34229c=_0x34229c-0x0;var _0x7105d=_0x8303[_0x34229c];return _0x7105d;};'use strict';var Sequelize=require(_0x3830('0x0'));module[_0x3830('0x1')]={'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 a50cea6..37a19ab 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 _0x1c32=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x13fa73,_0x3640ec){var _0x5842ba=function(_0x56ea77){while(--_0x56ea77){_0x13fa73['push'](_0x13fa73['shift']());}};_0x5842ba(++_0x3640ec);}(_0x1c32,0x184));var _0x21c3=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x1c32[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x21c3('0x0'));var util=require(_0x21c3('0x1'));var logger=require(_0x21c3('0x2'))('api');var moment=require(_0x21c3('0x3'));var BPromise=require(_0x21c3('0x4'));var rp=require(_0x21c3('0x5'));var fs=require('fs');var path=require(_0x21c3('0x6'));var rimraf=require(_0x21c3('0x7'));var config=require(_0x21c3('0x8'));var attributes=require(_0x21c3('0x9'));module['exports']=function(_0x1cf4c0,_0x25e295){return _0x1cf4c0[_0x21c3('0xa')](_0x21c3('0xb'),attributes,{'tableName':_0x21c3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3ce=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash'];(function(_0x33b335,_0x3f422a){var _0x12f19d=function(_0x394718){while(--_0x394718){_0x33b335['push'](_0x33b335['shift']());}};_0x12f19d(++_0x3f422a);}(_0xa3ce,0xa8));var _0xea3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3ce[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xea3c('0x0'));var util=require(_0xea3c('0x1'));var logger=require('../../config/logger')(_0xea3c('0x2'));var moment=require('moment');var BPromise=require(_0xea3c('0x3'));var rp=require(_0xea3c('0x4'));var fs=require('fs');var path=require(_0xea3c('0x5'));var rimraf=require(_0xea3c('0x6'));var config=require(_0xea3c('0x7'));var attributes=require(_0xea3c('0x8'));module[_0xea3c('0x9')]=function(_0x1b453d,_0x4e2259){return _0x1b453d[_0xea3c('0xa')](_0xea3c('0xb'),attributes,{'tableName':_0xea3c('0xc'),'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 dfdf342..7044d83 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 _0x0815=['rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x589dcd,_0x2e6d1a){var _0x261bff=function(_0x4108a8){while(--_0x4108a8){_0x589dcd['push'](_0x589dcd['shift']());}};_0x261bff(++_0x2e6d1a);}(_0x0815,0x100));var _0x5081=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x0815[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5081('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5081('0x1'))['db'];var utils=require(_0x5081('0x2'));var logger=require(_0x5081('0x3'))(_0x5081('0x4'));var config=require(_0x5081('0x5'));var jayson=require(_0x5081('0x6'));var client=jayson[_0x5081('0x7')][_0x5081('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b1127,_0x33af08,_0x4edc8d){return new BPromise(function(_0x4ccd80,_0x22209e){return client[_0x5081('0x9')](_0x3b1127,_0x4edc8d)['then'](function(_0x37c4bc){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x33af08,_0x5081('0xa'));logger[_0x5081('0xb')](_0x5081('0xc'),_0x33af08,_0x5081('0xa'),JSON['stringify'](_0x37c4bc));if(_0x37c4bc['error']){if(_0x37c4bc[_0x5081('0xd')][_0x5081('0xe')]===0x1f4){logger['error'](_0x5081('0xf'),_0x33af08,_0x37c4bc['error'][_0x5081('0x10')]);return _0x22209e(_0x37c4bc['error']['message']);}logger[_0x5081('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x33af08,_0x37c4bc['error'][_0x5081('0x10')]);return _0x4ccd80(_0x37c4bc[_0x5081('0xd')]['message']);}else{logger[_0x5081('0x11')](_0x5081('0xf'),_0x33af08,_0x5081('0xa'));_0x4ccd80(_0x37c4bc[_0x5081('0x12')][_0x5081('0x10')]);}})[_0x5081('0x13')](function(_0x422da6){logger['error'](_0x5081('0xf'),_0x33af08,_0x422da6);_0x22209e(_0x422da6);});});} \ No newline at end of file +var _0x17b2=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x113855,_0x2bd31b){var _0x229a37=function(_0x7ddb1f){while(--_0x7ddb1f){_0x113855['push'](_0x113855['shift']());}};_0x229a37(++_0x2bd31b);}(_0x17b2,0x1d7));var _0x217b=function(_0x43d852,_0x4538ef){_0x43d852=_0x43d852-0x0;var _0x2c4b73=_0x17b2[_0x43d852];return _0x2c4b73;};'use strict';var _=require(_0x217b('0x0'));var util=require(_0x217b('0x1'));var moment=require(_0x217b('0x2'));var BPromise=require('bluebird');var rs=require(_0x217b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x217b('0x4'));var logger=require(_0x217b('0x5'))(_0x217b('0x6'));var config=require('../../config/environment');var jayson=require(_0x217b('0x7'));var client=jayson[_0x217b('0x8')][_0x217b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bf50e,_0x21c220,_0x174c54){return new BPromise(function(_0x9fef24,_0x33ab26){return client['request'](_0x5bf50e,_0x174c54)[_0x217b('0xa')](function(_0x4c8b7c){logger[_0x217b('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x21c220,_0x217b('0xc'));logger[_0x217b('0xd')](_0x217b('0xe'),_0x21c220,'request\x20sent',JSON[_0x217b('0xf')](_0x4c8b7c));if(_0x4c8b7c[_0x217b('0x10')]){if(_0x4c8b7c[_0x217b('0x10')][_0x217b('0x11')]===0x1f4){logger[_0x217b('0x10')](_0x217b('0x12'),_0x21c220,_0x4c8b7c[_0x217b('0x10')]['message']);return _0x33ab26(_0x4c8b7c[_0x217b('0x10')][_0x217b('0x13')]);}logger[_0x217b('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x21c220,_0x4c8b7c[_0x217b('0x10')]['message']);return _0x9fef24(_0x4c8b7c['error']['message']);}else{logger[_0x217b('0xb')](_0x217b('0x12'),_0x21c220,'request\x20sent');_0x9fef24(_0x4c8b7c[_0x217b('0x14')][_0x217b('0x13')]);}})[_0x217b('0x15')](function(_0x5e061e){logger[_0x217b('0x10')](_0x217b('0x12'),_0x21c220,_0x5e061e);_0x33ab26(_0x5e061e);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 6701fbe..db69878 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 _0x8dd6=['post','addSections','put','update','delete','destroy','removeResources','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','describe','get','/:id','show','/:id/sections','getSections','/:id/resources'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8dd6,0x1b1));var _0x68dd=function(_0x3be128,_0x1eef7d){_0x3be128=_0x3be128-0x0;var _0x5e4369=_0x8dd6[_0x3be128];return _0x5e4369;};'use strict';var multer=require(_0x68dd('0x0'));var util=require(_0x68dd('0x1'));var path=require(_0x68dd('0x2'));var timeout=require('connect-timeout');var express=require(_0x68dd('0x3'));var router=express['Router']();var fs_extra=require(_0x68dd('0x4'));var auth=require(_0x68dd('0x5'));var interaction=require(_0x68dd('0x6'));var config=require(_0x68dd('0x7'));var controller=require(_0x68dd('0x8'));router['get']('/',auth[_0x68dd('0x9')](),controller['index']);router['get']('/describe',auth[_0x68dd('0x9')](),controller[_0x68dd('0xa')]);router[_0x68dd('0xb')](_0x68dd('0xc'),auth[_0x68dd('0x9')](),controller[_0x68dd('0xd')]);router[_0x68dd('0xb')](_0x68dd('0xe'),auth['isAuthenticated'](),controller[_0x68dd('0xf')]);router['get'](_0x68dd('0x10'),auth[_0x68dd('0x9')](),controller['getResources']);router['post']('/',auth[_0x68dd('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x68dd('0x9')](),controller['clone']);router[_0x68dd('0x11')](_0x68dd('0xe'),auth[_0x68dd('0x9')](),controller[_0x68dd('0x12')]);router[_0x68dd('0x11')]('/:id/resources',auth[_0x68dd('0x9')](),controller['addResources']);router[_0x68dd('0x13')](_0x68dd('0xc'),auth['isAuthenticated'](),controller[_0x68dd('0x14')]);router[_0x68dd('0x15')](_0x68dd('0xc'),auth['isAuthenticated'](),controller[_0x68dd('0x16')]);router[_0x68dd('0x15')](_0x68dd('0xe'),auth['isAuthenticated'](),controller['removeSections']);router[_0x68dd('0x15')](_0x68dd('0x10'),auth['isAuthenticated'](),controller[_0x68dd('0x17')]);module[_0x68dd('0x18')]=router; \ No newline at end of file +var _0xc77d=['/:id/resources','getResources','create','/:id/clone','clone','post','/:id/sections','addSections','addResources','update','destroy','delete','removeSections','removeResources','exports','multer','connect-timeout','express','Router','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','getSections'];(function(_0x1ee351,_0x54261b){var _0x245aaf=function(_0x3e4b65){while(--_0x3e4b65){_0x1ee351['push'](_0x1ee351['shift']());}};_0x245aaf(++_0x54261b);}(_0xc77d,0x1af));var _0xdc77=function(_0x3cdcfc,_0x5c259b){_0x3cdcfc=_0x3cdcfc-0x0;var _0x4b7c43=_0xc77d[_0x3cdcfc];return _0x4b7c43;};'use strict';var multer=require(_0xdc77('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdc77('0x1'));var express=require(_0xdc77('0x2'));var router=express[_0xdc77('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(_0xdc77('0x4'));router[_0xdc77('0x5')]('/',auth[_0xdc77('0x6')](),controller['index']);router[_0xdc77('0x5')](_0xdc77('0x7'),auth['isAuthenticated'](),controller[_0xdc77('0x8')]);router['get'](_0xdc77('0x9'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/sections',auth['isAuthenticated'](),controller[_0xdc77('0xa')]);router[_0xdc77('0x5')](_0xdc77('0xb'),auth[_0xdc77('0x6')](),controller[_0xdc77('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdc77('0xd')]);router['post'](_0xdc77('0xe'),auth[_0xdc77('0x6')](),controller[_0xdc77('0xf')]);router[_0xdc77('0x10')](_0xdc77('0x11'),auth[_0xdc77('0x6')](),controller[_0xdc77('0x12')]);router[_0xdc77('0x10')](_0xdc77('0xb'),auth[_0xdc77('0x6')](),controller[_0xdc77('0x13')]);router['put'](_0xdc77('0x9'),auth[_0xdc77('0x6')](),controller[_0xdc77('0x14')]);router['delete'](_0xdc77('0x9'),auth[_0xdc77('0x6')](),controller[_0xdc77('0x15')]);router[_0xdc77('0x16')](_0xdc77('0x11'),auth[_0xdc77('0x6')](),controller[_0xdc77('0x17')]);router[_0xdc77('0x16')](_0xdc77('0xb'),auth[_0xdc77('0x6')](),controller[_0xdc77('0x18')]);module[_0xdc77('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index ac84f6a..a693825 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 _0x5f3d=['STRING','name','setDataValue','crudPermissions','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x19af2b,_0x274ecc){var _0x1d7b79=function(_0x37e6ab){while(--_0x37e6ab){_0x19af2b['push'](_0x19af2b['shift']());}};_0x1d7b79(++_0x274ecc);}(_0x5f3d,0x142));var _0xd5f3=function(_0x1b7ec3,_0x3affe9){_0x1b7ec3=_0x1b7ec3-0x0;var _0x388fc7=_0x5f3d[_0x1b7ec3];return _0x388fc7;};'use strict';var Sequelize=require(_0xd5f3('0x0'));module[_0xd5f3('0x1')]={'name':{'type':Sequelize[_0xd5f3('0x2')],'allowNull':![],'unique':_0xd5f3('0x3')},'crudPermissions':{'type':Sequelize[_0xd5f3('0x2')],'set':function(_0x201ada){this[_0xd5f3('0x4')](_0xd5f3('0x5'),_0x201ada?_0x201ada['join'](''):[]);},'get':function(){return this[_0xd5f3('0x6')](_0xd5f3('0x5'))?this[_0xd5f3('0x6')](_0xd5f3('0x5'))[_0xd5f3('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd5f3('0x8')],'defaultValue':!![]}}; \ No newline at end of file +var _0x6463=['join','getDataValue','crudPermissions','BOOLEAN','sequelize','STRING'];(function(_0x512d29,_0x5acca7){var _0x3666a9=function(_0x39fb9c){while(--_0x39fb9c){_0x512d29['push'](_0x512d29['shift']());}};_0x3666a9(++_0x5acca7);}(_0x6463,0x6a));var _0x3646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6463[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3646('0x0'));module['exports']={'name':{'type':Sequelize[_0x3646('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x3646('0x1')],'set':function(_0x508a58){this['setDataValue']('crudPermissions',_0x508a58?_0x508a58[_0x3646('0x2')](''):[]);},'get':function(){return this[_0x3646('0x3')](_0x3646('0x4'))?this[_0x3646('0x3')](_0x3646('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x3646('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3646('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x3646('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3646('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x3646('0x5')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index fd0a69a..4e0f81d 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 _0x9e6d=['Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','findAll','rows','catch','show','params','includeAll','include','options','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','UserProfileResource','describe','addSections','each','push','removeSections','enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','getResources','section'];(function(_0xc3a3cb,_0xa6d008){var _0x536d7a=function(_0x21e6b9){while(--_0x21e6b9){_0xc3a3cb['push'](_0xc3a3cb['shift']());}};_0x536d7a(++_0xa6d008);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x3047d7,_0x4f67f9){_0x3047d7=_0x3047d7-0x0;var _0xc173cc=_0x9e6d[_0x3047d7];return _0xc173cc;};'use strict';var emlformat=require(_0xd9e6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd9e6('0x1'));var jsonpatch=require(_0xd9e6('0x2'));var rp=require(_0xd9e6('0x3'));var moment=require('moment');var BPromise=require(_0xd9e6('0x4'));var Mustache=require(_0xd9e6('0x5'));var util=require(_0xd9e6('0x6'));var path=require(_0xd9e6('0x7'));var sox=require('sox');var csv=require(_0xd9e6('0x8'));var ejs=require(_0xd9e6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd9e6('0xa'));var crypto=require(_0xd9e6('0xb'));var jsforce=require(_0xd9e6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd9e6('0x8'));var querystring=require(_0xd9e6('0xd'));var Papa=require('papaparse');var Redis=require(_0xd9e6('0xe'));var authService=require(_0xd9e6('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9e6('0x10'));var logger=require(_0xd9e6('0x11'))(_0xd9e6('0x12'));var utils=require(_0xd9e6('0x13'));var config=require(_0xd9e6('0x14'));var licenseUtil=require(_0xd9e6('0x15'));var db=require(_0xd9e6('0x16'))['db'];config[_0xd9e6('0x17')]=_[_0xd9e6('0x18')](config['redis'],{'host':_0xd9e6('0x19'),'port':0x18eb});var socket=require(_0xd9e6('0x1a'))(new Redis(config['redis']));require('./userProfile.socket')[_0xd9e6('0x1b')](socket);function respondWithStatusCode(_0x5a9940,_0x3c69bb){_0x3c69bb=_0x3c69bb||0xcc;return function(_0x1b3e86){if(_0x1b3e86){return _0x5a9940[_0xd9e6('0x1c')](_0x3c69bb);}return _0x5a9940[_0xd9e6('0x1d')](_0x3c69bb)[_0xd9e6('0x1e')]();};}function respondWithResult(_0x4eb591,_0x5ddd5a){_0x5ddd5a=_0x5ddd5a||0xc8;return function(_0x10d104){if(_0x10d104){return _0x4eb591['status'](_0x5ddd5a)[_0xd9e6('0x1f')](_0x10d104);}};}function respondWithFilteredResult(_0x232770,_0xbe657c){return function(_0x2db831){if(_0x2db831){var _0xe30afc=typeof _0xbe657c[_0xd9e6('0x20')]===_0xd9e6('0x21')&&typeof _0xbe657c[_0xd9e6('0x22')]===_0xd9e6('0x21');var _0x2604a0=_0x2db831['count'];var _0x4eb9b0=_0xe30afc?0x0:_0xbe657c[_0xd9e6('0x20')];var _0x1063b4=_0xe30afc?_0x2db831[_0xd9e6('0x23')]:_0xbe657c['offset']+_0xbe657c[_0xd9e6('0x22')];var _0x106026;if(_0x1063b4>=_0x2604a0){_0x1063b4=_0x2604a0;_0x106026=0xc8;}else{_0x106026=0xce;}_0x232770[_0xd9e6('0x1d')](_0x106026);return _0x232770[_0xd9e6('0x24')]('Content-Range',_0x4eb9b0+'-'+_0x1063b4+'/'+_0x2604a0)['json'](_0x2db831);}return null;};}function patchUpdates(_0x162e67){return function(_0x3ada59){try{jsonpatch[_0xd9e6('0x25')](_0x3ada59,_0x162e67,!![]);}catch(_0x5dc0bd){return BPromise[_0xd9e6('0x26')](_0x5dc0bd);}return _0x3ada59[_0xd9e6('0x27')]();};}function saveUpdates(_0x2393b9,_0xdfd442){return function(_0x1cebad){if(_0x1cebad){return _0x1cebad[_0xd9e6('0x28')](_0x2393b9)[_0xd9e6('0x29')](function(_0x5e2eef){return _0x5e2eef;});}return null;};}function removeEntity(_0x3a8c62,_0x3b17f9){return function(_0x33b7af){if(_0x33b7af){return _0x33b7af[_0xd9e6('0x2a')]()[_0xd9e6('0x29')](function(){_0x3a8c62[_0xd9e6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e6de,_0xa32093){return function(_0x38df16){if(!_0x38df16){_0x32e6de[_0xd9e6('0x1c')](0x194);}return _0x38df16;};}function handleError(_0x3708a2,_0x2f815e){_0x2f815e=_0x2f815e||0x1f4;return function(_0x105831){logger[_0xd9e6('0x2b')](_0x105831[_0xd9e6('0x2c')]);if(_0x105831[_0xd9e6('0x2d')]){delete _0x105831[_0xd9e6('0x2d')];}_0x3708a2[_0xd9e6('0x1d')](_0x2f815e)[_0xd9e6('0x2e')](_0x105831);};}exports[_0xd9e6('0x2f')]=function(_0x5367c9,_0x339d5f){var _0x138473={},_0x45a52c={},_0x468052={'count':0x0,'rows':[]};var _0x436a48=_[_0xd9e6('0x30')](db[_0xd9e6('0x31')][_0xd9e6('0x32')],function(_0x53689c){return{'name':_0x53689c[_0xd9e6('0x33')],'type':_0x53689c[_0xd9e6('0x34')][_0xd9e6('0x35')]};});_0x45a52c['model']=_[_0xd9e6('0x30')](_0x436a48,'name');_0x45a52c[_0xd9e6('0x36')]=_[_0xd9e6('0x37')](_0x5367c9['query']);_0x45a52c['filters']=_[_0xd9e6('0x38')](_0x45a52c[_0xd9e6('0x39')],_0x45a52c['query']);_0x138473[_0xd9e6('0x3a')]=_['intersection'](_0x45a52c[_0xd9e6('0x39')],qs[_0xd9e6('0x3b')](_0x5367c9[_0xd9e6('0x36')][_0xd9e6('0x3b')]));_0x138473[_0xd9e6('0x3a')]=_0x138473[_0xd9e6('0x3a')][_0xd9e6('0x3c')]?_0x138473[_0xd9e6('0x3a')]:_0x45a52c['model'];if(!_0x5367c9['query'][_0xd9e6('0x3d')](_0xd9e6('0x3e'))){_0x138473[_0xd9e6('0x22')]=qs[_0xd9e6('0x22')](_0x5367c9[_0xd9e6('0x36')][_0xd9e6('0x22')]);_0x138473[_0xd9e6('0x20')]=qs[_0xd9e6('0x20')](_0x5367c9['query'][_0xd9e6('0x20')]);}_0x138473[_0xd9e6('0x3f')]=qs[_0xd9e6('0x40')](_0x5367c9['query'][_0xd9e6('0x40')]);_0x138473[_0xd9e6('0x41')]=qs[_0xd9e6('0x42')](_[_0xd9e6('0x43')](_0x5367c9[_0xd9e6('0x36')],_0x45a52c[_0xd9e6('0x42')]),_0x436a48);if(_0x5367c9[_0xd9e6('0x36')]['filter']){_0x138473['where']=_['merge'](_0x138473[_0xd9e6('0x41')],{'$or':_['map'](_0x436a48,function(_0x56b0a5){if(_0x56b0a5[_0xd9e6('0x34')]!==_0xd9e6('0x44')){var _0x44b173={};_0x44b173[_0x56b0a5['name']]={'$like':'%'+_0x5367c9[_0xd9e6('0x36')][_0xd9e6('0x45')]+'%'};return _0x44b173;}})});}_0x138473=_[_0xd9e6('0x46')]({},_0x138473,_0x5367c9['options']);var _0x27bce0={'where':_0x138473[_0xd9e6('0x41')]};return db[_0xd9e6('0x31')][_0xd9e6('0x23')](_0x27bce0)[_0xd9e6('0x29')](function(_0x4b874e){_0x468052[_0xd9e6('0x23')]=_0x4b874e;if(_0x5367c9['query']['includeAll']){_0x138473['include']=[{'all':!![]}];}return db[_0xd9e6('0x31')][_0xd9e6('0x47')](_0x138473);})['then'](function(_0x2e3fa8){_0x468052[_0xd9e6('0x48')]=_0x2e3fa8;return _0x468052;})[_0xd9e6('0x29')](respondWithFilteredResult(_0x339d5f,_0x138473))[_0xd9e6('0x49')](handleError(_0x339d5f,null));};exports[_0xd9e6('0x4a')]=function(_0xb60bc4,_0x3935a6){var _0x1c6641={'raw':![],'where':{'id':_0xb60bc4[_0xd9e6('0x4b')]['id']}},_0x57ddee={};_0x57ddee[_0xd9e6('0x39')]=_[_0xd9e6('0x37')](db[_0xd9e6('0x31')][_0xd9e6('0x32')]);_0x57ddee[_0xd9e6('0x36')]=_[_0xd9e6('0x37')](_0xb60bc4[_0xd9e6('0x36')]);_0x57ddee[_0xd9e6('0x42')]=_['intersection'](_0x57ddee[_0xd9e6('0x39')],_0x57ddee[_0xd9e6('0x36')]);_0x1c6641[_0xd9e6('0x3a')]=_[_0xd9e6('0x38')](_0x57ddee[_0xd9e6('0x39')],qs[_0xd9e6('0x3b')](_0xb60bc4[_0xd9e6('0x36')][_0xd9e6('0x3b')]));_0x1c6641['attributes']=_0x1c6641[_0xd9e6('0x3a')][_0xd9e6('0x3c')]?_0x1c6641[_0xd9e6('0x3a')]:_0x57ddee[_0xd9e6('0x39')];if(_0xb60bc4[_0xd9e6('0x36')][_0xd9e6('0x4c')]){_0x1c6641[_0xd9e6('0x4d')]=[{'all':!![]}];}_0x1c6641=_[_0xd9e6('0x46')]({},_0x1c6641,_0xb60bc4[_0xd9e6('0x4e')]);return db['UserProfile'][_0xd9e6('0x4f')](_0x1c6641)[_0xd9e6('0x29')](handleEntityNotFound(_0x3935a6,null))[_0xd9e6('0x29')](respondWithResult(_0x3935a6,null))['catch'](handleError(_0x3935a6,null));};exports[_0xd9e6('0x50')]=function(_0x324fe8,_0x14719a){return db[_0xd9e6('0x31')][_0xd9e6('0x50')](_0x324fe8[_0xd9e6('0x51')],{})[_0xd9e6('0x29')](respondWithResult(_0x14719a,0xc9))[_0xd9e6('0x49')](handleError(_0x14719a,null));};exports[_0xd9e6('0x52')]=function(_0x20a822,_0x289407){var _0x550796={'where':{'id':_0x20a822[_0xd9e6('0x4b')]['id']}},_0x4aea71={};_0x4aea71[_0xd9e6('0x39')]=_[_0xd9e6('0x37')](db[_0xd9e6('0x31')][_0xd9e6('0x32')]);_0x550796[_0xd9e6('0x3a')]=_['intersection'](_0x4aea71[_0xd9e6('0x39')],qs['fields'](_0x20a822[_0xd9e6('0x36')][_0xd9e6('0x3b')]));_0x550796[_0xd9e6('0x3a')]=_0x550796[_0xd9e6('0x3a')][_0xd9e6('0x3c')]?_0x550796['attributes']:_0x4aea71['model'];if(_0x20a822[_0xd9e6('0x36')][_0xd9e6('0x4c')]){_0x550796['include']=[{'all':!![]}];}_0x550796=_[_0xd9e6('0x46')]({},_0x550796,_0x20a822[_0xd9e6('0x4e')]);return db[_0xd9e6('0x31')][_0xd9e6('0x4f')](_0x550796)['then'](handleEntityNotFound(_0x289407,null))[_0xd9e6('0x29')](function(_0x5f16d5){if(_0x5f16d5){var _0x1e08f8=_0x5f16d5[_0xd9e6('0x53')]({'plain':!![]});_0x1e08f8=qs[_0xd9e6('0x54')](_0x1e08f8,['id',_0xd9e6('0x55'),_0xd9e6('0x56'),_0xd9e6('0x57')]);_0x20a822[_0xd9e6('0x51')]=_[_0xd9e6('0x54')](_0x20a822[_0xd9e6('0x51')],['id',_0xd9e6('0x55'),_0xd9e6('0x56')]);return db[_0xd9e6('0x58')][_0xd9e6('0x59')](function(_0x47df54){return db[_0xd9e6('0x31')][_0xd9e6('0x50')](_['merge'](_0x1e08f8,_0x20a822[_0xd9e6('0x51')]),{'include':_0x20a822[_0xd9e6('0x36')][_0xd9e6('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x47df54})['then'](function(_0x254b8f){var _0x5d2472=_0x254b8f[_0xd9e6('0x53')]({'plain':!![]});return db['UserProfileSection'][_0xd9e6('0x47')]({'where':{'userProfileId':_0x20a822[_0xd9e6('0x4b')]['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x4e642a){if(_0x4e642a){return BPromise['each'](_0x4e642a,function(_0x4865b2){return new BPromise(function(_0x5cde8b,_0xb58033){if(_0x4865b2[_0xd9e6('0x5a')]===null||_0x4865b2['autoAssociation']===0x1)_0x5cde8b(null);return db['UserProfileResource'][_0xd9e6('0x47')]({'where':{'sectionId':_0x4865b2['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x63cb6){var _0x22bb73=_[_0xd9e6('0x30')](_0x63cb6,function(_0x47b709){return qs[_0xd9e6('0x54')](_0x47b709,['id',_0xd9e6('0x55'),_0xd9e6('0x56'),_0xd9e6('0x5b')]);});_0x5cde8b(_0x22bb73);})[_0xd9e6('0x49')](function(_0x4e8620){_0xb58033(_0x4e8620);});})['then'](function(_0x1203de){var _0x17ef8e=qs[_0xd9e6('0x54')](_0x4865b2,['id',_0xd9e6('0x55'),_0xd9e6('0x56')]);_0x17ef8e[_0xd9e6('0x5c')]=_0x5d2472['id'];if(_0x1203de)_0x17ef8e[_0xd9e6('0x5d')]=_0x1203de;return _0x17ef8e;})[_0xd9e6('0x29')](function(_0x24d58d){return db[_0xd9e6('0x5e')][_0xd9e6('0x50')](_0x24d58d,{'include':[{'model':db[_0xd9e6('0x5f')],'as':'Resources'}],'raw':!![],'transaction':_0x47df54});});})[_0xd9e6('0x29')](function(){return _0x5d2472;});}});});});}})[_0xd9e6('0x29')](respondWithResult(_0x289407,0xc9))[_0xd9e6('0x49')](handleError(_0x289407,null));};exports[_0xd9e6('0x28')]=function(_0x2e4352,_0x7a6900){if(_0x2e4352[_0xd9e6('0x51')]['id']){delete _0x2e4352[_0xd9e6('0x51')]['id'];}return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x2e4352[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x7a6900,null))[_0xd9e6('0x29')](saveUpdates(_0x2e4352[_0xd9e6('0x51')],null))[_0xd9e6('0x29')](respondWithResult(_0x7a6900,null))[_0xd9e6('0x49')](handleError(_0x7a6900,null));};exports[_0xd9e6('0x2a')]=function(_0x37dfe2,_0x51e765){return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x37dfe2[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x51e765,null))['then'](removeEntity(_0x51e765,null))[_0xd9e6('0x49')](handleError(_0x51e765,null));};exports[_0xd9e6('0x60')]=function(_0x2dc460,_0x224c8a){return db['UserProfile'][_0xd9e6('0x60')]()[_0xd9e6('0x29')](respondWithResult(_0x224c8a,null))[_0xd9e6('0x49')](handleError(_0x224c8a,null));};exports[_0xd9e6('0x61')]=function(_0x384c9b,_0x5438e1){var _0x2294e2=_0x384c9b[_0xd9e6('0x51')];return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x384c9b[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x5438e1,null))[_0xd9e6('0x29')](function(_0x99e2c6){if(_0x99e2c6){return db[_0xd9e6('0x58')]['transaction'](function(_0x11382c){return db[_0xd9e6('0x5e')][_0xd9e6('0x2a')]({'where':{'userProfileId':_0x384c9b[_0xd9e6('0x4b')]['id'],'sectionId':_[_0xd9e6('0x30')](_0x2294e2,function(_0x24c143){return _0x24c143[_0xd9e6('0x5b')];})},'transaction':_0x11382c})[_0xd9e6('0x29')](function(){var _0x5cca00=_['map'](_0x2294e2,function(_0x3d4b19){_0x3d4b19['userProfileId']=_0x384c9b['params']['id'];return _0x3d4b19;});var _0x2c0ed0=[];return BPromise[_0xd9e6('0x62')](_0x5cca00,function(_0x11c1d2){return db[_0xd9e6('0x5e')][_0xd9e6('0x50')](_0x11c1d2,{'include':[{'model':db['UserProfileResource'],'as':_0xd9e6('0x5d')}],'raw':!![],'transaction':_0x11382c})['then'](function(_0x36e4e6){_0x2c0ed0[_0xd9e6('0x63')](_0x36e4e6[_0xd9e6('0x53')]({'plain':!![]}));});})[_0xd9e6('0x29')](function(){return _0x2c0ed0;});});});}})[_0xd9e6('0x29')](function(_0x4f11b4){return _0x4f11b4;})[_0xd9e6('0x29')](respondWithResult(_0x5438e1,null))[_0xd9e6('0x49')](handleError(_0x5438e1,null));};exports[_0xd9e6('0x64')]=function(_0x2246f1,_0x3c39a0){var _0x2c642f;return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x2246f1['params']['id']},'attributes':['id',_0xd9e6('0x2d')]})[_0xd9e6('0x29')](handleEntityNotFound(_0x3c39a0,null))[_0xd9e6('0x29')](function(_0x127e1c){if(_0x127e1c){_0x2c642f=_0x127e1c;return db[_0xd9e6('0x5e')][_0xd9e6('0x2a')]({'where':{'userProfileId':_0x2246f1['params']['id'],'sectionId':_0x2246f1[_0xd9e6('0x36')]['ids']}});}})['then'](function(){return _0x2c642f;})[_0xd9e6('0x29')](respondWithStatusCode(_0x3c39a0,null))[_0xd9e6('0x49')](handleError(_0x3c39a0,null));};exports['getSections']=function(_0x469fec,_0x57f35b){var _0x1a4308=[];var _0x4e08d1=[];return db[_0xd9e6('0x5e')][_0xd9e6('0x47')]({'where':{'userProfileId':_0x469fec[_0xd9e6('0x4b')]['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x5c8337){_0x1a4308=_['filter'](_0x5c8337,function(_0x59f6e9){return _0x59f6e9[_0xd9e6('0x65')]===0x1||_[_0xd9e6('0x66')]([0x3eb,0x709],_0x59f6e9[_0xd9e6('0x5b')]);});if(!_[_0xd9e6('0x67')](_0x1a4308)){return _['map'](_0x1a4308,function(_0x300a6d){return _0x300a6d[_0xd9e6('0x5b')];});}else{return;}})[_0xd9e6('0x29')](function(_0x5a71a1){if(_0x5a71a1)_0x4e08d1=_0x5a71a1;if(_['includes'](_0x4e08d1,0x64)){var _0xdd7835=_[_0xd9e6('0x4f')](_0x1a4308,{'sectionId':0x64});return hasDefaultDashboard(_0xdd7835)[_0xd9e6('0x29')](function(_0x40fe0a){return _[_0xd9e6('0x30')](_0x1a4308,function(_0x5ed76a){if(_0x5ed76a[_0xd9e6('0x5b')]===0x64){_0x5ed76a[_0xd9e6('0x68')]=_0x40fe0a;}return _0x5ed76a;});});}else{return;}})[_0xd9e6('0x29')](function(_0x35cd20){if(_0x35cd20)_0x1a4308=_0x35cd20;if(_[_0xd9e6('0x66')](_0x4e08d1,0x3eb)){var _0x4197c8=_[_0xd9e6('0x4f')](_0x1a4308,{'sectionId':0x3eb});return getCustomDashboards(_0x4197c8)['then'](function(_0x1b958c){return _[_0xd9e6('0x30')](_0x1a4308,function(_0x318b6d){if(_0x4197c8['enabled']){if(_0x318b6d['sectionId']===0x3eb){_0x318b6d[_0xd9e6('0x68')]=_0x1b958c;}}else{if(_0x318b6d[_0xd9e6('0x5b')]===0x64){_0x318b6d[_0xd9e6('0x68')]=_0x1b958c;}}return _0x318b6d;});});}else{return;}})['then'](function(_0x43b96b){if(_0x43b96b)_0x1a4308=_0x43b96b;if(_[_0xd9e6('0x66')](_0x4e08d1,0x709)){var _0x515b6=_['find'](_0x1a4308,{'sectionId':0x709});return getPlugins(_0x515b6)['then'](function(_0x15a136){if(_0x515b6['enabled']){return _[_0xd9e6('0x30')](_0x1a4308,function(_0x2fa56b){if(_0x2fa56b['sectionId']===0x709){_0x2fa56b['subsections']=_0x15a136;}return _0x2fa56b;});}else{var _0x162a31={'sectionId':0x76c,'enabled':0x1,'subsections':_0x15a136};var _0x2f5fe3=_[_0xd9e6('0x30')](_0x1a4308);_0x2f5fe3[_0xd9e6('0x63')](_0x162a31);return _0x2f5fe3;}});}else{return;}})[_0xd9e6('0x29')](function(_0x460562){if(_0x460562)_0x1a4308=_0x460562;return _['filter'](_0x1a4308,['enabled',0x1]);})[_0xd9e6('0x29')](respondWithResult(_0x57f35b,null))[_0xd9e6('0x49')](handleError(_0x57f35b,null));};function hasDefaultDashboard(_0x587c9c){var _0xa94c26=[0x65];return new BPromise(function(_0x1047fd,_0x1db8b4){try{if(_0x587c9c[_0xd9e6('0x5a')]){_0x1047fd(_0xa94c26);}else{return db[_0xd9e6('0x5f')]['findOne']({'where':{'sectionId':_0x587c9c['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x1551cf){_0x1551cf?_0x1047fd(_0xa94c26):_0x1047fd();});}}catch(_0xf13ed8){_0x1db8b4(_0xf13ed8);}});}function getCustomDashboards(_0x436f88){var _0x4810e3=[];return new BPromise(function(_0x242da1,_0x4b5d21){try{if(_0x436f88['autoAssociation']){return db[_0xd9e6('0x69')][_0xd9e6('0x47')]({'raw':!![]})[_0xd9e6('0x29')](function(_0x1e44f8){_0x1e44f8[_0xd9e6('0x6a')](function(_0x4ff27c){_0x4810e3[_0xd9e6('0x63')](_0x4ff27c['id']+0x1869f);});_0x242da1(_0x4810e3);});}else{return db['UserProfileResource'][_0xd9e6('0x47')]({'where':{'sectionId':_0x436f88['id']},'raw':!![]})['then'](function(_0x5332f4){_0x5332f4[_0xd9e6('0x6a')](function(_0x4f8f94){_0x4810e3['push'](_0x4f8f94[_0xd9e6('0x6b')]+0x1869f);});_0x242da1(_0x4810e3);});}}catch(_0x2cdd54){_0x4b5d21(_0x2cdd54);}});}function getPlugins(_0x5b1d62){var _0x496e58=[];return new BPromise(function(_0x309964,_0x207d7e){try{if(_0x5b1d62[_0xd9e6('0x5a')]){return db[_0xd9e6('0x6c')][_0xd9e6('0x47')]({'raw':!![]})[_0xd9e6('0x29')](function(_0x56d94e){_0x56d94e[_0xd9e6('0x6a')](function(_0x3a99b2){_0x496e58[_0xd9e6('0x63')](_0x3a99b2['id']+0x15b38);});_0x309964(_0x496e58);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x5b1d62['id']},'raw':!![]})[_0xd9e6('0x29')](function(_0x3f31f1){_0x3f31f1[_0xd9e6('0x6a')](function(_0x1fbea1){_0x496e58[_0xd9e6('0x63')](_0x1fbea1['resourceId']+0x15b38);});_0x309964(_0x496e58);});}}catch(_0x4aec06){_0x207d7e(_0x4aec06);}});}exports['addResources']=function(_0x3d1f97,_0x11cd13){return db[_0xd9e6('0x31')]['find']({'where':{'id':_0x3d1f97[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x11cd13,null))[_0xd9e6('0x29')](function(_0x5a3a80){if(_0x5a3a80){return db[_0xd9e6('0x58')][_0xd9e6('0x59')](function(_0x4ab3f1){return db['UserProfileSection'][_0xd9e6('0x47')]({'where':{'userProfileId':_0x3d1f97[_0xd9e6('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0xd9e6('0x29')](function(_0x20d948){if(_0x20d948){return db[_0xd9e6('0x5e')][_0xd9e6('0x2a')]({'where':{'userProfileId':_0x3d1f97[_0xd9e6('0x4b')]['id'],'id':_[_0xd9e6('0x30')](_0x20d948,function(_0x3630a5){return _0x3630a5['id'];})},'transaction':_0x4ab3f1});}})[_0xd9e6('0x29')](function(_0x2360d2){var _0x2175c3=_[_0xd9e6('0x30')](_0x3d1f97['body'],function(_0x1a2d1f){_0x1a2d1f[_0xd9e6('0x5c')]=_0x3d1f97[_0xd9e6('0x4b')]['id'];return _0x1a2d1f;});return db[_0xd9e6('0x5e')][_0xd9e6('0x6d')](_0x2175c3,{'raw':!![],'transaction':_0x4ab3f1});})[_0xd9e6('0x29')](function(_0x13382e){var _0x4be99a=_['filter'](_[_0xd9e6('0x30')](_0x13382e,function(_0x2b42d1){return _0x2b42d1['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4be99a){return db['UserProfileSection'][_0xd9e6('0x47')]({'where':{'userProfileId':_0x3d1f97[_0xd9e6('0x4b')]['id'],'sectionId':_['map'](_0x4be99a,function(_0x28c1ba){return _0x28c1ba[_0xd9e6('0x5b')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xd9e6('0x29')](function(_0x23f04a){var _0x9f20c6=_[_0xd9e6('0x30')](_0x3d1f97['body'],function(_0x49e92d){_0x49e92d[_0xd9e6('0x5c')]=_0x3d1f97[_0xd9e6('0x4b')]['id'];return _0x49e92d;});return db[_0xd9e6('0x5f')][_0xd9e6('0x6d')](_0x9f20c6,{'raw':!![],'transaction':_0x4ab3f1});});}})['catch'](handleError(_0x11cd13,null));});}})[_0xd9e6('0x29')](function(_0x229db3){var _0x3002a5=_[_0xd9e6('0x30')](_0x229db3,function(_0x5b28de){return _0x5b28de[_0xd9e6('0x53')]({'plain':!![]});});})[_0xd9e6('0x29')](respondWithResult(_0x11cd13,null))[_0xd9e6('0x49')](handleError(_0x11cd13,null));};exports[_0xd9e6('0x6e')]=function(_0x582201,_0x193817,_0x46feae){return db[_0xd9e6('0x31')][_0xd9e6('0x4f')]({'where':{'id':_0x582201[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](handleEntityNotFound(_0x193817,null))[_0xd9e6('0x29')](function(_0x3058fd){if(_0x3058fd){return _0x3058fd['removeResources'](_0x582201[_0xd9e6('0x36')][_0xd9e6('0x6f')]);}})[_0xd9e6('0x29')](respondWithStatusCode(_0x193817,null))[_0xd9e6('0x49')](handleError(_0x193817,null));};exports[_0xd9e6('0x70')]=function(_0x1ac814,_0x1f80f5){var _0x34dab3={};if(!_0x1ac814[_0xd9e6('0x36')][_0xd9e6('0x71')])throw new Error(_0xd9e6('0x72'));if(!_0x1ac814['query'][_0xd9e6('0x3d')]('nolimit')){_0x34dab3[_0xd9e6('0x22')]=qs[_0xd9e6('0x22')](_0x1ac814[_0xd9e6('0x36')]['limit']);_0x34dab3[_0xd9e6('0x20')]=qs[_0xd9e6('0x20')](_0x1ac814[_0xd9e6('0x36')][_0xd9e6('0x20')]);}return db['UserProfile'][_0xd9e6('0x4f')]({'where':{'id':_0x1ac814[_0xd9e6('0x4b')]['id']}})[_0xd9e6('0x29')](function(_0x3c4d8c){if(!_0x3c4d8c)throw new Error(_0xd9e6('0x73')+_0x1ac814[_0xd9e6('0x4b')]['id']);return db[_0xd9e6('0x31')][_0xd9e6('0x70')](_0x1ac814);})[_0xd9e6('0x29')](respondWithFilteredResult(_0x1f80f5,_0x34dab3))[_0xd9e6('0x49')](handleError(_0x1f80f5,null));}; \ No newline at end of file +var _0xdc9c=['defaults','redis','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','keys','filters','intersection','fields','query','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','clone','get','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','findAll','each','autoAssociation','UserProfileResource','userProfileId','Resources','UserProfileSection','describe','addSections','sectionId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','moment','bluebird','mustache','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','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x860520,_0x20520a){var _0x22ce80=function(_0x54ccbf){while(--_0x54ccbf){_0x860520['push'](_0x860520['shift']());}};_0x22ce80(++_0x20520a);}(_0xdc9c,0x13f));var _0xcdc9=function(_0x52e86a,_0x4f247a){_0x52e86a=_0x52e86a-0x0;var _0x36019f=_0xdc9c[_0x52e86a];return _0x36019f;};'use strict';var emlformat=require(_0xcdc9('0x0'));var rimraf=require(_0xcdc9('0x1'));var zipdir=require(_0xcdc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcdc9('0x3'));var BPromise=require(_0xcdc9('0x4'));var Mustache=require(_0xcdc9('0x5'));var util=require('util');var path=require(_0xcdc9('0x6'));var sox=require(_0xcdc9('0x7'));var csv=require(_0xcdc9('0x8'));var ejs=require(_0xcdc9('0x9'));var fs=require('fs');var fs_extra=require(_0xcdc9('0xa'));var _=require(_0xcdc9('0xb'));var squel=require(_0xcdc9('0xc'));var crypto=require(_0xcdc9('0xd'));var jsforce=require(_0xcdc9('0xe'));var deskjs=require(_0xcdc9('0xf'));var toCsv=require(_0xcdc9('0x8'));var querystring=require(_0xcdc9('0x10'));var Papa=require('papaparse');var Redis=require(_0xcdc9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcdc9('0x12'));var as=require(_0xcdc9('0x13'));var hardwareService=require(_0xcdc9('0x14'));var logger=require(_0xcdc9('0x15'))(_0xcdc9('0x16'));var utils=require('../../config/utils');var config=require(_0xcdc9('0x17'));var licenseUtil=require(_0xcdc9('0x18'));var db=require(_0xcdc9('0x19'))['db'];config['redis']=_[_0xcdc9('0x1a')](config[_0xcdc9('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xcdc9('0x1c'))(new Redis(config['redis']));require(_0xcdc9('0x1d'))[_0xcdc9('0x1e')](socket);function respondWithStatusCode(_0x2e31be,_0x28f482){_0x28f482=_0x28f482||0xcc;return function(_0x4d4269){if(_0x4d4269){return _0x2e31be[_0xcdc9('0x1f')](_0x28f482);}return _0x2e31be[_0xcdc9('0x20')](_0x28f482)[_0xcdc9('0x21')]();};}function respondWithResult(_0xa497e7,_0x5b8d9f){_0x5b8d9f=_0x5b8d9f||0xc8;return function(_0x39e2bd){if(_0x39e2bd){return _0xa497e7[_0xcdc9('0x20')](_0x5b8d9f)['json'](_0x39e2bd);}};}function respondWithFilteredResult(_0x2cf1b6,_0x21839d){return function(_0x4b726f){if(_0x4b726f){var _0x45e9e8=typeof _0x21839d[_0xcdc9('0x22')]==='undefined'&&typeof _0x21839d[_0xcdc9('0x23')]===_0xcdc9('0x24');var _0x45e5c5=_0x4b726f[_0xcdc9('0x25')];var _0x463dc2=_0x45e9e8?0x0:_0x21839d[_0xcdc9('0x22')];var _0x39e9e5=_0x45e9e8?_0x4b726f[_0xcdc9('0x25')]:_0x21839d['offset']+_0x21839d[_0xcdc9('0x23')];var _0x295e9f;if(_0x39e9e5>=_0x45e5c5){_0x39e9e5=_0x45e5c5;_0x295e9f=0xc8;}else{_0x295e9f=0xce;}_0x2cf1b6[_0xcdc9('0x20')](_0x295e9f);return _0x2cf1b6['set'](_0xcdc9('0x26'),_0x463dc2+'-'+_0x39e9e5+'/'+_0x45e5c5)['json'](_0x4b726f);}return null;};}function patchUpdates(_0x146327){return function(_0x5ebdf0){try{jsonpatch[_0xcdc9('0x27')](_0x5ebdf0,_0x146327,!![]);}catch(_0x2221d4){return BPromise[_0xcdc9('0x28')](_0x2221d4);}return _0x5ebdf0[_0xcdc9('0x29')]();};}function saveUpdates(_0x4f7ffe,_0x1439c0){return function(_0x35fefe){if(_0x35fefe){return _0x35fefe[_0xcdc9('0x2a')](_0x4f7ffe)[_0xcdc9('0x2b')](function(_0x21396b){return _0x21396b;});}return null;};}function removeEntity(_0x5b7992,_0x2ba68b){return function(_0x582d48){if(_0x582d48){return _0x582d48[_0xcdc9('0x2c')]()[_0xcdc9('0x2b')](function(){_0x5b7992[_0xcdc9('0x20')](0xcc)[_0xcdc9('0x21')]();});}};}function handleEntityNotFound(_0x4e2936,_0x29bd29){return function(_0x372a39){if(!_0x372a39){_0x4e2936[_0xcdc9('0x1f')](0x194);}return _0x372a39;};}function handleError(_0x5e6a2d,_0x2dd2ce){_0x2dd2ce=_0x2dd2ce||0x1f4;return function(_0x2fb2bb){logger[_0xcdc9('0x2d')](_0x2fb2bb['stack']);if(_0x2fb2bb[_0xcdc9('0x2e')]){delete _0x2fb2bb[_0xcdc9('0x2e')];}_0x5e6a2d[_0xcdc9('0x20')](_0x2dd2ce)[_0xcdc9('0x2f')](_0x2fb2bb);};}exports[_0xcdc9('0x30')]=function(_0xd31d28,_0x4f1668){var _0x294231={},_0x57628f={},_0x3b71bb={'count':0x0,'rows':[]};var _0x4e48f6=_[_0xcdc9('0x31')](db[_0xcdc9('0x32')][_0xcdc9('0x33')],function(_0x16afc5){return{'name':_0x16afc5[_0xcdc9('0x34')],'type':_0x16afc5['type'][_0xcdc9('0x35')]};});_0x57628f[_0xcdc9('0x36')]=_[_0xcdc9('0x31')](_0x4e48f6,_0xcdc9('0x2e'));_0x57628f['query']=_[_0xcdc9('0x37')](_0xd31d28['query']);_0x57628f[_0xcdc9('0x38')]=_['intersection'](_0x57628f[_0xcdc9('0x36')],_0x57628f['query']);_0x294231['attributes']=_[_0xcdc9('0x39')](_0x57628f['model'],qs[_0xcdc9('0x3a')](_0xd31d28[_0xcdc9('0x3b')]['fields']));_0x294231['attributes']=_0x294231[_0xcdc9('0x3c')][_0xcdc9('0x3d')]?_0x294231[_0xcdc9('0x3c')]:_0x57628f[_0xcdc9('0x36')];if(!_0xd31d28[_0xcdc9('0x3b')]['hasOwnProperty'](_0xcdc9('0x3e'))){_0x294231[_0xcdc9('0x23')]=qs['limit'](_0xd31d28[_0xcdc9('0x3b')]['limit']);_0x294231[_0xcdc9('0x22')]=qs[_0xcdc9('0x22')](_0xd31d28[_0xcdc9('0x3b')][_0xcdc9('0x22')]);}_0x294231[_0xcdc9('0x3f')]=qs[_0xcdc9('0x40')](_0xd31d28['query'][_0xcdc9('0x40')]);_0x294231[_0xcdc9('0x41')]=qs[_0xcdc9('0x38')](_[_0xcdc9('0x42')](_0xd31d28[_0xcdc9('0x3b')],_0x57628f['filters']),_0x4e48f6);if(_0xd31d28[_0xcdc9('0x3b')][_0xcdc9('0x43')]){_0x294231[_0xcdc9('0x41')]=_[_0xcdc9('0x44')](_0x294231['where'],{'$or':_['map'](_0x4e48f6,function(_0x2391a7){if(_0x2391a7[_0xcdc9('0x45')]!==_0xcdc9('0x46')){var _0x19bf28={};_0x19bf28[_0x2391a7['name']]={'$like':'%'+_0xd31d28[_0xcdc9('0x3b')][_0xcdc9('0x43')]+'%'};return _0x19bf28;}})});}_0x294231=_[_0xcdc9('0x44')]({},_0x294231,_0xd31d28[_0xcdc9('0x47')]);var _0x566b77={'where':_0x294231['where']};return db['UserProfile'][_0xcdc9('0x25')](_0x566b77)[_0xcdc9('0x2b')](function(_0x105ed1){_0x3b71bb[_0xcdc9('0x25')]=_0x105ed1;if(_0xd31d28['query'][_0xcdc9('0x48')]){_0x294231[_0xcdc9('0x49')]=[{'all':!![]}];}return db[_0xcdc9('0x32')]['findAll'](_0x294231);})[_0xcdc9('0x2b')](function(_0x5b6209){_0x3b71bb['rows']=_0x5b6209;return _0x3b71bb;})[_0xcdc9('0x2b')](respondWithFilteredResult(_0x4f1668,_0x294231))[_0xcdc9('0x4a')](handleError(_0x4f1668,null));};exports[_0xcdc9('0x4b')]=function(_0x116fe1,_0x2a1d8d){var _0x347b06={'raw':![],'where':{'id':_0x116fe1[_0xcdc9('0x4c')]['id']}},_0x1f01bc={};_0x1f01bc[_0xcdc9('0x36')]=_[_0xcdc9('0x37')](db['UserProfile'][_0xcdc9('0x33')]);_0x1f01bc[_0xcdc9('0x3b')]=_['keys'](_0x116fe1[_0xcdc9('0x3b')]);_0x1f01bc[_0xcdc9('0x38')]=_['intersection'](_0x1f01bc['model'],_0x1f01bc[_0xcdc9('0x3b')]);_0x347b06[_0xcdc9('0x3c')]=_[_0xcdc9('0x39')](_0x1f01bc[_0xcdc9('0x36')],qs[_0xcdc9('0x3a')](_0x116fe1[_0xcdc9('0x3b')][_0xcdc9('0x3a')]));_0x347b06[_0xcdc9('0x3c')]=_0x347b06[_0xcdc9('0x3c')]['length']?_0x347b06[_0xcdc9('0x3c')]:_0x1f01bc[_0xcdc9('0x36')];if(_0x116fe1[_0xcdc9('0x3b')]['includeAll']){_0x347b06[_0xcdc9('0x49')]=[{'all':!![]}];}_0x347b06=_['merge']({},_0x347b06,_0x116fe1[_0xcdc9('0x47')]);return db['UserProfile'][_0xcdc9('0x4d')](_0x347b06)[_0xcdc9('0x2b')](handleEntityNotFound(_0x2a1d8d,null))['then'](respondWithResult(_0x2a1d8d,null))[_0xcdc9('0x4a')](handleError(_0x2a1d8d,null));};exports['create']=function(_0x120f73,_0x1b9074){return db[_0xcdc9('0x32')][_0xcdc9('0x4e')](_0x120f73[_0xcdc9('0x4f')],{})[_0xcdc9('0x2b')](respondWithResult(_0x1b9074,0xc9))['catch'](handleError(_0x1b9074,null));};exports[_0xcdc9('0x50')]=function(_0x41221e,_0x454590){var _0x7cf1a9={'where':{'id':_0x41221e['params']['id']}},_0x4b7aac={};_0x4b7aac[_0xcdc9('0x36')]=_[_0xcdc9('0x37')](db[_0xcdc9('0x32')][_0xcdc9('0x33')]);_0x7cf1a9[_0xcdc9('0x3c')]=_[_0xcdc9('0x39')](_0x4b7aac[_0xcdc9('0x36')],qs[_0xcdc9('0x3a')](_0x41221e[_0xcdc9('0x3b')][_0xcdc9('0x3a')]));_0x7cf1a9['attributes']=_0x7cf1a9['attributes'][_0xcdc9('0x3d')]?_0x7cf1a9[_0xcdc9('0x3c')]:_0x4b7aac[_0xcdc9('0x36')];if(_0x41221e['query'][_0xcdc9('0x48')]){_0x7cf1a9['include']=[{'all':!![]}];}_0x7cf1a9=_[_0xcdc9('0x44')]({},_0x7cf1a9,_0x41221e[_0xcdc9('0x47')]);return db['UserProfile'][_0xcdc9('0x4d')](_0x7cf1a9)['then'](handleEntityNotFound(_0x454590,null))['then'](function(_0x5bd3d0){if(_0x5bd3d0){var _0x384f9f=_0x5bd3d0[_0xcdc9('0x51')]({'plain':!![]});_0x384f9f=qs[_0xcdc9('0x52')](_0x384f9f,['id','createdAt',_0xcdc9('0x53'),_0xcdc9('0x54')]);_0x41221e[_0xcdc9('0x4f')]=_['omit'](_0x41221e['body'],['id',_0xcdc9('0x55'),_0xcdc9('0x53')]);return db[_0xcdc9('0x56')][_0xcdc9('0x57')](function(_0x52c6e6){return db[_0xcdc9('0x32')][_0xcdc9('0x4e')](_[_0xcdc9('0x44')](_0x384f9f,_0x41221e[_0xcdc9('0x4f')]),{'include':_0x41221e['query'][_0xcdc9('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x52c6e6})[_0xcdc9('0x2b')](function(_0x20863a){var _0x2bd7ff=_0x20863a[_0xcdc9('0x51')]({'plain':!![]});return db['UserProfileSection'][_0xcdc9('0x58')]({'where':{'userProfileId':_0x41221e[_0xcdc9('0x4c')]['id']},'raw':!![]})[_0xcdc9('0x2b')](function(_0x137aa3){if(_0x137aa3){return BPromise[_0xcdc9('0x59')](_0x137aa3,function(_0x4d71e4){return new BPromise(function(_0x15dcf0,_0x549971){if(_0x4d71e4[_0xcdc9('0x5a')]===null||_0x4d71e4[_0xcdc9('0x5a')]===0x1)_0x15dcf0(null);return db[_0xcdc9('0x5b')][_0xcdc9('0x58')]({'where':{'sectionId':_0x4d71e4['id']},'raw':!![]})[_0xcdc9('0x2b')](function(_0x262982){var _0x47e8d3=_[_0xcdc9('0x31')](_0x262982,function(_0x268f09){return qs[_0xcdc9('0x52')](_0x268f09,['id','createdAt',_0xcdc9('0x53'),'sectionId']);});_0x15dcf0(_0x47e8d3);})['catch'](function(_0x59a512){_0x549971(_0x59a512);});})[_0xcdc9('0x2b')](function(_0x31510e){var _0x1a7e05=qs[_0xcdc9('0x52')](_0x4d71e4,['id','createdAt',_0xcdc9('0x53')]);_0x1a7e05[_0xcdc9('0x5c')]=_0x2bd7ff['id'];if(_0x31510e)_0x1a7e05[_0xcdc9('0x5d')]=_0x31510e;return _0x1a7e05;})['then'](function(_0x9a20df){return db[_0xcdc9('0x5e')][_0xcdc9('0x4e')](_0x9a20df,{'include':[{'model':db[_0xcdc9('0x5b')],'as':_0xcdc9('0x5d')}],'raw':!![],'transaction':_0x52c6e6});});})[_0xcdc9('0x2b')](function(){return _0x2bd7ff;});}});});});}})[_0xcdc9('0x2b')](respondWithResult(_0x454590,0xc9))[_0xcdc9('0x4a')](handleError(_0x454590,null));};exports[_0xcdc9('0x2a')]=function(_0x25604b,_0x473c8c){if(_0x25604b['body']['id']){delete _0x25604b['body']['id'];}return db[_0xcdc9('0x32')][_0xcdc9('0x4d')]({'where':{'id':_0x25604b['params']['id']}})['then'](handleEntityNotFound(_0x473c8c,null))[_0xcdc9('0x2b')](saveUpdates(_0x25604b[_0xcdc9('0x4f')],null))[_0xcdc9('0x2b')](respondWithResult(_0x473c8c,null))['catch'](handleError(_0x473c8c,null));};exports[_0xcdc9('0x2c')]=function(_0xbe6f60,_0x34d189){return db[_0xcdc9('0x32')][_0xcdc9('0x4d')]({'where':{'id':_0xbe6f60[_0xcdc9('0x4c')]['id']}})[_0xcdc9('0x2b')](handleEntityNotFound(_0x34d189,null))[_0xcdc9('0x2b')](removeEntity(_0x34d189,null))[_0xcdc9('0x4a')](handleError(_0x34d189,null));};exports[_0xcdc9('0x5f')]=function(_0x342ab2,_0x4e3fc0){return db[_0xcdc9('0x32')][_0xcdc9('0x5f')]()[_0xcdc9('0x2b')](respondWithResult(_0x4e3fc0,null))[_0xcdc9('0x4a')](handleError(_0x4e3fc0,null));};exports[_0xcdc9('0x60')]=function(_0x58b221,_0x410b01){var _0x3bc15c=_0x58b221[_0xcdc9('0x4f')];return db[_0xcdc9('0x32')][_0xcdc9('0x4d')]({'where':{'id':_0x58b221[_0xcdc9('0x4c')]['id']}})[_0xcdc9('0x2b')](handleEntityNotFound(_0x410b01,null))['then'](function(_0x3afce9){if(_0x3afce9){return db[_0xcdc9('0x56')][_0xcdc9('0x57')](function(_0x3ec8a7){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x58b221[_0xcdc9('0x4c')]['id'],'sectionId':_['map'](_0x3bc15c,function(_0x42d77a){return _0x42d77a[_0xcdc9('0x61')];})},'transaction':_0x3ec8a7})[_0xcdc9('0x2b')](function(){var _0x375b1d=_['map'](_0x3bc15c,function(_0x187951){_0x187951['userProfileId']=_0x58b221[_0xcdc9('0x4c')]['id'];return _0x187951;});var _0x2359dd=[];return BPromise[_0xcdc9('0x59')](_0x375b1d,function(_0x4705b7){return db[_0xcdc9('0x5e')][_0xcdc9('0x4e')](_0x4705b7,{'include':[{'model':db[_0xcdc9('0x5b')],'as':'Resources'}],'raw':!![],'transaction':_0x3ec8a7})[_0xcdc9('0x2b')](function(_0x1c340e){_0x2359dd[_0xcdc9('0x62')](_0x1c340e[_0xcdc9('0x51')]({'plain':!![]}));});})[_0xcdc9('0x2b')](function(){return _0x2359dd;});});});}})[_0xcdc9('0x2b')](function(_0x68635d){return _0x68635d;})[_0xcdc9('0x2b')](respondWithResult(_0x410b01,null))[_0xcdc9('0x4a')](handleError(_0x410b01,null));};exports[_0xcdc9('0x63')]=function(_0x10b096,_0x27a6d7){var _0x291ea;return db[_0xcdc9('0x32')][_0xcdc9('0x4d')]({'where':{'id':_0x10b096[_0xcdc9('0x4c')]['id']},'attributes':['id',_0xcdc9('0x2e')]})[_0xcdc9('0x2b')](handleEntityNotFound(_0x27a6d7,null))[_0xcdc9('0x2b')](function(_0x40779c){if(_0x40779c){_0x291ea=_0x40779c;return db[_0xcdc9('0x5e')][_0xcdc9('0x2c')]({'where':{'userProfileId':_0x10b096['params']['id'],'sectionId':_0x10b096['query'][_0xcdc9('0x64')]}});}})[_0xcdc9('0x2b')](function(){return _0x291ea;})['then'](respondWithStatusCode(_0x27a6d7,null))['catch'](handleError(_0x27a6d7,null));};exports[_0xcdc9('0x65')]=function(_0x7cc91f,_0x1d30b6){var _0x46489d=[];var _0x4b26f1=[];return db['UserProfileSection'][_0xcdc9('0x58')]({'where':{'userProfileId':_0x7cc91f[_0xcdc9('0x4c')]['id']},'raw':!![]})[_0xcdc9('0x2b')](function(_0x459d26){_0x46489d=_['filter'](_0x459d26,function(_0xf4e249){return _0xf4e249[_0xcdc9('0x66')]===0x1||_[_0xcdc9('0x67')]([0x3eb,0x709],_0xf4e249['sectionId']);});if(!_[_0xcdc9('0x68')](_0x46489d)){return _[_0xcdc9('0x31')](_0x46489d,function(_0x379f02){return _0x379f02[_0xcdc9('0x61')];});}else{return;}})[_0xcdc9('0x2b')](function(_0xfd26d7){if(_0xfd26d7)_0x4b26f1=_0xfd26d7;if(_['includes'](_0x4b26f1,0x64)){var _0x48d82a=_[_0xcdc9('0x4d')](_0x46489d,{'sectionId':0x64});return hasDefaultDashboard(_0x48d82a)[_0xcdc9('0x2b')](function(_0x49754d){return _['map'](_0x46489d,function(_0x80c0f){if(_0x80c0f[_0xcdc9('0x61')]===0x64){_0x80c0f['subsections']=_0x49754d;}return _0x80c0f;});});}else{return;}})[_0xcdc9('0x2b')](function(_0x235870){if(_0x235870)_0x46489d=_0x235870;if(_[_0xcdc9('0x67')](_0x4b26f1,0x3eb)){var _0x147d42=_[_0xcdc9('0x4d')](_0x46489d,{'sectionId':0x3eb});return getCustomDashboards(_0x147d42)[_0xcdc9('0x2b')](function(_0x3597a1){return _[_0xcdc9('0x31')](_0x46489d,function(_0x59d0ad){if(_0x147d42[_0xcdc9('0x66')]){if(_0x59d0ad[_0xcdc9('0x61')]===0x3eb){_0x59d0ad[_0xcdc9('0x69')]=_0x3597a1;}}else{if(_0x59d0ad[_0xcdc9('0x61')]===0x64){if(!_0x59d0ad[_0xcdc9('0x69')]){_0x59d0ad[_0xcdc9('0x69')]=[];}_0x59d0ad[_0xcdc9('0x69')]=_0x59d0ad['subsections']['concat'](_0x3597a1);}}return _0x59d0ad;});});}else{return;}})[_0xcdc9('0x2b')](function(_0x832467){if(_0x832467)_0x46489d=_0x832467;if(_[_0xcdc9('0x67')](_0x4b26f1,0x709)){var _0x513102=_[_0xcdc9('0x4d')](_0x46489d,{'sectionId':0x709});return getPlugins(_0x513102)[_0xcdc9('0x2b')](function(_0x5b10b0){if(_0x513102[_0xcdc9('0x66')]){return _['map'](_0x46489d,function(_0x2b9af2){if(_0x2b9af2['sectionId']===0x709){_0x2b9af2[_0xcdc9('0x69')]=_0x5b10b0;}return _0x2b9af2;});}else{var _0x32a5ad={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5b10b0};var _0xfc49a6=_['map'](_0x46489d);_0xfc49a6['push'](_0x32a5ad);return _0xfc49a6;}});}else{return;}})[_0xcdc9('0x2b')](function(_0x3d2524){if(_0x3d2524)_0x46489d=_0x3d2524;return _[_0xcdc9('0x43')](_0x46489d,[_0xcdc9('0x66'),0x1]);})['then'](respondWithResult(_0x1d30b6,null))[_0xcdc9('0x4a')](handleError(_0x1d30b6,null));};function hasDefaultDashboard(_0x2e67f4){var _0x3bac12=[0x65];return new BPromise(function(_0x3dfc20,_0x299015){try{if(_0x2e67f4[_0xcdc9('0x5a')]){_0x3dfc20(_0x3bac12);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x2e67f4['id']},'raw':!![]})['then'](function(_0x552ad4){_0x552ad4?_0x3dfc20(_0x3bac12):_0x3dfc20();});}}catch(_0x1a31d4){_0x299015(_0x1a31d4);}});}function getCustomDashboards(_0x533929){var _0x5f4072=[];return new BPromise(function(_0x21298d,_0x4ab288){try{if(_0x533929[_0xcdc9('0x5a')]){return db['Dashboard'][_0xcdc9('0x58')]({'raw':!![]})[_0xcdc9('0x2b')](function(_0x21f568){_0x21f568[_0xcdc9('0x6a')](function(_0x48b4f9){_0x5f4072['push'](_0x48b4f9['id']+0x1869f);});_0x21298d(_0x5f4072);});}else{return db[_0xcdc9('0x5b')]['findAll']({'where':{'sectionId':_0x533929['id']},'raw':!![]})[_0xcdc9('0x2b')](function(_0x53ff9f){_0x53ff9f[_0xcdc9('0x6a')](function(_0x1fb8d9){_0x5f4072['push'](_0x1fb8d9[_0xcdc9('0x6b')]+0x1869f);});_0x21298d(_0x5f4072);});}}catch(_0x3b82bf){_0x4ab288(_0x3b82bf);}});}function getPlugins(_0x15f127){var _0x5ea0b2=[];return new BPromise(function(_0x1b3544,_0x4d08bb){try{if(_0x15f127['autoAssociation']){return db[_0xcdc9('0x6c')]['findAll']({'raw':!![]})[_0xcdc9('0x2b')](function(_0x49f54a){_0x49f54a[_0xcdc9('0x6a')](function(_0x504458){_0x5ea0b2[_0xcdc9('0x62')](_0x504458['id']+0x15b38);});_0x1b3544(_0x5ea0b2);});}else{return db['UserProfileResource'][_0xcdc9('0x58')]({'where':{'sectionId':_0x15f127['id']},'raw':!![]})[_0xcdc9('0x2b')](function(_0xc8205e){_0xc8205e['forEach'](function(_0x35aa7f){_0x5ea0b2[_0xcdc9('0x62')](_0x35aa7f[_0xcdc9('0x6b')]+0x15b38);});_0x1b3544(_0x5ea0b2);});}}catch(_0x3b3868){_0x4d08bb(_0x3b3868);}});}exports[_0xcdc9('0x6d')]=function(_0x13c928,_0x4c8a6d){return db[_0xcdc9('0x32')][_0xcdc9('0x4d')]({'where':{'id':_0x13c928[_0xcdc9('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c8a6d,null))[_0xcdc9('0x2b')](function(_0x3c01ac){if(_0x3c01ac){return db[_0xcdc9('0x56')][_0xcdc9('0x57')](function(_0x19aca9){return db[_0xcdc9('0x5e')][_0xcdc9('0x58')]({'where':{'userProfileId':_0x13c928[_0xcdc9('0x4c')]['id']},'attributes':['id'],'raw':!![]})[_0xcdc9('0x2b')](function(_0x2805b9){if(_0x2805b9){return db[_0xcdc9('0x5e')]['destroy']({'where':{'userProfileId':_0x13c928[_0xcdc9('0x4c')]['id'],'id':_['map'](_0x2805b9,function(_0x3c6747){return _0x3c6747['id'];})},'transaction':_0x19aca9});}})['then'](function(_0x41be60){var _0x3f6522=_[_0xcdc9('0x31')](_0x13c928[_0xcdc9('0x4f')],function(_0x5e2f47){_0x5e2f47['userProfileId']=_0x13c928['params']['id'];return _0x5e2f47;});return db['UserProfileSection'][_0xcdc9('0x6e')](_0x3f6522,{'raw':!![],'transaction':_0x19aca9});})['then'](function(_0x1a64cf){var _0x4b292f=_['filter'](_['map'](_0x1a64cf,function(_0x1632ee){return _0x1632ee['get']({'plain':!![]});}),{'includeAll':![]});if(_0x4b292f){return db[_0xcdc9('0x5e')]['findAll']({'where':{'userProfileId':_0x13c928[_0xcdc9('0x4c')]['id'],'sectionId':_[_0xcdc9('0x31')](_0x4b292f,function(_0x40bd18){return _0x40bd18['sectionId'];})},'attributes':['id',_0xcdc9('0x61')],'raw':!![]})['then'](function(_0x4c90c9){var _0x530251=_[_0xcdc9('0x31')](_0x13c928[_0xcdc9('0x4f')],function(_0x57bb3a){_0x57bb3a[_0xcdc9('0x5c')]=_0x13c928['params']['id'];return _0x57bb3a;});return db[_0xcdc9('0x5b')]['bulkCreate'](_0x530251,{'raw':!![],'transaction':_0x19aca9});});}})[_0xcdc9('0x4a')](handleError(_0x4c8a6d,null));});}})['then'](function(_0x3b5fa4){var _0x234b09=_[_0xcdc9('0x31')](_0x3b5fa4,function(_0xd393fe){return _0xd393fe[_0xcdc9('0x51')]({'plain':!![]});});})[_0xcdc9('0x2b')](respondWithResult(_0x4c8a6d,null))[_0xcdc9('0x4a')](handleError(_0x4c8a6d,null));};exports[_0xcdc9('0x6f')]=function(_0xf4ba5f,_0x4444c6,_0x10901e){return db['UserProfile'][_0xcdc9('0x4d')]({'where':{'id':_0xf4ba5f[_0xcdc9('0x4c')]['id']}})[_0xcdc9('0x2b')](handleEntityNotFound(_0x4444c6,null))['then'](function(_0x2eff0b){if(_0x2eff0b){return _0x2eff0b[_0xcdc9('0x6f')](_0xf4ba5f[_0xcdc9('0x3b')][_0xcdc9('0x64')]);}})['then'](respondWithStatusCode(_0x4444c6,null))['catch'](handleError(_0x4444c6,null));};exports[_0xcdc9('0x70')]=function(_0x3ec69c,_0x4e4ed7){var _0x34670d={};if(!_0x3ec69c[_0xcdc9('0x3b')]['section'])throw new Error(_0xcdc9('0x71'));if(!_0x3ec69c[_0xcdc9('0x3b')]['hasOwnProperty']('nolimit')){_0x34670d[_0xcdc9('0x23')]=qs[_0xcdc9('0x23')](_0x3ec69c[_0xcdc9('0x3b')][_0xcdc9('0x23')]);_0x34670d[_0xcdc9('0x22')]=qs[_0xcdc9('0x22')](_0x3ec69c['query'][_0xcdc9('0x22')]);}return db[_0xcdc9('0x32')][_0xcdc9('0x4d')]({'where':{'id':_0x3ec69c['params']['id']}})[_0xcdc9('0x2b')](function(_0x260459){if(!_0x260459)throw new Error(_0xcdc9('0x72')+_0x3ec69c[_0xcdc9('0x4c')]['id']);return db[_0xcdc9('0x32')][_0xcdc9('0x70')](_0x3ec69c);})[_0xcdc9('0x2b')](respondWithFilteredResult(_0x4e4ed7,_0x34670d))[_0xcdc9('0x4a')](handleError(_0x4e4ed7,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 834cfe4..a6ae772 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 _0x49fe=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x57ff7b,_0x470f0d){var _0x2b15d3=function(_0x17c685){while(--_0x17c685){_0x57ff7b['push'](_0x57ff7b['shift']());}};_0x2b15d3(++_0x470f0d);}(_0x49fe,0x75));var _0xe49f=function(_0x2a0390,_0x1bc633){_0x2a0390=_0x2a0390-0x0;var _0x2b5fd3=_0x49fe[_0x2a0390];return _0x2b5fd3;};'use strict';var EventEmitter=require(_0xe49f('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe49f('0x1'),'afterUpdate':_0xe49f('0x2'),'afterDestroy':_0xe49f('0x3')};function emitEvent(_0xb99c7){return function(_0x1cac40,_0x2db0ec,_0x1235f4){UserProfileEvents[_0xe49f('0x4')](_0xb99c7+':'+_0x1cac40['id'],_0x1cac40);UserProfileEvents[_0xe49f('0x4')](_0xb99c7,_0x1cac40);_0x1235f4(null);};}for(var e in events){if(events[_0xe49f('0x5')](e)){var event=events[e];UserProfile[_0xe49f('0x6')](e,emitEvent(event));}}module[_0xe49f('0x7')]=UserProfileEvents; \ No newline at end of file +var _0x49fe=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0xdeb8fe,_0x455878){var _0x4c7674=function(_0x439b27){while(--_0x439b27){_0xdeb8fe['push'](_0xdeb8fe['shift']());}};_0x4c7674(++_0x455878);}(_0x49fe,0x75));var _0xe49f=function(_0x34df13,_0x4126a5){_0x34df13=_0x34df13-0x0;var _0x2ad70b=_0x49fe[_0x34df13];return _0x2ad70b;};'use strict';var EventEmitter=require(_0xe49f('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe49f('0x1'),'afterUpdate':_0xe49f('0x2'),'afterDestroy':_0xe49f('0x3')};function emitEvent(_0xb99c7){return function(_0x1cac40,_0x2db0ec,_0x1235f4){UserProfileEvents[_0xe49f('0x4')](_0xb99c7+':'+_0x1cac40['id'],_0x1cac40);UserProfileEvents[_0xe49f('0x4')](_0xb99c7,_0x1cac40);_0x1235f4(null);};}for(var e in events){if(events[_0xe49f('0x5')](e)){var event=events[e];UserProfile[_0xe49f('0x6')](e,emitEvent(event));}}module[_0xe49f('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 056758b..1bb8cd3 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 _0x814c=['SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','User','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','templates','triggers','Trigger','trunks','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','params','all','union','length','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','reportType','default','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','include','Tag','Tags','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','catch','value','model','findAll','then','map','name','resolve','UserProfileResource','AnalyticExtractedReport','associatedResources','resourceId','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','internalroutes','outboundroutes','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','role','Telephones','telephone','VoiceQueues','VoiceQueue','type','QueueCampaigns','queue','musiconholds','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','queuecampaigns','users','agents','telephones','Users','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts'];(function(_0x57e477,_0xec10a4){var _0x3c47b5=function(_0x4bfc4b){while(--_0x4bfc4b){_0x57e477['push'](_0x57e477['shift']());}};_0x3c47b5(++_0xec10a4);}(_0x814c,0x12b));var _0xc814=function(_0x3e82a0,_0x16e564){_0x3e82a0=_0x3e82a0-0x0;var _0x4ea8a7=_0x814c[_0x3e82a0];return _0x4ea8a7;};'use strict';var _=require(_0xc814('0x0'));var attributes=require(_0xc814('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0xc814('0x2'));module[_0xc814('0x3')]=function(_0x36928d){var _0x1ed0d9=_0x36928d[_0xc814('0x4')];function _0x5e9d9e(_0x50c05e,_0x44fa11){return new Promise(function(_0x1b5f4b,_0x3248ae){if(!_0x44fa11)return _0x1b5f4b(null);var _0x3a8d30=_0x44fa11[_0xc814('0x5')]?{[_0x44fa11[_0xc814('0x5')][_0xc814('0x6')]]:_0x44fa11[_0xc814('0x5')]['value']}:undefined;return _0x1ed0d9[_0x50c05e]['findAll']({'where':_0x3a8d30,'raw':!![]})['then'](function(_0x5dc606){_0x44fa11['associatedResources']=_['map'](_0x5dc606,'id');_0x1b5f4b(_0x44fa11);})[_0xc814('0x7')](function(_0x3eb2c3){_0x3248ae(_0x3eb2c3);});});}function _0x12f196(_0x4e792c,_0x5476d0){return new Promise(function(_0x46b3a7,_0x297545){var _0x3ae44e=_0x4e792c[_0xc814('0x5')]?{[_0x4e792c[_0xc814('0x5')][_0xc814('0x6')]]:_0x4e792c[_0xc814('0x5')][_0xc814('0x8')]}:undefined;return _0x1ed0d9[_0x4e792c[_0xc814('0x9')]][_0xc814('0xa')]({'where':_0x3ae44e,'raw':!![]})[_0xc814('0xb')](function(_0x3ffbcd){_0x5476d0['associatedResources']=_[_0xc814('0xc')](_0x3ffbcd,function(_0xd9c53b){return _0xd9c53b[_0xc814('0xd')];});_0x46b3a7(_0x5476d0);})[_0xc814('0x7')](function(_0x28b315){_0x297545(_0x28b315);});});}function _0x27c0dd(_0x5aa507,_0x24c0f9,_0x41dc32){if(!_0x24c0f9)return Promise[_0xc814('0xe')](null);return new Promise(function(_0x3a5c69,_0x49cb48){return _0x1ed0d9[_0xc814('0xf')]['findAll']({'where':{'sectionId':_0x24c0f9['id']},'raw':!![]})['then'](function(_0x5ef101){if(_0x5aa507[_0xc814('0x6')]&&_0x5aa507[_0xc814('0x6')]!=='id'){_0x24c0f9['associatedResources']=_[_0xc814('0xc')](_0x5ef101,function(_0x9eef2a){return _0x9eef2a[_0x5aa507['field']];});}else{if(_0x41dc32===_0xc814('0x10')){_0x24c0f9[_0xc814('0x11')]=_[_0xc814('0xc')](_0x5ef101,function(_0x223976){return{'id':_0x223976[_0xc814('0x12')],'type':_0x223976['type']};});}else{_0x24c0f9[_0xc814('0x11')]=_['map'](_0x5ef101,function(_0x4db27f){return _0x4db27f[_0xc814('0x12')];});}}_0x3a5c69(_0x24c0f9);})[_0xc814('0x7')](function(_0x45bb94){_0x49cb48(_0x45bb94);});});}function _0x7f320d(_0x396ed8,_0x312d52){var _0x38c723={'parentSections':[]};switch(_0x396ed8['toLowerCase']()){case _0xc814('0x13'):_0x38c723[_0xc814('0x14')]=_0xc814('0x15');break;case _0xc814('0x16'):_0x38c723[_0xc814('0x14')]=_0xc814('0x17');break;case _0xc814('0x18'):_0x38c723[_0xc814('0x14')]='SquareRecording';_0x38c723[_0xc814('0x19')]=[{'name':_0xc814('0x1a'),'field':_0xc814('0xd'),'foreignKey':_0xc814('0x1b')}];break;case _0xc814('0x1c'):_0x38c723[_0xc814('0x14')]=_0xc814('0x1d');break;case _0xc814('0x1e'):_0x38c723['childModel']=_0xc814('0x1f');_0x38c723[_0xc814('0x19')]=[{'name':_0xc814('0x20'),'field':'id','foreignKey':_0xc814('0x21')}];break;case _0xc814('0x22'):_0x38c723[_0xc814('0x14')]=_0xc814('0x23');break;case'companies':_0x38c723[_0xc814('0x14')]=_0xc814('0x24');break;case _0xc814('0x25'):_0x38c723[_0xc814('0x14')]='CmCustomField';break;case _0xc814('0x26'):_0x38c723[_0xc814('0x14')]=_0xc814('0x27');break;case _0xc814('0x28'):_0x38c723[_0xc814('0x14')]=_0xc814('0x29');break;case'faxqueues':_0x38c723[_0xc814('0x14')]=_0xc814('0x2a');break;case _0xc814('0x2b'):_0x38c723['childModel']='FaxAccount';break;case'inboundroutes':case _0xc814('0x2c'):case _0xc814('0x2d'):_0x38c723[_0xc814('0x14')]='VoiceExtension';break;case'contexts':_0x38c723[_0xc814('0x14')]=_0xc814('0x2e');break;case _0xc814('0x2f'):_0x38c723[_0xc814('0x14')]='VoiceMail';break;case _0xc814('0x30'):_0x38c723[_0xc814('0x14')]=_0xc814('0x31');_0x38c723[_0xc814('0x19')]=[{'name':_0xc814('0x32'),'field':_0xc814('0xd'),'foreignKey':_0xc814('0x33'),'model':'User','filter':{'field':_0xc814('0x34'),'value':['agent']}},{'name':_0xc814('0x35'),'field':_0xc814('0xd'),'foreignKey':_0xc814('0x33'),'model':'User','filter':{'field':_0xc814('0x34'),'value':[_0xc814('0x36')]}},{'name':_0xc814('0x37'),'field':_0xc814('0xd'),'foreignKey':'queue','model':_0xc814('0x38'),'filter':{'field':_0xc814('0x39'),'value':['inbound']}},{'name':_0xc814('0x3a'),'field':_0xc814('0xd'),'foreignKey':_0xc814('0x3b'),'model':_0xc814('0x38'),'filter':{'field':_0xc814('0x39'),'value':['outbound']}}];break;case _0xc814('0x3c'):_0x38c723[_0xc814('0x14')]='VoiceMusicOnHold';break;case _0xc814('0x3d'):_0x38c723[_0xc814('0x14')]=_0xc814('0x3e');break;case _0xc814('0x3f'):_0x38c723[_0xc814('0x14')]=_0xc814('0x40');break;case'ivrcampaigns':_0x38c723['childModel']=_0xc814('0x41');break;case _0xc814('0x42'):_0x38c723[_0xc814('0x14')]=_0xc814('0x43');break;case'mailaccounts':_0x38c723[_0xc814('0x14')]=_0xc814('0x44');break;case'mailsubstatuses':_0x38c723['childModel']=_0xc814('0x45');break;case _0xc814('0x46'):_0x38c723['childModel']=_0xc814('0x47');break;case'openchannelaccounts':_0x38c723[_0xc814('0x14')]=_0xc814('0x48');break;case _0xc814('0x49'):_0x38c723[_0xc814('0x14')]=_0xc814('0x4a');break;case _0xc814('0x4b'):_0x38c723[_0xc814('0x14')]=_0xc814('0x4c');break;case'whatsappqueues':_0x38c723['childModel']=_0xc814('0x4d');break;case _0xc814('0x4e'):_0x38c723[_0xc814('0x14')]=_0xc814('0x4f');break;case'teams':_0x38c723[_0xc814('0x14')]='Team';break;case'voicequeues':case _0xc814('0x50'):_0x38c723[_0xc814('0x14')]=_0xc814('0x38');if(_0x312d52){_0x38c723['parentSections']=[{'name':_0xc814('0x37')},{'name':_0xc814('0x3a')}];}break;case _0xc814('0x51'):case _0xc814('0x52'):case _0xc814('0x53'):_0x38c723[_0xc814('0x14')]='User';if(_0x312d52){_0x38c723[_0xc814('0x19')]=[{'name':_0xc814('0x54'),'filter':{'field':_0xc814('0x34'),'value':['admin','user']},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0xc814('0x55'):_0x38c723['childModel']=_0xc814('0x56');break;case _0xc814('0x57'):_0x38c723[_0xc814('0x14')]=_0xc814('0x58');break;case _0xc814('0x59'):_0x38c723[_0xc814('0x14')]='FreshdeskAccount';break;case _0xc814('0x5a'):_0x38c723['childModel']=_0xc814('0x5b');break;case _0xc814('0x5c'):_0x38c723['childModel']=_0xc814('0x5d');break;case _0xc814('0x5e'):_0x38c723[_0xc814('0x14')]='ZohoAccount';break;case _0xc814('0x5f'):_0x38c723['childModel']=_0xc814('0x60');break;case _0xc814('0x61'):_0x38c723[_0xc814('0x14')]=_0xc814('0x62');break;case _0xc814('0x63'):_0x38c723[_0xc814('0x14')]=_0xc814('0x64');break;case _0xc814('0x65'):_0x38c723[_0xc814('0x14')]=_0xc814('0x66');break;case _0xc814('0x67'):_0x38c723[_0xc814('0x14')]=_0xc814('0x68');break;case _0xc814('0x69'):_0x38c723['childModel']=_0xc814('0x6a');break;case _0xc814('0x6b'):_0x38c723[_0xc814('0x14')]=_0xc814('0x6c');break;case _0xc814('0x6d'):_0x38c723[_0xc814('0x14')]=_0xc814('0x6e');break;case'tags':_0x38c723[_0xc814('0x14')]='Tag';break;case _0xc814('0x6f'):_0x38c723[_0xc814('0x14')]='Template';break;case _0xc814('0x70'):_0x38c723[_0xc814('0x14')]=_0xc814('0x71');break;case _0xc814('0x72'):_0x38c723[_0xc814('0x14')]='Trunk';break;case'variables':_0x38c723[_0xc814('0x14')]='Variable';break;case _0xc814('0x73'):_0x38c723[_0xc814('0x14')]=_0xc814('0x74');break;case _0xc814('0x75'):_0x38c723[_0xc814('0x14')]='AnalyticExtractedReport';_0x38c723[_0xc814('0x19')]=[{'name':'Reports','field':'id','foreignKey':_0xc814('0x76')}];break;case _0xc814('0x77'):_0x38c723[_0xc814('0x14')]=_0xc814('0x78');break;}return _0x38c723;}function _0x36001d(_0x2be71f,_0x2a7c3a){var _0x2425fd=_0x2be71f[_0xc814('0x79')](0x0)[_0xc814('0x7a')]()+_0x2be71f[_0xc814('0x7b')](0x1);var _0x80fb72={'type':_0x1ed0d9[_0xc814('0x7c')][_0xc814('0x7d')][_0xc814('0x7e')],'raw':!![]};return new Promise(function(_0x62bf1a,_0x5a09c5){var _0x352b13=squel[_0xc814('0x7f')]()[_0xc814('0x6')](_0xc814('0x80')+_0x2425fd+_0xc814('0x81'),'id')[_0xc814('0x6')](_0xc814('0x82'))['from'](_0xc814('0x83')+_0x2be71f+'_interactions','ui')[_0xc814('0x84')](_0xc814('0x85'),_0x2a7c3a['id']);return _0x1ed0d9['sequelize'][_0xc814('0x86')](_0x352b13[_0xc814('0x87')](),_0x80fb72)[_0xc814('0xb')](function(_0x532d2f){_0x2a7c3a[_0x2425fd+_0xc814('0x88')]=_0x532d2f;_0x62bf1a(_0x532d2f);})['catch'](function(_0x4c4556){_0x5a09c5(_0x4c4556);});});}return _0x36928d[_0xc814('0x89')](_0xc814('0x8a'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1a7554){var _0x2970ed={'raw':_0x1a7554[_0xc814('0x86')]['raw'],'where':{}};var _0x4b8ca9={};var _0x5b65fb={'count':0x0,'rows':[]};var _0x35d196=_0x1a7554[_0xc814('0x86')][_0xc814('0x8b')];var _0x515a03=_0x1a7554[_0xc814('0x86')][_0xc814('0x8c')]||![];var _0x10e33a=_0x7f320d(_0x35d196,_0x515a03);if(!_0x10e33a[_0xc814('0x14')])throw new Error(_0xc814('0x8d')+_0x35d196+'\x27');var _0x456e22=[{'name':_0x35d196}];if(!_[_0xc814('0x8e')](_0x10e33a[_0xc814('0x19')]))_0x456e22=_0x10e33a[_0xc814('0x19')];var _0x36ea45=[];for(var _0xc8d8b8=0x0;_0xc8d8b8<_0x456e22['length'];_0xc8d8b8++){_0x36ea45[_0xc814('0x8f')](_0x1ed0d9[_0xc814('0x90')][_0xc814('0x91')]({'where':{'userProfileId':_0x1a7554[_0xc814('0x92')]['id'],'name':_0x456e22[_0xc8d8b8][_0xc814('0xd')]},'raw':!![]}));}return Promise[_0xc814('0x93')](_0x36ea45)['then'](function(_0x5d4c3d){var _0x258bd6=_[_0xc814('0x5')](_0x5d4c3d,function(_0x5ba818){return _0x5ba818?_0x5ba818:undefined;});var _0x1d1048=_[_0xc814('0x5')](_0x456e22,['ignore',!![]]);var _0x694636=_[_0xc814('0x8e')](_0x258bd6)&&_[_0xc814('0x8e')](_0x1d1048)?null:_[_0xc814('0x94')](_0x1d1048,_0x258bd6);if(!_0x694636)return null;var _0x44d0ed=[];for(var _0x2a864e=0x0;_0x2a864e<_0x694636[_0xc814('0x95')];_0x2a864e++){var _0x5db343=_[_0xc814('0x91')](_0x456e22,function(_0x330b90){return _0x694636[_0x2a864e]?_0x330b90['name']===_0x694636[_0x2a864e][_0xc814('0xd')]:null;});if(_0x5db343){if(_0x694636[_0x2a864e][_0xc814('0x96')]){_0x44d0ed[_0xc814('0x8f')](_0x5e9d9e(_0x10e33a[_0xc814('0x14')],_0x694636[_0x2a864e]));}else{if(!_0x694636[_0x2a864e][_0xc814('0x97')]){_0x44d0ed[_0xc814('0x8f')](_0x27c0dd(_0x5db343,_0x694636[_0x2a864e],_0x10e33a[_0xc814('0x14')]));}else{if(_0x5db343[_0xc814('0x9')]){_0x44d0ed[_0xc814('0x8f')](_0x12f196(_0x5db343,_0x694636[_0x2a864e]));}}}}}return Promise[_0xc814('0x93')](_0x44d0ed);})['then'](function(_0x16cd55){var _0xe0691e=_0x16cd55;var _0x2f65e4=null;if(_0xe0691e){_0x2f65e4=_0xe0691e[_0xc814('0x95')]===0x1?_0xe0691e[0x0]:null;}if(!_0x2f65e4&&!_0xe0691e)return _0x5b65fb;var _0x38df0e=_0x1ed0d9[_0x10e33a[_0xc814('0x14')]][_0xc814('0x98')];_0x4b8ca9[_0xc814('0x9')]=_[_0xc814('0x99')](_0x38df0e);_0x4b8ca9[_0xc814('0x86')]=_['keys'](_0x1a7554[_0xc814('0x86')]);_0x4b8ca9[_0xc814('0x9a')]=_[_0xc814('0x9b')](_0x4b8ca9['model'],_0x4b8ca9[_0xc814('0x86')]);_0x2970ed[_0xc814('0x9c')]=_[_0xc814('0x9b')](_0x4b8ca9[_0xc814('0x9')],qs[_0xc814('0x9d')](_0x1a7554[_0xc814('0x86')][_0xc814('0x9d')]));_0x2970ed['attributes']=_0x2970ed['attributes'][_0xc814('0x95')]?_0x2970ed[_0xc814('0x9c')]:_0x4b8ca9[_0xc814('0x9')];if(!_0x1a7554[_0xc814('0x86')][_0xc814('0x9e')](_0xc814('0x9f'))){_0x2970ed['limit']=qs[_0xc814('0xa0')](_0x1a7554[_0xc814('0x86')][_0xc814('0xa0')]);_0x2970ed[_0xc814('0xa1')]=qs[_0xc814('0xa1')](_0x1a7554['query'][_0xc814('0xa1')]);}_0x2970ed[_0xc814('0xa2')]=qs[_0xc814('0xa3')](_0x1a7554[_0xc814('0x86')][_0xc814('0xa3')]);_0x2970ed['where']=qs[_0xc814('0x9a')](_[_0xc814('0xa4')](_0x1a7554[_0xc814('0x86')],_0x4b8ca9[_0xc814('0x9a')]));if(_0x1a7554[_0xc814('0x86')][_0xc814('0x5')]){_0x2970ed['where']=_[_0xc814('0xa5')](_0x2970ed[_0xc814('0x84')],{'$or':_[_0xc814('0xc')](_0x38df0e,function(_0x468190){if(_0x468190[_0xc814('0x39')][_0xc814('0xa6')]!==_0xc814('0xa7')){var _0x4d7dd2={};_0x4d7dd2[_0x468190[_0xc814('0x6')]]={'$like':'%'+_0x1a7554[_0xc814('0x86')][_0xc814('0x5')]+'%'};return _0x4d7dd2;}})});}var _0x589fbc=[];var _0x149ae9=null;var _0x5939ec={};if(_0x2f65e4){_0x149ae9=_['find'](_0x456e22,[_0xc814('0xd'),_0x2f65e4[_0xc814('0xd')]]);if(_0x149ae9[_0xc814('0x6')]){_0x5939ec={};if(_0x10e33a[_0xc814('0x14')]==='AnalyticExtractedReport'){_0x5939ec[_0x149ae9[_0xc814('0xa8')]]=_[_0xc814('0xc')](_0x2f65e4[_0xc814('0x11')],'id');}else{_0x5939ec[_0x149ae9[_0xc814('0xa8')]]=_0x2f65e4['associatedResources'];}_0x589fbc['push'](_0x5939ec);}else{_0x2970ed['where']['id']=_0x2f65e4[_0xc814('0x11')];}}else{for(var _0xefbe4c=0x0;_0xefbe4c<_0xe0691e[_0xc814('0x95')];_0xefbe4c++){_0x149ae9=_[_0xc814('0x91')](_0x456e22,[_0xc814('0xd'),_0xe0691e[_0xefbe4c][_0xc814('0xd')]]);if(_0x149ae9[_0xc814('0x6')]){_0x5939ec={};_0x5939ec[_0x149ae9[_0xc814('0xa8')]]=_0xe0691e[_0xefbe4c][_0xc814('0x11')];_0x589fbc[_0xc814('0x8f')](_0x5939ec);}else{if(!_0x2970ed[_0xc814('0x84')]['id'])_0x2970ed['where']['id']=[];_0xe0691e[_0xefbe4c][_0xc814('0x11')][_0xc814('0xa9')](function(_0x1df2af){_0x2970ed['where']['id'][_0xc814('0x8f')](_0x1df2af);});}}}if(!_[_0xc814('0x8e')](_0x589fbc)){_0x2970ed['where']=_['merge'](_0x2970ed[_0xc814('0x84')],{'$and':{'$or':_0x589fbc}});}_0x2970ed=_['merge']({},_0x2970ed,_0x1a7554[_0xc814('0xaa')]);if(_0x2f65e4&&!_0x2f65e4[_0xc814('0x97')]&&_0x10e33a[_0xc814('0x14')]==='AnalyticExtractedReport'){if(_0x1a7554[_0xc814('0x86')][_0xc814('0xab')]){_0x2970ed['include']=[{'all':!![]}];}return _0x1ed0d9[_0x10e33a[_0xc814('0x14')]]['findAll'](_0x2970ed)[_0xc814('0xb')](function(_0x3ff75d){var _0x58ef91=[];_0x3ff75d[_0xc814('0xa9')](function(_0x50883a){var _0x457c4a;switch(_0x50883a[_0xc814('0xac')]){case _0xc814('0xad'):_0x457c4a=_[_0xc814('0x91')](_0x2f65e4[_0xc814('0x11')],function(_0x5b5c75){return _0x5b5c75['id']===_0x50883a['reportId']&&_0x5b5c75['type']===_0xc814('0xae');});break;case _0xc814('0xaf'):_0x457c4a=_['find'](_0x2f65e4[_0xc814('0x11')],function(_0x424525){return _0x424525['id']===_0x50883a[_0xc814('0x76')]&&_0x424525[_0xc814('0x39')]==='CustomReports';});break;}if(_0x457c4a)_0x58ef91['push'](_0x50883a);});_0x5b65fb[_0xc814('0xb0')]=_0x58ef91[_0xc814('0x95')];_0x5b65fb[_0xc814('0xb1')]=_0x58ef91;return _0x5b65fb;});}else{if(!_[_0xc814('0x8e')](_0x1a7554[_0xc814('0x86')][_0xc814('0xb2')])){_0x2970ed[_0xc814('0x84')]['id']=_0x2970ed['where']['id']?_[_0xc814('0x9b')](_0x2970ed['where']['id'],_0x1a7554['query']['ids']):_0x1a7554['query'][_0xc814('0xb2')];if(_0x1a7554[_0xc814('0x86')][_0xc814('0xb3')]){_0x2970ed[_0xc814('0xa2')]=_0x1a7554['query'][_0xc814('0xb3')];}}if(_0x1a7554[_0xc814('0x86')]['extraQueryConditions']){_0x2970ed[_0xc814('0x84')]=_[_0xc814('0xa5')](_0x2970ed['where'],{'$and':_0x1a7554[_0xc814('0x86')][_0xc814('0xb4')]});}return _0x1ed0d9[_0x10e33a[_0xc814('0x14')]][_0xc814('0xb0')]({'where':_0x2970ed[_0xc814('0x84')]})['then'](function(_0x33fc3b){_0x5b65fb[_0xc814('0xb0')]=_0x33fc3b;if(_0x1a7554[_0xc814('0x86')][_0xc814('0xab')]){if(_0x10e33a['childModel']==='CmContact'){_0x2970ed[_0xc814('0xb5')]=[{'model':_0x1ed0d9[_0xc814('0xb6')],'as':_0xc814('0xb7'),'attributes':['id',_0xc814('0xd'),'color'],'required':_0x1a7554['query'][_0xc814('0xb8')]?!![]:![]},{'model':_0x1ed0d9[_0xc814('0xb6')],'as':_0xc814('0xb9'),'attributes':['id','name','color'],'through':_0x1a7554[_0xc814('0x86')]['tag']?{'attributes':[],'where':{'TagId':_0x1a7554[_0xc814('0x86')][_0xc814('0xb8')]||undefined}}:{},'required':_0x1a7554[_0xc814('0x86')]['tag']?!![]:![]}];}else{_0x2970ed[_0xc814('0xb5')]=[{'all':!![]}];}}return _0x1ed0d9[_0x10e33a[_0xc814('0x14')]]['findAll'](_0x2970ed);})[_0xc814('0xb')](function(_0x2bdacf){_0x5b65fb[_0xc814('0xb1')]=_0x2bdacf;if(_0x35d196===_0xc814('0x32')&&_0x1a7554[_0xc814('0x86')][_0xc814('0xba')]===_0xc814('0xbb')){var _0x1fe2ac=[];for(var _0x348e5b=0x0;_0x348e5b<_0x5b65fb['rows'][_0xc814('0x95')];_0x348e5b++){_0x1fe2ac[_0xc814('0x8f')](_0x36001d(_0xc814('0xbc'),_0x5b65fb[_0xc814('0xb1')][_0x348e5b][_0xc814('0xbd')]));_0x1fe2ac['push'](_0x36001d(_0xc814('0xbe'),_0x5b65fb[_0xc814('0xb1')][_0x348e5b][_0xc814('0xbd')]));_0x1fe2ac[_0xc814('0x8f')](_0x36001d(_0xc814('0xbf'),_0x5b65fb[_0xc814('0xb1')][_0x348e5b][_0xc814('0xbd')]));_0x1fe2ac['push'](_0x36001d(_0xc814('0xc0'),_0x5b65fb['rows'][_0x348e5b]['dataValues']));_0x1fe2ac[_0xc814('0x8f')](_0x36001d(_0xc814('0xc1'),_0x5b65fb[_0xc814('0xb1')][_0x348e5b][_0xc814('0xbd')]));_0x1fe2ac[_0xc814('0x8f')](_0x36001d(_0xc814('0xc2'),_0x5b65fb['rows'][_0x348e5b][_0xc814('0xbd')]));}return Promise[_0xc814('0x93')](_0x1fe2ac)[_0xc814('0xb')](function(){return _0x5b65fb;});}return _0x5b65fb;});}});}}});}; \ No newline at end of file +var _0xfddf=['chat','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','exports','models','field','findAll','then','associatedResources','map','filter','model','name','UserProfileResource','AnalyticExtractedReport','resourceId','type','catch','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','Campaign','mailqueues','MailQueue','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','define','UserProfile','raw','section','mergeResources','Invalid\x20section\x20\x27','push','find','params','all','isEmpty','union','length','ignore','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','pick','key','VIRTUAL','foreignKey','forEach','merge','options','autoAssociation','includeAll','include','reportType','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','CmContact','Tags','color','tag','ThroughTags','openTabs','true'];(function(_0x38a52b,_0x2b718c){var _0x5c9d06=function(_0x5a2fad){while(--_0x5a2fad){_0x38a52b['push'](_0x38a52b['shift']());}};_0x5c9d06(++_0x2b718c);}(_0xfddf,0xc5));var _0xffdd=function(_0xccd60b,_0x5523be){_0xccd60b=_0xccd60b-0x0;var _0x2f352c=_0xfddf[_0xccd60b];return _0x2f352c;};'use strict';var _=require('lodash');var attributes=require(_0xffdd('0x0'));var qs=require(_0xffdd('0x1'));var squel=require('squel');module[_0xffdd('0x2')]=function(_0x2d3c96){var _0x488908=_0x2d3c96[_0xffdd('0x3')];function _0x36817a(_0x17b4b9,_0x5de4b3){return new Promise(function(_0x121601,_0x9a1447){if(!_0x5de4b3)return _0x121601(null);var _0x1c8dc8=_0x5de4b3['filter']?{[_0x5de4b3['filter'][_0xffdd('0x4')]]:_0x5de4b3['filter']['value']}:undefined;return _0x488908[_0x17b4b9][_0xffdd('0x5')]({'where':_0x1c8dc8,'raw':!![]})[_0xffdd('0x6')](function(_0x469722){_0x5de4b3[_0xffdd('0x7')]=_[_0xffdd('0x8')](_0x469722,'id');_0x121601(_0x5de4b3);})['catch'](function(_0x18b0c7){_0x9a1447(_0x18b0c7);});});}function _0x577861(_0x771674,_0xb3f1aa){return new Promise(function(_0x20f5ab,_0x22d235){var _0x49cc82=_0x771674[_0xffdd('0x9')]?{[_0x771674[_0xffdd('0x9')][_0xffdd('0x4')]]:_0x771674[_0xffdd('0x9')]['value']}:undefined;return _0x488908[_0x771674[_0xffdd('0xa')]][_0xffdd('0x5')]({'where':_0x49cc82,'raw':!![]})['then'](function(_0x37b691){_0xb3f1aa['associatedResources']=_[_0xffdd('0x8')](_0x37b691,function(_0xeb3e94){return _0xeb3e94[_0xffdd('0xb')];});_0x20f5ab(_0xb3f1aa);})['catch'](function(_0x23716e){_0x22d235(_0x23716e);});});}function _0xe0bfc3(_0x201403,_0x24830a,_0x7257a2){if(!_0x24830a)return Promise['resolve'](null);return new Promise(function(_0x1760d9,_0x1c0f53){return _0x488908[_0xffdd('0xc')][_0xffdd('0x5')]({'where':{'sectionId':_0x24830a['id']},'raw':!![]})[_0xffdd('0x6')](function(_0x42f3f0){if(_0x201403[_0xffdd('0x4')]&&_0x201403[_0xffdd('0x4')]!=='id'){_0x24830a[_0xffdd('0x7')]=_['map'](_0x42f3f0,function(_0x4e2b76){return _0x4e2b76[_0x201403['field']];});}else{if(_0x7257a2===_0xffdd('0xd')){_0x24830a['associatedResources']=_[_0xffdd('0x8')](_0x42f3f0,function(_0x253d74){return{'id':_0x253d74[_0xffdd('0xe')],'type':_0x253d74[_0xffdd('0xf')]};});}else{_0x24830a[_0xffdd('0x7')]=_['map'](_0x42f3f0,function(_0xad6374){return _0xad6374['resourceId'];});}}_0x1760d9(_0x24830a);})[_0xffdd('0x10')](function(_0x829dc){_0x1c0f53(_0x829dc);});});}function _0x176881(_0x1a6f7c,_0x2e69c9){var _0x3fcc2a={'parentSections':[]};switch(_0x1a6f7c[_0xffdd('0x11')]()){case'squareprojects':_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x13');break;case _0xffdd('0x14'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x15');break;case _0xffdd('0x16'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x17');_0x3fcc2a[_0xffdd('0x18')]=[{'name':_0xffdd('0x19'),'field':_0xffdd('0xb'),'foreignKey':_0xffdd('0x1a')}];break;case _0xffdd('0x1b'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x1c');break;case _0xffdd('0x1d'):_0x3fcc2a[_0xffdd('0x12')]='CmContact';_0x3fcc2a[_0xffdd('0x18')]=[{'name':_0xffdd('0x1e'),'field':'id','foreignKey':_0xffdd('0x1f')}];break;case'lists':_0x3fcc2a[_0xffdd('0x12')]='CmList';break;case'companies':_0x3fcc2a['childModel']=_0xffdd('0x20');break;case _0xffdd('0x21'):_0x3fcc2a['childModel']=_0xffdd('0x22');break;case _0xffdd('0x23'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x24');break;case _0xffdd('0x25'):_0x3fcc2a[_0xffdd('0x12')]='ChatWebsite';break;case _0xffdd('0x26'):_0x3fcc2a[_0xffdd('0x12')]='FaxQueue';break;case _0xffdd('0x27'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x28');break;case _0xffdd('0x29'):case _0xffdd('0x2a'):case _0xffdd('0x2b'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x2c');break;case _0xffdd('0x2d'):_0x3fcc2a[_0xffdd('0x12')]='VoiceContext';break;case _0xffdd('0x2e'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x2f');break;case _0xffdd('0x30'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x31');_0x3fcc2a['parentSections']=[{'name':_0xffdd('0x32'),'field':'name','foreignKey':_0xffdd('0x33'),'model':'User','filter':{'field':_0xffdd('0x34'),'value':[_0xffdd('0x35')]}},{'name':_0xffdd('0x36'),'field':_0xffdd('0xb'),'foreignKey':'membername','model':_0xffdd('0x37'),'filter':{'field':_0xffdd('0x34'),'value':[_0xffdd('0x38')]}},{'name':_0xffdd('0x39'),'field':_0xffdd('0xb'),'foreignKey':_0xffdd('0x3a'),'model':_0xffdd('0x3b'),'filter':{'field':_0xffdd('0xf'),'value':[_0xffdd('0x3c')]}},{'name':_0xffdd('0x3d'),'field':_0xffdd('0xb'),'foreignKey':'queue','model':_0xffdd('0x3b'),'filter':{'field':_0xffdd('0xf'),'value':['outbound']}}];break;case _0xffdd('0x3e'):_0x3fcc2a['childModel']=_0xffdd('0x3f');break;case _0xffdd('0x40'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x41');break;case'voiceprefixes':_0x3fcc2a[_0xffdd('0x12')]='VoicePrefix';break;case'ivrcampaigns':_0x3fcc2a['childModel']=_0xffdd('0x42');break;case _0xffdd('0x43'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x44');break;case'mailaccounts':_0x3fcc2a[_0xffdd('0x12')]='MailAccount';break;case _0xffdd('0x45'):_0x3fcc2a[_0xffdd('0x12')]='MailSubstatus';break;case _0xffdd('0x46'):_0x3fcc2a[_0xffdd('0x12')]='OpenchannelQueue';break;case _0xffdd('0x47'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x48');break;case _0xffdd('0x49'):_0x3fcc2a['childModel']='SmsQueue';break;case _0xffdd('0x4a'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x4b');break;case _0xffdd('0x4c'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x4d');break;case _0xffdd('0x4e'):_0x3fcc2a['childModel']=_0xffdd('0x4f');break;case _0xffdd('0x50'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x51');break;case _0xffdd('0x52'):case'queuecampaigns':_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x3b');if(_0x2e69c9){_0x3fcc2a[_0xffdd('0x18')]=[{'name':'VoiceQueues'},{'name':_0xffdd('0x3d')}];}break;case _0xffdd('0x53'):case _0xffdd('0x54'):case _0xffdd('0x55'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x37');if(_0x2e69c9){_0x3fcc2a[_0xffdd('0x18')]=[{'name':'Users','filter':{'field':_0xffdd('0x34'),'value':[_0xffdd('0x56'),_0xffdd('0x57')]},'ignore':!![]},{'name':_0xffdd('0x32')},{'name':_0xffdd('0x36')}];}break;case _0xffdd('0x58'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x59');break;case _0xffdd('0x5a'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x5b');break;case'freshdeskaccounts':_0x3fcc2a[_0xffdd('0x12')]='FreshdeskAccount';break;case _0xffdd('0x5c'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x5d');break;case _0xffdd('0x5e'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x5f');break;case _0xffdd('0x60'):_0x3fcc2a[_0xffdd('0x12')]='ZohoAccount';break;case _0xffdd('0x61'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x37');break;case _0xffdd('0x62'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x63');break;case _0xffdd('0x64'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x65');break;case'customdashboards':_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x66');break;case'intervals':_0x3fcc2a[_0xffdd('0x12')]='Interval';break;case _0xffdd('0x67'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x68');break;case _0xffdd('0x69'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x6a');break;case _0xffdd('0x6b'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x6c');break;case _0xffdd('0x6d'):_0x3fcc2a['childModel']=_0xffdd('0x6e');break;case _0xffdd('0x6f'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x70');break;case _0xffdd('0x71'):_0x3fcc2a['childModel']='Trigger';break;case'trunks':_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x72');break;case _0xffdd('0x73'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x74');break;case _0xffdd('0x75'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0x76');break;case _0xffdd('0x77'):_0x3fcc2a[_0xffdd('0x12')]=_0xffdd('0xd');_0x3fcc2a['parentSections']=[{'name':_0xffdd('0x78'),'field':'id','foreignKey':_0xffdd('0x79')}];break;case _0xffdd('0x7a'):_0x3fcc2a[_0xffdd('0x12')]='AnalyticMetric';break;}return _0x3fcc2a;}function _0x353e55(_0x1f5024,_0x3928bc){var _0x29c7da=_0x1f5024['charAt'](0x0)['toUpperCase']()+_0x1f5024['slice'](0x1);var _0x55da68={'type':_0x488908[_0xffdd('0x7b')][_0xffdd('0x7c')][_0xffdd('0x7d')],'raw':!![]};return new Promise(function(_0x52a5fa,_0x2bf40b){var _0x8193bc=squel[_0xffdd('0x7e')]()[_0xffdd('0x4')](_0xffdd('0x7f')+_0x29c7da+_0xffdd('0x80'),'id')['field'](_0xffdd('0x81'))['from'](_0xffdd('0x82')+_0x1f5024+'_interactions','ui')[_0xffdd('0x83')](_0xffdd('0x84'),_0x3928bc['id']);return _0x488908[_0xffdd('0x85')][_0xffdd('0x86')](_0x8193bc['toString'](),_0x55da68)[_0xffdd('0x6')](function(_0x5715e9){_0x3928bc[_0x29c7da+'OpenTabs']=_0x5715e9;_0x52a5fa(_0x5715e9);})[_0xffdd('0x10')](function(_0x5b607d){_0x2bf40b(_0x5b607d);});});}return _0x2d3c96[_0xffdd('0x87')](_0xffdd('0x88'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x542e6e){var _0x18d412={'raw':_0x542e6e[_0xffdd('0x86')][_0xffdd('0x89')],'where':{}};var _0x2995dc={};var _0x528014={'count':0x0,'rows':[]};var _0x3cc8f2=_0x542e6e[_0xffdd('0x86')][_0xffdd('0x8a')];var _0x1cc93b=_0x542e6e[_0xffdd('0x86')][_0xffdd('0x8b')]||![];var _0x175282=_0x176881(_0x3cc8f2,_0x1cc93b);if(!_0x175282[_0xffdd('0x12')])throw new Error(_0xffdd('0x8c')+_0x3cc8f2+'\x27');var _0xe542e7=[{'name':_0x3cc8f2}];if(!_['isEmpty'](_0x175282[_0xffdd('0x18')]))_0xe542e7=_0x175282['parentSections'];var _0x3c9994=[];for(var _0x11f5c6=0x0;_0x11f5c6<_0xe542e7['length'];_0x11f5c6++){_0x3c9994[_0xffdd('0x8d')](_0x488908['UserProfileSection'][_0xffdd('0x8e')]({'where':{'userProfileId':_0x542e6e[_0xffdd('0x8f')]['id'],'name':_0xe542e7[_0x11f5c6]['name']},'raw':!![]}));}return Promise[_0xffdd('0x90')](_0x3c9994)[_0xffdd('0x6')](function(_0x49a1f7){var _0x1d9990=_[_0xffdd('0x9')](_0x49a1f7,function(_0x40483){return _0x40483?_0x40483:undefined;});var _0x41b0a6=_[_0xffdd('0x9')](_0xe542e7,['ignore',!![]]);var _0x1f97c4=_[_0xffdd('0x91')](_0x1d9990)&&_[_0xffdd('0x91')](_0x41b0a6)?null:_[_0xffdd('0x92')](_0x41b0a6,_0x1d9990);if(!_0x1f97c4)return null;var _0x317383=[];for(var _0x17cda0=0x0;_0x17cda0<_0x1f97c4[_0xffdd('0x93')];_0x17cda0++){var _0x85e896=_[_0xffdd('0x8e')](_0xe542e7,function(_0x3a3695){return _0x1f97c4[_0x17cda0]?_0x3a3695['name']===_0x1f97c4[_0x17cda0][_0xffdd('0xb')]:null;});if(_0x85e896){if(_0x1f97c4[_0x17cda0][_0xffdd('0x94')]){_0x317383['push'](_0x36817a(_0x175282[_0xffdd('0x12')],_0x1f97c4[_0x17cda0]));}else{if(!_0x1f97c4[_0x17cda0]['autoAssociation']){_0x317383[_0xffdd('0x8d')](_0xe0bfc3(_0x85e896,_0x1f97c4[_0x17cda0],_0x175282[_0xffdd('0x12')]));}else{if(_0x85e896[_0xffdd('0xa')]){_0x317383['push'](_0x577861(_0x85e896,_0x1f97c4[_0x17cda0]));}}}}}return Promise[_0xffdd('0x90')](_0x317383);})[_0xffdd('0x6')](function(_0x2281f3){var _0x2f1687=_0x2281f3;var _0x59c14e=null;if(_0x2f1687){_0x59c14e=_0x2f1687[_0xffdd('0x93')]===0x1?_0x2f1687[0x0]:null;}if(!_0x59c14e&&!_0x2f1687)return _0x528014;var _0x220b5e=_0x488908[_0x175282[_0xffdd('0x12')]][_0xffdd('0x95')];_0x2995dc[_0xffdd('0xa')]=_['keys'](_0x220b5e);_0x2995dc[_0xffdd('0x86')]=_[_0xffdd('0x96')](_0x542e6e[_0xffdd('0x86')]);_0x2995dc[_0xffdd('0x97')]=_[_0xffdd('0x98')](_0x2995dc['model'],_0x2995dc[_0xffdd('0x86')]);_0x18d412['attributes']=_['intersection'](_0x2995dc[_0xffdd('0xa')],qs[_0xffdd('0x99')](_0x542e6e[_0xffdd('0x86')][_0xffdd('0x99')]));_0x18d412[_0xffdd('0x9a')]=_0x18d412[_0xffdd('0x9a')][_0xffdd('0x93')]?_0x18d412[_0xffdd('0x9a')]:_0x2995dc[_0xffdd('0xa')];if(!_0x542e6e[_0xffdd('0x86')][_0xffdd('0x9b')]('nolimit')){_0x18d412[_0xffdd('0x9c')]=qs[_0xffdd('0x9c')](_0x542e6e[_0xffdd('0x86')]['limit']);_0x18d412['offset']=qs[_0xffdd('0x9d')](_0x542e6e['query'][_0xffdd('0x9d')]);}_0x18d412[_0xffdd('0x9e')]=qs['sort'](_0x542e6e[_0xffdd('0x86')][_0xffdd('0x9f')]);_0x18d412[_0xffdd('0x83')]=qs['filters'](_[_0xffdd('0xa0')](_0x542e6e['query'],_0x2995dc[_0xffdd('0x97')]));if(_0x542e6e['query'][_0xffdd('0x9')]){_0x18d412[_0xffdd('0x83')]=_['merge'](_0x18d412['where'],{'$or':_['map'](_0x220b5e,function(_0x1b2f5d){if(_0x1b2f5d['type'][_0xffdd('0xa1')]!==_0xffdd('0xa2')){var _0x317b62={};_0x317b62[_0x1b2f5d[_0xffdd('0x4')]]={'$like':'%'+_0x542e6e[_0xffdd('0x86')]['filter']+'%'};return _0x317b62;}})});}var _0x244fa7=[];var _0x34039e=null;var _0xda3063={};if(_0x59c14e){_0x34039e=_[_0xffdd('0x8e')](_0xe542e7,['name',_0x59c14e[_0xffdd('0xb')]]);if(_0x34039e['field']){_0xda3063={};if(_0x175282[_0xffdd('0x12')]==='AnalyticExtractedReport'){_0xda3063[_0x34039e[_0xffdd('0xa3')]]=_[_0xffdd('0x8')](_0x59c14e[_0xffdd('0x7')],'id');}else{_0xda3063[_0x34039e[_0xffdd('0xa3')]]=_0x59c14e[_0xffdd('0x7')];}_0x244fa7[_0xffdd('0x8d')](_0xda3063);}else{_0x18d412[_0xffdd('0x83')]['id']=_0x59c14e[_0xffdd('0x7')];}}else{for(var _0x3f4745=0x0;_0x3f4745<_0x2f1687['length'];_0x3f4745++){_0x34039e=_['find'](_0xe542e7,[_0xffdd('0xb'),_0x2f1687[_0x3f4745][_0xffdd('0xb')]]);if(_0x34039e[_0xffdd('0x4')]){_0xda3063={};_0xda3063[_0x34039e[_0xffdd('0xa3')]]=_0x2f1687[_0x3f4745][_0xffdd('0x7')];_0x244fa7[_0xffdd('0x8d')](_0xda3063);}else{if(!_0x18d412[_0xffdd('0x83')]['id'])_0x18d412[_0xffdd('0x83')]['id']=[];_0x2f1687[_0x3f4745][_0xffdd('0x7')][_0xffdd('0xa4')](function(_0x2ea070){_0x18d412['where']['id'][_0xffdd('0x8d')](_0x2ea070);});}}}if(!_[_0xffdd('0x91')](_0x244fa7)){_0x18d412['where']=_[_0xffdd('0xa5')](_0x18d412['where'],{'$and':{'$or':_0x244fa7}});}_0x18d412=_['merge']({},_0x18d412,_0x542e6e[_0xffdd('0xa6')]);if(_0x59c14e&&!_0x59c14e[_0xffdd('0xa7')]&&_0x175282[_0xffdd('0x12')]===_0xffdd('0xd')){if(_0x542e6e[_0xffdd('0x86')][_0xffdd('0xa8')]){_0x18d412[_0xffdd('0xa9')]=[{'all':!![]}];}return _0x488908[_0x175282['childModel']][_0xffdd('0x5')](_0x18d412)[_0xffdd('0x6')](function(_0x367562){var _0x3490cf=[];_0x367562[_0xffdd('0xa4')](function(_0x155b0b){var _0x3b7d11;switch(_0x155b0b[_0xffdd('0xaa')]){case'default':_0x3b7d11=_[_0xffdd('0x8e')](_0x59c14e['associatedResources'],function(_0x48890d){return _0x48890d['id']===_0x155b0b[_0xffdd('0x79')]&&_0x48890d['type']==='DefaultReports';});break;case _0xffdd('0xab'):_0x3b7d11=_['find'](_0x59c14e[_0xffdd('0x7')],function(_0x5079f5){return _0x5079f5['id']===_0x155b0b[_0xffdd('0x79')]&&_0x5079f5['type']===_0xffdd('0xac');});break;}if(_0x3b7d11)_0x3490cf[_0xffdd('0x8d')](_0x155b0b);});_0x528014[_0xffdd('0xad')]=_0x3490cf[_0xffdd('0x93')];_0x528014[_0xffdd('0xae')]=_0x3490cf;return _0x528014;});}else{if(!_['isEmpty'](_0x542e6e[_0xffdd('0x86')][_0xffdd('0xaf')])){_0x18d412['where']['id']=_0x18d412[_0xffdd('0x83')]['id']?_[_0xffdd('0x98')](_0x18d412[_0xffdd('0x83')]['id'],_0x542e6e[_0xffdd('0x86')][_0xffdd('0xaf')]):_0x542e6e[_0xffdd('0x86')][_0xffdd('0xaf')];if(_0x542e6e[_0xffdd('0x86')][_0xffdd('0xb0')]){_0x18d412[_0xffdd('0x9e')]=_0x542e6e[_0xffdd('0x86')]['customSorting'];}}if(_0x542e6e[_0xffdd('0x86')][_0xffdd('0xb1')]){_0x18d412[_0xffdd('0x83')]=_[_0xffdd('0xa5')](_0x18d412[_0xffdd('0x83')],{'$and':_0x542e6e['query'][_0xffdd('0xb1')]});}return _0x488908[_0x175282['childModel']][_0xffdd('0xad')]({'where':_0x18d412['where']})[_0xffdd('0x6')](function(_0x56445c){_0x528014['count']=_0x56445c;if(_0x542e6e[_0xffdd('0x86')][_0xffdd('0xa8')]){if(_0x175282[_0xffdd('0x12')]===_0xffdd('0xb2')){_0x18d412[_0xffdd('0xa9')]=[{'model':_0x488908[_0xffdd('0x6e')],'as':_0xffdd('0xb3'),'attributes':['id',_0xffdd('0xb'),_0xffdd('0xb4')],'required':_0x542e6e[_0xffdd('0x86')][_0xffdd('0xb5')]?!![]:![]},{'model':_0x488908[_0xffdd('0x6e')],'as':_0xffdd('0xb6'),'attributes':['id',_0xffdd('0xb'),'color'],'through':_0x542e6e['query'][_0xffdd('0xb5')]?{'attributes':[],'where':{'TagId':_0x542e6e[_0xffdd('0x86')][_0xffdd('0xb5')]||undefined}}:{},'required':_0x542e6e[_0xffdd('0x86')][_0xffdd('0xb5')]?!![]:![]}];}else{_0x18d412[_0xffdd('0xa9')]=[{'all':!![]}];}}return _0x488908[_0x175282[_0xffdd('0x12')]][_0xffdd('0x5')](_0x18d412);})['then'](function(_0xf63d85){_0x528014[_0xffdd('0xae')]=_0xf63d85;if(_0x3cc8f2===_0xffdd('0x32')&&_0x542e6e[_0xffdd('0x86')][_0xffdd('0xb7')]===_0xffdd('0xb8')){var _0x6a959e=[];for(var _0x13b226=0x0;_0x13b226<_0x528014[_0xffdd('0xae')][_0xffdd('0x93')];_0x13b226++){_0x6a959e[_0xffdd('0x8d')](_0x353e55(_0xffdd('0xb9'),_0x528014[_0xffdd('0xae')][_0x13b226][_0xffdd('0xba')]));_0x6a959e['push'](_0x353e55('sms',_0x528014['rows'][_0x13b226][_0xffdd('0xba')]));_0x6a959e['push'](_0x353e55(_0xffdd('0xbb'),_0x528014[_0xffdd('0xae')][_0x13b226]['dataValues']));_0x6a959e[_0xffdd('0x8d')](_0x353e55(_0xffdd('0xbc'),_0x528014[_0xffdd('0xae')][_0x13b226][_0xffdd('0xba')]));_0x6a959e['push'](_0x353e55(_0xffdd('0xbd'),_0x528014['rows'][_0x13b226][_0xffdd('0xba')]));_0x6a959e['push'](_0x353e55(_0xffdd('0xbe'),_0x528014[_0xffdd('0xae')][_0x13b226][_0xffdd('0xba')]));}return Promise[_0xffdd('0x90')](_0x6a959e)[_0xffdd('0x6')](function(){return _0x528014;});}return _0x528014;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6ed4550..456f823 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 _0x8daf=['request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x4addf8,_0x49d9b8){var _0x2ce2da=function(_0x4f66ef){while(--_0x4f66ef){_0x4addf8['push'](_0x4addf8['shift']());}};_0x2ce2da(++_0x49d9b8);}(_0x8daf,0x15c));var _0xf8da=function(_0x41594f,_0x32bc97){_0x41594f=_0x41594f-0x0;var _0x41a1ab=_0x8daf[_0x41594f];return _0x41a1ab;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf8da('0x0'));var fs=require('fs');var Redis=require(_0xf8da('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8da('0x2'));var logger=require(_0xf8da('0x3'))(_0xf8da('0x4'));var config=require(_0xf8da('0x5'));var jayson=require(_0xf8da('0x6'));var client=jayson[_0xf8da('0x7')][_0xf8da('0x8')]({'port':0x232a});config[_0xf8da('0x9')]=_[_0xf8da('0xa')](config['redis'],{'host':_0xf8da('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8da('0x9')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x2f16ba,_0x44dabc,_0xbd4f48){return new BPromise(function(_0x408b04,_0x4463eb){return client[_0xf8da('0xc')](_0x2f16ba,_0xbd4f48)[_0xf8da('0xd')](function(_0x31193e){logger['info'](_0xf8da('0xe'),_0x44dabc,_0xf8da('0xf'));logger[_0xf8da('0x10')](_0xf8da('0x11'),_0x44dabc,'request\x20sent',JSON[_0xf8da('0x12')](_0x31193e));if(_0x31193e['error']){if(_0x31193e[_0xf8da('0x13')][_0xf8da('0x14')]===0x1f4){logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x31193e[_0xf8da('0x13')]['message']);return _0x4463eb(_0x31193e[_0xf8da('0x13')][_0xf8da('0x15')]);}logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x31193e[_0xf8da('0x13')][_0xf8da('0x15')]);return _0x408b04(_0x31193e[_0xf8da('0x13')]['message']);}else{logger[_0xf8da('0x16')]('UserProfile,\x20%s,\x20%s',_0x44dabc,'request\x20sent');_0x408b04(_0x31193e[_0xf8da('0x17')][_0xf8da('0x15')]);}})['catch'](function(_0x3e427){logger[_0xf8da('0x13')](_0xf8da('0xe'),_0x44dabc,_0x3e427);_0x4463eb(_0x3e427);});});} \ No newline at end of file +var _0xeba2=['debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','UserProfile,\x20%s,\x20%s','request\x20sent'];(function(_0x493503,_0x351993){var _0x1986d0=function(_0x59a6a1){while(--_0x59a6a1){_0x493503['push'](_0x493503['shift']());}};_0x1986d0(++_0x351993);}(_0xeba2,0x70));var _0x2eba=function(_0x264d4d,_0x118fb5){_0x264d4d=_0x264d4d-0x0;var _0xc917e2=_0xeba2[_0x264d4d];return _0xc917e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2eba('0x0'));var BPromise=require(_0x2eba('0x1'));var rs=require(_0x2eba('0x2'));var fs=require('fs');var Redis=require(_0x2eba('0x3'));var db=require(_0x2eba('0x4'))['db'];var utils=require(_0x2eba('0x5'));var logger=require(_0x2eba('0x6'))(_0x2eba('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2eba('0x8')]({'port':0x232a});config[_0x2eba('0x9')]=_[_0x2eba('0xa')](config['redis'],{'host':_0x2eba('0xb'),'port':0x18eb});var socket=require(_0x2eba('0xc'))(new Redis(config[_0x2eba('0x9')]));require(_0x2eba('0xd'))[_0x2eba('0xe')](socket);function respondWithRpcPromise(_0x3a5bfe,_0x32b1d0,_0xd336b6){return new BPromise(function(_0x40b678,_0x38939a){return client['request'](_0x3a5bfe,_0xd336b6)[_0x2eba('0xf')](function(_0x669096){logger['info'](_0x2eba('0x10'),_0x32b1d0,_0x2eba('0x11'));logger[_0x2eba('0x12')](_0x2eba('0x13'),_0x32b1d0,_0x2eba('0x11'),JSON[_0x2eba('0x14')](_0x669096));if(_0x669096[_0x2eba('0x15')]){if(_0x669096['error']['code']===0x1f4){logger[_0x2eba('0x15')](_0x2eba('0x10'),_0x32b1d0,_0x669096[_0x2eba('0x15')][_0x2eba('0x16')]);return _0x38939a(_0x669096[_0x2eba('0x15')]['message']);}logger[_0x2eba('0x15')](_0x2eba('0x10'),_0x32b1d0,_0x669096[_0x2eba('0x15')][_0x2eba('0x16')]);return _0x40b678(_0x669096[_0x2eba('0x15')]['message']);}else{logger[_0x2eba('0x17')]('UserProfile,\x20%s,\x20%s',_0x32b1d0,'request\x20sent');_0x40b678(_0x669096[_0x2eba('0x18')][_0x2eba('0x16')]);}})[_0x2eba('0x19')](function(_0x354265){logger[_0x2eba('0x15')](_0x2eba('0x10'),_0x32b1d0,_0x354265);_0x38939a(_0x354265);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 3437c4d..a609ed7 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 _0x6bae=['register','length','userProfile:','./userProfile.events','emit','removeListener'];(function(_0x14f135,_0x2acbc3){var _0x282598=function(_0x3b6451){while(--_0x3b6451){_0x14f135['push'](_0x14f135['shift']());}};_0x282598(++_0x2acbc3);}(_0x6bae,0x15f));var _0xe6ba=function(_0xf66018,_0x43a4ea){_0xf66018=_0xf66018-0x0;var _0x2136df=_0x6bae[_0xf66018];return _0x2136df;};'use strict';var UserProfileEvents=require(_0xe6ba('0x0'));var events=['save','remove','update'];function createListener(_0x50c1c1,_0x4951fd){return function(_0x37f005){_0x4951fd[_0xe6ba('0x1')](_0x50c1c1,_0x37f005);};}function removeListener(_0x18765d,_0x3e4404){return function(){UserProfileEvents[_0xe6ba('0x2')](_0x18765d,_0x3e4404);};}exports[_0xe6ba('0x3')]=function(_0x5e1292){for(var _0x37c31b=0x0,_0x21c3f4=events[_0xe6ba('0x4')];_0x37c31b<_0x21c3f4;_0x37c31b++){var _0x27504e=events[_0x37c31b];var _0x4eee69=createListener(_0xe6ba('0x5')+_0x27504e,_0x5e1292);UserProfileEvents['on'](_0x27504e,_0x4eee69);}}; \ No newline at end of file +var _0x35be=['length','userProfile:','./userProfile.events','save','remove','emit','removeListener'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x35be,0x72));var _0xe35b=function(_0x4adf20,_0x41cc23){_0x4adf20=_0x4adf20-0x0;var _0x5e2b5b=_0x35be[_0x4adf20];return _0x5e2b5b;};'use strict';var UserProfileEvents=require(_0xe35b('0x0'));var events=[_0xe35b('0x1'),_0xe35b('0x2'),'update'];function createListener(_0x3a53f,_0x31106e){return function(_0x55901e){_0x31106e[_0xe35b('0x3')](_0x3a53f,_0x55901e);};}function removeListener(_0x315d98,_0x2c0706){return function(){UserProfileEvents[_0xe35b('0x4')](_0x315d98,_0x2c0706);};}exports['register']=function(_0x4220f4){for(var _0x1b038a=0x0,_0x900204=events[_0xe35b('0x5')];_0x1b038a<_0x900204;_0x1b038a++){var _0x568797=events[_0x1b038a];var _0x11f66c=createListener(_0xe35b('0x6')+_0x568797,_0x4220f4);UserProfileEvents['on'](_0x568797,_0x11f66c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index a3fefe5..889cd99 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 _0xb33c=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','index','describe'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb33c,0x168));var _0xcb33=function(_0xdb78b6,_0x4b95c4){_0xdb78b6=_0xdb78b6-0x0;var _0x48b7b7=_0xb33c[_0xdb78b6];return _0x48b7b7;};'use strict';var multer=require(_0xcb33('0x0'));var util=require(_0xcb33('0x1'));var path=require(_0xcb33('0x2'));var timeout=require(_0xcb33('0x3'));var express=require(_0xcb33('0x4'));var router=express[_0xcb33('0x5')]();var fs_extra=require(_0xcb33('0x6'));var auth=require(_0xcb33('0x7'));var interaction=require(_0xcb33('0x8'));var config=require('../../config/environment');var controller=require(_0xcb33('0x9'));router[_0xcb33('0xa')]('/',auth[_0xcb33('0xb')](),controller[_0xcb33('0xc')]);router[_0xcb33('0xa')]('/describe',auth[_0xcb33('0xb')](),controller[_0xcb33('0xd')]);router['get'](_0xcb33('0xe'),auth['isAuthenticated'](),controller[_0xcb33('0xf')]);router[_0xcb33('0x10')]('/',auth[_0xcb33('0xb')](),controller[_0xcb33('0x11')]);router[_0xcb33('0x12')](_0xcb33('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xcb33('0x13')](_0xcb33('0xe'),auth[_0xcb33('0xb')](),controller[_0xcb33('0x14')]);module[_0xcb33('0x15')]=router; \ No newline at end of file +var _0xbf7e=['index','get','/describe','show','post','create','put','/:id','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0xbf7e,0x1d9));var _0xebf7=function(_0x5f5a19,_0x5c31a7){_0x5f5a19=_0x5f5a19-0x0;var _0x2aba96=_0xbf7e[_0x5f5a19];return _0x2aba96;};'use strict';var multer=require(_0xebf7('0x0'));var util=require('util');var path=require(_0xebf7('0x1'));var timeout=require('connect-timeout');var express=require(_0xebf7('0x2'));var router=express[_0xebf7('0x3')]();var fs_extra=require(_0xebf7('0x4'));var auth=require(_0xebf7('0x5'));var interaction=require(_0xebf7('0x6'));var config=require(_0xebf7('0x7'));var controller=require(_0xebf7('0x8'));router['get']('/',auth[_0xebf7('0x9')](),controller[_0xebf7('0xa')]);router[_0xebf7('0xb')](_0xebf7('0xc'),auth[_0xebf7('0x9')](),controller['describe']);router[_0xebf7('0xb')]('/:id',auth[_0xebf7('0x9')](),controller[_0xebf7('0xd')]);router[_0xebf7('0xe')]('/',auth[_0xebf7('0x9')](),controller[_0xebf7('0xf')]);router[_0xebf7('0x10')](_0xebf7('0x11'),auth['isAuthenticated'](),controller[_0xebf7('0x12')]);router[_0xebf7('0x13')](_0xebf7('0x11'),auth['isAuthenticated'](),controller[_0xebf7('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index f626b76..1677a03 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 _0x5e22=['INTEGER','sequelize','exports','STRING'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x5e22,0xa9));var _0x25e2=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x5e22[_0x1b2ff7];return _0x31656a;};'use strict';var Sequelize=require(_0x25e2('0x0'));module[_0x25e2('0x1')]={'name':{'type':Sequelize[_0x25e2('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x25e2('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x25e2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2187=['INTEGER','sequelize','STRING'];(function(_0xe1d7db,_0x4d45b4){var _0x49e669=function(_0x5e58f0){while(--_0x5e58f0){_0xe1d7db['push'](_0xe1d7db['shift']());}};_0x49e669(++_0x4d45b4);}(_0x2187,0x1ae));var _0x7218=function(_0x1a8816,_0x2c7b08){_0x1a8816=_0x1a8816-0x0;var _0x3209d5=_0x2187[_0x1a8816];return _0x3209d5;};'use strict';var Sequelize=require(_0x7218('0x0'));module['exports']={'name':{'type':Sequelize[_0x7218('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x7218('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7218('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 0bfe295..b54e092 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 _0xf61e=['where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','apply','destroy','then','status','error','stack','name','send','index','map','UserProfileResource','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order'];(function(_0x2281d4,_0x1dc3f5){var _0x171e1d=function(_0x4d39f6){while(--_0x4d39f6){_0x2281d4['push'](_0x2281d4['shift']());}};_0x171e1d(++_0x1dc3f5);}(_0xf61e,0x191));var _0xef61=function(_0x590678,_0x4d09d7){_0x590678=_0x590678-0x0;var _0x38c01c=_0xf61e[_0x590678];return _0x38c01c;};'use strict';var emlformat=require(_0xef61('0x0'));var rimraf=require(_0xef61('0x1'));var zipdir=require(_0xef61('0x2'));var jsonpatch=require(_0xef61('0x3'));var rp=require(_0xef61('0x4'));var moment=require(_0xef61('0x5'));var BPromise=require(_0xef61('0x6'));var Mustache=require(_0xef61('0x7'));var util=require(_0xef61('0x8'));var path=require(_0xef61('0x9'));var sox=require(_0xef61('0xa'));var csv=require(_0xef61('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef61('0xc'));var _=require(_0xef61('0xd'));var squel=require('squel');var crypto=require(_0xef61('0xe'));var jsforce=require(_0xef61('0xf'));var deskjs=require(_0xef61('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xef61('0x11'));var Redis=require(_0xef61('0x12'));var authService=require(_0xef61('0x13'));var qs=require(_0xef61('0x14'));var as=require(_0xef61('0x15'));var hardwareService=require(_0xef61('0x16'));var logger=require(_0xef61('0x17'))(_0xef61('0x18'));var utils=require(_0xef61('0x19'));var config=require(_0xef61('0x1a'));var licenseUtil=require(_0xef61('0x1b'));var db=require(_0xef61('0x1c'))['db'];function respondWithStatusCode(_0x114e1f,_0x318f1c){_0x318f1c=_0x318f1c||0xcc;return function(_0x5de159){if(_0x5de159){return _0x114e1f[_0xef61('0x1d')](_0x318f1c);}return _0x114e1f['status'](_0x318f1c)[_0xef61('0x1e')]();};}function respondWithResult(_0x1db2a9,_0x370ee0){_0x370ee0=_0x370ee0||0xc8;return function(_0x76ef9b){if(_0x76ef9b){return _0x1db2a9['status'](_0x370ee0)[_0xef61('0x1f')](_0x76ef9b);}};}function respondWithFilteredResult(_0x435beb,_0x1224c2){return function(_0x78ff22){if(_0x78ff22){var _0x588a61=typeof _0x1224c2[_0xef61('0x20')]===_0xef61('0x21')&&typeof _0x1224c2['limit']===_0xef61('0x21');var _0x408541=_0x78ff22[_0xef61('0x22')];var _0x22dc1b=_0x588a61?0x0:_0x1224c2[_0xef61('0x20')];var _0x28315a=_0x588a61?_0x78ff22[_0xef61('0x22')]:_0x1224c2['offset']+_0x1224c2[_0xef61('0x23')];var _0x2c8dad;if(_0x28315a>=_0x408541){_0x28315a=_0x408541;_0x2c8dad=0xc8;}else{_0x2c8dad=0xce;}_0x435beb['status'](_0x2c8dad);return _0x435beb[_0xef61('0x24')](_0xef61('0x25'),_0x22dc1b+'-'+_0x28315a+'/'+_0x408541)[_0xef61('0x1f')](_0x78ff22);}return null;};}function patchUpdates(_0x26cf42){return function(_0xb0d7a4){try{jsonpatch[_0xef61('0x26')](_0xb0d7a4,_0x26cf42,!![]);}catch(_0x92ea33){return BPromise['reject'](_0x92ea33);}return _0xb0d7a4['save']();};}function saveUpdates(_0x3d31c1,_0x58bd7d){return function(_0x389d6d){if(_0x389d6d){return _0x389d6d['update'](_0x3d31c1)['then'](function(_0x2f0569){return _0x2f0569;});}return null;};}function removeEntity(_0x5ce99d,_0x53181b){return function(_0xfbee94){if(_0xfbee94){return _0xfbee94[_0xef61('0x27')]()[_0xef61('0x28')](function(){_0x5ce99d[_0xef61('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16b144,_0x4e738f){return function(_0x2a6832){if(!_0x2a6832){_0x16b144[_0xef61('0x1d')](0x194);}return _0x2a6832;};}function handleError(_0x2419a9,_0xf4c7c9){_0xf4c7c9=_0xf4c7c9||0x1f4;return function(_0x2155f1){logger[_0xef61('0x2a')](_0x2155f1[_0xef61('0x2b')]);if(_0x2155f1[_0xef61('0x2c')]){delete _0x2155f1[_0xef61('0x2c')];}_0x2419a9[_0xef61('0x29')](_0xf4c7c9)[_0xef61('0x2d')](_0x2155f1);};}exports[_0xef61('0x2e')]=function(_0xeb9a62,_0x63edd4){var _0x1f3572={},_0x85978={},_0x39c15e={'count':0x0,'rows':[]};var _0x393ea9=_[_0xef61('0x2f')](db[_0xef61('0x30')][_0xef61('0x31')],function(_0x53fa3b){return{'name':_0x53fa3b['fieldName'],'type':_0x53fa3b['type'][_0xef61('0x32')]};});_0x85978[_0xef61('0x33')]=_[_0xef61('0x2f')](_0x393ea9,'name');_0x85978[_0xef61('0x34')]=_[_0xef61('0x35')](_0xeb9a62['query']);_0x85978[_0xef61('0x36')]=_['intersection'](_0x85978['model'],_0x85978[_0xef61('0x34')]);_0x1f3572['attributes']=_[_0xef61('0x37')](_0x85978['model'],qs[_0xef61('0x38')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x38')]));_0x1f3572[_0xef61('0x39')]=_0x1f3572[_0xef61('0x39')][_0xef61('0x3a')]?_0x1f3572[_0xef61('0x39')]:_0x85978[_0xef61('0x33')];if(!_0xeb9a62[_0xef61('0x34')][_0xef61('0x3b')]('nolimit')){_0x1f3572[_0xef61('0x23')]=qs[_0xef61('0x23')](_0xeb9a62[_0xef61('0x34')][_0xef61('0x23')]);_0x1f3572[_0xef61('0x20')]=qs['offset'](_0xeb9a62[_0xef61('0x34')][_0xef61('0x20')]);}_0x1f3572[_0xef61('0x3c')]=qs['sort'](_0xeb9a62['query']['sort']);_0x1f3572[_0xef61('0x3d')]=qs['filters'](_['pick'](_0xeb9a62['query'],_0x85978[_0xef61('0x36')]),_0x393ea9);if(_0xeb9a62[_0xef61('0x34')][_0xef61('0x3e')]){_0x1f3572['where']=_['merge'](_0x1f3572['where'],{'$or':_[_0xef61('0x2f')](_0x393ea9,function(_0x32ad44){if(_0x32ad44['type']!==_0xef61('0x3f')){var _0x12f442={};_0x12f442[_0x32ad44[_0xef61('0x2c')]]={'$like':'%'+_0xeb9a62[_0xef61('0x34')]['filter']+'%'};return _0x12f442;}})});}_0x1f3572=_[_0xef61('0x40')]({},_0x1f3572,_0xeb9a62[_0xef61('0x41')]);var _0x3103d4={'where':_0x1f3572[_0xef61('0x3d')]};return db['UserProfileResource']['count'](_0x3103d4)[_0xef61('0x28')](function(_0x462972){_0x39c15e[_0xef61('0x22')]=_0x462972;if(_0xeb9a62['query'][_0xef61('0x42')]){_0x1f3572[_0xef61('0x43')]=[{'all':!![]}];}return db[_0xef61('0x30')][_0xef61('0x44')](_0x1f3572);})['then'](function(_0x545597){_0x39c15e['rows']=_0x545597;return _0x39c15e;})[_0xef61('0x28')](respondWithFilteredResult(_0x63edd4,_0x1f3572))[_0xef61('0x45')](handleError(_0x63edd4,null));};exports[_0xef61('0x46')]=function(_0xe40d,_0x3f81a1){var _0x272143={'raw':![],'where':{'id':_0xe40d['params']['id']}},_0xc9b467={};_0xc9b467[_0xef61('0x33')]=_[_0xef61('0x35')](db[_0xef61('0x30')][_0xef61('0x31')]);_0xc9b467['query']=_[_0xef61('0x35')](_0xe40d[_0xef61('0x34')]);_0xc9b467[_0xef61('0x36')]=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],_0xc9b467[_0xef61('0x34')]);_0x272143['attributes']=_[_0xef61('0x37')](_0xc9b467[_0xef61('0x33')],qs[_0xef61('0x38')](_0xe40d['query'][_0xef61('0x38')]));_0x272143[_0xef61('0x39')]=_0x272143[_0xef61('0x39')][_0xef61('0x3a')]?_0x272143[_0xef61('0x39')]:_0xc9b467[_0xef61('0x33')];if(_0xe40d['query'][_0xef61('0x42')]){_0x272143[_0xef61('0x43')]=[{'all':!![]}];}_0x272143=_['merge']({},_0x272143,_0xe40d[_0xef61('0x41')]);return db[_0xef61('0x30')][_0xef61('0x47')](_0x272143)[_0xef61('0x28')](handleEntityNotFound(_0x3f81a1,null))['then'](respondWithResult(_0x3f81a1,null))[_0xef61('0x45')](handleError(_0x3f81a1,null));};exports[_0xef61('0x48')]=function(_0x5e614b,_0x47b09d){return db[_0xef61('0x30')][_0xef61('0x48')](_0x5e614b['body'],{})[_0xef61('0x28')](respondWithResult(_0x47b09d,0xc9))[_0xef61('0x45')](handleError(_0x47b09d,null));};exports[_0xef61('0x49')]=function(_0x2904e0,_0x13bb20){if(_0x2904e0[_0xef61('0x4a')]['id']){delete _0x2904e0[_0xef61('0x4a')]['id'];}return db['UserProfileResource'][_0xef61('0x47')]({'where':{'id':_0x2904e0['params']['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x13bb20,null))[_0xef61('0x28')](saveUpdates(_0x2904e0[_0xef61('0x4a')],null))[_0xef61('0x28')](respondWithResult(_0x13bb20,null))[_0xef61('0x45')](handleError(_0x13bb20,null));};exports[_0xef61('0x27')]=function(_0x3e23eb,_0x1565c7){return db[_0xef61('0x30')]['find']({'where':{'id':_0x3e23eb[_0xef61('0x4b')]['id']}})[_0xef61('0x28')](handleEntityNotFound(_0x1565c7,null))['then'](removeEntity(_0x1565c7,null))['catch'](handleError(_0x1565c7,null));};exports[_0xef61('0x4c')]=function(_0x1ce127,_0x504389){return db[_0xef61('0x30')]['describe']()[_0xef61('0x28')](respondWithResult(_0x504389,null))[_0xef61('0x45')](handleError(_0x504389,null));}; \ No newline at end of file +var _0xafc4=['update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','UserProfileResource','includeAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x33e706,_0x13cbcc){var _0x5a8382=function(_0x488191){while(--_0x488191){_0x33e706['push'](_0x33e706['shift']());}};_0x5a8382(++_0x13cbcc);}(_0xafc4,0x69));var _0x4afc=function(_0x161005,_0xe63d63){_0x161005=_0x161005-0x0;var _0x12a7c7=_0xafc4[_0x161005];return _0x12a7c7;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['UserProfileResource'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['UserProfileResource']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 34aa7ba..aadaea8 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 _0x8ff5=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','../../config/logger'];(function(_0x4e1331,_0x530883){var _0x416406=function(_0x3fe01f){while(--_0x3fe01f){_0x4e1331['push'](_0x4e1331['shift']());}};_0x416406(++_0x530883);}(_0x8ff5,0x6d));var _0x58ff=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8ff5[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x58ff('0x0'));var util=require(_0x58ff('0x1'));var logger=require(_0x58ff('0x2'))(_0x58ff('0x3'));var moment=require('moment');var BPromise=require(_0x58ff('0x4'));var rp=require(_0x58ff('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58ff('0x6'));var config=require(_0x58ff('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x58ff('0x8')]=function(_0x375563,_0x9b6f05){return _0x375563[_0x58ff('0x9')](_0x58ff('0xa'),attributes,{'tableName':_0x58ff('0xb'),'paranoid':![],'indexes':[{'name':_0x58ff('0xc'),'fields':['resourceId',_0x58ff('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd527=['define','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./userProfileResource.attributes','exports'];(function(_0x39b170,_0x4c69e9){var _0x4e7706=function(_0x15b27f){while(--_0x15b27f){_0x39b170['push'](_0x39b170['shift']());}};_0x4e7706(++_0x4c69e9);}(_0xd527,0x12a));var _0x7d52=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xd527[_0xe15270];return _0x1e813b;};'use strict';var _=require(_0x7d52('0x0'));var util=require(_0x7d52('0x1'));var logger=require(_0x7d52('0x2'))(_0x7d52('0x3'));var moment=require(_0x7d52('0x4'));var BPromise=require(_0x7d52('0x5'));var rp=require(_0x7d52('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7d52('0x7'));var attributes=require(_0x7d52('0x8'));module[_0x7d52('0x9')]=function(_0x4fd2ac,_0x44d62d){return _0x4fd2ac[_0x7d52('0xa')]('UserProfileResource',attributes,{'tableName':_0x7d52('0xb'),'paranoid':![],'indexes':[{'name':_0x7d52('0xc'),'fields':[_0x7d52('0xd'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 0093780..732df26 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 _0x3bb1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x3bb1,0xda));var _0x13bb=function(_0x15ae07,_0x4f9fef){_0x15ae07=_0x15ae07-0x0;var _0x384dd4=_0x3bb1[_0x15ae07];return _0x384dd4;};'use strict';var _=require(_0x13bb('0x0'));var util=require(_0x13bb('0x1'));var moment=require(_0x13bb('0x2'));var BPromise=require(_0x13bb('0x3'));var rs=require(_0x13bb('0x4'));var fs=require('fs');var Redis=require(_0x13bb('0x5'));var db=require(_0x13bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x13bb('0x7'))(_0x13bb('0x8'));var config=require(_0x13bb('0x9'));var jayson=require(_0x13bb('0xa'));var client=jayson[_0x13bb('0xb')][_0x13bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1003ef,_0x587a0a,_0x16d816){return new BPromise(function(_0x2f691e,_0x2b7d31){return client['request'](_0x1003ef,_0x16d816)[_0x13bb('0xd')](function(_0x57650b){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x587a0a,_0x13bb('0xe'));logger[_0x13bb('0xf')](_0x13bb('0x10'),_0x587a0a,_0x13bb('0xe'),JSON[_0x13bb('0x11')](_0x57650b));if(_0x57650b['error']){if(_0x57650b[_0x13bb('0x12')][_0x13bb('0x13')]===0x1f4){logger[_0x13bb('0x12')](_0x13bb('0x14'),_0x587a0a,_0x57650b['error'][_0x13bb('0x15')]);return _0x2b7d31(_0x57650b[_0x13bb('0x12')][_0x13bb('0x15')]);}logger[_0x13bb('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x587a0a,_0x57650b[_0x13bb('0x12')][_0x13bb('0x15')]);return _0x2f691e(_0x57650b['error']['message']);}else{logger[_0x13bb('0x16')](_0x13bb('0x14'),_0x587a0a,'request\x20sent');_0x2f691e(_0x57650b[_0x13bb('0x17')]['message']);}})[_0x13bb('0x18')](function(_0x475dd5){logger[_0x13bb('0x12')](_0x13bb('0x14'),_0x587a0a,_0x475dd5);_0x2b7d31(_0x475dd5);});});} \ No newline at end of file +var _0x541d=['error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x29e416,_0x465da1){var _0x2722e2=function(_0x4a0134){while(--_0x4a0134){_0x29e416['push'](_0x29e416['shift']());}};_0x2722e2(++_0x465da1);}(_0x541d,0xd5));var _0xd541=function(_0x3d2f57,_0x181e69){_0x3d2f57=_0x3d2f57-0x0;var _0xc7e303=_0x541d[_0x3d2f57];return _0xc7e303;};'use strict';var _=require('lodash');var util=require(_0xd541('0x0'));var moment=require('moment');var BPromise=require(_0xd541('0x1'));var rs=require(_0xd541('0x2'));var fs=require('fs');var Redis=require(_0xd541('0x3'));var db=require(_0xd541('0x4'))['db'];var utils=require(_0xd541('0x5'));var logger=require('../../config/logger')(_0xd541('0x6'));var config=require('../../config/environment');var jayson=require(_0xd541('0x7'));var client=jayson[_0xd541('0x8')][_0xd541('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x191b2b,_0x1de20d,_0xd6e04b){return new BPromise(function(_0x116e9e,_0xcb2fef){return client['request'](_0x191b2b,_0xd6e04b)[_0xd541('0xa')](function(_0x2dbb91){logger['info'](_0xd541('0xb'),_0x1de20d,_0xd541('0xc'));logger['debug'](_0xd541('0xd'),_0x1de20d,_0xd541('0xc'),JSON[_0xd541('0xe')](_0x2dbb91));if(_0x2dbb91[_0xd541('0xf')]){if(_0x2dbb91['error'][_0xd541('0x10')]===0x1f4){logger[_0xd541('0xf')](_0xd541('0xb'),_0x1de20d,_0x2dbb91['error'][_0xd541('0x11')]);return _0xcb2fef(_0x2dbb91[_0xd541('0xf')]['message']);}logger['error'](_0xd541('0xb'),_0x1de20d,_0x2dbb91['error'][_0xd541('0x11')]);return _0x116e9e(_0x2dbb91[_0xd541('0xf')][_0xd541('0x11')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x1de20d,_0xd541('0xc'));_0x116e9e(_0x2dbb91[_0xd541('0x12')][_0xd541('0x11')]);}})['catch'](function(_0x1b1389){logger[_0xd541('0xf')](_0xd541('0xb'),_0x1de20d,_0x1b1389);_0xcb2fef(_0x1b1389);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9182b79..9e1a17c 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 _0xc1c3=['/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','get'];(function(_0x490298,_0x13f61a){var _0x24cdea=function(_0x48377a){while(--_0x48377a){_0x490298['push'](_0x490298['shift']());}};_0x24cdea(++_0x13f61a);}(_0xc1c3,0x88));var _0x3c1c=function(_0x9ac182,_0x4fecb4){_0x9ac182=_0x9ac182-0x0;var _0x22378e=_0xc1c3[_0x9ac182];return _0x22378e;};'use strict';var multer=require(_0x3c1c('0x0'));var util=require(_0x3c1c('0x1'));var path=require(_0x3c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x3c1c('0x3'));var router=express['Router']();var fs_extra=require(_0x3c1c('0x4'));var auth=require(_0x3c1c('0x5'));var interaction=require(_0x3c1c('0x6'));var config=require(_0x3c1c('0x7'));var controller=require(_0x3c1c('0x8'));router['get']('/',auth[_0x3c1c('0x9')](),controller['index']);router[_0x3c1c('0xa')](_0x3c1c('0xb'),auth[_0x3c1c('0x9')](),controller[_0x3c1c('0xc')]);router[_0x3c1c('0xa')]('/:id',auth[_0x3c1c('0x9')](),controller[_0x3c1c('0xd')]);router[_0x3c1c('0xe')]('/',auth[_0x3c1c('0x9')](),controller[_0x3c1c('0xf')]);router[_0x3c1c('0x10')](_0x3c1c('0x11'),auth[_0x3c1c('0x9')](),controller['update']);router[_0x3c1c('0x12')](_0x3c1c('0x11'),auth[_0x3c1c('0x9')](),controller[_0x3c1c('0x13')]);module[_0x3c1c('0x14')]=router; \ No newline at end of file +var _0x53bc=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','get'];(function(_0x2d6566,_0x74d6da){var _0x3ec4c3=function(_0x3e4342){while(--_0x3e4342){_0x2d6566['push'](_0x2d6566['shift']());}};_0x3ec4c3(++_0x74d6da);}(_0x53bc,0x1da));var _0xc53b=function(_0x4ed0af,_0x4359d2){_0x4ed0af=_0x4ed0af-0x0;var _0x2ef8d3=_0x53bc[_0x4ed0af];return _0x2ef8d3;};'use strict';var multer=require(_0xc53b('0x0'));var util=require(_0xc53b('0x1'));var path=require(_0xc53b('0x2'));var timeout=require(_0xc53b('0x3'));var express=require(_0xc53b('0x4'));var router=express['Router']();var fs_extra=require(_0xc53b('0x5'));var auth=require(_0xc53b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53b('0x7'));var controller=require(_0xc53b('0x8'));router[_0xc53b('0x9')]('/',auth[_0xc53b('0xa')](),controller[_0xc53b('0xb')]);router[_0xc53b('0x9')](_0xc53b('0xc'),auth[_0xc53b('0xa')](),controller[_0xc53b('0xd')]);router[_0xc53b('0x9')](_0xc53b('0xe'),auth[_0xc53b('0xa')](),controller[_0xc53b('0xf')]);router[_0xc53b('0x10')]('/',auth[_0xc53b('0xa')](),controller[_0xc53b('0x11')]);router[_0xc53b('0x12')]('/:id',auth[_0xc53b('0xa')](),controller[_0xc53b('0x13')]);router['delete'](_0xc53b('0xe'),auth[_0xc53b('0xa')](),controller[_0xc53b('0x14')]);module[_0xc53b('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 7bbb4ef..e7b025c 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 _0xe820=['sequelize','STRING','BOOLEAN','setDataValue','join','getDataValue','crudPermissions'];(function(_0x177b1d,_0x2776d0){var _0x4800a5=function(_0x389728){while(--_0x389728){_0x177b1d['push'](_0x177b1d['shift']());}};_0x4800a5(++_0x2776d0);}(_0xe820,0xd2));var _0x0e82=function(_0x259764,_0x13848f){_0x259764=_0x259764-0x0;var _0x44c434=_0xe820[_0x259764];return _0x44c434;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0e82('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0e82('0x1')],'set':function(_0x59b28d){this[_0x0e82('0x3')]('crudPermissions',_0x59b28d?_0x59b28d[_0x0e82('0x4')](''):[]);},'get':function(){return this[_0x0e82('0x5')](_0x0e82('0x6'))?this[_0x0e82('0x5')](_0x0e82('0x6'))['split'](''):[];}}}; \ No newline at end of file +var _0xf4f4=['INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','split','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf4f4,0xe3));var _0x4f4f=function(_0xae6db5,_0x5b81e9){_0xae6db5=_0xae6db5-0x0;var _0x526e3c=_0xf4f4[_0xae6db5];return _0x526e3c;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x4f4f('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4f4f('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4f4f('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x4f4f('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4f4f('0x2')],'set':function(_0x510b24){this[_0x4f4f('0x5')]('crudPermissions',_0x510b24?_0x510b24[_0x4f4f('0x6')](''):[]);},'get':function(){return this[_0x4f4f('0x7')](_0x4f4f('0x8'))?this[_0x4f4f('0x7')](_0x4f4f('0x8'))[_0x4f4f('0x9')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6a23e0f..ea8d66d 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 _0x8c68=['filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','UserProfileSection','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c68,0x65));var _0x88c6=function(_0x208763,_0x528f91){_0x208763=_0x208763-0x0;var _0x2e1d57=_0x8c68[_0x208763];return _0x2e1d57;};'use strict';var emlformat=require(_0x88c6('0x0'));var rimraf=require(_0x88c6('0x1'));var zipdir=require(_0x88c6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x88c6('0x3'));var moment=require(_0x88c6('0x4'));var BPromise=require(_0x88c6('0x5'));var Mustache=require(_0x88c6('0x6'));var util=require(_0x88c6('0x7'));var path=require(_0x88c6('0x8'));var sox=require(_0x88c6('0x9'));var csv=require(_0x88c6('0xa'));var ejs=require(_0x88c6('0xb'));var fs=require('fs');var fs_extra=require(_0x88c6('0xc'));var _=require(_0x88c6('0xd'));var squel=require(_0x88c6('0xe'));var crypto=require('crypto');var jsforce=require(_0x88c6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x88c6('0x10'));var Papa=require('papaparse');var Redis=require(_0x88c6('0x11'));var authService=require(_0x88c6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x88c6('0x13'));var hardwareService=require(_0x88c6('0x14'));var logger=require('../../config/logger')(_0x88c6('0x15'));var utils=require(_0x88c6('0x16'));var config=require(_0x88c6('0x17'));var licenseUtil=require(_0x88c6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xee5737,_0x25e0ce){_0x25e0ce=_0x25e0ce||0xcc;return function(_0x42aad2){if(_0x42aad2){return _0xee5737[_0x88c6('0x19')](_0x25e0ce);}return _0xee5737[_0x88c6('0x1a')](_0x25e0ce)['end']();};}function respondWithResult(_0xab33b,_0x5321ec){_0x5321ec=_0x5321ec||0xc8;return function(_0x4f5b90){if(_0x4f5b90){return _0xab33b[_0x88c6('0x1a')](_0x5321ec)[_0x88c6('0x1b')](_0x4f5b90);}};}function respondWithFilteredResult(_0x24dfe9,_0x3f06e8){return function(_0x76313a){if(_0x76313a){var _0x3f8cc=typeof _0x3f06e8[_0x88c6('0x1c')]==='undefined'&&typeof _0x3f06e8['limit']===_0x88c6('0x1d');var _0x4c1c6c=_0x76313a[_0x88c6('0x1e')];var _0x2cafc0=_0x3f8cc?0x0:_0x3f06e8[_0x88c6('0x1c')];var _0x344886=_0x3f8cc?_0x76313a[_0x88c6('0x1e')]:_0x3f06e8[_0x88c6('0x1c')]+_0x3f06e8[_0x88c6('0x1f')];var _0x27b0b8;if(_0x344886>=_0x4c1c6c){_0x344886=_0x4c1c6c;_0x27b0b8=0xc8;}else{_0x27b0b8=0xce;}_0x24dfe9[_0x88c6('0x1a')](_0x27b0b8);return _0x24dfe9[_0x88c6('0x20')](_0x88c6('0x21'),_0x2cafc0+'-'+_0x344886+'/'+_0x4c1c6c)[_0x88c6('0x1b')](_0x76313a);}return null;};}function patchUpdates(_0x2b2a2a){return function(_0x1f48b0){try{jsonpatch[_0x88c6('0x22')](_0x1f48b0,_0x2b2a2a,!![]);}catch(_0x3c49c8){return BPromise[_0x88c6('0x23')](_0x3c49c8);}return _0x1f48b0[_0x88c6('0x24')]();};}function saveUpdates(_0x51b29f,_0x260a22){return function(_0x4aa6d3){if(_0x4aa6d3){return _0x4aa6d3[_0x88c6('0x25')](_0x51b29f)[_0x88c6('0x26')](function(_0x44bb1e){return _0x44bb1e;});}return null;};}function removeEntity(_0x2a57ec,_0xc3d259){return function(_0x3caff6){if(_0x3caff6){return _0x3caff6[_0x88c6('0x27')]()['then'](function(){_0x2a57ec[_0x88c6('0x1a')](0xcc)[_0x88c6('0x28')]();});}};}function handleEntityNotFound(_0x4adde9,_0x4f84fe){return function(_0x620397){if(!_0x620397){_0x4adde9['sendStatus'](0x194);}return _0x620397;};}function handleError(_0x1a94b5,_0x77baf7){_0x77baf7=_0x77baf7||0x1f4;return function(_0x1c3b02){logger[_0x88c6('0x29')](_0x1c3b02[_0x88c6('0x2a')]);if(_0x1c3b02[_0x88c6('0x2b')]){delete _0x1c3b02[_0x88c6('0x2b')];}_0x1a94b5[_0x88c6('0x1a')](_0x77baf7)[_0x88c6('0x2c')](_0x1c3b02);};}exports[_0x88c6('0x2d')]=function(_0x1c9950,_0xe4e273){var _0x589aec={},_0x31f2b6={},_0x37f6d4={'count':0x0,'rows':[]};var _0x1dd8a6=_[_0x88c6('0x2e')](db['UserProfileSection']['rawAttributes'],function(_0x38549e){return{'name':_0x38549e[_0x88c6('0x2f')],'type':_0x38549e[_0x88c6('0x30')][_0x88c6('0x31')]};});_0x31f2b6[_0x88c6('0x32')]=_[_0x88c6('0x2e')](_0x1dd8a6,_0x88c6('0x2b'));_0x31f2b6[_0x88c6('0x33')]=_[_0x88c6('0x34')](_0x1c9950[_0x88c6('0x33')]);_0x31f2b6[_0x88c6('0x35')]=_[_0x88c6('0x36')](_0x31f2b6[_0x88c6('0x32')],_0x31f2b6[_0x88c6('0x33')]);_0x589aec['attributes']=_['intersection'](_0x31f2b6[_0x88c6('0x32')],qs[_0x88c6('0x37')](_0x1c9950[_0x88c6('0x33')][_0x88c6('0x37')]));_0x589aec[_0x88c6('0x38')]=_0x589aec[_0x88c6('0x38')][_0x88c6('0x39')]?_0x589aec[_0x88c6('0x38')]:_0x31f2b6[_0x88c6('0x32')];if(!_0x1c9950['query'][_0x88c6('0x3a')]('nolimit')){_0x589aec[_0x88c6('0x1f')]=qs[_0x88c6('0x1f')](_0x1c9950[_0x88c6('0x33')][_0x88c6('0x1f')]);_0x589aec['offset']=qs['offset'](_0x1c9950['query']['offset']);}_0x589aec[_0x88c6('0x3b')]=qs[_0x88c6('0x3c')](_0x1c9950[_0x88c6('0x33')][_0x88c6('0x3c')]);_0x589aec[_0x88c6('0x3d')]=qs[_0x88c6('0x35')](_[_0x88c6('0x3e')](_0x1c9950['query'],_0x31f2b6['filters']),_0x1dd8a6);if(_0x1c9950[_0x88c6('0x33')][_0x88c6('0x3f')]){_0x589aec[_0x88c6('0x3d')]=_['merge'](_0x589aec[_0x88c6('0x3d')],{'$or':_[_0x88c6('0x2e')](_0x1dd8a6,function(_0x1e1302){if(_0x1e1302[_0x88c6('0x30')]!==_0x88c6('0x40')){var _0x4449bf={};_0x4449bf[_0x1e1302[_0x88c6('0x2b')]]={'$like':'%'+_0x1c9950[_0x88c6('0x33')][_0x88c6('0x3f')]+'%'};return _0x4449bf;}})});}_0x589aec=_[_0x88c6('0x41')]({},_0x589aec,_0x1c9950[_0x88c6('0x42')]);var _0x3f91c4={'where':_0x589aec['where']};return db['UserProfileSection'][_0x88c6('0x1e')](_0x3f91c4)[_0x88c6('0x26')](function(_0x313f36){_0x37f6d4[_0x88c6('0x1e')]=_0x313f36;if(_0x1c9950['query']['includeAll']){_0x589aec['include']=[{'all':!![]}];}return db['UserProfileSection'][_0x88c6('0x43')](_0x589aec);})['then'](function(_0x35ab13){_0x37f6d4[_0x88c6('0x44')]=_0x35ab13;return _0x37f6d4;})[_0x88c6('0x26')](respondWithFilteredResult(_0xe4e273,_0x589aec))[_0x88c6('0x45')](handleError(_0xe4e273,null));};exports['show']=function(_0x505a21,_0x4253a4){var _0x57ae3f={'raw':![],'where':{'id':_0x505a21[_0x88c6('0x46')]['id']}},_0x16e146={};_0x16e146[_0x88c6('0x32')]=_['keys'](db[_0x88c6('0x47')][_0x88c6('0x48')]);_0x16e146[_0x88c6('0x33')]=_[_0x88c6('0x34')](_0x505a21[_0x88c6('0x33')]);_0x16e146[_0x88c6('0x35')]=_[_0x88c6('0x36')](_0x16e146['model'],_0x16e146[_0x88c6('0x33')]);_0x57ae3f[_0x88c6('0x38')]=_[_0x88c6('0x36')](_0x16e146[_0x88c6('0x32')],qs[_0x88c6('0x37')](_0x505a21[_0x88c6('0x33')][_0x88c6('0x37')]));_0x57ae3f[_0x88c6('0x38')]=_0x57ae3f['attributes'][_0x88c6('0x39')]?_0x57ae3f['attributes']:_0x16e146[_0x88c6('0x32')];if(_0x505a21[_0x88c6('0x33')]['includeAll']){_0x57ae3f['include']=[{'all':!![]}];}_0x57ae3f=_[_0x88c6('0x41')]({},_0x57ae3f,_0x505a21['options']);return db[_0x88c6('0x47')][_0x88c6('0x49')](_0x57ae3f)[_0x88c6('0x26')](handleEntityNotFound(_0x4253a4,null))[_0x88c6('0x26')](respondWithResult(_0x4253a4,null))[_0x88c6('0x45')](handleError(_0x4253a4,null));};exports[_0x88c6('0x4a')]=function(_0x3ee1da,_0x22a176){return db[_0x88c6('0x47')][_0x88c6('0x4a')](_0x3ee1da[_0x88c6('0x4b')],{})['then'](respondWithResult(_0x22a176,0xc9))['catch'](handleError(_0x22a176,null));};exports[_0x88c6('0x25')]=function(_0x52123a,_0x94a6d7){if(_0x52123a['body']['id']){delete _0x52123a[_0x88c6('0x4b')]['id'];}return db[_0x88c6('0x47')][_0x88c6('0x49')]({'where':{'id':_0x52123a[_0x88c6('0x46')]['id']}})[_0x88c6('0x26')](handleEntityNotFound(_0x94a6d7,null))[_0x88c6('0x26')](saveUpdates(_0x52123a[_0x88c6('0x4b')],null))['then'](respondWithResult(_0x94a6d7,null))[_0x88c6('0x45')](handleError(_0x94a6d7,null));};exports[_0x88c6('0x27')]=function(_0x1089f2,_0xcf2365){return db[_0x88c6('0x47')]['find']({'where':{'id':_0x1089f2[_0x88c6('0x46')]['id']}})[_0x88c6('0x26')](handleEntityNotFound(_0xcf2365,null))[_0x88c6('0x26')](removeEntity(_0xcf2365,null))[_0x88c6('0x45')](handleError(_0xcf2365,null));};exports[_0x88c6('0x4c')]=function(_0x1d1bfd,_0x2176c2){return db[_0x88c6('0x47')][_0x88c6('0x4c')]()[_0x88c6('0x26')](respondWithResult(_0x2176c2,null))['catch'](handleError(_0x2176c2,null));}; \ No newline at end of file +var _0xcade=['lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','name','send','index','UserProfileSection','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','create','update','body','find','params','destroy','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra'];(function(_0x9fea02,_0x113929){var _0x2d1e70=function(_0x1a62f0){while(--_0x1a62f0){_0x9fea02['push'](_0x9fea02['shift']());}};_0x2d1e70(++_0x113929);}(_0xcade,0x117));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xecad('0x0'));var zipdir=require(_0xecad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xecad('0x2'));var moment=require('moment');var BPromise=require(_0xecad('0x3'));var Mustache=require('mustache');var util=require(_0xecad('0x4'));var path=require(_0xecad('0x5'));var sox=require(_0xecad('0x6'));var csv=require(_0xecad('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecad('0x8'));var _=require(_0xecad('0x9'));var squel=require(_0xecad('0xa'));var crypto=require('crypto');var jsforce=require(_0xecad('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xecad('0x7'));var querystring=require('querystring');var Papa=require(_0xecad('0xc'));var Redis=require(_0xecad('0xd'));var authService=require(_0xecad('0xe'));var qs=require(_0xecad('0xf'));var as=require(_0xecad('0x10'));var hardwareService=require(_0xecad('0x11'));var logger=require(_0xecad('0x12'))(_0xecad('0x13'));var utils=require(_0xecad('0x14'));var config=require(_0xecad('0x15'));var licenseUtil=require(_0xecad('0x16'));var db=require(_0xecad('0x17'))['db'];function respondWithStatusCode(_0x46b46b,_0x160b4c){_0x160b4c=_0x160b4c||0xcc;return function(_0x52647e){if(_0x52647e){return _0x46b46b[_0xecad('0x18')](_0x160b4c);}return _0x46b46b[_0xecad('0x19')](_0x160b4c)[_0xecad('0x1a')]();};}function respondWithResult(_0x167973,_0x3c2a7d){_0x3c2a7d=_0x3c2a7d||0xc8;return function(_0x44a1a4){if(_0x44a1a4){return _0x167973[_0xecad('0x19')](_0x3c2a7d)[_0xecad('0x1b')](_0x44a1a4);}};}function respondWithFilteredResult(_0x14f03b,_0x4ebc3f){return function(_0x51c939){if(_0x51c939){var _0x200bea=typeof _0x4ebc3f[_0xecad('0x1c')]==='undefined'&&typeof _0x4ebc3f[_0xecad('0x1d')]===_0xecad('0x1e');var _0x2bf9a2=_0x51c939[_0xecad('0x1f')];var _0x2dc71e=_0x200bea?0x0:_0x4ebc3f[_0xecad('0x1c')];var _0x46c151=_0x200bea?_0x51c939[_0xecad('0x1f')]:_0x4ebc3f[_0xecad('0x1c')]+_0x4ebc3f[_0xecad('0x1d')];var _0x59bf7a;if(_0x46c151>=_0x2bf9a2){_0x46c151=_0x2bf9a2;_0x59bf7a=0xc8;}else{_0x59bf7a=0xce;}_0x14f03b[_0xecad('0x19')](_0x59bf7a);return _0x14f03b[_0xecad('0x20')]('Content-Range',_0x2dc71e+'-'+_0x46c151+'/'+_0x2bf9a2)['json'](_0x51c939);}return null;};}function patchUpdates(_0x3f81aa){return function(_0x548cd9){try{jsonpatch[_0xecad('0x21')](_0x548cd9,_0x3f81aa,!![]);}catch(_0x31804e){return BPromise[_0xecad('0x22')](_0x31804e);}return _0x548cd9[_0xecad('0x23')]();};}function saveUpdates(_0x1655b9,_0x5cad10){return function(_0x406db5){if(_0x406db5){return _0x406db5['update'](_0x1655b9)['then'](function(_0x275aab){return _0x275aab;});}return null;};}function removeEntity(_0x55bfc6,_0x4a7cdc){return function(_0x168dc8){if(_0x168dc8){return _0x168dc8['destroy']()[_0xecad('0x24')](function(){_0x55bfc6[_0xecad('0x19')](0xcc)[_0xecad('0x1a')]();});}};}function handleEntityNotFound(_0x2d06c7,_0x3ffa67){return function(_0x302776){if(!_0x302776){_0x2d06c7[_0xecad('0x18')](0x194);}return _0x302776;};}function handleError(_0x551020,_0x12d799){_0x12d799=_0x12d799||0x1f4;return function(_0x3cbbbb){logger['error'](_0x3cbbbb['stack']);if(_0x3cbbbb[_0xecad('0x25')]){delete _0x3cbbbb[_0xecad('0x25')];}_0x551020[_0xecad('0x19')](_0x12d799)[_0xecad('0x26')](_0x3cbbbb);};}exports[_0xecad('0x27')]=function(_0x4627c9,_0x1cf613){var _0x3cd8f4={},_0x5864c2={},_0x2287f8={'count':0x0,'rows':[]};var _0x500bc7=_['map'](db[_0xecad('0x28')][_0xecad('0x29')],function(_0x4fb0b6){return{'name':_0x4fb0b6['fieldName'],'type':_0x4fb0b6[_0xecad('0x2a')]['key']};});_0x5864c2[_0xecad('0x2b')]=_[_0xecad('0x2c')](_0x500bc7,_0xecad('0x25'));_0x5864c2[_0xecad('0x2d')]=_[_0xecad('0x2e')](_0x4627c9['query']);_0x5864c2[_0xecad('0x2f')]=_[_0xecad('0x30')](_0x5864c2[_0xecad('0x2b')],_0x5864c2[_0xecad('0x2d')]);_0x3cd8f4[_0xecad('0x31')]=_[_0xecad('0x30')](_0x5864c2[_0xecad('0x2b')],qs[_0xecad('0x32')](_0x4627c9[_0xecad('0x2d')]['fields']));_0x3cd8f4['attributes']=_0x3cd8f4[_0xecad('0x31')]['length']?_0x3cd8f4[_0xecad('0x31')]:_0x5864c2[_0xecad('0x2b')];if(!_0x4627c9[_0xecad('0x2d')][_0xecad('0x33')](_0xecad('0x34'))){_0x3cd8f4['limit']=qs[_0xecad('0x1d')](_0x4627c9['query'][_0xecad('0x1d')]);_0x3cd8f4[_0xecad('0x1c')]=qs[_0xecad('0x1c')](_0x4627c9[_0xecad('0x2d')][_0xecad('0x1c')]);}_0x3cd8f4[_0xecad('0x35')]=qs[_0xecad('0x36')](_0x4627c9['query'][_0xecad('0x36')]);_0x3cd8f4[_0xecad('0x37')]=qs['filters'](_[_0xecad('0x38')](_0x4627c9[_0xecad('0x2d')],_0x5864c2[_0xecad('0x2f')]),_0x500bc7);if(_0x4627c9['query'][_0xecad('0x39')]){_0x3cd8f4['where']=_[_0xecad('0x3a')](_0x3cd8f4['where'],{'$or':_[_0xecad('0x2c')](_0x500bc7,function(_0x8701fd){if(_0x8701fd[_0xecad('0x2a')]!==_0xecad('0x3b')){var _0x170c33={};_0x170c33[_0x8701fd[_0xecad('0x25')]]={'$like':'%'+_0x4627c9['query'][_0xecad('0x39')]+'%'};return _0x170c33;}})});}_0x3cd8f4=_[_0xecad('0x3a')]({},_0x3cd8f4,_0x4627c9[_0xecad('0x3c')]);var _0xbeb175={'where':_0x3cd8f4[_0xecad('0x37')]};return db['UserProfileSection']['count'](_0xbeb175)[_0xecad('0x24')](function(_0x58e01c){_0x2287f8['count']=_0x58e01c;if(_0x4627c9[_0xecad('0x2d')][_0xecad('0x3d')]){_0x3cd8f4['include']=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x3cd8f4);})[_0xecad('0x24')](function(_0x53a268){_0x2287f8[_0xecad('0x3e')]=_0x53a268;return _0x2287f8;})['then'](respondWithFilteredResult(_0x1cf613,_0x3cd8f4))[_0xecad('0x3f')](handleError(_0x1cf613,null));};exports[_0xecad('0x40')]=function(_0x14cbcf,_0x5b907e){var _0x5eecf7={'raw':![],'where':{'id':_0x14cbcf['params']['id']}},_0x45bc7b={};_0x45bc7b['model']=_[_0xecad('0x2e')](db[_0xecad('0x28')][_0xecad('0x29')]);_0x45bc7b[_0xecad('0x2d')]=_[_0xecad('0x2e')](_0x14cbcf[_0xecad('0x2d')]);_0x45bc7b[_0xecad('0x2f')]=_[_0xecad('0x30')](_0x45bc7b[_0xecad('0x2b')],_0x45bc7b['query']);_0x5eecf7[_0xecad('0x31')]=_[_0xecad('0x30')](_0x45bc7b['model'],qs[_0xecad('0x32')](_0x14cbcf['query'][_0xecad('0x32')]));_0x5eecf7[_0xecad('0x31')]=_0x5eecf7['attributes']['length']?_0x5eecf7[_0xecad('0x31')]:_0x45bc7b['model'];if(_0x14cbcf[_0xecad('0x2d')]['includeAll']){_0x5eecf7['include']=[{'all':!![]}];}_0x5eecf7=_[_0xecad('0x3a')]({},_0x5eecf7,_0x14cbcf[_0xecad('0x3c')]);return db['UserProfileSection']['find'](_0x5eecf7)[_0xecad('0x24')](handleEntityNotFound(_0x5b907e,null))['then'](respondWithResult(_0x5b907e,null))[_0xecad('0x3f')](handleError(_0x5b907e,null));};exports['create']=function(_0x4ee2e2,_0x21cf52){return db[_0xecad('0x28')][_0xecad('0x41')](_0x4ee2e2['body'],{})[_0xecad('0x24')](respondWithResult(_0x21cf52,0xc9))[_0xecad('0x3f')](handleError(_0x21cf52,null));};exports[_0xecad('0x42')]=function(_0x38e073,_0x308b98){if(_0x38e073[_0xecad('0x43')]['id']){delete _0x38e073[_0xecad('0x43')]['id'];}return db[_0xecad('0x28')][_0xecad('0x44')]({'where':{'id':_0x38e073[_0xecad('0x45')]['id']}})[_0xecad('0x24')](handleEntityNotFound(_0x308b98,null))['then'](saveUpdates(_0x38e073['body'],null))[_0xecad('0x24')](respondWithResult(_0x308b98,null))[_0xecad('0x3f')](handleError(_0x308b98,null));};exports[_0xecad('0x46')]=function(_0x56eaeb,_0x32a7cf){return db[_0xecad('0x28')][_0xecad('0x44')]({'where':{'id':_0x56eaeb[_0xecad('0x45')]['id']}})['then'](handleEntityNotFound(_0x32a7cf,null))['then'](removeEntity(_0x32a7cf,null))[_0xecad('0x3f')](handleError(_0x32a7cf,null));};exports[_0xecad('0x47')]=function(_0x3e0304,_0x255260){return db[_0xecad('0x28')][_0xecad('0x47')]()['then'](respondWithResult(_0x255260,null))['catch'](handleError(_0x255260,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 61a752c..0acd738 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 _0x3c7b=['exports','define','UserProfileSection','user_profile_has_sections','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes'];(function(_0x10a548,_0x26a534){var _0x2a8b3b=function(_0x540934){while(--_0x540934){_0x10a548['push'](_0x10a548['shift']());}};_0x2a8b3b(++_0x26a534);}(_0x3c7b,0x1e0));var _0xb3c7=function(_0x512a1c,_0x344f83){_0x512a1c=_0x512a1c-0x0;var _0x29074e=_0x3c7b[_0x512a1c];return _0x29074e;};'use strict';var _=require(_0xb3c7('0x0'));var util=require(_0xb3c7('0x1'));var logger=require(_0xb3c7('0x2'))(_0xb3c7('0x3'));var moment=require(_0xb3c7('0x4'));var BPromise=require(_0xb3c7('0x5'));var rp=require(_0xb3c7('0x6'));var fs=require('fs');var path=require(_0xb3c7('0x7'));var rimraf=require(_0xb3c7('0x8'));var config=require('../../config/environment');var attributes=require(_0xb3c7('0x9'));module[_0xb3c7('0xa')]=function(_0x67cac8,_0x43ae0b){return _0x67cac8[_0xb3c7('0xb')](_0xb3c7('0xc'),attributes,{'tableName':_0xb3c7('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['sectionId','userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x05e2=['path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4256a1,_0x1b593a){var _0x2a4f89=function(_0x5c5482){while(--_0x5c5482){_0x4256a1['push'](_0x4256a1['shift']());}};_0x2a4f89(++_0x1b593a);}(_0x05e2,0x179));var _0x205e=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x05e2[_0x3238ea];return _0x4aaac2;};'use strict';var _=require(_0x205e('0x0'));var util=require(_0x205e('0x1'));var logger=require(_0x205e('0x2'))(_0x205e('0x3'));var moment=require(_0x205e('0x4'));var BPromise=require(_0x205e('0x5'));var rp=require(_0x205e('0x6'));var fs=require('fs');var path=require(_0x205e('0x7'));var rimraf=require('rimraf');var config=require(_0x205e('0x8'));var attributes=require(_0x205e('0x9'));module[_0x205e('0xa')]=function(_0x3c439b,_0x1363f0){return _0x3c439b[_0x205e('0xb')](_0x205e('0xc'),attributes,{'tableName':_0x205e('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x205e('0xe'),_0x205e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index fc80609..1eaa760 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 _0x4627=['../../config/logger','rpc','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x4627,0xa0));var _0x7462=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x4627[_0x1db251];return _0x56685a;};'use strict';var _=require(_0x7462('0x0'));var util=require(_0x7462('0x1'));var moment=require(_0x7462('0x2'));var BPromise=require(_0x7462('0x3'));var rs=require(_0x7462('0x4'));var fs=require('fs');var Redis=require(_0x7462('0x5'));var db=require(_0x7462('0x6'))['db'];var utils=require(_0x7462('0x7'));var logger=require(_0x7462('0x8'))(_0x7462('0x9'));var config=require('../../config/environment');var jayson=require(_0x7462('0xa'));var client=jayson[_0x7462('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48ef92,_0x2160ad,_0x25faf8){return new BPromise(function(_0x2e0ba3,_0x287e17){return client[_0x7462('0xc')](_0x48ef92,_0x25faf8)[_0x7462('0xd')](function(_0x2d8757){logger[_0x7462('0xe')](_0x7462('0xf'),_0x2160ad,_0x7462('0x10'));logger[_0x7462('0x11')](_0x7462('0x12'),_0x2160ad,_0x7462('0x10'),JSON[_0x7462('0x13')](_0x2d8757));if(_0x2d8757[_0x7462('0x14')]){if(_0x2d8757[_0x7462('0x14')][_0x7462('0x15')]===0x1f4){logger[_0x7462('0x14')](_0x7462('0xf'),_0x2160ad,_0x2d8757[_0x7462('0x14')][_0x7462('0x16')]);return _0x287e17(_0x2d8757['error'][_0x7462('0x16')]);}logger[_0x7462('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x2160ad,_0x2d8757[_0x7462('0x14')][_0x7462('0x16')]);return _0x2e0ba3(_0x2d8757['error']['message']);}else{logger['info'](_0x7462('0xf'),_0x2160ad,_0x7462('0x10'));_0x2e0ba3(_0x2d8757['result'][_0x7462('0x16')]);}})[_0x7462('0x17')](function(_0x1e2bec){logger[_0x7462('0x14')](_0x7462('0xf'),_0x2160ad,_0x1e2bec);_0x287e17(_0x1e2bec);});});} \ No newline at end of file +var _0xe5e5=['error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4a4c4f,_0x2de179){var _0x11d741=function(_0x1d7739){while(--_0x1d7739){_0x4a4c4f['push'](_0x4a4c4f['shift']());}};_0x11d741(++_0x2de179);}(_0xe5e5,0x7c));var _0x5e5e=function(_0x10102c,_0x56ed26){_0x10102c=_0x10102c-0x0;var _0x51a161=_0xe5e5[_0x10102c];return _0x51a161;};'use strict';var _=require(_0x5e5e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5e5e('0x1'));var rs=require(_0x5e5e('0x2'));var fs=require('fs');var Redis=require(_0x5e5e('0x3'));var db=require(_0x5e5e('0x4'))['db'];var utils=require(_0x5e5e('0x5'));var logger=require(_0x5e5e('0x6'))(_0x5e5e('0x7'));var config=require(_0x5e5e('0x8'));var jayson=require(_0x5e5e('0x9'));var client=jayson[_0x5e5e('0xa')][_0x5e5e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2336ec,_0x179979,_0x5e9ed7){return new BPromise(function(_0x6b4779,_0x44be9d){return client[_0x5e5e('0xc')](_0x2336ec,_0x5e9ed7)[_0x5e5e('0xd')](function(_0x59e38b){logger[_0x5e5e('0xe')](_0x5e5e('0xf'),_0x179979,_0x5e5e('0x10'));logger[_0x5e5e('0x11')](_0x5e5e('0x12'),_0x179979,'request\x20sent',JSON[_0x5e5e('0x13')](_0x59e38b));if(_0x59e38b[_0x5e5e('0x14')]){if(_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x15')]===0x1f4){logger[_0x5e5e('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x179979,_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x16')]);return _0x44be9d(_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x16')]);}logger[_0x5e5e('0x14')](_0x5e5e('0xf'),_0x179979,_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x16')]);return _0x6b4779(_0x59e38b[_0x5e5e('0x14')][_0x5e5e('0x16')]);}else{logger[_0x5e5e('0xe')](_0x5e5e('0xf'),_0x179979,_0x5e5e('0x10'));_0x6b4779(_0x59e38b[_0x5e5e('0x17')]['message']);}})['catch'](function(_0xfcd63b){logger[_0x5e5e('0x14')](_0x5e5e('0xf'),_0x179979,_0xfcd63b);_0x44be9d(_0xfcd63b);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index b7b9137..3fff5e5 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x185067,_0x3881af){var _0x455b6e=function(_0x1e0494){while(--_0x1e0494){_0x185067['push'](_0x185067['shift']());}};_0x455b6e(++_0x3881af);}(_0xe706,0xa3));var _0x6e70=function(_0x486f1d,_0x90c2b5){_0x486f1d=_0x486f1d-0x0;var _0x5a2c2d=_0xe706[_0x486f1d];return _0x5a2c2d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x402baf,_0x1ef0ba){var _0x1974d8=function(_0x36a33f){while(--_0x36a33f){_0x402baf['push'](_0x402baf['shift']());}};_0x1974d8(++_0x1ef0ba);}(_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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 2b88c28..dd68b58 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 _0x297d=['sequelize'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0x297d,0x157));var _0xd297=function(_0xfbc991,_0x67c37e){_0xfbc991=_0xfbc991-0x0;var _0xe60518=_0x297d[_0xfbc991];return _0xe60518;};'use strict';var Sequelize=require(_0xd297('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x80c9=['sequelize','exports','INTEGER'];(function(_0x2bb2d2,_0x4b05a7){var _0x325ef1=function(_0x5d2424){while(--_0x5d2424){_0x2bb2d2['push'](_0x2bb2d2['shift']());}};_0x325ef1(++_0x4b05a7);}(_0x80c9,0xba));var _0x980c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80c9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x980c('0x0'));module[_0x980c('0x1')]={'penalty':{'type':Sequelize[_0x980c('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 1ee673e..d0bb4ea 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 _0xafc4=['path','exports','define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xafc4,0x69));var _0x4afc=function(_0x358ac6,_0x5b0a50){_0x358ac6=_0x358ac6-0x0;var _0x20a09f=_0xafc4[_0x358ac6];return _0x20a09f;};'use strict';var _=require(_0x4afc('0x0'));var util=require('util');var logger=require(_0x4afc('0x1'))('api');var moment=require(_0x4afc('0x2'));var BPromise=require(_0x4afc('0x3'));var rp=require(_0x4afc('0x4'));var fs=require('fs');var path=require(_0x4afc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module[_0x4afc('0x6')]=function(_0x471d45,_0x16953b){return _0x471d45[_0x4afc('0x7')](_0x4afc('0x8'),attributes,{'tableName':_0x4afc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eba=['user_has_sms_queues','util','../../config/logger','api','moment','path','../../config/environment','./userSmsQueue.attributes','exports'];(function(_0x13409a,_0x8f949e){var _0x12815b=function(_0x4ee9ab){while(--_0x4ee9ab){_0x13409a['push'](_0x13409a['shift']());}};_0x12815b(++_0x8f949e);}(_0x2eba,0xc7));var _0xa2eb=function(_0x45c8b7,_0x537706){_0x45c8b7=_0x45c8b7-0x0;var _0x144cb6=_0x2eba[_0x45c8b7];return _0x144cb6;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var logger=require(_0xa2eb('0x1'))(_0xa2eb('0x2'));var moment=require(_0xa2eb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa2eb('0x4'));var rimraf=require('rimraf');var config=require(_0xa2eb('0x5'));var attributes=require(_0xa2eb('0x6'));module[_0xa2eb('0x7')]=function(_0x1e6fa2,_0x575a5c){return _0x1e6fa2['define']('UserSmsQueue',attributes,{'tableName':_0xa2eb('0x8'),'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 53b44f3..dc8298a 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 _0x787f=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then'];(function(_0x3a0579,_0x17d535){var _0xa6faf3=function(_0x17a11b){while(--_0x17a11b){_0x3a0579['push'](_0x3a0579['shift']());}};_0xa6faf3(++_0x17d535);}(_0x787f,0x1ea));var _0xf787=function(_0x51e79c,_0x51485e){_0x51e79c=_0x51e79c-0x0;var _0x2467be=_0x787f[_0x51e79c];return _0x2467be;};'use strict';var _=require(_0xf787('0x0'));var util=require(_0xf787('0x1'));var moment=require(_0xf787('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf787('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf787('0x4'));var logger=require(_0xf787('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf787('0x6'));var client=jayson['client'][_0xf787('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57db75,_0x40f508,_0x1f367d){return new BPromise(function(_0x448fb6,_0x4373ed){return client[_0xf787('0x8')](_0x57db75,_0x1f367d)[_0xf787('0x9')](function(_0x3893e4){logger['info'](_0xf787('0xa'),_0x40f508,_0xf787('0xb'));logger[_0xf787('0xc')](_0xf787('0xd'),_0x40f508,_0xf787('0xb'),JSON[_0xf787('0xe')](_0x3893e4));if(_0x3893e4[_0xf787('0xf')]){if(_0x3893e4[_0xf787('0xf')]['code']===0x1f4){logger['error'](_0xf787('0xa'),_0x40f508,_0x3893e4[_0xf787('0xf')][_0xf787('0x10')]);return _0x4373ed(_0x3893e4[_0xf787('0xf')][_0xf787('0x10')]);}logger[_0xf787('0xf')](_0xf787('0xa'),_0x40f508,_0x3893e4[_0xf787('0xf')][_0xf787('0x10')]);return _0x448fb6(_0x3893e4[_0xf787('0xf')][_0xf787('0x10')]);}else{logger[_0xf787('0x11')](_0xf787('0xa'),_0x40f508,_0xf787('0xb'));_0x448fb6(_0x3893e4[_0xf787('0x12')][_0xf787('0x10')]);}})[_0xf787('0x13')](function(_0x3a0f32){logger[_0xf787('0xf')](_0xf787('0xa'),_0x40f508,_0x3a0f32);_0x4373ed(_0x3a0f32);});});} \ No newline at end of file +var _0xa7f6=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4e1a7f,_0x150206){var _0x21148b=function(_0x51b15b){while(--_0x51b15b){_0x4e1a7f['push'](_0x4e1a7f['shift']());}};_0x21148b(++_0x150206);}(_0xa7f6,0x108));var _0x6a7f=function(_0x2800b5,_0x419221){_0x2800b5=_0x2800b5-0x0;var _0x405ae5=_0xa7f6[_0x2800b5];return _0x405ae5;};'use strict';var _=require(_0x6a7f('0x0'));var util=require(_0x6a7f('0x1'));var moment=require('moment');var BPromise=require(_0x6a7f('0x2'));var rs=require(_0x6a7f('0x3'));var fs=require('fs');var Redis=require(_0x6a7f('0x4'));var db=require(_0x6a7f('0x5'))['db'];var utils=require(_0x6a7f('0x6'));var logger=require(_0x6a7f('0x7'))(_0x6a7f('0x8'));var config=require(_0x6a7f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6a7f('0xa')][_0x6a7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c7590,_0x2a2618,_0xec28b7){return new BPromise(function(_0x2aa34f,_0x4fca19){return client['request'](_0x4c7590,_0xec28b7)[_0x6a7f('0xc')](function(_0x27e9f9){logger[_0x6a7f('0xd')](_0x6a7f('0xe'),_0x2a2618,_0x6a7f('0xf'));logger[_0x6a7f('0x10')](_0x6a7f('0x11'),_0x2a2618,_0x6a7f('0xf'),JSON[_0x6a7f('0x12')](_0x27e9f9));if(_0x27e9f9['error']){if(_0x27e9f9[_0x6a7f('0x13')][_0x6a7f('0x14')]===0x1f4){logger['error'](_0x6a7f('0xe'),_0x2a2618,_0x27e9f9['error'][_0x6a7f('0x15')]);return _0x4fca19(_0x27e9f9['error']['message']);}logger[_0x6a7f('0x13')](_0x6a7f('0xe'),_0x2a2618,_0x27e9f9[_0x6a7f('0x13')][_0x6a7f('0x15')]);return _0x2aa34f(_0x27e9f9[_0x6a7f('0x13')][_0x6a7f('0x15')]);}else{logger[_0x6a7f('0xd')](_0x6a7f('0xe'),_0x2a2618,_0x6a7f('0xf'));_0x2aa34f(_0x27e9f9['result']['message']);}})['catch'](function(_0x559bbf){logger[_0x6a7f('0x13')](_0x6a7f('0xe'),_0x2a2618,_0x559bbf);_0x4fca19(_0x559bbf);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 83a96ec..2956b37 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 _0xe3db=['INTEGER','sequelize'];(function(_0x2fdc55,_0x205f53){var _0x12d2a8=function(_0x575289){while(--_0x575289){_0x2fdc55['push'](_0x2fdc55['shift']());}};_0x12d2a8(++_0x205f53);}(_0xe3db,0x1c3));var _0xbe3d=function(_0x15fab1,_0x49e5e0){_0x15fab1=_0x15fab1-0x0;var _0x374ccd=_0xe3db[_0x15fab1];return _0x374ccd;};'use strict';var Sequelize=require(_0xbe3d('0x0'));module['exports']={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xbe3d('0x1')]}}; \ No newline at end of file +var _0xefbe=['sequelize','INTEGER'];(function(_0x5046cf,_0x44c493){var _0x2fb819=function(_0x412a83){while(--_0x412a83){_0x5046cf['push'](_0x5046cf['shift']());}};_0x2fb819(++_0x44c493);}(_0xefbe,0x15a));var _0xeefb=function(_0x185791,_0x13e9ac){_0x185791=_0x185791-0x0;var _0x3a605e=_0xefbe[_0x185791];return _0x3a605e;};'use strict';var Sequelize=require(_0xeefb('0x0'));module['exports']={'UserId':{'type':Sequelize[_0xeefb('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index ad12f3c..9f1a55c 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(_0x209fd2,_0x3cc08a){var _0x21bcbb=function(_0x46d600){while(--_0x46d600){_0x209fd2['push'](_0x209fd2['shift']());}};_0x21bcbb(++_0x3cc08a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x58a4a0,_0x99cd94){var _0x21f5d0=function(_0x56e235){while(--_0x56e235){_0x58a4a0['push'](_0x58a4a0['shift']());}};_0x21f5d0(++_0x99cd94);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 fce8551..e01d799 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5d6bef,_0x25b68d){var _0x2b7826=function(_0x5c3a59){while(--_0x5c3a59){_0x5d6bef['push'](_0x5d6bef['shift']());}};_0x2b7826(++_0x25b68d);}(_0x70e0,0x17b));var _0x070e=function(_0x4cdffd,_0xa325f1){_0x4cdffd=_0x4cdffd-0x0;var _0xf31be6=_0x70e0[_0x4cdffd];return _0xf31be6;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6e75f9,_0xafb397){var _0x2d78e5=function(_0x4e970f){while(--_0x4e970f){_0x6e75f9['push'](_0x6e75f9['shift']());}};_0x2d78e5(++_0xafb397);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d41785a..86f931a 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 _0x2d5b=['exports','INTEGER'];(function(_0x3f64ba,_0x2afe32){var _0x2b5d08=function(_0x128ba8){while(--_0x128ba8){_0x3f64ba['push'](_0x3f64ba['shift']());}};_0x2b5d08(++_0x2afe32);}(_0x2d5b,0x1ce));var _0xb2d5=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0x2d5b[_0x3403d5];return _0xf9df4f;};'use strict';var Sequelize=require('sequelize');module[_0xb2d5('0x0')]={'penalty':{'type':Sequelize[_0xb2d5('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x44d8=['exports','sequelize'];(function(_0x5e06db,_0x9741fd){var _0xb4424b=function(_0x25473e){while(--_0x25473e){_0x5e06db['push'](_0x5e06db['shift']());}};_0xb4424b(++_0x9741fd);}(_0x44d8,0x9b));var _0x844d=function(_0x45f4bc,_0x2369bb){_0x45f4bc=_0x45f4bc-0x0;var _0x40d14b=_0x44d8[_0x45f4bc];return _0x40d14b;};'use strict';var Sequelize=require(_0x844d('0x0'));module[_0x844d('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index a5dfb06..9e937a6 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 _0xd408=['lodash','util','api','moment','bluebird','path','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0xd408,0x113));var _0x8d40=function(_0x581abc,_0x55677e){_0x581abc=_0x581abc-0x0;var _0x192c82=_0xd408[_0x581abc];return _0x192c82;};'use strict';var _=require(_0x8d40('0x0'));var util=require(_0x8d40('0x1'));var logger=require('../../config/logger')(_0x8d40('0x2'));var moment=require(_0x8d40('0x3'));var BPromise=require(_0x8d40('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8d40('0x5'));var rimraf=require('rimraf');var config=require(_0x8d40('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x8d40('0x7')]=function(_0x48538e,_0x5a7259){return _0x48538e[_0x8d40('0x8')](_0x8d40('0x9'),attributes,{'tableName':_0x8d40('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe896=['request-promise','path','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','bluebird'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0xe896,0x119));var _0x6e89=function(_0x196f82,_0x48eeb5){_0x196f82=_0x196f82-0x0;var _0x140382=_0xe896[_0x196f82];return _0x140382;};'use strict';var _=require(_0x6e89('0x0'));var util=require(_0x6e89('0x1'));var logger=require('../../config/logger')(_0x6e89('0x2'));var moment=require(_0x6e89('0x3'));var BPromise=require(_0x6e89('0x4'));var rp=require(_0x6e89('0x5'));var fs=require('fs');var path=require(_0x6e89('0x6'));var rimraf=require(_0x6e89('0x7'));var config=require('../../config/environment');var attributes=require(_0x6e89('0x8'));module[_0x6e89('0x9')]=function(_0x5a3b81,_0x123463){return _0x5a3b81[_0x6e89('0xa')](_0x6e89('0xb'),attributes,{'tableName':_0x6e89('0xc'),'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 2fe7222..a930d6d 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 _0xa6eb=['stringify','error','code','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x189e42,_0x280d1a){var _0x2c99ee=function(_0x58e168){while(--_0x58e168){_0x189e42['push'](_0x189e42['shift']());}};_0x2c99ee(++_0x280d1a);}(_0xa6eb,0x1e9));var _0xba6e=function(_0x4cb93c,_0x40ddc1){_0x4cb93c=_0x4cb93c-0x0;var _0x3107af=_0xa6eb[_0x4cb93c];return _0x3107af;};'use strict';var _=require(_0xba6e('0x0'));var util=require(_0xba6e('0x1'));var moment=require(_0xba6e('0x2'));var BPromise=require('bluebird');var rs=require(_0xba6e('0x3'));var fs=require('fs');var Redis=require(_0xba6e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xba6e('0x5'));var logger=require('../../config/logger')(_0xba6e('0x6'));var config=require(_0xba6e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba6e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe94bfb,_0x36f841,_0x1a2583){return new BPromise(function(_0x47a48d,_0x2ef2cc){return client[_0xba6e('0x9')](_0xe94bfb,_0x1a2583)[_0xba6e('0xa')](function(_0x1421c3){logger['info'](_0xba6e('0xb'),_0x36f841,_0xba6e('0xc'));logger[_0xba6e('0xd')](_0xba6e('0xe'),_0x36f841,_0xba6e('0xc'),JSON[_0xba6e('0xf')](_0x1421c3));if(_0x1421c3[_0xba6e('0x10')]){if(_0x1421c3[_0xba6e('0x10')][_0xba6e('0x11')]===0x1f4){logger[_0xba6e('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x36f841,_0x1421c3['error']['message']);return _0x2ef2cc(_0x1421c3[_0xba6e('0x10')][_0xba6e('0x12')]);}logger[_0xba6e('0x10')](_0xba6e('0xb'),_0x36f841,_0x1421c3['error'][_0xba6e('0x12')]);return _0x47a48d(_0x1421c3[_0xba6e('0x10')][_0xba6e('0x12')]);}else{logger[_0xba6e('0x13')](_0xba6e('0xb'),_0x36f841,'request\x20sent');_0x47a48d(_0x1421c3['result'][_0xba6e('0x12')]);}})[_0xba6e('0x14')](function(_0x588d58){logger[_0xba6e('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x36f841,_0x588d58);_0x2ef2cc(_0x588d58);});});} \ No newline at end of file +var _0xe63b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x47d689,_0x42f62b){var _0x570f3d=function(_0x37cb76){while(--_0x37cb76){_0x47d689['push'](_0x47d689['shift']());}};_0x570f3d(++_0x42f62b);}(_0xe63b,0x16a));var _0xbe63=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0xe63b[_0x211632];return _0x5a1da1;};'use strict';var _=require(_0xbe63('0x0'));var util=require(_0xbe63('0x1'));var moment=require(_0xbe63('0x2'));var BPromise=require(_0xbe63('0x3'));var rs=require(_0xbe63('0x4'));var fs=require('fs');var Redis=require(_0xbe63('0x5'));var db=require(_0xbe63('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe63('0x7'))(_0xbe63('0x8'));var config=require(_0xbe63('0x9'));var jayson=require(_0xbe63('0xa'));var client=jayson['client'][_0xbe63('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14be5b,_0x5d0e00,_0x3e83b6){return new BPromise(function(_0x5007bc,_0x55652c){return client[_0xbe63('0xc')](_0x14be5b,_0x3e83b6)['then'](function(_0x30c7b3){logger[_0xbe63('0xd')](_0xbe63('0xe'),_0x5d0e00,_0xbe63('0xf'));logger['debug'](_0xbe63('0x10'),_0x5d0e00,_0xbe63('0xf'),JSON[_0xbe63('0x11')](_0x30c7b3));if(_0x30c7b3[_0xbe63('0x12')]){if(_0x30c7b3[_0xbe63('0x12')][_0xbe63('0x13')]===0x1f4){logger['error'](_0xbe63('0xe'),_0x5d0e00,_0x30c7b3[_0xbe63('0x12')][_0xbe63('0x14')]);return _0x55652c(_0x30c7b3[_0xbe63('0x12')][_0xbe63('0x14')]);}logger['error'](_0xbe63('0xe'),_0x5d0e00,_0x30c7b3[_0xbe63('0x12')]['message']);return _0x5007bc(_0x30c7b3['error']['message']);}else{logger[_0xbe63('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x5d0e00,_0xbe63('0xf'));_0x5007bc(_0x30c7b3[_0xbe63('0x15')]['message']);}})[_0xbe63('0x16')](function(_0x22e3ec){logger[_0xbe63('0x12')](_0xbe63('0xe'),_0x5d0e00,_0x22e3ec);_0x55652c(_0x22e3ec);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 70bb517..318e03c 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x96e457,_0x44f424){var _0x186bd0=function(_0x133bd4){while(--_0x133bd4){_0x96e457['push'](_0x96e457['shift']());}};_0x186bd0(++_0x44f424);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e182f,_0x380ec7){_0x3e182f=_0x3e182f-0x0;var _0x23edc9=_0xcb91[_0x3e182f];return _0x23edc9;};'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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x56eda8,_0x5189fb){var _0x2a1c58=function(_0x1bc8bf){while(--_0x1bc8bf){_0x56eda8['push'](_0x56eda8['shift']());}};_0x2a1c58(++_0x5189fb);}(_0x70e0,0x17b));var _0x070e=function(_0x3c8024,_0xc27256){_0x3c8024=_0x3c8024-0x0;var _0x2b855c=_0x70e0[_0x3c8024];return _0x2b855c;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 29c256f..994a7fb 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 _0x356e=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x356e,0x1dc));var _0xe356=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x356e[_0x46a38b];return _0x346e75;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe356('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xe356('0x1')},'membername':{'type':Sequelize[_0xe356('0x2')],'allowNull':![],'comment':_0xe356('0x1')},'UserId':{'type':Sequelize[_0xe356('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe356('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0xe356('0x1')},'VoiceQueueId':{'type':Sequelize[_0xe356('0x0')],'allowNull':![]},'interface':{'type':Sequelize[_0xe356('0x2')],'allowNull':![],'unique':_0xe356('0x3'),'comment':_0xe356('0x1')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xe356('0x1')},'paused':{'type':Sequelize[_0xe356('0x0')](0xb),'defaultValue':0x0,'comment':_0xe356('0x1')}}; \ No newline at end of file +var _0x0880=['INTEGER','STRING','queue_interface','Required\x20by\x20Asterisk','sequelize'];(function(_0x14b26d,_0x225458){var _0x3c0d47=function(_0x580640){while(--_0x580640){_0x14b26d['push'](_0x14b26d['shift']());}};_0x3c0d47(++_0x225458);}(_0x0880,0x7c));var _0x0088=function(_0x4a7193,_0x556c6a){_0x4a7193=_0x4a7193-0x0;var _0xc33d94=_0x0880[_0x4a7193];return _0xc33d94;};'use strict';var Sequelize=require(_0x0088('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0088('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x0088('0x2')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0088('0x3'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x0088('0x1')](0xb),'defaultValue':0x0,'comment':_0x0088('0x4')},'paused':{'type':Sequelize[_0x0088('0x1')](0xb),'defaultValue':0x0,'comment':_0x0088('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index ee06b31..45dc56e 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 _0xf17e=['UserVoiceQueueRt','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x84fa15,_0x370960){var _0x125cfc=function(_0x1106f6){while(--_0x1106f6){_0x84fa15['push'](_0x84fa15['shift']());}};_0x125cfc(++_0x370960);}(_0xf17e,0x7c));var _0xef17=function(_0x93a5f6,_0x3cb97e){_0x93a5f6=_0x93a5f6-0x0;var _0x305f74=_0xf17e[_0x93a5f6];return _0x305f74;};'use strict';var EventEmitter=require(_0xef17('0x0'));var UserVoiceQueueRt=require(_0xef17('0x1'))['db'][_0xef17('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xef17('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef17('0x4'),'afterDestroy':_0xef17('0x5')};function emitEvent(_0x437556){return function(_0xcf5993,_0x5b2dd5,_0x431ba1){UserVoiceQueueRtEvents['emit'](_0x437556+':'+_0xcf5993['id'],_0xcf5993);UserVoiceQueueRtEvents[_0xef17('0x6')](_0x437556,_0xcf5993);_0x431ba1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xef17('0x7')](e,emitEvent(event));}}module[_0xef17('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x38f1=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x50ca77,_0xaf6074){var _0x5a7eff=function(_0x3e26f2){while(--_0x3e26f2){_0x50ca77['push'](_0x50ca77['shift']());}};_0x5a7eff(++_0xaf6074);}(_0x38f1,0xef));var _0x138f=function(_0x42817d,_0x17482f){_0x42817d=_0x42817d-0x0;var _0x2edeb1=_0x38f1[_0x42817d];return _0x2edeb1;};'use strict';var EventEmitter=require(_0x138f('0x0'));var UserVoiceQueueRt=require(_0x138f('0x1'))['db'][_0x138f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x138f('0x3')](0x0);var events={'afterCreate':_0x138f('0x4'),'afterUpdate':_0x138f('0x5'),'afterDestroy':_0x138f('0x6')};function emitEvent(_0xeb6dfe){return function(_0x368c08,_0x2b674b,_0x26f3c8){UserVoiceQueueRtEvents[_0x138f('0x7')](_0xeb6dfe+':'+_0x368c08['id'],_0x368c08);UserVoiceQueueRtEvents[_0x138f('0x7')](_0xeb6dfe,_0x368c08);_0x26f3c8(null);};}for(var e in events){if(events[_0x138f('0x8')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 7db48bf..45f8f32 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 _0xc324=['./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x39b307,_0x485a20){var _0xc39d31=function(_0x2d638d){while(--_0x2d638d){_0x39b307['push'](_0x39b307['shift']());}};_0xc39d31(++_0x485a20);}(_0xc324,0x7d));var _0x4c32=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc324[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c32('0x0'));var util=require(_0x4c32('0x1'));var logger=require(_0x4c32('0x2'))(_0x4c32('0x3'));var moment=require(_0x4c32('0x4'));var BPromise=require(_0x4c32('0x5'));var rp=require(_0x4c32('0x6'));var fs=require('fs');var path=require(_0x4c32('0x7'));var rimraf=require(_0x4c32('0x8'));var config=require(_0x4c32('0x9'));var attributes=require(_0x4c32('0xa'));module[_0x4c32('0xb')]=function(_0x333b3c,_0x3f1f9f){return _0x333b3c[_0x4c32('0xc')](_0x4c32('0xd'),attributes,{'tableName':_0x4c32('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x528c=['rimraf','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x58caff,_0x4f7e01){var _0x2cdfdd=function(_0x3be9a){while(--_0x3be9a){_0x58caff['push'](_0x58caff['shift']());}};_0x2cdfdd(++_0x4f7e01);}(_0x528c,0x1a8));var _0xc528=function(_0x181aaa,_0x30c832){_0x181aaa=_0x181aaa-0x0;var _0xebacd2=_0x528c[_0x181aaa];return _0xebacd2;};'use strict';var _=require(_0xc528('0x0'));var util=require(_0xc528('0x1'));var logger=require(_0xc528('0x2'))(_0xc528('0x3'));var moment=require(_0xc528('0x4'));var BPromise=require(_0xc528('0x5'));var rp=require(_0xc528('0x6'));var fs=require('fs');var path=require(_0xc528('0x7'));var rimraf=require(_0xc528('0x8'));var config=require('../../config/environment');var attributes=require(_0xc528('0x9'));module[_0xc528('0xa')]=function(_0x41716a,_0x20eb74){return _0x41716a['define'](_0xc528('0xb'),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 63e3f13..23e7277 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 _0x75ea=['options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','GetVoiceQueueRtPauses'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x75ea,0x93));var _0xa75e=function(_0xf0ae5f,_0x1eef94){_0xf0ae5f=_0xf0ae5f-0x0;var _0x38d55c=_0x75ea[_0xf0ae5f];return _0x38d55c;};'use strict';var _=require(_0xa75e('0x0'));var util=require(_0xa75e('0x1'));var moment=require(_0xa75e('0x2'));var BPromise=require(_0xa75e('0x3'));var rs=require(_0xa75e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa75e('0x5'));var logger=require(_0xa75e('0x6'))(_0xa75e('0x7'));var config=require(_0xa75e('0x8'));var jayson=require(_0xa75e('0x9'));var client=jayson[_0xa75e('0xa')][_0xa75e('0xb')]({'port':0x232a});config[_0xa75e('0xc')]=_[_0xa75e('0xd')](config[_0xa75e('0xc')],{'host':_0xa75e('0xe'),'port':0x18eb});var socket=require(_0xa75e('0xf'))(new Redis(config['redis']));require(_0xa75e('0x10'))[_0xa75e('0x11')](socket);function respondWithRpcPromise(_0x36da0b,_0x188262,_0x5e7b5a){return new BPromise(function(_0x3fcc46,_0x976447){return client['request'](_0x36da0b,_0x5e7b5a)[_0xa75e('0x12')](function(_0x253139){logger[_0xa75e('0x13')](_0xa75e('0x14'),_0x188262,_0xa75e('0x15'));logger[_0xa75e('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x188262,'request\x20sent',JSON[_0xa75e('0x17')](_0x253139));if(_0x253139['error']){if(_0x253139['error'][_0xa75e('0x18')]===0x1f4){logger[_0xa75e('0x19')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x188262,_0x253139[_0xa75e('0x19')][_0xa75e('0x1a')]);return _0x976447(_0x253139[_0xa75e('0x19')][_0xa75e('0x1a')]);}logger[_0xa75e('0x19')](_0xa75e('0x14'),_0x188262,_0x253139[_0xa75e('0x19')]['message']);return _0x3fcc46(_0x253139[_0xa75e('0x19')][_0xa75e('0x1a')]);}else{logger['info'](_0xa75e('0x14'),_0x188262,_0xa75e('0x15'));_0x3fcc46(_0x253139['result']['message']);}})['catch'](function(_0x2c0ea1){logger[_0xa75e('0x19')](_0xa75e('0x14'),_0x188262,_0x2c0ea1);_0x976447(_0x2c0ea1);});});}exports[_0xa75e('0x1b')]=function(_0x54ded8){var _0x3a3c18=this;return new Promise(function(_0x453f46,_0x5a2be3){return db['UserVoiceQueueRt']['findAll']({'raw':_0x54ded8['options']?_0x54ded8[_0xa75e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x54ded8[_0xa75e('0x1c')]?_0x54ded8[_0xa75e('0x1c')]['where']||null:null,'attributes':[[db[_0xa75e('0x1d')]['fn'](_0xa75e('0x1e'),db[_0xa75e('0x1d')]['fn']('IF',db[_0xa75e('0x1d')][_0xa75e('0x1f')](_0xa75e('0x20')))),_0xa75e('0x21')]]})['then'](function(_0x27c7cc){logger[_0xa75e('0x13')](_0xa75e('0x1b'),_0x54ded8);logger[_0xa75e('0x16')](_0xa75e('0x1b'),_0x54ded8,JSON[_0xa75e('0x17')](_0x27c7cc));_0x453f46(_0x27c7cc);})[_0xa75e('0x22')](function(_0x4d0bdb){logger['error'](_0xa75e('0x1b'),_0x4d0bdb['message'],_0x54ded8);_0x5a2be3(_0x3a3c18[_0xa75e('0x19')](0x1f4,_0x4d0bdb[_0xa75e('0x1a')]));});});}; \ No newline at end of file +var _0x69ec=['UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','lodash','moment','bluebird','randomstring','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x69ec,0x1bf));var _0xc69e=function(_0x4cb0e3,_0x5e0445){_0x4cb0e3=_0x4cb0e3-0x0;var _0x46ea93=_0x69ec[_0x4cb0e3];return _0x46ea93;};'use strict';var _=require(_0xc69e('0x0'));var util=require('util');var moment=require(_0xc69e('0x1'));var BPromise=require(_0xc69e('0x2'));var rs=require(_0xc69e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc69e('0x4'))(_0xc69e('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc69e('0x6')][_0xc69e('0x7')]({'port':0x232a});config[_0xc69e('0x8')]=_[_0xc69e('0x9')](config[_0xc69e('0x8')],{'host':_0xc69e('0xa'),'port':0x18eb});var socket=require(_0xc69e('0xb'))(new Redis(config[_0xc69e('0x8')]));require(_0xc69e('0xc'))[_0xc69e('0xd')](socket);function respondWithRpcPromise(_0x290912,_0x4db613,_0x5b514a){return new BPromise(function(_0x5bfdd4,_0xc18ff3){return client['request'](_0x290912,_0x5b514a)[_0xc69e('0xe')](function(_0x1dc80d){logger['info'](_0xc69e('0xf'),_0x4db613,_0xc69e('0x10'));logger[_0xc69e('0x11')](_0xc69e('0x12'),_0x4db613,_0xc69e('0x10'),JSON['stringify'](_0x1dc80d));if(_0x1dc80d[_0xc69e('0x13')]){if(_0x1dc80d[_0xc69e('0x13')][_0xc69e('0x14')]===0x1f4){logger[_0xc69e('0x13')](_0xc69e('0xf'),_0x4db613,_0x1dc80d[_0xc69e('0x13')]['message']);return _0xc18ff3(_0x1dc80d[_0xc69e('0x13')][_0xc69e('0x15')]);}logger[_0xc69e('0x13')](_0xc69e('0xf'),_0x4db613,_0x1dc80d[_0xc69e('0x13')]['message']);return _0x5bfdd4(_0x1dc80d[_0xc69e('0x13')][_0xc69e('0x15')]);}else{logger[_0xc69e('0x16')](_0xc69e('0xf'),_0x4db613,_0xc69e('0x10'));_0x5bfdd4(_0x1dc80d[_0xc69e('0x17')]['message']);}})['catch'](function(_0x1fc5ff){logger[_0xc69e('0x13')](_0xc69e('0xf'),_0x4db613,_0x1fc5ff);_0xc18ff3(_0x1fc5ff);});});}exports[_0xc69e('0x18')]=function(_0x177140){var _0x143403=this;return new Promise(function(_0x585494,_0x1ec76b){return db[_0xc69e('0x19')]['findAll']({'raw':_0x177140[_0xc69e('0x1a')]?_0x177140['options'][_0xc69e('0x1b')]===undefined?!![]:![]:!![],'where':_0x177140[_0xc69e('0x1a')]?_0x177140['options'][_0xc69e('0x1c')]||null:null,'attributes':[[db[_0xc69e('0x1d')]['fn'](_0xc69e('0x1e'),db[_0xc69e('0x1d')]['fn']('IF',db[_0xc69e('0x1d')][_0xc69e('0x1f')](_0xc69e('0x20')))),'outboundQueuePauses']]})[_0xc69e('0xe')](function(_0x3a25e1){logger[_0xc69e('0x16')](_0xc69e('0x18'),_0x177140);logger[_0xc69e('0x11')](_0xc69e('0x18'),_0x177140,JSON['stringify'](_0x3a25e1));_0x585494(_0x3a25e1);})['catch'](function(_0x53cff5){logger[_0xc69e('0x13')](_0xc69e('0x18'),_0x53cff5[_0xc69e('0x15')],_0x177140);_0x1ec76b(_0x143403['error'](0x1f4,_0x53cff5['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index d70b827..c732249 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 _0x1052=['save','remove','update','emit','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x5a0383,_0x312ffe){var _0x1adda7=function(_0x1a0cf5){while(--_0x1a0cf5){_0x5a0383['push'](_0x5a0383['shift']());}};_0x1adda7(++_0x312ffe);}(_0x1052,0xf4));var _0x2105=function(_0x3c04d7,_0x472801){_0x3c04d7=_0x3c04d7-0x0;var _0x2fb24=_0x1052[_0x3c04d7];return _0x2fb24;};'use strict';var UserVoiceQueueRtEvents=require(_0x2105('0x0'));var events=[_0x2105('0x1'),_0x2105('0x2'),_0x2105('0x3')];function createListener(_0x1644e8,_0x7d7b47){return function(_0x265e12){_0x7d7b47[_0x2105('0x4')](_0x1644e8,_0x265e12);};}function removeListener(_0x1e106c,_0x5c1e84){return function(){UserVoiceQueueRtEvents['removeListener'](_0x1e106c,_0x5c1e84);};}exports[_0x2105('0x5')]=function(_0x4a4e6b){for(var _0x126cd9=0x0,_0x9b262=events['length'];_0x126cd9<_0x9b262;_0x126cd9++){var _0x1e6ad5=events[_0x126cd9];var _0x20d2b4=createListener(_0x2105('0x6')+_0x1e6ad5,_0x4a4e6b);UserVoiceQueueRtEvents['on'](_0x1e6ad5,_0x20d2b4);}}; \ No newline at end of file +var _0x0a6b=['removeListener','length','./userVoiceQueueRt.events','emit'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x0a6b,0x18e));var _0xb0a6=function(_0x1c78dd,_0x117d6e){_0x1c78dd=_0x1c78dd-0x0;var _0x927903=_0x0a6b[_0x1c78dd];return _0x927903;};'use strict';var UserVoiceQueueRtEvents=require(_0xb0a6('0x0'));var events=['save','remove','update'];function createListener(_0x16a15d,_0x50d3d5){return function(_0x2245d7){_0x50d3d5[_0xb0a6('0x1')](_0x16a15d,_0x2245d7);};}function removeListener(_0x1d3b78,_0x544a64){return function(){UserVoiceQueueRtEvents[_0xb0a6('0x2')](_0x1d3b78,_0x544a64);};}exports['register']=function(_0xbbdf89){for(var _0x415e9e=0x0,_0x5e2d2d=events[_0xb0a6('0x3')];_0x415e9e<_0x5e2d2d;_0x415e9e++){var _0x24515c=events[_0x415e9e];var _0x2a8516=createListener('userVoiceQueueRt:'+_0x24515c,_0xbbdf89);UserVoiceQueueRtEvents['on'](_0x24515c,_0x2a8516);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 7a1595a..99a37f1 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x397c64,_0x2be3e6){var _0x1de351=function(_0x5e2240){while(--_0x5e2240){_0x397c64['push'](_0x397c64['shift']());}};_0x1de351(++_0x2be3e6);}(_0xe706,0xa3));var _0x6e70=function(_0x5a0681,_0x5cbc10){_0x5a0681=_0x5a0681-0x0;var _0x2d3a74=_0xe706[_0x5a0681];return _0x2d3a74;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x43fd75,_0x48dc5c){var _0x3cb02d=function(_0x2eb0d0){while(--_0x2eb0d0){_0x43fd75['push'](_0x43fd75['shift']());}};_0x3cb02d(++_0x48dc5c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 69a3e96..02c77b3 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 _0xf576=['exports','INTEGER','sequelize'];(function(_0x17a963,_0x291584){var _0x549ebc=function(_0x995173){while(--_0x995173){_0x17a963['push'](_0x17a963['shift']());}};_0x549ebc(++_0x291584);}(_0xf576,0xef));var _0x6f57=function(_0x1ab43b,_0x14bd76){_0x1ab43b=_0x1ab43b-0x0;var _0x44fc81=_0xf576[_0x1ab43b];return _0x44fc81;};'use strict';var Sequelize=require(_0x6f57('0x0'));module[_0x6f57('0x1')]={'penalty':{'type':Sequelize[_0x6f57('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6510=['INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6510,0x1a3));var _0x0651=function(_0x2be172,_0x1dff08){_0x2be172=_0x2be172-0x0;var _0xfab385=_0x6510[_0x2be172];return _0xfab385;};'use strict';var Sequelize=require(_0x0651('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0651('0x1')],'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 b21a385..da1c610 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 _0xb527=['UserWhatsappQueue','user_has_whatsapp_queues','util','../../config/logger','api','moment','request-promise','path','./userWhatsappQueue.attributes','exports','define'];(function(_0x95d4aa,_0x549b27){var _0x40ed9f=function(_0x52fdbb){while(--_0x52fdbb){_0x95d4aa['push'](_0x95d4aa['shift']());}};_0x40ed9f(++_0x549b27);}(_0xb527,0x1ba));var _0x7b52=function(_0x20e26a,_0x20b87d){_0x20e26a=_0x20e26a-0x0;var _0x450dee=_0xb527[_0x20e26a];return _0x450dee;};'use strict';var _=require('lodash');var util=require(_0x7b52('0x0'));var logger=require(_0x7b52('0x1'))(_0x7b52('0x2'));var moment=require(_0x7b52('0x3'));var BPromise=require('bluebird');var rp=require(_0x7b52('0x4'));var fs=require('fs');var path=require(_0x7b52('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7b52('0x6'));module[_0x7b52('0x7')]=function(_0xe52368,_0x2ed2cd){return _0xe52368[_0x7b52('0x8')](_0x7b52('0x9'),attributes,{'tableName':_0x7b52('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a82=['moment','bluebird','request-promise','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','api'];(function(_0x37c3a5,_0x1f7bf3){var _0x693995=function(_0x2d0ca5){while(--_0x2d0ca5){_0x37c3a5['push'](_0x37c3a5['shift']());}};_0x693995(++_0x1f7bf3);}(_0x9a82,0x12a));var _0x29a8=function(_0x48ac48,_0x2c4323){_0x48ac48=_0x48ac48-0x0;var _0x8431b3=_0x9a82[_0x48ac48];return _0x8431b3;};'use strict';var _=require(_0x29a8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x29a8('0x1'));var moment=require(_0x29a8('0x2'));var BPromise=require(_0x29a8('0x3'));var rp=require(_0x29a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x29a8('0x5'));var config=require(_0x29a8('0x6'));var attributes=require(_0x29a8('0x7'));module[_0x29a8('0x8')]=function(_0x2c154d,_0x5ec7e8){return _0x2c154d[_0x29a8('0x9')](_0x29a8('0xa'),attributes,{'tableName':_0x29a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 7324a47..a162941 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 _0xad72=['../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x554505,_0x5013e8){var _0xf4d23b=function(_0x16973d){while(--_0x16973d){_0x554505['push'](_0x554505['shift']());}};_0xf4d23b(++_0x5013e8);}(_0xad72,0x12d));var _0x2ad7=function(_0x12f85e,_0x217706){_0x12f85e=_0x12f85e-0x0;var _0x316c77=_0xad72[_0x12f85e];return _0x316c77;};'use strict';var _=require(_0x2ad7('0x0'));var util=require('util');var moment=require(_0x2ad7('0x1'));var BPromise=require(_0x2ad7('0x2'));var rs=require(_0x2ad7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ad7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ad7('0x5'))(_0x2ad7('0x6'));var config=require(_0x2ad7('0x7'));var jayson=require(_0x2ad7('0x8'));var client=jayson[_0x2ad7('0x9')][_0x2ad7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ea2ae,_0x1d23a2,_0x45f8cc){return new BPromise(function(_0x176dc8,_0x5a4edd){return client[_0x2ad7('0xb')](_0x5ea2ae,_0x45f8cc)[_0x2ad7('0xc')](function(_0x3406ff){logger['info'](_0x2ad7('0xd'),_0x1d23a2,_0x2ad7('0xe'));logger[_0x2ad7('0xf')](_0x2ad7('0x10'),_0x1d23a2,_0x2ad7('0xe'),JSON[_0x2ad7('0x11')](_0x3406ff));if(_0x3406ff[_0x2ad7('0x12')]){if(_0x3406ff[_0x2ad7('0x12')][_0x2ad7('0x13')]===0x1f4){logger['error'](_0x2ad7('0xd'),_0x1d23a2,_0x3406ff[_0x2ad7('0x12')][_0x2ad7('0x14')]);return _0x5a4edd(_0x3406ff[_0x2ad7('0x12')][_0x2ad7('0x14')]);}logger[_0x2ad7('0x12')](_0x2ad7('0xd'),_0x1d23a2,_0x3406ff[_0x2ad7('0x12')]['message']);return _0x176dc8(_0x3406ff[_0x2ad7('0x12')][_0x2ad7('0x14')]);}else{logger['info'](_0x2ad7('0xd'),_0x1d23a2,_0x2ad7('0xe'));_0x176dc8(_0x3406ff['result'][_0x2ad7('0x14')]);}})[_0x2ad7('0x15')](function(_0x30ba7d){logger[_0x2ad7('0x12')](_0x2ad7('0xd'),_0x1d23a2,_0x30ba7d);_0x5a4edd(_0x30ba7d);});});} \ No newline at end of file +var _0x87f7=['request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s'];(function(_0x3ff9bf,_0x2510e4){var _0x156e50=function(_0x145bef){while(--_0x145bef){_0x3ff9bf['push'](_0x3ff9bf['shift']());}};_0x156e50(++_0x2510e4);}(_0x87f7,0x102));var _0x787f=function(_0x249d6a,_0x5beaa1){_0x249d6a=_0x249d6a-0x0;var _0x591c89=_0x87f7[_0x249d6a];return _0x591c89;};'use strict';var _=require(_0x787f('0x0'));var util=require(_0x787f('0x1'));var moment=require(_0x787f('0x2'));var BPromise=require('bluebird');var rs=require(_0x787f('0x3'));var fs=require('fs');var Redis=require(_0x787f('0x4'));var db=require(_0x787f('0x5'))['db'];var utils=require(_0x787f('0x6'));var logger=require(_0x787f('0x7'))(_0x787f('0x8'));var config=require(_0x787f('0x9'));var jayson=require(_0x787f('0xa'));var client=jayson[_0x787f('0xb')][_0x787f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x102e61,_0x54a47d,_0x2288dd){return new BPromise(function(_0x2a5b72,_0x3f8ff2){return client[_0x787f('0xd')](_0x102e61,_0x2288dd)[_0x787f('0xe')](function(_0x1125e8){logger[_0x787f('0xf')](_0x787f('0x10'),_0x54a47d,_0x787f('0x11'));logger[_0x787f('0x12')](_0x787f('0x13'),_0x54a47d,_0x787f('0x11'),JSON[_0x787f('0x14')](_0x1125e8));if(_0x1125e8[_0x787f('0x15')]){if(_0x1125e8[_0x787f('0x15')][_0x787f('0x16')]===0x1f4){logger[_0x787f('0x15')](_0x787f('0x10'),_0x54a47d,_0x1125e8[_0x787f('0x15')][_0x787f('0x17')]);return _0x3f8ff2(_0x1125e8[_0x787f('0x15')]['message']);}logger[_0x787f('0x15')]('UserWhatsappQueue,\x20%s,\x20%s',_0x54a47d,_0x1125e8[_0x787f('0x15')][_0x787f('0x17')]);return _0x2a5b72(_0x1125e8[_0x787f('0x15')]['message']);}else{logger['info']('UserWhatsappQueue,\x20%s,\x20%s',_0x54a47d,_0x787f('0x11'));_0x2a5b72(_0x1125e8[_0x787f('0x18')][_0x787f('0x17')]);}})['catch'](function(_0x531245){logger['error'](_0x787f('0x10'),_0x54a47d,_0x531245);_0x3f8ff2(_0x531245);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 3ebc11f..141f1ce 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 _0xb2ef=['Router','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','multer','util','path','express'];(function(_0x1de2bd,_0x953fb){var _0x595960=function(_0xea260b){while(--_0xea260b){_0x1de2bd['push'](_0x1de2bd['shift']());}};_0x595960(++_0x953fb);}(_0xb2ef,0xa7));var _0xfb2e=function(_0x24b323,_0x15e297){_0x24b323=_0x24b323-0x0;var _0x368a68=_0xb2ef[_0x24b323];return _0x368a68;};'use strict';var multer=require(_0xfb2e('0x0'));var util=require(_0xfb2e('0x1'));var path=require(_0xfb2e('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb2e('0x3'));var router=express[_0xfb2e('0x4')]();var fs_extra=require(_0xfb2e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfb2e('0x6'));var config=require(_0xfb2e('0x7'));var controller=require(_0xfb2e('0x8'));router[_0xfb2e('0x9')]('/',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xb')]);router[_0xfb2e('0x9')](_0xfb2e('0xc'),auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xd')]);router['post']('/',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0xe')]);router[_0xfb2e('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xfb2e('0x10')]);router[_0xfb2e('0x11')]('/:id',auth[_0xfb2e('0xa')](),controller[_0xfb2e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x3379=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','util','path'];(function(_0x5a6a5a,_0x1c9fe6){var _0x2d4f8a=function(_0x13cb12){while(--_0x13cb12){_0x5a6a5a['push'](_0x5a6a5a['shift']());}};_0x2d4f8a(++_0x1c9fe6);}(_0x3379,0x115));var _0x9337=function(_0x1a116d,_0x567bd2){_0x1a116d=_0x1a116d-0x0;var _0x234c94=_0x3379[_0x1a116d];return _0x234c94;};'use strict';var multer=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var path=require(_0x9337('0x2'));var timeout=require(_0x9337('0x3'));var express=require('express');var router=express[_0x9337('0x4')]();var fs_extra=require(_0x9337('0x5'));var auth=require(_0x9337('0x6'));var interaction=require(_0x9337('0x7'));var config=require('../../config/environment');var controller=require(_0x9337('0x8'));router[_0x9337('0x9')]('/',auth[_0x9337('0xa')](),controller[_0x9337('0xb')]);router['get'](_0x9337('0xc'),auth['isAuthenticated'](),controller[_0x9337('0xd')]);router[_0x9337('0xe')]('/',auth[_0x9337('0xa')](),controller[_0x9337('0xf')]);router[_0x9337('0x10')]('/:id',auth[_0x9337('0xa')](),controller[_0x9337('0x11')]);router[_0x9337('0x12')](_0x9337('0xc'),auth[_0x9337('0xa')](),controller['destroy']);module[_0x9337('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index b55160d..7ea1fdc 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 _0x47aa=['exports','STRING','sequelize'];(function(_0x508a99,_0x42b963){var _0x4ed68d=function(_0x1228ee){while(--_0x1228ee){_0x508a99['push'](_0x508a99['shift']());}};_0x4ed68d(++_0x42b963);}(_0x47aa,0x9e));var _0xa47a=function(_0x3e0613,_0x8ed990){_0x3e0613=_0x3e0613-0x0;var _0xbe84c3=_0x47aa[_0x3e0613];return _0xbe84c3;};'use strict';var Sequelize=require(_0xa47a('0x0'));module[_0xa47a('0x1')]={'name':{'type':Sequelize[_0xa47a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa47a('0x2')]}}; \ No newline at end of file +var _0x27e7=['STRING','sequelize'];(function(_0x712be0,_0x5b4371){var _0xed004a=function(_0x9ec6af){while(--_0x9ec6af){_0x712be0['push'](_0x712be0['shift']());}};_0xed004a(++_0x5b4371);}(_0x27e7,0x67));var _0x727e=function(_0x2764c6,_0x2d1bb7){_0x2764c6=_0x2764c6-0x0;var _0x4bee43=_0x27e7[_0x2764c6];return _0x4bee43;};'use strict';var Sequelize=require(_0x727e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x727e('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 466c806..4896585 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 _0x736a=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','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','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','Variables','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','index','Variable','rawAttributes','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','role','user','UserProfileSection','autoAssociation','eml-format'];(function(_0x3e6e66,_0x3f8f4e){var _0x4b3e0a=function(_0x2cb7a3){while(--_0x2cb7a3){_0x3e6e66['push'](_0x3e6e66['shift']());}};_0x4b3e0a(++_0x3f8f4e);}(_0x736a,0xa7));var _0xa736=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x736a[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require(_0xa736('0x0'));var rimraf=require(_0xa736('0x1'));var zipdir=require(_0xa736('0x2'));var jsonpatch=require(_0xa736('0x3'));var rp=require(_0xa736('0x4'));var moment=require(_0xa736('0x5'));var BPromise=require(_0xa736('0x6'));var Mustache=require('mustache');var util=require(_0xa736('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa736('0x8'));var ejs=require(_0xa736('0x9'));var fs=require('fs');var fs_extra=require(_0xa736('0xa'));var _=require(_0xa736('0xb'));var squel=require(_0xa736('0xc'));var crypto=require(_0xa736('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa736('0xe'));var toCsv=require(_0xa736('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa736('0xf'));var authService=require(_0xa736('0x10'));var qs=require(_0xa736('0x11'));var as=require(_0xa736('0x12'));var hardwareService=require(_0xa736('0x13'));var logger=require('../../config/logger')(_0xa736('0x14'));var utils=require(_0xa736('0x15'));var config=require(_0xa736('0x16'));var licenseUtil=require(_0xa736('0x17'));var db=require(_0xa736('0x18'))['db'];function respondWithStatusCode(_0x147012,_0x52b797){_0x52b797=_0x52b797||0xcc;return function(_0x1bd4b5){if(_0x1bd4b5){return _0x147012['sendStatus'](_0x52b797);}return _0x147012[_0xa736('0x19')](_0x52b797)['end']();};}function respondWithResult(_0x3dab62,_0xd40399){_0xd40399=_0xd40399||0xc8;return function(_0x17f6dc){if(_0x17f6dc){return _0x3dab62[_0xa736('0x19')](_0xd40399)[_0xa736('0x1a')](_0x17f6dc);}};}function respondWithFilteredResult(_0xe7c759,_0x69e6ff){return function(_0x2fd4a2){if(_0x2fd4a2){var _0x2c8bbe=typeof _0x69e6ff[_0xa736('0x1b')]===_0xa736('0x1c')&&typeof _0x69e6ff[_0xa736('0x1d')]==='undefined';var _0x2cc52f=_0x2fd4a2[_0xa736('0x1e')];var _0x406c8a=_0x2c8bbe?0x0:_0x69e6ff[_0xa736('0x1b')];var _0x550168=_0x2c8bbe?_0x2fd4a2[_0xa736('0x1e')]:_0x69e6ff[_0xa736('0x1b')]+_0x69e6ff['limit'];var _0x538430;if(_0x550168>=_0x2cc52f){_0x550168=_0x2cc52f;_0x538430=0xc8;}else{_0x538430=0xce;}_0xe7c759[_0xa736('0x19')](_0x538430);return _0xe7c759[_0xa736('0x1f')](_0xa736('0x20'),_0x406c8a+'-'+_0x550168+'/'+_0x2cc52f)['json'](_0x2fd4a2);}return null;};}function patchUpdates(_0xbead9e){return function(_0x48c0cc){try{jsonpatch[_0xa736('0x21')](_0x48c0cc,_0xbead9e,!![]);}catch(_0x8f89fc){return BPromise[_0xa736('0x22')](_0x8f89fc);}return _0x48c0cc['save']();};}function saveUpdates(_0x39a389,_0x42497e){return function(_0x3ce519){if(_0x3ce519){return _0x3ce519[_0xa736('0x23')](_0x39a389)[_0xa736('0x24')](function(_0x2ac3e4){return _0x2ac3e4;});}return null;};}function removeEntity(_0x102cc3,_0x245b74){return function(_0x29890f){if(_0x29890f){return _0x29890f['destroy']()[_0xa736('0x24')](function(){var _0x5b8a5c=_0x29890f[_0xa736('0x25')]({'plain':!![]});var _0x427d20=_0xa736('0x26');return db[_0xa736('0x27')][_0xa736('0x28')]({'where':{'type':_0x427d20,'resourceId':_0x5b8a5c['id']}})[_0xa736('0x24')](function(){return _0x29890f;});})['then'](function(){_0x102cc3['status'](0xcc)[_0xa736('0x29')]();});}};}function handleEntityNotFound(_0x49a502,_0x156de1){return function(_0x112ce7){if(!_0x112ce7){_0x49a502[_0xa736('0x2a')](0x194);}return _0x112ce7;};}function handleError(_0x3b85b5,_0x1f4b1d){_0x1f4b1d=_0x1f4b1d||0x1f4;return function(_0x56e40e){logger[_0xa736('0x2b')](_0x56e40e[_0xa736('0x2c')]);if(_0x56e40e[_0xa736('0x2d')]){delete _0x56e40e[_0xa736('0x2d')];}_0x3b85b5[_0xa736('0x19')](_0x1f4b1d)[_0xa736('0x2e')](_0x56e40e);};}exports[_0xa736('0x2f')]=function(_0xde7a5,_0x4a8c45){var _0x35ca78={},_0x3007c9={},_0x525f55={'count':0x0,'rows':[]};var _0x2f3fe4=_['map'](db[_0xa736('0x30')][_0xa736('0x31')],function(_0x583392){return{'name':_0x583392['fieldName'],'type':_0x583392[_0xa736('0x32')][_0xa736('0x33')]};});_0x3007c9['model']=_[_0xa736('0x34')](_0x2f3fe4,'name');_0x3007c9[_0xa736('0x35')]=_[_0xa736('0x36')](_0xde7a5[_0xa736('0x35')]);_0x3007c9[_0xa736('0x37')]=_['intersection'](_0x3007c9[_0xa736('0x38')],_0x3007c9[_0xa736('0x35')]);_0x35ca78[_0xa736('0x39')]=_[_0xa736('0x3a')](_0x3007c9['model'],qs['fields'](_0xde7a5[_0xa736('0x35')][_0xa736('0x3b')]));_0x35ca78['attributes']=_0x35ca78[_0xa736('0x39')]['length']?_0x35ca78[_0xa736('0x39')]:_0x3007c9[_0xa736('0x38')];if(!_0xde7a5[_0xa736('0x35')][_0xa736('0x3c')](_0xa736('0x3d'))){_0x35ca78['limit']=qs[_0xa736('0x1d')](_0xde7a5[_0xa736('0x35')]['limit']);_0x35ca78[_0xa736('0x1b')]=qs[_0xa736('0x1b')](_0xde7a5[_0xa736('0x35')]['offset']);}_0x35ca78[_0xa736('0x3e')]=qs['sort'](_0xde7a5[_0xa736('0x35')][_0xa736('0x3f')]);_0x35ca78[_0xa736('0x40')]=qs[_0xa736('0x37')](_[_0xa736('0x41')](_0xde7a5[_0xa736('0x35')],_0x3007c9[_0xa736('0x37')]),_0x2f3fe4);if(_0xde7a5['query']['filter']){_0x35ca78[_0xa736('0x40')]=_[_0xa736('0x42')](_0x35ca78[_0xa736('0x40')],{'$or':_[_0xa736('0x34')](_0x2f3fe4,function(_0x57a08f){if(_0x57a08f[_0xa736('0x32')]!==_0xa736('0x43')){var _0x31cd31={};_0x31cd31[_0x57a08f['name']]={'$like':'%'+_0xde7a5[_0xa736('0x35')][_0xa736('0x44')]+'%'};return _0x31cd31;}})});}_0x35ca78=_[_0xa736('0x42')]({},_0x35ca78,_0xde7a5[_0xa736('0x45')]);var _0x4d79bc={'where':_0x35ca78['where']};return db[_0xa736('0x30')][_0xa736('0x1e')](_0x4d79bc)[_0xa736('0x24')](function(_0x35c3ec){_0x525f55[_0xa736('0x1e')]=_0x35c3ec;if(_0xde7a5[_0xa736('0x35')]['includeAll']){_0x35ca78[_0xa736('0x46')]=[{'all':!![]}];}return db[_0xa736('0x30')][_0xa736('0x47')](_0x35ca78);})[_0xa736('0x24')](function(_0x4c6db3){_0x525f55[_0xa736('0x48')]=_0x4c6db3;return _0x525f55;})[_0xa736('0x24')](respondWithFilteredResult(_0x4a8c45,_0x35ca78))[_0xa736('0x49')](handleError(_0x4a8c45,null));};exports['show']=function(_0x372cb2,_0x587d57){var _0x23b773={'raw':!![],'where':{'id':_0x372cb2[_0xa736('0x4a')]['id']}},_0x5d87ab={};_0x5d87ab['model']=_[_0xa736('0x36')](db[_0xa736('0x30')]['rawAttributes']);_0x5d87ab[_0xa736('0x35')]=_[_0xa736('0x36')](_0x372cb2[_0xa736('0x35')]);_0x5d87ab[_0xa736('0x37')]=_[_0xa736('0x3a')](_0x5d87ab[_0xa736('0x38')],_0x5d87ab['query']);_0x23b773['attributes']=_[_0xa736('0x3a')](_0x5d87ab[_0xa736('0x38')],qs[_0xa736('0x3b')](_0x372cb2[_0xa736('0x35')][_0xa736('0x3b')]));_0x23b773[_0xa736('0x39')]=_0x23b773[_0xa736('0x39')][_0xa736('0x4b')]?_0x23b773[_0xa736('0x39')]:_0x5d87ab['model'];if(_0x372cb2[_0xa736('0x35')][_0xa736('0x4c')]){_0x23b773[_0xa736('0x46')]=[{'all':!![]}];}_0x23b773=_[_0xa736('0x42')]({},_0x23b773,_0x372cb2[_0xa736('0x45')]);return db[_0xa736('0x30')][_0xa736('0x4d')](_0x23b773)[_0xa736('0x24')](handleEntityNotFound(_0x587d57,null))[_0xa736('0x24')](respondWithResult(_0x587d57,null))[_0xa736('0x49')](handleError(_0x587d57,null));};exports['create']=function(_0x1f5476,_0x58cd72){return db[_0xa736('0x30')][_0xa736('0x4e')](_0x1f5476[_0xa736('0x4f')],{})[_0xa736('0x24')](function(_0x15073e){var _0x345684=_0x1f5476['user']['get']({'plain':!![]});if(!_0x345684)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x345684[_0xa736('0x50')]===_0xa736('0x51')){var _0x54ce9f=_0x15073e['get']({'plain':!![]});var _0x3a18de='Variables';return db[_0xa736('0x52')][_0xa736('0x4d')]({'where':{'name':_0x3a18de,'userProfileId':_0x345684['userProfileId']},'raw':!![]})[_0xa736('0x24')](function(_0x1fdf9e){if(_0x1fdf9e&&_0x1fdf9e[_0xa736('0x53')]===0x0){return db[_0xa736('0x27')]['create']({'name':_0x54ce9f[_0xa736('0x2d')],'resourceId':_0x54ce9f['id'],'type':_0x1fdf9e[_0xa736('0x2d')],'sectionId':_0x1fdf9e['id']},{})[_0xa736('0x24')](function(){return _0x15073e;});}else{return _0x15073e;}})[_0xa736('0x49')](function(_0x255880){logger[_0xa736('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x255880);throw _0x255880;});}return _0x15073e;})['then'](respondWithResult(_0x58cd72,0xc9))['catch'](handleError(_0x58cd72,null));};exports[_0xa736('0x23')]=function(_0x270239,_0x30dc20){if(_0x270239[_0xa736('0x4f')]['id']){delete _0x270239[_0xa736('0x4f')]['id'];}return db[_0xa736('0x30')][_0xa736('0x4d')]({'where':{'id':_0x270239[_0xa736('0x4a')]['id']}})[_0xa736('0x24')](handleEntityNotFound(_0x30dc20,null))[_0xa736('0x24')](saveUpdates(_0x270239[_0xa736('0x4f')],null))['then'](respondWithResult(_0x30dc20,null))[_0xa736('0x49')](handleError(_0x30dc20,null));};exports[_0xa736('0x28')]=function(_0x2d82f3,_0x1b637e){return db[_0xa736('0x30')][_0xa736('0x4d')]({'where':{'id':_0x2d82f3[_0xa736('0x4a')]['id']}})[_0xa736('0x24')](handleEntityNotFound(_0x1b637e,null))['then'](removeEntity(_0x1b637e,null))[_0xa736('0x49')](handleError(_0x1b637e,null));}; \ No newline at end of file +var _0xbc90=['userProfileId','autoAssociation','error','body','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','Variables','UserProfileResource','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','Variable','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x4ea992,_0x4f895a){var _0x4c8575=function(_0x53aaba){while(--_0x53aaba){_0x4ea992['push'](_0x4ea992['shift']());}};_0x4c8575(++_0x4f895a);}(_0xbc90,0xee));var _0x0bc9=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xbc90[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bc9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0bc9('0x1'));var rp=require(_0x0bc9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0bc9('0x3'));var util=require('util');var path=require(_0x0bc9('0x4'));var sox=require('sox');var csv=require(_0x0bc9('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bc9('0x6'));var _=require(_0x0bc9('0x7'));var squel=require('squel');var crypto=require(_0x0bc9('0x8'));var jsforce=require(_0x0bc9('0x9'));var deskjs=require(_0x0bc9('0xa'));var toCsv=require(_0x0bc9('0x5'));var querystring=require(_0x0bc9('0xb'));var Papa=require(_0x0bc9('0xc'));var Redis=require(_0x0bc9('0xd'));var authService=require(_0x0bc9('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x0bc9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0bc9('0x10'))(_0x0bc9('0x11'));var utils=require(_0x0bc9('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xca238,_0x5101d3){_0x5101d3=_0x5101d3||0xcc;return function(_0x52f57c){if(_0x52f57c){return _0xca238[_0x0bc9('0x13')](_0x5101d3);}return _0xca238[_0x0bc9('0x14')](_0x5101d3)[_0x0bc9('0x15')]();};}function respondWithResult(_0x5c7e29,_0x8c4c98){_0x8c4c98=_0x8c4c98||0xc8;return function(_0x44a58f){if(_0x44a58f){return _0x5c7e29[_0x0bc9('0x14')](_0x8c4c98)[_0x0bc9('0x16')](_0x44a58f);}};}function respondWithFilteredResult(_0x18726b,_0x382a47){return function(_0x5b8045){if(_0x5b8045){var _0x59dbad=typeof _0x382a47[_0x0bc9('0x17')]==='undefined'&&typeof _0x382a47['limit']===_0x0bc9('0x18');var _0x4acf51=_0x5b8045[_0x0bc9('0x19')];var _0x228b7f=_0x59dbad?0x0:_0x382a47[_0x0bc9('0x17')];var _0x20bafb=_0x59dbad?_0x5b8045[_0x0bc9('0x19')]:_0x382a47[_0x0bc9('0x17')]+_0x382a47['limit'];var _0x421b04;if(_0x20bafb>=_0x4acf51){_0x20bafb=_0x4acf51;_0x421b04=0xc8;}else{_0x421b04=0xce;}_0x18726b[_0x0bc9('0x14')](_0x421b04);return _0x18726b[_0x0bc9('0x1a')](_0x0bc9('0x1b'),_0x228b7f+'-'+_0x20bafb+'/'+_0x4acf51)[_0x0bc9('0x16')](_0x5b8045);}return null;};}function patchUpdates(_0x42493e){return function(_0x2f5895){try{jsonpatch[_0x0bc9('0x1c')](_0x2f5895,_0x42493e,!![]);}catch(_0x174457){return BPromise[_0x0bc9('0x1d')](_0x174457);}return _0x2f5895['save']();};}function saveUpdates(_0x5d9724,_0x45c47c){return function(_0x492cef){if(_0x492cef){return _0x492cef[_0x0bc9('0x1e')](_0x5d9724)[_0x0bc9('0x1f')](function(_0x2f77f2){return _0x2f77f2;});}return null;};}function removeEntity(_0x19f0e7,_0x4e0a35){return function(_0x59c128){if(_0x59c128){return _0x59c128[_0x0bc9('0x20')]()[_0x0bc9('0x1f')](function(){var _0x465acc=_0x59c128[_0x0bc9('0x21')]({'plain':!![]});var _0x5ecc07=_0x0bc9('0x22');return db[_0x0bc9('0x23')][_0x0bc9('0x20')]({'where':{'type':_0x5ecc07,'resourceId':_0x465acc['id']}})['then'](function(){return _0x59c128;});})[_0x0bc9('0x1f')](function(){_0x19f0e7[_0x0bc9('0x14')](0xcc)[_0x0bc9('0x15')]();});}};}function handleEntityNotFound(_0x18fd75,_0x307f10){return function(_0xdeb8b0){if(!_0xdeb8b0){_0x18fd75[_0x0bc9('0x13')](0x194);}return _0xdeb8b0;};}function handleError(_0x4ef93d,_0x5ab37){_0x5ab37=_0x5ab37||0x1f4;return function(_0x59713a){logger['error'](_0x59713a[_0x0bc9('0x24')]);if(_0x59713a[_0x0bc9('0x25')]){delete _0x59713a[_0x0bc9('0x25')];}_0x4ef93d[_0x0bc9('0x14')](_0x5ab37)['send'](_0x59713a);};}exports[_0x0bc9('0x26')]=function(_0x408dcb,_0x8cad6b){var _0xffb236={},_0x14d60d={},_0x31491a={'count':0x0,'rows':[]};var _0x50b421=_[_0x0bc9('0x27')](db['Variable']['rawAttributes'],function(_0x20f99f){return{'name':_0x20f99f[_0x0bc9('0x28')],'type':_0x20f99f[_0x0bc9('0x29')][_0x0bc9('0x2a')]};});_0x14d60d[_0x0bc9('0x2b')]=_[_0x0bc9('0x27')](_0x50b421,_0x0bc9('0x25'));_0x14d60d[_0x0bc9('0x2c')]=_[_0x0bc9('0x2d')](_0x408dcb['query']);_0x14d60d[_0x0bc9('0x2e')]=_[_0x0bc9('0x2f')](_0x14d60d[_0x0bc9('0x2b')],_0x14d60d[_0x0bc9('0x2c')]);_0xffb236[_0x0bc9('0x30')]=_[_0x0bc9('0x2f')](_0x14d60d[_0x0bc9('0x2b')],qs['fields'](_0x408dcb[_0x0bc9('0x2c')]['fields']));_0xffb236['attributes']=_0xffb236[_0x0bc9('0x30')][_0x0bc9('0x31')]?_0xffb236[_0x0bc9('0x30')]:_0x14d60d['model'];if(!_0x408dcb[_0x0bc9('0x2c')]['hasOwnProperty'](_0x0bc9('0x32'))){_0xffb236['limit']=qs['limit'](_0x408dcb['query']['limit']);_0xffb236[_0x0bc9('0x17')]=qs['offset'](_0x408dcb[_0x0bc9('0x2c')][_0x0bc9('0x17')]);}_0xffb236[_0x0bc9('0x33')]=qs[_0x0bc9('0x34')](_0x408dcb['query'][_0x0bc9('0x34')]);_0xffb236[_0x0bc9('0x35')]=qs[_0x0bc9('0x2e')](_['pick'](_0x408dcb[_0x0bc9('0x2c')],_0x14d60d[_0x0bc9('0x2e')]),_0x50b421);if(_0x408dcb[_0x0bc9('0x2c')][_0x0bc9('0x36')]){_0xffb236[_0x0bc9('0x35')]=_[_0x0bc9('0x37')](_0xffb236['where'],{'$or':_['map'](_0x50b421,function(_0x1ce1bc){if(_0x1ce1bc[_0x0bc9('0x29')]!==_0x0bc9('0x38')){var _0x58f30d={};_0x58f30d[_0x1ce1bc['name']]={'$like':'%'+_0x408dcb['query']['filter']+'%'};return _0x58f30d;}})});}_0xffb236=_[_0x0bc9('0x37')]({},_0xffb236,_0x408dcb['options']);var _0x159cd2={'where':_0xffb236[_0x0bc9('0x35')]};return db[_0x0bc9('0x39')][_0x0bc9('0x19')](_0x159cd2)[_0x0bc9('0x1f')](function(_0x173bbc){_0x31491a[_0x0bc9('0x19')]=_0x173bbc;if(_0x408dcb['query'][_0x0bc9('0x3a')]){_0xffb236[_0x0bc9('0x3b')]=[{'all':!![]}];}return db[_0x0bc9('0x39')][_0x0bc9('0x3c')](_0xffb236);})[_0x0bc9('0x1f')](function(_0x171c29){_0x31491a[_0x0bc9('0x3d')]=_0x171c29;return _0x31491a;})[_0x0bc9('0x1f')](respondWithFilteredResult(_0x8cad6b,_0xffb236))[_0x0bc9('0x3e')](handleError(_0x8cad6b,null));};exports[_0x0bc9('0x3f')]=function(_0x2cb11f,_0x10cd4e){var _0x31d433={'raw':!![],'where':{'id':_0x2cb11f[_0x0bc9('0x40')]['id']}},_0x428be7={};_0x428be7[_0x0bc9('0x2b')]=_[_0x0bc9('0x2d')](db[_0x0bc9('0x39')][_0x0bc9('0x41')]);_0x428be7[_0x0bc9('0x2c')]=_[_0x0bc9('0x2d')](_0x2cb11f['query']);_0x428be7[_0x0bc9('0x2e')]=_['intersection'](_0x428be7[_0x0bc9('0x2b')],_0x428be7[_0x0bc9('0x2c')]);_0x31d433['attributes']=_[_0x0bc9('0x2f')](_0x428be7['model'],qs['fields'](_0x2cb11f[_0x0bc9('0x2c')][_0x0bc9('0x42')]));_0x31d433[_0x0bc9('0x30')]=_0x31d433['attributes'][_0x0bc9('0x31')]?_0x31d433[_0x0bc9('0x30')]:_0x428be7[_0x0bc9('0x2b')];if(_0x2cb11f['query'][_0x0bc9('0x3a')]){_0x31d433[_0x0bc9('0x3b')]=[{'all':!![]}];}_0x31d433=_[_0x0bc9('0x37')]({},_0x31d433,_0x2cb11f[_0x0bc9('0x43')]);return db[_0x0bc9('0x39')][_0x0bc9('0x44')](_0x31d433)[_0x0bc9('0x1f')](handleEntityNotFound(_0x10cd4e,null))[_0x0bc9('0x1f')](respondWithResult(_0x10cd4e,null))[_0x0bc9('0x3e')](handleError(_0x10cd4e,null));};exports[_0x0bc9('0x45')]=function(_0x5b1da4,_0x2ad1ef){return db[_0x0bc9('0x39')]['create'](_0x5b1da4['body'],{})[_0x0bc9('0x1f')](function(_0x5acb6d){var _0x1e0b7=_0x5b1da4[_0x0bc9('0x46')][_0x0bc9('0x21')]({'plain':!![]});if(!_0x1e0b7)throw new Error(_0x0bc9('0x47'));if(_0x1e0b7[_0x0bc9('0x48')]===_0x0bc9('0x46')){var _0x4bbdaf=_0x5acb6d[_0x0bc9('0x21')]({'plain':!![]});var _0x1d332b=_0x0bc9('0x22');return db[_0x0bc9('0x49')][_0x0bc9('0x44')]({'where':{'name':_0x1d332b,'userProfileId':_0x1e0b7[_0x0bc9('0x4a')]},'raw':!![]})[_0x0bc9('0x1f')](function(_0x3dfd55){if(_0x3dfd55&&_0x3dfd55[_0x0bc9('0x4b')]===0x0){return db[_0x0bc9('0x23')][_0x0bc9('0x45')]({'name':_0x4bbdaf[_0x0bc9('0x25')],'resourceId':_0x4bbdaf['id'],'type':_0x3dfd55[_0x0bc9('0x25')],'sectionId':_0x3dfd55['id']},{})[_0x0bc9('0x1f')](function(){return _0x5acb6d;});}else{return _0x5acb6d;}})['catch'](function(_0x13bcf5){logger[_0x0bc9('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13bcf5);throw _0x13bcf5;});}return _0x5acb6d;})[_0x0bc9('0x1f')](respondWithResult(_0x2ad1ef,0xc9))[_0x0bc9('0x3e')](handleError(_0x2ad1ef,null));};exports[_0x0bc9('0x1e')]=function(_0x4f16c7,_0x4f5e52){if(_0x4f16c7['body']['id']){delete _0x4f16c7[_0x0bc9('0x4d')]['id'];}return db['Variable'][_0x0bc9('0x44')]({'where':{'id':_0x4f16c7[_0x0bc9('0x40')]['id']}})[_0x0bc9('0x1f')](handleEntityNotFound(_0x4f5e52,null))['then'](saveUpdates(_0x4f16c7['body'],null))[_0x0bc9('0x1f')](respondWithResult(_0x4f5e52,null))['catch'](handleError(_0x4f5e52,null));};exports[_0x0bc9('0x20')]=function(_0x25e481,_0x1af61e){return db[_0x0bc9('0x39')][_0x0bc9('0x44')]({'where':{'id':_0x25e481['params']['id']}})['then'](handleEntityNotFound(_0x1af61e,null))[_0x0bc9('0x1f')](removeEntity(_0x1af61e,null))[_0x0bc9('0x3e')](handleError(_0x1af61e,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 479ad2d..bc61d24 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 _0x0b1b=['Variable','lodash','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x0b1b,0x6f));var _0xb0b1=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x0b1b[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0xb0b1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb0b1('0x1'));var moment=require(_0xb0b1('0x2'));var BPromise=require(_0xb0b1('0x3'));var rp=require(_0xb0b1('0x4'));var fs=require('fs');var path=require(_0xb0b1('0x5'));var rimraf=require(_0xb0b1('0x6'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xb0b1('0x7')]=function(_0x52a582,_0x457829){return _0x52a582[_0xb0b1('0x8')](_0xb0b1('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc49f=['bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','moment'];(function(_0x5373f2,_0x38e815){var _0x514a14=function(_0x39999f){while(--_0x39999f){_0x5373f2['push'](_0x5373f2['shift']());}};_0x514a14(++_0x38e815);}(_0xc49f,0x14d));var _0xfc49=function(_0x3c27b3,_0x178edc){_0x3c27b3=_0x3c27b3-0x0;var _0x2fa01b=_0xc49f[_0x3c27b3];return _0x2fa01b;};'use strict';var _=require(_0xfc49('0x0'));var util=require(_0xfc49('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfc49('0x2'));var BPromise=require(_0xfc49('0x3'));var rp=require(_0xfc49('0x4'));var fs=require('fs');var path=require(_0xfc49('0x5'));var rimraf=require(_0xfc49('0x6'));var config=require(_0xfc49('0x7'));var attributes=require(_0xfc49('0x8'));module[_0xfc49('0x9')]=function(_0x7b2f74,_0x25020e){return _0x7b2f74[_0xfc49('0xa')](_0xfc49('0xb'),attributes,{'tableName':'tools_variables','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 5dd6313..6f520b6 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0x544d42,_0x1253e1){var _0x40cefb=function(_0x5c705f){while(--_0x5c705f){_0x544d42['push'](_0x544d42['shift']());}};_0x40cefb(++_0x1253e1);}(_0xabce,0x103));var _0xeabc=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xabce[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});}; \ No newline at end of file +var _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(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xa41a,0x6b));var _0xaa41=function(_0x4d108b,_0x105e02){_0x4d108b=_0x4d108b-0x0;var _0x24ac8f=_0xa41a[_0x4d108b];return _0x24ac8f;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 3f2f5f4..b2fe4a6 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 _0x60f5=['./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','pull','/restart','restart','/migrations','exports','express','Router','../../components/auth/service'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x60f5,0x85));var _0x560f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x60f5[_0x501510];return _0x1e6ee5;};'use strict';var express=require(_0x560f('0x0'));var router=express[_0x560f('0x1')]();var auth=require(_0x560f('0x2'));var controller=require(_0x560f('0x3'));router[_0x560f('0x4')]('/',controller[_0x560f('0x5')]);router[_0x560f('0x4')](_0x560f('0x6'),auth[_0x560f('0x7')](),auth[_0x560f('0x8')](),controller[_0x560f('0x9')]);router['get'](_0x560f('0xa'),auth[_0x560f('0x7')](),auth[_0x560f('0x8')](),controller[_0x560f('0xb')]);router[_0x560f('0x4')]('/pull',auth[_0x560f('0x7')](),auth['canUpdate'](),controller[_0x560f('0xc')]);router['get'](_0x560f('0xd'),auth[_0x560f('0x7')](),controller[_0x560f('0xe')]);router[_0x560f('0x4')](_0x560f('0xf'),controller['migrations']);module[_0x560f('0x10')]=router; \ No newline at end of file +var _0x435c=['restart','/migrations','migrations','express','Router','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart'];(function(_0x38d1b4,_0x58378e){var _0xe7f2d3=function(_0x1e7f81){while(--_0x1e7f81){_0x38d1b4['push'](_0x38d1b4['shift']());}};_0xe7f2d3(++_0x58378e);}(_0x435c,0x1f3));var _0xc435=function(_0x602ca8,_0x568e82){_0x602ca8=_0x602ca8-0x0;var _0x26e8ab=_0x435c[_0x602ca8];return _0x26e8ab;};'use strict';var express=require(_0xc435('0x0'));var router=express[_0xc435('0x1')]();var auth=require(_0xc435('0x2'));var controller=require(_0xc435('0x3'));router[_0xc435('0x4')]('/',controller['index']);router[_0xc435('0x4')](_0xc435('0x5'),auth[_0xc435('0x6')](),auth[_0xc435('0x7')](),controller[_0xc435('0x8')]);router[_0xc435('0x4')](_0xc435('0x9'),auth['isAuthenticated'](),auth[_0xc435('0x7')](),controller[_0xc435('0xa')]);router[_0xc435('0x4')](_0xc435('0xb'),auth[_0xc435('0x6')](),auth[_0xc435('0x7')](),controller['pull']);router[_0xc435('0x4')](_0xc435('0xc'),auth[_0xc435('0x6')](),controller[_0xc435('0xd')]);router[_0xc435('0x4')](_0xc435('0xe'),controller[_0xc435('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 62ae101..6e7f951 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 _0x6b9a=['git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','replace','.js','length','sort','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','join','sequelize','UniqueConstraintError','Database\x20already\x20up-to-date','path','lodash','pkginfo','compare-versions','child_process','../../mysqldb','../../config/logger','update','root','exports','query','latest','fetch','tags','version','json','status','origin','master','error','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info'];(function(_0x5c8dca,_0x1ecbf1){var _0x5d1e32=function(_0x54001c){while(--_0x54001c){_0x5c8dca['push'](_0x5c8dca['shift']());}};_0x5d1e32(++_0x1ecbf1);}(_0x6b9a,0x17f));var _0xa6b9=function(_0x42e26d,_0x371a2b){_0x42e26d=_0x42e26d-0x0;var _0x324331=_0x6b9a[_0x42e26d];return _0x324331;};'use strict';var Umzug=require('umzug');var path=require(_0xa6b9('0x0'));var fs=require('fs');var _=require(_0xa6b9('0x1'));var pkginfo=require(_0xa6b9('0x2'))(module,'version');var compareVersions=require(_0xa6b9('0x3'));var exec=require(_0xa6b9('0x4'))['exec'];var db=require(_0xa6b9('0x5'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0xa6b9('0x6'))(_0xa6b9('0x7'));var git=require('simple-git')(config[_0xa6b9('0x8')]);exports['index']=function(_0x2be900,_0x23817f){var _0x59b919={'current':module[_0xa6b9('0x9')]['version'],'phonebar':0x2};if(_0x2be900[_0xa6b9('0xa')]&&_0x2be900[_0xa6b9('0xa')][_0xa6b9('0xb')]){return git[_0xa6b9('0xc')]()[_0xa6b9('0xd')](function(_0x42192a,_0x1c1c84){_0x59b919[_0xa6b9('0xb')]=(_0x42192a?module[_0xa6b9('0x9')][_0xa6b9('0xe')]:_0x1c1c84['latest'])||'2.0.0';return _0x23817f['status'](0xc8)[_0xa6b9('0xf')](_0x59b919);});}else{return _0x23817f[_0xa6b9('0x10')](0xc8)['json'](_0x59b919);}};exports['fetch']=function(_0x281d29,_0x1b3b70){return git[_0xa6b9('0xc')]([_0xa6b9('0x11'),_0xa6b9('0x12')],function(_0x228b03){if(_0x228b03){logger[_0xa6b9('0x13')](_0x228b03);return _0x1b3b70['status'](0x1f4)[_0xa6b9('0xf')](_0x228b03);}logger['info']('git\x20fetch');return _0x1b3b70[_0xa6b9('0x10')](0xc8)['json']({'output':_0xa6b9('0x14')});});};exports['reset']=function(_0x2f582c,_0x44b85e){return git[_0xa6b9('0x15')]([_0xa6b9('0x16'),_0xa6b9('0x17')],function(_0x49906a){if(_0x49906a){logger[_0xa6b9('0x13')](_0x49906a);return _0x44b85e[_0xa6b9('0x10')](0x1f4)[_0xa6b9('0xf')](_0x49906a);}logger[_0xa6b9('0x18')](_0xa6b9('0x19'));return _0x44b85e['status'](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x1a')});});};exports[_0xa6b9('0x1b')]=function(_0x77ec02,_0x1662cb){exec(_0xa6b9('0x1c'),function(_0x1b129a,_0x243304,_0x9fe936){logger[_0xa6b9('0x18')](_0x243304);logger[_0xa6b9('0x18')](_0x9fe936);if(_0x1b129a){logger[_0xa6b9('0x13')](_0x1b129a);return _0x1662cb[_0xa6b9('0x10')](0x1f4)['json'](_0x1b129a);}return _0x1662cb[_0xa6b9('0x10')](0xc8)[_0xa6b9('0xf')]({'output':_0x243304});});};exports[_0xa6b9('0x1d')]=function(_0x21b3c3,_0x5726be){return pm2['restart'](_0xa6b9('0x1e'))[_0xa6b9('0x1f')](function(_0x36193c){logger[_0xa6b9('0x18')]('pm2\x20restart\x20motion\x20%s',_0x36193c);return _0x5726be['status'](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x20')});})[_0xa6b9('0x21')](function(_0x22a863){logger['error'](_0x22a863);return _0x5726be[_0xa6b9('0x10')](0x1f4)[_0xa6b9('0xf')](_0x22a863);});};exports[_0xa6b9('0x22')]=function(_0x488bf1,_0x2a391f){var _0x24baf8=fs[_0xa6b9('0x23')](path['join'](config[_0xa6b9('0x8')],'server',_0xa6b9('0x22')));var _0x4115b0=[];for(var _0xeebaa0=0x0;_0xeebaa0<_0x24baf8['length'];_0xeebaa0++){var _0x39a287=_0x24baf8[_0xeebaa0][_0xa6b9('0x24')](_0xa6b9('0x25'),'');if(compareVersions(module[_0xa6b9('0x9')][_0xa6b9('0xe')],_0x39a287)===-0x1){_0x4115b0['push'](_0x39a287);}}if(_0x4115b0[_0xa6b9('0x26')]){var _0x3eb42b=_0x4115b0[_0xa6b9('0x27')](compareVersions);var _0x1be8d0=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xa6b9('0x28')],'modelName':_0xa6b9('0x28'),'columnName':_0xa6b9('0xe')},'migrations':{'params':[db['sequelize'][_0xa6b9('0x29')](),db['sequelize'][_0xa6b9('0x2a')],function(){throw new Error(_0xa6b9('0x2b'));}],'path':path['join'](config[_0xa6b9('0x8')],_0xa6b9('0x2c'),_0xa6b9('0x22')),'pattern':/\.js$/}});_0x1be8d0['up']({'migrations':_[_0xa6b9('0x2d')](_0x3eb42b,function(_0x265245){return _0x265245+'.js';})})[_0xa6b9('0x1f')](function(){return _0x2a391f['status'](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x2e')+module[_0xa6b9('0x9')][_0xa6b9('0xe')]+'\x20to\x20'+_['last'](_0x3eb42b),'migrations':_[_0xa6b9('0x2f')](_0x3eb42b)});})[_0xa6b9('0x21')](function(_0x262156){if(_0x262156 instanceof db[_0xa6b9('0x30')][_0xa6b9('0x31')]){return _0x2a391f[_0xa6b9('0x10')](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x32')});}else{return _0x2a391f['status'](0x1f4)[_0xa6b9('0xf')](_0x262156);}});}else{return _0x2a391f[_0xa6b9('0x10')](0xc8)[_0xa6b9('0xf')]({'output':_0xa6b9('0x32')});}}; \ No newline at end of file +var _0x0f9b=['compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','2.0.0','status','json','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version'];(function(_0x1b672b,_0x1c16a4){var _0x22675a=function(_0x2736ea){while(--_0x2736ea){_0x1b672b['push'](_0x1b672b['shift']());}};_0x22675a(++_0x1c16a4);}(_0x0f9b,0x13f));var _0xb0f9=function(_0x1bf05a,_0x1617f7){_0x1bf05a=_0x1bf05a-0x0;var _0x252f74=_0x0f9b[_0x1bf05a];return _0x252f74;};'use strict';var Umzug=require(_0xb0f9('0x0'));var path=require(_0xb0f9('0x1'));var fs=require('fs');var _=require(_0xb0f9('0x2'));var pkginfo=require(_0xb0f9('0x3'))(module,_0xb0f9('0x4'));var compareVersions=require(_0xb0f9('0x5'));var exec=require(_0xb0f9('0x6'))['exec'];var db=require(_0xb0f9('0x7'))['db'];var config=require(_0xb0f9('0x8'));var pm2=require(_0xb0f9('0x9'));var logger=require(_0xb0f9('0xa'))(_0xb0f9('0xb'));var git=require(_0xb0f9('0xc'))(config[_0xb0f9('0xd')]);exports[_0xb0f9('0xe')]=function(_0x61e985,_0x16249b){var _0x539bab={'current':module[_0xb0f9('0xf')][_0xb0f9('0x4')],'phonebar':0x2};if(_0x61e985[_0xb0f9('0x10')]&&_0x61e985[_0xb0f9('0x10')][_0xb0f9('0x11')]){return git[_0xb0f9('0x12')]()['tags'](function(_0x48b79c,_0x17adfc){_0x539bab[_0xb0f9('0x11')]=(_0x48b79c?module[_0xb0f9('0xf')][_0xb0f9('0x4')]:_0x17adfc[_0xb0f9('0x11')])||_0xb0f9('0x13');return _0x16249b[_0xb0f9('0x14')](0xc8)['json'](_0x539bab);});}else{return _0x16249b[_0xb0f9('0x14')](0xc8)[_0xb0f9('0x15')](_0x539bab);}};exports['fetch']=function(_0x429aea,_0x2a70a0){return git[_0xb0f9('0x12')](['origin',_0xb0f9('0x16')],function(_0x2ca02d){if(_0x2ca02d){logger[_0xb0f9('0x17')](_0x2ca02d);return _0x2a70a0[_0xb0f9('0x14')](0x1f4)[_0xb0f9('0x15')](_0x2ca02d);}logger[_0xb0f9('0x18')]('git\x20fetch');return _0x2a70a0[_0xb0f9('0x14')](0xc8)[_0xb0f9('0x15')]({'output':_0xb0f9('0x19')});});};exports[_0xb0f9('0x1a')]=function(_0x1242f4,_0x152d30){return git['reset']([_0xb0f9('0x1b'),_0xb0f9('0x1c')],function(_0xc9f22a){if(_0xc9f22a){logger[_0xb0f9('0x17')](_0xc9f22a);return _0x152d30[_0xb0f9('0x14')](0x1f4)['json'](_0xc9f22a);}logger[_0xb0f9('0x18')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x152d30[_0xb0f9('0x14')](0xc8)[_0xb0f9('0x15')]({'output':_0xb0f9('0x1d')});});};exports[_0xb0f9('0x1e')]=function(_0x36e329,_0x208a4f){exec(_0xb0f9('0x1f'),function(_0x342445,_0x4f8bda,_0x325dd2){logger[_0xb0f9('0x18')](_0x4f8bda);logger[_0xb0f9('0x18')](_0x325dd2);if(_0x342445){logger[_0xb0f9('0x17')](_0x342445);return _0x208a4f[_0xb0f9('0x14')](0x1f4)[_0xb0f9('0x15')](_0x342445);}return _0x208a4f['status'](0xc8)[_0xb0f9('0x15')]({'output':_0x4f8bda});});};exports[_0xb0f9('0x20')]=function(_0x170aa4,_0x4df93a){return pm2[_0xb0f9('0x20')](_0xb0f9('0x21'))[_0xb0f9('0x22')](function(_0x7fe714){logger['info']('pm2\x20restart\x20motion\x20%s',_0x7fe714);return _0x4df93a['status'](0xc8)[_0xb0f9('0x15')]({'output':_0xb0f9('0x23')});})['catch'](function(_0xc1ba7d){logger[_0xb0f9('0x17')](_0xc1ba7d);return _0x4df93a[_0xb0f9('0x14')](0x1f4)[_0xb0f9('0x15')](_0xc1ba7d);});};exports[_0xb0f9('0x24')]=function(_0x1084b9,_0x2e2fe6){var _0x4f905e=fs[_0xb0f9('0x25')](path[_0xb0f9('0x26')](config[_0xb0f9('0xd')],_0xb0f9('0x27'),_0xb0f9('0x24')));var _0x561542=[];for(var _0x5c8834=0x0;_0x5c8834<_0x4f905e[_0xb0f9('0x28')];_0x5c8834++){var _0x53816d=_0x4f905e[_0x5c8834]['replace'](_0xb0f9('0x29'),'');if(compareVersions(module[_0xb0f9('0xf')][_0xb0f9('0x4')],_0x53816d)===-0x1){_0x561542[_0xb0f9('0x2a')](_0x53816d);}}if(_0x561542['length']){var _0x5ccdd8=_0x561542[_0xb0f9('0x2b')](compareVersions);var _0x4c467d=new Umzug({'storage':_0xb0f9('0x2c'),'storageOptions':{'model':db[_0xb0f9('0x2d')],'modelName':_0xb0f9('0x2d'),'columnName':_0xb0f9('0x4')},'migrations':{'params':[db[_0xb0f9('0x2c')][_0xb0f9('0x2e')](),db[_0xb0f9('0x2c')]['constructor'],function(){throw new Error(_0xb0f9('0x2f'));}],'path':path[_0xb0f9('0x26')](config[_0xb0f9('0xd')],'server',_0xb0f9('0x24')),'pattern':/\.js$/}});_0x4c467d['up']({'migrations':_[_0xb0f9('0x30')](_0x5ccdd8,function(_0x421c85){return _0x421c85+_0xb0f9('0x29');})})['then'](function(){return _0x2e2fe6[_0xb0f9('0x14')](0xc8)[_0xb0f9('0x15')]({'output':_0xb0f9('0x31')+module['exports'][_0xb0f9('0x4')]+_0xb0f9('0x32')+_[_0xb0f9('0x33')](_0x5ccdd8),'migrations':_[_0xb0f9('0x26')](_0x5ccdd8)});})[_0xb0f9('0x34')](function(_0x58837e){if(_0x58837e instanceof db[_0xb0f9('0x2c')]['UniqueConstraintError']){return _0x2e2fe6[_0xb0f9('0x14')](0xc8)[_0xb0f9('0x15')]({'output':_0xb0f9('0x35')});}else{return _0x2e2fe6[_0xb0f9('0x14')](0x1f4)['json'](_0x58837e);}});}else{return _0x2e2fe6[_0xb0f9('0x14')](0xc8)[_0xb0f9('0x15')]({'output':_0xb0f9('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 13e5a54..d6adb13 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 _0xddd2=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xddd2,0x1da));var _0x2ddd=function(_0x200770,_0x4391ed){_0x200770=_0x200770-0x0;var _0x303db6=_0xddd2[_0x200770];return _0x303db6;};'use strict';var multer=require(_0x2ddd('0x0'));var util=require(_0x2ddd('0x1'));var path=require(_0x2ddd('0x2'));var timeout=require(_0x2ddd('0x3'));var express=require(_0x2ddd('0x4'));var router=express[_0x2ddd('0x5')]();var fs_extra=require(_0x2ddd('0x6'));var auth=require(_0x2ddd('0x7'));var interaction=require(_0x2ddd('0x8'));var config=require(_0x2ddd('0x9'));var controller=require(_0x2ddd('0xa'));router[_0x2ddd('0xb')]('/',auth[_0x2ddd('0xc')](),controller[_0x2ddd('0xd')]);router[_0x2ddd('0xb')](_0x2ddd('0xe'),auth[_0x2ddd('0xc')](),controller[_0x2ddd('0xf')]);router[_0x2ddd('0xb')](_0x2ddd('0x10'),auth['isAuthenticated'](),controller[_0x2ddd('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2ddd('0x12')](_0x2ddd('0x10'),auth[_0x2ddd('0xc')](),controller[_0x2ddd('0x13')]);router[_0x2ddd('0x14')](_0x2ddd('0x10'),auth[_0x2ddd('0xc')](),controller['destroy']);module[_0x2ddd('0x15')]=router; \ No newline at end of file +var _0xa4ee=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','update','exports','multer','util','path','express','Router'];(function(_0x13c174,_0xda25fe){var _0x160654=function(_0x1b6ac2){while(--_0x1b6ac2){_0x13c174['push'](_0x13c174['shift']());}};_0x160654(++_0xda25fe);}(_0xa4ee,0x1d6));var _0xea4e=function(_0x680b65,_0x5b2e9c){_0x680b65=_0x680b65-0x0;var _0x1c2053=_0xa4ee[_0x680b65];return _0x1c2053;};'use strict';var multer=require(_0xea4e('0x0'));var util=require(_0xea4e('0x1'));var path=require(_0xea4e('0x2'));var timeout=require('connect-timeout');var express=require(_0xea4e('0x3'));var router=express[_0xea4e('0x4')]();var fs_extra=require(_0xea4e('0x5'));var auth=require(_0xea4e('0x6'));var interaction=require(_0xea4e('0x7'));var config=require('../../config/environment');var controller=require(_0xea4e('0x8'));router[_0xea4e('0x9')]('/',auth[_0xea4e('0xa')](),controller[_0xea4e('0xb')]);router[_0xea4e('0x9')]('/describe',auth[_0xea4e('0xa')](),controller[_0xea4e('0xc')]);router['get'](_0xea4e('0xd'),auth[_0xea4e('0xa')](),controller[_0xea4e('0xe')]);router[_0xea4e('0xf')]('/',auth[_0xea4e('0xa')](),controller[_0xea4e('0x10')]);router['put'](_0xea4e('0xd'),auth['isAuthenticated'](),controller[_0xea4e('0x11')]);router['delete']('/:id',auth[_0xea4e('0xa')](),controller['destroy']);module[_0xea4e('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index e6b49e9..18e03f9 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 _0x4325=['sequelize','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x414655,_0x79d916){var _0x237884=function(_0x2737d9){while(--_0x2737d9){_0x414655['push'](_0x414655['shift']());}};_0x237884(++_0x79d916);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x5432('0x0'));module[_0x5432('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5432('0x2')]},'calleridnum':{'type':Sequelize[_0x5432('0x2')]},'calleridname':{'type':Sequelize[_0x5432('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5432('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5432('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5432('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x5432('0x3')]},'agentdumpAt':{'type':Sequelize[_0x5432('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5432('0x5')]},'agentacw':{'type':Sequelize[_0x5432('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5432('0x5')]},'reason':{'type':Sequelize[_0x5432('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5432('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5432('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5432('0x2')]},'connectedlinename':{'type':Sequelize[_0x5432('0x2')]},'language':{'type':Sequelize[_0x5432('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5432('0x2')]},'priority':{'type':Sequelize[_0x5432('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x5432('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x5432('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5432('0x2')]},'destcalleridname':{'type':Sequelize[_0x5432('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5432('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x5432('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x5432('0x2')]},'destexten':{'type':Sequelize[_0x5432('0x2')]},'destpriority':{'type':Sequelize[_0x5432('0x2')]},'destuniqueid':{'type':Sequelize[_0x5432('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x5432('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x5432('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5432('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x5432('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5432('0x2')]},'agententerreason':{'type':Sequelize[_0x5432('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x531a=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x295415,_0x15b6ff){var _0x423354=function(_0x123aa6){while(--_0x123aa6){_0x295415['push'](_0x295415['shift']());}};_0x423354(++_0x15b6ff);}(_0x531a,0x100));var _0xa531=function(_0x2eb795,_0x53ae4f){_0x2eb795=_0x2eb795-0x0;var _0x568a65=_0x531a[_0x2eb795];return _0x568a65;};'use strict';var Sequelize=require(_0xa531('0x0'));module[_0xa531('0x1')]={'type':{'type':Sequelize[_0xa531('0x2')]},'uniqueid':{'type':Sequelize[_0xa531('0x2')]},'calleridnum':{'type':Sequelize[_0xa531('0x2')]},'calleridname':{'type':Sequelize[_0xa531('0x2')]},'queue':{'type':Sequelize[_0xa531('0x2')]},'interface':{'type':Sequelize[_0xa531('0x2')]},'membername':{'type':Sequelize[_0xa531('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa531('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xa531('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0xa531('0x3')]},'holdtime':{'type':Sequelize[_0xa531('0x4')]},'agentcomplete':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa531('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xa531('0x2')]},'channel':{'type':Sequelize[_0xa531('0x2')]},'channelstate':{'type':Sequelize[_0xa531('0x4')]},'channelstatedesc':{'type':Sequelize[_0xa531('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa531('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa531('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa531('0x2')]},'exten':{'type':Sequelize[_0xa531('0x2')]},'priority':{'type':Sequelize[_0xa531('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xa531('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xa531('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xa531('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xa531('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xa531('0x2')]},'destaccountcode':{'type':Sequelize[_0xa531('0x2')]},'destcontext':{'type':Sequelize[_0xa531('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xa531('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xa531('0x2')]},'transfer':{'type':Sequelize[_0xa531('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa531('0x2')],'comment':_0xa531('0x6')},'transferexten':{'type':Sequelize[_0xa531('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xa531('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 9892e83..c92897b 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(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'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(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'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 cea0132..d2e500e 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 _0x3bd7=['VoiceAgentReport','../../config/logger','api','moment','request-promise','path','rimraf','./voiceAgentReport.attributes'];(function(_0x2e3756,_0x32670f){var _0x442861=function(_0x3cb36e){while(--_0x3cb36e){_0x2e3756['push'](_0x2e3756['shift']());}};_0x442861(++_0x32670f);}(_0x3bd7,0x199));var _0x73bd=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0x3bd7[_0x210d7f];return _0x42d687;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x73bd('0x0'))(_0x73bd('0x1'));var moment=require(_0x73bd('0x2'));var BPromise=require('bluebird');var rp=require(_0x73bd('0x3'));var fs=require('fs');var path=require(_0x73bd('0x4'));var rimraf=require(_0x73bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x73bd('0x6'));module['exports']=function(_0xe20fe9,_0x1aa5e1){return _0xe20fe9['define'](_0x73bd('0x7'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x33c5=['exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceAgentReport.attributes'];(function(_0x1b62b8,_0x3e78d9){var _0x47a5a0=function(_0x479a5b){while(--_0x479a5b){_0x1b62b8['push'](_0x1b62b8['shift']());}};_0x47a5a0(++_0x3e78d9);}(_0x33c5,0xe6));var _0x533c=function(_0x54e4ec,_0x183144){_0x54e4ec=_0x54e4ec-0x0;var _0x44ef91=_0x33c5[_0x54e4ec];return _0x44ef91;};'use strict';var _=require('lodash');var util=require(_0x533c('0x0'));var logger=require(_0x533c('0x1'))('api');var moment=require(_0x533c('0x2'));var BPromise=require(_0x533c('0x3'));var rp=require(_0x533c('0x4'));var fs=require('fs');var path=require(_0x533c('0x5'));var rimraf=require(_0x533c('0x6'));var config=require('../../config/environment');var attributes=require(_0x533c('0x7'));module[_0x533c('0x8')]=function(_0x31d912,_0x151732){return _0x31d912[_0x533c('0x9')](_0x533c('0xa'),attributes,{'tableName':_0x533c('0xb'),'paranoid':![],'indexes':[{'fields':[_0x533c('0xc'),_0x533c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 4515657..88c5469 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 _0xf9d7=['CreateVoiceAgentReport','VoiceAgentReport','body','options','UpdateVoiceAgentReport','raw','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x26840e,_0x281551){var _0x1ce00b=function(_0x111fd9){while(--_0x111fd9){_0x26840e['push'](_0x26840e['shift']());}};_0x1ce00b(++_0x281551);}(_0xf9d7,0x18d));var _0x7f9d=function(_0x14f458,_0x5dd219){_0x14f458=_0x14f458-0x0;var _0x4ff2da=_0xf9d7[_0x14f458];return _0x4ff2da;};'use strict';var _=require('lodash');var util=require(_0x7f9d('0x0'));var moment=require(_0x7f9d('0x1'));var BPromise=require(_0x7f9d('0x2'));var rs=require(_0x7f9d('0x3'));var fs=require('fs');var Redis=require(_0x7f9d('0x4'));var db=require(_0x7f9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7f9d('0x6'));var config=require(_0x7f9d('0x7'));var jayson=require(_0x7f9d('0x8'));var client=jayson[_0x7f9d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x336a8f,_0x1d0af8,_0xfc36){return new BPromise(function(_0xdb9a65,_0x473c99){return client[_0x7f9d('0xa')](_0x336a8f,_0xfc36)[_0x7f9d('0xb')](function(_0x357ca3){logger[_0x7f9d('0xc')](_0x7f9d('0xd'),_0x1d0af8,_0x7f9d('0xe'));logger[_0x7f9d('0xf')](_0x7f9d('0x10'),_0x1d0af8,'request\x20sent',JSON[_0x7f9d('0x11')](_0x357ca3));if(_0x357ca3[_0x7f9d('0x12')]){if(_0x357ca3[_0x7f9d('0x12')][_0x7f9d('0x13')]===0x1f4){logger[_0x7f9d('0x12')](_0x7f9d('0xd'),_0x1d0af8,_0x357ca3[_0x7f9d('0x12')][_0x7f9d('0x14')]);return _0x473c99(_0x357ca3[_0x7f9d('0x12')][_0x7f9d('0x14')]);}logger['error'](_0x7f9d('0xd'),_0x1d0af8,_0x357ca3[_0x7f9d('0x12')][_0x7f9d('0x14')]);return _0xdb9a65(_0x357ca3['error']['message']);}else{logger[_0x7f9d('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x1d0af8,_0x7f9d('0xe'));_0xdb9a65(_0x357ca3[_0x7f9d('0x15')][_0x7f9d('0x14')]);}})[_0x7f9d('0x16')](function(_0xfe30a0){logger[_0x7f9d('0x12')](_0x7f9d('0xd'),_0x1d0af8,_0xfe30a0);_0x473c99(_0xfe30a0);});});}exports[_0x7f9d('0x17')]=function(_0x4124f9){var _0x449a30=this;return new Promise(function(_0x29984e,_0x438ed8){return db[_0x7f9d('0x18')]['create'](_0x4124f9[_0x7f9d('0x19')],{'raw':_0x4124f9[_0x7f9d('0x1a')]?_0x4124f9[_0x7f9d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x7f9d('0xb')](function(_0x1854ce){logger['info']('CreateVoiceAgentReport',_0x4124f9);logger[_0x7f9d('0xf')](_0x7f9d('0x17'),_0x4124f9,JSON['stringify'](_0x1854ce));_0x29984e(_0x1854ce);})[_0x7f9d('0x16')](function(_0x3f4f32){logger[_0x7f9d('0x12')](_0x7f9d('0x17'),_0x3f4f32[_0x7f9d('0x14')],_0x4124f9);_0x438ed8(_0x449a30['error'](0x1f4,_0x3f4f32[_0x7f9d('0x14')]));});});};exports[_0x7f9d('0x1b')]=function(_0x21caab){var _0x4660b1=this;return new Promise(function(_0x6eb673,_0x12e097){return db[_0x7f9d('0x18')]['update'](_0x21caab[_0x7f9d('0x19')],{'raw':_0x21caab[_0x7f9d('0x1a')]?_0x21caab[_0x7f9d('0x1a')][_0x7f9d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21caab[_0x7f9d('0x1a')]?_0x21caab[_0x7f9d('0x1a')][_0x7f9d('0x1d')]||null:null,'attributes':_0x21caab['options']?_0x21caab['options']['attributes']||null:null,'limit':_0x21caab[_0x7f9d('0x1a')]?_0x21caab[_0x7f9d('0x1a')]['limit']||null:null})[_0x7f9d('0xb')](function(_0x4cf295){logger[_0x7f9d('0xc')]('UpdateVoiceAgentReport',_0x21caab);logger[_0x7f9d('0xf')](_0x7f9d('0x1b'),_0x21caab,JSON['stringify'](_0x4cf295));_0x6eb673(_0x4cf295);})[_0x7f9d('0x16')](function(_0x2610ba){logger[_0x7f9d('0x12')](_0x7f9d('0x1b'),_0x2610ba['message'],_0x21caab);_0x12e097(_0x4660b1['error'](0x1f4,_0x2610ba['message']));});});}; \ No newline at end of file +var _0x47a9=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','lodash','util','moment','bluebird','randomstring'];(function(_0x3160e6,_0x4a7bd6){var _0x5022ca=function(_0x29a871){while(--_0x29a871){_0x3160e6['push'](_0x3160e6['shift']());}};_0x5022ca(++_0x4a7bd6);}(_0x47a9,0xd4));var _0x947a=function(_0x38fc1c,_0x4cce51){_0x38fc1c=_0x38fc1c-0x0;var _0x5b23c2=_0x47a9[_0x38fc1c];return _0x5b23c2;};'use strict';var _=require(_0x947a('0x0'));var util=require(_0x947a('0x1'));var moment=require(_0x947a('0x2'));var BPromise=require(_0x947a('0x3'));var rs=require(_0x947a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x947a('0x5'))['db'];var utils=require(_0x947a('0x6'));var logger=require(_0x947a('0x7'))(_0x947a('0x8'));var config=require('../../config/environment');var jayson=require(_0x947a('0x9'));var client=jayson['client'][_0x947a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x547dec,_0x25a5e9,_0x37e9bf){return new BPromise(function(_0x56dcde,_0x31abf5){return client['request'](_0x547dec,_0x37e9bf)[_0x947a('0xb')](function(_0x2e204a){logger[_0x947a('0xc')](_0x947a('0xd'),_0x25a5e9,'request\x20sent');logger[_0x947a('0xe')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x25a5e9,_0x947a('0xf'),JSON[_0x947a('0x10')](_0x2e204a));if(_0x2e204a[_0x947a('0x11')]){if(_0x2e204a[_0x947a('0x11')][_0x947a('0x12')]===0x1f4){logger[_0x947a('0x11')](_0x947a('0xd'),_0x25a5e9,_0x2e204a['error']['message']);return _0x31abf5(_0x2e204a['error']['message']);}logger[_0x947a('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x25a5e9,_0x2e204a['error'][_0x947a('0x13')]);return _0x56dcde(_0x2e204a['error'][_0x947a('0x13')]);}else{logger[_0x947a('0xc')](_0x947a('0xd'),_0x25a5e9,_0x947a('0xf'));_0x56dcde(_0x2e204a[_0x947a('0x14')][_0x947a('0x13')]);}})[_0x947a('0x15')](function(_0x444b3c){logger[_0x947a('0x11')](_0x947a('0xd'),_0x25a5e9,_0x444b3c);_0x31abf5(_0x444b3c);});});}exports[_0x947a('0x16')]=function(_0x4380c3){var _0x7a591c=this;return new Promise(function(_0x529c9b,_0x50f4ea){return db[_0x947a('0x17')][_0x947a('0x18')](_0x4380c3[_0x947a('0x19')],{'raw':_0x4380c3[_0x947a('0x1a')]?_0x4380c3[_0x947a('0x1a')][_0x947a('0x1b')]===undefined?!![]:![]:!![]})[_0x947a('0xb')](function(_0x3bf970){logger['info'](_0x947a('0x16'),_0x4380c3);logger[_0x947a('0xe')]('CreateVoiceAgentReport',_0x4380c3,JSON[_0x947a('0x10')](_0x3bf970));_0x529c9b(_0x3bf970);})['catch'](function(_0xd4db0){logger[_0x947a('0x11')](_0x947a('0x16'),_0xd4db0[_0x947a('0x13')],_0x4380c3);_0x50f4ea(_0x7a591c[_0x947a('0x11')](0x1f4,_0xd4db0[_0x947a('0x13')]));});});};exports[_0x947a('0x1c')]=function(_0x5d87ad){var _0x1e87de=this;return new Promise(function(_0x254061,_0x4bcae3){return db[_0x947a('0x17')][_0x947a('0x1d')](_0x5d87ad[_0x947a('0x19')],{'raw':_0x5d87ad[_0x947a('0x1a')]?_0x5d87ad[_0x947a('0x1a')][_0x947a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d87ad[_0x947a('0x1a')]?_0x5d87ad['options'][_0x947a('0x1e')]||null:null,'attributes':_0x5d87ad[_0x947a('0x1a')]?_0x5d87ad[_0x947a('0x1a')]['attributes']||null:null,'limit':_0x5d87ad[_0x947a('0x1a')]?_0x5d87ad[_0x947a('0x1a')]['limit']||null:null})['then'](function(_0x2facc6){logger[_0x947a('0xc')](_0x947a('0x1c'),_0x5d87ad);logger[_0x947a('0xe')](_0x947a('0x1c'),_0x5d87ad,JSON[_0x947a('0x10')](_0x2facc6));_0x254061(_0x2facc6);})['catch'](function(_0x1a4afe){logger[_0x947a('0x11')](_0x947a('0x1c'),_0x1a4afe['message'],_0x5d87ad);_0x4bcae3(_0x1e87de[_0x947a('0x11')](0x1f4,_0x1a4afe[_0x947a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index f10b144..c54ec61 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 _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0xca9e,0x136));var _0xeca9=function(_0x1c72df,_0x47d2ac){_0x1c72df=_0x1c72df-0x0;var _0x3dac21=_0xca9e[_0x1c72df];return _0x3dac21;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router; \ No newline at end of file +var _0x9c5a=['fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','show','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4526cc,_0x58b7b6){_0x4526cc=_0x4526cc-0x0;var _0x4158e7=_0x9c5a[_0x4526cc];return _0x4158e7;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./voiceCallReport.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['post']('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xd')]);router['put']('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')](_0xa9c5('0x10'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);module[_0xa9c5('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e0eae34..88dc4bc 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 _0x7e3b=['internal','outbound','inbound-fax','outbound-fax','dialer','DATE','INTEGER','exports','STRING','ENUM','inbound'];(function(_0x4a1db4,_0x48b131){var _0x17073c=function(_0x1fe1e5){while(--_0x1fe1e5){_0x4a1db4['push'](_0x4a1db4['shift']());}};_0x17073c(++_0x48b131);}(_0x7e3b,0xd8));var _0xb7e3=function(_0x54b314,_0x426c6c){_0x54b314=_0x54b314-0x0;var _0x23c139=_0x7e3b[_0x54b314];return _0x23c139;};'use strict';var Sequelize=require('sequelize');module[_0xb7e3('0x0')]={'uniqueid':{'type':Sequelize[_0xb7e3('0x1')]},'type':{'type':Sequelize[_0xb7e3('0x2')](_0xb7e3('0x3'),_0xb7e3('0x4'),_0xb7e3('0x5'),_0xb7e3('0x6'),_0xb7e3('0x7'),_0xb7e3('0x8'))},'tag':{'type':Sequelize[_0xb7e3('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xb7e3('0x1')]},'destination':{'type':Sequelize[_0xb7e3('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xb7e3('0x1')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0xb7e3('0x1')]},'lastapplication':{'type':Sequelize[_0xb7e3('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xb7e3('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb7e3('0x9')]},'endtime':{'type':Sequelize[_0xb7e3('0x9')]},'duration':{'type':Sequelize[_0xb7e3('0xa')]},'billableseconds':{'type':Sequelize[_0xb7e3('0xa')]},'mohtime':{'type':Sequelize[_0xb7e3('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb7e3('0x1')]},'amaflags':{'type':Sequelize[_0xb7e3('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xb7e3('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xb7e3('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xb7e3('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb7e3('0x1')]},'routeid':{'type':Sequelize[_0xb7e3('0xa')]},'sipcallid':{'type':Sequelize[_0xb7e3('0x1')]}}; \ No newline at end of file +var _0xd397=['outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal'];(function(_0x4bc4e9,_0x2f2833){var _0x41dec7=function(_0x503fb2){while(--_0x503fb2){_0x4bc4e9['push'](_0x4bc4e9['shift']());}};_0x41dec7(++_0x2f2833);}(_0xd397,0xae));var _0x7d39=function(_0x3028db,_0x109c73){_0x3028db=_0x3028db-0x0;var _0x5791dd=_0xd397[_0x3028db];return _0x5791dd;};'use strict';var Sequelize=require(_0x7d39('0x0'));module[_0x7d39('0x1')]={'uniqueid':{'type':Sequelize[_0x7d39('0x2')]},'type':{'type':Sequelize[_0x7d39('0x3')](_0x7d39('0x4'),_0x7d39('0x5'),_0x7d39('0x6'),'inbound-fax',_0x7d39('0x7'),_0x7d39('0x8'))},'tag':{'type':Sequelize[_0x7d39('0x2')]},'accountcode':{'type':Sequelize[_0x7d39('0x2')]},'source':{'type':Sequelize[_0x7d39('0x2')]},'destination':{'type':Sequelize[_0x7d39('0x2')]},'destinationcontext':{'type':Sequelize[_0x7d39('0x2')]},'callerid':{'type':Sequelize[_0x7d39('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x7d39('0x2')]},'lastdata':{'type':Sequelize[_0x7d39('0x9')]},'starttime':{'type':Sequelize[_0x7d39('0xa')]},'systemanswertime':{'type':Sequelize[_0x7d39('0xa')]},'answertime':{'type':Sequelize[_0x7d39('0xa')]},'endtime':{'type':Sequelize[_0x7d39('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x7d39('0xb')]},'mohtime':{'type':Sequelize[_0x7d39('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7d39('0x2')]},'userfield':{'type':Sequelize[_0x7d39('0x2')]},'userDisposition':{'type':Sequelize[_0x7d39('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x7d39('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x7d39('0x2')]},'note':{'type':Sequelize[_0x7d39('0x2')]},'prefix':{'type':Sequelize[_0x7d39('0x2')]},'routeid':{'type':Sequelize[_0x7d39('0xb')]},'sipcallid':{'type':Sequelize[_0x7d39('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 36802b2..f0c88a5 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0xadb5,0xad));var _0x5adb=function(_0x408d46,_0x4de6d2){_0x408d46=_0x408d46-0x0;var _0x108f89=_0xadb5[_0x408d46];return _0x108f89;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index c618068..ef5188b 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 _0x851e=['api','moment','request-promise','path','rimraf','exports','define','uniqueid','lodash','util','../../config/logger'];(function(_0x42d0bb,_0x11dfb2){var _0x29aca9=function(_0x12cad7){while(--_0x12cad7){_0x42d0bb['push'](_0x42d0bb['shift']());}};_0x29aca9(++_0x11dfb2);}(_0x851e,0x13c));var _0xe851=function(_0x337565,_0x3198ec){_0x337565=_0x337565-0x0;var _0x197ff3=_0x851e[_0x337565];return _0x197ff3;};'use strict';var _=require(_0xe851('0x0'));var util=require(_0xe851('0x1'));var logger=require(_0xe851('0x2'))(_0xe851('0x3'));var moment=require(_0xe851('0x4'));var BPromise=require('bluebird');var rp=require(_0xe851('0x5'));var fs=require('fs');var path=require(_0xe851('0x6'));var rimraf=require(_0xe851('0x7'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0xe851('0x8')]=function(_0x51d60b,_0x2c4082){return _0x51d60b[_0xe851('0x9')]('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xe851('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9515=['report_call','lodash','api','request-promise','path','rimraf','../../config/environment','exports','define','VoiceCallReport'];(function(_0x2ba813,_0x99d182){var _0x1b56c0=function(_0x4c885d){while(--_0x4c885d){_0x2ba813['push'](_0x2ba813['shift']());}};_0x1b56c0(++_0x99d182);}(_0x9515,0xe7));var _0x5951=function(_0x4d45d6,_0x2c74f0){_0x4d45d6=_0x4d45d6-0x0;var _0x19cd3f=_0x9515[_0x4d45d6];return _0x19cd3f;};'use strict';var _=require(_0x5951('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5951('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5951('0x2'));var fs=require('fs');var path=require(_0x5951('0x3'));var rimraf=require(_0x5951('0x4'));var config=require(_0x5951('0x5'));var attributes=require('./voiceCallReport.attributes');module[_0x5951('0x6')]=function(_0xa35d0f,_0x2bb252){return _0xa35d0f[_0x5951('0x7')](_0x5951('0x8'),attributes,{'tableName':_0x5951('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index d0f29ee..0d1aaec 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 _0x2435=['debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetVoiceCallReport','stringify','VoiceCallReport','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2435,0xde));var _0x5243=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x2435[_0xbf8ebe];return _0x1e25e8;};'use strict';var _=require('lodash');var util=require(_0x5243('0x0'));var moment=require(_0x5243('0x1'));var BPromise=require(_0x5243('0x2'));var rs=require(_0x5243('0x3'));var fs=require('fs');var Redis=require(_0x5243('0x4'));var db=require(_0x5243('0x5'))['db'];var utils=require(_0x5243('0x6'));var logger=require(_0x5243('0x7'))(_0x5243('0x8'));var config=require(_0x5243('0x9'));var jayson=require(_0x5243('0xa'));var client=jayson[_0x5243('0xb')][_0x5243('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x199df3,_0x3e2656,_0x1fe72d){return new BPromise(function(_0x1379fa,_0x24ad9e){return client[_0x5243('0xd')](_0x199df3,_0x1fe72d)[_0x5243('0xe')](function(_0x3c5b66){logger[_0x5243('0xf')](_0x5243('0x10'),_0x3e2656,_0x5243('0x11'));logger[_0x5243('0x12')](_0x5243('0x13'),_0x3e2656,'request\x20sent',JSON['stringify'](_0x3c5b66));if(_0x3c5b66[_0x5243('0x14')]){if(_0x3c5b66['error'][_0x5243('0x15')]===0x1f4){logger[_0x5243('0x14')](_0x5243('0x10'),_0x3e2656,_0x3c5b66[_0x5243('0x14')][_0x5243('0x16')]);return _0x24ad9e(_0x3c5b66[_0x5243('0x14')][_0x5243('0x16')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x3e2656,_0x3c5b66['error'][_0x5243('0x16')]);return _0x1379fa(_0x3c5b66[_0x5243('0x14')][_0x5243('0x16')]);}else{logger[_0x5243('0xf')](_0x5243('0x10'),_0x3e2656,_0x5243('0x11'));_0x1379fa(_0x3c5b66[_0x5243('0x17')][_0x5243('0x16')]);}})[_0x5243('0x18')](function(_0x345c83){logger[_0x5243('0x14')](_0x5243('0x10'),_0x3e2656,_0x345c83);_0x24ad9e(_0x345c83);});});}exports['GetVoiceCallReport']=function(_0x3167d3){var _0x5e8c47=this;return new Promise(function(_0x112284,_0x424b71){return db['VoiceCallReport']['findAll']({'raw':_0x3167d3['options']?_0x3167d3[_0x5243('0x19')][_0x5243('0x1a')]===undefined?!![]:![]:!![],'where':_0x3167d3[_0x5243('0x19')]?_0x3167d3['options'][_0x5243('0x1b')]||null:null,'attributes':_0x3167d3['options']?_0x3167d3[_0x5243('0x19')][_0x5243('0x1c')]||null:null,'limit':_0x3167d3[_0x5243('0x19')]?_0x3167d3[_0x5243('0x19')][_0x5243('0x1d')]||null:null,'include':_0x3167d3[_0x5243('0x19')]?_0x3167d3[_0x5243('0x19')][_0x5243('0x1e')]?_[_0x5243('0x1f')](_0x3167d3[_0x5243('0x19')][_0x5243('0x1e')],function(_0x112921){return{'model':db[_0x112921[_0x5243('0x20')]],'as':_0x112921['as'],'attributes':_0x112921['attributes'],'include':_0x112921[_0x5243('0x1e')]?_[_0x5243('0x1f')](_0x112921['include'],function(_0x3c2d0b){return{'model':db[_0x3c2d0b[_0x5243('0x20')]],'as':_0x3c2d0b['as'],'attributes':_0x3c2d0b['attributes'],'include':_0x3c2d0b[_0x5243('0x1e')]?_[_0x5243('0x1f')](_0x3c2d0b[_0x5243('0x1e')],function(_0x38b8a2){return{'model':db[_0x38b8a2[_0x5243('0x20')]],'as':_0x38b8a2['as'],'attributes':_0x38b8a2[_0x5243('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5243('0xe')](function(_0x3527cc){logger['info']('GetVoiceCallReport',_0x3167d3);logger['debug'](_0x5243('0x21'),_0x3167d3,JSON[_0x5243('0x22')](_0x3527cc));_0x112284(_0x3527cc);})['catch'](function(_0x57e21a){logger['error'](_0x5243('0x21'),_0x57e21a['message'],_0x3167d3);_0x424b71(_0x5e8c47[_0x5243('0x14')](0x1f4,_0x57e21a[_0x5243('0x16')]));});});};exports['CreateVoiceCallReport']=function(_0x218e17){var _0x2eda36=this;return new Promise(function(_0x269573,_0x1061e5){return db[_0x5243('0x23')]['create'](_0x218e17[_0x5243('0x24')],{'raw':_0x218e17[_0x5243('0x19')]?_0x218e17[_0x5243('0x19')][_0x5243('0x1a')]===undefined?!![]:![]:!![]})[_0x5243('0xe')](function(_0x108544){logger['info']('CreateVoiceCallReport',_0x218e17);logger[_0x5243('0x12')](_0x5243('0x25'),_0x218e17,JSON[_0x5243('0x22')](_0x108544));_0x269573(_0x108544);})[_0x5243('0x18')](function(_0x2a9ec2){logger[_0x5243('0x14')](_0x5243('0x25'),_0x2a9ec2[_0x5243('0x16')],_0x218e17);_0x1061e5(_0x2eda36[_0x5243('0x14')](0x1f4,_0x2a9ec2[_0x5243('0x16')]));});});};exports[_0x5243('0x26')]=function(_0x1ead73){var _0x277037=this;return new Promise(function(_0x53f4c2,_0x185cfa){return db[_0x5243('0x23')][_0x5243('0x27')](_0x1ead73[_0x5243('0x24')],{'raw':_0x1ead73[_0x5243('0x19')]?_0x1ead73['options'][_0x5243('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ead73[_0x5243('0x19')]?_0x1ead73[_0x5243('0x19')][_0x5243('0x1b')]||null:null,'attributes':_0x1ead73['options']?_0x1ead73[_0x5243('0x19')][_0x5243('0x1c')]||null:null,'limit':_0x1ead73[_0x5243('0x19')]?_0x1ead73[_0x5243('0x19')][_0x5243('0x1d')]||null:null})[_0x5243('0xe')](function(_0xe4ccb6){logger[_0x5243('0xf')]('UpdateVoiceCallReport',_0x1ead73);logger[_0x5243('0x12')](_0x5243('0x26'),_0x1ead73,JSON[_0x5243('0x22')](_0xe4ccb6));_0x53f4c2(_0xe4ccb6);})[_0x5243('0x18')](function(_0x5af4ab){logger[_0x5243('0x14')](_0x5243('0x26'),_0x5af4ab[_0x5243('0x16')],_0x1ead73);_0x185cfa(_0x277037['error'](0x1f4,_0x5af4ab['message']));});});}; \ No newline at end of file +var _0x2c0b=['VoiceCallReport','options','raw','where','attributes','include','map','model','then','CreateVoiceCallReport','body','update','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x2c0b,0x8c));var _0xb2c0=function(_0x5aed25,_0xd91252){_0x5aed25=_0x5aed25-0x0;var _0x2761e9=_0x2c0b[_0x5aed25];return _0x2761e9;};'use strict';var _=require(_0xb2c0('0x0'));var util=require('util');var moment=require(_0xb2c0('0x1'));var BPromise=require('bluebird');var rs=require(_0xb2c0('0x2'));var fs=require('fs');var Redis=require(_0xb2c0('0x3'));var db=require(_0xb2c0('0x4'))['db'];var utils=require(_0xb2c0('0x5'));var logger=require('../../config/logger')(_0xb2c0('0x6'));var config=require(_0xb2c0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb2c0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489530,_0x5d93bd,_0x227847){return new BPromise(function(_0x47f15c,_0x59cd7d){return client['request'](_0x489530,_0x227847)['then'](function(_0x5a9bd7){logger['info'](_0xb2c0('0x9'),_0x5d93bd,_0xb2c0('0xa'));logger[_0xb2c0('0xb')](_0xb2c0('0xc'),_0x5d93bd,'request\x20sent',JSON[_0xb2c0('0xd')](_0x5a9bd7));if(_0x5a9bd7[_0xb2c0('0xe')]){if(_0x5a9bd7[_0xb2c0('0xe')][_0xb2c0('0xf')]===0x1f4){logger[_0xb2c0('0xe')](_0xb2c0('0x9'),_0x5d93bd,_0x5a9bd7[_0xb2c0('0xe')]['message']);return _0x59cd7d(_0x5a9bd7[_0xb2c0('0xe')][_0xb2c0('0x10')]);}logger[_0xb2c0('0xe')](_0xb2c0('0x9'),_0x5d93bd,_0x5a9bd7[_0xb2c0('0xe')][_0xb2c0('0x10')]);return _0x47f15c(_0x5a9bd7['error'][_0xb2c0('0x10')]);}else{logger[_0xb2c0('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x5d93bd,'request\x20sent');_0x47f15c(_0x5a9bd7[_0xb2c0('0x12')][_0xb2c0('0x10')]);}})[_0xb2c0('0x13')](function(_0x1ebd53){logger['error'](_0xb2c0('0x9'),_0x5d93bd,_0x1ebd53);_0x59cd7d(_0x1ebd53);});});}exports['GetVoiceCallReport']=function(_0x21c7e3){var _0x4bd338=this;return new Promise(function(_0x426da1,_0x5d7b8e){return db[_0xb2c0('0x14')]['findAll']({'raw':_0x21c7e3[_0xb2c0('0x15')]?_0x21c7e3[_0xb2c0('0x15')][_0xb2c0('0x16')]===undefined?!![]:![]:!![],'where':_0x21c7e3['options']?_0x21c7e3[_0xb2c0('0x15')][_0xb2c0('0x17')]||null:null,'attributes':_0x21c7e3[_0xb2c0('0x15')]?_0x21c7e3[_0xb2c0('0x15')][_0xb2c0('0x18')]||null:null,'limit':_0x21c7e3[_0xb2c0('0x15')]?_0x21c7e3['options']['limit']||null:null,'include':_0x21c7e3[_0xb2c0('0x15')]?_0x21c7e3[_0xb2c0('0x15')][_0xb2c0('0x19')]?_[_0xb2c0('0x1a')](_0x21c7e3[_0xb2c0('0x15')][_0xb2c0('0x19')],function(_0x37a7f3){return{'model':db[_0x37a7f3[_0xb2c0('0x1b')]],'as':_0x37a7f3['as'],'attributes':_0x37a7f3['attributes'],'include':_0x37a7f3['include']?_['map'](_0x37a7f3[_0xb2c0('0x19')],function(_0x365b74){return{'model':db[_0x365b74[_0xb2c0('0x1b')]],'as':_0x365b74['as'],'attributes':_0x365b74[_0xb2c0('0x18')],'include':_0x365b74[_0xb2c0('0x19')]?_[_0xb2c0('0x1a')](_0x365b74['include'],function(_0x3bc564){return{'model':db[_0x3bc564[_0xb2c0('0x1b')]],'as':_0x3bc564['as'],'attributes':_0x3bc564[_0xb2c0('0x18')]};}):[]};}):[]};}):[]:[]})[_0xb2c0('0x1c')](function(_0x9d7e77){logger['info']('GetVoiceCallReport',_0x21c7e3);logger[_0xb2c0('0xb')]('GetVoiceCallReport',_0x21c7e3,JSON[_0xb2c0('0xd')](_0x9d7e77));_0x426da1(_0x9d7e77);})[_0xb2c0('0x13')](function(_0x588692){logger[_0xb2c0('0xe')]('GetVoiceCallReport',_0x588692[_0xb2c0('0x10')],_0x21c7e3);_0x5d7b8e(_0x4bd338['error'](0x1f4,_0x588692[_0xb2c0('0x10')]));});});};exports[_0xb2c0('0x1d')]=function(_0x5e4eae){var _0x5e65da=this;return new Promise(function(_0x56f2e4,_0xfbe1e2){return db[_0xb2c0('0x14')]['create'](_0x5e4eae[_0xb2c0('0x1e')],{'raw':_0x5e4eae[_0xb2c0('0x15')]?_0x5e4eae[_0xb2c0('0x15')][_0xb2c0('0x16')]===undefined?!![]:![]:!![]})[_0xb2c0('0x1c')](function(_0x5129dd){logger[_0xb2c0('0x11')]('CreateVoiceCallReport',_0x5e4eae);logger[_0xb2c0('0xb')](_0xb2c0('0x1d'),_0x5e4eae,JSON['stringify'](_0x5129dd));_0x56f2e4(_0x5129dd);})['catch'](function(_0xdceeee){logger['error'](_0xb2c0('0x1d'),_0xdceeee[_0xb2c0('0x10')],_0x5e4eae);_0xfbe1e2(_0x5e65da[_0xb2c0('0xe')](0x1f4,_0xdceeee[_0xb2c0('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x53a44f){var _0x3163e8=this;return new Promise(function(_0x2e5c3d,_0x1e6b7c){return db['VoiceCallReport'][_0xb2c0('0x1f')](_0x53a44f['body'],{'raw':_0x53a44f[_0xb2c0('0x15')]?_0x53a44f[_0xb2c0('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53a44f[_0xb2c0('0x15')]?_0x53a44f['options'][_0xb2c0('0x17')]||null:null,'attributes':_0x53a44f[_0xb2c0('0x15')]?_0x53a44f[_0xb2c0('0x15')][_0xb2c0('0x18')]||null:null,'limit':_0x53a44f[_0xb2c0('0x15')]?_0x53a44f[_0xb2c0('0x15')]['limit']||null:null})['then'](function(_0x344723){logger[_0xb2c0('0x11')]('UpdateVoiceCallReport',_0x53a44f);logger[_0xb2c0('0xb')]('UpdateVoiceCallReport',_0x53a44f,JSON[_0xb2c0('0xd')](_0x344723));_0x2e5c3d(_0x344723);})[_0xb2c0('0x13')](function(_0x418e90){logger[_0xb2c0('0xe')]('UpdateVoiceCallReport',_0x418e90[_0xb2c0('0x10')],_0x53a44f);_0x1e6b7c(_0x3163e8[_0xb2c0('0xe')](0x1f4,_0x418e90[_0xb2c0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index ad308a7..e694b63 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 _0x2331=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','post','create','put','/:id'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x2331,0x1b3));var _0x1233=function(_0x3d13bb,_0x262a54){_0x3d13bb=_0x3d13bb-0x0;var _0x4b5a1b=_0x2331[_0x3d13bb];return _0x4b5a1b;};'use strict';var multer=require(_0x1233('0x0'));var util=require(_0x1233('0x1'));var path=require(_0x1233('0x2'));var timeout=require(_0x1233('0x3'));var express=require(_0x1233('0x4'));var router=express[_0x1233('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1233('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1233('0x7'));var controller=require(_0x1233('0x8'));router[_0x1233('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x1233('0xa')](),controller['show']);router[_0x1233('0xb')]('/',auth[_0x1233('0xa')](),controller[_0x1233('0xc')]);router[_0x1233('0xd')](_0x1233('0xe'),auth[_0x1233('0xa')](),controller[_0x1233('0xf')]);router['delete'](_0x1233('0xe'),auth['isAuthenticated'](),controller[_0x1233('0x10')]);module[_0x1233('0x11')]=router; \ No newline at end of file +var _0x35b4=['fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','update','destroy','exports','multer','connect-timeout','Router'];(function(_0x77a668,_0x4aa05f){var _0xf21b10=function(_0xd43ec1){while(--_0xd43ec1){_0x77a668['push'](_0x77a668['shift']());}};_0xf21b10(++_0x4aa05f);}(_0x35b4,0xcd));var _0x435b=function(_0x183116,_0x326f1a){_0x183116=_0x183116-0x0;var _0x294bd6=_0x35b4[_0x183116];return _0x294bd6;};'use strict';var multer=require(_0x435b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x435b('0x1'));var express=require('express');var router=express[_0x435b('0x2')]();var fs_extra=require(_0x435b('0x3'));var auth=require(_0x435b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x435b('0x5'));var controller=require(_0x435b('0x6'));router[_0x435b('0x7')]('/',auth['isAuthenticated'](),controller[_0x435b('0x8')]);router[_0x435b('0x7')](_0x435b('0x9'),auth[_0x435b('0xa')](),controller[_0x435b('0xb')]);router[_0x435b('0xc')]('/',auth[_0x435b('0xa')](),controller['create']);router['put'](_0x435b('0x9'),auth[_0x435b('0xa')](),controller[_0x435b('0xd')]);router['delete'](_0x435b('0x9'),auth[_0x435b('0xa')](),controller[_0x435b('0xe')]);module[_0x435b('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 9810ed8..ab858a5 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 _0x385b=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x3ba0e8,_0x96adc1){var _0x1ae36a=function(_0x5be0ff){while(--_0x5be0ff){_0x3ba0e8['push'](_0x3ba0e8['shift']());}};_0x1ae36a(++_0x96adc1);}(_0x385b,0x6f));var _0xb385=function(_0x33c9d7,_0x65cd8f){_0x33c9d7=_0x33c9d7-0x0;var _0x99cd88=_0x385b[_0x33c9d7];return _0x99cd88;};'use strict';var Sequelize=require(_0xb385('0x0'));module[_0xb385('0x1')]={'name':{'type':Sequelize[_0xb385('0x2')]},'prefix':{'type':Sequelize[_0xb385('0x2')],'unique':_0xb385('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xb385('0x2')],'set':function(_0x40d0f7){this[_0xb385('0x4')](_0xb385('0x5'),_0x40d0f7?_0x40d0f7[_0xb385('0x6')](''):[]);},'get':function(){return this[_0xb385('0x7')](_0xb385('0x5'))?this[_0xb385('0x7')](_0xb385('0x5'))[_0xb385('0x8')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xb385('0x2')]},'record':{'type':Sequelize[_0xb385('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x45ff=['STRING','name','setDataValue','join','getDataValue','options','BOOLEAN','sequelize'];(function(_0x47ca58,_0x540f3a){var _0x2dbf65=function(_0x2ab567){while(--_0x2ab567){_0x47ca58['push'](_0x47ca58['shift']());}};_0x2dbf65(++_0x540f3a);}(_0x45ff,0x67));var _0xf45f=function(_0x562362,_0x5d54f4){_0x562362=_0x562362-0x0;var _0x3a18ce=_0x45ff[_0x562362];return _0x3a18ce;};'use strict';var Sequelize=require(_0xf45f('0x0'));module['exports']={'name':{'type':Sequelize[_0xf45f('0x1')]},'prefix':{'type':Sequelize[_0xf45f('0x1')],'unique':_0xf45f('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x303818){this[_0xf45f('0x3')]('options',_0x303818?_0x303818[_0xf45f('0x4')](''):[]);},'get':function(){return this[_0xf45f('0x5')]('options')?this[_0xf45f('0x5')](_0xf45f('0x6'))['split'](''):[];}},'auth':{'type':Sequelize[_0xf45f('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xf45f('0x1')]},'record':{'type':Sequelize[_0xf45f('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf45f('0x1')]},'description':{'type':Sequelize[_0xf45f('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4376cce..66b089c 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 _0x25a3=['end','sendStatus','error','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','ChanSpies'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x25a3,0x121));var _0x325a=function(_0x17c2d9,_0x3596b0){_0x17c2d9=_0x17c2d9-0x0;var _0x450828=_0x25a3[_0x17c2d9];return _0x450828;};'use strict';var emlformat=require(_0x325a('0x0'));var rimraf=require(_0x325a('0x1'));var zipdir=require(_0x325a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x325a('0x3'));var moment=require('moment');var BPromise=require(_0x325a('0x4'));var Mustache=require(_0x325a('0x5'));var util=require(_0x325a('0x6'));var path=require('path');var sox=require(_0x325a('0x7'));var csv=require(_0x325a('0x8'));var ejs=require(_0x325a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x325a('0xa'));var crypto=require(_0x325a('0xb'));var jsforce=require(_0x325a('0xc'));var deskjs=require(_0x325a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x325a('0xe'));var Redis=require(_0x325a('0xf'));var authService=require(_0x325a('0x10'));var qs=require(_0x325a('0x11'));var as=require(_0x325a('0x12'));var hardwareService=require(_0x325a('0x13'));var logger=require('../../config/logger')(_0x325a('0x14'));var utils=require(_0x325a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x325a('0x16'));var db=require(_0x325a('0x17'))['db'];function respondWithStatusCode(_0x2a8750,_0x3e90fe){_0x3e90fe=_0x3e90fe||0xcc;return function(_0x4e3b88){if(_0x4e3b88){return _0x2a8750['sendStatus'](_0x3e90fe);}return _0x2a8750[_0x325a('0x18')](_0x3e90fe)['end']();};}function respondWithResult(_0x3d12d5,_0xa8dc3a){_0xa8dc3a=_0xa8dc3a||0xc8;return function(_0x3db556){if(_0x3db556){return _0x3d12d5[_0x325a('0x18')](_0xa8dc3a)[_0x325a('0x19')](_0x3db556);}};}function respondWithFilteredResult(_0x3d198c,_0x1d7efc){return function(_0x4412ba){if(_0x4412ba){var _0x1fd4ec=typeof _0x1d7efc[_0x325a('0x1a')]===_0x325a('0x1b')&&typeof _0x1d7efc[_0x325a('0x1c')]===_0x325a('0x1b');var _0x1dcafe=_0x4412ba['count'];var _0x4cba7=_0x1fd4ec?0x0:_0x1d7efc[_0x325a('0x1a')];var _0x4a1f9f=_0x1fd4ec?_0x4412ba[_0x325a('0x1d')]:_0x1d7efc[_0x325a('0x1a')]+_0x1d7efc[_0x325a('0x1c')];var _0x297599;if(_0x4a1f9f>=_0x1dcafe){_0x4a1f9f=_0x1dcafe;_0x297599=0xc8;}else{_0x297599=0xce;}_0x3d198c[_0x325a('0x18')](_0x297599);return _0x3d198c[_0x325a('0x1e')](_0x325a('0x1f'),_0x4cba7+'-'+_0x4a1f9f+'/'+_0x1dcafe)[_0x325a('0x19')](_0x4412ba);}return null;};}function patchUpdates(_0x347f2d){return function(_0x1d76b7){try{jsonpatch[_0x325a('0x20')](_0x1d76b7,_0x347f2d,!![]);}catch(_0x11f0cb){return BPromise['reject'](_0x11f0cb);}return _0x1d76b7[_0x325a('0x21')]();};}function saveUpdates(_0x32a2f5,_0x18e29f){return function(_0x192e83){if(_0x192e83){return _0x192e83[_0x325a('0x22')](_0x32a2f5)[_0x325a('0x23')](function(_0x4c21bf){return _0x4c21bf;});}return null;};}function removeEntity(_0x36b2ac,_0x4c403d){return function(_0x15b5a6){if(_0x15b5a6){return _0x15b5a6[_0x325a('0x24')]()[_0x325a('0x23')](function(){var _0x22c4a6=_0x15b5a6[_0x325a('0x25')]({'plain':!![]});var _0x4b3d65=_0x325a('0x26');return db['UserProfileResource'][_0x325a('0x24')]({'where':{'type':_0x4b3d65,'resourceId':_0x22c4a6['id']}})[_0x325a('0x23')](function(){return _0x15b5a6;});})[_0x325a('0x23')](function(){_0x36b2ac['status'](0xcc)[_0x325a('0x27')]();});}};}function handleEntityNotFound(_0x33bfc0,_0x2514df){return function(_0x473d91){if(!_0x473d91){_0x33bfc0[_0x325a('0x28')](0x194);}return _0x473d91;};}function handleError(_0x18a8d7,_0x19b002){_0x19b002=_0x19b002||0x1f4;return function(_0x49d93b){logger[_0x325a('0x29')](_0x49d93b['stack']);if(_0x49d93b[_0x325a('0x2a')]){delete _0x49d93b[_0x325a('0x2a')];}_0x18a8d7[_0x325a('0x18')](_0x19b002)[_0x325a('0x2b')](_0x49d93b);};}exports[_0x325a('0x2c')]=function(_0x5acbcd,_0x27b3f7){var _0x4b1e46={},_0x34ef69={},_0x1f487e={'count':0x0,'rows':[]};var _0x5b66e9=_[_0x325a('0x2d')](db[_0x325a('0x2e')][_0x325a('0x2f')],function(_0x4129b3){return{'name':_0x4129b3['fieldName'],'type':_0x4129b3[_0x325a('0x30')][_0x325a('0x31')]};});_0x34ef69[_0x325a('0x32')]=_[_0x325a('0x2d')](_0x5b66e9,'name');_0x34ef69[_0x325a('0x33')]=_[_0x325a('0x34')](_0x5acbcd[_0x325a('0x33')]);_0x34ef69[_0x325a('0x35')]=_[_0x325a('0x36')](_0x34ef69[_0x325a('0x32')],_0x34ef69['query']);_0x4b1e46[_0x325a('0x37')]=_[_0x325a('0x36')](_0x34ef69['model'],qs[_0x325a('0x38')](_0x5acbcd[_0x325a('0x33')]['fields']));_0x4b1e46[_0x325a('0x37')]=_0x4b1e46['attributes'][_0x325a('0x39')]?_0x4b1e46[_0x325a('0x37')]:_0x34ef69[_0x325a('0x32')];if(!_0x5acbcd[_0x325a('0x33')]['hasOwnProperty'](_0x325a('0x3a'))){_0x4b1e46['limit']=qs[_0x325a('0x1c')](_0x5acbcd['query']['limit']);_0x4b1e46[_0x325a('0x1a')]=qs[_0x325a('0x1a')](_0x5acbcd[_0x325a('0x33')]['offset']);}_0x4b1e46[_0x325a('0x3b')]=qs['sort'](_0x5acbcd[_0x325a('0x33')][_0x325a('0x3c')]);_0x4b1e46[_0x325a('0x3d')]=qs[_0x325a('0x35')](_[_0x325a('0x3e')](_0x5acbcd[_0x325a('0x33')],_0x34ef69[_0x325a('0x35')]),_0x5b66e9);if(_0x5acbcd[_0x325a('0x33')]['filter']){_0x4b1e46[_0x325a('0x3d')]=_[_0x325a('0x3f')](_0x4b1e46[_0x325a('0x3d')],{'$or':_[_0x325a('0x2d')](_0x5b66e9,function(_0x3056f8){if(_0x3056f8[_0x325a('0x30')]!==_0x325a('0x40')){var _0x145c1f={};_0x145c1f[_0x3056f8[_0x325a('0x2a')]]={'$like':'%'+_0x5acbcd['query'][_0x325a('0x41')]+'%'};return _0x145c1f;}})});}_0x4b1e46=_[_0x325a('0x3f')]({},_0x4b1e46,_0x5acbcd[_0x325a('0x42')]);var _0x2b2f05={'where':_0x4b1e46[_0x325a('0x3d')]};return db[_0x325a('0x2e')][_0x325a('0x1d')](_0x2b2f05)[_0x325a('0x23')](function(_0x384e62){_0x1f487e[_0x325a('0x1d')]=_0x384e62;if(_0x5acbcd[_0x325a('0x33')]['includeAll']){_0x4b1e46[_0x325a('0x43')]=[{'all':!![]}];}return db[_0x325a('0x2e')][_0x325a('0x44')](_0x4b1e46);})[_0x325a('0x23')](function(_0x2750dd){_0x1f487e[_0x325a('0x45')]=_0x2750dd;return _0x1f487e;})['then'](respondWithFilteredResult(_0x27b3f7,_0x4b1e46))[_0x325a('0x46')](handleError(_0x27b3f7,null));};exports[_0x325a('0x47')]=function(_0x2984f3,_0x363682){var _0x1f46e9={'raw':![],'where':{'id':_0x2984f3[_0x325a('0x48')]['id']}},_0x5924af={};_0x5924af[_0x325a('0x32')]=_[_0x325a('0x34')](db['VoiceChanSpy'][_0x325a('0x2f')]);_0x5924af[_0x325a('0x33')]=_[_0x325a('0x34')](_0x2984f3['query']);_0x5924af['filters']=_[_0x325a('0x36')](_0x5924af[_0x325a('0x32')],_0x5924af[_0x325a('0x33')]);_0x1f46e9[_0x325a('0x37')]=_['intersection'](_0x5924af[_0x325a('0x32')],qs[_0x325a('0x38')](_0x2984f3['query'][_0x325a('0x38')]));_0x1f46e9[_0x325a('0x37')]=_0x1f46e9['attributes'][_0x325a('0x39')]?_0x1f46e9[_0x325a('0x37')]:_0x5924af['model'];if(_0x2984f3[_0x325a('0x33')]['includeAll']){_0x1f46e9['include']=[{'all':!![]}];}_0x1f46e9=_[_0x325a('0x3f')]({},_0x1f46e9,_0x2984f3[_0x325a('0x42')]);return db[_0x325a('0x2e')]['find'](_0x1f46e9)[_0x325a('0x23')](handleEntityNotFound(_0x363682,null))[_0x325a('0x23')](respondWithResult(_0x363682,null))['catch'](handleError(_0x363682,null));};exports['create']=function(_0x1009dc,_0x2002c4){return db['VoiceChanSpy'][_0x325a('0x49')](_0x1009dc['body'],{})['then'](function(_0x54b6d4){var _0x5f6c4b=_0x1009dc[_0x325a('0x4a')]['get']({'plain':!![]});if(!_0x5f6c4b)throw new Error(_0x325a('0x4b'));if(_0x5f6c4b[_0x325a('0x4c')]==='user'){var _0x37b66f=_0x54b6d4[_0x325a('0x25')]({'plain':!![]});var _0x12a4c6=_0x325a('0x26');return db[_0x325a('0x4d')][_0x325a('0x4e')]({'where':{'name':_0x12a4c6,'userProfileId':_0x5f6c4b['userProfileId']},'raw':!![]})[_0x325a('0x23')](function(_0x97414a){if(_0x97414a&&_0x97414a['autoAssociation']===0x0){return db[_0x325a('0x4f')]['create']({'name':_0x37b66f[_0x325a('0x2a')],'resourceId':_0x37b66f['id'],'type':_0x97414a[_0x325a('0x2a')],'sectionId':_0x97414a['id']},{})[_0x325a('0x23')](function(){return _0x54b6d4;});}else{return _0x54b6d4;}})[_0x325a('0x46')](function(_0x2854e6){logger[_0x325a('0x29')](_0x325a('0x50'),_0x2854e6);throw _0x2854e6;});}return _0x54b6d4;})[_0x325a('0x23')](respondWithResult(_0x2002c4,0xc9))[_0x325a('0x46')](handleError(_0x2002c4,null));};exports[_0x325a('0x22')]=function(_0x52a211,_0x112dd4){if(_0x52a211[_0x325a('0x51')]['id']){delete _0x52a211['body']['id'];}return db[_0x325a('0x2e')][_0x325a('0x4e')]({'where':{'id':_0x52a211[_0x325a('0x48')]['id']}})[_0x325a('0x23')](handleEntityNotFound(_0x112dd4,null))[_0x325a('0x23')](saveUpdates(_0x52a211[_0x325a('0x51')],null))[_0x325a('0x23')](respondWithResult(_0x112dd4,null))[_0x325a('0x46')](handleError(_0x112dd4,null));};exports[_0x325a('0x24')]=function(_0xc022fd,_0x1a0dcc){return db[_0x325a('0x2e')][_0x325a('0x4e')]({'where':{'id':_0xc022fd[_0x325a('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a0dcc,null))[_0x325a('0x23')](removeEntity(_0x1a0dcc,null))[_0x325a('0x46')](handleError(_0x1a0dcc,null));}; \ No newline at end of file +var _0x9de3=['request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','undefined','limit','count','set','reject','save','then','get','ChanSpies','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VoiceChanSpy','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','zip-dir','fast-json-patch'];(function(_0x19b0ba,_0x1c1f9a){var _0x1db808=function(_0x6fe12f){while(--_0x6fe12f){_0x19b0ba['push'](_0x19b0ba['shift']());}};_0x1db808(++_0x1c1f9a);}(_0x9de3,0xea));var _0x39de=function(_0x1b1eda,_0x2b0f77){_0x1b1eda=_0x1b1eda-0x0;var _0x197f08=_0x9de3[_0x1b1eda];return _0x197f08;};'use strict';var emlformat=require(_0x39de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39de('0x1'));var jsonpatch=require(_0x39de('0x2'));var rp=require(_0x39de('0x3'));var moment=require('moment');var BPromise=require(_0x39de('0x4'));var Mustache=require('mustache');var util=require(_0x39de('0x5'));var path=require(_0x39de('0x6'));var sox=require(_0x39de('0x7'));var csv=require(_0x39de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39de('0x9'));var _=require(_0x39de('0xa'));var squel=require(_0x39de('0xb'));var crypto=require(_0x39de('0xc'));var jsforce=require(_0x39de('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x39de('0xe'));var Redis=require(_0x39de('0xf'));var authService=require(_0x39de('0x10'));var qs=require(_0x39de('0x11'));var as=require(_0x39de('0x12'));var hardwareService=require(_0x39de('0x13'));var logger=require(_0x39de('0x14'))(_0x39de('0x15'));var utils=require('../../config/utils');var config=require(_0x39de('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2bd0f0,_0x35061b){_0x35061b=_0x35061b||0xcc;return function(_0x32d610){if(_0x32d610){return _0x2bd0f0['sendStatus'](_0x35061b);}return _0x2bd0f0[_0x39de('0x17')](_0x35061b)[_0x39de('0x18')]();};}function respondWithResult(_0x1318d8,_0x905132){_0x905132=_0x905132||0xc8;return function(_0x38fe3b){if(_0x38fe3b){return _0x1318d8[_0x39de('0x17')](_0x905132)[_0x39de('0x19')](_0x38fe3b);}};}function respondWithFilteredResult(_0x25ca17,_0xaff589){return function(_0x316fdb){if(_0x316fdb){var _0x4c56df=typeof _0xaff589[_0x39de('0x1a')]===_0x39de('0x1b')&&typeof _0xaff589[_0x39de('0x1c')]===_0x39de('0x1b');var _0x493200=_0x316fdb['count'];var _0x2d355b=_0x4c56df?0x0:_0xaff589['offset'];var _0x1fb6fa=_0x4c56df?_0x316fdb[_0x39de('0x1d')]:_0xaff589['offset']+_0xaff589[_0x39de('0x1c')];var _0x5dcb96;if(_0x1fb6fa>=_0x493200){_0x1fb6fa=_0x493200;_0x5dcb96=0xc8;}else{_0x5dcb96=0xce;}_0x25ca17[_0x39de('0x17')](_0x5dcb96);return _0x25ca17[_0x39de('0x1e')]('Content-Range',_0x2d355b+'-'+_0x1fb6fa+'/'+_0x493200)['json'](_0x316fdb);}return null;};}function patchUpdates(_0xab6f89){return function(_0x5e4ab2){try{jsonpatch['apply'](_0x5e4ab2,_0xab6f89,!![]);}catch(_0x315e4a){return BPromise[_0x39de('0x1f')](_0x315e4a);}return _0x5e4ab2[_0x39de('0x20')]();};}function saveUpdates(_0x292dda,_0x400d62){return function(_0x10c0fc){if(_0x10c0fc){return _0x10c0fc['update'](_0x292dda)[_0x39de('0x21')](function(_0x3baec4){return _0x3baec4;});}return null;};}function removeEntity(_0x45abce,_0x578eaa){return function(_0x372564){if(_0x372564){return _0x372564['destroy']()[_0x39de('0x21')](function(){var _0x102c5b=_0x372564[_0x39de('0x22')]({'plain':!![]});var _0x39d01a=_0x39de('0x23');return db['UserProfileResource'][_0x39de('0x24')]({'where':{'type':_0x39d01a,'resourceId':_0x102c5b['id']}})[_0x39de('0x21')](function(){return _0x372564;});})[_0x39de('0x21')](function(){_0x45abce[_0x39de('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fd91a,_0x59e64f){return function(_0x4c11b3){if(!_0x4c11b3){_0x3fd91a[_0x39de('0x25')](0x194);}return _0x4c11b3;};}function handleError(_0x1d3b79,_0xfd80c8){_0xfd80c8=_0xfd80c8||0x1f4;return function(_0x3ff4d8){logger[_0x39de('0x26')](_0x3ff4d8['stack']);if(_0x3ff4d8[_0x39de('0x27')]){delete _0x3ff4d8[_0x39de('0x27')];}_0x1d3b79[_0x39de('0x17')](_0xfd80c8)[_0x39de('0x28')](_0x3ff4d8);};}exports[_0x39de('0x29')]=function(_0x2db103,_0x414647){var _0x497f1a={},_0xdf658b={},_0x2ca57d={'count':0x0,'rows':[]};var _0x3760c7=_[_0x39de('0x2a')](db['VoiceChanSpy'][_0x39de('0x2b')],function(_0x3d6562){return{'name':_0x3d6562[_0x39de('0x2c')],'type':_0x3d6562[_0x39de('0x2d')]['key']};});_0xdf658b[_0x39de('0x2e')]=_[_0x39de('0x2a')](_0x3760c7,_0x39de('0x27'));_0xdf658b[_0x39de('0x2f')]=_[_0x39de('0x30')](_0x2db103['query']);_0xdf658b['filters']=_[_0x39de('0x31')](_0xdf658b[_0x39de('0x2e')],_0xdf658b[_0x39de('0x2f')]);_0x497f1a[_0x39de('0x32')]=_['intersection'](_0xdf658b[_0x39de('0x2e')],qs['fields'](_0x2db103[_0x39de('0x2f')][_0x39de('0x33')]));_0x497f1a[_0x39de('0x32')]=_0x497f1a['attributes'][_0x39de('0x34')]?_0x497f1a[_0x39de('0x32')]:_0xdf658b[_0x39de('0x2e')];if(!_0x2db103[_0x39de('0x2f')][_0x39de('0x35')](_0x39de('0x36'))){_0x497f1a[_0x39de('0x1c')]=qs[_0x39de('0x1c')](_0x2db103[_0x39de('0x2f')]['limit']);_0x497f1a[_0x39de('0x1a')]=qs[_0x39de('0x1a')](_0x2db103[_0x39de('0x2f')][_0x39de('0x1a')]);}_0x497f1a[_0x39de('0x37')]=qs['sort'](_0x2db103[_0x39de('0x2f')]['sort']);_0x497f1a[_0x39de('0x38')]=qs[_0x39de('0x39')](_[_0x39de('0x3a')](_0x2db103[_0x39de('0x2f')],_0xdf658b[_0x39de('0x39')]),_0x3760c7);if(_0x2db103[_0x39de('0x2f')][_0x39de('0x3b')]){_0x497f1a[_0x39de('0x38')]=_[_0x39de('0x3c')](_0x497f1a['where'],{'$or':_[_0x39de('0x2a')](_0x3760c7,function(_0x3dd32d){if(_0x3dd32d[_0x39de('0x2d')]!=='VIRTUAL'){var _0x6f1636={};_0x6f1636[_0x3dd32d[_0x39de('0x27')]]={'$like':'%'+_0x2db103[_0x39de('0x2f')][_0x39de('0x3b')]+'%'};return _0x6f1636;}})});}_0x497f1a=_['merge']({},_0x497f1a,_0x2db103['options']);var _0x156310={'where':_0x497f1a[_0x39de('0x38')]};return db[_0x39de('0x3d')][_0x39de('0x1d')](_0x156310)['then'](function(_0x71c4b6){_0x2ca57d[_0x39de('0x1d')]=_0x71c4b6;if(_0x2db103[_0x39de('0x2f')][_0x39de('0x3e')]){_0x497f1a[_0x39de('0x3f')]=[{'all':!![]}];}return db[_0x39de('0x3d')][_0x39de('0x40')](_0x497f1a);})[_0x39de('0x21')](function(_0x5ad678){_0x2ca57d[_0x39de('0x41')]=_0x5ad678;return _0x2ca57d;})[_0x39de('0x21')](respondWithFilteredResult(_0x414647,_0x497f1a))[_0x39de('0x42')](handleError(_0x414647,null));};exports['show']=function(_0x1bfc75,_0x796fac){var _0x2c0503={'raw':![],'where':{'id':_0x1bfc75[_0x39de('0x43')]['id']}},_0x49d4a9={};_0x49d4a9[_0x39de('0x2e')]=_[_0x39de('0x30')](db['VoiceChanSpy'][_0x39de('0x2b')]);_0x49d4a9[_0x39de('0x2f')]=_[_0x39de('0x30')](_0x1bfc75[_0x39de('0x2f')]);_0x49d4a9['filters']=_[_0x39de('0x31')](_0x49d4a9[_0x39de('0x2e')],_0x49d4a9['query']);_0x2c0503['attributes']=_['intersection'](_0x49d4a9[_0x39de('0x2e')],qs[_0x39de('0x33')](_0x1bfc75[_0x39de('0x2f')][_0x39de('0x33')]));_0x2c0503[_0x39de('0x32')]=_0x2c0503[_0x39de('0x32')]['length']?_0x2c0503[_0x39de('0x32')]:_0x49d4a9[_0x39de('0x2e')];if(_0x1bfc75[_0x39de('0x2f')]['includeAll']){_0x2c0503[_0x39de('0x3f')]=[{'all':!![]}];}_0x2c0503=_[_0x39de('0x3c')]({},_0x2c0503,_0x1bfc75['options']);return db['VoiceChanSpy'][_0x39de('0x44')](_0x2c0503)[_0x39de('0x21')](handleEntityNotFound(_0x796fac,null))['then'](respondWithResult(_0x796fac,null))[_0x39de('0x42')](handleError(_0x796fac,null));};exports[_0x39de('0x45')]=function(_0x49514c,_0x1674da){return db[_0x39de('0x3d')][_0x39de('0x45')](_0x49514c[_0x39de('0x46')],{})[_0x39de('0x21')](function(_0x4caace){var _0x18abca=_0x49514c[_0x39de('0x47')]['get']({'plain':!![]});if(!_0x18abca)throw new Error(_0x39de('0x48'));if(_0x18abca[_0x39de('0x49')]==='user'){var _0x576a40=_0x4caace[_0x39de('0x22')]({'plain':!![]});var _0x5c473c=_0x39de('0x23');return db['UserProfileSection'][_0x39de('0x44')]({'where':{'name':_0x5c473c,'userProfileId':_0x18abca[_0x39de('0x4a')]},'raw':!![]})[_0x39de('0x21')](function(_0x58a177){if(_0x58a177&&_0x58a177[_0x39de('0x4b')]===0x0){return db[_0x39de('0x4c')][_0x39de('0x45')]({'name':_0x576a40['name'],'resourceId':_0x576a40['id'],'type':_0x58a177[_0x39de('0x27')],'sectionId':_0x58a177['id']},{})[_0x39de('0x21')](function(){return _0x4caace;});}else{return _0x4caace;}})['catch'](function(_0x53baea){logger[_0x39de('0x26')](_0x39de('0x4d'),_0x53baea);throw _0x53baea;});}return _0x4caace;})[_0x39de('0x21')](respondWithResult(_0x1674da,0xc9))[_0x39de('0x42')](handleError(_0x1674da,null));};exports[_0x39de('0x4e')]=function(_0x39ba53,_0x17241c){if(_0x39ba53[_0x39de('0x46')]['id']){delete _0x39ba53[_0x39de('0x46')]['id'];}return db['VoiceChanSpy'][_0x39de('0x44')]({'where':{'id':_0x39ba53['params']['id']}})[_0x39de('0x21')](handleEntityNotFound(_0x17241c,null))[_0x39de('0x21')](saveUpdates(_0x39ba53[_0x39de('0x46')],null))[_0x39de('0x21')](respondWithResult(_0x17241c,null))['catch'](handleError(_0x17241c,null));};exports[_0x39de('0x24')]=function(_0x1f5ac0,_0x38b0fa){return db[_0x39de('0x3d')][_0x39de('0x44')]({'where':{'id':_0x1f5ac0['params']['id']}})['then'](handleEntityNotFound(_0x38b0fa,null))[_0x39de('0x21')](removeEntity(_0x38b0fa,null))['catch'](handleError(_0x38b0fa,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 61275fc..e6f9142 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 _0xebd9=['agent','then','catch','exports','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','format','%s%s','merge','Set','chanspy','record','push','${UNIQUEID}.%s,a','auth','password','ChanSpy','name','options','concat','findAll','internal'];(function(_0x349cff,_0x49aa80){var _0x45fe96=function(_0x14597f){while(--_0x14597f){_0x349cff['push'](_0x349cff['shift']());}};_0x45fe96(++_0x49aa80);}(_0xebd9,0x8f));var _0x9ebd=function(_0x3624e8,_0x16081e){_0x3624e8=_0x3624e8-0x0;var _0x32fabc=_0xebd9[_0x3624e8];return _0x32fabc;};'use strict';var _=require(_0x9ebd('0x0'));var util=require(_0x9ebd('0x1'));var BPromise=require(_0x9ebd('0x2'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3a23c3,_0x1bc6c8,_0x427516){var _0x550758=0x1;var _0x535087=[];var _0x2df250={'context':_0x1bc6c8['context']||'from-sip','exten':util[_0x9ebd('0x3')](_0x9ebd('0x4'),_0x3a23c3['prefix'],_0x427516),'type':'system','isApp':![],'ChanSpyId':_0x3a23c3['id'],'UserId':_0x1bc6c8['id']};_0x535087['push'](_[_0x9ebd('0x5')]({'app':_0x9ebd('0x6'),'appdata':util['format']('CDR(type)=%s',_0x9ebd('0x7')),'priority':_0x550758++},_0x2df250));if(_0x3a23c3[_0x9ebd('0x8')]){_0x535087[_0x9ebd('0x9')](_[_0x9ebd('0x5')]({'app':'MixMonitor','appdata':util['format'](_0x9ebd('0xa'),_0x3a23c3['recordingFormat']),'priority':_0x550758++},_0x2df250));}if(_0x3a23c3[_0x9ebd('0xb')]){_0x535087['push'](_[_0x9ebd('0x5')]({'app':'Authenticate','appdata':_0x3a23c3[_0x9ebd('0xc')],'priority':_0x550758++},_0x2df250));}_0x535087[_0x9ebd('0x9')](_[_0x9ebd('0x5')]({'app':_0x9ebd('0xd'),'appdata':util[_0x9ebd('0x3')]('SIP/%s,%s',_0x1bc6c8[_0x9ebd('0xe')],_0x3a23c3['options']?_0x3a23c3[_0x9ebd('0xf')]['join'](''):''),'priority':_0x550758++},_0x2df250));if(_0x3a23c3[_0x9ebd('0x8')]){_0x535087[_0x9ebd('0x9')](_['merge']({'app':'StopMixMonitor','priority':_0x550758++},_0x2df250));}return _0x535087;};var getChanSpyApplications=function(_0x48eab5,_0x5f1295){var _0x1780e0=[];for(var _0x716e23=0x0,_0x2278c4=0x1;_0x716e23<_0x5f1295['length'];_0x716e23++,_0x2278c4=0x1){_0x1780e0=_0x1780e0[_0x9ebd('0x10')](getUserApplications(_0x48eab5,_0x5f1295[_0x716e23],_0x5f1295[_0x716e23]['internal']));if(_0x5f1295[_0x716e23]['internal']!=_0x5f1295[_0x716e23][_0x9ebd('0xe')]){_0x1780e0=_0x1780e0['concat'](getUserApplications(_0x48eab5,_0x5f1295[_0x716e23],_0x5f1295[_0x716e23][_0x9ebd('0xe')]));}}return _0x1780e0;};var getChanSpyPromise=function(_0x1393a6,_0xabae9f){return new BPromise(function(_0x2992b8,_0x192c93){return _0x1393a6['User'][_0x9ebd('0x11')]({'attributes':['id',_0x9ebd('0xe'),_0x9ebd('0x12')],'where':{'role':_0x9ebd('0x13'),'chanspy':!![]},'raw':!![]})[_0x9ebd('0x14')](function(_0x4384ae){if(_0x4384ae){return _0x2992b8(getChanSpyApplications(_0xabae9f,_0x4384ae));}return _0x2992b8([]);})[_0x9ebd('0x15')](function(_0x1eccd5){_0x192c93(_0x1eccd5);});});};module[_0x9ebd('0x16')]=function(_0x1bb4ee,_0x26a611){var _0x219e05=_0x1bb4ee['models'];return _0x1bb4ee['define']('VoiceChanSpy',attributes,{'tableName':_0x9ebd('0x17'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x40fe36,_0x1e0908,_0x1bc907){return getChanSpyPromise(_0x219e05,_0x40fe36)[_0x9ebd('0x14')](function(_0xe72f4f){if(_0xe72f4f&&_0xe72f4f['length']){return _0x219e05[_0x9ebd('0x18')][_0x9ebd('0x19')](_0xe72f4f);}})[_0x9ebd('0x14')](function(){_0x1bc907();})[_0x9ebd('0x15')](function(_0x4c25e5){_0x1bc907(_0x4c25e5);});},'afterUpdate':function(_0x4ca7e4,_0x1a6b58,_0x345874){return _0x219e05[_0x9ebd('0x18')][_0x9ebd('0x1a')]({'where':{'ChanSpyId':_0x4ca7e4['id']}})[_0x9ebd('0x14')](function(){return getChanSpyPromise(_0x219e05,_0x4ca7e4);})[_0x9ebd('0x14')](function(_0x3f8755){if(_0x3f8755&&_0x3f8755['length']){return _0x219e05[_0x9ebd('0x18')][_0x9ebd('0x19')](_0x3f8755);}})[_0x9ebd('0x14')](function(){_0x345874();})[_0x9ebd('0x15')](function(_0x5d83ef){_0x345874(_0x5d83ef);});},'afterDestroy':function(_0x4553d2,_0x141b7f,_0x52876e){return _0x219e05[_0x9ebd('0x18')][_0x9ebd('0x1a')]({'where':{'ChanSpyId':_0x4553d2['id']}})[_0x9ebd('0x14')](function(){_0x52876e();})[_0x9ebd('0x15')](function(_0x3179e2){_0x52876e(_0x3179e2);});}}});}; \ No newline at end of file +var _0x0432=['voice_chanspy','then','VoiceExtension','destroy','bulkCreate','bluebird','./voiceChanSpy.attributes','context','from-sip','%s%s','prefix','system','push','Set','CDR(type)=%s','record','merge','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','format','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','catch','exports','models','define','VoiceChanSpy'];(function(_0xfe9365,_0x4f9b01){var _0x419138=function(_0xf916b6){while(--_0xf916b6){_0xfe9365['push'](_0xfe9365['shift']());}};_0x419138(++_0x4f9b01);}(_0x0432,0xe9));var _0x2043=function(_0x50315b,_0x4ec280){_0x50315b=_0x50315b-0x0;var _0x13e0a9=_0x0432[_0x50315b];return _0x13e0a9;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x2043('0x0'));var attributes=require(_0x2043('0x1'));var getUserApplications=function(_0x4d24fa,_0x22ff70,_0xc8fa0){var _0x483ab8=0x1;var _0x12c2f3=[];var _0x1378ee={'context':_0x22ff70[_0x2043('0x2')]||_0x2043('0x3'),'exten':util['format'](_0x2043('0x4'),_0x4d24fa[_0x2043('0x5')],_0xc8fa0),'type':_0x2043('0x6'),'isApp':![],'ChanSpyId':_0x4d24fa['id'],'UserId':_0x22ff70['id']};_0x12c2f3[_0x2043('0x7')](_['merge']({'app':_0x2043('0x8'),'appdata':util['format'](_0x2043('0x9'),'chanspy'),'priority':_0x483ab8++},_0x1378ee));if(_0x4d24fa[_0x2043('0xa')]){_0x12c2f3[_0x2043('0x7')](_[_0x2043('0xb')]({'app':_0x2043('0xc'),'appdata':util['format'](_0x2043('0xd'),_0x4d24fa['recordingFormat']),'priority':_0x483ab8++},_0x1378ee));}if(_0x4d24fa[_0x2043('0xe')]){_0x12c2f3[_0x2043('0x7')](_['merge']({'app':_0x2043('0xf'),'appdata':_0x4d24fa[_0x2043('0x10')],'priority':_0x483ab8++},_0x1378ee));}_0x12c2f3[_0x2043('0x7')](_[_0x2043('0xb')]({'app':_0x2043('0x11'),'appdata':util[_0x2043('0x12')]('SIP/%s,%s',_0x22ff70[_0x2043('0x13')],_0x4d24fa[_0x2043('0x14')]?_0x4d24fa[_0x2043('0x14')][_0x2043('0x15')](''):''),'priority':_0x483ab8++},_0x1378ee));if(_0x4d24fa[_0x2043('0xa')]){_0x12c2f3[_0x2043('0x7')](_[_0x2043('0xb')]({'app':_0x2043('0x16'),'priority':_0x483ab8++},_0x1378ee));}return _0x12c2f3;};var getChanSpyApplications=function(_0x4e35b0,_0xe256fc){var _0x46ecc2=[];for(var _0x72d6f1=0x0,_0x5ee559=0x1;_0x72d6f1<_0xe256fc[_0x2043('0x17')];_0x72d6f1++,_0x5ee559=0x1){_0x46ecc2=_0x46ecc2[_0x2043('0x18')](getUserApplications(_0x4e35b0,_0xe256fc[_0x72d6f1],_0xe256fc[_0x72d6f1][_0x2043('0x19')]));if(_0xe256fc[_0x72d6f1]['internal']!=_0xe256fc[_0x72d6f1][_0x2043('0x13')]){_0x46ecc2=_0x46ecc2['concat'](getUserApplications(_0x4e35b0,_0xe256fc[_0x72d6f1],_0xe256fc[_0x72d6f1][_0x2043('0x13')]));}}return _0x46ecc2;};var getChanSpyPromise=function(_0x37e6df,_0x2cc74d){return new BPromise(function(_0x815d87,_0x208aca){return _0x37e6df['User'][_0x2043('0x1a')]({'attributes':['id',_0x2043('0x13'),_0x2043('0x19')],'where':{'role':_0x2043('0x1b'),'chanspy':!![]},'raw':!![]})['then'](function(_0x436e7b){if(_0x436e7b){return _0x815d87(getChanSpyApplications(_0x2cc74d,_0x436e7b));}return _0x815d87([]);})[_0x2043('0x1c')](function(_0x1998ac){_0x208aca(_0x1998ac);});});};module[_0x2043('0x1d')]=function(_0x235165,_0x414bf4){var _0x37b07f=_0x235165[_0x2043('0x1e')];return _0x235165[_0x2043('0x1f')](_0x2043('0x20'),attributes,{'tableName':_0x2043('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x595f89,_0x412774,_0x38e018){return getChanSpyPromise(_0x37b07f,_0x595f89)[_0x2043('0x22')](function(_0x2ba8e6){if(_0x2ba8e6&&_0x2ba8e6[_0x2043('0x17')]){return _0x37b07f[_0x2043('0x23')]['bulkCreate'](_0x2ba8e6);}})['then'](function(){_0x38e018();})[_0x2043('0x1c')](function(_0x28c83d){_0x38e018(_0x28c83d);});},'afterUpdate':function(_0x1fc164,_0x59291e,_0x283a37){return _0x37b07f[_0x2043('0x23')][_0x2043('0x24')]({'where':{'ChanSpyId':_0x1fc164['id']}})[_0x2043('0x22')](function(){return getChanSpyPromise(_0x37b07f,_0x1fc164);})[_0x2043('0x22')](function(_0xde5156){if(_0xde5156&&_0xde5156[_0x2043('0x17')]){return _0x37b07f[_0x2043('0x23')][_0x2043('0x25')](_0xde5156);}})[_0x2043('0x22')](function(){_0x283a37();})[_0x2043('0x1c')](function(_0x2d1146){_0x283a37(_0x2d1146);});},'afterDestroy':function(_0x46924d,_0x4f2e95,_0x55481c){return _0x37b07f[_0x2043('0x23')][_0x2043('0x24')]({'where':{'ChanSpyId':_0x46924d['id']}})[_0x2043('0x22')](function(){_0x55481c();})[_0x2043('0x1c')](function(_0x2695d8){_0x55481c(_0x2695d8);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 5185a28..f31edce 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 _0xa5fa=['bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','request\x20sent','result','catch','util','moment'];(function(_0x3b2983,_0x553477){var _0x303cfe=function(_0x30e397){while(--_0x30e397){_0x3b2983['push'](_0x3b2983['shift']());}};_0x303cfe(++_0x553477);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x59a098,_0x2064c1){_0x59a098=_0x59a098-0x0;var _0x5d56dd=_0xa5fa[_0x59a098];return _0x5d56dd;};'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')]('VoiceChanSpy,\x20%s,\x20%s',_0x302138,'request\x20sent');logger[_0xaa5f('0xd')]('VoiceChanSpy,\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);});});} \ No newline at end of file +var _0xa588=['stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xa588,0xe1));var _0x8a58=function(_0x5925e9,_0x51b161){_0x5925e9=_0x5925e9-0x0;var _0x72efff=_0xa588[_0x5925e9];return _0x72efff;};'use strict';var _=require('lodash');var util=require(_0x8a58('0x0'));var moment=require(_0x8a58('0x1'));var BPromise=require(_0x8a58('0x2'));var rs=require(_0x8a58('0x3'));var fs=require('fs');var Redis=require(_0x8a58('0x4'));var db=require(_0x8a58('0x5'))['db'];var utils=require(_0x8a58('0x6'));var logger=require(_0x8a58('0x7'))(_0x8a58('0x8'));var config=require('../../config/environment');var jayson=require(_0x8a58('0x9'));var client=jayson[_0x8a58('0xa')][_0x8a58('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35d5ad,_0xe0af18,_0x140f99){return new BPromise(function(_0x77b421,_0x585376){return client['request'](_0x35d5ad,_0x140f99)[_0x8a58('0xc')](function(_0x39a20e){logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));logger['debug'](_0x8a58('0x10'),_0xe0af18,_0x8a58('0xf'),JSON[_0x8a58('0x11')](_0x39a20e));if(_0x39a20e[_0x8a58('0x12')]){if(_0x39a20e['error']['code']===0x1f4){logger[_0x8a58('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x585376(_0x39a20e['error'][_0x8a58('0x13')]);}logger[_0x8a58('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0xe0af18,_0x39a20e[_0x8a58('0x12')][_0x8a58('0x13')]);return _0x77b421(_0x39a20e['error'][_0x8a58('0x13')]);}else{logger[_0x8a58('0xd')](_0x8a58('0xe'),_0xe0af18,_0x8a58('0xf'));_0x77b421(_0x39a20e[_0x8a58('0x14')][_0x8a58('0x13')]);}})[_0x8a58('0x15')](function(_0x49ee0e){logger['error'](_0x8a58('0xe'),_0xe0af18,_0x49ee0e);_0x585376(_0x49ee0e);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 7a5c089..21c7869 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 _0x8226=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8226,0x184));var _0x6822=function(_0x264136,_0x22508f){_0x264136=_0x264136-0x0;var _0x414056=_0x8226[_0x264136];return _0x414056;};'use strict';var multer=require(_0x6822('0x0'));var util=require(_0x6822('0x1'));var path=require(_0x6822('0x2'));var timeout=require('connect-timeout');var express=require(_0x6822('0x3'));var router=express[_0x6822('0x4')]();var fs_extra=require(_0x6822('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6822('0x6'));var config=require(_0x6822('0x7'));var controller=require('./voiceContext.controller');router[_0x6822('0x8')]('/',auth[_0x6822('0x9')](),controller[_0x6822('0xa')]);router[_0x6822('0x8')](_0x6822('0xb'),auth[_0x6822('0x9')](),controller['show']);router[_0x6822('0xc')]('/',auth['isAuthenticated'](),controller[_0x6822('0xd')]);router[_0x6822('0xe')](_0x6822('0xb'),auth[_0x6822('0x9')](),controller[_0x6822('0xf')]);router[_0x6822('0x10')](_0x6822('0xb'),auth[_0x6822('0x9')](),controller[_0x6822('0x11')]);module['exports']=router; \ No newline at end of file +var _0xa230=['put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','post'];(function(_0x59b201,_0x2203dd){var _0x2b39e2=function(_0x533a73){while(--_0x533a73){_0x59b201['push'](_0x59b201['shift']());}};_0x2b39e2(++_0x2203dd);}(_0xa230,0x65));var _0x0a23=function(_0x1cd07f,_0x2c1871){_0x1cd07f=_0x1cd07f-0x0;var _0x566181=_0xa230[_0x1cd07f];return _0x566181;};'use strict';var multer=require(_0x0a23('0x0'));var util=require(_0x0a23('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a23('0x2')]();var fs_extra=require(_0x0a23('0x3'));var auth=require(_0x0a23('0x4'));var interaction=require(_0x0a23('0x5'));var config=require(_0x0a23('0x6'));var controller=require(_0x0a23('0x7'));router['get']('/',auth[_0x0a23('0x8')](),controller[_0x0a23('0x9')]);router['get']('/:id',auth[_0x0a23('0x8')](),controller['show']);router[_0x0a23('0xa')]('/',auth[_0x0a23('0x8')](),controller['create']);router[_0x0a23('0xb')](_0x0a23('0xc'),auth[_0x0a23('0x8')](),controller[_0x0a23('0xd')]);router['delete'](_0x0a23('0xc'),auth[_0x0a23('0x8')](),controller[_0x0a23('0xe')]);module[_0x0a23('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index d74b8c9..92be812 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 _0xcb08=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0xfe5df4,_0x5db816){var _0x39c311=function(_0x6caa7){while(--_0x6caa7){_0xfe5df4['push'](_0xfe5df4['shift']());}};_0x39c311(++_0x5db816);}(_0xcb08,0x10f));var _0x8cb0=function(_0x25ed96,_0x282ce9){_0x25ed96=_0x25ed96-0x0;var _0x15f358=_0xcb08[_0x25ed96];return _0x15f358;};'use strict';var Sequelize=require(_0x8cb0('0x0'));module[_0x8cb0('0x1')]={'name':{'type':Sequelize[_0x8cb0('0x2')],'unique':_0x8cb0('0x3')},'description':{'type':Sequelize[_0x8cb0('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8cb0('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2109=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x1eda2b,_0x3c6187){var _0x3da4c9=function(_0x56f8ae){while(--_0x56f8ae){_0x1eda2b['push'](_0x1eda2b['shift']());}};_0x3da4c9(++_0x3c6187);}(_0x2109,0xdb));var _0x9210=function(_0x62e5cd,_0x2fb26b){_0x62e5cd=_0x62e5cd-0x0;var _0x368da3=_0x2109[_0x62e5cd];return _0x368da3;};'use strict';var Sequelize=require(_0x9210('0x0'));module[_0x9210('0x1')]={'name':{'type':Sequelize[_0x9210('0x2')],'unique':_0x9210('0x3')},'description':{'type':Sequelize[_0x9210('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9210('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index bf88e43..832470a 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 _0x54c8=['count','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Contexts','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','utf8','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x2a1a38,_0x5e817d){var _0x23cc97=function(_0x2315ac){while(--_0x2315ac){_0x2a1a38['push'](_0x2a1a38['shift']());}};_0x23cc97(++_0x5e817d);}(_0x54c8,0x9b));var _0x854c=function(_0x254081,_0x175fd7){_0x254081=_0x254081-0x0;var _0x3b3502=_0x54c8[_0x254081];return _0x3b3502;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x854c('0x0'));var zipdir=require(_0x854c('0x1'));var jsonpatch=require(_0x854c('0x2'));var rp=require(_0x854c('0x3'));var moment=require('moment');var BPromise=require(_0x854c('0x4'));var Mustache=require(_0x854c('0x5'));var util=require(_0x854c('0x6'));var path=require('path');var sox=require(_0x854c('0x7'));var csv=require(_0x854c('0x8'));var ejs=require(_0x854c('0x9'));var fs=require('fs');var fs_extra=require(_0x854c('0xa'));var _=require('lodash');var squel=require(_0x854c('0xb'));var crypto=require(_0x854c('0xc'));var jsforce=require(_0x854c('0xd'));var deskjs=require(_0x854c('0xe'));var toCsv=require(_0x854c('0x8'));var querystring=require(_0x854c('0xf'));var Papa=require(_0x854c('0x10'));var Redis=require(_0x854c('0x11'));var authService=require(_0x854c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x854c('0x13'));var hardwareService=require(_0x854c('0x14'));var logger=require(_0x854c('0x15'))(_0x854c('0x16'));var utils=require(_0x854c('0x17'));var config=require(_0x854c('0x18'));var licenseUtil=require(_0x854c('0x19'));var db=require(_0x854c('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x854c('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d2f8a,_0x515268,_0x1317a3,_0x5d38e5){return new BPromise(function(_0x5b745c,_0x1a24b1){var _0x3d9fc7=_0x5d38e5||client;return _0x3d9fc7[_0x854c('0x1c')](_0x4d2f8a,_0x1317a3)[_0x854c('0x1d')](function(_0x1e5a97){logger[_0x854c('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x515268,_0x854c('0x1f'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x515268,_0x854c('0x1f'),JSON[_0x854c('0x20')](_0x1e5a97));if(_0x1e5a97[_0x854c('0x21')]){if(_0x1e5a97[_0x854c('0x21')]['code']===0x1f4){logger[_0x854c('0x21')](_0x854c('0x22'),_0x515268,_0x1e5a97['error'][_0x854c('0x23')]);return _0x1a24b1(_0x1e5a97[_0x854c('0x21')]['message']);}logger[_0x854c('0x21')](_0x854c('0x22'),_0x515268,_0x1e5a97[_0x854c('0x21')][_0x854c('0x23')]);return _0x5b745c(_0x1e5a97['error']['message']);}else{logger[_0x854c('0x1e')](_0x854c('0x22'),_0x515268,'request\x20sent');_0x5b745c(_0x1e5a97[_0x854c('0x24')][_0x854c('0x23')]);}})[_0x854c('0x25')](function(_0x115490){logger['error'](_0x854c('0x22'),_0x515268,_0x115490);_0x1a24b1(_0x115490);});});}function respondWithStatusCode(_0x407028,_0x5a9daf){_0x5a9daf=_0x5a9daf||0xcc;return function(_0x3b31f2){if(_0x3b31f2){return _0x407028[_0x854c('0x26')](_0x5a9daf);}return _0x407028[_0x854c('0x27')](_0x5a9daf)[_0x854c('0x28')]();};}function respondWithResult(_0x1aa0bc,_0x4264a7){_0x4264a7=_0x4264a7||0xc8;return function(_0x3eb8e2){if(_0x3eb8e2){return _0x1aa0bc[_0x854c('0x27')](_0x4264a7)[_0x854c('0x29')](_0x3eb8e2);}};}function respondWithFilteredResult(_0x1060f4,_0x4e5c4a){return function(_0x1142ce){if(_0x1142ce){var _0x306103=typeof _0x4e5c4a[_0x854c('0x2a')]===_0x854c('0x2b')&&typeof _0x4e5c4a[_0x854c('0x2c')]===_0x854c('0x2b');var _0x21eaca=_0x1142ce[_0x854c('0x2d')];var _0xa4e6ba=_0x306103?0x0:_0x4e5c4a[_0x854c('0x2a')];var _0x4ecb88=_0x306103?_0x1142ce['count']:_0x4e5c4a[_0x854c('0x2a')]+_0x4e5c4a[_0x854c('0x2c')];var _0xdef6c8;if(_0x4ecb88>=_0x21eaca){_0x4ecb88=_0x21eaca;_0xdef6c8=0xc8;}else{_0xdef6c8=0xce;}_0x1060f4[_0x854c('0x27')](_0xdef6c8);return _0x1060f4['set'](_0x854c('0x2e'),_0xa4e6ba+'-'+_0x4ecb88+'/'+_0x21eaca)['json'](_0x1142ce);}return null;};}function patchUpdates(_0x44d3a8){return function(_0x43d073){try{jsonpatch[_0x854c('0x2f')](_0x43d073,_0x44d3a8,!![]);}catch(_0x2a9904){return BPromise['reject'](_0x2a9904);}return _0x43d073[_0x854c('0x30')]();};}function saveUpdates(_0xc28ff8,_0x1e7dec){return function(_0xca083){if(_0xca083){return _0xca083[_0x854c('0x31')](_0xc28ff8)['then'](function(_0x31de2f){return _0x31de2f;});}return null;};}function removeEntity(_0x94780e,_0x415ea8){return function(_0x2c20a7){if(_0x2c20a7){return _0x2c20a7[_0x854c('0x32')]()[_0x854c('0x1d')](function(){var _0xb7a143=_0x2c20a7[_0x854c('0x33')]({'plain':!![]});var _0x2d0105='Contexts';return db[_0x854c('0x34')][_0x854c('0x32')]({'where':{'type':_0x2d0105,'resourceId':_0xb7a143['id']}})[_0x854c('0x1d')](function(){return _0x2c20a7;});})[_0x854c('0x1d')](function(){_0x94780e[_0x854c('0x27')](0xcc)[_0x854c('0x28')]();});}};}function handleEntityNotFound(_0x1b8e96,_0x1ce320){return function(_0x1d6836){if(!_0x1d6836){_0x1b8e96[_0x854c('0x26')](0x194);}return _0x1d6836;};}function handleError(_0x5244a7,_0x1b7da0){_0x1b7da0=_0x1b7da0||0x1f4;return function(_0x62c854){logger['error'](_0x62c854[_0x854c('0x35')]);if(_0x62c854[_0x854c('0x36')]){delete _0x62c854['name'];}_0x5244a7[_0x854c('0x27')](_0x1b7da0)['send'](_0x62c854);};}exports[_0x854c('0x37')]=function(_0x4ca05e,_0x15ae53){var _0x5042e2={},_0x39a636={},_0x3c3447={'count':0x0,'rows':[]};var _0x5d167e=_['map'](db[_0x854c('0x38')][_0x854c('0x39')],function(_0x14705e){return{'name':_0x14705e[_0x854c('0x3a')],'type':_0x14705e[_0x854c('0x3b')][_0x854c('0x3c')]};});_0x39a636[_0x854c('0x3d')]=_[_0x854c('0x3e')](_0x5d167e,_0x854c('0x36'));_0x39a636[_0x854c('0x3f')]=_[_0x854c('0x40')](_0x4ca05e['query']);_0x39a636[_0x854c('0x41')]=_['intersection'](_0x39a636[_0x854c('0x3d')],_0x39a636[_0x854c('0x3f')]);_0x5042e2['attributes']=_[_0x854c('0x42')](_0x39a636['model'],qs['fields'](_0x4ca05e[_0x854c('0x3f')][_0x854c('0x43')]));_0x5042e2[_0x854c('0x44')]=_0x5042e2[_0x854c('0x44')][_0x854c('0x45')]?_0x5042e2['attributes']:_0x39a636['model'];if(!_0x4ca05e[_0x854c('0x3f')][_0x854c('0x46')](_0x854c('0x47'))){_0x5042e2['limit']=qs[_0x854c('0x2c')](_0x4ca05e[_0x854c('0x3f')][_0x854c('0x2c')]);_0x5042e2[_0x854c('0x2a')]=qs['offset'](_0x4ca05e[_0x854c('0x3f')][_0x854c('0x2a')]);}_0x5042e2['order']=qs[_0x854c('0x48')](_0x4ca05e['query']['sort']);_0x5042e2['where']=qs[_0x854c('0x41')](_[_0x854c('0x49')](_0x4ca05e['query'],_0x39a636[_0x854c('0x41')]),_0x5d167e);if(_0x4ca05e[_0x854c('0x3f')]['filter']){_0x5042e2['where']=_[_0x854c('0x4a')](_0x5042e2['where'],{'$or':_[_0x854c('0x3e')](_0x5d167e,function(_0x59bd2c){if(_0x59bd2c[_0x854c('0x3b')]!==_0x854c('0x4b')){var _0x7c7616={};_0x7c7616[_0x59bd2c[_0x854c('0x36')]]={'$like':'%'+_0x4ca05e['query']['filter']+'%'};return _0x7c7616;}})});}_0x5042e2=_[_0x854c('0x4a')]({},_0x5042e2,_0x4ca05e[_0x854c('0x4c')]);var _0x1edbd2={'where':_0x5042e2['where']};return db[_0x854c('0x38')]['count'](_0x1edbd2)['then'](function(_0xe98c6d){_0x3c3447[_0x854c('0x2d')]=_0xe98c6d;if(_0x4ca05e[_0x854c('0x3f')][_0x854c('0x4d')]){_0x5042e2[_0x854c('0x4e')]=[{'all':!![]}];}return db[_0x854c('0x38')][_0x854c('0x4f')](_0x5042e2);})[_0x854c('0x1d')](function(_0x23f5e5){_0x3c3447[_0x854c('0x50')]=_0x23f5e5;return _0x3c3447;})[_0x854c('0x1d')](respondWithFilteredResult(_0x15ae53,_0x5042e2))[_0x854c('0x25')](handleError(_0x15ae53,null));};exports['show']=function(_0x1a8dab,_0x477825){var _0x5b2fe9={'raw':![],'where':{'id':_0x1a8dab['params']['id']}},_0x8ff6c2={};_0x8ff6c2[_0x854c('0x3d')]=_[_0x854c('0x40')](db[_0x854c('0x38')][_0x854c('0x39')]);_0x8ff6c2[_0x854c('0x3f')]=_[_0x854c('0x40')](_0x1a8dab[_0x854c('0x3f')]);_0x8ff6c2[_0x854c('0x41')]=_['intersection'](_0x8ff6c2[_0x854c('0x3d')],_0x8ff6c2['query']);_0x5b2fe9[_0x854c('0x44')]=_[_0x854c('0x42')](_0x8ff6c2['model'],qs['fields'](_0x1a8dab[_0x854c('0x3f')][_0x854c('0x43')]));_0x5b2fe9[_0x854c('0x44')]=_0x5b2fe9['attributes'][_0x854c('0x45')]?_0x5b2fe9[_0x854c('0x44')]:_0x8ff6c2[_0x854c('0x3d')];if(_0x1a8dab[_0x854c('0x3f')][_0x854c('0x4d')]){_0x5b2fe9[_0x854c('0x4e')]=[{'all':!![]}];}_0x5b2fe9=_[_0x854c('0x4a')]({},_0x5b2fe9,_0x1a8dab[_0x854c('0x4c')]);return db[_0x854c('0x38')][_0x854c('0x51')](_0x5b2fe9)[_0x854c('0x1d')](handleEntityNotFound(_0x477825,null))[_0x854c('0x1d')](respondWithResult(_0x477825,null))[_0x854c('0x25')](handleError(_0x477825,null));};exports[_0x854c('0x52')]=function(_0x5aef93,_0x3c9b7c,_0x891294){var _0x142fbc;return db[_0x854c('0x38')]['create'](_0x5aef93[_0x854c('0x53')],{'raw':!![]})[_0x854c('0x1d')](function(_0x2a23b4){_0x142fbc=_0x2a23b4;return db['VoiceContext'][_0x854c('0x4f')]({'raw':!![]});})[_0x854c('0x1d')](function(_0xedca18){var _0xcaf687=fs[_0x854c('0x54')](path[_0x854c('0x55')](config[_0x854c('0x56')],_0x854c('0x57')),'utf8');var _0x247294=ejs[_0x854c('0x58')](_0xcaf687,{'contexts':_0xedca18||[]});fs[_0x854c('0x59')](_0x854c('0x5a'),_0x247294);})[_0x854c('0x1d')](function(){return respondWithRpcPromise(_0x854c('0x5b'),_0x854c('0x52'),{'module':_0x854c('0x5c')});})[_0x854c('0x1d')](function(){var _0x49e9a3=_0x5aef93[_0x854c('0x5d')]['get']({'plain':!![]});if(!_0x49e9a3)throw new Error(_0x854c('0x5e'));if(_0x49e9a3['role']===_0x854c('0x5d')){var _0x1a361e=_0x142fbc[_0x854c('0x33')]({'plain':!![]});return db[_0x854c('0x5f')]['find']({'where':{'name':_0x854c('0x60'),'userProfileId':_0x49e9a3['userProfileId']},'raw':!![]})[_0x854c('0x1d')](function(_0x3d686d){if(_0x3d686d&&_0x3d686d['autoAssociation']===0x0){return db[_0x854c('0x34')][_0x854c('0x52')]({'name':_0x1a361e[_0x854c('0x36')],'resourceId':_0x1a361e['id'],'type':_0x3d686d[_0x854c('0x36')],'sectionId':_0x3d686d['id']},{})[_0x854c('0x1d')](function(){return _0x142fbc;});}else{return _0x142fbc;}})[_0x854c('0x25')](function(_0x2e4aff){logger[_0x854c('0x21')](_0x854c('0x61'),_0x2e4aff);throw _0x2e4aff;});}return _0x142fbc;})[_0x854c('0x1d')](respondWithResult(_0x3c9b7c,0xc9))[_0x854c('0x25')](handleError(_0x3c9b7c,null));};exports[_0x854c('0x31')]=function(_0x1470ae,_0x2d8e84,_0x515461){var _0x15abed;return db['VoiceContext'][_0x854c('0x51')]({'where':{'id':_0x1470ae[_0x854c('0x62')]['id']}})['then'](handleEntityNotFound(_0x2d8e84,null))['then'](saveUpdates(_0x1470ae[_0x854c('0x53')],null))[_0x854c('0x1d')](function(_0x483dc1){if(_0x483dc1){_0x15abed=_0x483dc1;return db[_0x854c('0x38')][_0x854c('0x4f')]({'raw':!![]});}})[_0x854c('0x1d')](function(_0x54c0f0){var _0x70ff57=fs['readFileSync'](path[_0x854c('0x55')](config[_0x854c('0x56')],_0x854c('0x57')),_0x854c('0x63'));var _0x20224f=ejs[_0x854c('0x58')](_0x70ff57,{'contexts':_0x54c0f0||[]});fs[_0x854c('0x59')](_0x854c('0x5a'),_0x20224f);})['then'](function(){return respondWithRpcPromise('Reload',_0x854c('0x31'),{'module':'chan_sip.so'});})[_0x854c('0x1d')](function(){return _0x15abed;})[_0x854c('0x1d')](respondWithResult(_0x2d8e84,null))[_0x854c('0x25')](handleError(_0x2d8e84,null));};exports[_0x854c('0x32')]=function(_0x56a096,_0x1acce0,_0x561f26){var _0x51cc07;return db[_0x854c('0x38')]['find']({'where':{'id':_0x56a096[_0x854c('0x62')]['id']}})[_0x854c('0x1d')](handleEntityNotFound(_0x1acce0,null))[_0x854c('0x1d')](removeEntity(_0x1acce0,null))['then'](function(){return db['VoiceContext'][_0x854c('0x4f')]({'raw':!![]});})[_0x854c('0x1d')](function(_0x321a74){var _0xf00c78=fs[_0x854c('0x54')](path['join'](config['root'],'server/files/templates/context.ejs'),_0x854c('0x63'));var _0x5ae014=ejs['render'](_0xf00c78,{'contexts':_0x321a74});fs[_0x854c('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5ae014);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0x854c('0x25')](handleError(_0x1acce0,null));}; \ No newline at end of file +var _0x42c9=['root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','join','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../config/utils','../../mysqldb','jayson/promise','client','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','get','Contexts','UserProfileResource','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','length','options','create','body','findAll','readFileSync'];(function(_0x24779f,_0x4b35b7){var _0x4f2180=function(_0x1dc458){while(--_0x1dc458){_0x24779f['push'](_0x24779f['shift']());}};_0x4f2180(++_0x4b35b7);}(_0x42c9,0x1ae));var _0x942c=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x42c9[_0x337748];return _0x3bb03f;};'use strict';var emlformat=require(_0x942c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x942c('0x1'));var jsonpatch=require(_0x942c('0x2'));var rp=require(_0x942c('0x3'));var moment=require(_0x942c('0x4'));var BPromise=require(_0x942c('0x5'));var Mustache=require(_0x942c('0x6'));var util=require(_0x942c('0x7'));var path=require(_0x942c('0x8'));var sox=require(_0x942c('0x9'));var csv=require(_0x942c('0xa'));var ejs=require(_0x942c('0xb'));var fs=require('fs');var fs_extra=require(_0x942c('0xc'));var _=require(_0x942c('0xd'));var squel=require(_0x942c('0xe'));var crypto=require(_0x942c('0xf'));var jsforce=require(_0x942c('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x942c('0xa'));var querystring=require(_0x942c('0x11'));var Papa=require(_0x942c('0x12'));var Redis=require('ioredis');var authService=require(_0x942c('0x13'));var qs=require(_0x942c('0x14'));var as=require(_0x942c('0x15'));var hardwareService=require(_0x942c('0x16'));var logger=require(_0x942c('0x17'))('api');var utils=require(_0x942c('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x942c('0x19'))['db'];var jayson=require(_0x942c('0x1a'));var client=jayson[_0x942c('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55ad8e,_0x14e60f,_0x53715d,_0x43f72b){return new BPromise(function(_0x2578d6,_0x21a131){var _0xba4d41=_0x43f72b||client;return _0xba4d41['request'](_0x55ad8e,_0x53715d)[_0x942c('0x1c')](function(_0x16782a){logger['info']('VoiceContext,\x20%s,\x20%s',_0x14e60f,'request\x20sent');logger[_0x942c('0x1d')](_0x942c('0x1e'),_0x14e60f,_0x942c('0x1f'),JSON[_0x942c('0x20')](_0x16782a));if(_0x16782a[_0x942c('0x21')]){if(_0x16782a[_0x942c('0x21')][_0x942c('0x22')]===0x1f4){logger[_0x942c('0x21')](_0x942c('0x23'),_0x14e60f,_0x16782a[_0x942c('0x21')][_0x942c('0x24')]);return _0x21a131(_0x16782a[_0x942c('0x21')][_0x942c('0x24')]);}logger[_0x942c('0x21')]('VoiceContext,\x20%s,\x20%s',_0x14e60f,_0x16782a[_0x942c('0x21')][_0x942c('0x24')]);return _0x2578d6(_0x16782a[_0x942c('0x21')][_0x942c('0x24')]);}else{logger['info'](_0x942c('0x23'),_0x14e60f,'request\x20sent');_0x2578d6(_0x16782a[_0x942c('0x25')][_0x942c('0x24')]);}})[_0x942c('0x26')](function(_0x1c50fe){logger[_0x942c('0x21')](_0x942c('0x23'),_0x14e60f,_0x1c50fe);_0x21a131(_0x1c50fe);});});}function respondWithStatusCode(_0x5c470c,_0x4b72d5){_0x4b72d5=_0x4b72d5||0xcc;return function(_0x58f409){if(_0x58f409){return _0x5c470c[_0x942c('0x27')](_0x4b72d5);}return _0x5c470c[_0x942c('0x28')](_0x4b72d5)[_0x942c('0x29')]();};}function respondWithResult(_0x421449,_0x377d1f){_0x377d1f=_0x377d1f||0xc8;return function(_0x263f63){if(_0x263f63){return _0x421449[_0x942c('0x28')](_0x377d1f)[_0x942c('0x2a')](_0x263f63);}};}function respondWithFilteredResult(_0x44c255,_0x13061a){return function(_0x2200ed){if(_0x2200ed){var _0x4ab7cd=typeof _0x13061a[_0x942c('0x2b')]===_0x942c('0x2c')&&typeof _0x13061a[_0x942c('0x2d')]===_0x942c('0x2c');var _0x554878=_0x2200ed['count'];var _0x33286b=_0x4ab7cd?0x0:_0x13061a[_0x942c('0x2b')];var _0x2e9930=_0x4ab7cd?_0x2200ed[_0x942c('0x2e')]:_0x13061a[_0x942c('0x2b')]+_0x13061a[_0x942c('0x2d')];var _0x59761d;if(_0x2e9930>=_0x554878){_0x2e9930=_0x554878;_0x59761d=0xc8;}else{_0x59761d=0xce;}_0x44c255[_0x942c('0x28')](_0x59761d);return _0x44c255[_0x942c('0x2f')](_0x942c('0x30'),_0x33286b+'-'+_0x2e9930+'/'+_0x554878)[_0x942c('0x2a')](_0x2200ed);}return null;};}function patchUpdates(_0x4a90ba){return function(_0x22b8af){try{jsonpatch['apply'](_0x22b8af,_0x4a90ba,!![]);}catch(_0x17c13b){return BPromise['reject'](_0x17c13b);}return _0x22b8af[_0x942c('0x31')]();};}function saveUpdates(_0x402dca,_0x1c4a87){return function(_0x4ee512){if(_0x4ee512){return _0x4ee512[_0x942c('0x32')](_0x402dca)[_0x942c('0x1c')](function(_0x506ec4){return _0x506ec4;});}return null;};}function removeEntity(_0x305505,_0x112223){return function(_0x1da715){if(_0x1da715){return _0x1da715[_0x942c('0x33')]()[_0x942c('0x1c')](function(){var _0x392f8f=_0x1da715[_0x942c('0x34')]({'plain':!![]});var _0x5a22c0=_0x942c('0x35');return db[_0x942c('0x36')][_0x942c('0x33')]({'where':{'type':_0x5a22c0,'resourceId':_0x392f8f['id']}})[_0x942c('0x1c')](function(){return _0x1da715;});})[_0x942c('0x1c')](function(){_0x305505[_0x942c('0x28')](0xcc)[_0x942c('0x29')]();});}};}function handleEntityNotFound(_0x144927,_0x4c523a){return function(_0x498401){if(!_0x498401){_0x144927[_0x942c('0x27')](0x194);}return _0x498401;};}function handleError(_0x29b17f,_0x56f538){_0x56f538=_0x56f538||0x1f4;return function(_0x4b9fee){logger[_0x942c('0x21')](_0x4b9fee['stack']);if(_0x4b9fee[_0x942c('0x37')]){delete _0x4b9fee[_0x942c('0x37')];}_0x29b17f[_0x942c('0x28')](_0x56f538)[_0x942c('0x38')](_0x4b9fee);};}exports[_0x942c('0x39')]=function(_0x1069fd,_0x7a1bf){var _0x1a8d59={},_0x2275a7={},_0x1d007e={'count':0x0,'rows':[]};var _0x1da66b=_[_0x942c('0x3a')](db[_0x942c('0x3b')]['rawAttributes'],function(_0x2f192b){return{'name':_0x2f192b[_0x942c('0x3c')],'type':_0x2f192b[_0x942c('0x3d')][_0x942c('0x3e')]};});_0x2275a7[_0x942c('0x3f')]=_['map'](_0x1da66b,_0x942c('0x37'));_0x2275a7[_0x942c('0x40')]=_[_0x942c('0x41')](_0x1069fd[_0x942c('0x40')]);_0x2275a7['filters']=_[_0x942c('0x42')](_0x2275a7['model'],_0x2275a7[_0x942c('0x40')]);_0x1a8d59['attributes']=_[_0x942c('0x42')](_0x2275a7['model'],qs[_0x942c('0x43')](_0x1069fd['query'][_0x942c('0x43')]));_0x1a8d59[_0x942c('0x44')]=_0x1a8d59[_0x942c('0x44')]['length']?_0x1a8d59[_0x942c('0x44')]:_0x2275a7['model'];if(!_0x1069fd[_0x942c('0x40')][_0x942c('0x45')](_0x942c('0x46'))){_0x1a8d59[_0x942c('0x2d')]=qs['limit'](_0x1069fd[_0x942c('0x40')][_0x942c('0x2d')]);_0x1a8d59['offset']=qs[_0x942c('0x2b')](_0x1069fd[_0x942c('0x40')][_0x942c('0x2b')]);}_0x1a8d59[_0x942c('0x47')]=qs[_0x942c('0x48')](_0x1069fd[_0x942c('0x40')][_0x942c('0x48')]);_0x1a8d59['where']=qs[_0x942c('0x49')](_[_0x942c('0x4a')](_0x1069fd[_0x942c('0x40')],_0x2275a7['filters']),_0x1da66b);if(_0x1069fd[_0x942c('0x40')]['filter']){_0x1a8d59[_0x942c('0x4b')]=_[_0x942c('0x4c')](_0x1a8d59['where'],{'$or':_[_0x942c('0x3a')](_0x1da66b,function(_0x22a341){if(_0x22a341[_0x942c('0x3d')]!==_0x942c('0x4d')){var _0x3858a0={};_0x3858a0[_0x22a341[_0x942c('0x37')]]={'$like':'%'+_0x1069fd[_0x942c('0x40')]['filter']+'%'};return _0x3858a0;}})});}_0x1a8d59=_['merge']({},_0x1a8d59,_0x1069fd['options']);var _0x12debb={'where':_0x1a8d59['where']};return db['VoiceContext'][_0x942c('0x2e')](_0x12debb)[_0x942c('0x1c')](function(_0x3ec18b){_0x1d007e[_0x942c('0x2e')]=_0x3ec18b;if(_0x1069fd[_0x942c('0x40')][_0x942c('0x4e')]){_0x1a8d59[_0x942c('0x4f')]=[{'all':!![]}];}return db[_0x942c('0x3b')]['findAll'](_0x1a8d59);})['then'](function(_0x1141a6){_0x1d007e[_0x942c('0x50')]=_0x1141a6;return _0x1d007e;})[_0x942c('0x1c')](respondWithFilteredResult(_0x7a1bf,_0x1a8d59))[_0x942c('0x26')](handleError(_0x7a1bf,null));};exports[_0x942c('0x51')]=function(_0x103b68,_0x230993){var _0x38f042={'raw':![],'where':{'id':_0x103b68[_0x942c('0x52')]['id']}},_0x35280a={};_0x35280a['model']=_[_0x942c('0x41')](db[_0x942c('0x3b')][_0x942c('0x53')]);_0x35280a[_0x942c('0x40')]=_['keys'](_0x103b68[_0x942c('0x40')]);_0x35280a['filters']=_[_0x942c('0x42')](_0x35280a[_0x942c('0x3f')],_0x35280a['query']);_0x38f042[_0x942c('0x44')]=_[_0x942c('0x42')](_0x35280a[_0x942c('0x3f')],qs[_0x942c('0x43')](_0x103b68[_0x942c('0x40')][_0x942c('0x43')]));_0x38f042['attributes']=_0x38f042['attributes'][_0x942c('0x54')]?_0x38f042[_0x942c('0x44')]:_0x35280a[_0x942c('0x3f')];if(_0x103b68[_0x942c('0x40')]['includeAll']){_0x38f042[_0x942c('0x4f')]=[{'all':!![]}];}_0x38f042=_[_0x942c('0x4c')]({},_0x38f042,_0x103b68[_0x942c('0x55')]);return db[_0x942c('0x3b')]['find'](_0x38f042)[_0x942c('0x1c')](handleEntityNotFound(_0x230993,null))[_0x942c('0x1c')](respondWithResult(_0x230993,null))[_0x942c('0x26')](handleError(_0x230993,null));};exports[_0x942c('0x56')]=function(_0x29ee55,_0x489339,_0x32785c){var _0x178037;return db[_0x942c('0x3b')][_0x942c('0x56')](_0x29ee55[_0x942c('0x57')],{'raw':!![]})[_0x942c('0x1c')](function(_0x11acb8){_0x178037=_0x11acb8;return db['VoiceContext'][_0x942c('0x58')]({'raw':!![]});})[_0x942c('0x1c')](function(_0x553d46){var _0x3520cd=fs[_0x942c('0x59')](path['join'](config[_0x942c('0x5a')],'server/files/templates/context.ejs'),_0x942c('0x5b'));var _0x20c1b0=ejs[_0x942c('0x5c')](_0x3520cd,{'contexts':_0x553d46||[]});fs[_0x942c('0x5d')](_0x942c('0x5e'),_0x20c1b0);})[_0x942c('0x1c')](function(){return respondWithRpcPromise(_0x942c('0x5f'),'create',{'module':'chan_sip.so'});})['then'](function(){var _0x25cf1a=_0x29ee55[_0x942c('0x60')][_0x942c('0x34')]({'plain':!![]});if(!_0x25cf1a)throw new Error(_0x942c('0x61'));if(_0x25cf1a[_0x942c('0x62')]===_0x942c('0x60')){var _0x1a306c=_0x178037[_0x942c('0x34')]({'plain':!![]});return db['UserProfileSection'][_0x942c('0x63')]({'where':{'name':_0x942c('0x35'),'userProfileId':_0x25cf1a[_0x942c('0x64')]},'raw':!![]})[_0x942c('0x1c')](function(_0x4d5be3){if(_0x4d5be3&&_0x4d5be3['autoAssociation']===0x0){return db[_0x942c('0x36')][_0x942c('0x56')]({'name':_0x1a306c[_0x942c('0x37')],'resourceId':_0x1a306c['id'],'type':_0x4d5be3[_0x942c('0x37')],'sectionId':_0x4d5be3['id']},{})[_0x942c('0x1c')](function(){return _0x178037;});}else{return _0x178037;}})[_0x942c('0x26')](function(_0x31f9e3){logger['error'](_0x942c('0x65'),_0x31f9e3);throw _0x31f9e3;});}return _0x178037;})[_0x942c('0x1c')](respondWithResult(_0x489339,0xc9))['catch'](handleError(_0x489339,null));};exports[_0x942c('0x32')]=function(_0x4d9ba9,_0x330d6d,_0x872af3){var _0x477425;return db['VoiceContext'][_0x942c('0x63')]({'where':{'id':_0x4d9ba9[_0x942c('0x52')]['id']}})[_0x942c('0x1c')](handleEntityNotFound(_0x330d6d,null))[_0x942c('0x1c')](saveUpdates(_0x4d9ba9['body'],null))[_0x942c('0x1c')](function(_0x34bf5d){if(_0x34bf5d){_0x477425=_0x34bf5d;return db[_0x942c('0x3b')]['findAll']({'raw':!![]});}})[_0x942c('0x1c')](function(_0x2e2ece){var _0x9a495b=fs[_0x942c('0x59')](path['join'](config[_0x942c('0x5a')],_0x942c('0x66')),_0x942c('0x5b'));var _0x27db2d=ejs[_0x942c('0x5c')](_0x9a495b,{'contexts':_0x2e2ece||[]});fs[_0x942c('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x27db2d);})[_0x942c('0x1c')](function(){return respondWithRpcPromise(_0x942c('0x5f'),'update',{'module':'chan_sip.so'});})[_0x942c('0x1c')](function(){return _0x477425;})['then'](respondWithResult(_0x330d6d,null))[_0x942c('0x26')](handleError(_0x330d6d,null));};exports[_0x942c('0x33')]=function(_0x548565,_0x394b8a,_0x697050){var _0x79b53c;return db['VoiceContext'][_0x942c('0x63')]({'where':{'id':_0x548565['params']['id']}})[_0x942c('0x1c')](handleEntityNotFound(_0x394b8a,null))[_0x942c('0x1c')](removeEntity(_0x394b8a,null))[_0x942c('0x1c')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x942c('0x1c')](function(_0x3dbdee){var _0x4000be=fs[_0x942c('0x59')](path[_0x942c('0x67')](config['root'],_0x942c('0x66')),'utf8');var _0x1ec219=ejs[_0x942c('0x5c')](_0x4000be,{'contexts':_0x3dbdee});fs[_0x942c('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1ec219);return respondWithRpcPromise('Reload',_0x942c('0x33'),{'module':'chan_sip.so'});})['catch'](handleError(_0x394b8a,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 3bbea5b..9126643 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 _0x2b7e=['../../config/environment','./voiceContext.attributes','exports','define','voice_contexts','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2b7e,0x13d));var _0xe2b7=function(_0x39d945,_0x359b9d){_0x39d945=_0x39d945-0x0;var _0x333401=_0x2b7e[_0x39d945];return _0x333401;};'use strict';var _=require(_0xe2b7('0x0'));var util=require(_0xe2b7('0x1'));var logger=require('../../config/logger')(_0xe2b7('0x2'));var moment=require(_0xe2b7('0x3'));var BPromise=require(_0xe2b7('0x4'));var rp=require(_0xe2b7('0x5'));var fs=require('fs');var path=require(_0xe2b7('0x6'));var rimraf=require(_0xe2b7('0x7'));var config=require(_0xe2b7('0x8'));var attributes=require(_0xe2b7('0x9'));module[_0xe2b7('0xa')]=function(_0x374f94,_0x20a31b){return _0x374f94[_0xe2b7('0xb')]('VoiceContext',attributes,{'tableName':_0xe2b7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82bb=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','VoiceContext','voice_contexts','lodash'];(function(_0x450510,_0x5636e9){var _0xe94a9=function(_0x447551){while(--_0x447551){_0x450510['push'](_0x450510['shift']());}};_0xe94a9(++_0x5636e9);}(_0x82bb,0xd0));var _0xb82b=function(_0x4cab90,_0x1acab9){_0x4cab90=_0x4cab90-0x0;var _0x2a7c1d=_0x82bb[_0x4cab90];return _0x2a7c1d;};'use strict';var _=require(_0xb82b('0x0'));var util=require(_0xb82b('0x1'));var logger=require(_0xb82b('0x2'))(_0xb82b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb82b('0x4'));var fs=require('fs');var path=require(_0xb82b('0x5'));var rimraf=require(_0xb82b('0x6'));var config=require(_0xb82b('0x7'));var attributes=require('./voiceContext.attributes');module['exports']=function(_0x452d64,_0x1ce845){return _0x452d64[_0xb82b('0x8')](_0xb82b('0x9'),attributes,{'tableName':_0xb82b('0xa'),'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 99325a5..6daf2e8 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 _0xd38f=['code','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x239875,_0x52a793){var _0x55a8d6=function(_0x1c48db){while(--_0x1c48db){_0x239875['push'](_0x239875['shift']());}};_0x55a8d6(++_0x52a793);}(_0xd38f,0xa3));var _0xfd38=function(_0x21adf0,_0x5303dc){_0x21adf0=_0x21adf0-0x0;var _0x4504bf=_0xd38f[_0x21adf0];return _0x4504bf;};'use strict';var _=require(_0xfd38('0x0'));var util=require(_0xfd38('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd38('0x2'));var db=require(_0xfd38('0x3'))['db'];var utils=require(_0xfd38('0x4'));var logger=require(_0xfd38('0x5'))(_0xfd38('0x6'));var config=require(_0xfd38('0x7'));var jayson=require(_0xfd38('0x8'));var client=jayson[_0xfd38('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x318785,_0x9e8238,_0x433783){return new BPromise(function(_0xd0d6d8,_0x57ffcb){return client['request'](_0x318785,_0x433783)[_0xfd38('0xa')](function(_0x2f789a){logger['info'](_0xfd38('0xb'),_0x9e8238,_0xfd38('0xc'));logger[_0xfd38('0xd')](_0xfd38('0xe'),_0x9e8238,_0xfd38('0xc'),JSON[_0xfd38('0xf')](_0x2f789a));if(_0x2f789a[_0xfd38('0x10')]){if(_0x2f789a[_0xfd38('0x10')][_0xfd38('0x11')]===0x1f4){logger[_0xfd38('0x10')]('VoiceContext,\x20%s,\x20%s',_0x9e8238,_0x2f789a[_0xfd38('0x10')]['message']);return _0x57ffcb(_0x2f789a[_0xfd38('0x10')][_0xfd38('0x12')]);}logger[_0xfd38('0x10')](_0xfd38('0xb'),_0x9e8238,_0x2f789a[_0xfd38('0x10')]['message']);return _0xd0d6d8(_0x2f789a['error'][_0xfd38('0x12')]);}else{logger['info'](_0xfd38('0xb'),_0x9e8238,_0xfd38('0xc'));_0xd0d6d8(_0x2f789a['result'][_0xfd38('0x12')]);}})[_0xfd38('0x13')](function(_0x447252){logger[_0xfd38('0x10')](_0xfd38('0xb'),_0x9e8238,_0x447252);_0x57ffcb(_0x447252);});});} \ No newline at end of file +var _0x8b35=['code','VoiceContext,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x3ed8e0,_0x79c682){var _0x1d2d1e=function(_0x2a7f3){while(--_0x2a7f3){_0x3ed8e0['push'](_0x3ed8e0['shift']());}};_0x1d2d1e(++_0x79c682);}(_0x8b35,0x17a));var _0x58b3=function(_0x1aed91,_0x373232){_0x1aed91=_0x1aed91-0x0;var _0x4b23cc=_0x8b35[_0x1aed91];return _0x4b23cc;};'use strict';var _=require(_0x58b3('0x0'));var util=require(_0x58b3('0x1'));var moment=require(_0x58b3('0x2'));var BPromise=require(_0x58b3('0x3'));var rs=require(_0x58b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58b3('0x5'))['db'];var utils=require(_0x58b3('0x6'));var logger=require(_0x58b3('0x7'))(_0x58b3('0x8'));var config=require(_0x58b3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x58b3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35d044,_0x5ec362,_0x503b78){return new BPromise(function(_0x126232,_0x46fda3){return client[_0x58b3('0xb')](_0x35d044,_0x503b78)[_0x58b3('0xc')](function(_0x446e8d){logger[_0x58b3('0xd')]('VoiceContext,\x20%s,\x20%s',_0x5ec362,_0x58b3('0xe'));logger[_0x58b3('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5ec362,_0x58b3('0xe'),JSON[_0x58b3('0x10')](_0x446e8d));if(_0x446e8d[_0x58b3('0x11')]){if(_0x446e8d['error'][_0x58b3('0x12')]===0x1f4){logger['error'](_0x58b3('0x13'),_0x5ec362,_0x446e8d[_0x58b3('0x11')][_0x58b3('0x14')]);return _0x46fda3(_0x446e8d[_0x58b3('0x11')][_0x58b3('0x14')]);}logger[_0x58b3('0x11')](_0x58b3('0x13'),_0x5ec362,_0x446e8d['error'][_0x58b3('0x14')]);return _0x126232(_0x446e8d[_0x58b3('0x11')]['message']);}else{logger[_0x58b3('0xd')](_0x58b3('0x13'),_0x5ec362,'request\x20sent');_0x126232(_0x446e8d['result'][_0x58b3('0x14')]);}})[_0x58b3('0x15')](function(_0x38f6a7){logger[_0x58b3('0x11')]('VoiceContext,\x20%s,\x20%s',_0x5ec362,_0x38f6a7);_0x46fda3(_0x38f6a7);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 2d98b10..766d5c3 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 _0x7883=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','delete'];(function(_0x2c75ef,_0xab78e9){var _0x49a4b1=function(_0x268ab){while(--_0x268ab){_0x2c75ef['push'](_0x2c75ef['shift']());}};_0x49a4b1(++_0xab78e9);}(_0x7883,0x1b6));var _0x3788=function(_0x133ab6,_0x5140c9){_0x133ab6=_0x133ab6-0x0;var _0xe6075a=_0x7883[_0x133ab6];return _0xe6075a;};'use strict';var multer=require(_0x3788('0x0'));var util=require('util');var path=require(_0x3788('0x1'));var timeout=require(_0x3788('0x2'));var express=require(_0x3788('0x3'));var router=express[_0x3788('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3788('0x5'));var interaction=require(_0x3788('0x6'));var config=require(_0x3788('0x7'));var controller=require(_0x3788('0x8'));router[_0x3788('0x9')]('/',auth[_0x3788('0xa')](),controller[_0x3788('0xb')]);router[_0x3788('0x9')](_0x3788('0xc'),auth['isAuthenticated'](),controller[_0x3788('0xd')]);router[_0x3788('0x9')](_0x3788('0xe'),auth[_0x3788('0xa')](),controller[_0x3788('0xf')]);router['post']('/',auth[_0x3788('0xa')](),controller[_0x3788('0x10')]);router['put'](_0x3788('0xe'),auth[_0x3788('0xa')](),controller['update']);router[_0x3788('0x11')](_0x3788('0xe'),auth[_0x3788('0xa')](),controller['destroy']);module[_0x3788('0x12')]=router; \ No newline at end of file +var _0x95cc=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller'];(function(_0x258229,_0x32027f){var _0x482c09=function(_0x4624d4){while(--_0x4624d4){_0x258229['push'](_0x258229['shift']());}};_0x482c09(++_0x32027f);}(_0x95cc,0x19a));var _0xc95c=function(_0x25e625,_0x2a97e2){_0x25e625=_0x25e625-0x0;var _0x3312cb=_0x95cc[_0x25e625];return _0x3312cb;};'use strict';var multer=require(_0xc95c('0x0'));var util=require(_0xc95c('0x1'));var path=require(_0xc95c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc95c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc95c('0x4'));var interaction=require(_0xc95c('0x5'));var config=require(_0xc95c('0x6'));var controller=require(_0xc95c('0x7'));router[_0xc95c('0x8')]('/',auth[_0xc95c('0x9')](),controller[_0xc95c('0xa')]);router[_0xc95c('0x8')](_0xc95c('0xb'),auth[_0xc95c('0x9')](),controller[_0xc95c('0xc')]);router['get'](_0xc95c('0xd'),auth[_0xc95c('0x9')](),controller[_0xc95c('0xe')]);router[_0xc95c('0xf')]('/',auth[_0xc95c('0x9')](),controller[_0xc95c('0x10')]);router[_0xc95c('0x11')](_0xc95c('0xd'),auth[_0xc95c('0x9')](),controller[_0xc95c('0x12')]);router[_0xc95c('0x13')](_0xc95c('0xd'),auth[_0xc95c('0x9')](),controller[_0xc95c('0x14')]);module[_0xc95c('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 12696c7..5eaf088 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 _0xbec5=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x51e871,_0x194890){var _0x1fb16f=function(_0x40559b){while(--_0x40559b){_0x51e871['push'](_0x51e871['shift']());}};_0x1fb16f(++_0x194890);}(_0xbec5,0xe5));var _0x5bec=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xbec5[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5bec('0x2')]},'channelstate':{'type':Sequelize[_0x5bec('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'calleridnum':{'type':Sequelize[_0x5bec('0x2')]},'calleridname':{'type':Sequelize[_0x5bec('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5bec('0x2')]},'language':{'type':Sequelize[_0x5bec('0x2')]},'accountcode':{'type':Sequelize[_0x5bec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5bec('0x2')]},'priority':{'type':Sequelize[_0x5bec('0x3')]},'uniqueid':{'type':Sequelize[_0x5bec('0x2')]},'linkedid':{'type':Sequelize[_0x5bec('0x2')]},'destchannel':{'type':Sequelize[_0x5bec('0x2')]},'destchannelstate':{'type':Sequelize[_0x5bec('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5bec('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5bec('0x2')]},'destaccountcode':{'type':Sequelize[_0x5bec('0x2')]},'destcontext':{'type':Sequelize[_0x5bec('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5bec('0x3')]},'destuniqueid':{'type':Sequelize[_0x5bec('0x2')]},'destlinkedid':{'type':Sequelize[_0x5bec('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x5bec('0x2')]},'starttime':{'type':Sequelize[_0x5bec('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5bec('0x4')]},'lastevent':{'type':Sequelize[_0x5bec('0x2')],'comment':_0x5bec('0x5')},'routeId':{'type':Sequelize[_0x5bec('0x3')]},'duration':{'type':Sequelize[_0x5bec('0x3')]},'holdtime':{'type':Sequelize[_0x5bec('0x3')]},'billableseconds':{'type':Sequelize[_0x5bec('0x3')]}}; \ No newline at end of file +var _0x4b84=['INTEGER','STRING','DATE','called,connect,complete','sequelize','exports'];(function(_0x426aa9,_0xc9fd9f){var _0x4fb0bd=function(_0x31aa6e){while(--_0x31aa6e){_0x426aa9['push'](_0x426aa9['shift']());}};_0x4fb0bd(++_0xc9fd9f);}(_0x4b84,0x1cc));var _0x44b8=function(_0x837dad,_0x1d9098){_0x837dad=_0x837dad-0x0;var _0x1d62d3=_0x4b84[_0x837dad];return _0x1d62d3;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x44b8('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinename':{'type':Sequelize[_0x44b8('0x3')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x44b8('0x3')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x44b8('0x3')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x44b8('0x3')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x44b8('0x3')]},'destcalleridname':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x44b8('0x3')]},'destaccountcode':{'type':Sequelize[_0x44b8('0x3')]},'destcontext':{'type':Sequelize[_0x44b8('0x3')]},'destexten':{'type':Sequelize[_0x44b8('0x3')]},'destpriority':{'type':Sequelize[_0x44b8('0x2')]},'destuniqueid':{'type':Sequelize[_0x44b8('0x3')]},'destlinkedid':{'type':Sequelize[_0x44b8('0x3')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x44b8('0x3')]},'starttime':{'type':Sequelize[_0x44b8('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x44b8('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x44b8('0x5')},'routeId':{'type':Sequelize[_0x44b8('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x44b8('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 2e0d046..e81df5c 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 _0xe4aa=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','then','error','name','send','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra'];(function(_0x161312,_0x28f518){var _0x50f468=function(_0x26a1ab){while(--_0x26a1ab){_0x161312['push'](_0x161312['shift']());}};_0x50f468(++_0x28f518);}(_0xe4aa,0x87));var _0xae4a=function(_0x49929e,_0x72b8ac){_0x49929e=_0x49929e-0x0;var _0x2112e3=_0xe4aa[_0x49929e];return _0x2112e3;};'use strict';var emlformat=require(_0xae4a('0x0'));var rimraf=require(_0xae4a('0x1'));var zipdir=require(_0xae4a('0x2'));var jsonpatch=require(_0xae4a('0x3'));var rp=require(_0xae4a('0x4'));var moment=require(_0xae4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xae4a('0x6'));var path=require(_0xae4a('0x7'));var sox=require('sox');var csv=require(_0xae4a('0x8'));var ejs=require(_0xae4a('0x9'));var fs=require('fs');var fs_extra=require(_0xae4a('0xa'));var _=require('lodash');var squel=require(_0xae4a('0xb'));var crypto=require(_0xae4a('0xc'));var jsforce=require(_0xae4a('0xd'));var deskjs=require(_0xae4a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xae4a('0xf'));var Papa=require(_0xae4a('0x10'));var Redis=require(_0xae4a('0x11'));var authService=require(_0xae4a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xae4a('0x13'));var hardwareService=require(_0xae4a('0x14'));var logger=require(_0xae4a('0x15'))(_0xae4a('0x16'));var utils=require(_0xae4a('0x17'));var config=require(_0xae4a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xae4a('0x19'))['db'];function respondWithStatusCode(_0x4dff2d,_0x38190d){_0x38190d=_0x38190d||0xcc;return function(_0x5695d6){if(_0x5695d6){return _0x4dff2d[_0xae4a('0x1a')](_0x38190d);}return _0x4dff2d[_0xae4a('0x1b')](_0x38190d)[_0xae4a('0x1c')]();};}function respondWithResult(_0x171519,_0x2100e5){_0x2100e5=_0x2100e5||0xc8;return function(_0x51eebf){if(_0x51eebf){return _0x171519[_0xae4a('0x1b')](_0x2100e5)[_0xae4a('0x1d')](_0x51eebf);}};}function respondWithFilteredResult(_0x2f622d,_0xcd4361){return function(_0x2c14e1){if(_0x2c14e1){var _0x5e5266=typeof _0xcd4361['offset']===_0xae4a('0x1e')&&typeof _0xcd4361[_0xae4a('0x1f')]===_0xae4a('0x1e');var _0x312143=_0x2c14e1[_0xae4a('0x20')];var _0x51e1d9=_0x5e5266?0x0:_0xcd4361[_0xae4a('0x21')];var _0x57bd71=_0x5e5266?_0x2c14e1[_0xae4a('0x20')]:_0xcd4361[_0xae4a('0x21')]+_0xcd4361[_0xae4a('0x1f')];var _0x153a8b;if(_0x57bd71>=_0x312143){_0x57bd71=_0x312143;_0x153a8b=0xc8;}else{_0x153a8b=0xce;}_0x2f622d[_0xae4a('0x1b')](_0x153a8b);return _0x2f622d['set']('Content-Range',_0x51e1d9+'-'+_0x57bd71+'/'+_0x312143)[_0xae4a('0x1d')](_0x2c14e1);}return null;};}function patchUpdates(_0x2b9f49){return function(_0x545e56){try{jsonpatch['apply'](_0x545e56,_0x2b9f49,!![]);}catch(_0x23c259){return BPromise[_0xae4a('0x22')](_0x23c259);}return _0x545e56[_0xae4a('0x23')]();};}function saveUpdates(_0x9c14de,_0x1f2d2b){return function(_0x7dcdc5){if(_0x7dcdc5){return _0x7dcdc5[_0xae4a('0x24')](_0x9c14de)[_0xae4a('0x25')](function(_0x270ff0){return _0x270ff0;});}return null;};}function removeEntity(_0x54c34d,_0x498784){return function(_0x3ed96d){if(_0x3ed96d){return _0x3ed96d['destroy']()[_0xae4a('0x25')](function(){_0x54c34d[_0xae4a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x315e86,_0x2b9dc4){return function(_0x514c12){if(!_0x514c12){_0x315e86[_0xae4a('0x1a')](0x194);}return _0x514c12;};}function handleError(_0x127263,_0x4c2b62){_0x4c2b62=_0x4c2b62||0x1f4;return function(_0xf46072){logger[_0xae4a('0x26')](_0xf46072['stack']);if(_0xf46072[_0xae4a('0x27')]){delete _0xf46072['name'];}_0x127263[_0xae4a('0x1b')](_0x4c2b62)[_0xae4a('0x28')](_0xf46072);};}exports['index']=function(_0x393aa3,_0x113daa){var _0x392fbb={},_0x87d1e6={},_0x160fb6={'count':0x0,'rows':[]};var _0x108284=_[_0xae4a('0x29')](db[_0xae4a('0x2a')]['rawAttributes'],function(_0x2466ee){return{'name':_0x2466ee[_0xae4a('0x2b')],'type':_0x2466ee[_0xae4a('0x2c')][_0xae4a('0x2d')]};});_0x87d1e6[_0xae4a('0x2e')]=_[_0xae4a('0x29')](_0x108284,_0xae4a('0x27'));_0x87d1e6[_0xae4a('0x2f')]=_[_0xae4a('0x30')](_0x393aa3['query']);_0x87d1e6[_0xae4a('0x31')]=_['intersection'](_0x87d1e6[_0xae4a('0x2e')],_0x87d1e6['query']);_0x392fbb[_0xae4a('0x32')]=_[_0xae4a('0x33')](_0x87d1e6[_0xae4a('0x2e')],qs[_0xae4a('0x34')](_0x393aa3['query'][_0xae4a('0x34')]));_0x392fbb[_0xae4a('0x32')]=_0x392fbb[_0xae4a('0x32')][_0xae4a('0x35')]?_0x392fbb[_0xae4a('0x32')]:_0x87d1e6['model'];if(!_0x393aa3['query']['hasOwnProperty'](_0xae4a('0x36'))){_0x392fbb['limit']=qs['limit'](_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x1f')]);_0x392fbb[_0xae4a('0x21')]=qs[_0xae4a('0x21')](_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x21')]);}_0x392fbb['order']=qs[_0xae4a('0x37')](_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x37')]);_0x392fbb[_0xae4a('0x38')]=qs[_0xae4a('0x31')](_['pick'](_0x393aa3['query'],_0x87d1e6[_0xae4a('0x31')]),_0x108284);if(_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x39')]){_0x392fbb[_0xae4a('0x38')]=_[_0xae4a('0x3a')](_0x392fbb['where'],{'$or':_[_0xae4a('0x29')](_0x108284,function(_0x4a6e75){if(_0x4a6e75[_0xae4a('0x2c')]!==_0xae4a('0x3b')){var _0x10ced7={};_0x10ced7[_0x4a6e75[_0xae4a('0x27')]]={'$like':'%'+_0x393aa3[_0xae4a('0x2f')][_0xae4a('0x39')]+'%'};return _0x10ced7;}})});}_0x392fbb=_['merge']({},_0x392fbb,_0x393aa3[_0xae4a('0x3c')]);var _0x5e759c={'where':_0x392fbb[_0xae4a('0x38')]};return db[_0xae4a('0x2a')][_0xae4a('0x20')](_0x5e759c)['then'](function(_0x1f9b67){_0x160fb6[_0xae4a('0x20')]=_0x1f9b67;if(_0x393aa3[_0xae4a('0x2f')]['includeAll']){_0x392fbb[_0xae4a('0x3d')]=[{'all':!![]}];}return db[_0xae4a('0x2a')][_0xae4a('0x3e')](_0x392fbb);})[_0xae4a('0x25')](function(_0x35c48a){_0x160fb6['rows']=_0x35c48a;return _0x160fb6;})['then'](respondWithFilteredResult(_0x113daa,_0x392fbb))[_0xae4a('0x3f')](handleError(_0x113daa,null));};exports[_0xae4a('0x40')]=function(_0x3a8b6f,_0x554fc8){var _0x3ba0ee={'raw':!![],'where':{'id':_0x3a8b6f[_0xae4a('0x41')]['id']}},_0xa4f890={};_0xa4f890[_0xae4a('0x2e')]=_[_0xae4a('0x30')](db[_0xae4a('0x2a')][_0xae4a('0x42')]);_0xa4f890[_0xae4a('0x2f')]=_[_0xae4a('0x30')](_0x3a8b6f[_0xae4a('0x2f')]);_0xa4f890[_0xae4a('0x31')]=_[_0xae4a('0x33')](_0xa4f890[_0xae4a('0x2e')],_0xa4f890[_0xae4a('0x2f')]);_0x3ba0ee[_0xae4a('0x32')]=_[_0xae4a('0x33')](_0xa4f890[_0xae4a('0x2e')],qs[_0xae4a('0x34')](_0x3a8b6f[_0xae4a('0x2f')]['fields']));_0x3ba0ee['attributes']=_0x3ba0ee[_0xae4a('0x32')]['length']?_0x3ba0ee['attributes']:_0xa4f890[_0xae4a('0x2e')];if(_0x3a8b6f[_0xae4a('0x2f')][_0xae4a('0x43')]){_0x3ba0ee['include']=[{'all':!![]}];}_0x3ba0ee=_[_0xae4a('0x3a')]({},_0x3ba0ee,_0x3a8b6f[_0xae4a('0x3c')]);return db[_0xae4a('0x2a')]['find'](_0x3ba0ee)[_0xae4a('0x25')](handleEntityNotFound(_0x554fc8,null))[_0xae4a('0x25')](respondWithResult(_0x554fc8,null))['catch'](handleError(_0x554fc8,null));};exports[_0xae4a('0x44')]=function(_0x336162,_0x258e6f){return db[_0xae4a('0x2a')][_0xae4a('0x44')](_0x336162[_0xae4a('0x45')],{})['then'](respondWithResult(_0x258e6f,0xc9))[_0xae4a('0x3f')](handleError(_0x258e6f,null));};exports['update']=function(_0x6f219a,_0x20241e){if(_0x6f219a['body']['id']){delete _0x6f219a['body']['id'];}return db[_0xae4a('0x2a')][_0xae4a('0x46')]({'where':{'id':_0x6f219a[_0xae4a('0x41')]['id']}})[_0xae4a('0x25')](handleEntityNotFound(_0x20241e,null))[_0xae4a('0x25')](saveUpdates(_0x6f219a[_0xae4a('0x45')],null))[_0xae4a('0x25')](respondWithResult(_0x20241e,null))[_0xae4a('0x3f')](handleError(_0x20241e,null));};exports[_0xae4a('0x47')]=function(_0x1fbefe,_0x5a89a5){return db[_0xae4a('0x2a')][_0xae4a('0x46')]({'where':{'id':_0x1fbefe[_0xae4a('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a89a5,null))['then'](removeEntity(_0x5a89a5,null))[_0xae4a('0x3f')](handleError(_0x5a89a5,null));};exports[_0xae4a('0x48')]=function(_0x8a3eb6,_0xd71434){return db[_0xae4a('0x2a')][_0xae4a('0x48')]()['then'](respondWithResult(_0xd71434,null))[_0xae4a('0x3f')](handleError(_0xd71434,null));}; \ No newline at end of file +var _0xff9c=['describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','include','catch','show','params','rawAttributes','includeAll','find','create','body'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xff9c,0x187));var _0xcff9=function(_0x9f3a38,_0x5f1cd6){_0x9f3a38=_0x9f3a38-0x0;var _0x5a5b06=_0xff9c[_0x9f3a38];return _0x5a5b06;};'use strict';var emlformat=require(_0xcff9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcff9('0x1'));var jsonpatch=require(_0xcff9('0x2'));var rp=require(_0xcff9('0x3'));var moment=require(_0xcff9('0x4'));var BPromise=require(_0xcff9('0x5'));var Mustache=require(_0xcff9('0x6'));var util=require(_0xcff9('0x7'));var path=require('path');var sox=require(_0xcff9('0x8'));var csv=require(_0xcff9('0x9'));var ejs=require(_0xcff9('0xa'));var fs=require('fs');var fs_extra=require(_0xcff9('0xb'));var _=require(_0xcff9('0xc'));var squel=require('squel');var crypto=require(_0xcff9('0xd'));var jsforce=require(_0xcff9('0xe'));var deskjs=require(_0xcff9('0xf'));var toCsv=require(_0xcff9('0x9'));var querystring=require(_0xcff9('0x10'));var Papa=require(_0xcff9('0x11'));var Redis=require('ioredis');var authService=require(_0xcff9('0x12'));var qs=require(_0xcff9('0x13'));var as=require(_0xcff9('0x14'));var hardwareService=require(_0xcff9('0x15'));var logger=require(_0xcff9('0x16'))('api');var utils=require(_0xcff9('0x17'));var config=require(_0xcff9('0x18'));var licenseUtil=require(_0xcff9('0x19'));var db=require(_0xcff9('0x1a'))['db'];function respondWithStatusCode(_0x440248,_0x27e247){_0x27e247=_0x27e247||0xcc;return function(_0x445d43){if(_0x445d43){return _0x440248[_0xcff9('0x1b')](_0x27e247);}return _0x440248[_0xcff9('0x1c')](_0x27e247)[_0xcff9('0x1d')]();};}function respondWithResult(_0x160eee,_0x5f0e88){_0x5f0e88=_0x5f0e88||0xc8;return function(_0x49f10f){if(_0x49f10f){return _0x160eee[_0xcff9('0x1c')](_0x5f0e88)[_0xcff9('0x1e')](_0x49f10f);}};}function respondWithFilteredResult(_0x17ea79,_0x53eed6){return function(_0x58ba21){if(_0x58ba21){var _0x351839=typeof _0x53eed6['offset']===_0xcff9('0x1f')&&typeof _0x53eed6['limit']===_0xcff9('0x1f');var _0x5b348a=_0x58ba21[_0xcff9('0x20')];var _0x30ef44=_0x351839?0x0:_0x53eed6[_0xcff9('0x21')];var _0x220336=_0x351839?_0x58ba21['count']:_0x53eed6['offset']+_0x53eed6[_0xcff9('0x22')];var _0x25ddf2;if(_0x220336>=_0x5b348a){_0x220336=_0x5b348a;_0x25ddf2=0xc8;}else{_0x25ddf2=0xce;}_0x17ea79[_0xcff9('0x1c')](_0x25ddf2);return _0x17ea79[_0xcff9('0x23')]('Content-Range',_0x30ef44+'-'+_0x220336+'/'+_0x5b348a)[_0xcff9('0x1e')](_0x58ba21);}return null;};}function patchUpdates(_0xedf157){return function(_0x41dfe2){try{jsonpatch[_0xcff9('0x24')](_0x41dfe2,_0xedf157,!![]);}catch(_0x177abe){return BPromise[_0xcff9('0x25')](_0x177abe);}return _0x41dfe2[_0xcff9('0x26')]();};}function saveUpdates(_0x328603,_0x334a30){return function(_0x184096){if(_0x184096){return _0x184096[_0xcff9('0x27')](_0x328603)[_0xcff9('0x28')](function(_0x3495ee){return _0x3495ee;});}return null;};}function removeEntity(_0x327e72,_0x17bab0){return function(_0x3b4cd6){if(_0x3b4cd6){return _0x3b4cd6[_0xcff9('0x29')]()[_0xcff9('0x28')](function(){_0x327e72[_0xcff9('0x1c')](0xcc)[_0xcff9('0x1d')]();});}};}function handleEntityNotFound(_0x465c46,_0x348642){return function(_0x5e9585){if(!_0x5e9585){_0x465c46[_0xcff9('0x1b')](0x194);}return _0x5e9585;};}function handleError(_0x394e06,_0x4d4e4b){_0x4d4e4b=_0x4d4e4b||0x1f4;return function(_0x463249){logger[_0xcff9('0x2a')](_0x463249[_0xcff9('0x2b')]);if(_0x463249[_0xcff9('0x2c')]){delete _0x463249[_0xcff9('0x2c')];}_0x394e06['status'](_0x4d4e4b)[_0xcff9('0x2d')](_0x463249);};}exports[_0xcff9('0x2e')]=function(_0x6accc1,_0x57c493){var _0x1b08c7={},_0xafe592={},_0x162618={'count':0x0,'rows':[]};var _0x3f3c1d=_[_0xcff9('0x2f')](db[_0xcff9('0x30')]['rawAttributes'],function(_0xd1dae6){return{'name':_0xd1dae6[_0xcff9('0x31')],'type':_0xd1dae6[_0xcff9('0x32')][_0xcff9('0x33')]};});_0xafe592[_0xcff9('0x34')]=_[_0xcff9('0x2f')](_0x3f3c1d,_0xcff9('0x2c'));_0xafe592[_0xcff9('0x35')]=_[_0xcff9('0x36')](_0x6accc1[_0xcff9('0x35')]);_0xafe592['filters']=_[_0xcff9('0x37')](_0xafe592['model'],_0xafe592[_0xcff9('0x35')]);_0x1b08c7[_0xcff9('0x38')]=_['intersection'](_0xafe592['model'],qs['fields'](_0x6accc1[_0xcff9('0x35')][_0xcff9('0x39')]));_0x1b08c7[_0xcff9('0x38')]=_0x1b08c7[_0xcff9('0x38')][_0xcff9('0x3a')]?_0x1b08c7[_0xcff9('0x38')]:_0xafe592[_0xcff9('0x34')];if(!_0x6accc1[_0xcff9('0x35')][_0xcff9('0x3b')](_0xcff9('0x3c'))){_0x1b08c7['limit']=qs[_0xcff9('0x22')](_0x6accc1[_0xcff9('0x35')]['limit']);_0x1b08c7[_0xcff9('0x21')]=qs['offset'](_0x6accc1[_0xcff9('0x35')][_0xcff9('0x21')]);}_0x1b08c7[_0xcff9('0x3d')]=qs['sort'](_0x6accc1[_0xcff9('0x35')][_0xcff9('0x3e')]);_0x1b08c7[_0xcff9('0x3f')]=qs[_0xcff9('0x40')](_[_0xcff9('0x41')](_0x6accc1['query'],_0xafe592[_0xcff9('0x40')]),_0x3f3c1d);if(_0x6accc1[_0xcff9('0x35')]['filter']){_0x1b08c7[_0xcff9('0x3f')]=_[_0xcff9('0x42')](_0x1b08c7['where'],{'$or':_[_0xcff9('0x2f')](_0x3f3c1d,function(_0x236769){if(_0x236769[_0xcff9('0x32')]!=='VIRTUAL'){var _0x2a6ccc={};_0x2a6ccc[_0x236769[_0xcff9('0x2c')]]={'$like':'%'+_0x6accc1[_0xcff9('0x35')]['filter']+'%'};return _0x2a6ccc;}})});}_0x1b08c7=_[_0xcff9('0x42')]({},_0x1b08c7,_0x6accc1[_0xcff9('0x43')]);var _0x2d5506={'where':_0x1b08c7[_0xcff9('0x3f')]};return db[_0xcff9('0x30')][_0xcff9('0x20')](_0x2d5506)[_0xcff9('0x28')](function(_0x3e5744){_0x162618[_0xcff9('0x20')]=_0x3e5744;if(_0x6accc1[_0xcff9('0x35')]['includeAll']){_0x1b08c7[_0xcff9('0x44')]=[{'all':!![]}];}return db[_0xcff9('0x30')]['findAll'](_0x1b08c7);})[_0xcff9('0x28')](function(_0x1839f6){_0x162618['rows']=_0x1839f6;return _0x162618;})['then'](respondWithFilteredResult(_0x57c493,_0x1b08c7))[_0xcff9('0x45')](handleError(_0x57c493,null));};exports[_0xcff9('0x46')]=function(_0xc6c645,_0x9cf846){var _0x743e2d={'raw':!![],'where':{'id':_0xc6c645[_0xcff9('0x47')]['id']}},_0x3cd739={};_0x3cd739[_0xcff9('0x34')]=_[_0xcff9('0x36')](db[_0xcff9('0x30')][_0xcff9('0x48')]);_0x3cd739[_0xcff9('0x35')]=_[_0xcff9('0x36')](_0xc6c645[_0xcff9('0x35')]);_0x3cd739[_0xcff9('0x40')]=_[_0xcff9('0x37')](_0x3cd739[_0xcff9('0x34')],_0x3cd739[_0xcff9('0x35')]);_0x743e2d[_0xcff9('0x38')]=_[_0xcff9('0x37')](_0x3cd739[_0xcff9('0x34')],qs[_0xcff9('0x39')](_0xc6c645['query'][_0xcff9('0x39')]));_0x743e2d[_0xcff9('0x38')]=_0x743e2d[_0xcff9('0x38')]['length']?_0x743e2d['attributes']:_0x3cd739[_0xcff9('0x34')];if(_0xc6c645[_0xcff9('0x35')][_0xcff9('0x49')]){_0x743e2d[_0xcff9('0x44')]=[{'all':!![]}];}_0x743e2d=_[_0xcff9('0x42')]({},_0x743e2d,_0xc6c645[_0xcff9('0x43')]);return db['VoiceDialReport'][_0xcff9('0x4a')](_0x743e2d)[_0xcff9('0x28')](handleEntityNotFound(_0x9cf846,null))[_0xcff9('0x28')](respondWithResult(_0x9cf846,null))['catch'](handleError(_0x9cf846,null));};exports[_0xcff9('0x4b')]=function(_0x11e54f,_0x5e138d){return db[_0xcff9('0x30')][_0xcff9('0x4b')](_0x11e54f[_0xcff9('0x4c')],{})[_0xcff9('0x28')](respondWithResult(_0x5e138d,0xc9))[_0xcff9('0x45')](handleError(_0x5e138d,null));};exports[_0xcff9('0x27')]=function(_0x36f60b,_0x314107){if(_0x36f60b['body']['id']){delete _0x36f60b[_0xcff9('0x4c')]['id'];}return db[_0xcff9('0x30')][_0xcff9('0x4a')]({'where':{'id':_0x36f60b[_0xcff9('0x47')]['id']}})[_0xcff9('0x28')](handleEntityNotFound(_0x314107,null))[_0xcff9('0x28')](saveUpdates(_0x36f60b[_0xcff9('0x4c')],null))['then'](respondWithResult(_0x314107,null))[_0xcff9('0x45')](handleError(_0x314107,null));};exports[_0xcff9('0x29')]=function(_0x4468c2,_0x9e544c){return db['VoiceDialReport'][_0xcff9('0x4a')]({'where':{'id':_0x4468c2[_0xcff9('0x47')]['id']}})[_0xcff9('0x28')](handleEntityNotFound(_0x9e544c,null))[_0xcff9('0x28')](removeEntity(_0x9e544c,null))['catch'](handleError(_0x9e544c,null));};exports['describe']=function(_0x1c2861,_0x224afd){return db[_0xcff9('0x30')][_0xcff9('0x4d')]()['then'](respondWithResult(_0x224afd,null))[_0xcff9('0x45')](handleError(_0x224afd,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 391ad2b..66c0591 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 _0x6881=['../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid','../../config/logger','api','bluebird','request-promise','path'];(function(_0x394798,_0x14af05){var _0x80638c=function(_0x3321cb){while(--_0x3321cb){_0x394798['push'](_0x394798['shift']());}};_0x80638c(++_0x14af05);}(_0x6881,0x10e));var _0x1688=function(_0x63358a,_0xa611af){_0x63358a=_0x63358a-0x0;var _0x2242a5=_0x6881[_0x63358a];return _0x2242a5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1688('0x0'))(_0x1688('0x1'));var moment=require('moment');var BPromise=require(_0x1688('0x2'));var rp=require(_0x1688('0x3'));var fs=require('fs');var path=require(_0x1688('0x4'));var rimraf=require('rimraf');var config=require(_0x1688('0x5'));var attributes=require('./voiceDialReport.attributes');module[_0x1688('0x6')]=function(_0x4cad07,_0x323ca9){return _0x4cad07[_0x1688('0x7')](_0x1688('0x8'),attributes,{'tableName':_0x1688('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1688('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b67=['moment','bluebird','path','../../config/environment','./voiceDialReport.attributes','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api'];(function(_0x1cc040,_0x40e0d7){var _0x3cd89e=function(_0x523e80){while(--_0x523e80){_0x1cc040['push'](_0x1cc040['shift']());}};_0x3cd89e(++_0x40e0d7);}(_0x2b67,0xf3));var _0x72b6=function(_0x3476b2,_0x47ded3){_0x3476b2=_0x3476b2-0x0;var _0x1611a6=_0x2b67[_0x3476b2];return _0x1611a6;};'use strict';var _=require(_0x72b6('0x0'));var util=require(_0x72b6('0x1'));var logger=require(_0x72b6('0x2'))(_0x72b6('0x3'));var moment=require(_0x72b6('0x4'));var BPromise=require(_0x72b6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x72b6('0x6'));var rimraf=require('rimraf');var config=require(_0x72b6('0x7'));var attributes=require(_0x72b6('0x8'));module['exports']=function(_0x572088,_0x5232be){return _0x572088[_0x72b6('0x9')](_0x72b6('0xa'),attributes,{'tableName':_0x72b6('0xb'),'paranoid':![],'indexes':[{'fields':[_0x72b6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index a0e94e1..6afbfaf 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 _0x43d4=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VoiceDialReport','create','body','options','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','raw','where','attributes','limit','lodash'];(function(_0x25a560,_0x1251ba){var _0x79f289=function(_0x5b99b6){while(--_0x5b99b6){_0x25a560['push'](_0x25a560['shift']());}};_0x79f289(++_0x1251ba);}(_0x43d4,0x11f));var _0x443d=function(_0x76502a,_0x19ac88){_0x76502a=_0x76502a-0x0;var _0x25a79b=_0x43d4[_0x76502a];return _0x25a79b;};'use strict';var _=require(_0x443d('0x0'));var util=require(_0x443d('0x1'));var moment=require(_0x443d('0x2'));var BPromise=require(_0x443d('0x3'));var rs=require(_0x443d('0x4'));var fs=require('fs');var Redis=require(_0x443d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x443d('0x6'));var logger=require(_0x443d('0x7'))(_0x443d('0x8'));var config=require(_0x443d('0x9'));var jayson=require(_0x443d('0xa'));var client=jayson[_0x443d('0xb')][_0x443d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x322b1a,_0x4d13ab,_0x24e18e){return new BPromise(function(_0x152241,_0x3acaf4){return client[_0x443d('0xd')](_0x322b1a,_0x24e18e)[_0x443d('0xe')](function(_0x2747ec){logger[_0x443d('0xf')](_0x443d('0x10'),_0x4d13ab,'request\x20sent');logger['debug'](_0x443d('0x11'),_0x4d13ab,_0x443d('0x12'),JSON[_0x443d('0x13')](_0x2747ec));if(_0x2747ec[_0x443d('0x14')]){if(_0x2747ec[_0x443d('0x14')]['code']===0x1f4){logger[_0x443d('0x14')](_0x443d('0x10'),_0x4d13ab,_0x2747ec['error'][_0x443d('0x15')]);return _0x3acaf4(_0x2747ec[_0x443d('0x14')]['message']);}logger[_0x443d('0x14')](_0x443d('0x10'),_0x4d13ab,_0x2747ec[_0x443d('0x14')]['message']);return _0x152241(_0x2747ec[_0x443d('0x14')][_0x443d('0x15')]);}else{logger[_0x443d('0xf')](_0x443d('0x10'),_0x4d13ab,_0x443d('0x12'));_0x152241(_0x2747ec[_0x443d('0x16')][_0x443d('0x15')]);}})[_0x443d('0x17')](function(_0x35eae5){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x4d13ab,_0x35eae5);_0x3acaf4(_0x35eae5);});});}exports['CreateVoiceDialReport']=function(_0x372bf2){var _0xca03cd=this;return new Promise(function(_0x5a8ef5,_0x4dfe12){return db[_0x443d('0x18')][_0x443d('0x19')](_0x372bf2[_0x443d('0x1a')],{'raw':_0x372bf2['options']?_0x372bf2[_0x443d('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x443d('0xe')](function(_0x33077e){logger[_0x443d('0xf')](_0x443d('0x1c'),_0x372bf2);logger[_0x443d('0x1d')](_0x443d('0x1c'),_0x372bf2,JSON['stringify'](_0x33077e));_0x5a8ef5(_0x33077e);})[_0x443d('0x17')](function(_0x4ce09d){logger[_0x443d('0x14')](_0x443d('0x1c'),_0x4ce09d['message'],_0x372bf2);_0x4dfe12(_0xca03cd['error'](0x1f4,_0x4ce09d[_0x443d('0x15')]));});});};exports[_0x443d('0x1e')]=function(_0x2a1e){var _0x4cb538=this;return new Promise(function(_0x18df43,_0x54ef02){return db[_0x443d('0x18')][_0x443d('0x1f')](_0x2a1e['body'],{'raw':_0x2a1e['options']?_0x2a1e['options'][_0x443d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a1e['options']?_0x2a1e[_0x443d('0x1b')][_0x443d('0x21')]||null:null,'attributes':_0x2a1e[_0x443d('0x1b')]?_0x2a1e[_0x443d('0x1b')][_0x443d('0x22')]||null:null,'limit':_0x2a1e[_0x443d('0x1b')]?_0x2a1e[_0x443d('0x1b')][_0x443d('0x23')]||null:null})[_0x443d('0xe')](function(_0xcbeaea){logger[_0x443d('0xf')]('UpdateVoiceDialReport',_0x2a1e);logger[_0x443d('0x1d')]('UpdateVoiceDialReport',_0x2a1e,JSON['stringify'](_0xcbeaea));_0x18df43(_0xcbeaea);})[_0x443d('0x17')](function(_0x104e35){logger[_0x443d('0x14')](_0x443d('0x1e'),_0x104e35['message'],_0x2a1e);_0x54ef02(_0x4cb538[_0x443d('0x14')](0x1f4,_0x104e35[_0x443d('0x15')]));});});}; \ No newline at end of file +var _0x5f26=['code','message','info','result','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','catch','UpdateVoiceDialReport','update','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x1d5d38,_0x48247a){var _0x173c83=function(_0x2a0d83){while(--_0x2a0d83){_0x1d5d38['push'](_0x1d5d38['shift']());}};_0x173c83(++_0x48247a);}(_0x5f26,0x19c));var _0x65f2=function(_0x4432f2,_0x22697a){_0x4432f2=_0x4432f2-0x0;var _0x1c97d6=_0x5f26[_0x4432f2];return _0x1c97d6;};'use strict';var _=require('lodash');var util=require(_0x65f2('0x0'));var moment=require(_0x65f2('0x1'));var BPromise=require('bluebird');var rs=require(_0x65f2('0x2'));var fs=require('fs');var Redis=require(_0x65f2('0x3'));var db=require(_0x65f2('0x4'))['db'];var utils=require(_0x65f2('0x5'));var logger=require('../../config/logger')(_0x65f2('0x6'));var config=require(_0x65f2('0x7'));var jayson=require(_0x65f2('0x8'));var client=jayson['client'][_0x65f2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15ac31,_0x405388,_0x569ff6){return new BPromise(function(_0x37fefe,_0x19c165){return client[_0x65f2('0xa')](_0x15ac31,_0x569ff6)[_0x65f2('0xb')](function(_0xd5d214){logger['info'](_0x65f2('0xc'),_0x405388,_0x65f2('0xd'));logger[_0x65f2('0xe')](_0x65f2('0xf'),_0x405388,_0x65f2('0xd'),JSON['stringify'](_0xd5d214));if(_0xd5d214['error']){if(_0xd5d214[_0x65f2('0x10')][_0x65f2('0x11')]===0x1f4){logger[_0x65f2('0x10')](_0x65f2('0xc'),_0x405388,_0xd5d214['error'][_0x65f2('0x12')]);return _0x19c165(_0xd5d214[_0x65f2('0x10')][_0x65f2('0x12')]);}logger[_0x65f2('0x10')](_0x65f2('0xc'),_0x405388,_0xd5d214[_0x65f2('0x10')][_0x65f2('0x12')]);return _0x37fefe(_0xd5d214['error'][_0x65f2('0x12')]);}else{logger[_0x65f2('0x13')](_0x65f2('0xc'),_0x405388,_0x65f2('0xd'));_0x37fefe(_0xd5d214[_0x65f2('0x14')][_0x65f2('0x12')]);}})['catch'](function(_0x2dcb9f){logger[_0x65f2('0x10')](_0x65f2('0xc'),_0x405388,_0x2dcb9f);_0x19c165(_0x2dcb9f);});});}exports['CreateVoiceDialReport']=function(_0x378229){var _0x100502=this;return new Promise(function(_0x182496,_0x5d3fda){return db[_0x65f2('0x15')][_0x65f2('0x16')](_0x378229[_0x65f2('0x17')],{'raw':_0x378229[_0x65f2('0x18')]?_0x378229['options'][_0x65f2('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3ce683){logger[_0x65f2('0x13')](_0x65f2('0x1a'),_0x378229);logger['debug'](_0x65f2('0x1a'),_0x378229,JSON['stringify'](_0x3ce683));_0x182496(_0x3ce683);})[_0x65f2('0x1b')](function(_0x5a829d){logger[_0x65f2('0x10')](_0x65f2('0x1a'),_0x5a829d[_0x65f2('0x12')],_0x378229);_0x5d3fda(_0x100502[_0x65f2('0x10')](0x1f4,_0x5a829d['message']));});});};exports[_0x65f2('0x1c')]=function(_0x39b2d5){var _0x12e2da=this;return new Promise(function(_0x2cb92d,_0x1eea03){return db[_0x65f2('0x15')][_0x65f2('0x1d')](_0x39b2d5['body'],{'raw':_0x39b2d5[_0x65f2('0x18')]?_0x39b2d5[_0x65f2('0x18')][_0x65f2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39b2d5[_0x65f2('0x18')]?_0x39b2d5[_0x65f2('0x18')][_0x65f2('0x1e')]||null:null,'attributes':_0x39b2d5[_0x65f2('0x18')]?_0x39b2d5[_0x65f2('0x18')][_0x65f2('0x1f')]||null:null,'limit':_0x39b2d5[_0x65f2('0x18')]?_0x39b2d5[_0x65f2('0x18')][_0x65f2('0x20')]||null:null})[_0x65f2('0xb')](function(_0x338d12){logger[_0x65f2('0x13')](_0x65f2('0x1c'),_0x39b2d5);logger[_0x65f2('0xe')](_0x65f2('0x1c'),_0x39b2d5,JSON['stringify'](_0x338d12));_0x2cb92d(_0x338d12);})[_0x65f2('0x1b')](function(_0x4c41d0){logger['error'](_0x65f2('0x1c'),_0x4c41d0[_0x65f2('0x12')],_0x39b2d5);_0x1eea03(_0x12e2da[_0x65f2('0x10')](0x1f4,_0x4c41d0[_0x65f2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index e266af9..3e02615 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 _0xead9=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','post','/:id/applications','addApplications','put','update'];(function(_0x1e5e4a,_0x2463a9){var _0x2d7dd2=function(_0x543bf2){while(--_0x543bf2){_0x1e5e4a['push'](_0x1e5e4a['shift']());}};_0x2d7dd2(++_0x2463a9);}(_0xead9,0x1a5));var _0x9ead=function(_0xaa2dd6,_0x12016a){_0xaa2dd6=_0xaa2dd6-0x0;var _0x1ee8a5=_0xead9[_0xaa2dd6];return _0x1ee8a5;};'use strict';var multer=require(_0x9ead('0x0'));var util=require(_0x9ead('0x1'));var path=require(_0x9ead('0x2'));var timeout=require(_0x9ead('0x3'));var express=require(_0x9ead('0x4'));var router=express['Router']();var fs_extra=require(_0x9ead('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ead('0x6'));var config=require(_0x9ead('0x7'));var controller=require('./voiceExtension.controller');router['get']('/',auth[_0x9ead('0x8')](),controller['index']);router[_0x9ead('0x9')](_0x9ead('0xa'),auth[_0x9ead('0x8')](),controller['show']);router[_0x9ead('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9ead('0xc'),auth[_0x9ead('0x8')](),controller[_0x9ead('0xd')]);router[_0x9ead('0xe')](_0x9ead('0xa'),auth[_0x9ead('0x8')](),controller[_0x9ead('0xf')]);router[_0x9ead('0x10')]('/:id',auth[_0x9ead('0x8')](),controller[_0x9ead('0x11')]);module[_0x9ead('0x12')]=router; \ No newline at end of file +var _0x5a8b=['/:id','isAuthenticated','show','addApplications','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get'];(function(_0xb8e6fa,_0x5d75c7){var _0x2ac333=function(_0x5ccbb1){while(--_0x5ccbb1){_0xb8e6fa['push'](_0xb8e6fa['shift']());}};_0x2ac333(++_0x5d75c7);}(_0x5a8b,0x1ee));var _0xb5a8=function(_0x49f547,_0x3484f3){_0x49f547=_0x49f547-0x0;var _0xfc9aa4=_0x5a8b[_0x49f547];return _0xfc9aa4;};'use strict';var multer=require(_0xb5a8('0x0'));var util=require('util');var path=require(_0xb5a8('0x1'));var timeout=require(_0xb5a8('0x2'));var express=require(_0xb5a8('0x3'));var router=express[_0xb5a8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb5a8('0x5'));var interaction=require(_0xb5a8('0x6'));var config=require(_0xb5a8('0x7'));var controller=require(_0xb5a8('0x8'));router[_0xb5a8('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb5a8('0x9')](_0xb5a8('0xa'),auth[_0xb5a8('0xb')](),controller[_0xb5a8('0xc')]);router['post']('/',auth[_0xb5a8('0xb')](),controller['create']);router['post']('/:id/applications',auth[_0xb5a8('0xb')](),controller[_0xb5a8('0xd')]);router[_0xb5a8('0xe')](_0xb5a8('0xa'),auth[_0xb5a8('0xb')](),controller[_0xb5a8('0xf')]);router[_0xb5a8('0x10')](_0xb5a8('0xa'),auth['isAuthenticated'](),controller[_0xb5a8('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index dfbfd0b..74e2b18 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 _0x6c7b=['STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6c7b,0x1ec));var _0xb6c7=function(_0x583c72,_0x3aac93){_0x583c72=_0x583c72-0x0;var _0x1fdd0f=_0x6c7b[_0x583c72];return _0x1fdd0f;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'context':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'unique':_0xb6c7('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'defaultValue':_0xb6c7('0x3')},'appdata':{'type':Sequelize[_0xb6c7('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb6c7('0x4')](_0xb6c7('0x5'),_0xb6c7('0x6'),_0xb6c7('0x7'),_0xb6c7('0x8'),_0xb6c7('0x9'),_0xb6c7('0xa'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xb6c7('0x1')]},'interval':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':![],'defaultValue':_0xb6c7('0xb')},'IntervalId':{'type':Sequelize[_0xb6c7('0xc')]},'isApp':{'type':Sequelize[_0xb6c7('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb6c7('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xb6c7('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xb6c7('0xc')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb6c7('0xe')},'answer':{'type':Sequelize[_0xb6c7('0xd')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3e4458){return this[_0xb6c7('0xf')](_0xb6c7('0x10'));}},'alias':{'type':Sequelize[_0xb6c7('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x30d2=['exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','internal','inbound-fax','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue'];(function(_0x5bc69d,_0x25137d){var _0x154d9c=function(_0x10a8b0){while(--_0x10a8b0){_0x5bc69d['push'](_0x5bc69d['shift']());}};_0x154d9c(++_0x25137d);}(_0x30d2,0x122));var _0x230d=function(_0x2040a7,_0x8da657){_0x2040a7=_0x2040a7-0x0;var _0x346357=_0x30d2[_0x2040a7];return _0x346357;};'use strict';var Sequelize=require(_0x230d('0x0'));module[_0x230d('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x230d('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x230d('0x3')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x230d('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x230d('0x3')],'allowNull':![],'defaultValue':_0x230d('0x4')},'appdata':{'type':Sequelize[_0x230d('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x230d('0x5')]('inbound','outbound',_0x230d('0x6'),_0x230d('0x7'),_0x230d('0x8'),_0x230d('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x230d('0x3')],'allowNull':![],'defaultValue':_0x230d('0xa')},'IntervalId':{'type':Sequelize[_0x230d('0xb')]},'isApp':{'type':Sequelize[_0x230d('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x230d('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0x230d('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0x230d('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x230d('0xb')]},'recordingFormat':{'type':Sequelize[_0x230d('0x3')],'defaultValue':_0x230d('0xd')},'answer':{'type':Sequelize[_0x230d('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x230d('0xe')],'get':function(_0x2f0254){return this[_0x230d('0xf')](_0x230d('0x10'));}},'alias':{'type':Sequelize[_0x230d('0x3')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index d47565b..d198d48 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 _0xf98b=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','then','get','InboundRoutes','outbound','internal','ignore','value','type','destroy','error','stack','name','send','map','VoiceExtension','rawAttributes','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','rows','catch','show','length','merge','find','params','create','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','inbound','OutboundRoutes','UserProfileSection','autoAssociation'];(function(_0x816507,_0x310a55){var _0xcffa37=function(_0x20d8c8){while(--_0x20d8c8){_0x816507['push'](_0x816507['shift']());}};_0xcffa37(++_0x310a55);}(_0xf98b,0x6e));var _0xbf98=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xf98b[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xbf98('0x0'));var Redis=require('ioredis');var qs=require(_0xbf98('0x1'));var logger=require('../../config/logger')('api');var config=require(_0xbf98('0x2'));var db=require(_0xbf98('0x3'))['db'];config[_0xbf98('0x4')]=_['defaults'](config['redis'],{'host':_0xbf98('0x5'),'port':0x18eb});var socket=require(_0xbf98('0x6'))(new Redis(config[_0xbf98('0x4')]));require(_0xbf98('0x7'))['register'](socket);function respondWithStatusCode(_0x246537,_0x12fa55){_0x12fa55=_0x12fa55||0xcc;return function(_0x31388a){if(_0x31388a){return _0x246537[_0xbf98('0x8')](_0x12fa55);}return _0x246537[_0xbf98('0x9')](_0x12fa55)[_0xbf98('0xa')]();};}function respondWithResult(_0x244492,_0x98795f){_0x98795f=_0x98795f||0xc8;return function(_0x2e8b77){if(_0x2e8b77){return _0x244492[_0xbf98('0x9')](_0x98795f)[_0xbf98('0xb')](_0x2e8b77);}};}function respondWithFilteredResult(_0x4ebb40,_0x554613){return function(_0x1801a7){if(_0x1801a7){var _0x1a1bba=typeof _0x554613['offset']===_0xbf98('0xc')&&typeof _0x554613[_0xbf98('0xd')]===_0xbf98('0xc');var _0x453349=_0x1801a7[_0xbf98('0xe')];var _0x514d8a=_0x1a1bba?0x0:_0x554613['offset'];var _0x282622=_0x1a1bba?_0x1801a7[_0xbf98('0xe')]:_0x554613[_0xbf98('0xf')]+_0x554613['limit'];var _0x391f14;if(_0x282622>=_0x453349){_0x282622=_0x453349;_0x391f14=0xc8;}else{_0x391f14=0xce;}_0x4ebb40[_0xbf98('0x9')](_0x391f14);return _0x4ebb40['set'](_0xbf98('0x10'),_0x514d8a+'-'+_0x282622+'/'+_0x453349)[_0xbf98('0xb')](_0x1801a7);}return null;};}function removeEntity(_0x44402e){return function(_0x209916){if(_0x209916){return _0x209916['destroy']()[_0xbf98('0x11')](function(){var _0x37074d=_0x209916[_0xbf98('0x12')]({'plain':!![]});var _0x421fb2=[{'name':_0xbf98('0x13'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0xbf98('0x14'),'ignore':![]},{'name':'InternalRoutes','value':_0xbf98('0x15'),'ignore':![]}];var _0x14e396=_(_0x421fb2)['filter'](_0xbf98('0x16'))['map'](_0xbf98('0x17'))['value']();if(_['includes'](_0x14e396,_0x37074d['type'])){return;}var _0x4e3804=_['find'](_0x421fb2,[_0xbf98('0x17'),_0x37074d[_0xbf98('0x18')]])['name'];return db['UserProfileResource'][_0xbf98('0x19')]({'where':{'type':_0x4e3804,'resourceId':_0x37074d['id']}})[_0xbf98('0x11')](function(){return _0x209916;});})[_0xbf98('0x11')](function(){_0x44402e['status'](0xcc)[_0xbf98('0xa')]();});}};}function handleEntityNotFound(_0x11b931){return function(_0x8f7bcb){if(!_0x8f7bcb){_0x11b931[_0xbf98('0x8')](0x194);}return _0x8f7bcb;};}function handleError(_0xc1a79c,_0x3f8431){_0x3f8431=_0x3f8431||0x1f4;return function(_0x25d01d){logger[_0xbf98('0x1a')](_0x25d01d[_0xbf98('0x1b')]);if(_0x25d01d[_0xbf98('0x1c')]){delete _0x25d01d['name'];}_0xc1a79c[_0xbf98('0x9')](_0x3f8431)[_0xbf98('0x1d')](_0x25d01d);};}exports['index']=function(_0xe2703b,_0x24b50d){var _0x53deb0={},_0x4a4c0f={},_0x20fd96={'count':0x0,'rows':[]};var _0x3c8795=_[_0xbf98('0x1e')](db[_0xbf98('0x1f')][_0xbf98('0x20')],function(_0x4fb020){return{'name':_0x4fb020['fieldName'],'type':_0x4fb020[_0xbf98('0x18')]['key']};});_0x4a4c0f[_0xbf98('0x21')]=_[_0xbf98('0x1e')](_0x3c8795,_0xbf98('0x1c'));_0x4a4c0f[_0xbf98('0x22')]=_[_0xbf98('0x23')](_0xe2703b['query']);_0x4a4c0f[_0xbf98('0x24')]=_['intersection'](_0x4a4c0f[_0xbf98('0x21')],_0x4a4c0f[_0xbf98('0x22')]);_0x53deb0['attributes']=_[_0xbf98('0x25')](_0x4a4c0f[_0xbf98('0x21')],qs[_0xbf98('0x26')](_0xe2703b[_0xbf98('0x22')][_0xbf98('0x26')]));_0x53deb0[_0xbf98('0x27')]=_0x53deb0[_0xbf98('0x27')]['length']?_0x53deb0[_0xbf98('0x27')]:_0x4a4c0f[_0xbf98('0x21')];if(!_0xe2703b['query'][_0xbf98('0x28')](_0xbf98('0x29'))){_0x53deb0['limit']=qs[_0xbf98('0xd')](_0xe2703b[_0xbf98('0x22')][_0xbf98('0xd')]);_0x53deb0[_0xbf98('0xf')]=qs[_0xbf98('0xf')](_0xe2703b[_0xbf98('0x22')][_0xbf98('0xf')]);}_0x53deb0[_0xbf98('0x2a')]=qs[_0xbf98('0x2b')](_0xe2703b['query']['sort']);_0x53deb0[_0xbf98('0x2c')]=qs[_0xbf98('0x24')](_['pick'](_0xe2703b[_0xbf98('0x22')],_0x4a4c0f[_0xbf98('0x24')]),_0x3c8795);if(_0xe2703b[_0xbf98('0x22')]['filter']){_0x53deb0[_0xbf98('0x2c')]=_['merge'](_0x53deb0[_0xbf98('0x2c')],{'$or':_[_0xbf98('0x1e')](_0x3c8795,function(_0x1bd616){if(_0x1bd616['type']!=='VIRTUAL'){var _0x30c25c={};_0x30c25c[_0x1bd616[_0xbf98('0x1c')]]={'$like':'%'+_0xe2703b['query'][_0xbf98('0x2d')]+'%'};return _0x30c25c;}})});}_0x53deb0=_['merge']({},_0x53deb0,_0xe2703b[_0xbf98('0x2e')]);var _0x1a9808={'where':_0x53deb0[_0xbf98('0x2c')]};return db['VoiceExtension'][_0xbf98('0xe')](_0x1a9808)[_0xbf98('0x11')](function(_0x61c0fc){_0x20fd96[_0xbf98('0xe')]=_0x61c0fc;if(_0xe2703b[_0xbf98('0x22')][_0xbf98('0x2f')]){_0x53deb0[_0xbf98('0x30')]=[{'all':!![]}];}return db[_0xbf98('0x1f')][_0xbf98('0x31')](_0x53deb0);})['then'](function(_0x219a0f){_0x20fd96[_0xbf98('0x32')]=_0x219a0f;return _0x20fd96;})[_0xbf98('0x11')](respondWithFilteredResult(_0x24b50d,_0x53deb0))[_0xbf98('0x33')](handleError(_0x24b50d,null));};exports[_0xbf98('0x34')]=function(_0x2eb3e7,_0x4fcda3){var _0x198c90={'raw':![],'where':{'id':_0x2eb3e7['params']['id']}},_0x5025e5={};_0x5025e5[_0xbf98('0x21')]=_[_0xbf98('0x23')](db['VoiceExtension'][_0xbf98('0x20')]);_0x5025e5[_0xbf98('0x22')]=_[_0xbf98('0x23')](_0x2eb3e7[_0xbf98('0x22')]);_0x5025e5['filters']=_[_0xbf98('0x25')](_0x5025e5[_0xbf98('0x21')],_0x5025e5[_0xbf98('0x22')]);_0x198c90[_0xbf98('0x27')]=_[_0xbf98('0x25')](_0x5025e5[_0xbf98('0x21')],qs[_0xbf98('0x26')](_0x2eb3e7[_0xbf98('0x22')][_0xbf98('0x26')]));_0x198c90[_0xbf98('0x27')]=_0x198c90['attributes'][_0xbf98('0x35')]?_0x198c90['attributes']:_0x5025e5['model'];if(_0x2eb3e7[_0xbf98('0x22')][_0xbf98('0x2f')]){_0x198c90[_0xbf98('0x30')]=[{'all':!![]}];}_0x198c90=_[_0xbf98('0x36')]({},_0x198c90,_0x2eb3e7[_0xbf98('0x2e')]);return db[_0xbf98('0x1f')][_0xbf98('0x37')](_0x198c90)[_0xbf98('0x11')](handleEntityNotFound(_0x4fcda3,null))[_0xbf98('0x11')](respondWithResult(_0x4fcda3,null))['catch'](handleError(_0x4fcda3,null));};exports[_0xbf98('0x19')]=function(_0x203d92,_0x32206f){return db[_0xbf98('0x1f')]['find']({'where':{'id':_0x203d92[_0xbf98('0x38')]['id']}})['then'](handleEntityNotFound(_0x32206f,null))[_0xbf98('0x11')](removeEntity(_0x32206f,null))[_0xbf98('0x33')](handleError(_0x32206f,null));};exports[_0xbf98('0x39')]=function(_0x4b036a,_0x55b7f2){if(_0x4b036a[_0xbf98('0x3a')][_0xbf98('0x18')]===_0xbf98('0x14')&&!_['startsWith'](_0x4b036a[_0xbf98('0x3a')]['exten'],'_')){_0x4b036a[_0xbf98('0x3a')]['exten']='_'['concat'](_0x4b036a[_0xbf98('0x3a')][_0xbf98('0x3b')]);}return db[_0xbf98('0x1f')][_0xbf98('0x39')](_0x4b036a['body'],{'raw':![]})[_0xbf98('0x11')](function(_0x4d0a36){var _0x4469de=_0x4b036a[_0xbf98('0x3c')]['get']({'plain':!![]});if(!_0x4469de)throw new Error(_0xbf98('0x3d'));if(_0x4469de['role']===_0xbf98('0x3c')){var _0x1c84bb=_0x4d0a36['get']({'plain':!![]});var _0x4ffa08=[{'name':_0xbf98('0x13'),'value':_0xbf98('0x3e')},{'name':_0xbf98('0x3f'),'value':_0xbf98('0x14')},{'name':'InternalRoutes','value':'internal'}];var _0x14a877=_[_0xbf98('0x37')](_0x4ffa08,[_0xbf98('0x17'),_0x1c84bb['type']])[_0xbf98('0x1c')];return db[_0xbf98('0x40')][_0xbf98('0x37')]({'where':{'name':_0x14a877,'userProfileId':_0x4469de['userProfileId']},'raw':!![]})[_0xbf98('0x11')](function(_0x20bf55){if(_0x20bf55&&_0x20bf55[_0xbf98('0x41')]===0x0){return db[_0xbf98('0x42')]['create']({'name':_0x1c84bb[_0xbf98('0x1c')],'resourceId':_0x1c84bb['id'],'type':_0x20bf55['name'],'sectionId':_0x20bf55['id']},{})['then'](function(){return _0x4d0a36;});}else{return _0x4d0a36;}})['catch'](function(_0x5e1b42){logger['error'](_0xbf98('0x43'),_0x5e1b42);throw _0x5e1b42;});}return _0x4d0a36;})[_0xbf98('0x11')](respondWithResult(_0x55b7f2,0xc9))[_0xbf98('0x33')](handleError(_0x55b7f2,null));};exports[_0xbf98('0x44')]=function(_0x53b288,_0x36934b){if(_0x53b288[_0xbf98('0x3a')]['id']){delete _0x53b288[_0xbf98('0x3a')]['id'];}return db['VoiceExtension'][_0xbf98('0x37')]({'where':{'id':_0x53b288[_0xbf98('0x38')]['id']}})[_0xbf98('0x11')](handleEntityNotFound(_0x36934b,null))[_0xbf98('0x11')](function(_0x5eb42c){if(_0x5eb42c){return db['VoiceExtension']['update'](_[_0xbf98('0x45')](_0x53b288[_0xbf98('0x3a')],[_0xbf98('0x3b'),'context',_0xbf98('0x46'),_0xbf98('0x47'),_0xbf98('0x48'),_0xbf98('0x49'),_0xbf98('0x4a')]),{'where':{'context':_0x5eb42c[_0xbf98('0x4b')],'exten':_0x5eb42c['exten']},'individualHooks':!![]})[_0xbf98('0x11')](function(_0x5e2c78){return _0x5e2c78;});}return null;})['then'](respondWithStatusCode(_0x36934b,null))[_0xbf98('0x33')](handleError(_0x36934b,null));};exports['addApplications']=function(_0x26cf83,_0x2febec){var _0x4a9fc2=_0x26cf83[_0xbf98('0x38')]['id'];var _0x3b2987=_0x26cf83['body'];var _0x3809ac=0xc8;var _0x436783=null;return db[_0xbf98('0x4c')][_0xbf98('0x4d')]({'isolationLevel':db[_0xbf98('0x4c')][_0xbf98('0x4e')][_0xbf98('0x4f')][_0xbf98('0x50')]},function(_0xe7f07){return db['VoiceExtension'][_0xbf98('0x51')]({'where':{'id':_0x4a9fc2},'transaction':_0xe7f07})[_0xbf98('0x11')](function(_0x649001){if(_0x649001){return db[_0xbf98('0x1f')][_0xbf98('0x19')]({'where':{'VoiceExtensionId':_0x4a9fc2},'transaction':_0xe7f07})[_0xbf98('0x11')](function(){var _0x7cc210=_[_0xbf98('0x1e')](_0x3b2987,function(_0x333d06){_0x333d06[_0xbf98('0x52')]=_0x4a9fc2;_0x333d06[_0xbf98('0x53')]=!![];return _0x333d06;});return _0x649001[_0xbf98('0x54')](_0x7cc210);})[_0xbf98('0x11')](function(_0x398235){return db[_0xbf98('0x1f')][_0xbf98('0x55')](_0x398235,{'transaction':_0xe7f07});});}else{_0x3809ac=0x194;_0x436783=[];}});})[_0xbf98('0x11')](function(){if(_0x3809ac!==0x194){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4a9fc2},'order':_0xbf98('0x56')})['then'](function(_0x4a66e7){_0x436783=_0x4a66e7;});}})[_0xbf98('0x33')](function(_0x36ee31){_0x3809ac=0x1f4;logger[_0xbf98('0x1a')](_0x36ee31[_0xbf98('0x1b')]);if(_0x36ee31[_0xbf98('0x1c')]){delete _0x36ee31[_0xbf98('0x1c')];}_0x436783=_0x36ee31;})[_0xbf98('0x57')](function(){if(_0x436783===null){_0x2febec['sendStatus'](_0x3809ac);}else{if(_0x3809ac===0x1f4){_0x2febec[_0xbf98('0x9')](_0x3809ac)['send'](_0x436783);}else{_0x2febec['status'](_0x3809ac)[_0xbf98('0xb')](_0x436783);}}});}; \ No newline at end of file +var _0x87a1=['model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','create','startsWith','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','UserProfileSection','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','READ_COMMITTED','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','fieldName','key'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x87a1,0x150));var _0x187a=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x87a1[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x187a('0x0'));var Redis=require(_0x187a('0x1'));var qs=require(_0x187a('0x2'));var logger=require(_0x187a('0x3'))(_0x187a('0x4'));var config=require(_0x187a('0x5'));var db=require(_0x187a('0x6'))['db'];config[_0x187a('0x7')]=_[_0x187a('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x187a('0x9'))(new Redis(config[_0x187a('0x7')]));require(_0x187a('0xa'))[_0x187a('0xb')](socket);function respondWithStatusCode(_0xa98d3b,_0x1d6d00){_0x1d6d00=_0x1d6d00||0xcc;return function(_0x3ee69){if(_0x3ee69){return _0xa98d3b[_0x187a('0xc')](_0x1d6d00);}return _0xa98d3b[_0x187a('0xd')](_0x1d6d00)[_0x187a('0xe')]();};}function respondWithResult(_0x35bb39,_0xfb68e6){_0xfb68e6=_0xfb68e6||0xc8;return function(_0x141e1c){if(_0x141e1c){return _0x35bb39['status'](_0xfb68e6)[_0x187a('0xf')](_0x141e1c);}};}function respondWithFilteredResult(_0x2e3f87,_0x90ed80){return function(_0x32af4d){if(_0x32af4d){var _0x5ca392=typeof _0x90ed80[_0x187a('0x10')]===_0x187a('0x11')&&typeof _0x90ed80['limit']==='undefined';var _0x324d36=_0x32af4d[_0x187a('0x12')];var _0x3e38ba=_0x5ca392?0x0:_0x90ed80[_0x187a('0x10')];var _0x59ddb8=_0x5ca392?_0x32af4d[_0x187a('0x12')]:_0x90ed80[_0x187a('0x10')]+_0x90ed80[_0x187a('0x13')];var _0x4f9a8d;if(_0x59ddb8>=_0x324d36){_0x59ddb8=_0x324d36;_0x4f9a8d=0xc8;}else{_0x4f9a8d=0xce;}_0x2e3f87[_0x187a('0xd')](_0x4f9a8d);return _0x2e3f87['set'](_0x187a('0x14'),_0x3e38ba+'-'+_0x59ddb8+'/'+_0x324d36)['json'](_0x32af4d);}return null;};}function removeEntity(_0x202ce3){return function(_0x50b706){if(_0x50b706){return _0x50b706[_0x187a('0x15')]()[_0x187a('0x16')](function(){var _0x129146=_0x50b706[_0x187a('0x17')]({'plain':!![]});var _0x2e88f1=[{'name':_0x187a('0x18'),'value':_0x187a('0x19'),'ignore':![]},{'name':_0x187a('0x1a'),'value':_0x187a('0x1b'),'ignore':![]},{'name':_0x187a('0x1c'),'value':'internal','ignore':![]}];var _0x4d2326=_(_0x2e88f1)['filter'](_0x187a('0x1d'))[_0x187a('0x1e')](_0x187a('0x1f'))[_0x187a('0x1f')]();if(_[_0x187a('0x20')](_0x4d2326,_0x129146[_0x187a('0x21')])){return;}var _0x92363c=_[_0x187a('0x22')](_0x2e88f1,[_0x187a('0x1f'),_0x129146['type']])[_0x187a('0x23')];return db[_0x187a('0x24')][_0x187a('0x15')]({'where':{'type':_0x92363c,'resourceId':_0x129146['id']}})[_0x187a('0x16')](function(){return _0x50b706;});})[_0x187a('0x16')](function(){_0x202ce3['status'](0xcc)[_0x187a('0xe')]();});}};}function handleEntityNotFound(_0x11e71a){return function(_0xb51076){if(!_0xb51076){_0x11e71a['sendStatus'](0x194);}return _0xb51076;};}function handleError(_0x301866,_0x562183){_0x562183=_0x562183||0x1f4;return function(_0x1ccf38){logger[_0x187a('0x25')](_0x1ccf38[_0x187a('0x26')]);if(_0x1ccf38['name']){delete _0x1ccf38[_0x187a('0x23')];}_0x301866['status'](_0x562183)[_0x187a('0x27')](_0x1ccf38);};}exports[_0x187a('0x28')]=function(_0x5d82e2,_0x11fde5){var _0x10b252={},_0x328100={},_0x3d79f3={'count':0x0,'rows':[]};var _0x47cd2c=_[_0x187a('0x1e')](db[_0x187a('0x29')]['rawAttributes'],function(_0x59af44){return{'name':_0x59af44[_0x187a('0x2a')],'type':_0x59af44[_0x187a('0x21')][_0x187a('0x2b')]};});_0x328100[_0x187a('0x2c')]=_[_0x187a('0x1e')](_0x47cd2c,_0x187a('0x23'));_0x328100['query']=_[_0x187a('0x2d')](_0x5d82e2[_0x187a('0x2e')]);_0x328100[_0x187a('0x2f')]=_['intersection'](_0x328100[_0x187a('0x2c')],_0x328100[_0x187a('0x2e')]);_0x10b252[_0x187a('0x30')]=_[_0x187a('0x31')](_0x328100[_0x187a('0x2c')],qs['fields'](_0x5d82e2[_0x187a('0x2e')][_0x187a('0x32')]));_0x10b252[_0x187a('0x30')]=_0x10b252[_0x187a('0x30')][_0x187a('0x33')]?_0x10b252[_0x187a('0x30')]:_0x328100['model'];if(!_0x5d82e2[_0x187a('0x2e')][_0x187a('0x34')](_0x187a('0x35'))){_0x10b252['limit']=qs[_0x187a('0x13')](_0x5d82e2['query'][_0x187a('0x13')]);_0x10b252[_0x187a('0x10')]=qs[_0x187a('0x10')](_0x5d82e2[_0x187a('0x2e')][_0x187a('0x10')]);}_0x10b252[_0x187a('0x36')]=qs[_0x187a('0x37')](_0x5d82e2['query']['sort']);_0x10b252['where']=qs[_0x187a('0x2f')](_[_0x187a('0x38')](_0x5d82e2[_0x187a('0x2e')],_0x328100[_0x187a('0x2f')]),_0x47cd2c);if(_0x5d82e2[_0x187a('0x2e')]['filter']){_0x10b252[_0x187a('0x39')]=_[_0x187a('0x3a')](_0x10b252[_0x187a('0x39')],{'$or':_[_0x187a('0x1e')](_0x47cd2c,function(_0x5474d9){if(_0x5474d9[_0x187a('0x21')]!==_0x187a('0x3b')){var _0x10551c={};_0x10551c[_0x5474d9[_0x187a('0x23')]]={'$like':'%'+_0x5d82e2[_0x187a('0x2e')][_0x187a('0x3c')]+'%'};return _0x10551c;}})});}_0x10b252=_[_0x187a('0x3a')]({},_0x10b252,_0x5d82e2[_0x187a('0x3d')]);var _0xe5a7d6={'where':_0x10b252[_0x187a('0x39')]};return db[_0x187a('0x29')]['count'](_0xe5a7d6)['then'](function(_0x43856d){_0x3d79f3[_0x187a('0x12')]=_0x43856d;if(_0x5d82e2[_0x187a('0x2e')][_0x187a('0x3e')]){_0x10b252['include']=[{'all':!![]}];}return db[_0x187a('0x29')][_0x187a('0x3f')](_0x10b252);})[_0x187a('0x16')](function(_0x39279a){_0x3d79f3[_0x187a('0x40')]=_0x39279a;return _0x3d79f3;})[_0x187a('0x16')](respondWithFilteredResult(_0x11fde5,_0x10b252))[_0x187a('0x41')](handleError(_0x11fde5,null));};exports[_0x187a('0x42')]=function(_0x21a4c3,_0x345ee0){var _0x33ac34={'raw':![],'where':{'id':_0x21a4c3[_0x187a('0x43')]['id']}},_0x5396df={};_0x5396df[_0x187a('0x2c')]=_['keys'](db[_0x187a('0x29')][_0x187a('0x44')]);_0x5396df[_0x187a('0x2e')]=_[_0x187a('0x2d')](_0x21a4c3['query']);_0x5396df[_0x187a('0x2f')]=_[_0x187a('0x31')](_0x5396df[_0x187a('0x2c')],_0x5396df['query']);_0x33ac34['attributes']=_[_0x187a('0x31')](_0x5396df['model'],qs[_0x187a('0x32')](_0x21a4c3[_0x187a('0x2e')][_0x187a('0x32')]));_0x33ac34[_0x187a('0x30')]=_0x33ac34[_0x187a('0x30')][_0x187a('0x33')]?_0x33ac34['attributes']:_0x5396df[_0x187a('0x2c')];if(_0x21a4c3[_0x187a('0x2e')]['includeAll']){_0x33ac34['include']=[{'all':!![]}];}_0x33ac34=_['merge']({},_0x33ac34,_0x21a4c3[_0x187a('0x3d')]);return db[_0x187a('0x29')][_0x187a('0x22')](_0x33ac34)['then'](handleEntityNotFound(_0x345ee0,null))[_0x187a('0x16')](respondWithResult(_0x345ee0,null))[_0x187a('0x41')](handleError(_0x345ee0,null));};exports[_0x187a('0x15')]=function(_0x3328b3,_0x9415a8){return db[_0x187a('0x29')][_0x187a('0x22')]({'where':{'id':_0x3328b3[_0x187a('0x43')]['id']}})[_0x187a('0x16')](handleEntityNotFound(_0x9415a8,null))[_0x187a('0x16')](removeEntity(_0x9415a8,null))['catch'](handleError(_0x9415a8,null));};exports[_0x187a('0x45')]=function(_0x7dd45c,_0x2196c8){if(_0x7dd45c['body']['type']==='outbound'&&!_[_0x187a('0x46')](_0x7dd45c[_0x187a('0x47')][_0x187a('0x48')],'_')){_0x7dd45c['body'][_0x187a('0x48')]='_'['concat'](_0x7dd45c['body']['exten']);}return db['VoiceExtension'][_0x187a('0x45')](_0x7dd45c['body'],{'raw':![]})[_0x187a('0x16')](function(_0x4d5089){var _0x26fb1d=_0x7dd45c[_0x187a('0x49')]['get']({'plain':!![]});if(!_0x26fb1d)throw new Error(_0x187a('0x4a'));if(_0x26fb1d[_0x187a('0x4b')]===_0x187a('0x49')){var _0x3f8593=_0x4d5089['get']({'plain':!![]});var _0x33f619=[{'name':'InboundRoutes','value':_0x187a('0x19')},{'name':_0x187a('0x1a'),'value':'outbound'},{'name':'InternalRoutes','value':_0x187a('0x4c')}];var _0x2b86f2=_['find'](_0x33f619,[_0x187a('0x1f'),_0x3f8593['type']])['name'];return db[_0x187a('0x4d')][_0x187a('0x22')]({'where':{'name':_0x2b86f2,'userProfileId':_0x26fb1d['userProfileId']},'raw':!![]})['then'](function(_0x1e079d){if(_0x1e079d&&_0x1e079d['autoAssociation']===0x0){return db[_0x187a('0x24')][_0x187a('0x45')]({'name':_0x3f8593[_0x187a('0x23')],'resourceId':_0x3f8593['id'],'type':_0x1e079d[_0x187a('0x23')],'sectionId':_0x1e079d['id']},{})[_0x187a('0x16')](function(){return _0x4d5089;});}else{return _0x4d5089;}})[_0x187a('0x41')](function(_0x19534a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19534a);throw _0x19534a;});}return _0x4d5089;})[_0x187a('0x16')](respondWithResult(_0x2196c8,0xc9))[_0x187a('0x41')](handleError(_0x2196c8,null));};exports['update']=function(_0x56ecde,_0x38d3d5){if(_0x56ecde[_0x187a('0x47')]['id']){delete _0x56ecde[_0x187a('0x47')]['id'];}return db[_0x187a('0x29')][_0x187a('0x22')]({'where':{'id':_0x56ecde['params']['id']}})[_0x187a('0x16')](handleEntityNotFound(_0x38d3d5,null))[_0x187a('0x16')](function(_0x4b235d){if(_0x4b235d){return db[_0x187a('0x29')][_0x187a('0x4e')](_[_0x187a('0x38')](_0x56ecde['body'],[_0x187a('0x48'),_0x187a('0x4f'),_0x187a('0x50'),_0x187a('0x51'),_0x187a('0x52'),_0x187a('0x53'),_0x187a('0x54')]),{'where':{'context':_0x4b235d[_0x187a('0x4f')],'exten':_0x4b235d[_0x187a('0x48')]},'individualHooks':!![]})[_0x187a('0x16')](function(_0x32488c){return _0x32488c;});}return null;})[_0x187a('0x16')](respondWithStatusCode(_0x38d3d5,null))['catch'](handleError(_0x38d3d5,null));};exports[_0x187a('0x55')]=function(_0x96fa76,_0x5e83dd){var _0x5d80d8=_0x96fa76[_0x187a('0x43')]['id'];var _0x4db137=_0x96fa76[_0x187a('0x47')];var _0xf6ccdb=0xc8;var _0x59df2c=null;return db[_0x187a('0x56')][_0x187a('0x57')]({'isolationLevel':db[_0x187a('0x56')]['Transaction']['ISOLATION_LEVELS'][_0x187a('0x58')]},function(_0x459e75){return db[_0x187a('0x29')]['findOne']({'where':{'id':_0x5d80d8},'transaction':_0x459e75})['then'](function(_0x1ceb11){if(_0x1ceb11){return db[_0x187a('0x29')][_0x187a('0x15')]({'where':{'VoiceExtensionId':_0x5d80d8},'transaction':_0x459e75})[_0x187a('0x16')](function(){var _0x39b002=_[_0x187a('0x1e')](_0x4db137,function(_0x506096){_0x506096[_0x187a('0x59')]=_0x5d80d8;_0x506096[_0x187a('0x5a')]=!![];return _0x506096;});return _0x1ceb11[_0x187a('0x5b')](_0x39b002);})['then'](function(_0x1fd861){return db[_0x187a('0x29')][_0x187a('0x5c')](_0x1fd861,{'transaction':_0x459e75});});}else{_0xf6ccdb=0x194;_0x59df2c=[];}});})['then'](function(){if(_0xf6ccdb!==0x194){return db[_0x187a('0x29')][_0x187a('0x5d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5d80d8},'order':_0x187a('0x5e')})[_0x187a('0x16')](function(_0x12bd6e){_0x59df2c=_0x12bd6e;});}})[_0x187a('0x41')](function(_0x3b41e7){_0xf6ccdb=0x1f4;logger[_0x187a('0x25')](_0x3b41e7[_0x187a('0x26')]);if(_0x3b41e7['name']){delete _0x3b41e7['name'];}_0x59df2c=_0x3b41e7;})['finally'](function(){if(_0x59df2c===null){_0x5e83dd['sendStatus'](_0xf6ccdb);}else{if(_0xf6ccdb===0x1f4){_0x5e83dd['status'](_0xf6ccdb)[_0x187a('0x27')](_0x59df2c);}else{_0x5e83dd[_0x187a('0xd')](_0xf6ccdb)['json'](_0x59df2c);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d7de94c..46e5d9e 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 _0xef57=['../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x4fcd21,_0x3b4148){var _0x3af7b8=function(_0x4a0f72){while(--_0x4a0f72){_0x4fcd21['push'](_0x4fcd21['shift']());}};_0x3af7b8(++_0x3b4148);}(_0xef57,0x143));var _0x7ef5=function(_0x21985e,_0x2e090f){_0x21985e=_0x21985e-0x0;var _0x448ede=_0xef57[_0x21985e];return _0x448ede;};'use strict';var EventEmitter=require(_0x7ef5('0x0'));var VoiceExtension=require(_0x7ef5('0x1'))['db'][_0x7ef5('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x7ef5('0x3')](0x0);var events={'afterCreate':_0x7ef5('0x4'),'afterUpdate':'update','afterDestroy':_0x7ef5('0x5')};function emitEvent(_0x357b6c){return function(_0x2f8648,_0x184f2d,_0x1f53d2){VoiceExtensionEvents[_0x7ef5('0x6')](_0x357b6c+':'+_0x2f8648['id'],_0x2f8648);VoiceExtensionEvents['emit'](_0x357b6c,_0x2f8648);_0x1f53d2(null);};}for(var e in events){if(events[_0x7ef5('0x7')](e)){var event=events[e];VoiceExtension[_0x7ef5('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x7311=['../../mysqldb','VoiceExtension','update','remove','emit','hook','exports'];(function(_0x452968,_0x31e391){var _0xb6f9ae=function(_0x263987){while(--_0x263987){_0x452968['push'](_0x452968['shift']());}};_0xb6f9ae(++_0x31e391);}(_0x7311,0xb6));var _0x1731=function(_0x16f0e8,_0x25b381){_0x16f0e8=_0x16f0e8-0x0;var _0x418a8f=_0x7311[_0x16f0e8];return _0x418a8f;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x1731('0x0'))['db'][_0x1731('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1731('0x2'),'afterDestroy':_0x1731('0x3')};function emitEvent(_0x56de32){return function(_0x549fa1,_0x21bd8d,_0x1f5d4d){VoiceExtensionEvents[_0x1731('0x4')](_0x56de32+':'+_0x549fa1['id'],_0x549fa1);VoiceExtensionEvents['emit'](_0x56de32,_0x549fa1);_0x1f5d4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x1731('0x5')](e,emitEvent(event));}}module[_0x1731('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f1ea76c..b1b4e79 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 _0x5977=['$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','split','length','name','param','prefix','phone','${EXTEN}','SIP','join','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','answer','queue','playback','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','ExecIf'];(function(_0x2cd5d7,_0x4662a9){var _0x3ab7f0=function(_0x5c220b){while(--_0x5c220b){_0x2cd5d7['push'](_0x2cd5d7['shift']());}};_0x3ab7f0(++_0x4662a9);}(_0x5977,0xe1));var _0x7597=function(_0x135156,_0x5dbd78){_0x135156=_0x135156-0x0;var _0x20df4e=_0x5977[_0x135156];return _0x20df4e;};'use strict';var _=require(_0x7597('0x0'));var attributes=require(_0x7597('0x1'));module[_0x7597('0x2')]=function(_0xd2e8e4){var _0x5f0d35=_0xd2e8e4[_0x7597('0x3')];function _0x1970b0(_0x38374f){var _0x536908=0x2;var _0x402e4d=[{'type':_0x38374f[_0x7597('0x4')],'app':_0x7597('0x5'),'appdata':_0x7597('0x6')+_0x38374f[_0x7597('0x4')],'context':_0x38374f[_0x7597('0x7')],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']},{'type':_0x38374f[_0x7597('0x4')],'app':_0x38374f[_0x7597('0x9')]?_0x7597('0x5'):_0x7597('0xa'),'appdata':_0x38374f['alias']?_0x7597('0xb')+_0x38374f[_0x7597('0x9')]:_0x7597('0xc'),'context':_0x38374f[_0x7597('0x7')],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']}];if(_0x38374f[_0x7597('0x4')]===_0x7597('0xd')){_0x402e4d[_0x7597('0xe')]({'type':_0x7597('0xd'),'app':_0x7597('0x5'),'appdata':_0x7597('0xf')+_0x38374f['id'],'context':_0x38374f['context'],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']});}_0x402e4d[_0x7597('0xe')]({'type':_0x38374f[_0x7597('0x4')],'app':_0x7597('0x5'),'appdata':_0x7597('0x10'),'context':_0x38374f['context'],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']},{'type':_0x38374f[_0x7597('0x4')],'app':'Set','appdata':_0x7597('0x11'),'context':_0x38374f[_0x7597('0x7')],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']},{'type':_0x38374f[_0x7597('0x4')],'app':_0x7597('0x5'),'appdata':_0x7597('0x12'),'context':_0x38374f[_0x7597('0x7')],'exten':_0x38374f[_0x7597('0x8')],'priority':_0x536908++,'VoiceExtensionId':_0x38374f['id']});return _0x402e4d;}function _0x5948b8(_0x55b28b){var _0x24be0d=0x2;var _0x5e2857=[{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0x14'),'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':'outbound','app':_0x55b28b[_0x7597('0x9')]?_0x7597('0x5'):_0x7597('0xa'),'appdata':_0x55b28b['alias']?_0x7597('0xb')+_0x55b28b[_0x7597('0x9')]:_0x7597('0xc'),'context':_0x55b28b['context'],'exten':_0x55b28b['exten'],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':'CDR(destination)='+(_0x55b28b[_0x7597('0x15')]?_0x7597('0x16')+_0x55b28b['cutdigits']+'}':'${EXTEN}'),'context':_0x55b28b['context'],'exten':_0x55b28b['exten'],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0xf')+_0x55b28b['id'],'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x17'),'appdata':_0x7597('0x18')+(_0x24be0d+0x2)+_0x7597('0x19')+(_0x24be0d+0x1)+')','context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b['exten'],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x55b28b[_0x7597('0x15')]?_0x7597('0x1a')+_0x55b28b[_0x7597('0x15')]+'}':_0x7597('0x1b'),'context':_0x55b28b['context'],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':'Set','appdata':_0x7597('0x10'),'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':'Set','appdata':_0x7597('0x12'),'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b['exten'],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0x1c')+_0x55b28b['id'],'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']}];if(_0x55b28b[_0x7597('0x1d')]('recordingFormat')&&_0x55b28b[_0x7597('0x1e')]!==_0x7597('0x1f')){_0x5e2857[_0x7597('0xe')]({'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0x20'),'context':_0x55b28b['context'],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']},{'type':_0x7597('0x13'),'app':_0x7597('0x5'),'appdata':_0x7597('0x21')+_0x55b28b[_0x7597('0x1e')]||_0x7597('0x22'),'context':_0x55b28b[_0x7597('0x7')],'exten':_0x55b28b[_0x7597('0x8')],'priority':_0x24be0d++,'VoiceExtensionId':_0x55b28b['id']});}return _0x5e2857;}function _0x15c18c(_0x30ea7c,_0x1603b4){var _0x5cc5c6=[{'name':_0x7597('0x23'),'param':0x0},{'name':_0x7597('0x24'),'param':0x1},{'name':_0x7597('0x25'),'param':0x2},{'name':'url','param':0x3}];var _0x462e56={};var _0x5f2c62=_0x1603b4[_0x7597('0x26')](',');var _0xceba73=[];for(var _0x5bc5de=0x0;_0x5bc5de<_0x5cc5c6[_0x7597('0x27')];_0x5bc5de++){switch(_0x5cc5c6[_0x5bc5de][_0x7597('0x28')]){case _0x7597('0x23'):_0x462e56[_0x7597('0x23')]=_0x5f2c62[_0x5cc5c6[_0x5bc5de]['param']][_0x7597('0x26')]('/')[0x1];_0x462e56['phone']=_0x5f2c62[_0x5cc5c6[_0x5bc5de][_0x7597('0x29')]]['split']('/')[0x2];_0x462e56[_0x7597('0x2a')]=_0x462e56[_0x7597('0x2b')]?_0x462e56[_0x7597('0x2b')][_0x7597('0x26')]('$')[0x0]:undefined;_0x462e56[_0x7597('0x2b')]=_0x30ea7c[_0x7597('0x15')]?(_0x462e56[_0x7597('0x2a')]||'')+'${EXTEN:'+_0x30ea7c[_0x7597('0x15')]+'}':(_0x462e56['prefix']||'')+_0x7597('0x2c');_0xceba73[_0x5cc5c6[_0x5bc5de][_0x7597('0x29')]]=[_0x7597('0x2d'),_0x462e56[_0x7597('0x23')],_0x462e56[_0x7597('0x2b')]][_0x7597('0x2e')]('/');break;case _0x7597('0x25'):_0x462e56[_0x7597('0x25')]=_0x5f2c62[_0x5cc5c6[_0x5bc5de][_0x7597('0x29')]];if(_0x30ea7c[_0x7597('0x1e')]!==_0x7597('0x1f')){if(_0x462e56['options']['indexOf'](_0x7597('0x2f'))<0x0){_0x462e56[_0x7597('0x25')]+=_0x7597('0x2f');}}else{_0x462e56[_0x7597('0x25')]=_0x462e56[_0x7597('0x25')][_0x7597('0x30')](_0x7597('0x2f'),'');}_0xceba73[_0x5cc5c6[_0x5bc5de]['param']]=_0x462e56[_0x7597('0x25')];break;default:_0xceba73[_0x5cc5c6[_0x5bc5de][_0x7597('0x29')]]=_0x5f2c62[_0x5cc5c6[_0x5bc5de]['param']];}}return _0xceba73['join'](',');}function _0x1ec74e(_0x31be6f,_0x2b2828,_0x1cb806){return new Promise(function(_0x5a99c7,_0x4f48ac){var _0x5f2fe4=[];if(_[_0x7597('0x31')](_0x2b2828))return _0x5a99c7(_0x5f2fe4);_0x5f0d35[_0x7597('0x32')][_0x7597('0x33')]({'attributes':['id',_0x7597('0x34'),_0x7597('0x35')],'raw':!![]})[_0x7597('0x36')](function(_0x57e48c){for(var _0x3ab9e8=0x0,_0x309c9f=0x0;_0x3ab9e8<_0x2b2828[_0x7597('0x27')];_0x3ab9e8++,_0x309c9f=0x0){var _0x428201=_0x2b2828[_0x3ab9e8];var _0x58c29a=[];var _0x1e40ff=[];delete _0x428201['id'];if(_0x428201['interval']!==_0x7597('0x37')){_0x428201['intervals']=[_0x428201['interval']];}else{_0x428201[_0x7597('0x38')]=_0x428201[_0x7597('0x35')]?_[_0x7597('0x39')](_[_0x7597('0x3a')](_0x57e48c,{'IntervalId':_0x428201['IntervalId']}),'interval'):[];}_0x428201['context']=_0x31be6f[_0x7597('0x7')];_0x428201[_0x7597('0x8')]=_0x31be6f[_0x7597('0x8')];if(_0x428201['type'])_0x428201[_0x7597('0x4')]=_0x428201['type']['toLowerCase']();if(_0x31be6f[_0x7597('0x4')]==='outbound'){if(_0x428201[_0x7597('0x1d')](_0x7597('0x3b'))&&_0x428201[_0x7597('0x3b')]&&_0x428201['tag']!=='--'){_0x58c29a[_0x7597('0xe')]({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':_0x7597('0x5'),'appdata':_0x7597('0x3d')+_0x428201[_0x7597('0x3b')],'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f[_0x7597('0x8')],'priority':_0x428201['intervals']['length']+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});}_0x58c29a[_0x7597('0xe')]({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':'ExecIf','appdata':_0x7597('0x3e')+(_0x428201[_0x7597('0x3f')]?'Set(CALLERID(all)='+_0x428201[_0x7597('0x3f')]+')':'NoOp(No\x20number\x20available)'),'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f['exten'],'priority':_0x428201[_0x7597('0x38')][_0x7597('0x27')]+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});}else{if(_0x428201[_0x7597('0x1d')](_0x7597('0x40'))){if([_0x7597('0x41'),_0x7597('0x42')]['includes'](_0x428201[_0x7597('0x43')][_0x7597('0x3c')]())&&_0x428201['appType']!==_0x7597('0x44')){if(_0x428201[_0x7597('0x40')]){_0x58c29a['push']({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':_0x7597('0x17'),'appdata':_0x7597('0x45'),'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f[_0x7597('0x8')],'priority':_0x428201[_0x7597('0x38')]['length']+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});_0x58c29a['push']({'type':_0x428201['type'][_0x7597('0x3c')](),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f[_0x7597('0x8')],'priority':_0x428201[_0x7597('0x38')][_0x7597('0x27')]+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});}else{_0x58c29a[_0x7597('0xe')]({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':_0x7597('0x17'),'appdata':_0x7597('0x46'),'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f['exten'],'priority':_0x428201[_0x7597('0x38')][_0x7597('0x27')]+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});_0x58c29a[_0x7597('0xe')]({'type':_0x428201[_0x7597('0x4')][_0x7597('0x3c')](),'app':_0x7597('0x5'),'appdata':_0x7597('0x47'),'context':_0x31be6f[_0x7597('0x7')],'exten':_0x31be6f[_0x7597('0x8')],'priority':_0x428201[_0x7597('0x38')][_0x7597('0x27')]+_0x1cb806+_0x309c9f++,'VoiceExtensionId':_0x31be6f['id']});}}}}for(var _0x17e0d6=0x0;_0x17e0d6<_0x428201[_0x7597('0x38')][_0x7597('0x27')];_0x17e0d6++){var _0x361ba6=_0x1cb806+_0x428201[_0x7597('0x38')][_0x7597('0x27')];var _0x3d2ec=_0x17e0d6===_0x428201['intervals']['length']-0x1?_0x1cb806+_0x58c29a[_0x7597('0x27')]+_0x1e40ff[_0x7597('0x27')]+0x2:_0x1cb806+_0x17e0d6+0x1;_0x58c29a['splice'](_0x17e0d6,0x0,{'type':_0x31be6f['type'],'app':_0x7597('0x48'),'appdata':_0x428201['intervals'][_0x17e0d6]+'?'+_0x31be6f[_0x7597('0x7')]+_0x7597('0x49')+_0x361ba6+':'+_0x31be6f['context']+_0x7597('0x49')+_0x3d2ec,'exten':_0x31be6f[_0x7597('0x8')],'context':_0x31be6f[_0x7597('0x7')],'priority':_0x1cb806+_0x17e0d6,'VoiceExtensionId':_0x31be6f['id']});}if(_0x428201['appType']==='outboundDial')_0x428201[_0x7597('0x4a')]=_0x15c18c(_0x31be6f,_0x428201['appdata']);_0x428201[_0x7597('0x4b')]=_0x58c29a[_0x7597('0x27')]?_[_0x7597('0x4c')](_0x58c29a)['priority']+0x1:_0x1cb806;_0x5f2fe4=_[_0x7597('0x4d')](_0x5f2fe4,_0x58c29a,[_0x428201],_0x1e40ff);_0x1cb806=_['last'](_0x5f2fe4)[_0x7597('0x4b')]+0x1;}return _0x5a99c7(_0x5f2fe4);})[_0x7597('0x4e')](function(_0x1727bd){_0x4f48ac(_0x1727bd);});});}return _0xd2e8e4[_0x7597('0x4f')](_0x7597('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xb65df0){var _0x4ab615=this[_0x7597('0x51')]({'plain':!![]});var _0x804772=_0x4ab615[_0x7597('0x4')]===_0x7597('0x13')?_0x5948b8(_0x4ab615):_0x1970b0(_0x4ab615);return _0x1ec74e(_0x4ab615,_0xb65df0,_[_0x7597('0x4c')](_0x804772)[_0x7597('0x4b')]+0x1)['then'](function(_0x247153){var _0xd00bd=_[_0x7597('0x4d')](_0x804772,_0x247153);_0xd00bd[_0x7597('0xe')]({'type':_0x4ab615[_0x7597('0x4')],'app':_0x7597('0x52'),'exten':_0x4ab615['exten'],'context':_0x4ab615[_0x7597('0x7')],'priority':_[_0x7597('0x4c')](_0xd00bd)[_0x7597('0x4b')]+0x1,'VoiceExtensionId':_0x4ab615['id']});return _0xd00bd;});}}});}; \ No newline at end of file +var _0x7380=['interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','get','Hangup','./voiceExtension.attributes','exports','models','type','context','alias','Set','NoOp','No\x20alias\x20set','exten','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(routeAlias)=','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','prefix','phone','SIP','join','U(xcally-mixmonitor-context)','findAll'];(function(_0x4914ad,_0x551a18){var _0x3cd61f=function(_0x2a773e){while(--_0x2a773e){_0x4914ad['push'](_0x4914ad['shift']());}};_0x3cd61f(++_0x551a18);}(_0x7380,0x172));var _0x0738=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7380[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var attributes=require(_0x0738('0x0'));module[_0x0738('0x1')]=function(_0x4eeea9){var _0x48479a=_0x4eeea9[_0x0738('0x2')];function _0xdb7ed1(_0x51c93f){var _0x235e91=0x2;var _0x2ed2be=[{'type':_0x51c93f[_0x0738('0x3')],'app':'Set','appdata':'CDR(type)='+_0x51c93f[_0x0738('0x3')],'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f['exten'],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']},{'type':_0x51c93f['type'],'app':_0x51c93f[_0x0738('0x5')]?_0x0738('0x6'):_0x0738('0x7'),'appdata':_0x51c93f[_0x0738('0x5')]?'CDR(routeAlias)='+_0x51c93f['alias']:_0x0738('0x8'),'context':_0x51c93f['context'],'exten':_0x51c93f[_0x0738('0x9')],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']}];if(_0x51c93f[_0x0738('0x3')]===_0x0738('0xa')){_0x2ed2be['push']({'type':_0x0738('0xa'),'app':'Set','appdata':_0x0738('0xb')+_0x51c93f['id'],'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f[_0x0738('0x9')],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']});}_0x2ed2be[_0x0738('0xc')]({'type':_0x51c93f[_0x0738('0x3')],'app':_0x0738('0x6'),'appdata':_0x0738('0xd'),'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f[_0x0738('0x9')],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']},{'type':_0x51c93f['type'],'app':_0x0738('0x6'),'appdata':_0x0738('0xe'),'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f['exten'],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']},{'type':_0x51c93f[_0x0738('0x3')],'app':_0x0738('0x6'),'appdata':_0x0738('0xf'),'context':_0x51c93f[_0x0738('0x4')],'exten':_0x51c93f[_0x0738('0x9')],'priority':_0x235e91++,'VoiceExtensionId':_0x51c93f['id']});return _0x2ed2be;}function _0x36bd81(_0x1e4dd0){var _0x14f259=0x2;var _0x8b333f=[{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':'CDR(type)=outbound','context':_0x1e4dd0['context'],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x1e4dd0[_0x0738('0x5')]?'Set':'NoOp','appdata':_0x1e4dd0[_0x0738('0x5')]?_0x0738('0x11')+_0x1e4dd0[_0x0738('0x5')]:_0x0738('0x8'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0x12')+(_0x1e4dd0['cutdigits']?_0x0738('0x13')+_0x1e4dd0[_0x0738('0x14')]+'}':_0x0738('0x15')),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0xb')+_0x1e4dd0['id'],'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':'ExecIf','appdata':_0x0738('0x16')+(_0x14f259+0x2)+'):Goto('+(_0x14f259+0x1)+')','context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x1e4dd0[_0x0738('0x14')]?_0x0738('0x17')+_0x1e4dd0[_0x0738('0x14')]+'}':_0x0738('0x18'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':'Set','appdata':_0x0738('0xd'),'context':_0x1e4dd0['context'],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0xe'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0xf'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':'outbound','app':_0x0738('0x6'),'appdata':_0x0738('0x19')+_0x1e4dd0['id'],'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0['exten'],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']}];if(_0x1e4dd0[_0x0738('0x1a')](_0x0738('0x1b'))&&_0x1e4dd0['recordingFormat']!==_0x0738('0x1c')){_0x8b333f['push']({'type':_0x0738('0x10'),'app':'Set','appdata':_0x0738('0x1d'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']},{'type':_0x0738('0x10'),'app':_0x0738('0x6'),'appdata':_0x0738('0x1e')+_0x1e4dd0[_0x0738('0x1b')]||_0x0738('0x1f'),'context':_0x1e4dd0[_0x0738('0x4')],'exten':_0x1e4dd0[_0x0738('0x9')],'priority':_0x14f259++,'VoiceExtensionId':_0x1e4dd0['id']});}return _0x8b333f;}function _0x335b8d(_0x547d53,_0x46d373){var _0x3df84e=[{'name':'trunk','param':0x0},{'name':_0x0738('0x20'),'param':0x1},{'name':_0x0738('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0xd4f4ca={};var _0x2073fa=_0x46d373[_0x0738('0x22')](',');var _0x104237=[];for(var _0x25323a=0x0;_0x25323a<_0x3df84e[_0x0738('0x23')];_0x25323a++){switch(_0x3df84e[_0x25323a][_0x0738('0x24')]){case'trunk':_0xd4f4ca[_0x0738('0x25')]=_0x2073fa[_0x3df84e[_0x25323a][_0x0738('0x26')]][_0x0738('0x22')]('/')[0x1];_0xd4f4ca['phone']=_0x2073fa[_0x3df84e[_0x25323a][_0x0738('0x26')]][_0x0738('0x22')]('/')[0x2];_0xd4f4ca[_0x0738('0x27')]=_0xd4f4ca['phone']?_0xd4f4ca[_0x0738('0x28')]['split']('$')[0x0]:undefined;_0xd4f4ca[_0x0738('0x28')]=_0x547d53[_0x0738('0x14')]?(_0xd4f4ca[_0x0738('0x27')]||'')+'${EXTEN:'+_0x547d53[_0x0738('0x14')]+'}':(_0xd4f4ca['prefix']||'')+'${EXTEN}';_0x104237[_0x3df84e[_0x25323a][_0x0738('0x26')]]=[_0x0738('0x29'),_0xd4f4ca['trunk'],_0xd4f4ca['phone']][_0x0738('0x2a')]('/');break;case'options':_0xd4f4ca[_0x0738('0x21')]=_0x2073fa[_0x3df84e[_0x25323a][_0x0738('0x26')]];if(_0x547d53[_0x0738('0x1b')]!==_0x0738('0x1c')){if(_0xd4f4ca['options']['indexOf'](_0x0738('0x2b'))<0x0){_0xd4f4ca[_0x0738('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0xd4f4ca[_0x0738('0x21')]=_0xd4f4ca[_0x0738('0x21')]['replace'](_0x0738('0x2b'),'');}_0x104237[_0x3df84e[_0x25323a][_0x0738('0x26')]]=_0xd4f4ca[_0x0738('0x21')];break;default:_0x104237[_0x3df84e[_0x25323a][_0x0738('0x26')]]=_0x2073fa[_0x3df84e[_0x25323a][_0x0738('0x26')]];}}return _0x104237['join'](',');}function _0xf55150(_0x567479,_0x5564b9,_0x17e7bf){return new Promise(function(_0x315139,_0x300a72){var _0x595e34=[];if(_['isEmpty'](_0x5564b9))return _0x315139(_0x595e34);_0x48479a['Interval'][_0x0738('0x2c')]({'attributes':['id',_0x0738('0x2d'),_0x0738('0x2e')],'raw':!![]})[_0x0738('0x2f')](function(_0x2aae84){for(var _0x54873f=0x0,_0x2d99ba=0x0;_0x54873f<_0x5564b9[_0x0738('0x23')];_0x54873f++,_0x2d99ba=0x0){var _0x321082=_0x5564b9[_0x54873f];var _0x5ad8eb=[];var _0x13d458=[];delete _0x321082['id'];if(_0x321082[_0x0738('0x2d')]!==_0x0738('0x30')){_0x321082[_0x0738('0x31')]=[_0x321082[_0x0738('0x2d')]];}else{_0x321082[_0x0738('0x31')]=_0x321082[_0x0738('0x2e')]?_[_0x0738('0x32')](_[_0x0738('0x33')](_0x2aae84,{'IntervalId':_0x321082[_0x0738('0x2e')]}),_0x0738('0x2d')):[];}_0x321082[_0x0738('0x4')]=_0x567479[_0x0738('0x4')];_0x321082[_0x0738('0x9')]=_0x567479['exten'];if(_0x321082[_0x0738('0x3')])_0x321082[_0x0738('0x3')]=_0x321082[_0x0738('0x3')][_0x0738('0x34')]();if(_0x567479[_0x0738('0x3')]===_0x0738('0x10')){if(_0x321082[_0x0738('0x1a')](_0x0738('0x35'))&&_0x321082[_0x0738('0x35')]&&_0x321082[_0x0738('0x35')]!=='--'){_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082[_0x0738('0x3')][_0x0738('0x34')](),'app':_0x0738('0x6'),'appdata':_0x0738('0x36')+_0x321082[_0x0738('0x35')],'context':_0x567479[_0x0738('0x4')],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082[_0x0738('0x31')][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});}_0x5ad8eb['push']({'type':_0x321082[_0x0738('0x3')]['toLowerCase'](),'app':_0x0738('0x37'),'appdata':_0x0738('0x38')+(_0x321082['callerID']?_0x0738('0x39')+_0x321082[_0x0738('0x3a')]+')':_0x0738('0x3b')),'context':_0x567479[_0x0738('0x4')],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082[_0x0738('0x31')]['length']+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});}else{if(_0x321082[_0x0738('0x1a')](_0x0738('0x3c'))){if([_0x0738('0x3d'),_0x0738('0x3e')][_0x0738('0x3f')](_0x321082[_0x0738('0x40')]['toLowerCase']())&&_0x321082[_0x0738('0x41')]!==_0x0738('0x42')){if(_0x321082[_0x0738('0x3c')]){_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082['type'][_0x0738('0x34')](),'app':_0x0738('0x37'),'appdata':_0x0738('0x43'),'context':_0x567479[_0x0738('0x4')],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082['intervals'][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082[_0x0738('0x3')]['toLowerCase'](),'app':_0x0738('0x6'),'appdata':_0x0738('0x44'),'context':_0x567479[_0x0738('0x4')],'exten':_0x567479['exten'],'priority':_0x321082[_0x0738('0x31')][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});}else{_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082['type'][_0x0738('0x34')](),'app':_0x0738('0x37'),'appdata':_0x0738('0x45'),'context':_0x567479['context'],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082[_0x0738('0x31')][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});_0x5ad8eb[_0x0738('0xc')]({'type':_0x321082['type'][_0x0738('0x34')](),'app':_0x0738('0x6'),'appdata':_0x0738('0x46'),'context':_0x567479[_0x0738('0x4')],'exten':_0x567479[_0x0738('0x9')],'priority':_0x321082[_0x0738('0x31')][_0x0738('0x23')]+_0x17e7bf+_0x2d99ba++,'VoiceExtensionId':_0x567479['id']});}}}}for(var _0x6f2a5a=0x0;_0x6f2a5a<_0x321082['intervals'][_0x0738('0x23')];_0x6f2a5a++){var _0x2e214e=_0x17e7bf+_0x321082[_0x0738('0x31')]['length'];var _0x12a31f=_0x6f2a5a===_0x321082[_0x0738('0x31')][_0x0738('0x23')]-0x1?_0x17e7bf+_0x5ad8eb[_0x0738('0x23')]+_0x13d458[_0x0738('0x23')]+0x2:_0x17e7bf+_0x6f2a5a+0x1;_0x5ad8eb['splice'](_0x6f2a5a,0x0,{'type':_0x567479[_0x0738('0x3')],'app':_0x0738('0x47'),'appdata':_0x321082[_0x0738('0x31')][_0x6f2a5a]+'?'+_0x567479[_0x0738('0x4')]+_0x0738('0x48')+_0x2e214e+':'+_0x567479[_0x0738('0x4')]+_0x0738('0x48')+_0x12a31f,'exten':_0x567479[_0x0738('0x9')],'context':_0x567479[_0x0738('0x4')],'priority':_0x17e7bf+_0x6f2a5a,'VoiceExtensionId':_0x567479['id']});}if(_0x321082['appType']===_0x0738('0x49'))_0x321082[_0x0738('0x4a')]=_0x335b8d(_0x567479,_0x321082[_0x0738('0x4a')]);_0x321082[_0x0738('0x4b')]=_0x5ad8eb[_0x0738('0x23')]?_[_0x0738('0x4c')](_0x5ad8eb)[_0x0738('0x4b')]+0x1:_0x17e7bf;_0x595e34=_[_0x0738('0x4d')](_0x595e34,_0x5ad8eb,[_0x321082],_0x13d458);_0x17e7bf=_[_0x0738('0x4c')](_0x595e34)[_0x0738('0x4b')]+0x1;}return _0x315139(_0x595e34);})[_0x0738('0x4e')](function(_0x5564f6){_0x300a72(_0x5564f6);});});}return _0x4eeea9[_0x0738('0x4f')](_0x0738('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x169736){var _0x3e172e=this[_0x0738('0x51')]({'plain':!![]});var _0x2f0757=_0x3e172e['type']===_0x0738('0x10')?_0x36bd81(_0x3e172e):_0xdb7ed1(_0x3e172e);return _0xf55150(_0x3e172e,_0x169736,_[_0x0738('0x4c')](_0x2f0757)['priority']+0x1)[_0x0738('0x2f')](function(_0x420377){var _0x1630b8=_[_0x0738('0x4d')](_0x2f0757,_0x420377);_0x1630b8[_0x0738('0xc')]({'type':_0x3e172e[_0x0738('0x3')],'app':_0x0738('0x52'),'exten':_0x3e172e[_0x0738('0x9')],'context':_0x3e172e[_0x0738('0x4')],'priority':_[_0x0738('0x4c')](_0x1630b8)[_0x0738('0x4b')]+0x1,'VoiceExtensionId':_0x3e172e['id']});return _0x1630b8;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 44f2b4b..8ea7b57 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 _0x00cd=['rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','then','info','VoiceExtension,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','map','include','model','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x00cd,0xee));var _0xd00c=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x00cd[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0xd00c('0x0'));var util=require(_0xd00c('0x1'));var moment=require(_0xd00c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd00c('0x3'));var db=require(_0xd00c('0x4'))['db'];var utils=require(_0xd00c('0x5'));var logger=require(_0xd00c('0x6'))(_0xd00c('0x7'));var config=require('../../config/environment');var jayson=require(_0xd00c('0x8'));var client=jayson[_0xd00c('0x9')][_0xd00c('0xa')]({'port':0x232a});config[_0xd00c('0xb')]=_[_0xd00c('0xc')](config[_0xd00c('0xb')],{'host':_0xd00c('0xd'),'port':0x18eb});var socket=require(_0xd00c('0xe'))(new Redis(config[_0xd00c('0xb')]));require(_0xd00c('0xf'))['register'](socket);function respondWithRpcPromise(_0x5b6955,_0x462615,_0x267343){return new BPromise(function(_0x3c7e4f,_0x1dee65){return client['request'](_0x5b6955,_0x267343)[_0xd00c('0x10')](function(_0x532556){logger[_0xd00c('0x11')](_0xd00c('0x12'),_0x462615,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x462615,'request\x20sent',JSON[_0xd00c('0x13')](_0x532556));if(_0x532556[_0xd00c('0x14')]){if(_0x532556[_0xd00c('0x14')]['code']===0x1f4){logger[_0xd00c('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x462615,_0x532556[_0xd00c('0x14')][_0xd00c('0x15')]);return _0x1dee65(_0x532556[_0xd00c('0x14')]['message']);}logger['error'](_0xd00c('0x12'),_0x462615,_0x532556[_0xd00c('0x14')][_0xd00c('0x15')]);return _0x3c7e4f(_0x532556[_0xd00c('0x14')][_0xd00c('0x15')]);}else{logger[_0xd00c('0x11')](_0xd00c('0x12'),_0x462615,_0xd00c('0x16'));_0x3c7e4f(_0x532556['result'][_0xd00c('0x15')]);}})[_0xd00c('0x17')](function(_0x110464){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x462615,_0x110464);_0x1dee65(_0x110464);});});}exports[_0xd00c('0x18')]=function(_0x271543){var _0x42b1b9=this;return new Promise(function(_0x29a748,_0xbced81){return db[_0xd00c('0x19')][_0xd00c('0x1a')]({'raw':_0x271543['options']?_0x271543[_0xd00c('0x1b')][_0xd00c('0x1c')]===undefined?!![]:![]:!![],'where':_0x271543[_0xd00c('0x1b')]?_0x271543[_0xd00c('0x1b')][_0xd00c('0x1d')]||null:null,'attributes':_0x271543['options']?_0x271543['options'][_0xd00c('0x1e')]||null:null,'limit':_0x271543[_0xd00c('0x1b')]?_0x271543['options']['limit']||null:null,'include':_0x271543['options']?_0x271543[_0xd00c('0x1b')]['include']?_[_0xd00c('0x1f')](_0x271543['options'][_0xd00c('0x20')],function(_0x276eef){return{'model':db[_0x276eef['model']],'as':_0x276eef['as'],'attributes':_0x276eef['attributes'],'include':_0x276eef[_0xd00c('0x20')]?_[_0xd00c('0x1f')](_0x276eef[_0xd00c('0x20')],function(_0x2f95e4){return{'model':db[_0x2f95e4['model']],'as':_0x2f95e4['as'],'attributes':_0x2f95e4[_0xd00c('0x1e')],'include':_0x2f95e4[_0xd00c('0x20')]?_[_0xd00c('0x1f')](_0x2f95e4[_0xd00c('0x20')],function(_0x4987c5){return{'model':db[_0x4987c5[_0xd00c('0x21')]],'as':_0x4987c5['as'],'attributes':_0x4987c5['attributes']};}):[]};}):[]};}):[]:[]})[_0xd00c('0x10')](function(_0x127a0b){logger[_0xd00c('0x11')](_0xd00c('0x18'),_0x271543);logger[_0xd00c('0x22')](_0xd00c('0x18'),_0x271543,JSON[_0xd00c('0x13')](_0x127a0b));_0x29a748(_0x127a0b);})[_0xd00c('0x17')](function(_0x1345dd){logger[_0xd00c('0x14')](_0xd00c('0x18'),_0x1345dd[_0xd00c('0x15')],_0x271543);_0xbced81(_0x42b1b9[_0xd00c('0x14')](0x1f4,_0x1345dd[_0xd00c('0x15')]));});});}; \ No newline at end of file +var _0xafdd=['then','info','VoiceExtension,\x20%s,\x20%s','debug','stringify','error','code','message','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','limit','include','map','model','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xafdd,0x19a));var _0xdafd=function(_0x3146dd,_0x467f10){_0x3146dd=_0x3146dd-0x0;var _0x18e2bb=_0xafdd[_0x3146dd];return _0x18e2bb;};'use strict';var _=require(_0xdafd('0x0'));var util=require(_0xdafd('0x1'));var moment=require(_0xdafd('0x2'));var BPromise=require(_0xdafd('0x3'));var rs=require(_0xdafd('0x4'));var fs=require('fs');var Redis=require(_0xdafd('0x5'));var db=require(_0xdafd('0x6'))['db'];var utils=require(_0xdafd('0x7'));var logger=require('../../config/logger')(_0xdafd('0x8'));var config=require(_0xdafd('0x9'));var jayson=require(_0xdafd('0xa'));var client=jayson[_0xdafd('0xb')][_0xdafd('0xc')]({'port':0x232a});config[_0xdafd('0xd')]=_[_0xdafd('0xe')](config['redis'],{'host':_0xdafd('0xf'),'port':0x18eb});var socket=require(_0xdafd('0x10'))(new Redis(config[_0xdafd('0xd')]));require('./voiceExtension.socket')[_0xdafd('0x11')](socket);function respondWithRpcPromise(_0x413d23,_0xb2514d,_0x2f3bb3){return new BPromise(function(_0x5a4bcd,_0x42373f){return client[_0xdafd('0x12')](_0x413d23,_0x2f3bb3)[_0xdafd('0x13')](function(_0x44e13d){logger[_0xdafd('0x14')](_0xdafd('0x15'),_0xb2514d,'request\x20sent');logger[_0xdafd('0x16')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0xb2514d,'request\x20sent',JSON[_0xdafd('0x17')](_0x44e13d));if(_0x44e13d[_0xdafd('0x18')]){if(_0x44e13d['error'][_0xdafd('0x19')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0xb2514d,_0x44e13d[_0xdafd('0x18')][_0xdafd('0x1a')]);return _0x42373f(_0x44e13d[_0xdafd('0x18')][_0xdafd('0x1a')]);}logger[_0xdafd('0x18')]('VoiceExtension,\x20%s,\x20%s',_0xb2514d,_0x44e13d[_0xdafd('0x18')][_0xdafd('0x1a')]);return _0x5a4bcd(_0x44e13d[_0xdafd('0x18')]['message']);}else{logger[_0xdafd('0x14')](_0xdafd('0x15'),_0xb2514d,'request\x20sent');_0x5a4bcd(_0x44e13d['result'][_0xdafd('0x1a')]);}})['catch'](function(_0x3556da){logger[_0xdafd('0x18')](_0xdafd('0x15'),_0xb2514d,_0x3556da);_0x42373f(_0x3556da);});});}exports[_0xdafd('0x1b')]=function(_0x1c2029){var _0x367ead=this;return new Promise(function(_0x44f825,_0x42e0f9){return db[_0xdafd('0x1c')][_0xdafd('0x1d')]({'raw':_0x1c2029[_0xdafd('0x1e')]?_0x1c2029[_0xdafd('0x1e')][_0xdafd('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c2029[_0xdafd('0x1e')]?_0x1c2029['options'][_0xdafd('0x20')]||null:null,'attributes':_0x1c2029['options']?_0x1c2029[_0xdafd('0x1e')]['attributes']||null:null,'limit':_0x1c2029[_0xdafd('0x1e')]?_0x1c2029[_0xdafd('0x1e')][_0xdafd('0x21')]||null:null,'include':_0x1c2029[_0xdafd('0x1e')]?_0x1c2029[_0xdafd('0x1e')][_0xdafd('0x22')]?_[_0xdafd('0x23')](_0x1c2029[_0xdafd('0x1e')][_0xdafd('0x22')],function(_0x5cd11d){return{'model':db[_0x5cd11d[_0xdafd('0x24')]],'as':_0x5cd11d['as'],'attributes':_0x5cd11d[_0xdafd('0x25')],'include':_0x5cd11d[_0xdafd('0x22')]?_[_0xdafd('0x23')](_0x5cd11d[_0xdafd('0x22')],function(_0x25f277){return{'model':db[_0x25f277[_0xdafd('0x24')]],'as':_0x25f277['as'],'attributes':_0x25f277[_0xdafd('0x25')],'include':_0x25f277[_0xdafd('0x22')]?_[_0xdafd('0x23')](_0x25f277['include'],function(_0x243182){return{'model':db[_0x243182[_0xdafd('0x24')]],'as':_0x243182['as'],'attributes':_0x243182[_0xdafd('0x25')]};}):[]};}):[]};}):[]:[]})[_0xdafd('0x13')](function(_0x21edb6){logger[_0xdafd('0x14')]('GetVoiceExtension',_0x1c2029);logger['debug']('GetVoiceExtension',_0x1c2029,JSON[_0xdafd('0x17')](_0x21edb6));_0x44f825(_0x21edb6);})[_0xdafd('0x26')](function(_0x568996){logger['error'](_0xdafd('0x1b'),_0x568996[_0xdafd('0x1a')],_0x1c2029);_0x42e0f9(_0x367ead[_0xdafd('0x18')](0x1f4,_0x568996[_0xdafd('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 2cb7f8b..816717e 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 _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x814b,0x1a2));var _0xb814=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x814b[_0x149a9b];return _0x2c2bf6;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}}; \ No newline at end of file +var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x4f22ec,_0x4784b5){var _0x21f4ca=function(_0x2d0e30){while(--_0x2d0e30){_0x4f22ec['push'](_0x4f22ec['shift']());}};_0x21f4ca(++_0x4784b5);}(_0x1261,0x144));var _0x1126=function(_0x5cbcdf,_0x2224a4){_0x5cbcdf=_0x5cbcdf-0x0;var _0x4be16f=_0x1261[_0x5cbcdf];return _0x4be16f;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 0e72ad7..ceab005 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 _0xdf55=['/:id/messages','getMessages','create','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show'];(function(_0x254081,_0x133020){var _0x15e822=function(_0x5835ea){while(--_0x5835ea){_0x254081['push'](_0x254081['shift']());}};_0x15e822(++_0x133020);}(_0xdf55,0x83));var _0x5df5=function(_0x5229bb,_0x4b17f5){_0x5229bb=_0x5229bb-0x0;var _0x15db9b=_0xdf55[_0x5229bb];return _0x15db9b;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5df5('0xf')]);router['put'](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller['update']);router['delete'](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0x10')]);module[_0x5df5('0x11')]=router; \ No newline at end of file +var _0xf61e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','index','isAuthenticated','show','getMessages','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x15c815,_0x4137f4){var _0x58df88=function(_0x363ebd){while(--_0x363ebd){_0x15c815['push'](_0x15c815['shift']());}};_0x58df88(++_0x4137f4);}(_0xf61e,0x191));var _0xef61=function(_0x136cfc,_0x21167f){_0x136cfc=_0x136cfc-0x0;var _0x43a3d5=_0xf61e[_0x136cfc];return _0x43a3d5;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/:id',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id/messages',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0x10')]('/',auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0x12')](_0xef61('0x13'),auth[_0xef61('0xd')](),controller[_0xef61('0x14')]);router[_0xef61('0x15')](_0xef61('0x13'),auth[_0xef61('0xd')](),controller[_0xef61('0x16')]);module[_0xef61('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index a0c538c..619ff43 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 _0x0991=['STRING','from-voicemail','contest_mailbox','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','fullname','\x20-\x20','getDataValue','mailbox','sequelize'];(function(_0x5a056e,_0x382a98){var _0x5e1dab=function(_0x1059a4){while(--_0x1059a4){_0x5a056e['push'](_0x5a056e['shift']());}};_0x5e1dab(++_0x382a98);}(_0x0991,0x12f));var _0x1099=function(_0x56bb3d,_0xcc1932){_0x56bb3d=_0x56bb3d-0x0;var _0x336a5e=_0x0991[_0x56bb3d];return _0x336a5e;};'use strict';var Sequelize=require(_0x1099('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x1099('0x1')],'defaultValue':_0x1099('0x2'),'unique':_0x1099('0x3')},'mailbox':{'type':Sequelize[_0x1099('0x1')],'defaultValue':'','allowNull':![],'unique':_0x1099('0x3')},'password':{'type':Sequelize[_0x1099('0x1')]},'fullname':{'type':Sequelize[_0x1099('0x1')]},'email':{'type':Sequelize[_0x1099('0x1')],'validate':{'isEmail':!![]},'set':function(_0x1e10d3){this['setDataValue'](_0x1099('0x4'),typeof _0x1e10d3==='string'&&_0x1e10d3[_0x1099('0x5')]()?_0x1e10d3[_0x1099('0x5')]():null);}},'pager':{'type':Sequelize[_0x1099('0x1')]},'tz':{'type':Sequelize[_0x1099('0x1')],'defaultValue':_0x1099('0x6')},'attach':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':_0x1099('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x1099('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x1099('0x1')]},'review':{'type':Sequelize[_0x1099('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1099('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':_0x1099('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x1099('0x7')](_0x1099('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x1099('0xa')},'emailsubject':{'type':Sequelize[_0x1099('0x1')]},'emailbody':{'type':Sequelize[_0x1099('0x1')]},'maxsecs':{'type':Sequelize[_0x1099('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1099('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x1099('0xc'))+_0x1099('0xd')+this[_0x1099('0xe')](_0x1099('0xf'));}}}; \ No newline at end of file +var _0xc716=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes'];(function(_0x30ba6c,_0x234a17){var _0x9c7617=function(_0x166660){while(--_0x166660){_0x30ba6c['push'](_0x30ba6c['shift']());}};_0x9c7617(++_0x234a17);}(_0xc716,0xde));var _0x6c71=function(_0x3157f4,_0x1d32c8){_0x3157f4=_0x3157f4-0x0;var _0x42ef99=_0xc716[_0x3157f4];return _0x42ef99;};'use strict';var Sequelize=require(_0x6c71('0x0'));module[_0x6c71('0x1')]={'customer_id':{'type':Sequelize[_0x6c71('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x6c71('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x6c71('0x2')],'defaultValue':'','allowNull':![],'unique':_0x6c71('0x4')},'password':{'type':Sequelize[_0x6c71('0x2')]},'fullname':{'type':Sequelize[_0x6c71('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x223b7c){this[_0x6c71('0x5')](_0x6c71('0x6'),typeof _0x223b7c===_0x6c71('0x7')&&_0x223b7c[_0x6c71('0x8')]()?_0x223b7c[_0x6c71('0x8')]():null);}},'pager':{'type':Sequelize[_0x6c71('0x2')]},'tz':{'type':Sequelize[_0x6c71('0x2')],'defaultValue':_0x6c71('0x9')},'attach':{'type':Sequelize[_0x6c71('0xa')](_0x6c71('0xb'),'no'),'defaultValue':_0x6c71('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x6c71('0xa')]('yes','no'),'defaultValue':_0x6c71('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0x6c71('0x2')]},'callback':{'type':Sequelize[_0x6c71('0x2')]},'review':{'type':Sequelize[_0x6c71('0xa')](_0x6c71('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x6c71('0xa')](_0x6c71('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x6c71('0xa')](_0x6c71('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x6c71('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x6c71('0xa')](_0x6c71('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x6c71('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x6c71('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x6c71('0xa')](_0x6c71('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x6c71('0xa')](_0x6c71('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x6c71('0xa')](_0x6c71('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x6c71('0xc')},'emailsubject':{'type':Sequelize[_0x6c71('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x6c71('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x6c71('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x6c71('0xe')],'get':function(){return this[_0x6c71('0xf')](_0x6c71('0x10'))+'\x20-\x20'+this[_0x6c71('0xf')](_0x6c71('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index b0b1602..569ce7b 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 _0x96cc=['find','userProfileId','UserProfileResource','getMessages','findOne','mailbox','VoiceMailMessage','findAndCountAll','eml-format','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','../../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','destroy','then','get','Voicemails','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail','includeAll','include','rows','catch','params','keys','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection'];(function(_0x5f25b3,_0x35481a){var _0x4ab9bf=function(_0x49baf7){while(--_0x49baf7){_0x5f25b3['push'](_0x5f25b3['shift']());}};_0x4ab9bf(++_0x35481a);}(_0x96cc,0x16c));var _0xc96c=function(_0x625a73,_0x50ae08){_0x625a73=_0x625a73-0x0;var _0x3eceb5=_0x96cc[_0x625a73];return _0x3eceb5;};'use strict';var emlformat=require(_0xc96c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc96c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc96c('0x2'));var moment=require(_0xc96c('0x3'));var BPromise=require(_0xc96c('0x4'));var Mustache=require(_0xc96c('0x5'));var util=require(_0xc96c('0x6'));var path=require(_0xc96c('0x7'));var sox=require(_0xc96c('0x8'));var csv=require(_0xc96c('0x9'));var ejs=require(_0xc96c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc96c('0xb'));var squel=require(_0xc96c('0xc'));var crypto=require(_0xc96c('0xd'));var jsforce=require(_0xc96c('0xe'));var deskjs=require(_0xc96c('0xf'));var toCsv=require(_0xc96c('0x9'));var querystring=require(_0xc96c('0x10'));var Papa=require('papaparse');var Redis=require(_0xc96c('0x11'));var authService=require(_0xc96c('0x12'));var qs=require(_0xc96c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc96c('0x14'));var logger=require('../../config/logger')(_0xc96c('0x15'));var utils=require('../../config/utils');var config=require(_0xc96c('0x16'));var licenseUtil=require(_0xc96c('0x17'));var db=require(_0xc96c('0x18'))['db'];function respondWithStatusCode(_0x246a95,_0x5f27f3){_0x5f27f3=_0x5f27f3||0xcc;return function(_0x3fe3d5){if(_0x3fe3d5){return _0x246a95[_0xc96c('0x19')](_0x5f27f3);}return _0x246a95[_0xc96c('0x1a')](_0x5f27f3)[_0xc96c('0x1b')]();};}function respondWithResult(_0x48de8d,_0x35da94){_0x35da94=_0x35da94||0xc8;return function(_0xbed0c9){if(_0xbed0c9){return _0x48de8d[_0xc96c('0x1a')](_0x35da94)[_0xc96c('0x1c')](_0xbed0c9);}};}function respondWithFilteredResult(_0x377dbc,_0x46455a){return function(_0x1765d9){if(_0x1765d9){var _0x23e357=typeof _0x46455a[_0xc96c('0x1d')]===_0xc96c('0x1e')&&typeof _0x46455a[_0xc96c('0x1f')]==='undefined';var _0x509376=_0x1765d9[_0xc96c('0x20')];var _0x99c402=_0x23e357?0x0:_0x46455a[_0xc96c('0x1d')];var _0x2ae19a=_0x23e357?_0x1765d9['count']:_0x46455a[_0xc96c('0x1d')]+_0x46455a[_0xc96c('0x1f')];var _0x2a361c;if(_0x2ae19a>=_0x509376){_0x2ae19a=_0x509376;_0x2a361c=0xc8;}else{_0x2a361c=0xce;}_0x377dbc[_0xc96c('0x1a')](_0x2a361c);return _0x377dbc[_0xc96c('0x21')](_0xc96c('0x22'),_0x99c402+'-'+_0x2ae19a+'/'+_0x509376)[_0xc96c('0x1c')](_0x1765d9);}return null;};}function patchUpdates(_0x41daba){return function(_0x28d762){try{jsonpatch[_0xc96c('0x23')](_0x28d762,_0x41daba,!![]);}catch(_0x2bb397){return BPromise[_0xc96c('0x24')](_0x2bb397);}return _0x28d762[_0xc96c('0x25')]();};}function saveUpdates(_0x45edee,_0x325c54){return function(_0x3b5c6c){if(_0x3b5c6c){return _0x3b5c6c[_0xc96c('0x26')](_0x45edee)['then'](function(_0xd63951){return _0xd63951;});}return null;};}function removeEntity(_0x4be783,_0x4456bf){return function(_0x10ae21){if(_0x10ae21){return _0x10ae21[_0xc96c('0x27')]()[_0xc96c('0x28')](function(){var _0x40f23d=_0x10ae21[_0xc96c('0x29')]({'plain':!![]});var _0x1a77df=_0xc96c('0x2a');return db['UserProfileResource'][_0xc96c('0x27')]({'where':{'type':_0x1a77df,'resourceId':_0x40f23d['id']}})[_0xc96c('0x28')](function(){return _0x10ae21;});})[_0xc96c('0x28')](function(){_0x4be783[_0xc96c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c00b6,_0x39c191){return function(_0x12c293){if(!_0x12c293){_0x5c00b6[_0xc96c('0x19')](0x194);}return _0x12c293;};}function handleError(_0x1ef845,_0x3c0eb1){_0x3c0eb1=_0x3c0eb1||0x1f4;return function(_0x5e1727){logger[_0xc96c('0x2b')](_0x5e1727[_0xc96c('0x2c')]);if(_0x5e1727[_0xc96c('0x2d')]){delete _0x5e1727[_0xc96c('0x2d')];}_0x1ef845[_0xc96c('0x1a')](_0x3c0eb1)[_0xc96c('0x2e')](_0x5e1727);};}exports[_0xc96c('0x2f')]=function(_0x328ee4,_0x556108){var _0x3aa436={},_0x53c994={},_0x3f4b0e={'count':0x0,'rows':[]};var _0x442c7f=_[_0xc96c('0x30')](db['VoiceMail'][_0xc96c('0x31')],function(_0x3240ba){return{'name':_0x3240ba[_0xc96c('0x32')],'type':_0x3240ba[_0xc96c('0x33')]['key']};});_0x53c994['model']=_[_0xc96c('0x30')](_0x442c7f,_0xc96c('0x2d'));_0x53c994[_0xc96c('0x34')]=_['keys'](_0x328ee4[_0xc96c('0x34')]);_0x53c994[_0xc96c('0x35')]=_[_0xc96c('0x36')](_0x53c994[_0xc96c('0x37')],_0x53c994['query']);_0x3aa436[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x53c994['model'],qs[_0xc96c('0x39')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x39')]));_0x3aa436[_0xc96c('0x38')]=_0x3aa436[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x3aa436['attributes']:_0x53c994[_0xc96c('0x37')];if(!_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x3aa436[_0xc96c('0x1f')]=qs[_0xc96c('0x1f')](_0x328ee4['query']['limit']);_0x3aa436[_0xc96c('0x1d')]=qs[_0xc96c('0x1d')](_0x328ee4['query']['offset']);}_0x3aa436[_0xc96c('0x3d')]=qs[_0xc96c('0x3e')](_0x328ee4[_0xc96c('0x34')][_0xc96c('0x3e')]);_0x3aa436[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x328ee4[_0xc96c('0x34')],_0x53c994[_0xc96c('0x35')]),_0x442c7f);if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x41')]){_0x3aa436['where']=_[_0xc96c('0x42')](_0x3aa436[_0xc96c('0x3f')],{'$or':_[_0xc96c('0x30')](_0x442c7f,function(_0x16b1f1){if(_0x16b1f1['type']!==_0xc96c('0x43')){var _0x3a0848={};_0x3a0848[_0x16b1f1[_0xc96c('0x2d')]]={'$like':'%'+_0x328ee4['query']['filter']+'%'};return _0x3a0848;}})});}_0x3aa436=_[_0xc96c('0x42')]({},_0x3aa436,_0x328ee4[_0xc96c('0x44')]);var _0x2e3bc3={'where':_0x3aa436['where']};return db[_0xc96c('0x45')][_0xc96c('0x20')](_0x2e3bc3)[_0xc96c('0x28')](function(_0x2a8ea7){_0x3f4b0e[_0xc96c('0x20')]=_0x2a8ea7;if(_0x328ee4[_0xc96c('0x34')][_0xc96c('0x46')]){_0x3aa436[_0xc96c('0x47')]=[{'all':!![]}];}return db[_0xc96c('0x45')]['findAll'](_0x3aa436);})['then'](function(_0x30b3ac){_0x3f4b0e[_0xc96c('0x48')]=_0x30b3ac;return _0x3f4b0e;})[_0xc96c('0x28')](respondWithFilteredResult(_0x556108,_0x3aa436))[_0xc96c('0x49')](handleError(_0x556108,null));};exports['show']=function(_0x5ee6ac,_0x14b712){var _0x1c18c1={'raw':!![],'where':{'id':_0x5ee6ac[_0xc96c('0x4a')]['id']}},_0x44eb20={};_0x44eb20[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db[_0xc96c('0x45')]['rawAttributes']);_0x44eb20[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x5ee6ac[_0xc96c('0x34')]);_0x44eb20[_0xc96c('0x35')]=_['intersection'](_0x44eb20['model'],_0x44eb20[_0xc96c('0x34')]);_0x1c18c1[_0xc96c('0x38')]=_[_0xc96c('0x36')](_0x44eb20[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x5ee6ac[_0xc96c('0x34')][_0xc96c('0x39')]));_0x1c18c1[_0xc96c('0x38')]=_0x1c18c1[_0xc96c('0x38')][_0xc96c('0x3a')]?_0x1c18c1[_0xc96c('0x38')]:_0x44eb20[_0xc96c('0x37')];if(_0x5ee6ac[_0xc96c('0x34')]['includeAll']){_0x1c18c1[_0xc96c('0x47')]=[{'all':!![]}];}_0x1c18c1=_[_0xc96c('0x42')]({},_0x1c18c1,_0x5ee6ac[_0xc96c('0x44')]);return db[_0xc96c('0x45')]['find'](_0x1c18c1)[_0xc96c('0x28')](handleEntityNotFound(_0x14b712,null))['then'](respondWithResult(_0x14b712,null))[_0xc96c('0x49')](handleError(_0x14b712,null));};exports[_0xc96c('0x4c')]=function(_0x565812,_0x2581ae){return db[_0xc96c('0x45')][_0xc96c('0x4c')](_0x565812[_0xc96c('0x4d')],{})[_0xc96c('0x28')](function(_0x1bd694){var _0x57e699=_0x565812['user']['get']({'plain':!![]});if(!_0x57e699)throw new Error(_0xc96c('0x4e'));if(_0x57e699['role']===_0xc96c('0x4f')){var _0x22b2e3=_0x1bd694[_0xc96c('0x29')]({'plain':!![]});var _0x17c764=_0xc96c('0x2a');return db[_0xc96c('0x50')][_0xc96c('0x51')]({'where':{'name':_0x17c764,'userProfileId':_0x57e699[_0xc96c('0x52')]},'raw':!![]})[_0xc96c('0x28')](function(_0xd78e10){if(_0xd78e10&&_0xd78e10['autoAssociation']===0x0){return db[_0xc96c('0x53')][_0xc96c('0x4c')]({'name':_0x22b2e3[_0xc96c('0x2d')],'resourceId':_0x22b2e3['id'],'type':_0xd78e10[_0xc96c('0x2d')],'sectionId':_0xd78e10['id']},{})[_0xc96c('0x28')](function(){return _0x1bd694;});}else{return _0x1bd694;}})[_0xc96c('0x49')](function(_0xad88c3){logger[_0xc96c('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xad88c3);throw _0xad88c3;});}return _0x1bd694;})['then'](respondWithResult(_0x2581ae,0xc9))['catch'](handleError(_0x2581ae,null));};exports['update']=function(_0x356ef3,_0x46c6fb){if(_0x356ef3[_0xc96c('0x4d')]['id']){delete _0x356ef3[_0xc96c('0x4d')]['id'];}return db[_0xc96c('0x45')][_0xc96c('0x51')]({'where':{'id':_0x356ef3[_0xc96c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x46c6fb,null))[_0xc96c('0x28')](saveUpdates(_0x356ef3[_0xc96c('0x4d')],null))[_0xc96c('0x28')](respondWithResult(_0x46c6fb,null))[_0xc96c('0x49')](handleError(_0x46c6fb,null));};exports[_0xc96c('0x27')]=function(_0x1dbea5,_0x3aa216){return db['VoiceMail'][_0xc96c('0x51')]({'where':{'id':_0x1dbea5[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x3aa216,null))[_0xc96c('0x28')](removeEntity(_0x3aa216,null))[_0xc96c('0x49')](handleError(_0x3aa216,null));};exports[_0xc96c('0x54')]=function(_0x258f79,_0x34bb98,_0x10b1b8){return db[_0xc96c('0x45')][_0xc96c('0x55')]({'where':{'id':_0x258f79[_0xc96c('0x4a')]['id']}})[_0xc96c('0x28')](handleEntityNotFound(_0x34bb98,null))[_0xc96c('0x28')](function(_0x5a6e3e){var _0xb1629c;var _0x183211={},_0x3d879a={};_0x3d879a[_0xc96c('0x37')]=_[_0xc96c('0x4b')](db['VoiceMailMessage'][_0xc96c('0x31')]);_0x3d879a[_0xc96c('0x34')]=_[_0xc96c('0x4b')](_0x258f79[_0xc96c('0x34')]);_0x3d879a['filters']=_[_0xc96c('0x36')](_0x3d879a[_0xc96c('0x37')],_0x3d879a['query']);_0x183211['attributes']=_['intersection'](_0x3d879a[_0xc96c('0x37')],qs[_0xc96c('0x39')](_0x258f79[_0xc96c('0x34')][_0xc96c('0x39')]));_0x183211[_0xc96c('0x38')]=_0x183211['attributes']['length']?_0x183211[_0xc96c('0x38')]:_0x3d879a[_0xc96c('0x37')];if(!_0x258f79[_0xc96c('0x34')][_0xc96c('0x3b')](_0xc96c('0x3c'))){_0x183211['limit']=qs[_0xc96c('0x1f')](_0x258f79[_0xc96c('0x34')][_0xc96c('0x1f')]);_0x183211[_0xc96c('0x1d')]=qs['offset'](_0x258f79['query'][_0xc96c('0x1d')]);}_0x183211[_0xc96c('0x3d')]=qs['sort'](_0x258f79[_0xc96c('0x34')]['sort']);_0x183211[_0xc96c('0x3f')]=qs[_0xc96c('0x35')](_[_0xc96c('0x40')](_0x258f79[_0xc96c('0x34')],_0x3d879a[_0xc96c('0x35')]));if(_0x258f79[_0xc96c('0x34')][_0xc96c('0x41')]){_0x183211[_0xc96c('0x3f')]=_[_0xc96c('0x42')](_0x183211[_0xc96c('0x3f')],{'$or':_['map'](_0x183211[_0xc96c('0x38')],function(_0x5e94fa){var _0xe34ef={};_0xe34ef[_0x5e94fa]={'$like':'%'+_0x258f79[_0xc96c('0x34')]['filter']+'%'};return _0xe34ef;})});}_0x183211[_0xc96c('0x3f')]=_['merge'](_0x183211[_0xc96c('0x3f')],{'mailboxuser':_0x5a6e3e[_0xc96c('0x56')]});_0x183211=_[_0xc96c('0x42')]({},_0x183211,_0x258f79[_0xc96c('0x44')]);return db[_0xc96c('0x57')][_0xc96c('0x58')](_0x183211)[_0xc96c('0x28')](respondWithFilteredResult(_0x34bb98,_0x183211));})[_0xc96c('0x49')](handleError(_0x34bb98,null));}; \ No newline at end of file +var _0xb9a7=['model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','VoiceMail','includeAll','include','findAll','rows','params','find','catch','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','body','findOne','VoiceMailMessage','rawAttributes','nolimit','findAndCountAll','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','fieldName','type'];(function(_0xdb8aba,_0x584954){var _0x790caa=function(_0x5c33dd){while(--_0x5c33dd){_0xdb8aba['push'](_0xdb8aba['shift']());}};_0x790caa(++_0x584954);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xb9a7[_0x1969a7];return _0x3d665f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];function respondWithStatusCode(_0x5948ca,_0x32f616){_0x32f616=_0x32f616||0xcc;return function(_0xec5949){if(_0xec5949){return _0x5948ca['sendStatus'](_0x32f616);}return _0x5948ca[_0x7b9a('0x14')](_0x32f616)[_0x7b9a('0x15')]();};}function respondWithResult(_0x4b7ec0,_0xb157e5){_0xb157e5=_0xb157e5||0xc8;return function(_0xde180d){if(_0xde180d){return _0x4b7ec0[_0x7b9a('0x14')](_0xb157e5)[_0x7b9a('0x16')](_0xde180d);}};}function respondWithFilteredResult(_0x344fa7,_0x346daa){return function(_0x22a7e4){if(_0x22a7e4){var _0x35e602=typeof _0x346daa[_0x7b9a('0x17')]==='undefined'&&typeof _0x346daa[_0x7b9a('0x18')]==='undefined';var _0x123921=_0x22a7e4[_0x7b9a('0x19')];var _0x271263=_0x35e602?0x0:_0x346daa[_0x7b9a('0x17')];var _0x44a232=_0x35e602?_0x22a7e4[_0x7b9a('0x19')]:_0x346daa[_0x7b9a('0x17')]+_0x346daa[_0x7b9a('0x18')];var _0x2064a0;if(_0x44a232>=_0x123921){_0x44a232=_0x123921;_0x2064a0=0xc8;}else{_0x2064a0=0xce;}_0x344fa7[_0x7b9a('0x14')](_0x2064a0);return _0x344fa7[_0x7b9a('0x1a')](_0x7b9a('0x1b'),_0x271263+'-'+_0x44a232+'/'+_0x123921)[_0x7b9a('0x16')](_0x22a7e4);}return null;};}function patchUpdates(_0x58aed7){return function(_0x993048){try{jsonpatch['apply'](_0x993048,_0x58aed7,!![]);}catch(_0x1eacbc){return BPromise['reject'](_0x1eacbc);}return _0x993048[_0x7b9a('0x1c')]();};}function saveUpdates(_0x331ae6,_0x23d812){return function(_0x54fda7){if(_0x54fda7){return _0x54fda7[_0x7b9a('0x1d')](_0x331ae6)[_0x7b9a('0x1e')](function(_0x5705b2){return _0x5705b2;});}return null;};}function removeEntity(_0x35aca7,_0x374dca){return function(_0x269c07){if(_0x269c07){return _0x269c07[_0x7b9a('0x1f')]()[_0x7b9a('0x1e')](function(){var _0x5b2f52=_0x269c07[_0x7b9a('0x20')]({'plain':!![]});var _0x23219e='Voicemails';return db[_0x7b9a('0x21')]['destroy']({'where':{'type':_0x23219e,'resourceId':_0x5b2f52['id']}})[_0x7b9a('0x1e')](function(){return _0x269c07;});})[_0x7b9a('0x1e')](function(){_0x35aca7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24d886,_0x55301c){return function(_0x54df8a){if(!_0x54df8a){_0x24d886[_0x7b9a('0x22')](0x194);}return _0x54df8a;};}function handleError(_0x58fec8,_0x5be740){_0x5be740=_0x5be740||0x1f4;return function(_0x3847b4){logger['error'](_0x3847b4[_0x7b9a('0x23')]);if(_0x3847b4[_0x7b9a('0x24')]){delete _0x3847b4['name'];}_0x58fec8[_0x7b9a('0x14')](_0x5be740)[_0x7b9a('0x25')](_0x3847b4);};}exports[_0x7b9a('0x26')]=function(_0x5b64d7,_0x45ccf5){var _0x2ce78b={},_0x181e9c={},_0x6c8b1f={'count':0x0,'rows':[]};var _0x5028e7=_[_0x7b9a('0x27')](db['VoiceMail']['rawAttributes'],function(_0x2d278e){return{'name':_0x2d278e[_0x7b9a('0x28')],'type':_0x2d278e[_0x7b9a('0x29')]['key']};});_0x181e9c[_0x7b9a('0x2a')]=_[_0x7b9a('0x27')](_0x5028e7,'name');_0x181e9c['query']=_[_0x7b9a('0x2b')](_0x5b64d7[_0x7b9a('0x2c')]);_0x181e9c['filters']=_[_0x7b9a('0x2d')](_0x181e9c[_0x7b9a('0x2a')],_0x181e9c[_0x7b9a('0x2c')]);_0x2ce78b[_0x7b9a('0x2e')]=_[_0x7b9a('0x2d')](_0x181e9c['model'],qs[_0x7b9a('0x2f')](_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x2ce78b[_0x7b9a('0x2e')]=_0x2ce78b[_0x7b9a('0x2e')][_0x7b9a('0x30')]?_0x2ce78b['attributes']:_0x181e9c['model'];if(!_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x31')]('nolimit')){_0x2ce78b[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x5b64d7[_0x7b9a('0x2c')]['limit']);_0x2ce78b[_0x7b9a('0x17')]=qs[_0x7b9a('0x17')](_0x5b64d7['query']['offset']);}_0x2ce78b[_0x7b9a('0x32')]=qs[_0x7b9a('0x33')](_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x33')]);_0x2ce78b[_0x7b9a('0x34')]=qs[_0x7b9a('0x35')](_[_0x7b9a('0x36')](_0x5b64d7[_0x7b9a('0x2c')],_0x181e9c['filters']),_0x5028e7);if(_0x5b64d7[_0x7b9a('0x2c')]['filter']){_0x2ce78b[_0x7b9a('0x34')]=_[_0x7b9a('0x37')](_0x2ce78b[_0x7b9a('0x34')],{'$or':_[_0x7b9a('0x27')](_0x5028e7,function(_0x3fa4cd){if(_0x3fa4cd[_0x7b9a('0x29')]!=='VIRTUAL'){var _0x34eebe={};_0x34eebe[_0x3fa4cd[_0x7b9a('0x24')]]={'$like':'%'+_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x34eebe;}})});}_0x2ce78b=_['merge']({},_0x2ce78b,_0x5b64d7[_0x7b9a('0x39')]);var _0xf86939={'where':_0x2ce78b[_0x7b9a('0x34')]};return db[_0x7b9a('0x3a')]['count'](_0xf86939)[_0x7b9a('0x1e')](function(_0x53d89a){_0x6c8b1f[_0x7b9a('0x19')]=_0x53d89a;if(_0x5b64d7[_0x7b9a('0x2c')][_0x7b9a('0x3b')]){_0x2ce78b[_0x7b9a('0x3c')]=[{'all':!![]}];}return db[_0x7b9a('0x3a')][_0x7b9a('0x3d')](_0x2ce78b);})['then'](function(_0x33edc6){_0x6c8b1f[_0x7b9a('0x3e')]=_0x33edc6;return _0x6c8b1f;})[_0x7b9a('0x1e')](respondWithFilteredResult(_0x45ccf5,_0x2ce78b))['catch'](handleError(_0x45ccf5,null));};exports['show']=function(_0x3724fe,_0x454b35){var _0x995d59={'raw':!![],'where':{'id':_0x3724fe[_0x7b9a('0x3f')]['id']}},_0x5cd3dd={};_0x5cd3dd[_0x7b9a('0x2a')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x5cd3dd[_0x7b9a('0x2c')]=_[_0x7b9a('0x2b')](_0x3724fe['query']);_0x5cd3dd[_0x7b9a('0x35')]=_[_0x7b9a('0x2d')](_0x5cd3dd[_0x7b9a('0x2a')],_0x5cd3dd['query']);_0x995d59[_0x7b9a('0x2e')]=_['intersection'](_0x5cd3dd[_0x7b9a('0x2a')],qs[_0x7b9a('0x2f')](_0x3724fe[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x995d59[_0x7b9a('0x2e')]=_0x995d59['attributes'][_0x7b9a('0x30')]?_0x995d59['attributes']:_0x5cd3dd[_0x7b9a('0x2a')];if(_0x3724fe['query']['includeAll']){_0x995d59[_0x7b9a('0x3c')]=[{'all':!![]}];}_0x995d59=_[_0x7b9a('0x37')]({},_0x995d59,_0x3724fe[_0x7b9a('0x39')]);return db[_0x7b9a('0x3a')][_0x7b9a('0x40')](_0x995d59)[_0x7b9a('0x1e')](handleEntityNotFound(_0x454b35,null))[_0x7b9a('0x1e')](respondWithResult(_0x454b35,null))[_0x7b9a('0x41')](handleError(_0x454b35,null));};exports[_0x7b9a('0x42')]=function(_0x5088c7,_0x1d7957){return db[_0x7b9a('0x3a')]['create'](_0x5088c7['body'],{})['then'](function(_0x1b3e65){var _0x30296e=_0x5088c7[_0x7b9a('0x43')][_0x7b9a('0x20')]({'plain':!![]});if(!_0x30296e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30296e[_0x7b9a('0x44')]===_0x7b9a('0x43')){var _0x287dea=_0x1b3e65[_0x7b9a('0x20')]({'plain':!![]});var _0x2d083b='Voicemails';return db[_0x7b9a('0x45')]['find']({'where':{'name':_0x2d083b,'userProfileId':_0x30296e[_0x7b9a('0x46')]},'raw':!![]})[_0x7b9a('0x1e')](function(_0x239146){if(_0x239146&&_0x239146[_0x7b9a('0x47')]===0x0){return db['UserProfileResource'][_0x7b9a('0x42')]({'name':_0x287dea[_0x7b9a('0x24')],'resourceId':_0x287dea['id'],'type':_0x239146[_0x7b9a('0x24')],'sectionId':_0x239146['id']},{})[_0x7b9a('0x1e')](function(){return _0x1b3e65;});}else{return _0x1b3e65;}})[_0x7b9a('0x41')](function(_0x3e2f1b){logger[_0x7b9a('0x48')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e2f1b);throw _0x3e2f1b;});}return _0x1b3e65;})['then'](respondWithResult(_0x1d7957,0xc9))['catch'](handleError(_0x1d7957,null));};exports[_0x7b9a('0x1d')]=function(_0x2f8929,_0x5a1b7d){if(_0x2f8929['body']['id']){delete _0x2f8929['body']['id'];}return db['VoiceMail'][_0x7b9a('0x40')]({'where':{'id':_0x2f8929[_0x7b9a('0x3f')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x5a1b7d,null))[_0x7b9a('0x1e')](saveUpdates(_0x2f8929[_0x7b9a('0x49')],null))[_0x7b9a('0x1e')](respondWithResult(_0x5a1b7d,null))[_0x7b9a('0x41')](handleError(_0x5a1b7d,null));};exports[_0x7b9a('0x1f')]=function(_0x5dc17e,_0x1f99f5){return db['VoiceMail'][_0x7b9a('0x40')]({'where':{'id':_0x5dc17e[_0x7b9a('0x3f')]['id']}})[_0x7b9a('0x1e')](handleEntityNotFound(_0x1f99f5,null))[_0x7b9a('0x1e')](removeEntity(_0x1f99f5,null))[_0x7b9a('0x41')](handleError(_0x1f99f5,null));};exports['getMessages']=function(_0x25ec82,_0x491804,_0x3d2df4){return db[_0x7b9a('0x3a')][_0x7b9a('0x4a')]({'where':{'id':_0x25ec82['params']['id']}})['then'](handleEntityNotFound(_0x491804,null))['then'](function(_0x4f6843){var _0x33375c;var _0x8a777f={},_0xb91099={};_0xb91099['model']=_[_0x7b9a('0x2b')](db[_0x7b9a('0x4b')][_0x7b9a('0x4c')]);_0xb91099[_0x7b9a('0x2c')]=_[_0x7b9a('0x2b')](_0x25ec82['query']);_0xb91099[_0x7b9a('0x35')]=_[_0x7b9a('0x2d')](_0xb91099[_0x7b9a('0x2a')],_0xb91099['query']);_0x8a777f['attributes']=_['intersection'](_0xb91099[_0x7b9a('0x2a')],qs[_0x7b9a('0x2f')](_0x25ec82[_0x7b9a('0x2c')]['fields']));_0x8a777f[_0x7b9a('0x2e')]=_0x8a777f[_0x7b9a('0x2e')]['length']?_0x8a777f[_0x7b9a('0x2e')]:_0xb91099['model'];if(!_0x25ec82[_0x7b9a('0x2c')]['hasOwnProperty'](_0x7b9a('0x4d'))){_0x8a777f[_0x7b9a('0x18')]=qs[_0x7b9a('0x18')](_0x25ec82[_0x7b9a('0x2c')]['limit']);_0x8a777f[_0x7b9a('0x17')]=qs[_0x7b9a('0x17')](_0x25ec82[_0x7b9a('0x2c')][_0x7b9a('0x17')]);}_0x8a777f['order']=qs[_0x7b9a('0x33')](_0x25ec82['query'][_0x7b9a('0x33')]);_0x8a777f['where']=qs[_0x7b9a('0x35')](_['pick'](_0x25ec82['query'],_0xb91099['filters']));if(_0x25ec82['query'][_0x7b9a('0x38')]){_0x8a777f[_0x7b9a('0x34')]=_[_0x7b9a('0x37')](_0x8a777f[_0x7b9a('0x34')],{'$or':_['map'](_0x8a777f[_0x7b9a('0x2e')],function(_0x4b9462){var _0x50b6f1={};_0x50b6f1[_0x4b9462]={'$like':'%'+_0x25ec82[_0x7b9a('0x2c')]['filter']+'%'};return _0x50b6f1;})});}_0x8a777f['where']=_[_0x7b9a('0x37')](_0x8a777f[_0x7b9a('0x34')],{'mailboxuser':_0x4f6843['mailbox']});_0x8a777f=_[_0x7b9a('0x37')]({},_0x8a777f,_0x25ec82['options']);return db[_0x7b9a('0x4b')][_0x7b9a('0x4e')](_0x8a777f)[_0x7b9a('0x1e')](respondWithFilteredResult(_0x491804,_0x8a777f));})['catch'](handleError(_0x491804,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 0df0ed8..a287145 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 _0x88fe=['context','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox'];(function(_0x3da2cd,_0x59aa26){var _0x160082=function(_0x36e81b){while(--_0x36e81b){_0x3da2cd['push'](_0x3da2cd['shift']());}};_0x160082(++_0x59aa26);}(_0x88fe,0x187));var _0xe88f=function(_0xaec935,_0x5f3d12){_0xaec935=_0xaec935-0x0;var _0x28a8e1=_0x88fe[_0xaec935];return _0x28a8e1;};'use strict';var _=require('lodash');var util=require(_0xe88f('0x0'));var logger=require(_0xe88f('0x1'))(_0xe88f('0x2'));var moment=require(_0xe88f('0x3'));var BPromise=require(_0xe88f('0x4'));var rp=require(_0xe88f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe88f('0x6'));var attributes=require(_0xe88f('0x7'));module[_0xe88f('0x8')]=function(_0x3dd8b6,_0x3a6661){return _0x3dd8b6[_0xe88f('0x9')](_0xe88f('0xa'),attributes,{'tableName':_0xe88f('0xb'),'paranoid':![],'indexes':[{'name':_0xe88f('0xc'),'fields':[_0xe88f('0xd'),_0xe88f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11ca=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3fad77,_0x35b5f9){var _0x2eb632=function(_0xc0f8a5){while(--_0xc0f8a5){_0x3fad77['push'](_0x3fad77['shift']());}};_0x2eb632(++_0x35b5f9);}(_0x11ca,0x1d9));var _0xa11c=function(_0x4ac10a,_0x12f0b4){_0x4ac10a=_0x4ac10a-0x0;var _0x1bee4=_0x11ca[_0x4ac10a];return _0x1bee4;};'use strict';var _=require(_0xa11c('0x0'));var util=require(_0xa11c('0x1'));var logger=require(_0xa11c('0x2'))(_0xa11c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa11c('0x4'));var fs=require('fs');var path=require(_0xa11c('0x5'));var rimraf=require(_0xa11c('0x6'));var config=require(_0xa11c('0x7'));var attributes=require(_0xa11c('0x8'));module[_0xa11c('0x9')]=function(_0x31a966,_0x47f53c){return _0x31a966[_0xa11c('0xa')](_0xa11c('0xb'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xa11c('0xc'),'fields':[_0xa11c('0xd'),_0xa11c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 805c89b..47926a0 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 _0xbb03=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','moment','bluebird','ioredis','../../mysqldb'];(function(_0x561f4c,_0x1d434d){var _0x3c45f3=function(_0x56e6da){while(--_0x56e6da){_0x561f4c['push'](_0x561f4c['shift']());}};_0x3c45f3(++_0x1d434d);}(_0xbb03,0x96));var _0x3bb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb03[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3bb0('0x0'));var BPromise=require(_0x3bb0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3bb0('0x2'));var db=require(_0x3bb0('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3bb0('0x4'));var config=require(_0x3bb0('0x5'));var jayson=require(_0x3bb0('0x6'));var client=jayson[_0x3bb0('0x7')][_0x3bb0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ea0dc,_0x1b9bd0,_0x5b4579){return new BPromise(function(_0x12f12e,_0x147211){return client[_0x3bb0('0x9')](_0x5ea0dc,_0x5b4579)[_0x3bb0('0xa')](function(_0x2f0bdc){logger[_0x3bb0('0xb')]('VoiceMail,\x20%s,\x20%s',_0x1b9bd0,_0x3bb0('0xc'));logger[_0x3bb0('0xd')](_0x3bb0('0xe'),_0x1b9bd0,_0x3bb0('0xc'),JSON[_0x3bb0('0xf')](_0x2f0bdc));if(_0x2f0bdc['error']){if(_0x2f0bdc[_0x3bb0('0x10')][_0x3bb0('0x11')]===0x1f4){logger[_0x3bb0('0x10')]('VoiceMail,\x20%s,\x20%s',_0x1b9bd0,_0x2f0bdc[_0x3bb0('0x10')][_0x3bb0('0x12')]);return _0x147211(_0x2f0bdc[_0x3bb0('0x10')]['message']);}logger[_0x3bb0('0x10')](_0x3bb0('0x13'),_0x1b9bd0,_0x2f0bdc['error'][_0x3bb0('0x12')]);return _0x12f12e(_0x2f0bdc[_0x3bb0('0x10')][_0x3bb0('0x12')]);}else{logger['info'](_0x3bb0('0x13'),_0x1b9bd0,_0x3bb0('0xc'));_0x12f12e(_0x2f0bdc[_0x3bb0('0x14')][_0x3bb0('0x12')]);}})[_0x3bb0('0x15')](function(_0x15040e){logger['error']('VoiceMail,\x20%s,\x20%s',_0x1b9bd0,_0x15040e);_0x147211(_0x15040e);});});} \ No newline at end of file +var _0x6c4b=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x6c4b,0x97));var _0xb6c4=function(_0x48de63,_0xbc0033){_0x48de63=_0x48de63-0x0;var _0x581139=_0x6c4b[_0x48de63];return _0x581139;};'use strict';var _=require(_0xb6c4('0x0'));var util=require(_0xb6c4('0x1'));var moment=require(_0xb6c4('0x2'));var BPromise=require(_0xb6c4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6c4('0x4'))['db'];var utils=require(_0xb6c4('0x5'));var logger=require(_0xb6c4('0x6'))(_0xb6c4('0x7'));var config=require('../../config/environment');var jayson=require(_0xb6c4('0x8'));var client=jayson[_0xb6c4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x478220,_0x240d58,_0x534404){return new BPromise(function(_0x48a0b8,_0x2912bd){return client[_0xb6c4('0xa')](_0x478220,_0x534404)[_0xb6c4('0xb')](function(_0x794104){logger[_0xb6c4('0xc')](_0xb6c4('0xd'),_0x240d58,'request\x20sent');logger[_0xb6c4('0xe')](_0xb6c4('0xf'),_0x240d58,_0xb6c4('0x10'),JSON[_0xb6c4('0x11')](_0x794104));if(_0x794104[_0xb6c4('0x12')]){if(_0x794104['error'][_0xb6c4('0x13')]===0x1f4){logger[_0xb6c4('0x12')]('VoiceMail,\x20%s,\x20%s',_0x240d58,_0x794104[_0xb6c4('0x12')][_0xb6c4('0x14')]);return _0x2912bd(_0x794104[_0xb6c4('0x12')][_0xb6c4('0x14')]);}logger[_0xb6c4('0x12')]('VoiceMail,\x20%s,\x20%s',_0x240d58,_0x794104['error']['message']);return _0x48a0b8(_0x794104[_0xb6c4('0x12')][_0xb6c4('0x14')]);}else{logger[_0xb6c4('0xc')](_0xb6c4('0xd'),_0x240d58,_0xb6c4('0x10'));_0x48a0b8(_0x794104[_0xb6c4('0x15')][_0xb6c4('0x14')]);}})['catch'](function(_0x444a9b){logger[_0xb6c4('0x12')](_0xb6c4('0xd'),_0x240d58,_0x444a9b);_0x2912bd(_0x444a9b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index bd76221..0fde707 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 _0x6adc=['post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','/:id','get','/:id/download','download'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x6adc,0x17e));var _0xc6ad=function(_0x3a5541,_0x34dc2e){_0x3a5541=_0x3a5541-0x0;var _0x549d59=_0x6adc[_0x3a5541];return _0x549d59;};'use strict';var multer=require(_0xc6ad('0x0'));var util=require(_0xc6ad('0x1'));var path=require(_0xc6ad('0x2'));var timeout=require(_0xc6ad('0x3'));var express=require(_0xc6ad('0x4'));var router=express[_0xc6ad('0x5')]();var fs_extra=require(_0xc6ad('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc6ad('0x7'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0xc6ad('0x8')](),controller[_0xc6ad('0x9')]);router['get'](_0xc6ad('0xa'),auth[_0xc6ad('0x8')](),controller['show']);router[_0xc6ad('0xb')](_0xc6ad('0xc'),auth[_0xc6ad('0x8')](),controller[_0xc6ad('0xd')]);router[_0xc6ad('0xe')]('/',auth[_0xc6ad('0x8')](),controller[_0xc6ad('0xf')]);router[_0xc6ad('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xc6ad('0x11')]);router['delete'](_0xc6ad('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x361f=['index','get','isAuthenticated','show','/:id/download','download','create','/:id','update','delete','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x361f,0xbe));var _0xf361=function(_0x11d2f6,_0x3c0e83){_0x11d2f6=_0x11d2f6-0x0;var _0x2d6257=_0x361f[_0x11d2f6];return _0x2d6257;};'use strict';var multer=require(_0xf361('0x0'));var util=require(_0xf361('0x1'));var path=require(_0xf361('0x2'));var timeout=require(_0xf361('0x3'));var express=require(_0xf361('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf361('0x5'));var config=require(_0xf361('0x6'));var controller=require(_0xf361('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xf361('0x8')]);router[_0xf361('0x9')]('/:id',auth[_0xf361('0xa')](),controller[_0xf361('0xb')]);router[_0xf361('0x9')](_0xf361('0xc'),auth['isAuthenticated'](),controller[_0xf361('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf361('0xe')]);router['put'](_0xf361('0xf'),auth[_0xf361('0xa')](),controller[_0xf361('0x10')]);router[_0xf361('0x11')](_0xf361('0xf'),auth[_0xf361('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6212909..b59e87f 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 _0x0542=['literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x37f68f,_0xc576e5){var _0x5bba69=function(_0x45174e){while(--_0x45174e){_0x37f68f['push'](_0x37f68f['shift']());}};_0x5bba69(++_0xc576e5);}(_0x0542,0x12d));var _0x2054=function(_0x26ae63,_0x321902){_0x26ae63=_0x26ae63-0x0;var _0x318359=_0x0542[_0x26ae63];return _0x318359;};'use strict';var Sequelize=require(_0x2054('0x0'));module[_0x2054('0x1')]={'name':{'type':Sequelize[_0x2054('0x2')],'get':function(_0x1f0c8b){return this[_0x2054('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x2054('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2054('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x2054('0x6')](_0x2054('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x2054('0x8'),'defaultValue':Sequelize[_0x2054('0x9')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0xed5c=['long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xed5c,0x81));var _0xced5=function(_0x4a80e2,_0x27c5e4){_0x4a80e2=_0x4a80e2-0x0;var _0x1507e5=_0xed5c[_0x4a80e2];return _0x1507e5;};'use strict';var Sequelize=require(_0xced5('0x0'));module[_0xced5('0x1')]={'name':{'type':Sequelize[_0xced5('0x2')],'get':function(_0x21fae7){return this[_0xced5('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xced5('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xced5('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0xced5('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xced5('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xced5('0x5')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xced5('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xced5('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xced5('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xced5('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xced5('0x5')],'defaultValue':''},'stamp':{'type':_0xced5('0x7'),'defaultValue':Sequelize[_0xced5('0x8')]('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 00c7341..f38da19 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 _0xe122=['mustache','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','VoiceMailMessage','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','catch','create','body','find','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xe122,0xf3));var _0x2e12=function(_0xe9f60d,_0x7f0501){_0xe9f60d=_0xe9f60d-0x0;var _0x4e91a3=_0xe122[_0xe9f60d];return _0x4e91a3;};'use strict';var emlformat=require(_0x2e12('0x0'));var rimraf=require(_0x2e12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e12('0x2'));var rp=require(_0x2e12('0x3'));var moment=require(_0x2e12('0x4'));var BPromise=require(_0x2e12('0x5'));var Mustache=require(_0x2e12('0x6'));var util=require('util');var path=require(_0x2e12('0x7'));var sox=require(_0x2e12('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2e12('0x9'));var _=require(_0x2e12('0xa'));var squel=require(_0x2e12('0xb'));var crypto=require('crypto');var jsforce=require(_0x2e12('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2e12('0xd'));var querystring=require(_0x2e12('0xe'));var Papa=require(_0x2e12('0xf'));var Redis=require(_0x2e12('0x10'));var authService=require(_0x2e12('0x11'));var qs=require(_0x2e12('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e12('0x13'))(_0x2e12('0x14'));var utils=require(_0x2e12('0x15'));var config=require(_0x2e12('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e12('0x17'))['db'];function respondWithStatusCode(_0x967361,_0x2922e2){_0x2922e2=_0x2922e2||0xcc;return function(_0x2a8715){if(_0x2a8715){return _0x967361['sendStatus'](_0x2922e2);}return _0x967361['status'](_0x2922e2)['end']();};}function respondWithResult(_0x457832,_0x11a922){_0x11a922=_0x11a922||0xc8;return function(_0x214d3c){if(_0x214d3c){return _0x457832[_0x2e12('0x18')](_0x11a922)['json'](_0x214d3c);}};}function respondWithFilteredResult(_0x2a1de3,_0x38320b){return function(_0x44ce89){if(_0x44ce89){var _0x1ffb84=typeof _0x38320b[_0x2e12('0x19')]==='undefined'&&typeof _0x38320b[_0x2e12('0x1a')]===_0x2e12('0x1b');var _0xdb324c=_0x44ce89[_0x2e12('0x1c')];var _0x410b15=_0x1ffb84?0x0:_0x38320b[_0x2e12('0x19')];var _0x422c31=_0x1ffb84?_0x44ce89[_0x2e12('0x1c')]:_0x38320b[_0x2e12('0x19')]+_0x38320b[_0x2e12('0x1a')];var _0x3e16f1;if(_0x422c31>=_0xdb324c){_0x422c31=_0xdb324c;_0x3e16f1=0xc8;}else{_0x3e16f1=0xce;}_0x2a1de3['status'](_0x3e16f1);return _0x2a1de3[_0x2e12('0x1d')](_0x2e12('0x1e'),_0x410b15+'-'+_0x422c31+'/'+_0xdb324c)[_0x2e12('0x1f')](_0x44ce89);}return null;};}function patchUpdates(_0x1b7739){return function(_0x5ea598){try{jsonpatch[_0x2e12('0x20')](_0x5ea598,_0x1b7739,!![]);}catch(_0x495d93){return BPromise[_0x2e12('0x21')](_0x495d93);}return _0x5ea598[_0x2e12('0x22')]();};}function saveUpdates(_0x2792a6,_0x399ed4){return function(_0x37c505){if(_0x37c505){return _0x37c505[_0x2e12('0x23')](_0x2792a6)[_0x2e12('0x24')](function(_0xe5b05b){return _0xe5b05b;});}return null;};}function removeEntity(_0x412175,_0x42d60d){return function(_0x26e1c6){if(_0x26e1c6){return _0x26e1c6[_0x2e12('0x25')]()[_0x2e12('0x24')](function(){_0x412175[_0x2e12('0x18')](0xcc)[_0x2e12('0x26')]();});}};}function handleEntityNotFound(_0x5f4431,_0x15c6cc){return function(_0x3a5d36){if(!_0x3a5d36){_0x5f4431[_0x2e12('0x27')](0x194);}return _0x3a5d36;};}function handleError(_0x4edce4,_0x15e5f3){_0x15e5f3=_0x15e5f3||0x1f4;return function(_0x28624d){logger[_0x2e12('0x28')](_0x28624d['stack']);if(_0x28624d[_0x2e12('0x29')]){delete _0x28624d[_0x2e12('0x29')];}_0x4edce4[_0x2e12('0x18')](_0x15e5f3)[_0x2e12('0x2a')](_0x28624d);};}exports['index']=function(_0x1edee6,_0x434992){var _0x16933d={},_0x397bf6={},_0x526041={'count':0x0,'rows':[]};var _0x1db61f=_['map'](db[_0x2e12('0x2b')][_0x2e12('0x2c')],function(_0xdf9a02){return{'name':_0xdf9a02[_0x2e12('0x2d')],'type':_0xdf9a02[_0x2e12('0x2e')]['key']};});_0x397bf6[_0x2e12('0x2f')]=_['differenceBy'](_[_0x2e12('0x30')](_0x1db61f,'name'),['name']);_0x397bf6[_0x2e12('0x31')]=_[_0x2e12('0x32')](_0x1edee6[_0x2e12('0x31')]);_0x397bf6[_0x2e12('0x33')]=_[_0x2e12('0x34')](_0x397bf6['model'],_0x397bf6['query']);_0x16933d['attributes']=_['intersection'](_0x397bf6['model'],qs[_0x2e12('0x35')](_0x1edee6[_0x2e12('0x31')][_0x2e12('0x35')]));_0x16933d[_0x2e12('0x36')]=_0x16933d['attributes'][_0x2e12('0x37')]?_0x16933d[_0x2e12('0x36')]:_0x397bf6[_0x2e12('0x2f')];if(!_0x1edee6[_0x2e12('0x31')][_0x2e12('0x38')]('nolimit')){_0x16933d['limit']=qs[_0x2e12('0x1a')](_0x1edee6['query'][_0x2e12('0x1a')]);_0x16933d[_0x2e12('0x19')]=qs[_0x2e12('0x19')](_0x1edee6['query']['offset']);}_0x16933d[_0x2e12('0x39')]=qs[_0x2e12('0x3a')](_0x1edee6[_0x2e12('0x31')][_0x2e12('0x3a')]);_0x16933d[_0x2e12('0x3b')]=qs[_0x2e12('0x33')](_[_0x2e12('0x3c')](_0x1edee6[_0x2e12('0x31')],_0x397bf6[_0x2e12('0x33')]),_0x1db61f);if(_0x1edee6[_0x2e12('0x31')][_0x2e12('0x3d')]){_0x16933d[_0x2e12('0x3b')]=_[_0x2e12('0x3e')](_0x16933d[_0x2e12('0x3b')],{'$or':_['map'](_0x1db61f,function(_0x55b20e){if(_0x55b20e[_0x2e12('0x2e')]!==_0x2e12('0x3f')){var _0x5ce744={};_0x5ce744[_0x55b20e['name']]={'$like':'%'+_0x1edee6[_0x2e12('0x31')][_0x2e12('0x3d')]+'%'};return _0x5ce744;}})});}_0x16933d=_[_0x2e12('0x3e')]({},_0x16933d,_0x1edee6[_0x2e12('0x40')]);var _0x28a798={'where':_0x16933d[_0x2e12('0x3b')]};return db[_0x2e12('0x2b')]['count'](_0x28a798)['then'](function(_0x59d2d5){_0x526041[_0x2e12('0x1c')]=_0x59d2d5;if(_0x1edee6[_0x2e12('0x31')]['includeAll']){_0x16933d[_0x2e12('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x2e12('0x42')](_0x16933d);})[_0x2e12('0x24')](function(_0x4c33f0){_0x526041[_0x2e12('0x43')]=_0x4c33f0;return _0x526041;})['then'](respondWithFilteredResult(_0x434992,_0x16933d))['catch'](handleError(_0x434992,null));};exports[_0x2e12('0x44')]=function(_0xccf4f2,_0x2cebeb){var _0x40debf={'raw':!![],'where':{'id':_0xccf4f2[_0x2e12('0x45')]['id']}},_0x147913={};_0x147913[_0x2e12('0x2f')]=_['keys'](db[_0x2e12('0x2b')][_0x2e12('0x2c')]);_0x147913[_0x2e12('0x31')]=_[_0x2e12('0x32')](_0xccf4f2['query']);_0x147913[_0x2e12('0x33')]=_[_0x2e12('0x34')](_0x147913[_0x2e12('0x2f')],_0x147913[_0x2e12('0x31')]);_0x40debf['attributes']=_[_0x2e12('0x34')](_0x147913['model'],qs[_0x2e12('0x35')](_0xccf4f2['query'][_0x2e12('0x35')]));_0x40debf[_0x2e12('0x36')]=_0x40debf[_0x2e12('0x36')]['length']?_0x40debf[_0x2e12('0x36')]:_0x147913[_0x2e12('0x2f')];if(_0xccf4f2[_0x2e12('0x31')][_0x2e12('0x46')]){_0x40debf[_0x2e12('0x41')]=[{'all':!![]}];}_0x40debf=_[_0x2e12('0x3e')]({},_0x40debf,_0xccf4f2['options']);return db[_0x2e12('0x2b')]['find'](_0x40debf)[_0x2e12('0x24')](handleEntityNotFound(_0x2cebeb,null))['then'](respondWithResult(_0x2cebeb,null))[_0x2e12('0x47')](handleError(_0x2cebeb,null));};exports[_0x2e12('0x48')]=function(_0x39f4e5,_0x32ce12){return db[_0x2e12('0x2b')]['create'](_0x39f4e5[_0x2e12('0x49')],{})[_0x2e12('0x24')](respondWithResult(_0x32ce12,0xc9))[_0x2e12('0x47')](handleError(_0x32ce12,null));};exports[_0x2e12('0x23')]=function(_0x29b16b,_0x4ce71d){if(_0x29b16b[_0x2e12('0x49')]['id']){delete _0x29b16b[_0x2e12('0x49')]['id'];}return db['VoiceMailMessage'][_0x2e12('0x4a')]({'where':{'id':_0x29b16b['params']['id']}})[_0x2e12('0x24')](handleEntityNotFound(_0x4ce71d,null))[_0x2e12('0x24')](saveUpdates(_0x29b16b['body'],null))[_0x2e12('0x24')](respondWithResult(_0x4ce71d,null))[_0x2e12('0x47')](handleError(_0x4ce71d,null));};exports['destroy']=function(_0x1b3371,_0x3d14a9){return db[_0x2e12('0x2b')][_0x2e12('0x4a')]({'where':{'id':_0x1b3371[_0x2e12('0x45')]['id']}})[_0x2e12('0x24')](handleEntityNotFound(_0x3d14a9,null))[_0x2e12('0x24')](removeEntity(_0x3d14a9,null))['catch'](handleError(_0x3d14a9,null));};exports[_0x2e12('0x4b')]=function(_0x3c2e2a,_0x3a2eaa,_0x51fb70){return db[_0x2e12('0x2b')][_0x2e12('0x4a')]({'where':{'id':_0x3c2e2a[_0x2e12('0x45')]['id']},'attributes':['id',_0x2e12('0x4c'),_0x2e12('0x4d')]})[_0x2e12('0x24')](handleEntityNotFound(_0x3a2eaa,null))[_0x2e12('0x24')](function(_0x503016){if(_0x503016){if(!_0x503016[_0x2e12('0x4c')]){throw new db['Sequelize'][(_0x2e12('0x4e'))](_0x2e12('0x4f'));}var _0x58f88e={'Content-Type':_0x2e12('0x50'),'Content-Disposition':'attachment'};if(_0x503016[_0x2e12('0x4d')]){_0x58f88e['Content-Disposition']=_0x2e12('0x51')+_0x503016[_0x2e12('0x4d')]+_0x2e12('0x52');}_0x3a2eaa['set'](_0x58f88e);return _0x3a2eaa['send'](new Buffer(_0x503016['recording']));}})[_0x2e12('0x47')](handleError(_0x3a2eaa,null));}; \ No newline at end of file +var _0x5508=['update','then','destroy','name','send','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','keys','query','filters','attributes','intersection','fields','length','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','body','download','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','recording','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save'];(function(_0x76d2ec,_0x45ea7c){var _0x540bdc=function(_0xf4d00a){while(--_0xf4d00a){_0x76d2ec['push'](_0x76d2ec['shift']());}};_0x540bdc(++_0x45ea7c);}(_0x5508,0x1d2));var _0x8550=function(_0x572262,_0x2988c1){_0x572262=_0x572262-0x0;var _0x29571d=_0x5508[_0x572262];return _0x29571d;};'use strict';var emlformat=require(_0x8550('0x0'));var rimraf=require(_0x8550('0x1'));var zipdir=require(_0x8550('0x2'));var jsonpatch=require(_0x8550('0x3'));var rp=require(_0x8550('0x4'));var moment=require(_0x8550('0x5'));var BPromise=require(_0x8550('0x6'));var Mustache=require(_0x8550('0x7'));var util=require(_0x8550('0x8'));var path=require(_0x8550('0x9'));var sox=require(_0x8550('0xa'));var csv=require(_0x8550('0xb'));var ejs=require(_0x8550('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8550('0xd'));var crypto=require(_0x8550('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8550('0xb'));var querystring=require(_0x8550('0xf'));var Papa=require(_0x8550('0x10'));var Redis=require(_0x8550('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8550('0x12'));var as=require(_0x8550('0x13'));var hardwareService=require(_0x8550('0x14'));var logger=require('../../config/logger')(_0x8550('0x15'));var utils=require(_0x8550('0x16'));var config=require(_0x8550('0x17'));var licenseUtil=require(_0x8550('0x18'));var db=require(_0x8550('0x19'))['db'];function respondWithStatusCode(_0x48daba,_0x45b31a){_0x45b31a=_0x45b31a||0xcc;return function(_0x3f59b3){if(_0x3f59b3){return _0x48daba[_0x8550('0x1a')](_0x45b31a);}return _0x48daba[_0x8550('0x1b')](_0x45b31a)[_0x8550('0x1c')]();};}function respondWithResult(_0x330573,_0x198109){_0x198109=_0x198109||0xc8;return function(_0x31d293){if(_0x31d293){return _0x330573[_0x8550('0x1b')](_0x198109)[_0x8550('0x1d')](_0x31d293);}};}function respondWithFilteredResult(_0x1c50a1,_0x3e79d3){return function(_0x4bc792){if(_0x4bc792){var _0x54f701=typeof _0x3e79d3[_0x8550('0x1e')]==='undefined'&&typeof _0x3e79d3[_0x8550('0x1f')]===_0x8550('0x20');var _0x42b54d=_0x4bc792[_0x8550('0x21')];var _0xd914e3=_0x54f701?0x0:_0x3e79d3[_0x8550('0x1e')];var _0xfa934c=_0x54f701?_0x4bc792['count']:_0x3e79d3['offset']+_0x3e79d3[_0x8550('0x1f')];var _0xca770b;if(_0xfa934c>=_0x42b54d){_0xfa934c=_0x42b54d;_0xca770b=0xc8;}else{_0xca770b=0xce;}_0x1c50a1[_0x8550('0x1b')](_0xca770b);return _0x1c50a1[_0x8550('0x22')](_0x8550('0x23'),_0xd914e3+'-'+_0xfa934c+'/'+_0x42b54d)[_0x8550('0x1d')](_0x4bc792);}return null;};}function patchUpdates(_0x2a7a8f){return function(_0x8f63f3){try{jsonpatch['apply'](_0x8f63f3,_0x2a7a8f,!![]);}catch(_0x254274){return BPromise[_0x8550('0x24')](_0x254274);}return _0x8f63f3[_0x8550('0x25')]();};}function saveUpdates(_0x38dbfb,_0x3bd059){return function(_0x5475be){if(_0x5475be){return _0x5475be[_0x8550('0x26')](_0x38dbfb)[_0x8550('0x27')](function(_0x314bb2){return _0x314bb2;});}return null;};}function removeEntity(_0x4d200f,_0x1c36ab){return function(_0x4357b4){if(_0x4357b4){return _0x4357b4[_0x8550('0x28')]()[_0x8550('0x27')](function(){_0x4d200f[_0x8550('0x1b')](0xcc)[_0x8550('0x1c')]();});}};}function handleEntityNotFound(_0x4640bc,_0x196062){return function(_0x289349){if(!_0x289349){_0x4640bc[_0x8550('0x1a')](0x194);}return _0x289349;};}function handleError(_0xf92a32,_0x4be0c4){_0x4be0c4=_0x4be0c4||0x1f4;return function(_0x5f30ec){logger['error'](_0x5f30ec['stack']);if(_0x5f30ec[_0x8550('0x29')]){delete _0x5f30ec[_0x8550('0x29')];}_0xf92a32[_0x8550('0x1b')](_0x4be0c4)[_0x8550('0x2a')](_0x5f30ec);};}exports[_0x8550('0x2b')]=function(_0x5213b8,_0x5302e8){var _0x304c5b={},_0x5574ed={},_0x3e41f2={'count':0x0,'rows':[]};var _0x44acaf=_[_0x8550('0x2c')](db[_0x8550('0x2d')][_0x8550('0x2e')],function(_0x2f9e19){return{'name':_0x2f9e19['fieldName'],'type':_0x2f9e19[_0x8550('0x2f')][_0x8550('0x30')]};});_0x5574ed[_0x8550('0x31')]=_[_0x8550('0x32')](_[_0x8550('0x2c')](_0x44acaf,'name'),[_0x8550('0x29')]);_0x5574ed['query']=_[_0x8550('0x33')](_0x5213b8[_0x8550('0x34')]);_0x5574ed[_0x8550('0x35')]=_['intersection'](_0x5574ed[_0x8550('0x31')],_0x5574ed['query']);_0x304c5b[_0x8550('0x36')]=_[_0x8550('0x37')](_0x5574ed['model'],qs[_0x8550('0x38')](_0x5213b8[_0x8550('0x34')][_0x8550('0x38')]));_0x304c5b['attributes']=_0x304c5b[_0x8550('0x36')][_0x8550('0x39')]?_0x304c5b[_0x8550('0x36')]:_0x5574ed[_0x8550('0x31')];if(!_0x5213b8['query']['hasOwnProperty']('nolimit')){_0x304c5b[_0x8550('0x1f')]=qs[_0x8550('0x1f')](_0x5213b8[_0x8550('0x34')][_0x8550('0x1f')]);_0x304c5b[_0x8550('0x1e')]=qs[_0x8550('0x1e')](_0x5213b8[_0x8550('0x34')][_0x8550('0x1e')]);}_0x304c5b[_0x8550('0x3a')]=qs[_0x8550('0x3b')](_0x5213b8[_0x8550('0x34')]['sort']);_0x304c5b[_0x8550('0x3c')]=qs[_0x8550('0x35')](_['pick'](_0x5213b8[_0x8550('0x34')],_0x5574ed[_0x8550('0x35')]),_0x44acaf);if(_0x5213b8['query'][_0x8550('0x3d')]){_0x304c5b[_0x8550('0x3c')]=_['merge'](_0x304c5b[_0x8550('0x3c')],{'$or':_[_0x8550('0x2c')](_0x44acaf,function(_0x5003b6){if(_0x5003b6[_0x8550('0x2f')]!==_0x8550('0x3e')){var _0x19b377={};_0x19b377[_0x5003b6[_0x8550('0x29')]]={'$like':'%'+_0x5213b8[_0x8550('0x34')][_0x8550('0x3d')]+'%'};return _0x19b377;}})});}_0x304c5b=_[_0x8550('0x3f')]({},_0x304c5b,_0x5213b8[_0x8550('0x40')]);var _0x3f214a={'where':_0x304c5b['where']};return db['VoiceMailMessage']['count'](_0x3f214a)[_0x8550('0x27')](function(_0x4d477f){_0x3e41f2[_0x8550('0x21')]=_0x4d477f;if(_0x5213b8[_0x8550('0x34')]['includeAll']){_0x304c5b[_0x8550('0x41')]=[{'all':!![]}];}return db[_0x8550('0x2d')][_0x8550('0x42')](_0x304c5b);})[_0x8550('0x27')](function(_0x2e544f){_0x3e41f2[_0x8550('0x43')]=_0x2e544f;return _0x3e41f2;})[_0x8550('0x27')](respondWithFilteredResult(_0x5302e8,_0x304c5b))[_0x8550('0x44')](handleError(_0x5302e8,null));};exports[_0x8550('0x45')]=function(_0x33dcdf,_0x39977b){var _0x16d5bb={'raw':!![],'where':{'id':_0x33dcdf[_0x8550('0x46')]['id']}},_0x5c9147={};_0x5c9147['model']=_[_0x8550('0x33')](db[_0x8550('0x2d')][_0x8550('0x2e')]);_0x5c9147[_0x8550('0x34')]=_[_0x8550('0x33')](_0x33dcdf[_0x8550('0x34')]);_0x5c9147[_0x8550('0x35')]=_[_0x8550('0x37')](_0x5c9147[_0x8550('0x31')],_0x5c9147['query']);_0x16d5bb[_0x8550('0x36')]=_[_0x8550('0x37')](_0x5c9147['model'],qs[_0x8550('0x38')](_0x33dcdf[_0x8550('0x34')]['fields']));_0x16d5bb[_0x8550('0x36')]=_0x16d5bb[_0x8550('0x36')][_0x8550('0x39')]?_0x16d5bb['attributes']:_0x5c9147[_0x8550('0x31')];if(_0x33dcdf['query'][_0x8550('0x47')]){_0x16d5bb[_0x8550('0x41')]=[{'all':!![]}];}_0x16d5bb=_[_0x8550('0x3f')]({},_0x16d5bb,_0x33dcdf['options']);return db[_0x8550('0x2d')][_0x8550('0x48')](_0x16d5bb)['then'](handleEntityNotFound(_0x39977b,null))['then'](respondWithResult(_0x39977b,null))['catch'](handleError(_0x39977b,null));};exports['create']=function(_0x269fac,_0x47923a){return db['VoiceMailMessage']['create'](_0x269fac[_0x8550('0x49')],{})[_0x8550('0x27')](respondWithResult(_0x47923a,0xc9))[_0x8550('0x44')](handleError(_0x47923a,null));};exports[_0x8550('0x26')]=function(_0x50aa45,_0x41eb72){if(_0x50aa45['body']['id']){delete _0x50aa45['body']['id'];}return db['VoiceMailMessage'][_0x8550('0x48')]({'where':{'id':_0x50aa45['params']['id']}})[_0x8550('0x27')](handleEntityNotFound(_0x41eb72,null))['then'](saveUpdates(_0x50aa45[_0x8550('0x49')],null))[_0x8550('0x27')](respondWithResult(_0x41eb72,null))[_0x8550('0x44')](handleError(_0x41eb72,null));};exports['destroy']=function(_0x5ec558,_0x3b85a1){return db['VoiceMailMessage'][_0x8550('0x48')]({'where':{'id':_0x5ec558['params']['id']}})[_0x8550('0x27')](handleEntityNotFound(_0x3b85a1,null))[_0x8550('0x27')](removeEntity(_0x3b85a1,null))['catch'](handleError(_0x3b85a1,null));};exports[_0x8550('0x4a')]=function(_0x21486b,_0x4dc2b4,_0x20004f){return db['VoiceMailMessage'][_0x8550('0x48')]({'where':{'id':_0x21486b[_0x8550('0x46')]['id']},'attributes':['id','recording','msg_id']})[_0x8550('0x27')](handleEntityNotFound(_0x4dc2b4,null))[_0x8550('0x27')](function(_0x1de7b7){if(_0x1de7b7){if(!_0x1de7b7['recording']){throw new db['Sequelize'][(_0x8550('0x4b'))](_0x8550('0x4c'));}var _0x1969c3={'Content-Type':_0x8550('0x4d'),'Content-Disposition':_0x8550('0x4e')};if(_0x1de7b7[_0x8550('0x4f')]){_0x1969c3[_0x8550('0x50')]=_0x8550('0x51')+_0x1de7b7[_0x8550('0x4f')]+_0x8550('0x52');}_0x4dc2b4[_0x8550('0x22')](_0x1969c3);return _0x4dc2b4[_0x8550('0x2a')](new Buffer(_0x1de7b7[_0x8550('0x53')]));}})[_0x8550('0x44')](handleError(_0x4dc2b4,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 8ab04f9..e69682a 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 _0x0832=['request-promise','path','rimraf','../../config/environment','exports','define','dir','util','api','moment'];(function(_0x162f05,_0x328e0f){var _0x54f59a=function(_0x2cf002){while(--_0x2cf002){_0x162f05['push'](_0x162f05['shift']());}};_0x54f59a(++_0x328e0f);}(_0x0832,0x129));var _0x2083=function(_0x1a4b0b,_0x20698c){_0x1a4b0b=_0x1a4b0b-0x0;var _0xe5b4ae=_0x0832[_0x1a4b0b];return _0xe5b4ae;};'use strict';var _=require('lodash');var util=require(_0x2083('0x0'));var logger=require('../../config/logger')(_0x2083('0x1'));var moment=require(_0x2083('0x2'));var BPromise=require('bluebird');var rp=require(_0x2083('0x3'));var fs=require('fs');var path=require(_0x2083('0x4'));var rimraf=require(_0x2083('0x5'));var config=require(_0x2083('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x2083('0x7')]=function(_0x474946,_0x5771ba){return _0x474946[_0x2083('0x8')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x2083('0x9'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x6298=['../../config/environment','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','moment','path'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x6298,0x1dc));var _0x8629=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6298[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8629('0x0'))(_0x8629('0x1'));var moment=require(_0x8629('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8629('0x3'));var rimraf=require('rimraf');var config=require(_0x8629('0x4'));var attributes=require('./voiceMailMessage.attributes');module[_0x8629('0x5')]=function(_0x2f7c2d,_0x25710c){return _0x2f7c2d[_0x8629('0x6')](_0x8629('0x7'),attributes,{'tableName':_0x8629('0x8'),'paranoid':![],'indexes':[{'name':_0x8629('0x9'),'fields':[_0x8629('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 76f84a8..223e883 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 _0xf7d8=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','util','moment'];(function(_0x4b3153,_0x51d21d){var _0x1d98b5=function(_0x33c622){while(--_0x33c622){_0x4b3153['push'](_0x4b3153['shift']());}};_0x1d98b5(++_0x51d21d);}(_0xf7d8,0x1c6));var _0x8f7d=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0xf7d8[_0x525af9];return _0x129fbf;};'use strict';var _=require('lodash');var util=require(_0x8f7d('0x0'));var moment=require(_0x8f7d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f7d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f7d('0x3'))['db'];var utils=require(_0x8f7d('0x4'));var logger=require('../../config/logger')(_0x8f7d('0x5'));var config=require(_0x8f7d('0x6'));var jayson=require(_0x8f7d('0x7'));var client=jayson[_0x8f7d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52dd7f,_0x17cc97,_0x42f550){return new BPromise(function(_0x488877,_0x35d48b){return client[_0x8f7d('0x9')](_0x52dd7f,_0x42f550)[_0x8f7d('0xa')](function(_0x56c38c){logger['info'](_0x8f7d('0xb'),_0x17cc97,_0x8f7d('0xc'));logger[_0x8f7d('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x17cc97,'request\x20sent',JSON['stringify'](_0x56c38c));if(_0x56c38c[_0x8f7d('0xe')]){if(_0x56c38c[_0x8f7d('0xe')][_0x8f7d('0xf')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x17cc97,_0x56c38c[_0x8f7d('0xe')]['message']);return _0x35d48b(_0x56c38c['error'][_0x8f7d('0x10')]);}logger[_0x8f7d('0xe')](_0x8f7d('0xb'),_0x17cc97,_0x56c38c[_0x8f7d('0xe')]['message']);return _0x488877(_0x56c38c[_0x8f7d('0xe')][_0x8f7d('0x10')]);}else{logger[_0x8f7d('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x17cc97,_0x8f7d('0xc'));_0x488877(_0x56c38c[_0x8f7d('0x12')][_0x8f7d('0x10')]);}})['catch'](function(_0xfe9256){logger[_0x8f7d('0xe')](_0x8f7d('0xb'),_0x17cc97,_0xfe9256);_0x35d48b(_0xfe9256);});});} \ No newline at end of file +var _0x6bb6=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x4059b5,_0x4b9fab){var _0x277d0a=function(_0x455cf2){while(--_0x455cf2){_0x4059b5['push'](_0x4059b5['shift']());}};_0x277d0a(++_0x4b9fab);}(_0x6bb6,0xb8));var _0x66bb=function(_0x2e3681,_0x23ef81){_0x2e3681=_0x2e3681-0x0;var _0x4b8c22=_0x6bb6[_0x2e3681];return _0x4b8c22;};'use strict';var _=require(_0x66bb('0x0'));var util=require(_0x66bb('0x1'));var moment=require(_0x66bb('0x2'));var BPromise=require(_0x66bb('0x3'));var rs=require(_0x66bb('0x4'));var fs=require('fs');var Redis=require(_0x66bb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x66bb('0x6'));var logger=require(_0x66bb('0x7'))(_0x66bb('0x8'));var config=require(_0x66bb('0x9'));var jayson=require(_0x66bb('0xa'));var client=jayson[_0x66bb('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a54b9,_0x2dfc48,_0x3f2c1d){return new BPromise(function(_0x4e783d,_0x5c9b35){return client[_0x66bb('0xc')](_0x3a54b9,_0x3f2c1d)[_0x66bb('0xd')](function(_0xde5b83){logger[_0x66bb('0xe')](_0x66bb('0xf'),_0x2dfc48,_0x66bb('0x10'));logger['debug'](_0x66bb('0x11'),_0x2dfc48,_0x66bb('0x10'),JSON[_0x66bb('0x12')](_0xde5b83));if(_0xde5b83[_0x66bb('0x13')]){if(_0xde5b83[_0x66bb('0x13')]['code']===0x1f4){logger[_0x66bb('0x13')](_0x66bb('0xf'),_0x2dfc48,_0xde5b83[_0x66bb('0x13')][_0x66bb('0x14')]);return _0x5c9b35(_0xde5b83[_0x66bb('0x13')]['message']);}logger['error'](_0x66bb('0xf'),_0x2dfc48,_0xde5b83[_0x66bb('0x13')][_0x66bb('0x14')]);return _0x4e783d(_0xde5b83['error'][_0x66bb('0x14')]);}else{logger[_0x66bb('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x2dfc48,_0x66bb('0x10'));_0x4e783d(_0xde5b83[_0x66bb('0x15')]['message']);}})[_0x66bb('0x16')](function(_0x4d6737){logger[_0x66bb('0x13')](_0x66bb('0xf'),_0x2dfc48,_0x4d6737);_0x5c9b35(_0x4d6737);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index f26b4d4..b65f13d 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 _0x54e3=['update','delete','destroy','/:id/sounds/:id2','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','/:id/sounds','getSounds','post','create','put'];(function(_0x44093b,_0xc7f5a7){var _0x46c798=function(_0x3ac7d0){while(--_0x3ac7d0){_0x44093b['push'](_0x44093b['shift']());}};_0x46c798(++_0xc7f5a7);}(_0x54e3,0x180));var _0x354e=function(_0x37ad0c,_0x377664){_0x37ad0c=_0x37ad0c-0x0;var _0x552015=_0x54e3[_0x37ad0c];return _0x552015;};'use strict';var multer=require(_0x354e('0x0'));var util=require(_0x354e('0x1'));var path=require(_0x354e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x354e('0x3'));var auth=require(_0x354e('0x4'));var interaction=require(_0x354e('0x5'));var config=require(_0x354e('0x6'));var controller=require(_0x354e('0x7'));router[_0x354e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x354e('0x8')](_0x354e('0x9'),auth[_0x354e('0xa')](),controller['show']);router['get'](_0x354e('0xb'),auth[_0x354e('0xa')](),controller[_0x354e('0xc')]);router[_0x354e('0xd')]('/',auth[_0x354e('0xa')](),controller[_0x354e('0xe')]);router[_0x354e('0xd')]('/:id/sounds',auth[_0x354e('0xa')](),controller['addSound']);router[_0x354e('0xf')](_0x354e('0x9'),auth[_0x354e('0xa')](),controller[_0x354e('0x10')]);router[_0x354e('0x11')](_0x354e('0x9'),auth['isAuthenticated'](),controller[_0x354e('0x12')]);router['delete'](_0x354e('0x13'),auth[_0x354e('0xa')](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0x3e2b=['./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','create','post','addSound','put','delete','/:id/sounds/:id2','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19d24c,_0x62bc50){var _0x2fae8d=function(_0x419856){while(--_0x419856){_0x19d24c['push'](_0x19d24c['shift']());}};_0x2fae8d(++_0x62bc50);}(_0x3e2b,0x1c7));var _0xb3e2=function(_0x290614,_0x172eb6){_0x290614=_0x290614-0x0;var _0x3840f1=_0x3e2b[_0x290614];return _0x3840f1;};'use strict';var multer=require(_0xb3e2('0x0'));var util=require(_0xb3e2('0x1'));var path=require('path');var timeout=require(_0xb3e2('0x2'));var express=require('express');var router=express[_0xb3e2('0x3')]();var fs_extra=require(_0xb3e2('0x4'));var auth=require(_0xb3e2('0x5'));var interaction=require(_0xb3e2('0x6'));var config=require('../../config/environment');var controller=require(_0xb3e2('0x7'));router[_0xb3e2('0x8')]('/',auth[_0xb3e2('0x9')](),controller[_0xb3e2('0xa')]);router[_0xb3e2('0x8')](_0xb3e2('0xb'),auth[_0xb3e2('0x9')](),controller[_0xb3e2('0xc')]);router['get'](_0xb3e2('0xd'),auth[_0xb3e2('0x9')](),controller[_0xb3e2('0xe')]);router['post']('/',auth[_0xb3e2('0x9')](),controller[_0xb3e2('0xf')]);router[_0xb3e2('0x10')]('/:id/sounds',auth[_0xb3e2('0x9')](),controller[_0xb3e2('0x11')]);router[_0xb3e2('0x12')](_0xb3e2('0xb'),auth[_0xb3e2('0x9')](),controller['update']);router[_0xb3e2('0x13')](_0xb3e2('0xb'),auth[_0xb3e2('0x9')](),controller['destroy']);router[_0xb3e2('0x13')](_0xb3e2('0x14'),auth[_0xb3e2('0x9')](),controller['removeSound']);module[_0xb3e2('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index da4d0c4..911e766 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 _0x6a87=['name','ENUM','custom','files','quietmp3','mp3','alpha','exports','STRING'];(function(_0xf9a6cf,_0x11870e){var _0x59e2bc=function(_0x1cd606){while(--_0x1cd606){_0xf9a6cf['push'](_0xf9a6cf['shift']());}};_0x59e2bc(++_0x11870e);}(_0x6a87,0x7c));var _0x76a8=function(_0x40f945,_0xd1d5){_0x40f945=_0x40f945-0x0;var _0x41f33a=_0x6a87[_0x40f945];return _0x41f33a;};'use strict';var Sequelize=require('sequelize');module[_0x76a8('0x0')]={'name':{'type':Sequelize[_0x76a8('0x1')],'allowNull':![],'unique':_0x76a8('0x2')},'mode':{'type':Sequelize[_0x76a8('0x3')](_0x76a8('0x4'),_0x76a8('0x5'),'mp3nb','quietmp3nb',_0x76a8('0x6'),_0x76a8('0x7')),'allowNull':!![],'defaultValue':_0x76a8('0x5')},'directory':{'type':Sequelize[_0x76a8('0x1')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x76a8('0x1')],'allowNull':!![],'defaultValue':_0x76a8('0x8')},'format':{'type':Sequelize[_0x76a8('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xea0b=['custom','files','mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x260a28,_0xb429d0){var _0x1fd65f=function(_0x247152){while(--_0x247152){_0x260a28['push'](_0x260a28['shift']());}};_0x1fd65f(++_0xb429d0);}(_0xea0b,0x140));var _0xbea0=function(_0x3d197f,_0x3186d3){_0x3d197f=_0x3d197f-0x0;var _0x37c656=_0xea0b[_0x3d197f];return _0x37c656;};'use strict';var Sequelize=require(_0xbea0('0x0'));module[_0xbea0('0x1')]={'name':{'type':Sequelize[_0xbea0('0x2')],'allowNull':![],'unique':_0xbea0('0x3')},'mode':{'type':Sequelize[_0xbea0('0x4')](_0xbea0('0x5'),_0xbea0('0x6'),_0xbea0('0x7'),_0xbea0('0x8'),_0xbea0('0x9'),'mp3'),'allowNull':!![],'defaultValue':_0xbea0('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xbea0('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xbea0('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xbea0('0x2')],'allowNull':!![],'defaultValue':_0xbea0('0xa')},'format':{'type':Sequelize[_0xbea0('0x2')],'allowNull':!![]},'stamp':{'type':_0xbea0('0xb')},'defaultEntry':{'type':Sequelize[_0xbea0('0xc')],'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 298749f..9e7c105 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 _0xd7c1=['Content-Range','apply','save','update','then','destroy','get','MusicOnHolds','error','stack','name','index','VoiceMusicOnHold','rawAttributes','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','fields','body','find','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','addSound','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','symlinkSync','ValidationError','removeSound','id2','message','getSounds','length','order','nolimit','rimraf','zip-dir','moment','mustache','path','sox','to-csv','fs-extra','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x38c82d,_0x430408){var _0x2d7429=function(_0x288d8c){while(--_0x288d8c){_0x38c82d['push'](_0x38c82d['shift']());}};_0x2d7429(++_0x430408);}(_0xd7c1,0x1f4));var _0x1d7c=function(_0x4db8d3,_0x2a2f70){_0x4db8d3=_0x4db8d3-0x0;var _0x24a266=_0xd7c1[_0x4db8d3];return _0x24a266;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1d7c('0x0'));var zipdir=require(_0x1d7c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1d7c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1d7c('0x3'));var util=require('util');var path=require(_0x1d7c('0x4'));var sox=require(_0x1d7c('0x5'));var csv=require(_0x1d7c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d7c('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1d7c('0x8'));var Redis=require(_0x1d7c('0x9'));var authService=require(_0x1d7c('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x1d7c('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1d7c('0xc'));var utils=require(_0x1d7c('0xd'));var config=require(_0x1d7c('0xe'));var licenseUtil=require(_0x1d7c('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17eed6,_0x28ed0b){_0x28ed0b=_0x28ed0b||0xcc;return function(_0x405685){if(_0x405685){return _0x17eed6[_0x1d7c('0x10')](_0x28ed0b);}return _0x17eed6[_0x1d7c('0x11')](_0x28ed0b)[_0x1d7c('0x12')]();};}function respondWithResult(_0xffc54c,_0x3989a2){_0x3989a2=_0x3989a2||0xc8;return function(_0x1b8b15){if(_0x1b8b15){return _0xffc54c[_0x1d7c('0x11')](_0x3989a2)[_0x1d7c('0x13')](_0x1b8b15);}};}function respondWithFilteredResult(_0x12745d,_0x121cf0){return function(_0xf88bcf){if(_0xf88bcf){var _0x424aae=typeof _0x121cf0[_0x1d7c('0x14')]==='undefined'&&typeof _0x121cf0[_0x1d7c('0x15')]===_0x1d7c('0x16');var _0x3c08ff=_0xf88bcf['count'];var _0x2e8d6e=_0x424aae?0x0:_0x121cf0[_0x1d7c('0x14')];var _0x40e763=_0x424aae?_0xf88bcf[_0x1d7c('0x17')]:_0x121cf0[_0x1d7c('0x14')]+_0x121cf0[_0x1d7c('0x15')];var _0xbb1151;if(_0x40e763>=_0x3c08ff){_0x40e763=_0x3c08ff;_0xbb1151=0xc8;}else{_0xbb1151=0xce;}_0x12745d[_0x1d7c('0x11')](_0xbb1151);return _0x12745d[_0x1d7c('0x18')](_0x1d7c('0x19'),_0x2e8d6e+'-'+_0x40e763+'/'+_0x3c08ff)['json'](_0xf88bcf);}return null;};}function patchUpdates(_0x257dca){return function(_0x3cf2d7){try{jsonpatch[_0x1d7c('0x1a')](_0x3cf2d7,_0x257dca,!![]);}catch(_0x5334e5){return BPromise['reject'](_0x5334e5);}return _0x3cf2d7[_0x1d7c('0x1b')]();};}function saveUpdates(_0x5e6a20,_0x1c71f6){return function(_0x38ac9b){if(_0x38ac9b){return _0x38ac9b[_0x1d7c('0x1c')](_0x5e6a20)[_0x1d7c('0x1d')](function(_0x35c2c1){return _0x35c2c1;});}return null;};}function removeEntity(_0x2ddb4f,_0x1879ae){return function(_0x2b9296){if(_0x2b9296){return _0x2b9296[_0x1d7c('0x1e')]()[_0x1d7c('0x1d')](function(){var _0x3f5af9=_0x2b9296[_0x1d7c('0x1f')]({'plain':!![]});var _0x187322=_0x1d7c('0x20');return db['UserProfileResource'][_0x1d7c('0x1e')]({'where':{'type':_0x187322,'resourceId':_0x3f5af9['id']}})[_0x1d7c('0x1d')](function(){return _0x2b9296;});})[_0x1d7c('0x1d')](function(){_0x2ddb4f[_0x1d7c('0x11')](0xcc)[_0x1d7c('0x12')]();});}};}function handleEntityNotFound(_0x6f9063,_0x40c53){return function(_0x500319){if(!_0x500319){_0x6f9063[_0x1d7c('0x10')](0x194);}return _0x500319;};}function handleError(_0x47fc73,_0x1ad9ce){_0x1ad9ce=_0x1ad9ce||0x1f4;return function(_0x2a887d){logger[_0x1d7c('0x21')](_0x2a887d[_0x1d7c('0x22')]);if(_0x2a887d['name']){delete _0x2a887d[_0x1d7c('0x23')];}_0x47fc73[_0x1d7c('0x11')](_0x1ad9ce)['send'](_0x2a887d);};}exports[_0x1d7c('0x24')]=function(_0x5460e7,_0x1a2de4){var _0x539519={},_0x59c2bf={},_0x558bdb={'count':0x0,'rows':[]};var _0x229e1f=_['map'](db[_0x1d7c('0x25')][_0x1d7c('0x26')],function(_0x449c6e){return{'name':_0x449c6e['fieldName'],'type':_0x449c6e[_0x1d7c('0x27')][_0x1d7c('0x28')]};});_0x59c2bf[_0x1d7c('0x29')]=_[_0x1d7c('0x2a')](_0x229e1f,_0x1d7c('0x23'));_0x59c2bf[_0x1d7c('0x2b')]=_['keys'](_0x5460e7[_0x1d7c('0x2b')]);_0x59c2bf[_0x1d7c('0x2c')]=_[_0x1d7c('0x2d')](_0x59c2bf[_0x1d7c('0x29')],_0x59c2bf[_0x1d7c('0x2b')]);_0x539519[_0x1d7c('0x2e')]=_['intersection'](_0x59c2bf[_0x1d7c('0x29')],qs['fields'](_0x5460e7[_0x1d7c('0x2b')]['fields']));_0x539519[_0x1d7c('0x2e')]=_0x539519[_0x1d7c('0x2e')]['length']?_0x539519['attributes']:_0x59c2bf[_0x1d7c('0x29')];if(!_0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x2f')]('nolimit')){_0x539519[_0x1d7c('0x15')]=qs[_0x1d7c('0x15')](_0x5460e7[_0x1d7c('0x2b')]['limit']);_0x539519[_0x1d7c('0x14')]=qs[_0x1d7c('0x14')](_0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x14')]);}_0x539519['order']=qs[_0x1d7c('0x30')](_0x5460e7['query'][_0x1d7c('0x30')]);delete _0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x30')];_0x539519[_0x1d7c('0x31')]=qs[_0x1d7c('0x2c')](_[_0x1d7c('0x32')](_0x5460e7['query'],_0x59c2bf[_0x1d7c('0x2c')]),_0x229e1f);if(_0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x33')]){_0x539519['where']=_[_0x1d7c('0x34')](_0x539519[_0x1d7c('0x31')],{'$or':_[_0x1d7c('0x2a')](_0x229e1f,function(_0x2d8487){if(_0x2d8487[_0x1d7c('0x27')]!=='VIRTUAL'){var _0x3b8a03={};_0x3b8a03[_0x2d8487['name']]={'$like':'%'+_0x5460e7['query'][_0x1d7c('0x33')]+'%'};return _0x3b8a03;}})});}_0x539519=_['merge']({},_0x539519,_0x5460e7[_0x1d7c('0x35')]);var _0x396507={'where':_0x539519[_0x1d7c('0x31')]};return db[_0x1d7c('0x25')][_0x1d7c('0x17')](_0x396507)['then'](function(_0xbf8166){_0x558bdb['count']=_0xbf8166;if(_0x5460e7[_0x1d7c('0x2b')][_0x1d7c('0x36')]){_0x539519[_0x1d7c('0x37')]=[{'all':!![]}];}return db[_0x1d7c('0x25')][_0x1d7c('0x38')](_0x539519);})[_0x1d7c('0x1d')](function(_0x32219c){_0x558bdb[_0x1d7c('0x39')]=_0x32219c;return _0x558bdb;})[_0x1d7c('0x1d')](respondWithFilteredResult(_0x1a2de4,_0x539519))[_0x1d7c('0x3a')](handleError(_0x1a2de4,null));};exports['show']=function(_0x314859,_0x42978f){var _0xbd9bb1={'raw':![],'where':{'id':_0x314859[_0x1d7c('0x3b')]['id']}},_0x5846df={};_0x5846df[_0x1d7c('0x29')]=_[_0x1d7c('0x3c')](db['VoiceMusicOnHold'][_0x1d7c('0x26')]);_0x5846df['query']=_[_0x1d7c('0x3c')](_0x314859[_0x1d7c('0x2b')]);_0x5846df[_0x1d7c('0x2c')]=_[_0x1d7c('0x2d')](_0x5846df[_0x1d7c('0x29')],_0x5846df['query']);_0xbd9bb1[_0x1d7c('0x2e')]=_[_0x1d7c('0x2d')](_0x5846df[_0x1d7c('0x29')],qs['fields'](_0x314859[_0x1d7c('0x2b')][_0x1d7c('0x3d')]));_0xbd9bb1[_0x1d7c('0x2e')]=_0xbd9bb1[_0x1d7c('0x2e')]['length']?_0xbd9bb1[_0x1d7c('0x2e')]:_0x5846df[_0x1d7c('0x29')];if(_0x314859['query']['includeAll']){_0xbd9bb1[_0x1d7c('0x37')]=[{'all':!![]}];}_0xbd9bb1=_[_0x1d7c('0x34')]({},_0xbd9bb1,_0x314859[_0x1d7c('0x35')]);return db[_0x1d7c('0x25')]['find'](_0xbd9bb1)[_0x1d7c('0x1d')](handleEntityNotFound(_0x42978f,null))[_0x1d7c('0x1d')](respondWithResult(_0x42978f,null))[_0x1d7c('0x3a')](handleError(_0x42978f,null));};exports[_0x1d7c('0x1c')]=function(_0x5f0f5e,_0x2195b8){if(_0x5f0f5e[_0x1d7c('0x3e')]['id']){delete _0x5f0f5e[_0x1d7c('0x3e')]['id'];}return db[_0x1d7c('0x25')][_0x1d7c('0x3f')]({'where':{'id':_0x5f0f5e[_0x1d7c('0x3b')]['id']}})[_0x1d7c('0x1d')](handleEntityNotFound(_0x2195b8,null))[_0x1d7c('0x1d')](saveUpdates(_0x5f0f5e[_0x1d7c('0x3e')],null))['then'](respondWithResult(_0x2195b8,null))[_0x1d7c('0x3a')](handleError(_0x2195b8,null));};exports[_0x1d7c('0x40')]=function(_0xfa894c,_0x563569,_0x9d54b6){return db[_0x1d7c('0x41')][_0x1d7c('0x42')](function(_0x1af449){if(_0xfa894c[_0x1d7c('0x3e')][_0x1d7c('0x43')]===_0x1d7c('0x44')){_0xfa894c['body'][_0x1d7c('0x45')]=path[_0x1d7c('0x46')](config[_0x1d7c('0x47')],_0x1d7c('0x48'),_0xfa894c[_0x1d7c('0x3e')][_0x1d7c('0x23')]);}return db[_0x1d7c('0x25')][_0x1d7c('0x40')](_0xfa894c[_0x1d7c('0x3e')],{'transaction':_0x1af449})['then'](function(_0x236248){if(_0xfa894c[_0x1d7c('0x3e')]['mode']===_0x1d7c('0x44')){fs[_0x1d7c('0x49')](_0x236248[_0x1d7c('0x45')],parseInt('0777',0x8));}var _0x1421e9=_0xfa894c[_0x1d7c('0x4a')][_0x1d7c('0x1f')]({'plain':!![]});if(!_0x1421e9)throw new Error(_0x1d7c('0x4b'));if(_0x1421e9[_0x1d7c('0x4c')]===_0x1d7c('0x4a')){var _0x1f4d5c=_0x236248[_0x1d7c('0x1f')]({'plain':!![]});return db[_0x1d7c('0x4d')][_0x1d7c('0x3f')]({'where':{'name':_0x1d7c('0x20'),'userProfileId':_0x1421e9['userProfileId']},'raw':!![]})['then'](function(_0x4d5509){if(_0x4d5509&&_0x4d5509[_0x1d7c('0x4e')]===0x0){return db[_0x1d7c('0x4f')][_0x1d7c('0x40')]({'name':_0x1f4d5c[_0x1d7c('0x23')],'resourceId':_0x1f4d5c['id'],'type':_0x4d5509[_0x1d7c('0x23')],'sectionId':_0x4d5509['id']},{})[_0x1d7c('0x1d')](function(){return _0x236248;});}else{return _0x236248;}})[_0x1d7c('0x3a')](function(_0x5a7b20){logger['error'](_0x1d7c('0x50'),_0x5a7b20);});}return _0x236248;});})[_0x1d7c('0x1d')](respondWithResult(_0x563569,0xc9))[_0x1d7c('0x3a')](handleError(_0x563569,null));};exports[_0x1d7c('0x1e')]=function(_0x2b2fad,_0x3f86d3,_0x15bae2){var _0x23593e;return db[_0x1d7c('0x25')]['find']({'where':{'id':_0x2b2fad[_0x1d7c('0x3b')]['id']}})['then'](function(_0x310802){if(_0x310802){return db[_0x1d7c('0x41')]['transaction'](function(_0x2e18a2){return _0x310802[_0x1d7c('0x1e')]({'transaction':_0x2e18a2,'raw':!![]})[_0x1d7c('0x1d')](function(_0x482935){if(_0x482935[_0x1d7c('0x45')]){fs[_0x1d7c('0x51')](_0x482935[_0x1d7c('0x45')])[_0x1d7c('0x52')](function(_0x3c3559){fs[_0x1d7c('0x53')](path[_0x1d7c('0x46')](_0x482935[_0x1d7c('0x45')],_0x3c3559));});fs['rmdirSync'](_0x482935[_0x1d7c('0x45')]);}return _0x482935;});})['catch'](function(_0x39cf29){throw new db[(_0x1d7c('0x54'))]['ValidationError'](_0x39cf29['message']);});}})[_0x1d7c('0x1d')](handleEntityNotFound(_0x3f86d3,null))[_0x1d7c('0x1d')](removeEntity(_0x3f86d3,null))[_0x1d7c('0x3a')](handleError(_0x3f86d3,null));};exports[_0x1d7c('0x55')]=function(_0x5afa82,_0xaf7217,_0x353ec4){return db[_0x1d7c('0x41')][_0x1d7c('0x42')](function(_0x185de0){var _0x1e7d61;return db['VoiceMusicOnHold'][_0x1d7c('0x3f')]({'where':{'id':_0x5afa82[_0x1d7c('0x3b')]['id']}})['then'](function(_0x1996a5){if(_0x1996a5){_0x1e7d61=_0x1996a5;return _0x1996a5[_0x1d7c('0x55')](_0x5afa82['body']['id'],{'transaction':_0x185de0});}})[_0x1d7c('0x1d')](function(_0x408aa9){if(_0x408aa9){return db[_0x1d7c('0x56')][_0x1d7c('0x57')]({'where':{'id':_0x5afa82['body']['id']},'attributes':['id',_0x1d7c('0x23'),_0x1d7c('0x58'),'converted_format',_0x1d7c('0x59')],'raw':!![]});}})[_0x1d7c('0x1d')](function(_0x4b1d88){if(_0x4b1d88){var _0x4ac48f=path[_0x1d7c('0x46')](config[_0x1d7c('0x47')],_0x1d7c('0x5a'),util[_0x1d7c('0x5b')](_0x1d7c('0x5c'),path[_0x1d7c('0x5d')](_0x4b1d88[_0x1d7c('0x58')],path[_0x1d7c('0x5e')](_0x4b1d88['save_name'])),_0x4b1d88[_0x1d7c('0x5f')]));var _0x5787d1=path[_0x1d7c('0x46')](config[_0x1d7c('0x47')],_0x1d7c('0x48'),_0x1e7d61[_0x1d7c('0x23')],util[_0x1d7c('0x5b')](_0x1d7c('0x5c'),_0x4b1d88[_0x1d7c('0x23')],_0x4b1d88[_0x1d7c('0x5f')]));fs[_0x1d7c('0x60')](_0x4ac48f,_0x5787d1);return _0x4b1d88;}})[_0x1d7c('0x3a')](function(_0x141f6b){throw new db[(_0x1d7c('0x54'))][(_0x1d7c('0x61'))](_0x141f6b['message']);});})['then'](handleEntityNotFound(_0xaf7217,null))[_0x1d7c('0x1d')](respondWithResult(_0xaf7217,0xc9))[_0x1d7c('0x3a')](handleError(_0xaf7217,null));};exports[_0x1d7c('0x62')]=function(_0x2e05ec,_0x5f30b2,_0x3ab8b9){return db[_0x1d7c('0x41')][_0x1d7c('0x42')](function(_0x2eaaeb){var _0x3650d2;return db[_0x1d7c('0x25')]['findOne']({'where':{'id':_0x2e05ec[_0x1d7c('0x3b')]['id']}})[_0x1d7c('0x1d')](handleEntityNotFound(_0x5f30b2,null))[_0x1d7c('0x1d')](function(_0x1e2bfc){if(_0x1e2bfc){_0x3650d2=_0x1e2bfc;return _0x1e2bfc[_0x1d7c('0x62')](_0x2e05ec[_0x1d7c('0x3b')][_0x1d7c('0x63')]);}})['then'](function(_0x1b4a19){if(_0x1b4a19){return db[_0x1d7c('0x56')][_0x1d7c('0x57')]({'where':{'id':_0x2e05ec[_0x1d7c('0x3b')][_0x1d7c('0x63')]},'attributes':['id',_0x1d7c('0x23'),'save_name',_0x1d7c('0x5f'),_0x1d7c('0x59')],'raw':!![]});}})['then'](function(_0x2d81e5){if(_0x2d81e5){fs[_0x1d7c('0x53')](path[_0x1d7c('0x46')](_0x3650d2[_0x1d7c('0x45')],util[_0x1d7c('0x5b')](_0x1d7c('0x5c'),_0x2d81e5[_0x1d7c('0x23')],_0x2d81e5[_0x1d7c('0x5f')])));return _0x2d81e5;}})[_0x1d7c('0x3a')](function(_0x45b6e0){throw new db['Sequelize'][(_0x1d7c('0x61'))](_0x45b6e0[_0x1d7c('0x64')]);});})[_0x1d7c('0x1d')](handleEntityNotFound(_0x5f30b2,null))['then'](respondWithStatusCode(_0x5f30b2,0xcc))['catch'](handleError(_0x5f30b2,null));};exports[_0x1d7c('0x65')]=function(_0x3a589d,_0x544437,_0x2f8ffe){var _0x434a53={};var _0x4245a3={};var _0x25fa30;var _0x574cce;return db[_0x1d7c('0x25')][_0x1d7c('0x57')]({'where':{'id':_0x3a589d['params']['id']}})[_0x1d7c('0x1d')](handleEntityNotFound(_0x544437,null))[_0x1d7c('0x1d')](function(_0x984d29){if(_0x984d29){_0x25fa30=_0x984d29;_0x4245a3[_0x1d7c('0x29')]=_['keys'](db[_0x1d7c('0x56')][_0x1d7c('0x26')]);_0x4245a3['query']=_[_0x1d7c('0x3c')](_0x3a589d[_0x1d7c('0x2b')]);_0x4245a3['filters']=_[_0x1d7c('0x2d')](_0x4245a3['model'],_0x4245a3[_0x1d7c('0x2b')]);_0x434a53[_0x1d7c('0x2e')]=_[_0x1d7c('0x2d')](_0x4245a3[_0x1d7c('0x29')],qs['fields'](_0x3a589d[_0x1d7c('0x2b')][_0x1d7c('0x3d')]));_0x434a53['attributes']=_0x434a53[_0x1d7c('0x2e')][_0x1d7c('0x66')]?_0x434a53[_0x1d7c('0x2e')]:_0x4245a3[_0x1d7c('0x29')];_0x434a53[_0x1d7c('0x67')]=qs[_0x1d7c('0x30')](_0x3a589d['query'][_0x1d7c('0x30')]);_0x434a53[_0x1d7c('0x31')]=qs['filters'](_[_0x1d7c('0x32')](_0x3a589d[_0x1d7c('0x2b')],_0x4245a3[_0x1d7c('0x2c')]));if(_0x3a589d[_0x1d7c('0x2b')][_0x1d7c('0x33')]){_0x434a53['where']=_['merge'](_0x434a53[_0x1d7c('0x31')],{'$or':_[_0x1d7c('0x2a')](_0x434a53[_0x1d7c('0x2e')],function(_0x40e1e0){var _0x4ae5f2={};_0x4ae5f2[_0x40e1e0]={'$like':'%'+_0x3a589d['query'][_0x1d7c('0x33')]+'%'};return _0x4ae5f2;})});}_0x434a53=_['merge']({},_0x434a53,_0x3a589d[_0x1d7c('0x35')]);return _0x25fa30[_0x1d7c('0x65')](_0x434a53);}})[_0x1d7c('0x1d')](function(_0x52f8c5){if(_0x52f8c5){_0x574cce=_0x52f8c5['length'];if(!_0x3a589d[_0x1d7c('0x2b')][_0x1d7c('0x2f')](_0x1d7c('0x68'))){_0x434a53[_0x1d7c('0x15')]=qs[_0x1d7c('0x15')](_0x3a589d['query'][_0x1d7c('0x15')]);_0x434a53[_0x1d7c('0x14')]=qs[_0x1d7c('0x14')](_0x3a589d['query'][_0x1d7c('0x14')]);}return _0x25fa30['getSounds'](_0x434a53);}})[_0x1d7c('0x1d')](function(_0x4ce19b){if(_0x4ce19b){return _0x4ce19b?{'count':_0x574cce,'rows':_0x4ce19b}:null;}})['then'](respondWithResult(_0x544437,null))[_0x1d7c('0x3a')](handleError(_0x544437,null));}; \ No newline at end of file +var _0x0b0c=['nolimit','eml-format','rimraf','zip-dir','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','findAll','rows','catch','params','include','find','body','create','sequelize','transaction','mode','directory','root','server/files/moh','files','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','join','rmdirSync','ValidationError','message','addSound','Sound','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','Sequelize','removeSound','findOne','id2','createdAt','getSounds','options'];(function(_0x328b1c,_0xec0b4f){var _0x4dbeaa=function(_0x432519){while(--_0x432519){_0x328b1c['push'](_0x328b1c['shift']());}};_0x4dbeaa(++_0xec0b4f);}(_0x0b0c,0x1bd));var _0xc0b0=function(_0xa9b067,_0x2047eb){_0xa9b067=_0xa9b067-0x0;var _0x492156=_0x0b0c[_0xa9b067];return _0x492156;};'use strict';var emlformat=require(_0xc0b0('0x0'));var rimraf=require(_0xc0b0('0x1'));var zipdir=require(_0xc0b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc0b0('0x3'));var Mustache=require('mustache');var util=require(_0xc0b0('0x4'));var path=require('path');var sox=require(_0xc0b0('0x5'));var csv=require(_0xc0b0('0x6'));var ejs=require(_0xc0b0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0b0('0x8'));var squel=require(_0xc0b0('0x9'));var crypto=require(_0xc0b0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc0b0('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc0b0('0xc'));var Redis=require(_0xc0b0('0xd'));var authService=require(_0xc0b0('0xe'));var qs=require(_0xc0b0('0xf'));var as=require(_0xc0b0('0x10'));var hardwareService=require(_0xc0b0('0x11'));var logger=require(_0xc0b0('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc0b0('0x13'));var licenseUtil=require(_0xc0b0('0x14'));var db=require(_0xc0b0('0x15'))['db'];function respondWithStatusCode(_0x113ddb,_0x3c7378){_0x3c7378=_0x3c7378||0xcc;return function(_0x48814b){if(_0x48814b){return _0x113ddb[_0xc0b0('0x16')](_0x3c7378);}return _0x113ddb[_0xc0b0('0x17')](_0x3c7378)[_0xc0b0('0x18')]();};}function respondWithResult(_0x2461b5,_0x48fc21){_0x48fc21=_0x48fc21||0xc8;return function(_0x4fb6f5){if(_0x4fb6f5){return _0x2461b5['status'](_0x48fc21)[_0xc0b0('0x19')](_0x4fb6f5);}};}function respondWithFilteredResult(_0x3e9b93,_0x4c8547){return function(_0x1a2751){if(_0x1a2751){var _0x54d284=typeof _0x4c8547[_0xc0b0('0x1a')]===_0xc0b0('0x1b')&&typeof _0x4c8547[_0xc0b0('0x1c')]==='undefined';var _0xc837af=_0x1a2751[_0xc0b0('0x1d')];var _0x2e33de=_0x54d284?0x0:_0x4c8547[_0xc0b0('0x1a')];var _0x444865=_0x54d284?_0x1a2751['count']:_0x4c8547['offset']+_0x4c8547[_0xc0b0('0x1c')];var _0x4aa635;if(_0x444865>=_0xc837af){_0x444865=_0xc837af;_0x4aa635=0xc8;}else{_0x4aa635=0xce;}_0x3e9b93[_0xc0b0('0x17')](_0x4aa635);return _0x3e9b93[_0xc0b0('0x1e')]('Content-Range',_0x2e33de+'-'+_0x444865+'/'+_0xc837af)[_0xc0b0('0x19')](_0x1a2751);}return null;};}function patchUpdates(_0x514a4d){return function(_0x4ec752){try{jsonpatch[_0xc0b0('0x1f')](_0x4ec752,_0x514a4d,!![]);}catch(_0x50d8e1){return BPromise[_0xc0b0('0x20')](_0x50d8e1);}return _0x4ec752[_0xc0b0('0x21')]();};}function saveUpdates(_0x25dbfc,_0x319f0b){return function(_0x102d1c){if(_0x102d1c){return _0x102d1c[_0xc0b0('0x22')](_0x25dbfc)['then'](function(_0xfb1c77){return _0xfb1c77;});}return null;};}function removeEntity(_0x553ab1,_0xdc9969){return function(_0x4567e0){if(_0x4567e0){return _0x4567e0['destroy']()[_0xc0b0('0x23')](function(){var _0x341e6f=_0x4567e0[_0xc0b0('0x24')]({'plain':!![]});var _0x4b1606=_0xc0b0('0x25');return db[_0xc0b0('0x26')][_0xc0b0('0x27')]({'where':{'type':_0x4b1606,'resourceId':_0x341e6f['id']}})[_0xc0b0('0x23')](function(){return _0x4567e0;});})['then'](function(){_0x553ab1['status'](0xcc)[_0xc0b0('0x18')]();});}};}function handleEntityNotFound(_0x17956d,_0x151168){return function(_0x269c97){if(!_0x269c97){_0x17956d[_0xc0b0('0x16')](0x194);}return _0x269c97;};}function handleError(_0x2cae6e,_0x218991){_0x218991=_0x218991||0x1f4;return function(_0x31f956){logger[_0xc0b0('0x28')](_0x31f956['stack']);if(_0x31f956[_0xc0b0('0x29')]){delete _0x31f956[_0xc0b0('0x29')];}_0x2cae6e['status'](_0x218991)[_0xc0b0('0x2a')](_0x31f956);};}exports[_0xc0b0('0x2b')]=function(_0x3ab63d,_0x469b60){var _0x3b694f={},_0x3c7691={},_0x2084c6={'count':0x0,'rows':[]};var _0x162b5a=_[_0xc0b0('0x2c')](db[_0xc0b0('0x2d')][_0xc0b0('0x2e')],function(_0x8959a1){return{'name':_0x8959a1[_0xc0b0('0x2f')],'type':_0x8959a1['type']['key']};});_0x3c7691['model']=_[_0xc0b0('0x2c')](_0x162b5a,_0xc0b0('0x29'));_0x3c7691[_0xc0b0('0x30')]=_[_0xc0b0('0x31')](_0x3ab63d[_0xc0b0('0x30')]);_0x3c7691[_0xc0b0('0x32')]=_[_0xc0b0('0x33')](_0x3c7691[_0xc0b0('0x34')],_0x3c7691[_0xc0b0('0x30')]);_0x3b694f[_0xc0b0('0x35')]=_[_0xc0b0('0x33')](_0x3c7691[_0xc0b0('0x34')],qs['fields'](_0x3ab63d[_0xc0b0('0x30')][_0xc0b0('0x36')]));_0x3b694f[_0xc0b0('0x35')]=_0x3b694f[_0xc0b0('0x35')][_0xc0b0('0x37')]?_0x3b694f[_0xc0b0('0x35')]:_0x3c7691[_0xc0b0('0x34')];if(!_0x3ab63d[_0xc0b0('0x30')][_0xc0b0('0x38')]('nolimit')){_0x3b694f['limit']=qs['limit'](_0x3ab63d[_0xc0b0('0x30')][_0xc0b0('0x1c')]);_0x3b694f[_0xc0b0('0x1a')]=qs[_0xc0b0('0x1a')](_0x3ab63d['query'][_0xc0b0('0x1a')]);}_0x3b694f[_0xc0b0('0x39')]=qs[_0xc0b0('0x3a')](_0x3ab63d[_0xc0b0('0x30')][_0xc0b0('0x3a')]);delete _0x3ab63d['query'][_0xc0b0('0x3a')];_0x3b694f[_0xc0b0('0x3b')]=qs['filters'](_[_0xc0b0('0x3c')](_0x3ab63d[_0xc0b0('0x30')],_0x3c7691[_0xc0b0('0x32')]),_0x162b5a);if(_0x3ab63d['query']['filter']){_0x3b694f[_0xc0b0('0x3b')]=_[_0xc0b0('0x3d')](_0x3b694f[_0xc0b0('0x3b')],{'$or':_[_0xc0b0('0x2c')](_0x162b5a,function(_0x1e2c83){if(_0x1e2c83[_0xc0b0('0x3e')]!==_0xc0b0('0x3f')){var _0x5458a7={};_0x5458a7[_0x1e2c83['name']]={'$like':'%'+_0x3ab63d[_0xc0b0('0x30')][_0xc0b0('0x40')]+'%'};return _0x5458a7;}})});}_0x3b694f=_[_0xc0b0('0x3d')]({},_0x3b694f,_0x3ab63d['options']);var _0xd6e346={'where':_0x3b694f[_0xc0b0('0x3b')]};return db[_0xc0b0('0x2d')][_0xc0b0('0x1d')](_0xd6e346)[_0xc0b0('0x23')](function(_0x3b5257){_0x2084c6[_0xc0b0('0x1d')]=_0x3b5257;if(_0x3ab63d['query'][_0xc0b0('0x41')]){_0x3b694f['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xc0b0('0x42')](_0x3b694f);})['then'](function(_0x19f0a1){_0x2084c6[_0xc0b0('0x43')]=_0x19f0a1;return _0x2084c6;})[_0xc0b0('0x23')](respondWithFilteredResult(_0x469b60,_0x3b694f))[_0xc0b0('0x44')](handleError(_0x469b60,null));};exports['show']=function(_0x1ab8d0,_0x3221ee){var _0x5d9a58={'raw':![],'where':{'id':_0x1ab8d0[_0xc0b0('0x45')]['id']}},_0x8adeae={};_0x8adeae[_0xc0b0('0x34')]=_[_0xc0b0('0x31')](db[_0xc0b0('0x2d')][_0xc0b0('0x2e')]);_0x8adeae[_0xc0b0('0x30')]=_[_0xc0b0('0x31')](_0x1ab8d0[_0xc0b0('0x30')]);_0x8adeae[_0xc0b0('0x32')]=_[_0xc0b0('0x33')](_0x8adeae[_0xc0b0('0x34')],_0x8adeae[_0xc0b0('0x30')]);_0x5d9a58[_0xc0b0('0x35')]=_[_0xc0b0('0x33')](_0x8adeae[_0xc0b0('0x34')],qs[_0xc0b0('0x36')](_0x1ab8d0['query'][_0xc0b0('0x36')]));_0x5d9a58[_0xc0b0('0x35')]=_0x5d9a58['attributes'][_0xc0b0('0x37')]?_0x5d9a58['attributes']:_0x8adeae[_0xc0b0('0x34')];if(_0x1ab8d0['query'][_0xc0b0('0x41')]){_0x5d9a58[_0xc0b0('0x46')]=[{'all':!![]}];}_0x5d9a58=_[_0xc0b0('0x3d')]({},_0x5d9a58,_0x1ab8d0['options']);return db['VoiceMusicOnHold'][_0xc0b0('0x47')](_0x5d9a58)[_0xc0b0('0x23')](handleEntityNotFound(_0x3221ee,null))[_0xc0b0('0x23')](respondWithResult(_0x3221ee,null))[_0xc0b0('0x44')](handleError(_0x3221ee,null));};exports['update']=function(_0x110366,_0x5367bb){if(_0x110366[_0xc0b0('0x48')]['id']){delete _0x110366['body']['id'];}return db[_0xc0b0('0x2d')]['find']({'where':{'id':_0x110366[_0xc0b0('0x45')]['id']}})[_0xc0b0('0x23')](handleEntityNotFound(_0x5367bb,null))[_0xc0b0('0x23')](saveUpdates(_0x110366[_0xc0b0('0x48')],null))[_0xc0b0('0x23')](respondWithResult(_0x5367bb,null))['catch'](handleError(_0x5367bb,null));};exports[_0xc0b0('0x49')]=function(_0xcd8d70,_0x12bfdb,_0x132519){return db[_0xc0b0('0x4a')][_0xc0b0('0x4b')](function(_0x226cea){if(_0xcd8d70[_0xc0b0('0x48')][_0xc0b0('0x4c')]==='files'){_0xcd8d70['body'][_0xc0b0('0x4d')]=path['join'](config[_0xc0b0('0x4e')],_0xc0b0('0x4f'),_0xcd8d70[_0xc0b0('0x48')][_0xc0b0('0x29')]);}return db[_0xc0b0('0x2d')][_0xc0b0('0x49')](_0xcd8d70[_0xc0b0('0x48')],{'transaction':_0x226cea})[_0xc0b0('0x23')](function(_0x2b04f3){if(_0xcd8d70[_0xc0b0('0x48')][_0xc0b0('0x4c')]===_0xc0b0('0x50')){fs[_0xc0b0('0x51')](_0x2b04f3[_0xc0b0('0x4d')],parseInt('0777',0x8));}var _0x21ddf9=_0xcd8d70[_0xc0b0('0x52')][_0xc0b0('0x24')]({'plain':!![]});if(!_0x21ddf9)throw new Error(_0xc0b0('0x53'));if(_0x21ddf9['role']===_0xc0b0('0x52')){var _0x422a22=_0x2b04f3['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xc0b0('0x25'),'userProfileId':_0x21ddf9[_0xc0b0('0x54')]},'raw':!![]})['then'](function(_0xa5f503){if(_0xa5f503&&_0xa5f503[_0xc0b0('0x55')]===0x0){return db[_0xc0b0('0x26')][_0xc0b0('0x49')]({'name':_0x422a22['name'],'resourceId':_0x422a22['id'],'type':_0xa5f503['name'],'sectionId':_0xa5f503['id']},{})[_0xc0b0('0x23')](function(){return _0x2b04f3;});}else{return _0x2b04f3;}})[_0xc0b0('0x44')](function(_0x9024ff){logger[_0xc0b0('0x28')](_0xc0b0('0x56'),_0x9024ff);});}return _0x2b04f3;});})[_0xc0b0('0x23')](respondWithResult(_0x12bfdb,0xc9))['catch'](handleError(_0x12bfdb,null));};exports[_0xc0b0('0x27')]=function(_0x51daa9,_0x173bbc,_0x4ea67f){var _0x49c44b;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x51daa9['params']['id']}})[_0xc0b0('0x23')](function(_0xccf404){if(_0xccf404){return db[_0xc0b0('0x4a')][_0xc0b0('0x4b')](function(_0x35ed48){return _0xccf404[_0xc0b0('0x27')]({'transaction':_0x35ed48,'raw':!![]})[_0xc0b0('0x23')](function(_0x4e0014){if(_0x4e0014[_0xc0b0('0x4d')]){fs[_0xc0b0('0x57')](_0x4e0014[_0xc0b0('0x4d')])['forEach'](function(_0x45d53b){fs[_0xc0b0('0x58')](path[_0xc0b0('0x59')](_0x4e0014['directory'],_0x45d53b));});fs[_0xc0b0('0x5a')](_0x4e0014[_0xc0b0('0x4d')]);}return _0x4e0014;});})[_0xc0b0('0x44')](function(_0x204e0c){throw new db['Sequelize'][(_0xc0b0('0x5b'))](_0x204e0c[_0xc0b0('0x5c')]);});}})[_0xc0b0('0x23')](handleEntityNotFound(_0x173bbc,null))[_0xc0b0('0x23')](removeEntity(_0x173bbc,null))[_0xc0b0('0x44')](handleError(_0x173bbc,null));};exports[_0xc0b0('0x5d')]=function(_0x570919,_0x46cd7e,_0x2c99ea){return db['sequelize']['transaction'](function(_0x2da54a){var _0x146ae9;return db[_0xc0b0('0x2d')]['find']({'where':{'id':_0x570919[_0xc0b0('0x45')]['id']}})['then'](function(_0x16e833){if(_0x16e833){_0x146ae9=_0x16e833;return _0x16e833[_0xc0b0('0x5d')](_0x570919[_0xc0b0('0x48')]['id'],{'transaction':_0x2da54a});}})[_0xc0b0('0x23')](function(_0x538dc4){if(_0x538dc4){return db[_0xc0b0('0x5e')]['findOne']({'where':{'id':_0x570919[_0xc0b0('0x48')]['id']},'attributes':['id','name',_0xc0b0('0x5f'),_0xc0b0('0x60'),'createdAt'],'raw':!![]});}})[_0xc0b0('0x23')](function(_0x192c9b){if(_0x192c9b){var _0x539f4d=path['join'](config[_0xc0b0('0x4e')],_0xc0b0('0x61'),util[_0xc0b0('0x62')](_0xc0b0('0x63'),path[_0xc0b0('0x64')](_0x192c9b[_0xc0b0('0x5f')],path[_0xc0b0('0x65')](_0x192c9b[_0xc0b0('0x5f')])),_0x192c9b[_0xc0b0('0x60')]));var _0x2e6bd1=path[_0xc0b0('0x59')](config[_0xc0b0('0x4e')],_0xc0b0('0x4f'),_0x146ae9[_0xc0b0('0x29')],util[_0xc0b0('0x62')]('%s.%s',_0x192c9b[_0xc0b0('0x29')],_0x192c9b[_0xc0b0('0x60')]));fs[_0xc0b0('0x66')](_0x539f4d,_0x2e6bd1);return _0x192c9b;}})[_0xc0b0('0x44')](function(_0x1e2a27){throw new db[(_0xc0b0('0x67'))]['ValidationError'](_0x1e2a27[_0xc0b0('0x5c')]);});})[_0xc0b0('0x23')](handleEntityNotFound(_0x46cd7e,null))[_0xc0b0('0x23')](respondWithResult(_0x46cd7e,0xc9))[_0xc0b0('0x44')](handleError(_0x46cd7e,null));};exports[_0xc0b0('0x68')]=function(_0x5526e9,_0x1278a1,_0x591ce7){return db[_0xc0b0('0x4a')][_0xc0b0('0x4b')](function(_0x22c8ef){var _0x46892c;return db[_0xc0b0('0x2d')][_0xc0b0('0x69')]({'where':{'id':_0x5526e9[_0xc0b0('0x45')]['id']}})[_0xc0b0('0x23')](handleEntityNotFound(_0x1278a1,null))[_0xc0b0('0x23')](function(_0x163874){if(_0x163874){_0x46892c=_0x163874;return _0x163874[_0xc0b0('0x68')](_0x5526e9[_0xc0b0('0x45')][_0xc0b0('0x6a')]);}})[_0xc0b0('0x23')](function(_0x4fe81d){if(_0x4fe81d){return db[_0xc0b0('0x5e')]['findOne']({'where':{'id':_0x5526e9['params'][_0xc0b0('0x6a')]},'attributes':['id',_0xc0b0('0x29'),_0xc0b0('0x5f'),_0xc0b0('0x60'),_0xc0b0('0x6b')],'raw':!![]});}})[_0xc0b0('0x23')](function(_0x42b9fd){if(_0x42b9fd){fs[_0xc0b0('0x58')](path[_0xc0b0('0x59')](_0x46892c[_0xc0b0('0x4d')],util[_0xc0b0('0x62')](_0xc0b0('0x63'),_0x42b9fd['name'],_0x42b9fd['converted_format'])));return _0x42b9fd;}})[_0xc0b0('0x44')](function(_0x42186d){throw new db[(_0xc0b0('0x67'))][(_0xc0b0('0x5b'))](_0x42186d['message']);});})[_0xc0b0('0x23')](handleEntityNotFound(_0x1278a1,null))[_0xc0b0('0x23')](respondWithStatusCode(_0x1278a1,0xcc))['catch'](handleError(_0x1278a1,null));};exports[_0xc0b0('0x6c')]=function(_0x2fd21c,_0x282934,_0x3d2192){var _0x2fa5ff={};var _0x7ead3a={};var _0x2005d4;var _0x50fc8d;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x2fd21c['params']['id']}})['then'](handleEntityNotFound(_0x282934,null))['then'](function(_0x3ee198){if(_0x3ee198){_0x2005d4=_0x3ee198;_0x7ead3a[_0xc0b0('0x34')]=_[_0xc0b0('0x31')](db[_0xc0b0('0x5e')][_0xc0b0('0x2e')]);_0x7ead3a[_0xc0b0('0x30')]=_[_0xc0b0('0x31')](_0x2fd21c['query']);_0x7ead3a['filters']=_[_0xc0b0('0x33')](_0x7ead3a[_0xc0b0('0x34')],_0x7ead3a[_0xc0b0('0x30')]);_0x2fa5ff[_0xc0b0('0x35')]=_[_0xc0b0('0x33')](_0x7ead3a[_0xc0b0('0x34')],qs[_0xc0b0('0x36')](_0x2fd21c[_0xc0b0('0x30')]['fields']));_0x2fa5ff[_0xc0b0('0x35')]=_0x2fa5ff[_0xc0b0('0x35')][_0xc0b0('0x37')]?_0x2fa5ff['attributes']:_0x7ead3a[_0xc0b0('0x34')];_0x2fa5ff['order']=qs[_0xc0b0('0x3a')](_0x2fd21c[_0xc0b0('0x30')][_0xc0b0('0x3a')]);_0x2fa5ff[_0xc0b0('0x3b')]=qs[_0xc0b0('0x32')](_['pick'](_0x2fd21c['query'],_0x7ead3a['filters']));if(_0x2fd21c['query'][_0xc0b0('0x40')]){_0x2fa5ff[_0xc0b0('0x3b')]=_[_0xc0b0('0x3d')](_0x2fa5ff['where'],{'$or':_[_0xc0b0('0x2c')](_0x2fa5ff[_0xc0b0('0x35')],function(_0xc60e98){var _0x22c771={};_0x22c771[_0xc60e98]={'$like':'%'+_0x2fd21c[_0xc0b0('0x30')][_0xc0b0('0x40')]+'%'};return _0x22c771;})});}_0x2fa5ff=_['merge']({},_0x2fa5ff,_0x2fd21c[_0xc0b0('0x6d')]);return _0x2005d4[_0xc0b0('0x6c')](_0x2fa5ff);}})['then'](function(_0x1e74dd){if(_0x1e74dd){_0x50fc8d=_0x1e74dd[_0xc0b0('0x37')];if(!_0x2fd21c['query'][_0xc0b0('0x38')](_0xc0b0('0x6e'))){_0x2fa5ff['limit']=qs[_0xc0b0('0x1c')](_0x2fd21c['query'][_0xc0b0('0x1c')]);_0x2fa5ff[_0xc0b0('0x1a')]=qs[_0xc0b0('0x1a')](_0x2fd21c[_0xc0b0('0x30')][_0xc0b0('0x1a')]);}return _0x2005d4['getSounds'](_0x2fa5ff);}})[_0xc0b0('0x23')](function(_0x3f6e0c){if(_0x3f6e0c){return _0x3f6e0c?{'count':_0x50fc8d,'rows':_0x3f6e0c}:null;}})[_0xc0b0('0x23')](respondWithResult(_0x282934,null))[_0xc0b0('0x44')](handleError(_0x282934,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1a8d8d7..9a50f2e 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 _0x26b4=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x394d06,_0x4ed578){var _0x22c2c8=function(_0x5ef2a1){while(--_0x5ef2a1){_0x394d06['push'](_0x394d06['shift']());}};_0x22c2c8(++_0x4ed578);}(_0x26b4,0x174));var _0x426b=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x26b4[_0x220f3f];return _0x1f170e;};'use strict';var _=require('lodash');var util=require(_0x426b('0x0'));var logger=require(_0x426b('0x1'))(_0x426b('0x2'));var moment=require(_0x426b('0x3'));var BPromise=require(_0x426b('0x4'));var rp=require(_0x426b('0x5'));var fs=require('fs');var path=require(_0x426b('0x6'));var rimraf=require(_0x426b('0x7'));var config=require(_0x426b('0x8'));var attributes=require(_0x426b('0x9'));module[_0x426b('0xa')]=function(_0x19ab9a,_0x4f2b70){return _0x19ab9a[_0x426b('0xb')](_0x426b('0xc'),attributes,{'tableName':_0x426b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd03=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold'];(function(_0x3e6aed,_0x97a2f1){var _0x3220dd=function(_0x252cd2){while(--_0x252cd2){_0x3e6aed['push'](_0x3e6aed['shift']());}};_0x3220dd(++_0x97a2f1);}(_0xfd03,0xa2));var _0x3fd0=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0xfd03[_0x46a671];return _0x526d75;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3fd0('0x0'))(_0x3fd0('0x1'));var moment=require(_0x3fd0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fd0('0x3'));var rimraf=require(_0x3fd0('0x4'));var config=require(_0x3fd0('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x3fd0('0x6')]=function(_0x59d2f4,_0x35c9ba){return _0x59d2f4[_0x3fd0('0x7')](_0x3fd0('0x8'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 338a7dc..2a83830 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(_0x41a6db,_0x2e7370){var _0x392e32=function(_0x5e009c){while(--_0x5e009c){_0x41a6db['push'](_0x41a6db['shift']());}};_0x392e32(++_0x2e7370);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3bab09,_0x217c29){_0x3bab09=_0x3bab09-0x0;var _0x164376=_0xcb91[_0x3bab09];return _0x164376;};'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(_0x4af6fe,_0x3c2802){var _0x49ace7=function(_0x3a93e3){while(--_0x3a93e3){_0x4af6fe['push'](_0x4af6fe['shift']());}};_0x49ace7(++_0x3c2802);}(_0xedd9,0xfc));var _0x9edd=function(_0x3cffdd,_0x1f91f7){_0x3cffdd=_0x3cffdd-0x0;var _0x17ee9c=_0xedd9[_0x3cffdd];return _0x17ee9c;};'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 fe8455c..85cafd0 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 _0x6a39=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','addTeams','put','update','destroy','delete','removeAgents','removeTeams','multer','util','path','connect-timeout'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x6a39,0x140));var _0x96a3=function(_0x50fc19,_0x2685e7){_0x50fc19=_0x50fc19-0x0;var _0x30c392=_0x6a39[_0x50fc19];return _0x30c392;};'use strict';var multer=require(_0x96a3('0x0'));var util=require(_0x96a3('0x1'));var path=require(_0x96a3('0x2'));var timeout=require(_0x96a3('0x3'));var express=require(_0x96a3('0x4'));var router=express[_0x96a3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x96a3('0x6'));var interaction=require(_0x96a3('0x7'));var config=require(_0x96a3('0x8'));var controller=require(_0x96a3('0x9'));router[_0x96a3('0xa')]('/',auth[_0x96a3('0xb')](),controller[_0x96a3('0xc')]);router[_0x96a3('0xa')](_0x96a3('0xd'),auth[_0x96a3('0xb')](),controller['describe']);router[_0x96a3('0xa')](_0x96a3('0xe'),auth[_0x96a3('0xb')](),controller['show']);router[_0x96a3('0xa')](_0x96a3('0xf'),auth[_0x96a3('0xb')](),controller[_0x96a3('0x10')]);router[_0x96a3('0xa')](_0x96a3('0x11'),auth[_0x96a3('0xb')](),controller[_0x96a3('0x12')]);router[_0x96a3('0x13')]('/',auth[_0x96a3('0xb')](),controller['create']);router[_0x96a3('0x13')]('/:id/users',auth[_0x96a3('0xb')](),controller['addAgents']);router[_0x96a3('0x13')]('/:id/teams',auth[_0x96a3('0xb')](),controller[_0x96a3('0x14')]);router[_0x96a3('0x15')]('/:id',auth[_0x96a3('0xb')](),controller[_0x96a3('0x16')]);router['delete']('/:id',auth[_0x96a3('0xb')](),controller[_0x96a3('0x17')]);router[_0x96a3('0x18')](_0x96a3('0xf'),auth['isAuthenticated'](),controller[_0x96a3('0x19')]);router[_0x96a3('0x18')]('/:id/teams',auth[_0x96a3('0xb')](),controller[_0x96a3('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xdd41=['../../config/environment','./voicePrefix.controller','isAuthenticated','index','/describe','get','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','update','delete','/:id','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x38f86b,_0x45b662){var _0x10832f=function(_0x35f66a){while(--_0x35f66a){_0x38f86b['push'](_0x38f86b['shift']());}};_0x10832f(++_0x45b662);}(_0xdd41,0x1f2));var _0x1dd4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd41[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1dd4('0x0'));var util=require(_0x1dd4('0x1'));var path=require(_0x1dd4('0x2'));var timeout=require(_0x1dd4('0x3'));var express=require('express');var router=express[_0x1dd4('0x4')]();var fs_extra=require(_0x1dd4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1dd4('0x6'));var controller=require(_0x1dd4('0x7'));router['get']('/',auth[_0x1dd4('0x8')](),controller[_0x1dd4('0x9')]);router['get'](_0x1dd4('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x1dd4('0x8')](),controller['show']);router[_0x1dd4('0xb')](_0x1dd4('0xc'),auth[_0x1dd4('0x8')](),controller[_0x1dd4('0xd')]);router['get'](_0x1dd4('0xe'),auth['isAuthenticated'](),controller[_0x1dd4('0xf')]);router[_0x1dd4('0x10')]('/',auth[_0x1dd4('0x8')](),controller[_0x1dd4('0x11')]);router[_0x1dd4('0x10')]('/:id/users',auth[_0x1dd4('0x8')](),controller[_0x1dd4('0x12')]);router[_0x1dd4('0x10')](_0x1dd4('0xe'),auth[_0x1dd4('0x8')](),controller[_0x1dd4('0x13')]);router[_0x1dd4('0x14')]('/:id',auth[_0x1dd4('0x8')](),controller[_0x1dd4('0x15')]);router[_0x1dd4('0x16')](_0x1dd4('0x17'),auth[_0x1dd4('0x8')](),controller[_0x1dd4('0x18')]);router[_0x1dd4('0x16')](_0x1dd4('0xc'),auth[_0x1dd4('0x8')](),controller[_0x1dd4('0x19')]);router['delete']('/:id/teams',auth[_0x1dd4('0x8')](),controller[_0x1dd4('0x1a')]);module[_0x1dd4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a48bf0f..5d34a12 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 _0x5db3=['VIRTUAL','system-','getDataValue','STRING','INTEGER','exports','name'];(function(_0x1b83ab,_0x177b36){var _0x152034=function(_0x359c82){while(--_0x359c82){_0x1b83ab['push'](_0x1b83ab['shift']());}};_0x152034(++_0x177b36);}(_0x5db3,0x1a9));var _0x35db=function(_0x59b439,_0x14ae7b){_0x59b439=_0x59b439-0x0;var _0x521ea3=_0x5db3[_0x59b439];return _0x521ea3;};'use strict';var Sequelize=require('sequelize');module[_0x35db('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x35db('0x1')},'prefix':{'type':Sequelize[_0x35db('0x2')],'get':function(_0x41177e){return _0x35db('0x3')+this[_0x35db('0x4')](_0x35db('0x1'))+'-';}},'description':{'type':Sequelize[_0x35db('0x5')]},'callerIdAll':{'type':Sequelize[_0x35db('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x35db('0x6')]}}; \ No newline at end of file +var _0x80c6=['getDataValue','INTEGER','sequelize','STRING','name','VIRTUAL','system-'];(function(_0x571915,_0x16f00c){var _0x57c6ea=function(_0x1f18c1){while(--_0x1f18c1){_0x571915['push'](_0x571915['shift']());}};_0x57c6ea(++_0x16f00c);}(_0x80c6,0x160));var _0x680c=function(_0x304f7a,_0x33989c){_0x304f7a=_0x304f7a-0x0;var _0x42ef52=_0x80c6[_0x304f7a];return _0x42ef52;};'use strict';var Sequelize=require(_0x680c('0x0'));module['exports']={'name':{'type':Sequelize[_0x680c('0x1')],'allowNull':![],'unique':_0x680c('0x2')},'prefix':{'type':Sequelize[_0x680c('0x3')],'get':function(_0xfb022d){return _0x680c('0x4')+this[_0x680c('0x5')](_0x680c('0x2'))+'-';}},'description':{'type':Sequelize[_0x680c('0x1')]},'callerIdAll':{'type':Sequelize[_0x680c('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x680c('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index a02cffd..ef58c21 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 _0xe820=['appdata','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','prefix','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','VoiceExtensionId','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','nolimit','getTeams','Team','User','Agents','online','voicePause','flatMap','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','removeTeams','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','value','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','sendStatus','error','name','send','map','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','includeAll','include','find','describe','create','sequelize','transaction','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority'];(function(_0x10b53c,_0xa0c4){var _0x43326f=function(_0xac80b2){while(--_0xac80b2){_0x10b53c['push'](_0x10b53c['shift']());}};_0x43326f(++_0xa0c4);}(_0xe820,0xd2));var _0x0e82=function(_0xe69b7e,_0x7fdc36){_0xe69b7e=_0xe69b7e-0x0;var _0x5e6a0f=_0xe820[_0xe69b7e];return _0x5e6a0f;};'use strict';var emlformat=require(_0x0e82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0e82('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0e82('0x2'));var BPromise=require(_0x0e82('0x3'));var Mustache=require(_0x0e82('0x4'));var util=require('util');var path=require(_0x0e82('0x5'));var sox=require('sox');var csv=require(_0x0e82('0x6'));var ejs=require(_0x0e82('0x7'));var fs=require('fs');var fs_extra=require(_0x0e82('0x8'));var _=require(_0x0e82('0x9'));var squel=require(_0x0e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0e82('0xb'));var deskjs=require(_0x0e82('0xc'));var toCsv=require(_0x0e82('0x6'));var querystring=require(_0x0e82('0xd'));var Papa=require(_0x0e82('0xe'));var Redis=require('ioredis');var authService=require(_0x0e82('0xf'));var qs=require(_0x0e82('0x10'));var as=require(_0x0e82('0x11'));var hardwareService=require(_0x0e82('0x12'));var logger=require(_0x0e82('0x13'))(_0x0e82('0x14'));var utils=require(_0x0e82('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x0e82('0x16'));var db=require(_0x0e82('0x17'))['db'];config[_0x0e82('0x18')]=_[_0x0e82('0x19')](config[_0x0e82('0x18')],{'host':_0x0e82('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0e82('0x18')]));require('./voicePrefix.socket')['register'](socket);function respondWithStatusCode(_0x1e4ddb,_0x4b748a){_0x4b748a=_0x4b748a||0xcc;return function(_0x5b4ffd){if(_0x5b4ffd){return _0x1e4ddb['sendStatus'](_0x4b748a);}return _0x1e4ddb[_0x0e82('0x1b')](_0x4b748a)['end']();};}function respondWithResult(_0x585b9b,_0x1149b1){_0x1149b1=_0x1149b1||0xc8;return function(_0x582f45){if(_0x582f45){return _0x585b9b[_0x0e82('0x1b')](_0x1149b1)[_0x0e82('0x1c')](_0x582f45);}};}function respondWithFilteredResult(_0x233c6d,_0x315ce4){return function(_0x53622b){if(_0x53622b){var _0x25ac21=typeof _0x315ce4[_0x0e82('0x1d')]===_0x0e82('0x1e')&&typeof _0x315ce4[_0x0e82('0x1f')]===_0x0e82('0x1e');var _0x1230e6=_0x53622b[_0x0e82('0x20')];var _0x3735c0=_0x25ac21?0x0:_0x315ce4[_0x0e82('0x1d')];var _0x224455=_0x25ac21?_0x53622b[_0x0e82('0x20')]:_0x315ce4['offset']+_0x315ce4['limit'];var _0x294696;if(_0x224455>=_0x1230e6){_0x224455=_0x1230e6;_0x294696=0xc8;}else{_0x294696=0xce;}_0x233c6d[_0x0e82('0x1b')](_0x294696);return _0x233c6d[_0x0e82('0x21')](_0x0e82('0x22'),_0x3735c0+'-'+_0x224455+'/'+_0x1230e6)[_0x0e82('0x1c')](_0x53622b);}return null;};}function patchUpdates(_0x1bdad4){return function(_0x39fcbe){try{jsonpatch[_0x0e82('0x23')](_0x39fcbe,_0x1bdad4,!![]);}catch(_0x56b3ad){return BPromise[_0x0e82('0x24')](_0x56b3ad);}return _0x39fcbe[_0x0e82('0x25')]();};}function saveUpdates(_0x3d6c28,_0x24f883){return function(_0x507f08){if(_0x507f08){return _0x507f08[_0x0e82('0x26')](_0x3d6c28)[_0x0e82('0x27')](function(_0x7a9399){return _0x7a9399;});}return null;};}function removeEntity(_0x16e11c,_0x4900d3){return function(_0x1ef751){if(_0x1ef751){return _0x1ef751['destroy']()['then'](function(){var _0x384f88=_0x1ef751[_0x0e82('0x28')]({'plain':!![]});var _0x4c5fc1=_0x0e82('0x29');return db[_0x0e82('0x2a')][_0x0e82('0x2b')]({'where':{'type':_0x4c5fc1,'resourceId':_0x384f88['id']}})['then'](function(){return _0x1ef751;});})[_0x0e82('0x27')](function(){_0x16e11c[_0x0e82('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xabc536,_0x59a5b6){return function(_0x4300f9){if(!_0x4300f9){_0xabc536[_0x0e82('0x2c')](0x194);}return _0x4300f9;};}function handleError(_0x551f96,_0x38cbbc){_0x38cbbc=_0x38cbbc||0x1f4;return function(_0x268af5){logger[_0x0e82('0x2d')](_0x268af5['stack']);if(_0x268af5['name']){delete _0x268af5[_0x0e82('0x2e')];}_0x551f96['status'](_0x38cbbc)[_0x0e82('0x2f')](_0x268af5);};}exports['index']=function(_0x1a3b2e,_0x264022){var _0x44e177={},_0x56ca79={},_0x45a40e={'count':0x0,'rows':[]};var _0x59d2f8=_[_0x0e82('0x30')](db[_0x0e82('0x31')][_0x0e82('0x32')],function(_0x30c993){return{'name':_0x30c993[_0x0e82('0x33')],'type':_0x30c993[_0x0e82('0x34')]['key']};});_0x56ca79[_0x0e82('0x35')]=_[_0x0e82('0x30')](_0x59d2f8,_0x0e82('0x2e'));_0x56ca79[_0x0e82('0x36')]=_[_0x0e82('0x37')](_0x1a3b2e[_0x0e82('0x36')]);_0x56ca79[_0x0e82('0x38')]=_[_0x0e82('0x39')](_0x56ca79[_0x0e82('0x35')],_0x56ca79[_0x0e82('0x36')]);_0x44e177[_0x0e82('0x3a')]=_[_0x0e82('0x39')](_0x56ca79[_0x0e82('0x35')],qs[_0x0e82('0x3b')](_0x1a3b2e[_0x0e82('0x36')]['fields']));_0x44e177[_0x0e82('0x3a')]=_0x44e177[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x44e177[_0x0e82('0x3a')]:_0x56ca79['model'];if(!_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x3d')]('nolimit')){_0x44e177[_0x0e82('0x1f')]=qs['limit'](_0x1a3b2e['query'][_0x0e82('0x1f')]);_0x44e177[_0x0e82('0x1d')]=qs[_0x0e82('0x1d')](_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x1d')]);}_0x44e177[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x1a3b2e['query']['sort']);_0x44e177[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x1a3b2e[_0x0e82('0x36')],_0x56ca79[_0x0e82('0x38')]),_0x59d2f8);if(_0x1a3b2e[_0x0e82('0x36')][_0x0e82('0x42')]){_0x44e177[_0x0e82('0x40')]=_['merge'](_0x44e177[_0x0e82('0x40')],{'$or':_[_0x0e82('0x30')](_0x59d2f8,function(_0x233a18){if(_0x233a18[_0x0e82('0x34')]!==_0x0e82('0x43')){var _0x3d0a45={};_0x3d0a45[_0x233a18[_0x0e82('0x2e')]]={'$like':'%'+_0x1a3b2e['query'][_0x0e82('0x42')]+'%'};return _0x3d0a45;}})});}_0x44e177=_[_0x0e82('0x44')]({},_0x44e177,_0x1a3b2e[_0x0e82('0x45')]);var _0x36fe4c={'where':_0x44e177[_0x0e82('0x40')]};return db[_0x0e82('0x31')][_0x0e82('0x20')](_0x36fe4c)['then'](function(_0x581764){_0x45a40e['count']=_0x581764;if(_0x1a3b2e['query']['includeAll']){_0x44e177['include']=[{'all':!![]}];}return db[_0x0e82('0x31')][_0x0e82('0x46')](_0x44e177);})[_0x0e82('0x27')](function(_0x199495){_0x45a40e[_0x0e82('0x47')]=_0x199495;return _0x45a40e;})[_0x0e82('0x27')](respondWithFilteredResult(_0x264022,_0x44e177))[_0x0e82('0x48')](handleError(_0x264022,null));};exports[_0x0e82('0x49')]=function(_0x55b53a,_0x484f94){var _0x2ae914={'raw':![],'where':{'id':_0x55b53a[_0x0e82('0x4a')]['id']}},_0x36a0c2={};_0x36a0c2[_0x0e82('0x35')]=_[_0x0e82('0x37')](db[_0x0e82('0x31')][_0x0e82('0x32')]);_0x36a0c2[_0x0e82('0x36')]=_['keys'](_0x55b53a[_0x0e82('0x36')]);_0x36a0c2['filters']=_[_0x0e82('0x39')](_0x36a0c2['model'],_0x36a0c2[_0x0e82('0x36')]);_0x2ae914['attributes']=_[_0x0e82('0x39')](_0x36a0c2[_0x0e82('0x35')],qs[_0x0e82('0x3b')](_0x55b53a['query']['fields']));_0x2ae914[_0x0e82('0x3a')]=_0x2ae914[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x2ae914['attributes']:_0x36a0c2[_0x0e82('0x35')];if(_0x55b53a['query'][_0x0e82('0x4b')]){_0x2ae914[_0x0e82('0x4c')]=[{'all':!![]}];}_0x2ae914=_[_0x0e82('0x44')]({},_0x2ae914,_0x55b53a[_0x0e82('0x45')]);return db[_0x0e82('0x31')][_0x0e82('0x4d')](_0x2ae914)[_0x0e82('0x27')](handleEntityNotFound(_0x484f94,null))[_0x0e82('0x27')](respondWithResult(_0x484f94,null))[_0x0e82('0x48')](handleError(_0x484f94,null));};exports[_0x0e82('0x2b')]=function(_0x41e27e,_0x22c249){return db['VoicePrefix'][_0x0e82('0x4d')]({'where':{'id':_0x41e27e[_0x0e82('0x4a')]['id']}})['then'](handleEntityNotFound(_0x22c249,null))[_0x0e82('0x27')](removeEntity(_0x22c249,null))['catch'](handleError(_0x22c249,null));};exports['describe']=function(_0x42a535,_0x505663){return db[_0x0e82('0x31')][_0x0e82('0x4e')]()[_0x0e82('0x27')](respondWithResult(_0x505663,null))[_0x0e82('0x48')](handleError(_0x505663,null));};exports[_0x0e82('0x4f')]=function(_0x535f6d,_0x104bfe){var _0x4cb6e7;return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x42c4a7){return db[_0x0e82('0x31')][_0x0e82('0x4f')](_0x535f6d['body'],{'transaction':_0x42c4a7})[_0x0e82('0x27')](function(_0x22d56b){_0x4cb6e7=_0x22d56b[_0x0e82('0x28')]({'plain':!![]});return db[_0x0e82('0x52')][_0x0e82('0x4d')]({'where':{'id':_0x4cb6e7['VoiceExtensionId']},'raw':!![]})[_0x0e82('0x27')](function(_0x348b00){return createVoicePrefixExtensions(_0x4cb6e7,_0x348b00,_0x42c4a7);});});})[_0x0e82('0x27')](function(){var _0x1e6d69=_0x535f6d[_0x0e82('0x53')][_0x0e82('0x28')]({'plain':!![]});if(!_0x1e6d69)throw new Error(_0x0e82('0x54'));if(_0x1e6d69[_0x0e82('0x55')]===_0x0e82('0x53')){var _0x2852d4=_0x4cb6e7;return db['UserProfileSection']['find']({'where':{'name':'VoicePrefixes','userProfileId':_0x1e6d69[_0x0e82('0x56')]},'raw':!![]})['then'](function(_0x23741c){if(_0x23741c&&_0x23741c[_0x0e82('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x2852d4[_0x0e82('0x2e')],'resourceId':_0x2852d4['id'],'type':_0x23741c[_0x0e82('0x2e')],'sectionId':_0x23741c['id']},{})[_0x0e82('0x27')](function(){return _0x4cb6e7;});}else{return _0x4cb6e7;}})[_0x0e82('0x48')](function(_0x174da5){logger[_0x0e82('0x2d')](_0x0e82('0x58'),_0x174da5);throw _0x174da5;});}return _0x4cb6e7;})[_0x0e82('0x27')](respondWithResult(_0x104bfe,null))[_0x0e82('0x48')](handleError(_0x104bfe,null));};function Extension(_0x3b35e0,_0x4ce423,_0x30e9f1,_0x21aaac){this[_0x0e82('0x59')]=_0x0e82('0x5a');this[_0x0e82('0x5b')]=_0x3b35e0;this[_0x0e82('0x5c')]=_0x30e9f1;this[_0x0e82('0x34')]=_0x0e82('0x5d');this['description']=_0x0e82('0x5e');this[_0x0e82('0x5f')]=_0x4ce423;this[_0x0e82('0x60')]=_0x21aaac;}function createVoicePrefixExtensions(_0x1ea2fc,_0x21c870,_0x28f3b7){return new BPromise(function(_0x2d1e59,_0x11ef9e){var _0x20bf0c=new Extension(formatPrefixName(_0x1ea2fc['prefix']),0x1,_0x0e82('0x61'),'Voice\x20Prefix');_0x20bf0c[_0x0e82('0x62')]=_0x1ea2fc['id'];return db['VoiceExtension'][_0x0e82('0x4f')](_0x20bf0c,{'transaction':_0x28f3b7})[_0x0e82('0x27')](function(_0x5f3ec3){var _0x30e0a3=_0x5f3ec3[_0x0e82('0x28')]({'plain':!![]});var _0x244b42=_[_0x0e82('0x30')](addVoicePrefixExtensions(_0x1ea2fc,_0x21c870),function(_0x336df1){_0x336df1['VoiceExtensionId']=_0x30e0a3['id'];_0x336df1[_0x0e82('0x62')]=_0x1ea2fc['id'];return _0x336df1;});return db['VoiceExtension']['bulkCreate'](_0x244b42,{'transaction':_0x28f3b7})[_0x0e82('0x27')](function(_0x2cf29f){if(!_0x2cf29f){return _0x11ef9e(_0x0e82('0x63'));}else{return _0x2d1e59(_0x2cf29f);}})[_0x0e82('0x48')](function(_0x2bdca1){return _0x11ef9e(_0x2bdca1);});});;});};function addVoicePrefixExtensions(_0xa4fe1f,_0xb1a061){var _0x41ef93=[];var _0x277327=formatPrefixName(_0xa4fe1f[_0x0e82('0x64')]);_0x41ef93['push'](new Extension(_0x277327,0x2,'Set',_0x0e82('0x65')+_0xa4fe1f['name']));if(_0xa4fe1f[_0x0e82('0x66')]){_0x41ef93[_0x0e82('0x67')](new Extension(_0x277327,0x3,'Set',_0x0e82('0x68')+_0xa4fe1f[_0x0e82('0x66')]));}else{_0x41ef93['push'](new Extension(_0x277327,0x3,_0x0e82('0x61'),_0x0e82('0x69')));}_0x41ef93['push'](new Extension(_0x277327,0x4,_0x0e82('0x6a'),_0xb1a061['context']+','+_0x0e82('0x6b')+(0x8+_0xa4fe1f[_0x0e82('0x2e')][_0x0e82('0x3c')])+'}'+','+0x1));return _0x41ef93;}function formatPrefixName(_0x3bdc68){var _0x34faf5='_';for(var _0x75a64d=0x0;_0x75a64d<_0x3bdc68[_0x0e82('0x3c')];_0x75a64d++){if(_0x3bdc68[_0x0e82('0x6c')](_0x75a64d)=='-'){_0x34faf5+=_0x3bdc68[_0x0e82('0x6c')](_0x75a64d);}else{_0x34faf5+='['+_0x3bdc68[_0x0e82('0x6c')](_0x75a64d)+']';}}_0x34faf5+='.';return _0x34faf5;}exports['update']=function(_0x39911a,_0x4a696b,_0x131698){var _0x2dfd03=_0x39911a[_0x0e82('0x6d')];_0x2dfd03['prefix']=_0x0e82('0x6e')+_0x2dfd03[_0x0e82('0x2e')]+'-';return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x1a67bc){return db['VoicePrefix'][_0x0e82('0x26')](_0x2dfd03,{'where':{'id':_0x2dfd03['id']},'transaction':_0x1a67bc})['then'](function(){return db[_0x0e82('0x52')][_0x0e82('0x2b')]({'where':{'VoicePrefixId':_0x2dfd03['id']},'transaction':_0x1a67bc})['then'](function(){return db['VoiceExtension'][_0x0e82('0x4d')]({'where':{'id':_0x2dfd03[_0x0e82('0x6f')]},'raw':!![]})[_0x0e82('0x27')](function(_0x22791b){return createVoicePrefixExtensions(_0x2dfd03,_0x22791b,_0x1a67bc);});});});})[_0x0e82('0x27')](function(){return db[_0x0e82('0x31')][_0x0e82('0x70')](_0x2dfd03['id']);})[_0x0e82('0x27')](respondWithResult(_0x4a696b,null))[_0x0e82('0x48')](handleError(_0x4a696b,null));};exports['addAgents']=function(_0x4249fd,_0x328d74,_0x480d15){return db['VoicePrefix']['find']({'where':{'id':_0x4249fd[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x328d74,null))[_0x0e82('0x27')](function(_0x542b28){if(_0x542b28){return _0x542b28[_0x0e82('0x71')](_0x4249fd['body'][_0x0e82('0x72')],_[_0x0e82('0x73')](_0x4249fd[_0x0e82('0x6d')],[_0x0e82('0x72'),'id'])||{})[_0x0e82('0x74')](function(_0x48ac18){for(var _0x28097c=0x0;_0x28097c<_0x4249fd[_0x0e82('0x6d')]['ids'][_0x0e82('0x3c')];_0x28097c+=0x1){socket[_0x0e82('0x75')](_0x0e82('0x76'),{'UserId':Number(_0x4249fd['body'][_0x0e82('0x72')][_0x28097c]),'VoicePrefixId':Number(_0x4249fd['params']['id'])});}return _0x48ac18;});}})[_0x0e82('0x27')](respondWithResult(_0x328d74,null))[_0x0e82('0x48')](handleError(_0x328d74,null));};exports[_0x0e82('0x77')]=function(_0x5ca20d,_0xe258d4,_0x115800){return db[_0x0e82('0x31')][_0x0e82('0x4d')]({'where':{'id':_0x5ca20d['params']['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0xe258d4,null))[_0x0e82('0x27')](function(_0x168bf1){if(_0x168bf1){return _0x168bf1[_0x0e82('0x77')](_0x5ca20d[_0x0e82('0x36')]['ids'])[_0x0e82('0x27')](function(){if(_['isArray'](_0x5ca20d[_0x0e82('0x36')]['ids'])){for(var _0x40e10c=0x0;_0x40e10c<_0x5ca20d[_0x0e82('0x36')]['ids'][_0x0e82('0x3c')];_0x40e10c+=0x1){socket[_0x0e82('0x75')](_0x0e82('0x78'),{'UserId':Number(_0x5ca20d['query']['ids'][_0x40e10c]),'VoicePrefixId':Number(_0x5ca20d['params']['id'])});}}else{socket[_0x0e82('0x75')](_0x0e82('0x78'),{'UserId':Number(_0x5ca20d[_0x0e82('0x36')]['ids']),'VoicePrefixId':Number(_0x5ca20d[_0x0e82('0x4a')]['id'])});}});}})[_0x0e82('0x27')](respondWithStatusCode(_0xe258d4,null))[_0x0e82('0x48')](handleError(_0xe258d4,null));};exports[_0x0e82('0x79')]=function(_0x183fe7,_0x27928f,_0x6fcbe1){var _0x446a39={};var _0x556a2d={};var _0x445d82;var _0x384428;return db[_0x0e82('0x31')][_0x0e82('0x7a')]({'where':{'id':_0x183fe7[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x27928f,null))[_0x0e82('0x27')](function(_0x42b39c){if(_0x42b39c){_0x445d82=_0x42b39c;_0x556a2d['model']=_[_0x0e82('0x37')](db['User']['rawAttributes']);_0x556a2d['query']=_[_0x0e82('0x37')](_0x183fe7[_0x0e82('0x36')]);_0x556a2d[_0x0e82('0x38')]=_[_0x0e82('0x39')](_0x556a2d['model'],_0x556a2d[_0x0e82('0x36')]);_0x446a39['attributes']=_[_0x0e82('0x39')](_0x556a2d[_0x0e82('0x35')],qs['fields'](_0x183fe7[_0x0e82('0x36')]['fields']));_0x446a39['attributes']=_0x446a39[_0x0e82('0x3a')][_0x0e82('0x3c')]?_0x446a39['attributes']:_0x556a2d['model'];_0x446a39[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x183fe7[_0x0e82('0x36')][_0x0e82('0x3f')]);_0x446a39[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x183fe7[_0x0e82('0x36')],_0x556a2d['filters']));if(_0x183fe7['query'][_0x0e82('0x42')]){_0x446a39[_0x0e82('0x40')]=_[_0x0e82('0x44')](_0x446a39[_0x0e82('0x40')],{'$or':_[_0x0e82('0x30')](_0x446a39[_0x0e82('0x3a')],function(_0x350b6c){var _0x56804d={};_0x56804d[_0x350b6c]={'$like':'%'+_0x183fe7[_0x0e82('0x36')]['filter']+'%'};return _0x56804d;})});}_0x446a39=_['merge']({},_0x446a39,_0x183fe7[_0x0e82('0x45')]);return _0x445d82['getAgents'](_0x446a39);}})[_0x0e82('0x27')](function(_0x2ca1e2){if(_0x2ca1e2){_0x384428=_0x2ca1e2['length'];if(!_0x183fe7[_0x0e82('0x36')][_0x0e82('0x3d')](_0x0e82('0x7b'))){_0x446a39[_0x0e82('0x1f')]=qs[_0x0e82('0x1f')](_0x183fe7[_0x0e82('0x36')][_0x0e82('0x1f')]);_0x446a39['offset']=qs[_0x0e82('0x1d')](_0x183fe7['query']['offset']);}return _0x445d82['getAgents'](_0x446a39);}})[_0x0e82('0x27')](function(_0x30f947){if(_0x30f947){return _0x30f947?{'count':_0x384428,'rows':_0x30f947}:null;}})[_0x0e82('0x27')](respondWithResult(_0x27928f,null))[_0x0e82('0x48')](handleError(_0x27928f,null));};exports[_0x0e82('0x7c')]=function(_0x33eaa3,_0x57d238,_0x890f08){var _0x4a5773={};var _0x5f59f1={};var _0x48bd88;var _0x1fad5a;return db['VoicePrefix']['findOne']({'where':{'id':_0x33eaa3[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](handleEntityNotFound(_0x57d238,null))['then'](function(_0x5800a5){if(_0x5800a5){_0x48bd88=_0x5800a5;_0x5f59f1[_0x0e82('0x35')]=_['keys'](db[_0x0e82('0x7d')][_0x0e82('0x32')]);_0x5f59f1[_0x0e82('0x36')]=_['keys'](_0x33eaa3[_0x0e82('0x36')]);_0x5f59f1[_0x0e82('0x38')]=_['intersection'](_0x5f59f1[_0x0e82('0x35')],_0x5f59f1[_0x0e82('0x36')]);_0x4a5773['attributes']=_[_0x0e82('0x39')](_0x5f59f1[_0x0e82('0x35')],qs['fields'](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3b')]));_0x4a5773[_0x0e82('0x3a')]=_0x4a5773[_0x0e82('0x3a')]['length']?_0x4a5773['attributes']:_0x5f59f1[_0x0e82('0x35')];_0x4a5773[_0x0e82('0x3e')]=qs[_0x0e82('0x3f')](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3f')]);_0x4a5773[_0x0e82('0x40')]=qs[_0x0e82('0x38')](_[_0x0e82('0x41')](_0x33eaa3[_0x0e82('0x36')],_0x5f59f1['filters']));if(_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x42')]){_0x4a5773[_0x0e82('0x40')]=_[_0x0e82('0x44')](_0x4a5773['where'],{'$or':_[_0x0e82('0x30')](_0x4a5773[_0x0e82('0x3a')],function(_0x51b943){var _0x148a2f={};_0x148a2f[_0x51b943]={'$like':'%'+_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x42')]+'%'};return _0x148a2f;})});}_0x4a5773=_[_0x0e82('0x44')]({},_0x4a5773,_0x33eaa3[_0x0e82('0x45')]);return _0x48bd88[_0x0e82('0x7c')](_0x4a5773);}})['then'](function(_0x17a56d){if(_0x17a56d){_0x1fad5a=_0x17a56d['length'];if(!_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x3d')](_0x0e82('0x7b'))){_0x4a5773[_0x0e82('0x1f')]=qs[_0x0e82('0x1f')](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x1f')]);_0x4a5773[_0x0e82('0x1d')]=qs['offset'](_0x33eaa3[_0x0e82('0x36')][_0x0e82('0x1d')]);}return _0x48bd88[_0x0e82('0x7c')](_0x4a5773);}})['then'](function(_0x273036){if(_0x273036){return _0x273036?{'count':_0x1fad5a,'rows':_0x273036}:null;}})['then'](respondWithResult(_0x57d238,null))[_0x0e82('0x48')](handleError(_0x57d238,null));};exports['addTeams']=function(_0x317358,_0x3691ac,_0x436572){var _0x532041=_0x317358[_0x0e82('0x6d')][_0x0e82('0x72')];var _0xae4be5;return db[_0x0e82('0x7d')]['findAll']({'where':{'id':_0x532041},'attributes':['id'],'include':[{'model':db[_0x0e82('0x7e')],'as':_0x0e82('0x7f'),'attributes':['id',_0x0e82('0x2e'),_0x0e82('0x80'),_0x0e82('0x81'),'interface'],'raw':!![]}]})[_0x0e82('0x27')](function(_0x252df2){if(_0x252df2){_0xae4be5=_0x252df2;var _0xca734b=_[_0x0e82('0x82')](_0x252df2,function(_0x456bad){var _0x4ed7ba=_0x456bad['get']({'plain':!![]});return _0x4ed7ba[_0x0e82('0x7f')];});return db[_0x0e82('0x31')]['find']({'where':{'id':_0x317358['params']['id']}})[_0x0e82('0x27')](function(_0x226726){return db[_0x0e82('0x50')][_0x0e82('0x51')](function(_0x326ed0){return _0x226726[_0x0e82('0x83')](_0x532041,{'transaction':_0x326ed0})['then'](function(){return BPromise[_0x0e82('0x84')](_0xae4be5,function(_0x270ad0){return db[_0x0e82('0x85')][_0x0e82('0x86')]({'TeamId':_0x270ad0['id'],'VoicePrefixId':_0x317358['params']['id']},{'transaction':_0x326ed0});});})['then'](function(){return BPromise[_0x0e82('0x84')](_0xca734b,function(_0x38a73a){return db[_0x0e82('0x87')][_0x0e82('0x88')]({'where':{'UserId':_0x38a73a['id'],'VoicePrefixId':_0x317358[_0x0e82('0x4a')]['id']},'transaction':_0x326ed0});});})['then'](function(){_0xca734b['forEach'](function(_0x3ab464){socket['emit'](_0x0e82('0x76'),{'UserId':_0x3ab464['id'],'VoicePrefixId':_0x226726['id']});});});});});}})['then'](respondWithStatusCode(_0x3691ac,null))[_0x0e82('0x48')](handleError(_0x3691ac,null));};exports[_0x0e82('0x89')]=function(_0x33d446,_0x34d730,_0x1c1a0d){return db[_0x0e82('0x7d')]['findAll']({'where':{'id':_0x33d446['query'][_0x0e82('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0e82('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x0e82('0x27')](handleEntityNotFound(_0x34d730,null))[_0x0e82('0x27')](function(_0x1c5350){var _0x396f44=_[_0x0e82('0x30')](_0x1c5350,'id');var _0x1d79b5=[];var _0x1e305f=[];var _0x25c63b=squel['select']();_0x25c63b[_0x0e82('0x8a')](_0x0e82('0x8b'))[_0x0e82('0x8c')](_0x0e82('0x8d'),'tq')[_0x0e82('0x8e')](_0x0e82('0x8f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0e82('0x40')](_0x0e82('0x90'),_0x33d446[_0x0e82('0x4a')]['id']);for(var _0x5d13ab=0x0;_0x5d13ab<_0x1c5350[_0x0e82('0x3c')];_0x5d13ab+=0x1){let _0xf8b029=_0x1c5350[_0x5d13ab];for(var _0x5581e6=0x0;_0x5581e6<_0xf8b029[_0x0e82('0x7f')][_0x0e82('0x3c')];_0x5581e6+=0x1){let _0x524665=_0xf8b029[_0x0e82('0x7f')][_0x5581e6];var _0x32264b=_0x25c63b[_0x0e82('0x91')]();_0x32264b[_0x0e82('0x40')](_0x0e82('0x92'),_0x524665['id']);_0x1e305f[_0x0e82('0x67')](db[_0x0e82('0x50')][_0x0e82('0x36')](_0x32264b[_0x0e82('0x93')](),{'type':db[_0x0e82('0x50')]['QueryTypes'][_0x0e82('0x94')]})['then'](function(_0x546f99){if(_0x546f99[_0x0e82('0x3c')]===0x1){return _0x524665['id'];}else{var _0x4b3009=_[_0x0e82('0x95')](_[_0x0e82('0x30')](_0x546f99,_0x0e82('0x96')),function(_0x414250){return _[_0x0e82('0x97')](_0x396f44,_0x414250);});if(_0x4b3009){return _0x524665['id'];}}}));}}return BPromise['all'](_0x1e305f)[_0x0e82('0x27')](function(_0x1df810){_0x1d79b5=_(_0x1d79b5)['union'](_0x1df810)['compact']()[_0x0e82('0x98')]();return db['VoicePrefix'][_0x0e82('0x4d')]({'where':{'id':_0x33d446[_0x0e82('0x4a')]['id']}})[_0x0e82('0x27')](function(_0x4f2118){return db['sequelize'][_0x0e82('0x51')](function(_0x5e7f11){return _0x4f2118[_0x0e82('0x89')](_0x33d446['query'][_0x0e82('0x72')],{'transaction':_0x5e7f11})[_0x0e82('0x27')](function(){if(!_['isEmpty'](_0x1d79b5)){return _0x4f2118[_0x0e82('0x77')](_0x1d79b5,{'transaction':_0x5e7f11});}})[_0x0e82('0x27')](function(){_0x1d79b5['forEach'](function(_0x22da22){socket[_0x0e82('0x75')]('userVoicePrefix:remove',{'UserId':_0x22da22,'VoicePrefixId':_0x4f2118['id']});});});});});});})['then'](respondWithStatusCode(_0x34d730,null))[_0x0e82('0x48')](handleError(_0x34d730,null));}; \ No newline at end of file +var _0x1775=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','VoicePrefixes','UserProfileResource','then','error','stack','name','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','params','keys','includeAll','include','describe','create','sequelize','body','VoiceExtension','find','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','transaction','findById','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','User','getAgents','hasOwnProperty','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','interface','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x36d815,_0x2c7143){var _0x55a7df=function(_0x4d03f7){while(--_0x4d03f7){_0x36d815['push'](_0x36d815['shift']());}};_0x55a7df(++_0x2c7143);}(_0x1775,0x1db));var _0x5177=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1775[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5177('0x0'));var zipdir=require(_0x5177('0x1'));var jsonpatch=require(_0x5177('0x2'));var rp=require(_0x5177('0x3'));var moment=require(_0x5177('0x4'));var BPromise=require(_0x5177('0x5'));var Mustache=require(_0x5177('0x6'));var util=require(_0x5177('0x7'));var path=require(_0x5177('0x8'));var sox=require(_0x5177('0x9'));var csv=require(_0x5177('0xa'));var ejs=require(_0x5177('0xb'));var fs=require('fs');var fs_extra=require(_0x5177('0xc'));var _=require(_0x5177('0xd'));var squel=require(_0x5177('0xe'));var crypto=require(_0x5177('0xf'));var jsforce=require(_0x5177('0x10'));var deskjs=require(_0x5177('0x11'));var toCsv=require(_0x5177('0xa'));var querystring=require(_0x5177('0x12'));var Papa=require(_0x5177('0x13'));var Redis=require(_0x5177('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5177('0x15'));var hardwareService=require(_0x5177('0x16'));var logger=require(_0x5177('0x17'))(_0x5177('0x18'));var utils=require(_0x5177('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5177('0x1a'));var db=require(_0x5177('0x1b'))['db'];config[_0x5177('0x1c')]=_[_0x5177('0x1d')](config[_0x5177('0x1c')],{'host':_0x5177('0x1e'),'port':0x18eb});var socket=require(_0x5177('0x1f'))(new Redis(config[_0x5177('0x1c')]));require(_0x5177('0x20'))[_0x5177('0x21')](socket);function respondWithStatusCode(_0x41bef4,_0x2bf5bb){_0x2bf5bb=_0x2bf5bb||0xcc;return function(_0x29cd2c){if(_0x29cd2c){return _0x41bef4[_0x5177('0x22')](_0x2bf5bb);}return _0x41bef4[_0x5177('0x23')](_0x2bf5bb)[_0x5177('0x24')]();};}function respondWithResult(_0x2ab5e5,_0x7dba6f){_0x7dba6f=_0x7dba6f||0xc8;return function(_0xe6dcf6){if(_0xe6dcf6){return _0x2ab5e5['status'](_0x7dba6f)[_0x5177('0x25')](_0xe6dcf6);}};}function respondWithFilteredResult(_0x41e687,_0x3f5ab5){return function(_0x1b4102){if(_0x1b4102){var _0x5f5bd4=typeof _0x3f5ab5[_0x5177('0x26')]===_0x5177('0x27')&&typeof _0x3f5ab5[_0x5177('0x28')]==='undefined';var _0x86f5f8=_0x1b4102['count'];var _0xc2b2b5=_0x5f5bd4?0x0:_0x3f5ab5[_0x5177('0x26')];var _0x219744=_0x5f5bd4?_0x1b4102[_0x5177('0x29')]:_0x3f5ab5[_0x5177('0x26')]+_0x3f5ab5[_0x5177('0x28')];var _0x174c4f;if(_0x219744>=_0x86f5f8){_0x219744=_0x86f5f8;_0x174c4f=0xc8;}else{_0x174c4f=0xce;}_0x41e687[_0x5177('0x23')](_0x174c4f);return _0x41e687[_0x5177('0x2a')](_0x5177('0x2b'),_0xc2b2b5+'-'+_0x219744+'/'+_0x86f5f8)[_0x5177('0x25')](_0x1b4102);}return null;};}function patchUpdates(_0x3b0c37){return function(_0x5d9a9c){try{jsonpatch[_0x5177('0x2c')](_0x5d9a9c,_0x3b0c37,!![]);}catch(_0x556f96){return BPromise[_0x5177('0x2d')](_0x556f96);}return _0x5d9a9c[_0x5177('0x2e')]();};}function saveUpdates(_0x3b39b5,_0x2d51d0){return function(_0x4bc8e2){if(_0x4bc8e2){return _0x4bc8e2[_0x5177('0x2f')](_0x3b39b5)['then'](function(_0x564139){return _0x564139;});}return null;};}function removeEntity(_0x19a0c2,_0x15cb93){return function(_0x577bf7){if(_0x577bf7){return _0x577bf7[_0x5177('0x30')]()['then'](function(){var _0x231d35=_0x577bf7[_0x5177('0x31')]({'plain':!![]});var _0x58846c=_0x5177('0x32');return db[_0x5177('0x33')][_0x5177('0x30')]({'where':{'type':_0x58846c,'resourceId':_0x231d35['id']}})[_0x5177('0x34')](function(){return _0x577bf7;});})[_0x5177('0x34')](function(){_0x19a0c2[_0x5177('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498fcd,_0x45cf20){return function(_0x1c660e){if(!_0x1c660e){_0x498fcd[_0x5177('0x22')](0x194);}return _0x1c660e;};}function handleError(_0x174f7a,_0x2e1985){_0x2e1985=_0x2e1985||0x1f4;return function(_0x8134f9){logger[_0x5177('0x35')](_0x8134f9[_0x5177('0x36')]);if(_0x8134f9['name']){delete _0x8134f9[_0x5177('0x37')];}_0x174f7a[_0x5177('0x23')](_0x2e1985)['send'](_0x8134f9);};}exports[_0x5177('0x38')]=function(_0x5e4c48,_0x172b36){var _0x1a2c46={},_0x1ba51c={},_0x5e2e5a={'count':0x0,'rows':[]};var _0x4f70df=_[_0x5177('0x39')](db[_0x5177('0x3a')][_0x5177('0x3b')],function(_0x3735e9){return{'name':_0x3735e9[_0x5177('0x3c')],'type':_0x3735e9[_0x5177('0x3d')][_0x5177('0x3e')]};});_0x1ba51c[_0x5177('0x3f')]=_['map'](_0x4f70df,_0x5177('0x37'));_0x1ba51c[_0x5177('0x40')]=_['keys'](_0x5e4c48[_0x5177('0x40')]);_0x1ba51c[_0x5177('0x41')]=_[_0x5177('0x42')](_0x1ba51c[_0x5177('0x3f')],_0x1ba51c[_0x5177('0x40')]);_0x1a2c46[_0x5177('0x43')]=_['intersection'](_0x1ba51c[_0x5177('0x3f')],qs[_0x5177('0x44')](_0x5e4c48[_0x5177('0x40')][_0x5177('0x44')]));_0x1a2c46[_0x5177('0x43')]=_0x1a2c46[_0x5177('0x43')][_0x5177('0x45')]?_0x1a2c46['attributes']:_0x1ba51c[_0x5177('0x3f')];if(!_0x5e4c48[_0x5177('0x40')]['hasOwnProperty']('nolimit')){_0x1a2c46[_0x5177('0x28')]=qs[_0x5177('0x28')](_0x5e4c48[_0x5177('0x40')][_0x5177('0x28')]);_0x1a2c46[_0x5177('0x26')]=qs[_0x5177('0x26')](_0x5e4c48[_0x5177('0x40')][_0x5177('0x26')]);}_0x1a2c46[_0x5177('0x46')]=qs[_0x5177('0x47')](_0x5e4c48[_0x5177('0x40')][_0x5177('0x47')]);_0x1a2c46[_0x5177('0x48')]=qs['filters'](_[_0x5177('0x49')](_0x5e4c48[_0x5177('0x40')],_0x1ba51c['filters']),_0x4f70df);if(_0x5e4c48[_0x5177('0x40')]['filter']){_0x1a2c46[_0x5177('0x48')]=_[_0x5177('0x4a')](_0x1a2c46[_0x5177('0x48')],{'$or':_['map'](_0x4f70df,function(_0x56eba4){if(_0x56eba4[_0x5177('0x3d')]!==_0x5177('0x4b')){var _0x1a149b={};_0x1a149b[_0x56eba4[_0x5177('0x37')]]={'$like':'%'+_0x5e4c48[_0x5177('0x40')][_0x5177('0x4c')]+'%'};return _0x1a149b;}})});}_0x1a2c46=_[_0x5177('0x4a')]({},_0x1a2c46,_0x5e4c48[_0x5177('0x4d')]);var _0x4e287e={'where':_0x1a2c46[_0x5177('0x48')]};return db['VoicePrefix']['count'](_0x4e287e)[_0x5177('0x34')](function(_0x17dc98){_0x5e2e5a['count']=_0x17dc98;if(_0x5e4c48[_0x5177('0x40')]['includeAll']){_0x1a2c46['include']=[{'all':!![]}];}return db[_0x5177('0x3a')][_0x5177('0x4e')](_0x1a2c46);})[_0x5177('0x34')](function(_0x3776b8){_0x5e2e5a[_0x5177('0x4f')]=_0x3776b8;return _0x5e2e5a;})[_0x5177('0x34')](respondWithFilteredResult(_0x172b36,_0x1a2c46))[_0x5177('0x50')](handleError(_0x172b36,null));};exports['show']=function(_0x5396cc,_0x12b70){var _0x511dc0={'raw':![],'where':{'id':_0x5396cc[_0x5177('0x51')]['id']}},_0x23be2a={};_0x23be2a[_0x5177('0x3f')]=_[_0x5177('0x52')](db['VoicePrefix'][_0x5177('0x3b')]);_0x23be2a[_0x5177('0x40')]=_[_0x5177('0x52')](_0x5396cc[_0x5177('0x40')]);_0x23be2a[_0x5177('0x41')]=_[_0x5177('0x42')](_0x23be2a[_0x5177('0x3f')],_0x23be2a[_0x5177('0x40')]);_0x511dc0[_0x5177('0x43')]=_[_0x5177('0x42')](_0x23be2a[_0x5177('0x3f')],qs['fields'](_0x5396cc[_0x5177('0x40')]['fields']));_0x511dc0['attributes']=_0x511dc0['attributes'][_0x5177('0x45')]?_0x511dc0[_0x5177('0x43')]:_0x23be2a['model'];if(_0x5396cc[_0x5177('0x40')][_0x5177('0x53')]){_0x511dc0[_0x5177('0x54')]=[{'all':!![]}];}_0x511dc0=_['merge']({},_0x511dc0,_0x5396cc[_0x5177('0x4d')]);return db['VoicePrefix']['find'](_0x511dc0)['then'](handleEntityNotFound(_0x12b70,null))[_0x5177('0x34')](respondWithResult(_0x12b70,null))[_0x5177('0x50')](handleError(_0x12b70,null));};exports[_0x5177('0x30')]=function(_0x5a1f8b,_0x4e53e4){return db[_0x5177('0x3a')]['find']({'where':{'id':_0x5a1f8b[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x4e53e4,null))[_0x5177('0x34')](removeEntity(_0x4e53e4,null))[_0x5177('0x50')](handleError(_0x4e53e4,null));};exports[_0x5177('0x55')]=function(_0xa0edd7,_0x26bac0){return db[_0x5177('0x3a')][_0x5177('0x55')]()[_0x5177('0x34')](respondWithResult(_0x26bac0,null))[_0x5177('0x50')](handleError(_0x26bac0,null));};exports[_0x5177('0x56')]=function(_0x422d6c,_0x4c2068){var _0x59376b;return db[_0x5177('0x57')]['transaction'](function(_0x649c6f){return db['VoicePrefix'][_0x5177('0x56')](_0x422d6c[_0x5177('0x58')],{'transaction':_0x649c6f})[_0x5177('0x34')](function(_0x55a0b6){_0x59376b=_0x55a0b6['get']({'plain':!![]});return db[_0x5177('0x59')][_0x5177('0x5a')]({'where':{'id':_0x59376b[_0x5177('0x5b')]},'raw':!![]})[_0x5177('0x34')](function(_0x4a4758){return createVoicePrefixExtensions(_0x59376b,_0x4a4758,_0x649c6f);});});})['then'](function(){var _0x3f0e89=_0x422d6c[_0x5177('0x5c')][_0x5177('0x31')]({'plain':!![]});if(!_0x3f0e89)throw new Error(_0x5177('0x5d'));if(_0x3f0e89['role']===_0x5177('0x5c')){var _0x143aff=_0x59376b;return db[_0x5177('0x5e')]['find']({'where':{'name':_0x5177('0x32'),'userProfileId':_0x3f0e89[_0x5177('0x5f')]},'raw':!![]})[_0x5177('0x34')](function(_0x49e3e3){if(_0x49e3e3&&_0x49e3e3[_0x5177('0x60')]===0x0){return db['UserProfileResource'][_0x5177('0x56')]({'name':_0x143aff[_0x5177('0x37')],'resourceId':_0x143aff['id'],'type':_0x49e3e3[_0x5177('0x37')],'sectionId':_0x49e3e3['id']},{})['then'](function(){return _0x59376b;});}else{return _0x59376b;}})[_0x5177('0x50')](function(_0x161e03){logger[_0x5177('0x35')](_0x5177('0x61'),_0x161e03);throw _0x161e03;});}return _0x59376b;})[_0x5177('0x34')](respondWithResult(_0x4c2068,null))[_0x5177('0x50')](handleError(_0x4c2068,null));};function Extension(_0x37380c,_0x267599,_0x5ceed2,_0x5d96ce){this['context']=_0x5177('0x62');this[_0x5177('0x63')]=_0x37380c;this[_0x5177('0x64')]=_0x5ceed2;this[_0x5177('0x3d')]=_0x5177('0x65');this[_0x5177('0x66')]='Voice\x20Prefix\x20Extension';this['priority']=_0x267599;this[_0x5177('0x67')]=_0x5d96ce;}function createVoicePrefixExtensions(_0x23eb6e,_0x1f294e,_0x336017){return new BPromise(function(_0x123d40,_0x1b1778){var _0x2d1745=new Extension(formatPrefixName(_0x23eb6e[_0x5177('0x68')]),0x1,_0x5177('0x69'),'Voice\x20Prefix');_0x2d1745[_0x5177('0x6a')]=_0x23eb6e['id'];return db[_0x5177('0x59')]['create'](_0x2d1745,{'transaction':_0x336017})[_0x5177('0x34')](function(_0x4481b6){var _0x4edebc=_0x4481b6[_0x5177('0x31')]({'plain':!![]});var _0x2f3344=_[_0x5177('0x39')](addVoicePrefixExtensions(_0x23eb6e,_0x1f294e),function(_0x4be4b2){_0x4be4b2[_0x5177('0x5b')]=_0x4edebc['id'];_0x4be4b2[_0x5177('0x6a')]=_0x23eb6e['id'];return _0x4be4b2;});return db['VoiceExtension']['bulkCreate'](_0x2f3344,{'transaction':_0x336017})[_0x5177('0x34')](function(_0x4f76d7){if(!_0x4f76d7){return _0x1b1778(_0x5177('0x6b'));}else{return _0x123d40(_0x4f76d7);}})['catch'](function(_0x2771fa){return _0x1b1778(_0x2771fa);});});;});};function addVoicePrefixExtensions(_0x16f17c,_0x5a8ada){var _0x2af938=[];var _0x3b090d=formatPrefixName(_0x16f17c[_0x5177('0x68')]);_0x2af938[_0x5177('0x6c')](new Extension(_0x3b090d,0x2,_0x5177('0x6d'),_0x5177('0x6e')+_0x16f17c[_0x5177('0x37')]));if(_0x16f17c['callerIdAll']){_0x2af938[_0x5177('0x6c')](new Extension(_0x3b090d,0x3,'Set','PREFIX-CALLERIDALL='+_0x16f17c[_0x5177('0x6f')]));}else{_0x2af938[_0x5177('0x6c')](new Extension(_0x3b090d,0x3,'NoOp',_0x5177('0x70')));}_0x2af938[_0x5177('0x6c')](new Extension(_0x3b090d,0x4,_0x5177('0x71'),_0x5a8ada[_0x5177('0x72')]+','+_0x5177('0x73')+(0x8+_0x16f17c[_0x5177('0x37')][_0x5177('0x45')])+'}'+','+0x1));return _0x2af938;}function formatPrefixName(_0x3b26f4){var _0x478d5e='_';for(var _0x54b28f=0x0;_0x54b28f<_0x3b26f4[_0x5177('0x45')];_0x54b28f++){if(_0x3b26f4[_0x5177('0x74')](_0x54b28f)=='-'){_0x478d5e+=_0x3b26f4[_0x5177('0x74')](_0x54b28f);}else{_0x478d5e+='['+_0x3b26f4[_0x5177('0x74')](_0x54b28f)+']';}}_0x478d5e+='.';return _0x478d5e;}exports[_0x5177('0x2f')]=function(_0x3dd58f,_0x4fc289,_0x3692b2){var _0x397b75=_0x3dd58f[_0x5177('0x58')];_0x397b75[_0x5177('0x68')]='system-'+_0x397b75[_0x5177('0x37')]+'-';return db[_0x5177('0x57')][_0x5177('0x75')](function(_0x22da9d){return db[_0x5177('0x3a')]['update'](_0x397b75,{'where':{'id':_0x397b75['id']},'transaction':_0x22da9d})[_0x5177('0x34')](function(){return db['VoiceExtension'][_0x5177('0x30')]({'where':{'VoicePrefixId':_0x397b75['id']},'transaction':_0x22da9d})[_0x5177('0x34')](function(){return db['VoiceExtension'][_0x5177('0x5a')]({'where':{'id':_0x397b75[_0x5177('0x5b')]},'raw':!![]})[_0x5177('0x34')](function(_0x44ed82){return createVoicePrefixExtensions(_0x397b75,_0x44ed82,_0x22da9d);});});});})['then'](function(){return db[_0x5177('0x3a')][_0x5177('0x76')](_0x397b75['id']);})[_0x5177('0x34')](respondWithResult(_0x4fc289,null))[_0x5177('0x50')](handleError(_0x4fc289,null));};exports['addAgents']=function(_0x16b85b,_0x17456b,_0x3502dd){return db['VoicePrefix']['find']({'where':{'id':_0x16b85b[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x17456b,null))[_0x5177('0x34')](function(_0x170e25){if(_0x170e25){return _0x170e25[_0x5177('0x77')](_0x16b85b[_0x5177('0x58')][_0x5177('0x78')],_[_0x5177('0x79')](_0x16b85b[_0x5177('0x58')],['ids','id'])||{})['spread'](function(_0x597a84){for(var _0x290315=0x0;_0x290315<_0x16b85b['body'][_0x5177('0x78')][_0x5177('0x45')];_0x290315+=0x1){socket[_0x5177('0x7a')](_0x5177('0x7b'),{'UserId':Number(_0x16b85b[_0x5177('0x58')]['ids'][_0x290315]),'VoicePrefixId':Number(_0x16b85b[_0x5177('0x51')]['id'])});}return _0x597a84;});}})[_0x5177('0x34')](respondWithResult(_0x17456b,null))[_0x5177('0x50')](handleError(_0x17456b,null));};exports['removeAgents']=function(_0x3d845e,_0x484762,_0x3d95df){return db[_0x5177('0x3a')]['find']({'where':{'id':_0x3d845e[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x484762,null))['then'](function(_0x5f0141){if(_0x5f0141){return _0x5f0141[_0x5177('0x7c')](_0x3d845e['query'][_0x5177('0x78')])[_0x5177('0x34')](function(){if(_['isArray'](_0x3d845e[_0x5177('0x40')][_0x5177('0x78')])){for(var _0xcbbb73=0x0;_0xcbbb73<_0x3d845e[_0x5177('0x40')][_0x5177('0x78')][_0x5177('0x45')];_0xcbbb73+=0x1){socket[_0x5177('0x7a')](_0x5177('0x7d'),{'UserId':Number(_0x3d845e['query'][_0x5177('0x78')][_0xcbbb73]),'VoicePrefixId':Number(_0x3d845e['params']['id'])});}}else{socket[_0x5177('0x7a')](_0x5177('0x7d'),{'UserId':Number(_0x3d845e[_0x5177('0x40')][_0x5177('0x78')]),'VoicePrefixId':Number(_0x3d845e['params']['id'])});}});}})[_0x5177('0x34')](respondWithStatusCode(_0x484762,null))[_0x5177('0x50')](handleError(_0x484762,null));};exports['getAgents']=function(_0x17efe1,_0x30c2dc,_0x523012){var _0x33e1a6={};var _0x5f57bc={};var _0x3f1aad;var _0x558e04;return db['VoicePrefix']['findOne']({'where':{'id':_0x17efe1[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x30c2dc,null))[_0x5177('0x34')](function(_0x516d0b){if(_0x516d0b){_0x3f1aad=_0x516d0b;_0x5f57bc[_0x5177('0x3f')]=_[_0x5177('0x52')](db[_0x5177('0x7e')][_0x5177('0x3b')]);_0x5f57bc[_0x5177('0x40')]=_['keys'](_0x17efe1[_0x5177('0x40')]);_0x5f57bc[_0x5177('0x41')]=_['intersection'](_0x5f57bc[_0x5177('0x3f')],_0x5f57bc['query']);_0x33e1a6[_0x5177('0x43')]=_['intersection'](_0x5f57bc[_0x5177('0x3f')],qs[_0x5177('0x44')](_0x17efe1[_0x5177('0x40')][_0x5177('0x44')]));_0x33e1a6[_0x5177('0x43')]=_0x33e1a6[_0x5177('0x43')]['length']?_0x33e1a6['attributes']:_0x5f57bc[_0x5177('0x3f')];_0x33e1a6[_0x5177('0x46')]=qs[_0x5177('0x47')](_0x17efe1['query'][_0x5177('0x47')]);_0x33e1a6[_0x5177('0x48')]=qs['filters'](_[_0x5177('0x49')](_0x17efe1['query'],_0x5f57bc[_0x5177('0x41')]));if(_0x17efe1[_0x5177('0x40')][_0x5177('0x4c')]){_0x33e1a6['where']=_[_0x5177('0x4a')](_0x33e1a6['where'],{'$or':_[_0x5177('0x39')](_0x33e1a6[_0x5177('0x43')],function(_0x5a40f1){var _0x5a8146={};_0x5a8146[_0x5a40f1]={'$like':'%'+_0x17efe1['query'][_0x5177('0x4c')]+'%'};return _0x5a8146;})});}_0x33e1a6=_['merge']({},_0x33e1a6,_0x17efe1[_0x5177('0x4d')]);return _0x3f1aad[_0x5177('0x7f')](_0x33e1a6);}})[_0x5177('0x34')](function(_0x57adf4){if(_0x57adf4){_0x558e04=_0x57adf4['length'];if(!_0x17efe1['query'][_0x5177('0x80')](_0x5177('0x81'))){_0x33e1a6[_0x5177('0x28')]=qs['limit'](_0x17efe1[_0x5177('0x40')][_0x5177('0x28')]);_0x33e1a6['offset']=qs[_0x5177('0x26')](_0x17efe1['query'][_0x5177('0x26')]);}return _0x3f1aad['getAgents'](_0x33e1a6);}})['then'](function(_0x5910a8){if(_0x5910a8){return _0x5910a8?{'count':_0x558e04,'rows':_0x5910a8}:null;}})[_0x5177('0x34')](respondWithResult(_0x30c2dc,null))['catch'](handleError(_0x30c2dc,null));};exports[_0x5177('0x82')]=function(_0x450c61,_0x1d351b,_0x1372ad){var _0x3b4cab={};var _0x197377={};var _0x580d34;var _0x1e76cf;return db[_0x5177('0x3a')]['findOne']({'where':{'id':_0x450c61[_0x5177('0x51')]['id']}})[_0x5177('0x34')](handleEntityNotFound(_0x1d351b,null))[_0x5177('0x34')](function(_0x51f7ce){if(_0x51f7ce){_0x580d34=_0x51f7ce;_0x197377['model']=_['keys'](db[_0x5177('0x83')][_0x5177('0x3b')]);_0x197377[_0x5177('0x40')]=_[_0x5177('0x52')](_0x450c61[_0x5177('0x40')]);_0x197377[_0x5177('0x41')]=_[_0x5177('0x42')](_0x197377[_0x5177('0x3f')],_0x197377[_0x5177('0x40')]);_0x3b4cab[_0x5177('0x43')]=_[_0x5177('0x42')](_0x197377[_0x5177('0x3f')],qs['fields'](_0x450c61[_0x5177('0x40')]['fields']));_0x3b4cab[_0x5177('0x43')]=_0x3b4cab[_0x5177('0x43')][_0x5177('0x45')]?_0x3b4cab['attributes']:_0x197377[_0x5177('0x3f')];_0x3b4cab[_0x5177('0x46')]=qs[_0x5177('0x47')](_0x450c61[_0x5177('0x40')][_0x5177('0x47')]);_0x3b4cab[_0x5177('0x48')]=qs[_0x5177('0x41')](_[_0x5177('0x49')](_0x450c61['query'],_0x197377['filters']));if(_0x450c61[_0x5177('0x40')]['filter']){_0x3b4cab[_0x5177('0x48')]=_[_0x5177('0x4a')](_0x3b4cab['where'],{'$or':_[_0x5177('0x39')](_0x3b4cab[_0x5177('0x43')],function(_0x54efd0){var _0x3e8a29={};_0x3e8a29[_0x54efd0]={'$like':'%'+_0x450c61[_0x5177('0x40')][_0x5177('0x4c')]+'%'};return _0x3e8a29;})});}_0x3b4cab=_[_0x5177('0x4a')]({},_0x3b4cab,_0x450c61[_0x5177('0x4d')]);return _0x580d34[_0x5177('0x82')](_0x3b4cab);}})[_0x5177('0x34')](function(_0x7a67fb){if(_0x7a67fb){_0x1e76cf=_0x7a67fb[_0x5177('0x45')];if(!_0x450c61[_0x5177('0x40')][_0x5177('0x80')](_0x5177('0x81'))){_0x3b4cab[_0x5177('0x28')]=qs['limit'](_0x450c61[_0x5177('0x40')][_0x5177('0x28')]);_0x3b4cab[_0x5177('0x26')]=qs['offset'](_0x450c61[_0x5177('0x40')][_0x5177('0x26')]);}return _0x580d34['getTeams'](_0x3b4cab);}})[_0x5177('0x34')](function(_0x5cbc48){if(_0x5cbc48){return _0x5cbc48?{'count':_0x1e76cf,'rows':_0x5cbc48}:null;}})['then'](respondWithResult(_0x1d351b,null))[_0x5177('0x50')](handleError(_0x1d351b,null));};exports[_0x5177('0x84')]=function(_0xd8f8f3,_0x40ded0,_0x356874){var _0x219a7c=_0xd8f8f3['body'][_0x5177('0x78')];var _0xcb831c;return db['Team'][_0x5177('0x4e')]({'where':{'id':_0x219a7c},'attributes':['id'],'include':[{'model':db[_0x5177('0x7e')],'as':_0x5177('0x85'),'attributes':['id',_0x5177('0x37'),_0x5177('0x86'),_0x5177('0x87'),_0x5177('0x88')],'raw':!![]}]})[_0x5177('0x34')](function(_0x4e60b2){if(_0x4e60b2){_0xcb831c=_0x4e60b2;var _0x193dbf=_['flatMap'](_0x4e60b2,function(_0xecd419){var _0x4970b3=_0xecd419[_0x5177('0x31')]({'plain':!![]});return _0x4970b3[_0x5177('0x85')];});return db[_0x5177('0x3a')][_0x5177('0x5a')]({'where':{'id':_0xd8f8f3['params']['id']}})[_0x5177('0x34')](function(_0x1b7c52){return db[_0x5177('0x57')][_0x5177('0x75')](function(_0x4e8c0c){return _0x1b7c52['addTeams'](_0x219a7c,{'transaction':_0x4e8c0c})['then'](function(){return BPromise['each'](_0xcb831c,function(_0xaafc9f){return db['TeamVoicePrefix'][_0x5177('0x89')]({'TeamId':_0xaafc9f['id'],'VoicePrefixId':_0xd8f8f3['params']['id']},{'transaction':_0x4e8c0c});});})[_0x5177('0x34')](function(){return BPromise['each'](_0x193dbf,function(_0x384af7){return db[_0x5177('0x8a')][_0x5177('0x8b')]({'where':{'UserId':_0x384af7['id'],'VoicePrefixId':_0xd8f8f3[_0x5177('0x51')]['id']},'transaction':_0x4e8c0c});});})[_0x5177('0x34')](function(){_0x193dbf[_0x5177('0x8c')](function(_0x3a9c65){socket[_0x5177('0x7a')](_0x5177('0x7b'),{'UserId':_0x3a9c65['id'],'VoicePrefixId':_0x1b7c52['id']});});});});});}})[_0x5177('0x34')](respondWithStatusCode(_0x40ded0,null))['catch'](handleError(_0x40ded0,null));};exports[_0x5177('0x8d')]=function(_0x13fa90,_0x3475c3,_0x5ed46a){return db[_0x5177('0x83')][_0x5177('0x4e')]({'where':{'id':_0x13fa90[_0x5177('0x40')][_0x5177('0x78')]},'attributes':['id'],'include':[{'model':db[_0x5177('0x7e')],'as':_0x5177('0x85'),'attributes':['id'],'raw':!![]}]})[_0x5177('0x34')](handleEntityNotFound(_0x3475c3,null))[_0x5177('0x34')](function(_0xb8f7de){var _0x1bc4cb=_[_0x5177('0x39')](_0xb8f7de,'id');var _0x4d29b7=[];var _0x1f8c26=[];var _0x365b68=squel[_0x5177('0x8e')]();_0x365b68['field'](_0x5177('0x8f'))[_0x5177('0x90')]('team_has_voice_prefixes','tq')[_0x5177('0x91')](_0x5177('0x92'),'ut',_0x5177('0x93'))['where'](_0x5177('0x94'),_0x13fa90[_0x5177('0x51')]['id']);for(var _0x3b8c79=0x0;_0x3b8c79<_0xb8f7de[_0x5177('0x45')];_0x3b8c79+=0x1){let _0x2a16ed=_0xb8f7de[_0x3b8c79];for(var _0x5d1909=0x0;_0x5d1909<_0x2a16ed['Agents'][_0x5177('0x45')];_0x5d1909+=0x1){let _0x61ead2=_0x2a16ed['Agents'][_0x5d1909];var _0x2ffb25=_0x365b68[_0x5177('0x95')]();_0x2ffb25['where'](_0x5177('0x96'),_0x61ead2['id']);_0x1f8c26[_0x5177('0x6c')](db['sequelize']['query'](_0x2ffb25[_0x5177('0x97')](),{'type':db['sequelize']['QueryTypes'][_0x5177('0x98')]})[_0x5177('0x34')](function(_0x58170f){if(_0x58170f[_0x5177('0x45')]===0x1){return _0x61ead2['id'];}else{var _0xdc5504=_[_0x5177('0x99')](_[_0x5177('0x39')](_0x58170f,_0x5177('0x9a')),function(_0x2fa026){return _['includes'](_0x1bc4cb,_0x2fa026);});if(_0xdc5504){return _0x61ead2['id'];}}}));}}return BPromise[_0x5177('0x9b')](_0x1f8c26)['then'](function(_0x55e914){_0x4d29b7=_(_0x4d29b7)[_0x5177('0x9c')](_0x55e914)[_0x5177('0x9d')]()[_0x5177('0x9e')]();return db['VoicePrefix'][_0x5177('0x5a')]({'where':{'id':_0x13fa90[_0x5177('0x51')]['id']}})[_0x5177('0x34')](function(_0x3873ca){return db[_0x5177('0x57')][_0x5177('0x75')](function(_0x10698d){return _0x3873ca[_0x5177('0x8d')](_0x13fa90[_0x5177('0x40')][_0x5177('0x78')],{'transaction':_0x10698d})[_0x5177('0x34')](function(){if(!_[_0x5177('0x9f')](_0x4d29b7)){return _0x3873ca['removeAgents'](_0x4d29b7,{'transaction':_0x10698d});}})[_0x5177('0x34')](function(){_0x4d29b7[_0x5177('0x8c')](function(_0x38f0f4){socket[_0x5177('0x7a')]('userVoicePrefix:remove',{'UserId':_0x38f0f4,'VoicePrefixId':_0x3873ca['id']});});});});});});})['then'](respondWithStatusCode(_0x3475c3,null))['catch'](handleError(_0x3475c3,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 3c3f693..18a1e54 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 _0xcc7e=['update','emit','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xcc7e,0x136));var _0xecc7=function(_0x239ddb,_0x523839){_0x239ddb=_0x239ddb-0x0;var _0xc2879d=_0xcc7e[_0x239ddb];return _0xc2879d;};'use strict';var EventEmitter=require(_0xecc7('0x0'));var VoicePrefix=require(_0xecc7('0x1'))['db'][_0xecc7('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xecc7('0x3')](0x0);var events={'afterCreate':_0xecc7('0x4'),'afterUpdate':_0xecc7('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4afa99){return function(_0x255925,_0x23cb89,_0x2dd82a){VoicePrefixEvents[_0xecc7('0x6')](_0x4afa99+':'+_0x255925['id'],_0x255925);VoicePrefixEvents[_0xecc7('0x6')](_0x4afa99,_0x255925);_0x2dd82a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xecc7('0x7')](e,emitEvent(event));}}module[_0xecc7('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xcb49=['hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xcb49,0x66));var _0x9cb4=function(_0x291aaf,_0x4c6d8d){_0x291aaf=_0x291aaf-0x0;var _0x5571e6=_0xcb49[_0x291aaf];return _0x5571e6;};'use strict';var EventEmitter=require(_0x9cb4('0x0'));var VoicePrefix=require(_0x9cb4('0x1'))['db'][_0x9cb4('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9cb4('0x3')](0x0);var events={'afterCreate':_0x9cb4('0x4'),'afterUpdate':_0x9cb4('0x5'),'afterDestroy':_0x9cb4('0x6')};function emitEvent(_0x4753fb){return function(_0x2732c8,_0x598fea,_0x32bb46){VoicePrefixEvents[_0x9cb4('0x7')](_0x4753fb+':'+_0x2732c8['id'],_0x2732c8);VoicePrefixEvents[_0x9cb4('0x7')](_0x4753fb,_0x2732c8);_0x32bb46(null);};}for(var e in events){if(events[_0x9cb4('0x8')](e)){var event=events[e];VoicePrefix[_0x9cb4('0x9')](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 8c8177f..a88a2d3 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 _0x4b6e=['VoicePrefix','util','api','bluebird','path','./voicePrefix.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b6e,0x15f));var _0xe4b6=function(_0x1e43bd,_0x63fb56){_0x1e43bd=_0x1e43bd-0x0;var _0x4b80b1=_0x4b6e[_0x1e43bd];return _0x4b80b1;};'use strict';var _=require('lodash');var util=require(_0xe4b6('0x0'));var logger=require('../../config/logger')(_0xe4b6('0x1'));var moment=require('moment');var BPromise=require(_0xe4b6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4b6('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe4b6('0x4'));module[_0xe4b6('0x5')]=function(_0x2906bc,_0x42078d){return _0x2906bc['define'](_0xe4b6('0x6'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e45=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','voice_prefixes'];(function(_0x184b14,_0xe302d7){var _0xe118d6=function(_0x1328cf){while(--_0x1328cf){_0x184b14['push'](_0x184b14['shift']());}};_0xe118d6(++_0xe302d7);}(_0x5e45,0x18c));var _0x55e4=function(_0x55af57,_0x5705f0){_0x55af57=_0x55af57-0x0;var _0x848ee0=_0x5e45[_0x55af57];return _0x848ee0;};'use strict';var _=require(_0x55e4('0x0'));var util=require(_0x55e4('0x1'));var logger=require(_0x55e4('0x2'))(_0x55e4('0x3'));var moment=require(_0x55e4('0x4'));var BPromise=require(_0x55e4('0x5'));var rp=require(_0x55e4('0x6'));var fs=require('fs');var path=require(_0x55e4('0x7'));var rimraf=require(_0x55e4('0x8'));var config=require(_0x55e4('0x9'));var attributes=require('./voicePrefix.attributes');module[_0x55e4('0xa')]=function(_0x107026,_0x19ef79){return _0x107026['define']('VoicePrefix',attributes,{'tableName':_0x55e4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 1edf980..4158abd 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 _0xb89c=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s'];(function(_0x5d90d1,_0x547e47){var _0x1cdcee=function(_0x1dffc6){while(--_0x1dffc6){_0x5d90d1['push'](_0x5d90d1['shift']());}};_0x1cdcee(++_0x547e47);}(_0xb89c,0x198));var _0xcb89=function(_0x5bcfd0,_0x4b61e8){_0x5bcfd0=_0x5bcfd0-0x0;var _0x51bfd=_0xb89c[_0x5bcfd0];return _0x51bfd;};'use strict';var _=require(_0xcb89('0x0'));var util=require(_0xcb89('0x1'));var moment=require(_0xcb89('0x2'));var BPromise=require(_0xcb89('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb89('0x4'));var db=require(_0xcb89('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb89('0x6'))(_0xcb89('0x7'));var config=require(_0xcb89('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb89('0x9')]({'port':0x232a});config[_0xcb89('0xa')]=_[_0xcb89('0xb')](config['redis'],{'host':_0xcb89('0xc'),'port':0x18eb});var socket=require(_0xcb89('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xcb89('0xe')](socket);function respondWithRpcPromise(_0x53c5a7,_0x41e33c,_0x13d505){return new BPromise(function(_0xbff62,_0x24c1b6){return client[_0xcb89('0xf')](_0x53c5a7,_0x13d505)[_0xcb89('0x10')](function(_0x4be56e){logger[_0xcb89('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x41e33c,_0xcb89('0x12'));logger[_0xcb89('0x13')](_0xcb89('0x14'),_0x41e33c,_0xcb89('0x12'),JSON[_0xcb89('0x15')](_0x4be56e));if(_0x4be56e[_0xcb89('0x16')]){if(_0x4be56e[_0xcb89('0x16')]['code']===0x1f4){logger[_0xcb89('0x16')](_0xcb89('0x17'),_0x41e33c,_0x4be56e['error'][_0xcb89('0x18')]);return _0x24c1b6(_0x4be56e[_0xcb89('0x16')][_0xcb89('0x18')]);}logger['error'](_0xcb89('0x17'),_0x41e33c,_0x4be56e['error']['message']);return _0xbff62(_0x4be56e[_0xcb89('0x16')][_0xcb89('0x18')]);}else{logger[_0xcb89('0x11')](_0xcb89('0x17'),_0x41e33c,_0xcb89('0x12'));_0xbff62(_0x4be56e[_0xcb89('0x19')][_0xcb89('0x18')]);}})[_0xcb89('0x1a')](function(_0x5d17a7){logger[_0xcb89('0x16')](_0xcb89('0x17'),_0x41e33c,_0x5d17a7);_0x24c1b6(_0x5d17a7);});});} \ No newline at end of file +var _0x1a85=['catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x897bdc,_0x309e3e){var _0x53dc75=function(_0x4f8e09){while(--_0x4f8e09){_0x897bdc['push'](_0x897bdc['shift']());}};_0x53dc75(++_0x309e3e);}(_0x1a85,0x178));var _0x51a8=function(_0x40bfc2,_0x538e26){_0x40bfc2=_0x40bfc2-0x0;var _0x14d1db=_0x1a85[_0x40bfc2];return _0x14d1db;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});config['redis']=_[_0x51a8('0x8')](config[_0x51a8('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x51a8('0xa'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0x51a8('0xb')](socket);function respondWithRpcPromise(_0x2f276b,_0x1a476d,_0x45a3f4){return new BPromise(function(_0x418f06,_0x421fa4){return client[_0x51a8('0xc')](_0x2f276b,_0x45a3f4)[_0x51a8('0xd')](function(_0x34c887){logger[_0x51a8('0xe')](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));logger[_0x51a8('0x11')](_0x51a8('0x12'),_0x1a476d,_0x51a8('0x10'),JSON[_0x51a8('0x13')](_0x34c887));if(_0x34c887[_0x51a8('0x14')]){if(_0x34c887['error'][_0x51a8('0x15')]===0x1f4){logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887['error'][_0x51a8('0x16')]);return _0x421fa4(_0x34c887['error'][_0x51a8('0x16')]);}logger[_0x51a8('0x14')](_0x51a8('0xf'),_0x1a476d,_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);return _0x418f06(_0x34c887[_0x51a8('0x14')][_0x51a8('0x16')]);}else{logger['info'](_0x51a8('0xf'),_0x1a476d,_0x51a8('0x10'));_0x418f06(_0x34c887[_0x51a8('0x17')][_0x51a8('0x16')]);}})[_0x51a8('0x18')](function(_0x544886){logger['error'](_0x51a8('0xf'),_0x1a476d,_0x544886);_0x421fa4(_0x544886);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index ca8542d..71c008c 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 _0xee4e=['length','voicePrefix:','./voicePrefix.events','save','remove','emit','removeListener','register'];(function(_0x5d43be,_0x62e23c){var _0x493270=function(_0x23a255){while(--_0x23a255){_0x5d43be['push'](_0x5d43be['shift']());}};_0x493270(++_0x62e23c);}(_0xee4e,0x122));var _0xeee4=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xee4e[_0x173441];return _0x2423a8;};'use strict';var VoicePrefixEvents=require(_0xeee4('0x0'));var events=[_0xeee4('0x1'),_0xeee4('0x2'),'update'];function createListener(_0x171016,_0x827900){return function(_0x33e574){_0x827900[_0xeee4('0x3')](_0x171016,_0x33e574);};}function removeListener(_0x2012a1,_0x30fe5a){return function(){VoicePrefixEvents[_0xeee4('0x4')](_0x2012a1,_0x30fe5a);};}exports[_0xeee4('0x5')]=function(_0x5564f7){for(var _0xcf3bbd=0x0,_0x148296=events[_0xeee4('0x6')];_0xcf3bbd<_0x148296;_0xcf3bbd++){var _0x593262=events[_0xcf3bbd];var _0x25f0ed=createListener(_0xeee4('0x7')+_0x593262,_0x5564f7);VoicePrefixEvents['on'](_0x593262,_0x25f0ed);}}; \ No newline at end of file +var _0xa900=['length','./voicePrefix.events','save','remove','update','emit','removeListener','register'];(function(_0x7e3995,_0x4c57ac){var _0x21ba44=function(_0x475532){while(--_0x475532){_0x7e3995['push'](_0x7e3995['shift']());}};_0x21ba44(++_0x4c57ac);}(_0xa900,0x101));var _0x0a90=function(_0x476031,_0x41aef3){_0x476031=_0x476031-0x0;var _0x4950fb=_0xa900[_0x476031];return _0x4950fb;};'use strict';var VoicePrefixEvents=require(_0x0a90('0x0'));var events=[_0x0a90('0x1'),_0x0a90('0x2'),_0x0a90('0x3')];function createListener(_0x2a9b60,_0x4e133b){return function(_0x55f0b7){_0x4e133b[_0x0a90('0x4')](_0x2a9b60,_0x55f0b7);};}function removeListener(_0x5872bf,_0x4f5b00){return function(){VoicePrefixEvents[_0x0a90('0x5')](_0x5872bf,_0x4f5b00);};}exports[_0x0a90('0x6')]=function(_0x461b32){for(var _0x34ee43=0x0,_0x56a1e5=events[_0x0a90('0x7')];_0x34ee43<_0x56a1e5;_0x34ee43++){var _0x4718e9=events[_0x34ee43];var _0x33e3cf=createListener('voicePrefix:'+_0x4718e9,_0x461b32);VoicePrefixEvents['on'](_0x4718e9,_0x33e3cf);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index ace5293..e924480 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 _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x123df5,_0x5a535b){var _0x115fc5=function(_0x44e410){while(--_0x44e410){_0x123df5['push'](_0x123df5['shift']());}};_0x115fc5(++_0x5a535b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +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(_0x223c0d,_0x3ec04d){var _0x207827=function(_0x39d240){while(--_0x39d240){_0x223c0d['push'](_0x223c0d['shift']());}};_0x207827(++_0x3ec04d);}(_0xb10b,0x12a));var _0xbb10=function(_0x3388d8,_0x256024){_0x3388d8=_0x3388d8-0x0;var _0x2bbe73=_0xb10b[_0x3388d8];return _0x2bbe73;};'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 75b67dc..2b71d5d 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 _0xcec4=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\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)','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','inbound','default','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','UNSIGNED','agentBusyFactor','dropRate','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','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x54c9af,_0x4f3942){var _0x234b50=function(_0x5756f0){while(--_0x5756f0){_0x54c9af['push'](_0x54c9af['shift']());}};_0x234b50(++_0x4f3942);}(_0xcec4,0xe3));var _0x4cec=function(_0x729c45,_0x4488c4){_0x729c45=_0x729c45-0x0;var _0xd4b462=_0xcec4[_0x729c45];return _0xd4b462;};'use strict';var Sequelize=require(_0x4cec('0x0'));module[_0x4cec('0x1')]={'name':{'type':Sequelize[_0x4cec('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4cec('0x3')]('inbound','outbound'),'allowNull':![],'defaultValue':_0x4cec('0x4')},'musiconhold':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':_0x4cec('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x4cec('0x3')]('rr','ringall','leastrecent',_0x4cec('0x6'),_0x4cec('0x7'),_0x4cec('0x8'),_0x4cec('0x9'),_0x4cec('0xa'),_0x4cec('0xb')),'allowNull':![],'defaultValue':_0x4cec('0xc'),'set':function(_0x2ed9f8){this[_0x4cec('0xd')](_0x4cec('0xe'),_0x2ed9f8?_0x2ed9f8:'rrmemory');},'get':function(){var _0x24d4a8=this[_0x4cec('0xf')]('type');var _0xf9be07=this[_0x4cec('0xf')](_0x4cec('0x10'));var _0x3d2810=this[_0x4cec('0xf')]('strategy');if(_0x24d4a8===_0x4cec('0x4')){return _0x3d2810;}if(_0xf9be07==='booked'&&_0x3d2810===_0x4cec('0x8')||_0xf9be07===_0x4cec('0x11')&&_0x3d2810==='roundrobin'){return _0x3d2810;}if(_0xf9be07===_0x4cec('0x12')||_0xf9be07===_0x4cec('0x13')||_0xf9be07===_0x4cec('0x14')){return _0x3d2810;}return null;}},'servicelevel':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x4cec('0x15')](0xb)},'timeout':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x4cec('0x2')]},'weight':{'type':Sequelize[_0x4cec('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x4cec('0x3')]('yes','no'),'defaultValue':_0x4cec('0x16')},'autopause':{'type':Sequelize[_0x4cec('0x3')]('yes','no',_0x4cec('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x4cec('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x4cec('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x4cec('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x4cec('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x4cec('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x4cec('0x3')]('yes','no'),'defaultValue':_0x4cec('0x16')},'announce_holdtime':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no',_0x4cec('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x4cec('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x4cec('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x4cec('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x4cec('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x4cec('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x4cec('0x2')]},'periodic_announce':{'type':Sequelize[_0x4cec('0x19')],'set':function(_0x35f983){this['setDataValue'](_0x4cec('0x1a'),_0x35f983?_0x35f983[_0x4cec('0x1b')](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x4cec('0xf')](_0x4cec('0x1a'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':_0x4cec('0x16'),'set':function(_0x18283c){this[_0x4cec('0xd')](_0x4cec('0x1c'),_0x18283c?_0x18283c[_0x4cec('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x4cec('0xf')](_0x4cec('0x1c'))[_0x4cec('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x144e33){this['setDataValue']('leavewhenempty',_0x144e33?_0x144e33['join'](','):undefined);},'get':function(){return this[_0x4cec('0xf')](_0x4cec('0x1e'))?this['getDataValue'](_0x4cec('0x1e'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x4cec('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4cec('0x2')]},'acw':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':0x0,'set':function(_0x1f8aa6){this[_0x4cec('0xd')](_0x4cec('0x20'),_0x1f8aa6);if(_0x1f8aa6){if(this['getDataValue'](_0x4cec('0x21'))<0x2){this[_0x4cec('0xd')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x4cec('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x22'),_0x4cec('0x12'),'power',_0x4cec('0x13'),_0x4cec('0x11')),'defaultValue':_0x4cec('0x12'),'comment':_0x4cec('0x23')},'dialLimitChannel':{'type':Sequelize[_0x4cec('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4cec('0x24')},'dialLimitQueue':{'type':Sequelize[_0x4cec('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x4cec('0x25')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x4cec('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x27'),_0x4cec('0x28')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x4cec('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x4cec('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x4cec('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':_0x4cec('0x2c'),'comment':_0x4cec('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x4cec('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x4cec('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cec('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x31')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x4cec('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x4cec('0x32')},'dialTimezone':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x4cec('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x4cec('0x3')](_0x4cec('0x33'),_0x4cec('0x34'),_0x4cec('0x35')),'defaultValue':_0x4cec('0x33')},'dialAMDActive':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':0x0,'comment':_0x4cec('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x4cec('0x37')},'dialAMDGreeting':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x4cec('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x4cec('0x39')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x4cec('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x4cec('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x4cec('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x4cec('0x3b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x4cec('0x15')](0x9)[_0x4cec('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x4cec('0x15')](0x5)[_0x4cec('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x4cec('0x3c')},'dialRecallInQueue':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':0x0,'comment':_0x4cec('0x3d')},'dialOrderByScheduledAt':{'type':Sequelize[_0x4cec('0x3')]('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x4cec('0x2')],'comment':_0x4cec('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x4cec('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x4cec('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x4cec('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cec('0x40')},'dialDropMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x41')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x4cec('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cec('0x42')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x43')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x4cec('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x4cec('0x44')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x4cec('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x4cec('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4cec('0x15')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x41ffa3){if(!_0x41ffa3)this[_0x4cec('0xd')](_0x4cec('0x46'),null);this['setDataValue']('mandatoryDisposition',_0x41ffa3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x4cec('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x4cec('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x4cec('0x15')](0x3)[_0x4cec('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x4cec('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0x3855=['Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','ENUM','once','TEXT','periodic_announce','split','joinempty','leavewhenempty','join','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'];(function(_0x193634,_0x2484e7){var _0x31a11b=function(_0x72f1a1){while(--_0x72f1a1){_0x193634['push'](_0x193634['shift']());}};_0x31a11b(++_0x2484e7);}(_0x3855,0x1b6));var _0x5385=function(_0x57f419,_0x3a81e1){_0x57f419=_0x57f419-0x0;var _0x55e76a=_0x3855[_0x57f419];return _0x55e76a;};'use strict';var Sequelize=require(_0x5385('0x0'));module[_0x5385('0x1')]={'name':{'type':Sequelize[_0x5385('0x2')],'allowNull':![],'unique':_0x5385('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x5385('0x4'),_0x5385('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x5385('0x2')],'defaultValue':_0x5385('0x6')},'announce':{'type':Sequelize[_0x5385('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x5385('0x7'),_0x5385('0x8'),_0x5385('0x9'),_0x5385('0xa'),_0x5385('0xb'),_0x5385('0xc'),_0x5385('0xd'),'rrordered'),'allowNull':![],'defaultValue':_0x5385('0x7'),'set':function(_0x1fc85c){this[_0x5385('0xe')](_0x5385('0xf'),_0x1fc85c?_0x1fc85c:_0x5385('0xb'));},'get':function(){var _0x268f3d=this[_0x5385('0x10')](_0x5385('0x11'));var _0x4f53e0=this[_0x5385('0x10')](_0x5385('0x12'));var _0x4a5f07=this[_0x5385('0x10')]('strategy');if(_0x268f3d===_0x5385('0x4')){return _0x4a5f07;}if(_0x4f53e0===_0x5385('0x13')&&_0x4a5f07==='rrmemory'||_0x4f53e0===_0x5385('0x13')&&_0x4a5f07===_0x5385('0x14')){return _0x4a5f07;}if(_0x4f53e0==='progressive'||_0x4f53e0===_0x5385('0x15')||_0x4f53e0===_0x5385('0x16')){return _0x4a5f07;}return null;}},'servicelevel':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5385('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5385('0x17')](0xb)},'timeout':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x5385('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x5385('0x18'),'no'),'defaultValue':_0x5385('0x18')},'autopause':{'type':Sequelize[_0x5385('0x19')](_0x5385('0x18'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5385('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x5385('0x19')](_0x5385('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5385('0x19')](_0x5385('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x5385('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x5385('0x19')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5385('0x19')](_0x5385('0x18'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x5385('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5385('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5385('0x19')](_0x5385('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x5385('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x5385('0x18'),'no',_0x5385('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5385('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5385('0x19')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5385('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x5385('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x5385('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5385('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5385('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x5385('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5385('0x2')]},'queue_quantity1':{'type':Sequelize[_0x5385('0x2')]},'queue_quantity2':{'type':Sequelize[_0x5385('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x5385('0x2')]},'queue_less_than':{'type':Sequelize[_0x5385('0x2')]},'periodic_announce':{'type':Sequelize[_0x5385('0x1b')],'set':function(_0xadb5c4){this[_0x5385('0xe')](_0x5385('0x1c'),_0xadb5c4?_0xadb5c4['join'](','):[]);},'get':function(){return this['getDataValue']('periodic_announce')?this[_0x5385('0x10')]('periodic_announce')[_0x5385('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x5385('0x2')],'defaultValue':_0x5385('0x18'),'set':function(_0x1d963e){this[_0x5385('0xe')](_0x5385('0x1e'),_0x1d963e?_0x1d963e['join'](','):undefined);},'get':function(){return this[_0x5385('0x10')](_0x5385('0x1e'))?this[_0x5385('0x10')]('joinempty')[_0x5385('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5385('0x2')],'defaultValue':'no','set':function(_0x54402a){this[_0x5385('0xe')](_0x5385('0x1f'),_0x54402a?_0x54402a[_0x5385('0x20')](','):undefined);},'get':function(){return this[_0x5385('0x10')](_0x5385('0x1f'))?this['getDataValue'](_0x5385('0x1f'))[_0x5385('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x5385('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5385('0x19')](_0x5385('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5385('0x19')](_0x5385('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5385('0x2')]},'description':{'type':Sequelize[_0x5385('0x2')]},'acw':{'type':Sequelize[_0x5385('0x21')],'defaultValue':0x0,'set':function(_0x625ce8){this['setDataValue']('acw',_0x625ce8);if(_0x625ce8){if(this['getDataValue']('wrapuptime')<0x2){this[_0x5385('0xe')](_0x5385('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5385('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5385('0x23')},'dialMethod':{'type':Sequelize[_0x5385('0x19')]('preview',_0x5385('0x24'),_0x5385('0x16'),_0x5385('0x15'),'booked'),'defaultValue':_0x5385('0x24'),'comment':_0x5385('0x25')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x5385('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5385('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x5385('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5385('0x28')},'dialPowerLevel':{'type':Sequelize[_0x5385('0x29')](0x2)[_0x5385('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x5385('0x2a'),_0x5385('0x2b')),'defaultValue':_0x5385('0x2b'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5385('0x29')](0x2)[_0x5385('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5385('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x5385('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5385('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x5385('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x5385('0x2')],'defaultValue':_0x5385('0x2e'),'comment':_0x5385('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x5385('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5385('0x30')},'dialQueueProject':{'type':Sequelize[_0x5385('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5385('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5385('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5385('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5385('0x33')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5385('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5385('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0x3,'comment':_0x5385('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5385('0x36')},'dialTimezone':{'type':Sequelize[_0x5385('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5385('0x2')],'defaultValue':_0x5385('0x37')},'dialPrefix':{'type':Sequelize[_0x5385('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x5385('0x38'),_0x5385('0x39'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x5385('0x21')],'defaultValue':0x0,'comment':_0x5385('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x5385('0x17')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x5385('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x5385('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5385('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5385('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5385('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5385('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5385('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5385('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5385('0x17')](0x9)[_0x5385('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5385('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5385('0x17')](0x9)[_0x5385('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5385('0x17')](0x5)[_0x5385('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5385('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5385('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x5385('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5385('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x5385('0x21')],'defaultValue':0x0,'comment':_0x5385('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5385('0x19')](_0x5385('0x43'),'ASC'),'defaultValue':_0x5385('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x5385('0x44')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5385('0x21')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x5385('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5385('0x45')},'dialCutDigit':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5385('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5385('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5385('0x17')](0x5)[_0x5385('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5385('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x5385('0x17')](0x5)[_0x5385('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5385('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5385('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5385('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5385('0x4b')},'dialMachineMaxRetry':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x5385('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5385('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5385('0x17')](0x5)[_0x5385('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5385('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5385('0x17')],'allowNull':!![],'comment':_0x5385('0x4e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x18094f){if(!_0x18094f)this[_0x5385('0xe')](_0x5385('0x4f'),null);this['setDataValue'](_0x5385('0x50'),_0x18094f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5385('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x5385('0x21')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x5385('0x17')](0x3)[_0x5385('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x5385('0x21')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 21ca7bd..2d1fdbf 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 _0x88b0=['addTeams','teams','Team','User','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','findOrCreate','UserVoiceQueueRt','upsert','isNil','SIP/%s','emit','userVoiceQueue:save','ids','select','field','tq.TeamId','from','team_has_voice_queues','join','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','compact','removeAgents','forEach','addAgents','spread','format','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','ContactId','ListId','phone','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','scheduledAt','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','fromQuery','NOW()','phone\x20IS\x20NOT\x20NULL','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','reject','then','destroy','get','inbound','QueueCampaigns','outbound','map','value','includes','type','find','name','UserProfileResource','stack','index','VoiceQueue','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0x88b0,0x1cb));var _0x088b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x88b0[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x088b('0x0'));var rimraf=require(_0x088b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x088b('0x2'));var moment=require(_0x088b('0x3'));var BPromise=require(_0x088b('0x4'));var Mustache=require(_0x088b('0x5'));var util=require('util');var path=require(_0x088b('0x6'));var sox=require(_0x088b('0x7'));var csv=require(_0x088b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x088b('0x9'));var squel=require(_0x088b('0xa'));var crypto=require(_0x088b('0xb'));var jsforce=require(_0x088b('0xc'));var deskjs=require(_0x088b('0xd'));var toCsv=require(_0x088b('0x8'));var querystring=require(_0x088b('0xe'));var Papa=require('papaparse');var Redis=require(_0x088b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x088b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x088b('0x11'));var logger=require(_0x088b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x088b('0x13'));var licenseUtil=require(_0x088b('0x14'));var db=require(_0x088b('0x15'))['db'];config['redis']=_[_0x088b('0x16')](config[_0x088b('0x17')],{'host':_0x088b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x088b('0x17')]));require(_0x088b('0x19'))[_0x088b('0x1a')](socket);function respondWithStatusCode(_0xf6bd53,_0x1ec5e5){_0x1ec5e5=_0x1ec5e5||0xcc;return function(_0x3d659d){if(_0x3d659d){return _0xf6bd53[_0x088b('0x1b')](_0x1ec5e5);}return _0xf6bd53['status'](_0x1ec5e5)[_0x088b('0x1c')]();};}function respondWithResult(_0x1c1096,_0x458b47){_0x458b47=_0x458b47||0xc8;return function(_0xdee68a){if(_0xdee68a){return _0x1c1096[_0x088b('0x1d')](_0x458b47)[_0x088b('0x1e')](_0xdee68a);}};}function respondWithFilteredResult(_0x54a27e,_0x331cb0){return function(_0x3ce059){if(_0x3ce059){var _0x135e00=typeof _0x331cb0[_0x088b('0x1f')]===_0x088b('0x20')&&typeof _0x331cb0['limit']==='undefined';var _0x35e006=_0x3ce059[_0x088b('0x21')];var _0x12e3ac=_0x135e00?0x0:_0x331cb0[_0x088b('0x1f')];var _0x3c9c1d=_0x135e00?_0x3ce059[_0x088b('0x21')]:_0x331cb0['offset']+_0x331cb0[_0x088b('0x22')];var _0x293604;if(_0x3c9c1d>=_0x35e006){_0x3c9c1d=_0x35e006;_0x293604=0xc8;}else{_0x293604=0xce;}_0x54a27e[_0x088b('0x1d')](_0x293604);return _0x54a27e['set']('Content-Range',_0x12e3ac+'-'+_0x3c9c1d+'/'+_0x35e006)[_0x088b('0x1e')](_0x3ce059);}return null;};}function patchUpdates(_0x1db300){return function(_0x587bad){try{jsonpatch['apply'](_0x587bad,_0x1db300,!![]);}catch(_0x187350){return BPromise[_0x088b('0x23')](_0x187350);}return _0x587bad['save']();};}function saveUpdates(_0x4b4d3f,_0x48bbaa){return function(_0x282156){if(_0x282156){return _0x282156['update'](_0x4b4d3f)[_0x088b('0x24')](function(_0x4178d0){return _0x4178d0;});}return null;};}function removeEntity(_0x8f18b7,_0x2c551f){return function(_0x43ee2e){if(_0x43ee2e){return _0x43ee2e[_0x088b('0x25')]()['then'](function(){var _0x339eb9=_0x43ee2e[_0x088b('0x26')]({'plain':!![]});var _0x3da9e1=[{'name':'VoiceQueues','value':_0x088b('0x27'),'ignore':![]},{'name':_0x088b('0x28'),'value':_0x088b('0x29'),'ignore':![]}];var _0x3ed176=_(_0x3da9e1)['filter']('ignore')[_0x088b('0x2a')](_0x088b('0x2b'))[_0x088b('0x2b')]();if(_[_0x088b('0x2c')](_0x3ed176,_0x339eb9[_0x088b('0x2d')])){return;}var _0x4f17f9=_[_0x088b('0x2e')](_0x3da9e1,[_0x088b('0x2b'),_0x339eb9[_0x088b('0x2d')]])[_0x088b('0x2f')];return db[_0x088b('0x30')]['destroy']({'where':{'type':_0x4f17f9,'resourceId':_0x339eb9['id']}})[_0x088b('0x24')](function(){return _0x43ee2e;});})[_0x088b('0x24')](function(){_0x8f18b7[_0x088b('0x1d')](0xcc)[_0x088b('0x1c')]();});}};}function handleEntityNotFound(_0x124bb6,_0x296ffa){return function(_0x13f87f){if(!_0x13f87f){_0x124bb6[_0x088b('0x1b')](0x194);}return _0x13f87f;};}function handleError(_0x1fff93,_0x17f4bc){_0x17f4bc=_0x17f4bc||0x1f4;return function(_0x46c0c0){logger['error'](_0x46c0c0[_0x088b('0x31')]);if(_0x46c0c0[_0x088b('0x2f')]){delete _0x46c0c0[_0x088b('0x2f')];}_0x1fff93[_0x088b('0x1d')](_0x17f4bc)['send'](_0x46c0c0);};}exports[_0x088b('0x32')]=function(_0x5a7a9f,_0x213b0e){var _0x59a607={},_0x572e24={},_0x172edc={'count':0x0,'rows':[]};var _0x38f851=_[_0x088b('0x2a')](db[_0x088b('0x33')][_0x088b('0x34')],function(_0x1e3700){return{'name':_0x1e3700['fieldName'],'type':_0x1e3700[_0x088b('0x2d')][_0x088b('0x35')]};});_0x572e24[_0x088b('0x36')]=_['map'](_0x38f851,_0x088b('0x2f'));_0x572e24[_0x088b('0x37')]=_['keys'](_0x5a7a9f[_0x088b('0x37')]);_0x572e24[_0x088b('0x38')]=_[_0x088b('0x39')](_0x572e24[_0x088b('0x36')],_0x572e24['query']);_0x59a607[_0x088b('0x3a')]=_['intersection'](_0x572e24[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x5a7a9f[_0x088b('0x37')]['fields']));_0x59a607[_0x088b('0x3a')]=_0x59a607['attributes'][_0x088b('0x3c')]?_0x59a607[_0x088b('0x3a')]:_0x572e24[_0x088b('0x36')];if(!_0x5a7a9f[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x59a607[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x5a7a9f['query'][_0x088b('0x22')]);_0x59a607[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x5a7a9f['query'][_0x088b('0x1f')]);}_0x59a607[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x5a7a9f['query']['sort']);_0x59a607['where']=qs['filters'](_[_0x088b('0x41')](_0x5a7a9f[_0x088b('0x37')],_0x572e24[_0x088b('0x38')]),_0x38f851);if(_0x5a7a9f[_0x088b('0x37')][_0x088b('0x42')]){_0x59a607[_0x088b('0x43')]=_['merge'](_0x59a607[_0x088b('0x43')],{'$or':_['map'](_0x38f851,function(_0x5c8cb3){if(_0x5c8cb3['type']!=='VIRTUAL'){var _0x2cb360={};_0x2cb360[_0x5c8cb3[_0x088b('0x2f')]]={'$like':'%'+_0x5a7a9f[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x2cb360;}})});}_0x59a607=_[_0x088b('0x44')]({},_0x59a607,_0x5a7a9f[_0x088b('0x45')]);var _0x3aa0bc={'where':_0x59a607[_0x088b('0x43')]};return db[_0x088b('0x33')][_0x088b('0x21')](_0x3aa0bc)[_0x088b('0x24')](function(_0x55be78){_0x172edc[_0x088b('0x21')]=_0x55be78;if(_0x5a7a9f[_0x088b('0x37')][_0x088b('0x46')]){_0x59a607[_0x088b('0x47')]=[{'all':!![]}];}return db['VoiceQueue'][_0x088b('0x48')](_0x59a607);})['then'](function(_0x2153c7){_0x172edc[_0x088b('0x49')]=_0x2153c7;return _0x172edc;})[_0x088b('0x24')](respondWithFilteredResult(_0x213b0e,_0x59a607))['catch'](handleError(_0x213b0e,null));};exports[_0x088b('0x4a')]=function(_0x31b3fc,_0x266e8b){var _0x1dbf16={'raw':![],'where':{'id':_0x31b3fc[_0x088b('0x4b')]['id']}},_0x3dc19b={};_0x3dc19b[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x33')]['rawAttributes']);_0x3dc19b[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x31b3fc[_0x088b('0x37')]);_0x3dc19b[_0x088b('0x38')]=_[_0x088b('0x39')](_0x3dc19b[_0x088b('0x36')],_0x3dc19b[_0x088b('0x37')]);_0x1dbf16[_0x088b('0x3a')]=_['intersection'](_0x3dc19b[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x31b3fc[_0x088b('0x37')][_0x088b('0x3b')]));_0x1dbf16['attributes']=_0x1dbf16[_0x088b('0x3a')][_0x088b('0x3c')]?_0x1dbf16[_0x088b('0x3a')]:_0x3dc19b['model'];if(_0x31b3fc[_0x088b('0x37')]['includeAll']){_0x1dbf16['include']=[{'all':!![]}];}_0x1dbf16=_[_0x088b('0x44')]({},_0x1dbf16,_0x31b3fc[_0x088b('0x45')]);return db[_0x088b('0x33')][_0x088b('0x2e')](_0x1dbf16)[_0x088b('0x24')](handleEntityNotFound(_0x266e8b,null))[_0x088b('0x24')](respondWithResult(_0x266e8b,null))[_0x088b('0x4d')](handleError(_0x266e8b,null));};exports['create']=function(_0x409db7,_0x30d235){return db['VoiceQueue'][_0x088b('0x4e')](_0x409db7[_0x088b('0x4f')],{})[_0x088b('0x24')](function(_0x2d9e32){var _0x12d063=_0x409db7[_0x088b('0x50')][_0x088b('0x26')]({'plain':!![]});if(!_0x12d063)throw new Error(_0x088b('0x51'));if(_0x12d063[_0x088b('0x52')]===_0x088b('0x50')){var _0x316ab4=_0x2d9e32['get']({'plain':!![]});var _0x5ec1f1=[{'name':_0x088b('0x53'),'value':'inbound'},{'name':_0x088b('0x28'),'value':_0x088b('0x29')}];var _0x99fbd6=_[_0x088b('0x2e')](_0x5ec1f1,[_0x088b('0x2b'),_0x316ab4[_0x088b('0x2d')]])['name'];return db[_0x088b('0x54')][_0x088b('0x2e')]({'where':{'name':_0x99fbd6,'userProfileId':_0x12d063[_0x088b('0x55')]},'raw':!![]})['then'](function(_0x118e13){if(_0x118e13&&_0x118e13[_0x088b('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x316ab4[_0x088b('0x2f')],'resourceId':_0x316ab4['id'],'type':_0x118e13[_0x088b('0x2f')],'sectionId':_0x118e13['id']},{})[_0x088b('0x24')](function(){return _0x2d9e32;});}else{return _0x2d9e32;}})['catch'](function(_0x26c7b9){logger[_0x088b('0x57')](_0x088b('0x58'),_0x26c7b9);throw _0x26c7b9;});}return _0x2d9e32;})[_0x088b('0x24')](respondWithResult(_0x30d235,0xc9))[_0x088b('0x4d')](handleError(_0x30d235,null));};exports[_0x088b('0x59')]=function(_0x151a66,_0x46e33c){var _0x289a3b={'where':{'id':_0x151a66[_0x088b('0x4b')]['id']}},_0x333066={};_0x333066[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x33')]['rawAttributes']);_0x289a3b[_0x088b('0x3a')]=_['intersection'](_0x333066['model'],qs['fields'](_0x151a66[_0x088b('0x37')][_0x088b('0x3b')]));_0x289a3b[_0x088b('0x3a')]=_0x289a3b['attributes']['length']?_0x289a3b[_0x088b('0x3a')]:_0x333066[_0x088b('0x36')];if(_0x151a66[_0x088b('0x37')][_0x088b('0x46')]){_0x289a3b[_0x088b('0x47')]=[{'all':!![]}];}_0x289a3b=_[_0x088b('0x44')]({},_0x289a3b,_0x151a66[_0x088b('0x45')]);return db[_0x088b('0x33')][_0x088b('0x2e')](_0x289a3b)[_0x088b('0x24')](handleEntityNotFound(_0x46e33c,null))[_0x088b('0x24')](function(_0x33ff98){if(_0x33ff98){var _0x2496da=_0x33ff98['get']({'plain':!![]});_0x2496da=qs[_0x088b('0x5a')](_0x2496da,['id','createdAt',_0x088b('0x5b')]);_0x151a66['body']=_[_0x088b('0x5a')](_0x151a66['body'],['id',_0x088b('0x5c'),_0x088b('0x5b')]);return db[_0x088b('0x33')][_0x088b('0x4e')](_[_0x088b('0x44')](_0x2496da,_0x151a66['body']),{'include':_0x151a66[_0x088b('0x37')][_0x088b('0x46')]?[{'all':!![]}]:undefined})[_0x088b('0x24')](function(_0x5b2935){var _0x3ad76b=_0x151a66[_0x088b('0x50')][_0x088b('0x26')]({'plain':!![]});if(!_0x3ad76b)throw new Error(_0x088b('0x51'));if(_0x3ad76b[_0x088b('0x52')]===_0x088b('0x50')){var _0x429e7d=_0x5b2935['get']({'plain':!![]});var _0x181e0a=[{'name':_0x088b('0x53'),'value':_0x088b('0x27')},{'name':_0x088b('0x28'),'value':'outbound'}];var _0x228a8d=_[_0x088b('0x2e')](_0x181e0a,[_0x088b('0x2b'),_0x429e7d[_0x088b('0x2d')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x228a8d,'userProfileId':_0x3ad76b[_0x088b('0x55')]},'raw':!![]})[_0x088b('0x24')](function(_0x1b98ce){if(_0x1b98ce&&_0x1b98ce['autoAssociation']===0x0){return db[_0x088b('0x30')]['create']({'name':_0x429e7d['name'],'resourceId':_0x429e7d['id'],'type':_0x1b98ce[_0x088b('0x2f')],'sectionId':_0x1b98ce['id']},{})[_0x088b('0x24')](function(){return _0x5b2935;});}else{return _0x5b2935;}})['catch'](function(_0x20484c){logger[_0x088b('0x57')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20484c);throw _0x20484c;});}return _0x5b2935;});}})[_0x088b('0x24')](respondWithResult(_0x46e33c,0xc9))['catch'](handleError(_0x46e33c,null));};exports[_0x088b('0x5d')]=function(_0x255632,_0x35b07a){if(_0x255632[_0x088b('0x4f')]['id']){delete _0x255632['body']['id'];}return db[_0x088b('0x33')]['find']({'where':{'id':_0x255632[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x35b07a,null))[_0x088b('0x24')](saveUpdates(_0x255632['body'],null))[_0x088b('0x24')](respondWithResult(_0x35b07a,null))['catch'](handleError(_0x35b07a,null));};exports['destroy']=function(_0x1bd60d,_0x2387cd){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1bd60d['params']['id']}})['then'](handleEntityNotFound(_0x2387cd,null))['then'](removeEntity(_0x2387cd,null))[_0x088b('0x4d')](handleError(_0x2387cd,null));};exports[_0x088b('0x5e')]=function(_0x406e94,_0x2e726e,_0x10ecfb){var _0x3cc35f={'raw':![],'where':{}};var _0x24c6e7={};var _0x4ea258={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x406e94['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x2e726e,null))['then'](function(_0x1d0a90){if(_0x1d0a90){_0x24c6e7[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x60')][_0x088b('0x34')]);_0x24c6e7[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x406e94[_0x088b('0x37')]);_0x24c6e7[_0x088b('0x38')]=_[_0x088b('0x39')](_0x24c6e7[_0x088b('0x36')],_0x24c6e7['query']);_0x3cc35f[_0x088b('0x3a')]=_['intersection'](_0x24c6e7['model'],qs['fields'](_0x406e94[_0x088b('0x37')][_0x088b('0x3b')]));_0x3cc35f[_0x088b('0x3a')]=_0x3cc35f[_0x088b('0x3a')][_0x088b('0x3c')]?_0x3cc35f['attributes']:_0x24c6e7['model'];if(!_0x406e94[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x3cc35f['limit']=qs[_0x088b('0x22')](_0x406e94[_0x088b('0x37')]['limit']);_0x3cc35f[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x406e94[_0x088b('0x37')][_0x088b('0x1f')]);}_0x3cc35f[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x406e94[_0x088b('0x37')][_0x088b('0x40')]);_0x3cc35f[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x406e94[_0x088b('0x37')],_0x24c6e7[_0x088b('0x38')]));_0x3cc35f[_0x088b('0x43')][_0x088b('0x61')]=_0x1d0a90['id'];if(_0x406e94[_0x088b('0x37')][_0x088b('0x42')]){_0x3cc35f[_0x088b('0x43')]=_[_0x088b('0x44')](_0x3cc35f[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x3cc35f[_0x088b('0x3a')],function(_0x4a297f){var _0x4b3f78={};_0x4b3f78[_0x4a297f]={'$like':'%'+_0x406e94['query'][_0x088b('0x42')]+'%'};return _0x4b3f78;})});}_0x3cc35f=_[_0x088b('0x44')]({},_0x3cc35f,_0x406e94[_0x088b('0x45')]);return db[_0x088b('0x60')][_0x088b('0x21')]({'where':_0x3cc35f[_0x088b('0x43')]})[_0x088b('0x24')](function(_0x2cade3){_0x4ea258[_0x088b('0x21')]=_0x2cade3;if(_0x406e94[_0x088b('0x37')][_0x088b('0x46')]){_0x3cc35f[_0x088b('0x47')]=[{'all':!![]}];}return db['CmHopper'][_0x088b('0x48')](_0x3cc35f);})['then'](function(_0x48af4a){_0x4ea258[_0x088b('0x49')]=_0x48af4a;return _0x4ea258;});}})[_0x088b('0x24')](respondWithFilteredResult(_0x2e726e,_0x3cc35f))['catch'](handleError(_0x2e726e,null));};exports[_0x088b('0x62')]=function(_0x3dd39b,_0x3b8e17,_0x1dfed6){var _0xedd84={'raw':!![],'where':{}};var _0x34841b={};var _0x30e553={'count':0x0,'rows':[]};return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x3dd39b[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3b8e17,null))[_0x088b('0x24')](function(_0x162350){if(_0x162350){_0x34841b[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x63')][_0x088b('0x34')]);_0x34841b[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x3dd39b[_0x088b('0x37')]);_0x34841b[_0x088b('0x38')]=_[_0x088b('0x39')](_0x34841b[_0x088b('0x36')],_0x34841b[_0x088b('0x37')]);_0xedd84[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x34841b[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x3dd39b['query']['fields']));_0xedd84[_0x088b('0x3a')]=_0xedd84['attributes'][_0x088b('0x3c')]?_0xedd84[_0x088b('0x3a')]:_0x34841b[_0x088b('0x36')];if(!_0x3dd39b[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0xedd84[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x3dd39b['query'][_0x088b('0x22')]);_0xedd84['offset']=qs[_0x088b('0x1f')](_0x3dd39b['query'][_0x088b('0x1f')]);}_0xedd84[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x3dd39b[_0x088b('0x37')]['sort']);_0xedd84[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x3dd39b['query'],_0x34841b[_0x088b('0x38')]));_0xedd84['where']['VoiceQueueId']=_0x162350['id'];if(_0x3dd39b[_0x088b('0x37')]['filter']){_0xedd84[_0x088b('0x43')]=_[_0x088b('0x44')](_0xedd84[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0xedd84['attributes'],function(_0x3be504){var _0x3e6399={};_0x3e6399[_0x3be504]={'$like':'%'+_0x3dd39b[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x3e6399;})});}_0xedd84=_[_0x088b('0x44')]({},_0xedd84,_0x3dd39b[_0x088b('0x45')]);return db[_0x088b('0x63')][_0x088b('0x21')]({'where':_0xedd84[_0x088b('0x43')]})[_0x088b('0x24')](function(_0x503737){_0x30e553[_0x088b('0x21')]=_0x503737;if(_0x3dd39b[_0x088b('0x37')][_0x088b('0x46')]){_0xedd84[_0x088b('0x47')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x088b('0x48')](_0xedd84);})[_0x088b('0x24')](function(_0x392ed3){_0x30e553[_0x088b('0x49')]=_0x392ed3;return _0x30e553;});}})[_0x088b('0x24')](respondWithFilteredResult(_0x3b8e17,_0xedd84))[_0x088b('0x4d')](handleError(_0x3b8e17,null));};exports[_0x088b('0x64')]=function(_0x118f0c,_0x4c7693,_0x5c54c6){var _0x56b40c={'raw':!![],'where':{}};var _0x14f011={};var _0x29d3c7={'count':0x0,'rows':[]};return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x118f0c['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x4c7693,null))[_0x088b('0x24')](function(_0x2cbac7){if(_0x2cbac7){_0x14f011[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x65')]['rawAttributes']);_0x14f011[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x118f0c[_0x088b('0x37')]);_0x14f011[_0x088b('0x38')]=_['intersection'](_0x14f011[_0x088b('0x36')],_0x14f011[_0x088b('0x37')]);_0x56b40c['attributes']=_[_0x088b('0x39')](_0x14f011['model'],qs[_0x088b('0x3b')](_0x118f0c[_0x088b('0x37')][_0x088b('0x3b')]));_0x56b40c[_0x088b('0x3a')]=_0x56b40c[_0x088b('0x3a')][_0x088b('0x3c')]?_0x56b40c[_0x088b('0x3a')]:_0x14f011[_0x088b('0x36')];if(!_0x118f0c[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x56b40c['limit']=qs[_0x088b('0x22')](_0x118f0c['query'][_0x088b('0x22')]);_0x56b40c[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x118f0c[_0x088b('0x37')][_0x088b('0x1f')]);}_0x56b40c[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x118f0c[_0x088b('0x37')][_0x088b('0x40')]);_0x56b40c['where']=qs['filters'](_[_0x088b('0x41')](_0x118f0c[_0x088b('0x37')],_0x14f011[_0x088b('0x38')]));_0x56b40c[_0x088b('0x43')][_0x088b('0x61')]=_0x2cbac7['id'];if(_0x118f0c['query'][_0x088b('0x42')]){_0x56b40c[_0x088b('0x43')]=_[_0x088b('0x44')](_0x56b40c['where'],{'$or':_[_0x088b('0x2a')](_0x56b40c[_0x088b('0x3a')],function(_0x199244){var _0x8f2c44={};_0x8f2c44[_0x199244]={'$like':'%'+_0x118f0c[_0x088b('0x37')]['filter']+'%'};return _0x8f2c44;})});}_0x56b40c=_['merge']({},_0x56b40c,_0x118f0c[_0x088b('0x45')]);return db['CmHopperFinal'][_0x088b('0x21')]({'where':_0x56b40c['where']})[_0x088b('0x24')](function(_0x195d45){_0x29d3c7[_0x088b('0x21')]=_0x195d45;if(_0x118f0c['query']['includeAll']){_0x56b40c['include']=[{'all':!![]}];}return db[_0x088b('0x65')][_0x088b('0x48')](_0x56b40c);})['then'](function(_0x451e38){_0x29d3c7[_0x088b('0x49')]=_0x451e38;return _0x29d3c7;});}})['then'](respondWithFilteredResult(_0x4c7693,_0x56b40c))[_0x088b('0x4d')](handleError(_0x4c7693,null));};exports[_0x088b('0x66')]=function(_0x5adbbe,_0x525706,_0x4c47f1){var _0x3b1a0b={'raw':!![],'where':{}};var _0x20ad09={};var _0xf8109={'count':0x0,'rows':[]};return db[_0x088b('0x33')]['findOne']({'where':{'id':_0x5adbbe[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x525706,null))[_0x088b('0x24')](function(_0x2751ba){if(_0x2751ba){_0x20ad09[_0x088b('0x36')]=_['keys'](db[_0x088b('0x67')][_0x088b('0x34')]);_0x20ad09[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x5adbbe[_0x088b('0x37')]);_0x20ad09['filters']=_[_0x088b('0x39')](_0x20ad09[_0x088b('0x36')],_0x20ad09[_0x088b('0x37')]);_0x3b1a0b[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x20ad09[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x5adbbe[_0x088b('0x37')]['fields']));_0x3b1a0b[_0x088b('0x3a')]=_0x3b1a0b['attributes'][_0x088b('0x3c')]?_0x3b1a0b['attributes']:_0x20ad09[_0x088b('0x36')];if(!_0x5adbbe['query']['hasOwnProperty'](_0x088b('0x3e'))){_0x3b1a0b[_0x088b('0x22')]=qs['limit'](_0x5adbbe['query']['limit']);_0x3b1a0b[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x5adbbe['query'][_0x088b('0x1f')]);}_0x3b1a0b[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x5adbbe[_0x088b('0x37')]['sort']);_0x3b1a0b[_0x088b('0x43')]=qs['filters'](_[_0x088b('0x41')](_0x5adbbe['query'],_0x20ad09[_0x088b('0x38')]));_0x3b1a0b[_0x088b('0x43')][_0x088b('0x61')]=_0x2751ba['id'];if(_0x5adbbe[_0x088b('0x37')][_0x088b('0x42')]){_0x3b1a0b['where']=_['merge'](_0x3b1a0b['where'],{'$or':_['map'](_0x3b1a0b[_0x088b('0x3a')],function(_0x47262b){var _0x3dee93={};_0x3dee93[_0x47262b]={'$like':'%'+_0x5adbbe[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x3dee93;})});}_0x3b1a0b=_[_0x088b('0x44')]({},_0x3b1a0b,_0x5adbbe[_0x088b('0x45')]);return db['CmHopperBlack'][_0x088b('0x21')]({'where':_0x3b1a0b['where']})[_0x088b('0x24')](function(_0xb90164){_0xf8109[_0x088b('0x21')]=_0xb90164;if(_0x5adbbe[_0x088b('0x37')][_0x088b('0x46')]){_0x3b1a0b[_0x088b('0x47')]=[{'all':!![]}];}return db[_0x088b('0x67')][_0x088b('0x48')](_0x3b1a0b);})[_0x088b('0x24')](function(_0x1d0f7d){_0xf8109[_0x088b('0x49')]=_0x1d0f7d;return _0xf8109;});}})['then'](respondWithFilteredResult(_0x525706,_0x3b1a0b))[_0x088b('0x4d')](handleError(_0x525706,null));};exports[_0x088b('0x68')]=function(_0x18b7b5,_0x1f44f1,_0x1de83){var _0x27cc10={};var _0x249451={};var _0x4e69fd;var _0x25cd56;return db[_0x088b('0x33')][_0x088b('0x5f')]({'where':{'id':_0x18b7b5[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x1f44f1,null))[_0x088b('0x24')](function(_0x388373){if(_0x388373){_0x4e69fd=_0x388373;_0x249451[_0x088b('0x36')]=_[_0x088b('0x4c')](db['Team'][_0x088b('0x34')]);_0x249451[_0x088b('0x37')]=_['keys'](_0x18b7b5[_0x088b('0x37')]);_0x249451[_0x088b('0x38')]=_[_0x088b('0x39')](_0x249451[_0x088b('0x36')],_0x249451[_0x088b('0x37')]);_0x27cc10['attributes']=_[_0x088b('0x39')](_0x249451[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x18b7b5[_0x088b('0x37')]['fields']));_0x27cc10[_0x088b('0x3a')]=_0x27cc10[_0x088b('0x3a')][_0x088b('0x3c')]?_0x27cc10[_0x088b('0x3a')]:_0x249451[_0x088b('0x36')];_0x27cc10[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x18b7b5[_0x088b('0x37')][_0x088b('0x40')]);_0x27cc10[_0x088b('0x43')]=qs[_0x088b('0x38')](_['pick'](_0x18b7b5[_0x088b('0x37')],_0x249451[_0x088b('0x38')]));if(_0x18b7b5[_0x088b('0x37')][_0x088b('0x42')]){_0x27cc10[_0x088b('0x43')]=_[_0x088b('0x44')](_0x27cc10[_0x088b('0x43')],{'$or':_['map'](_0x27cc10[_0x088b('0x3a')],function(_0x5dc63c){var _0x21cd5a={};_0x21cd5a[_0x5dc63c]={'$like':'%'+_0x18b7b5['query'][_0x088b('0x42')]+'%'};return _0x21cd5a;})});}_0x27cc10=_[_0x088b('0x44')]({},_0x27cc10,_0x18b7b5['options']);return _0x4e69fd[_0x088b('0x68')](_0x27cc10);}})[_0x088b('0x24')](function(_0x2ed071){if(_0x2ed071){_0x25cd56=_0x2ed071['length'];if(!_0x18b7b5['query']['hasOwnProperty'](_0x088b('0x3e'))){_0x27cc10['limit']=qs['limit'](_0x18b7b5[_0x088b('0x37')][_0x088b('0x22')]);_0x27cc10['offset']=qs[_0x088b('0x1f')](_0x18b7b5[_0x088b('0x37')][_0x088b('0x1f')]);}return _0x4e69fd[_0x088b('0x68')](_0x27cc10);}})[_0x088b('0x24')](function(_0x4bbd7d){if(_0x4bbd7d){return _0x4bbd7d?{'count':_0x25cd56,'rows':_0x4bbd7d}:null;}})['then'](respondWithResult(_0x1f44f1,null))['catch'](handleError(_0x1f44f1,null));};exports[_0x088b('0x69')]=function(_0x1483b6,_0x1d9c64,_0x539bd3){var _0x5c75ea=_0x1483b6['body'][_0x088b('0x6a')];var _0x514106=_[_0x088b('0x2a')](_0x5c75ea,'id');return db[_0x088b('0x6b')]['findAll']({'where':{'id':_0x514106},'attributes':['id'],'include':[{'model':db[_0x088b('0x6c')],'as':'Agents','attributes':['id','name',_0x088b('0x6d'),_0x088b('0x6e'),_0x088b('0x6f')],'raw':!![]}]})[_0x088b('0x24')](function(_0x57ead5){if(_0x57ead5){var _0x29eeaf=_[_0x088b('0x70')](_0x57ead5,function(_0x58a0e6){var _0x42f94a=_0x58a0e6[_0x088b('0x26')]({'plain':!![]});_0x42f94a[_0x088b('0x71')]['forEach'](function(_0x5cbc9d){_0x5cbc9d[_0x088b('0x72')]=_[_0x088b('0x2e')](_0x5c75ea,{'id':_0x42f94a['id']})[_0x088b('0x72')];});return _0x42f94a['Agents'];});return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1483b6[_0x088b('0x4b')]['id']}})['then'](function(_0x9c3501){return db[_0x088b('0x73')][_0x088b('0x74')](function(_0x2e82e9){return _0x9c3501[_0x088b('0x69')](_0x514106,{'transaction':_0x2e82e9})[_0x088b('0x24')](function(){return BPromise[_0x088b('0x75')](_0x5c75ea,function(_0x5b7b2e){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x5b7b2e['id'],'VoiceQueueId':_0x1483b6[_0x088b('0x4b')]['id'],'penalty':_0x5b7b2e[_0x088b('0x72')]},{'transaction':_0x2e82e9});});})['then'](function(){return BPromise[_0x088b('0x75')](_0x29eeaf,function(_0x4e248e){return db['UserVoiceQueue'][_0x088b('0x76')]({'where':{'UserId':_0x4e248e['id'],'VoiceQueueId':_0x1483b6[_0x088b('0x4b')]['id']},'defaults':{'penalty':_0x4e248e[_0x088b('0x72')]},'transaction':_0x2e82e9});});})[_0x088b('0x24')](function(){return BPromise[_0x088b('0x75')](_[_0x088b('0x42')](_0x29eeaf,{'online':!![]}),function(_0x13717f){return db[_0x088b('0x77')][_0x088b('0x78')]({'membername':_0x13717f['name'],'UserId':_0x13717f['id'],'queue_name':_0x9c3501['name'],'VoiceQueueId':_0x9c3501['id'],'interface':_[_0x088b('0x79')](_0x13717f[_0x088b('0x6f')])?util['format'](_0x088b('0x7a'),_0x13717f[_0x088b('0x2f')]):_0x13717f[_0x088b('0x6f')],'paused':_0x13717f[_0x088b('0x6e')]||![],'penalty':_0x13717f['penalty']},{'transaction':_0x2e82e9});});})['then'](function(){_0x29eeaf['forEach'](function(_0x3465d6){socket[_0x088b('0x7b')](_0x088b('0x7c'),{'UserId':_0x3465d6['id'],'VoiceQueueId':_0x9c3501['id']});});});});});}})[_0x088b('0x24')](respondWithStatusCode(_0x1d9c64,null))[_0x088b('0x4d')](handleError(_0x1d9c64,null));};exports['removeTeams']=function(_0x55e165,_0xc99d64,_0x1e11ca){return db[_0x088b('0x6b')][_0x088b('0x48')]({'where':{'id':_0x55e165['query'][_0x088b('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x088b('0x6c')],'as':_0x088b('0x71'),'attributes':['id'],'raw':!![]}]})[_0x088b('0x24')](handleEntityNotFound(_0xc99d64,null))[_0x088b('0x24')](function(_0x4e9679){var _0x2f022d=_['map'](_0x4e9679,'id');var _0x5590a3=[];var _0x1b2f26=[];var _0x270d6c=squel[_0x088b('0x7e')]();_0x270d6c[_0x088b('0x7f')](_0x088b('0x80'))[_0x088b('0x81')](_0x088b('0x82'),'tq')[_0x088b('0x83')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x088b('0x43')]('VoiceQueueId\x20=\x20?',_0x55e165[_0x088b('0x4b')]['id']);for(var _0x136109=0x0;_0x136109<_0x4e9679[_0x088b('0x3c')];_0x136109+=0x1){let _0x160f2a=_0x4e9679[_0x136109];for(var _0x5b570d=0x0;_0x5b570d<_0x160f2a[_0x088b('0x71')][_0x088b('0x3c')];_0x5b570d+=0x1){let _0x363227=_0x160f2a[_0x088b('0x71')][_0x5b570d];var _0x12bd5e=_0x270d6c[_0x088b('0x59')]();_0x12bd5e[_0x088b('0x43')](_0x088b('0x84'),_0x363227['id']);_0x1b2f26[_0x088b('0x85')](db[_0x088b('0x73')][_0x088b('0x37')](_0x12bd5e['toString'](),{'type':db['sequelize'][_0x088b('0x86')][_0x088b('0x87')]})[_0x088b('0x24')](function(_0x36755b){if(_0x36755b[_0x088b('0x3c')]===0x1){return _0x363227['id'];}else{var _0xff60c5=_['every'](_[_0x088b('0x2a')](_0x36755b,_0x088b('0x88')),function(_0x473c76){return _[_0x088b('0x2c')](_0x2f022d,_0x473c76);});if(_0xff60c5){return _0x363227['id'];}}}));}}return BPromise[_0x088b('0x89')](_0x1b2f26)[_0x088b('0x24')](function(_0xf59f24){_0x5590a3=_(_0x5590a3)[_0x088b('0x8a')](_0xf59f24)[_0x088b('0x8b')]()[_0x088b('0x2b')]();return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x55e165[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](function(_0x25ac59){return db[_0x088b('0x73')][_0x088b('0x74')](function(_0x5aa732){return _0x25ac59['removeTeams'](_0x55e165['query'][_0x088b('0x7d')],{'transaction':_0x5aa732})[_0x088b('0x24')](function(){if(!_['isEmpty'](_0x5590a3)){return _0x25ac59[_0x088b('0x8c')](_0x5590a3,{'transaction':_0x5aa732})[_0x088b('0x24')](function(){return db['UserVoiceQueueRt'][_0x088b('0x25')]({'where':{'VoiceQueueId':_0x55e165[_0x088b('0x4b')]['id'],'UserId':_0x5590a3},'transaction':_0x5aa732});});}})[_0x088b('0x24')](function(){_0x5590a3[_0x088b('0x8d')](function(_0x5dc854){socket[_0x088b('0x7b')]('userVoiceQueue:remove',{'UserId':_0x5dc854,'VoiceQueueId':_0x25ac59['id']});});});});});});})[_0x088b('0x24')](respondWithStatusCode(_0xc99d64,null))[_0x088b('0x4d')](handleError(_0xc99d64,null));};exports[_0x088b('0x8e')]=function(_0x6b8fb1,_0x3ed607,_0x47c2f5){var _0x27fbca,_0x831e;return db[_0x088b('0x33')]['find']({'where':{'id':_0x6b8fb1['params']['id']}})['then'](handleEntityNotFound(_0x3ed607,null))[_0x088b('0x24')](function(_0x42601a){if(_0x42601a){_0x831e=_0x42601a;return _0x42601a[_0x088b('0x8e')](_0x6b8fb1[_0x088b('0x4f')]['ids'],_['omit'](_0x6b8fb1[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{})[_0x088b('0x8f')](function(_0x16948b){for(var _0x18c2f4=0x0;_0x18c2f4<_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x7d')][_0x088b('0x3c')];_0x18c2f4+=0x1){socket[_0x088b('0x7b')](_0x088b('0x7c'),{'UserId':Number(_0x6b8fb1['body'][_0x088b('0x7d')][_0x18c2f4]),'VoiceQueueId':Number(_0x6b8fb1[_0x088b('0x4b')]['id'])});}return _0x16948b;});}})[_0x088b('0x24')](function(_0x58a9a5){_0x27fbca=_0x58a9a5||[];if(_0x831e){return db[_0x088b('0x6c')][_0x088b('0x48')]({'where':{'id':_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x7d')]},'attributes':['id',_0x088b('0x2f'),_0x088b('0x6d'),'voicePause',_0x088b('0x6f')],'raw':!![]});}})[_0x088b('0x24')](function(_0x246914){if(!_['isEmpty'](_0x246914)){var _0x1e3ec2=[];for(var _0x553fc0=0x0;_0x553fc0<_0x246914[_0x088b('0x3c')];_0x553fc0++){if(_0x246914[_0x553fc0]['online']){_0x1e3ec2[_0x088b('0x85')](db['UserVoiceQueueRt'][_0x088b('0x78')]({'membername':_0x246914[_0x553fc0]['name'],'UserId':_0x246914[_0x553fc0]['id'],'queue_name':_0x831e['name'],'VoiceQueueId':_0x831e['id'],'interface':_[_0x088b('0x79')](_0x246914[_0x553fc0][_0x088b('0x6f')])?util[_0x088b('0x90')](_0x088b('0x7a'),_0x246914[_0x553fc0][_0x088b('0x2f')]):_0x246914[_0x553fc0][_0x088b('0x6f')],'paused':_0x246914[_0x553fc0][_0x088b('0x6e')]||![],'penalty':_0x6b8fb1[_0x088b('0x4f')][_0x088b('0x72')]||0x0}));}}return BPromise[_0x088b('0x89')](_0x1e3ec2);}})[_0x088b('0x24')](function(){return _0x27fbca;})[_0x088b('0x24')](respondWithResult(_0x3ed607,null))[_0x088b('0x4d')](handleError(_0x3ed607,null));};exports[_0x088b('0x8c')]=function(_0x214947,_0x53fe94,_0x444cb6){return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x214947[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53fe94,null))[_0x088b('0x24')](function(_0x2a2532){if(_0x2a2532){return _0x2a2532['removeAgents'](_0x214947[_0x088b('0x37')][_0x088b('0x7d')])[_0x088b('0x24')](function(){if(_[_0x088b('0x91')](_0x214947[_0x088b('0x37')][_0x088b('0x7d')])){for(var _0x250787=0x0;_0x250787<_0x214947[_0x088b('0x37')]['ids'][_0x088b('0x3c')];_0x250787+=0x1){socket['emit'](_0x088b('0x92'),{'UserId':Number(_0x214947[_0x088b('0x37')][_0x088b('0x7d')][_0x250787]),'VoiceQueueId':Number(_0x214947[_0x088b('0x4b')]['id'])});}}else{socket[_0x088b('0x7b')](_0x088b('0x92'),{'UserId':Number(_0x214947[_0x088b('0x37')][_0x088b('0x7d')]),'VoiceQueueId':Number(_0x214947['params']['id'])});}});}})[_0x088b('0x24')](function(_0x19955d){return db['UserVoiceQueueRt'][_0x088b('0x25')]({'where':{'VoiceQueueId':_0x214947['params']['id'],'UserId':_0x214947[_0x088b('0x37')]['ids']}})[_0x088b('0x24')](function(){return _0x19955d;});})[_0x088b('0x24')](respondWithStatusCode(_0x53fe94,null))[_0x088b('0x4d')](handleError(_0x53fe94,null));};exports[_0x088b('0x93')]=function(_0x29a112,_0x27bf16,_0x316497){var _0x901fe3={};var _0x387fac={};var _0x2f7a4c;var _0x361401;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x29a112[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x27bf16,null))[_0x088b('0x24')](function(_0x212cdb){if(_0x212cdb){_0x2f7a4c=_0x212cdb;_0x387fac[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x6c')][_0x088b('0x34')]);_0x387fac[_0x088b('0x37')]=_['keys'](_0x29a112[_0x088b('0x37')]);_0x387fac[_0x088b('0x38')]=_['intersection'](_0x387fac['model'],_0x387fac['query']);_0x901fe3[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x387fac[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x29a112[_0x088b('0x37')][_0x088b('0x3b')]));_0x901fe3[_0x088b('0x3a')]=_0x901fe3['attributes'][_0x088b('0x3c')]?_0x901fe3[_0x088b('0x3a')]:_0x387fac[_0x088b('0x36')];_0x901fe3[_0x088b('0x3f')]=qs[_0x088b('0x40')](_0x29a112[_0x088b('0x37')][_0x088b('0x40')]);_0x901fe3[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x29a112['query'],_0x387fac[_0x088b('0x38')]));if(_0x29a112[_0x088b('0x37')][_0x088b('0x42')]){_0x901fe3[_0x088b('0x43')]=_[_0x088b('0x44')](_0x901fe3[_0x088b('0x43')],{'$or':_['map'](_0x901fe3[_0x088b('0x3a')],function(_0x1a8df5){var _0xb0fa12={};_0xb0fa12[_0x1a8df5]={'$like':'%'+_0x29a112['query'][_0x088b('0x42')]+'%'};return _0xb0fa12;})});}_0x901fe3=_[_0x088b('0x44')]({},_0x901fe3,_0x29a112[_0x088b('0x45')]);return _0x2f7a4c[_0x088b('0x93')](_0x901fe3);}})[_0x088b('0x24')](function(_0x244e7f){if(_0x244e7f){_0x361401=_0x244e7f[_0x088b('0x3c')];if(!_0x29a112[_0x088b('0x37')][_0x088b('0x3d')](_0x088b('0x3e'))){_0x901fe3[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x29a112[_0x088b('0x37')]['limit']);_0x901fe3[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x29a112[_0x088b('0x37')]['offset']);}return _0x2f7a4c[_0x088b('0x93')](_0x901fe3);}})[_0x088b('0x24')](function(_0x3a78bf){if(_0x3a78bf){return _0x3a78bf?{'count':_0x361401,'rows':_0x3a78bf}:null;}})[_0x088b('0x24')](respondWithResult(_0x27bf16,null))['catch'](handleError(_0x27bf16,null));};exports[_0x088b('0x94')]=function(_0x132915,_0x3dc68c,_0x461937){var _0x2258ed={};var _0x119e15={};var _0x4759ab;var _0x5dd5aa;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x132915[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3dc68c,null))[_0x088b('0x24')](function(_0x4a8642){if(_0x4a8642){_0x4759ab=_0x4a8642;_0x119e15['model']=_[_0x088b('0x4c')](db[_0x088b('0x77')]['rawAttributes']);_0x119e15[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x132915['query']);_0x119e15[_0x088b('0x38')]=_[_0x088b('0x39')](_0x119e15['model'],_0x119e15[_0x088b('0x37')]);_0x2258ed[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x119e15[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x132915[_0x088b('0x37')][_0x088b('0x3b')]));_0x2258ed[_0x088b('0x3a')]=_0x2258ed[_0x088b('0x3a')][_0x088b('0x3c')]?_0x2258ed[_0x088b('0x3a')]:_0x119e15[_0x088b('0x36')];_0x2258ed['order']=qs[_0x088b('0x40')](_0x132915[_0x088b('0x37')][_0x088b('0x40')]);_0x2258ed[_0x088b('0x43')]=qs['filters'](_[_0x088b('0x41')](_0x132915['query'],_0x119e15[_0x088b('0x38')]));if(_0x132915[_0x088b('0x37')][_0x088b('0x42')]){_0x2258ed['where']=_[_0x088b('0x44')](_0x2258ed[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x2258ed[_0x088b('0x3a')],function(_0x12013c){var _0x18e831={};_0x18e831[_0x12013c]={'$like':'%'+_0x132915['query'][_0x088b('0x42')]+'%'};return _0x18e831;})});}_0x2258ed=_[_0x088b('0x44')]({},_0x2258ed,_0x132915[_0x088b('0x45')]);return _0x4759ab[_0x088b('0x94')](_0x2258ed);}})[_0x088b('0x24')](function(_0x51eb91){if(_0x51eb91){_0x5dd5aa=_0x51eb91[_0x088b('0x3c')];if(!_0x132915[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0x2258ed[_0x088b('0x22')]=qs['limit'](_0x132915[_0x088b('0x37')][_0x088b('0x22')]);_0x2258ed[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x132915['query']['offset']);}return _0x4759ab[_0x088b('0x94')](_0x2258ed);}})[_0x088b('0x24')](function(_0x110fb8){return _0x110fb8?{'count':_0x5dd5aa,'rows':_0x110fb8}:null;})[_0x088b('0x24')](respondWithResult(_0x3dc68c,null))[_0x088b('0x4d')](handleError(_0x3dc68c,null));};exports[_0x088b('0x95')]=function(_0x2b4bbe,_0x2d5f08,_0x1fcfa8){var _0x1500ba={};var _0x14d87d={};var _0x17258f;var _0x22c53a;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x2b4bbe[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x2d5f08,null))[_0x088b('0x24')](function(_0x260235){if(_0x260235){_0x17258f=_0x260235;_0x14d87d[_0x088b('0x36')]=_[_0x088b('0x4c')](db[_0x088b('0x96')][_0x088b('0x34')]);_0x14d87d[_0x088b('0x37')]=_['keys'](_0x2b4bbe[_0x088b('0x37')]);_0x14d87d[_0x088b('0x38')]=_[_0x088b('0x39')](_0x14d87d[_0x088b('0x36')],_0x14d87d[_0x088b('0x37')]);_0x1500ba[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x14d87d[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x3b')]));_0x1500ba['attributes']=_0x1500ba['attributes'][_0x088b('0x3c')]?_0x1500ba[_0x088b('0x3a')]:_0x14d87d[_0x088b('0x36')];_0x1500ba[_0x088b('0x3f')]=qs['sort'](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x40')]);_0x1500ba[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x2b4bbe[_0x088b('0x37')],_0x14d87d['filters']));if(_0x2b4bbe[_0x088b('0x37')][_0x088b('0x42')]){_0x1500ba[_0x088b('0x43')]=_[_0x088b('0x44')](_0x1500ba[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x1500ba[_0x088b('0x3a')],function(_0x37e0fa){var _0x565723={};_0x565723[_0x37e0fa]={'$like':'%'+_0x2b4bbe[_0x088b('0x37')][_0x088b('0x42')]+'%'};return _0x565723;})});}_0x1500ba=_[_0x088b('0x44')]({},_0x1500ba,_0x2b4bbe[_0x088b('0x45')]);return _0x17258f[_0x088b('0x95')](_0x1500ba);}})[_0x088b('0x24')](function(_0x4d68ef){if(_0x4d68ef){_0x22c53a=_0x4d68ef[_0x088b('0x3c')];if(!_0x2b4bbe[_0x088b('0x37')]['hasOwnProperty'](_0x088b('0x3e'))){_0x1500ba['limit']=qs['limit'](_0x2b4bbe['query'][_0x088b('0x22')]);_0x1500ba['offset']=qs['offset'](_0x2b4bbe[_0x088b('0x37')][_0x088b('0x1f')]);}return _0x17258f[_0x088b('0x95')](_0x1500ba);}})[_0x088b('0x24')](function(_0x3da9f7){if(_0x3da9f7){return _0x3da9f7?{'count':_0x22c53a,'rows':_0x3da9f7}:null;}})[_0x088b('0x24')](respondWithResult(_0x2d5f08,null))['catch'](handleError(_0x2d5f08,null));};exports['addLists']=function(_0xcec66f,_0x46d0c6,_0x52a461){var _0x4546f6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x299d3d,_0x5a2cdc;return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0xcec66f['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x46d0c6,null))[_0x088b('0x24')](function(_0x43af00){if(_0x43af00){_0x5a2cdc=_0x43af00;return _0x43af00[_0x088b('0x97')](_0xcec66f[_0x088b('0x4f')][_0x088b('0x7d')],_[_0x088b('0x5a')](_0xcec66f[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{});}return null;})[_0x088b('0x8f')](function(_0x5e5162){var _0xa3a341;_0x299d3d=_0x5e5162||[];var _0x4f521d=[];if(_0x5e5162){for(var _0x4077a2=0x0;_0x4077a2<_0x5e5162['length'];_0x4077a2+=0x1){var _0x5aa1a2=_0x5e5162[_0x4077a2][_0x088b('0x26')]({'plain':!![]});_0x5a2cdc[_0x088b('0x98')]=_0xcec66f[_0x088b('0x4f')]['dialCheckDuplicateType']?_0xcec66f[_0x088b('0x4f')][_0x088b('0x98')]:_0x5a2cdc['dialCheckDuplicateType'];switch(_0x5a2cdc[_0x088b('0x98')]){case _0x088b('0x99'):_0xa3a341=squel[_0x088b('0x9a')]()[_0x088b('0x9b')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),_0x088b('0x5c'),_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','scheduledAt')[_0x088b('0x7f')]('id','ContactId')[_0x088b('0x7f')](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),_0x088b('0x9d'))[_0x088b('0x7f')](_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))['from'](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2['CmListId'][_0x088b('0xa0')]())[_0x088b('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0xa5'))['from'](_0x088b('0xa6'))[_0x088b('0x43')](_0x088b('0xa7'),_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')]()))[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()['field'](_0x088b('0xa8'))[_0x088b('0x81')](_0x088b('0xa9'))[_0x088b('0x43')](_0x088b('0xa7'),_0xcec66f['params']['id'][_0x088b('0xa0')]())))[_0x088b('0xa0')]();break;case _0x088b('0xaa'):_0xa3a341=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x088b('0x9e'),_0x088b('0xab'),_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),'createdAt',_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')]('phone',_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','scheduledAt')[_0x088b('0x7f')]('id',_0x088b('0x9c'))['field'](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),'ListId')[_0x088b('0x7f')](_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))[_0x088b('0x81')](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2[_0x088b('0x9f')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x088b('0x43')](_0x088b('0xa4'),squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0xa8'))[_0x088b('0x81')]('cm_hopper')['where'](_0x088b('0xa7'),_0xcec66f[_0x088b('0x4b')]['id'][_0x088b('0xa0')]())))[_0x088b('0xa0')]();break;default:_0xa3a341=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xa9'))['fromQuery']([_0x088b('0x9e'),'scheduledAt','ContactId',_0x088b('0x9d'),'VoiceQueueId',_0x088b('0x5c'),_0x088b('0x5b')],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),_0x088b('0x9e'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0xab'))[_0x088b('0x7f')]('id',_0x088b('0x9c'))['field'](_0x5aa1a2[_0x088b('0x9f')][_0x088b('0xa0')](),_0x088b('0x9d'))[_0x088b('0x7f')](_0xcec66f['params']['id'][_0x088b('0xa0')](),_0x088b('0x61'))['field']('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5b'))[_0x088b('0x81')](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x5aa1a2[_0x088b('0x9f')]['toString']())[_0x088b('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4f521d['push'](db['sequelize'][_0x088b('0x37')](_0xa3a341));}return BPromise[_0x088b('0x89')](_0x4f521d);}})['then'](function(){var _0x3dfa80=[];var _0x55cc74=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xac'))['fromQuery']([_0x088b('0xad'),_0x088b('0x9e'),_0x088b('0xae'),_0x088b('0x5c'),'updatedAt'],squel[_0x088b('0x7e')]()[_0x088b('0x7f')]('h.id')[_0x088b('0x7f')](_0x088b('0xaf'))['field'](_0x088b('0xb0'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27',_0x088b('0x5c'))[_0x088b('0x7f')]('\x27'+_0x4546f6+'\x27','updatedAt')[_0x088b('0x81')](_0x088b('0xb1'),'ci')['join'](_0x088b('0xa9'),'h','h.ContactId=ci.CmContactId')[_0x088b('0x43')](_0x088b('0xb2'),_0x4546f6)[_0x088b('0x43')]('ci.ItemClass=?',_0x088b('0xb3')))[_0x088b('0xa0')]();_0x3dfa80['push'](db[_0x088b('0x73')]['query'](_0x55cc74));return BPromise[_0x088b('0x89')](_0x3dfa80);})[_0x088b('0x24')](function(){return _0x299d3d;})[_0x088b('0x24')](respondWithResult(_0x46d0c6,null))['catch'](handleError(_0x46d0c6,null));};exports[_0x088b('0xb4')]=function(_0x2bb3ba,_0x395ed0,_0x3db304){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x2bb3ba[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x395ed0,null))[_0x088b('0x24')](function(_0x32b9e2){if(_0x32b9e2){return _0x32b9e2[_0x088b('0xb4')](_0x2bb3ba[_0x088b('0x37')]['ids']);}})[_0x088b('0x24')](function(_0x598c86){if(_0x598c86){return db[_0x088b('0x60')]['destroy']({'where':{'ListId':_0x2bb3ba['query'][_0x088b('0x7d')],'VoiceQueueId':_0x2bb3ba[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](function(){return _0x598c86;});}})['then'](respondWithStatusCode(_0x395ed0,null))['catch'](handleError(_0x395ed0,null));};exports[_0x088b('0xb5')]=function(_0x4979b7,_0x43732f,_0x3df719){var _0x741eec={};var _0x383b52={};var _0x3beb37;var _0x536038;return db['VoiceQueue'][_0x088b('0x5f')]({'where':{'id':_0x4979b7[_0x088b('0x4b')]['id']}})[_0x088b('0x24')](handleEntityNotFound(_0x43732f,null))['then'](function(_0x29c794){if(_0x29c794){_0x3beb37=_0x29c794;_0x383b52[_0x088b('0x36')]=_['keys'](db['CmList']['rawAttributes']);_0x383b52[_0x088b('0x37')]=_[_0x088b('0x4c')](_0x4979b7[_0x088b('0x37')]);_0x383b52[_0x088b('0x38')]=_[_0x088b('0x39')](_0x383b52['model'],_0x383b52[_0x088b('0x37')]);_0x741eec[_0x088b('0x3a')]=_[_0x088b('0x39')](_0x383b52[_0x088b('0x36')],qs[_0x088b('0x3b')](_0x4979b7[_0x088b('0x37')][_0x088b('0x3b')]));_0x741eec['attributes']=_0x741eec[_0x088b('0x3a')]['length']?_0x741eec[_0x088b('0x3a')]:_0x383b52[_0x088b('0x36')];_0x741eec['order']=qs[_0x088b('0x40')](_0x4979b7['query'][_0x088b('0x40')]);_0x741eec[_0x088b('0x43')]=qs[_0x088b('0x38')](_[_0x088b('0x41')](_0x4979b7['query'],_0x383b52[_0x088b('0x38')]));if(_0x4979b7[_0x088b('0x37')][_0x088b('0x42')]){_0x741eec[_0x088b('0x43')]=_[_0x088b('0x44')](_0x741eec[_0x088b('0x43')],{'$or':_[_0x088b('0x2a')](_0x741eec['attributes'],function(_0x155644){var _0x205475={};_0x205475[_0x155644]={'$like':'%'+_0x4979b7[_0x088b('0x37')]['filter']+'%'};return _0x205475;})});}_0x741eec=_[_0x088b('0x44')]({},_0x741eec,_0x4979b7['options']);return _0x3beb37[_0x088b('0xb5')](_0x741eec);}})[_0x088b('0x24')](function(_0x1877fb){if(_0x1877fb){_0x536038=_0x1877fb['length'];if(!_0x4979b7['query'][_0x088b('0x3d')]('nolimit')){_0x741eec[_0x088b('0x22')]=qs[_0x088b('0x22')](_0x4979b7[_0x088b('0x37')][_0x088b('0x22')]);_0x741eec[_0x088b('0x1f')]=qs[_0x088b('0x1f')](_0x4979b7[_0x088b('0x37')]['offset']);}return _0x3beb37[_0x088b('0xb5')](_0x741eec);}})['then'](function(_0x201539){if(_0x201539){return _0x201539?{'count':_0x536038,'rows':_0x201539}:null;}})[_0x088b('0x24')](respondWithResult(_0x43732f,null))[_0x088b('0x4d')](handleError(_0x43732f,null));};exports[_0x088b('0xb6')]=function(_0x42ad81,_0xacacf7,_0x183cfb){var _0x50a6c8,_0x1621de;return db[_0x088b('0x33')][_0x088b('0x2e')]({'where':{'id':_0x42ad81['params']['id']}})[_0x088b('0x24')](handleEntityNotFound(_0xacacf7,null))[_0x088b('0x24')](function(_0xff8164){if(_0xff8164){_0x1621de=_0xff8164;return _0xff8164[_0x088b('0xb6')](_0x42ad81[_0x088b('0x4f')][_0x088b('0x7d')],_[_0x088b('0x5a')](_0x42ad81[_0x088b('0x4f')],[_0x088b('0x7d'),'id'])||{});}return null;})[_0x088b('0x8f')](function(_0x54ea92){var _0x223021;_0x50a6c8=_0x54ea92||[];var _0x2776bc=[];if(_0x54ea92){for(var _0x3cf220=0x0;_0x3cf220<_0x54ea92[_0x088b('0x3c')];_0x3cf220+=0x1){var _0x14e077=_0x54ea92[_0x3cf220][_0x088b('0x26')]({'plain':!![]});_0x223021=squel[_0x088b('0x9a')]()[_0x088b('0x9b')](_0x088b('0xb7'))[_0x088b('0xb8')]([_0x088b('0x9e'),_0x088b('0x9c'),_0x088b('0x9d'),_0x088b('0x61'),_0x088b('0x5c'),'updatedAt'],squel[_0x088b('0x7e')]()[_0x088b('0x7f')](_0x088b('0x9e'),'phone')['field']('id',_0x088b('0x9c'))[_0x088b('0x7f')](_0x14e077[_0x088b('0x9f')]['toString'](),_0x088b('0x9d'))[_0x088b('0x7f')](_0x42ad81[_0x088b('0x4b')]['id'][_0x088b('0xa0')](),_0x088b('0x61'))[_0x088b('0x7f')](_0x088b('0xb9'),_0x088b('0x5c'))[_0x088b('0x7f')](_0x088b('0xb9'),_0x088b('0x5b'))['from'](_0x088b('0xa1'))[_0x088b('0x43')](_0x088b('0xa2'))[_0x088b('0x43')](_0x088b('0xa3'),_0x14e077[_0x088b('0x9f')][_0x088b('0xa0')]())[_0x088b('0x43')](_0x088b('0xba')))[_0x088b('0xa0')]();_0x2776bc[_0x088b('0x85')](db[_0x088b('0x73')][_0x088b('0x37')](_0x223021));}return BPromise['all'](_0x2776bc);}})[_0x088b('0x24')](function(){return _0x50a6c8;})[_0x088b('0x24')](respondWithResult(_0xacacf7,null))[_0x088b('0x4d')](handleError(_0xacacf7,null));};exports[_0x088b('0xbb')]=function(_0x1414b6,_0x3d20f0,_0x27542b){return db['VoiceQueue'][_0x088b('0x2e')]({'where':{'id':_0x1414b6[_0x088b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d20f0,null))[_0x088b('0x24')](function(_0x1ed3c2){if(_0x1ed3c2){return _0x1ed3c2[_0x088b('0xbb')](_0x1414b6[_0x088b('0x37')][_0x088b('0x7d')]);}})[_0x088b('0x24')](function(_0x470b5b){if(_0x470b5b){return db[_0x088b('0x67')][_0x088b('0x25')]({'where':{'ListId':_0x1414b6['query'][_0x088b('0x7d')],'VoiceQueueId':_0x1414b6['params']['id']}})[_0x088b('0x24')](function(){return _0x470b5b;});}})[_0x088b('0x24')](respondWithStatusCode(_0x3d20f0,null))[_0x088b('0x4d')](handleError(_0x3d20f0,null));}; \ No newline at end of file +var _0x0e4b=['ContactId','ListId','CmListId','toString','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./voiceQueue.socket','register','status','end','json','undefined','limit','count','offset','set','update','then','get','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','find','type','name','UserProfileResource','destroy','stack','send','rawAttributes','fieldName','key','model','intersection','query','fields','attributes','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','options','VoiceQueue','include','findAll','rows','catch','show','params','keys','includeAll','create','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','error','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmHopper','hasOwnProperty','order','VoiceQueueId','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','isEmpty','removeAgents','emit','userVoiceQueue:remove','addAgents','spread','online','getAgents','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt'];(function(_0x474f18,_0x3fc4ed){var _0x1c372d=function(_0x5625cb){while(--_0x5625cb){_0x474f18['push'](_0x474f18['shift']());}};_0x1c372d(++_0x3fc4ed);}(_0x0e4b,0xdc));var _0xb0e4=function(_0x2b73cb,_0x35754a){_0x2b73cb=_0x2b73cb-0x0;var _0x2fae69=_0x0e4b[_0x2b73cb];return _0x2fae69;};'use strict';var emlformat=require(_0xb0e4('0x0'));var rimraf=require(_0xb0e4('0x1'));var zipdir=require(_0xb0e4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0e4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb0e4('0x4'));var sox=require(_0xb0e4('0x5'));var csv=require('to-csv');var ejs=require(_0xb0e4('0x6'));var fs=require('fs');var fs_extra=require(_0xb0e4('0x7'));var _=require(_0xb0e4('0x8'));var squel=require(_0xb0e4('0x9'));var crypto=require(_0xb0e4('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb0e4('0xb'));var querystring=require(_0xb0e4('0xc'));var Papa=require(_0xb0e4('0xd'));var Redis=require(_0xb0e4('0xe'));var authService=require(_0xb0e4('0xf'));var qs=require(_0xb0e4('0x10'));var as=require(_0xb0e4('0x11'));var hardwareService=require(_0xb0e4('0x12'));var logger=require(_0xb0e4('0x13'))(_0xb0e4('0x14'));var utils=require(_0xb0e4('0x15'));var config=require(_0xb0e4('0x16'));var licenseUtil=require(_0xb0e4('0x17'));var db=require(_0xb0e4('0x18'))['db'];config[_0xb0e4('0x19')]=_['defaults'](config[_0xb0e4('0x19')],{'host':_0xb0e4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0e4('0x19')]));require(_0xb0e4('0x1b'))[_0xb0e4('0x1c')](socket);function respondWithStatusCode(_0x460180,_0x1e1ca5){_0x1e1ca5=_0x1e1ca5||0xcc;return function(_0x57ba9d){if(_0x57ba9d){return _0x460180['sendStatus'](_0x1e1ca5);}return _0x460180[_0xb0e4('0x1d')](_0x1e1ca5)[_0xb0e4('0x1e')]();};}function respondWithResult(_0x5b219a,_0x152ceb){_0x152ceb=_0x152ceb||0xc8;return function(_0x376d1f){if(_0x376d1f){return _0x5b219a[_0xb0e4('0x1d')](_0x152ceb)[_0xb0e4('0x1f')](_0x376d1f);}};}function respondWithFilteredResult(_0x74c379,_0x3355c6){return function(_0x570886){if(_0x570886){var _0x491a29=typeof _0x3355c6['offset']===_0xb0e4('0x20')&&typeof _0x3355c6[_0xb0e4('0x21')]===_0xb0e4('0x20');var _0x690682=_0x570886[_0xb0e4('0x22')];var _0x2f3809=_0x491a29?0x0:_0x3355c6['offset'];var _0x436667=_0x491a29?_0x570886[_0xb0e4('0x22')]:_0x3355c6[_0xb0e4('0x23')]+_0x3355c6[_0xb0e4('0x21')];var _0x4bbb10;if(_0x436667>=_0x690682){_0x436667=_0x690682;_0x4bbb10=0xc8;}else{_0x4bbb10=0xce;}_0x74c379[_0xb0e4('0x1d')](_0x4bbb10);return _0x74c379[_0xb0e4('0x24')]('Content-Range',_0x2f3809+'-'+_0x436667+'/'+_0x690682)[_0xb0e4('0x1f')](_0x570886);}return null;};}function patchUpdates(_0x2774be){return function(_0xe6a9cf){try{jsonpatch['apply'](_0xe6a9cf,_0x2774be,!![]);}catch(_0x1a6810){return BPromise['reject'](_0x1a6810);}return _0xe6a9cf['save']();};}function saveUpdates(_0x21276c,_0x39db8d){return function(_0x139c84){if(_0x139c84){return _0x139c84[_0xb0e4('0x25')](_0x21276c)[_0xb0e4('0x26')](function(_0x248aa5){return _0x248aa5;});}return null;};}function removeEntity(_0x6665e,_0x50fe9e){return function(_0x28ed88){if(_0x28ed88){return _0x28ed88['destroy']()[_0xb0e4('0x26')](function(){var _0x22033f=_0x28ed88[_0xb0e4('0x27')]({'plain':!![]});var _0xfef785=[{'name':'VoiceQueues','value':_0xb0e4('0x28'),'ignore':![]},{'name':_0xb0e4('0x29'),'value':_0xb0e4('0x2a'),'ignore':![]}];var _0x451008=_(_0xfef785)[_0xb0e4('0x2b')](_0xb0e4('0x2c'))[_0xb0e4('0x2d')](_0xb0e4('0x2e'))['value']();if(_[_0xb0e4('0x2f')](_0x451008,_0x22033f['type'])){return;}var _0x16f13e=_[_0xb0e4('0x30')](_0xfef785,['value',_0x22033f[_0xb0e4('0x31')]])[_0xb0e4('0x32')];return db[_0xb0e4('0x33')][_0xb0e4('0x34')]({'where':{'type':_0x16f13e,'resourceId':_0x22033f['id']}})[_0xb0e4('0x26')](function(){return _0x28ed88;});})[_0xb0e4('0x26')](function(){_0x6665e['status'](0xcc)[_0xb0e4('0x1e')]();});}};}function handleEntityNotFound(_0x57339c,_0x5b3d93){return function(_0x311ce3){if(!_0x311ce3){_0x57339c['sendStatus'](0x194);}return _0x311ce3;};}function handleError(_0xc51bcb,_0x5f2498){_0x5f2498=_0x5f2498||0x1f4;return function(_0x7d1cf7){logger['error'](_0x7d1cf7[_0xb0e4('0x35')]);if(_0x7d1cf7[_0xb0e4('0x32')]){delete _0x7d1cf7[_0xb0e4('0x32')];}_0xc51bcb['status'](_0x5f2498)[_0xb0e4('0x36')](_0x7d1cf7);};}exports['index']=function(_0xfbc43,_0x2d3e83){var _0x23ab51={},_0x129aec={},_0x6a7758={'count':0x0,'rows':[]};var _0x59870f=_[_0xb0e4('0x2d')](db['VoiceQueue'][_0xb0e4('0x37')],function(_0x434630){return{'name':_0x434630[_0xb0e4('0x38')],'type':_0x434630['type'][_0xb0e4('0x39')]};});_0x129aec[_0xb0e4('0x3a')]=_[_0xb0e4('0x2d')](_0x59870f,_0xb0e4('0x32'));_0x129aec['query']=_['keys'](_0xfbc43['query']);_0x129aec['filters']=_[_0xb0e4('0x3b')](_0x129aec['model'],_0x129aec[_0xb0e4('0x3c')]);_0x23ab51['attributes']=_[_0xb0e4('0x3b')](_0x129aec['model'],qs[_0xb0e4('0x3d')](_0xfbc43[_0xb0e4('0x3c')][_0xb0e4('0x3d')]));_0x23ab51[_0xb0e4('0x3e')]=_0x23ab51['attributes'][_0xb0e4('0x3f')]?_0x23ab51[_0xb0e4('0x3e')]:_0x129aec['model'];if(!_0xfbc43[_0xb0e4('0x3c')]['hasOwnProperty'](_0xb0e4('0x40'))){_0x23ab51[_0xb0e4('0x21')]=qs['limit'](_0xfbc43[_0xb0e4('0x3c')]['limit']);_0x23ab51['offset']=qs['offset'](_0xfbc43[_0xb0e4('0x3c')][_0xb0e4('0x23')]);}_0x23ab51['order']=qs[_0xb0e4('0x41')](_0xfbc43['query'][_0xb0e4('0x41')]);_0x23ab51[_0xb0e4('0x42')]=qs[_0xb0e4('0x43')](_[_0xb0e4('0x44')](_0xfbc43['query'],_0x129aec[_0xb0e4('0x43')]),_0x59870f);if(_0xfbc43[_0xb0e4('0x3c')][_0xb0e4('0x2b')]){_0x23ab51[_0xb0e4('0x42')]=_[_0xb0e4('0x45')](_0x23ab51[_0xb0e4('0x42')],{'$or':_[_0xb0e4('0x2d')](_0x59870f,function(_0xd1fec){if(_0xd1fec[_0xb0e4('0x31')]!==_0xb0e4('0x46')){var _0x13faed={};_0x13faed[_0xd1fec[_0xb0e4('0x32')]]={'$like':'%'+_0xfbc43[_0xb0e4('0x3c')][_0xb0e4('0x2b')]+'%'};return _0x13faed;}})});}_0x23ab51=_[_0xb0e4('0x45')]({},_0x23ab51,_0xfbc43[_0xb0e4('0x47')]);var _0x5b7448={'where':_0x23ab51[_0xb0e4('0x42')]};return db[_0xb0e4('0x48')][_0xb0e4('0x22')](_0x5b7448)[_0xb0e4('0x26')](function(_0x4b3ec2){_0x6a7758[_0xb0e4('0x22')]=_0x4b3ec2;if(_0xfbc43[_0xb0e4('0x3c')]['includeAll']){_0x23ab51[_0xb0e4('0x49')]=[{'all':!![]}];}return db[_0xb0e4('0x48')][_0xb0e4('0x4a')](_0x23ab51);})[_0xb0e4('0x26')](function(_0x48ad47){_0x6a7758[_0xb0e4('0x4b')]=_0x48ad47;return _0x6a7758;})[_0xb0e4('0x26')](respondWithFilteredResult(_0x2d3e83,_0x23ab51))[_0xb0e4('0x4c')](handleError(_0x2d3e83,null));};exports[_0xb0e4('0x4d')]=function(_0x78b898,_0x2ffb16){var _0x2a5b12={'raw':![],'where':{'id':_0x78b898[_0xb0e4('0x4e')]['id']}},_0xe9ee50={};_0xe9ee50[_0xb0e4('0x3a')]=_[_0xb0e4('0x4f')](db['VoiceQueue'][_0xb0e4('0x37')]);_0xe9ee50[_0xb0e4('0x3c')]=_['keys'](_0x78b898['query']);_0xe9ee50['filters']=_[_0xb0e4('0x3b')](_0xe9ee50[_0xb0e4('0x3a')],_0xe9ee50['query']);_0x2a5b12['attributes']=_['intersection'](_0xe9ee50['model'],qs['fields'](_0x78b898['query'][_0xb0e4('0x3d')]));_0x2a5b12['attributes']=_0x2a5b12[_0xb0e4('0x3e')][_0xb0e4('0x3f')]?_0x2a5b12[_0xb0e4('0x3e')]:_0xe9ee50[_0xb0e4('0x3a')];if(_0x78b898['query'][_0xb0e4('0x50')]){_0x2a5b12[_0xb0e4('0x49')]=[{'all':!![]}];}_0x2a5b12=_['merge']({},_0x2a5b12,_0x78b898[_0xb0e4('0x47')]);return db['VoiceQueue'][_0xb0e4('0x30')](_0x2a5b12)[_0xb0e4('0x26')](handleEntityNotFound(_0x2ffb16,null))[_0xb0e4('0x26')](respondWithResult(_0x2ffb16,null))[_0xb0e4('0x4c')](handleError(_0x2ffb16,null));};exports['create']=function(_0x312ccc,_0x3b87a7){return db[_0xb0e4('0x48')][_0xb0e4('0x51')](_0x312ccc['body'],{})[_0xb0e4('0x26')](function(_0x1f9d98){var _0x167583=_0x312ccc['user']['get']({'plain':!![]});if(!_0x167583)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x167583['role']==='user'){var _0x288582=_0x1f9d98['get']({'plain':!![]});var _0x3a4f50=[{'name':_0xb0e4('0x52'),'value':_0xb0e4('0x28')},{'name':_0xb0e4('0x29'),'value':'outbound'}];var _0x387319=_[_0xb0e4('0x30')](_0x3a4f50,['value',_0x288582[_0xb0e4('0x31')]])['name'];return db[_0xb0e4('0x53')][_0xb0e4('0x30')]({'where':{'name':_0x387319,'userProfileId':_0x167583[_0xb0e4('0x54')]},'raw':!![]})['then'](function(_0x3ad23a){if(_0x3ad23a&&_0x3ad23a[_0xb0e4('0x55')]===0x0){return db['UserProfileResource'][_0xb0e4('0x51')]({'name':_0x288582[_0xb0e4('0x32')],'resourceId':_0x288582['id'],'type':_0x3ad23a['name'],'sectionId':_0x3ad23a['id']},{})['then'](function(){return _0x1f9d98;});}else{return _0x1f9d98;}})[_0xb0e4('0x4c')](function(_0xa4c0b0){logger[_0xb0e4('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa4c0b0);throw _0xa4c0b0;});}return _0x1f9d98;})[_0xb0e4('0x26')](respondWithResult(_0x3b87a7,0xc9))[_0xb0e4('0x4c')](handleError(_0x3b87a7,null));};exports['clone']=function(_0x313801,_0x32d5b7){var _0x571a5e={'where':{'id':_0x313801[_0xb0e4('0x4e')]['id']}},_0x108395={};_0x108395[_0xb0e4('0x3a')]=_['keys'](db[_0xb0e4('0x48')][_0xb0e4('0x37')]);_0x571a5e[_0xb0e4('0x3e')]=_[_0xb0e4('0x3b')](_0x108395['model'],qs[_0xb0e4('0x3d')](_0x313801[_0xb0e4('0x3c')][_0xb0e4('0x3d')]));_0x571a5e[_0xb0e4('0x3e')]=_0x571a5e[_0xb0e4('0x3e')][_0xb0e4('0x3f')]?_0x571a5e[_0xb0e4('0x3e')]:_0x108395['model'];if(_0x313801['query'][_0xb0e4('0x50')]){_0x571a5e[_0xb0e4('0x49')]=[{'all':!![]}];}_0x571a5e=_[_0xb0e4('0x45')]({},_0x571a5e,_0x313801[_0xb0e4('0x47')]);return db[_0xb0e4('0x48')][_0xb0e4('0x30')](_0x571a5e)[_0xb0e4('0x26')](handleEntityNotFound(_0x32d5b7,null))[_0xb0e4('0x26')](function(_0xf035a2){if(_0xf035a2){var _0x2f8e3c=_0xf035a2[_0xb0e4('0x27')]({'plain':!![]});_0x2f8e3c=qs[_0xb0e4('0x57')](_0x2f8e3c,['id',_0xb0e4('0x58'),_0xb0e4('0x59')]);_0x313801[_0xb0e4('0x5a')]=_[_0xb0e4('0x57')](_0x313801['body'],['id','createdAt',_0xb0e4('0x59')]);return db[_0xb0e4('0x48')][_0xb0e4('0x51')](_[_0xb0e4('0x45')](_0x2f8e3c,_0x313801[_0xb0e4('0x5a')]),{'include':_0x313801['query']['includeAll']?[{'all':!![]}]:undefined})[_0xb0e4('0x26')](function(_0x26d172){var _0xa05a06=_0x313801['user'][_0xb0e4('0x27')]({'plain':!![]});if(!_0xa05a06)throw new Error(_0xb0e4('0x5b'));if(_0xa05a06['role']==='user'){var _0x2c46de=_0x26d172['get']({'plain':!![]});var _0x2400e0=[{'name':_0xb0e4('0x52'),'value':_0xb0e4('0x28')},{'name':_0xb0e4('0x29'),'value':_0xb0e4('0x2a')}];var _0x27e561=_[_0xb0e4('0x30')](_0x2400e0,[_0xb0e4('0x2e'),_0x2c46de[_0xb0e4('0x31')]])[_0xb0e4('0x32')];return db[_0xb0e4('0x53')]['find']({'where':{'name':_0x27e561,'userProfileId':_0xa05a06[_0xb0e4('0x54')]},'raw':!![]})[_0xb0e4('0x26')](function(_0x1add3a){if(_0x1add3a&&_0x1add3a[_0xb0e4('0x55')]===0x0){return db[_0xb0e4('0x33')][_0xb0e4('0x51')]({'name':_0x2c46de[_0xb0e4('0x32')],'resourceId':_0x2c46de['id'],'type':_0x1add3a[_0xb0e4('0x32')],'sectionId':_0x1add3a['id']},{})['then'](function(){return _0x26d172;});}else{return _0x26d172;}})[_0xb0e4('0x4c')](function(_0xffe7f){logger[_0xb0e4('0x56')](_0xb0e4('0x5c'),_0xffe7f);throw _0xffe7f;});}return _0x26d172;});}})[_0xb0e4('0x26')](respondWithResult(_0x32d5b7,0xc9))[_0xb0e4('0x4c')](handleError(_0x32d5b7,null));};exports[_0xb0e4('0x25')]=function(_0x474956,_0x37c1d0){if(_0x474956['body']['id']){delete _0x474956[_0xb0e4('0x5a')]['id'];}return db['VoiceQueue'][_0xb0e4('0x30')]({'where':{'id':_0x474956['params']['id']}})['then'](handleEntityNotFound(_0x37c1d0,null))['then'](saveUpdates(_0x474956[_0xb0e4('0x5a')],null))[_0xb0e4('0x26')](respondWithResult(_0x37c1d0,null))[_0xb0e4('0x4c')](handleError(_0x37c1d0,null));};exports[_0xb0e4('0x34')]=function(_0x317e13,_0x157d14){return db[_0xb0e4('0x48')]['find']({'where':{'id':_0x317e13[_0xb0e4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x157d14,null))[_0xb0e4('0x26')](removeEntity(_0x157d14,null))['catch'](handleError(_0x157d14,null));};exports['getHoppers']=function(_0x100be6,_0x536fc5,_0x4bb7a6){var _0x1ac0b5={'raw':![],'where':{}};var _0x6fba98={};var _0x27e840={'count':0x0,'rows':[]};return db[_0xb0e4('0x48')]['findOne']({'where':{'id':_0x100be6[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x536fc5,null))[_0xb0e4('0x26')](function(_0x5751ae){if(_0x5751ae){_0x6fba98['model']=_[_0xb0e4('0x4f')](db[_0xb0e4('0x5d')][_0xb0e4('0x37')]);_0x6fba98[_0xb0e4('0x3c')]=_['keys'](_0x100be6[_0xb0e4('0x3c')]);_0x6fba98['filters']=_[_0xb0e4('0x3b')](_0x6fba98[_0xb0e4('0x3a')],_0x6fba98[_0xb0e4('0x3c')]);_0x1ac0b5[_0xb0e4('0x3e')]=_[_0xb0e4('0x3b')](_0x6fba98[_0xb0e4('0x3a')],qs[_0xb0e4('0x3d')](_0x100be6['query'][_0xb0e4('0x3d')]));_0x1ac0b5[_0xb0e4('0x3e')]=_0x1ac0b5[_0xb0e4('0x3e')][_0xb0e4('0x3f')]?_0x1ac0b5[_0xb0e4('0x3e')]:_0x6fba98[_0xb0e4('0x3a')];if(!_0x100be6[_0xb0e4('0x3c')][_0xb0e4('0x5e')](_0xb0e4('0x40'))){_0x1ac0b5[_0xb0e4('0x21')]=qs[_0xb0e4('0x21')](_0x100be6[_0xb0e4('0x3c')]['limit']);_0x1ac0b5[_0xb0e4('0x23')]=qs[_0xb0e4('0x23')](_0x100be6[_0xb0e4('0x3c')]['offset']);}_0x1ac0b5[_0xb0e4('0x5f')]=qs[_0xb0e4('0x41')](_0x100be6[_0xb0e4('0x3c')][_0xb0e4('0x41')]);_0x1ac0b5[_0xb0e4('0x42')]=qs[_0xb0e4('0x43')](_[_0xb0e4('0x44')](_0x100be6['query'],_0x6fba98['filters']));_0x1ac0b5['where'][_0xb0e4('0x60')]=_0x5751ae['id'];if(_0x100be6[_0xb0e4('0x3c')][_0xb0e4('0x2b')]){_0x1ac0b5[_0xb0e4('0x42')]=_[_0xb0e4('0x45')](_0x1ac0b5[_0xb0e4('0x42')],{'$or':_[_0xb0e4('0x2d')](_0x1ac0b5[_0xb0e4('0x3e')],function(_0x125f8f){var _0xdd477d={};_0xdd477d[_0x125f8f]={'$like':'%'+_0x100be6[_0xb0e4('0x3c')][_0xb0e4('0x2b')]+'%'};return _0xdd477d;})});}_0x1ac0b5=_[_0xb0e4('0x45')]({},_0x1ac0b5,_0x100be6[_0xb0e4('0x47')]);return db[_0xb0e4('0x5d')][_0xb0e4('0x22')]({'where':_0x1ac0b5['where']})[_0xb0e4('0x26')](function(_0x406242){_0x27e840['count']=_0x406242;if(_0x100be6[_0xb0e4('0x3c')][_0xb0e4('0x50')]){_0x1ac0b5['include']=[{'all':!![]}];}return db[_0xb0e4('0x5d')][_0xb0e4('0x4a')](_0x1ac0b5);})[_0xb0e4('0x26')](function(_0x5cf0cc){_0x27e840[_0xb0e4('0x4b')]=_0x5cf0cc;return _0x27e840;});}})[_0xb0e4('0x26')](respondWithFilteredResult(_0x536fc5,_0x1ac0b5))[_0xb0e4('0x4c')](handleError(_0x536fc5,null));};exports[_0xb0e4('0x61')]=function(_0x5409af,_0x344f9b,_0x332767){var _0x47e242={'raw':!![],'where':{}};var _0x22d455={};var _0x4698a1={'count':0x0,'rows':[]};return db[_0xb0e4('0x48')][_0xb0e4('0x62')]({'where':{'id':_0x5409af['params']['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x344f9b,null))[_0xb0e4('0x26')](function(_0x231c64){if(_0x231c64){_0x22d455[_0xb0e4('0x3a')]=_[_0xb0e4('0x4f')](db[_0xb0e4('0x63')][_0xb0e4('0x37')]);_0x22d455['query']=_[_0xb0e4('0x4f')](_0x5409af[_0xb0e4('0x3c')]);_0x22d455['filters']=_[_0xb0e4('0x3b')](_0x22d455['model'],_0x22d455[_0xb0e4('0x3c')]);_0x47e242[_0xb0e4('0x3e')]=_[_0xb0e4('0x3b')](_0x22d455[_0xb0e4('0x3a')],qs[_0xb0e4('0x3d')](_0x5409af[_0xb0e4('0x3c')][_0xb0e4('0x3d')]));_0x47e242[_0xb0e4('0x3e')]=_0x47e242[_0xb0e4('0x3e')][_0xb0e4('0x3f')]?_0x47e242[_0xb0e4('0x3e')]:_0x22d455[_0xb0e4('0x3a')];if(!_0x5409af[_0xb0e4('0x3c')][_0xb0e4('0x5e')]('nolimit')){_0x47e242[_0xb0e4('0x21')]=qs[_0xb0e4('0x21')](_0x5409af[_0xb0e4('0x3c')][_0xb0e4('0x21')]);_0x47e242['offset']=qs['offset'](_0x5409af[_0xb0e4('0x3c')][_0xb0e4('0x23')]);}_0x47e242[_0xb0e4('0x5f')]=qs[_0xb0e4('0x41')](_0x5409af[_0xb0e4('0x3c')][_0xb0e4('0x41')]);_0x47e242[_0xb0e4('0x42')]=qs[_0xb0e4('0x43')](_['pick'](_0x5409af[_0xb0e4('0x3c')],_0x22d455[_0xb0e4('0x43')]));_0x47e242['where']['VoiceQueueId']=_0x231c64['id'];if(_0x5409af['query'][_0xb0e4('0x2b')]){_0x47e242[_0xb0e4('0x42')]=_[_0xb0e4('0x45')](_0x47e242['where'],{'$or':_[_0xb0e4('0x2d')](_0x47e242[_0xb0e4('0x3e')],function(_0x2517fd){var _0x60bfb6={};_0x60bfb6[_0x2517fd]={'$like':'%'+_0x5409af[_0xb0e4('0x3c')]['filter']+'%'};return _0x60bfb6;})});}_0x47e242=_['merge']({},_0x47e242,_0x5409af['options']);return db[_0xb0e4('0x63')]['count']({'where':_0x47e242[_0xb0e4('0x42')]})[_0xb0e4('0x26')](function(_0xe0b486){_0x4698a1[_0xb0e4('0x22')]=_0xe0b486;if(_0x5409af['query']['includeAll']){_0x47e242[_0xb0e4('0x49')]=[{'all':!![]}];}return db[_0xb0e4('0x63')][_0xb0e4('0x4a')](_0x47e242);})[_0xb0e4('0x26')](function(_0xa8d3f){_0x4698a1[_0xb0e4('0x4b')]=_0xa8d3f;return _0x4698a1;});}})[_0xb0e4('0x26')](respondWithFilteredResult(_0x344f9b,_0x47e242))[_0xb0e4('0x4c')](handleError(_0x344f9b,null));};exports[_0xb0e4('0x64')]=function(_0x2387b3,_0x1bf6eb,_0x534787){var _0x5518a9={'raw':!![],'where':{}};var _0x509c99={};var _0x140058={'count':0x0,'rows':[]};return db[_0xb0e4('0x48')][_0xb0e4('0x62')]({'where':{'id':_0x2387b3['params']['id']}})['then'](handleEntityNotFound(_0x1bf6eb,null))[_0xb0e4('0x26')](function(_0x1ab225){if(_0x1ab225){_0x509c99[_0xb0e4('0x3a')]=_['keys'](db[_0xb0e4('0x65')][_0xb0e4('0x37')]);_0x509c99[_0xb0e4('0x3c')]=_[_0xb0e4('0x4f')](_0x2387b3[_0xb0e4('0x3c')]);_0x509c99[_0xb0e4('0x43')]=_[_0xb0e4('0x3b')](_0x509c99[_0xb0e4('0x3a')],_0x509c99[_0xb0e4('0x3c')]);_0x5518a9['attributes']=_[_0xb0e4('0x3b')](_0x509c99[_0xb0e4('0x3a')],qs[_0xb0e4('0x3d')](_0x2387b3['query']['fields']));_0x5518a9[_0xb0e4('0x3e')]=_0x5518a9[_0xb0e4('0x3e')][_0xb0e4('0x3f')]?_0x5518a9[_0xb0e4('0x3e')]:_0x509c99[_0xb0e4('0x3a')];if(!_0x2387b3[_0xb0e4('0x3c')]['hasOwnProperty'](_0xb0e4('0x40'))){_0x5518a9[_0xb0e4('0x21')]=qs[_0xb0e4('0x21')](_0x2387b3[_0xb0e4('0x3c')][_0xb0e4('0x21')]);_0x5518a9[_0xb0e4('0x23')]=qs[_0xb0e4('0x23')](_0x2387b3[_0xb0e4('0x3c')]['offset']);}_0x5518a9[_0xb0e4('0x5f')]=qs[_0xb0e4('0x41')](_0x2387b3[_0xb0e4('0x3c')][_0xb0e4('0x41')]);_0x5518a9['where']=qs['filters'](_[_0xb0e4('0x44')](_0x2387b3[_0xb0e4('0x3c')],_0x509c99[_0xb0e4('0x43')]));_0x5518a9[_0xb0e4('0x42')][_0xb0e4('0x60')]=_0x1ab225['id'];if(_0x2387b3[_0xb0e4('0x3c')]['filter']){_0x5518a9['where']=_['merge'](_0x5518a9[_0xb0e4('0x42')],{'$or':_['map'](_0x5518a9[_0xb0e4('0x3e')],function(_0x4848eb){var _0x40a25f={};_0x40a25f[_0x4848eb]={'$like':'%'+_0x2387b3[_0xb0e4('0x3c')][_0xb0e4('0x2b')]+'%'};return _0x40a25f;})});}_0x5518a9=_['merge']({},_0x5518a9,_0x2387b3['options']);return db[_0xb0e4('0x65')]['count']({'where':_0x5518a9[_0xb0e4('0x42')]})[_0xb0e4('0x26')](function(_0x56fdd3){_0x140058[_0xb0e4('0x22')]=_0x56fdd3;if(_0x2387b3[_0xb0e4('0x3c')][_0xb0e4('0x50')]){_0x5518a9['include']=[{'all':!![]}];}return db[_0xb0e4('0x65')][_0xb0e4('0x4a')](_0x5518a9);})[_0xb0e4('0x26')](function(_0x3f197c){_0x140058[_0xb0e4('0x4b')]=_0x3f197c;return _0x140058;});}})[_0xb0e4('0x26')](respondWithFilteredResult(_0x1bf6eb,_0x5518a9))[_0xb0e4('0x4c')](handleError(_0x1bf6eb,null));};exports[_0xb0e4('0x66')]=function(_0x293736,_0x2296d6,_0x43d723){var _0x1a7d8a={'raw':!![],'where':{}};var _0x1210b9={};var _0x4fd363={'count':0x0,'rows':[]};return db[_0xb0e4('0x48')][_0xb0e4('0x62')]({'where':{'id':_0x293736[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x2296d6,null))['then'](function(_0x40f443){if(_0x40f443){_0x1210b9[_0xb0e4('0x3a')]=_[_0xb0e4('0x4f')](db[_0xb0e4('0x67')][_0xb0e4('0x37')]);_0x1210b9[_0xb0e4('0x3c')]=_[_0xb0e4('0x4f')](_0x293736[_0xb0e4('0x3c')]);_0x1210b9[_0xb0e4('0x43')]=_['intersection'](_0x1210b9[_0xb0e4('0x3a')],_0x1210b9[_0xb0e4('0x3c')]);_0x1a7d8a[_0xb0e4('0x3e')]=_[_0xb0e4('0x3b')](_0x1210b9[_0xb0e4('0x3a')],qs[_0xb0e4('0x3d')](_0x293736[_0xb0e4('0x3c')]['fields']));_0x1a7d8a[_0xb0e4('0x3e')]=_0x1a7d8a['attributes'][_0xb0e4('0x3f')]?_0x1a7d8a[_0xb0e4('0x3e')]:_0x1210b9[_0xb0e4('0x3a')];if(!_0x293736['query'][_0xb0e4('0x5e')](_0xb0e4('0x40'))){_0x1a7d8a[_0xb0e4('0x21')]=qs[_0xb0e4('0x21')](_0x293736[_0xb0e4('0x3c')]['limit']);_0x1a7d8a[_0xb0e4('0x23')]=qs[_0xb0e4('0x23')](_0x293736[_0xb0e4('0x3c')][_0xb0e4('0x23')]);}_0x1a7d8a[_0xb0e4('0x5f')]=qs['sort'](_0x293736['query'][_0xb0e4('0x41')]);_0x1a7d8a['where']=qs[_0xb0e4('0x43')](_[_0xb0e4('0x44')](_0x293736[_0xb0e4('0x3c')],_0x1210b9[_0xb0e4('0x43')]));_0x1a7d8a['where'][_0xb0e4('0x60')]=_0x40f443['id'];if(_0x293736['query'][_0xb0e4('0x2b')]){_0x1a7d8a[_0xb0e4('0x42')]=_[_0xb0e4('0x45')](_0x1a7d8a[_0xb0e4('0x42')],{'$or':_[_0xb0e4('0x2d')](_0x1a7d8a[_0xb0e4('0x3e')],function(_0x4b14c8){var _0x38a8ae={};_0x38a8ae[_0x4b14c8]={'$like':'%'+_0x293736[_0xb0e4('0x3c')][_0xb0e4('0x2b')]+'%'};return _0x38a8ae;})});}_0x1a7d8a=_[_0xb0e4('0x45')]({},_0x1a7d8a,_0x293736[_0xb0e4('0x47')]);return db['CmHopperBlack']['count']({'where':_0x1a7d8a['where']})[_0xb0e4('0x26')](function(_0x4f61ed){_0x4fd363[_0xb0e4('0x22')]=_0x4f61ed;if(_0x293736[_0xb0e4('0x3c')][_0xb0e4('0x50')]){_0x1a7d8a['include']=[{'all':!![]}];}return db[_0xb0e4('0x67')]['findAll'](_0x1a7d8a);})[_0xb0e4('0x26')](function(_0x26fb02){_0x4fd363[_0xb0e4('0x4b')]=_0x26fb02;return _0x4fd363;});}})[_0xb0e4('0x26')](respondWithFilteredResult(_0x2296d6,_0x1a7d8a))['catch'](handleError(_0x2296d6,null));};exports['getTeams']=function(_0x1caa18,_0x20aec7,_0x2b2995){var _0x1fee04={};var _0x5346de={};var _0x42b6d7;var _0x22ef0e;return db[_0xb0e4('0x48')][_0xb0e4('0x62')]({'where':{'id':_0x1caa18['params']['id']}})['then'](handleEntityNotFound(_0x20aec7,null))[_0xb0e4('0x26')](function(_0xb19b0){if(_0xb19b0){_0x42b6d7=_0xb19b0;_0x5346de['model']=_[_0xb0e4('0x4f')](db[_0xb0e4('0x68')][_0xb0e4('0x37')]);_0x5346de[_0xb0e4('0x3c')]=_[_0xb0e4('0x4f')](_0x1caa18[_0xb0e4('0x3c')]);_0x5346de[_0xb0e4('0x43')]=_['intersection'](_0x5346de[_0xb0e4('0x3a')],_0x5346de[_0xb0e4('0x3c')]);_0x1fee04[_0xb0e4('0x3e')]=_[_0xb0e4('0x3b')](_0x5346de[_0xb0e4('0x3a')],qs[_0xb0e4('0x3d')](_0x1caa18['query'][_0xb0e4('0x3d')]));_0x1fee04['attributes']=_0x1fee04['attributes'][_0xb0e4('0x3f')]?_0x1fee04[_0xb0e4('0x3e')]:_0x5346de['model'];_0x1fee04[_0xb0e4('0x5f')]=qs[_0xb0e4('0x41')](_0x1caa18['query'][_0xb0e4('0x41')]);_0x1fee04['where']=qs['filters'](_[_0xb0e4('0x44')](_0x1caa18[_0xb0e4('0x3c')],_0x5346de[_0xb0e4('0x43')]));if(_0x1caa18['query'][_0xb0e4('0x2b')]){_0x1fee04[_0xb0e4('0x42')]=_[_0xb0e4('0x45')](_0x1fee04[_0xb0e4('0x42')],{'$or':_[_0xb0e4('0x2d')](_0x1fee04[_0xb0e4('0x3e')],function(_0x209df7){var _0x5293b3={};_0x5293b3[_0x209df7]={'$like':'%'+_0x1caa18[_0xb0e4('0x3c')]['filter']+'%'};return _0x5293b3;})});}_0x1fee04=_[_0xb0e4('0x45')]({},_0x1fee04,_0x1caa18[_0xb0e4('0x47')]);return _0x42b6d7[_0xb0e4('0x69')](_0x1fee04);}})[_0xb0e4('0x26')](function(_0x548862){if(_0x548862){_0x22ef0e=_0x548862[_0xb0e4('0x3f')];if(!_0x1caa18[_0xb0e4('0x3c')]['hasOwnProperty'](_0xb0e4('0x40'))){_0x1fee04['limit']=qs[_0xb0e4('0x21')](_0x1caa18[_0xb0e4('0x3c')][_0xb0e4('0x21')]);_0x1fee04[_0xb0e4('0x23')]=qs[_0xb0e4('0x23')](_0x1caa18[_0xb0e4('0x3c')]['offset']);}return _0x42b6d7[_0xb0e4('0x69')](_0x1fee04);}})['then'](function(_0x321cc5){if(_0x321cc5){return _0x321cc5?{'count':_0x22ef0e,'rows':_0x321cc5}:null;}})[_0xb0e4('0x26')](respondWithResult(_0x20aec7,null))['catch'](handleError(_0x20aec7,null));};exports[_0xb0e4('0x6a')]=function(_0x2ef6eb,_0x441b6b,_0x5caa7b){var _0x3fd177=_0x2ef6eb[_0xb0e4('0x5a')][_0xb0e4('0x6b')];var _0x58cf93=_['map'](_0x3fd177,'id');return db[_0xb0e4('0x68')]['findAll']({'where':{'id':_0x58cf93},'attributes':['id'],'include':[{'model':db[_0xb0e4('0x6c')],'as':_0xb0e4('0x6d'),'attributes':['id',_0xb0e4('0x32'),'online',_0xb0e4('0x6e'),_0xb0e4('0x6f')],'raw':!![]}]})['then'](function(_0x3dc09e){if(_0x3dc09e){var _0x11947a=_[_0xb0e4('0x70')](_0x3dc09e,function(_0x1b144f){var _0x211461=_0x1b144f[_0xb0e4('0x27')]({'plain':!![]});_0x211461['Agents'][_0xb0e4('0x71')](function(_0x2d6dcd){_0x2d6dcd[_0xb0e4('0x72')]=_['find'](_0x3fd177,{'id':_0x211461['id']})[_0xb0e4('0x72')];});return _0x211461[_0xb0e4('0x6d')];});return db[_0xb0e4('0x48')][_0xb0e4('0x30')]({'where':{'id':_0x2ef6eb[_0xb0e4('0x4e')]['id']}})['then'](function(_0x5ae25){return db[_0xb0e4('0x73')][_0xb0e4('0x74')](function(_0x48b0a6){return _0x5ae25[_0xb0e4('0x6a')](_0x58cf93,{'transaction':_0x48b0a6})[_0xb0e4('0x26')](function(){return BPromise[_0xb0e4('0x75')](_0x3fd177,function(_0x16de36){return db['TeamVoiceQueue'][_0xb0e4('0x76')]({'TeamId':_0x16de36['id'],'VoiceQueueId':_0x2ef6eb[_0xb0e4('0x4e')]['id'],'penalty':_0x16de36[_0xb0e4('0x72')]},{'transaction':_0x48b0a6});});})[_0xb0e4('0x26')](function(){return BPromise[_0xb0e4('0x75')](_0x11947a,function(_0x312c84){return db[_0xb0e4('0x77')][_0xb0e4('0x78')]({'where':{'UserId':_0x312c84['id'],'VoiceQueueId':_0x2ef6eb['params']['id']},'defaults':{'penalty':_0x312c84[_0xb0e4('0x72')]},'transaction':_0x48b0a6});});})[_0xb0e4('0x26')](function(){return BPromise['each'](_['filter'](_0x11947a,{'online':!![]}),function(_0x1cbc7f){return db[_0xb0e4('0x79')][_0xb0e4('0x76')]({'membername':_0x1cbc7f[_0xb0e4('0x32')],'UserId':_0x1cbc7f['id'],'queue_name':_0x5ae25[_0xb0e4('0x32')],'VoiceQueueId':_0x5ae25['id'],'interface':_[_0xb0e4('0x7a')](_0x1cbc7f[_0xb0e4('0x6f')])?util[_0xb0e4('0x7b')](_0xb0e4('0x7c'),_0x1cbc7f[_0xb0e4('0x32')]):_0x1cbc7f[_0xb0e4('0x6f')],'paused':_0x1cbc7f['voicePause']||![],'penalty':_0x1cbc7f[_0xb0e4('0x72')]},{'transaction':_0x48b0a6});});})[_0xb0e4('0x26')](function(){_0x11947a[_0xb0e4('0x71')](function(_0x36f9d1){socket['emit'](_0xb0e4('0x7d'),{'UserId':_0x36f9d1['id'],'VoiceQueueId':_0x5ae25['id']});});});});});}})[_0xb0e4('0x26')](respondWithStatusCode(_0x441b6b,null))[_0xb0e4('0x4c')](handleError(_0x441b6b,null));};exports[_0xb0e4('0x7e')]=function(_0x550785,_0x1bfa34,_0x3f2494){return db[_0xb0e4('0x68')][_0xb0e4('0x4a')]({'where':{'id':_0x550785[_0xb0e4('0x3c')][_0xb0e4('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb0e4('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xb0e4('0x26')](handleEntityNotFound(_0x1bfa34,null))[_0xb0e4('0x26')](function(_0x56e199){var _0x4fda88=_[_0xb0e4('0x2d')](_0x56e199,'id');var _0x45d06a=[];var _0x3c881c=[];var _0x39d243=squel[_0xb0e4('0x80')]();_0x39d243[_0xb0e4('0x81')](_0xb0e4('0x82'))['from'](_0xb0e4('0x83'),'tq')[_0xb0e4('0x84')](_0xb0e4('0x85'),'ut',_0xb0e4('0x86'))[_0xb0e4('0x42')]('VoiceQueueId\x20=\x20?',_0x550785[_0xb0e4('0x4e')]['id']);for(var _0x4628b5=0x0;_0x4628b5<_0x56e199[_0xb0e4('0x3f')];_0x4628b5+=0x1){let _0x54895e=_0x56e199[_0x4628b5];for(var _0x4407a6=0x0;_0x4407a6<_0x54895e[_0xb0e4('0x6d')]['length'];_0x4407a6+=0x1){let _0x21ba5d=_0x54895e['Agents'][_0x4407a6];var _0x14b3b0=_0x39d243['clone']();_0x14b3b0[_0xb0e4('0x42')](_0xb0e4('0x87'),_0x21ba5d['id']);_0x3c881c[_0xb0e4('0x88')](db[_0xb0e4('0x73')][_0xb0e4('0x3c')](_0x14b3b0['toString'](),{'type':db['sequelize'][_0xb0e4('0x89')][_0xb0e4('0x8a')]})['then'](function(_0x30cbd6){if(_0x30cbd6[_0xb0e4('0x3f')]===0x1){return _0x21ba5d['id'];}else{var _0x37b28c=_[_0xb0e4('0x8b')](_['map'](_0x30cbd6,_0xb0e4('0x8c')),function(_0x54e81c){return _[_0xb0e4('0x2f')](_0x4fda88,_0x54e81c);});if(_0x37b28c){return _0x21ba5d['id'];}}}));}}return BPromise[_0xb0e4('0x8d')](_0x3c881c)[_0xb0e4('0x26')](function(_0x3e89b7){_0x45d06a=_(_0x45d06a)[_0xb0e4('0x8e')](_0x3e89b7)['compact']()['value']();return db['VoiceQueue'][_0xb0e4('0x30')]({'where':{'id':_0x550785['params']['id']}})[_0xb0e4('0x26')](function(_0x5bc5ba){return db[_0xb0e4('0x73')]['transaction'](function(_0x5257e4){return _0x5bc5ba[_0xb0e4('0x7e')](_0x550785[_0xb0e4('0x3c')]['ids'],{'transaction':_0x5257e4})[_0xb0e4('0x26')](function(){if(!_[_0xb0e4('0x8f')](_0x45d06a)){return _0x5bc5ba[_0xb0e4('0x90')](_0x45d06a,{'transaction':_0x5257e4})['then'](function(){return db[_0xb0e4('0x79')][_0xb0e4('0x34')]({'where':{'VoiceQueueId':_0x550785[_0xb0e4('0x4e')]['id'],'UserId':_0x45d06a},'transaction':_0x5257e4});});}})[_0xb0e4('0x26')](function(){_0x45d06a[_0xb0e4('0x71')](function(_0x3e648a){socket[_0xb0e4('0x91')](_0xb0e4('0x92'),{'UserId':_0x3e648a,'VoiceQueueId':_0x5bc5ba['id']});});});});});});})[_0xb0e4('0x26')](respondWithStatusCode(_0x1bfa34,null))[_0xb0e4('0x4c')](handleError(_0x1bfa34,null));};exports[_0xb0e4('0x93')]=function(_0x13d842,_0x231ddd,_0x3cd7d4){var _0x150760,_0x3755bb;return db['VoiceQueue'][_0xb0e4('0x30')]({'where':{'id':_0x13d842[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x231ddd,null))[_0xb0e4('0x26')](function(_0x19e9af){if(_0x19e9af){_0x3755bb=_0x19e9af;return _0x19e9af[_0xb0e4('0x93')](_0x13d842[_0xb0e4('0x5a')][_0xb0e4('0x7f')],_[_0xb0e4('0x57')](_0x13d842[_0xb0e4('0x5a')],[_0xb0e4('0x7f'),'id'])||{})[_0xb0e4('0x94')](function(_0x2fd8cb){for(var _0x40307d=0x0;_0x40307d<_0x13d842['body'][_0xb0e4('0x7f')][_0xb0e4('0x3f')];_0x40307d+=0x1){socket[_0xb0e4('0x91')](_0xb0e4('0x7d'),{'UserId':Number(_0x13d842[_0xb0e4('0x5a')][_0xb0e4('0x7f')][_0x40307d]),'VoiceQueueId':Number(_0x13d842[_0xb0e4('0x4e')]['id'])});}return _0x2fd8cb;});}})['then'](function(_0x1cd767){_0x150760=_0x1cd767||[];if(_0x3755bb){return db[_0xb0e4('0x6c')][_0xb0e4('0x4a')]({'where':{'id':_0x13d842['body'][_0xb0e4('0x7f')]},'attributes':['id',_0xb0e4('0x32'),'online',_0xb0e4('0x6e'),_0xb0e4('0x6f')],'raw':!![]});}})['then'](function(_0x5c9f5c){if(!_[_0xb0e4('0x8f')](_0x5c9f5c)){var _0x395e41=[];for(var _0x1549bf=0x0;_0x1549bf<_0x5c9f5c['length'];_0x1549bf++){if(_0x5c9f5c[_0x1549bf][_0xb0e4('0x95')]){_0x395e41[_0xb0e4('0x88')](db[_0xb0e4('0x79')][_0xb0e4('0x76')]({'membername':_0x5c9f5c[_0x1549bf]['name'],'UserId':_0x5c9f5c[_0x1549bf]['id'],'queue_name':_0x3755bb[_0xb0e4('0x32')],'VoiceQueueId':_0x3755bb['id'],'interface':_[_0xb0e4('0x7a')](_0x5c9f5c[_0x1549bf][_0xb0e4('0x6f')])?util[_0xb0e4('0x7b')](_0xb0e4('0x7c'),_0x5c9f5c[_0x1549bf]['name']):_0x5c9f5c[_0x1549bf]['interface'],'paused':_0x5c9f5c[_0x1549bf][_0xb0e4('0x6e')]||![],'penalty':_0x13d842[_0xb0e4('0x5a')]['penalty']||0x0}));}}return BPromise[_0xb0e4('0x8d')](_0x395e41);}})[_0xb0e4('0x26')](function(){return _0x150760;})[_0xb0e4('0x26')](respondWithResult(_0x231ddd,null))[_0xb0e4('0x4c')](handleError(_0x231ddd,null));};exports[_0xb0e4('0x90')]=function(_0x379674,_0x5279b1,_0x378de3){return db[_0xb0e4('0x48')][_0xb0e4('0x30')]({'where':{'id':_0x379674[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x5279b1,null))['then'](function(_0x322f70){if(_0x322f70){return _0x322f70[_0xb0e4('0x90')](_0x379674[_0xb0e4('0x3c')]['ids'])[_0xb0e4('0x26')](function(){if(_['isArray'](_0x379674[_0xb0e4('0x3c')][_0xb0e4('0x7f')])){for(var _0x392b9a=0x0;_0x392b9a<_0x379674['query'][_0xb0e4('0x7f')][_0xb0e4('0x3f')];_0x392b9a+=0x1){socket[_0xb0e4('0x91')](_0xb0e4('0x92'),{'UserId':Number(_0x379674['query'][_0xb0e4('0x7f')][_0x392b9a]),'VoiceQueueId':Number(_0x379674['params']['id'])});}}else{socket[_0xb0e4('0x91')](_0xb0e4('0x92'),{'UserId':Number(_0x379674[_0xb0e4('0x3c')][_0xb0e4('0x7f')]),'VoiceQueueId':Number(_0x379674[_0xb0e4('0x4e')]['id'])});}});}})[_0xb0e4('0x26')](function(_0x242a83){return db[_0xb0e4('0x79')][_0xb0e4('0x34')]({'where':{'VoiceQueueId':_0x379674[_0xb0e4('0x4e')]['id'],'UserId':_0x379674[_0xb0e4('0x3c')][_0xb0e4('0x7f')]}})[_0xb0e4('0x26')](function(){return _0x242a83;});})[_0xb0e4('0x26')](respondWithStatusCode(_0x5279b1,null))[_0xb0e4('0x4c')](handleError(_0x5279b1,null));};exports[_0xb0e4('0x96')]=function(_0x52ba8c,_0x441ad6,_0xf43e88){var _0x47213f={};var _0x3655d6={};var _0x49e982;var _0x290180;return db[_0xb0e4('0x48')][_0xb0e4('0x62')]({'where':{'id':_0x52ba8c[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x441ad6,null))['then'](function(_0x4bbd32){if(_0x4bbd32){_0x49e982=_0x4bbd32;_0x3655d6[_0xb0e4('0x3a')]=_[_0xb0e4('0x4f')](db[_0xb0e4('0x6c')][_0xb0e4('0x37')]);_0x3655d6[_0xb0e4('0x3c')]=_[_0xb0e4('0x4f')](_0x52ba8c['query']);_0x3655d6[_0xb0e4('0x43')]=_[_0xb0e4('0x3b')](_0x3655d6[_0xb0e4('0x3a')],_0x3655d6[_0xb0e4('0x3c')]);_0x47213f[_0xb0e4('0x3e')]=_['intersection'](_0x3655d6[_0xb0e4('0x3a')],qs['fields'](_0x52ba8c[_0xb0e4('0x3c')][_0xb0e4('0x3d')]));_0x47213f[_0xb0e4('0x3e')]=_0x47213f[_0xb0e4('0x3e')][_0xb0e4('0x3f')]?_0x47213f[_0xb0e4('0x3e')]:_0x3655d6['model'];_0x47213f['order']=qs[_0xb0e4('0x41')](_0x52ba8c[_0xb0e4('0x3c')]['sort']);_0x47213f[_0xb0e4('0x42')]=qs[_0xb0e4('0x43')](_[_0xb0e4('0x44')](_0x52ba8c[_0xb0e4('0x3c')],_0x3655d6[_0xb0e4('0x43')]));if(_0x52ba8c[_0xb0e4('0x3c')][_0xb0e4('0x2b')]){_0x47213f[_0xb0e4('0x42')]=_[_0xb0e4('0x45')](_0x47213f[_0xb0e4('0x42')],{'$or':_[_0xb0e4('0x2d')](_0x47213f[_0xb0e4('0x3e')],function(_0x40ff22){var _0x29b4fb={};_0x29b4fb[_0x40ff22]={'$like':'%'+_0x52ba8c['query']['filter']+'%'};return _0x29b4fb;})});}_0x47213f=_[_0xb0e4('0x45')]({},_0x47213f,_0x52ba8c[_0xb0e4('0x47')]);return _0x49e982[_0xb0e4('0x96')](_0x47213f);}})[_0xb0e4('0x26')](function(_0x2490a8){if(_0x2490a8){_0x290180=_0x2490a8[_0xb0e4('0x3f')];if(!_0x52ba8c['query'][_0xb0e4('0x5e')](_0xb0e4('0x40'))){_0x47213f['limit']=qs[_0xb0e4('0x21')](_0x52ba8c[_0xb0e4('0x3c')][_0xb0e4('0x21')]);_0x47213f[_0xb0e4('0x23')]=qs[_0xb0e4('0x23')](_0x52ba8c[_0xb0e4('0x3c')]['offset']);}return _0x49e982[_0xb0e4('0x96')](_0x47213f);}})[_0xb0e4('0x26')](function(_0x49fbf3){if(_0x49fbf3){return _0x49fbf3?{'count':_0x290180,'rows':_0x49fbf3}:null;}})[_0xb0e4('0x26')](respondWithResult(_0x441ad6,null))[_0xb0e4('0x4c')](handleError(_0x441ad6,null));};exports['getMembers']=function(_0x195cbd,_0x505517,_0x217d5e){var _0x762206={};var _0x34d607={};var _0x16a5d1;var _0x2cd857;return db[_0xb0e4('0x48')][_0xb0e4('0x62')]({'where':{'id':_0x195cbd[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x505517,null))[_0xb0e4('0x26')](function(_0xf4f29e){if(_0xf4f29e){_0x16a5d1=_0xf4f29e;_0x34d607[_0xb0e4('0x3a')]=_[_0xb0e4('0x4f')](db['UserVoiceQueueRt'][_0xb0e4('0x37')]);_0x34d607[_0xb0e4('0x3c')]=_[_0xb0e4('0x4f')](_0x195cbd['query']);_0x34d607[_0xb0e4('0x43')]=_['intersection'](_0x34d607['model'],_0x34d607['query']);_0x762206[_0xb0e4('0x3e')]=_[_0xb0e4('0x3b')](_0x34d607[_0xb0e4('0x3a')],qs[_0xb0e4('0x3d')](_0x195cbd[_0xb0e4('0x3c')]['fields']));_0x762206[_0xb0e4('0x3e')]=_0x762206[_0xb0e4('0x3e')][_0xb0e4('0x3f')]?_0x762206[_0xb0e4('0x3e')]:_0x34d607[_0xb0e4('0x3a')];_0x762206[_0xb0e4('0x5f')]=qs[_0xb0e4('0x41')](_0x195cbd[_0xb0e4('0x3c')][_0xb0e4('0x41')]);_0x762206['where']=qs[_0xb0e4('0x43')](_[_0xb0e4('0x44')](_0x195cbd['query'],_0x34d607[_0xb0e4('0x43')]));if(_0x195cbd['query'][_0xb0e4('0x2b')]){_0x762206[_0xb0e4('0x42')]=_['merge'](_0x762206[_0xb0e4('0x42')],{'$or':_[_0xb0e4('0x2d')](_0x762206[_0xb0e4('0x3e')],function(_0x5ebdf8){var _0x1bfff1={};_0x1bfff1[_0x5ebdf8]={'$like':'%'+_0x195cbd[_0xb0e4('0x3c')][_0xb0e4('0x2b')]+'%'};return _0x1bfff1;})});}_0x762206=_[_0xb0e4('0x45')]({},_0x762206,_0x195cbd[_0xb0e4('0x47')]);return _0x16a5d1['getMembers'](_0x762206);}})[_0xb0e4('0x26')](function(_0x4457a5){if(_0x4457a5){_0x2cd857=_0x4457a5[_0xb0e4('0x3f')];if(!_0x195cbd[_0xb0e4('0x3c')][_0xb0e4('0x5e')](_0xb0e4('0x40'))){_0x762206[_0xb0e4('0x21')]=qs[_0xb0e4('0x21')](_0x195cbd[_0xb0e4('0x3c')][_0xb0e4('0x21')]);_0x762206[_0xb0e4('0x23')]=qs[_0xb0e4('0x23')](_0x195cbd[_0xb0e4('0x3c')][_0xb0e4('0x23')]);}return _0x16a5d1['getMembers'](_0x762206);}})[_0xb0e4('0x26')](function(_0x24bc26){return _0x24bc26?{'count':_0x2cd857,'rows':_0x24bc26}:null;})[_0xb0e4('0x26')](respondWithResult(_0x505517,null))[_0xb0e4('0x4c')](handleError(_0x505517,null));};exports[_0xb0e4('0x97')]=function(_0xddfd88,_0x2f72a8,_0x33d16c){var _0x587527={};var _0x51e5e8={};var _0x35832e;var _0x52fdd9;return db[_0xb0e4('0x48')][_0xb0e4('0x62')]({'where':{'id':_0xddfd88[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x2f72a8,null))[_0xb0e4('0x26')](function(_0xfb5ce7){if(_0xfb5ce7){_0x35832e=_0xfb5ce7;_0x51e5e8[_0xb0e4('0x3a')]=_[_0xb0e4('0x4f')](db['CmList'][_0xb0e4('0x37')]);_0x51e5e8['query']=_[_0xb0e4('0x4f')](_0xddfd88[_0xb0e4('0x3c')]);_0x51e5e8[_0xb0e4('0x43')]=_[_0xb0e4('0x3b')](_0x51e5e8[_0xb0e4('0x3a')],_0x51e5e8[_0xb0e4('0x3c')]);_0x587527[_0xb0e4('0x3e')]=_[_0xb0e4('0x3b')](_0x51e5e8[_0xb0e4('0x3a')],qs[_0xb0e4('0x3d')](_0xddfd88['query'][_0xb0e4('0x3d')]));_0x587527[_0xb0e4('0x3e')]=_0x587527[_0xb0e4('0x3e')][_0xb0e4('0x3f')]?_0x587527[_0xb0e4('0x3e')]:_0x51e5e8[_0xb0e4('0x3a')];_0x587527[_0xb0e4('0x5f')]=qs[_0xb0e4('0x41')](_0xddfd88[_0xb0e4('0x3c')][_0xb0e4('0x41')]);_0x587527[_0xb0e4('0x42')]=qs['filters'](_[_0xb0e4('0x44')](_0xddfd88['query'],_0x51e5e8[_0xb0e4('0x43')]));if(_0xddfd88[_0xb0e4('0x3c')]['filter']){_0x587527[_0xb0e4('0x42')]=_[_0xb0e4('0x45')](_0x587527[_0xb0e4('0x42')],{'$or':_[_0xb0e4('0x2d')](_0x587527[_0xb0e4('0x3e')],function(_0x10ad16){var _0x6bacad={};_0x6bacad[_0x10ad16]={'$like':'%'+_0xddfd88['query'][_0xb0e4('0x2b')]+'%'};return _0x6bacad;})});}_0x587527=_[_0xb0e4('0x45')]({},_0x587527,_0xddfd88[_0xb0e4('0x47')]);return _0x35832e[_0xb0e4('0x97')](_0x587527);}})[_0xb0e4('0x26')](function(_0x4fd36d){if(_0x4fd36d){_0x52fdd9=_0x4fd36d[_0xb0e4('0x3f')];if(!_0xddfd88[_0xb0e4('0x3c')][_0xb0e4('0x5e')](_0xb0e4('0x40'))){_0x587527[_0xb0e4('0x21')]=qs['limit'](_0xddfd88[_0xb0e4('0x3c')][_0xb0e4('0x21')]);_0x587527[_0xb0e4('0x23')]=qs[_0xb0e4('0x23')](_0xddfd88[_0xb0e4('0x3c')][_0xb0e4('0x23')]);}return _0x35832e[_0xb0e4('0x97')](_0x587527);}})[_0xb0e4('0x26')](function(_0x1ff972){if(_0x1ff972){return _0x1ff972?{'count':_0x52fdd9,'rows':_0x1ff972}:null;}})[_0xb0e4('0x26')](respondWithResult(_0x2f72a8,null))[_0xb0e4('0x4c')](handleError(_0x2f72a8,null));};exports[_0xb0e4('0x98')]=function(_0x993bd2,_0x4e20a6,_0xb33f71){var _0x4de18e=moment()[_0xb0e4('0x7b')](_0xb0e4('0x99'));var _0x2b5fe4,_0x340557;return db['VoiceQueue'][_0xb0e4('0x30')]({'where':{'id':_0x993bd2['params']['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x4e20a6,null))['then'](function(_0x197dbb){if(_0x197dbb){_0x340557=_0x197dbb;return _0x197dbb['addLists'](_0x993bd2['body']['ids'],_[_0xb0e4('0x57')](_0x993bd2[_0xb0e4('0x5a')],['ids','id'])||{});}return null;})[_0xb0e4('0x94')](function(_0x1dffce){var _0x1a6698;_0x2b5fe4=_0x1dffce||[];var _0x51be52=[];if(_0x1dffce){for(var _0x500950=0x0;_0x500950<_0x1dffce['length'];_0x500950+=0x1){var _0x35927b=_0x1dffce[_0x500950][_0xb0e4('0x27')]({'plain':!![]});_0x340557[_0xb0e4('0x9a')]=_0x993bd2[_0xb0e4('0x5a')]['dialCheckDuplicateType']?_0x993bd2[_0xb0e4('0x5a')][_0xb0e4('0x9a')]:_0x340557[_0xb0e4('0x9a')];switch(_0x340557[_0xb0e4('0x9a')]){case _0xb0e4('0x9b'):_0x1a6698=squel[_0xb0e4('0x9c')]()[_0xb0e4('0x9d')](_0xb0e4('0x9e'))[_0xb0e4('0x9f')]([_0xb0e4('0xa0'),_0xb0e4('0xa1'),_0xb0e4('0xa2'),_0xb0e4('0xa3'),_0xb0e4('0x60'),_0xb0e4('0x58'),_0xb0e4('0x59')],squel[_0xb0e4('0x80')]()[_0xb0e4('0x81')](_0xb0e4('0xa0'),_0xb0e4('0xa0'))['field']('\x27'+_0x4de18e+'\x27',_0xb0e4('0xa1'))[_0xb0e4('0x81')]('id',_0xb0e4('0xa2'))['field'](_0x35927b[_0xb0e4('0xa4')][_0xb0e4('0xa5')](),'ListId')[_0xb0e4('0x81')](_0x993bd2[_0xb0e4('0x4e')]['id'][_0xb0e4('0xa5')](),'VoiceQueueId')[_0xb0e4('0x81')]('\x27'+_0x4de18e+'\x27',_0xb0e4('0x58'))[_0xb0e4('0x81')]('\x27'+_0x4de18e+'\x27',_0xb0e4('0x59'))[_0xb0e4('0xa6')](_0xb0e4('0xa7'))[_0xb0e4('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x35927b[_0xb0e4('0xa4')][_0xb0e4('0xa5')]())[_0xb0e4('0x42')](_0xb0e4('0xa8'))[_0xb0e4('0x42')](_0xb0e4('0xa9'),squel['select']()['field'](_0xb0e4('0xaa'))[_0xb0e4('0xa6')](_0xb0e4('0xab'))['where'](_0xb0e4('0xac'),_0x993bd2['params']['id']['toString']()))[_0xb0e4('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0xb0e4('0x80')]()[_0xb0e4('0x81')](_0xb0e4('0xad'))[_0xb0e4('0xa6')](_0xb0e4('0x9e'))[_0xb0e4('0x42')](_0xb0e4('0xac'),_0x993bd2[_0xb0e4('0x4e')]['id']['toString']())))[_0xb0e4('0xa5')]();break;case _0xb0e4('0xae'):_0x1a6698=squel[_0xb0e4('0x9c')]()['into'](_0xb0e4('0x9e'))['fromQuery']([_0xb0e4('0xa0'),_0xb0e4('0xa1'),_0xb0e4('0xa2'),_0xb0e4('0xa3'),'VoiceQueueId',_0xb0e4('0x58'),_0xb0e4('0x59')],squel['select']()[_0xb0e4('0x81')](_0xb0e4('0xa0'),'phone')[_0xb0e4('0x81')]('\x27'+_0x4de18e+'\x27','scheduledAt')[_0xb0e4('0x81')]('id','ContactId')['field'](_0x35927b[_0xb0e4('0xa4')][_0xb0e4('0xa5')](),_0xb0e4('0xa3'))[_0xb0e4('0x81')](_0x993bd2['params']['id'][_0xb0e4('0xa5')](),'VoiceQueueId')[_0xb0e4('0x81')]('\x27'+_0x4de18e+'\x27',_0xb0e4('0x58'))[_0xb0e4('0x81')]('\x27'+_0x4de18e+'\x27',_0xb0e4('0x59'))[_0xb0e4('0xa6')](_0xb0e4('0xa7'))[_0xb0e4('0x42')]('deletedAt\x20IS\x20NULL')[_0xb0e4('0x42')](_0xb0e4('0xaf'),_0x35927b['CmListId'][_0xb0e4('0xa5')]())[_0xb0e4('0x42')](_0xb0e4('0xa8'))['where'](_0xb0e4('0xa9'),squel[_0xb0e4('0x80')]()[_0xb0e4('0x81')]('COALESCE(phone,\x27\x27)')['from'](_0xb0e4('0x9e'))['where'](_0xb0e4('0xac'),_0x993bd2[_0xb0e4('0x4e')]['id'][_0xb0e4('0xa5')]())))[_0xb0e4('0xa5')]();break;default:_0x1a6698=squel[_0xb0e4('0x9c')]()[_0xb0e4('0x9d')](_0xb0e4('0x9e'))[_0xb0e4('0x9f')]([_0xb0e4('0xa0'),_0xb0e4('0xa1'),'ContactId','ListId',_0xb0e4('0x60'),'createdAt',_0xb0e4('0x59')],squel[_0xb0e4('0x80')]()[_0xb0e4('0x81')]('phone','phone')[_0xb0e4('0x81')]('\x27'+_0x4de18e+'\x27',_0xb0e4('0xa1'))['field']('id',_0xb0e4('0xa2'))['field'](_0x35927b['CmListId'][_0xb0e4('0xa5')](),_0xb0e4('0xa3'))[_0xb0e4('0x81')](_0x993bd2['params']['id'][_0xb0e4('0xa5')](),_0xb0e4('0x60'))[_0xb0e4('0x81')]('\x27'+_0x4de18e+'\x27','createdAt')[_0xb0e4('0x81')]('\x27'+_0x4de18e+'\x27','updatedAt')[_0xb0e4('0xa6')](_0xb0e4('0xa7'))['where'](_0xb0e4('0xb0'))[_0xb0e4('0x42')](_0xb0e4('0xaf'),_0x35927b[_0xb0e4('0xa4')][_0xb0e4('0xa5')]())['where'](_0xb0e4('0xa8')))[_0xb0e4('0xa5')]();}_0x51be52[_0xb0e4('0x88')](db['sequelize'][_0xb0e4('0x3c')](_0x1a6698));}return BPromise[_0xb0e4('0x8d')](_0x51be52);}})[_0xb0e4('0x26')](function(){var _0x4bb0fd=[];var _0x5d7907=squel['insert']()[_0xb0e4('0x9d')](_0xb0e4('0xb1'))[_0xb0e4('0x9f')]([_0xb0e4('0xb2'),_0xb0e4('0xa0'),_0xb0e4('0xb3'),_0xb0e4('0x58'),_0xb0e4('0x59')],squel[_0xb0e4('0x80')]()['field']('h.id')['field'](_0xb0e4('0xb4'))['field']('ci.OrderBy+1')['field']('\x27'+_0x4de18e+'\x27',_0xb0e4('0x58'))['field']('\x27'+_0x4de18e+'\x27',_0xb0e4('0x59'))['from'](_0xb0e4('0xb5'),'ci')['join'](_0xb0e4('0x9e'),'h',_0xb0e4('0xb6'))[_0xb0e4('0x42')](_0xb0e4('0xb7'),_0x4de18e)[_0xb0e4('0x42')](_0xb0e4('0xb8'),'PHONE'))[_0xb0e4('0xa5')]();_0x4bb0fd[_0xb0e4('0x88')](db[_0xb0e4('0x73')][_0xb0e4('0x3c')](_0x5d7907));return BPromise[_0xb0e4('0x8d')](_0x4bb0fd);})['then'](function(){return _0x2b5fe4;})[_0xb0e4('0x26')](respondWithResult(_0x4e20a6,null))[_0xb0e4('0x4c')](handleError(_0x4e20a6,null));};exports['removeLists']=function(_0x58b8c9,_0x5ef04d,_0x5e7e48){return db['VoiceQueue']['find']({'where':{'id':_0x58b8c9[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x5ef04d,null))['then'](function(_0x5eecf5){if(_0x5eecf5){return _0x5eecf5[_0xb0e4('0xb9')](_0x58b8c9[_0xb0e4('0x3c')]['ids']);}})['then'](function(_0x4169c9){if(_0x4169c9){return db[_0xb0e4('0x5d')]['destroy']({'where':{'ListId':_0x58b8c9['query']['ids'],'VoiceQueueId':_0x58b8c9[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](function(){return _0x4169c9;});}})['then'](respondWithStatusCode(_0x5ef04d,null))[_0xb0e4('0x4c')](handleError(_0x5ef04d,null));};exports[_0xb0e4('0xba')]=function(_0x19ad57,_0x594ec9,_0x30046d){var _0xda96ad={};var _0x3dc077={};var _0xbaae34;var _0xc62649;return db[_0xb0e4('0x48')]['findOne']({'where':{'id':_0x19ad57[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x594ec9,null))[_0xb0e4('0x26')](function(_0x5b8771){if(_0x5b8771){_0xbaae34=_0x5b8771;_0x3dc077['model']=_[_0xb0e4('0x4f')](db['CmList'][_0xb0e4('0x37')]);_0x3dc077['query']=_[_0xb0e4('0x4f')](_0x19ad57[_0xb0e4('0x3c')]);_0x3dc077[_0xb0e4('0x43')]=_['intersection'](_0x3dc077[_0xb0e4('0x3a')],_0x3dc077[_0xb0e4('0x3c')]);_0xda96ad[_0xb0e4('0x3e')]=_[_0xb0e4('0x3b')](_0x3dc077[_0xb0e4('0x3a')],qs[_0xb0e4('0x3d')](_0x19ad57['query'][_0xb0e4('0x3d')]));_0xda96ad[_0xb0e4('0x3e')]=_0xda96ad['attributes'][_0xb0e4('0x3f')]?_0xda96ad[_0xb0e4('0x3e')]:_0x3dc077[_0xb0e4('0x3a')];_0xda96ad[_0xb0e4('0x5f')]=qs[_0xb0e4('0x41')](_0x19ad57[_0xb0e4('0x3c')][_0xb0e4('0x41')]);_0xda96ad[_0xb0e4('0x42')]=qs['filters'](_[_0xb0e4('0x44')](_0x19ad57[_0xb0e4('0x3c')],_0x3dc077[_0xb0e4('0x43')]));if(_0x19ad57[_0xb0e4('0x3c')][_0xb0e4('0x2b')]){_0xda96ad[_0xb0e4('0x42')]=_[_0xb0e4('0x45')](_0xda96ad['where'],{'$or':_[_0xb0e4('0x2d')](_0xda96ad['attributes'],function(_0xb130d5){var _0x3ab153={};_0x3ab153[_0xb130d5]={'$like':'%'+_0x19ad57[_0xb0e4('0x3c')][_0xb0e4('0x2b')]+'%'};return _0x3ab153;})});}_0xda96ad=_[_0xb0e4('0x45')]({},_0xda96ad,_0x19ad57['options']);return _0xbaae34[_0xb0e4('0xba')](_0xda96ad);}})[_0xb0e4('0x26')](function(_0x50c88d){if(_0x50c88d){_0xc62649=_0x50c88d['length'];if(!_0x19ad57[_0xb0e4('0x3c')][_0xb0e4('0x5e')](_0xb0e4('0x40'))){_0xda96ad[_0xb0e4('0x21')]=qs[_0xb0e4('0x21')](_0x19ad57[_0xb0e4('0x3c')][_0xb0e4('0x21')]);_0xda96ad[_0xb0e4('0x23')]=qs['offset'](_0x19ad57['query'][_0xb0e4('0x23')]);}return _0xbaae34[_0xb0e4('0xba')](_0xda96ad);}})['then'](function(_0x4a23bb){if(_0x4a23bb){return _0x4a23bb?{'count':_0xc62649,'rows':_0x4a23bb}:null;}})['then'](respondWithResult(_0x594ec9,null))[_0xb0e4('0x4c')](handleError(_0x594ec9,null));};exports['addBlackLists']=function(_0x9f7bae,_0x589af6,_0x14457a){var _0x594c8c,_0x9e11d1;return db[_0xb0e4('0x48')][_0xb0e4('0x30')]({'where':{'id':_0x9f7bae[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x589af6,null))[_0xb0e4('0x26')](function(_0x17930a){if(_0x17930a){_0x9e11d1=_0x17930a;return _0x17930a[_0xb0e4('0xbb')](_0x9f7bae[_0xb0e4('0x5a')]['ids'],_[_0xb0e4('0x57')](_0x9f7bae[_0xb0e4('0x5a')],[_0xb0e4('0x7f'),'id'])||{});}return null;})[_0xb0e4('0x94')](function(_0x5b2b04){var _0x5164d5;_0x594c8c=_0x5b2b04||[];var _0x5b2384=[];if(_0x5b2b04){for(var _0x5646ca=0x0;_0x5646ca<_0x5b2b04['length'];_0x5646ca+=0x1){var _0x1ccc92=_0x5b2b04[_0x5646ca][_0xb0e4('0x27')]({'plain':!![]});_0x5164d5=squel[_0xb0e4('0x9c')]()[_0xb0e4('0x9d')](_0xb0e4('0xbc'))[_0xb0e4('0x9f')]([_0xb0e4('0xa0'),_0xb0e4('0xa2'),'ListId',_0xb0e4('0x60'),_0xb0e4('0x58'),_0xb0e4('0x59')],squel[_0xb0e4('0x80')]()[_0xb0e4('0x81')](_0xb0e4('0xa0'),_0xb0e4('0xa0'))[_0xb0e4('0x81')]('id',_0xb0e4('0xa2'))['field'](_0x1ccc92[_0xb0e4('0xa4')][_0xb0e4('0xa5')](),_0xb0e4('0xa3'))[_0xb0e4('0x81')](_0x9f7bae[_0xb0e4('0x4e')]['id'][_0xb0e4('0xa5')](),'VoiceQueueId')['field'](_0xb0e4('0xbd'),_0xb0e4('0x58'))[_0xb0e4('0x81')](_0xb0e4('0xbd'),_0xb0e4('0x59'))[_0xb0e4('0xa6')](_0xb0e4('0xa7'))[_0xb0e4('0x42')](_0xb0e4('0xb0'))[_0xb0e4('0x42')](_0xb0e4('0xaf'),_0x1ccc92[_0xb0e4('0xa4')]['toString']())[_0xb0e4('0x42')](_0xb0e4('0xa8')))['toString']();_0x5b2384[_0xb0e4('0x88')](db[_0xb0e4('0x73')][_0xb0e4('0x3c')](_0x5164d5));}return BPromise[_0xb0e4('0x8d')](_0x5b2384);}})[_0xb0e4('0x26')](function(){return _0x594c8c;})[_0xb0e4('0x26')](respondWithResult(_0x589af6,null))['catch'](handleError(_0x589af6,null));};exports[_0xb0e4('0xbe')]=function(_0x41df90,_0x1c5337,_0x22834f){return db[_0xb0e4('0x48')][_0xb0e4('0x30')]({'where':{'id':_0x41df90[_0xb0e4('0x4e')]['id']}})[_0xb0e4('0x26')](handleEntityNotFound(_0x1c5337,null))[_0xb0e4('0x26')](function(_0x366abb){if(_0x366abb){return _0x366abb[_0xb0e4('0xbe')](_0x41df90['query'][_0xb0e4('0x7f')]);}})[_0xb0e4('0x26')](function(_0x55d5aa){if(_0x55d5aa){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x41df90[_0xb0e4('0x3c')]['ids'],'VoiceQueueId':_0x41df90['params']['id']}})[_0xb0e4('0x26')](function(){return _0x55d5aa;});}})[_0xb0e4('0x26')](respondWithStatusCode(_0x1c5337,null))['catch'](handleError(_0x1c5337,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5684e85..695f2bb 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 _0x0c6c=['exports','events','../../mysqldb','VoiceQueue','save','remove','emit'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0x0c6c,0x1a5));var _0xc0c6=function(_0x372b9d,_0x547e8c){_0x372b9d=_0x372b9d-0x0;var _0x48cb9b=_0x0c6c[_0x372b9d];return _0x48cb9b;};'use strict';var EventEmitter=require(_0xc0c6('0x0'));var VoiceQueue=require(_0xc0c6('0x1'))['db'][_0xc0c6('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc0c6('0x3'),'afterUpdate':'update','afterDestroy':_0xc0c6('0x4')};function emitEvent(_0x3877b8){return function(_0x27a949,_0xf1bcd1,_0x3109a4){VoiceQueueEvents[_0xc0c6('0x5')](_0x3877b8+':'+_0x27a949['id'],_0x27a949);VoiceQueueEvents[_0xc0c6('0x5')](_0x3877b8,_0x27a949);_0x3109a4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xc0c6('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0x9471=['emit','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9471,0x173));var _0x1947=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9471[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x1947('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1947('0x1')](0x0);var events={'afterCreate':_0x1947('0x2'),'afterUpdate':_0x1947('0x3'),'afterDestroy':_0x1947('0x4')};function emitEvent(_0x1c8604){return function(_0x62bc84,_0x3b0bdb,_0x9e5c50){VoiceQueueEvents['emit'](_0x1c8604+':'+_0x62bc84['id'],_0x62bc84);VoiceQueueEvents[_0x1947('0x5')](_0x1c8604,_0x62bc84);_0x9e5c50(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1947('0x6')](e,emitEvent(event));}}module[_0x1947('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5ff291d..c1aed53 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(_0x51a299,_0x1d8091){var _0x3c1128=function(_0x6a622d){while(--_0x6a622d){_0x51a299['push'](_0x51a299['shift']());}};_0x3c1128(++_0x1d8091);}(_0xedd9,0xfc));var _0x9edd=function(_0xf4b49,_0x7c2356){_0xf4b49=_0xf4b49-0x0;var _0x181c78=_0xedd9[_0xf4b49];return _0x181c78;};'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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x3e3221,_0x392851){var _0x190da4=function(_0x13d601){while(--_0x13d601){_0x3e3221['push'](_0x3e3221['shift']());}};_0x190da4(++_0x392851);}(_0x70e0,0x17b));var _0x070e=function(_0x3da149,_0x321951){_0x3da149=_0x3da149-0x0;var _0x415552=_0x70e0[_0x3da149];return _0x415552;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'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 ebb1cb2..edd8f6f 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 _0x4819=['request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','findAll','options','limit','include','attributes','map','model','debug','ShowVoiceQueue','VoiceQueue','find','where','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x4114ef,_0x59b4b9){var _0x33b4f5=function(_0x3e0251){while(--_0x3e0251){_0x4114ef['push'](_0x4114ef['shift']());}};_0x33b4f5(++_0x59b4b9);}(_0x4819,0x14c));var _0x9481=function(_0x4cb9d5,_0x187d5a){_0x4cb9d5=_0x4cb9d5-0x0;var _0x444523=_0x4819[_0x4cb9d5];return _0x444523;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9481('0x3'));var logger=require(_0x9481('0x4'))(_0x9481('0x5'));var config=require(_0x9481('0x6'));var jayson=require(_0x9481('0x7'));var client=jayson['client'][_0x9481('0x8')]({'port':0x232a});config['redis']=_[_0x9481('0x9')](config['redis'],{'host':_0x9481('0xa'),'port':0x18eb});var socket=require(_0x9481('0xb'))(new Redis(config[_0x9481('0xc')]));require(_0x9481('0xd'))[_0x9481('0xe')](socket);function respondWithRpcPromise(_0xe98ee0,_0x5c064a,_0x2f7e40){return new BPromise(function(_0x1f4064,_0x519837){return client[_0x9481('0xf')](_0xe98ee0,_0x2f7e40)[_0x9481('0x10')](function(_0x43f75f){logger[_0x9481('0x11')](_0x9481('0x12'),_0x5c064a,_0x9481('0x13'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x5c064a,_0x9481('0x13'),JSON[_0x9481('0x14')](_0x43f75f));if(_0x43f75f[_0x9481('0x15')]){if(_0x43f75f[_0x9481('0x15')][_0x9481('0x16')]===0x1f4){logger[_0x9481('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x5c064a,_0x43f75f['error']['message']);return _0x519837(_0x43f75f[_0x9481('0x15')][_0x9481('0x17')]);}logger[_0x9481('0x15')](_0x9481('0x12'),_0x5c064a,_0x43f75f['error'][_0x9481('0x17')]);return _0x1f4064(_0x43f75f[_0x9481('0x15')][_0x9481('0x17')]);}else{logger[_0x9481('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x5c064a,'request\x20sent');_0x1f4064(_0x43f75f[_0x9481('0x18')][_0x9481('0x17')]);}})[_0x9481('0x19')](function(_0x2928a0){logger[_0x9481('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x5c064a,_0x2928a0);_0x519837(_0x2928a0);});});}exports[_0x9481('0x1a')]=function(_0x252fa3){var _0x1abf01=this;return new Promise(function(_0x1f973c,_0x186494){return db['VoiceQueue'][_0x9481('0x1b')]({'raw':_0x252fa3['options']?_0x252fa3[_0x9481('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x252fa3[_0x9481('0x1c')]?_0x252fa3[_0x9481('0x1c')]['where']||null:null,'attributes':_0x252fa3['options']?_0x252fa3['options']['attributes']||null:null,'limit':_0x252fa3[_0x9481('0x1c')]?_0x252fa3[_0x9481('0x1c')][_0x9481('0x1d')]||null:null,'include':_0x252fa3[_0x9481('0x1c')]?_0x252fa3[_0x9481('0x1c')][_0x9481('0x1e')]?_['map'](_0x252fa3[_0x9481('0x1c')][_0x9481('0x1e')],function(_0x1c9f39){return{'model':db[_0x1c9f39['model']],'as':_0x1c9f39['as'],'attributes':_0x1c9f39[_0x9481('0x1f')],'include':_0x1c9f39['include']?_[_0x9481('0x20')](_0x1c9f39[_0x9481('0x1e')],function(_0x105050){return{'model':db[_0x105050[_0x9481('0x21')]],'as':_0x105050['as'],'attributes':_0x105050[_0x9481('0x1f')],'include':_0x105050['include']?_['map'](_0x105050[_0x9481('0x1e')],function(_0x381164){return{'model':db[_0x381164[_0x9481('0x21')]],'as':_0x381164['as'],'attributes':_0x381164['attributes']};}):[]};}):[]};}):[]:[]})[_0x9481('0x10')](function(_0x33ef3e){logger['info'](_0x9481('0x1a'),_0x252fa3);logger[_0x9481('0x22')](_0x9481('0x1a'),_0x252fa3,JSON[_0x9481('0x14')](_0x33ef3e));_0x1f973c(_0x33ef3e);})[_0x9481('0x19')](function(_0x101347){logger['error'](_0x9481('0x1a'),_0x101347[_0x9481('0x17')],_0x252fa3);_0x186494(_0x1abf01[_0x9481('0x15')](0x1f4,_0x101347[_0x9481('0x17')]));});});};exports[_0x9481('0x23')]=function(_0x11ffc7){var _0x2cfb6b=this;return new Promise(function(_0x58a50a,_0x36cbcd){return db[_0x9481('0x24')][_0x9481('0x25')]({'raw':_0x11ffc7[_0x9481('0x1c')]?_0x11ffc7[_0x9481('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x11ffc7[_0x9481('0x1c')]?_0x11ffc7[_0x9481('0x1c')][_0x9481('0x26')]||null:null,'attributes':_0x11ffc7[_0x9481('0x1c')]?_0x11ffc7[_0x9481('0x1c')][_0x9481('0x1f')]||null:null,'include':_0x11ffc7[_0x9481('0x1c')]?_0x11ffc7[_0x9481('0x1c')][_0x9481('0x1e')]?_[_0x9481('0x20')](_0x11ffc7[_0x9481('0x1c')][_0x9481('0x1e')],function(_0x46e95b){return{'model':db[_0x46e95b[_0x9481('0x21')]],'as':_0x46e95b['as'],'attributes':_0x46e95b[_0x9481('0x1f')],'include':_0x46e95b['include']?_['map'](_0x46e95b['include'],function(_0x54f732){return{'model':db[_0x54f732[_0x9481('0x21')]],'as':_0x54f732['as'],'attributes':_0x54f732[_0x9481('0x1f')],'include':_0x54f732[_0x9481('0x1e')]?_[_0x9481('0x20')](_0x54f732[_0x9481('0x1e')],function(_0x5008ce){return{'model':db[_0x5008ce[_0x9481('0x21')]],'as':_0x5008ce['as'],'attributes':_0x5008ce['attributes']};}):[]};}):[]};}):[]:[]})[_0x9481('0x10')](function(_0x818de){logger['info'](_0x9481('0x23'),_0x11ffc7);logger['debug']('ShowVoiceQueue',_0x11ffc7,JSON[_0x9481('0x14')](_0x818de));_0x58a50a(_0x818de);})[_0x9481('0x19')](function(_0x1c076d){logger[_0x9481('0x15')](_0x9481('0x23'),_0x1c076d[_0x9481('0x17')],_0x11ffc7);_0x36cbcd(_0x2cfb6b[_0x9481('0x15')](0x1f4,_0x1c076d['message']));});});}; \ No newline at end of file +var _0x03af=['localhost','./voiceQueue.socket','register','request','then','info','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueue,\x20%s,\x20%s','message','catch','GetVoiceQueue','VoiceQueue','options','where','limit','include','model','attributes','map','ShowVoiceQueue','find','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x23c047,_0x3dca4e){var _0x581e4e=function(_0x499e46){while(--_0x499e46){_0x23c047['push'](_0x23c047['shift']());}};_0x581e4e(++_0x3dca4e);}(_0x03af,0xdc));var _0xf03a=function(_0x21f0b3,_0x4fd9e4){_0x21f0b3=_0x21f0b3-0x0;var _0x3e66ab=_0x03af[_0x21f0b3];return _0x3e66ab;};'use strict';var _=require(_0xf03a('0x0'));var util=require(_0xf03a('0x1'));var moment=require(_0xf03a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf03a('0x3'));var fs=require('fs');var Redis=require(_0xf03a('0x4'));var db=require(_0xf03a('0x5'))['db'];var utils=require(_0xf03a('0x6'));var logger=require(_0xf03a('0x7'))(_0xf03a('0x8'));var config=require(_0xf03a('0x9'));var jayson=require(_0xf03a('0xa'));var client=jayson[_0xf03a('0xb')]['http']({'port':0x232a});config[_0xf03a('0xc')]=_[_0xf03a('0xd')](config[_0xf03a('0xc')],{'host':_0xf03a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf03a('0xf'))[_0xf03a('0x10')](socket);function respondWithRpcPromise(_0x477d60,_0x4f8759,_0x2b05af){return new BPromise(function(_0x523dc0,_0x42a46b){return client[_0xf03a('0x11')](_0x477d60,_0x2b05af)[_0xf03a('0x12')](function(_0x3c7d93){logger[_0xf03a('0x13')]('VoiceQueue,\x20%s,\x20%s',_0x4f8759,_0xf03a('0x14'));logger['debug'](_0xf03a('0x15'),_0x4f8759,_0xf03a('0x14'),JSON[_0xf03a('0x16')](_0x3c7d93));if(_0x3c7d93[_0xf03a('0x17')]){if(_0x3c7d93['error']['code']===0x1f4){logger[_0xf03a('0x17')](_0xf03a('0x18'),_0x4f8759,_0x3c7d93['error'][_0xf03a('0x19')]);return _0x42a46b(_0x3c7d93[_0xf03a('0x17')][_0xf03a('0x19')]);}logger['error'](_0xf03a('0x18'),_0x4f8759,_0x3c7d93[_0xf03a('0x17')][_0xf03a('0x19')]);return _0x523dc0(_0x3c7d93['error']['message']);}else{logger[_0xf03a('0x13')](_0xf03a('0x18'),_0x4f8759,_0xf03a('0x14'));_0x523dc0(_0x3c7d93['result']['message']);}})[_0xf03a('0x1a')](function(_0x52e568){logger[_0xf03a('0x17')](_0xf03a('0x18'),_0x4f8759,_0x52e568);_0x42a46b(_0x52e568);});});}exports[_0xf03a('0x1b')]=function(_0x14025b){var _0x2d41d0=this;return new Promise(function(_0xcd683f,_0x3393f2){return db[_0xf03a('0x1c')]['findAll']({'raw':_0x14025b['options']?_0x14025b[_0xf03a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x14025b['options']?_0x14025b[_0xf03a('0x1d')][_0xf03a('0x1e')]||null:null,'attributes':_0x14025b[_0xf03a('0x1d')]?_0x14025b[_0xf03a('0x1d')]['attributes']||null:null,'limit':_0x14025b['options']?_0x14025b[_0xf03a('0x1d')][_0xf03a('0x1f')]||null:null,'include':_0x14025b[_0xf03a('0x1d')]?_0x14025b[_0xf03a('0x1d')][_0xf03a('0x20')]?_['map'](_0x14025b[_0xf03a('0x1d')][_0xf03a('0x20')],function(_0x105c47){return{'model':db[_0x105c47[_0xf03a('0x21')]],'as':_0x105c47['as'],'attributes':_0x105c47[_0xf03a('0x22')],'include':_0x105c47[_0xf03a('0x20')]?_[_0xf03a('0x23')](_0x105c47[_0xf03a('0x20')],function(_0x4b0848){return{'model':db[_0x4b0848[_0xf03a('0x21')]],'as':_0x4b0848['as'],'attributes':_0x4b0848[_0xf03a('0x22')],'include':_0x4b0848['include']?_[_0xf03a('0x23')](_0x4b0848[_0xf03a('0x20')],function(_0xa893b5){return{'model':db[_0xa893b5[_0xf03a('0x21')]],'as':_0xa893b5['as'],'attributes':_0xa893b5[_0xf03a('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf03a('0x12')](function(_0xaae061){logger[_0xf03a('0x13')]('GetVoiceQueue',_0x14025b);logger['debug'](_0xf03a('0x1b'),_0x14025b,JSON['stringify'](_0xaae061));_0xcd683f(_0xaae061);})[_0xf03a('0x1a')](function(_0x2f7de7){logger[_0xf03a('0x17')](_0xf03a('0x1b'),_0x2f7de7['message'],_0x14025b);_0x3393f2(_0x2d41d0[_0xf03a('0x17')](0x1f4,_0x2f7de7[_0xf03a('0x19')]));});});};exports[_0xf03a('0x24')]=function(_0x1daa8b){var _0x4c8862=this;return new Promise(function(_0x48e2dc,_0x529574){return db[_0xf03a('0x1c')][_0xf03a('0x25')]({'raw':_0x1daa8b[_0xf03a('0x1d')]?_0x1daa8b[_0xf03a('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1daa8b['options']?_0x1daa8b[_0xf03a('0x1d')][_0xf03a('0x1e')]||null:null,'attributes':_0x1daa8b[_0xf03a('0x1d')]?_0x1daa8b[_0xf03a('0x1d')][_0xf03a('0x22')]||null:null,'include':_0x1daa8b[_0xf03a('0x1d')]?_0x1daa8b[_0xf03a('0x1d')][_0xf03a('0x20')]?_[_0xf03a('0x23')](_0x1daa8b[_0xf03a('0x1d')]['include'],function(_0x5355fe){return{'model':db[_0x5355fe[_0xf03a('0x21')]],'as':_0x5355fe['as'],'attributes':_0x5355fe[_0xf03a('0x22')],'include':_0x5355fe[_0xf03a('0x20')]?_[_0xf03a('0x23')](_0x5355fe['include'],function(_0xa0718f){return{'model':db[_0xa0718f['model']],'as':_0xa0718f['as'],'attributes':_0xa0718f[_0xf03a('0x22')],'include':_0xa0718f['include']?_[_0xf03a('0x23')](_0xa0718f[_0xf03a('0x20')],function(_0x3bffaf){return{'model':db[_0x3bffaf[_0xf03a('0x21')]],'as':_0x3bffaf['as'],'attributes':_0x3bffaf[_0xf03a('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fee26){logger['info'](_0xf03a('0x24'),_0x1daa8b);logger[_0xf03a('0x26')](_0xf03a('0x24'),_0x1daa8b,JSON[_0xf03a('0x16')](_0x4fee26));_0x48e2dc(_0x4fee26);})[_0xf03a('0x1a')](function(_0x2b540b){logger[_0xf03a('0x17')]('ShowVoiceQueue',_0x2b540b[_0xf03a('0x19')],_0x1daa8b);_0x529574(_0x4c8862[_0xf03a('0x17')](0x1f4,_0x2b540b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 7743307..3213efb 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 _0xf47a=['length','voiceQueue:','./voiceQueue.events','save','remove','removeListener','register'];(function(_0x5d16fb,_0x4fcc7a){var _0x8b5e9d=function(_0x224374){while(--_0x224374){_0x5d16fb['push'](_0x5d16fb['shift']());}};_0x8b5e9d(++_0x4fcc7a);}(_0xf47a,0x11a));var _0xaf47=function(_0x154163,_0x2eb88c){_0x154163=_0x154163-0x0;var _0x41dd43=_0xf47a[_0x154163];return _0x41dd43;};'use strict';var VoiceQueueEvents=require(_0xaf47('0x0'));var events=[_0xaf47('0x1'),_0xaf47('0x2'),'update'];function createListener(_0x382be3,_0x691b69){return function(_0x104479){_0x691b69['emit'](_0x382be3,_0x104479);};}function removeListener(_0x53e486,_0x429ab1){return function(){VoiceQueueEvents[_0xaf47('0x3')](_0x53e486,_0x429ab1);};}exports[_0xaf47('0x4')]=function(_0x3430f5){for(var _0x12cb46=0x0,_0x3771c6=events[_0xaf47('0x5')];_0x12cb46<_0x3771c6;_0x12cb46++){var _0x2a4d1e=events[_0x12cb46];var _0x2e9e87=createListener(_0xaf47('0x6')+_0x2a4d1e,_0x3430f5);VoiceQueueEvents['on'](_0x2a4d1e,_0x2e9e87);}}; \ No newline at end of file +var _0x822e=['emit','removeListener','register','length','./voiceQueue.events','save','remove','update'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x822e,0x1f4));var _0xe822=function(_0x5a7bfe,_0x56b03c){_0x5a7bfe=_0x5a7bfe-0x0;var _0x16197d=_0x822e[_0x5a7bfe];return _0x16197d;};'use strict';var VoiceQueueEvents=require(_0xe822('0x0'));var events=[_0xe822('0x1'),_0xe822('0x2'),_0xe822('0x3')];function createListener(_0x5713d0,_0x2db697){return function(_0x3d884d){_0x2db697[_0xe822('0x4')](_0x5713d0,_0x3d884d);};}function removeListener(_0x1f0c91,_0x596b55){return function(){VoiceQueueEvents[_0xe822('0x5')](_0x1f0c91,_0x596b55);};}exports[_0xe822('0x6')]=function(_0x5b28dc){for(var _0x577840=0x0,_0x4fdc0e=events[_0xe822('0x7')];_0x577840<_0x4fdc0e;_0x577840++){var _0x2805b9=events[_0x577840];var _0x300875=createListener('voiceQueue:'+_0x2805b9,_0x5b28dc);VoiceQueueEvents['on'](_0x2805b9,_0x300875);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 659e898..a705af2 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 _0x07da=['exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','delete'];(function(_0x50e6bf,_0x5cc3cc){var _0xe072b1=function(_0x300474){while(--_0x300474){_0x50e6bf['push'](_0x50e6bf['shift']());}};_0xe072b1(++_0x5cc3cc);}(_0x07da,0x177));var _0xa07d=function(_0x39ffd1,_0x299703){_0x39ffd1=_0x39ffd1-0x0;var _0x31267e=_0x07da[_0x39ffd1];return _0x31267e;};'use strict';var multer=require(_0xa07d('0x0'));var util=require(_0xa07d('0x1'));var path=require(_0xa07d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa07d('0x3'));var auth=require(_0xa07d('0x4'));var interaction=require(_0xa07d('0x5'));var config=require(_0xa07d('0x6'));var controller=require(_0xa07d('0x7'));router[_0xa07d('0x8')]('/',auth[_0xa07d('0x9')](),controller[_0xa07d('0xa')]);router['get'](_0xa07d('0xb'),auth['isAuthenticated'](),controller[_0xa07d('0xc')]);router[_0xa07d('0x8')](_0xa07d('0xd'),auth['isAuthenticated'](),controller[_0xa07d('0xe')]);router[_0xa07d('0x8')](_0xa07d('0xf'),auth[_0xa07d('0x9')](),controller[_0xa07d('0x10')]);router[_0xa07d('0x11')]('/',auth['isAuthenticated'](),controller[_0xa07d('0x12')]);router[_0xa07d('0x13')]('/:id',auth[_0xa07d('0x9')](),controller['update']);router[_0xa07d('0x14')]('/:id',auth[_0xa07d('0x9')](),controller['destroy']);module[_0xa07d('0x15')]=router; \ No newline at end of file +var _0xb3c5=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','show','create','put'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb3c5,0x192));var _0x5b3c=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xb3c5[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x5b3c('0x0'));var util=require(_0x5b3c('0x1'));var path=require(_0x5b3c('0x2'));var timeout=require(_0x5b3c('0x3'));var express=require('express');var router=express[_0x5b3c('0x4')]();var fs_extra=require(_0x5b3c('0x5'));var auth=require(_0x5b3c('0x6'));var interaction=require(_0x5b3c('0x7'));var config=require(_0x5b3c('0x8'));var controller=require('./voiceQueueReport.controller');router[_0x5b3c('0x9')]('/',auth[_0x5b3c('0xa')](),controller[_0x5b3c('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5b3c('0xc')]);router[_0x5b3c('0x9')](_0x5b3c('0xd'),auth[_0x5b3c('0xa')](),controller[_0x5b3c('0xe')]);router[_0x5b3c('0x9')]('/:id',auth[_0x5b3c('0xa')](),controller[_0x5b3c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5b3c('0x10')]);router[_0x5b3c('0x11')]('/:id',auth[_0x5b3c('0xa')](),controller['update']);router[_0x5b3c('0x12')]('/:id',auth[_0x5b3c('0xa')](),controller[_0x5b3c('0x13')]);module[_0x5b3c('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index fd8001e..5a6c774 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 _0x7eab=['sequelize','exports','STRING','DATE','getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x511929,_0x18d1eb){var _0x296489=function(_0x2bc675){while(--_0x2bc675){_0x511929['push'](_0x511929['shift']());}};_0x296489(++_0x18d1eb);}(_0x7eab,0x177));var _0xb7ea=function(_0x15f67d,_0x15cbb0){_0x15f67d=_0x15f67d-0x0;var _0x2f0ac2=_0x7eab[_0x15f67d];return _0x2f0ac2;};'use strict';var Sequelize=require(_0xb7ea('0x0'));var moment=require('moment');module[_0xb7ea('0x1')]={'type':{'type':Sequelize[_0xb7ea('0x2')]},'uniqueid':{'type':Sequelize[_0xb7ea('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb7ea('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xb7ea('0x3')],'set':function(_0x147c31){var _0x4a6706=moment(_0x147c31);var _0x4e28ef=moment(this[_0xb7ea('0x4')]('queuecallerjoinAt'))[_0xb7ea('0x5')](_0xb7ea('0x6'));var _0x1bf687=_0x4a6706[_0xb7ea('0x7')](_0x4e28ef,_0xb7ea('0x8'));this[_0xb7ea('0x9')](_0xb7ea('0xa'),_0x147c31);this[_0xb7ea('0x9')](_0xb7ea('0xb'),_0x1bf687||null);}},'position':{'type':Sequelize[_0xb7ea('0xc')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xb7ea('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb7ea('0x3')]},'queuecallerexit':{'type':Sequelize[_0xb7ea('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb7ea('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xb7ea('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0xb7ea('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb7ea('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xb7ea('0x2')]},'context':{'type':Sequelize[_0xb7ea('0x2')]},'exten':{'type':Sequelize[_0xb7ea('0x2')]},'priority':{'type':Sequelize[_0xb7ea('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xb7ea('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb7ea('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb7ea('0x2')]},'transfer':{'type':Sequelize[_0xb7ea('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb7ea('0x2')],'comment':_0xb7ea('0xe')},'transferexten':{'type':Sequelize[_0xb7ea('0x2')]},'transferuniqueid':{'type':Sequelize[_0xb7ea('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb7ea('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb7ea('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xb7ea('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xb7ea('0x2')]}}; \ No newline at end of file +var _0x77a7=['diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x4e0adf,_0xb8bb74){var _0x1a019a=function(_0x300662){while(--_0x300662){_0x4e0adf['push'](_0x4e0adf['shift']());}};_0x1a019a(++_0xb8bb74);}(_0x77a7,0xbe));var _0x777a=function(_0x42853d,_0x49d6ee){_0x42853d=_0x42853d-0x0;var _0x119be3=_0x77a7[_0x42853d];return _0x119be3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x777a('0x0'));module[_0x777a('0x1')]={'type':{'type':Sequelize[_0x777a('0x2')]},'uniqueid':{'type':Sequelize[_0x777a('0x2')]},'calleridnum':{'type':Sequelize[_0x777a('0x2')]},'calleridname':{'type':Sequelize[_0x777a('0x2')]},'queue':{'type':Sequelize[_0x777a('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x777a('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x777a('0x3')],'set':function(_0x2c0111){var _0xda68b6=moment(_0x2c0111);var _0x370055=moment(this[_0x777a('0x4')](_0x777a('0x5')))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x15282b=_0xda68b6[_0x777a('0x6')](_0x370055,_0x777a('0x7'));this[_0x777a('0x8')](_0x777a('0x9'),_0x2c0111);this[_0x777a('0x8')]('holdtime',_0x15282b||null);}},'position':{'type':Sequelize[_0x777a('0xa')]},'count':{'type':Sequelize[_0x777a('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x777a('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x777a('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x777a('0x3')]},'queuecallerexit':{'type':Sequelize[_0x777a('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x777a('0x2')],'comment':_0x777a('0xc')},'originalposition':{'type':Sequelize[_0x777a('0xa')]},'channel':{'type':Sequelize[_0x777a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x777a('0x2')]},'connectedlinename':{'type':Sequelize[_0x777a('0x2')]},'accountcode':{'type':Sequelize[_0x777a('0x2')]},'context':{'type':Sequelize[_0x777a('0x2')]},'exten':{'type':Sequelize[_0x777a('0x2')]},'priority':{'type':Sequelize[_0x777a('0x2')]},'holdtime':{'type':Sequelize[_0x777a('0xa')]},'mohtime':{'type':Sequelize[_0x777a('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x777a('0x2')]},'transfer':{'type':Sequelize[_0x777a('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x777a('0xd')},'transferexten':{'type':Sequelize[_0x777a('0x2')]},'transferuniqueid':{'type':Sequelize[_0x777a('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x777a('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index c61c291..02179f2 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 _0x129b=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','index','map','VoiceQueueReport','fieldName','key','model','query','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','length','find','body','params','describe','getVoiceQueuesReport','rawAttributes','hasOwnProperty','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x129b,0x1dd));var _0xb129=function(_0x527824,_0xc824a9){_0x527824=_0x527824-0x0;var _0xc8b8ed=_0x129b[_0x527824];return _0xc8b8ed;};'use strict';var emlformat=require(_0xb129('0x0'));var rimraf=require(_0xb129('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb129('0x2'));var BPromise=require(_0xb129('0x3'));var Mustache=require(_0xb129('0x4'));var util=require(_0xb129('0x5'));var path=require(_0xb129('0x6'));var sox=require(_0xb129('0x7'));var csv=require(_0xb129('0x8'));var ejs=require(_0xb129('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb129('0xa'));var squel=require(_0xb129('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb129('0xc'));var toCsv=require(_0xb129('0x8'));var querystring=require(_0xb129('0xd'));var Papa=require(_0xb129('0xe'));var Redis=require(_0xb129('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb129('0x10'));var hardwareService=require(_0xb129('0x11'));var logger=require(_0xb129('0x12'))(_0xb129('0x13'));var utils=require(_0xb129('0x14'));var config=require(_0xb129('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb129('0x16'))['db'];config[_0xb129('0x17')]=_[_0xb129('0x18')](config[_0xb129('0x17')],{'host':_0xb129('0x19'),'port':0x18eb});var socket=require(_0xb129('0x1a'))(new Redis(config[_0xb129('0x17')]));require(_0xb129('0x1b'))[_0xb129('0x1c')](socket);function respondWithStatusCode(_0x13bf58,_0x448509){_0x448509=_0x448509||0xcc;return function(_0xe0384){if(_0xe0384){return _0x13bf58['sendStatus'](_0x448509);}return _0x13bf58[_0xb129('0x1d')](_0x448509)[_0xb129('0x1e')]();};}function respondWithResult(_0xd27ab8,_0x429d7c){_0x429d7c=_0x429d7c||0xc8;return function(_0x33c167){if(_0x33c167){return _0xd27ab8['status'](_0x429d7c)[_0xb129('0x1f')](_0x33c167);}};}function respondWithFilteredResult(_0x151e7f,_0x4ce7d8){return function(_0x5c02e5){if(_0x5c02e5){var _0x53d502=typeof _0x4ce7d8[_0xb129('0x20')]===_0xb129('0x21')&&typeof _0x4ce7d8[_0xb129('0x22')]===_0xb129('0x21');var _0x5f00c7=_0x5c02e5[_0xb129('0x23')];var _0xa6f26c=_0x53d502?0x0:_0x4ce7d8[_0xb129('0x20')];var _0x4094d7=_0x53d502?_0x5c02e5[_0xb129('0x23')]:_0x4ce7d8[_0xb129('0x20')]+_0x4ce7d8['limit'];var _0xb1a8e2;if(_0x4094d7>=_0x5f00c7){_0x4094d7=_0x5f00c7;_0xb1a8e2=0xc8;}else{_0xb1a8e2=0xce;}_0x151e7f['status'](_0xb1a8e2);return _0x151e7f['set'](_0xb129('0x24'),_0xa6f26c+'-'+_0x4094d7+'/'+_0x5f00c7)['json'](_0x5c02e5);}return null;};}function patchUpdates(_0x1b3dbf){return function(_0x17bcf9){try{jsonpatch[_0xb129('0x25')](_0x17bcf9,_0x1b3dbf,!![]);}catch(_0x334e22){return BPromise[_0xb129('0x26')](_0x334e22);}return _0x17bcf9[_0xb129('0x27')]();};}function saveUpdates(_0xe8a916,_0x5c0951){return function(_0x47c47b){if(_0x47c47b){return _0x47c47b[_0xb129('0x28')](_0xe8a916)['then'](function(_0x29f5d4){return _0x29f5d4;});}return null;};}function removeEntity(_0x1a3bd0,_0x48e781){return function(_0x2d1c84){if(_0x2d1c84){return _0x2d1c84[_0xb129('0x29')]()[_0xb129('0x2a')](function(){_0x1a3bd0[_0xb129('0x1d')](0xcc)[_0xb129('0x1e')]();});}};}function handleEntityNotFound(_0x23f959,_0x363c91){return function(_0x1df707){if(!_0x1df707){_0x23f959[_0xb129('0x2b')](0x194);}return _0x1df707;};}function handleError(_0x2c4f5a,_0x2b2003){_0x2b2003=_0x2b2003||0x1f4;return function(_0x365753){logger[_0xb129('0x2c')](_0x365753['stack']);if(_0x365753[_0xb129('0x2d')]){delete _0x365753[_0xb129('0x2d')];}_0x2c4f5a['status'](_0x2b2003)[_0xb129('0x2e')](_0x365753);};}exports[_0xb129('0x2f')]=function(_0x4b6a16,_0x2fb950){var _0x553ccf={},_0x5c1947={},_0x5f3af4={'count':0x0,'rows':[]};var _0x5b6ac3=_[_0xb129('0x30')](db[_0xb129('0x31')]['rawAttributes'],function(_0x1f503b){return{'name':_0x1f503b[_0xb129('0x32')],'type':_0x1f503b['type'][_0xb129('0x33')]};});_0x5c1947[_0xb129('0x34')]=_[_0xb129('0x30')](_0x5b6ac3,_0xb129('0x2d'));_0x5c1947[_0xb129('0x35')]=_['keys'](_0x4b6a16[_0xb129('0x35')]);_0x5c1947['filters']=_[_0xb129('0x36')](_0x5c1947['model'],_0x5c1947[_0xb129('0x35')]);_0x553ccf['attributes']=_['intersection'](_0x5c1947[_0xb129('0x34')],qs[_0xb129('0x37')](_0x4b6a16[_0xb129('0x35')]['fields']));_0x553ccf['attributes']=_0x553ccf[_0xb129('0x38')]['length']?_0x553ccf[_0xb129('0x38')]:_0x5c1947[_0xb129('0x34')];if(!_0x4b6a16[_0xb129('0x35')]['hasOwnProperty'](_0xb129('0x39'))){_0x553ccf['limit']=qs['limit'](_0x4b6a16[_0xb129('0x35')][_0xb129('0x22')]);_0x553ccf['offset']=qs[_0xb129('0x20')](_0x4b6a16[_0xb129('0x35')][_0xb129('0x20')]);}_0x553ccf[_0xb129('0x3a')]=qs[_0xb129('0x3b')](_0x4b6a16[_0xb129('0x35')][_0xb129('0x3b')]);_0x553ccf[_0xb129('0x3c')]=qs[_0xb129('0x3d')](_[_0xb129('0x3e')](_0x4b6a16['query'],_0x5c1947[_0xb129('0x3d')]),_0x5b6ac3);if(_0x4b6a16[_0xb129('0x35')]['filter']){_0x553ccf[_0xb129('0x3c')]=_[_0xb129('0x3f')](_0x553ccf[_0xb129('0x3c')],{'$or':_[_0xb129('0x30')](_0x5b6ac3,function(_0xaa8808){if(_0xaa8808['type']!==_0xb129('0x40')){var _0x1b5f6d={};_0x1b5f6d[_0xaa8808[_0xb129('0x2d')]]={'$like':'%'+_0x4b6a16[_0xb129('0x35')][_0xb129('0x41')]+'%'};return _0x1b5f6d;}})});}_0x553ccf=_[_0xb129('0x3f')]({},_0x553ccf,_0x4b6a16[_0xb129('0x42')]);var _0x12aed3={'where':_0x553ccf[_0xb129('0x3c')]};return db[_0xb129('0x31')][_0xb129('0x23')](_0x12aed3)['then'](function(_0x46c9a5){_0x5f3af4[_0xb129('0x23')]=_0x46c9a5;if(_0x4b6a16[_0xb129('0x35')][_0xb129('0x43')]){_0x553ccf[_0xb129('0x44')]=[{'all':!![]}];}return db[_0xb129('0x31')][_0xb129('0x45')](_0x553ccf);})[_0xb129('0x2a')](function(_0x147f1e){_0x5f3af4[_0xb129('0x46')]=_0x147f1e;return _0x5f3af4;})[_0xb129('0x2a')](respondWithFilteredResult(_0x2fb950,_0x553ccf))[_0xb129('0x47')](handleError(_0x2fb950,null));};exports[_0xb129('0x48')]=function(_0xd45ad0,_0x2ef03c){var _0x15c3c9={'raw':![],'where':{'id':_0xd45ad0['params']['id']}},_0x529475={};_0x529475[_0xb129('0x34')]=_[_0xb129('0x49')](db[_0xb129('0x31')]['rawAttributes']);_0x529475['query']=_['keys'](_0xd45ad0['query']);_0x529475[_0xb129('0x3d')]=_[_0xb129('0x36')](_0x529475[_0xb129('0x34')],_0x529475[_0xb129('0x35')]);_0x15c3c9[_0xb129('0x38')]=_['intersection'](_0x529475[_0xb129('0x34')],qs[_0xb129('0x37')](_0xd45ad0[_0xb129('0x35')][_0xb129('0x37')]));_0x15c3c9[_0xb129('0x38')]=_0x15c3c9[_0xb129('0x38')][_0xb129('0x4a')]?_0x15c3c9['attributes']:_0x529475[_0xb129('0x34')];if(_0xd45ad0[_0xb129('0x35')][_0xb129('0x43')]){_0x15c3c9[_0xb129('0x44')]=[{'all':!![]}];}_0x15c3c9=_[_0xb129('0x3f')]({},_0x15c3c9,_0xd45ad0[_0xb129('0x42')]);return db[_0xb129('0x31')][_0xb129('0x4b')](_0x15c3c9)[_0xb129('0x2a')](handleEntityNotFound(_0x2ef03c,null))[_0xb129('0x2a')](respondWithResult(_0x2ef03c,null))[_0xb129('0x47')](handleError(_0x2ef03c,null));};exports['create']=function(_0x491cc9,_0x566a14){return db[_0xb129('0x31')]['create'](_0x491cc9[_0xb129('0x4c')],{})[_0xb129('0x2a')](respondWithResult(_0x566a14,0xc9))[_0xb129('0x47')](handleError(_0x566a14,null));};exports[_0xb129('0x28')]=function(_0x39c655,_0x4a2e06){if(_0x39c655[_0xb129('0x4c')]['id']){delete _0x39c655[_0xb129('0x4c')]['id'];}return db['VoiceQueueReport'][_0xb129('0x4b')]({'where':{'id':_0x39c655[_0xb129('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a2e06,null))[_0xb129('0x2a')](saveUpdates(_0x39c655[_0xb129('0x4c')],null))[_0xb129('0x2a')](respondWithResult(_0x4a2e06,null))[_0xb129('0x47')](handleError(_0x4a2e06,null));};exports[_0xb129('0x29')]=function(_0x2eddaa,_0x645489){return db[_0xb129('0x31')][_0xb129('0x4b')]({'where':{'id':_0x2eddaa[_0xb129('0x4d')]['id']}})[_0xb129('0x2a')](handleEntityNotFound(_0x645489,null))[_0xb129('0x2a')](removeEntity(_0x645489,null))[_0xb129('0x47')](handleError(_0x645489,null));};exports[_0xb129('0x4e')]=function(_0x3184ae,_0x17c817){return db['VoiceQueueReport'][_0xb129('0x4e')]()[_0xb129('0x2a')](respondWithResult(_0x17c817,null))[_0xb129('0x47')](handleError(_0x17c817,null));};exports[_0xb129('0x4f')]=function(_0x596bc3,_0x20425e){var _0x6cfcd4={},_0x3a1fad={},_0x2204ff={'count':0x0,'rows':[]};_0x3a1fad[_0xb129('0x34')]=_[_0xb129('0x49')](db[_0xb129('0x31')][_0xb129('0x50')]);_0x3a1fad['query']=_[_0xb129('0x49')](_0x596bc3[_0xb129('0x35')]);_0x3a1fad[_0xb129('0x3d')]=_[_0xb129('0x36')](_0x3a1fad['model'],_0x3a1fad['query']);_0x6cfcd4[_0xb129('0x38')]=_[_0xb129('0x36')](_0x3a1fad[_0xb129('0x34')],qs[_0xb129('0x37')](_0x596bc3[_0xb129('0x35')]['fields']));_0x6cfcd4[_0xb129('0x38')]=_0x6cfcd4[_0xb129('0x38')][_0xb129('0x4a')]?_0x6cfcd4[_0xb129('0x38')]:_0x3a1fad[_0xb129('0x34')];if(!_0x596bc3[_0xb129('0x35')][_0xb129('0x51')](_0xb129('0x39'))){_0x6cfcd4['limit']=qs[_0xb129('0x22')](_0x596bc3[_0xb129('0x35')]['limit']);_0x6cfcd4[_0xb129('0x20')]=qs[_0xb129('0x20')](_0x596bc3['query'][_0xb129('0x20')]);}_0x6cfcd4[_0xb129('0x3a')]=qs['sort'](_0x596bc3[_0xb129('0x35')]['sort']);_0x6cfcd4['where']=qs[_0xb129('0x3d')](_[_0xb129('0x3e')](_0x596bc3[_0xb129('0x35')],_0x3a1fad[_0xb129('0x3d')]));if(_0x596bc3[_0xb129('0x35')]['filter']){_0x6cfcd4['where']=_[_0xb129('0x3f')](_0x6cfcd4['where'],{'$or':_[_0xb129('0x30')](_0x6cfcd4[_0xb129('0x38')],function(_0x39536b){var _0x5579c4={};_0x5579c4[_0x39536b]={'$like':'%'+_0x596bc3[_0xb129('0x35')][_0xb129('0x41')]+'%'};return _0x5579c4;})});}_0x6cfcd4=_['merge']({},_0x6cfcd4,_0x596bc3[_0xb129('0x42')]);var _0x66c34e={'where':_0x6cfcd4[_0xb129('0x3c')]};return db['VoiceQueueReport'][_0xb129('0x23')](_0x66c34e)[_0xb129('0x2a')](function(_0x338785){_0x2204ff[_0xb129('0x23')]=_0x338785;if(_0x596bc3[_0xb129('0x35')][_0xb129('0x43')]){_0x6cfcd4[_0xb129('0x44')]=[{'all':!![]}];}return db[_0xb129('0x31')][_0xb129('0x45')](_0x6cfcd4);})[_0xb129('0x2a')](function(_0x2f918d){_0x2204ff[_0xb129('0x46')]=_0x2f918d;return _0x2204ff;})[_0xb129('0x2a')](respondWithFilteredResult(_0x20425e,_0x6cfcd4,_0xb129('0x4f')))['catch'](handleError(_0x20425e,null,_0xb129('0x4f')));}; \ No newline at end of file +var _0xfb09=['status','json','offset','undefined','count','limit','set','Content-Range','save','destroy','then','end','error','stack','name','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceQueueReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','getVoiceQueuesReport','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus'];(function(_0x7f2d6,_0x34a999){var _0x4c1f62=function(_0xa9f8f7){while(--_0xa9f8f7){_0x7f2d6['push'](_0x7f2d6['shift']());}};_0x4c1f62(++_0x34a999);}(_0xfb09,0x81));var _0x9fb0=function(_0x392d4a,_0x19f3e1){_0x392d4a=_0x392d4a-0x0;var _0x3774ab=_0xfb09[_0x392d4a];return _0x3774ab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fb0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fb0('0x1'));var rp=require(_0x9fb0('0x2'));var moment=require(_0x9fb0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9fb0('0x4'));var util=require('util');var path=require(_0x9fb0('0x5'));var sox=require(_0x9fb0('0x6'));var csv=require(_0x9fb0('0x7'));var ejs=require(_0x9fb0('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9fb0('0x9'));var squel=require(_0x9fb0('0xa'));var crypto=require(_0x9fb0('0xb'));var jsforce=require(_0x9fb0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9fb0('0x7'));var querystring=require(_0x9fb0('0xd'));var Papa=require(_0x9fb0('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9fb0('0xf'));var hardwareService=require(_0x9fb0('0x10'));var logger=require(_0x9fb0('0x11'))('api');var utils=require(_0x9fb0('0x12'));var config=require(_0x9fb0('0x13'));var licenseUtil=require(_0x9fb0('0x14'));var db=require(_0x9fb0('0x15'))['db'];config[_0x9fb0('0x16')]=_[_0x9fb0('0x17')](config[_0x9fb0('0x16')],{'host':_0x9fb0('0x18'),'port':0x18eb});var socket=require(_0x9fb0('0x19'))(new Redis(config['redis']));require(_0x9fb0('0x1a'))[_0x9fb0('0x1b')](socket);function respondWithStatusCode(_0x5842d4,_0x95d27d){_0x95d27d=_0x95d27d||0xcc;return function(_0x530e2d){if(_0x530e2d){return _0x5842d4[_0x9fb0('0x1c')](_0x95d27d);}return _0x5842d4[_0x9fb0('0x1d')](_0x95d27d)['end']();};}function respondWithResult(_0x303f7e,_0x5a577b){_0x5a577b=_0x5a577b||0xc8;return function(_0xffa1d9){if(_0xffa1d9){return _0x303f7e[_0x9fb0('0x1d')](_0x5a577b)[_0x9fb0('0x1e')](_0xffa1d9);}};}function respondWithFilteredResult(_0x9331f8,_0x24711f){return function(_0xfa3396){if(_0xfa3396){var _0x1f8a7f=typeof _0x24711f[_0x9fb0('0x1f')]==='undefined'&&typeof _0x24711f['limit']===_0x9fb0('0x20');var _0x23fd11=_0xfa3396[_0x9fb0('0x21')];var _0x267bfd=_0x1f8a7f?0x0:_0x24711f['offset'];var _0x445d9c=_0x1f8a7f?_0xfa3396['count']:_0x24711f[_0x9fb0('0x1f')]+_0x24711f[_0x9fb0('0x22')];var _0x1709bd;if(_0x445d9c>=_0x23fd11){_0x445d9c=_0x23fd11;_0x1709bd=0xc8;}else{_0x1709bd=0xce;}_0x9331f8['status'](_0x1709bd);return _0x9331f8[_0x9fb0('0x23')](_0x9fb0('0x24'),_0x267bfd+'-'+_0x445d9c+'/'+_0x23fd11)[_0x9fb0('0x1e')](_0xfa3396);}return null;};}function patchUpdates(_0x238ef7){return function(_0x521b56){try{jsonpatch['apply'](_0x521b56,_0x238ef7,!![]);}catch(_0x321f76){return BPromise['reject'](_0x321f76);}return _0x521b56[_0x9fb0('0x25')]();};}function saveUpdates(_0xec4d41,_0x184e01){return function(_0xdf6804){if(_0xdf6804){return _0xdf6804['update'](_0xec4d41)['then'](function(_0x4d6084){return _0x4d6084;});}return null;};}function removeEntity(_0xb3e161,_0x2c32b1){return function(_0x8da79e){if(_0x8da79e){return _0x8da79e[_0x9fb0('0x26')]()[_0x9fb0('0x27')](function(){_0xb3e161[_0x9fb0('0x1d')](0xcc)[_0x9fb0('0x28')]();});}};}function handleEntityNotFound(_0x374ce6,_0x1c5629){return function(_0x2acdab){if(!_0x2acdab){_0x374ce6[_0x9fb0('0x1c')](0x194);}return _0x2acdab;};}function handleError(_0x2d607b,_0x3d3229){_0x3d3229=_0x3d3229||0x1f4;return function(_0x1bf773){logger[_0x9fb0('0x29')](_0x1bf773[_0x9fb0('0x2a')]);if(_0x1bf773[_0x9fb0('0x2b')]){delete _0x1bf773['name'];}_0x2d607b['status'](_0x3d3229)['send'](_0x1bf773);};}exports['index']=function(_0x57fc4d,_0x456f40){var _0x4b6505={},_0x3d40a6={},_0x50f786={'count':0x0,'rows':[]};var _0xd2be90=_[_0x9fb0('0x2c')](db['VoiceQueueReport'][_0x9fb0('0x2d')],function(_0x5a80e3){return{'name':_0x5a80e3['fieldName'],'type':_0x5a80e3[_0x9fb0('0x2e')][_0x9fb0('0x2f')]};});_0x3d40a6[_0x9fb0('0x30')]=_['map'](_0xd2be90,_0x9fb0('0x2b'));_0x3d40a6['query']=_[_0x9fb0('0x31')](_0x57fc4d[_0x9fb0('0x32')]);_0x3d40a6[_0x9fb0('0x33')]=_[_0x9fb0('0x34')](_0x3d40a6[_0x9fb0('0x30')],_0x3d40a6[_0x9fb0('0x32')]);_0x4b6505[_0x9fb0('0x35')]=_[_0x9fb0('0x34')](_0x3d40a6['model'],qs['fields'](_0x57fc4d['query'][_0x9fb0('0x36')]));_0x4b6505[_0x9fb0('0x35')]=_0x4b6505['attributes'][_0x9fb0('0x37')]?_0x4b6505['attributes']:_0x3d40a6[_0x9fb0('0x30')];if(!_0x57fc4d[_0x9fb0('0x32')][_0x9fb0('0x38')](_0x9fb0('0x39'))){_0x4b6505[_0x9fb0('0x22')]=qs[_0x9fb0('0x22')](_0x57fc4d['query']['limit']);_0x4b6505[_0x9fb0('0x1f')]=qs[_0x9fb0('0x1f')](_0x57fc4d[_0x9fb0('0x32')][_0x9fb0('0x1f')]);}_0x4b6505[_0x9fb0('0x3a')]=qs[_0x9fb0('0x3b')](_0x57fc4d[_0x9fb0('0x32')][_0x9fb0('0x3b')]);_0x4b6505[_0x9fb0('0x3c')]=qs[_0x9fb0('0x33')](_[_0x9fb0('0x3d')](_0x57fc4d['query'],_0x3d40a6[_0x9fb0('0x33')]),_0xd2be90);if(_0x57fc4d[_0x9fb0('0x32')][_0x9fb0('0x3e')]){_0x4b6505[_0x9fb0('0x3c')]=_[_0x9fb0('0x3f')](_0x4b6505[_0x9fb0('0x3c')],{'$or':_[_0x9fb0('0x2c')](_0xd2be90,function(_0x588d44){if(_0x588d44[_0x9fb0('0x2e')]!=='VIRTUAL'){var _0x1fa98c={};_0x1fa98c[_0x588d44[_0x9fb0('0x2b')]]={'$like':'%'+_0x57fc4d[_0x9fb0('0x32')][_0x9fb0('0x3e')]+'%'};return _0x1fa98c;}})});}_0x4b6505=_['merge']({},_0x4b6505,_0x57fc4d[_0x9fb0('0x40')]);var _0x1b49d4={'where':_0x4b6505[_0x9fb0('0x3c')]};return db[_0x9fb0('0x41')][_0x9fb0('0x21')](_0x1b49d4)[_0x9fb0('0x27')](function(_0x3a74fc){_0x50f786['count']=_0x3a74fc;if(_0x57fc4d[_0x9fb0('0x32')][_0x9fb0('0x42')]){_0x4b6505['include']=[{'all':!![]}];}return db[_0x9fb0('0x41')][_0x9fb0('0x43')](_0x4b6505);})[_0x9fb0('0x27')](function(_0x17b08b){_0x50f786[_0x9fb0('0x44')]=_0x17b08b;return _0x50f786;})[_0x9fb0('0x27')](respondWithFilteredResult(_0x456f40,_0x4b6505))[_0x9fb0('0x45')](handleError(_0x456f40,null));};exports[_0x9fb0('0x46')]=function(_0x202d6b,_0xb384ff){var _0xe2e200={'raw':![],'where':{'id':_0x202d6b[_0x9fb0('0x47')]['id']}},_0x540114={};_0x540114[_0x9fb0('0x30')]=_[_0x9fb0('0x31')](db['VoiceQueueReport']['rawAttributes']);_0x540114[_0x9fb0('0x32')]=_[_0x9fb0('0x31')](_0x202d6b[_0x9fb0('0x32')]);_0x540114[_0x9fb0('0x33')]=_[_0x9fb0('0x34')](_0x540114[_0x9fb0('0x30')],_0x540114['query']);_0xe2e200[_0x9fb0('0x35')]=_[_0x9fb0('0x34')](_0x540114[_0x9fb0('0x30')],qs[_0x9fb0('0x36')](_0x202d6b['query'][_0x9fb0('0x36')]));_0xe2e200[_0x9fb0('0x35')]=_0xe2e200[_0x9fb0('0x35')]['length']?_0xe2e200['attributes']:_0x540114[_0x9fb0('0x30')];if(_0x202d6b[_0x9fb0('0x32')][_0x9fb0('0x42')]){_0xe2e200[_0x9fb0('0x48')]=[{'all':!![]}];}_0xe2e200=_[_0x9fb0('0x3f')]({},_0xe2e200,_0x202d6b[_0x9fb0('0x40')]);return db[_0x9fb0('0x41')][_0x9fb0('0x49')](_0xe2e200)['then'](handleEntityNotFound(_0xb384ff,null))[_0x9fb0('0x27')](respondWithResult(_0xb384ff,null))[_0x9fb0('0x45')](handleError(_0xb384ff,null));};exports[_0x9fb0('0x4a')]=function(_0x28f25b,_0x2ae780){return db['VoiceQueueReport'][_0x9fb0('0x4a')](_0x28f25b[_0x9fb0('0x4b')],{})[_0x9fb0('0x27')](respondWithResult(_0x2ae780,0xc9))[_0x9fb0('0x45')](handleError(_0x2ae780,null));};exports[_0x9fb0('0x4c')]=function(_0x9f706,_0x1735a2){if(_0x9f706[_0x9fb0('0x4b')]['id']){delete _0x9f706[_0x9fb0('0x4b')]['id'];}return db['VoiceQueueReport'][_0x9fb0('0x49')]({'where':{'id':_0x9f706['params']['id']}})[_0x9fb0('0x27')](handleEntityNotFound(_0x1735a2,null))[_0x9fb0('0x27')](saveUpdates(_0x9f706[_0x9fb0('0x4b')],null))['then'](respondWithResult(_0x1735a2,null))[_0x9fb0('0x45')](handleError(_0x1735a2,null));};exports[_0x9fb0('0x26')]=function(_0x3f1ebd,_0x13f067){return db[_0x9fb0('0x41')]['find']({'where':{'id':_0x3f1ebd['params']['id']}})[_0x9fb0('0x27')](handleEntityNotFound(_0x13f067,null))[_0x9fb0('0x27')](removeEntity(_0x13f067,null))[_0x9fb0('0x45')](handleError(_0x13f067,null));};exports[_0x9fb0('0x4d')]=function(_0x1252a5,_0x23bb9b){return db[_0x9fb0('0x41')][_0x9fb0('0x4d')]()[_0x9fb0('0x27')](respondWithResult(_0x23bb9b,null))[_0x9fb0('0x45')](handleError(_0x23bb9b,null));};exports[_0x9fb0('0x4e')]=function(_0xb4704d,_0x1dd5ec){var _0x5660b0={},_0x4351aa={},_0x335429={'count':0x0,'rows':[]};_0x4351aa['model']=_[_0x9fb0('0x31')](db[_0x9fb0('0x41')]['rawAttributes']);_0x4351aa[_0x9fb0('0x32')]=_[_0x9fb0('0x31')](_0xb4704d[_0x9fb0('0x32')]);_0x4351aa['filters']=_['intersection'](_0x4351aa[_0x9fb0('0x30')],_0x4351aa[_0x9fb0('0x32')]);_0x5660b0['attributes']=_[_0x9fb0('0x34')](_0x4351aa[_0x9fb0('0x30')],qs[_0x9fb0('0x36')](_0xb4704d[_0x9fb0('0x32')][_0x9fb0('0x36')]));_0x5660b0[_0x9fb0('0x35')]=_0x5660b0[_0x9fb0('0x35')][_0x9fb0('0x37')]?_0x5660b0['attributes']:_0x4351aa['model'];if(!_0xb4704d[_0x9fb0('0x32')][_0x9fb0('0x38')](_0x9fb0('0x39'))){_0x5660b0[_0x9fb0('0x22')]=qs[_0x9fb0('0x22')](_0xb4704d[_0x9fb0('0x32')][_0x9fb0('0x22')]);_0x5660b0['offset']=qs[_0x9fb0('0x1f')](_0xb4704d[_0x9fb0('0x32')][_0x9fb0('0x1f')]);}_0x5660b0[_0x9fb0('0x3a')]=qs[_0x9fb0('0x3b')](_0xb4704d['query'][_0x9fb0('0x3b')]);_0x5660b0[_0x9fb0('0x3c')]=qs['filters'](_[_0x9fb0('0x3d')](_0xb4704d[_0x9fb0('0x32')],_0x4351aa['filters']));if(_0xb4704d[_0x9fb0('0x32')]['filter']){_0x5660b0[_0x9fb0('0x3c')]=_['merge'](_0x5660b0['where'],{'$or':_[_0x9fb0('0x2c')](_0x5660b0[_0x9fb0('0x35')],function(_0x3e1e77){var _0x25e800={};_0x25e800[_0x3e1e77]={'$like':'%'+_0xb4704d[_0x9fb0('0x32')][_0x9fb0('0x3e')]+'%'};return _0x25e800;})});}_0x5660b0=_['merge']({},_0x5660b0,_0xb4704d[_0x9fb0('0x40')]);var _0x2abc61={'where':_0x5660b0['where']};return db['VoiceQueueReport'][_0x9fb0('0x21')](_0x2abc61)[_0x9fb0('0x27')](function(_0x47c02e){_0x335429['count']=_0x47c02e;if(_0xb4704d[_0x9fb0('0x32')]['includeAll']){_0x5660b0[_0x9fb0('0x48')]=[{'all':!![]}];}return db[_0x9fb0('0x41')][_0x9fb0('0x43')](_0x5660b0);})[_0x9fb0('0x27')](function(_0x425927){_0x335429[_0x9fb0('0x44')]=_0x425927;return _0x335429;})[_0x9fb0('0x27')](respondWithFilteredResult(_0x1dd5ec,_0x5660b0,_0x9fb0('0x4e')))['catch'](handleError(_0x1dd5ec,null,_0x9fb0('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 8fcb3a8..1e6d692 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 _0x6b94=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x53544c,_0xb36295){var _0x12bcc6=function(_0x580582){while(--_0x580582){_0x53544c['push'](_0x53544c['shift']());}};_0x12bcc6(++_0xb36295);}(_0x6b94,0x1e5));var _0x46b9=function(_0x208429,_0x3f8848){_0x208429=_0x208429-0x0;var _0x406352=_0x6b94[_0x208429];return _0x406352;};'use strict';var EventEmitter=require(_0x46b9('0x0'));var VoiceQueueReport=require(_0x46b9('0x1'))['db'][_0x46b9('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x46b9('0x3')](0x0);var events={'afterCreate':_0x46b9('0x4'),'afterUpdate':'update','afterDestroy':_0x46b9('0x5')};function emitEvent(_0x3ab726){return function(_0x1c541f,_0x24312e,_0x183f7c){VoiceQueueReportEvents['emit'](_0x3ab726+':'+_0x1c541f['id'],_0x1c541f);VoiceQueueReportEvents[_0x46b9('0x6')](_0x3ab726,_0x1c541f);_0x183f7c(null);};}for(var e in events){if(events[_0x46b9('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x46b9('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x3202=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x36feb2,_0x53abef){var _0x292b43=function(_0x52a460){while(--_0x52a460){_0x36feb2['push'](_0x36feb2['shift']());}};_0x292b43(++_0x53abef);}(_0x3202,0x1b8));var _0x2320=function(_0x3becdf,_0x7482c7){_0x3becdf=_0x3becdf-0x0;var _0x2a52df=_0x3202[_0x3becdf];return _0x2a52df;};'use strict';var EventEmitter=require(_0x2320('0x0'));var VoiceQueueReport=require(_0x2320('0x1'))['db'][_0x2320('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2320('0x3')](0x0);var events={'afterCreate':_0x2320('0x4'),'afterUpdate':_0x2320('0x5'),'afterDestroy':_0x2320('0x6')};function emitEvent(_0x2f6fc6){return function(_0x2e7d79,_0x25836e,_0x183228){VoiceQueueReportEvents['emit'](_0x2f6fc6+':'+_0x2e7d79['id'],_0x2e7d79);VoiceQueueReportEvents[_0x2320('0x7')](_0x2f6fc6,_0x2e7d79);_0x183228(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index fa47c81..d42e32f 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 _0x3d98=['./voiceQueueReport.attributes','exports','define','report_queue','calleridnum','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4e8acf,_0x360b15){var _0x5e5a48=function(_0x177174){while(--_0x177174){_0x4e8acf['push'](_0x4e8acf['shift']());}};_0x5e5a48(++_0x360b15);}(_0x3d98,0x1cc));var _0x83d9=function(_0xb532e7,_0x4e98c8){_0xb532e7=_0xb532e7-0x0;var _0x4ff8a6=_0x3d98[_0xb532e7];return _0x4ff8a6;};'use strict';var _=require(_0x83d9('0x0'));var util=require(_0x83d9('0x1'));var logger=require(_0x83d9('0x2'))('api');var moment=require(_0x83d9('0x3'));var BPromise=require(_0x83d9('0x4'));var rp=require(_0x83d9('0x5'));var fs=require('fs');var path=require(_0x83d9('0x6'));var rimraf=require('rimraf');var config=require(_0x83d9('0x7'));var attributes=require(_0x83d9('0x8'));module[_0x83d9('0x9')]=function(_0x4e74cb,_0x407e2d){return _0x4e74cb[_0x83d9('0xa')]('VoiceQueueReport',attributes,{'tableName':_0x83d9('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x83d9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c43=['report_queue','lodash','util','api','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','exports','define','VoiceQueueReport'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x0c43,0x199));var _0x30c4=function(_0x155c97,_0x112419){_0x155c97=_0x155c97-0x0;var _0x4fca83=_0x0c43[_0x155c97];return _0x4fca83;};'use strict';var _=require(_0x30c4('0x0'));var util=require(_0x30c4('0x1'));var logger=require('../../config/logger')(_0x30c4('0x2'));var moment=require(_0x30c4('0x3'));var BPromise=require(_0x30c4('0x4'));var rp=require(_0x30c4('0x5'));var fs=require('fs');var path=require(_0x30c4('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x30c4('0x7'));module[_0x30c4('0x8')]=function(_0x24cb32,_0x2d8e37){return _0x24cb32[_0x30c4('0x9')](_0x30c4('0xa'),attributes,{'tableName':_0x30c4('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'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 0efde4b..07f33b5 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 _0x6000=['then','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','attributes','map','include','model'];(function(_0x229cd2,_0x1ed556){var _0x3804b7=function(_0x3dadff){while(--_0x3dadff){_0x229cd2['push'](_0x229cd2['shift']());}};_0x3804b7(++_0x1ed556);}(_0x6000,0x1b6));var _0x0600=function(_0x270a15,_0x65933d){_0x270a15=_0x270a15-0x0;var _0x280e81=_0x6000[_0x270a15];return _0x280e81;};'use strict';var _=require(_0x0600('0x0'));var util=require('util');var moment=require(_0x0600('0x1'));var BPromise=require(_0x0600('0x2'));var rs=require(_0x0600('0x3'));var fs=require('fs');var Redis=require(_0x0600('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0600('0x5'));var logger=require(_0x0600('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0600('0x7'));var client=jayson[_0x0600('0x8')][_0x0600('0x9')]({'port':0x232a});config[_0x0600('0xa')]=_[_0x0600('0xb')](config[_0x0600('0xa')],{'host':_0x0600('0xc'),'port':0x18eb});var socket=require(_0x0600('0xd'))(new Redis(config[_0x0600('0xa')]));require('./voiceQueueReport.socket')[_0x0600('0xe')](socket);function respondWithRpcPromise(_0x559743,_0x5869f2,_0x2c584f){return new BPromise(function(_0x3f3fa6,_0x26d769){return client[_0x0600('0xf')](_0x559743,_0x2c584f)['then'](function(_0x2594ae){logger['info'](_0x0600('0x10'),_0x5869f2,'request\x20sent');logger[_0x0600('0x11')](_0x0600('0x12'),_0x5869f2,'request\x20sent',JSON['stringify'](_0x2594ae));if(_0x2594ae['error']){if(_0x2594ae[_0x0600('0x13')][_0x0600('0x14')]===0x1f4){logger[_0x0600('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x5869f2,_0x2594ae[_0x0600('0x13')][_0x0600('0x15')]);return _0x26d769(_0x2594ae[_0x0600('0x13')][_0x0600('0x15')]);}logger[_0x0600('0x13')](_0x0600('0x10'),_0x5869f2,_0x2594ae[_0x0600('0x13')][_0x0600('0x15')]);return _0x3f3fa6(_0x2594ae[_0x0600('0x13')]['message']);}else{logger[_0x0600('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x5869f2,'request\x20sent');_0x3f3fa6(_0x2594ae[_0x0600('0x17')][_0x0600('0x15')]);}})[_0x0600('0x18')](function(_0x2dcad1){logger[_0x0600('0x13')](_0x0600('0x10'),_0x5869f2,_0x2dcad1);_0x26d769(_0x2dcad1);});});}exports[_0x0600('0x19')]=function(_0x460bad){var _0x222642=this;return new Promise(function(_0x58e24,_0x224676){return db[_0x0600('0x1a')][_0x0600('0x1b')]({'raw':_0x460bad['options']?_0x460bad['options'][_0x0600('0x1c')]===undefined?!![]:![]:!![],'where':_0x460bad[_0x0600('0x1d')]?_0x460bad['options'][_0x0600('0x1e')]||null:null,'attributes':_0x460bad['options']?_0x460bad[_0x0600('0x1d')][_0x0600('0x1f')]||null:null,'limit':_0x460bad[_0x0600('0x1d')]?_0x460bad['options']['limit']||null:null,'include':_0x460bad[_0x0600('0x1d')]?_0x460bad[_0x0600('0x1d')]['include']?_[_0x0600('0x20')](_0x460bad[_0x0600('0x1d')][_0x0600('0x21')],function(_0x1b719d){return{'model':db[_0x1b719d[_0x0600('0x22')]],'as':_0x1b719d['as'],'attributes':_0x1b719d['attributes'],'include':_0x1b719d[_0x0600('0x21')]?_['map'](_0x1b719d[_0x0600('0x21')],function(_0x59bfb1){return{'model':db[_0x59bfb1[_0x0600('0x22')]],'as':_0x59bfb1['as'],'attributes':_0x59bfb1['attributes'],'include':_0x59bfb1[_0x0600('0x21')]?_[_0x0600('0x20')](_0x59bfb1[_0x0600('0x21')],function(_0x2c25c2){return{'model':db[_0x2c25c2[_0x0600('0x22')]],'as':_0x2c25c2['as'],'attributes':_0x2c25c2[_0x0600('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0600('0x23')](function(_0x2833ac){logger[_0x0600('0x16')](_0x0600('0x19'),_0x460bad);logger['debug'](_0x0600('0x19'),_0x460bad,JSON[_0x0600('0x24')](_0x2833ac));_0x58e24(_0x2833ac);})[_0x0600('0x18')](function(_0x2adced){logger[_0x0600('0x13')](_0x0600('0x19'),_0x2adced[_0x0600('0x15')],_0x460bad);_0x224676(_0x222642[_0x0600('0x13')](0x1f4,_0x2adced[_0x0600('0x15')]));});});};exports[_0x0600('0x25')]=function(_0x1b44a3){var _0x58b80e=this;return new Promise(function(_0x15d2bb,_0x555c3b){return db[_0x0600('0x1a')][_0x0600('0x26')](_0x1b44a3[_0x0600('0x27')],{'raw':_0x1b44a3[_0x0600('0x1d')]?_0x1b44a3[_0x0600('0x1d')][_0x0600('0x1c')]===undefined?!![]:![]:!![]})[_0x0600('0x23')](function(_0xce5d9f){logger['info']('CreateVoiceQueueReport',_0x1b44a3);logger[_0x0600('0x11')]('CreateVoiceQueueReport',_0x1b44a3,JSON[_0x0600('0x24')](_0xce5d9f));_0x15d2bb(_0xce5d9f);})[_0x0600('0x18')](function(_0x13600c){logger['error'](_0x0600('0x25'),_0x13600c[_0x0600('0x15')],_0x1b44a3);_0x555c3b(_0x58b80e[_0x0600('0x13')](0x1f4,_0x13600c['message']));});});};exports[_0x0600('0x28')]=function(_0xbc9d7f){var _0x2cff71=this;return new Promise(function(_0x55f7f8,_0x2c72a7){return db[_0x0600('0x1a')][_0x0600('0x29')](_0xbc9d7f['body'],{'raw':_0xbc9d7f[_0x0600('0x1d')]?_0xbc9d7f[_0x0600('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbc9d7f[_0x0600('0x1d')]?_0xbc9d7f[_0x0600('0x1d')][_0x0600('0x1e')]||null:null,'attributes':_0xbc9d7f[_0x0600('0x1d')]?_0xbc9d7f[_0x0600('0x1d')][_0x0600('0x1f')]||null:null,'limit':_0xbc9d7f[_0x0600('0x1d')]?_0xbc9d7f[_0x0600('0x1d')][_0x0600('0x2a')]||null:null})[_0x0600('0x23')](function(_0x3060ff){logger['info'](_0x0600('0x28'),_0xbc9d7f);logger['debug']('UpdateVoiceQueueReport',_0xbc9d7f,JSON['stringify'](_0x3060ff));_0x55f7f8(_0x3060ff);})['catch'](function(_0x39d475){logger[_0x0600('0x13')](_0x0600('0x28'),_0x39d475[_0x0600('0x15')],_0xbc9d7f);_0x2c72a7(_0x2cff71[_0x0600('0x13')](0x1f4,_0x39d475['message']));});});}; \ No newline at end of file +var _0x8260=['body','UpdateVoiceQueueReport','update','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueueReport','findAll','options','raw','where','map','include','model','attributes','CreateVoiceQueueReport','VoiceQueueReport','create'];(function(_0x1e6000,_0x48db6f){var _0x1ecef3=function(_0x5e7450){while(--_0x5e7450){_0x1e6000['push'](_0x1e6000['shift']());}};_0x1ecef3(++_0x48db6f);}(_0x8260,0x190));var _0x0826=function(_0x187e24,_0x393e15){_0x187e24=_0x187e24-0x0;var _0x39b658=_0x8260[_0x187e24];return _0x39b658;};'use strict';var _=require(_0x0826('0x0'));var util=require('util');var moment=require(_0x0826('0x1'));var BPromise=require('bluebird');var rs=require(_0x0826('0x2'));var fs=require('fs');var Redis=require(_0x0826('0x3'));var db=require(_0x0826('0x4'))['db'];var utils=require(_0x0826('0x5'));var logger=require(_0x0826('0x6'))('rpc');var config=require(_0x0826('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0826('0x8')][_0x0826('0x9')]({'port':0x232a});config[_0x0826('0xa')]=_[_0x0826('0xb')](config[_0x0826('0xa')],{'host':_0x0826('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0826('0xd'))[_0x0826('0xe')](socket);function respondWithRpcPromise(_0x136d2e,_0x1c7853,_0x29871f){return new BPromise(function(_0x5dd0dd,_0x3d0c0e){return client[_0x0826('0xf')](_0x136d2e,_0x29871f)[_0x0826('0x10')](function(_0x56e06b){logger['info'](_0x0826('0x11'),_0x1c7853,_0x0826('0x12'));logger[_0x0826('0x13')](_0x0826('0x14'),_0x1c7853,_0x0826('0x12'),JSON[_0x0826('0x15')](_0x56e06b));if(_0x56e06b['error']){if(_0x56e06b[_0x0826('0x16')][_0x0826('0x17')]===0x1f4){logger[_0x0826('0x16')](_0x0826('0x11'),_0x1c7853,_0x56e06b[_0x0826('0x16')]['message']);return _0x3d0c0e(_0x56e06b[_0x0826('0x16')][_0x0826('0x18')]);}logger[_0x0826('0x16')](_0x0826('0x11'),_0x1c7853,_0x56e06b[_0x0826('0x16')][_0x0826('0x18')]);return _0x5dd0dd(_0x56e06b['error'][_0x0826('0x18')]);}else{logger[_0x0826('0x19')](_0x0826('0x11'),_0x1c7853,_0x0826('0x12'));_0x5dd0dd(_0x56e06b[_0x0826('0x1a')][_0x0826('0x18')]);}})[_0x0826('0x1b')](function(_0x4c1bd3){logger['error'](_0x0826('0x11'),_0x1c7853,_0x4c1bd3);_0x3d0c0e(_0x4c1bd3);});});}exports[_0x0826('0x1c')]=function(_0x41b611){var _0x414b91=this;return new Promise(function(_0x15226f,_0x2c5711){return db['VoiceQueueReport'][_0x0826('0x1d')]({'raw':_0x41b611[_0x0826('0x1e')]?_0x41b611[_0x0826('0x1e')][_0x0826('0x1f')]===undefined?!![]:![]:!![],'where':_0x41b611[_0x0826('0x1e')]?_0x41b611[_0x0826('0x1e')][_0x0826('0x20')]||null:null,'attributes':_0x41b611['options']?_0x41b611['options']['attributes']||null:null,'limit':_0x41b611[_0x0826('0x1e')]?_0x41b611[_0x0826('0x1e')]['limit']||null:null,'include':_0x41b611[_0x0826('0x1e')]?_0x41b611[_0x0826('0x1e')]['include']?_[_0x0826('0x21')](_0x41b611[_0x0826('0x1e')][_0x0826('0x22')],function(_0x57c94f){return{'model':db[_0x57c94f[_0x0826('0x23')]],'as':_0x57c94f['as'],'attributes':_0x57c94f['attributes'],'include':_0x57c94f[_0x0826('0x22')]?_[_0x0826('0x21')](_0x57c94f[_0x0826('0x22')],function(_0x55fee8){return{'model':db[_0x55fee8[_0x0826('0x23')]],'as':_0x55fee8['as'],'attributes':_0x55fee8['attributes'],'include':_0x55fee8[_0x0826('0x22')]?_['map'](_0x55fee8['include'],function(_0x5cba10){return{'model':db[_0x5cba10[_0x0826('0x23')]],'as':_0x5cba10['as'],'attributes':_0x5cba10[_0x0826('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41c246){logger[_0x0826('0x19')](_0x0826('0x1c'),_0x41b611);logger[_0x0826('0x13')]('GetVoiceQueueReport',_0x41b611,JSON[_0x0826('0x15')](_0x41c246));_0x15226f(_0x41c246);})[_0x0826('0x1b')](function(_0x371493){logger[_0x0826('0x16')]('GetVoiceQueueReport',_0x371493[_0x0826('0x18')],_0x41b611);_0x2c5711(_0x414b91[_0x0826('0x16')](0x1f4,_0x371493['message']));});});};exports[_0x0826('0x25')]=function(_0xabb195){var _0x2e8970=this;return new Promise(function(_0x496243,_0x306803){return db[_0x0826('0x26')][_0x0826('0x27')](_0xabb195[_0x0826('0x28')],{'raw':_0xabb195['options']?_0xabb195['options'][_0x0826('0x1f')]===undefined?!![]:![]:!![]})[_0x0826('0x10')](function(_0x19dc22){logger['info'](_0x0826('0x25'),_0xabb195);logger[_0x0826('0x13')](_0x0826('0x25'),_0xabb195,JSON[_0x0826('0x15')](_0x19dc22));_0x496243(_0x19dc22);})['catch'](function(_0x4df03e){logger[_0x0826('0x16')](_0x0826('0x25'),_0x4df03e[_0x0826('0x18')],_0xabb195);_0x306803(_0x2e8970[_0x0826('0x16')](0x1f4,_0x4df03e[_0x0826('0x18')]));});});};exports[_0x0826('0x29')]=function(_0x228f55){var _0xeed620=this;return new Promise(function(_0x6caf67,_0x32c184){return db[_0x0826('0x26')][_0x0826('0x2a')](_0x228f55['body'],{'raw':_0x228f55[_0x0826('0x1e')]?_0x228f55[_0x0826('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228f55['options']?_0x228f55[_0x0826('0x1e')][_0x0826('0x20')]||null:null,'attributes':_0x228f55[_0x0826('0x1e')]?_0x228f55[_0x0826('0x1e')]['attributes']||null:null,'limit':_0x228f55['options']?_0x228f55[_0x0826('0x1e')][_0x0826('0x2b')]||null:null})[_0x0826('0x10')](function(_0x78e3a7){logger[_0x0826('0x19')](_0x0826('0x29'),_0x228f55);logger[_0x0826('0x13')]('UpdateVoiceQueueReport',_0x228f55,JSON[_0x0826('0x15')](_0x78e3a7));_0x6caf67(_0x78e3a7);})['catch'](function(_0x46e622){logger[_0x0826('0x16')]('UpdateVoiceQueueReport',_0x46e622[_0x0826('0x18')],_0x228f55);_0x32c184(_0xeed620[_0x0826('0x16')](0x1f4,_0x46e622['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index ecfe279..993acd1 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 _0xd90b=['register','length','voiceQueueReport:','./voiceQueueReport.events','update','removeListener'];(function(_0x31cba6,_0xa48959){var _0x2bf1a4=function(_0x5cce09){while(--_0x5cce09){_0x31cba6['push'](_0x31cba6['shift']());}};_0x2bf1a4(++_0xa48959);}(_0xd90b,0xbd));var _0xbd90=function(_0x24a537,_0x3d69dc){_0x24a537=_0x24a537-0x0;var _0x3dfc5b=_0xd90b[_0x24a537];return _0x3dfc5b;};'use strict';var VoiceQueueReportEvents=require(_0xbd90('0x0'));var events=['save','remove',_0xbd90('0x1')];function createListener(_0x5a9a50,_0x5e0407){return function(_0x40bb8c){_0x5e0407['emit'](_0x5a9a50,_0x40bb8c);};}function removeListener(_0x3d994c,_0x1813c7){return function(){VoiceQueueReportEvents[_0xbd90('0x2')](_0x3d994c,_0x1813c7);};}exports[_0xbd90('0x3')]=function(_0x448c24){for(var _0x257fd3=0x0,_0x524ad0=events[_0xbd90('0x4')];_0x257fd3<_0x524ad0;_0x257fd3++){var _0x2f612f=events[_0x257fd3];var _0x35be45=createListener(_0xbd90('0x5')+_0x2f612f,_0x448c24);VoiceQueueReportEvents['on'](_0x2f612f,_0x35be45);}}; \ No newline at end of file +var _0x9576=['save','remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x29006c,_0x31016b){var _0x151ad9=function(_0x32d4e7){while(--_0x32d4e7){_0x29006c['push'](_0x29006c['shift']());}};_0x151ad9(++_0x31016b);}(_0x9576,0x182));var _0x6957=function(_0x35bd53,_0xe6db40){_0x35bd53=_0x35bd53-0x0;var _0x204057=_0x9576[_0x35bd53];return _0x204057;};'use strict';var VoiceQueueReportEvents=require(_0x6957('0x0'));var events=[_0x6957('0x1'),_0x6957('0x2'),_0x6957('0x3')];function createListener(_0x47fd53,_0x4ee0d8){return function(_0xf9d8fc){_0x4ee0d8[_0x6957('0x4')](_0x47fd53,_0xf9d8fc);};}function removeListener(_0x9e834,_0x10ed80){return function(){VoiceQueueReportEvents[_0x6957('0x5')](_0x9e834,_0x10ed80);};}exports[_0x6957('0x6')]=function(_0x2eb79e){for(var _0x49e08a=0x0,_0x6d8af8=events[_0x6957('0x7')];_0x49e08a<_0x6d8af8;_0x49e08a++){var _0x70b8c4=events[_0x49e08a];var _0x2e5727=createListener(_0x6957('0x8')+_0x70b8c4,_0x2eb79e);VoiceQueueReportEvents['on'](_0x70b8c4,_0x2e5727);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index de42075..1e366fd 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 _0x7d70=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','/:id'];(function(_0x280e8e,_0x39f681){var _0x2d5c1f=function(_0x184fc4){while(--_0x184fc4){_0x280e8e['push'](_0x280e8e['shift']());}};_0x2d5c1f(++_0x39f681);}(_0x7d70,0x12e));var _0x07d7=function(_0x1e903c,_0x11b69c){_0x1e903c=_0x1e903c-0x0;var _0x1c0230=_0x7d70[_0x1e903c];return _0x1c0230;};'use strict';var multer=require(_0x07d7('0x0'));var util=require(_0x07d7('0x1'));var path=require(_0x07d7('0x2'));var timeout=require(_0x07d7('0x3'));var express=require(_0x07d7('0x4'));var router=express['Router']();var fs_extra=require(_0x07d7('0x5'));var auth=require(_0x07d7('0x6'));var interaction=require(_0x07d7('0x7'));var config=require(_0x07d7('0x8'));var controller=require(_0x07d7('0x9'));router[_0x07d7('0xa')]('/',auth[_0x07d7('0xb')](),controller['index']);router[_0x07d7('0xa')](_0x07d7('0xc'),auth[_0x07d7('0xb')](),controller[_0x07d7('0xd')]);router[_0x07d7('0xe')]('/',auth[_0x07d7('0xb')](),controller[_0x07d7('0xf')]);router[_0x07d7('0x10')]('/:id',auth[_0x07d7('0xb')](),controller[_0x07d7('0x11')]);router[_0x07d7('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x07d7('0x13')]);module[_0x07d7('0x14')]=router; \ No newline at end of file +var _0x01e7=['multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','put','delete','destroy'];(function(_0x5381e9,_0x47f0b0){var _0x4403c6=function(_0x4a7dc8){while(--_0x4a7dc8){_0x5381e9['push'](_0x5381e9['shift']());}};_0x4403c6(++_0x47f0b0);}(_0x01e7,0x134));var _0x701e=function(_0x3d1f0a,_0x228622){_0x3d1f0a=_0x3d1f0a-0x0;var _0x50d587=_0x01e7[_0x3d1f0a];return _0x50d587;};'use strict';var multer=require(_0x701e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x701e('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x701e('0x2'));var auth=require(_0x701e('0x3'));var interaction=require(_0x701e('0x4'));var config=require('../../config/environment');var controller=require(_0x701e('0x5'));router[_0x701e('0x6')]('/',auth[_0x701e('0x7')](),controller[_0x701e('0x8')]);router['get'](_0x701e('0x9'),auth[_0x701e('0x7')](),controller['show']);router[_0x701e('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x701e('0xb')]('/:id',auth[_0x701e('0x7')](),controller['update']);router[_0x701e('0xc')](_0x701e('0x9'),auth['isAuthenticated'](),controller[_0x701e('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 5de6d8d..cc7d9d4 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 _0x9010=['sequelize','moment','STRING','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x3416d9,_0x6a56f9){var _0x589ad9=function(_0x451180){while(--_0x451180){_0x3416d9['push'](_0x3416d9['shift']());}};_0x589ad9(++_0x6a56f9);}(_0x9010,0x98));var _0x0901=function(_0x52903e,_0x360bfb){_0x52903e=_0x52903e-0x0;var _0x1a86e6=_0x9010[_0x52903e];return _0x1a86e6;};'use strict';var Sequelize=require(_0x0901('0x0'));var moment=require(_0x0901('0x1'));module['exports']={'time':{'type':Sequelize[_0x0901('0x2')]},'callid':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x0901('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['literal'](_0x0901('0x3'))}}; \ No newline at end of file +var _0xaa56=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','STRING','literal'];(function(_0x586986,_0xa68308){var _0x43e149=function(_0x53507a){while(--_0x53507a){_0x586986['push'](_0x586986['shift']());}};_0x43e149(++_0xa68308);}(_0xaa56,0x135));var _0x6aa5=function(_0x515830,_0x41fc93){_0x515830=_0x515830-0x0;var _0x54381c=_0xaa56[_0x515830];return _0x54381c;};'use strict';var Sequelize=require(_0x6aa5('0x0'));var moment=require('moment');module['exports']={'time':{'type':Sequelize[_0x6aa5('0x1')]},'callid':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x6aa5('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x6aa5('0x2')](_0x6aa5('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 2199ed6..1471f72 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 _0x4b50=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','name','index','VoiceQueuesLog','fieldName','type','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','findAll','catch','params','rawAttributes','fields','include','options','find','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x10b465,_0x2cccb8){var _0x550ddc=function(_0x192664){while(--_0x192664){_0x10b465['push'](_0x10b465['shift']());}};_0x550ddc(++_0x2cccb8);}(_0x4b50,0x1ea));var _0x04b5=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x4b50[_0x8a969d];return _0x1d8dc7;};'use strict';var emlformat=require(_0x04b5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04b5('0x1'));var jsonpatch=require(_0x04b5('0x2'));var rp=require(_0x04b5('0x3'));var moment=require('moment');var BPromise=require(_0x04b5('0x4'));var Mustache=require(_0x04b5('0x5'));var util=require('util');var path=require(_0x04b5('0x6'));var sox=require(_0x04b5('0x7'));var csv=require('to-csv');var ejs=require(_0x04b5('0x8'));var fs=require('fs');var fs_extra=require(_0x04b5('0x9'));var _=require(_0x04b5('0xa'));var squel=require('squel');var crypto=require(_0x04b5('0xb'));var jsforce=require(_0x04b5('0xc'));var deskjs=require(_0x04b5('0xd'));var toCsv=require(_0x04b5('0xe'));var querystring=require(_0x04b5('0xf'));var Papa=require(_0x04b5('0x10'));var Redis=require(_0x04b5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x04b5('0x12'));var as=require(_0x04b5('0x13'));var hardwareService=require(_0x04b5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x04b5('0x15'));var config=require(_0x04b5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x04b5('0x17'))['db'];function respondWithStatusCode(_0xf2abda,_0x5d6c77){_0x5d6c77=_0x5d6c77||0xcc;return function(_0x24def2){if(_0x24def2){return _0xf2abda[_0x04b5('0x18')](_0x5d6c77);}return _0xf2abda['status'](_0x5d6c77)[_0x04b5('0x19')]();};}function respondWithResult(_0xa8253a,_0x39708e){_0x39708e=_0x39708e||0xc8;return function(_0x3245d8){if(_0x3245d8){return _0xa8253a[_0x04b5('0x1a')](_0x39708e)[_0x04b5('0x1b')](_0x3245d8);}};}function respondWithFilteredResult(_0x3d5596,_0x338bd5){return function(_0x5dafcd){if(_0x5dafcd){var _0x16f280=typeof _0x338bd5[_0x04b5('0x1c')]===_0x04b5('0x1d')&&typeof _0x338bd5['limit']===_0x04b5('0x1d');var _0x5e2748=_0x5dafcd[_0x04b5('0x1e')];var _0x1dabb7=_0x16f280?0x0:_0x338bd5['offset'];var _0x2095f9=_0x16f280?_0x5dafcd[_0x04b5('0x1e')]:_0x338bd5[_0x04b5('0x1c')]+_0x338bd5[_0x04b5('0x1f')];var _0x315ced;if(_0x2095f9>=_0x5e2748){_0x2095f9=_0x5e2748;_0x315ced=0xc8;}else{_0x315ced=0xce;}_0x3d5596[_0x04b5('0x1a')](_0x315ced);return _0x3d5596[_0x04b5('0x20')](_0x04b5('0x21'),_0x1dabb7+'-'+_0x2095f9+'/'+_0x5e2748)['json'](_0x5dafcd);}return null;};}function patchUpdates(_0x4e0c9a){return function(_0x5ce3c3){try{jsonpatch[_0x04b5('0x22')](_0x5ce3c3,_0x4e0c9a,!![]);}catch(_0x119b29){return BPromise[_0x04b5('0x23')](_0x119b29);}return _0x5ce3c3[_0x04b5('0x24')]();};}function saveUpdates(_0x151f56,_0x19f26f){return function(_0x1d10d5){if(_0x1d10d5){return _0x1d10d5['update'](_0x151f56)[_0x04b5('0x25')](function(_0x3f7c23){return _0x3f7c23;});}return null;};}function removeEntity(_0x2fd002,_0x4600c8){return function(_0x44a421){if(_0x44a421){return _0x44a421[_0x04b5('0x26')]()[_0x04b5('0x25')](function(){_0x2fd002[_0x04b5('0x1a')](0xcc)[_0x04b5('0x19')]();});}};}function handleEntityNotFound(_0x408b44,_0x43f17d){return function(_0x1c21ac){if(!_0x1c21ac){_0x408b44[_0x04b5('0x18')](0x194);}return _0x1c21ac;};}function handleError(_0x2399e3,_0x3f812d){_0x3f812d=_0x3f812d||0x1f4;return function(_0x2438dc){logger['error'](_0x2438dc['stack']);if(_0x2438dc[_0x04b5('0x27')]){delete _0x2438dc[_0x04b5('0x27')];}_0x2399e3[_0x04b5('0x1a')](_0x3f812d)['send'](_0x2438dc);};}exports[_0x04b5('0x28')]=function(_0x576944,_0x415025){var _0x401a42={},_0x49cc5a={},_0x38db71={'count':0x0,'rows':[]};var _0x188df6=_['map'](db[_0x04b5('0x29')]['rawAttributes'],function(_0x50f1af){return{'name':_0x50f1af[_0x04b5('0x2a')],'type':_0x50f1af[_0x04b5('0x2b')]['key']};});_0x49cc5a[_0x04b5('0x2c')]=_[_0x04b5('0x2d')](_0x188df6,_0x04b5('0x27'));_0x49cc5a[_0x04b5('0x2e')]=_[_0x04b5('0x2f')](_0x576944[_0x04b5('0x2e')]);_0x49cc5a['filters']=_[_0x04b5('0x30')](_0x49cc5a['model'],_0x49cc5a['query']);_0x401a42[_0x04b5('0x31')]=_[_0x04b5('0x30')](_0x49cc5a['model'],qs['fields'](_0x576944['query']['fields']));_0x401a42[_0x04b5('0x31')]=_0x401a42[_0x04b5('0x31')][_0x04b5('0x32')]?_0x401a42['attributes']:_0x49cc5a[_0x04b5('0x2c')];if(!_0x576944[_0x04b5('0x2e')][_0x04b5('0x33')](_0x04b5('0x34'))){_0x401a42[_0x04b5('0x1f')]=qs[_0x04b5('0x1f')](_0x576944['query'][_0x04b5('0x1f')]);_0x401a42[_0x04b5('0x1c')]=qs[_0x04b5('0x1c')](_0x576944[_0x04b5('0x2e')][_0x04b5('0x1c')]);}_0x401a42[_0x04b5('0x35')]=qs['sort'](_0x576944['query'][_0x04b5('0x36')]);_0x401a42[_0x04b5('0x37')]=qs['filters'](_['pick'](_0x576944[_0x04b5('0x2e')],_0x49cc5a[_0x04b5('0x38')]),_0x188df6);if(_0x576944[_0x04b5('0x2e')]['filter']){_0x401a42[_0x04b5('0x37')]=_[_0x04b5('0x39')](_0x401a42[_0x04b5('0x37')],{'$or':_[_0x04b5('0x2d')](_0x188df6,function(_0x54b20e){if(_0x54b20e[_0x04b5('0x2b')]!==_0x04b5('0x3a')){var _0x2bcadb={};_0x2bcadb[_0x54b20e[_0x04b5('0x27')]]={'$like':'%'+_0x576944[_0x04b5('0x2e')][_0x04b5('0x3b')]+'%'};return _0x2bcadb;}})});}_0x401a42=_[_0x04b5('0x39')]({},_0x401a42,_0x576944['options']);var _0x3fb17f={'where':_0x401a42[_0x04b5('0x37')]};return db[_0x04b5('0x29')][_0x04b5('0x1e')](_0x3fb17f)['then'](function(_0x2c8e40){_0x38db71[_0x04b5('0x1e')]=_0x2c8e40;if(_0x576944[_0x04b5('0x2e')][_0x04b5('0x3c')]){_0x401a42['include']=[{'all':!![]}];}return db[_0x04b5('0x29')][_0x04b5('0x3d')](_0x401a42);})[_0x04b5('0x25')](function(_0x4b0ea2){_0x38db71['rows']=_0x4b0ea2;return _0x38db71;})[_0x04b5('0x25')](respondWithFilteredResult(_0x415025,_0x401a42))[_0x04b5('0x3e')](handleError(_0x415025,null));};exports['show']=function(_0x3f36ee,_0x58ce15){var _0x3ad4a2={'raw':!![],'where':{'id':_0x3f36ee[_0x04b5('0x3f')]['id']}},_0x409897={};_0x409897[_0x04b5('0x2c')]=_[_0x04b5('0x2f')](db[_0x04b5('0x29')][_0x04b5('0x40')]);_0x409897[_0x04b5('0x2e')]=_[_0x04b5('0x2f')](_0x3f36ee[_0x04b5('0x2e')]);_0x409897[_0x04b5('0x38')]=_[_0x04b5('0x30')](_0x409897[_0x04b5('0x2c')],_0x409897[_0x04b5('0x2e')]);_0x3ad4a2[_0x04b5('0x31')]=_[_0x04b5('0x30')](_0x409897[_0x04b5('0x2c')],qs[_0x04b5('0x41')](_0x3f36ee[_0x04b5('0x2e')][_0x04b5('0x41')]));_0x3ad4a2[_0x04b5('0x31')]=_0x3ad4a2[_0x04b5('0x31')][_0x04b5('0x32')]?_0x3ad4a2[_0x04b5('0x31')]:_0x409897[_0x04b5('0x2c')];if(_0x3f36ee[_0x04b5('0x2e')][_0x04b5('0x3c')]){_0x3ad4a2[_0x04b5('0x42')]=[{'all':!![]}];}_0x3ad4a2=_[_0x04b5('0x39')]({},_0x3ad4a2,_0x3f36ee[_0x04b5('0x43')]);return db[_0x04b5('0x29')][_0x04b5('0x44')](_0x3ad4a2)[_0x04b5('0x25')](handleEntityNotFound(_0x58ce15,null))['then'](respondWithResult(_0x58ce15,null))[_0x04b5('0x3e')](handleError(_0x58ce15,null));};exports[_0x04b5('0x45')]=function(_0x422cd3,_0x2f4df3){return db[_0x04b5('0x29')][_0x04b5('0x45')](_0x422cd3['body'],{})[_0x04b5('0x25')](respondWithResult(_0x2f4df3,0xc9))[_0x04b5('0x3e')](handleError(_0x2f4df3,null));};exports[_0x04b5('0x46')]=function(_0x50e24d,_0x2385cb){if(_0x50e24d['body']['id']){delete _0x50e24d[_0x04b5('0x47')]['id'];}return db[_0x04b5('0x29')][_0x04b5('0x44')]({'where':{'id':_0x50e24d[_0x04b5('0x3f')]['id']}})[_0x04b5('0x25')](handleEntityNotFound(_0x2385cb,null))[_0x04b5('0x25')](saveUpdates(_0x50e24d[_0x04b5('0x47')],null))[_0x04b5('0x25')](respondWithResult(_0x2385cb,null))[_0x04b5('0x3e')](handleError(_0x2385cb,null));};exports['destroy']=function(_0x45dedc,_0x9170fc){return db[_0x04b5('0x29')][_0x04b5('0x44')]({'where':{'id':_0x45dedc[_0x04b5('0x3f')]['id']}})[_0x04b5('0x25')](handleEntityNotFound(_0x9170fc,null))[_0x04b5('0x25')](removeEntity(_0x9170fc,null))['catch'](handleError(_0x9170fc,null));}; \ No newline at end of file +var _0x9de3=['set','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','index','rawAttributes','fieldName','type','model','map','name','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','includeAll','include','rows','catch','keys','find','create','body','params','eml-format','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/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','undefined','limit','count','offset'];(function(_0x358be7,_0x37bdc0){var _0x5e0ecb=function(_0x278825){while(--_0x278825){_0x358be7['push'](_0x358be7['shift']());}};_0x5e0ecb(++_0x37bdc0);}(_0x9de3,0x72));var _0x39de=function(_0x33df82,_0x314322){_0x33df82=_0x33df82-0x0;var _0x2b9c5f=_0x9de3[_0x33df82];return _0x2b9c5f;};'use strict';var emlformat=require(_0x39de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x39de('0x1'));var jsonpatch=require(_0x39de('0x2'));var rp=require(_0x39de('0x3'));var moment=require(_0x39de('0x4'));var BPromise=require(_0x39de('0x5'));var Mustache=require(_0x39de('0x6'));var util=require(_0x39de('0x7'));var path=require(_0x39de('0x8'));var sox=require(_0x39de('0x9'));var csv=require('to-csv');var ejs=require(_0x39de('0xa'));var fs=require('fs');var fs_extra=require(_0x39de('0xb'));var _=require(_0x39de('0xc'));var squel=require(_0x39de('0xd'));var crypto=require(_0x39de('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x39de('0xf'));var querystring=require(_0x39de('0x10'));var Papa=require(_0x39de('0x11'));var Redis=require('ioredis');var authService=require(_0x39de('0x12'));var qs=require(_0x39de('0x13'));var as=require(_0x39de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x39de('0x15'))(_0x39de('0x16'));var utils=require(_0x39de('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x39de('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b37aa,_0x1e207f){_0x1e207f=_0x1e207f||0xcc;return function(_0x56aaec){if(_0x56aaec){return _0x4b37aa['sendStatus'](_0x1e207f);}return _0x4b37aa[_0x39de('0x19')](_0x1e207f)[_0x39de('0x1a')]();};}function respondWithResult(_0x1e3ee3,_0x74ab1b){_0x74ab1b=_0x74ab1b||0xc8;return function(_0x3a59ec){if(_0x3a59ec){return _0x1e3ee3[_0x39de('0x19')](_0x74ab1b)[_0x39de('0x1b')](_0x3a59ec);}};}function respondWithFilteredResult(_0x30d19e,_0x468c53){return function(_0x32cd16){if(_0x32cd16){var _0x18c3d7=typeof _0x468c53['offset']===_0x39de('0x1c')&&typeof _0x468c53[_0x39de('0x1d')]===_0x39de('0x1c');var _0xeae810=_0x32cd16[_0x39de('0x1e')];var _0x22a1ef=_0x18c3d7?0x0:_0x468c53[_0x39de('0x1f')];var _0xbafa8d=_0x18c3d7?_0x32cd16[_0x39de('0x1e')]:_0x468c53[_0x39de('0x1f')]+_0x468c53['limit'];var _0x5335e2;if(_0xbafa8d>=_0xeae810){_0xbafa8d=_0xeae810;_0x5335e2=0xc8;}else{_0x5335e2=0xce;}_0x30d19e[_0x39de('0x19')](_0x5335e2);return _0x30d19e[_0x39de('0x20')](_0x39de('0x21'),_0x22a1ef+'-'+_0xbafa8d+'/'+_0xeae810)[_0x39de('0x1b')](_0x32cd16);}return null;};}function patchUpdates(_0x224454){return function(_0x3f1167){try{jsonpatch[_0x39de('0x22')](_0x3f1167,_0x224454,!![]);}catch(_0x2024f6){return BPromise[_0x39de('0x23')](_0x2024f6);}return _0x3f1167['save']();};}function saveUpdates(_0x45e76c,_0x19a0b8){return function(_0xe70540){if(_0xe70540){return _0xe70540['update'](_0x45e76c)[_0x39de('0x24')](function(_0x229db4){return _0x229db4;});}return null;};}function removeEntity(_0x20cfc9,_0x29fa88){return function(_0x4715d9){if(_0x4715d9){return _0x4715d9[_0x39de('0x25')]()[_0x39de('0x24')](function(){_0x20cfc9[_0x39de('0x19')](0xcc)[_0x39de('0x1a')]();});}};}function handleEntityNotFound(_0x2c923d,_0x7e9b5){return function(_0x55bcb8){if(!_0x55bcb8){_0x2c923d[_0x39de('0x26')](0x194);}return _0x55bcb8;};}function handleError(_0x422dc9,_0x15443d){_0x15443d=_0x15443d||0x1f4;return function(_0xcf6bbc){logger[_0x39de('0x27')](_0xcf6bbc[_0x39de('0x28')]);if(_0xcf6bbc['name']){delete _0xcf6bbc['name'];}_0x422dc9[_0x39de('0x19')](_0x15443d)['send'](_0xcf6bbc);};}exports[_0x39de('0x29')]=function(_0x15a031,_0x5f541b){var _0x534a4e={},_0x4c8fe4={},_0x47c498={'count':0x0,'rows':[]};var _0x21a368=_['map'](db['VoiceQueuesLog'][_0x39de('0x2a')],function(_0x4b314d){return{'name':_0x4b314d[_0x39de('0x2b')],'type':_0x4b314d[_0x39de('0x2c')]['key']};});_0x4c8fe4[_0x39de('0x2d')]=_[_0x39de('0x2e')](_0x21a368,_0x39de('0x2f'));_0x4c8fe4[_0x39de('0x30')]=_['keys'](_0x15a031[_0x39de('0x30')]);_0x4c8fe4['filters']=_['intersection'](_0x4c8fe4['model'],_0x4c8fe4['query']);_0x534a4e['attributes']=_[_0x39de('0x31')](_0x4c8fe4[_0x39de('0x2d')],qs[_0x39de('0x32')](_0x15a031['query']['fields']));_0x534a4e['attributes']=_0x534a4e[_0x39de('0x33')][_0x39de('0x34')]?_0x534a4e['attributes']:_0x4c8fe4[_0x39de('0x2d')];if(!_0x15a031[_0x39de('0x30')]['hasOwnProperty'](_0x39de('0x35'))){_0x534a4e['limit']=qs[_0x39de('0x1d')](_0x15a031['query'][_0x39de('0x1d')]);_0x534a4e[_0x39de('0x1f')]=qs['offset'](_0x15a031['query'][_0x39de('0x1f')]);}_0x534a4e[_0x39de('0x36')]=qs[_0x39de('0x37')](_0x15a031[_0x39de('0x30')][_0x39de('0x37')]);_0x534a4e[_0x39de('0x38')]=qs[_0x39de('0x39')](_[_0x39de('0x3a')](_0x15a031[_0x39de('0x30')],_0x4c8fe4[_0x39de('0x39')]),_0x21a368);if(_0x15a031[_0x39de('0x30')][_0x39de('0x3b')]){_0x534a4e[_0x39de('0x38')]=_[_0x39de('0x3c')](_0x534a4e[_0x39de('0x38')],{'$or':_[_0x39de('0x2e')](_0x21a368,function(_0x39fc33){if(_0x39fc33[_0x39de('0x2c')]!==_0x39de('0x3d')){var _0x13f15d={};_0x13f15d[_0x39fc33[_0x39de('0x2f')]]={'$like':'%'+_0x15a031['query'][_0x39de('0x3b')]+'%'};return _0x13f15d;}})});}_0x534a4e=_[_0x39de('0x3c')]({},_0x534a4e,_0x15a031[_0x39de('0x3e')]);var _0x40718c={'where':_0x534a4e['where']};return db[_0x39de('0x3f')]['count'](_0x40718c)[_0x39de('0x24')](function(_0x268c01){_0x47c498['count']=_0x268c01;if(_0x15a031[_0x39de('0x30')][_0x39de('0x40')]){_0x534a4e[_0x39de('0x41')]=[{'all':!![]}];}return db[_0x39de('0x3f')]['findAll'](_0x534a4e);})[_0x39de('0x24')](function(_0x99c933){_0x47c498[_0x39de('0x42')]=_0x99c933;return _0x47c498;})[_0x39de('0x24')](respondWithFilteredResult(_0x5f541b,_0x534a4e))[_0x39de('0x43')](handleError(_0x5f541b,null));};exports['show']=function(_0x462d57,_0x4df5c4){var _0x39feb6={'raw':!![],'where':{'id':_0x462d57['params']['id']}},_0x42cc85={};_0x42cc85[_0x39de('0x2d')]=_[_0x39de('0x44')](db[_0x39de('0x3f')]['rawAttributes']);_0x42cc85[_0x39de('0x30')]=_[_0x39de('0x44')](_0x462d57['query']);_0x42cc85[_0x39de('0x39')]=_[_0x39de('0x31')](_0x42cc85['model'],_0x42cc85[_0x39de('0x30')]);_0x39feb6[_0x39de('0x33')]=_[_0x39de('0x31')](_0x42cc85[_0x39de('0x2d')],qs[_0x39de('0x32')](_0x462d57[_0x39de('0x30')]['fields']));_0x39feb6['attributes']=_0x39feb6['attributes']['length']?_0x39feb6[_0x39de('0x33')]:_0x42cc85['model'];if(_0x462d57[_0x39de('0x30')][_0x39de('0x40')]){_0x39feb6[_0x39de('0x41')]=[{'all':!![]}];}_0x39feb6=_['merge']({},_0x39feb6,_0x462d57[_0x39de('0x3e')]);return db[_0x39de('0x3f')][_0x39de('0x45')](_0x39feb6)[_0x39de('0x24')](handleEntityNotFound(_0x4df5c4,null))[_0x39de('0x24')](respondWithResult(_0x4df5c4,null))['catch'](handleError(_0x4df5c4,null));};exports[_0x39de('0x46')]=function(_0x5e1801,_0x460d16){return db['VoiceQueuesLog'][_0x39de('0x46')](_0x5e1801['body'],{})[_0x39de('0x24')](respondWithResult(_0x460d16,0xc9))[_0x39de('0x43')](handleError(_0x460d16,null));};exports['update']=function(_0x2a26a6,_0x17ff45){if(_0x2a26a6[_0x39de('0x47')]['id']){delete _0x2a26a6[_0x39de('0x47')]['id'];}return db[_0x39de('0x3f')]['find']({'where':{'id':_0x2a26a6[_0x39de('0x48')]['id']}})[_0x39de('0x24')](handleEntityNotFound(_0x17ff45,null))[_0x39de('0x24')](saveUpdates(_0x2a26a6['body'],null))[_0x39de('0x24')](respondWithResult(_0x17ff45,null))['catch'](handleError(_0x17ff45,null));};exports[_0x39de('0x25')]=function(_0x1f4344,_0x54c6f1){return db['VoiceQueuesLog'][_0x39de('0x45')]({'where':{'id':_0x1f4344[_0x39de('0x48')]['id']}})[_0x39de('0x24')](handleEntityNotFound(_0x54c6f1,null))[_0x39de('0x24')](removeEntity(_0x54c6f1,null))[_0x39de('0x43')](handleError(_0x54c6f1,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index aa7a285..1504da5 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 _0x2746=['request-promise','path','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','../../config/logger','api','moment','bluebird'];(function(_0x4da39b,_0x8eae6){var _0x4d6739=function(_0x4936f0){while(--_0x4936f0){_0x4da39b['push'](_0x4da39b['shift']());}};_0x4d6739(++_0x8eae6);}(_0x2746,0x19c));var _0x6274=function(_0xee396,_0x496dce){_0xee396=_0xee396-0x0;var _0xc95140=_0x2746[_0xee396];return _0xc95140;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6274('0x0'))(_0x6274('0x1'));var moment=require(_0x6274('0x2'));var BPromise=require(_0x6274('0x3'));var rp=require(_0x6274('0x4'));var fs=require('fs');var path=require(_0x6274('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6274('0x6'));module[_0x6274('0x7')]=function(_0x1978ff,_0x534aee){return _0x1978ff[_0x6274('0x8')](_0x6274('0x9'),attributes,{'tableName':_0x6274('0xa'),'paranoid':![],'indexes':[{'name':_0x6274('0xb'),'fields':[_0x6274('0xc'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x0b13=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','../../config/logger','api'];(function(_0x55e393,_0x157928){var _0x219ab0=function(_0x7d4311){while(--_0x7d4311){_0x55e393['push'](_0x55e393['shift']());}};_0x219ab0(++_0x157928);}(_0x0b13,0x150));var _0x30b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b13[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x30b1('0x0'));var util=require(_0x30b1('0x1'));var logger=require(_0x30b1('0x2'))(_0x30b1('0x3'));var moment=require(_0x30b1('0x4'));var BPromise=require(_0x30b1('0x5'));var rp=require(_0x30b1('0x6'));var fs=require('fs');var path=require(_0x30b1('0x7'));var rimraf=require(_0x30b1('0x8'));var config=require(_0x30b1('0x9'));var attributes=require(_0x30b1('0xa'));module[_0x30b1('0xb')]=function(_0x2ec728,_0x17504d){return _0x2ec728[_0x30b1('0xc')](_0x30b1('0xd'),attributes,{'tableName':_0x30b1('0xe'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x30b1('0xf'),_0x30b1('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 9fc06d0..aefe2a6 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 _0x4c73=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3c3982,_0x163010){var _0x66448f=function(_0x35f37f){while(--_0x35f37f){_0x3c3982['push'](_0x3c3982['shift']());}};_0x66448f(++_0x163010);}(_0x4c73,0x14c));var _0x34c7=function(_0x1b44bb,_0x34a5d4){_0x1b44bb=_0x1b44bb-0x0;var _0x1672ff=_0x4c73[_0x1b44bb];return _0x1672ff;};'use strict';var _=require(_0x34c7('0x0'));var util=require(_0x34c7('0x1'));var moment=require(_0x34c7('0x2'));var BPromise=require(_0x34c7('0x3'));var rs=require(_0x34c7('0x4'));var fs=require('fs');var Redis=require(_0x34c7('0x5'));var db=require(_0x34c7('0x6'))['db'];var utils=require(_0x34c7('0x7'));var logger=require('../../config/logger')(_0x34c7('0x8'));var config=require(_0x34c7('0x9'));var jayson=require(_0x34c7('0xa'));var client=jayson[_0x34c7('0xb')][_0x34c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x758dae,_0x4aaefc,_0x1f5afc){return new BPromise(function(_0x4a9793,_0x6cf575){return client[_0x34c7('0xd')](_0x758dae,_0x1f5afc)['then'](function(_0x439d7b){logger['info'](_0x34c7('0xe'),_0x4aaefc,_0x34c7('0xf'));logger[_0x34c7('0x10')](_0x34c7('0x11'),_0x4aaefc,_0x34c7('0xf'),JSON[_0x34c7('0x12')](_0x439d7b));if(_0x439d7b[_0x34c7('0x13')]){if(_0x439d7b[_0x34c7('0x13')][_0x34c7('0x14')]===0x1f4){logger[_0x34c7('0x13')](_0x34c7('0xe'),_0x4aaefc,_0x439d7b[_0x34c7('0x13')][_0x34c7('0x15')]);return _0x6cf575(_0x439d7b[_0x34c7('0x13')][_0x34c7('0x15')]);}logger[_0x34c7('0x13')](_0x34c7('0xe'),_0x4aaefc,_0x439d7b[_0x34c7('0x13')]['message']);return _0x4a9793(_0x439d7b[_0x34c7('0x13')][_0x34c7('0x15')]);}else{logger['info'](_0x34c7('0xe'),_0x4aaefc,_0x34c7('0xf'));_0x4a9793(_0x439d7b[_0x34c7('0x16')][_0x34c7('0x15')]);}})[_0x34c7('0x17')](function(_0x169f43){logger[_0x34c7('0x13')](_0x34c7('0xe'),_0x4aaefc,_0x169f43);_0x6cf575(_0x169f43);});});} \ No newline at end of file +var _0x4f73=['stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x4f73,0x10f));var _0x34f7=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x4f73[_0x13cab0];return _0x38804f;};'use strict';var _=require(_0x34f7('0x0'));var util=require(_0x34f7('0x1'));var moment=require(_0x34f7('0x2'));var BPromise=require(_0x34f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34f7('0x5'));var logger=require('../../config/logger')(_0x34f7('0x6'));var config=require(_0x34f7('0x7'));var jayson=require(_0x34f7('0x8'));var client=jayson[_0x34f7('0x9')][_0x34f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b02ca,_0x576be8,_0x39e1e8){return new BPromise(function(_0x3b0938,_0x29031d){return client[_0x34f7('0xb')](_0x5b02ca,_0x39e1e8)[_0x34f7('0xc')](function(_0x2fabed){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x576be8,_0x34f7('0xd'));logger['debug'](_0x34f7('0xe'),_0x576be8,_0x34f7('0xd'),JSON[_0x34f7('0xf')](_0x2fabed));if(_0x2fabed[_0x34f7('0x10')]){if(_0x2fabed[_0x34f7('0x10')][_0x34f7('0x11')]===0x1f4){logger[_0x34f7('0x10')](_0x34f7('0x12'),_0x576be8,_0x2fabed['error'][_0x34f7('0x13')]);return _0x29031d(_0x2fabed[_0x34f7('0x10')]['message']);}logger[_0x34f7('0x10')](_0x34f7('0x12'),_0x576be8,_0x2fabed[_0x34f7('0x10')][_0x34f7('0x13')]);return _0x3b0938(_0x2fabed[_0x34f7('0x10')]['message']);}else{logger[_0x34f7('0x14')](_0x34f7('0x12'),_0x576be8,_0x34f7('0xd'));_0x3b0938(_0x2fabed[_0x34f7('0x15')][_0x34f7('0x13')]);}})['catch'](function(_0x3460b4){logger[_0x34f7('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x576be8,_0x3460b4);_0x29031d(_0x3460b4);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 4318e4d..73236cc 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 _0x5ba7=['/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','/:id/download'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5ba7,0x1df));var _0x75ba=function(_0x27e0c6,_0x472b19){_0x27e0c6=_0x27e0c6-0x0;var _0x11ddb9=_0x5ba7[_0x27e0c6];return _0x11ddb9;};'use strict';var multer=require('multer');var util=require(_0x75ba('0x0'));var path=require(_0x75ba('0x1'));var timeout=require(_0x75ba('0x2'));var express=require(_0x75ba('0x3'));var router=express[_0x75ba('0x4')]();var fs_extra=require(_0x75ba('0x5'));var auth=require(_0x75ba('0x6'));var interaction=require(_0x75ba('0x7'));var config=require(_0x75ba('0x8'));var controller=require('./voiceRecording.controller');router[_0x75ba('0x9')]('/',auth['isAuthenticated'](),controller[_0x75ba('0xa')]);router[_0x75ba('0x9')]('/describe',auth[_0x75ba('0xb')](),controller[_0x75ba('0xc')]);router[_0x75ba('0x9')](_0x75ba('0xd'),auth[_0x75ba('0xb')](),controller['show']);router[_0x75ba('0x9')](_0x75ba('0xe'),auth[_0x75ba('0xb')](),controller['download']);router['get'](_0x75ba('0xf'),controller[_0x75ba('0x10')]);router['get'](_0x75ba('0x11'),auth['isAuthenticated'](),controller[_0x75ba('0x12')]);router['post']('/',auth[_0x75ba('0xb')](),controller['create']);router[_0x75ba('0x13')](_0x75ba('0x11'),auth[_0x75ba('0xb')](),controller[_0x75ba('0x14')]);router[_0x75ba('0x15')](_0x75ba('0xd'),auth[_0x75ba('0xb')](),controller[_0x75ba('0x16')]);router[_0x75ba('0x17')](_0x75ba('0xd'),auth[_0x75ba('0xb')](),controller[_0x75ba('0x18')]);module[_0x75ba('0x19')]=router; \ No newline at end of file +var _0xb0c4=['/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../config/environment','./voiceRecording.controller','isAuthenticated','index','get','describe','/:id'];(function(_0x2be7c5,_0x17a20e){var _0x54b6cb=function(_0x1a4c09){while(--_0x1a4c09){_0x2be7c5['push'](_0x2be7c5['shift']());}};_0x54b6cb(++_0x17a20e);}(_0xb0c4,0x8a));var _0x4b0c=function(_0x102881,_0x58d723){_0x102881=_0x102881-0x0;var _0x5c63d0=_0xb0c4[_0x102881];return _0x5c63d0;};'use strict';var multer=require(_0x4b0c('0x0'));var util=require('util');var path=require(_0x4b0c('0x1'));var timeout=require('connect-timeout');var express=require(_0x4b0c('0x2'));var router=express[_0x4b0c('0x3')]();var fs_extra=require(_0x4b0c('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4b0c('0x5'));var controller=require(_0x4b0c('0x6'));router['get']('/',auth[_0x4b0c('0x7')](),controller[_0x4b0c('0x8')]);router[_0x4b0c('0x9')]('/describe',auth[_0x4b0c('0x7')](),controller[_0x4b0c('0xa')]);router[_0x4b0c('0x9')](_0x4b0c('0xb'),auth[_0x4b0c('0x7')](),controller['show']);router['get'](_0x4b0c('0xc'),auth[_0x4b0c('0x7')](),controller[_0x4b0c('0xd')]);router[_0x4b0c('0x9')](_0x4b0c('0xe'),controller[_0x4b0c('0xf')]);router[_0x4b0c('0x9')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x4b0c('0x10')]);router[_0x4b0c('0x11')]('/',auth['isAuthenticated'](),controller[_0x4b0c('0x12')]);router[_0x4b0c('0x11')](_0x4b0c('0x13'),auth[_0x4b0c('0x7')](),controller['runTranscribe']);router[_0x4b0c('0x14')](_0x4b0c('0xb'),auth[_0x4b0c('0x7')](),controller[_0x4b0c('0x15')]);router[_0x4b0c('0x16')](_0x4b0c('0xb'),auth[_0x4b0c('0x7')](),controller[_0x4b0c('0x17')]);module[_0x4b0c('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index c7dc255..27845bc 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(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 1bc9fa8..83b3d55 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 _0xa3ea=['ejs','fs-extra','lodash','squel','jsforce','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','fieldName','type','key','model','differenceBy','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','VoiceRecording','findAll','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','format','isNil','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data1','data2','Buckets','Name','NEW','IN_PROGRESS','runSentiment','downloadTranscribe','fileText','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xb22617,_0x374ab8){var _0x19b5ec=function(_0x5edfb9){while(--_0x5edfb9){_0xb22617['push'](_0xb22617['shift']());}};_0x19b5ec(++_0x374ab8);}(_0xa3ea,0x1ac));var _0xaa3e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa3ea[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa3e('0x0'));var zipdir=require(_0xaa3e('0x1'));var jsonpatch=require(_0xaa3e('0x2'));var rp=require(_0xaa3e('0x3'));var moment=require(_0xaa3e('0x4'));var BPromise=require(_0xaa3e('0x5'));var Mustache=require(_0xaa3e('0x6'));var util=require('util');var path=require(_0xaa3e('0x7'));var sox=require(_0xaa3e('0x8'));var csv=require(_0xaa3e('0x9'));var ejs=require(_0xaa3e('0xa'));var fs=require('fs');var fs_extra=require(_0xaa3e('0xb'));var _=require(_0xaa3e('0xc'));var squel=require(_0xaa3e('0xd'));var crypto=require('crypto');var jsforce=require(_0xaa3e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa3e('0xf'));var Papa=require('papaparse');var AWS=require(_0xaa3e('0x10'));var uuidv4=require('uuid/v4');var Redis=require(_0xaa3e('0x11'));var authService=require(_0xaa3e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaa3e('0x13'));var hardwareService=require(_0xaa3e('0x14'));var logger=require(_0xaa3e('0x15'))(_0xaa3e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaa3e('0x17'));var db=require(_0xaa3e('0x18'))['db'];function respondWithStatusCode(_0x207584,_0x2c3c63){_0x2c3c63=_0x2c3c63||0xcc;return function(_0x18711b){if(_0x18711b){return _0x207584['sendStatus'](_0x2c3c63);}return _0x207584[_0xaa3e('0x19')](_0x2c3c63)[_0xaa3e('0x1a')]();};}function respondWithResult(_0x4918be,_0x2d6633){_0x2d6633=_0x2d6633||0xc8;return function(_0x555ed3){if(_0x555ed3){return _0x4918be['status'](_0x2d6633)[_0xaa3e('0x1b')](_0x555ed3);}};}function respondWithFilteredResult(_0x500adb,_0x117214){return function(_0x67f94a){if(_0x67f94a){var _0xa315d4=typeof _0x117214[_0xaa3e('0x1c')]===_0xaa3e('0x1d')&&typeof _0x117214[_0xaa3e('0x1e')]===_0xaa3e('0x1d');var _0x346953=_0x67f94a[_0xaa3e('0x1f')];var _0x47d987=_0xa315d4?0x0:_0x117214[_0xaa3e('0x1c')];var _0xbe8611=_0xa315d4?_0x67f94a['count']:_0x117214['offset']+_0x117214[_0xaa3e('0x1e')];var _0x328268;if(_0xbe8611>=_0x346953){_0xbe8611=_0x346953;_0x328268=0xc8;}else{_0x328268=0xce;}_0x500adb[_0xaa3e('0x19')](_0x328268);return _0x500adb['set'](_0xaa3e('0x20'),_0x47d987+'-'+_0xbe8611+'/'+_0x346953)[_0xaa3e('0x1b')](_0x67f94a);}return null;};}function patchUpdates(_0x400cb1){return function(_0x55e825){try{jsonpatch[_0xaa3e('0x21')](_0x55e825,_0x400cb1,!![]);}catch(_0x4594a2){return BPromise[_0xaa3e('0x22')](_0x4594a2);}return _0x55e825[_0xaa3e('0x23')]();};}function saveUpdates(_0x16d63a,_0x20ec65){return function(_0x5814c1){if(_0x5814c1){return _0x5814c1[_0xaa3e('0x24')](_0x16d63a)[_0xaa3e('0x25')](function(_0x54f35f){return _0x54f35f;});}return null;};}function removeEntity(_0x21e932,_0x5d0452){return function(_0x3164e0){if(_0x3164e0){return _0x3164e0[_0xaa3e('0x26')]()[_0xaa3e('0x25')](function(){_0x21e932['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31c0e9,_0x1e77bc){return function(_0x434fed){if(!_0x434fed){_0x31c0e9[_0xaa3e('0x27')](0x194);}return _0x434fed;};}function handleError(_0x5f2fc4,_0x33edc2){_0x33edc2=_0x33edc2||0x1f4;return function(_0x3a0c85){logger[_0xaa3e('0x28')](_0x3a0c85['stack']);if(_0x3a0c85[_0xaa3e('0x29')]){delete _0x3a0c85[_0xaa3e('0x29')];}_0x5f2fc4[_0xaa3e('0x19')](_0x33edc2)[_0xaa3e('0x2a')](_0x3a0c85);};}exports[_0xaa3e('0x2b')]=function(_0x1bd3f8,_0x1c9ba6){var _0xc6879b={},_0x309b51={},_0x4f90dd={'count':0x0,'rows':[]};var _0x2e53c4=_['map'](db['VoiceRecording']['rawAttributes'],function(_0x5d5de7){return{'name':_0x5d5de7[_0xaa3e('0x2c')],'type':_0x5d5de7[_0xaa3e('0x2d')][_0xaa3e('0x2e')]};});_0x309b51[_0xaa3e('0x2f')]=_[_0xaa3e('0x30')](_[_0xaa3e('0x31')](_0x2e53c4,_0xaa3e('0x29')),['format']);_0x309b51['query']=_[_0xaa3e('0x32')](_0x1bd3f8[_0xaa3e('0x33')]);_0x309b51[_0xaa3e('0x34')]=_[_0xaa3e('0x35')](_0x309b51['model'],_0x309b51[_0xaa3e('0x33')]);_0xc6879b[_0xaa3e('0x36')]=_[_0xaa3e('0x35')](_0x309b51['model'],qs['fields'](_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x37')]));_0xc6879b[_0xaa3e('0x36')]=_0xc6879b[_0xaa3e('0x36')][_0xaa3e('0x38')]?_0xc6879b[_0xaa3e('0x36')]:_0x309b51[_0xaa3e('0x2f')];if(!_0x1bd3f8['query']['hasOwnProperty'](_0xaa3e('0x39'))){_0xc6879b[_0xaa3e('0x1e')]=qs[_0xaa3e('0x1e')](_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x1e')]);_0xc6879b[_0xaa3e('0x1c')]=qs['offset'](_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x1c')]);}_0xc6879b['order']=qs[_0xaa3e('0x3a')](_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x3a')]);_0xc6879b[_0xaa3e('0x3b')]=qs[_0xaa3e('0x34')](_[_0xaa3e('0x3c')](_0x1bd3f8[_0xaa3e('0x33')],_0x309b51[_0xaa3e('0x34')]),_0x2e53c4);if(_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x3d')]){_0xc6879b['where']=_[_0xaa3e('0x3e')](_0xc6879b[_0xaa3e('0x3b')],{'$or':_[_0xaa3e('0x31')](_0x2e53c4,function(_0x542e87){if(_0x542e87[_0xaa3e('0x2d')]!==_0xaa3e('0x3f')){var _0xed2bc5={};_0xed2bc5[_0x542e87[_0xaa3e('0x29')]]={'$like':'%'+_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x3d')]+'%'};return _0xed2bc5;}})});}_0xc6879b=_[_0xaa3e('0x3e')]({},_0xc6879b,_0x1bd3f8[_0xaa3e('0x40')]);var _0x33e966={'where':_0xc6879b[_0xaa3e('0x3b')]};return db['VoiceRecording']['count'](_0x33e966)[_0xaa3e('0x25')](function(_0x5fd37b){_0x4f90dd[_0xaa3e('0x1f')]=_0x5fd37b;if(_0x1bd3f8[_0xaa3e('0x33')][_0xaa3e('0x41')]){_0xc6879b[_0xaa3e('0x42')]=[{'all':!![]}];}return db[_0xaa3e('0x43')][_0xaa3e('0x44')](_0xc6879b);})[_0xaa3e('0x25')](function(_0x2f7eaf){_0x4f90dd['rows']=_0x2f7eaf;return _0x4f90dd;})[_0xaa3e('0x25')](respondWithFilteredResult(_0x1c9ba6,_0xc6879b))[_0xaa3e('0x45')](handleError(_0x1c9ba6,null));};exports[_0xaa3e('0x46')]=function(_0x8816dd,_0x1d274c){var _0x634b86={'raw':![],'where':{'id':_0x8816dd[_0xaa3e('0x47')]['id']}},_0x3a85dd={};_0x3a85dd[_0xaa3e('0x2f')]=_[_0xaa3e('0x32')](db[_0xaa3e('0x43')]['rawAttributes']);_0x3a85dd[_0xaa3e('0x33')]=_['keys'](_0x8816dd[_0xaa3e('0x33')]);_0x3a85dd[_0xaa3e('0x34')]=_['intersection'](_0x3a85dd[_0xaa3e('0x2f')],_0x3a85dd[_0xaa3e('0x33')]);_0x634b86[_0xaa3e('0x36')]=_['intersection'](_0x3a85dd[_0xaa3e('0x2f')],qs[_0xaa3e('0x37')](_0x8816dd[_0xaa3e('0x33')][_0xaa3e('0x37')]));_0x634b86['attributes']=_0x634b86[_0xaa3e('0x36')]['length']?_0x634b86[_0xaa3e('0x36')]:_0x3a85dd[_0xaa3e('0x2f')];if(_0x8816dd[_0xaa3e('0x33')][_0xaa3e('0x41')]){_0x634b86['include']=[{'all':!![]}];}_0x634b86=_[_0xaa3e('0x3e')]({},_0x634b86,_0x8816dd[_0xaa3e('0x40')]);return db[_0xaa3e('0x43')][_0xaa3e('0x48')](_0x634b86)[_0xaa3e('0x25')](handleEntityNotFound(_0x1d274c,null))[_0xaa3e('0x25')](respondWithResult(_0x1d274c,null))[_0xaa3e('0x45')](handleError(_0x1d274c,null));};exports[_0xaa3e('0x49')]=function(_0xbb4a93,_0x1a6ad1){return db['VoiceRecording'][_0xaa3e('0x49')](_0xbb4a93[_0xaa3e('0x4a')],{})['then'](respondWithResult(_0x1a6ad1,0xc9))[_0xaa3e('0x45')](handleError(_0x1a6ad1,null));};exports['update']=function(_0x28893d,_0x3c3445){if(_0x28893d[_0xaa3e('0x4a')]['id']){delete _0x28893d[_0xaa3e('0x4a')]['id'];}return db[_0xaa3e('0x43')][_0xaa3e('0x48')]({'where':{'id':_0x28893d[_0xaa3e('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c3445,null))['then'](saveUpdates(_0x28893d[_0xaa3e('0x4a')],null))[_0xaa3e('0x25')](respondWithResult(_0x3c3445,null))[_0xaa3e('0x45')](handleError(_0x3c3445,null));};exports[_0xaa3e('0x4b')]=function(_0x373be5,_0x1d275c){return db['VoiceRecording'][_0xaa3e('0x4b')]()[_0xaa3e('0x25')](respondWithResult(_0x1d275c,null))['catch'](handleError(_0x1d275c,null));};exports[_0xaa3e('0x4c')]=function(_0x1c2675,_0x56cdbf,_0x22aca4){var _0x32a994=require(_0xaa3e('0x4d'));var _0x39d050=![];var _0x40740c={};if(_0x1c2675[_0xaa3e('0x33')][_0xaa3e('0x2d')]&&_0x1c2675[_0xaa3e('0x33')]['type']===_0xaa3e('0x4e')){_0x40740c[_0xaa3e('0x4e')]=_0x1c2675[_0xaa3e('0x47')]['id'];}else{_0x40740c['id']=_0x1c2675[_0xaa3e('0x47')]['id'];}return db[_0xaa3e('0x43')][_0xaa3e('0x48')]({'where':_0x40740c,'attributes':['id',_0xaa3e('0x4f')],'raw':!![]})[_0xaa3e('0x25')](handleEntityNotFound(_0x56cdbf,null))['then'](function(_0xdad89a){if(_0xdad89a){var _0x15bffe=_0xdad89a[_0xaa3e('0x4f')];var _0x4a5ffd=util['format'](_0xaa3e('0x50'),_0x15bffe);if(fs[_0xaa3e('0x51')](_0x4a5ffd)){_0x39d050=!![];return _0x32a994[_0xaa3e('0x52')](_0x4a5ffd,_0x15bffe,config[_0xaa3e('0x53')]['recording'])['then'](function(){return _0xdad89a;});}return _0xdad89a;}})['then'](function(_0x4af1af){if(_0x4af1af){var _0x2e846b=_0x4af1af[_0xaa3e('0x4f')];if(!fs[_0xaa3e('0x51')](_0x2e846b)){throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))](_0xaa3e('0x56'));}if(_0x4af1af[_0xaa3e('0x57')]){return _0x56cdbf['download'](_0x2e846b,_0x4af1af[_0xaa3e('0x57')]+path[_0xaa3e('0x58')](_0x2e846b),function(){if(_0x39d050){fs[_0xaa3e('0x59')](_0x2e846b);}});}else{return _0x56cdbf[_0xaa3e('0x4c')](_0x2e846b,function(_0xbc8315){if(_0x39d050){fs['unlink'](_0x2e846b);}});}}})[_0xaa3e('0x45')](function(_0x28bac9){if(_0x28bac9[_0xaa3e('0x5a')]==='VoiceRecording\x20not\x20found'){_0x56cdbf[_0xaa3e('0x19')](0x194)[_0xaa3e('0x2a')](_0xaa3e('0x5b'));}else{return handleError(_0x56cdbf,null);}});};exports[_0xaa3e('0x5c')]=function(_0x51513e,_0x1fbcea,_0x144e9d){var _0x4cd513=require(_0xaa3e('0x4d'));var _0x8304de=![];var _0x277be7={'$and':[db[_0xaa3e('0x5d')][_0xaa3e('0x3b')](db['sequelize']['fn'](_0xaa3e('0x5e'),db['sequelize'][_0xaa3e('0x5f')](_0xaa3e('0x4e'))),_0x51513e[_0xaa3e('0x33')]['token'])]};if(_0x51513e[_0xaa3e('0x33')][_0xaa3e('0x2d')]&&_0x51513e[_0xaa3e('0x33')][_0xaa3e('0x2d')]===_0xaa3e('0x4e')){_0x277be7['$and']['push']({'uniqueid':_0x51513e['params']['id']});}else{_0x277be7[_0xaa3e('0x60')][_0xaa3e('0x61')]({'id':_0x51513e[_0xaa3e('0x47')]['id']});}return db['VoiceRecording'][_0xaa3e('0x48')]({'where':_0x277be7,'attributes':['id',_0xaa3e('0x4f')],'raw':!![]})[_0xaa3e('0x25')](handleEntityNotFound(_0x1fbcea,null))['then'](function(_0xe35dba){if(_0xe35dba){var _0x59ee87=util[_0xaa3e('0x62')](_0xaa3e('0x50'),_0xe35dba[_0xaa3e('0x4f')]);if(fs[_0xaa3e('0x51')](_0x59ee87)){_0x8304de=!![];return _0x4cd513[_0xaa3e('0x52')](_0x59ee87,_0xe35dba[_0xaa3e('0x4f')],config[_0xaa3e('0x53')]['recording'])[_0xaa3e('0x25')](function(){return _0xe35dba;});}return _0xe35dba;}})[_0xaa3e('0x25')](function(_0x4af15d){if(_0x4af15d){if(!fs[_0xaa3e('0x51')](_0x4af15d['value'])){throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x4af15d[_0xaa3e('0x57')]){return _0x1fbcea['download'](_0x4af15d[_0xaa3e('0x4f')],_0x4af15d[_0xaa3e('0x57')]+path[_0xaa3e('0x58')](_0x4af15d[_0xaa3e('0x4f')]),function(){if(_0x8304de){fs[_0xaa3e('0x59')](_0x4af15d[_0xaa3e('0x4f')]);}});}else{return _0x1fbcea[_0xaa3e('0x4c')](_0x4af15d[_0xaa3e('0x4f')],function(_0x58202f){if(_0x8304de){fs[_0xaa3e('0x59')](_0x4af15d[_0xaa3e('0x4f')]);}});}}})[_0xaa3e('0x45')](handleError(_0x1fbcea,null));};exports[_0xaa3e('0x26')]=function(_0x4cc583,_0x44e7f4){return db[_0xaa3e('0x43')][_0xaa3e('0x48')]({'where':{'id':_0x4cc583[_0xaa3e('0x47')]['id']}})[_0xaa3e('0x25')](function(_0x48fdf4){if(_[_0xaa3e('0x63')](_0x48fdf4)){throw new ReferenceError('Entity\x20not\x20found');}return _0x48fdf4;})[_0xaa3e('0x25')](function(_0x44a897){var _0x2f6c1d=_0x44a897[_0xaa3e('0x4f')];logger['info'](_0xaa3e('0x64'),_0x2f6c1d);if(!_[_0xaa3e('0x63')](_0x44a897[_0xaa3e('0x4f')])&&fs[_0xaa3e('0x51')](_0x2f6c1d)){logger[_0xaa3e('0x65')]('File:\x20\x22'+_0x2f6c1d+_0xaa3e('0x66'));fs[_0xaa3e('0x67')](_0x2f6c1d);}_0x2f6c1d=_0x2f6c1d+_0xaa3e('0x68');if(!_[_0xaa3e('0x63')](_0x44a897['value'])&&fs[_0xaa3e('0x51')](_0x2f6c1d)){logger['info'](_0xaa3e('0x69')+_0x2f6c1d+_0xaa3e('0x66'));fs[_0xaa3e('0x67')](_0x2f6c1d);}return _0x44a897;})[_0xaa3e('0x25')](function(_0x3ac5a1){if(!_0x3ac5a1)throw new InternalError();return _0x3ac5a1[_0xaa3e('0x26')]();})[_0xaa3e('0x25')](function(){_0x44e7f4[_0xaa3e('0x19')](0xcc)[_0xaa3e('0x1a')]();})[_0xaa3e('0x45')](handleError(_0x44e7f4,null));};function getBucketslist(_0x11723d,_0xd4a44c,_0x56563d){return new Promise(function(_0x110283,_0x3ae2af){var _0x13d123=new AWS['S3']({'accessKeyId':_0xd4a44c,'secretAccessKey':_0x11723d,'region':_0x56563d});_0x13d123[_0xaa3e('0x6a')]({},function(_0x29ee22,_0x2ba441){if(_0x29ee22){return _0x3ae2af(_0x29ee22);}else{return _0x110283(_0x2ba441);}});});}function createBucket(_0x2d1332,_0x16e96c,_0x104691,_0x125b30){return new Promise(function(_0xbc3e8b,_0x5e2019){var _0x3c2b72=new AWS['S3']({'accessKeyId':_0x16e96c,'secretAccessKey':_0x2d1332,'region':_0x104691});_0x3c2b72[_0xaa3e('0x6b')]({'Bucket':_0x125b30},function(_0x2bb3da,_0x4e6b13){if(_0x2bb3da){return _0x5e2019(_0x2bb3da);}else{return _0xbc3e8b(_0x4e6b13);}});});}function uploadFile(_0x4543cd,_0x1fba2a,_0x123be5,_0x121f97,_0x560bc2,_0x592ce5){return new Promise(function(_0x4f9da9,_0x2a9f54){var _0x2f5efa=new AWS['S3']({'accessKeyId':_0x1fba2a,'secretAccessKey':_0x4543cd,'region':_0x123be5});_0x2f5efa[_0xaa3e('0x6c')]({'Bucket':_0x121f97,'Key':_0x560bc2,'Body':_0x592ce5},function(_0x3a5936,_0x59b3b3){if(_0x3a5936){return _0x2a9f54(_0x3a5936);}else{return _0x4f9da9(_0x59b3b3);}});});}function startTranscribe(_0x2e5410,_0x174ee8,_0x306332,_0x2f19a4,_0x3040ab,_0x5d10ea){return new Promise(function(_0x2532eb,_0x28beca){var _0xb5fdbb=new AWS[(_0xaa3e('0x6d'))]({'accessKeyId':_0x174ee8,'secretAccessKey':_0x2e5410,'region':_0x306332});_0xb5fdbb[_0xaa3e('0x6e')]({'TranscriptionJobName':_0x2f19a4,'LanguageCode':_0x3040ab,'Media':{'MediaFileUri':_0x5d10ea}},function(_0x5f1e2a,_0x59b393){if(_0x5f1e2a){return _0x28beca(_0x5f1e2a);}else{return _0x2532eb(_0x59b393);}});});}function transcribe(_0x14a900,_0x142c5f,_0x338611,_0x23846b,_0x46990a,_0x444355,_0x3da920){return new Promise(function(_0x47408a,_0x57eb5a){var _0x46c051={};logger[_0xaa3e('0x65')](util[_0xaa3e('0x62')](_0xaa3e('0x6f'),_0x14a900,_0x46990a));return uploadFile(_0x142c5f,_0x338611,_0x23846b,_0x46990a,path['basename'](_0x444355),fs['readFileSync'](_0x444355))['then'](function(_0x93d031){logger[_0xaa3e('0x65')](util['format'](_0xaa3e('0x70'),_0x14a900,_0x46990a,_0x93d031[_0xaa3e('0x71')]));_0x46c051[_0xaa3e('0x72')]=_0x93d031['Bucket'];_0x46c051[_0xaa3e('0x73')]=_0x93d031['Location'];logger[_0xaa3e('0x65')](util[_0xaa3e('0x62')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x14a900));return startTranscribe(_0x142c5f,_0x338611,_0x23846b,uuidv4(),_0x3da920,_0x93d031[_0xaa3e('0x71')]);})['then'](function(_0x58ca24){logger[_0xaa3e('0x65')](util['format'](_0xaa3e('0x74'),_0x14a900,_0x58ca24[_0xaa3e('0x75')][_0xaa3e('0x76')]));_0x46c051[_0xaa3e('0x77')]=_0x58ca24['TranscriptionJob'][_0xaa3e('0x76')];_0x46c051[_0xaa3e('0x78')]=_0x58ca24[_0xaa3e('0x75')][_0xaa3e('0x79')];return _0x47408a(_0x46c051);})['catch'](function(_0x5aecd9){return _0x57eb5a(_0x5aecd9);});});}exports[_0xaa3e('0x7a')]=function(_0xe12c82,_0x2bf09a,_0x3fa31d){var _0x2be86e;var _0x58eec7;var _0x3f4d59;var _0x5b0277=require('../../components/encryptor');return db[_0xaa3e('0x43')][_0xaa3e('0x7b')]({'where':{'id':_0xe12c82[_0xaa3e('0x47')]['id']}})[_0xaa3e('0x25')](function(_0x26c6ad){if(_0x26c6ad){var _0x1f29a7=util['format'](_0xaa3e('0x50'),_0x26c6ad[_0xaa3e('0x4f')]);if(fs[_0xaa3e('0x51')](_0x1f29a7)){cypher=!![];return _0x5b0277['decryptFile'](_0x1f29a7,_0x26c6ad[_0xaa3e('0x4f')],config[_0xaa3e('0x53')][_0xaa3e('0x7c')])[_0xaa3e('0x25')](function(){return _0x26c6ad;});}return _0x26c6ad;}})['then'](function(_0x319330){if(!_0x319330){throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))](_0xaa3e('0x7d'));}_0x58eec7=_0x319330;return db[_0xaa3e('0x7e')][_0xaa3e('0x7b')]({'where':{'id':0x1}});})[_0xaa3e('0x25')](handleEntityNotFound(_0x2bf09a,null))[_0xaa3e('0x25')](function(_0x1bf4ae){if(_0x1bf4ae){_0x2be86e=_0x1bf4ae;if(!_0x2be86e['transcribe']||!_0x2be86e[_0xaa3e('0x7f')]||!_0x2be86e[_0xaa3e('0x80')]||!_0x2be86e[_0xaa3e('0x81')]||!_0x2be86e[_0xaa3e('0x72')]){throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))](_0xaa3e('0x82'));}if(_0xe12c82[_0xaa3e('0x4a')]['runSentiment']&&(!_0x2be86e[_0xaa3e('0x83')]||!_0x2be86e['sentimentAccountId']||!_0x2be86e[_0xaa3e('0x84')]||!_0x2be86e[_0xaa3e('0x81')]||!_0x2be86e[_0xaa3e('0x72')])){throw new db['Sequelize'][(_0xaa3e('0x55'))](_0xaa3e('0x85'));}return db[_0xaa3e('0x86')][_0xaa3e('0x7b')]({'where':{'id':_0x2be86e[_0xaa3e('0x7f')]}});}})['then'](function(_0x5f2865){if(!_0x5f2865){throw new db['Sequelize'][(_0xaa3e('0x55'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5f2865[_0xaa3e('0x87')]||!_0x5f2865['data2']){throw new db['Sequelize'][(_0xaa3e('0x55'))]('Cloud\x20Provider\x20not\x20configured');}_0x3f4d59=_0x5f2865;return getBucketslist(_0x3f4d59[_0xaa3e('0x87')],_0x3f4d59[_0xaa3e('0x88')],_0x2be86e[_0xaa3e('0x80')]);})[_0xaa3e('0x25')](function(_0x4c430a){if(_0x4c430a&&_0x4c430a[_0xaa3e('0x89')]){var _0x15aed9=_[_0xaa3e('0x48')](_0x4c430a[_0xaa3e('0x89')],function(_0x16d8d5){return _0x16d8d5[_0xaa3e('0x8a')]===_0x2be86e[_0xaa3e('0x72')];});if(!_0x15aed9){logger[_0xaa3e('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xe12c82[_0xaa3e('0x47')]['id'],_0x2be86e['bucket']));return createBucket(_0x3f4d59['data1'],_0x3f4d59['data2'],_0x2be86e[_0xaa3e('0x80')],_0x2be86e['bucket']);}logger[_0xaa3e('0x65')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0xe12c82[_0xaa3e('0x47')]['id'],_0x2be86e[_0xaa3e('0x72')]));return;}})[_0xaa3e('0x25')](function(_0x4c71cd){if(_0x58eec7[_0xaa3e('0x78')]===_0xaa3e('0x8b')){return transcribe(_0xe12c82[_0xaa3e('0x47')]['id'],_0x3f4d59['data1'],_0x3f4d59['data2'],_0x2be86e[_0xaa3e('0x80')],_0x2be86e['bucket'],_0x58eec7[_0xaa3e('0x4f')],_0x2be86e[_0xaa3e('0x81')]);}else{logger['info'](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xe12c82[_0xaa3e('0x47')]['id']));return{'transcribeStatus':_0xaa3e('0x8c')};}})[_0xaa3e('0x25')](function(_0x53321d){if(_0x53321d){_0x53321d['tempSentiment']=_0xe12c82[_0xaa3e('0x4a')][_0xaa3e('0x8d')];return _0x58eec7['updateAttributes'](_0x53321d);}})[_0xaa3e('0x25')](respondWithResult(_0x2bf09a,null))['catch'](handleError(_0x2bf09a,null));};function writeFile(_0xa38ea6,_0x5d76e2){return new Promise(function(_0x455d7f,_0x5555b8){fs['writeFile'](_0x5d76e2,_0xa38ea6,function(_0x187f32,_0x176340){if(_0x187f32){return _0x5555b8(_0x187f32);}else{return _0x455d7f(_0x176340);}});});}exports[_0xaa3e('0x8e')]=function(_0x4a5ec2,_0x48f989,_0x47705f){return db[_0xaa3e('0x43')]['findOne']({'where':{'id':_0x4a5ec2[_0xaa3e('0x47')]['id']}})['then'](handleEntityNotFound(_0x48f989))[_0xaa3e('0x25')](function(_0x2d4ba2){if(_0x2d4ba2&&_0x2d4ba2['fileText']){var _0x9a94a1=_0x2d4ba2[_0xaa3e('0x8f')];var _0x256118=config['root']+'/server/files/transcribes/transcribe_'+_0x2d4ba2['id']+_0xaa3e('0x90');if(fs[_0xaa3e('0x51')](_0x256118)){return _0x256118;}return writeFile(_0x9a94a1,_0x256118)[_0xaa3e('0x25')](function(){return _0x256118;});}else{throw new db[(_0xaa3e('0x54'))][(_0xaa3e('0x55'))](_0xaa3e('0x91'));}})[_0xaa3e('0x25')](function(_0x48da9e){return _0x48f989[_0xaa3e('0x4c')](_0x48da9e);})[_0xaa3e('0x45')](handleError(_0x48f989));}; \ No newline at end of file +var _0xd5bf=['mustache','util','path','sox','to-csv','fs-extra','lodash','squel','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','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','model','format','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','catch','show','params','keys','include','options','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','sequelize','MD5','col','token','$and','push','extname','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','Location','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','language','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0xd5bf,0x1c7));var _0xfd5b=function(_0x501fa2,_0x413a32){_0x501fa2=_0x501fa2-0x0;var _0x57e564=_0xd5bf[_0x501fa2];return _0x57e564;};'use strict';var emlformat=require(_0xfd5b('0x0'));var rimraf=require(_0xfd5b('0x1'));var zipdir=require(_0xfd5b('0x2'));var jsonpatch=require(_0xfd5b('0x3'));var rp=require(_0xfd5b('0x4'));var moment=require(_0xfd5b('0x5'));var BPromise=require(_0xfd5b('0x6'));var Mustache=require(_0xfd5b('0x7'));var util=require(_0xfd5b('0x8'));var path=require(_0xfd5b('0x9'));var sox=require(_0xfd5b('0xa'));var csv=require(_0xfd5b('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfd5b('0xc'));var _=require(_0xfd5b('0xd'));var squel=require(_0xfd5b('0xe'));var crypto=require(_0xfd5b('0xf'));var jsforce=require(_0xfd5b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfd5b('0xb'));var querystring=require(_0xfd5b('0x11'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require(_0xfd5b('0x12'));var qs=require(_0xfd5b('0x13'));var as=require(_0xfd5b('0x14'));var hardwareService=require(_0xfd5b('0x15'));var logger=require(_0xfd5b('0x16'))(_0xfd5b('0x17'));var utils=require(_0xfd5b('0x18'));var config=require(_0xfd5b('0x19'));var licenseUtil=require(_0xfd5b('0x1a'));var db=require(_0xfd5b('0x1b'))['db'];function respondWithStatusCode(_0x2d408d,_0x8027e7){_0x8027e7=_0x8027e7||0xcc;return function(_0x54cd63){if(_0x54cd63){return _0x2d408d[_0xfd5b('0x1c')](_0x8027e7);}return _0x2d408d[_0xfd5b('0x1d')](_0x8027e7)[_0xfd5b('0x1e')]();};}function respondWithResult(_0x3511f4,_0x2e0cc4){_0x2e0cc4=_0x2e0cc4||0xc8;return function(_0x2fdab8){if(_0x2fdab8){return _0x3511f4[_0xfd5b('0x1d')](_0x2e0cc4)[_0xfd5b('0x1f')](_0x2fdab8);}};}function respondWithFilteredResult(_0x99e586,_0x46df8c){return function(_0x322188){if(_0x322188){var _0x12eb85=typeof _0x46df8c[_0xfd5b('0x20')]===_0xfd5b('0x21')&&typeof _0x46df8c[_0xfd5b('0x22')]===_0xfd5b('0x21');var _0x430e6f=_0x322188[_0xfd5b('0x23')];var _0x352990=_0x12eb85?0x0:_0x46df8c[_0xfd5b('0x20')];var _0x5202d3=_0x12eb85?_0x322188[_0xfd5b('0x23')]:_0x46df8c[_0xfd5b('0x20')]+_0x46df8c[_0xfd5b('0x22')];var _0x4b4fdc;if(_0x5202d3>=_0x430e6f){_0x5202d3=_0x430e6f;_0x4b4fdc=0xc8;}else{_0x4b4fdc=0xce;}_0x99e586['status'](_0x4b4fdc);return _0x99e586['set'](_0xfd5b('0x24'),_0x352990+'-'+_0x5202d3+'/'+_0x430e6f)['json'](_0x322188);}return null;};}function patchUpdates(_0xb31227){return function(_0xab0c3f){try{jsonpatch[_0xfd5b('0x25')](_0xab0c3f,_0xb31227,!![]);}catch(_0x5b99e3){return BPromise[_0xfd5b('0x26')](_0x5b99e3);}return _0xab0c3f[_0xfd5b('0x27')]();};}function saveUpdates(_0x25a382,_0x5887fb){return function(_0x3cedf4){if(_0x3cedf4){return _0x3cedf4[_0xfd5b('0x28')](_0x25a382)[_0xfd5b('0x29')](function(_0x210144){return _0x210144;});}return null;};}function removeEntity(_0x37627a,_0x36c72c){return function(_0x3a35fd){if(_0x3a35fd){return _0x3a35fd[_0xfd5b('0x2a')]()[_0xfd5b('0x29')](function(){_0x37627a[_0xfd5b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x467f7d,_0x2b091b){return function(_0x2af671){if(!_0x2af671){_0x467f7d['sendStatus'](0x194);}return _0x2af671;};}function handleError(_0x2b048c,_0x1c48ea){_0x1c48ea=_0x1c48ea||0x1f4;return function(_0x53a319){logger['error'](_0x53a319[_0xfd5b('0x2b')]);if(_0x53a319[_0xfd5b('0x2c')]){delete _0x53a319[_0xfd5b('0x2c')];}_0x2b048c[_0xfd5b('0x1d')](_0x1c48ea)[_0xfd5b('0x2d')](_0x53a319);};}exports[_0xfd5b('0x2e')]=function(_0x16c3d0,_0x40587a){var _0x49832c={},_0xccb374={},_0x4a08b3={'count':0x0,'rows':[]};var _0xf0847e=_[_0xfd5b('0x2f')](db[_0xfd5b('0x30')][_0xfd5b('0x31')],function(_0x37705a){return{'name':_0x37705a['fieldName'],'type':_0x37705a[_0xfd5b('0x32')][_0xfd5b('0x33')]};});_0xccb374[_0xfd5b('0x34')]=_['differenceBy'](_[_0xfd5b('0x2f')](_0xf0847e,_0xfd5b('0x2c')),[_0xfd5b('0x35')]);_0xccb374['query']=_['keys'](_0x16c3d0['query']);_0xccb374[_0xfd5b('0x36')]=_[_0xfd5b('0x37')](_0xccb374[_0xfd5b('0x34')],_0xccb374[_0xfd5b('0x38')]);_0x49832c[_0xfd5b('0x39')]=_['intersection'](_0xccb374[_0xfd5b('0x34')],qs[_0xfd5b('0x3a')](_0x16c3d0[_0xfd5b('0x38')][_0xfd5b('0x3a')]));_0x49832c[_0xfd5b('0x39')]=_0x49832c[_0xfd5b('0x39')][_0xfd5b('0x3b')]?_0x49832c[_0xfd5b('0x39')]:_0xccb374[_0xfd5b('0x34')];if(!_0x16c3d0[_0xfd5b('0x38')][_0xfd5b('0x3c')](_0xfd5b('0x3d'))){_0x49832c[_0xfd5b('0x22')]=qs['limit'](_0x16c3d0[_0xfd5b('0x38')][_0xfd5b('0x22')]);_0x49832c[_0xfd5b('0x20')]=qs[_0xfd5b('0x20')](_0x16c3d0[_0xfd5b('0x38')]['offset']);}_0x49832c['order']=qs[_0xfd5b('0x3e')](_0x16c3d0[_0xfd5b('0x38')]['sort']);_0x49832c[_0xfd5b('0x3f')]=qs[_0xfd5b('0x36')](_[_0xfd5b('0x40')](_0x16c3d0[_0xfd5b('0x38')],_0xccb374[_0xfd5b('0x36')]),_0xf0847e);if(_0x16c3d0[_0xfd5b('0x38')][_0xfd5b('0x41')]){_0x49832c[_0xfd5b('0x3f')]=_[_0xfd5b('0x42')](_0x49832c[_0xfd5b('0x3f')],{'$or':_[_0xfd5b('0x2f')](_0xf0847e,function(_0x31afca){if(_0x31afca['type']!==_0xfd5b('0x43')){var _0x570b3b={};_0x570b3b[_0x31afca[_0xfd5b('0x2c')]]={'$like':'%'+_0x16c3d0[_0xfd5b('0x38')][_0xfd5b('0x41')]+'%'};return _0x570b3b;}})});}_0x49832c=_[_0xfd5b('0x42')]({},_0x49832c,_0x16c3d0['options']);var _0x1b4cca={'where':_0x49832c['where']};return db[_0xfd5b('0x30')][_0xfd5b('0x23')](_0x1b4cca)[_0xfd5b('0x29')](function(_0x409010){_0x4a08b3[_0xfd5b('0x23')]=_0x409010;if(_0x16c3d0[_0xfd5b('0x38')][_0xfd5b('0x44')]){_0x49832c['include']=[{'all':!![]}];}return db[_0xfd5b('0x30')]['findAll'](_0x49832c);})[_0xfd5b('0x29')](function(_0x186d0a){_0x4a08b3['rows']=_0x186d0a;return _0x4a08b3;})[_0xfd5b('0x29')](respondWithFilteredResult(_0x40587a,_0x49832c))[_0xfd5b('0x45')](handleError(_0x40587a,null));};exports[_0xfd5b('0x46')]=function(_0x1aad76,_0x2cce35){var _0x3a2193={'raw':![],'where':{'id':_0x1aad76[_0xfd5b('0x47')]['id']}},_0x4b871a={};_0x4b871a['model']=_[_0xfd5b('0x48')](db[_0xfd5b('0x30')][_0xfd5b('0x31')]);_0x4b871a[_0xfd5b('0x38')]=_['keys'](_0x1aad76[_0xfd5b('0x38')]);_0x4b871a[_0xfd5b('0x36')]=_[_0xfd5b('0x37')](_0x4b871a['model'],_0x4b871a[_0xfd5b('0x38')]);_0x3a2193[_0xfd5b('0x39')]=_['intersection'](_0x4b871a[_0xfd5b('0x34')],qs[_0xfd5b('0x3a')](_0x1aad76[_0xfd5b('0x38')][_0xfd5b('0x3a')]));_0x3a2193[_0xfd5b('0x39')]=_0x3a2193[_0xfd5b('0x39')][_0xfd5b('0x3b')]?_0x3a2193[_0xfd5b('0x39')]:_0x4b871a[_0xfd5b('0x34')];if(_0x1aad76[_0xfd5b('0x38')][_0xfd5b('0x44')]){_0x3a2193[_0xfd5b('0x49')]=[{'all':!![]}];}_0x3a2193=_[_0xfd5b('0x42')]({},_0x3a2193,_0x1aad76[_0xfd5b('0x4a')]);return db[_0xfd5b('0x30')][_0xfd5b('0x4b')](_0x3a2193)[_0xfd5b('0x29')](handleEntityNotFound(_0x2cce35,null))['then'](respondWithResult(_0x2cce35,null))['catch'](handleError(_0x2cce35,null));};exports[_0xfd5b('0x4c')]=function(_0x5ed4ff,_0x2a19a5){return db[_0xfd5b('0x30')][_0xfd5b('0x4c')](_0x5ed4ff[_0xfd5b('0x4d')],{})[_0xfd5b('0x29')](respondWithResult(_0x2a19a5,0xc9))[_0xfd5b('0x45')](handleError(_0x2a19a5,null));};exports[_0xfd5b('0x28')]=function(_0x169928,_0x3e1c78){if(_0x169928[_0xfd5b('0x4d')]['id']){delete _0x169928[_0xfd5b('0x4d')]['id'];}return db[_0xfd5b('0x30')][_0xfd5b('0x4b')]({'where':{'id':_0x169928['params']['id']}})[_0xfd5b('0x29')](handleEntityNotFound(_0x3e1c78,null))['then'](saveUpdates(_0x169928[_0xfd5b('0x4d')],null))[_0xfd5b('0x29')](respondWithResult(_0x3e1c78,null))[_0xfd5b('0x45')](handleError(_0x3e1c78,null));};exports[_0xfd5b('0x4e')]=function(_0x3b7de0,_0x45c232){return db[_0xfd5b('0x30')][_0xfd5b('0x4e')]()[_0xfd5b('0x29')](respondWithResult(_0x45c232,null))[_0xfd5b('0x45')](handleError(_0x45c232,null));};exports[_0xfd5b('0x4f')]=function(_0x2f8fef,_0x24d62d,_0x4d3f91){var _0x27c0f9=require(_0xfd5b('0x50'));var _0x55b3ef=![];var _0x5ef2e7={};if(_0x2f8fef[_0xfd5b('0x38')][_0xfd5b('0x32')]&&_0x2f8fef[_0xfd5b('0x38')][_0xfd5b('0x32')]===_0xfd5b('0x51')){_0x5ef2e7[_0xfd5b('0x51')]=_0x2f8fef['params']['id'];}else{_0x5ef2e7['id']=_0x2f8fef[_0xfd5b('0x47')]['id'];}return db[_0xfd5b('0x30')]['find']({'where':_0x5ef2e7,'attributes':['id','value'],'raw':!![]})[_0xfd5b('0x29')](handleEntityNotFound(_0x24d62d,null))[_0xfd5b('0x29')](function(_0x33f38b){if(_0x33f38b){var _0x2ab8dc=_0x33f38b[_0xfd5b('0x52')];var _0x18a2eb=util['format'](_0xfd5b('0x53'),_0x2ab8dc);if(fs[_0xfd5b('0x54')](_0x18a2eb)){_0x55b3ef=!![];return _0x27c0f9[_0xfd5b('0x55')](_0x18a2eb,_0x2ab8dc,config[_0xfd5b('0x56')][_0xfd5b('0x57')])[_0xfd5b('0x29')](function(){return _0x33f38b;});}return _0x33f38b;}})['then'](function(_0x55b324){if(_0x55b324){var _0x5e5b5c=_0x55b324[_0xfd5b('0x52')];if(!fs[_0xfd5b('0x54')](_0x5e5b5c)){throw new db[(_0xfd5b('0x58'))][(_0xfd5b('0x59'))](_0xfd5b('0x5a'));}if(_0x55b324[_0xfd5b('0x5b')]){return _0x24d62d[_0xfd5b('0x4f')](_0x5e5b5c,_0x55b324[_0xfd5b('0x5b')]+path['extname'](_0x5e5b5c),function(){if(_0x55b3ef){fs[_0xfd5b('0x5c')](_0x5e5b5c);}});}else{return _0x24d62d[_0xfd5b('0x4f')](_0x5e5b5c,function(_0x71940a){if(_0x55b3ef){fs[_0xfd5b('0x5c')](_0x5e5b5c);}});}}})[_0xfd5b('0x45')](function(_0x57b56f){if(_0x57b56f[_0xfd5b('0x5d')]===_0xfd5b('0x5a')){_0x24d62d[_0xfd5b('0x1d')](0x194)[_0xfd5b('0x2d')]('Not\x20found');}else{return handleError(_0x24d62d,null);}});};exports['downloads']=function(_0x2751d2,_0x291d2e,_0x33bdbc){var _0x5d403d=require('../../components/encryptor');var _0x40c276=![];var _0x6729ee={'$and':[db[_0xfd5b('0x5e')]['where'](db[_0xfd5b('0x5e')]['fn'](_0xfd5b('0x5f'),db[_0xfd5b('0x5e')][_0xfd5b('0x60')](_0xfd5b('0x51'))),_0x2751d2['query'][_0xfd5b('0x61')])]};if(_0x2751d2[_0xfd5b('0x38')][_0xfd5b('0x32')]&&_0x2751d2[_0xfd5b('0x38')][_0xfd5b('0x32')]===_0xfd5b('0x51')){_0x6729ee[_0xfd5b('0x62')][_0xfd5b('0x63')]({'uniqueid':_0x2751d2[_0xfd5b('0x47')]['id']});}else{_0x6729ee['$and'][_0xfd5b('0x63')]({'id':_0x2751d2[_0xfd5b('0x47')]['id']});}return db[_0xfd5b('0x30')]['find']({'where':_0x6729ee,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x291d2e,null))['then'](function(_0x332c1b){if(_0x332c1b){var _0x46e976=util[_0xfd5b('0x35')](_0xfd5b('0x53'),_0x332c1b[_0xfd5b('0x52')]);if(fs[_0xfd5b('0x54')](_0x46e976)){_0x40c276=!![];return _0x5d403d['decryptFile'](_0x46e976,_0x332c1b[_0xfd5b('0x52')],config['secrets'][_0xfd5b('0x57')])['then'](function(){return _0x332c1b;});}return _0x332c1b;}})[_0xfd5b('0x29')](function(_0x472314){if(_0x472314){if(!fs[_0xfd5b('0x54')](_0x472314[_0xfd5b('0x52')])){throw new db[(_0xfd5b('0x58'))]['ValidationError'](_0xfd5b('0x5a'));}if(_0x472314[_0xfd5b('0x5b')]){return _0x291d2e['download'](_0x472314[_0xfd5b('0x52')],_0x472314['filename']+path[_0xfd5b('0x64')](_0x472314[_0xfd5b('0x52')]),function(){if(_0x40c276){fs[_0xfd5b('0x5c')](_0x472314[_0xfd5b('0x52')]);}});}else{return _0x291d2e['download'](_0x472314['value'],function(_0x47016e){if(_0x40c276){fs[_0xfd5b('0x5c')](_0x472314[_0xfd5b('0x52')]);}});}}})[_0xfd5b('0x45')](handleError(_0x291d2e,null));};exports[_0xfd5b('0x2a')]=function(_0xdf16b9,_0xd474a6){return db[_0xfd5b('0x30')][_0xfd5b('0x4b')]({'where':{'id':_0xdf16b9[_0xfd5b('0x47')]['id']}})[_0xfd5b('0x29')](function(_0x32f609){if(_[_0xfd5b('0x65')](_0x32f609)){throw new ReferenceError(_0xfd5b('0x66'));}return _0x32f609;})['then'](function(_0x43f24e){var _0x3d8edc=_0x43f24e[_0xfd5b('0x52')];logger[_0xfd5b('0x67')](_0xfd5b('0x68'),_0x3d8edc);if(!_['isNil'](_0x43f24e[_0xfd5b('0x52')])&&fs[_0xfd5b('0x54')](_0x3d8edc)){logger['info'](_0xfd5b('0x69')+_0x3d8edc+_0xfd5b('0x6a'));fs[_0xfd5b('0x6b')](_0x3d8edc);}_0x3d8edc=_0x3d8edc+_0xfd5b('0x6c');if(!_[_0xfd5b('0x65')](_0x43f24e[_0xfd5b('0x52')])&&fs[_0xfd5b('0x54')](_0x3d8edc)){logger['info']('File:\x20\x22'+_0x3d8edc+_0xfd5b('0x6a'));fs['unlinkSync'](_0x3d8edc);}return _0x43f24e;})[_0xfd5b('0x29')](function(_0x148ea3){if(!_0x148ea3)throw new InternalError();return _0x148ea3[_0xfd5b('0x2a')]();})['then'](function(){_0xd474a6[_0xfd5b('0x1d')](0xcc)[_0xfd5b('0x1e')]();})['catch'](handleError(_0xd474a6,null));};function getBucketslist(_0x5e4676,_0x570dfc,_0xce0ea3){return new Promise(function(_0x5c10ee,_0x1d7067){var _0xf6fa1d=new AWS['S3']({'accessKeyId':_0x570dfc,'secretAccessKey':_0x5e4676,'region':_0xce0ea3});_0xf6fa1d[_0xfd5b('0x6d')]({},function(_0x245077,_0x8139f3){if(_0x245077){return _0x1d7067(_0x245077);}else{return _0x5c10ee(_0x8139f3);}});});}function createBucket(_0x403301,_0x5f0ae7,_0x7cfc80,_0x4656ed){return new Promise(function(_0xec6b80,_0x7fe9b0){var _0x194fef=new AWS['S3']({'accessKeyId':_0x5f0ae7,'secretAccessKey':_0x403301,'region':_0x7cfc80});_0x194fef[_0xfd5b('0x6e')]({'Bucket':_0x4656ed},function(_0x10107f,_0x53a297){if(_0x10107f){return _0x7fe9b0(_0x10107f);}else{return _0xec6b80(_0x53a297);}});});}function uploadFile(_0x18333e,_0x44d2d5,_0x4e3765,_0x2900ec,_0x5f47ea,_0x918958){return new Promise(function(_0x4b8278,_0x5cbf7b){var _0xac8efd=new AWS['S3']({'accessKeyId':_0x44d2d5,'secretAccessKey':_0x18333e,'region':_0x4e3765});_0xac8efd[_0xfd5b('0x6f')]({'Bucket':_0x2900ec,'Key':_0x5f47ea,'Body':_0x918958},function(_0x4bca3f,_0x107db0){if(_0x4bca3f){return _0x5cbf7b(_0x4bca3f);}else{return _0x4b8278(_0x107db0);}});});}function startTranscribe(_0x23f2c6,_0x4b881e,_0x3f5d69,_0x4bac56,_0x4fb4e4,_0x51dac6){return new Promise(function(_0x2456a7,_0x5bbed4){var _0x45aaa4=new AWS[(_0xfd5b('0x70'))]({'accessKeyId':_0x4b881e,'secretAccessKey':_0x23f2c6,'region':_0x3f5d69});_0x45aaa4[_0xfd5b('0x71')]({'TranscriptionJobName':_0x4bac56,'LanguageCode':_0x4fb4e4,'Media':{'MediaFileUri':_0x51dac6}},function(_0x38eb34,_0x253026){if(_0x38eb34){return _0x5bbed4(_0x38eb34);}else{return _0x2456a7(_0x253026);}});});}function transcribe(_0x2adc1b,_0x11f0dd,_0x5769a2,_0x69e91e,_0x35095f,_0x20c256,_0x8097b0){return new Promise(function(_0x3d0da0,_0x59dcdb){var _0x14a9bd={};logger['info'](util[_0xfd5b('0x35')](_0xfd5b('0x72'),_0x2adc1b,_0x35095f));return uploadFile(_0x11f0dd,_0x5769a2,_0x69e91e,_0x35095f,path['basename'](_0x20c256),fs['readFileSync'](_0x20c256))[_0xfd5b('0x29')](function(_0x385c3e){logger[_0xfd5b('0x67')](util['format'](_0xfd5b('0x73'),_0x2adc1b,_0x35095f,_0x385c3e['Location']));_0x14a9bd[_0xfd5b('0x74')]=_0x385c3e['Bucket'];_0x14a9bd[_0xfd5b('0x75')]=_0x385c3e['Location'];logger[_0xfd5b('0x67')](util['format'](_0xfd5b('0x76'),_0x2adc1b));return startTranscribe(_0x11f0dd,_0x5769a2,_0x69e91e,uuidv4(),_0x8097b0,_0x385c3e[_0xfd5b('0x77')]);})[_0xfd5b('0x29')](function(_0x502e1b){logger['info'](util[_0xfd5b('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x2adc1b,_0x502e1b[_0xfd5b('0x78')][_0xfd5b('0x79')]));_0x14a9bd[_0xfd5b('0x7a')]=_0x502e1b[_0xfd5b('0x78')][_0xfd5b('0x79')];_0x14a9bd[_0xfd5b('0x7b')]=_0x502e1b[_0xfd5b('0x78')][_0xfd5b('0x7c')];return _0x3d0da0(_0x14a9bd);})[_0xfd5b('0x45')](function(_0x420f6d){return _0x59dcdb(_0x420f6d);});});}exports['runTranscribe']=function(_0x31a5b9,_0x471a70,_0xfc2a62){var _0x2b1c9a;var _0x5a51cd;var _0x11b648;var _0x9be635=require(_0xfd5b('0x50'));return db[_0xfd5b('0x30')]['findOne']({'where':{'id':_0x31a5b9[_0xfd5b('0x47')]['id']}})[_0xfd5b('0x29')](function(_0x2b1642){if(_0x2b1642){var _0x5e48af=util[_0xfd5b('0x35')](_0xfd5b('0x53'),_0x2b1642[_0xfd5b('0x52')]);if(fs[_0xfd5b('0x54')](_0x5e48af)){cypher=!![];return _0x9be635[_0xfd5b('0x55')](_0x5e48af,_0x2b1642[_0xfd5b('0x52')],config[_0xfd5b('0x56')][_0xfd5b('0x57')])['then'](function(){return _0x2b1642;});}return _0x2b1642;}})[_0xfd5b('0x29')](function(_0x57eaac){if(!_0x57eaac){throw new db['Sequelize'][(_0xfd5b('0x59'))](_0xfd5b('0x7d'));}_0x5a51cd=_0x57eaac;return db[_0xfd5b('0x7e')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x471a70,null))[_0xfd5b('0x29')](function(_0xebb69c){if(_0xebb69c){_0x2b1c9a=_0xebb69c;if(!_0x2b1c9a[_0xfd5b('0x7f')]||!_0x2b1c9a[_0xfd5b('0x80')]||!_0x2b1c9a['transcribeRegion']||!_0x2b1c9a['language']||!_0x2b1c9a[_0xfd5b('0x74')]){throw new db[(_0xfd5b('0x58'))][(_0xfd5b('0x59'))](_0xfd5b('0x81'));}if(_0x31a5b9[_0xfd5b('0x4d')][_0xfd5b('0x82')]&&(!_0x2b1c9a['sentiment']||!_0x2b1c9a[_0xfd5b('0x83')]||!_0x2b1c9a[_0xfd5b('0x84')]||!_0x2b1c9a['language']||!_0x2b1c9a[_0xfd5b('0x74')])){throw new db[(_0xfd5b('0x58'))]['ValidationError'](_0xfd5b('0x85'));}return db[_0xfd5b('0x86')][_0xfd5b('0x87')]({'where':{'id':_0x2b1c9a[_0xfd5b('0x80')]}});}})[_0xfd5b('0x29')](function(_0x3ec021){if(!_0x3ec021){throw new db[(_0xfd5b('0x58'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3ec021[_0xfd5b('0x88')]||!_0x3ec021[_0xfd5b('0x89')]){throw new db[(_0xfd5b('0x58'))][(_0xfd5b('0x59'))](_0xfd5b('0x8a'));}_0x11b648=_0x3ec021;return getBucketslist(_0x11b648[_0xfd5b('0x88')],_0x11b648['data2'],_0x2b1c9a[_0xfd5b('0x8b')]);})[_0xfd5b('0x29')](function(_0x43b2f2){if(_0x43b2f2&&_0x43b2f2['Buckets']){var _0x3918dd=_[_0xfd5b('0x4b')](_0x43b2f2[_0xfd5b('0x8c')],function(_0x28b540){return _0x28b540[_0xfd5b('0x8d')]===_0x2b1c9a[_0xfd5b('0x74')];});if(!_0x3918dd){logger[_0xfd5b('0x67')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x31a5b9['params']['id'],_0x2b1c9a[_0xfd5b('0x74')]));return createBucket(_0x11b648[_0xfd5b('0x88')],_0x11b648['data2'],_0x2b1c9a[_0xfd5b('0x8b')],_0x2b1c9a[_0xfd5b('0x74')]);}logger['info'](util[_0xfd5b('0x35')](_0xfd5b('0x8e'),_0x31a5b9[_0xfd5b('0x47')]['id'],_0x2b1c9a[_0xfd5b('0x74')]));return;}})[_0xfd5b('0x29')](function(_0x51836f){if(_0x5a51cd[_0xfd5b('0x7b')]===_0xfd5b('0x8f')){return transcribe(_0x31a5b9[_0xfd5b('0x47')]['id'],_0x11b648['data1'],_0x11b648['data2'],_0x2b1c9a[_0xfd5b('0x8b')],_0x2b1c9a['bucket'],_0x5a51cd['value'],_0x2b1c9a[_0xfd5b('0x90')]);}else{logger[_0xfd5b('0x67')](util[_0xfd5b('0x35')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x31a5b9['params']['id']));return{'transcribeStatus':_0xfd5b('0x91')};}})[_0xfd5b('0x29')](function(_0x3a1640){if(_0x3a1640){_0x3a1640[_0xfd5b('0x92')]=_0x31a5b9[_0xfd5b('0x4d')][_0xfd5b('0x82')];return _0x5a51cd[_0xfd5b('0x93')](_0x3a1640);}})[_0xfd5b('0x29')](respondWithResult(_0x471a70,null))[_0xfd5b('0x45')](handleError(_0x471a70,null));};function writeFile(_0x2d5af9,_0x5ee0cb){return new Promise(function(_0xe34ea5,_0x5e28ea){fs[_0xfd5b('0x94')](_0x5ee0cb,_0x2d5af9,function(_0x529adb,_0x20fdf3){if(_0x529adb){return _0x5e28ea(_0x529adb);}else{return _0xe34ea5(_0x20fdf3);}});});}exports[_0xfd5b('0x95')]=function(_0x2c8911,_0x181c9f,_0x21b12b){return db['VoiceRecording'][_0xfd5b('0x87')]({'where':{'id':_0x2c8911[_0xfd5b('0x47')]['id']}})['then'](handleEntityNotFound(_0x181c9f))[_0xfd5b('0x29')](function(_0xc2b9d7){if(_0xc2b9d7&&_0xc2b9d7[_0xfd5b('0x96')]){var _0x6e2d50=_0xc2b9d7[_0xfd5b('0x96')];var _0x52598b=config['root']+_0xfd5b('0x97')+_0xc2b9d7['id']+_0xfd5b('0x98');if(fs['existsSync'](_0x52598b)){return _0x52598b;}return writeFile(_0x6e2d50,_0x52598b)[_0xfd5b('0x29')](function(){return _0x52598b;});}else{throw new db[(_0xfd5b('0x58'))][(_0xfd5b('0x59'))](_0xfd5b('0x99'));}})[_0xfd5b('0x29')](function(_0x39168b){return _0x181c9f[_0xfd5b('0x4f')](_0x39168b);})[_0xfd5b('0x45')](handleError(_0x181c9f));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index efb4ce7..d464d7e 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 _0x27c5=['voice_recordings','uniqueid','transcribeStatus','define'];(function(_0x8ffee8,_0x4a5954){var _0x109982=function(_0x27fb14){while(--_0x27fb14){_0x8ffee8['push'](_0x8ffee8['shift']());}};_0x109982(++_0x4a5954);}(_0x27c5,0x173));var _0x527c=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x27c5[_0x1b6c6d];return _0x290d9d;};'use strict';var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x157017,_0x46cdc0){return _0x157017[_0x527c('0x0')]('VoiceRecording',attributes,{'tableName':_0x527c('0x1'),'paranoid':![],'indexes':[{'name':_0x527c('0x2'),'fields':[_0x527c('0x2')]},{'name':_0x527c('0x3'),'fields':[_0x527c('0x3')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x49e9=['transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid'];(function(_0x27402f,_0x38eb47){var _0xa2eaf1=function(_0x2d7c67){while(--_0x2d7c67){_0x27402f['push'](_0x27402f['shift']());}};_0xa2eaf1(++_0x38eb47);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var attributes=require(_0x949e('0x0'));module[_0x949e('0x1')]=function(_0x4d18e7,_0x41404c){return _0x4d18e7[_0x949e('0x2')](_0x949e('0x3'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x949e('0x4')]},{'name':'transcribeStatus','fields':[_0x949e('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index a2ec550..dda2b61 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 _0x66fa=['CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceRecording,\x20%s,\x20%s','message','catch','VoiceRecording','update','body','options','raw','where','attributes','UpdateVoiceRecording','stringify'];(function(_0x296110,_0x214375){var _0x47a5cc=function(_0x3461e5){while(--_0x3461e5){_0x296110['push'](_0x296110['shift']());}};_0x47a5cc(++_0x214375);}(_0x66fa,0x117));var _0xa66f=function(_0x35ad4e,_0x164583){_0x35ad4e=_0x35ad4e-0x0;var _0x57c148=_0x66fa[_0x35ad4e];return _0x57c148;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('VoiceRecording,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}exports['UpdateVoiceRecording']=function(_0x1cbe64){var _0x55b59d=this;return new Promise(function(_0x4a28d4,_0x2f9da2){return db[_0xa66f('0x14')][_0xa66f('0x15')](_0x1cbe64[_0xa66f('0x16')],{'raw':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x19')]||null:null,'attributes':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')][_0xa66f('0x1a')]||null:null,'limit':_0x1cbe64[_0xa66f('0x17')]?_0x1cbe64[_0xa66f('0x17')]['limit']||null:null})[_0xa66f('0xb')](function(_0xc5c82e){logger[_0xa66f('0xc')](_0xa66f('0x1b'),_0x1cbe64);logger['debug'](_0xa66f('0x1b'),_0x1cbe64,JSON[_0xa66f('0x1c')](_0xc5c82e));_0x4a28d4(_0xc5c82e);})[_0xa66f('0x13')](function(_0x16f1fa){logger['error']('UpdateVoiceRecording',_0x16f1fa[_0xa66f('0x12')],_0x1cbe64);_0x2f9da2(_0x55b59d['error'](0x1f4,_0x16f1fa[_0xa66f('0x12')]));});});};exports[_0xa66f('0x1d')]=function(_0x384164){var _0x57da7f=this;return new Promise(function(_0x4683c7,_0x1c2903){var _0x13495f=require(_0xa66f('0x1e'));var _0x17c103;return db[_0xa66f('0x1f')][_0xa66f('0x20')]({'attributes':['id',_0xa66f('0x21')],'where':{'id':0x1},'raw':!![]})[_0xa66f('0xb')](function(_0x117d03){_0x17c103=_0x117d03;return db[_0xa66f('0x14')][_0xa66f('0x22')](_0x384164[_0xa66f('0x16')]);})[_0xa66f('0xb')](function(_0x49f615){if(_0x17c103['callRecordingEncryption']&&fs[_0xa66f('0x23')](_0x49f615[_0xa66f('0x24')])){var _0x55f309=util[_0xa66f('0x25')](_0xa66f('0x26'),_0x49f615['value']);return _0x13495f[_0xa66f('0x27')](_0x49f615[_0xa66f('0x24')],_0x55f309,config[_0xa66f('0x28')][_0xa66f('0x29')])[_0xa66f('0xb')](function(){fs['unlink'](_0x49f615[_0xa66f('0x24')]);logger['info'](_0xa66f('0x2a'));return _0x49f615;});}return _0x49f615;})[_0xa66f('0xb')](function(_0x2e4dc8){logger['info'](_0xa66f('0x1d'),_0x384164);logger[_0xa66f('0x2b')]('CreateVoiceRecording',_0x384164,JSON[_0xa66f('0x1c')](_0x2e4dc8));_0x4683c7(_0x2e4dc8);})[_0xa66f('0x13')](function(_0xba9457){logger[_0xa66f('0xf')](_0xa66f('0x1d'),_0xba9457[_0xa66f('0x12')],_0x384164);_0x1c2903(_0x57da7f[_0xa66f('0xf')](0x1f4,_0xba9457[_0xa66f('0x12')]));});});}; \ No newline at end of file +var _0x955f=['randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','body','options','raw','where','attributes','limit','debug','UpdateVoiceRecording','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird'];(function(_0x5a11ce,_0x22bf95){var _0x4af3ae=function(_0x1a2516){while(--_0x1a2516){_0x5a11ce['push'](_0x5a11ce['shift']());}};_0x4af3ae(++_0x22bf95);}(_0x955f,0x1eb));var _0xf955=function(_0x594990,_0x55654a){_0x594990=_0x594990-0x0;var _0x5643da=_0x955f[_0x594990];return _0x5643da;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));var BPromise=require(_0xf955('0x3'));var rs=require(_0xf955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf955('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf955('0x6'));var config=require('../../config/environment');var jayson=require(_0xf955('0x7'));var client=jayson[_0xf955('0x8')][_0xf955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59d5b3,_0x18432f,_0x20c096){return new BPromise(function(_0x4f58fb,_0x254b38){return client[_0xf955('0xa')](_0x59d5b3,_0x20c096)[_0xf955('0xb')](function(_0x38b190){logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,_0xf955('0xe'));logger['debug'](_0xf955('0xf'),_0x18432f,'request\x20sent',JSON[_0xf955('0x10')](_0x38b190));if(_0x38b190[_0xf955('0x11')]){if(_0x38b190[_0xf955('0x11')]['code']===0x1f4){logger[_0xf955('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x18432f,_0x38b190[_0xf955('0x11')]['message']);return _0x254b38(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);return _0x4f58fb(_0x38b190[_0xf955('0x11')][_0xf955('0x12')]);}else{logger[_0xf955('0xc')](_0xf955('0xd'),_0x18432f,'request\x20sent');_0x4f58fb(_0x38b190[_0xf955('0x13')]['message']);}})[_0xf955('0x14')](function(_0x3a814f){logger[_0xf955('0x11')](_0xf955('0xd'),_0x18432f,_0x3a814f);_0x254b38(_0x3a814f);});});}exports['UpdateVoiceRecording']=function(_0x5ac6cb){var _0x1e20d1=this;return new Promise(function(_0xe6de5c,_0x3c49c0){return db['VoiceRecording'][_0xf955('0x15')](_0x5ac6cb[_0xf955('0x16')],{'raw':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x19')]||null:null,'attributes':_0x5ac6cb[_0xf955('0x17')]?_0x5ac6cb['options'][_0xf955('0x1a')]||null:null,'limit':_0x5ac6cb['options']?_0x5ac6cb[_0xf955('0x17')][_0xf955('0x1b')]||null:null})[_0xf955('0xb')](function(_0xa4ebb4){logger[_0xf955('0xc')]('UpdateVoiceRecording',_0x5ac6cb);logger[_0xf955('0x1c')](_0xf955('0x1d'),_0x5ac6cb,JSON[_0xf955('0x10')](_0xa4ebb4));_0xe6de5c(_0xa4ebb4);})[_0xf955('0x14')](function(_0x17dec2){logger[_0xf955('0x11')](_0xf955('0x1d'),_0x17dec2['message'],_0x5ac6cb);_0x3c49c0(_0x1e20d1[_0xf955('0x11')](0x1f4,_0x17dec2[_0xf955('0x12')]));});});};exports[_0xf955('0x1e')]=function(_0x406632){var _0x2dcd55=this;return new Promise(function(_0x13a86d,_0x3796f7){var _0x51f3ab=require(_0xf955('0x1f'));var _0x145098;return db[_0xf955('0x20')][_0xf955('0x21')]({'attributes':['id',_0xf955('0x22')],'where':{'id':0x1},'raw':!![]})[_0xf955('0xb')](function(_0x4d4af0){_0x145098=_0x4d4af0;return db[_0xf955('0x23')][_0xf955('0x24')](_0x406632['body']);})[_0xf955('0xb')](function(_0x2c8df1){if(_0x145098[_0xf955('0x22')]&&fs[_0xf955('0x25')](_0x2c8df1['value'])){var _0x3a951c=util['format'](_0xf955('0x26'),_0x2c8df1[_0xf955('0x27')]);return _0x51f3ab[_0xf955('0x28')](_0x2c8df1[_0xf955('0x27')],_0x3a951c,config[_0xf955('0x29')][_0xf955('0x2a')])[_0xf955('0xb')](function(){fs[_0xf955('0x2b')](_0x2c8df1['value']);logger[_0xf955('0xc')](_0xf955('0x2c'));return _0x2c8df1;});}return _0x2c8df1;})[_0xf955('0xb')](function(_0x2046c8){logger['info'](_0xf955('0x1e'),_0x406632);logger[_0xf955('0x1c')](_0xf955('0x1e'),_0x406632,JSON[_0xf955('0x10')](_0x2046c8));_0x13a86d(_0x2046c8);})[_0xf955('0x14')](function(_0x4eb2c3){logger['error']('CreateVoiceRecording',_0x4eb2c3[_0xf955('0x12')],_0x406632);_0x3796f7(_0x2dcd55[_0xf955('0x11')](0x1f4,_0x4eb2c3[_0xf955('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 96225ab..6082dc5 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 _0x007e=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','update','delete'];(function(_0x3f994d,_0x249d72){var _0x5309b4=function(_0x545307){while(--_0x545307){_0x3f994d['push'](_0x3f994d['shift']());}};_0x5309b4(++_0x249d72);}(_0x007e,0xad));var _0xe007=function(_0x116fcd,_0x207538){_0x116fcd=_0x116fcd-0x0;var _0x914264=_0x007e[_0x116fcd];return _0x914264;};'use strict';var multer=require(_0xe007('0x0'));var util=require(_0xe007('0x1'));var path=require('path');var timeout=require(_0xe007('0x2'));var express=require(_0xe007('0x3'));var router=express[_0xe007('0x4')]();var fs_extra=require(_0xe007('0x5'));var auth=require(_0xe007('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe007('0x7'));var controller=require(_0xe007('0x8'));router[_0xe007('0x9')]('/',auth[_0xe007('0xa')](),controller[_0xe007('0xb')]);router[_0xe007('0x9')](_0xe007('0xc'),auth[_0xe007('0xa')](),controller[_0xe007('0xd')]);router[_0xe007('0x9')](_0xe007('0xe'),auth[_0xe007('0xa')](),controller['show']);router['post']('/',auth[_0xe007('0xa')](),controller['create']);router['put'](_0xe007('0xe'),auth[_0xe007('0xa')](),controller[_0xe007('0xf')]);router[_0xe007('0x10')](_0xe007('0xe'),auth[_0xe007('0xa')](),controller[_0xe007('0x11')]);module[_0xe007('0x12')]=router; \ No newline at end of file +var _0xc762=['index','/describe','describe','/:id','show','post','create','put','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated'];(function(_0xedc3bf,_0x4557bc){var _0x567ee0=function(_0x335080){while(--_0x335080){_0xedc3bf['push'](_0xedc3bf['shift']());}};_0x567ee0(++_0x4557bc);}(_0xc762,0x8f));var _0x2c76=function(_0x29db25,_0x457467){_0x29db25=_0x29db25-0x0;var _0x48b1a5=_0xc762[_0x29db25];return _0x48b1a5;};'use strict';var multer=require(_0x2c76('0x0'));var util=require('util');var path=require(_0x2c76('0x1'));var timeout=require(_0x2c76('0x2'));var express=require(_0x2c76('0x3'));var router=express['Router']();var fs_extra=require(_0x2c76('0x4'));var auth=require(_0x2c76('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2c76('0x6'));var controller=require(_0x2c76('0x7'));router['get']('/',auth[_0x2c76('0x8')](),controller[_0x2c76('0x9')]);router['get'](_0x2c76('0xa'),auth[_0x2c76('0x8')](),controller[_0x2c76('0xb')]);router['get'](_0x2c76('0xc'),auth[_0x2c76('0x8')](),controller[_0x2c76('0xd')]);router[_0x2c76('0xe')]('/',auth[_0x2c76('0x8')](),controller[_0x2c76('0xf')]);router[_0x2c76('0x10')](_0x2c76('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2c76('0xc'),auth[_0x2c76('0x8')](),controller[_0x2c76('0x11')]);module[_0x2c76('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index c5e7702..358f76c 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 _0x63bf=['Yes','moment','exports','ENUM','blind','STRING'];(function(_0x232c80,_0x5bb7d5){var _0x1d29aa=function(_0x7a0eca){while(--_0x7a0eca){_0x232c80['push'](_0x232c80['shift']());}};_0x1d29aa(++_0x5bb7d5);}(_0x63bf,0x109));var _0xf63b=function(_0x21c287,_0x576a39){_0x21c287=_0x21c287-0x0;var _0x15a5e7=_0x63bf[_0x21c287];return _0x15a5e7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf63b('0x0'));module[_0xf63b('0x1')]={'type':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x3'),'attended')},'result':{'type':Sequelize[_0xf63b('0x4')]},'transfererchannel':{'type':Sequelize[_0xf63b('0x4')]},'transferercalleridnum':{'type':Sequelize[_0xf63b('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xf63b('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xf63b('0x4')]},'transferercontext':{'type':Sequelize[_0xf63b('0x4')]},'transfererexten':{'type':Sequelize[_0xf63b('0x4')]},'transfererlinkedid':{'type':Sequelize[_0xf63b('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf63b('0x4')]},'transfereecalleridname':{'type':Sequelize[_0xf63b('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf63b('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0xf63b('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0xf63b('0x4')]},'transfereecontext':{'type':Sequelize[_0xf63b('0x4')]},'transfereeexten':{'type':Sequelize[_0xf63b('0x4')]},'transfereelinkedid':{'type':Sequelize[_0xf63b('0x4')]},'isexternal':{'type':Sequelize[_0xf63b('0x2')](_0xf63b('0x5'),'No')},'context':{'type':Sequelize[_0xf63b('0x4')]},'extension':{'type':Sequelize[_0xf63b('0x4')]}}; \ No newline at end of file +var _0xf4d2=['Yes','exports','ENUM','blind','attended','STRING'];(function(_0x82247a,_0xe2498e){var _0x3df0d2=function(_0x101b45){while(--_0x101b45){_0x82247a['push'](_0x82247a['shift']());}};_0x3df0d2(++_0xe2498e);}(_0xf4d2,0x103));var _0x2f4d=function(_0x1bbfa4,_0x388934){_0x1bbfa4=_0x1bbfa4-0x0;var _0xe526d7=_0xf4d2[_0x1bbfa4];return _0xe526d7;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2f4d('0x0')]={'type':{'type':Sequelize[_0x2f4d('0x1')](_0x2f4d('0x2'),_0x2f4d('0x3'))},'result':{'type':Sequelize[_0x2f4d('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x2f4d('0x4')]},'transferercalleridname':{'type':Sequelize[_0x2f4d('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x2f4d('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x2f4d('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x2f4d('0x4')]},'transfereechannel':{'type':Sequelize[_0x2f4d('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x2f4d('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x2f4d('0x4')]},'transfereecontext':{'type':Sequelize[_0x2f4d('0x4')]},'transfereeexten':{'type':Sequelize[_0x2f4d('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x2f4d('0x1')](_0x2f4d('0x5'),'No')},'context':{'type':Sequelize[_0x2f4d('0x4')]},'extension':{'type':Sequelize[_0x2f4d('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b5e2515..dd7c654 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 _0xe12e=['type','includeAll','findAll','rows','catch','show','params','include','options','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','save','update','destroy','then','error','stack','name','map','VoiceTransferReport','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x3febf9,_0x196358){var _0x19c2f7=function(_0x5202b8){while(--_0x5202b8){_0x3febf9['push'](_0x3febf9['shift']());}};_0x19c2f7(++_0x196358);}(_0xe12e,0x129));var _0xee12=function(_0x3addde,_0x251294){_0x3addde=_0x3addde-0x0;var _0x55364e=_0xe12e[_0x3addde];return _0x55364e;};'use strict';var emlformat=require(_0xee12('0x0'));var rimraf=require(_0xee12('0x1'));var zipdir=require(_0xee12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee12('0x3'));var moment=require(_0xee12('0x4'));var BPromise=require(_0xee12('0x5'));var Mustache=require(_0xee12('0x6'));var util=require(_0xee12('0x7'));var path=require('path');var sox=require(_0xee12('0x8'));var csv=require(_0xee12('0x9'));var ejs=require(_0xee12('0xa'));var fs=require('fs');var fs_extra=require(_0xee12('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xee12('0xc'));var jsforce=require(_0xee12('0xd'));var deskjs=require(_0xee12('0xe'));var toCsv=require('to-csv');var querystring=require(_0xee12('0xf'));var Papa=require(_0xee12('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee12('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xee12('0x12'))('api');var utils=require(_0xee12('0x13'));var config=require(_0xee12('0x14'));var licenseUtil=require(_0xee12('0x15'));var db=require(_0xee12('0x16'))['db'];function respondWithStatusCode(_0x204039,_0x5aaecd){_0x5aaecd=_0x5aaecd||0xcc;return function(_0x25fb85){if(_0x25fb85){return _0x204039[_0xee12('0x17')](_0x5aaecd);}return _0x204039['status'](_0x5aaecd)[_0xee12('0x18')]();};}function respondWithResult(_0x5c1dd3,_0x51dde2){_0x51dde2=_0x51dde2||0xc8;return function(_0x38ae60){if(_0x38ae60){return _0x5c1dd3[_0xee12('0x19')](_0x51dde2)[_0xee12('0x1a')](_0x38ae60);}};}function respondWithFilteredResult(_0x3286b1,_0x124fd6){return function(_0x12ded7){if(_0x12ded7){var _0xf0cd0b=typeof _0x124fd6[_0xee12('0x1b')]==='undefined'&&typeof _0x124fd6[_0xee12('0x1c')]===_0xee12('0x1d');var _0x4cc9c8=_0x12ded7['count'];var _0x417ca5=_0xf0cd0b?0x0:_0x124fd6[_0xee12('0x1b')];var _0x59fece=_0xf0cd0b?_0x12ded7[_0xee12('0x1e')]:_0x124fd6['offset']+_0x124fd6[_0xee12('0x1c')];var _0x33ac6c;if(_0x59fece>=_0x4cc9c8){_0x59fece=_0x4cc9c8;_0x33ac6c=0xc8;}else{_0x33ac6c=0xce;}_0x3286b1['status'](_0x33ac6c);return _0x3286b1[_0xee12('0x1f')]('Content-Range',_0x417ca5+'-'+_0x59fece+'/'+_0x4cc9c8)[_0xee12('0x1a')](_0x12ded7);}return null;};}function patchUpdates(_0x2c01fb){return function(_0x18a555){try{jsonpatch['apply'](_0x18a555,_0x2c01fb,!![]);}catch(_0x4dfa4e){return BPromise[_0xee12('0x20')](_0x4dfa4e);}return _0x18a555[_0xee12('0x21')]();};}function saveUpdates(_0x30b40e,_0x4e945d){return function(_0x18655a){if(_0x18655a){return _0x18655a[_0xee12('0x22')](_0x30b40e)['then'](function(_0x357e89){return _0x357e89;});}return null;};}function removeEntity(_0x2c72c7,_0x42a9d7){return function(_0x680d2){if(_0x680d2){return _0x680d2[_0xee12('0x23')]()[_0xee12('0x24')](function(){_0x2c72c7[_0xee12('0x19')](0xcc)[_0xee12('0x18')]();});}};}function handleEntityNotFound(_0x13ad54,_0x29e257){return function(_0x4090a8){if(!_0x4090a8){_0x13ad54[_0xee12('0x17')](0x194);}return _0x4090a8;};}function handleError(_0x3eb550,_0x50fc59){_0x50fc59=_0x50fc59||0x1f4;return function(_0x484c52){logger[_0xee12('0x25')](_0x484c52[_0xee12('0x26')]);if(_0x484c52[_0xee12('0x27')]){delete _0x484c52['name'];}_0x3eb550['status'](_0x50fc59)['send'](_0x484c52);};}exports['index']=function(_0x186b82,_0x514c2e){var _0x3fd710={},_0x285a6e={},_0x22db61={'count':0x0,'rows':[]};var _0x132b0a=_[_0xee12('0x28')](db[_0xee12('0x29')][_0xee12('0x2a')],function(_0x5b4f50){return{'name':_0x5b4f50['fieldName'],'type':_0x5b4f50['type']['key']};});_0x285a6e[_0xee12('0x2b')]=_[_0xee12('0x28')](_0x132b0a,'name');_0x285a6e[_0xee12('0x2c')]=_[_0xee12('0x2d')](_0x186b82[_0xee12('0x2c')]);_0x285a6e[_0xee12('0x2e')]=_['intersection'](_0x285a6e[_0xee12('0x2b')],_0x285a6e[_0xee12('0x2c')]);_0x3fd710[_0xee12('0x2f')]=_[_0xee12('0x30')](_0x285a6e[_0xee12('0x2b')],qs['fields'](_0x186b82[_0xee12('0x2c')][_0xee12('0x31')]));_0x3fd710[_0xee12('0x2f')]=_0x3fd710[_0xee12('0x2f')][_0xee12('0x32')]?_0x3fd710['attributes']:_0x285a6e['model'];if(!_0x186b82[_0xee12('0x2c')][_0xee12('0x33')](_0xee12('0x34'))){_0x3fd710['limit']=qs[_0xee12('0x1c')](_0x186b82[_0xee12('0x2c')]['limit']);_0x3fd710[_0xee12('0x1b')]=qs['offset'](_0x186b82['query'][_0xee12('0x1b')]);}_0x3fd710[_0xee12('0x35')]=qs['sort'](_0x186b82[_0xee12('0x2c')][_0xee12('0x36')]);_0x3fd710[_0xee12('0x37')]=qs[_0xee12('0x2e')](_[_0xee12('0x38')](_0x186b82[_0xee12('0x2c')],_0x285a6e[_0xee12('0x2e')]),_0x132b0a);if(_0x186b82[_0xee12('0x2c')]['filter']){_0x3fd710['where']=_[_0xee12('0x39')](_0x3fd710[_0xee12('0x37')],{'$or':_[_0xee12('0x28')](_0x132b0a,function(_0x496fe5){if(_0x496fe5[_0xee12('0x3a')]!=='VIRTUAL'){var _0x612eab={};_0x612eab[_0x496fe5[_0xee12('0x27')]]={'$like':'%'+_0x186b82[_0xee12('0x2c')]['filter']+'%'};return _0x612eab;}})});}_0x3fd710=_[_0xee12('0x39')]({},_0x3fd710,_0x186b82['options']);var _0x3683a4={'where':_0x3fd710[_0xee12('0x37')]};return db[_0xee12('0x29')][_0xee12('0x1e')](_0x3683a4)[_0xee12('0x24')](function(_0x5755c4){_0x22db61[_0xee12('0x1e')]=_0x5755c4;if(_0x186b82[_0xee12('0x2c')][_0xee12('0x3b')]){_0x3fd710['include']=[{'all':!![]}];}return db[_0xee12('0x29')][_0xee12('0x3c')](_0x3fd710);})[_0xee12('0x24')](function(_0x40820c){_0x22db61[_0xee12('0x3d')]=_0x40820c;return _0x22db61;})[_0xee12('0x24')](respondWithFilteredResult(_0x514c2e,_0x3fd710))[_0xee12('0x3e')](handleError(_0x514c2e,null));};exports[_0xee12('0x3f')]=function(_0x328b1c,_0x37ccd4){var _0x4fd400={'raw':!![],'where':{'id':_0x328b1c[_0xee12('0x40')]['id']}},_0x5b4572={};_0x5b4572['model']=_[_0xee12('0x2d')](db[_0xee12('0x29')]['rawAttributes']);_0x5b4572[_0xee12('0x2c')]=_[_0xee12('0x2d')](_0x328b1c[_0xee12('0x2c')]);_0x5b4572['filters']=_[_0xee12('0x30')](_0x5b4572['model'],_0x5b4572[_0xee12('0x2c')]);_0x4fd400[_0xee12('0x2f')]=_['intersection'](_0x5b4572[_0xee12('0x2b')],qs['fields'](_0x328b1c[_0xee12('0x2c')][_0xee12('0x31')]));_0x4fd400[_0xee12('0x2f')]=_0x4fd400[_0xee12('0x2f')][_0xee12('0x32')]?_0x4fd400[_0xee12('0x2f')]:_0x5b4572['model'];if(_0x328b1c[_0xee12('0x2c')][_0xee12('0x3b')]){_0x4fd400[_0xee12('0x41')]=[{'all':!![]}];}_0x4fd400=_[_0xee12('0x39')]({},_0x4fd400,_0x328b1c[_0xee12('0x42')]);return db['VoiceTransferReport']['find'](_0x4fd400)[_0xee12('0x24')](handleEntityNotFound(_0x37ccd4,null))[_0xee12('0x24')](respondWithResult(_0x37ccd4,null))[_0xee12('0x3e')](handleError(_0x37ccd4,null));};exports['create']=function(_0x5d36e4,_0x48c385){return db[_0xee12('0x29')][_0xee12('0x43')](_0x5d36e4[_0xee12('0x44')],{})[_0xee12('0x24')](respondWithResult(_0x48c385,0xc9))['catch'](handleError(_0x48c385,null));};exports[_0xee12('0x22')]=function(_0x4e359e,_0x5c75e7){if(_0x4e359e[_0xee12('0x44')]['id']){delete _0x4e359e[_0xee12('0x44')]['id'];}return db['VoiceTransferReport'][_0xee12('0x45')]({'where':{'id':_0x4e359e[_0xee12('0x40')]['id']}})['then'](handleEntityNotFound(_0x5c75e7,null))['then'](saveUpdates(_0x4e359e[_0xee12('0x44')],null))[_0xee12('0x24')](respondWithResult(_0x5c75e7,null))[_0xee12('0x3e')](handleError(_0x5c75e7,null));};exports[_0xee12('0x23')]=function(_0xd57b8,_0x110328){return db['VoiceTransferReport'][_0xee12('0x45')]({'where':{'id':_0xd57b8[_0xee12('0x40')]['id']}})[_0xee12('0x24')](handleEntityNotFound(_0x110328,null))[_0xee12('0x24')](removeEntity(_0x110328,null))[_0xee12('0x3e')](handleError(_0x110328,null));};exports[_0xee12('0x46')]=function(_0x304d8a,_0x379aab){return db[_0xee12('0x29')][_0xee12('0x46')]()['then'](respondWithResult(_0x379aab,null))['catch'](handleError(_0x379aab,null));}; \ No newline at end of file +var _0xc9bd=['querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','error','name','send','index','VoiceTransferReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','nolimit','sort','pick','filter','where','merge','map','type','VIRTUAL','include','rows','show','params','keys','length','includeAll','options','find','create','body','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc9bd,0x87));var _0xdc9b=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0xc9bd[_0xf0bc07];return _0x1c50c2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc9b('0x0'));var zipdir=require(_0xdc9b('0x1'));var jsonpatch=require(_0xdc9b('0x2'));var rp=require(_0xdc9b('0x3'));var moment=require(_0xdc9b('0x4'));var BPromise=require(_0xdc9b('0x5'));var Mustache=require(_0xdc9b('0x6'));var util=require(_0xdc9b('0x7'));var path=require('path');var sox=require(_0xdc9b('0x8'));var csv=require(_0xdc9b('0x9'));var ejs=require(_0xdc9b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdc9b('0xb'));var crypto=require(_0xdc9b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdc9b('0x9'));var querystring=require(_0xdc9b('0xd'));var Papa=require(_0xdc9b('0xe'));var Redis=require(_0xdc9b('0xf'));var authService=require(_0xdc9b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdc9b('0x11'));var logger=require(_0xdc9b('0x12'))('api');var utils=require(_0xdc9b('0x13'));var config=require(_0xdc9b('0x14'));var licenseUtil=require(_0xdc9b('0x15'));var db=require(_0xdc9b('0x16'))['db'];function respondWithStatusCode(_0x268ebd,_0x2d0a29){_0x2d0a29=_0x2d0a29||0xcc;return function(_0x580189){if(_0x580189){return _0x268ebd[_0xdc9b('0x17')](_0x2d0a29);}return _0x268ebd['status'](_0x2d0a29)[_0xdc9b('0x18')]();};}function respondWithResult(_0x2afed8,_0x520afc){_0x520afc=_0x520afc||0xc8;return function(_0x5006b8){if(_0x5006b8){return _0x2afed8['status'](_0x520afc)[_0xdc9b('0x19')](_0x5006b8);}};}function respondWithFilteredResult(_0x245fa5,_0x348cec){return function(_0x48e8ef){if(_0x48e8ef){var _0x28b7c4=typeof _0x348cec[_0xdc9b('0x1a')]===_0xdc9b('0x1b')&&typeof _0x348cec[_0xdc9b('0x1c')]===_0xdc9b('0x1b');var _0x58b6f0=_0x48e8ef['count'];var _0x5fea97=_0x28b7c4?0x0:_0x348cec[_0xdc9b('0x1a')];var _0x26d7e0=_0x28b7c4?_0x48e8ef[_0xdc9b('0x1d')]:_0x348cec['offset']+_0x348cec[_0xdc9b('0x1c')];var _0x3fe9f1;if(_0x26d7e0>=_0x58b6f0){_0x26d7e0=_0x58b6f0;_0x3fe9f1=0xc8;}else{_0x3fe9f1=0xce;}_0x245fa5[_0xdc9b('0x1e')](_0x3fe9f1);return _0x245fa5['set'](_0xdc9b('0x1f'),_0x5fea97+'-'+_0x26d7e0+'/'+_0x58b6f0)[_0xdc9b('0x19')](_0x48e8ef);}return null;};}function patchUpdates(_0x32ef81){return function(_0x58b70a){try{jsonpatch[_0xdc9b('0x20')](_0x58b70a,_0x32ef81,!![]);}catch(_0x12d7de){return BPromise[_0xdc9b('0x21')](_0x12d7de);}return _0x58b70a[_0xdc9b('0x22')]();};}function saveUpdates(_0x1c974d,_0x3ac8b3){return function(_0x305f2d){if(_0x305f2d){return _0x305f2d[_0xdc9b('0x23')](_0x1c974d)[_0xdc9b('0x24')](function(_0x3d073d){return _0x3d073d;});}return null;};}function removeEntity(_0x3472a4,_0x2e189f){return function(_0x583eae){if(_0x583eae){return _0x583eae['destroy']()[_0xdc9b('0x24')](function(){_0x3472a4[_0xdc9b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x508559,_0x131219){return function(_0x32cd7d){if(!_0x32cd7d){_0x508559[_0xdc9b('0x17')](0x194);}return _0x32cd7d;};}function handleError(_0x42c0c8,_0x197a02){_0x197a02=_0x197a02||0x1f4;return function(_0x4fdd93){logger[_0xdc9b('0x25')](_0x4fdd93['stack']);if(_0x4fdd93['name']){delete _0x4fdd93[_0xdc9b('0x26')];}_0x42c0c8[_0xdc9b('0x1e')](_0x197a02)[_0xdc9b('0x27')](_0x4fdd93);};}exports[_0xdc9b('0x28')]=function(_0x1436d8,_0x2fd594){var _0x3cde36={},_0x5e0053={},_0x497d5c={'count':0x0,'rows':[]};var _0xab383b=_['map'](db[_0xdc9b('0x29')][_0xdc9b('0x2a')],function(_0x379ae7){return{'name':_0x379ae7[_0xdc9b('0x2b')],'type':_0x379ae7['type'][_0xdc9b('0x2c')]};});_0x5e0053[_0xdc9b('0x2d')]=_['map'](_0xab383b,_0xdc9b('0x26'));_0x5e0053[_0xdc9b('0x2e')]=_['keys'](_0x1436d8[_0xdc9b('0x2e')]);_0x5e0053[_0xdc9b('0x2f')]=_['intersection'](_0x5e0053[_0xdc9b('0x2d')],_0x5e0053[_0xdc9b('0x2e')]);_0x3cde36[_0xdc9b('0x30')]=_[_0xdc9b('0x31')](_0x5e0053[_0xdc9b('0x2d')],qs[_0xdc9b('0x32')](_0x1436d8[_0xdc9b('0x2e')][_0xdc9b('0x32')]));_0x3cde36[_0xdc9b('0x30')]=_0x3cde36['attributes']['length']?_0x3cde36[_0xdc9b('0x30')]:_0x5e0053[_0xdc9b('0x2d')];if(!_0x1436d8[_0xdc9b('0x2e')]['hasOwnProperty'](_0xdc9b('0x33'))){_0x3cde36[_0xdc9b('0x1c')]=qs[_0xdc9b('0x1c')](_0x1436d8[_0xdc9b('0x2e')][_0xdc9b('0x1c')]);_0x3cde36[_0xdc9b('0x1a')]=qs['offset'](_0x1436d8[_0xdc9b('0x2e')][_0xdc9b('0x1a')]);}_0x3cde36['order']=qs['sort'](_0x1436d8['query'][_0xdc9b('0x34')]);_0x3cde36['where']=qs[_0xdc9b('0x2f')](_[_0xdc9b('0x35')](_0x1436d8[_0xdc9b('0x2e')],_0x5e0053['filters']),_0xab383b);if(_0x1436d8[_0xdc9b('0x2e')][_0xdc9b('0x36')]){_0x3cde36[_0xdc9b('0x37')]=_[_0xdc9b('0x38')](_0x3cde36['where'],{'$or':_[_0xdc9b('0x39')](_0xab383b,function(_0x20743f){if(_0x20743f[_0xdc9b('0x3a')]!==_0xdc9b('0x3b')){var _0xae90fc={};_0xae90fc[_0x20743f[_0xdc9b('0x26')]]={'$like':'%'+_0x1436d8[_0xdc9b('0x2e')][_0xdc9b('0x36')]+'%'};return _0xae90fc;}})});}_0x3cde36=_[_0xdc9b('0x38')]({},_0x3cde36,_0x1436d8['options']);var _0x32fd70={'where':_0x3cde36[_0xdc9b('0x37')]};return db['VoiceTransferReport']['count'](_0x32fd70)[_0xdc9b('0x24')](function(_0x3f92ed){_0x497d5c[_0xdc9b('0x1d')]=_0x3f92ed;if(_0x1436d8['query']['includeAll']){_0x3cde36[_0xdc9b('0x3c')]=[{'all':!![]}];}return db['VoiceTransferReport']['findAll'](_0x3cde36);})[_0xdc9b('0x24')](function(_0x8eb711){_0x497d5c[_0xdc9b('0x3d')]=_0x8eb711;return _0x497d5c;})[_0xdc9b('0x24')](respondWithFilteredResult(_0x2fd594,_0x3cde36))['catch'](handleError(_0x2fd594,null));};exports[_0xdc9b('0x3e')]=function(_0x4758b5,_0xfe7db2){var _0x3d92cc={'raw':!![],'where':{'id':_0x4758b5[_0xdc9b('0x3f')]['id']}},_0x1e7e0f={};_0x1e7e0f['model']=_[_0xdc9b('0x40')](db[_0xdc9b('0x29')]['rawAttributes']);_0x1e7e0f[_0xdc9b('0x2e')]=_[_0xdc9b('0x40')](_0x4758b5[_0xdc9b('0x2e')]);_0x1e7e0f[_0xdc9b('0x2f')]=_['intersection'](_0x1e7e0f[_0xdc9b('0x2d')],_0x1e7e0f[_0xdc9b('0x2e')]);_0x3d92cc[_0xdc9b('0x30')]=_[_0xdc9b('0x31')](_0x1e7e0f[_0xdc9b('0x2d')],qs[_0xdc9b('0x32')](_0x4758b5['query']['fields']));_0x3d92cc['attributes']=_0x3d92cc[_0xdc9b('0x30')][_0xdc9b('0x41')]?_0x3d92cc[_0xdc9b('0x30')]:_0x1e7e0f[_0xdc9b('0x2d')];if(_0x4758b5[_0xdc9b('0x2e')][_0xdc9b('0x42')]){_0x3d92cc[_0xdc9b('0x3c')]=[{'all':!![]}];}_0x3d92cc=_['merge']({},_0x3d92cc,_0x4758b5[_0xdc9b('0x43')]);return db['VoiceTransferReport'][_0xdc9b('0x44')](_0x3d92cc)['then'](handleEntityNotFound(_0xfe7db2,null))['then'](respondWithResult(_0xfe7db2,null))['catch'](handleError(_0xfe7db2,null));};exports[_0xdc9b('0x45')]=function(_0x431332,_0x48bf7f){return db[_0xdc9b('0x29')]['create'](_0x431332[_0xdc9b('0x46')],{})[_0xdc9b('0x24')](respondWithResult(_0x48bf7f,0xc9))[_0xdc9b('0x47')](handleError(_0x48bf7f,null));};exports[_0xdc9b('0x23')]=function(_0x10e39a,_0x5ceb10){if(_0x10e39a[_0xdc9b('0x46')]['id']){delete _0x10e39a['body']['id'];}return db['VoiceTransferReport'][_0xdc9b('0x44')]({'where':{'id':_0x10e39a['params']['id']}})[_0xdc9b('0x24')](handleEntityNotFound(_0x5ceb10,null))[_0xdc9b('0x24')](saveUpdates(_0x10e39a['body'],null))[_0xdc9b('0x24')](respondWithResult(_0x5ceb10,null))[_0xdc9b('0x47')](handleError(_0x5ceb10,null));};exports[_0xdc9b('0x48')]=function(_0x227f5c,_0x622967){return db[_0xdc9b('0x29')]['find']({'where':{'id':_0x227f5c['params']['id']}})['then'](handleEntityNotFound(_0x622967,null))[_0xdc9b('0x24')](removeEntity(_0x622967,null))[_0xdc9b('0x47')](handleError(_0x622967,null));};exports[_0xdc9b('0x49')]=function(_0x1760f8,_0x573e93){return db['VoiceTransferReport'][_0xdc9b('0x49')]()[_0xdc9b('0x24')](respondWithResult(_0x573e93,null))[_0xdc9b('0x47')](handleError(_0x573e93,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1a4bb89..41e789e 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 _0xb13b=['./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xb13b,0x122));var _0xbb13=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb13b[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xbb13('0x0'));var util=require('util');var logger=require(_0xbb13('0x1'))('api');var moment=require(_0xbb13('0x2'));var BPromise=require(_0xbb13('0x3'));var rp=require(_0xbb13('0x4'));var fs=require('fs');var path=require(_0xbb13('0x5'));var rimraf=require('rimraf');var config=require(_0xbb13('0x6'));var attributes=require(_0xbb13('0x7'));module[_0xbb13('0x8')]=function(_0x6fe38b,_0x1c4c4e){return _0x6fe38b[_0xbb13('0x9')]('VoiceTransferReport',attributes,{'tableName':_0xbb13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5eac=['moment','request-promise','rimraf','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','util','../../config/logger'];(function(_0x19e574,_0x25d02f){var _0x22b768=function(_0x36b103){while(--_0x36b103){_0x19e574['push'](_0x19e574['shift']());}};_0x22b768(++_0x25d02f);}(_0x5eac,0x198));var _0xc5ea=function(_0x5baa19,_0x3d2cd1){_0x5baa19=_0x5baa19-0x0;var _0x2a1020=_0x5eac[_0x5baa19];return _0x2a1020;};'use strict';var _=require('lodash');var util=require(_0xc5ea('0x0'));var logger=require(_0xc5ea('0x1'))('api');var moment=require(_0xc5ea('0x2'));var BPromise=require('bluebird');var rp=require(_0xc5ea('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5ea('0x4'));var config=require(_0xc5ea('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0xc5ea('0x6')]=function(_0x235bab,_0x13cfd8){return _0x235bab[_0xc5ea('0x7')](_0xc5ea('0x8'),attributes,{'tableName':_0xc5ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index cd44d47..fd997fb 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 _0x53f4=['VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceTransferReport','create','body','options','raw','then','CreateVoiceTransferReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x314294,_0x2ab1ae){var _0xbecc35=function(_0x2d6f4c){while(--_0x2d6f4c){_0x314294['push'](_0x314294['shift']());}};_0xbecc35(++_0x2ab1ae);}(_0x53f4,0xbd));var _0x453f=function(_0x4aefb9,_0x55959c){_0x4aefb9=_0x4aefb9-0x0;var _0x3152dc=_0x53f4[_0x4aefb9];return _0x3152dc;};'use strict';var _=require('lodash');var util=require(_0x453f('0x0'));var moment=require(_0x453f('0x1'));var BPromise=require(_0x453f('0x2'));var rs=require(_0x453f('0x3'));var fs=require('fs');var Redis=require(_0x453f('0x4'));var db=require(_0x453f('0x5'))['db'];var utils=require(_0x453f('0x6'));var logger=require(_0x453f('0x7'))(_0x453f('0x8'));var config=require('../../config/environment');var jayson=require(_0x453f('0x9'));var client=jayson[_0x453f('0xa')][_0x453f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28dc2a,_0x3b24ad,_0x4215f8){return new BPromise(function(_0x12294d,_0x1c77c9){return client[_0x453f('0xc')](_0x28dc2a,_0x4215f8)['then'](function(_0x9dd979){logger[_0x453f('0xd')](_0x453f('0xe'),_0x3b24ad,_0x453f('0xf'));logger['debug'](_0x453f('0x10'),_0x3b24ad,_0x453f('0xf'),JSON[_0x453f('0x11')](_0x9dd979));if(_0x9dd979[_0x453f('0x12')]){if(_0x9dd979[_0x453f('0x12')]['code']===0x1f4){logger[_0x453f('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x3b24ad,_0x9dd979[_0x453f('0x12')][_0x453f('0x13')]);return _0x1c77c9(_0x9dd979[_0x453f('0x12')][_0x453f('0x13')]);}logger['error'](_0x453f('0xe'),_0x3b24ad,_0x9dd979[_0x453f('0x12')]['message']);return _0x12294d(_0x9dd979[_0x453f('0x12')][_0x453f('0x13')]);}else{logger[_0x453f('0xd')](_0x453f('0xe'),_0x3b24ad,'request\x20sent');_0x12294d(_0x9dd979[_0x453f('0x14')][_0x453f('0x13')]);}})[_0x453f('0x15')](function(_0xf50632){logger[_0x453f('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x3b24ad,_0xf50632);_0x1c77c9(_0xf50632);});});}exports['CreateVoiceTransferReport']=function(_0x5c63ad){var _0x260f9e=this;return new Promise(function(_0x3ce80d,_0x1eae4b){return db[_0x453f('0x16')][_0x453f('0x17')](_0x5c63ad[_0x453f('0x18')],{'raw':_0x5c63ad[_0x453f('0x19')]?_0x5c63ad['options'][_0x453f('0x1a')]===undefined?!![]:![]:!![]})[_0x453f('0x1b')](function(_0x344483){logger[_0x453f('0xd')](_0x453f('0x1c'),_0x5c63ad);logger['debug'](_0x453f('0x1c'),_0x5c63ad,JSON['stringify'](_0x344483));_0x3ce80d(_0x344483);})[_0x453f('0x15')](function(_0x3f53aa){logger[_0x453f('0x12')](_0x453f('0x1c'),_0x3f53aa[_0x453f('0x13')],_0x5c63ad);_0x1eae4b(_0x260f9e[_0x453f('0x12')](0x1f4,_0x3f53aa['message']));});});}; \ No newline at end of file +var _0x0246=['jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','stringify','util','moment','bluebird','ioredis','../../config/environment'];(function(_0x1d81c2,_0x7a8e60){var _0x11d059=function(_0x5511b0){while(--_0x5511b0){_0x1d81c2['push'](_0x1d81c2['shift']());}};_0x11d059(++_0x7a8e60);}(_0x0246,0x1de));var _0x6024=function(_0x36301c,_0x44d88e){_0x36301c=_0x36301c-0x0;var _0xadef0d=_0x0246[_0x36301c];return _0xadef0d;};'use strict';var _=require('lodash');var util=require(_0x6024('0x0'));var moment=require(_0x6024('0x1'));var BPromise=require(_0x6024('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6024('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6024('0x4'));var jayson=require(_0x6024('0x5'));var client=jayson[_0x6024('0x6')][_0x6024('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1d3256,_0x101c95,_0x479d7c){return new BPromise(function(_0x30e29f,_0x15d207){return client[_0x6024('0x8')](_0x1d3256,_0x479d7c)[_0x6024('0x9')](function(_0x370a7b){logger[_0x6024('0xa')](_0x6024('0xb'),_0x101c95,_0x6024('0xc'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x101c95,_0x6024('0xc'),JSON['stringify'](_0x370a7b));if(_0x370a7b[_0x6024('0xd')]){if(_0x370a7b[_0x6024('0xd')]['code']===0x1f4){logger[_0x6024('0xd')](_0x6024('0xb'),_0x101c95,_0x370a7b['error']['message']);return _0x15d207(_0x370a7b[_0x6024('0xd')][_0x6024('0xe')]);}logger['error'](_0x6024('0xb'),_0x101c95,_0x370a7b[_0x6024('0xd')][_0x6024('0xe')]);return _0x30e29f(_0x370a7b[_0x6024('0xd')]['message']);}else{logger[_0x6024('0xa')](_0x6024('0xb'),_0x101c95,'request\x20sent');_0x30e29f(_0x370a7b[_0x6024('0xf')][_0x6024('0xe')]);}})[_0x6024('0x10')](function(_0x1b030f){logger[_0x6024('0xd')](_0x6024('0xb'),_0x101c95,_0x1b030f);_0x15d207(_0x1b030f);});});}exports[_0x6024('0x11')]=function(_0x5f4938){var _0x181419=this;return new Promise(function(_0x4aaf70,_0x4b1390){return db[_0x6024('0x12')][_0x6024('0x13')](_0x5f4938[_0x6024('0x14')],{'raw':_0x5f4938[_0x6024('0x15')]?_0x5f4938['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bdf67){logger[_0x6024('0xa')](_0x6024('0x11'),_0x5f4938);logger['debug'](_0x6024('0x11'),_0x5f4938,JSON[_0x6024('0x16')](_0x4bdf67));_0x4aaf70(_0x4bdf67);})[_0x6024('0x10')](function(_0x2ea671){logger[_0x6024('0xd')](_0x6024('0x11'),_0x2ea671['message'],_0x5f4938);_0x4b1390(_0x181419[_0x6024('0xd')](0x1f4,_0x2ea671[_0x6024('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index dc93b89..f110859 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 _0x9f62=['/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','hold','/calls','/transfer','transfer','exports','Router','./webbar.controller','post','/originate','originate'];(function(_0x4a0c62,_0x27b244){var _0x3d8cf0=function(_0x57f803){while(--_0x57f803){_0x4a0c62['push'](_0x4a0c62['shift']());}};_0x3d8cf0(++_0x27b244);}(_0x9f62,0x154));var _0x29f6=function(_0x30a3a6,_0xa67cc5){_0x30a3a6=_0x30a3a6-0x0;var _0x3920b9=_0x9f62[_0x30a3a6];return _0x3920b9;};'use strict';var express=require('express');var router=express[_0x29f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x29f6('0x1'));router[_0x29f6('0x2')](_0x29f6('0x3'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x29f6('0x4')]);router[_0x29f6('0x2')](_0x29f6('0x5'),auth[_0x29f6('0x6')](),auth['isWebrtcLicence'](),controller[_0x29f6('0x7')]);router[_0x29f6('0x2')](_0x29f6('0x8'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['answer']);router['post']('/hold',auth['isAuthenticated'](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xa')]);router['post']('/unhold',auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['unhold']);router[_0x29f6('0x2')](_0x29f6('0xb'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['calls']);router['post'](_0x29f6('0xc'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xd')]);module[_0x29f6('0xe')]=router; \ No newline at end of file +var _0xf3cd=['/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','isAuthenticated','hangup','/answer','answer'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0xf3cd[_0x1bbc08];return _0x5d825b;};'use strict';var express=require(_0xdf3c('0x0'));var router=express[_0xdf3c('0x1')]();var auth=require(_0xdf3c('0x2'));var controller=require(_0xdf3c('0x3'));router[_0xdf3c('0x4')](_0xdf3c('0x5'),auth['isAuthenticated'](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x7')]);router[_0xdf3c('0x4')]('/hangup',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0x9')]);router[_0xdf3c('0x4')](_0xdf3c('0xa'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xb')]);router['post']('/hold',auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller['hold']);router[_0xdf3c('0x4')](_0xdf3c('0xc'),auth[_0xdf3c('0x8')](),auth[_0xdf3c('0x6')](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0x4')](_0xdf3c('0xe'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x4')](_0xdf3c('0x10'),auth[_0xdf3c('0x8')](),auth['isWebrtcLicence'](),controller[_0xdf3c('0x11')]);module[_0xdf3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index afa4cac..e612149 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 _0x2121=['string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','send','request','then','message','catch','User','findOne','agent','VoiceChannels','all','filter','rows','sessionId','sessionId\x20','originate','originate\x20fired:','body','validate','length','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','jayson/promise','client','http','webbarapi','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required'];(function(_0x580d82,_0x384529){var _0x509125=function(_0x4d1e1e){while(--_0x4d1e1e){_0x580d82['push'](_0x580d82['shift']());}};_0x509125(++_0x384529);}(_0x2121,0x1b4));var _0x1212=function(_0x4dceaa,_0x478997){_0x4dceaa=_0x4dceaa-0x0;var _0x120034=_0x2121[_0x4dceaa];return _0x120034;};'use strict';var path=require(_0x1212('0x0'));var fs=require('fs');var _=require(_0x1212('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0x1212('0x2'));var BPromise=require(_0x1212('0x3'));var jayson=require(_0x1212('0x4'));var amiClient=jayson[_0x1212('0x5')][_0x1212('0x6')]({'port':0x232a});var logger=require('../../config/logger')(_0x1212('0x7'));var Redis=require('ioredis');config[_0x1212('0x8')]=_[_0x1212('0x9')](config[_0x1212('0x8')],{'host':_0x1212('0xa'),'port':0x18eb});var io=require(_0x1212('0xb'))(new Redis(config[_0x1212('0x8')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'callNumber':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0xf')]},'callerId':{'type':_0x1212('0xe')},'callbackUrl':{'type':_0x1212('0xe')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0x10')]},'transferNumber':{'type':_0x1212('0xe'),'required':[!![],_0x1212('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]},'sessionId':{'type':_0x1212('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1212('0xc'),'required':[!![],_0x1212('0xd')]}});function emit(_0x5cc246,_0x568870,_0x54ae52){logger[_0x1212('0x12')](_0x5cc246,_0x568870,JSON[_0x1212('0x13')](_0x54ae52));io['to'](_0x5cc246)[_0x1212('0x14')](_0x568870,_0x54ae52);}function handleError(_0x3dd9dd){return function(_0x3cf284){console[_0x1212('0x15')](_0x1212('0x16'),_0x3cf284,_0x3cf284 instanceof RangeError);logger[_0x1212('0x17')](_0x3cf284[_0x1212('0x18')]);if(_0x3cf284 instanceof RangeError){if(_0x3cf284['name']){delete _0x3cf284[_0x1212('0x19')];}_0x3dd9dd[_0x1212('0x1a')](0x194)[_0x1212('0x1b')](_0x3cf284);}else{if(_0x3cf284[_0x1212('0x19')]){delete _0x3cf284[_0x1212('0x19')];}_0x3dd9dd[_0x1212('0x1a')](0x1f4)[_0x1212('0x1b')](_0x3cf284);}};}function checkError(){return function(_0x8d4002){if(!_0x8d4002){throw new RangeError('NotFound');}return _0x8d4002;};}function respondWithRpcPromise(_0x38a5e2,_0x3a9664){return new BPromise(function(_0x46d6df,_0x5d15ca){var _0x1571fd=amiClient;return _0x1571fd[_0x1212('0x1c')](_0x38a5e2,_0x3a9664)[_0x1212('0x1d')](function(_0x28c92b){if(_0x28c92b['error']){if(_0x28c92b['error']['code']===0x1f4){return _0x5d15ca(_0x28c92b['error']['message']);}return _0x46d6df(_0x28c92b[_0x1212('0x17')][_0x1212('0x1e')]);}else{_0x46d6df(_0x28c92b['result']);}})[_0x1212('0x1f')](function(_0xa1c850){_0x5d15ca(_0xa1c850);});});}function getAgent(_0x52c7b0){return db[_0x1212('0x20')][_0x1212('0x21')]({'where':{'id':_0x52c7b0,'role':_0x1212('0x22')}})[_0x1212('0x1d')](checkError());}function getAgentCheckSession(_0x3a0ddf,_0x3f6be3){return new BPromise(function(_0x2750b0,_0x2666be){var _0x53aa25=respondWithRpcPromise(_0x1212('0x23'));var _0x7706a0=getAgent(_0x3a0ddf);Promise[_0x1212('0x24')]([_0x53aa25,_0x7706a0])[_0x1212('0x1d')](function(_0x17d0f6){var _0x26446d=_0x17d0f6[0x0];var _0x315f00=_0x17d0f6[0x1];var _0x40b8f6=_[_0x1212('0x25')](_0x26446d[_0x1212('0x26')],function(_0x4b8e34){return _0x4b8e34['UserId']==_0x315f00['id']&&_0x4b8e34[_0x1212('0x27')]==_0x3f6be3;});if(_0x40b8f6['length']==0x1){_0x2750b0(_0x315f00);}else{_0x2666be(new RangeError(_0x1212('0x28')+_0x3f6be3+'\x20not\x20found!'));}});});}exports[_0x1212('0x29')]=function(_0x585bb6,_0x2c9313){logger[_0x1212('0x12')](_0x1212('0x2a'),_0x585bb6[_0x1212('0x2b')]);var _0x4df9d1=originateValidation[_0x1212('0x2c')](_0x585bb6[_0x1212('0x2b')]);if(_0x4df9d1[_0x1212('0x2d')]>0x0){return _0x2c9313[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x4df9d1);}var _0x47c63f=_0x585bb6[_0x1212('0x2b')][_0x1212('0x2f')];var _0x1cf542=_0x585bb6['body'][_0x1212('0x30')];var _0x33309a=_0x585bb6[_0x1212('0x2b')][_0x1212('0x31')];var _0x52c611=_0x585bb6[_0x1212('0x2b')][_0x1212('0x32')];return getAgent(_0x47c63f)['then'](function(_0x405feb){logger[_0x1212('0x12')](_0x1212('0x33'),_0x405feb['name']);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x405feb[_0x1212('0x19')]),'webbar:originate',{'callNumber':_0x1cf542,'callerId':_0x33309a,'callbackUrl':_0x52c611});return _0x2c9313[_0x1212('0x1a')](0xc8)['json']({'error':![],'message':_0x1212('0x36')});})[_0x1212('0x1f')](handleError(_0x2c9313));};exports['hangup']=function(_0x4e5be7,_0x2447c6){logger['info'](_0x1212('0x37'),_0x4e5be7[_0x1212('0x2b')]);var _0x31a69c=hangupValidation[_0x1212('0x2c')](_0x4e5be7[_0x1212('0x2b')]);if(_0x31a69c[_0x1212('0x2d')]>0x0){return _0x2447c6[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x31a69c);}var _0x320a5c=_0x4e5be7[_0x1212('0x2b')][_0x1212('0x2f')];var _0x1bbb84=_0x4e5be7[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x320a5c)[_0x1212('0x1d')](function(_0x42b95a){logger[_0x1212('0x12')](_0x1212('0x33'),_0x42b95a['name']);emit(util[_0x1212('0x34')]('user:%s',_0x42b95a['name']),_0x1212('0x38'),{'sessionId':_0x1bbb84});return _0x2447c6[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x39')});})[_0x1212('0x1f')](handleError(_0x2447c6));};exports['answer']=function(_0x497c20,_0x37391e){logger[_0x1212('0x12')](_0x1212('0x3a'),_0x497c20[_0x1212('0x2b')]);var _0x45fc95=answerValidation[_0x1212('0x2c')](_0x497c20[_0x1212('0x2b')]);if(_0x45fc95[_0x1212('0x2d')]>0x0){return _0x37391e[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x45fc95);}var _0x1af6ae=_0x497c20[_0x1212('0x2b')]['userId'];var _0x584d32=_0x497c20[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x1af6ae)['then'](function(_0x1a9c63){logger['info'](_0x1212('0x33'),_0x1a9c63[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x1a9c63[_0x1212('0x19')]),'webbar:answer',{'sessionId':_0x584d32});return _0x37391e[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x3b')});})['catch'](handleError(_0x37391e));};exports[_0x1212('0x3c')]=function(_0x298538,_0x4b1625){logger[_0x1212('0x12')](_0x1212('0x3d'),_0x298538[_0x1212('0x2b')]);var _0x126df5=holdValidation[_0x1212('0x2c')](_0x298538[_0x1212('0x2b')]);if(_0x126df5['length']>0x0){return _0x4b1625[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x126df5);}var _0x3a4f8c=_0x298538['body']['userId'];var _0xf7d207=_0x298538['body'][_0x1212('0x27')];return getAgent(_0x3a4f8c)['then'](function(_0x50a8ef){logger[_0x1212('0x12')](_0x1212('0x33'),_0x50a8ef['name']);emit(util[_0x1212('0x34')]('user:%s',_0x50a8ef[_0x1212('0x19')]),_0x1212('0x3e'),{'sessionId':_0xf7d207});return _0x4b1625['status'](0xc8)['json']({'error':![],'message':_0x1212('0x3f')});})['catch'](handleError(_0x4b1625));};exports[_0x1212('0x40')]=function(_0x53a46f,_0x20e66f){logger['info'](_0x1212('0x41'),_0x53a46f[_0x1212('0x2b')]);var _0x249066=unholdValidation[_0x1212('0x2c')](_0x53a46f[_0x1212('0x2b')]);if(_0x249066[_0x1212('0x2d')]>0x0){return _0x20e66f['status'](0x190)['json'](_0x249066);}var _0x2a983e=_0x53a46f[_0x1212('0x2b')][_0x1212('0x2f')];var _0x140984=_0x53a46f[_0x1212('0x2b')][_0x1212('0x27')];return getAgent(_0x2a983e)['then'](function(_0x5e3644){logger['info'](_0x1212('0x33'),_0x5e3644[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x5e3644[_0x1212('0x19')]),'webbar:unhold',{'sessionId':_0x140984});return _0x20e66f[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x42')});})[_0x1212('0x1f')](handleError(_0x20e66f));};exports[_0x1212('0x43')]=function(_0x271ecf,_0x4901c1){logger[_0x1212('0x12')](_0x1212('0x44'),_0x4901c1[_0x1212('0x2b')]);var _0x4a86bd=callsValidation[_0x1212('0x2c')](_0x271ecf[_0x1212('0x2b')]);if(_0x4a86bd[_0x1212('0x2d')]>0x0){return _0x4901c1[_0x1212('0x1a')](0x190)['json'](_0x4a86bd);}var _0x27e94b=_0x271ecf[_0x1212('0x2b')][_0x1212('0x2f')];var _0x41e155=respondWithRpcPromise(_0x1212('0x23'));var _0x162fb0=getAgent(_0x27e94b);return Promise['all']([_0x41e155,_0x162fb0])[_0x1212('0x1d')](function(_0x4ee27a){var _0x568935=_0x4ee27a[0x0];var _0x3c940a=_0x4ee27a[0x1];var _0x343e54=_['filter'](_0x568935[_0x1212('0x26')],function(_0x486162){return _0x486162['UserId']==_0x3c940a['id'];});return _0x4901c1['status'](0xc8)['json']({'count':_0x343e54['length'],'rows':_0x343e54});})[_0x1212('0x1f')](handleError(_0x4901c1));};exports[_0x1212('0x45')]=function(_0x467c40,_0x121f00){logger[_0x1212('0x12')](_0x1212('0x46'),_0x467c40[_0x1212('0x2b')]);var _0x41f7be=conferenceValidation[_0x1212('0x2c')](_0x467c40[_0x1212('0x2b')]);if(_0x41f7be[_0x1212('0x2d')]>0x0){return _0x121f00[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x41f7be);}var _0x49c742=_0x467c40[_0x1212('0x2b')]['userId'];return getAgent(_0x49c742)[_0x1212('0x1d')](function(_0x1170cb){logger[_0x1212('0x12')](_0x1212('0x33'),_0x1170cb[_0x1212('0x19')]);emit(util[_0x1212('0x34')](_0x1212('0x35'),_0x1170cb[_0x1212('0x19')]),'webbar:conference');return _0x121f00[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x47')});})[_0x1212('0x1f')](handleError(_0x121f00));};exports['transfer']=function(_0xa0f4f2,_0x28bb5e){logger['info'](_0x1212('0x48'),_0xa0f4f2[_0x1212('0x2b')]);var _0x519879=transferValidation[_0x1212('0x2c')](_0xa0f4f2[_0x1212('0x2b')]);if(_0x519879[_0x1212('0x2d')]>0x0){return _0x28bb5e[_0x1212('0x1a')](0x190)[_0x1212('0x2e')](_0x519879);}var _0x3a9843=_0xa0f4f2[_0x1212('0x2b')][_0x1212('0x2f')];var _0x388432=_0xa0f4f2[_0x1212('0x2b')][_0x1212('0x27')];var _0x59b660=_0xa0f4f2[_0x1212('0x2b')]['transferNumber'];return getAgent(_0x3a9843)[_0x1212('0x1d')](function(_0x54cca8){logger[_0x1212('0x12')](_0x1212('0x33'),_0x54cca8[_0x1212('0x19')]);emit(util[_0x1212('0x34')]('user:%s',_0x54cca8['name']),_0x1212('0x49'),{'sessionId':_0x388432,'transferNumber':_0x59b660});return _0x28bb5e[_0x1212('0x1a')](0xc8)[_0x1212('0x2e')]({'error':![],'message':_0x1212('0x4a')});})['catch'](handleError(_0x28bb5e));}; \ No newline at end of file +var _0xcb91=['findOne','VoiceChannels','all','rows','UserId','sessionId','sessionId\x20','originate','originate\x20fired:','body','length','json','userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','entityFound:','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','filter','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','../../mysqldb','../../config/environment','util','bluebird','client','http','webbarapi','ioredis','defaults','redis','socket.io-emitter','number','callNumber\x20is\x20required','string','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','error','stack','name','status','send','NotFound','request','then','message','result','catch','User'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a6e4b,_0x118cd9){_0x3a6e4b=_0x3a6e4b-0x0;var _0x36572d=_0xcb91[_0x3a6e4b];return _0x36572d;};'use strict';var path=require('path');var fs=require('fs');var _=require('lodash');var db=require(_0x1cb9('0x0'))['db'];var config=require(_0x1cb9('0x1'));var util=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x1cb9('0x4')][_0x1cb9('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x1cb9('0x6'));var Redis=require(_0x1cb9('0x7'));config['redis']=_[_0x1cb9('0x8')](config[_0x1cb9('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0xa'))(new Redis(config[_0x1cb9('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x1cb9('0xc')]},'callerId':{'type':_0x1cb9('0xd')},'callbackUrl':{'type':_0x1cb9('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':_0x1cb9('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0x1cb9('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':_0x1cb9('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x1cb9('0xe')]},'sessionId':{'type':_0x1cb9('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],_0x1cb9('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x1cb9('0xb'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x5572cb,_0xd446a3,_0x3cc765){logger[_0x1cb9('0x10')](_0x5572cb,_0xd446a3,JSON[_0x1cb9('0x11')](_0x3cc765));io['to'](_0x5572cb)[_0x1cb9('0x12')](_0xd446a3,_0x3cc765);}function handleError(_0xf22920){return function(_0x23d3a9){console['log']('handleError:',_0x23d3a9,_0x23d3a9 instanceof RangeError);logger[_0x1cb9('0x13')](_0x23d3a9[_0x1cb9('0x14')]);if(_0x23d3a9 instanceof RangeError){if(_0x23d3a9[_0x1cb9('0x15')]){delete _0x23d3a9[_0x1cb9('0x15')];}_0xf22920[_0x1cb9('0x16')](0x194)[_0x1cb9('0x17')](_0x23d3a9);}else{if(_0x23d3a9[_0x1cb9('0x15')]){delete _0x23d3a9['name'];}_0xf22920['status'](0x1f4)[_0x1cb9('0x17')](_0x23d3a9);}};}function checkError(){return function(_0x5dbfae){if(!_0x5dbfae){throw new RangeError(_0x1cb9('0x18'));}return _0x5dbfae;};}function respondWithRpcPromise(_0x2265ea,_0x523b26){return new BPromise(function(_0x599275,_0x2e3854){var _0x325637=amiClient;return _0x325637[_0x1cb9('0x19')](_0x2265ea,_0x523b26)[_0x1cb9('0x1a')](function(_0x45b8d3){if(_0x45b8d3[_0x1cb9('0x13')]){if(_0x45b8d3['error']['code']===0x1f4){return _0x2e3854(_0x45b8d3[_0x1cb9('0x13')]['message']);}return _0x599275(_0x45b8d3[_0x1cb9('0x13')][_0x1cb9('0x1b')]);}else{_0x599275(_0x45b8d3[_0x1cb9('0x1c')]);}})[_0x1cb9('0x1d')](function(_0x43a100){_0x2e3854(_0x43a100);});});}function getAgent(_0x53f9fa){return db[_0x1cb9('0x1e')][_0x1cb9('0x1f')]({'where':{'id':_0x53f9fa,'role':'agent'}})[_0x1cb9('0x1a')](checkError());}function getAgentCheckSession(_0x21effa,_0x41a9a0){return new BPromise(function(_0x1804fd,_0x406821){var _0x21d6f5=respondWithRpcPromise(_0x1cb9('0x20'));var _0xb644b3=getAgent(_0x21effa);Promise[_0x1cb9('0x21')]([_0x21d6f5,_0xb644b3])[_0x1cb9('0x1a')](function(_0x48888d){var _0x405a2f=_0x48888d[0x0];var _0x536635=_0x48888d[0x1];var _0x110282=_['filter'](_0x405a2f[_0x1cb9('0x22')],function(_0x41011c){return _0x41011c[_0x1cb9('0x23')]==_0x536635['id']&&_0x41011c[_0x1cb9('0x24')]==_0x41a9a0;});if(_0x110282['length']==0x1){_0x1804fd(_0x536635);}else{_0x406821(new RangeError(_0x1cb9('0x25')+_0x41a9a0+'\x20not\x20found!'));}});});}exports[_0x1cb9('0x26')]=function(_0x336a98,_0x4220d7){logger['info'](_0x1cb9('0x27'),_0x336a98['body']);var _0x3a3543=originateValidation['validate'](_0x336a98[_0x1cb9('0x28')]);if(_0x3a3543[_0x1cb9('0x29')]>0x0){return _0x4220d7[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x3a3543);}var _0x56c3e0=_0x336a98[_0x1cb9('0x28')][_0x1cb9('0x2b')];var _0x3467d5=_0x336a98[_0x1cb9('0x28')][_0x1cb9('0x2c')];var _0x2794fa=_0x336a98[_0x1cb9('0x28')][_0x1cb9('0x2d')];var _0x386e8b=_0x336a98[_0x1cb9('0x28')][_0x1cb9('0x2e')];return getAgent(_0x56c3e0)[_0x1cb9('0x1a')](function(_0x29f149){logger['info']('entityFound:',_0x29f149[_0x1cb9('0x15')]);emit(util[_0x1cb9('0x2f')](_0x1cb9('0x30'),_0x29f149[_0x1cb9('0x15')]),_0x1cb9('0x31'),{'callNumber':_0x3467d5,'callerId':_0x2794fa,'callbackUrl':_0x386e8b});return _0x4220d7[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':_0x1cb9('0x32')});})['catch'](handleError(_0x4220d7));};exports[_0x1cb9('0x33')]=function(_0x1482c4,_0xefe136){logger['info'](_0x1cb9('0x34'),_0x1482c4['body']);var _0x313e34=hangupValidation['validate'](_0x1482c4[_0x1cb9('0x28')]);if(_0x313e34[_0x1cb9('0x29')]>0x0){return _0xefe136[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x313e34);}var _0x34ada2=_0x1482c4[_0x1cb9('0x28')][_0x1cb9('0x2b')];var _0x4a4788=_0x1482c4['body'][_0x1cb9('0x24')];return getAgent(_0x34ada2)[_0x1cb9('0x1a')](function(_0x7a0d8b){logger[_0x1cb9('0x10')](_0x1cb9('0x35'),_0x7a0d8b[_0x1cb9('0x15')]);emit(util[_0x1cb9('0x2f')]('user:%s',_0x7a0d8b[_0x1cb9('0x15')]),'webbar:hangup',{'sessionId':_0x4a4788});return _0xefe136['status'](0xc8)['json']({'error':![],'message':_0x1cb9('0x36')});})[_0x1cb9('0x1d')](handleError(_0xefe136));};exports[_0x1cb9('0x37')]=function(_0x2e3cf3,_0x2817e9){logger['info'](_0x1cb9('0x38'),_0x2e3cf3['body']);var _0x91121=answerValidation[_0x1cb9('0x39')](_0x2e3cf3[_0x1cb9('0x28')]);if(_0x91121['length']>0x0){return _0x2817e9[_0x1cb9('0x16')](0x190)['json'](_0x91121);}var _0xda1a44=_0x2e3cf3[_0x1cb9('0x28')]['userId'];var _0x5839aa=_0x2e3cf3[_0x1cb9('0x28')][_0x1cb9('0x24')];return getAgent(_0xda1a44)[_0x1cb9('0x1a')](function(_0x162712){logger[_0x1cb9('0x10')]('entityFound:',_0x162712[_0x1cb9('0x15')]);emit(util['format']('user:%s',_0x162712['name']),_0x1cb9('0x3a'),{'sessionId':_0x5839aa});return _0x2817e9[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':_0x1cb9('0x3b')});})[_0x1cb9('0x1d')](handleError(_0x2817e9));};exports[_0x1cb9('0x3c')]=function(_0x40ca68,_0x409b89){logger[_0x1cb9('0x10')](_0x1cb9('0x3d'),_0x40ca68[_0x1cb9('0x28')]);var _0x4ce899=holdValidation[_0x1cb9('0x39')](_0x40ca68[_0x1cb9('0x28')]);if(_0x4ce899[_0x1cb9('0x29')]>0x0){return _0x409b89['status'](0x190)[_0x1cb9('0x2a')](_0x4ce899);}var _0x57251=_0x40ca68[_0x1cb9('0x28')][_0x1cb9('0x2b')];var _0x4599a4=_0x40ca68['body'][_0x1cb9('0x24')];return getAgent(_0x57251)['then'](function(_0x2eaa11){logger['info'](_0x1cb9('0x35'),_0x2eaa11[_0x1cb9('0x15')]);emit(util[_0x1cb9('0x2f')](_0x1cb9('0x30'),_0x2eaa11['name']),_0x1cb9('0x3e'),{'sessionId':_0x4599a4});return _0x409b89[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':_0x1cb9('0x3f')});})[_0x1cb9('0x1d')](handleError(_0x409b89));};exports[_0x1cb9('0x40')]=function(_0x17b92a,_0x3b6a92){logger[_0x1cb9('0x10')](_0x1cb9('0x41'),_0x17b92a['body']);var _0x5092a6=unholdValidation[_0x1cb9('0x39')](_0x17b92a[_0x1cb9('0x28')]);if(_0x5092a6[_0x1cb9('0x29')]>0x0){return _0x3b6a92[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x5092a6);}var _0x2d076b=_0x17b92a[_0x1cb9('0x28')][_0x1cb9('0x2b')];var _0x36c53a=_0x17b92a[_0x1cb9('0x28')]['sessionId'];return getAgent(_0x2d076b)[_0x1cb9('0x1a')](function(_0x5e773d){logger[_0x1cb9('0x10')]('entityFound:',_0x5e773d[_0x1cb9('0x15')]);emit(util['format']('user:%s',_0x5e773d[_0x1cb9('0x15')]),_0x1cb9('0x42'),{'sessionId':_0x36c53a});return _0x3b6a92[_0x1cb9('0x16')](0xc8)['json']({'error':![],'message':_0x1cb9('0x43')});})[_0x1cb9('0x1d')](handleError(_0x3b6a92));};exports['calls']=function(_0x571b33,_0x398d9d){logger[_0x1cb9('0x10')](_0x1cb9('0x44'),_0x398d9d[_0x1cb9('0x28')]);var _0x3de325=callsValidation[_0x1cb9('0x39')](_0x571b33[_0x1cb9('0x28')]);if(_0x3de325['length']>0x0){return _0x398d9d[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x3de325);}var _0x108551=_0x571b33['body'][_0x1cb9('0x2b')];var _0x9893a3=respondWithRpcPromise(_0x1cb9('0x20'));var _0xf6eb2d=getAgent(_0x108551);return Promise[_0x1cb9('0x21')]([_0x9893a3,_0xf6eb2d])[_0x1cb9('0x1a')](function(_0x5ae762){var _0x37ceb5=_0x5ae762[0x0];var _0x36c40d=_0x5ae762[0x1];var _0x41e81f=_[_0x1cb9('0x45')](_0x37ceb5[_0x1cb9('0x22')],function(_0x274c90){return _0x274c90[_0x1cb9('0x23')]==_0x36c40d['id'];});return _0x398d9d[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'count':_0x41e81f[_0x1cb9('0x29')],'rows':_0x41e81f});})[_0x1cb9('0x1d')](handleError(_0x398d9d));};exports['conference']=function(_0xfc39e1,_0xb4c211){logger[_0x1cb9('0x10')](_0x1cb9('0x46'),_0xfc39e1['body']);var _0x4a9cf8=conferenceValidation[_0x1cb9('0x39')](_0xfc39e1[_0x1cb9('0x28')]);if(_0x4a9cf8[_0x1cb9('0x29')]>0x0){return _0xb4c211[_0x1cb9('0x16')](0x190)[_0x1cb9('0x2a')](_0x4a9cf8);}var _0x75c734=_0xfc39e1[_0x1cb9('0x28')][_0x1cb9('0x2b')];return getAgent(_0x75c734)['then'](function(_0x49f74c){logger[_0x1cb9('0x10')]('entityFound:',_0x49f74c['name']);emit(util['format']('user:%s',_0x49f74c['name']),_0x1cb9('0x47'));return _0xb4c211[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':_0x1cb9('0x48')});})[_0x1cb9('0x1d')](handleError(_0xb4c211));};exports[_0x1cb9('0x49')]=function(_0x54f008,_0x27d7ef){logger[_0x1cb9('0x10')]('transfer\x20fired:',_0x54f008['body']);var _0x150441=transferValidation[_0x1cb9('0x39')](_0x54f008[_0x1cb9('0x28')]);if(_0x150441[_0x1cb9('0x29')]>0x0){return _0x27d7ef[_0x1cb9('0x16')](0x190)['json'](_0x150441);}var _0x538ff0=_0x54f008['body'][_0x1cb9('0x2b')];var _0x2fd5a0=_0x54f008[_0x1cb9('0x28')][_0x1cb9('0x24')];var _0x349f33=_0x54f008['body'][_0x1cb9('0x4a')];return getAgent(_0x538ff0)[_0x1cb9('0x1a')](function(_0x5c65cd){logger['info'](_0x1cb9('0x35'),_0x5c65cd['name']);emit(util[_0x1cb9('0x2f')](_0x1cb9('0x30'),_0x5c65cd[_0x1cb9('0x15')]),_0x1cb9('0x4b'),{'sessionId':_0x2fd5a0,'transferNumber':_0x349f33});return _0x27d7ef[_0x1cb9('0x16')](0xc8)[_0x1cb9('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0x1cb9('0x1d')](handleError(_0x27d7ef));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index eb3dd64..7de61c0 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 _0x1623=['destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','/:id/dispositions','addAgents','/:id/notify','notify','update'];(function(_0x15ca1a,_0x30fc82){var _0x507626=function(_0x14c9bc){while(--_0x14c9bc){_0x15ca1a['push'](_0x15ca1a['shift']());}};_0x507626(++_0x30fc82);}(_0x1623,0xab));var _0x3162=function(_0x1d8699,_0x7377ee){_0x1d8699=_0x1d8699-0x0;var _0xd4b68a=_0x1623[_0x1d8699];return _0xd4b68a;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var fs_extra=require(_0x3162('0x4'));var auth=require(_0x3162('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3162('0x6'));router['get']('/',auth[_0x3162('0x7')](),controller[_0x3162('0x8')]);router['get'](_0x3162('0x9'),auth[_0x3162('0x7')](),controller[_0x3162('0xa')]);router[_0x3162('0xb')](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0xd')]);router[_0x3162('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x3162('0xe')]);router[_0x3162('0xb')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller[_0x3162('0x10')]);router[_0x3162('0xb')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x12')]);router['get'](_0x3162('0x13'),auth['isAuthenticated'](),controller[_0x3162('0x14')]);router[_0x3162('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3162('0x15')](_0x3162('0x16'),auth[_0x3162('0x7')](),controller['addDisposition']);router[_0x3162('0x15')](_0x3162('0xf'),auth[_0x3162('0x7')](),controller['addAnswer']);router[_0x3162('0x15')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x17')]);router[_0x3162('0x15')](_0x3162('0x13'),auth[_0x3162('0x7')](),controller['addApplications']);router[_0x3162('0x15')](_0x3162('0x18'),controller[_0x3162('0x19')]);router[_0x3162('0x15')]('/:id/send',auth[_0x3162('0x7')](),controller['send']);router['put'](_0x3162('0xc'),auth[_0x3162('0x7')](),controller[_0x3162('0x1a')]);router['delete']('/:id',auth[_0x3162('0x7')](),controller[_0x3162('0x1b')]);router[_0x3162('0x1c')](_0x3162('0x16'),auth[_0x3162('0x7')](),controller[_0x3162('0x1d')]);router[_0x3162('0x1c')](_0x3162('0xf'),auth['isAuthenticated'](),controller[_0x3162('0x1e')]);router[_0x3162('0x1c')](_0x3162('0x11'),auth[_0x3162('0x7')](),controller[_0x3162('0x1f')]);module[_0x3162('0x20')]=router; \ No newline at end of file +var _0x781d=['post','addDisposition','/:id/canned_answers','addAnswer','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications'];(function(_0x38ff1e,_0x3b9385){var _0x3755d4=function(_0x6e6692){while(--_0x6e6692){_0x38ff1e['push'](_0x38ff1e['shift']());}};_0x3755d4(++_0x3b9385);}(_0x781d,0x14a));var _0xd781=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x781d[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd781('0x2'));var router=express[_0xd781('0x3')]();var fs_extra=require(_0xd781('0x4'));var auth=require(_0xd781('0x5'));var interaction=require(_0xd781('0x6'));var config=require(_0xd781('0x7'));var controller=require(_0xd781('0x8'));router[_0xd781('0x9')]('/',auth[_0xd781('0xa')](),controller[_0xd781('0xb')]);router['get'](_0xd781('0xc'),auth[_0xd781('0xa')](),controller[_0xd781('0xd')]);router[_0xd781('0x9')]('/:id',auth[_0xd781('0xa')](),controller['show']);router[_0xd781('0x9')](_0xd781('0xe'),auth['isAuthenticated'](),controller[_0xd781('0xf')]);router[_0xd781('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xd781('0x10')]);router[_0xd781('0x9')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x12')]);router[_0xd781('0x9')](_0xd781('0x13'),auth[_0xd781('0xa')](),controller[_0xd781('0x14')]);router[_0xd781('0x15')]('/',auth[_0xd781('0xa')](),controller['create']);router[_0xd781('0x15')](_0xd781('0xe'),auth['isAuthenticated'](),controller[_0xd781('0x16')]);router['post'](_0xd781('0x17'),auth[_0xd781('0xa')](),controller[_0xd781('0x18')]);router[_0xd781('0x15')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x19')]);router['post'](_0xd781('0x13'),auth[_0xd781('0xa')](),controller[_0xd781('0x1a')]);router[_0xd781('0x15')](_0xd781('0x1b'),controller[_0xd781('0x1c')]);router[_0xd781('0x15')](_0xd781('0x1d'),auth['isAuthenticated'](),controller[_0xd781('0x1e')]);router[_0xd781('0x1f')](_0xd781('0x20'),auth[_0xd781('0xa')](),controller[_0xd781('0x21')]);router[_0xd781('0x22')](_0xd781('0x20'),auth['isAuthenticated'](),controller[_0xd781('0x23')]);router['delete']('/:id/dispositions',auth[_0xd781('0xa')](),controller['removeDispositions']);router[_0xd781('0x22')](_0xd781('0x17'),auth[_0xd781('0xa')](),controller[_0xd781('0x24')]);router[_0xd781('0x22')](_0xd781('0x11'),auth[_0xd781('0xa')](),controller[_0xd781('0x25')]);module[_0xd781('0x26')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 158341b..ec03f3c 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 _0xd640=['sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0xd640,0x1e8));var _0x0d64=function(_0x238469,_0x13fe16){_0x238469=_0x238469-0x0;var _0x5ddc4a=_0xd640[_0x238469];return _0x5ddc4a;};'use strict';var Sequelize=require(_0x0d64('0x0'));var rs=require(_0x0d64('0x1'));module[_0x0d64('0x2')]={'name':{'type':Sequelize[_0x0d64('0x3')],'unique':_0x0d64('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x0d64('0x3')],'defaultValue':function(){return rs[_0x0d64('0x5')]();}},'phone':{'type':Sequelize[_0x0d64('0x3')]},'type':{'type':Sequelize[_0x0d64('0x6')](_0x0d64('0x7'),_0x0d64('0x8'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0d64('0x9')],'defaultValue':function(){return _0x0d64('0xa');}},'notificationSound':{'type':Sequelize[_0x0d64('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0d64('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0d64('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0d64('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0d64('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0d64('0xd'),'set':function(_0x102374){if(!_0x102374){this[_0x0d64('0xe')]('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x0d64('0xf'),_0x102374);}},'description':{'type':Sequelize[_0x0d64('0x3')]}}; \ No newline at end of file +var _0xaab9=['twilio','sinch','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','name','generate'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xaab9,0x10a));var _0x9aab=function(_0x4ef8c1,_0x27fcfc){_0x4ef8c1=_0x4ef8c1-0x0;var _0x48f7a3=_0xaab9[_0x4ef8c1];return _0x48f7a3;};'use strict';var Sequelize=require(_0x9aab('0x0'));var rs=require(_0x9aab('0x1'));module[_0x9aab('0x2')]={'name':{'type':Sequelize[_0x9aab('0x3')],'unique':_0x9aab('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x9aab('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x9aab('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x9aab('0x3')],'defaultValue':function(){return rs[_0x9aab('0x5')]();}},'phone':{'type':Sequelize[_0x9aab('0x3')]},'type':{'type':Sequelize['ENUM'](_0x9aab('0x6'),_0x9aab('0x7'))},'accountSid':{'type':Sequelize[_0x9aab('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9aab('0x8');}},'notificationSound':{'type':Sequelize[_0x9aab('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9aab('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9aab('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9aab('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9aab('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9aab('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9aab('0xa')],'comment':_0x9aab('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9aab('0xc'),'set':function(_0x2892ce){if(!_0x2892ce){this[_0x9aab('0xd')](_0x9aab('0xe'),null);}this[_0x9aab('0xd')](_0x9aab('0xf'),_0x2892ce);}},'description':{'type':Sequelize[_0x9aab('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 35992fd..531c77d 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 _0xfefe=['read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','From','replace','Body','messageId','MessageSid','from','notifications','ValidationError','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','CmList','ListId','Contacts','DESC','list','omit','defaults','CmContact','WhatsappInteraction','interaction','push','close','unmanaged','*,*,*,*','created','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','to\x20is\x20mandatory','List','get','out','Messages','dataValues','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','WhatsappAccounts','UserProfileResource','end','stack','name','send','index','map','WhatsappAccount','rawAttributes','fieldName','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','params','Pause','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','mandatoryDispositionPause','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','order','pick','rows','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','addAgents','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','Applications','account','type','sinch','statuses','state'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfefe,0x1ca));var _0xefef=function(_0x272156,_0x898895){_0x272156=_0x272156-0x0;var _0x1e5e1a=_0xfefe[_0x272156];return _0x1e5e1a;};'use strict';var emlformat=require(_0xefef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xefef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xefef('0x2'));var BPromise=require(_0xefef('0x3'));var Mustache=require(_0xefef('0x4'));var util=require(_0xefef('0x5'));var path=require(_0xefef('0x6'));var sox=require(_0xefef('0x7'));var csv=require(_0xefef('0x8'));var ejs=require(_0xefef('0x9'));var fs=require('fs');var fs_extra=require(_0xefef('0xa'));var _=require(_0xefef('0xb'));var squel=require(_0xefef('0xc'));var crypto=require(_0xefef('0xd'));var jsforce=require(_0xefef('0xe'));var deskjs=require(_0xefef('0xf'));var toCsv=require('to-csv');var querystring=require(_0xefef('0x10'));var Papa=require(_0xefef('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xefef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xefef('0x13'))(_0xefef('0x14'));var utils=require(_0xefef('0x15'));var config=require(_0xefef('0x16'));var licenseUtil=require(_0xefef('0x17'));var db=require(_0xefef('0x18'))['db'];config[_0xefef('0x19')]=_['defaults'](config['redis'],{'host':_0xefef('0x1a'),'port':0x18eb});var socket=require(_0xefef('0x1b'))(new Redis(config[_0xefef('0x19')]));require(_0xefef('0x1c'))[_0xefef('0x1d')](socket);var jayson=require(_0xefef('0x1e'));var client=jayson[_0xefef('0x1f')][_0xefef('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x49540a,_0x46185c,_0x1627b4,_0x2ab1ed){return new BPromise(function(_0x36f9a8,_0x4c6525){var _0x1510d9=_0x2ab1ed||client;return _0x1510d9[_0xefef('0x21')](_0x49540a,_0x1627b4)[_0xefef('0x22')](function(_0x443419){logger[_0xefef('0x23')](_0xefef('0x24'),_0x46185c,'request\x20sent');logger[_0xefef('0x25')](_0xefef('0x26'),_0x46185c,'request\x20sent',JSON[_0xefef('0x27')](_0x443419));if(_0x443419[_0xefef('0x28')]){if(_0x443419['error'][_0xefef('0x29')]===0x1f4){logger[_0xefef('0x28')](_0xefef('0x24'),_0x46185c,_0x443419[_0xefef('0x28')][_0xefef('0x2a')]);return _0x4c6525(_0x443419[_0xefef('0x28')][_0xefef('0x2a')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x46185c,_0x443419[_0xefef('0x28')]['message']);return _0x36f9a8(_0x443419['error'][_0xefef('0x2a')]);}else{logger[_0xefef('0x23')](_0xefef('0x24'),_0x46185c,_0xefef('0x2b'));_0x36f9a8(_0x443419[_0xefef('0x2c')]['message']);}})[_0xefef('0x2d')](function(_0x2bbdba){logger['error'](_0xefef('0x24'),_0x46185c,_0x2bbdba);_0x4c6525(_0x2bbdba);});});}function respondWithStatusCode(_0x5a24ff,_0xa125a8){_0xa125a8=_0xa125a8||0xcc;return function(_0x5e967f){if(_0x5e967f){return _0x5a24ff[_0xefef('0x2e')](_0xa125a8);}return _0x5a24ff['status'](_0xa125a8)['end']();};}function respondWithResult(_0x110db6,_0x7e7e82){_0x7e7e82=_0x7e7e82||0xc8;return function(_0x11a3ea){if(_0x11a3ea){return _0x110db6[_0xefef('0x2f')](_0x7e7e82)[_0xefef('0x30')](_0x11a3ea);}};}function respondWithFilteredResult(_0x2aeda6,_0x3c929f){return function(_0x22e585){if(_0x22e585){var _0x8a3afe=typeof _0x3c929f[_0xefef('0x31')]===_0xefef('0x32')&&typeof _0x3c929f['limit']===_0xefef('0x32');var _0x579219=_0x22e585[_0xefef('0x33')];var _0x4247bd=_0x8a3afe?0x0:_0x3c929f[_0xefef('0x31')];var _0x1e495f=_0x8a3afe?_0x22e585['count']:_0x3c929f[_0xefef('0x31')]+_0x3c929f['limit'];var _0x193418;if(_0x1e495f>=_0x579219){_0x1e495f=_0x579219;_0x193418=0xc8;}else{_0x193418=0xce;}_0x2aeda6['status'](_0x193418);return _0x2aeda6[_0xefef('0x34')](_0xefef('0x35'),_0x4247bd+'-'+_0x1e495f+'/'+_0x579219)['json'](_0x22e585);}return null;};}function patchUpdates(_0xb83883){return function(_0x2d10bb){try{jsonpatch[_0xefef('0x36')](_0x2d10bb,_0xb83883,!![]);}catch(_0x4f29ce){return BPromise[_0xefef('0x37')](_0x4f29ce);}return _0x2d10bb['save']();};}function saveUpdates(_0x3f4350,_0x29012f){return function(_0x4192d6){if(_0x4192d6){return _0x4192d6[_0xefef('0x38')](_0x3f4350)[_0xefef('0x22')](function(_0x5a629f){return _0x5a629f;});}return null;};}function removeEntity(_0x89d1c0,_0x42b678){return function(_0x378072){if(_0x378072){return _0x378072[_0xefef('0x39')]()['then'](function(){var _0x3df41b=_0x378072['get']({'plain':!![]});var _0x5b029e=_0xefef('0x3a');return db[_0xefef('0x3b')]['destroy']({'where':{'type':_0x5b029e,'resourceId':_0x3df41b['id']}})[_0xefef('0x22')](function(){return _0x378072;});})[_0xefef('0x22')](function(){_0x89d1c0['status'](0xcc)[_0xefef('0x3c')]();});}};}function handleEntityNotFound(_0x3fd419,_0x4376ce){return function(_0x403c4c){if(!_0x403c4c){_0x3fd419['sendStatus'](0x194);}return _0x403c4c;};}function handleError(_0x1ea9f9,_0x3ab8f9){_0x3ab8f9=_0x3ab8f9||0x1f4;return function(_0x35f49a){logger['error'](_0x35f49a[_0xefef('0x3d')]);if(_0x35f49a[_0xefef('0x3e')]){delete _0x35f49a[_0xefef('0x3e')];}_0x1ea9f9[_0xefef('0x2f')](_0x3ab8f9)[_0xefef('0x3f')](_0x35f49a);};}exports[_0xefef('0x40')]=function(_0x51590e,_0x49dcfd){var _0x142488={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3a2dc9={},_0x4fbccc={'count':0x0,'rows':[]};var _0x4efca2=_[_0xefef('0x41')](db[_0xefef('0x42')][_0xefef('0x43')],function(_0x2ab4f5){return{'name':_0x2ab4f5[_0xefef('0x44')],'type':_0x2ab4f5['type']['key']};});_0x3a2dc9[_0xefef('0x45')]=_['map'](_0x4efca2,_0xefef('0x3e'));_0x3a2dc9[_0xefef('0x46')]=_['keys'](_0x51590e[_0xefef('0x46')]);_0x3a2dc9[_0xefef('0x47')]=_[_0xefef('0x48')](_0x3a2dc9[_0xefef('0x45')],_0x3a2dc9[_0xefef('0x46')]);_0x142488['attributes']=_[_0xefef('0x48')](_0x3a2dc9['model'],qs[_0xefef('0x49')](_0x51590e[_0xefef('0x46')][_0xefef('0x49')]));_0x142488[_0xefef('0x4a')]=_0x142488['attributes'][_0xefef('0x4b')]?_0x142488['attributes']:_0x3a2dc9[_0xefef('0x45')];if(!_0x51590e[_0xefef('0x46')][_0xefef('0x4c')](_0xefef('0x4d'))){_0x142488[_0xefef('0x4e')]=qs['limit'](_0x51590e[_0xefef('0x46')]['limit']);_0x142488[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x51590e[_0xefef('0x46')][_0xefef('0x31')]);}_0x142488['order']=qs[_0xefef('0x4f')](_0x51590e['query'][_0xefef('0x4f')]);_0x142488[_0xefef('0x50')]=qs['filters'](_['pick'](_0x51590e['query'],_0x3a2dc9[_0xefef('0x47')]),_0x4efca2);if(_0x51590e[_0xefef('0x46')][_0xefef('0x51')]){_0x142488[_0xefef('0x50')]=_['merge'](_0x142488[_0xefef('0x50')],{'$or':_[_0xefef('0x41')](_0x4efca2,function(_0x4f4de9){if(_0x4f4de9['type']!==_0xefef('0x52')){var _0x413a8e={};_0x413a8e[_0x4f4de9[_0xefef('0x3e')]]={'$like':'%'+_0x51590e[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x413a8e;}})});}_0x142488=_[_0xefef('0x53')]({},_0x142488,_0x51590e[_0xefef('0x54')]);var _0x4d22e6={'where':_0x142488['where']};return db['WhatsappAccount'][_0xefef('0x33')](_0x4d22e6)[_0xefef('0x22')](function(_0x1d2979){_0x4fbccc[_0xefef('0x33')]=_0x1d2979;if(_0x51590e[_0xefef('0x46')][_0xefef('0x55')]){_0x142488[_0xefef('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xefef('0x57')](_0x142488);})[_0xefef('0x22')](function(_0x472fd8){_0x4fbccc['rows']=_0x472fd8;return _0x4fbccc;})['then'](respondWithFilteredResult(_0x49dcfd,_0x142488))['catch'](handleError(_0x49dcfd,null));};exports['show']=function(_0x1c5f01,_0x5d9b28){var _0x27f577={'raw':![],'where':{'id':_0x1c5f01[_0xefef('0x58')]['id']},'include':[{'model':db[_0xefef('0x59')],'as':'mandatoryDispositionPause'}]},_0x44eaef={};_0x44eaef[_0xefef('0x45')]=_[_0xefef('0x5a')](db[_0xefef('0x42')][_0xefef('0x43')]);_0x44eaef[_0xefef('0x46')]=_[_0xefef('0x5a')](_0x1c5f01[_0xefef('0x46')]);_0x44eaef[_0xefef('0x47')]=_[_0xefef('0x48')](_0x44eaef['model'],_0x44eaef[_0xefef('0x46')]);_0x27f577[_0xefef('0x4a')]=_[_0xefef('0x48')](_0x44eaef[_0xefef('0x45')],qs[_0xefef('0x49')](_0x1c5f01[_0xefef('0x46')]['fields']));_0x27f577[_0xefef('0x4a')]=_0x27f577[_0xefef('0x4a')][_0xefef('0x4b')]?_0x27f577['attributes']:_0x44eaef[_0xefef('0x45')];if(_0x1c5f01[_0xefef('0x46')]['includeAll']){_0x27f577[_0xefef('0x56')]=[{'all':!![]}];}_0x27f577=_[_0xefef('0x53')]({},_0x27f577,_0x1c5f01[_0xefef('0x54')]);return db[_0xefef('0x42')][_0xefef('0x5b')](_0x27f577)[_0xefef('0x22')](handleEntityNotFound(_0x5d9b28,null))[_0xefef('0x22')](respondWithResult(_0x5d9b28,null))[_0xefef('0x2d')](handleError(_0x5d9b28,null));};exports[_0xefef('0x5c')]=function(_0x58a061,_0x3a3244){return db[_0xefef('0x42')][_0xefef('0x5c')](_0x58a061['body'],{})['then'](function(_0x517c0e){var _0x88ab5c=_0x58a061[_0xefef('0x5d')]['get']({'plain':!![]});if(!_0x88ab5c)throw new Error(_0xefef('0x5e'));if(_0x88ab5c['role']===_0xefef('0x5d')){var _0x236718=_0x517c0e['get']({'plain':!![]});var _0x1fef5f=_0xefef('0x3a');return db['UserProfileSection'][_0xefef('0x5b')]({'where':{'name':_0x1fef5f,'userProfileId':_0x88ab5c[_0xefef('0x5f')]},'raw':!![]})[_0xefef('0x22')](function(_0x11bb69){if(_0x11bb69&&_0x11bb69[_0xefef('0x60')]===0x0){return db[_0xefef('0x3b')][_0xefef('0x5c')]({'name':_0x236718[_0xefef('0x3e')],'resourceId':_0x236718['id'],'type':_0x11bb69['name'],'sectionId':_0x11bb69['id']},{})['then'](function(){return _0x517c0e;});}else{return _0x517c0e;}})[_0xefef('0x2d')](function(_0x4d6647){logger['error'](_0xefef('0x61'),_0x4d6647);throw _0x4d6647;});}return _0x517c0e;})[_0xefef('0x22')](respondWithResult(_0x3a3244,0xc9))['catch'](handleError(_0x3a3244,null));};exports['update']=function(_0x24894e,_0x39e4a0){if(_0x24894e[_0xefef('0x62')]['id']){delete _0x24894e['body']['id'];}return db[_0xefef('0x42')]['find']({'where':{'id':_0x24894e['params']['id']},'include':[{'model':db[_0xefef('0x59')],'as':_0xefef('0x63')}]})[_0xefef('0x22')](handleEntityNotFound(_0x39e4a0,null))['then'](saveUpdates(_0x24894e[_0xefef('0x62')],null))[_0xefef('0x22')](respondWithResult(_0x39e4a0,null))[_0xefef('0x2d')](handleError(_0x39e4a0,null));};exports[_0xefef('0x39')]=function(_0x2a07b2,_0x3dae25){return db['WhatsappAccount'][_0xefef('0x5b')]({'where':{'id':_0x2a07b2[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x3dae25,null))[_0xefef('0x22')](removeEntity(_0x3dae25,null))[_0xefef('0x2d')](handleError(_0x3dae25,null));};exports[_0xefef('0x64')]=function(_0x323ed3,_0x36b6e2){return db[_0xefef('0x42')][_0xefef('0x64')]()[_0xefef('0x22')](respondWithResult(_0x36b6e2,null))['catch'](handleError(_0x36b6e2,null));};exports[_0xefef('0x65')]=function(_0x30890b,_0x2220a9,_0x55ecb9){if(_0x30890b[_0xefef('0x62')]['id']){delete _0x30890b['body']['id'];}return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x30890b[_0xefef('0x58')]['id']}})['then'](handleEntityNotFound(_0x2220a9,null))[_0xefef('0x22')](function(_0x438e1a){if(_0x438e1a){_0x30890b[_0xefef('0x62')][_0xefef('0x66')]=_0x438e1a['id'];return db[_0xefef('0x67')]['create'](_0x30890b['body']);}})['then'](respondWithResult(_0x2220a9,null))[_0xefef('0x2d')](handleError(_0x2220a9,null));};exports[_0xefef('0x68')]=function(_0x59837a,_0x117349,_0x5a9feb){var _0xdd815a={'raw':![],'where':{}};var _0x1fad1e={};var _0x1d9315={'count':0x0,'rows':[]};return db[_0xefef('0x42')][_0xefef('0x69')]({'where':{'id':_0x59837a['params']['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x117349,null))['then'](function(_0x4ff95b){if(_0x4ff95b){_0x1fad1e[_0xefef('0x45')]=_[_0xefef('0x5a')](db['Disposition'][_0xefef('0x43')]);_0x1fad1e['query']=_['keys'](_0x59837a[_0xefef('0x46')]);_0x1fad1e[_0xefef('0x47')]=_[_0xefef('0x48')](_0x1fad1e[_0xefef('0x45')],_0x1fad1e[_0xefef('0x46')]);_0xdd815a[_0xefef('0x4a')]=_[_0xefef('0x48')](_0x1fad1e[_0xefef('0x45')],qs['fields'](_0x59837a[_0xefef('0x46')]['fields']));_0xdd815a[_0xefef('0x4a')]=_0xdd815a[_0xefef('0x4a')][_0xefef('0x4b')]?_0xdd815a['attributes']:_0x1fad1e[_0xefef('0x45')];if(!_0x59837a['query'][_0xefef('0x4c')](_0xefef('0x4d'))){_0xdd815a[_0xefef('0x4e')]=qs[_0xefef('0x4e')](_0x59837a[_0xefef('0x46')][_0xefef('0x4e')]);_0xdd815a[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x59837a[_0xefef('0x46')][_0xefef('0x31')]);}_0xdd815a[_0xefef('0x6a')]=qs['sort'](_0x59837a['query'][_0xefef('0x4f')]);_0xdd815a[_0xefef('0x50')]=qs['filters'](_[_0xefef('0x6b')](_0x59837a[_0xefef('0x46')],_0x1fad1e[_0xefef('0x47')]));_0xdd815a[_0xefef('0x50')][_0xefef('0x66')]=_0x4ff95b['id'];if(_0x59837a[_0xefef('0x46')][_0xefef('0x51')]){_0xdd815a['where']=_[_0xefef('0x53')](_0xdd815a[_0xefef('0x50')],{'$or':_['map'](_0xdd815a[_0xefef('0x4a')],function(_0x484d8c){var _0x3a7b0d={};_0x3a7b0d[_0x484d8c]={'$like':'%'+_0x59837a[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x3a7b0d;})});}_0xdd815a=_['merge']({},_0xdd815a,_0x59837a[_0xefef('0x54')]);return db[_0xefef('0x67')][_0xefef('0x33')]({'where':_0xdd815a[_0xefef('0x50')]})[_0xefef('0x22')](function(_0x60e281){_0x1d9315[_0xefef('0x33')]=_0x60e281;if(_0x59837a[_0xefef('0x46')][_0xefef('0x55')]){_0xdd815a[_0xefef('0x56')]=[{'all':!![]}];}return db[_0xefef('0x67')][_0xefef('0x57')](_0xdd815a);})['then'](function(_0x4077f8){_0x1d9315[_0xefef('0x6c')]=_0x4077f8;return _0x1d9315;});}})[_0xefef('0x22')](respondWithFilteredResult(_0x117349,_0xdd815a))['catch'](handleError(_0x117349,null));};exports[_0xefef('0x6d')]=function(_0x229227,_0x3a9f2d,_0x374a42){return db['WhatsappAccount'][_0xefef('0x5b')]({'where':{'id':_0x229227[_0xefef('0x58')]['id']}})['then'](handleEntityNotFound(_0x3a9f2d,null))[_0xefef('0x22')](function(_0x8cfcad){if(_0x8cfcad){return _0x8cfcad[_0xefef('0x6d')](_0x229227[_0xefef('0x46')][_0xefef('0x6e')]);}})[_0xefef('0x22')](respondWithStatusCode(_0x3a9f2d,null))[_0xefef('0x2d')](handleError(_0x3a9f2d,null));};exports['addAnswer']=function(_0x47c0db,_0x362225,_0x3f200c){if(_0x47c0db[_0xefef('0x62')]['id']){delete _0x47c0db[_0xefef('0x62')]['id'];}return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x47c0db[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x362225,null))['then'](function(_0x24b744){if(_0x24b744){_0x47c0db[_0xefef('0x62')][_0xefef('0x66')]=_0x24b744['id'];return db['CannedAnswer'][_0xefef('0x5c')](_0x47c0db[_0xefef('0x62')]);}})[_0xefef('0x22')](respondWithResult(_0x362225,null))[_0xefef('0x2d')](handleError(_0x362225,null));};exports[_0xefef('0x6f')]=function(_0x2572b3,_0x20b5c9,_0x1b6d14){var _0x2f75ff={'raw':![],'where':{}};var _0x1ba13e={};var _0x392cec={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xefef('0x69')]({'where':{'id':_0x2572b3[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x20b5c9,null))[_0xefef('0x22')](function(_0x4b04c4){if(_0x4b04c4){_0x1ba13e['model']=_[_0xefef('0x5a')](db[_0xefef('0x70')]['rawAttributes']);_0x1ba13e[_0xefef('0x46')]=_[_0xefef('0x5a')](_0x2572b3[_0xefef('0x46')]);_0x1ba13e['filters']=_[_0xefef('0x48')](_0x1ba13e[_0xefef('0x45')],_0x1ba13e[_0xefef('0x46')]);_0x2f75ff[_0xefef('0x4a')]=_['intersection'](_0x1ba13e['model'],qs['fields'](_0x2572b3[_0xefef('0x46')][_0xefef('0x49')]));_0x2f75ff[_0xefef('0x4a')]=_0x2f75ff['attributes']['length']?_0x2f75ff[_0xefef('0x4a')]:_0x1ba13e[_0xefef('0x45')];if(!_0x2572b3['query']['hasOwnProperty'](_0xefef('0x4d'))){_0x2f75ff[_0xefef('0x4e')]=qs[_0xefef('0x4e')](_0x2572b3['query']['limit']);_0x2f75ff[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x2572b3[_0xefef('0x46')][_0xefef('0x31')]);}_0x2f75ff[_0xefef('0x6a')]=qs['sort'](_0x2572b3['query'][_0xefef('0x4f')]);_0x2f75ff[_0xefef('0x50')]=qs[_0xefef('0x47')](_[_0xefef('0x6b')](_0x2572b3[_0xefef('0x46')],_0x1ba13e[_0xefef('0x47')]));_0x2f75ff[_0xefef('0x50')][_0xefef('0x66')]=_0x4b04c4['id'];if(_0x2572b3[_0xefef('0x46')][_0xefef('0x51')]){_0x2f75ff[_0xefef('0x50')]=_[_0xefef('0x53')](_0x2f75ff[_0xefef('0x50')],{'$or':_[_0xefef('0x41')](_0x2f75ff[_0xefef('0x4a')],function(_0x53132b){var _0x45687e={};_0x45687e[_0x53132b]={'$like':'%'+_0x2572b3[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x45687e;})});}_0x2f75ff=_['merge']({},_0x2f75ff,_0x2572b3['options']);return db['CannedAnswer']['count']({'where':_0x2f75ff[_0xefef('0x50')]})[_0xefef('0x22')](function(_0x304bc2){_0x392cec['count']=_0x304bc2;if(_0x2572b3[_0xefef('0x46')]['includeAll']){_0x2f75ff[_0xefef('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xefef('0x57')](_0x2f75ff);})['then'](function(_0x656cd5){_0x392cec[_0xefef('0x6c')]=_0x656cd5;return _0x392cec;});}})[_0xefef('0x22')](respondWithFilteredResult(_0x20b5c9,_0x2f75ff))[_0xefef('0x2d')](handleError(_0x20b5c9,null));};exports[_0xefef('0x71')]=function(_0xb5c40,_0x1f5024,_0x1e745b){return db[_0xefef('0x42')]['find']({'where':{'id':_0xb5c40[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x1f5024,null))[_0xefef('0x22')](function(_0x501e37){if(_0x501e37){return _0x501e37[_0xefef('0x71')](_0xb5c40[_0xefef('0x46')][_0xefef('0x6e')]);}})['then'](respondWithStatusCode(_0x1f5024,null))[_0xefef('0x2d')](handleError(_0x1f5024,null));};exports['addAgents']=function(_0xd6058f,_0x39185d,_0x520957){return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0xd6058f[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x39185d,null))['then'](function(_0x163242){if(_0x163242){return _0x163242[_0xefef('0x72')](_0xd6058f[_0xefef('0x62')][_0xefef('0x6e')],_['omit'](_0xd6058f['body'],['ids','id'])||{})[_0xefef('0x73')](function(_0x513b51){for(var _0x497bce=0x0;_0x497bce<_0xd6058f[_0xefef('0x62')][_0xefef('0x6e')][_0xefef('0x4b')];_0x497bce+=0x1){socket['emit'](_0xefef('0x74'),{'UserId':Number(_0xd6058f['body'][_0xefef('0x6e')][_0x497bce]),'WhatsappAccountId':Number(_0xd6058f['params']['id'])});}return _0x513b51;});}})[_0xefef('0x22')](respondWithResult(_0x39185d,null))['catch'](handleError(_0x39185d,null));};exports[_0xefef('0x75')]=function(_0x1b6a83,_0x5d933a,_0x3a9267){return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x1b6a83[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x5d933a,null))['then'](function(_0x355d95){if(_0x355d95){return _0x355d95[_0xefef('0x75')](_0x1b6a83[_0xefef('0x46')]['ids'])['then'](function(){if(_[_0xefef('0x76')](_0x1b6a83[_0xefef('0x46')][_0xefef('0x6e')])){for(var _0x44ccea=0x0;_0x44ccea<_0x1b6a83[_0xefef('0x46')][_0xefef('0x6e')][_0xefef('0x4b')];_0x44ccea+=0x1){socket[_0xefef('0x77')](_0xefef('0x78'),{'UserId':Number(_0x1b6a83['query'][_0xefef('0x6e')][_0x44ccea]),'WhatsappAccountId':Number(_0x1b6a83['params']['id'])});}}else{socket[_0xefef('0x77')](_0xefef('0x78'),{'UserId':Number(_0x1b6a83['query'][_0xefef('0x6e')]),'WhatsappAccountId':Number(_0x1b6a83[_0xefef('0x58')]['id'])});}});}})[_0xefef('0x22')](respondWithStatusCode(_0x5d933a,null))[_0xefef('0x2d')](handleError(_0x5d933a,null));};exports[_0xefef('0x79')]=function(_0x1a97fe,_0x21bdee,_0x3d3215){var _0xe7c716={};var _0x1fefc4={};var _0x23115d;var _0x251655;return db[_0xefef('0x42')][_0xefef('0x69')]({'where':{'id':_0x1a97fe[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0x21bdee,null))[_0xefef('0x22')](function(_0x3bfc9c){if(_0x3bfc9c){_0x23115d=_0x3bfc9c;_0x1fefc4['model']=_[_0xefef('0x5a')](db[_0xefef('0x7a')][_0xefef('0x43')]);_0x1fefc4['query']=_[_0xefef('0x5a')](_0x1a97fe[_0xefef('0x46')]);_0x1fefc4[_0xefef('0x47')]=_[_0xefef('0x48')](_0x1fefc4[_0xefef('0x45')],_0x1fefc4[_0xefef('0x46')]);_0xe7c716[_0xefef('0x4a')]=_[_0xefef('0x48')](_0x1fefc4['model'],qs[_0xefef('0x49')](_0x1a97fe[_0xefef('0x46')][_0xefef('0x49')]));_0xe7c716[_0xefef('0x4a')]=_0xe7c716[_0xefef('0x4a')][_0xefef('0x4b')]?_0xe7c716[_0xefef('0x4a')]:_0x1fefc4[_0xefef('0x45')];_0xe7c716[_0xefef('0x6a')]=qs[_0xefef('0x4f')](_0x1a97fe[_0xefef('0x46')][_0xefef('0x4f')]);_0xe7c716[_0xefef('0x50')]=qs[_0xefef('0x47')](_[_0xefef('0x6b')](_0x1a97fe[_0xefef('0x46')],_0x1fefc4[_0xefef('0x47')]));if(_0x1a97fe[_0xefef('0x46')][_0xefef('0x51')]){_0xe7c716[_0xefef('0x50')]=_[_0xefef('0x53')](_0xe7c716['where'],{'$or':_[_0xefef('0x41')](_0xe7c716['attributes'],function(_0x7a2a4e){var _0x497735={};_0x497735[_0x7a2a4e]={'$like':'%'+_0x1a97fe[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x497735;})});}_0xe7c716=_[_0xefef('0x53')]({},_0xe7c716,_0x1a97fe[_0xefef('0x54')]);return _0x23115d['getAgents'](_0xe7c716);}})[_0xefef('0x22')](function(_0x362760){if(_0x362760){_0x251655=_0x362760[_0xefef('0x4b')];if(!_0x1a97fe[_0xefef('0x46')][_0xefef('0x4c')]('nolimit')){_0xe7c716[_0xefef('0x4e')]=qs[_0xefef('0x4e')](_0x1a97fe[_0xefef('0x46')][_0xefef('0x4e')]);_0xe7c716[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x1a97fe[_0xefef('0x46')][_0xefef('0x31')]);}return _0x23115d[_0xefef('0x79')](_0xe7c716);}})[_0xefef('0x22')](function(_0x2423f2){if(_0x2423f2){return _0x2423f2?{'count':_0x251655,'rows':_0x2423f2}:null;}})[_0xefef('0x22')](respondWithResult(_0x21bdee,null))[_0xefef('0x2d')](handleError(_0x21bdee,null));};exports['addApplications']=function(_0x2250c6,_0x2f5cd5){var _0x66138c=_0x2250c6[_0xefef('0x58')]['id'];var _0x3e3fc4=_0x2250c6[_0xefef('0x62')];var _0x558fad=0xc8;var _0x571f0d=null;return db[_0xefef('0x7b')][_0xefef('0x7c')]({'isolationLevel':db[_0xefef('0x7b')][_0xefef('0x7d')]['ISOLATION_LEVELS'][_0xefef('0x7e')]},function(_0x4d18eb){return db[_0xefef('0x42')][_0xefef('0x69')]({'where':{'id':_0x66138c},'transaction':_0x4d18eb})[_0xefef('0x22')](function(_0x1de9c5){if(_0x1de9c5){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x66138c},'transaction':_0x4d18eb})[_0xefef('0x22')](function(){var _0x620798=_[_0xefef('0x41')](_0x3e3fc4,function(_0x11842a){_0x11842a[_0xefef('0x66')]=_0x66138c;return _0x11842a;});return db[_0xefef('0x7f')][_0xefef('0x80')](_0x620798,{'transaction':_0x4d18eb});});}else{_0x558fad=0x194;_0x571f0d=[];}});})[_0xefef('0x22')](function(){if(_0x558fad!==0x194){return db[_0xefef('0x7f')][_0xefef('0x81')]({'where':{'WhatsappAccountId':_0x66138c},'order':_0xefef('0x82')})[_0xefef('0x22')](function(_0x4d2811){_0x571f0d=_0x4d2811;});}})['catch'](function(_0x5b2acf){_0x558fad=0x1f4;logger[_0xefef('0x28')](_0x5b2acf['stack']);if(_0x5b2acf[_0xefef('0x3e')]){delete _0x5b2acf[_0xefef('0x3e')];}_0x571f0d=_0x5b2acf;})[_0xefef('0x83')](function(){if(_0x571f0d===null){_0x2f5cd5[_0xefef('0x2e')](_0x558fad);}else{if(_0x558fad===0x1f4){_0x2f5cd5['status'](_0x558fad)['send'](_0x571f0d);}else{_0x2f5cd5[_0xefef('0x2f')](_0x558fad)[_0xefef('0x30')](_0x571f0d);}}});};exports['getApplications']=function(_0x54ed2a,_0xde628e,_0x5dc306){var _0x170e44={};var _0x171f8f={};var _0x43de39;var _0x2a3459;return db['WhatsappAccount']['findOne']({'where':{'id':_0x54ed2a[_0xefef('0x58')]['id']}})[_0xefef('0x22')](handleEntityNotFound(_0xde628e,null))[_0xefef('0x22')](function(_0x49db5a){if(_0x49db5a){_0x43de39=_0x49db5a;_0x171f8f['model']=_[_0xefef('0x5a')](db[_0xefef('0x7f')][_0xefef('0x43')]);_0x171f8f[_0xefef('0x46')]=_['keys'](_0x54ed2a[_0xefef('0x46')]);_0x171f8f[_0xefef('0x47')]=_[_0xefef('0x48')](_0x171f8f['model'],_0x171f8f[_0xefef('0x46')]);_0x170e44[_0xefef('0x4a')]=_['intersection'](_0x171f8f[_0xefef('0x45')],qs[_0xefef('0x49')](_0x54ed2a['query'][_0xefef('0x49')]));_0x170e44[_0xefef('0x4a')]=_0x170e44[_0xefef('0x4a')]['length']?_0x170e44['attributes']:_0x171f8f[_0xefef('0x45')];_0x170e44[_0xefef('0x6a')]=qs[_0xefef('0x4f')](_0x54ed2a[_0xefef('0x46')][_0xefef('0x4f')]);_0x170e44[_0xefef('0x50')]=qs['filters'](_[_0xefef('0x6b')](_0x54ed2a[_0xefef('0x46')],_0x171f8f['filters']));if(_0x54ed2a['query']['filter']){_0x170e44[_0xefef('0x50')]=_[_0xefef('0x53')](_0x170e44[_0xefef('0x50')],{'$or':_['map'](_0x170e44[_0xefef('0x4a')],function(_0x5796d0){var _0x273dbe={};_0x273dbe[_0x5796d0]={'$like':'%'+_0x54ed2a[_0xefef('0x46')][_0xefef('0x51')]+'%'};return _0x273dbe;})});}_0x170e44=_[_0xefef('0x53')]({},_0x170e44,_0x54ed2a['options']);return _0x43de39['getApplications'](_0x170e44);}})['then'](function(_0x3ab7e3){if(_0x3ab7e3){_0x2a3459=_0x3ab7e3[_0xefef('0x4b')];if(!_0x54ed2a[_0xefef('0x46')][_0xefef('0x4c')](_0xefef('0x4d'))){_0x170e44[_0xefef('0x4e')]=qs[_0xefef('0x4e')](_0x54ed2a[_0xefef('0x46')][_0xefef('0x4e')]);_0x170e44[_0xefef('0x31')]=qs[_0xefef('0x31')](_0x54ed2a[_0xefef('0x46')]['offset']);}return _0x43de39[_0xefef('0x84')](_0x170e44);}})[_0xefef('0x22')](function(_0x4a249e){if(_0x4a249e){return _0x4a249e?{'count':_0x2a3459,'rows':_0x4a249e}:null;}})[_0xefef('0x22')](respondWithResult(_0xde628e,null))[_0xefef('0x2d')](handleError(_0xde628e,null));};exports['notify']=function(_0x45ac3b,_0x598e3c,_0x2f85c5){var _0x16c63f={'channel':'whatsapp'};var _0x2fd36a=[];var _0x1e4c26=[];var _0x7c0432={};return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x45ac3b[_0xefef('0x58')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0xefef('0x85')}]})[_0xefef('0x22')](handleEntityNotFound(_0x598e3c,null))[_0xefef('0x22')](function(_0x1b752a){_0x16c63f[_0xefef('0x86')]=_0x1b752a;if(_0x16c63f[_0xefef('0x86')]&&_0x16c63f[_0xefef('0x86')][_0xefef('0x87')]===_0xefef('0x88')&&_0x45ac3b['body'][_0xefef('0x89')]){if(_0x45ac3b[_0xefef('0x62')]['statuses']['length']===0x0)return;if(_0x45ac3b['body'][_0xefef('0x89')][0x0][_0xefef('0x8a')]!==_0xefef('0x8b'))return;return db[_0xefef('0x8c')][_0xefef('0x38')]({'read':!![],'readAt':_0x45ac3b['body']['statuses'][0x0][_0xefef('0x8d')]},{'where':{'messageId':_0x45ac3b[_0xefef('0x62')]['statuses'][0x0][_0xefef('0x8e')]},'individualHooks':!![]})['then'](function(_0x25cc0e){return _0x598e3c['status'](0xc8)[_0xefef('0x30')](_0x25cc0e);});}_0x16c63f[_0xefef('0x8f')]=_[_0xefef('0x90')](_0x1b752a[_0xefef('0x85')],['priority'],[_0xefef('0x91')]);if(_0x16c63f[_0xefef('0x86')][_0xefef('0x85')]){delete _0x16c63f[_0xefef('0x86')][_0xefef('0x85')];}return db['CmContact'][_0xefef('0x64')]()[_0xefef('0x22')](function(_0x51cf57){if(!_0x51cf57){throw new db[(_0xefef('0x92'))]['ValidationError'](_0xefef('0x93'));}_0x2fd36a=_[_0xefef('0x94')](_[_0xefef('0x5a')](_0x51cf57),[_0xefef('0x95'),_0xefef('0x96')]);_0x1e4c26=_[_0xefef('0x94')](_[_0xefef('0x5a')](_0x51cf57),[_0xefef('0x95'),_0xefef('0x96'),_0xefef('0x97'),'ListId']);_0x16c63f[_0xefef('0x62')]={'mapKey':_0xefef('0x98')};if(_0x16c63f['account']&&_0x16c63f[_0xefef('0x86')][_0xefef('0x87')]==='twilio'){_0x16c63f[_0xefef('0x62')]['from']=_0x45ac3b['body'][_0xefef('0x99')][_0xefef('0x9a')]('whatsapp:','');_0x16c63f[_0xefef('0x62')][_0xefef('0x62')]=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9b')];_0x16c63f['body'][_0xefef('0x9c')]=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9d')];}if(_0x16c63f['account']&&_0x16c63f[_0xefef('0x86')][_0xefef('0x87')]===_0xefef('0x88')){_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')]=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9f')][0x0][_0xefef('0x9e')];_0x16c63f[_0xefef('0x62')][_0xefef('0x62')]=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9f')][0x0]['message']['body'];_0x16c63f['body']['messageId']=_0x45ac3b[_0xefef('0x62')][_0xefef('0x9f')][0x0][_0xefef('0x8e')];}if(_0x16c63f[_0xefef('0x62')]['id']){delete _0x16c63f['body']['id'];}if(_['isNil'](_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')])){throw new db[(_0xefef('0x92'))][(_0xefef('0xa0'))]('from\x20is\x20mandatory');}if(_[_0xefef('0xa1')](_0x16c63f[_0xefef('0x62')][_0xefef('0x62')])||_0x16c63f[_0xefef('0x62')][_0xefef('0x62')]===''){throw new db[(_0xefef('0x92'))][(_0xefef('0xa0'))](_0xefef('0xa2'));}if(_[_0xefef('0xa1')](_0x16c63f[_0xefef('0x62')][_0xefef('0xa3')])){throw new db[(_0xefef('0x92'))]['ValidationError'](_0xefef('0xa4')+_0x1e4c26);}if(!_['includes'](_0x1e4c26,_0x16c63f[_0xefef('0x62')][_0xefef('0xa3')])){throw new db[(_0xefef('0x92'))]['ValidationError'](_0xefef('0xa5')+_0x1e4c26);}_0x7c0432[_0x16c63f[_0xefef('0x62')][_0xefef('0xa3')]]=_0x16c63f['body']['from'];return db[_0xefef('0xa6')][_0xefef('0x5b')]({'where':{'id':_0x16c63f['account'][_0xefef('0xa7')]},'include':[{'model':db['CmContact'],'as':_0xefef('0xa8'),'where':_0x7c0432,'limit':0x1,'order':[[_0xefef('0x96'),_0xefef('0xa9')]]}]});})[_0xefef('0x22')](handleEntityNotFound(_0x598e3c,null))[_0xefef('0x22')](function(_0x3a0e78){if(_0x3a0e78){_0x16c63f[_0xefef('0xaa')]=_[_0xefef('0xab')](_0x3a0e78,['Contacts']);if(_0x3a0e78[_0xefef('0xa8')][_0xefef('0x4b')]){return _0x3a0e78[_0xefef('0xa8')][0x0];}var _0xaf0c2d=_[_0xefef('0xac')](_0x16c63f[_0xefef('0x62')],{'firstName':_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')],'ListId':_0x3a0e78['id']});_0xaf0c2d[_0x16c63f['body'][_0xefef('0xa3')]]=_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')];return db[_0xefef('0xad')]['create'](_0xaf0c2d,{'fields':_0x2fd36a,'raw':!![]});}})[_0xefef('0x22')](handleEntityNotFound(_0x598e3c,null))[_0xefef('0x22')](function(_0x18e4ba){if(_0x18e4ba){_0x16c63f['contact']=_0x18e4ba;var _0x521bcf={'ContactId':_0x18e4ba['id'],'phone':_0x16c63f['body'][_0xefef('0x9e')],'WhatsappAccountId':_0x45ac3b[_0xefef('0x58')]['id']};var _0x11e7c6={'ContactId':_0x18e4ba['id'],'WhatsappAccountId':_0x45ac3b['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x11e7c6})[_0xefef('0x22')](function(_0x356a12){if(_0x356a12){return[_0x356a12,![]];}return db[_0xefef('0xae')][_0xefef('0x5c')](_0x521bcf)['then'](function(_0x5a3a60){return[_0x5a3a60,!![]];});});}})[_0xefef('0x73')](function(_0x4f2f52,_0x57bf3b){_0x16c63f[_0xefef('0xaf')]=_0x4f2f52['get']({'plain':!![]});_0x16c63f[_0xefef('0xaf')]['created']=![];if(_0x57bf3b){if(_0x16c63f[_0xefef('0x86')]['autoclose']){_0x16c63f[_0xefef('0x8f')][_0xefef('0xb0')]({'id':0x0,'priority':_0x16c63f[_0xefef('0x8f')][_0xefef('0x4b')]+0x1,'app':_0xefef('0xb1'),'appdata':_0xefef('0xb2'),'interval':_0xefef('0xb3')});}_0x16c63f['interaction'][_0xefef('0xb4')]=!![];}return db[_0xefef('0x8c')]['create']({'phone':_0x16c63f[_0xefef('0x62')][_0xefef('0x9e')],'messageId':_0x16c63f['body'][_0xefef('0x9c')],'body':_0x16c63f[_0xefef('0x62')][_0xefef('0x62')],'WhatsappAccountId':_0x45ac3b[_0xefef('0x58')]['id'],'WhatsappInteractionId':_0x4f2f52['id'],'direction':'in','ContactId':_0x4f2f52['ContactId'],'AttachmentId':_0x16c63f[_0xefef('0x62')][_0xefef('0xb5')]});})[_0xefef('0x22')](function(_0x46290e){_0x16c63f['message']=_0x46290e;if(_0x16c63f[_0xefef('0xaf')][_0xefef('0xb6')]){return db[_0xefef('0x7a')]['find']({'attributes':['id',_0xefef('0x3e')],'where':{'id':_0x16c63f['interaction']['UserId']}})[_0xefef('0x22')](function(_0x36b260){if(_0x36b260){_0x16c63f['applications'][_0xefef('0xb7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x36b260['name']+','+(_0x16c63f[_0xefef('0x86')][_0xefef('0xb8')]||0xa),'interval':_0xefef('0xb3')});}return respondWithRpcPromise(_0xefef('0xb9'),_0xefef('0xba'),_0x16c63f);});}return respondWithRpcPromise('Start',_0xefef('0xba'),_0x16c63f);})[_0xefef('0x22')](function(_0x110669){if(_0x110669){var _0xf54d27=0xc8;var _0x1ad142=_0xefef('0xbb');logger[_0xefef('0x23')](_0xefef('0x26'),_0x1ad142,_0xf54d27,_0xefef('0xbc'));logger['debug'](_0xefef('0xbd'),_0x1ad142,_0xf54d27,_0xefef('0xbc'),JSON[_0xefef('0x27')](_0x110669));if(_0x16c63f[_0xefef('0x86')]['type']===_0xefef('0xbe')){return _0x598e3c['status'](_0xf54d27)[_0xefef('0x34')](_0xefef('0xbf'),_0xefef('0xc0'))[_0xefef('0x3f')]('\x0a');}else{return _0x598e3c[_0xefef('0x2f')](_0xf54d27)[_0xefef('0x30')](_0x110669);}}});})[_0xefef('0x2d')](handleError(_0x598e3c,null));};exports[_0xefef('0x3f')]=function(_0x1d7e21,_0xdfb9be,_0x2d71cf){var _0x56d5ab,_0x54288b,_0x490078;if(_[_0xefef('0xa1')](_0x1d7e21[_0xefef('0x62')][_0xefef('0x62')])||_0x1d7e21[_0xefef('0x62')][_0xefef('0x62')]===''){throw new db['Sequelize'][(_0xefef('0xa0'))](_0xefef('0xa2'));}if(_[_0xefef('0xa1')](_0x1d7e21[_0xefef('0x62')]['to'])){throw new db[(_0xefef('0x92'))][(_0xefef('0xa0'))](_0xefef('0xc1'));}_0x56d5ab=_0x1d7e21['body']['to'];return db[_0xefef('0x42')][_0xefef('0x5b')]({'where':{'id':_0x1d7e21[_0xefef('0x58')]['id']},'include':[{'model':db[_0xefef('0xa6')],'as':_0xefef('0xc2'),'include':[{'model':db[_0xefef('0xad')],'as':_0xefef('0xa8'),'where':{'mobile':_0x56d5ab},'limit':0x1,'order':[[_0xefef('0x96'),'DESC']]}]}]})[_0xefef('0x22')](handleEntityNotFound(_0xdfb9be,null))[_0xefef('0x22')](function(_0x485d38){if(_0x485d38&&_0x485d38['List']){_0x54288b=_0x485d38[_0xefef('0xc3')]({'plain':!![]});if(_0x54288b[_0xefef('0xc2')]&&_0x54288b[_0xefef('0xc2')][_0xefef('0xa8')]['length']){return _0x54288b[_0xefef('0xc2')][_0xefef('0xa8')][0x0];}return db[_0xefef('0xad')][_0xefef('0x5c')](_[_0xefef('0xac')](_0x1d7e21[_0xefef('0x62')],{'firstName':_0x56d5ab,'mobile':_0x56d5ab,'phone':_0x56d5ab,'ListId':_0x54288b[_0xefef('0xa7')]}));}})['then'](handleEntityNotFound(_0xdfb9be,null))[_0xefef('0x22')](function(_0x3d0db7){if(_0x3d0db7){_0x490078=_0x3d0db7;return db[_0xefef('0xae')]['find']({'where':{'ContactId':_0x490078['id'],'closed':![],'WhatsappAccountId':_0x54288b['id']}})[_0xefef('0x22')](function(_0xc588d9){if(_0xc588d9){return[_0xc588d9,![]];}return db[_0xefef('0xae')][_0xefef('0x5c')]({'UserId':_0x1d7e21[_0xefef('0x5d')]['id'],'ContactId':_0x490078['id'],'WhatsappAccountId':_0x54288b['id'],'phone':_0x56d5ab,'firstMsgDirection':_0xefef('0xc4'),'Messages':[_[_0xefef('0x53')](_0x1d7e21[_0xefef('0x62')],{'read':![],'body':_0x1d7e21[_0xefef('0x62')][_0xefef('0x62')],'phone':_0x56d5ab,'WhatsappAccountId':_0x54288b['id'],'UserId':_0x1d7e21[_0xefef('0x5d')]['id'],'ContactId':_0x490078['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xefef('0xc5')}]})[_0xefef('0x22')](function(_0x3ca5a3){return[_0x3ca5a3,!![]];});});}})[_0xefef('0x73')](function(_0x1774e5,_0x32461f){if(_0x32461f){return _0x1774e5;}return db[_0xefef('0x8c')]['create'](_[_0xefef('0x53')](_0x1d7e21[_0xefef('0x62')],{'read':![],'body':_0x1d7e21['body'][_0xefef('0x62')],'phone':_0x56d5ab,'WhatsappAccountId':_0x54288b['id'],'WhatsappInteractionId':_0x1774e5['id'],'UserId':_0x1d7e21[_0xefef('0x5d')]['id'],'ContactId':_0x490078['id']}))[_0xefef('0x22')](function(_0x1d9050){_0x1774e5[_0xefef('0xc6')]['Messages']=[];_0x1774e5['dataValues'][_0xefef('0xc5')][_0xefef('0xb0')](_0x1d9050[_0xefef('0xc6')]);return _0x1774e5;});})[_0xefef('0x22')](respondWithResult(_0xdfb9be,null))[_0xefef('0x2d')](handleError(_0xdfb9be,null));}; \ No newline at end of file +var _0xf74d=['orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','From','replace','messageId','MessageSid','notifications','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','Contacts','DESC','list','WhatsappInteraction','interaction','created','push','close','unmanaged','*,*,*,*','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','stack','send','index','Pause','map','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','WhatsappAccountId','Disposition','order','rows','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addAgents','omit','spread','userWhatsappAccount:save','emit','userWhatsappAccount:remove','User','getAgents','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','finally','getApplications','notify','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','applications'];(function(_0x302e04,_0x476769){var _0x53e36f=function(_0x22342a){while(--_0x22342a){_0x302e04['push'](_0x302e04['shift']());}};_0x53e36f(++_0x476769);}(_0xf74d,0xfa));var _0xdf74=function(_0x599389,_0x2caba7){_0x599389=_0x599389-0x0;var _0x4b2f10=_0xf74d[_0x599389];return _0x4b2f10;};'use strict';var emlformat=require(_0xdf74('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf74('0x1'));var jsonpatch=require(_0xdf74('0x2'));var rp=require(_0xdf74('0x3'));var moment=require(_0xdf74('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdf74('0x5'));var util=require(_0xdf74('0x6'));var path=require(_0xdf74('0x7'));var sox=require(_0xdf74('0x8'));var csv=require(_0xdf74('0x9'));var ejs=require(_0xdf74('0xa'));var fs=require('fs');var fs_extra=require(_0xdf74('0xb'));var _=require(_0xdf74('0xc'));var squel=require(_0xdf74('0xd'));var crypto=require(_0xdf74('0xe'));var jsforce=require(_0xdf74('0xf'));var deskjs=require(_0xdf74('0x10'));var toCsv=require(_0xdf74('0x9'));var querystring=require('querystring');var Papa=require(_0xdf74('0x11'));var Redis=require('ioredis');var authService=require(_0xdf74('0x12'));var qs=require(_0xdf74('0x13'));var as=require(_0xdf74('0x14'));var hardwareService=require(_0xdf74('0x15'));var logger=require(_0xdf74('0x16'))(_0xdf74('0x17'));var utils=require(_0xdf74('0x18'));var config=require(_0xdf74('0x19'));var licenseUtil=require(_0xdf74('0x1a'));var db=require('../../mysqldb')['db'];config[_0xdf74('0x1b')]=_[_0xdf74('0x1c')](config[_0xdf74('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf74('0x1d'))(new Redis(config[_0xdf74('0x1b')]));require('./whatsappAccount.socket')[_0xdf74('0x1e')](socket);var jayson=require(_0xdf74('0x1f'));var client=jayson[_0xdf74('0x20')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4d2837,_0x5d2d14,_0xf44298,_0x5b101b){return new BPromise(function(_0x26df56,_0x52ee79){var _0x426b05=_0x5b101b||client;return _0x426b05[_0xdf74('0x21')](_0x4d2837,_0xf44298)[_0xdf74('0x22')](function(_0x59d6e7){logger[_0xdf74('0x23')](_0xdf74('0x24'),_0x5d2d14,_0xdf74('0x25'));logger[_0xdf74('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x5d2d14,_0xdf74('0x25'),JSON[_0xdf74('0x27')](_0x59d6e7));if(_0x59d6e7[_0xdf74('0x28')]){if(_0x59d6e7[_0xdf74('0x28')][_0xdf74('0x29')]===0x1f4){logger['error'](_0xdf74('0x24'),_0x5d2d14,_0x59d6e7[_0xdf74('0x28')][_0xdf74('0x2a')]);return _0x52ee79(_0x59d6e7[_0xdf74('0x28')][_0xdf74('0x2a')]);}logger[_0xdf74('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x5d2d14,_0x59d6e7['error'][_0xdf74('0x2a')]);return _0x26df56(_0x59d6e7[_0xdf74('0x28')][_0xdf74('0x2a')]);}else{logger[_0xdf74('0x23')](_0xdf74('0x24'),_0x5d2d14,_0xdf74('0x25'));_0x26df56(_0x59d6e7[_0xdf74('0x2b')][_0xdf74('0x2a')]);}})[_0xdf74('0x2c')](function(_0x197079){logger[_0xdf74('0x28')](_0xdf74('0x24'),_0x5d2d14,_0x197079);_0x52ee79(_0x197079);});});}function respondWithStatusCode(_0x43a262,_0x43c78b){_0x43c78b=_0x43c78b||0xcc;return function(_0xd8fa63){if(_0xd8fa63){return _0x43a262[_0xdf74('0x2d')](_0x43c78b);}return _0x43a262[_0xdf74('0x2e')](_0x43c78b)[_0xdf74('0x2f')]();};}function respondWithResult(_0x3ed5a3,_0x3015ac){_0x3015ac=_0x3015ac||0xc8;return function(_0x3097d8){if(_0x3097d8){return _0x3ed5a3[_0xdf74('0x2e')](_0x3015ac)[_0xdf74('0x30')](_0x3097d8);}};}function respondWithFilteredResult(_0x5b748d,_0x162f2b){return function(_0x39b088){if(_0x39b088){var _0x4fba9d=typeof _0x162f2b[_0xdf74('0x31')]===_0xdf74('0x32')&&typeof _0x162f2b['limit']===_0xdf74('0x32');var _0x42d3b3=_0x39b088[_0xdf74('0x33')];var _0x5208fd=_0x4fba9d?0x0:_0x162f2b[_0xdf74('0x31')];var _0x24139f=_0x4fba9d?_0x39b088[_0xdf74('0x33')]:_0x162f2b['offset']+_0x162f2b[_0xdf74('0x34')];var _0x18ee1a;if(_0x24139f>=_0x42d3b3){_0x24139f=_0x42d3b3;_0x18ee1a=0xc8;}else{_0x18ee1a=0xce;}_0x5b748d[_0xdf74('0x2e')](_0x18ee1a);return _0x5b748d[_0xdf74('0x35')](_0xdf74('0x36'),_0x5208fd+'-'+_0x24139f+'/'+_0x42d3b3)['json'](_0x39b088);}return null;};}function patchUpdates(_0x11087f){return function(_0x3cee42){try{jsonpatch[_0xdf74('0x37')](_0x3cee42,_0x11087f,!![]);}catch(_0x47e9ad){return BPromise[_0xdf74('0x38')](_0x47e9ad);}return _0x3cee42[_0xdf74('0x39')]();};}function saveUpdates(_0x543182,_0x199715){return function(_0x50d753){if(_0x50d753){return _0x50d753[_0xdf74('0x3a')](_0x543182)[_0xdf74('0x22')](function(_0xbbcf02){return _0xbbcf02;});}return null;};}function removeEntity(_0x26ebe1,_0x36bc8b){return function(_0x12e627){if(_0x12e627){return _0x12e627['destroy']()['then'](function(){var _0x3901c0=_0x12e627[_0xdf74('0x3b')]({'plain':!![]});var _0x464770='WhatsappAccounts';return db[_0xdf74('0x3c')][_0xdf74('0x3d')]({'where':{'type':_0x464770,'resourceId':_0x3901c0['id']}})[_0xdf74('0x22')](function(){return _0x12e627;});})[_0xdf74('0x22')](function(){_0x26ebe1[_0xdf74('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c795a,_0x139641){return function(_0x487d3e){if(!_0x487d3e){_0x3c795a[_0xdf74('0x2d')](0x194);}return _0x487d3e;};}function handleError(_0x3b9597,_0x9c7731){_0x9c7731=_0x9c7731||0x1f4;return function(_0x2c3160){logger['error'](_0x2c3160[_0xdf74('0x3e')]);if(_0x2c3160['name']){delete _0x2c3160['name'];}_0x3b9597[_0xdf74('0x2e')](_0x9c7731)[_0xdf74('0x3f')](_0x2c3160);};}exports[_0xdf74('0x40')]=function(_0xb678fd,_0x10fc36){var _0x56a1c3={'include':[{'model':db[_0xdf74('0x41')],'as':'mandatoryDispositionPause'}]},_0x5428bc={},_0x103f41={'count':0x0,'rows':[]};var _0x140c50=_[_0xdf74('0x42')](db['WhatsappAccount'][_0xdf74('0x43')],function(_0x31d6e6){return{'name':_0x31d6e6[_0xdf74('0x44')],'type':_0x31d6e6[_0xdf74('0x45')]['key']};});_0x5428bc[_0xdf74('0x46')]=_['map'](_0x140c50,_0xdf74('0x47'));_0x5428bc['query']=_[_0xdf74('0x48')](_0xb678fd['query']);_0x5428bc[_0xdf74('0x49')]=_[_0xdf74('0x4a')](_0x5428bc[_0xdf74('0x46')],_0x5428bc[_0xdf74('0x4b')]);_0x56a1c3['attributes']=_[_0xdf74('0x4a')](_0x5428bc[_0xdf74('0x46')],qs['fields'](_0xb678fd[_0xdf74('0x4b')]['fields']));_0x56a1c3['attributes']=_0x56a1c3[_0xdf74('0x4c')][_0xdf74('0x4d')]?_0x56a1c3[_0xdf74('0x4c')]:_0x5428bc[_0xdf74('0x46')];if(!_0xb678fd[_0xdf74('0x4b')][_0xdf74('0x4e')](_0xdf74('0x4f'))){_0x56a1c3[_0xdf74('0x34')]=qs['limit'](_0xb678fd[_0xdf74('0x4b')][_0xdf74('0x34')]);_0x56a1c3['offset']=qs[_0xdf74('0x31')](_0xb678fd[_0xdf74('0x4b')][_0xdf74('0x31')]);}_0x56a1c3['order']=qs[_0xdf74('0x50')](_0xb678fd[_0xdf74('0x4b')][_0xdf74('0x50')]);_0x56a1c3['where']=qs[_0xdf74('0x49')](_[_0xdf74('0x51')](_0xb678fd[_0xdf74('0x4b')],_0x5428bc[_0xdf74('0x49')]),_0x140c50);if(_0xb678fd['query'][_0xdf74('0x52')]){_0x56a1c3[_0xdf74('0x53')]=_[_0xdf74('0x54')](_0x56a1c3['where'],{'$or':_['map'](_0x140c50,function(_0x246af7){if(_0x246af7[_0xdf74('0x45')]!==_0xdf74('0x55')){var _0xe616d6={};_0xe616d6[_0x246af7[_0xdf74('0x47')]]={'$like':'%'+_0xb678fd[_0xdf74('0x4b')][_0xdf74('0x52')]+'%'};return _0xe616d6;}})});}_0x56a1c3=_[_0xdf74('0x54')]({},_0x56a1c3,_0xb678fd[_0xdf74('0x56')]);var _0x1abe43={'where':_0x56a1c3[_0xdf74('0x53')]};return db[_0xdf74('0x57')]['count'](_0x1abe43)[_0xdf74('0x22')](function(_0x32dc5b){_0x103f41[_0xdf74('0x33')]=_0x32dc5b;if(_0xb678fd[_0xdf74('0x4b')][_0xdf74('0x58')]){_0x56a1c3[_0xdf74('0x59')]=[{'all':!![]}];}return db[_0xdf74('0x57')][_0xdf74('0x5a')](_0x56a1c3);})['then'](function(_0x25c179){_0x103f41['rows']=_0x25c179;return _0x103f41;})[_0xdf74('0x22')](respondWithFilteredResult(_0x10fc36,_0x56a1c3))[_0xdf74('0x2c')](handleError(_0x10fc36,null));};exports['show']=function(_0x23a91a,_0xf01671){var _0x407830={'raw':![],'where':{'id':_0x23a91a[_0xdf74('0x5b')]['id']},'include':[{'model':db[_0xdf74('0x41')],'as':'mandatoryDispositionPause'}]},_0xf46036={};_0xf46036['model']=_[_0xdf74('0x48')](db[_0xdf74('0x57')][_0xdf74('0x43')]);_0xf46036['query']=_[_0xdf74('0x48')](_0x23a91a[_0xdf74('0x4b')]);_0xf46036[_0xdf74('0x49')]=_[_0xdf74('0x4a')](_0xf46036[_0xdf74('0x46')],_0xf46036[_0xdf74('0x4b')]);_0x407830['attributes']=_[_0xdf74('0x4a')](_0xf46036[_0xdf74('0x46')],qs[_0xdf74('0x5c')](_0x23a91a[_0xdf74('0x4b')][_0xdf74('0x5c')]));_0x407830[_0xdf74('0x4c')]=_0x407830[_0xdf74('0x4c')][_0xdf74('0x4d')]?_0x407830[_0xdf74('0x4c')]:_0xf46036['model'];if(_0x23a91a[_0xdf74('0x4b')][_0xdf74('0x58')]){_0x407830[_0xdf74('0x59')]=[{'all':!![]}];}_0x407830=_[_0xdf74('0x54')]({},_0x407830,_0x23a91a[_0xdf74('0x56')]);return db['WhatsappAccount'][_0xdf74('0x5d')](_0x407830)[_0xdf74('0x22')](handleEntityNotFound(_0xf01671,null))['then'](respondWithResult(_0xf01671,null))[_0xdf74('0x2c')](handleError(_0xf01671,null));};exports[_0xdf74('0x5e')]=function(_0x18ff28,_0x18a957){return db[_0xdf74('0x57')][_0xdf74('0x5e')](_0x18ff28[_0xdf74('0x5f')],{})['then'](function(_0x36455b){var _0x3a6cf7=_0x18ff28[_0xdf74('0x60')]['get']({'plain':!![]});if(!_0x3a6cf7)throw new Error(_0xdf74('0x61'));if(_0x3a6cf7[_0xdf74('0x62')]===_0xdf74('0x60')){var _0x4d211a=_0x36455b['get']({'plain':!![]});var _0x424251='WhatsappAccounts';return db[_0xdf74('0x63')][_0xdf74('0x5d')]({'where':{'name':_0x424251,'userProfileId':_0x3a6cf7[_0xdf74('0x64')]},'raw':!![]})[_0xdf74('0x22')](function(_0x48e000){if(_0x48e000&&_0x48e000[_0xdf74('0x65')]===0x0){return db[_0xdf74('0x3c')][_0xdf74('0x5e')]({'name':_0x4d211a['name'],'resourceId':_0x4d211a['id'],'type':_0x48e000['name'],'sectionId':_0x48e000['id']},{})[_0xdf74('0x22')](function(){return _0x36455b;});}else{return _0x36455b;}})[_0xdf74('0x2c')](function(_0x43ef9a){logger[_0xdf74('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43ef9a);throw _0x43ef9a;});}return _0x36455b;})['then'](respondWithResult(_0x18a957,0xc9))[_0xdf74('0x2c')](handleError(_0x18a957,null));};exports[_0xdf74('0x3a')]=function(_0xba0e5d,_0x6f8a0a){if(_0xba0e5d[_0xdf74('0x5f')]['id']){delete _0xba0e5d[_0xdf74('0x5f')]['id'];}return db[_0xdf74('0x57')][_0xdf74('0x5d')]({'where':{'id':_0xba0e5d['params']['id']},'include':[{'model':db[_0xdf74('0x41')],'as':'mandatoryDispositionPause'}]})[_0xdf74('0x22')](handleEntityNotFound(_0x6f8a0a,null))[_0xdf74('0x22')](saveUpdates(_0xba0e5d[_0xdf74('0x5f')],null))['then'](respondWithResult(_0x6f8a0a,null))[_0xdf74('0x2c')](handleError(_0x6f8a0a,null));};exports[_0xdf74('0x3d')]=function(_0x5e018b,_0x1d97fa){return db[_0xdf74('0x57')]['find']({'where':{'id':_0x5e018b[_0xdf74('0x5b')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x1d97fa,null))['then'](removeEntity(_0x1d97fa,null))[_0xdf74('0x2c')](handleError(_0x1d97fa,null));};exports['describe']=function(_0x1806ea,_0x1d4433){return db[_0xdf74('0x57')][_0xdf74('0x66')]()[_0xdf74('0x22')](respondWithResult(_0x1d4433,null))[_0xdf74('0x2c')](handleError(_0x1d4433,null));};exports[_0xdf74('0x67')]=function(_0x55f72f,_0x21059f,_0x2beff9){if(_0x55f72f['body']['id']){delete _0x55f72f[_0xdf74('0x5f')]['id'];}return db[_0xdf74('0x57')][_0xdf74('0x5d')]({'where':{'id':_0x55f72f[_0xdf74('0x5b')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x21059f,null))[_0xdf74('0x22')](function(_0x3d0ed4){if(_0x3d0ed4){_0x55f72f[_0xdf74('0x5f')][_0xdf74('0x68')]=_0x3d0ed4['id'];return db[_0xdf74('0x69')][_0xdf74('0x5e')](_0x55f72f[_0xdf74('0x5f')]);}})[_0xdf74('0x22')](respondWithResult(_0x21059f,null))[_0xdf74('0x2c')](handleError(_0x21059f,null));};exports['getDispositions']=function(_0x37c2f4,_0xe7c3d,_0x535d0b){var _0x2572f7={'raw':![],'where':{}};var _0x27f008={};var _0x2bff75={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x37c2f4[_0xdf74('0x5b')]['id']}})['then'](handleEntityNotFound(_0xe7c3d,null))[_0xdf74('0x22')](function(_0x9354){if(_0x9354){_0x27f008[_0xdf74('0x46')]=_[_0xdf74('0x48')](db['Disposition']['rawAttributes']);_0x27f008[_0xdf74('0x4b')]=_['keys'](_0x37c2f4[_0xdf74('0x4b')]);_0x27f008[_0xdf74('0x49')]=_[_0xdf74('0x4a')](_0x27f008[_0xdf74('0x46')],_0x27f008['query']);_0x2572f7['attributes']=_[_0xdf74('0x4a')](_0x27f008['model'],qs[_0xdf74('0x5c')](_0x37c2f4[_0xdf74('0x4b')]['fields']));_0x2572f7[_0xdf74('0x4c')]=_0x2572f7['attributes'][_0xdf74('0x4d')]?_0x2572f7[_0xdf74('0x4c')]:_0x27f008[_0xdf74('0x46')];if(!_0x37c2f4[_0xdf74('0x4b')]['hasOwnProperty'](_0xdf74('0x4f'))){_0x2572f7['limit']=qs[_0xdf74('0x34')](_0x37c2f4[_0xdf74('0x4b')][_0xdf74('0x34')]);_0x2572f7[_0xdf74('0x31')]=qs[_0xdf74('0x31')](_0x37c2f4['query'][_0xdf74('0x31')]);}_0x2572f7[_0xdf74('0x6a')]=qs['sort'](_0x37c2f4[_0xdf74('0x4b')][_0xdf74('0x50')]);_0x2572f7[_0xdf74('0x53')]=qs[_0xdf74('0x49')](_[_0xdf74('0x51')](_0x37c2f4[_0xdf74('0x4b')],_0x27f008[_0xdf74('0x49')]));_0x2572f7['where']['WhatsappAccountId']=_0x9354['id'];if(_0x37c2f4[_0xdf74('0x4b')][_0xdf74('0x52')]){_0x2572f7['where']=_[_0xdf74('0x54')](_0x2572f7['where'],{'$or':_['map'](_0x2572f7[_0xdf74('0x4c')],function(_0x4edb4e){var _0x4e6a76={};_0x4e6a76[_0x4edb4e]={'$like':'%'+_0x37c2f4[_0xdf74('0x4b')][_0xdf74('0x52')]+'%'};return _0x4e6a76;})});}_0x2572f7=_[_0xdf74('0x54')]({},_0x2572f7,_0x37c2f4['options']);return db[_0xdf74('0x69')]['count']({'where':_0x2572f7[_0xdf74('0x53')]})[_0xdf74('0x22')](function(_0x3af5d3){_0x2bff75[_0xdf74('0x33')]=_0x3af5d3;if(_0x37c2f4[_0xdf74('0x4b')][_0xdf74('0x58')]){_0x2572f7['include']=[{'all':!![]}];}return db['Disposition'][_0xdf74('0x5a')](_0x2572f7);})['then'](function(_0x5c5394){_0x2bff75[_0xdf74('0x6b')]=_0x5c5394;return _0x2bff75;});}})[_0xdf74('0x22')](respondWithFilteredResult(_0xe7c3d,_0x2572f7))[_0xdf74('0x2c')](handleError(_0xe7c3d,null));};exports['removeDispositions']=function(_0x5bdf64,_0x1b08a4,_0x412a01){return db[_0xdf74('0x57')][_0xdf74('0x5d')]({'where':{'id':_0x5bdf64[_0xdf74('0x5b')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x1b08a4,null))[_0xdf74('0x22')](function(_0x1a0eef){if(_0x1a0eef){return _0x1a0eef['removeDispositions'](_0x5bdf64[_0xdf74('0x4b')][_0xdf74('0x6c')]);}})[_0xdf74('0x22')](respondWithStatusCode(_0x1b08a4,null))[_0xdf74('0x2c')](handleError(_0x1b08a4,null));};exports[_0xdf74('0x6d')]=function(_0x3e2a9d,_0x17e8e9,_0x38c3ce){if(_0x3e2a9d[_0xdf74('0x5f')]['id']){delete _0x3e2a9d[_0xdf74('0x5f')]['id'];}return db[_0xdf74('0x57')][_0xdf74('0x5d')]({'where':{'id':_0x3e2a9d[_0xdf74('0x5b')]['id']}})['then'](handleEntityNotFound(_0x17e8e9,null))['then'](function(_0x4f8dc2){if(_0x4f8dc2){_0x3e2a9d[_0xdf74('0x5f')][_0xdf74('0x68')]=_0x4f8dc2['id'];return db[_0xdf74('0x6e')][_0xdf74('0x5e')](_0x3e2a9d[_0xdf74('0x5f')]);}})[_0xdf74('0x22')](respondWithResult(_0x17e8e9,null))[_0xdf74('0x2c')](handleError(_0x17e8e9,null));};exports[_0xdf74('0x6f')]=function(_0x456ecb,_0xda49db,_0x437ada){var _0x3287b1={'raw':![],'where':{}};var _0x265fb5={};var _0x1145e0={'count':0x0,'rows':[]};return db[_0xdf74('0x57')][_0xdf74('0x70')]({'where':{'id':_0x456ecb['params']['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0xda49db,null))[_0xdf74('0x22')](function(_0x5b64f8){if(_0x5b64f8){_0x265fb5[_0xdf74('0x46')]=_[_0xdf74('0x48')](db[_0xdf74('0x6e')][_0xdf74('0x43')]);_0x265fb5[_0xdf74('0x4b')]=_[_0xdf74('0x48')](_0x456ecb[_0xdf74('0x4b')]);_0x265fb5[_0xdf74('0x49')]=_[_0xdf74('0x4a')](_0x265fb5['model'],_0x265fb5[_0xdf74('0x4b')]);_0x3287b1[_0xdf74('0x4c')]=_[_0xdf74('0x4a')](_0x265fb5[_0xdf74('0x46')],qs['fields'](_0x456ecb['query'][_0xdf74('0x5c')]));_0x3287b1[_0xdf74('0x4c')]=_0x3287b1['attributes']['length']?_0x3287b1['attributes']:_0x265fb5['model'];if(!_0x456ecb[_0xdf74('0x4b')][_0xdf74('0x4e')](_0xdf74('0x4f'))){_0x3287b1['limit']=qs[_0xdf74('0x34')](_0x456ecb['query']['limit']);_0x3287b1['offset']=qs[_0xdf74('0x31')](_0x456ecb[_0xdf74('0x4b')]['offset']);}_0x3287b1[_0xdf74('0x6a')]=qs[_0xdf74('0x50')](_0x456ecb['query'][_0xdf74('0x50')]);_0x3287b1[_0xdf74('0x53')]=qs[_0xdf74('0x49')](_['pick'](_0x456ecb[_0xdf74('0x4b')],_0x265fb5[_0xdf74('0x49')]));_0x3287b1[_0xdf74('0x53')][_0xdf74('0x68')]=_0x5b64f8['id'];if(_0x456ecb[_0xdf74('0x4b')][_0xdf74('0x52')]){_0x3287b1[_0xdf74('0x53')]=_['merge'](_0x3287b1['where'],{'$or':_['map'](_0x3287b1['attributes'],function(_0x3f5ed1){var _0x252a8f={};_0x252a8f[_0x3f5ed1]={'$like':'%'+_0x456ecb[_0xdf74('0x4b')][_0xdf74('0x52')]+'%'};return _0x252a8f;})});}_0x3287b1=_[_0xdf74('0x54')]({},_0x3287b1,_0x456ecb[_0xdf74('0x56')]);return db[_0xdf74('0x6e')][_0xdf74('0x33')]({'where':_0x3287b1[_0xdf74('0x53')]})[_0xdf74('0x22')](function(_0x57758f){_0x1145e0[_0xdf74('0x33')]=_0x57758f;if(_0x456ecb[_0xdf74('0x4b')][_0xdf74('0x58')]){_0x3287b1[_0xdf74('0x59')]=[{'all':!![]}];}return db[_0xdf74('0x6e')]['findAll'](_0x3287b1);})['then'](function(_0x33f0fd){_0x1145e0[_0xdf74('0x6b')]=_0x33f0fd;return _0x1145e0;});}})[_0xdf74('0x22')](respondWithFilteredResult(_0xda49db,_0x3287b1))[_0xdf74('0x2c')](handleError(_0xda49db,null));};exports[_0xdf74('0x71')]=function(_0x49349b,_0x2fb04d,_0x1c5b9d){return db['WhatsappAccount'][_0xdf74('0x5d')]({'where':{'id':_0x49349b[_0xdf74('0x5b')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x2fb04d,null))[_0xdf74('0x22')](function(_0x2dc2d8){if(_0x2dc2d8){return _0x2dc2d8[_0xdf74('0x71')](_0x49349b[_0xdf74('0x4b')][_0xdf74('0x6c')]);}})[_0xdf74('0x22')](respondWithStatusCode(_0x2fb04d,null))[_0xdf74('0x2c')](handleError(_0x2fb04d,null));};exports[_0xdf74('0x72')]=function(_0x37c4db,_0x35c6d1,_0x3e0872){return db[_0xdf74('0x57')][_0xdf74('0x5d')]({'where':{'id':_0x37c4db[_0xdf74('0x5b')]['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x35c6d1,null))[_0xdf74('0x22')](function(_0x25c74d){if(_0x25c74d){return _0x25c74d['addAgents'](_0x37c4db[_0xdf74('0x5f')][_0xdf74('0x6c')],_[_0xdf74('0x73')](_0x37c4db[_0xdf74('0x5f')],[_0xdf74('0x6c'),'id'])||{})[_0xdf74('0x74')](function(_0x1eed76){for(var _0x1da0c7=0x0;_0x1da0c7<_0x37c4db[_0xdf74('0x5f')][_0xdf74('0x6c')]['length'];_0x1da0c7+=0x1){socket['emit'](_0xdf74('0x75'),{'UserId':Number(_0x37c4db[_0xdf74('0x5f')][_0xdf74('0x6c')][_0x1da0c7]),'WhatsappAccountId':Number(_0x37c4db['params']['id'])});}return _0x1eed76;});}})['then'](respondWithResult(_0x35c6d1,null))['catch'](handleError(_0x35c6d1,null));};exports['removeAgents']=function(_0xe1b326,_0x45fc97,_0x5778ed){return db['WhatsappAccount'][_0xdf74('0x5d')]({'where':{'id':_0xe1b326['params']['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x45fc97,null))[_0xdf74('0x22')](function(_0x5de961){if(_0x5de961){return _0x5de961['removeAgents'](_0xe1b326[_0xdf74('0x4b')][_0xdf74('0x6c')])[_0xdf74('0x22')](function(){if(_['isArray'](_0xe1b326['query']['ids'])){for(var _0x25e6b5=0x0;_0x25e6b5<_0xe1b326['query'][_0xdf74('0x6c')][_0xdf74('0x4d')];_0x25e6b5+=0x1){socket[_0xdf74('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0xe1b326[_0xdf74('0x4b')][_0xdf74('0x6c')][_0x25e6b5]),'WhatsappAccountId':Number(_0xe1b326['params']['id'])});}}else{socket['emit'](_0xdf74('0x77'),{'UserId':Number(_0xe1b326['query']['ids']),'WhatsappAccountId':Number(_0xe1b326[_0xdf74('0x5b')]['id'])});}});}})[_0xdf74('0x22')](respondWithStatusCode(_0x45fc97,null))[_0xdf74('0x2c')](handleError(_0x45fc97,null));};exports['getAgents']=function(_0x431df2,_0x2044fa,_0x256f8e){var _0x2e97f6={};var _0x5e3959={};var _0x1816cf;var _0xa7248b;return db[_0xdf74('0x57')][_0xdf74('0x70')]({'where':{'id':_0x431df2['params']['id']}})[_0xdf74('0x22')](handleEntityNotFound(_0x2044fa,null))[_0xdf74('0x22')](function(_0x4c3ab6){if(_0x4c3ab6){_0x1816cf=_0x4c3ab6;_0x5e3959[_0xdf74('0x46')]=_[_0xdf74('0x48')](db[_0xdf74('0x78')][_0xdf74('0x43')]);_0x5e3959['query']=_['keys'](_0x431df2[_0xdf74('0x4b')]);_0x5e3959[_0xdf74('0x49')]=_[_0xdf74('0x4a')](_0x5e3959[_0xdf74('0x46')],_0x5e3959[_0xdf74('0x4b')]);_0x2e97f6[_0xdf74('0x4c')]=_['intersection'](_0x5e3959[_0xdf74('0x46')],qs[_0xdf74('0x5c')](_0x431df2['query'][_0xdf74('0x5c')]));_0x2e97f6[_0xdf74('0x4c')]=_0x2e97f6[_0xdf74('0x4c')][_0xdf74('0x4d')]?_0x2e97f6[_0xdf74('0x4c')]:_0x5e3959[_0xdf74('0x46')];_0x2e97f6['order']=qs['sort'](_0x431df2[_0xdf74('0x4b')]['sort']);_0x2e97f6[_0xdf74('0x53')]=qs[_0xdf74('0x49')](_[_0xdf74('0x51')](_0x431df2['query'],_0x5e3959[_0xdf74('0x49')]));if(_0x431df2[_0xdf74('0x4b')]['filter']){_0x2e97f6[_0xdf74('0x53')]=_['merge'](_0x2e97f6[_0xdf74('0x53')],{'$or':_[_0xdf74('0x42')](_0x2e97f6['attributes'],function(_0x22dceb){var _0x391453={};_0x391453[_0x22dceb]={'$like':'%'+_0x431df2[_0xdf74('0x4b')][_0xdf74('0x52')]+'%'};return _0x391453;})});}_0x2e97f6=_[_0xdf74('0x54')]({},_0x2e97f6,_0x431df2['options']);return _0x1816cf['getAgents'](_0x2e97f6);}})[_0xdf74('0x22')](function(_0x19ab37){if(_0x19ab37){_0xa7248b=_0x19ab37['length'];if(!_0x431df2[_0xdf74('0x4b')]['hasOwnProperty'](_0xdf74('0x4f'))){_0x2e97f6[_0xdf74('0x34')]=qs[_0xdf74('0x34')](_0x431df2[_0xdf74('0x4b')][_0xdf74('0x34')]);_0x2e97f6[_0xdf74('0x31')]=qs[_0xdf74('0x31')](_0x431df2['query'][_0xdf74('0x31')]);}return _0x1816cf[_0xdf74('0x79')](_0x2e97f6);}})[_0xdf74('0x22')](function(_0x4fc024){if(_0x4fc024){return _0x4fc024?{'count':_0xa7248b,'rows':_0x4fc024}:null;}})[_0xdf74('0x22')](respondWithResult(_0x2044fa,null))[_0xdf74('0x2c')](handleError(_0x2044fa,null));};exports['addApplications']=function(_0x5572ef,_0x3f44fb){var _0x59eb8b=_0x5572ef['params']['id'];var _0x1bce7e=_0x5572ef[_0xdf74('0x5f')];var _0x5e0de2=0xc8;var _0x146284=null;return db[_0xdf74('0x7a')][_0xdf74('0x7b')]({'isolationLevel':db[_0xdf74('0x7a')][_0xdf74('0x7c')][_0xdf74('0x7d')][_0xdf74('0x7e')]},function(_0x1a3145){return db[_0xdf74('0x57')][_0xdf74('0x70')]({'where':{'id':_0x59eb8b},'transaction':_0x1a3145})[_0xdf74('0x22')](function(_0x24c58a){if(_0x24c58a){return db['WhatsappApplication'][_0xdf74('0x3d')]({'where':{'WhatsappAccountId':_0x59eb8b},'transaction':_0x1a3145})[_0xdf74('0x22')](function(){var _0x17a98e=_[_0xdf74('0x42')](_0x1bce7e,function(_0x58e869){_0x58e869[_0xdf74('0x68')]=_0x59eb8b;return _0x58e869;});return db[_0xdf74('0x7f')][_0xdf74('0x80')](_0x17a98e,{'transaction':_0x1a3145});});}else{_0x5e0de2=0x194;_0x146284=[];}});})[_0xdf74('0x22')](function(){if(_0x5e0de2!==0x194){return db['WhatsappApplication'][_0xdf74('0x81')]({'where':{'WhatsappAccountId':_0x59eb8b},'order':'priority'})['then'](function(_0x5b28f6){_0x146284=_0x5b28f6;});}})['catch'](function(_0x1e20ea){_0x5e0de2=0x1f4;logger[_0xdf74('0x28')](_0x1e20ea['stack']);if(_0x1e20ea[_0xdf74('0x47')]){delete _0x1e20ea[_0xdf74('0x47')];}_0x146284=_0x1e20ea;})[_0xdf74('0x82')](function(){if(_0x146284===null){_0x3f44fb[_0xdf74('0x2d')](_0x5e0de2);}else{if(_0x5e0de2===0x1f4){_0x3f44fb[_0xdf74('0x2e')](_0x5e0de2)[_0xdf74('0x3f')](_0x146284);}else{_0x3f44fb[_0xdf74('0x2e')](_0x5e0de2)[_0xdf74('0x30')](_0x146284);}}});};exports[_0xdf74('0x83')]=function(_0x36d6b2,_0x3e2a0e,_0x395a0a){var _0x30a395={};var _0x3abd2d={};var _0x44ae4b;var _0x1eed1b;return db[_0xdf74('0x57')][_0xdf74('0x70')]({'where':{'id':_0x36d6b2['params']['id']}})['then'](handleEntityNotFound(_0x3e2a0e,null))[_0xdf74('0x22')](function(_0x58cb52){if(_0x58cb52){_0x44ae4b=_0x58cb52;_0x3abd2d['model']=_['keys'](db[_0xdf74('0x7f')][_0xdf74('0x43')]);_0x3abd2d[_0xdf74('0x4b')]=_[_0xdf74('0x48')](_0x36d6b2[_0xdf74('0x4b')]);_0x3abd2d[_0xdf74('0x49')]=_['intersection'](_0x3abd2d[_0xdf74('0x46')],_0x3abd2d[_0xdf74('0x4b')]);_0x30a395[_0xdf74('0x4c')]=_[_0xdf74('0x4a')](_0x3abd2d[_0xdf74('0x46')],qs[_0xdf74('0x5c')](_0x36d6b2[_0xdf74('0x4b')][_0xdf74('0x5c')]));_0x30a395['attributes']=_0x30a395[_0xdf74('0x4c')][_0xdf74('0x4d')]?_0x30a395['attributes']:_0x3abd2d[_0xdf74('0x46')];_0x30a395[_0xdf74('0x6a')]=qs['sort'](_0x36d6b2[_0xdf74('0x4b')][_0xdf74('0x50')]);_0x30a395[_0xdf74('0x53')]=qs[_0xdf74('0x49')](_[_0xdf74('0x51')](_0x36d6b2[_0xdf74('0x4b')],_0x3abd2d[_0xdf74('0x49')]));if(_0x36d6b2[_0xdf74('0x4b')]['filter']){_0x30a395[_0xdf74('0x53')]=_[_0xdf74('0x54')](_0x30a395[_0xdf74('0x53')],{'$or':_[_0xdf74('0x42')](_0x30a395[_0xdf74('0x4c')],function(_0x1e32a8){var _0x3482de={};_0x3482de[_0x1e32a8]={'$like':'%'+_0x36d6b2[_0xdf74('0x4b')][_0xdf74('0x52')]+'%'};return _0x3482de;})});}_0x30a395=_[_0xdf74('0x54')]({},_0x30a395,_0x36d6b2['options']);return _0x44ae4b[_0xdf74('0x83')](_0x30a395);}})[_0xdf74('0x22')](function(_0x30bc2d){if(_0x30bc2d){_0x1eed1b=_0x30bc2d[_0xdf74('0x4d')];if(!_0x36d6b2['query'][_0xdf74('0x4e')](_0xdf74('0x4f'))){_0x30a395['limit']=qs[_0xdf74('0x34')](_0x36d6b2['query'][_0xdf74('0x34')]);_0x30a395['offset']=qs[_0xdf74('0x31')](_0x36d6b2[_0xdf74('0x4b')][_0xdf74('0x31')]);}return _0x44ae4b[_0xdf74('0x83')](_0x30a395);}})[_0xdf74('0x22')](function(_0x10f862){if(_0x10f862){return _0x10f862?{'count':_0x1eed1b,'rows':_0x10f862}:null;}})[_0xdf74('0x22')](respondWithResult(_0x3e2a0e,null))[_0xdf74('0x2c')](handleError(_0x3e2a0e,null));};exports[_0xdf74('0x84')]=function(_0x35165c,_0x330c2e,_0x498f0c){var _0x429d8e={'channel':'whatsapp'};var _0x549599=[];var _0x3f87b7=[];var _0x1b58a0={};return db['WhatsappAccount'][_0xdf74('0x5d')]({'where':{'id':_0x35165c[_0xdf74('0x5b')]['id']},'include':[{'model':db[_0xdf74('0x7f')],'as':_0xdf74('0x85')}]})[_0xdf74('0x22')](handleEntityNotFound(_0x330c2e,null))[_0xdf74('0x22')](function(_0x13848f){_0x429d8e[_0xdf74('0x86')]=_0x13848f;if(_0x429d8e[_0xdf74('0x86')]&&_0x429d8e[_0xdf74('0x86')][_0xdf74('0x45')]===_0xdf74('0x87')&&_0x35165c[_0xdf74('0x5f')][_0xdf74('0x88')]){if(_0x35165c['body'][_0xdf74('0x88')][_0xdf74('0x4d')]===0x0)return;if(_0x35165c[_0xdf74('0x5f')]['statuses'][0x0]['state']!==_0xdf74('0x89'))return;return db[_0xdf74('0x8a')]['update']({'read':!![],'readAt':_0x35165c[_0xdf74('0x5f')][_0xdf74('0x88')][0x0][_0xdf74('0x8b')]},{'where':{'messageId':_0x35165c[_0xdf74('0x5f')]['statuses'][0x0][_0xdf74('0x8c')]},'individualHooks':!![]})['then'](function(_0x7a860d){return _0x330c2e[_0xdf74('0x2e')](0xc8)['json'](_0x7a860d);});}_0x429d8e[_0xdf74('0x8d')]=_[_0xdf74('0x8e')](_0x13848f['Applications'],[_0xdf74('0x8f')],[_0xdf74('0x90')]);if(_0x429d8e[_0xdf74('0x86')][_0xdf74('0x85')]){delete _0x429d8e['account'][_0xdf74('0x85')];}return db[_0xdf74('0x91')]['describe']()['then'](function(_0x2d5672){if(!_0x2d5672){throw new db[(_0xdf74('0x92'))][(_0xdf74('0x93'))](_0xdf74('0x94'));}_0x549599=_[_0xdf74('0x95')](_[_0xdf74('0x48')](_0x2d5672),[_0xdf74('0x96'),_0xdf74('0x97')]);_0x3f87b7=_['difference'](_[_0xdf74('0x48')](_0x2d5672),[_0xdf74('0x96'),'updatedAt',_0xdf74('0x98'),'ListId']);_0x429d8e['body']={'mapKey':_0xdf74('0x99')};if(_0x429d8e[_0xdf74('0x86')]&&_0x429d8e[_0xdf74('0x86')]['type']===_0xdf74('0x9a')){_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x9b')]=_0x35165c['body'][_0xdf74('0x9c')][_0xdf74('0x9d')]('whatsapp:','');_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x5f')]=_0x35165c[_0xdf74('0x5f')]['Body'];_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x9e')]=_0x35165c[_0xdf74('0x5f')][_0xdf74('0x9f')];}if(_0x429d8e['account']&&_0x429d8e[_0xdf74('0x86')]['type']===_0xdf74('0x87')){_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x9b')]=_0x35165c[_0xdf74('0x5f')][_0xdf74('0xa0')][0x0]['from'];_0x429d8e[_0xdf74('0x5f')]['body']=_0x35165c[_0xdf74('0x5f')][_0xdf74('0xa0')][0x0][_0xdf74('0x2a')][_0xdf74('0x5f')];_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x9e')]=_0x35165c[_0xdf74('0x5f')][_0xdf74('0xa0')][0x0][_0xdf74('0x8c')];}if(_0x429d8e[_0xdf74('0x5f')]['id']){delete _0x429d8e['body']['id'];}if(_[_0xdf74('0xa1')](_0x429d8e['body']['from'])){throw new db['Sequelize'][(_0xdf74('0x93'))](_0xdf74('0xa2'));}if(_[_0xdf74('0xa1')](_0x429d8e['body'][_0xdf74('0x5f')])||_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x5f')]===''){throw new db[(_0xdf74('0x92'))][(_0xdf74('0x93'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdf74('0xa1')](_0x429d8e[_0xdf74('0x5f')]['mapKey'])){throw new db[(_0xdf74('0x92'))]['ValidationError'](_0xdf74('0xa3')+_0x3f87b7);}if(!_[_0xdf74('0xa4')](_0x3f87b7,_0x429d8e[_0xdf74('0x5f')][_0xdf74('0xa5')])){throw new db[(_0xdf74('0x92'))][(_0xdf74('0x93'))](_0xdf74('0xa6')+_0x3f87b7);}_0x1b58a0[_0x429d8e['body'][_0xdf74('0xa5')]]=_0x429d8e['body'][_0xdf74('0x9b')];return db[_0xdf74('0xa7')][_0xdf74('0x5d')]({'where':{'id':_0x429d8e[_0xdf74('0x86')][_0xdf74('0xa8')]},'include':[{'model':db['CmContact'],'as':_0xdf74('0xa9'),'where':_0x1b58a0,'limit':0x1,'order':[[_0xdf74('0x97'),_0xdf74('0xaa')]]}]});})['then'](handleEntityNotFound(_0x330c2e,null))[_0xdf74('0x22')](function(_0x69b81a){if(_0x69b81a){_0x429d8e[_0xdf74('0xab')]=_['omit'](_0x69b81a,[_0xdf74('0xa9')]);if(_0x69b81a[_0xdf74('0xa9')][_0xdf74('0x4d')]){return _0x69b81a['Contacts'][0x0];}var _0x36be5b=_[_0xdf74('0x1c')](_0x429d8e[_0xdf74('0x5f')],{'firstName':_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x9b')],'ListId':_0x69b81a['id']});_0x36be5b[_0x429d8e[_0xdf74('0x5f')][_0xdf74('0xa5')]]=_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x9b')];return db[_0xdf74('0x91')]['create'](_0x36be5b,{'fields':_0x549599,'raw':!![]});}})[_0xdf74('0x22')](handleEntityNotFound(_0x330c2e,null))[_0xdf74('0x22')](function(_0x1add7b){if(_0x1add7b){_0x429d8e['contact']=_0x1add7b;var _0x147e4e={'ContactId':_0x1add7b['id'],'phone':_0x429d8e[_0xdf74('0x5f')]['from'],'WhatsappAccountId':_0x35165c[_0xdf74('0x5b')]['id']};var _0x5feee4={'ContactId':_0x1add7b['id'],'WhatsappAccountId':_0x35165c['params']['id'],'closed':![]};return db[_0xdf74('0xac')]['find']({'where':_0x5feee4})[_0xdf74('0x22')](function(_0x30cc2c){if(_0x30cc2c){return[_0x30cc2c,![]];}return db[_0xdf74('0xac')][_0xdf74('0x5e')](_0x147e4e)[_0xdf74('0x22')](function(_0x317a52){return[_0x317a52,!![]];});});}})[_0xdf74('0x74')](function(_0xa4780d,_0x287632){_0x429d8e[_0xdf74('0xad')]=_0xa4780d[_0xdf74('0x3b')]({'plain':!![]});_0x429d8e[_0xdf74('0xad')][_0xdf74('0xae')]=![];if(_0x287632){if(_0x429d8e[_0xdf74('0x86')]['autoclose']){_0x429d8e[_0xdf74('0x8d')][_0xdf74('0xaf')]({'id':0x0,'priority':_0x429d8e[_0xdf74('0x8d')][_0xdf74('0x4d')]+0x1,'app':_0xdf74('0xb0'),'appdata':_0xdf74('0xb1'),'interval':_0xdf74('0xb2')});}_0x429d8e[_0xdf74('0xad')][_0xdf74('0xae')]=!![];}return db[_0xdf74('0x8a')][_0xdf74('0x5e')]({'phone':_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x9b')],'messageId':_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x9e')],'body':_0x429d8e[_0xdf74('0x5f')][_0xdf74('0x5f')],'WhatsappAccountId':_0x35165c[_0xdf74('0x5b')]['id'],'WhatsappInteractionId':_0xa4780d['id'],'direction':'in','ContactId':_0xa4780d['ContactId'],'AttachmentId':_0x429d8e['body']['AttachmentId']});})[_0xdf74('0x22')](function(_0x59dcbf){_0x429d8e[_0xdf74('0x2a')]=_0x59dcbf;if(_0x429d8e[_0xdf74('0xad')][_0xdf74('0xb3')]){return db[_0xdf74('0x78')][_0xdf74('0x5d')]({'attributes':['id',_0xdf74('0x47')],'where':{'id':_0x429d8e[_0xdf74('0xad')][_0xdf74('0xb3')]}})['then'](function(_0x588249){if(_0x588249){_0x429d8e[_0xdf74('0x8d')][_0xdf74('0xb4')]({'id':0x0,'priority':0x0,'app':_0xdf74('0xb5'),'appdata':_0x588249[_0xdf74('0x47')]+','+(_0x429d8e[_0xdf74('0x86')][_0xdf74('0xb6')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xdf74('0xb7'),_0xdf74('0xb8'),_0x429d8e);});}return respondWithRpcPromise(_0xdf74('0xb7'),'startRouting',_0x429d8e);})[_0xdf74('0x22')](function(_0x2e3bd8){if(_0x2e3bd8){var _0x3ad59d=0xc8;var _0x207428='receiveMessage';logger[_0xdf74('0x23')](_0xdf74('0xb9'),_0x207428,_0x3ad59d,_0xdf74('0xba'));logger[_0xdf74('0x26')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x207428,_0x3ad59d,'entity\x20found',JSON[_0xdf74('0x27')](_0x2e3bd8));if(_0x429d8e[_0xdf74('0x86')]['type']==='twilio'){return _0x330c2e[_0xdf74('0x2e')](_0x3ad59d)[_0xdf74('0x35')](_0xdf74('0xbb'),_0xdf74('0xbc'))['send'](_0xdf74('0xbd'));}else{return _0x330c2e[_0xdf74('0x2e')](_0x3ad59d)[_0xdf74('0x30')](_0x2e3bd8);}}});})[_0xdf74('0x2c')](handleError(_0x330c2e,null));};exports[_0xdf74('0x3f')]=function(_0x1202ca,_0x5ab9ae,_0x235612){var _0x7748a,_0x3b5421,_0x560934;if(_[_0xdf74('0xa1')](_0x1202ca[_0xdf74('0x5f')][_0xdf74('0x5f')])||_0x1202ca[_0xdf74('0x5f')][_0xdf74('0x5f')]===''){throw new db[(_0xdf74('0x92'))][(_0xdf74('0x93'))](_0xdf74('0xbe'));}if(_[_0xdf74('0xa1')](_0x1202ca['body']['to'])){throw new db['Sequelize'][(_0xdf74('0x93'))](_0xdf74('0xbf'));}_0x7748a=_0x1202ca['body']['to'];return db[_0xdf74('0x57')]['find']({'where':{'id':_0x1202ca[_0xdf74('0x5b')]['id']},'include':[{'model':db[_0xdf74('0xa7')],'as':_0xdf74('0xc0'),'include':[{'model':db[_0xdf74('0x91')],'as':'Contacts','where':{'mobile':_0x7748a},'limit':0x1,'order':[[_0xdf74('0x97'),_0xdf74('0xaa')]]}]}]})[_0xdf74('0x22')](handleEntityNotFound(_0x5ab9ae,null))[_0xdf74('0x22')](function(_0x586934){if(_0x586934&&_0x586934['List']){_0x3b5421=_0x586934[_0xdf74('0x3b')]({'plain':!![]});if(_0x3b5421[_0xdf74('0xc0')]&&_0x3b5421['List'][_0xdf74('0xa9')][_0xdf74('0x4d')]){return _0x3b5421[_0xdf74('0xc0')][_0xdf74('0xa9')][0x0];}return db['CmContact']['create'](_[_0xdf74('0x1c')](_0x1202ca[_0xdf74('0x5f')],{'firstName':_0x7748a,'mobile':_0x7748a,'phone':_0x7748a,'ListId':_0x3b5421[_0xdf74('0xa8')]}));}})[_0xdf74('0x22')](handleEntityNotFound(_0x5ab9ae,null))[_0xdf74('0x22')](function(_0x525255){if(_0x525255){_0x560934=_0x525255;return db[_0xdf74('0xac')][_0xdf74('0x5d')]({'where':{'ContactId':_0x560934['id'],'closed':![],'WhatsappAccountId':_0x3b5421['id']}})[_0xdf74('0x22')](function(_0x206d70){if(_0x206d70){return[_0x206d70,![]];}return db[_0xdf74('0xac')][_0xdf74('0x5e')]({'UserId':_0x1202ca[_0xdf74('0x60')]['id'],'ContactId':_0x560934['id'],'WhatsappAccountId':_0x3b5421['id'],'phone':_0x7748a,'firstMsgDirection':_0xdf74('0xc1'),'Messages':[_[_0xdf74('0x54')](_0x1202ca[_0xdf74('0x5f')],{'read':![],'body':_0x1202ca[_0xdf74('0x5f')][_0xdf74('0x5f')],'phone':_0x7748a,'WhatsappAccountId':_0x3b5421['id'],'UserId':_0x1202ca[_0xdf74('0x60')]['id'],'ContactId':_0x560934['id']})]},{'include':[{'model':db[_0xdf74('0x8a')],'as':_0xdf74('0xc2')}]})[_0xdf74('0x22')](function(_0x2afc4c){return[_0x2afc4c,!![]];});});}})[_0xdf74('0x74')](function(_0x43e64f,_0x1cdde1){if(_0x1cdde1){return _0x43e64f;}return db[_0xdf74('0x8a')]['create'](_[_0xdf74('0x54')](_0x1202ca[_0xdf74('0x5f')],{'read':![],'body':_0x1202ca[_0xdf74('0x5f')][_0xdf74('0x5f')],'phone':_0x7748a,'WhatsappAccountId':_0x3b5421['id'],'WhatsappInteractionId':_0x43e64f['id'],'UserId':_0x1202ca[_0xdf74('0x60')]['id'],'ContactId':_0x560934['id']}))[_0xdf74('0x22')](function(_0x2cd1d5){_0x43e64f[_0xdf74('0xc3')]['Messages']=[];_0x43e64f[_0xdf74('0xc3')][_0xdf74('0xc2')][_0xdf74('0xaf')](_0x2cd1d5['dataValues']);return _0x43e64f;});})[_0xdf74('0x22')](respondWithResult(_0x5ab9ae,null))[_0xdf74('0x2c')](handleError(_0x5ab9ae,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 3305cda..157fdc8 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 _0x3b3c=['emit','hasOwnProperty','exports','WhatsappAccount','setMaxListeners','save','update','remove'];(function(_0x4dfe4c,_0x8050ad){var _0x11769d=function(_0x13cb76){while(--_0x13cb76){_0x4dfe4c['push'](_0x4dfe4c['shift']());}};_0x11769d(++_0x8050ad);}(_0x3b3c,0xd3));var _0xc3b3=function(_0x5b7327,_0x3da7cc){_0x5b7327=_0x5b7327-0x0;var _0x1518a1=_0x3b3c[_0x5b7327];return _0x1518a1;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0xc3b3('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc3b3('0x1')](0x0);var events={'afterCreate':_0xc3b3('0x2'),'afterUpdate':_0xc3b3('0x3'),'afterDestroy':_0xc3b3('0x4')};function emitEvent(_0x7a4878){return function(_0xc10ef,_0x12b963,_0x438ff8){WhatsappAccountEvents[_0xc3b3('0x5')](_0x7a4878+':'+_0xc10ef['id'],_0xc10ef);WhatsappAccountEvents[_0xc3b3('0x5')](_0x7a4878,_0xc10ef);_0x438ff8(null);};}for(var e in events){if(events[_0xc3b3('0x6')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xc3b3('0x7')]=WhatsappAccountEvents; \ No newline at end of file +var _0x6137=['../../mysqldb','WhatsappAccount','setMaxListeners','remove','emit','hook','events'];(function(_0x37c07d,_0xdbdb5f){var _0x10dadc=function(_0x2bafb7){while(--_0x2bafb7){_0x37c07d['push'](_0x37c07d['shift']());}};_0x10dadc(++_0xdbdb5f);}(_0x6137,0xbc));var _0x7613=function(_0x2e7f5c,_0x31915d){_0x2e7f5c=_0x2e7f5c-0x0;var _0x3c8afc=_0x6137[_0x2e7f5c];return _0x3c8afc;};'use strict';var EventEmitter=require(_0x7613('0x0'));var WhatsappAccount=require(_0x7613('0x1'))['db'][_0x7613('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7613('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x7613('0x4')};function emitEvent(_0x487a76){return function(_0x362528,_0x439ea3,_0x15b588){WhatsappAccountEvents[_0x7613('0x5')](_0x487a76+':'+_0x362528['id'],_0x362528);WhatsappAccountEvents['emit'](_0x487a76,_0x362528);_0x15b588(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x7613('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 7dd38f4..cfd32b6 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 _0x9a8a=['rimraf','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','api','moment','bluebird','path'];(function(_0x1b1dd4,_0x17fd4c){var _0x1a248b=function(_0x4dc972){while(--_0x4dc972){_0x1b1dd4['push'](_0x1b1dd4['shift']());}};_0x1a248b(++_0x17fd4c);}(_0x9a8a,0x17f));var _0xa9a8=function(_0x3c41e8,_0x1bb0ce){_0x3c41e8=_0x3c41e8-0x0;var _0x546c75=_0x9a8a[_0x3c41e8];return _0x546c75;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xa9a8('0x0'));var moment=require(_0xa9a8('0x1'));var BPromise=require(_0xa9a8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9a8('0x3'));var rimraf=require(_0xa9a8('0x4'));var config=require('../../config/environment');var attributes=require(_0xa9a8('0x5'));module['exports']=function(_0x2859c6,_0x142a52){return _0x2859c6[_0xa9a8('0x6')](_0xa9a8('0x7'),attributes,{'tableName':_0xa9a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b1e=['rimraf','./whatsappAccount.attributes','exports','lodash','../../config/logger','bluebird','request-promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x4b1e,0x1ae));var _0xe4b1=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0x4b1e[_0x51bda1];return _0x1ce08c;};'use strict';var _=require(_0xe4b1('0x0'));var util=require('util');var logger=require(_0xe4b1('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe4b1('0x2'));var rp=require(_0xe4b1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4b1('0x4'));var config=require('../../config/environment');var attributes=require(_0xe4b1('0x5'));module[_0xe4b1('0x6')]=function(_0x360899,_0x48dbca){return _0x360899['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index dc9bba5..5bf2b79 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 _0x6157=['find','options','raw','attributes','map','model','include','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowWhatsappAccount','WhatsappAccount'];(function(_0x52ab62,_0x203d25){var _0x42f499=function(_0x56adfd){while(--_0x56adfd){_0x52ab62['push'](_0x52ab62['shift']());}};_0x42f499(++_0x203d25);}(_0x6157,0x1a0));var _0x7615=function(_0x159330,_0x514203){_0x159330=_0x159330-0x0;var _0x1f5698=_0x6157[_0x159330];return _0x1f5698;};'use strict';var _=require(_0x7615('0x0'));var util=require(_0x7615('0x1'));var moment=require('moment');var BPromise=require(_0x7615('0x2'));var rs=require(_0x7615('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7615('0x4'))['db'];var utils=require(_0x7615('0x5'));var logger=require(_0x7615('0x6'))(_0x7615('0x7'));var config=require(_0x7615('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x7615('0x9')](config[_0x7615('0xa')],{'host':_0x7615('0xb'),'port':0x18eb});var socket=require(_0x7615('0xc'))(new Redis(config[_0x7615('0xa')]));require('./whatsappAccount.socket')[_0x7615('0xd')](socket);function respondWithRpcPromise(_0x1b97ec,_0x551add,_0x167b04){return new BPromise(function(_0x4e4374,_0x1574de){return client['request'](_0x1b97ec,_0x167b04)['then'](function(_0x3a5b3d){logger['info'](_0x7615('0xe'),_0x551add,_0x7615('0xf'));logger[_0x7615('0x10')](_0x7615('0x11'),_0x551add,_0x7615('0xf'),JSON[_0x7615('0x12')](_0x3a5b3d));if(_0x3a5b3d[_0x7615('0x13')]){if(_0x3a5b3d[_0x7615('0x13')]['code']===0x1f4){logger['error'](_0x7615('0xe'),_0x551add,_0x3a5b3d[_0x7615('0x13')][_0x7615('0x14')]);return _0x1574de(_0x3a5b3d[_0x7615('0x13')][_0x7615('0x14')]);}logger[_0x7615('0x13')](_0x7615('0xe'),_0x551add,_0x3a5b3d[_0x7615('0x13')][_0x7615('0x14')]);return _0x4e4374(_0x3a5b3d[_0x7615('0x13')]['message']);}else{logger[_0x7615('0x15')](_0x7615('0xe'),_0x551add,_0x7615('0xf'));_0x4e4374(_0x3a5b3d[_0x7615('0x16')]['message']);}})[_0x7615('0x17')](function(_0x45290e){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x551add,_0x45290e);_0x1574de(_0x45290e);});});}exports[_0x7615('0x18')]=function(_0x31409a){var _0x573fb7=this;return new Promise(function(_0x126e75,_0x263c2b){return db[_0x7615('0x19')][_0x7615('0x1a')]({'raw':_0x31409a[_0x7615('0x1b')]?_0x31409a[_0x7615('0x1b')][_0x7615('0x1c')]===undefined?!![]:![]:!![],'where':_0x31409a[_0x7615('0x1b')]?_0x31409a[_0x7615('0x1b')]['where']||null:null,'attributes':_0x31409a[_0x7615('0x1b')]?_0x31409a[_0x7615('0x1b')][_0x7615('0x1d')]||null:null,'include':_0x31409a[_0x7615('0x1b')]?_0x31409a[_0x7615('0x1b')]['include']?_[_0x7615('0x1e')](_0x31409a[_0x7615('0x1b')]['include'],function(_0x154543){return{'model':db[_0x154543[_0x7615('0x1f')]],'as':_0x154543['as'],'attributes':_0x154543['attributes'],'include':_0x154543[_0x7615('0x20')]?_[_0x7615('0x1e')](_0x154543[_0x7615('0x20')],function(_0x2b7f9d){return{'model':db[_0x2b7f9d[_0x7615('0x1f')]],'as':_0x2b7f9d['as'],'attributes':_0x2b7f9d['attributes'],'include':_0x2b7f9d[_0x7615('0x20')]?_[_0x7615('0x1e')](_0x2b7f9d['include'],function(_0x2757d1){return{'model':db[_0x2757d1[_0x7615('0x1f')]],'as':_0x2757d1['as'],'attributes':_0x2757d1[_0x7615('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7615('0x21')](function(_0x491d80){logger[_0x7615('0x15')](_0x7615('0x18'),_0x31409a);logger['debug'](_0x7615('0x18'),_0x31409a,JSON[_0x7615('0x12')](_0x491d80));_0x126e75(_0x491d80);})[_0x7615('0x17')](function(_0x15f231){logger[_0x7615('0x13')](_0x7615('0x18'),_0x15f231[_0x7615('0x14')],_0x31409a);_0x263c2b(_0x573fb7[_0x7615('0x13')](0x1f4,_0x15f231[_0x7615('0x14')]));});});}; \ No newline at end of file +var _0x1530=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','WhatsappAccount','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','lodash','util'];(function(_0x2e7f99,_0x23fb26){var _0x368568=function(_0x4ed8d9){while(--_0x4ed8d9){_0x2e7f99['push'](_0x2e7f99['shift']());}};_0x368568(++_0x23fb26);}(_0x1530,0xc6));var _0x0153=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x1530[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0x0153('0x0'));var util=require(_0x0153('0x1'));var moment=require(_0x0153('0x2'));var BPromise=require(_0x0153('0x3'));var rs=require(_0x0153('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0153('0x5'))['db'];var utils=require(_0x0153('0x6'));var logger=require(_0x0153('0x7'))(_0x0153('0x8'));var config=require(_0x0153('0x9'));var jayson=require(_0x0153('0xa'));var client=jayson[_0x0153('0xb')][_0x0153('0xc')]({'port':0x232a});config[_0x0153('0xd')]=_[_0x0153('0xe')](config[_0x0153('0xd')],{'host':_0x0153('0xf'),'port':0x18eb});var socket=require(_0x0153('0x10'))(new Redis(config[_0x0153('0xd')]));require(_0x0153('0x11'))['register'](socket);function respondWithRpcPromise(_0x521bba,_0x1df009,_0x27ec05){return new BPromise(function(_0xbab6b8,_0x5066a4){return client[_0x0153('0x12')](_0x521bba,_0x27ec05)[_0x0153('0x13')](function(_0xefeae9){logger['info'](_0x0153('0x14'),_0x1df009,_0x0153('0x15'));logger[_0x0153('0x16')](_0x0153('0x17'),_0x1df009,_0x0153('0x15'),JSON[_0x0153('0x18')](_0xefeae9));if(_0xefeae9[_0x0153('0x19')]){if(_0xefeae9[_0x0153('0x19')][_0x0153('0x1a')]===0x1f4){logger['error'](_0x0153('0x14'),_0x1df009,_0xefeae9[_0x0153('0x19')]['message']);return _0x5066a4(_0xefeae9[_0x0153('0x19')][_0x0153('0x1b')]);}logger[_0x0153('0x19')](_0x0153('0x14'),_0x1df009,_0xefeae9[_0x0153('0x19')][_0x0153('0x1b')]);return _0xbab6b8(_0xefeae9['error'][_0x0153('0x1b')]);}else{logger[_0x0153('0x1c')](_0x0153('0x14'),_0x1df009,_0x0153('0x15'));_0xbab6b8(_0xefeae9[_0x0153('0x1d')]['message']);}})[_0x0153('0x1e')](function(_0x1a66c7){logger[_0x0153('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0x1df009,_0x1a66c7);_0x5066a4(_0x1a66c7);});});}exports['ShowWhatsappAccount']=function(_0x1e281f){var _0x3e1f51=this;return new Promise(function(_0x189f85,_0x157e9c){return db[_0x0153('0x1f')]['find']({'raw':_0x1e281f[_0x0153('0x20')]?_0x1e281f[_0x0153('0x20')][_0x0153('0x21')]===undefined?!![]:![]:!![],'where':_0x1e281f[_0x0153('0x20')]?_0x1e281f[_0x0153('0x20')][_0x0153('0x22')]||null:null,'attributes':_0x1e281f[_0x0153('0x20')]?_0x1e281f[_0x0153('0x20')][_0x0153('0x23')]||null:null,'include':_0x1e281f[_0x0153('0x20')]?_0x1e281f['options'][_0x0153('0x24')]?_[_0x0153('0x25')](_0x1e281f['options'][_0x0153('0x24')],function(_0x4baa54){return{'model':db[_0x4baa54[_0x0153('0x26')]],'as':_0x4baa54['as'],'attributes':_0x4baa54[_0x0153('0x23')],'include':_0x4baa54['include']?_[_0x0153('0x25')](_0x4baa54[_0x0153('0x24')],function(_0x56906e){return{'model':db[_0x56906e[_0x0153('0x26')]],'as':_0x56906e['as'],'attributes':_0x56906e[_0x0153('0x23')],'include':_0x56906e[_0x0153('0x24')]?_[_0x0153('0x25')](_0x56906e[_0x0153('0x24')],function(_0xed71a4){return{'model':db[_0xed71a4[_0x0153('0x26')]],'as':_0xed71a4['as'],'attributes':_0xed71a4[_0x0153('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1de293){logger[_0x0153('0x1c')](_0x0153('0x27'),_0x1e281f);logger[_0x0153('0x16')](_0x0153('0x27'),_0x1e281f,JSON[_0x0153('0x18')](_0x1de293));_0x189f85(_0x1de293);})[_0x0153('0x1e')](function(_0x4a6810){logger[_0x0153('0x19')]('ShowWhatsappAccount',_0x4a6810[_0x0153('0x1b')],_0x1e281f);_0x157e9c(_0x3e1f51[_0x0153('0x19')](0x1f4,_0x4a6810[_0x0153('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 359a71c..6675815 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 _0x35a4=['removeListener','whatsappAccount:','./whatsappAccount.events','save','remove','update','emit'];(function(_0x5820f6,_0x543488){var _0x7c8fec=function(_0x5e2e4d){while(--_0x5e2e4d){_0x5820f6['push'](_0x5820f6['shift']());}};_0x7c8fec(++_0x543488);}(_0x35a4,0x128));var _0x435a=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x35a4[_0x680821];return _0x3f132c;};'use strict';var WhatsappAccountEvents=require(_0x435a('0x0'));var events=[_0x435a('0x1'),_0x435a('0x2'),_0x435a('0x3')];function createListener(_0xf8f056,_0x1dfc89){return function(_0x51153a){_0x1dfc89[_0x435a('0x4')](_0xf8f056,_0x51153a);};}function removeListener(_0x1e63b0,_0x201a1b){return function(){WhatsappAccountEvents[_0x435a('0x5')](_0x1e63b0,_0x201a1b);};}exports['register']=function(_0x22f8e6){for(var _0x511bba=0x0,_0x565e9f=events['length'];_0x511bba<_0x565e9f;_0x511bba++){var _0xccebb6=events[_0x511bba];var _0x6ce798=createListener(_0x435a('0x6')+_0xccebb6,_0x22f8e6);WhatsappAccountEvents['on'](_0xccebb6,_0x6ce798);}}; \ No newline at end of file +var _0x3ca7=['removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save','emit'];(function(_0x15264c,_0x1bdd4b){var _0x5e737c=function(_0x49ee38){while(--_0x49ee38){_0x15264c['push'](_0x15264c['shift']());}};_0x5e737c(++_0x1bdd4b);}(_0x3ca7,0xa5));var _0x73ca=function(_0x24106c,_0x367a6f){_0x24106c=_0x24106c-0x0;var _0xbaeb73=_0x3ca7[_0x24106c];return _0xbaeb73;};'use strict';var WhatsappAccountEvents=require(_0x73ca('0x0'));var events=[_0x73ca('0x1'),'remove','update'];function createListener(_0x44e827,_0x13a58b){return function(_0x59a5df){_0x13a58b[_0x73ca('0x2')](_0x44e827,_0x59a5df);};}function removeListener(_0x1d7d5d,_0x20c340){return function(){WhatsappAccountEvents[_0x73ca('0x3')](_0x1d7d5d,_0x20c340);};}exports[_0x73ca('0x4')]=function(_0x51ad2a){for(var _0x3c11a9=0x0,_0x25e981=events[_0x73ca('0x5')];_0x3c11a9<_0x25e981;_0x3c11a9++){var _0xc160f4=events[_0x3c11a9];var _0x31573a=createListener(_0x73ca('0x6')+_0xc160f4,_0x51ad2a);WhatsappAccountEvents['on'](_0xc160f4,_0x31573a);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index ad0c9bb..5bef874 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 _0xc701=['post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0x20552b,_0x13b1b8){var _0x3b0b6e=function(_0x293f01){while(--_0x293f01){_0x20552b['push'](_0x20552b['shift']());}};_0x3b0b6e(++_0x13b1b8);}(_0xc701,0x159));var _0x1c70=function(_0x1427e2,_0x5a60ba){_0x1427e2=_0x1427e2-0x0;var _0x3b2772=_0xc701[_0x1427e2];return _0x3b2772;};'use strict';var multer=require(_0x1c70('0x0'));var util=require(_0x1c70('0x1'));var path=require(_0x1c70('0x2'));var timeout=require(_0x1c70('0x3'));var express=require(_0x1c70('0x4'));var router=express[_0x1c70('0x5')]();var fs_extra=require(_0x1c70('0x6'));var auth=require(_0x1c70('0x7'));var interaction=require(_0x1c70('0x8'));var config=require(_0x1c70('0x9'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0x1c70('0xa')](),controller[_0x1c70('0xb')]);router[_0x1c70('0xc')](_0x1c70('0xd'),auth[_0x1c70('0xa')](),controller[_0x1c70('0xe')]);router[_0x1c70('0xf')]('/',auth[_0x1c70('0xa')](),controller[_0x1c70('0x10')]);router['put']('/:id',auth[_0x1c70('0xa')](),controller[_0x1c70('0x11')]);router['delete'](_0x1c70('0xd'),auth[_0x1c70('0xa')](),controller[_0x1c70('0x12')]);module[_0x1c70('0x13')]=router; \ No newline at end of file +var _0x430f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x4c0e4c,_0xf69c08){var _0x318372=function(_0x530b18){while(--_0x530b18){_0x4c0e4c['push'](_0x4c0e4c['shift']());}};_0x318372(++_0xf69c08);}(_0x430f,0x140));var _0xf430=function(_0x5d0765,_0x145489){_0x5d0765=_0x5d0765-0x0;var _0x3f94c8=_0x430f[_0x5d0765];return _0x3f94c8;};'use strict';var multer=require(_0xf430('0x0'));var util=require('util');var path=require(_0xf430('0x1'));var timeout=require(_0xf430('0x2'));var express=require(_0xf430('0x3'));var router=express[_0xf430('0x4')]();var fs_extra=require(_0xf430('0x5'));var auth=require(_0xf430('0x6'));var interaction=require(_0xf430('0x7'));var config=require(_0xf430('0x8'));var controller=require('./whatsappApplication.controller');router[_0xf430('0x9')]('/',auth['isAuthenticated'](),controller[_0xf430('0xa')]);router[_0xf430('0x9')](_0xf430('0xb'),auth[_0xf430('0xc')](),controller['show']);router[_0xf430('0xd')]('/',auth[_0xf430('0xc')](),controller[_0xf430('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf430('0xf')]);router[_0xf430('0x10')](_0xf430('0xb'),auth[_0xf430('0xc')](),controller[_0xf430('0x11')]);module[_0xf430('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 707a1e7..584d256 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 _0xa860=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x19ecaa,_0x48a0ff){var _0x473fa2=function(_0x36881c){while(--_0x36881c){_0x19ecaa['push'](_0x19ecaa['shift']());}};_0x473fa2(++_0x48a0ff);}(_0xa860,0x1b2));var _0x0a86=function(_0x3c3569,_0x5b54bf){_0x3c3569=_0x3c3569-0x0;var _0x23d45e=_0xa860[_0x3c3569];return _0x23d45e;};'use strict';var Sequelize=require(_0x0a86('0x0'));module[_0x0a86('0x1')]={'priority':{'type':Sequelize[_0x0a86('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0a86('0x3')},'appdata':{'type':Sequelize[_0x0a86('0x4')]()},'description':{'type':Sequelize[_0x0a86('0x5')]},'interval':{'type':Sequelize[_0x0a86('0x5')],'defaultValue':_0x0a86('0x6')}}; \ No newline at end of file +var _0xe4f9=['exports','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0xd2fb71,_0x2f6d54){var _0x2a71e5=function(_0x38b2a5){while(--_0x38b2a5){_0xd2fb71['push'](_0xd2fb71['shift']());}};_0x2a71e5(++_0x2f6d54);}(_0xe4f9,0x71));var _0x9e4f=function(_0x97b028,_0x1539f3){_0x97b028=_0x97b028-0x0;var _0x159e67=_0xe4f9[_0x97b028];return _0x159e67;};'use strict';var Sequelize=require(_0x9e4f('0x0'));module[_0x9e4f('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9e4f('0x2')],'allowNull':![],'defaultValue':_0x9e4f('0x3')},'appdata':{'type':Sequelize[_0x9e4f('0x4')]()},'description':{'type':Sequelize[_0x9e4f('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9e4f('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index beedcab..f28abab 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 _0x1241=['key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','filters','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','offset','undefined','limit','set','json','reject','update','then','destroy','end','error','stack','name','send','index','WhatsappApplication','fieldName','type'];(function(_0x132152,_0x364966){var _0x518966=function(_0x340ba0){while(--_0x340ba0){_0x132152['push'](_0x132152['shift']());}};_0x518966(++_0x364966);}(_0x1241,0xb4));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1124('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1124('0x1'));var jsonpatch=require(_0x1124('0x2'));var rp=require(_0x1124('0x3'));var moment=require(_0x1124('0x4'));var BPromise=require(_0x1124('0x5'));var Mustache=require('mustache');var util=require(_0x1124('0x6'));var path=require(_0x1124('0x7'));var sox=require(_0x1124('0x8'));var csv=require('to-csv');var ejs=require(_0x1124('0x9'));var fs=require('fs');var fs_extra=require(_0x1124('0xa'));var _=require(_0x1124('0xb'));var squel=require(_0x1124('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1124('0xd'));var querystring=require('querystring');var Papa=require(_0x1124('0xe'));var Redis=require(_0x1124('0xf'));var authService=require(_0x1124('0x10'));var qs=require(_0x1124('0x11'));var as=require(_0x1124('0x12'));var hardwareService=require(_0x1124('0x13'));var logger=require('../../config/logger')(_0x1124('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1124('0x15'))['db'];function respondWithStatusCode(_0x480e39,_0x548734){_0x548734=_0x548734||0xcc;return function(_0x249f75){if(_0x249f75){return _0x480e39[_0x1124('0x16')](_0x548734);}return _0x480e39[_0x1124('0x17')](_0x548734)['end']();};}function respondWithResult(_0x227291,_0x109f00){_0x109f00=_0x109f00||0xc8;return function(_0xb7e22b){if(_0xb7e22b){return _0x227291[_0x1124('0x17')](_0x109f00)['json'](_0xb7e22b);}};}function respondWithFilteredResult(_0x12ea42,_0x3d040d){return function(_0x2a8271){if(_0x2a8271){var _0x74a148=typeof _0x3d040d[_0x1124('0x18')]===_0x1124('0x19')&&typeof _0x3d040d[_0x1124('0x1a')]===_0x1124('0x19');var _0x3eed9d=_0x2a8271['count'];var _0x5e7506=_0x74a148?0x0:_0x3d040d[_0x1124('0x18')];var _0x55d2e3=_0x74a148?_0x2a8271['count']:_0x3d040d[_0x1124('0x18')]+_0x3d040d[_0x1124('0x1a')];var _0x392bc7;if(_0x55d2e3>=_0x3eed9d){_0x55d2e3=_0x3eed9d;_0x392bc7=0xc8;}else{_0x392bc7=0xce;}_0x12ea42[_0x1124('0x17')](_0x392bc7);return _0x12ea42[_0x1124('0x1b')]('Content-Range',_0x5e7506+'-'+_0x55d2e3+'/'+_0x3eed9d)[_0x1124('0x1c')](_0x2a8271);}return null;};}function patchUpdates(_0x19639a){return function(_0x8c1d68){try{jsonpatch['apply'](_0x8c1d68,_0x19639a,!![]);}catch(_0x4edfa8){return BPromise[_0x1124('0x1d')](_0x4edfa8);}return _0x8c1d68['save']();};}function saveUpdates(_0x294201,_0x48a548){return function(_0x32ad7a){if(_0x32ad7a){return _0x32ad7a[_0x1124('0x1e')](_0x294201)[_0x1124('0x1f')](function(_0xe5854f){return _0xe5854f;});}return null;};}function removeEntity(_0x3078c4,_0x3e98a7){return function(_0x94dc0b){if(_0x94dc0b){return _0x94dc0b[_0x1124('0x20')]()[_0x1124('0x1f')](function(){_0x3078c4[_0x1124('0x17')](0xcc)[_0x1124('0x21')]();});}};}function handleEntityNotFound(_0x4ff6e6,_0x5eb15f){return function(_0x1909fc){if(!_0x1909fc){_0x4ff6e6[_0x1124('0x16')](0x194);}return _0x1909fc;};}function handleError(_0x4c5299,_0xd91727){_0xd91727=_0xd91727||0x1f4;return function(_0x54cf47){logger[_0x1124('0x22')](_0x54cf47[_0x1124('0x23')]);if(_0x54cf47['name']){delete _0x54cf47[_0x1124('0x24')];}_0x4c5299[_0x1124('0x17')](_0xd91727)[_0x1124('0x25')](_0x54cf47);};}exports[_0x1124('0x26')]=function(_0x351ca9,_0x4d36e1){var _0x462825={},_0x38dddd={},_0x5b876f={'count':0x0,'rows':[]};var _0x5dac66=_['map'](db[_0x1124('0x27')]['rawAttributes'],function(_0x2227ac){return{'name':_0x2227ac[_0x1124('0x28')],'type':_0x2227ac[_0x1124('0x29')][_0x1124('0x2a')]};});_0x38dddd[_0x1124('0x2b')]=_[_0x1124('0x2c')](_0x5dac66,_0x1124('0x24'));_0x38dddd['query']=_[_0x1124('0x2d')](_0x351ca9[_0x1124('0x2e')]);_0x38dddd['filters']=_[_0x1124('0x2f')](_0x38dddd['model'],_0x38dddd[_0x1124('0x2e')]);_0x462825[_0x1124('0x30')]=_[_0x1124('0x2f')](_0x38dddd['model'],qs['fields'](_0x351ca9[_0x1124('0x2e')][_0x1124('0x31')]));_0x462825[_0x1124('0x30')]=_0x462825[_0x1124('0x30')][_0x1124('0x32')]?_0x462825[_0x1124('0x30')]:_0x38dddd[_0x1124('0x2b')];if(!_0x351ca9['query'][_0x1124('0x33')](_0x1124('0x34'))){_0x462825[_0x1124('0x1a')]=qs[_0x1124('0x1a')](_0x351ca9[_0x1124('0x2e')][_0x1124('0x1a')]);_0x462825[_0x1124('0x18')]=qs[_0x1124('0x18')](_0x351ca9[_0x1124('0x2e')][_0x1124('0x18')]);}_0x462825[_0x1124('0x35')]=qs[_0x1124('0x36')](_0x351ca9[_0x1124('0x2e')][_0x1124('0x36')]);_0x462825[_0x1124('0x37')]=qs['filters'](_[_0x1124('0x38')](_0x351ca9['query'],_0x38dddd['filters']),_0x5dac66);if(_0x351ca9[_0x1124('0x2e')]['filter']){_0x462825[_0x1124('0x37')]=_[_0x1124('0x39')](_0x462825[_0x1124('0x37')],{'$or':_[_0x1124('0x2c')](_0x5dac66,function(_0xf1414a){if(_0xf1414a[_0x1124('0x29')]!==_0x1124('0x3a')){var _0x450a96={};_0x450a96[_0xf1414a['name']]={'$like':'%'+_0x351ca9[_0x1124('0x2e')][_0x1124('0x3b')]+'%'};return _0x450a96;}})});}_0x462825=_[_0x1124('0x39')]({},_0x462825,_0x351ca9[_0x1124('0x3c')]);var _0x2362d1={'where':_0x462825['where']};return db['WhatsappApplication']['count'](_0x2362d1)[_0x1124('0x1f')](function(_0x34722d){_0x5b876f[_0x1124('0x3d')]=_0x34722d;if(_0x351ca9['query'][_0x1124('0x3e')]){_0x462825[_0x1124('0x3f')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x1124('0x40')](_0x462825);})[_0x1124('0x1f')](function(_0x1a3af7){_0x5b876f[_0x1124('0x41')]=_0x1a3af7;return _0x5b876f;})['then'](respondWithFilteredResult(_0x4d36e1,_0x462825))[_0x1124('0x42')](handleError(_0x4d36e1,null));};exports[_0x1124('0x43')]=function(_0x22bdbf,_0x1d508c){var _0x22c2ed={'raw':!![],'where':{'id':_0x22bdbf[_0x1124('0x44')]['id']}},_0x365328={};_0x365328[_0x1124('0x2b')]=_[_0x1124('0x2d')](db[_0x1124('0x27')][_0x1124('0x45')]);_0x365328[_0x1124('0x2e')]=_[_0x1124('0x2d')](_0x22bdbf[_0x1124('0x2e')]);_0x365328[_0x1124('0x46')]=_[_0x1124('0x2f')](_0x365328['model'],_0x365328[_0x1124('0x2e')]);_0x22c2ed[_0x1124('0x30')]=_[_0x1124('0x2f')](_0x365328[_0x1124('0x2b')],qs[_0x1124('0x31')](_0x22bdbf[_0x1124('0x2e')][_0x1124('0x31')]));_0x22c2ed[_0x1124('0x30')]=_0x22c2ed[_0x1124('0x30')]['length']?_0x22c2ed[_0x1124('0x30')]:_0x365328['model'];if(_0x22bdbf[_0x1124('0x2e')][_0x1124('0x3e')]){_0x22c2ed['include']=[{'all':!![]}];}_0x22c2ed=_[_0x1124('0x39')]({},_0x22c2ed,_0x22bdbf[_0x1124('0x3c')]);return db[_0x1124('0x27')][_0x1124('0x47')](_0x22c2ed)[_0x1124('0x1f')](handleEntityNotFound(_0x1d508c,null))[_0x1124('0x1f')](respondWithResult(_0x1d508c,null))[_0x1124('0x42')](handleError(_0x1d508c,null));};exports[_0x1124('0x48')]=function(_0xbe24f5,_0x23896b){return db[_0x1124('0x27')]['create'](_0xbe24f5[_0x1124('0x49')],{})['then'](respondWithResult(_0x23896b,0xc9))[_0x1124('0x42')](handleError(_0x23896b,null));};exports[_0x1124('0x1e')]=function(_0x36f9fc,_0x236fee){if(_0x36f9fc[_0x1124('0x49')]['id']){delete _0x36f9fc['body']['id'];}return db[_0x1124('0x27')]['find']({'where':{'id':_0x36f9fc['params']['id']}})[_0x1124('0x1f')](handleEntityNotFound(_0x236fee,null))[_0x1124('0x1f')](saveUpdates(_0x36f9fc['body'],null))[_0x1124('0x1f')](respondWithResult(_0x236fee,null))[_0x1124('0x42')](handleError(_0x236fee,null));};exports['destroy']=function(_0x3ced54,_0x4a4adb){return db['WhatsappApplication']['find']({'where':{'id':_0x3ced54['params']['id']}})[_0x1124('0x1f')](handleEntityNotFound(_0x4a4adb,null))[_0x1124('0x1f')](removeEntity(_0x4a4adb,null))[_0x1124('0x42')](handleError(_0x4a4adb,null));}; \ No newline at end of file +var _0x6d11=['lodash','squel','crypto','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','apply','reject','then','destroy','stack','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','fields','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra'];(function(_0x53f7d0,_0x520044){var _0x55d6f0=function(_0x3346f2){while(--_0x3346f2){_0x53f7d0['push'](_0x53f7d0['shift']());}};_0x55d6f0(++_0x520044);}(_0x6d11,0xbf));var _0x16d1=function(_0x589cd2,_0x340f8a){_0x589cd2=_0x589cd2-0x0;var _0x4739bc=_0x6d11[_0x589cd2];return _0x4739bc;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)[_0x16d1('0x1b')]();});}};}function handleEntityNotFound(_0x335c24,_0x4b2b5c){return function(_0x15203b){if(!_0x15203b){_0x335c24[_0x16d1('0x19')](0x194);}return _0x15203b;};}function handleError(_0x262f89,_0x346b69){_0x346b69=_0x346b69||0x1f4;return function(_0x2b8403){logger['error'](_0x2b8403[_0x16d1('0x24')]);if(_0x2b8403[_0x16d1('0x25')]){delete _0x2b8403[_0x16d1('0x25')];}_0x262f89['status'](_0x346b69)[_0x16d1('0x26')](_0x2b8403);};}exports[_0x16d1('0x27')]=function(_0x364bf7,_0x22e5b3){var _0x6396fc={},_0x462e5b={},_0x1dd574={'count':0x0,'rows':[]};var _0x562908=_[_0x16d1('0x28')](db[_0x16d1('0x29')][_0x16d1('0x2a')],function(_0x30cd8f){return{'name':_0x30cd8f['fieldName'],'type':_0x30cd8f['type'][_0x16d1('0x2b')]};});_0x462e5b[_0x16d1('0x2c')]=_[_0x16d1('0x28')](_0x562908,_0x16d1('0x25'));_0x462e5b[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x364bf7[_0x16d1('0x2d')]);_0x462e5b[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],_0x462e5b[_0x16d1('0x2d')]);_0x6396fc[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],qs['fields'](_0x364bf7[_0x16d1('0x2d')]['fields']));_0x6396fc[_0x16d1('0x31')]=_0x6396fc[_0x16d1('0x31')][_0x16d1('0x32')]?_0x6396fc[_0x16d1('0x31')]:_0x462e5b[_0x16d1('0x2c')];if(!_0x364bf7[_0x16d1('0x2d')]['hasOwnProperty']('nolimit')){_0x6396fc['limit']=qs[_0x16d1('0x1f')](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1f')]);_0x6396fc[_0x16d1('0x1d')]=qs['offset'](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1d')]);}_0x6396fc['order']=qs['sort'](_0x364bf7['query'][_0x16d1('0x33')]);_0x6396fc[_0x16d1('0x34')]=qs[_0x16d1('0x2f')](_['pick'](_0x364bf7[_0x16d1('0x2d')],_0x462e5b[_0x16d1('0x2f')]),_0x562908);if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]){_0x6396fc[_0x16d1('0x34')]=_[_0x16d1('0x36')](_0x6396fc[_0x16d1('0x34')],{'$or':_['map'](_0x562908,function(_0x50267b){if(_0x50267b['type']!==_0x16d1('0x37')){var _0x2306d3={};_0x2306d3[_0x50267b[_0x16d1('0x25')]]={'$like':'%'+_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]+'%'};return _0x2306d3;}})});}_0x6396fc=_[_0x16d1('0x36')]({},_0x6396fc,_0x364bf7[_0x16d1('0x38')]);var _0x369b1c={'where':_0x6396fc['where']};return db[_0x16d1('0x29')]['count'](_0x369b1c)['then'](function(_0x352c5b){_0x1dd574[_0x16d1('0x39')]=_0x352c5b;if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x6396fc[_0x16d1('0x3b')]=[{'all':!![]}];}return db[_0x16d1('0x29')]['findAll'](_0x6396fc);})[_0x16d1('0x22')](function(_0x525212){_0x1dd574['rows']=_0x525212;return _0x1dd574;})['then'](respondWithFilteredResult(_0x22e5b3,_0x6396fc))['catch'](handleError(_0x22e5b3,null));};exports[_0x16d1('0x3c')]=function(_0x168e14,_0x24038b){var _0x1eb761={'raw':!![],'where':{'id':_0x168e14[_0x16d1('0x3d')]['id']}},_0x53de06={};_0x53de06['model']=_[_0x16d1('0x2e')](db[_0x16d1('0x29')][_0x16d1('0x2a')]);_0x53de06[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x168e14[_0x16d1('0x2d')]);_0x53de06[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],_0x53de06[_0x16d1('0x2d')]);_0x1eb761[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],qs[_0x16d1('0x3e')](_0x168e14[_0x16d1('0x2d')]['fields']));_0x1eb761['attributes']=_0x1eb761[_0x16d1('0x31')][_0x16d1('0x32')]?_0x1eb761[_0x16d1('0x31')]:_0x53de06[_0x16d1('0x2c')];if(_0x168e14[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x1eb761['include']=[{'all':!![]}];}_0x1eb761=_[_0x16d1('0x36')]({},_0x1eb761,_0x168e14[_0x16d1('0x38')]);return db[_0x16d1('0x29')]['find'](_0x1eb761)['then'](handleEntityNotFound(_0x24038b,null))[_0x16d1('0x22')](respondWithResult(_0x24038b,null))[_0x16d1('0x3f')](handleError(_0x24038b,null));};exports['create']=function(_0x1cc137,_0x583151){return db[_0x16d1('0x29')][_0x16d1('0x40')](_0x1cc137[_0x16d1('0x41')],{})[_0x16d1('0x22')](respondWithResult(_0x583151,0xc9))['catch'](handleError(_0x583151,null));};exports['update']=function(_0x1d92cd,_0x8bb0c1){if(_0x1d92cd['body']['id']){delete _0x1d92cd[_0x16d1('0x41')]['id'];}return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x1d92cd[_0x16d1('0x3d')]['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x8bb0c1,null))['then'](saveUpdates(_0x1d92cd[_0x16d1('0x41')],null))['then'](respondWithResult(_0x8bb0c1,null))[_0x16d1('0x3f')](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x23')]=function(_0x5d384c,_0x413acd){return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x5d384c[_0x16d1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x413acd,null))['then'](removeEntity(_0x413acd,null))['catch'](handleError(_0x413acd,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index aa1b77c..e38ae63 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 _0x0689=['utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0x58b860,_0x41cc53){var _0x1fc128=function(_0x2c67a4){while(--_0x2c67a4){_0x58b860['push'](_0x58b860['shift']());}};_0x1fc128(++_0x41cc53);}(_0x0689,0x161));var _0x9068=function(_0x38aa55,_0x527d35){_0x38aa55=_0x38aa55-0x0;var _0x4e951f=_0x0689[_0x38aa55];return _0x4e951f;};'use strict';var _=require('lodash');var util=require(_0x9068('0x0'));var logger=require('../../config/logger')(_0x9068('0x1'));var moment=require(_0x9068('0x2'));var BPromise=require(_0x9068('0x3'));var rp=require(_0x9068('0x4'));var fs=require('fs');var path=require(_0x9068('0x5'));var rimraf=require(_0x9068('0x6'));var config=require(_0x9068('0x7'));var attributes=require(_0x9068('0x8'));module[_0x9068('0x9')]=function(_0x287846,_0x5ce5a7){return _0x287846[_0x9068('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9068('0xb'),'collate':_0x9068('0xc')});}; \ No newline at end of file +var _0xb90d=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications'];(function(_0x3c5aba,_0x335f28){var _0x1bab64=function(_0x9b339f){while(--_0x9b339f){_0x3c5aba['push'](_0x3c5aba['shift']());}};_0x1bab64(++_0x335f28);}(_0xb90d,0x17a));var _0xdb90=function(_0x3d7a9f,_0x24e0f1){_0x3d7a9f=_0x3d7a9f-0x0;var _0x13f5f1=_0xb90d[_0x3d7a9f];return _0x13f5f1;};'use strict';var _=require('lodash');var util=require(_0xdb90('0x0'));var logger=require(_0xdb90('0x1'))(_0xdb90('0x2'));var moment=require(_0xdb90('0x3'));var BPromise=require(_0xdb90('0x4'));var rp=require(_0xdb90('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb90('0x6'));var config=require(_0xdb90('0x7'));var attributes=require(_0xdb90('0x8'));module['exports']=function(_0x5a0622,_0x2cc7cd){return _0x5a0622[_0xdb90('0x9')](_0xdb90('0xa'),attributes,{'tableName':_0xdb90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xdb90('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 1184dff..2893af6 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 _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(_0x584fab,_0x5e818c){var _0x2f1330=function(_0x381ffd){while(--_0x381ffd){_0x584fab['push'](_0x584fab['shift']());}};_0x2f1330(++_0x5e818c);}(_0xfd28,0x148));var _0x8fd2=function(_0xe45118,_0x5dffbc){_0xe45118=_0xe45118-0x0;var _0x15e15d=_0xfd28[_0xe45118];return _0x15e15d;};'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 +var _0xb903=['http','request','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappApplication,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x26013b,_0x2ed582){var _0x5627ca=function(_0x336621){while(--_0x336621){_0x26013b['push'](_0x26013b['shift']());}};_0x5627ca(++_0x2ed582);}(_0xb903,0x185));var _0x3b90=function(_0x3bd6a5,_0xd5bd6b){_0x3bd6a5=_0x3bd6a5-0x0;var _0x54a78a=_0xb903[_0x3bd6a5];return _0x54a78a;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 5e6c5af..53c7180 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 _0x44e8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','index','/describe','isAuthenticated','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','delete','/:id/tags','removeTags','exports','multer','connect-timeout'];(function(_0x56928f,_0x229473){var _0x159b5d=function(_0x8ef81){while(--_0x8ef81){_0x56928f['push'](_0x56928f['shift']());}};_0x159b5d(++_0x229473);}(_0x44e8,0xd7));var _0x844e=function(_0x2c5f53,_0x108035){_0x2c5f53=_0x2c5f53-0x0;var _0x38c7fb=_0x44e8[_0x2c5f53];return _0x38c7fb;};'use strict';var multer=require(_0x844e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x844e('0x1'));var express=require(_0x844e('0x2'));var router=express[_0x844e('0x3')]();var fs_extra=require(_0x844e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var controller=require(_0x844e('0x7'));router[_0x844e('0x8')]('/',auth['isAuthenticated'](),controller[_0x844e('0x9')]);router[_0x844e('0x8')](_0x844e('0xa'),auth[_0x844e('0xb')](),controller['describe']);router[_0x844e('0x8')](_0x844e('0xc'),auth[_0x844e('0xb')](),controller[_0x844e('0xd')]);router[_0x844e('0x8')](_0x844e('0xe'),auth['isAuthenticated'](),controller[_0x844e('0xf')]);router[_0x844e('0x8')](_0x844e('0x10'),auth[_0x844e('0xb')](),controller[_0x844e('0x11')]);router[_0x844e('0x12')]('/',auth[_0x844e('0xb')](),controller['create']);router[_0x844e('0x12')](_0x844e('0xe'),auth['isAuthenticated'](),controller[_0x844e('0x13')]);router[_0x844e('0x12')]('/:id/tags',auth[_0x844e('0xb')](),interaction[_0x844e('0x14')](_0x844e('0x15'),'whatsappinteraction:addtags'),controller[_0x844e('0x16')]);router[_0x844e('0x17')](_0x844e('0xc'),auth[_0x844e('0xb')](),interaction[_0x844e('0x14')](_0x844e('0x15'),_0x844e('0x18')),controller[_0x844e('0x19')]);router['delete'](_0x844e('0xc'),auth['isAuthenticated'](),interaction[_0x844e('0x14')]('whatsapp',_0x844e('0x1a')),controller['destroy']);router[_0x844e('0x1b')](_0x844e('0x1c'),auth[_0x844e('0xb')](),controller[_0x844e('0x1d')]);module[_0x844e('0x1e')]=router; \ No newline at end of file +var _0xc4aa=['put','whatsappinteraction:update','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags'];(function(_0xff07ae,_0x1b8fa7){var _0x577f5c=function(_0x33f745){while(--_0x33f745){_0xff07ae['push'](_0xff07ae['shift']());}};_0x577f5c(++_0x1b8fa7);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc4aa[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0x12')]);router[_0xac4a('0x13')]('/:id/messages',auth[_0xac4a('0x9')](),controller[_0xac4a('0x14')]);router[_0xac4a('0x13')](_0xac4a('0x15'),auth[_0xac4a('0x9')](),interaction[_0xac4a('0x16')](_0xac4a('0x17'),_0xac4a('0x18')),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),interaction['tracked'](_0xac4a('0x17'),_0xac4a('0x1b')),controller[_0xac4a('0x1c')]);router[_0xac4a('0x1d')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),interaction[_0xac4a('0x16')](_0xac4a('0x17'),'whatsappinteraction:destroy'),controller['destroy']);router[_0xac4a('0x1d')](_0xac4a('0x15'),auth[_0xac4a('0x9')](),controller['removeTags']);module[_0xac4a('0x1e')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 66596f5..8278a91 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 _0xb76d=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xb76d,0x119));var _0xdb76=function(_0x11b2ae,_0x5c5f90){_0x11b2ae=_0x11b2ae-0x0;var _0x75ad9e=_0xb76d[_0x11b2ae];return _0x75ad9e;};'use strict';var Sequelize=require(_0xdb76('0x0'));var moment=require('moment');module[_0xdb76('0x1')]={'closed':{'type':Sequelize[_0xdb76('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdb76('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xdb76('0x4')]},'thirdDisposition':{'type':Sequelize[_0xdb76('0x4')]},'note':{'type':Sequelize[_0xdb76('0x4')]},'phone':{'type':Sequelize[_0xdb76('0x4')]},'read1stAt':{'type':Sequelize[_0xdb76('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xdb76('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xdb76('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdb76('0x5')]('in',_0xdb76('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xdb76('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x61df=['DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x26848e,_0x1b6235){var _0x37fd5b=function(_0x28dc7f){while(--_0x28dc7f){_0x26848e['push'](_0x26848e['shift']());}};_0x37fd5b(++_0x1b6235);}(_0x61df,0xbd));var _0xf61d=function(_0x355197,_0x3e8dc9){_0x355197=_0x355197-0x0;var _0x33edb3=_0x61df[_0x355197];return _0x33edb3;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0xf61d('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf61d('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf61d('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf61d('0x2')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf61d('0x2')]},'read1stAt':{'type':Sequelize[_0xf61d('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xf61d('0x3')]('in',_0xf61d('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf61d('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xf61d('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xf61d('0x0')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index e9e7d17..e397fb0 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 _0x7a79=['WhatsappInteractionId','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','where','rows','setTags','spread','Tag','emit','removeTags','download','toString','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','get','mkdirSync','Owner','fullname','N.A.','closed','closedAt','disposition','existsSync','createReadStream','createWriteStream','out','System','renderFile','.pdf','Whatsapp','log','unlinkSync','zip-dir','bluebird','util','path','ejs','ioredis','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','status','end','offset','undefined','limit','count','Content-Range','json','update','then','sendStatus','error','name','send','index','WhatsappInteraction','fieldName','type','key','findAll','whatsapp','query','user','catch','show','params','model','keys','rawAttributes','filters','attributes','fields','length','includeAll','include','merge','options','find','create','body','destroy','describe','addMessage','WhatsappMessage','ids','omit','getMessages','intersection','hasOwnProperty','sort','pick'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x7a79,0x11f));var _0x97a7=function(_0x3fa7d3,_0x37f83c){_0x3fa7d3=_0x3fa7d3-0x0;var _0x4c51bd=_0x7a79[_0x3fa7d3];return _0x4c51bd;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x97a7('0x0'));var moment=require('moment');var BPromise=require(_0x97a7('0x1'));var util=require(_0x97a7('0x2'));var path=require(_0x97a7('0x3'));var ejs=require(_0x97a7('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x97a7('0x5'));var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x97a7('0x6'));var logger=require(_0x97a7('0x7'))(_0x97a7('0x8'));var config=require(_0x97a7('0x9'));var db=require(_0x97a7('0xa'))['db'];config[_0x97a7('0xb')]=_[_0x97a7('0xc')](config['redis'],{'host':_0x97a7('0xd'),'port':0x18eb});var socket=require(_0x97a7('0xe'))(new Redis(config['redis']));require(_0x97a7('0xf'))['register'](socket);function respondWithStatusCode(_0x19ca2b,_0x46b197){_0x46b197=_0x46b197||0xcc;return function(_0x27faca){if(_0x27faca){return _0x19ca2b['sendStatus'](_0x46b197);}return _0x19ca2b[_0x97a7('0x10')](_0x46b197)[_0x97a7('0x11')]();};}function respondWithResult(_0x50b93a,_0x1c3232){_0x1c3232=_0x1c3232||0xc8;return function(_0x3d665e){if(_0x3d665e){return _0x50b93a['status'](_0x1c3232)['json'](_0x3d665e);}};}function respondWithFilteredResult(_0x115f10,_0x10241d){return function(_0x54f9ab){if(_0x54f9ab){var _0x6fbe21=typeof _0x10241d[_0x97a7('0x12')]===_0x97a7('0x13')&&typeof _0x10241d[_0x97a7('0x14')]==='undefined';var _0x5e2de6=_0x54f9ab['count'];var _0x1581d7=_0x6fbe21?0x0:_0x10241d[_0x97a7('0x12')];var _0x2e3f28=_0x6fbe21?_0x54f9ab[_0x97a7('0x15')]:_0x10241d[_0x97a7('0x12')]+_0x10241d['limit'];var _0x1ec1ae;if(_0x2e3f28>=_0x5e2de6){_0x2e3f28=_0x5e2de6;_0x1ec1ae=0xc8;}else{_0x1ec1ae=0xce;}_0x115f10[_0x97a7('0x10')](_0x1ec1ae);return _0x115f10['set'](_0x97a7('0x16'),_0x1581d7+'-'+_0x2e3f28+'/'+_0x5e2de6)[_0x97a7('0x17')](_0x54f9ab);}return null;};}function saveUpdates(_0x371cb0){return function(_0x6c99c9){if(_0x6c99c9){return _0x6c99c9[_0x97a7('0x18')](_0x371cb0)[_0x97a7('0x19')](function(_0x29c524){return _0x29c524;});}return null;};}function removeEntity(_0x43f4dd){return function(_0x4b9c43){if(_0x4b9c43){return _0x4b9c43['destroy']()[_0x97a7('0x19')](function(){_0x43f4dd[_0x97a7('0x10')](0xcc)[_0x97a7('0x11')]();});}};}function handleEntityNotFound(_0x408148){return function(_0x53e90f){if(!_0x53e90f){_0x408148[_0x97a7('0x1a')](0x194);}return _0x53e90f;};}function handleError(_0x112233,_0xfc6d13){_0xfc6d13=_0xfc6d13||0x1f4;return function(_0x58341e){logger[_0x97a7('0x1b')](_0x58341e['stack']);if(_0x58341e[_0x97a7('0x1c')]){delete _0x58341e[_0x97a7('0x1c')];}_0x112233[_0x97a7('0x10')](_0xfc6d13)[_0x97a7('0x1d')](_0x58341e);};}exports[_0x97a7('0x1e')]=function(_0x1853af,_0xa24001){var _0x10d268={};var _0x4c9a67=_['map'](db[_0x97a7('0x1f')]['rawAttributes'],function(_0xe29c83){return{'name':_0xe29c83[_0x97a7('0x20')],'type':_0xe29c83[_0x97a7('0x21')][_0x97a7('0x22')]};});_0x10d268=qs['getOptions'](_0x4c9a67,_0x1853af);return interaction[_0x97a7('0x23')](_0x97a7('0x24'),_0x1853af[_0x97a7('0x25')],_0x1853af[_0x97a7('0x26')],_0x10d268,_0x4c9a67)[_0x97a7('0x19')](respondWithFilteredResult(_0xa24001,_0x10d268))[_0x97a7('0x27')](handleError(_0xa24001,null));};exports[_0x97a7('0x28')]=function(_0x58a614,_0x442040){var _0xa808f8={'raw':![],'where':{'id':_0x58a614[_0x97a7('0x29')]['id']}},_0x57c0ee={};_0x57c0ee[_0x97a7('0x2a')]=_[_0x97a7('0x2b')](db[_0x97a7('0x1f')][_0x97a7('0x2c')]);_0x57c0ee[_0x97a7('0x25')]=_[_0x97a7('0x2b')](_0x58a614[_0x97a7('0x25')]);_0x57c0ee[_0x97a7('0x2d')]=_['intersection'](_0x57c0ee['model'],_0x57c0ee[_0x97a7('0x25')]);_0xa808f8[_0x97a7('0x2e')]=_['intersection'](_0x57c0ee['model'],qs[_0x97a7('0x2f')](_0x58a614[_0x97a7('0x25')][_0x97a7('0x2f')]));_0xa808f8[_0x97a7('0x2e')]=_0xa808f8[_0x97a7('0x2e')][_0x97a7('0x30')]?_0xa808f8[_0x97a7('0x2e')]:_0x57c0ee[_0x97a7('0x2a')];if(_0x58a614['query'][_0x97a7('0x31')]){_0xa808f8[_0x97a7('0x32')]=[{'all':!![]}];}_0xa808f8=_[_0x97a7('0x33')]({},_0xa808f8,_0x58a614[_0x97a7('0x34')]);return db[_0x97a7('0x1f')][_0x97a7('0x35')](_0xa808f8)[_0x97a7('0x19')](handleEntityNotFound(_0x442040,null))[_0x97a7('0x19')](respondWithResult(_0x442040,null))[_0x97a7('0x27')](handleError(_0x442040,null));};exports[_0x97a7('0x36')]=function(_0x3985ca,_0x33d9b4){return db[_0x97a7('0x1f')][_0x97a7('0x36')](_0x3985ca['body'],{})[_0x97a7('0x19')](respondWithResult(_0x33d9b4,0xc9))[_0x97a7('0x27')](handleError(_0x33d9b4,null));};exports['update']=function(_0xc11482,_0x4de79b){if(_0xc11482[_0x97a7('0x37')]['id']){delete _0xc11482[_0x97a7('0x37')]['id'];}return db[_0x97a7('0x1f')][_0x97a7('0x35')]({'where':{'id':_0xc11482[_0x97a7('0x29')]['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x4de79b,null))[_0x97a7('0x19')](saveUpdates(_0xc11482['body'],null))[_0x97a7('0x19')](respondWithResult(_0x4de79b,null))[_0x97a7('0x27')](handleError(_0x4de79b,null));};exports[_0x97a7('0x38')]=function(_0x52ed72,_0x3f3243){return db['WhatsappInteraction']['find']({'where':{'id':_0x52ed72['params']['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x3f3243,null))['then'](removeEntity(_0x3f3243,null))['catch'](handleError(_0x3f3243,null));};exports[_0x97a7('0x39')]=function(_0x479989,_0x13d7e1){return db[_0x97a7('0x1f')]['describe']()[_0x97a7('0x19')](respondWithResult(_0x13d7e1,null))[_0x97a7('0x27')](handleError(_0x13d7e1,null));};exports[_0x97a7('0x3a')]=function(_0x55ec20,_0x594416){return db[_0x97a7('0x3b')][_0x97a7('0x35')]({'where':{'id':_0x55ec20['params']['id']}})['then'](handleEntityNotFound(_0x594416,null))[_0x97a7('0x19')](function(_0x590542){if(_0x590542){return _0x590542[_0x97a7('0x3a')](_0x55ec20[_0x97a7('0x37')][_0x97a7('0x3c')],_[_0x97a7('0x3d')](_0x55ec20['body'],[_0x97a7('0x3c'),'id'])||{});}})[_0x97a7('0x19')](respondWithResult(_0x594416,null))[_0x97a7('0x27')](handleError(_0x594416,null));};exports[_0x97a7('0x3e')]=function(_0x2ea04c,_0x70cccd){var _0x2c0c4a={'raw':![],'where':{}};var _0xc88615={};var _0x16760c={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x2ea04c[_0x97a7('0x29')]['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x70cccd,null))[_0x97a7('0x19')](function(_0x104823){if(_0x104823){_0xc88615['model']=_[_0x97a7('0x2b')](db[_0x97a7('0x3b')][_0x97a7('0x2c')]);_0xc88615['query']=_[_0x97a7('0x2b')](_0x2ea04c[_0x97a7('0x25')]);_0xc88615[_0x97a7('0x2d')]=_['intersection'](_0xc88615[_0x97a7('0x2a')],_0xc88615['query']);_0x2c0c4a[_0x97a7('0x2e')]=_[_0x97a7('0x3f')](_0xc88615[_0x97a7('0x2a')],qs[_0x97a7('0x2f')](_0x2ea04c[_0x97a7('0x25')]['fields']));_0x2c0c4a[_0x97a7('0x2e')]=_0x2c0c4a[_0x97a7('0x2e')][_0x97a7('0x30')]?_0x2c0c4a[_0x97a7('0x2e')]:_0xc88615[_0x97a7('0x2a')];if(!_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x40')]('nolimit')){_0x2c0c4a[_0x97a7('0x14')]=qs[_0x97a7('0x14')](_0x2ea04c['query'][_0x97a7('0x14')]);_0x2c0c4a[_0x97a7('0x12')]=qs[_0x97a7('0x12')](_0x2ea04c['query']['offset']);}_0x2c0c4a['order']=qs[_0x97a7('0x41')](_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x41')]);_0x2c0c4a['where']=qs[_0x97a7('0x2d')](_[_0x97a7('0x42')](_0x2ea04c[_0x97a7('0x25')],_0xc88615['filters']));_0x2c0c4a['where'][_0x97a7('0x43')]=_0x104823['id'];if(_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x44')]){_0x2c0c4a['where']=_[_0x97a7('0x33')](_0x2c0c4a['where'],{'$or':_[_0x97a7('0x45')](_0x2c0c4a[_0x97a7('0x2e')],function(_0x445f4b){var _0x53a241={};_0x53a241[_0x445f4b]={'$like':'%'+_0x2ea04c['query'][_0x97a7('0x44')]+'%'};return _0x53a241;})});}if(_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x46')]){var _0x4b08f3=_0x2ea04c['query']['$gte']['split'](',');var _0x3ec2ab={};_0x3ec2ab[_0x4b08f3[0x0]]={'$gte':moment(_0x4b08f3[0x1])[_0x97a7('0x47')](_0x97a7('0x48'))};_0x2c0c4a[_0x97a7('0x49')]=_[_0x97a7('0x33')](_0x2c0c4a[_0x97a7('0x49')],_0x3ec2ab);}_0x2c0c4a=_['merge']({},_0x2c0c4a,_0x2ea04c[_0x97a7('0x34')]);return db[_0x97a7('0x3b')][_0x97a7('0x15')]({'where':_0x2c0c4a['where']})[_0x97a7('0x19')](function(_0x5f5a89){_0x16760c[_0x97a7('0x15')]=_0x5f5a89;if(_0x2ea04c[_0x97a7('0x25')][_0x97a7('0x31')]){_0x2c0c4a[_0x97a7('0x32')]=[{'all':!![]}];}return db[_0x97a7('0x3b')][_0x97a7('0x23')](_0x2c0c4a);})[_0x97a7('0x19')](function(_0x355737){_0x16760c[_0x97a7('0x4a')]=_0x355737;return _0x16760c;});}})['then'](respondWithFilteredResult(_0x70cccd,_0x2c0c4a))['catch'](handleError(_0x70cccd,null));};exports['addTags']=function(_0x2da28c,_0x1aa926){return db['WhatsappInteraction']['find']({'where':{'id':_0x2da28c['params']['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x1aa926,null))[_0x97a7('0x19')](function(_0x42b43b){if(_0x42b43b){return _0x42b43b[_0x97a7('0x4b')](_0x2da28c[_0x97a7('0x37')][_0x97a7('0x3c')],_[_0x97a7('0x3d')](_0x2da28c[_0x97a7('0x37')],[_0x97a7('0x3c'),'id'])||{})[_0x97a7('0x4c')](function(){return db[_0x97a7('0x4d')][_0x97a7('0x23')]({'attributes':['id',_0x97a7('0x1c'),'color'],'where':{'id':_0x2da28c['body'][_0x97a7('0x3c')]}});})[_0x97a7('0x19')](function(_0x33b12d){socket[_0x97a7('0x4e')]('whatsappInteractionTags:save',{'id':Number(_0x2da28c[_0x97a7('0x29')]['id']),'tags':_0x33b12d||[]});return{'id':Number(_0x2da28c['params']['id']),'tags':_0x33b12d||[]};});}})[_0x97a7('0x19')](respondWithResult(_0x1aa926,null))[_0x97a7('0x27')](handleError(_0x1aa926,null));};exports[_0x97a7('0x4f')]=function(_0x1731e8,_0x91977d){return db[_0x97a7('0x1f')][_0x97a7('0x35')]({'where':{'id':_0x1731e8['params']['id']}})[_0x97a7('0x19')](handleEntityNotFound(_0x91977d,null))['then'](function(_0x350813){if(_0x350813){return _0x350813[_0x97a7('0x4f')](_0x1731e8[_0x97a7('0x25')][_0x97a7('0x3c')]);}})[_0x97a7('0x19')](respondWithStatusCode(_0x91977d,null))['catch'](handleError(_0x91977d,null));};exports[_0x97a7('0x50')]=function(_0x3ce377,_0x2761d8){var _0x45cded=moment()['unix']()[_0x97a7('0x51')]();var _0x21222d=path[_0x97a7('0x52')](config[_0x97a7('0x53')],_0x97a7('0x54'),_0x97a7('0x55'),'tmp');var _0x54c345=path['join'](config['root'],_0x97a7('0x54'),_0x97a7('0x55'),_0x97a7('0x56'));var _0x581732=path[_0x97a7('0x52')](_0x21222d,_0x45cded);var _0x355c86=util[_0x97a7('0x47')](_0x97a7('0x57'),_0x3ce377[_0x97a7('0x29')]['id'],_0x45cded);var _0x18e7bc=path[_0x97a7('0x52')](_0x21222d,_0x355c86);var _0x5eace2=[];_0x5eace2[_0x97a7('0x58')]({'model':db[_0x97a7('0x59')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5eace2[_0x97a7('0x58')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x97a7('0x5a'),_0x97a7('0x5b')],'raw':!![]});if(_0x3ce377[_0x97a7('0x25')][_0x97a7('0x56')]){_0x5eace2[_0x97a7('0x58')]({'model':db[_0x97a7('0x5c')],'as':_0x97a7('0x5c'),'raw':!![]});}var _0x292197=[{'model':db['WhatsappMessage'],'as':_0x97a7('0x5d'),'attributes':['id',_0x97a7('0x37'),_0x97a7('0x5e'),_0x97a7('0x5f'),_0x97a7('0x60'),_0x97a7('0x61')],'include':_0x5eace2}];_0x292197[_0x97a7('0x58')]({'model':db[_0x97a7('0x62')],'as':_0x97a7('0x63'),'attributes':['id',_0x97a7('0x1c')]});_0x292197[_0x97a7('0x58')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x97a7('0x1f')][_0x97a7('0x35')]({'where':{'id':_0x3ce377[_0x97a7('0x29')]['id']},'include':_0x292197})[_0x97a7('0x19')](handleEntityNotFound(_0x2761d8,null))[_0x97a7('0x19')](function(_0x48717e){if(_0x48717e){var _0xdc104a=_0x48717e[_0x97a7('0x64')]({'plain':!![]});fs[_0x97a7('0x65')](_0x581732);var _0x1e9dbc={'channel':'Whatsapp','account':_0xdc104a[_0x97a7('0x63')][_0x97a7('0x1c')],'agent':_0xdc104a[_0x97a7('0x66')]?_0xdc104a[_0x97a7('0x66')][_0x97a7('0x67')]:_0x97a7('0x68'),'createdAt':moment(_0xdc104a[_0x97a7('0x5e')])[_0x97a7('0x47')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0xdc104a[_0x97a7('0x69')]?moment(_0xdc104a[_0x97a7('0x6a')])[_0x97a7('0x47')](_0x97a7('0x48'))[_0x97a7('0x51')]():'','disposition':_0xdc104a[_0x97a7('0x6b')],'messages':_(_0xdc104a[_0x97a7('0x5d')])[_0x97a7('0x44')]({'secret':![]})['map'](function(_0x1bb570){if(_0x1bb570[_0x97a7('0x5c')]){var _0x2c1bac=path[_0x97a7('0x52')](_0x54c345,_0x1bb570[_0x97a7('0x5c')]['basename']);if(fs[_0x97a7('0x6c')](_0x2c1bac)){fs[_0x97a7('0x6d')](_0x2c1bac)['pipe'](fs[_0x97a7('0x6e')](path['join'](_0x581732,_0x1bb570['Attachment']['basename'])));}}return{'date':moment(_0x1bb570['createdAt'])[_0x97a7('0x47')](_0x97a7('0x48'))['toString'](),'sender':_0x1bb570['direction']===_0x97a7('0x6f')?_0x1bb570[_0x97a7('0x59')]?_0x1bb570['User'][_0x97a7('0x67')]:_0x97a7('0x70'):_0x1bb570['Contact'][_0x97a7('0x5a')]+(_0x1bb570['Contact'][_0x97a7('0x5b')]?'\x20'+_0x1bb570['Contact'][_0x97a7('0x5b')]:''),'body':_0x1bb570['Attachment']?_0x1bb570[_0x97a7('0x5c')]['basename']:_0x1bb570[_0x97a7('0x37')],'direction':_0x1bb570[_0x97a7('0x5f')]===_0x97a7('0x6f')?'A':'C','secret':_0x1bb570[_0x97a7('0x60')],'read':_0x1bb570[_0x97a7('0x61')],'attachment':_0x1bb570[_0x97a7('0x5c')]};})['value']()};return ejs[_0x97a7('0x71')](path[_0x97a7('0x52')](config[_0x97a7('0x53')],'server','views','downloadInteraction.ejs'),{'interaction':_0x1e9dbc})[_0x97a7('0x19')](function(_0xfbe280){var _0x5a68ca=path[_0x97a7('0x52')](_0x581732,'transcript-'+_0xdc104a['id']+'-'+_0x45cded+_0x97a7('0x72'));var _0x3a6a09={'path':_0x5a68ca,'channel':_0x97a7('0x73'),'interactionId':_0xdc104a['id']};return pdf['createPdfFromHTML'](_0xfbe280,_0x3a6a09);})[_0x97a7('0x19')](function(){return new BPromise(function(_0x41ea7f,_0x114d02){zipdir(_0x581732,{'saveTo':_0x18e7bc},function(_0x1f1d12,_0x2658dc){if(_0x1f1d12)return _0x114d02(_0x1f1d12);return _0x41ea7f(_0x2658dc);});})[_0x97a7('0x19')](function(){return new BPromise(function(_0x25f170,_0x54be6e){rimraf(_0x581732,function(_0x52216c){if(_0x52216c)_0x54be6e(_0x52216c);return _0x25f170();});});})[_0x97a7('0x19')](function(){return _0x2761d8[_0x97a7('0x50')](_0x18e7bc,_0x355c86,function(_0x597dfe){if(_0x597dfe){console[_0x97a7('0x74')]('err',_0x597dfe);}else{fs[_0x97a7('0x75')](_0x18e7bc);}});});});}else{return _0x2761d8[_0x97a7('0x1a')](0xc8);}})['catch'](handleError(_0x2761d8,null));}; \ No newline at end of file +var _0x0c01=['createdAt','secret','read','WhatsappAccount','Owner','get','mkdirSync','Whatsapp','Account','fullname','toString','closed','closedAt','disposition','existsSync','createReadStream','pipe','basename','direction','System','Contact','firstName','out','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','rimraf','bluebird','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','map','WhatsappInteraction','rawAttributes','type','getOptions','findAll','whatsapp','query','catch','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','options','create','body','addMessage','WhatsappMessage','ids','omit','getMessages','sort','where','filter','merge','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','find','setTags','name','color','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','attachments','join','transcript-%d-%s.zip','User','push','CmContact','lastName','Attachment','Messages'];(function(_0x69f9ff,_0x2dd452){var _0x3f91a3=function(_0x5be5e1){while(--_0x5be5e1){_0x69f9ff['push'](_0x69f9ff['shift']());}};_0x3f91a3(++_0x2dd452);}(_0x0c01,0x10f));var _0x10c0=function(_0x48189c,_0x5aa295){_0x48189c=_0x48189c-0x0;var _0x1121f4=_0x0c01[_0x48189c];return _0x1121f4;};'use strict';var rimraf=require(_0x10c0('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x10c0('0x1'));var util=require('util');var path=require('path');var ejs=require(_0x10c0('0x2'));var fs=require('fs');var _=require(_0x10c0('0x3'));var Redis=require(_0x10c0('0x4'));var interaction=require(_0x10c0('0x5'));var qs=require(_0x10c0('0x6'));var pdf=require(_0x10c0('0x7'));var logger=require(_0x10c0('0x8'))('api');var config=require(_0x10c0('0x9'));var db=require('../../mysqldb')['db'];config[_0x10c0('0xa')]=_['defaults'](config[_0x10c0('0xa')],{'host':_0x10c0('0xb'),'port':0x18eb});var socket=require(_0x10c0('0xc'))(new Redis(config[_0x10c0('0xa')]));require(_0x10c0('0xd'))[_0x10c0('0xe')](socket);function respondWithStatusCode(_0x1f5986,_0x5c84d3){_0x5c84d3=_0x5c84d3||0xcc;return function(_0x85125b){if(_0x85125b){return _0x1f5986[_0x10c0('0xf')](_0x5c84d3);}return _0x1f5986['status'](_0x5c84d3)['end']();};}function respondWithResult(_0x57a24f,_0x20f2de){_0x20f2de=_0x20f2de||0xc8;return function(_0x3050ba){if(_0x3050ba){return _0x57a24f[_0x10c0('0x10')](_0x20f2de)[_0x10c0('0x11')](_0x3050ba);}};}function respondWithFilteredResult(_0x4337bf,_0x327558){return function(_0x8f1593){if(_0x8f1593){var _0x3f687c=typeof _0x327558[_0x10c0('0x12')]===_0x10c0('0x13')&&typeof _0x327558[_0x10c0('0x14')]==='undefined';var _0x17bcf3=_0x8f1593['count'];var _0x3ac0a1=_0x3f687c?0x0:_0x327558[_0x10c0('0x12')];var _0x3ddc80=_0x3f687c?_0x8f1593[_0x10c0('0x15')]:_0x327558[_0x10c0('0x12')]+_0x327558[_0x10c0('0x14')];var _0x2a8964;if(_0x3ddc80>=_0x17bcf3){_0x3ddc80=_0x17bcf3;_0x2a8964=0xc8;}else{_0x2a8964=0xce;}_0x4337bf[_0x10c0('0x10')](_0x2a8964);return _0x4337bf[_0x10c0('0x16')](_0x10c0('0x17'),_0x3ac0a1+'-'+_0x3ddc80+'/'+_0x17bcf3)[_0x10c0('0x11')](_0x8f1593);}return null;};}function saveUpdates(_0x150efe){return function(_0x5d83ef){if(_0x5d83ef){return _0x5d83ef[_0x10c0('0x18')](_0x150efe)[_0x10c0('0x19')](function(_0x279239){return _0x279239;});}return null;};}function removeEntity(_0x28cf0f){return function(_0x1420b0){if(_0x1420b0){return _0x1420b0[_0x10c0('0x1a')]()['then'](function(){_0x28cf0f['status'](0xcc)[_0x10c0('0x1b')]();});}};}function handleEntityNotFound(_0x561f53){return function(_0xbdebe4){if(!_0xbdebe4){_0x561f53[_0x10c0('0xf')](0x194);}return _0xbdebe4;};}function handleError(_0x57d1ed,_0x4aabb7){_0x4aabb7=_0x4aabb7||0x1f4;return function(_0x392fa4){logger[_0x10c0('0x1c')](_0x392fa4[_0x10c0('0x1d')]);if(_0x392fa4['name']){delete _0x392fa4['name'];}_0x57d1ed[_0x10c0('0x10')](_0x4aabb7)['send'](_0x392fa4);};}exports['index']=function(_0x5eab76,_0x1fa180){var _0x5d5940={};var _0xfeca43=_[_0x10c0('0x1e')](db[_0x10c0('0x1f')][_0x10c0('0x20')],function(_0x321458){return{'name':_0x321458['fieldName'],'type':_0x321458[_0x10c0('0x21')]['key']};});_0x5d5940=qs[_0x10c0('0x22')](_0xfeca43,_0x5eab76);return interaction[_0x10c0('0x23')](_0x10c0('0x24'),_0x5eab76[_0x10c0('0x25')],_0x5eab76['user'],_0x5d5940,_0xfeca43)[_0x10c0('0x19')](respondWithFilteredResult(_0x1fa180,_0x5d5940))[_0x10c0('0x26')](handleError(_0x1fa180,null));};exports[_0x10c0('0x27')]=function(_0x5e8da0,_0x449901){var _0x1a39fb={'raw':![],'where':{'id':_0x5e8da0[_0x10c0('0x28')]['id']}},_0x4217fc={};_0x4217fc[_0x10c0('0x29')]=_['keys'](db[_0x10c0('0x1f')][_0x10c0('0x20')]);_0x4217fc[_0x10c0('0x25')]=_[_0x10c0('0x2a')](_0x5e8da0[_0x10c0('0x25')]);_0x4217fc[_0x10c0('0x2b')]=_['intersection'](_0x4217fc[_0x10c0('0x29')],_0x4217fc[_0x10c0('0x25')]);_0x1a39fb[_0x10c0('0x2c')]=_[_0x10c0('0x2d')](_0x4217fc[_0x10c0('0x29')],qs['fields'](_0x5e8da0[_0x10c0('0x25')][_0x10c0('0x2e')]));_0x1a39fb[_0x10c0('0x2c')]=_0x1a39fb[_0x10c0('0x2c')][_0x10c0('0x2f')]?_0x1a39fb[_0x10c0('0x2c')]:_0x4217fc[_0x10c0('0x29')];if(_0x5e8da0[_0x10c0('0x25')][_0x10c0('0x30')]){_0x1a39fb[_0x10c0('0x31')]=[{'all':!![]}];}_0x1a39fb=_['merge']({},_0x1a39fb,_0x5e8da0[_0x10c0('0x32')]);return db[_0x10c0('0x1f')]['find'](_0x1a39fb)[_0x10c0('0x19')](handleEntityNotFound(_0x449901,null))['then'](respondWithResult(_0x449901,null))[_0x10c0('0x26')](handleError(_0x449901,null));};exports[_0x10c0('0x33')]=function(_0x173bd5,_0x370105){return db[_0x10c0('0x1f')][_0x10c0('0x33')](_0x173bd5[_0x10c0('0x34')],{})[_0x10c0('0x19')](respondWithResult(_0x370105,0xc9))[_0x10c0('0x26')](handleError(_0x370105,null));};exports[_0x10c0('0x18')]=function(_0x454873,_0x292400){if(_0x454873[_0x10c0('0x34')]['id']){delete _0x454873[_0x10c0('0x34')]['id'];}return db[_0x10c0('0x1f')]['find']({'where':{'id':_0x454873[_0x10c0('0x28')]['id']}})[_0x10c0('0x19')](handleEntityNotFound(_0x292400,null))['then'](saveUpdates(_0x454873[_0x10c0('0x34')],null))[_0x10c0('0x19')](respondWithResult(_0x292400,null))[_0x10c0('0x26')](handleError(_0x292400,null));};exports[_0x10c0('0x1a')]=function(_0x401d42,_0x3940cb){return db[_0x10c0('0x1f')]['find']({'where':{'id':_0x401d42[_0x10c0('0x28')]['id']}})[_0x10c0('0x19')](handleEntityNotFound(_0x3940cb,null))[_0x10c0('0x19')](removeEntity(_0x3940cb,null))[_0x10c0('0x26')](handleError(_0x3940cb,null));};exports['describe']=function(_0x10f88e,_0xe18ccd){return db['WhatsappInteraction']['describe']()['then'](respondWithResult(_0xe18ccd,null))[_0x10c0('0x26')](handleError(_0xe18ccd,null));};exports[_0x10c0('0x35')]=function(_0x589046,_0x372b37){return db[_0x10c0('0x36')]['find']({'where':{'id':_0x589046[_0x10c0('0x28')]['id']}})['then'](handleEntityNotFound(_0x372b37,null))[_0x10c0('0x19')](function(_0x582ef3){if(_0x582ef3){return _0x582ef3['addMessage'](_0x589046[_0x10c0('0x34')][_0x10c0('0x37')],_[_0x10c0('0x38')](_0x589046[_0x10c0('0x34')],[_0x10c0('0x37'),'id'])||{});}})['then'](respondWithResult(_0x372b37,null))[_0x10c0('0x26')](handleError(_0x372b37,null));};exports[_0x10c0('0x39')]=function(_0x41311b,_0x34be0d){var _0x5a2263={'raw':![],'where':{}};var _0x1b1e7f={};var _0x5112fd={'count':0x0,'rows':[]};return db[_0x10c0('0x1f')]['findOne']({'where':{'id':_0x41311b[_0x10c0('0x28')]['id']}})[_0x10c0('0x19')](handleEntityNotFound(_0x34be0d,null))['then'](function(_0x8f44c9){if(_0x8f44c9){_0x1b1e7f[_0x10c0('0x29')]=_[_0x10c0('0x2a')](db[_0x10c0('0x36')]['rawAttributes']);_0x1b1e7f[_0x10c0('0x25')]=_[_0x10c0('0x2a')](_0x41311b['query']);_0x1b1e7f[_0x10c0('0x2b')]=_[_0x10c0('0x2d')](_0x1b1e7f[_0x10c0('0x29')],_0x1b1e7f[_0x10c0('0x25')]);_0x5a2263[_0x10c0('0x2c')]=_[_0x10c0('0x2d')](_0x1b1e7f[_0x10c0('0x29')],qs[_0x10c0('0x2e')](_0x41311b[_0x10c0('0x25')][_0x10c0('0x2e')]));_0x5a2263[_0x10c0('0x2c')]=_0x5a2263[_0x10c0('0x2c')]['length']?_0x5a2263[_0x10c0('0x2c')]:_0x1b1e7f[_0x10c0('0x29')];if(!_0x41311b[_0x10c0('0x25')]['hasOwnProperty']('nolimit')){_0x5a2263['limit']=qs[_0x10c0('0x14')](_0x41311b[_0x10c0('0x25')][_0x10c0('0x14')]);_0x5a2263[_0x10c0('0x12')]=qs[_0x10c0('0x12')](_0x41311b['query'][_0x10c0('0x12')]);}_0x5a2263['order']=qs[_0x10c0('0x3a')](_0x41311b[_0x10c0('0x25')]['sort']);_0x5a2263[_0x10c0('0x3b')]=qs[_0x10c0('0x2b')](_['pick'](_0x41311b[_0x10c0('0x25')],_0x1b1e7f[_0x10c0('0x2b')]));_0x5a2263['where']['WhatsappInteractionId']=_0x8f44c9['id'];if(_0x41311b[_0x10c0('0x25')][_0x10c0('0x3c')]){_0x5a2263[_0x10c0('0x3b')]=_[_0x10c0('0x3d')](_0x5a2263['where'],{'$or':_[_0x10c0('0x1e')](_0x5a2263['attributes'],function(_0x320732){var _0x310ccc={};_0x310ccc[_0x320732]={'$like':'%'+_0x41311b[_0x10c0('0x25')]['filter']+'%'};return _0x310ccc;})});}if(_0x41311b[_0x10c0('0x25')][_0x10c0('0x3e')]){var _0x2e4c74=_0x41311b[_0x10c0('0x25')][_0x10c0('0x3e')][_0x10c0('0x3f')](',');var _0x4bef65={};_0x4bef65[_0x2e4c74[0x0]]={'$gte':moment(_0x2e4c74[0x1])[_0x10c0('0x40')](_0x10c0('0x41'))};_0x5a2263[_0x10c0('0x3b')]=_[_0x10c0('0x3d')](_0x5a2263['where'],_0x4bef65);}_0x5a2263=_['merge']({},_0x5a2263,_0x41311b[_0x10c0('0x32')]);return db[_0x10c0('0x36')][_0x10c0('0x15')]({'where':_0x5a2263[_0x10c0('0x3b')]})['then'](function(_0x5b5519){_0x5112fd[_0x10c0('0x15')]=_0x5b5519;if(_0x41311b[_0x10c0('0x25')]['includeAll']){_0x5a2263[_0x10c0('0x31')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x5a2263);})['then'](function(_0x10742c){_0x5112fd[_0x10c0('0x42')]=_0x10742c;return _0x5112fd;});}})['then'](respondWithFilteredResult(_0x34be0d,_0x5a2263))[_0x10c0('0x26')](handleError(_0x34be0d,null));};exports[_0x10c0('0x43')]=function(_0x1a140a,_0xec572){return db[_0x10c0('0x1f')][_0x10c0('0x44')]({'where':{'id':_0x1a140a['params']['id']}})[_0x10c0('0x19')](handleEntityNotFound(_0xec572,null))[_0x10c0('0x19')](function(_0x401477){if(_0x401477){return _0x401477[_0x10c0('0x45')](_0x1a140a[_0x10c0('0x34')][_0x10c0('0x37')],_[_0x10c0('0x38')](_0x1a140a[_0x10c0('0x34')],[_0x10c0('0x37'),'id'])||{})['spread'](function(){return db['Tag'][_0x10c0('0x23')]({'attributes':['id',_0x10c0('0x46'),_0x10c0('0x47')],'where':{'id':_0x1a140a[_0x10c0('0x34')]['ids']}});})[_0x10c0('0x19')](function(_0x1aa8d6){socket[_0x10c0('0x48')](_0x10c0('0x49'),{'id':Number(_0x1a140a[_0x10c0('0x28')]['id']),'tags':_0x1aa8d6||[]});return{'id':Number(_0x1a140a[_0x10c0('0x28')]['id']),'tags':_0x1aa8d6||[]};});}})[_0x10c0('0x19')](respondWithResult(_0xec572,null))[_0x10c0('0x26')](handleError(_0xec572,null));};exports[_0x10c0('0x4a')]=function(_0xbc8115,_0x5bac2c){return db[_0x10c0('0x1f')][_0x10c0('0x44')]({'where':{'id':_0xbc8115[_0x10c0('0x28')]['id']}})['then'](handleEntityNotFound(_0x5bac2c,null))[_0x10c0('0x19')](function(_0x2af3dd){if(_0x2af3dd){return _0x2af3dd[_0x10c0('0x4a')](_0xbc8115[_0x10c0('0x25')][_0x10c0('0x37')]);}})[_0x10c0('0x19')](respondWithStatusCode(_0x5bac2c,null))[_0x10c0('0x26')](handleError(_0x5bac2c,null));};exports[_0x10c0('0x4b')]=function(_0x44bd97,_0x39f6a){var _0x5f2aa6=moment()[_0x10c0('0x4c')]()['toString']();var _0x4e40b6=path['join'](config[_0x10c0('0x4d')],_0x10c0('0x4e'),'files','tmp');var _0x3309c4=path['join'](config['root'],_0x10c0('0x4e'),_0x10c0('0x4f'),_0x10c0('0x50'));var _0x626990=path[_0x10c0('0x51')](_0x4e40b6,_0x5f2aa6);var _0x280043=util[_0x10c0('0x40')](_0x10c0('0x52'),_0x44bd97[_0x10c0('0x28')]['id'],_0x5f2aa6);var _0x58c32e=path[_0x10c0('0x51')](_0x4e40b6,_0x280043);var _0x2b25ca=[];_0x2b25ca['push']({'model':db[_0x10c0('0x53')],'as':_0x10c0('0x53'),'attributes':['id','fullname'],'raw':!![]});_0x2b25ca[_0x10c0('0x54')]({'model':db[_0x10c0('0x55')],'as':'Contact','attributes':['id','firstName',_0x10c0('0x56')],'raw':!![]});if(_0x44bd97[_0x10c0('0x25')][_0x10c0('0x50')]){_0x2b25ca[_0x10c0('0x54')]({'model':db[_0x10c0('0x57')],'as':_0x10c0('0x57'),'raw':!![]});}var _0x372c74=[{'model':db[_0x10c0('0x36')],'as':_0x10c0('0x58'),'attributes':['id','body',_0x10c0('0x59'),'direction',_0x10c0('0x5a'),_0x10c0('0x5b')],'include':_0x2b25ca}];_0x372c74[_0x10c0('0x54')]({'model':db[_0x10c0('0x5c')],'as':'Account','attributes':['id',_0x10c0('0x46')]});_0x372c74[_0x10c0('0x54')]({'model':db[_0x10c0('0x53')],'as':_0x10c0('0x5d'),'attributes':['id','fullname']});return db['WhatsappInteraction'][_0x10c0('0x44')]({'where':{'id':_0x44bd97[_0x10c0('0x28')]['id']},'include':_0x372c74})[_0x10c0('0x19')](handleEntityNotFound(_0x39f6a,null))['then'](function(_0x4df481){if(_0x4df481){var _0x475d40=_0x4df481[_0x10c0('0x5e')]({'plain':!![]});fs[_0x10c0('0x5f')](_0x626990);var _0x5d8746={'channel':_0x10c0('0x60'),'account':_0x475d40[_0x10c0('0x61')][_0x10c0('0x46')],'agent':_0x475d40[_0x10c0('0x5d')]?_0x475d40[_0x10c0('0x5d')][_0x10c0('0x62')]:'N.A.','createdAt':moment(_0x475d40[_0x10c0('0x59')])[_0x10c0('0x40')](_0x10c0('0x41'))[_0x10c0('0x63')](),'closedAt':_0x475d40[_0x10c0('0x64')]?moment(_0x475d40[_0x10c0('0x65')])['format'](_0x10c0('0x41'))[_0x10c0('0x63')]():'','disposition':_0x475d40[_0x10c0('0x66')],'messages':_(_0x475d40[_0x10c0('0x58')])[_0x10c0('0x3c')]({'secret':![]})[_0x10c0('0x1e')](function(_0x124249){if(_0x124249[_0x10c0('0x57')]){var _0x198dc6=path[_0x10c0('0x51')](_0x3309c4,_0x124249[_0x10c0('0x57')]['basename']);if(fs[_0x10c0('0x67')](_0x198dc6)){fs[_0x10c0('0x68')](_0x198dc6)[_0x10c0('0x69')](fs['createWriteStream'](path['join'](_0x626990,_0x124249['Attachment'][_0x10c0('0x6a')])));}}return{'date':moment(_0x124249[_0x10c0('0x59')])[_0x10c0('0x40')](_0x10c0('0x41'))[_0x10c0('0x63')](),'sender':_0x124249[_0x10c0('0x6b')]==='out'?_0x124249[_0x10c0('0x53')]?_0x124249[_0x10c0('0x53')]['fullname']:_0x10c0('0x6c'):_0x124249[_0x10c0('0x6d')][_0x10c0('0x6e')]+(_0x124249[_0x10c0('0x6d')][_0x10c0('0x56')]?'\x20'+_0x124249[_0x10c0('0x6d')][_0x10c0('0x56')]:''),'body':_0x124249[_0x10c0('0x57')]?_0x124249[_0x10c0('0x57')]['basename']:_0x124249['body'],'direction':_0x124249[_0x10c0('0x6b')]===_0x10c0('0x6f')?'A':'C','secret':_0x124249['secret'],'read':_0x124249['read'],'attachment':_0x124249[_0x10c0('0x57')]};})[_0x10c0('0x70')]()};return ejs[_0x10c0('0x71')](path[_0x10c0('0x51')](config[_0x10c0('0x4d')],_0x10c0('0x4e'),_0x10c0('0x72'),_0x10c0('0x73')),{'interaction':_0x5d8746})['then'](function(_0x4e6a01){var _0x10f3f2=path['join'](_0x626990,_0x10c0('0x74')+_0x475d40['id']+'-'+_0x5f2aa6+'.pdf');var _0x1d26a2={'path':_0x10f3f2,'channel':_0x10c0('0x60'),'interactionId':_0x475d40['id']};return pdf[_0x10c0('0x75')](_0x4e6a01,_0x1d26a2);})[_0x10c0('0x19')](function(){return new BPromise(function(_0x4e6047,_0x1672fd){zipdir(_0x626990,{'saveTo':_0x58c32e},function(_0x55bfd3,_0x4f8be0){if(_0x55bfd3)return _0x1672fd(_0x55bfd3);return _0x4e6047(_0x4f8be0);});})['then'](function(){return new BPromise(function(_0x14eac3,_0x14eb91){rimraf(_0x626990,function(_0x4b917b){if(_0x4b917b)_0x14eb91(_0x4b917b);return _0x14eac3();});});})[_0x10c0('0x19')](function(){return _0x39f6a['download'](_0x58c32e,_0x280043,function(_0xe78274){if(_0xe78274){console[_0x10c0('0x76')](_0x10c0('0x77'),_0xe78274);}else{fs['unlinkSync'](_0x58c32e);}});});});}else{return _0x39f6a[_0x10c0('0xf')](0xc8);}})[_0x10c0('0x26')](handleError(_0x39f6a,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 031321b..3f0a1d7 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 _0xd353=['getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','catch','events','../../mysqldb','WhatsappMessage','update'];(function(_0xe40606,_0x352502){var _0x1f6230=function(_0x4ead96){while(--_0x4ead96){_0xe40606['push'](_0xe40606['shift']());}};_0x1f6230(++_0x352502);}(_0xd353,0x7e));var _0x3d35=function(_0x46fbda,_0x2cf27f){_0x46fbda=_0x46fbda-0x0;var _0x348db3=_0xd353[_0x46fbda];return _0x348db3;};'use strict';var EventEmitter=require(_0x3d35('0x0'));var WhatsappInteraction=require(_0x3d35('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x3d35('0x1'))['db'][_0x3d35('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d35('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3bc47e){return function(_0x23d65e,_0x2287bd,_0xb43971){_0x23d65e[_0x3d35('0x4')]({'attributes':['id'],'raw':!![]})[_0x3d35('0x5')](function(_0x1cf467){_0x23d65e['setDataValue'](_0x3d35('0x6'),_0x1cf467[_0x3d35('0x7')](function(_0x19126c){return{'id':_0x19126c['id']};}));return WhatsappMessage[_0x3d35('0x8')]({'where':{'WhatsappInteractionId':_0x23d65e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d35('0x5')](function(_0x3539f9){_0x23d65e[_0x3d35('0x9')](_0x3d35('0xa'),_0x3539f9[_0x3d35('0xb')]);WhatsappInteractionEvents['emit'](_0x3bc47e+':'+_0x23d65e['id'],_0x23d65e);WhatsappInteractionEvents['emit'](_0x3bc47e,_0x23d65e);_0xb43971(null);})[_0x3d35('0xc')](_0xb43971(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0xa477=['save','update','remove','getUsers','Users','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x465e1c,_0xdff365){var _0xb35dda=function(_0x496535){while(--_0x496535){_0x465e1c['push'](_0x465e1c['shift']());}};_0xb35dda(++_0xdff365);}(_0xa477,0xe6));var _0x7a47=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa477[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x7a47('0x0'));var WhatsappInteraction=require(_0x7a47('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x7a47('0x1'))['db'][_0x7a47('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7a47('0x3')](0x0);var events={'afterCreate':_0x7a47('0x4'),'afterUpdate':_0x7a47('0x5'),'afterDestroy':_0x7a47('0x6')};function emitEvent(_0x1b595e){return function(_0x56b589,_0x493cad,_0x307852){_0x56b589[_0x7a47('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x54e9aa){_0x56b589['setDataValue'](_0x7a47('0x8'),_0x54e9aa['map'](function(_0x2dc504){return{'id':_0x2dc504['id']};}));return WhatsappMessage[_0x7a47('0x9')]({'where':{'WhatsappInteractionId':_0x56b589['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3afd71){_0x56b589[_0x7a47('0xa')](_0x7a47('0xb'),_0x3afd71[_0x7a47('0xc')]);WhatsappInteractionEvents[_0x7a47('0xd')](_0x1b595e+':'+_0x56b589['id'],_0x56b589);WhatsappInteractionEvents['emit'](_0x1b595e,_0x56b589);_0x307852(null);})[_0x7a47('0xe')](_0x307852(null));};}for(var e in events){if(events[_0x7a47('0xf')](e)){var event=events[e];WhatsappInteraction[_0x7a47('0x10')](e,emitEvent(event));}}module[_0x7a47('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 09ead2e..75149d5 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 _0x1123=['request-promise','path','rimraf','./whatsappInteraction.attributes','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','moment','bluebird'];(function(_0x4c27de,_0x44ca11){var _0x482a1e=function(_0x225321){while(--_0x225321){_0x4c27de['push'](_0x4c27de['shift']());}};_0x482a1e(++_0x44ca11);}(_0x1123,0x1e7));var _0x3112=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1123[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x3112('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3112('0x1'));var BPromise=require(_0x3112('0x2'));var rp=require(_0x3112('0x3'));var fs=require('fs');var path=require(_0x3112('0x4'));var rimraf=require(_0x3112('0x5'));var config=require('../../config/environment');var attributes=require(_0x3112('0x6'));module['exports']=function(_0x2479a0,_0x3b72ee){return _0x2479a0['define']('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b01f0,_0x533669,_0x55d764){if(_0x5b01f0['changed'](_0x3112('0x7'))){_0x5b01f0[_0x3112('0x8')]=moment()['format'](_0x3112('0x9'));}_0x55d764(null,_0x5b01f0);}}});}; \ No newline at end of file +var _0xc175=['define','WhatsappInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x45ee60,_0x5b0f76){var _0x4d185d=function(_0x102078){while(--_0x102078){_0x45ee60['push'](_0x45ee60['shift']());}};_0x4d185d(++_0x5b0f76);}(_0xc175,0x196));var _0x5c17=function(_0x1a6a8c,_0x12d6c9){_0x1a6a8c=_0x1a6a8c-0x0;var _0x572fb0=_0xc175[_0x1a6a8c];return _0x572fb0;};'use strict';var _=require(_0x5c17('0x0'));var util=require(_0x5c17('0x1'));var logger=require(_0x5c17('0x2'))(_0x5c17('0x3'));var moment=require(_0x5c17('0x4'));var BPromise=require(_0x5c17('0x5'));var rp=require(_0x5c17('0x6'));var fs=require('fs');var path=require(_0x5c17('0x7'));var rimraf=require(_0x5c17('0x8'));var config=require(_0x5c17('0x9'));var attributes=require(_0x5c17('0xa'));module[_0x5c17('0xb')]=function(_0x13b557,_0x485105){return _0x13b557[_0x5c17('0xc')](_0x5c17('0xd'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a35b3,_0x194a37,_0x2699d1){if(_0x4a35b3[_0x5c17('0xe')](_0x5c17('0xf'))){_0x4a35b3[_0x5c17('0x10')]=moment()[_0x5c17('0x11')](_0x5c17('0x12'));}_0x2699d1(null,_0x4a35b3);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 9c8805a..0c10166 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 _0xef81=['info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateWhatsappInteraction','update','body','options','where','attributes','limit','AddTagsToWhatsappInteraction','WhatsappInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then'];(function(_0x3aa13d,_0x57a0c9){var _0xd3e8c5=function(_0x4115c6){while(--_0x4115c6){_0x3aa13d['push'](_0x3aa13d['shift']());}};_0xd3e8c5(++_0x57a0c9);}(_0xef81,0x114));var _0x1ef8=function(_0x1ef132,_0x54d977){_0x1ef132=_0x1ef132-0x0;var _0xa2b53f=_0xef81[_0x1ef132];return _0xa2b53f;};'use strict';var _=require(_0x1ef8('0x0'));var util=require(_0x1ef8('0x1'));var moment=require(_0x1ef8('0x2'));var BPromise=require(_0x1ef8('0x3'));var rs=require(_0x1ef8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ef8('0x5'))['db'];var utils=require(_0x1ef8('0x6'));var logger=require('../../config/logger')(_0x1ef8('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ef8('0x8'));var client=jayson['client'][_0x1ef8('0x9')]({'port':0x232a});config[_0x1ef8('0xa')]=_[_0x1ef8('0xb')](config[_0x1ef8('0xa')],{'host':_0x1ef8('0xc'),'port':0x18eb});var socket=require(_0x1ef8('0xd'))(new Redis(config[_0x1ef8('0xa')]));require(_0x1ef8('0xe'))[_0x1ef8('0xf')](socket);function respondWithRpcPromise(_0x1b581f,_0x146afb,_0x31ec12){return new BPromise(function(_0x37c62f,_0x415805){return client[_0x1ef8('0x10')](_0x1b581f,_0x31ec12)[_0x1ef8('0x11')](function(_0x5cf8aa){logger[_0x1ef8('0x12')](_0x1ef8('0x13'),_0x146afb,_0x1ef8('0x14'));logger[_0x1ef8('0x15')](_0x1ef8('0x16'),_0x146afb,_0x1ef8('0x14'),JSON[_0x1ef8('0x17')](_0x5cf8aa));if(_0x5cf8aa[_0x1ef8('0x18')]){if(_0x5cf8aa[_0x1ef8('0x18')]['code']===0x1f4){logger[_0x1ef8('0x18')](_0x1ef8('0x13'),_0x146afb,_0x5cf8aa['error'][_0x1ef8('0x19')]);return _0x415805(_0x5cf8aa[_0x1ef8('0x18')]['message']);}logger[_0x1ef8('0x18')](_0x1ef8('0x13'),_0x146afb,_0x5cf8aa[_0x1ef8('0x18')][_0x1ef8('0x19')]);return _0x37c62f(_0x5cf8aa[_0x1ef8('0x18')]['message']);}else{logger[_0x1ef8('0x12')](_0x1ef8('0x13'),_0x146afb,_0x1ef8('0x14'));_0x37c62f(_0x5cf8aa[_0x1ef8('0x1a')][_0x1ef8('0x19')]);}})[_0x1ef8('0x1b')](function(_0xd6637b){logger[_0x1ef8('0x18')](_0x1ef8('0x13'),_0x146afb,_0xd6637b);_0x415805(_0xd6637b);});});}exports[_0x1ef8('0x1c')]=function(_0x52b3bd){var _0x3f557c=this;return new Promise(function(_0x2edc6c,_0x2d3646){return db['WhatsappInteraction'][_0x1ef8('0x1d')](_0x52b3bd[_0x1ef8('0x1e')],{'raw':_0x52b3bd[_0x1ef8('0x1f')]?_0x52b3bd[_0x1ef8('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52b3bd['options']?_0x52b3bd[_0x1ef8('0x1f')][_0x1ef8('0x20')]||null:null,'attributes':_0x52b3bd[_0x1ef8('0x1f')]?_0x52b3bd[_0x1ef8('0x1f')][_0x1ef8('0x21')]||null:null,'limit':_0x52b3bd[_0x1ef8('0x1f')]?_0x52b3bd[_0x1ef8('0x1f')][_0x1ef8('0x22')]||null:null})[_0x1ef8('0x11')](function(_0x43ef9a){logger[_0x1ef8('0x12')](_0x1ef8('0x1c'),_0x52b3bd);logger[_0x1ef8('0x15')]('UpdateWhatsappInteraction',_0x52b3bd,JSON['stringify'](_0x43ef9a));_0x2edc6c(_0x43ef9a);})[_0x1ef8('0x1b')](function(_0x5b1324){logger[_0x1ef8('0x18')](_0x1ef8('0x1c'),_0x5b1324[_0x1ef8('0x19')],_0x52b3bd);_0x2d3646(_0x3f557c['error'](0x1f4,_0x5b1324[_0x1ef8('0x19')]));});});};exports[_0x1ef8('0x23')]=function(_0x162339){return new Promise(function(_0x5f337e,_0x48e77e){return db[_0x1ef8('0x24')]['find']({'where':_0x162339['options']?_0x162339['options'][_0x1ef8('0x20')]||null:null})[_0x1ef8('0x11')](function(_0x1c59e5){if(_0x1c59e5){return _0x1c59e5[_0x1ef8('0x25')](_0x162339['body']['ids'],_[_0x1ef8('0x26')](_0x162339[_0x1ef8('0x1e')],[_0x1ef8('0x27'),'id'])||{});}})[_0x1ef8('0x28')](function(_0x5327ce){logger[_0x1ef8('0x12')]('AddTags',_0x162339);logger[_0x1ef8('0x15')]('AddTags',_0x162339,JSON[_0x1ef8('0x17')](_0x5327ce));_0x5f337e(_0x5327ce);})['catch'](function(_0x15976a){logger[_0x1ef8('0x18')](_0x1ef8('0x29'),_0x15976a[_0x1ef8('0x19')],_0x162339);_0x48e77e(_this[_0x1ef8('0x18')](0x1f4,_0x15976a['message']));});});}; \ No newline at end of file +var _0xb8b3=['code','message','info','result','catch','WhatsappInteraction','update','body','options','raw','where','attributes','limit','debug','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1f47c9,_0x587a0d){var _0x2360df=function(_0x33dea9){while(--_0x33dea9){_0x1f47c9['push'](_0x1f47c9['shift']());}};_0x2360df(++_0x587a0d);}(_0xb8b3,0x93));var _0x3b8b=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0xb8b3[_0x28aea5];return _0x6a55f9;};'use strict';var _=require(_0x3b8b('0x0'));var util=require(_0x3b8b('0x1'));var moment=require(_0x3b8b('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b8b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b8b('0x4'))['db'];var utils=require(_0x3b8b('0x5'));var logger=require('../../config/logger')(_0x3b8b('0x6'));var config=require(_0x3b8b('0x7'));var jayson=require(_0x3b8b('0x8'));var client=jayson[_0x3b8b('0x9')][_0x3b8b('0xa')]({'port':0x232a});config[_0x3b8b('0xb')]=_[_0x3b8b('0xc')](config[_0x3b8b('0xb')],{'host':_0x3b8b('0xd'),'port':0x18eb});var socket=require(_0x3b8b('0xe'))(new Redis(config[_0x3b8b('0xb')]));require('./whatsappInteraction.socket')[_0x3b8b('0xf')](socket);function respondWithRpcPromise(_0x2095fa,_0x57417d,_0x37bc88){return new BPromise(function(_0x1ef076,_0x180288){return client['request'](_0x2095fa,_0x37bc88)[_0x3b8b('0x10')](function(_0x402d79){logger['info'](_0x3b8b('0x11'),_0x57417d,_0x3b8b('0x12'));logger['debug']('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x57417d,_0x3b8b('0x12'),JSON[_0x3b8b('0x13')](_0x402d79));if(_0x402d79[_0x3b8b('0x14')]){if(_0x402d79[_0x3b8b('0x14')][_0x3b8b('0x15')]===0x1f4){logger[_0x3b8b('0x14')](_0x3b8b('0x11'),_0x57417d,_0x402d79[_0x3b8b('0x14')][_0x3b8b('0x16')]);return _0x180288(_0x402d79[_0x3b8b('0x14')][_0x3b8b('0x16')]);}logger[_0x3b8b('0x14')](_0x3b8b('0x11'),_0x57417d,_0x402d79[_0x3b8b('0x14')][_0x3b8b('0x16')]);return _0x1ef076(_0x402d79[_0x3b8b('0x14')][_0x3b8b('0x16')]);}else{logger[_0x3b8b('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x57417d,'request\x20sent');_0x1ef076(_0x402d79[_0x3b8b('0x18')][_0x3b8b('0x16')]);}})[_0x3b8b('0x19')](function(_0x439f72){logger[_0x3b8b('0x14')](_0x3b8b('0x11'),_0x57417d,_0x439f72);_0x180288(_0x439f72);});});}exports['UpdateWhatsappInteraction']=function(_0x106d4e){var _0x2a5cbb=this;return new Promise(function(_0x1be5ed,_0x22a742){return db[_0x3b8b('0x1a')][_0x3b8b('0x1b')](_0x106d4e[_0x3b8b('0x1c')],{'raw':_0x106d4e[_0x3b8b('0x1d')]?_0x106d4e[_0x3b8b('0x1d')][_0x3b8b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x106d4e[_0x3b8b('0x1d')]?_0x106d4e['options'][_0x3b8b('0x1f')]||null:null,'attributes':_0x106d4e[_0x3b8b('0x1d')]?_0x106d4e[_0x3b8b('0x1d')][_0x3b8b('0x20')]||null:null,'limit':_0x106d4e[_0x3b8b('0x1d')]?_0x106d4e[_0x3b8b('0x1d')][_0x3b8b('0x21')]||null:null})[_0x3b8b('0x10')](function(_0x2625fe){logger[_0x3b8b('0x17')]('UpdateWhatsappInteraction',_0x106d4e);logger[_0x3b8b('0x22')](_0x3b8b('0x23'),_0x106d4e,JSON[_0x3b8b('0x13')](_0x2625fe));_0x1be5ed(_0x2625fe);})[_0x3b8b('0x19')](function(_0x5162a4){logger[_0x3b8b('0x14')]('UpdateWhatsappInteraction',_0x5162a4[_0x3b8b('0x16')],_0x106d4e);_0x22a742(_0x2a5cbb['error'](0x1f4,_0x5162a4[_0x3b8b('0x16')]));});});};exports[_0x3b8b('0x24')]=function(_0x4f7ad3){return new Promise(function(_0x4851a4,_0x69a2b2){return db[_0x3b8b('0x1a')][_0x3b8b('0x25')]({'where':_0x4f7ad3[_0x3b8b('0x1d')]?_0x4f7ad3[_0x3b8b('0x1d')][_0x3b8b('0x1f')]||null:null})['then'](function(_0x2b8d12){if(_0x2b8d12){return _0x2b8d12[_0x3b8b('0x26')](_0x4f7ad3[_0x3b8b('0x1c')][_0x3b8b('0x27')],_[_0x3b8b('0x28')](_0x4f7ad3[_0x3b8b('0x1c')],['ids','id'])||{});}})['spread'](function(_0x27f61a){logger[_0x3b8b('0x17')](_0x3b8b('0x29'),_0x4f7ad3);logger[_0x3b8b('0x22')]('AddTags',_0x4f7ad3,JSON['stringify'](_0x27f61a));_0x4851a4(_0x27f61a);})[_0x3b8b('0x19')](function(_0x3b8f14){logger[_0x3b8b('0x14')](_0x3b8b('0x29'),_0x3b8f14[_0x3b8b('0x16')],_0x4f7ad3);_0x69a2b2(_this[_0x3b8b('0x14')](0x1f4,_0x3b8f14[_0x3b8b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index c5db02f..132a613 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 _0xae97=['register','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0xae97,0x80));var _0x7ae9=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xae97[_0x21549c];return _0x426cbd;};'use strict';var WhatsappInteractionEvents=require(_0x7ae9('0x0'));var events=['save',_0x7ae9('0x1'),_0x7ae9('0x2')];function createListener(_0x537d96,_0xd644d6){return function(_0x3afd55){_0xd644d6[_0x7ae9('0x3')](_0x537d96,_0x3afd55);};}function removeListener(_0x522802,_0x5e9b2c){return function(){WhatsappInteractionEvents[_0x7ae9('0x4')](_0x522802,_0x5e9b2c);};}exports[_0x7ae9('0x5')]=function(_0x531057){for(var _0x3040ba=0x0,_0x3843b4=events['length'];_0x3040ba<_0x3843b4;_0x3040ba++){var _0x4faac9=events[_0x3040ba];var _0x32a463=createListener(_0x7ae9('0x6')+_0x4faac9,_0x531057);WhatsappInteractionEvents['on'](_0x4faac9,_0x32a463);}}; \ No newline at end of file +var _0x2f5f=['save','remove','update','register','length','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x2f5f,0x6f));var _0xf2f5=function(_0x1bb848,_0x3bb208){_0x1bb848=_0x1bb848-0x0;var _0x484bb2=_0x2f5f[_0x1bb848];return _0x484bb2;};'use strict';var WhatsappInteractionEvents=require(_0xf2f5('0x0'));var events=[_0xf2f5('0x1'),_0xf2f5('0x2'),_0xf2f5('0x3')];function createListener(_0x2e6882,_0x1a7326){return function(_0x57867a){_0x1a7326['emit'](_0x2e6882,_0x57867a);};}function removeListener(_0xd7f807,_0x196c78){return function(){WhatsappInteractionEvents['removeListener'](_0xd7f807,_0x196c78);};}exports[_0xf2f5('0x4')]=function(_0xc1fc24){for(var _0x4740f9=0x0,_0x115548=events[_0xf2f5('0x5')];_0x4740f9<_0x115548;_0x4740f9++){var _0x1ab9a2=events[_0x4740f9];var _0x18d037=createListener(_0xf2f5('0x6')+_0x1ab9a2,_0xc1fc24);WhatsappInteractionEvents['on'](_0x1ab9a2,_0x18d037);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 45b3b37..ef91be1 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 _0xceb3=['create','/:id/status','status','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xceb3,0xcf));var _0x3ceb=function(_0x212a37,_0xf35b2e){_0x212a37=_0x212a37-0x0;var _0x5d0bf9=_0xceb3[_0x212a37];return _0x5d0bf9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3ceb('0x0'));var express=require(_0x3ceb('0x1'));var router=express[_0x3ceb('0x2')]();var fs_extra=require(_0x3ceb('0x3'));var auth=require(_0x3ceb('0x4'));var interaction=require(_0x3ceb('0x5'));var config=require(_0x3ceb('0x6'));var controller=require(_0x3ceb('0x7'));router[_0x3ceb('0x8')]('/',auth[_0x3ceb('0x9')](),controller[_0x3ceb('0xa')]);router['get'](_0x3ceb('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3ceb('0xc'),auth[_0x3ceb('0x9')](),controller[_0x3ceb('0xd')]);router[_0x3ceb('0xe')]('/',auth[_0x3ceb('0x9')](),interaction[_0x3ceb('0xf')](_0x3ceb('0x10'),'whatsappmessage:create'),controller[_0x3ceb('0x11')]);router[_0x3ceb('0xe')](_0x3ceb('0x12'),controller[_0x3ceb('0x13')]);router[_0x3ceb('0x14')](_0x3ceb('0xc'),auth[_0x3ceb('0x9')](),controller[_0x3ceb('0x15')]);router[_0x3ceb('0x14')](_0x3ceb('0x16'),auth[_0x3ceb('0x9')](),controller['accept']);router[_0x3ceb('0x14')](_0x3ceb('0x17'),auth['isAuthenticated'](),controller[_0x3ceb('0x18')]);router[_0x3ceb('0x19')](_0x3ceb('0xc'),auth[_0x3ceb('0x9')](),controller[_0x3ceb('0x1a')]);module[_0x3ceb('0x1b')]=router; \ No newline at end of file +var _0x1d48=['whatsapp','create','status','update','put','/:id/accept','/:id/reject','reject','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','tracked'];(function(_0x154cbb,_0x43c57f){var _0x494584=function(_0x971bd9){while(--_0x971bd9){_0x154cbb['push'](_0x154cbb['shift']());}};_0x494584(++_0x43c57f);}(_0x1d48,0xb8));var _0x81d4=function(_0x19aba0,_0x4d920b){_0x19aba0=_0x19aba0-0x0;var _0x198c24=_0x1d48[_0x19aba0];return _0x198c24;};'use strict';var multer=require(_0x81d4('0x0'));var util=require(_0x81d4('0x1'));var path=require('path');var timeout=require(_0x81d4('0x2'));var express=require(_0x81d4('0x3'));var router=express[_0x81d4('0x4')]();var fs_extra=require(_0x81d4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x81d4('0x6'));var config=require(_0x81d4('0x7'));var controller=require('./whatsappMessage.controller');router[_0x81d4('0x8')]('/',auth[_0x81d4('0x9')](),controller['index']);router[_0x81d4('0x8')](_0x81d4('0xa'),auth[_0x81d4('0x9')](),controller[_0x81d4('0xb')]);router['get'](_0x81d4('0xc'),auth[_0x81d4('0x9')](),controller['show']);router['post']('/',auth[_0x81d4('0x9')](),interaction[_0x81d4('0xd')](_0x81d4('0xe'),'whatsappmessage:create'),controller[_0x81d4('0xf')]);router['post']('/:id/status',controller[_0x81d4('0x10')]);router['put']('/:id',auth[_0x81d4('0x9')](),controller[_0x81d4('0x11')]);router[_0x81d4('0x12')](_0x81d4('0x13'),auth[_0x81d4('0x9')](),controller['accept']);router['put'](_0x81d4('0x14'),auth[_0x81d4('0x9')](),controller[_0x81d4('0x15')]);router['delete'](_0x81d4('0xc'),auth[_0x81d4('0x9')](),controller['destroy']);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 3bf9c0f..cb2779d 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 _0xa6ee=['out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa6ee,0xd3));var _0xea6e=function(_0x2e61e9,_0x21040a){_0x2e61e9=_0x2e61e9-0x0;var _0x31dff9=_0xa6ee[_0x2e61e9];return _0x31dff9;};'use strict';var Sequelize=require(_0xea6e('0x0'));module['exports']={'body':{'type':Sequelize[_0xea6e('0x1')](_0xea6e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xea6e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xea6e('0x4')]('in',_0xea6e('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xea6e('0x6')]},'readAt':{'type':Sequelize[_0xea6e('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xea6e('0x6')]},'providerResponse':{'type':Sequelize[_0xea6e('0x1')]}}; \ No newline at end of file +var _0x702c=['BOOLEAN','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x702c,0x1e4));var _0xc702=function(_0x470995,_0x49eb0e){_0x470995=_0x470995-0x0;var _0x107dee=_0x702c[_0x470995];return _0x107dee;};'use strict';var Sequelize=require(_0xc702('0x0'));module[_0xc702('0x1')]={'body':{'type':Sequelize[_0xc702('0x2')](_0xc702('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xc702('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc702('0x5')),'defaultValue':_0xc702('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc702('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xc702('0x7')]},'secret':{'type':Sequelize[_0xc702('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 3e1bfb6..2f6aa3b 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 _0xf229=['QueryTypes','User','rejectmessage','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','redis','defaults','localhost','./whatsappMessage.socket','register','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','include','findAll','rows','catch','includeAll','find','create','body','params','describe','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','null','rejectMessage','Sequelize'];(function(_0x324d02,_0x6d9c0b){var _0x3d4f59=function(_0x279f6b){while(--_0x279f6b){_0x324d02['push'](_0x324d02['shift']());}};_0x3d4f59(++_0x6d9c0b);}(_0xf229,0x1a5));var _0x9f22=function(_0x32a4e7,_0x3fc8c5){_0x32a4e7=_0x32a4e7-0x0;var _0x55a210=_0xf229[_0x32a4e7];return _0x55a210;};'use strict';var emlformat=require(_0x9f22('0x0'));var rimraf=require(_0x9f22('0x1'));var zipdir=require(_0x9f22('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f22('0x3'));var moment=require(_0x9f22('0x4'));var BPromise=require(_0x9f22('0x5'));var Mustache=require(_0x9f22('0x6'));var util=require(_0x9f22('0x7'));var path=require(_0x9f22('0x8'));var sox=require(_0x9f22('0x9'));var csv=require(_0x9f22('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9f22('0xb'));var _=require('lodash');var squel=require(_0x9f22('0xc'));var crypto=require('crypto');var jsforce=require(_0x9f22('0xd'));var deskjs=require(_0x9f22('0xe'));var toCsv=require(_0x9f22('0xa'));var querystring=require(_0x9f22('0xf'));var Papa=require(_0x9f22('0x10'));var Redis=require(_0x9f22('0x11'));var authService=require(_0x9f22('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9f22('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9f22('0x14'))('api');var utils=require(_0x9f22('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9f22('0x16')]=_[_0x9f22('0x17')](config[_0x9f22('0x16')],{'host':_0x9f22('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9f22('0x16')]));require(_0x9f22('0x19'))[_0x9f22('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9f22('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x9f22('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x489466,_0x3a44c3,_0x259744,_0x15bd82){return new BPromise(function(_0x32753b,_0x561564){var _0x556904=_0x15bd82||client;return _0x556904[_0x9f22('0x1c')](_0x489466,_0x259744)[_0x9f22('0x1d')](function(_0x1ca1b7){logger[_0x9f22('0x1e')](_0x9f22('0x1f'),_0x3a44c3,_0x9f22('0x20'));logger[_0x9f22('0x21')](_0x9f22('0x22'),_0x3a44c3,'request\x20sent',JSON[_0x9f22('0x23')](_0x1ca1b7));if(_0x1ca1b7['error']){if(_0x1ca1b7[_0x9f22('0x24')]['code']===0x1f4){logger[_0x9f22('0x24')](_0x9f22('0x1f'),_0x3a44c3,_0x1ca1b7[_0x9f22('0x24')][_0x9f22('0x25')]);return _0x561564(_0x1ca1b7[_0x9f22('0x24')][_0x9f22('0x25')]);}logger[_0x9f22('0x24')](_0x9f22('0x1f'),_0x3a44c3,_0x1ca1b7[_0x9f22('0x24')][_0x9f22('0x25')]);return _0x32753b(_0x1ca1b7[_0x9f22('0x24')][_0x9f22('0x25')]);}else{logger[_0x9f22('0x1e')](_0x9f22('0x1f'),_0x3a44c3,'request\x20sent');_0x32753b(_0x1ca1b7[_0x9f22('0x26')][_0x9f22('0x25')]);}})['catch'](function(_0x222791){logger[_0x9f22('0x24')](_0x9f22('0x1f'),_0x3a44c3,_0x222791);_0x561564(_0x222791);});});}function respondWithStatusCode(_0x5b09be,_0x1ad0d3){_0x1ad0d3=_0x1ad0d3||0xcc;return function(_0x2e73ed){if(_0x2e73ed){return _0x5b09be['sendStatus'](_0x1ad0d3);}return _0x5b09be['status'](_0x1ad0d3)[_0x9f22('0x27')]();};}function respondWithResult(_0x1957f1,_0x3d7f72){_0x3d7f72=_0x3d7f72||0xc8;return function(_0x14ed94){if(_0x14ed94){return _0x1957f1[_0x9f22('0x28')](_0x3d7f72)['json'](_0x14ed94);}};}function respondWithFilteredResult(_0x3d9b5d,_0xebbb9c){return function(_0x5379fc){if(_0x5379fc){var _0x24a949=typeof _0xebbb9c[_0x9f22('0x29')]==='undefined'&&typeof _0xebbb9c['limit']===_0x9f22('0x2a');var _0x1859c6=_0x5379fc[_0x9f22('0x2b')];var _0x55b164=_0x24a949?0x0:_0xebbb9c[_0x9f22('0x29')];var _0x29556e=_0x24a949?_0x5379fc[_0x9f22('0x2b')]:_0xebbb9c[_0x9f22('0x29')]+_0xebbb9c[_0x9f22('0x2c')];var _0x23d441;if(_0x29556e>=_0x1859c6){_0x29556e=_0x1859c6;_0x23d441=0xc8;}else{_0x23d441=0xce;}_0x3d9b5d[_0x9f22('0x28')](_0x23d441);return _0x3d9b5d['set'](_0x9f22('0x2d'),_0x55b164+'-'+_0x29556e+'/'+_0x1859c6)[_0x9f22('0x2e')](_0x5379fc);}return null;};}function patchUpdates(_0x2e6877){return function(_0x514084){try{jsonpatch[_0x9f22('0x2f')](_0x514084,_0x2e6877,!![]);}catch(_0x52fccc){return BPromise[_0x9f22('0x30')](_0x52fccc);}return _0x514084[_0x9f22('0x31')]();};}function saveUpdates(_0x1e72e3,_0x2ebd81){return function(_0x1f681b){if(_0x1f681b){return _0x1f681b[_0x9f22('0x32')](_0x1e72e3)[_0x9f22('0x1d')](function(_0x33d159){return _0x33d159;});}return null;};}function removeEntity(_0x55b320,_0x5ce5c9){return function(_0x3c7bd9){if(_0x3c7bd9){return _0x3c7bd9['destroy']()['then'](function(){_0x55b320['status'](0xcc)[_0x9f22('0x27')]();});}};}function handleEntityNotFound(_0x4968de,_0x3b5d23){return function(_0xb37af7){if(!_0xb37af7){_0x4968de['sendStatus'](0x194);}return _0xb37af7;};}function handleError(_0x2bb211,_0x40c67d){_0x40c67d=_0x40c67d||0x1f4;return function(_0x5afe45){logger[_0x9f22('0x24')](_0x5afe45[_0x9f22('0x33')]);if(_0x5afe45[_0x9f22('0x34')]){delete _0x5afe45[_0x9f22('0x34')];}_0x2bb211[_0x9f22('0x28')](_0x40c67d)[_0x9f22('0x35')](_0x5afe45);};}exports[_0x9f22('0x36')]=function(_0x2c814e,_0x3ff6a0){var _0xf81554={},_0x42ad00={},_0x3f59d7={'count':0x0,'rows':[]};var _0x15b039=_[_0x9f22('0x37')](db[_0x9f22('0x38')][_0x9f22('0x39')],function(_0x5ba9ba){return{'name':_0x5ba9ba[_0x9f22('0x3a')],'type':_0x5ba9ba['type'][_0x9f22('0x3b')]};});_0x42ad00['model']=_[_0x9f22('0x37')](_0x15b039,'name');_0x42ad00[_0x9f22('0x3c')]=_[_0x9f22('0x3d')](_0x2c814e[_0x9f22('0x3c')]);_0x42ad00['filters']=_['intersection'](_0x42ad00[_0x9f22('0x3e')],_0x42ad00[_0x9f22('0x3c')]);_0xf81554[_0x9f22('0x3f')]=_[_0x9f22('0x40')](_0x42ad00[_0x9f22('0x3e')],qs[_0x9f22('0x41')](_0x2c814e[_0x9f22('0x3c')]['fields']));_0xf81554[_0x9f22('0x3f')]=_0xf81554['attributes'][_0x9f22('0x42')]?_0xf81554['attributes']:_0x42ad00['model'];if(!_0x2c814e[_0x9f22('0x3c')][_0x9f22('0x43')](_0x9f22('0x44'))){_0xf81554[_0x9f22('0x2c')]=qs[_0x9f22('0x2c')](_0x2c814e[_0x9f22('0x3c')][_0x9f22('0x2c')]);_0xf81554[_0x9f22('0x29')]=qs[_0x9f22('0x29')](_0x2c814e[_0x9f22('0x3c')][_0x9f22('0x29')]);}_0xf81554[_0x9f22('0x45')]=qs[_0x9f22('0x46')](_0x2c814e['query'][_0x9f22('0x46')]);_0xf81554['where']=qs['filters'](_[_0x9f22('0x47')](_0x2c814e[_0x9f22('0x3c')],_0x42ad00[_0x9f22('0x48')]),_0x15b039);if(_0x2c814e[_0x9f22('0x3c')]['filter']){_0xf81554[_0x9f22('0x49')]=_['merge'](_0xf81554[_0x9f22('0x49')],{'$or':_[_0x9f22('0x37')](_0x15b039,function(_0x191c9f){if(_0x191c9f[_0x9f22('0x4a')]!==_0x9f22('0x4b')){var _0xc4e9c6={};_0xc4e9c6[_0x191c9f[_0x9f22('0x34')]]={'$like':'%'+_0x2c814e[_0x9f22('0x3c')][_0x9f22('0x4c')]+'%'};return _0xc4e9c6;}})});}_0xf81554=_[_0x9f22('0x4d')]({},_0xf81554,_0x2c814e[_0x9f22('0x4e')]);var _0x2a749b={'where':_0xf81554['where']};return db[_0x9f22('0x38')]['count'](_0x2a749b)['then'](function(_0x5bc734){_0x3f59d7[_0x9f22('0x2b')]=_0x5bc734;if(_0x2c814e['query']['includeAll']){_0xf81554[_0x9f22('0x4f')]=[{'all':!![]}];}return db[_0x9f22('0x38')][_0x9f22('0x50')](_0xf81554);})['then'](function(_0x40ba83){_0x3f59d7[_0x9f22('0x51')]=_0x40ba83;return _0x3f59d7;})['then'](respondWithFilteredResult(_0x3ff6a0,_0xf81554))[_0x9f22('0x52')](handleError(_0x3ff6a0,null));};exports['show']=function(_0x5d0dce,_0xe7cda1){var _0x554332={'raw':!![],'where':{'id':_0x5d0dce['params']['id']}},_0x2c17ba={};_0x2c17ba[_0x9f22('0x3e')]=_[_0x9f22('0x3d')](db[_0x9f22('0x38')][_0x9f22('0x39')]);_0x2c17ba[_0x9f22('0x3c')]=_[_0x9f22('0x3d')](_0x5d0dce[_0x9f22('0x3c')]);_0x2c17ba[_0x9f22('0x48')]=_['intersection'](_0x2c17ba[_0x9f22('0x3e')],_0x2c17ba['query']);_0x554332['attributes']=_[_0x9f22('0x40')](_0x2c17ba[_0x9f22('0x3e')],qs[_0x9f22('0x41')](_0x5d0dce[_0x9f22('0x3c')][_0x9f22('0x41')]));_0x554332['attributes']=_0x554332[_0x9f22('0x3f')]['length']?_0x554332[_0x9f22('0x3f')]:_0x2c17ba[_0x9f22('0x3e')];if(_0x5d0dce['query'][_0x9f22('0x53')]){_0x554332[_0x9f22('0x4f')]=[{'all':!![]}];}_0x554332=_['merge']({},_0x554332,_0x5d0dce[_0x9f22('0x4e')]);return db['WhatsappMessage'][_0x9f22('0x54')](_0x554332)['then'](handleEntityNotFound(_0xe7cda1,null))['then'](respondWithResult(_0xe7cda1,null))[_0x9f22('0x52')](handleError(_0xe7cda1,null));};exports[_0x9f22('0x55')]=function(_0x24bb52,_0x23b994){return db[_0x9f22('0x38')][_0x9f22('0x55')](_0x24bb52[_0x9f22('0x56')],{})['then'](respondWithResult(_0x23b994,0xc9))['catch'](handleError(_0x23b994,null));};exports[_0x9f22('0x32')]=function(_0x5485e3,_0x3b078f){if(_0x5485e3['body']['id']){delete _0x5485e3[_0x9f22('0x56')]['id'];}return db[_0x9f22('0x38')][_0x9f22('0x54')]({'where':{'id':_0x5485e3[_0x9f22('0x57')]['id']}})[_0x9f22('0x1d')](handleEntityNotFound(_0x3b078f,null))[_0x9f22('0x1d')](saveUpdates(_0x5485e3['body'],null))[_0x9f22('0x1d')](respondWithResult(_0x3b078f,null))[_0x9f22('0x52')](handleError(_0x3b078f,null));};exports['destroy']=function(_0x34e667,_0x1de249){return db[_0x9f22('0x38')][_0x9f22('0x54')]({'where':{'id':_0x34e667[_0x9f22('0x57')]['id']}})[_0x9f22('0x1d')](handleEntityNotFound(_0x1de249,null))['then'](removeEntity(_0x1de249,null))[_0x9f22('0x52')](handleError(_0x1de249,null));};exports[_0x9f22('0x58')]=function(_0x490102,_0x3d6972){return db[_0x9f22('0x38')][_0x9f22('0x58')]()[_0x9f22('0x1d')](respondWithResult(_0x3d6972,null))[_0x9f22('0x52')](handleError(_0x3d6972,null));};var interaction_log=require(_0x9f22('0x14'))('whatsapp-interactions');exports[_0x9f22('0x59')]=function(_0x1736da,_0x291e06,_0x59f026){var _0x4a50e4={'agent':{},'channel':_0x9f22('0x5a')};if(_0x1736da[_0x9f22('0x56')]['id']){delete _0x1736da['body']['id'];}_0x1736da[_0x9f22('0x56')][_0x9f22('0x5b')]=!![];_0x1736da[_0x9f22('0x56')][_0x9f22('0x5c')]=moment()[_0x9f22('0x5d')](_0x9f22('0x5e'));_0x1736da[_0x9f22('0x56')]['UserId']=_0x1736da[_0x9f22('0x56')][_0x9f22('0x5f')]||_0x1736da[_0x9f22('0x60')]['id'];_0x4a50e4[_0x9f22('0x61')]['id']=_0x1736da[_0x9f22('0x56')]['UserId'];return db['WhatsappMessage']['find']({'where':{'id':_0x1736da[_0x9f22('0x57')]['id'],'UserId':null}})[_0x9f22('0x1d')](handleEntityNotFound(_0x291e06,null))[_0x9f22('0x1d')](saveUpdates(_0x1736da['body'],null))[_0x9f22('0x1d')](function(_0x53cff3){if(_0x53cff3){_0x4a50e4['message']=_0x53cff3[_0x9f22('0x62')]({'plain':!![]});return db[_0x9f22('0x63')][_0x9f22('0x54')]({'where':{'id':_0x53cff3[_0x9f22('0x64')]}});}return null;})[_0x9f22('0x1d')](handleEntityNotFound(_0x291e06,null))[_0x9f22('0x1d')](function(_0x15518d){if(_0x15518d){return _0x15518d['update']({'UserId':_0x1736da[_0x9f22('0x56')]['UserId'],'read1stAt':_[_0x9f22('0x65')](_0x15518d[_0x9f22('0x66')])?moment()[_0x9f22('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x35f8b8){if(_0x35f8b8){_0x4a50e4[_0x9f22('0x67')]=_0x35f8b8[_0x9f22('0x62')]({'plain':!![]});interaction_log[_0x9f22('0x1e')](_0x9f22('0x68'),_0x1736da[_0x9f22('0x60')]['id'],_0x1736da[_0x9f22('0x60')]['name'],_0x1736da[_0x9f22('0x60')][_0x9f22('0x69')],_0x4a50e4[_0x9f22('0x67')]['id'],_0x1736da['body']?JSON['stringify'](_0x1736da[_0x9f22('0x56')]):'null');return respondWithRpcPromise(_0x9f22('0x6a'),_0x9f22('0x6b'),_0x4a50e4);}return null;})['then'](function(_0x4137ee){var _0x362814=_0x9f22('0x6c')+_0x4137ee['message'][_0x9f22('0x6d')];return db[_0x9f22('0x6e')][_0x9f22('0x3c')](_0x362814,{'type':db['Sequelize']['QueryTypes'][_0x9f22('0x6f')],'raw':!![]})[_0x9f22('0x1d')](function(_0x44eab2){return _0x44eab2;});})[_0x9f22('0x1d')](function(_0x26e3bc){if(_0x26e3bc){_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x70')]=_0x26e3bc[0x0];if(!_0x1736da[_0x9f22('0x56')][_0x9f22('0x5f')])return;return db['User']['find']({'where':{'id':_0x1736da[_0x9f22('0x56')][_0x9f22('0x5f')],'role':'agent'},'attributes':['id','name',_0x9f22('0x71'),_0x9f22('0x72'),_0x9f22('0x73')],'raw':!![]});}return null;})[_0x9f22('0x1d')](function(_0x1dd476){if(!_0x1dd476)return null;_0x4a50e4[_0x9f22('0x25')]['agent']=_0x1dd476;return _0x4a50e4;})[_0x9f22('0x1d')](function(_0x37e8e){if(_0x37e8e){if(_0x1736da['body'][_0x9f22('0x74')]){_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x75')]=util[_0x9f22('0x5d')](_0x9f22('0x76'),_0x1736da[_0x9f22('0x60')][_0x9f22('0x34')]);_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x77')]=_0x4a50e4['channel'];_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x78')]=_0x4a50e4[_0x9f22('0x77')];_0x4a50e4[_0x9f22('0x25')][_0x9f22('0x79')]='accept';return respondWithRpcPromise(_0x9f22('0x7a'),_0x9f22('0x7a'),{'event':'acceptmessage','message':_0x4a50e4[_0x9f22('0x25')]},client9002)[_0x9f22('0x1d')](function(){return _0x4a50e4;});}return _0x4a50e4;}return null;})[_0x9f22('0x1d')](respondWithResult(_0x291e06,null))['catch'](handleError(_0x291e06,null));};var interaction_log=require(_0x9f22('0x14'))(_0x9f22('0x7b'));exports[_0x9f22('0x30')]=function(_0xdf4d63,_0x181f9a,_0x533686){var _0x4f5b2f={'agent':{},'channel':_0x9f22('0x5a')};if(_0xdf4d63[_0x9f22('0x56')]['id']){delete _0xdf4d63['body']['id'];}_0xdf4d63['body'][_0x9f22('0x5f')]=_0xdf4d63[_0x9f22('0x56')][_0x9f22('0x5f')]||_0xdf4d63[_0x9f22('0x60')]['id'];_0x4f5b2f[_0x9f22('0x61')]['id']=_0xdf4d63[_0x9f22('0x56')][_0x9f22('0x5f')];return db['WhatsappMessage'][_0x9f22('0x54')]({'where':{'id':_0xdf4d63[_0x9f22('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x181f9a,null))[_0x9f22('0x1d')](function(_0x4aed7b){if(_0x4aed7b){_0x4f5b2f[_0x9f22('0x25')]=_0x4aed7b['get']({'plain':!![]});return db[_0x9f22('0x63')][_0x9f22('0x54')]({'where':{'id':_0x4aed7b[_0x9f22('0x64')]}});}return null;})[_0x9f22('0x1d')](handleEntityNotFound(_0x181f9a,null))[_0x9f22('0x1d')](function(_0x3ed97d){if(_0x3ed97d){_0x4f5b2f[_0x9f22('0x67')]=_0x3ed97d[_0x9f22('0x62')]({'plain':!![]});interaction_log[_0x9f22('0x1e')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xdf4d63[_0x9f22('0x60')]['id'],_0xdf4d63['user'][_0x9f22('0x34')],_0xdf4d63[_0x9f22('0x60')][_0x9f22('0x69')],_0x4f5b2f[_0x9f22('0x67')]['id'],_0xdf4d63[_0x9f22('0x56')]?JSON[_0x9f22('0x23')](_0xdf4d63[_0x9f22('0x56')]):_0x9f22('0x7c'));return respondWithRpcPromise('RejectMessage',_0x9f22('0x7d'),_0x4f5b2f);}return null;})[_0x9f22('0x1d')](function(_0x32f4b2){var _0x1aab1e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x32f4b2[_0x9f22('0x25')]['ContactId'];return db['sequelize'][_0x9f22('0x3c')](_0x1aab1e,{'type':db[_0x9f22('0x7e')][_0x9f22('0x7f')][_0x9f22('0x6f')],'raw':!![]})[_0x9f22('0x1d')](function(_0x22603d){return _0x22603d;});})[_0x9f22('0x1d')](function(_0x12ec8d){if(_0x12ec8d){_0x4f5b2f[_0x9f22('0x25')][_0x9f22('0x70')]=_0x12ec8d[0x0];if(!_0xdf4d63[_0x9f22('0x56')][_0x9f22('0x5f')])return;return db[_0x9f22('0x80')]['find']({'where':{'id':_0xdf4d63['body']['UserId'],'role':_0x9f22('0x61')},'attributes':['id',_0x9f22('0x34'),_0x9f22('0x71'),_0x9f22('0x72'),_0x9f22('0x73')],'raw':!![]});}return null;})[_0x9f22('0x1d')](function(_0x5daccb){if(!_0x5daccb)return null;_0x4f5b2f['message'][_0x9f22('0x61')]=_0x5daccb;return _0x4f5b2f;})[_0x9f22('0x1d')](function(_0x218939){if(_0x218939){_0x218939[_0x9f22('0x25')]['interface']=util[_0x9f22('0x5d')]('SIP/%s',_0xdf4d63[_0x9f22('0x60')][_0x9f22('0x34')]);_0x218939[_0x9f22('0x25')][_0x9f22('0x77')]=_0x4f5b2f[_0x9f22('0x77')];_0x218939[_0x9f22('0x25')][_0x9f22('0x78')]=_0x4f5b2f['channel'];_0x218939[_0x9f22('0x25')]['event']=_0x9f22('0x30');respondWithRpcPromise(_0x9f22('0x7a'),_0x9f22('0x7a'),{'event':_0x9f22('0x81'),'message':_0x218939[_0x9f22('0x25')]},client9002);return _0x4f5b2f;}return null;})[_0x9f22('0x1d')](respondWithResult(_0x181f9a,null))[_0x9f22('0x52')](handleError(_0x181f9a,null));};exports['status']=function(_0xed9dc9,_0x571546,_0x35b4aa){if(_0xed9dc9['body']['id']){delete _0xed9dc9[_0x9f22('0x56')]['id'];}var _0x1bb2e6;return db[_0x9f22('0x38')]['find']({'where':{'id':_0xed9dc9[_0x9f22('0x57')]['id']}})['then'](handleEntityNotFound(_0x571546,null))[_0x9f22('0x1d')](function(_0x524532){if(_0x524532){_0x1bb2e6=_0x524532;return db['WhatsappAccount']['find']({'where':{'id':_0x524532['WhatsappAccountId']}});}})[_0x9f22('0x1d')](handleEntityNotFound(_0x571546,null))[_0x9f22('0x1d')](function(_0x324b9f){if(_0x324b9f){logger[_0x9f22('0x21')](_0x9f22('0x82'),'status',_0x9f22('0x83'),_0x324b9f[_0x9f22('0x4a')],util[_0x9f22('0x84')](_0xed9dc9[_0x9f22('0x56')],{'showHidden':![],'depth':null}));switch(_0x324b9f[_0x9f22('0x4a')]){case _0x9f22('0x85'):if(_0xed9dc9[_0x9f22('0x56')][_0x9f22('0x86')]&&_0xed9dc9[_0x9f22('0x56')][_0x9f22('0x86')]===_0x1bb2e6[_0x9f22('0x87')]&&_0xed9dc9[_0x9f22('0x56')]['MessageStatus']&&_0xed9dc9[_0x9f22('0x56')][_0x9f22('0x88')]===_0x9f22('0x5b')){return _0x1bb2e6[_0x9f22('0x32')]({'read':!![]});}else{logger[_0x9f22('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x9f22('0x85'),util[_0x9f22('0x84')](_0xed9dc9['body'],{'showHidden':![],'depth':null}));}break;}return _0x1bb2e6;}})[_0x9f22('0x1d')](respondWithResult(_0x571546,null))[_0x9f22('0x52')](handleError(_0x571546,null));}; \ No newline at end of file +var _0x8bee=['null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','User','agent','fullname','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','WhatsappInteractionId','role','RejectMessage','rejectMessage','QueryTypes','contact','email','internal','rejectmessage','WhatsappAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','save','destroy','stack','name','send','index','map','WhatsappMessage','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','rows','keys','create','body','update','find','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','user','get','WhatsappInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify'];(function(_0x5ed954,_0x2fc5ed){var _0x4b067d=function(_0x4f5915){while(--_0x4f5915){_0x5ed954['push'](_0x5ed954['shift']());}};_0x4b067d(++_0x2fc5ed);}(_0x8bee,0x12f));var _0xe8be=function(_0x493c04,_0x4de40b){_0x493c04=_0x493c04-0x0;var _0x4f9981=_0x8bee[_0x493c04];return _0x4f9981;};'use strict';var emlformat=require(_0xe8be('0x0'));var rimraf=require(_0xe8be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8be('0x2'));var rp=require(_0xe8be('0x3'));var moment=require(_0xe8be('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe8be('0x5'));var util=require('util');var path=require(_0xe8be('0x6'));var sox=require(_0xe8be('0x7'));var csv=require(_0xe8be('0x8'));var ejs=require(_0xe8be('0x9'));var fs=require('fs');var fs_extra=require(_0xe8be('0xa'));var _=require(_0xe8be('0xb'));var squel=require(_0xe8be('0xc'));var crypto=require(_0xe8be('0xd'));var jsforce=require(_0xe8be('0xe'));var deskjs=require(_0xe8be('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe8be('0x10'));var Redis=require(_0xe8be('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe8be('0x12'));var hardwareService=require(_0xe8be('0x13'));var logger=require(_0xe8be('0x14'))(_0xe8be('0x15'));var utils=require('../../config/utils');var config=require(_0xe8be('0x16'));var licenseUtil=require(_0xe8be('0x17'));var db=require('../../mysqldb')['db'];config[_0xe8be('0x18')]=_[_0xe8be('0x19')](config[_0xe8be('0x18')],{'host':_0xe8be('0x1a'),'port':0x18eb});var socket=require(_0xe8be('0x1b'))(new Redis(config[_0xe8be('0x18')]));require('./whatsappMessage.socket')[_0xe8be('0x1c')](socket);var jayson=require(_0xe8be('0x1d'));var client=jayson[_0xe8be('0x1e')][_0xe8be('0x1f')]({'port':0x232c});var client9002=jayson[_0xe8be('0x1e')][_0xe8be('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x26f51e,_0x4664ad,_0x23f0fd,_0x4f2985){return new BPromise(function(_0x48d14e,_0x51b794){var _0x38580d=_0x4f2985||client;return _0x38580d[_0xe8be('0x20')](_0x26f51e,_0x23f0fd)[_0xe8be('0x21')](function(_0x52965b){logger['info'](_0xe8be('0x22'),_0x4664ad,'request\x20sent');logger[_0xe8be('0x23')](_0xe8be('0x24'),_0x4664ad,_0xe8be('0x25'),JSON['stringify'](_0x52965b));if(_0x52965b[_0xe8be('0x26')]){if(_0x52965b['error'][_0xe8be('0x27')]===0x1f4){logger['error'](_0xe8be('0x22'),_0x4664ad,_0x52965b[_0xe8be('0x26')][_0xe8be('0x28')]);return _0x51b794(_0x52965b[_0xe8be('0x26')][_0xe8be('0x28')]);}logger[_0xe8be('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x4664ad,_0x52965b[_0xe8be('0x26')][_0xe8be('0x28')]);return _0x48d14e(_0x52965b[_0xe8be('0x26')][_0xe8be('0x28')]);}else{logger[_0xe8be('0x29')](_0xe8be('0x22'),_0x4664ad,'request\x20sent');_0x48d14e(_0x52965b[_0xe8be('0x2a')][_0xe8be('0x28')]);}})[_0xe8be('0x2b')](function(_0x57406b){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x4664ad,_0x57406b);_0x51b794(_0x57406b);});});}function respondWithStatusCode(_0x54ace4,_0x13d148){_0x13d148=_0x13d148||0xcc;return function(_0x18005f){if(_0x18005f){return _0x54ace4['sendStatus'](_0x13d148);}return _0x54ace4[_0xe8be('0x2c')](_0x13d148)[_0xe8be('0x2d')]();};}function respondWithResult(_0x4e4d09,_0x3b571b){_0x3b571b=_0x3b571b||0xc8;return function(_0x2deb15){if(_0x2deb15){return _0x4e4d09[_0xe8be('0x2c')](_0x3b571b)[_0xe8be('0x2e')](_0x2deb15);}};}function respondWithFilteredResult(_0x1c92ac,_0x28a125){return function(_0x7f091b){if(_0x7f091b){var _0x4cf34d=typeof _0x28a125[_0xe8be('0x2f')]===_0xe8be('0x30')&&typeof _0x28a125[_0xe8be('0x31')]===_0xe8be('0x30');var _0x360bdf=_0x7f091b[_0xe8be('0x32')];var _0xe787c9=_0x4cf34d?0x0:_0x28a125['offset'];var _0x25def2=_0x4cf34d?_0x7f091b['count']:_0x28a125[_0xe8be('0x2f')]+_0x28a125[_0xe8be('0x31')];var _0x1b7f13;if(_0x25def2>=_0x360bdf){_0x25def2=_0x360bdf;_0x1b7f13=0xc8;}else{_0x1b7f13=0xce;}_0x1c92ac['status'](_0x1b7f13);return _0x1c92ac[_0xe8be('0x33')]('Content-Range',_0xe787c9+'-'+_0x25def2+'/'+_0x360bdf)['json'](_0x7f091b);}return null;};}function patchUpdates(_0x34e7f7){return function(_0x49a47a){try{jsonpatch[_0xe8be('0x34')](_0x49a47a,_0x34e7f7,!![]);}catch(_0x2aaa99){return BPromise[_0xe8be('0x35')](_0x2aaa99);}return _0x49a47a[_0xe8be('0x36')]();};}function saveUpdates(_0xd41c11,_0x56ecef){return function(_0x3f4a98){if(_0x3f4a98){return _0x3f4a98['update'](_0xd41c11)[_0xe8be('0x21')](function(_0x4ede8e){return _0x4ede8e;});}return null;};}function removeEntity(_0x728a25,_0x32ff09){return function(_0x1b7b8d){if(_0x1b7b8d){return _0x1b7b8d[_0xe8be('0x37')]()[_0xe8be('0x21')](function(){_0x728a25[_0xe8be('0x2c')](0xcc)[_0xe8be('0x2d')]();});}};}function handleEntityNotFound(_0x561e3d,_0x5e1ca4){return function(_0x57f68e){if(!_0x57f68e){_0x561e3d['sendStatus'](0x194);}return _0x57f68e;};}function handleError(_0xeb7e3,_0x2b0ef5){_0x2b0ef5=_0x2b0ef5||0x1f4;return function(_0xa2060b){logger['error'](_0xa2060b[_0xe8be('0x38')]);if(_0xa2060b[_0xe8be('0x39')]){delete _0xa2060b[_0xe8be('0x39')];}_0xeb7e3['status'](_0x2b0ef5)[_0xe8be('0x3a')](_0xa2060b);};}exports[_0xe8be('0x3b')]=function(_0x58b13a,_0x351b92){var _0x183827={},_0x14db5c={},_0x256ab7={'count':0x0,'rows':[]};var _0x2beada=_[_0xe8be('0x3c')](db[_0xe8be('0x3d')]['rawAttributes'],function(_0x171405){return{'name':_0x171405['fieldName'],'type':_0x171405[_0xe8be('0x3e')]['key']};});_0x14db5c[_0xe8be('0x3f')]=_['map'](_0x2beada,_0xe8be('0x39'));_0x14db5c[_0xe8be('0x40')]=_['keys'](_0x58b13a['query']);_0x14db5c['filters']=_[_0xe8be('0x41')](_0x14db5c[_0xe8be('0x3f')],_0x14db5c[_0xe8be('0x40')]);_0x183827[_0xe8be('0x42')]=_['intersection'](_0x14db5c[_0xe8be('0x3f')],qs[_0xe8be('0x43')](_0x58b13a['query'][_0xe8be('0x43')]));_0x183827[_0xe8be('0x42')]=_0x183827[_0xe8be('0x42')]['length']?_0x183827[_0xe8be('0x42')]:_0x14db5c['model'];if(!_0x58b13a['query'][_0xe8be('0x44')](_0xe8be('0x45'))){_0x183827[_0xe8be('0x31')]=qs[_0xe8be('0x31')](_0x58b13a[_0xe8be('0x40')][_0xe8be('0x31')]);_0x183827[_0xe8be('0x2f')]=qs[_0xe8be('0x2f')](_0x58b13a['query'][_0xe8be('0x2f')]);}_0x183827[_0xe8be('0x46')]=qs[_0xe8be('0x47')](_0x58b13a[_0xe8be('0x40')][_0xe8be('0x47')]);_0x183827[_0xe8be('0x48')]=qs['filters'](_['pick'](_0x58b13a[_0xe8be('0x40')],_0x14db5c[_0xe8be('0x49')]),_0x2beada);if(_0x58b13a[_0xe8be('0x40')][_0xe8be('0x4a')]){_0x183827[_0xe8be('0x48')]=_[_0xe8be('0x4b')](_0x183827[_0xe8be('0x48')],{'$or':_[_0xe8be('0x3c')](_0x2beada,function(_0x1b6495){if(_0x1b6495[_0xe8be('0x3e')]!=='VIRTUAL'){var _0x69b89={};_0x69b89[_0x1b6495['name']]={'$like':'%'+_0x58b13a[_0xe8be('0x40')][_0xe8be('0x4a')]+'%'};return _0x69b89;}})});}_0x183827=_[_0xe8be('0x4b')]({},_0x183827,_0x58b13a[_0xe8be('0x4c')]);var _0x15960a={'where':_0x183827[_0xe8be('0x48')]};return db[_0xe8be('0x3d')][_0xe8be('0x32')](_0x15960a)[_0xe8be('0x21')](function(_0x24ae4a){_0x256ab7[_0xe8be('0x32')]=_0x24ae4a;if(_0x58b13a[_0xe8be('0x40')][_0xe8be('0x4d')]){_0x183827[_0xe8be('0x4e')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x183827);})[_0xe8be('0x21')](function(_0x4d0443){_0x256ab7[_0xe8be('0x4f')]=_0x4d0443;return _0x256ab7;})[_0xe8be('0x21')](respondWithFilteredResult(_0x351b92,_0x183827))[_0xe8be('0x2b')](handleError(_0x351b92,null));};exports['show']=function(_0x40cabe,_0x201d1e){var _0x16ae4e={'raw':!![],'where':{'id':_0x40cabe['params']['id']}},_0x47bcff={};_0x47bcff[_0xe8be('0x3f')]=_[_0xe8be('0x50')](db[_0xe8be('0x3d')]['rawAttributes']);_0x47bcff[_0xe8be('0x40')]=_[_0xe8be('0x50')](_0x40cabe[_0xe8be('0x40')]);_0x47bcff[_0xe8be('0x49')]=_['intersection'](_0x47bcff[_0xe8be('0x3f')],_0x47bcff['query']);_0x16ae4e['attributes']=_['intersection'](_0x47bcff['model'],qs[_0xe8be('0x43')](_0x40cabe[_0xe8be('0x40')][_0xe8be('0x43')]));_0x16ae4e[_0xe8be('0x42')]=_0x16ae4e['attributes']['length']?_0x16ae4e['attributes']:_0x47bcff[_0xe8be('0x3f')];if(_0x40cabe[_0xe8be('0x40')][_0xe8be('0x4d')]){_0x16ae4e[_0xe8be('0x4e')]=[{'all':!![]}];}_0x16ae4e=_[_0xe8be('0x4b')]({},_0x16ae4e,_0x40cabe[_0xe8be('0x4c')]);return db[_0xe8be('0x3d')]['find'](_0x16ae4e)[_0xe8be('0x21')](handleEntityNotFound(_0x201d1e,null))[_0xe8be('0x21')](respondWithResult(_0x201d1e,null))[_0xe8be('0x2b')](handleError(_0x201d1e,null));};exports['create']=function(_0x5b425c,_0x424204){return db[_0xe8be('0x3d')][_0xe8be('0x51')](_0x5b425c[_0xe8be('0x52')],{})['then'](respondWithResult(_0x424204,0xc9))[_0xe8be('0x2b')](handleError(_0x424204,null));};exports[_0xe8be('0x53')]=function(_0x1b2d5f,_0x2fcb90){if(_0x1b2d5f[_0xe8be('0x52')]['id']){delete _0x1b2d5f[_0xe8be('0x52')]['id'];}return db[_0xe8be('0x3d')][_0xe8be('0x54')]({'where':{'id':_0x1b2d5f[_0xe8be('0x55')]['id']}})['then'](handleEntityNotFound(_0x2fcb90,null))[_0xe8be('0x21')](saveUpdates(_0x1b2d5f[_0xe8be('0x52')],null))[_0xe8be('0x21')](respondWithResult(_0x2fcb90,null))['catch'](handleError(_0x2fcb90,null));};exports[_0xe8be('0x37')]=function(_0x4c23e0,_0x400cb7){return db['WhatsappMessage'][_0xe8be('0x54')]({'where':{'id':_0x4c23e0['params']['id']}})['then'](handleEntityNotFound(_0x400cb7,null))[_0xe8be('0x21')](removeEntity(_0x400cb7,null))['catch'](handleError(_0x400cb7,null));};exports['describe']=function(_0x36fce6,_0x767a9e){return db['WhatsappMessage'][_0xe8be('0x56')]()['then'](respondWithResult(_0x767a9e,null))['catch'](handleError(_0x767a9e,null));};var interaction_log=require(_0xe8be('0x14'))(_0xe8be('0x57'));exports[_0xe8be('0x58')]=function(_0x2a37ca,_0xf05dc9,_0x390088){var _0x1fa111={'agent':{},'channel':_0xe8be('0x59')};if(_0x2a37ca[_0xe8be('0x52')]['id']){delete _0x2a37ca[_0xe8be('0x52')]['id'];}_0x2a37ca[_0xe8be('0x52')][_0xe8be('0x5a')]=!![];_0x2a37ca[_0xe8be('0x52')][_0xe8be('0x5b')]=moment()[_0xe8be('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x2a37ca['body']['UserId']=_0x2a37ca[_0xe8be('0x52')][_0xe8be('0x5d')]||_0x2a37ca[_0xe8be('0x5e')]['id'];_0x1fa111['agent']['id']=_0x2a37ca['body'][_0xe8be('0x5d')];return db[_0xe8be('0x3d')][_0xe8be('0x54')]({'where':{'id':_0x2a37ca[_0xe8be('0x55')]['id'],'UserId':null}})[_0xe8be('0x21')](handleEntityNotFound(_0xf05dc9,null))['then'](saveUpdates(_0x2a37ca['body'],null))[_0xe8be('0x21')](function(_0x497da7){if(_0x497da7){_0x1fa111[_0xe8be('0x28')]=_0x497da7[_0xe8be('0x5f')]({'plain':!![]});return db[_0xe8be('0x60')][_0xe8be('0x54')]({'where':{'id':_0x497da7['WhatsappInteractionId']}});}return null;})[_0xe8be('0x21')](handleEntityNotFound(_0xf05dc9,null))[_0xe8be('0x21')](function(_0x186a25){if(_0x186a25){return _0x186a25['update']({'UserId':_0x2a37ca[_0xe8be('0x52')][_0xe8be('0x5d')],'read1stAt':_['isNil'](_0x186a25[_0xe8be('0x61')])?moment()['format'](_0xe8be('0x62')):undefined});}return null;})['then'](function(_0x463794){if(_0x463794){_0x1fa111[_0xe8be('0x63')]=_0x463794[_0xe8be('0x5f')]({'plain':!![]});interaction_log[_0xe8be('0x29')](_0xe8be('0x64'),_0x2a37ca[_0xe8be('0x5e')]['id'],_0x2a37ca[_0xe8be('0x5e')]['name'],_0x2a37ca['user']['role'],_0x1fa111[_0xe8be('0x63')]['id'],_0x2a37ca[_0xe8be('0x52')]?JSON[_0xe8be('0x65')](_0x2a37ca[_0xe8be('0x52')]):_0xe8be('0x66'));return respondWithRpcPromise(_0xe8be('0x67'),'acceptMessage',_0x1fa111);}return null;})[_0xe8be('0x21')](function(_0x3e603c){var _0x1d8ad4=_0xe8be('0x68')+_0x3e603c[_0xe8be('0x28')][_0xe8be('0x69')];return db[_0xe8be('0x6a')][_0xe8be('0x40')](_0x1d8ad4,{'type':db[_0xe8be('0x6b')]['QueryTypes'][_0xe8be('0x6c')],'raw':!![]})['then'](function(_0x35e8d4){return _0x35e8d4;});})[_0xe8be('0x21')](function(_0x14132a){if(_0x14132a){_0x1fa111['message']['contact']=_0x14132a[0x0];if(!_0x2a37ca[_0xe8be('0x52')][_0xe8be('0x5d')])return;return db[_0xe8be('0x6d')][_0xe8be('0x54')]({'where':{'id':_0x2a37ca[_0xe8be('0x52')][_0xe8be('0x5d')],'role':_0xe8be('0x6e')},'attributes':['id',_0xe8be('0x39'),_0xe8be('0x6f'),'email','internal'],'raw':!![]});}return null;})[_0xe8be('0x21')](function(_0x5bb001){if(!_0x5bb001)return null;_0x1fa111['message']['agent']=_0x5bb001;return _0x1fa111;})['then'](function(_0x2e71e2){if(_0x2e71e2){if(_0x2a37ca[_0xe8be('0x52')]['manual']){_0x1fa111[_0xe8be('0x28')]['interface']=util[_0xe8be('0x5c')](_0xe8be('0x70'),_0x2a37ca[_0xe8be('0x5e')]['name']);_0x1fa111[_0xe8be('0x28')][_0xe8be('0x71')]=_0x1fa111[_0xe8be('0x71')];_0x1fa111[_0xe8be('0x28')][_0xe8be('0x72')]=_0x1fa111[_0xe8be('0x71')];_0x1fa111[_0xe8be('0x28')][_0xe8be('0x73')]=_0xe8be('0x58');return respondWithRpcPromise(_0xe8be('0x74'),_0xe8be('0x74'),{'event':_0xe8be('0x75'),'message':_0x1fa111[_0xe8be('0x28')]},client9002)['then'](function(){return _0x1fa111;});}return _0x1fa111;}return null;})[_0xe8be('0x21')](respondWithResult(_0xf05dc9,null))[_0xe8be('0x2b')](handleError(_0xf05dc9,null));};var interaction_log=require(_0xe8be('0x14'))(_0xe8be('0x57'));exports[_0xe8be('0x35')]=function(_0x41b4ea,_0x5f08f0,_0x35b0ee){var _0xc00cc3={'agent':{},'channel':_0xe8be('0x59')};if(_0x41b4ea[_0xe8be('0x52')]['id']){delete _0x41b4ea[_0xe8be('0x52')]['id'];}_0x41b4ea['body'][_0xe8be('0x5d')]=_0x41b4ea[_0xe8be('0x52')][_0xe8be('0x5d')]||_0x41b4ea[_0xe8be('0x5e')]['id'];_0xc00cc3[_0xe8be('0x6e')]['id']=_0x41b4ea['body']['UserId'];return db[_0xe8be('0x3d')][_0xe8be('0x54')]({'where':{'id':_0x41b4ea[_0xe8be('0x55')]['id'],'UserId':null}})[_0xe8be('0x21')](handleEntityNotFound(_0x5f08f0,null))[_0xe8be('0x21')](function(_0x189d35){if(_0x189d35){_0xc00cc3[_0xe8be('0x28')]=_0x189d35['get']({'plain':!![]});return db[_0xe8be('0x60')][_0xe8be('0x54')]({'where':{'id':_0x189d35[_0xe8be('0x76')]}});}return null;})[_0xe8be('0x21')](handleEntityNotFound(_0x5f08f0,null))['then'](function(_0x4ae0a2){if(_0x4ae0a2){_0xc00cc3[_0xe8be('0x63')]=_0x4ae0a2['get']({'plain':!![]});interaction_log[_0xe8be('0x29')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41b4ea[_0xe8be('0x5e')]['id'],_0x41b4ea['user'][_0xe8be('0x39')],_0x41b4ea['user'][_0xe8be('0x77')],_0xc00cc3[_0xe8be('0x63')]['id'],_0x41b4ea[_0xe8be('0x52')]?JSON['stringify'](_0x41b4ea[_0xe8be('0x52')]):_0xe8be('0x66'));return respondWithRpcPromise(_0xe8be('0x78'),_0xe8be('0x79'),_0xc00cc3);}return null;})[_0xe8be('0x21')](function(_0x19446a){var _0x2262b3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x19446a[_0xe8be('0x28')][_0xe8be('0x69')];return db[_0xe8be('0x6a')][_0xe8be('0x40')](_0x2262b3,{'type':db[_0xe8be('0x6b')][_0xe8be('0x7a')][_0xe8be('0x6c')],'raw':!![]})[_0xe8be('0x21')](function(_0x12bca9){return _0x12bca9;});})[_0xe8be('0x21')](function(_0x53abb4){if(_0x53abb4){_0xc00cc3['message'][_0xe8be('0x7b')]=_0x53abb4[0x0];if(!_0x41b4ea[_0xe8be('0x52')][_0xe8be('0x5d')])return;return db[_0xe8be('0x6d')][_0xe8be('0x54')]({'where':{'id':_0x41b4ea[_0xe8be('0x52')][_0xe8be('0x5d')],'role':'agent'},'attributes':['id',_0xe8be('0x39'),_0xe8be('0x6f'),_0xe8be('0x7c'),_0xe8be('0x7d')],'raw':!![]});}return null;})[_0xe8be('0x21')](function(_0x2c0aac){if(!_0x2c0aac)return null;_0xc00cc3['message']['agent']=_0x2c0aac;return _0xc00cc3;})[_0xe8be('0x21')](function(_0x219248){if(_0x219248){_0x219248[_0xe8be('0x28')]['interface']=util[_0xe8be('0x5c')](_0xe8be('0x70'),_0x41b4ea[_0xe8be('0x5e')][_0xe8be('0x39')]);_0x219248[_0xe8be('0x28')][_0xe8be('0x71')]=_0xc00cc3[_0xe8be('0x71')];_0x219248[_0xe8be('0x28')]['motionChannel']=_0xc00cc3[_0xe8be('0x71')];_0x219248['message'][_0xe8be('0x73')]=_0xe8be('0x35');respondWithRpcPromise(_0xe8be('0x74'),_0xe8be('0x74'),{'event':_0xe8be('0x7e'),'message':_0x219248[_0xe8be('0x28')]},client9002);return _0xc00cc3;}return null;})['then'](respondWithResult(_0x5f08f0,null))[_0xe8be('0x2b')](handleError(_0x5f08f0,null));};exports[_0xe8be('0x2c')]=function(_0x5d64e9,_0x1c3024,_0x31a203){if(_0x5d64e9[_0xe8be('0x52')]['id']){delete _0x5d64e9[_0xe8be('0x52')]['id'];}var _0xf2c215;return db[_0xe8be('0x3d')][_0xe8be('0x54')]({'where':{'id':_0x5d64e9[_0xe8be('0x55')]['id']}})['then'](handleEntityNotFound(_0x1c3024,null))[_0xe8be('0x21')](function(_0x47181b){if(_0x47181b){_0xf2c215=_0x47181b;return db[_0xe8be('0x7f')]['find']({'where':{'id':_0x47181b['WhatsappAccountId']}});}})[_0xe8be('0x21')](handleEntityNotFound(_0x1c3024,null))['then'](function(_0x5afc08){if(_0x5afc08){logger[_0xe8be('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xe8be('0x2c'),_0xe8be('0x80'),_0x5afc08[_0xe8be('0x3e')],util[_0xe8be('0x81')](_0x5d64e9['body'],{'showHidden':![],'depth':null}));switch(_0x5afc08['type']){case _0xe8be('0x82'):if(_0x5d64e9[_0xe8be('0x52')][_0xe8be('0x83')]&&_0x5d64e9['body'][_0xe8be('0x83')]===_0xf2c215[_0xe8be('0x84')]&&_0x5d64e9[_0xe8be('0x52')][_0xe8be('0x85')]&&_0x5d64e9['body'][_0xe8be('0x85')]==='read'){return _0xf2c215['update']({'read':!![]});}else{logger[_0xe8be('0x26')](_0xe8be('0x86'),_0xe8be('0x2c'),_0xe8be('0x82'),util[_0xe8be('0x81')](_0x5d64e9[_0xe8be('0x52')],{'showHidden':![],'depth':null}));}break;}return _0xf2c215;}})[_0xe8be('0x21')](respondWithResult(_0x1c3024,null))[_0xe8be('0x2b')](handleError(_0x1c3024,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 028111c..5ad9195 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 _0x5eb8=['WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x28c069,_0x3857d0){var _0x23c598=function(_0x169739){while(--_0x169739){_0x28c069['push'](_0x28c069['shift']());}};_0x23c598(++_0x3857d0);}(_0x5eb8,0xb0));var _0x85eb=function(_0x206338,_0x2d800b){_0x206338=_0x206338-0x0;var _0x2b87f2=_0x5eb8[_0x206338];return _0x2b87f2;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0x85eb('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x85eb('0x1')](0x0);var events={'afterCreate':_0x85eb('0x2'),'afterUpdate':_0x85eb('0x3'),'afterDestroy':_0x85eb('0x4')};function emitEvent(_0x13d8a9){return function(_0x13b1df,_0x44e313,_0x3c5798){WhatsappMessageEvents[_0x85eb('0x5')](_0x13d8a9+':'+_0x13b1df['id'],_0x13b1df);WhatsappMessageEvents[_0x85eb('0x5')](_0x13d8a9,_0x13b1df);_0x3c5798(null);};}for(var e in events){if(events[_0x85eb('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x85eb('0x7')]=WhatsappMessageEvents; \ No newline at end of file +var _0x1152=['remove','emit','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x1b9ce4,_0x19142b){var _0x488f43=function(_0x240f3d){while(--_0x240f3d){_0x1b9ce4['push'](_0x1b9ce4['shift']());}};_0x488f43(++_0x19142b);}(_0x1152,0x182));var _0x2115=function(_0x9e3edc,_0x594d61){_0x9e3edc=_0x9e3edc-0x0;var _0x44a387=_0x1152[_0x9e3edc];return _0x44a387;};'use strict';var EventEmitter=require(_0x2115('0x0'));var WhatsappMessage=require(_0x2115('0x1'))['db'][_0x2115('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2115('0x3')](0x0);var events={'afterCreate':_0x2115('0x4'),'afterUpdate':_0x2115('0x5'),'afterDestroy':_0x2115('0x6')};function emitEvent(_0x3b8dfa){return function(_0x4d0f31,_0x1e8a26,_0x5c17b3){WhatsappMessageEvents[_0x2115('0x7')](_0x3b8dfa+':'+_0x4d0f31['id'],_0x4d0f31);WhatsappMessageEvents[_0x2115('0x7')](_0x3b8dfa,_0x4d0f31);_0x5c17b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 092efe5..d7d7585 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 _0xac8d=['path','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','direction','toLowerCase','out','UserId','findOne','WhatsappInteractionId','then','update','catch','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','body','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','error','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','message_id','statuses','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','node-fetch'];(function(_0x3342b3,_0x590643){var _0x4fddb7=function(_0x2a755a){while(--_0x2a755a){_0x3342b3['push'](_0x3342b3['shift']());}};_0x4fddb7(++_0x590643);}(_0xac8d,0x1d8));var _0xdac8=function(_0x4c2f54,_0xdc401a){_0x4c2f54=_0x4c2f54-0x0;var _0x41b37b=_0xac8d[_0x4c2f54];return _0x41b37b;};'use strict';var _=require(_0xdac8('0x0'));var util=require(_0xdac8('0x1'));var logger=require(_0xdac8('0x2'))(_0xdac8('0x3'));var moment=require(_0xdac8('0x4'));var BPromise=require(_0xdac8('0x5'));var rp=require(_0xdac8('0x6'));var fetch=require(_0xdac8('0x7'));var fs=require('fs');var path=require(_0xdac8('0x8'));var rimraf=require('rimraf');var config=require(_0xdac8('0x9'));var attributes=require(_0xdac8('0xa'));module[_0xdac8('0xb')]=function(_0x13d70e,_0x1e1cc7){return _0x13d70e[_0xdac8('0xc')](_0xdac8('0xd'),attributes,{'tableName':_0xdac8('0xe'),'paranoid':![],'indexes':[{'name':_0xdac8('0xf'),'fields':['messageId']},{'name':_0xdac8('0x10'),'fields':['body'],'type':_0xdac8('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c6884,_0x1c1c20,_0x2f9c0d){var _0x2d68be=_0x13d70e['models'];var _0xfbdce0=_0x3c6884['get']({'plain':!![]});if(_0xfbdce0[_0xdac8('0x12')][_0xdac8('0x13')]()==='in'||_0xfbdce0[_0xdac8('0x12')]['toLowerCase']()===_0xdac8('0x14')&&!_0xfbdce0['secret']&&!_['isNil'](_0xfbdce0[_0xdac8('0x15')])){_0x2d68be['WhatsappInteraction'][_0xdac8('0x16')]({'where':{'id':_0xfbdce0[_0xdac8('0x17')]}})[_0xdac8('0x18')](function(_0x3830b4){if(_0x3830b4){_0x3830b4[_0xdac8('0x19')]({'lastMsgAt':_0xfbdce0['createdAt'],'lastMsgDirection':_0xfbdce0[_0xdac8('0x12')][_0xdac8('0x13')]()});}})[_0xdac8('0x1a')](function(_0x31bcd3){console['error'](_0x31bcd3);});}if(_0xfbdce0[_0xdac8('0x12')]===_0xdac8('0x14')&&!_0xfbdce0[_0xdac8('0x1b')]){var _0x18dcb5;_0x2d68be[_0xdac8('0x1c')][_0xdac8('0x1d')]({'where':{'id':_0xfbdce0[_0xdac8('0x1e')]},'raw':!![]})[_0xdac8('0x18')](function(_0x11ef2d){_0x18dcb5=_0x11ef2d;if(_0x18dcb5&&_0x18dcb5[_0xdac8('0x1f')]){switch(_0x18dcb5[_0xdac8('0x1f')]){case'twilio':var _0x13a6fe=require(_0xdac8('0x20'));if(_0x18dcb5[_0xdac8('0x21')]&&_0x18dcb5[_0xdac8('0x22')]&&_0x18dcb5[_0xdac8('0x23')]){var _0x498db4=new _0x13a6fe(_0x18dcb5[_0xdac8('0x21')],_0x18dcb5['authToken']);_0x498db4[_0xdac8('0x24')][_0xdac8('0x25')]({'body':_0xfbdce0[_0xdac8('0x26')],'to':_0xdac8('0x27')+_0xfbdce0[_0xdac8('0x23')],'from':_0xdac8('0x27')+_0x18dcb5[_0xdac8('0x23')],'statusCallback':_0x18dcb5['remote']+_0xdac8('0x28')+_0xfbdce0['id']+_0xdac8('0x29')+_0x18dcb5[_0xdac8('0x2a')]})[_0xdac8('0x18')](function(_0xb41b5a){if(_0xb41b5a[_0xdac8('0x2b')]){return _0x3c6884[_0xdac8('0x19')]({'messageId':_0xb41b5a[_0xdac8('0x2b')]});}})[_0xdac8('0x1a')](function(_0x3b0cb2){logger[_0xdac8('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xdac8('0x2d'),_0xdac8('0x20'),util[_0xdac8('0x2e')](_0x3b0cb2,{'showHidden':![],'depth':null}));});}else{logger[_0xdac8('0x2c')](_0xdac8('0x2f'),_0xdac8('0x2d'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xdac8('0x30'):var _0x2f6551=_0x18dcb5[_0xdac8('0x21')];var _0x3b9c7a=_0x18dcb5['authToken'];var _0x910db6=_0x18dcb5[_0xdac8('0x31')]+_0xdac8('0x32')+_0x2f6551+_0xdac8('0x33');var _0x3ebebd={'to':[_0xfbdce0[_0xdac8('0x23')]],'message':{'type':'text','text':_0xfbdce0[_0xdac8('0x26')]}};var _0x23f81c={'method':_0xdac8('0x34'),'uri':_0x910db6,'headers':{'Authorization':'Bearer\x20'+_0x3b9c7a,'Content-Type':_0xdac8('0x35')},'body':_0x3ebebd,'json':!![]};rp(_0x23f81c)[_0xdac8('0x18')](function(_0x539e46){if(_0x539e46['statuses'][0x0][_0xdac8('0x36')]){return _0x3c6884[_0xdac8('0x19')]({'messageId':_0x539e46[_0xdac8('0x37')][0x0][_0xdac8('0x36')]});}})[_0xdac8('0x1a')](function(_0x2dc875){logger[_0xdac8('0x38')](_0xdac8('0x39'),_0x2dc875);});break;}}})[_0xdac8('0x3a')](function(){_0x2f9c0d();});}else{_0x2f9c0d();}}},'charset':'utf8mb4','collate':_0xdac8('0x3b')});}; \ No newline at end of file +var _0xf3b4=['baseUrl','text','POST','Bearer\x20','application/json','statuses','message_id','err','finally','lodash','util','api','moment','request-promise','node-fetch','path','../../config/environment','exports','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','catch','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','whatsapp:','phone','remote','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf3b4,0x11c));var _0x4f3b=function(_0x2f8bd1,_0x36d5e4){_0x2f8bd1=_0x2f8bd1-0x0;var _0x17ea35=_0xf3b4[_0x2f8bd1];return _0x17ea35;};'use strict';var _=require(_0x4f3b('0x0'));var util=require(_0x4f3b('0x1'));var logger=require('../../config/logger')(_0x4f3b('0x2'));var moment=require(_0x4f3b('0x3'));var BPromise=require('bluebird');var rp=require(_0x4f3b('0x4'));var fetch=require(_0x4f3b('0x5'));var fs=require('fs');var path=require(_0x4f3b('0x6'));var rimraf=require('rimraf');var config=require(_0x4f3b('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x4f3b('0x8')]=function(_0x115986,_0x1891c3){return _0x115986['define']('WhatsappMessage',attributes,{'tableName':_0x4f3b('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4f3b('0xa')]},{'name':_0x4f3b('0xb'),'fields':[_0x4f3b('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a346f,_0x31128d,_0x34ca8a){var _0x5c698d=_0x115986[_0x4f3b('0xd')];var _0x3270c7=_0x1a346f[_0x4f3b('0xe')]({'plain':!![]});if(_0x3270c7[_0x4f3b('0xf')][_0x4f3b('0x10')]()==='in'||_0x3270c7[_0x4f3b('0xf')][_0x4f3b('0x10')]()===_0x4f3b('0x11')&&!_0x3270c7['secret']&&!_['isNil'](_0x3270c7[_0x4f3b('0x12')])){_0x5c698d[_0x4f3b('0x13')][_0x4f3b('0x14')]({'where':{'id':_0x3270c7[_0x4f3b('0x15')]}})[_0x4f3b('0x16')](function(_0x318749){if(_0x318749){_0x318749[_0x4f3b('0x17')]({'lastMsgAt':_0x3270c7['createdAt'],'lastMsgDirection':_0x3270c7[_0x4f3b('0xf')]['toLowerCase']()});}})[_0x4f3b('0x18')](function(_0x237eb7){console['error'](_0x237eb7);});}if(_0x3270c7[_0x4f3b('0xf')]==='out'&&!_0x3270c7[_0x4f3b('0x19')]){var _0x135b1c;_0x5c698d[_0x4f3b('0x1a')][_0x4f3b('0x1b')]({'where':{'id':_0x3270c7[_0x4f3b('0x1c')]},'raw':!![]})['then'](function(_0x34febb){_0x135b1c=_0x34febb;if(_0x135b1c&&_0x135b1c[_0x4f3b('0x1d')]){switch(_0x135b1c[_0x4f3b('0x1d')]){case _0x4f3b('0x1e'):var _0x2ebcc7=require(_0x4f3b('0x1e'));if(_0x135b1c[_0x4f3b('0x1f')]&&_0x135b1c[_0x4f3b('0x20')]&&_0x135b1c['phone']){var _0x2753b0=new _0x2ebcc7(_0x135b1c['accountSid'],_0x135b1c[_0x4f3b('0x20')]);_0x2753b0[_0x4f3b('0x21')]['create']({'body':_0x3270c7['body'],'to':_0x4f3b('0x22')+_0x3270c7[_0x4f3b('0x23')],'from':'whatsapp:'+_0x135b1c[_0x4f3b('0x23')],'statusCallback':_0x135b1c[_0x4f3b('0x24')]+_0x4f3b('0x25')+_0x3270c7['id']+_0x4f3b('0x26')+_0x135b1c[_0x4f3b('0x27')]})['then'](function(_0x300202){if(_0x300202[_0x4f3b('0x28')]){return _0x1a346f[_0x4f3b('0x17')]({'messageId':_0x300202[_0x4f3b('0x28')]});}})[_0x4f3b('0x18')](function(_0x15c742){logger[_0x4f3b('0x29')](_0x4f3b('0x2a'),_0x4f3b('0x2b'),_0x4f3b('0x1e'),util[_0x4f3b('0x2c')](_0x15c742,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4f3b('0x2a'),'afterCreate',_0x4f3b('0x1e'),_0x4f3b('0x2d'));}break;case'sinch':var _0x1ac016=_0x135b1c[_0x4f3b('0x1f')];var _0x22a4ce=_0x135b1c[_0x4f3b('0x20')];var _0x2b6e97=_0x135b1c[_0x4f3b('0x2e')]+'/whatsapp/v1/'+_0x1ac016+'/messages/';var _0x3f3d7f={'to':[_0x3270c7['phone']],'message':{'type':_0x4f3b('0x2f'),'text':_0x3270c7[_0x4f3b('0xc')]}};var _0xd4191b={'method':_0x4f3b('0x30'),'uri':_0x2b6e97,'headers':{'Authorization':_0x4f3b('0x31')+_0x22a4ce,'Content-Type':_0x4f3b('0x32')},'body':_0x3f3d7f,'json':!![]};rp(_0xd4191b)[_0x4f3b('0x16')](function(_0x51f911){if(_0x51f911[_0x4f3b('0x33')][0x0][_0x4f3b('0x34')]){return _0x1a346f[_0x4f3b('0x17')]({'messageId':_0x51f911[_0x4f3b('0x33')][0x0]['message_id']});}})[_0x4f3b('0x18')](function(_0x10db5f){logger[_0x4f3b('0x35')]('WhatsappMessage,\x20%s',_0x10db5f);});break;}}})[_0x4f3b('0x36')](function(){_0x34ca8a();});}else{_0x34ca8a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index da9656b..cb896ba 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 _0x466f=['redis','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','WhatsappMessage','create','body','options','debug','catch','CreateWhatsappMessage','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x5aaa82,_0x5d2e28){var _0x2aa517=function(_0x346c22){while(--_0x346c22){_0x5aaa82['push'](_0x5aaa82['shift']());}};_0x2aa517(++_0x5d2e28);}(_0x466f,0xf5));var _0xf466=function(_0x3c7291,_0x1beb39){_0x3c7291=_0x3c7291-0x0;var _0x372ca7=_0x466f[_0x3c7291];return _0x372ca7;};'use strict';var _=require(_0xf466('0x0'));var util=require(_0xf466('0x1'));var moment=require(_0xf466('0x2'));var BPromise=require('bluebird');var rs=require(_0xf466('0x3'));var fs=require('fs');var Redis=require(_0xf466('0x4'));var db=require(_0xf466('0x5'))['db'];var utils=require(_0xf466('0x6'));var logger=require('../../config/logger')(_0xf466('0x7'));var config=require(_0xf466('0x8'));var jayson=require(_0xf466('0x9'));var client=jayson['client'][_0xf466('0xa')]({'port':0x232a});config[_0xf466('0xb')]=_['defaults'](config[_0xf466('0xb')],{'host':_0xf466('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf466('0xb')]));require(_0xf466('0xd'))[_0xf466('0xe')](socket);function respondWithRpcPromise(_0x598190,_0x4c1219,_0x9a46d1){return new BPromise(function(_0x29bdc2,_0x2523fd){return client[_0xf466('0xf')](_0x598190,_0x9a46d1)[_0xf466('0x10')](function(_0xe4c683){logger[_0xf466('0x11')](_0xf466('0x12'),_0x4c1219,_0xf466('0x13'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x4c1219,_0xf466('0x13'),JSON[_0xf466('0x14')](_0xe4c683));if(_0xe4c683['error']){if(_0xe4c683[_0xf466('0x15')][_0xf466('0x16')]===0x1f4){logger[_0xf466('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x4c1219,_0xe4c683[_0xf466('0x15')][_0xf466('0x17')]);return _0x2523fd(_0xe4c683[_0xf466('0x15')]['message']);}logger[_0xf466('0x15')](_0xf466('0x12'),_0x4c1219,_0xe4c683[_0xf466('0x15')]['message']);return _0x29bdc2(_0xe4c683[_0xf466('0x15')][_0xf466('0x17')]);}else{logger[_0xf466('0x11')](_0xf466('0x12'),_0x4c1219,'request\x20sent');_0x29bdc2(_0xe4c683[_0xf466('0x18')][_0xf466('0x17')]);}})['catch'](function(_0x4f8e86){logger['error'](_0xf466('0x12'),_0x4c1219,_0x4f8e86);_0x2523fd(_0x4f8e86);});});}exports['CreateWhatsappMessage']=function(_0x32d843){var _0x3ac6e5=this;return new Promise(function(_0x452cb2,_0x386dfa){return db[_0xf466('0x19')][_0xf466('0x1a')](_0x32d843[_0xf466('0x1b')],{'raw':_0x32d843[_0xf466('0x1c')]?_0x32d843['options']['raw']===undefined?!![]:![]:!![]})[_0xf466('0x10')](function(_0x53e195){logger[_0xf466('0x11')]('CreateWhatsappMessage',_0x32d843);logger[_0xf466('0x1d')]('CreateWhatsappMessage',_0x32d843,JSON[_0xf466('0x14')](_0x53e195));_0x452cb2(_0x53e195);})[_0xf466('0x1e')](function(_0x4bef1c){logger[_0xf466('0x15')](_0xf466('0x1f'),_0x4bef1c['message'],_0x32d843);_0x386dfa(_0x3ac6e5[_0xf466('0x15')](0x1f4,_0x4bef1c[_0xf466('0x17')]));});});}; \ No newline at end of file +var _0x385d=['register','request','then','info','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','WhatsappMessage,\x20%s,\x20%s','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x385d,0x9e));var _0xd385=function(_0x1d026b,_0x26dc5d){_0x1d026b=_0x1d026b-0x0;var _0x1e152a=_0x385d[_0x1d026b];return _0x1e152a;};'use strict';var _=require(_0xd385('0x0'));var util=require(_0xd385('0x1'));var moment=require(_0xd385('0x2'));var BPromise=require(_0xd385('0x3'));var rs=require(_0xd385('0x4'));var fs=require('fs');var Redis=require(_0xd385('0x5'));var db=require(_0xd385('0x6'))['db'];var utils=require(_0xd385('0x7'));var logger=require('../../config/logger')(_0xd385('0x8'));var config=require(_0xd385('0x9'));var jayson=require(_0xd385('0xa'));var client=jayson[_0xd385('0xb')][_0xd385('0xc')]({'port':0x232a});config[_0xd385('0xd')]=_[_0xd385('0xe')](config[_0xd385('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd385('0xf'))(new Redis(config[_0xd385('0xd')]));require(_0xd385('0x10'))[_0xd385('0x11')](socket);function respondWithRpcPromise(_0xe027eb,_0x23d865,_0x486372){return new BPromise(function(_0x4f5b,_0x57f2b0){return client[_0xd385('0x12')](_0xe027eb,_0x486372)[_0xd385('0x13')](function(_0x546044){logger[_0xd385('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x23d865,'request\x20sent');logger[_0xd385('0x15')](_0xd385('0x16'),_0x23d865,_0xd385('0x17'),JSON['stringify'](_0x546044));if(_0x546044['error']){if(_0x546044['error'][_0xd385('0x18')]===0x1f4){logger[_0xd385('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x23d865,_0x546044[_0xd385('0x19')]['message']);return _0x57f2b0(_0x546044[_0xd385('0x19')][_0xd385('0x1a')]);}logger[_0xd385('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x23d865,_0x546044[_0xd385('0x19')]['message']);return _0x4f5b(_0x546044[_0xd385('0x19')][_0xd385('0x1a')]);}else{logger[_0xd385('0x14')](_0xd385('0x1b'),_0x23d865,'request\x20sent');_0x4f5b(_0x546044['result'][_0xd385('0x1a')]);}})[_0xd385('0x1c')](function(_0x400534){logger[_0xd385('0x19')](_0xd385('0x1b'),_0x23d865,_0x400534);_0x57f2b0(_0x400534);});});}exports[_0xd385('0x1d')]=function(_0x269762){var _0x1993f6=this;return new Promise(function(_0x23ebbd,_0xbdf696){return db[_0xd385('0x1e')][_0xd385('0x1f')](_0x269762['body'],{'raw':_0x269762[_0xd385('0x20')]?_0x269762['options'][_0xd385('0x21')]===undefined?!![]:![]:!![]})[_0xd385('0x13')](function(_0x5b58a9){logger[_0xd385('0x14')]('CreateWhatsappMessage',_0x269762);logger[_0xd385('0x15')](_0xd385('0x1d'),_0x269762,JSON[_0xd385('0x22')](_0x5b58a9));_0x23ebbd(_0x5b58a9);})['catch'](function(_0x310dbd){logger[_0xd385('0x19')](_0xd385('0x1d'),_0x310dbd[_0xd385('0x1a')],_0x269762);_0xbdf696(_0x1993f6[_0xd385('0x19')](0x1f4,_0x310dbd[_0xd385('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 8637bb3..ec2db09 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 _0x6c04=['length','whatsappMessage:','./whatsappMessage.events','save','emit','removeListener','register'];(function(_0x2ca3d8,_0xf83cb8){var _0x2639d9=function(_0x5ee2bc){while(--_0x5ee2bc){_0x2ca3d8['push'](_0x2ca3d8['shift']());}};_0x2639d9(++_0xf83cb8);}(_0x6c04,0x79));var _0x46c0=function(_0x11489d,_0x1738d4){_0x11489d=_0x11489d-0x0;var _0x56a378=_0x6c04[_0x11489d];return _0x56a378;};'use strict';var WhatsappMessageEvents=require(_0x46c0('0x0'));var events=[_0x46c0('0x1'),'remove','update'];function createListener(_0x3a6b25,_0x8c57c4){return function(_0x37925e){_0x8c57c4[_0x46c0('0x2')](_0x3a6b25,_0x37925e);};}function removeListener(_0x23ab77,_0x406bc7){return function(){WhatsappMessageEvents[_0x46c0('0x3')](_0x23ab77,_0x406bc7);};}exports[_0x46c0('0x4')]=function(_0x1c4a05){for(var _0xebb088=0x0,_0x2ef42f=events[_0x46c0('0x5')];_0xebb088<_0x2ef42f;_0xebb088++){var _0x728bab=events[_0xebb088];var _0x32ebcc=createListener(_0x46c0('0x6')+_0x728bab,_0x1c4a05);WhatsappMessageEvents['on'](_0x728bab,_0x32ebcc);}}; \ No newline at end of file +var _0xeca6=['update','removeListener','length','whatsappMessage:','remove'];(function(_0x477e2e,_0x3fa019){var _0x27e036=function(_0x335b74){while(--_0x335b74){_0x477e2e['push'](_0x477e2e['shift']());}};_0x27e036(++_0x3fa019);}(_0xeca6,0x72));var _0x6eca=function(_0x24948f,_0x50451d){_0x24948f=_0x24948f-0x0;var _0x216686=_0xeca6[_0x24948f];return _0x216686;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=['save',_0x6eca('0x0'),_0x6eca('0x1')];function createListener(_0x23fd9d,_0x44243d){return function(_0x4d3a00){_0x44243d['emit'](_0x23fd9d,_0x4d3a00);};}function removeListener(_0x2716be,_0x3e9870){return function(){WhatsappMessageEvents[_0x6eca('0x2')](_0x2716be,_0x3e9870);};}exports['register']=function(_0x54cd23){for(var _0x20d183=0x0,_0x5abca5=events[_0x6eca('0x3')];_0x20d183<_0x5abca5;_0x20d183++){var _0x663166=events[_0x20d183];var _0x3d3601=createListener(_0x6eca('0x4')+_0x663166,_0x54cd23);WhatsappMessageEvents['on'](_0x663166,_0x3d3601);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index eb67337..58e2490 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 _0xfcf8=['../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1aa3f4,_0x197b65){var _0x1ec6b7=function(_0x55283a){while(--_0x55283a){_0x1aa3f4['push'](_0x1aa3f4['shift']());}};_0x1ec6b7(++_0x197b65);}(_0xfcf8,0x8f));var _0x8fcf=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfcf8[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x8fcf('0x0'));var util=require(_0x8fcf('0x1'));var path=require(_0x8fcf('0x2'));var timeout=require(_0x8fcf('0x3'));var express=require(_0x8fcf('0x4'));var router=express[_0x8fcf('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8fcf('0x6'));var interaction=require(_0x8fcf('0x7'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0x8fcf('0x8')]('/',auth['isAuthenticated'](),controller[_0x8fcf('0x9')]);router[_0x8fcf('0x8')](_0x8fcf('0xa'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0xc')]);router[_0x8fcf('0x8')](_0x8fcf('0xd'),auth['isAuthenticated'](),controller[_0x8fcf('0xe')]);router[_0x8fcf('0x8')](_0x8fcf('0xf'),auth[_0x8fcf('0xb')](),controller['getMembers']);router[_0x8fcf('0x8')](_0x8fcf('0x10'),auth['isAuthenticated'](),controller[_0x8fcf('0x11')]);router['get'](_0x8fcf('0x12'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8fcf('0x14')]);router[_0x8fcf('0x15')](_0x8fcf('0x10'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x16')]);router[_0x8fcf('0x15')](_0x8fcf('0x12'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x17')]);router[_0x8fcf('0x18')](_0x8fcf('0xd'),auth['isAuthenticated'](),controller[_0x8fcf('0x19')]);router[_0x8fcf('0x1a')](_0x8fcf('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x8fcf('0x1a')](_0x8fcf('0x10'),auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x1b')]);router[_0x8fcf('0x1a')]('/:id/users',auth[_0x8fcf('0xb')](),controller[_0x8fcf('0x1c')]);module[_0x8fcf('0x1d')]=router; \ No newline at end of file +var _0x6074=['/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./whatsappQueue.controller','get','isAuthenticated','index'];(function(_0x121edc,_0x2befbc){var _0x23aa0d=function(_0x3f69f4){while(--_0x3f69f4){_0x121edc['push'](_0x121edc['shift']());}};_0x23aa0d(++_0x2befbc);}(_0x6074,0xd6));var _0x4607=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x6074[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x4607('0x0'));var util=require('util');var path=require(_0x4607('0x1'));var timeout=require(_0x4607('0x2'));var express=require(_0x4607('0x3'));var router=express['Router']();var fs_extra=require(_0x4607('0x4'));var auth=require(_0x4607('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4607('0x6'));router[_0x4607('0x7')]('/',auth[_0x4607('0x8')](),controller[_0x4607('0x9')]);router[_0x4607('0x7')](_0x4607('0xa'),auth['isAuthenticated'](),controller[_0x4607('0xb')]);router['get'](_0x4607('0xc'),auth[_0x4607('0x8')](),controller[_0x4607('0xd')]);router[_0x4607('0x7')](_0x4607('0xe'),auth[_0x4607('0x8')](),controller['getMembers']);router[_0x4607('0x7')](_0x4607('0xf'),auth[_0x4607('0x8')](),controller[_0x4607('0x10')]);router[_0x4607('0x7')](_0x4607('0x11'),auth['isAuthenticated'](),controller[_0x4607('0x12')]);router[_0x4607('0x13')]('/',auth[_0x4607('0x8')](),controller[_0x4607('0x14')]);router['post'](_0x4607('0xf'),auth[_0x4607('0x8')](),controller['addTeams']);router[_0x4607('0x13')](_0x4607('0x11'),auth['isAuthenticated'](),controller[_0x4607('0x15')]);router[_0x4607('0x16')](_0x4607('0xc'),auth[_0x4607('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4607('0x17')]);router[_0x4607('0x18')](_0x4607('0xf'),auth[_0x4607('0x8')](),controller[_0x4607('0x19')]);router[_0x4607('0x18')](_0x4607('0x11'),auth[_0x4607('0x8')](),controller[_0x4607('0x1a')]);module[_0x4607('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index dff9fc9..9b9937a 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 _0x4522=['beepall','roundrobin','STRING','name','INTEGER','rrmemory'];(function(_0x1323df,_0x1fdc48){var _0x9bd3cd=function(_0x16f849){while(--_0x16f849){_0x1323df['push'](_0x1323df['shift']());}};_0x9bd3cd(++_0x1fdc48);}(_0x4522,0x1a0));var _0x2452=function(_0x4d72b0,_0x6ba7fa){_0x4d72b0=_0x4d72b0-0x0;var _0x159901=_0x4522[_0x4d72b0];return _0x159901;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2452('0x0')],'unique':_0x2452('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x2452('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2452('0x3'),_0x2452('0x4'),_0x2452('0x5'))},'description':{'type':Sequelize[_0x2452('0x0')]}}; \ No newline at end of file +var _0xf3dc=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x35ea44,_0x314ac5){_0x35ea44=_0x35ea44-0x0;var _0x432f30=_0xf3dc[_0x35ea44];return _0x432f30;};'use strict';var Sequelize=require(_0xcf3d('0x0'));module[_0xcf3d('0x1')]={'name':{'type':Sequelize[_0xcf3d('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcf3d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcf3d('0x4')](_0xcf3d('0x5'),_0xcf3d('0x6'),_0xcf3d('0x7'))},'description':{'type':Sequelize[_0xcf3d('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 97ab890..367eb2c 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 _0xc4cf=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','destroy','WhatsappQueues','end','error','stack','name','send','map','WhatsappQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserWhatsappQueue','hasOwnProperty','nolimit','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x13931a,_0x1c9eb5){var _0x58a813=function(_0x81cdcf){while(--_0x81cdcf){_0x13931a['push'](_0x13931a['shift']());}};_0x58a813(++_0x1c9eb5);}(_0xc4cf,0x10f));var _0xfc4c=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xc4cf[_0x4ed520];return _0x4415a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfc4c('0x0'));var zipdir=require(_0xfc4c('0x1'));var jsonpatch=require(_0xfc4c('0x2'));var rp=require(_0xfc4c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfc4c('0x4'));var sox=require('sox');var csv=require(_0xfc4c('0x5'));var ejs=require(_0xfc4c('0x6'));var fs=require('fs');var fs_extra=require(_0xfc4c('0x7'));var _=require(_0xfc4c('0x8'));var squel=require(_0xfc4c('0x9'));var crypto=require(_0xfc4c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfc4c('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfc4c('0xc'));var Redis=require('ioredis');var authService=require(_0xfc4c('0xd'));var qs=require(_0xfc4c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc4c('0xf'));var logger=require(_0xfc4c('0x10'))(_0xfc4c('0x11'));var utils=require(_0xfc4c('0x12'));var config=require(_0xfc4c('0x13'));var licenseUtil=require(_0xfc4c('0x14'));var db=require(_0xfc4c('0x15'))['db'];config[_0xfc4c('0x16')]=_['defaults'](config[_0xfc4c('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc4c('0x17'))(new Redis(config['redis']));require(_0xfc4c('0x18'))[_0xfc4c('0x19')](socket);function respondWithStatusCode(_0x57ea02,_0x490c2f){_0x490c2f=_0x490c2f||0xcc;return function(_0x237c1e){if(_0x237c1e){return _0x57ea02[_0xfc4c('0x1a')](_0x490c2f);}return _0x57ea02['status'](_0x490c2f)['end']();};}function respondWithResult(_0x26f420,_0x112008){_0x112008=_0x112008||0xc8;return function(_0x293904){if(_0x293904){return _0x26f420[_0xfc4c('0x1b')](_0x112008)['json'](_0x293904);}};}function respondWithFilteredResult(_0x2940fb,_0x3a89db){return function(_0x1d43fd){if(_0x1d43fd){var _0xc88b30=typeof _0x3a89db[_0xfc4c('0x1c')]===_0xfc4c('0x1d')&&typeof _0x3a89db[_0xfc4c('0x1e')]===_0xfc4c('0x1d');var _0x40c9b4=_0x1d43fd['count'];var _0x244d54=_0xc88b30?0x0:_0x3a89db['offset'];var _0x35375c=_0xc88b30?_0x1d43fd['count']:_0x3a89db[_0xfc4c('0x1c')]+_0x3a89db[_0xfc4c('0x1e')];var _0xfcf9f7;if(_0x35375c>=_0x40c9b4){_0x35375c=_0x40c9b4;_0xfcf9f7=0xc8;}else{_0xfcf9f7=0xce;}_0x2940fb[_0xfc4c('0x1b')](_0xfcf9f7);return _0x2940fb[_0xfc4c('0x1f')](_0xfc4c('0x20'),_0x244d54+'-'+_0x35375c+'/'+_0x40c9b4)[_0xfc4c('0x21')](_0x1d43fd);}return null;};}function patchUpdates(_0x3da899){return function(_0x44f566){try{jsonpatch[_0xfc4c('0x22')](_0x44f566,_0x3da899,!![]);}catch(_0x35d179){return BPromise['reject'](_0x35d179);}return _0x44f566[_0xfc4c('0x23')]();};}function saveUpdates(_0x542459,_0x429524){return function(_0x44b225){if(_0x44b225){return _0x44b225[_0xfc4c('0x24')](_0x542459)[_0xfc4c('0x25')](function(_0x5c0f2f){return _0x5c0f2f;});}return null;};}function removeEntity(_0x178069,_0x92b3f4){return function(_0xc1bc08){if(_0xc1bc08){return _0xc1bc08[_0xfc4c('0x26')]()[_0xfc4c('0x25')](function(){var _0x517527=_0xc1bc08['get']({'plain':!![]});var _0x42fc7e=_0xfc4c('0x27');return db['UserProfileResource'][_0xfc4c('0x26')]({'where':{'type':_0x42fc7e,'resourceId':_0x517527['id']}})[_0xfc4c('0x25')](function(){return _0xc1bc08;});})[_0xfc4c('0x25')](function(){_0x178069[_0xfc4c('0x1b')](0xcc)[_0xfc4c('0x28')]();});}};}function handleEntityNotFound(_0x4e7425,_0x56dfd3){return function(_0x12900f){if(!_0x12900f){_0x4e7425[_0xfc4c('0x1a')](0x194);}return _0x12900f;};}function handleError(_0x54d289,_0xf84a5c){_0xf84a5c=_0xf84a5c||0x1f4;return function(_0x5587f6){logger[_0xfc4c('0x29')](_0x5587f6[_0xfc4c('0x2a')]);if(_0x5587f6[_0xfc4c('0x2b')]){delete _0x5587f6[_0xfc4c('0x2b')];}_0x54d289['status'](_0xf84a5c)[_0xfc4c('0x2c')](_0x5587f6);};}exports['index']=function(_0x1a2839,_0x3ab737){var _0x577dd6={},_0x49feec={},_0x575a47={'count':0x0,'rows':[]};var _0x339034=_[_0xfc4c('0x2d')](db[_0xfc4c('0x2e')]['rawAttributes'],function(_0x567c13){return{'name':_0x567c13[_0xfc4c('0x2f')],'type':_0x567c13[_0xfc4c('0x30')][_0xfc4c('0x31')]};});_0x49feec[_0xfc4c('0x32')]=_[_0xfc4c('0x2d')](_0x339034,_0xfc4c('0x2b'));_0x49feec[_0xfc4c('0x33')]=_[_0xfc4c('0x34')](_0x1a2839[_0xfc4c('0x33')]);_0x49feec[_0xfc4c('0x35')]=_[_0xfc4c('0x36')](_0x49feec[_0xfc4c('0x32')],_0x49feec['query']);_0x577dd6[_0xfc4c('0x37')]=_[_0xfc4c('0x36')](_0x49feec[_0xfc4c('0x32')],qs[_0xfc4c('0x38')](_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x577dd6['attributes']=_0x577dd6[_0xfc4c('0x37')][_0xfc4c('0x39')]?_0x577dd6[_0xfc4c('0x37')]:_0x49feec[_0xfc4c('0x32')];if(!_0x1a2839[_0xfc4c('0x33')]['hasOwnProperty']('nolimit')){_0x577dd6[_0xfc4c('0x1e')]=qs[_0xfc4c('0x1e')](_0x1a2839[_0xfc4c('0x33')]['limit']);_0x577dd6[_0xfc4c('0x1c')]=qs[_0xfc4c('0x1c')](_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x1c')]);}_0x577dd6[_0xfc4c('0x3a')]=qs[_0xfc4c('0x3b')](_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x3b')]);_0x577dd6[_0xfc4c('0x3c')]=qs[_0xfc4c('0x35')](_['pick'](_0x1a2839[_0xfc4c('0x33')],_0x49feec['filters']),_0x339034);if(_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x3d')]){_0x577dd6[_0xfc4c('0x3c')]=_[_0xfc4c('0x3e')](_0x577dd6[_0xfc4c('0x3c')],{'$or':_[_0xfc4c('0x2d')](_0x339034,function(_0x277514){if(_0x277514['type']!=='VIRTUAL'){var _0x597502={};_0x597502[_0x277514[_0xfc4c('0x2b')]]={'$like':'%'+_0x1a2839[_0xfc4c('0x33')][_0xfc4c('0x3d')]+'%'};return _0x597502;}})});}_0x577dd6=_[_0xfc4c('0x3e')]({},_0x577dd6,_0x1a2839[_0xfc4c('0x3f')]);var _0xfb8be6={'where':_0x577dd6[_0xfc4c('0x3c')]};return db[_0xfc4c('0x2e')][_0xfc4c('0x40')](_0xfb8be6)[_0xfc4c('0x25')](function(_0x3d0316){_0x575a47[_0xfc4c('0x40')]=_0x3d0316;if(_0x1a2839['query'][_0xfc4c('0x41')]){_0x577dd6[_0xfc4c('0x42')]=[{'all':!![]}];}return db[_0xfc4c('0x2e')][_0xfc4c('0x43')](_0x577dd6);})[_0xfc4c('0x25')](function(_0x5b3223){_0x575a47[_0xfc4c('0x44')]=_0x5b3223;return _0x575a47;})[_0xfc4c('0x25')](respondWithFilteredResult(_0x3ab737,_0x577dd6))[_0xfc4c('0x45')](handleError(_0x3ab737,null));};exports[_0xfc4c('0x46')]=function(_0xfae758,_0x5dccd1){var _0x504279={'raw':!![],'where':{'id':_0xfae758[_0xfc4c('0x47')]['id']}},_0x2eef16={};_0x2eef16[_0xfc4c('0x32')]=_[_0xfc4c('0x34')](db[_0xfc4c('0x2e')][_0xfc4c('0x48')]);_0x2eef16[_0xfc4c('0x33')]=_[_0xfc4c('0x34')](_0xfae758[_0xfc4c('0x33')]);_0x2eef16[_0xfc4c('0x35')]=_[_0xfc4c('0x36')](_0x2eef16['model'],_0x2eef16[_0xfc4c('0x33')]);_0x504279[_0xfc4c('0x37')]=_[_0xfc4c('0x36')](_0x2eef16['model'],qs['fields'](_0xfae758[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x504279[_0xfc4c('0x37')]=_0x504279[_0xfc4c('0x37')][_0xfc4c('0x39')]?_0x504279[_0xfc4c('0x37')]:_0x2eef16[_0xfc4c('0x32')];if(_0xfae758[_0xfc4c('0x33')][_0xfc4c('0x41')]){_0x504279[_0xfc4c('0x42')]=[{'all':!![]}];}_0x504279=_['merge']({},_0x504279,_0xfae758[_0xfc4c('0x3f')]);return db[_0xfc4c('0x2e')][_0xfc4c('0x49')](_0x504279)['then'](handleEntityNotFound(_0x5dccd1,null))['then'](respondWithResult(_0x5dccd1,null))[_0xfc4c('0x45')](handleError(_0x5dccd1,null));};exports['create']=function(_0x523428,_0x24d356){return db[_0xfc4c('0x2e')]['create'](_0x523428[_0xfc4c('0x4a')],{})[_0xfc4c('0x25')](function(_0x5337e8){var _0x479ab5=_0x523428[_0xfc4c('0x4b')][_0xfc4c('0x4c')]({'plain':!![]});if(!_0x479ab5)throw new Error(_0xfc4c('0x4d'));if(_0x479ab5[_0xfc4c('0x4e')]===_0xfc4c('0x4b')){var _0x261873=_0x5337e8[_0xfc4c('0x4c')]({'plain':!![]});var _0x4d2fa4=_0xfc4c('0x27');return db['UserProfileSection'][_0xfc4c('0x49')]({'where':{'name':_0x4d2fa4,'userProfileId':_0x479ab5[_0xfc4c('0x4f')]},'raw':!![]})['then'](function(_0x2a2d5d){if(_0x2a2d5d&&_0x2a2d5d[_0xfc4c('0x50')]===0x0){return db[_0xfc4c('0x51')][_0xfc4c('0x52')]({'name':_0x261873[_0xfc4c('0x2b')],'resourceId':_0x261873['id'],'type':_0x2a2d5d[_0xfc4c('0x2b')],'sectionId':_0x2a2d5d['id']},{})[_0xfc4c('0x25')](function(){return _0x5337e8;});}else{return _0x5337e8;}})[_0xfc4c('0x45')](function(_0x1a13f3){logger[_0xfc4c('0x29')](_0xfc4c('0x53'),_0x1a13f3);throw _0x1a13f3;});}return _0x5337e8;})[_0xfc4c('0x25')](respondWithResult(_0x24d356,0xc9))[_0xfc4c('0x45')](handleError(_0x24d356,null));};exports[_0xfc4c('0x24')]=function(_0x324a0a,_0x1a7480){if(_0x324a0a[_0xfc4c('0x4a')]['id']){delete _0x324a0a['body']['id'];}return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x324a0a[_0xfc4c('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a7480,null))[_0xfc4c('0x25')](saveUpdates(_0x324a0a[_0xfc4c('0x4a')],null))[_0xfc4c('0x25')](respondWithResult(_0x1a7480,null))[_0xfc4c('0x45')](handleError(_0x1a7480,null));};exports[_0xfc4c('0x26')]=function(_0x15e09e,_0x1c6fd4){return db['WhatsappQueue'][_0xfc4c('0x49')]({'where':{'id':_0x15e09e[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0x1c6fd4,null))['then'](removeEntity(_0x1c6fd4,null))[_0xfc4c('0x45')](handleError(_0x1c6fd4,null));};exports[_0xfc4c('0x54')]=function(_0x5a3717,_0x4c3a87){return db[_0xfc4c('0x2e')]['describe']()[_0xfc4c('0x25')](respondWithResult(_0x4c3a87,null))[_0xfc4c('0x45')](handleError(_0x4c3a87,null));};exports['getMembers']=function(_0x21fe36,_0x39ead9,_0x237048){var _0x44716b={'raw':!![],'where':{}},_0x345619={},_0x3da383;return db[_0xfc4c('0x2e')]['findOne']({'where':{'id':_0x21fe36[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0x39ead9,null))[_0xfc4c('0x25')](function(_0x4f90dc){if(_0x4f90dc){_0x3da383=_0x4f90dc[_0xfc4c('0x4c')]({'plain':!![]});_0x345619['model']=_['keys'](db[_0xfc4c('0x55')][_0xfc4c('0x48')]);_0x345619[_0xfc4c('0x33')]=_[_0xfc4c('0x34')](_0x21fe36[_0xfc4c('0x33')]);_0x345619[_0xfc4c('0x35')]=_[_0xfc4c('0x36')](_0x345619[_0xfc4c('0x32')],_0x345619[_0xfc4c('0x33')]);_0x44716b['attributes']=_['intersection'](_0x345619[_0xfc4c('0x32')],qs[_0xfc4c('0x38')](_0x21fe36[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x44716b[_0xfc4c('0x37')]=_0x44716b['attributes'][_0xfc4c('0x39')]?_0x44716b[_0xfc4c('0x37')]:_0x345619['model'];if(!_0x21fe36['query'][_0xfc4c('0x56')](_0xfc4c('0x57'))){_0x44716b['limit']=qs['limit'](_0x21fe36[_0xfc4c('0x33')][_0xfc4c('0x1e')]);_0x44716b[_0xfc4c('0x1c')]=qs[_0xfc4c('0x1c')](_0x21fe36['query']['offset']);}_0x44716b[_0xfc4c('0x3a')]=qs[_0xfc4c('0x3b')](_0x21fe36[_0xfc4c('0x33')][_0xfc4c('0x3b')]);_0x44716b[_0xfc4c('0x3c')]=qs[_0xfc4c('0x35')](_[_0xfc4c('0x58')](_0x21fe36[_0xfc4c('0x33')],_0x345619[_0xfc4c('0x35')]));_0x44716b['where'][_0xfc4c('0x59')]=_0x4f90dc['id'];if(_0x21fe36[_0xfc4c('0x33')]['filter']){_0x44716b[_0xfc4c('0x3c')]=_[_0xfc4c('0x3e')](_0x44716b[_0xfc4c('0x3c')],{'$or':_[_0xfc4c('0x2d')](_0x44716b[_0xfc4c('0x37')],function(_0x224d21){var _0x520084={};_0x520084[_0x224d21]={'$like':'%'+_0x21fe36[_0xfc4c('0x33')][_0xfc4c('0x3d')]+'%'};return _0x520084;})});}_0x44716b=_[_0xfc4c('0x3e')]({},_0x44716b,_0x21fe36[_0xfc4c('0x3f')]);return db[_0xfc4c('0x55')][_0xfc4c('0x43')](_0x44716b);}})[_0xfc4c('0x25')](function(_0x30c836){if(_0x30c836){return db[_0xfc4c('0x5a')][_0xfc4c('0x5b')]({'where':{'id':_[_0xfc4c('0x2d')](_0x30c836,_0xfc4c('0x5c')),'role':_0xfc4c('0x5d')},'attributes':['id','name',_0xfc4c('0x5e'),_0xfc4c('0x5f'),_0xfc4c('0x60')]});}})[_0xfc4c('0x25')](function(_0x5a906b){if(_0x5a906b){return{'count':_0x5a906b[_0xfc4c('0x40')],'rows':_[_0xfc4c('0x2d')](_0x5a906b[_0xfc4c('0x44')],function(_0x401a22){return{'membername':_0x401a22[_0xfc4c('0x2b')],'UserId':_0x401a22['id'],'queue_name':_0x3da383[_0xfc4c('0x2b')],'WhatsappQueueId':_0x3da383['id'],'interface':util[_0xfc4c('0x61')]('%s/%s',_0xfc4c('0x62'),_0x401a22[_0xfc4c('0x2b')]),'penalty':0x0,'paused':_0x401a22[_0xfc4c('0x5e')],'createdAt':_0x401a22[_0xfc4c('0x60')],'updatedAt':_0x401a22[_0xfc4c('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfc4c('0x25')](respondWithFilteredResult(_0x39ead9,_0x44716b))[_0xfc4c('0x45')](handleError(_0x39ead9,null));};exports[_0xfc4c('0x63')]=function(_0x10241e,_0x471518,_0x3fdbfb){var _0x4b18f3={};var _0x3c00c0={};var _0x3c1550;var _0x2afa5b;return db[_0xfc4c('0x2e')][_0xfc4c('0x64')]({'where':{'id':_0x10241e['params']['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0x471518,null))[_0xfc4c('0x25')](function(_0x503ccb){if(_0x503ccb){_0x3c1550=_0x503ccb;_0x3c00c0[_0xfc4c('0x32')]=_[_0xfc4c('0x34')](db[_0xfc4c('0x65')][_0xfc4c('0x48')]);_0x3c00c0['query']=_[_0xfc4c('0x34')](_0x10241e['query']);_0x3c00c0[_0xfc4c('0x35')]=_['intersection'](_0x3c00c0[_0xfc4c('0x32')],_0x3c00c0[_0xfc4c('0x33')]);_0x4b18f3[_0xfc4c('0x37')]=_[_0xfc4c('0x36')](_0x3c00c0[_0xfc4c('0x32')],qs['fields'](_0x10241e[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x4b18f3[_0xfc4c('0x37')]=_0x4b18f3[_0xfc4c('0x37')][_0xfc4c('0x39')]?_0x4b18f3['attributes']:_0x3c00c0['model'];_0x4b18f3[_0xfc4c('0x3a')]=qs[_0xfc4c('0x3b')](_0x10241e['query'][_0xfc4c('0x3b')]);_0x4b18f3[_0xfc4c('0x3c')]=qs['filters'](_[_0xfc4c('0x58')](_0x10241e[_0xfc4c('0x33')],_0x3c00c0[_0xfc4c('0x35')]));if(_0x10241e[_0xfc4c('0x33')][_0xfc4c('0x3d')]){_0x4b18f3['where']=_['merge'](_0x4b18f3[_0xfc4c('0x3c')],{'$or':_['map'](_0x4b18f3[_0xfc4c('0x37')],function(_0x127afb){var _0x3fd6ad={};_0x3fd6ad[_0x127afb]={'$like':'%'+_0x10241e[_0xfc4c('0x33')][_0xfc4c('0x3d')]+'%'};return _0x3fd6ad;})});}_0x4b18f3=_[_0xfc4c('0x3e')]({},_0x4b18f3,_0x10241e[_0xfc4c('0x3f')]);return _0x3c1550['getTeams'](_0x4b18f3);}})[_0xfc4c('0x25')](function(_0x37ddb9){if(_0x37ddb9){_0x2afa5b=_0x37ddb9[_0xfc4c('0x39')];if(!_0x10241e[_0xfc4c('0x33')][_0xfc4c('0x56')]('nolimit')){_0x4b18f3[_0xfc4c('0x1e')]=qs[_0xfc4c('0x1e')](_0x10241e[_0xfc4c('0x33')]['limit']);_0x4b18f3[_0xfc4c('0x1c')]=qs['offset'](_0x10241e[_0xfc4c('0x33')]['offset']);}return _0x3c1550[_0xfc4c('0x63')](_0x4b18f3);}})[_0xfc4c('0x25')](function(_0x266ea8){if(_0x266ea8){return _0x266ea8?{'count':_0x2afa5b,'rows':_0x266ea8}:null;}})[_0xfc4c('0x25')](respondWithResult(_0x471518,null))[_0xfc4c('0x45')](handleError(_0x471518,null));};exports[_0xfc4c('0x66')]=function(_0x306769,_0x49d638,_0xfaf987){var _0x49cee9=_0x306769['body'][_0xfc4c('0x67')];return db[_0xfc4c('0x65')][_0xfc4c('0x43')]({'where':{'id':_0x49cee9},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfc4c('0x68'),'attributes':['id','name',_0xfc4c('0x69'),_0xfc4c('0x6a'),_0xfc4c('0x6b')],'raw':!![]}]})['then'](function(_0x5b7322){if(_0x5b7322){var _0x469a9c=_['flatMap'](_0x5b7322,function(_0x279931){var _0xec474f=_0x279931[_0xfc4c('0x4c')]({'plain':!![]});return _0xec474f[_0xfc4c('0x68')];});return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x306769['params']['id']}})[_0xfc4c('0x25')](function(_0x57a4c2){return db['sequelize'][_0xfc4c('0x6c')](function(_0xd8516d){return _0x57a4c2[_0xfc4c('0x66')](_0x49cee9,{'transaction':_0xd8516d})[_0xfc4c('0x25')](function(){return BPromise[_0xfc4c('0x6d')](_0x469a9c,function(_0x34c206){return db[_0xfc4c('0x55')][_0xfc4c('0x6e')]({'where':{'UserId':_0x34c206['id'],'WhatsappQueueId':_0x306769[_0xfc4c('0x47')]['id']},'transaction':_0xd8516d});});})['then'](function(){_0x469a9c[_0xfc4c('0x6f')](function(_0x307b6b){socket[_0xfc4c('0x70')](_0xfc4c('0x71'),{'UserId':_0x307b6b['id'],'WhatsappQueueId':_0x57a4c2['id']});});});});});}})['then'](respondWithStatusCode(_0x49d638,null))[_0xfc4c('0x45')](handleError(_0x49d638,null));};exports['removeTeams']=function(_0x1940e7,_0x2c0e16,_0x3477cb){return db[_0xfc4c('0x65')]['findAll']({'where':{'id':_0x1940e7[_0xfc4c('0x33')][_0xfc4c('0x67')]},'attributes':['id'],'include':[{'model':db[_0xfc4c('0x5a')],'as':_0xfc4c('0x68'),'attributes':['id'],'raw':!![]}]})[_0xfc4c('0x25')](handleEntityNotFound(_0x2c0e16,null))[_0xfc4c('0x25')](function(_0x4213d4){var _0x4d4471=_[_0xfc4c('0x2d')](_0x4213d4,'id');var _0x4e2e8e=[];var _0x1c8629=[];var _0x1f8356=squel['select']();_0x1f8356[_0xfc4c('0x72')](_0xfc4c('0x73'))[_0xfc4c('0x74')](_0xfc4c('0x75'),'tq')[_0xfc4c('0x76')](_0xfc4c('0x77'),'ut',_0xfc4c('0x78'))['where'](_0xfc4c('0x79'),_0x1940e7[_0xfc4c('0x47')]['id']);for(var _0x14232e=0x0;_0x14232e<_0x4213d4[_0xfc4c('0x39')];_0x14232e+=0x1){let _0x5b070f=_0x4213d4[_0x14232e];for(var _0x1123be=0x0;_0x1123be<_0x5b070f[_0xfc4c('0x68')]['length'];_0x1123be+=0x1){let _0x1a9af7=_0x5b070f['Agents'][_0x1123be];var _0x5407e5=_0x1f8356[_0xfc4c('0x7a')]();_0x5407e5[_0xfc4c('0x3c')](_0xfc4c('0x7b'),_0x1a9af7['id']);_0x1c8629[_0xfc4c('0x7c')](db[_0xfc4c('0x7d')][_0xfc4c('0x33')](_0x5407e5[_0xfc4c('0x7e')](),{'type':db['sequelize'][_0xfc4c('0x7f')]['SELECT']})[_0xfc4c('0x25')](function(_0x2dcf41){if(_0x2dcf41[_0xfc4c('0x39')]===0x1){return _0x1a9af7['id'];}else{var _0x368e48=_[_0xfc4c('0x80')](_['map'](_0x2dcf41,_0xfc4c('0x81')),function(_0x2c84fd){return _[_0xfc4c('0x82')](_0x4d4471,_0x2c84fd);});if(_0x368e48){return _0x1a9af7['id'];}}}));}}return BPromise[_0xfc4c('0x83')](_0x1c8629)[_0xfc4c('0x25')](function(_0x1d1062){_0x4e2e8e=_(_0x4e2e8e)[_0xfc4c('0x84')](_0x1d1062)[_0xfc4c('0x85')]()[_0xfc4c('0x86')]();return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x1940e7[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](function(_0x26e784){return db[_0xfc4c('0x7d')][_0xfc4c('0x6c')](function(_0x59b2ca){return _0x26e784[_0xfc4c('0x87')](_0x1940e7[_0xfc4c('0x33')]['ids'],{'transaction':_0x59b2ca})[_0xfc4c('0x25')](function(){if(!_[_0xfc4c('0x88')](_0x4e2e8e)){return _0x26e784[_0xfc4c('0x89')](_0x4e2e8e,{'transaction':_0x59b2ca});}})[_0xfc4c('0x25')](function(){_0x4e2e8e[_0xfc4c('0x6f')](function(_0x26909b){socket[_0xfc4c('0x70')](_0xfc4c('0x8a'),{'UserId':_0x26909b,'WhatsappQueueId':_0x26e784['id']});});});});});});})[_0xfc4c('0x25')](respondWithStatusCode(_0x2c0e16,null))[_0xfc4c('0x45')](handleError(_0x2c0e16,null));};exports[_0xfc4c('0x8b')]=function(_0x2ffcb5,_0xac1391,_0x351f7b){return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x2ffcb5[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0xac1391,null))['then'](function(_0x16ef18){if(_0x16ef18){return _0x16ef18[_0xfc4c('0x8b')](_0x2ffcb5['body'][_0xfc4c('0x67')],_[_0xfc4c('0x8c')](_0x2ffcb5[_0xfc4c('0x4a')],['ids','id'])||{})[_0xfc4c('0x8d')](function(_0x5002d8){for(var _0x58dda7=0x0;_0x58dda7<_0x2ffcb5[_0xfc4c('0x4a')][_0xfc4c('0x67')][_0xfc4c('0x39')];_0x58dda7+=0x1){socket[_0xfc4c('0x70')](_0xfc4c('0x71'),{'UserId':Number(_0x2ffcb5[_0xfc4c('0x4a')][_0xfc4c('0x67')][_0x58dda7]),'WhatsappQueueId':Number(_0x2ffcb5[_0xfc4c('0x47')]['id'])});}return _0x5002d8;});}})[_0xfc4c('0x25')](respondWithResult(_0xac1391,null))[_0xfc4c('0x45')](handleError(_0xac1391,null));};exports[_0xfc4c('0x89')]=function(_0x41875f,_0xcf1c81,_0x9e11e){return db[_0xfc4c('0x2e')][_0xfc4c('0x49')]({'where':{'id':_0x41875f[_0xfc4c('0x47')]['id']}})[_0xfc4c('0x25')](handleEntityNotFound(_0xcf1c81,null))[_0xfc4c('0x25')](function(_0x3cf8ba){if(_0x3cf8ba){return _0x3cf8ba['removeAgents'](_0x41875f[_0xfc4c('0x33')][_0xfc4c('0x67')])[_0xfc4c('0x25')](function(){if(_[_0xfc4c('0x8e')](_0x41875f[_0xfc4c('0x33')]['ids'])){for(var _0x237fd6=0x0;_0x237fd6<_0x41875f['query'][_0xfc4c('0x67')][_0xfc4c('0x39')];_0x237fd6+=0x1){socket['emit'](_0xfc4c('0x8a'),{'UserId':Number(_0x41875f[_0xfc4c('0x33')][_0xfc4c('0x67')][_0x237fd6]),'WhatsappQueueId':Number(_0x41875f[_0xfc4c('0x47')]['id'])});}}else{socket['emit'](_0xfc4c('0x8a'),{'UserId':Number(_0x41875f['query'][_0xfc4c('0x67')]),'WhatsappQueueId':Number(_0x41875f[_0xfc4c('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0xcf1c81,null))['catch'](handleError(_0xcf1c81,null));};exports[_0xfc4c('0x8f')]=function(_0x2168ee,_0x520a23,_0x46c455){var _0x45e385={};var _0x32b0c3={};var _0x6f5934;var _0x133dce;return db[_0xfc4c('0x2e')][_0xfc4c('0x64')]({'where':{'id':_0x2168ee['params']['id']}})['then'](handleEntityNotFound(_0x520a23,null))['then'](function(_0x5a8511){if(_0x5a8511){_0x6f5934=_0x5a8511;_0x32b0c3['model']=_[_0xfc4c('0x34')](db[_0xfc4c('0x5a')][_0xfc4c('0x48')]);_0x32b0c3[_0xfc4c('0x33')]=_['keys'](_0x2168ee['query']);_0x32b0c3[_0xfc4c('0x35')]=_[_0xfc4c('0x36')](_0x32b0c3[_0xfc4c('0x32')],_0x32b0c3['query']);_0x45e385['attributes']=_[_0xfc4c('0x36')](_0x32b0c3[_0xfc4c('0x32')],qs[_0xfc4c('0x38')](_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x38')]));_0x45e385[_0xfc4c('0x37')]=_0x45e385['attributes'][_0xfc4c('0x39')]?_0x45e385['attributes']:_0x32b0c3[_0xfc4c('0x32')];_0x45e385[_0xfc4c('0x3a')]=qs['sort'](_0x2168ee[_0xfc4c('0x33')]['sort']);_0x45e385['where']=qs[_0xfc4c('0x35')](_[_0xfc4c('0x58')](_0x2168ee['query'],_0x32b0c3[_0xfc4c('0x35')]));if(_0x2168ee['query'][_0xfc4c('0x3d')]){_0x45e385[_0xfc4c('0x3c')]=_[_0xfc4c('0x3e')](_0x45e385[_0xfc4c('0x3c')],{'$or':_[_0xfc4c('0x2d')](_0x45e385[_0xfc4c('0x37')],function(_0x5f0a25){var _0x37a656={};_0x37a656[_0x5f0a25]={'$like':'%'+_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x3d')]+'%'};return _0x37a656;})});}_0x45e385=_['merge']({},_0x45e385,_0x2168ee[_0xfc4c('0x3f')]);return _0x6f5934[_0xfc4c('0x8f')](_0x45e385);}})[_0xfc4c('0x25')](function(_0x12ff6d){if(_0x12ff6d){_0x133dce=_0x12ff6d[_0xfc4c('0x39')];if(!_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x56')](_0xfc4c('0x57'))){_0x45e385['limit']=qs[_0xfc4c('0x1e')](_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x1e')]);_0x45e385[_0xfc4c('0x1c')]=qs[_0xfc4c('0x1c')](_0x2168ee[_0xfc4c('0x33')][_0xfc4c('0x1c')]);}return _0x6f5934[_0xfc4c('0x8f')](_0x45e385);}})[_0xfc4c('0x25')](function(_0x3ddd39){if(_0x3ddd39){return _0x3ddd39?{'count':_0x133dce,'rows':_0x3ddd39}:null;}})[_0xfc4c('0x25')](respondWithResult(_0x520a23,null))['catch'](handleError(_0x520a23,null));}; \ No newline at end of file +var _0x380a=['Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','order','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','getTeams','Team','ids','Agents','voicePause','interface','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','userWhatsappQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappQueue.socket','register','status','json','undefined','limit','count','offset','apply','reject','save','then','get','WhatsappQueues','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','WhatsappQueue','includeAll','findAll','rows','catch','show','params','keys','include','find','create','user'];(function(_0x2b34c1,_0x837daf){var _0x2fdc6f=function(_0x4fce2b){while(--_0x4fce2b){_0x2b34c1['push'](_0x2b34c1['shift']());}};_0x2fdc6f(++_0x837daf);}(_0x380a,0xc6));var _0xa380=function(_0x1d997f,_0x259b5a){_0x1d997f=_0x1d997f-0x0;var _0x307704=_0x380a[_0x1d997f];return _0x307704;};'use strict';var emlformat=require(_0xa380('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa380('0x1'));var jsonpatch=require(_0xa380('0x2'));var rp=require(_0xa380('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa380('0x4'));var util=require(_0xa380('0x5'));var path=require(_0xa380('0x6'));var sox=require(_0xa380('0x7'));var csv=require(_0xa380('0x8'));var ejs=require(_0xa380('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa380('0xa'));var squel=require(_0xa380('0xb'));var crypto=require(_0xa380('0xc'));var jsforce=require(_0xa380('0xd'));var deskjs=require(_0xa380('0xe'));var toCsv=require(_0xa380('0x8'));var querystring=require(_0xa380('0xf'));var Papa=require('papaparse');var Redis=require(_0xa380('0x10'));var authService=require(_0xa380('0x11'));var qs=require(_0xa380('0x12'));var as=require(_0xa380('0x13'));var hardwareService=require(_0xa380('0x14'));var logger=require('../../config/logger')(_0xa380('0x15'));var utils=require(_0xa380('0x16'));var config=require(_0xa380('0x17'));var licenseUtil=require(_0xa380('0x18'));var db=require(_0xa380('0x19'))['db'];config['redis']=_[_0xa380('0x1a')](config[_0xa380('0x1b')],{'host':_0xa380('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa380('0x1b')]));require(_0xa380('0x1d'))[_0xa380('0x1e')](socket);function respondWithStatusCode(_0x32a547,_0x286dc4){_0x286dc4=_0x286dc4||0xcc;return function(_0x355240){if(_0x355240){return _0x32a547['sendStatus'](_0x286dc4);}return _0x32a547[_0xa380('0x1f')](_0x286dc4)['end']();};}function respondWithResult(_0x4968d4,_0x2fd93c){_0x2fd93c=_0x2fd93c||0xc8;return function(_0x545cbd){if(_0x545cbd){return _0x4968d4[_0xa380('0x1f')](_0x2fd93c)[_0xa380('0x20')](_0x545cbd);}};}function respondWithFilteredResult(_0x26dfbb,_0x54eba6){return function(_0x18af40){if(_0x18af40){var _0x4ad629=typeof _0x54eba6['offset']===_0xa380('0x21')&&typeof _0x54eba6[_0xa380('0x22')]==='undefined';var _0x57494a=_0x18af40[_0xa380('0x23')];var _0xcde0e2=_0x4ad629?0x0:_0x54eba6['offset'];var _0x128238=_0x4ad629?_0x18af40[_0xa380('0x23')]:_0x54eba6[_0xa380('0x24')]+_0x54eba6[_0xa380('0x22')];var _0x177a77;if(_0x128238>=_0x57494a){_0x128238=_0x57494a;_0x177a77=0xc8;}else{_0x177a77=0xce;}_0x26dfbb[_0xa380('0x1f')](_0x177a77);return _0x26dfbb['set']('Content-Range',_0xcde0e2+'-'+_0x128238+'/'+_0x57494a)[_0xa380('0x20')](_0x18af40);}return null;};}function patchUpdates(_0xf6dc2d){return function(_0xc99ff8){try{jsonpatch[_0xa380('0x25')](_0xc99ff8,_0xf6dc2d,!![]);}catch(_0x1eeb09){return BPromise[_0xa380('0x26')](_0x1eeb09);}return _0xc99ff8[_0xa380('0x27')]();};}function saveUpdates(_0x14f718,_0x2efbf6){return function(_0x1451d0){if(_0x1451d0){return _0x1451d0['update'](_0x14f718)[_0xa380('0x28')](function(_0x1a4e6d){return _0x1a4e6d;});}return null;};}function removeEntity(_0x45a97f,_0xc02dba){return function(_0x21172b){if(_0x21172b){return _0x21172b['destroy']()[_0xa380('0x28')](function(){var _0x395670=_0x21172b[_0xa380('0x29')]({'plain':!![]});var _0x2a0eae=_0xa380('0x2a');return db['UserProfileResource'][_0xa380('0x2b')]({'where':{'type':_0x2a0eae,'resourceId':_0x395670['id']}})[_0xa380('0x28')](function(){return _0x21172b;});})['then'](function(){_0x45a97f[_0xa380('0x1f')](0xcc)[_0xa380('0x2c')]();});}};}function handleEntityNotFound(_0x273825,_0x1aa273){return function(_0x425032){if(!_0x425032){_0x273825['sendStatus'](0x194);}return _0x425032;};}function handleError(_0x26042e,_0x494664){_0x494664=_0x494664||0x1f4;return function(_0xda7784){logger[_0xa380('0x2d')](_0xda7784[_0xa380('0x2e')]);if(_0xda7784[_0xa380('0x2f')]){delete _0xda7784[_0xa380('0x2f')];}_0x26042e[_0xa380('0x1f')](_0x494664)[_0xa380('0x30')](_0xda7784);};}exports[_0xa380('0x31')]=function(_0x5d400d,_0x905779){var _0x36fba3={},_0x31c9c9={},_0x1855c9={'count':0x0,'rows':[]};var _0xa37560=_[_0xa380('0x32')](db['WhatsappQueue'][_0xa380('0x33')],function(_0x4c7994){return{'name':_0x4c7994[_0xa380('0x34')],'type':_0x4c7994['type'][_0xa380('0x35')]};});_0x31c9c9[_0xa380('0x36')]=_[_0xa380('0x32')](_0xa37560,_0xa380('0x2f'));_0x31c9c9['query']=_['keys'](_0x5d400d[_0xa380('0x37')]);_0x31c9c9['filters']=_[_0xa380('0x38')](_0x31c9c9['model'],_0x31c9c9[_0xa380('0x37')]);_0x36fba3['attributes']=_[_0xa380('0x38')](_0x31c9c9[_0xa380('0x36')],qs[_0xa380('0x39')](_0x5d400d[_0xa380('0x37')][_0xa380('0x39')]));_0x36fba3[_0xa380('0x3a')]=_0x36fba3['attributes'][_0xa380('0x3b')]?_0x36fba3[_0xa380('0x3a')]:_0x31c9c9[_0xa380('0x36')];if(!_0x5d400d[_0xa380('0x37')][_0xa380('0x3c')](_0xa380('0x3d'))){_0x36fba3[_0xa380('0x22')]=qs[_0xa380('0x22')](_0x5d400d[_0xa380('0x37')][_0xa380('0x22')]);_0x36fba3[_0xa380('0x24')]=qs[_0xa380('0x24')](_0x5d400d[_0xa380('0x37')]['offset']);}_0x36fba3['order']=qs['sort'](_0x5d400d[_0xa380('0x37')][_0xa380('0x3e')]);_0x36fba3[_0xa380('0x3f')]=qs['filters'](_[_0xa380('0x40')](_0x5d400d[_0xa380('0x37')],_0x31c9c9[_0xa380('0x41')]),_0xa37560);if(_0x5d400d[_0xa380('0x37')]['filter']){_0x36fba3[_0xa380('0x3f')]=_[_0xa380('0x42')](_0x36fba3['where'],{'$or':_[_0xa380('0x32')](_0xa37560,function(_0x4a3a2c){if(_0x4a3a2c['type']!==_0xa380('0x43')){var _0x2ea475={};_0x2ea475[_0x4a3a2c['name']]={'$like':'%'+_0x5d400d[_0xa380('0x37')][_0xa380('0x44')]+'%'};return _0x2ea475;}})});}_0x36fba3=_[_0xa380('0x42')]({},_0x36fba3,_0x5d400d[_0xa380('0x45')]);var _0x17190f={'where':_0x36fba3[_0xa380('0x3f')]};return db[_0xa380('0x46')][_0xa380('0x23')](_0x17190f)[_0xa380('0x28')](function(_0x1b7063){_0x1855c9[_0xa380('0x23')]=_0x1b7063;if(_0x5d400d[_0xa380('0x37')][_0xa380('0x47')]){_0x36fba3['include']=[{'all':!![]}];}return db[_0xa380('0x46')][_0xa380('0x48')](_0x36fba3);})['then'](function(_0xe4fdfa){_0x1855c9[_0xa380('0x49')]=_0xe4fdfa;return _0x1855c9;})[_0xa380('0x28')](respondWithFilteredResult(_0x905779,_0x36fba3))[_0xa380('0x4a')](handleError(_0x905779,null));};exports[_0xa380('0x4b')]=function(_0x3caaef,_0x4e699c){var _0x545d0f={'raw':!![],'where':{'id':_0x3caaef[_0xa380('0x4c')]['id']}},_0x2e71dd={};_0x2e71dd[_0xa380('0x36')]=_['keys'](db[_0xa380('0x46')][_0xa380('0x33')]);_0x2e71dd[_0xa380('0x37')]=_[_0xa380('0x4d')](_0x3caaef[_0xa380('0x37')]);_0x2e71dd[_0xa380('0x41')]=_[_0xa380('0x38')](_0x2e71dd['model'],_0x2e71dd[_0xa380('0x37')]);_0x545d0f[_0xa380('0x3a')]=_[_0xa380('0x38')](_0x2e71dd['model'],qs['fields'](_0x3caaef['query']['fields']));_0x545d0f[_0xa380('0x3a')]=_0x545d0f[_0xa380('0x3a')]['length']?_0x545d0f[_0xa380('0x3a')]:_0x2e71dd['model'];if(_0x3caaef[_0xa380('0x37')][_0xa380('0x47')]){_0x545d0f[_0xa380('0x4e')]=[{'all':!![]}];}_0x545d0f=_[_0xa380('0x42')]({},_0x545d0f,_0x3caaef[_0xa380('0x45')]);return db[_0xa380('0x46')][_0xa380('0x4f')](_0x545d0f)['then'](handleEntityNotFound(_0x4e699c,null))[_0xa380('0x28')](respondWithResult(_0x4e699c,null))[_0xa380('0x4a')](handleError(_0x4e699c,null));};exports[_0xa380('0x50')]=function(_0x59c4fb,_0x44a0e6){return db['WhatsappQueue']['create'](_0x59c4fb['body'],{})['then'](function(_0x4477e4){var _0x36b6da=_0x59c4fb[_0xa380('0x51')][_0xa380('0x29')]({'plain':!![]});if(!_0x36b6da)throw new Error(_0xa380('0x52'));if(_0x36b6da['role']==='user'){var _0x49d4d0=_0x4477e4[_0xa380('0x29')]({'plain':!![]});var _0x5f559e='WhatsappQueues';return db[_0xa380('0x53')][_0xa380('0x4f')]({'where':{'name':_0x5f559e,'userProfileId':_0x36b6da[_0xa380('0x54')]},'raw':!![]})[_0xa380('0x28')](function(_0xf52dc8){if(_0xf52dc8&&_0xf52dc8[_0xa380('0x55')]===0x0){return db[_0xa380('0x56')][_0xa380('0x50')]({'name':_0x49d4d0['name'],'resourceId':_0x49d4d0['id'],'type':_0xf52dc8['name'],'sectionId':_0xf52dc8['id']},{})[_0xa380('0x28')](function(){return _0x4477e4;});}else{return _0x4477e4;}})[_0xa380('0x4a')](function(_0x58e6fb){logger[_0xa380('0x2d')](_0xa380('0x57'),_0x58e6fb);throw _0x58e6fb;});}return _0x4477e4;})[_0xa380('0x28')](respondWithResult(_0x44a0e6,0xc9))[_0xa380('0x4a')](handleError(_0x44a0e6,null));};exports['update']=function(_0x5263e7,_0x5c964d){if(_0x5263e7[_0xa380('0x58')]['id']){delete _0x5263e7[_0xa380('0x58')]['id'];}return db[_0xa380('0x46')][_0xa380('0x4f')]({'where':{'id':_0x5263e7['params']['id']}})[_0xa380('0x28')](handleEntityNotFound(_0x5c964d,null))[_0xa380('0x28')](saveUpdates(_0x5263e7[_0xa380('0x58')],null))[_0xa380('0x28')](respondWithResult(_0x5c964d,null))[_0xa380('0x4a')](handleError(_0x5c964d,null));};exports['destroy']=function(_0x42823d,_0x2ac6c1){return db['WhatsappQueue'][_0xa380('0x4f')]({'where':{'id':_0x42823d[_0xa380('0x4c')]['id']}})[_0xa380('0x28')](handleEntityNotFound(_0x2ac6c1,null))['then'](removeEntity(_0x2ac6c1,null))[_0xa380('0x4a')](handleError(_0x2ac6c1,null));};exports[_0xa380('0x59')]=function(_0x8e6790,_0x264a9a){return db['WhatsappQueue']['describe']()[_0xa380('0x28')](respondWithResult(_0x264a9a,null))[_0xa380('0x4a')](handleError(_0x264a9a,null));};exports[_0xa380('0x5a')]=function(_0x298867,_0x5a8303,_0x143cb8){var _0x15558f={'raw':!![],'where':{}},_0x5a9dbf={},_0x46803f;return db[_0xa380('0x46')][_0xa380('0x5b')]({'where':{'id':_0x298867['params']['id']}})[_0xa380('0x28')](handleEntityNotFound(_0x5a8303,null))[_0xa380('0x28')](function(_0x42600d){if(_0x42600d){_0x46803f=_0x42600d[_0xa380('0x29')]({'plain':!![]});_0x5a9dbf[_0xa380('0x36')]=_['keys'](db['UserWhatsappQueue'][_0xa380('0x33')]);_0x5a9dbf[_0xa380('0x37')]=_[_0xa380('0x4d')](_0x298867[_0xa380('0x37')]);_0x5a9dbf['filters']=_['intersection'](_0x5a9dbf['model'],_0x5a9dbf[_0xa380('0x37')]);_0x15558f['attributes']=_[_0xa380('0x38')](_0x5a9dbf['model'],qs[_0xa380('0x39')](_0x298867['query'][_0xa380('0x39')]));_0x15558f[_0xa380('0x3a')]=_0x15558f[_0xa380('0x3a')][_0xa380('0x3b')]?_0x15558f['attributes']:_0x5a9dbf[_0xa380('0x36')];if(!_0x298867[_0xa380('0x37')][_0xa380('0x3c')](_0xa380('0x3d'))){_0x15558f[_0xa380('0x22')]=qs[_0xa380('0x22')](_0x298867[_0xa380('0x37')][_0xa380('0x22')]);_0x15558f['offset']=qs[_0xa380('0x24')](_0x298867[_0xa380('0x37')][_0xa380('0x24')]);}_0x15558f[_0xa380('0x5c')]=qs['sort'](_0x298867['query'][_0xa380('0x3e')]);_0x15558f[_0xa380('0x3f')]=qs[_0xa380('0x41')](_['pick'](_0x298867['query'],_0x5a9dbf['filters']));_0x15558f['where'][_0xa380('0x5d')]=_0x42600d['id'];if(_0x298867['query'][_0xa380('0x44')]){_0x15558f[_0xa380('0x3f')]=_['merge'](_0x15558f['where'],{'$or':_[_0xa380('0x32')](_0x15558f[_0xa380('0x3a')],function(_0x1ed3dd){var _0x2580b8={};_0x2580b8[_0x1ed3dd]={'$like':'%'+_0x298867['query'][_0xa380('0x44')]+'%'};return _0x2580b8;})});}_0x15558f=_['merge']({},_0x15558f,_0x298867[_0xa380('0x45')]);return db[_0xa380('0x5e')][_0xa380('0x48')](_0x15558f);}})[_0xa380('0x28')](function(_0x5e43bd){if(_0x5e43bd){return db[_0xa380('0x5f')][_0xa380('0x60')]({'where':{'id':_[_0xa380('0x32')](_0x5e43bd,_0xa380('0x61')),'role':_0xa380('0x62')},'attributes':['id',_0xa380('0x2f'),_0xa380('0x63'),_0xa380('0x64'),_0xa380('0x65')]});}})['then'](function(_0x39a59a){if(_0x39a59a){return{'count':_0x39a59a[_0xa380('0x23')],'rows':_['map'](_0x39a59a[_0xa380('0x49')],function(_0x4b7b01){return{'membername':_0x4b7b01[_0xa380('0x2f')],'UserId':_0x4b7b01['id'],'queue_name':_0x46803f[_0xa380('0x2f')],'WhatsappQueueId':_0x46803f['id'],'interface':util['format']('%s/%s','SIP',_0x4b7b01[_0xa380('0x2f')]),'penalty':0x0,'paused':_0x4b7b01[_0xa380('0x63')],'createdAt':_0x4b7b01[_0xa380('0x65')],'updatedAt':_0x4b7b01['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa380('0x28')](respondWithFilteredResult(_0x5a8303,_0x15558f))[_0xa380('0x4a')](handleError(_0x5a8303,null));};exports[_0xa380('0x66')]=function(_0x29a939,_0xef5879,_0xf8b83a){var _0x40c3c4={};var _0x31da0c={};var _0x556cd7;var _0x2d2697;return db['WhatsappQueue']['findOne']({'where':{'id':_0x29a939[_0xa380('0x4c')]['id']}})[_0xa380('0x28')](handleEntityNotFound(_0xef5879,null))[_0xa380('0x28')](function(_0x385ff6){if(_0x385ff6){_0x556cd7=_0x385ff6;_0x31da0c[_0xa380('0x36')]=_[_0xa380('0x4d')](db[_0xa380('0x67')][_0xa380('0x33')]);_0x31da0c[_0xa380('0x37')]=_[_0xa380('0x4d')](_0x29a939['query']);_0x31da0c[_0xa380('0x41')]=_[_0xa380('0x38')](_0x31da0c[_0xa380('0x36')],_0x31da0c['query']);_0x40c3c4[_0xa380('0x3a')]=_['intersection'](_0x31da0c[_0xa380('0x36')],qs[_0xa380('0x39')](_0x29a939[_0xa380('0x37')][_0xa380('0x39')]));_0x40c3c4[_0xa380('0x3a')]=_0x40c3c4[_0xa380('0x3a')][_0xa380('0x3b')]?_0x40c3c4[_0xa380('0x3a')]:_0x31da0c[_0xa380('0x36')];_0x40c3c4[_0xa380('0x5c')]=qs[_0xa380('0x3e')](_0x29a939[_0xa380('0x37')][_0xa380('0x3e')]);_0x40c3c4[_0xa380('0x3f')]=qs['filters'](_['pick'](_0x29a939[_0xa380('0x37')],_0x31da0c[_0xa380('0x41')]));if(_0x29a939['query'][_0xa380('0x44')]){_0x40c3c4[_0xa380('0x3f')]=_[_0xa380('0x42')](_0x40c3c4[_0xa380('0x3f')],{'$or':_[_0xa380('0x32')](_0x40c3c4[_0xa380('0x3a')],function(_0x535ead){var _0x1b730c={};_0x1b730c[_0x535ead]={'$like':'%'+_0x29a939[_0xa380('0x37')]['filter']+'%'};return _0x1b730c;})});}_0x40c3c4=_[_0xa380('0x42')]({},_0x40c3c4,_0x29a939['options']);return _0x556cd7[_0xa380('0x66')](_0x40c3c4);}})['then'](function(_0x143d49){if(_0x143d49){_0x2d2697=_0x143d49[_0xa380('0x3b')];if(!_0x29a939[_0xa380('0x37')][_0xa380('0x3c')](_0xa380('0x3d'))){_0x40c3c4[_0xa380('0x22')]=qs[_0xa380('0x22')](_0x29a939['query'][_0xa380('0x22')]);_0x40c3c4[_0xa380('0x24')]=qs['offset'](_0x29a939[_0xa380('0x37')][_0xa380('0x24')]);}return _0x556cd7[_0xa380('0x66')](_0x40c3c4);}})[_0xa380('0x28')](function(_0x141da2){if(_0x141da2){return _0x141da2?{'count':_0x2d2697,'rows':_0x141da2}:null;}})['then'](respondWithResult(_0xef5879,null))[_0xa380('0x4a')](handleError(_0xef5879,null));};exports['addTeams']=function(_0x551be3,_0x2f4680,_0x20a6a7){var _0x21cb1f=_0x551be3[_0xa380('0x58')][_0xa380('0x68')];return db['Team']['findAll']({'where':{'id':_0x21cb1f},'attributes':['id'],'include':[{'model':db[_0xa380('0x5f')],'as':_0xa380('0x69'),'attributes':['id','name','online',_0xa380('0x6a'),_0xa380('0x6b')],'raw':!![]}]})['then'](function(_0x435003){if(_0x435003){var _0x50bc13=_['flatMap'](_0x435003,function(_0x59377b){var _0x4fa097=_0x59377b[_0xa380('0x29')]({'plain':!![]});return _0x4fa097[_0xa380('0x69')];});return db[_0xa380('0x46')][_0xa380('0x4f')]({'where':{'id':_0x551be3['params']['id']}})[_0xa380('0x28')](function(_0x5e9f87){return db['sequelize'][_0xa380('0x6c')](function(_0x425657){return _0x5e9f87[_0xa380('0x6d')](_0x21cb1f,{'transaction':_0x425657})[_0xa380('0x28')](function(){return BPromise[_0xa380('0x6e')](_0x50bc13,function(_0xfa9f71){return db[_0xa380('0x5e')][_0xa380('0x6f')]({'where':{'UserId':_0xfa9f71['id'],'WhatsappQueueId':_0x551be3[_0xa380('0x4c')]['id']},'transaction':_0x425657});});})[_0xa380('0x28')](function(){_0x50bc13[_0xa380('0x70')](function(_0x47027d){socket[_0xa380('0x71')]('userWhatsappQueue:save',{'UserId':_0x47027d['id'],'WhatsappQueueId':_0x5e9f87['id']});});});});});}})[_0xa380('0x28')](respondWithStatusCode(_0x2f4680,null))[_0xa380('0x4a')](handleError(_0x2f4680,null));};exports[_0xa380('0x72')]=function(_0x35e6ca,_0x55e4af,_0x93e73c){return db[_0xa380('0x67')][_0xa380('0x48')]({'where':{'id':_0x35e6ca['query'][_0xa380('0x68')]},'attributes':['id'],'include':[{'model':db[_0xa380('0x5f')],'as':_0xa380('0x69'),'attributes':['id'],'raw':!![]}]})[_0xa380('0x28')](handleEntityNotFound(_0x55e4af,null))[_0xa380('0x28')](function(_0x126f01){var _0x4d0bbc=_[_0xa380('0x32')](_0x126f01,'id');var _0x3aa3c7=[];var _0xdb58dc=[];var _0x2b50e1=squel['select']();_0x2b50e1[_0xa380('0x73')](_0xa380('0x74'))['from'](_0xa380('0x75'),'tq')[_0xa380('0x76')](_0xa380('0x77'),'ut',_0xa380('0x78'))[_0xa380('0x3f')](_0xa380('0x79'),_0x35e6ca[_0xa380('0x4c')]['id']);for(var _0x3dc7e6=0x0;_0x3dc7e6<_0x126f01[_0xa380('0x3b')];_0x3dc7e6+=0x1){let _0x285556=_0x126f01[_0x3dc7e6];for(var _0x5669be=0x0;_0x5669be<_0x285556['Agents'][_0xa380('0x3b')];_0x5669be+=0x1){let _0x311c1f=_0x285556['Agents'][_0x5669be];var _0x4e85c9=_0x2b50e1['clone']();_0x4e85c9[_0xa380('0x3f')](_0xa380('0x7a'),_0x311c1f['id']);_0xdb58dc[_0xa380('0x7b')](db[_0xa380('0x7c')]['query'](_0x4e85c9[_0xa380('0x7d')](),{'type':db[_0xa380('0x7c')][_0xa380('0x7e')][_0xa380('0x7f')]})[_0xa380('0x28')](function(_0x1a5fb4){if(_0x1a5fb4[_0xa380('0x3b')]===0x1){return _0x311c1f['id'];}else{var _0x3cfbab=_['every'](_[_0xa380('0x32')](_0x1a5fb4,_0xa380('0x80')),function(_0x1ed4b5){return _[_0xa380('0x81')](_0x4d0bbc,_0x1ed4b5);});if(_0x3cfbab){return _0x311c1f['id'];}}}));}}return BPromise['all'](_0xdb58dc)[_0xa380('0x28')](function(_0x56784e){_0x3aa3c7=_(_0x3aa3c7)[_0xa380('0x82')](_0x56784e)[_0xa380('0x83')]()[_0xa380('0x84')]();return db['WhatsappQueue'][_0xa380('0x4f')]({'where':{'id':_0x35e6ca[_0xa380('0x4c')]['id']}})[_0xa380('0x28')](function(_0x399222){return db['sequelize'][_0xa380('0x6c')](function(_0x48da79){return _0x399222[_0xa380('0x72')](_0x35e6ca['query'][_0xa380('0x68')],{'transaction':_0x48da79})[_0xa380('0x28')](function(){if(!_[_0xa380('0x85')](_0x3aa3c7)){return _0x399222[_0xa380('0x86')](_0x3aa3c7,{'transaction':_0x48da79});}})[_0xa380('0x28')](function(){_0x3aa3c7['forEach'](function(_0x44e4df){socket[_0xa380('0x71')](_0xa380('0x87'),{'UserId':_0x44e4df,'WhatsappQueueId':_0x399222['id']});});});});});});})[_0xa380('0x28')](respondWithStatusCode(_0x55e4af,null))[_0xa380('0x4a')](handleError(_0x55e4af,null));};exports[_0xa380('0x88')]=function(_0x3dafae,_0x5d319a,_0x3f82e8){return db[_0xa380('0x46')][_0xa380('0x4f')]({'where':{'id':_0x3dafae['params']['id']}})['then'](handleEntityNotFound(_0x5d319a,null))['then'](function(_0x1d5816){if(_0x1d5816){return _0x1d5816[_0xa380('0x88')](_0x3dafae[_0xa380('0x58')][_0xa380('0x68')],_[_0xa380('0x89')](_0x3dafae[_0xa380('0x58')],[_0xa380('0x68'),'id'])||{})['spread'](function(_0x7ac9a1){for(var _0x4712f9=0x0;_0x4712f9<_0x3dafae[_0xa380('0x58')][_0xa380('0x68')][_0xa380('0x3b')];_0x4712f9+=0x1){socket['emit'](_0xa380('0x8a'),{'UserId':Number(_0x3dafae[_0xa380('0x58')][_0xa380('0x68')][_0x4712f9]),'WhatsappQueueId':Number(_0x3dafae['params']['id'])});}return _0x7ac9a1;});}})['then'](respondWithResult(_0x5d319a,null))['catch'](handleError(_0x5d319a,null));};exports['removeAgents']=function(_0x1be158,_0x564344,_0x3f4538){return db[_0xa380('0x46')][_0xa380('0x4f')]({'where':{'id':_0x1be158['params']['id']}})['then'](handleEntityNotFound(_0x564344,null))[_0xa380('0x28')](function(_0x5882c0){if(_0x5882c0){return _0x5882c0[_0xa380('0x86')](_0x1be158[_0xa380('0x37')][_0xa380('0x68')])[_0xa380('0x28')](function(){if(_['isArray'](_0x1be158['query'][_0xa380('0x68')])){for(var _0x348e8d=0x0;_0x348e8d<_0x1be158[_0xa380('0x37')]['ids']['length'];_0x348e8d+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x1be158['query']['ids'][_0x348e8d]),'WhatsappQueueId':Number(_0x1be158[_0xa380('0x4c')]['id'])});}}else{socket['emit'](_0xa380('0x87'),{'UserId':Number(_0x1be158[_0xa380('0x37')][_0xa380('0x68')]),'WhatsappQueueId':Number(_0x1be158['params']['id'])});}});}})[_0xa380('0x28')](respondWithStatusCode(_0x564344,null))[_0xa380('0x4a')](handleError(_0x564344,null));};exports[_0xa380('0x8b')]=function(_0x44e54a,_0xc58b32,_0x37053e){var _0x3a7f14={};var _0x5010ce={};var _0x5ed067;var _0x286e25;return db[_0xa380('0x46')]['findOne']({'where':{'id':_0x44e54a[_0xa380('0x4c')]['id']}})['then'](handleEntityNotFound(_0xc58b32,null))[_0xa380('0x28')](function(_0x432506){if(_0x432506){_0x5ed067=_0x432506;_0x5010ce[_0xa380('0x36')]=_[_0xa380('0x4d')](db[_0xa380('0x5f')][_0xa380('0x33')]);_0x5010ce['query']=_['keys'](_0x44e54a[_0xa380('0x37')]);_0x5010ce[_0xa380('0x41')]=_[_0xa380('0x38')](_0x5010ce['model'],_0x5010ce[_0xa380('0x37')]);_0x3a7f14['attributes']=_[_0xa380('0x38')](_0x5010ce['model'],qs[_0xa380('0x39')](_0x44e54a[_0xa380('0x37')][_0xa380('0x39')]));_0x3a7f14[_0xa380('0x3a')]=_0x3a7f14[_0xa380('0x3a')][_0xa380('0x3b')]?_0x3a7f14['attributes']:_0x5010ce[_0xa380('0x36')];_0x3a7f14[_0xa380('0x5c')]=qs[_0xa380('0x3e')](_0x44e54a[_0xa380('0x37')][_0xa380('0x3e')]);_0x3a7f14['where']=qs['filters'](_[_0xa380('0x40')](_0x44e54a[_0xa380('0x37')],_0x5010ce['filters']));if(_0x44e54a['query'][_0xa380('0x44')]){_0x3a7f14['where']=_['merge'](_0x3a7f14[_0xa380('0x3f')],{'$or':_[_0xa380('0x32')](_0x3a7f14[_0xa380('0x3a')],function(_0x55cc45){var _0x3fb903={};_0x3fb903[_0x55cc45]={'$like':'%'+_0x44e54a[_0xa380('0x37')]['filter']+'%'};return _0x3fb903;})});}_0x3a7f14=_[_0xa380('0x42')]({},_0x3a7f14,_0x44e54a[_0xa380('0x45')]);return _0x5ed067[_0xa380('0x8b')](_0x3a7f14);}})[_0xa380('0x28')](function(_0x35b6eb){if(_0x35b6eb){_0x286e25=_0x35b6eb['length'];if(!_0x44e54a[_0xa380('0x37')][_0xa380('0x3c')](_0xa380('0x3d'))){_0x3a7f14[_0xa380('0x22')]=qs[_0xa380('0x22')](_0x44e54a['query'][_0xa380('0x22')]);_0x3a7f14[_0xa380('0x24')]=qs['offset'](_0x44e54a['query'][_0xa380('0x24')]);}return _0x5ed067[_0xa380('0x8b')](_0x3a7f14);}})[_0xa380('0x28')](function(_0x5f47ea){if(_0x5f47ea){return _0x5f47ea?{'count':_0x286e25,'rows':_0x5f47ea}:null;}})[_0xa380('0x28')](respondWithResult(_0xc58b32,null))[_0xa380('0x4a')](handleError(_0xc58b32,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index d25f239..e7c56bc 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 _0xc6ba=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','save','update','remove','emit'];(function(_0x6aad74,_0x32ecf4){var _0x5b1c38=function(_0x567477){while(--_0x567477){_0x6aad74['push'](_0x6aad74['shift']());}};_0x5b1c38(++_0x32ecf4);}(_0xc6ba,0x71));var _0xac6b=function(_0x65ded6,_0x44949e){_0x65ded6=_0x65ded6-0x0;var _0x208438=_0xc6ba[_0x65ded6];return _0x208438;};'use strict';var EventEmitter=require(_0xac6b('0x0'));var WhatsappQueue=require(_0xac6b('0x1'))['db'][_0xac6b('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xac6b('0x3'),'afterUpdate':_0xac6b('0x4'),'afterDestroy':_0xac6b('0x5')};function emitEvent(_0x2b7f30){return function(_0x3bbc1b,_0xcf30d6,_0x4a70c9){WhatsappQueueEvents[_0xac6b('0x6')](_0x2b7f30+':'+_0x3bbc1b['id'],_0x3bbc1b);WhatsappQueueEvents[_0xac6b('0x6')](_0x2b7f30,_0x3bbc1b);_0x4a70c9(null);};}for(var e in events){if(events[_0xac6b('0x7')](e)){var event=events[e];WhatsappQueue[_0xac6b('0x8')](e,emitEvent(event));}}module[_0xac6b('0x9')]=WhatsappQueueEvents; \ No newline at end of file +var _0x4d9c=['exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x286949,_0x1ba55d){var _0x35a894=function(_0x51d62d){while(--_0x51d62d){_0x286949['push'](_0x286949['shift']());}};_0x35a894(++_0x1ba55d);}(_0x4d9c,0x169));var _0xc4d9=function(_0x8ad34c,_0x4d6fb5){_0x8ad34c=_0x8ad34c-0x0;var _0x27ddc5=_0x4d9c[_0x8ad34c];return _0x27ddc5;};'use strict';var EventEmitter=require(_0xc4d9('0x0'));var WhatsappQueue=require(_0xc4d9('0x1'))['db'][_0xc4d9('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xc4d9('0x3')](0x0);var events={'afterCreate':_0xc4d9('0x4'),'afterUpdate':'update','afterDestroy':_0xc4d9('0x5')};function emitEvent(_0x18e979){return function(_0x436d7a,_0x17936d,_0x110818){WhatsappQueueEvents['emit'](_0x18e979+':'+_0x436d7a['id'],_0x436d7a);WhatsappQueueEvents[_0xc4d9('0x6')](_0x18e979,_0x436d7a);_0x110818(null);};}for(var e in events){if(events[_0xc4d9('0x7')](e)){var event=events[e];WhatsappQueue[_0xc4d9('0x8')](e,emitEvent(event));}}module[_0xc4d9('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index f20a6bf..5b7afe6 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 _0x5bd0=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','WhatsappQueue','lodash','util'];(function(_0x39595c,_0x214c9b){var _0x4e0117=function(_0x5d58d7){while(--_0x5d58d7){_0x39595c['push'](_0x39595c['shift']());}};_0x4e0117(++_0x214c9b);}(_0x5bd0,0x166));var _0x05bd=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x5bd0[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0x05bd('0x0'));var util=require(_0x05bd('0x1'));var logger=require('../../config/logger')(_0x05bd('0x2'));var moment=require(_0x05bd('0x3'));var BPromise=require(_0x05bd('0x4'));var rp=require(_0x05bd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05bd('0x6'));var config=require(_0x05bd('0x7'));var attributes=require('./whatsappQueue.attributes');module[_0x05bd('0x8')]=function(_0x310ddd,_0x34b083){return _0x310ddd['define'](_0x05bd('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdceb=['whatsapp_queues','lodash','util','api','request-promise','path','./whatsappQueue.attributes','exports','define','WhatsappQueue'];(function(_0x92d580,_0x4928fb){var _0x4ee344=function(_0x55aa0c){while(--_0x55aa0c){_0x92d580['push'](_0x92d580['shift']());}};_0x4ee344(++_0x4928fb);}(_0xdceb,0x187));var _0xbdce=function(_0x24b615,_0x14a5d8){_0x24b615=_0x24b615-0x0;var _0x3b8bae=_0xdceb[_0x24b615];return _0x3b8bae;};'use strict';var _=require(_0xbdce('0x0'));var util=require(_0xbdce('0x1'));var logger=require('../../config/logger')(_0xbdce('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbdce('0x3'));var fs=require('fs');var path=require(_0xbdce('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbdce('0x5'));module[_0xbdce('0x6')]=function(_0x25fb0b,_0x171011){return _0x25fb0b[_0xbdce('0x7')](_0xbdce('0x8'),attributes,{'tableName':_0xbdce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 8da2c6e..3440eef 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 _0x023e=['stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','ShowWhatsappQueue','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x2b6fdc,_0x564d66){var _0x40295c=function(_0x392184){while(--_0x392184){_0x2b6fdc['push'](_0x2b6fdc['shift']());}};_0x40295c(++_0x564d66);}(_0x023e,0x131));var _0xe023=function(_0x4be43b,_0x52b04f){_0x4be43b=_0x4be43b-0x0;var _0x40e949=_0x023e[_0x4be43b];return _0x40e949;};'use strict';var _=require(_0xe023('0x0'));var util=require('util');var moment=require(_0xe023('0x1'));var BPromise=require('bluebird');var rs=require(_0xe023('0x2'));var fs=require('fs');var Redis=require(_0xe023('0x3'));var db=require(_0xe023('0x4'))['db'];var utils=require(_0xe023('0x5'));var logger=require(_0xe023('0x6'))(_0xe023('0x7'));var config=require('../../config/environment');var jayson=require(_0xe023('0x8'));var client=jayson[_0xe023('0x9')][_0xe023('0xa')]({'port':0x232a});config[_0xe023('0xb')]=_[_0xe023('0xc')](config[_0xe023('0xb')],{'host':_0xe023('0xd'),'port':0x18eb});var socket=require(_0xe023('0xe'))(new Redis(config[_0xe023('0xb')]));require(_0xe023('0xf'))[_0xe023('0x10')](socket);function respondWithRpcPromise(_0x10df77,_0x4c47ea,_0x473dbb){return new BPromise(function(_0xea60b6,_0xf5449f){return client[_0xe023('0x11')](_0x10df77,_0x473dbb)[_0xe023('0x12')](function(_0x2657c9){logger[_0xe023('0x13')](_0xe023('0x14'),_0x4c47ea,'request\x20sent');logger[_0xe023('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4c47ea,_0xe023('0x16'),JSON[_0xe023('0x17')](_0x2657c9));if(_0x2657c9['error']){if(_0x2657c9[_0xe023('0x18')][_0xe023('0x19')]===0x1f4){logger[_0xe023('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x4c47ea,_0x2657c9[_0xe023('0x18')][_0xe023('0x1a')]);return _0xf5449f(_0x2657c9[_0xe023('0x18')]['message']);}logger[_0xe023('0x18')](_0xe023('0x14'),_0x4c47ea,_0x2657c9['error'][_0xe023('0x1a')]);return _0xea60b6(_0x2657c9[_0xe023('0x18')][_0xe023('0x1a')]);}else{logger[_0xe023('0x13')](_0xe023('0x14'),_0x4c47ea,_0xe023('0x16'));_0xea60b6(_0x2657c9[_0xe023('0x1b')][_0xe023('0x1a')]);}})[_0xe023('0x1c')](function(_0xae10e8){logger[_0xe023('0x18')](_0xe023('0x14'),_0x4c47ea,_0xae10e8);_0xf5449f(_0xae10e8);});});}exports[_0xe023('0x1d')]=function(_0x5a5250){var _0x4f2842=this;return new Promise(function(_0x533279,_0x2e6d94){return db[_0xe023('0x1e')][_0xe023('0x1f')]({'raw':_0x5a5250[_0xe023('0x20')]?_0x5a5250[_0xe023('0x20')][_0xe023('0x21')]===undefined?!![]:![]:!![],'where':_0x5a5250[_0xe023('0x20')]?_0x5a5250['options'][_0xe023('0x22')]||null:null,'attributes':_0x5a5250[_0xe023('0x20')]?_0x5a5250[_0xe023('0x20')][_0xe023('0x23')]||null:null,'limit':_0x5a5250['options']?_0x5a5250[_0xe023('0x20')]['limit']||null:null,'include':_0x5a5250[_0xe023('0x20')]?_0x5a5250['options'][_0xe023('0x24')]?_[_0xe023('0x25')](_0x5a5250[_0xe023('0x20')][_0xe023('0x24')],function(_0x4c9887){return{'model':db[_0x4c9887['model']],'as':_0x4c9887['as'],'attributes':_0x4c9887[_0xe023('0x23')],'include':_0x4c9887[_0xe023('0x24')]?_[_0xe023('0x25')](_0x4c9887[_0xe023('0x24')],function(_0xf15e84){return{'model':db[_0xf15e84['model']],'as':_0xf15e84['as'],'attributes':_0xf15e84[_0xe023('0x23')],'include':_0xf15e84[_0xe023('0x24')]?_[_0xe023('0x25')](_0xf15e84['include'],function(_0x5d4f45){return{'model':db[_0x5d4f45[_0xe023('0x26')]],'as':_0x5d4f45['as'],'attributes':_0x5d4f45['attributes']};}):[]};}):[]};}):[]:[]})[_0xe023('0x12')](function(_0x234bf6){logger[_0xe023('0x13')]('GetWhatsappQueue',_0x5a5250);logger['debug'](_0xe023('0x1d'),_0x5a5250,JSON[_0xe023('0x17')](_0x234bf6));_0x533279(_0x234bf6);})['catch'](function(_0x2a9bf3){logger[_0xe023('0x18')](_0xe023('0x1d'),_0x2a9bf3[_0xe023('0x1a')],_0x5a5250);_0x2e6d94(_0x4f2842['error'](0x1f4,_0x2a9bf3[_0xe023('0x1a')]));});});};exports[_0xe023('0x27')]=function(_0x197163){var _0x1e74bb=this;return new Promise(function(_0x199042,_0x1eeb66){return db[_0xe023('0x1e')][_0xe023('0x28')]({'raw':_0x197163['options']?_0x197163[_0xe023('0x20')][_0xe023('0x21')]===undefined?!![]:![]:!![],'where':_0x197163['options']?_0x197163['options']['where']||null:null,'attributes':_0x197163[_0xe023('0x20')]?_0x197163[_0xe023('0x20')][_0xe023('0x23')]||null:null,'include':_0x197163['options']?_0x197163[_0xe023('0x20')][_0xe023('0x24')]?_[_0xe023('0x25')](_0x197163[_0xe023('0x20')][_0xe023('0x24')],function(_0x5be10a){return{'model':db[_0x5be10a['model']],'as':_0x5be10a['as'],'attributes':_0x5be10a[_0xe023('0x23')],'include':_0x5be10a[_0xe023('0x24')]?_['map'](_0x5be10a[_0xe023('0x24')],function(_0x9afe07){return{'model':db[_0x9afe07[_0xe023('0x26')]],'as':_0x9afe07['as'],'attributes':_0x9afe07[_0xe023('0x23')],'include':_0x9afe07['include']?_[_0xe023('0x25')](_0x9afe07[_0xe023('0x24')],function(_0x158ec5){return{'model':db[_0x158ec5[_0xe023('0x26')]],'as':_0x158ec5['as'],'attributes':_0x158ec5[_0xe023('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x248eba){logger['info'](_0xe023('0x27'),_0x197163);logger[_0xe023('0x15')](_0xe023('0x27'),_0x197163,JSON[_0xe023('0x17')](_0x248eba));_0x199042(_0x248eba);})[_0xe023('0x1c')](function(_0x29a469){logger[_0xe023('0x18')](_0xe023('0x27'),_0x29a469[_0xe023('0x1a')],_0x197163);_0x1eeb66(_0x1e74bb[_0xe023('0x18')](0x1f4,_0x29a469[_0xe023('0x1a')]));});});}; \ No newline at end of file +var _0x36c3=['result','catch','options','raw','where','attributes','include','model','map','GetWhatsappQueue','ShowWhatsappQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xdcf7cb,_0x38ba96){var _0x38181d=function(_0x358975){while(--_0x358975){_0xdcf7cb['push'](_0xdcf7cb['shift']());}};_0x38181d(++_0x38ba96);}(_0x36c3,0x7e));var _0x336c=function(_0x4489f2,_0x1f9128){_0x4489f2=_0x4489f2-0x0;var _0x5cc527=_0x36c3[_0x4489f2];return _0x5cc527;};'use strict';var _=require(_0x336c('0x0'));var util=require('util');var moment=require(_0x336c('0x1'));var BPromise=require(_0x336c('0x2'));var rs=require(_0x336c('0x3'));var fs=require('fs');var Redis=require(_0x336c('0x4'));var db=require(_0x336c('0x5'))['db'];var utils=require(_0x336c('0x6'));var logger=require(_0x336c('0x7'))(_0x336c('0x8'));var config=require(_0x336c('0x9'));var jayson=require(_0x336c('0xa'));var client=jayson[_0x336c('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x336c('0xc')],{'host':_0x336c('0xd'),'port':0x18eb});var socket=require(_0x336c('0xe'))(new Redis(config[_0x336c('0xc')]));require(_0x336c('0xf'))[_0x336c('0x10')](socket);function respondWithRpcPromise(_0x16f621,_0x59bc8a,_0x418594){return new BPromise(function(_0x34f65e,_0x4e4b4f){return client['request'](_0x16f621,_0x418594)['then'](function(_0x191104){logger[_0x336c('0x11')](_0x336c('0x12'),_0x59bc8a,_0x336c('0x13'));logger[_0x336c('0x14')](_0x336c('0x15'),_0x59bc8a,'request\x20sent',JSON[_0x336c('0x16')](_0x191104));if(_0x191104[_0x336c('0x17')]){if(_0x191104[_0x336c('0x17')][_0x336c('0x18')]===0x1f4){logger[_0x336c('0x17')](_0x336c('0x12'),_0x59bc8a,_0x191104['error']['message']);return _0x4e4b4f(_0x191104['error'][_0x336c('0x19')]);}logger['error'](_0x336c('0x12'),_0x59bc8a,_0x191104['error'][_0x336c('0x19')]);return _0x34f65e(_0x191104[_0x336c('0x17')][_0x336c('0x19')]);}else{logger[_0x336c('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x59bc8a,_0x336c('0x13'));_0x34f65e(_0x191104[_0x336c('0x1a')]['message']);}})[_0x336c('0x1b')](function(_0x129bbb){logger[_0x336c('0x17')](_0x336c('0x12'),_0x59bc8a,_0x129bbb);_0x4e4b4f(_0x129bbb);});});}exports['GetWhatsappQueue']=function(_0x22c903){var _0x538284=this;return new Promise(function(_0x240d31,_0x5db430){return db['WhatsappQueue']['findAll']({'raw':_0x22c903['options']?_0x22c903[_0x336c('0x1c')][_0x336c('0x1d')]===undefined?!![]:![]:!![],'where':_0x22c903[_0x336c('0x1c')]?_0x22c903[_0x336c('0x1c')][_0x336c('0x1e')]||null:null,'attributes':_0x22c903['options']?_0x22c903[_0x336c('0x1c')][_0x336c('0x1f')]||null:null,'limit':_0x22c903['options']?_0x22c903['options']['limit']||null:null,'include':_0x22c903[_0x336c('0x1c')]?_0x22c903['options'][_0x336c('0x20')]?_['map'](_0x22c903[_0x336c('0x1c')][_0x336c('0x20')],function(_0x1c789f){return{'model':db[_0x1c789f[_0x336c('0x21')]],'as':_0x1c789f['as'],'attributes':_0x1c789f[_0x336c('0x1f')],'include':_0x1c789f[_0x336c('0x20')]?_['map'](_0x1c789f[_0x336c('0x20')],function(_0x5500cb){return{'model':db[_0x5500cb[_0x336c('0x21')]],'as':_0x5500cb['as'],'attributes':_0x5500cb[_0x336c('0x1f')],'include':_0x5500cb[_0x336c('0x20')]?_[_0x336c('0x22')](_0x5500cb[_0x336c('0x20')],function(_0xcedda3){return{'model':db[_0xcedda3[_0x336c('0x21')]],'as':_0xcedda3['as'],'attributes':_0xcedda3[_0x336c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2f5965){logger[_0x336c('0x11')](_0x336c('0x23'),_0x22c903);logger[_0x336c('0x14')]('GetWhatsappQueue',_0x22c903,JSON[_0x336c('0x16')](_0x2f5965));_0x240d31(_0x2f5965);})[_0x336c('0x1b')](function(_0x1cdd36){logger['error'](_0x336c('0x23'),_0x1cdd36['message'],_0x22c903);_0x5db430(_0x538284[_0x336c('0x17')](0x1f4,_0x1cdd36['message']));});});};exports[_0x336c('0x24')]=function(_0x119fbd){var _0x3f42fe=this;return new Promise(function(_0x5af6b0,_0x27a0fe){return db['WhatsappQueue'][_0x336c('0x25')]({'raw':_0x119fbd['options']?_0x119fbd[_0x336c('0x1c')][_0x336c('0x1d')]===undefined?!![]:![]:!![],'where':_0x119fbd['options']?_0x119fbd[_0x336c('0x1c')][_0x336c('0x1e')]||null:null,'attributes':_0x119fbd[_0x336c('0x1c')]?_0x119fbd[_0x336c('0x1c')][_0x336c('0x1f')]||null:null,'include':_0x119fbd[_0x336c('0x1c')]?_0x119fbd['options'][_0x336c('0x20')]?_[_0x336c('0x22')](_0x119fbd['options'][_0x336c('0x20')],function(_0x7367ac){return{'model':db[_0x7367ac[_0x336c('0x21')]],'as':_0x7367ac['as'],'attributes':_0x7367ac['attributes'],'include':_0x7367ac[_0x336c('0x20')]?_[_0x336c('0x22')](_0x7367ac[_0x336c('0x20')],function(_0x515d4f){return{'model':db[_0x515d4f['model']],'as':_0x515d4f['as'],'attributes':_0x515d4f['attributes'],'include':_0x515d4f[_0x336c('0x20')]?_[_0x336c('0x22')](_0x515d4f[_0x336c('0x20')],function(_0x141a3e){return{'model':db[_0x141a3e['model']],'as':_0x141a3e['as'],'attributes':_0x141a3e[_0x336c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41569b){logger[_0x336c('0x11')](_0x336c('0x24'),_0x119fbd);logger[_0x336c('0x14')](_0x336c('0x24'),_0x119fbd,JSON['stringify'](_0x41569b));_0x5af6b0(_0x41569b);})[_0x336c('0x1b')](function(_0x5d1d72){logger[_0x336c('0x17')](_0x336c('0x24'),_0x5d1d72[_0x336c('0x19')],_0x119fbd);_0x27a0fe(_0x3f42fe[_0x336c('0x17')](0x1f4,_0x5d1d72['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 696fac4..219e4f0 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 _0x9c18=['remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x7424aa,_0x52f4c6){var _0x4d489c=function(_0x288a8f){while(--_0x288a8f){_0x7424aa['push'](_0x7424aa['shift']());}};_0x4d489c(++_0x52f4c6);}(_0x9c18,0xa7));var _0x89c1=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x9c18[_0x31cb5f];return _0x586042;};'use strict';var WhatsappQueueEvents=require(_0x89c1('0x0'));var events=['save',_0x89c1('0x1'),_0x89c1('0x2')];function createListener(_0x502d23,_0x4d68d4){return function(_0x55d6e){_0x4d68d4[_0x89c1('0x3')](_0x502d23,_0x55d6e);};}function removeListener(_0xcc08dd,_0x14bb78){return function(){WhatsappQueueEvents[_0x89c1('0x4')](_0xcc08dd,_0x14bb78);};}exports[_0x89c1('0x5')]=function(_0x4f49af){for(var _0x1144d6=0x0,_0x10b270=events[_0x89c1('0x6')];_0x1144d6<_0x10b270;_0x1144d6++){var _0x432066=events[_0x1144d6];var _0x40bfbf=createListener(_0x89c1('0x7')+_0x432066,_0x4f49af);WhatsappQueueEvents['on'](_0x432066,_0x40bfbf);}}; \ No newline at end of file +var _0x38c3=['save','update','emit','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x5908b8,_0x544699){var _0xe24a76=function(_0x2bd33f){while(--_0x2bd33f){_0x5908b8['push'](_0x5908b8['shift']());}};_0xe24a76(++_0x544699);}(_0x38c3,0x164));var _0x338c=function(_0x4804d7,_0x56ef10){_0x4804d7=_0x4804d7-0x0;var _0x532259=_0x38c3[_0x4804d7];return _0x532259;};'use strict';var WhatsappQueueEvents=require(_0x338c('0x0'));var events=[_0x338c('0x1'),'remove',_0x338c('0x2')];function createListener(_0x496aa2,_0x43d4db){return function(_0x444115){_0x43d4db[_0x338c('0x3')](_0x496aa2,_0x444115);};}function removeListener(_0x45155c,_0xe9afd6){return function(){WhatsappQueueEvents['removeListener'](_0x45155c,_0xe9afd6);};}exports[_0x338c('0x4')]=function(_0x131e71){for(var _0x21230e=0x0,_0x2e0462=events[_0x338c('0x5')];_0x21230e<_0x2e0462;_0x21230e++){var _0x2dd5a7=events[_0x21230e];var _0x5ca247=createListener(_0x338c('0x6')+_0x2dd5a7,_0x131e71);WhatsappQueueEvents['on'](_0x2dd5a7,_0x5ca247);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index a93d721..ed67e80 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 _0xba83=['fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','delete','destroy','exports','util','path','express','Router'];(function(_0x4fe456,_0x4ff847){var _0x2865d4=function(_0x47980d){while(--_0x47980d){_0x4fe456['push'](_0x4fe456['shift']());}};_0x2865d4(++_0x4ff847);}(_0xba83,0xc2));var _0x3ba8=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0xba83[_0xbb9dbf];return _0x30223c;};'use strict';var multer=require('multer');var util=require(_0x3ba8('0x0'));var path=require(_0x3ba8('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ba8('0x2'));var router=express[_0x3ba8('0x3')]();var fs_extra=require(_0x3ba8('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3ba8('0x5'));var config=require(_0x3ba8('0x6'));var controller=require(_0x3ba8('0x7'));router[_0x3ba8('0x8')]('/',auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xa')]);router[_0x3ba8('0x8')](_0x3ba8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x3ba8('0x8')](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller[_0x3ba8('0xd')]);router[_0x3ba8('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller['update']);router[_0x3ba8('0xf')](_0x3ba8('0xc'),auth[_0x3ba8('0x9')](),controller[_0x3ba8('0x10')]);module[_0x3ba8('0x11')]=router; \ No newline at end of file +var _0x5c66=['post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','index','/describe','isAuthenticated','describe','get','show'];(function(_0x2f6af4,_0x2875fc){var _0xa5f3be=function(_0x406555){while(--_0x406555){_0x2f6af4['push'](_0x2f6af4['shift']());}};_0xa5f3be(++_0x2875fc);}(_0x5c66,0x192));var _0x65c6=function(_0x1e5a35,_0x2dfee4){_0x1e5a35=_0x1e5a35-0x0;var _0x1fb6d3=_0x5c66[_0x1e5a35];return _0x1fb6d3;};'use strict';var multer=require(_0x65c6('0x0'));var util=require(_0x65c6('0x1'));var path=require(_0x65c6('0x2'));var timeout=require(_0x65c6('0x3'));var express=require(_0x65c6('0x4'));var router=express[_0x65c6('0x5')]();var fs_extra=require(_0x65c6('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x65c6('0x7'));var config=require(_0x65c6('0x8'));var controller=require(_0x65c6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x65c6('0xa')]);router['get'](_0x65c6('0xb'),auth[_0x65c6('0xc')](),controller[_0x65c6('0xd')]);router[_0x65c6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x65c6('0xf')]);router[_0x65c6('0x10')]('/',auth[_0x65c6('0xc')](),controller[_0x65c6('0x11')]);router[_0x65c6('0x12')](_0x65c6('0x13'),auth[_0x65c6('0xc')](),controller['update']);router[_0x65c6('0x14')](_0x65c6('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x65c6('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index b002fba..bfc87cc 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4ea32f,_0x1a992e){var _0x147e03=function(_0x36ce6e){while(--_0x36ce6e){_0x4ea32f['push'](_0x4ea32f['shift']());}};_0x147e03(++_0x1a992e);}(_0x7a54,0x106));var _0x47a5=function(_0x2f54a1,_0x18a261){_0x2f54a1=_0x2f54a1-0x0;var _0x246c54=_0x7a54[_0x2f54a1];return _0x246c54;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4395f1,_0x147638){var _0x4991d8=function(_0x2750dc){while(--_0x2750dc){_0x4395f1['push'](_0x4395f1['shift']());}};_0x4991d8(++_0x147638);}(_0x7a54,0x106));var _0x47a5=function(_0x3fe532,_0x2f56cd){_0x3fe532=_0x3fe532-0x0;var _0x1459eb=_0x7a54[_0x3fe532];return _0x1459eb;};'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 f967b8c..0d654c7 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 _0x3f8c=['end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3fd9d0,_0xdfe805){var _0x3e1d65=function(_0xf4d655){while(--_0xf4d655){_0x3fd9d0['push'](_0x3fd9d0['shift']());}};_0x3e1d65(++_0xdfe805);}(_0x3f8c,0x104));var _0xc3f8=function(_0x38a77e,_0x192a56){_0x38a77e=_0x38a77e-0x0;var _0x4bd270=_0x3f8c[_0x38a77e];return _0x4bd270;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4569c2,_0x327b2d){return function(_0x2d237e){if(!_0x2d237e){_0x4569c2[_0xc3f8('0x16')](0x194);}return _0x2d237e;};}function handleError(_0x25088f,_0x9d43b4){_0x9d43b4=_0x9d43b4||0x1f4;return function(_0xf1d460){logger[_0xc3f8('0x22')](_0xf1d460[_0xc3f8('0x23')]);if(_0xf1d460[_0xc3f8('0x24')]){delete _0xf1d460[_0xc3f8('0x24')];}_0x25088f[_0xc3f8('0x17')](_0x9d43b4)[_0xc3f8('0x25')](_0xf1d460);};}exports[_0xc3f8('0x26')]=function(_0x59e4dd,_0x58b303){var _0x2909f8={},_0x218029={},_0x5bf6e2={'count':0x0,'rows':[]};var _0x151bba=_['map'](db[_0xc3f8('0x27')][_0xc3f8('0x28')],function(_0x47ab53){return{'name':_0x47ab53['fieldName'],'type':_0x47ab53[_0xc3f8('0x29')][_0xc3f8('0x2a')]};});_0x218029[_0xc3f8('0x2b')]=_[_0xc3f8('0x2c')](_0x151bba,_0xc3f8('0x24'));_0x218029[_0xc3f8('0x2d')]=_[_0xc3f8('0x2e')](_0x59e4dd[_0xc3f8('0x2d')]);_0x218029[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x218029['model'],_0x218029[_0xc3f8('0x2d')]);_0x2909f8[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x218029[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x59e4dd['query']['fields']));_0x2909f8[_0xc3f8('0x31')]=_0x2909f8[_0xc3f8('0x31')][_0xc3f8('0x33')]?_0x2909f8[_0xc3f8('0x31')]:_0x218029[_0xc3f8('0x2b')];if(!_0x59e4dd['query'][_0xc3f8('0x34')](_0xc3f8('0x35'))){_0x2909f8[_0xc3f8('0x1b')]=qs['limit'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1b')]);_0x2909f8[_0xc3f8('0x1a')]=qs['offset'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1a')]);}_0x2909f8['order']=qs[_0xc3f8('0x36')](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x36')]);_0x2909f8[_0xc3f8('0x37')]=qs[_0xc3f8('0x2f')](_[_0xc3f8('0x38')](_0x59e4dd['query'],_0x218029[_0xc3f8('0x2f')]),_0x151bba);if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]){_0x2909f8[_0xc3f8('0x37')]=_[_0xc3f8('0x3a')](_0x2909f8['where'],{'$or':_[_0xc3f8('0x2c')](_0x151bba,function(_0x4451a2){if(_0x4451a2[_0xc3f8('0x29')]!=='VIRTUAL'){var _0x316643={};_0x316643[_0x4451a2[_0xc3f8('0x24')]]={'$like':'%'+_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]+'%'};return _0x316643;}})});}_0x2909f8=_['merge']({},_0x2909f8,_0x59e4dd[_0xc3f8('0x3b')]);var _0x45d416={'where':_0x2909f8[_0xc3f8('0x37')]};return db[_0xc3f8('0x27')]['count'](_0x45d416)[_0xc3f8('0x21')](function(_0x5db44d){_0x5bf6e2['count']=_0x5db44d;if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x3c')]){_0x2909f8[_0xc3f8('0x3d')]=[{'all':!![]}];}return db[_0xc3f8('0x27')]['findAll'](_0x2909f8);})['then'](function(_0x361a85){_0x5bf6e2[_0xc3f8('0x3e')]=_0x361a85;return _0x5bf6e2;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x58b303,_0x2909f8))[_0xc3f8('0x3f')](handleError(_0x58b303,null));};exports[_0xc3f8('0x40')]=function(_0x465547,_0x3113b4){var _0x45e6ea={'raw':!![],'where':{'id':_0x465547[_0xc3f8('0x41')]['id']}},_0x13d8dc={};_0x13d8dc[_0xc3f8('0x2b')]=_['keys'](db[_0xc3f8('0x27')][_0xc3f8('0x28')]);_0x13d8dc['query']=_[_0xc3f8('0x2e')](_0x465547[_0xc3f8('0x2d')]);_0x13d8dc['filters']=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],_0x13d8dc[_0xc3f8('0x2d')]);_0x45e6ea[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x465547[_0xc3f8('0x2d')][_0xc3f8('0x32')]));_0x45e6ea[_0xc3f8('0x31')]=_0x45e6ea[_0xc3f8('0x31')]['length']?_0x45e6ea[_0xc3f8('0x31')]:_0x13d8dc[_0xc3f8('0x2b')];if(_0x465547['query'][_0xc3f8('0x3c')]){_0x45e6ea[_0xc3f8('0x3d')]=[{'all':!![]}];}_0x45e6ea=_[_0xc3f8('0x3a')]({},_0x45e6ea,_0x465547[_0xc3f8('0x3b')]);return db['WhatsappQueueReport']['find'](_0x45e6ea)[_0xc3f8('0x21')](handleEntityNotFound(_0x3113b4,null))[_0xc3f8('0x21')](respondWithResult(_0x3113b4,null))[_0xc3f8('0x3f')](handleError(_0x3113b4,null));};exports['create']=function(_0x1b5777,_0x3a665e){return db[_0xc3f8('0x27')][_0xc3f8('0x42')](_0x1b5777[_0xc3f8('0x43')],{})['then'](respondWithResult(_0x3a665e,0xc9))[_0xc3f8('0x3f')](handleError(_0x3a665e,null));};exports[_0xc3f8('0x20')]=function(_0x5961ab,_0x1becae){if(_0x5961ab[_0xc3f8('0x43')]['id']){delete _0x5961ab[_0xc3f8('0x43')]['id'];}return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x5961ab[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1becae,null))['then'](saveUpdates(_0x5961ab[_0xc3f8('0x43')],null))[_0xc3f8('0x21')](respondWithResult(_0x1becae,null))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x45')]=function(_0x2e9f93,_0x2448bf){return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x2e9f93[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x2448bf,null))['then'](removeEntity(_0x2448bf,null))[_0xc3f8('0x3f')](handleError(_0x2448bf,null));};exports[_0xc3f8('0x46')]=function(_0x425fee,_0x267c95){return db[_0xc3f8('0x27')][_0xc3f8('0x46')]()[_0xc3f8('0x21')](respondWithResult(_0x267c95,null))[_0xc3f8('0x3f')](handleError(_0x267c95,null));}; \ No newline at end of file +var _0x7af2=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','keys','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce'];(function(_0x1d506a,_0x4fc4a0){var _0x5edd79=function(_0x4f7567){while(--_0x4f7567){_0x1d506a['push'](_0x1d506a['shift']());}};_0x5edd79(++_0x4fc4a0);}(_0x7af2,0x119));var _0x27af=function(_0x248c97,_0x1d9091){_0x248c97=_0x248c97-0x0;var _0x23b211=_0x7af2[_0x248c97];return _0x23b211;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x27af('0x0'));var zipdir=require(_0x27af('0x1'));var jsonpatch=require(_0x27af('0x2'));var rp=require(_0x27af('0x3'));var moment=require('moment');var BPromise=require(_0x27af('0x4'));var Mustache=require(_0x27af('0x5'));var util=require(_0x27af('0x6'));var path=require(_0x27af('0x7'));var sox=require(_0x27af('0x8'));var csv=require(_0x27af('0x9'));var ejs=require(_0x27af('0xa'));var fs=require('fs');var fs_extra=require(_0x27af('0xb'));var _=require(_0x27af('0xc'));var squel=require('squel');var crypto=require(_0x27af('0xd'));var jsforce=require(_0x27af('0xe'));var deskjs=require(_0x27af('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27af('0x10'));var Papa=require(_0x27af('0x11'));var Redis=require(_0x27af('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27af('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x27af('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x27af('0x16'))['db'];function respondWithStatusCode(_0x49a883,_0x406340){_0x406340=_0x406340||0xcc;return function(_0x203501){if(_0x203501){return _0x49a883[_0x27af('0x17')](_0x406340);}return _0x49a883[_0x27af('0x18')](_0x406340)[_0x27af('0x19')]();};}function respondWithResult(_0x1edb50,_0x234825){_0x234825=_0x234825||0xc8;return function(_0x3da435){if(_0x3da435){return _0x1edb50[_0x27af('0x18')](_0x234825)[_0x27af('0x1a')](_0x3da435);}};}function respondWithFilteredResult(_0x30f675,_0x9c2d4b){return function(_0x2d7800){if(_0x2d7800){var _0x3102c4=typeof _0x9c2d4b[_0x27af('0x1b')]===_0x27af('0x1c')&&typeof _0x9c2d4b[_0x27af('0x1d')]===_0x27af('0x1c');var _0x58583a=_0x2d7800[_0x27af('0x1e')];var _0x31d702=_0x3102c4?0x0:_0x9c2d4b['offset'];var _0x4e6e2f=_0x3102c4?_0x2d7800[_0x27af('0x1e')]:_0x9c2d4b[_0x27af('0x1b')]+_0x9c2d4b[_0x27af('0x1d')];var _0x31573a;if(_0x4e6e2f>=_0x58583a){_0x4e6e2f=_0x58583a;_0x31573a=0xc8;}else{_0x31573a=0xce;}_0x30f675[_0x27af('0x18')](_0x31573a);return _0x30f675['set'](_0x27af('0x1f'),_0x31d702+'-'+_0x4e6e2f+'/'+_0x58583a)[_0x27af('0x1a')](_0x2d7800);}return null;};}function patchUpdates(_0xcb4b90){return function(_0x5e7c19){try{jsonpatch[_0x27af('0x20')](_0x5e7c19,_0xcb4b90,!![]);}catch(_0x2eec5f){return BPromise[_0x27af('0x21')](_0x2eec5f);}return _0x5e7c19['save']();};}function saveUpdates(_0x2dce2b,_0x2460f4){return function(_0x30720b){if(_0x30720b){return _0x30720b[_0x27af('0x22')](_0x2dce2b)[_0x27af('0x23')](function(_0x396156){return _0x396156;});}return null;};}function removeEntity(_0x43dd9e,_0x35b36d){return function(_0x2e1bb0){if(_0x2e1bb0){return _0x2e1bb0['destroy']()['then'](function(){_0x43dd9e['status'](0xcc)[_0x27af('0x19')]();});}};}function handleEntityNotFound(_0x4feaf1,_0x12625c){return function(_0x396326){if(!_0x396326){_0x4feaf1['sendStatus'](0x194);}return _0x396326;};}function handleError(_0x393190,_0x1d9341){_0x1d9341=_0x1d9341||0x1f4;return function(_0x463e36){logger[_0x27af('0x24')](_0x463e36[_0x27af('0x25')]);if(_0x463e36[_0x27af('0x26')]){delete _0x463e36[_0x27af('0x26')];}_0x393190['status'](_0x1d9341)[_0x27af('0x27')](_0x463e36);};}exports[_0x27af('0x28')]=function(_0xadd38e,_0xe009a){var _0x25d65a={},_0xa08dd9={},_0x42a5b7={'count':0x0,'rows':[]};var _0x2b26ac=_[_0x27af('0x29')](db[_0x27af('0x2a')][_0x27af('0x2b')],function(_0x4f4955){return{'name':_0x4f4955[_0x27af('0x2c')],'type':_0x4f4955[_0x27af('0x2d')][_0x27af('0x2e')]};});_0xa08dd9[_0x27af('0x2f')]=_[_0x27af('0x29')](_0x2b26ac,_0x27af('0x26'));_0xa08dd9['query']=_['keys'](_0xadd38e[_0x27af('0x30')]);_0xa08dd9[_0x27af('0x31')]=_['intersection'](_0xa08dd9[_0x27af('0x2f')],_0xa08dd9[_0x27af('0x30')]);_0x25d65a[_0x27af('0x32')]=_[_0x27af('0x33')](_0xa08dd9[_0x27af('0x2f')],qs[_0x27af('0x34')](_0xadd38e[_0x27af('0x30')][_0x27af('0x34')]));_0x25d65a[_0x27af('0x32')]=_0x25d65a[_0x27af('0x32')][_0x27af('0x35')]?_0x25d65a['attributes']:_0xa08dd9['model'];if(!_0xadd38e[_0x27af('0x30')][_0x27af('0x36')]('nolimit')){_0x25d65a[_0x27af('0x1d')]=qs[_0x27af('0x1d')](_0xadd38e['query'][_0x27af('0x1d')]);_0x25d65a[_0x27af('0x1b')]=qs[_0x27af('0x1b')](_0xadd38e[_0x27af('0x30')][_0x27af('0x1b')]);}_0x25d65a['order']=qs[_0x27af('0x37')](_0xadd38e[_0x27af('0x30')]['sort']);_0x25d65a['where']=qs[_0x27af('0x31')](_[_0x27af('0x38')](_0xadd38e[_0x27af('0x30')],_0xa08dd9[_0x27af('0x31')]),_0x2b26ac);if(_0xadd38e[_0x27af('0x30')][_0x27af('0x39')]){_0x25d65a['where']=_[_0x27af('0x3a')](_0x25d65a['where'],{'$or':_[_0x27af('0x29')](_0x2b26ac,function(_0x38a532){if(_0x38a532[_0x27af('0x2d')]!==_0x27af('0x3b')){var _0x1c6a4d={};_0x1c6a4d[_0x38a532['name']]={'$like':'%'+_0xadd38e[_0x27af('0x30')][_0x27af('0x39')]+'%'};return _0x1c6a4d;}})});}_0x25d65a=_[_0x27af('0x3a')]({},_0x25d65a,_0xadd38e[_0x27af('0x3c')]);var _0x10c1be={'where':_0x25d65a[_0x27af('0x3d')]};return db[_0x27af('0x2a')][_0x27af('0x1e')](_0x10c1be)[_0x27af('0x23')](function(_0x18f11b){_0x42a5b7[_0x27af('0x1e')]=_0x18f11b;if(_0xadd38e[_0x27af('0x30')][_0x27af('0x3e')]){_0x25d65a[_0x27af('0x3f')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x27af('0x40')](_0x25d65a);})[_0x27af('0x23')](function(_0x44534b){_0x42a5b7[_0x27af('0x41')]=_0x44534b;return _0x42a5b7;})['then'](respondWithFilteredResult(_0xe009a,_0x25d65a))[_0x27af('0x42')](handleError(_0xe009a,null));};exports['show']=function(_0x516651,_0x2425dd){var _0x3c9c81={'raw':!![],'where':{'id':_0x516651[_0x27af('0x43')]['id']}},_0x279f99={};_0x279f99[_0x27af('0x2f')]=_[_0x27af('0x44')](db[_0x27af('0x2a')][_0x27af('0x2b')]);_0x279f99[_0x27af('0x30')]=_[_0x27af('0x44')](_0x516651[_0x27af('0x30')]);_0x279f99[_0x27af('0x31')]=_['intersection'](_0x279f99[_0x27af('0x2f')],_0x279f99[_0x27af('0x30')]);_0x3c9c81['attributes']=_['intersection'](_0x279f99[_0x27af('0x2f')],qs[_0x27af('0x34')](_0x516651[_0x27af('0x30')][_0x27af('0x34')]));_0x3c9c81[_0x27af('0x32')]=_0x3c9c81['attributes'][_0x27af('0x35')]?_0x3c9c81['attributes']:_0x279f99[_0x27af('0x2f')];if(_0x516651[_0x27af('0x30')][_0x27af('0x3e')]){_0x3c9c81[_0x27af('0x3f')]=[{'all':!![]}];}_0x3c9c81=_[_0x27af('0x3a')]({},_0x3c9c81,_0x516651[_0x27af('0x3c')]);return db[_0x27af('0x2a')]['find'](_0x3c9c81)['then'](handleEntityNotFound(_0x2425dd,null))[_0x27af('0x23')](respondWithResult(_0x2425dd,null))['catch'](handleError(_0x2425dd,null));};exports[_0x27af('0x45')]=function(_0x1b43e2,_0x226025){return db[_0x27af('0x2a')][_0x27af('0x45')](_0x1b43e2[_0x27af('0x46')],{})[_0x27af('0x23')](respondWithResult(_0x226025,0xc9))['catch'](handleError(_0x226025,null));};exports[_0x27af('0x22')]=function(_0xc7e2a8,_0x20e180){if(_0xc7e2a8[_0x27af('0x46')]['id']){delete _0xc7e2a8[_0x27af('0x46')]['id'];}return db['WhatsappQueueReport'][_0x27af('0x47')]({'where':{'id':_0xc7e2a8[_0x27af('0x43')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x20e180,null))['then'](saveUpdates(_0xc7e2a8['body'],null))[_0x27af('0x23')](respondWithResult(_0x20e180,null))[_0x27af('0x42')](handleError(_0x20e180,null));};exports[_0x27af('0x48')]=function(_0x5be44f,_0x495794){return db[_0x27af('0x2a')]['find']({'where':{'id':_0x5be44f[_0x27af('0x43')]['id']}})[_0x27af('0x23')](handleEntityNotFound(_0x495794,null))[_0x27af('0x23')](removeEntity(_0x495794,null))[_0x27af('0x42')](handleError(_0x495794,null));};exports[_0x27af('0x49')]=function(_0xb9e23,_0x123533){return db[_0x27af('0x2a')][_0x27af('0x49')]()[_0x27af('0x23')](respondWithResult(_0x123533,null))[_0x27af('0x42')](handleError(_0x123533,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 753e138..4ed190b 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 _0xf41c=['exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x45b2c3,_0x4a0966){var _0x4d1323=function(_0x24bcd8){while(--_0x24bcd8){_0x45b2c3['push'](_0x45b2c3['shift']());}};_0x4d1323(++_0x4a0966);}(_0xf41c,0x139));var _0xcf41=function(_0x31114c,_0x39e7be){_0x31114c=_0x31114c-0x0;var _0x39ea34=_0xf41c[_0x31114c];return _0x39ea34;};'use strict';var _=require(_0xcf41('0x0'));var util=require(_0xcf41('0x1'));var logger=require(_0xcf41('0x2'))('api');var moment=require(_0xcf41('0x3'));var BPromise=require(_0xcf41('0x4'));var rp=require(_0xcf41('0x5'));var fs=require('fs');var path=require(_0xcf41('0x6'));var rimraf=require(_0xcf41('0x7'));var config=require(_0xcf41('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0xcf41('0x9')]=function(_0x54e807,_0xb6a61){return _0x54e807[_0xcf41('0xa')](_0xcf41('0xb'),attributes,{'tableName':_0xcf41('0xc'),'paranoid':![],'indexes':[{'name':_0xcf41('0xd'),'fields':[_0xcf41('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfae0=['../../config/logger','api','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','lodash'];(function(_0x3a0cbe,_0x3e8f5a){var _0x2eeecc=function(_0x541c36){while(--_0x541c36){_0x3a0cbe['push'](_0x3a0cbe['shift']());}};_0x2eeecc(++_0x3e8f5a);}(_0xfae0,0x154));var _0x0fae=function(_0x52753e,_0x1718bc){_0x52753e=_0x52753e-0x0;var _0x5b2cd5=_0xfae0[_0x52753e];return _0x5b2cd5;};'use strict';var _=require(_0x0fae('0x0'));var util=require('util');var logger=require(_0x0fae('0x1'))(_0x0fae('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0fae('0x3'));var fs=require('fs');var path=require(_0x0fae('0x4'));var rimraf=require('rimraf');var config=require(_0x0fae('0x5'));var attributes=require(_0x0fae('0x6'));module[_0x0fae('0x7')]=function(_0x2e10bf,_0x402886){return _0x2e10bf[_0x0fae('0x8')](_0x0fae('0x9'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x0fae('0xa'),'fields':[_0x0fae('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 343f4f5..16cc2cf 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 _0x2d33=['catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','UpdateWhatsappQueueReport','update','body','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x4934b3,_0x479b1c){var _0x202e51=function(_0x250228){while(--_0x250228){_0x4934b3['push'](_0x4934b3['shift']());}};_0x202e51(++_0x479b1c);}(_0x2d33,0x17e));var _0x32d3=function(_0x1e2372,_0x2ea876){_0x1e2372=_0x1e2372-0x0;var _0x4cd59b=_0x2d33[_0x1e2372];return _0x4cd59b;};'use strict';var _=require(_0x32d3('0x0'));var util=require(_0x32d3('0x1'));var moment=require(_0x32d3('0x2'));var BPromise=require('bluebird');var rs=require(_0x32d3('0x3'));var fs=require('fs');var Redis=require(_0x32d3('0x4'));var db=require(_0x32d3('0x5'))['db'];var utils=require(_0x32d3('0x6'));var logger=require(_0x32d3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x32d3('0x8'));var client=jayson[_0x32d3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b1b1c,_0x180324,_0x23d72c){return new BPromise(function(_0x3f68e3,_0x4b94fe){return client[_0x32d3('0xa')](_0x1b1b1c,_0x23d72c)['then'](function(_0x26f9b9){logger['info'](_0x32d3('0xb'),_0x180324,_0x32d3('0xc'));logger[_0x32d3('0xd')](_0x32d3('0xe'),_0x180324,_0x32d3('0xc'),JSON[_0x32d3('0xf')](_0x26f9b9));if(_0x26f9b9['error']){if(_0x26f9b9[_0x32d3('0x10')][_0x32d3('0x11')]===0x1f4){logger[_0x32d3('0x10')](_0x32d3('0xb'),_0x180324,_0x26f9b9[_0x32d3('0x10')]['message']);return _0x4b94fe(_0x26f9b9[_0x32d3('0x10')][_0x32d3('0x12')]);}logger[_0x32d3('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x180324,_0x26f9b9[_0x32d3('0x10')][_0x32d3('0x12')]);return _0x3f68e3(_0x26f9b9[_0x32d3('0x10')][_0x32d3('0x12')]);}else{logger[_0x32d3('0x13')](_0x32d3('0xb'),_0x180324,_0x32d3('0xc'));_0x3f68e3(_0x26f9b9[_0x32d3('0x14')]['message']);}})[_0x32d3('0x15')](function(_0x346875){logger[_0x32d3('0x10')](_0x32d3('0xb'),_0x180324,_0x346875);_0x4b94fe(_0x346875);});});}exports[_0x32d3('0x16')]=function(_0x207075){var _0x1e0575=this;return new Promise(function(_0x361706,_0xe1c8c6){return db[_0x32d3('0x17')][_0x32d3('0x18')](_0x207075['body'],{'raw':_0x207075[_0x32d3('0x19')]?_0x207075[_0x32d3('0x19')][_0x32d3('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x8cb7db){logger['info'](_0x32d3('0x16'),_0x207075);logger[_0x32d3('0xd')]('CreateWhatsappQueueReport',_0x207075,JSON[_0x32d3('0xf')](_0x8cb7db));_0x361706(_0x8cb7db);})[_0x32d3('0x15')](function(_0x2b051c){logger[_0x32d3('0x10')](_0x32d3('0x16'),_0x2b051c[_0x32d3('0x12')],_0x207075);_0xe1c8c6(_0x1e0575['error'](0x1f4,_0x2b051c[_0x32d3('0x12')]));});});};exports[_0x32d3('0x1b')]=function(_0x2088d0){var _0x656423=this;return new Promise(function(_0x3e5dcf,_0xb4f64a){return db[_0x32d3('0x17')][_0x32d3('0x1c')](_0x2088d0[_0x32d3('0x1d')],{'raw':_0x2088d0['options']?_0x2088d0[_0x32d3('0x19')][_0x32d3('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2088d0[_0x32d3('0x19')]?_0x2088d0[_0x32d3('0x19')]['where']||null:null,'attributes':_0x2088d0[_0x32d3('0x19')]?_0x2088d0[_0x32d3('0x19')]['attributes']||null:null,'limit':_0x2088d0[_0x32d3('0x19')]?_0x2088d0['options'][_0x32d3('0x1e')]||null:null})['then'](function(_0x4beac0){logger[_0x32d3('0x13')](_0x32d3('0x1b'),_0x2088d0);logger[_0x32d3('0xd')](_0x32d3('0x1b'),_0x2088d0,JSON[_0x32d3('0xf')](_0x4beac0));_0x3e5dcf(_0x4beac0);})['catch'](function(_0x51d5b2){logger['error'](_0x32d3('0x1b'),_0x51d5b2[_0x32d3('0x12')],_0x2088d0);_0xb4f64a(_0x656423[_0x32d3('0x10')](0x1f4,_0x51d5b2[_0x32d3('0x12')]));});});}; \ No newline at end of file +var _0x1a20=['http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','stringify','update','where','attributes','limit','UpdateWhatsappQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client'];(function(_0x9213a5,_0x5aeddb){var _0x31353c=function(_0x50eaa6){while(--_0x50eaa6){_0x9213a5['push'](_0x9213a5['shift']());}};_0x31353c(++_0x5aeddb);}(_0x1a20,0x14b));var _0x01a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1a20[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x01a2('0x0'));var moment=require(_0x01a2('0x1'));var BPromise=require(_0x01a2('0x2'));var rs=require(_0x01a2('0x3'));var fs=require('fs');var Redis=require(_0x01a2('0x4'));var db=require(_0x01a2('0x5'))['db'];var utils=require(_0x01a2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x01a2('0x7'));var client=jayson[_0x01a2('0x8')][_0x01a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d9015,_0xa6268c,_0x2c9849){return new BPromise(function(_0x11fe2f,_0x52d216){return client[_0x01a2('0xa')](_0x4d9015,_0x2c9849)[_0x01a2('0xb')](function(_0x28b0db){logger[_0x01a2('0xc')](_0x01a2('0xd'),_0xa6268c,_0x01a2('0xe'));logger[_0x01a2('0xf')](_0x01a2('0x10'),_0xa6268c,_0x01a2('0xe'),JSON['stringify'](_0x28b0db));if(_0x28b0db[_0x01a2('0x11')]){if(_0x28b0db[_0x01a2('0x11')][_0x01a2('0x12')]===0x1f4){logger['error'](_0x01a2('0xd'),_0xa6268c,_0x28b0db['error']['message']);return _0x52d216(_0x28b0db[_0x01a2('0x11')]['message']);}logger['error'](_0x01a2('0xd'),_0xa6268c,_0x28b0db[_0x01a2('0x11')][_0x01a2('0x13')]);return _0x11fe2f(_0x28b0db[_0x01a2('0x11')][_0x01a2('0x13')]);}else{logger[_0x01a2('0xc')](_0x01a2('0xd'),_0xa6268c,'request\x20sent');_0x11fe2f(_0x28b0db[_0x01a2('0x14')][_0x01a2('0x13')]);}})[_0x01a2('0x15')](function(_0x13418a){logger['error'](_0x01a2('0xd'),_0xa6268c,_0x13418a);_0x52d216(_0x13418a);});});}exports['CreateWhatsappQueueReport']=function(_0x2feba7){var _0x1bee86=this;return new Promise(function(_0x55cd82,_0x276ed6){return db[_0x01a2('0x16')][_0x01a2('0x17')](_0x2feba7[_0x01a2('0x18')],{'raw':_0x2feba7[_0x01a2('0x19')]?_0x2feba7['options'][_0x01a2('0x1a')]===undefined?!![]:![]:!![]})[_0x01a2('0xb')](function(_0x8d99ee){logger[_0x01a2('0xc')](_0x01a2('0x1b'),_0x2feba7);logger[_0x01a2('0xf')](_0x01a2('0x1b'),_0x2feba7,JSON[_0x01a2('0x1c')](_0x8d99ee));_0x55cd82(_0x8d99ee);})['catch'](function(_0x2bcb54){logger[_0x01a2('0x11')](_0x01a2('0x1b'),_0x2bcb54[_0x01a2('0x13')],_0x2feba7);_0x276ed6(_0x1bee86[_0x01a2('0x11')](0x1f4,_0x2bcb54['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0xf21449){var _0x8975b6=this;return new Promise(function(_0x3cb414,_0x1dd541){return db[_0x01a2('0x16')][_0x01a2('0x1d')](_0xf21449[_0x01a2('0x18')],{'raw':_0xf21449[_0x01a2('0x19')]?_0xf21449[_0x01a2('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf21449[_0x01a2('0x19')]?_0xf21449['options'][_0x01a2('0x1e')]||null:null,'attributes':_0xf21449[_0x01a2('0x19')]?_0xf21449[_0x01a2('0x19')][_0x01a2('0x1f')]||null:null,'limit':_0xf21449[_0x01a2('0x19')]?_0xf21449[_0x01a2('0x19')][_0x01a2('0x20')]||null:null})[_0x01a2('0xb')](function(_0x32e420){logger[_0x01a2('0xc')](_0x01a2('0x21'),_0xf21449);logger['debug'](_0x01a2('0x21'),_0xf21449,JSON['stringify'](_0x32e420));_0x3cb414(_0x32e420);})[_0x01a2('0x15')](function(_0x3f0531){logger[_0x01a2('0x11')](_0x01a2('0x21'),_0x3f0531[_0x01a2('0x13')],_0xf21449);_0x1dd541(_0x8975b6['error'](0x1f4,_0x3f0531[_0x01a2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 09bea4c..60feb6c 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 _0x38c4=['/describe','describe','show','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x5f2a0d,_0x305eb1){var _0x4f38dc=function(_0x2653af){while(--_0x2653af){_0x5f2a0d['push'](_0x5f2a0d['shift']());}};_0x4f38dc(++_0x305eb1);}(_0x38c4,0x7a));var _0x438c=function(_0x101f71,_0x1eb4d1){_0x101f71=_0x101f71-0x0;var _0x5012ff=_0x38c4[_0x101f71];return _0x5012ff;};'use strict';var multer=require('multer');var util=require(_0x438c('0x0'));var path=require(_0x438c('0x1'));var timeout=require(_0x438c('0x2'));var express=require(_0x438c('0x3'));var router=express[_0x438c('0x4')]();var fs_extra=require(_0x438c('0x5'));var auth=require(_0x438c('0x6'));var interaction=require(_0x438c('0x7'));var config=require(_0x438c('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0x438c('0x9')]('/',auth['isAuthenticated'](),controller[_0x438c('0xa')]);router[_0x438c('0x9')](_0x438c('0xb'),auth['isAuthenticated'](),controller[_0x438c('0xc')]);router[_0x438c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x438c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x438c('0xe')]);router['put'](_0x438c('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x438c('0x10')](_0x438c('0xf'),auth['isAuthenticated'](),controller[_0x438c('0x11')]);module[_0x438c('0x12')]=router; \ No newline at end of file +var _0xe454=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','update','delete'];(function(_0x5703a6,_0x278b59){var _0x3823f9=function(_0x59e20a){while(--_0x59e20a){_0x5703a6['push'](_0x5703a6['shift']());}};_0x3823f9(++_0x278b59);}(_0xe454,0x66));var _0x4e45=function(_0x5d0f93,_0x14703c){_0x5d0f93=_0x5d0f93-0x0;var _0x5b4632=_0xe454[_0x5d0f93];return _0x5b4632;};'use strict';var multer=require(_0x4e45('0x0'));var util=require('util');var path=require(_0x4e45('0x1'));var timeout=require(_0x4e45('0x2'));var express=require(_0x4e45('0x3'));var router=express[_0x4e45('0x4')]();var fs_extra=require(_0x4e45('0x5'));var auth=require(_0x4e45('0x6'));var interaction=require(_0x4e45('0x7'));var config=require(_0x4e45('0x8'));var controller=require('./whatsappTransferReport.controller');router[_0x4e45('0x9')]('/',auth['isAuthenticated'](),controller[_0x4e45('0xa')]);router[_0x4e45('0x9')](_0x4e45('0xb'),auth[_0x4e45('0xc')](),controller[_0x4e45('0xd')]);router[_0x4e45('0x9')](_0x4e45('0xe'),auth[_0x4e45('0xc')](),controller[_0x4e45('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x4e45('0xe'),auth[_0x4e45('0xc')](),controller[_0x4e45('0x10')]);router[_0x4e45('0x11')](_0x4e45('0xe'),auth[_0x4e45('0xc')](),controller[_0x4e45('0x12')]);module[_0x4e45('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index b85dbda..f51469a 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 _0x6df9=['sequelize','exports','ENUM','queue'];(function(_0x18758b,_0xdacc5){var _0x505b72=function(_0x266111){while(--_0x266111){_0x18758b['push'](_0x18758b['shift']());}};_0x505b72(++_0xdacc5);}(_0x6df9,0x84));var _0x96df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6df9[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x96df('0x0'));module[_0x96df('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x96df('0x2')]('account','agent',_0x96df('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x373d=['agent','DATE','sequelize','STRING','ENUM','account'];(function(_0x5d9ca3,_0x25f0d3){var _0x3c70f4=function(_0x1f3360){while(--_0x1f3360){_0x5d9ca3['push'](_0x5d9ca3['shift']());}};_0x3c70f4(++_0x25f0d3);}(_0x373d,0x1e2));var _0xd373=function(_0x46ee6b,_0x7f3e6c){_0x46ee6b=_0x46ee6b-0x0;var _0x97d54b=_0x373d[_0x46ee6b];return _0x97d54b;};'use strict';var Sequelize=require(_0xd373('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd373('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd373('0x2')](_0xd373('0x3'),_0xd373('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xd373('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 7794bd0..07c4182 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 _0xa161=['create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','apply','reject','save','update','then','sendStatus','error','name','send','map','WhatsappTransferReport','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0xa161,0x1bf));var _0x1a16=function(_0x1ff8c1,_0x485f98){_0x1ff8c1=_0x1ff8c1-0x0;var _0x528e4c=_0xa161[_0x1ff8c1];return _0x528e4c;};'use strict';var emlformat=require(_0x1a16('0x0'));var rimraf=require(_0x1a16('0x1'));var zipdir=require(_0x1a16('0x2'));var jsonpatch=require(_0x1a16('0x3'));var rp=require('request-promise');var moment=require(_0x1a16('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1a16('0x5'));var util=require(_0x1a16('0x6'));var path=require(_0x1a16('0x7'));var sox=require(_0x1a16('0x8'));var csv=require(_0x1a16('0x9'));var ejs=require(_0x1a16('0xa'));var fs=require('fs');var fs_extra=require(_0x1a16('0xb'));var _=require(_0x1a16('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a16('0xd'));var deskjs=require(_0x1a16('0xe'));var toCsv=require(_0x1a16('0x9'));var querystring=require('querystring');var Papa=require(_0x1a16('0xf'));var Redis=require('ioredis');var authService=require(_0x1a16('0x10'));var qs=require(_0x1a16('0x11'));var as=require(_0x1a16('0x12'));var hardwareService=require(_0x1a16('0x13'));var logger=require(_0x1a16('0x14'))(_0x1a16('0x15'));var utils=require(_0x1a16('0x16'));var config=require(_0x1a16('0x17'));var licenseUtil=require(_0x1a16('0x18'));var db=require(_0x1a16('0x19'))['db'];function respondWithStatusCode(_0x1a846d,_0x36a52a){_0x36a52a=_0x36a52a||0xcc;return function(_0x33ebed){if(_0x33ebed){return _0x1a846d['sendStatus'](_0x36a52a);}return _0x1a846d[_0x1a16('0x1a')](_0x36a52a)[_0x1a16('0x1b')]();};}function respondWithResult(_0x2d29b8,_0x5614aa){_0x5614aa=_0x5614aa||0xc8;return function(_0x2a445f){if(_0x2a445f){return _0x2d29b8[_0x1a16('0x1a')](_0x5614aa)['json'](_0x2a445f);}};}function respondWithFilteredResult(_0x1bedb3,_0x55f63a){return function(_0x6e004a){if(_0x6e004a){var _0x1e59a2=typeof _0x55f63a['offset']==='undefined'&&typeof _0x55f63a[_0x1a16('0x1c')]===_0x1a16('0x1d');var _0x33da16=_0x6e004a[_0x1a16('0x1e')];var _0x2afd75=_0x1e59a2?0x0:_0x55f63a[_0x1a16('0x1f')];var _0x369d2c=_0x1e59a2?_0x6e004a['count']:_0x55f63a[_0x1a16('0x1f')]+_0x55f63a['limit'];var _0x44f885;if(_0x369d2c>=_0x33da16){_0x369d2c=_0x33da16;_0x44f885=0xc8;}else{_0x44f885=0xce;}_0x1bedb3[_0x1a16('0x1a')](_0x44f885);return _0x1bedb3['set']('Content-Range',_0x2afd75+'-'+_0x369d2c+'/'+_0x33da16)['json'](_0x6e004a);}return null;};}function patchUpdates(_0x1dbee8){return function(_0xa394e9){try{jsonpatch[_0x1a16('0x20')](_0xa394e9,_0x1dbee8,!![]);}catch(_0x4e1c3a){return BPromise[_0x1a16('0x21')](_0x4e1c3a);}return _0xa394e9[_0x1a16('0x22')]();};}function saveUpdates(_0x6fe317,_0xd1ef26){return function(_0x19f8f2){if(_0x19f8f2){return _0x19f8f2[_0x1a16('0x23')](_0x6fe317)[_0x1a16('0x24')](function(_0x43d864){return _0x43d864;});}return null;};}function removeEntity(_0x4d2ebe,_0x55fdf9){return function(_0x4730ee){if(_0x4730ee){return _0x4730ee['destroy']()['then'](function(){_0x4d2ebe[_0x1a16('0x1a')](0xcc)[_0x1a16('0x1b')]();});}};}function handleEntityNotFound(_0x15e02d,_0x3a92a7){return function(_0x2718c0){if(!_0x2718c0){_0x15e02d[_0x1a16('0x25')](0x194);}return _0x2718c0;};}function handleError(_0x3991a6,_0x16ff23){_0x16ff23=_0x16ff23||0x1f4;return function(_0x563343){logger[_0x1a16('0x26')](_0x563343['stack']);if(_0x563343[_0x1a16('0x27')]){delete _0x563343[_0x1a16('0x27')];}_0x3991a6[_0x1a16('0x1a')](_0x16ff23)[_0x1a16('0x28')](_0x563343);};}exports['index']=function(_0x60b051,_0x2999a4){var _0x178139={},_0x24c014={},_0xade469={'count':0x0,'rows':[]};var _0x2ba7f8=_[_0x1a16('0x29')](db[_0x1a16('0x2a')]['rawAttributes'],function(_0x4447ba){return{'name':_0x4447ba[_0x1a16('0x2b')],'type':_0x4447ba[_0x1a16('0x2c')][_0x1a16('0x2d')]};});_0x24c014[_0x1a16('0x2e')]=_[_0x1a16('0x29')](_0x2ba7f8,_0x1a16('0x27'));_0x24c014['query']=_[_0x1a16('0x2f')](_0x60b051['query']);_0x24c014['filters']=_[_0x1a16('0x30')](_0x24c014[_0x1a16('0x2e')],_0x24c014[_0x1a16('0x31')]);_0x178139['attributes']=_[_0x1a16('0x30')](_0x24c014[_0x1a16('0x2e')],qs[_0x1a16('0x32')](_0x60b051[_0x1a16('0x31')][_0x1a16('0x32')]));_0x178139['attributes']=_0x178139[_0x1a16('0x33')][_0x1a16('0x34')]?_0x178139[_0x1a16('0x33')]:_0x24c014[_0x1a16('0x2e')];if(!_0x60b051['query'][_0x1a16('0x35')](_0x1a16('0x36'))){_0x178139[_0x1a16('0x1c')]=qs['limit'](_0x60b051[_0x1a16('0x31')][_0x1a16('0x1c')]);_0x178139[_0x1a16('0x1f')]=qs['offset'](_0x60b051['query'][_0x1a16('0x1f')]);}_0x178139['order']=qs['sort'](_0x60b051[_0x1a16('0x31')][_0x1a16('0x37')]);_0x178139['where']=qs[_0x1a16('0x38')](_[_0x1a16('0x39')](_0x60b051[_0x1a16('0x31')],_0x24c014[_0x1a16('0x38')]),_0x2ba7f8);if(_0x60b051['query'][_0x1a16('0x3a')]){_0x178139[_0x1a16('0x3b')]=_['merge'](_0x178139[_0x1a16('0x3b')],{'$or':_['map'](_0x2ba7f8,function(_0xca6efd){if(_0xca6efd[_0x1a16('0x2c')]!=='VIRTUAL'){var _0x10dccd={};_0x10dccd[_0xca6efd[_0x1a16('0x27')]]={'$like':'%'+_0x60b051[_0x1a16('0x31')][_0x1a16('0x3a')]+'%'};return _0x10dccd;}})});}_0x178139=_[_0x1a16('0x3c')]({},_0x178139,_0x60b051[_0x1a16('0x3d')]);var _0x5658b2={'where':_0x178139[_0x1a16('0x3b')]};return db[_0x1a16('0x2a')][_0x1a16('0x1e')](_0x5658b2)[_0x1a16('0x24')](function(_0x34c688){_0xade469[_0x1a16('0x1e')]=_0x34c688;if(_0x60b051[_0x1a16('0x31')][_0x1a16('0x3e')]){_0x178139[_0x1a16('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x1a16('0x40')](_0x178139);})[_0x1a16('0x24')](function(_0x5fa084){_0xade469[_0x1a16('0x41')]=_0x5fa084;return _0xade469;})[_0x1a16('0x24')](respondWithFilteredResult(_0x2999a4,_0x178139))[_0x1a16('0x42')](handleError(_0x2999a4,null));};exports[_0x1a16('0x43')]=function(_0x4afbcd,_0x40fcaa){var _0xf6f02={'raw':!![],'where':{'id':_0x4afbcd[_0x1a16('0x44')]['id']}},_0x39f37a={};_0x39f37a[_0x1a16('0x2e')]=_[_0x1a16('0x2f')](db[_0x1a16('0x2a')][_0x1a16('0x45')]);_0x39f37a[_0x1a16('0x31')]=_[_0x1a16('0x2f')](_0x4afbcd[_0x1a16('0x31')]);_0x39f37a[_0x1a16('0x38')]=_['intersection'](_0x39f37a['model'],_0x39f37a[_0x1a16('0x31')]);_0xf6f02[_0x1a16('0x33')]=_[_0x1a16('0x30')](_0x39f37a[_0x1a16('0x2e')],qs[_0x1a16('0x32')](_0x4afbcd[_0x1a16('0x31')][_0x1a16('0x32')]));_0xf6f02[_0x1a16('0x33')]=_0xf6f02['attributes'][_0x1a16('0x34')]?_0xf6f02[_0x1a16('0x33')]:_0x39f37a[_0x1a16('0x2e')];if(_0x4afbcd['query'][_0x1a16('0x3e')]){_0xf6f02[_0x1a16('0x3f')]=[{'all':!![]}];}_0xf6f02=_[_0x1a16('0x3c')]({},_0xf6f02,_0x4afbcd[_0x1a16('0x3d')]);return db[_0x1a16('0x2a')][_0x1a16('0x46')](_0xf6f02)[_0x1a16('0x24')](handleEntityNotFound(_0x40fcaa,null))['then'](respondWithResult(_0x40fcaa,null))[_0x1a16('0x42')](handleError(_0x40fcaa,null));};exports[_0x1a16('0x47')]=function(_0x163a58,_0x568579){return db['WhatsappTransferReport'][_0x1a16('0x47')](_0x163a58[_0x1a16('0x48')],{})[_0x1a16('0x24')](respondWithResult(_0x568579,0xc9))[_0x1a16('0x42')](handleError(_0x568579,null));};exports[_0x1a16('0x23')]=function(_0x59c853,_0x2f97bb){if(_0x59c853[_0x1a16('0x48')]['id']){delete _0x59c853[_0x1a16('0x48')]['id'];}return db['WhatsappTransferReport'][_0x1a16('0x46')]({'where':{'id':_0x59c853[_0x1a16('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f97bb,null))[_0x1a16('0x24')](saveUpdates(_0x59c853[_0x1a16('0x48')],null))['then'](respondWithResult(_0x2f97bb,null))[_0x1a16('0x42')](handleError(_0x2f97bb,null));};exports['destroy']=function(_0x466a2a,_0x4ad3bf){return db['WhatsappTransferReport'][_0x1a16('0x46')]({'where':{'id':_0x466a2a[_0x1a16('0x44')]['id']}})[_0x1a16('0x24')](handleEntityNotFound(_0x4ad3bf,null))[_0x1a16('0x24')](removeEntity(_0x4ad3bf,null))[_0x1a16('0x42')](handleError(_0x4ad3bf,null));};exports['describe']=function(_0x340b9f,_0x3272e4){return db[_0x1a16('0x2a')][_0x1a16('0x49')]()['then'](respondWithResult(_0x3272e4,null))[_0x1a16('0x42')](handleError(_0x3272e4,null));}; \ No newline at end of file +var _0x0554=['offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','map','WhatsappTransferReport','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','include','findAll','catch','rawAttributes','length','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','json'];(function(_0x46369a,_0x141daa){var _0x59e91d=function(_0x141fa3){while(--_0x141fa3){_0x46369a['push'](_0x46369a['shift']());}};_0x59e91d(++_0x141daa);}(_0x0554,0x176));var _0x4055=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0554[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x4055('0x0'));var rimraf=require(_0x4055('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4055('0x2'));var rp=require('request-promise');var moment=require(_0x4055('0x3'));var BPromise=require(_0x4055('0x4'));var Mustache=require(_0x4055('0x5'));var util=require(_0x4055('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4055('0x7'));var ejs=require(_0x4055('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4055('0x9'));var crypto=require(_0x4055('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4055('0xb'));var toCsv=require(_0x4055('0x7'));var querystring=require('querystring');var Papa=require(_0x4055('0xc'));var Redis=require(_0x4055('0xd'));var authService=require(_0x4055('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4055('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4055('0x10'))(_0x4055('0x11'));var utils=require(_0x4055('0x12'));var config=require(_0x4055('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44b64b,_0x5b019c){_0x5b019c=_0x5b019c||0xcc;return function(_0x4a6960){if(_0x4a6960){return _0x44b64b['sendStatus'](_0x5b019c);}return _0x44b64b[_0x4055('0x14')](_0x5b019c)['end']();};}function respondWithResult(_0x4abacb,_0x12edc9){_0x12edc9=_0x12edc9||0xc8;return function(_0x105b69){if(_0x105b69){return _0x4abacb[_0x4055('0x14')](_0x12edc9)[_0x4055('0x15')](_0x105b69);}};}function respondWithFilteredResult(_0x2b434a,_0x4ef6e5){return function(_0xade709){if(_0xade709){var _0x291d4e=typeof _0x4ef6e5[_0x4055('0x16')]==='undefined'&&typeof _0x4ef6e5[_0x4055('0x17')]===_0x4055('0x18');var _0x3de065=_0xade709[_0x4055('0x19')];var _0x256896=_0x291d4e?0x0:_0x4ef6e5[_0x4055('0x16')];var _0x57fc4a=_0x291d4e?_0xade709[_0x4055('0x19')]:_0x4ef6e5[_0x4055('0x16')]+_0x4ef6e5[_0x4055('0x17')];var _0xf8e995;if(_0x57fc4a>=_0x3de065){_0x57fc4a=_0x3de065;_0xf8e995=0xc8;}else{_0xf8e995=0xce;}_0x2b434a[_0x4055('0x14')](_0xf8e995);return _0x2b434a['set'](_0x4055('0x1a'),_0x256896+'-'+_0x57fc4a+'/'+_0x3de065)[_0x4055('0x15')](_0xade709);}return null;};}function patchUpdates(_0x59dbdc){return function(_0x45e279){try{jsonpatch[_0x4055('0x1b')](_0x45e279,_0x59dbdc,!![]);}catch(_0x7a7c15){return BPromise[_0x4055('0x1c')](_0x7a7c15);}return _0x45e279[_0x4055('0x1d')]();};}function saveUpdates(_0x1fc087,_0x779021){return function(_0x2e0d57){if(_0x2e0d57){return _0x2e0d57[_0x4055('0x1e')](_0x1fc087)[_0x4055('0x1f')](function(_0x2182f4){return _0x2182f4;});}return null;};}function removeEntity(_0x3c961e,_0x5838d1){return function(_0x35b599){if(_0x35b599){return _0x35b599['destroy']()['then'](function(){_0x3c961e[_0x4055('0x14')](0xcc)[_0x4055('0x20')]();});}};}function handleEntityNotFound(_0x130440,_0x785ba3){return function(_0x1c0c52){if(!_0x1c0c52){_0x130440[_0x4055('0x21')](0x194);}return _0x1c0c52;};}function handleError(_0x50c85c,_0x185f0b){_0x185f0b=_0x185f0b||0x1f4;return function(_0x2df9bf){logger[_0x4055('0x22')](_0x2df9bf[_0x4055('0x23')]);if(_0x2df9bf[_0x4055('0x24')]){delete _0x2df9bf[_0x4055('0x24')];}_0x50c85c[_0x4055('0x14')](_0x185f0b)[_0x4055('0x25')](_0x2df9bf);};}exports['index']=function(_0x4c78df,_0x657e51){var _0x115487={},_0xf88855={},_0x1e1b7e={'count':0x0,'rows':[]};var _0x31379b=_[_0x4055('0x26')](db[_0x4055('0x27')]['rawAttributes'],function(_0x3e3540){return{'name':_0x3e3540['fieldName'],'type':_0x3e3540[_0x4055('0x28')][_0x4055('0x29')]};});_0xf88855[_0x4055('0x2a')]=_[_0x4055('0x26')](_0x31379b,_0x4055('0x24'));_0xf88855[_0x4055('0x2b')]=_[_0x4055('0x2c')](_0x4c78df[_0x4055('0x2b')]);_0xf88855['filters']=_[_0x4055('0x2d')](_0xf88855[_0x4055('0x2a')],_0xf88855['query']);_0x115487['attributes']=_[_0x4055('0x2d')](_0xf88855[_0x4055('0x2a')],qs[_0x4055('0x2e')](_0x4c78df[_0x4055('0x2b')]['fields']));_0x115487[_0x4055('0x2f')]=_0x115487[_0x4055('0x2f')]['length']?_0x115487['attributes']:_0xf88855['model'];if(!_0x4c78df['query'][_0x4055('0x30')](_0x4055('0x31'))){_0x115487[_0x4055('0x17')]=qs[_0x4055('0x17')](_0x4c78df['query'][_0x4055('0x17')]);_0x115487[_0x4055('0x16')]=qs[_0x4055('0x16')](_0x4c78df['query']['offset']);}_0x115487['order']=qs[_0x4055('0x32')](_0x4c78df['query'][_0x4055('0x32')]);_0x115487[_0x4055('0x33')]=qs[_0x4055('0x34')](_['pick'](_0x4c78df[_0x4055('0x2b')],_0xf88855[_0x4055('0x34')]),_0x31379b);if(_0x4c78df[_0x4055('0x2b')][_0x4055('0x35')]){_0x115487[_0x4055('0x33')]=_[_0x4055('0x36')](_0x115487[_0x4055('0x33')],{'$or':_[_0x4055('0x26')](_0x31379b,function(_0x1ee3d1){if(_0x1ee3d1[_0x4055('0x28')]!=='VIRTUAL'){var _0x394771={};_0x394771[_0x1ee3d1[_0x4055('0x24')]]={'$like':'%'+_0x4c78df[_0x4055('0x2b')]['filter']+'%'};return _0x394771;}})});}_0x115487=_['merge']({},_0x115487,_0x4c78df[_0x4055('0x37')]);var _0x177f69={'where':_0x115487['where']};return db[_0x4055('0x27')]['count'](_0x177f69)[_0x4055('0x1f')](function(_0x13a8f6){_0x1e1b7e[_0x4055('0x19')]=_0x13a8f6;if(_0x4c78df['query']['includeAll']){_0x115487[_0x4055('0x38')]=[{'all':!![]}];}return db[_0x4055('0x27')][_0x4055('0x39')](_0x115487);})[_0x4055('0x1f')](function(_0x4f762e){_0x1e1b7e['rows']=_0x4f762e;return _0x1e1b7e;})[_0x4055('0x1f')](respondWithFilteredResult(_0x657e51,_0x115487))[_0x4055('0x3a')](handleError(_0x657e51,null));};exports['show']=function(_0x25e6f8,_0x47ccdf){var _0x1849a1={'raw':!![],'where':{'id':_0x25e6f8['params']['id']}},_0x3a0b10={};_0x3a0b10[_0x4055('0x2a')]=_[_0x4055('0x2c')](db[_0x4055('0x27')][_0x4055('0x3b')]);_0x3a0b10[_0x4055('0x2b')]=_['keys'](_0x25e6f8[_0x4055('0x2b')]);_0x3a0b10[_0x4055('0x34')]=_[_0x4055('0x2d')](_0x3a0b10[_0x4055('0x2a')],_0x3a0b10['query']);_0x1849a1[_0x4055('0x2f')]=_[_0x4055('0x2d')](_0x3a0b10[_0x4055('0x2a')],qs['fields'](_0x25e6f8[_0x4055('0x2b')][_0x4055('0x2e')]));_0x1849a1[_0x4055('0x2f')]=_0x1849a1[_0x4055('0x2f')][_0x4055('0x3c')]?_0x1849a1['attributes']:_0x3a0b10[_0x4055('0x2a')];if(_0x25e6f8[_0x4055('0x2b')]['includeAll']){_0x1849a1['include']=[{'all':!![]}];}_0x1849a1=_[_0x4055('0x36')]({},_0x1849a1,_0x25e6f8[_0x4055('0x37')]);return db[_0x4055('0x27')]['find'](_0x1849a1)[_0x4055('0x1f')](handleEntityNotFound(_0x47ccdf,null))[_0x4055('0x1f')](respondWithResult(_0x47ccdf,null))[_0x4055('0x3a')](handleError(_0x47ccdf,null));};exports[_0x4055('0x3d')]=function(_0x30e9dd,_0x418b08){return db[_0x4055('0x27')]['create'](_0x30e9dd['body'],{})['then'](respondWithResult(_0x418b08,0xc9))['catch'](handleError(_0x418b08,null));};exports[_0x4055('0x1e')]=function(_0x2ef34d,_0x386bcc){if(_0x2ef34d[_0x4055('0x3e')]['id']){delete _0x2ef34d[_0x4055('0x3e')]['id'];}return db[_0x4055('0x27')][_0x4055('0x3f')]({'where':{'id':_0x2ef34d[_0x4055('0x40')]['id']}})['then'](handleEntityNotFound(_0x386bcc,null))[_0x4055('0x1f')](saveUpdates(_0x2ef34d[_0x4055('0x3e')],null))[_0x4055('0x1f')](respondWithResult(_0x386bcc,null))[_0x4055('0x3a')](handleError(_0x386bcc,null));};exports['destroy']=function(_0x4b907b,_0x195a5e){return db[_0x4055('0x27')][_0x4055('0x3f')]({'where':{'id':_0x4b907b['params']['id']}})[_0x4055('0x1f')](handleEntityNotFound(_0x195a5e,null))[_0x4055('0x1f')](removeEntity(_0x195a5e,null))[_0x4055('0x3a')](handleError(_0x195a5e,null));};exports[_0x4055('0x41')]=function(_0x45c918,_0x10f9f2){return db[_0x4055('0x27')]['describe']()[_0x4055('0x1f')](respondWithResult(_0x10f9f2,null))[_0x4055('0x3a')](handleError(_0x10f9f2,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 6dd171d..9331ab9 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 _0x5f0d=['api','moment','bluebird','request-promise','path','rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0xa72ce,_0xdaaef8){var _0x41a95b=function(_0x842109){while(--_0x842109){_0xa72ce['push'](_0xa72ce['shift']());}};_0x41a95b(++_0xdaaef8);}(_0x5f0d,0x66));var _0xd5f0=function(_0x55b305,_0xb048cd){_0x55b305=_0x55b305-0x0;var _0x110ddd=_0x5f0d[_0x55b305];return _0x110ddd;};'use strict';var _=require(_0xd5f0('0x0'));var util=require(_0xd5f0('0x1'));var logger=require(_0xd5f0('0x2'))(_0xd5f0('0x3'));var moment=require(_0xd5f0('0x4'));var BPromise=require(_0xd5f0('0x5'));var rp=require(_0xd5f0('0x6'));var fs=require('fs');var path=require(_0xd5f0('0x7'));var rimraf=require(_0xd5f0('0x8'));var config=require('../../config/environment');var attributes=require(_0xd5f0('0x9'));module[_0xd5f0('0xa')]=function(_0x38e9db,_0x114e5e){return _0x38e9db[_0xd5f0('0xb')](_0xd5f0('0xc'),attributes,{'tableName':_0xd5f0('0xd'),'paranoid':![],'indexes':[{'name':_0xd5f0('0xe'),'fields':[_0xd5f0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x230b=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x37c3f5,_0x252425){var _0x3f6584=function(_0x282b82){while(--_0x282b82){_0x37c3f5['push'](_0x37c3f5['shift']());}};_0x3f6584(++_0x252425);}(_0x230b,0x7c));var _0xb230=function(_0x14d1e1,_0x9ab9ba){_0x14d1e1=_0x14d1e1-0x0;var _0x58f075=_0x230b[_0x14d1e1];return _0x58f075;};'use strict';var _=require(_0xb230('0x0'));var util=require(_0xb230('0x1'));var logger=require(_0xb230('0x2'))('api');var moment=require(_0xb230('0x3'));var BPromise=require(_0xb230('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb230('0x5'));var rimraf=require(_0xb230('0x6'));var config=require(_0xb230('0x7'));var attributes=require(_0xb230('0x8'));module[_0xb230('0x9')]=function(_0x3720ba,_0x254609){return _0x3720ba[_0xb230('0xa')](_0xb230('0xb'),attributes,{'tableName':_0xb230('0xc'),'paranoid':![],'indexes':[{'name':_0xb230('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index db4196c..14f6194 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 _0x89d0=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x89d0,0x130));var _0x089d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x89d0[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x089d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x089d('0x1'));var rs=require(_0x089d('0x2'));var fs=require('fs');var Redis=require(_0x089d('0x3'));var db=require(_0x089d('0x4'))['db'];var utils=require(_0x089d('0x5'));var logger=require('../../config/logger')(_0x089d('0x6'));var config=require('../../config/environment');var jayson=require(_0x089d('0x7'));var client=jayson['client'][_0x089d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x43022c,_0x8ac28e,_0x440cf1){return new BPromise(function(_0xa663cf,_0x1fed0d){return client[_0x089d('0x9')](_0x43022c,_0x440cf1)[_0x089d('0xa')](function(_0x4a7c04){logger[_0x089d('0xb')](_0x089d('0xc'),_0x8ac28e,'request\x20sent');logger[_0x089d('0xd')](_0x089d('0xe'),_0x8ac28e,_0x089d('0xf'),JSON[_0x089d('0x10')](_0x4a7c04));if(_0x4a7c04[_0x089d('0x11')]){if(_0x4a7c04[_0x089d('0x11')][_0x089d('0x12')]===0x1f4){logger[_0x089d('0x11')](_0x089d('0xc'),_0x8ac28e,_0x4a7c04[_0x089d('0x11')][_0x089d('0x13')]);return _0x1fed0d(_0x4a7c04[_0x089d('0x11')][_0x089d('0x13')]);}logger[_0x089d('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x8ac28e,_0x4a7c04['error'][_0x089d('0x13')]);return _0xa663cf(_0x4a7c04[_0x089d('0x11')][_0x089d('0x13')]);}else{logger[_0x089d('0xb')](_0x089d('0xc'),_0x8ac28e,'request\x20sent');_0xa663cf(_0x4a7c04[_0x089d('0x14')]['message']);}})[_0x089d('0x15')](function(_0x1cc35a){logger[_0x089d('0x11')](_0x089d('0xc'),_0x8ac28e,_0x1cc35a);_0x1fed0d(_0x1cc35a);});});} \ No newline at end of file +var _0x2f0f=['then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x2f0f,0x15a));var _0xf2f0=function(_0x12f4d8,_0x1f6d82){_0x12f4d8=_0x12f4d8-0x0;var _0x265413=_0x2f0f[_0x12f4d8];return _0x265413;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf2f0('0x0'));var BPromise=require(_0xf2f0('0x1'));var rs=require(_0xf2f0('0x2'));var fs=require('fs');var Redis=require(_0xf2f0('0x3'));var db=require(_0xf2f0('0x4'))['db'];var utils=require(_0xf2f0('0x5'));var logger=require(_0xf2f0('0x6'))(_0xf2f0('0x7'));var config=require('../../config/environment');var jayson=require(_0xf2f0('0x8'));var client=jayson[_0xf2f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58c48e,_0x6e2d65,_0x5d42fb){return new BPromise(function(_0x226dfb,_0x34ef5d){return client[_0xf2f0('0xa')](_0x58c48e,_0x5d42fb)[_0xf2f0('0xb')](function(_0x30cbfc){logger[_0xf2f0('0xc')](_0xf2f0('0xd'),_0x6e2d65,'request\x20sent');logger[_0xf2f0('0xe')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x6e2d65,_0xf2f0('0xf'),JSON[_0xf2f0('0x10')](_0x30cbfc));if(_0x30cbfc[_0xf2f0('0x11')]){if(_0x30cbfc['error'][_0xf2f0('0x12')]===0x1f4){logger[_0xf2f0('0x11')](_0xf2f0('0xd'),_0x6e2d65,_0x30cbfc[_0xf2f0('0x11')][_0xf2f0('0x13')]);return _0x34ef5d(_0x30cbfc[_0xf2f0('0x11')][_0xf2f0('0x13')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x6e2d65,_0x30cbfc[_0xf2f0('0x11')]['message']);return _0x226dfb(_0x30cbfc[_0xf2f0('0x11')]['message']);}else{logger['info'](_0xf2f0('0xd'),_0x6e2d65,_0xf2f0('0xf'));_0x226dfb(_0x30cbfc['result'][_0xf2f0('0x13')]);}})[_0xf2f0('0x14')](function(_0x3782d8){logger[_0xf2f0('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x6e2d65,_0x3782d8);_0x34ef5d(_0x3782d8);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 901457a..017c705 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa630=['catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','Offline\x20apps:','status','join','log'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa630,0xbe));var _0x0a63=function(_0x23bea8,_0x2f1246){_0x23bea8=_0x23bea8-0x0;var _0x5a3a56=_0xa630[_0x23bea8];return _0x5a3a56;};'use strict';var _=require(_0x0a63('0x0'));var db=require(_0x0a63('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require('./config/license');var rpc=require(_0x0a63('0x2'));var config=require('./config/environment');var logger=require(_0x0a63('0x3'))('app');var pm2=require(_0x0a63('0x4'));var pm2Config=require(_0x0a63('0x5'));var schedule=require(_0x0a63('0x6'));var chat=require(_0x0a63('0x7'));var whatsapp=require(_0x0a63('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x0a63('0x9'));function main(){return db[_0x0a63('0xa')][_0x0a63('0xb')]()[_0x0a63('0xc')](function(){if(config[_0x0a63('0xd')]){return seedDb[_0x0a63('0xe')]();}})['then'](function(){return checkLicense[_0x0a63('0xe')]();})[_0x0a63('0xc')](function(){return rpc[_0x0a63('0xf')]();})[_0x0a63('0xc')](function(_0x327bb0){logger[_0x0a63('0x10')](_0x327bb0);return chat[_0x0a63('0x11')]();})[_0x0a63('0xc')](function(){return whatsapp[_0x0a63('0x11')]();})[_0x0a63('0xc')](function(){return schedule['start']();})[_0x0a63('0xc')](function(){return transcribe[_0x0a63('0x11')]();})[_0x0a63('0xc')](function(){return provider[_0x0a63('0x11')]();})['then'](function(_0x23f655){logger['info'](_0x23f655);return pm2[_0x0a63('0x11')](pm2Config);})[_0x0a63('0xc')](function(_0x26b2bc){var _0x23f8b5=_0x26b2bc[_0x0a63('0x12')](function(_0x23b49d){return typeof _0x23b49d[_0x0a63('0x13')]===_0x0a63('0x14')&&_0x23b49d['exitCode']>=0x0;});if(_0x23f8b5[_0x0a63('0x15')]>0x0){throw new Error(_0x23f8b5['length']+_0x0a63('0x16')+_[_0x0a63('0x17')](_0x23f8b5,function(_0x36a9e8){return'\x22'+_0x36a9e8[_0x0a63('0x18')][_0x0a63('0x19')]+'\x22';}));}logger[_0x0a63('0x10')](_0x0a63('0x1a'),_[_0x0a63('0x17')](_[_0x0a63('0x12')](_0x26b2bc,{'status':_0x0a63('0x1b')}),_0x0a63('0x19'))['join']());logger['info'](_0x0a63('0x1c'),_['map'](_[_0x0a63('0x12')](_0x26b2bc,function(_0x5937df){return _0x5937df[_0x0a63('0x1d')]!==_0x0a63('0x1b');}),_0x0a63('0x19'))[_0x0a63('0x1e')]()||'None');console[_0x0a63('0x1f')]('App\x20Ready!');})[_0x0a63('0x20')](function(_0x11fe64){console[_0x0a63('0x1f')](_0x0a63('0x21'),_0x11fe64);logger[_0x0a63('0x22')](_0x0a63('0x23'),_0x11fe64);process[_0x0a63('0x24')](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(_0x3bb490,_0x94fac5){var _0x252879=function(_0x426f3a){while(--_0x426f3a){_0x3bb490['push'](_0x3bb490['shift']());}};_0x252879(++_0x94fac5);}(_0x9417,0xb4));var _0x7941=function(_0x38f5f8,_0xefe164){_0x38f5f8=_0x38f5f8-0x0;var _0x34e820=_0x9417[_0x38f5f8];return _0x34e820;};'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 520bcfe..43b2c43 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 _0x008c=['The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','sign','session','payload','options','promisify','verify','randomBytes','hex','floor','HS512','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','name','userpic','permissions','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','hotdesk','interface','userProfileId','privacyEnabled','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','smsAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','params','closed','disposition','then','unmanaged','json','headers','startsWith','User','find','authenticate','pass','status','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','isEqual','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x008c,0x188));var _0xc008=function(_0x524bb0,_0x326327){_0x524bb0=_0x524bb0-0x0;var _0x2fb947=_0x008c[_0x524bb0];return _0x2fb947;};'use strict';var db=require(_0xc008('0x0'))['db'];var config=require(_0xc008('0x1'));var hardwareConf=require(_0xc008('0x2'));var licenseUtil=require(_0xc008('0x3'));var encryptor=require(_0xc008('0x4'));var _=require('lodash');var jwt=require(_0xc008('0x5'));var expressJwt=require(_0xc008('0x6'));var compose=require(_0xc008('0x7'));var basicAuth=require(_0xc008('0x8'));var crypto=require(_0xc008('0x9'));var BPromise=require(_0xc008('0xa'));var util=require(_0xc008('0xb'));var moment=require(_0xc008('0xc'));var validateJwt=expressJwt({'secret':config[_0xc008('0xd')]['session']});var userAttributes=['id',_0xc008('0xe'),'fullname',_0xc008('0xf'),'internal','email',_0xc008('0x10'),_0xc008('0x11'),'md5secret','voicePause','chatPause',_0xc008('0x12'),_0xc008('0x13'),'smsPause',_0xc008('0x14'),_0xc008('0x15'),_0xc008('0x16'),_0xc008('0x17'),_0xc008('0x18'),_0xc008('0x19'),_0xc008('0x1a'),'passwordResetAt','alias',_0xc008('0x1b'),'phoneBarAutoAnswerDelay',_0xc008('0x1c'),_0xc008('0x1d'),_0xc008('0x1e'),_0xc008('0x1f'),_0xc008('0x20'),'phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0xc008('0x21'),_0xc008('0x22'),_0xc008('0x23'),_0xc008('0x24'),'settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions',_0xc008('0x25'),_0xc008('0x26'),'selectRecallMeCampaign',_0xc008('0x27'),'chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer',_0xc008('0x28'),'openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer',_0xc008('0x29')];exports[_0xc008('0x2a')]=function(){return this[_0xc008('0x2b')](!![])[_0xc008('0x2c')](function(_0x11cc75,_0x110128,_0x4f43e2){if(_0x11cc75[_0xc008('0x2d')]){_0x4f43e2();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x11cc75[_0xc008('0x2e')]['id']},'attributes':['id',_0xc008('0x2f'),_0xc008('0x30')],'raw':!![]})[_0xc008('0x31')](function(_0x5410f5){if(_0x5410f5&&_0x5410f5['closed']){return _0x110128['status'](_0x5410f5[_0xc008('0x30')]===_0xc008('0x32')?0x195:0x193)[_0xc008('0x33')]({'message':_0x5410f5[_0xc008('0x30')]==='unmanaged'?'Unmanaged.':'Forbidden.'});}else{_0x4f43e2();}})['catch'](function(_0x4caaf4){_0x4f43e2(_0x4caaf4);});}});};exports[_0xc008('0x2b')]=function isAuthenticated(_0x29ba43){return compose()[_0xc008('0x2c')](function(_0x529961,_0x24c14c,_0x32390d){var _0x209591;if(_0x529961[_0xc008('0x34')]['authorization']){if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],'Basic')){var _0x539766=basicAuth(_0x529961);db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'name':_0x539766[_0xc008('0xf')]}})[_0xc008('0x31')](function(_0x1de04b){if(!_0x1de04b||!_0x1de04b[_0xc008('0x38')](_0x539766[_0xc008('0x39')])){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x3b')});}_0x529961[_0xc008('0x2d')]={'id':_0x1de04b['id']};_0x32390d();})[_0xc008('0x3c')](function(_0x596ee8){_0x32390d(_0x596ee8);});}else if(_[_0xc008('0x35')](_0x529961[_0xc008('0x34')]['authorization'],_0xc008('0x3d'))){validateJwt(_0x529961,_0x24c14c,_0x32390d);}else{if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}}}else if(_0x529961[_0xc008('0x3f')][_0xc008('0x40')]){try{var _0x7cfbc5={'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};verifyJwt(_0x529961['query'][_0xc008('0x40')],_0x7cfbc5)[_0xc008('0x31')](function(_0x459df4){return db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x459df4[_0xc008('0x42')]}})[_0xc008('0x31')](function(_0x5d0e06){_0x209591=_0x5d0e06;return db[_0xc008('0x43')][_0xc008('0x44')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc008('0x45')],'raw':!![]});})[_0xc008('0x31')](function(_0x5e38d5){if(!_0x209591||!_[_0xc008('0x46')](_0x209591[_0xc008('0x47')],_0x459df4[_0xc008('0x48')])){return _0x24c14c['status'](0x191)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x209591[_0xc008('0x49')]){return _0x24c14c['status'](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}if(_0x209591[_0xc008('0x4b')]){if(_0x5e38d5[_0xc008('0x45')]>0x0){if(moment(_0x209591[_0xc008('0x4c')])[_0xc008('0x4d')](_0x5e38d5[_0xc008('0x45')],_0xc008('0x4e'))>moment()){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}else{return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});}}_0x529961['user']={'id':_0x209591['id']};_0x32390d();});})[_0xc008('0x3c')](function(){return _0x24c14c[_0xc008('0x3a')](0x191)[_0xc008('0x33')]({'message':_0xc008('0x4a')});});}catch(_0x49a16d){_0x32390d(_0x49a16d);}}else if(_0x29ba43){_0x32390d();}else{return _0x24c14c[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x3e')});}})[_0xc008('0x2c')](function(_0x2d142d,_0x5706bb,_0x398cdd){if(_0x2d142d[_0xc008('0x2d')]){db[_0xc008('0x36')][_0xc008('0x37')]({'where':{'id':_0x2d142d[_0xc008('0x2d')]['id']},'attributes':userAttributes})['then'](function(_0xf4cc4b){if(!_0xf4cc4b){return _0x5706bb[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x4f')});}_0x2d142d['user']=_0xf4cc4b;_0x398cdd();})[_0xc008('0x3c')](function(_0xe37446){_0x398cdd(_0xe37446);});}else if(_0x29ba43){_0x398cdd();}else{return _0x5706bb[_0xc008('0x3a')](0x194)['json']({'message':_0xc008('0x50')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xc008('0x2c')](function(_0x5d3a72,_0x46fa8f,_0x213014){return licenseUtil['getLicense']()[_0xc008('0x31')](function(_0x24ba0f){if(_0x24ba0f[_0xc008('0x51')]){_0x213014();}else{return _0x46fa8f['status'](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x44fc5d){_0x213014(_0x44fc5d);});});};exports[_0xc008('0x53')]=function isWebrtcLicence(){return compose()[_0xc008('0x2c')](function(_0x59ca2b,_0x47cafa,_0x5283a8){return licenseUtil[_0xc008('0x54')]()[_0xc008('0x31')](function(_0x103a83){if(_0x103a83[_0xc008('0x55')]){_0x5283a8();}else{return _0x47cafa[_0xc008('0x3a')](0x193)[_0xc008('0x33')]({'message':_0xc008('0x52')});}})[_0xc008('0x3c')](function(_0x572593){_0x5283a8(_0x572593);});});};exports['isMiddleware']=function(_0x516e43,_0x2d5a49,_0x2651cf){_0x516e43[_0xc008('0x56')]=!![];return _0x2651cf();};exports['signToken']=function signToken(_0x28bc33){return signJwt(_0x28bc33);};exports[_0xc008('0x57')]=function(_0x17ab1a,_0x1c2c50){if(!_0x17ab1a[_0xc008('0x2d')]){return _0x1c2c50[_0xc008('0x3a')](0x194)[_0xc008('0x33')]({'message':_0xc008('0x58')});}var _0x3fd7d9={'payload':{'id':_0x17ab1a[_0xc008('0x2d')]['id'],'role':_0x17ab1a['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x3fd7d9)[_0xc008('0x31')](function(_0x51cb14){_0x1c2c50[_0xc008('0x59')](_0xc008('0x5a'),_0x51cb14);_0x1c2c50[_0xc008('0x5b')]('/dashboards/general');})[_0xc008('0x3c')](function(_0x32b435){return _0x1c2c50[_0xc008('0x3a')](0x1f4)[_0xc008('0x5c')](_0x32b435);});};exports[_0xc008('0x5d')]=function(_0x51105f){if(_[_0xc008('0x5e')](_0x51105f[_0xc008('0x47')])||_['isNil'](_0x51105f[_0xc008('0x5f')])){return null;}else{return createJwt(_0x51105f);}};exports[_0xc008('0x60')]=function(_0x5b5fbf){_0x5b5fbf['apiKeyNonce']=generateNonce();_0x5b5fbf[_0xc008('0x5f')]=generateIssuedAt();return createJwt(_0x5b5fbf);};exports[_0xc008('0x61')]=function(_0x20947b,_0x30d0aa){var _0x14b6a0=_0x20947b['query']['apikey'];if(_0x14b6a0){var _0x34b72a={'nonce':_0x30d0aa['apiKeyNonce'],'iat':_0x30d0aa[_0xc008('0x5f')],'audience':hardwareConf[_0xc008('0x41')](),'issuer':hardwareConf[_0xc008('0x41')]()};return verifyJwt(_0x14b6a0,_0x34b72a)[_0xc008('0x31')](function(){return generateApiKey(_0x30d0aa);});}else{throw{'message':_0xc008('0x62')};}};exports[_0xc008('0x63')]=function(_0x49d8b0){var _0x2ea742=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2ea742[_0xc008('0x64')](_0x49d8b0))throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0xc008('0x67'));return;};exports['validatePasswordHistory']=function(_0x41fae3,_0x4fdab4,_0x535e6e){var _0x5dbfca=encryptor[_0xc008('0x68')](_0x4fdab4)[_0xc008('0x69')](',');for(var _0x5dfb69=0x0;_0x5dfb69<_0x535e6e;_0x5dfb69++){if(!_0x5dbfca[_0x5dfb69])break;if(_0x41fae3['toLowerCase']()===_0x5dbfca[_0x5dfb69][_0xc008('0x6a')]()){var _0x2d8361=util[_0xc008('0x6b')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x535e6e);if(_0x535e6e===0x1){_0x2d8361=_0xc008('0x6c');}throw new db[(_0xc008('0x65'))][(_0xc008('0x66'))](_0x2d8361);}}return;};exports[_0xc008('0x6d')]=function(_0x5baff1,_0x4022dd){var _0x4eaa6d=_0x4022dd?encryptor[_0xc008('0x68')](_0x4022dd)[_0xc008('0x69')](','):[];if(_0x4eaa6d[_0xc008('0x6e')]===0x5){_0x4eaa6d[_0xc008('0x6f')](-0x1,0x1);}_0x4eaa6d[_0xc008('0x70')](_0x5baff1);return encryptor[_0xc008('0x71')](_0x4eaa6d['join'](','));};function signJwt(_0x375e71){var _0x570001=BPromise['promisify'](jwt[_0xc008('0x72')],{'context':jwt});var _0x30aa1e=_0x375e71['secret']||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x3e373e,_0x4517c0){_0x570001(_0x375e71[_0xc008('0x74')],_0x30aa1e,_0x375e71[_0xc008('0x75')])[_0xc008('0x31')](function(_0x57ce9a){_0x3e373e(_0x57ce9a);})[_0xc008('0x3c')](function(_0x462e1e){_0x4517c0(_0x462e1e);});});}function verifyJwt(_0x3bfb15,_0x2a60e6,_0xb3ca0f){var _0x167425=BPromise[_0xc008('0x76')](jwt[_0xc008('0x77')],{'context':jwt});var _0xbc430a=_0xb3ca0f||config[_0xc008('0xd')][_0xc008('0x73')];return new BPromise(function(_0x2b5eb6,_0x131b81){_0x167425(_0x3bfb15,_0xbc430a,_0x2a60e6)[_0xc008('0x31')](function(_0x4e0251){_0x2b5eb6(_0x4e0251);})[_0xc008('0x3c')](function(_0x2e5467){_0x131b81(_0x2e5467);});});}function generateNonce(){return crypto[_0xc008('0x78')](0x10)['toString'](_0xc008('0x79'));}function generateIssuedAt(){return Math[_0xc008('0x7a')](Date['now']()/0x3e8)['toString']();}function createJwt(_0x1a03fd){var _0x2a4c2b={'payload':{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd[_0xc008('0x47')]},'options':{'algorithm':_0xc008('0x7b'),'subject':_0x1a03fd['id'][_0xc008('0x7c')](),'issuer':hardwareConf[_0xc008('0x41')](),'audience':hardwareConf[_0xc008('0x41')]()}};return signJwt(_0x2a4c2b)[_0xc008('0x31')](function(_0x1b059b){return{'iat':_0x1a03fd[_0xc008('0x5f')],'nonce':_0x1a03fd['apiKeyNonce'],'token':_0x1b059b};});} \ No newline at end of file +var _0x9bde=['whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','pass','json','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','generateApiKey','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','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.','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x23fa1c,_0x49c936){_0x23fa1c=_0x23fa1c-0x0;var _0x30dcbb=_0x9bde[_0x23fa1c];return _0x30dcbb;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe9bd('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xe9bd('0x1'));var encryptor=require('../encryptor');var _=require(_0xe9bd('0x2'));var jwt=require(_0xe9bd('0x3'));var expressJwt=require(_0xe9bd('0x4'));var compose=require(_0xe9bd('0x5'));var basicAuth=require(_0xe9bd('0x6'));var crypto=require(_0xe9bd('0x7'));var BPromise=require(_0xe9bd('0x8'));var util=require('util');var moment=require(_0xe9bd('0x9'));var validateJwt=expressJwt({'secret':config[_0xe9bd('0xa')][_0xe9bd('0xb')]});var userAttributes=['id',_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf'),_0xe9bd('0x10'),_0xe9bd('0x11'),_0xe9bd('0x12'),'md5secret','voicePause',_0xe9bd('0x13'),_0xe9bd('0x14'),_0xe9bd('0x15'),'smsPause',_0xe9bd('0x16'),_0xe9bd('0x17'),_0xe9bd('0x18'),_0xe9bd('0x19'),'lastPauseAt',_0xe9bd('0x1a'),'allowmessenger',_0xe9bd('0x1b'),_0xe9bd('0x1c'),_0xe9bd('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xe9bd('0x1e'),_0xe9bd('0x1f'),_0xe9bd('0x20'),_0xe9bd('0x21'),_0xe9bd('0x22'),_0xe9bd('0x23'),_0xe9bd('0x24'),'hotdesk',_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),'settingsEnabled',_0xe9bd('0x28'),_0xe9bd('0x29'),_0xe9bd('0x2a'),_0xe9bd('0x2b'),'ignorePauseForPreviewCalls',_0xe9bd('0x2c'),'chatAutoanswer',_0xe9bd('0x2d'),'emailAutoanswer',_0xe9bd('0x2e'),_0xe9bd('0x2f'),_0xe9bd('0x30'),_0xe9bd('0x31'),_0xe9bd('0x32'),_0xe9bd('0x33'),_0xe9bd('0x34'),'whatsappAutoanswer',_0xe9bd('0x35')];exports[_0xe9bd('0x36')]=function(){return this['isAuthenticated'](!![])[_0xe9bd('0x37')](function(_0x505c23,_0x238ab1,_0x1b9cc9){if(_0x505c23[_0xe9bd('0x38')]){_0x1b9cc9();}else{return db[_0xe9bd('0x39')]['findOne']({'where':{'id':_0x505c23[_0xe9bd('0x3a')]['id']},'attributes':['id',_0xe9bd('0x3b'),_0xe9bd('0x3c')],'raw':!![]})[_0xe9bd('0x3d')](function(_0x2641be){if(_0x2641be&&_0x2641be[_0xe9bd('0x3b')]){return _0x238ab1[_0xe9bd('0x3e')](_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?0x195:0x193)['json']({'message':_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?'Unmanaged.':_0xe9bd('0x40')});}else{_0x1b9cc9();}})[_0xe9bd('0x41')](function(_0x119672){_0x1b9cc9(_0x119672);});}});};exports[_0xe9bd('0x42')]=function isAuthenticated(_0x141b95){return compose()[_0xe9bd('0x37')](function(_0x519f48,_0x5b7f1d,_0x1de54c){var _0x56e409;if(_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')]){if(_[_0xe9bd('0x45')](_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')],'Basic')){var _0x4b7bc2=basicAuth(_0x519f48);db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'name':_0x4b7bc2[_0xe9bd('0xe')]}})[_0xe9bd('0x3d')](function(_0xe2436){if(!_0xe2436||!_0xe2436[_0xe9bd('0x48')](_0x4b7bc2[_0xe9bd('0x49')])){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':'Wrong\x20credentials.'});}_0x519f48[_0xe9bd('0x38')]={'id':_0xe2436['id']};_0x1de54c();})[_0xe9bd('0x41')](function(_0x390a43){_0x1de54c(_0x390a43);});}else if(_['startsWith'](_0x519f48['headers'][_0xe9bd('0x44')],_0xe9bd('0x4b'))){validateJwt(_0x519f48,_0x5b7f1d,_0x1de54c);}else{if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}}}else if(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')]){try{var _0x1c6173={'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};verifyJwt(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')],_0x1c6173)[_0xe9bd('0x3d')](function(_0x199477){return db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'id':_0x199477[_0xe9bd('0x50')]}})[_0xe9bd('0x3d')](function(_0x4c689d){_0x56e409=_0x4c689d;return db[_0xe9bd('0x51')][_0xe9bd('0x52')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9bd('0x53')],'raw':!![]});})[_0xe9bd('0x3d')](function(_0x4c7d47){if(!_0x56e409||!_['isEqual'](_0x56e409[_0xe9bd('0x54')],_0x199477[_0xe9bd('0x55')])){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x56')});}if(_0x56e409[_0xe9bd('0x57')]){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e409[_0xe9bd('0x58')]){if(_0x4c7d47[_0xe9bd('0x53')]>0x0){if(moment(_0x56e409[_0xe9bd('0x59')])[_0xe9bd('0x5a')](_0x4c7d47['blockDuration'],_0xe9bd('0x5b'))>moment()){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}_0x519f48[_0xe9bd('0x38')]={'id':_0x56e409['id']};_0x1de54c();});})[_0xe9bd('0x41')](function(){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xcf9a0c){_0x1de54c(_0xcf9a0c);}}else if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d['status'](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}})[_0xe9bd('0x37')](function(_0x480797,_0x1ba613,_0x2923cf){if(_0x480797[_0xe9bd('0x38')]){db['User'][_0xe9bd('0x47')]({'where':{'id':_0x480797[_0xe9bd('0x38')]['id']},'attributes':userAttributes})[_0xe9bd('0x3d')](function(_0x388132){if(!_0x388132){return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5d')});}_0x480797[_0xe9bd('0x38')]=_0x388132;_0x2923cf();})[_0xe9bd('0x41')](function(_0x300e07){_0x2923cf(_0x300e07);});}else if(_0x141b95){_0x2923cf();}else{return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5e')});}});};exports[_0xe9bd('0x5f')]=function canUpdate(){return compose()[_0xe9bd('0x37')](function(_0x5b70d3,_0x5a86fd,_0x283e67){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x58828b){if(_0x58828b['update']){_0x283e67();}else{return _0x5a86fd[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0x39fb61){_0x283e67(_0x39fb61);});});};exports[_0xe9bd('0x62')]=function isWebrtcLicence(){return compose()[_0xe9bd('0x37')](function(_0x512899,_0x1e45fc,_0x4cc146){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x33ba69){if(_0x33ba69[_0xe9bd('0x63')]){_0x4cc146();}else{return _0x1e45fc[_0xe9bd('0x3e')](0x193)['json']({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0xe14fa4){_0x4cc146(_0xe14fa4);});});};exports['isMiddleware']=function(_0xff4e14,_0x476f23,_0x34f787){_0xff4e14['isMiddleware']=!![];return _0x34f787();};exports[_0xe9bd('0x64')]=function signToken(_0x27e7b0){return signJwt(_0x27e7b0);};exports[_0xe9bd('0x65')]=function(_0x10ec29,_0x1ee09c){if(!_0x10ec29['user']){return _0x1ee09c[_0xe9bd('0x3e')](0x194)['json']({'message':_0xe9bd('0x66')});}var _0x239be9={'payload':{'id':_0x10ec29[_0xe9bd('0x38')]['id'],'role':_0x10ec29[_0xe9bd('0x38')][_0xe9bd('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x239be9)['then'](function(_0x15d1d0){_0x1ee09c['cookie'](_0xe9bd('0x67'),_0x15d1d0);_0x1ee09c[_0xe9bd('0x68')]('/dashboards/general');})['catch'](function(_0x1ce539){return _0x1ee09c['status'](0x1f4)[_0xe9bd('0x69')](_0x1ce539);});};exports['retrieveApiKey']=function(_0x26b25a){if(_[_0xe9bd('0x6a')](_0x26b25a['apiKeyNonce'])||_[_0xe9bd('0x6a')](_0x26b25a['apiKeyIat'])){return null;}else{return createJwt(_0x26b25a);}};exports[_0xe9bd('0x6b')]=function(_0x2d9a94){_0x2d9a94[_0xe9bd('0x54')]=generateNonce();_0x2d9a94['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d9a94);};exports[_0xe9bd('0x6c')]=function(_0x1d703f,_0x45b69e){var _0x232a36=_0x1d703f['query']['apikey'];if(_0x232a36){var _0x441f89={'nonce':_0x45b69e['apiKeyNonce'],'iat':_0x45b69e[_0xe9bd('0x6d')],'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};return verifyJwt(_0x232a36,_0x441f89)[_0xe9bd('0x3d')](function(){return generateApiKey(_0x45b69e);});}else{throw{'message':_0xe9bd('0x6e')};}};exports[_0xe9bd('0x6f')]=function(_0x373057){var _0x3381ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3381ee[_0xe9bd('0x70')](_0x373057))throw new db[(_0xe9bd('0x71'))][(_0xe9bd('0x72'))](_0xe9bd('0x73'));return;};exports['validatePasswordHistory']=function(_0x596a7d,_0x566dd8,_0x10e685){var _0x5a516e=encryptor[_0xe9bd('0x74')](_0x566dd8)[_0xe9bd('0x75')](',');for(var _0x90db01=0x0;_0x90db01<_0x10e685;_0x90db01++){if(!_0x5a516e[_0x90db01])break;if(_0x596a7d[_0xe9bd('0x76')]()===_0x5a516e[_0x90db01][_0xe9bd('0x76')]()){var _0xaf6ffd=util[_0xe9bd('0x77')](_0xe9bd('0x78'),_0x10e685);if(_0x10e685===0x1){_0xaf6ffd=_0xe9bd('0x79');}throw new db['Sequelize'][(_0xe9bd('0x72'))](_0xaf6ffd);}}return;};exports[_0xe9bd('0x7a')]=function(_0x3d3e74,_0x3f848d){var _0x4d58c1=_0x3f848d?encryptor[_0xe9bd('0x74')](_0x3f848d)[_0xe9bd('0x75')](','):[];if(_0x4d58c1[_0xe9bd('0x7b')]===0x5){_0x4d58c1['splice'](-0x1,0x1);}_0x4d58c1[_0xe9bd('0x7c')](_0x3d3e74);return encryptor[_0xe9bd('0x7d')](_0x4d58c1[_0xe9bd('0x7e')](','));};function signJwt(_0xfe82f7){var _0x4ee26a=BPromise['promisify'](jwt[_0xe9bd('0x7f')],{'context':jwt});var _0x188891=_0xfe82f7[_0xe9bd('0x80')]||config[_0xe9bd('0xa')]['session'];return new BPromise(function(_0x49add9,_0x305efa){_0x4ee26a(_0xfe82f7[_0xe9bd('0x81')],_0x188891,_0xfe82f7[_0xe9bd('0x82')])[_0xe9bd('0x3d')](function(_0x1fd2b5){_0x49add9(_0x1fd2b5);})[_0xe9bd('0x41')](function(_0x4870f8){_0x305efa(_0x4870f8);});});}function verifyJwt(_0x179c8d,_0x5681ab,_0x27e07c){var _0x28dd03=BPromise[_0xe9bd('0x83')](jwt[_0xe9bd('0x84')],{'context':jwt});var _0x5bc1f8=_0x27e07c||config[_0xe9bd('0xa')][_0xe9bd('0xb')];return new BPromise(function(_0x3b0190,_0x4f35c4){_0x28dd03(_0x179c8d,_0x5bc1f8,_0x5681ab)[_0xe9bd('0x3d')](function(_0x1a9d0c){_0x3b0190(_0x1a9d0c);})[_0xe9bd('0x41')](function(_0x3e3e05){_0x4f35c4(_0x3e3e05);});});}function generateNonce(){return crypto[_0xe9bd('0x85')](0x10)[_0xe9bd('0x86')](_0xe9bd('0x87'));}function generateIssuedAt(){return Math[_0xe9bd('0x88')](Date[_0xe9bd('0x89')]()/0x3e8)[_0xe9bd('0x86')]();}function createJwt(_0x14c599){var _0x37d07a={'payload':{'iat':_0x14c599['apiKeyIat'],'nonce':_0x14c599[_0xe9bd('0x54')]},'options':{'algorithm':_0xe9bd('0x8a'),'subject':_0x14c599['id']['toString'](),'issuer':hardwareConf[_0xe9bd('0x4f')](),'audience':hardwareConf[_0xe9bd('0x4f')]()}};return signJwt(_0x37d07a)['then'](function(_0x561165){return{'iat':_0x14c599[_0xe9bd('0x6d')],'nonce':_0x14c599[_0xe9bd('0x54')],'token':_0x561165};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 0cff9b0..fe88fd2 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 _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x4c9e61,_0xc050a1){var _0x11a1ac=function(_0x218a22){while(--_0x218a22){_0x4c9e61['push'](_0x4c9e61['shift']());}};_0x11a1ac(++_0xc050a1);}(_0xb10b,0x12a));var _0xbb10=function(_0x50ede0,_0x7e6410){_0x50ede0=_0x50ede0-0x0;var _0x5cbe32=_0xb10b[_0x50ede0];return _0x5cbe32;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file +var _0xb10b=['user','clause','tags','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','keys','startsWith','cf_','map','CmCustomField','findOne','slice','all','fieldType','type','lodash','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','default','where','fields','filter'];(function(_0x1d5737,_0x450bea){var _0x3843c2=function(_0x7a0646){while(--_0x7a0646){_0x1d5737['push'](_0x1d5737['shift']());}};_0x3843c2(++_0x450bea);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d69e5,_0x2a29af){_0x1d69e5=_0x1d69e5-0x0;var _0x17da11=_0xb10b[_0x1d69e5];return _0x17da11;};'use strict';var _=require(_0xbb10('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xbb10('0x1'))['db'];exports[_0xbb10('0x2')]=function(_0x1dcb08,_0x4d688c,_0x4541ae,_0x9bbed){var _0x460981={'count':0x0,'rows':[]};var _0x22320e=sqlUtils[_0xbb10('0x3')](_0x4d688c,_0x1dcb08);if(_0x22320e){return Promise[_0xbb10('0x4')](_0x460981);}var _0x481979=sqlUtils[_0xbb10('0x5')]();var _0x3cdd53={};var _0x513741=![];var _0x1b9e94=![];return Promise[_0xbb10('0x4')]()[_0xbb10('0x6')](function(){if(_0x1dcb08[_0xbb10('0x7')]){return sqlUtils[_0xbb10('0x8')](_0x1dcb08[_0xbb10('0x7')],_0x9bbed);}else{return sqlUtils[_0xbb10('0x9')](_0x1dcb08,_0x9bbed);}})[_0xbb10('0x6')](function(_0x5ab04a){_0x481979['where'](_0x5ab04a[_0xbb10('0xa')]);_0x481979[_0xbb10('0xb')](_0x5ab04a[_0xbb10('0xc')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xd')]);_0x481979['where'](_0x5ab04a[_0xbb10('0xe')][_0xbb10('0xf')]);_0x3cdd53=_0x5ab04a[_0xbb10('0x10')];_0x1b9e94=_0x5ab04a[_0xbb10('0xe')][_0xbb10('0x11')];return sqlUtils[_0xbb10('0x12')](_0x4d688c,_0x1dcb08,_0x1b9e94);})['then'](function(_0x26e021){_0x481979[_0xbb10('0xb')](_0x26e021);var _0x45b9d6=_0x1dcb08[_0xbb10('0x7')]?_0x3cdd53[_0xbb10('0x13')]:_0x1dcb08[_0xbb10('0x14')];_0x513741=_0x45b9d6?!![]:![];return sqlUtils[_0xbb10('0x15')](_0x481979,_0x45b9d6);})[_0xbb10('0x6')](function(_0x3e26f4){_0x460981[_0xbb10('0x16')]=_0x3e26f4;if(_0x460981['count']===0x0){return;}return sqlUtils[_0xbb10('0x17')](_0x481979,_0x1dcb08[_0xbb10('0xc')],_0x4541ae,_0x513741,_0x3cdd53[_0xbb10('0xf')],_0x1b9e94);})[_0xbb10('0x6')](function(_0x378da8){if(!_0x378da8){return[];}return sqlUtils[_0xbb10('0x18')](_0x378da8,_0x1dcb08,_0x4541ae);})[_0xbb10('0x6')](function(_0x30efc6){_0x460981[_0xbb10('0x19')]=_0x30efc6;return _0x460981;})[_0xbb10('0x1a')](function(_0x48b6e9){throw _0x48b6e9;});};exports[_0xbb10('0x1b')]=function(){var _0x19f48d={};var _0x388fab=[];return db[_0xbb10('0x1c')][_0xbb10('0x1b')]()[_0xbb10('0x6')](function(_0x4deb49){_0x19f48d=_0x4deb49;var _0x12f888=Object[_0xbb10('0x1d')](_0x19f48d)['filter'](function(_0x4c4b0d){return _[_0xbb10('0x1e')](_0x4c4b0d,_0xbb10('0x1f'))?_0x4c4b0d:undefined;});var _0x2e911d=_0x12f888[_0xbb10('0x20')](function(_0x445761){return db[_0xbb10('0x21')][_0xbb10('0x22')]({'where':{'id':_0x445761[_0xbb10('0x23')](0x3)},'raw':!![]});});return Promise[_0xbb10('0x24')](_0x2e911d);})[_0xbb10('0x6')](function(_0x3ba6cd){for(var _0x26ad93=0x0;_0x26ad93<_0x3ba6cd['length'];_0x26ad93++){if(_0x3ba6cd[_0x26ad93]){var _0x4fedac='cf_'+_0x3ba6cd[_0x26ad93]['id'];_0x19f48d[_0x4fedac][_0xbb10('0x25')]=_0x3ba6cd[_0x26ad93][_0xbb10('0x26')];}}_0x388fab=_[_0xbb10('0x20')](Object['keys'](_0x19f48d),function(_0x2fdde9){return{'name':_0x2fdde9,'type':_0x19f48d[_0x2fdde9][_0xbb10('0x26')]};});return _0x388fab;})[_0xbb10('0x1a')](function(_0x1d5e95){throw _0x1d5e95;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 35a6f8a..fd4fd44 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 _0xbac0=['value','Tag','map','tags','clause','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','Contact','c.ListId\x20IN\x20?','and','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','then','fields','tag','filter','resolve','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','toString','Tags','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','where','c.deletedAt\x20IS\x20NULL','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','left_join','cm_contact_has_tags','.id','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','text'];(function(_0x28f1a8,_0x5c853e){var _0x4293c9=function(_0x103823){while(--_0x103823){_0x28f1a8['push'](_0x28f1a8['shift']());}};_0x4293c9(++_0x5c853e);}(_0xbac0,0x1e8));var _0x0bac=function(_0x11cd17,_0x489e02){_0x11cd17=_0x11cd17-0x0;var _0x3343ad=_0xbac0[_0x11cd17];return _0x3343ad;};'use strict';var _=require('lodash');var squel=require(_0x0bac('0x0'));var as=require(_0x0bac('0x1'));var qs=require(_0x0bac('0x2'));var utils=require(_0x0bac('0x3'));var db=require(_0x0bac('0x4'))['db'];function skipContactsQuery(_0x46177c,_0x2ad975){var _0x20e7da=![];if(_0x46177c[_0x0bac('0x5')]===_0x0bac('0x6')&&!_0x2ad975[_0x0bac('0x7')]&&!_0x2ad975[_0x0bac('0x8')]&&_0x2ad975[_0x0bac('0x9')]!==_0x0bac('0xa')){_0x20e7da=!![];}return _0x20e7da;}function getContactsSubquery(){return squel['select']()[_0x0bac('0xb')]('cm_contacts','c')[_0x0bac('0xc')](_0x0bac('0xd'));}function applyJoinClauses(_0x3a783f,_0x2a1a0f){var _0x1ca994=_0x2a1a0f?'c':_0x0bac('0xe');_0x3a783f['left_join'](_0x0bac('0xf'),'uc',_0x0bac('0x10')+_0x1ca994+'.id')[_0x0bac('0x11')](_0x0bac('0x12'),'ct','ct.CmContactId\x20=\x20'+_0x1ca994+_0x0bac('0x13'))[_0x0bac('0x11')](_0x0bac('0x14'),'t',_0x0bac('0x15'));return _0x3a783f;}function addFieldsToQuery(_0x54f846,_0x711eab,_0x353e2c,_0x55b94c,_0x5aecb1){var _0x2df847=_0x5aecb1?'c':_0x0bac('0xe');if(!_0x711eab){_0x711eab=['id','firstName',_0x0bac('0x16'),_0x0bac('0x17'),_0x0bac('0x18'),'fax',_0x0bac('0x19'),_0x0bac('0x8'),_0x0bac('0x1a'),_0x0bac('0x1b'),_0x0bac('0x1c'),_0x0bac('0x1d'),_0x0bac('0x1e')];}else if(!_0x711eab[_0x0bac('0x1f')]('id')){_0x711eab[_0x0bac('0x20')]('id');}var _0xf0a249=_0x353e2c&&_0x5aecb1||!_0x353e2c&&!_0x5aecb1;if(_0x55b94c){_0xf0a249=_0x55b94c&&_0x5aecb1||!_0x55b94c&&!_0x5aecb1;}_0x711eab[_0x0bac('0x21')](function(_0x5e54dd){if(_0x5e54dd===_0x0bac('0x1e')){if(_0xf0a249){_0x54f846[_0x0bac('0x22')](_0x0bac('0x23'),_0x5e54dd);}else if(_0x353e2c||_0x55b94c){_0x54f846[_0x0bac('0x22')](_0x2df847+'.'+_0x5e54dd);}}else{_0x54f846[_0x0bac('0x22')](_0x2df847+'.'+_0x5e54dd);}});return _0x54f846;}function getSqlClauses(){var _0x2ebb29={'default':squel[_0x0bac('0x24')](),'fields':squel[_0x0bac('0x24')](),'filter':squel[_0x0bac('0x24')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x0bac('0x24')](),'skip':![]}};return _0x2ebb29;}function parseTagParameter(_0x9ec56c){var _0x17fd37=squel[_0x0bac('0x24')]();if(_0x9ec56c){var _0x410f4d=utils[_0x0bac('0x25')](_0x9ec56c);_0x410f4d[_0x0bac('0x21')](function(_0x233dbd){_0x17fd37['or'](_0x0bac('0x26'),'%,'+_0x233dbd+',%');});}return _0x17fd37;}function parseSearchFilter(_0x2686f0){var _0x36c57c=squel[_0x0bac('0x24')]();if(_0x2686f0){var _0x31d35a=_0x2686f0[_0x0bac('0x27')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x31d35a[_0x0bac('0x28')]('\x20')['length']>0x1){_0x36c57c['or'](_0x0bac('0x29'),qs['getFullTextValue'](_0x31d35a),null);}else{if(qs[_0x0bac('0x2a')](_0x31d35a)){_0x36c57c['or'](_0x0bac('0x2b'),_0x31d35a+'%');_0x36c57c['or']('c.phone\x20LIKE\x20?',_0x31d35a+'%');_0x36c57c['or'](_0x0bac('0x2c'),_0x31d35a+'%');_0x36c57c['or'](_0x0bac('0x2d'),_0x31d35a+'%');}else if(qs[_0x0bac('0x2e')](_0x31d35a)){_0x36c57c['or'](_0x0bac('0x2f'),_0x31d35a+'%');}else{_0x36c57c['or'](_0x0bac('0x30'),'%'+_0x31d35a+'%');_0x36c57c['or']('c.lastName\x20LIKE\x20?','%'+_0x31d35a+'%');_0x36c57c['or'](_0x0bac('0x2f'),'%'+_0x31d35a+'%');}}}return _0x36c57c;}function parseAdvancedSearchFilter(_0x5b187c,_0x3e3223){var _0x480af7=getSqlClauses();var _0x3874bc=as[_0x0bac('0x31')](_0x5b187c);var _0x2761e1=_0x3874bc[_0x0bac('0x32')];for(var _0x4d04ce=0x0;_0x4d04ce<_0x3874bc[_0x0bac('0x33')][_0x0bac('0x34')];_0x4d04ce++){var _0x44974b=_0x3874bc[_0x0bac('0x33')][_0x4d04ce];var _0x31adea='c';var _0x410672=_[_0x0bac('0x35')](_0x3e3223,[_0x0bac('0x36'),_0x44974b[_0x0bac('0x22')]]);if(_0x410672){if(_0x44974b[_0x0bac('0x22')]===_0x0bac('0x37')||_0x410672[_0x0bac('0x38')]===_0x0bac('0x39')){_0x44974b[_0x0bac('0x3a')]=_0x0bac('0x3b');}var _0x174d06=as[_0x0bac('0x3c')](_0x31adea,_0x410672['type'],_0x44974b);_0x480af7['default'][_0x2761e1](_0x174d06[_0x0bac('0x3d')],_0x174d06[_0x0bac('0x3e')]['start'],_0x174d06['value']['end']);}else{if(_0x44974b[_0x0bac('0x22')]===_0x0bac('0x3f')){var _0x219b3b=_0x44974b[_0x0bac('0x3e')]['split'](',')[_0x0bac('0x40')](function(_0x35f031){return Number(_0x35f031);});var _0x400c0b=parseTagParameter(_0x219b3b);_0x480af7[_0x0bac('0x41')][_0x0bac('0x42')]['and'](_0x400c0b);_0x480af7[_0x0bac('0x41')][_0x0bac('0x43')]=_0x219b3b;}else if(_0x44974b[_0x0bac('0x22')]===_0x0bac('0x44')){_0x480af7[_0x0bac('0x45')][_0x0bac('0x42')]['and'](_0x0bac('0x46'),_0x44974b[_0x0bac('0x3e')]);_0x480af7[_0x0bac('0x45')][_0x0bac('0x47')]=!![];}}}return _0x480af7;}function parseModelFields(_0x3646b6,_0x19092b){var _0x1d7db2=squel[_0x0bac('0x24')]();var _0x85816=_(_0x3646b6)[_0x0bac('0x48')]()[_0x0bac('0x40')](function(_0x439499){return _[_0x0bac('0x49')](_0x19092b,['name',_0x439499])?_0x439499:undefined;})['compact']()['value']();if(_0x3646b6[_0x0bac('0x4a')]){_0x85816['push'](_0x0bac('0x4a'));}if(_0x85816[_0x0bac('0x34')]>0x0){_0x85816[_0x0bac('0x21')](function(_0x13b230){if(_0x13b230===_0x0bac('0x8')){_0x1d7db2['and'](_0x0bac('0x4b'),[]['concat'](_0x3646b6[_0x13b230]));}else if(_0x13b230===_0x0bac('0x4a')){var _0x578152='%'+_0x3646b6[_0x13b230]+'%';_0x1d7db2[_0x0bac('0x4c')](_0x0bac('0x4d'),_0x578152);}else{_0x1d7db2[_0x0bac('0x4c')]('c.'+_0x13b230+'\x20=\x20?',_0x3646b6[_0x13b230]);}});}return _0x1d7db2;}function parseQueryParameters(_0x34e4fd,_0x1e956e){var _0x36221a=getSqlClauses();return Promise['resolve']()[_0x0bac('0x4e')](function(){return parseModelFields(_0x34e4fd,_0x1e956e);})['then'](function(_0x2c5202){_0x36221a[_0x0bac('0x4f')][_0x0bac('0x4c')](_0x2c5202);return parseTagParameter(_0x34e4fd[_0x0bac('0x50')]);})[_0x0bac('0x4e')](function(_0x1950bb){_0x36221a['tags'][_0x0bac('0x42')]['and'](_0x1950bb);return parseSearchFilter(_0x34e4fd['filter']);})[_0x0bac('0x4e')](function(_0x251008){_0x36221a[_0x0bac('0x51')]=_0x251008;return _0x36221a;});}function checkListsRestrictions(_0x1dc874,_0x1f95e2,_0x3a723b){var _0x3dbae1=squel['expr']();return Promise[_0x0bac('0x52')]()[_0x0bac('0x4e')](function(){if(_0x1f95e2['search']&&_0x1dc874[_0x0bac('0x5')]==='agent'&&!_0x3a723b){return _0x1dc874['getLists']({'attributes':['id'],'raw':!![]});}})['then'](function(_0x510b85){if(_0x510b85){if(_0x510b85['length']===0x0){_0x3dbae1[_0x0bac('0x4c')](_0x0bac('0x53'));}else{_0x3dbae1[_0x0bac('0x4c')](_0x0bac('0x4b'),_['map'](_0x510b85,'id'));}}})[_0x0bac('0x4e')](function(){return _0x3dbae1;});}function buildContactsQuery(_0x11204e,_0x181559,_0x3ff385,_0x532f0b,_0x1efb87,_0x1cdcdf){if(_0x181559){_0x181559=_0x3ff385[_0x0bac('0x54')];}_0x11204e=addFieldsToQuery(_0x11204e,_0x181559,_0x532f0b,_0x1cdcdf,!![]);var _0x19ed4f=squel['select']();_0x19ed4f=addFieldsToQuery(_0x19ed4f,_0x181559,_0x532f0b,_0x1cdcdf,![]);if(_0x532f0b||_0x1cdcdf){_0x11204e=applyJoinClauses(_0x11204e,!![]);_0x11204e[_0x0bac('0x55')](_0x0bac('0x56'));if(_0x3ff385[_0x0bac('0x57')]){_0x19ed4f['limit'](_0x3ff385[_0x0bac('0x57')]);}if(_0x3ff385[_0x0bac('0x58')]){_0x19ed4f[_0x0bac('0x58')](_0x3ff385[_0x0bac('0x58')]);}}else{_0x19ed4f=applyJoinClauses(_0x19ed4f,![]);_0x19ed4f[_0x0bac('0x55')](_0x0bac('0x59'));if(_0x3ff385[_0x0bac('0x57')]){_0x11204e[_0x0bac('0x57')](_0x3ff385[_0x0bac('0x57')]);}if(_0x3ff385['offset']){_0x11204e[_0x0bac('0x58')](_0x3ff385[_0x0bac('0x58')]);}}_0x19ed4f[_0x0bac('0x5a')](_0x1efb87);if(_0x3ff385[_0x0bac('0x5b')]){_0x3ff385[_0x0bac('0x5b')][_0x0bac('0x21')](function(_0x19716a){_0x11204e['order']('c.'+_0x19716a[0x0],_0x19716a[0x1]===_0x0bac('0x5c')?![]:!![]);_0x19ed4f['order'](_0x0bac('0x5d')+_0x19716a[0x0],_0x19716a[0x1]===_0x0bac('0x5c')?![]:!![]);});}_0x19ed4f[_0x0bac('0xb')](_0x11204e,_0x0bac('0xe'));return _0x19ed4f;}function getFilteredContacts(_0x9647fd){var _0x6de194=[];return db[_0x0bac('0x3f')][_0x0bac('0x5e')]({'attributes':['id',_0x0bac('0x36'),_0x0bac('0x5f')],'raw':!![]})['then'](function(_0x1084dc){_0x6de194=_[_0x0bac('0x60')](_0x1084dc,'id');var _0x399ac8={'type':db[_0x0bac('0x61')][_0x0bac('0x62')][_0x0bac('0x63')],'model':db[_0x0bac('0x64')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x0bac('0x65')][_0x0bac('0x66')](_0x9647fd[_0x0bac('0x67')](),_0x399ac8);})[_0x0bac('0x4e')](function(_0x95269e){_0x95269e[_0x0bac('0x21')](function(_0x5414a1){if(_0x5414a1[_0x0bac('0x1e')]){_0x5414a1[_0x0bac('0x68')]=[];_0x5414a1[_0x0bac('0x1e')][_0x0bac('0x28')](',')['forEach'](function(_0x263e8e){_0x5414a1['Tags'][_0x0bac('0x20')](_0x6de194[_0x263e8e]);});}delete _0x5414a1[_0x0bac('0x1e')];});return _0x95269e;});}function countFilteredContacts(_0x4de423,_0x4e4127){var _0xd81c38=_0x4de423[_0x0bac('0x69')]();_0xd81c38['field'](_0x0bac('0x6a'));_0xd81c38=applyJoinClauses(_0xd81c38,!![]);_0x4de423['group']('c.id');var _0x47b0e4=utils['getSelectedTags'](_0x4e4127);if(!_[_0x0bac('0x6b')](_0x47b0e4)){_0xd81c38[_0x0bac('0xc')](_0x0bac('0x6c'),_0x47b0e4);}var _0x2e526c={'type':db[_0x0bac('0x61')][_0x0bac('0x62')][_0x0bac('0x63')],'raw':!![]};return db[_0x0bac('0x65')][_0x0bac('0x66')](_0xd81c38['toString'](),_0x2e526c)[_0x0bac('0x4e')](function(_0x461686){return _0x461686[0x0][_0x0bac('0x6a')];});}module[_0x0bac('0x6d')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xbc6d=['isEmpty','t.id\x20IN\x20?','toString','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','role','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','phone','mobile','fax','CompanyId','deletedAt','TagIds','includes','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','DATE','buildExpression','type','default','text','value','start','map','tags','clause','and','ids','User','user','skip','some','compact','Contact','push','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','agent','getLists','attributes','group','c.id','limit','offset','subqry.id','having','order','DESC','subqry.','Tag','findAll','color','Sequelize','QueryTypes','SELECT','CmContact','sequelize','query','Tags','COUNT(*)'];(function(_0x3cc4c2,_0x856e05){var _0x1bef64=function(_0x1d8b89){while(--_0x1d8b89){_0x3cc4c2['push'](_0x3cc4c2['shift']());}};_0x1bef64(++_0x856e05);}(_0xbc6d,0x14b));var _0xdbc6=function(_0x2bf258,_0x5e0bb2){_0x2bf258=_0x2bf258-0x0;var _0x3b43af=_0xbc6d[_0x2bf258];return _0x3b43af;};'use strict';var _=require(_0xdbc6('0x0'));var squel=require(_0xdbc6('0x1'));var as=require(_0xdbc6('0x2'));var qs=require(_0xdbc6('0x3'));var utils=require(_0xdbc6('0x4'));var db=require(_0xdbc6('0x5'))['db'];function skipContactsQuery(_0x437bdb,_0x23585c){var _0x35c9a2=![];if(_0x437bdb[_0xdbc6('0x6')]==='agent'&&!_0x23585c[_0xdbc6('0x7')]&&!_0x23585c[_0xdbc6('0x8')]&&_0x23585c[_0xdbc6('0x9')]!==_0xdbc6('0xa')){_0x35c9a2=!![];}return _0x35c9a2;}function getContactsSubquery(){return squel[_0xdbc6('0xb')]()[_0xdbc6('0xc')](_0xdbc6('0xd'),'c')[_0xdbc6('0xe')](_0xdbc6('0xf'));}function applyJoinClauses(_0x308fb5,_0x49913b){var _0x1b6980=_0x49913b?'c':_0xdbc6('0x10');_0x308fb5[_0xdbc6('0x11')](_0xdbc6('0x12'),'uc',_0xdbc6('0x13')+_0x1b6980+_0xdbc6('0x14'))['left_join'](_0xdbc6('0x15'),'ct',_0xdbc6('0x16')+_0x1b6980+'.id')['left_join'](_0xdbc6('0x17'),'t','t.id\x20=\x20ct.TagId');return _0x308fb5;}function addFieldsToQuery(_0x31c5ce,_0x5c100b,_0x2110dd,_0x2e6f04,_0x43fcd5){var _0x2da40b=_0x43fcd5?'c':_0xdbc6('0x10');if(!_0x5c100b){_0x5c100b=['id','firstName','lastName',_0xdbc6('0x18'),_0xdbc6('0x19'),_0xdbc6('0x1a'),'email',_0xdbc6('0x8'),_0xdbc6('0x1b'),'createdAt','updatedAt',_0xdbc6('0x1c'),_0xdbc6('0x1d')];}else if(!_0x5c100b[_0xdbc6('0x1e')]('id')){_0x5c100b['push']('id');}var _0x1f337c=_0x2110dd&&_0x43fcd5||!_0x2110dd&&!_0x43fcd5;if(_0x2e6f04){_0x1f337c=_0x2e6f04&&_0x43fcd5||!_0x2e6f04&&!_0x43fcd5;}_0x5c100b[_0xdbc6('0x1f')](function(_0x30795c){if(_0x30795c===_0xdbc6('0x1d')){if(_0x1f337c){_0x31c5ce[_0xdbc6('0x20')](_0xdbc6('0x21'),_0x30795c);}else if(_0x2110dd||_0x2e6f04){_0x31c5ce['field'](_0x2da40b+'.'+_0x30795c);}}else{_0x31c5ce['field'](_0x2da40b+'.'+_0x30795c);}});return _0x31c5ce;}function getSqlClauses(){var _0xc96204={'default':squel[_0xdbc6('0x22')](),'fields':squel[_0xdbc6('0x22')](),'filter':squel[_0xdbc6('0x22')](),'tags':{'clause':squel[_0xdbc6('0x22')](),'ids':null},'user':{'clause':squel[_0xdbc6('0x22')](),'skip':![]}};return _0xc96204;}function parseTagParameter(_0x4eaa0a){var _0x5a80e8=squel[_0xdbc6('0x22')]();if(_0x4eaa0a){var _0x1464d5=utils[_0xdbc6('0x23')](_0x4eaa0a);_0x1464d5['forEach'](function(_0x2a9874){_0x5a80e8['or'](_0xdbc6('0x24'),'%,'+_0x2a9874+',%');});}return _0x5a80e8;}function parseSearchFilter(_0x2a6426){var _0x10f90c=squel[_0xdbc6('0x22')]();if(_0x2a6426){var _0x32c091=_0x2a6426[_0xdbc6('0x25')]('\x5c','\x5c\x5c')[_0xdbc6('0x25')](/'/g,'\x27\x27');if(_0x32c091[_0xdbc6('0x26')]('\x20')[_0xdbc6('0x27')]>0x1){_0x10f90c['or'](_0xdbc6('0x28'),qs[_0xdbc6('0x29')](_0x32c091),null);}else{if(qs[_0xdbc6('0x2a')](_0x32c091)){_0x10f90c['or'](_0xdbc6('0x2b'),_0x32c091+'%');_0x10f90c['or']('c.phone\x20LIKE\x20?',_0x32c091+'%');_0x10f90c['or'](_0xdbc6('0x2c'),_0x32c091+'%');_0x10f90c['or'](_0xdbc6('0x2d'),_0x32c091+'%');}else if(qs[_0xdbc6('0x2e')](_0x32c091)){_0x10f90c['or'](_0xdbc6('0x2f'),_0x32c091+'%');}else{_0x10f90c['or']('c.firstName\x20LIKE\x20?','%'+_0x32c091+'%');_0x10f90c['or']('c.lastName\x20LIKE\x20?','%'+_0x32c091+'%');_0x10f90c['or']('c.email\x20LIKE\x20?','%'+_0x32c091+'%');}}}return _0x10f90c;}function parseAdvancedSearchFilter(_0x80a2e4,_0x452eb5){var _0x2433c8=getSqlClauses();var _0x4d991d=as[_0xdbc6('0x30')](_0x80a2e4);var _0x19ba58=_0x4d991d['sqlOperator'];for(var _0x1240ff=0x0;_0x1240ff<_0x4d991d['conditions'][_0xdbc6('0x27')];_0x1240ff++){var _0x19cd69=_0x4d991d[_0xdbc6('0x31')][_0x1240ff];var _0x49da4a='c';var _0x43fef5=_['find'](_0x452eb5,[_0xdbc6('0x32'),_0x19cd69[_0xdbc6('0x20')]]);if(_0x43fef5){if(_0x19cd69[_0xdbc6('0x20')]===_0xdbc6('0x33')||_0x43fef5[_0xdbc6('0x34')]===_0xdbc6('0x35')){_0x19cd69['castTo']=_0xdbc6('0x36');}var _0xdf3c45=as[_0xdbc6('0x37')](_0x49da4a,_0x43fef5[_0xdbc6('0x38')],_0x19cd69);_0x2433c8[_0xdbc6('0x39')][_0x19ba58](_0xdf3c45[_0xdbc6('0x3a')],_0xdf3c45[_0xdbc6('0x3b')][_0xdbc6('0x3c')],_0xdf3c45[_0xdbc6('0x3b')]['end']);}else{if(_0x19cd69['field']==='Tag'){var _0xbd0b0b=_0x19cd69[_0xdbc6('0x3b')]['split'](',')[_0xdbc6('0x3d')](function(_0x2d926c){return Number(_0x2d926c);});var _0x147e21=parseTagParameter(_0xbd0b0b);_0x2433c8[_0xdbc6('0x3e')][_0xdbc6('0x3f')][_0xdbc6('0x40')](_0x147e21);_0x2433c8[_0xdbc6('0x3e')][_0xdbc6('0x41')]=_0xbd0b0b;}else if(_0x19cd69['field']===_0xdbc6('0x42')){_0x2433c8['user'][_0xdbc6('0x3f')]['and']('uc.UserId\x20=\x20?',_0x19cd69[_0xdbc6('0x3b')]);_0x2433c8[_0xdbc6('0x43')][_0xdbc6('0x44')]=!![];}}}return _0x2433c8;}function parseModelFields(_0x211d4f,_0x338c8d){var _0x3205cb=squel[_0xdbc6('0x22')]();var _0x1a4842=_(_0x211d4f)['keys']()[_0xdbc6('0x3d')](function(_0x2b72c9){return _[_0xdbc6('0x45')](_0x338c8d,[_0xdbc6('0x32'),_0x2b72c9])?_0x2b72c9:undefined;})[_0xdbc6('0x46')]()['value']();if(_0x211d4f[_0xdbc6('0x47')]){_0x1a4842[_0xdbc6('0x48')](_0xdbc6('0x47'));}if(_0x1a4842['length']>0x0){_0x1a4842[_0xdbc6('0x1f')](function(_0x11aec9){if(_0x11aec9===_0xdbc6('0x8')){_0x3205cb[_0xdbc6('0x40')](_0xdbc6('0x49'),[][_0xdbc6('0x4a')](_0x211d4f[_0x11aec9]));}else if(_0x11aec9==='Contact'){var _0x20fd44='%'+_0x211d4f[_0x11aec9]+'%';_0x3205cb[_0xdbc6('0x40')](_0xdbc6('0x4b'),_0x20fd44);}else{_0x3205cb['and']('c.'+_0x11aec9+_0xdbc6('0x4c'),_0x211d4f[_0x11aec9]);}});}return _0x3205cb;}function parseQueryParameters(_0x254800,_0x527be5){var _0x52113b=getSqlClauses();return Promise[_0xdbc6('0x4d')]()[_0xdbc6('0x4e')](function(){return parseModelFields(_0x254800,_0x527be5);})['then'](function(_0x4f679e){_0x52113b[_0xdbc6('0x4f')][_0xdbc6('0x40')](_0x4f679e);return parseTagParameter(_0x254800[_0xdbc6('0x50')]);})[_0xdbc6('0x4e')](function(_0x57a65b){_0x52113b[_0xdbc6('0x3e')]['clause'][_0xdbc6('0x40')](_0x57a65b);return parseSearchFilter(_0x254800[_0xdbc6('0x51')]);})['then'](function(_0x5c2e0c){_0x52113b[_0xdbc6('0x51')]=_0x5c2e0c;return _0x52113b;});}function checkListsRestrictions(_0x368341,_0x5b1366,_0x273451){var _0x467985=squel[_0xdbc6('0x22')]();return Promise[_0xdbc6('0x4d')]()[_0xdbc6('0x4e')](function(){if(_0x5b1366[_0xdbc6('0x7')]&&_0x368341[_0xdbc6('0x6')]===_0xdbc6('0x52')&&!_0x273451){return _0x368341[_0xdbc6('0x53')]({'attributes':['id'],'raw':!![]});}})[_0xdbc6('0x4e')](function(_0x17593b){if(_0x17593b){if(_0x17593b[_0xdbc6('0x27')]===0x0){_0x467985[_0xdbc6('0x40')]('c.ListId\x20IS\x20NULL');}else{_0x467985[_0xdbc6('0x40')]('c.ListId\x20IN\x20?',_[_0xdbc6('0x3d')](_0x17593b,'id'));}}})[_0xdbc6('0x4e')](function(){return _0x467985;});}function buildContactsQuery(_0x596bb5,_0x22d869,_0x26fae5,_0x330ace,_0x3422f9,_0x3f0087){if(_0x22d869){_0x22d869=_0x26fae5[_0xdbc6('0x54')];}_0x596bb5=addFieldsToQuery(_0x596bb5,_0x22d869,_0x330ace,_0x3f0087,!![]);var _0x211cf8=squel[_0xdbc6('0xb')]();_0x211cf8=addFieldsToQuery(_0x211cf8,_0x22d869,_0x330ace,_0x3f0087,![]);if(_0x330ace||_0x3f0087){_0x596bb5=applyJoinClauses(_0x596bb5,!![]);_0x596bb5[_0xdbc6('0x55')](_0xdbc6('0x56'));if(_0x26fae5[_0xdbc6('0x57')]){_0x211cf8[_0xdbc6('0x57')](_0x26fae5[_0xdbc6('0x57')]);}if(_0x26fae5[_0xdbc6('0x58')]){_0x211cf8[_0xdbc6('0x58')](_0x26fae5[_0xdbc6('0x58')]);}}else{_0x211cf8=applyJoinClauses(_0x211cf8,![]);_0x211cf8[_0xdbc6('0x55')](_0xdbc6('0x59'));if(_0x26fae5['limit']){_0x596bb5['limit'](_0x26fae5['limit']);}if(_0x26fae5[_0xdbc6('0x58')]){_0x596bb5[_0xdbc6('0x58')](_0x26fae5[_0xdbc6('0x58')]);}}_0x211cf8[_0xdbc6('0x5a')](_0x3422f9);if(_0x26fae5[_0xdbc6('0x5b')]){_0x26fae5[_0xdbc6('0x5b')][_0xdbc6('0x1f')](function(_0x5e0814){_0x596bb5[_0xdbc6('0x5b')]('c.'+_0x5e0814[0x0],_0x5e0814[0x1]===_0xdbc6('0x5c')?![]:!![]);_0x211cf8[_0xdbc6('0x5b')](_0xdbc6('0x5d')+_0x5e0814[0x0],_0x5e0814[0x1]===_0xdbc6('0x5c')?![]:!![]);});}_0x211cf8[_0xdbc6('0xc')](_0x596bb5,_0xdbc6('0x10'));return _0x211cf8;}function getFilteredContacts(_0x2657d0){var _0x276a18=[];return db[_0xdbc6('0x5e')][_0xdbc6('0x5f')]({'attributes':['id',_0xdbc6('0x32'),_0xdbc6('0x60')],'raw':!![]})[_0xdbc6('0x4e')](function(_0x14c031){_0x276a18=_['keyBy'](_0x14c031,'id');var _0x24d68b={'type':db[_0xdbc6('0x61')][_0xdbc6('0x62')][_0xdbc6('0x63')],'model':db[_0xdbc6('0x64')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xdbc6('0x65')][_0xdbc6('0x66')](_0x2657d0['toString'](),_0x24d68b);})[_0xdbc6('0x4e')](function(_0xffb739){_0xffb739['forEach'](function(_0x5f0256){if(_0x5f0256['TagIds']){_0x5f0256['Tags']=[];_0x5f0256['TagIds'][_0xdbc6('0x26')](',')[_0xdbc6('0x1f')](function(_0x56d5a9){_0x5f0256[_0xdbc6('0x67')][_0xdbc6('0x48')](_0x276a18[_0x56d5a9]);});}delete _0x5f0256[_0xdbc6('0x1d')];});return _0xffb739;});}function countFilteredContacts(_0x4d8120,_0x4e26ee){var _0x2e4264=_0x4d8120['clone']();_0x2e4264['field'](_0xdbc6('0x68'));_0x2e4264=applyJoinClauses(_0x2e4264,!![]);_0x4d8120[_0xdbc6('0x55')]('c.id');var _0x44525e=utils[_0xdbc6('0x23')](_0x4e26ee);if(!_[_0xdbc6('0x69')](_0x44525e)){_0x2e4264[_0xdbc6('0xe')](_0xdbc6('0x6a'),_0x44525e);}var _0xda851={'type':db[_0xdbc6('0x61')][_0xdbc6('0x62')][_0xdbc6('0x63')],'raw':!![]};return db['sequelize'][_0xdbc6('0x66')](_0x2e4264[_0xdbc6('0x6b')](),_0xda851)[_0xdbc6('0x4e')](function(_0x312b02){return _0x312b02[0x0][_0xdbc6('0x68')];});}module[_0xdbc6('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 904c422..508104c 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 _0xe07c=['final','end','close','decryptFile','createDecipher','unlink','secret','createCipher','base64','decryptString','utf8','crypto','lodash','../../config/environment','app','secrets','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','data','update','binary','write'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe07c,0xcb));var _0xce07=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xe07c[_0x27af45];return _0x18df21;};'use strict';var crypto=require(_0xce07('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xce07('0x1'));var config=require(_0xce07('0x2'));var logger=require('../../config/logger')(_0xce07('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xce07('0x4')]['session'],'algorithm':_0xce07('0x5')};const fileOptions={'algorithm':_0xce07('0x6')};if(config[_0xce07('0x7')]&&config[_0xce07('0x7')][_0xce07('0x8')]){var isSupported=isAlgorithmSupported(config[_0xce07('0x7')][_0xce07('0x8')]);if(isSupported){fileOptions[_0xce07('0x8')]=config['encrypt'][_0xce07('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xce07('0x9')](config[_0xce07('0x7')][_0xce07('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x392bee){return AES_SUPPORTED_RX[_0xce07('0xa')](_0x392bee);}function getSupportedCiphers(){return crypto[_0xce07('0xb')]()[_0xce07('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x48d96f){return getSupportedCiphers()[_0xce07('0xd')](_0x48d96f)>-0x1;}function combineOptions(_0x4af3a6){var _0x4d4eec={};for(var _0x4ab7cb in fileOptions){if(fileOptions[_0xce07('0xe')](_0x4ab7cb)){_0x4d4eec[_0x4ab7cb]=fileOptions[_0x4ab7cb];}}if(_0x4af3a6){for(var _0x392cec in _0x4af3a6){if(_0x4af3a6[_0xce07('0xe')](_0x392cec)){_0x4d4eec[_0x392cec]=_0x4af3a6[_0x392cec];}}}return _0x4d4eec;}exports[_0xce07('0xf')]=function(_0x3d4c59,_0x146b11,_0x5ebccb,_0xa8d272){return new BPromise(function(_0x5a8d03,_0x2ba7a7){_0xa8d272=combineOptions(_0xa8d272);var _0x118d95=new Buffer(_0x5ebccb);var _0x4ba148=fs['createReadStream'](_0x3d4c59);var _0x35e05a=fs[_0xce07('0x10')](_0x146b11);var _0x2f00a7=crypto['createCipher'](_0xa8d272['algorithm'],_0x118d95);_0x4ba148['on'](_0xce07('0x11'),function(_0x2178e9){var _0x21f1fe=new Buffer(_0x2f00a7[_0xce07('0x12')](_0x2178e9),_0xce07('0x13'));_0x35e05a[_0xce07('0x14')](_0x21f1fe);});_0x4ba148['on']('end',function(){try{var _0x597d6b=new Buffer(_0x2f00a7[_0xce07('0x15')](_0xce07('0x13')),'binary');_0x35e05a[_0xce07('0x14')](_0x597d6b);_0x35e05a[_0xce07('0x16')]();_0x35e05a['on'](_0xce07('0x17'),function(){return _0x5a8d03(_0x146b11);});}catch(_0x4e7d14){fs['unlink'](_0x146b11);return _0x2ba7a7(_0x4e7d14);}});});};exports[_0xce07('0x18')]=function(_0x2c6895,_0xd9cdb1,_0xcbe740,_0x412eee){return new BPromise(function(_0x4ffbb9,_0xab4f47){_0x412eee=combineOptions(_0x412eee);var _0x3410e7=new Buffer(_0xcbe740);var _0x138016=fs['createReadStream'](_0x2c6895);var _0x22b0c9=fs[_0xce07('0x10')](_0xd9cdb1);var _0x16b27d=crypto[_0xce07('0x19')](_0x412eee['algorithm'],_0x3410e7);_0x138016['on'](_0xce07('0x11'),function(_0x4a35be){var _0x566490=new Buffer(_0x16b27d['update'](_0x4a35be),_0xce07('0x13'));_0x22b0c9[_0xce07('0x14')](_0x566490);});_0x138016['on']('end',function(){try{var _0x5f023d=new Buffer(_0x16b27d[_0xce07('0x15')](_0xce07('0x13')),'binary');_0x22b0c9[_0xce07('0x14')](_0x5f023d);_0x22b0c9[_0xce07('0x16')]();_0x22b0c9['on'](_0xce07('0x17'),function(){return _0x4ffbb9(_0xd9cdb1);});}catch(_0x3cc963){fs[_0xce07('0x1a')](_0xd9cdb1);return _0xab4f47(_0x3cc963);}});});};exports['encryptString']=function(_0x4fef0e,_0x1bd410,_0x2f3eaf){var _0x19d47f=_0x2f3eaf||stringOptions[_0xce07('0x8')];var _0x278f6b=_0x1bd410||stringOptions[_0xce07('0x1b')];var _0x204693=crypto[_0xce07('0x1c')](_0x19d47f,_0x278f6b);var _0x38a59a=_0x204693[_0xce07('0x12')](_0x4fef0e,'utf8',_0xce07('0x1d'));_0x38a59a+=_0x204693['final'](_0xce07('0x1d'));return _0x38a59a;};exports[_0xce07('0x1e')]=function(_0x4fc816,_0x1e8626,_0x1b7d9e){var _0x3d990b=_0x1b7d9e||stringOptions[_0xce07('0x8')];var _0x3ab96c=_0x1e8626||stringOptions[_0xce07('0x1b')];var _0x5d6984=crypto[_0xce07('0x19')](_0x3d990b,_0x3ab96c);var _0x58a9e0=_0x5d6984[_0xce07('0x12')](_0x4fc816,_0xce07('0x1d'),_0xce07('0x1f'));_0x58a9e0+=_0x5d6984['final'](_0xce07('0x1f'));return _0x58a9e0;}; \ No newline at end of file +var _0x8229=['crypto','bluebird','lodash','../../config/environment','../../config/logger','session','encrypt','algorithm','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','utf8','base64','decryptString','secret'];(function(_0x56c809,_0x305058){var _0x7e8952=function(_0x508ec8){while(--_0x508ec8){_0x56c809['push'](_0x56c809['shift']());}};_0x7e8952(++_0x305058);}(_0x8229,0xe7));var _0x9822=function(_0x4ed8af,_0x475fe2){_0x4ed8af=_0x4ed8af-0x0;var _0x3ee848=_0x8229[_0x4ed8af];return _0x3ee848;};'use strict';var crypto=require(_0x9822('0x0'));var fs=require('fs');var BPromise=require(_0x9822('0x1'));var _=require(_0x9822('0x2'));var config=require(_0x9822('0x3'));var logger=require(_0x9822('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x9822('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':'aes192'};if(config[_0x9822('0x6')]&&config['encrypt'][_0x9822('0x7')]){var isSupported=isAlgorithmSupported(config[_0x9822('0x6')][_0x9822('0x7')]);if(isSupported){fileOptions[_0x9822('0x7')]=config[_0x9822('0x6')][_0x9822('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger['error'](config['encrypt'][_0x9822('0x7')],_0x9822('0x8'),supportedAlgorithms);}}function isASupportedCipher(_0x1e733b){return AES_SUPPORTED_RX[_0x9822('0x9')](_0x1e733b);}function getSupportedCiphers(){return crypto[_0x9822('0xa')]()[_0x9822('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x21cdfa){return getSupportedCiphers()[_0x9822('0xc')](_0x21cdfa)>-0x1;}function combineOptions(_0x458208){var _0x43b6c8={};for(var _0x54989d in fileOptions){if(fileOptions[_0x9822('0xd')](_0x54989d)){_0x43b6c8[_0x54989d]=fileOptions[_0x54989d];}}if(_0x458208){for(var _0x25802f in _0x458208){if(_0x458208[_0x9822('0xd')](_0x25802f)){_0x43b6c8[_0x25802f]=_0x458208[_0x25802f];}}}return _0x43b6c8;}exports[_0x9822('0xe')]=function(_0x4a3f15,_0x41a04e,_0x367b37,_0x4c8e01){return new BPromise(function(_0x7996fe,_0xc28c0d){_0x4c8e01=combineOptions(_0x4c8e01);var _0x33bc85=new Buffer(_0x367b37);var _0x37e4ce=fs['createReadStream'](_0x4a3f15);var _0x129b6f=fs[_0x9822('0xf')](_0x41a04e);var _0x15b7f9=crypto[_0x9822('0x10')](_0x4c8e01[_0x9822('0x7')],_0x33bc85);_0x37e4ce['on'](_0x9822('0x11'),function(_0x196d17){var _0x122c09=new Buffer(_0x15b7f9[_0x9822('0x12')](_0x196d17),_0x9822('0x13'));_0x129b6f[_0x9822('0x14')](_0x122c09);});_0x37e4ce['on'](_0x9822('0x15'),function(){try{var _0xd3eee8=new Buffer(_0x15b7f9[_0x9822('0x16')](_0x9822('0x13')),_0x9822('0x13'));_0x129b6f[_0x9822('0x14')](_0xd3eee8);_0x129b6f[_0x9822('0x15')]();_0x129b6f['on'](_0x9822('0x17'),function(){return _0x7996fe(_0x41a04e);});}catch(_0x2ec276){fs[_0x9822('0x18')](_0x41a04e);return _0xc28c0d(_0x2ec276);}});});};exports[_0x9822('0x19')]=function(_0x589a38,_0x318a9f,_0x363d73,_0x4b9424){return new BPromise(function(_0x48548a,_0x3219ab){_0x4b9424=combineOptions(_0x4b9424);var _0x1529a0=new Buffer(_0x363d73);var _0x442327=fs[_0x9822('0x1a')](_0x589a38);var _0x37cbec=fs['createWriteStream'](_0x318a9f);var _0x2df1d5=crypto[_0x9822('0x1b')](_0x4b9424['algorithm'],_0x1529a0);_0x442327['on'](_0x9822('0x11'),function(_0x3fda37){var _0xfba08f=new Buffer(_0x2df1d5[_0x9822('0x12')](_0x3fda37),_0x9822('0x13'));_0x37cbec['write'](_0xfba08f);});_0x442327['on'](_0x9822('0x15'),function(){try{var _0xe64ea4=new Buffer(_0x2df1d5[_0x9822('0x16')](_0x9822('0x13')),_0x9822('0x13'));_0x37cbec[_0x9822('0x14')](_0xe64ea4);_0x37cbec['end']();_0x37cbec['on'](_0x9822('0x17'),function(){return _0x48548a(_0x318a9f);});}catch(_0x27b73a){fs[_0x9822('0x18')](_0x318a9f);return _0x3219ab(_0x27b73a);}});});};exports[_0x9822('0x1c')]=function(_0x669eb1,_0x53b578,_0x26aec5){var _0x1f4ebb=_0x26aec5||stringOptions[_0x9822('0x7')];var _0x556b1a=_0x53b578||stringOptions['secret'];var _0x5ab093=crypto[_0x9822('0x10')](_0x1f4ebb,_0x556b1a);var _0x37a036=_0x5ab093[_0x9822('0x12')](_0x669eb1,_0x9822('0x1d'),'base64');_0x37a036+=_0x5ab093[_0x9822('0x16')](_0x9822('0x1e'));return _0x37a036;};exports[_0x9822('0x1f')]=function(_0x161d6e,_0x3d2388,_0x501f00){var _0x31246e=_0x501f00||stringOptions['algorithm'];var _0x3eeb50=_0x3d2388||stringOptions[_0x9822('0x20')];var _0x1f0ee0=crypto[_0x9822('0x1b')](_0x31246e,_0x3eeb50);var _0x541f4b=_0x1f0ee0[_0x9822('0x12')](_0x161d6e,'base64',_0x9822('0x1d'));_0x541f4b+=_0x1f0ee0[_0x9822('0x16')](_0x9822('0x1d'));return _0x541f4b;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 8f77df6..0b00548 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 _0x5281=['QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','length','existsSync','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','info','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','exit','util','path','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x586890,_0x57399f){var _0x3bbc16=function(_0x5362fd){while(--_0x5362fd){_0x586890['push'](_0x586890['shift']());}};_0x3bbc16(++_0x57399f);}(_0x5281,0xb7));var _0x1528=function(_0x76401d,_0x170972){_0x76401d=_0x76401d-0x0;var _0x5cd76b=_0x5281[_0x76401d];return _0x5cd76b;};'use strict';var util=require(_0x1528('0x0'));var path=require(_0x1528('0x1'));var _=require('lodash');var csv=require(_0x1528('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x1528('0x3'));var rimraf=require(_0x1528('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1528('0x5'))[_0x1528('0x6')];var logger=require(_0x1528('0x7'))(_0x1528('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x1528('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x571c94,_0x3cc618){var _0x1da6bf={'status':_0x571c94};var _0x4ba89c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3cc618){_0x1da6bf[_0x1528('0xa')]=_0x3cc618;}return db[_0x1528('0xb')][_0x1528('0xc')](_0x1da6bf,_0x4ba89c);}function main(){var _0x1e1378=0x1388;var _0x13d15c;logger['info'](util[_0x1528('0xd')](_0x1528('0xe'),EXTRACTED_REPORT_ID,_0x1528('0xf')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1528('0x10'),_0x1528('0x11')]})[_0x1528('0x12')](function(_0x56f9b4){if(_0x56f9b4){_0x13d15c=_0x56f9b4;_0x1e1378=_0x13d15c[_0x1528('0x11')]||0x1388;}})['then'](function(){return dbH[_0x1528('0x13')]['query'](util[_0x1528('0xd')](_0x1528('0x14'),QUERY),{'type':dbH[_0x1528('0x13')][_0x1528('0x15')][_0x1528('0x16')]});})[_0x1528('0x12')](function(_0x4e0419){if(!_0x4e0419[0x0][_0x1528('0x17')]){return analyticExtractedReport(_0x1528('0x18'));}var _0x3b3a73=[];var _0x48e2ca=0x0;if(_0x13d15c['split']){if(_0x4e0419&&_0x4e0419['length']){var _0x3c9805=_[_0x1528('0x19')](_0x4e0419[0x0][_0x1528('0x17')]/_0x1e1378);var _0x240ce3=Number[_0x1528('0x1a')](_0x4e0419[0x0][_0x1528('0x17')]/_0x1e1378)?_0x4e0419[0x0][_0x1528('0x17')]%_0x1e1378:0x0;_0x3c9805[_0x1528('0x1b')](function(_0x18febd){if(_0x18febd>0x0){_0x48e2ca+=_0x1e1378;}_0x3b3a73[_0x1528('0x1c')](dbH['sequelize']['query'](util[_0x1528('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1e1378,_0x48e2ca),{'type':dbH[_0x1528('0x13')]['QueryTypes'][_0x1528('0x16')]}));});if(_0x240ce3>0x0){_0x48e2ca+=_0x1e1378;_0x3b3a73[_0x1528('0x1c')](dbH[_0x1528('0x13')][_0x1528('0x1d')](util[_0x1528('0xd')](_0x1528('0x1e'),QUERY,_0x240ce3,_0x48e2ca),{'type':dbH['sequelize']['QueryTypes'][_0x1528('0x16')]}));}}}else{_0x3b3a73[_0x1528('0x1c')](dbH['sequelize'][_0x1528('0x1d')](QUERY,{'type':dbH[_0x1528('0x13')][_0x1528('0x15')]['SELECT']}));}var _0x5e34ec=path[_0x1528('0x1f')](PATH);var _0x34784a=path[_0x1528('0x20')](PATH,_0x1528('0x21'));var _0x446112=_0x13d15c[_0x1528('0x10')]&&_0x3b3a73[_0x1528('0x22')]>0x1;var _0x488728=[];if(!fs[_0x1528('0x23')](path[_0x1528('0x24')](_0x5e34ec,_0x34784a))&&_0x446112){fs[_0x1528('0x25')](path[_0x1528('0x24')](_0x5e34ec,_0x34784a));}return BPromise['each'](_0x3b3a73,function(_0x35ade6){_0x488728[_0x1528('0x1c')](_0x35ade6);})[_0x1528('0x12')](function(){for(var _0x41309e=0x0;_0x41309e<_0x488728[_0x1528('0x22')];_0x41309e+=0x1){var _0x50c38f;var _0x2bd031=_0x488728[_0x41309e];if(_0x446112){_0x50c38f=path['join'](_0x5e34ec,_0x34784a,util[_0x1528('0xd')](_0x1528('0x26'),_0x34784a,_0x41309e,'csv'));}else{_0x50c38f=path[_0x1528('0x24')](_0x5e34ec,util[_0x1528('0xd')](_0x1528('0x27'),_0x34784a,_0x1528('0x28')));}fs[_0x1528('0x29')](_0x50c38f,csv(_0x2bd031));}})[_0x1528('0x12')](function(){if(_0x446112){return new Promise(function(_0x4eefee){zipdir(path[_0x1528('0x24')](_0x5e34ec,_0x34784a),{'saveTo':path[_0x1528('0x24')](_0x5e34ec,util['format'](_0x1528('0x27'),_0x34784a,_0x1528('0x2a')))},function(_0x117d45,_0x6a90cc){rimraf(path['join'](_0x5e34ec,_0x34784a),function(){});_0x4eefee(_0x1528('0x2b'));});});}})['then'](function(){logger[_0x1528('0x2c')](util['format'](_0x1528('0x2d'),EXTRACTED_REPORT_ID,_0x1528('0xf')));return analyticExtractedReport(_0x1528('0x2e'),_0x446112?util[_0x1528('0xd')](_0x1528('0x27'),_0x34784a,_0x446112?'zip':_0x1528('0x28')):null);});})['catch'](function(_0x3fecb5){logger[_0x1528('0x2c')](util[_0x1528('0xd')](_0x1528('0x2f'),EXTRACTED_REPORT_ID,_0x1528('0xf')),util[_0x1528('0x30')](_0x3fecb5,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1528('0x31'));})['finally'](function(){process[_0x1528('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xa4ce=['bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','QueryTypes','dirname','.csv','join','mkdirSync','then','%s%d.%s','%s.%s','csv','writeFileSync','zip','Completed','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','path','lodash','to-csv'];(function(_0x6918e0,_0x2bc1df){var _0x4f3c61=function(_0x2304f7){while(--_0x2304f7){_0x6918e0['push'](_0x6918e0['shift']());}};_0x4f3c61(++_0x2bc1df);}(_0xa4ce,0x1ec));var _0xea4c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xa4ce[_0x2b5eae];return _0x5f3ac9;};'use strict';var util=require('util');var path=require(_0xea4c('0x0'));var _=require(_0xea4c('0x1'));var csv=require(_0xea4c('0x2'));var fs=require('fs');var BPromise=require(_0xea4c('0x3'));var zipdir=require(_0xea4c('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xea4c('0x5'))[_0xea4c('0x6')];var logger=require(_0xea4c('0x7'))(_0xea4c('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xea4c('0x9')][0x2]);var QUERY=process[_0xea4c('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5780c4,_0x76f1ed){var _0x44b062={'status':_0x5780c4};var _0x162434={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x76f1ed){_0x44b062['savename']=_0x76f1ed;}return db[_0xea4c('0xa')][_0xea4c('0xb')](_0x44b062,_0x162434);}function main(){var _0x91f8cc=0x1388;var _0x28ff03;logger['info'](util[_0xea4c('0xc')](_0xea4c('0xd'),EXTRACTED_REPORT_ID,_0xea4c('0xe')));return db[_0xea4c('0xf')][_0xea4c('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xea4c('0x11'),_0xea4c('0x12')]})['then'](function(_0x60236){if(_0x60236){_0x28ff03=_0x60236;_0x91f8cc=_0x28ff03[_0xea4c('0x12')]||0x1388;}})['then'](function(){return dbH[_0xea4c('0x13')]['query'](util['format'](_0xea4c('0x14'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xea4c('0x15')]});})['then'](function(_0x29f227){if(!_0x29f227[0x0][_0xea4c('0x16')]){return analyticExtractedReport(_0xea4c('0x17'));}var _0x52cc9d=[];var _0x547bcd=0x0;if(_0x28ff03[_0xea4c('0x11')]){if(_0x29f227&&_0x29f227[_0xea4c('0x18')]){var _0x45d855=_['range'](_0x29f227[0x0][_0xea4c('0x16')]/_0x91f8cc);var _0x3cde4a=Number['isInteger'](_0x29f227[0x0]['num']/_0x91f8cc)?_0x29f227[0x0][_0xea4c('0x16')]%_0x91f8cc:0x0;_0x45d855[_0xea4c('0x19')](function(_0x22d4f3){if(_0x22d4f3>0x0){_0x547bcd+=_0x91f8cc;}_0x52cc9d['push'](dbH[_0xea4c('0x13')][_0xea4c('0x1a')](util[_0xea4c('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x91f8cc,_0x547bcd),{'type':dbH['sequelize']['QueryTypes'][_0xea4c('0x15')]}));});if(_0x3cde4a>0x0){_0x547bcd+=_0x91f8cc;_0x52cc9d['push'](dbH[_0xea4c('0x13')][_0xea4c('0x1a')](util['format'](_0xea4c('0x1b'),QUERY,_0x3cde4a,_0x547bcd),{'type':dbH[_0xea4c('0x13')]['QueryTypes'][_0xea4c('0x15')]}));}}}else{_0x52cc9d[_0xea4c('0x1c')](dbH[_0xea4c('0x13')][_0xea4c('0x1a')](QUERY,{'type':dbH['sequelize'][_0xea4c('0x1d')][_0xea4c('0x15')]}));}var _0x816a7b=path[_0xea4c('0x1e')](PATH);var _0x57b1d9=path['basename'](PATH,_0xea4c('0x1f'));var _0x511ddf=_0x28ff03[_0xea4c('0x11')]&&_0x52cc9d[_0xea4c('0x18')]>0x1;var _0x37724b=[];if(!fs['existsSync'](path[_0xea4c('0x20')](_0x816a7b,_0x57b1d9))&&_0x511ddf){fs[_0xea4c('0x21')](path['join'](_0x816a7b,_0x57b1d9));}return BPromise['each'](_0x52cc9d,function(_0x123041){_0x37724b[_0xea4c('0x1c')](_0x123041);})[_0xea4c('0x22')](function(){for(var _0x3c3648=0x0;_0x3c3648<_0x37724b[_0xea4c('0x18')];_0x3c3648+=0x1){var _0x1cc53d;var _0x4ca413=_0x37724b[_0x3c3648];if(_0x511ddf){_0x1cc53d=path[_0xea4c('0x20')](_0x816a7b,_0x57b1d9,util[_0xea4c('0xc')](_0xea4c('0x23'),_0x57b1d9,_0x3c3648,'csv'));}else{_0x1cc53d=path[_0xea4c('0x20')](_0x816a7b,util[_0xea4c('0xc')](_0xea4c('0x24'),_0x57b1d9,_0xea4c('0x25')));}fs[_0xea4c('0x26')](_0x1cc53d,csv(_0x4ca413));}})[_0xea4c('0x22')](function(){if(_0x511ddf){return new Promise(function(_0x1ed60e){zipdir(path['join'](_0x816a7b,_0x57b1d9),{'saveTo':path[_0xea4c('0x20')](_0x816a7b,util[_0xea4c('0xc')](_0xea4c('0x24'),_0x57b1d9,_0xea4c('0x27')))},function(_0x240e05,_0x104b2b){rimraf(path[_0xea4c('0x20')](_0x816a7b,_0x57b1d9),function(){});_0x1ed60e('zip\x20finished');});});}})[_0xea4c('0x22')](function(){logger['info'](util[_0xea4c('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xea4c('0x28'),_0x511ddf?util[_0xea4c('0xc')](_0xea4c('0x24'),_0x57b1d9,_0x511ddf?_0xea4c('0x27'):_0xea4c('0x25')):null);});})['catch'](function(_0x19af50){logger[_0xea4c('0x29')](util[_0xea4c('0xc')](_0xea4c('0x2a'),EXTRACTED_REPORT_ID,'CSV'),util[_0xea4c('0x2b')](_0x19af50,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xea4c('0x2c')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 897ee0f..f53244b 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 _0xd43a=['pick','value','fill','length','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','before','margin','landscape','toString','\x20/\x20','footer','Arial','num','Empty','Setting','find','splitSizePdf','then','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','moment','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','tableHeader'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0xd43a,0xa4));var _0xad43=function(_0x3600f7,_0x4d0042){_0x3600f7=_0x3600f7-0x0;var _0x2afdba=_0xd43a[_0x3600f7];return _0x2afdba;};'use strict';var _=require(_0xad43('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0xad43('0x1'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0xad43('0x2'))[_0xad43('0x3')];var window=new JSDOM('')[_0xad43('0x4')];var BPromise=require(_0xad43('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xad43('0x6'))['dbH'];var logger=require(_0xad43('0x7'))(_0xad43('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xad43('0x9')][0x2]);var QUERY=process[_0xad43('0x9')][0x3];var PATH=process[_0xad43('0x9')][0x4];var NAME=process[_0xad43('0x9')][0x5];var FORMAT=_0xad43('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x45aef4,_0x142572){var _0x3d94f0={'status':_0x45aef4};var _0x2feba8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x142572){_0x3d94f0[_0xad43('0xb')]=_0x142572;}return db[_0xad43('0xc')][_0xad43('0xd')](_0x3d94f0,_0x2feba8);}function getHeaders(_0x308c6e){return _[_0xad43('0xe')](_0x308c6e,function(_0x5280ff){return{'text':_0x5280ff,'style':_0xad43('0xf')};});}function getRows(_0x48b39f,_0x215a7a){return _[_0xad43('0xe')](_0x215a7a,function(_0x2c3285){return _(_0x2c3285)[_0xad43('0x10')](_0x48b39f)['map'](function(_0x4c71e6){return _0x4c71e6?_['toString'](_0x4c71e6):'';})[_0xad43('0x11')]();});}function createTable(_0x192849,_0x35abdf){var _0x28d45a={'widths':_[_0xad43('0x12')](Array(_0x192849[_0xad43('0x13')]),0x91),'heights':function(_0xe57e61){return _0xe57e61===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2aa079=getHeaders(_0x192849);_0x28d45a[_0xad43('0x14')][_0xad43('0x15')](_0x2aa079);var _0x1d0e32=getRows(_0x192849,_0x35abdf);_0x28d45a[_0xad43('0x14')]=_0x28d45a[_0xad43('0x14')][_0xad43('0x16')](_0x1d0e32);return _0x28d45a;}function createTables(_0x4aba8a){var _0x3ec17c=[];var _0x42f1c8=_[_0xad43('0x17')](Object[_0xad43('0x18')](_0x4aba8a[0x0]),0x5);_0x42f1c8[_0xad43('0x19')](function(_0x121e5c){_0x3ec17c[_0xad43('0x15')](createTable(_0x121e5c,_0x4aba8a));});return _0x3ec17c;}function getPDFDocDefinition(_0x31ef73){var _0x4de4e0=util[_0xad43('0x1a')](_0xad43('0x1b'),NAME,EXTRACTED_REPORT[_0xad43('0x1c')],moment(EXTRACTED_REPORT[_0xad43('0x1d')])[_0xad43('0x1a')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xad43('0x1a')](FORMAT));var _0x28b9e0=[];for(var _0x52da6d=0x0;_0x52da6d<_0x31ef73[_0xad43('0x13')];_0x52da6d++){var _0x85b655=[];if(_0x52da6d===0x0){_0x85b655[_0xad43('0x15')]({'text':_0x4de4e0,'style':'header'});}var _0x167f80={'table':_0x31ef73[_0x52da6d]};if(_0x52da6d>0x0){_0x167f80['pageBreak']=_0xad43('0x1e');_0x167f80[_0xad43('0x1f')]=[0x0,0x46,0x0,0x0];}_0x85b655[_0xad43('0x15')](_0x167f80);_0x28b9e0[_0xad43('0x15')](_0x85b655);}return{'pageSize':'A4','pageOrientation':_0xad43('0x20'),'content':_0x28b9e0,'footer':function(_0x4ae4fb,_0x2450e7){return{'text':_0x4ae4fb[_0xad43('0x21')]()+_0xad43('0x22')+_0x2450e7,'style':_0xad43('0x23')};},'defaultStyle':{'font':_0xad43('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x43601f){var _0x3c1a9b=0x1388;var _0x572b6d;if(!_0x43601f[0x0][_0xad43('0x25')]){return analyticExtractedReport(_0xad43('0x26'));}return db[_0xad43('0x27')][_0xad43('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xad43('0x29')]})[_0xad43('0x2a')](function(_0x264e0e){if(_0x264e0e){_0x572b6d=_0x264e0e;_0x3c1a9b=_0x572b6d[_0xad43('0x29')]||0x3e8;}})[_0xad43('0x2a')](function(){var _0x43b633=[];var _0x1e01a4=0x0;if(_0x572b6d['split']){if(_0x43601f&&_0x43601f['length']){var _0x46610d=_[_0xad43('0x2b')](_0x43601f[0x0][_0xad43('0x25')]/_0x3c1a9b);var _0xb23253=Number['isInteger'](_0x43601f[0x0][_0xad43('0x25')]/_0x3c1a9b)?_0x43601f[0x0]['num']%_0x3c1a9b:0x0;_0x46610d[_0xad43('0x19')](function(_0x171e83){if(_0x171e83>0x0){_0x1e01a4+=_0x3c1a9b;}_0x43b633[_0xad43('0x15')](dbH[_0xad43('0x2c')][_0xad43('0x2d')](util[_0xad43('0x1a')](_0xad43('0x2e'),QUERY,_0x3c1a9b,_0x1e01a4),{'type':dbH['sequelize'][_0xad43('0x2f')]['SELECT']}));});if(_0xb23253>0x0){_0x1e01a4+=_0x3c1a9b;_0x43b633[_0xad43('0x15')](dbH[_0xad43('0x2c')][_0xad43('0x2d')](util[_0xad43('0x1a')](_0xad43('0x2e'),QUERY,_0xb23253,_0x1e01a4),{'type':dbH['sequelize'][_0xad43('0x2f')][_0xad43('0x30')]}));}}}else{_0x43b633['push'](dbH[_0xad43('0x2c')][_0xad43('0x2d')](QUERY,{'type':dbH[_0xad43('0x2c')]['QueryTypes']['SELECT']}));}var _0x5bae82=path[_0xad43('0x31')](PATH);var _0x211ee8=path[_0xad43('0x32')](PATH,'.pdf');var _0x41e988=_0x572b6d['split']&&_0x43b633[_0xad43('0x13')]>0x1;var _0x5bff42=[];if(!fs[_0xad43('0x33')](path[_0xad43('0x34')](_0x5bae82,_0x211ee8))&&_0x41e988){fs[_0xad43('0x35')](path[_0xad43('0x34')](_0x5bae82,_0x211ee8));}return BPromise[_0xad43('0x36')](_0x43b633,function(_0x26ed51){_0x5bff42['push'](_0x26ed51);})['then'](function(){var _0x2c07f9=[];for(var _0x17be10=0x0;_0x17be10<_0x5bff42[_0xad43('0x13')];_0x17be10+=0x1){var _0x37ad4f=_0x5bff42[_0x17be10];var _0x3aca26=createTables(_[_0xad43('0x37')](_0x37ad4f));var _0x3fe634;var _0x146ebe=getPDFDocDefinition(_0x3aca26);var _0x5b5b68=getPDFPrinter();var _0x3e57e1=_0x5b5b68[_0xad43('0x38')](_0x146ebe);if(_0x41e988){_0x3fe634=path[_0xad43('0x34')](_0x5bae82,_0x211ee8,util[_0xad43('0x1a')]('%s%d.%s',_0x211ee8,_0x17be10,_0xad43('0x39')));}else{_0x3fe634=path[_0xad43('0x34')](_0x5bae82,util[_0xad43('0x1a')](_0xad43('0x3a'),_0x211ee8,_0xad43('0x39')));}_0x2c07f9[_0xad43('0x15')](writePDFDocument(_0x3e57e1,_0x3fe634));}return Promise[_0xad43('0x3b')](_0x2c07f9);})[_0xad43('0x2a')](function(){if(_0x41e988){return new Promise(function(_0x596385){zipdir(path[_0xad43('0x34')](_0x5bae82,_0x211ee8),{'saveTo':path[_0xad43('0x34')](_0x5bae82,util[_0xad43('0x1a')](_0xad43('0x3a'),_0x211ee8,_0xad43('0x3c')))},function(){rimraf(path[_0xad43('0x34')](_0x5bae82,_0x211ee8),function(){});_0x596385(_0xad43('0x3d'));});});}})[_0xad43('0x2a')](function(){if(!_0x41e988)return;rimraf(path['join'](_0x5bae82,_0x211ee8),function(){});})[_0xad43('0x2a')](function(){logger[_0xad43('0x3e')](util[_0xad43('0x1a')](_0xad43('0x3f'),EXTRACTED_REPORT_ID,_0xad43('0x40')));return analyticExtractedReport(_0xad43('0x41'),_0x41e988?util['format'](_0xad43('0x3a'),_0x211ee8,_0x41e988?_0xad43('0x3c'):_0xad43('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xad43('0x3e')](util[_0xad43('0x1a')](_0xad43('0x42'),EXTRACTED_REPORT_ID,_0xad43('0x40')));return db['AnalyticExtractedReport'][_0xad43('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x447c7b){EXTRACTED_REPORT=_0x447c7b;return dbH['sequelize']['query'](util[_0xad43('0x1a')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xad43('0x2c')][_0xad43('0x2f')][_0xad43('0x30')]});})[_0xad43('0x2a')](extractReport)[_0xad43('0x44')](function(_0x420125){logger[_0xad43('0x3e')](util[_0xad43('0x1a')](_0xad43('0x45'),EXTRACTED_REPORT_ID,'PDF'),util[_0xad43('0x46')](_0x420125,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xad43('0x47'));})['finally'](function(){process[_0xad43('0x48')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x257bb4=new PdfPrinter({'Arial':{'normal':__dirname+_0xad43('0x49'),'bold':__dirname+_0xad43('0x4a'),'italics':__dirname+_0xad43('0x4b'),'bolditalics':__dirname+_0xad43('0x4c')}});return _0x257bb4;}function getPDFDocDefinitionFromHTML(_0x666eda,_0x2418fa){var _0x4209dd=util[_0xad43('0x1a')](_0xad43('0x4d'),_0x2418fa['channel'],_0x2418fa[_0xad43('0x4e')]);var _0x41814e=moment()[_0xad43('0x1a')](_0xad43('0x4f'))['toString']();var _0x3b0349=htmlToPdfmake(_0x666eda,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3b0349],'defaultStyle':{'font':_0xad43('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xad43('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xad43('0x50')}},'header':function(){return[{'text':_0xad43('0x51'),'style':_0xad43('0x52')}];},'footer':function(_0x14dd63,_0x461638){return[{'text':util[_0xad43('0x1a')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x4209dd,_0x14dd63,_0x461638,_0x41814e),'style':_0xad43('0x23')}];}};}function writePDFDocument(_0x23b88b,_0x56c9f8){return new Promise(function(_0x193ea6,_0x3e99c3){var _0x472a64=_0x23b88b[_0xad43('0x53')](fs[_0xad43('0x54')](_0x56c9f8));_0x472a64['on']('finish',function(){_0x193ea6(_0xad43('0x55'));});_0x472a64['on'](_0xad43('0x56'),function(_0xdbeb3){_0x3e99c3(_0xdbeb3);});_0x23b88b[_0xad43('0x57')]();});}exports[_0xad43('0x58')]=function(_0x220be4,_0x5d0be2){var _0x707f73=getPDFPrinter();var _0x1ce6c3=getPDFDocDefinitionFromHTML(_0x220be4,_0x5d0be2);var _0x453f3a=_0x707f73[_0xad43('0x38')](_0x1ce6c3);return writePDFDocument(_0x453f3a,_0x5d0be2[_0xad43('0x59')])[_0xad43('0x44')](function(_0x37566c){throw _0x37566c;});}; \ No newline at end of file +var _0xe864=['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','Interaction\x20Transcript','finish','error','end','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','toString','value','body','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','before','margin','push','\x20/\x20','footer','Arial','Setting','split','splitSizePdf','then','length','range','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','PDF','Completed','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x2c6905,_0x99469e){var _0x124a00=function(_0xa7dabc){while(--_0xa7dabc){_0x2c6905['push'](_0x2c6905['shift']());}};_0x124a00(++_0x99469e);}(_0xe864,0xbf));var _0x4e86=function(_0x1819d1,_0x311e3d){_0x1819d1=_0x1819d1-0x0;var _0x55e84e=_0xe864[_0x1819d1];return _0x55e84e;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x4e86('0x0'));var moment=require(_0x4e86('0x1'));var htmlToPdfmake=require(_0x4e86('0x2'));var PdfPrinter=require(_0x4e86('0x3'));var zipdir=require(_0x4e86('0x4'));var rimraf=require(_0x4e86('0x5'));var JSDOM=require(_0x4e86('0x6'))[_0x4e86('0x7')];var window=new JSDOM('')['window'];var BPromise=require(_0x4e86('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0x4e86('0x9'))[_0x4e86('0xa')];var logger=require(_0x4e86('0xb'))(_0x4e86('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x4e86('0xd')][0x2]);var QUERY=process[_0x4e86('0xd')][0x3];var PATH=process[_0x4e86('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x4e86('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1e37a6,_0x565155){var _0x387cb9={'status':_0x1e37a6};var _0x36f891={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x565155){_0x387cb9[_0x4e86('0xf')]=_0x565155;}return db['AnalyticExtractedReport'][_0x4e86('0x10')](_0x387cb9,_0x36f891);}function getHeaders(_0x5e6e2f){return _[_0x4e86('0x11')](_0x5e6e2f,function(_0x5019e8){return{'text':_0x5019e8,'style':_0x4e86('0x12')};});}function getRows(_0x55c861,_0x5aca44){return _[_0x4e86('0x11')](_0x5aca44,function(_0x3a7b64){return _(_0x3a7b64)['pick'](_0x55c861)['map'](function(_0x206257){return _0x206257?_[_0x4e86('0x13')](_0x206257):'';})[_0x4e86('0x14')]();});}function createTable(_0x25633d,_0x543965){var _0x11ef40={'widths':_['fill'](Array(_0x25633d['length']),0x91),'heights':function(_0x2fa632){return _0x2fa632===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xe02da8=getHeaders(_0x25633d);_0x11ef40[_0x4e86('0x15')]['push'](_0xe02da8);var _0x1951d4=getRows(_0x25633d,_0x543965);_0x11ef40['body']=_0x11ef40[_0x4e86('0x15')]['concat'](_0x1951d4);return _0x11ef40;}function createTables(_0x4c9641){var _0x9ab1a0=[];var _0xdcc72d=_['chunk'](Object[_0x4e86('0x16')](_0x4c9641[0x0]),0x5);_0xdcc72d[_0x4e86('0x17')](function(_0x13224f){_0x9ab1a0['push'](createTable(_0x13224f,_0x4c9641));});return _0x9ab1a0;}function getPDFDocDefinition(_0x5821b4){var _0x2ba028=util[_0x4e86('0x18')](_0x4e86('0x19'),NAME,EXTRACTED_REPORT[_0x4e86('0x1a')],moment(EXTRACTED_REPORT['startDate'])[_0x4e86('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x4e86('0x1b')])[_0x4e86('0x18')](FORMAT));var _0x1da432=[];for(var _0x54d52a=0x0;_0x54d52a<_0x5821b4['length'];_0x54d52a++){var _0x2f4d8d=[];if(_0x54d52a===0x0){_0x2f4d8d['push']({'text':_0x2ba028,'style':_0x4e86('0x1c')});}var _0x3c3a42={'table':_0x5821b4[_0x54d52a]};if(_0x54d52a>0x0){_0x3c3a42[_0x4e86('0x1d')]=_0x4e86('0x1e');_0x3c3a42[_0x4e86('0x1f')]=[0x0,0x46,0x0,0x0];}_0x2f4d8d['push'](_0x3c3a42);_0x1da432[_0x4e86('0x20')](_0x2f4d8d);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x1da432,'footer':function(_0x313cc2,_0x2df879){return{'text':_0x313cc2['toString']()+_0x4e86('0x21')+_0x2df879,'style':_0x4e86('0x22')};},'defaultStyle':{'font':_0x4e86('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x52ce3c){var _0x2d2a77=0x1388;var _0x24b9c4;if(!_0x52ce3c[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0x4e86('0x24')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x4e86('0x25'),_0x4e86('0x26')]})[_0x4e86('0x27')](function(_0x371436){if(_0x371436){_0x24b9c4=_0x371436;_0x2d2a77=_0x24b9c4['splitSizePdf']||0x3e8;}})[_0x4e86('0x27')](function(){var _0x55b11e=[];var _0x3decf7=0x0;if(_0x24b9c4[_0x4e86('0x25')]){if(_0x52ce3c&&_0x52ce3c[_0x4e86('0x28')]){var _0x4153a2=_[_0x4e86('0x29')](_0x52ce3c[0x0][_0x4e86('0x2a')]/_0x2d2a77);var _0x4fcc13=Number[_0x4e86('0x2b')](_0x52ce3c[0x0][_0x4e86('0x2a')]/_0x2d2a77)?_0x52ce3c[0x0][_0x4e86('0x2a')]%_0x2d2a77:0x0;_0x4153a2[_0x4e86('0x17')](function(_0x31d998){if(_0x31d998>0x0){_0x3decf7+=_0x2d2a77;}_0x55b11e[_0x4e86('0x20')](dbH[_0x4e86('0x2c')][_0x4e86('0x2d')](util[_0x4e86('0x18')](_0x4e86('0x2e'),QUERY,_0x2d2a77,_0x3decf7),{'type':dbH['sequelize']['QueryTypes'][_0x4e86('0x2f')]}));});if(_0x4fcc13>0x0){_0x3decf7+=_0x2d2a77;_0x55b11e[_0x4e86('0x20')](dbH['sequelize']['query'](util[_0x4e86('0x18')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4fcc13,_0x3decf7),{'type':dbH['sequelize']['QueryTypes'][_0x4e86('0x2f')]}));}}}else{_0x55b11e[_0x4e86('0x20')](dbH[_0x4e86('0x2c')][_0x4e86('0x2d')](QUERY,{'type':dbH['sequelize'][_0x4e86('0x30')]['SELECT']}));}var _0x18dc7b=path['dirname'](PATH);var _0x3ad646=path[_0x4e86('0x31')](PATH,_0x4e86('0x32'));var _0x1d2824=_0x24b9c4[_0x4e86('0x25')]&&_0x55b11e['length']>0x1;var _0x2c6c9e=[];if(!fs[_0x4e86('0x33')](path['join'](_0x18dc7b,_0x3ad646))&&_0x1d2824){fs['mkdirSync'](path[_0x4e86('0x34')](_0x18dc7b,_0x3ad646));}return BPromise[_0x4e86('0x35')](_0x55b11e,function(_0x3442e1){_0x2c6c9e[_0x4e86('0x20')](_0x3442e1);})[_0x4e86('0x27')](function(){var _0x3805a0=[];for(var _0x4321a1=0x0;_0x4321a1<_0x2c6c9e['length'];_0x4321a1+=0x1){var _0x2120aa=_0x2c6c9e[_0x4321a1];var _0xdc54a0=createTables(_[_0x4e86('0x36')](_0x2120aa));var _0x2cde7f;var _0x32fefa=getPDFDocDefinition(_0xdc54a0);var _0x3c84e4=getPDFPrinter();var _0x4aafd8=_0x3c84e4[_0x4e86('0x37')](_0x32fefa);if(_0x1d2824){_0x2cde7f=path[_0x4e86('0x34')](_0x18dc7b,_0x3ad646,util['format'](_0x4e86('0x38'),_0x3ad646,_0x4321a1,_0x4e86('0x39')));}else{_0x2cde7f=path[_0x4e86('0x34')](_0x18dc7b,util[_0x4e86('0x18')](_0x4e86('0x3a'),_0x3ad646,_0x4e86('0x39')));}_0x3805a0['push'](writePDFDocument(_0x4aafd8,_0x2cde7f));}return Promise[_0x4e86('0x3b')](_0x3805a0);})['then'](function(){if(_0x1d2824){return new Promise(function(_0x50ffe9){zipdir(path[_0x4e86('0x34')](_0x18dc7b,_0x3ad646),{'saveTo':path[_0x4e86('0x34')](_0x18dc7b,util[_0x4e86('0x18')](_0x4e86('0x3a'),_0x3ad646,'zip'))},function(){rimraf(path[_0x4e86('0x34')](_0x18dc7b,_0x3ad646),function(){});_0x50ffe9('zip\x20finished');});});}})[_0x4e86('0x27')](function(){if(!_0x1d2824)return;rimraf(path[_0x4e86('0x34')](_0x18dc7b,_0x3ad646),function(){});})[_0x4e86('0x27')](function(){logger['info'](util[_0x4e86('0x18')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x4e86('0x3c')));return analyticExtractedReport(_0x4e86('0x3d'),_0x1d2824?util[_0x4e86('0x18')]('%s.%s',_0x3ad646,_0x1d2824?_0x4e86('0x3e'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x4e86('0x18')](_0x4e86('0x3f'),EXTRACTED_REPORT_ID,_0x4e86('0x3c')));return db[_0x4e86('0x40')][_0x4e86('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x4e86('0x27')](function(_0x74a338){EXTRACTED_REPORT=_0x74a338;return dbH[_0x4e86('0x2c')][_0x4e86('0x2d')](util['format'](_0x4e86('0x42'),QUERY),{'type':dbH[_0x4e86('0x2c')]['QueryTypes'][_0x4e86('0x2f')]});})['then'](extractReport)[_0x4e86('0x43')](function(_0x3dcd20){logger[_0x4e86('0x44')](util[_0x4e86('0x18')](_0x4e86('0x45'),EXTRACTED_REPORT_ID,'PDF'),util[_0x4e86('0x46')](_0x3dcd20,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4e86('0x47'));})[_0x4e86('0x48')](function(){process[_0x4e86('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x35d0e5=new PdfPrinter({'Arial':{'normal':__dirname+_0x4e86('0x4a'),'bold':__dirname+_0x4e86('0x4b'),'italics':__dirname+_0x4e86('0x4c'),'bolditalics':__dirname+_0x4e86('0x4d')}});return _0x35d0e5;}function getPDFDocDefinitionFromHTML(_0x21cea3,_0x560f5a){var _0x1bdd46=util[_0x4e86('0x18')](_0x4e86('0x4e'),_0x560f5a[_0x4e86('0x4f')],_0x560f5a[_0x4e86('0x50')]);var _0x512ef8=moment()[_0x4e86('0x18')](_0x4e86('0x51'))[_0x4e86('0x13')]();var _0x55a493=htmlToPdfmake(_0x21cea3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x55a493],'defaultStyle':{'font':_0x4e86('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x4e86('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x4e86('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x4e86('0x53'),'style':_0x4e86('0x1c')}];},'footer':function(_0x1cc33e,_0x3f930f){return[{'text':util[_0x4e86('0x18')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x1bdd46,_0x1cc33e,_0x3f930f,_0x512ef8),'style':_0x4e86('0x22')}];}};}function writePDFDocument(_0x1c825a,_0x3cd438){return new Promise(function(_0x4e016f,_0x2ae22c){var _0x5b9eeb=_0x1c825a['pipe'](fs['createWriteStream'](_0x3cd438));_0x5b9eeb['on'](_0x4e86('0x54'),function(){_0x4e016f(_0x4e86('0x54'));});_0x5b9eeb['on'](_0x4e86('0x55'),function(_0x1f560c){_0x2ae22c(_0x1f560c);});_0x1c825a[_0x4e86('0x56')]();});}exports['createPdfFromHTML']=function(_0x3e58d2,_0xe138a9){var _0x2a067f=getPDFPrinter();var _0x5eb5fb=getPDFDocDefinitionFromHTML(_0x3e58d2,_0xe138a9);var _0x346a17=_0x2a067f[_0x4e86('0x37')](_0x5eb5fb);return writePDFDocument(_0x346a17,_0xe138a9[_0x4e86('0x0')])[_0x4e86('0x43')](function(_0x3d2a44){throw _0x3d2a44;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 0e24a89..8afe3ed 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 _0x127c=['../../config/logger','analytics','argv','savename','format','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','range','isInteger','forEach','push','dirname','basename','.xlsx','existsSync','join','each','length','%s%d.%s','xlsx','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','inspect','exit','util','lodash','rimraf','../../mysqldb','dbH'];(function(_0x4cc85f,_0x1c1044){var _0x1daf99=function(_0xf9e68b){while(--_0xf9e68b){_0x4cc85f['push'](_0x4cc85f['shift']());}};_0x1daf99(++_0x1c1044);}(_0x127c,0x121));var _0xc127=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x127c[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xc127('0x0'));var path=require('path');var _=require(_0xc127('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xc127('0x2'));var db=require(_0xc127('0x3'))['db'];var dbH=require(_0xc127('0x3'))[_0xc127('0x4')];var logger=require(_0xc127('0x5'))(_0xc127('0x6'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xc127('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x210aed,_0x271289){var _0x430a54={'status':_0x210aed};var _0x2d2e63={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x271289){_0x430a54[_0xc127('0x8')]=_0x271289;}return db['AnalyticExtractedReport']['update'](_0x430a54,_0x2d2e63);}function main(){var _0xd518e7=0x1388;var _0x100b6c;logger['info'](util[_0xc127('0x9')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc127('0xa'),'splitSizeXlsx']})['then'](function(_0x31fdd4){if(_0x31fdd4){_0x100b6c=_0x31fdd4;_0xd518e7=_0x100b6c[_0xc127('0xb')]||0x1388;}})[_0xc127('0xc')](function(){return dbH[_0xc127('0xd')][_0xc127('0xe')](util[_0xc127('0x9')](_0xc127('0xf'),QUERY),{'type':dbH[_0xc127('0xd')][_0xc127('0x10')][_0xc127('0x11')]});})[_0xc127('0xc')](function(_0x2d7024){if(!_0x2d7024[0x0][_0xc127('0x12')]){return analyticExtractedReport('Empty');}var _0x4086b3=[];var _0x9f6ecc=0x0;if(_0x100b6c['split']){if(_0x2d7024&&_0x2d7024['length']){var _0x136656=_[_0xc127('0x13')](_0x2d7024[0x0][_0xc127('0x12')]/_0xd518e7);var _0x24fb7c=Number[_0xc127('0x14')](_0x2d7024[0x0][_0xc127('0x12')]/_0xd518e7)?_0x2d7024[0x0][_0xc127('0x12')]%_0xd518e7:0x0;_0x136656[_0xc127('0x15')](function(_0x16de69){if(_0x16de69>0x0){_0x9f6ecc+=_0xd518e7;}_0x4086b3[_0xc127('0x16')](dbH[_0xc127('0xd')][_0xc127('0xe')](util[_0xc127('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xd518e7,_0x9f6ecc),{'type':dbH[_0xc127('0xd')][_0xc127('0x10')]['SELECT']}));});if(_0x24fb7c>0x0){_0x9f6ecc+=_0xd518e7;_0x4086b3[_0xc127('0x16')](dbH[_0xc127('0xd')]['query'](util[_0xc127('0x9')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x24fb7c,_0x9f6ecc),{'type':dbH[_0xc127('0xd')][_0xc127('0x10')][_0xc127('0x11')]}));}}}else{_0x4086b3[_0xc127('0x16')](dbH[_0xc127('0xd')][_0xc127('0xe')](QUERY,{'type':dbH[_0xc127('0xd')][_0xc127('0x10')][_0xc127('0x11')]}));}var _0x1e76e2=path[_0xc127('0x17')](PATH);var _0x5a1599=path[_0xc127('0x18')](PATH,_0xc127('0x19'));var _0x4b5583=_0x100b6c[_0xc127('0xa')]&&_0x4086b3['length']>0x1;var _0x2323f4=[];if(!fs[_0xc127('0x1a')](path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599))&&_0x4b5583){fs['mkdirSync'](path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599));}return BPromise[_0xc127('0x1c')](_0x4086b3,function(_0x3d6a32){_0x2323f4[_0xc127('0x16')](_0x3d6a32);})[_0xc127('0xc')](function(){for(var _0x47ddaa=0x0;_0x47ddaa<_0x2323f4[_0xc127('0x1d')];_0x47ddaa+=0x1){var _0x5b60b7;var _0x598a51=_0x2323f4[_0x47ddaa];if(_0x4b5583){_0x5b60b7=path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599,util[_0xc127('0x9')](_0xc127('0x1e'),_0x5a1599,_0x47ddaa,_0xc127('0x1f')));}else{_0x5b60b7=path[_0xc127('0x1b')](_0x1e76e2,util['format']('%s.%s',_0x5a1599,_0xc127('0x1f')));}fs[_0xc127('0x20')](_0x5b60b7,json2xls(_0x598a51),'binary');}})[_0xc127('0xc')](function(){if(_0x4b5583){return new Promise(function(_0x223ddd){zipdir(path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599),{'saveTo':path[_0xc127('0x1b')](_0x1e76e2,util[_0xc127('0x9')]('%s.%s',_0x5a1599,_0xc127('0x21')))},function(_0x4c4b5a,_0xdd30f2){rimraf(path[_0xc127('0x1b')](_0x1e76e2,_0x5a1599),function(){});_0x223ddd(_0xc127('0x22'));});});}})[_0xc127('0xc')](function(){logger[_0xc127('0x23')](util['format'](_0xc127('0x24'),EXTRACTED_REPORT_ID,_0xc127('0x25')));return analyticExtractedReport(_0xc127('0x26'),_0x4b5583?util[_0xc127('0x9')]('%s.%s',_0x5a1599,_0x4b5583?_0xc127('0x21'):_0xc127('0x1f')):null);});})[_0xc127('0x27')](function(_0x84fcc8){logger[_0xc127('0x23')](util[_0xc127('0x9')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc127('0x25')),util[_0xc127('0x28')](_0x84fcc8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xc127('0x29')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x620f=['Failed','exit','util','path','lodash','bluebird','zip-dir','rimraf','dbH','analytics','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x620f,0x160));var _0xf620=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x620f[_0x397e5f];return _0x5302b8;};'use strict';var util=require(_0xf620('0x0'));var path=require(_0xf620('0x1'));var _=require(_0xf620('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xf620('0x3'));var zipdir=require(_0xf620('0x4'));var rimraf=require(_0xf620('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf620('0x6')];var logger=require('../../config/logger')(_0xf620('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xf620('0x8')][0x2]);var QUERY=process[_0xf620('0x8')][0x3];var PATH=process[_0xf620('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1c308b,_0x17c0c1){var _0x98379c={'status':_0x1c308b};var _0x54231d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x17c0c1){_0x98379c[_0xf620('0x9')]=_0x17c0c1;}return db[_0xf620('0xa')]['update'](_0x98379c,_0x54231d);}function main(){var _0x296d7d=0x1388;var _0x3ab8d4;logger[_0xf620('0xb')](util['format'](_0xf620('0xc'),EXTRACTED_REPORT_ID,_0xf620('0xd')));return db[_0xf620('0xe')][_0xf620('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf620('0x10'),_0xf620('0x11')]})[_0xf620('0x12')](function(_0xcd0ab8){if(_0xcd0ab8){_0x3ab8d4=_0xcd0ab8;_0x296d7d=_0x3ab8d4[_0xf620('0x11')]||0x1388;}})[_0xf620('0x12')](function(){return dbH[_0xf620('0x13')][_0xf620('0x14')](util[_0xf620('0x15')](_0xf620('0x16'),QUERY),{'type':dbH[_0xf620('0x13')]['QueryTypes'][_0xf620('0x17')]});})[_0xf620('0x12')](function(_0x3e1a69){if(!_0x3e1a69[0x0][_0xf620('0x18')]){return analyticExtractedReport('Empty');}var _0x2c316a=[];var _0x5c2273=0x0;if(_0x3ab8d4['split']){if(_0x3e1a69&&_0x3e1a69[_0xf620('0x19')]){var _0xe0d6b3=_[_0xf620('0x1a')](_0x3e1a69[0x0][_0xf620('0x18')]/_0x296d7d);var _0x264d38=Number[_0xf620('0x1b')](_0x3e1a69[0x0][_0xf620('0x18')]/_0x296d7d)?_0x3e1a69[0x0][_0xf620('0x18')]%_0x296d7d:0x0;_0xe0d6b3[_0xf620('0x1c')](function(_0x20ddae){if(_0x20ddae>0x0){_0x5c2273+=_0x296d7d;}_0x2c316a[_0xf620('0x1d')](dbH['sequelize'][_0xf620('0x14')](util[_0xf620('0x15')](_0xf620('0x1e'),QUERY,_0x296d7d,_0x5c2273),{'type':dbH[_0xf620('0x13')][_0xf620('0x1f')][_0xf620('0x17')]}));});if(_0x264d38>0x0){_0x5c2273+=_0x296d7d;_0x2c316a['push'](dbH[_0xf620('0x13')][_0xf620('0x14')](util[_0xf620('0x15')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x264d38,_0x5c2273),{'type':dbH[_0xf620('0x13')][_0xf620('0x1f')]['SELECT']}));}}}else{_0x2c316a[_0xf620('0x1d')](dbH[_0xf620('0x13')][_0xf620('0x14')](QUERY,{'type':dbH[_0xf620('0x13')][_0xf620('0x1f')][_0xf620('0x17')]}));}var _0x3ea7dd=path[_0xf620('0x20')](PATH);var _0x412a0c=path[_0xf620('0x21')](PATH,_0xf620('0x22'));var _0x1afb94=_0x3ab8d4[_0xf620('0x10')]&&_0x2c316a[_0xf620('0x19')]>0x1;var _0x23055f=[];if(!fs['existsSync'](path[_0xf620('0x23')](_0x3ea7dd,_0x412a0c))&&_0x1afb94){fs[_0xf620('0x24')](path['join'](_0x3ea7dd,_0x412a0c));}return BPromise[_0xf620('0x25')](_0x2c316a,function(_0x3f70c9){_0x23055f['push'](_0x3f70c9);})['then'](function(){for(var _0xfdb4c6=0x0;_0xfdb4c6<_0x23055f[_0xf620('0x19')];_0xfdb4c6+=0x1){var _0x1c70ed;var _0xd69cc=_0x23055f[_0xfdb4c6];if(_0x1afb94){_0x1c70ed=path['join'](_0x3ea7dd,_0x412a0c,util['format'](_0xf620('0x26'),_0x412a0c,_0xfdb4c6,_0xf620('0x27')));}else{_0x1c70ed=path[_0xf620('0x23')](_0x3ea7dd,util[_0xf620('0x15')](_0xf620('0x28'),_0x412a0c,_0xf620('0x27')));}fs[_0xf620('0x29')](_0x1c70ed,json2xls(_0xd69cc),_0xf620('0x2a'));}})['then'](function(){if(_0x1afb94){return new Promise(function(_0x213788){zipdir(path[_0xf620('0x23')](_0x3ea7dd,_0x412a0c),{'saveTo':path[_0xf620('0x23')](_0x3ea7dd,util[_0xf620('0x15')]('%s.%s',_0x412a0c,'zip'))},function(_0xcc74dc,_0x334191){rimraf(path[_0xf620('0x23')](_0x3ea7dd,_0x412a0c),function(){});_0x213788(_0xf620('0x2b'));});});}})['then'](function(){logger['info'](util[_0xf620('0x15')](_0xf620('0x2c'),EXTRACTED_REPORT_ID,_0xf620('0xd')));return analyticExtractedReport('Completed',_0x1afb94?util[_0xf620('0x15')](_0xf620('0x28'),_0x412a0c,_0x1afb94?'zip':_0xf620('0x27')):null);});})[_0xf620('0x2d')](function(_0x9041f0){logger[_0xf620('0xb')](util[_0xf620('0x15')](_0xf620('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util[_0xf620('0x2f')](_0x9041f0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf620('0x30'));})['finally'](function(){process[_0xf620('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 14b6c67..42e26e6 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 _0x3c69=['toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','models','findAll','then','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','push','format','CDR(type)=%s','type','context','inbound','Set','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','VoiceExtensionId','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app'];(function(_0x2e0fd6,_0x149cb7){var _0xed91f5=function(_0x2813b3){while(--_0x2813b3){_0x2e0fd6['push'](_0x2e0fd6['shift']());}};_0xed91f5(++_0x149cb7);}(_0x3c69,0x1b9));var _0x93c6=function(_0x161f85,_0x1b1968){_0x161f85=_0x161f85-0x0;var _0x3f98ad=_0x3c69[_0x161f85];return _0x3f98ad;};'use strict';var _=require('lodash');var util=require('util');function rewrite(_0x3721b1,_0x4cc200){var _0x367157=this;return _0x3721b1[_0x93c6('0x0')]['Interval'][_0x93c6('0x1')]({'raw':!![]})[_0x93c6('0x2')](function(_0xc25ed9){_0x367157['intervals']=_0xc25ed9;return _0x3721b1[_0x93c6('0x0')][_0x93c6('0x3')][_0x93c6('0x1')]({'where':{'IntervalId':_0x4cc200[_0x93c6('0x4')]},'raw':!![]});})[_0x93c6('0x2')](function(_0x2ab11d){return _0x3721b1[_0x93c6('0x0')]['VoiceExtension'][_0x93c6('0x1')]({'where':{'exten':{'$in':_[_0x93c6('0x5')](_[_0x93c6('0x6')](_0x2ab11d,_0x93c6('0x7')))}},'order':[{'raw':_0x93c6('0x8')}],'raw':!![]});})[_0x93c6('0x2')](function(_0x4e6032){var _0x575370=_[_0x93c6('0x9')](_0x4e6032,{'priority':'1'});var _0x596c14=_[_0x93c6('0x9')](_0x4e6032,{'isApp':0x1});var _0x3c06c9=_[_0x93c6('0xa')](_0x596c14,_0x93c6('0x7'));var _0x493fac=[_0x93c6('0xb'),'playback'];var _0x50e177=[];var _0x59d6f2=[];for(var _0x5007a0 in _0x3c06c9){if(_0x3c06c9['hasOwnProperty'](_0x5007a0)){_0x367157[_0x93c6('0xc')]=0x2;_0x367157[_0x93c6('0xd')]=[];_0x367157[_0x93c6('0xe')]=_[_0x93c6('0xf')](_0x575370,{'exten':_0x3c06c9[_0x5007a0][0x0]['exten']});_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0]['type'],'app':'Set','appdata':util[_0x93c6('0x11')](_0x93c6('0x12'),_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')]),'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157['priority']++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId']});if(_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')]===_0x93c6('0x15')){_0x367157[_0x93c6('0xd')]['push']({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x17')+_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId'],'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId']});}else if(_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')]===_0x93c6('0x18')){if(_0x367157[_0x93c6('0xe')]){_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0]['type'],'app':'Set','appdata':_0x93c6('0x19')+(_0x367157['extension'][_0x93c6('0x1a')]?_0x93c6('0x1b')+_0x367157[_0x93c6('0xe')][_0x93c6('0x1a')]+'}':_0x93c6('0x1c')),'context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId']});}_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0]['type'],'app':'Set','appdata':_0x93c6('0x17')+_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId'],'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});var _0x3e0e87=_0x367157['priority']++;_0x367157[_0x93c6('0xd')]['push']({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':'ExecIf','appdata':_0x93c6('0x1e')+(_0x3e0e87+0x2)+_0x93c6('0x1f')+(_0x3e0e87+0x1)+')','context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x3e0e87,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});if(_0x367157[_0x93c6('0xe')]){_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x367157[_0x93c6('0xe')][_0x93c6('0x1a')]?_0x93c6('0x20')+_0x367157[_0x93c6('0xe')][_0x93c6('0x1a')]+'}':'CDR(prefix)=noprefix','context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0]['exten'],'priority':_0x367157['priority']++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});}_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':'Set','appdata':_0x93c6('0x21')+_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId'],'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157['priority']++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0]['VoiceExtensionId']});if(_0x367157[_0x93c6('0xe')]&&_0x367157[_0x93c6('0xe')][_0x93c6('0x22')](_0x93c6('0x23'))&&_0x367157[_0x93c6('0xe')][_0x93c6('0x23')]!==_0x93c6('0x24')){_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0]['type'],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x25')+_0x367157[_0x93c6('0xe')][_0x93c6('0x23')]||_0x93c6('0x26'),'context':_0x3c06c9[_0x5007a0][0x0]['context'],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});}}_0x367157[_0x93c6('0xd')]['push']({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x27'),'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157['priority']++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x28'),'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0]['exten'],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});_0x367157[_0x93c6('0xd')]['push']({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'priority':_0x367157[_0x93c6('0xc')]++,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});for(var _0x409864=0x0,_0x52fa69=0x0;_0x409864<_0x3c06c9[_0x5007a0][_0x93c6('0x29')];_0x409864+=0x1,_0x52fa69=0x0){var _0x1a063f=_0x3c06c9[_0x5007a0][_0x409864];if(_0x1a063f['type']){_0x1a063f[_0x93c6('0x13')]=_0x1a063f[_0x93c6('0x13')]['toLowerCase']();}var _0x5c967b=[];var _0x295c07=[];delete _0x1a063f['id'];delete _0x1a063f[_0x93c6('0x2a')];delete _0x1a063f[_0x93c6('0x2b')];var _0x565152=_0x1a063f[_0x93c6('0x2c')]!==_0x93c6('0x2d')?[_0x1a063f[_0x93c6('0x2c')]]:_0x1a063f[_0x93c6('0x4')]?_[_0x93c6('0x6')](_[_0x93c6('0x9')](_0x367157[_0x93c6('0x2e')],{'IntervalId':_0x1a063f[_0x93c6('0x4')]}),_0x93c6('0x2c')):[];if(_0x1a063f[_0x93c6('0x22')](_0x93c6('0x2f'))){if(_0x1a063f['tag']&&_0x1a063f['tag']!=='--'){_0x5c967b['push']({'type':_0x1a063f[_0x93c6('0x13')],'app':'Set','appdata':_0x93c6('0x30')+_0x1a063f[_0x93c6('0x2f')],'context':_0x1a063f[_0x93c6('0x14')],'exten':_0x1a063f['exten'],'priority':_0x565152['length']+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f['VoiceExtensionId']});}}if(_0x1a063f[_0x93c6('0x13')]==='outbound'&&_0x1a063f[_0x93c6('0x22')](_0x93c6('0x31'))){if(_0x1a063f['callerID']){_0x5c967b[_0x93c6('0x10')]({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x32'),'appdata':_0x93c6('0x33')+_0x1a063f[_0x93c6('0x31')]+')','context':_0x1a063f[_0x93c6('0x14')],'exten':_0x1a063f['exten'],'priority':_0x565152['length']+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});}else{_0x5c967b[_0x93c6('0x10')]({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x32'),'appdata':_0x93c6('0x34'),'context':_0x1a063f['context'],'exten':_0x1a063f['exten'],'priority':_0x565152[_0x93c6('0x29')]+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});}}if(_0x1a063f[_0x93c6('0x22')](_0x93c6('0x35'))){if(_0x493fac[_0x93c6('0x36')](_0x1a063f[_0x93c6('0x37')][_0x93c6('0x38')]())>=0x0&&_0x1a063f[_0x93c6('0x39')]!==_0x93c6('0x3a')){if(_0x1a063f[_0x93c6('0x35')]){_0x5c967b[_0x93c6('0x10')]({'type':_0x1a063f['type'],'app':_0x93c6('0x32'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x1a063f['context'],'exten':_0x1a063f[_0x93c6('0x7')],'priority':_0x565152[_0x93c6('0x29')]+_0x367157['priority']+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});_0x5c967b[_0x93c6('0x10')]({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':_0x93c6('0x3b'),'context':_0x1a063f[_0x93c6('0x14')],'exten':_0x1a063f[_0x93c6('0x7')],'priority':_0x565152['length']+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});}else{_0x5c967b['push']({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x32'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x1a063f[_0x93c6('0x14')],'exten':_0x1a063f['exten'],'priority':_0x565152[_0x93c6('0x29')]+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});_0x5c967b['push']({'type':_0x1a063f[_0x93c6('0x13')],'app':_0x93c6('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x1a063f['context'],'exten':_0x1a063f[_0x93c6('0x7')],'priority':_0x565152[_0x93c6('0x29')]+_0x367157[_0x93c6('0xc')]+_0x52fa69++,'VoiceExtensionId':_0x1a063f[_0x93c6('0x1d')]});}}}for(var _0x4a1905=0x0;_0x4a1905<_0x565152['length'];_0x4a1905+=0x1){var _0x3ce861=_0x367157[_0x93c6('0xc')]+_0x565152['length'];var _0x47d8d1=_0x4a1905===_0x565152[_0x93c6('0x29')]-0x1?_0x367157[_0x93c6('0xc')]+_0x5c967b[_0x93c6('0x29')]+_0x295c07[_0x93c6('0x29')]+0x2:_0x367157[_0x93c6('0xc')]+_0x4a1905+0x1;_0x5c967b[_0x93c6('0x3c')](_0x4a1905,0x0,{'type':_0x1a063f[_0x93c6('0x13')],'app':'GotoIfTime','appdata':_0x565152[_0x4a1905]+'?'+_0x1a063f['context']+_0x93c6('0x3d')+_0x3ce861+':'+_0x1a063f['context']+_0x93c6('0x3d')+_0x47d8d1,'exten':_0x1a063f['exten'],'context':_0x1a063f[_0x93c6('0x14')],'priority':_0x367157[_0x93c6('0xc')]+_0x4a1905,'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});}_0x1a063f[_0x93c6('0xc')]=_0x5c967b[_0x93c6('0x29')]?_['last'](_0x5c967b)[_0x93c6('0xc')]+0x1:_0x367157[_0x93c6('0xc')];_0x367157[_0x93c6('0xc')]=(_0x295c07[_0x93c6('0x29')]?_[_0x93c6('0x3e')](_0x295c07)[_0x93c6('0xc')]:_0x1a063f[_0x93c6('0xc')])+0x1;_0x367157[_0x93c6('0xd')]=_[_0x93c6('0x3f')](_0x367157['extensions'],_0x5c967b,[_0x1a063f],_0x295c07);}_0x367157[_0x93c6('0xd')][_0x93c6('0x10')]({'type':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x13')],'app':_0x93c6('0x40'),'exten':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x7')],'context':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x14')],'priority':_0x367157[_0x93c6('0xc')],'VoiceExtensionId':_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]});_0x50e177[_0x93c6('0x10')](_0x3c06c9[_0x5007a0][0x0][_0x93c6('0x1d')]);_0x59d6f2=_[_0x93c6('0x3f')](_0x59d6f2,_0x367157['extensions']);}}return _0x3721b1[_0x93c6('0x41')](function(_0x9fff0){return _0x3721b1[_0x93c6('0x0')][_0x93c6('0x3')][_0x93c6('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x50e177}},'transaction':_0x9fff0})[_0x93c6('0x2')](function(_0x4778dc){return _0x3721b1[_0x93c6('0x0')]['VoiceExtension'][_0x93c6('0x43')](_[_0x93c6('0x44')](_0x59d6f2,_0x93c6('0xc')),{'transaction':_0x9fff0});});});})[_0x93c6('0x45')](function(_0x4c57ab){console[_0x93c6('0x46')](_0x4c57ab);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x1d99=['lodash','then','intervals','models','findAll','IntervalId','uniq','map','filter','groupBy','exten','playback','priority','extensions','extension','find','type','Set','CDR(type)=%s','context','push','CDR(routeid)=','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','createdAt','updatedAt','interval','tag','CDR(tag)=','length','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','app','toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','VoiceExtension','bulkCreate','sortBy','catch'];(function(_0xd97a9c,_0x4ef415){var _0x9c59d8=function(_0x37eb31){while(--_0x37eb31){_0xd97a9c['push'](_0xd97a9c['shift']());}};_0x9c59d8(++_0x4ef415);}(_0x1d99,0xc6));var _0x91d9=function(_0x17d289,_0x4ec7cd){_0x17d289=_0x17d289-0x0;var _0x19822d=_0x1d99[_0x17d289];return _0x19822d;};'use strict';var _=require(_0x91d9('0x0'));var util=require('util');function rewrite(_0x1f064d,_0x838ca0){var _0x158714=this;return _0x1f064d['models']['Interval']['findAll']({'raw':!![]})[_0x91d9('0x1')](function(_0x2c9115){_0x158714[_0x91d9('0x2')]=_0x2c9115;return _0x1f064d[_0x91d9('0x3')]['VoiceExtension'][_0x91d9('0x4')]({'where':{'IntervalId':_0x838ca0[_0x91d9('0x5')]},'raw':!![]});})[_0x91d9('0x1')](function(_0x164622){return _0x1f064d[_0x91d9('0x3')]['VoiceExtension'][_0x91d9('0x4')]({'where':{'exten':{'$in':_[_0x91d9('0x6')](_[_0x91d9('0x7')](_0x164622,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x4cfc2b){var _0x35d202=_[_0x91d9('0x8')](_0x4cfc2b,{'priority':'1'});var _0x5bd492=_['filter'](_0x4cfc2b,{'isApp':0x1});var _0x53d070=_[_0x91d9('0x9')](_0x5bd492,_0x91d9('0xa'));var _0x31b798=['queue',_0x91d9('0xb')];var _0x3c8f74=[];var _0x5ed73f=[];for(var _0x4a6c22 in _0x53d070){if(_0x53d070['hasOwnProperty'](_0x4a6c22)){_0x158714[_0x91d9('0xc')]=0x2;_0x158714[_0x91d9('0xd')]=[];_0x158714[_0x91d9('0xe')]=_[_0x91d9('0xf')](_0x35d202,{'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')]});_0x158714['extensions']['push']({'type':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':util['format'](_0x91d9('0x12'),_0x53d070[_0x4a6c22][0x0]['type']),'context':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x13')],'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')],'priority':_0x158714[_0x91d9('0xc')]++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0]['VoiceExtensionId']});if(_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')]==='inbound'){_0x158714[_0x91d9('0xd')][_0x91d9('0x14')]({'type':_0x53d070[_0x4a6c22][0x0]['type'],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x15')+_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')],'context':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x13')],'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')],'priority':_0x158714[_0x91d9('0xc')]++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0]['VoiceExtensionId']});}else if(_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')]==='outbound'){if(_0x158714[_0x91d9('0xe')]){_0x158714['extensions']['push']({'type':_0x53d070[_0x4a6c22][0x0]['type'],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x17')+(_0x158714[_0x91d9('0xe')][_0x91d9('0x18')]?_0x91d9('0x19')+_0x158714['extension'][_0x91d9('0x18')]+'}':_0x91d9('0x1a')),'context':_0x53d070[_0x4a6c22][0x0]['context'],'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')],'priority':_0x158714[_0x91d9('0xc')]++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});}_0x158714[_0x91d9('0xd')][_0x91d9('0x14')]({'type':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x15')+_0x53d070[_0x4a6c22][0x0]['VoiceExtensionId'],'context':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x13')],'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')],'priority':_0x158714['priority']++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});var _0x1062f8=_0x158714['priority']++;_0x158714[_0x91d9('0xd')][_0x91d9('0x14')]({'type':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')],'app':_0x91d9('0x1b'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x1062f8+0x2)+'):Goto('+(_0x1062f8+0x1)+')','context':_0x53d070[_0x4a6c22][0x0]['context'],'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')],'priority':_0x1062f8,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});if(_0x158714[_0x91d9('0xe')]){_0x158714[_0x91d9('0xd')]['push']({'type':_0x53d070[_0x4a6c22][0x0]['type'],'app':_0x91d9('0x11'),'appdata':_0x158714[_0x91d9('0xe')][_0x91d9('0x18')]?'CDR(prefix)=${EXTEN:0:'+_0x158714[_0x91d9('0xe')][_0x91d9('0x18')]+'}':_0x91d9('0x1c'),'context':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x13')],'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')],'priority':_0x158714['priority']++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});}_0x158714[_0x91d9('0xd')]['push']({'type':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x1d')+_0x53d070[_0x4a6c22][0x0]['VoiceExtensionId'],'context':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x13')],'exten':_0x53d070[_0x4a6c22][0x0]['exten'],'priority':_0x158714['priority']++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});if(_0x158714[_0x91d9('0xe')]&&_0x158714['extension'][_0x91d9('0x1e')](_0x91d9('0x1f'))&&_0x158714['extension'][_0x91d9('0x1f')]!==_0x91d9('0x20')){_0x158714['extensions']['push']({'type':_0x53d070[_0x4a6c22][0x0]['type'],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x21'),'context':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x13')],'exten':_0x53d070[_0x4a6c22][0x0]['exten'],'priority':_0x158714[_0x91d9('0xc')]++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0]['VoiceExtensionId']});_0x158714[_0x91d9('0xd')][_0x91d9('0x14')]({'type':_0x53d070[_0x4a6c22][0x0]['type'],'app':_0x91d9('0x11'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x158714['extension']['recordingFormat']||_0x91d9('0x22'),'context':_0x53d070[_0x4a6c22][0x0]['context'],'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')],'priority':_0x158714[_0x91d9('0xc')]++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});}}_0x158714[_0x91d9('0xd')][_0x91d9('0x14')]({'type':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x23'),'context':_0x53d070[_0x4a6c22][0x0]['context'],'exten':_0x53d070[_0x4a6c22][0x0]['exten'],'priority':_0x158714[_0x91d9('0xc')]++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});_0x158714[_0x91d9('0xd')][_0x91d9('0x14')]({'type':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x24'),'context':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x13')],'exten':_0x53d070[_0x4a6c22][0x0][_0x91d9('0xa')],'priority':_0x158714['priority']++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});_0x158714[_0x91d9('0xd')][_0x91d9('0x14')]({'type':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x25'),'context':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x13')],'exten':_0x53d070[_0x4a6c22][0x0]['exten'],'priority':_0x158714['priority']++,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0]['VoiceExtensionId']});for(var _0x398b22=0x0,_0x22e6aa=0x0;_0x398b22<_0x53d070[_0x4a6c22]['length'];_0x398b22+=0x1,_0x22e6aa=0x0){var _0x370519=_0x53d070[_0x4a6c22][_0x398b22];if(_0x370519['type']){_0x370519['type']=_0x370519[_0x91d9('0x10')]['toLowerCase']();}var _0x2537a9=[];var _0x596c31=[];delete _0x370519['id'];delete _0x370519[_0x91d9('0x26')];delete _0x370519[_0x91d9('0x27')];var _0x4c1c52=_0x370519[_0x91d9('0x28')]!=='*,*,*,*'?[_0x370519[_0x91d9('0x28')]]:_0x370519[_0x91d9('0x5')]?_['map'](_[_0x91d9('0x8')](_0x158714[_0x91d9('0x2')],{'IntervalId':_0x370519[_0x91d9('0x5')]}),'interval'):[];if(_0x370519[_0x91d9('0x1e')](_0x91d9('0x29'))){if(_0x370519['tag']&&_0x370519[_0x91d9('0x29')]!=='--'){_0x2537a9['push']({'type':_0x370519[_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x2a')+_0x370519[_0x91d9('0x29')],'context':_0x370519[_0x91d9('0x13')],'exten':_0x370519['exten'],'priority':_0x4c1c52[_0x91d9('0x2b')]+_0x158714[_0x91d9('0xc')]+_0x22e6aa++,'VoiceExtensionId':_0x370519[_0x91d9('0x16')]});}}if(_0x370519[_0x91d9('0x10')]===_0x91d9('0x2c')&&_0x370519['hasOwnProperty']('callerID')){if(_0x370519[_0x91d9('0x2d')]){_0x2537a9[_0x91d9('0x14')]({'type':_0x370519[_0x91d9('0x10')],'app':_0x91d9('0x1b'),'appdata':_0x91d9('0x2e')+_0x370519['callerID']+')','context':_0x370519[_0x91d9('0x13')],'exten':_0x370519['exten'],'priority':_0x4c1c52[_0x91d9('0x2b')]+_0x158714[_0x91d9('0xc')]+_0x22e6aa++,'VoiceExtensionId':_0x370519[_0x91d9('0x16')]});}else{_0x2537a9[_0x91d9('0x14')]({'type':_0x370519['type'],'app':'ExecIf','appdata':_0x91d9('0x2f'),'context':_0x370519[_0x91d9('0x13')],'exten':_0x370519[_0x91d9('0xa')],'priority':_0x4c1c52[_0x91d9('0x2b')]+_0x158714[_0x91d9('0xc')]+_0x22e6aa++,'VoiceExtensionId':_0x370519[_0x91d9('0x16')]});}}if(_0x370519[_0x91d9('0x1e')](_0x91d9('0x30'))){if(_0x31b798['indexOf'](_0x370519[_0x91d9('0x31')][_0x91d9('0x32')]())>=0x0&&_0x370519['appType']!==_0x91d9('0x33')){if(_0x370519[_0x91d9('0x30')]){_0x2537a9[_0x91d9('0x14')]({'type':_0x370519[_0x91d9('0x10')],'app':_0x91d9('0x1b'),'appdata':_0x91d9('0x34'),'context':_0x370519[_0x91d9('0x13')],'exten':_0x370519[_0x91d9('0xa')],'priority':_0x4c1c52[_0x91d9('0x2b')]+_0x158714[_0x91d9('0xc')]+_0x22e6aa++,'VoiceExtensionId':_0x370519[_0x91d9('0x16')]});_0x2537a9['push']({'type':_0x370519[_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x370519[_0x91d9('0x13')],'exten':_0x370519[_0x91d9('0xa')],'priority':_0x4c1c52[_0x91d9('0x2b')]+_0x158714['priority']+_0x22e6aa++,'VoiceExtensionId':_0x370519[_0x91d9('0x16')]});}else{_0x2537a9[_0x91d9('0x14')]({'type':_0x370519[_0x91d9('0x10')],'app':_0x91d9('0x1b'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x370519[_0x91d9('0x13')],'exten':_0x370519[_0x91d9('0xa')],'priority':_0x4c1c52['length']+_0x158714[_0x91d9('0xc')]+_0x22e6aa++,'VoiceExtensionId':_0x370519[_0x91d9('0x16')]});_0x2537a9[_0x91d9('0x14')]({'type':_0x370519[_0x91d9('0x10')],'app':_0x91d9('0x11'),'appdata':_0x91d9('0x35'),'context':_0x370519[_0x91d9('0x13')],'exten':_0x370519[_0x91d9('0xa')],'priority':_0x4c1c52[_0x91d9('0x2b')]+_0x158714[_0x91d9('0xc')]+_0x22e6aa++,'VoiceExtensionId':_0x370519[_0x91d9('0x16')]});}}}for(var _0x7e3b1=0x0;_0x7e3b1<_0x4c1c52[_0x91d9('0x2b')];_0x7e3b1+=0x1){var _0x247bf2=_0x158714[_0x91d9('0xc')]+_0x4c1c52['length'];var _0x383cc7=_0x7e3b1===_0x4c1c52[_0x91d9('0x2b')]-0x1?_0x158714[_0x91d9('0xc')]+_0x2537a9[_0x91d9('0x2b')]+_0x596c31['length']+0x2:_0x158714[_0x91d9('0xc')]+_0x7e3b1+0x1;_0x2537a9[_0x91d9('0x36')](_0x7e3b1,0x0,{'type':_0x370519[_0x91d9('0x10')],'app':_0x91d9('0x37'),'appdata':_0x4c1c52[_0x7e3b1]+'?'+_0x370519[_0x91d9('0x13')]+_0x91d9('0x38')+_0x247bf2+':'+_0x370519[_0x91d9('0x13')]+_0x91d9('0x38')+_0x383cc7,'exten':_0x370519[_0x91d9('0xa')],'context':_0x370519[_0x91d9('0x13')],'priority':_0x158714['priority']+_0x7e3b1,'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]});}_0x370519['priority']=_0x2537a9[_0x91d9('0x2b')]?_[_0x91d9('0x39')](_0x2537a9)[_0x91d9('0xc')]+0x1:_0x158714[_0x91d9('0xc')];_0x158714[_0x91d9('0xc')]=(_0x596c31[_0x91d9('0x2b')]?_[_0x91d9('0x39')](_0x596c31)[_0x91d9('0xc')]:_0x370519[_0x91d9('0xc')])+0x1;_0x158714[_0x91d9('0xd')]=_[_0x91d9('0x3a')](_0x158714[_0x91d9('0xd')],_0x2537a9,[_0x370519],_0x596c31);}_0x158714[_0x91d9('0xd')][_0x91d9('0x14')]({'type':_0x53d070[_0x4a6c22][0x0][_0x91d9('0x10')],'app':_0x91d9('0x3b'),'exten':_0x53d070[_0x4a6c22][0x0]['exten'],'context':_0x53d070[_0x4a6c22][0x0]['context'],'priority':_0x158714[_0x91d9('0xc')],'VoiceExtensionId':_0x53d070[_0x4a6c22][0x0]['VoiceExtensionId']});_0x3c8f74[_0x91d9('0x14')](_0x53d070[_0x4a6c22][0x0][_0x91d9('0x16')]);_0x5ed73f=_['concat'](_0x5ed73f,_0x158714[_0x91d9('0xd')]);}}return _0x1f064d[_0x91d9('0x3c')](function(_0x1487fd){return _0x1f064d['models']['VoiceExtension'][_0x91d9('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x3c8f74}},'transaction':_0x1487fd})[_0x91d9('0x1')](function(_0x23ba33){return _0x1f064d[_0x91d9('0x3')][_0x91d9('0x3e')][_0x91d9('0x3f')](_[_0x91d9('0x40')](_0x5ed73f,_0x91d9('0xc')),{'transaction':_0x1487fd});});});})[_0x91d9('0x41')](function(_0x5e66e9){console['error'](_0x5e66e9);});}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 eddf7f6..bf10b76 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 _0xecbe=['The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','stringify','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','id\x20IN\x20?','calleridnum','cm_hopper_final','str','cm_hopper_black','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','catch','all','findAll','BlackLists','get','Campaign','CampaignId','onlyIfOpen','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parse\x20error','util','lodash','squel','ioredis','../../../config/environment','../../../config/logger','api','defaults','localhost','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xecbe,0x19f));var _0xeecb=function(_0x50b57f,_0x2f01e9){_0x50b57f=_0x50b57f-0x0;var _0x4386fd=_0xecbe[_0x50b57f];return _0x4386fd;};'use strict';var BPromise=require('bluebird');var util=require(_0xeecb('0x0'));var _=require(_0xeecb('0x1'));var fs=require('fs');var squel=require(_0xeecb('0x2'));var Papa=require('papaparse');var Redis=require(_0xeecb('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0xeecb('0x4'));var logger=require(_0xeecb('0x5'))(_0xeecb('0x6'));config['redis']=_[_0xeecb('0x7')](config['redis'],{'host':_0xeecb('0x8'),'port':0x18eb});var socket=require(_0xeecb('0x9'))(new Redis(config[_0xeecb('0xa')]));require(_0xeecb('0xb'))[_0xeecb('0xc')](socket);try{if(!process[_0xeecb('0xd')][0x2]||process[_0xeecb('0xd')][0x2]===_0xeecb('0xe')||process[_0xeecb('0xd')][0x2]===_0xeecb('0xf')){throw new Error(_0xeecb('0x10'));}var FILEPATH=process[_0xeecb('0xd')][0x2];if(!process[_0xeecb('0xd')][0x3]||process['argv'][0x3]===_0xeecb('0xe')||process[_0xeecb('0xd')][0x3]===_0xeecb('0xf')||!process[_0xeecb('0xd')][0x4]||process[_0xeecb('0xd')][0x4]===_0xeecb('0xe')||process[_0xeecb('0xd')][0x4]==='null'){throw new Error(_0xeecb('0x11'));}var FIELDS=_['zipObject'](process[_0xeecb('0xd')][0x3]['split'](','),process[_0xeecb('0xd')][0x4][_0xeecb('0x12')](','));if(!process[_0xeecb('0xd')][0x5]||process['argv'][0x5]===_0xeecb('0xe')||process[_0xeecb('0xd')][0x5]===_0xeecb('0xf')){throw new Error(_0xeecb('0x13'));}var LISTID=process[_0xeecb('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0xeecb('0xd')][0x6]!==_0xeecb('0xe')&&process[_0xeecb('0xd')][0x6]!==_0xeecb('0xf')?process[_0xeecb('0xd')][0x6]:null;var DUPLICATES=process[_0xeecb('0xd')][0x7]&&process[_0xeecb('0xd')][0x7]!=='undefined'&&process['argv'][0x7]!==_0xeecb('0xf')?process['argv'][0x7]:null;if(!process[_0xeecb('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0xeecb('0xd')][0x8]===_0xeecb('0xf')){throw new Error(_0xeecb('0x14'));}var SOCKET_TIMESTAMP=process[_0xeecb('0xd')][0x8];}catch(_0x30853c){logger[_0xeecb('0x15')](_0x30853c);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(_0x3a36cd,_0x1c761d,_0x584cbb,_0x116a43){var _0x458989={'message':_0x1c761d};_0x458989[_0x3a36cd]=!![];if(_0x584cbb){_0x458989[_0xeecb('0x16')]=_0x584cbb;}if(_0x116a43){_0x458989[_0xeecb('0x17')]=_0x116a43;}return _0x458989;}function isEmail(_0x4ed6d2){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'](_0x4ed6d2);}function checkRow(_0x4741c5,_0x1ccb1c,_0x1b70b1){return new BPromise(function(_0x1ea84b,_0xf766d0){if(_[_0xeecb('0x18')](_0x4741c5)){return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),_0xeecb('0x19'),null,_0x1b70b1));}if(_0x4741c5['errors']&&_0x4741c5[_0xeecb('0x1a')][_0xeecb('0x1b')]){var _0xb2247f=_[_0xeecb('0x1c')](_0x4741c5[_0xeecb('0x1a')],_0xeecb('0x1d'))[_0xeecb('0x1e')](';');return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),_0xb2247f,null,_0x1b70b1));}var _0x579e9a={};for(var _0x56ea26 in FIELDS){if(FIELDS['hasOwnProperty'](_0x56ea26)&&FIELDS[_0x56ea26]){_0x579e9a[_0x56ea26]=_0x4741c5[_0xeecb('0x1f')][0x0][FIELDS[_0x56ea26]]||_0x4741c5[_0xeecb('0x1f')][0x0]['\ufeff'+FIELDS[_0x56ea26]];}}if(!_0x579e9a[_0xeecb('0x20')]){return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),_0xeecb('0x21'),null,_0x1b70b1));}if(!_0x579e9a[_0xeecb('0x22')]){return _0xf766d0(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x1b70b1));}if(_0x579e9a[_0xeecb('0x23')]){var _0x39d697=moment(_0x579e9a[_0xeecb('0x23')],_0xeecb('0x24'));if(!_0x39d697[_0xeecb('0x25')]()){return _0xf766d0(handleCheckRowError('error',_0xeecb('0x26'),null,_0x1b70b1));}}if(_0x579e9a[_0xeecb('0x27')]){if(!isEmail(_0x579e9a['email'])){return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),_0xeecb('0x28'),null,_0x1b70b1));}}_0x579e9a[_0xeecb('0x29')]=LISTID;_0x579e9a[_0xeecb('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xeecb('0x1b')]&&_0x1ccb1c){var _0x507494={};for(var _0x2bb0d9=0x0,_0x1c74e3=DUPLICATES['length'];_0x2bb0d9<_0x1c74e3;_0x2bb0d9+=0x1){_0x507494[DUPLICATES[_0x2bb0d9]]=_0x579e9a[DUPLICATES[_0x2bb0d9]];}var _0x599ece=_[_0xeecb('0x2b')](_0x1ccb1c,_0x507494);if(_0x599ece){return _0xf766d0(handleCheckRowError(_0xeecb('0x2c'),_0xeecb('0x2d'),_0x599ece,_0x1b70b1));}}return db[_0xeecb('0x2e')][_0xeecb('0x2f')](_0x579e9a,{'raw':!![],'hooks':![],'fields':_[_0xeecb('0x30')](_0x579e9a)})[_0xeecb('0x31')](function(_0x4a7d2f){if(DUPLICATES&&DUPLICATES[_0xeecb('0x1b')]&&_0x1ccb1c){_0x1ccb1c[_0xeecb('0x32')](_['pick'](_0x579e9a,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4a7d2f['id'];return _0x1ea84b();})['catch'](function(_0x19dd8a){return _0xf766d0(handleCheckRowError(_0xeecb('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x19dd8a[_0xeecb('0x1d')]||JSON[_0xeecb('0x33')](_0x19dd8a)),null,_0x1b70b1));});});}function checkHopper(){function _0x1cf5e6(){return function(_0x465185){logger[_0xeecb('0x15')]('cmContact',_0xeecb('0x34'),util[_0xeecb('0x35')](_0x465185,{'showHidden':![],'depth':null}));};}var _0x4f7a2a=function(_0x2b5f92,_0x264e85){var _0x33c37a=squel[_0xeecb('0x36')]()[_0xeecb('0x37')](_0xeecb('0x38'))[_0xeecb('0x39')](['phone',_0xeecb('0x3a'),_0xeecb('0x3b'),'ListId',_0x264e85,'createdAt',_0xeecb('0x3c')],squel[_0xeecb('0x3d')]()[_0xeecb('0x3e')](_0xeecb('0x22'),_0xeecb('0x22'))[_0xeecb('0x3e')](_0xeecb('0x3f'),'scheduledAt')[_0xeecb('0x3e')]('id',_0xeecb('0x3b'))[_0xeecb('0x3e')](LISTID['toString'](),_0xeecb('0x29'))[_0xeecb('0x3e')](_0x2b5f92['id'][_0xeecb('0x40')](),_0x264e85)['field'](_0xeecb('0x3f'),_0xeecb('0x41'))[_0xeecb('0x3e')](_0xeecb('0x3f'),_0xeecb('0x3c'))[_0xeecb('0x42')](_0xeecb('0x43'))[_0xeecb('0x44')]('deletedAt\x20IS\x20NULL')[_0xeecb('0x44')]('ListId\x20=\x20?',LISTID['toString']())[_0xeecb('0x44')](_0xeecb('0x45'))[_0xeecb('0x44')](_0xeecb('0x46'),squel['select']()[_0xeecb('0x3e')](_0xeecb('0x22'))[_0xeecb('0x42')](_0xeecb('0x38'))[_0xeecb('0x44')](_0x264e85+_0xeecb('0x47'),_0x2b5f92['id'][_0xeecb('0x40')]())))[_0xeecb('0x40')]();return _0x33c37a;};var _0x3a30ec=function(_0x8c41a9,_0x1a9c80){var _0x300eef=squel[_0xeecb('0x36')]()[_0xeecb('0x37')](_0xeecb('0x38'))['fromQuery']([_0xeecb('0x22'),'scheduledAt',_0xeecb('0x3b'),_0xeecb('0x29'),_0x1a9c80,'createdAt',_0xeecb('0x3c')],squel['select']()[_0xeecb('0x3e')](_0xeecb('0x22'),_0xeecb('0x22'))[_0xeecb('0x3e')]('NOW()',_0xeecb('0x3a'))[_0xeecb('0x3e')]('id',_0xeecb('0x3b'))['field'](LISTID[_0xeecb('0x40')](),'ListId')[_0xeecb('0x3e')](_0x8c41a9['id'][_0xeecb('0x40')](),_0x1a9c80)['field'](_0xeecb('0x3f'),_0xeecb('0x41'))['field'](_0xeecb('0x3f'),_0xeecb('0x3c'))['from'](_0xeecb('0x43'))[_0xeecb('0x44')](_0xeecb('0x48'))[_0xeecb('0x44')](_0xeecb('0x49'),LISTID[_0xeecb('0x40')]())[_0xeecb('0x44')](_0xeecb('0x4a'),squel['str'](hopperContacts))[_0xeecb('0x44')](_0xeecb('0x45'))[_0xeecb('0x44')](_0xeecb('0x46'),squel[_0xeecb('0x3d')]()[_0xeecb('0x3e')](_0xeecb('0x4b'))[_0xeecb('0x42')](_0xeecb('0x4c'))['where'](_0x1a9c80+_0xeecb('0x47'),_0x8c41a9['id']['toString']()))[_0xeecb('0x44')](_0xeecb('0x46'),squel['select']()[_0xeecb('0x3e')](_0xeecb('0x22'))[_0xeecb('0x42')]('cm_hopper')[_0xeecb('0x44')](_0x1a9c80+_0xeecb('0x47'),_0x8c41a9['id']['toString']())))[_0xeecb('0x40')]();return _0x300eef;};function _0x45972f(_0x30ef2f,_0x3494ef){var _0xd1a77b=squel['insert']()[_0xeecb('0x37')](_0xeecb('0x38'))['fromQuery']([_0xeecb('0x22'),_0xeecb('0x3a'),'ContactId',_0xeecb('0x29'),_0x3494ef,_0xeecb('0x41'),_0xeecb('0x3c')],squel[_0xeecb('0x3d')]()[_0xeecb('0x3e')](_0xeecb('0x22'),'phone')['field'](_0xeecb('0x3f'),_0xeecb('0x3a'))[_0xeecb('0x3e')]('id',_0xeecb('0x3b'))[_0xeecb('0x3e')](LISTID[_0xeecb('0x40')](),_0xeecb('0x29'))[_0xeecb('0x3e')](_0x30ef2f['id']['toString'](),_0x3494ef)[_0xeecb('0x3e')]('NOW()',_0xeecb('0x41'))['field'](_0xeecb('0x3f'),'updatedAt')[_0xeecb('0x42')]('cm_contacts')[_0xeecb('0x44')](_0xeecb('0x48'))[_0xeecb('0x44')](_0xeecb('0x49'),LISTID[_0xeecb('0x40')]())[_0xeecb('0x44')](_0xeecb('0x4a'),squel[_0xeecb('0x4d')](hopperContacts))[_0xeecb('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0xeecb('0x40')]();return _0xd1a77b;}function _0x759dbc(_0x41e29f,_0x52c5cd){var _0x3a9714=squel[_0xeecb('0x36')]()[_0xeecb('0x37')](_0xeecb('0x4e'))[_0xeecb('0x39')]([_0xeecb('0x22'),_0xeecb('0x3b'),'ListId',_0x52c5cd,_0xeecb('0x41'),_0xeecb('0x3c')],squel[_0xeecb('0x3d')]()[_0xeecb('0x3e')]('phone',_0xeecb('0x22'))[_0xeecb('0x3e')]('id',_0xeecb('0x3b'))[_0xeecb('0x3e')](LISTID[_0xeecb('0x40')](),'ListId')[_0xeecb('0x3e')](_0x41e29f['id'][_0xeecb('0x40')](),_0x52c5cd)[_0xeecb('0x3e')](_0xeecb('0x3f'),_0xeecb('0x41'))[_0xeecb('0x3e')](_0xeecb('0x3f'),'updatedAt')[_0xeecb('0x42')]('cm_contacts')[_0xeecb('0x44')](_0xeecb('0x48'))[_0xeecb('0x44')](_0xeecb('0x49'),LISTID[_0xeecb('0x40')]())[_0xeecb('0x44')]('id\x20IN\x20?',squel[_0xeecb('0x4d')](hopperContacts))['where'](_0xeecb('0x45')))['toString']();return _0x3a9714;}return db[_0xeecb('0x4f')]['findAll']({'where':{'type':_0xeecb('0x50')},'attributes':['id',_0xeecb('0x51')],'include':[{'model':db[_0xeecb('0x52')],'as':_0xeecb('0x53'),'where':{'id':LISTID}}]})[_0xeecb('0x31')](function(_0x1a0b5c){var _0x2f58c4=[];if(_0x1a0b5c){var _0x292d17;for(var _0x4c4104=0x0,_0x530a93;_0x4c4104<_0x1a0b5c['length'];_0x4c4104+=0x1){_0x530a93=_0x1a0b5c[_0x4c4104]['get']({'plain':!![]});switch(_0x530a93[_0xeecb('0x51')]){case _0xeecb('0x54'):_0x2f58c4[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x3a30ec(_0x530a93,_0xeecb('0x57')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));break;case'onlyIfOpen':_0x2f58c4[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x4f7a2a(_0x530a93,_0xeecb('0x57')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));break;default:_0x2f58c4['push'](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x45972f(_0x530a93,_0xeecb('0x57')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));}}}return _0x2f58c4;})[_0xeecb('0x59')]()['then'](function(){return db[_0xeecb('0x4f')][_0xeecb('0x5a')]({'where':{'type':_0xeecb('0x50')},'attributes':['id'],'include':[{'model':db[_0xeecb('0x52')],'as':_0xeecb('0x5b'),'where':{'id':LISTID}}]})[_0xeecb('0x31')](function(_0x509566){var _0xff2009=[];if(_0x509566){var _0x3aa1d1;for(var _0x59f1aa=0x0,_0x111d02;_0x59f1aa<_0x509566[_0xeecb('0x1b')];_0x59f1aa+=0x1){_0x111d02=_0x509566[_0x59f1aa][_0xeecb('0x5c')]({'plain':!![]});_0xff2009[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x759dbc(_0x111d02,_0xeecb('0x57')))[_0xeecb('0x31')](function(){})['catch'](_0x1cf5e6()));}}return _0xff2009;})['all']();})[_0xeecb('0x31')](function(){return db[_0xeecb('0x5d')][_0xeecb('0x5a')]({'attributes':['id',_0xeecb('0x51')],'include':[{'model':db[_0xeecb('0x52')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x455aa2){var _0x49c129=[];if(_0x455aa2){for(var _0x2a27e4=0x0,_0x558474;_0x2a27e4<_0x455aa2[_0xeecb('0x1b')];_0x2a27e4+=0x1){_0x558474=_0x455aa2[_0x2a27e4]['get']({'plain':!![]});switch(_0x558474['dialCheckDuplicateType']){case'always':_0x49c129[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x3a30ec(_0x558474,_0xeecb('0x5e')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));break;case _0xeecb('0x5f'):_0x49c129[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x4f7a2a(_0x558474,'CampaignId'))['then'](function(){})['catch'](_0x1cf5e6()));break;default:_0x49c129[_0xeecb('0x32')](db[_0xeecb('0x55')][_0xeecb('0x56')](_0x45972f(_0x558474,'CampaignId'))['then'](function(){})[_0xeecb('0x58')](_0x1cf5e6()));}}}return _0x49c129;})[_0xeecb('0x59')]();})[_0xeecb('0x31')](function(){return db[_0xeecb('0x5d')][_0xeecb('0x5a')]({'attributes':['id'],'include':[{'model':db[_0xeecb('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xeecb('0x31')](function(_0x45f4c3){var _0x1d33f6=[];if(_0x45f4c3){for(var _0x48702d=0x0,_0x547e16;_0x48702d<_0x45f4c3[_0xeecb('0x1b')];_0x48702d+=0x1){_0x547e16=_0x45f4c3[_0x48702d]['get']({'plain':!![]});_0x1d33f6['push'](db['sequelize']['query'](_0x759dbc(_0x547e16,_0xeecb('0x5e')))[_0xeecb('0x31')](function(){})[_0xeecb('0x58')](_0x1cf5e6()));}}return _0x1d33f6;})['all']();})[_0xeecb('0x58')](function(_0x5a099e){logger[_0xeecb('0x15')]('cmContact,\x20%s,\x20%s',_0xeecb('0x60'),_0x5a099e['message']);});}var processPromises=function(_0x5ea4e4){return BPromise[_0xeecb('0x59')](promises)[_0xeecb('0x31')](function(_0x469ac0){})[_0xeecb('0x58')](function(_0x4e6893){logger['error'](_0xeecb('0x61'),JSON[_0xeecb('0x33')](_0x4e6893));})[_0xeecb('0x62')](function(){socket[_0xeecb('0x63')](_0xeecb('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5ea4e4){return _0x5ea4e4[_0xeecb('0x65')]();}});};var endCsv=function(){return BPromise[_0xeecb('0x66')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0xeecb('0x63')](_0xeecb('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x5f5935){logger[_0xeecb('0x15')](_0xeecb('0x67'),JSON[_0xeecb('0x33')](_0x5f5935));}finally{process[_0xeecb('0x68')](0x0);}});};process['on']('SIGINT',function(){logger[_0xeecb('0x69')](_0xeecb('0x6a'));endCsv();});function main(){return BPromise[_0xeecb('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xeecb('0x12')](',');return db[_0xeecb('0x2e')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xeecb('0x31')](function(_0x3f9ec5){var _0x5855dc=fs[_0xeecb('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xeecb('0x6c')](_0x5855dc,{'header':!![],'skipEmptyLines':!![],'step':function(_0x380f7e,_0x274318){total+=0x1;var _0xe65b08=total;promises[_0xeecb('0x32')](checkRow(_0x380f7e,_0x3f9ec5,_0xe65b08)[_0xeecb('0x31')](function(){success+=0x1;})[_0xeecb('0x58')](function(_0xba38f2){if(_0xba38f2['error']){errors+=0x1;delete _0xba38f2[_0xeecb('0x15')];}else if(_0xba38f2[_0xeecb('0x2c')]){duplicates+=0x1;delete _0xba38f2[_0xeecb('0x2c')];}rows[_0xeecb('0x32')](_0xba38f2);}));if(total%0xc8===0x0){_0x274318['pause']();return processPromises(_0x274318);}},'complete':function(){return processPromises()['then'](function(){logger[_0xeecb('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x213248,_0x36d813){logger[_0xeecb('0x69')](_0xeecb('0x6d'),JSON[_0xeecb('0x33')](_0x213248));endCsv();}});})[_0xeecb('0x58')](function(_0x8b49a4){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xeecb('0x33')](_0x8b49a4));});}main(); \ No newline at end of file +var _0x516d=['birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','find','duplicate','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','into','cm_contacts','findAll','outbound','dialCheckDuplicateType','Lists','get','query','VoiceQueueId','sequelize','all','VoiceQueue','BlackLists','Campaign','CmList','always','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','emit','contact:csv_','resume','resolve','unlinkSync','exit','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','Missing\x20filepath\x20parameter!','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','message','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!'];(function(_0x46236b,_0x2142a9){var _0x4fd70d=function(_0x8f9513){while(--_0x8f9513){_0x46236b['push'](_0x46236b['shift']());}};_0x4fd70d(++_0x2142a9);}(_0x516d,0x1a1));var _0xd516=function(_0x16aa09,_0xbadd28){_0x16aa09=_0x16aa09-0x0;var _0x55f174=_0x516d[_0x16aa09];return _0x55f174;};'use strict';var BPromise=require(_0xd516('0x0'));var util=require(_0xd516('0x1'));var _=require(_0xd516('0x2'));var fs=require('fs');var squel=require(_0xd516('0x3'));var Papa=require(_0xd516('0x4'));var Redis=require(_0xd516('0x5'));var db=require(_0xd516('0x6'))['db'];var config=require(_0xd516('0x7'));var logger=require('../../../config/logger')(_0xd516('0x8'));config[_0xd516('0x9')]=_[_0xd516('0xa')](config[_0xd516('0x9')],{'host':_0xd516('0xb'),'port':0x18eb});var socket=require(_0xd516('0xc'))(new Redis(config['redis']));require(_0xd516('0xd'))[_0xd516('0xe')](socket);try{if(!process[_0xd516('0xf')][0x2]||process['argv'][0x2]==='undefined'||process[_0xd516('0xf')][0x2]==='null'){throw new Error(_0xd516('0x10'));}var FILEPATH=process[_0xd516('0xf')][0x2];if(!process[_0xd516('0xf')][0x3]||process[_0xd516('0xf')][0x3]===_0xd516('0x11')||process[_0xd516('0xf')][0x3]===_0xd516('0x12')||!process[_0xd516('0xf')][0x4]||process[_0xd516('0xf')][0x4]===_0xd516('0x11')||process[_0xd516('0xf')][0x4]===_0xd516('0x12')){throw new Error(_0xd516('0x13'));}var FIELDS=_['zipObject'](process[_0xd516('0xf')][0x3]['split'](','),process[_0xd516('0xf')][0x4][_0xd516('0x14')](','));if(!process[_0xd516('0xf')][0x5]||process['argv'][0x5]===_0xd516('0x11')||process[_0xd516('0xf')][0x5]===_0xd516('0x12')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xd516('0xf')][0x5];var COMPANYID=process[_0xd516('0xf')][0x6]&&process[_0xd516('0xf')][0x6]!=='undefined'&&process['argv'][0x6]!=='null'?process[_0xd516('0xf')][0x6]:null;var DUPLICATES=process[_0xd516('0xf')][0x7]&&process['argv'][0x7]!==_0xd516('0x11')&&process[_0xd516('0xf')][0x7]!==_0xd516('0x12')?process['argv'][0x7]:null;if(!process[_0xd516('0xf')][0x8]||process[_0xd516('0xf')][0x8]===_0xd516('0x11')||process[_0xd516('0xf')][0x8]===_0xd516('0x12')){throw new Error(_0xd516('0x15'));}var SOCKET_TIMESTAMP=process[_0xd516('0xf')][0x8];}catch(_0x54d6e9){logger[_0xd516('0x16')](_0x54d6e9);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(_0x3f4019,_0x3a8d75,_0xa69422,_0x2df800){var _0x4f68ec={'message':_0x3a8d75};_0x4f68ec[_0x3f4019]=!![];if(_0xa69422){_0x4f68ec[_0xd516('0x17')]=_0xa69422;}if(_0x2df800){_0x4f68ec[_0xd516('0x18')]=_0x2df800;}return _0x4f68ec;}function isEmail(_0x3e60d8){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))*$/[_0xd516('0x19')](_0x3e60d8);}function checkRow(_0x34841d,_0x27a258,_0x534fa3){return new BPromise(function(_0x12cc33,_0x355edc){if(_[_0xd516('0x1a')](_0x34841d)){return _0x355edc(handleCheckRowError(_0xd516('0x16'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x534fa3));}if(_0x34841d[_0xd516('0x1b')]&&_0x34841d[_0xd516('0x1b')]['length']){var _0x4b16b3=_['map'](_0x34841d[_0xd516('0x1b')],_0xd516('0x1c'))['join'](';');return _0x355edc(handleCheckRowError('error',_0x4b16b3,null,_0x534fa3));}var _0x25eb6f={};for(var _0x23166e in FIELDS){if(FIELDS[_0xd516('0x1d')](_0x23166e)&&FIELDS[_0x23166e]){_0x25eb6f[_0x23166e]=_0x34841d['data'][0x0][FIELDS[_0x23166e]]||_0x34841d[_0xd516('0x1e')][0x0]['\ufeff'+FIELDS[_0x23166e]];}}if(!_0x25eb6f[_0xd516('0x1f')]){return _0x355edc(handleCheckRowError(_0xd516('0x16'),_0xd516('0x20'),null,_0x534fa3));}if(!_0x25eb6f[_0xd516('0x21')]){return _0x355edc(handleCheckRowError(_0xd516('0x16'),_0xd516('0x22'),null,_0x534fa3));}if(_0x25eb6f[_0xd516('0x23')]){var _0x1c7d27=moment(_0x25eb6f[_0xd516('0x23')],_0xd516('0x24'));if(!_0x1c7d27[_0xd516('0x25')]()){return _0x355edc(handleCheckRowError(_0xd516('0x16'),_0xd516('0x26'),null,_0x534fa3));}}if(_0x25eb6f[_0xd516('0x27')]){if(!isEmail(_0x25eb6f[_0xd516('0x27')])){return _0x355edc(handleCheckRowError(_0xd516('0x16'),_0xd516('0x28'),null,_0x534fa3));}}_0x25eb6f[_0xd516('0x29')]=LISTID;_0x25eb6f[_0xd516('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xd516('0x2b')]&&_0x27a258){var _0xf453d3={};for(var _0x54db42=0x0,_0x360ed1=DUPLICATES[_0xd516('0x2b')];_0x54db42<_0x360ed1;_0x54db42+=0x1){_0xf453d3[DUPLICATES[_0x54db42]]=_0x25eb6f[DUPLICATES[_0x54db42]];}var _0x2d0037=_[_0xd516('0x2c')](_0x27a258,_0xf453d3);if(_0x2d0037){return _0x355edc(handleCheckRowError(_0xd516('0x2d'),'Duplicate\x20Contact',_0x2d0037,_0x534fa3));}}return db['CmContact']['create'](_0x25eb6f,{'raw':!![],'hooks':![],'fields':_[_0xd516('0x2e')](_0x25eb6f)})[_0xd516('0x2f')](function(_0x55a913){if(DUPLICATES&&DUPLICATES[_0xd516('0x2b')]&&_0x27a258){_0x27a258[_0xd516('0x30')](_[_0xd516('0x31')](_0x25eb6f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x55a913['id'];return _0x12cc33();})[_0xd516('0x32')](function(_0x1e613e){return _0x355edc(handleCheckRowError(_0xd516('0x16'),_0xd516('0x33')+(_0x1e613e[_0xd516('0x1c')]||JSON['stringify'](_0x1e613e)),null,_0x534fa3));});});}function checkHopper(){function _0x27061d(){return function(_0xc2ab8b){logger['error'](_0xd516('0x34'),_0xd516('0x35'),util[_0xd516('0x36')](_0xc2ab8b,{'showHidden':![],'depth':null}));};}var _0x330f17=function(_0x6df17a,_0x44cec1){var _0x128e85=squel[_0xd516('0x37')]()['into'](_0xd516('0x38'))[_0xd516('0x39')]([_0xd516('0x21'),_0xd516('0x3a'),'ContactId',_0xd516('0x29'),_0x44cec1,_0xd516('0x3b'),_0xd516('0x3c')],squel[_0xd516('0x3d')]()[_0xd516('0x3e')](_0xd516('0x21'),_0xd516('0x21'))[_0xd516('0x3e')](_0xd516('0x3f'),_0xd516('0x3a'))[_0xd516('0x3e')]('id',_0xd516('0x40'))['field'](LISTID[_0xd516('0x41')](),_0xd516('0x29'))[_0xd516('0x3e')](_0x6df17a['id'][_0xd516('0x41')](),_0x44cec1)[_0xd516('0x3e')]('NOW()',_0xd516('0x3b'))[_0xd516('0x3e')](_0xd516('0x3f'),_0xd516('0x3c'))[_0xd516('0x42')]('cm_contacts')[_0xd516('0x43')](_0xd516('0x44'))['where'](_0xd516('0x45'),LISTID[_0xd516('0x41')]())[_0xd516('0x43')](_0xd516('0x46'))['where'](_0xd516('0x47'),squel[_0xd516('0x3d')]()[_0xd516('0x3e')](_0xd516('0x21'))['from'](_0xd516('0x38'))[_0xd516('0x43')](_0x44cec1+_0xd516('0x48'),_0x6df17a['id']['toString']())))[_0xd516('0x41')]();return _0x128e85;};var _0x3d6e6b=function(_0x3b5c8e,_0x598b02){var _0xc56848=squel[_0xd516('0x37')]()['into'](_0xd516('0x38'))['fromQuery']([_0xd516('0x21'),_0xd516('0x3a'),'ContactId',_0xd516('0x29'),_0x598b02,_0xd516('0x3b'),_0xd516('0x3c')],squel[_0xd516('0x3d')]()[_0xd516('0x3e')](_0xd516('0x21'),_0xd516('0x21'))[_0xd516('0x3e')](_0xd516('0x3f'),_0xd516('0x3a'))['field']('id',_0xd516('0x40'))[_0xd516('0x3e')](LISTID[_0xd516('0x41')](),_0xd516('0x29'))[_0xd516('0x3e')](_0x3b5c8e['id'][_0xd516('0x41')](),_0x598b02)[_0xd516('0x3e')](_0xd516('0x3f'),_0xd516('0x3b'))[_0xd516('0x3e')](_0xd516('0x3f'),_0xd516('0x3c'))[_0xd516('0x42')]('cm_contacts')['where'](_0xd516('0x44'))[_0xd516('0x43')](_0xd516('0x45'),LISTID[_0xd516('0x41')]())['where'](_0xd516('0x49'),squel[_0xd516('0x4a')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL')[_0xd516('0x43')](_0xd516('0x47'),squel[_0xd516('0x3d')]()[_0xd516('0x3e')](_0xd516('0x4b'))[_0xd516('0x42')](_0xd516('0x4c'))[_0xd516('0x43')](_0x598b02+_0xd516('0x48'),_0x3b5c8e['id'][_0xd516('0x41')]()))[_0xd516('0x43')](_0xd516('0x47'),squel[_0xd516('0x3d')]()[_0xd516('0x3e')]('phone')[_0xd516('0x42')]('cm_hopper')[_0xd516('0x43')](_0x598b02+_0xd516('0x48'),_0x3b5c8e['id'][_0xd516('0x41')]())))['toString']();return _0xc56848;};function _0x2abf48(_0x539e4a,_0x456a70){var _0x288be2=squel['insert']()[_0xd516('0x4d')]('cm_hopper')[_0xd516('0x39')](['phone',_0xd516('0x3a'),_0xd516('0x40'),_0xd516('0x29'),_0x456a70,_0xd516('0x3b'),_0xd516('0x3c')],squel[_0xd516('0x3d')]()[_0xd516('0x3e')](_0xd516('0x21'),'phone')[_0xd516('0x3e')](_0xd516('0x3f'),_0xd516('0x3a'))['field']('id',_0xd516('0x40'))[_0xd516('0x3e')](LISTID[_0xd516('0x41')](),_0xd516('0x29'))[_0xd516('0x3e')](_0x539e4a['id'][_0xd516('0x41')](),_0x456a70)[_0xd516('0x3e')]('NOW()',_0xd516('0x3b'))[_0xd516('0x3e')]('NOW()','updatedAt')[_0xd516('0x42')](_0xd516('0x4e'))[_0xd516('0x43')](_0xd516('0x44'))[_0xd516('0x43')](_0xd516('0x45'),LISTID[_0xd516('0x41')]())[_0xd516('0x43')](_0xd516('0x49'),squel[_0xd516('0x4a')](hopperContacts))[_0xd516('0x43')](_0xd516('0x46')))['toString']();return _0x288be2;}function _0x14c571(_0x1429b4,_0x6a42e8){var _0x489930=squel[_0xd516('0x37')]()[_0xd516('0x4d')]('cm_hopper_black')[_0xd516('0x39')](['phone',_0xd516('0x40'),_0xd516('0x29'),_0x6a42e8,'createdAt',_0xd516('0x3c')],squel[_0xd516('0x3d')]()[_0xd516('0x3e')](_0xd516('0x21'),_0xd516('0x21'))[_0xd516('0x3e')]('id','ContactId')['field'](LISTID[_0xd516('0x41')](),_0xd516('0x29'))['field'](_0x1429b4['id']['toString'](),_0x6a42e8)['field'](_0xd516('0x3f'),_0xd516('0x3b'))[_0xd516('0x3e')](_0xd516('0x3f'),_0xd516('0x3c'))[_0xd516('0x42')](_0xd516('0x4e'))[_0xd516('0x43')]('deletedAt\x20IS\x20NULL')[_0xd516('0x43')](_0xd516('0x45'),LISTID['toString']())['where'](_0xd516('0x49'),squel[_0xd516('0x4a')](hopperContacts))[_0xd516('0x43')](_0xd516('0x46')))['toString']();return _0x489930;}return db['VoiceQueue'][_0xd516('0x4f')]({'where':{'type':_0xd516('0x50')},'attributes':['id',_0xd516('0x51')],'include':[{'model':db['CmList'],'as':_0xd516('0x52'),'where':{'id':LISTID}}]})['then'](function(_0x5464aa){var _0x1ec371=[];if(_0x5464aa){var _0x243861;for(var _0x509df0=0x0,_0x5ecb1d;_0x509df0<_0x5464aa['length'];_0x509df0+=0x1){_0x5ecb1d=_0x5464aa[_0x509df0][_0xd516('0x53')]({'plain':!![]});switch(_0x5ecb1d[_0xd516('0x51')]){case'always':_0x1ec371['push'](db['sequelize'][_0xd516('0x54')](_0x3d6e6b(_0x5ecb1d,_0xd516('0x55')))[_0xd516('0x2f')](function(){})[_0xd516('0x32')](_0x27061d()));break;case'onlyIfOpen':_0x1ec371[_0xd516('0x30')](db['sequelize'][_0xd516('0x54')](_0x330f17(_0x5ecb1d,_0xd516('0x55')))[_0xd516('0x2f')](function(){})[_0xd516('0x32')](_0x27061d()));break;default:_0x1ec371[_0xd516('0x30')](db[_0xd516('0x56')][_0xd516('0x54')](_0x2abf48(_0x5ecb1d,_0xd516('0x55')))[_0xd516('0x2f')](function(){})['catch'](_0x27061d()));}}}return _0x1ec371;})[_0xd516('0x57')]()[_0xd516('0x2f')](function(){return db[_0xd516('0x58')][_0xd516('0x4f')]({'where':{'type':_0xd516('0x50')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xd516('0x59'),'where':{'id':LISTID}}]})[_0xd516('0x2f')](function(_0x1088a6){var _0x1bb921=[];if(_0x1088a6){var _0x3333d6;for(var _0x56693d=0x0,_0x1a9d4e;_0x56693d<_0x1088a6['length'];_0x56693d+=0x1){_0x1a9d4e=_0x1088a6[_0x56693d][_0xd516('0x53')]({'plain':!![]});_0x1bb921[_0xd516('0x30')](db[_0xd516('0x56')][_0xd516('0x54')](_0x14c571(_0x1a9d4e,_0xd516('0x55')))[_0xd516('0x2f')](function(){})[_0xd516('0x32')](_0x27061d()));}}return _0x1bb921;})['all']();})[_0xd516('0x2f')](function(){return db[_0xd516('0x5a')][_0xd516('0x4f')]({'attributes':['id',_0xd516('0x51')],'include':[{'model':db[_0xd516('0x5b')],'as':_0xd516('0x52'),'where':{'id':LISTID}}]})[_0xd516('0x2f')](function(_0x4cbd8b){var _0x28d9d7=[];if(_0x4cbd8b){for(var _0x2bb6f3=0x0,_0x59a581;_0x2bb6f3<_0x4cbd8b['length'];_0x2bb6f3+=0x1){_0x59a581=_0x4cbd8b[_0x2bb6f3][_0xd516('0x53')]({'plain':!![]});switch(_0x59a581[_0xd516('0x51')]){case _0xd516('0x5c'):_0x28d9d7[_0xd516('0x30')](db['sequelize'][_0xd516('0x54')](_0x3d6e6b(_0x59a581,_0xd516('0x5d')))[_0xd516('0x2f')](function(){})[_0xd516('0x32')](_0x27061d()));break;case _0xd516('0x5e'):_0x28d9d7[_0xd516('0x30')](db[_0xd516('0x56')][_0xd516('0x54')](_0x330f17(_0x59a581,_0xd516('0x5d')))[_0xd516('0x2f')](function(){})['catch'](_0x27061d()));break;default:_0x28d9d7[_0xd516('0x30')](db['sequelize'][_0xd516('0x54')](_0x2abf48(_0x59a581,'CampaignId'))[_0xd516('0x2f')](function(){})[_0xd516('0x32')](_0x27061d()));}}}return _0x28d9d7;})[_0xd516('0x57')]();})[_0xd516('0x2f')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0xd516('0x5b')],'as':_0xd516('0x59'),'where':{'id':LISTID}}]})[_0xd516('0x2f')](function(_0x38a367){var _0x4fe4b4=[];if(_0x38a367){for(var _0x4bcd87=0x0,_0xf11ea6;_0x4bcd87<_0x38a367[_0xd516('0x2b')];_0x4bcd87+=0x1){_0xf11ea6=_0x38a367[_0x4bcd87][_0xd516('0x53')]({'plain':!![]});_0x4fe4b4['push'](db['sequelize']['query'](_0x14c571(_0xf11ea6,'CampaignId'))['then'](function(){})[_0xd516('0x32')](_0x27061d()));}}return _0x4fe4b4;})['all']();})[_0xd516('0x32')](function(_0x13f13d){logger['error'](_0xd516('0x5f'),_0xd516('0x60'),_0x13f13d['message']);});}var processPromises=function(_0x107bce){return BPromise['all'](promises)['then'](function(_0x4b3b33){})[_0xd516('0x32')](function(_0x8c9e83){logger[_0xd516('0x16')]('Error\x20processing\x20rows\x20block:',JSON[_0xd516('0x61')](_0x8c9e83));})['finally'](function(){socket[_0xd516('0x62')](_0xd516('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x107bce){return _0x107bce[_0xd516('0x64')]();}});};var endCsv=function(){return BPromise[_0xd516('0x65')]()[_0xd516('0x2f')](function(){if(hopperContacts){return checkHopper();}})[_0xd516('0x2f')](function(){socket[_0xd516('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xd516('0x66')](FILEPATH);}catch(_0x3c9767){logger['error']('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x3c9767));}finally{process[_0xd516('0x67')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0xd516('0x68'));endCsv();});function main(){return BPromise[_0xd516('0x65')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xd516('0x14')](',');return db[_0xd516('0x69')][_0xd516('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x726be2){var _0xad495d=fs[_0xd516('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xd516('0x6b')](_0xad495d,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4acd44,_0x275e46){total+=0x1;var _0x1792ba=total;promises[_0xd516('0x30')](checkRow(_0x4acd44,_0x726be2,_0x1792ba)['then'](function(){success+=0x1;})[_0xd516('0x32')](function(_0x4cb60c){if(_0x4cb60c[_0xd516('0x16')]){errors+=0x1;delete _0x4cb60c[_0xd516('0x16')];}else if(_0x4cb60c['duplicate']){duplicates+=0x1;delete _0x4cb60c['duplicate'];}rows[_0xd516('0x30')](_0x4cb60c);}));if(total%0xc8===0x0){_0x275e46[_0xd516('0x6c')]();return processPromises(_0x275e46);}},'complete':function(){return processPromises()[_0xd516('0x2f')](function(){logger[_0xd516('0x6d')](_0xd516('0x6e'));endCsv();});},'error':function(_0x23653f,_0x218659){logger[_0xd516('0x6d')](_0xd516('0x6f'),JSON[_0xd516('0x61')](_0x23653f));endCsv();}});})['catch'](function(_0x12a608){logger[_0xd516('0x16')](_0xd516('0x70'),JSON['stringify'](_0x12a608));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index a69dab2..c4b3923 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 _0x9f62=['cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','error','exit','errors','message','query','spread','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','set','offset','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','rows','data','find','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','utcOffset','firstName','\x20not\x20specified','itemTypeId','trim','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','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()','duplicates','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','findAll','then','length','push','all','AdditionalPhones','filter','split','findOne','CmContactHasItem','update','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','phone','cm_contacts','cm_hopper_black','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','ListId','\x22onlyIfOpen\x22','ContactId','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy'];(function(_0x2518d9,_0x154d81){var _0x84d4ad=function(_0x3cd44c){while(--_0x3cd44c){_0x2518d9['push'](_0x2518d9['shift']());}};_0x84d4ad(++_0x154d81);}(_0x9f62,0x12c));var _0x29f6=function(_0x5d8a13,_0x27aea5){_0x5d8a13=_0x5d8a13-0x0;var _0x4593c1=_0x9f62[_0x5d8a13];return _0x4593c1;};'use strict';var fs=require('fs');var path=require(_0x29f6('0x0'));var _=require(_0x29f6('0x1'));var Papa=require(_0x29f6('0x2'));var util=require(_0x29f6('0x3'));var BPromise=require(_0x29f6('0x4'));var moment=require(_0x29f6('0x5'));var squel=require(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));var db=require(_0x29f6('0x8'))['db'];var config=require(_0x29f6('0x9'));var shared=require(_0x29f6('0xa'));var logger=require(_0x29f6('0xb'))('import');config['redis']=_[_0x29f6('0xc')](config[_0x29f6('0xd')],{'host':_0x29f6('0xe'),'port':0x18eb});var socket=require(_0x29f6('0xf'))(new Redis(config[_0x29f6('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0x29f6('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x29f6('0x11')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x14395a){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))*$/[_0x29f6('0x12')](_0x14395a);}function selectNotIn(_0x1aecee,_0x4f6af5,_0x5347eb,_0x50c4e6,_0x548bf2){return squel['select']()[_0x29f6('0x13')]('phone')[_0x29f6('0x14')](_0x50c4e6)[_0x29f6('0x15')](_0x4f6af5,null,_0x4f6af5+_0x29f6('0x16')+_0x50c4e6+'.'+_0x5347eb)[_0x29f6('0x17')](_0x50c4e6+'.'+_0x5347eb+_0x29f6('0x18')+_0x1aecee+'.'+_0x5347eb)[_0x29f6('0x17')](_0x4f6af5+_0x29f6('0x19')+_0x548bf2[_0x29f6('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0xd59009,_0x2c99e8){promisesAdditionalPhones=[];return db['CmContact'][_0x29f6('0x1a')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x29f6('0x1b')](function(_0x3a10cb){if(_0x3a10cb!==null){var _0x3005d5=[];for(var _0xa898b2=0x0;_0xa898b2<_0x3a10cb[_0x29f6('0x1c')];_0xa898b2++){var _0x3c9c98=_0x3a10cb[_0xa898b2];_0x3005d5[_0x29f6('0x1d')](insertAdditionalPhones(_0x3c9c98));}}Promise[_0x29f6('0x1e')](_0x3005d5)[_0x29f6('0x1b')](function(){_0xd59009({'val':0x1});});});});}function insertAdditionalPhones(_0x24976f){return new Promise(function(_0x2bb464,_0x1d7029){var _0x1a88d2=_0x24976f[_0x29f6('0x1f')];var _0x1535b5=_0x1a88d2['split'](';');var _0x143aa1=[];orderBy=0x0;for(var _0x43899d=0x0;_0x43899d<_0x1535b5[_0x29f6('0x1c')];_0x43899d++){_0x143aa1['push'](splitAdditionalPhone(_0x24976f['id'],_0x1535b5[_0x43899d]));}Promise[_0x29f6('0x1e')](_0x143aa1)['then'](function(){_0x2bb464({'val':_0x1535b5[_0x29f6('0x1c')]});});});}function splitAdditionalPhone(_0x33920a,_0x2042aa){return new Promise(function(_0x54d62a,_0x97c6ee){var _0x4eaa7a=_0x2042aa['split'](':');var _0x434339=_0x4eaa7a[0x0];var _0x184568=_0x4eaa7a[0x1];if(!_['isNil'](_0x184568)){var _0x541816=_0x184568['split']('|');var _0x563690=[];for(var _0x161d24=0x0;_0x161d24<_0x541816[_0x29f6('0x1c')];_0x161d24++){if(_0x541816[_0x161d24]!==''){var _0x2e42d9=_[_0x29f6('0x20')](promisesAdditionalPhones,{'contactId':_0x33920a,'phone':_0x541816[_0x161d24]});if(_0x2e42d9[_0x29f6('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x29f6('0x1d')]({'contactId':_0x33920a,'contactTypeId':_0x434339,'phone':_0x541816[_0x161d24],'orderBy':orderBy});}}}_0x54d62a({'ok':0x1});}else _0x54d62a({'res':0x0});});}function createAdditionalPhone(_0x222686,_0x2dfe05,_0xe962ea,_0x4dacbb){var _0x32230e='';var _0x3cf16c='';var _0x47fda2=_0xe962ea[_0x29f6('0x21')]('§');_0x32230e=_0x47fda2[0x0];if(_0x47fda2[_0x29f6('0x1c')]==0x2)_0x3cf16c=_0x47fda2[0x1];return new Promise(function(_0x35c055,_0x32fc62){return db['CmContactHasItem'][_0x29f6('0x22')]({'where':{'CmContactId':_0x222686,'item':_0x32230e}})['then'](function(_0xd01468){if(_0xd01468){return db[_0x29f6('0x23')][_0x29f6('0x24')]({'ItemTypeId':_0x2dfe05,'description':_0x3cf16c,'OrderBy':_0x4dacbb},{'where':{'CmContactId':_0x222686,'item':_0x32230e}})[_0x29f6('0x1b')](function(_0x2e7185){_0x35c055({'res':_0x29f6('0x25')});});}else{return db[_0x29f6('0x23')][_0x29f6('0x26')]({'CmContactId':_0x222686,'item':_0x32230e,'description':_0x3cf16c,'ItemTypeId':_0x2dfe05,'OrderBy':_0x4dacbb,'ItemClass':'PHONE'})[_0x29f6('0x1b')](function(_0x5b7aff){_0x35c055({'res':_0x29f6('0x27')});});}});});}function insertCmHopper(_0x2f3903,_0x461acf,_0x2abdde,_0xafbc68,_0x3cf834){var _0x1c6c41=[_0x29f6('0x28'),_0x29f6('0x29'),_0x29f6('0x2a'),_0x29f6('0x2b'),_0x461acf+'.'+_0xafbc68,_0x29f6('0x2c'),_0x29f6('0x2d'),'cm_contacts.priority',_0x29f6('0x2e'),'\x22'+_0x3cf834+'\x22'];return squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x29f6('0x31'))[_0x29f6('0x32')](['phone',_0x29f6('0x33'),'ContactId','ListId',_0xafbc68,_0x29f6('0x34'),_0x29f6('0x35'),_0x29f6('0x36'),_0x29f6('0x37'),_0x29f6('0x38')],squel[_0x29f6('0x39')]()[_0x29f6('0x3a')](_0x1c6c41)['from'](_0x461acf)[_0x29f6('0x15')]('cm_contacts',null,_0x29f6('0x3b')+_0x461acf+_0x29f6('0x3c'))[_0x29f6('0x15')](_0x2abdde,null,_0x2abdde+'.id\x20=\x20'+_0x461acf+'.'+_0xafbc68)[_0x29f6('0x17')](_0x461acf+_0x29f6('0x3d'),_0x2f3903)[_0x29f6('0x17')](_0x29f6('0x3e'),NOW)[_0x29f6('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x461acf,_0x2abdde,_0xafbc68,_0x29f6('0x31'),[_0x29f6('0x3f'),'\x22onlyIfOpen\x22']))[_0x29f6('0x17')](_0x29f6('0x40'),selectNotIn(_0x461acf,_0x2abdde,_0xafbc68,_0x29f6('0x31'),[_0x29f6('0x3f')])))[_0x29f6('0x41')]();}function insertCmHopperBlack(_0x4343af,_0x259d38,_0x2fa021,_0x4b854f){var _0x52feb1=[_0x29f6('0x28'),_0x29f6('0x2a'),'cm_contacts.ListId',_0x259d38+'.'+_0x4b854f,_0x29f6('0x2c'),_0x29f6('0x2d')];return squel[_0x29f6('0x2f')]()[_0x29f6('0x30')]('cm_hopper_black')[_0x29f6('0x32')]([_0x29f6('0x42'),'ContactId','ListId',_0x4b854f,'createdAt',_0x29f6('0x35')],squel['select']()[_0x29f6('0x3a')](_0x52feb1)['from'](_0x259d38)[_0x29f6('0x15')](_0x29f6('0x43'),null,_0x29f6('0x3b')+_0x259d38+_0x29f6('0x3c'))[_0x29f6('0x15')](_0x2fa021,null,_0x2fa021+'.id\x20=\x20'+_0x259d38+'.'+_0x4b854f)['where'](_0x259d38+_0x29f6('0x3d'),_0x4343af)[_0x29f6('0x17')](_0x29f6('0x3e'),NOW)[_0x29f6('0x17')](_0x29f6('0x40'),squel['select']()['field']('phone')[_0x29f6('0x14')](_0x29f6('0x44'))[_0x29f6('0x17')]('ListId\x20=\x20?',_0x4343af)[_0x29f6('0x17')](_0x4b854f+_0x29f6('0x18')+_0x259d38+'.'+_0x4b854f)))['toString']();}function insertTzCmHopper(_0x44f4cc,_0x427c18,_0x16e367,_0xfd5e5f,_0x5c30cc,_0x39801a){var _0x14f5d0=[_0x29f6('0x28'),_0x29f6('0x45')+_0x39801a+_0x29f6('0x46'),_0x29f6('0x2a'),'cm_contacts.ListId',_0x427c18+'.'+_0xfd5e5f,_0x29f6('0x2c'),_0x29f6('0x2d'),'cm_contacts.priority',_0x29f6('0x2e'),'\x22'+_0x5c30cc+'\x22'];var _0x24abbe=squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x29f6('0x31'))[_0x29f6('0x32')]([_0x29f6('0x42'),_0x29f6('0x33'),'ContactId',_0x29f6('0x47'),_0xfd5e5f,_0x29f6('0x34'),_0x29f6('0x35'),_0x29f6('0x36'),_0x29f6('0x37'),_0x29f6('0x38')],squel[_0x29f6('0x39')]()[_0x29f6('0x3a')](_0x14f5d0)[_0x29f6('0x14')](_0x427c18)[_0x29f6('0x15')](_0x29f6('0x43'),null,_0x29f6('0x3b')+_0x427c18+'.CmListId')[_0x29f6('0x15')](_0x16e367,null,_0x16e367+'.id\x20=\x20'+_0x427c18+'.'+_0xfd5e5f)['join'](_0x39801a,null,_0x39801a+'.id\x20=\x20'+_0x427c18+'.'+_0xfd5e5f)[_0x29f6('0x17')](_0x427c18+_0x29f6('0x3d'),_0x44f4cc)[_0x29f6('0x17')](_0x29f6('0x3e'),NOW)[_0x29f6('0x17')](_0x29f6('0x40'),selectNotIn(_0x427c18,_0x16e367,_0xfd5e5f,'cm_hopper',[_0x29f6('0x3f'),_0x29f6('0x48')]))[_0x29f6('0x17')](_0x29f6('0x40'),selectNotIn(_0x427c18,_0x16e367,_0xfd5e5f,'cm_hopper',[_0x29f6('0x3f')])))[_0x29f6('0x41')]();return _0x24abbe;}function insertTzCmHopperBlack(_0x3ec4a1,_0x59bd34,_0x59f636,_0x560d9d){var _0x59ffb5=['cm_contacts.phone',_0x29f6('0x2a'),_0x29f6('0x2b'),_0x59bd34+'.'+_0x560d9d,'cm_contacts.createdAt',_0x29f6('0x2d')];return squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x29f6('0x44'))['fromQuery']([_0x29f6('0x42'),_0x29f6('0x49'),_0x29f6('0x47'),_0x560d9d,_0x29f6('0x34'),_0x29f6('0x35')],squel[_0x29f6('0x39')]()['fields'](_0x59ffb5)[_0x29f6('0x14')](_0x59bd34)[_0x29f6('0x15')](_0x29f6('0x43'),null,'cm_contacts.ListId\x20=\x20'+_0x59bd34+_0x29f6('0x3c'))['join'](_0x59f636,null,_0x59f636+_0x29f6('0x16')+_0x59bd34+'.'+_0x560d9d)['where'](_0x59bd34+_0x29f6('0x3d'),_0x3ec4a1)['where'](_0x29f6('0x3e'),NOW)[_0x29f6('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x29f6('0x39')]()[_0x29f6('0x13')](_0x29f6('0x42'))[_0x29f6('0x14')](_0x29f6('0x44'))[_0x29f6('0x17')](_0x29f6('0x4a'),_0x3ec4a1)['where'](_0x560d9d+_0x29f6('0x18')+_0x59bd34+'.'+_0x560d9d)))[_0x29f6('0x41')]();}function insertCmHopperAdditionalPhones(_0xc7f76e){var _0x475f9c=[_0x29f6('0x4b'),'cm_contact_has_items.item',_0x29f6('0x4c'),_0x29f6('0x4d'),_0x29f6('0x4e')];return squel['insert']()['into'](_0x29f6('0x4f'))[_0x29f6('0x32')]([_0x29f6('0x50'),'phone',_0x29f6('0x51'),_0x29f6('0x34'),_0x29f6('0x35')],squel[_0x29f6('0x39')]()[_0x29f6('0x3a')](_0x475f9c)[_0x29f6('0x14')](_0x29f6('0x31'))[_0x29f6('0x15')](_0x29f6('0x43'),null,_0x29f6('0x52'))['join'](_0x29f6('0x53'),null,_0x29f6('0x54'))[_0x29f6('0x17')](_0x29f6('0x55'),_0xc7f76e)[_0x29f6('0x17')](_0x29f6('0x3e'),NOW))[_0x29f6('0x41')]();}function insertCmContact(_0x3cd01d,_0x32a11e,_0x365a47,_0x5a8665){var _0x432c49=_[_0x29f6('0x56')](_[_0x29f6('0x57')](_0x5a8665),[_0x29f6('0x47'),_0x29f6('0x58'),_0x29f6('0x34'),_0x29f6('0x35')]);return squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x29f6('0x43'))[_0x29f6('0x32')](_0x432c49,squel[_0x29f6('0x39')]()[_0x29f6('0x3a')](_0x432c49)[_0x29f6('0x14')](_0x32a11e)['where']('('+_0x365a47[_0x29f6('0x15')](',')+_0x29f6('0x59'),squel['select']()[_0x29f6('0x3a')](_0x365a47)[_0x29f6('0x14')](_0x29f6('0x43'))[_0x29f6('0x17')](_0x29f6('0x4a'),_0x3cd01d)[_0x29f6('0x17')]('deletedAt\x20IS\x20NULL'))[_0x29f6('0x17')](_0x29f6('0x5a'),squel[_0x29f6('0x39')]()[_0x29f6('0x13')](_0x29f6('0x5b'),_0x29f6('0x5c'))[_0x29f6('0x14')](_0x32a11e)['group'](_0x365a47['join'](','))))[_0x29f6('0x41')]();}function handleStop(){logger[_0x29f6('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x5d0cfe){logger[_0x29f6('0x5e')](_0x5d0cfe['message']);process[_0x29f6('0x5f')](0x1);}function handleError(_0x50f397,_0x46a94f){stats[_0x29f6('0x60')][_0x29f6('0x1d')]({'name':_0x46a94f['code'],'message':_0x46a94f[_0x29f6('0x61')],'row':_0x50f397});}function handleQuery(_0x2002a5){logger[_0x29f6('0x5d')](_0x2002a5);return db['sequelize'][_0x29f6('0x62')](_0x2002a5)[_0x29f6('0x63')](function(_0x315c48){results[_0x29f6('0x1d')](_0x315c48);})['catch'](function(_0x1fe1f1){logger[_0x29f6('0x5e')](_0x1fe1f1[_0x29f6('0x61')]);});}function updateTzCampaigns(_0x4bd4b6){return new Promise(function(_0x34b77d,_0x3064a5){var _0x5d2d91=squel[_0x29f6('0x39')]()['fields'](['campaigns.id',_0x29f6('0x64')])[_0x29f6('0x14')]('campaigns')[_0x29f6('0x15')](_0x29f6('0x65'),null,_0x29f6('0x66'))[_0x29f6('0x17')](_0x29f6('0x67')+_0x4bd4b6);db[_0x29f6('0x68')]['query'](_0x5d2d91[_0x29f6('0x41')]())[_0x29f6('0x63')](function(_0x404e2a){var _0x3290c5=[];for(var _0x112019=0x0;_0x112019<_0x404e2a['length'];_0x112019++){_0x3290c5[_0x29f6('0x1d')](getTimezoneData(_0x404e2a[_0x112019],tmp_campaigns));}BPromise['all'](_0x3290c5)[_0x29f6('0x1b')](function(){_0x34b77d({'val':0x1});});})[_0x29f6('0x69')](function(_0x2b09d8){logger[_0x29f6('0x5e')](_0x2b09d8['message']);_0x34b77d({'val':0x0});});});}function updateTzVoiceQueues(_0x2309ff){return new Promise(function(_0x77240e,_0x6ab3ca){var _0xfd5c2=squel['select']()[_0x29f6('0x3a')]([_0x29f6('0x6a'),_0x29f6('0x6b')])[_0x29f6('0x14')](_0x29f6('0x6c'))[_0x29f6('0x15')](_0x29f6('0x6d'),null,_0x29f6('0x6e'))[_0x29f6('0x17')](_0x29f6('0x6f')+_0x2309ff);db[_0x29f6('0x68')]['query'](_0xfd5c2[_0x29f6('0x41')]())[_0x29f6('0x63')](function(_0x4c4545){var _0x1024eb=[];for(var _0x59d89c=0x0;_0x59d89c<_0x4c4545['length'];_0x59d89c++){_0x1024eb[_0x29f6('0x1d')](getTimezoneData(_0x4c4545[_0x59d89c],tmp_voice_queues));}BPromise['all'](_0x1024eb)[_0x29f6('0x1b')](function(){_0x77240e({'val':0x1});});})[_0x29f6('0x69')](function(_0x35e5be){logger[_0x29f6('0x5e')](_0x35e5be[_0x29f6('0x61')]);_0x77240e({'val':0x0});});});}function getTimezoneData(_0x1ac6d8,_0x3dcf6d){return new Promise(function(_0x4915a,_0x5e5a74){var _0xdea4a9=shared['timezones'];var _0x4deadf=_0xdea4a9[_0x1ac6d8[_0x29f6('0x70')]];if(_[_0x29f6('0x71')](_0x4deadf)){_0x4915a({'ret':0x1});}else{var _0x413cf3=_0x4deadf['utcOffset'];var _0x1e4401=squel[_0x29f6('0x2f')]()[_0x29f6('0x30')](_0x3dcf6d)[_0x29f6('0x72')]('id',_0x1ac6d8['id'])[_0x29f6('0x72')](_0x29f6('0x73'),_0x413cf3)['set'](_0x29f6('0x70'),_0x1ac6d8['dialTimezone'])['toString']();return db[_0x29f6('0x68')][_0x29f6('0x62')](_0x1e4401)[_0x29f6('0x63')](function(_0x533898){_0x4915a({'ret':0x1});})['catch'](function(_0x443be3){logger[_0x29f6('0x5e')](_0x443be3['message']);_0x5e5a74({'ret':0x1});});}});}function handleTZQuery(_0x170e2a){logger['info'](_0x170e2a);return db['sequelize'][_0x29f6('0x62')](_0x170e2a)[_0x29f6('0x63')](function(_0x4b5859){})['catch'](function(_0x4caa89){logger['error'](_0x4caa89[_0x29f6('0x61')]);});}function main(_0x26124b,_0x127e95,_0x4ab626,_0x11096c){logger['info'](_0x29f6('0x74'),_0x26124b,JSON[_0x29f6('0x75')](_0x127e95));process[_0x29f6('0x76')](_0x29f6('0x77'));var _0x4c2bf3=_0x127e95[_0x29f6('0x78')];var _0x208b6a=_[_0x29f6('0x79')](_0x4c2bf3);var _0x1f574e=_0x127e95[_0x29f6('0x7a')];var _0x5cf519=path[_0x29f6('0x15')](config[_0x29f6('0x7b')],_0x29f6('0x7c'),_0x1f574e+_0x29f6('0x7d'));hasTZ=_[_0x29f6('0x57')](_0x4c2bf3)[_0x29f6('0x7e')]('dialTimezone');var _0x4e9bc6=_['keys'](_0x4c2bf3)['join']();logger[_0x29f6('0x5d')](_0x29f6('0x7f'),_0x4e9bc6);db[_0x29f6('0x80')][_0x29f6('0x1a')]({'raw':!![],'attributes':['id','name']})['then'](function(_0x3dcde1){for(var _0x45efd6=0x0;_0x45efd6<_0x3dcde1['length'];_0x45efd6++){if(_0x3dcde1[_0x45efd6][_0x29f6('0x81')]in _0x4c2bf3){contactItemTypes['push'](_0x3dcde1[_0x45efd6]);delete _0x208b6a[_0x3dcde1[_0x45efd6][_0x29f6('0x81')]];hasAdditionalPhones=!![];}for(var _0x3e1f6f in _0x4c2bf3){if(_0x3dcde1[_0x45efd6][_0x29f6('0x81')]+_0x29f6('0x82')===_0x3e1f6f){phoneDescriptions[_0x29f6('0x1d')]({'itemTypeId':_0x3dcde1[_0x45efd6]['id'],'description':_0x3e1f6f});delete _0x208b6a[_0x3e1f6f];}}}if(hasAdditionalPhones)_0x208b6a[_0x29f6('0x1f')]='';var _0x3cae30=_[_0x29f6('0x57')](_0x208b6a)['join']();logger[_0x29f6('0x5d')](_0x29f6('0x7f'),_0x3cae30);fs[_0x29f6('0x83')](_0x5cf519,_0x3cae30+'\x0a');Papa[_0x29f6('0x84')](fs[_0x29f6('0x85')](_0x26124b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2fcf19,_0xbd8c69){try{for(var _0x1c0ee4=0x0,_0x2ba4d6=[];_0x1c0ee4<_0x2fcf19['data'][_0x29f6('0x1c')];_0x1c0ee4++){stats[_0x29f6('0x86')]+=0x1;if(_0x2fcf19[_0x29f6('0x60')][_0x1c0ee4]){handleError(_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4],_0x2fcf19[_0x29f6('0x60')][_0x1c0ee4]);}else{var _0x590263=[];var _0x1d5940=[];var _0x15f15a={};for(var _0x12045b in _0x4c2bf3){let _0x360566=contactItemTypes[_0x29f6('0x88')](_0x34be2c=>_0x34be2c[_0x29f6('0x81')]===_0x12045b);let _0x1cfe50=contactItemTypes[_0x29f6('0x88')](_0x1b8a71=>_0x1b8a71[_0x29f6('0x81')]+_0x29f6('0x82')===_0x12045b);if(_['isNil'](_0x360566)&&_[_0x29f6('0x71')](_0x1cfe50)){if(_0x4c2bf3[_0x29f6('0x89')](_0x12045b)){if(_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x12045b]]){var _0x52f851=_['trim'](_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x12045b]][_0x29f6('0x8a')](/"/g,'\x27'));switch(_0x12045b){case _0x29f6('0x33'):var _0x4167d1=moment(_0x52f851,_0x29f6('0x10'),!![]);if(_0x4167d1[_0x29f6('0x8b')]()){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x52f851+'\x22');}else{_0x590263['push'](_0x29f6('0x8c'));}break;case _0x29f6('0x36'):var _0x3f6516=parseInt(_0x52f851);_0x52f851=_['isNaN'](_0x3f6516)||_0x3f6516<0x0||_0x3f6516>0x4?_0x11096c?0x3:0x2:_0x3f6516;_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x52f851+'\x22');break;case _0x29f6('0x37'):var _0x18f024=parseInt(_0x52f851);if(_[_0x29f6('0x8d')](_0x18f024)&&_[_0x29f6('0x7e')](_0x4ab626,_0x18f024)){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x18f024+'\x22');}else{_0x590263[_0x29f6('0x1d')]('agent\x20not\x20exists');}break;case _0x29f6('0x8e'):if(isEmail(_0x52f851)){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x52f851+'\x22');}else{_0x590263['push'](_0x29f6('0x8f'));}break;case'dateOfBirth':var _0x2bed40=moment(_0x52f851,_0x29f6('0x90'),!![]);if(_0x2bed40['isValid']()){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x52f851+'\x22');}else{_0x590263[_0x29f6('0x1d')](_0x29f6('0x91'));}break;case _0x29f6('0x70'):var _0x3c6619=shared[_0x29f6('0x92')];var _0x46d06d=_0x3c6619[_0x52f851];if(!_[_0x29f6('0x71')](_0x46d06d)){var _0x5e73c7=_0x46d06d[_0x29f6('0x93')];_0x2ba4d6['push']('\x22'+_0x52f851+'\x22');_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x5e73c7+'\x22');}break;default:_0x2ba4d6['push']('\x22'+_0x52f851+'\x22');}}else{switch(_0x12045b){case _0x29f6('0x94'):case'phone':_0x590263[_0x29f6('0x1d')](_0x12045b+_0x29f6('0x95'));break;default:_0x2ba4d6[_0x29f6('0x1d')]('\x22\x22');}}}}else{var _0xf0c663='';if(!_[_0x29f6('0x71')](_0x360566)){if(!_0x15f15a[_0x29f6('0x89')](_0x360566['id'])){if(!_['isNil'](_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x12045b]])){var _0x52f851=_['trim'](_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x12045b]][_0x29f6('0x8a')](/"/g,'\x27'));var _0x49f077=phoneDescriptions['find'](_0x2cb0be=>_0x2cb0be[_0x29f6('0x96')]===_0x360566['id']);if(!_['isNil'](_0x49f077)){var _0x573a2e=_[_0x29f6('0x97')](_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4][_0x4c2bf3[_0x49f077['description']]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x573a2e))_0x52f851=_0x52f851+'§'+_0x573a2e;}if(_0xf0c663=='')_0xf0c663=_0x52f851;else _0xf0c663+='|'+_0x52f851;}_0x1d5940[_0x29f6('0x1d')](_0x360566['id']+':'+_0xf0c663);_0x15f15a[_0x360566['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2ba4d6[_0x29f6('0x1d')]('\x22'+_0x1d5940['join'](';')+'\x22');}if(_0x590263[_0x29f6('0x1c')]){handleError(_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4],{'code':_0x29f6('0x98'),'message':_0x590263['join']()});}else{fs[_0x29f6('0x99')](_0x5cf519,_0x2ba4d6[_0x29f6('0x15')]()+'\x0a');}_0x2ba4d6=[];}if(!(stats[_0x29f6('0x86')]%0xc8)){socket[_0x29f6('0x9a')]('contact:import:'+_0x1f574e,stats);stats[_0x29f6('0x60')]=[];}}if(stopped){logger[_0x29f6('0x5d')](_0x29f6('0x9b'));_0xbd8c69[_0x29f6('0x9c')]();}}catch(_0x195798){handleError(_0x2fcf19[_0x29f6('0x87')][_0x1c0ee4],{'code':_0x29f6('0x9d'),'message':_0x195798['message']});logger['error']('step',_0x195798[_0x29f6('0x61')]);}},'complete':function(){try{var _0x5dbcc2=[];var _0x48a690=[];var _0x2560d6='cm_contacts';if(_0x127e95['duplicates']&&_0x127e95['duplicates']['length']){_0x2560d6=_0x29f6('0x9e')+_0x1f574e;_0x5dbcc2['push'](_0x29f6('0x9f')+_0x2560d6+_0x29f6('0xa0'));}tmp_campaigns=_0x29f6('0xa1')+_0x1f574e;tmp_voice_queues=_0x29f6('0xa2')+_0x1f574e;_0x48a690[_0x29f6('0x1d')](_0x29f6('0x9f')+tmp_campaigns+_0x29f6('0xa3'));_0x48a690[_0x29f6('0x1d')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x29f6('0xa3'));BPromise[_0x29f6('0xa4')](_0x48a690,handleTZQuery)['then'](function(_0x42372a){updateTzCampaigns(_0x127e95['ListId'])[_0x29f6('0x1b')](function(_0x17039){updateTzVoiceQueues(_0x127e95['ListId'])['then'](function(_0x44aa05){if(hasTZ)_0x3cae30=_0x3cae30[_0x29f6('0x8a')](_0x29f6('0x70'),_0x29f6('0xa5'));var _0x2b0302=util[_0x29f6('0x11')](_0x29f6('0xa6'),_0x5cf519,_0x2560d6,_0x3cae30,_0x127e95['ListId'],_0x127e95['CompanyId']||null,NOW,NOW);if(_['isNil'](_0x4c2bf3['scheduledat'])){_0x2b0302+=_0x29f6('0xa7');}_0x5dbcc2[_0x29f6('0x1d')](_0x2b0302);if(_0x127e95[_0x29f6('0xa8')]&&_0x127e95[_0x29f6('0xa8')][_0x29f6('0x1c')]){_0x5dbcc2['push'](insertCmContact(_0x127e95[_0x29f6('0x47')],_0x2560d6,_0x127e95[_0x29f6('0xa8')],_0x4c2bf3));_0x5dbcc2[_0x29f6('0x1d')]('DROP\x20TABLE\x20'+_0x2560d6+';');}BPromise[_0x29f6('0xa4')](_0x5dbcc2,handleQuery)[_0x29f6('0x1b')](function(_0x47a296){BPromise[_0x29f6('0x1e')]([handleAdditionalPhones()])[_0x29f6('0x1b')](function(){_0x5dbcc2=[];for(var _0x426363=0x0;_0x426363_0x3d41e6['name']===_0x4db584);let _0x2b58a7=contactItemTypes[_0x5d96('0x84')](_0x32115c=>_0x32115c[_0x5d96('0x7d')]+_0x5d96('0x85')===_0x4db584);if(_[_0x5d96('0x1d')](_0x3d0262)&&_['isNil'](_0x2b58a7)){if(_0x560739[_0x5d96('0x86')](_0x4db584)){if(_0x34edef['data'][_0x455473][_0x560739[_0x4db584]]){var _0x2394d6=_[_0x5d96('0x87')](_0x34edef['data'][_0x455473][_0x560739[_0x4db584]][_0x5d96('0x88')](/"/g,'\x27'));switch(_0x4db584){case _0x5d96('0x2f'):var _0xff9509=moment(_0x2394d6,_0x5d96('0xc'),!![]);if(_0xff9509[_0x5d96('0x89')]()){_0x145b80['push']('\x22'+_0x2394d6+'\x22');}else{_0x3f4393[_0x5d96('0x1a')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x5d96('0x34'):var _0xe9cd88=parseInt(_0x2394d6);_0x2394d6=_[_0x5d96('0x8a')](_0xe9cd88)||_0xe9cd88<0x0||_0xe9cd88>0x4?_0x1dcb38?0x3:0x2:_0xe9cd88;_0x145b80[_0x5d96('0x1a')]('\x22'+_0x2394d6+'\x22');break;case _0x5d96('0x35'):var _0x13cc7b=parseInt(_0x2394d6);if(_[_0x5d96('0x8b')](_0x13cc7b)&&_[_0x5d96('0x7a')](_0x47eddc,_0x13cc7b)){_0x145b80[_0x5d96('0x1a')]('\x22'+_0x13cc7b+'\x22');}else{_0x3f4393[_0x5d96('0x1a')](_0x5d96('0x8c'));}break;case _0x5d96('0x8d'):if(isEmail(_0x2394d6)){_0x145b80[_0x5d96('0x1a')]('\x22'+_0x2394d6+'\x22');}else{_0x3f4393[_0x5d96('0x1a')](_0x5d96('0x8e'));}break;case _0x5d96('0x8f'):var _0x197139=moment(_0x2394d6,_0x5d96('0x90'),!![]);if(_0x197139['isValid']()){_0x145b80['push']('\x22'+_0x2394d6+'\x22');}else{_0x3f4393['push'](_0x5d96('0x91'));}break;case'dialTimezone':var _0x5a571e=shared[_0x5d96('0x6b')];var _0xa1e5a5=_0x5a571e[_0x2394d6];if(!_['isNil'](_0xa1e5a5)){var _0x8b5b5=_0xa1e5a5[_0x5d96('0x6d')];_0x145b80[_0x5d96('0x1a')]('\x22'+_0x2394d6+'\x22');_0x145b80[_0x5d96('0x1a')]('\x22'+_0x8b5b5+'\x22');}break;default:_0x145b80[_0x5d96('0x1a')]('\x22'+_0x2394d6+'\x22');}}else{switch(_0x4db584){case'firstName':case _0x5d96('0x2e'):_0x3f4393['push'](_0x4db584+_0x5d96('0x92'));break;default:_0x145b80[_0x5d96('0x1a')]('\x22\x22');}}}}else{var _0x3431f1='';if(!_[_0x5d96('0x1d')](_0x3d0262)){if(!_0x5a5a54[_0x5d96('0x86')](_0x3d0262['id'])){if(!_[_0x5d96('0x1d')](_0x34edef[_0x5d96('0x82')][_0x455473][_0x560739[_0x4db584]])){var _0x2394d6=_[_0x5d96('0x87')](_0x34edef[_0x5d96('0x82')][_0x455473][_0x560739[_0x4db584]][_0x5d96('0x88')](/"/g,'\x27'));var _0x5a9ee3=phoneDescriptions[_0x5d96('0x84')](_0x478e95=>_0x478e95[_0x5d96('0x93')]===_0x3d0262['id']);if(!_['isNil'](_0x5a9ee3)){var _0x5ced15=_['trim'](_0x34edef['data'][_0x455473][_0x560739[_0x5a9ee3[_0x5d96('0x94')]]]['replace'](/"/g,'\x27'));if(!_[_0x5d96('0x1d')](_0x5ced15))_0x2394d6=_0x2394d6+'§'+_0x5ced15;}if(_0x3431f1=='')_0x3431f1=_0x2394d6;else _0x3431f1+='|'+_0x2394d6;}_0x2aa9ba['push'](_0x3d0262['id']+':'+_0x3431f1);_0x5a5a54[_0x3d0262['id']]=0x1;}}}}if(hasAdditionalPhones){_0x145b80['push']('\x22'+_0x2aa9ba[_0x5d96('0x12')](';')+'\x22');}if(_0x3f4393[_0x5d96('0x19')]){handleError(_0x34edef[_0x5d96('0x82')][_0x455473],{'code':_0x5d96('0x95'),'message':_0x3f4393['join']()});}else{fs[_0x5d96('0x96')](_0x4edca5,_0x145b80[_0x5d96('0x12')]()+'\x0a');}_0x145b80=[];}if(!(stats['rows']%0xc8)){socket[_0x5d96('0x97')](_0x5d96('0x98')+_0x40bfb5,stats);stats[_0x5d96('0x58')]=[];}}if(stopped){logger[_0x5d96('0x55')]('Abort\x20parser');_0x163211['abort']();}}catch(_0x3d6da4){handleError(_0x34edef[_0x5d96('0x82')][_0x455473],{'code':_0x5d96('0x99'),'message':_0x3d6da4[_0x5d96('0x5a')]});logger[_0x5d96('0x5e')](_0x5d96('0x9a'),_0x3d6da4[_0x5d96('0x5a')]);}},'complete':function(){try{var _0x26630c=[];var _0x2bca6a=[];var _0x5531b9=_0x5d96('0x36');if(_0x51d585['duplicates']&&_0x51d585[_0x5d96('0x9b')][_0x5d96('0x19')]){_0x5531b9='cm_contacts_'+_0x40bfb5;_0x26630c[_0x5d96('0x1a')]('CREATE\x20TABLE\x20'+_0x5531b9+_0x5d96('0x9c'));}tmp_campaigns=_0x5d96('0x9d')+_0x40bfb5;tmp_voice_queues='voice_queues_'+_0x40bfb5;_0x2bca6a[_0x5d96('0x1a')](_0x5d96('0x9e')+tmp_campaigns+_0x5d96('0x9f'));_0x2bca6a['push'](_0x5d96('0x9e')+tmp_voice_queues+_0x5d96('0x9f'));BPromise[_0x5d96('0xa0')](_0x2bca6a,handleTZQuery)[_0x5d96('0x18')](function(_0x3c6e04){updateTzCampaigns(_0x51d585[_0x5d96('0x31')])[_0x5d96('0x18')](function(_0x1b1b35){updateTzVoiceQueues(_0x51d585[_0x5d96('0x31')])[_0x5d96('0x18')](function(_0x11ade4){if(hasTZ)_0x4e55fc=_0x4e55fc[_0x5d96('0x88')](_0x5d96('0x6c'),_0x5d96('0xa1'));var _0x167977=util['format'](_0x5d96('0xa2'),_0x4edca5,_0x5531b9,_0x4e55fc,_0x51d585[_0x5d96('0x31')],_0x51d585[_0x5d96('0xa3')]||null,NOW,NOW);if(_[_0x5d96('0x1d')](_0x560739[_0x5d96('0x2f')])){_0x167977+=_0x5d96('0xa4');}_0x26630c['push'](_0x167977);if(_0x51d585[_0x5d96('0x9b')]&&_0x51d585[_0x5d96('0x9b')][_0x5d96('0x19')]){_0x26630c['push'](insertCmContact(_0x51d585['ListId'],_0x5531b9,_0x51d585[_0x5d96('0x9b')],_0x560739));_0x26630c['push'](_0x5d96('0xa5')+_0x5531b9+';');}BPromise[_0x5d96('0xa0')](_0x26630c,handleQuery)[_0x5d96('0x18')](function(_0x5898f6){BPromise['all']([handleAdditionalPhones()])[_0x5d96('0x18')](function(){_0x26630c=[];for(var _0x5bde56=0x0;_0x5bde56\x20\x20');}var _0x586064=path['join'](config[_0x5d96('0x77')],_0x5d96('0x78'),process[_0x5d96('0xb1')][0x2]);if(!fs['existsSync'](_0x586064)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x3d37e={};try{_0x3d37e=JSON[_0x5d96('0x80')](process[_0x5d96('0xb1')][0x3]);if(!_0x3d37e[_0x5d96('0x74')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x3d37e[_0x5d96('0x74')]['phone']){throw new Error(_0x5d96('0xb2'));}if(!_0x3d37e[_0x5d96('0x74')][_0x5d96('0xb3')]){throw new Error(_0x5d96('0xb4'));}var _0x5b2f85=0x0;if(_0x3d37e[_0x5d96('0x74')][_0x5d96('0x35')]){_0x5b2f85=0x1;}if(!_0x3d37e[_0x5d96('0x31')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x26fcfc){throw new Error('body\x20id\x20mandatory');}var _0x4a2194=[];try{_0x4a2194=_['map'](JSON['parse'](process[_0x5d96('0xb1')][0x4]),'id');}catch(_0x4a2908){logger[_0x5d96('0x55')](_0x5d96('0xb5'));}main(_0x586064,_0x3d37e,_0x4a2194,_0x5b2f85);}validate();process['on'](_0x5d96('0xb6'),handleStop);process['on'](_0x5d96('0xb7'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 855b672..e253c71 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe54c=['length','AdditionalPhones','push','then','catch','error','message','isNil','split','CmContactHasItem','update','updated','create','PHONE','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','insert','into','cm_hopper','scheduledat','createdAt','updatedAt','priority','UserId','recallme','fields','from','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.phone','cm_hopper_black','ListId','ListId\x20=\x20?','\x20=\x20?','toString','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','fromQuery','OrderBy','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','errors','code','main','stringify','send','start','socket_timestamp','root','.csv','ContactItemType','findAll','name','_description','header','writeFileSync','createReadStream','data','find','hasOwnProperty','trim','replace','isValid','isNumber','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','emit','contact:import:','SystemError','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','all','contactId','contactTypeId','orderBy','finish','unlink','complete','argv','arguments\x20\x20\x20','server/files/tmp','file\x20doesn\x27t\x20exists','parse','binding','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/environment','import','redis','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','field','phone','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0xe54c,0x79));var _0xce54=function(_0x4f51f9,_0x5d5613){_0x4f51f9=_0x4f51f9-0x0;var _0x533984=_0xe54c[_0x4f51f9];return _0x533984;};'use strict';var fs=require('fs');var path=require(_0xce54('0x0'));var _=require(_0xce54('0x1'));var Papa=require(_0xce54('0x2'));var util=require(_0xce54('0x3'));var BPromise=require(_0xce54('0x4'));var moment=require(_0xce54('0x5'));var squel=require(_0xce54('0x6'));var Redis=require(_0xce54('0x7'));var db=require('../../../mysqldb')['db'];var config=require(_0xce54('0x8'));var logger=require('../../../config/logger')(_0xce54('0x9'));config[_0xce54('0xa')]=_['defaults'](config[_0xce54('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xce54('0xb'))(new Redis(config[_0xce54('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0xce54('0xc'));var tempTableName=_0xce54('0xd')+moment()[_0xce54('0xe')](_0xce54('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xb0f2df){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))*$/[_0xce54('0x10')](_0xb0f2df);}function selectNotIn(_0x41a8ac,_0x4b73ec,_0x236549,_0xf75956,_0x1c84a9){return squel[_0xce54('0x11')]()[_0xce54('0x12')](_0xce54('0x13'))['from'](_0xf75956)['join'](_0x4b73ec,null,_0x4b73ec+'.id\x20=\x20'+_0xf75956+'.'+_0x236549)[_0xce54('0x14')](_0xf75956+'.'+_0x236549+'\x20=\x20'+_0x41a8ac+'.'+_0x236549)[_0xce54('0x14')](_0x4b73ec+_0xce54('0x15')+_0x1c84a9['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x586520,_0x355e0f){promisesAdditionalPhones=[];promisesContact=[];return db[_0xce54('0x16')][_0xce54('0x17')](_0xce54('0x18')+tempTableName)[_0xce54('0x19')](function(_0x57effb){if(_0x57effb!==null){var _0x4fafc0=[];for(var _0x3eee0d=0x0;_0x3eee0d<_0x57effb[_0xce54('0x1a')];_0x3eee0d++){var _0x2b60e8=_0x57effb[_0x3eee0d];if(!_['isNil'](_0x2b60e8[_0xce54('0x13')])){if(!_['isNil'](_0x2b60e8[_0xce54('0x1b')]))_0x4fafc0['push'](insertAdditionalPhones(_0x2b60e8));promisesContact[_0xce54('0x1c')]({'contact':_0x2b60e8});}}}Promise['all'](_0x4fafc0)[_0xce54('0x1d')](function(){_0x586520({'val':0x1});});})[_0xce54('0x1e')](function(_0x268acd){logger[_0xce54('0x1f')](_0x268acd[_0xce54('0x20')]);});});}function insertAdditionalPhones(_0x58739c){return new Promise(function(_0x50fe8c,_0x375ae4){var _0x348770=_0x58739c[_0xce54('0x1b')];if(_[_0xce54('0x21')](_0x348770))_0x375ae4({'val':0x0});else{var _0x13e074=_0x348770[_0xce54('0x22')](';');var _0x35c3a8=[];orderBy=0x0;for(var _0x486d35=0x0;_0x486d35<_0x13e074['length'];_0x486d35++){_0x35c3a8[_0xce54('0x1c')](splitAdditionalPhone(_0x58739c['id'],_0x13e074[_0x486d35]));}Promise['all'](_0x35c3a8)[_0xce54('0x1d')](function(){_0x50fe8c({'val':_0x13e074[_0xce54('0x1a')]});});}});}function splitAdditionalPhone(_0x3a96e6,_0xdde13e){return new Promise(function(_0x2057fa,_0x2d83be){var _0x490621=_0xdde13e[_0xce54('0x22')](':');var _0x12622e=_0x490621[0x0];var _0x4d0bd7=_0x490621[0x1];if(_0x4d0bd7!==''){var _0x38cf3b=_0x4d0bd7[_0xce54('0x22')]('|');var _0x1c48ab=[];for(var _0x3243f6=0x0;_0x3243f6<_0x38cf3b[_0xce54('0x1a')];_0x3243f6++){if(_0x38cf3b[_0x3243f6]!==''){var _0x1cb75f=_['filter'](promisesAdditionalPhones,{'contactId':_0x3a96e6,'phone':_0x38cf3b[_0x3243f6]});if(_0x1cb75f[_0xce54('0x1a')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x3a96e6,'contactTypeId':_0x12622e,'phone':_0x38cf3b[_0x3243f6],'orderBy':orderBy});}}}_0x2057fa({'ok':0x1});}else _0x2057fa({'res':0x0});});}function createAdditionalPhone(_0x585ef3,_0x1461c7,_0x243aff,_0x2c7a7e){var _0x4b94ca='';var _0x2cd689='';var _0x215c16=_0x243aff['split']('§');_0x4b94ca=_0x215c16[0x0];if(_0x215c16['length']==0x2)_0x2cd689=_0x215c16[0x1];return new Promise(function(_0xd7800f,_0x1bb48d){return db[_0xce54('0x23')]['findOne']({'where':{'CmContactId':_0x585ef3,'item':_0x4b94ca}})[_0xce54('0x1d')](function(_0x27a65e){if(_0x27a65e){return db[_0xce54('0x23')][_0xce54('0x24')]({'ItemTypeId':_0x1461c7,'description':_0x2cd689,'OrderBy':_0x2c7a7e},{'where':{'CmContactId':_0x585ef3,'item':_0x4b94ca}})[_0xce54('0x1d')](function(_0x1b9e07){_0xd7800f({'res':_0xce54('0x25')});});}else{return db[_0xce54('0x23')][_0xce54('0x26')]({'CmContactId':_0x585ef3,'item':_0x4b94ca,'ItemTypeId':_0x1461c7,'description':_0x2cd689,'OrderBy':_0x2c7a7e,'ItemClass':_0xce54('0x27')})[_0xce54('0x1d')](function(_0x37ef02){_0xd7800f({'res':'inserted'});});}});});}function updateContact(_0x5c8e55){return new Promise(function(_0x575779,_0x4053d7){var _0x2a9ee8=_0x5c8e55['id'];delete _0x5c8e55['id'];return db['CmContact']['update'](_0x5c8e55,{'where':{'id':_0x2a9ee8}})[_0xce54('0x1d')](function(_0x18c242){updatedRows+=0x1;return db[_0xce54('0x28')][_0xce54('0x24')]({'phone':_0x5c8e55[_0xce54('0x13')]},{'where':{'ContactId':_0x2a9ee8}})[_0xce54('0x1d')](function(_0x12bd9f){_0x575779({'ret':'OK'});});});});}function insertCmHopper(_0x432ba2,_0x29824b,_0xd1d6bc,_0x595d8b,_0x5c81b8){var _0x52e664=['cm_contacts.phone',_0xce54('0x29'),_0xce54('0x2a'),_0xce54('0x2b'),_0x29824b+'.'+_0x595d8b,_0xce54('0x2c'),'cm_contacts.updatedAt',_0xce54('0x2d'),'cm_contacts.UserId','\x22'+_0x5c81b8+'\x22'];return squel[_0xce54('0x2e')]()[_0xce54('0x2f')](_0xce54('0x30'))['fromQuery'](['phone',_0xce54('0x31'),'ContactId','ListId',_0x595d8b,_0xce54('0x32'),_0xce54('0x33'),_0xce54('0x34'),_0xce54('0x35'),_0xce54('0x36')],squel[_0xce54('0x11')]()[_0xce54('0x37')](_0x52e664)[_0xce54('0x38')](_0x29824b)[_0xce54('0x39')](_0xce54('0x3a'),null,_0xce54('0x3b')+_0x29824b+_0xce54('0x3c'))[_0xce54('0x39')](_0xd1d6bc,null,_0xd1d6bc+_0xce54('0x3d')+_0x29824b+'.'+_0x595d8b)[_0xce54('0x14')](_0x29824b+_0xce54('0x3e'),_0x432ba2)['where'](_0xce54('0x3f'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x29824b,_0xd1d6bc,_0x595d8b,'cm_hopper',[_0xce54('0x40'),'\x22onlyIfOpen\x22']))['where'](_0xce54('0x41'),selectNotIn(_0x29824b,_0xd1d6bc,_0x595d8b,_0xce54('0x30'),[_0xce54('0x40')])))['toString']();}function insertCmHopperBlack(_0x11d53a,_0x11e240,_0x5b929a,_0x34ba65){var _0x243282=[_0xce54('0x42'),_0xce54('0x2a'),'cm_contacts.ListId',_0x11e240+'.'+_0x34ba65,_0xce54('0x2c'),'cm_contacts.updatedAt'];return squel['insert']()[_0xce54('0x2f')](_0xce54('0x43'))['fromQuery'](['phone','ContactId',_0xce54('0x44'),_0x34ba65,_0xce54('0x32'),_0xce54('0x33')],squel[_0xce54('0x11')]()[_0xce54('0x37')](_0x243282)[_0xce54('0x38')](_0x11e240)[_0xce54('0x39')](_0xce54('0x3a'),null,_0xce54('0x3b')+_0x11e240+_0xce54('0x3c'))[_0xce54('0x39')](_0x5b929a,null,_0x5b929a+_0xce54('0x3d')+_0x11e240+'.'+_0x34ba65)['where'](_0x11e240+_0xce54('0x3e'),_0x11d53a)[_0xce54('0x14')](_0xce54('0x3f'),NOW)['where'](_0xce54('0x41'),squel[_0xce54('0x11')]()[_0xce54('0x12')](_0xce54('0x13'))[_0xce54('0x38')](_0xce54('0x43'))[_0xce54('0x14')](_0xce54('0x45'),_0x11d53a)[_0xce54('0x14')](_0x34ba65+_0xce54('0x46'),_0x11e240+'.'+_0x34ba65)))[_0xce54('0x47')]();}function insertCmHopperAdditionalPhones(_0x405b3f){var _0x51814c=['cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy',_0xce54('0x48'),_0xce54('0x49')];return squel[_0xce54('0x2e')]()[_0xce54('0x2f')](_0xce54('0x4a'))[_0xce54('0x4b')](['CmHopperId',_0xce54('0x13'),_0xce54('0x4c'),_0xce54('0x32'),_0xce54('0x33')],squel[_0xce54('0x11')]()[_0xce54('0x37')](_0x51814c)['from']('cm_hopper')[_0xce54('0x39')](_0xce54('0x3a'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xce54('0x39')]('cm_contact_has_items',null,_0xce54('0x4d'))[_0xce54('0x14')](_0xce54('0x4e'),_0x405b3f)['where'](_0xce54('0x3f'),NOW))[_0xce54('0x47')]();}function insertCmContact(_0x322dc4,_0x13f78b,_0x208943,_0xdaa118){var _0x43fda2=_['concat'](_[_0xce54('0x4f')](_0xdaa118),[_0xce54('0x44'),_0xce54('0x50'),_0xce54('0x32'),_0xce54('0x33')]);return squel[_0xce54('0x2e')]()['into'](_0xce54('0x3a'))[_0xce54('0x4b')](_0x43fda2,squel['select']()[_0xce54('0x37')](_0x43fda2)[_0xce54('0x38')](_0x13f78b)[_0xce54('0x14')]('('+_0x208943[_0xce54('0x39')](',')+_0xce54('0x51'),squel[_0xce54('0x11')]()[_0xce54('0x37')](_0x208943)['from'](_0xce54('0x3a'))[_0xce54('0x14')](_0xce54('0x45'),_0x322dc4))['where']('id\x20IN\x20?',squel[_0xce54('0x11')]()['field'](_0xce54('0x52'),_0xce54('0x53'))[_0xce54('0x38')](_0x13f78b)['group'](_0x208943['join'](','))))[_0xce54('0x47')]();}function handleStop(){logger[_0xce54('0x54')](_0xce54('0x55'));stopped=!![];}function handleUncaughtException(_0x42305e){logger[_0xce54('0x1f')](_0x42305e[_0xce54('0x20')]);process[_0xce54('0x56')](0x1);}function handleError(_0x50db00,_0x17ccb1){stats[_0xce54('0x57')][_0xce54('0x1c')]({'name':_0x17ccb1[_0xce54('0x58')],'message':_0x17ccb1['message'],'row':_0x50db00});}function handleQuery(_0x5e2c97){logger['info'](_0x5e2c97);return db[_0xce54('0x16')][_0xce54('0x17')](_0x5e2c97)[_0xce54('0x19')](function(_0x24ecb5){results[_0xce54('0x1c')](_0x24ecb5);})['catch'](function(_0x53b8ba){logger[_0xce54('0x1f')](_0x53b8ba['message']);});}function main(_0x43931e,_0x450484,_0x4621a5,_0x504302){logger['info'](_0xce54('0x59'),_0x43931e,JSON[_0xce54('0x5a')](_0x450484));process[_0xce54('0x5b')](_0xce54('0x5c'));var _0x51a685=_0x450484['binding'];var _0x34361a=_['clone'](_0x51a685);var _0x3d78ab=_0x450484[_0xce54('0x5d')];var _0x927424=path[_0xce54('0x39')](config[_0xce54('0x5e')],'server/files/tmp',_0x3d78ab+_0xce54('0x5f'));logger[_0xce54('0x54')]('body',_0x450484);db[_0xce54('0x60')][_0xce54('0x61')]({'raw':!![],'attributes':['id',_0xce54('0x62')]})[_0xce54('0x1d')](function(_0x3b940a){for(var _0x3d8a07=0x0;_0x3d8a07<_0x3b940a[_0xce54('0x1a')];_0x3d8a07++){if(_0x3b940a[_0x3d8a07][_0xce54('0x62')]in _0x51a685){contactItemTypes[_0xce54('0x1c')](_0x3b940a[_0x3d8a07]);delete _0x34361a[_0x3b940a[_0x3d8a07][_0xce54('0x62')]];hasAdditionalPhones=!![];}for(var _0x20d33f in _0x51a685){if(_0x3b940a[_0x3d8a07][_0xce54('0x62')]+_0xce54('0x63')===_0x20d33f){phoneDescriptions['push']({'itemTypeId':_0x3b940a[_0x3d8a07]['id'],'description':_0x20d33f});delete _0x34361a[_0x20d33f];}}}if(hasAdditionalPhones)_0x34361a[_0xce54('0x1b')]='';var _0x1741e8=_[_0xce54('0x4f')](_0x34361a)['join']();logger['info'](_0xce54('0x64'),_0x1741e8);fs[_0xce54('0x65')](_0x927424,_0x1741e8+'\x0a');Papa['parse'](fs[_0xce54('0x66')](_0x43931e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ca193,_0x67afb9){try{for(var _0x56023d=0x0,_0x4e15af=[];_0x56023d<_0x1ca193['data'][_0xce54('0x1a')];_0x56023d++){stats['rows']+=0x1;if(_0x1ca193[_0xce54('0x57')][_0x56023d]){handleError(_0x1ca193[_0xce54('0x67')][_0x56023d],_0x1ca193[_0xce54('0x57')][_0x56023d]);}else{var _0x403053=[];var _0x306092=[];var _0xa94508={};for(var _0x95205b in _0x51a685){let _0x811f6a=contactItemTypes[_0xce54('0x68')](_0x226a4d=>_0x226a4d[_0xce54('0x62')]===_0x95205b);let _0x2aa4c9=contactItemTypes[_0xce54('0x68')](_0x5a5ef9=>_0x5a5ef9['name']+'_description'===_0x95205b);if(_[_0xce54('0x21')](_0x811f6a)&&_[_0xce54('0x21')](_0x2aa4c9)){if(_0x51a685[_0xce54('0x69')](_0x95205b)){if(_0x1ca193[_0xce54('0x67')][_0x56023d][_0x51a685[_0x95205b]]){var _0x25cd90=_[_0xce54('0x6a')](_0x1ca193[_0xce54('0x67')][_0x56023d][_0x51a685[_0x95205b]][_0xce54('0x6b')](/"/g,'\x27'));switch(_0x95205b){case _0xce54('0x31'):var _0xf16f4d=moment(_0x25cd90,_0xce54('0xc'),!![]);if(_0xf16f4d[_0xce54('0x6c')]()){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x25cd90+'\x22');}else{_0x403053[_0xce54('0x1c')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xce54('0x34'):var _0x36b3f6=parseInt(_0x25cd90);_0x25cd90=_['isNaN'](_0x36b3f6)||_0x36b3f6<0x0||_0x36b3f6>0x4?_0x504302?0x3:0x2:_0x36b3f6;_0x4e15af['push']('\x22'+_0x25cd90+'\x22');break;case _0xce54('0x35'):var _0x165c44=parseInt(_0x25cd90);if(_[_0xce54('0x6d')](_0x165c44)&&_[_0xce54('0x6e')](_0x4621a5,_0x165c44)){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x165c44+'\x22');}else{_0x403053['push']('agent\x20not\x20exists');}break;case'email':if(isEmail(_0x25cd90)){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x25cd90+'\x22');}else{_0x403053[_0xce54('0x1c')](_0xce54('0x6f'));}break;case _0xce54('0x70'):var _0x2beaef=moment(_0x25cd90,_0xce54('0x71'),!![]);if(_0x2beaef[_0xce54('0x6c')]()){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x25cd90+'\x22');}else{_0x403053[_0xce54('0x1c')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4e15af[_0xce54('0x1c')]('\x22'+_0x25cd90+'\x22');}}else{switch(_0x95205b){case _0xce54('0x72'):case'phone':_0x403053[_0xce54('0x1c')](_0x95205b+_0xce54('0x73'));break;default:_0x4e15af[_0xce54('0x1c')]('\x22\x22');}}}}else{var _0x2bda86='';if(!_[_0xce54('0x21')](_0x811f6a)){if(!_0xa94508[_0xce54('0x69')](_0x811f6a['id'])){for(var _0x12a82b=0x0;_0x12a82b<_0x51a685[_0x95205b][_0xce54('0x1a')];_0x12a82b++){var _0x25cd90=_[_0xce54('0x6a')](_0x1ca193[_0xce54('0x67')][_0x56023d][_0x51a685[_0x95205b][_0x12a82b]][_0xce54('0x6b')](/"/g,'\x27'));var _0x3716ec=phoneDescriptions[_0xce54('0x68')](_0x259caa=>_0x259caa['itemTypeId']===_0x811f6a['id']);if(!_[_0xce54('0x21')](_0x3716ec)){var _0x4a8bea=_[_0xce54('0x6a')](_0x1ca193['data'][_0x56023d][_0x51a685[_0x3716ec[_0xce54('0x74')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xce54('0x21')](_0x4a8bea))_0x25cd90=_0x25cd90+'§'+_0x4a8bea;}if(_0x2bda86=='')_0x2bda86=_0x25cd90;else _0x2bda86+='|'+_0x25cd90;}_0x306092['push'](_0x811f6a['id']+':'+_0x2bda86);_0xa94508[_0x811f6a['id']]=0x1;}}}}if(hasAdditionalPhones){_0x4e15af[_0xce54('0x1c')]('\x22'+_0x306092[_0xce54('0x39')](';')+'\x22');}if(_0x403053[_0xce54('0x1a')]){handleError(_0x1ca193[_0xce54('0x67')][_0x56023d],{'code':_0xce54('0x75'),'message':_0x403053[_0xce54('0x39')]()});}else{fs[_0xce54('0x76')](_0x927424,_0x4e15af[_0xce54('0x39')]()+'\x0a');}_0x4e15af=[];}if(!(stats['rows']%0xc8)){socket[_0xce54('0x77')](_0xce54('0x78')+_0x3d78ab,stats);stats[_0xce54('0x57')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x67afb9['abort']();}}catch(_0xc219b0){handleError(_0x1ca193[_0xce54('0x67')][_0x56023d],{'code':_0xce54('0x79'),'message':_0xc219b0[_0xce54('0x20')]});logger[_0xce54('0x1f')]('step',_0xc219b0['message']);}},'complete':function(){try{var _0x28a28a=[];var _0x227c7f=tempTableName;_0x28a28a[_0xce54('0x1c')](_0xce54('0x7a')+_0x227c7f+_0xce54('0x7b'));logger[_0xce54('0x54')](_0xce54('0x7c'),contactItemTypes[_0xce54('0x1a')]);var _0x49afe0=util[_0xce54('0xe')](_0xce54('0x7d'),_0x927424,_0x227c7f,_0x1741e8,_0x450484[_0xce54('0x44')],_0x450484[_0xce54('0x50')]||null,NOW,NOW);if(_['isNil'](_0x51a685[_0xce54('0x31')])){_0x49afe0+=_0xce54('0x7e');}_0x28a28a[_0xce54('0x1c')](_0x49afe0);BPromise[_0xce54('0x7f')](_0x28a28a,handleQuery)[_0xce54('0x1d')](function(_0x21d1f5){BPromise['all']([handleAdditionalPhones()])[_0xce54('0x1d')](function(){_0x28a28a=[];for(var _0x1db5fc=0x0;_0x1db5fc\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','query','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','catch','error','split','all','length','filter','CmContactHasItem','then','update','updated','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x915f,0xf4));var _0xf915=function(_0x4a4fb4,_0xea22a8){_0x4a4fb4=_0x4a4fb4-0x0;var _0x5ac27d=_0x915f[_0x4a4fb4];return _0x5ac27d;};'use strict';var fs=require('fs');var path=require(_0xf915('0x0'));var _=require(_0xf915('0x1'));var Papa=require(_0xf915('0x2'));var util=require(_0xf915('0x3'));var BPromise=require(_0xf915('0x4'));var moment=require('moment');var squel=require(_0xf915('0x5'));var Redis=require(_0xf915('0x6'));var db=require(_0xf915('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0xf915('0x8'))('import');config[_0xf915('0x9')]=_['defaults'](config[_0xf915('0x9')],{'host':_0xf915('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf915('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()[_0xf915('0xb')](_0xf915('0xc'));var tempTableName=_0xf915('0xd')+moment()['format'](_0xf915('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x896d5b){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))*$/[_0xf915('0xf')](_0x896d5b);}function selectNotIn(_0x57b2d2,_0x51f805,_0x208e2d,_0x2f5a2c,_0x4ce990){return squel[_0xf915('0x10')]()[_0xf915('0x11')](_0xf915('0x12'))[_0xf915('0x13')](_0x2f5a2c)[_0xf915('0x14')](_0x51f805,null,_0x51f805+_0xf915('0x15')+_0x2f5a2c+'.'+_0x208e2d)[_0xf915('0x16')](_0x2f5a2c+'.'+_0x208e2d+'\x20=\x20'+_0x57b2d2+'.'+_0x208e2d)[_0xf915('0x16')](_0x51f805+_0xf915('0x17')+_0x4ce990['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3a4c04,_0x19c603){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0xf915('0x18')](_0xf915('0x19')+tempTableName)[_0xf915('0x1a')](function(_0x571996){if(_0x571996!==null){var _0x390655=[];for(var _0x576fc6=0x0;_0x576fc6<_0x571996['length'];_0x576fc6++){var _0x5f4003=_0x571996[_0x576fc6];if(!_[_0xf915('0x1b')](_0x5f4003[_0xf915('0x12')])){if(!_[_0xf915('0x1b')](_0x5f4003[_0xf915('0x1c')]))_0x390655[_0xf915('0x1d')](insertAdditionalPhones(_0x5f4003));promisesContact[_0xf915('0x1d')]({'contact':_0x5f4003});}}}Promise['all'](_0x390655)['then'](function(){_0x3a4c04({'val':0x1});});})[_0xf915('0x1e')](function(_0x381fcd){logger[_0xf915('0x1f')](_0x381fcd['message']);});});}function insertAdditionalPhones(_0x1c1703){return new Promise(function(_0x4a07c5,_0x2977bb){var _0x5e6146=_0x1c1703[_0xf915('0x1c')];if(_[_0xf915('0x1b')](_0x5e6146))_0x2977bb({'val':0x0});else{var _0x31dd28=_0x5e6146[_0xf915('0x20')](';');var _0x594a1f=[];orderBy=0x0;for(var _0x16e29f=0x0;_0x16e29f<_0x31dd28['length'];_0x16e29f++){_0x594a1f[_0xf915('0x1d')](splitAdditionalPhone(_0x1c1703['id'],_0x31dd28[_0x16e29f]));}Promise[_0xf915('0x21')](_0x594a1f)['then'](function(){_0x4a07c5({'val':_0x31dd28[_0xf915('0x22')]});});}});}function splitAdditionalPhone(_0x205120,_0x30119e){return new Promise(function(_0x5af28c,_0x17b035){var _0x5b0cf4=_0x30119e[_0xf915('0x20')](':');var _0x284a37=_0x5b0cf4[0x0];var _0xb39a43=_0x5b0cf4[0x1];if(_0xb39a43!==''){var _0x2bb4b4=_0xb39a43[_0xf915('0x20')]('|');var _0x4d87df=[];for(var _0x14ac59=0x0;_0x14ac59<_0x2bb4b4[_0xf915('0x22')];_0x14ac59++){if(_0x2bb4b4[_0x14ac59]!==''){var _0x16b073=_[_0xf915('0x23')](promisesAdditionalPhones,{'contactId':_0x205120,'phone':_0x2bb4b4[_0x14ac59]});if(_0x16b073[_0xf915('0x22')]==0x0){orderBy++;promisesAdditionalPhones[_0xf915('0x1d')]({'contactId':_0x205120,'contactTypeId':_0x284a37,'phone':_0x2bb4b4[_0x14ac59],'orderBy':orderBy});}}}_0x5af28c({'ok':0x1});}else _0x5af28c({'res':0x0});});}function createAdditionalPhone(_0x440c4a,_0x40dfce,_0x23e57d,_0x1f79fc){var _0x46fbe1='';var _0xd55b9b='';var _0xd0c4ba=_0x23e57d[_0xf915('0x20')]('§');_0x46fbe1=_0xd0c4ba[0x0];if(_0xd0c4ba['length']==0x2)_0xd55b9b=_0xd0c4ba[0x1];return new Promise(function(_0x324ab0,_0x47e950){return db[_0xf915('0x24')]['findOne']({'where':{'CmContactId':_0x440c4a,'item':_0x46fbe1}})[_0xf915('0x25')](function(_0x347a39){if(_0x347a39){return db[_0xf915('0x24')][_0xf915('0x26')]({'ItemTypeId':_0x40dfce,'description':_0xd55b9b,'OrderBy':_0x1f79fc},{'where':{'CmContactId':_0x440c4a,'item':_0x46fbe1}})['then'](function(_0x34bbb1){_0x324ab0({'res':_0xf915('0x27')});});}else{return db[_0xf915('0x24')]['create']({'CmContactId':_0x440c4a,'item':_0x46fbe1,'ItemTypeId':_0x40dfce,'description':_0xd55b9b,'OrderBy':_0x1f79fc,'ItemClass':'PHONE'})[_0xf915('0x25')](function(_0xa0cb2e){_0x324ab0({'res':_0xf915('0x28')});});}});});}function updateContact(_0x38ed87){return new Promise(function(_0x5f18ec,_0x3770c6){var _0x2b7353=_0x38ed87['id'];delete _0x38ed87['id'];return db[_0xf915('0x29')][_0xf915('0x26')](_0x38ed87,{'where':{'id':_0x2b7353}})[_0xf915('0x25')](function(_0x51e81f){updatedRows+=0x1;return db[_0xf915('0x2a')]['update']({'phone':_0x38ed87[_0xf915('0x12')]},{'where':{'ContactId':_0x2b7353}})[_0xf915('0x25')](function(_0x2c04cc){_0x5f18ec({'ret':'OK'});});});});}function insertCmHopper(_0x50a15e,_0x93687c,_0x50afd7,_0x10bcd3,_0x1faf9e){var _0x1f8338=[_0xf915('0x2b'),_0xf915('0x2c'),_0xf915('0x2d'),_0xf915('0x2e'),_0x93687c+'.'+_0x10bcd3,'cm_contacts.createdAt',_0xf915('0x2f'),_0xf915('0x30'),'cm_contacts.UserId','\x22'+_0x1faf9e+'\x22'];return squel[_0xf915('0x31')]()['into'](_0xf915('0x32'))[_0xf915('0x33')]([_0xf915('0x12'),_0xf915('0x34'),_0xf915('0x35'),_0xf915('0x36'),_0x10bcd3,_0xf915('0x37'),_0xf915('0x38'),_0xf915('0x39'),_0xf915('0x3a'),_0xf915('0x3b')],squel[_0xf915('0x10')]()[_0xf915('0x3c')](_0x1f8338)['from'](_0x93687c)[_0xf915('0x14')](_0xf915('0x3d'),null,_0xf915('0x3e')+_0x93687c+'.CmListId')['join'](_0x50afd7,null,_0x50afd7+_0xf915('0x15')+_0x93687c+'.'+_0x10bcd3)['where'](_0x93687c+_0xf915('0x3f'),_0x50a15e)[_0xf915('0x16')](_0xf915('0x40'),NOW)[_0xf915('0x16')](_0xf915('0x41'),selectNotIn(_0x93687c,_0x50afd7,_0x10bcd3,_0xf915('0x32'),[_0xf915('0x42'),_0xf915('0x43')]))['where'](_0xf915('0x41'),selectNotIn(_0x93687c,_0x50afd7,_0x10bcd3,'cm_hopper',[_0xf915('0x42')])))[_0xf915('0x44')]();}function insertCmHopperBlack(_0x147bd4,_0x5c1824,_0x272e0d,_0x4be551){var _0x2a1cd2=[_0xf915('0x2b'),'cm_contacts.id',_0xf915('0x2e'),_0x5c1824+'.'+_0x4be551,_0xf915('0x45'),_0xf915('0x2f')];return squel[_0xf915('0x31')]()[_0xf915('0x46')]('cm_hopper_black')[_0xf915('0x33')]([_0xf915('0x12'),_0xf915('0x35'),_0xf915('0x36'),_0x4be551,_0xf915('0x37'),_0xf915('0x38')],squel[_0xf915('0x10')]()[_0xf915('0x3c')](_0x2a1cd2)[_0xf915('0x13')](_0x5c1824)[_0xf915('0x14')](_0xf915('0x3d'),null,_0xf915('0x3e')+_0x5c1824+_0xf915('0x47'))[_0xf915('0x14')](_0x272e0d,null,_0x272e0d+'.id\x20=\x20'+_0x5c1824+'.'+_0x4be551)['where'](_0x5c1824+_0xf915('0x3f'),_0x147bd4)['where'](_0xf915('0x40'),NOW)[_0xf915('0x16')](_0xf915('0x41'),squel[_0xf915('0x10')]()[_0xf915('0x11')](_0xf915('0x12'))['from'](_0xf915('0x48'))[_0xf915('0x16')]('ListId\x20=\x20?',_0x147bd4)[_0xf915('0x16')](_0x4be551+_0xf915('0x49'),_0x5c1824+'.'+_0x4be551)))[_0xf915('0x44')]();}function insertCmHopperAdditionalPhones(_0x191b1d){var _0x567923=[_0xf915('0x4a'),'cm_contact_has_items.item',_0xf915('0x4b'),_0xf915('0x4c'),'cm_contact_has_items.updatedAt'];return squel[_0xf915('0x31')]()[_0xf915('0x46')](_0xf915('0x4d'))[_0xf915('0x33')]([_0xf915('0x4e'),_0xf915('0x12'),'OrderBy','createdAt',_0xf915('0x38')],squel[_0xf915('0x10')]()[_0xf915('0x3c')](_0x567923)[_0xf915('0x13')](_0xf915('0x32'))['join'](_0xf915('0x3d'),null,_0xf915('0x4f'))['join'](_0xf915('0x50'),null,_0xf915('0x51'))[_0xf915('0x16')](_0xf915('0x52'),_0x191b1d)[_0xf915('0x16')](_0xf915('0x40'),NOW))[_0xf915('0x44')]();}function insertCmContact(_0x5d7942,_0x3c3ab4,_0x1a2c46,_0x5c154a){var _0x119846=_['concat'](_['keys'](_0x5c154a),[_0xf915('0x36'),_0xf915('0x53'),_0xf915('0x37'),_0xf915('0x38')]);return squel[_0xf915('0x31')]()[_0xf915('0x46')](_0xf915('0x3d'))[_0xf915('0x33')](_0x119846,squel[_0xf915('0x10')]()[_0xf915('0x3c')](_0x119846)[_0xf915('0x13')](_0x3c3ab4)['where']('('+_0x1a2c46['join'](',')+_0xf915('0x54'),squel[_0xf915('0x10')]()['fields'](_0x1a2c46)[_0xf915('0x13')](_0xf915('0x3d'))[_0xf915('0x16')](_0xf915('0x55'),_0x5d7942))[_0xf915('0x16')](_0xf915('0x56'),squel['select']()['field'](_0xf915('0x57'),_0xf915('0x58'))[_0xf915('0x13')](_0x3c3ab4)[_0xf915('0x59')](_0x1a2c46[_0xf915('0x14')](','))))[_0xf915('0x44')]();}function handleStop(){logger[_0xf915('0x5a')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x27c20d){logger[_0xf915('0x1f')](_0x27c20d[_0xf915('0x5b')]);process[_0xf915('0x5c')](0x1);}function handleError(_0x23c992,_0x53dc3f){stats['errors'][_0xf915('0x1d')]({'name':_0x53dc3f[_0xf915('0x5d')],'message':_0x53dc3f[_0xf915('0x5b')],'row':_0x23c992});}function handleQuery(_0x5e31ed){logger['info'](_0x5e31ed);return db[_0xf915('0x5e')]['query'](_0x5e31ed)['spread'](function(_0xcb1293){results['push'](_0xcb1293);})[_0xf915('0x1e')](function(_0x4f8577){logger[_0xf915('0x1f')](_0x4f8577[_0xf915('0x5b')]);});}function main(_0x17c0b7,_0x1a2ef5,_0x38406a,_0x19fbd9){logger[_0xf915('0x5a')](_0xf915('0x5f'),_0x17c0b7,JSON[_0xf915('0x60')](_0x1a2ef5));process[_0xf915('0x61')](_0xf915('0x62'));var _0x192677=_0x1a2ef5[_0xf915('0x63')];var _0x4513a1=_[_0xf915('0x64')](_0x192677);var _0x172ace=_0x1a2ef5['socket_timestamp'];var _0x2a978a=path[_0xf915('0x14')](config[_0xf915('0x65')],_0xf915('0x66'),_0x172ace+_0xf915('0x67'));logger['info'](_0xf915('0x68'),_0x1a2ef5);db[_0xf915('0x69')][_0xf915('0x6a')]({'raw':!![],'attributes':['id',_0xf915('0x6b')]})['then'](function(_0x1a86ce){for(var _0x300d10=0x0;_0x300d10<_0x1a86ce[_0xf915('0x22')];_0x300d10++){if(_0x1a86ce[_0x300d10][_0xf915('0x6b')]in _0x192677){contactItemTypes[_0xf915('0x1d')](_0x1a86ce[_0x300d10]);delete _0x4513a1[_0x1a86ce[_0x300d10][_0xf915('0x6b')]];hasAdditionalPhones=!![];}for(var _0x590516 in _0x192677){if(_0x1a86ce[_0x300d10][_0xf915('0x6b')]+'_description'===_0x590516){phoneDescriptions[_0xf915('0x1d')]({'itemTypeId':_0x1a86ce[_0x300d10]['id'],'description':_0x590516});delete _0x4513a1[_0x590516];}}}if(hasAdditionalPhones)_0x4513a1[_0xf915('0x1c')]='';var _0x4ccb7b=_[_0xf915('0x6c')](_0x4513a1)[_0xf915('0x14')]();logger['info'](_0xf915('0x6d'),_0x4ccb7b);fs[_0xf915('0x6e')](_0x2a978a,_0x4ccb7b+'\x0a');Papa['parse'](fs[_0xf915('0x6f')](_0x17c0b7),{'header':!![],'skipEmptyLines':!![],'step':function(_0x257f15,_0x41ec5f){try{for(var _0x366940=0x0,_0x2f0fef=[];_0x366940<_0x257f15['data'][_0xf915('0x22')];_0x366940++){stats[_0xf915('0x70')]+=0x1;if(_0x257f15['errors'][_0x366940]){handleError(_0x257f15[_0xf915('0x71')][_0x366940],_0x257f15[_0xf915('0x72')][_0x366940]);}else{var _0x30c998=[];var _0x849451=[];var _0x148dc7={};for(var _0x26939c in _0x192677){let _0x37ed86=contactItemTypes[_0xf915('0x73')](_0x3d4343=>_0x3d4343[_0xf915('0x6b')]===_0x26939c);let _0xf633af=contactItemTypes[_0xf915('0x73')](_0x4e2333=>_0x4e2333[_0xf915('0x6b')]+'_description'===_0x26939c);if(_['isNil'](_0x37ed86)&&_['isNil'](_0xf633af)){if(_0x192677[_0xf915('0x74')](_0x26939c)){if(_0x257f15['data'][_0x366940][_0x192677[_0x26939c]]){var _0x5ede53=_['trim'](_0x257f15['data'][_0x366940][_0x192677[_0x26939c]][_0xf915('0x75')](/"/g,'\x27'));switch(_0x26939c){case _0xf915('0x34'):var _0x22a9fd=moment(_0x5ede53,_0xf915('0xc'),!![]);if(_0x22a9fd['isValid']()){_0x2f0fef[_0xf915('0x1d')]('\x22'+_0x5ede53+'\x22');}else{_0x30c998[_0xf915('0x1d')](_0xf915('0x76'));}break;case'priority':var _0x597db2=parseInt(_0x5ede53);_0x5ede53=_['isNaN'](_0x597db2)||_0x597db2<0x0||_0x597db2>0x4?_0x19fbd9?0x3:0x2:_0x597db2;_0x2f0fef[_0xf915('0x1d')]('\x22'+_0x5ede53+'\x22');break;case _0xf915('0x3a'):var _0x2b3b12=parseInt(_0x5ede53);if(_[_0xf915('0x77')](_0x2b3b12)&&_[_0xf915('0x78')](_0x38406a,_0x2b3b12)){_0x2f0fef['push']('\x22'+_0x2b3b12+'\x22');}else{_0x30c998[_0xf915('0x1d')](_0xf915('0x79'));}break;case _0xf915('0x7a'):if(isEmail(_0x5ede53)){_0x2f0fef[_0xf915('0x1d')]('\x22'+_0x5ede53+'\x22');}else{_0x30c998[_0xf915('0x1d')](_0xf915('0x7b'));}break;case _0xf915('0x7c'):var _0x28b284=moment(_0x5ede53,_0xf915('0x7d'),!![]);if(_0x28b284[_0xf915('0x7e')]()){_0x2f0fef['push']('\x22'+_0x5ede53+'\x22');}else{_0x30c998['push'](_0xf915('0x7f'));}break;default:_0x2f0fef[_0xf915('0x1d')]('\x22'+_0x5ede53+'\x22');}}else{switch(_0x26939c){case'firstName':case'phone':_0x30c998[_0xf915('0x1d')](_0x26939c+_0xf915('0x80'));break;default:_0x2f0fef[_0xf915('0x1d')]('\x22\x22');}}}}else{var _0x2346d9='';if(!_['isNil'](_0x37ed86)){if(!_0x148dc7['hasOwnProperty'](_0x37ed86['id'])){for(var _0xecf8a4=0x0;_0xecf8a4<_0x192677[_0x26939c][_0xf915('0x22')];_0xecf8a4++){var _0x5ede53=_[_0xf915('0x81')](_0x257f15[_0xf915('0x71')][_0x366940][_0x192677[_0x26939c][_0xecf8a4]][_0xf915('0x75')](/"/g,'\x27'));var _0x2b7ff6=phoneDescriptions[_0xf915('0x73')](_0x3c1763=>_0x3c1763['itemTypeId']===_0x37ed86['id']);if(!_['isNil'](_0x2b7ff6)){var _0x3972be=_[_0xf915('0x81')](_0x257f15[_0xf915('0x71')][_0x366940][_0x192677[_0x2b7ff6['description']][0x0]][_0xf915('0x75')](/"/g,'\x27'));if(!_[_0xf915('0x1b')](_0x3972be))_0x5ede53=_0x5ede53+'§'+_0x3972be;}if(_0x2346d9=='')_0x2346d9=_0x5ede53;else _0x2346d9+='|'+_0x5ede53;}_0x849451[_0xf915('0x1d')](_0x37ed86['id']+':'+_0x2346d9);_0x148dc7[_0x37ed86['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2f0fef[_0xf915('0x1d')]('\x22'+_0x849451[_0xf915('0x14')](';')+'\x22');}if(_0x30c998['length']){handleError(_0x257f15[_0xf915('0x71')][_0x366940],{'code':_0xf915('0x82'),'message':_0x30c998[_0xf915('0x14')]()});}else{fs[_0xf915('0x83')](_0x2a978a,_0x2f0fef['join']()+'\x0a');}_0x2f0fef=[];}if(!(stats['rows']%0xc8)){socket[_0xf915('0x84')](_0xf915('0x85')+_0x172ace,stats);stats[_0xf915('0x72')]=[];}}if(stopped){logger[_0xf915('0x5a')](_0xf915('0x86'));_0x41ec5f['abort']();}}catch(_0x1429fb){handleError(_0x257f15['data'][_0x366940],{'code':_0xf915('0x87'),'message':_0x1429fb[_0xf915('0x5b')]});logger[_0xf915('0x1f')](_0xf915('0x88'),_0x1429fb[_0xf915('0x5b')]);}},'complete':function(){try{var _0x5348aa=[];var _0x561f03=tempTableName;_0x5348aa[_0xf915('0x1d')](_0xf915('0x89')+_0x561f03+'\x20LIKE\x20cm_contacts;');logger['info']('CIS\x20len',contactItemTypes[_0xf915('0x22')]);var _0x557c14=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x2a978a,_0x561f03,_0x4ccb7b,_0x1a2ef5[_0xf915('0x36')],_0x1a2ef5['CompanyId']||null,NOW,NOW);if(_[_0xf915('0x1b')](_0x192677[_0xf915('0x34')])){_0x557c14+=_0xf915('0x8a');}_0x5348aa['push'](_0x557c14);BPromise['each'](_0x5348aa,handleQuery)[_0xf915('0x25')](function(_0x570f2e){BPromise[_0xf915('0x21')]([handleAdditionalPhones()])[_0xf915('0x25')](function(){_0x5348aa=[];for(var _0x563fc0=0x0;_0x563fc0\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.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgDirection','i.subject','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','unreadMessages','getSelectedTags','isEmpty','t.id\x20IN\x20?','SELECT','exports','lodash','updateInteraction','getAccountFK','role','search','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','select','u.fullname','ui.','left_join','length','where','map','getInteractionsTables','interactions','cm_contacts','users','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','isEmail','mail','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','buildExpression','type','default','text','value','end','read','and','Contact','operator','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','tags','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','user','body','plainBody','some','compact','\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','then','fields','filter','capitalize'];(function(_0x3777ba,_0x2e3a47){var _0x4d04a7=function(_0x3e25b0){while(--_0x3e25b0){_0x3777ba['push'](_0x3777ba['shift']());}};_0x4d04a7(++_0x2e3a47);}(_0xf4eb,0xec));var _0xbf4e=function(_0x23d492,_0x18ef3d){_0x23d492=_0x23d492-0x0;var _0x55d076=_0xf4eb[_0x23d492];return _0x55d076;};'use strict';var _=require(_0xbf4e('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require('../parsers/qs');var updateInteraction=require('./update-interaction')[_0xbf4e('0x1')];var utils=require('./utils');var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x2e3070,_0x1c7606,_0x32d1d7){var _0x18c665=![];var _0xa4dcf5=utils[_0xbf4e('0x2')](_0x2e3070);if(_0x1c7606[_0xbf4e('0x3')]==='agent'&&!_0x32d1d7[_0xbf4e('0x4')]&&!_0x32d1d7[_0xa4dcf5]){_0x18c665=!![];}return _0x18c665;}function getTagsQuery(){return squel['select']()['field']('id')[_0xbf4e('0x5')](_0xbf4e('0x6'))[_0xbf4e('0x5')](_0xbf4e('0x7'))[_0xbf4e('0x8')](_0xbf4e('0x9'));}function getUsersQuery(_0x177342,_0x580a26){var _0x4d9a07=utils[_0xbf4e('0xa')](_0x177342);var _0x5a8397=_0xbf4e('0xb')+_0x177342+_0xbf4e('0xc');var _0x54a96e=squel[_0xbf4e('0xd')]()['field']('u.id')[_0xbf4e('0x5')](_0xbf4e('0xe'))[_0xbf4e('0x5')](_0xbf4e('0xf')+_0x4d9a07)[_0xbf4e('0x8')](_0x5a8397,'ui')[_0xbf4e('0x10')]('users','u','u.id\x20=\x20ui.UserId');if(_0x580a26[_0xbf4e('0x11')]>0x0){_0x54a96e[_0xbf4e('0x12')](_0xbf4e('0xf')+_0x4d9a07+'\x20IN\x20?',_[_0xbf4e('0x13')](_0x580a26,'id'));}return _0x54a96e;}function getInteractionsQuery(_0x2c292c){var _0x912fc0=utils[_0xbf4e('0x14')](_0x2c292c);var _0x5a631e=utils[_0xbf4e('0x2')](_0x2c292c);var _0x577c27=utils['getInteractionFK'](_0x2c292c);return squel['select']()['from'](_0x912fc0[_0xbf4e('0x15')],'i')[_0xbf4e('0x10')](_0xbf4e('0x16'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xbf4e('0x17'),'o',_0xbf4e('0x18'))[_0xbf4e('0x10')](_0x912fc0[_0xbf4e('0x19')],'a',_0xbf4e('0x1a')+_0x5a631e)[_0xbf4e('0x10')](_0x912fc0[_0xbf4e('0x1b')],'me',_0xbf4e('0x1c')+_0x577c27+_0xbf4e('0x1d'))[_0xbf4e('0x10')](_0x912fc0[_0xbf4e('0x1e')],'it','it.'+_0x577c27+_0xbf4e('0x1d'))[_0xbf4e('0x10')]('tools_tags','t',_0xbf4e('0x1f'));}function getSqlClauses(){var _0x30994d={'body':squel[_0xbf4e('0x20')](),'contact':squel[_0xbf4e('0x20')](),'default':squel[_0xbf4e('0x20')](),'fields':squel['expr'](),'filter':squel[_0xbf4e('0x20')](),'read':squel[_0xbf4e('0x20')](),'tags':{'clause':squel[_0xbf4e('0x20')](),'ids':null},'user':squel['expr']()};return _0x30994d;}function parseTagParameter(_0x2fb490){var _0x5e08b1=squel['expr']();if(_0x2fb490){var _0x2bfccf=utils['getSelectedTags'](_0x2fb490);_0x2bfccf[_0xbf4e('0x21')](function(_0x315df3){_0x5e08b1['or'](_0xbf4e('0x22'),'%,'+_0x315df3+',%');});}return _0x5e08b1;}function parseReadParameter(_0x41f918){var _0x5c912f='';if(_0x41f918){_0x5c912f=_0xbf4e('0x23');if(_0x41f918==='1'){_0x5c912f=_0x5c912f[_0xbf4e('0x24')](_0xbf4e('0x25'),'=');}else{_0x5c912f=_0x5c912f['replace'](_0xbf4e('0x25'),'>');}}return _0x5c912f;}function parseSearchFilter(_0x590c85,_0x1dfa81){var _0x1421e1=squel[_0xbf4e('0x20')]();if(_0x1dfa81){var _0x498dbd=_0x1dfa81[_0xbf4e('0x24')]('\x5c','\x5c\x5c')[_0xbf4e('0x24')](/'/g,'\x27\x27');if(qs[_0xbf4e('0x26')](_0x498dbd)){_0x1421e1['or'](_0xbf4e('0x27'),_0x498dbd+'%');if([_0xbf4e('0x28'),_0xbf4e('0x29')]['includes'](_0x590c85)){_0x1421e1['or'](_0xbf4e('0x2a'),_0x498dbd+'%');}else if(_0x590c85===_0xbf4e('0x2b')){_0x1421e1['or']('i.fax\x20LIKE\x20?',_0x498dbd+'%');}else if(_0x590c85===_0xbf4e('0x2c')){_0x1421e1['or'](_0xbf4e('0x2d'),_0x498dbd+'%');}}else if(_0x590c85==='mail'&&qs[_0xbf4e('0x2e')](_0x498dbd)){_0x1421e1['or']('c.email\x20LIKE\x20?',_0x498dbd+'%');}else{if(_0x590c85===_0xbf4e('0x2f')){_0x1421e1['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbf4e('0x30')](_0x498dbd))['or'](_0xbf4e('0x31'),qs[_0xbf4e('0x30')](_0x498dbd));}else{if(_0x590c85!=='fax'){_0x1421e1['or'](_0xbf4e('0x32'),qs[_0xbf4e('0x30')](_0x498dbd));}_0x1421e1['or'](_0xbf4e('0x33'),_0x498dbd+'%');}}}return _0x1421e1;}function parseAdvancedSearchFilter(_0x29d6aa,_0xb93672){var _0x477873=getSqlClauses();var _0x5b8440=as[_0xbf4e('0x34')](_0x29d6aa);var _0x3dbb2b=_0x5b8440[_0xbf4e('0x35')];for(var _0x3bba55=0x0;_0x3bba55<_0x5b8440[_0xbf4e('0x36')]['length'];_0x3bba55++){var _0x4864bd=_0x5b8440['conditions'][_0x3bba55];var _0x4be59a='i';var _0x429c07=_[_0xbf4e('0x37')](_0xb93672,[_0xbf4e('0x6'),_0x4864bd[_0xbf4e('0x5')]]);if(_0x429c07){var _0x22ddde=as[_0xbf4e('0x38')](_0x4be59a,_0x429c07[_0xbf4e('0x39')],_0x4864bd);_0x477873[_0xbf4e('0x3a')][_0x3dbb2b](_0x22ddde[_0xbf4e('0x3b')],_0x22ddde['value']['start'],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x3d')]);}else{switch(_0x4864bd[_0xbf4e('0x5')]){case'unreadMessages':var _0x3f46f1=parseReadParameter(_0x4864bd['value']);_0x477873[_0xbf4e('0x3e')][_0xbf4e('0x3f')](_0x3f46f1);break;case _0xbf4e('0x40'):if(_0x4864bd[_0xbf4e('0x41')]==='$substring'){if(_0x4864bd[_0xbf4e('0x3c')][_0xbf4e('0x42')]('\x20')[_0xbf4e('0x11')]>0x1){_0x477873[_0xbf4e('0x43')][_0x3dbb2b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xbf4e('0x30')](_0x4864bd[_0xbf4e('0x3c')]),null);}else{var _0x148d94='%'+_0x4864bd[_0xbf4e('0x3c')]+'%';_0x477873[_0xbf4e('0x43')][_0x3dbb2b](_0xbf4e('0x44'),_0x148d94,_0x148d94,_0x148d94);}}else{_0x429c07=_[_0xbf4e('0x37')](_0xb93672,['name',_0xbf4e('0x45')]);_0x4864bd[_0xbf4e('0x5')]='ContactId';_0x22ddde=as['buildExpression'](_0x4be59a,_0x429c07[_0xbf4e('0x39')],_0x4864bd);_0x477873[_0xbf4e('0x43')][_0x3dbb2b](_0x22ddde['text'],_0x22ddde['value'][_0xbf4e('0x46')],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x3d')]);}break;case _0xbf4e('0x47'):var _0x2ee1b4=_0x4864bd[_0xbf4e('0x3c')]['split'](',')[_0xbf4e('0x13')](function(_0x7bd91){return Number(_0x7bd91);});var _0x4d31b6=parseTagParameter(_0x2ee1b4);_0x477873['tags']['clause']['and'](_0x4d31b6);_0x477873[_0xbf4e('0x48')]['ids']=_0x2ee1b4;break;case _0xbf4e('0x49'):if(_0x4864bd[_0xbf4e('0x41')]==='$substring'){_0x477873['user'][_0x3dbb2b](_0xbf4e('0x4a'),'%'+_0x4864bd[_0xbf4e('0x3c')]+'%',null);}else{_0x429c07=_[_0xbf4e('0x37')](_0xb93672,[_0xbf4e('0x6'),_0xbf4e('0x4b')]);_0x4864bd['field']=_0xbf4e('0x4b');_0x22ddde=as[_0xbf4e('0x38')](_0x4be59a,_0x429c07[_0xbf4e('0x39')],_0x4864bd);_0x477873[_0xbf4e('0x4c')][_0x3dbb2b](_0x22ddde[_0xbf4e('0x3b')],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x46')],_0x22ddde[_0xbf4e('0x3c')]['end']);}break;case _0xbf4e('0x4d'):case _0xbf4e('0x4e'):_0x22ddde=as[_0xbf4e('0x38')]('me',null,_0x4864bd);_0x477873[_0xbf4e('0x4d')][_0x3dbb2b](_0x22ddde[_0xbf4e('0x3b')],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x46')],_0x22ddde[_0xbf4e('0x3c')][_0xbf4e('0x3d')]);break;}}}return _0x477873;}function parseModelFields(_0x3447ab,_0x2fdba9,_0x6fd78d){var _0x370d4c=utils[_0xbf4e('0x2')](_0x3447ab);var _0x24fb7d=squel[_0xbf4e('0x20')]();var _0x10bc23=_(_0x2fdba9)['keys']()[_0xbf4e('0x13')](function(_0x17a7be){return _[_0xbf4e('0x4f')](_0x6fd78d,['name',_0x17a7be])?_0x17a7be:undefined;})[_0xbf4e('0x50')]()['value']();if(_0x10bc23['length']>0x0){_0x10bc23[_0xbf4e('0x21')](function(_0x200393){if(_0x200393===_0x370d4c){_0x24fb7d['and']('i.'+_0x370d4c+_0xbf4e('0x51'),[][_0xbf4e('0x52')](_0x2fdba9[_0x200393]));}else if(_0x200393===_0xbf4e('0x53')){var _0xa7af68=JSON[_0xbf4e('0x54')](_0x2fdba9[_0x200393])[_0xbf4e('0x55')];var _0x419969=JSON[_0xbf4e('0x54')](_0x2fdba9[_0x200393])[_0xbf4e('0x56')];_0x24fb7d[_0xbf4e('0x3f')](_0xbf4e('0x57'),_0xa7af68,_0x419969);}else{if(_0x2fdba9[_0x200393]==='null'){_0x24fb7d['and']('i.'+_0x200393+_0xbf4e('0x58'));}else{_0x24fb7d[_0xbf4e('0x3f')]('i.'+_0x200393+_0xbf4e('0x59'),_0x2fdba9[_0x200393]);}}});}return _0x24fb7d;}function parseQueryParameters(_0x586f5d,_0x339ce6,_0x3924dc){var _0x481c06=getSqlClauses();return Promise['resolve']()[_0xbf4e('0x5a')](function(){return parseModelFields(_0x586f5d,_0x339ce6,_0x3924dc);})['then'](function(_0x510548){_0x481c06[_0xbf4e('0x5b')][_0xbf4e('0x3f')](_0x510548);return parseReadParameter(_0x339ce6[_0xbf4e('0x3e')]);})[_0xbf4e('0x5a')](function(_0x6ff233){_0x481c06['read'][_0xbf4e('0x3f')](_0x6ff233);return parseTagParameter(_0x339ce6['tag']);})[_0xbf4e('0x5a')](function(_0x53875e){_0x481c06[_0xbf4e('0x48')]['clause'][_0xbf4e('0x3f')](_0x53875e);return parseSearchFilter(_0x586f5d,_0x339ce6[_0xbf4e('0x5c')]);})[_0xbf4e('0x5a')](function(_0x16592f){_0x481c06[_0xbf4e('0x5c')]=_0x16592f;return _0x481c06;});}function checkAccountsRestrictions(_0x52dfc4,_0x55a17d,_0x5a0f4a){var _0x52ea6e=utils[_0xbf4e('0x2')](_0x52dfc4);var _0x453411='get'+_[_0xbf4e('0x5d')](_0x52dfc4)+(_0x52dfc4===_0xbf4e('0x5e')?_0xbf4e('0x5f'):_0xbf4e('0x60'));var _0x17c2e1=squel[_0xbf4e('0x20')]();return Promise[_0xbf4e('0x61')]()['then'](function(){if(_0x5a0f4a[_0xbf4e('0x4')]&&_0x55a17d[_0xbf4e('0x3')]===_0xbf4e('0x62')){return _0x55a17d[_0x453411]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x56338e){if(_0x56338e){if(_0x56338e[_0xbf4e('0x11')]===0x0){_0x17c2e1[_0xbf4e('0x3f')]('i.'+_0x52ea6e+_0xbf4e('0x58'));}else{_0x17c2e1['and']('i.'+_0x52ea6e+_0xbf4e('0x51'),_[_0xbf4e('0x13')](_0x56338e,'id'));}}else if(!_0x5a0f4a[_0x52ea6e]){_0x17c2e1[_0xbf4e('0x3f')]('i.'+_0x52ea6e+_0xbf4e('0x63'));}})[_0xbf4e('0x5a')](function(){return _0x17c2e1;});}function getClosedOrderClause(_0x5532df,_0x35ce41){var _0x3ee848='';var _0x238a99=[_0xbf4e('0x64'),_0xbf4e('0x65'),_0xbf4e('0x66')];if(_0x5532df==='mail'){_0x238a99[_0xbf4e('0x67')]('i.substatus');}if(_0x35ce41[_0xbf4e('0x68')]==='0'&&_0x5532df===_0xbf4e('0x2f')){_0x3ee848=_0xbf4e('0x69');}else{if(_0x35ce41[_0xbf4e('0x68')]==='1'){_0x238a99[_0xbf4e('0x6a')]();}_0x3ee848=_0xbf4e('0x6b')+_0x238a99[_0xbf4e('0x6c')](',\x20')+')';}return _0x3ee848;}function getFilteredInteractions(_0x1149c2,_0x4ea377,_0x1aeedd,_0x325d09){var _0x22d5e1=utils[_0xbf4e('0xa')](_0x1149c2);var _0x1c0ecb=_['capitalize'](_0x1149c2)+_0xbf4e('0x6d');var _0x753f25=[];var _0x405bec=getTagsQuery();var _0x1770ca={'type':db[_0xbf4e('0x6e')][_0xbf4e('0x6f')]['SELECT'],'raw':!![]};var _0x2246a2=[];var _0x59ea50=[];return db[_0xbf4e('0x70')][_0xbf4e('0x71')](_0x405bec[_0xbf4e('0x72')](),_0x1770ca)[_0xbf4e('0x5a')](function(_0x4bff77){_0x753f25=_[_0xbf4e('0x73')](_0x4bff77,'id');_0x1770ca=_['merge'](_0x1770ca,{'model':db[_0x1c0ecb],'mapToModel':!![],'nest':!![]});if(_0x1aeedd['fields']){_0x325d09[_0xbf4e('0x74')][_0xbf4e('0x21')](function(_0x3a00ca){_0x4ea377['field']('i.'+_0x3a00ca);});}else{_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x75'),'unreadMessages');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x76'),_0xbf4e('0x77'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x78'),_0xbf4e('0x79'));if(_0x1149c2===_0xbf4e('0x2f')){_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7a'),'Account.email');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7b'),_0xbf4e('0x7c'));_0x4ea377[_0xbf4e('0x5')]('i.id');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7d'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7e'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x7f'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x80'));_0x4ea377[_0xbf4e('0x5')]('i.attach');_0x4ea377[_0xbf4e('0x5')]('i.lastMsgAt');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x81'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x82'));_0x4ea377[_0xbf4e('0x5')]('i.disposition');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x65'));_0x4ea377[_0xbf4e('0x5')]('i.thirdDisposition');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x69'));_0x4ea377[_0xbf4e('0x5')]('i.to');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x83'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x84'));_0x4ea377[_0xbf4e('0x5')]('i.UserId');}else if(_0x1149c2===_0xbf4e('0x2c')){_0x4ea377['field'](_0xbf4e('0x85'),'contactName');}else{_0x4ea377[_0xbf4e('0x5')]('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',_0xbf4e('0x7c'));}if(_0x1149c2!=='mail'){_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x86'));}_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x87'),_0xbf4e('0x88'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x89'),'Contact.lastName');_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x8a'),_0xbf4e('0x8b'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x8c'),_0xbf4e('0x8d'));_0x4ea377['field'](_0xbf4e('0x8e'),_0xbf4e('0x8f'));_0x4ea377['field'](_0xbf4e('0x90'),_0xbf4e('0x91'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x92'),_0xbf4e('0x93'));_0x4ea377[_0xbf4e('0x5')](_0xbf4e('0x94'),_0xbf4e('0x95'));_0x4ea377[_0xbf4e('0x5')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbf4e('0x96'));}if(_0x325d09[_0xbf4e('0x97')]){_0x4ea377[_0xbf4e('0x97')](_0x325d09['limit']);}if(_0x325d09[_0xbf4e('0x98')]){_0x4ea377[_0xbf4e('0x98')](_0x325d09['offset']);}return db[_0xbf4e('0x70')][_0xbf4e('0x71')](_0x4ea377[_0xbf4e('0x72')](),_0x1770ca);})[_0xbf4e('0x5a')](function(_0x15d424){_0x2246a2=_0x15d424;var _0x1cc939=getUsersQuery(_0x1149c2,_0x2246a2);return db[_0xbf4e('0x70')][_0xbf4e('0x71')](_0x1cc939[_0xbf4e('0x72')](),_0x1770ca);})[_0xbf4e('0x5a')](function(_0x55bc7c){_0x59ea50=_['groupBy'](_0x55bc7c,_0x22d5e1);if(_0x1149c2===_0xbf4e('0x2f')){return db[_0xbf4e('0x99')][_0xbf4e('0x9a')]({'attributes':[_0xbf4e('0x9b')],'raw':!![]});}})['then'](function(_0x19108b){var _0x30e5c1=_0x19108b?_0x19108b[_0xbf4e('0x9b')]:undefined;var _0x99d48d=_0x2246a2[_0xbf4e('0x13')](function(_0xf27015){return updateInteraction(_0xf27015,_0x753f25,_0x59ea50,_0x30e5c1);});return Promise[_0xbf4e('0x9c')](_0x99d48d);});}function countFilteredInteractions(_0x4af65a,_0x34b766){var _0x54d5ac=_0x4af65a[_0xbf4e('0x9d')]();_0x54d5ac[_0xbf4e('0x5')](_0xbf4e('0x9e'));_0x54d5ac[_0xbf4e('0x5')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbf4e('0x9f'));var _0x25ce6d=utils[_0xbf4e('0xa0')](_0x34b766);if(!_[_0xbf4e('0xa1')](_0x25ce6d)){_0x54d5ac[_0xbf4e('0x12')](_0xbf4e('0xa2'),_0x25ce6d);}var _0x2992b4={'type':db['Sequelize']['QueryTypes'][_0xbf4e('0xa3')],'raw':!![]};return db[_0xbf4e('0x70')][_0xbf4e('0x71')](_0x54d5ac[_0xbf4e('0x72')](),_0x2992b4);}module[_0xbf4e('0xa4')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x780f=['parseSearch','sqlOperator','conditions','find','name','buildExpression','type','default','text','start','value','end','unreadMessages','read','and','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','tags','ids','User','UserId','user','plainBody','body','keys','compact','forEach','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','tag','clause','filter','get','chat','Websites','\x20IS\x20NOT\x20NULL','i.secondDisposition','i.disposition','unshift','i.substatus','closed','join','capitalize','Interaction','Sequelize','QueryTypes','query','toString','keyBy','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.attach','i.lastMsgAt','i.subject','i.thirdDisposition','i.to','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','../../mysqldb','role','agent','search','select','field','color','from','tools_tags','user_has_','_interactions','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','getAccountFK','getInteractionFK','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','accounts','a.id\x20=\x20i.','me.','interactionsTags','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x5c2067,_0x5aae1a){var _0x445fea=function(_0x3bf06b){while(--_0x3bf06b){_0x5c2067['push'](_0x5c2067['shift']());}};_0x445fea(++_0x5aae1a);}(_0x780f,0x6c));var _0xf780=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0x780f[_0x48ec91];return _0x22766c;};'use strict';var _=require(_0xf780('0x0'));var squel=require(_0xf780('0x1'));var as=require(_0xf780('0x2'));var qs=require(_0xf780('0x3'));var updateInteraction=require(_0xf780('0x4'))['updateInteraction'];var utils=require('./utils');var db=require(_0xf780('0x5'))['db'];function skipInteractionsQuery(_0x26ed87,_0x1a22c0,_0x100bb2){var _0x4af209=![];var _0x37b0a2=utils['getAccountFK'](_0x26ed87);if(_0x1a22c0[_0xf780('0x6')]===_0xf780('0x7')&&!_0x100bb2[_0xf780('0x8')]&&!_0x100bb2[_0x37b0a2]){_0x4af209=!![];}return _0x4af209;}function getTagsQuery(){return squel[_0xf780('0x9')]()[_0xf780('0xa')]('id')[_0xf780('0xa')]('name')[_0xf780('0xa')](_0xf780('0xb'))[_0xf780('0xc')](_0xf780('0xd'));}function getUsersQuery(_0x343856,_0x2d597c){var _0x491ab5=utils['getInteractionFK'](_0x343856);var _0x4b95fd=_0xf780('0xe')+_0x343856+_0xf780('0xf');var _0x16d4c9=squel[_0xf780('0x9')]()['field'](_0xf780('0x10'))[_0xf780('0xa')](_0xf780('0x11'))[_0xf780('0xa')]('ui.'+_0x491ab5)[_0xf780('0xc')](_0x4b95fd,'ui')['left_join'](_0xf780('0x12'),'u',_0xf780('0x13'));if(_0x2d597c[_0xf780('0x14')]>0x0){_0x16d4c9[_0xf780('0x15')](_0xf780('0x16')+_0x491ab5+_0xf780('0x17'),_[_0xf780('0x18')](_0x2d597c,'id'));}return _0x16d4c9;}function getInteractionsQuery(_0x51b096){var _0x450198=utils[_0xf780('0x19')](_0x51b096);var _0xa78b1b=utils[_0xf780('0x1a')](_0x51b096);var _0x5d5a81=utils[_0xf780('0x1b')](_0x51b096);return squel['select']()[_0xf780('0xc')](_0x450198[_0xf780('0x1c')],'i')['left_join'](_0xf780('0x1d'),'c',_0xf780('0x1e'))['left_join'](_0xf780('0x12'),'o',_0xf780('0x1f'))[_0xf780('0x20')](_0x450198[_0xf780('0x21')],'a',_0xf780('0x22')+_0xa78b1b)[_0xf780('0x20')](_0x450198['messages'],'me',_0xf780('0x23')+_0x5d5a81+'\x20=\x20i.id')['left_join'](_0x450198[_0xf780('0x24')],'it',_0xf780('0x25')+_0x5d5a81+_0xf780('0x26'))['left_join'](_0xf780('0xd'),'t',_0xf780('0x27'));}function getSqlClauses(){var _0x4f59b1={'body':squel[_0xf780('0x28')](),'contact':squel['expr'](),'default':squel[_0xf780('0x28')](),'fields':squel[_0xf780('0x28')](),'filter':squel['expr'](),'read':squel['expr'](),'tags':{'clause':squel[_0xf780('0x28')](),'ids':null},'user':squel[_0xf780('0x28')]()};return _0x4f59b1;}function parseTagParameter(_0x462435){var _0x40d9c9=squel[_0xf780('0x28')]();if(_0x462435){var _0x2bd6cf=utils[_0xf780('0x29')](_0x462435);_0x2bd6cf['forEach'](function(_0x5a3547){_0x40d9c9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5a3547+',%');});}return _0x40d9c9;}function parseReadParameter(_0x3f5498){var _0xf595e2='';if(_0x3f5498){_0xf595e2=_0xf780('0x2a');if(_0x3f5498==='1'){_0xf595e2=_0xf595e2['replace']('{OPERATOR}','=');}else{_0xf595e2=_0xf595e2[_0xf780('0x2b')](_0xf780('0x2c'),'>');}}return _0xf595e2;}function parseSearchFilter(_0x2b832d,_0x5e6b25){var _0x3cc1a5=squel[_0xf780('0x28')]();if(_0x5e6b25){var _0x2368e3=_0x5e6b25[_0xf780('0x2b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf780('0x2d')](_0x2368e3)){_0x3cc1a5['or']('i.id\x20LIKE\x20?',_0x2368e3+'%');if([_0xf780('0x2e'),_0xf780('0x2f')][_0xf780('0x30')](_0x2b832d)){_0x3cc1a5['or'](_0xf780('0x31'),_0x2368e3+'%');}else if(_0x2b832d===_0xf780('0x32')){_0x3cc1a5['or'](_0xf780('0x33'),_0x2368e3+'%');}else if(_0x2b832d===_0xf780('0x34')){_0x3cc1a5['or'](_0xf780('0x35'),_0x2368e3+'%');}}else if(_0x2b832d==='mail'&&qs[_0xf780('0x36')](_0x2368e3)){_0x3cc1a5['or'](_0xf780('0x37'),_0x2368e3+'%');}else{if(_0x2b832d===_0xf780('0x38')){_0x3cc1a5['or'](_0xf780('0x39'),qs[_0xf780('0x3a')](_0x2368e3))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf780('0x3a')](_0x2368e3));}else{if(_0x2b832d!=='fax'){_0x3cc1a5['or'](_0xf780('0x3b'),qs[_0xf780('0x3a')](_0x2368e3));}_0x3cc1a5['or'](_0xf780('0x3c'),_0x2368e3+'%');}}}return _0x3cc1a5;}function parseAdvancedSearchFilter(_0x513bdf,_0x270419){var _0x46893b=getSqlClauses();var _0x26d084=as[_0xf780('0x3d')](_0x513bdf);var _0x523b7a=_0x26d084[_0xf780('0x3e')];for(var _0x5d0553=0x0;_0x5d0553<_0x26d084[_0xf780('0x3f')]['length'];_0x5d0553++){var _0x4bf8a5=_0x26d084[_0xf780('0x3f')][_0x5d0553];var _0x4a2f5a='i';var _0x355430=_[_0xf780('0x40')](_0x270419,[_0xf780('0x41'),_0x4bf8a5[_0xf780('0xa')]]);if(_0x355430){var _0x50e90c=as[_0xf780('0x42')](_0x4a2f5a,_0x355430[_0xf780('0x43')],_0x4bf8a5);_0x46893b[_0xf780('0x44')][_0x523b7a](_0x50e90c[_0xf780('0x45')],_0x50e90c['value'][_0xf780('0x46')],_0x50e90c[_0xf780('0x47')][_0xf780('0x48')]);}else{switch(_0x4bf8a5[_0xf780('0xa')]){case _0xf780('0x49'):var _0x4b4ed8=parseReadParameter(_0x4bf8a5['value']);_0x46893b[_0xf780('0x4a')][_0xf780('0x4b')](_0x4b4ed8);break;case _0xf780('0x4c'):if(_0x4bf8a5[_0xf780('0x4d')]===_0xf780('0x4e')){if(_0x4bf8a5['value'][_0xf780('0x4f')]('\x20')['length']>0x1){_0x46893b[_0xf780('0x50')][_0x523b7a](_0xf780('0x51'),qs[_0xf780('0x3a')](_0x4bf8a5[_0xf780('0x47')]),null);}else{var _0x4b293c='%'+_0x4bf8a5[_0xf780('0x47')]+'%';_0x46893b[_0xf780('0x50')][_0x523b7a](_0xf780('0x52'),_0x4b293c,_0x4b293c,_0x4b293c);}}else{_0x355430=_[_0xf780('0x40')](_0x270419,[_0xf780('0x41'),_0xf780('0x53')]);_0x4bf8a5[_0xf780('0xa')]=_0xf780('0x53');_0x50e90c=as[_0xf780('0x42')](_0x4a2f5a,_0x355430[_0xf780('0x43')],_0x4bf8a5);_0x46893b[_0xf780('0x50')][_0x523b7a](_0x50e90c[_0xf780('0x45')],_0x50e90c[_0xf780('0x47')][_0xf780('0x46')],_0x50e90c['value'][_0xf780('0x48')]);}break;case'Tag':var _0x187444=_0x4bf8a5[_0xf780('0x47')]['split'](',')['map'](function(_0x564c9a){return Number(_0x564c9a);});var _0x5811f1=parseTagParameter(_0x187444);_0x46893b[_0xf780('0x54')]['clause'][_0xf780('0x4b')](_0x5811f1);_0x46893b[_0xf780('0x54')][_0xf780('0x55')]=_0x187444;break;case _0xf780('0x56'):if(_0x4bf8a5[_0xf780('0x4d')]==='$substring'){_0x46893b['user'][_0x523b7a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4bf8a5['value']+'%',null);}else{_0x355430=_[_0xf780('0x40')](_0x270419,[_0xf780('0x41'),_0xf780('0x57')]);_0x4bf8a5[_0xf780('0xa')]=_0xf780('0x57');_0x50e90c=as[_0xf780('0x42')](_0x4a2f5a,_0x355430['type'],_0x4bf8a5);_0x46893b[_0xf780('0x58')][_0x523b7a](_0x50e90c[_0xf780('0x45')],_0x50e90c[_0xf780('0x47')][_0xf780('0x46')],_0x50e90c[_0xf780('0x47')][_0xf780('0x48')]);}break;case'body':case _0xf780('0x59'):_0x50e90c=as['buildExpression']('me',null,_0x4bf8a5);_0x46893b[_0xf780('0x5a')][_0x523b7a](_0x50e90c['text'],_0x50e90c[_0xf780('0x47')]['start'],_0x50e90c['value'][_0xf780('0x48')]);break;}}}return _0x46893b;}function parseModelFields(_0x72a225,_0x189717,_0x2946a1){var _0x5b60e7=utils[_0xf780('0x1a')](_0x72a225);var _0x41ee46=squel[_0xf780('0x28')]();var _0x143665=_(_0x189717)[_0xf780('0x5b')]()['map'](function(_0x34f679){return _['some'](_0x2946a1,[_0xf780('0x41'),_0x34f679])?_0x34f679:undefined;})[_0xf780('0x5c')]()[_0xf780('0x47')]();if(_0x143665[_0xf780('0x14')]>0x0){_0x143665[_0xf780('0x5d')](function(_0x544458){if(_0x544458===_0x5b60e7){_0x41ee46['and']('i.'+_0x5b60e7+_0xf780('0x17'),[][_0xf780('0x5e')](_0x189717[_0x544458]));}else if(_0x544458===_0xf780('0x5f')){var _0x3fead1=JSON['parse'](_0x189717[_0x544458])[_0xf780('0x60')];var _0x476354=JSON[_0xf780('0x61')](_0x189717[_0x544458])[_0xf780('0x62')];_0x41ee46[_0xf780('0x4b')](_0xf780('0x63'),_0x3fead1,_0x476354);}else{if(_0x189717[_0x544458]==='null'){_0x41ee46[_0xf780('0x4b')]('i.'+_0x544458+_0xf780('0x64'));}else{_0x41ee46['and']('i.'+_0x544458+_0xf780('0x65'),_0x189717[_0x544458]);}}});}return _0x41ee46;}function parseQueryParameters(_0x1f1907,_0x276a30,_0x1429cf){var _0xad692a=getSqlClauses();return Promise[_0xf780('0x66')]()[_0xf780('0x67')](function(){return parseModelFields(_0x1f1907,_0x276a30,_0x1429cf);})[_0xf780('0x67')](function(_0x29af91){_0xad692a[_0xf780('0x68')][_0xf780('0x4b')](_0x29af91);return parseReadParameter(_0x276a30[_0xf780('0x4a')]);})['then'](function(_0x22745e){_0xad692a['read'][_0xf780('0x4b')](_0x22745e);return parseTagParameter(_0x276a30[_0xf780('0x69')]);})['then'](function(_0x4dee75){_0xad692a['tags'][_0xf780('0x6a')][_0xf780('0x4b')](_0x4dee75);return parseSearchFilter(_0x1f1907,_0x276a30[_0xf780('0x6b')]);})['then'](function(_0x586ce6){_0xad692a['filter']=_0x586ce6;return _0xad692a;});}function checkAccountsRestrictions(_0x1d3cf1,_0x5ec8e6,_0x28b057){var _0xcffb55=utils[_0xf780('0x1a')](_0x1d3cf1);var _0x593c17=_0xf780('0x6c')+_['capitalize'](_0x1d3cf1)+(_0x1d3cf1===_0xf780('0x6d')?_0xf780('0x6e'):'Accounts');var _0x27e4b3=squel[_0xf780('0x28')]();return Promise[_0xf780('0x66')]()[_0xf780('0x67')](function(){if(_0x28b057[_0xf780('0x8')]&&_0x5ec8e6[_0xf780('0x6')]===_0xf780('0x7')){return _0x5ec8e6[_0x593c17]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x5bfa4a){if(_0x5bfa4a){if(_0x5bfa4a[_0xf780('0x14')]===0x0){_0x27e4b3[_0xf780('0x4b')]('i.'+_0xcffb55+'\x20IS\x20NULL');}else{_0x27e4b3[_0xf780('0x4b')]('i.'+_0xcffb55+_0xf780('0x17'),_[_0xf780('0x18')](_0x5bfa4a,'id'));}}else if(!_0x28b057[_0xcffb55]){_0x27e4b3[_0xf780('0x4b')]('i.'+_0xcffb55+_0xf780('0x6f'));}})['then'](function(){return _0x27e4b3;});}function getClosedOrderClause(_0x5c29b8,_0x45f9a6){var _0x5f052e='';var _0xad2d7e=['i.thirdDisposition',_0xf780('0x70'),_0xf780('0x71')];if(_0x5c29b8===_0xf780('0x38')){_0xad2d7e[_0xf780('0x72')](_0xf780('0x73'));}if(_0x45f9a6['closed']==='0'&&_0x5c29b8===_0xf780('0x38')){_0x5f052e=_0xf780('0x73');}else{if(_0x45f9a6[_0xf780('0x74')]==='1'){_0xad2d7e['shift']();}_0x5f052e='CONCAT_WS(\x27\x27,\x20'+_0xad2d7e[_0xf780('0x75')](',\x20')+')';}return _0x5f052e;}function getFilteredInteractions(_0x2eb89f,_0x26541b,_0x56853b,_0x49f751){var _0x23ac0a=utils[_0xf780('0x1b')](_0x2eb89f);var _0x21e7be=_[_0xf780('0x76')](_0x2eb89f)+_0xf780('0x77');var _0x31d999=[];var _0x4cd6b7=getTagsQuery();var _0x6b14e8={'type':db[_0xf780('0x78')][_0xf780('0x79')]['SELECT'],'raw':!![]};var _0x58f573=[];var _0x1bcf9f=[];return db['sequelize'][_0xf780('0x7a')](_0x4cd6b7[_0xf780('0x7b')](),_0x6b14e8)[_0xf780('0x67')](function(_0x337465){_0x31d999=_[_0xf780('0x7c')](_0x337465,'id');_0x6b14e8=_[_0xf780('0x7d')](_0x6b14e8,{'model':db[_0x21e7be],'mapToModel':!![],'nest':!![]});if(_0x56853b[_0xf780('0x68')]){_0x49f751[_0xf780('0x7e')][_0xf780('0x5d')](function(_0x38e8cf){_0x26541b[_0xf780('0xa')]('i.'+_0x38e8cf);});}else{_0x26541b[_0xf780('0xa')](_0xf780('0x7f'),_0xf780('0x49'));_0x26541b[_0xf780('0xa')](_0xf780('0x80'),'Account.key');_0x26541b[_0xf780('0xa')]('a.mandatoryDisposition',_0xf780('0x81'));if(_0x2eb89f===_0xf780('0x38')){_0x26541b[_0xf780('0xa')]('a.email',_0xf780('0x82'));_0x26541b[_0xf780('0xa')](_0xf780('0x83'),_0xf780('0x84'));_0x26541b[_0xf780('0xa')](_0xf780('0x85'));_0x26541b[_0xf780('0xa')](_0xf780('0x86'));_0x26541b[_0xf780('0xa')](_0xf780('0x87'));_0x26541b[_0xf780('0xa')]('i.closed');_0x26541b[_0xf780('0xa')]('i.closedAt');_0x26541b['field'](_0xf780('0x88'));_0x26541b['field'](_0xf780('0x89'));_0x26541b[_0xf780('0xa')]('i.lastMsgDirection');_0x26541b[_0xf780('0xa')](_0xf780('0x8a'));_0x26541b[_0xf780('0xa')]('i.disposition');_0x26541b[_0xf780('0xa')](_0xf780('0x70'));_0x26541b[_0xf780('0xa')](_0xf780('0x8b'));_0x26541b[_0xf780('0xa')]('i.substatus');_0x26541b[_0xf780('0xa')](_0xf780('0x8c'));_0x26541b[_0xf780('0xa')]('i.ContactId');_0x26541b[_0xf780('0xa')]('i.MailAccountId');_0x26541b[_0xf780('0xa')](_0xf780('0x8d'));}else if(_0x2eb89f===_0xf780('0x34')){_0x26541b[_0xf780('0xa')](_0xf780('0x8e'),_0xf780('0x84'));}else{_0x26541b[_0xf780('0xa')]('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',_0xf780('0x84'));}if(_0x2eb89f!==_0xf780('0x38')){_0x26541b[_0xf780('0xa')]('i.*');}_0x26541b[_0xf780('0xa')](_0xf780('0x8f'),_0xf780('0x90'));_0x26541b['field'](_0xf780('0x91'),_0xf780('0x92'));_0x26541b[_0xf780('0xa')](_0xf780('0x93'),'Contact.email');_0x26541b[_0xf780('0xa')](_0xf780('0x94'),_0xf780('0x95'));_0x26541b[_0xf780('0xa')]('c.mobile',_0xf780('0x96'));_0x26541b[_0xf780('0xa')](_0xf780('0x97'),_0xf780('0x98'));_0x26541b['field'](_0xf780('0x99'),'Owner.fullname');_0x26541b[_0xf780('0xa')](_0xf780('0x9a'),'Owner.internal');_0x26541b[_0xf780('0xa')](_0xf780('0x9b'),_0xf780('0x9c'));}if(_0x49f751[_0xf780('0x9d')]){_0x26541b[_0xf780('0x9d')](_0x49f751[_0xf780('0x9d')]);}if(_0x49f751['offset']){_0x26541b['offset'](_0x49f751[_0xf780('0x9e')]);}return db['sequelize'][_0xf780('0x7a')](_0x26541b['toString'](),_0x6b14e8);})[_0xf780('0x67')](function(_0xde8c1b){_0x58f573=_0xde8c1b;var _0x449482=getUsersQuery(_0x2eb89f,_0x58f573);return db[_0xf780('0x9f')][_0xf780('0x7a')](_0x449482[_0xf780('0x7b')](),_0x6b14e8);})[_0xf780('0x67')](function(_0x43c98c){_0x1bcf9f=_['groupBy'](_0x43c98c,_0x23ac0a);if(_0x2eb89f==='mail'){return db[_0xf780('0xa0')][_0xf780('0xa1')]({'attributes':[_0xf780('0xa2')],'raw':!![]});}})[_0xf780('0x67')](function(_0x2d8dcb){var _0x5d5108=_0x2d8dcb?_0x2d8dcb[_0xf780('0xa2')]:undefined;var _0x231ca5=_0x58f573['map'](function(_0x14c799){return updateInteraction(_0x14c799,_0x31d999,_0x1bcf9f,_0x5d5108);});return Promise[_0xf780('0xa3')](_0x231ca5);});}function countFilteredInteractions(_0x1c49f4,_0xe8c5e9){var _0xbdbd2c=_0x1c49f4[_0xf780('0xa4')]();_0xbdbd2c['field'](_0xf780('0xa5'));_0xbdbd2c[_0xf780('0xa')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x24e0dd=utils[_0xf780('0x29')](_0xe8c5e9);if(!_[_0xf780('0xa6')](_0x24e0dd)){_0xbdbd2c[_0xf780('0x15')]('t.id\x20IN\x20?',_0x24e0dd);}var _0xeef304={'type':db[_0xf780('0x78')][_0xf780('0x79')][_0xf780('0xa7')],'raw':!![]};return db[_0xf780('0x9f')][_0xf780('0x7a')](_0xbdbd2c[_0xf780('0x7b')](),_0xeef304);}module[_0xf780('0xa8')]={'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 b0908e2..d5dca48 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 _0x45d4=['push','waiting','talking','answered','unmanaged','total','closed','disposition','abandoned','UserId','MailMessage','plainBody','then','lastMsgText','trimStart','catch','updateInteraction','Users','Tags','TagIds','lodash','../../mysqldb','forEach'];(function(_0x190733,_0x4536ec){var _0x1021d7=function(_0x5cb8ee){while(--_0x5cb8ee){_0x190733['push'](_0x190733['shift']());}};_0x1021d7(++_0x4536ec);}(_0x45d4,0xb5));var _0x445d=function(_0x2aac38,_0x4cf347){_0x2aac38=_0x2aac38-0x0;var _0x1992af=_0x45d4[_0x2aac38];return _0x1992af;};'use strict';var _=require(_0x445d('0x0'));var db=require(_0x445d('0x1'))['db'];function getInteractionUsers(_0x41c6e0,_0x40a3aa){return new Promise(function(_0x51abe7,_0x895d78){try{var _0x3219b5=[];if(_0x40a3aa[_0x41c6e0]){_0x3219b5=_0x40a3aa[_0x41c6e0]['map'](function(_0x30e6e0){return{'id':_0x30e6e0['id'],'fullname':_0x30e6e0['fullname']};});}return _0x51abe7(_0x3219b5);}catch(_0x40c635){_0x895d78(_0x40c635);}});}function getInteractionTags(_0x286e70,_0x15d8cd){var _0x4a2afd=[];if(_0x286e70){_0x286e70['split'](',')[_0x445d('0x2')](function(_0x5d85ae){_0x4a2afd[_0x445d('0x3')](_0x15d8cd[_0x5d85ae]);});}return _0x4a2afd;}function updateWaitingCounter(_0x544cbc){if(_0x544cbc[_0x445d('0x4')]){_0x544cbc[_0x445d('0x4')]-=0x1;}}function updateInteractionCounters(_0x5052cb){_0x5052cb[_0x445d('0x4')]=0x0;_0x5052cb[_0x445d('0x5')]=0x0;_0x5052cb[_0x445d('0x6')]=0x0;_0x5052cb[_0x445d('0x7')]=0x0;_0x5052cb['abandoned']=0x0;_0x5052cb[_0x445d('0x8')]=0x0;if(_0x5052cb[_0x445d('0x9')]){if(_0x5052cb[_0x445d('0xa')]===_0x445d('0xb')){_0x5052cb[_0x445d('0xb')]+=0x1;updateWaitingCounter(_0x5052cb);}if(_0x5052cb[_0x445d('0xc')]){_0x5052cb[_0x445d('0x6')]+=0x1;if(_0x5052cb['talking']){_0x5052cb[_0x445d('0x5')]-=0x1;}}else{if(_0x5052cb[_0x445d('0xa')]){_0x5052cb['unmanaged']+=0x1;updateWaitingCounter(_0x5052cb);}}}else{if(!_0x5052cb[_0x445d('0xc')]){_0x5052cb[_0x445d('0x4')]+=0x1;}if(_0x5052cb[_0x445d('0xc')]){_0x5052cb[_0x445d('0x5')]+=0x1;updateWaitingCounter(_0x5052cb);}}_0x5052cb[_0x445d('0x8')]+=0x1;return _0x5052cb;}function getLastMessageText(_0x724d8b){return db[_0x445d('0xd')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x724d8b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x445d('0xe')],'order':'-id','raw':!![]})[_0x445d('0xf')](function(_0x267404){if(_0x267404&&_0x267404['plainBody']){_0x724d8b[_0x445d('0x10')]=_[_0x445d('0x11')](_0x267404[_0x445d('0xe')]);}return _0x724d8b;})[_0x445d('0x12')](function(_0x3b5ade){throw _0x3b5ade;});}exports[_0x445d('0x13')]=function(_0x396174,_0x190b77,_0x4f52e5,_0xd0aff9){return new Promise(function(_0x150c8a,_0x29982c){return getInteractionUsers(_0x396174['id'],_0x4f52e5)['then'](function(_0x4fb54b){_0x396174[_0x445d('0x14')]=_0x4fb54b;return getInteractionTags(_0x396174['TagIds'],_0x190b77);})[_0x445d('0xf')](function(_0x596cdf){_0x396174[_0x445d('0x15')]=_0x596cdf;delete _0x396174[_0x445d('0x16')];return updateInteractionCounters(_0x396174);})[_0x445d('0xf')](function(_0x136d3b){if(_0xd0aff9){return getLastMessageText(_0x136d3b);}else{return _0x136d3b;}})[_0x445d('0xf')](function(_0x4dd0aa){_0x150c8a(_0x4dd0aa);})[_0x445d('0x12')](function(_0x1605b9){_0x29982c(_0x1605b9);});});}; \ No newline at end of file +var _0x7761=['plainBody','-id','then','lastMsgText','trimStart','catch','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','disposition','UserId','findOne','out'];(function(_0x37d686,_0x12888d){var _0xafbb57=function(_0x1ed44d){while(--_0x1ed44d){_0x37d686['push'](_0x37d686['shift']());}};_0xafbb57(++_0x12888d);}(_0x7761,0x15b));var _0x1776=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7761[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1776('0x0'));var db=require(_0x1776('0x1'))['db'];function getInteractionUsers(_0x4f7906,_0x515523){return new Promise(function(_0x543fd6,_0x14fcb5){try{var _0x3a7409=[];if(_0x515523[_0x4f7906]){_0x3a7409=_0x515523[_0x4f7906][_0x1776('0x2')](function(_0x405958){return{'id':_0x405958['id'],'fullname':_0x405958[_0x1776('0x3')]};});}return _0x543fd6(_0x3a7409);}catch(_0x5e0686){_0x14fcb5(_0x5e0686);}});}function getInteractionTags(_0x266d9f,_0x104fe3){var _0x16ba0e=[];if(_0x266d9f){_0x266d9f[_0x1776('0x4')](',')[_0x1776('0x5')](function(_0x256393){_0x16ba0e[_0x1776('0x6')](_0x104fe3[_0x256393]);});}return _0x16ba0e;}function updateWaitingCounter(_0x45d865){if(_0x45d865[_0x1776('0x7')]){_0x45d865[_0x1776('0x7')]-=0x1;}}function updateInteractionCounters(_0x4f1346){_0x4f1346[_0x1776('0x7')]=0x0;_0x4f1346[_0x1776('0x8')]=0x0;_0x4f1346[_0x1776('0x9')]=0x0;_0x4f1346[_0x1776('0xa')]=0x0;_0x4f1346[_0x1776('0xb')]=0x0;_0x4f1346[_0x1776('0xc')]=0x0;if(_0x4f1346['closed']){if(_0x4f1346[_0x1776('0xd')]===_0x1776('0xb')){_0x4f1346[_0x1776('0xb')]+=0x1;updateWaitingCounter(_0x4f1346);}if(_0x4f1346[_0x1776('0xe')]){_0x4f1346[_0x1776('0x9')]+=0x1;if(_0x4f1346[_0x1776('0x8')]){_0x4f1346['talking']-=0x1;}}else{if(_0x4f1346[_0x1776('0xd')]){_0x4f1346[_0x1776('0xa')]+=0x1;updateWaitingCounter(_0x4f1346);}}}else{if(!_0x4f1346['UserId']){_0x4f1346['waiting']+=0x1;}if(_0x4f1346[_0x1776('0xe')]){_0x4f1346[_0x1776('0x8')]+=0x1;updateWaitingCounter(_0x4f1346);}}_0x4f1346[_0x1776('0xc')]+=0x1;return _0x4f1346;}function getLastMessageText(_0x49560c){return db['MailMessage'][_0x1776('0xf')]({'where':{'$and':[{'MailInteractionId':_0x49560c['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x1776('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x1776('0x11')],'order':_0x1776('0x12'),'raw':!![]})[_0x1776('0x13')](function(_0x5059c1){if(_0x5059c1&&_0x5059c1[_0x1776('0x11')]){_0x49560c[_0x1776('0x14')]=_[_0x1776('0x15')](_0x5059c1[_0x1776('0x11')]);}return _0x49560c;})[_0x1776('0x16')](function(_0x51cc72){throw _0x51cc72;});}exports['updateInteraction']=function(_0x2010b5,_0x336f35,_0x5571df,_0x33f3b7){return new Promise(function(_0x5bdfdc,_0x480e38){return getInteractionUsers(_0x2010b5['id'],_0x5571df)['then'](function(_0x152b6e){_0x2010b5[_0x1776('0x17')]=_0x152b6e;return getInteractionTags(_0x2010b5[_0x1776('0x18')],_0x336f35);})[_0x1776('0x13')](function(_0x37caa3){_0x2010b5[_0x1776('0x19')]=_0x37caa3;delete _0x2010b5[_0x1776('0x18')];return updateInteractionCounters(_0x2010b5);})['then'](function(_0x14bfc6){if(_0x33f3b7){return getLastMessageText(_0x14bfc6);}else{return _0x14bfc6;}})[_0x1776('0x13')](function(_0x425d6a){_0x5bdfdc(_0x425d6a);})[_0x1776('0x16')](function(_0x2b7835){_0x480e38(_0x2b7835);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index db82ed7..f43bb36 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 _0x6670=['capitalize','Account','InteractionId','upperFirst','unknown','chat','websites','accounts','_interaction_has_tags','user_has_','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','Interaction','then','update','info','catch','error','lodash','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x6670,0x1d9));var _0x0667=function(_0x4d925c,_0x1265ab){_0x4d925c=_0x4d925c-0x0;var _0x334860=_0x6670[_0x4d925c];return _0x334860;};'use strict';var _=require(_0x0667('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x0667('0x1'))(_0x0667('0x2')),'mail':require('../../config/logger')(_0x0667('0x3')),'fax':require('../../config/logger')(_0x0667('0x4')),'sms':require('../../config/logger')(_0x0667('0x5')),'chat':require(_0x0667('0x1'))(_0x0667('0x6')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getAccountFK(_0x1f9751){return _[_0x0667('0x7')](_0x1f9751)+(_0x1f9751==='chat'?'Website':_0x0667('0x8'))+'Id';}function getInteractionFK(_0x424865){return _[_0x0667('0x7')](_0x424865)+_0x0667('0x9');}function getInteractionId(_0x5a24a1,_0x1312bb,_0x4216f5){if(_0x5a24a1&&_0x5a24a1[_[_0x0667('0xa')](_0x4216f5)+'InteractionId']){return _0x5a24a1[_[_0x0667('0xa')](_0x4216f5)+_0x0667('0x9')];}else if(_0x5a24a1&&_0x5a24a1['id']){return _0x5a24a1['id'];}else if(_0x1312bb&&_0x1312bb['id']){return _0x1312bb['id'];}else{return _0x0667('0xb');}}function getInteractionsTables(_0x4949e6){return{'accounts':_0x4949e6+'_'+(_0x4949e6===_0x0667('0xc')?_0x0667('0xd'):_0x0667('0xe')),'interactions':_0x4949e6+'_interactions','interactionsTags':_0x4949e6+_0x0667('0xf'),'messages':_0x4949e6+'_messages','userInteractions':_0x0667('0x10')+_0x4949e6+_0x0667('0x11')};}function getSelectedTags(_0x3ac84e){var _0x196122=[];if(_0x3ac84e){_0x196122=Array[_0x0667('0x12')](_0x3ac84e)?_0x3ac84e:[_0x3ac84e];}return _0x196122;}function log(_0x947e57,_0x41881a,_0xc99f2,_0x48d6cd,_0x40b9e6,_0x38d0ac){loggers[_0x40b9e6[_0x0667('0x13')]()][_0x947e57](_0x0667('0x14'),_0x38d0ac[_0x0667('0x15')](),_0x41881a?_0x41881a['id']:null,_0x41881a?_0x41881a[_0x0667('0x16')]:null,_0x41881a?_0x41881a[_0x0667('0x17')]:null,getInteractionId(_0xc99f2,_0x48d6cd,_0x40b9e6),_0xc99f2?JSON['stringify'](_0xc99f2):'null');}function updateUser(_0x2d37bc,_0x5e5173,_0x383360,_0x4f232c,_0x323e7a){db[_[_0x0667('0xa')](_0x4f232c)+_0x0667('0x18')]['findOne']({'where':{'id':getInteractionId(_0x5e5173,_0x383360,_0x4f232c)}})[_0x0667('0x19')](function(_0x2d7bf5){if(_0x2d7bf5){return _0x2d7bf5[_0x0667('0x1a')]({'UserId':_0x2d37bc?_0x2d37bc['id']:null});}})['then'](function(_0x19accd){if(_0x19accd){log(_0x0667('0x1b'),_0x2d37bc,_0x5e5173,_0x383360,_0x4f232c,_0x323e7a);}})[_0x0667('0x1c')](function(){log(_0x0667('0x1d'),_0x2d37bc,_0x5e5173,_0x383360,_0x4f232c,_0x323e7a);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0xc0c6=['info','catch','error','exports','../../mysqldb','mail-interactions','../../config/logger','fax-interactions','sms-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','unknown','websites','_interactions','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','role','stringify','null','Interaction','findOne','update','then'];(function(_0x40b0f,_0x3783e5){var _0x39a923=function(_0x1464b7){while(--_0x1464b7){_0x40b0f['push'](_0x40b0f['shift']());}};_0x39a923(++_0x3783e5);}(_0xc0c6,0x64));var _0x6c0c=function(_0x4b5f1f,_0x1fee93){_0x4b5f1f=_0x4b5f1f-0x0;var _0x3bb747=_0xc0c6[_0x4b5f1f];return _0x3bb747;};'use strict';var _=require('lodash');var db=require(_0x6c0c('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require('../../config/logger')(_0x6c0c('0x1')),'fax':require(_0x6c0c('0x2'))(_0x6c0c('0x3')),'sms':require(_0x6c0c('0x2'))(_0x6c0c('0x4')),'chat':require(_0x6c0c('0x2'))('chat-interactions'),'whatsapp':require(_0x6c0c('0x2'))(_0x6c0c('0x5'))};function getAccountFK(_0x495e0d){return _[_0x6c0c('0x6')](_0x495e0d)+(_0x495e0d===_0x6c0c('0x7')?_0x6c0c('0x8'):_0x6c0c('0x9'))+'Id';}function getInteractionFK(_0x3d2c73){return _[_0x6c0c('0x6')](_0x3d2c73)+_0x6c0c('0xa');}function getInteractionId(_0x1cb7c7,_0xc9bf15,_0x3a9bc9){if(_0x1cb7c7&&_0x1cb7c7[_[_0x6c0c('0xb')](_0x3a9bc9)+'InteractionId']){return _0x1cb7c7[_[_0x6c0c('0xb')](_0x3a9bc9)+_0x6c0c('0xa')];}else if(_0x1cb7c7&&_0x1cb7c7['id']){return _0x1cb7c7['id'];}else if(_0xc9bf15&&_0xc9bf15['id']){return _0xc9bf15['id'];}else{return _0x6c0c('0xc');}}function getInteractionsTables(_0x2fde58){return{'accounts':_0x2fde58+'_'+(_0x2fde58===_0x6c0c('0x7')?_0x6c0c('0xd'):'accounts'),'interactions':_0x2fde58+_0x6c0c('0xe'),'interactionsTags':_0x2fde58+'_interaction_has_tags','messages':_0x2fde58+_0x6c0c('0xf'),'userInteractions':_0x6c0c('0x10')+_0x2fde58+'_interactions'};}function getSelectedTags(_0xd58ffa){var _0x4bbf86=[];if(_0xd58ffa){_0x4bbf86=Array[_0x6c0c('0x11')](_0xd58ffa)?_0xd58ffa:[_0xd58ffa];}return _0x4bbf86;}function log(_0xbcaa6c,_0x289c96,_0x57266e,_0xbcc9ad,_0x4507b1,_0xa493b2){loggers[_0x4507b1[_0x6c0c('0x12')]()][_0xbcaa6c](_0x6c0c('0x13'),_0xa493b2[_0x6c0c('0x14')](),_0x289c96?_0x289c96['id']:null,_0x289c96?_0x289c96['name']:null,_0x289c96?_0x289c96[_0x6c0c('0x15')]:null,getInteractionId(_0x57266e,_0xbcc9ad,_0x4507b1),_0x57266e?JSON[_0x6c0c('0x16')](_0x57266e):_0x6c0c('0x17'));}function updateUser(_0x153614,_0x11d6c8,_0x3b5c9d,_0x27fbaf,_0x14dba1){db[_[_0x6c0c('0xb')](_0x27fbaf)+_0x6c0c('0x18')][_0x6c0c('0x19')]({'where':{'id':getInteractionId(_0x11d6c8,_0x3b5c9d,_0x27fbaf)}})['then'](function(_0x3df146){if(_0x3df146){return _0x3df146[_0x6c0c('0x1a')]({'UserId':_0x153614?_0x153614['id']:null});}})[_0x6c0c('0x1b')](function(_0x2194fb){if(_0x2194fb){log(_0x6c0c('0x1c'),_0x153614,_0x11d6c8,_0x3b5c9d,_0x27fbaf,_0x14dba1);}})[_0x6c0c('0x1d')](function(){log(_0x6c0c('0x1e'),_0x153614,_0x11d6c8,_0x3b5c9d,_0x27fbaf,_0x14dba1);});}module[_0x6c0c('0x1f')]={'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 c37eb99..3b6817e 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 _0xc0aa=['../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','user','isUserLimit','crypto','util','../../mysqldb'];(function(_0x745c75,_0x1d59e1){var _0x3ca2e7=function(_0x4fcd00){while(--_0x4fcd00){_0x745c75['push'](_0x745c75['shift']());}};_0x3ca2e7(++_0x1d59e1);}(_0xc0aa,0x185));var _0xac0a=function(_0x102cdb,_0x2e326){_0x102cdb=_0x102cdb-0x0;var _0x2163c6=_0xc0aa[_0x102cdb];return _0x2163c6;};'use strict';var crypto=require(_0xac0a('0x0'));var util=require(_0xac0a('0x1'));var compose=require('composable-middleware');var db=require(_0xac0a('0x2'))['db'];var config=require(_0xac0a('0x3'));function getValueFromLicense(_0x5e07fd,_0x93e316){if(_0x5e07fd&&_0x93e316){if(_0x93e316[_0xac0a('0x4')]&&_0x93e316[_0xac0a('0x5')]){var _0x1cc3b9=_0x93e316['data1'];var _0x5eb95c=_0x93e316['license'];var _0x126ec9=_0x1cc3b9[_0xac0a('0x6')]('-')[0x4];var _0x30212e=_0x1cc3b9[_0xac0a('0x6')]('-')[0x0];var _0x319fbd=crypto[_0xac0a('0x7')](_0xac0a('0x8'),util[_0xac0a('0x9')](_0xac0a('0xa'),_0x126ec9,_0x1cc3b9,_0x30212e));var _0x462eb5=_0x319fbd[_0xac0a('0xb')](_0x5eb95c,_0xac0a('0xc'),_0xac0a('0xd'));_0x462eb5+=_0x319fbd['final'](_0xac0a('0xd'));var _0x21d725=JSON[_0xac0a('0xe')](_0x462eb5);return _0x21d725[_0xac0a('0xf')](_0x5e07fd)?_0x21d725[_0x5e07fd]:null;}}return null;}function isLimit(_0x2ad592,_0x91be49,_0x114a3b,_0x1f5ba1){var _0xe38dfb=_0x91be49;return compose()[_0xac0a('0x10')](function(_0x13052f,_0x397bc9,_0x42418f){return db[_0xac0a('0x11')][_0xac0a('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xac0a('0x13')](function(_0xcd10e5){var _0x13288b=getValueFromLicense(_0x2ad592,_0xcd10e5);return _0x13288b?_0x13288b:_0xe38dfb;})['then'](function(_0x5cc1e5){_0xe38dfb=_0x5cc1e5;return _0x114a3b[_0xac0a('0x14')](_0x1f5ba1);})[_0xac0a('0x13')](function(_0x3f4fc3){if(_0x3f4fc3>=_0xe38dfb){return _0x397bc9[_0xac0a('0x15')](0x193)[_0xac0a('0x16')]({'message':util[_0xac0a('0x9')](_0xac0a('0x17'),_0x2ad592)});}_0x42418f();})[_0xac0a('0x18')](function(_0x21f493){_0x42418f(_0x21f493);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xac0a('0x19')],{'where':{'$or':[{'role':'admin'},{'role':_0xac0a('0x1a')}]}});}exports[_0xac0a('0x1b')]=isUserLimit; \ No newline at end of file +var _0x4377=['split','createDecipher','format','%s:%s:%s','base64','final','utf8','parse','hasOwnProperty','License','findOne','then','count','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','user','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','license'];(function(_0x1da279,_0x5968ed){var _0x56d83a=function(_0xfbe655){while(--_0xfbe655){_0x1da279['push'](_0x1da279['shift']());}};_0x56d83a(++_0x5968ed);}(_0x4377,0xf5));var _0x7437=function(_0x2a7a96,_0x232940){_0x2a7a96=_0x2a7a96-0x0;var _0xd5a479=_0x4377[_0x2a7a96];return _0xd5a479;};'use strict';var crypto=require(_0x7437('0x0'));var util=require('util');var compose=require(_0x7437('0x1'));var db=require(_0x7437('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4ff07e,_0x3fc455){if(_0x4ff07e&&_0x3fc455){if(_0x3fc455[_0x7437('0x3')]&&_0x3fc455[_0x7437('0x4')]){var _0x22ce4c=_0x3fc455['data1'];var _0x3135fe=_0x3fc455['license'];var _0x3c6eef=_0x22ce4c[_0x7437('0x5')]('-')[0x4];var _0x208398=_0x22ce4c[_0x7437('0x5')]('-')[0x0];var _0x1714a4=crypto[_0x7437('0x6')]('aes-256-ctr',util[_0x7437('0x7')](_0x7437('0x8'),_0x3c6eef,_0x22ce4c,_0x208398));var _0x4a0cec=_0x1714a4['update'](_0x3135fe,_0x7437('0x9'),'utf8');_0x4a0cec+=_0x1714a4[_0x7437('0xa')](_0x7437('0xb'));var _0x486e25=JSON[_0x7437('0xc')](_0x4a0cec);return _0x486e25[_0x7437('0xd')](_0x4ff07e)?_0x486e25[_0x4ff07e]:null;}}return null;}function isLimit(_0x475105,_0x5e2b6d,_0x417863,_0x1094dc){var _0x2ebeca=_0x5e2b6d;return compose()['use'](function(_0x93aa59,_0x605bfa,_0x3fe7c6){return db[_0x7437('0xe')][_0x7437('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x4290b2){var _0x306ed1=getValueFromLicense(_0x475105,_0x4290b2);return _0x306ed1?_0x306ed1:_0x2ebeca;})[_0x7437('0x10')](function(_0x2f8fd5){_0x2ebeca=_0x2f8fd5;return _0x417863[_0x7437('0x11')](_0x1094dc);})['then'](function(_0x470121){if(_0x470121>=_0x2ebeca){return _0x605bfa['status'](0x193)[_0x7437('0x12')]({'message':util[_0x7437('0x7')](_0x7437('0x13'),_0x475105)});}_0x3fe7c6();})[_0x7437('0x14')](function(_0x479feb){_0x3fe7c6(_0x479feb);});});}function isUserLimit(){return isLimit(_0x7437('0x15'),0x1,db[_0x7437('0x16')],{'where':{'$or':[{'role':'admin'},{'role':_0x7437('0x17')}]}});}exports[_0x7437('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index b1d7171..3b317e7 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 _0x7ae5=['filter','indexOf','map','conditions','push','DATE','operator','$eq','$between','value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','$in','IN\x20?','=\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','pop','utcOffset','minutes','lodash','parseSearch','startsWith','[$or]','[$and]','replace','split','length','slice','forEach','shift','match'];(function(_0x61c999,_0x2bebd8){var _0x25472f=function(_0x5befec){while(--_0x5befec){_0x61c999['push'](_0x61c999['shift']());}};_0x25472f(++_0x2bebd8);}(_0x7ae5,0x1d1));var _0x57ae=function(_0x1781de,_0x5c4b38){_0x1781de=_0x1781de-0x0;var _0x48d7fc=_0x7ae5[_0x1781de];return _0x48d7fc;};'use strict';var _=require(_0x57ae('0x0'));var moment=require('moment');exports[_0x57ae('0x1')]=function(_0x31a84c){var _0x3dcc10={'conditions':[]};_0x3dcc10['sqlOperator']=_[_0x57ae('0x2')](_0x31a84c,_0x57ae('0x3'))?'or':'and';var _0x10b984=_0x31a84c['replace'](_0x57ae('0x4'),'')[_0x57ae('0x5')](_0x57ae('0x3'),'')[_0x57ae('0x6')]('||');for(var _0x9a7746=0x0;_0x9a7746<_0x10b984[_0x57ae('0x7')];_0x9a7746++){var _0x256db2=_0x10b984[_0x9a7746][_0x57ae('0x6')](':=');var _0x49eb67=_0x256db2[0x0];var _0x2ef7ec=_0x256db2[_0x57ae('0x8')](0x1);_0x2ef7ec[_0x57ae('0x9')](function(_0x4b2d0a){var _0x5e6d34=_0x4b2d0a['split']('[')[_0x57ae('0xa')]();var _0x2ae5e1=_0x4b2d0a[_0x57ae('0xb')](/\[(.*?)\]/g);_0x2ae5e1[_0x57ae('0x9')](function(_0x4dec44){var _0x5a6242=_0x4dec44['split']('[')[_0x57ae('0xc')](function(_0x310aab){return _0x310aab[_0x57ae('0xd')](']')>-0x1;})[_0x57ae('0xe')](function(_0x414cee){return _0x414cee['split'](']')[0x0];})[0x0];_0x3dcc10[_0x57ae('0xf')][_0x57ae('0x10')]({'field':_0x49eb67,'operator':_0x5e6d34,'value':_0x5a6242});});});}return _0x3dcc10;};exports['buildExpression']=function(_0xa7773c,_0xd400a9,_0x46877d){var _0x1b6b8f={};if(_0xd400a9===_0x57ae('0x11')){if(_0x46877d[_0x57ae('0x12')]===_0x57ae('0x13')){_0x46877d['operator']=_0x57ae('0x14');_0x46877d[_0x57ae('0x15')]+=','+_0x46877d[_0x57ae('0x15')];}else if(_[_0x57ae('0x16')]([_0x57ae('0x17'),_0x57ae('0x18')],_0x46877d['operator'])){_0x46877d['value']=moment(_0x46877d[_0x57ae('0x15')])[_0x57ae('0x19')](0x1,_0x57ae('0x1a'))[_0x57ae('0x1b')]('YYYY-MM-DD');}}if(_0x46877d[_0x57ae('0x1c')]){_0xd400a9=_0x46877d[_0x57ae('0x1c')];_0x1b6b8f[_0x57ae('0x1d')]=_0x57ae('0x1e')+_0xa7773c+'.'+_0x46877d[_0x57ae('0x1f')]+_0x57ae('0x20')+_0x46877d[_0x57ae('0x1c')]+')\x20'+parseOperator(_0x46877d[_0x57ae('0x12')]);}else{_0x1b6b8f['text']=_0xa7773c+'.'+_0x46877d[_0x57ae('0x1f')]+'\x20'+parseOperator(_0x46877d['operator']);}if(_[_0x57ae('0x16')]([_0x57ae('0x21'),_0x57ae('0x22')],_0x46877d[_0x57ae('0x12')]))_0x1b6b8f[_0x57ae('0x1d')]='('+_0x1b6b8f[_0x57ae('0x1d')]+'\x20OR\x20'+_0xa7773c+'.'+_0x46877d['field']+'\x20IS\x20NULL)';_0x1b6b8f[_0x57ae('0x15')]=parseValue(_0xd400a9,_0x46877d[_0x57ae('0x12')],_0x46877d['value']);return _0x1b6b8f;};function parseOperator(_0x42a4db){var _0x4d4406;switch(_0x42a4db){case _0x57ae('0x23'):_0x4d4406=_0x57ae('0x24');break;case _0x57ae('0x22'):_0x4d4406='NOT\x20IN\x20?';break;case _0x57ae('0x13'):_0x4d4406=_0x57ae('0x25');break;case _0x57ae('0x21'):_0x4d4406='<>\x20?';break;case _0x57ae('0x26'):case'$startsWith':case _0x57ae('0x27'):_0x4d4406=_0x57ae('0x28');break;case _0x57ae('0x29'):_0x4d4406=_0x57ae('0x2a');break;case _0x57ae('0x17'):_0x4d4406=_0x57ae('0x2b');break;case'$lte':_0x4d4406=_0x57ae('0x2c');break;case _0x57ae('0x2d'):_0x4d4406=_0x57ae('0x2e');break;case _0x57ae('0x14'):_0x4d4406=_0x57ae('0x2f');break;}return _0x4d4406;}function parseValue(_0x9f2054,_0xe11b88,_0x2b7c67){var _0x39e153={'start':undefined,'end':undefined};switch(_0xe11b88){case'$in':case _0x57ae('0x22'):_0x39e153[_0x57ae('0x30')]=_0x2b7c67['split'](',');break;case'$substring':_0x39e153[_0x57ae('0x30')]='%'+_0x2b7c67+'%';break;case _0x57ae('0x31'):_0x39e153['start']=_0x2b7c67+'%';break;case _0x57ae('0x27'):_0x39e153[_0x57ae('0x30')]='%'+_0x2b7c67;break;case _0x57ae('0x14'):var _0x16a5ca=_0x2b7c67[_0x57ae('0x6')](',');var _0x2b7c67=_0x16a5ca[_0x57ae('0xa')]();var _0x5255be=_0x16a5ca[_0x57ae('0x32')]();if(_0x9f2054===_0x57ae('0x11')){_0x2b7c67=moment(_0x2b7c67)[_0x57ae('0x33')](0x0,!![])['format']();_0x5255be=moment(_0x5255be)[_0x57ae('0x33')](0x0,!![])[_0x57ae('0x19')](0x17,'hours')[_0x57ae('0x19')](0x3b,_0x57ae('0x34'))['add'](0x3b,'seconds')['format']();}_0x39e153={'start':_0x2b7c67,'end':_0x5255be};break;default:_0x39e153[_0x57ae('0x30')]=_0x2b7c67;break;}return _0x39e153;} \ No newline at end of file +var _0x6d1d=['text','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','$notIn','start','pop','DATE','format','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','startsWith','[$or]','[$and]','replace','split','length','slice','forEach','shift','match','filter','indexOf','buildExpression','operator','$eq','value','includes','$gt','$lte','add','days','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0x6d1d,0x100));var _0xd6d1=function(_0x32e2c6,_0x47dae9){_0x32e2c6=_0x32e2c6-0x0;var _0x2f1250=_0x6d1d[_0x32e2c6];return _0x2f1250;};'use strict';var _=require(_0xd6d1('0x0'));var moment=require(_0xd6d1('0x1'));exports[_0xd6d1('0x2')]=function(_0x11a925){var _0x4b7031={'conditions':[]};_0x4b7031['sqlOperator']=_[_0xd6d1('0x3')](_0x11a925,_0xd6d1('0x4'))?'or':'and';var _0x4bae7e=_0x11a925['replace'](_0xd6d1('0x5'),'')[_0xd6d1('0x6')](_0xd6d1('0x4'),'')[_0xd6d1('0x7')]('||');for(var _0x47ecf9=0x0;_0x47ecf9<_0x4bae7e[_0xd6d1('0x8')];_0x47ecf9++){var _0x1d905f=_0x4bae7e[_0x47ecf9][_0xd6d1('0x7')](':=');var _0x4bf5b5=_0x1d905f[0x0];var _0x46511c=_0x1d905f[_0xd6d1('0x9')](0x1);_0x46511c[_0xd6d1('0xa')](function(_0x48edb4){var _0x1ef171=_0x48edb4['split']('[')[_0xd6d1('0xb')]();var _0x5176fb=_0x48edb4[_0xd6d1('0xc')](/\[(.*?)\]/g);_0x5176fb[_0xd6d1('0xa')](function(_0x47e973){var _0x525227=_0x47e973[_0xd6d1('0x7')]('[')[_0xd6d1('0xd')](function(_0xa636fa){return _0xa636fa[_0xd6d1('0xe')](']')>-0x1;})['map'](function(_0x2303bf){return _0x2303bf[_0xd6d1('0x7')](']')[0x0];})[0x0];_0x4b7031['conditions']['push']({'field':_0x4bf5b5,'operator':_0x1ef171,'value':_0x525227});});});}return _0x4b7031;};exports[_0xd6d1('0xf')]=function(_0x1d8515,_0x3ee50c,_0x3f8ea9){var _0x52ecf5={};if(_0x3ee50c==='DATE'){if(_0x3f8ea9[_0xd6d1('0x10')]===_0xd6d1('0x11')){_0x3f8ea9['operator']='$between';_0x3f8ea9[_0xd6d1('0x12')]+=','+_0x3f8ea9['value'];}else if(_[_0xd6d1('0x13')]([_0xd6d1('0x14'),_0xd6d1('0x15')],_0x3f8ea9[_0xd6d1('0x10')])){_0x3f8ea9[_0xd6d1('0x12')]=moment(_0x3f8ea9[_0xd6d1('0x12')])[_0xd6d1('0x16')](0x1,_0xd6d1('0x17'))['format'](_0xd6d1('0x18'));}}if(_0x3f8ea9[_0xd6d1('0x19')]){_0x3ee50c=_0x3f8ea9[_0xd6d1('0x19')];_0x52ecf5['text']=_0xd6d1('0x1a')+_0x1d8515+'.'+_0x3f8ea9[_0xd6d1('0x1b')]+_0xd6d1('0x1c')+_0x3f8ea9[_0xd6d1('0x19')]+')\x20'+parseOperator(_0x3f8ea9['operator']);}else{_0x52ecf5[_0xd6d1('0x1d')]=_0x1d8515+'.'+_0x3f8ea9[_0xd6d1('0x1b')]+'\x20'+parseOperator(_0x3f8ea9['operator']);}if(_[_0xd6d1('0x13')]([_0xd6d1('0x1e'),'$notIn'],_0x3f8ea9[_0xd6d1('0x10')]))_0x52ecf5[_0xd6d1('0x1d')]='('+_0x52ecf5['text']+_0xd6d1('0x1f')+_0x1d8515+'.'+_0x3f8ea9[_0xd6d1('0x1b')]+_0xd6d1('0x20');_0x52ecf5['value']=parseValue(_0x3ee50c,_0x3f8ea9[_0xd6d1('0x10')],_0x3f8ea9[_0xd6d1('0x12')]);return _0x52ecf5;};function parseOperator(_0x566576){var _0x21b5fb;switch(_0x566576){case _0xd6d1('0x21'):_0x21b5fb=_0xd6d1('0x22');break;case'$notIn':_0x21b5fb=_0xd6d1('0x23');break;case _0xd6d1('0x11'):_0x21b5fb=_0xd6d1('0x24');break;case'$ne':_0x21b5fb=_0xd6d1('0x25');break;case _0xd6d1('0x26'):case _0xd6d1('0x27'):case _0xd6d1('0x28'):_0x21b5fb=_0xd6d1('0x29');break;case'$lt':_0x21b5fb='<\x20?';break;case _0xd6d1('0x14'):_0x21b5fb=_0xd6d1('0x2a');break;case _0xd6d1('0x15'):_0x21b5fb=_0xd6d1('0x2b');break;case _0xd6d1('0x2c'):_0x21b5fb=_0xd6d1('0x2d');break;case _0xd6d1('0x2e'):_0x21b5fb=_0xd6d1('0x2f');break;}return _0x21b5fb;}function parseValue(_0x3141d2,_0x6e417c,_0x90b8bc){var _0x1c1d05={'start':undefined,'end':undefined};switch(_0x6e417c){case _0xd6d1('0x21'):case _0xd6d1('0x30'):_0x1c1d05[_0xd6d1('0x31')]=_0x90b8bc['split'](',');break;case _0xd6d1('0x26'):_0x1c1d05[_0xd6d1('0x31')]='%'+_0x90b8bc+'%';break;case _0xd6d1('0x27'):_0x1c1d05['start']=_0x90b8bc+'%';break;case _0xd6d1('0x28'):_0x1c1d05['start']='%'+_0x90b8bc;break;case _0xd6d1('0x2e'):var _0x1c5328=_0x90b8bc['split'](',');var _0x90b8bc=_0x1c5328['shift']();var _0x654b0e=_0x1c5328[_0xd6d1('0x32')]();if(_0x3141d2===_0xd6d1('0x33')){_0x90b8bc=moment(_0x90b8bc)['utcOffset'](0x0,!![])[_0xd6d1('0x34')]();_0x654b0e=moment(_0x654b0e)[_0xd6d1('0x35')](0x0,!![])[_0xd6d1('0x16')](0x17,_0xd6d1('0x36'))[_0xd6d1('0x16')](0x3b,_0xd6d1('0x37'))[_0xd6d1('0x16')](0x3b,_0xd6d1('0x38'))[_0xd6d1('0x34')]();}_0x1c1d05={'start':_0x90b8bc,'end':_0x654b0e};break;default:_0x1c1d05[_0xd6d1('0x31')]=_0x90b8bc;break;}return _0x1c1d05;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index fce2ece..d32c779 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 _0x032e=['isEmpty','forOwn','find','type','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','map','indexOf','priority','cast','unsigned','substr','DESC','col','length','omit','isObject','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','forEach','replace','push','join','query','$id','intersection','model','attributes','nolimit','offset','order','sort','pick','object','filter','where','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','includes','fields','split','filters'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x032e,0x124));var _0xe032=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x032e[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xe032('0x0'));var sequelize=require('sequelize');var moment=require(_0xe032('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1cf95c){var _0x5ca562=['ne'];try{var _0x4afba2=JSON[_0xe032('0x2')](_0x1cf95c);var _0x2ce001=Object[_0xe032('0x3')](_0x4afba2)[0x0];return _0x5ca562[_0xe032('0x4')](_0x2ce001);}catch(_0x306f3d){return![];}}function getOperatorValue(_0x420020){var _0x2ba8a0=JSON[_0xe032('0x2')](_0x420020);var _0x37432f=Object[_0xe032('0x3')](_0x2ba8a0)[0x0];var _0x3289b0=_0x2ba8a0[_0x37432f];return{['$'+_0x37432f]:_0x3289b0};}exports[_0xe032('0x5')]=function(_0xaf3907){var _0x3b0ef8=null;if(_0xaf3907){_0x3b0ef8=_0xaf3907[_0xe032('0x6')](',');}return _0x3b0ef8;};exports[_0xe032('0x7')]=function(_0x2dc9e5,_0x167bd9){var _0x4aec53={};if(!_[_0xe032('0x8')](_0x2dc9e5)){_[_0xe032('0x9')](_0x2dc9e5,function(_0x13c126,_0x42e2ba){try{if(_0x167bd9){var _0x244f93=_[_0xe032('0xa')](_0x167bd9,{'name':_0x42e2ba})||{};if(hasSequelizeOperator(_0x13c126)){_0x4aec53[_0x42e2ba]=getOperatorValue(_0x13c126);}else if(_0x244f93[_0xe032('0xb')]==='DATE'&&_[_0xe032('0xc')](_0x13c126)){var _0x266d71=JSON[_0xe032('0x2')](_0x13c126);var _0x1a53ab={'$gte':moment(moment(_0x266d71['$gte'])[_0xe032('0xd')](_0xe032('0xe')))[_0xe032('0xf')]()[_0xe032('0xd')](),'$lte':moment(moment(_0x266d71[_0xe032('0x10')])[_0xe032('0xd')](_0xe032('0xe')))['utc']()[_0xe032('0x11')](0x1,'s')[_0xe032('0xd')]()};_0x4aec53[_0x42e2ba]=_0x1a53ab;}else if(_0x244f93[_0xe032('0x12')]===_0xe032('0x13')){_0x4aec53[_0x42e2ba]=_0x13c126;}else{_0x4aec53[_0x42e2ba]=_[_0xe032('0x14')](_0x13c126)?_0x13c126:JSON[_0xe032('0x2')](_0x13c126);}}else{_0x4aec53[_0x42e2ba]=_['isArray'](_0x13c126)?_0x13c126:JSON[_0xe032('0x2')](_0x13c126);}}catch(_0x25cedb){_0x4aec53[_0x42e2ba]=_0x13c126[_0xe032('0x6')](',');}});}return _0x4aec53;};exports[_0xe032('0x15')]=function(_0x208c47){_0x208c47=parseInt(_0x208c47,0xa);if(!_0x208c47||_0x208c47<0x0){_0x208c47=LIMIT_VALUE;}return _0x208c47;};exports['offset']=function(_0x4b644b){_0x4b644b=parseInt(_0x4b644b,0xa);if(!_0x4b644b||_0x4b644b<0x0){_0x4b644b=0x0;}return _0x4b644b;};exports['sort']=function(_0x15475c){var _0x505d8c,_0x46dc27=null;if(_0x15475c){_0x505d8c=_0x15475c[_0xe032('0x6')](',');_0x46dc27=_[_0xe032('0x16')](_0x505d8c,function(_0x2aa342){if(_0x2aa342[_0xe032('0x17')]('-')===0x0){return[_0x2aa342===_0xe032('0x18')?sequelize[_0xe032('0x19')](sequelize['col'](_0xe032('0x18')),_0xe032('0x1a')):_0x2aa342[_0xe032('0x1b')](0x1),_0xe032('0x1c')];}else{return[_0x2aa342===_0xe032('0x18')?sequelize[_0xe032('0x19')](sequelize[_0xe032('0x1d')](_0xe032('0x18')),'unsigned'):_0x2aa342,'ASC'];}});}return _0x46dc27;};exports['omit']=function(_0x4ef536,_0x2568ce){if(_[_0xe032('0x8')](_0x4ef536)){return _0x4ef536;}if(_[_0xe032('0x14')](_0x4ef536)){for(var _0x2bfe8f=0x0;_0x2bfe8f<_0x4ef536[_0xe032('0x1e')];_0x2bfe8f+=0x1){_0x4ef536[_0x2bfe8f]=this[_0xe032('0x1f')](_0x4ef536[_0x2bfe8f],_0x2568ce);}return _0x4ef536;}if(!_[_0xe032('0x20')](_0x4ef536)){return _0x4ef536;}if(_[_0xe032('0x21')](_0x2568ce)){_0x2568ce=[_0x2568ce];}if(!_[_0xe032('0x14')](_0x2568ce)){return _0x4ef536;}for(var _0x5bb36a=0x0;_0x5bb36a<_0x2568ce[_0xe032('0x1e')];_0x5bb36a+=0x1){_[_0xe032('0x22')](_0x4ef536,_0x2568ce[_0x5bb36a]);}for(var _0x3106aa in _0x4ef536){if(_0x4ef536[_0xe032('0x23')](_0x3106aa)){_0x4ef536[_0x3106aa]=this['omit'](_0x4ef536[_0x3106aa],_0x2568ce);}}return _0x4ef536;};exports['isNumeric']=function(_0x3e2575){return _0x3e2575[_0xe032('0x24')](RegExp(_0xe032('0x25')))?!![]:![];};exports[_0xe032('0x26')]=function(_0x4e8b72){return _0x4e8b72['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x42ec95){var _0x1dd34f=[];_0x42ec95[_0xe032('0x6')](/[ ,]+/)[_0xe032('0x27')](function(_0x50db2d){_0x50db2d=_0x50db2d[_0xe032('0x28')](/([^:]")"+/g,'$1');_0x50db2d='+'+_0x50db2d+'*';var _0x236da9=/[ `!@#$%^&*()_\-?~]/;if(_0x50db2d[_0xe032('0x24')](_0x236da9))_0x50db2d='\x22'+_0x50db2d+'\x22';_0x1dd34f[_0xe032('0x29')](_0x50db2d);});return _0x1dd34f[_0xe032('0x2a')]('\x20');};exports['getOptions']=function(_0xd90bd5,_0x33634c,_0x319a2f){var _0x2cc18c={},_0x522bdc={};if(_0x33634c[_0xe032('0x2b')]['$id']){_0x33634c[_0xe032('0x2b')]['id']=_0x33634c['query'][_0xe032('0x2c')];delete _0x33634c['query'][_0xe032('0x2c')];}_0x2cc18c['model']=_[_0xe032('0x16')](_0xd90bd5,_0xe032('0x12'));_0x2cc18c['query']=_[_0xe032('0x3')](_0x33634c[_0xe032('0x2b')]);_0x2cc18c[_0xe032('0x7')]=_[_0xe032('0x2d')](_0x2cc18c['model'],_0x2cc18c[_0xe032('0x2b')]);_0x522bdc['attributes']=_[_0xe032('0x2d')](_0x2cc18c[_0xe032('0x2e')],this['fields'](_0x33634c[_0xe032('0x2b')][_0xe032('0x5')]));_0x522bdc['attributes']=_0x522bdc[_0xe032('0x2f')][_0xe032('0x1e')]?_0x522bdc[_0xe032('0x2f')]:_0x2cc18c[_0xe032('0x2e')];if(!_0x33634c[_0xe032('0x2b')][_0xe032('0x23')](_0xe032('0x30'))){_0x522bdc[_0xe032('0x15')]=this[_0xe032('0x15')](_0x33634c[_0xe032('0x2b')][_0xe032('0x15')]);_0x522bdc[_0xe032('0x31')]=this[_0xe032('0x31')](_0x33634c[_0xe032('0x2b')][_0xe032('0x31')]);}_0x522bdc[_0xe032('0x32')]=this[_0xe032('0x33')](_0x33634c['query'][_0xe032('0x33')]);_0x522bdc['where']=this[_0xe032('0x7')](_[_0xe032('0x34')](_0x33634c[_0xe032('0x2b')],_0x2cc18c[_0xe032('0x7')]),_0xd90bd5);if(_0x33634c[_0xe032('0x2b')]['filter']){var _0x132d25=_0xd90bd5;var _0x55688b=_0x33634c[_0xe032('0x2b')]['filter'];if(typeof _0x55688b===_0xe032('0x35')){_0x132d25=_[_0xe032('0x36')](_0xd90bd5,function(_0x2644a1){return _[_0xe032('0x4')](_0x55688b['columns'],_0x2644a1[_0xe032('0x12')]);});_0x55688b=_0x55688b['value'];}_0x522bdc[_0xe032('0x37')]=_[_0xe032('0x38')](_0x522bdc[_0xe032('0x37')],{'$or':_[_0xe032('0x16')](_0x132d25,function(_0x4b58eb){if(_0x4b58eb['type']!==_0xe032('0x39')){if(_0x319a2f){return sequelize[_0xe032('0x37')](sequelize['fn']('lower',sequelize[_0xe032('0x1d')](_0x4b58eb[_0xe032('0x12')])),{'$like':sequelize['fn'](_0xe032('0x3a'),'%'+_0x33634c[_0xe032('0x2b')][_0xe032('0x36')]+'%')});}else{var _0x4dafef={};_0x4dafef[_0x4b58eb[_0xe032('0x12')]]={'$like':'%'+_0x33634c[_0xe032('0x2b')][_0xe032('0x36')]+'%'};return _0x4dafef;}}})});}_0x522bdc=_[_0xe032('0x38')]({},_0x522bdc,_0x33634c[_0xe032('0x3b')]);return _0x522bdc;}; \ No newline at end of file +var _0x7bae=['omit','isObject','isString','length','unset','match','^[+]?[0-9]*$','getFullTextValue','replace','getOptions','query','$id','model','name','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filter','object','columns','merge','type','VIRTUAL','lower','options','moment','keys','includes','parse','fields','split','isEmpty','forOwn','find','DATE','$gte','format','YYYY-MM-DD','$lte','subtract','isArray','limit','offset','sort','map','indexOf','priority','col','unsigned','substr','DESC','cast'];(function(_0x38e595,_0x345259){var _0x3aad63=function(_0x41c02b){while(--_0x41c02b){_0x38e595['push'](_0x38e595['shift']());}};_0x3aad63(++_0x345259);}(_0x7bae,0x13b));var _0xe7ba=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x7bae[_0x160c73];return _0xd9302;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xe7ba('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1e05c4){var _0x503803=['ne'];try{var _0x3963c7=JSON['parse'](_0x1e05c4);var _0x120efa=Object[_0xe7ba('0x1')](_0x3963c7)[0x0];return _0x503803[_0xe7ba('0x2')](_0x120efa);}catch(_0x2276df){return![];}}function getOperatorValue(_0x398a6a){var _0xfd3a22=JSON[_0xe7ba('0x3')](_0x398a6a);var _0x3c5e59=Object[_0xe7ba('0x1')](_0xfd3a22)[0x0];var _0x34fb18=_0xfd3a22[_0x3c5e59];return{['$'+_0x3c5e59]:_0x34fb18};}exports[_0xe7ba('0x4')]=function(_0x27b1d5){var _0x41c39d=null;if(_0x27b1d5){_0x41c39d=_0x27b1d5[_0xe7ba('0x5')](',');}return _0x41c39d;};exports['filters']=function(_0x3df8bf,_0xe57e33){var _0x375ebb={};if(!_[_0xe7ba('0x6')](_0x3df8bf)){_[_0xe7ba('0x7')](_0x3df8bf,function(_0x1672f0,_0x99a86f){try{if(_0xe57e33){var _0x448bcc=_[_0xe7ba('0x8')](_0xe57e33,{'name':_0x99a86f})||{};if(hasSequelizeOperator(_0x1672f0)){_0x375ebb[_0x99a86f]=getOperatorValue(_0x1672f0);}else if(_0x448bcc['type']===_0xe7ba('0x9')&&_['isPlainObject'](_0x1672f0)){var _0x602b1=JSON[_0xe7ba('0x3')](_0x1672f0);var _0x390596={'$gte':moment(moment(_0x602b1[_0xe7ba('0xa')])[_0xe7ba('0xb')](_0xe7ba('0xc')))['utc']()['format'](),'$lte':moment(moment(_0x602b1[_0xe7ba('0xd')])[_0xe7ba('0xb')](_0xe7ba('0xc')))['utc']()[_0xe7ba('0xe')](0x1,'s')['format']()};_0x375ebb[_0x99a86f]=_0x390596;}else if(_0x448bcc['name']==='uniqueid'){_0x375ebb[_0x99a86f]=_0x1672f0;}else{_0x375ebb[_0x99a86f]=_[_0xe7ba('0xf')](_0x1672f0)?_0x1672f0:JSON['parse'](_0x1672f0);}}else{_0x375ebb[_0x99a86f]=_[_0xe7ba('0xf')](_0x1672f0)?_0x1672f0:JSON['parse'](_0x1672f0);}}catch(_0x4e3021){_0x375ebb[_0x99a86f]=_0x1672f0['split'](',');}});}return _0x375ebb;};exports[_0xe7ba('0x10')]=function(_0x30086c){_0x30086c=parseInt(_0x30086c,0xa);if(!_0x30086c||_0x30086c<0x0){_0x30086c=LIMIT_VALUE;}return _0x30086c;};exports[_0xe7ba('0x11')]=function(_0x3c06c3){_0x3c06c3=parseInt(_0x3c06c3,0xa);if(!_0x3c06c3||_0x3c06c3<0x0){_0x3c06c3=0x0;}return _0x3c06c3;};exports[_0xe7ba('0x12')]=function(_0x58550c){var _0x149c62,_0x20c653=null;if(_0x58550c){_0x149c62=_0x58550c[_0xe7ba('0x5')](',');_0x20c653=_[_0xe7ba('0x13')](_0x149c62,function(_0x4aaf35){if(_0x4aaf35[_0xe7ba('0x14')]('-')===0x0){return[_0x4aaf35===_0xe7ba('0x15')?sequelize['cast'](sequelize[_0xe7ba('0x16')](_0xe7ba('0x15')),_0xe7ba('0x17')):_0x4aaf35[_0xe7ba('0x18')](0x1),_0xe7ba('0x19')];}else{return[_0x4aaf35===_0xe7ba('0x15')?sequelize[_0xe7ba('0x1a')](sequelize[_0xe7ba('0x16')](_0xe7ba('0x15')),_0xe7ba('0x17')):_0x4aaf35,'ASC'];}});}return _0x20c653;};exports['omit']=function(_0x4dcc7b,_0x4cd124){if(_[_0xe7ba('0x6')](_0x4dcc7b)){return _0x4dcc7b;}if(_['isArray'](_0x4dcc7b)){for(var _0x4ecc0d=0x0;_0x4ecc0d<_0x4dcc7b['length'];_0x4ecc0d+=0x1){_0x4dcc7b[_0x4ecc0d]=this[_0xe7ba('0x1b')](_0x4dcc7b[_0x4ecc0d],_0x4cd124);}return _0x4dcc7b;}if(!_[_0xe7ba('0x1c')](_0x4dcc7b)){return _0x4dcc7b;}if(_[_0xe7ba('0x1d')](_0x4cd124)){_0x4cd124=[_0x4cd124];}if(!_[_0xe7ba('0xf')](_0x4cd124)){return _0x4dcc7b;}for(var _0x3435c6=0x0;_0x3435c6<_0x4cd124[_0xe7ba('0x1e')];_0x3435c6+=0x1){_[_0xe7ba('0x1f')](_0x4dcc7b,_0x4cd124[_0x3435c6]);}for(var _0x3a59d6 in _0x4dcc7b){if(_0x4dcc7b['hasOwnProperty'](_0x3a59d6)){_0x4dcc7b[_0x3a59d6]=this[_0xe7ba('0x1b')](_0x4dcc7b[_0x3a59d6],_0x4cd124);}}return _0x4dcc7b;};exports['isNumeric']=function(_0x102925){return _0x102925[_0xe7ba('0x20')](RegExp(_0xe7ba('0x21')))?!![]:![];};exports['isEmail']=function(_0x587c7d){return _0x587c7d[_0xe7ba('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0xe7ba('0x22')]=function(_0x8d5020){var _0x20b6cd=[];_0x8d5020[_0xe7ba('0x5')](/[ ,]+/)['forEach'](function(_0x37911d){_0x37911d=_0x37911d[_0xe7ba('0x23')](/([^:]")"+/g,'$1');_0x37911d='+'+_0x37911d+'*';var _0x5b5ff3=/[ `!@#$%^&*()_\-?~]/;if(_0x37911d[_0xe7ba('0x20')](_0x5b5ff3))_0x37911d='\x22'+_0x37911d+'\x22';_0x20b6cd['push'](_0x37911d);});return _0x20b6cd['join']('\x20');};exports[_0xe7ba('0x24')]=function(_0x134f21,_0x1be947,_0x52f90e){var _0x3b14b4={},_0x4ccdc7={};if(_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x26')]){_0x1be947[_0xe7ba('0x25')]['id']=_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x26')];delete _0x1be947['query'][_0xe7ba('0x26')];}_0x3b14b4[_0xe7ba('0x27')]=_['map'](_0x134f21,_0xe7ba('0x28'));_0x3b14b4[_0xe7ba('0x25')]=_[_0xe7ba('0x1')](_0x1be947['query']);_0x3b14b4[_0xe7ba('0x29')]=_[_0xe7ba('0x2a')](_0x3b14b4['model'],_0x3b14b4[_0xe7ba('0x25')]);_0x4ccdc7[_0xe7ba('0x2b')]=_[_0xe7ba('0x2a')](_0x3b14b4['model'],this[_0xe7ba('0x4')](_0x1be947[_0xe7ba('0x25')]['fields']));_0x4ccdc7[_0xe7ba('0x2b')]=_0x4ccdc7[_0xe7ba('0x2b')][_0xe7ba('0x1e')]?_0x4ccdc7['attributes']:_0x3b14b4['model'];if(!_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x2c')](_0xe7ba('0x2d'))){_0x4ccdc7[_0xe7ba('0x10')]=this[_0xe7ba('0x10')](_0x1be947['query'][_0xe7ba('0x10')]);_0x4ccdc7[_0xe7ba('0x11')]=this[_0xe7ba('0x11')](_0x1be947[_0xe7ba('0x25')]['offset']);}_0x4ccdc7[_0xe7ba('0x2e')]=this[_0xe7ba('0x12')](_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x12')]);_0x4ccdc7[_0xe7ba('0x2f')]=this[_0xe7ba('0x29')](_[_0xe7ba('0x30')](_0x1be947['query'],_0x3b14b4[_0xe7ba('0x29')]),_0x134f21);if(_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x31')]){var _0x401b0a=_0x134f21;var _0xf61205=_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x31')];if(typeof _0xf61205===_0xe7ba('0x32')){_0x401b0a=_[_0xe7ba('0x31')](_0x134f21,function(_0x50792c){return _[_0xe7ba('0x2')](_0xf61205[_0xe7ba('0x33')],_0x50792c['name']);});_0xf61205=_0xf61205['value'];}_0x4ccdc7[_0xe7ba('0x2f')]=_[_0xe7ba('0x34')](_0x4ccdc7[_0xe7ba('0x2f')],{'$or':_['map'](_0x401b0a,function(_0x249e1d){if(_0x249e1d[_0xe7ba('0x35')]!==_0xe7ba('0x36')){if(_0x52f90e){return sequelize[_0xe7ba('0x2f')](sequelize['fn'](_0xe7ba('0x37'),sequelize['col'](_0x249e1d[_0xe7ba('0x28')])),{'$like':sequelize['fn']('lower','%'+_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x31')]+'%')});}else{var _0xe0f1c3={};_0xe0f1c3[_0x249e1d[_0xe7ba('0x28')]]={'$like':'%'+_0x1be947[_0xe7ba('0x25')][_0xe7ba('0x31')]+'%'};return _0xe0f1c3;}}})});}_0x4ccdc7=_[_0xe7ba('0x34')]({},_0x4ccdc7,_0x1be947[_0xe7ba('0x38')]);return _0x4ccdc7;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 8dd3830..ff9f43b 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 _0xb7cf=['faxCurrentCapacity','mailStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','client','http','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','length','idle','unknown','unavailable','ringing','voiceStatus','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','*pause','busy','getAgentStatus','isArray','Queue','findOne','all','flatten','map','uniq','value','getAgentIdsByQueues','filter','includes','getAgentIdsByStatus','resolve','findAll','chatPause','pauseType','find','merge','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname','internal','substring','sort','toLowerCase','userpic','online','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity'];(function(_0x4b7e4d,_0x82d2ab){var _0x38d6af=function(_0x227432){while(--_0x227432){_0x4b7e4d['push'](_0x4b7e4d['shift']());}};_0x38d6af(++_0x82d2ab);}(_0xb7cf,0xcb));var _0xfb7c=function(_0x1c53e1,_0x2f11a8){_0x1c53e1=_0x1c53e1-0x0;var _0x1f5b1f=_0xb7cf[_0x1c53e1];return _0x1f5b1f;};'use strict';var _=require('lodash');var jayson=require(_0xfb7c('0x0'));var db=require(_0xfb7c('0x1'))['db'];var amiClient=jayson[_0xfb7c('0x2')][_0xfb7c('0x3')]({'port':0x232a});var routingClient=jayson[_0xfb7c('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x3f9e56,_0x4b6f20){var _0x55675d=[_0x3f9e56['chatPause'],_0x3f9e56[_0xfb7c('0x4')],_0x3f9e56[_0xfb7c('0x5')],_0x3f9e56[_0xfb7c('0x6')],_0x3f9e56[_0xfb7c('0x7')],_0x3f9e56[_0xfb7c('0x8')],_0x3f9e56[_0xfb7c('0x9')]];if(!_0x4b6f20)return _[_0xfb7c('0xa')](_0x55675d);var _0x43ce2d=_['filter'](_0x55675d);return _0x43ce2d[_0xfb7c('0xb')]>0x0&&_0x43ce2d['length']<_0x55675d['length']?!![]:![];}function isIdle(_0x1fa33d){return _0x1fa33d===_0xfb7c('0xc')||_0x1fa33d===_0xfb7c('0xd')||_0x1fa33d===_0xfb7c('0xe')||_0x1fa33d===_0xfb7c('0xf')||_['isNil'](_0x1fa33d);}function isAgentIdle(_0x518ff5){if(_0x518ff5[_0xfb7c('0x10')]!=='idle'&&_0x518ff5[_0xfb7c('0x8')]){_0x518ff5[_0xfb7c('0x10')]=_0xfb7c('0x11');return![];}return _[_0xfb7c('0xa')]([_0x518ff5[_0xfb7c('0x12')],_0x518ff5[_0xfb7c('0x13')],_0x518ff5['mailStatus'],_0x518ff5[_0xfb7c('0x14')],_0x518ff5[_0xfb7c('0x15')],_0x518ff5['voiceStatus'],_0x518ff5['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xfb7c('0x16')](_0xfb7c('0x17'),{})[_0xfb7c('0x18')](function(_0x362b7c){if(_0x362b7c['error']){throw new Error(_0xfb7c('0x19'));}var _0x177fda=_0x362b7c[_0xfb7c('0x1a')];return routingClient[_0xfb7c('0x16')](_0xfb7c('0x17'),{})[_0xfb7c('0x18')](function(_0x2901c9){if(_0x2901c9[_0xfb7c('0x1b')]){throw new Error(_0xfb7c('0x1c'));}var _0x469986=_0x2901c9['result'];return _['merge']({},_0x177fda,_0x469986);});})[_0xfb7c('0x1d')](function(_0x55d7d6){throw _0x55d7d6;});}exports[_0xfb7c('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x3cc7d0){var _0x6126fc=_0xfb7c('0xd');if(isAgentPaused(_0x3cc7d0))_0x6126fc='pause';else if(isAgentPaused(_0x3cc7d0,!![]))_0x6126fc=_0xfb7c('0x1f');else if(isAgentIdle(_0x3cc7d0))_0x6126fc=_0xfb7c('0xc');else _0x6126fc=_0xfb7c('0x20');return _0x6126fc;}exports[_0xfb7c('0x21')]=getAgentStatus;function getAgentIdsByQueues(_0x2072af,_0x17383e){var _0x388d8f=_[_0xfb7c('0x22')](_0x2072af)?_0x2072af:[_0x2072af];var _0x203dc5=_['startCase'](_0x17383e)+_0xfb7c('0x23');var _0x394599=_['map'](_0x388d8f,function(_0x21a36f){return db[_0x203dc5][_0xfb7c('0x24')]({'where':{'id':_0x21a36f}})[_0xfb7c('0x18')](function(_0x2e859c){if(!_0x2e859c)return[];return _0x2e859c['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0xfb7c('0x25')](_0x394599)[_0xfb7c('0x18')](function(_0x4b33c0){var _0x5554c4=_(_0x4b33c0)[_0xfb7c('0x26')]()[_0xfb7c('0x27')]('id')[_0xfb7c('0x28')]()[_0xfb7c('0x29')]();return _0x5554c4;});}exports[_0xfb7c('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5eefe9,_0x3706fa,_0xd48bbf){try{if(_0x3706fa[_0xfb7c('0xb')]>0x0){_0x5eefe9=_0x5eefe9[_0xfb7c('0x2b')](function(_0x350aa5){return _0x3706fa[_0xfb7c('0x2c')](_0x350aa5['id']);});}var _0x1e6fc8=_0x5eefe9['filter'](function(_0x415ea5){var _0x390104=_0xfb7c('0x20');if(isAgentIdle(_0x415ea5)){_0x390104='idle';}return _0x390104===_0xd48bbf;});return _[_0xfb7c('0x27')](_0x1e6fc8,'id');}catch(_0x2d360d){throw _0x2d360d;}}exports[_0xfb7c('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x10c944,_0xde37fe,_0x38d248){return Promise[_0xfb7c('0x2e')]()['then'](function(){if(_0xde37fe['length']>0x0){_0x10c944=_0x10c944['filter'](function(_0x50d5d1){return _0xde37fe['includes'](_0x50d5d1['id']);});}return _0x10c944;})[_0xfb7c('0x18')](function(){return db['User'][_0xfb7c('0x2f')]({'attributes':['id','name','fullname',_0xfb7c('0x30'),_0xfb7c('0x4'),'mailPause',_0xfb7c('0x6'),'smsPause','voicePause',_0xfb7c('0x9'),_0xfb7c('0x31')],'where':{'id':{'$in':_[_0xfb7c('0x27')](_0x10c944,'id')}},'raw':!![]});})['then'](function(_0x5cba44){return _0x5cba44['map'](function(_0x51c9f8){var _0x4375f9=_[_0xfb7c('0x32')](_0x10c944,['id',_0x51c9f8['id']]);var _0x46abfd=filterAgentAttributes(_0x4375f9);_[_0xfb7c('0x33')](_0x51c9f8,_0x46abfd);_0x51c9f8[_0xfb7c('0x34')]=getAgentStatus(_0x51c9f8);return _0x51c9f8;});})['then'](function(_0x4a4205){var _0x3984db=sortAgentsByStatus(_0x4a4205,_0x38d248);return _[_0xfb7c('0x27')](_0x3984db,'id');})[_0xfb7c('0x1d')](function(_0x24d985){throw _0x24d985;});}exports[_0xfb7c('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0xf57e6c){var _0x4b2d6b={'fields':[],'order':null};var _0x36788c=_0xf57e6c[_0xfb7c('0x36')](',');_0x4b2d6b[_0xfb7c('0x37')]=_[_0xfb7c('0x2b')](_0x36788c,function(_0x52cdb1){if(!_0x52cdb1[_0xfb7c('0x2c')](_0xfb7c('0x34'))){return!![];}_0x4b2d6b[_0xfb7c('0x38')]=_[_0xfb7c('0x39')](_0x52cdb1,'-')?_0xfb7c('0x3a'):_0xfb7c('0x3b');return![];});return _0x4b2d6b;}exports[_0xfb7c('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x55a8b2){if(_0x55a8b2[_0xfb7c('0x2c')](_0xfb7c('0x3d'))&&!_0x55a8b2[_0xfb7c('0x2c')](_0xfb7c('0x3e'))){var _0x30cbba=_0x55a8b2[_0xfb7c('0x3f')](0x0,_0x55a8b2['indexOf']('fullname'));_0x55a8b2+=','+_0x30cbba+_0xfb7c('0x3e');}return _0x55a8b2;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x48261d,_0x231d47){var _0x206f02=_0x48261d[_0xfb7c('0x40')](function(_0x57e89b,_0x3392b2){if(_0x57e89b['globalStatus']===_0x3392b2['globalStatus']){if(_0x57e89b[_0xfb7c('0x34')]==='pause'){if(_0x231d47===_0xfb7c('0x3a')){return(_0x57e89b[_0xfb7c('0x31')]||'')<(_0x3392b2[_0xfb7c('0x31')]||'')||_0x57e89b[_0xfb7c('0x3d')][_0xfb7c('0x41')]()>_0x3392b2[_0xfb7c('0x3d')][_0xfb7c('0x41')]()?0x1:-0x1;}else{return(_0x57e89b[_0xfb7c('0x31')]||'')<(_0x3392b2[_0xfb7c('0x31')]||'')||_0x57e89b[_0xfb7c('0x3d')][_0xfb7c('0x41')]()>_0x3392b2['fullname'][_0xfb7c('0x41')]()?-0x1:0x1;}}else{if(_0x231d47===_0xfb7c('0x3a')){return _0x57e89b['fullname'][_0xfb7c('0x41')]()<_0x3392b2[_0xfb7c('0x3d')][_0xfb7c('0x41')]()?0x1:-0x1;}else{return _0x57e89b[_0xfb7c('0x3d')]['toLowerCase']()<_0x3392b2[_0xfb7c('0x3d')][_0xfb7c('0x41')]()?-0x1:0x1;}}}else{if(_0x231d47===_0xfb7c('0x3a')){return _0x57e89b[_0xfb7c('0x34')]<_0x3392b2['globalStatus']?0x1:-0x1;}else{return _0x57e89b[_0xfb7c('0x34')]<_0x3392b2[_0xfb7c('0x34')]?-0x1:0x1;}}});return _0x206f02;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x46b69a){var _0x5d0ea5=[_0xfb7c('0x42'),_0xfb7c('0x43'),'lastLoginAt',_0xfb7c('0x44'),_0xfb7c('0x31'),'lastPauseAt','internal',_0xfb7c('0x45'),_0xfb7c('0x30'),'openchannelPause','mailPause',_0xfb7c('0x7'),_0xfb7c('0x9'),_0xfb7c('0x4'),'voicePause',_0xfb7c('0x46'),_0xfb7c('0x47'),_0xfb7c('0x48'),_0xfb7c('0x49'),_0xfb7c('0x4a'),_0xfb7c('0x4b'),_0xfb7c('0x4c'),_0xfb7c('0x4d'),'mailCurrentCapacity',_0xfb7c('0x4e'),'whatsappCurrentCapacity',_0xfb7c('0x4f'),_0xfb7c('0x12'),_0xfb7c('0x14'),_0xfb7c('0x50'),_0xfb7c('0x15'),_0xfb7c('0x51'),_0xfb7c('0x13'),'voiceStatus',_0xfb7c('0x52'),_0xfb7c('0x53'),_0xfb7c('0x54'),'smsStatusTime',_0xfb7c('0x55'),_0xfb7c('0x56'),_0xfb7c('0x57'),_0xfb7c('0x58'),_0xfb7c('0x59'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0xfb7c('0x5a'),'routealias'];var _0x25a1f5=[_0xfb7c('0x30'),_0xfb7c('0x6'),_0xfb7c('0x5'),_0xfb7c('0x7'),_0xfb7c('0x9'),'faxPause',_0xfb7c('0x8'),'online'];var _0x515d18=_(_0x46b69a)[_0xfb7c('0x5b')](_0x25a1f5)[_0xfb7c('0x5c')](_0x5d0ea5)[_0xfb7c('0x29')]();return _0x515d18;}exports[_0xfb7c('0x5d')]=filterAgentAttributes; \ No newline at end of file +var _0xab2e=['smsStatus','request','Agents','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','merge','catch','unknown','*pause','busy','isArray','findOne','getAgents','all','map','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','DESC','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','mailStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','pick','filterAgentAttributes','jayson/promise','../../mysqldb','client','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','unavailable','isNil','voiceStatus','idle','pause','faxStatus','openchannelStatus'];(function(_0x30dffa,_0x35b080){var _0x2f5d84=function(_0x17dcc9){while(--_0x17dcc9){_0x30dffa['push'](_0x30dffa['shift']());}};_0x2f5d84(++_0x35b080);}(_0xab2e,0x154));var _0xeab2=function(_0xa38daf,_0x30406b){_0xa38daf=_0xa38daf-0x0;var _0x1b786a=_0xab2e[_0xa38daf];return _0x1b786a;};'use strict';var _=require('lodash');var jayson=require(_0xeab2('0x0'));var db=require(_0xeab2('0x1'))['db'];var amiClient=jayson[_0xeab2('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0xeab2('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x3684cf,_0x1750ac){var _0x5b91fe=[_0x3684cf[_0xeab2('0x3')],_0x3684cf[_0xeab2('0x4')],_0x3684cf[_0xeab2('0x5')],_0x3684cf[_0xeab2('0x6')],_0x3684cf[_0xeab2('0x7')],_0x3684cf[_0xeab2('0x8')],_0x3684cf[_0xeab2('0x9')]];if(!_0x1750ac)return _[_0xeab2('0xa')](_0x5b91fe);var _0x1b2489=_[_0xeab2('0xb')](_0x5b91fe);return _0x1b2489[_0xeab2('0xc')]>0x0&&_0x1b2489[_0xeab2('0xc')]<_0x5b91fe[_0xeab2('0xc')]?!![]:![];}function isIdle(_0x226f63){return _0x226f63==='idle'||_0x226f63==='unknown'||_0x226f63===_0xeab2('0xd')||_0x226f63==='ringing'||_[_0xeab2('0xe')](_0x226f63);}function isAgentIdle(_0xed0ee7){if(_0xed0ee7[_0xeab2('0xf')]!==_0xeab2('0x10')&&_0xed0ee7[_0xeab2('0x8')]){_0xed0ee7['voiceStatus']=_0xeab2('0x11');return![];}return _[_0xeab2('0xa')]([_0xed0ee7['chatStatus'],_0xed0ee7[_0xeab2('0x12')],_0xed0ee7['mailStatus'],_0xed0ee7[_0xeab2('0x13')],_0xed0ee7[_0xeab2('0x14')],_0xed0ee7[_0xeab2('0xf')],_0xed0ee7['whatsappStatus']],isIdle);}function getRealtimeAgents(){return amiClient[_0xeab2('0x15')](_0xeab2('0x16'),{})[_0xeab2('0x17')](function(_0x215123){if(_0x215123[_0xeab2('0x18')]){throw new Error(_0xeab2('0x19'));}var _0x36c166=_0x215123[_0xeab2('0x1a')];return routingClient['request']('Agents',{})['then'](function(_0x9aafc8){if(_0x9aafc8[_0xeab2('0x18')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x8722d9=_0x9aafc8['result'];return _[_0xeab2('0x1b')]({},_0x36c166,_0x8722d9);});})[_0xeab2('0x1c')](function(_0x58fdf7){throw _0x58fdf7;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x4adee){var _0x3a3dc9=_0xeab2('0x1d');if(isAgentPaused(_0x4adee))_0x3a3dc9=_0xeab2('0x11');else if(isAgentPaused(_0x4adee,!![]))_0x3a3dc9=_0xeab2('0x1e');else if(isAgentIdle(_0x4adee))_0x3a3dc9='idle';else _0x3a3dc9=_0xeab2('0x1f');return _0x3a3dc9;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x8691ee,_0x582252){var _0x37ea01=_[_0xeab2('0x20')](_0x8691ee)?_0x8691ee:[_0x8691ee];var _0x279b95=_['startCase'](_0x582252)+'Queue';var _0x459f7b=_['map'](_0x37ea01,function(_0x2291c3){return db[_0x279b95][_0xeab2('0x21')]({'where':{'id':_0x2291c3}})['then'](function(_0x11eab1){if(!_0x11eab1)return[];return _0x11eab1[_0xeab2('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xeab2('0x23')](_0x459f7b)[_0xeab2('0x17')](function(_0x354dd6){var _0x4fe5b6=_(_0x354dd6)['flatten']()[_0xeab2('0x24')]('id')[_0xeab2('0x25')]()[_0xeab2('0x26')]();return _0x4fe5b6;});}exports[_0xeab2('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xbbd43f,_0xa34f26,_0x502554){try{if(_0xa34f26[_0xeab2('0xc')]>0x0){_0xbbd43f=_0xbbd43f['filter'](function(_0x1c1b16){return _0xa34f26[_0xeab2('0x28')](_0x1c1b16['id']);});}var _0x4e0d73=_0xbbd43f[_0xeab2('0xb')](function(_0x17c749){var _0x370422=_0xeab2('0x1f');if(isAgentIdle(_0x17c749)){_0x370422='idle';}return _0x370422===_0x502554;});return _[_0xeab2('0x24')](_0x4e0d73,'id');}catch(_0x3e062e){throw _0x3e062e;}}exports[_0xeab2('0x29')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x99d915,_0x13c7b8,_0x37070e){return Promise[_0xeab2('0x2a')]()[_0xeab2('0x17')](function(){if(_0x13c7b8[_0xeab2('0xc')]>0x0){_0x99d915=_0x99d915[_0xeab2('0xb')](function(_0x35224d){return _0x13c7b8['includes'](_0x35224d['id']);});}return _0x99d915;})[_0xeab2('0x17')](function(){return db[_0xeab2('0x2b')][_0xeab2('0x2c')]({'attributes':['id',_0xeab2('0x2d'),_0xeab2('0x2e'),_0xeab2('0x3'),'faxPause',_0xeab2('0x5'),_0xeab2('0x6'),_0xeab2('0x7'),'voicePause','whatsappPause',_0xeab2('0x2f')],'where':{'id':{'$in':_[_0xeab2('0x24')](_0x99d915,'id')}},'raw':!![]});})[_0xeab2('0x17')](function(_0xc25be7){return _0xc25be7[_0xeab2('0x24')](function(_0x4df6d3){var _0x31c147=_[_0xeab2('0x30')](_0x99d915,['id',_0x4df6d3['id']]);var _0x18bc52=filterAgentAttributes(_0x31c147);_['merge'](_0x4df6d3,_0x18bc52);_0x4df6d3[_0xeab2('0x31')]=getAgentStatus(_0x4df6d3);return _0x4df6d3;});})['then'](function(_0x18b61a){var _0x4f70ba=sortAgentsByStatus(_0x18b61a,_0x37070e);return _['map'](_0x4f70ba,'id');})[_0xeab2('0x1c')](function(_0x4c84f4){throw _0x4c84f4;});}exports[_0xeab2('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x349f39){var _0x531d4d={'fields':[],'order':null};var _0x3a1d07=_0x349f39[_0xeab2('0x33')](',');_0x531d4d[_0xeab2('0x34')]=_[_0xeab2('0xb')](_0x3a1d07,function(_0x935636){if(!_0x935636[_0xeab2('0x28')](_0xeab2('0x31'))){return!![];}_0x531d4d['order']=_[_0xeab2('0x35')](_0x935636,'-')?'DESC':'ASC';return![];});return _0x531d4d;}exports[_0xeab2('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x13d6ca){if(_0x13d6ca[_0xeab2('0x28')](_0xeab2('0x2e'))&&!_0x13d6ca[_0xeab2('0x28')](_0xeab2('0x37'))){var _0x2c4410=_0x13d6ca[_0xeab2('0x38')](0x0,_0x13d6ca[_0xeab2('0x39')](_0xeab2('0x2e')));_0x13d6ca+=','+_0x2c4410+_0xeab2('0x37');}return _0x13d6ca;}exports[_0xeab2('0x3a')]=validateSortParameter;function sortAgentsByStatus(_0x536201,_0x5f740d){var _0x4af06c=_0x536201[_0xeab2('0x3b')](function(_0x2f34fe,_0x25831f){if(_0x2f34fe['globalStatus']===_0x25831f[_0xeab2('0x31')]){if(_0x2f34fe[_0xeab2('0x31')]===_0xeab2('0x11')){if(_0x5f740d===_0xeab2('0x3c')){return(_0x2f34fe[_0xeab2('0x2f')]||'')<(_0x25831f['pauseType']||'')||_0x2f34fe['fullname']['toLowerCase']()>_0x25831f[_0xeab2('0x2e')]['toLowerCase']()?0x1:-0x1;}else{return(_0x2f34fe[_0xeab2('0x2f')]||'')<(_0x25831f['pauseType']||'')||_0x2f34fe[_0xeab2('0x2e')]['toLowerCase']()>_0x25831f[_0xeab2('0x2e')][_0xeab2('0x3d')]()?-0x1:0x1;}}else{if(_0x5f740d===_0xeab2('0x3c')){return _0x2f34fe[_0xeab2('0x2e')][_0xeab2('0x3d')]()<_0x25831f[_0xeab2('0x2e')][_0xeab2('0x3d')]()?0x1:-0x1;}else{return _0x2f34fe[_0xeab2('0x2e')]['toLowerCase']()<_0x25831f[_0xeab2('0x2e')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x5f740d==='DESC'){return _0x2f34fe[_0xeab2('0x31')]<_0x25831f[_0xeab2('0x31')]?0x1:-0x1;}else{return _0x2f34fe['globalStatus']<_0x25831f[_0xeab2('0x31')]?-0x1:0x1;}}});return _0x4af06c;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x919480){var _0x1e60c4=[_0xeab2('0x3e'),_0xeab2('0x3f'),_0xeab2('0x40'),_0xeab2('0x41'),_0xeab2('0x2f'),'lastPauseAt',_0xeab2('0x37'),_0xeab2('0x42'),_0xeab2('0x3'),'openchannelPause',_0xeab2('0x5'),'smsPause',_0xeab2('0x9'),_0xeab2('0x4'),_0xeab2('0x8'),_0xeab2('0x43'),'openchannelCapacity','mailCapacity','smsCapacity',_0xeab2('0x44'),_0xeab2('0x45'),_0xeab2('0x46'),_0xeab2('0x47'),'mailCurrentCapacity',_0xeab2('0x48'),_0xeab2('0x49'),_0xeab2('0x4a'),_0xeab2('0x4b'),'openchannelStatus',_0xeab2('0x4c'),'smsStatus',_0xeab2('0x4d'),_0xeab2('0x12'),_0xeab2('0xf'),_0xeab2('0x4e'),_0xeab2('0x4f'),_0xeab2('0x50'),_0xeab2('0x51'),_0xeab2('0x52'),_0xeab2('0x53'),_0xeab2('0x54'),'queue','destconnectedlinenum',_0xeab2('0x55'),'phoneBarEnableScreenRecordingByAgent',_0xeab2('0x56'),'routealias'];var _0x362763=['chatPause',_0xeab2('0x6'),_0xeab2('0x5'),_0xeab2('0x7'),_0xeab2('0x9'),_0xeab2('0x4'),'voicePause','online'];var _0x464048=_(_0x919480)[_0xeab2('0x57')](_0x362763)[_0xeab2('0x58')](_0x1e60c4)[_0xeab2('0x26')]();return _0x464048;}exports[_0xeab2('0x59')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 94c915f..99f3c37 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(_0x5008d1,_0x71f66){var _0x2b0796=function(_0x5548e0){while(--_0x5548e0){_0x5008d1['push'](_0x5008d1['shift']());}};_0x2b0796(++_0x71f66);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 _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(_0x488814,_0x3fec59){var _0x58138b=function(_0x575c59){while(--_0x575c59){_0x488814['push'](_0x488814['shift']());}};_0x58138b(++_0x3fec59);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 904c083..fa0f75e 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 _0x1f0a=['model','join','md5','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','createHash','update','substring','lodash','crypto','child_process','execSync','../environment','orderBy','keys','length','filter','family','IPv4','internal','mac','address','127.0.0.1','getFirstInterface','cpus','map'];(function(_0x25297f,_0x42dd93){var _0x238f9b=function(_0x22b9d9){while(--_0x22b9d9){_0x25297f['push'](_0x25297f['shift']());}};_0x238f9b(++_0x42dd93);}(_0x1f0a,0x1b5));var _0xa1f0=function(_0x7ca973,_0x425f8b){_0x7ca973=_0x7ca973-0x0;var _0x2750ab=_0x1f0a[_0x7ca973];return _0x2750ab;};'use strict';var _=require(_0xa1f0('0x0'));var os=require('os');var crypto=require(_0xa1f0('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xa1f0('0x2'))[_0xa1f0('0x3')];var config=require(_0xa1f0('0x4'));function getInterfaces(){var _0x121edc=[];var _0x1602ce=os['networkInterfaces']();var _0x4ed6c3=_[_0xa1f0('0x5')](_[_0xa1f0('0x6')](_0x1602ce));for(var _0x56583f=0x0;_0x56583f<_0x4ed6c3[_0xa1f0('0x7')];_0x56583f++){var _0x4db211=_0x1602ce[_0x4ed6c3[_0x56583f]][_0xa1f0('0x8')](function(_0x283452){return _0x283452[_0xa1f0('0x9')]===_0xa1f0('0xa')&&_0x283452[_0xa1f0('0xb')]===![];});_0x121edc=_0x121edc['concat'](_0x4db211);}return _0x121edc;}function getFirstInterface(){var _0x159809=_['head'](getInterfaces());return{'macAddress':_0x159809&&_0x159809['mac']?_0x159809[_0xa1f0('0xc')]:'00:00:00:00:00:00','ipAddress':_0x159809&&_0x159809[_0xa1f0('0xd')]?_0x159809['address']:_0xa1f0('0xe')};}exports[_0xa1f0('0xf')]=getFirstInterface;function getCPUhash(){var _0x4c8e7c=_['orderBy'](os[_0xa1f0('0x10')]()[_0xa1f0('0x11')](function(_0x120fa0){return _0x120fa0[_0xa1f0('0x12')];}))[_0xa1f0('0x13')](':');return crypto['createHash'](_0xa1f0('0x14'))['update'](_0x4c8e7c)[_0xa1f0('0x15')](_0xa1f0('0x16'));}exports[_0xa1f0('0x17')]=function(){var _0x24dfea=os[_0xa1f0('0x18')]();var _0x42784c=/[0-9a-f-]{36}/;if(config[_0xa1f0('0x19')]&&_0x42784c['test'](config[_0xa1f0('0x19')])){return config[_0xa1f0('0x19')];}else if(_0x24dfea===_0xa1f0('0x1a')){return exec(_0xa1f0('0x1b'),{'encoding':_0xa1f0('0x1c')})['replace']('\x0d\x0a','');}else{var _0x27d829=getFirstInterface();var _0x50869a=getCPUhash();var _0x363cbb=_0x50869a+'|'+os[_0xa1f0('0x1d')]()+'|'+_0x27d829[_0xa1f0('0x1e')]+'|'+_0x27d829[_0xa1f0('0x1f')];var _0x539d50=crypto[_0xa1f0('0x20')](_0xa1f0('0x14'))[_0xa1f0('0x21')](_0x363cbb)['digest']('hex');return _0x539d50[_0xa1f0('0x22')](0x0,0x8)+'-'+_0x539d50['substring'](0x8,0xc)+'-'+_0x539d50['substring'](0xc,0x10)+'-'+_0x539d50[_0xa1f0('0x22')](0x10,0x14)+'-'+_0x539d50[_0xa1f0('0x22')](0x14);}}; \ No newline at end of file +var _0xb396=['test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','ipAddress','substring','crypto','child_process','execSync','keys','IPv4','concat','head','mac','00:00:00:00:00:00','address','cpus','map','model','createHash','md5','digest','hex','getUuid','platform'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0xb396,0x105));var _0x6b39=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb396[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x6b39('0x0'));var machine=require('bimedia-machine-uuid');var exec=require(_0x6b39('0x1'))[_0x6b39('0x2')];var config=require('../environment');function getInterfaces(){var _0x1908a3=[];var _0x3c0e7a=os['networkInterfaces']();var _0x4954db=_['orderBy'](_[_0x6b39('0x3')](_0x3c0e7a));for(var _0x38d8fa=0x0;_0x38d8fa<_0x4954db['length'];_0x38d8fa++){var _0x27eef8=_0x3c0e7a[_0x4954db[_0x38d8fa]]['filter'](function(_0x492607){return _0x492607['family']===_0x6b39('0x4')&&_0x492607['internal']===![];});_0x1908a3=_0x1908a3[_0x6b39('0x5')](_0x27eef8);}return _0x1908a3;}function getFirstInterface(){var _0x4b6a06=_[_0x6b39('0x6')](getInterfaces());return{'macAddress':_0x4b6a06&&_0x4b6a06[_0x6b39('0x7')]?_0x4b6a06[_0x6b39('0x7')]:_0x6b39('0x8'),'ipAddress':_0x4b6a06&&_0x4b6a06[_0x6b39('0x9')]?_0x4b6a06[_0x6b39('0x9')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x8fbb97=_['orderBy'](os[_0x6b39('0xa')]()[_0x6b39('0xb')](function(_0x298a78){return _0x298a78[_0x6b39('0xc')];}))['join'](':');return crypto[_0x6b39('0xd')](_0x6b39('0xe'))['update'](_0x8fbb97)[_0x6b39('0xf')](_0x6b39('0x10'));}exports[_0x6b39('0x11')]=function(){var _0xba79f4=os[_0x6b39('0x12')]();var _0x257e3c=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x257e3c[_0x6b39('0x13')](config[_0x6b39('0x14')])){return config[_0x6b39('0x14')];}else if(_0xba79f4===_0x6b39('0x15')){return exec(_0x6b39('0x16'),{'encoding':_0x6b39('0x17')})[_0x6b39('0x18')]('\x0d\x0a','');}else{var _0x15e42e=getFirstInterface();var _0x1e9b95=getCPUhash();var _0x12e7e7=_0x1e9b95+'|'+os[_0x6b39('0x19')]()+'|'+_0x15e42e['macAddress']+'|'+_0x15e42e[_0x6b39('0x1a')];var _0x4a3c9a=crypto['createHash'](_0x6b39('0xe'))['update'](_0x12e7e7)['digest']('hex');return _0x4a3c9a['substring'](0x0,0x8)+'-'+_0x4a3c9a[_0x6b39('0x1b')](0x8,0xc)+'-'+_0x4a3c9a[_0x6b39('0x1b')](0xc,0x10)+'-'+_0x4a3c9a[_0x6b39('0x1b')](0x10,0x14)+'-'+_0x4a3c9a[_0x6b39('0x1b')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index a917351..e9c26e4 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 _0x5963=['update','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','data1','then','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5963,0xac));var _0x3596=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x5963[_0x57b54c];return _0x59cc19;};'use strict';var util=require(_0x3596('0x0'));var moment=require(_0x3596('0x1'));var rp=require(_0x3596('0x2'));var BPromise=require(_0x3596('0x3'));var pkginfo=require('pkginfo')(module,_0x3596('0x4'));var db=require(_0x3596('0x5'))['db'];var encryptor=require(_0x3596('0x6'));var hardware=require(_0x3596('0x7'));var logger=require(_0x3596('0x8'))(_0x3596('0x9'));var HOST=_0x3596('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x4cfffd){return new BPromise(function(_0x532635,_0x5da80c){var _0x3f5e01=util[_0x3596('0xb')](_0x3596('0xc'),HOST,_0x4cfffd,module[_0x3596('0xd')][_0x3596('0x4')]);if(oldToken){_0x3f5e01=util[_0x3596('0xb')](_0x3596('0xe'),HOST,_0x4cfffd,module[_0x3596('0xd')][_0x3596('0x4')],oldToken);}var _0x2bc5b6={'uri':_0x3f5e01,'method':_0x3596('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x2bc5b6)['then'](function(_0x3aa6ce){_0x532635(_0x3aa6ce);})[_0x3596('0x10')](function(_0x5df6ca){_0x5da80c(_0x5df6ca);});});}function manageLicense(_0x5ec29e,_0xe129be){var _0x4a3a1b=_0xe129be['get']({'plain':!![]});if(!isOldTokenSent&&_0x4a3a1b['data1']!==_0x5ec29e&&!_0x4a3a1b['data2']){oldToken=_0x4a3a1b[_0x3596('0x11')];}httpRequest(_0x5ec29e)[_0x3596('0x12')](function(_0x264f62){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x264f62[_0x3596('0x13')]){isOldTokenSent=![];if(!_0x4a3a1b[_0x3596('0x9')]&&_0x4a3a1b[_0x3596('0x9')]!=_0x264f62[_0x3596('0x9')]||_0x4a3a1b[_0x3596('0x9')]&&_0x4a3a1b[_0x3596('0x14')]){logger[_0x3596('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4a3a1b[_0x3596('0x9')]&&!_0x4a3a1b[_0x3596('0x14')]&&_0x4a3a1b['license']!=_0x264f62[_0x3596('0x9')]){logger[_0x3596('0x15')](_0x3596('0x16'));}if(_0x4a3a1b['license']&&!_0x4a3a1b[_0x3596('0x14')]&&_0x4a3a1b['license']==_0x264f62['license']){return _0xe129be;}return _0xe129be['update']({'data1':_0x5ec29e,'data2':null,'license':_0x264f62[_0x3596('0x9')]});}else{if(_0x264f62[_0x3596('0x9')]||_0x4a3a1b[_0x3596('0x9')]){if(!_0x4a3a1b[_0x3596('0x14')]){if(_0x4a3a1b[_0x3596('0x11')]==_0x5ec29e){GRAY_PERIOD_REASON='Disabled';logger['info'](_0x3596('0x17'));}else{GRAY_PERIOD_REASON=_0x3596('0x18');logger[_0x3596('0x15')](_0x3596('0x19'),_0x4a3a1b[_0x3596('0x11')],_0x5ec29e);}logger[_0x3596('0x15')](_0x3596('0x1a'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0xe129be['update']({'data2':encryptor[_0x3596('0x1b')](moment()[_0x3596('0xb')](_0x3596('0x1c')))});}else{if(moment()[_0x3596('0x1d')](encryptor[_0x3596('0x1e')](_0x4a3a1b[_0x3596('0x14')]),_0x3596('0x1f'))>DAYS){logger[_0x3596('0x15')](_0x3596('0x20'),moment()[_0x3596('0xb')](_0x3596('0x1c')));isOldTokenSent=![];return _0xe129be['update']({'data1':_0x5ec29e,'data2':null,'license':null});}}}else{if(_0x4a3a1b[_0x3596('0x11')]!=_0x5ec29e){logger[_0x3596('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4a3a1b[_0x3596('0x11')],_0x5ec29e);return _0xe129be[_0x3596('0x21')]({'data1':_0x5ec29e,'data2':null,'license':null});}}}return _0xe129be;})[_0x3596('0x12')](function(_0x47fa11){_0xe129be=_0x47fa11;})['catch'](function(_0x5a9890){logger[_0x3596('0x22')](_0x5a9890[_0x3596('0x23')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xe129be);},TIME);});}function defaultLicense(){var _0x1ac0f1=hardware[_0x3596('0x24')]();if(_0x1ac0f1){return db[_0x3596('0x25')][_0x3596('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x1ac0f1}})[_0x3596('0x27')](function(_0x2fa89b,_0x4b5fd4){logger[_0x3596('0x15')](_0x3596('0x28'),_0x1ac0f1);manageLicense(_0x1ac0f1,_0x2fa89b);})[_0x3596('0x10')](function(_0x23e2b5){logger[_0x3596('0x22')](_0x23e2b5[_0x3596('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x48b4=['data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','default','util','moment','bluebird','pkginfo','version','./hardware','license','https://www.xcallymotion.com','format','exports','GET','then','catch','data2'];(function(_0x4739dc,_0x1c4222){var _0x2610d6=function(_0x562625){while(--_0x562625){_0x4739dc['push'](_0x4739dc['shift']());}};_0x2610d6(++_0x1c4222);}(_0x48b4,0x1c6));var _0x448b=function(_0x42cb33,_0x38eac3){_0x42cb33=_0x42cb33-0x0;var _0xca7455=_0x48b4[_0x42cb33];return _0xca7455;};'use strict';var util=require(_0x448b('0x0'));var moment=require(_0x448b('0x1'));var rp=require('request-promise');var BPromise=require(_0x448b('0x2'));var pkginfo=require(_0x448b('0x3'))(module,_0x448b('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x448b('0x5'));var logger=require('../logger')(_0x448b('0x6'));var HOST=_0x448b('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x318595){return new BPromise(function(_0x5c306f,_0x4b842d){var _0x2265fc=util[_0x448b('0x8')]('%s/api/servers/%s/check?version=%s',HOST,_0x318595,module[_0x448b('0x9')][_0x448b('0x4')]);if(oldToken){_0x2265fc=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x318595,module['exports'][_0x448b('0x4')],oldToken);}var _0x2bf700={'uri':_0x2265fc,'method':_0x448b('0xa'),'timeout':0xea60,'json':!![]};return rp(_0x2bf700)[_0x448b('0xb')](function(_0x18a41a){_0x5c306f(_0x18a41a);})[_0x448b('0xc')](function(_0x2acbe9){_0x4b842d(_0x2acbe9);});});}function manageLicense(_0x513bee,_0x42030d){var _0x2cd99a=_0x42030d['get']({'plain':!![]});if(!isOldTokenSent&&_0x2cd99a['data1']!==_0x513bee&&!_0x2cd99a[_0x448b('0xd')]){oldToken=_0x2cd99a[_0x448b('0xe')];}httpRequest(_0x513bee)[_0x448b('0xb')](function(_0x4e9552){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4e9552[_0x448b('0xf')]){isOldTokenSent=![];if(!_0x2cd99a[_0x448b('0x6')]&&_0x2cd99a[_0x448b('0x6')]!=_0x4e9552['license']||_0x2cd99a[_0x448b('0x6')]&&_0x2cd99a[_0x448b('0xd')]){logger['info'](_0x448b('0x10'));}if(_0x2cd99a['license']&&!_0x2cd99a[_0x448b('0xd')]&&_0x2cd99a['license']!=_0x4e9552[_0x448b('0x6')]){logger[_0x448b('0x11')](_0x448b('0x12'));}if(_0x2cd99a['license']&&!_0x2cd99a[_0x448b('0xd')]&&_0x2cd99a[_0x448b('0x6')]==_0x4e9552[_0x448b('0x6')]){return _0x42030d;}return _0x42030d['update']({'data1':_0x513bee,'data2':null,'license':_0x4e9552[_0x448b('0x6')]});}else{if(_0x4e9552['license']||_0x2cd99a[_0x448b('0x6')]){if(!_0x2cd99a[_0x448b('0xd')]){if(_0x2cd99a['data1']==_0x513bee){GRAY_PERIOD_REASON=_0x448b('0x13');logger[_0x448b('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x448b('0x14');logger[_0x448b('0x11')](_0x448b('0x15'),_0x2cd99a[_0x448b('0xe')],_0x513bee);}logger[_0x448b('0x11')](_0x448b('0x16'),GRAY_PERIOD_REASON[_0x448b('0x17')](),moment()[_0x448b('0x8')](_0x448b('0x18')));return _0x42030d[_0x448b('0x19')]({'data2':encryptor[_0x448b('0x1a')](moment()[_0x448b('0x8')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x448b('0x1b')](encryptor[_0x448b('0x1c')](_0x2cd99a[_0x448b('0xd')]),_0x448b('0x1d'))>DAYS){logger['info'](_0x448b('0x1e'),moment()[_0x448b('0x8')](_0x448b('0x18')));isOldTokenSent=![];return _0x42030d[_0x448b('0x19')]({'data1':_0x513bee,'data2':null,'license':null});}}}else{if(_0x2cd99a[_0x448b('0xe')]!=_0x513bee){logger['info'](_0x448b('0x15'),_0x2cd99a[_0x448b('0xe')],_0x513bee);return _0x42030d[_0x448b('0x19')]({'data1':_0x513bee,'data2':null,'license':null});}}}return _0x42030d;})[_0x448b('0xb')](function(_0x2658ee){_0x42030d=_0x2658ee;})[_0x448b('0xc')](function(_0x19b511){logger[_0x448b('0x1f')](_0x19b511[_0x448b('0x20')]);})[_0x448b('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x448b('0x22')](),_0x42030d);},TIME);});}function defaultLicense(){var _0x208561=hardware[_0x448b('0x22')]();if(_0x208561){return db[_0x448b('0x23')][_0x448b('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x208561}})[_0x448b('0x25')](function(_0x18f0eb,_0x1a9708){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x208561);manageLicense(_0x208561,_0x18f0eb);})['catch'](function(_0x46e6e0){logger['error'](_0x46e6e0[_0x448b('0x20')]);});}}exports[_0x448b('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 36ec072..c261e1e 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 _0xe1cc=['decryptString','gray','deadline','grayReason','changed','disabled','message','User','findAll','role','sequelize','COUNT','user','telephones','forEach','admin','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','defaults','then','catch','uuid','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','%s:%s:%s','parse','machineUuid'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0xe1cc,0x68));var _0xce1c=function(_0x27a7b1,_0x59c48f){_0x27a7b1=_0x27a7b1-0x0;var _0xb22e88=_0xe1cc[_0x27a7b1];return _0xb22e88;};'use strict';var util=require(_0xce1c('0x0'));var _=require(_0xce1c('0x1'));var moment=require(_0xce1c('0x2'));var BPromise=require(_0xce1c('0x3'));var hardware=require(_0xce1c('0x4'));var encryptor=require(_0xce1c('0x5'));var db=require(_0xce1c('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xce1c('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xce1c('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xce1c('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xce1c('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x315cc7){return new BPromise(function(_0x3811b3,_0x3ac8e7){return db[_0xce1c('0xa')]['find'](_[_0xce1c('0xb')](_0x315cc7,{'raw':!![],'where':{'id':0x1}}))[_0xce1c('0xc')](function(_0x51c97d){return checkLicense(_0x51c97d,null);})[_0xce1c('0xc')](function(_0x585017){_0x3811b3(_0x585017);return;})[_0xce1c('0xd')](function(_0x59d4af){_0x3ac8e7(_0x59d4af);});});}function checkLicense(_0x580bc7,_0x295ddb){if(!_0x580bc7){demoLicense[_0xce1c('0xe')]=_0x580bc7[_0xce1c('0xf')];return demoLicense;}try{var _0x1a8fe7=_0x295ddb||_0x580bc7['license'];if(_[_0xce1c('0x10')](_0x1a8fe7)){throw new Error(_0xce1c('0x11'));}var _0x20b115=_0x580bc7[_0xce1c('0xf')];var _0x2c95f5=_0x580bc7[_0xce1c('0x12')];var _0x660555=_0x20b115['split']('-')[0x4];var _0x439056=_0x20b115['split']('-')[0x0];var _0xb17766=encryptor['decryptString'](_0x1a8fe7,util['format'](_0xce1c('0x13'),_0x660555,_0x20b115,_0x439056));var _0x249894=JSON[_0xce1c('0x14')](_0xb17766);_0x249894['demo']=![];_0x249894[_0xce1c('0xe')]=_0x20b115;_0x249894[_0xce1c('0x15')]=hardware[_0xce1c('0x9')]();if(_0x2c95f5){var _0x92a2b7=encryptor[_0xce1c('0x16')](_0x2c95f5);_0x249894[_0xce1c('0x17')]=_0x92a2b7;_0x249894[_0xce1c('0x18')]=moment(_0x92a2b7)['add'](0x7,'days')['format']();_0x249894[_0xce1c('0x19')]=_0x249894[_0xce1c('0xe')]!=_0x249894['machineUuid']?_0xce1c('0x1a'):_0xce1c('0x1b');}return _0x249894;}catch(_0x41f250){breakingLicense['uuid']=_0x580bc7[_0xce1c('0xf')];breakingLicense[_0xce1c('0x1c')]=_0x41f250[_0xce1c('0x1c')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x45fa29,_0x56286d){getLicense()['then'](function(_0xe8be46){return db[_0xce1c('0x1d')][_0xce1c('0x1e')]({'attributes':[_0xce1c('0x1f'),[db[_0xce1c('0x20')]['fn'](_0xce1c('0x21'),db[_0xce1c('0x20')]['col'](_0xce1c('0x1f'))),'count']],'group':_0xce1c('0x1f'),'where':{'role':{'$or':['admin',_0xce1c('0x22'),'telephone']}},'raw':!![]})[_0xce1c('0xc')](function(_0x141d5c){var _0x5813ee={'user':_0xe8be46['users']||0x0,'telephone':_0xe8be46[_0xce1c('0x23')]||0x0};_0x141d5c[_0xce1c('0x24')](function(_0x26a280){var _0x32407e=_0x26a280[_0xce1c('0x1f')]===_0xce1c('0x25')?_0xce1c('0x22'):_0x26a280[_0xce1c('0x1f')];_0x5813ee[_0x32407e]-=_0x26a280['count'];if(_0x5813ee[_0x32407e]<0x0)_0x5813ee[_0x32407e]=0x0;});_0x45fa29(_0x5813ee);return;});})[_0xce1c('0xd')](function(_0x85552c){_0x56286d(_0x85552c);});});}function checkUserLimits(_0x3e00ab){return new BPromise(function(_0x18fdda,_0x2ff8c2){getLimits()[_0xce1c('0xc')](function(_0x17ce06){var _0x515f07=_['pick'](_['countBy'](_0x3e00ab,_0xce1c('0x1f')),[_0xce1c('0x25'),_0xce1c('0x22'),_0xce1c('0x26')]);var _0x25538e=(_0x515f07[_0xce1c('0x25')]||0x0)+(_0x515f07[_0xce1c('0x22')]||0x0);var _0x289584=_0x515f07[_0xce1c('0x26')]||0x0;if(_0x25538e>_0x17ce06['user'])return _0x2ff8c2(_0xce1c('0x27'));if(_0x289584>_0x17ce06[_0xce1c('0x26')])return _0x2ff8c2(_0xce1c('0x28'));return _0x18fdda();})[_0xce1c('0xd')](function(_0x3c1add){_0x2ff8c2(_0x3c1add);});});}module[_0xce1c('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x8075=['../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','License','find','defaults','then','catch','uuid','data1','data2','split','decryptString','format','parse','demo','deadline','add','days','grayReason','machineUuid','changed','disabled','message','role','sequelize','col','count','admin','user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x8075,0xdb));var _0x5807=function(_0x2042e4,_0x49de4a){_0x2042e4=_0x2042e4-0x0;var _0xc73b2d=_0x8075[_0x2042e4];return _0xc73b2d;};'use strict';var util=require(_0x5807('0x0'));var _=require(_0x5807('0x1'));var moment=require(_0x5807('0x2'));var BPromise=require(_0x5807('0x3'));var hardware=require(_0x5807('0x4'));var encryptor=require(_0x5807('0x5'));var db=require(_0x5807('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5807('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x5807('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x382214){return new BPromise(function(_0x1db018,_0x5d95ce){return db[_0x5807('0x9')][_0x5807('0xa')](_[_0x5807('0xb')](_0x382214,{'raw':!![],'where':{'id':0x1}}))[_0x5807('0xc')](function(_0x2f89dd){return checkLicense(_0x2f89dd,null);})[_0x5807('0xc')](function(_0x25abf1){_0x1db018(_0x25abf1);return;})[_0x5807('0xd')](function(_0x3f09d0){_0x5d95ce(_0x3f09d0);});});}function checkLicense(_0x7c4b8a,_0xb09373){if(!_0x7c4b8a){demoLicense[_0x5807('0xe')]=_0x7c4b8a[_0x5807('0xf')];return demoLicense;}try{var _0x3e83a5=_0xb09373||_0x7c4b8a['license'];if(_['isEmpty'](_0x3e83a5)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x5d4bc2=_0x7c4b8a[_0x5807('0xf')];var _0x4b72b5=_0x7c4b8a[_0x5807('0x10')];var _0x1cf406=_0x5d4bc2[_0x5807('0x11')]('-')[0x4];var _0x3a8321=_0x5d4bc2['split']('-')[0x0];var _0x2adf4c=encryptor[_0x5807('0x12')](_0x3e83a5,util[_0x5807('0x13')]('%s:%s:%s',_0x1cf406,_0x5d4bc2,_0x3a8321));var _0x4f00bb=JSON[_0x5807('0x14')](_0x2adf4c);_0x4f00bb[_0x5807('0x15')]=![];_0x4f00bb['uuid']=_0x5d4bc2;_0x4f00bb['machineUuid']=hardware[_0x5807('0x8')]();if(_0x4b72b5){var _0x5924ac=encryptor[_0x5807('0x12')](_0x4b72b5);_0x4f00bb['gray']=_0x5924ac;_0x4f00bb[_0x5807('0x16')]=moment(_0x5924ac)[_0x5807('0x17')](0x7,_0x5807('0x18'))[_0x5807('0x13')]();_0x4f00bb[_0x5807('0x19')]=_0x4f00bb[_0x5807('0xe')]!=_0x4f00bb[_0x5807('0x1a')]?_0x5807('0x1b'):_0x5807('0x1c');}return _0x4f00bb;}catch(_0x2314a6){breakingLicense[_0x5807('0xe')]=_0x7c4b8a[_0x5807('0xf')];breakingLicense[_0x5807('0x1d')]=_0x2314a6[_0x5807('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3cb247,_0x218f84){getLicense()[_0x5807('0xc')](function(_0x569f1f){return db['User']['findAll']({'attributes':[_0x5807('0x1e'),[db[_0x5807('0x1f')]['fn']('COUNT',db[_0x5807('0x1f')][_0x5807('0x20')](_0x5807('0x1e'))),_0x5807('0x21')]],'group':_0x5807('0x1e'),'where':{'role':{'$or':[_0x5807('0x22'),_0x5807('0x23'),_0x5807('0x24')]}},'raw':!![]})[_0x5807('0xc')](function(_0x437341){var _0xf18eff={'user':_0x569f1f[_0x5807('0x25')]||0x0,'telephone':_0x569f1f[_0x5807('0x26')]||0x0};_0x437341[_0x5807('0x27')](function(_0x3f6f4f){var _0x4a2a12=_0x3f6f4f[_0x5807('0x1e')]===_0x5807('0x22')?_0x5807('0x23'):_0x3f6f4f[_0x5807('0x1e')];_0xf18eff[_0x4a2a12]-=_0x3f6f4f[_0x5807('0x21')];if(_0xf18eff[_0x4a2a12]<0x0)_0xf18eff[_0x4a2a12]=0x0;});_0x3cb247(_0xf18eff);return;});})[_0x5807('0xd')](function(_0x533c67){_0x218f84(_0x533c67);});});}function checkUserLimits(_0x50fb17){return new BPromise(function(_0x2f75ac,_0x4dc9a6){getLimits()['then'](function(_0x18a173){var _0x26a390=_[_0x5807('0x28')](_[_0x5807('0x29')](_0x50fb17,_0x5807('0x1e')),[_0x5807('0x22'),_0x5807('0x23'),_0x5807('0x24')]);var _0x239634=(_0x26a390[_0x5807('0x22')]||0x0)+(_0x26a390[_0x5807('0x23')]||0x0);var _0x55358c=_0x26a390[_0x5807('0x24')]||0x0;if(_0x239634>_0x18a173[_0x5807('0x23')])return _0x4dc9a6(_0x5807('0x2a'));if(_0x55358c>_0x18a173[_0x5807('0x24')])return _0x4dc9a6(_0x5807('0x2b'));return _0x2f75ac();})[_0x5807('0xd')](function(_0x463a61){_0x4dc9a6(_0x463a61);});});}module[_0x5807('0x2c')]={'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 a026aef..cf02958 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 _0x5f66=['app-id','secret','http://localhost:9000'];(function(_0x4b9750,_0x538cbf){var _0x4470b0=function(_0x204609){while(--_0x204609){_0x4b9750['push'](_0x4b9750['shift']());}};_0x4470b0(++_0x538cbf);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';module['exports']={'DOMAIN':_0x65f6('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x65f6('0x1'),'GOOGLE_SECRET':_0x65f6('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x5f2f=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x11f93a,_0x2c2ee7){var _0x5381a4=function(_0xf48d92){while(--_0xf48d92){_0x11f93a['push'](_0x11f93a['shift']());}};_0x5381a4(++_0x2c2ee7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2aaf2a,_0x38e198){_0x2aaf2a=_0x2aaf2a-0x0;var _0x15453e=_0x5f2f[_0x2aaf2a];return _0x15453e;};'use strict';module[_0xf5f2('0x0')]={'DOMAIN':_0xf5f2('0x1'),'SESSION_SECRET':_0xf5f2('0x2'),'GOOGLE_ID':_0xf5f2('0x3'),'GOOGLE_SECRET':_0xf5f2('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 846101e..b56215e 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf6ea=['exports','../utils/loggers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf6ea,0x1af));var _0xaf6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf6ea[_0x502c7d];return _0x30b7ed;};'use strict';var fileLogger=require(_0xaf6e('0x0'))['fileLogger'];module[_0xaf6e('0x1')]=fileLogger; \ No newline at end of file +var _0x7127=['exports','fileLogger'];(function(_0x41a8c8,_0x4fab26){var _0x4d1684=function(_0x1010b4){while(--_0x1010b4){_0x41a8c8['push'](_0x41a8c8['shift']());}};_0x4d1684(++_0x4fab26);}(_0x7127,0x19f));var _0x7712=function(_0x2e7f42,_0x1ad62d){_0x2e7f42=_0x2e7f42-0x0;var _0x39c910=_0x7127[_0x2e7f42];return _0x39c910;};'use strict';var fileLogger=require('../utils/loggers')[_0x7712('0x0')];module[_0x7712('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index bca4167..0eb6b9d 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 _0xa824=['join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','../../services/express/index.js'];(function(_0x421ec0,_0x5ae73b){var _0x1d79cf=function(_0x16db00){while(--_0x16db00){_0x421ec0['push'](_0x421ec0['shift']());}};_0x1d79cf(++_0x5ae73b);}(_0xa824,0x15e));var _0x4a82=function(_0x1ddc01,_0x36efdd){_0x1ddc01=_0x1ddc01-0x0;var _0x2cba33=_0xa824[_0x1ddc01];return _0x2cba33;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x4a82('0x0'),'script':path['join'](__dirname,_0x4a82('0x1'))},{'name':'ami','script':path[_0x4a82('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x4a82('0x2')](__dirname,_0x4a82('0x3'))},{'name':_0x4a82('0x4'),'script':path[_0x4a82('0x2')](__dirname,_0x4a82('0x5'))},{'name':_0x4a82('0x6'),'script':path[_0x4a82('0x2')](__dirname,_0x4a82('0x7'))},{'name':_0x4a82('0x8'),'script':path[_0x4a82('0x2')](__dirname,_0x4a82('0x9'))}]};module[_0x4a82('0xa')]=config; \ No newline at end of file +var _0x4c07=['../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express'];(function(_0x3b004d,_0x2e5d51){var _0x4db51e=function(_0x289d72){while(--_0x289d72){_0x3b004d['push'](_0x3b004d['shift']());}};_0x4db51e(++_0x2e5d51);}(_0x4c07,0x1d2));var _0x74c0=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x4c07[_0x58db4e];return _0x40139a;};'use strict';var path=require(_0x74c0('0x0'));var os=require('os');var config={'apps':[{'name':_0x74c0('0x1'),'script':path['join'](__dirname,_0x74c0('0x2'))},{'name':_0x74c0('0x3'),'script':path[_0x74c0('0x4')](__dirname,_0x74c0('0x5'))},{'name':_0x74c0('0x6'),'script':path[_0x74c0('0x4')](__dirname,_0x74c0('0x7'))},{'name':'email','script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0x74c0('0x8'),'script':path[_0x74c0('0x4')](__dirname,_0x74c0('0x9'))},{'name':_0x74c0('0xa'),'script':path[_0x74c0('0x4')](__dirname,_0x74c0('0xb'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 114f28d..a239642 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 _0x12a6=['connected','start','stop','then','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','connect'];(function(_0x59c05a,_0x3b004d){var _0x1a0bfd=function(_0x399664){while(--_0x399664){_0x59c05a['push'](_0x59c05a['shift']());}};_0x1a0bfd(++_0x3b004d);}(_0x12a6,0x7a));var _0x612a=function(_0x590a3a,_0xd9db9){_0x590a3a=_0x590a3a-0x0;var _0x49017f=_0x12a6[_0x590a3a];return _0x49017f;};'use strict';var pm2=require(_0x612a('0x0'));var BPromise=require(_0x612a('0x1'));var config=require(_0x612a('0x2'));function connect(){return new BPromise(function(_0x3b0549,_0xc30f62){return pm2[_0x612a('0x3')](function(_0x68dc4b){if(_0x68dc4b){return _0xc30f62(_0x68dc4b);}return _0x3b0549(_0x612a('0x4'));});});};exports[_0x612a('0x5')]=function(_0x26de6e){return connect()['then'](function(){return new BPromise(function(_0x2b73d4,_0x4077ff){return pm2[_0x612a('0x5')](_0x26de6e,function(_0x452036,_0x450104){if(_0x452036){return _0x4077ff(_0x452036);}pm2['disconnect']();return _0x2b73d4(_0x450104);});});});};exports[_0x612a('0x6')]=function(_0x4ec215){return connect()[_0x612a('0x7')](function(){return new BPromise(function(_0x497a0d,_0x131359){return pm2[_0x612a('0x6')](_0x4ec215,function(_0x22a901,_0x3dd1ca){if(_0x22a901){return _0x131359(_0x22a901);}pm2[_0x612a('0x8')]();return _0x497a0d(_0x3dd1ca);});});});};exports[_0x612a('0x9')]=function(_0x497759){return connect()['then'](function(){return new BPromise(function(_0x43adda,_0x43e6c9){return pm2['restart'](_0x497759,function(_0x2bc8a5,_0x56d167){if(_0x2bc8a5){return _0x43e6c9(_0x2bc8a5);}pm2['disconnect']();return _0x43adda(_0x56d167);});});});};exports['list']=function(){return connect()[_0x612a('0x7')](function(){return new BPromise(function(_0x2dce03,_0x3a3f7d){return pm2[_0x612a('0xa')](function(_0x1446b,_0x65050){if(_0x1446b){return _0x3a3f7d(_0x1446b);}pm2[_0x612a('0x8')]();return _0x2dce03(_0x65050);});});});};exports[_0x612a('0xb')]=function(_0x4483c1){return connect()[_0x612a('0x7')](function(){return new BPromise(function(_0x5916ac,_0x435eeb){return pm2[_0x612a('0xb')](_0x4483c1,function(_0x14d2bf,_0x2b345c){if(_0x14d2bf){return _0x435eeb(_0x14d2bf);}pm2['disconnect']();return _0x5916ac(_0x2b345c);});});});};exports[_0x612a('0xc')]=function(_0x2c3b7f){return connect()['then'](function(){return new BPromise(function(_0x72d78c,_0x3a75dd){return pm2[_0x612a('0xc')](_0x2c3b7f,function(_0x349844,_0x32509d){if(_0x349844){return _0x3a75dd(_0x349844);}pm2[_0x612a('0x8')]();return _0x72d78c(_0x32509d);});});});};exports[_0x612a('0xd')]=function(){return connect()[_0x612a('0x7')](function(){return new BPromise(function(_0x835636,_0x37ca3d){return pm2['dump'](function(_0x4cdcf2){if(_0x4cdcf2){return _0x37ca3d(_0x4cdcf2);}return _0x835636('saved');});});});}; \ No newline at end of file +var _0xd2a2=['connect','connected','start','then','stop','disconnect','list','delete','dump','saved','pm2','bluebird','./config'];(function(_0xfe7ed4,_0x5d9262){var _0x35f3c5=function(_0x5076e7){while(--_0x5076e7){_0xfe7ed4['push'](_0xfe7ed4['shift']());}};_0x35f3c5(++_0x5d9262);}(_0xd2a2,0x19d));var _0x2d2a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd2a2[_0x2dafbe];return _0x58a45a;};'use strict';var pm2=require(_0x2d2a('0x0'));var BPromise=require(_0x2d2a('0x1'));var config=require(_0x2d2a('0x2'));function connect(){return new BPromise(function(_0x468eaa,_0x463218){return pm2[_0x2d2a('0x3')](function(_0x4cd96c){if(_0x4cd96c){return _0x463218(_0x4cd96c);}return _0x468eaa(_0x2d2a('0x4'));});});};exports['start']=function(_0x3d285f){return connect()['then'](function(){return new BPromise(function(_0x2c2f7c,_0x513813){return pm2[_0x2d2a('0x5')](_0x3d285f,function(_0x381284,_0x28d01e){if(_0x381284){return _0x513813(_0x381284);}pm2['disconnect']();return _0x2c2f7c(_0x28d01e);});});});};exports['stop']=function(_0x3f7463){return connect()[_0x2d2a('0x6')](function(){return new BPromise(function(_0x1d3888,_0x1f6d03){return pm2[_0x2d2a('0x7')](_0x3f7463,function(_0x29c683,_0x19b5b7){if(_0x29c683){return _0x1f6d03(_0x29c683);}pm2[_0x2d2a('0x8')]();return _0x1d3888(_0x19b5b7);});});});};exports['restart']=function(_0x1b1f26){return connect()[_0x2d2a('0x6')](function(){return new BPromise(function(_0x712347,_0x522708){return pm2['restart'](_0x1b1f26,function(_0x3ef0ae,_0x5c6571){if(_0x3ef0ae){return _0x522708(_0x3ef0ae);}pm2['disconnect']();return _0x712347(_0x5c6571);});});});};exports[_0x2d2a('0x9')]=function(){return connect()[_0x2d2a('0x6')](function(){return new BPromise(function(_0xda5808,_0x2e5306){return pm2[_0x2d2a('0x9')](function(_0x19bc29,_0x16cea3){if(_0x19bc29){return _0x2e5306(_0x19bc29);}pm2[_0x2d2a('0x8')]();return _0xda5808(_0x16cea3);});});});};exports['describe']=function(_0x4ec9c8){return connect()[_0x2d2a('0x6')](function(){return new BPromise(function(_0x4f71e8,_0x1b8c53){return pm2['describe'](_0x4ec9c8,function(_0x4d7e49,_0x44ca4d){if(_0x4d7e49){return _0x1b8c53(_0x4d7e49);}pm2['disconnect']();return _0x4f71e8(_0x44ca4d);});});});};exports[_0x2d2a('0xa')]=function(_0x288366){return connect()[_0x2d2a('0x6')](function(){return new BPromise(function(_0x7e894f,_0x52619a){return pm2[_0x2d2a('0xa')](_0x288366,function(_0x174bd0,_0x118f04){if(_0x174bd0){return _0x52619a(_0x174bd0);}pm2[_0x2d2a('0x8')]();return _0x7e894f(_0x118f04);});});});};exports[_0x2d2a('0xb')]=function(){return connect()[_0x2d2a('0x6')](function(){return new BPromise(function(_0x32ae41,_0x54f79a){return pm2[_0x2d2a('0xb')](function(_0x4e5d11){if(_0x4e5d11){return _0x54f79a(_0x4e5d11);}return _0x32ae41(_0x2d2a('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 34805b2..c2afe40 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 _0x4e2a=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','join','system','timeout','format'];(function(_0xcbbd05,_0x8c097a){var _0x5538b2=function(_0x3be359){while(--_0x3be359){_0xcbbd05['push'](_0xcbbd05['shift']());}};_0x5538b2(++_0x8c097a);}(_0x4e2a,0xe5));var _0xa4e2=function(_0x367c78,_0x58ee26){_0x367c78=_0x367c78-0x0;var _0x2a1044=_0x4e2a[_0x367c78];return _0x2a1044;};'use strict';var _=require(_0xa4e2('0x0'));var moment=require(_0xa4e2('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0xa4e2('0x2'));var db=require(_0xa4e2('0x3'))['db'];var logger=require(_0xa4e2('0x4'))(_0xa4e2('0x5'));config[_0xa4e2('0x6')]=_[_0xa4e2('0x7')](config['redis'],{'host':_0xa4e2('0x8'),'port':0x18eb});var io=require(_0xa4e2('0x9'))(new Redis(config[_0xa4e2('0x6')]));function closeInteractions(){var _0x5555ba=0x0;var _0x3bead=[];return db[_0xa4e2('0xa')][_0xa4e2('0xb')]({'raw':!![],'attributes':['id',_0xa4e2('0xc')],'where':{'id':0x1}})[_0xa4e2('0xd')](function(_0x47e88e){_0x5555ba=_0x47e88e[_0xa4e2('0xc')];if(_0x5555ba){return db[_0xa4e2('0xe')]['findAll']({'raw':!![],'attributes':['id',_0xa4e2('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa4e2('0x10')](_0x47e88e[_0xa4e2('0xc')],_0xa4e2('0x11'))}}});}else{return[];}})[_0xa4e2('0xd')](function(_0x1fd20b){if(_0x1fd20b&&_0x1fd20b[_0xa4e2('0x12')]){_0x3bead=_['map'](_0x1fd20b||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x3bead[_0xa4e2('0x13')]());return db[_0xa4e2('0xe')]['update']({'closeReason':_0xa4e2('0x14'),'disposition':_0xa4e2('0x15'),'closed':!![],'closedAt':moment()[_0xa4e2('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3bead}});}})[_0xa4e2('0xd')](function(){if(_0x3bead&&_0x3bead[_0xa4e2('0x12')]){logger['info'](_0xa4e2('0x17'),_0x3bead['join']());for(var _0x42590=0x0;_0x42590<_0x3bead[_0xa4e2('0x12')];_0x42590++){io['emit'](_0xa4e2('0x18'),{'id':_0x3bead[_0x42590],'closed':!![]});}}})['catch'](function(_0x534907){logger['error'](_0xa4e2('0x19'),_0x534907?util[_0xa4e2('0x1a')](_0x534907,{'showHidden':![],'depth':null}):'');});}exports[_0xa4e2('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xdce5=['system','format','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','schedule','redis','defaults','socket.io-emitter','Setting','chatTimeout','then','findAll','subtract','minutes','info','join','ChatInteraction','update'];(function(_0x451ef1,_0xe452e9){var _0x31735f=function(_0x550aa3){while(--_0x550aa3){_0x451ef1['push'](_0x451ef1['shift']());}};_0x31735f(++_0xe452e9);}(_0xdce5,0x1c9));var _0x5dce=function(_0x738950,_0xf902e8){_0x738950=_0x738950-0x0;var _0x284632=_0xdce5[_0x738950];return _0x284632;};'use strict';var _=require(_0x5dce('0x0'));var moment=require(_0x5dce('0x1'));var Redis=require(_0x5dce('0x2'));var util=require(_0x5dce('0x3'));var config=require(_0x5dce('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x5dce('0x5'));config[_0x5dce('0x6')]=_[_0x5dce('0x7')](config[_0x5dce('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x5dce('0x8'))(new Redis(config[_0x5dce('0x6')]));function closeInteractions(){var _0x2c0f76=0x0;var _0x4d120b=[];return db[_0x5dce('0x9')]['find']({'raw':!![],'attributes':['id',_0x5dce('0xa')],'where':{'id':0x1}})[_0x5dce('0xb')](function(_0x209aa3){_0x2c0f76=_0x209aa3['chatTimeout'];if(_0x2c0f76){return db['ChatInteraction'][_0x5dce('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5dce('0xd')](_0x209aa3[_0x5dce('0xa')],_0x5dce('0xe'))}}});}else{return[];}})[_0x5dce('0xb')](function(_0x1aeb00){if(_0x1aeb00&&_0x1aeb00['length']){_0x4d120b=_['map'](_0x1aeb00||[],'id');logger[_0x5dce('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x4d120b[_0x5dce('0x10')]());return db[_0x5dce('0x11')][_0x5dce('0x12')]({'closeReason':_0x5dce('0x13'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x5dce('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4d120b}});}})[_0x5dce('0xb')](function(){if(_0x4d120b&&_0x4d120b[_0x5dce('0x15')]){logger[_0x5dce('0xf')](_0x5dce('0x16'),_0x4d120b[_0x5dce('0x10')]());for(var _0x5b5725=0x0;_0x5b5725<_0x4d120b[_0x5dce('0x15')];_0x5b5725++){io[_0x5dce('0x17')](_0x5dce('0x18'),{'id':_0x4d120b[_0x5b5725],'closed':!![]});}}})[_0x5dce('0x19')](function(_0x325be5){logger['error'](_0x5dce('0x1a'),_0x325be5?util[_0x5dce('0x1b')](_0x325be5,{'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/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 9489607..902be94 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 _0x8fb9=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x37b803,_0x5d4cb8){var _0x56ab7d=function(_0x4c1f10){while(--_0x4c1f10){_0x37b803['push'](_0x37b803['shift']());}};_0x56ab7d(++_0x5d4cb8);}(_0x8fb9,0x174));var _0x98fb=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x8fb9[_0x295314];return _0x584b0c;};'use strict';function start(){var _0x2908ac=require(_0x98fb('0x0'));return _0x2908ac[_0x98fb('0x1')]();}module[_0x98fb('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xbbb0=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x4ebd36,_0x14acab){var _0x346a11=function(_0x3ffbca){while(--_0x3ffbca){_0x4ebd36['push'](_0x4ebd36['shift']());}};_0x346a11(++_0x14acab);}(_0xbbb0,0x1d4));var _0x0bbb=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xbbb0[_0x186376];return _0x2dbdd9;};'use strict';function start(){var _0x289662=require(_0x0bbb('0x0'));return _0x289662['startAllRefreshIntervals']();}module[_0x0bbb('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 5e36434..e241873 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 _0xe6a3=['difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','run\x20job','cron','active','isBetween','startAt','add','add\x20cron','stop\x20cron','endAt','update','start','util','lodash','cron-job-manager','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','Smtp','user','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','savename','%s.%s','basename','extname','existsSync','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','sendIfEmpty','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','findAll','MailServerOut','CloudProvider','map','toString'];(function(_0xb9ddce,_0x524945){var _0x246755=function(_0xb0234d){while(--_0xb0234d){_0xb9ddce['push'](_0xb9ddce['shift']());}};_0x246755(++_0x524945);}(_0xe6a3,0x104));var _0x3e6a=function(_0x318410,_0x451962){_0x318410=_0x318410-0x0;var _0x2898a3=_0xe6a3[_0x318410];return _0x2898a3;};'use strict';var fs=require('fs');var util=require(_0x3e6a('0x0'));var path=require('path');var _=require(_0x3e6a('0x1'));var moment=require('moment');var CronJobManager=require(_0x3e6a('0x2'));var jayson=require(_0x3e6a('0x3'));var BPromise=require('bluebird');var logger=require(_0x3e6a('0x4'))('schedule');var db=require(_0x3e6a('0x5'))['db'];var analyticCustomReportController=require(_0x3e6a('0x6'));var analyticDefaultReportController=require(_0x3e6a('0x7'));var client=jayson[_0x3e6a('0x8')][_0x3e6a('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2a858e,_0x26e29c){return function(){logger[_0x3e6a('0xa')](_0x3e6a('0xb'),_0x2a858e[_0x3e6a('0xc')]);var _0x56c58e=!![];var _0xa8b8d3=_0x2a858e[_0x3e6a('0xd')][_0x3e6a('0xe')]();var _0xa26930={'account':_0xa8b8d3,'message':{'from':util['format'](_0x3e6a('0xf'),_0x2a858e[_0x3e6a('0xd')][_0x3e6a('0x10')],_0x2a858e[_0x3e6a('0xd')][_0x3e6a('0xc')]||_0x2a858e[_0x3e6a('0xd')][_0x3e6a('0x11')][_0x3e6a('0x12')]),'to':_0x2a858e[_0x3e6a('0xc')],'cc':_0x2a858e['cc'],'bcc':_0x2a858e['bcc'],'subject':util[_0x3e6a('0x13')](_0x3e6a('0x14'),_0x26e29c[_0x3e6a('0x10')],_0x2a858e[_0x3e6a('0x15')],_0x2a858e['subtractUnit'])}};var _0x52eb64=path[_0x3e6a('0x16')](__dirname,'../../files/reports');var _0x34d319=_0x26e29c[_0x3e6a('0x17')];var _0x3d0886=util[_0x3e6a('0x13')](_0x3e6a('0x18'),path[_0x3e6a('0x19')](_0x26e29c[_0x3e6a('0x17')],path[_0x3e6a('0x1a')](_0x26e29c['savename'])),'zip');var _0x4b1d83=path[_0x3e6a('0x16')](_0x52eb64,_0x34d319);var _0x1cb176=path['join'](_0x52eb64,_0x3d0886);if(fs[_0x3e6a('0x1b')](_0x4b1d83)){_0x26e29c['status']='Sent';_0xa26930[_0x3e6a('0x1c')][_0x3e6a('0x1d')]=[{'filename':_0x34d319,'path':_0x4b1d83}];_0xa26930[_0x3e6a('0x1c')][_0x3e6a('0x1e')]=util[_0x3e6a('0x13')](_0x3e6a('0x1f'),JSON[_0x3e6a('0x20')](_0x26e29c,null,0x2));}else if(fs[_0x3e6a('0x1b')](_0x1cb176)){_0x26e29c[_0x3e6a('0x21')]=_0x3e6a('0x22');_0xa26930['message']['attachments']=[{'filename':_0x3d0886,'path':_0x1cb176}];}else{_0xa26930[_0x3e6a('0x1c')][_0x3e6a('0x1e')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2a858e[_0x3e6a('0x23')]){_0x56c58e=![];logger[_0x3e6a('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x56c58e){return client['request'](_0x3e6a('0x24'),_0xa26930)[_0x3e6a('0x25')](function(_0x36d046){if(_0x36d046[_0x3e6a('0x26')]){return logger[_0x3e6a('0x26')](_0x3e6a('0x27'),JSON[_0x3e6a('0x20')](_0x36d046));}return logger[_0x3e6a('0xa')](_0x3e6a('0x28'));})[_0x3e6a('0x29')](function(_0x57aca7){return logger[_0x3e6a('0x26')]('error\x20mail',JSON[_0x3e6a('0x20')](_0x57aca7));});}};}function handleError(){return function(_0x479ad0){return logger[_0x3e6a('0x26')](JSON[_0x3e6a('0x20')](_0x479ad0));};}function handleResult(_0x1982c3){return function(_0x574e07){logger[_0x3e6a('0xa')]('data',JSON[_0x3e6a('0x20')](_0x574e07));if(_0x1982c3[_0x3e6a('0xd')]&&_0x1982c3[_0x3e6a('0xd')][_0x3e6a('0x11')]&&!_['isNil'](_0x1982c3[_0x3e6a('0xc')])){setTimeout(handleSendEmail(_0x1982c3,_0x574e07),0x3c*0x3e8);}};}function handleJob(_0x43cf97){return function(){try{if(_[_0x3e6a('0x2a')](_0x43cf97['subtractNumber'])){return logger['info'](_0x3e6a('0x2b'));}if(_[_0x3e6a('0x2a')](_0x43cf97[_0x3e6a('0x2c')])){return logger[_0x3e6a('0xa')](_0x3e6a('0x2d'));}var _0x450901={'startDate':moment()[_0x3e6a('0x2e')](_0x43cf97['subtractNumber'],_0x43cf97[_0x3e6a('0x2c')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x3e6a('0x13')](_0x3e6a('0x2f')),'type':_0x3e6a('0x30'),'output':_0x43cf97[_0x3e6a('0x31')],'name':_0x43cf97[_0x3e6a('0x10')]};if(!_['isNil'](_0x43cf97[_0x3e6a('0x32')])){logger[_0x3e6a('0xa')](_0x3e6a('0x33'),_0x43cf97[_0x3e6a('0x32')]);return analyticDefaultReportController[_0x3e6a('0x34')]({'id':_0x43cf97[_0x3e6a('0x32')]},_0x450901)[_0x3e6a('0x25')](handleResult(_0x43cf97))[_0x3e6a('0x29')](handleError());}if(!_[_0x3e6a('0x2a')](_0x43cf97[_0x3e6a('0x35')])){logger[_0x3e6a('0xa')]('exec\x20custom\x20report\x20id:%s',_0x43cf97[_0x3e6a('0x35')]);return analyticCustomReportController[_0x3e6a('0x34')]({'id':_0x43cf97[_0x3e6a('0x35')]},_0x450901)[_0x3e6a('0x25')](handleResult(_0x43cf97))[_0x3e6a('0x29')](handleError());}}catch(_0xf0422){logger[_0x3e6a('0x26')](JSON[_0x3e6a('0x20')](_0xf0422));}return logger[_0x3e6a('0xa')](_0x3e6a('0x36'));};}function getJobs(_0x125f6b){var _0x46b4a6={};if(_0x125f6b){_0x46b4a6['id']=_0x125f6b;}return db['Schedule'][_0x3e6a('0x37')]({'where':_0x46b4a6,'include':[{'model':db[_0x3e6a('0xd')],'attributes':['id',_0x3e6a('0x10'),'email'],'include':[{'model':db[_0x3e6a('0x38')],'as':_0x3e6a('0x11'),'include':[{'model':db[_0x3e6a('0x39')],'as':_0x3e6a('0x39')}]}]}]})[_0x3e6a('0x25')](function(_0x2dc988){var _0x1a00a1=_['keys'](manager['jobs']);var _0x43cb2d=_[_0x3e6a('0x3a')](_0x2dc988,function(_0x5a0baf){return _0x5a0baf['id'][_0x3e6a('0x3b')]();});var _0x34adde=_['keyBy'](_0x2dc988,function(_0x2bf6d4){return _0x2bf6d4['id'][_0x3e6a('0x3b')]();});var _0x109580=_0x125f6b?_0x43cb2d:_['difference'](_0x43cb2d,_0x1a00a1);var _0x7e357c=_['intersection'](_0x43cb2d,_0x1a00a1);var _0x4448d=_[_0x3e6a('0x3c')](_0x1a00a1,_0x43cb2d);var _0x2ee38c;var _0x114344;for(_0x2ee38c=0x0;_0x2ee38c<_0x4448d['length']&&!_0x125f6b;_0x2ee38c+=0x1){_0x114344=_0x4448d[_0x2ee38c][_0x3e6a('0x3b')]();if(manager[_0x3e6a('0x3d')](_0x114344)){manager[_0x3e6a('0x3e')](_0x114344);manager[_0x3e6a('0x3f')](_0x114344);logger[_0x3e6a('0xa')](_0x3e6a('0x40'),_0x114344);}}logger[_0x3e6a('0xa')](_0x3e6a('0x41'),JSON[_0x3e6a('0x20')](_0x109580));for(_0x2ee38c=0x0;_0x2ee38c<_0x109580[_0x3e6a('0x42')];_0x2ee38c+=0x1){_0x114344=_0x109580[_0x2ee38c]['toString']();logger[_0x3e6a('0xa')](_0x3e6a('0x43'),_0x114344);if(_0x125f6b){logger[_0x3e6a('0xa')](_0x3e6a('0x44'),_0x125f6b);logger['info'](JSON[_0x3e6a('0x20')](_0x34adde[_0x114344]));BPromise['resolve']()['then'](handleJob(_0x34adde[_0x114344]));logger[_0x3e6a('0xa')](_0x3e6a('0x45'),_0x34adde[_0x114344][_0x3e6a('0x10')],_0x34adde[_0x114344]['cron']);}else if(_0x34adde[_0x114344][_0x3e6a('0x46')]&&_0x34adde[_0x114344][_0x3e6a('0x47')]&&moment()[_0x3e6a('0x48')](_0x34adde[_0x114344][_0x3e6a('0x49')],_0x34adde[_0x114344]['endAt'])){manager[_0x3e6a('0x4a')](_0x114344,_0x34adde[_0x114344]['cron'],handleJob(_0x34adde[_0x114344]));manager['start'](_0x114344);logger[_0x3e6a('0xa')](_0x3e6a('0x4b'),_0x34adde[_0x114344]['name'],_0x34adde[_0x114344][_0x3e6a('0x46')]);}else if(manager[_0x3e6a('0x3d')](_0x114344)){manager[_0x3e6a('0x3e')](_0x114344);manager[_0x3e6a('0x3f')](_0x114344);logger[_0x3e6a('0xa')](_0x3e6a('0x4c'),_0x34adde[_0x114344][_0x3e6a('0x10')],_0x34adde[_0x114344][_0x3e6a('0x46')]);}}for(_0x2ee38c=0x0,_0x114344;_0x2ee38c<_0x7e357c[_0x3e6a('0x42')]&&!_0x125f6b;_0x2ee38c+=0x1){_0x114344=_0x7e357c[_0x2ee38c][_0x3e6a('0x3b')]();if(manager['exists'](_0x114344)){if(_0x34adde[_0x114344]['cron']&&_0x34adde[_0x114344]['active']&&moment()[_0x3e6a('0x48')](_0x34adde[_0x114344][_0x3e6a('0x49')],_0x34adde[_0x114344][_0x3e6a('0x4d')])){manager[_0x3e6a('0x4e')](_0x114344,_0x34adde[_0x114344][_0x3e6a('0x46')],handleJob(_0x34adde[_0x114344]));logger['info']('update\x20cron',_0x34adde[_0x114344][_0x3e6a('0x10')],_0x34adde[_0x114344][_0x3e6a('0x46')]);}else{manager[_0x3e6a('0x3e')](_0x114344);manager[_0x3e6a('0x3f')](_0x114344);logger[_0x3e6a('0xa')](_0x3e6a('0x4c'),_0x34adde[_0x114344][_0x3e6a('0x10')],_0x34adde[_0x114344]['cron']);}}}})[_0x3e6a('0x29')](function(_0x2d07ad){logger[_0x3e6a('0x26')](JSON['stringify'](_0x2d07ad));});}exports['run']=function(_0x472a3e){return getJobs(_0x472a3e);};exports[_0x3e6a('0x4f')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x5391=['length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','exists','stop\x20cron','update\x20cron','run','util','path','lodash','moment','cron-job-manager','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','name','email','Smtp','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','status','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','Sent','attachments','message','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','stringify','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','keyBy','toString','difference','intersection'];(function(_0x219ce3,_0x535de0){var _0x13da3c=function(_0x8417f5){while(--_0x8417f5){_0x219ce3['push'](_0x219ce3['shift']());}};_0x13da3c(++_0x535de0);}(_0x5391,0x11c));var _0x1539=function(_0x3e2b0b,_0xcf603){_0x3e2b0b=_0x3e2b0b-0x0;var _0x8a5b07=_0x5391[_0x3e2b0b];return _0x8a5b07;};'use strict';var fs=require('fs');var util=require(_0x1539('0x0'));var path=require(_0x1539('0x1'));var _=require(_0x1539('0x2'));var moment=require(_0x1539('0x3'));var CronJobManager=require(_0x1539('0x4'));var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1539('0x5'))(_0x1539('0x6'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x1539('0x7'));var analyticDefaultReportController=require(_0x1539('0x8'));var client=jayson[_0x1539('0x9')][_0x1539('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x28ed7c,_0x2c6989){return function(){logger['info'](_0x1539('0xb'),_0x28ed7c['email']);var _0x586376=!![];var _0x1d636d=_0x28ed7c[_0x1539('0xc')][_0x1539('0xd')]();var _0x4c6d3b={'account':_0x1d636d,'message':{'from':util[_0x1539('0xe')]('\x22%s\x22\x20<%s>',_0x28ed7c[_0x1539('0xc')][_0x1539('0xf')],_0x28ed7c[_0x1539('0xc')][_0x1539('0x10')]||_0x28ed7c['MailAccount'][_0x1539('0x11')][_0x1539('0x12')]),'to':_0x28ed7c[_0x1539('0x10')],'cc':_0x28ed7c['cc'],'bcc':_0x28ed7c['bcc'],'subject':util[_0x1539('0xe')](_0x1539('0x13'),_0x2c6989['name'],_0x28ed7c[_0x1539('0x14')],_0x28ed7c[_0x1539('0x15')])}};var _0x153054=path[_0x1539('0x16')](__dirname,_0x1539('0x17'));var _0x5dcb71=_0x2c6989[_0x1539('0x18')];var _0x136d86=util[_0x1539('0xe')](_0x1539('0x19'),path[_0x1539('0x1a')](_0x2c6989['savename'],path[_0x1539('0x1b')](_0x2c6989[_0x1539('0x18')])),_0x1539('0x1c'));var _0x321fc8=path[_0x1539('0x16')](_0x153054,_0x5dcb71);var _0x3fd23a=path[_0x1539('0x16')](_0x153054,_0x136d86);if(fs['existsSync'](_0x321fc8)){_0x2c6989[_0x1539('0x1d')]='Sent';_0x4c6d3b['message']['attachments']=[{'filename':_0x5dcb71,'path':_0x321fc8}];_0x4c6d3b['message'][_0x1539('0x1e')]=util[_0x1539('0xe')](_0x1539('0x1f'),JSON['stringify'](_0x2c6989,null,0x2));}else if(fs[_0x1539('0x20')](_0x3fd23a)){_0x2c6989[_0x1539('0x1d')]=_0x1539('0x21');_0x4c6d3b['message'][_0x1539('0x22')]=[{'filename':_0x136d86,'path':_0x3fd23a}];}else{_0x4c6d3b[_0x1539('0x23')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x28ed7c[_0x1539('0x24')]){_0x586376=![];logger[_0x1539('0x25')](_0x1539('0x26'));}}if(_0x586376){return client[_0x1539('0x27')](_0x1539('0x28'),_0x4c6d3b)[_0x1539('0x29')](function(_0x521ed2){if(_0x521ed2[_0x1539('0x2a')]){return logger[_0x1539('0x2a')]('error\x20mail',JSON[_0x1539('0x2b')](_0x521ed2));}return logger[_0x1539('0x25')]('email\x20sent');})['catch'](function(_0x438e2e){return logger[_0x1539('0x2a')]('error\x20mail',JSON[_0x1539('0x2b')](_0x438e2e));});}};}function handleError(){return function(_0x3859b4){return logger[_0x1539('0x2a')](JSON[_0x1539('0x2b')](_0x3859b4));};}function handleResult(_0x15224b){return function(_0x257eaa){logger[_0x1539('0x25')](_0x1539('0x2c'),JSON[_0x1539('0x2b')](_0x257eaa));if(_0x15224b['MailAccount']&&_0x15224b['MailAccount'][_0x1539('0x11')]&&!_[_0x1539('0x2d')](_0x15224b[_0x1539('0x10')])){setTimeout(handleSendEmail(_0x15224b,_0x257eaa),0x3c*0x3e8);}};}function handleJob(_0x2d0528){return function(){try{if(_[_0x1539('0x2d')](_0x2d0528[_0x1539('0x14')])){return logger['info'](_0x1539('0x2e'));}if(_[_0x1539('0x2d')](_0x2d0528['subtractUnit'])){return logger[_0x1539('0x25')](_0x1539('0x2f'));}var _0x582001={'startDate':moment()[_0x1539('0x30')](_0x2d0528[_0x1539('0x14')],_0x2d0528[_0x1539('0x15')])[_0x1539('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x1539('0xe')](_0x1539('0x31')),'type':_0x1539('0x32'),'output':_0x2d0528['output'],'name':_0x2d0528[_0x1539('0xf')]};if(!_['isNil'](_0x2d0528[_0x1539('0x33')])){logger['info'](_0x1539('0x34'),_0x2d0528[_0x1539('0x33')]);return analyticDefaultReportController[_0x1539('0x35')]({'id':_0x2d0528['DefaultReportId']},_0x582001)[_0x1539('0x29')](handleResult(_0x2d0528))[_0x1539('0x36')](handleError());}if(!_[_0x1539('0x2d')](_0x2d0528[_0x1539('0x37')])){logger[_0x1539('0x25')](_0x1539('0x38'),_0x2d0528[_0x1539('0x37')]);return analyticCustomReportController[_0x1539('0x35')]({'id':_0x2d0528[_0x1539('0x37')]},_0x582001)[_0x1539('0x29')](handleResult(_0x2d0528))['catch'](handleError());}}catch(_0x5cae25){logger[_0x1539('0x2a')](JSON[_0x1539('0x2b')](_0x5cae25));}return logger[_0x1539('0x25')](_0x1539('0x39'));};}function getJobs(_0x484f6a){var _0x391e09={};if(_0x484f6a){_0x391e09['id']=_0x484f6a;}return db[_0x1539('0x3a')][_0x1539('0x3b')]({'where':_0x391e09,'include':[{'model':db[_0x1539('0xc')],'attributes':['id',_0x1539('0xf'),_0x1539('0x10')],'include':[{'model':db[_0x1539('0x3c')],'as':_0x1539('0x11'),'include':[{'model':db['CloudProvider'],'as':_0x1539('0x3d')}]}]}]})[_0x1539('0x29')](function(_0x4d56b4){var _0x1b5282=_['keys'](manager[_0x1539('0x3e')]);var _0x9e8bc2=_[_0x1539('0x3f')](_0x4d56b4,function(_0x195d2b){return _0x195d2b['id']['toString']();});var _0x4d83b2=_[_0x1539('0x40')](_0x4d56b4,function(_0x57a62c){return _0x57a62c['id'][_0x1539('0x41')]();});var _0x46bf3a=_0x484f6a?_0x9e8bc2:_[_0x1539('0x42')](_0x9e8bc2,_0x1b5282);var _0x59dc04=_[_0x1539('0x43')](_0x9e8bc2,_0x1b5282);var _0x43b10d=_[_0x1539('0x42')](_0x1b5282,_0x9e8bc2);var _0x5edada;var _0x1ebe8e;for(_0x5edada=0x0;_0x5edada<_0x43b10d[_0x1539('0x44')]&&!_0x484f6a;_0x5edada+=0x1){_0x1ebe8e=_0x43b10d[_0x5edada][_0x1539('0x41')]();if(manager['exists'](_0x1ebe8e)){manager[_0x1539('0x45')](_0x1ebe8e);manager[_0x1539('0x46')](_0x1ebe8e);logger['info'](_0x1539('0x47'),_0x1ebe8e);}}logger[_0x1539('0x25')](_0x1539('0x48'),JSON[_0x1539('0x2b')](_0x46bf3a));for(_0x5edada=0x0;_0x5edada<_0x46bf3a[_0x1539('0x44')];_0x5edada+=0x1){_0x1ebe8e=_0x46bf3a[_0x5edada]['toString']();logger['info'](_0x1539('0x49'),_0x1ebe8e);if(_0x484f6a){logger[_0x1539('0x25')](_0x1539('0x4a'),_0x484f6a);logger[_0x1539('0x25')](JSON[_0x1539('0x2b')](_0x4d83b2[_0x1ebe8e]));BPromise[_0x1539('0x4b')]()['then'](handleJob(_0x4d83b2[_0x1ebe8e]));logger['info'](_0x1539('0x4c'),_0x4d83b2[_0x1ebe8e]['name'],_0x4d83b2[_0x1ebe8e][_0x1539('0x4d')]);}else if(_0x4d83b2[_0x1ebe8e][_0x1539('0x4d')]&&_0x4d83b2[_0x1ebe8e][_0x1539('0x4e')]&&moment()[_0x1539('0x4f')](_0x4d83b2[_0x1ebe8e][_0x1539('0x50')],_0x4d83b2[_0x1ebe8e][_0x1539('0x51')])){manager[_0x1539('0x52')](_0x1ebe8e,_0x4d83b2[_0x1ebe8e][_0x1539('0x4d')],handleJob(_0x4d83b2[_0x1ebe8e]));manager[_0x1539('0x53')](_0x1ebe8e);logger['info']('add\x20cron',_0x4d83b2[_0x1ebe8e][_0x1539('0xf')],_0x4d83b2[_0x1ebe8e][_0x1539('0x4d')]);}else if(manager[_0x1539('0x54')](_0x1ebe8e)){manager[_0x1539('0x45')](_0x1ebe8e);manager[_0x1539('0x46')](_0x1ebe8e);logger[_0x1539('0x25')](_0x1539('0x55'),_0x4d83b2[_0x1ebe8e][_0x1539('0xf')],_0x4d83b2[_0x1ebe8e][_0x1539('0x4d')]);}}for(_0x5edada=0x0,_0x1ebe8e;_0x5edada<_0x59dc04[_0x1539('0x44')]&&!_0x484f6a;_0x5edada+=0x1){_0x1ebe8e=_0x59dc04[_0x5edada][_0x1539('0x41')]();if(manager[_0x1539('0x54')](_0x1ebe8e)){if(_0x4d83b2[_0x1ebe8e][_0x1539('0x4d')]&&_0x4d83b2[_0x1ebe8e][_0x1539('0x4e')]&&moment()[_0x1539('0x4f')](_0x4d83b2[_0x1ebe8e][_0x1539('0x50')],_0x4d83b2[_0x1ebe8e]['endAt'])){manager['update'](_0x1ebe8e,_0x4d83b2[_0x1ebe8e][_0x1539('0x4d')],handleJob(_0x4d83b2[_0x1ebe8e]));logger['info'](_0x1539('0x56'),_0x4d83b2[_0x1ebe8e][_0x1539('0xf')],_0x4d83b2[_0x1ebe8e]['cron']);}else{manager[_0x1539('0x45')](_0x1ebe8e);manager[_0x1539('0x46')](_0x1ebe8e);logger['info']('stop\x20cron',_0x4d83b2[_0x1ebe8e][_0x1539('0xf')],_0x4d83b2[_0x1ebe8e][_0x1539('0x4d')]);}}}})[_0x1539('0x36')](function(_0x274721){logger[_0x1539('0x2a')](JSON[_0x1539('0x2b')](_0x274721));});}exports[_0x1539('0x57')]=function(_0x11060d){return getJobs(_0x11060d);};exports[_0x1539('0x53')]=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 e57e29d..da16abb 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 _0xa71a=['Negative','Neutral','FAILED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','sentiment','language','sentimentAccountId','findOne','Mixed','name','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','all','SequelizeValidationError','error','start','lodash','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','ValidationError','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','Positive','SentimentScore'];(function(_0x31cdff,_0x545438){var _0x14091f=function(_0x363721){while(--_0x363721){_0x31cdff['push'](_0x31cdff['shift']());}};_0x14091f(++_0x545438);}(_0xa71a,0xf1));var _0xaa71=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa71a[_0x321bb2];return _0x9c12ed;};var _=require(_0xaa71('0x0'));var AWS=require(_0xaa71('0x1'));var rp=require(_0xaa71('0x2'));var util=require(_0xaa71('0x3'));var BPromise=require('bluebird');var db=require(_0xaa71('0x4'))['db'];var logger=require(_0xaa71('0x5'))(_0xaa71('0x6'));function getTranscriptionJob(_0x5efe0e,_0x32d34b,_0x480d9b,_0xd325fb){return new Promise(function(_0x2f476b,_0x1f07bd){var _0x5893aa=new AWS[(_0xaa71('0x7'))]({'accessKeyId':_0x32d34b,'secretAccessKey':_0x5efe0e,'region':_0x480d9b});_0x5893aa[_0xaa71('0x8')]({'TranscriptionJobName':_0xd325fb},function(_0x5a0dca,_0x50ad8f){if(_0x5a0dca){return _0x1f07bd(_0x5a0dca);}else{return _0x2f476b(_0x50ad8f);}});});}function sentiment(_0x2fc645,_0x2ec823,_0xc26148,_0x59f523,_0x59e7b9){return new Promise(function(_0xb81c88,_0x28023d){var _0x1636f5=new AWS[(_0xaa71('0x9'))]({'accessKeyId':_0x2ec823,'secretAccessKey':_0x2fc645,'region':_0xc26148});_0x1636f5[_0xaa71('0xa')]({'Text':_0x59f523,'LanguageCode':_0x59e7b9[_0xaa71('0xb')](0x0,0x2)},function(_0x4ad162,_0x5ce035){if(_0x4ad162){return _0x28023d(_0x4ad162);}else{return _0xb81c88(_0x5ce035);}});});}function checkTranscribeJob(_0x4f9755,_0x464b95,_0x128712){var _0x3b7a53;return new BPromise(function(_0x5603e0,_0x331a56){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0xe'),_0x4f9755['id'],_0x4f9755[_0xaa71('0xf')]));return getTranscriptionJob(_0x128712[_0xaa71('0x10')],_0x128712['data2'],_0x464b95[_0xaa71('0x11')],_0x4f9755[_0xaa71('0xf')])[_0xaa71('0x12')](function(_0x5b4f5a){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x13'),_0x4f9755['id'],_0x4f9755[_0xaa71('0xf')],_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x15')]));if(!_0x4f9755[_0xaa71('0x16')]){switch(_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x15')]){case _0xaa71('0x17'):var _0x58155d={'transcribeStatus':_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x15')],'fileUri':_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x18')][_0xaa71('0x19')]};logger['info'](util[_0xaa71('0xd')]('[RECORDING:%d]\x20Get\x20transcript',_0x4f9755['id']));return rp({'uri':_0x5b4f5a[_0xaa71('0x14')][_0xaa71('0x18')][_0xaa71('0x19')],'json':!![]})[_0xaa71('0x12')](function(_0x2e3f95){logger['info'](util['format'](_0xaa71('0x1a'),_0x4f9755['id']));if(_0x2e3f95&&_0x2e3f95['results']&&_0x2e3f95[_0xaa71('0x1b')][_0xaa71('0x1c')]&&_0x2e3f95[_0xaa71('0x1b')][_0xaa71('0x1c')][_0xaa71('0x1d')]){_0x58155d[_0xaa71('0x16')]='';for(var _0x1bde4f=0x0;_0x1bde4f<_0x2e3f95[_0xaa71('0x1b')][_0xaa71('0x1c')][_0xaa71('0x1d')];_0x1bde4f++){_0x58155d[_0xaa71('0x16')]+=_0x2e3f95[_0xaa71('0x1b')][_0xaa71('0x1c')][_0x1bde4f]['transcript']+'';}}return _0x4f9755['update'](_0x58155d);})[_0xaa71('0x12')](function(){logger[_0xaa71('0xc')](util[_0xaa71('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4f9755['id']));if(!_0x4f9755['tempSentiment']){throw new db[(_0xaa71('0x1e'))]['ValidationError'](_0xaa71('0x1f'));}if(!_0x464b95['sentiment']||!_0x464b95['sentimentAccountId']||!_0x464b95[_0xaa71('0x20')]||!_0x464b95['language']||!_0x464b95[_0xaa71('0x21')]){throw new db[(_0xaa71('0x1e'))]['ValidationError'](_0xaa71('0x22'));}if(!_0x58155d[_0xaa71('0x16')]){throw new Error(_0xaa71('0x23'));}if(_0x464b95['sentimentAccountId']===_0x128712['id']){return _0x128712;}else{return db[_0xaa71('0x24')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xaa71('0x12')](function(_0x4d8050){if(!_0x4d8050){throw new db[(_0xaa71('0x1e'))]['ValidationError'](_0xaa71('0x25'));}if(!_0x4d8050[_0xaa71('0x10')]||!_0x4d8050[_0xaa71('0x26')]){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x28'));}_0x3b7a53=_0x4d8050;logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x29'),_0x4f9755['id']));return sentiment(_0x3b7a53['data1'],_0x3b7a53['data2'],_0x464b95[_0xaa71('0x20')],_0x58155d[_0xaa71('0x16')],_0x464b95['language']);})[_0xaa71('0x12')](function(_0x448702){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x2a'),_0x4f9755['id']));return _0x4f9755[_0xaa71('0x2b')]({'sentiment':_0x448702[_0xaa71('0x2c')],'sPositive':_0x448702['SentimentScore'][_0xaa71('0x2d')],'sNegative':_0x448702[_0xaa71('0x2e')][_0xaa71('0x2f')],'sMixed':_0x448702[_0xaa71('0x2e')]['Mixed'],'sNeutral':_0x448702[_0xaa71('0x2e')][_0xaa71('0x30')]});})[_0xaa71('0x12')](function(){logger['info'](util[_0xaa71('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4f9755['id']));_0x5603e0();});case'FAILED':return _0x4f9755[_0xaa71('0x2b')]({'transcribeStatus':_0xaa71('0x31'),'failureReason':_0x5b4f5a[_0xaa71('0x14')]['FailureReason']})[_0xaa71('0x12')](function(){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x32'),_0x4f9755['id']));_0x5603e0();});default:logger[_0xaa71('0xc')](util['format'](_0xaa71('0x33'),_0x4f9755['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x4f9755[_0xaa71('0x34')]){throw new db['Sequelize'][(_0xaa71('0x27'))](_0xaa71('0x1f'));}if(!_0x464b95[_0xaa71('0x35')]||!_0x464b95['sentimentAccountId']||!_0x464b95[_0xaa71('0x20')]||!_0x464b95[_0xaa71('0x36')]||!_0x464b95['bucket']){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x22'));}if(!_0x4f9755[_0xaa71('0x16')]){throw new Error(_0xaa71('0x23'));}if(_0x464b95[_0xaa71('0x37')]===_0x128712['id']){return _0x128712;}else{return db[_0xaa71('0x24')][_0xaa71('0x38')]({'where':{'id':_settings[_0xaa71('0x37')]}});}})[_0xaa71('0x12')](function(_0x3861bf){if(!_0x3861bf){throw new db[(_0xaa71('0x1e'))]['ValidationError'](_0xaa71('0x25'));}if(!_0x3861bf[_0xaa71('0x10')]||!_0x3861bf[_0xaa71('0x26')]){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x28'));}_0x3b7a53=_0x3861bf;logger[_0xaa71('0xc')](util['format'](_0xaa71('0x29'),_0x4f9755['id']));return sentiment(_0x3b7a53[_0xaa71('0x10')],_0x3b7a53[_0xaa71('0x26')],_0x464b95[_0xaa71('0x20')],_0x4f9755[_0xaa71('0x16')],_0x464b95[_0xaa71('0x36')]);})[_0xaa71('0x12')](function(_0xd1ebc0){logger[_0xaa71('0xc')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x4f9755['id']));return _0x4f9755[_0xaa71('0x2b')]({'sentiment':_0xd1ebc0[_0xaa71('0x2c')],'sPositive':_0xd1ebc0[_0xaa71('0x2e')][_0xaa71('0x2d')],'sNegative':_0xd1ebc0[_0xaa71('0x2e')][_0xaa71('0x2f')],'sMixed':_0xd1ebc0[_0xaa71('0x2e')][_0xaa71('0x39')],'sNeutral':_0xd1ebc0[_0xaa71('0x2e')][_0xaa71('0x30')],'transcribeStatus':_0xaa71('0x17')});})[_0xaa71('0x12')](function(){logger[_0xaa71('0xc')](util[_0xaa71('0xd')](_0xaa71('0x32'),_0x4f9755['id']));_0x5603e0();});}})['catch'](function(_0x10a362){if(_0x10a362){if(!_0x10a362[_0xaa71('0x3a')]||_0x10a362[_0xaa71('0x3a')]!=='SequelizeValidationError'){logger['error'](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x4f9755['id']),util[_0xaa71('0x3b')](_0x10a362,{'showHidden':![],'depth':null}));}}_0x5603e0();});});}function checkTranscribe(){var _0x52fa61;var _0x1c9899;var _0x2b670d;return db[_0xaa71('0x3c')][_0xaa71('0x3d')]({'where':{'transcribeStatus':_0xaa71('0x3e')}})[_0xaa71('0x12')](function(_0x4e9be7){if(!_0x4e9be7||!_0x4e9be7[_0xaa71('0x1d')]){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x3f'));}_0x52fa61=_0x4e9be7;return db[_0xaa71('0x40')][_0xaa71('0x38')]({'where':{'id':0x1}});})[_0xaa71('0x12')](function(_0x303417){if(!_0x303417){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x41'));}_0x1c9899=_0x303417;if(!_0x1c9899[_0xaa71('0x6')]||!_0x1c9899[_0xaa71('0x42')]||!_0x1c9899['transcribeRegion']||!_0x1c9899[_0xaa71('0x36')]||!_0x1c9899[_0xaa71('0x21')]){throw new db[(_0xaa71('0x1e'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0xaa71('0x24')][_0xaa71('0x38')]({'where':{'id':_0x1c9899[_0xaa71('0x42')]}});})[_0xaa71('0x12')](function(_0x5762b5){if(!_0x5762b5){throw new db['Sequelize']['ValidationError'](_0xaa71('0x25'));}if(!_0x5762b5[_0xaa71('0x10')]||!_0x5762b5[_0xaa71('0x26')]){throw new db[(_0xaa71('0x1e'))][(_0xaa71('0x27'))](_0xaa71('0x28'));}_0x2b670d=_0x5762b5;var _0x5a5c37=[];_0x52fa61[_0xaa71('0x43')](function(_0x1634b8){_0x5a5c37['push'](checkTranscribeJob(_0x1634b8,_0x1c9899,_0x2b670d));});return BPromise[_0xaa71('0x44')](_0x5a5c37);})['catch'](function(_0x331fd9){if(_0x331fd9){if(!_0x331fd9[_0xaa71('0x3a')]||_0x331fd9[_0xaa71('0x3a')]!==_0xaa71('0x45')){logger[_0xaa71('0x46')](util[_0xaa71('0x3b')](_0x331fd9,{'showHidden':![],'depth':null}));}}});}exports[_0xaa71('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0xa062=['transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','bucket','Cloud\x20Provider\x20not\x20available','Sentiment','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','inspect','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','substring','info','transcribeName','data1','transcribeRegion','then','format','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','fileText'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa062,0x101));var _0x2a06=function(_0x124d97,_0x1f72a9){_0x124d97=_0x124d97-0x0;var _0xda85e=_0xa062[_0x124d97];return _0xda85e;};var _=require(_0x2a06('0x0'));var AWS=require(_0x2a06('0x1'));var rp=require(_0x2a06('0x2'));var util=require('util');var BPromise=require(_0x2a06('0x3'));var db=require(_0x2a06('0x4'))['db'];var logger=require(_0x2a06('0x5'))(_0x2a06('0x6'));function getTranscriptionJob(_0x5e6e85,_0x313241,_0x56d270,_0x4b75c2){return new Promise(function(_0x1376ba,_0x1ba42f){var _0x3626b6=new AWS[(_0x2a06('0x7'))]({'accessKeyId':_0x313241,'secretAccessKey':_0x5e6e85,'region':_0x56d270});_0x3626b6[_0x2a06('0x8')]({'TranscriptionJobName':_0x4b75c2},function(_0x448892,_0x5da16b){if(_0x448892){return _0x1ba42f(_0x448892);}else{return _0x1376ba(_0x5da16b);}});});}function sentiment(_0x2a09df,_0x30e8c5,_0x4ed6fc,_0x2bcc82,_0xd2a1a0){return new Promise(function(_0x125a74,_0x533012){var _0x528c65=new AWS['Comprehend']({'accessKeyId':_0x30e8c5,'secretAccessKey':_0x2a09df,'region':_0x4ed6fc});_0x528c65['detectSentiment']({'Text':_0x2bcc82,'LanguageCode':_0xd2a1a0[_0x2a06('0x9')](0x0,0x2)},function(_0x300b57,_0x5e8afe){if(_0x300b57){return _0x533012(_0x300b57);}else{return _0x125a74(_0x5e8afe);}});});}function checkTranscribeJob(_0x45988e,_0x1ae9bb,_0x329cdf){var _0x179b0e;return new BPromise(function(_0x19f480,_0x760c01){logger[_0x2a06('0xa')](util['format']('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x45988e['id'],_0x45988e[_0x2a06('0xb')]));return getTranscriptionJob(_0x329cdf[_0x2a06('0xc')],_0x329cdf['data2'],_0x1ae9bb[_0x2a06('0xd')],_0x45988e[_0x2a06('0xb')])[_0x2a06('0xe')](function(_0x1ba819){logger[_0x2a06('0xa')](util[_0x2a06('0xf')](_0x2a06('0x10'),_0x45988e['id'],_0x45988e[_0x2a06('0xb')],_0x1ba819[_0x2a06('0x11')][_0x2a06('0x12')]));if(!_0x45988e['fileText']){switch(_0x1ba819[_0x2a06('0x11')][_0x2a06('0x12')]){case _0x2a06('0x13'):var _0x285d6a={'transcribeStatus':_0x1ba819[_0x2a06('0x11')][_0x2a06('0x12')],'fileUri':_0x1ba819[_0x2a06('0x11')][_0x2a06('0x14')][_0x2a06('0x15')]};logger[_0x2a06('0xa')](util[_0x2a06('0xf')](_0x2a06('0x16'),_0x45988e['id']));return rp({'uri':_0x1ba819['TranscriptionJob'][_0x2a06('0x14')][_0x2a06('0x15')],'json':!![]})[_0x2a06('0xe')](function(_0x393cc4){logger[_0x2a06('0xa')](util[_0x2a06('0xf')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x45988e['id']));if(_0x393cc4&&_0x393cc4['results']&&_0x393cc4[_0x2a06('0x17')]['transcripts']&&_0x393cc4['results'][_0x2a06('0x18')][_0x2a06('0x19')]){_0x285d6a[_0x2a06('0x1a')]='';for(var _0x1d61dc=0x0;_0x1d61dc<_0x393cc4[_0x2a06('0x17')][_0x2a06('0x18')]['length'];_0x1d61dc++){_0x285d6a['fileText']+=_0x393cc4[_0x2a06('0x17')][_0x2a06('0x18')][_0x1d61dc][_0x2a06('0x1b')]+'';}}return _0x45988e[_0x2a06('0x1c')](_0x285d6a);})[_0x2a06('0xe')](function(){logger['info'](util[_0x2a06('0xf')](_0x2a06('0x1d'),_0x45988e['id']));if(!_0x45988e['tempSentiment']){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x20'));}if(!_0x1ae9bb[_0x2a06('0x21')]||!_0x1ae9bb[_0x2a06('0x22')]||!_0x1ae9bb['sentimentRegion']||!_0x1ae9bb[_0x2a06('0x23')]||!_0x1ae9bb['bucket']){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x24'));}if(!_0x285d6a[_0x2a06('0x1a')]){throw new Error(_0x2a06('0x25'));}if(_0x1ae9bb['sentimentAccountId']===_0x329cdf['id']){return _0x329cdf;}else{return db[_0x2a06('0x26')][_0x2a06('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})['then'](function(_0x5b48e7){if(!_0x5b48e7){throw new db[(_0x2a06('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x5b48e7[_0x2a06('0xc')]||!_0x5b48e7[_0x2a06('0x28')]){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x29'));}_0x179b0e=_0x5b48e7;logger[_0x2a06('0xa')](util[_0x2a06('0xf')](_0x2a06('0x2a'),_0x45988e['id']));return sentiment(_0x179b0e[_0x2a06('0xc')],_0x179b0e['data2'],_0x1ae9bb[_0x2a06('0x2b')],_0x285d6a[_0x2a06('0x1a')],_0x1ae9bb[_0x2a06('0x23')]);})['then'](function(_0x5339bb){logger[_0x2a06('0xa')](util[_0x2a06('0xf')](_0x2a06('0x2c'),_0x45988e['id']));return _0x45988e['update']({'sentiment':_0x5339bb['Sentiment'],'sPositive':_0x5339bb[_0x2a06('0x2d')][_0x2a06('0x2e')],'sNegative':_0x5339bb[_0x2a06('0x2d')][_0x2a06('0x2f')],'sMixed':_0x5339bb['SentimentScore'][_0x2a06('0x30')],'sNeutral':_0x5339bb['SentimentScore'][_0x2a06('0x31')]});})[_0x2a06('0xe')](function(){logger['info'](util['format'](_0x2a06('0x1d'),_0x45988e['id']));_0x19f480();});case _0x2a06('0x32'):return _0x45988e[_0x2a06('0x1c')]({'transcribeStatus':_0x2a06('0x32'),'failureReason':_0x1ba819['TranscriptionJob']['FailureReason']})['then'](function(){logger[_0x2a06('0xa')](util[_0x2a06('0xf')](_0x2a06('0x1d'),_0x45988e['id']));_0x19f480();});default:logger[_0x2a06('0xa')](util[_0x2a06('0xf')](_0x2a06('0x33'),_0x45988e['id']));break;}}else{return BPromise[_0x2a06('0x34')]()['then'](function(){if(!_0x45988e['tempSentiment']){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x20'));}if(!_0x1ae9bb[_0x2a06('0x21')]||!_0x1ae9bb[_0x2a06('0x22')]||!_0x1ae9bb[_0x2a06('0x2b')]||!_0x1ae9bb[_0x2a06('0x23')]||!_0x1ae9bb[_0x2a06('0x35')]){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x24'));}if(!_0x45988e[_0x2a06('0x1a')]){throw new Error(_0x2a06('0x25'));}if(_0x1ae9bb[_0x2a06('0x22')]===_0x329cdf['id']){return _0x329cdf;}else{return db[_0x2a06('0x26')][_0x2a06('0x27')]({'where':{'id':_settings[_0x2a06('0x22')]}});}})[_0x2a06('0xe')](function(_0x4ccb9d){if(!_0x4ccb9d){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x36'));}if(!_0x4ccb9d[_0x2a06('0xc')]||!_0x4ccb9d[_0x2a06('0x28')]){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x29'));}_0x179b0e=_0x4ccb9d;logger[_0x2a06('0xa')](util[_0x2a06('0xf')](_0x2a06('0x2a'),_0x45988e['id']));return sentiment(_0x179b0e[_0x2a06('0xc')],_0x179b0e[_0x2a06('0x28')],_0x1ae9bb[_0x2a06('0x2b')],_0x45988e[_0x2a06('0x1a')],_0x1ae9bb[_0x2a06('0x23')]);})[_0x2a06('0xe')](function(_0x1d8919){logger[_0x2a06('0xa')](util[_0x2a06('0xf')](_0x2a06('0x2c'),_0x45988e['id']));return _0x45988e['update']({'sentiment':_0x1d8919[_0x2a06('0x37')],'sPositive':_0x1d8919['SentimentScore']['Positive'],'sNegative':_0x1d8919[_0x2a06('0x2d')]['Negative'],'sMixed':_0x1d8919[_0x2a06('0x2d')]['Mixed'],'sNeutral':_0x1d8919['SentimentScore'][_0x2a06('0x31')],'transcribeStatus':_0x2a06('0x13')});})[_0x2a06('0xe')](function(){logger[_0x2a06('0xa')](util['format'](_0x2a06('0x1d'),_0x45988e['id']));_0x19f480();});}})[_0x2a06('0x38')](function(_0x3e5f7d){if(_0x3e5f7d){if(!_0x3e5f7d[_0x2a06('0x39')]||_0x3e5f7d['name']!==_0x2a06('0x3a')){logger[_0x2a06('0x3b')](util[_0x2a06('0xf')](_0x2a06('0x3c'),_0x45988e['id']),util['inspect'](_0x3e5f7d,{'showHidden':![],'depth':null}));}}_0x19f480();});});}function checkTranscribe(){var _0x22dd68;var _0x2900e1;var _0x55b004;return db[_0x2a06('0x3d')][_0x2a06('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x2a06('0xe')](function(_0x16aba6){if(!_0x16aba6||!_0x16aba6[_0x2a06('0x19')]){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))]('No\x20transcribe\x20job\x20to\x20check');}_0x22dd68=_0x16aba6;return db['Setting'][_0x2a06('0x27')]({'where':{'id':0x1}});})['then'](function(_0x123061){if(!_0x123061){throw new db['Sequelize']['ValidationError'](_0x2a06('0x3f'));}_0x2900e1=_0x123061;if(!_0x2900e1['transcribe']||!_0x2900e1[_0x2a06('0x40')]||!_0x2900e1[_0x2a06('0xd')]||!_0x2900e1['language']||!_0x2900e1[_0x2a06('0x35')]){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x41'));}return db[_0x2a06('0x26')][_0x2a06('0x27')]({'where':{'id':_0x2900e1['transcribeAccountId']}});})[_0x2a06('0xe')](function(_0x4e7e73){if(!_0x4e7e73){throw new db[(_0x2a06('0x1e'))][(_0x2a06('0x1f'))](_0x2a06('0x36'));}if(!_0x4e7e73[_0x2a06('0xc')]||!_0x4e7e73[_0x2a06('0x28')]){throw new db[(_0x2a06('0x1e'))]['ValidationError'](_0x2a06('0x29'));}_0x55b004=_0x4e7e73;var _0x153a06=[];_0x22dd68[_0x2a06('0x42')](function(_0xbae561){_0x153a06[_0x2a06('0x43')](checkTranscribeJob(_0xbae561,_0x2900e1,_0x55b004));});return BPromise[_0x2a06('0x44')](_0x153a06);})[_0x2a06('0x38')](function(_0x5e204c){if(_0x5e204c){if(!_0x5e204c[_0x2a06('0x39')]||_0x5e204c['name']!=='SequelizeValidationError'){logger['error'](util[_0x2a06('0x45')](_0x5e204c,{'showHidden':![],'depth':null}));}}});}exports[_0x2a06('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index d1c5741..be544c9 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 _0xa9ac=['hours','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','start','lodash','moment','util','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','WhatsappInteraction','findAll','subtract'];(function(_0x571411,_0x2fcc8b){var _0x34c2a9=function(_0x52e41b){while(--_0x52e41b){_0x571411['push'](_0x571411['shift']());}};_0x34c2a9(++_0x2fcc8b);}(_0xa9ac,0xb4));var _0xca9a=function(_0xff659d,_0x2283a1){_0xff659d=_0xff659d-0x0;var _0x19c170=_0xa9ac[_0xff659d];return _0x19c170;};'use strict';var _=require(_0xca9a('0x0'));var moment=require(_0xca9a('0x1'));var Redis=require('ioredis');var util=require(_0xca9a('0x2'));var config=require(_0xca9a('0x3'));var db=require(_0xca9a('0x4'))['db'];var logger=require('../logger')('schedule');config[_0xca9a('0x5')]=_[_0xca9a('0x6')](config['redis'],{'host':_0xca9a('0x7'),'port':0x18eb});var io=require(_0xca9a('0x8'))(new Redis(config[_0xca9a('0x5')]));function closeInteractions(){var _0x4719cc=[];return db[_0xca9a('0x9')][_0xca9a('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xca9a('0xb')](0x18,_0xca9a('0xc'))}}})['then'](function(_0xb324f5){if(_0xb324f5&&_0xb324f5[_0xca9a('0xd')]){_0x4719cc=_[_0xca9a('0xe')](_0xb324f5||[],'id');logger['info'](_0xca9a('0xf'),_0x4719cc[_0xca9a('0x10')]());return db[_0xca9a('0x9')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4719cc}});}})['then'](function(){if(_0x4719cc&&_0x4719cc[_0xca9a('0xd')]){logger[_0xca9a('0x11')](_0xca9a('0x12'),_0x4719cc['join']());for(var _0x4beae1=0x0;_0x4beae1<_0x4719cc['length'];_0x4beae1++){io[_0xca9a('0x13')]('whatsappInteraction:update',{'id':_0x4719cc[_0x4beae1],'closed':!![]});}}})[_0xca9a('0x14')](function(_0x5cf980){logger[_0xca9a('0x15')](_0xca9a('0x16'),_0x5cf980?util['inspect'](_0x5cf980,{'showHidden':![],'depth':null}):'');});}exports[_0xca9a('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8bf8=['util','../../config/environment','../../mysqldb','schedule','redis','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','error','inspect','lodash','moment','ioredis'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x8bf8,0x84));var _0x88bf=function(_0x4a5531,_0x58895c){_0x4a5531=_0x4a5531-0x0;var _0xce9b10=_0x8bf8[_0x4a5531];return _0xce9b10;};'use strict';var _=require(_0x88bf('0x0'));var moment=require(_0x88bf('0x1'));var Redis=require(_0x88bf('0x2'));var util=require(_0x88bf('0x3'));var config=require(_0x88bf('0x4'));var db=require(_0x88bf('0x5'))['db'];var logger=require('../logger')(_0x88bf('0x6'));config[_0x88bf('0x7')]=_['defaults'](config[_0x88bf('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x88bf('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x54e189=[];return db[_0x88bf('0x9')][_0x88bf('0xa')]({'raw':!![],'attributes':['id',_0x88bf('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x88bf('0xc'))}}})[_0x88bf('0xd')](function(_0x2aec92){if(_0x2aec92&&_0x2aec92[_0x88bf('0xe')]){_0x54e189=_[_0x88bf('0xf')](_0x2aec92||[],'id');logger[_0x88bf('0x10')](_0x88bf('0x11'),_0x54e189['join']());return db[_0x88bf('0x9')][_0x88bf('0x12')]({'closeReason':_0x88bf('0x13'),'disposition':_0x88bf('0x14'),'closed':!![],'closedAt':moment()[_0x88bf('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x54e189}});}})[_0x88bf('0xd')](function(){if(_0x54e189&&_0x54e189[_0x88bf('0xe')]){logger[_0x88bf('0x10')](_0x88bf('0x16'),_0x54e189[_0x88bf('0x17')]());for(var _0x44b3a2=0x0;_0x44b3a2<_0x54e189[_0x88bf('0xe')];_0x44b3a2++){io[_0x88bf('0x18')]('whatsappInteraction:update',{'id':_0x54e189[_0x44b3a2],'closed':!![]});}}})['catch'](function(_0x403c88){logger[_0x88bf('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x403c88?util[_0x88bf('0x1a')](_0x403c88,{'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 bc4381f..2aa7d43 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdcc=['now','CmContact','destroy','then','bulkCreate','finished\x20populating','log','contacts2','CmHopper','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','push'];(function(_0x202ea3,_0x38ab41){var _0x58787b=function(_0x1dce0b){while(--_0x1dce0b){_0x202ea3['push'](_0x202ea3['shift']());}};_0x58787b(++_0x38ab41);}(_0xfdcc,0x161));var _0xcfdc=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xfdcc[_0x2ff238];return _0x204a56;};'use strict';var util=require(_0xcfdc('0x0'));var db=require(_0xcfdc('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xcfdc('0x2')+i,'lastName':_0xcfdc('0x3')+i,'phone':0xf879fb460+i,'email':_0xcfdc('0x4')+i+_0xcfdc('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xcfdc('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xcfdc('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xcfdc('0x7')](),'updatedAt':Date[_0xcfdc('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xcfdc('0x6')]({'id':i,'firstName':_0xcfdc('0x2')+i,'lastName':_0xcfdc('0x3')+i,'phone':0xf879fb460+i,'email':_0xcfdc('0x4')+i+_0xcfdc('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xcfdc('0x6')]({'id':i,'active':![],'scheduledat':Date[_0xcfdc('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xcfdc('0x7')](),'updatedAt':Date[_0xcfdc('0x7')]()});}db[_0xcfdc('0x8')][_0xcfdc('0x9')]({'where':{}})[_0xcfdc('0xa')](function(){return db['CmContact'][_0xcfdc('0xb')](contacts);})['then'](function(){console['log'](_0xcfdc('0xc'),'contacts1');return db['CmHopper']['destroy']({'where':{}});})[_0xcfdc('0xa')](function(){return db['CmHopper'][_0xcfdc('0xb')](hopper);})[_0xcfdc('0xa')](function(){console[_0xcfdc('0xd')](_0xcfdc('0xc'),'hopper1');return db[_0xcfdc('0x8')][_0xcfdc('0xb')](contacts2);})[_0xcfdc('0xa')](function(){console[_0xcfdc('0xd')](_0xcfdc('0xc'),_0xcfdc('0xe'));return db[_0xcfdc('0xf')][_0xcfdc('0xb')](hopper2);})['then'](function(){console[_0xcfdc('0xd')](_0xcfdc('0xc'),_0xcfdc('0x10'));})[_0xcfdc('0x11')](function(_0x570e13){console[_0xcfdc('0xd')](_0x570e13);}); \ No newline at end of file +var _0x785f=['finished\x20populating','contacts1','CmHopper','hopper1','bulkCreate','contacts2','hopper2','catch','util','push','Innocenzo','innocenzo.biondo','@xcally.com','now','Biondo','CmContact','destroy','then','log'];(function(_0x35488c,_0x43a07c){var _0x566215=function(_0x112af2){while(--_0x112af2){_0x35488c['push'](_0x35488c['shift']());}};_0x566215(++_0x43a07c);}(_0x785f,0xff));var _0xf785=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x785f[_0x456fb1];return _0x4083d6;};'use strict';var util=require(_0xf785('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf785('0x1')]({'id':i,'firstName':_0xf785('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xf785('0x3')+i+_0xf785('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xf785('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf785('0x5')](),'updatedAt':Date[_0xf785('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf785('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xf785('0x6')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xf785('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf785('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xf785('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf785('0x5')](),'updatedAt':Date[_0xf785('0x5')]()});}db[_0xf785('0x7')][_0xf785('0x8')]({'where':{}})[_0xf785('0x9')](function(){return db[_0xf785('0x7')]['bulkCreate'](contacts);})[_0xf785('0x9')](function(){console[_0xf785('0xa')](_0xf785('0xb'),_0xf785('0xc'));return db[_0xf785('0xd')][_0xf785('0x8')]({'where':{}});})[_0xf785('0x9')](function(){return db[_0xf785('0xd')]['bulkCreate'](hopper);})[_0xf785('0x9')](function(){console[_0xf785('0xa')](_0xf785('0xb'),_0xf785('0xe'));return db[_0xf785('0x7')][_0xf785('0xf')](contacts2);})['then'](function(){console[_0xf785('0xa')](_0xf785('0xb'),_0xf785('0x10'));return db[_0xf785('0xd')][_0xf785('0xf')](hopper2);})['then'](function(){console['log'](_0xf785('0xb'),_0xf785('0x11'));})[_0xf785('0x12')](function(_0x2e6dc1){console[_0xf785('0xa')](_0x2e6dc1);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 2a1e9da..d676a64 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7364=['/etc/pki/tls/private/motion.key','User','then','add\x20user','catch','log','util','../mysqldb','format','%s%s','agent','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x2e7656,_0xedcebb){var _0x5a770f=function(_0x5ef09e){while(--_0x5ef09e){_0x2e7656['push'](_0x2e7656['shift']());}};_0x5a770f(++_0xedcebb);}(_0x7364,0xd6));var _0x4736=function(_0x588e0e,_0x2893b4){_0x588e0e=_0x588e0e-0x0;var _0x548ead=_0x7364[_0x588e0e];return _0x548ead;};'use strict';var util=require(_0x4736('0x0'));var db=require(_0x4736('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x4736('0x2')](_0x4736('0x3'),_0x4736('0x4'),i),'fullname':util[_0x4736('0x2')]('%s%s',_0x4736('0x4'),i),'email':util[_0x4736('0x2')]('%s%s@xcally.com','agent',i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0x4736('0x5'),'transport':['udp','ws',_0x4736('0x6')],'disallow':['all'],'allow':[_0x4736('0x7')],'defaultuser':util['format']('%s%s',_0x4736('0x4'),i),'encryption':_0x4736('0x8'),'avpf':'yes','force_avp':_0x4736('0x8'),'icesupport':_0x4736('0x8'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x4736('0x9'),'dtlsprivatekey':_0x4736('0xa'),'dtlssetup':'actpass','callerid':util[_0x4736('0x2')]('\x22%s\x22\x20<%s>',util[_0x4736('0x2')](_0x4736('0x3'),_0x4736('0x4'),i),0xfa0+i)});}db[_0x4736('0xb')]['bulkCreate'](users)[_0x4736('0xc')](function(){console['log'](_0x4736('0xd'));})[_0x4736('0xe')](function(_0x1895e5){console[_0x4736('0xf')](_0x1895e5);}); \ No newline at end of file +var _0xf287=['push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb'];(function(_0x5b9568,_0x1bce36){var _0x336b76=function(_0x377bf7){while(--_0x377bf7){_0x5b9568['push'](_0x5b9568['shift']());}};_0x336b76(++_0x1bce36);}(_0xf287,0x67));var _0x7f28=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xf287[_0x1d1779];return _0x2377e9;};'use strict';var util=require(_0x7f28('0x0'));var db=require(_0x7f28('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7f28('0x2')]({'name':util['format'](_0x7f28('0x3'),_0x7f28('0x4'),i),'fullname':util[_0x7f28('0x5')](_0x7f28('0x3'),_0x7f28('0x4'),i),'email':util[_0x7f28('0x5')](_0x7f28('0x6'),_0x7f28('0x4'),i),'role':'agent','password':_0x7f28('0x7'),'internal':0xfa0+i,'type':_0x7f28('0x8'),'transport':[_0x7f28('0x9'),'ws','wss'],'disallow':[_0x7f28('0xa')],'allow':['ulaw'],'defaultuser':util[_0x7f28('0x5')](_0x7f28('0x3'),_0x7f28('0x4'),i),'encryption':_0x7f28('0xb'),'avpf':_0x7f28('0xb'),'force_avp':'yes','icesupport':_0x7f28('0xb'),'dtlsenable':_0x7f28('0xb'),'dtlsverify':'no','dtlscertfile':_0x7f28('0xc'),'dtlsprivatekey':_0x7f28('0xd'),'dtlssetup':_0x7f28('0xe'),'callerid':util[_0x7f28('0x5')]('\x22%s\x22\x20<%s>',util['format'](_0x7f28('0x3'),_0x7f28('0x4'),i),0xfa0+i)});}db[_0x7f28('0xf')][_0x7f28('0x10')](users)[_0x7f28('0x11')](function(){console[_0x7f28('0x12')](_0x7f28('0x13'));})[_0x7f28('0x14')](function(_0xcf154f){console[_0x7f28('0x12')](_0xcf154f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 07d4bcd..a25f968 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaac4=['default','connection','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','CONNECTED','lodash','util','../mysqldb','./environment','name','User','role','agent','type','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','then','resourceId','where','ivr','format','%s:queue:%s','Agents','length','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:inbound','include','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','FaxQueues','FaxQueue','Trunks','IvrCampaigns','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','map','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join'];(function(_0x387056,_0x5550a5){var _0x3b276d=function(_0x4d375e){while(--_0x4d375e){_0x387056['push'](_0x387056['shift']());}};_0x3b276d(++_0x5550a5);}(_0xaac4,0x6c));var _0x4aac=function(_0x5b2d38,_0x3c461a){_0x5b2d38=_0x5b2d38-0x0;var _0x2f7806=_0xaac4[_0x5b2d38];return _0x2f7806;};'use strict';var _=require(_0x4aac('0x0'));var util=require(_0x4aac('0x1'));var BPromise=require('bluebird');var db=require(_0x4aac('0x2'))['db'];var config=require(_0x4aac('0x3'));var queryQueues={'attributes':['id',_0x4aac('0x4')],'include':[{'as':'Agents','model':db[_0x4aac('0x5')],'attributes':['id',_0x4aac('0x4'),_0x4aac('0x6')],'raw':!![],'where':{'role':_0x4aac('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4aac('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x4aac('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x4aac('0x4')],'where':{'role':_0x4aac('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x4aac('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x3ba0ea,_0x83c258,_0x239771){return db[_0x4aac('0x9')][_0x4aac('0xa')]({'where':{'name':_0x3ba0ea,'userProfileId':_0x83c258},'raw':!![]})['then'](function(_0xabb74){if(_0xabb74){if(_0xabb74[_0x4aac('0xb')]){switch(_0x3ba0ea){case _0x4aac('0xc'):case _0x4aac('0xd'):case'FaxQueues':case _0x4aac('0xe'):case _0x4aac('0xf'):case _0x4aac('0x10'):case _0x4aac('0x11'):return db[_0x239771][_0x4aac('0x12')](queryQueues);case _0x4aac('0x13'):return db[_0x239771][_0x4aac('0x12')](queryTelephones);case'Trunks':return db[_0x239771][_0x4aac('0x12')](queryTrunks);case'IvrCampaigns':return db[_0x239771][_0x4aac('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0x4aac('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0xabb74['id']},'raw':!![]})[_0x4aac('0x14')](function(_0x442883){if(_0x442883){var _0x2dca5b={'where':{'id':_['map'](_0x442883,_0x4aac('0x15'))},'raw':!![]};switch(_0x239771){case _0x4aac('0x5'):_0x2dca5b['where']['role']='telephone';break;case'Campaign':_0x2dca5b[_0x4aac('0x16')][_0x4aac('0x8')]=_0x4aac('0x17');break;}return db[_0x239771]['findAll'](_0x2dca5b);}else{return[];}});}}else{return[];}})[_0x4aac('0x14')](function(_0x375f81){return _0x375f81;});}function joinOrLeaveQueues(_0x2f751b,_0x2b4ab0,_0x22a0fe,_0x2da712){_0x2f751b[_0x2b4ab0](util[_0x4aac('0x18')](_0x4aac('0x19'),_0x22a0fe,_0x2da712[_0x4aac('0x4')]));if(_0x2da712[_0x4aac('0x1a')]){for(var _0x39d457=0x0;_0x39d457<_0x2da712['Agents'][_0x4aac('0x1b')];_0x39d457+=0x1){_0x2f751b[_0x2b4ab0](util[_0x4aac('0x18')]('user:%s',_0x2da712[_0x4aac('0x1a')][_0x39d457]['name']));}}}function joinOrLeave(_0x1f35f3,_0x23fb33,_0x34a384){var _0x3d4836;if(_0x1f35f3[_0x4aac('0x1c')][_0x4aac('0x1d')]['id']){db[_0x4aac('0x5')]['find']({'attributes':['id',_0x4aac('0x4'),_0x4aac('0x6'),_0x4aac('0x1e')],'where':{'id':_0x1f35f3['handshake'][_0x4aac('0x1d')]['id']},'include':[{'model':db[_0x4aac('0x1f')],'as':_0x4aac('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x4aac('0x21')],'as':_0x4aac('0x22'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x4aac('0x23'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4aac('0x24')],'as':_0x4aac('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4aac('0x26')],'as':_0x4aac('0x27'),'attributes':['id'],'raw':!![]}]})[_0x4aac('0x14')](function(_0x5133b8){if(_0x5133b8){_0x3d4836=_0x5133b8;_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')](_0x4aac('0x28'),_0x5133b8['name']));var _0x869ea2=[];switch(_0x5133b8[_0x4aac('0x6')]){case'admin':_0x1f35f3[_0x23fb33](_0x4aac('0x29'));_0x1f35f3[_0x23fb33]('voice:outbound');if(queryQueues['hasOwnProperty'](_0x4aac('0x2a'))){delete queryQueues[_0x4aac('0x2a')];}_0x869ea2[_0x4aac('0x2b')](db['VoiceQueue'][_0x4aac('0x12')](queryQueues));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x2c')][_0x4aac('0x12')](queryQueues));_0x869ea2[_0x4aac('0x2b')](db['FaxQueue'][_0x4aac('0x12')](queryQueues));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x2d')][_0x4aac('0x12')](queryQueues));_0x869ea2['push'](db[_0x4aac('0x2e')][_0x4aac('0x12')](queryQueues));_0x869ea2['push'](db[_0x4aac('0x2f')][_0x4aac('0x12')](queryQueues));_0x869ea2['push'](db[_0x4aac('0x30')][_0x4aac('0x12')](queryQueues));_0x869ea2[_0x4aac('0x2b')](db['User']['findAll'](queryTelephones));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x31')]['findAll'](queryTrunks));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x32')]['findAll'](queryCampaigns));_0x869ea2[_0x4aac('0x2b')](db[_0x4aac('0x5')][_0x4aac('0x12')](queryAgents));break;case _0x4aac('0x33'):_0x1f35f3[_0x23fb33](_0x4aac('0x29'));_0x1f35f3[_0x23fb33](_0x4aac('0x34'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0xc'),_0x5133b8[_0x4aac('0x1e')],'VoiceQueue'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0xd'),_0x5133b8[_0x4aac('0x1e')],'ChatQueue'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0x35'),_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x36')));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0xe'),_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x2d')));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0xf'),_0x5133b8[_0x4aac('0x1e')],'MailQueue'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources('OpenchannelQueues',_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x2f')));_0x869ea2['push'](getAssociatedResources(_0x4aac('0x11'),_0x5133b8['userProfileId'],'WhatsappQueue'));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0x13'),_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x5')));_0x869ea2['push'](getAssociatedResources(_0x4aac('0x37'),_0x5133b8[_0x4aac('0x1e')],_0x4aac('0x31')));_0x869ea2[_0x4aac('0x2b')](getAssociatedResources(_0x4aac('0x38'),_0x5133b8[_0x4aac('0x1e')],'Campaign'));_0x869ea2[_0x4aac('0x2b')](db['User'][_0x4aac('0x12')](queryAgents));break;case _0x4aac('0x7'):_0x1f35f3[_0x23fb33](_0x4aac('0x29'));_0x1f35f3[_0x23fb33]('voice:outbound');_0x869ea2[_0x4aac('0x2b')](_0x5133b8[_0x4aac('0x39')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2[_0x4aac('0x2b')](_0x5133b8[_0x4aac('0x3a')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2['push'](_0x5133b8['getFaxQueues']({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2['push'](_0x5133b8[_0x4aac('0x3b')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2[_0x4aac('0x2b')](_0x5133b8[_0x4aac('0x3c')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2[_0x4aac('0x2b')](_0x5133b8[_0x4aac('0x3d')]({'attributes':['id',_0x4aac('0x4')]}));_0x869ea2[_0x4aac('0x2b')](_0x5133b8['getWhatsappQueues']({'attributes':['id',_0x4aac('0x4')]}));break;}return BPromise[_0x4aac('0x3e')](_0x869ea2);}})['then'](function(_0x47f8bb){if(_0x47f8bb&&_0x47f8bb[_0x4aac('0x1b')]){for(var _0x574e92=0x0;_0x574e92<_0x47f8bb['length'];_0x574e92+=0x1){for(var _0x47d40a=0x0;_0x47d40a<_0x47f8bb[_0x574e92][_0x4aac('0x1b')];_0x47d40a+=0x1){switch(_0x574e92){case 0x0:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,'voice',_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x1:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,'chat',_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x2:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x3f'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x3:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x40'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x4:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x41'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x5:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x42'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x6:joinOrLeaveQueues(_0x1f35f3,_0x23fb33,_0x4aac('0x43'),_0x47f8bb[_0x574e92][_0x47d40a]);break;case 0x7:if(_0x3d4836[_0x4aac('0x6')]!==_0x4aac('0x7'))_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')](_0x4aac('0x44'),_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x4')]));break;case 0x8:if(_0x3d4836['role']!==_0x4aac('0x7'))_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')]('trunk:%s',_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x4')]));break;case 0x9:if(_0x3d4836[_0x4aac('0x6')]!==_0x4aac('0x7'))_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')](_0x4aac('0x45'),_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x8')],_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x4')]));break;case 0xa:_0x1f35f3[_0x23fb33](util[_0x4aac('0x18')](_0x4aac('0x28'),_0x47f8bb[_0x574e92][_0x47d40a][_0x4aac('0x4')]));break;}}}}})[_0x4aac('0x14')](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x27e987=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x20')],'id');return _0x3d4836['removeChatInteractions'](_0x27e987)[_0x4aac('0x14')](function(){for(var _0x4ba78b=0x0;_0x4ba78b<_0x27e987[_0x4aac('0x1b')];_0x4ba78b+=0x1){_0x34a384['emit'](_0x4aac('0x48'),{'ChatInteractionId':Number(_0x27e987[_0x4ba78b]),'UserId':Number(_0x3d4836['id'])});}});}})['then'](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x114d43=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x22')],'id');return _0x3d4836[_0x4aac('0x49')](_0x114d43)['then'](function(){for(var _0x57442e=0x0;_0x57442e<_0x114d43[_0x4aac('0x1b')];_0x57442e+=0x1){_0x34a384[_0x4aac('0x4a')](_0x4aac('0x4b'),{'MailInteractionId':Number(_0x114d43[_0x57442e]),'UserId':Number(_0x3d4836['id'])});}});}})[_0x4aac('0x14')](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x4764ac=_['map'](_0x3d4836['FaxInteractions'],'id');return _0x3d4836[_0x4aac('0x4c')](_0x4764ac)[_0x4aac('0x14')](function(){for(var _0x5f004a=0x0;_0x5f004a<_0x4764ac['length'];_0x5f004a+=0x1){_0x34a384['emit'](_0x4aac('0x4d'),{'FaxInteractionId':Number(_0x4764ac[_0x5f004a]),'UserId':Number(_0x3d4836['id'])});}});}})['then'](function(){if(_0x23fb33==='leave'){var _0xc732b3=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x4e')],'id');return _0x3d4836[_0x4aac('0x4f')](_0xc732b3)[_0x4aac('0x14')](function(){for(var _0x38707d=0x0;_0x38707d<_0xc732b3[_0x4aac('0x1b')];_0x38707d+=0x1){_0x34a384[_0x4aac('0x4a')](_0x4aac('0x50'),{'SmsInteractionId':Number(_0xc732b3[_0x38707d]),'UserId':Number(_0x3d4836['id'])});}});}})[_0x4aac('0x14')](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x613835=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x25')],'id');return _0x3d4836[_0x4aac('0x51')](_0x613835)[_0x4aac('0x14')](function(){for(var _0x2d8603=0x0;_0x2d8603<_0x613835['length'];_0x2d8603+=0x1){_0x34a384[_0x4aac('0x4a')](_0x4aac('0x52'),{'OpenchannelInteractionId':Number(_0x613835[_0x2d8603]),'UserId':Number(_0x3d4836['id'])});}});}})[_0x4aac('0x14')](function(){if(_0x23fb33===_0x4aac('0x46')){var _0x14c062=_[_0x4aac('0x47')](_0x3d4836[_0x4aac('0x27')],'id');return _0x3d4836[_0x4aac('0x53')](_0x14c062)[_0x4aac('0x14')](function(){for(var _0x2e0171=0x0;_0x2e0171<_0x14c062['length'];_0x2e0171+=0x1){_0x34a384[_0x4aac('0x4a')](_0x4aac('0x54'),{'WhatsappInteractionId':Number(_0x14c062[_0x2e0171]),'UserId':Number(_0x3d4836['id'])});}});}})[_0x4aac('0x55')](function(_0x167495){_0x1f35f3[_0x4aac('0x56')](_0x167495);});}}function onDisconnect(_0x30aae5,_0x44f533){joinOrLeave(_0x30aae5,'leave',_0x44f533);}function onConnect(_0x4ca246){joinOrLeave(_0x4ca246,_0x4aac('0x57'));}exports[_0x4aac('0x58')]=function(_0x55146a){_0x55146a['on'](_0x4aac('0x59'),function(_0x10b635){_0x10b635['setMaxListeners'](0x0);_0x10b635['address']=_0x10b635[_0x4aac('0x5a')][_0x4aac('0x59')][_0x4aac('0x5b')]+':'+_0x10b635[_0x4aac('0x5a')][_0x4aac('0x59')][_0x4aac('0x5c')];_0x10b635[_0x4aac('0x5d')]=new Date();_0x10b635['log']=function(_0x1d8bed){console['log'](_0x4aac('0x5e')+_0x10b635[_0x4aac('0x5f')]['name']+'['+_0x10b635[_0x4aac('0x60')]+']',_0x1d8bed);};_0x10b635['on']('disconnect',function(){onDisconnect(_0x10b635,_0x55146a);_0x10b635['log']('DISCONNECTED');});onConnect(_0x10b635);_0x10b635[_0x4aac('0x56')](_0x4aac('0x61'));});}; \ No newline at end of file +var _0xed1c=['OpenchannelQueue','Trunk','user','voice:outbound','WhatsappQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','all','chat','sms','mail','openchannel','whatsapp','telephone:%s','leave','map','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','log','SocketIO\x20','nsp','disconnect','CONNECTED','lodash','util','Agents','User','name','agent','telephone','type','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','role','Campaign','format','%s:queue:%s','length','handshake','query','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','user:%s','admin','voice:inbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0xed1c,0xe4));var _0xced1=function(_0x15f25f,_0x215e5a){_0x15f25f=_0x15f25f-0x0;var _0x166c14=_0xed1c[_0x15f25f];return _0x166c14;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0xced1('0x2'),'model':db[_0xced1('0x3')],'attributes':['id',_0xced1('0x4'),'role'],'raw':!![],'where':{'role':_0xced1('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xced1('0x4')],'where':{'role':_0xced1('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xced1('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xced1('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xced1('0x4'),_0xced1('0x7')],'where':{'type':_0xced1('0x8')}};function getAssociatedResources(_0x354203,_0x3221b6,_0x325dd2){return db[_0xced1('0x9')]['findOne']({'where':{'name':_0x354203,'userProfileId':_0x3221b6},'raw':!![]})[_0xced1('0xa')](function(_0x59c820){if(_0x59c820){if(_0x59c820[_0xced1('0xb')]){switch(_0x354203){case _0xced1('0xc'):case _0xced1('0xd'):case _0xced1('0xe'):case _0xced1('0xf'):case _0xced1('0x10'):case _0xced1('0x11'):case'WhatsappQueues':return db[_0x325dd2][_0xced1('0x12')](queryQueues);case _0xced1('0x13'):return db[_0x325dd2][_0xced1('0x12')](queryTelephones);case _0xced1('0x14'):return db[_0x325dd2]['findAll'](queryTrunks);case _0xced1('0x15'):return db[_0x325dd2][_0xced1('0x12')](queryCampaigns);}}else{return db['UserProfileResource'][_0xced1('0x12')]({'attributes':[_0xced1('0x16')],'where':{'sectionId':_0x59c820['id']},'raw':!![]})[_0xced1('0xa')](function(_0x32100b){if(_0x32100b){var _0x47baec={'where':{'id':_['map'](_0x32100b,_0xced1('0x16'))},'raw':!![]};switch(_0x325dd2){case _0xced1('0x3'):_0x47baec[_0xced1('0x17')][_0xced1('0x18')]=_0xced1('0x6');break;case _0xced1('0x19'):_0x47baec['where']['type']=_0xced1('0x8');break;}return db[_0x325dd2][_0xced1('0x12')](_0x47baec);}else{return[];}});}}else{return[];}})[_0xced1('0xa')](function(_0x5257e7){return _0x5257e7;});}function joinOrLeaveQueues(_0x1eac14,_0x25f0df,_0x3e51e4,_0x4eed16){_0x1eac14[_0x25f0df](util[_0xced1('0x1a')](_0xced1('0x1b'),_0x3e51e4,_0x4eed16[_0xced1('0x4')]));if(_0x4eed16['Agents']){for(var _0x138c8b=0x0;_0x138c8b<_0x4eed16[_0xced1('0x2')][_0xced1('0x1c')];_0x138c8b+=0x1){_0x1eac14[_0x25f0df](util['format']('user:%s',_0x4eed16[_0xced1('0x2')][_0x138c8b][_0xced1('0x4')]));}}}function joinOrLeave(_0x2a6248,_0x20dcb4,_0x210d7e){var _0x49c8b9;if(_0x2a6248[_0xced1('0x1d')][_0xced1('0x1e')]['id']){db['User']['find']({'attributes':['id',_0xced1('0x4'),_0xced1('0x18'),_0xced1('0x1f')],'where':{'id':_0x2a6248[_0xced1('0x1d')][_0xced1('0x1e')]['id']},'include':[{'model':db[_0xced1('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x21')],'as':_0xced1('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x23')],'as':_0xced1('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x25')],'as':_0xced1('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xced1('0x28')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xced1('0xa')](function(_0x2c2269){if(_0x2c2269){_0x49c8b9=_0x2c2269;_0x2a6248[_0x20dcb4](util[_0xced1('0x1a')](_0xced1('0x29'),_0x2c2269['name']));var _0x59361e=[];switch(_0x2c2269[_0xced1('0x18')]){case _0xced1('0x2a'):_0x2a6248[_0x20dcb4](_0xced1('0x2b'));_0x2a6248[_0x20dcb4]('voice:outbound');if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0xced1('0x2c')];}_0x59361e[_0xced1('0x2d')](db[_0xced1('0x2e')][_0xced1('0x12')](queryQueues));_0x59361e['push'](db[_0xced1('0x2f')][_0xced1('0x12')](queryQueues));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x30')][_0xced1('0x12')](queryQueues));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x31')]['findAll'](queryQueues));_0x59361e['push'](db[_0xced1('0x32')][_0xced1('0x12')](queryQueues));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x33')][_0xced1('0x12')](queryQueues));_0x59361e[_0xced1('0x2d')](db['WhatsappQueue']['findAll'](queryQueues));_0x59361e['push'](db['User'][_0xced1('0x12')](queryTelephones));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x34')][_0xced1('0x12')](queryTrunks));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x19')][_0xced1('0x12')](queryCampaigns));_0x59361e[_0xced1('0x2d')](db[_0xced1('0x3')][_0xced1('0x12')](queryAgents));break;case _0xced1('0x35'):_0x2a6248[_0x20dcb4](_0xced1('0x2b'));_0x2a6248[_0x20dcb4](_0xced1('0x36'));_0x59361e['push'](getAssociatedResources(_0xced1('0xc'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x2e')));_0x59361e[_0xced1('0x2d')](getAssociatedResources(_0xced1('0xd'),_0x2c2269[_0xced1('0x1f')],'ChatQueue'));_0x59361e[_0xced1('0x2d')](getAssociatedResources(_0xced1('0xe'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x30')));_0x59361e[_0xced1('0x2d')](getAssociatedResources(_0xced1('0xf'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x31')));_0x59361e[_0xced1('0x2d')](getAssociatedResources(_0xced1('0x10'),_0x2c2269[_0xced1('0x1f')],'MailQueue'));_0x59361e['push'](getAssociatedResources(_0xced1('0x11'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x33')));_0x59361e['push'](getAssociatedResources(_0xced1('0x37'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x38')));_0x59361e['push'](getAssociatedResources(_0xced1('0x13'),_0x2c2269[_0xced1('0x1f')],'User'));_0x59361e[_0xced1('0x2d')](getAssociatedResources('Trunks',_0x2c2269[_0xced1('0x1f')],_0xced1('0x34')));_0x59361e['push'](getAssociatedResources(_0xced1('0x15'),_0x2c2269[_0xced1('0x1f')],_0xced1('0x19')));_0x59361e['push'](db[_0xced1('0x3')][_0xced1('0x12')](queryAgents));break;case'agent':_0x2a6248[_0x20dcb4](_0xced1('0x2b'));_0x2a6248[_0x20dcb4]('voice:outbound');_0x59361e['push'](_0x2c2269[_0xced1('0x39')]({'attributes':['id','name']}));_0x59361e[_0xced1('0x2d')](_0x2c2269[_0xced1('0x3a')]({'attributes':['id',_0xced1('0x4')]}));_0x59361e['push'](_0x2c2269[_0xced1('0x3b')]({'attributes':['id','name']}));_0x59361e[_0xced1('0x2d')](_0x2c2269[_0xced1('0x3c')]({'attributes':['id',_0xced1('0x4')]}));_0x59361e[_0xced1('0x2d')](_0x2c2269['getMailQueues']({'attributes':['id',_0xced1('0x4')]}));_0x59361e[_0xced1('0x2d')](_0x2c2269['getOpenchannelQueues']({'attributes':['id',_0xced1('0x4')]}));_0x59361e[_0xced1('0x2d')](_0x2c2269['getWhatsappQueues']({'attributes':['id',_0xced1('0x4')]}));break;}return BPromise[_0xced1('0x3d')](_0x59361e);}})[_0xced1('0xa')](function(_0x59f1ba){if(_0x59f1ba&&_0x59f1ba[_0xced1('0x1c')]){for(var _0xcfbed8=0x0;_0xcfbed8<_0x59f1ba[_0xced1('0x1c')];_0xcfbed8+=0x1){for(var _0x3333e6=0x0;_0x3333e6<_0x59f1ba[_0xcfbed8][_0xced1('0x1c')];_0x3333e6+=0x1){switch(_0xcfbed8){case 0x0:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,'voice',_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x1:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x3e'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x2:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,'fax',_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x3:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x3f'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x4:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x40'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x5:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x41'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x6:joinOrLeaveQueues(_0x2a6248,_0x20dcb4,_0xced1('0x42'),_0x59f1ba[_0xcfbed8][_0x3333e6]);break;case 0x7:if(_0x49c8b9[_0xced1('0x18')]!==_0xced1('0x5'))_0x2a6248[_0x20dcb4](util['format'](_0xced1('0x43'),_0x59f1ba[_0xcfbed8][_0x3333e6][_0xced1('0x4')]));break;case 0x8:if(_0x49c8b9['role']!==_0xced1('0x5'))_0x2a6248[_0x20dcb4](util['format']('trunk:%s',_0x59f1ba[_0xcfbed8][_0x3333e6][_0xced1('0x4')]));break;case 0x9:if(_0x49c8b9[_0xced1('0x18')]!==_0xced1('0x5'))_0x2a6248[_0x20dcb4](util[_0xced1('0x1a')]('campaign:%s:%s',_0x59f1ba[_0xcfbed8][_0x3333e6][_0xced1('0x7')],_0x59f1ba[_0xcfbed8][_0x3333e6][_0xced1('0x4')]));break;case 0xa:_0x2a6248[_0x20dcb4](util[_0xced1('0x1a')]('user:%s',_0x59f1ba[_0xcfbed8][_0x3333e6]['name']));break;}}}}})[_0xced1('0xa')](function(){if(_0x20dcb4===_0xced1('0x44')){var _0xad1d9f=_[_0xced1('0x45')](_0x49c8b9['ChatInteractions'],'id');return _0x49c8b9['removeChatInteractions'](_0xad1d9f)['then'](function(){for(var _0x7df9c5=0x0;_0x7df9c5<_0xad1d9f[_0xced1('0x1c')];_0x7df9c5+=0x1){_0x210d7e[_0xced1('0x46')](_0xced1('0x47'),{'ChatInteractionId':Number(_0xad1d9f[_0x7df9c5]),'UserId':Number(_0x49c8b9['id'])});}});}})[_0xced1('0xa')](function(){if(_0x20dcb4===_0xced1('0x44')){var _0x211fd0=_[_0xced1('0x45')](_0x49c8b9[_0xced1('0x22')],'id');return _0x49c8b9['removeMailInteractions'](_0x211fd0)[_0xced1('0xa')](function(){for(var _0x3f44e6=0x0;_0x3f44e6<_0x211fd0[_0xced1('0x1c')];_0x3f44e6+=0x1){_0x210d7e['emit'](_0xced1('0x48'),{'MailInteractionId':Number(_0x211fd0[_0x3f44e6]),'UserId':Number(_0x49c8b9['id'])});}});}})[_0xced1('0xa')](function(){if(_0x20dcb4===_0xced1('0x44')){var _0x2acfd3=_['map'](_0x49c8b9[_0xced1('0x24')],'id');return _0x49c8b9['removeFaxInteractions'](_0x2acfd3)['then'](function(){for(var _0x1a2b65=0x0;_0x1a2b65<_0x2acfd3[_0xced1('0x1c')];_0x1a2b65+=0x1){_0x210d7e['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2acfd3[_0x1a2b65]),'UserId':Number(_0x49c8b9['id'])});}});}})['then'](function(){if(_0x20dcb4===_0xced1('0x44')){var _0x5dfcf4=_[_0xced1('0x45')](_0x49c8b9[_0xced1('0x26')],'id');return _0x49c8b9[_0xced1('0x49')](_0x5dfcf4)[_0xced1('0xa')](function(){for(var _0x39fa12=0x0;_0x39fa12<_0x5dfcf4[_0xced1('0x1c')];_0x39fa12+=0x1){_0x210d7e[_0xced1('0x46')](_0xced1('0x4a'),{'SmsInteractionId':Number(_0x5dfcf4[_0x39fa12]),'UserId':Number(_0x49c8b9['id'])});}});}})['then'](function(){if(_0x20dcb4==='leave'){var _0x4832d2=_[_0xced1('0x45')](_0x49c8b9[_0xced1('0x4b')],'id');return _0x49c8b9[_0xced1('0x4c')](_0x4832d2)['then'](function(){for(var _0x455134=0x0;_0x455134<_0x4832d2[_0xced1('0x1c')];_0x455134+=0x1){_0x210d7e[_0xced1('0x46')](_0xced1('0x4d'),{'OpenchannelInteractionId':Number(_0x4832d2[_0x455134]),'UserId':Number(_0x49c8b9['id'])});}});}})['then'](function(){if(_0x20dcb4===_0xced1('0x44')){var _0x2abd02=_[_0xced1('0x45')](_0x49c8b9[_0xced1('0x4e')],'id');return _0x49c8b9[_0xced1('0x4f')](_0x2abd02)[_0xced1('0xa')](function(){for(var _0x44cfbe=0x0;_0x44cfbe<_0x2abd02[_0xced1('0x1c')];_0x44cfbe+=0x1){_0x210d7e['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2abd02[_0x44cfbe]),'UserId':Number(_0x49c8b9['id'])});}});}})['catch'](function(_0x440b22){_0x2a6248['log'](_0x440b22);});}}function onDisconnect(_0x398264,_0x5d28cc){joinOrLeave(_0x398264,'leave',_0x5d28cc);}function onConnect(_0x37bec5){joinOrLeave(_0x37bec5,_0xced1('0x50'));}exports[_0xced1('0x51')]=function(_0x2bdcea){_0x2bdcea['on'](_0xced1('0x52'),function(_0x466da1){_0x466da1[_0xced1('0x53')](0x0);_0x466da1[_0xced1('0x54')]=_0x466da1[_0xced1('0x55')][_0xced1('0x52')][_0xced1('0x56')]+':'+_0x466da1['request'][_0xced1('0x52')][_0xced1('0x57')];_0x466da1['connectedAt']=new Date();_0x466da1[_0xced1('0x58')]=function(_0x26f154){console['log'](_0xced1('0x59')+_0x466da1[_0xced1('0x5a')][_0xced1('0x4')]+'['+_0x466da1[_0xced1('0x54')]+']',_0x26f154);};_0x466da1['on'](_0xced1('0x5b'),function(){onDisconnect(_0x466da1,_0x2bdcea);_0x466da1['log']('DISCONNECTED');});onConnect(_0x466da1);_0x466da1['log'](_0xced1('0x5c'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 753dce1..44b5676 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 _0x5878=['direction','ContactId','undefined','sequelize','query','Sequelize','SELECT','contact','UserId','format','name','incomingmessage','outgoingmessage','catch','AfterCreateMessage','offlineMessage','opened','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','SIP/%s','agent','AfterCreate','changed','closed','substatus','QueryTypes','User','fullname','email','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','ChatOfflineMessage','SmsInteraction','Sms','closedinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','error','code','Trigger,\x20%s','get','channel','motionChannel','event'];(function(_0x25ed75,_0x85898e){var _0x1031eb=function(_0x24f2bb){while(--_0x24f2bb){_0x25ed75['push'](_0x25ed75['shift']());}};_0x1031eb(++_0x85898e);}(_0x5878,0x70));var _0x8587=function(_0x12028d,_0x36e447){_0x12028d=_0x12028d-0x0;var _0x3e022b=_0x5878[_0x12028d];return _0x3e022b;};'use strict';var util=require(_0x8587('0x0'));var db=require(_0x8587('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')('triggers');var client=jayson[_0x8587('0x2')][_0x8587('0x3')]({'port':0x232a});var triggers=[{'channel':_0x8587('0x4'),'model':_0x8587('0x5'),'event':_0x8587('0x6'),'condition':_0x8587('0x7'),'callback':afterCreate},{'channel':_0x8587('0x4'),'model':_0x8587('0x5'),'event':_0x8587('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x8587('0x4'),'model':_0x8587('0x9'),'event':_0x8587('0x6'),'condition':_0x8587('0xa'),'callback':afterCreateMessage},{'channel':_0x8587('0x4'),'model':_0x8587('0xb'),'event':_0x8587('0x6'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x8587('0xc'),'event':_0x8587('0x6'),'condition':_0x8587('0x7'),'callback':afterCreate},{'channel':_0x8587('0xd'),'model':'SmsInteraction','event':_0x8587('0x8'),'condition':_0x8587('0xe'),'callback':afterUpdate},{'channel':_0x8587('0xd'),'model':_0x8587('0xf'),'event':'afterCreate','condition':_0x8587('0xa'),'callback':afterCreateMessage},{'channel':_0x8587('0x10'),'model':_0x8587('0x11'),'event':_0x8587('0x6'),'condition':_0x8587('0x7'),'callback':afterCreate},{'channel':_0x8587('0x10'),'model':_0x8587('0x11'),'event':_0x8587('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x8587('0x10'),'model':_0x8587('0x12'),'event':_0x8587('0x6'),'condition':_0x8587('0xa'),'callback':afterCreateMessage},{'channel':_0x8587('0x13'),'model':_0x8587('0x14'),'event':_0x8587('0x6'),'condition':_0x8587('0x7'),'callback':afterCreate},{'channel':_0x8587('0x13'),'model':_0x8587('0x14'),'event':_0x8587('0x8'),'condition':_0x8587('0xe'),'callback':afterUpdate},{'channel':_0x8587('0x13'),'model':_0x8587('0x15'),'event':_0x8587('0x6'),'condition':_0x8587('0xa'),'callback':afterCreateMessage},{'channel':_0x8587('0x16'),'model':_0x8587('0x17'),'event':_0x8587('0x6'),'condition':_0x8587('0x7'),'callback':afterCreate},{'channel':_0x8587('0x16'),'model':_0x8587('0x17'),'event':_0x8587('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Mail','model':_0x8587('0x18'),'event':_0x8587('0x6'),'condition':_0x8587('0xa'),'callback':afterCreateMessage},{'channel':_0x8587('0x19'),'model':_0x8587('0x1a'),'event':_0x8587('0x6'),'condition':_0x8587('0x7'),'callback':afterCreate},{'channel':_0x8587('0x19'),'model':'OpenchannelInteraction','event':_0x8587('0x8'),'condition':_0x8587('0xe'),'callback':afterUpdate},{'channel':_0x8587('0x19'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0x8587('0xa'),'callback':afterCreateMessage}];function request(_0x4a127a){return client[_0x8587('0x1b')](_0x8587('0x1c'),_0x4a127a)[_0x8587('0x1d')](function(_0x4af87b){logger[_0x8587('0x1e')]('Trigger,\x20%s','EventManager',_0x4af87b);if(_0x4af87b['error']){if(_0x4af87b[_0x8587('0x1f')][_0x8587('0x20')]===0x1f4){logger['error'](_0x8587('0x21'),_0x8587('0x1c'),_0x4af87b[_0x8587('0x1f')]);}}})['catch'](function(_0xe6dfd1){logger[_0x8587('0x1f')](_0x8587('0x21'),_0x8587('0x1c'),_0xe6dfd1);});}function afterCreateMessage(_0x1786ca){return function(_0x51a11b){_0x51a11b=_0x51a11b[_0x8587('0x22')]({'plain':!![]});_0x51a11b[_0x8587('0x23')]=_0x1786ca;_0x51a11b[_0x8587('0x24')]=_0x1786ca;_0x51a11b[_0x8587('0x25')]=_0x51a11b[_0x8587('0x26')];Promise['resolve']()[_0x8587('0x1d')](function(){if(typeof _0x51a11b[_0x8587('0x27')]===_0x8587('0x28'))return null;var _0x2487a3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x51a11b['ContactId'];return db[_0x8587('0x29')][_0x8587('0x2a')](_0x2487a3,{'type':db[_0x8587('0x2b')]['QueryTypes'][_0x8587('0x2c')],'raw':!![]});})[_0x8587('0x1d')](function(_0x3a06aa){if(_0x3a06aa){_0x51a11b[_0x8587('0x2d')]=_0x3a06aa[0x0];}if(typeof _0x51a11b[_0x8587('0x2e')]==='undefined')return;return getAgent(_0x51a11b[_0x8587('0x2e')]);})[_0x8587('0x1d')](function(_0x2641d7){if(_0x2641d7){_0x51a11b['interface']=util[_0x8587('0x2f')]('SIP/%s',_0x2641d7[_0x8587('0x30')]);_0x51a11b['agent']=_0x2641d7;_0x51a11b[_0x8587('0x23')]=_0x1786ca;return request({'event':_0x8587('0x31'),'message':_0x51a11b});}else{return request({'event':_0x8587('0x32'),'message':_0x51a11b});}})[_0x8587('0x33')](function(_0x5c3d2e){logger[_0x8587('0x1f')]('Trigger,\x20%s',_0x8587('0x34'),_0x5c3d2e);});};}function afterCreateOfflineMessage(_0x8b4b0d){return function(_0x5e4433){_0x5e4433=_0x5e4433[_0x8587('0x22')]({'plain':!![]});_0x5e4433[_0x8587('0x23')]=_0x8b4b0d;_0x5e4433[_0x8587('0x24')]=_0x8b4b0d;_0x5e4433[_0x8587('0x25')]=_0x8587('0x35');return request({'event':_0x5e4433[_0x8587('0x25')],'message':_0x5e4433});};}function afterCreate(_0x20f6aa,_0x52ad43){return function(_0x346167){_0x346167=_0x346167[_0x8587('0x22')]({'plain':!![]});_0x346167['channel']=_0x20f6aa;_0x346167[_0x8587('0x24')]=_0x20f6aa;_0x346167['event']=_0x8587('0x36');Promise[_0x8587('0x37')]()[_0x8587('0x1d')](function(){var _0x326698=_0x8587('0x38')+_0x346167[_0x8587('0x27')];return db[_0x8587('0x29')][_0x8587('0x2a')](_0x326698,{'type':db[_0x8587('0x2b')]['QueryTypes'][_0x8587('0x2c')],'raw':!![]});})[_0x8587('0x1d')](function(_0x4f1926){if(_0x4f1926){_0x346167[_0x8587('0x2d')]=_0x4f1926[0x0];}if(typeof _0x346167[_0x8587('0x2e')]==='undefined')return;return getAgent(_0x346167[_0x8587('0x2e')]);})[_0x8587('0x1d')](function(_0x2de961){if(_0x2de961){_0x346167[_0x8587('0x39')]=util[_0x8587('0x2f')](_0x8587('0x3a'),_0x2de961[_0x8587('0x30')]);_0x346167[_0x8587('0x3b')]=_0x2de961;}return request({'event':_0x52ad43,'message':_0x346167});})[_0x8587('0x33')](function(_0x9e4deb){logger['error'](_0x8587('0x21'),_0x8587('0x3c'),_0x9e4deb);});};}function afterUpdate(_0x19c0e5){return function(_0x16633a){var _0x54051d=_0x16633a[_0x8587('0x3d')]('closed')&&_0x16633a[_0x8587('0x3e')];var _0x5bd0bc=_0x16633a['changed']('substatus');if(_0x54051d||_0x5bd0bc){var _0x349a35=_0x54051d?_0x8587('0xe'):_0x8587('0x3f');var _0x54cbc9=_0x16633a[_0x8587('0x22')]({'plain':!![]});_0x54cbc9[_0x8587('0x23')]=_0x19c0e5;_0x54cbc9[_0x8587('0x24')]=_0x19c0e5;_0x54cbc9[_0x8587('0x25')]=_0x54051d?_0x8587('0x3e'):_0x8587('0x3f');var _0x3931c1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54cbc9[_0x8587('0x27')];return db[_0x8587('0x29')][_0x8587('0x2a')](_0x3931c1,{'type':db[_0x8587('0x2b')][_0x8587('0x40')][_0x8587('0x2c')],'raw':!![]})[_0x8587('0x1d')](function(_0x3d89ab){if(_0x3d89ab){_0x54cbc9[_0x8587('0x2d')]=_0x3d89ab[0x0];}if(typeof _0x54cbc9[_0x8587('0x2e')]===_0x8587('0x28'))return;return getAgent(_0x54cbc9['UserId']);})[_0x8587('0x1d')](function(_0x3c5f5c){if(_0x3c5f5c){_0x54cbc9[_0x8587('0x39')]=util[_0x8587('0x2f')]('SIP/%s',_0x3c5f5c['name']);_0x54cbc9[_0x8587('0x3b')]=_0x3c5f5c;}return request({'event':_0x349a35,'message':_0x54cbc9});})[_0x8587('0x33')](function(_0x3e1644){logger[_0x8587('0x1f')]('Trigger,\x20%s','AfterUpdate',_0x3e1644);});}};}function getAgent(_0x29a140){return db[_0x8587('0x41')]['find']({'where':{'id':_0x29a140},'attributes':['id','name',_0x8587('0x42'),_0x8587('0x43'),'internal'],'raw':!![]})[_0x8587('0x1d')](function(_0x1e8c78){return _0x1e8c78;});}exports[_0x8587('0x44')]=function(){for(var _0x37198a=0x0;_0x37198a=_0x928209[_0x17fc('0x15')]){throw Error(_0x17fc('0x16'));}_0x21514f(_0x5d35fb);})[_0x17fc('0x17')](function(_0x418783){_0x38283d(_0x418783);});});}; \ No newline at end of file +var _0x4c87=['blockedAt','updateAttributes','getLicense','role','agent','User','count','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','mail','chat','whatsapp','getChannels','toLowerCase','clearBlockUser','isUndefined'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x4c87,0x1ea));var _0x74c8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4c87[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x74c8('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0x74c8('0x1'));var channels=[_0x74c8('0x2'),_0x74c8('0x3'),_0x74c8('0x4'),'fax','sms',_0x74c8('0x5'),'openchannel'];exports[_0x74c8('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0x1a5f4e){_0x1a5f4e=_0x1a5f4e[_0x74c8('0x7')]();return _['includes'](channels,_0x1a5f4e);};exports[_0x74c8('0x8')]=function(_0x30ed48,_0x2e633a,_0x23baf2,_0x5cac97){var _0x30d5cc={'loginAttempts':_0x2e633a,'blocked':_0x23baf2};if(!_[_0x74c8('0x9')](_0x5cac97)){_0x30d5cc[_0x74c8('0xa')]=_0x5cac97;}return _0x30ed48[_0x74c8('0xb')](_0x30d5cc);};exports[_0x74c8('0xc')]=function(_0x3c7a1d){return new BPromise(function(_0x14dfa4,_0x3524f8){var _0xbab295=0x0;if(_0x3c7a1d[_0x74c8('0xd')]!==_0x74c8('0xe')){_0x14dfa4(_0x3c7a1d);}db[_0x74c8('0xf')][_0x74c8('0x10')]({'where':{'role':_0x74c8('0xe'),'online':!![],'id':{'$ne':_0x3c7a1d['id']}}})['then'](function(_0x4743c1){_0xbab295=_0x4743c1;return util['getLicense']();})['then'](function(_0x5a5d0c){if(_0x5a5d0c&&_0x5a5d0c[_0x74c8('0x11')]&&_0xbab295>=_0x5a5d0c['agents']){throw Error(_0x74c8('0x12'));}_0x14dfa4(_0x3c7a1d);})[_0x74c8('0x13')](function(_0x7e722c){_0x3524f8(_0x7e722c);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 8cc9c0f..ddd6c8a 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f0d=['../config/logger','api','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','message','Not\x20Found','Forbidden','error','status','send','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x3bdce4,_0x5013c2){_0x3bdce4=_0x3bdce4-0x0;var _0x1c338d=_0x6f0d[_0x3bdce4];return _0x1c338d;};'use strict';var util=require('util');var logger=require(_0xd6f0('0x0'))(_0xd6f0('0x1'));var APIError=function(_0xd1480,_0x107a8c){this['message']=_0xd1480||_0xd6f0('0x2');this[_0xd6f0('0x3')]=_0x107a8c||_0xd6f0('0x4');util[_0xd6f0('0x5')](APIError,Error);};var APIBadRequestError=function(_0x3a757f){this['message']=_0x3a757f||_0xd6f0('0x6');this['name']=_0xd6f0('0x6');util[_0xd6f0('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x8b89a9){this[_0xd6f0('0x7')]=_0x8b89a9||'Entity\x20not\x20found';this['name']=_0xd6f0('0x8');util[_0xd6f0('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x2854cd){switch(_0x2854cd){case _0xd6f0('0x6'):return 0x190;case _0xd6f0('0x9'),'OutOfInterval':return 0x193;case _0xd6f0('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xee144c){return function(_0x329f69){logger[_0xd6f0('0xa')](_0x329f69['stack']);var _0x1ce8d5=getStatusCode(_0x329f69[_0xd6f0('0x3')]);if(_0x329f69[_0xd6f0('0x3')])delete _0x329f69[_0xd6f0('0x3')];return _0xee144c[_0xd6f0('0xb')](_0x1ce8d5)[_0xd6f0('0xc')](_0x329f69);};}module[_0xd6f0('0xd')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0x6f0d=['../config/logger','api','Internal\x20Server\x20Error','name','Error','inherits','Bad\x20Request','message','Not\x20Found','Forbidden','error','status','send','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1def7a,_0x1d1b1d){_0x1def7a=_0x1def7a-0x0;var _0x403ea4=_0x6f0d[_0x1def7a];return _0x403ea4;};'use strict';var util=require('util');var logger=require(_0xd6f0('0x0'))(_0xd6f0('0x1'));var APIError=function(_0xd1480,_0x107a8c){this['message']=_0xd1480||_0xd6f0('0x2');this[_0xd6f0('0x3')]=_0x107a8c||_0xd6f0('0x4');util[_0xd6f0('0x5')](APIError,Error);};var APIBadRequestError=function(_0x3a757f){this['message']=_0x3a757f||_0xd6f0('0x6');this['name']=_0xd6f0('0x6');util[_0xd6f0('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x8b89a9){this[_0xd6f0('0x7')]=_0x8b89a9||'Entity\x20not\x20found';this['name']=_0xd6f0('0x8');util[_0xd6f0('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x2854cd){switch(_0x2854cd){case _0xd6f0('0x6'):return 0x190;case _0xd6f0('0x9'),'OutOfInterval':return 0x193;case _0xd6f0('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0xee144c){return function(_0x329f69){logger[_0xd6f0('0xa')](_0x329f69['stack']);var _0x1ce8d5=getStatusCode(_0x329f69[_0xd6f0('0x3')]);if(_0x329f69[_0xd6f0('0x3')])delete _0x329f69[_0xd6f0('0x3')];return _0xee144c[_0xd6f0('0xb')](_0x1ce8d5)[_0xd6f0('0xc')](_0x329f69);};}module[_0xd6f0('0xd')]={'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 6cf2ffc..3e7e774 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0db=['404','status','render','json','send','exports'];(function(_0xf8cafb,_0x416d92){var _0x5c3f5e=function(_0x3931d1){while(--_0x3931d1){_0xf8cafb['push'](_0xf8cafb['shift']());}};_0x5c3f5e(++_0x416d92);}(_0xe0db,0x65));var _0xbe0d=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xe0db[_0x455c6c];return _0x488242;};'use strict';module[_0xbe0d('0x0')][0x194]=function pageNotFound(_0x4a72a1,_0x30a792){var _0x2b2c07=_0xbe0d('0x1');var _0x167fe6=0x194;var _0x3a6e14={'status':_0x167fe6};_0x30a792[_0xbe0d('0x2')](_0x3a6e14['status']);_0x30a792[_0xbe0d('0x3')](_0x2b2c07,{},function(_0x2d2886,_0x472d15){if(_0x2d2886){return _0x30a792[_0xbe0d('0x2')](_0x3a6e14['status'])[_0xbe0d('0x4')](_0x3a6e14);}_0x30a792[_0xbe0d('0x5')](_0x472d15);});}; \ No newline at end of file +var _0xd350=['status','render','json','exports'];(function(_0x58345e,_0x4d6f63){var _0x2908ad=function(_0xc02a7c){while(--_0xc02a7c){_0x58345e['push'](_0x58345e['shift']());}};_0x2908ad(++_0x4d6f63);}(_0xd350,0x7b));var _0x0d35=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xd350[_0x1cfa0d];return _0xe33279;};'use strict';module[_0x0d35('0x0')][0x194]=function pageNotFound(_0x4947be,_0xf760b8){var _0x1fa8df='404';var _0x22eee7=0x194;var _0x1b6a18={'status':_0x22eee7};_0xf760b8[_0x0d35('0x1')](_0x1b6a18['status']);_0xf760b8[_0x0d35('0x2')](_0x1fa8df,{},function(_0x584a54,_0x11e944){if(_0x584a54){return _0xf760b8['status'](_0x1b6a18[_0x0d35('0x1')])[_0x0d35('0x3')](_0x1b6a18);}_0xf760b8['send'](_0x11e944);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 20d915a..852504d 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f87=['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','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','ContactItemType','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','UserSetting','../api/user-setting/user-setting.model','User','cascade','hasOne','userSetting','UserId','hasMany','UserVoiceQueueRt','VoiceQueuesRt','Extensions','HopperHistory','OpenchannelInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','Groups','cm_user_has_contacts','Lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','ChatQueue','ChatQueues','SmsQueues','WhatsappQueues','user_has_chat_websites','FaxAccount','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Members','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','Messages','MailApplication','List','TemplateId','team_has_mail_queues','Account','Contact','Owner','Tags','Users','Interaction','MailInteractionId','ChatOfflineMessage','IntervalId','TagId','MailQueueReport','ListId','Items','FaxAccountId','Interactions','FaxApplication','Exntensions','FaxInteractionId','ThroughTags','AttachmentId','team_has_fax_queues','SmsAccountId','Applications','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatOfflineMessageId','team_has_chat_queues','Contacts','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','AdditionalPhones','Campaign','CampaignId','Condition','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','Schedule','DefaultReportId','Mohs','moh_has_sounds','mail_interaction_has_tags','fax_interaction_has_tags','ItemType','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAnyId','TriggerId','Fields','CustomReportId','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','Subject','Description','Field','VariableId','SugarcrmAccount','FieldId','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowConfiguration','FreshsalesAccount','FreshsalesField','ToId','SessionId','ProjectId','MailQueues','OpenchannelQueues','team_has_whatsapp_queues','VoicePrefix','Hoppers','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','../config/environment','lodash','jstz','determine','defaultsDeep','sequelize','motion2','xcall','xC@LL1234','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','name','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','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/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model'];(function(_0x49c9a,_0x24f68a){var _0x2b03d6=function(_0x4f2232){while(--_0x4f2232){_0x49c9a['push'](_0x49c9a['shift']());}};_0x2b03d6(++_0x24f68a);}(_0x1f87,0x1cf));var _0x71f8=function(_0x4a4b9b,_0x47c325){_0x4a4b9b=_0x4a4b9b-0x0;var _0x260375=_0x1f87[_0x4a4b9b];return _0x260375;};'use strict';var config=require(_0x71f8('0x0'));var Sequelize=require('sequelize');var _=require(_0x71f8('0x1'));var jstz=require(_0x71f8('0x2'));var timezone=jstz[_0x71f8('0x3')]();config['sequelize']=_[_0x71f8('0x4')](config[_0x71f8('0x5')],{'database':_0x71f8('0x6'),'username':_0x71f8('0x7'),'password':_0x71f8('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x71f8('0x9'),'dialectOptions':{'charset':_0x71f8('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x71f8('0xb'),'collate':_0x71f8('0xc')}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0x71f8('0xd')],{'database':_0x71f8('0x6'),'username':'xcall','password':_0x71f8('0x8'),'options':{'host':_0x71f8('0xe'),'port':0xcea,'dialect':_0x71f8('0x9'),'dialectOptions':{'charset':_0x71f8('0xa')},'logging':![],'timezone':timezone[_0x71f8('0xf')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x71f8('0x10')],config[_0x71f8('0x5')][_0x71f8('0x11')],config['sequelize'][_0x71f8('0x12')],config['sequelize'][_0x71f8('0x13')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x71f8('0xd')][_0x71f8('0x10')],config[_0x71f8('0xd')][_0x71f8('0x11')],config[_0x71f8('0xd')][_0x71f8('0x12')],config['sequelizeHistory'][_0x71f8('0x13')])};db['User']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x15'));db[_0x71f8('0x16')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x17'));db[_0x71f8('0x18')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x19'));db[_0x71f8('0x1a')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x1b'));db['VoiceMusicOnHold']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x1c'));db[_0x71f8('0x1d')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0x71f8('0x1e')]=db['sequelize']['import'](_0x71f8('0x1f'));db[_0x71f8('0x20')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x21'));db[_0x71f8('0x22')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x23'));db[_0x71f8('0x24')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x25'));db[_0x71f8('0x26')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x27'));db[_0x71f8('0x28')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x29'));db[_0x71f8('0x2a')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x2b'));db[_0x71f8('0x2c')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x2d'));db[_0x71f8('0x2e')]=db[_0x71f8('0x5')]['import']('../api/memberReport/memberReport.model');db['Trunk']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x2f'));db[_0x71f8('0x30')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x31'));db['UserVoiceQueueRt']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x32'));db[_0x71f8('0x33')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x34'));db[_0x71f8('0x35')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x36'));db[_0x71f8('0x37')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x38'));db[_0x71f8('0x39')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x3a'));db[_0x71f8('0x3b')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x3c'));db[_0x71f8('0x3d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x3e'));db[_0x71f8('0x3f')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x40'));db[_0x71f8('0x41')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0x71f8('0x42')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x43'));db[_0x71f8('0x44')]=db['sequelize']['import']('../api/mailAccount/mailAccount.model');db[_0x71f8('0x45')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x46'));db[_0x71f8('0x47')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x48'));db[_0x71f8('0x49')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0x71f8('0x4a')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x4b'));db[_0x71f8('0x4c')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x4d'));db[_0x71f8('0x4e')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x4f'));db['FaxAccount']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x50'));db['FaxApplication']=db[_0x71f8('0x5')]['import'](_0x71f8('0x51'));db[_0x71f8('0x52')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x53'));db[_0x71f8('0x54')]=db['sequelize']['import'](_0x71f8('0x55'));db[_0x71f8('0x56')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x57'));db[_0x71f8('0x58')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x59'));db[_0x71f8('0x5a')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x5b'));db[_0x71f8('0x5c')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x5d'));db[_0x71f8('0x5e')]=db['sequelize']['import'](_0x71f8('0x5f'));db[_0x71f8('0x60')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x61'));db[_0x71f8('0x62')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x63'));db[_0x71f8('0x64')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0x71f8('0x65')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x66'));db[_0x71f8('0x67')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x68'));db[_0x71f8('0x69')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x6a'));db[_0x71f8('0x6b')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x6c'));db[_0x71f8('0x6d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x6e'));db[_0x71f8('0x6f')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x70'));db[_0x71f8('0x71')]=db['sequelize'][_0x71f8('0x14')]('../api/chatApplication/chatApplication.model');db[_0x71f8('0x72')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x73'));db[_0x71f8('0x74')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x75'));db['ChatOfflineMessage']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x76'));db['ChatQueue']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x77'));db[_0x71f8('0x78')]=db[_0x71f8('0x5')]['import']('../api/chatGroup/chatGroup.model');db[_0x71f8('0x79')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x7a'));db[_0x71f8('0x7b')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x7c'));db[_0x71f8('0x7d')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/cmContact/cmContact.model');db[_0x71f8('0x7e')]=db['sequelize'][_0x71f8('0x14')]('../api/cmHopper/cmHopper.model');db[_0x71f8('0x7f')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x80'));db[_0x71f8('0x81')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x82'));db[_0x71f8('0x83')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x84'));db[_0x71f8('0x85')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x86'));db[_0x71f8('0x87')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x88'));db[_0x71f8('0x89')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x8a'));db[_0x71f8('0x8b')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x8c'));db[_0x71f8('0x8d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x8e'));db[_0x71f8('0x8f')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x90'));db['Condition']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/condition/condition.model');db[_0x71f8('0x91')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x92'));db[_0x71f8('0x93')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/pause/pause.model');db['Cdr']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x94'));db[_0x71f8('0x95')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x96'));db['Schedule']=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x97'));db[_0x71f8('0x98')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/sound/sound.model');db[_0x71f8('0x99')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x9a'));db[_0x71f8('0x9b')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/contactItemType/contactItemType.model');db[_0x71f8('0x9c')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x9d'));db[_0x71f8('0x9e')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x9f'));db[_0x71f8('0xa0')]=db['sequelize']['import']('../api/template/template.model');db[_0x71f8('0xa1')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xa2'));db[_0x71f8('0xa3')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xa4'));db[_0x71f8('0xa5')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/integration/integration.model');db['IntegrationReport']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/integrationReport/integrationReport.model');db[_0x71f8('0xa6')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xa7'));db[_0x71f8('0xa8')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xa9'));db[_0x71f8('0xaa')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xab'));db[_0x71f8('0xac')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xad'));db[_0x71f8('0xae')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x71f8('0xaf')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xb0'));db[_0x71f8('0xb1')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xb2'));db[_0x71f8('0xb3')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xb4'));db[_0x71f8('0xb5')]=db['sequelize'][_0x71f8('0x14')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xb6'));db[_0x71f8('0xb7')]=db['sequelize'][_0x71f8('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x71f8('0xb8')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xb9'));db[_0x71f8('0xba')]=db['sequelize'][_0x71f8('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x71f8('0xbb')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xbc'));db['DeskField']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xbd'));db[_0x71f8('0xbe')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xbf'));db['ZohoConfiguration']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xc0'));db[_0x71f8('0xc1')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xc2'));db[_0x71f8('0xc3')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x71f8('0xc4')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x71f8('0xc5')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0x71f8('0xc6')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xc7'));db['FreshdeskConfiguration']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xc8'));db[_0x71f8('0xc9')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x71f8('0xca')]=db[_0x71f8('0x5')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x71f8('0xcb')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xcc'));db[_0x71f8('0xcd')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xce'));db[_0x71f8('0xcf')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xd0'));db['ServicenowConfiguration']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x71f8('0xd1')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xd2'));db[_0x71f8('0xd3')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xd4'));db[_0x71f8('0xd5')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xd6'));db[_0x71f8('0xd7')]=db['sequelize'][_0x71f8('0x14')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xd8'));db[_0x71f8('0xd9')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xda'));db['FreshsalesField']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xdb'));db['Integration']=db[_0x71f8('0x5')]['import'](_0x71f8('0xdc'));db[_0x71f8('0xdd')]=db['sequelize']['import'](_0x71f8('0xde'));db[_0x71f8('0xdf')]=db['sequelize']['import']('../api/chatQueueReport/chatQueueReport.model');db[_0x71f8('0xe0')]=db[_0x71f8('0x5')]['import']('../api/chatInternalMessage/chatInternalMessage.model');db[_0x71f8('0xe1')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xe2'));db[_0x71f8('0xe3')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xe4'));db[_0x71f8('0xe5')]=db['sequelize']['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x71f8('0xe6')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xe7'));db[_0x71f8('0xe8')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xe9'));db[_0x71f8('0xea')]=db[_0x71f8('0x5')]['import'](_0x71f8('0xeb'));db[_0x71f8('0xec')]=db['sequelize']['import']('../api/jscriptyProject/jscriptyProject.model');db[_0x71f8('0xed')]=db['sequelize']['import']('../api/setting/setting.model');db[_0x71f8('0xee')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xef'));db[_0x71f8('0xf0')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xf1'));db['SquareRecording']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xf2'));db[_0x71f8('0xf3')]=db['sequelize']['import'](_0x71f8('0xf4'));db[_0x71f8('0xf5')]=db['sequelize']['import'](_0x71f8('0xf6'));db[_0x71f8('0xf7')]=db[_0x71f8('0x5')]['import']('../api/license/license.model');db['Campaign']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xf8'));db['Migration']=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/migration/migration.model');db[_0x71f8('0xf9')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0xfa'));db[_0x71f8('0xfb')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0xfc'));db[_0x71f8('0xfd')]=db['sequelize']['import'](_0x71f8('0xfe'));db[_0x71f8('0xff')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x100'));db[_0x71f8('0x101')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x102'));db[_0x71f8('0x103')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x104'));db[_0x71f8('0x105')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x106'));db[_0x71f8('0x107')]=db['sequelize'][_0x71f8('0x14')]('../api/cmList/cmList.model');db['VoicePrefix']=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x108'));db[_0x71f8('0x109')]=db[_0x71f8('0x5')]['import']('../api/userProfile/userProfile.model');db[_0x71f8('0x10a')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x10b'));db[_0x71f8('0x10c')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0x71f8('0x10d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x10e'));db[_0x71f8('0x10f')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x110'));db[_0x71f8('0x111')]=db['sequelize'][_0x71f8('0x14')]('../api/whatsappApplication/whatsappApplication.model');db[_0x71f8('0x112')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x113'));db[_0x71f8('0x114')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x115'));db[_0x71f8('0x116')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x117'));db[_0x71f8('0x118')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x119'));db[_0x71f8('0x11a')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x11b'));db[_0x71f8('0x11c')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/cloudProvider/cloudProvider.model');db[_0x71f8('0x11d')]=db[_0x71f8('0x5')][_0x71f8('0x14')](_0x71f8('0x11e'));db[_0x71f8('0x11f')]=db['sequelize'][_0x71f8('0x14')](_0x71f8('0x120'));db[_0x71f8('0x121')]=db[_0x71f8('0x5')][_0x71f8('0x14')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0x71f8('0x122')]=db[_0x71f8('0x5')]['import'](_0x71f8('0x123'));db[_0x71f8('0x124')]['hasOne'](db[_0x71f8('0x22')],{'as':_0x71f8('0x22'),'onDelete':_0x71f8('0x125'),'foreignKey':'UserId'});db[_0x71f8('0x124')][_0x71f8('0x126')](db[_0x71f8('0x122')],{'as':_0x71f8('0x127'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x1e')],{'as':'Recordings','foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x12a')],{'as':_0x71f8('0x12b'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'as':_0x71f8('0x12c'),'onDelete':'cascade','hooks':!![]});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x81')],{'as':'HopperFinals','foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x83')],{'as':_0x71f8('0x12d'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x85')],{'as':_0x71f8('0x85'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x71f8('0x12e'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x72')],{'as':'ChatInteractions','foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x5e')],{'as':'SmsInteractions','foreignKey':'UserId'});db['User']['hasMany'](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x71f8('0x128')});db['User'][_0x71f8('0x129')](db[_0x71f8('0x49')],{'as':_0x71f8('0x12f'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x124')][_0x71f8('0x129')](db['WhatsappInteraction'],{'as':_0x71f8('0x130'),'foreignKey':'UserId'});db[_0x71f8('0x124')][_0x71f8('0x129')](db[_0x71f8('0x10d')],{'as':_0x71f8('0x131'),'foreignKey':_0x71f8('0x132')});db[_0x71f8('0x124')]['belongsTo'](db['UserProfile'],{'as':_0x71f8('0x109'),'foreignKey':_0x71f8('0x133')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['ChatGroup'],{'as':_0x71f8('0x135'),'through':'chat_group_has_users'});db['User']['belongsToMany'](db['CmContact'],{'as':'Contacts','through':_0x71f8('0x136')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x107')],{'as':_0x71f8('0x137'),'through':'cm_user_has_lists'});db['User']['belongsToMany'](db[_0x71f8('0xf5')],{'through':_0x71f8('0x138')});db[_0x71f8('0x124')]['belongsToMany'](db['MailInteraction'],{'as':_0x71f8('0x12f'),'through':_0x71f8('0x139')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x72')],{'as':_0x71f8('0x13a'),'through':_0x71f8('0x13b')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['FaxInteraction'],{'as':_0x71f8('0x13c'),'through':_0x71f8('0x13d')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x5e')],{'as':_0x71f8('0x13e'),'through':'user_has_sms_interactions'});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x67')],{'as':'OpenchannelInteractions','through':_0x71f8('0x13f')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['WhatsappInteraction'],{'as':_0x71f8('0x130'),'through':_0x71f8('0x140')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x1d')],{'as':_0x71f8('0x141'),'through':_0x71f8('0x33'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0x71f8('0x121'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db['MailQueue'],{'as':'MailQueues','through':_0x71f8('0x37'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x142')],{'as':_0x71f8('0x143'),'through':_0x71f8('0x35'),'required':![],'hooks':!![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x56')],{'as':'FaxQueues','through':_0x71f8('0x39'),'required':![]});db['User'][_0x71f8('0x134')](db[_0x71f8('0x62')],{'as':_0x71f8('0x144'),'through':_0x71f8('0x3b'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0x71f8('0x3d'),'required':![]});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x11a')],{'as':_0x71f8('0x145'),'through':_0x71f8('0x3f'),'required':![]});db[_0x71f8('0x124')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x6d')],{'as':'ChatWebsites','through':_0x71f8('0x146')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x147')],{'as':'FaxAccounts','through':_0x71f8('0x148')});db[_0x71f8('0x124')]['belongsToMany'](db[_0x71f8('0x44')],{'as':'MailAccounts','through':_0x71f8('0x149')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['OpenchannelAccount'],{'as':_0x71f8('0x14a'),'through':_0x71f8('0x14b')});db[_0x71f8('0x124')][_0x71f8('0x134')](db[_0x71f8('0x5a')],{'as':_0x71f8('0x14c'),'through':_0x71f8('0x14d')});db[_0x71f8('0x124')][_0x71f8('0x134')](db['WhatsappAccount'],{'as':_0x71f8('0x14e'),'through':_0x71f8('0x14f')});db['VoiceChanSpy'][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'as':_0x71f8('0x150'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x151')});db['VoiceContext'][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'onDelete':_0x71f8('0x125')});db[_0x71f8('0x1a')][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'as':'Applications','onDelete':'cascade'});db['VoiceMusicOnHold'][_0x71f8('0x134')](db[_0x71f8('0x98')],{'as':'Sounds','through':'moh_has_sounds'});db[_0x71f8('0x1d')][_0x71f8('0x129')](db['UserVoiceQueueRt'],{'as':_0x71f8('0x152'),'foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')][_0x71f8('0x129')](db[_0x71f8('0x7e')],{'as':'Hoppers','foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')][_0x71f8('0x129')](db[_0x71f8('0x81')],{'as':_0x71f8('0x154'),'foreignKey':'VoiceQueueId'});db[_0x71f8('0x1d')][_0x71f8('0x129')](db[_0x71f8('0x83')],{'as':_0x71f8('0x155'),'foreignKey':'VoiceQueueId'});db[_0x71f8('0x1d')][_0x71f8('0x129')](db['ReportAgentPreview'],{'as':_0x71f8('0x85'),'foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')][_0x71f8('0x129')](db[_0x71f8('0x7f')],{'as':_0x71f8('0x156'),'foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')]['hasMany'](db['JscriptySessionReport'],{'as':_0x71f8('0x157'),'foreignKey':_0x71f8('0x153')});db[_0x71f8('0x1d')]['belongsTo'](db[_0x71f8('0x158')],{'as':_0x71f8('0x158'),'foreignKey':_0x71f8('0x159')});db['VoiceQueue'][_0x71f8('0x15a')](db[_0x71f8('0x158')],{'as':_0x71f8('0x15b'),'foreignKey':_0x71f8('0x15c')});db['VoiceQueue']['belongsTo'](db[_0x71f8('0x91')],{'as':_0x71f8('0x91'),'foreignKey':'IntervalId'});db[_0x71f8('0x1d')][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db[_0x71f8('0x1d')][_0x71f8('0x134')](db[_0x71f8('0x107')],{'as':_0x71f8('0x137'),'through':_0x71f8('0x15f')});db['VoiceQueue'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0x71f8('0x134')](db[_0x71f8('0xf5')],{'as':_0x71f8('0x161'),'through':_0x71f8('0x11d')});db[_0x71f8('0x1d')]['belongsToMany'](db[_0x71f8('0x107')],{'as':_0x71f8('0x162'),'through':_0x71f8('0x163')});db[_0x71f8('0x1e')]['belongsTo'](db[_0x71f8('0x124')],{'as':'User','foreignKey':_0x71f8('0x128')});db[_0x71f8('0x20')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x124'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x22')][_0x71f8('0x129')](db[_0x71f8('0x24')],{'as':'Messages','onDelete':_0x71f8('0x125'),'foreignKey':'mailboxuser','sourceKey':_0x71f8('0x164')});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':_0x71f8('0x165'),'targetKey':'mailbox'});db[_0x71f8('0x26')][_0x71f8('0x129')](db[_0x71f8('0x2c')],{'as':_0x71f8('0x166'),'foreignKey':_0x71f8('0x167'),'constraints':![]});db[_0x71f8('0x26')][_0x71f8('0x129')](db[_0x71f8('0x2a')],{'as':_0x71f8('0x168'),'foreignKey':_0x71f8('0x167'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x71f8('0x124')],{'as':_0x71f8('0x124'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x26')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':'Contact','foreignKey':_0x71f8('0x169')});db[_0x71f8('0x41')]['belongsTo'](db['MailAccount'],{'as':_0x71f8('0x44'),'foreignKey':_0x71f8('0x16a')});db['MailServerIn'][_0x71f8('0x15a')](db[_0x71f8('0x11c')],{'as':_0x71f8('0x11c'),'foreignKey':_0x71f8('0x16b'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x42')][_0x71f8('0x15a')](db[_0x71f8('0x44')],{'as':_0x71f8('0x44'),'foreignKey':'MailAccountId'});db[_0x71f8('0x42')]['belongsTo'](db[_0x71f8('0x11c')],{'as':'CloudProvider','foreignKey':_0x71f8('0x16b'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x44')][_0x71f8('0x126')](db[_0x71f8('0x41')],{'as':_0x71f8('0x16d'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x44')]['hasOne'](db['MailServerOut'],{'as':_0x71f8('0x16e'),'onDelete':'cascade'});db[_0x71f8('0x44')][_0x71f8('0x129')](db[_0x71f8('0x8f')],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x16a'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x44')][_0x71f8('0x129')](db[_0x71f8('0x8d')],{'as':_0x71f8('0x170'),'foreignKey':_0x71f8('0x16a')});db[_0x71f8('0x44')][_0x71f8('0x129')](db[_0x71f8('0x4a')],{'as':_0x71f8('0x171'),'foreignKey':'MailAccountId'});db[_0x71f8('0x44')]['hasMany'](db[_0x71f8('0x49')],{'as':'Interactions'});db[_0x71f8('0x44')][_0x71f8('0x129')](db[_0x71f8('0x172')],{'as':'Applications'});db[_0x71f8('0x44')][_0x71f8('0x15a')](db['CmList'],{'as':_0x71f8('0x173'),'foreignKey':'ListId'});db[_0x71f8('0x44')][_0x71f8('0x15a')](db[_0x71f8('0xa0')],{'as':'Template','foreignKey':_0x71f8('0x174')});db[_0x71f8('0x44')][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db['MailAccount'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':'user_has_mail_accounts'});db[_0x71f8('0x45')][_0x71f8('0x134')](db['User'],{'as':_0x71f8('0x160'),'through':_0x71f8('0x37')});db[_0x71f8('0x45')][_0x71f8('0x134')](db[_0x71f8('0xf5')],{'through':_0x71f8('0x175'),'as':_0x71f8('0x161')});db[_0x71f8('0x49')][_0x71f8('0x129')](db[_0x71f8('0x4a')],{'as':_0x71f8('0x171'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x71f8('0x49')]['belongsTo'](db['MailAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x16a')});db[_0x71f8('0x49')][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x49')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x178'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x49')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':'mail_interaction_has_tags','as':_0x71f8('0x179')});db['MailInteraction'][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x71f8('0x49')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x71f8('0x4a')][_0x71f8('0x129')](db[_0x71f8('0xf9')],{'as':'Attachments','onDelete':'cascade'});db[_0x71f8('0x4a')]['belongsTo'](db[_0x71f8('0x124')],{'as':_0x71f8('0x124')});db[_0x71f8('0x4a')]['belongsTo'](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x4a')][_0x71f8('0x15a')](db[_0x71f8('0x49')],{'as':_0x71f8('0x17b'),'foreignKey':_0x71f8('0x17c')});db[_0x71f8('0x4a')]['belongsTo'](db[_0x71f8('0x44')],{'as':'Account','foreignKey':'MailAccountId'});db['MailMessage'][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{'as':_0x71f8('0x6d'),'foreignKey':'ChatWebsiteId'});db[_0x71f8('0x4a')][_0x71f8('0x15a')](db[_0x71f8('0x17d')],{'as':_0x71f8('0x17d'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x172')][_0x71f8('0x15a')](db[_0x71f8('0x45')],{'onDelete':'restrict'});db[_0x71f8('0x172')][_0x71f8('0x15a')](db['MailAccount'],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x172')][_0x71f8('0x15a')](db['Interval'],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17e')});db['MailApplication'][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x180')][_0x71f8('0x15a')](db['MailAccount'],{});db[_0x71f8('0x180')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':'List','foreignKey':_0x71f8('0x181')});db[_0x71f8('0x180')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x180')][_0x71f8('0x15a')](db[_0x71f8('0x49')],{});db['MailQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x4a')],{});db['MailQueueReport']['belongsTo'](db['User'],{});db[_0x71f8('0x180')][_0x71f8('0x15a')](db[_0x71f8('0x45')],{});db[_0x71f8('0x4c')]['hasMany'](db[_0x71f8('0x4e')],{'as':_0x71f8('0x182'),'onDelete':_0x71f8('0x125')});db['FaxAccount']['hasMany'](db[_0x71f8('0x8f')],{'as':'Dispositions','foreignKey':_0x71f8('0x183'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x147')][_0x71f8('0x129')](db[_0x71f8('0x8d')],{'as':'Answers','foreignKey':_0x71f8('0x183')});db[_0x71f8('0x147')]['hasMany'](db[_0x71f8('0x52')],{'as':_0x71f8('0x184')});db['FaxAccount'][_0x71f8('0x129')](db[_0x71f8('0x185')],{'as':'Applications'});db[_0x71f8('0x147')]['hasMany'](db['VoiceExtension'],{'as':_0x71f8('0x186'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x147')][_0x71f8('0x129')](db[_0x71f8('0x54')],{'as':_0x71f8('0x171')});db[_0x71f8('0x147')][_0x71f8('0x15a')](db[_0x71f8('0x158')],{'as':_0x71f8('0x158')});db[_0x71f8('0x147')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db['FaxAccount'][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x71f8('0x147')]['belongsToMany'](db[_0x71f8('0x124')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x71f8('0x185')][_0x71f8('0x15a')](db['User'],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x185')][_0x71f8('0x15a')](db[_0x71f8('0x56')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x185')][_0x71f8('0x15a')](db[_0x71f8('0x147')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x185')][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x52')][_0x71f8('0x129')](db[_0x71f8('0x54')],{'as':'Messages','onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x187')});db[_0x71f8('0x52')][_0x71f8('0x15a')](db[_0x71f8('0x147')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x71f8('0x52')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x52')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x178'),'foreignKey':'UserId'});db['FaxInteraction']['belongsToMany'](db[_0x71f8('0x99')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x71f8('0x52')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':'fax_interaction_has_tags','as':_0x71f8('0x188')});db[_0x71f8('0x52')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':_0x71f8('0x13d'),'foreignKey':_0x71f8('0x187')});db['FaxMessage'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':'cascade','as':'User'});db[_0x71f8('0x54')][_0x71f8('0x15a')](db['FaxInteraction'],{'as':_0x71f8('0x17b'),'foreignKey':_0x71f8('0x187')});db[_0x71f8('0x54')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x54')]['belongsTo'](db[_0x71f8('0xf9')],{'as':_0x71f8('0xf9'),'foreignKey':_0x71f8('0x189')});db['FaxMessage'][_0x71f8('0x15a')](db[_0x71f8('0x147')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x71f8('0x56')]['belongsToMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x39')});db[_0x71f8('0x56')][_0x71f8('0x134')](db['Team'],{'through':_0x71f8('0x18a'),'as':_0x71f8('0x161')});db[_0x71f8('0x58')][_0x71f8('0x15a')](db[_0x71f8('0x147')],{});db[_0x71f8('0x58')]['belongsTo'](db['CmList'],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db['FaxQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x58')][_0x71f8('0x15a')](db['FaxInteraction'],{});db[_0x71f8('0x58')][_0x71f8('0x15a')](db[_0x71f8('0x54')],{});db['FaxQueueReport']['belongsTo'](db[_0x71f8('0x124')],{});db[_0x71f8('0x58')][_0x71f8('0x15a')](db[_0x71f8('0x56')],{});db[_0x71f8('0x5a')][_0x71f8('0x129')](db[_0x71f8('0x8f')],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x18b'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x5a')][_0x71f8('0x129')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x71f8('0x18b')});db[_0x71f8('0x5a')][_0x71f8('0x129')](db['SmsMessage'],{'as':'Messages','foreignKey':_0x71f8('0x18b')});db[_0x71f8('0x5a')][_0x71f8('0x129')](db[_0x71f8('0x5e')],{'as':_0x71f8('0x184')});db[_0x71f8('0x5a')][_0x71f8('0x129')](db['SmsApplication'],{'as':_0x71f8('0x18c')});db[_0x71f8('0x5a')]['belongsTo'](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0x5a')][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db[_0x71f8('0x5a')]['belongsToMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x14d')});db[_0x71f8('0x5c')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x16c')});db['SmsApplication'][_0x71f8('0x15a')](db[_0x71f8('0x62')],{'onDelete':'restrict'});db[_0x71f8('0x5c')][_0x71f8('0x15a')](db[_0x71f8('0x5a')],{'onDelete':'restrict'});db[_0x71f8('0x5c')]['belongsTo'](db[_0x71f8('0x91')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17e')});db[_0x71f8('0x5c')][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x5e')][_0x71f8('0x129')](db[_0x71f8('0x60')],{'as':_0x71f8('0x171'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x18d')});db['SmsInteraction']['belongsTo'](db[_0x71f8('0x5a')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x18b')});db[_0x71f8('0x5e')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':'Contact','foreignKey':_0x71f8('0x169')});db[_0x71f8('0x5e')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':'Owner','foreignKey':'UserId'});db[_0x71f8('0x5e')]['belongsToMany'](db[_0x71f8('0x99')],{'through':_0x71f8('0x18e'),'as':_0x71f8('0x179')});db['SmsInteraction'][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x18e'),'as':'ThroughTags'});db['SmsInteraction'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':_0x71f8('0x18f'),'foreignKey':'SmsInteractionId'});db[_0x71f8('0x60')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x124')});db['SmsMessage']['belongsTo'](db['CmContact'],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x60')][_0x71f8('0x15a')](db[_0x71f8('0x5e')],{'onDelete':'cascade','as':_0x71f8('0x17b'),'foreignKey':_0x71f8('0x18d')});db[_0x71f8('0x60')][_0x71f8('0x15a')](db[_0x71f8('0x5a')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x18b')});db['SmsQueue'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x3b'),'foreignKey':'SmsQueueId'});db[_0x71f8('0x62')][_0x71f8('0x134')](db['Team'],{'through':_0x71f8('0x190'),'as':_0x71f8('0x161')});db[_0x71f8('0x64')][_0x71f8('0x129')](db[_0x71f8('0x8f')],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x191'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x64')][_0x71f8('0x129')](db[_0x71f8('0x8d')],{'as':_0x71f8('0x170'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x64')][_0x71f8('0x129')](db['OpenchannelInteraction'],{'as':_0x71f8('0x184'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x64')]['hasMany'](db['OpenchannelMessage'],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x71f8('0x65')],{'as':_0x71f8('0x18c'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x64')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db[_0x71f8('0x64')][_0x71f8('0x134')](db['User'],{'as':'Agents','through':_0x71f8('0x14b')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db[_0x71f8('0x6b')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x192')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db['OpenchannelAccount'],{'onDelete':'restrict','foreignKey':_0x71f8('0x191')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db[_0x71f8('0x91')],{'onDelete':'restrict','foreignKey':_0x71f8('0x17e')});db[_0x71f8('0x65')][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x67')]['hasMany'](db[_0x71f8('0x69')],{'as':_0x71f8('0x171'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x193')});db[_0x71f8('0x67')][_0x71f8('0x15a')](db[_0x71f8('0x64')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x67')][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db['OpenchannelInteraction'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x178'),'foreignKey':_0x71f8('0x128')});db[_0x71f8('0x67')]['belongsToMany'](db[_0x71f8('0x99')],{'through':_0x71f8('0x194'),'as':_0x71f8('0x179')});db[_0x71f8('0x67')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x194'),'as':_0x71f8('0x188')});db[_0x71f8('0x67')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':_0x71f8('0x13f'),'foreignKey':_0x71f8('0x193')});db[_0x71f8('0x69')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x124')});db[_0x71f8('0x69')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x69')][_0x71f8('0x15a')](db[_0x71f8('0x67')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x17b'),'foreignKey':'OpenchannelInteractionId'});db[_0x71f8('0x69')][_0x71f8('0x15a')](db[_0x71f8('0xf9')],{'as':_0x71f8('0xf9'),'foreignKey':_0x71f8('0x189')});db[_0x71f8('0x69')]['belongsTo'](db[_0x71f8('0x64')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x191')});db[_0x71f8('0x6b')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x3d'),'foreignKey':_0x71f8('0x192')});db[_0x71f8('0x6b')]['belongsToMany'](db[_0x71f8('0xf5')],{'through':_0x71f8('0x195'),'as':'Teams'});db[_0x71f8('0x6d')]['hasMany'](db['Disposition'],{'as':_0x71f8('0x16f'),'foreignKey':'ChatWebsiteId','onDelete':_0x71f8('0x125')});db[_0x71f8('0x6d')]['hasMany'](db[_0x71f8('0x8d')],{'as':_0x71f8('0x170'),'foreignKey':_0x71f8('0x196')});db[_0x71f8('0x6d')][_0x71f8('0x129')](db['ChatProactiveAction'],{'as':'ProactiveActions'});db[_0x71f8('0x6d')][_0x71f8('0x129')](db[_0x71f8('0x72')],{'as':_0x71f8('0x184')});db[_0x71f8('0x6d')][_0x71f8('0x129')](db['ChatApplication'],{'as':_0x71f8('0x18c')});db[_0x71f8('0x6d')][_0x71f8('0x129')](db['ChatMessage'],{'as':_0x71f8('0x171')});db[_0x71f8('0x6d')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':'List','foreignKey':_0x71f8('0x181')});db['ChatWebsite'][_0x71f8('0x15a')](db[_0x71f8('0x91')],{'as':_0x71f8('0x91'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0x71f8('0x15a')](db[_0x71f8('0x44')],{'as':_0x71f8('0x44'),'foreignKey':_0x71f8('0x16a')});db[_0x71f8('0x6d')]['belongsTo'](db['Pause'],{'as':_0x71f8('0x15d'),'foreignKey':_0x71f8('0x15e')});db[_0x71f8('0x6d')]['belongsToMany'](db['User'],{'as':_0x71f8('0x160'),'through':_0x71f8('0x146')});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db[_0x71f8('0x64')],{});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db['CmList'],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0x6f')]['belongsTo'](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db[_0x71f8('0x67')],{});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db['OpenchannelMessage'],{});db[_0x71f8('0x6f')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{});db[_0x71f8('0x6f')]['belongsTo'](db[_0x71f8('0x6b')],{});db[_0x71f8('0x71')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x197'),'foreignKey':_0x71f8('0x128'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x71')][_0x71f8('0x15a')](db['ChatQueue'],{'as':_0x71f8('0x198'),'foreignKey':_0x71f8('0x199'),'onDelete':_0x71f8('0x16c')});db['ChatApplication']['belongsTo'](db[_0x71f8('0x6d')],{'as':_0x71f8('0x19a'),'foreignKey':'ChatWebsiteId','onDelete':_0x71f8('0x16c')});db['ChatApplication'][_0x71f8('0x15a')](db[_0x71f8('0x99')],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x72')][_0x71f8('0x129')](db[_0x71f8('0x74')],{'as':'Messages','onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x19b')});db[_0x71f8('0x72')]['belongsTo'](db[_0x71f8('0x6d')],{'as':'Account','foreignKey':_0x71f8('0x196')});db['ChatInteraction'][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':'Contact','foreignKey':_0x71f8('0x169')});db['ChatInteraction'][_0x71f8('0x15a')](db['User'],{'as':_0x71f8('0x178'),'foreignKey':_0x71f8('0x128')});db['ChatInteraction'][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x19c'),'as':'Tags'});db['ChatInteraction'][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x19c'),'as':_0x71f8('0x188')});db[_0x71f8('0x72')]['belongsToMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'through':'user_has_chat_interactions','foreignKey':_0x71f8('0x19b')});db[_0x71f8('0x74')][_0x71f8('0x15a')](db['User'],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x124')});db[_0x71f8('0x74')][_0x71f8('0x15a')](db['CmContact'],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x74')]['belongsTo'](db[_0x71f8('0x72')],{'onDelete':'cascade','as':_0x71f8('0x17b'),'foreignKey':'ChatInteractionId'});db[_0x71f8('0x74')][_0x71f8('0x15a')](db[_0x71f8('0xf9')],{'as':_0x71f8('0xf9'),'foreignKey':_0x71f8('0x189')});db[_0x71f8('0x74')][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{'as':_0x71f8('0x176'),'foreignKey':'ChatWebsiteId'});db[_0x71f8('0x17d')]['hasMany'](db[_0x71f8('0xf9')],{'as':_0x71f8('0x19d'),'foreignKey':_0x71f8('0x19e'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0x17d')]['belongsTo'](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x17d')][_0x71f8('0x15a')](db['ChatWebsite'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x196')});db['ChatQueue'][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x35'),'hooks':!![]});db['ChatQueue'][_0x71f8('0x134')](db[_0x71f8('0xf5')],{'through':_0x71f8('0x19f'),'as':_0x71f8('0x161')});db[_0x71f8('0x78')]['hasMany'](db['ChatInternalMessage'],{'as':_0x71f8('0x171'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0x71f8('0x78')]['belongsToMany'](db[_0x71f8('0x124')],{'as':'Members','through':'chat_group_has_users'});db[_0x71f8('0x79')][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{'as':_0x71f8('0x19a'),'foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db[_0x71f8('0x7d')],{'as':_0x71f8('0x1a0'),'foreignKey':_0x71f8('0x1a1')});db[_0x71f8('0x7d')]['hasMany'](db[_0x71f8('0x9c')],{'as':_0x71f8('0x1a2'),'foreignKey':_0x71f8('0x1a3')});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x7e')],{'as':'Hoppers','foreignKey':_0x71f8('0x169')});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x81')],{'as':_0x71f8('0x154'),'foreignKey':_0x71f8('0x169')});db['CmContact'][_0x71f8('0x129')](db['CmHopperHistory'],{'as':_0x71f8('0x155'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x7d')]['hasMany'](db[_0x71f8('0x85')],{'as':_0x71f8('0x85'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0x7d')]['hasMany'](db[_0x71f8('0xe5')],{'as':_0x71f8('0x157'),'foreignKey':'ContactId'});db['CmContact'][_0x71f8('0x129')](db[_0x71f8('0x67')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':'restrict'});db['CmContact']['hasMany'](db['ChatInteraction'],{'as':_0x71f8('0x13a'),'foreignKey':_0x71f8('0x169'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x5e')],{'as':_0x71f8('0x13e'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x52')],{'as':_0x71f8('0x13c'),'foreignKey':'ContactId','onDelete':_0x71f8('0x16c')});db[_0x71f8('0x7d')][_0x71f8('0x129')](db[_0x71f8('0x49')],{'as':_0x71f8('0x12f'),'foreignKey':_0x71f8('0x169'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x7d')][_0x71f8('0x15a')](db[_0x71f8('0x7b')],{'as':_0x71f8('0x1a4'),'foreignKey':'CompanyId'});db['CmContact'][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':'ListId','onDelete':_0x71f8('0x125')});db[_0x71f8('0x7d')]['belongsToMany'](db['User'],{'as':_0x71f8('0x17a'),'through':'cm_user_has_contacts'});db[_0x71f8('0x7d')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'as':_0x71f8('0x179'),'through':_0x71f8('0x1a5')});db[_0x71f8('0x7d')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x1a5'),'as':_0x71f8('0x188')});db[_0x71f8('0x7e')][_0x71f8('0x129')](db[_0x71f8('0x9e')],{'as':_0x71f8('0x1a6'),'foreignKey':'CmHopperId'});db[_0x71f8('0x7e')][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x7e')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':'ListId','onDelete':_0x71f8('0x125')});db[_0x71f8('0x7e')]['belongsTo'](db[_0x71f8('0x124')],{'as':'Agent','foreignKey':'UserId'});db[_0x71f8('0x7e')]['belongsTo'](db[_0x71f8('0x1d')],{'as':_0x71f8('0x198'),'foreignKey':_0x71f8('0x153'),'onDelete':_0x71f8('0x125')});db['CmHopper'][_0x71f8('0x15a')](db[_0x71f8('0x1a7')],{'as':_0x71f8('0x1a7'),'foreignKey':_0x71f8('0x1a8'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x7e')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x71f8('0x7f')]['belongsTo'](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x7f')][_0x71f8('0x15a')](db[_0x71f8('0x107')],{'as':'List','foreignKey':_0x71f8('0x181'),'onDelete':_0x71f8('0x125')});db['CmHopperBlack'][_0x71f8('0x15a')](db[_0x71f8('0x1d')],{'as':'Queue','foreignKey':_0x71f8('0x153'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x7f')][_0x71f8('0x15a')](db[_0x71f8('0x1a7')],{'as':_0x71f8('0x1a7'),'foreignKey':_0x71f8('0x1a8'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x8b')][_0x71f8('0x129')](db[_0x71f8('0x1a9')],{'as':{'plural':'All','singular':_0x71f8('0x1aa')},'foreignKey':'AutomationAllId','onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0x8b')]['hasMany'](db[_0x71f8('0x1a9')],{'as':{'plural':_0x71f8('0x1ab'),'singular':_0x71f8('0x1ac')},'foreignKey':_0x71f8('0x1ad'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db['Automation']['hasMany'](db['Action'],{'as':_0x71f8('0x1ae'),'foreignKey':_0x71f8('0x1af'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0x8f')]['hasMany'](db[_0x71f8('0x8f')],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x1b0'),'onDelete':'cascade'});db[_0x71f8('0x91')][_0x71f8('0x129')](db['Interval'],{'as':_0x71f8('0x1b1'),'foreignKey':_0x71f8('0x17e'),'onDelete':_0x71f8('0x125'),'hooks':!![],'required':![]});db[_0x71f8('0x91')][_0x71f8('0x129')](db[_0x71f8('0x1a')],{'as':_0x71f8('0x12c'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x71f8('0x91')][_0x71f8('0x129')](db[_0x71f8('0x172')],{'as':_0x71f8('0x1b2'),'foreignKey':'IntervalId'});db[_0x71f8('0x91')][_0x71f8('0x129')](db[_0x71f8('0x71')],{'as':'ChatApplications','foreignKey':'IntervalId'});db['Interval'][_0x71f8('0x129')](db[_0x71f8('0x185')],{'as':_0x71f8('0x1b3'),'foreignKey':'IntervalId'});db['Interval'][_0x71f8('0x129')](db[_0x71f8('0x5c')],{'as':_0x71f8('0x1b4'),'foreignKey':'IntervalId'});db[_0x71f8('0x1b5')][_0x71f8('0x15a')](db[_0x71f8('0x44')],{});db[_0x71f8('0x1b5')][_0x71f8('0x15a')](db['AnalyticDefaultReport'],{'foreignKey':_0x71f8('0x1b6')});db['Schedule']['belongsTo'](db[_0x71f8('0xa6')],{'foreignKey':'CustomReportId'});db[_0x71f8('0x98')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':_0x71f8('0x1b7'),'through':_0x71f8('0x1b8'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x99')][_0x71f8('0x134')](db[_0x71f8('0x7d')],{'through':_0x71f8('0x1a5')});db['Tag'][_0x71f8('0x134')](db[_0x71f8('0x72')],{'through':'chat_interaction_has_tags'});db[_0x71f8('0x99')]['belongsToMany'](db['MailInteraction'],{'through':_0x71f8('0x1b9')});db[_0x71f8('0x99')][_0x71f8('0x134')](db[_0x71f8('0x5e')],{'through':_0x71f8('0x18e')});db[_0x71f8('0x99')]['belongsToMany'](db['FaxInteraction'],{'through':_0x71f8('0x1ba')});db[_0x71f8('0x99')]['belongsToMany'](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x71f8('0x99')][_0x71f8('0x134')](db[_0x71f8('0x112')],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem']['belongsTo'](db[_0x71f8('0x9b')],{'as':_0x71f8('0x1bb'),'foreignKey':'ItemTypeId'});db[_0x71f8('0x9e')][_0x71f8('0x15a')](db['CmHopper'],{'as':_0x71f8('0x1bc'),'foreignKey':_0x71f8('0x1bd')});db[_0x71f8('0x9c')]['belongsTo'](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':'CmContactId'});db[_0x71f8('0xa1')][_0x71f8('0x129')](db[_0x71f8('0x1a9')],{'as':{'plural':_0x71f8('0x1be'),'singular':_0x71f8('0x1bf')},'foreignKey':'TriggerAllId','onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0xa1')]['hasMany'](db['Condition'],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0x71f8('0x1c0'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0xa1')][_0x71f8('0x129')](db[_0x71f8('0x89')],{'as':_0x71f8('0x1ae'),'foreignKey':_0x71f8('0x1c1'),'onDelete':_0x71f8('0x125'),'hooks':!![]});db[_0x71f8('0xa6')]['hasMany'](db[_0x71f8('0xae')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c3'),'hooks':!![]});db[_0x71f8('0xa8')][_0x71f8('0x129')](db[_0x71f8('0xae')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1b6')});db[_0x71f8('0xac')][_0x71f8('0x129')](db[_0x71f8('0xae')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x71f8('0x15a')](db[_0x71f8('0xac')],{'foreignKey':_0x71f8('0x1c4')});db[_0x71f8('0xb1')]['hasMany'](db[_0x71f8('0xb3')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xb3')]['hasMany'](db[_0x71f8('0xb5')],{'as':_0x71f8('0x1c7'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xb3')][_0x71f8('0x129')](db[_0x71f8('0xb5')],{'as':_0x71f8('0x1c9'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1ca')});db['SalesforceConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xb5')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x71f8('0x15a')](db[_0x71f8('0xb1')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xb5')][_0x71f8('0x129')](db['SalesforceField'],{'as':_0x71f8('0x1cb'),'foreignKey':'SubjectId'});db[_0x71f8('0xb5')][_0x71f8('0x129')](db[_0x71f8('0xb5')],{'as':_0x71f8('0x1cc'),'foreignKey':'DescriptionId'});db[_0x71f8('0xb5')][_0x71f8('0x129')](db[_0x71f8('0xb5')],{'as':_0x71f8('0x1cd'),'foreignKey':'FieldId'});db[_0x71f8('0xb5')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0x1cf')][_0x71f8('0x129')](db[_0x71f8('0xb7')],{'as':_0x71f8('0x1c5'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c6')});db['SugarcrmConfiguration'][_0x71f8('0x129')](db['SugarcrmField'],{'as':_0x71f8('0x1c7'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c8')});db['SugarcrmConfiguration'][_0x71f8('0x129')](db['SugarcrmField'],{'as':_0x71f8('0x1c9'),'onDelete':_0x71f8('0x125'),'foreignKey':'DescriptionId'});db[_0x71f8('0xb7')]['hasMany'](db[_0x71f8('0xb8')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xb7')][_0x71f8('0x15a')](db[_0x71f8('0x1cf')],{'as':'Account','foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xb8')][_0x71f8('0x129')](db['SugarcrmField'],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db['SugarcrmField'][_0x71f8('0x129')](db[_0x71f8('0xb8')],{'as':_0x71f8('0x1cc'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xb8')][_0x71f8('0x129')](db[_0x71f8('0xb8')],{'as':'Field','foreignKey':'FieldId'});db[_0x71f8('0xb8')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':'VariableId'});db[_0x71f8('0xba')][_0x71f8('0x129')](db[_0x71f8('0xbb')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xbb')][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':_0x71f8('0x1c7'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c8')});db['DeskConfiguration'][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':_0x71f8('0x1c9'),'onDelete':'cascade','foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xbb')][_0x71f8('0x129')](db['DeskField'],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xbb')][_0x71f8('0x15a')](db[_0x71f8('0xba')],{'as':'Account','foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xbb')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x1d2')});db[_0x71f8('0x1d1')][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0x1d1')][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':'Description','foreignKey':_0x71f8('0x1ca')});db['DeskField'][_0x71f8('0x129')](db[_0x71f8('0x1d1')],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d1')][_0x71f8('0x15a')](db['Variable'],{'as':'Variable','foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xbe')][_0x71f8('0x129')](db[_0x71f8('0x1d3')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':'AccountId'});db[_0x71f8('0x1d3')]['hasMany'](db[_0x71f8('0xc1')],{'as':_0x71f8('0x1c7'),'onDelete':_0x71f8('0x125'),'foreignKey':'SubjectId'});db[_0x71f8('0x1d3')]['hasMany'](db[_0x71f8('0xc1')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0x1d3')][_0x71f8('0x129')](db[_0x71f8('0xc1')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d3')][_0x71f8('0x15a')](db['ZohoAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xc1')]['hasMany'](db[_0x71f8('0xc1')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x71f8('0xc1')][_0x71f8('0x129')](db['ZohoField'],{'as':_0x71f8('0x1cc'),'foreignKey':'DescriptionId'});db[_0x71f8('0xc1')][_0x71f8('0x129')](db['ZohoField'],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xc1')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xc3')][_0x71f8('0x129')](db[_0x71f8('0xc4')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x71f8('0x129')](db['ZendeskField'],{'as':_0x71f8('0x1c7'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xc4')][_0x71f8('0x129')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x71f8('0x1ca')});db['ZendeskConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xc5')],{'as':'Fields','foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xc4')][_0x71f8('0x15a')](db[_0x71f8('0xc3')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xc4')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x1d4')});db[_0x71f8('0xc5')][_0x71f8('0x129')](db[_0x71f8('0xc5')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db['ZendeskField'][_0x71f8('0x129')](db[_0x71f8('0xc5')],{'as':_0x71f8('0x1cc'),'foreignKey':'DescriptionId'});db[_0x71f8('0xc5')]['hasMany'](db[_0x71f8('0xc5')],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xc5')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xc6')][_0x71f8('0x129')](db[_0x71f8('0x1d5')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0x1d5')][_0x71f8('0x129')](db['FreshdeskField'],{'as':_0x71f8('0x1c7'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c8')});db['FreshdeskConfiguration']['hasMany'](db[_0x71f8('0xc9')],{'as':_0x71f8('0x1c9'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1ca')});db['FreshdeskConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xc9')],{'as':_0x71f8('0x1c2'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d5')][_0x71f8('0x15a')](db[_0x71f8('0xc6')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0x1d5')][_0x71f8('0x134')](db[_0x71f8('0x99')],{'through':_0x71f8('0x1d6')});db['FreshdeskField']['hasMany'](db[_0x71f8('0xc9')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xc9')][_0x71f8('0x129')](db[_0x71f8('0xc9')],{'as':_0x71f8('0x1cc'),'foreignKey':'DescriptionId'});db[_0x71f8('0xc9')][_0x71f8('0x129')](db[_0x71f8('0xc9')],{'as':'Field','foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xc9')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xca')][_0x71f8('0x129')](db['VtigerConfiguration'],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xcb')][_0x71f8('0x129')](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1c7'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xcb')][_0x71f8('0x129')](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1c9'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xcb')][_0x71f8('0x129')](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1c2'),'foreignKey':'FieldId'});db[_0x71f8('0xcb')][_0x71f8('0x15a')](db['VtigerAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xcd')]['hasMany'](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xcd')][_0x71f8('0x129')](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1cc'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xcd')]['hasMany'](db[_0x71f8('0xcd')],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xcd')]['belongsTo'](db['Variable'],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db['ServicenowAccount']['hasMany'](db[_0x71f8('0x1d7')],{'as':_0x71f8('0x1c5'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0x1d7')][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':_0x71f8('0x1c7'),'foreignKey':_0x71f8('0x1c8')});db['ServicenowConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':_0x71f8('0x1c9'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':'Fields','foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d7')]['belongsTo'](db['ServicenowAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xd1')][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':'Subject','foreignKey':_0x71f8('0x1c8')});db['ServicenowField'][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':'Description','foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xd1')][_0x71f8('0x129')](db[_0x71f8('0xd1')],{'as':_0x71f8('0x1cd'),'foreignKey':'FieldId'});db[_0x71f8('0xd1')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0xd3')][_0x71f8('0x129')](db[_0x71f8('0xd5')],{'as':_0x71f8('0x1c5'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xd3')]['belongsTo'](db['CloudProvider'],{'as':_0x71f8('0x11c'),'foreignKey':'CloudProviderId'});db[_0x71f8('0xd5')]['hasMany'](db[_0x71f8('0xd7')],{'as':_0x71f8('0x1c7'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xd5')]['hasMany'](db[_0x71f8('0xd7')],{'as':_0x71f8('0x1c9'),'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1ca')});db['Dynamics365Configuration'][_0x71f8('0x129')](db['Dynamics365Field'],{'as':_0x71f8('0x1c2'),'onDelete':'cascade','foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xd5')]['belongsTo'](db[_0x71f8('0xd3')],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db['Dynamics365Field'][_0x71f8('0x129')](db[_0x71f8('0xd7')],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xd7')]['hasMany'](db[_0x71f8('0xd7')],{'as':_0x71f8('0x1cc'),'foreignKey':_0x71f8('0x1ca')});db['Dynamics365Field'][_0x71f8('0x129')](db['Dynamics365Field'],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0xd7')][_0x71f8('0x15a')](db[_0x71f8('0xa3')],{'as':_0x71f8('0xa3'),'foreignKey':_0x71f8('0x1ce')});db[_0x71f8('0x1d8')][_0x71f8('0x129')](db[_0x71f8('0xd9')],{'as':_0x71f8('0x1c5'),'onDelete':'cascade','foreignKey':_0x71f8('0x1c6')});db[_0x71f8('0xd9')]['hasMany'](db['FreshsalesField'],{'as':_0x71f8('0x1c7'),'foreignKey':_0x71f8('0x1c8')});db[_0x71f8('0xd9')][_0x71f8('0x129')](db[_0x71f8('0x1d9')],{'as':_0x71f8('0x1c9'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0xd9')][_0x71f8('0x129')](db[_0x71f8('0x1d9')],{'as':_0x71f8('0x1c2'),'foreignKey':'FieldId'});db[_0x71f8('0xd9')][_0x71f8('0x15a')](db['FreshsalesAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1c6')});db['FreshsalesField'][_0x71f8('0x129')](db['FreshsalesField'],{'as':_0x71f8('0x1cb'),'foreignKey':_0x71f8('0x1c8')});db['FreshsalesField'][_0x71f8('0x129')](db['FreshsalesField'],{'as':_0x71f8('0x1cc'),'foreignKey':_0x71f8('0x1ca')});db[_0x71f8('0x1d9')][_0x71f8('0x129')](db[_0x71f8('0x1d9')],{'as':_0x71f8('0x1cd'),'foreignKey':_0x71f8('0x1d0')});db[_0x71f8('0x1d9')][_0x71f8('0x15a')](db['Variable'],{'as':_0x71f8('0xa3'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{});db['ChatQueueReport']['belongsTo'](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db['ChatQueueReport'][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0xdf')][_0x71f8('0x15a')](db[_0x71f8('0x72')],{});db[_0x71f8('0xdf')]['belongsTo'](db[_0x71f8('0x74')],{});db[_0x71f8('0xdf')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{});db['ChatQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x142')],{});db[_0x71f8('0xe0')]['belongsTo'](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x125'),'foreignKey':'FromId'});db[_0x71f8('0xe0')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x125'),'foreignKey':_0x71f8('0x1da')});db[_0x71f8('0xe5')][_0x71f8('0x129')](db['JscriptyQuestionReport'],{'foreignKey':_0x71f8('0x1db'),'onDelete':_0x71f8('0x125')});db['JscriptySessionReport']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x71f8('0x125')});db[_0x71f8('0xe6')]['belongsTo'](db[_0x71f8('0x5a')],{});db[_0x71f8('0xe6')]['belongsTo'](db['CmList'],{'as':_0x71f8('0x173'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0xe6')][_0x71f8('0x15a')](db['CmContact'],{'as':_0x71f8('0x177'),'foreignKey':_0x71f8('0x169')});db[_0x71f8('0xe6')][_0x71f8('0x15a')](db['SmsInteraction'],{});db[_0x71f8('0xe6')][_0x71f8('0x15a')](db['SmsMessage'],{});db[_0x71f8('0xe6')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{});db['SmsQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x62')],{});db['JscriptyProject'][_0x71f8('0x129')](db[_0x71f8('0xe5')],{'foreignKey':_0x71f8('0x1dc')});db[_0x71f8('0xec')][_0x71f8('0x129')](db[_0x71f8('0xe3')],{'foreignKey':_0x71f8('0x1dc')});db[_0x71f8('0xec')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x71f8('0x1dc')});db[_0x71f8('0xf5')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x138')});db[_0x71f8('0xf5')][_0x71f8('0x134')](db[_0x71f8('0x1d')],{'through':_0x71f8('0x11d'),'as':'VoiceQueues'});db['Team'][_0x71f8('0x134')](db['MailQueue'],{'through':_0x71f8('0x175'),'as':_0x71f8('0x1dd')});db[_0x71f8('0xf5')]['belongsToMany'](db[_0x71f8('0x142')],{'through':_0x71f8('0x19f'),'as':_0x71f8('0x143')});db['Team'][_0x71f8('0x134')](db[_0x71f8('0x56')],{'through':_0x71f8('0x18a'),'as':'FaxQueues'});db['Team'][_0x71f8('0x134')](db[_0x71f8('0x62')],{'through':_0x71f8('0x190'),'as':'SmsQueues'});db[_0x71f8('0xf5')][_0x71f8('0x134')](db[_0x71f8('0x6b')],{'through':'team_has_openchannel_queues','as':_0x71f8('0x1de')});db[_0x71f8('0xf5')][_0x71f8('0x134')](db[_0x71f8('0x11a')],{'through':_0x71f8('0x1df'),'as':_0x71f8('0x145')});db['Team'][_0x71f8('0x134')](db[_0x71f8('0x1e0')],{'through':_0x71f8('0x11f'),'as':'VoicePrefixes'});db[_0x71f8('0x1a7')][_0x71f8('0x129')](db[_0x71f8('0x7e')],{'as':_0x71f8('0x1e1'),'foreignKey':_0x71f8('0x1a8')});db['Campaign']['hasMany'](db['CmHopperFinal'],{'as':_0x71f8('0x154'),'foreignKey':_0x71f8('0x1a8')});db[_0x71f8('0x1a7')][_0x71f8('0x129')](db[_0x71f8('0x83')],{'as':'HopperHistories','foreignKey':_0x71f8('0x1a8')});db['Campaign'][_0x71f8('0x129')](db['CmHopperBlack'],{'as':_0x71f8('0x156'),'foreignKey':'CampaignId'});db['Campaign'][_0x71f8('0x15a')](db[_0x71f8('0x158')],{'as':'Trunk','foreignKey':_0x71f8('0x159')});db[_0x71f8('0x1a7')]['belongsTo'](db[_0x71f8('0x158')],{'as':_0x71f8('0x15b'),'foreignKey':_0x71f8('0x15c')});db[_0x71f8('0x1a7')]['belongsTo'](db[_0x71f8('0x91')],{'as':_0x71f8('0x91'),'foreignKey':_0x71f8('0x17e')});db[_0x71f8('0x1a7')][_0x71f8('0x15a')](db[_0x71f8('0xf0')],{'as':_0x71f8('0xf0'),'foreignKey':_0x71f8('0x1e2')});db[_0x71f8('0x1a7')]['belongsToMany'](db[_0x71f8('0x107')],{'as':_0x71f8('0x137'),'through':_0x71f8('0x1e3')});db[_0x71f8('0x1a7')][_0x71f8('0x134')](db[_0x71f8('0x107')],{'as':'BlackLists','through':_0x71f8('0x1e4')});db['Attachment']['belongsTo'](db[_0x71f8('0x17d')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x4a')],{});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x49')],{});db['MailTransferReport'][_0x71f8('0x15a')](db['MailAccount'],{'foreignKey':_0x71f8('0x1e5'),'as':_0x71f8('0x1e6')});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':'FromUserId','as':_0x71f8('0x1e7')});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1e8'),'as':_0x71f8('0x1e9')});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0x71f8('0x1ea')});db[_0x71f8('0xfd')][_0x71f8('0x15a')](db[_0x71f8('0x44')],{'foreignKey':'ToMailAccountId','as':_0x71f8('0x1eb')});db[_0x71f8('0xff')][_0x71f8('0x15a')](db[_0x71f8('0x74')],{});db[_0x71f8('0xff')]['belongsTo'](db[_0x71f8('0x72')],{});db[_0x71f8('0xff')][_0x71f8('0x15a')](db['ChatWebsite'],{'foreignKey':_0x71f8('0x1ec'),'as':_0x71f8('0x1e6')});db['ChatTransferReport'][_0x71f8('0x15a')](db['User'],{'foreignKey':_0x71f8('0x1ed'),'as':_0x71f8('0x1e7')});db[_0x71f8('0xff')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1e8'),'as':_0x71f8('0x1e9')});db[_0x71f8('0xff')][_0x71f8('0x15a')](db[_0x71f8('0x142')],{'foreignKey':_0x71f8('0x1ee'),'as':_0x71f8('0x1ea')});db['ChatTransferReport'][_0x71f8('0x15a')](db[_0x71f8('0x6d')],{'foreignKey':_0x71f8('0x1ef'),'as':_0x71f8('0x1eb')});db[_0x71f8('0x101')]['belongsTo'](db[_0x71f8('0x54')],{});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x52')],{});db[_0x71f8('0x101')]['belongsTo'](db[_0x71f8('0x147')],{'foreignKey':'FromFaxAccountId','as':_0x71f8('0x1e6')});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1ed'),'as':_0x71f8('0x1e7')});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1e8'),'as':'ToAgent'});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x56')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0x71f8('0x101')][_0x71f8('0x15a')](db[_0x71f8('0x147')],{'foreignKey':_0x71f8('0x1f0'),'as':_0x71f8('0x1eb')});db[_0x71f8('0x103')][_0x71f8('0x15a')](db[_0x71f8('0x69')],{});db[_0x71f8('0x103')][_0x71f8('0x15a')](db[_0x71f8('0x67')],{});db[_0x71f8('0x103')]['belongsTo'](db[_0x71f8('0x64')],{'foreignKey':'FromOpenchannelAccountId','as':_0x71f8('0x1e6')});db['OpenchannelTransferReport'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':'FromUserId','as':'FromAgent'});db['OpenchannelTransferReport'][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1e8'),'as':_0x71f8('0x1e9')});db[_0x71f8('0x103')][_0x71f8('0x15a')](db['OpenchannelQueue'],{'foreignKey':_0x71f8('0x1f1'),'as':'ToQueue'});db[_0x71f8('0x103')][_0x71f8('0x15a')](db['OpenchannelAccount'],{'foreignKey':_0x71f8('0x1f2'),'as':_0x71f8('0x1eb')});db['SmsTransferReport'][_0x71f8('0x15a')](db[_0x71f8('0x60')],{});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x5e')],{});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x5a')],{'foreignKey':_0x71f8('0x1f3'),'as':_0x71f8('0x1e6')});db['SmsTransferReport']['belongsTo'](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1ed'),'as':_0x71f8('0x1e7')});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':'ToUserId','as':_0x71f8('0x1e9')});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x62')],{'foreignKey':_0x71f8('0x1f4'),'as':_0x71f8('0x1ea')});db[_0x71f8('0x105')][_0x71f8('0x15a')](db[_0x71f8('0x5a')],{'foreignKey':_0x71f8('0x1f5'),'as':_0x71f8('0x1eb')});db[_0x71f8('0x107')][_0x71f8('0x129')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x71f8('0x181'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x107')][_0x71f8('0x129')](db['CmCustomField'],{'as':_0x71f8('0x1f6'),'foreignKey':_0x71f8('0x181')});db['CmList'][_0x71f8('0x129')](db[_0x71f8('0x7d')],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x71f8('0x181')});db[_0x71f8('0x107')]['hasMany'](db[_0x71f8('0x81')],{'as':_0x71f8('0x154'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0x107')]['hasMany'](db[_0x71f8('0x83')],{'as':_0x71f8('0x12d'),'foreignKey':_0x71f8('0x181')});db[_0x71f8('0x107')]['hasMany'](db['ReportAgentPreview'],{'as':_0x71f8('0x85'),'foreignKey':'ListId'});db[_0x71f8('0x107')][_0x71f8('0x134')](db[_0x71f8('0x1d')],{'as':_0x71f8('0x1f7'),'through':'voice_queues_has_cm_lists'});db[_0x71f8('0x107')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':'cm_user_has_lists'});db[_0x71f8('0x1e0')]['hasMany'](db['VoiceExtension'],{'as':_0x71f8('0x12c'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x1e0')]['belongsToMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':'UserVoicePrefix'});db[_0x71f8('0x1e0')]['belongsToMany'](db[_0x71f8('0xf5')],{'through':'TeamVoicePrefix','as':_0x71f8('0x161')});db[_0x71f8('0x109')]['hasMany'](db[_0x71f8('0x124')],{'as':_0x71f8('0x17a'),'foreignKey':_0x71f8('0x133')});db[_0x71f8('0x109')][_0x71f8('0x129')](db[_0x71f8('0x10a')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x71f8('0x125')});db['UserProfileSection'][_0x71f8('0x129')](db[_0x71f8('0x10c')],{'as':_0x71f8('0x1f8'),'foreignKey':_0x71f8('0x1f9'),'onDelete':_0x71f8('0x125')});db[_0x71f8('0x10f')][_0x71f8('0x129')](db['Disposition'],{'as':_0x71f8('0x16f'),'foreignKey':_0x71f8('0x1fa'),'onDelete':'cascade'});db[_0x71f8('0x10f')]['hasMany'](db[_0x71f8('0x8d')],{'as':_0x71f8('0x170'),'foreignKey':_0x71f8('0x1fa')});db[_0x71f8('0x10f')][_0x71f8('0x129')](db[_0x71f8('0x114')],{'as':_0x71f8('0x171'),'foreignKey':_0x71f8('0x1fa')});db[_0x71f8('0x10f')][_0x71f8('0x129')](db[_0x71f8('0x112')],{'as':'Interactions'});db[_0x71f8('0x10f')][_0x71f8('0x129')](db[_0x71f8('0x111')],{'as':_0x71f8('0x18c')});db['WhatsappAccount']['belongsTo'](db[_0x71f8('0x107')],{'as':'List','foreignKey':'ListId'});db[_0x71f8('0x10f')][_0x71f8('0x15a')](db[_0x71f8('0x93')],{'as':_0x71f8('0x15d'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x71f8('0x10f')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':'Agents','through':_0x71f8('0x14f')});db[_0x71f8('0x111')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x111')][_0x71f8('0x15a')](db[_0x71f8('0x11a')],{'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x111')]['belongsTo'](db[_0x71f8('0x10f')],{'onDelete':_0x71f8('0x16c')});db['WhatsappApplication']['belongsTo'](db[_0x71f8('0x91')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x71f8('0x111')][_0x71f8('0x15a')](db['Tag'],{'onDelete':_0x71f8('0x16c'),'foreignKey':_0x71f8('0x17f')});db[_0x71f8('0x112')][_0x71f8('0x129')](db['WhatsappMessage'],{'as':_0x71f8('0x171'),'onDelete':'cascade','foreignKey':_0x71f8('0x1fb')});db[_0x71f8('0x112')]['belongsTo'](db['WhatsappAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1fa')});db[_0x71f8('0x112')][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':'ContactId'});db[_0x71f8('0x112')]['belongsTo'](db[_0x71f8('0x124')],{'as':_0x71f8('0x178'),'foreignKey':'UserId'});db[_0x71f8('0x112')]['belongsToMany'](db['Tag'],{'through':_0x71f8('0x1fc'),'as':_0x71f8('0x179')});db[_0x71f8('0x112')][_0x71f8('0x134')](db['Tag'],{'through':_0x71f8('0x1fc'),'as':_0x71f8('0x188')});db[_0x71f8('0x112')][_0x71f8('0x134')](db['User'],{'as':'Users','through':_0x71f8('0x140'),'foreignKey':_0x71f8('0x1fb')});db[_0x71f8('0x114')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'as':_0x71f8('0x124')});db['WhatsappMessage'][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'onDelete':_0x71f8('0x125'),'as':_0x71f8('0x177')});db[_0x71f8('0x114')][_0x71f8('0x15a')](db['WhatsappInteraction'],{'onDelete':_0x71f8('0x125'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0x71f8('0x114')][_0x71f8('0x15a')](db['WhatsappAccount'],{'as':_0x71f8('0x176'),'foreignKey':_0x71f8('0x1fa')});db[_0x71f8('0x116')][_0x71f8('0x15a')](db['WhatsappAccount'],{});db[_0x71f8('0x116')]['belongsTo'](db[_0x71f8('0x107')],{'as':_0x71f8('0x173'),'foreignKey':'ListId'});db['WhatsappQueueReport'][_0x71f8('0x15a')](db[_0x71f8('0x7d')],{'as':_0x71f8('0x177'),'foreignKey':'ContactId'});db[_0x71f8('0x116')][_0x71f8('0x15a')](db[_0x71f8('0x112')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x71f8('0x11a')],{});db[_0x71f8('0x116')][_0x71f8('0x15a')](db[_0x71f8('0x114')],{});db[_0x71f8('0x116')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{});db[_0x71f8('0x118')]['belongsTo'](db[_0x71f8('0x114')],{});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x112')],{});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x10f')],{'foreignKey':_0x71f8('0x1fd'),'as':_0x71f8('0x1e6')});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x10f')],{'foreignKey':_0x71f8('0x1fe'),'as':_0x71f8('0x1eb')});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x11a')],{'foreignKey':_0x71f8('0x1ff'),'as':_0x71f8('0x1ea')});db[_0x71f8('0x118')][_0x71f8('0x15a')](db[_0x71f8('0x124')],{'foreignKey':_0x71f8('0x1ed'),'as':_0x71f8('0x1e7')});db['WhatsappTransferReport']['belongsTo'](db[_0x71f8('0x124')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x71f8('0x11a')][_0x71f8('0x134')](db[_0x71f8('0x124')],{'as':_0x71f8('0x160'),'through':_0x71f8('0x3f'),'foreignKey':_0x71f8('0x200')});db[_0x71f8('0x11a')][_0x71f8('0x134')](db[_0x71f8('0xf5')],{'through':_0x71f8('0x1df'),'as':_0x71f8('0x161')});db[_0x71f8('0x122')][_0x71f8('0x15a')](db['User'],{'as':'user','foreignKey':'UserId','onDelete':'cascade','hooks':!![]});db[_0x71f8('0x11c')][_0x71f8('0x126')](db[_0x71f8('0xd3')],{'as':_0x71f8('0xd3'),'onDelete':'restrict'});db[_0x71f8('0x11c')][_0x71f8('0x126')](db[_0x71f8('0x41')],{'as':_0x71f8('0x16d'),'onDelete':_0x71f8('0x16c')});db[_0x71f8('0x11c')][_0x71f8('0x126')](db[_0x71f8('0x42')],{'as':_0x71f8('0x16e'),'onDelete':'restrict'});module[_0x71f8('0x201')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xa04f=['FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','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','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','cascade','userSetting','UserId','VoiceRecording','Recordings','UserVoiceQueueRt','hasMany','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','cm_user_has_contacts','CmList','Lists','Team','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','OpenchannelQueue','OpenchannelQueues','UserOpenchannelQueue','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','MailServerOut','hasOne','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','user_has_mail_accounts','MailInteractionId','Account','Owner','Tags','Tag','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','IntervalId','TagId','DashboardItem','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','user_has_openchannel_accounts','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','Agent','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','Phones','CmContactId','Hoppers','SmsInteractions','AdditionalPhones','CmHopperId','Queue','CampaignId','All','OneAll','AutomationAllId','Any','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','cm_contact_has_tags','whatsapp_interaction_has_tags','ContactItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Variable','VariableId','Field','DeskAccount','DeskField','Descriptions','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','FromId','SessionId','JscriptyProject','ProjectId','VoiceQueues','team_has_mail_queues','team_has_fax_queues','team_has_sms_queues','SmsQueues','team_has_whatsapp_queues','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromAccount','ToAgent','ToChatQueueId','FromFaxAccountId','ToFaxAccountId','OpenchannelTransferReport','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserVoicePrefix','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','jstz','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','database','password','options','User','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../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','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','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','../api/tag/tag.model','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticExtractedReport','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xa04f,0x148));var _0xfa04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa04f[_0x3dd15e];return _0x231fd0;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xfa04('0x0'));var timezone=jstz['determine']();config[_0xfa04('0x1')]=_[_0xfa04('0x2')](config[_0xfa04('0x1')],{'database':_0xfa04('0x3'),'username':_0xfa04('0x4'),'password':_0xfa04('0x5'),'options':{'host':_0xfa04('0x6'),'port':0xcea,'dialect':_0xfa04('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xfa04('0x8')](),'define':{'charset':_0xfa04('0x9'),'collate':_0xfa04('0xa')}}});config[_0xfa04('0xb')]=_[_0xfa04('0x2')](config[_0xfa04('0xb')],{'database':_0xfa04('0x3'),'username':_0xfa04('0x4'),'password':'xC@LL1234','options':{'host':_0xfa04('0x6'),'port':0xcea,'dialect':_0xfa04('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xfa04('0x9'),'collate':_0xfa04('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xfa04('0xc')],config[_0xfa04('0x1')]['username'],config[_0xfa04('0x1')][_0xfa04('0xd')],config[_0xfa04('0x1')][_0xfa04('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa04('0xb')][_0xfa04('0xc')],config[_0xfa04('0xb')]['username'],config[_0xfa04('0xb')][_0xfa04('0xd')],config[_0xfa04('0xb')][_0xfa04('0xe')])};db[_0xfa04('0xf')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/user/user.model');db['VoiceChanSpy']=db['sequelize']['import'](_0xfa04('0x11'));db[_0xfa04('0x12')]=db[_0xfa04('0x1')]['import']('../api/voiceContext/voiceContext.model');db[_0xfa04('0x13')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x14'));db[_0xfa04('0x15')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x16'));db['VoiceRecording']=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x17'));db['ScreenRecording']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x18'));db[_0xfa04('0x19')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x1a'));db[_0xfa04('0x1b')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x1c'));db[_0xfa04('0x1d')]=db['sequelize']['import'](_0xfa04('0x1e'));db['VoiceDialReport']=db[_0xfa04('0x1')]['import'](_0xfa04('0x1f'));db['VoiceAgentReport']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x20'));db[_0xfa04('0x21')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x22'));db[_0xfa04('0x23')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x24'));db[_0xfa04('0x25')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x26'));db[_0xfa04('0x27')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x28'));db['UserVoiceQueueRt']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x29'));db[_0xfa04('0x2a')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x2b'));db[_0xfa04('0x2c')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x2d'));db[_0xfa04('0x2e')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x2f'));db[_0xfa04('0x30')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x31'));db[_0xfa04('0x32')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x33'));db['UserOpenchannelQueue']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x34'));db[_0xfa04('0x35')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x36'));db[_0xfa04('0x37')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x38'));db[_0xfa04('0x39')]=db[_0xfa04('0x1')]['import']('../api/mailAccount/mailAccount.model');db[_0xfa04('0x3a')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/mailQueue/mailQueue.model');db[_0xfa04('0x3b')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/mailSubstatus/mailSubstatus.model');db[_0xfa04('0x3c')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x3d'));db[_0xfa04('0x3e')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x3f'));db[_0xfa04('0x40')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x41'));db[_0xfa04('0x42')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/mailQueueReport/mailQueueReport.model');db[_0xfa04('0x43')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x44'));db['DashboardItem']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x45'));db[_0xfa04('0x46')]=db['sequelize']['import'](_0xfa04('0x47'));db[_0xfa04('0x48')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x49'));db[_0xfa04('0x4a')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x4b'));db[_0xfa04('0x4c')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x4d'));db[_0xfa04('0x4e')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/faxQueue/faxQueue.model');db['FaxQueueReport']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x4f'));db[_0xfa04('0x50')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x51'));db[_0xfa04('0x52')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x53'));db[_0xfa04('0x54')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/smsInteraction/smsInteraction.model');db[_0xfa04('0x55')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x56'));db[_0xfa04('0x57')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x58'));db[_0xfa04('0x59')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x5a'));db[_0xfa04('0x5b')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x5c'));db[_0xfa04('0x5d')]=db['sequelize']['import']('../api/openchannelInteraction/openchannelInteraction.model');db[_0xfa04('0x5e')]=db[_0xfa04('0x1')]['import']('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x5f'));db[_0xfa04('0x60')]=db['sequelize'][_0xfa04('0x10')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xfa04('0x61')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x62'));db[_0xfa04('0x63')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x64'));db[_0xfa04('0x65')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x66'));db[_0xfa04('0x67')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xfa04('0x68')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/chatQueue/chatQueue.model');db[_0xfa04('0x69')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x6a'));db[_0xfa04('0x6b')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x6c'));db[_0xfa04('0x6d')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x6e'));db[_0xfa04('0x6f')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x70'));db[_0xfa04('0x71')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x72'));db[_0xfa04('0x73')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x74'));db[_0xfa04('0x75')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x76'));db[_0xfa04('0x77')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x78'));db[_0xfa04('0x79')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x7a'));db[_0xfa04('0x7b')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x7c'));db[_0xfa04('0x7d')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x7e'));db[_0xfa04('0x7f')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x80'));db['Disposition']=db['sequelize']['import'](_0xfa04('0x81'));db[_0xfa04('0x82')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x83'));db[_0xfa04('0x84')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/interval/interval.model');db[_0xfa04('0x85')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x86'));db[_0xfa04('0x87')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x88'));db[_0xfa04('0x89')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x8a'));db[_0xfa04('0x8b')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x8c'));db['Sound']=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x8d'));db['Tag']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x8e'));db['ContactItemType']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x8f'));db[_0xfa04('0x90')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x91'));db[_0xfa04('0x92')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x93'));db[_0xfa04('0x94')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x95'));db[_0xfa04('0x96')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x97'));db['Variable']=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/variable/variable.model');db[_0xfa04('0x98')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x99'));db[_0xfa04('0x9a')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x9b'));db[_0xfa04('0x9c')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db['sequelize'][_0xfa04('0x10')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xfa04('0x9d')]=db['sequelize'][_0xfa04('0x10')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x9e'));db[_0xfa04('0x9f')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xa0'));db[_0xfa04('0xa1')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xfa04('0xa2')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xa3'));db['SalesforceConfiguration']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xa4'));db[_0xfa04('0xa5')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xa6'));db[_0xfa04('0xa7')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xa8'));db[_0xfa04('0xa9')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xaa'));db[_0xfa04('0xab')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xac'));db['DeskAccount']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xad'));db[_0xfa04('0xae')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xaf'));db['DeskField']=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/intDeskField/intDeskField.model');db[_0xfa04('0xb0')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xb1'));db['ZohoConfiguration']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xb2'));db[_0xfa04('0xb3')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xb4'));db[_0xfa04('0xb5')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xb6'));db[_0xfa04('0xb7')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xb8'));db['ZendeskField']=db[_0xfa04('0x1')]['import'](_0xfa04('0xb9'));db['FreshdeskAccount']=db[_0xfa04('0x1')]['import']('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xfa04('0xba')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xbb'));db[_0xfa04('0xbc')]=db[_0xfa04('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xfa04('0xbd')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xbe'));db['VtigerConfiguration']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xbf'));db['VtigerField']=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xc0'));db[_0xfa04('0xc1')]=db['sequelize'][_0xfa04('0x10')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xfa04('0xc2')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xc3'));db[_0xfa04('0xc4')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/intServicenowField/intServicenowField.model');db[_0xfa04('0xc5')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xc6'));db[_0xfa04('0xc7')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xfa04('0xc8')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xc9'));db[_0xfa04('0xca')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xcb'));db[_0xfa04('0xcc')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xcd'));db[_0xfa04('0xce')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xcf'));db[_0xfa04('0x98')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x99'));db['Network']=db[_0xfa04('0x1')]['import'](_0xfa04('0xd0'));db[_0xfa04('0xd1')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xd2'));db[_0xfa04('0xd3')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xfa04('0xd4')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xd5'));db[_0xfa04('0xd6')]=db[_0xfa04('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xfa04('0xd7')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xd8'));db[_0xfa04('0xd9')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xda'));db[_0xfa04('0xdb')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xdc'));db['SquareDetailsReport']=db['sequelize']['import'](_0xfa04('0xdd'));db['JscriptyProject']=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xde'));db[_0xfa04('0xdf')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xe0'));db['SquareOdbc']=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xe1'));db['SquareProject']=db['sequelize'][_0xfa04('0x10')]('../api/squareProject/squareProject.model');db[_0xfa04('0xe2')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xe3'));db['SquareMessage']=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/squareMessage/squareMessage.model');db['Team']=db[_0xfa04('0x1')]['import'](_0xfa04('0xe4'));db[_0xfa04('0xe5')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xe6'));db[_0xfa04('0xe7')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/campaign/campaign.model');db[_0xfa04('0xe8')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xe9'));db[_0xfa04('0xea')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xeb'));db['Plugin']=db['sequelize']['import'](_0xfa04('0xec'));db[_0xfa04('0xed')]=db['sequelize'][_0xfa04('0x10')]('../api/mailTransferReport/mailTransferReport.model');db[_0xfa04('0xee')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xef'));db[_0xfa04('0xf0')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db['sequelize'][_0xfa04('0x10')](_0xfa04('0xf1'));db[_0xfa04('0xf2')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xf3'));db['VoicePrefix']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xf4'));db[_0xfa04('0xf5')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xf6'));db[_0xfa04('0xf7')]=db[_0xfa04('0x1')][_0xfa04('0x10')]('../api/userProfileSection/userProfileSection.model');db[_0xfa04('0xf8')]=db['sequelize'][_0xfa04('0x10')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xf9'));db[_0xfa04('0xfa')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xfb'));db[_0xfa04('0xfc')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0xfd'));db[_0xfa04('0xfe')]=db[_0xfa04('0x1')]['import'](_0xfa04('0xff'));db[_0xfa04('0x100')]=db[_0xfa04('0x1')]['import']('../api/whatsappMessage/whatsappMessage.model');db[_0xfa04('0x101')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x102'));db[_0xfa04('0x103')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x104'));db[_0xfa04('0x105')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x106'));db[_0xfa04('0x107')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x108'));db[_0xfa04('0x109')]=db[_0xfa04('0x1')][_0xfa04('0x10')](_0xfa04('0x10a'));db[_0xfa04('0x10b')]=db['sequelize'][_0xfa04('0x10')](_0xfa04('0x10c'));db['UserVoicePrefix']=db[_0xfa04('0x1')]['import'](_0xfa04('0x10d'));db[_0xfa04('0x10e')]=db[_0xfa04('0x1')]['import'](_0xfa04('0x10f'));db[_0xfa04('0xf')]['hasOne'](db[_0xfa04('0x19')],{'as':_0xfa04('0x19'),'onDelete':_0xfa04('0x110'),'foreignKey':'UserId'});db[_0xfa04('0xf')]['hasOne'](db[_0xfa04('0x10e')],{'as':_0xfa04('0x111'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0xf')]['hasMany'](db[_0xfa04('0x113')],{'as':_0xfa04('0x114'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0xf')]['hasMany'](db[_0xfa04('0x115')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db[_0xfa04('0xf')]['hasMany'](db[_0xfa04('0x13')],{'as':'Extensions','onDelete':_0xfa04('0x110'),'hooks':!![]});db['User'][_0xfa04('0x116')](db[_0xfa04('0x75')],{'as':'HopperFinals','foreignKey':_0xfa04('0x112')});db[_0xfa04('0xf')]['hasMany'](db[_0xfa04('0x117')],{'as':_0xfa04('0x118'),'foreignKey':'UserId'});db[_0xfa04('0xf')]['hasMany'](db['ReportAgentPreview'],{'as':_0xfa04('0x77'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0xf')][_0xfa04('0x116')](db['OpenchannelInteraction'],{'as':_0xfa04('0x119'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0xf')][_0xfa04('0x116')](db[_0xfa04('0x63')],{'as':_0xfa04('0x11a'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0xf')][_0xfa04('0x116')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xfa04('0x112')});db[_0xfa04('0xf')]['hasMany'](db[_0xfa04('0x4a')],{'as':'FaxInteractions','foreignKey':_0xfa04('0x112')});db[_0xfa04('0xf')][_0xfa04('0x116')](db[_0xfa04('0x3c')],{'as':'MailInteractions','foreignKey':'UserId'});db[_0xfa04('0xf')]['hasMany'](db[_0xfa04('0xfe')],{'as':_0xfa04('0x11b'),'foreignKey':_0xfa04('0x112')});db['User'][_0xfa04('0x116')](db[_0xfa04('0x11c')],{'as':_0xfa04('0x11d'),'foreignKey':_0xfa04('0x11e')});db[_0xfa04('0xf')][_0xfa04('0x11f')](db[_0xfa04('0xf5')],{'as':_0xfa04('0xf5'),'foreignKey':_0xfa04('0x120')});db['User'][_0xfa04('0x121')](db[_0xfa04('0x69')],{'as':_0xfa04('0x122'),'through':_0xfa04('0x123')});db['User'][_0xfa04('0x121')](db['CmContact'],{'as':'Contacts','through':_0xfa04('0x124')});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0x125')],{'as':_0xfa04('0x126'),'through':'cm_user_has_lists'});db[_0xfa04('0xf')]['belongsToMany'](db[_0xfa04('0x127')],{'through':_0xfa04('0x128')});db[_0xfa04('0xf')]['belongsToMany'](db[_0xfa04('0x3c')],{'as':_0xfa04('0x129'),'through':_0xfa04('0x12a')});db[_0xfa04('0xf')][_0xfa04('0x121')](db['ChatInteraction'],{'as':_0xfa04('0x11a'),'through':_0xfa04('0x12b')});db['User'][_0xfa04('0x121')](db['FaxInteraction'],{'as':_0xfa04('0x12c'),'through':'user_has_fax_interactions'});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0x54')],{'as':'SmsInteractions','through':_0xfa04('0x12d')});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0x5d')],{'as':_0xfa04('0x119'),'through':_0xfa04('0x12e')});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0xfe')],{'as':_0xfa04('0x11b'),'through':_0xfa04('0x12f')});db[_0xfa04('0xf')][_0xfa04('0x121')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0xfa04('0x2a'),'required':![]});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0x130')],{'as':_0xfa04('0x131'),'through':'UserVoicePrefix','required':![]});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0x3a')],{'as':_0xfa04('0x132'),'through':_0xfa04('0x2e'),'required':![]});db['User']['belongsToMany'](db['ChatQueue'],{'as':_0xfa04('0x133'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xfa04('0xf')]['belongsToMany'](db['FaxQueue'],{'as':_0xfa04('0x134'),'through':'UserFaxQueue','required':![]});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0x57')],{'as':'SmsQueues','through':_0xfa04('0x32'),'required':![]});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0x135')],{'as':_0xfa04('0x136'),'through':_0xfa04('0x137'),'required':![]});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0x105')],{'as':_0xfa04('0x138'),'through':_0xfa04('0x35'),'required':![]});db['User'][_0xfa04('0x121')](db[_0xfa04('0x125')],{'through':_0xfa04('0x139')});db[_0xfa04('0xf')][_0xfa04('0x121')](db['ChatWebsite'],{'as':_0xfa04('0x13a'),'through':_0xfa04('0x13b')});db['User'][_0xfa04('0x121')](db[_0xfa04('0x46')],{'as':'FaxAccounts','through':_0xfa04('0x13c')});db[_0xfa04('0xf')][_0xfa04('0x121')](db['MailAccount'],{'as':'MailAccounts','through':'user_has_mail_accounts'});db['User'][_0xfa04('0x121')](db['OpenchannelAccount'],{'as':_0xfa04('0x13d'),'through':'user_has_openchannel_accounts'});db[_0xfa04('0xf')]['belongsToMany'](db[_0xfa04('0x50')],{'as':_0xfa04('0x13e'),'through':_0xfa04('0x13f')});db[_0xfa04('0xf')][_0xfa04('0x121')](db[_0xfa04('0xfa')],{'as':_0xfa04('0x140'),'through':_0xfa04('0x141')});db[_0xfa04('0x142')][_0xfa04('0x116')](db[_0xfa04('0x13')],{'as':_0xfa04('0x143'),'onDelete':'cascade','foreignKey':_0xfa04('0x144')});db[_0xfa04('0x12')][_0xfa04('0x116')](db[_0xfa04('0x13')],{'onDelete':_0xfa04('0x110')});db['VoiceExtension'][_0xfa04('0x116')](db[_0xfa04('0x13')],{'as':_0xfa04('0x145'),'onDelete':'cascade'});db[_0xfa04('0x146')]['belongsToMany'](db[_0xfa04('0x147')],{'as':_0xfa04('0x148'),'through':_0xfa04('0x149')});db[_0xfa04('0x15')][_0xfa04('0x116')](db[_0xfa04('0x115')],{'as':_0xfa04('0x14a'),'foreignKey':_0xfa04('0x14b')});db['VoiceQueue'][_0xfa04('0x116')](db[_0xfa04('0x71')],{'as':'Hoppers','foreignKey':_0xfa04('0x14b')});db[_0xfa04('0x15')][_0xfa04('0x116')](db[_0xfa04('0x75')],{'as':_0xfa04('0x14c'),'foreignKey':_0xfa04('0x14b')});db[_0xfa04('0x15')]['hasMany'](db[_0xfa04('0x117')],{'as':_0xfa04('0x14d'),'foreignKey':_0xfa04('0x14b')});db[_0xfa04('0x15')]['hasMany'](db[_0xfa04('0x77')],{'as':_0xfa04('0x77'),'foreignKey':'VoiceQueueId'});db[_0xfa04('0x15')][_0xfa04('0x116')](db[_0xfa04('0x73')],{'as':_0xfa04('0x14e'),'foreignKey':_0xfa04('0x14b')});db[_0xfa04('0x15')]['hasMany'](db[_0xfa04('0xd7')],{'as':_0xfa04('0x14f'),'foreignKey':_0xfa04('0x14b')});db[_0xfa04('0x15')][_0xfa04('0x11f')](db[_0xfa04('0x25')],{'as':_0xfa04('0x25'),'foreignKey':_0xfa04('0x150')});db[_0xfa04('0x15')][_0xfa04('0x11f')](db[_0xfa04('0x25')],{'as':_0xfa04('0x151'),'foreignKey':_0xfa04('0x152')});db[_0xfa04('0x15')]['belongsTo'](db[_0xfa04('0x84')],{'as':_0xfa04('0x84'),'foreignKey':'IntervalId'});db[_0xfa04('0x15')][_0xfa04('0x11f')](db[_0xfa04('0x85')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xfa04('0x15')][_0xfa04('0x121')](db['CmList'],{'as':_0xfa04('0x126'),'through':_0xfa04('0x153')});db['VoiceQueue'][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':_0xfa04('0x154'),'through':_0xfa04('0x2a')});db[_0xfa04('0x15')][_0xfa04('0x121')](db[_0xfa04('0x127')],{'as':_0xfa04('0x155'),'through':_0xfa04('0x109')});db[_0xfa04('0x15')]['belongsToMany'](db[_0xfa04('0x125')],{'as':_0xfa04('0x156'),'through':_0xfa04('0x157')});db['VoiceRecording'][_0xfa04('0x11f')](db['User'],{'as':_0xfa04('0xf'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0x158')][_0xfa04('0x11f')](db['User'],{'as':_0xfa04('0xf'),'foreignKey':'UserId'});db[_0xfa04('0x19')]['hasMany'](db[_0xfa04('0x1b')],{'as':_0xfa04('0x159'),'onDelete':_0xfa04('0x110'),'foreignKey':'mailboxuser','sourceKey':_0xfa04('0x15a')});db[_0xfa04('0x1b')][_0xfa04('0x11f')](db[_0xfa04('0x19')],{'foreignKey':_0xfa04('0x15b'),'targetKey':_0xfa04('0x15a')});db[_0xfa04('0x1d')][_0xfa04('0x116')](db['VoiceQueueReport'],{'as':_0xfa04('0x15c'),'foreignKey':_0xfa04('0x15d'),'constraints':![]});db[_0xfa04('0x1d')][_0xfa04('0x116')](db['VoiceAgentReport'],{'as':_0xfa04('0x15e'),'foreignKey':_0xfa04('0x15d'),'constraints':![]});db[_0xfa04('0x1d')][_0xfa04('0x11f')](db['User'],{'as':_0xfa04('0xf'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0x1d')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db[_0xfa04('0x37')]['belongsTo'](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xfa04('0x161')});db[_0xfa04('0x37')]['belongsTo'](db[_0xfa04('0x107')],{'as':_0xfa04('0x107'),'foreignKey':_0xfa04('0x162'),'onDelete':_0xfa04('0x163')});db[_0xfa04('0x164')][_0xfa04('0x11f')](db[_0xfa04('0x39')],{'as':_0xfa04('0x39'),'foreignKey':_0xfa04('0x161')});db[_0xfa04('0x164')][_0xfa04('0x11f')](db[_0xfa04('0x107')],{'as':_0xfa04('0x107'),'foreignKey':_0xfa04('0x162'),'onDelete':_0xfa04('0x163')});db[_0xfa04('0x39')][_0xfa04('0x165')](db[_0xfa04('0x37')],{'as':_0xfa04('0x166'),'onDelete':'cascade'});db[_0xfa04('0x39')][_0xfa04('0x165')](db[_0xfa04('0x164')],{'as':_0xfa04('0x167'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x39')][_0xfa04('0x116')](db[_0xfa04('0x168')],{'as':_0xfa04('0x169'),'foreignKey':_0xfa04('0x161'),'onDelete':'cascade'});db['MailAccount'][_0xfa04('0x116')](db[_0xfa04('0x7f')],{'as':_0xfa04('0x16a'),'foreignKey':'MailAccountId'});db[_0xfa04('0x39')][_0xfa04('0x116')](db['MailMessage'],{'as':_0xfa04('0x159'),'foreignKey':_0xfa04('0x161')});db[_0xfa04('0x39')][_0xfa04('0x116')](db[_0xfa04('0x3c')],{'as':_0xfa04('0x16b')});db[_0xfa04('0x39')]['hasMany'](db['MailApplication'],{'as':_0xfa04('0x145')});db[_0xfa04('0x39')][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':_0xfa04('0x16d')});db[_0xfa04('0x39')][_0xfa04('0x11f')](db[_0xfa04('0x94')],{'as':_0xfa04('0x94'),'foreignKey':_0xfa04('0x16e')});db[_0xfa04('0x39')][_0xfa04('0x11f')](db[_0xfa04('0x85')],{'as':_0xfa04('0x16f'),'foreignKey':_0xfa04('0x170')});db[_0xfa04('0x39')][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':_0xfa04('0x154'),'through':_0xfa04('0x171')});db[_0xfa04('0x3a')][_0xfa04('0x121')](db['User'],{'as':'Agents','through':_0xfa04('0x2e')});db[_0xfa04('0x3a')][_0xfa04('0x121')](db[_0xfa04('0x127')],{'through':'team_has_mail_queues','as':_0xfa04('0x155')});db['MailInteraction']['hasMany'](db[_0xfa04('0x3e')],{'as':'Messages','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x172')});db[_0xfa04('0x3c')][_0xfa04('0x11f')](db[_0xfa04('0x39')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x161')});db[_0xfa04('0x3c')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db[_0xfa04('0x3c')][_0xfa04('0x11f')](db['User'],{'as':_0xfa04('0x174'),'foreignKey':'UserId'});db[_0xfa04('0x3c')][_0xfa04('0x121')](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xfa04('0x175')});db[_0xfa04('0x3c')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x177'),'as':_0xfa04('0x178')});db[_0xfa04('0x3c')]['belongsToMany'](db[_0xfa04('0xf')],{'as':_0xfa04('0x179'),'through':_0xfa04('0x12a'),'foreignKey':_0xfa04('0x172')});db['MailMessage'][_0xfa04('0x116')](db['Attachment'],{'as':_0xfa04('0x17a'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x3e')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'as':'User'});db[_0xfa04('0x3e')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0x15f')});db[_0xfa04('0x3e')][_0xfa04('0x11f')](db['MailInteraction'],{'as':_0xfa04('0x17b'),'foreignKey':'MailInteractionId'});db[_0xfa04('0x3e')][_0xfa04('0x11f')](db[_0xfa04('0x39')],{'as':'Account','foreignKey':_0xfa04('0x161')});db[_0xfa04('0x3e')][_0xfa04('0x11f')](db[_0xfa04('0x60')],{'as':'ChatWebsite','foreignKey':_0xfa04('0x17c')});db[_0xfa04('0x3e')][_0xfa04('0x11f')](db[_0xfa04('0x67')],{'as':_0xfa04('0x67'),'foreignKey':_0xfa04('0x17d')});db[_0xfa04('0x40')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'onDelete':_0xfa04('0x163')});db[_0xfa04('0x40')][_0xfa04('0x11f')](db[_0xfa04('0x3a')],{'onDelete':_0xfa04('0x163')});db[_0xfa04('0x40')][_0xfa04('0x11f')](db[_0xfa04('0x39')],{'onDelete':_0xfa04('0x163')});db['MailApplication']['belongsTo'](db[_0xfa04('0x84')],{'onDelete':_0xfa04('0x163'),'foreignKey':_0xfa04('0x17e')});db['MailApplication'][_0xfa04('0x11f')](db[_0xfa04('0x176')],{'onDelete':'restrict','foreignKey':_0xfa04('0x17f')});db[_0xfa04('0x42')]['belongsTo'](db['MailAccount'],{});db['MailQueueReport'][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':'List','foreignKey':_0xfa04('0x16d')});db[_0xfa04('0x42')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db[_0xfa04('0x42')][_0xfa04('0x11f')](db['MailInteraction'],{});db[_0xfa04('0x42')][_0xfa04('0x11f')](db[_0xfa04('0x3e')],{});db[_0xfa04('0x42')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{});db[_0xfa04('0x42')][_0xfa04('0x11f')](db['MailQueue'],{});db[_0xfa04('0x43')][_0xfa04('0x116')](db[_0xfa04('0x180')],{'as':'Items','onDelete':_0xfa04('0x110')});db[_0xfa04('0x46')][_0xfa04('0x116')](db[_0xfa04('0x168')],{'as':_0xfa04('0x169'),'foreignKey':_0xfa04('0x181'),'onDelete':'cascade'});db[_0xfa04('0x46')]['hasMany'](db[_0xfa04('0x7f')],{'as':_0xfa04('0x16a'),'foreignKey':'FaxAccountId'});db[_0xfa04('0x46')][_0xfa04('0x116')](db[_0xfa04('0x4a')],{'as':_0xfa04('0x16b')});db[_0xfa04('0x46')][_0xfa04('0x116')](db[_0xfa04('0x48')],{'as':_0xfa04('0x145')});db[_0xfa04('0x46')][_0xfa04('0x116')](db['VoiceExtension'],{'as':_0xfa04('0x182'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x46')]['hasMany'](db['FaxMessage'],{'as':_0xfa04('0x159')});db[_0xfa04('0x46')][_0xfa04('0x11f')](db[_0xfa04('0x25')],{'as':_0xfa04('0x25')});db[_0xfa04('0x46')]['belongsTo'](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':_0xfa04('0x16d')});db['FaxAccount']['belongsTo'](db[_0xfa04('0x85')],{'as':_0xfa04('0x16f'),'foreignKey':_0xfa04('0x170')});db[_0xfa04('0x46')]['belongsToMany'](db['User'],{'as':_0xfa04('0x154'),'through':_0xfa04('0x13c')});db[_0xfa04('0x48')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'onDelete':_0xfa04('0x163')});db[_0xfa04('0x48')][_0xfa04('0x11f')](db[_0xfa04('0x4e')],{'onDelete':_0xfa04('0x163')});db[_0xfa04('0x48')][_0xfa04('0x11f')](db[_0xfa04('0x46')],{'onDelete':_0xfa04('0x163')});db['FaxApplication'][_0xfa04('0x11f')](db[_0xfa04('0x176')],{'onDelete':_0xfa04('0x163'),'foreignKey':_0xfa04('0x17f')});db[_0xfa04('0x4a')][_0xfa04('0x116')](db[_0xfa04('0x4c')],{'as':_0xfa04('0x159'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x183')});db[_0xfa04('0x4a')][_0xfa04('0x11f')](db['FaxAccount'],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x181')});db[_0xfa04('0x4a')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db[_0xfa04('0x4a')]['belongsTo'](db[_0xfa04('0xf')],{'as':_0xfa04('0x174'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0x4a')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x184'),'as':_0xfa04('0x175')});db['FaxInteraction'][_0xfa04('0x121')](db['Tag'],{'through':_0xfa04('0x184'),'as':_0xfa04('0x178')});db[_0xfa04('0x4a')][_0xfa04('0x121')](db['User'],{'as':_0xfa04('0x179'),'through':_0xfa04('0x185'),'foreignKey':_0xfa04('0x183')});db[_0xfa04('0x4c')]['belongsTo'](db[_0xfa04('0xf')],{'onDelete':'cascade','as':_0xfa04('0xf')});db[_0xfa04('0x4c')][_0xfa04('0x11f')](db[_0xfa04('0x4a')],{'as':_0xfa04('0x17b'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0x15f')});db[_0xfa04('0x4c')]['belongsTo'](db[_0xfa04('0xea')],{'as':_0xfa04('0xea'),'foreignKey':_0xfa04('0x186')});db[_0xfa04('0x4c')][_0xfa04('0x11f')](db[_0xfa04('0x46')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x181')});db[_0xfa04('0x4e')]['belongsToMany'](db[_0xfa04('0xf')],{'as':_0xfa04('0x154'),'through':'UserFaxQueue'});db[_0xfa04('0x4e')][_0xfa04('0x121')](db[_0xfa04('0x127')],{'through':'team_has_fax_queues','as':'Teams'});db[_0xfa04('0x187')][_0xfa04('0x11f')](db[_0xfa04('0x46')],{});db[_0xfa04('0x187')]['belongsTo'](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':_0xfa04('0x16d')});db[_0xfa04('0x187')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':'Contact','foreignKey':'ContactId'});db[_0xfa04('0x187')][_0xfa04('0x11f')](db[_0xfa04('0x4a')],{});db['FaxQueueReport'][_0xfa04('0x11f')](db[_0xfa04('0x4c')],{});db[_0xfa04('0x187')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{});db[_0xfa04('0x187')]['belongsTo'](db['FaxQueue'],{});db[_0xfa04('0x50')]['hasMany'](db[_0xfa04('0x168')],{'as':_0xfa04('0x169'),'foreignKey':_0xfa04('0x188'),'onDelete':'cascade'});db[_0xfa04('0x50')][_0xfa04('0x116')](db[_0xfa04('0x7f')],{'as':_0xfa04('0x16a'),'foreignKey':'SmsAccountId'});db[_0xfa04('0x50')]['hasMany'](db[_0xfa04('0x55')],{'as':_0xfa04('0x159'),'foreignKey':'SmsAccountId'});db[_0xfa04('0x50')][_0xfa04('0x116')](db['SmsInteraction'],{'as':_0xfa04('0x16b')});db[_0xfa04('0x50')][_0xfa04('0x116')](db[_0xfa04('0x52')],{'as':_0xfa04('0x145')});db[_0xfa04('0x50')][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':_0xfa04('0x16d')});db[_0xfa04('0x50')][_0xfa04('0x11f')](db[_0xfa04('0x85')],{'as':_0xfa04('0x16f'),'foreignKey':_0xfa04('0x170')});db[_0xfa04('0x50')]['belongsToMany'](db[_0xfa04('0xf')],{'as':'Agents','through':_0xfa04('0x13f')});db[_0xfa04('0x52')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'onDelete':_0xfa04('0x163')});db['SmsApplication'][_0xfa04('0x11f')](db[_0xfa04('0x57')],{'onDelete':'restrict'});db[_0xfa04('0x52')][_0xfa04('0x11f')](db['SmsAccount'],{'onDelete':_0xfa04('0x163')});db[_0xfa04('0x52')][_0xfa04('0x11f')](db['Interval'],{'onDelete':_0xfa04('0x163'),'foreignKey':_0xfa04('0x17e')});db['SmsApplication']['belongsTo'](db[_0xfa04('0x176')],{'onDelete':_0xfa04('0x163'),'foreignKey':_0xfa04('0x17f')});db['SmsInteraction'][_0xfa04('0x116')](db[_0xfa04('0x55')],{'as':'Messages','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x189')});db[_0xfa04('0x54')][_0xfa04('0x11f')](db[_0xfa04('0x50')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x188')});db[_0xfa04('0x54')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db[_0xfa04('0x54')][_0xfa04('0x11f')](db['User'],{'as':_0xfa04('0x174'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0x54')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x18a'),'as':'Tags'});db['SmsInteraction']['belongsToMany'](db[_0xfa04('0x176')],{'through':'sms_interaction_has_tags','as':_0xfa04('0x178')});db[_0xfa04('0x54')][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':_0xfa04('0x179'),'through':_0xfa04('0x12d'),'foreignKey':_0xfa04('0x189')});db[_0xfa04('0x55')]['belongsTo'](db[_0xfa04('0xf')],{'as':_0xfa04('0xf')});db['SmsMessage']['belongsTo'](db[_0xfa04('0x6f')],{'onDelete':'cascade','as':_0xfa04('0x15f')});db[_0xfa04('0x55')][_0xfa04('0x11f')](db[_0xfa04('0x54')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0x17b'),'foreignKey':_0xfa04('0x189')});db[_0xfa04('0x55')]['belongsTo'](db[_0xfa04('0x50')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x188')});db[_0xfa04('0x57')][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':_0xfa04('0x154'),'through':_0xfa04('0x32'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0xfa04('0x121')](db['Team'],{'through':'team_has_sms_queues','as':_0xfa04('0x155')});db[_0xfa04('0x59')][_0xfa04('0x116')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfa04('0x18b'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x59')][_0xfa04('0x116')](db[_0xfa04('0x7f')],{'as':_0xfa04('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xfa04('0x116')](db[_0xfa04('0x5d')],{'as':_0xfa04('0x16b'),'foreignKey':_0xfa04('0x18b')});db[_0xfa04('0x59')][_0xfa04('0x116')](db[_0xfa04('0x5e')],{'as':_0xfa04('0x159'),'foreignKey':_0xfa04('0x18b')});db['OpenchannelAccount'][_0xfa04('0x116')](db[_0xfa04('0x5b')],{'as':_0xfa04('0x145'),'foreignKey':_0xfa04('0x18b')});db['OpenchannelAccount'][_0xfa04('0x11f')](db['CmList'],{'as':_0xfa04('0x16c'),'foreignKey':'ListId'});db[_0xfa04('0x59')][_0xfa04('0x11f')](db['Pause'],{'as':_0xfa04('0x16f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xfa04('0x59')]['belongsToMany'](db[_0xfa04('0xf')],{'as':'Agents','through':_0xfa04('0x18c')});db[_0xfa04('0x5b')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'onDelete':'restrict'});db[_0xfa04('0x5b')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xfa04('0x163'),'foreignKey':'OpenchannelQueueId'});db[_0xfa04('0x5b')]['belongsTo'](db[_0xfa04('0x59')],{'onDelete':_0xfa04('0x163'),'foreignKey':_0xfa04('0x18b')});db['OpenchannelApplication'][_0xfa04('0x11f')](db[_0xfa04('0x84')],{'onDelete':_0xfa04('0x163'),'foreignKey':_0xfa04('0x17e')});db[_0xfa04('0x5b')][_0xfa04('0x11f')](db[_0xfa04('0x176')],{'onDelete':'restrict','foreignKey':_0xfa04('0x17f')});db[_0xfa04('0x5d')][_0xfa04('0x116')](db[_0xfa04('0x5e')],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction'][_0xfa04('0x11f')](db[_0xfa04('0x59')],{'as':_0xfa04('0x173'),'foreignKey':'OpenchannelAccountId'});db[_0xfa04('0x5d')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db['OpenchannelInteraction'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'as':_0xfa04('0x174'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0x5d')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':'openchannel_interaction_has_tags','as':_0xfa04('0x175')});db['OpenchannelInteraction']['belongsToMany'](db[_0xfa04('0x176')],{'through':_0xfa04('0x18d'),'as':_0xfa04('0x178')});db[_0xfa04('0x5d')]['belongsToMany'](db[_0xfa04('0xf')],{'as':_0xfa04('0x179'),'through':_0xfa04('0x12e'),'foreignKey':_0xfa04('0x18e')});db[_0xfa04('0x5e')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0xf')});db[_0xfa04('0x5e')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0x15f')});db[_0xfa04('0x5e')][_0xfa04('0x11f')](db['OpenchannelInteraction'],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0x17b'),'foreignKey':_0xfa04('0x18e')});db['OpenchannelMessage'][_0xfa04('0x11f')](db[_0xfa04('0xea')],{'as':_0xfa04('0xea'),'foreignKey':_0xfa04('0x186')});db[_0xfa04('0x5e')][_0xfa04('0x11f')](db[_0xfa04('0x59')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x18b')});db[_0xfa04('0x135')][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':'Agents','through':_0xfa04('0x137'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0xfa04('0x121')](db['Team'],{'through':_0xfa04('0x18f'),'as':_0xfa04('0x155')});db[_0xfa04('0x60')][_0xfa04('0x116')](db[_0xfa04('0x168')],{'as':'Dispositions','foreignKey':_0xfa04('0x17c'),'onDelete':'cascade'});db[_0xfa04('0x60')]['hasMany'](db[_0xfa04('0x7f')],{'as':_0xfa04('0x16a'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite']['hasMany'](db[_0xfa04('0x6b')],{'as':_0xfa04('0x190')});db['ChatWebsite'][_0xfa04('0x116')](db['ChatInteraction'],{'as':_0xfa04('0x16b')});db['ChatWebsite'][_0xfa04('0x116')](db[_0xfa04('0x61')],{'as':_0xfa04('0x145')});db[_0xfa04('0x60')]['hasMany'](db[_0xfa04('0x65')],{'as':_0xfa04('0x159')});db[_0xfa04('0x60')][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':_0xfa04('0x16d')});db['ChatWebsite'][_0xfa04('0x11f')](db[_0xfa04('0x84')],{'as':'Interval','foreignKey':_0xfa04('0x17e')});db['ChatWebsite'][_0xfa04('0x11f')](db[_0xfa04('0x39')],{'as':_0xfa04('0x39'),'foreignKey':_0xfa04('0x161')});db[_0xfa04('0x60')]['belongsTo'](db['Pause'],{'as':_0xfa04('0x16f'),'foreignKey':_0xfa04('0x170')});db[_0xfa04('0x60')]['belongsToMany'](db[_0xfa04('0xf')],{'as':'Agents','through':'user_has_chat_websites'});db[_0xfa04('0x191')][_0xfa04('0x11f')](db[_0xfa04('0x59')],{});db[_0xfa04('0x191')][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':'List','foreignKey':_0xfa04('0x16d')});db['OpenchannelQueueReport']['belongsTo'](db['CmContact'],{'as':_0xfa04('0x15f'),'foreignKey':'ContactId'});db[_0xfa04('0x191')][_0xfa04('0x11f')](db[_0xfa04('0x5d')],{});db[_0xfa04('0x191')]['belongsTo'](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{});db[_0xfa04('0x191')][_0xfa04('0x11f')](db[_0xfa04('0x135')],{});db['ChatApplication'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'as':_0xfa04('0x192'),'foreignKey':'UserId','onDelete':_0xfa04('0x163')});db[_0xfa04('0x61')][_0xfa04('0x11f')](db[_0xfa04('0x68')],{'as':'Queue','foreignKey':_0xfa04('0x193'),'onDelete':'restrict'});db['ChatApplication'][_0xfa04('0x11f')](db[_0xfa04('0x60')],{'as':_0xfa04('0x194'),'foreignKey':_0xfa04('0x17c'),'onDelete':_0xfa04('0x163')});db[_0xfa04('0x61')][_0xfa04('0x11f')](db['Tag'],{'onDelete':_0xfa04('0x163'),'foreignKey':_0xfa04('0x17f')});db[_0xfa04('0x63')][_0xfa04('0x116')](db[_0xfa04('0x65')],{'as':_0xfa04('0x159'),'onDelete':_0xfa04('0x110'),'foreignKey':'ChatInteractionId'});db[_0xfa04('0x63')][_0xfa04('0x11f')](db['ChatWebsite'],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x17c')});db['ChatInteraction'][_0xfa04('0x11f')](db['CmContact'],{'as':_0xfa04('0x15f'),'foreignKey':'ContactId'});db[_0xfa04('0x63')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'as':_0xfa04('0x174'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0x63')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x195'),'as':_0xfa04('0x175')});db[_0xfa04('0x63')]['belongsToMany'](db[_0xfa04('0x176')],{'through':_0xfa04('0x195'),'as':'ThroughTags'});db['ChatInteraction'][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':_0xfa04('0x179'),'through':'user_has_chat_interactions','foreignKey':_0xfa04('0x196')});db[_0xfa04('0x65')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0xf')});db['ChatMessage'][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'onDelete':'cascade','as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db['ChatMessage'][_0xfa04('0x11f')](db[_0xfa04('0x63')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0x17b'),'foreignKey':_0xfa04('0x196')});db['ChatMessage']['belongsTo'](db[_0xfa04('0xea')],{'as':_0xfa04('0xea'),'foreignKey':_0xfa04('0x186')});db['ChatMessage'][_0xfa04('0x11f')](db[_0xfa04('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xfa04('0x67')][_0xfa04('0x116')](db[_0xfa04('0xea')],{'as':_0xfa04('0x17a'),'foreignKey':_0xfa04('0x17d'),'onDelete':_0xfa04('0x110'),'hooks':!![]});db[_0xfa04('0x67')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db[_0xfa04('0x67')]['belongsTo'](db['ChatWebsite'],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x17c')});db[_0xfa04('0x68')][_0xfa04('0x121')](db['User'],{'as':_0xfa04('0x154'),'through':'UserChatQueue','hooks':!![]});db[_0xfa04('0x68')][_0xfa04('0x121')](db[_0xfa04('0x127')],{'through':_0xfa04('0x197'),'as':'Teams'});db[_0xfa04('0x69')][_0xfa04('0x116')](db[_0xfa04('0xd3')],{'as':_0xfa04('0x159'),'foreignKey':_0xfa04('0x198'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x69')]['belongsToMany'](db[_0xfa04('0xf')],{'as':'Members','through':'chat_group_has_users'});db[_0xfa04('0x6b')][_0xfa04('0x11f')](db[_0xfa04('0x60')],{'as':_0xfa04('0x194'),'foreignKey':_0xfa04('0x17c')});db[_0xfa04('0x6d')][_0xfa04('0x116')](db['CmContact'],{'as':_0xfa04('0x199'),'foreignKey':_0xfa04('0x19a')});db[_0xfa04('0x6f')][_0xfa04('0x116')](db[_0xfa04('0x90')],{'as':_0xfa04('0x19b'),'foreignKey':_0xfa04('0x19c')});db['CmContact'][_0xfa04('0x116')](db[_0xfa04('0x71')],{'as':_0xfa04('0x19d'),'foreignKey':'ContactId'});db[_0xfa04('0x6f')][_0xfa04('0x116')](db['CmHopperFinal'],{'as':_0xfa04('0x14c'),'foreignKey':_0xfa04('0x160')});db[_0xfa04('0x6f')][_0xfa04('0x116')](db[_0xfa04('0x117')],{'as':'HopperHistories','foreignKey':_0xfa04('0x160')});db[_0xfa04('0x6f')][_0xfa04('0x116')](db[_0xfa04('0x77')],{'as':'ReportAgentPreview','foreignKey':_0xfa04('0x160')});db[_0xfa04('0x6f')][_0xfa04('0x116')](db[_0xfa04('0xd7')],{'as':_0xfa04('0x14f'),'foreignKey':_0xfa04('0x160')});db['CmContact']['hasMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xfa04('0x160'),'onDelete':_0xfa04('0x163')});db[_0xfa04('0x6f')][_0xfa04('0x116')](db['ChatInteraction'],{'as':_0xfa04('0x11a'),'foreignKey':_0xfa04('0x160'),'onDelete':'restrict'});db[_0xfa04('0x6f')][_0xfa04('0x116')](db[_0xfa04('0x54')],{'as':_0xfa04('0x19e'),'foreignKey':_0xfa04('0x160'),'onDelete':'restrict'});db[_0xfa04('0x6f')]['hasMany'](db[_0xfa04('0x4a')],{'as':_0xfa04('0x12c'),'foreignKey':_0xfa04('0x160'),'onDelete':'restrict'});db['CmContact']['hasMany'](db[_0xfa04('0x3c')],{'as':'MailInteractions','foreignKey':_0xfa04('0x160'),'onDelete':'restrict'});db[_0xfa04('0x6f')]['belongsTo'](db[_0xfa04('0x6d')],{'as':'Company','foreignKey':'CompanyId'});db[_0xfa04('0x6f')]['belongsTo'](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':_0xfa04('0x16d'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x6f')][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':_0xfa04('0x179'),'through':_0xfa04('0x124')});db[_0xfa04('0x6f')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xfa04('0x6f')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':'cm_contact_has_tags','as':_0xfa04('0x178')});db[_0xfa04('0x71')]['hasMany'](db[_0xfa04('0x92')],{'as':_0xfa04('0x19f'),'foreignKey':_0xfa04('0x1a0')});db[_0xfa04('0x71')]['belongsTo'](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':'ContactId','onDelete':_0xfa04('0x110')});db['CmHopper'][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':'List','foreignKey':_0xfa04('0x16d'),'onDelete':_0xfa04('0x110')});db['CmHopper'][_0xfa04('0x11f')](db['User'],{'as':_0xfa04('0x192'),'foreignKey':_0xfa04('0x112')});db['CmHopper'][_0xfa04('0x11f')](db[_0xfa04('0x15')],{'as':_0xfa04('0x1a1'),'foreignKey':_0xfa04('0x14b'),'onDelete':_0xfa04('0x110')});db['CmHopper'][_0xfa04('0x11f')](db[_0xfa04('0xe7')],{'as':'Campaign','foreignKey':_0xfa04('0x1a2'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x71')][_0xfa04('0x11f')](db['User'],{'as':'Owner','foreignKey':'OwnerId'});db[_0xfa04('0x73')][_0xfa04('0x11f')](db['CmContact'],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x73')][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':_0xfa04('0x16d'),'onDelete':'cascade'});db[_0xfa04('0x73')][_0xfa04('0x11f')](db[_0xfa04('0x15')],{'as':_0xfa04('0x1a1'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xfa04('0x73')][_0xfa04('0x11f')](db[_0xfa04('0xe7')],{'as':'Campaign','foreignKey':_0xfa04('0x1a2'),'onDelete':_0xfa04('0x110')});db['Automation'][_0xfa04('0x116')](db['Condition'],{'as':{'plural':_0xfa04('0x1a3'),'singular':_0xfa04('0x1a4')},'foreignKey':_0xfa04('0x1a5'),'onDelete':_0xfa04('0x110'),'hooks':!![]});db[_0xfa04('0x7d')][_0xfa04('0x116')](db[_0xfa04('0x82')],{'as':{'plural':_0xfa04('0x1a6'),'singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db[_0xfa04('0x7d')]['hasMany'](db[_0xfa04('0x7b')],{'as':_0xfa04('0x1a7'),'foreignKey':_0xfa04('0x1a8'),'onDelete':_0xfa04('0x110'),'hooks':!![]});db[_0xfa04('0x168')][_0xfa04('0x116')](db[_0xfa04('0x168')],{'as':_0xfa04('0x169'),'foreignKey':_0xfa04('0x1a9'),'onDelete':_0xfa04('0x110')});db['Interval']['hasMany'](db['Interval'],{'as':_0xfa04('0x1aa'),'foreignKey':_0xfa04('0x17e'),'onDelete':_0xfa04('0x110'),'hooks':!![],'required':![]});db[_0xfa04('0x84')]['hasMany'](db['VoiceExtension'],{'as':_0xfa04('0x1ab'),'foreignKey':_0xfa04('0x17e'),'onDelete':_0xfa04('0x163')});db[_0xfa04('0x84')][_0xfa04('0x116')](db[_0xfa04('0x40')],{'as':_0xfa04('0x1ac'),'foreignKey':_0xfa04('0x17e')});db['Interval'][_0xfa04('0x116')](db[_0xfa04('0x61')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0xfa04('0x84')][_0xfa04('0x116')](db[_0xfa04('0x48')],{'as':_0xfa04('0x1ad'),'foreignKey':_0xfa04('0x17e')});db[_0xfa04('0x84')][_0xfa04('0x116')](db[_0xfa04('0x52')],{'as':_0xfa04('0x1ae'),'foreignKey':'IntervalId'});db['Schedule'][_0xfa04('0x11f')](db[_0xfa04('0x39')],{});db[_0xfa04('0x8b')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xfa04('0x8b')]['belongsTo'](db[_0xfa04('0x9c')],{'foreignKey':_0xfa04('0x1af')});db[_0xfa04('0x147')][_0xfa04('0x121')](db[_0xfa04('0x146')],{'as':_0xfa04('0x1b0'),'through':'moh_has_sounds','onDelete':'restrict'});db[_0xfa04('0x176')]['belongsToMany'](db[_0xfa04('0x6f')],{'through':_0xfa04('0x1b1')});db['Tag'][_0xfa04('0x121')](db[_0xfa04('0x63')],{'through':_0xfa04('0x195')});db[_0xfa04('0x176')]['belongsToMany'](db[_0xfa04('0x3c')],{'through':_0xfa04('0x177')});db[_0xfa04('0x176')][_0xfa04('0x121')](db[_0xfa04('0x54')],{'through':_0xfa04('0x18a')});db[_0xfa04('0x176')][_0xfa04('0x121')](db[_0xfa04('0x4a')],{'through':_0xfa04('0x184')});db[_0xfa04('0x176')][_0xfa04('0x121')](db[_0xfa04('0x5d')],{'through':'openchannel_interaction_has_tags'});db[_0xfa04('0x176')][_0xfa04('0x121')](db[_0xfa04('0xfe')],{'through':_0xfa04('0x1b2')});db[_0xfa04('0x90')][_0xfa04('0x11f')](db[_0xfa04('0x1b3')],{'as':'ItemType','foreignKey':_0xfa04('0x1b4')});db[_0xfa04('0x92')][_0xfa04('0x11f')](db[_0xfa04('0x71')],{'as':_0xfa04('0x1b5'),'foreignKey':'CmHopperId'});db[_0xfa04('0x90')]['belongsTo'](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x19c')});db[_0xfa04('0x96')][_0xfa04('0x116')](db['Condition'],{'as':{'plural':_0xfa04('0x1b6'),'singular':_0xfa04('0x1b7')},'foreignKey':_0xfa04('0x1b8'),'onDelete':_0xfa04('0x110'),'hooks':!![]});db[_0xfa04('0x96')][_0xfa04('0x116')](db[_0xfa04('0x82')],{'as':{'plural':_0xfa04('0x1b9'),'singular':'AnyCondition'},'foreignKey':_0xfa04('0x1ba'),'onDelete':_0xfa04('0x110'),'hooks':!![]});db[_0xfa04('0x96')][_0xfa04('0x116')](db[_0xfa04('0x7b')],{'as':_0xfa04('0x1a7'),'foreignKey':_0xfa04('0x1bb'),'onDelete':_0xfa04('0x110'),'hooks':!![]});db[_0xfa04('0x9c')][_0xfa04('0x116')](db[_0xfa04('0x9f')],{'as':_0xfa04('0x1bc'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0xfa04('0x116')](db[_0xfa04('0x9f')],{'as':_0xfa04('0x1bc'),'onDelete':_0xfa04('0x110'),'foreignKey':'DefaultReportId'});db[_0xfa04('0x1bd')][_0xfa04('0x116')](db['AnalyticFieldReport'],{'as':_0xfa04('0x1bc'),'onDelete':'cascade','foreignKey':_0xfa04('0x1be')});db[_0xfa04('0x9f')][_0xfa04('0x11f')](db[_0xfa04('0x1bd')],{'foreignKey':_0xfa04('0x1be')});db['SalesforceAccount']['hasMany'](db[_0xfa04('0x1bf')],{'as':_0xfa04('0x1c0'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c1')});db['SalesforceConfiguration']['hasMany'](db['SalesforceField'],{'as':_0xfa04('0x1c2'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0x1bf')][_0xfa04('0x116')](db[_0xfa04('0xa5')],{'as':'Descriptions','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c4')});db[_0xfa04('0x1bf')][_0xfa04('0x116')](db['SalesforceField'],{'as':'Fields','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0x1bf')][_0xfa04('0x11f')](db['SalesforceAccount'],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xa5')][_0xfa04('0x116')](db[_0xfa04('0xa5')],{'as':_0xfa04('0x1c6'),'foreignKey':'SubjectId'});db['SalesforceField'][_0xfa04('0x116')](db[_0xfa04('0xa5')],{'as':_0xfa04('0x1c7'),'foreignKey':_0xfa04('0x1c4')});db[_0xfa04('0xa5')][_0xfa04('0x116')](db[_0xfa04('0xa5')],{'as':'Field','foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0xa5')]['belongsTo'](db[_0xfa04('0x1c8')],{'as':_0xfa04('0x1c8'),'foreignKey':_0xfa04('0x1c9')});db[_0xfa04('0xa7')][_0xfa04('0x116')](db['SugarcrmConfiguration'],{'as':_0xfa04('0x1c0'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xa9')][_0xfa04('0x116')](db[_0xfa04('0xab')],{'as':'Subjects','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c3')});db['SugarcrmConfiguration'][_0xfa04('0x116')](db[_0xfa04('0xab')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xfa04('0x1c4')});db['SugarcrmConfiguration'][_0xfa04('0x116')](db['SugarcrmField'],{'as':'Fields','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0xa9')][_0xfa04('0x11f')](db['SugarcrmAccount'],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xab')][_0xfa04('0x116')](db[_0xfa04('0xab')],{'as':'Subject','foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0xab')][_0xfa04('0x116')](db[_0xfa04('0xab')],{'as':_0xfa04('0x1c7'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0xfa04('0x116')](db[_0xfa04('0xab')],{'as':_0xfa04('0x1ca'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0xab')][_0xfa04('0x11f')](db[_0xfa04('0x1c8')],{'as':_0xfa04('0x1c8'),'foreignKey':_0xfa04('0x1c9')});db[_0xfa04('0x1cb')][_0xfa04('0x116')](db[_0xfa04('0xae')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xae')][_0xfa04('0x116')](db[_0xfa04('0x1cc')],{'as':_0xfa04('0x1c2'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0xae')][_0xfa04('0x116')](db[_0xfa04('0x1cc')],{'as':_0xfa04('0x1cd'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c4')});db[_0xfa04('0xae')]['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0xae')][_0xfa04('0x11f')](db[_0xfa04('0x1cb')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xae')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x1ce')});db[_0xfa04('0x1cc')][_0xfa04('0x116')](db[_0xfa04('0x1cc')],{'as':_0xfa04('0x1c6'),'foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0x1cc')][_0xfa04('0x116')](db[_0xfa04('0x1cc')],{'as':_0xfa04('0x1c7'),'foreignKey':_0xfa04('0x1c4')});db[_0xfa04('0x1cc')][_0xfa04('0x116')](db[_0xfa04('0x1cc')],{'as':'Field','foreignKey':_0xfa04('0x1c5')});db['DeskField'][_0xfa04('0x11f')](db[_0xfa04('0x1c8')],{'as':'Variable','foreignKey':'VariableId'});db[_0xfa04('0xb0')][_0xfa04('0x116')](db[_0xfa04('0x1cf')],{'as':_0xfa04('0x1c0'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c1')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':'Subjects','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0x1cf')][_0xfa04('0x116')](db[_0xfa04('0xb3')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa04('0x1cf')][_0xfa04('0x116')](db[_0xfa04('0xb3')],{'as':'Fields','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0x1cf')][_0xfa04('0x11f')](db['ZohoAccount'],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xb3')][_0xfa04('0x116')](db[_0xfa04('0xb3')],{'as':'Subject','foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0xb3')]['hasMany'](db[_0xfa04('0xb3')],{'as':_0xfa04('0x1c7'),'foreignKey':_0xfa04('0x1c4')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xfa04('0x1ca'),'foreignKey':_0xfa04('0x1c5')});db['ZohoField'][_0xfa04('0x11f')](db[_0xfa04('0x1c8')],{'as':'Variable','foreignKey':_0xfa04('0x1c9')});db[_0xfa04('0xb5')][_0xfa04('0x116')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xb7')][_0xfa04('0x116')](db[_0xfa04('0x1d0')],{'as':_0xfa04('0x1c2'),'foreignKey':_0xfa04('0x1c3')});db['ZendeskConfiguration']['hasMany'](db[_0xfa04('0x1d0')],{'as':'Descriptions','foreignKey':_0xfa04('0x1c4')});db[_0xfa04('0xb7')]['hasMany'](db[_0xfa04('0x1d0')],{'as':_0xfa04('0x1bc'),'foreignKey':_0xfa04('0x1c5')});db['ZendeskConfiguration'][_0xfa04('0x11f')](db['ZendeskAccount'],{'as':_0xfa04('0x173'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x1d1')});db[_0xfa04('0x1d0')][_0xfa04('0x116')](db[_0xfa04('0x1d0')],{'as':'Subject','foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0x1d0')]['hasMany'](db['ZendeskField'],{'as':_0xfa04('0x1c7'),'foreignKey':_0xfa04('0x1c4')});db[_0xfa04('0x1d0')][_0xfa04('0x116')](db[_0xfa04('0x1d0')],{'as':'Field','foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0x1d0')]['belongsTo'](db[_0xfa04('0x1c8')],{'as':_0xfa04('0x1c8'),'foreignKey':_0xfa04('0x1c9')});db[_0xfa04('0x1d2')][_0xfa04('0x116')](db[_0xfa04('0xba')],{'as':_0xfa04('0x1c0'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xba')][_0xfa04('0x116')](db['FreshdeskField'],{'as':_0xfa04('0x1c2'),'onDelete':'cascade','foreignKey':_0xfa04('0x1c3')});db['FreshdeskConfiguration'][_0xfa04('0x116')](db[_0xfa04('0xbc')],{'as':_0xfa04('0x1cd'),'onDelete':_0xfa04('0x110'),'foreignKey':'DescriptionId'});db[_0xfa04('0xba')]['hasMany'](db[_0xfa04('0xbc')],{'as':_0xfa04('0x1bc'),'onDelete':_0xfa04('0x110'),'foreignKey':'FieldId'});db[_0xfa04('0xba')][_0xfa04('0x11f')](db[_0xfa04('0x1d2')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xba')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x1d3')});db[_0xfa04('0xbc')][_0xfa04('0x116')](db['FreshdeskField'],{'as':_0xfa04('0x1c6'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xfa04('0x116')](db[_0xfa04('0xbc')],{'as':_0xfa04('0x1c7'),'foreignKey':_0xfa04('0x1c4')});db[_0xfa04('0xbc')][_0xfa04('0x116')](db[_0xfa04('0xbc')],{'as':_0xfa04('0x1ca'),'foreignKey':_0xfa04('0x1c5')});db['FreshdeskField']['belongsTo'](db[_0xfa04('0x1c8')],{'as':_0xfa04('0x1c8'),'foreignKey':'VariableId'});db['VtigerAccount']['hasMany'](db['VtigerConfiguration'],{'as':_0xfa04('0x1c0'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0x1d4')]['hasMany'](db[_0xfa04('0x1d5')],{'as':_0xfa04('0x1c2'),'foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0x1d4')][_0xfa04('0x116')](db[_0xfa04('0x1d5')],{'as':'Descriptions','foreignKey':_0xfa04('0x1c4')});db[_0xfa04('0x1d4')][_0xfa04('0x116')](db[_0xfa04('0x1d5')],{'as':_0xfa04('0x1bc'),'foreignKey':'FieldId'});db[_0xfa04('0x1d4')][_0xfa04('0x11f')](db[_0xfa04('0xbd')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0x1d5')][_0xfa04('0x116')](db[_0xfa04('0x1d5')],{'as':'Subject','foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0x1d5')][_0xfa04('0x116')](db['VtigerField'],{'as':_0xfa04('0x1c7'),'foreignKey':'DescriptionId'});db[_0xfa04('0x1d5')][_0xfa04('0x116')](db[_0xfa04('0x1d5')],{'as':_0xfa04('0x1ca'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0x1d5')][_0xfa04('0x11f')](db[_0xfa04('0x1c8')],{'as':_0xfa04('0x1c8'),'foreignKey':'VariableId'});db['ServicenowAccount'][_0xfa04('0x116')](db[_0xfa04('0xc2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xfa04('0x1c1')});db['ServicenowConfiguration'][_0xfa04('0x116')](db[_0xfa04('0xc4')],{'as':_0xfa04('0x1c2'),'foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0xc2')][_0xfa04('0x116')](db[_0xfa04('0xc4')],{'as':_0xfa04('0x1cd'),'foreignKey':'DescriptionId'});db[_0xfa04('0xc2')][_0xfa04('0x116')](db[_0xfa04('0xc4')],{'as':_0xfa04('0x1bc'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0xc2')][_0xfa04('0x11f')](db[_0xfa04('0xc1')],{'as':_0xfa04('0x173'),'foreignKey':'AccountId'});db[_0xfa04('0xc4')][_0xfa04('0x116')](db[_0xfa04('0xc4')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfa04('0xc4')][_0xfa04('0x116')](db[_0xfa04('0xc4')],{'as':_0xfa04('0x1c7'),'foreignKey':_0xfa04('0x1c4')});db['ServicenowField']['hasMany'](db[_0xfa04('0xc4')],{'as':_0xfa04('0x1ca'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0xc4')][_0xfa04('0x11f')](db[_0xfa04('0x1c8')],{'as':'Variable','foreignKey':'VariableId'});db[_0xfa04('0xc5')]['hasMany'](db['Dynamics365Configuration'],{'as':_0xfa04('0x1c0'),'onDelete':'cascade','foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xc5')][_0xfa04('0x11f')](db[_0xfa04('0x107')],{'as':_0xfa04('0x107'),'foreignKey':_0xfa04('0x162')});db[_0xfa04('0xc7')][_0xfa04('0x116')](db[_0xfa04('0xc8')],{'as':_0xfa04('0x1c2'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0xc7')][_0xfa04('0x116')](db['Dynamics365Field'],{'as':_0xfa04('0x1cd'),'onDelete':_0xfa04('0x110'),'foreignKey':'DescriptionId'});db[_0xfa04('0xc7')][_0xfa04('0x116')](db[_0xfa04('0xc8')],{'as':'Fields','onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0xc7')]['belongsTo'](db[_0xfa04('0xc5')],{'as':'Account','foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xc8')][_0xfa04('0x116')](db[_0xfa04('0xc8')],{'as':_0xfa04('0x1c6'),'foreignKey':_0xfa04('0x1c3')});db[_0xfa04('0xc8')][_0xfa04('0x116')](db[_0xfa04('0xc8')],{'as':_0xfa04('0x1c7'),'foreignKey':'DescriptionId'});db[_0xfa04('0xc8')][_0xfa04('0x116')](db[_0xfa04('0xc8')],{'as':'Field','foreignKey':'FieldId'});db['Dynamics365Field']['belongsTo'](db[_0xfa04('0x1c8')],{'as':_0xfa04('0x1c8'),'foreignKey':_0xfa04('0x1c9')});db['FreshsalesAccount']['hasMany'](db['FreshsalesConfiguration'],{'as':_0xfa04('0x1c0'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xcc')][_0xfa04('0x116')](db[_0xfa04('0xce')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xfa04('0xcc')]['hasMany'](db[_0xfa04('0xce')],{'as':_0xfa04('0x1cd'),'foreignKey':'DescriptionId'});db[_0xfa04('0xcc')][_0xfa04('0x116')](db[_0xfa04('0xce')],{'as':'Fields','foreignKey':'FieldId'});db[_0xfa04('0xcc')][_0xfa04('0x11f')](db[_0xfa04('0xca')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1c1')});db[_0xfa04('0xce')][_0xfa04('0x116')](db['FreshsalesField'],{'as':_0xfa04('0x1c6'),'foreignKey':_0xfa04('0x1c3')});db['FreshsalesField'][_0xfa04('0x116')](db['FreshsalesField'],{'as':_0xfa04('0x1c7'),'foreignKey':_0xfa04('0x1c4')});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0xfa04('0x1ca'),'foreignKey':_0xfa04('0x1c5')});db[_0xfa04('0xce')][_0xfa04('0x11f')](db['Variable'],{'as':_0xfa04('0x1c8'),'foreignKey':_0xfa04('0x1c9')});db['ChatQueueReport'][_0xfa04('0x11f')](db[_0xfa04('0x60')],{});db[_0xfa04('0xd1')]['belongsTo'](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':'ListId'});db[_0xfa04('0xd1')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':'Contact','foreignKey':_0xfa04('0x160')});db[_0xfa04('0xd1')][_0xfa04('0x11f')](db['ChatInteraction'],{});db[_0xfa04('0xd1')][_0xfa04('0x11f')](db['ChatMessage'],{});db[_0xfa04('0xd1')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{});db[_0xfa04('0xd1')]['belongsTo'](db[_0xfa04('0x68')],{});db['ChatInternalMessage'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x1d6')});db[_0xfa04('0xd3')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'onDelete':_0xfa04('0x110'),'foreignKey':'ToId'});db[_0xfa04('0xd7')][_0xfa04('0x116')](db[_0xfa04('0xd6')],{'foreignKey':_0xfa04('0x1d7'),'onDelete':'cascade'});db[_0xfa04('0xd7')][_0xfa04('0x116')](db[_0xfa04('0xd4')],{'foreignKey':_0xfa04('0x1d7'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0xd9')][_0xfa04('0x11f')](db['SmsAccount'],{});db[_0xfa04('0xd9')][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':'List','foreignKey':_0xfa04('0x16d')});db[_0xfa04('0xd9')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db[_0xfa04('0xd9')][_0xfa04('0x11f')](db[_0xfa04('0x54')],{});db[_0xfa04('0xd9')]['belongsTo'](db[_0xfa04('0x55')],{});db[_0xfa04('0xd9')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{});db[_0xfa04('0xd9')][_0xfa04('0x11f')](db[_0xfa04('0x57')],{});db[_0xfa04('0x1d8')][_0xfa04('0x116')](db[_0xfa04('0xd7')],{'foreignKey':'ProjectId'});db[_0xfa04('0x1d8')][_0xfa04('0x116')](db[_0xfa04('0xd6')],{'foreignKey':_0xfa04('0x1d9')});db[_0xfa04('0x1d8')][_0xfa04('0x116')](db[_0xfa04('0xd4')],{'foreignKey':_0xfa04('0x1d9')});db['Team'][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':'Agents','through':_0xfa04('0x128')});db[_0xfa04('0x127')][_0xfa04('0x121')](db['VoiceQueue'],{'through':_0xfa04('0x109'),'as':_0xfa04('0x1da')});db['Team'][_0xfa04('0x121')](db['MailQueue'],{'through':_0xfa04('0x1db'),'as':_0xfa04('0x132')});db[_0xfa04('0x127')][_0xfa04('0x121')](db['ChatQueue'],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xfa04('0x127')][_0xfa04('0x121')](db[_0xfa04('0x4e')],{'through':_0xfa04('0x1dc'),'as':_0xfa04('0x134')});db[_0xfa04('0x127')][_0xfa04('0x121')](db[_0xfa04('0x57')],{'through':_0xfa04('0x1dd'),'as':_0xfa04('0x1de')});db[_0xfa04('0x127')][_0xfa04('0x121')](db[_0xfa04('0x135')],{'through':_0xfa04('0x18f'),'as':'OpenchannelQueues'});db['Team'][_0xfa04('0x121')](db[_0xfa04('0x105')],{'through':_0xfa04('0x1df'),'as':_0xfa04('0x138')});db[_0xfa04('0x127')][_0xfa04('0x121')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0xfa04('0x131')});db[_0xfa04('0xe7')][_0xfa04('0x116')](db[_0xfa04('0x71')],{'as':'Hoppers','foreignKey':_0xfa04('0x1a2')});db[_0xfa04('0xe7')][_0xfa04('0x116')](db[_0xfa04('0x75')],{'as':_0xfa04('0x14c'),'foreignKey':_0xfa04('0x1a2')});db['Campaign'][_0xfa04('0x116')](db[_0xfa04('0x117')],{'as':_0xfa04('0x14d'),'foreignKey':_0xfa04('0x1a2')});db[_0xfa04('0xe7')]['hasMany'](db[_0xfa04('0x73')],{'as':_0xfa04('0x14e'),'foreignKey':_0xfa04('0x1a2')});db[_0xfa04('0xe7')][_0xfa04('0x11f')](db[_0xfa04('0x25')],{'as':_0xfa04('0x25'),'foreignKey':'TrunkId'});db[_0xfa04('0xe7')]['belongsTo'](db[_0xfa04('0x25')],{'as':_0xfa04('0x151'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0xfa04('0x11f')](db[_0xfa04('0x84')],{'as':'Interval','foreignKey':_0xfa04('0x17e')});db['Campaign'][_0xfa04('0x11f')](db[_0xfa04('0x1e0')],{'as':_0xfa04('0x1e0'),'foreignKey':_0xfa04('0x1e1')});db[_0xfa04('0xe7')][_0xfa04('0x121')](db[_0xfa04('0x125')],{'as':'Lists','through':_0xfa04('0x1e2')});db['Campaign'][_0xfa04('0x121')](db[_0xfa04('0x125')],{'as':'BlackLists','through':_0xfa04('0x1e3')});db['Attachment'][_0xfa04('0x11f')](db[_0xfa04('0x67')],{'as':'ChatOfflineMessage','foreignKey':_0xfa04('0x17d')});db[_0xfa04('0xed')][_0xfa04('0x11f')](db[_0xfa04('0x3e')],{});db[_0xfa04('0xed')]['belongsTo'](db[_0xfa04('0x3c')],{});db[_0xfa04('0xed')][_0xfa04('0x11f')](db[_0xfa04('0x39')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db['MailTransferReport'][_0xfa04('0x11f')](db['User'],{'foreignKey':_0xfa04('0x1e4'),'as':_0xfa04('0x1e5')});db['MailTransferReport'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e6'),'as':'ToAgent'});db[_0xfa04('0xed')][_0xfa04('0x11f')](db[_0xfa04('0x3a')],{'foreignKey':_0xfa04('0x1e7'),'as':_0xfa04('0x1e8')});db['MailTransferReport'][_0xfa04('0x11f')](db['MailAccount'],{'foreignKey':_0xfa04('0x1e9'),'as':_0xfa04('0x1ea')});db[_0xfa04('0xee')][_0xfa04('0x11f')](db[_0xfa04('0x65')],{});db[_0xfa04('0xee')]['belongsTo'](db[_0xfa04('0x63')],{});db[_0xfa04('0xee')]['belongsTo'](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0xfa04('0x1eb')});db['ChatTransferReport'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e4'),'as':'FromAgent'});db['ChatTransferReport'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e6'),'as':_0xfa04('0x1ec')});db['ChatTransferReport'][_0xfa04('0x11f')](db[_0xfa04('0x68')],{'foreignKey':_0xfa04('0x1ed'),'as':_0xfa04('0x1e8')});db[_0xfa04('0xee')]['belongsTo'](db[_0xfa04('0x60')],{'foreignKey':'ToChatWebsiteId','as':'ToAccount'});db[_0xfa04('0xf0')][_0xfa04('0x11f')](db[_0xfa04('0x4c')],{});db[_0xfa04('0xf0')]['belongsTo'](db[_0xfa04('0x4a')],{});db[_0xfa04('0xf0')][_0xfa04('0x11f')](db[_0xfa04('0x46')],{'foreignKey':_0xfa04('0x1ee'),'as':'FromAccount'});db[_0xfa04('0xf0')]['belongsTo'](db[_0xfa04('0xf')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xfa04('0xf0')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e6'),'as':_0xfa04('0x1ec')});db['FaxTransferReport'][_0xfa04('0x11f')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0xfa04('0x1e8')});db[_0xfa04('0xf0')][_0xfa04('0x11f')](db['FaxAccount'],{'foreignKey':_0xfa04('0x1ef'),'as':_0xfa04('0x1ea')});db[_0xfa04('0x1f0')]['belongsTo'](db[_0xfa04('0x5e')],{});db[_0xfa04('0x1f0')]['belongsTo'](db[_0xfa04('0x5d')],{});db[_0xfa04('0x1f0')][_0xfa04('0x11f')](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0xfa04('0x1eb')});db[_0xfa04('0x1f0')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e4'),'as':_0xfa04('0x1e5')});db['OpenchannelTransferReport']['belongsTo'](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e6'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0xfa04('0x11f')](db[_0xfa04('0x135')],{'foreignKey':_0xfa04('0x1f1'),'as':_0xfa04('0x1e8')});db[_0xfa04('0x1f0')]['belongsTo'](db[_0xfa04('0x59')],{'foreignKey':_0xfa04('0x1f2'),'as':'ToAccount'});db['SmsTransferReport'][_0xfa04('0x11f')](db[_0xfa04('0x55')],{});db[_0xfa04('0xf2')][_0xfa04('0x11f')](db[_0xfa04('0x54')],{});db[_0xfa04('0xf2')][_0xfa04('0x11f')](db[_0xfa04('0x50')],{'foreignKey':_0xfa04('0x1f3'),'as':'FromAccount'});db[_0xfa04('0xf2')]['belongsTo'](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e4'),'as':_0xfa04('0x1e5')});db['SmsTransferReport'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e6'),'as':_0xfa04('0x1ec')});db[_0xfa04('0xf2')][_0xfa04('0x11f')](db[_0xfa04('0x57')],{'foreignKey':_0xfa04('0x1f4'),'as':_0xfa04('0x1e8')});db[_0xfa04('0xf2')][_0xfa04('0x11f')](db['SmsAccount'],{'foreignKey':_0xfa04('0x1f5'),'as':_0xfa04('0x1ea')});db[_0xfa04('0x125')][_0xfa04('0x116')](db[_0xfa04('0x168')],{'as':_0xfa04('0x169'),'foreignKey':_0xfa04('0x16d'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x125')][_0xfa04('0x116')](db['CmCustomField'],{'as':_0xfa04('0x1f6'),'foreignKey':_0xfa04('0x16d')});db['CmList'][_0xfa04('0x116')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x199'),'onDelete':_0xfa04('0x110'),'foreignKey':_0xfa04('0x16d')});db[_0xfa04('0x125')][_0xfa04('0x116')](db[_0xfa04('0x75')],{'as':_0xfa04('0x14c'),'foreignKey':_0xfa04('0x16d')});db[_0xfa04('0x125')][_0xfa04('0x116')](db['CmHopperHistory'],{'as':_0xfa04('0x118'),'foreignKey':_0xfa04('0x16d')});db['CmList'][_0xfa04('0x116')](db[_0xfa04('0x77')],{'as':_0xfa04('0x77'),'foreignKey':_0xfa04('0x16d')});db['CmList']['belongsToMany'](db['VoiceQueue'],{'as':'Queues','through':_0xfa04('0x153')});db['CmList'][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':'Agents','through':_0xfa04('0x139')});db[_0xfa04('0x130')][_0xfa04('0x116')](db[_0xfa04('0x13')],{'as':_0xfa04('0x1ab'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0x130')][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':_0xfa04('0x154'),'through':_0xfa04('0x1f7')});db[_0xfa04('0x130')][_0xfa04('0x121')](db[_0xfa04('0x127')],{'through':'TeamVoicePrefix','as':'Teams'});db['UserProfile'][_0xfa04('0x116')](db['User'],{'as':'Users','foreignKey':_0xfa04('0x120')});db[_0xfa04('0xf5')]['hasMany'](db[_0xfa04('0xf7')],{'as':_0xfa04('0x1f8'),'foreignKey':_0xfa04('0x120'),'onDelete':_0xfa04('0x110')});db[_0xfa04('0xf7')]['hasMany'](db['UserProfileResource'],{'as':_0xfa04('0x1f9'),'foreignKey':'sectionId','onDelete':_0xfa04('0x110')});db[_0xfa04('0xfa')][_0xfa04('0x116')](db['Disposition'],{'as':_0xfa04('0x169'),'foreignKey':_0xfa04('0x1fa'),'onDelete':'cascade'});db[_0xfa04('0xfa')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xfa04('0x1fa')});db[_0xfa04('0xfa')]['hasMany'](db[_0xfa04('0x100')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db['WhatsappAccount']['hasMany'](db['WhatsappInteraction'],{'as':_0xfa04('0x16b')});db[_0xfa04('0xfa')]['hasMany'](db[_0xfa04('0xfc')],{'as':_0xfa04('0x145')});db['WhatsappAccount'][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':'List','foreignKey':_0xfa04('0x16d')});db[_0xfa04('0xfa')][_0xfa04('0x11f')](db['Pause'],{'as':_0xfa04('0x16f'),'foreignKey':_0xfa04('0x170')});db[_0xfa04('0xfa')]['belongsToMany'](db[_0xfa04('0xf')],{'as':_0xfa04('0x154'),'through':_0xfa04('0x141')});db['WhatsappApplication']['belongsTo'](db[_0xfa04('0xf')],{'onDelete':'restrict'});db[_0xfa04('0xfc')]['belongsTo'](db['WhatsappQueue'],{'onDelete':_0xfa04('0x163')});db['WhatsappApplication']['belongsTo'](db[_0xfa04('0xfa')],{'onDelete':_0xfa04('0x163')});db[_0xfa04('0xfc')][_0xfa04('0x11f')](db[_0xfa04('0x84')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['WhatsappApplication'][_0xfa04('0x11f')](db[_0xfa04('0x176')],{'onDelete':_0xfa04('0x163'),'foreignKey':_0xfa04('0x17f')});db[_0xfa04('0xfe')][_0xfa04('0x116')](db['WhatsappMessage'],{'as':_0xfa04('0x159'),'onDelete':'cascade','foreignKey':_0xfa04('0x1fb')});db[_0xfa04('0xfe')][_0xfa04('0x11f')](db[_0xfa04('0xfa')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1fa')});db[_0xfa04('0xfe')][_0xfa04('0x11f')](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db['WhatsappInteraction'][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'as':_0xfa04('0x174'),'foreignKey':_0xfa04('0x112')});db[_0xfa04('0xfe')][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x1b2'),'as':_0xfa04('0x175')});db['WhatsappInteraction'][_0xfa04('0x121')](db[_0xfa04('0x176')],{'through':_0xfa04('0x1b2'),'as':_0xfa04('0x178')});db[_0xfa04('0xfe')][_0xfa04('0x121')](db[_0xfa04('0xf')],{'as':_0xfa04('0x179'),'through':_0xfa04('0x12f'),'foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db['User'],{'as':_0xfa04('0xf')});db[_0xfa04('0x100')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xfa04('0x15f')});db[_0xfa04('0x100')]['belongsTo'](db[_0xfa04('0xfe')],{'onDelete':_0xfa04('0x110'),'as':_0xfa04('0x17b'),'foreignKey':_0xfa04('0x1fb')});db[_0xfa04('0x100')][_0xfa04('0x11f')](db[_0xfa04('0xfa')],{'as':_0xfa04('0x173'),'foreignKey':_0xfa04('0x1fa')});db['WhatsappQueueReport'][_0xfa04('0x11f')](db[_0xfa04('0xfa')],{});db['WhatsappQueueReport'][_0xfa04('0x11f')](db[_0xfa04('0x125')],{'as':_0xfa04('0x16c'),'foreignKey':_0xfa04('0x16d')});db[_0xfa04('0x101')]['belongsTo'](db[_0xfa04('0x6f')],{'as':_0xfa04('0x15f'),'foreignKey':_0xfa04('0x160')});db['WhatsappQueueReport'][_0xfa04('0x11f')](db[_0xfa04('0xfe')],{});db[_0xfa04('0x101')]['belongsTo'](db['WhatsappQueue'],{});db['WhatsappQueueReport']['belongsTo'](db['WhatsappMessage'],{});db['WhatsappQueueReport'][_0xfa04('0x11f')](db['User'],{});db['WhatsappTransferReport'][_0xfa04('0x11f')](db[_0xfa04('0x100')],{});db[_0xfa04('0x103')][_0xfa04('0x11f')](db['WhatsappInteraction'],{});db[_0xfa04('0x103')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xfa04('0x1fc'),'as':'FromAccount'});db[_0xfa04('0x103')][_0xfa04('0x11f')](db['WhatsappAccount'],{'foreignKey':_0xfa04('0x1fd'),'as':'ToAccount'});db['WhatsappTransferReport'][_0xfa04('0x11f')](db['WhatsappQueue'],{'foreignKey':_0xfa04('0x1fe'),'as':_0xfa04('0x1e8')});db[_0xfa04('0x103')][_0xfa04('0x11f')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db['WhatsappTransferReport']['belongsTo'](db[_0xfa04('0xf')],{'foreignKey':_0xfa04('0x1e6'),'as':'ToAgent'});db[_0xfa04('0x105')]['belongsToMany'](db[_0xfa04('0xf')],{'as':_0xfa04('0x154'),'through':_0xfa04('0x35'),'foreignKey':_0xfa04('0x1ff')});db[_0xfa04('0x105')][_0xfa04('0x121')](db['Team'],{'through':_0xfa04('0x1df'),'as':_0xfa04('0x155')});db[_0xfa04('0x10e')][_0xfa04('0x11f')](db[_0xfa04('0xf')],{'as':_0xfa04('0x200'),'foreignKey':'UserId','onDelete':_0xfa04('0x110'),'hooks':!![]});db[_0xfa04('0x107')][_0xfa04('0x165')](db[_0xfa04('0xc5')],{'as':'Dynamics365Account','onDelete':_0xfa04('0x163')});db[_0xfa04('0x107')][_0xfa04('0x165')](db[_0xfa04('0x37')],{'as':_0xfa04('0x166'),'onDelete':_0xfa04('0x163')});db[_0xfa04('0x107')][_0xfa04('0x165')](db[_0xfa04('0x164')],{'as':_0xfa04('0x167'),'onDelete':_0xfa04('0x163')});module[_0xfa04('0x201')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 36f2714..4bd04a5 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f8c=['./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','/api/auth/google','/api/auth/activedirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/pm2','/api/webbar','/api/logs','/apidoc','static','root','/www','join','/demo','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','then','/api/users','./api/user','use','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./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/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages'];(function(_0x1bc443,_0x244e86){var _0x3c590d=function(_0x346dc7){while(--_0x346dc7){_0x1bc443['push'](_0x1bc443['shift']());}};_0x3c590d(++_0x244e86);}(_0x1f8c,0x163));var _0xc1f8=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x1f8c[_0x1196bd];return _0x26014f;};'use strict';var path=require('path');var express=require(_0xc1f8('0x0'));var errors=require(_0xc1f8('0x1'));var config=require(_0xc1f8('0x2'));var setupLoggers=require(_0xc1f8('0x3'))[_0xc1f8('0x4')];var clientSideLogs=require('./api/client-side-logs');exports['default']=function(_0xab80e7){return setupLoggers(_0xab80e7)[_0xc1f8('0x5')](function(){_0xab80e7['use'](_0xc1f8('0x6'),require(_0xc1f8('0x7')));_0xab80e7[_0xc1f8('0x8')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0xab80e7['use'](_0xc1f8('0x9'),require(_0xc1f8('0xa')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb'),require(_0xc1f8('0xc')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd'),require('./api/voiceMusicOnHold'));_0xab80e7[_0xc1f8('0x8')]('/api/voice/queues',require(_0xc1f8('0xe')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf'),require(_0xc1f8('0x10')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x11'),require(_0xc1f8('0x12')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x13'),require(_0xc1f8('0x14')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x15'),require(_0xc1f8('0x16')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x17'),require(_0xc1f8('0x18')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x19'),require(_0xc1f8('0x1a')));_0xab80e7['use']('/api/voice/agents/reports',require(_0xc1f8('0x1b')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x1c'),require(_0xc1f8('0x1d')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x1e'),require('./api/memberReport'));_0xab80e7['use'](_0xc1f8('0x1f'),require(_0xc1f8('0x20')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x21'),require(_0xc1f8('0x22')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x23'),require(_0xc1f8('0x24')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x25'),require(_0xc1f8('0x26')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x27'),require(_0xc1f8('0x28')));_0xab80e7[_0xc1f8('0x8')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x29'),require(_0xc1f8('0x2a')));_0xab80e7[_0xc1f8('0x8')]('/api/mail/messages',require(_0xc1f8('0x2b')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x2c'),require(_0xc1f8('0x2d')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x2e'),require(_0xc1f8('0x2f')));_0xab80e7[_0xc1f8('0x8')]('/api/dashboards',require(_0xc1f8('0x30')));_0xab80e7['use'](_0xc1f8('0x31'),require(_0xc1f8('0x32')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x33'),require(_0xc1f8('0x34')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x35'),require(_0xc1f8('0x36')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x37'),require(_0xc1f8('0x38')));_0xab80e7['use'](_0xc1f8('0x39'),require(_0xc1f8('0x3a')));_0xab80e7[_0xc1f8('0x8')]('/api/fax/queues',require('./api/faxQueue'));_0xab80e7['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x3b'),require(_0xc1f8('0x3c')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x3d'),require(_0xc1f8('0x3e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x3f'),require(_0xc1f8('0x40')));_0xab80e7[_0xc1f8('0x8')]('/api/sms/messages',require(_0xc1f8('0x41')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x42'),require(_0xc1f8('0x43')));_0xab80e7['use'](_0xc1f8('0x44'),require(_0xc1f8('0x45')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x46'),require(_0xc1f8('0x47')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x48'),require('./api/openchannelInteraction'));_0xab80e7['use'](_0xc1f8('0x49'),require(_0xc1f8('0x4a')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x4b'),require(_0xc1f8('0x4c')));_0xab80e7['use']('/api/chat/websites',require(_0xc1f8('0x4d')));_0xab80e7[_0xc1f8('0x8')]('/api/openchannel/reports/queue',require(_0xc1f8('0x4e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x4f'),require(_0xc1f8('0x50')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x51'),require(_0xc1f8('0x52')));_0xab80e7[_0xc1f8('0x8')]('/api/chat/messages',require(_0xc1f8('0x53')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x54'),require('./api/chatOfflineMessage'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x55'),require(_0xc1f8('0x56')));_0xab80e7[_0xc1f8('0x8')]('/api/chat/groups',require(_0xc1f8('0x57')));_0xab80e7[_0xc1f8('0x8')]('/api/chat/proactive_actions',require(_0xc1f8('0x58')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x59'),require('./api/cmCompany'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x5a'),require(_0xc1f8('0x5b')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x5c'),require(_0xc1f8('0x5d')));_0xab80e7['use'](_0xc1f8('0x5e'),require(_0xc1f8('0x5f')));_0xab80e7['use'](_0xc1f8('0x60'),require('./api/cmHopperFinal'));_0xab80e7['use'](_0xc1f8('0x61'),require(_0xc1f8('0x62')));_0xab80e7['use'](_0xc1f8('0x63'),require('./api/cmCustomField'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x64'),require(_0xc1f8('0x65')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x66'),require(_0xc1f8('0x67')));_0xab80e7[_0xc1f8('0x8')]('/api/canned_answers',require('./api/cannedAnswer'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x68'),require(_0xc1f8('0x69')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x6a'),require('./api/condition'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x6b'),require('./api/interval'));_0xab80e7[_0xc1f8('0x8')]('/api/pauses',require(_0xc1f8('0x6c')));_0xab80e7['use'](_0xc1f8('0x6d'),require(_0xc1f8('0x6e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x6f'),require('./api/voiceQueuesLog'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x70'),require(_0xc1f8('0x71')));_0xab80e7['use'](_0xc1f8('0x72'),require(_0xc1f8('0x73')));_0xab80e7['use']('/api/tags',require(_0xc1f8('0x74')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x75'),require(_0xc1f8('0x76')));_0xab80e7['use']('/api/cm_contact_has_items',require(_0xc1f8('0x77')));_0xab80e7['use'](_0xc1f8('0x78'),require(_0xc1f8('0x79')));_0xab80e7[_0xc1f8('0x8')]('/api/templates',require(_0xc1f8('0x7a')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x7b'),require(_0xc1f8('0x7c')));_0xab80e7['use'](_0xc1f8('0x7d'),require(_0xc1f8('0x7e')));_0xab80e7[_0xc1f8('0x8')]('/api/integrations',require(_0xc1f8('0x7f')));_0xab80e7['use']('/api/integrations/reports',require(_0xc1f8('0x80')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x81'),require(_0xc1f8('0x82')));_0xab80e7[_0xc1f8('0x8')]('/api/analytics/default_reports',require(_0xc1f8('0x83')));_0xab80e7['use'](_0xc1f8('0x84'),require('./api/analyticExtractedReport'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x85'),require('./api/analyticMetric'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x86'),require(_0xc1f8('0x87')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x88'),require(_0xc1f8('0x89')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x8a'),require('./api/intSalesforceAccount'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x8b'),require('./api/intSalesforceConfiguration'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x8c'),require(_0xc1f8('0x8d')));_0xab80e7[_0xc1f8('0x8')]('/api/integrations/sugarcrm/accounts',require(_0xc1f8('0x8e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x8f'),require(_0xc1f8('0x90')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x91'),require('./api/intSugarcrmField'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x92'),require(_0xc1f8('0x93')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x94'),require(_0xc1f8('0x95')));_0xab80e7['use']('/api/integrations/desk/fields',require(_0xc1f8('0x96')));_0xab80e7['use'](_0xc1f8('0x97'),require(_0xc1f8('0x98')));_0xab80e7['use'](_0xc1f8('0x99'),require(_0xc1f8('0x9a')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x9b'),require(_0xc1f8('0x9c')));_0xab80e7[_0xc1f8('0x8')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0xab80e7['use'](_0xc1f8('0x9d'),require(_0xc1f8('0x9e')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x9f'),require(_0xc1f8('0xa0')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xa1'),require(_0xc1f8('0xa2')));_0xab80e7['use'](_0xc1f8('0xa3'),require('./api/intFreshdeskConfiguration'));_0xab80e7['use'](_0xc1f8('0xa4'),require(_0xc1f8('0xa5')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xa6'),require(_0xc1f8('0xa7')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xa8'),require(_0xc1f8('0xa9')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xaa'),require('./api/intVtigerField'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xab'),require(_0xc1f8('0xac')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xad'),require(_0xc1f8('0xae')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xaf'),require('./api/intServicenowField'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb0'),require('./api/intDynamics365Account'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb1'),require(_0xc1f8('0xb2')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb3'),require(_0xc1f8('0xb4')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb5'),require(_0xc1f8('0xb6')));_0xab80e7['use'](_0xc1f8('0xb7'),require('./api/intFreshsalesConfiguration'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xb8'),require(_0xc1f8('0xb9')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xba'),require(_0xc1f8('0xbb')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xbc'),require(_0xc1f8('0xbd')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xbe'),require('./api/chatInternalMessage'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xbf'),require(_0xc1f8('0xc0')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xc1'),require(_0xc1f8('0xc2')));_0xab80e7['use']('/api/jscripty/sessions/reports',require(_0xc1f8('0xc3')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xc4'),require('./api/smsQueueReport'));_0xab80e7['use'](_0xc1f8('0xc5'),require(_0xc1f8('0xc6')));_0xab80e7['use'](_0xc1f8('0xc7'),require(_0xc1f8('0xc8')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xc9'),require('./api/jscriptyProject'));_0xab80e7[_0xc1f8('0x8')]('/api/settings',require(_0xc1f8('0xca')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xcb'),require('./api/squareOdbc'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xcc'),require(_0xc1f8('0xcd')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xce'),require(_0xc1f8('0xcf')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd0'),require(_0xc1f8('0xd1')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd2'),require(_0xc1f8('0xd3')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd4'),require('./api/license'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd5'),require(_0xc1f8('0xd6')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd7'),require(_0xc1f8('0xd8')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xd9'),require(_0xc1f8('0xda')));_0xab80e7['use']('/api/plugins',require(_0xc1f8('0xdb')));_0xab80e7['use']('/api/mail/reports/transfer',require(_0xc1f8('0xdc')));_0xab80e7['use'](_0xc1f8('0xdd'),require(_0xc1f8('0xde')));_0xab80e7[_0xc1f8('0x8')]('/api/fax/reports/transfer',require(_0xc1f8('0xdf')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xe0'),require('./api/openchannelTransferReport'));_0xab80e7['use'](_0xc1f8('0xe1'),require(_0xc1f8('0xe2')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xe3'),require(_0xc1f8('0xe4')));_0xab80e7['use'](_0xc1f8('0xe5'),require(_0xc1f8('0xe6')));_0xab80e7['use'](_0xc1f8('0xe7'),require(_0xc1f8('0xe8')));_0xab80e7['use']('/api/userProfile/sections',require(_0xc1f8('0xe9')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xea'),require(_0xc1f8('0xeb')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xec'),require(_0xc1f8('0xed')));_0xab80e7['use'](_0xc1f8('0xee'),require('./api/whatsappAccount'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xef'),require(_0xc1f8('0xf0')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf1'),require(_0xc1f8('0xf2')));_0xab80e7['use']('/api/whatsapp/messages',require(_0xc1f8('0xf3')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf4'),require(_0xc1f8('0xf5')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf6'),require(_0xc1f8('0xf7')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xf8'),require(_0xc1f8('0xf9')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xfa'),require(_0xc1f8('0xfb')));_0xab80e7[_0xc1f8('0x8')]('/api/realtime',require(_0xc1f8('0xfc')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xfd'),require(_0xc1f8('0xfe')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0xff'),require('./api/authLocal'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x100'),require('./api/authGoogle'));_0xab80e7['use'](_0xc1f8('0x101'),require('./api/authActiveDirectory'));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x102'),require(_0xc1f8('0x103')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x104'),require(_0xc1f8('0x105')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x106'),require('./api/version'));_0xab80e7[_0xc1f8('0x8')]('/api/system',require('./api/system'));_0xab80e7[_0xc1f8('0x8')]('/api/pm2',require(_0xc1f8('0x107')));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x108'),require('./api/webbar'));_0xab80e7['use'](_0xc1f8('0x109'),clientSideLogs);_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x10a'),express[_0xc1f8('0x10b')](path['join'](config[_0xc1f8('0x10c')],_0xc1f8('0x10a'))));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x10d'),express[_0xc1f8('0x10b')](path[_0xc1f8('0x10e')](config[_0xc1f8('0x10c')],_0xc1f8('0x10d'))));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x10f'),express['static'](path['join'](config[_0xc1f8('0x10c')],_0xc1f8('0x10f'))));_0xab80e7['use'](_0xc1f8('0x110'),express[_0xc1f8('0x10b')](path[_0xc1f8('0x10e')](config[_0xc1f8('0x10c')],_0xc1f8('0x111'),_0xc1f8('0x112'))));_0xab80e7[_0xc1f8('0x8')](_0xc1f8('0x113'),express[_0xc1f8('0x10b')](path[_0xc1f8('0x10e')](config['root'],'/server/files/plugins')));_0xab80e7[_0xc1f8('0x114')](_0xc1f8('0x115'))['get'](errors[0x194]);_0xab80e7[_0xc1f8('0x114')]('/*')[_0xc1f8('0x116')](function(_0x51c704,_0xa1f171){_0xa1f171[_0xc1f8('0x117')](path[_0xc1f8('0x118')](_0xab80e7['get'](_0xc1f8('0x119'))+'/index.html'));});return _0xab80e7;});}; \ No newline at end of file +var _0x9b46=['./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/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/integrations/freshsales/accounts','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','path','express','./config/environment','./utils/client-side-logger','setupLoggers','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./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/cmContact','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./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/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields'];(function(_0x176210,_0x448d0d){var _0x59acd3=function(_0x4af093){while(--_0x4af093){_0x176210['push'](_0x176210['shift']());}};_0x59acd3(++_0x448d0d);}(_0x9b46,0x82));var _0x69b4=function(_0x1b74d6,_0x5b7972){_0x1b74d6=_0x1b74d6-0x0;var _0x2e432e=_0x9b46[_0x1b74d6];return _0x2e432e;};'use strict';var path=require(_0x69b4('0x0'));var express=require(_0x69b4('0x1'));var errors=require('./errors');var config=require(_0x69b4('0x2'));var setupLoggers=require(_0x69b4('0x3'))[_0x69b4('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0x69b4('0x5')]=function(_0x4799e2){return setupLoggers(_0x4799e2)[_0x69b4('0x6')](function(){_0x4799e2[_0x69b4('0x7')](_0x69b4('0x8'),require(_0x69b4('0x9')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xa'),require(_0x69b4('0xb')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xc'),require(_0x69b4('0xd')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xe'),require(_0x69b4('0xf')));_0x4799e2[_0x69b4('0x7')]('/api/voice/mohs',require(_0x69b4('0x10')));_0x4799e2['use']('/api/voice/queues',require(_0x69b4('0x11')));_0x4799e2['use']('/api/voice/recordings',require(_0x69b4('0x12')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x13'),require(_0x69b4('0x14')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x15'),require(_0x69b4('0x16')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x17'),require('./api/voiceMailMessage'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x18'),require(_0x69b4('0x19')));_0x4799e2[_0x69b4('0x7')]('/api/voice/dials/reports',require('./api/voiceDialReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x1a'),require(_0x69b4('0x1b')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x1c'),require('./api/voiceQueueReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x1d'),require('./api/memberReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x1e'),require(_0x69b4('0x1f')));_0x4799e2['use'](_0x69b4('0x20'),require(_0x69b4('0x21')));_0x4799e2[_0x69b4('0x7')]('/api/mail/out_servers',require(_0x69b4('0x22')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x23'),require(_0x69b4('0x24')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x25'),require(_0x69b4('0x26')));_0x4799e2['use'](_0x69b4('0x27'),require('./api/mailSubstatus'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x28'),require(_0x69b4('0x29')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x2a'),require('./api/mailMessage'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x2b'),require(_0x69b4('0x2c')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x2d'),require(_0x69b4('0x2e')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x2f'),require('./api/dashboard'));_0x4799e2['use'](_0x69b4('0x30'),require('./api/dashboardItem'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x31'),require(_0x69b4('0x32')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x33'),require(_0x69b4('0x34')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x35'),require(_0x69b4('0x36')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x37'),require(_0x69b4('0x38')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x39'),require(_0x69b4('0x3a')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x3b'),require(_0x69b4('0x3c')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x3d'),require(_0x69b4('0x3e')));_0x4799e2[_0x69b4('0x7')]('/api/sms/applications',require(_0x69b4('0x3f')));_0x4799e2['use']('/api/sms/interactions',require(_0x69b4('0x40')));_0x4799e2['use'](_0x69b4('0x41'),require(_0x69b4('0x42')));_0x4799e2['use']('/api/sms/queues',require(_0x69b4('0x43')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x44'),require(_0x69b4('0x45')));_0x4799e2[_0x69b4('0x7')]('/api/openchannel/applications',require(_0x69b4('0x46')));_0x4799e2[_0x69b4('0x7')]('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x47'),require(_0x69b4('0x48')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x49'),require(_0x69b4('0x4a')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x4b'),require(_0x69b4('0x4c')));_0x4799e2[_0x69b4('0x7')]('/api/openchannel/reports/queue',require(_0x69b4('0x4d')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x4e'),require(_0x69b4('0x4f')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x50'),require(_0x69b4('0x51')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x52'),require(_0x69b4('0x53')));_0x4799e2['use']('/api/chat/offline_messages',require(_0x69b4('0x54')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x55'),require(_0x69b4('0x56')));_0x4799e2[_0x69b4('0x7')]('/api/chat/groups',require(_0x69b4('0x57')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x58'),require(_0x69b4('0x59')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x5a'),require(_0x69b4('0x5b')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x5c'),require(_0x69b4('0x5d')));_0x4799e2['use'](_0x69b4('0x5e'),require('./api/cmHopper'));_0x4799e2['use']('/api/cm/hopper_black',require(_0x69b4('0x5f')));_0x4799e2['use'](_0x69b4('0x60'),require('./api/cmHopperFinal'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x61'),require(_0x69b4('0x62')));_0x4799e2[_0x69b4('0x7')]('/api/cm/custom_fields',require(_0x69b4('0x63')));_0x4799e2['use'](_0x69b4('0x64'),require(_0x69b4('0x65')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x66'),require('./api/automation'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x67'),require(_0x69b4('0x68')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x69'),require('./api/disposition'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x6a'),require('./api/condition'));_0x4799e2[_0x69b4('0x7')]('/api/intervals',require('./api/interval'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x6b'),require(_0x69b4('0x6c')));_0x4799e2['use'](_0x69b4('0x6d'),require(_0x69b4('0x6e')));_0x4799e2['use'](_0x69b4('0x6f'),require(_0x69b4('0x70')));_0x4799e2[_0x69b4('0x7')]('/api/schedules',require(_0x69b4('0x71')));_0x4799e2['use'](_0x69b4('0x72'),require('./api/sound'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x73'),require(_0x69b4('0x74')));_0x4799e2['use'](_0x69b4('0x75'),require(_0x69b4('0x76')));_0x4799e2[_0x69b4('0x7')]('/api/cm_contact_has_items',require(_0x69b4('0x77')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x78'),require(_0x69b4('0x79')));_0x4799e2['use']('/api/templates',require(_0x69b4('0x7a')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x7b'),require(_0x69b4('0x7c')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x7d'),require(_0x69b4('0x7e')));_0x4799e2['use'](_0x69b4('0x7f'),require(_0x69b4('0x80')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x81'),require(_0x69b4('0x82')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x83'),require(_0x69b4('0x84')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x85'),require(_0x69b4('0x86')));_0x4799e2[_0x69b4('0x7')]('/api/analytics/extracted_reports',require(_0x69b4('0x87')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x88'),require(_0x69b4('0x89')));_0x4799e2[_0x69b4('0x7')]('/api/analytics/field_reports',require(_0x69b4('0x8a')));_0x4799e2['use']('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x8b'),require(_0x69b4('0x8c')));_0x4799e2[_0x69b4('0x7')]('/api/integrations/salesforce/configurations',require(_0x69b4('0x8d')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x8e'),require(_0x69b4('0x8f')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x90'),require(_0x69b4('0x91')));_0x4799e2['use'](_0x69b4('0x92'),require(_0x69b4('0x93')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x94'),require(_0x69b4('0x95')));_0x4799e2[_0x69b4('0x7')]('/api/integrations/desk/accounts',require(_0x69b4('0x96')));_0x4799e2['use'](_0x69b4('0x97'),require(_0x69b4('0x98')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x99'),require(_0x69b4('0x9a')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x9b'),require(_0x69b4('0x9c')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x9d'),require('./api/intZohoConfiguration'));_0x4799e2[_0x69b4('0x7')]('/api/integrations/zoho/fields',require(_0x69b4('0x9e')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x9f'),require(_0x69b4('0xa0')));_0x4799e2['use'](_0x69b4('0xa1'),require(_0x69b4('0xa2')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xa3'),require(_0x69b4('0xa4')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xa5'),require('./api/intFreshdeskAccount'));_0x4799e2['use'](_0x69b4('0xa6'),require(_0x69b4('0xa7')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xa8'),require(_0x69b4('0xa9')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xaa'),require(_0x69b4('0xab')));_0x4799e2[_0x69b4('0x7')]('/api/integrations/vtiger/configurations',require(_0x69b4('0xac')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xad'),require(_0x69b4('0xae')));_0x4799e2[_0x69b4('0x7')]('/api/integrations/servicenow/accounts',require(_0x69b4('0xaf')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xb0'),require(_0x69b4('0xb1')));_0x4799e2['use'](_0x69b4('0xb2'),require(_0x69b4('0xb3')));_0x4799e2[_0x69b4('0x7')]('/api/integrations/dynamics365/accounts',require(_0x69b4('0xb4')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xb5'),require(_0x69b4('0xb6')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xb7'),require('./api/intDynamics365Field'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xb8'),require('./api/intFreshsalesAccount'));_0x4799e2['use']('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x4799e2['use'](_0x69b4('0xb9'),require('./api/intFreshsalesField'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xba'),require(_0x69b4('0xbb')));_0x4799e2['use']('/api/chat/reports/queue',require(_0x69b4('0xbc')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xbd'),require(_0x69b4('0xbe')));_0x4799e2['use'](_0x69b4('0xbf'),require('./api/jscriptyAnswerReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xc0'),require(_0x69b4('0xc1')));_0x4799e2['use'](_0x69b4('0xc2'),require('./api/jscriptySessionReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xc3'),require(_0x69b4('0xc4')));_0x4799e2['use'](_0x69b4('0xc5'),require(_0x69b4('0xc6')));_0x4799e2[_0x69b4('0x7')]('/api/square/details/reports',require(_0x69b4('0xc7')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xc8'),require(_0x69b4('0xc9')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xca'),require(_0x69b4('0xcb')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xcc'),require(_0x69b4('0xcd')));_0x4799e2['use']('/api/square/projects',require(_0x69b4('0xce')));_0x4799e2['use'](_0x69b4('0xcf'),require(_0x69b4('0xd0')));_0x4799e2[_0x69b4('0x7')]('/api/square/messages',require(_0x69b4('0xd1')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xd2'),require('./api/team'));_0x4799e2[_0x69b4('0x7')]('/api/license',require(_0x69b4('0xd3')));_0x4799e2['use'](_0x69b4('0xd4'),require(_0x69b4('0xd5')));_0x4799e2[_0x69b4('0x7')]('/api/migrations',require('./api/migration'));_0x4799e2['use'](_0x69b4('0xd6'),require(_0x69b4('0xd7')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xd8'),require(_0x69b4('0xd9')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xda'),require('./api/mailTransferReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xdb'),require(_0x69b4('0xdc')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xdd'),require('./api/faxTransferReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xde'),require('./api/openchannelTransferReport'));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xdf'),require(_0x69b4('0xe0')));_0x4799e2[_0x69b4('0x7')]('/api/cm/lists',require(_0x69b4('0xe1')));_0x4799e2[_0x69b4('0x7')]('/api/voice/prefixes',require(_0x69b4('0xe2')));_0x4799e2['use'](_0x69b4('0xe3'),require(_0x69b4('0xe4')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xe5'),require('./api/userProfileSection'));_0x4799e2['use'](_0x69b4('0xe6'),require('./api/userProfileResource'));_0x4799e2[_0x69b4('0x7')]('/api/userNotifications',require(_0x69b4('0xe7')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xe8'),require(_0x69b4('0xe9')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xea'),require(_0x69b4('0xeb')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xec'),require(_0x69b4('0xed')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xee'),require(_0x69b4('0xef')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xf0'),require(_0x69b4('0xf1')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xf2'),require('./api/whatsappTransferReport'));_0x4799e2[_0x69b4('0x7')]('/api/whatsapp/queues',require(_0x69b4('0xf3')));_0x4799e2[_0x69b4('0x7')]('/api/cloudProviders',require(_0x69b4('0xf4')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xf5'),require('./api/realtime'));_0x4799e2[_0x69b4('0x7')]('/api/user-settings',require(_0x69b4('0xf6')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xf7'),require(_0x69b4('0xf8')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xf9'),require(_0x69b4('0xfa')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xfb'),require(_0x69b4('0xfc')));_0x4799e2['use']('/api/jira',require(_0x69b4('0xfd')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0xfe'),require(_0x69b4('0xff')));_0x4799e2[_0x69b4('0x7')]('/api/version',require(_0x69b4('0x100')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x101'),require(_0x69b4('0x102')));_0x4799e2[_0x69b4('0x7')]('/api/pm2',require(_0x69b4('0x103')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x104'),require(_0x69b4('0x105')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x106'),clientSideLogs);_0x4799e2[_0x69b4('0x7')](_0x69b4('0x107'),express[_0x69b4('0x108')](path[_0x69b4('0x109')](config[_0x69b4('0x10a')],_0x69b4('0x107'))));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x10b'),express[_0x69b4('0x108')](path[_0x69b4('0x109')](config[_0x69b4('0x10a')],_0x69b4('0x10b'))));_0x4799e2[_0x69b4('0x7')]('/demo',express['static'](path[_0x69b4('0x109')](config[_0x69b4('0x10a')],'/demo')));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x10c'),express[_0x69b4('0x108')](path[_0x69b4('0x109')](config[_0x69b4('0x10a')],_0x69b4('0x10d'),_0x69b4('0x10e'))));_0x4799e2[_0x69b4('0x7')](_0x69b4('0x10f'),express[_0x69b4('0x108')](path[_0x69b4('0x109')](config[_0x69b4('0x10a')],_0x69b4('0x110'))));_0x4799e2[_0x69b4('0x111')](_0x69b4('0x112'))[_0x69b4('0x113')](errors[0x194]);_0x4799e2[_0x69b4('0x111')]('/*')[_0x69b4('0x113')](function(_0x1e584e,_0x292576){_0x292576[_0x69b4('0x114')](path[_0x69b4('0x115')](_0x4799e2[_0x69b4('0x113')](_0x69b4('0x116'))+'/index.html'));});return _0x4799e2;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index ea85342..620d050 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ece=['../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.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/cmHopper/cmHopper.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','server','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc'];(function(_0x20f189,_0x5ebbd8){var _0x4699e6=function(_0x32a77f){while(--_0x32a77f){_0x20f189['push'](_0x20f189['shift']());}};_0x4699e6(++_0x5ebbd8);}(_0x7ece,0xc9));var _0xe7ec=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x7ece[_0x35885a];return _0xe86249;};'use strict';var jayson=require('jayson/promise');var _=require(_0xe7ec('0x0'));var config=require(_0xe7ec('0x1'));exports['listen']=function(){return new Promise(function(_0x39b8fd,_0x3ca0fb){var _0x129edf={};_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x3')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/voiceExtension/voiceExtension.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x4')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x5')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x6')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x7')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x8')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x9')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xa')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xb')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xc')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xd')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0xe')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0xf')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/mailApplication/mailApplication.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x10')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x11')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x12')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x13')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x14')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x15')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x16')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x17')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x18')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/smsMessage/smsMessage.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/smsQueue/smsQueue.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x19')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x1a')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x1b')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x1c')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x1d')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x1e')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x1f')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x20')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/cmContact/cmContact.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x21')));_0x129edf=_['merge'](_0x129edf,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x22')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x23')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x24')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x25')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x26')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/template/template.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x27')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x28')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x29')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2a')));_0x129edf=_['merge'](_0x129edf,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2b')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2c')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2d')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x2e')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x2f')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x30')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x31')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x32')));_0x129edf=_['merge'](_0x129edf,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x33')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x34')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x35')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require('../api/squareRecording/squareRecording.rpc'));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x36')));_0x129edf=_['merge'](_0x129edf,require('../api/campaign/campaign.rpc'));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x37')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x38')));_0x129edf=_['merge'](_0x129edf,require(_0xe7ec('0x39')));_0x129edf=_[_0xe7ec('0x2')](_0x129edf,require(_0xe7ec('0x3a')));_0x129edf=_['merge'](_0x129edf,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x129edf=_['merge'](_0x129edf,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x129edf=_['merge'](_0x129edf,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x113a26=jayson[_0xe7ec('0x3b')](_0x129edf)[_0xe7ec('0x3c')]();var _0x4a1438=config[_0xe7ec('0x3d')][_0xe7ec('0x3e')]||config['port']+0x1;var _0x242f97=config[_0xe7ec('0x3d')]['ip']||_0xe7ec('0x3f');_0x113a26['on'](_0xe7ec('0x40'),function(_0x3a69e1){return _0x3ca0fb(_0x3a69e1);});_0x113a26[_0xe7ec('0x41')](_0x4a1438,_0x242f97,function(){console[_0xe7ec('0x42')](_0xe7ec('0x43'),_0x242f97,_0x4a1438);require(_0xe7ec('0x44'))['default']();return _0x39b8fd(_0xe7ec('0x45')+_0x242f97+':'+_0x4a1438);});});}; \ No newline at end of file +var _0x2e8f=['../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.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/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.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/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x2e8f,0x180));var _0xf2e8=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x2e8f[_0x2afbb0];return _0x411ff2;};'use strict';var jayson=require(_0xf2e8('0x0'));var _=require('lodash');var config=require(_0xf2e8('0x1'));exports[_0xf2e8('0x2')]=function(){return new Promise(function(_0x2cbe96,_0x2f72e5){var _0x4f1093={};_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x4')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/voiceExtension/voiceExtension.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x5')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x6')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x7')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x8')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x9')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0xa')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/memberReport/memberReport.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0xb')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0xc')));_0x4f1093=_['merge'](_0x4f1093,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0xd')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0xe')));_0x4f1093=_['merge'](_0x4f1093,require('../api/mailQueue/mailQueue.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0xf')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x10')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x11')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/faxAccount/faxAccount.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x12')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/faxInteraction/faxInteraction.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/faxMessage/faxMessage.rpc'));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x13')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x14')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/smsInteraction/smsInteraction.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x15')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x16')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x17')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x18')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x19')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x1a')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x1b')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x1c')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x1d')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x1e')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x1f')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x20')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x21')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x22')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x23')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x24')));_0x4f1093=_['merge'](_0x4f1093,require('../api/pause/pause.rpc'));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x25')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x26')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x27')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x28')));_0x4f1093=_['merge'](_0x4f1093,require('../api/variable/variable.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x29')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x2a')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x2b')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x2c')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x2d')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x2e')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x2f')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x30')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x31')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x32')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x33')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x34')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/squareOdbc/squareOdbc.rpc'));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x35')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x36')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x37')));_0x4f1093=_['merge'](_0x4f1093,require('../api/campaign/campaign.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x38')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require(_0xf2e8('0x39')));_0x4f1093=_['merge'](_0x4f1093,require(_0xf2e8('0x3a')));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x4f1093=_['merge'](_0x4f1093,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x4f1093=_['merge'](_0x4f1093,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x4f1093=_[_0xf2e8('0x3')](_0x4f1093,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x5cba07=jayson['server'](_0x4f1093)['http']();var _0x74c74d=config[_0xf2e8('0x3b')][_0xf2e8('0x3c')]||config[_0xf2e8('0x3c')]+0x1;var _0xeda628=config[_0xf2e8('0x3b')]['ip']||_0xf2e8('0x3d');_0x5cba07['on'](_0xf2e8('0x3e'),function(_0xc4a93b){return _0x2f72e5(_0xc4a93b);});_0x5cba07['listen'](_0x74c74d,_0xeda628,function(){console[_0xf2e8('0x3f')](_0xf2e8('0x40'),_0xeda628,_0x74c74d);require('../config/triggers')['default']();return _0x2cbe96(_0xf2e8('0x41')+_0xeda628+':'+_0x74c74d);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 1fb32fc..88e4eba 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 _0x5c7c=['STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','setEncoding','utf8','headers','emit','ready','toLowerCase','hangup','520-Invalid','search','function','substring','no\x20code','replace','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','destroy','pipe','command','inherits','prototype','sendRequest','answer','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','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP'];(function(_0x36bfe3,_0x358938){var _0x9b0436=function(_0x86e47d){while(--_0x86e47d){_0x36bfe3['push'](_0x36bfe3['shift']());}};_0x9b0436(++_0x358938);}(_0x5c7c,0x172));var _0xc5c7=function(_0x48a836,_0xa1d010){_0x48a836=_0x48a836-0x0;var _0x249dc8=_0x5c7c[_0x48a836];return _0x249dc8;};'use strict';var util=require(_0xc5c7('0x0'));var _=require(_0xc5c7('0x1'));var EventEmitter=require(_0xc5c7('0x2'))[_0xc5c7('0x3')];var AGIReply=require(_0xc5c7('0x4'));var AGIError=require(_0xc5c7('0x5'));function AGIChannel(_0xc17170){var _0x4e4407=this,_0x1c4f6b=new AGIReply(),_0x1cfbf3=![],_0x557ffb={};EventEmitter['call'](_0x4e4407);_0xc17170[_0xc5c7('0x6')](_0xc5c7('0x7'));_0xc17170['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1c4f6b[_0xc5c7('0x6')](_0xc5c7('0x7'));_0x1c4f6b['on'](_0xc5c7('0x8'),function(_0x43520f){for(var _0x571b10 in _0x43520f){_0x4e4407[_0x571b10]=_0x43520f[_0x571b10];}_0x4e4407[_0xc5c7('0x9')](_0xc5c7('0xa'));});_0x1c4f6b['on']('line',function(_0x25ce4e){if(_0x25ce4e[_0xc5c7('0xb')]()==_0xc5c7('0xc')){_0x4e4407['emit']('hangup');return;}if(_0x25ce4e['substring'](0x0,0xb)==_0xc5c7('0xd')){_0x1cfbf3=!![];}if(_0x1cfbf3){_0x557ffb['rx']+=_0x25ce4e+'\x0a';if(_0x25ce4e[_0xc5c7('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x1cfbf3=![];}}else{_0x557ffb['rx']=_0x25ce4e;}if(_0x1cfbf3){return;}if(typeof _0x557ffb['cb']==_0xc5c7('0xf')){var _0x286a3f=_0x557ffb['rx'][_0xc5c7('0x10')](0x0,0x3),_0x1ee659=null,_0x10b566=null;_0x286a3f=parseInt(_0x286a3f);if(isNaN(_0x286a3f)){_0x557ffb['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xc5c7('0x11')});return;}if(_0x286a3f!=0xc8){_0x557ffb['cb'](null,{'code':_0x286a3f,'result':-0x1,'extra':'KO'});return;}_0x1ee659=_0x557ffb['rx'][_0xc5c7('0x10')](0x4)[_0xc5c7('0x12')]('result=','');if(_0x1ee659[_0xc5c7('0x13')]('\x20')!=-0x1){_0x1ee659=_0x1ee659[_0xc5c7('0x14')](0x0,_0x1ee659['indexOf']('\x20'));}if(_['startsWith'](_0x1ee659,'-1')){_0x1ee659=parseInt(_0x1ee659);}_0x10b566=_0x557ffb['rx'][_0xc5c7('0x15')]('\x20');if(_0x10b566[_0xc5c7('0x16')]==0x3){_0x10b566=_0x10b566[0x2][_0xc5c7('0x10')](0x1,_0x10b566[0x2][_0xc5c7('0x16')]-0x1);}else if(_0x10b566['length']>0x3){var _0x2552ef=/\((.+)\)/;var _0x18bea3=_0x557ffb['rx'][_0xc5c7('0x17')](_0x2552ef);if(_0x18bea3){_0x10b566=_0x18bea3[0x1];}else{_0x10b566=null;}}else{_0x10b566=null;}_0x557ffb['cb'](null,{'code':_0x286a3f,'result':_0x1ee659,'extra':_0x10b566});}});_0xc17170['on'](_0xc5c7('0x18'),function(_0x16e44c){_0x4e4407['emit']('error',new AGIError(_0xc5c7('0x19'),_0x16e44c[_0xc5c7('0x1a')]));});_0xc17170['on']('close',function(){_0x4e4407['emit'](_0xc5c7('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0xc17170['on'](_0xc5c7('0x1c'),function(){_0x4e4407[_0xc5c7('0x9')](_0xc5c7('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0xc17170[_0xc5c7('0x1d')]();});_0xc17170[_0xc5c7('0x1e')](_0x1c4f6b);this[_0xc5c7('0x1f')]=function(_0x3911f7,_0x14dc81){var _0x3911f7=_0x3911f7||'',_0x14dc81=typeof _0x14dc81=='function'?_0x14dc81:new Function();_0x557ffb={'tx':_0x3911f7,'rx':'','cb':_0x14dc81};_0xc17170['write'](_0x3911f7+'\x0a');},this[_0xc5c7('0x1b')]=function(){_0xc17170[_0xc5c7('0x1d')]();};}util[_0xc5c7('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x22')]=function(_0x1e4a3f){return this[_0xc5c7('0x1f')]['sync'](this,_0x1e4a3f);};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x23')]=function(){return this[_0xc5c7('0x22')](_0xc5c7('0x24'));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x25')]=function(_0x579ab5,_0x1e7ab0,_0x5a0dfa){_0x579ab5=_0x579ab5===undefined?'beep':_0x579ab5;_0x1e7ab0=_0x1e7ab0===undefined?'5':_0x1e7ab0;_0x5a0dfa=_0x5a0dfa===undefined?'1':_0x5a0dfa;return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x27'),_0x579ab5,_0x1e7ab0*0x3e8,_0x5a0dfa));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x28')]=function(_0x5e50ed){_0x5e50ed=_0x5e50ed||_0xc5c7('0x29');return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x2a'),_0x5e50ed));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x2b')]=function(_0x5aca5b,_0x51c860){if(_[_0xc5c7('0x2c')](_0x51c860)){return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0x5aca5b,_0x51c860['join'](',')));}return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x2d'),_0x5aca5b,_0x51c860));};AGIChannel[_0xc5c7('0x21')]['setContext']=function(_0xa7e082){return this['sendRequest'](util[_0xc5c7('0x26')](_0xc5c7('0x2e'),_0xa7e082));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x2f')]=function(_0x159b29){return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x30'),_0x159b29));};AGIChannel[_0xc5c7('0x21')]['setPriority']=function(_0xfebb30){return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x31'),_0xfebb30));};AGIChannel[_0xc5c7('0x21')]['hangup']=function(){return this[_0xc5c7('0x22')](_0xc5c7('0x32'));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x33')]=function(_0x841be4,_0x2c074f){var _0x2848da=_[_0xc5c7('0x34')](_0x2c074f)||_['isNumber'](_0x2c074f)?_0x2c074f[_0xc5c7('0x35')]():_0x2c074f;return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x36'),_0x841be4,_0x2848da?_0x2848da[_0xc5c7('0x35')]()[_0xc5c7('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x37')]=function(_0x19ee07,_0x5198e7){return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x38'),_0x19ee07,_0x5198e7));};AGIChannel[_0xc5c7('0x21')]['sayDigits']=function(_0x65c14c,_0x3b9096){return this['sendRequest'](util[_0xc5c7('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x65c14c,_0x3b9096));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x39')]=function(_0xb63fd9,_0x2b12be){return this[_0xc5c7('0x22')](util['format'](_0xc5c7('0x3a'),_0xb63fd9,_0x2b12be));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x3b')]=function(_0x4326bf,_0x5e77be,_0x4b6f2){_0x5e77be=_0x5e77be||this[_0xc5c7('0x3c')];_0x4b6f2=_0x4b6f2||0x1;this['setContext'](_0x4326bf);this[_0xc5c7('0x2f')](_0x5e77be);this[_0xc5c7('0x3d')](_0x4b6f2);return this[_0xc5c7('0x28')](util[_0xc5c7('0x26')](_0xc5c7('0x3e'),_0x4326bf,_0x5e77be,_0x4b6f2));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x3f')]=function(_0x2ca5b5){return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')](_0xc5c7('0x40'),_0x2ca5b5));};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x41')]=function(_0x2e5f09,_0x3a27d1,_0x269e47,_0x42d3a4,_0x1a67ea,_0x4b0e6a){_0x3a27d1=_0x3a27d1||_0xc5c7('0x42');_0x269e47=_0x269e47||'';_0x42d3a4=_0x42d3a4===undefined?-0x1:_0x42d3a4==='-1'?-0x1:_0x42d3a4*0x3e8;_0x1a67ea=_0x1a67ea===undefined?'':'s='+_0x1a67ea;_0x4b0e6a=_0x4b0e6a?_0xc5c7('0x43'):'';return this[_0xc5c7('0x22')](util[_0xc5c7('0x26')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2e5f09,_0x3a27d1,_0x269e47,_0x42d3a4,_0x4b0e6a,_0x1a67ea));};AGIChannel[_0xc5c7('0x21')]['streamFile']=function(_0x592976,_0x5c3cf6){_0x5c3cf6=_0x5c3cf6||'';return this[_0xc5c7('0x22')](util['format'](_0xc5c7('0x44'),_0x592976,_0x5c3cf6));};AGIChannel[_0xc5c7('0x21')]['agi']=function(_0x1419e2){return this['exec'](_0xc5c7('0x45'),_0x1419e2);};AGIChannel[_0xc5c7('0x21')]['wait']=function(_0x3f350b){return this[_0xc5c7('0x2b')](_0xc5c7('0x46'),_0x3f350b);};AGIChannel[_0xc5c7('0x21')][_0xc5c7('0x18')]=function(_0x1d213,_0x555f5c){this[_0xc5c7('0x28')](util[_0xc5c7('0x26')](_0xc5c7('0x47'),_0x1d213['id'],_0x1d213[_0xc5c7('0x48')],_0x555f5c));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x5ed3=['command','write','close','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','continueAt','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','exec','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','util','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup','substring','520-Invalid','search','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy'];(function(_0x27e51b,_0x2b4412){var _0x5d22ab=function(_0x303b5f){while(--_0x303b5f){_0x27e51b['push'](_0x27e51b['shift']());}};_0x5d22ab(++_0x2b4412);}(_0x5ed3,0x1f3));var _0x35ed=function(_0x579424,_0x131f87){_0x579424=_0x579424-0x0;var _0x5b1c4b=_0x5ed3[_0x579424];return _0x5b1c4b;};'use strict';var util=require(_0x35ed('0x0'));var _=require('lodash');var EventEmitter=require(_0x35ed('0x1'))[_0x35ed('0x2')];var AGIReply=require(_0x35ed('0x3'));var AGIError=require('./error');function AGIChannel(_0x5a195e){var _0x1be624=this,_0x4d070=new AGIReply(),_0x1908f3=![],_0x481b09={};EventEmitter[_0x35ed('0x4')](_0x1be624);_0x5a195e[_0x35ed('0x5')](_0x35ed('0x6'));_0x5a195e[_0x35ed('0x7')](0x8*0x3c*0x3c*0x3e8);_0x4d070['setEncoding'](_0x35ed('0x6'));_0x4d070['on'](_0x35ed('0x8'),function(_0x274ce2){for(var _0x25a733 in _0x274ce2){_0x1be624[_0x25a733]=_0x274ce2[_0x25a733];}_0x1be624[_0x35ed('0x9')](_0x35ed('0xa'));});_0x4d070['on']('line',function(_0x59ccb1){if(_0x59ccb1[_0x35ed('0xb')]()=='hangup'){_0x1be624['emit'](_0x35ed('0xc'));return;}if(_0x59ccb1[_0x35ed('0xd')](0x0,0xb)==_0x35ed('0xe')){_0x1908f3=!![];}if(_0x1908f3){_0x481b09['rx']+=_0x59ccb1+'\x0a';if(_0x59ccb1[_0x35ed('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x1908f3=![];}}else{_0x481b09['rx']=_0x59ccb1;}if(_0x1908f3){return;}if(typeof _0x481b09['cb']==_0x35ed('0x10')){var _0x7b2467=_0x481b09['rx'][_0x35ed('0xd')](0x0,0x3),_0xd89531=null,_0x189ae6=null;_0x7b2467=parseInt(_0x7b2467);if(isNaN(_0x7b2467)){_0x481b09['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x35ed('0x11')});return;}if(_0x7b2467!=0xc8){_0x481b09['cb'](null,{'code':_0x7b2467,'result':-0x1,'extra':'KO'});return;}_0xd89531=_0x481b09['rx'][_0x35ed('0xd')](0x4)[_0x35ed('0x12')](_0x35ed('0x13'),'');if(_0xd89531[_0x35ed('0x14')]('\x20')!=-0x1){_0xd89531=_0xd89531[_0x35ed('0x15')](0x0,_0xd89531[_0x35ed('0x14')]('\x20'));}if(_[_0x35ed('0x16')](_0xd89531,'-1')){_0xd89531=parseInt(_0xd89531);}_0x189ae6=_0x481b09['rx'][_0x35ed('0x17')]('\x20');if(_0x189ae6['length']==0x3){_0x189ae6=_0x189ae6[0x2]['substring'](0x1,_0x189ae6[0x2][_0x35ed('0x18')]-0x1);}else if(_0x189ae6[_0x35ed('0x18')]>0x3){var _0x539cfc=/\((.+)\)/;var _0x381a75=_0x481b09['rx'][_0x35ed('0x19')](_0x539cfc);if(_0x381a75){_0x189ae6=_0x381a75[0x1];}else{_0x189ae6=null;}}else{_0x189ae6=null;}_0x481b09['cb'](null,{'code':_0x7b2467,'result':_0xd89531,'extra':_0x189ae6});}});_0x5a195e['on'](_0x35ed('0x1a'),function(_0x58405c){_0x1be624[_0x35ed('0x9')](_0x35ed('0x1a'),new AGIError(_0x35ed('0x1b'),_0x58405c[_0x35ed('0x1c')]));});_0x5a195e['on']('close',function(){_0x1be624['emit']('close',new AGIError(_0x35ed('0x1d')));});_0x5a195e['on'](_0x35ed('0x1e'),function(){_0x1be624[_0x35ed('0x9')](_0x35ed('0x1e'),new AGIError(_0x35ed('0x1f')));_0x5a195e[_0x35ed('0x20')]();});_0x5a195e['pipe'](_0x4d070);this[_0x35ed('0x21')]=function(_0xfed00b,_0x520d13){var _0xfed00b=_0xfed00b||'',_0x520d13=typeof _0x520d13==_0x35ed('0x10')?_0x520d13:new Function();_0x481b09={'tx':_0xfed00b,'rx':'','cb':_0x520d13};_0x5a195e[_0x35ed('0x22')](_0xfed00b+'\x0a');},this[_0x35ed('0x23')]=function(){_0x5a195e[_0x35ed('0x20')]();};}util[_0x35ed('0x24')](AGIChannel,EventEmitter);AGIChannel[_0x35ed('0x25')][_0x35ed('0x26')]=function(_0x176f0a){return this['command'][_0x35ed('0x27')](this,_0x176f0a);};AGIChannel['prototype'][_0x35ed('0x28')]=function(){return this['sendRequest'](_0x35ed('0x29'));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x2a')]=function(_0x3aabcd,_0x22d599,_0x499b99){_0x3aabcd=_0x3aabcd===undefined?_0x35ed('0x2b'):_0x3aabcd;_0x22d599=_0x22d599===undefined?'5':_0x22d599;_0x499b99=_0x499b99===undefined?'1':_0x499b99;return this[_0x35ed('0x26')](util[_0x35ed('0x2c')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3aabcd,_0x22d599*0x3e8,_0x499b99));};AGIChannel[_0x35ed('0x25')]['noop']=function(_0x361ded){_0x361ded=_0x361ded||'NO\x20MESSAGE';return this[_0x35ed('0x26')](util[_0x35ed('0x2c')]('VERBOSE\x20\x22%s\x22',_0x361ded));};AGIChannel[_0x35ed('0x25')]['exec']=function(_0x1a9a3e,_0x277aad){if(_[_0x35ed('0x2d')](_0x277aad)){return this['sendRequest'](util[_0x35ed('0x2c')](_0x35ed('0x2e'),_0x1a9a3e,_0x277aad[_0x35ed('0x2f')](',')));}return this[_0x35ed('0x26')](util['format'](_0x35ed('0x2e'),_0x1a9a3e,_0x277aad));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x30')]=function(_0x583d34){return this[_0x35ed('0x26')](util[_0x35ed('0x2c')](_0x35ed('0x31'),_0x583d34));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x32')]=function(_0x211de2){return this[_0x35ed('0x26')](util[_0x35ed('0x2c')](_0x35ed('0x33'),_0x211de2));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x34')]=function(_0x54986c){return this[_0x35ed('0x26')](util[_0x35ed('0x2c')](_0x35ed('0x35'),_0x54986c));};AGIChannel[_0x35ed('0x25')][_0x35ed('0xc')]=function(){return this[_0x35ed('0x26')]('HANGUP');};AGIChannel[_0x35ed('0x25')][_0x35ed('0x36')]=function(_0x4bc042,_0x4e11ff){var _0x54dbba=_[_0x35ed('0x37')](_0x4e11ff)||_[_0x35ed('0x38')](_0x4e11ff)?_0x4e11ff[_0x35ed('0x39')]():_0x4e11ff;return this[_0x35ed('0x26')](util[_0x35ed('0x2c')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x4bc042,_0x54dbba?_0x54dbba[_0x35ed('0x39')]()[_0x35ed('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0xbd6e8d,_0xd156b8){return this[_0x35ed('0x26')](util[_0x35ed('0x2c')](_0x35ed('0x3a'),_0xbd6e8d,_0xd156b8));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x3b')]=function(_0x2e06e1,_0x5eff3a){return this['sendRequest'](util[_0x35ed('0x2c')]('SAY\x20DIGITS\x20%s\x20%s',_0x2e06e1,_0x5eff3a));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x3c')]=function(_0x33864c,_0x3d2694){return this[_0x35ed('0x26')](util[_0x35ed('0x2c')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x33864c,_0x3d2694));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x3d')]=function(_0xa5defe,_0x59302f,_0x4c57fe){_0x59302f=_0x59302f||this['extension'];_0x4c57fe=_0x4c57fe||0x1;this[_0x35ed('0x30')](_0xa5defe);this[_0x35ed('0x32')](_0x59302f);this[_0x35ed('0x34')](_0x4c57fe);return this[_0x35ed('0x3e')](util['format']('GOTO\x20%s\x20%s\x20%s',_0xa5defe,_0x59302f,_0x4c57fe));};AGIChannel['prototype'][_0x35ed('0x3f')]=function(_0x153d7c){return this[_0x35ed('0x26')](util[_0x35ed('0x2c')](_0x35ed('0x40'),_0x153d7c));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x41')]=function(_0x4e8344,_0x2168bf,_0xec327e,_0x556700,_0x20e5aa,_0x4cae46){_0x2168bf=_0x2168bf||_0x35ed('0x42');_0xec327e=_0xec327e||'';_0x556700=_0x556700===undefined?-0x1:_0x556700==='-1'?-0x1:_0x556700*0x3e8;_0x20e5aa=_0x20e5aa===undefined?'':'s='+_0x20e5aa;_0x4cae46=_0x4cae46?_0x35ed('0x43'):'';return this['sendRequest'](util[_0x35ed('0x2c')](_0x35ed('0x44'),_0x4e8344,_0x2168bf,_0xec327e,_0x556700,_0x4cae46,_0x20e5aa));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x45')]=function(_0x298849,_0x2e96be){_0x2e96be=_0x2e96be||'';return this['sendRequest'](util[_0x35ed('0x2c')](_0x35ed('0x46'),_0x298849,_0x2e96be));};AGIChannel[_0x35ed('0x25')][_0x35ed('0x47')]=function(_0x280cb8){return this['exec'](_0x35ed('0x48'),_0x280cb8);};AGIChannel[_0x35ed('0x25')][_0x35ed('0x49')]=function(_0x99c1b1){return this[_0x35ed('0x4a')]('WAIT',_0x99c1b1);};AGIChannel['prototype'][_0x35ed('0x1a')]=function(_0x2f34c2,_0x1409ec){this[_0x35ed('0x3e')](util['format'](_0x35ed('0x4b'),_0x2f34c2['id'],_0x2f34c2['label'],_0x1409ec));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 79cd8b4..b7fad49 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 _0xf7d6=['push','format','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED'];(function(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0xf7d6,0x1ca));var _0x6f7d=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xf7d6[_0x13ea00];return _0x1f7347;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x6f7d('0x0'),'E_AGI_ARGUMENT_PORT':_0x6f7d('0x1'),'E_AGI_SERVER_ERROR':_0x6f7d('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x6f7d('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x6f7d('0x4'),'E_AGI_SOCKET_ERROR':_0x6f7d('0x5'),'E_AGI_SOCKET_CLOSE':_0x6f7d('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x6f7d('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6f7d('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x2cbc40){var _0x2cbc40=_0x2cbc40||null,_0x2f94a2=_0x2f94a2||[],_0x1f12c6=0x1,_0x2f78dd='';if(!error[_0x2cbc40]){_0x2cbc40=_0x6f7d('0x9');}_0x2f94a2['push'](error[_0x2cbc40]);while(arguments[_0x1f12c6]){_0x2f94a2[_0x6f7d('0xa')](arguments[_0x1f12c6]);_0x1f12c6++;}_0x2f78dd=util[_0x6f7d('0xb')]['apply'](util,_0x2f94a2);this['message']=_0x2f78dd;this[_0x6f7d('0xc')]=_0x2cbc40;}module['exports']=AGIError; \ No newline at end of file +var _0xd778=['Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','push','message','name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.'];(function(_0x30dbe4,_0x176acb){var _0x5183a0=function(_0x307c19){while(--_0x307c19){_0x30dbe4['push'](_0x30dbe4['shift']());}};_0x5183a0(++_0x176acb);}(_0xd778,0x132));var _0x8d77=function(_0x34207c,_0x21dfc2){_0x34207c=_0x34207c-0x0;var _0x3b1c2e=_0xd778[_0x34207c];return _0x3b1c2e;};'use strict';var util=require(_0x8d77('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x8d77('0x1'),'E_AGI_SERVER_CLOSE':_0x8d77('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x8d77('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x8d77('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x8d77('0x5'),'E_AGI_COMMAND_EMPTY':_0x8d77('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x8d77('0x7')};function AGIError(_0x37bf28){var _0x37bf28=_0x37bf28||null,_0x27129b=_0x27129b||[],_0x7835a0=0x1,_0xc3264c='';if(!error[_0x37bf28]){_0x37bf28='E_AGI_UNDEFINED';}_0x27129b['push'](error[_0x37bf28]);while(arguments[_0x7835a0]){_0x27129b[_0x8d77('0x8')](arguments[_0x7835a0]);_0x7835a0++;}_0xc3264c=util['format']['apply'](util,_0x27129b);this[_0x8d77('0x9')]=_0xc3264c;this[_0x8d77('0xa')]=_0x37bf28;}module[_0x8d77('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 72e6bf3..104dc9f 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 _0xff4f=['agi','emit','E_AGI_SERVER_ERROR','message','projectUpdate','error','exports','lodash','events','./error','../../config/environment','redis','defaults','subscribe'];(function(_0x4f2b00,_0x54cf31){var _0x555e79=function(_0x41cae0){while(--_0x41cae0){_0x4f2b00['push'](_0x4f2b00['shift']());}};_0x555e79(++_0x54cf31);}(_0xff4f,0x1e3));var _0xfff4=function(_0x2e18e3,_0x48d4e1){_0x2e18e3=_0x2e18e3-0x0;var _0x308ceb=_0xff4f[_0x2e18e3];return _0x308ceb;};'use strict';var _=require(_0xfff4('0x0'));var EventEmitter=require(_0xfff4('0x1'))['EventEmitter'];var Redis=require('ioredis');var AGIError=require(_0xfff4('0x2'));var config=require(_0xfff4('0x3'));config[_0xfff4('0x4')]=_[_0xfff4('0x5')](config[_0xfff4('0x4')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config['redis']);sub[_0xfff4('0x6')](_0xfff4('0x7'),function(_0x3fc2d4){if(_0x3fc2d4)return eventEmitter[_0xfff4('0x8')]('error',new AGIError(_0xfff4('0x9'),_0x3fc2d4));});sub['on'](_0xfff4('0xa'),function(_0x5a00cb,_0x2e2b0b){if(_0x5a00cb!=='agi')return;try{var _0x3c6c2d=JSON['parse'](_0x2e2b0b);eventEmitter[_0xfff4('0x8')](_0xfff4('0xb'),_0x3c6c2d);}catch(_0x1a8599){eventEmitter['emit'](_0xfff4('0xc'),new AGIError(_0xfff4('0x9'),_0x1a8599));}});module[_0xfff4('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x626f=['EventEmitter','./error','redis','defaults','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','projectUpdate','error','exports','lodash'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x626f,0x1cd));var _0xf626=function(_0x4b6c8d,_0x3a8324){_0x4b6c8d=_0x4b6c8d-0x0;var _0x45bffa=_0x626f[_0x4b6c8d];return _0x45bffa;};'use strict';var _=require(_0xf626('0x0'));var EventEmitter=require('events')[_0xf626('0x1')];var Redis=require('ioredis');var AGIError=require(_0xf626('0x2'));var config=require('../../config/environment');config[_0xf626('0x3')]=_[_0xf626('0x4')](config[_0xf626('0x3')],{'host':_0xf626('0x5'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xf626('0x3')]);sub[_0xf626('0x6')](_0xf626('0x7'),function(_0xb695a7){if(_0xb695a7)return eventEmitter[_0xf626('0x8')]('error',new AGIError(_0xf626('0x9'),_0xb695a7));});sub['on'](_0xf626('0xa'),function(_0x73ce6e,_0x425c72){if(_0x73ce6e!==_0xf626('0x7'))return;try{var _0x1ad707=JSON['parse'](_0x425c72);eventEmitter[_0xf626('0x8')](_0xf626('0xb'),_0x1ad707);}catch(_0x3c5678){eventEmitter['emit'](_0xf626('0xc'),new AGIError(_0xf626('0x9'),_0x3c5678));}});module[_0xf626('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 b2c7c62..2dcb6e2 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 _0x5a87=['addVertex','push','prototype','size','relations','info','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','vswitch','target','default','agicommand','menu','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','getdigits','getsecretdigits','vertices','edges','numberOfEdges'];(function(_0x2ad308,_0x59426a){var _0x442d2a=function(_0x8a9092){while(--_0x8a9092){_0x2ad308['push'](_0x2ad308['shift']());}};_0x442d2a(++_0x59426a);}(_0x5a87,0x161));var _0x75a8=function(_0x4ca5c8,_0x5033b3){_0x4ca5c8=_0x4ca5c8-0x0;var _0x11e3da=_0x5a87[_0x4ca5c8];return _0x11e3da;};'use strict';var _=require(_0x75a8('0x0'));var logger=require('../../../config/logger')(_0x75a8('0x1'));var verticesWithRetry=['menu',_0x75a8('0x2'),_0x75a8('0x3')];var Graph=function(){this[_0x75a8('0x4')]={};this[_0x75a8('0x5')]={};this[_0x75a8('0x6')]=0x0;};Graph['prototype'][_0x75a8('0x7')]=function(_0x2296a4){this['vertices'][_0x2296a4['id']]=_0x2296a4;this['edges'][_0x2296a4['id']]=[];};Graph['prototype']['addEdge']=function(_0x2752de,_0x19f50a,_0x2797d6){this[_0x75a8('0x5')][_0x2752de][_0x75a8('0x8')]({'target':_0x19f50a,'condition':_0x2797d6});this[_0x75a8('0x6')]+=0x1;};Graph[_0x75a8('0x9')][_0x75a8('0xa')]=function(){return _[_0x75a8('0xa')](this[_0x75a8('0x4')]);};Graph[_0x75a8('0x9')][_0x75a8('0xb')]=function(){return this[_0x75a8('0x6')];};Graph[_0x75a8('0x9')]['getVertex']=function(_0x2f4d38){return this[_0x75a8('0x4')][_0x2f4d38];};Graph[_0x75a8('0x9')]['traverseBFS']=function(_0x2471ce,_0x59b17a){if(!this['vertices'][_0x2471ce]){return logger['info']('no\x20vertex\x20found');}var _0x3ef9a4=_0x59b17a(this['vertices'][_0x2471ce]);if(!_0x3ef9a4){return logger[_0x75a8('0xc')](_0x75a8('0xd'));}if(this[_0x75a8('0x5')][_0x2471ce]['length']===0x0){return logger['info'](_0x75a8('0xe'));}for(var _0x5d2eff=0x0,_0x21a806=[],_0x394cb3=![];_0x5d2eff\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','variables','stringify','close'];(function(_0x20b128,_0x194967){var _0x225697=function(_0x1e92ff){while(--_0x1e92ff){_0x20b128['push'](_0x20b128['shift']());}};_0x225697(++_0x194967);}(_0x2851,0xb7));var _0x1285=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2851[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x1285('0x0'));var syncho=require(_0x1285('0x1'));var util=require(_0x1285('0x2'));var config=require(_0x1285('0x3'));var logger=require(_0x1285('0x4'))(_0x1285('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x1285('0x6'));var Project=require(_0x1285('0x7'));var AGIEmitter=require(_0x1285('0x8'))[_0x1285('0x9')];var projects=[];config[_0x1285('0x5')]=_[_0x1285('0xa')](config[_0x1285('0x5')],{'ip':_0x1285('0xb'),'port':0x11dd});AGIEmitter['on'](_0x1285('0xc'),projectUpdateHandler);function connectionHandler(_0x11cc91){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x11cc91);agiHandler(_0x11cc91);}catch(_0x478faf){logger[_0x1285('0xd')](_0x478faf[_0x1285('0xe')]);}});});}function projectUpdateHandler(_0x34f687){try{var _0x136ab8=_[_0x1285('0xf')](projects,['id',_0x34f687['id']]);if(_0x136ab8>-0x1){if(_0x34f687[_0x1285('0x10')]===!![]){projects[_0x1285('0x11')](_0x136ab8,0x1);}else{projects[_0x136ab8]=_0x34f687;}}else{projects[_0x1285('0x12')](_0x34f687);}}catch(_0x708eba){logger[_0x1285('0xd')](_0x708eba[_0x1285('0xe')]);}}function listeningHandler(){console[_0x1285('0x13')](_0x1285('0x14'),config[_0x1285('0x5')][_0x1285('0x15')]);logger['info'](util[_0x1285('0x16')](_0x1285('0x17'),config[_0x1285('0x5')]['ip'],config[_0x1285('0x5')][_0x1285('0x15')]));}function errorHandler(_0x1f14d2){if(_0x1f14d2&&_0x1f14d2[_0x1285('0x18')]&&_0x1f14d2[_0x1285('0x19')]){logger[_0x1285('0xd')](util['format']('[%s]\x20%s',_0x1f14d2[_0x1285('0x18')],_0x1f14d2[_0x1285('0x19')]));}else{logger['error'](util['format'](_0x1285('0x1a'),_0x1f14d2[_0x1285('0xe')]));}}function closeHandler(){logger[_0x1285('0x1b')](util[_0x1285('0x16')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x1285('0x1c')],this[_0x1285('0x1d')],this[_0x1285('0x1e')]));try{createSquareReport(this);}catch(_0x342cde){logger[_0x1285('0xd')](_0x342cde[_0x1285('0xe')]);}}function timeoutHandler(){logger[_0x1285('0x1b')](util[_0x1285('0x16')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x1285('0x1f')],this[_0x1285('0x20')],this[_0x1285('0x1c')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x1285('0x1b')](util['format'](_0x1285('0x21'),this[_0x1285('0x1f')],this[_0x1285('0x20')],this['callerid'],this[_0x1285('0x1d')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x317919,_0x3b18f6){rpc[_0x1285('0x22')](_0x317919)[_0x1285('0x23')](function(_0x5011aa){if(_0x3b18f6){_0x3b18f6(null,_0x5011aa);}})[_0x1285('0x24')](function(_0x3b82c4){if(_0x3b18f6){_0x3b18f6(null,_0x3b82c4);}});}function setChannelVariables(_0x1d042a){for(var _0x30ef34 in _0x1d042a){if(_0x1d042a[_0x1285('0x25')](_0x30ef34)){if(_0x30ef34[_0x1285('0x26')](_0x1285('0x27'))===0x0){_0x1d042a[_0x30ef34[_0x1285('0x28')](0x4)]=_0x1d042a[_0x30ef34];delete _0x1d042a[_0x30ef34];}}}}function agiHandler(_0x4a673e){logger[_0x1285('0x29')](_0x1285('0x2a'),JSON[_0x1285('0x2b')](_0x4a673e,null,0x2));logger['info'](util[_0x1285('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x4a673e[_0x1285('0x1f')],_0x4a673e[_0x1285('0x20')],_0x4a673e[_0x1285('0x1c')],_0x4a673e[_0x1285('0x1d')],_0x4a673e[_0x1285('0x1e')]));_0x4a673e['on'](_0x1285('0xd'),errorHandler);_0x4a673e['on'](_0x1285('0x2c'),closeHandler);_0x4a673e['on']('timeout',timeoutHandler);_0x4a673e['evtHangup']=![];_0x4a673e['on'](_0x1285('0x2d'),hangupHandler);var _0x4296b1=_[_0x1285('0x2e')](projects,['name',_0x4a673e['arg_1']]);if(!_0x4296b1)return Project[_0x1285('0x2f')](_0x4a673e);if(!_0x4296b1['production'])return Project[_0x1285('0x30')](_0x4a673e);return Project[_0x1285('0x31')](_0x4296b1,_0x4a673e);}function main(){var _0x91f342;return utilLicense[_0x1285('0x32')]()[_0x1285('0x23')](function(_0x55cfed){if(!_0x55cfed)return;if(_0x55cfed[_0x1285('0x33')]){if(_0x55cfed[_0x1285('0x34')]&&_0x55cfed[_0x1285('0x34')]>0x0){logger['info'](util[_0x1285('0x16')]('[LICENSE]\x20CHANNELS:\x20%s',_0x55cfed[_0x1285('0x34')]));_0x91f342=_0x55cfed[_0x1285('0x34')];}else{logger[_0x1285('0x1b')](_0x1285('0x35'));}}else{logger[_0x1285('0x1b')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x91f342=-0x1;}})['then'](function(){return Project['getAll']();})[_0x1285('0x23')](function(_0x3ab010){projects=_0x3ab010;return;})[_0x1285('0x24')](function(_0x1154cb){logger[_0x1285('0xd')]('[LICENSE]',_0x1154cb[_0x1285('0xe')]);})['finally'](function(){var _0x50bebc=require(_0x1285('0x36'))(config[_0x1285('0x5')]['port'],config[_0x1285('0x5')]['ip'],_0x91f342);_0x50bebc['on'](_0x1285('0xd'),errorHandler);_0x50bebc['on'](_0x1285('0x37'),listeningHandler);_0x50bebc['on'](_0x1285('0x38'),connectionHandler);_0x50bebc['on'](_0x1285('0x2c'),closeHandler);});}main(); \ No newline at end of file +var _0x2c35=['callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','./server','listening','lodash','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./rpc','./project','./events','EventEmitter','agi','127.0.0.1','projectUpdate','nextTick','stack','findIndex','deleted','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[%s]\x20%s','[ERROR]\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','debug','variables','stringify','close','hangup','handleNotFound','production','handleUnpublished','getLicense','voice'];(function(_0x1b46ac,_0x7bbaf9){var _0x362d4f=function(_0x386c59){while(--_0x386c59){_0x1b46ac['push'](_0x1b46ac['shift']());}};_0x362d4f(++_0x7bbaf9);}(_0x2c35,0x12f));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x52c3('0x0'));var syncho=require(_0x52c3('0x1'));var util=require(_0x52c3('0x2'));var config=require(_0x52c3('0x3'));var logger=require(_0x52c3('0x4'))('agi');var utilLicense=require(_0x52c3('0x5'));var rpc=require(_0x52c3('0x6'));var Project=require(_0x52c3('0x7'));var AGIEmitter=require(_0x52c3('0x8'))[_0x52c3('0x9')];var projects=[];config[_0x52c3('0xa')]=_['defaults'](config[_0x52c3('0xa')],{'ip':_0x52c3('0xb'),'port':0x11dd});AGIEmitter['on'](_0x52c3('0xc'),projectUpdateHandler);function connectionHandler(_0x127f9a){process[_0x52c3('0xd')](function(){syncho(function(){try{setChannelVariables(_0x127f9a);agiHandler(_0x127f9a);}catch(_0xd83485){logger['error'](_0xd83485[_0x52c3('0xe')]);}});});}function projectUpdateHandler(_0x4c9c49){try{var _0x2ff4d1=_[_0x52c3('0xf')](projects,['id',_0x4c9c49['id']]);if(_0x2ff4d1>-0x1){if(_0x4c9c49[_0x52c3('0x10')]===!![]){projects['splice'](_0x2ff4d1,0x1);}else{projects[_0x2ff4d1]=_0x4c9c49;}}else{projects[_0x52c3('0x11')](_0x4c9c49);}}catch(_0x415ed1){logger['error'](_0x415ed1[_0x52c3('0xe')]);}}function listeningHandler(){console['log'](_0x52c3('0x12'),config[_0x52c3('0xa')][_0x52c3('0x13')]);logger[_0x52c3('0x14')](util[_0x52c3('0x15')](_0x52c3('0x16'),config[_0x52c3('0xa')]['ip'],config[_0x52c3('0xa')][_0x52c3('0x13')]));}function errorHandler(_0xda896b){if(_0xda896b&&_0xda896b[_0x52c3('0x17')]&&_0xda896b[_0x52c3('0x18')]){logger[_0x52c3('0x19')](util[_0x52c3('0x15')](_0x52c3('0x1a'),_0xda896b[_0x52c3('0x17')],_0xda896b['message']));}else{logger['error'](util[_0x52c3('0x15')](_0x52c3('0x1b'),_0xda896b[_0x52c3('0xe')]));}}function closeHandler(){logger['info'](util[_0x52c3('0x15')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x52c3('0x1c')],this['calleridname'],this[_0x52c3('0x1d')],this[_0x52c3('0x1e')],this[_0x52c3('0x1f')]));try{createSquareReport(this);}catch(_0x6c391f){logger['error'](_0x6c391f[_0x52c3('0xe')]);}}function timeoutHandler(){logger['info'](util[_0x52c3('0x15')](_0x52c3('0x20'),this[_0x52c3('0x1c')],this[_0x52c3('0x21')],this[_0x52c3('0x1d')],this[_0x52c3('0x1e')],this[_0x52c3('0x1f')]));}function hangupHandler(){logger['info'](util['format'](_0x52c3('0x22'),this[_0x52c3('0x1c')],this[_0x52c3('0x21')],this[_0x52c3('0x1d')],this[_0x52c3('0x1e')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x3e30ff,_0x38662a){rpc[_0x52c3('0x23')](_0x3e30ff)[_0x52c3('0x24')](function(_0x329f36){if(_0x38662a){_0x38662a(null,_0x329f36);}})[_0x52c3('0x25')](function(_0x2f983f){if(_0x38662a){_0x38662a(null,_0x2f983f);}});}function setChannelVariables(_0x14fe99){for(var _0x576ddc in _0x14fe99){if(_0x14fe99[_0x52c3('0x26')](_0x576ddc)){if(_0x576ddc[_0x52c3('0x27')](_0x52c3('0x28'))===0x0){_0x14fe99[_0x576ddc['substring'](0x4)]=_0x14fe99[_0x576ddc];delete _0x14fe99[_0x576ddc];}}}}function agiHandler(_0x2c3bc9){logger[_0x52c3('0x29')](_0x52c3('0x2a'),JSON[_0x52c3('0x2b')](_0x2c3bc9,null,0x2));logger[_0x52c3('0x14')](util[_0x52c3('0x15')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2c3bc9[_0x52c3('0x1c')],_0x2c3bc9[_0x52c3('0x21')],_0x2c3bc9[_0x52c3('0x1d')],_0x2c3bc9[_0x52c3('0x1e')],_0x2c3bc9[_0x52c3('0x1f')]));_0x2c3bc9['on'](_0x52c3('0x19'),errorHandler);_0x2c3bc9['on'](_0x52c3('0x2c'),closeHandler);_0x2c3bc9['on']('timeout',timeoutHandler);_0x2c3bc9['evtHangup']=![];_0x2c3bc9['on'](_0x52c3('0x2d'),hangupHandler);var _0x456067=_['find'](projects,['name',_0x2c3bc9['arg_1']]);if(!_0x456067)return Project[_0x52c3('0x2e')](_0x2c3bc9);if(!_0x456067[_0x52c3('0x2f')])return Project[_0x52c3('0x30')](_0x2c3bc9);return Project['initialize'](_0x456067,_0x2c3bc9);}function main(){var _0x2200d5;return utilLicense[_0x52c3('0x31')]()[_0x52c3('0x24')](function(_0xb17f79){if(!_0xb17f79)return;if(_0xb17f79[_0x52c3('0x32')]){if(_0xb17f79[_0x52c3('0x33')]&&_0xb17f79[_0x52c3('0x33')]>0x0){logger[_0x52c3('0x14')](util[_0x52c3('0x15')](_0x52c3('0x34'),_0xb17f79[_0x52c3('0x33')]));_0x2200d5=_0xb17f79['callysquare'];}else{logger[_0x52c3('0x14')](_0x52c3('0x35'));}}else{logger[_0x52c3('0x14')](_0x52c3('0x36'));_0x2200d5=-0x1;}})[_0x52c3('0x24')](function(){return Project[_0x52c3('0x37')]();})[_0x52c3('0x24')](function(_0x1d6ba1){projects=_0x1d6ba1;return;})['catch'](function(_0x170a04){logger[_0x52c3('0x19')](_0x52c3('0x38'),_0x170a04[_0x52c3('0xe')]);})['finally'](function(){var _0x3a0d55=require(_0x52c3('0x39'))(config[_0x52c3('0xa')]['port'],config[_0x52c3('0xa')]['ip'],_0x2200d5);_0x3a0d55['on'](_0x52c3('0x19'),errorHandler);_0x3a0d55['on'](_0x52c3('0x3a'),listeningHandler);_0x3a0d55['on']('connection',connectionHandler);_0x3a0d55['on'](_0x52c3('0x2c'),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 0f0e0f6..9801ca4 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 _0x0caa=['request','then','error','message','catch','SendMail','jayson/promise','client','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0caa,0xf9));var _0xa0ca=function(_0x38a045,_0x402d6b){_0x38a045=_0x38a045-0x0;var _0x45c34c=_0x0caa[_0x38a045];return _0x45c34c;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa0ca('0x0'));var client=jayson[_0xa0ca('0x1')][_0xa0ca('0x2')]({'port':0x232b});function request(_0x5f3728,_0x51791b){return new BPromise(function(_0x511fbe,_0x13570c){return client[_0xa0ca('0x3')](_0x5f3728,_0x51791b)[_0xa0ca('0x4')](function(_0x2f8a4a){if(_0x2f8a4a[_0xa0ca('0x5')]){return _0x13570c(_0x2f8a4a[_0xa0ca('0x5')][_0xa0ca('0x6')]);}else{return _0x511fbe(_0x2f8a4a['result']);}})[_0xa0ca('0x7')](function(_0x6217df){return _0x13570c(_0x6217df);});});}exports['sendMailMessage']=function(_0x47068a,_0x2ad898){return request(_0xa0ca('0x8'),{'account':_0x47068a,'message':_0x2ad898});}; \ No newline at end of file +var _0x5f16=['error','message','result','catch','bluebird','jayson/promise','client','request','then'];(function(_0x29edfd,_0x2eab43){var _0x556e8b=function(_0x7309fe){while(--_0x7309fe){_0x29edfd['push'](_0x29edfd['shift']());}};_0x556e8b(++_0x2eab43);}(_0x5f16,0x1c6));var _0x65f1=function(_0x8756b8,_0x1a58dc){_0x8756b8=_0x8756b8-0x0;var _0x48a2f3=_0x5f16[_0x8756b8];return _0x48a2f3;};'use strict';var BPromise=require(_0x65f1('0x0'));var jayson=require(_0x65f1('0x1'));var client=jayson[_0x65f1('0x2')]['http']({'port':0x232b});function request(_0x237091,_0x36cf3a){return new BPromise(function(_0x13906b,_0x5171ae){return client[_0x65f1('0x3')](_0x237091,_0x36cf3a)[_0x65f1('0x4')](function(_0x35909d){if(_0x35909d[_0x65f1('0x5')]){return _0x5171ae(_0x35909d[_0x65f1('0x5')][_0x65f1('0x6')]);}else{return _0x13906b(_0x35909d[_0x65f1('0x7')]);}})[_0x65f1('0x8')](function(_0x2468f6){return _0x5171ae(_0x2468f6);});});}exports['sendMailMessage']=function(_0x142209,_0x5bc001){return request('SendMail',{'account':_0x142209,'message':_0x5bc001});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 2db05ce..399fe03 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 _0xbab8=['util','../../config/logger','agi','./rpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','isArray','length','source','target','mxGraphModel','root','inspect','production','debug','stringify','format','YYYY-MM-DD\x20HH:mm:ss','omit','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','start','clear','vertex','agicommand','context','extension','priority','code','result','evtHangup','response','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','agicommand\x20not\x20found','arg_1','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','moment','xml2json'];(function(_0x31ad2f,_0x385d75){var _0x5b4051=function(_0x19e6a1){while(--_0x19e6a1){_0x31ad2f['push'](_0x31ad2f['shift']());}};_0x5b4051(++_0x385d75);}(_0xbab8,0x16c));var _0x8bab=function(_0x16abc5,_0x2607a4){_0x16abc5=_0x16abc5-0x0;var _0x1d0963=_0xbab8[_0x16abc5];return _0x1d0963;};'use strict';var _=require('lodash');var moment=require(_0x8bab('0x0'));var parser=require(_0x8bab('0x1'));var util=require(_0x8bab('0x2'));var logger=require(_0x8bab('0x3'))(_0x8bab('0x4'));var rpc=require(_0x8bab('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0x8bab('0x6'));var Vertices=require(_0x8bab('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x8bab('0x8')]()[_0x8bab('0x9')](function(_0xb37691){logger[_0x8bab('0xa')](_0x8bab('0xb'),_0xb37691[_0x8bab('0xc')]);return[];});}function addVertex(_0x32cfcc,_0x18acee,_0x727ddf){_0x18acee['agicommand']=_0x727ddf;if(_0x18acee[_0x8bab('0xd')](_0x8bab('0xe'))){_0x18acee[_0x8bab('0xf')]=parseInt(_0x18acee[_0x8bab('0xe')],0xa);}_0x32cfcc[_0x8bab('0x10')](_['omit'](_0x18acee,'mxCell'));}function initGraph(_0x39fe33,_0x112c04){var _0x51b3fd=new Graph();for(var _0x3204ba in _0x39fe33){if(_0x39fe33[_0x8bab('0xd')](_0x3204ba)){if(_[_0x8bab('0x11')](_0x39fe33[_0x3204ba])){for(var _0x34674a=0x0;_0x34674a<_0x39fe33[_0x3204ba][_0x8bab('0x12')];_0x34674a+=0x1){addVertex(_0x51b3fd,_0x39fe33[_0x3204ba][_0x34674a],_0x3204ba);}}else{addVertex(_0x51b3fd,_0x39fe33[_0x3204ba],_0x3204ba);}}}for(var _0x388660=0x0;_0x388660<_0x112c04[_0x8bab('0x12')];_0x388660+=0x1){if(_0x112c04[_0x388660][_0x8bab('0x13')]&&_0x112c04[_0x388660]['target']){_0x51b3fd['addEdge'](_0x112c04[_0x388660]['source'],_0x112c04[_0x388660][_0x8bab('0x14')],_0x112c04[_0x388660]['value']);}}return _0x51b3fd;}function getRoot(_0x3f0f50){return parser['toJson'](_0x3f0f50,{'object':!![]})[_0x8bab('0x15')][_0x8bab('0x16')];}function inspect(_0x49632e){return util[_0x8bab('0x17')](_0x49632e,{'showHidden':![],'depth':null});}function initialize(_0x3e0df7,_0x537973){var _0x13d651=getRoot(_0x3e0df7[_0x8bab('0x18')]);if(!_0x13d651||!_0x13d651['start'])return;var _0x2ad2bf,_0x4d6906,_0x276c02;logger[_0x8bab('0x19')](_0x8bab('0x16'),JSON[_0x8bab('0x1a')](_0x13d651,null,0x2));_0x537973['joinAt']=moment()[_0x8bab('0x1b')](_0x8bab('0x1c'));_0x2ad2bf=initGraph(_[_0x8bab('0x1d')](_0x13d651,_0x8bab('0x1e')),_0x13d651['mxCell']);_0x4d6906=new Vertices(_0x537973,rpc,mailRpc);logger[_0x8bab('0x1f')](util[_0x8bab('0x1b')](_0x8bab('0x20'),_0x537973['arg_1'],_0x537973[_0x8bab('0x21')],_0x537973[_0x8bab('0x22')],_0x537973[_0x8bab('0x23')],_0x537973[_0x8bab('0x24')]));_0x2ad2bf['traverseBFS'](_0x13d651[_0x8bab('0x25')]['id'],function(_0x115517){try{_0x115517=_0x4d6906[_0x8bab('0x26')](_0x115517);logger[_0x8bab('0x19')](_0x8bab('0x27'),JSON['stringify'](_0x115517,null,0x2));if(_0x115517[_0x8bab('0x28')]==='gotoc'){logger[_0x8bab('0x1f')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x537973['context']=_0x115517[_0x8bab('0x29')]||_0x537973[_0x8bab('0x29')];_0x537973[_0x8bab('0x2a')]=_0x115517['extension'];_0x537973[_0x8bab('0x2b')]=_0x115517[_0x8bab('0x2b')]?_0x115517[_0x8bab('0x2b')]-0x1:0x1;return null;}else if(_0x115517&&_0x4d6906[_0x115517[_0x8bab('0x28')]]){_0x276c02=_0x4d6906[_0x115517['agicommand']](_0x115517);logger[_0x8bab('0x1f')]('response',JSON[_0x8bab('0x1a')](_0x276c02,null,0x2));if(_0x276c02&&_0x276c02[_0x8bab('0x2c')]===AGI_CODE_SUCCESS&&_0x276c02[_0x8bab('0x2d')]!==AGI_RESULT_ERROR&&!_0x537973[_0x8bab('0x2e')]){logger[_0x8bab('0x19')](_0x8bab('0x2f'),inspect(_0x276c02));return _[_0x8bab('0x30')](_0x276c02[_0x8bab('0x2d')])?null:_0x276c02['result'][_0x8bab('0x31')]();}else{logger[_0x8bab('0xa')](_0x8bab('0x2f'),inspect(_0x276c02));return null;}}else{logger[_0x8bab('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x2dd873){logger['error'](_0x2dd873[_0x8bab('0xc')]);return null;}});if(_0x13d651[_0x8bab('0x32')]){logger['info'](util[_0x8bab('0x1b')](_0x8bab('0x33'),_0x537973['arg_1'],_0x537973[_0x8bab('0x21')],_0x537973['callerid'],_0x537973['dnid'],_0x537973[_0x8bab('0x24')]));_0x2ad2bf[_0x8bab('0x34')](_0x13d651['finally']['id'],function(_0x358d09){try{_0x358d09=_0x4d6906[_0x8bab('0x26')](_0x358d09);logger[_0x8bab('0x19')](_0x8bab('0x27'),JSON[_0x8bab('0x1a')](_0x358d09,null,0x2));if(_0x358d09&&_0x4d6906[_0x358d09[_0x8bab('0x28')]]){_0x276c02=_0x4d6906[_0x358d09[_0x8bab('0x28')]](_0x358d09);if(_0x276c02){logger[_0x8bab('0x19')](_0x8bab('0x2f'),inspect(_0x276c02));return _[_0x8bab('0x30')](_0x276c02[_0x8bab('0x2d')])?null:_0x276c02['result'][_0x8bab('0x31')]();}else{logger[_0x8bab('0xa')](_0x8bab('0x2f'),inspect(_0x276c02));return null;}}else{logger['error'](_0x8bab('0x35'));return null;}}catch(_0x5a77e9){logger[_0x8bab('0xa')](_0x5a77e9['stack']);return null;}});}logger[_0x8bab('0x1f')](util[_0x8bab('0x1b')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x537973[_0x8bab('0x36')],_0x537973[_0x8bab('0x21')],_0x537973[_0x8bab('0x22')],_0x537973[_0x8bab('0x23')],_0x537973[_0x8bab('0x24')]));logger[_0x8bab('0x1f')](util['format'](_0x8bab('0x37'),_0x537973[_0x8bab('0x29')],_0x537973[_0x8bab('0x2a')],parseInt(_0x537973['priority'],0xa)+0x1));_0x537973[_0x8bab('0x38')](_0x537973[_0x8bab('0x29')],_0x537973[_0x8bab('0x2a')],parseInt(_0x537973[_0x8bab('0x2b')],0xa)+0x1);_0x537973[_0x8bab('0x39')]();}function handleNotFound(_0x37e208){logger[_0x8bab('0xa')](util[_0x8bab('0x1b')](_0x8bab('0x3a'),_0x37e208[_0x8bab('0x36')]));_0x37e208['continueAt'](_0x37e208[_0x8bab('0x29')],_0x37e208['extension'],parseInt(_0x37e208[_0x8bab('0x2b')],0xa)+0x1);_0x37e208[_0x8bab('0x39')]();}function handleUnpublished(_0xb8a07c){logger[_0x8bab('0xa')](util['format'](_0x8bab('0x3b'),_0xb8a07c[_0x8bab('0x36')]));_0xb8a07c[_0x8bab('0x38')](_0xb8a07c[_0x8bab('0x29')],_0xb8a07c[_0x8bab('0x2a')],parseInt(_0xb8a07c[_0x8bab('0x2b')],0xa)+0x1);_0xb8a07c['close']();}module[_0x8bab('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x0ef8=['maxRetry','addVertex','omit','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','inspect','production','start','debug','root','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','vertex','context','extension','priority','agicommand','code','result','evtHangup','isUndefined','toString','response','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','traverseBFS','clear','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','moment','xml2json','../../config/logger','agi','./rpc','./vertices','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0ef8,0xe4));var _0x80ef=function(_0x1f5f68,_0xe28857){_0x1f5f68=_0x1f5f68-0x0;var _0x1be600=_0x0ef8[_0x1f5f68];return _0x1be600;};'use strict';var _=require('lodash');var moment=require(_0x80ef('0x0'));var parser=require(_0x80ef('0x1'));var util=require('util');var logger=require(_0x80ef('0x2'))(_0x80ef('0x3'));var rpc=require(_0x80ef('0x4'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0x80ef('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc['getSquareProjects']()[_0x80ef('0x6')](function(_0x2695b1){logger[_0x80ef('0x7')](_0x80ef('0x8'),_0x2695b1[_0x80ef('0x9')]);return[];});}function addVertex(_0x336a94,_0x355753,_0x43c217){_0x355753['agicommand']=_0x43c217;if(_0x355753[_0x80ef('0xa')](_0x80ef('0xb'))){_0x355753[_0x80ef('0xc')]=parseInt(_0x355753[_0x80ef('0xb')],0xa);}_0x336a94[_0x80ef('0xd')](_[_0x80ef('0xe')](_0x355753,'mxCell'));}function initGraph(_0x43061b,_0xb1ab56){var _0x3579b7=new Graph();for(var _0x456b1f in _0x43061b){if(_0x43061b[_0x80ef('0xa')](_0x456b1f)){if(_[_0x80ef('0xf')](_0x43061b[_0x456b1f])){for(var _0xda7006=0x0;_0xda7006<_0x43061b[_0x456b1f][_0x80ef('0x10')];_0xda7006+=0x1){addVertex(_0x3579b7,_0x43061b[_0x456b1f][_0xda7006],_0x456b1f);}}else{addVertex(_0x3579b7,_0x43061b[_0x456b1f],_0x456b1f);}}}for(var _0x49e483=0x0;_0x49e483<_0xb1ab56[_0x80ef('0x10')];_0x49e483+=0x1){if(_0xb1ab56[_0x49e483][_0x80ef('0x11')]&&_0xb1ab56[_0x49e483][_0x80ef('0x12')]){_0x3579b7[_0x80ef('0x13')](_0xb1ab56[_0x49e483][_0x80ef('0x11')],_0xb1ab56[_0x49e483][_0x80ef('0x12')],_0xb1ab56[_0x49e483][_0x80ef('0x14')]);}}return _0x3579b7;}function getRoot(_0x581772){return parser[_0x80ef('0x15')](_0x581772,{'object':!![]})[_0x80ef('0x16')]['root'];}function inspect(_0x2200be){return util[_0x80ef('0x17')](_0x2200be,{'showHidden':![],'depth':null});}function initialize(_0xeb7127,_0x48b1f9){var _0x243019=getRoot(_0xeb7127[_0x80ef('0x18')]);if(!_0x243019||!_0x243019[_0x80ef('0x19')])return;var _0x13f433,_0x25e62e,_0x52b3de;logger[_0x80ef('0x1a')](_0x80ef('0x1b'),JSON[_0x80ef('0x1c')](_0x243019,null,0x2));_0x48b1f9[_0x80ef('0x1d')]=moment()[_0x80ef('0x1e')](_0x80ef('0x1f'));_0x13f433=initGraph(_[_0x80ef('0xe')](_0x243019,_0x80ef('0x20')),_0x243019[_0x80ef('0x20')]);_0x25e62e=new Vertices(_0x48b1f9,rpc,mailRpc);logger[_0x80ef('0x21')](util[_0x80ef('0x1e')](_0x80ef('0x22'),_0x48b1f9[_0x80ef('0x23')],_0x48b1f9[_0x80ef('0x24')],_0x48b1f9[_0x80ef('0x25')],_0x48b1f9['dnid'],_0x48b1f9[_0x80ef('0x26')]));_0x13f433['traverseBFS'](_0x243019[_0x80ef('0x19')]['id'],function(_0x481bc8){try{_0x481bc8=_0x25e62e['clear'](_0x481bc8);logger[_0x80ef('0x1a')](_0x80ef('0x27'),JSON[_0x80ef('0x1c')](_0x481bc8,null,0x2));if(_0x481bc8['agicommand']==='gotoc'){logger[_0x80ef('0x21')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x48b1f9[_0x80ef('0x28')]=_0x481bc8[_0x80ef('0x28')]||_0x48b1f9[_0x80ef('0x28')];_0x48b1f9[_0x80ef('0x29')]=_0x481bc8[_0x80ef('0x29')];_0x48b1f9['priority']=_0x481bc8[_0x80ef('0x2a')]?_0x481bc8[_0x80ef('0x2a')]-0x1:0x1;return null;}else if(_0x481bc8&&_0x25e62e[_0x481bc8[_0x80ef('0x2b')]]){_0x52b3de=_0x25e62e[_0x481bc8['agicommand']](_0x481bc8);logger[_0x80ef('0x21')]('response',JSON[_0x80ef('0x1c')](_0x52b3de,null,0x2));if(_0x52b3de&&_0x52b3de[_0x80ef('0x2c')]===AGI_CODE_SUCCESS&&_0x52b3de[_0x80ef('0x2d')]!==AGI_RESULT_ERROR&&!_0x48b1f9[_0x80ef('0x2e')]){logger['debug']('response',inspect(_0x52b3de));return _[_0x80ef('0x2f')](_0x52b3de[_0x80ef('0x2d')])?null:_0x52b3de[_0x80ef('0x2d')][_0x80ef('0x30')]();}else{logger[_0x80ef('0x7')](_0x80ef('0x31'),inspect(_0x52b3de));return null;}}else{logger['error'](_0x80ef('0x32'));return null;}}catch(_0x117dd5){logger['error'](_0x117dd5['stack']);return null;}});if(_0x243019[_0x80ef('0x33')]){logger[_0x80ef('0x21')](util['format'](_0x80ef('0x34'),_0x48b1f9['arg_1'],_0x48b1f9[_0x80ef('0x24')],_0x48b1f9['callerid'],_0x48b1f9[_0x80ef('0x35')],_0x48b1f9[_0x80ef('0x26')]));_0x13f433[_0x80ef('0x36')](_0x243019['finally']['id'],function(_0x91439b){try{_0x91439b=_0x25e62e[_0x80ef('0x37')](_0x91439b);logger[_0x80ef('0x1a')](_0x80ef('0x27'),JSON[_0x80ef('0x1c')](_0x91439b,null,0x2));if(_0x91439b&&_0x25e62e[_0x91439b[_0x80ef('0x2b')]]){_0x52b3de=_0x25e62e[_0x91439b['agicommand']](_0x91439b);if(_0x52b3de){logger[_0x80ef('0x1a')](_0x80ef('0x31'),inspect(_0x52b3de));return _['isUndefined'](_0x52b3de[_0x80ef('0x2d')])?null:_0x52b3de[_0x80ef('0x2d')][_0x80ef('0x30')]();}else{logger['error'](_0x80ef('0x31'),inspect(_0x52b3de));return null;}}else{logger[_0x80ef('0x7')](_0x80ef('0x32'));return null;}}catch(_0x3665e5){logger[_0x80ef('0x7')](_0x3665e5[_0x80ef('0x9')]);return null;}});}logger['info'](util[_0x80ef('0x1e')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x48b1f9['arg_1'],_0x48b1f9[_0x80ef('0x24')],_0x48b1f9[_0x80ef('0x25')],_0x48b1f9[_0x80ef('0x35')],_0x48b1f9['uniqueid']));logger['info'](util[_0x80ef('0x1e')](_0x80ef('0x38'),_0x48b1f9[_0x80ef('0x28')],_0x48b1f9[_0x80ef('0x29')],parseInt(_0x48b1f9[_0x80ef('0x2a')],0xa)+0x1));_0x48b1f9[_0x80ef('0x39')](_0x48b1f9[_0x80ef('0x28')],_0x48b1f9[_0x80ef('0x29')],parseInt(_0x48b1f9[_0x80ef('0x2a')],0xa)+0x1);_0x48b1f9[_0x80ef('0x3a')]();}function handleNotFound(_0x112d48){logger[_0x80ef('0x7')](util[_0x80ef('0x1e')]('Project\x20%s\x20not\x20found',_0x112d48['arg_1']));_0x112d48[_0x80ef('0x39')](_0x112d48[_0x80ef('0x28')],_0x112d48[_0x80ef('0x29')],parseInt(_0x112d48['priority'],0xa)+0x1);_0x112d48[_0x80ef('0x3a')]();}function handleUnpublished(_0x14a184){logger['error'](util[_0x80ef('0x1e')](_0x80ef('0x3b'),_0x14a184['arg_1']));_0x14a184[_0x80ef('0x39')](_0x14a184[_0x80ef('0x28')],_0x14a184[_0x80ef('0x29')],parseInt(_0x14a184[_0x80ef('0x2a')],0xa)+0x1);_0x14a184[_0x80ef('0x3a')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index e578a7f..e895d30 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 _0xb458=['trim','emit','headers','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','_transform','toString','indexOf','substring','length','split','slice'];(function(_0x26c336,_0x584614){var _0x5f5d61=function(_0x419e84){while(--_0x419e84){_0x26c336['push'](_0x26c336['shift']());}};_0x5f5d61(++_0x584614);}(_0xb458,0xca));var _0x8b45=function(_0x44a074,_0x5f3ddb){_0x44a074=_0x44a074-0x0;var _0x2c44a4=_0xb458[_0x44a074];return _0x2c44a4;};'use strict';var util=require(_0x8b45('0x0'));var Transform=require(_0x8b45('0x1'))[_0x8b45('0x2')];function AGIReply(_0xa1c236){Transform['call'](this,_0xa1c236);this[_0x8b45('0x3')]='';this[_0x8b45('0x4')]=![];}util[_0x8b45('0x5')](AGIReply,Transform);AGIReply[_0x8b45('0x6')][_0x8b45('0x7')]=function(_0x15c798,_0x3f0efd,_0x35680c){var _0x2a5b3c='\x0a',_0x114de0=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x15dcf4=-0x1,_0x2f0c9e=-0x1,_0x1386a4='',_0x54f299=0x0,_0x122b6d='',_0x4c1403='';this[_0x8b45('0x3')]+=_0x15c798[_0x8b45('0x8')]();_0x122b6d=this[_0x8b45('0x3')];if(!this['_inBody']){_0x54f299=0x0;while(_0x114de0[_0x54f299]){while((_0x2f0c9e=_0x122b6d[_0x8b45('0x9')](_0x114de0[_0x54f299]))!=-0x1){_0x1386a4=_0x114de0[_0x54f299];_0x4c1403=_0x122b6d['substring'](0x0,_0x2f0c9e);_0x122b6d=_0x122b6d[_0x8b45('0xa')](_0x2f0c9e+_0x1386a4[_0x8b45('0xb')]);var _0x42b37e=_0x4c1403[_0x8b45('0xc')](_0x2a5b3c),_0x21f36e=0x0,_0x2d9102={},_0x54c03c='',_0x5559e7='',_0x46a6c4=-0x1;while(_0x42b37e[_0x21f36e]){_0x46a6c4=_0x42b37e[_0x21f36e][_0x8b45('0x9')](':');if(_0x46a6c4!=-0x1){_0x54c03c=_0x42b37e[_0x21f36e][_0x8b45('0xd')](0x0,_0x46a6c4)[_0x8b45('0xe')]();_0x5559e7=_0x42b37e[_0x21f36e][_0x8b45('0xd')](_0x46a6c4+0x1)[_0x8b45('0xe')]();if(_0x54c03c[_0x8b45('0xb')]>0x0){_0x2d9102[_0x54c03c]=_0x5559e7;}}else{}_0x21f36e++;}this[_0x8b45('0xf')](_0x8b45('0x10'),_0x2d9102);this[_0x8b45('0x4')]=!![];}_0x54f299++;}this[_0x8b45('0x3')]=_0x122b6d;}else{while((_0x15dcf4=_0x122b6d[_0x8b45('0x9')](_0x2a5b3c))!=-0x1){_0x4c1403=_0x122b6d[_0x8b45('0xa')](0x0,_0x15dcf4);this[_0x8b45('0xf')]('line',_0x4c1403);_0x122b6d=_0x122b6d['substring'](_0x15dcf4+_0x2a5b3c[_0x8b45('0xb')]);}this[_0x8b45('0x3')]=_0x122b6d;}_0x35680c();};module[_0x8b45('0x11')]=AGIReply; \ No newline at end of file +var _0x51a0=['Transform','call','_localBuffer','_inBody','inherits','prototype','toString','indexOf','substring','length','slice','trim','emit','line','exports','util','stream'];(function(_0x48a928,_0x430727){var _0x11c1e9=function(_0x338805){while(--_0x338805){_0x48a928['push'](_0x48a928['shift']());}};_0x11c1e9(++_0x430727);}(_0x51a0,0x1c9));var _0x051a=function(_0x1389ae,_0x1caf91){_0x1389ae=_0x1389ae-0x0;var _0x1514d4=_0x51a0[_0x1389ae];return _0x1514d4;};'use strict';var util=require(_0x051a('0x0'));var Transform=require(_0x051a('0x1'))[_0x051a('0x2')];function AGIReply(_0x1fe890){Transform[_0x051a('0x3')](this,_0x1fe890);this[_0x051a('0x4')]='';this[_0x051a('0x5')]=![];}util[_0x051a('0x6')](AGIReply,Transform);AGIReply[_0x051a('0x7')]['_transform']=function(_0x113283,_0x362618,_0x32f30e){var _0x23c6f8='\x0a',_0x3a3bb2=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x499a66=-0x1,_0x3931c0=-0x1,_0x174ba5='',_0x9ed027=0x0,_0x4a1a2d='',_0x45f629='';this['_localBuffer']+=_0x113283[_0x051a('0x8')]();_0x4a1a2d=this['_localBuffer'];if(!this[_0x051a('0x5')]){_0x9ed027=0x0;while(_0x3a3bb2[_0x9ed027]){while((_0x3931c0=_0x4a1a2d[_0x051a('0x9')](_0x3a3bb2[_0x9ed027]))!=-0x1){_0x174ba5=_0x3a3bb2[_0x9ed027];_0x45f629=_0x4a1a2d[_0x051a('0xa')](0x0,_0x3931c0);_0x4a1a2d=_0x4a1a2d[_0x051a('0xa')](_0x3931c0+_0x174ba5[_0x051a('0xb')]);var _0x443ee4=_0x45f629['split'](_0x23c6f8),_0x40c1fa=0x0,_0x336654={},_0xa6832f='',_0x5222e0='',_0x306126=-0x1;while(_0x443ee4[_0x40c1fa]){_0x306126=_0x443ee4[_0x40c1fa]['indexOf'](':');if(_0x306126!=-0x1){_0xa6832f=_0x443ee4[_0x40c1fa][_0x051a('0xc')](0x0,_0x306126)['trim']();_0x5222e0=_0x443ee4[_0x40c1fa]['slice'](_0x306126+0x1)[_0x051a('0xd')]();if(_0xa6832f[_0x051a('0xb')]>0x0){_0x336654[_0xa6832f]=_0x5222e0;}}else{}_0x40c1fa++;}this[_0x051a('0xe')]('headers',_0x336654);this['_inBody']=!![];}_0x9ed027++;}this[_0x051a('0x4')]=_0x4a1a2d;}else{while((_0x499a66=_0x4a1a2d[_0x051a('0x9')](_0x23c6f8))!=-0x1){_0x45f629=_0x4a1a2d[_0x051a('0xa')](0x0,_0x499a66);this[_0x051a('0xe')](_0x051a('0xf'),_0x45f629);_0x4a1a2d=_0x4a1a2d[_0x051a('0xa')](_0x499a66+_0x23c6f8[_0x051a('0xb')]);}this[_0x051a('0x4')]=_0x4a1a2d;}_0x32f30e();};module[_0x051a('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index d94ee8c..9f685a0 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 _0x28aa=['CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','PauseUser','UnpauseUser','agentLogout','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','ShowUser','getContactByPhone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','format','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId'];(function(_0x36ad71,_0x3f235d){var _0x45190d=function(_0x158e41){while(--_0x158e41){_0x36ad71['push'](_0x36ad71['shift']());}};_0x45190d(++_0x3f235d);}(_0x28aa,0xf8));var _0xa28a=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x28aa[_0x487b0c];return _0x1adbdc;};'use strict';var _=require('lodash');var moment=require(_0xa28a('0x0'));var jayson=require(_0xa28a('0x1'));var client=jayson[_0xa28a('0x2')][_0xa28a('0x3')]({'port':0x2329});function request(_0x46d694,_0x3227b6){return new Promise(function(_0x50ad8c,_0x3e0341){return client[_0xa28a('0x4')](_0x46d694,_0x3227b6)[_0xa28a('0x5')](function(_0x22966f){if(_0x22966f['error']){return _0x3e0341(_0x22966f[_0xa28a('0x6')][_0xa28a('0x7')]);}else{return _0x50ad8c(_0x22966f[_0xa28a('0x8')]);}})[_0xa28a('0x9')](function(_0x420947){return _0x3e0341(_0x420947);});});}exports[_0xa28a('0xa')]=function(){return request(_0xa28a('0xb'),{'options':{'raw':![],'attributes':['id',_0xa28a('0xc'),_0xa28a('0xd')]}});};exports[_0xa28a('0xe')]=function(_0x3e8701){return request(_0xa28a('0xf'),{'options':{'raw':![],'where':{'name':_0x3e8701},'attributes':[_0xa28a('0xd')]}});};exports[_0xa28a('0x10')]=function(_0x1d0a82){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x1d0a82},'include':[{'model':_0xa28a('0x11'),'as':_0xa28a('0x12'),'include':[{'model':_0xa28a('0x13'),'as':_0xa28a('0x13')}]}],'attributes':['id','name',_0xa28a('0x14')],'smtp':!![]}});};exports[_0xa28a('0x15')]=function(_0x59e606){return request(_0xa28a('0xf'),{'options':{'where':{'id':_0x59e606},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x16')]=function(_0x412e0d){return request(_0xa28a('0x17'),{'options':{'where':{'id':_0x412e0d},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x18')]=function(_0x11ef7c){return request(_0xa28a('0x19'),{'options':{'where':{'id':_0x11ef7c},'attributes':[_0xa28a('0xc')]}});};exports['getSquareOdbcById']=function(_0x3018cd){return request(_0xa28a('0x1a'),{'options':{'where':{'id':_0x3018cd},'attributes':[_0xa28a('0x1b')]}});};exports['getUserById']=function(_0x15d22f){return request(_0xa28a('0x1c'),{'options':{'where':{'id':_0x15d22f},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x1d')]=function(_0x1fc027){return request('GetContactByPhone',{'options':{'where':{'phone':_0x1fc027['phone']},'attributes':['id']}});};exports[_0xa28a('0x1e')]=function(_0x516340){return request('ShowTrunk',{'options':{'where':{'id':_0x516340},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x1f')]=function(_0x1f528c){return request(_0xa28a('0x20'),{'options':{'where':{'id':_0x1f528c},'attributes':[_0xa28a('0x21')]}});};exports[_0xa28a('0x22')]=function(_0x3b0c0f){return request(_0xa28a('0x23'),{'options':{'raw':![],'where':{'id':_0x3b0c0f},'include':[{'model':_0xa28a('0x24'),'as':_0xa28a('0x25')}]}});};exports[_0xa28a('0x26')]=function(_0x43bf00){return request('ShowSmsAccount',{'options':{'where':{'id':_0x43bf00},'attributes':['id',_0xa28a('0xc')]}});};exports[_0xa28a('0x27')]=function(_0x461ab4){return request('CreateSmsMessage',{'body':_0x461ab4});};exports[_0xa28a('0x28')]=function(_0x27d680){return request('CreateSquareDetailsReport',{'body':_0x27d680});};exports[_0xa28a('0x29')]=function(_0x19fff1){return request(_0xa28a('0x2a'),{'body':_[_0xa28a('0x2b')](_0x19fff1,{'project_name':_0x19fff1[_0xa28a('0x2c')],'prev_project_name':_0x19fff1['arg_2']||'','is_subproject':_0x19fff1['arg_2']?!![]:![],'leaveAt':moment()[_0xa28a('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xa28a('0x2e')]=function(_0x5f2579){return request('CreateSquareRecording',{'body':_0x5f2579});};exports[_0xa28a('0x2f')]=function(_0x3d0488){return request(_0xa28a('0x30'),{'body':_0x3d0488});};exports[_0xa28a('0x31')]=function(_0x5514f5){return request(_0xa28a('0x32'),{'options':{'raw':![],'where':{'phone':_0x5514f5['phone'],'ListId':_0x5514f5[_0xa28a('0x33')]}}})[_0xa28a('0x5')](function(_0x2b029f){if(_0x2b029f){return _0x2b029f;}return request(_0xa28a('0x34'),{'body':_0x5514f5});});};exports[_0xa28a('0x35')]=function(_0x271925){return request(_0xa28a('0x36'),{'options':{'where':{'id':_0x271925},'attributes':[_0xa28a('0xc')]}});};exports[_0xa28a('0x37')]=function(_0x392d14,_0x5e53d1){return request('LoginUser',{'body':{'interface':_0x5e53d1},'options':{'where':_0x392d14}});};exports[_0xa28a('0x38')]=function(_0x58d32a,_0x1facc7,_0x402af4){return request(_0xa28a('0x39'),{'body':{'type':_0x1facc7,'uniqueid':_0x402af4},'options':{'where':_0x58d32a}});};exports['agentUnpause']=function(_0x43b068){return request(_0xa28a('0x3a'),{'body':{},'options':{'where':_0x43b068}});};exports[_0xa28a('0x3b')]=function(_0x4060af){return request('LogoutUser',{'body':{},'options':{'where':_0x4060af}});}; \ No newline at end of file +var _0x6282=['error','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','GetContactByPhone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','request','then'];(function(_0x5d5198,_0x541d1f){var _0x59db1a=function(_0x36d06f){while(--_0x36d06f){_0x5d5198['push'](_0x5d5198['shift']());}};_0x59db1a(++_0x541d1f);}(_0x6282,0x76));var _0x2628=function(_0x5e0416,_0x541afd){_0x5e0416=_0x5e0416-0x0;var _0x3dfc48=_0x6282[_0x5e0416];return _0x3dfc48;};'use strict';var _=require(_0x2628('0x0'));var moment=require(_0x2628('0x1'));var jayson=require(_0x2628('0x2'));var client=jayson[_0x2628('0x3')]['http']({'port':0x2329});function request(_0x50e40f,_0x126d9a){return new Promise(function(_0xc5c0c7,_0x5eb31b){return client[_0x2628('0x4')](_0x50e40f,_0x126d9a)[_0x2628('0x5')](function(_0x3937c5){if(_0x3937c5[_0x2628('0x6')]){return _0x5eb31b(_0x3937c5[_0x2628('0x6')]['message']);}else{return _0xc5c0c7(_0x3937c5[_0x2628('0x7')]);}})[_0x2628('0x8')](function(_0x2170a7){return _0x5eb31b(_0x2170a7);});});}exports[_0x2628('0x9')]=function(){return request(_0x2628('0xa'),{'options':{'raw':![],'attributes':['id',_0x2628('0xb'),_0x2628('0xc')]}});};exports[_0x2628('0xd')]=function(_0x3f9015){return request(_0x2628('0xe'),{'options':{'raw':![],'where':{'name':_0x3f9015},'attributes':[_0x2628('0xc')]}});};exports[_0x2628('0xf')]=function(_0x17c835){return request(_0x2628('0x10'),{'options':{'raw':![],'where':{'id':_0x17c835},'include':[{'model':_0x2628('0x11'),'as':'Smtp','include':[{'model':'CloudProvider','as':_0x2628('0x12')}]}],'attributes':['id',_0x2628('0xb'),_0x2628('0x13')],'smtp':!![]}});};exports[_0x2628('0x14')]=function(_0x5d0a32){return request('ShowSquareProject',{'options':{'where':{'id':_0x5d0a32},'attributes':[_0x2628('0xb')]}});};exports[_0x2628('0x15')]=function(_0x4d2cfb){return request(_0x2628('0x16'),{'options':{'where':{'id':_0x4d2cfb},'attributes':[_0x2628('0xb')]}});};exports['getVariableById']=function(_0x645884){return request(_0x2628('0x17'),{'options':{'where':{'id':_0x645884},'attributes':[_0x2628('0xb')]}});};exports['getSquareOdbcById']=function(_0x13a728){return request(_0x2628('0x18'),{'options':{'where':{'id':_0x13a728},'attributes':['dsn']}});};exports[_0x2628('0x19')]=function(_0x4c2a10){return request(_0x2628('0x1a'),{'options':{'where':{'id':_0x4c2a10},'attributes':[_0x2628('0xb')]}});};exports['getContactByPhone']=function(_0x2a6bed){return request(_0x2628('0x1b'),{'options':{'where':{'phone':_0x2a6bed['phone']},'attributes':['id']}});};exports[_0x2628('0x1c')]=function(_0x532d6d){return request(_0x2628('0x1d'),{'options':{'where':{'id':_0x532d6d},'attributes':['name']}});};exports['getSoundById']=function(_0xcf0862){return request(_0x2628('0x1e'),{'options':{'where':{'id':_0xcf0862},'attributes':[_0x2628('0x1f')]}});};exports[_0x2628('0x20')]=function(_0x1640b2){return request(_0x2628('0x21'),{'options':{'raw':![],'where':{'id':_0x1640b2},'include':[{'model':_0x2628('0x22'),'as':_0x2628('0x23')}]}});};exports[_0x2628('0x24')]=function(_0x57a799){return request(_0x2628('0x25'),{'options':{'where':{'id':_0x57a799},'attributes':['id',_0x2628('0xb')]}});};exports[_0x2628('0x26')]=function(_0x3904cb){return request(_0x2628('0x27'),{'body':_0x3904cb});};exports['createSquareDetailsReport']=function(_0xf65ef8){return request(_0x2628('0x28'),{'body':_0xf65ef8});};exports[_0x2628('0x29')]=function(_0xfc2210){return request(_0x2628('0x2a'),{'body':_['merge'](_0xfc2210,{'project_name':_0xfc2210['arg_1'],'prev_project_name':_0xfc2210[_0x2628('0x2b')]||'','is_subproject':_0xfc2210[_0x2628('0x2b')]?!![]:![],'leaveAt':moment()[_0x2628('0x2c')](_0x2628('0x2d'))})});};exports[_0x2628('0x2e')]=function(_0x571711){return request(_0x2628('0x2f'),{'body':_0x571711});};exports[_0x2628('0x30')]=function(_0xaa308b){return request(_0x2628('0x31'),{'body':_0xaa308b});};exports[_0x2628('0x32')]=function(_0x118e75){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x118e75['phone'],'ListId':_0x118e75[_0x2628('0x33')]}}})[_0x2628('0x5')](function(_0x3d98a7){if(_0x3d98a7){return _0x3d98a7;}return request(_0x2628('0x34'),{'body':_0x118e75});});};exports['getPauseById']=function(_0x17bc01){return request(_0x2628('0x35'),{'options':{'where':{'id':_0x17bc01},'attributes':[_0x2628('0xb')]}});};exports[_0x2628('0x36')]=function(_0x4b5938,_0x2a9cf0){return request(_0x2628('0x37'),{'body':{'interface':_0x2a9cf0},'options':{'where':_0x4b5938}});};exports[_0x2628('0x38')]=function(_0x19530e,_0x515f29,_0x24e688){return request(_0x2628('0x39'),{'body':{'type':_0x515f29,'uniqueid':_0x24e688},'options':{'where':_0x19530e}});};exports[_0x2628('0x3a')]=function(_0x4443c5){return request(_0x2628('0x3b'),{'body':{},'options':{'where':_0x4443c5}});};exports[_0x2628('0x3c')]=function(_0x23b271){return request(_0x2628('0x3d'),{'body':{},'options':{'where':_0x23b271}});}; \ 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 66a7408..c325969 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 _0x0689=['./lex'];(function(_0x2b5aea,_0xeb8e){var _0x17efd5=function(_0x5656bc){while(--_0x5656bc){_0x2b5aea['push'](_0x2b5aea['shift']());}};_0x17efd5(++_0xeb8e);}(_0x0689,0x161));var _0x9068=function(_0x53673d,_0x1bff0a){_0x53673d=_0x53673d-0x0;var _0x4ea690=_0x0689[_0x53673d];return _0x4ea690;};var polly=require('./polly');var lex=require(_0x9068('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xa992=['./polly','./lex','exports'];(function(_0x4d1c00,_0x449133){var _0x239935=function(_0x5badfd){while(--_0x5badfd){_0x4d1c00['push'](_0x4d1c00['shift']());}};_0x239935(++_0x449133);}(_0xa992,0x18c));var _0x2a99=function(_0x46d7cf,_0x525798){_0x46d7cf=_0x46d7cf-0x0;var _0x48d2c4=_0xa992[_0x46d7cf];return _0x48d2c4;};var polly=require(_0x2a99('0x0'));var lex=require(_0x2a99('0x1'));module[_0x2a99('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 c14fc11..4ea1dbc 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(_0x4b4865,_0xb43449){_0x4b4865=_0x4b4865-0x0;var _0x190dc2=_0x6324[_0x4b4865];return _0x190dc2;};'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 _0x13f6=['./lib/api','exports'];(function(_0x74e5b4,_0x496d09){var _0x513253=function(_0x131bf4){while(--_0x131bf4){_0x74e5b4['push'](_0x74e5b4['shift']());}};_0x513253(++_0x496d09);}(_0x13f6,0x124));var _0x613f=function(_0x1247d8,_0x47a0ad){_0x1247d8=_0x1247d8-0x0;var _0x2502db=_0x13f6[_0x1247d8];return _0x2502db;};'use strict';var lex=require(_0x613f('0x0'));module[_0x613f('0x1')]=function(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff){return lex(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff);}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index 54e238b..dc6fefd 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(_0x2321b4,_0x188dea){var _0x35d849=function(_0x4e99e2){while(--_0x4e99e2){_0x2321b4['push'](_0x2321b4['shift']());}};_0x35d849(++_0x188dea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x4d5f4f,_0x354d39){var _0x40fc76=function(_0x31b4c4){while(--_0x31b4c4){_0x4d5f4f['push'](_0x4d5f4f['shift']());}};_0x40fc76(++_0x354d39);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 de6ce38..49514be 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 _0x5bc3=['./lib/api'];(function(_0x16f047,_0x1b64b8){var _0x4f63e5=function(_0x2b4429){while(--_0x2b4429){_0x16f047['push'](_0x16f047['shift']());}};_0x4f63e5(++_0x1b64b8);}(_0x5bc3,0x1e5));var _0x35bc=function(_0x17df0b,_0x4eb806){_0x17df0b=_0x17df0b-0x0;var _0x535e65=_0x5bc3[_0x17df0b];return _0x535e65;};'use strict';var polly=require(_0x35bc('0x0'));module['exports']=function(_0x51e793,_0x520304,_0x4fca76,_0x2a8612,_0x43b886,_0x3e542d,_0xa053c){return polly(_0x51e793,_0x520304,_0x4fca76,_0x2a8612,_0x43b886,_0x3e542d,_0xa053c);}; \ No newline at end of file +var _0x8ced=['exports','./lib/api'];(function(_0x5e6a01,_0x4475c0){var _0x4308ce=function(_0x10f4d1){while(--_0x10f4d1){_0x5e6a01['push'](_0x5e6a01['shift']());}};_0x4308ce(++_0x4475c0);}(_0x8ced,0x161));var _0xd8ce=function(_0x30584f,_0x4a1f96){_0x30584f=_0x30584f-0x0;var _0x2a31e1=_0x8ced[_0x30584f];return _0x2a31e1;};'use strict';var polly=require(_0xd8ce('0x0'));module[_0xd8ce('0x1')]=function(_0xc1fc97,_0x334077,_0x12381b,_0x464ec3,_0x1c3bb3,_0x51b1b8,_0x2e7aef){return polly(_0xc1fc97,_0x334077,_0x12381b,_0x464ec3,_0x1c3bb3,_0x51b1b8,_0x2e7aef);}; \ 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 f72da59..17f7e8b 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 _0xa9a1=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','bluebird','randomstring','AudioStream','writeFile'];(function(_0x577ce8,_0x3aab34){var _0x206ab9=function(_0x1280e8){while(--_0x1280e8){_0x577ce8['push'](_0x577ce8['shift']());}};_0x206ab9(++_0x3aab34);}(_0xa9a1,0x176));var _0x1a9a=function(_0xab0049,_0x7718cf){_0xab0049=_0xab0049-0x0;var _0x97eb5c=_0xa9a1[_0xab0049];return _0x97eb5c;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x1a9a('0x0'));var rs=require(_0x1a9a('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x4f7322,_0x188f70,_0x2503c2){return new BPromise(function(_0x170e05,_0x3da318){_0x4f7322['synthesizeSpeech'](_0x188f70,function(_0x3f2282,_0x592ae4){if(_0x3f2282){_0x3da318(_0x3f2282);}else if(_0x592ae4){if(_0x592ae4[_0x1a9a('0x2')]instanceof Buffer){fs[_0x1a9a('0x3')](_0x2503c2,_0x592ae4[_0x1a9a('0x2')],function(_0x5378e4){if(_0x5378e4){_0x3da318(_0x5378e4);}else{_0x170e05();}});}else{_0x3da318(new Error(_0x1a9a('0x4')));}}else{_0x3da318(new Error(_0x1a9a('0x5')));}});});}module[_0x1a9a('0x6')]=function(_0x2ca0c6,_0x19bf55,_0x15e9b0,_0x575117,_0x8852ad,_0x52b27d,_0x2200d9){var _0x4d7f52=new AWS['Polly']({'accessKeyId':_0x2ca0c6,'secretAccessKey':_0x19bf55,'region':_0x15e9b0});var _0x36fc42={'Text':_0x8852ad,'TextType':_0x52b27d||_0x1a9a('0x7'),'OutputFormat':_0x1a9a('0x8'),'VoiceId':_0x575117};return pollyResult(_0x4d7f52,_0x36fc42,_0x2200d9);}; \ No newline at end of file +var _0x0360=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0360,0xad));var _0x0036=function(_0x5639b1,_0x1b4b77){_0x5639b1=_0x5639b1-0x0;var _0x2760b0=_0x0360[_0x5639b1];return _0x2760b0;};'use strict';var fs=require('fs');var path=require(_0x0036('0x0'));var BPromise=require(_0x0036('0x1'));var rs=require('randomstring');var AWS=require(_0x0036('0x2'));function pollyResult(_0x3ede78,_0x2830e2,_0x3d89bb){return new BPromise(function(_0x4c60e9,_0x423e30){_0x3ede78['synthesizeSpeech'](_0x2830e2,function(_0x313a20,_0xe5daeb){if(_0x313a20){_0x423e30(_0x313a20);}else if(_0xe5daeb){if(_0xe5daeb[_0x0036('0x3')]instanceof Buffer){fs[_0x0036('0x4')](_0x3d89bb,_0xe5daeb[_0x0036('0x3')],function(_0x56f251){if(_0x56f251){_0x423e30(_0x56f251);}else{_0x4c60e9();}});}else{_0x423e30(new Error(_0x0036('0x5')));}}else{_0x423e30(new Error(_0x0036('0x6')));}});});}module[_0x0036('0x7')]=function(_0x1ff462,_0x1c2a23,_0x24a92d,_0x1ed1ff,_0x4fd86c,_0x351763,_0x13224e){var _0x503fb6=new AWS[(_0x0036('0x8'))]({'accessKeyId':_0x1ff462,'secretAccessKey':_0x1c2a23,'region':_0x24a92d});var _0xf60942={'Text':_0x4fd86c,'TextType':_0x351763||_0x0036('0x9'),'OutputFormat':_0x0036('0xa'),'VoiceId':_0x1ed1ff};return pollyResult(_0x503fb6,_0xf60942,_0x13224e);}; \ 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 9be4444..6a35413 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 _0x3e11=['./lib/api','exports'];(function(_0xc7ed29,_0x515330){var _0xf8da19=function(_0x1bd99c){while(--_0x1bd99c){_0xc7ed29['push'](_0xc7ed29['shift']());}};_0xf8da19(++_0x515330);}(_0x3e11,0x18c));var _0x13e1=function(_0x4a4629,_0x3b4f1b){_0x4a4629=_0x4a4629-0x0;var _0xa544fb=_0x3e11[_0x4a4629];return _0xa544fb;};'use strict';var asr=require(_0x13e1('0x0'));module[_0x13e1('0x1')]=function(_0x543943,_0x380f42,_0xc7d421,_0x5452fe){return asr(_0x543943,_0x380f42,_0xc7d421);}; \ No newline at end of file +var _0x5992=['./lib/api'];(function(_0xc1fa4d,_0x5ee29f){var _0x27ab09=function(_0x134f7d){while(--_0x134f7d){_0xc1fa4d['push'](_0xc1fa4d['shift']());}};_0x27ab09(++_0x5ee29f);}(_0x5992,0x111));var _0x2599=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x5992[_0x1d9aa0];return _0x226868;};'use strict';var asr=require(_0x2599('0x0'));module['exports']=function(_0x326271,_0x7b7a61,_0x189ffb,_0x37c6ee){return asr(_0x326271,_0x7b7a61,_0x189ffb);}; \ 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 d9dc759..a0c484c 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 _0x2209=['bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','LINEAR16','8000','url'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2209,0x95));var _0x9220=function(_0x3cfc68,_0x9f3031){_0x3cfc68=_0x3cfc68-0x0;var _0x407e04=_0x2209[_0x3cfc68];return _0x407e04;};'use strict';var url=require(_0x9220('0x0'));var BPromise=require(_0x9220('0x1'));var fs=require('fs');var host=_0x9220('0x2');module[_0x9220('0x3')]=function(_0x29dc9b,_0x5d3fe2,_0x2b23aa){return new BPromise(function(_0x5cc72c,_0x348220){var _0x2fddae;if(typeof _0x29dc9b!==_0x9220('0x4')||_0x29dc9b[_0x9220('0x5')]===0x0){return _0x348220(_0x9220('0x6'));}if(typeof _0x5d3fe2!==_0x9220('0x4')||_0x5d3fe2[_0x9220('0x5')]===0x0){return _0x348220(_0x9220('0x7'));}if(typeof _0x2b23aa!==_0x9220('0x8')&&(typeof _0x2b23aa!=='string'||_0x2b23aa[_0x9220('0x5')]===0x0)){return _0x348220(_0x9220('0x9'));}try{_0x2fddae=fs['readFileSync'](_0x29dc9b)[_0x9220('0xa')](_0x9220('0xb'));}catch(_0x18550a){return _0x348220(_0x18550a);}return _0x5cc72c({'method':_0x9220('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x5d3fe2,'body':{'config':{'encoding':_0x9220('0xd'),'sampleRateHertz':_0x9220('0xe'),'languageCode':_0x2b23aa},'audio':{'content':_0x2fddae}},'json':!![]});});}; \ No newline at end of file +var _0xf2a6=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','string'];(function(_0x18cac4,_0x57a4d5){var _0x2227c6=function(_0x72934d){while(--_0x72934d){_0x18cac4['push'](_0x18cac4['shift']());}};_0x2227c6(++_0x57a4d5);}(_0xf2a6,0x13d));var _0x6f2a=function(_0x1b6f6a,_0x197170){_0x1b6f6a=_0x1b6f6a-0x0;var _0x2d2830=_0xf2a6[_0x1b6f6a];return _0x2d2830;};'use strict';var url=require(_0x6f2a('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x1b32c0,_0x5b2cbc,_0x3b14e2){return new BPromise(function(_0xf60faa,_0x454ff7){var _0x32ddb6;if(typeof _0x1b32c0!==_0x6f2a('0x1')||_0x1b32c0[_0x6f2a('0x2')]===0x0){return _0x454ff7(_0x6f2a('0x3'));}if(typeof _0x5b2cbc!==_0x6f2a('0x1')||_0x5b2cbc[_0x6f2a('0x2')]===0x0){return _0x454ff7(_0x6f2a('0x4'));}if(typeof _0x3b14e2!=='undefined'&&(typeof _0x3b14e2!==_0x6f2a('0x1')||_0x3b14e2[_0x6f2a('0x2')]===0x0)){return _0x454ff7(_0x6f2a('0x5'));}try{_0x32ddb6=fs[_0x6f2a('0x6')](_0x1b32c0)['toString'](_0x6f2a('0x7'));}catch(_0x5663e2){return _0x454ff7(_0x5663e2);}return _0xf60faa({'method':_0x6f2a('0x8'),'uri':host+_0x6f2a('0x9')+_0x5b2cbc,'body':{'config':{'encoding':_0x6f2a('0xa'),'sampleRateHertz':'8000','languageCode':_0x3b14e2},'audio':{'content':_0x32ddb6}},'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 b03f814..10cb4be 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 _0x2223=['exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2223,0x84));var _0x3222=function(_0x4cb348,_0x3c0cd1){_0x4cb348=_0x4cb348-0x0;var _0xd2944b=_0x2223[_0x4cb348];return _0xd2944b;};var asr=require('./asr');module[_0x3222('0x0')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 5990716..ea9586b 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 _0x585d=['isFallbackIntent','googleDialogflowV2','replace','sessionPath','length','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','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','CustomActionData','AudioFromTts','Data','dirName','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./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','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','data','wav','error\x20convert','resolve','tmp','generate','.wav','base64','then','chmodSync','777','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','POST','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','null','slice','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','speech','score','code','metadata'];(function(_0x5d2df1,_0x3e9282){var _0x349ae3=function(_0x4ca58e){while(--_0x4ca58e){_0x5d2df1['push'](_0x5d2df1['shift']());}};_0x349ae3(++_0x3e9282);}(_0x585d,0x138));var _0xd585=function(_0x271ebd,_0x1c24ac){_0x271ebd=_0x271ebd-0x0;var _0x313e1d=_0x585d[_0x271ebd];return _0x313e1d;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xd585('0x0'));var dialogflow=require(_0xd585('0x1'));var fs=require('fs');var http=require(_0xd585('0x2'));var https=require(_0xd585('0x3'));var md5=require(_0xd585('0x4'));var path=require(_0xd585('0x5'));var querystring=require(_0xd585('0x6'));var rp=require(_0xd585('0x7'));var rs=require(_0xd585('0x8'));var sox=require(_0xd585('0x9'));var tts=require(_0xd585('0xa'));var urlParse=require('url')[_0xd585('0xb')];var util=require(_0xd585('0xc'));var aws=require(_0xd585('0xd'));var google=require(_0xd585('0xe'));var sestek=require(_0xd585('0xf'));var tilde=require(_0xd585('0x10'));var logger=require(_0xd585('0x11'))(_0xd585('0x12'));var ISPEECH_API=_0xd585('0x13');function downloadFile(_0x24c670,_0x41e8d0){return new BPromise(function(_0x27a760,_0x1d5e91){var _0x535935=urlParse(_0x24c670);var _0x2696f9=_0x535935[_0xd585('0x14')]===_0xd585('0x15')?https:http;var _0x5b824f={'host':_0x535935[_0xd585('0x16')],'path':_0x535935['path'],'headers':{'user-agent':_0xd585('0x17')}};_0x2696f9[_0xd585('0x18')](_0x5b824f,function(_0x180394){if(_0x180394[_0xd585('0x19')]!==0xc8){logger[_0xd585('0x1a')](_0xd585('0x1b')+_0x24c670+_0xd585('0x1c')+_0x180394[_0xd585('0x19')]+'\x20('+_0x180394[_0xd585('0x1d')]+')');_0x1d5e91(new Error('request\x20to\x20'+_0x24c670+'\x20failed,\x20status\x20code\x20=\x20'+_0x180394[_0xd585('0x19')]+'\x20('+_0x180394[_0xd585('0x1d')]+')'));return;}var _0x264765=fs[_0xd585('0x1e')](_0x41e8d0);_0x264765['on'](_0xd585('0x1f'),function(){logger[_0xd585('0x20')](_0xd585('0x21'));_0x264765[_0xd585('0x22')](_0x27a760);});_0x264765['on'](_0xd585('0x1a'),function(_0x519b7a){fs[_0xd585('0x23')](_0x41e8d0);logger[_0xd585('0x1a')](_0xd585('0x24'),_0x519b7a);_0x1d5e91(_0x519b7a);});_0x180394[_0xd585('0x25')](_0x264765);})['on'](_0xd585('0x1a'),function(_0x3c7708){logger[_0xd585('0x1a')](_0x3c7708);_0x1d5e91(_0x3c7708);})[_0xd585('0x26')]();});}function uploadFile(_0x10daaa){return new BPromise(function(_0x2c73b1,_0x3eeb11){var _0xc32a11=urlParse(_0x10daaa);var _0x209fcf=_0xc32a11[_0xd585('0x14')]===_0xd585('0x15')?https:http;var _0x1bceeb={'host':_0xc32a11[_0xd585('0x16')],'path':_0xc32a11[_0xd585('0x5')],'headers':{'user-agent':'WHAT_EVER'}};_0x209fcf['get'](_0x1bceeb,function(_0x18ea7d){if(_0x18ea7d[_0xd585('0x19')]!==0xc8){_0x3eeb11(new Error(_0xd585('0x1b')+_0x10daaa+'\x20failed,\x20status\x20code\x20=\x20'+_0x18ea7d[_0xd585('0x19')]+'\x20('+_0x18ea7d[_0xd585('0x1d')]+')'));return;}var _0x6aa165='';_0x18ea7d['on'](_0xd585('0x27'),function(_0x588edf){_0x6aa165+=_0x588edf;});_0x18ea7d['on'](_0xd585('0x26'),function(){_0x2c73b1(_0x6aa165);});})['on'](_0xd585('0x1a'),function(_0x502877){_0x3eeb11(_0x502877);})[_0xd585('0x26')]();});}function convertFile(_0x545adf,_0x5e49f6){return new BPromise(function(_0x1eee99,_0x2a3c22){var _0x1b36ca=sox['transcode'](_0x545adf,_0x5e49f6,{'sampleRate':0x1f40,'format':_0xd585('0x28'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1b36ca['on']('error',function(_0x566ed2){logger[_0xd585('0x1a')](_0xd585('0x29'),_0x566ed2);_0x2a3c22(_0x566ed2);});_0x1b36ca['on']('end',function(){logger[_0xd585('0x20')]('finish\x20to\x20convert');_0x1eee99();});_0x1b36ca['start']();});}function base64Decode(_0x4b8de0,_0x443502){var _0x4a1ca9=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x2d'));fs['writeFileSync'](_0x4a1ca9,_0x4b8de0,_0xd585('0x2e'));return convertFile(_0x4a1ca9,_0x443502)[_0xd585('0x2f')](function(){try{fs[_0xd585('0x23')](_0x4a1ca9);fs[_0xd585('0x30')](_0x443502,_0xd585('0x31'));}catch(_0x4623fb){logger[_0xd585('0x1a')](_0x4623fb);}return _0x443502['split']('.')[0x0];});}function base64Encode(_0x3425f4){var _0x39a5aa=fs['readFileSync'](_0x3425f4);return new Buffer(_0x39a5aa)[_0xd585('0x32')]('base64');}exports[_0xd585('0x33')]=function(_0x1dd30e,_0x3f3f4e,_0x441708,_0xb53abd,_0x3a606a,_0x378208){var _0xdab588,_0x3f578d;var _0x3c2f6c=_0xd585('0x34');var _0x335029=_0xd585('0x35')+_0x1dd30e;var _0x33b318={};if(_0x3f3f4e===_0xd585('0x36')){_0x33b318[_0xd585('0x37')]={'ssml':_0x441708};}else{_0x33b318[_0xd585('0x37')]={'text':_0x441708};};_0x33b318[_0xd585('0x38')]={'languageCode':_0xb53abd,'ssmlGender':_0x3a606a};_0x33b318[_0xd585('0x39')]={'audioEncoding':_0xd585('0x3a'),'sampleRateHertz':0x1f40};var _0x462420={'url':_0x3c2f6c+'text:synthesize'+_0x335029,'method':_0xd585('0x3b'),'json':!![],'body':_0x33b318};return rp(_0x462420)[_0xd585('0x2f')](function(_0x17235f){return new BPromise(function(_0x40b19c,_0x2e05c9){_0xdab588=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs['generate'](0x4)+_0xd585('0x3c'));var _0x5e220b=Buffer[_0xd585('0x3d')](_0x17235f[_0xd585('0x3e')],_0xd585('0x2e'));return fs[_0xd585('0x3f')](_0xdab588,_0x5e220b,function(_0x186642){_0x2e05c9(_0x186642);},function(_0x5ecc24){fs[_0xd585('0x30')](_0xdab588,_0xd585('0x31'));_0x40b19c(_0x5ecc24);});});})[_0xd585('0x2f')](function(_0x5179c0){_0x3f578d=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x2d'));return convertFile(_0xdab588,_0x3f578d);})['then'](function(){try{fs[_0xd585('0x23')](_0xdab588);fs[_0xd585('0x30')](_0x3f578d,_0xd585('0x31'));}catch(_0x1b0e05){logger[_0xd585('0x1a')](_0x1b0e05);}logger[_0xd585('0x20')](_0xd585('0x40'),_0x3f578d[_0xd585('0x41')]('.')[0x0]);return _0x3f578d['split']('.')[0x0];});};exports[_0xd585('0x42')]=function(_0x4011fa,_0x4c9b59){var _0x28ebb4=_0xd585('0x43');var _0x1f77fc,_0xfa9d68;var _0x5161fc;var _0x509d2e={'encoding':_0xd585('0x44'),'method':_0xd585('0x3b'),'timeout':0x2710,'url':_0x28ebb4,'headers':{'Content-Type':_0xd585('0x45')},'body':_0xd585('0x46')+encodeURIComponent(JSON[_0xd585('0x47')]([[[_0xd585('0x48'),JSON[_0xd585('0x47')]([_0x4011fa,_0x4c9b59||'en',![],_0xd585('0x49')]),null,'generic']]]))};return rp(_0x509d2e)[_0xd585('0x2f')](function(_0x214e2b){try{_0x5161fc=eval(_0x214e2b[_0xd585('0x4a')](0x5))[0x0][0x2];}catch(_0x5ae52f){throw new Error('parse\x20response\x20failed:\x0a'+_0x214e2b[_0xd585('0x27')]);}if(!_0x5161fc){if(_0x4011fa['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x4c9b59+_0xd585('0x4b'));}}try{_0x5161fc=eval(_0x5161fc)[0x0];}catch(_0x3f43a1){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xd585('0x27')]);}const _0x3260d3=_0x5161fc;_0x1f77fc=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x3c'));fs['writeFileSync'](_0x1f77fc,_0x5161fc,{'encoding':_0xd585('0x2e')});_0xfa9d68=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x2d'));return convertFile(_0x1f77fc,_0xfa9d68);})[_0xd585('0x2f')](function(){try{fs[_0xd585('0x23')](_0x1f77fc);fs['chmodSync'](_0xfa9d68,_0xd585('0x31'));}catch(_0x41d473){logger['error'](_0x41d473);}logger[_0xd585('0x20')](_0xd585('0x4c'),_0xfa9d68[_0xd585('0x41')]('.')[0x0]);return _0xfa9d68['split']('.')[0x0];});};exports[_0xd585('0x4d')]=function(_0x5e262b,_0x23e47d,_0x18ff55){return google[_0xd585('0x4e')](_0x5e262b,_0x23e47d,_0x18ff55)[_0xd585('0x2f')](function(_0x1b972a){logger[_0xd585('0x20')](_0x1b972a['uri']);return rp(_0x1b972a);})[_0xd585('0x2f')](function(_0x496135){var _0x3085d1='';var _0x1ce46b=0x0;try{fs[_0xd585('0x23')](_0x5e262b);}catch(_0x40497f){logger['error'](_0x40497f);}if(_0x496135&&_0x496135[_0xd585('0x4f')]){_0x3085d1=_0x496135[_0xd585('0x4f')]['map'](function(_0x3c1519){return _0x3c1519&&_0x3c1519[_0xd585('0x50')][0x0]&&_0x3c1519['alternatives'][0x0][_0xd585('0x51')]?_0x3c1519[_0xd585('0x50')][0x0][_0xd585('0x51')]:'';})[_0xd585('0x52')]('\x0a');_0x1ce46b=_0x496135[_0xd585('0x4f')][_0xd585('0x53')](function(_0x3ae23a){return _0x3ae23a&&_0x3ae23a[_0xd585('0x50')][0x0]&&_0x3ae23a['alternatives'][0x0]['confidence']?_0x3ae23a[_0xd585('0x50')][0x0][_0xd585('0x54')]:0x0;})[_0xd585('0x52')]('\x0a');}logger['info'](_0xd585('0x55'),_0x3085d1);logger['info'](_0xd585('0x56'),_0x1ce46b);return{'transcript':_0x3085d1,'confidence':_0x1ce46b};})['catch'](function(_0x14f83b){logger[_0xd585('0x1a')]('[%s]\x20%s:%s',_0x14f83b['statusCode'],_0x14f83b['name'],_0x14f83b[_0xd585('0x57')]);});};exports[_0xd585('0x58')]=function(_0x52f360,_0x1ea78e,_0x3202a0,_0x269e14){var _0x719b9e=apiai(_0x1ea78e,{'language':_0x269e14||'en'});return _0x719b9e[_0xd585('0x59')](_0x3202a0,{'sessionId':md5(_0x52f360)})[_0xd585('0x2f')](function(_0x45a912){logger[_0xd585('0x20')](JSON[_0xd585('0x47')](_0x45a912));return{'source':_0x45a912[_0xd585('0x5a')][_0xd585('0x5b')],'resolvedQuery':_0x45a912['result'][_0xd585('0x5c')],'action':_0x45a912[_0xd585('0x5a')][_0xd585('0x5d')],'actionIncomplete':_0x45a912[_0xd585('0x5a')][_0xd585('0x5e')],'speech':_0x45a912['result']['fulfillment'][_0xd585('0x5f')],'score':_0x45a912[_0xd585('0x5a')][_0xd585('0x60')],'statusCode':_0x45a912['status'][_0xd585('0x61')],'endConversation':_0x45a912[_0xd585('0x5a')][_0xd585('0x62')]['endConversation']||![],'isFallbackIntent':_0x45a912[_0xd585('0x5a')]['metadata'][_0xd585('0x63')]};});};exports[_0xd585('0x64')]=function(_0x3a7fe2,_0x3ad33b,_0x398f79,_0x123376,_0x20f596,_0x11facb){var _0x499723=_0x123376[_0xd585('0x65')](/\\n/g,'\x0a');var _0x4fee2c={'credentials':{'private_key':_0x499723,'client_email':_0x398f79}};var _0x32adf7=new dialogflow['SessionsClient'](_0x4fee2c);var _0xa44998=_0x32adf7[_0xd585('0x66')](_0x3ad33b,md5(_0x3a7fe2));var _0x4926ad={'session':_0xa44998,'queryInput':{'text':{'text':_0x20f596,'languageCode':_0x11facb}}};return _0x32adf7['detectIntent'](_0x4926ad)['then'](function(_0x276d97){if(_0x276d97&&_0x276d97[_0xd585('0x67')]){logger[_0xd585('0x20')](_0xd585('0x68'),JSON['stringify'](_0x276d97));var _0x37ccc4=_0x276d97[0x0];if(_0x37ccc4){var _0x3f8b6a={'action':_0x37ccc4[_0xd585('0x69')]['action'],'allRequiredParamsPresent':_0x37ccc4[_0xd585('0x69')][_0xd585('0x6a')],'endConversation':_0x37ccc4['queryResult'][_0xd585('0x6b')]&&_0x37ccc4[_0xd585('0x69')]['diagnosticInfo']['fields']?_0x37ccc4[_0xd585('0x69')][_0xd585('0x6b')][_0xd585('0x6c')][_0xd585('0x6d')][_0xd585('0x6e')]:![],'fulfillmentText':_0x37ccc4[_0xd585('0x69')][_0xd585('0x6f')],'intentName':_0x37ccc4[_0xd585('0x69')][_0xd585('0x70')][_0xd585('0x71')],'intentDisplayName':_0x37ccc4[_0xd585('0x69')]['intent'][_0xd585('0x72')],'isFallbackIntent':_0x37ccc4['queryResult'][_0xd585('0x70')]['isFallback'],'languageCode':_0x37ccc4[_0xd585('0x69')][_0xd585('0x73')],'queryText':_0x37ccc4[_0xd585('0x69')][_0xd585('0x74')],'responseId':_0x37ccc4[_0xd585('0x75')],'score':_0x37ccc4['queryResult'][_0xd585('0x76')],'speech':_0x37ccc4[_0xd585('0x69')][_0xd585('0x6f')],'providerResponse':JSON['stringify'](_0x276d97)};return _0x3f8b6a;}}});};exports[_0xd585('0x77')]=function(_0x4b4964,_0x4dff74,_0x45a5d3,_0x88ec12){return tilde[_0xd585('0x4e')](_0x4b4964,_0x4dff74,_0x45a5d3,_0x88ec12)[_0xd585('0x2f')](function(_0x1ca960){try{fs[_0xd585('0x23')](_0x4b4964);}catch(_0x1f242d){logger[_0xd585('0x1a')](_0x1f242d);}logger[_0xd585('0x20')]('Tilde\x20ASR\x20transcription',_0x1ca960['transcript']);logger[_0xd585('0x20')](_0xd585('0x78'),_0x1ca960[_0xd585('0x54')]);return _0x1ca960;});};exports[_0xd585('0x79')]=function(_0x3a5be2,_0x149a87,_0x5efda7,_0x423ef8,_0x44f530,_0x80f0d4){var _0x12a1e7=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x3c'));var _0x5a9bac;return aws[_0xd585('0x7a')](_0x3a5be2,_0x149a87,_0x5efda7,_0x423ef8,_0x44f530,_0x80f0d4,_0x12a1e7)[_0xd585('0x2f')](function(){_0x5a9bac=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x2d'));return convertFile(_0x12a1e7,_0x5a9bac);})['then'](function(){try{fs[_0xd585('0x23')](_0x12a1e7);fs['chmodSync'](_0x5a9bac,_0xd585('0x31'));}catch(_0x490b3f){logger['error'](_0x490b3f);}return _0x5a9bac['split']('.')[0x0];});};exports['awsLex']=function(_0x504824,_0x5683e6,_0x4cd0c6,_0x1e8557,_0x335fc8,_0x4335cb){return aws[_0xd585('0x7b')](_0x504824,_0x5683e6,_0x4cd0c6,_0x1e8557,_0x335fc8,_0x4335cb)[_0xd585('0x2f')](function(_0x49c429){logger[_0xd585('0x20')](JSON['stringify'](_0x49c429));return _0x49c429;});};exports['ispeechTTS']=function(_0x22d96d,_0x1eddf1,_0x185aa9,_0x7b0f12){var _0x33798f=util[_0xd585('0x7c')](_0xd585('0x7d'),ISPEECH_API,_0x22d96d,encodeURIComponent(_0x1eddf1),_0x185aa9,_0x7b0f12);var _0x466dae=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+_0xd585('0x3c'));var _0x362614;return downloadFile(_0x33798f,_0x466dae)[_0xd585('0x2f')](function(){_0x362614=path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs['generate'](0x4)+_0xd585('0x2d'));return convertFile(_0x466dae,_0x362614);})[_0xd585('0x2f')](function(){try{fs[_0xd585('0x23')](_0x466dae);fs[_0xd585('0x30')](_0x362614,'777');}catch(_0x3fc0e3){logger['error'](_0x3fc0e3);}return _0x362614[_0xd585('0x41')]('.')[0x0];});};exports['ispeechASR']=function(_0x534e4a,_0x31dc83,_0x3b8374,_0x19e969){var _0x5467d1=util[_0xd585('0x7c')](_0xd585('0x7e'),ISPEECH_API,_0x31dc83,_0x3b8374,base64Encode(_0x534e4a),_0x19e969?util[_0xd585('0x7c')](_0xd585('0x7f'),encodeURIComponent(_0x19e969)):_0xd585('0x80'));return uploadFile(_0x5467d1)[_0xd585('0x2f')](function(_0x373270){return querystring[_0xd585('0xb')](_0x373270);});};exports[_0xd585('0x81')]=function(_0x301d50,_0x63edab){return sestek[_0xd585('0x82')](_0x301d50,_0x63edab)[_0xd585('0x2f')](function(_0x243e25){logger[_0xd585('0x20')](JSON[_0xd585('0x47')](_0x243e25));var _0x1e5f00={'speech':_0x243e25[_0xd585('0x83')],'action':_0x243e25[_0xd585('0x84')]?_0x243e25[_0xd585('0x84')]['CustomAction']:undefined,'actiondata':_0x243e25[_0xd585('0x84')]?_0x243e25[_0xd585('0x84')][_0xd585('0x85')]:undefined};if(_0x243e25[_0xd585('0x84')]&&_0x243e25[_0xd585('0x84')][_0xd585('0x86')]){return base64Decode(_0x243e25['channelData']['AudioFromTts'][_0xd585('0x87')],path[_0xd585('0x2a')](__dirname,_0xd585('0x2b'),rs[_0xd585('0x2c')](0x4)+'.wav'))[_0xd585('0x2f')](function(_0x369a49){_0x1e5f00['audiofile']=_0x369a49;return _0x1e5f00;});}return _0x1e5f00;});};exports[_0xd585('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0x0484=['freeform=3','channelData','CustomActionData','AudioFromTts','Data','dirName','bluebird','dialogflow','http','path','querystring','sox','google-tts-api','url','parse','util','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish\x20download\x20file','close','error','unlink','download\x20error','end','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','777','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','.mp3','audioContent','writeFile','chmodSync','info','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','Dialogflow\x20V2\x20response:','action','queryResult','diagnosticInfo','fields','boolValue','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x0484,0x192));var _0x4048=function(_0x28b28c,_0x3ee3f4){_0x28b28c=_0x28b28c-0x0;var _0x23ce6b=_0x0484[_0x28b28c];return _0x23ce6b;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x4048('0x0'));var dialogflow=require(_0x4048('0x1'));var fs=require('fs');var http=require(_0x4048('0x2'));var https=require('https');var md5=require('md5');var path=require(_0x4048('0x3'));var querystring=require(_0x4048('0x4'));var rp=require('request-promise');var rs=require('randomstring');var sox=require(_0x4048('0x5'));var tts=require(_0x4048('0x6'));var urlParse=require(_0x4048('0x7'))[_0x4048('0x8')];var util=require(_0x4048('0x9'));var aws=require('./aws');var google=require(_0x4048('0xa'));var sestek=require(_0x4048('0xb'));var tilde=require('./tilde');var logger=require(_0x4048('0xc'))(_0x4048('0xd'));var ISPEECH_API=_0x4048('0xe');function downloadFile(_0x36ba81,_0x4d7fea){return new BPromise(function(_0x56cc2e,_0x39932c){var _0x2b4db8=urlParse(_0x36ba81);var _0x6be592=_0x2b4db8[_0x4048('0xf')]===_0x4048('0x10')?https:http;var _0x48a778={'host':_0x2b4db8[_0x4048('0x11')],'path':_0x2b4db8[_0x4048('0x3')],'headers':{'user-agent':_0x4048('0x12')}};_0x6be592['get'](_0x48a778,function(_0x119585){if(_0x119585[_0x4048('0x13')]!==0xc8){logger['error']('request\x20to\x20'+_0x36ba81+_0x4048('0x14')+_0x119585['statusCode']+'\x20('+_0x119585[_0x4048('0x15')]+')');_0x39932c(new Error(_0x4048('0x16')+_0x36ba81+_0x4048('0x14')+_0x119585['statusCode']+'\x20('+_0x119585[_0x4048('0x15')]+')'));return;}var _0x8eb925=fs[_0x4048('0x17')](_0x4d7fea);_0x8eb925['on']('finish',function(){logger['info'](_0x4048('0x18'));_0x8eb925[_0x4048('0x19')](_0x56cc2e);});_0x8eb925['on'](_0x4048('0x1a'),function(_0x59e76d){fs[_0x4048('0x1b')](_0x4d7fea);logger[_0x4048('0x1a')](_0x4048('0x1c'),_0x59e76d);_0x39932c(_0x59e76d);});_0x119585['pipe'](_0x8eb925);})['on'](_0x4048('0x1a'),function(_0x5182b2){logger[_0x4048('0x1a')](_0x5182b2);_0x39932c(_0x5182b2);})[_0x4048('0x1d')]();});}function uploadFile(_0xbe7596){return new BPromise(function(_0x50311c,_0x3ffbfc){var _0x396777=urlParse(_0xbe7596);var _0x61b69f=_0x396777[_0x4048('0xf')]===_0x4048('0x10')?https:http;var _0x54ecd2={'host':_0x396777[_0x4048('0x11')],'path':_0x396777['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x61b69f[_0x4048('0x1e')](_0x54ecd2,function(_0x11a8bb){if(_0x11a8bb['statusCode']!==0xc8){_0x3ffbfc(new Error('request\x20to\x20'+_0xbe7596+_0x4048('0x14')+_0x11a8bb[_0x4048('0x13')]+'\x20('+_0x11a8bb[_0x4048('0x15')]+')'));return;}var _0x282fff='';_0x11a8bb['on'](_0x4048('0x1f'),function(_0x49a9f9){_0x282fff+=_0x49a9f9;});_0x11a8bb['on'](_0x4048('0x1d'),function(){_0x50311c(_0x282fff);});})['on'](_0x4048('0x1a'),function(_0x4ffa33){_0x3ffbfc(_0x4ffa33);})[_0x4048('0x1d')]();});}function convertFile(_0x41c824,_0x59b2ec){return new BPromise(function(_0x5dc805,_0x50092a){var _0xee8b35=sox[_0x4048('0x20')](_0x41c824,_0x59b2ec,{'sampleRate':0x1f40,'format':_0x4048('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xee8b35['on']('error',function(_0x96d668){logger[_0x4048('0x1a')](_0x4048('0x22'),_0x96d668);_0x50092a(_0x96d668);});_0xee8b35['on'](_0x4048('0x1d'),function(){logger['info'](_0x4048('0x23'));_0x5dc805();});_0xee8b35[_0x4048('0x24')]();});}function base64Decode(_0x116dfb,_0x2de39b){var _0x382951=path[_0x4048('0x25')](__dirname,'tmp',rs[_0x4048('0x26')](0x4)+_0x4048('0x27'));fs[_0x4048('0x28')](_0x382951,_0x116dfb,_0x4048('0x29'));return convertFile(_0x382951,_0x2de39b)[_0x4048('0x2a')](function(){try{fs['unlink'](_0x382951);fs['chmodSync'](_0x2de39b,_0x4048('0x2b'));}catch(_0x532c9a){logger[_0x4048('0x1a')](_0x532c9a);}return _0x2de39b['split']('.')[0x0];});}function base64Encode(_0x295c49){var _0x36898f=fs[_0x4048('0x2c')](_0x295c49);return new Buffer(_0x36898f)['toString'](_0x4048('0x29'));}exports[_0x4048('0x2d')]=function(_0x4d76d7,_0xb3f20b,_0x3eecb0,_0xa3311b,_0x4d8e47,_0x10244a){var _0x216b02,_0x223bd8;var _0x3ce0e2=_0x4048('0x2e');var _0x4a4315=_0x4048('0x2f')+_0x4d76d7;var _0x119e98={};if(_0xb3f20b===_0x4048('0x30')){_0x119e98[_0x4048('0x31')]={'ssml':_0x3eecb0};}else{_0x119e98[_0x4048('0x31')]={'text':_0x3eecb0};};_0x119e98[_0x4048('0x32')]={'languageCode':_0xa3311b,'ssmlGender':_0x4d8e47};_0x119e98[_0x4048('0x33')]={'audioEncoding':_0x4048('0x34'),'sampleRateHertz':0x1f40};var _0x1f9ba8={'url':_0x3ce0e2+_0x4048('0x35')+_0x4a4315,'method':_0x4048('0x36'),'json':!![],'body':_0x119e98};return rp(_0x1f9ba8)[_0x4048('0x2a')](function(_0x472afd){return new BPromise(function(_0x189ce5,_0x150a2e){_0x216b02=path[_0x4048('0x25')](__dirname,_0x4048('0x37'),rs[_0x4048('0x26')](0x4)+_0x4048('0x38'));var _0x40cc85=Buffer['from'](_0x472afd[_0x4048('0x39')],_0x4048('0x29'));return fs[_0x4048('0x3a')](_0x216b02,_0x40cc85,function(_0x58e378){_0x150a2e(_0x58e378);},function(_0x2ef87f){fs[_0x4048('0x3b')](_0x216b02,'777');_0x189ce5(_0x2ef87f);});});})['then'](function(_0x2ec66f){_0x223bd8=path[_0x4048('0x25')](__dirname,'tmp',rs[_0x4048('0x26')](0x4)+_0x4048('0x27'));return convertFile(_0x216b02,_0x223bd8);})[_0x4048('0x2a')](function(){try{fs['unlink'](_0x216b02);fs[_0x4048('0x3b')](_0x223bd8,'777');}catch(_0x35e344){logger[_0x4048('0x1a')](_0x35e344);}logger[_0x4048('0x3c')](_0x4048('0x3d'),_0x223bd8[_0x4048('0x3e')]('.')[0x0]);return _0x223bd8[_0x4048('0x3e')]('.')[0x0];});};exports[_0x4048('0x3f')]=function(_0x44de3e,_0x364f2b){var _0x18b66f=_0x4048('0x40');var _0x3f100f,_0x2ceeb2;var _0x262266;var _0x33af92={'encoding':_0x4048('0x41'),'method':_0x4048('0x36'),'timeout':0x2710,'url':_0x18b66f,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x4048('0x42')+encodeURIComponent(JSON[_0x4048('0x43')]([[[_0x4048('0x44'),JSON['stringify']([_0x44de3e,_0x364f2b||'en',![],_0x4048('0x45')]),null,_0x4048('0x46')]]]))};return rp(_0x33af92)['then'](function(_0x16c494){try{_0x262266=eval(_0x16c494['slice'](0x5))[0x0][0x2];}catch(_0x29ad47){throw new Error(_0x4048('0x47')+_0x16c494[_0x4048('0x1f')]);}if(!_0x262266){if(_0x44de3e[_0x4048('0x48')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x364f2b+'\x22\x20might\x20not\x20exist');}}try{_0x262266=eval(_0x262266)[0x0];}catch(_0x4ac46d){throw new Error(_0x4048('0x47')+res[_0x4048('0x1f')]);}const _0x37e8ee=_0x262266;_0x3f100f=path[_0x4048('0x25')](__dirname,_0x4048('0x37'),rs[_0x4048('0x26')](0x4)+_0x4048('0x38'));fs['writeFileSync'](_0x3f100f,_0x262266,{'encoding':_0x4048('0x29')});_0x2ceeb2=path[_0x4048('0x25')](__dirname,_0x4048('0x37'),rs['generate'](0x4)+_0x4048('0x27'));return convertFile(_0x3f100f,_0x2ceeb2);})[_0x4048('0x2a')](function(){try{fs[_0x4048('0x1b')](_0x3f100f);fs[_0x4048('0x3b')](_0x2ceeb2,_0x4048('0x2b'));}catch(_0x5a2842){logger['error'](_0x5a2842);}logger[_0x4048('0x3c')](_0x4048('0x49'),_0x2ceeb2[_0x4048('0x3e')]('.')[0x0]);return _0x2ceeb2['split']('.')[0x0];});};exports[_0x4048('0x4a')]=function(_0x2213f8,_0x4d01dd,_0x23098e){return google[_0x4048('0x4b')](_0x2213f8,_0x4d01dd,_0x23098e)[_0x4048('0x2a')](function(_0x45da6c){logger['info'](_0x45da6c['uri']);return rp(_0x45da6c);})['then'](function(_0x2e318c){var _0x5ed3a5='';var _0x3e27b0=0x0;try{fs[_0x4048('0x1b')](_0x2213f8);}catch(_0x351ae6){logger[_0x4048('0x1a')](_0x351ae6);}if(_0x2e318c&&_0x2e318c[_0x4048('0x4c')]){_0x5ed3a5=_0x2e318c['results'][_0x4048('0x4d')](function(_0x2a38a1){return _0x2a38a1&&_0x2a38a1[_0x4048('0x4e')][0x0]&&_0x2a38a1[_0x4048('0x4e')][0x0][_0x4048('0x4f')]?_0x2a38a1['alternatives'][0x0]['transcript']:'';})[_0x4048('0x50')]('\x0a');_0x3e27b0=_0x2e318c['results'][_0x4048('0x4d')](function(_0x2bb36c){return _0x2bb36c&&_0x2bb36c[_0x4048('0x4e')][0x0]&&_0x2bb36c['alternatives'][0x0]['confidence']?_0x2bb36c[_0x4048('0x4e')][0x0][_0x4048('0x51')]:0x0;})[_0x4048('0x50')]('\x0a');}logger[_0x4048('0x3c')](_0x4048('0x52'),_0x5ed3a5);logger[_0x4048('0x3c')](_0x4048('0x53'),_0x3e27b0);return{'transcript':_0x5ed3a5,'confidence':_0x3e27b0};})[_0x4048('0x54')](function(_0x3b0417){logger['error'](_0x4048('0x55'),_0x3b0417[_0x4048('0x13')],_0x3b0417[_0x4048('0x56')],_0x3b0417[_0x4048('0x57')]);});};exports[_0x4048('0x58')]=function(_0x306d87,_0x4df7d8,_0x5536c2,_0x54b327){var _0x4801b1=apiai(_0x4df7d8,{'language':_0x54b327||'en'});return _0x4801b1[_0x4048('0x59')](_0x5536c2,{'sessionId':md5(_0x306d87)})[_0x4048('0x2a')](function(_0x237e02){logger[_0x4048('0x3c')](JSON[_0x4048('0x43')](_0x237e02));return{'source':_0x237e02[_0x4048('0x5a')]['source'],'resolvedQuery':_0x237e02[_0x4048('0x5a')]['resolvedQuery'],'action':_0x237e02['result']['action'],'actionIncomplete':_0x237e02['result']['actionIncomplete'],'speech':_0x237e02[_0x4048('0x5a')][_0x4048('0x5b')][_0x4048('0x5c')],'score':_0x237e02[_0x4048('0x5a')][_0x4048('0x5d')],'statusCode':_0x237e02[_0x4048('0x5e')][_0x4048('0x5f')],'endConversation':_0x237e02[_0x4048('0x5a')][_0x4048('0x60')][_0x4048('0x61')]||![],'isFallbackIntent':_0x237e02[_0x4048('0x5a')]['metadata'][_0x4048('0x62')]};});};exports[_0x4048('0x63')]=function(_0xc3674c,_0x5931b5,_0x4f77bd,_0x4f7f1e,_0x32df86,_0x44fc8a){var _0x463ab3=_0x4f7f1e[_0x4048('0x64')](/\\n/g,'\x0a');var _0x2c67d7={'credentials':{'private_key':_0x463ab3,'client_email':_0x4f77bd}};var _0x1b6ab4=new dialogflow[(_0x4048('0x65'))](_0x2c67d7);var _0x5e8565=_0x1b6ab4['sessionPath'](_0x5931b5,md5(_0xc3674c));var _0x194be2={'session':_0x5e8565,'queryInput':{'text':{'text':_0x32df86,'languageCode':_0x44fc8a}}};return _0x1b6ab4['detectIntent'](_0x194be2)['then'](function(_0x35123d){if(_0x35123d&&_0x35123d[_0x4048('0x48')]){logger[_0x4048('0x3c')](_0x4048('0x66'),JSON[_0x4048('0x43')](_0x35123d));var _0x29b50d=_0x35123d[0x0];if(_0x29b50d){var _0x142ffe={'action':_0x29b50d['queryResult'][_0x4048('0x67')],'allRequiredParamsPresent':_0x29b50d[_0x4048('0x68')]['allRequiredParamsPresent'],'endConversation':_0x29b50d[_0x4048('0x68')][_0x4048('0x69')]&&_0x29b50d['queryResult'][_0x4048('0x69')][_0x4048('0x6a')]?_0x29b50d[_0x4048('0x68')]['diagnosticInfo'][_0x4048('0x6a')]['end_conversation'][_0x4048('0x6b')]:![],'fulfillmentText':_0x29b50d[_0x4048('0x68')]['fulfillmentText'],'intentName':_0x29b50d['queryResult'][_0x4048('0x6c')][_0x4048('0x56')],'intentDisplayName':_0x29b50d[_0x4048('0x68')][_0x4048('0x6c')][_0x4048('0x6d')],'isFallbackIntent':_0x29b50d['queryResult'][_0x4048('0x6c')][_0x4048('0x6e')],'languageCode':_0x29b50d[_0x4048('0x68')][_0x4048('0x6f')],'queryText':_0x29b50d[_0x4048('0x68')][_0x4048('0x70')],'responseId':_0x29b50d[_0x4048('0x71')],'score':_0x29b50d['queryResult'][_0x4048('0x72')],'speech':_0x29b50d[_0x4048('0x68')][_0x4048('0x73')],'providerResponse':JSON[_0x4048('0x43')](_0x35123d)};return _0x142ffe;}}});};exports[_0x4048('0x74')]=function(_0x3f314f,_0x3474fc,_0x2e9363,_0x4ce276){return tilde[_0x4048('0x4b')](_0x3f314f,_0x3474fc,_0x2e9363,_0x4ce276)[_0x4048('0x2a')](function(_0x3bcb8e){try{fs[_0x4048('0x1b')](_0x3f314f);}catch(_0x4d1ffb){logger[_0x4048('0x1a')](_0x4d1ffb);}logger[_0x4048('0x3c')](_0x4048('0x75'),_0x3bcb8e['transcript']);logger[_0x4048('0x3c')]('Tilde\x20ASR\x20confidence',_0x3bcb8e[_0x4048('0x51')]);return _0x3bcb8e;});};exports['awsPolly']=function(_0x424e10,_0x4f2983,_0x45219c,_0x24ece9,_0x543fda,_0x4d093d){var _0x3a89d6=path[_0x4048('0x25')](__dirname,'tmp',rs[_0x4048('0x26')](0x4)+_0x4048('0x38'));var _0x3b8c47;return aws[_0x4048('0x76')](_0x424e10,_0x4f2983,_0x45219c,_0x24ece9,_0x543fda,_0x4d093d,_0x3a89d6)[_0x4048('0x2a')](function(){_0x3b8c47=path[_0x4048('0x25')](__dirname,_0x4048('0x37'),rs[_0x4048('0x26')](0x4)+'.wav');return convertFile(_0x3a89d6,_0x3b8c47);})[_0x4048('0x2a')](function(){try{fs[_0x4048('0x1b')](_0x3a89d6);fs[_0x4048('0x3b')](_0x3b8c47,_0x4048('0x2b'));}catch(_0x547848){logger[_0x4048('0x1a')](_0x547848);}return _0x3b8c47[_0x4048('0x3e')]('.')[0x0];});};exports[_0x4048('0x77')]=function(_0x47c571,_0x461207,_0x5da511,_0x131d06,_0x30e3d3,_0x26b4b7){return aws[_0x4048('0x78')](_0x47c571,_0x461207,_0x5da511,_0x131d06,_0x30e3d3,_0x26b4b7)[_0x4048('0x2a')](function(_0x3d6138){logger[_0x4048('0x3c')](JSON[_0x4048('0x43')](_0x3d6138));return _0x3d6138;});};exports[_0x4048('0x79')]=function(_0x3aca2e,_0x5bbd85,_0xcece9f,_0x163613){var _0x4591a9=util[_0x4048('0x7a')](_0x4048('0x7b'),ISPEECH_API,_0x3aca2e,encodeURIComponent(_0x5bbd85),_0xcece9f,_0x163613);var _0x27709b=path[_0x4048('0x25')](__dirname,'tmp',rs[_0x4048('0x26')](0x4)+'.mp3');var _0x3f834d;return downloadFile(_0x4591a9,_0x27709b)[_0x4048('0x2a')](function(){_0x3f834d=path[_0x4048('0x25')](__dirname,_0x4048('0x37'),rs[_0x4048('0x26')](0x4)+'.wav');return convertFile(_0x27709b,_0x3f834d);})['then'](function(){try{fs[_0x4048('0x1b')](_0x27709b);fs[_0x4048('0x3b')](_0x3f834d,_0x4048('0x2b'));}catch(_0xa74b6f){logger[_0x4048('0x1a')](_0xa74b6f);}return _0x3f834d[_0x4048('0x3e')]('.')[0x0];});};exports[_0x4048('0x7c')]=function(_0x452149,_0x3b7873,_0x411a5f,_0x132003){var _0x37eecb=util[_0x4048('0x7a')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x3b7873,_0x411a5f,base64Encode(_0x452149),_0x132003?util[_0x4048('0x7a')](_0x4048('0x7d'),encodeURIComponent(_0x132003)):_0x4048('0x7e'));return uploadFile(_0x37eecb)['then'](function(_0x37aea9){return querystring[_0x4048('0x8')](_0x37aea9);});};exports['sestekNDA']=function(_0x49776f,_0x2000b6){return sestek['nda'](_0x49776f,_0x2000b6)[_0x4048('0x2a')](function(_0x564383){logger[_0x4048('0x3c')](JSON['stringify'](_0x564383));var _0x94499e={'speech':_0x564383['text'],'action':_0x564383[_0x4048('0x7f')]?_0x564383[_0x4048('0x7f')]['CustomAction']:undefined,'actiondata':_0x564383[_0x4048('0x7f')]?_0x564383[_0x4048('0x7f')][_0x4048('0x80')]:undefined};if(_0x564383[_0x4048('0x7f')]&&_0x564383[_0x4048('0x7f')][_0x4048('0x81')]){return base64Decode(_0x564383[_0x4048('0x7f')][_0x4048('0x81')][_0x4048('0x82')],path[_0x4048('0x25')](__dirname,_0x4048('0x37'),rs['generate'](0x4)+_0x4048('0x27')))[_0x4048('0x2a')](function(_0xacaf89){_0x94499e['audiofile']=_0xacaf89;return _0x94499e;});}return _0x94499e;});};exports[_0x4048('0x83')]=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 ba2aa6c..11f45ea 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 _0x3d2a=['exports','./nda'];(function(_0x601aba,_0x10ed80){var _0x125591=function(_0x8f41d){while(--_0x8f41d){_0x601aba['push'](_0x601aba['shift']());}};_0x125591(++_0x10ed80);}(_0x3d2a,0x99));var _0xa3d2=function(_0x1cc6c9,_0x1be68d){_0x1cc6c9=_0x1cc6c9-0x0;var _0x22c4e2=_0x3d2a[_0x1cc6c9];return _0x22c4e2;};var nda=require(_0xa3d2('0x0'));module[_0xa3d2('0x1')]={'nda':nda}; \ No newline at end of file +var _0xd823=['./nda'];(function(_0x3ccd6e,_0x5baac5){var _0x5cde6b=function(_0x207573){while(--_0x207573){_0x3ccd6e['push'](_0x3ccd6e['shift']());}};_0x5cde6b(++_0x5baac5);}(_0xd823,0x139));var _0x3d82=function(_0x27def7,_0x3f0835){_0x27def7=_0x27def7-0x0;var _0x581cbc=_0xd823[_0x27def7];return _0x581cbc;};var nda=require(_0x3d82('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index f6830f9..12a9b94 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 _0xd5b6=['text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xd5b6,0x73));var _0x6d5b=function(_0x4cdf7f,_0x409332){_0x4cdf7f=_0x4cdf7f-0x0;var _0x1bcbeb=_0xd5b6[_0x4cdf7f];return _0x1bcbeb;};'use strict';var rp=require(_0x6d5b('0x0'));var url=require(_0x6d5b('0x1'));var logger=require(_0x6d5b('0x2'))(_0x6d5b('0x3'));module[_0x6d5b('0x4')]=function(_0x3d9bc9,_0x162442){var _0x3fb583={'method':'POST','uri':url[_0x6d5b('0x5')](_0x162442[_0x6d5b('0x6')],_0x6d5b('0x7')),'form':{'grant_type':'password','username':_0x162442[_0x6d5b('0x8')],'password':_0x162442[_0x6d5b('0x9')]},'json':!![]};return rp(_0x3fb583)[_0x6d5b('0xa')](function(_0x3cdc91){var _0x5b57cb={'method':'POST','uri':url[_0x6d5b('0x5')](_0x162442[_0x6d5b('0xb')],_0x6d5b('0xc')),'body':{'type':_0x162442[_0x6d5b('0xd')]||_0x6d5b('0xe'),'channelId':_0x6d5b('0xf'),'conversation':{'id':_0x3d9bc9[_0x6d5b('0x10')]},'from':{'id':_0x3d9bc9[_0x6d5b('0x11')],'name':_0x3d9bc9[_0x6d5b('0x12')]},'recipient':{'id':_0x3d9bc9[_0x6d5b('0x13')],'name':_0x3d9bc9[_0x6d5b('0x14')]},'text':_0x162442[_0x6d5b('0x15')],'channelData':{}},'headers':{'Authorization':_0x6d5b('0x16')+_0x3cdc91[_0x6d5b('0x17')]},'json':!![]};if(_0x162442[_0x6d5b('0x18')]){_0x5b57cb[_0x6d5b('0x19')][_0x6d5b('0x1a')][_0x6d5b('0x1b')]=_0x162442['project'];}if(_0x162442[_0x6d5b('0x1c')]=='1'){_0x5b57cb[_0x6d5b('0x19')][_0x6d5b('0x1a')][_0x6d5b('0x1d')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x6d5b('0x1e')};}if(_0x162442['custom_action']){_0x5b57cb[_0x6d5b('0x19')][_0x6d5b('0x1a')]['CustomAction']=_0x162442[_0x6d5b('0x1f')];if(_0x162442['custom_action_data']){_0x5b57cb[_0x6d5b('0x19')]['channelData']['CustomActionData']=_0x162442['custom_action_data'];}}logger[_0x6d5b('0x20')](JSON[_0x6d5b('0x21')](_0x5b57cb));return rp(_0x5b57cb);});}; \ No newline at end of file +var _0xa249=['exports','POST','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','dnid','text','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','CustomActionData','custom_action_data','info','stringify','request-promise','url','agi'];(function(_0x5f03b2,_0x5ae481){var _0x23f1e4=function(_0x4cf99){while(--_0x4cf99){_0x5f03b2['push'](_0x5f03b2['shift']());}};_0x23f1e4(++_0x5ae481);}(_0xa249,0x183));var _0x9a24=function(_0x2276e9,_0x39fb1d){_0x2276e9=_0x2276e9-0x0;var _0x4657ee=_0xa249[_0x2276e9];return _0x4657ee;};'use strict';var rp=require(_0x9a24('0x0'));var url=require(_0x9a24('0x1'));var logger=require('../../../../../config/logger')(_0x9a24('0x2'));module[_0x9a24('0x3')]=function(_0x575a09,_0x12ef32){var _0x4d4d56={'method':_0x9a24('0x4'),'uri':url['resolve'](_0x12ef32['ndauth_url'],'/token'),'form':{'grant_type':_0x9a24('0x5'),'username':_0x12ef32[_0x9a24('0x6')],'password':_0x12ef32[_0x9a24('0x5')]},'json':!![]};return rp(_0x4d4d56)[_0x9a24('0x7')](function(_0x3f2459){var _0x22f220={'method':_0x9a24('0x4'),'uri':url[_0x9a24('0x8')](_0x12ef32[_0x9a24('0x9')],_0x9a24('0xa')),'body':{'type':_0x12ef32['ndaactivity_type']||'message','channelId':_0x9a24('0xb'),'conversation':{'id':_0x575a09[_0x9a24('0xc')]},'from':{'id':_0x575a09[_0x9a24('0xd')],'name':_0x575a09['calleridname']},'recipient':{'id':_0x575a09[_0x9a24('0xe')],'name':_0x575a09['extension']},'text':_0x12ef32[_0x9a24('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x3f2459[_0x9a24('0x10')]},'json':!![]};if(_0x12ef32[_0x9a24('0x11')]){_0x22f220[_0x9a24('0x12')][_0x9a24('0x13')][_0x9a24('0x14')]=_0x12ef32['project'];}if(_0x12ef32[_0x9a24('0x15')]=='1'){_0x22f220[_0x9a24('0x12')][_0x9a24('0x13')][_0x9a24('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x9a24('0x17')};}if(_0x12ef32['custom_action']){_0x22f220['body'][_0x9a24('0x13')][_0x9a24('0x18')]=_0x12ef32[_0x9a24('0x19')];if(_0x12ef32['custom_action_data']){_0x22f220[_0x9a24('0x12')][_0x9a24('0x13')][_0x9a24('0x1a')]=_0x12ef32[_0x9a24('0x1b')];}}logger[_0x9a24('0x1c')](JSON[_0x9a24('0x1d')](_0x22f220));return rp(_0x22f220);});}; \ 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 1e76b7c..30238de 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 _0x786e=['exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x786e,0x11a));var _0xe786=function(_0x3a3afe,_0x15da25){_0x3a3afe=_0x3a3afe-0x0;var _0x262dab=_0x786e[_0x3a3afe];return _0x262dab;};'use strict';var asr=require('./lib/api');module[_0xe786('0x0')]=function(_0x1238f5,_0x39a132,_0x510768,_0x5254b5){return asr(_0x1238f5,_0x39a132,_0x510768,_0x5254b5);}; \ No newline at end of file +var _0xe2df=['./lib/api','exports'];(function(_0x4f8b2b,_0x1dc8dd){var _0x2f230a=function(_0x232685){while(--_0x232685){_0x4f8b2b['push'](_0x4f8b2b['shift']());}};_0x2f230a(++_0x1dc8dd);}(_0xe2df,0x182));var _0xfe2d=function(_0x3a6f15,_0x10e382){_0x3a6f15=_0x3a6f15-0x0;var _0x374164=_0xe2df[_0x3a6f15];return _0x374164;};'use strict';var asr=require(_0xfe2d('0x0'));module[_0xfe2d('0x1')]=function(_0x53cd42,_0x63881c,_0x4ff012,_0x9b5cad){return asr(_0x53cd42,_0x63881c,_0x4ff012,_0x9b5cad);}; \ 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 47e9f8c..866377a 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 _0x0083=['close','lodash','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','isNil','isObject','open','message'];(function(_0xd637a3,_0x19b904){var _0x180a84=function(_0x2fc05a){while(--_0x2fc05a){_0xd637a3['push'](_0xd637a3['shift']());}};_0x180a84(++_0x19b904);}(_0x0083,0xba));var _0x3008=function(_0x4bf029,_0x3e24f6){_0x4bf029=_0x4bf029-0x0;var _0x359cf3=_0x0083[_0x4bf029];return _0x359cf3;};'use strict';var BPromise=require('bluebird');var _=require(_0x3008('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x3008('0x1'));var crypto=require(_0x3008('0x2'));var logger=require('../../../../../../config/logger')(_0x3008('0x3'));module[_0x3008('0x4')]=function(_0xef9353,_0x2e0f18,_0x438eb8,_0x438ded){return new BPromise(function(_0x365f26,_0xc745d2){logger[_0x3008('0x5')](_0x3008('0x6'),_0x438ded||_0x3008('0x7'));var _0x1c643a=new WebSocket(_0x438ded||_0x3008('0x7'),{'perMessageDeflate':![]});var _0x51bddf='';var _0x2b6189='0';var _0x10fac4='1';var _0x208a39=_0x3008('0x8');function _0x37fdb1(_0x3022b7){var _0x146ac7=crypto['createHash'](_0x3008('0x9'));_0x146ac7[_0x3008('0xa')](_0x3022b7);return _0x146ac7[_0x3008('0xb')]('hex');}function _0xf9afb7(){try{logger[_0x3008('0x5')](_0x3008('0xc'));var _0x5e2033=moment()['unix']();var _0x80b538=_0x37fdb1(_0x5e2033+_0x2e0f18+_0x438eb8);_0x1c643a[_0x3008('0xd')](JSON[_0x3008('0xe')]({'appID':_0x2e0f18,'timestamp':_0x5e2033,'appKey':_0x80b538}));var _0x25a0b9=fs[_0x3008('0xf')](_0xef9353);_0x25a0b9['on']('data',function(_0x182194){_0x1c643a['send'](_0x182194);});_0x25a0b9['on']('close',function(){_0x1c643a['send'](_0x3008('0x10'));});}catch(_0x5265b0){logger[_0x3008('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0x3008('0xe')](_0x5265b0));_0x1c643a[_0x3008('0x12')]();}}function _0x25fda8(_0x350463){try{if(_0x350463){var _0x2e3c99=JSON[_0x3008('0x13')](_0x350463);switch(_0x2e3c99[_0x3008('0x14')]){case 0x0:if(_0x2e3c99[_0x3008('0x15')]){if(_0x2e3c99['result'][_0x3008('0x16')]){logger['info'](_0x3008('0x17'),JSON['stringify'](_0x2e3c99['result'][_0x3008('0x18')]));_0x51bddf=_0x2e3c99[_0x3008('0x15')]['hypotheses'][0x0]['transcript'];_0x2b6189=_0x2e3c99[_0x3008('0x15')]['hypotheses'][0x0][_0x3008('0x19')];_0x10fac4='0';_0x208a39=_0x3008('0x1a');_0x1c643a[_0x3008('0x12')]();}}break;case 0x1:logger[_0x3008('0x5')](_0x3008('0x8'));_0x10fac4='1';_0x208a39=_0x3008('0x8');break;case 0x2:logger[_0x3008('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x10fac4='2';_0x208a39=_0x3008('0x1b');break;case 0x9:logger[_0x3008('0x5')](_0x3008('0x1c'));_0x10fac4='9';_0x208a39=_0x3008('0x1c');break;case 0xa:logger[_0x3008('0x5')](_0x3008('0x1d'));_0x10fac4='10';_0x208a39='Authentication\x20failed.';break;case 0xb:logger[_0x3008('0x5')](_0x3008('0x1e'));_0x10fac4='11';_0x208a39=_0x3008('0x1e');}}}catch(_0x30c7ec){logger[_0x3008('0x11')](_0x3008('0x1f'),JSON[_0x3008('0xe')](_0x30c7ec));_0x1c643a['terminate']();}}function _0x1309c4(){logger[_0x3008('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x365f26({'transcript':_0x51bddf,'confidence':_0x2b6189,'status':_0x10fac4,'status_message':_0x208a39});}function _0x26df97(_0x3f66e9){logger[_0x3008('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x3008('0x20')](_0x3f66e9)){logger[_0x3008('0x11')](_[_0x3008('0x21')](_0x3f66e9)?JSON['stringify'](_0x3f66e9):_0x3f66e9);}}_0x1c643a['on'](_0x3008('0x22'),_0xf9afb7);_0x1c643a['on'](_0x3008('0x23'),_0x25fda8);_0x1c643a['on'](_0x3008('0x24'),_0x1309c4);_0x1c643a['on'](_0x3008('0x11'),_0x26df97);});}; \ No newline at end of file +var _0x0232=['../../../../../../config/logger','agi','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','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','open','bluebird','lodash','moment','crypto'];(function(_0x3ff59d,_0x209599){var _0x221f59=function(_0x121af2){while(--_0x121af2){_0x3ff59d['push'](_0x3ff59d['shift']());}};_0x221f59(++_0x209599);}(_0x0232,0xbf));var _0x2023=function(_0x2d6afd,_0x576024){_0x2d6afd=_0x2d6afd-0x0;var _0x42e93a=_0x0232[_0x2d6afd];return _0x42e93a;};'use strict';var BPromise=require(_0x2023('0x0'));var _=require(_0x2023('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x2023('0x2'));var crypto=require(_0x2023('0x3'));var logger=require(_0x2023('0x4'))(_0x2023('0x5'));module['exports']=function(_0x2a1cfa,_0xa5bc22,_0xb452a0,_0xe1c626){return new BPromise(function(_0x1799fa,_0xbbdb9b){logger['info'](_0x2023('0x6'),_0xe1c626||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x4df65d=new WebSocket(_0xe1c626||_0x2023('0x7'),{'perMessageDeflate':![]});var _0x18669a='';var _0x4b2a28='0';var _0x4c93f6='1';var _0x4d1a40=_0x2023('0x8');function _0x5ad10c(_0x137dbb){var _0x24f4b6=crypto[_0x2023('0x9')](_0x2023('0xa'));_0x24f4b6['update'](_0x137dbb);return _0x24f4b6['digest'](_0x2023('0xb'));}function _0x4f169e(){try{logger[_0x2023('0xc')](_0x2023('0xd'));var _0x729adb=moment()[_0x2023('0xe')]();var _0x1925bd=_0x5ad10c(_0x729adb+_0xa5bc22+_0xb452a0);_0x4df65d[_0x2023('0xf')](JSON[_0x2023('0x10')]({'appID':_0xa5bc22,'timestamp':_0x729adb,'appKey':_0x1925bd}));var _0x29a8fc=fs[_0x2023('0x11')](_0x2a1cfa);_0x29a8fc['on'](_0x2023('0x12'),function(_0x1c2b1a){_0x4df65d[_0x2023('0xf')](_0x1c2b1a);});_0x29a8fc['on'](_0x2023('0x13'),function(){_0x4df65d['send'](_0x2023('0x14'));});}catch(_0x8d44cb){logger[_0x2023('0x15')](_0x2023('0x16'),JSON[_0x2023('0x10')](_0x8d44cb));_0x4df65d[_0x2023('0x17')]();}}function _0xd9d578(_0x586bcc){try{if(_0x586bcc){var _0x165641=JSON['parse'](_0x586bcc);switch(_0x165641[_0x2023('0x18')]){case 0x0:if(_0x165641[_0x2023('0x19')]){if(_0x165641[_0x2023('0x19')][_0x2023('0x1a')]){logger[_0x2023('0xc')](_0x2023('0x1b'),JSON[_0x2023('0x10')](_0x165641[_0x2023('0x19')][_0x2023('0x1c')]));_0x18669a=_0x165641[_0x2023('0x19')][_0x2023('0x1c')][0x0][_0x2023('0x1d')];_0x4b2a28=_0x165641[_0x2023('0x19')]['hypotheses'][0x0][_0x2023('0x1e')];_0x4c93f6='0';_0x4d1a40='Success.';_0x4df65d[_0x2023('0x17')]();}}break;case 0x1:logger[_0x2023('0xc')](_0x2023('0x8'));_0x4c93f6='1';_0x4d1a40=_0x2023('0x8');break;case 0x2:logger[_0x2023('0xc')](_0x2023('0x1f'));_0x4c93f6='2';_0x4d1a40=_0x2023('0x1f');break;case 0x9:logger[_0x2023('0xc')](_0x2023('0x20'));_0x4c93f6='9';_0x4d1a40=_0x2023('0x20');break;case 0xa:logger[_0x2023('0xc')](_0x2023('0x21'));_0x4c93f6='10';_0x4d1a40='Authentication\x20failed.';break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4c93f6='11';_0x4d1a40=_0x2023('0x22');}}}catch(_0x140a6f){logger[_0x2023('0x15')](_0x2023('0x23'),JSON[_0x2023('0x10')](_0x140a6f));_0x4df65d[_0x2023('0x17')]();}}function _0x497c24(){logger[_0x2023('0xc')]('Close\x20Tilde\x20ASR\x20socket');_0x1799fa({'transcript':_0x18669a,'confidence':_0x4b2a28,'status':_0x4c93f6,'status_message':_0x4d1a40});}function _0x372dd5(_0x5883ff){logger[_0x2023('0x15')](_0x2023('0x24'));if(!_['isNil'](_0x5883ff)){logger[_0x2023('0x15')](_[_0x2023('0x25')](_0x5883ff)?JSON[_0x2023('0x10')](_0x5883ff):_0x5883ff);}}_0x4df65d['on'](_0x2023('0x26'),_0x4f169e);_0x4df65d['on']('message',_0xd9d578);_0x4df65d['on'](_0x2023('0x13'),_0x497c24);_0x4df65d['on'](_0x2023('0x15'),_0x372dd5);});}; \ 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 0e978ad..8594f98 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 _0xf464=['./asr','exports'];(function(_0x22356f,_0x63767e){var _0x567c09=function(_0x3f206d){while(--_0x3f206d){_0x22356f['push'](_0x22356f['shift']());}};_0x567c09(++_0x63767e);}(_0xf464,0xb2));var _0x4f46=function(_0x90ff4,_0x468229){_0x90ff4=_0x90ff4-0x0;var _0x4eb7db=_0xf464[_0x90ff4];return _0x4eb7db;};var asr=require(_0x4f46('0x0'));module[_0x4f46('0x1')]={'asr':asr}; \ No newline at end of file +var _0xd935=['./asr'];(function(_0x40bdbc,_0x3fabcd){var _0xc603a8=function(_0x17c0e6){while(--_0x17c0e6){_0x40bdbc['push'](_0x40bdbc['shift']());}};_0xc603a8(++_0x3fabcd);}(_0xd935,0x6d));var _0x5d93=function(_0x4f1be1,_0x2240de){_0x4f1be1=_0x4f1be1-0x0;var _0x1bdd19=_0xd935[_0x4f1be1];return _0x1bdd19;};var asr=require(_0x5d93('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index c958a1f..4b7e42c 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x256e32,_0x4013bc){var _0x464070=function(_0x449398){while(--_0x449398){_0x256e32['push'](_0x256e32['shift']());}};_0x464070(++_0x4013bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0xe706,0xa3));var _0x6e70=function(_0x4ba18d,_0x134851){_0x4ba18d=_0x4ba18d-0x0;var _0x3a9bc6=_0xe706[_0x4ba18d];return _0x3a9bc6;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 58bc4f5..2fecfe3 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 _0x8ce8=['Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','out','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','beep','NOBEEP','intKey','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','false','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','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','no\x20variable\x20selected\x20for\x20the\x20result','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','playback','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','createSquareRecording','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','template_id','smtpOptions','sendFax','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','googleTTS','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','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','callerid','calleridname','context','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agent','agentPause','agentLogout','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','MALE','audioEncoding','MP3','google_tts_language','restAPI','url','method','timeout','includes','POST','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','headers','stringify','render','statusMessage','statusCode','message','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','model','awsPolly','aws_polly_region','aws_polly_voice','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','agicommand','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','retry','maxRetry','mrcpsynth','isConfigured','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','getAndSetVariable','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','add','minutes','custom_app','application','lumenvoxtts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured'];(function(_0x55dd0f,_0x5c8322){var _0x52ad28=function(_0x21e056){while(--_0x21e056){_0x55dd0f['push'](_0x55dd0f['shift']());}};_0x52ad28(++_0x5c8322);}(_0x8ce8,0xd3));var _0x88ce=function(_0x3b54e,_0x9d119){_0x3b54e=_0x3b54e-0x0;var _0x69ebae=_0x8ce8[_0x3b54e];return _0x69ebae;};'use strict';var fs=require('fs');var util=require(_0x88ce('0x0'));var _=require('lodash');var sh=require(_0x88ce('0x1'));var odbc=require(_0x88ce('0x2'))();var rs=require(_0x88ce('0x3'));var moment=require(_0x88ce('0x4'));var Mustache=require(_0x88ce('0x5'));var rp=require(_0x88ce('0x6'));var logger=require(_0x88ce('0x7'))(_0x88ce('0x8'));var config=require(_0x88ce('0x9'));var shared=require(_0x88ce('0xa'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x88ce('0xb'),_0x88ce('0xc')];var verticesWithRetry=[_0x88ce('0xd'),_0x88ce('0xe'),_0x88ce('0xf')];var AGIVertices=function(_0x5eea92,_0x48c190,_0x56d343){this[_0x88ce('0x10')]=_0x5eea92;this[_0x88ce('0x11')]=_0x48c190;this[_0x88ce('0x12')]=_0x56d343;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x14')]=function(_0x3d8ad6,_0x3e0e28){this[_0x88ce('0x11')]['getVariableById'](_0x3d8ad6)[_0x88ce('0x15')](function(_0x4cd1c0){_0x3e0e28(null,_0x4cd1c0?_0x4cd1c0[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x50b088){_0x3e0e28(_0x50b088);});};AGIVertices['prototype'][_0x88ce('0x18')]=function(_0xbc1936,_0x12e8af){this[_0x88ce('0x11')][_0x88ce('0x19')](_0xbc1936)[_0x88ce('0x15')](function(_0x242265){_0x12e8af(null,_0x242265?_0x242265['name']:![]);})[_0x88ce('0x17')](function(_0x5bcd5a){_0x12e8af(_0x5bcd5a);});};AGIVertices[_0x88ce('0x13')]['getSquareProject']=function(_0x429230,_0x2a5a86){this[_0x88ce('0x11')][_0x88ce('0x1a')](_0x429230)['then'](function(_0x50c9df){_0x2a5a86(null,_0x50c9df?_0x50c9df[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x404df9){_0x2a5a86(_0x404df9);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b')]=function(_0x37f31,_0x461a8a){this[_0x88ce('0x11')][_0x88ce('0x1c')](_0x37f31)[_0x88ce('0x15')](function(_0x106e59){_0x461a8a(null,_0x106e59?_0x106e59[_0x88ce('0x1d')]:![]);})[_0x88ce('0x17')](function(_0x397ee5){_0x461a8a(_0x397ee5);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1e')]=function(_0x4daac4,_0x356d7d){this[_0x88ce('0x11')][_0x88ce('0x1f')](_0x4daac4)[_0x88ce('0x15')](function(_0x33711e){_0x356d7d(null,_0x33711e?_0x33711e['name']:![]);})['catch'](function(_0x4dcdc4){_0x356d7d(_0x4dcdc4);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x20')]=function(_0x424b66,_0x51a894){this['rpc'][_0x88ce('0x21')](_0x424b66)[_0x88ce('0x15')](function(_0x1b9d39){_0x51a894(null,_0x1b9d39?_0x1b9d39[_0x88ce('0x16')]:![]);})[_0x88ce('0x17')](function(_0x1efcea){_0x51a894(_0x1efcea);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x22')]=function(_0x19c87f,_0x40aa83){var _0x4209bc=this;this[_0x88ce('0x11')][_0x88ce('0x23')](_0x19c87f)[_0x88ce('0x15')](function(_0x12b9a1){_0x40aa83(null,_0x12b9a1?_0x4209bc[_0x88ce('0x24')](_0x12b9a1['save_name']):![]);})[_0x88ce('0x17')](function(_0x5ceb03){_0x40aa83(_0x5ceb03);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x25')]=function(_0x6ea7e0,_0x2fe609){this['rpc'][_0x88ce('0x26')](_0x6ea7e0)[_0x88ce('0x15')](function(_0x326ebe){_0x2fe609(null,_0x326ebe?_0x326ebe:![]);})[_0x88ce('0x17')](function(_0x400096){_0x2fe609(_0x400096);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x27')]=function(_0x554cff,_0x1280be,_0x34b5c4){this['mailRpc'][_0x88ce('0x27')](_0x554cff,_0x1280be)[_0x88ce('0x15')](function(){_0x34b5c4(null);})[_0x88ce('0x17')](function(_0x24fbbe){_0x34b5c4(_0x24fbbe);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x28')]=function(_0x21e585,_0x12bcfa){this[_0x88ce('0x11')]['getIntervalById'](_0x21e585)[_0x88ce('0x15')](function(_0x1da20a){if(_0x1da20a){if(_0x1da20a[_0x88ce('0x29')]){_0x12bcfa(null,[_0x1da20a['interval']]);}else{_0x12bcfa(null,_[_0x88ce('0x2a')](_0x1da20a[_0x88ce('0x2b')],'interval'));}}else{_0x12bcfa(null,![]);}})['catch'](function(_0x238142){_0x12bcfa(_0x238142);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x24')]=function(_0x1e25ca){return util[_0x88ce('0x2c')](_0x88ce('0x2d'),FILES_PATH,_0x1e25ca);};AGIVertices['prototype'][_0x88ce('0x2e')]=function(_0x94a27,_0x500ed1,_0x35c773){odbc[_0x88ce('0x2f')](_0x94a27,function(_0x55e1c4){if(_0x55e1c4){logger[_0x88ce('0x30')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x55e1c4);_0x35c773(_0x55e1c4);}else{logger[_0x88ce('0x31')](_0x88ce('0x32'));odbc[_0x88ce('0x33')](_0x500ed1,function(_0x2c2ec1,_0x378436){if(_0x2c2ec1){logger[_0x88ce('0x31')]('Error\x20executing\x20query\x20%s',_0x500ed1);_0x35c773(_0x2c2ec1);}else{logger[_0x88ce('0x31')](_0x88ce('0x34'),_0x500ed1);odbc[_0x88ce('0x35')](function(_0x24f5fa){if(_0x24f5fa){logger['error'](_0x88ce('0x36'),_0x24f5fa);}_0x35c773(null,_0x378436);});}});}});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x37')]=function(_0x4cc1c2,_0x596d4c){this[_0x88ce('0x11')][_0x88ce('0x38')](_0x4cc1c2)[_0x88ce('0x15')](function(_0x512e49){_0x596d4c(null,_0x512e49?_0x512e49:![]);})[_0x88ce('0x17')](function(_0x3f7dce){_0x596d4c(_0x3f7dce);});};AGIVertices['prototype'][_0x88ce('0x39')]=function(_0x1b99a8,_0x4709c4){this[_0x88ce('0x11')][_0x88ce('0x39')](_0x1b99a8)['then'](function(_0x14e61a){_0x4709c4(null,_0x14e61a);})[_0x88ce('0x17')](function(_0x388926){_0x4709c4(_0x388926);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x3a')]=function(_0x29d440,_0x39bfb8,_0x5ae3f9){this[_0x88ce('0x11')][_0x88ce('0x3a')]({'uniqueid':this['channel'][_0x88ce('0x3b')],'node':_0x29d440[_0x88ce('0x3c')],'application':_0x29d440['agicommand'],'data':_0x39bfb8||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x88ce('0x10')][_0x88ce('0x3d')]})[_0x88ce('0x15')](function(_0x35cbf8){if(_0x5ae3f9){_0x5ae3f9(null,_0x35cbf8);}})[_0x88ce('0x17')](function(_0x20db25){if(_0x5ae3f9){_0x5ae3f9(_0x20db25);}});};AGIVertices[_0x88ce('0x13')]['createSquareRecording']=function(_0x160a6c,_0x535061,_0x2406b2,_0x10c963){this[_0x88ce('0x11')]['createSquareRecording']({'uniqueid':this[_0x88ce('0x10')]['uniqueid'],'callerid':this[_0x88ce('0x10')][_0x88ce('0x3d')],'calleridname':this[_0x88ce('0x10')][_0x88ce('0x3e')],'context':this[_0x88ce('0x10')][_0x88ce('0x3f')],'extension':this[_0x88ce('0x10')]['extension'],'priority':this[_0x88ce('0x10')][_0x88ce('0x40')],'accountcode':this[_0x88ce('0x10')][_0x88ce('0x41')],'dnid':this['channel']['dnid'],'projectName':this[_0x88ce('0x10')][_0x88ce('0x42')],'saveName':_0x535061,'filename':_0x160a6c[_0x88ce('0x43')]||_0x535061,'savePath':_0x2406b2})[_0x88ce('0x15')](function(_0x23967c){_0x10c963(null,_0x23967c);})[_0x88ce('0x17')](function(_0x4e4933){_0x10c963(_0x4e4933);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3471ae,_0x55cd0e,_0x5c2231,_0x47d0c7,_0x13e84f){this['rpc'][_0x88ce('0x44')]({'uniqueid':this[_0x88ce('0x10')][_0x88ce('0x3b')],'body':_0x3471ae,'direction':_0x55cd0e,'providerName':_0x5c2231,'providerResponse':_0x47d0c7})[_0x88ce('0x15')](function(_0x23be64){if(_0x13e84f){_0x13e84f(null,_0x23be64);}})[_0x88ce('0x17')](function(_0x5a598b){if(_0x13e84f){_0x13e84f(_0x5a598b);}});};AGIVertices['prototype'][_0x88ce('0x45')]=function(_0x39a801,_0x1c9e37){this[_0x88ce('0x11')]['createCmContact']({'firstName':_['isEmpty'](_0x39a801[_0x88ce('0x16')])||_[_0x88ce('0x46')](_0x39a801[_0x88ce('0x16')])?_0x88ce('0x47')+Math[_0x88ce('0x48')]():_0x39a801[_0x88ce('0x16')],'lastName':_[_0x88ce('0x49')](_0x39a801[_0x88ce('0x4a')])||_[_0x88ce('0x46')](_0x39a801[_0x88ce('0x4a')])?null:_0x39a801[_0x88ce('0x4a')],'phone':_0x39a801[_0x88ce('0x4b')],'ListId':_0x39a801[_0x88ce('0x4c')],'scheduledat':_0x39a801['scheduledAt'],'callbackUniqueid':this[_0x88ce('0x10')][_0x88ce('0x3b')],'tags':_0x88ce('0x4d'),'description':_0x88ce('0x4e')+_0x39a801[_0x88ce('0x4f')][_0x88ce('0x50')](),'priority':_0x39a801['callback_priority']})[_0x88ce('0x15')](function(_0x564f37){_0x1c9e37(null,_0x564f37);})[_0x88ce('0x17')](function(_0x3ee72d){_0x1c9e37(_0x3ee72d);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x51')]=function(_0x16778f,_0x4ab8da){this[_0x88ce('0x11')][_0x88ce('0x52')](_0x16778f)['then'](function(_0x42963f){_0x4ab8da(null,_0x42963f?_0x42963f['name']:![]);})[_0x88ce('0x17')](function(_0x3d05f3){_0x4ab8da(_0x3d05f3);});};AGIVertices[_0x88ce('0x13')]['agentPause']=function(_0x1e45cc,_0x2cc506,_0x27c25d){var _0x1988ab={'role':_0x88ce('0x53')};_0x1988ab[_0x1e45cc]=this[_0x88ce('0x10')][_0x88ce('0x3d')];this[_0x88ce('0x11')][_0x88ce('0x54')](_0x1988ab,_0x2cc506,this['channel']['uniqueid'])[_0x88ce('0x15')](function(_0x1d213d){_0x27c25d(null,_[_0x88ce('0x46')](_0x1d213d)?![]:!![]);})['catch'](function(_0x232cc1){logger['error'](_0x232cc1);_0x27c25d(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x114888,_0x50b887){var _0xaf4625={'role':_0x88ce('0x53')};_0xaf4625[_0x114888]=this[_0x88ce('0x10')]['callerid'];this[_0x88ce('0x11')]['agentUnpause'](_0xaf4625)[_0x88ce('0x15')](function(_0x1a1af4){_0x50b887(null,_[_0x88ce('0x46')](_0x1a1af4)?![]:!![]);})[_0x88ce('0x17')](function(_0x5c6c24){logger[_0x88ce('0x30')](_0x5c6c24);_0x50b887(null,![]);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x55')]=function(_0x563439,_0x590d79){var _0x5cddfd={'role':_0x88ce('0x53')};_0x5cddfd[_0x563439]=this[_0x88ce('0x10')][_0x88ce('0x3d')];this[_0x88ce('0x11')]['agentLogout'](_0x5cddfd)['then'](function(_0x55570f){_0x590d79(null,_[_0x88ce('0x46')](_0x55570f)?![]:!![]);})[_0x88ce('0x17')](function(_0x13f59a){logger[_0x88ce('0x30')](_0x13f59a);_0x590d79(null,![]);});};AGIVertices[_0x88ce('0x13')]['agentLogin']=function(_0x495ac2,_0x2aafcc){var _0x2d360b={'role':_0x88ce('0x53')};_0x2d360b[_0x495ac2]=this[_0x88ce('0x10')][_0x88ce('0x3d')];var _0x546248=_0x495ac2!='internal'?util[_0x88ce('0x2c')](_0x88ce('0x56'),_0x88ce('0x57'),this[_0x88ce('0x10')]['callerid']):undefined;this[_0x88ce('0x11')]['agentLogin'](_0x2d360b,_0x546248)['then'](function(_0x15df5a){_0x2aafcc(null,_[_0x88ce('0x46')](_0x15df5a)?![]:!![]);})[_0x88ce('0x17')](function(_0x3b4732){logger[_0x88ce('0x30')](_0x3b4732);_0x2aafcc(null,![]);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x58')]=function(_0x1f34d1,_0x41fc76){sh[_0x88ce('0x59')](_[_0x88ce('0x5a')](_0x1f34d1),function(_0x43133b,_0x19c2b2){var _0x21b65e=_0x19c2b2[_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'');_0x41fc76(null,_0x21b65e);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x5c')]=function(_0x458343,_0x13a3f6){scripts['googleCloudTTS'](_0x458343['apiKey'],_0x458343[_0x88ce('0x5d')]||_0x88ce('0x5e'),_0x458343[_0x88ce('0x5e')],_0x458343['languageCode']||_0x88ce('0x5f'),_0x458343['ssmlGender']||_0x88ce('0x60'),_0x458343[_0x88ce('0x61')]||_0x88ce('0x62'))['then'](function(_0x505097){_0x13a3f6(null,_0x505097);})['catch'](function(_0x57c372){_0x13a3f6(_0x57c372);});};AGIVertices['prototype']['googleTTS']=function(_0x3359ea,_0x28826e){scripts['googleTTS'](_0x3359ea[_0x88ce('0x5e')],_0x3359ea[_0x88ce('0x63')]||'en',0x1)[_0x88ce('0x15')](function(_0x13092e){_0x28826e(null,_0x13092e);})[_0x88ce('0x17')](function(_0x363992){_0x28826e(_0x363992);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x64')]=function(_0x1ffa58,_0x140b6e){var _0x168fd9={'uri':_0x1ffa58[_0x88ce('0x65')],'method':_0x1ffa58[_0x88ce('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1ffa58['timeout'])==='number'&&parseInt(_0x1ffa58[_0x88ce('0x67')])>=0x1?parseInt(_0x1ffa58[_0x88ce('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x88ce('0x68')]([_0x88ce('0x69'),'PUT'],_0x168fd9[_0x88ce('0x66')][_0x88ce('0x6a')]())){try{_0x168fd9[_0x88ce('0x6b')]=_0x1ffa58['rawBody']?JSON['parse'](_0x1ffa58[_0x88ce('0xc')]):{};}catch(_0x222480){logger[_0x88ce('0x30')](_0x88ce('0x6c'),_0x222480);}}try{_0x168fd9['headers']=_0x1ffa58[_0x88ce('0xb')]?JSON[_0x88ce('0x6d')](_0x1ffa58[_0x88ce('0xb')]):{};}catch(_0x9f1a8c){logger[_0x88ce('0x30')](_0x88ce('0x6e'),_0x9f1a8c);}if(_0x1ffa58[_0x88ce('0x6f')]){try{var _0x2ed8c9=require(_0x1ffa58[_0x88ce('0x6f')])[_0x88ce('0x70')](this,_0x168fd9);_0x168fd9[_0x88ce('0x71')]=Mustache['render'](_0x1ffa58[_0x88ce('0x65')],_0x2ed8c9,{},['$$','$$']);if(_0x168fd9[_0x88ce('0x72')]){_0x168fd9[_0x88ce('0x72')]=JSON[_0x88ce('0x6d')](Mustache['render'](JSON[_0x88ce('0x73')](_0x168fd9[_0x88ce('0x72')]),_0x2ed8c9,{},['$$','$$']));}if(_0x168fd9['body']){_0x168fd9[_0x88ce('0x6b')]=JSON[_0x88ce('0x6d')](Mustache[_0x88ce('0x74')](JSON[_0x88ce('0x73')](_0x168fd9[_0x88ce('0x6b')]),_0x2ed8c9,{},['$$','$$']));}}catch(_0x38fee5){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x38fee5);}}rp(_0x168fd9)[_0x88ce('0x15')](function(_0x11e364){var _0x49ebf5={'statusCode':_0x11e364['statusCode']||0xc8,'statusMessage':_0x11e364[_0x88ce('0x75')]||'OK','headers':_0x11e364[_0x88ce('0x72')]||{},'body':_0x11e364[_0x88ce('0x6b')]||{}};_0x140b6e(null,_0x49ebf5);})[_0x88ce('0x17')](function(_0x226b7e){var _0x113b25={'statusCode':_0x226b7e[_0x88ce('0x76')]||0x1f4,'statusMessage':_0x226b7e[_0x88ce('0x77')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x226b7e[_0x88ce('0x78')][_0x88ce('0x72')]||{},'body':_0x226b7e[_0x88ce('0x78')][_0x88ce('0x6b')]||{}};_0x140b6e(null,_0x113b25);});};AGIVertices[_0x88ce('0x13')]['googleDialogflow']=function(_0x2c471c,_0x305179){scripts[_0x88ce('0x79')](this[_0x88ce('0x10')]['uniqueid'],_0x2c471c['key'],_0x2c471c[_0x88ce('0x5e')],_0x2c471c[_0x88ce('0x7a')]||'en')[_0x88ce('0x15')](function(_0x137505){_0x305179(null,_0x137505);})[_0x88ce('0x17')](function(_0x35f619){_0x305179(_0x35f619);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x7b')]=function(_0x557c55,_0x2e2e71){scripts[_0x88ce('0x7b')](this['channel']['uniqueid'],_0x557c55[_0x88ce('0x7c')],_0x557c55[_0x88ce('0x7d')],_0x557c55['private_key'],_0x557c55['text'],_0x557c55['dialogflowV2_language']||'en')[_0x88ce('0x15')](function(_0x58fdf4){_0x2e2e71(null,_0x58fdf4);})['catch'](function(_0x3e24d5){_0x2e2e71(_0x3e24d5);});};AGIVertices['prototype'][_0x88ce('0x7e')]=function(_0x466e56,_0x3ea030){scripts[_0x88ce('0x7e')](this[_0x88ce('0x10')],_0x466e56)[_0x88ce('0x15')](function(_0x2f2d2e){_0x3ea030(null,_0x2f2d2e);})['catch'](function(_0x46777b){_0x3ea030(_0x46777b);});};AGIVertices[_0x88ce('0x13')]['ispeechTTS']=function(_0xf1a87e,_0x328928){scripts[_0x88ce('0x7f')](_0xf1a87e[_0x88ce('0x80')],_0xf1a87e[_0x88ce('0x5e')],_0xf1a87e[_0x88ce('0x81')]||_0x88ce('0x5f'),_0xf1a87e['speed'])[_0x88ce('0x15')](function(_0x45f901){_0x328928(null,_0x45f901);})[_0x88ce('0x17')](function(_0x2b5f7c){_0x328928(_0x2b5f7c);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x82')]=function(_0x3d653f,_0x41a8e3,_0x567493){scripts[_0x88ce('0x82')](_0x41a8e3,_0x3d653f[_0x88ce('0x80')],_0x3d653f[_0x88ce('0x83')]||_0x88ce('0x5f'),this['isConfigured'](_0x3d653f[_0x88ce('0x84')])?_0x3d653f[_0x88ce('0x84')]:undefined)['then'](function(_0x1a7d38){_0x567493(null,_0x1a7d38);})[_0x88ce('0x17')](function(_0x1f6c73){_0x567493(_0x1f6c73);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x85')]=function(_0x59475e,_0x38a64f){scripts['awsPolly'](_0x59475e['aws_access_key_id'],_0x59475e['aws_secret_access_key'],_0x59475e[_0x88ce('0x86')],_0x59475e[_0x88ce('0x87')]||'Amy',_0x59475e[_0x88ce('0x5e')],_0x59475e['aws_text_type']||_0x88ce('0x5e'))[_0x88ce('0x15')](function(_0x8319ab){_0x38a64f(null,_0x8319ab);})[_0x88ce('0x17')](function(_0x3c4e6a){_0x38a64f(_0x3c4e6a);});};AGIVertices[_0x88ce('0x13')]['awsLex']=function(_0x44b850,_0x360e39){scripts[_0x88ce('0x88')](this['channel'][_0x88ce('0x3b')],_0x44b850['aws_access_key_id'],_0x44b850[_0x88ce('0x89')],_0x44b850[_0x88ce('0x8a')],_0x44b850[_0x88ce('0x5e')],_0x44b850[_0x88ce('0x8b')])['then'](function(_0x54a51e){_0x360e39(null,_0x54a51e);})[_0x88ce('0x17')](function(_0x336e97){_0x360e39(_0x336e97);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x8c')]=function(_0x3bb1b4,_0x5b7155,_0x28152e){scripts[_0x88ce('0x8c')](_0x5b7155,_0x3bb1b4['key'],_0x3bb1b4[_0x88ce('0x8d')]||'en-US')[_0x88ce('0x15')](function(_0x30aa06){_0x28152e(null,_0x30aa06);})['catch'](function(_0x5681){_0x28152e(_0x5681);});};AGIVertices[_0x88ce('0x13')][_0x88ce('0x8e')]=function(_0x1704bb,_0xda259b,_0x55d86c){scripts['tildeASR'](_0xda259b,_0x1704bb['appid'],_0x1704bb['appsecret'],_0x1704bb[_0x88ce('0x71')])['then'](function(_0x15bab7){_0x55d86c(null,_0x15bab7);})[_0x88ce('0x17')](function(_0x3911d8){_0x55d86c(_0x3911d8);});};AGIVertices['prototype']['clear']=function(_0x3ea399){var _0x4f9012=_[_0x88ce('0x68')](verticesWithRetry,_0x3ea399[_0x88ce('0x8f')])?_0x3ea399:_[_0x88ce('0x90')](_0x3ea399);for(var _0x50f74e in _0x4f9012){if(_0x4f9012['hasOwnProperty'](_0x50f74e)){if(_0x4f9012[_0x50f74e]&&_[_0x88ce('0x91')](_0x4f9012[_0x50f74e])){if(_['includes'](recursiveMapAttributes,_0x50f74e)){_0x4f9012[_0x50f74e]=this[_0x88ce('0x92')](_0x4f9012[_0x50f74e]);}else{_0x4f9012[_0x50f74e]=this[_0x88ce('0x93')](_0x4f9012[_0x50f74e]);}}}}return _0x4f9012;};AGIVertices['prototype'][_0x88ce('0x94')]=function(_0x14fc54){for(var _0x3b7b4c in _0x14fc54){if(_0x14fc54[_0x88ce('0x95')](_0x3b7b4c)){if(_[_0x88ce('0x96')](_0x14fc54[_0x3b7b4c])){this[_0x88ce('0x94')](_0x14fc54[_0x3b7b4c]);}else if(_[_0x88ce('0x97')](_0x14fc54[_0x3b7b4c])){for(var _0x1c13e3=0x0;_0x1c13e3<_0x14fc54[_0x3b7b4c][_0x88ce('0x98')];_0x1c13e3++){this[_0x88ce('0x94')](_0x14fc54[_0x3b7b4c][_0x1c13e3]);}}else if(_[_0x88ce('0x91')](_0x14fc54[_0x3b7b4c])){_0x14fc54[_0x3b7b4c]=this[_0x88ce('0x93')](_0x14fc54[_0x3b7b4c]);}}}};AGIVertices['prototype']['saveRestApiResult']=function(_0x24e70b,_0x5b1a7b){for(var _0x12de3a in _0x24e70b){if(_0x24e70b[_0x88ce('0x95')](_0x12de3a)){if(_['isPlainObject'](_0x24e70b[_0x12de3a])){if(!_['isEmpty'](_0x24e70b[_0x12de3a])){this[_0x88ce('0x99')](_0x24e70b[_0x12de3a],util[_0x88ce('0x2c')](_0x88ce('0x9a'),_0x5b1a7b,_0x12de3a));}}else if(_[_0x88ce('0x97')](_0x24e70b[_0x12de3a])){for(var _0x17da67=0x0;_0x17da67<_0x24e70b[_0x12de3a][_0x88ce('0x98')];_0x17da67++){this[_0x88ce('0x99')](_0x24e70b[_0x12de3a][_0x17da67],util['format']('%s.%s',_0x5b1a7b,_0x12de3a+'['+_0x17da67+']'));}}else{if(!_['isNil'](_0x24e70b[_0x12de3a])){this[_0x88ce('0x10')]['setVariable'](util['format'](_0x88ce('0x9a'),_0x5b1a7b,_0x12de3a),_0x24e70b[_0x12de3a]);}}}}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x92')]=function(_0x2fe52a){try{var _0x3f5878=JSON[_0x88ce('0x6d')](_0x2fe52a);this[_0x88ce('0x94')](_0x3f5878);return JSON[_0x88ce('0x73')](_0x3f5878);}catch(_0x4d85b1){return this['replaceAllVariables'](_0x2fe52a);}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x93')]=function(_0xdf371b){var _0x25e4f4=_0xdf371b[_0x88ce('0x9b')]('{');for(var _0x25f0f3=0x1;_0x25f0f3<_0x25e4f4[_0x88ce('0x98')];_0x25f0f3+=0x1){var _0x4f86e1=_0x25e4f4[_0x25f0f3][_0x88ce('0x9b')]('}');if(_0x4f86e1[_0x88ce('0x98')]>0x1){_0xdf371b=_0xdf371b[_0x88ce('0x9c')]('{'+_0x4f86e1[0x0]+'}',this['channel'][_0x88ce('0x14')](_0x4f86e1[0x0])[_0x88ce('0x9d')]||_0x4f86e1[0x0]);}}if(_0x25e4f4[_0x88ce('0x98')]===0x1){return _0xdf371b[_0x88ce('0x50')]();}return this[_0x88ce('0x93')](_0xdf371b);};AGIVertices['prototype']['getAndSetVariable']=function(_0x357229,_0x2c4e01){var _0x14abcb=this[_0x88ce('0x10')]['getVariable'](_0x357229);if(_0x14abcb[_0x88ce('0x9e')]===-0x1){return _0x14abcb;}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x9f'),_0x2c4e01,_0x14abcb[_0x88ce('0x9d')]));return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x2c4e01,_0x14abcb[_0x88ce('0x9d')]);};AGIVertices[_0x88ce('0x13')]['isConfigured']=function(_0x3de8dc){return _0x3de8dc&&_0x3de8dc!=='0'&&_0x3de8dc!=='-1'&&_0x3de8dc!=='';};AGIVertices[_0x88ce('0x13')]['maxRetry']=function(_0xa8b8e1){this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0xa8b8e1,'-');_0xa8b8e1[_0x88ce('0xa1')]=_0xa8b8e1[_0x88ce('0xa2')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x88ce('0xa3')]=function(_0x23564f){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x23564f[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x23564f[_0x88ce('0x5e')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xa5'));}var _0x189a4f='\x22'+_0x23564f[_0x88ce('0x5e')]+'\x22';if(this[_0x88ce('0xa4')](_0x23564f[_0x88ce('0x78')])){_0x189a4f+=','+_0x23564f[_0x88ce('0x78')];}var _0x261a9c=this[_0x88ce('0x10')]['exec'](_0x88ce('0xa6'),_0x189a4f);if(_0x261a9c[_0x88ce('0x9e')]===-0x1){return _0x261a9c;}return this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0x189a4f));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xa7')]=function(_0x5dc0bb){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xa8'),_0x5dc0bb[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x5dc0bb[_0x88ce('0xa9')])){return this['channel'][_0x88ce('0xaa')]('no\x20grammar\x20configured');}var _0xb07cef=_0x5dc0bb['grammar'];if(this['isConfigured'](_0x5dc0bb[_0x88ce('0x78')])){_0xb07cef+=','+_0x5dc0bb[_0x88ce('0x78')];}var _0xe30a6b=this[_0x88ce('0x10')][_0x88ce('0x59')]('MRCPRecog',_0xb07cef);if(_0xe30a6b[_0x88ce('0x9e')]===-0x1){return _0xe30a6b;}var _0x3195a5=this[_0x88ce('0xab')]('RECOG_CONFIDENCE()',_0x88ce('0xac'));if(_0x3195a5[_0x88ce('0x9e')]===-0x1){return _0x3195a5;}var _0x3ce8af=this[_0x88ce('0xab')](_0x88ce('0xad'),'MRCP_RECOG_TRANSCRIPT');if(_0x3ce8af[_0x88ce('0x9e')]===-0x1){return _0x3ce8af;}var _0x3612f4=this['getAndSetVariable'](_0x88ce('0xae'),_0x88ce('0xaf'));if(_0x3612f4['result']===-0x1){return _0x3612f4;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0xb07cef));};AGIVertices['prototype'][_0x88ce('0x8')]=function(_0x4f5d25){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb1'),_0x4f5d25['label']));return this[_0x88ce('0x10')]['agi']([_0x4f5d25['command'],_0x4f5d25[_0x88ce('0xb2')]]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0xb3')]=function(_0x4fd795){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb4'),_0x4fd795['label']));if(this[_0x88ce('0xa4')](_0x4fd795[_0x88ce('0x67')])){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xb5'),_0x4fd795[_0x88ce('0x67')]));var _0x1cda82=this[_0x88ce('0x10')][_0x88ce('0xb6')](_0x4fd795['timeout']);if(_0x1cda82['result']===-0x1){return _0x1cda82;}}return this[_0x88ce('0x10')][_0x88ce('0xb3')]();};AGIVertices[_0x88ce('0x13')][_0x88ce('0x4d')]=function(_0x38d8a6){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xb7'),_0x38d8a6['label']));if(!this[_0x88ce('0xa4')](_0x38d8a6[_0x88ce('0x4c')])){return this['channel'][_0x88ce('0x30')](_0x38d8a6,'no\x20list\x20selected');}_0x38d8a6['scheduledAt']=moment();if(this[_0x88ce('0xa4')](_0x38d8a6[_0x88ce('0xb8')])){_0x38d8a6[_0x88ce('0x4f')]=moment()[_0x88ce('0xb9')](_0x38d8a6[_0x88ce('0xb8')],_0x88ce('0xba'));}if(!this[_0x88ce('0xa4')](_0x38d8a6['callback_priority'])){_0x38d8a6['callback_priority']=0x2;}this[_0x88ce('0x45')]['sync'](this,_0x38d8a6);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x38d8a6[_0x88ce('0x4b')],_0x38d8a6['list_id'],_0x38d8a6[_0x88ce('0x4f')]));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xbb')]=function(_0x192ea7){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x192ea7[_0x88ce('0x3c')]));var _0xa3b0aa=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x192ea7[_0x88ce('0xbc')],_0x192ea7[_0x88ce('0x78')]);if(_0xa3b0aa[_0x88ce('0x9e')]===-0x1){return _0xa3b0aa;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x192ea7['application'],_0x192ea7['options']));};AGIVertices['prototype'][_0x88ce('0xbd')]=function(_0x1e176d){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x1e176d['label']));if(!this[_0x88ce('0xa4')](_0x1e176d[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}var _0xdfc61b='\x22'+_0x1e176d['text']+'\x22';if(this[_0x88ce('0xa4')](_0x1e176d[_0x88ce('0x78')])){_0xdfc61b+=','+_0x1e176d[_0x88ce('0x78')];}var _0x21de38=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xa6'),_0xdfc61b);if(_0x21de38[_0x88ce('0x9e')]===-0x1){return _0x21de38;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20MRCPSynth\x20%s',_0xdfc61b));};AGIVertices[_0x88ce('0x13')]['sestektts']=function(_0x309ab0){logger[_0x88ce('0x31')](util['format'](_0x88ce('0xbe'),_0x309ab0[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x309ab0[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}var _0x44805b='\x22'+_0x309ab0['text']+'\x22';if(this['isConfigured'](_0x309ab0['options'])){_0x44805b+=','+_0x309ab0['options'];}var _0x2cdcc0=this[_0x88ce('0x10')]['exec']('MRCPSynth',_0x44805b);if(_0x2cdcc0[_0x88ce('0x9e')]===-0x1){return _0x2cdcc0;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xbf'),_0x44805b));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xc0')]=function(_0x323018){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xc1'),_0x323018['label']));if(!this[_0x88ce('0xa4')](_0x323018[_0x88ce('0xa9')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xc2'));}var _0x41a612=_0x323018[_0x88ce('0xa9')];if(this['isConfigured'](_0x323018[_0x88ce('0x78')])){_0x41a612+=','+_0x323018[_0x88ce('0x78')];}var _0xd75991=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xc3'),_0x41a612);if(_0xd75991[_0x88ce('0x9e')]===-0x1){return _0xd75991;}var _0x4aaa23=this[_0x88ce('0xab')]('RECOG_CONFIDENCE()',_0x88ce('0xc4'));if(_0x4aaa23[_0x88ce('0x9e')]===-0x1){return _0x4aaa23;}var _0x2e1e5a=this['getAndSetVariable'](_0x88ce('0xad'),_0x88ce('0xc5'));if(_0x2e1e5a[_0x88ce('0x9e')]===-0x1){return _0x2e1e5a;}var _0xb537f3=this[_0x88ce('0xab')](_0x88ce('0xae'),_0x88ce('0xc6'));if(_0xb537f3['result']===-0x1){return _0xb537f3;}return this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0x41a612));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xc7')]=function(_0x1a9c69){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xc8'),_0x1a9c69[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x1a9c69[_0x88ce('0xa9')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xc2'));}var _0x4755bb=_0x1a9c69[_0x88ce('0xa9')];if(this[_0x88ce('0xa4')](_0x1a9c69['options'])){_0x4755bb+=','+_0x1a9c69[_0x88ce('0x78')];}var _0x59e549=this['channel'][_0x88ce('0x59')](_0x88ce('0xc3'),_0x4755bb);if(_0x59e549['result']===-0x1){return _0x59e549;}var _0x31041e=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x88ce('0xc9'));if(_0x31041e['result']===-0x1){return _0x31041e;}var _0x705aa3=this[_0x88ce('0xab')](_0x88ce('0xad'),'SESTEK_ASR_TRANSCRIPT');if(_0x705aa3[_0x88ce('0x9e')]===-0x1){return _0x705aa3;}var _0x330326=this[_0x88ce('0xab')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x330326[_0x88ce('0x9e')]===-0x1){return _0x330326;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xb0'),_0x4755bb));};AGIVertices['prototype']['database']=function(_0x487ec5){logger[_0x88ce('0x31')](util['format'](_0x88ce('0xca'),_0x487ec5[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x487ec5[_0x88ce('0xcb')])){return this['channel'][_0x88ce('0x30')](_0x487ec5,_0x88ce('0xcc'));}var _0x5275da=this[_0x88ce('0x1b')][_0x88ce('0x70')](this,_0x487ec5['odbc_id']);if(!_0x5275da){return this['channel'][_0x88ce('0x30')](_0x487ec5,_0x88ce('0xcd'));}if(!this['isConfigured'](_0x487ec5[_0x88ce('0x33')])){return this['channel']['error'](_0x487ec5,_0x88ce('0xce'));}var _0x502487=_0x487ec5[_0x88ce('0x33')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('query:\x20%s',_0x502487));var _0x1ee1bc=this['getQueryOdbc'][_0x88ce('0x70')](this,_0x5275da,_0x502487);this['createSquareDetailsReport']['sync'](this,_0x487ec5,_0x502487);if(!this[_0x88ce('0xa4')](_0x487ec5['variable_id'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2c1a3f=this['getVariable'][_0x88ce('0x70')](this,_0x487ec5[_0x88ce('0xcf')]);if(!_0x2c1a3f){return this[_0x88ce('0x10')]['error'](_0x487ec5,'no\x20variable\x20found');}var _0x2bce67=this;_0x1ee1bc['forEach'](function(_0x95387d,_0xc06dd0){Object[_0x88ce('0xd0')](_0x95387d)['forEach'](function(_0x1f7194){_0x2bce67[_0x88ce('0x10')]['setVariable'](util['format'](_0x88ce('0xd1'),_0x2c1a3f,_0xc06dd0,_0x1f7194),_0x95387d[_0x1f7194]);});});this['channel'][_0x88ce('0xa0')](util['format']('%s_ROWS_COUNT',_0x2c1a3f),_0x1ee1bc[_0x88ce('0x98')]);return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xd2'),_0x2c1a3f));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xd3')]=function(_0x31f880){logger[_0x88ce('0xd4')](util[_0x88ce('0x2c')](_0x88ce('0xd5'),_0x31f880[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x31f880[_0x88ce('0xd6')])){return this['channel'][_0x88ce('0x30')](_0x31f880,_0x88ce('0xd7'));}var _0x25dee6=this[_0x88ce('0x1e')][_0x88ce('0x70')](this,_0x31f880[_0x88ce('0xd6')]);if(!_0x25dee6){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x31f880,_0x88ce('0xd8'));}var _0x23e1d0=this['channel'][_0x88ce('0x59')](_0x88ce('0xd9'),[util[_0x88ce('0x2c')](_0x88ce('0xda'),_0x25dee6),_0x31f880[_0x88ce('0x67')],_0x31f880[_0x88ce('0xdb')],_0x31f880['url']]);if(_0x23e1d0[_0x88ce('0x9e')]===-0x1){return _0x23e1d0;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xdc'),_0x88ce('0xd9')));};AGIVertices['prototype'][_0x88ce('0xdd')]=function(_0x3bd15e){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xde'),_0x3bd15e[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x3bd15e[_0x88ce('0x80')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xdf'));}if(!this['isConfigured'](_0x3bd15e[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20text\x20configured');}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x3bd15e);this[_0x88ce('0x44')](_0x3bd15e['text'],'in','','');this['channel'][_0x88ce('0xaa')](util['format']('Trying\x20Dialogflow:\x20%s',_0x3bd15e['text']));var _0x4511b0=this[_0x88ce('0x79')][_0x88ce('0x70')](this,_0x3bd15e);if(_0x4511b0){for(var _0xaf561c in _0x4511b0){if(_0x4511b0[_0x88ce('0x95')](_0xaf561c)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format']('DIALOGFLOW_%s',_0xaf561c[_0x88ce('0x6a')]()),_0x4511b0[_0xaf561c]);}}this['createSquareMessage'](_0x4511b0[_0x88ce('0xe1')],'out',_0x88ce('0xdd'),'');return this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xe2'),_0x4511b0['speech']));}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x3bd15e,_0x88ce('0xe3'));};AGIVertices['prototype'][_0x88ce('0xe4')]=function(_0x3623be){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3623be[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x7c')])){return this['channel']['noop']('no\x20project_id\x20configured');}if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x7d')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe5'));}if(!this[_0x88ce('0xa4')](_0x3623be['private_key'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe6'));}if(!this[_0x88ce('0xa4')](_0x3623be['dialogflowV2_language'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xe7'));}if(!this[_0x88ce('0xa4')](_0x3623be[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this['channel'][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x3623be);this[_0x88ce('0x44')](_0x3623be[_0x88ce('0x5e')],'in','','');this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xe8'),_0x3623be['text']));var _0x186327=this[_0x88ce('0x7b')][_0x88ce('0x70')](this,_0x3623be);if(_0x186327){for(var _0x2bc003 in _0x186327){if(_0x186327['hasOwnProperty'](_0x2bc003)){if(_0x2bc003!=='providerResponse'){this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')](_0x88ce('0xe9'),_0x2bc003['toUpperCase']()),_0x186327[_0x2bc003]);}}}this[_0x88ce('0x44')](_0x186327[_0x88ce('0xe1')],_0x88ce('0xea'),_0x88ce('0xe4'),_0x186327[_0x88ce('0xeb')]);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xec'),_0x186327[_0x88ce('0xe1')]));}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x3623be,_0x88ce('0xed'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xee')]=function(_0x191d41){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0xef'),_0x191d41[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x191d41[_0x88ce('0xf0')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xf1'));}if(!this['isConfigured'](_0x191d41['username'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xf2'));}if(!this[_0x88ce('0xa4')](_0x191d41[_0x88ce('0xf3')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')]('no\x20password\x20configured');}if(!this['isConfigured'](_0x191d41['ndassistant_url'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x191d41);this[_0x88ce('0x44')](_0x191d41[_0x88ce('0x5e')],'in','','');this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xf4'),_0x191d41[_0x88ce('0x5e')]));var _0x2eaa64=this[_0x88ce('0x7e')][_0x88ce('0x70')](this,_0x191d41);if(_0x2eaa64){for(var _0x45b8e8 in _0x2eaa64){if(_0x2eaa64[_0x88ce('0x95')](_0x45b8e8)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format'](_0x88ce('0xf5'),_0x45b8e8['toUpperCase']()),_0x2eaa64[_0x45b8e8]);}}this[_0x88ce('0x44')](_0x2eaa64[_0x88ce('0xe1')],_0x88ce('0xea'),_0x88ce('0xee'),'');if(_0x2eaa64['audiofile']){this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0xf6'),_0x2eaa64[_0x88ce('0xf7')]));var _0x969d32=this[_0x88ce('0x10')][_0x88ce('0xf8')](_0x2eaa64[_0x88ce('0xf7')]);try{fs[_0x88ce('0xf9')](_0x2eaa64[_0x88ce('0xf7')]+_0x88ce('0xfa'));}catch(_0xeecc16){logger[_0x88ce('0x30')](_0xeecc16);}return _0x969d32;}else{return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0xfb'),_0x2eaa64['speech']));}}return this['channel'][_0x88ce('0x30')](_0x191d41,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x88ce('0x13')][_0x88ce('0xfc')]=function(_0x40cf93){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x40cf93['label']));return this['channel'][_0x88ce('0xaa')](_0x88ce('0xfc'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0xfd')]=function(_0x181d7a){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0xfe'),_0x181d7a[_0x88ce('0x3c')]));var _0x2e041b='';if(_0x181d7a[_0x88ce('0xff')]){if(!this['isConfigured'](_0x181d7a['trunk_id'])){return this[_0x88ce('0x10')]['error'](_0x181d7a,_0x88ce('0x100'));}else{var _0x1d5553=parseInt(_0x181d7a[_0x88ce('0xff')],0xa);if(isNaN(_0x1d5553)){_0x2e041b=_0x181d7a[_0x88ce('0xff')];}else{_0x2e041b=this['getTrunk'][_0x88ce('0x70')](this,_0x181d7a[_0x88ce('0xff')]);if(!_0x2e041b){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x181d7a,_0x88ce('0x101'));}}}}else if(_0x181d7a[_0x88ce('0x102')]){_0x2e041b=_0x181d7a[_0x88ce('0x102')];}else{return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x181d7a,_0x88ce('0x100'));}var _0x31e5b2=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0xd9'),[util[_0x88ce('0x2c')]('SIP/%s/%s',_0x2e041b,_0x181d7a[_0x88ce('0x4b')]),_0x181d7a[_0x88ce('0x67')],_0x181d7a[_0x88ce('0xdb')],_0x181d7a[_0x88ce('0x65')]]);if(_0x31e5b2[_0x88ce('0x9e')]===-0x1){return _0x31e5b2;}return this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0xdc'),'DIAL'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x103')]=function(_0x5b08a6){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x104'),_0x5b08a6[_0x88ce('0x3c')]));return this[_0x88ce('0x10')]['noop'](_0x88ce('0x103'));};AGIVertices['prototype'][_0x88ce('0xe')]=function(_0x258fcf){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x105'),_0x258fcf[_0x88ce('0x3c')]));if(_0x258fcf[_0x88ce('0xa1')]===0x0){return this[_0x88ce('0xa2')](_0x258fcf);}_0x258fcf[_0x88ce('0xa1')]-=0x1;if(!this[_0x88ce('0xa4')](_0x258fcf['file_id'])){return this[_0x88ce('0x10')]['error'](_0x258fcf,_0x88ce('0x106'));}var _0x2e5d2c=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x258fcf[_0x88ce('0x107')]);if(!_0x2e5d2c){return this[_0x88ce('0x10')]['error'](_0x258fcf,'no\x20file\x20audio\x20found');}if(!this[_0x88ce('0xa4')](_0x258fcf[_0x88ce('0xcf')])){return this[_0x88ce('0x10')]['error']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2b3edc=this[_0x88ce('0x10')][_0x88ce('0x108')](_0x2e5d2c,_0x258fcf['response'],_0x258fcf[_0x88ce('0x109')]);var _0x1825ea=_0x2b3edc['result']?_0x2b3edc[_0x88ce('0x9e')]['toString']():'';logger['info'](_0x88ce('0x10a'),JSON['stringify'](_0x2b3edc));if(_0x2b3edc[_0x88ce('0x9e')]===-0x1){this[_0x88ce('0x3a')]['sync'](this,_0x258fcf,_0x1825ea);return _0x2b3edc;}else if(_0x2b3edc[_0x88ce('0x9d')]===_0x88ce('0x67')){_0x2b3edc[_0x88ce('0x9e')]=_0x1825ea['length']>=parseInt(_0x258fcf['mindigit'])?'x':'i';}else{_0x2b3edc[_0x88ce('0x9e')]=_0x1825ea[_0x88ce('0x98')]>=parseInt(_0x258fcf[_0x88ce('0x10b')])&&_0x1825ea[_0x88ce('0x98')]<=parseInt(_0x258fcf[_0x88ce('0x109')])?'x':'i';}var _0x2c6d44=this['getVariable'][_0x88ce('0x70')](this,_0x258fcf[_0x88ce('0xcf')]);if(!_0x2c6d44){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x258fcf,_0x88ce('0x10c'));}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x2c6d44,_0x1825ea);if(this['isConfigured'](_0x258fcf[_0x88ce('0x10d')])){var _0x2a9391=parseInt(_0x258fcf[_0x88ce('0x10d')],0xa);var _0x22a46f=rs[_0x88ce('0x10e')]({'charset':'*','length':_0x2a9391});var _0x3ade53=_0x1825ea['length'];if(_0x3ade53>0x0){if(_0x3ade53>_0x2a9391){this['createSquareDetailsReport'][_0x88ce('0x70')](this,_0x258fcf,_0x258fcf['hiddendigitspos']===_0x88ce('0x10f')?_0x22a46f+_0x1825ea[_0x88ce('0x110')](_0x2a9391):_0x1825ea['substr'](0x0,_0x3ade53-_0x2a9391)+_0x22a46f);}else{this[_0x88ce('0x3a')]['sync'](this,_0x258fcf,rs[_0x88ce('0x10e')]({'charset':'*','length':_0x3ade53}));}}else{this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x258fcf,'');}}else{this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x258fcf,_0x1825ea);}return _0x2b3edc;};AGIVertices[_0x88ce('0x13')][_0x88ce('0xf')]=function(_0x1e749e){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x111'),_0x1e749e[_0x88ce('0x3c')]));return this['getdigits'](_0x1e749e);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x112')]=function(_0x576a33){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x576a33['label']));this['createSquareDetailsReport']['sync'](this,_0x576a33,_0x576a33[_0x88ce('0x113')]);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x114'),_0x576a33['goalname']));};AGIVertices['prototype'][_0x88ce('0x115')]=function(_0x5ee649){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x5ee649['label']));if(!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x116')])||!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x89')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x117'));}if(!this[_0x88ce('0xa4')](_0x5ee649[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x118'),_0x5ee649[_0x88ce('0x5e')]));var _0x501a5b=this['awsPolly']['sync'](this,_0x5ee649);if(_0x501a5b){this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x501a5b));var _0x315805=this[_0x88ce('0x10')]['streamFile'](_0x501a5b);try{fs[_0x88ce('0xf9')](_0x501a5b+_0x88ce('0xfa'));}catch(_0x1991ff){logger[_0x88ce('0x30')](_0x1991ff);}return _0x315805;}return this['channel'][_0x88ce('0x30')](_0x5ee649,_0x88ce('0x119'));};AGIVertices[_0x88ce('0x13')]['awslex']=function(_0x59f336){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x11a'),_0x59f336['label']));if(!this['isConfigured'](_0x59f336[_0x88ce('0x116')])||!this[_0x88ce('0xa4')](_0x59f336[_0x88ce('0x89')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0x117'));}if(!this[_0x88ce('0xa4')](_0x59f336['aws_bot_name'])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0x11b'));}if(!this[_0x88ce('0xa4')](_0x59f336[_0x88ce('0x5e')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xe0')]=!![];this[_0x88ce('0x3a')](_0x59f336);this[_0x88ce('0x44')](_0x59f336['text'],'in','','');this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x11c'),_0x59f336[_0x88ce('0x5e')]));var _0x5b5e08=this['awsLex'][_0x88ce('0x70')](this,_0x59f336);if(_0x5b5e08){for(var _0x34fdce in _0x5b5e08){if(_0x5b5e08[_0x88ce('0x95')](_0x34fdce)&&_[_0x88ce('0x91')](_0x5b5e08[_0x34fdce])){this['channel']['setVariable'](util['format'](_0x88ce('0x11d'),_0x34fdce[_0x88ce('0x6a')]()),_0x5b5e08[_0x34fdce]);}}if(_['isNil'](_0x5b5e08[_0x88ce('0x77')])){return this['channel'][_0x88ce('0xaa')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x88ce('0x44')](_0x5b5e08['message'],_0x88ce('0xea'),_0x88ce('0x11e'),'');return this[_0x88ce('0x10')]['noop'](util['format'](_0x88ce('0x11f'),_0x5b5e08[_0x88ce('0x77')]));}}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x59f336,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x88ce('0x13')][_0x88ce('0x120')]=function(_0x5ea773){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x121'),_0x5ea773['label'],_0x5ea773[_0x88ce('0x67')]));if(!this[_0x88ce('0xa4')](_0x5ea773[_0x88ce('0x80')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xdf'));}var _0x4b2cde=_0x88ce('0x122');var _0x53e3ee=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0x2ef082=util[_0x88ce('0x2c')]('%s.%s',_0x53e3ee,_0x4b2cde);var _0x4ac48b=!![];if(_0x5ea773['beep']==='NOBEEP'){_0x4ac48b=![];}var _0x2dcf45=this[_0x88ce('0x10')][_0x88ce('0x124')](_0x53e3ee,_0x4b2cde,_0x5ea773['intKey'],_0x5ea773[_0x88ce('0x67')],undefined,_0x4ac48b);if(_0x2dcf45[_0x88ce('0x9e')]!==-0x1){this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x125'),_0x2ef082));var _0x34a5bf=this[_0x88ce('0x8c')]['sync'](this,_0x5ea773,_0x2ef082);if(_0x34a5bf){for(var _0x276ae3 in _0x34a5bf){if(_0x34a5bf[_0x88ce('0x95')](_0x276ae3)){this[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')]('GOOGLE_ASR_%s',_0x276ae3[_0x88ce('0x6a')]()),_0x34a5bf[_0x276ae3]);}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x126'),JSON[_0x88ce('0x73')](_0x34a5bf)));}}return _0x2dcf45;};AGIVertices['prototype'][_0x88ce('0x127')]=function(_0xd309b7){logger['info'](util['format'](_0x88ce('0x128'),_0xd309b7['label']));if(!this[_0x88ce('0xa4')](_0xd309b7[_0x88ce('0x129')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x12a'));}if(!this[_0x88ce('0xa4')](_0xd309b7[_0x88ce('0x12b')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x12c'));}var _0x407843=_0x88ce('0x122');var _0x2253f7=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0x3138cb=util['format'](_0x88ce('0x9a'),_0x2253f7,_0x407843);var _0x49f19a=!![];if(_0xd309b7[_0x88ce('0x12d')]===_0x88ce('0x12e')){_0x49f19a=![];}var _0x3142b0=this['channel'][_0x88ce('0x124')](_0x2253f7,_0x407843,_0xd309b7[_0x88ce('0x12f')],_0xd309b7[_0x88ce('0x67')],undefined,_0x49f19a);if(_0x3142b0[_0x88ce('0x9e')]!==-0x1){this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('tilde\x20%s\x20file\x20created',_0x3138cb));var _0x172225=this[_0x88ce('0x8e')][_0x88ce('0x70')](this,_0xd309b7,_0x3138cb);if(_0x172225){for(var _0x3bf56c in _0x172225){if(_0x172225['hasOwnProperty'](_0x3bf56c)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')]('TILDE_ASR_%s',_0x3bf56c[_0x88ce('0x6a')]()),_0x172225[_0x3bf56c]);}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('TildeASR\x20Result\x20%s',JSON[_0x88ce('0x73')](_0x172225)));}}return _0x3142b0;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x130')]=function(_0x10be63){logger['info'](util['format'](_0x88ce('0x131'),_0x10be63['label']));return this['channel'][_0x88ce('0x132')](_0x10be63[_0x88ce('0x3f')],_0x10be63[_0x88ce('0x133')],_0x10be63[_0x88ce('0x40')]);};AGIVertices[_0x88ce('0x13')]['gotoif']=function(_0x55e884){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x134'),_0x55e884['label']));if(!this[_0x88ce('0xa4')](_0x55e884['condition'])){return this['channel']['error'](_0x55e884,_0x88ce('0x135'));}try{var _0x17be65=eval(_0x55e884[_0x88ce('0x136')])?_0x88ce('0x137'):'false';this[_0x88ce('0x10')]['noop'](util['format'](_0x88ce('0x138'),_0x55e884[_0x88ce('0x136')],_0x17be65));return{'code':0xc8,'result':_0x17be65};}catch(_0x15bbde){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x139')]=function(_0x18b256){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x13a'),_0x18b256[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x18b256[_0x88ce('0x13b')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x18b256,_0x88ce('0x13c'));}var _0x1658a5=this[_0x88ce('0x28')]['sync'](this,_0x18b256[_0x88ce('0x13b')]);if(!_0x1658a5){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x18b256,_0x88ce('0x13d'));}for(var _0x38b7fb=0x0;_0x38b7fb<_0x1658a5[_0x88ce('0x98')];_0x38b7fb+=0x1){var _0x61078b=this[_0x88ce('0x10')][_0x88ce('0x14')](util[_0x88ce('0x2c')]('IFTIME(%s?true:false)',_0x1658a5[_0x38b7fb]));if(_0x61078b[_0x88ce('0x9e')]===-0x1){return _0x61078b;}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x61078b[_0x88ce('0x9d')]));if(_0x61078b[_0x88ce('0x9d')]==='true'){logger[_0x88ce('0x31')](util['format']('IFTIME\x20%s\x20%s',_0x1658a5[_0x38b7fb],_0x88ce('0x137')));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x137')));return{'code':0xc8,'result':_0x88ce('0x137')};}else{logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x13f')));this['channel']['noop'](util['format'](_0x88ce('0x13e'),_0x1658a5[_0x38b7fb],_0x88ce('0x13f')));}}return{'code':0xc8,'result':_0x88ce('0x13f')};};AGIVertices[_0x88ce('0x13')][_0x88ce('0x140')]=function(_0x56e8be){logger[_0x88ce('0x31')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x56e8be['label']));return this[_0x88ce('0x10')][_0x88ce('0x140')]();};AGIVertices[_0x88ce('0x13')][_0x88ce('0x141')]=function(_0x5b2b86){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x142'),_0x5b2b86['label']));if(!this['isConfigured'](_0x5b2b86[_0x88ce('0x80')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xdf'));}var _0x3d026d=_0x88ce('0x122');var _0x13cfd3=util['format'](_0x88ce('0x123'),FILES_PATH,rs[_0x88ce('0x10e')](0x4));var _0xd67fd3=util['format']('%s.%s',_0x13cfd3,_0x3d026d);var _0x1a61f7=!![];if(_0x5b2b86['beep']===_0x88ce('0x12e')){_0x1a61f7=![];}var _0xfcc57a=this[_0x88ce('0x10')][_0x88ce('0x124')](_0x13cfd3,_0x3d026d,_0x5b2b86[_0x88ce('0x12f')],_0x5b2b86[_0x88ce('0x67')],undefined,_0x1a61f7);if(_0xfcc57a[_0x88ce('0x9e')]!==-0x1){this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x143'),_0xd67fd3));var _0x2f3a0e=this[_0x88ce('0x82')]['sync'](this,_0x5b2b86,_0xd67fd3);if(_0x2f3a0e){for(var _0xcfa5dc in _0x2f3a0e){if(_0x2f3a0e[_0x88ce('0x95')](_0xcfa5dc)){this[_0x88ce('0x10')][_0x88ce('0xa0')](util['format'](_0x88ce('0x144'),_0xcfa5dc[_0x88ce('0x6a')]()),_0x2f3a0e[_0xcfa5dc]);}}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x145'),JSON[_0x88ce('0x73')](_0x2f3a0e)));}}return _0xfcc57a;};AGIVertices[_0x88ce('0x13')][_0x88ce('0x146')]=function(_0x5c0861){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x147'),_0x5c0861[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x5c0861[_0x88ce('0x80')])){return this[_0x88ce('0x10')]['noop'](_0x88ce('0xdf'));}if(!this[_0x88ce('0xa4')](_0x5c0861[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x148'),_0x5c0861[_0x88ce('0x5e')]));var _0x307c7e=this['ispeechTTS'][_0x88ce('0x70')](this,_0x5c0861);if(_0x307c7e){this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x143'),_0x307c7e));var _0x44cb27=this['channel'][_0x88ce('0xf8')](_0x307c7e,_0x5c0861[_0x88ce('0x12f')]);try{fs[_0x88ce('0xf9')](_0x307c7e+_0x88ce('0xfa'));}catch(_0xa4ea0b){logger['error'](_0xa4ea0b);}return _0x44cb27;}return this['channel'][_0x88ce('0x30')](_0x5c0861,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['login']=function(_0xcac372){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x149'),_0xcac372[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0xcac372[_0x88ce('0x14a')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0xcac372,_0x88ce('0x14b'));}logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));var _0x5b91a1=this[_0x88ce('0x14d')][_0x88ce('0x70')](this,_0xcac372[_0x88ce('0x14a')]);if(_0x5b91a1){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));this['channel'][_0x88ce('0xaa')](util['format'](_0x88ce('0x14e'),this['channel']['callerid'],_0xcac372[_0x88ce('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14f'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0xcac372['findBy']));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14f'),this[_0x88ce('0x10')]['callerid'],_0xcac372['findBy']));return{'code':0xc8,'result':_0x88ce('0x150')};}};AGIVertices[_0x88ce('0x13')][_0x88ce('0x151')]=function(_0x3cb22a){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x152'),_0x3cb22a[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x3cb22a[_0x88ce('0x14a')])){return this[_0x88ce('0x10')]['error'](_0x3cb22a,_0x88ce('0x14b'));}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x3cb22a[_0x88ce('0x14a')]));var _0x5cff82=this[_0x88ce('0x55')][_0x88ce('0x70')](this,_0x3cb22a['findBy']);if(_0x5cff82){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x3cb22a[_0x88ce('0x14a')]));this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')]['callerid'],_0x3cb22a['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14f'),this['channel']['callerid'],_0x3cb22a[_0x88ce('0x14a')]));this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')]['callerid'],_0x3cb22a['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x88ce('0x153')]=function(_0x5ef9f0){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x154'),_0x5ef9f0[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x5ef9f0[_0x88ce('0x155')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x5ef9f0,_0x88ce('0x156'));}this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('math\x20%s',_0x5ef9f0[_0x88ce('0x155')]));var _0x5c18c9=eval(_0x5ef9f0[_0x88ce('0x155')]);if(!this[_0x88ce('0xa4')](_0x5ef9f0[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x157'));}var _0x389614=this['getVariable']['sync'](this,_0x5ef9f0[_0x88ce('0xcf')]);if(!_0x389614){return this['channel']['error'](_0x5ef9f0,_0x88ce('0x10c'));}if(_['isArray'](_0x5c18c9)){var _0x3dd6a7=this;_0x5c18c9['forEach'](function(_0xde52bb,_0x4f35c0){_0x3dd6a7[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')](_0x88ce('0x158'),_0x389614,_0x4f35c0),_0xde52bb);});return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('variable\x20%s[key]\x20set',_0x389614));}else{return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x389614,_0x5c18c9);}};AGIVertices[_0x88ce('0x13')][_0x88ce('0xd')]=function(_0x17b32b){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x159'),_0x17b32b[_0x88ce('0x3c')]));if(_0x17b32b[_0x88ce('0xa1')]===0x0){return this[_0x88ce('0xa2')](_0x17b32b);}_0x17b32b['retry']-=0x1;if(!this['isConfigured'](_0x17b32b[_0x88ce('0x107')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x17b32b,'no\x20file\x20audio\x20selected');}var _0x48c3bd=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x17b32b['file_id']);if(!_0x48c3bd){return this['channel'][_0x88ce('0x30')](_0x17b32b,_0x88ce('0x15a'));}var _0x287b54=this[_0x88ce('0x10')][_0x88ce('0x108')](_0x48c3bd,_0x17b32b[_0x88ce('0x15b')],_0x17b32b[_0x88ce('0x15c')]);var _0x1c4968=_0x287b54[_0x88ce('0x9e')];if(_0x287b54[_0x88ce('0x9e')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x17b32b,'-1');return _0x287b54;}else if(_0x287b54[_0x88ce('0x9d')]===_0x88ce('0x67')){_0x287b54[_0x88ce('0x9e')]=_0x287b54[_0x88ce('0x9e')][_0x88ce('0x98')]>0x0?_0x287b54['result']:'t';}else if(_[_0x88ce('0x49')](_0x287b54[_0x88ce('0x9e')])){_0x287b54['result']='#';_0x1c4968='#';}if(!this['isConfigured'](_0x17b32b[_0x88ce('0xcf')])){this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x157'));}else{var _0x1d97c5=this['getVariable'][_0x88ce('0x70')](this,_0x17b32b[_0x88ce('0xcf')]);if(!_0x1d97c5){return this[_0x88ce('0x10')]['error'](_0x17b32b,'no\x20variable\x20found');}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x1d97c5,_0x1c4968);}this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x17b32b,_0x1c4968);return _0x287b54;};AGIVertices['prototype'][_0x88ce('0xaa')]=function(_0x1957b8){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x15d'),_0x1957b8[_0x88ce('0x3c')]));return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x1957b8[_0x88ce('0x15e')]||_0x1957b8['label']);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x15f')]=function(_0x28bc1a){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x160'),_0x28bc1a['label']));if(!this[_0x88ce('0xa4')](_0x28bc1a[_0x88ce('0x14a')])){return this[_0x88ce('0x10')]['error'](_0x28bc1a,_0x88ce('0x14b'));}logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a[_0x88ce('0x14a')]));var _0x2229c0=this['getPause'][_0x88ce('0x70')](this,_0x28bc1a[_0x88ce('0x161')]);var _0x5b7617=this['agentPause'][_0x88ce('0x70')](this,_0x28bc1a['findBy'],_0x2229c0);if(_0x5b7617){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a['findBy']));this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x28bc1a[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x162')};}else{logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14f'),this['channel'][_0x88ce('0x3d')],_0x28bc1a['findBy']));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')]['callerid'],_0x28bc1a[_0x88ce('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x88ce('0x163')]=function(_0x1cdc31){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1cdc31[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x1cdc31[_0x88ce('0x107')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x1cdc31,_0x88ce('0x106'));}var _0x4a0b2a=this['getSound'][_0x88ce('0x70')](this,_0x1cdc31[_0x88ce('0x107')]);if(!_0x4a0b2a){return this[_0x88ce('0x10')]['error'](_0x1cdc31,_0x88ce('0x15a'));}var _0x7c3e20=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0x164'),[_0x4a0b2a,_0x1cdc31[_0x88ce('0xdb')]]);if(_0x7c3e20[_0x88ce('0x9e')]===-0x1){return _0x7c3e20;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x165'),_0x88ce('0x164'),_0x4a0b2a));};AGIVertices['prototype'][_0x88ce('0x166')]=function(_0x183354){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x183354[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x183354[_0x88ce('0x167')])){return this[_0x88ce('0x10')]['error'](_0x183354,_0x88ce('0x168'));}var _0x575b0b='';var _0x50c693=parseInt(_0x183354[_0x88ce('0x167')],0xa);if(isNaN(_0x50c693)){_0x575b0b=_0x183354[_0x88ce('0x167')];}else{_0x575b0b=this[_0x88ce('0x18')][_0x88ce('0x70')](this,_0x183354[_0x88ce('0x167')]);if(!_0x575b0b){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x183354,'no\x20queue\x20found');}}var _0x2e409d='';if(this[_0x88ce('0xa4')](_0x183354[_0x88ce('0x107')])){var _0x2b8854=this[_0x88ce('0x22')][_0x88ce('0x70')](this,_0x183354[_0x88ce('0x107')]);if(_0x2b8854){_0x2e409d=_0x2b8854;}}this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x183354,_0x575b0b);if(_0x183354['opts'][_0x88ce('0x169')]('x')<0x0){_0x183354[_0x88ce('0xdb')]+='x';}if(_0x183354[_0x88ce('0xdb')][_0x88ce('0x169')]('X')<0x0){_0x183354[_0x88ce('0xdb')]+='X';}this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x88ce('0x16a'),_0x575b0b?_0x575b0b['toLowerCase']():'');var _0x55ad01=this[_0x88ce('0x10')]['exec'](_0x88ce('0x16b'),[_0x575b0b,_0x183354[_0x88ce('0xdb')],_0x183354['url'],_0x2e409d,_0x183354[_0x88ce('0x67')],_0x183354[_0x88ce('0x8')],_0x183354[_0x88ce('0x16c')],_0x183354[_0x88ce('0x16d')],'',_0x183354['position']]);if(_0x55ad01[_0x88ce('0x9e')]===-0x1){return _0x55ad01;}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x88ce('0x16b'),_0x575b0b));};AGIVertices[_0x88ce('0x13')]['record']=function(_0x48ea5d){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x16e'),_0x48ea5d['label']));var _0x4791d1=_0x48ea5d[_0x88ce('0x16f')]||_0x88ce('0x122');var _0xe2a229=util[_0x88ce('0x2c')](_0x88ce('0x170'),this[_0x88ce('0x10')][_0x88ce('0x3b')],rs[_0x88ce('0x10e')](0x5));var _0x2f04c8=util['format'](_0x88ce('0x171'),FILES_PATH,_0xe2a229,_0x4791d1);var _0x7d7c24=util[_0x88ce('0x2c')](_0x88ce('0x123'),FILES_PATH,_0xe2a229);this[_0x88ce('0x172')][_0x88ce('0x70')](this,_0x48ea5d,_0xe2a229,_0x2f04c8);this['channel'][_0x88ce('0xa0')](_0x88ce('0x173'),_0xe2a229);logger[_0x88ce('0x31')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x7d7c24,_0x4791d1,_0x48ea5d[_0x88ce('0x174')],_0x48ea5d['timeout']);return this[_0x88ce('0x10')][_0x88ce('0x124')](_0x7d7c24,_0x4791d1,_0x48ea5d['escape_digits'],_0x48ea5d['timeout'],undefined,!![]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x175')]=function(_0x1ec495){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x176'),_0x1ec495['label']));if(!this[_0x88ce('0xa4')](_0x1ec495[_0x88ce('0x65')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0x177'));}var _0x5edea0=this[_0x88ce('0x64')][_0x88ce('0x70')](this,_0x1ec495);logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x178'),util[_0x88ce('0x179')](_0x5edea0,{'showHidden':![],'depth':null})));if(!this[_0x88ce('0xa4')](_0x1ec495[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x17a'));}var _0x313a35=this[_0x88ce('0x14')]['sync'](this,_0x1ec495[_0x88ce('0xcf')]);if(!_0x313a35){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x1ec495,_0x88ce('0x10c'));}this[_0x88ce('0x10')]['setVariable'](util[_0x88ce('0x2c')](_0x88ce('0x17b'),_0x313a35),_0x5edea0[_0x88ce('0x76')]?_0x5edea0[_0x88ce('0x76')]:_0x88ce('0x17c'));this[_0x88ce('0x10')][_0x88ce('0xa0')](util[_0x88ce('0x2c')]('%s_STATUS_MESSAGE',_0x313a35),_0x5edea0[_0x88ce('0x75')]?_0x5edea0['statusMessage']:'OK');if(_0x5edea0[_0x88ce('0x6b')]){try{this[_0x88ce('0x99')](_0x5edea0[_0x88ce('0x6b')],_0x313a35);}catch(_0x582b56){logger[_0x88ce('0x30')](util[_0x88ce('0x2c')](_0x88ce('0x17d'),_0x313a35));}}return this['channel'][_0x88ce('0xaa')](util['format']('variable\x20%s\x20set',_0x313a35));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x17e')]=function(_0x128a56){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x128a56[_0x88ce('0x3c')]));return this['channel'][_0x88ce('0x17f')](_0x128a56[_0x88ce('0x180')][_0x88ce('0x5b')](/\s+/g,''),_0x128a56[_0x88ce('0x174')]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x181')]=function(_0xddac71){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x182'),_0xddac71['label']));return this['channel']['sayNumber'](_0xddac71[_0x88ce('0x183')]['replace'](/\s+/g,''),_0xddac71[_0x88ce('0x174')]);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x184')]=function(_0x4b55af){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4b55af[_0x88ce('0x3c')]));return this['channel'][_0x88ce('0x185')](_0x4b55af[_0x88ce('0x5e')],_0x4b55af['escape_digits']);};AGIVertices['prototype'][_0x88ce('0x186')]=function(_0x5c73a0){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x187'),_0x5c73a0[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x5c73a0['account_id'])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x188'));}var _0x44af47=this['getMailAccount'][_0x88ce('0x70')](this,_0x5c73a0['account_id']);if(!_0x44af47||!_0x44af47[_0x88ce('0x189')]){return this[_0x88ce('0x10')]['error'](_0x5c73a0,_0x88ce('0x18a'));}var _0x331d0d={'from':util[_0x88ce('0x2c')](_0x88ce('0x18b'),_0x44af47[_0x88ce('0x16')],_0x44af47[_0x88ce('0x18c')]||_0x44af47['Smtp']['user']),'to':_0x5c73a0['to']||'','cc':_0x5c73a0['cc']||'','bcc':_0x5c73a0['bcc']||'','subject':_0x5c73a0['subject'],'html':_0x5c73a0[_0x88ce('0x5e')],'text':_0x5c73a0['text']};if(this[_0x88ce('0xa4')](_0x5c73a0[_0x88ce('0x18d')])){}logger[_0x88ce('0xd4')]('sendMail\x20message',JSON[_0x88ce('0x73')](_0x331d0d));this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x5c73a0,_0x5c73a0['account_id']);this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x44af47[_0x88ce('0x16')]));this[_0x88ce('0x27')][_0x88ce('0x70')](this,_0x44af47[_0x88ce('0x18e')],_0x331d0d);return this['channel'][_0x88ce('0xaa')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x88ce('0x13')][_0x88ce('0x18f')]=function(_0x26430a){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x26430a['label']));return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x190'));};AGIVertices[_0x88ce('0x13')]['sendSMS']=function(_0x187a27){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x191'),_0x187a27['label']));if(!this[_0x88ce('0xa4')](_0x187a27[_0x88ce('0x192')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x193'));}var _0x12589e=this[_0x88ce('0x37')][_0x88ce('0x70')](this,_0x187a27['sms_account_id']);if(!_0x12589e){return this['channel']['error'](_0x187a27,'no\x20sms\x20account\x20found');}var _0xf8e6d3={'body':_0x187a27['sms_text'],'phone':_0x187a27['to']||'','SmsAccountId':_0x12589e['id']};logger[_0x88ce('0xd4')]('sendSMS\x20message',JSON[_0x88ce('0x73')](_0xf8e6d3));this['createSquareDetailsReport'][_0x88ce('0x70')](this,_0x187a27,_0x187a27[_0x88ce('0x192')]);this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x194'),_0x12589e['name']));this[_0x88ce('0x39')][_0x88ce('0x70')](this,_0xf8e6d3);return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x195'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x196')]=function(_0x112e14){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x197'),_0x112e14[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x112e14[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x112e14,_0x88ce('0x198'));}var _0x15ce28=this[_0x88ce('0x14')]['sync'](this,_0x112e14['variable_id']);if(!_0x15ce28){return this[_0x88ce('0x10')]['error'](_0x112e14,_0x88ce('0x10c'));}return this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x15ce28,_0x112e14['variable_value']);};AGIVertices[_0x88ce('0x13')][_0x88ce('0x199')]=function(_0x1a9e50){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x19a'),_0x1a9e50[_0x88ce('0x3c')]));this[_0x88ce('0x10')][_0x88ce('0xaa')]('START\x20CALLY\x20SQUARE');if(_0x1a9e50[_0x88ce('0xb3')]===_0x88ce('0x19b')){this[_0x88ce('0x10')]['noop']('Answer');return this[_0x88ce('0x10')][_0x88ce('0xb3')]();}return this[_0x88ce('0x10')]['noop'](_0x88ce('0x19c'));};AGIVertices[_0x88ce('0x13')]['subproject']=function(_0x274568){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x274568[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x274568[_0x88ce('0x19d')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x274568,_0x88ce('0x19e'));}var _0x245ab6=this[_0x88ce('0x19f')]['sync'](this,_0x274568[_0x88ce('0x19d')]);if(!this[_0x88ce('0xa4')](_0x245ab6)){return this[_0x88ce('0x10')]['error'](_0x274568,util[_0x88ce('0x2c')](_0x88ce('0x1a0'),_0x274568[_0x88ce('0x19d')]));}if(_0x245ab6===this['channel'][_0x88ce('0x42')]){return this['channel'][_0x88ce('0x30')](_0x274568,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x88ce('0x3a')]['sync'](this,_0x274568,_0x245ab6);var _0x937ca8=this[_0x88ce('0x10')]['exec'](_0x88ce('0x1a1'),util[_0x88ce('0x2c')](_0x88ce('0x1a2'),config[_0x88ce('0x8')][_0x88ce('0x1a3')]||_0x88ce('0x1a4'),_0x245ab6,this[_0x88ce('0x10')][_0x88ce('0x42')]));if(_0x937ca8[_0x88ce('0x9e')]===-0x1){return _0x937ca8;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Executed\x20command\x20%s\x20%s',_0x88ce('0x1a1'),_0x245ab6));};AGIVertices[_0x88ce('0x13')]['system']=function(_0x522655){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x1a5'),_0x522655[_0x88ce('0x3c')]));var _0x88788f=this[_0x88ce('0x58')]['sync'](this,_0x522655['command']);this[_0x88ce('0x3a')][_0x88ce('0x70')](this,_0x522655,_0x522655['command']);if(this[_0x88ce('0xa4')](_0x522655[_0x88ce('0xcf')])){var _0x663a5a=this[_0x88ce('0x14')]['sync'](this,_0x522655['variable_id']);if(_0x663a5a){this[_0x88ce('0x10')][_0x88ce('0xa0')](_0x663a5a,_0x88788f);return this[_0x88ce('0x10')][_0x88ce('0xaa')](util['format'](_0x88ce('0x1a6'),_0x522655[_0x88ce('0x1a7')],_0x663a5a));}}return this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x1a8'),_0x522655['command']));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1a9')]=function(_0x47e183){logger[_0x88ce('0x31')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x47e183[_0x88ce('0x3c')]));_0x47e183['text']=_0x47e183[_0x88ce('0x5e')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x47e183[_0x88ce('0x1aa')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0x1ab'));}if(!this[_0x88ce('0xa4')](_0x47e183[_0x88ce('0x5e')])){return this['channel'][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x47e183['text']));var _0x54e2dc=this[_0x88ce('0x5c')][_0x88ce('0x70')](this,_0x47e183);if(_0x54e2dc){this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x54e2dc));var _0x27774c=this['channel']['streamFile'](_0x54e2dc);try{fs['unlink'](_0x54e2dc+_0x88ce('0xfa'));}catch(_0x52cde4){logger[_0x88ce('0x30')](_0x52cde4);}return _0x27774c;}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x47e183,_0x88ce('0x1ac'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1ad')]=function(_0x178ae3){logger['info'](util[_0x88ce('0x2c')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x178ae3[_0x88ce('0x3c')]));_0x178ae3[_0x88ce('0x5e')]=_0x178ae3[_0x88ce('0x5e')][_0x88ce('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x88ce('0xa4')](_0x178ae3[_0x88ce('0x5e')])){return this[_0x88ce('0x10')][_0x88ce('0xaa')](_0x88ce('0xa5'));}this[_0x88ce('0x10')][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x1ae'),_0x178ae3['text']));var _0x404dba=this[_0x88ce('0x1af')]['sync'](this,_0x178ae3);if(_0x404dba){this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')](_0x88ce('0x1b0'),_0x404dba));var _0x48dcef=this[_0x88ce('0x10')]['streamFile'](_0x404dba);try{fs[_0x88ce('0xf9')](_0x404dba+'.wav');}catch(_0x18f2bb){logger[_0x88ce('0x30')](_0x18f2bb);}return _0x48dcef;}return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x178ae3,_0x88ce('0x1b1'));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b2')]=function(_0x444f24){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x1b3'),_0x444f24[_0x88ce('0x3c')]));if(!this['isConfigured'](_0x444f24[_0x88ce('0x14a')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x444f24,'no\x20find\x20by\x20configured');}logger[_0x88ce('0x31')](util['format'](_0x88ce('0x14c'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));var _0x1f9fa1=this['agentUnpause'][_0x88ce('0x70')](this,_0x444f24[_0x88ce('0x14a')]);if(_0x1f9fa1){logger['info'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));this['channel']['noop'](util[_0x88ce('0x2c')](_0x88ce('0x14e'),this['channel'][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x162')};}else{logger['info'](util[_0x88ce('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')][_0x88ce('0x3d')],_0x444f24[_0x88ce('0x14a')]));this[_0x88ce('0x10')]['noop'](util[_0x88ce('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x88ce('0x10')]['callerid'],_0x444f24[_0x88ce('0x14a')]));return{'code':0xc8,'result':_0x88ce('0x150')};}};AGIVertices['prototype'][_0x88ce('0x1b4')]=function(_0x3caf95){logger[_0x88ce('0x31')](util['format'](_0x88ce('0x1b5'),_0x3caf95['label']));var _0x6f1b73=this[_0x88ce('0x10')][_0x88ce('0x59')](_0x88ce('0x1b6'),[_0x3caf95['mailbox'],_0x3caf95[_0x88ce('0x78')]]);if(_0x6f1b73[_0x88ce('0x9e')]===-0x1){return _0x6f1b73;}return this['channel'][_0x88ce('0xaa')](util[_0x88ce('0x2c')](_0x88ce('0x165'),'VOICEMAIL',_0x3caf95[_0x88ce('0x1b7')]));};AGIVertices[_0x88ce('0x13')][_0x88ce('0x1b8')]=function(_0x33382c){logger[_0x88ce('0x31')](util[_0x88ce('0x2c')](_0x88ce('0x1b9'),_0x33382c[_0x88ce('0x3c')]));if(!this[_0x88ce('0xa4')](_0x33382c[_0x88ce('0xcf')])){return this[_0x88ce('0x10')][_0x88ce('0x30')](_0x33382c,_0x88ce('0x198'));}var _0x504ee1=this[_0x88ce('0x14')][_0x88ce('0x70')](this,_0x33382c[_0x88ce('0xcf')]);if(!_0x504ee1){return this['channel'][_0x88ce('0x30')](_0x33382c,_0x88ce('0x10c'));}var _0x456973=this[_0x88ce('0x10')][_0x88ce('0x14')](_0x504ee1);return{'code':0xc8,'result':_0x456973[_0x88ce('0x9d')]?_0x456973['extra']:'-'};};String[_0x88ce('0x13')]['replaceAll']=function(_0x3a6788,_0x3f9185){return this[_0x88ce('0x9b')](_0x3a6788)[_0x88ce('0x1ba')](_0x3f9185);};module['exports']=AGIVertices; \ No newline at end of file +var _0xd61e=['aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','isArray','setVariable','replaceAll','getVariable','extra','getAndSetVariable','result','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','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','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','NOBEEP','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','unlink','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','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','no\x20find\x20by\x20configured','math','operation','no\x20operation\x20configured','math\x20%s','menu','Enter\x20in\x20MENU\x20(%s)\x20block','getSound','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','escape_digits','saynumber','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','no\x20mail\x20account\x20configured','email','user','bcc','subject','template_id','debug','sendMail\x20message','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','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','project_id','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','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','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','split','join','util','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','channel','rpc','name','catch','prototype','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','ssmlGender','MALE','audioEncoding','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex'];(function(_0x1267e2,_0x4f33f6){var _0x18c2f0=function(_0x4cc868){while(--_0x4cc868){_0x1267e2['push'](_0x1267e2['shift']());}};_0x18c2f0(++_0x4f33f6);}(_0xd61e,0x13d));var _0xed61=function(_0x49e26d,_0x2ed658){_0x49e26d=_0x49e26d-0x0;var _0x55395b=_0xd61e[_0x49e26d];return _0x55395b;};'use strict';var fs=require('fs');var util=require(_0xed61('0x0'));var _=require(_0xed61('0x1'));var sh=require(_0xed61('0x2'));var odbc=require(_0xed61('0x3'))();var rs=require(_0xed61('0x4'));var moment=require(_0xed61('0x5'));var Mustache=require('mustache');var rp=require(_0xed61('0x6'));var logger=require(_0xed61('0x7'))(_0xed61('0x8'));var config=require(_0xed61('0x9'));var shared=require(_0xed61('0xa'));var scripts=require(_0xed61('0xb'));var FILES_PATH=_0xed61('0xc');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=['menu','getdigits','getsecretdigits'];var AGIVertices=function(_0xbac89d,_0x4149eb,_0x2964de){this[_0xed61('0xd')]=_0xbac89d;this[_0xed61('0xe')]=_0x4149eb;this['mailRpc']=_0x2964de;};AGIVertices['prototype']['getVariable']=function(_0x2f1c58,_0x16502a){this['rpc']['getVariableById'](_0x2f1c58)['then'](function(_0x51a0be){_0x16502a(null,_0x51a0be?_0x51a0be[_0xed61('0xf')]:![]);})[_0xed61('0x10')](function(_0x19c74c){_0x16502a(_0x19c74c);});};AGIVertices[_0xed61('0x11')]['getVoiceQueue']=function(_0x22f4bf,_0x28f4cb){this[_0xed61('0xe')]['getVoiceQueueById'](_0x22f4bf)[_0xed61('0x12')](function(_0x7048d3){_0x28f4cb(null,_0x7048d3?_0x7048d3[_0xed61('0xf')]:![]);})[_0xed61('0x10')](function(_0x4d3930){_0x28f4cb(_0x4d3930);});};AGIVertices[_0xed61('0x11')][_0xed61('0x13')]=function(_0x446b8a,_0x6d05cd){this['rpc'][_0xed61('0x14')](_0x446b8a)[_0xed61('0x12')](function(_0x4bd841){_0x6d05cd(null,_0x4bd841?_0x4bd841[_0xed61('0xf')]:![]);})[_0xed61('0x10')](function(_0x9d980e){_0x6d05cd(_0x9d980e);});};AGIVertices['prototype'][_0xed61('0x15')]=function(_0xb7879f,_0xd5aa2d){this['rpc'][_0xed61('0x16')](_0xb7879f)[_0xed61('0x12')](function(_0xce408c){_0xd5aa2d(null,_0xce408c?_0xce408c['dsn']:![]);})[_0xed61('0x10')](function(_0x16d63a){_0xd5aa2d(_0x16d63a);});};AGIVertices['prototype'][_0xed61('0x17')]=function(_0x315020,_0x864dfa){this['rpc']['getUserById'](_0x315020)[_0xed61('0x12')](function(_0x544d49){_0x864dfa(null,_0x544d49?_0x544d49[_0xed61('0xf')]:![]);})[_0xed61('0x10')](function(_0x2722d0){_0x864dfa(_0x2722d0);});};AGIVertices[_0xed61('0x11')][_0xed61('0x18')]=function(_0x5a71f0,_0x579203){this['rpc']['getTrunkById'](_0x5a71f0)['then'](function(_0x405c67){_0x579203(null,_0x405c67?_0x405c67['name']:![]);})[_0xed61('0x10')](function(_0x2c43ba){_0x579203(_0x2c43ba);});};AGIVertices['prototype']['getSound']=function(_0x14d140,_0xca7c0c){var _0x7784f3=this;this['rpc'][_0xed61('0x19')](_0x14d140)[_0xed61('0x12')](function(_0x1ac86e){_0xca7c0c(null,_0x1ac86e?_0x7784f3['getSoundPath'](_0x1ac86e[_0xed61('0x1a')]):![]);})['catch'](function(_0x11fd35){_0xca7c0c(_0x11fd35);});};AGIVertices[_0xed61('0x11')][_0xed61('0x1b')]=function(_0x50b19d,_0x260ac4){this[_0xed61('0xe')][_0xed61('0x1c')](_0x50b19d)[_0xed61('0x12')](function(_0x4b1294){_0x260ac4(null,_0x4b1294?_0x4b1294:![]);})[_0xed61('0x10')](function(_0x524477){_0x260ac4(_0x524477);});};AGIVertices['prototype'][_0xed61('0x1d')]=function(_0x378504,_0x4c8497,_0x368c50){this['mailRpc']['sendMailMessage'](_0x378504,_0x4c8497)[_0xed61('0x12')](function(){_0x368c50(null);})[_0xed61('0x10')](function(_0x1aa7d9){_0x368c50(_0x1aa7d9);});};AGIVertices[_0xed61('0x11')][_0xed61('0x1e')]=function(_0x2cff03,_0x36828b){this['rpc']['getIntervalById'](_0x2cff03)[_0xed61('0x12')](function(_0x4e72d1){if(_0x4e72d1){if(_0x4e72d1[_0xed61('0x1f')]){_0x36828b(null,[_0x4e72d1['interval']]);}else{_0x36828b(null,_['map'](_0x4e72d1['Intervals'],'interval'));}}else{_0x36828b(null,![]);}})['catch'](function(_0x447538){_0x36828b(_0x447538);});};AGIVertices[_0xed61('0x11')][_0xed61('0x20')]=function(_0xa1d78a){return util[_0xed61('0x21')](_0xed61('0x22'),FILES_PATH,_0xa1d78a);};AGIVertices[_0xed61('0x11')][_0xed61('0x23')]=function(_0x5b1e4e,_0x5d9cb3,_0x4b7688){odbc[_0xed61('0x24')](_0x5b1e4e,function(_0x3d3e36){if(_0x3d3e36){logger[_0xed61('0x25')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x3d3e36);_0x4b7688(_0x3d3e36);}else{logger[_0xed61('0x26')](_0xed61('0x27'));odbc['query'](_0x5d9cb3,function(_0x11ce2e,_0xceb303){if(_0x11ce2e){logger[_0xed61('0x26')](_0xed61('0x28'),_0x5d9cb3);_0x4b7688(_0x11ce2e);}else{logger['info'](_0xed61('0x29'),_0x5d9cb3);odbc[_0xed61('0x2a')](function(_0x2dac29){if(_0x2dac29){logger[_0xed61('0x25')](_0xed61('0x2b'),_0x2dac29);}_0x4b7688(null,_0xceb303);});}});}});};AGIVertices[_0xed61('0x11')][_0xed61('0x2c')]=function(_0x57e623,_0x3abfa6){this[_0xed61('0xe')][_0xed61('0x2d')](_0x57e623)[_0xed61('0x12')](function(_0x10c835){_0x3abfa6(null,_0x10c835?_0x10c835:![]);})[_0xed61('0x10')](function(_0x35ad22){_0x3abfa6(_0x35ad22);});};AGIVertices[_0xed61('0x11')][_0xed61('0x2e')]=function(_0x28d904,_0x3c1b01){this[_0xed61('0xe')][_0xed61('0x2e')](_0x28d904)[_0xed61('0x12')](function(_0x4e6403){_0x3c1b01(null,_0x4e6403);})['catch'](function(_0x190bf2){_0x3c1b01(_0x190bf2);});};AGIVertices[_0xed61('0x11')]['createSquareDetailsReport']=function(_0x5b9bef,_0x4de103,_0x5b0b3b){this[_0xed61('0xe')][_0xed61('0x2f')]({'uniqueid':this[_0xed61('0xd')][_0xed61('0x30')],'node':_0x5b9bef[_0xed61('0x31')],'application':_0x5b9bef[_0xed61('0x32')],'data':_0x4de103||null,'project_name':this['channel'][_0xed61('0x33')],'callerid':this[_0xed61('0xd')][_0xed61('0x34')]})['then'](function(_0x121800){if(_0x5b0b3b){_0x5b0b3b(null,_0x121800);}})[_0xed61('0x10')](function(_0x59d5c6){if(_0x5b0b3b){_0x5b0b3b(_0x59d5c6);}});};AGIVertices[_0xed61('0x11')][_0xed61('0x35')]=function(_0x5b5281,_0x5d7ba8,_0x32c1b0,_0x536ada){this[_0xed61('0xe')][_0xed61('0x35')]({'uniqueid':this['channel'][_0xed61('0x30')],'callerid':this[_0xed61('0xd')][_0xed61('0x34')],'calleridname':this['channel'][_0xed61('0x36')],'context':this[_0xed61('0xd')]['context'],'extension':this[_0xed61('0xd')][_0xed61('0x37')],'priority':this[_0xed61('0xd')][_0xed61('0x38')],'accountcode':this[_0xed61('0xd')][_0xed61('0x39')],'dnid':this[_0xed61('0xd')][_0xed61('0x3a')],'projectName':this[_0xed61('0xd')][_0xed61('0x33')],'saveName':_0x5d7ba8,'filename':_0x5b5281[_0xed61('0x3b')]||_0x5d7ba8,'savePath':_0x32c1b0})[_0xed61('0x12')](function(_0x363a82){_0x536ada(null,_0x363a82);})[_0xed61('0x10')](function(_0xe418b5){_0x536ada(_0xe418b5);});};AGIVertices[_0xed61('0x11')][_0xed61('0x3c')]=function(_0x43031b,_0x3f042a,_0x23f69a,_0xac4195,_0x326d2a){this[_0xed61('0xe')]['createSquareMessage']({'uniqueid':this['channel'][_0xed61('0x30')],'body':_0x43031b,'direction':_0x3f042a,'providerName':_0x23f69a,'providerResponse':_0xac4195})[_0xed61('0x12')](function(_0x2490b7){if(_0x326d2a){_0x326d2a(null,_0x2490b7);}})[_0xed61('0x10')](function(_0x4a7444){if(_0x326d2a){_0x326d2a(_0x4a7444);}});};AGIVertices[_0xed61('0x11')][_0xed61('0x3d')]=function(_0x2aac89,_0x53de57){this['rpc']['createCmContact']({'firstName':_[_0xed61('0x3e')](_0x2aac89[_0xed61('0xf')])||_[_0xed61('0x3f')](_0x2aac89[_0xed61('0xf')])?_0xed61('0x40')+Math[_0xed61('0x41')]():_0x2aac89[_0xed61('0xf')],'lastName':_[_0xed61('0x3e')](_0x2aac89['lastName'])||_[_0xed61('0x3f')](_0x2aac89[_0xed61('0x42')])?null:_0x2aac89['lastName'],'phone':_0x2aac89[_0xed61('0x43')],'ListId':_0x2aac89[_0xed61('0x44')],'scheduledat':_0x2aac89[_0xed61('0x45')],'callbackUniqueid':this['channel'][_0xed61('0x30')],'tags':'callback','description':_0xed61('0x46')+_0x2aac89[_0xed61('0x45')][_0xed61('0x47')](),'priority':_0x2aac89[_0xed61('0x48')]})[_0xed61('0x12')](function(_0x179f81){_0x53de57(null,_0x179f81);})[_0xed61('0x10')](function(_0x527470){_0x53de57(_0x527470);});};AGIVertices[_0xed61('0x11')][_0xed61('0x49')]=function(_0x375ba0,_0x36bb49){this[_0xed61('0xe')][_0xed61('0x4a')](_0x375ba0)['then'](function(_0xe3bc04){_0x36bb49(null,_0xe3bc04?_0xe3bc04['name']:![]);})[_0xed61('0x10')](function(_0x5a4754){_0x36bb49(_0x5a4754);});};AGIVertices[_0xed61('0x11')][_0xed61('0x4b')]=function(_0x591909,_0x2a143f,_0x46ebec){var _0x2e4065={'role':_0xed61('0x4c')};_0x2e4065[_0x591909]=this[_0xed61('0xd')]['callerid'];this[_0xed61('0xe')][_0xed61('0x4b')](_0x2e4065,_0x2a143f,this[_0xed61('0xd')][_0xed61('0x30')])[_0xed61('0x12')](function(_0x19a997){_0x46ebec(null,_[_0xed61('0x3f')](_0x19a997)?![]:!![]);})['catch'](function(_0x4b01f1){logger[_0xed61('0x25')](_0x4b01f1);_0x46ebec(null,![]);});};AGIVertices[_0xed61('0x11')][_0xed61('0x4d')]=function(_0x28ffb2,_0x352c75){var _0x5ec260={'role':_0xed61('0x4c')};_0x5ec260[_0x28ffb2]=this[_0xed61('0xd')][_0xed61('0x34')];this['rpc'][_0xed61('0x4d')](_0x5ec260)[_0xed61('0x12')](function(_0x429d42){_0x352c75(null,_[_0xed61('0x3f')](_0x429d42)?![]:!![]);})[_0xed61('0x10')](function(_0x56d241){logger['error'](_0x56d241);_0x352c75(null,![]);});};AGIVertices[_0xed61('0x11')][_0xed61('0x4e')]=function(_0x2461d3,_0x3aa517){var _0x457d66={'role':_0xed61('0x4c')};_0x457d66[_0x2461d3]=this[_0xed61('0xd')][_0xed61('0x34')];this[_0xed61('0xe')][_0xed61('0x4e')](_0x457d66)['then'](function(_0xb37b4c){_0x3aa517(null,_[_0xed61('0x3f')](_0xb37b4c)?![]:!![]);})['catch'](function(_0x298a12){logger[_0xed61('0x25')](_0x298a12);_0x3aa517(null,![]);});};AGIVertices[_0xed61('0x11')][_0xed61('0x4f')]=function(_0x185bfd,_0x576047){var _0x2b7a8a={'role':'agent'};_0x2b7a8a[_0x185bfd]=this['channel'][_0xed61('0x34')];var _0x27a0e6=_0x185bfd!=_0xed61('0x50')?util['format'](_0xed61('0x51'),_0xed61('0x52'),this[_0xed61('0xd')][_0xed61('0x34')]):undefined;this[_0xed61('0xe')]['agentLogin'](_0x2b7a8a,_0x27a0e6)['then'](function(_0x3c0a5f){_0x576047(null,_[_0xed61('0x3f')](_0x3c0a5f)?![]:!![]);})[_0xed61('0x10')](function(_0x21ab9c){logger[_0xed61('0x25')](_0x21ab9c);_0x576047(null,![]);});};AGIVertices['prototype'][_0xed61('0x53')]=function(_0xb883f7,_0x45824f){sh[_0xed61('0x54')](_['trim'](_0xb883f7),function(_0x257617,_0x2efa4a){var _0x57aef4=_0x2efa4a[_0xed61('0x55')](/(\r\n|\n|\r)/gm,'');_0x45824f(null,_0x57aef4);});};AGIVertices[_0xed61('0x11')][_0xed61('0x56')]=function(_0x121920,_0x2588fc){scripts[_0xed61('0x56')](_0x121920[_0xed61('0x57')],_0x121920[_0xed61('0x58')]||_0xed61('0x59'),_0x121920[_0xed61('0x59')],_0x121920['languageCode']||'en-US',_0x121920[_0xed61('0x5a')]||_0xed61('0x5b'),_0x121920[_0xed61('0x5c')]||'MP3')['then'](function(_0x1a391e){_0x2588fc(null,_0x1a391e);})[_0xed61('0x10')](function(_0x274848){_0x2588fc(_0x274848);});};AGIVertices[_0xed61('0x11')][_0xed61('0x5d')]=function(_0x1c325a,_0x27ac6e){scripts[_0xed61('0x5d')](_0x1c325a[_0xed61('0x59')],_0x1c325a['google_tts_language']||'en',0x1)[_0xed61('0x12')](function(_0x18ff74){_0x27ac6e(null,_0x18ff74);})[_0xed61('0x10')](function(_0x31649f){_0x27ac6e(_0x31649f);});};AGIVertices[_0xed61('0x11')][_0xed61('0x5e')]=function(_0x8472a6,_0x236277){var _0x4e01f7={'uri':_0x8472a6[_0xed61('0x5f')],'method':_0x8472a6[_0xed61('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x8472a6[_0xed61('0x61')])===_0xed61('0x62')&&parseInt(_0x8472a6[_0xed61('0x61')])>=0x1?parseInt(_0x8472a6[_0xed61('0x61')])*0x3e8:0x5*0x3e8};if(_[_0xed61('0x63')]([_0xed61('0x64'),_0xed61('0x65')],_0x4e01f7[_0xed61('0x60')][_0xed61('0x66')]())){try{_0x4e01f7[_0xed61('0x67')]=_0x8472a6[_0xed61('0x68')]?JSON[_0xed61('0x69')](_0x8472a6[_0xed61('0x68')]):{};}catch(_0x56d2c2){logger[_0xed61('0x25')](_0xed61('0x6a'),_0x56d2c2);}}try{_0x4e01f7[_0xed61('0x6b')]=_0x8472a6[_0xed61('0x6c')]?JSON[_0xed61('0x69')](_0x8472a6[_0xed61('0x6c')]):{};}catch(_0x5845a7){logger[_0xed61('0x25')](_0xed61('0x6d'),_0x5845a7);}if(_0x8472a6[_0xed61('0x6e')]){try{var _0x949e9=require(_0x8472a6[_0xed61('0x6e')])[_0xed61('0x6f')](this,_0x4e01f7);_0x4e01f7['uri']=Mustache[_0xed61('0x70')](_0x8472a6['url'],_0x949e9,{},['$$','$$']);if(_0x4e01f7[_0xed61('0x6b')]){_0x4e01f7[_0xed61('0x6b')]=JSON[_0xed61('0x69')](Mustache['render'](JSON[_0xed61('0x71')](_0x4e01f7['headers']),_0x949e9,{},['$$','$$']));}if(_0x4e01f7['body']){_0x4e01f7[_0xed61('0x67')]=JSON[_0xed61('0x69')](Mustache[_0xed61('0x70')](JSON[_0xed61('0x71')](_0x4e01f7[_0xed61('0x67')]),_0x949e9,{},['$$','$$']));}}catch(_0x4502c6){logger[_0xed61('0x25')](_0xed61('0x72'),_0x4502c6);}}rp(_0x4e01f7)[_0xed61('0x12')](function(_0x23d06d){var _0x3d1281={'statusCode':_0x23d06d[_0xed61('0x73')]||0xc8,'statusMessage':_0x23d06d[_0xed61('0x74')]||'OK','headers':_0x23d06d[_0xed61('0x6b')]||{},'body':_0x23d06d[_0xed61('0x67')]||{}};_0x236277(null,_0x3d1281);})[_0xed61('0x10')](function(_0x1cc020){var _0x1b183a={'statusCode':_0x1cc020[_0xed61('0x73')]||0x1f4,'statusMessage':_0x1cc020[_0xed61('0x75')]||_0xed61('0x76'),'headers':_0x1cc020[_0xed61('0x77')][_0xed61('0x6b')]||{},'body':_0x1cc020['options']['body']||{}};_0x236277(null,_0x1b183a);});};AGIVertices['prototype'][_0xed61('0x78')]=function(_0x109aff,_0x520d21){scripts[_0xed61('0x78')](this[_0xed61('0xd')][_0xed61('0x30')],_0x109aff[_0xed61('0x79')],_0x109aff[_0xed61('0x59')],_0x109aff[_0xed61('0x7a')]||'en')[_0xed61('0x12')](function(_0x5310c2){_0x520d21(null,_0x5310c2);})[_0xed61('0x10')](function(_0x44f604){_0x520d21(_0x44f604);});};AGIVertices[_0xed61('0x11')][_0xed61('0x7b')]=function(_0x419701,_0xd258bb){scripts[_0xed61('0x7b')](this[_0xed61('0xd')][_0xed61('0x30')],_0x419701['dialogflowV2_project_id'],_0x419701[_0xed61('0x7c')],_0x419701[_0xed61('0x7d')],_0x419701[_0xed61('0x59')],_0x419701[_0xed61('0x7e')]||'en')[_0xed61('0x12')](function(_0x35db90){_0xd258bb(null,_0x35db90);})['catch'](function(_0x587aa6){_0xd258bb(_0x587aa6);});};AGIVertices['prototype'][_0xed61('0x7f')]=function(_0x5bcbb9,_0x4b0add){scripts[_0xed61('0x7f')](this['channel'],_0x5bcbb9)[_0xed61('0x12')](function(_0x1cbabc){_0x4b0add(null,_0x1cbabc);})[_0xed61('0x10')](function(_0x43021e){_0x4b0add(_0x43021e);});};AGIVertices[_0xed61('0x11')][_0xed61('0x80')]=function(_0x3c0531,_0x4e1838){scripts[_0xed61('0x80')](_0x3c0531[_0xed61('0x79')],_0x3c0531[_0xed61('0x59')],_0x3c0531['ispeech_tts_language']||_0xed61('0x81'),_0x3c0531[_0xed61('0x82')])[_0xed61('0x12')](function(_0x19417f){_0x4e1838(null,_0x19417f);})[_0xed61('0x10')](function(_0x2c104b){_0x4e1838(_0x2c104b);});};AGIVertices[_0xed61('0x11')][_0xed61('0x83')]=function(_0x2fcbdc,_0x2ff201,_0xe8e904){scripts[_0xed61('0x83')](_0x2ff201,_0x2fcbdc[_0xed61('0x79')],_0x2fcbdc[_0xed61('0x84')]||_0xed61('0x81'),this[_0xed61('0x85')](_0x2fcbdc['model'])?_0x2fcbdc[_0xed61('0x86')]:undefined)['then'](function(_0x3143f9){_0xe8e904(null,_0x3143f9);})[_0xed61('0x10')](function(_0x4d6e0f){_0xe8e904(_0x4d6e0f);});};AGIVertices[_0xed61('0x11')][_0xed61('0x87')]=function(_0x5a74c5,_0x20aec3){scripts['awsPolly'](_0x5a74c5[_0xed61('0x88')],_0x5a74c5[_0xed61('0x89')],_0x5a74c5[_0xed61('0x8a')],_0x5a74c5[_0xed61('0x8b')]||_0xed61('0x8c'),_0x5a74c5[_0xed61('0x59')],_0x5a74c5[_0xed61('0x8d')]||'text')[_0xed61('0x12')](function(_0x44943d){_0x20aec3(null,_0x44943d);})[_0xed61('0x10')](function(_0x3761ab){_0x20aec3(_0x3761ab);});};AGIVertices['prototype']['awsLex']=function(_0x54fad9,_0x2bc556){scripts[_0xed61('0x8e')](this['channel']['uniqueid'],_0x54fad9[_0xed61('0x88')],_0x54fad9[_0xed61('0x89')],_0x54fad9[_0xed61('0x8f')],_0x54fad9[_0xed61('0x59')],_0x54fad9[_0xed61('0x90')])[_0xed61('0x12')](function(_0xc0f25f){_0x2bc556(null,_0xc0f25f);})[_0xed61('0x10')](function(_0x5ab9b4){_0x2bc556(_0x5ab9b4);});};AGIVertices[_0xed61('0x11')][_0xed61('0x91')]=function(_0x3f7eb1,_0x416931,_0x399f30){scripts['googleASR'](_0x416931,_0x3f7eb1['key'],_0x3f7eb1['google_asr_language']||_0xed61('0x81'))[_0xed61('0x12')](function(_0x18caac){_0x399f30(null,_0x18caac);})['catch'](function(_0x499015){_0x399f30(_0x499015);});};AGIVertices[_0xed61('0x11')][_0xed61('0x92')]=function(_0x1f07fd,_0x13ad5f,_0x12446b){scripts[_0xed61('0x92')](_0x13ad5f,_0x1f07fd[_0xed61('0x93')],_0x1f07fd[_0xed61('0x94')],_0x1f07fd['uri'])[_0xed61('0x12')](function(_0x301328){_0x12446b(null,_0x301328);})[_0xed61('0x10')](function(_0x389bc7){_0x12446b(_0x389bc7);});};AGIVertices['prototype'][_0xed61('0x95')]=function(_0x477044){var _0x5a065c=_[_0xed61('0x63')](verticesWithRetry,_0x477044[_0xed61('0x32')])?_0x477044:_[_0xed61('0x96')](_0x477044);for(var _0x1cd9b9 in _0x5a065c){if(_0x5a065c[_0xed61('0x97')](_0x1cd9b9)){if(_0x5a065c[_0x1cd9b9]&&_[_0xed61('0x98')](_0x5a065c[_0x1cd9b9])){if(_[_0xed61('0x63')](recursiveMapAttributes,_0x1cd9b9)){_0x5a065c[_0x1cd9b9]=this[_0xed61('0x99')](_0x5a065c[_0x1cd9b9]);}else{_0x5a065c[_0x1cd9b9]=this[_0xed61('0x9a')](_0x5a065c[_0x1cd9b9]);}}}}return _0x5a065c;};AGIVertices[_0xed61('0x11')][_0xed61('0x9b')]=function(_0x301b3c){for(var _0x429886 in _0x301b3c){if(_0x301b3c[_0xed61('0x97')](_0x429886)){if(_[_0xed61('0x9c')](_0x301b3c[_0x429886])){this[_0xed61('0x9b')](_0x301b3c[_0x429886]);}else if(_['isArray'](_0x301b3c[_0x429886])){for(var _0x5de0f2=0x0;_0x5de0f2<_0x301b3c[_0x429886][_0xed61('0x9d')];_0x5de0f2++){this['recursiveNodeIndex'](_0x301b3c[_0x429886][_0x5de0f2]);}}else if(_['isString'](_0x301b3c[_0x429886])){_0x301b3c[_0x429886]=this['replaceAllVariables'](_0x301b3c[_0x429886]);}}}};AGIVertices[_0xed61('0x11')][_0xed61('0x9e')]=function(_0x1f9fa7,_0x42d004){for(var _0x3b8444 in _0x1f9fa7){if(_0x1f9fa7[_0xed61('0x97')](_0x3b8444)){if(_[_0xed61('0x9c')](_0x1f9fa7[_0x3b8444])){if(!_[_0xed61('0x3e')](_0x1f9fa7[_0x3b8444])){this[_0xed61('0x9e')](_0x1f9fa7[_0x3b8444],util[_0xed61('0x21')](_0xed61('0x9f'),_0x42d004,_0x3b8444));}}else if(_[_0xed61('0xa0')](_0x1f9fa7[_0x3b8444])){for(var _0x31b1d4=0x0;_0x31b1d4<_0x1f9fa7[_0x3b8444]['length'];_0x31b1d4++){this['saveRestApiResult'](_0x1f9fa7[_0x3b8444][_0x31b1d4],util[_0xed61('0x21')](_0xed61('0x9f'),_0x42d004,_0x3b8444+'['+_0x31b1d4+']'));}}else{if(!_[_0xed61('0x3f')](_0x1f9fa7[_0x3b8444])){this[_0xed61('0xd')][_0xed61('0xa1')](util[_0xed61('0x21')](_0xed61('0x9f'),_0x42d004,_0x3b8444),_0x1f9fa7[_0x3b8444]);}}}}};AGIVertices['prototype'][_0xed61('0x99')]=function(_0x102f7f){try{var _0x2d91f9=JSON['parse'](_0x102f7f);this[_0xed61('0x9b')](_0x2d91f9);return JSON['stringify'](_0x2d91f9);}catch(_0x2653f7){return this[_0xed61('0x9a')](_0x102f7f);}};AGIVertices[_0xed61('0x11')][_0xed61('0x9a')]=function(_0x4e335b){var _0x512981=_0x4e335b['split']('{');for(var _0x55528a=0x1;_0x55528a<_0x512981['length'];_0x55528a+=0x1){var _0x33054c=_0x512981[_0x55528a]['split']('}');if(_0x33054c['length']>0x1){_0x4e335b=_0x4e335b[_0xed61('0xa2')]('{'+_0x33054c[0x0]+'}',this[_0xed61('0xd')][_0xed61('0xa3')](_0x33054c[0x0])[_0xed61('0xa4')]||_0x33054c[0x0]);}}if(_0x512981[_0xed61('0x9d')]===0x1){return _0x4e335b['toString']();}return this[_0xed61('0x9a')](_0x4e335b);};AGIVertices['prototype'][_0xed61('0xa5')]=function(_0x2c1cdc,_0x5604d0){var _0x28171b=this[_0xed61('0xd')]['getVariable'](_0x2c1cdc);if(_0x28171b[_0xed61('0xa6')]===-0x1){return _0x28171b;}logger[_0xed61('0x26')](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5604d0,_0x28171b[_0xed61('0xa4')]));return this['channel'][_0xed61('0xa1')](_0x5604d0,_0x28171b[_0xed61('0xa4')]);};AGIVertices['prototype'][_0xed61('0x85')]=function(_0x1db806){return _0x1db806&&_0x1db806!=='0'&&_0x1db806!=='-1'&&_0x1db806!=='';};AGIVertices['prototype'][_0xed61('0xa7')]=function(_0x14897a){this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x14897a,'-');_0x14897a['retry']=_0x14897a[_0xed61('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xed61('0xa8')]=function(_0x474a32){logger[_0xed61('0x26')](util['format'](_0xed61('0xa9'),_0x474a32['label']));if(!this[_0xed61('0x85')](_0x474a32[_0xed61('0x59')])){return this[_0xed61('0xd')]['noop'](_0xed61('0xaa'));}var _0x56ef59='\x22'+_0x474a32[_0xed61('0x59')]+'\x22';if(this[_0xed61('0x85')](_0x474a32[_0xed61('0x77')])){_0x56ef59+=','+_0x474a32[_0xed61('0x77')];}var _0x27426e=this[_0xed61('0xd')][_0xed61('0x54')]('MRCPSynth',_0x56ef59);if(_0x27426e[_0xed61('0xa6')]===-0x1){return _0x27426e;}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xac'),_0x56ef59));};AGIVertices[_0xed61('0x11')][_0xed61('0xad')]=function(_0x2e5d2c){logger['info'](util['format'](_0xed61('0xae'),_0x2e5d2c[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x2e5d2c[_0xed61('0xaf')])){return this[_0xed61('0xd')]['noop'](_0xed61('0xb0'));}var _0x1ad945=_0x2e5d2c[_0xed61('0xaf')];if(this[_0xed61('0x85')](_0x2e5d2c['options'])){_0x1ad945+=','+_0x2e5d2c['options'];}var _0x3a122f=this[_0xed61('0xd')][_0xed61('0x54')](_0xed61('0xb1'),_0x1ad945);if(_0x3a122f[_0xed61('0xa6')]===-0x1){return _0x3a122f;}var _0x37e5b6=this[_0xed61('0xa5')](_0xed61('0xb2'),_0xed61('0xb3'));if(_0x37e5b6[_0xed61('0xa6')]===-0x1){return _0x37e5b6;}var _0x5aeb54=this[_0xed61('0xa5')](_0xed61('0xb4'),_0xed61('0xb5'));if(_0x5aeb54[_0xed61('0xa6')]===-0x1){return _0x5aeb54;}var _0x36ebf9=this['getAndSetVariable'](_0xed61('0xb6'),_0xed61('0xb7'));if(_0x36ebf9[_0xed61('0xa6')]===-0x1){return _0x36ebf9;}return this['channel'][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xb8'),_0x1ad945));};AGIVertices['prototype'][_0xed61('0x8')]=function(_0x19000e){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0xb9'),_0x19000e[_0xed61('0x31')]));return this[_0xed61('0xd')][_0xed61('0x8')]([_0x19000e[_0xed61('0xba')],_0x19000e[_0xed61('0xbb')]]);};AGIVertices[_0xed61('0x11')][_0xed61('0xbc')]=function(_0x5d313d){logger[_0xed61('0x26')](util['format'](_0xed61('0xbd'),_0x5d313d['label']));if(this[_0xed61('0x85')](_0x5d313d['timeout'])){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0xbe'),_0x5d313d['timeout']));var _0xbfac04=this[_0xed61('0xd')][_0xed61('0xbf')](_0x5d313d[_0xed61('0x61')]);if(_0xbfac04[_0xed61('0xa6')]===-0x1){return _0xbfac04;}}return this[_0xed61('0xd')][_0xed61('0xbc')]();};AGIVertices[_0xed61('0x11')][_0xed61('0xc0')]=function(_0xb2bfdc){logger[_0xed61('0x26')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0xb2bfdc['label']));if(!this[_0xed61('0x85')](_0xb2bfdc[_0xed61('0x44')])){return this[_0xed61('0xd')]['error'](_0xb2bfdc,_0xed61('0xc1'));}_0xb2bfdc['scheduledAt']=moment();if(this[_0xed61('0x85')](_0xb2bfdc[_0xed61('0xc2')])){_0xb2bfdc[_0xed61('0x45')]=moment()[_0xed61('0xc3')](_0xb2bfdc[_0xed61('0xc2')],_0xed61('0xc4'));}if(!this[_0xed61('0x85')](_0xb2bfdc[_0xed61('0x48')])){_0xb2bfdc['callback_priority']=0x2;}this[_0xed61('0x3d')]['sync'](this,_0xb2bfdc);return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xb2bfdc[_0xed61('0x43')],_0xb2bfdc[_0xed61('0x44')],_0xb2bfdc[_0xed61('0x45')]));};AGIVertices['prototype'][_0xed61('0xc5')]=function(_0x268439){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0xc6'),_0x268439[_0xed61('0x31')]));var _0xd02686=this[_0xed61('0xd')][_0xed61('0x54')](_0x268439[_0xed61('0xc7')],_0x268439[_0xed61('0x77')]);if(_0xd02686['result']===-0x1){return _0xd02686;}return this[_0xed61('0xd')][_0xed61('0xab')](util['format'](_0xed61('0xc8'),_0x268439[_0xed61('0xc7')],_0x268439[_0xed61('0x77')]));};AGIVertices[_0xed61('0x11')][_0xed61('0xc9')]=function(_0x3e356b){logger['info'](util[_0xed61('0x21')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3e356b['label']));if(!this[_0xed61('0x85')](_0x3e356b[_0xed61('0x59')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xaa'));}var _0x57c4ff='\x22'+_0x3e356b[_0xed61('0x59')]+'\x22';if(this[_0xed61('0x85')](_0x3e356b[_0xed61('0x77')])){_0x57c4ff+=','+_0x3e356b[_0xed61('0x77')];}var _0x5a6366=this[_0xed61('0xd')]['exec'](_0xed61('0xca'),_0x57c4ff);if(_0x5a6366[_0xed61('0xa6')]===-0x1){return _0x5a6366;}return this['channel'][_0xed61('0xab')](util['format'](_0xed61('0xac'),_0x57c4ff));};AGIVertices[_0xed61('0x11')][_0xed61('0xcb')]=function(_0x425ef4){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0xcc'),_0x425ef4[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x425ef4['text'])){return this['channel'][_0xed61('0xab')](_0xed61('0xaa'));}var _0x1fc8e='\x22'+_0x425ef4[_0xed61('0x59')]+'\x22';if(this[_0xed61('0x85')](_0x425ef4[_0xed61('0x77')])){_0x1fc8e+=','+_0x425ef4[_0xed61('0x77')];}var _0x2ffbf4=this[_0xed61('0xd')]['exec'](_0xed61('0xca'),_0x1fc8e);if(_0x2ffbf4[_0xed61('0xa6')]===-0x1){return _0x2ffbf4;}return this['channel'][_0xed61('0xab')](util[_0xed61('0x21')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1fc8e));};AGIVertices[_0xed61('0x11')][_0xed61('0xcd')]=function(_0xf0f27){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0xf0f27[_0xed61('0x31')]));if(!this['isConfigured'](_0xf0f27['grammar'])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xb0'));}var _0x448b10=_0xf0f27['grammar'];if(this[_0xed61('0x85')](_0xf0f27['options'])){_0x448b10+=','+_0xf0f27[_0xed61('0x77')];}var _0x589ced=this['channel']['exec'](_0xed61('0xb1'),_0x448b10);if(_0x589ced[_0xed61('0xa6')]===-0x1){return _0x589ced;}var _0x58e75a=this[_0xed61('0xa5')](_0xed61('0xb2'),_0xed61('0xce'));if(_0x58e75a[_0xed61('0xa6')]===-0x1){return _0x58e75a;}var _0x513560=this['getAndSetVariable'](_0xed61('0xb4'),_0xed61('0xcf'));if(_0x513560[_0xed61('0xa6')]===-0x1){return _0x513560;}var _0x257ee6=this[_0xed61('0xa5')](_0xed61('0xb6'),'LUMENVOX_ASR_INSTANCE');if(_0x257ee6['result']===-0x1){return _0x257ee6;}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xb8'),_0x448b10));};AGIVertices['prototype'][_0xed61('0xd0')]=function(_0x16a777){logger['info'](util[_0xed61('0x21')](_0xed61('0xd1'),_0x16a777['label']));if(!this[_0xed61('0x85')](_0x16a777['grammar'])){return this['channel'][_0xed61('0xab')]('no\x20grammar\x20configured');}var _0xe6e95b=_0x16a777[_0xed61('0xaf')];if(this['isConfigured'](_0x16a777[_0xed61('0x77')])){_0xe6e95b+=','+_0x16a777['options'];}var _0x32cf9b=this[_0xed61('0xd')][_0xed61('0x54')](_0xed61('0xb1'),_0xe6e95b);if(_0x32cf9b[_0xed61('0xa6')]===-0x1){return _0x32cf9b;}var _0x39db39=this[_0xed61('0xa5')]('RECOG_CONFIDENCE()',_0xed61('0xd2'));if(_0x39db39[_0xed61('0xa6')]===-0x1){return _0x39db39;}var _0x2e47cd=this[_0xed61('0xa5')](_0xed61('0xb4'),'SESTEK_ASR_TRANSCRIPT');if(_0x2e47cd[_0xed61('0xa6')]===-0x1){return _0x2e47cd;}var _0x4807f5=this[_0xed61('0xa5')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x4807f5['result']===-0x1){return _0x4807f5;}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('Executed\x20command\x20MRCPRecog\x20%s',_0xe6e95b));};AGIVertices[_0xed61('0x11')][_0xed61('0xd3')]=function(_0x31eafc){logger['info'](util[_0xed61('0x21')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x31eafc['label']));if(!this['isConfigured'](_0x31eafc[_0xed61('0xd4')])){return this['channel'][_0xed61('0x25')](_0x31eafc,'no\x20database\x20selected');}var _0x509c07=this[_0xed61('0x15')][_0xed61('0x6f')](this,_0x31eafc[_0xed61('0xd4')]);if(!_0x509c07){return this['channel'][_0xed61('0x25')](_0x31eafc,_0xed61('0xd5'));}if(!this[_0xed61('0x85')](_0x31eafc['query'])){return this['channel'][_0xed61('0x25')](_0x31eafc,_0xed61('0xd6'));}var _0x1bcd9d=_0x31eafc['query'][_0xed61('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xd7'),_0x1bcd9d));var _0x26ece0=this[_0xed61('0x23')][_0xed61('0x6f')](this,_0x509c07,_0x1bcd9d);this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x31eafc,_0x1bcd9d);if(!this['isConfigured'](_0x31eafc[_0xed61('0xd8')])){return this[_0xed61('0xd')]['noop'](_0xed61('0xd9'));}var _0x1fcc4a=this[_0xed61('0xa3')][_0xed61('0x6f')](this,_0x31eafc['variable_id']);if(!_0x1fcc4a){return this[_0xed61('0xd')]['error'](_0x31eafc,_0xed61('0xda'));}var _0x10f415=this;_0x26ece0[_0xed61('0xdb')](function(_0x5ba6dd,_0x2cc713){Object[_0xed61('0xdc')](_0x5ba6dd)['forEach'](function(_0x5b670a){_0x10f415['channel'][_0xed61('0xa1')](util[_0xed61('0x21')](_0xed61('0xdd'),_0x1fcc4a,_0x2cc713,_0x5b670a),_0x5ba6dd[_0x5b670a]);});});this[_0xed61('0xd')][_0xed61('0xa1')](util[_0xed61('0x21')](_0xed61('0xde'),_0x1fcc4a),_0x26ece0[_0xed61('0x9d')]);return this[_0xed61('0xd')][_0xed61('0xab')](util['format'](_0xed61('0xdf'),_0x1fcc4a));};AGIVertices[_0xed61('0x11')][_0xed61('0xe0')]=function(_0x13464a){logger['debug'](util[_0xed61('0x21')](_0xed61('0xe1'),_0x13464a[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x13464a[_0xed61('0xe2')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0x13464a,_0xed61('0xe3'));}var _0x2ec058=this[_0xed61('0x17')][_0xed61('0x6f')](this,_0x13464a[_0xed61('0xe2')]);if(!_0x2ec058){return this[_0xed61('0xd')]['error'](_0x13464a,_0xed61('0xe4'));}var _0x4eb64c=this[_0xed61('0xd')][_0xed61('0x54')](_0xed61('0xe5'),[util[_0xed61('0x21')](_0xed61('0xe6'),_0x2ec058),_0x13464a[_0xed61('0x61')],_0x13464a[_0xed61('0xe7')],_0x13464a['url']]);if(_0x4eb64c[_0xed61('0xa6')]===-0x1){return _0x4eb64c;}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xe8'),_0xed61('0xe5')));};AGIVertices['prototype'][_0xed61('0xe9')]=function(_0x2a6f33){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0xea'),_0x2a6f33[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x2a6f33[_0xed61('0x79')])){return this[_0xed61('0xd')]['noop'](_0xed61('0xeb'));}if(!this['isConfigured'](_0x2a6f33[_0xed61('0x59')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xed61('0xd')][_0xed61('0xec')]=!![];this[_0xed61('0x2f')](_0x2a6f33);this[_0xed61('0x3c')](_0x2a6f33[_0xed61('0x59')],'in','','');this['channel'][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xed'),_0x2a6f33[_0xed61('0x59')]));var _0x23e0dd=this['googleDialogflow'][_0xed61('0x6f')](this,_0x2a6f33);if(_0x23e0dd){for(var _0x2dc4f2 in _0x23e0dd){if(_0x23e0dd[_0xed61('0x97')](_0x2dc4f2)){this[_0xed61('0xd')][_0xed61('0xa1')](util['format'](_0xed61('0xee'),_0x2dc4f2[_0xed61('0x66')]()),_0x23e0dd[_0x2dc4f2]);}}this['createSquareMessage'](_0x23e0dd[_0xed61('0xef')],_0xed61('0xf0'),'dialogflow','');return this['channel'][_0xed61('0xab')](util['format'](_0xed61('0xf1'),_0x23e0dd[_0xed61('0xef')]));}return this[_0xed61('0xd')]['error'](_0x2a6f33,_0xed61('0xf2'));};AGIVertices['prototype'][_0xed61('0xf3')]=function(_0x20f912){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0xf4'),_0x20f912[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x20f912[_0xed61('0xf5')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xf6'));}if(!this[_0xed61('0x85')](_0x20f912[_0xed61('0x7c')])){return this['channel'][_0xed61('0xab')](_0xed61('0xf7'));}if(!this[_0xed61('0x85')](_0x20f912[_0xed61('0x7d')])){return this['channel'][_0xed61('0xab')](_0xed61('0xf8'));}if(!this[_0xed61('0x85')](_0x20f912[_0xed61('0x7e')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xf9'));}if(!this[_0xed61('0x85')](_0x20f912[_0xed61('0x59')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xaa'));}this['channel'][_0xed61('0xec')]=!![];this[_0xed61('0x2f')](_0x20f912);this[_0xed61('0x3c')](_0x20f912[_0xed61('0x59')],'in','','');this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xfa'),_0x20f912[_0xed61('0x59')]));var _0x583ce7=this[_0xed61('0x7b')][_0xed61('0x6f')](this,_0x20f912);if(_0x583ce7){for(var _0x519518 in _0x583ce7){if(_0x583ce7[_0xed61('0x97')](_0x519518)){if(_0x519518!=='providerResponse'){this['channel'][_0xed61('0xa1')](util[_0xed61('0x21')](_0xed61('0xee'),_0x519518[_0xed61('0x66')]()),_0x583ce7[_0x519518]);}}}this[_0xed61('0x3c')](_0x583ce7[_0xed61('0xef')],_0xed61('0xf0'),'dialogflowV2',_0x583ce7[_0xed61('0xfb')]);return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xfc'),_0x583ce7[_0xed61('0xef')]));}return this['channel'][_0xed61('0x25')](_0x20f912,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xed61('0x11')][_0xed61('0xfd')]=function(_0x3d6788){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0xfe'),_0x3d6788[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x3d6788[_0xed61('0xff')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x100'));}if(!this['isConfigured'](_0x3d6788[_0xed61('0x101')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x102'));}if(!this[_0xed61('0x85')](_0x3d6788[_0xed61('0x103')])){return this['channel'][_0xed61('0xab')](_0xed61('0x104'));}if(!this[_0xed61('0x85')](_0x3d6788[_0xed61('0x105')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xaa'));}this['channel'][_0xed61('0xec')]=!![];this[_0xed61('0x2f')](_0x3d6788);this['createSquareMessage'](_0x3d6788[_0xed61('0x59')],'in','','');this['channel'][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x106'),_0x3d6788[_0xed61('0x59')]));var _0x500ba8=this[_0xed61('0x7f')][_0xed61('0x6f')](this,_0x3d6788);if(_0x500ba8){for(var _0x1cc17c in _0x500ba8){if(_0x500ba8[_0xed61('0x97')](_0x1cc17c)){this['channel']['setVariable'](util['format'](_0xed61('0x107'),_0x1cc17c[_0xed61('0x66')]()),_0x500ba8[_0x1cc17c]);}}this[_0xed61('0x3c')](_0x500ba8[_0xed61('0xef')],_0xed61('0xf0'),'sesteknda','');if(_0x500ba8[_0xed61('0x108')]){this[_0xed61('0xd')]['noop'](util[_0xed61('0x21')](_0xed61('0x109'),_0x500ba8[_0xed61('0x108')]));var _0x281d98=this[_0xed61('0xd')][_0xed61('0x10a')](_0x500ba8[_0xed61('0x108')]);try{fs['unlink'](_0x500ba8[_0xed61('0x108')]+_0xed61('0x10b'));}catch(_0x14d7ee){logger[_0xed61('0x25')](_0x14d7ee);}return _0x281d98;}else{return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x10c'),_0x500ba8[_0xed61('0xef')]));}}return this[_0xed61('0xd')][_0xed61('0x25')](_0x3d6788,_0xed61('0x10d'));};AGIVertices['prototype'][_0xed61('0x10e')]=function(_0x3e40fe){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20END\x20(%s)\x20block',_0x3e40fe[_0xed61('0x31')]));return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x10e'));};AGIVertices['prototype'][_0xed61('0x10f')]=function(_0x1eae9a){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x110'),_0x1eae9a[_0xed61('0x31')]));var _0xe56af0='';if(_0x1eae9a[_0xed61('0x111')]){if(!this['isConfigured'](_0x1eae9a[_0xed61('0x111')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0x1eae9a,_0xed61('0x112'));}else{var _0x3d37b=parseInt(_0x1eae9a[_0xed61('0x111')],0xa);if(isNaN(_0x3d37b)){_0xe56af0=_0x1eae9a[_0xed61('0x111')];}else{_0xe56af0=this[_0xed61('0x18')][_0xed61('0x6f')](this,_0x1eae9a[_0xed61('0x111')]);if(!_0xe56af0){return this[_0xed61('0xd')][_0xed61('0x25')](_0x1eae9a,_0xed61('0x113'));}}}}else if(_0x1eae9a[_0xed61('0x114')]){_0xe56af0=_0x1eae9a[_0xed61('0x114')];}else{return this[_0xed61('0xd')][_0xed61('0x25')](_0x1eae9a,_0xed61('0x112'));}var _0x3c4653=this[_0xed61('0xd')]['exec'](_0xed61('0xe5'),[util[_0xed61('0x21')](_0xed61('0x115'),_0xe56af0,_0x1eae9a[_0xed61('0x43')]),_0x1eae9a[_0xed61('0x61')],_0x1eae9a[_0xed61('0xe7')],_0x1eae9a[_0xed61('0x5f')]]);if(_0x3c4653[_0xed61('0xa6')]===-0x1){return _0x3c4653;}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xe8'),_0xed61('0xe5')));};AGIVertices['prototype'][_0xed61('0x116')]=function(_0x2cffaf){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x117'),_0x2cffaf[_0xed61('0x31')]));return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x116'));};AGIVertices[_0xed61('0x11')][_0xed61('0x118')]=function(_0x5d0dbe){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x5d0dbe[_0xed61('0x31')]));if(_0x5d0dbe[_0xed61('0x119')]===0x0){return this['maxRetry'](_0x5d0dbe);}_0x5d0dbe[_0xed61('0x119')]-=0x1;if(!this['isConfigured'](_0x5d0dbe[_0xed61('0x11a')])){return this[_0xed61('0xd')]['error'](_0x5d0dbe,_0xed61('0x11b'));}var _0x567a1f=this['getSound'][_0xed61('0x6f')](this,_0x5d0dbe[_0xed61('0x11a')]);if(!_0x567a1f){return this[_0xed61('0xd')]['error'](_0x5d0dbe,_0xed61('0x11c'));}if(!this[_0xed61('0x85')](_0x5d0dbe[_0xed61('0xd8')])){return this[_0xed61('0xd')]['error'](_0xed61('0xd9'));}var _0x1a7f24=this['channel'][_0xed61('0x11d')](_0x567a1f,_0x5d0dbe[_0xed61('0x11e')],_0x5d0dbe[_0xed61('0x11f')]);var _0x3ed327=_0x1a7f24[_0xed61('0xa6')]?_0x1a7f24[_0xed61('0xa6')][_0xed61('0x47')]():'';logger[_0xed61('0x26')](_0xed61('0x120'),JSON[_0xed61('0x71')](_0x1a7f24));if(_0x1a7f24[_0xed61('0xa6')]===-0x1){this[_0xed61('0x2f')]['sync'](this,_0x5d0dbe,_0x3ed327);return _0x1a7f24;}else if(_0x1a7f24[_0xed61('0xa4')]===_0xed61('0x61')){_0x1a7f24[_0xed61('0xa6')]=_0x3ed327[_0xed61('0x9d')]>=parseInt(_0x5d0dbe[_0xed61('0x121')])?'x':'i';}else{_0x1a7f24[_0xed61('0xa6')]=_0x3ed327[_0xed61('0x9d')]>=parseInt(_0x5d0dbe[_0xed61('0x121')])&&_0x3ed327[_0xed61('0x9d')]<=parseInt(_0x5d0dbe[_0xed61('0x11f')])?'x':'i';}var _0x3a2643=this[_0xed61('0xa3')]['sync'](this,_0x5d0dbe['variable_id']);if(!_0x3a2643){return this['channel'][_0xed61('0x25')](_0x5d0dbe,_0xed61('0xda'));}this[_0xed61('0xd')][_0xed61('0xa1')](_0x3a2643,_0x3ed327);if(this[_0xed61('0x85')](_0x5d0dbe['hiddendigitsnum'])){var _0x4ee992=parseInt(_0x5d0dbe['hiddendigitsnum'],0xa);var _0x59827c=rs[_0xed61('0x122')]({'charset':'*','length':_0x4ee992});var _0x1a9e06=_0x3ed327[_0xed61('0x9d')];if(_0x1a9e06>0x0){if(_0x1a9e06>_0x4ee992){this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x5d0dbe,_0x5d0dbe[_0xed61('0x123')]===_0xed61('0x124')?_0x59827c+_0x3ed327[_0xed61('0x125')](_0x4ee992):_0x3ed327[_0xed61('0x125')](0x0,_0x1a9e06-_0x4ee992)+_0x59827c);}else{this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x5d0dbe,rs[_0xed61('0x122')]({'charset':'*','length':_0x1a9e06}));}}else{this['createSquareDetailsReport'][_0xed61('0x6f')](this,_0x5d0dbe,'');}}else{this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x5d0dbe,_0x3ed327);}return _0x1a7f24;};AGIVertices[_0xed61('0x11')]['getsecretdigits']=function(_0xb64f9){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x126'),_0xb64f9[_0xed61('0x31')]));return this[_0xed61('0x118')](_0xb64f9);};AGIVertices[_0xed61('0x11')][_0xed61('0x127')]=function(_0x45e9db){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x45e9db[_0xed61('0x31')]));this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x45e9db,_0x45e9db[_0xed61('0x128')]);return this[_0xed61('0xd')]['noop'](util['format'](_0xed61('0x129'),_0x45e9db[_0xed61('0x128')]));};AGIVertices[_0xed61('0x11')][_0xed61('0x12a')]=function(_0x14a0bf){logger[_0xed61('0x26')](util['format'](_0xed61('0x12b'),_0x14a0bf[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x14a0bf[_0xed61('0x88')])||!this['isConfigured'](_0x14a0bf[_0xed61('0x89')])){return this[_0xed61('0xd')][_0xed61('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x14a0bf[_0xed61('0x59')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xaa'));}this['channel'][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x12c'),_0x14a0bf[_0xed61('0x59')]));var _0x334881=this['awsPolly'][_0xed61('0x6f')](this,_0x14a0bf);if(_0x334881){this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x12d'),_0x334881));var _0x19f49c=this[_0xed61('0xd')][_0xed61('0x10a')](_0x334881);try{fs['unlink'](_0x334881+_0xed61('0x10b'));}catch(_0x129078){logger[_0xed61('0x25')](_0x129078);}return _0x19f49c;}return this[_0xed61('0xd')][_0xed61('0x25')](_0x14a0bf,_0xed61('0x12e'));};AGIVertices[_0xed61('0x11')]['awslex']=function(_0x27f667){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x12f'),_0x27f667[_0xed61('0x31')]));if(!this['isConfigured'](_0x27f667['aws_access_key_id'])||!this[_0xed61('0x85')](_0x27f667[_0xed61('0x89')])){return this[_0xed61('0xd')][_0xed61('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x27f667[_0xed61('0x90')])){return this['channel']['noop'](_0xed61('0x130'));}if(!this['isConfigured'](_0x27f667[_0xed61('0x59')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xaa'));}this['channel'][_0xed61('0xec')]=!![];this[_0xed61('0x2f')](_0x27f667);this[_0xed61('0x3c')](_0x27f667[_0xed61('0x59')],'in','','');this[_0xed61('0xd')]['noop'](util[_0xed61('0x21')]('Trying\x20Amazon\x20Lex:\x20%s',_0x27f667[_0xed61('0x59')]));var _0x43f1fa=this[_0xed61('0x8e')][_0xed61('0x6f')](this,_0x27f667);if(_0x43f1fa){for(var _0x3fc3a4 in _0x43f1fa){if(_0x43f1fa['hasOwnProperty'](_0x3fc3a4)&&_['isString'](_0x43f1fa[_0x3fc3a4])){this[_0xed61('0xd')]['setVariable'](util[_0xed61('0x21')](_0xed61('0x131'),_0x3fc3a4[_0xed61('0x66')]()),_0x43f1fa[_0x3fc3a4]);}}if(_[_0xed61('0x3f')](_0x43f1fa[_0xed61('0x75')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x132'));}else{this['createSquareMessage'](_0x43f1fa[_0xed61('0x75')],_0xed61('0xf0'),_0xed61('0x133'),'');return this['channel']['noop'](util[_0xed61('0x21')](_0xed61('0x134'),_0x43f1fa['message']));}}return this[_0xed61('0xd')][_0xed61('0x25')](_0x27f667,_0xed61('0x135'));};AGIVertices[_0xed61('0x11')]['googleasr']=function(_0x28a4a9){logger[_0xed61('0x26')](util['format'](_0xed61('0x136'),_0x28a4a9[_0xed61('0x31')],_0x28a4a9[_0xed61('0x61')]));if(!this['isConfigured'](_0x28a4a9[_0xed61('0x79')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xeb'));}var _0x3a5f61='wav';var _0x145ea1=util['format'](_0xed61('0x137'),FILES_PATH,rs[_0xed61('0x122')](0x4));var _0x159097=util['format'](_0xed61('0x9f'),_0x145ea1,_0x3a5f61);var _0x32813d=!![];if(_0x28a4a9['beep']===_0xed61('0x138')){_0x32813d=![];}var _0x343933=this['channel'][_0xed61('0x139')](_0x145ea1,_0x3a5f61,_0x28a4a9[_0xed61('0x13a')],_0x28a4a9[_0xed61('0x61')],undefined,_0x32813d);if(_0x343933[_0xed61('0xa6')]!==-0x1){this[_0xed61('0xd')]['noop'](util[_0xed61('0x21')]('google\x20%s\x20file\x20created',_0x159097));var _0x17030b=this[_0xed61('0x91')]['sync'](this,_0x28a4a9,_0x159097);if(_0x17030b){for(var _0x50d78a in _0x17030b){if(_0x17030b['hasOwnProperty'](_0x50d78a)){this[_0xed61('0xd')][_0xed61('0xa1')](util['format'](_0xed61('0x13b'),_0x50d78a[_0xed61('0x66')]()),_0x17030b[_0x50d78a]);}}return this['channel'][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x13c'),JSON[_0xed61('0x71')](_0x17030b)));}}return _0x343933;};AGIVertices[_0xed61('0x11')][_0xed61('0x13d')]=function(_0x4ad668){logger[_0xed61('0x26')](util['format'](_0xed61('0x13e'),_0x4ad668['label']));if(!this[_0xed61('0x85')](_0x4ad668[_0xed61('0x93')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x13f'));}if(!this[_0xed61('0x85')](_0x4ad668[_0xed61('0x94')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x140'));}var _0x1908a6=_0xed61('0x141');var _0x335f04=util[_0xed61('0x21')](_0xed61('0x137'),FILES_PATH,rs[_0xed61('0x122')](0x4));var _0x31ce9b=util[_0xed61('0x21')]('%s.%s',_0x335f04,_0x1908a6);var _0x562127=!![];if(_0x4ad668[_0xed61('0x142')]===_0xed61('0x138')){_0x562127=![];}var _0x54fe96=this[_0xed61('0xd')]['recordFile'](_0x335f04,_0x1908a6,_0x4ad668[_0xed61('0x13a')],_0x4ad668[_0xed61('0x61')],undefined,_0x562127);if(_0x54fe96[_0xed61('0xa6')]!==-0x1){this['channel']['noop'](util[_0xed61('0x21')](_0xed61('0x143'),_0x31ce9b));var _0x11337d=this[_0xed61('0x92')][_0xed61('0x6f')](this,_0x4ad668,_0x31ce9b);if(_0x11337d){for(var _0x215ef9 in _0x11337d){if(_0x11337d[_0xed61('0x97')](_0x215ef9)){this[_0xed61('0xd')][_0xed61('0xa1')](util['format'](_0xed61('0x144'),_0x215ef9[_0xed61('0x66')]()),_0x11337d[_0x215ef9]);}}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x145'),JSON[_0xed61('0x71')](_0x11337d)));}}return _0x54fe96;};AGIVertices[_0xed61('0x11')]['gotoc']=function(_0x470f75){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x146'),_0x470f75[_0xed61('0x31')]));return this[_0xed61('0xd')][_0xed61('0x147')](_0x470f75[_0xed61('0x148')],_0x470f75['extension'],_0x470f75[_0xed61('0x38')]);};AGIVertices[_0xed61('0x11')]['gotoif']=function(_0x4e357c){logger['info'](util['format'](_0xed61('0x149'),_0x4e357c[_0xed61('0x31')]));if(!this['isConfigured'](_0x4e357c[_0xed61('0x14a')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0x4e357c,_0xed61('0x14b'));}try{var _0x4240da=eval(_0x4e357c[_0xed61('0x14a')])?_0xed61('0x14c'):'false';this[_0xed61('0xd')][_0xed61('0xab')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x4e357c[_0xed61('0x14a')],_0x4240da));return{'code':0xc8,'result':_0x4240da};}catch(_0x502c92){return{'code':0xc8,'result':_0xed61('0x14d')};}};AGIVertices[_0xed61('0x11')][_0xed61('0x14e')]=function(_0x6e9f9){logger[_0xed61('0x26')](util['format'](_0xed61('0x14f'),_0x6e9f9[_0xed61('0x31')]));if(!this['isConfigured'](_0x6e9f9[_0xed61('0x150')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0x6e9f9,'no\x20interval\x20configured');}var _0x3d201a=this[_0xed61('0x1e')]['sync'](this,_0x6e9f9[_0xed61('0x150')]);if(!_0x3d201a){return this[_0xed61('0xd')]['error'](_0x6e9f9,_0xed61('0x151'));}for(var _0x4c11cb=0x0;_0x4c11cb<_0x3d201a[_0xed61('0x9d')];_0x4c11cb+=0x1){var _0x5a462f=this[_0xed61('0xd')][_0xed61('0xa3')](util[_0xed61('0x21')](_0xed61('0x152'),_0x3d201a[_0x4c11cb]));if(_0x5a462f[_0xed61('0xa6')]===-0x1){return _0x5a462f;}logger[_0xed61('0x26')](util['format'](_0xed61('0x153'),_0x3d201a[_0x4c11cb],_0x5a462f['extra']));if(_0x5a462f[_0xed61('0xa4')]===_0xed61('0x14c')){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x153'),_0x3d201a[_0x4c11cb],_0xed61('0x14c')));this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('IFTIME\x20%s\x20%s',_0x3d201a[_0x4c11cb],_0xed61('0x14c')));return{'code':0xc8,'result':_0xed61('0x14c')};}else{logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x153'),_0x3d201a[_0x4c11cb],'false'));this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x153'),_0x3d201a[_0x4c11cb],'false'));}}return{'code':0xc8,'result':_0xed61('0x14d')};};AGIVertices[_0xed61('0x11')][_0xed61('0x154')]=function(_0x296d2d){logger['info'](util[_0xed61('0x21')](_0xed61('0x155'),_0x296d2d[_0xed61('0x31')]));return this[_0xed61('0xd')]['hangup']();};AGIVertices[_0xed61('0x11')][_0xed61('0x156')]=function(_0x36f764){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x36f764['label']));if(!this[_0xed61('0x85')](_0x36f764['key'])){return this['channel'][_0xed61('0xab')](_0xed61('0xeb'));}var _0x30da44=_0xed61('0x141');var _0x3e1a5e=util[_0xed61('0x21')](_0xed61('0x137'),FILES_PATH,rs[_0xed61('0x122')](0x4));var _0x22a17d=util[_0xed61('0x21')](_0xed61('0x9f'),_0x3e1a5e,_0x30da44);var _0x416c73=!![];if(_0x36f764[_0xed61('0x142')]==='NOBEEP'){_0x416c73=![];}var _0x5e2c2a=this[_0xed61('0xd')][_0xed61('0x139')](_0x3e1a5e,_0x30da44,_0x36f764[_0xed61('0x13a')],_0x36f764[_0xed61('0x61')],undefined,_0x416c73);if(_0x5e2c2a[_0xed61('0xa6')]!==-0x1){this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('ispeech\x20%s\x20file\x20created',_0x22a17d));var _0x533e17=this[_0xed61('0x83')][_0xed61('0x6f')](this,_0x36f764,_0x22a17d);if(_0x533e17){for(var _0x1c50aa in _0x533e17){if(_0x533e17['hasOwnProperty'](_0x1c50aa)){this[_0xed61('0xd')][_0xed61('0xa1')](util['format'](_0xed61('0x157'),_0x1c50aa[_0xed61('0x66')]()),_0x533e17[_0x1c50aa]);}}return this[_0xed61('0xd')]['noop'](util[_0xed61('0x21')]('IspeechASR\x20Result\x20%s',JSON[_0xed61('0x71')](_0x533e17)));}}return _0x5e2c2a;};AGIVertices[_0xed61('0x11')][_0xed61('0x158')]=function(_0x5491fc){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x5491fc[_0xed61('0x31')]));if(!this['isConfigured'](_0x5491fc[_0xed61('0x79')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xeb'));}if(!this[_0xed61('0x85')](_0x5491fc['text'])){return this[_0xed61('0xd')]['noop'](_0xed61('0xaa'));}this[_0xed61('0xd')]['noop'](util[_0xed61('0x21')](_0xed61('0x159'),_0x5491fc[_0xed61('0x59')]));var _0x2bba4d=this[_0xed61('0x80')][_0xed61('0x6f')](this,_0x5491fc);if(_0x2bba4d){this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('ispeech\x20%s\x20file\x20created',_0x2bba4d));var _0x556203=this['channel'][_0xed61('0x10a')](_0x2bba4d,_0x5491fc[_0xed61('0x13a')]);try{fs[_0xed61('0x15a')](_0x2bba4d+_0xed61('0x10b'));}catch(_0x530173){logger[_0xed61('0x25')](_0x530173);}return _0x556203;}return this[_0xed61('0xd')]['error'](_0x5491fc,_0xed61('0x15b'));};AGIVertices[_0xed61('0x11')][_0xed61('0x15c')]=function(_0x479430){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x15d'),_0x479430[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x479430[_0xed61('0x15e')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0x479430,'no\x20find\x20by\x20configured');}logger[_0xed61('0x26')](util['format'](_0xed61('0x15f'),this[_0xed61('0xd')]['callerid'],_0x479430[_0xed61('0x15e')]));var _0x142012=this[_0xed61('0x4f')][_0xed61('0x6f')](this,_0x479430['findBy']);if(_0x142012){logger['info'](util[_0xed61('0x21')](_0xed61('0x160'),this['channel'][_0xed61('0x34')],_0x479430[_0xed61('0x15e')]));this['channel']['noop'](util[_0xed61('0x21')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xed61('0x34')],_0x479430[_0xed61('0x15e')]));return{'code':0xc8,'result':_0xed61('0x161')};}else{logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x162'),this[_0xed61('0xd')][_0xed61('0x34')],_0x479430['findBy']));this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x162'),this[_0xed61('0xd')][_0xed61('0x34')],_0x479430['findBy']));return{'code':0xc8,'result':_0xed61('0x163')};}};AGIVertices['prototype'][_0xed61('0x164')]=function(_0x311013){logger['info'](util[_0xed61('0x21')](_0xed61('0x165'),_0x311013[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x311013[_0xed61('0x15e')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0x311013,_0xed61('0x166'));}logger[_0xed61('0x26')](util['format'](_0xed61('0x15f'),this[_0xed61('0xd')][_0xed61('0x34')],_0x311013['findBy']));var _0x20945d=this[_0xed61('0x4e')][_0xed61('0x6f')](this,_0x311013[_0xed61('0x15e')]);if(_0x20945d){logger[_0xed61('0x26')](util[_0xed61('0x21')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xed61('0xd')][_0xed61('0x34')],_0x311013[_0xed61('0x15e')]));this['channel'][_0xed61('0xab')](util[_0xed61('0x21')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xed61('0xd')][_0xed61('0x34')],_0x311013[_0xed61('0x15e')]));return{'code':0xc8,'result':_0xed61('0x161')};}else{logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x162'),this['channel']['callerid'],_0x311013['findBy']));this['channel'][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x162'),this['channel'][_0xed61('0x34')],_0x311013[_0xed61('0x15e')]));return{'code':0xc8,'result':_0xed61('0x163')};}};AGIVertices[_0xed61('0x11')][_0xed61('0x167')]=function(_0x192e83){logger['info'](util[_0xed61('0x21')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x192e83[_0xed61('0x31')]));if(!this['isConfigured'](_0x192e83[_0xed61('0x168')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0x192e83,_0xed61('0x169'));}this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x16a'),_0x192e83[_0xed61('0x168')]));var _0x189c06=eval(_0x192e83[_0xed61('0x168')]);if(!this[_0xed61('0x85')](_0x192e83['variable_id'])){return this['channel'][_0xed61('0xab')](_0xed61('0xd9'));}var _0x45bf0d=this[_0xed61('0xa3')][_0xed61('0x6f')](this,_0x192e83['variable_id']);if(!_0x45bf0d){return this[_0xed61('0xd')][_0xed61('0x25')](_0x192e83,_0xed61('0xda'));}if(_['isArray'](_0x189c06)){var _0x32ace6=this;_0x189c06[_0xed61('0xdb')](function(_0x49db7e,_0x55b619){_0x32ace6['channel'][_0xed61('0xa1')](util[_0xed61('0x21')]('%s[%s]',_0x45bf0d,_0x55b619),_0x49db7e);});return this[_0xed61('0xd')][_0xed61('0xab')](util['format']('variable\x20%s[key]\x20set',_0x45bf0d));}else{return this[_0xed61('0xd')][_0xed61('0xa1')](_0x45bf0d,_0x189c06);}};AGIVertices[_0xed61('0x11')][_0xed61('0x16b')]=function(_0x4994d4){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x16c'),_0x4994d4[_0xed61('0x31')]));if(_0x4994d4['retry']===0x0){return this[_0xed61('0xa7')](_0x4994d4);}_0x4994d4[_0xed61('0x119')]-=0x1;if(!this[_0xed61('0x85')](_0x4994d4['file_id'])){return this[_0xed61('0xd')]['error'](_0x4994d4,'no\x20file\x20audio\x20selected');}var _0x457cd2=this[_0xed61('0x16d')][_0xed61('0x6f')](this,_0x4994d4[_0xed61('0x11a')]);if(!_0x457cd2){return this[_0xed61('0xd')]['error'](_0x4994d4,_0xed61('0x11c'));}var _0x3d9b6e=this['channel'][_0xed61('0x11d')](_0x457cd2,_0x4994d4['response'],_0x4994d4['digit']);var _0x299e1b=_0x3d9b6e[_0xed61('0xa6')];if(_0x3d9b6e[_0xed61('0xa6')]===-0x1){this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x4994d4,'-1');return _0x3d9b6e;}else if(_0x3d9b6e[_0xed61('0xa4')]==='timeout'){_0x3d9b6e[_0xed61('0xa6')]=_0x3d9b6e[_0xed61('0xa6')]['length']>0x0?_0x3d9b6e['result']:'t';}else if(_['isEmpty'](_0x3d9b6e[_0xed61('0xa6')])){_0x3d9b6e[_0xed61('0xa6')]='#';_0x299e1b='#';}if(!this[_0xed61('0x85')](_0x4994d4['variable_id'])){this[_0xed61('0xd')][_0xed61('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3980f1=this[_0xed61('0xa3')][_0xed61('0x6f')](this,_0x4994d4['variable_id']);if(!_0x3980f1){return this[_0xed61('0xd')][_0xed61('0x25')](_0x4994d4,_0xed61('0xda'));}this[_0xed61('0xd')]['setVariable'](_0x3980f1,_0x299e1b);}this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x4994d4,_0x299e1b);return _0x3d9b6e;};AGIVertices[_0xed61('0x11')]['noop']=function(_0x51000d){logger['info'](util[_0xed61('0x21')](_0xed61('0x16e'),_0x51000d[_0xed61('0x31')]));return this[_0xed61('0xd')][_0xed61('0xab')](_0x51000d[_0xed61('0x16f')]||_0x51000d['label']);};AGIVertices[_0xed61('0x11')][_0xed61('0x170')]=function(_0xca7076){logger['info'](util[_0xed61('0x21')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0xca7076['label']));if(!this[_0xed61('0x85')](_0xca7076[_0xed61('0x15e')])){return this['channel'][_0xed61('0x25')](_0xca7076,_0xed61('0x166'));}logger['info'](util[_0xed61('0x21')](_0xed61('0x15f'),this[_0xed61('0xd')][_0xed61('0x34')],_0xca7076[_0xed61('0x15e')]));var _0x31316d=this['getPause'][_0xed61('0x6f')](this,_0xca7076[_0xed61('0x171')]);var _0x2077e9=this[_0xed61('0x4b')][_0xed61('0x6f')](this,_0xca7076[_0xed61('0x15e')],_0x31316d);if(_0x2077e9){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x160'),this[_0xed61('0xd')][_0xed61('0x34')],_0xca7076[_0xed61('0x15e')]));this['channel'][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x160'),this[_0xed61('0xd')][_0xed61('0x34')],_0xca7076[_0xed61('0x15e')]));return{'code':0xc8,'result':_0xed61('0x161')};}else{logger[_0xed61('0x26')](util['format'](_0xed61('0x162'),this[_0xed61('0xd')]['callerid'],_0xca7076[_0xed61('0x15e')]));this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xed61('0xd')]['callerid'],_0xca7076[_0xed61('0x15e')]));return{'code':0xc8,'result':_0xed61('0x163')};}};AGIVertices[_0xed61('0x11')][_0xed61('0x172')]=function(_0x5ea2fe){logger[_0xed61('0x26')](util['format'](_0xed61('0x173'),_0x5ea2fe[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x5ea2fe['file_id'])){return this['channel'][_0xed61('0x25')](_0x5ea2fe,_0xed61('0x11b'));}var _0x3b941f=this['getSound'][_0xed61('0x6f')](this,_0x5ea2fe[_0xed61('0x11a')]);if(!_0x3b941f){return this[_0xed61('0xd')][_0xed61('0x25')](_0x5ea2fe,'no\x20file\x20audio\x20found');}var _0x157073=this[_0xed61('0xd')]['exec'](_0xed61('0x174'),[_0x3b941f,_0x5ea2fe[_0xed61('0xe7')]]);if(_0x157073[_0xed61('0xa6')]===-0x1){return _0x157073;}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xc8'),_0xed61('0x174'),_0x3b941f));};AGIVertices[_0xed61('0x11')][_0xed61('0x175')]=function(_0xf276a3){logger[_0xed61('0x26')](util['format'](_0xed61('0x176'),_0xf276a3[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0xf276a3[_0xed61('0x177')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0xf276a3,_0xed61('0x178'));}var _0x5cdc5b='';var _0x32482f=parseInt(_0xf276a3[_0xed61('0x177')],0xa);if(isNaN(_0x32482f)){_0x5cdc5b=_0xf276a3['queue_id'];}else{_0x5cdc5b=this[_0xed61('0x179')][_0xed61('0x6f')](this,_0xf276a3[_0xed61('0x177')]);if(!_0x5cdc5b){return this[_0xed61('0xd')][_0xed61('0x25')](_0xf276a3,_0xed61('0x17a'));}}var _0x377578='';if(this['isConfigured'](_0xf276a3[_0xed61('0x11a')])){var _0x2ca90f=this[_0xed61('0x16d')][_0xed61('0x6f')](this,_0xf276a3[_0xed61('0x11a')]);if(_0x2ca90f){_0x377578=_0x2ca90f;}}this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0xf276a3,_0x5cdc5b);if(_0xf276a3[_0xed61('0xe7')][_0xed61('0x17b')]('x')<0x0){_0xf276a3[_0xed61('0xe7')]+='x';}if(_0xf276a3['opts'][_0xed61('0x17b')]('X')<0x0){_0xf276a3[_0xed61('0xe7')]+='X';}this['channel'][_0xed61('0xa1')](_0xed61('0x17c'),_0x5cdc5b?_0x5cdc5b['toLowerCase']():'');var _0x351aec=this[_0xed61('0xd')][_0xed61('0x54')](_0xed61('0x17d'),[_0x5cdc5b,_0xf276a3['opts'],_0xf276a3[_0xed61('0x5f')],_0x377578,_0xf276a3[_0xed61('0x61')],_0xf276a3[_0xed61('0x8')],_0xf276a3[_0xed61('0x17e')],_0xf276a3[_0xed61('0x17f')],'',_0xf276a3[_0xed61('0x180')]]);if(_0x351aec[_0xed61('0xa6')]===-0x1){return _0x351aec;}return this['channel']['noop'](util[_0xed61('0x21')]('Executed\x20command\x20%s\x20%s','QUEUE',_0x5cdc5b));};AGIVertices[_0xed61('0x11')][_0xed61('0x181')]=function(_0x3a2550){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x182'),_0x3a2550['label']));var _0x9df9c4=_0x3a2550[_0xed61('0x183')]||_0xed61('0x141');var _0x4dd4f5=util[_0xed61('0x21')](_0xed61('0x184'),this[_0xed61('0xd')][_0xed61('0x30')],rs[_0xed61('0x122')](0x5));var _0x2f2f29=util[_0xed61('0x21')]('%s/recordings/%s.%s',FILES_PATH,_0x4dd4f5,_0x9df9c4);var _0x5f23cc=util[_0xed61('0x21')](_0xed61('0x137'),FILES_PATH,_0x4dd4f5);this[_0xed61('0x35')][_0xed61('0x6f')](this,_0x3a2550,_0x4dd4f5,_0x2f2f29);this[_0xed61('0xd')]['setVariable'](_0xed61('0x185'),_0x4dd4f5);logger[_0xed61('0x26')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5f23cc,_0x9df9c4,_0x3a2550['escape_digits'],_0x3a2550[_0xed61('0x61')]);return this[_0xed61('0xd')][_0xed61('0x139')](_0x5f23cc,_0x9df9c4,_0x3a2550['escape_digits'],_0x3a2550['timeout'],undefined,!![]);};AGIVertices[_0xed61('0x11')]['restapi']=function(_0x2f3e46){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x2f3e46[_0xed61('0x31')]));if(!this['isConfigured'](_0x2f3e46[_0xed61('0x5f')])){return this[_0xed61('0xd')][_0xed61('0xab')]('no\x20url\x20configured');}var _0x16b9d1=this[_0xed61('0x5e')][_0xed61('0x6f')](this,_0x2f3e46);logger[_0xed61('0x26')](util[_0xed61('0x21')]('Response:',util[_0xed61('0x186')](_0x16b9d1,{'showHidden':![],'depth':null})));if(!this[_0xed61('0x85')](_0x2f3e46[_0xed61('0xd8')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x187'));}var _0x2bb925=this[_0xed61('0xa3')]['sync'](this,_0x2f3e46['variable_id']);if(!_0x2bb925){return this[_0xed61('0xd')][_0xed61('0x25')](_0x2f3e46,_0xed61('0xda'));}this['channel'][_0xed61('0xa1')](util['format'](_0xed61('0x188'),_0x2bb925),_0x16b9d1[_0xed61('0x73')]?_0x16b9d1['statusCode']:_0xed61('0x189'));this[_0xed61('0xd')][_0xed61('0xa1')](util[_0xed61('0x21')](_0xed61('0x18a'),_0x2bb925),_0x16b9d1[_0xed61('0x74')]?_0x16b9d1[_0xed61('0x74')]:'OK');if(_0x16b9d1[_0xed61('0x67')]){try{this['saveRestApiResult'](_0x16b9d1[_0xed61('0x67')],_0x2bb925);}catch(_0x474bd7){logger['error'](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x2bb925));}}return this['channel'][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xdf'),_0x2bb925));};AGIVertices['prototype'][_0xed61('0x18b')]=function(_0x1ff219){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x18c'),_0x1ff219[_0xed61('0x31')]));return this[_0xed61('0xd')][_0xed61('0x18d')](_0x1ff219['digits'][_0xed61('0x55')](/\s+/g,''),_0x1ff219[_0xed61('0x18e')]);};AGIVertices[_0xed61('0x11')][_0xed61('0x18f')]=function(_0x599579){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x599579[_0xed61('0x31')]));return this['channel'][_0xed61('0x190')](_0x599579['number'][_0xed61('0x55')](/\s+/g,''),_0x599579[_0xed61('0x18e')]);};AGIVertices[_0xed61('0x11')][_0xed61('0x191')]=function(_0x263afe){logger['info'](util[_0xed61('0x21')](_0xed61('0x192'),_0x263afe['label']));return this[_0xed61('0xd')][_0xed61('0x193')](_0x263afe[_0xed61('0x59')],_0x263afe[_0xed61('0x18e')]);};AGIVertices[_0xed61('0x11')]['sendMail']=function(_0x6ae0eb){logger['info'](util[_0xed61('0x21')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x6ae0eb[_0xed61('0x31')]));if(!this['isConfigured'](_0x6ae0eb[_0xed61('0x194')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x195'));}var _0x59333e=this[_0xed61('0x1b')][_0xed61('0x6f')](this,_0x6ae0eb['account_id']);if(!_0x59333e||!_0x59333e['Smtp']){return this[_0xed61('0xd')]['error'](_0x6ae0eb,'no\x20mail\x20account\x20found');}var _0x402692={'from':util[_0xed61('0x21')]('\x22%s\x22\x20<%s>',_0x59333e['name'],_0x59333e[_0xed61('0x196')]||_0x59333e['Smtp'][_0xed61('0x197')]),'to':_0x6ae0eb['to']||'','cc':_0x6ae0eb['cc']||'','bcc':_0x6ae0eb[_0xed61('0x198')]||'','subject':_0x6ae0eb[_0xed61('0x199')],'html':_0x6ae0eb[_0xed61('0x59')],'text':_0x6ae0eb['text']};if(this['isConfigured'](_0x6ae0eb[_0xed61('0x19a')])){}logger[_0xed61('0x19b')](_0xed61('0x19c'),JSON['stringify'](_0x402692));this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x6ae0eb,_0x6ae0eb['account_id']);this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x59333e['name']));this[_0xed61('0x1d')][_0xed61('0x6f')](this,_0x59333e['smtpOptions'],_0x402692);return this[_0xed61('0xd')][_0xed61('0xab')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xed61('0x11')][_0xed61('0x19d')]=function(_0x2b0cdf){logger['info'](util[_0xed61('0x21')](_0xed61('0x19e'),_0x2b0cdf['label']));return this['channel']['noop'](_0xed61('0x19f'));};AGIVertices['prototype'][_0xed61('0x1a0')]=function(_0x457859){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x1a1'),_0x457859['label']));if(!this[_0xed61('0x85')](_0x457859[_0xed61('0x1a2')])){return this['channel'][_0xed61('0xab')](_0xed61('0x1a3'));}var _0x584ccc=this[_0xed61('0x2c')][_0xed61('0x6f')](this,_0x457859[_0xed61('0x1a2')]);if(!_0x584ccc){return this[_0xed61('0xd')]['error'](_0x457859,_0xed61('0x1a4'));}var _0x1fcbce={'body':_0x457859[_0xed61('0x1a5')],'phone':_0x457859['to']||'','SmsAccountId':_0x584ccc['id']};logger[_0xed61('0x19b')](_0xed61('0x1a6'),JSON[_0xed61('0x71')](_0x1fcbce));this['createSquareDetailsReport']['sync'](this,_0x457859,_0x457859[_0xed61('0x1a2')]);this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x1a7'),_0x584ccc[_0xed61('0xf')]));this[_0xed61('0x2e')][_0xed61('0x6f')](this,_0x1fcbce);return this[_0xed61('0xd')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xed61('0x1a8')]=function(_0x5d8e24){logger[_0xed61('0x26')](util['format'](_0xed61('0x1a9'),_0x5d8e24[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x5d8e24[_0xed61('0xd8')])){return this['channel']['error'](_0x5d8e24,_0xed61('0x1aa'));}var _0xf128bb=this[_0xed61('0xa3')][_0xed61('0x6f')](this,_0x5d8e24[_0xed61('0xd8')]);if(!_0xf128bb){return this[_0xed61('0xd')][_0xed61('0x25')](_0x5d8e24,_0xed61('0xda'));}return this[_0xed61('0xd')]['setVariable'](_0xf128bb,_0x5d8e24[_0xed61('0x1ab')]);};AGIVertices['prototype'][_0xed61('0x1ac')]=function(_0x7526d1){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x1ad'),_0x7526d1[_0xed61('0x31')]));this['channel'][_0xed61('0xab')](_0xed61('0x1ae'));if(_0x7526d1[_0xed61('0xbc')]===_0xed61('0x1af')){this['channel'][_0xed61('0xab')](_0xed61('0x1b0'));return this[_0xed61('0xd')][_0xed61('0xbc')]();}return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0x1b1'));};AGIVertices['prototype'][_0xed61('0x1b2')]=function(_0x49a11d){logger['info'](util['format'](_0xed61('0x1b3'),_0x49a11d[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x49a11d[_0xed61('0x1b4')])){return this[_0xed61('0xd')]['error'](_0x49a11d,'no\x20subproject\x20selected');}var _0x4598cd=this[_0xed61('0x13')][_0xed61('0x6f')](this,_0x49a11d[_0xed61('0x1b4')]);if(!this['isConfigured'](_0x4598cd)){return this['channel']['error'](_0x49a11d,util['format']('no\x20subproject\x20found\x20with\x20id\x20%d',_0x49a11d[_0xed61('0x1b4')]));}if(_0x4598cd===this['channel']['arg_1']){return this[_0xed61('0xd')]['error'](_0x49a11d,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xed61('0x2f')][_0xed61('0x6f')](this,_0x49a11d,_0x4598cd);var _0x1a2178=this[_0xed61('0xd')]['exec'](_0xed61('0x1b5'),util[_0xed61('0x21')](_0xed61('0x1b6'),config[_0xed61('0x8')][_0xed61('0x1b7')]||_0xed61('0x1b8'),_0x4598cd,this[_0xed61('0xd')][_0xed61('0x33')]));if(_0x1a2178[_0xed61('0xa6')]===-0x1){return _0x1a2178;}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('Executed\x20command\x20%s\x20%s','AGI',_0x4598cd));};AGIVertices[_0xed61('0x11')][_0xed61('0x1b9')]=function(_0x946a1c){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x946a1c[_0xed61('0x31')]));var _0x1068c6=this[_0xed61('0x53')][_0xed61('0x6f')](this,_0x946a1c[_0xed61('0xba')]);this[_0xed61('0x2f')]['sync'](this,_0x946a1c,_0x946a1c[_0xed61('0xba')]);if(this[_0xed61('0x85')](_0x946a1c[_0xed61('0xd8')])){var _0x4e005a=this[_0xed61('0xa3')][_0xed61('0x6f')](this,_0x946a1c['variable_id']);if(_0x4e005a){this[_0xed61('0xd')][_0xed61('0xa1')](_0x4e005a,_0x1068c6);return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x1ba'),_0x946a1c[_0xed61('0xba')],_0x4e005a));}}return this['channel']['noop'](util[_0xed61('0x21')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x946a1c[_0xed61('0xba')]));};AGIVertices[_0xed61('0x11')][_0xed61('0x1bb')]=function(_0x559db5){logger[_0xed61('0x26')](util['format'](_0xed61('0x1bc'),_0x559db5['label']));_0x559db5[_0xed61('0x59')]=_0x559db5[_0xed61('0x59')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xed61('0x85')](_0x559db5['apiKey'])){return this[_0xed61('0xd')][_0xed61('0xab')]('no\x20apiKey\x20configured');}if(!this[_0xed61('0x85')](_0x559db5['text'])){return this[_0xed61('0xd')]['noop']('no\x20text\x20configured');}this['channel'][_0xed61('0xab')](util[_0xed61('0x21')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x559db5[_0xed61('0x59')]));var _0x3b6e0d=this[_0xed61('0x56')]['sync'](this,_0x559db5);if(_0x3b6e0d){this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x1bd'),_0x3b6e0d));var _0x2ad8fe=this[_0xed61('0xd')][_0xed61('0x10a')](_0x3b6e0d);try{fs[_0xed61('0x15a')](_0x3b6e0d+_0xed61('0x10b'));}catch(_0x12dd82){logger[_0xed61('0x25')](_0x12dd82);}return _0x2ad8fe;}return this[_0xed61('0xd')][_0xed61('0x25')](_0x559db5,_0xed61('0x1be'));};AGIVertices[_0xed61('0x11')][_0xed61('0x1bf')]=function(_0x462268){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x1c0'),_0x462268[_0xed61('0x31')]));_0x462268[_0xed61('0x59')]=_0x462268[_0xed61('0x59')][_0xed61('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xed61('0x85')](_0x462268[_0xed61('0x59')])){return this[_0xed61('0xd')][_0xed61('0xab')](_0xed61('0xaa'));}this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x1c1'),_0x462268[_0xed61('0x59')]));var _0x215a46=this[_0xed61('0x5d')][_0xed61('0x6f')](this,_0x462268);if(_0x215a46){this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0x1c2'),_0x215a46));var _0x1a8063=this[_0xed61('0xd')][_0xed61('0x10a')](_0x215a46);try{fs[_0xed61('0x15a')](_0x215a46+_0xed61('0x10b'));}catch(_0x8785d3){logger[_0xed61('0x25')](_0x8785d3);}return _0x1a8063;}return this[_0xed61('0xd')]['error'](_0x462268,_0xed61('0x1c3'));};AGIVertices['prototype']['unpause']=function(_0x6535cb){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x1c4'),_0x6535cb[_0xed61('0x31')]));if(!this[_0xed61('0x85')](_0x6535cb[_0xed61('0x15e')])){return this[_0xed61('0xd')][_0xed61('0x25')](_0x6535cb,_0xed61('0x166'));}logger[_0xed61('0x26')](util[_0xed61('0x21')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xed61('0xd')][_0xed61('0x34')],_0x6535cb[_0xed61('0x15e')]));var _0x4bf161=this[_0xed61('0x4d')][_0xed61('0x6f')](this,_0x6535cb[_0xed61('0x15e')]);if(_0x4bf161){logger[_0xed61('0x26')](util['format'](_0xed61('0x160'),this[_0xed61('0xd')][_0xed61('0x34')],_0x6535cb[_0xed61('0x15e')]));this[_0xed61('0xd')][_0xed61('0xab')](util['format'](_0xed61('0x160'),this[_0xed61('0xd')]['callerid'],_0x6535cb['findBy']));return{'code':0xc8,'result':_0xed61('0x161')};}else{logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x162'),this[_0xed61('0xd')][_0xed61('0x34')],_0x6535cb[_0xed61('0x15e')]));this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xed61('0xd')][_0xed61('0x34')],_0x6535cb['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xed61('0x11')][_0xed61('0x1c5')]=function(_0x4bdf68){logger[_0xed61('0x26')](util[_0xed61('0x21')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4bdf68[_0xed61('0x31')]));var _0x49184b=this[_0xed61('0xd')][_0xed61('0x54')]('VOICEMAIL',[_0x4bdf68[_0xed61('0x1c6')],_0x4bdf68['options']]);if(_0x49184b['result']===-0x1){return _0x49184b;}return this[_0xed61('0xd')][_0xed61('0xab')](util[_0xed61('0x21')](_0xed61('0xc8'),_0xed61('0x1c7'),_0x4bdf68[_0xed61('0x1c6')]));};AGIVertices[_0xed61('0x11')][_0xed61('0x1c8')]=function(_0x1892f7){logger[_0xed61('0x26')](util[_0xed61('0x21')](_0xed61('0x1c9'),_0x1892f7['label']));if(!this[_0xed61('0x85')](_0x1892f7[_0xed61('0xd8')])){return this['channel'][_0xed61('0x25')](_0x1892f7,'no\x20variable\x20selected');}var _0x2d46d8=this[_0xed61('0xa3')]['sync'](this,_0x1892f7[_0xed61('0xd8')]);if(!_0x2d46d8){return this['channel']['error'](_0x1892f7,'no\x20variable\x20found');}var _0xc44948=this[_0xed61('0xd')][_0xed61('0xa3')](_0x2d46d8);return{'code':0xc8,'result':_0xc44948['extra']?_0xc44948[_0xed61('0xa4')]:'-'};};String[_0xed61('0x11')][_0xed61('0xa2')]=function(_0x5d9917,_0x2191ce){return this[_0xed61('0x1ca')](_0x5d9917)[_0xed61('0x1cb')](_0x2191ce);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 585f554..ee77f32 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 _0x93f5=['queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','[ACW][START]\x20%s','message','uniqueid','[%s][TIMER][STOP][AGENT:%s]','[ACW][TIMERS]','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','linkedid','isUndefined','attended','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','stringify','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','interface'];(function(_0x2e1cbe,_0x19aee7){var _0x2f77bc=function(_0x2478e7){while(--_0x2478e7){_0x2e1cbe['push'](_0x2e1cbe['shift']());}};_0x2f77bc(++_0x19aee7);}(_0x93f5,0x180));var _0x593f=function(_0x2fa5fa,_0x4f7d6e){_0x2fa5fa=_0x2fa5fa-0x0;var _0x31b95c=_0x93f5[_0x2fa5fa];return _0x31b95c;};'use strict';var util=require(_0x593f('0x0'));var _=require(_0x593f('0x1'));var moment=require('moment');var ami=require(_0x593f('0x2'));var logger=require(_0x593f('0x3'))(_0x593f('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x593f('0x5'));function Acw(_0xd70635){this[_0x593f('0x6')]=_0xd70635[_0x593f('0x6')];this[_0x593f('0x7')]=_0xd70635[_0x593f('0x7')];this[_0x593f('0x8')]=_0xd70635[_0x593f('0x8')];this[_0x593f('0x9')]={};ami['on'](_0x593f('0xa'),this[_0x593f('0xb')][_0x593f('0xc')](this));ami['on'](_0x593f('0xd'),this[_0x593f('0xe')]['bind'](this));ami['on']('hangup',this[_0x593f('0xf')][_0x593f('0xc')](this));ami['on'](_0x593f('0x10'),this['syncAgentRingNoAnswer'][_0x593f('0xc')](this));ami['on'](_0x593f('0x11'),this['syncAttendedTransfer'][_0x593f('0xc')](this));ami['on'](_0x593f('0x12'),this[_0x593f('0x13')][_0x593f('0xc')](this));ami['on']('custom:agentConnectPreview',this[_0x593f('0x14')][_0x593f('0xc')](this));}function getDiff(_0x28f14d){var _0x5600bc=moment()[_0x593f('0x15')](0x0);var _0x353a8d=moment(_0x28f14d)[_0x593f('0x15')](0x0);return _0x5600bc[_0x593f('0x16')](_0x353a8d,'seconds');}Acw[_0x593f('0x17')][_0x593f('0x18')]=function(_0x2a2a0b){try{var _0x39a3b7=this;var _0x1ab659=this[_0x593f('0x9')][_0x2a2a0b][_0x593f('0x19')];var _0x331615=this[_0x593f('0x9')][_0x2a2a0b][_0x593f('0x1a')];var _0x40bfe0=this['voiceQueues'][_0x331615];var _0x5e00b6=![];var _0x277fc9=_0x593f('0x1b');if(_0x40bfe0[_0x593f('0x1c')]){if(_0x40bfe0[_0x593f('0x1d')][_0x593f('0x1e')]){_0x5e00b6=!![];_0x277fc9=_0x40bfe0['mandatoryDispositionPause']['name'];}}ami[_0x593f('0x1f')]({'action':_0x593f('0x20'),'interface':_0x1ab659,'paused':!![],'reason':_0x277fc9})[_0x593f('0x21')](function(_0x346fcd){if(_0x39a3b7['agents'][_0x1ab659]){return RpcUser['getAgent'](_0x39a3b7['agents'][_0x1ab659]['id'])[_0x593f('0x21')](function(_0x447998){if(_0x447998&&!_0x447998[_0x593f('0x22')]){logger[_0x593f('0x23')](_0x593f('0x24'),_0x2a2a0b,_0x1ab659,_0x331615);var _0x3dc45f=_0x39a3b7['channels'][_0x2a2a0b]['attended']&&_0x39a3b7[_0x593f('0x9')][_0x2a2a0b][_0x593f('0x25')]?_0x39a3b7[_0x593f('0x9')][_0x2a2a0b]['destlinkedid']:_0x2a2a0b;return RpcUser['savePause'](_0x39a3b7[_0x593f('0x7')][_0x1ab659],_0x277fc9,_0x3dc45f)[_0x593f('0x21')](function(_0x1b09ab){if(!_0x5e00b6){_0x39a3b7[_0x593f('0x8')][_0x1ab659]={};logger[_0x593f('0x23')](_0x593f('0x26'),_0x2a2a0b,_0x39a3b7[_0x593f('0x6')][_0x331615][_0x593f('0x27')],_0x1ab659,_0x331615);_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x28')]=setTimeout(_0x39a3b7[_0x593f('0x29')]['bind'](_0x39a3b7,_0x1ab659),_0x39a3b7[_0x593f('0x6')][_0x331615][_0x593f('0x27')]*0x3e8);_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x2a')]=moment()[_0x593f('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');_0x39a3b7['timers'][_0x1ab659]['uniqueid']=_0x2a2a0b;_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x1a')]=_0x331615;_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x2c')]=function(){var _0x1f39d2=getDiff(_0x39a3b7['timers'][_0x1ab659][_0x593f('0x2a')]);clearTimeout(_0x39a3b7['timers'][_0x1ab659]['timer']);_0x39a3b7[_0x593f('0x8')][_0x1ab659][_0x593f('0x28')]=![];RpcVoiceAgentReport[_0x593f('0x2d')]({'acwtime':_0x1f39d2},_0x39a3b7[_0x593f('0x8')][_0x1ab659]['uniqueid'],_0x1ab659)['then'](function(_0x200c89){logger[_0x593f('0x23')](_0x593f('0x2e'),_0x2a2a0b,_0x1f39d2,_0x200c89);})[_0x593f('0x2f')](function(_0x177def){logger[_0x593f('0x30')](_0x593f('0x31'),_0x2a2a0b,_0x177def);});delete _0x39a3b7[_0x593f('0x8')][_0x1ab659];};}});}else{logger[_0x593f('0x23')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x2a2a0b,_0x1ab659,_0x331615);}});}})[_0x593f('0x2f')](function(_0x30eac5){logger[_0x593f('0x30')](_0x593f('0x26'),_0x2a2a0b,_0x39a3b7[_0x593f('0x6')][_0x331615][_0x593f('0x27')],_0x1ab659,_0x331615);})[_0x593f('0x32')](function(){delete _0x39a3b7[_0x593f('0x9')][_0x2a2a0b];});}catch(_0x352ae6){logger['error'](_0x593f('0x33'),_0x352ae6[_0x593f('0x34')]);}};Acw['prototype']['stopAcw']=function(_0x397062){try{var _0x2f0b0b=this;if(_0x2f0b0b['timers'][_0x397062]){_0x2f0b0b[_0x593f('0x8')][_0x397062][_0x593f('0x28')]=![];var _0x1cfc75=_0x2f0b0b['timers'][_0x397062][_0x593f('0x35')];var _0x150f97=_0x2f0b0b[_0x593f('0x8')][_0x397062][_0x593f('0x1a')];var _0x402741=_0x2f0b0b['voiceQueues'][_0x150f97][_0x593f('0x27')];logger[_0x593f('0x23')](_0x593f('0x36'),_0x1cfc75,_0x397062);RpcUser['saveUnpause'](this[_0x593f('0x7')][_0x397062]);RpcVoiceAgentReport['update']({'acwtime':_0x402741,'agentacw':!![]},_0x1cfc75,_0x397062)[_0x593f('0x21')](function(_0x31edfc){logger[_0x593f('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x1cfc75,_0x402741,_0x31edfc);})[_0x593f('0x2f')](function(_0x5390eb){logger[_0x593f('0x30')](_0x593f('0x31'),_0x1cfc75,_0x5390eb);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x397062);if(_0x2f0b0b['timers']){logger[_0x593f('0x23')](_0x593f('0x37'),JSON['stringify'](_0x2f0b0b[_0x593f('0x8')]));}}}catch(_0x22ff47){logger[_0x593f('0x30')](_0x593f('0x38'),_0x22ff47[_0x593f('0x34')]);}};Acw[_0x593f('0x17')][_0x593f('0xb')]=function(_0x5428cf){try{if(this['voiceQueues'][_0x5428cf[_0x593f('0x1a')]]&&(this['voiceQueues'][_0x5428cf[_0x593f('0x1a')]]['acw']||this[_0x593f('0x6')][_0x5428cf[_0x593f('0x1a')]][_0x593f('0x1c')])){if(this[_0x593f('0x7')][_0x5428cf[_0x593f('0x19')]]){this['channels'][_0x5428cf[_0x593f('0x35')]]={'queue':_0x5428cf[_0x593f('0x1a')],'interface':_0x5428cf['interface'],'destlinkedid':_0x5428cf[_0x593f('0x25')]};}}}catch(_0x134cc3){logger[_0x593f('0x30')](_0x593f('0x39'),_0x134cc3[_0x593f('0x34')]);}};Acw[_0x593f('0x17')]['syncAgentConnectPreview']=function(_0x5ce4b6){try{if(this['voiceQueues'][_0x5ce4b6[_0x593f('0x1a')]]&&(this[_0x593f('0x6')][_0x5ce4b6[_0x593f('0x1a')]][_0x593f('0x4')]||this[_0x593f('0x6')][_0x5ce4b6[_0x593f('0x1a')]][_0x593f('0x1c')])){if(this['agents'][_0x5ce4b6[_0x593f('0x19')]]){this[_0x593f('0x9')][_0x5ce4b6[_0x593f('0x35')]]={'queue':_0x5ce4b6[_0x593f('0x1a')],'interface':_0x5ce4b6['interface']};}}}catch(_0x2cf030){logger[_0x593f('0x30')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2cf030[_0x593f('0x34')]);}};Acw['prototype'][_0x593f('0xe')]=function(_0x360447){try{if(this['channels'][_0x360447[_0x593f('0x35')]]&&_['isUndefined'](this[_0x593f('0x9')][_0x360447[_0x593f('0x35')]]['attended'])){logger[_0x593f('0x23')]('[%s][HANGUP:UNIQUEID]',_0x360447['uniqueid']);this[_0x593f('0x18')](_0x360447[_0x593f('0x35')]);}else if(this[_0x593f('0x9')][_0x360447[_0x593f('0x3a')]]&&_[_0x593f('0x3b')](this[_0x593f('0x9')][_0x360447[_0x593f('0x3a')]][_0x593f('0x3c')])){logger[_0x593f('0x23')]('[%s][HANGUP:LINKEDID]',_0x360447[_0x593f('0x3a')]);this[_0x593f('0x18')](_0x360447[_0x593f('0x3a')]);}}catch(_0x4eae79){logger[_0x593f('0x30')](_0x593f('0x3d'),_0x4eae79[_0x593f('0x34')]);}};Acw[_0x593f('0x17')][_0x593f('0xf')]=function(_0xeb4e5e){try{if(this[_0x593f('0x9')][_0xeb4e5e[_0x593f('0x35')]]&&this['channels'][_0xeb4e5e[_0x593f('0x35')]][_0x593f('0x3c')]){logger[_0x593f('0x23')](_0x593f('0x3e'),_0xeb4e5e[_0x593f('0x35')]);this[_0x593f('0x18')](_0xeb4e5e[_0x593f('0x35')]);}else if(this[_0x593f('0x9')][_0xeb4e5e[_0x593f('0x3a')]]&&this[_0x593f('0x9')][_0xeb4e5e[_0x593f('0x3a')]][_0x593f('0x3c')]){logger[_0x593f('0x23')](_0x593f('0x3f'),_0xeb4e5e[_0x593f('0x3a')]);this[_0x593f('0x18')](_0xeb4e5e[_0x593f('0x3a')]);}}catch(_0x217aec){logger[_0x593f('0x30')](_0x593f('0x40'),_0x217aec['message']);}};Acw['prototype'][_0x593f('0x41')]=function(_0x5450bd){try{if(!_[_0x593f('0x42')](this['channels'][_0x5450bd['transfereeuniqueid']])){this[_0x593f('0x18')](_0x5450bd['transfereeuniqueid']);if(this[_0x593f('0x9')][_0x5450bd['secondtransfereruniqueid']]){this['channels'][_0x5450bd[_0x593f('0x43')]][_0x593f('0x3c')]=!![];this[_0x593f('0x9')][_0x5450bd[_0x593f('0x44')]]=this[_0x593f('0x9')][_0x5450bd[_0x593f('0x43')]];delete this[_0x593f('0x9')][_0x5450bd[_0x593f('0x43')]];}}else if(!_['isNil'](this[_0x593f('0x9')][_0x5450bd[_0x593f('0x44')]])){this[_0x593f('0x18')](_0x5450bd[_0x593f('0x44')]);if(this[_0x593f('0x9')][_0x5450bd[_0x593f('0x45')]]){this[_0x593f('0x9')][_0x5450bd[_0x593f('0x45')]][_0x593f('0x3c')]=!![];this[_0x593f('0x9')][_0x5450bd['transfereeuniqueid']]=this['channels'][_0x5450bd[_0x593f('0x45')]];delete this['channels'][_0x5450bd['origtransfereruniqueid']];}}}catch(_0x21652f){logger[_0x593f('0x30')](_0x593f('0x46'),_0x21652f['message']);}};Acw[_0x593f('0x17')][_0x593f('0x13')]=function(_0x243609){try{if(this['channels'][_0x243609[_0x593f('0x47')]]){logger['info'](_0x593f('0x48'),JSON['stringify'](_0x243609['transfereruniqueid']));this[_0x593f('0x18')](_0x243609['transfereruniqueid']);}else if(this[_0x593f('0x9')][_0x243609[_0x593f('0x49')]]){logger[_0x593f('0x23')](_0x593f('0x4a'),JSON[_0x593f('0x4b')](_0x243609[_0x593f('0x49')]));this[_0x593f('0x18')](_0x243609[_0x593f('0x49')]);}}catch(_0x4639ce){logger[_0x593f('0x30')](_0x593f('0x4c'),_0x4639ce[_0x593f('0x34')]);}};Acw[_0x593f('0x17')]['syncAgentRingNoAnswer']=function(_0x4cd8bc){try{if(this[_0x593f('0x6')][_0x4cd8bc[_0x593f('0x1a')]]&&this[_0x593f('0x6')][_0x4cd8bc[_0x593f('0x1a')]][_0x593f('0x4d')]===_0x593f('0x4e')){if(this[_0x593f('0x7')][_0x4cd8bc[_0x593f('0x19')]]){logger[_0x593f('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x4cd8bc[_0x593f('0x35')],_0x4cd8bc[_0x593f('0x19')],_0x4cd8bc[_0x593f('0x1a')]);return RpcUser[_0x593f('0x4f')](this['agents'][_0x4cd8bc[_0x593f('0x19')]],'Auto-Pause',_0x4cd8bc[_0x593f('0x35')]);}}}catch(_0x52f5ea){logger[_0x593f('0x30')](_0x593f('0x50'),_0x52f5ea[_0x593f('0x34')]);}};module[_0x593f('0x51')]=Acw; \ No newline at end of file +var _0xd477=['[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','agents','timers','channels','agentconnect','bind','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','voiceQueues','ACW','mandatoryDispositionPause','Action','QueuePause','then','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','timer','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause'];(function(_0x11a741,_0x2b1699){var _0x4e43e3=function(_0x3bdb9d){while(--_0x3bdb9d){_0x11a741['push'](_0x11a741['shift']());}};_0x4e43e3(++_0x2b1699);}(_0xd477,0x1bf));var _0x7d47=function(_0x3ca52c,_0x8420f){_0x3ca52c=_0x3ca52c-0x0;var _0x2fb640=_0xd477[_0x3ca52c];return _0x2fb640;};'use strict';var util=require('util');var _=require(_0x7d47('0x0'));var moment=require(_0x7d47('0x1'));var ami=require(_0x7d47('0x2'));var logger=require(_0x7d47('0x3'))(_0x7d47('0x4'));var RpcUser=require(_0x7d47('0x5'));var RpcVoiceAgentReport=require(_0x7d47('0x6'));function Acw(_0x573d50){this['voiceQueues']=_0x573d50['voiceQueues'];this[_0x7d47('0x7')]=_0x573d50[_0x7d47('0x7')];this[_0x7d47('0x8')]=_0x573d50[_0x7d47('0x8')];this[_0x7d47('0x9')]={};ami['on'](_0x7d47('0xa'),this['syncAgentConnect'][_0x7d47('0xb')](this));ami['on']('hanguprequest',this[_0x7d47('0xc')][_0x7d47('0xb')](this));ami['on']('hangup',this[_0x7d47('0xd')][_0x7d47('0xb')](this));ami['on'](_0x7d47('0xe'),this[_0x7d47('0xf')][_0x7d47('0xb')](this));ami['on'](_0x7d47('0x10'),this[_0x7d47('0x11')][_0x7d47('0xb')](this));ami['on'](_0x7d47('0x12'),this[_0x7d47('0x13')][_0x7d47('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0x7d47('0x14')][_0x7d47('0xb')](this));}function getDiff(_0x167cd5){var _0x402a04=moment()['milliseconds'](0x0);var _0x4c6798=moment(_0x167cd5)[_0x7d47('0x15')](0x0);return _0x402a04[_0x7d47('0x16')](_0x4c6798,_0x7d47('0x17'));}Acw[_0x7d47('0x18')][_0x7d47('0x19')]=function(_0x413651){try{var _0x284231=this;var _0x5caca8=this[_0x7d47('0x9')][_0x413651]['interface'];var _0x5193d2=this[_0x7d47('0x9')][_0x413651][_0x7d47('0x1a')];var _0x2e10e9=this[_0x7d47('0x1b')][_0x5193d2];var _0x588e24=![];var _0x3ed1e5=_0x7d47('0x1c');if(_0x2e10e9['mandatoryDisposition']){if(_0x2e10e9[_0x7d47('0x1d')]['name']){_0x588e24=!![];_0x3ed1e5=_0x2e10e9[_0x7d47('0x1d')]['name'];}}ami[_0x7d47('0x1e')]({'action':_0x7d47('0x1f'),'interface':_0x5caca8,'paused':!![],'reason':_0x3ed1e5})[_0x7d47('0x20')](function(_0x3d237d){if(_0x284231[_0x7d47('0x7')][_0x5caca8]){return RpcUser[_0x7d47('0x21')](_0x284231[_0x7d47('0x7')][_0x5caca8]['id'])['then'](function(_0x12e2fa){if(_0x12e2fa&&!_0x12e2fa['voicePause']){logger[_0x7d47('0x22')](_0x7d47('0x23'),_0x413651,_0x5caca8,_0x5193d2);var _0x16d2fb=_0x284231[_0x7d47('0x9')][_0x413651][_0x7d47('0x24')]&&_0x284231['channels'][_0x413651][_0x7d47('0x25')]?_0x284231['channels'][_0x413651][_0x7d47('0x25')]:_0x413651;return RpcUser['savePause'](_0x284231[_0x7d47('0x7')][_0x5caca8],_0x3ed1e5,_0x16d2fb)[_0x7d47('0x20')](function(_0x569489){if(!_0x588e24){_0x284231[_0x7d47('0x8')][_0x5caca8]={};logger[_0x7d47('0x22')](_0x7d47('0x26'),_0x413651,_0x284231[_0x7d47('0x1b')][_0x5193d2]['acwTimeout'],_0x5caca8,_0x5193d2);_0x284231[_0x7d47('0x8')][_0x5caca8]['timer']=setTimeout(_0x284231[_0x7d47('0x27')][_0x7d47('0xb')](_0x284231,_0x5caca8),_0x284231[_0x7d47('0x1b')][_0x5193d2][_0x7d47('0x28')]*0x3e8);_0x284231[_0x7d47('0x8')][_0x5caca8][_0x7d47('0x29')]=moment()[_0x7d47('0x2a')](_0x7d47('0x2b'));_0x284231[_0x7d47('0x8')][_0x5caca8][_0x7d47('0x2c')]=_0x413651;_0x284231[_0x7d47('0x8')][_0x5caca8]['queue']=_0x5193d2;_0x284231[_0x7d47('0x8')][_0x5caca8][_0x7d47('0x2d')]=function(){var _0x2f8498=getDiff(_0x284231[_0x7d47('0x8')][_0x5caca8][_0x7d47('0x29')]);clearTimeout(_0x284231[_0x7d47('0x8')][_0x5caca8]['timer']);_0x284231[_0x7d47('0x8')][_0x5caca8]['timer']=![];RpcVoiceAgentReport[_0x7d47('0x2e')]({'acwtime':_0x2f8498},_0x284231[_0x7d47('0x8')][_0x5caca8][_0x7d47('0x2c')],_0x5caca8)[_0x7d47('0x20')](function(_0x4c056d){logger['info'](_0x7d47('0x2f'),_0x413651,_0x2f8498,_0x4c056d);})[_0x7d47('0x30')](function(_0x568cc8){logger[_0x7d47('0x31')](_0x7d47('0x32'),_0x413651,_0x568cc8);});delete _0x284231[_0x7d47('0x8')][_0x5caca8];};}});}else{logger['info'](_0x7d47('0x33'),_0x413651,_0x5caca8,_0x5193d2);}});}})['catch'](function(_0x1ee395){logger[_0x7d47('0x31')](_0x7d47('0x26'),_0x413651,_0x284231[_0x7d47('0x1b')][_0x5193d2][_0x7d47('0x28')],_0x5caca8,_0x5193d2);})[_0x7d47('0x34')](function(){delete _0x284231[_0x7d47('0x9')][_0x413651];});}catch(_0x43166f){logger['error'](_0x7d47('0x35'),_0x43166f['message']);}};Acw[_0x7d47('0x18')][_0x7d47('0x27')]=function(_0x36a77d){try{var _0xdc26bc=this;if(_0xdc26bc[_0x7d47('0x8')][_0x36a77d]){_0xdc26bc[_0x7d47('0x8')][_0x36a77d][_0x7d47('0x36')]=![];var _0xabc4f5=_0xdc26bc[_0x7d47('0x8')][_0x36a77d]['uniqueid'];var _0x153214=_0xdc26bc[_0x7d47('0x8')][_0x36a77d][_0x7d47('0x1a')];var _0x493248=_0xdc26bc[_0x7d47('0x1b')][_0x153214][_0x7d47('0x28')];logger[_0x7d47('0x22')](_0x7d47('0x37'),_0xabc4f5,_0x36a77d);RpcUser['saveUnpause'](this[_0x7d47('0x7')][_0x36a77d]);RpcVoiceAgentReport[_0x7d47('0x2e')]({'acwtime':_0x493248,'agentacw':!![]},_0xabc4f5,_0x36a77d)[_0x7d47('0x20')](function(_0x2388b2){logger['info'](_0x7d47('0x2f'),_0xabc4f5,_0x493248,_0x2388b2);})[_0x7d47('0x30')](function(_0x19aa20){logger['error'](_0x7d47('0x32'),_0xabc4f5,_0x19aa20);});}else{logger[_0x7d47('0x31')](_0x7d47('0x38'),_0x36a77d);if(_0xdc26bc[_0x7d47('0x8')]){logger[_0x7d47('0x22')](_0x7d47('0x39'),JSON[_0x7d47('0x3a')](_0xdc26bc[_0x7d47('0x8')]));}}}catch(_0x441dc9){logger['error'](_0x7d47('0x3b'),_0x441dc9[_0x7d47('0x3c')]);}};Acw[_0x7d47('0x18')][_0x7d47('0x3d')]=function(_0x251ebc){try{if(this[_0x7d47('0x1b')][_0x251ebc[_0x7d47('0x1a')]]&&(this[_0x7d47('0x1b')][_0x251ebc[_0x7d47('0x1a')]]['acw']||this['voiceQueues'][_0x251ebc[_0x7d47('0x1a')]][_0x7d47('0x3e')])){if(this[_0x7d47('0x7')][_0x251ebc[_0x7d47('0x3f')]]){this['channels'][_0x251ebc[_0x7d47('0x2c')]]={'queue':_0x251ebc[_0x7d47('0x1a')],'interface':_0x251ebc[_0x7d47('0x3f')],'destlinkedid':_0x251ebc['destlinkedid']};}}}catch(_0xa8d99c){logger[_0x7d47('0x31')](_0x7d47('0x40'),_0xa8d99c['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x4f899b){try{if(this['voiceQueues'][_0x4f899b[_0x7d47('0x1a')]]&&(this[_0x7d47('0x1b')][_0x4f899b[_0x7d47('0x1a')]][_0x7d47('0x4')]||this[_0x7d47('0x1b')][_0x4f899b[_0x7d47('0x1a')]][_0x7d47('0x3e')])){if(this['agents'][_0x4f899b[_0x7d47('0x3f')]]){this[_0x7d47('0x9')][_0x4f899b[_0x7d47('0x2c')]]={'queue':_0x4f899b[_0x7d47('0x1a')],'interface':_0x4f899b[_0x7d47('0x3f')]};}}}catch(_0x4037e8){logger[_0x7d47('0x31')](_0x7d47('0x41'),_0x4037e8[_0x7d47('0x3c')]);}};Acw['prototype'][_0x7d47('0xc')]=function(_0x5c021d){try{if(this['channels'][_0x5c021d[_0x7d47('0x2c')]]&&_[_0x7d47('0x42')](this[_0x7d47('0x9')][_0x5c021d[_0x7d47('0x2c')]][_0x7d47('0x24')])){logger[_0x7d47('0x22')](_0x7d47('0x43'),_0x5c021d['uniqueid']);this[_0x7d47('0x19')](_0x5c021d[_0x7d47('0x2c')]);}else if(this[_0x7d47('0x9')][_0x5c021d[_0x7d47('0x44')]]&&_[_0x7d47('0x42')](this['channels'][_0x5c021d[_0x7d47('0x44')]]['attended'])){logger[_0x7d47('0x22')]('[%s][HANGUP:LINKEDID]',_0x5c021d[_0x7d47('0x44')]);this[_0x7d47('0x19')](_0x5c021d['linkedid']);}}catch(_0x1e3dc6){logger[_0x7d47('0x31')](_0x7d47('0x45'),_0x1e3dc6['message']);}};Acw['prototype']['syncHangup']=function(_0x5ae6ca){try{if(this['channels'][_0x5ae6ca[_0x7d47('0x2c')]]&&this[_0x7d47('0x9')][_0x5ae6ca[_0x7d47('0x2c')]][_0x7d47('0x24')]){logger[_0x7d47('0x22')](_0x7d47('0x46'),_0x5ae6ca[_0x7d47('0x2c')]);this[_0x7d47('0x19')](_0x5ae6ca[_0x7d47('0x2c')]);}else if(this[_0x7d47('0x9')][_0x5ae6ca['linkedid']]&&this['channels'][_0x5ae6ca[_0x7d47('0x44')]]['attended']){logger[_0x7d47('0x22')](_0x7d47('0x47'),_0x5ae6ca[_0x7d47('0x44')]);this['startAcw'](_0x5ae6ca[_0x7d47('0x44')]);}}catch(_0xb6479){logger[_0x7d47('0x31')](_0x7d47('0x48'),_0xb6479[_0x7d47('0x3c')]);}};Acw[_0x7d47('0x18')][_0x7d47('0x11')]=function(_0x165a20){try{if(!_[_0x7d47('0x49')](this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4a')]])){this[_0x7d47('0x19')](_0x165a20[_0x7d47('0x4a')]);if(this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4b')]]){this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4b')]][_0x7d47('0x24')]=!![];this['channels'][_0x165a20[_0x7d47('0x4c')]]=this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4b')]];delete this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4b')]];}}else if(!_[_0x7d47('0x49')](this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4c')]])){this[_0x7d47('0x19')](_0x165a20[_0x7d47('0x4c')]);if(this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4d')]]){this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4d')]][_0x7d47('0x24')]=!![];this[_0x7d47('0x9')][_0x165a20[_0x7d47('0x4a')]]=this['channels'][_0x165a20[_0x7d47('0x4d')]];delete this[_0x7d47('0x9')][_0x165a20['origtransfereruniqueid']];}}}catch(_0x5e63aa){logger[_0x7d47('0x31')](_0x7d47('0x4e'),_0x5e63aa[_0x7d47('0x3c')]);}};Acw[_0x7d47('0x18')][_0x7d47('0x13')]=function(_0x2925ed){try{if(this[_0x7d47('0x9')][_0x2925ed[_0x7d47('0x4f')]]){logger[_0x7d47('0x22')](_0x7d47('0x50'),JSON[_0x7d47('0x3a')](_0x2925ed[_0x7d47('0x4f')]));this['startAcw'](_0x2925ed[_0x7d47('0x4f')]);}else if(this['channels'][_0x2925ed[_0x7d47('0x51')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x7d47('0x3a')](_0x2925ed[_0x7d47('0x51')]));this[_0x7d47('0x19')](_0x2925ed[_0x7d47('0x51')]);}}catch(_0xcbc881){logger['error'](_0x7d47('0x52'),_0xcbc881['message']);}};Acw[_0x7d47('0x18')][_0x7d47('0xf')]=function(_0x4d4c24){try{if(this[_0x7d47('0x1b')][_0x4d4c24[_0x7d47('0x1a')]]&&this['voiceQueues'][_0x4d4c24[_0x7d47('0x1a')]]['autopause']===_0x7d47('0x53')){if(this['agents'][_0x4d4c24[_0x7d47('0x3f')]]){logger['info'](_0x7d47('0x54'),_0x4d4c24['uniqueid'],_0x4d4c24[_0x7d47('0x3f')],_0x4d4c24[_0x7d47('0x1a')]);return RpcUser[_0x7d47('0x55')](this[_0x7d47('0x7')][_0x4d4c24['interface']],_0x7d47('0x56'),_0x4d4c24['uniqueid']);}}}catch(_0x4f2607){logger[_0x7d47('0x31')](_0x7d47('0x57'),_0x4f2607[_0x7d47('0x3c')]);}};module[_0x7d47('0x58')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index c89390c..cc89901 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 _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x49b3be,_0x4e68b9){var _0x1081ea=function(_0x2f0e6c){while(--_0x2f0e6c){_0x49b3be['push'](_0x49b3be['shift']());}};_0x1081ea(++_0x4e68b9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami; \ No newline at end of file +var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x583745,_0x2d1897){var _0x4ba020=function(_0x288616){while(--_0x288616){_0x583745['push'](_0x583745['shift']());}};_0x4ba020(++_0x2d1897);}(_0x757a,0xde));var _0xa757=function(_0x2a660c,_0x337885){_0x2a660c=_0x2a660c-0x0;var _0x4180be=_0x757a[_0x2a660c];return _0x4180be;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 3af7f41..0eae16d 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['exports','jayson/promise','../../config/logger','client','Request','debug','rpc','error','memberReport','message','result','catch'];(function(_0x22bee0,_0x412ecb){var _0x2d295b=function(_0x59d4b5){while(--_0x59d4b5){_0x22bee0['push'](_0x22bee0['shift']());}};_0x2d295b(++_0x412ecb);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0xb7e7[_0x4e6ae6];return _0x23c108;};'use strict';var jayson=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var logger=require(_0x7b7e('0x1'))('ami');var client=jayson[_0x7b7e('0x2')]['http']({'port':0x2329});client[_0x7b7e('0x3')]=function(_0x556d68,_0x31d0ed){return new BPromise(function(_0x118577,_0x1d9384){return client['request'](_0x556d68,_0x31d0ed)['then'](function(_0x333fa4){logger[_0x7b7e('0x4')](_0x7b7e('0x5'),'memberReport',_0x556d68,_0x31d0ed,_0x333fa4);if(_0x333fa4[_0x7b7e('0x6')]){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x333fa4[_0x7b7e('0x6')][_0x7b7e('0x8')],_0x31d0ed);return _0x1d9384(_0x333fa4[_0x7b7e('0x6')]['message']);}else{return _0x118577(_0x333fa4[_0x7b7e('0x9')]);}})[_0x7b7e('0xa')](function(_0x10a666){logger[_0x7b7e('0x6')](_0x7b7e('0x5'),_0x7b7e('0x7'),_0x556d68,_0x10a666,_0x31d0ed);return _0x1d9384(_0x10a666);});});};module[_0x7b7e('0xb')]=client; \ No newline at end of file +var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x4d16fc,_0x3dbdbd){var _0x5d07c2=function(_0x1bf6c7){while(--_0x1bf6c7){_0x4d16fc['push'](_0x4d16fc['shift']());}};_0x5d07c2(++_0x3dbdbd);}(_0xaa88,0x137));var _0x8aa8=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0xaa88[_0x316904];return _0xfa9a21;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index df394e5..20880ce 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 _0x611a=['UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','queue','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','ContactId','ListId'];(function(_0x1ff385,_0x2f30bb){var _0x563380=function(_0x1022dc){while(--_0x1022dc){_0x1ff385['push'](_0x1ff385['shift']());}};_0x563380(++_0x2f30bb);}(_0x611a,0x1ed));var _0xa611=function(_0x2738c3,_0x3487f1){_0x2738c3=_0x2738c3-0x0;var _0x4e6018=_0x611a[_0x2738c3];return _0x4e6018;};'use strict';var util=require(_0xa611('0x0'));var _=require('lodash');var moment=require(_0xa611('0x1'));function checkNameSurname(_0x4937d1,_0x24b937,_0x17a083){var _0x580604='';if(!_[_0xa611('0x2')](_0x24b937)&&_0xa611('0x3')===typeof _0x24b937){_0x580604+=_0x24b937;}if(!_[_0xa611('0x2')](_0x17a083)&&_0xa611('0x3')===typeof _0x17a083){_0x580604+='\x20'+_0x17a083;}if(_0x580604!==''){return _0x580604;}return _0x4937d1;}function Action(_0x3e9384,_0x3a5e01,_0x7cbf96){this[_0xa611('0x4')]=_0x3e9384;this[_0xa611('0x5')]=_0x7cbf96||undefined;this[_0xa611('0x6')]=checkNameSurname(_0x3a5e01[_0xa611('0x7')][_0xa611('0x8')],_0x3a5e01[_0xa611('0x7')][_0xa611('0x9')],_0x3a5e01[_0xa611('0x7')]['lastName']);this[_0xa611('0xa')]=_0x3a5e01['phone'];this['queue']=_0x3e9384['name'];this[_0xa611('0xb')]=_0x3a5e01['active']||![];this[_0xa611('0xc')]=_0x3e9384['type'];this[_0xa611('0xd')]=_0x3e9384[_0xa611('0xd')]||0x3;this[_0xa611('0xe')]=_0x3a5e01[_0xa611('0xe')];this['countbusyretry']=_0x3a5e01[_0xa611('0xf')];this[_0xa611('0x10')]=_0x3a5e01[_0xa611('0x10')];this[_0xa611('0x11')]=_0x3a5e01[_0xa611('0x11')];this['countnosuchnumberretry']=_0x3a5e01[_0xa611('0x12')];this['countdropretry']=_0x3a5e01['countdropretry'];this['countabandonedretry']=_0x3a5e01['countabandonedretry'];this[_0xa611('0x13')]=_0x3a5e01[_0xa611('0x13')];this[_0xa611('0x14')]=_0x3a5e01[_0xa611('0x14')];this['ContactId']=_0x3a5e01[_0xa611('0x15')];this['ListId']=_0x3a5e01[_0xa611('0x16')];this['UserId']=_0x3a5e01[_0xa611('0x17')];this[_0xa611('0x18')]=_0x3a5e01[_0xa611('0x18')];this[_0xa611('0x19')]=_0x3a5e01[_0xa611('0x19')];this[_0xa611('0x1a')]=_0x3a5e01['id'];this[_0xa611('0x1b')]=_0x3a5e01[_0xa611('0x7')]['firstName']||'';this[_0xa611('0x1c')]=moment()[_0xa611('0x1d')](_0xa611('0x1e'));this['callback']=_0x3a5e01[_0xa611('0x1f')];this[_0xa611('0x20')]=_0x3a5e01[_0xa611('0x20')];this[_0xa611('0x21')]=_0x3a5e01['callbackat'];this[_0xa611('0x22')]=_0x3a5e01[_0xa611('0x22')];this[_0xa611('0x23')]='';this[_0xa611('0x24')]='';}Action['prototype'][_0xa611('0x25')]=function(){return util['format'](_0xa611('0x26'),this[_0xa611('0x6')],this['voiceQueue'][_0xa611('0x27')]>0x0?this[_0xa611('0xa')][_0xa611('0x28')](this['voiceQueue'][_0xa611('0x27')]):this[_0xa611('0xa')]);};Action[_0xa611('0x29')]['getQueue']=function(){return this[_0xa611('0x2a')];};module['exports']=Action; \ No newline at end of file +var _0xef9e=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','prototype','getQueue','exports','lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry'];(function(_0x1fcdb5,_0x162157){var _0x44a25f=function(_0x23a18b){while(--_0x23a18b){_0x1fcdb5['push'](_0x1fcdb5['shift']());}};_0x44a25f(++_0x162157);}(_0xef9e,0xcb));var _0xeef9=function(_0x37f7f8,_0x401c22){_0x37f7f8=_0x37f7f8-0x0;var _0x24b54f=_0xef9e[_0x37f7f8];return _0x24b54f;};'use strict';var util=require('util');var _=require(_0xeef9('0x0'));var moment=require(_0xeef9('0x1'));function checkNameSurname(_0x3596d7,_0x14ce76,_0xd1297d){var _0x32de04='';if(!_[_0xeef9('0x2')](_0x14ce76)&&_0xeef9('0x3')===typeof _0x14ce76){_0x32de04+=_0x14ce76;}if(!_[_0xeef9('0x2')](_0xd1297d)&&_0xeef9('0x3')===typeof _0xd1297d){_0x32de04+='\x20'+_0xd1297d;}if(_0x32de04!==''){return _0x32de04;}return _0x3596d7;}function Action(_0x5d1cc4,_0x28aa96,_0x3bb0d2){this['voiceQueue']=_0x5d1cc4;this[_0xeef9('0x4')]=_0x3bb0d2||undefined;this[_0xeef9('0x5')]=checkNameSurname(_0x28aa96[_0xeef9('0x6')][_0xeef9('0x7')],_0x28aa96['Contact'][_0xeef9('0x8')],_0x28aa96[_0xeef9('0x6')][_0xeef9('0x9')]);this[_0xeef9('0xa')]=_0x28aa96[_0xeef9('0x7')];this[_0xeef9('0xb')]=_0x5d1cc4[_0xeef9('0x5')];this[_0xeef9('0xc')]=_0x28aa96['active']||![];this[_0xeef9('0xd')]=_0x5d1cc4['type'];this[_0xeef9('0xe')]=_0x5d1cc4[_0xeef9('0xe')]||0x3;this[_0xeef9('0xf')]=_0x28aa96[_0xeef9('0xf')];this[_0xeef9('0x10')]=_0x28aa96[_0xeef9('0x10')];this[_0xeef9('0x11')]=_0x28aa96['countcongestionretry'];this[_0xeef9('0x12')]=_0x28aa96[_0xeef9('0x12')];this[_0xeef9('0x13')]=_0x28aa96[_0xeef9('0x13')];this[_0xeef9('0x14')]=_0x28aa96[_0xeef9('0x14')];this['countabandonedretry']=_0x28aa96['countabandonedretry'];this[_0xeef9('0x15')]=_0x28aa96[_0xeef9('0x15')];this[_0xeef9('0x16')]=_0x28aa96['countagentrejectretry'];this[_0xeef9('0x17')]=_0x28aa96['ContactId'];this['ListId']=_0x28aa96[_0xeef9('0x18')];this[_0xeef9('0x19')]=_0x28aa96[_0xeef9('0x19')];this[_0xeef9('0x1a')]=_0x28aa96[_0xeef9('0x1a')];this[_0xeef9('0x1b')]=_0x28aa96[_0xeef9('0x1b')];this[_0xeef9('0x1c')]=_0x28aa96['id'];this['ContactFirstName']=_0x28aa96['Contact']['firstName']||'';this[_0xeef9('0x1d')]=moment()[_0xeef9('0x1e')](_0xeef9('0x1f'));this['callback']=_0x28aa96['callback'];this[_0xeef9('0x20')]=_0x28aa96[_0xeef9('0x20')];this['callbackat']=_0x28aa96[_0xeef9('0x21')];this[_0xeef9('0x22')]=_0x28aa96[_0xeef9('0x22')];this[_0xeef9('0x23')]='';this[_0xeef9('0x24')]='';}Action['prototype'][_0xeef9('0x25')]=function(){return util[_0xeef9('0x1e')](_0xeef9('0x26'),this[_0xeef9('0x5')],this[_0xeef9('0x27')][_0xeef9('0x28')]>0x0?this[_0xeef9('0xa')][_0xeef9('0x29')](this[_0xeef9('0x27')][_0xeef9('0x28')]):this['number']);};Action[_0xeef9('0x2a')][_0xeef9('0x2b')]=function(){return this[_0xeef9('0xb')];};module[_0xeef9('0x2c')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 9b2a21c..9d6f6ba 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 _0xbba7=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x59bd3b,_0x53eff9){var _0x586c53=function(_0xee0b0b){while(--_0xee0b0b){_0x59bd3b['push'](_0x59bd3b['shift']());}};_0x586c53(++_0x53eff9);}(_0xbba7,0x93));var _0x7bba=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0xbba7[_0x47df54];return _0x261b87;};'use strict';var util=require(_0x7bba('0x0'));var _=require(_0x7bba('0x1'));var moment=require(_0x7bba('0x2'));function getSeconds(_0x220702,_0xbcb710){var _0x334e6f=moment(_0x220702)[_0x7bba('0x3')](0x0);var _0x33407c=moment(_0xbcb710)['milliseconds'](0x0);return _0x334e6f[_0x7bba('0x4')](_0x33407c,_0x7bba('0x5'));}function AgentComplete(_0x39016a,_0x16b08a){this['state']=0x4;this[_0x7bba('0x6')]=_0x7bba('0x7');this[_0x7bba('0x8')]=_0x39016a[_0x7bba('0x8')];this['type']=_0x39016a[_0x7bba('0x9')];this[_0x7bba('0xa')]=_0x39016a[_0x7bba('0x9')]===_0x7bba('0xb')?_0x7bba('0xc'):_0x39016a[_0x7bba('0x9')];this['countbusyretry']=_0x39016a['countbusyretry'];this['countcongestionretry']=_0x39016a[_0x7bba('0xd')];this[_0x7bba('0xe')]=_0x39016a[_0x7bba('0xe')];this['countglobal']=_0x39016a[_0x7bba('0xf')]+_0x39016a[_0x7bba('0xd')]+_0x39016a[_0x7bba('0xe')]+_0x39016a['countnosuchnumberretry']+_0x39016a[_0x7bba('0x10')]+_0x39016a[_0x7bba('0x11')]+_0x39016a[_0x7bba('0x12')]+_0x39016a[_0x7bba('0x13')];this['countnosuchnumberretry']=_0x39016a[_0x7bba('0x14')];this['countdropretry']=_0x39016a[_0x7bba('0x10')];this[_0x7bba('0x11')]=_0x39016a[_0x7bba('0x11')];this[_0x7bba('0x12')]=_0x39016a[_0x7bba('0x12')];this[_0x7bba('0x13')]=_0x39016a[_0x7bba('0x13')];this[_0x7bba('0x15')]=_0x16b08a[_0x7bba('0x15')];this[_0x7bba('0x16')]=_0x39016a[_0x7bba('0x17')];this[_0x7bba('0x18')]=_0x39016a[_0x7bba('0x19')];this[_0x7bba('0x1a')]=_0x39016a[_0x7bba('0x1a')];this[_0x7bba('0x1b')]=_0x39016a[_0x7bba('0x1b')];this[_0x7bba('0x1c')]=_0x39016a[_0x7bba('0x1c')];this[_0x7bba('0x1d')]=moment()[_0x7bba('0x1e')](_0x7bba('0x1f'));this['ringtime']=getSeconds(_0x39016a[_0x7bba('0x1b')],_0x39016a[_0x7bba('0x1a')]);this[_0x7bba('0x20')]=getSeconds(_0x39016a[_0x7bba('0x1c')],_0x39016a[_0x7bba('0x1b')]);this['talktime']=getSeconds(this['endtime'],_0x39016a[_0x7bba('0x1c')]);this[_0x7bba('0xc')]=_0x16b08a[_0x7bba('0xc')];this[_0x7bba('0x21')]=_0x16b08a[_0x7bba('0x21')];this[_0x7bba('0x22')]=_0x16b08a['reason'];this['callback']=_0x39016a[_0x7bba('0x23')];this['callbackuniqueid']=_0x39016a[_0x7bba('0x24')];this[_0x7bba('0x25')]=_0x39016a['callbackat'];this[_0x7bba('0x26')]=_0x39016a[_0x7bba('0x26')];this['ContactId']=_0x39016a[_0x7bba('0x27')];this['ListId']=_0x39016a[_0x7bba('0x28')];this[_0x7bba('0x29')]=_0x39016a[_0x7bba('0x29')];this[_0x7bba('0x2a')]=_0x39016a[_0x7bba('0x2a')];this[_0x7bba('0x2b')]=_0x39016a[_0x7bba('0x2b')];this[_0x7bba('0x2c')]=_0x39016a[_0x7bba('0x2c')]||'';this['originatecalleridname']=_0x39016a[_0x7bba('0x2d')]||'';}module[_0x7bba('0x2e')]=AgentComplete; \ No newline at end of file +var _0x67ff=['originatecalleridname','exports','util','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','starttime','answertime','format','ringtime','responsetime','holdtime','talktime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x498a1d,_0x18dfd7){var _0x2b3699=function(_0x67a234){while(--_0x67a234){_0x498a1d['push'](_0x498a1d['shift']());}};_0x2b3699(++_0x18dfd7);}(_0x67ff,0x104));var _0xf67f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x67ff[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xf67f('0x0'));var _=require('lodash');var moment=require(_0xf67f('0x1'));function getSeconds(_0x153ac9,_0x3f2596){var _0x1b2519=moment(_0x153ac9)['milliseconds'](0x0);var _0x4e592c=moment(_0x3f2596)[_0xf67f('0x2')](0x0);return _0x1b2519['diff'](_0x4e592c,_0xf67f('0x3'));}function AgentComplete(_0x4cb652,_0x4fa36d){this[_0xf67f('0x4')]=0x4;this[_0xf67f('0x5')]='Answer';this[_0xf67f('0x6')]=_0x4cb652[_0xf67f('0x6')];this[_0xf67f('0x7')]=_0x4cb652['type'];this[_0xf67f('0x8')]=_0x4cb652[_0xf67f('0x7')]==='outbound'?'queue':_0x4cb652[_0xf67f('0x7')];this[_0xf67f('0x9')]=_0x4cb652['countbusyretry'];this['countcongestionretry']=_0x4cb652['countcongestionretry'];this[_0xf67f('0xa')]=_0x4cb652[_0xf67f('0xa')];this['countglobal']=_0x4cb652[_0xf67f('0x9')]+_0x4cb652[_0xf67f('0xb')]+_0x4cb652[_0xf67f('0xa')]+_0x4cb652[_0xf67f('0xc')]+_0x4cb652[_0xf67f('0xd')]+_0x4cb652['countabandonedretry']+_0x4cb652[_0xf67f('0xe')]+_0x4cb652['countagentrejectretry'];this[_0xf67f('0xc')]=_0x4cb652['countnosuchnumberretry'];this[_0xf67f('0xd')]=_0x4cb652['countdropretry'];this[_0xf67f('0xf')]=_0x4cb652[_0xf67f('0xf')];this['countmachineretry']=_0x4cb652[_0xf67f('0xe')];this['countagentrejectretry']=_0x4cb652['countagentrejectretry'];this[_0xf67f('0x10')]=_0x4fa36d['uniqueid'];this[_0xf67f('0x11')]=_0x4cb652[_0xf67f('0x12')];this[_0xf67f('0x13')]=_0x4cb652['number'];this['starttime']=_0x4cb652[_0xf67f('0x14')];this['responsetime']=_0x4cb652['responsetime'];this[_0xf67f('0x15')]=_0x4cb652[_0xf67f('0x15')];this['endtime']=moment()[_0xf67f('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf67f('0x17')]=getSeconds(_0x4cb652[_0xf67f('0x18')],_0x4cb652[_0xf67f('0x14')]);this[_0xf67f('0x19')]=getSeconds(_0x4cb652['answertime'],_0x4cb652[_0xf67f('0x18')]);this[_0xf67f('0x1a')]=getSeconds(this[_0xf67f('0x1b')],_0x4cb652['answertime']);this['queue']=_0x4fa36d[_0xf67f('0x1c')];this[_0xf67f('0x1d')]=_0x4fa36d[_0xf67f('0x1d')];this[_0xf67f('0x1e')]=_0x4fa36d[_0xf67f('0x1e')];this[_0xf67f('0x1f')]=_0x4cb652[_0xf67f('0x1f')];this[_0xf67f('0x20')]=_0x4cb652['callbackuniqueid'];this[_0xf67f('0x21')]=_0x4cb652['callbackat'];this[_0xf67f('0x22')]=_0x4cb652[_0xf67f('0x22')];this['ContactId']=_0x4cb652[_0xf67f('0x23')];this[_0xf67f('0x24')]=_0x4cb652[_0xf67f('0x24')];this[_0xf67f('0x25')]=_0x4cb652['UserId'];this[_0xf67f('0x26')]=_0x4cb652[_0xf67f('0x26')];this[_0xf67f('0x27')]=_0x4cb652['CampaignId'];this[_0xf67f('0x28')]=_0x4cb652[_0xf67f('0x28')]||'';this['originatecalleridname']=_0x4cb652[_0xf67f('0x29')]||'';}module[_0xf67f('0x2a')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 25b322d..0a0aa80 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 _0xe0c3=['util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x1c125f,_0x17869a){var _0x43e0b2=function(_0x44da96){while(--_0x44da96){_0x1c125f['push'](_0x1c125f['shift']());}};_0x43e0b2(++_0x17869a);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x3e0c('0x0'));var _=require('lodash');var moment=require(_0x3e0c('0x1'));function getSeconds(_0x172593,_0x3bb243){var _0x41c0bf=moment(_0x172593)[_0x3e0c('0x2')](0x0);var _0x410ec4=moment(_0x3bb243)[_0x3e0c('0x2')](0x0);return _0x41c0bf[_0x3e0c('0x3')](_0x410ec4,_0x3e0c('0x4'));}function Final(_0x511cfa){this['uniqueid']=_0x511cfa[_0x3e0c('0x5')];this[_0x3e0c('0x6')]=_0x511cfa[_0x3e0c('0x6')];this[_0x3e0c('0x7')]=_0x511cfa[_0x3e0c('0x7')];this[_0x3e0c('0x8')]=_0x511cfa[_0x3e0c('0x7')]===_0x3e0c('0x9')?_0x3e0c('0xa'):_0x511cfa[_0x3e0c('0x7')];this[_0x3e0c('0xb')]=_0x511cfa['countbusyretry'];this['countcongestionretry']=_0x511cfa[_0x3e0c('0xc')];this[_0x3e0c('0xd')]=_0x511cfa[_0x3e0c('0xd')];this[_0x3e0c('0xe')]=_0x511cfa[_0x3e0c('0xb')]+_0x511cfa[_0x3e0c('0xc')]+_0x511cfa[_0x3e0c('0xd')]+_0x511cfa['countnosuchnumberretry']+_0x511cfa[_0x3e0c('0xf')]+_0x511cfa['countabandonedretry']+_0x511cfa[_0x3e0c('0x10')]+_0x511cfa[_0x3e0c('0x11')];this['countnosuchnumberretry']=_0x511cfa[_0x3e0c('0x12')];this[_0x3e0c('0xf')]=_0x511cfa[_0x3e0c('0xf')];this[_0x3e0c('0x13')]=_0x511cfa[_0x3e0c('0x13')];this[_0x3e0c('0x10')]=_0x511cfa[_0x3e0c('0x10')];this[_0x3e0c('0x11')]=_0x511cfa[_0x3e0c('0x11')];this[_0x3e0c('0xa')]=_0x511cfa[_0x3e0c('0xa')];this[_0x3e0c('0x14')]=_0x511cfa['calleridname'];this['calleridnum']=_0x511cfa[_0x3e0c('0x15')];this[_0x3e0c('0x16')]=_0x511cfa[_0x3e0c('0x16')];this[_0x3e0c('0x17')]=_0x511cfa[_0x3e0c('0x17')];this[_0x3e0c('0x18')]=_0x511cfa['responsetime'];this[_0x3e0c('0x19')]=_0x511cfa[_0x3e0c('0x19')]||0x0;this[_0x3e0c('0x1a')]=_0x511cfa['holdtime']||0x0;this[_0x3e0c('0x1b')]=_0x511cfa['talktime']||0x0;this['callback']=_0x511cfa[_0x3e0c('0x1c')];this[_0x3e0c('0x1d')]=_0x511cfa[_0x3e0c('0x1d')];this[_0x3e0c('0x1e')]=_0x511cfa['callbackat'];this['recallme']=_0x511cfa[_0x3e0c('0x1f')];this['ContactId']=_0x511cfa['ContactId'];this[_0x3e0c('0x20')]=_0x511cfa[_0x3e0c('0x20')];this[_0x3e0c('0x21')]=_0x511cfa['UserId'];this[_0x3e0c('0x22')]=_0x511cfa[_0x3e0c('0x22')];this['CampaignId']=_0x511cfa[_0x3e0c('0x23')];this[_0x3e0c('0x24')]=_0x511cfa[_0x3e0c('0x24')]||'';this[_0x3e0c('0x25')]=_0x511cfa['originatecalleridname']||'';}module[_0x3e0c('0x26')]=Final; \ No newline at end of file +var _0xd67b=['calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x38194c,_0x104256){var _0x5cbd10=function(_0x2afc8d){while(--_0x2afc8d){_0x38194c['push'](_0x38194c['shift']());}};_0x5cbd10(++_0x104256);}(_0xd67b,0x133));var _0xbd67=function(_0x1b7afa,_0x3d9f30){_0x1b7afa=_0x1b7afa-0x0;var _0x59c8f8=_0xd67b[_0x1b7afa];return _0x59c8f8;};'use strict';var util=require('util');var _=require(_0xbd67('0x0'));var moment=require('moment');function getSeconds(_0x1da24d,_0x280954){var _0x317e33=moment(_0x1da24d)['milliseconds'](0x0);var _0x40e384=moment(_0x280954)['milliseconds'](0x0);return _0x317e33[_0xbd67('0x1')](_0x40e384,'seconds');}function Final(_0x309962){this[_0xbd67('0x2')]=_0x309962[_0xbd67('0x2')];this[_0xbd67('0x3')]=_0x309962[_0xbd67('0x3')];this[_0xbd67('0x4')]=_0x309962[_0xbd67('0x4')];this[_0xbd67('0x5')]=_0x309962[_0xbd67('0x4')]===_0xbd67('0x6')?_0xbd67('0x7'):_0x309962[_0xbd67('0x4')];this[_0xbd67('0x8')]=_0x309962['countbusyretry'];this['countcongestionretry']=_0x309962[_0xbd67('0x9')];this['countnoanswerretry']=_0x309962[_0xbd67('0xa')];this[_0xbd67('0xb')]=_0x309962[_0xbd67('0x8')]+_0x309962[_0xbd67('0x9')]+_0x309962[_0xbd67('0xa')]+_0x309962[_0xbd67('0xc')]+_0x309962[_0xbd67('0xd')]+_0x309962[_0xbd67('0xe')]+_0x309962[_0xbd67('0xf')]+_0x309962[_0xbd67('0x10')];this['countnosuchnumberretry']=_0x309962[_0xbd67('0xc')];this[_0xbd67('0xd')]=_0x309962[_0xbd67('0xd')];this[_0xbd67('0xe')]=_0x309962[_0xbd67('0xe')];this[_0xbd67('0xf')]=_0x309962[_0xbd67('0xf')];this[_0xbd67('0x10')]=_0x309962[_0xbd67('0x10')];this[_0xbd67('0x7')]=_0x309962['queue'];this['calleridname']=_0x309962[_0xbd67('0x11')];this[_0xbd67('0x12')]=_0x309962[_0xbd67('0x12')];this['starttime']=_0x309962[_0xbd67('0x13')];this[_0xbd67('0x14')]=_0x309962[_0xbd67('0x14')];this['endtime']=_0x309962[_0xbd67('0x14')];this['ringtime']=_0x309962[_0xbd67('0x15')]||0x0;this[_0xbd67('0x16')]=_0x309962[_0xbd67('0x16')]||0x0;this['talktime']=_0x309962[_0xbd67('0x17')]||0x0;this[_0xbd67('0x18')]=_0x309962[_0xbd67('0x18')];this[_0xbd67('0x19')]=_0x309962[_0xbd67('0x19')];this[_0xbd67('0x1a')]=_0x309962['callbackat'];this[_0xbd67('0x1b')]=_0x309962[_0xbd67('0x1b')];this[_0xbd67('0x1c')]=_0x309962[_0xbd67('0x1c')];this[_0xbd67('0x1d')]=_0x309962[_0xbd67('0x1d')];this[_0xbd67('0x1e')]=_0x309962[_0xbd67('0x1e')];this[_0xbd67('0x1f')]=_0x309962[_0xbd67('0x1f')];this[_0xbd67('0x20')]=_0x309962['CampaignId'];this[_0xbd67('0x21')]=_0x309962['originatecalleridnum']||'';this[_0xbd67('0x22')]=_0x309962[_0xbd67('0x22')]||'';}module[_0xbd67('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 3c3314f..229a37a 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 _0x4098=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime'];(function(_0x51fc49,_0xba76ea){var _0x29749c=function(_0x5ce79f){while(--_0x5ce79f){_0x51fc49['push'](_0x51fc49['shift']());}};_0x29749c(++_0xba76ea);}(_0x4098,0x1bf));var _0x8409=function(_0x58c9f4,_0x57b328){_0x58c9f4=_0x58c9f4-0x0;var _0x2dca0e=_0x4098[_0x58c9f4];return _0x2dca0e;};'use strict';var util=require(_0x8409('0x0'));var _=require(_0x8409('0x1'));var moment=require(_0x8409('0x2'));function getSeconds(_0x328104,_0x25e2dd){var _0x8efe78=moment(_0x328104)[_0x8409('0x3')](0x0);var _0x4ff96f=moment(_0x25e2dd)[_0x8409('0x3')](0x0);return _0x8efe78[_0x8409('0x4')](_0x4ff96f,_0x8409('0x5'));}function Hangup(_0x2a7469,_0x443396){this[_0x8409('0x6')]=0x4;this[_0x8409('0x7')]='Answer';this[_0x8409('0x8')]=_0x2a7469[_0x8409('0x8')];this[_0x8409('0x9')]=_0x2a7469[_0x8409('0x9')];this['campaigntype']=_0x2a7469[_0x8409('0x9')]===_0x8409('0xa')?_0x8409('0xb'):_0x2a7469[_0x8409('0x9')];this[_0x8409('0xc')]=_0x2a7469[_0x8409('0xc')];this[_0x8409('0xd')]=_0x2a7469[_0x8409('0xd')];this['countnoanswerretry']=_0x2a7469[_0x8409('0xe')];this[_0x8409('0xf')]=_0x2a7469[_0x8409('0xc')]+_0x2a7469[_0x8409('0xd')]+_0x2a7469['countnoanswerretry']+_0x2a7469[_0x8409('0x10')]+_0x2a7469[_0x8409('0x11')]+_0x2a7469[_0x8409('0x12')]+_0x2a7469[_0x8409('0x13')]+_0x2a7469[_0x8409('0x14')];this[_0x8409('0x10')]=_0x2a7469[_0x8409('0x10')];this[_0x8409('0x11')]=_0x2a7469[_0x8409('0x11')];this[_0x8409('0x12')]=_0x2a7469[_0x8409('0x12')];this['countmachineretry']=_0x2a7469['countmachineretry'];this[_0x8409('0x14')]=_0x2a7469[_0x8409('0x14')];this[_0x8409('0x15')]=_0x443396['uniqueid'];this[_0x8409('0x16')]=_0x2a7469[_0x8409('0x17')];this['calleridnum']=_0x2a7469['number'];this[_0x8409('0x18')]=_0x2a7469[_0x8409('0x18')];this[_0x8409('0x19')]=_0x2a7469['responsetime'];this[_0x8409('0x1a')]=moment()[_0x8409('0x1b')](_0x8409('0x1c'));this[_0x8409('0x1d')]=getSeconds(_0x2a7469[_0x8409('0x19')],_0x2a7469[_0x8409('0x18')]);this[_0x8409('0x1e')]=0x0;this[_0x8409('0x1f')]=getSeconds(this[_0x8409('0x1a')],_0x2a7469[_0x8409('0x19')]);this[_0x8409('0xb')]=_0x2a7469['queue'];this[_0x8409('0x20')]=_0x8409('0x21');this['reason']=_0x443396['cause-txt'];this[_0x8409('0x22')]=_0x2a7469[_0x8409('0x22')];this[_0x8409('0x23')]=_0x2a7469[_0x8409('0x23')];this[_0x8409('0x24')]=_0x2a7469[_0x8409('0x24')];this[_0x8409('0x25')]=_0x2a7469[_0x8409('0x25')];this[_0x8409('0x26')]=_0x2a7469[_0x8409('0x26')];this[_0x8409('0x27')]=_0x2a7469[_0x8409('0x27')];this[_0x8409('0x28')]=_0x2a7469[_0x8409('0x28')];this['VoiceQueueId']=_0x2a7469[_0x8409('0x29')];this[_0x8409('0x2a')]=_0x2a7469[_0x8409('0x2a')];}module['exports']=Hangup; \ No newline at end of file +var _0xb788=['countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','util','milliseconds','seconds','state','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xb788,0x1a9));var _0x8b78=function(_0x27250c,_0x3e6637){_0x27250c=_0x27250c-0x0;var _0x7e3095=_0xb788[_0x27250c];return _0x7e3095;};'use strict';var util=require(_0x8b78('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x10214a,_0xc66f40){var _0x5ea990=moment(_0x10214a)[_0x8b78('0x1')](0x0);var _0x206d3d=moment(_0xc66f40)[_0x8b78('0x1')](0x0);return _0x5ea990['diff'](_0x206d3d,_0x8b78('0x2'));}function Hangup(_0x15ae54,_0x1c15f1){this[_0x8b78('0x3')]=0x4;this['statedesc']=_0x8b78('0x4');this[_0x8b78('0x5')]=_0x15ae54[_0x8b78('0x5')];this[_0x8b78('0x6')]=_0x15ae54['type'];this[_0x8b78('0x7')]=_0x15ae54[_0x8b78('0x6')]==='outbound'?_0x8b78('0x8'):_0x15ae54[_0x8b78('0x6')];this[_0x8b78('0x9')]=_0x15ae54[_0x8b78('0x9')];this[_0x8b78('0xa')]=_0x15ae54[_0x8b78('0xa')];this['countnoanswerretry']=_0x15ae54[_0x8b78('0xb')];this[_0x8b78('0xc')]=_0x15ae54[_0x8b78('0x9')]+_0x15ae54[_0x8b78('0xa')]+_0x15ae54[_0x8b78('0xb')]+_0x15ae54['countnosuchnumberretry']+_0x15ae54[_0x8b78('0xd')]+_0x15ae54[_0x8b78('0xe')]+_0x15ae54[_0x8b78('0xf')]+_0x15ae54[_0x8b78('0x10')];this[_0x8b78('0x11')]=_0x15ae54[_0x8b78('0x11')];this[_0x8b78('0xd')]=_0x15ae54[_0x8b78('0xd')];this[_0x8b78('0xe')]=_0x15ae54[_0x8b78('0xe')];this[_0x8b78('0xf')]=_0x15ae54[_0x8b78('0xf')];this[_0x8b78('0x10')]=_0x15ae54[_0x8b78('0x10')];this[_0x8b78('0x12')]=_0x1c15f1[_0x8b78('0x12')];this[_0x8b78('0x13')]=_0x15ae54['name'];this[_0x8b78('0x14')]=_0x15ae54[_0x8b78('0x15')];this['starttime']=_0x15ae54[_0x8b78('0x16')];this[_0x8b78('0x17')]=_0x15ae54[_0x8b78('0x17')];this[_0x8b78('0x18')]=moment()[_0x8b78('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8b78('0x1a')]=getSeconds(_0x15ae54['responsetime'],_0x15ae54[_0x8b78('0x16')]);this[_0x8b78('0x1b')]=0x0;this[_0x8b78('0x1c')]=getSeconds(this[_0x8b78('0x18')],_0x15ae54[_0x8b78('0x17')]);this[_0x8b78('0x8')]=_0x15ae54[_0x8b78('0x8')];this[_0x8b78('0x1d')]='IVR';this['reason']=_0x1c15f1[_0x8b78('0x1e')];this[_0x8b78('0x1f')]=_0x15ae54[_0x8b78('0x1f')];this[_0x8b78('0x20')]=_0x15ae54[_0x8b78('0x20')];this[_0x8b78('0x21')]=_0x15ae54[_0x8b78('0x21')];this[_0x8b78('0x22')]=_0x15ae54[_0x8b78('0x22')];this[_0x8b78('0x23')]=_0x15ae54[_0x8b78('0x23')];this[_0x8b78('0x24')]=_0x15ae54['ListId'];this[_0x8b78('0x25')]=_0x15ae54[_0x8b78('0x25')];this['VoiceQueueId']=_0x15ae54['VoiceQueueId'];this[_0x8b78('0x26')]=_0x15ae54[_0x8b78('0x26')];}module[_0x8b78('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 23f738c..1546bd9 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 _0x1bb2=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x148783,_0x1ac458){var _0x85329a=function(_0x52afd8){while(--_0x52afd8){_0x148783['push'](_0x148783['shift']());}};_0x85329a(++_0x1ac458);}(_0x1bb2,0x12f));var _0x21bb=function(_0x4effa0,_0x166f42){_0x4effa0=_0x4effa0-0x0;var _0x341f71=_0x1bb2[_0x4effa0];return _0x341f71;};'use strict';var util=require(_0x21bb('0x0'));var _=require('lodash');var moment=require(_0x21bb('0x1'));function getSeconds(_0x2a50fa,_0x269c07){var _0x57818b=moment(_0x2a50fa)[_0x21bb('0x2')](0x0);var _0x1c5d49=moment(_0x269c07)['milliseconds'](0x0);return _0x57818b[_0x21bb('0x3')](_0x1c5d49,_0x21bb('0x4'));}function History(_0x378ff8){this['uniqueid']=_0x378ff8[_0x21bb('0x5')];this[_0x21bb('0x6')]=_0x378ff8[_0x21bb('0x6')]||undefined;this[_0x21bb('0x7')]=_0x378ff8[_0x21bb('0x7')];this['campaigntype']=_0x378ff8[_0x21bb('0x7')]===_0x21bb('0x8')?_0x21bb('0x9'):_0x378ff8['type'];this[_0x21bb('0xa')]=_0x378ff8['countbusyretry'];this[_0x21bb('0xb')]=_0x378ff8['countcongestionretry'];this[_0x21bb('0xc')]=_0x378ff8[_0x21bb('0xc')];this['countglobal']=_0x378ff8[_0x21bb('0xa')]+_0x378ff8[_0x21bb('0xb')]+_0x378ff8[_0x21bb('0xc')]+_0x378ff8[_0x21bb('0xd')]+_0x378ff8['countdropretry']+_0x378ff8['countabandonedretry']+_0x378ff8[_0x21bb('0xe')]+_0x378ff8['countagentrejectretry'];this[_0x21bb('0xd')]=_0x378ff8['countnosuchnumberretry'];this['countdropretry']=_0x378ff8[_0x21bb('0xf')];this[_0x21bb('0x10')]=_0x378ff8[_0x21bb('0x10')];this[_0x21bb('0xe')]=_0x378ff8['countmachineretry'];this[_0x21bb('0x11')]=_0x378ff8[_0x21bb('0x11')];this[_0x21bb('0x9')]=_0x378ff8[_0x21bb('0x9')];this[_0x21bb('0x12')]=_0x378ff8[_0x21bb('0x13')];this[_0x21bb('0x14')]=_0x378ff8[_0x21bb('0x15')];this[_0x21bb('0x16')]=_0x378ff8[_0x21bb('0x16')];this[_0x21bb('0x17')]=_0x378ff8[_0x21bb('0x17')];this[_0x21bb('0x18')]=_0x378ff8[_0x21bb('0x17')];this[_0x21bb('0x19')]=getSeconds(_0x378ff8['responsetime'],_0x378ff8['starttime']);this[_0x21bb('0x1a')]=0x0;this['talktime']=0x0;this['callback']=_0x378ff8[_0x21bb('0x1b')];this[_0x21bb('0x1c')]=_0x378ff8[_0x21bb('0x1c')];this['callbackat']=_0x378ff8[_0x21bb('0x1d')];this['recallme']=_0x378ff8['recallme'];this[_0x21bb('0x1e')]=_0x378ff8[_0x21bb('0x1e')];this['ListId']=_0x378ff8[_0x21bb('0x1f')];this[_0x21bb('0x20')]=_0x378ff8[_0x21bb('0x20')];this[_0x21bb('0x21')]=_0x378ff8[_0x21bb('0x21')];this['CampaignId']=_0x378ff8[_0x21bb('0x22')];this[_0x21bb('0x23')]=_0x378ff8['originatecalleridnum']||'';this['originatecalleridname']=_0x378ff8[_0x21bb('0x24')]||'';}module[_0x21bb('0x25')]=History; \ No newline at end of file +var _0xb59b=['callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','number','starttime','endtime','holdtime','talktime','callback'];(function(_0x362975,_0x3c6118){var _0x1d0972=function(_0x3b022c){while(--_0x3b022c){_0x362975['push'](_0x362975['shift']());}};_0x1d0972(++_0x3c6118);}(_0xb59b,0xbd));var _0xbb59=function(_0x156f6c,_0x3b8b49){_0x156f6c=_0x156f6c-0x0;var _0x4dc7e9=_0xb59b[_0x156f6c];return _0x4dc7e9;};'use strict';var util=require(_0xbb59('0x0'));var _=require('lodash');var moment=require(_0xbb59('0x1'));function getSeconds(_0x5089b6,_0x35dc7b){var _0x4ee44a=moment(_0x5089b6)[_0xbb59('0x2')](0x0);var _0x5a8a8a=moment(_0x35dc7b)[_0xbb59('0x2')](0x0);return _0x4ee44a[_0xbb59('0x3')](_0x5a8a8a,_0xbb59('0x4'));}function History(_0x4531a4){this[_0xbb59('0x5')]=_0x4531a4[_0xbb59('0x5')];this['scheduledat']=_0x4531a4[_0xbb59('0x6')]||undefined;this[_0xbb59('0x7')]=_0x4531a4[_0xbb59('0x7')];this[_0xbb59('0x8')]=_0x4531a4[_0xbb59('0x7')]===_0xbb59('0x9')?_0xbb59('0xa'):_0x4531a4[_0xbb59('0x7')];this[_0xbb59('0xb')]=_0x4531a4[_0xbb59('0xb')];this[_0xbb59('0xc')]=_0x4531a4['countcongestionretry'];this[_0xbb59('0xd')]=_0x4531a4[_0xbb59('0xd')];this['countglobal']=_0x4531a4[_0xbb59('0xb')]+_0x4531a4[_0xbb59('0xc')]+_0x4531a4[_0xbb59('0xd')]+_0x4531a4[_0xbb59('0xe')]+_0x4531a4[_0xbb59('0xf')]+_0x4531a4[_0xbb59('0x10')]+_0x4531a4['countmachineretry']+_0x4531a4[_0xbb59('0x11')];this[_0xbb59('0xe')]=_0x4531a4[_0xbb59('0xe')];this[_0xbb59('0xf')]=_0x4531a4[_0xbb59('0xf')];this[_0xbb59('0x10')]=_0x4531a4['countabandonedretry'];this[_0xbb59('0x12')]=_0x4531a4[_0xbb59('0x12')];this[_0xbb59('0x11')]=_0x4531a4[_0xbb59('0x11')];this[_0xbb59('0xa')]=_0x4531a4[_0xbb59('0xa')];this[_0xbb59('0x13')]=_0x4531a4['name'];this[_0xbb59('0x14')]=_0x4531a4[_0xbb59('0x15')];this['starttime']=_0x4531a4[_0xbb59('0x16')];this['responsetime']=_0x4531a4['responsetime'];this[_0xbb59('0x17')]=_0x4531a4['responsetime'];this['ringtime']=getSeconds(_0x4531a4['responsetime'],_0x4531a4[_0xbb59('0x16')]);this[_0xbb59('0x18')]=0x0;this[_0xbb59('0x19')]=0x0;this[_0xbb59('0x1a')]=_0x4531a4[_0xbb59('0x1a')];this[_0xbb59('0x1b')]=_0x4531a4[_0xbb59('0x1b')];this[_0xbb59('0x1c')]=_0x4531a4['callbackat'];this[_0xbb59('0x1d')]=_0x4531a4[_0xbb59('0x1d')];this['ContactId']=_0x4531a4[_0xbb59('0x1e')];this['ListId']=_0x4531a4['ListId'];this[_0xbb59('0x1f')]=_0x4531a4[_0xbb59('0x1f')];this[_0xbb59('0x20')]=_0x4531a4[_0xbb59('0x20')];this['CampaignId']=_0x4531a4[_0xbb59('0x21')];this['originatecalleridnum']=_0x4531a4[_0xbb59('0x22')]||'';this[_0xbb59('0x23')]=_0x4531a4[_0xbb59('0x23')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 1db5a56..4272785 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 _0x7a1b=['[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','SIP/%s','unmonitored','saveInDb','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','state','statedesc','HangupInAMD','membername','emit','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','AMD','countglobal','amd','countbusyretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','countmachineretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countcongestionretry','countdropretry','reason19\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','TIMEOUT','dialDropRetryFrequency','callAdditionalPhoneAfterMin','additional','[rescheduleContact][Drop]','calleridname','calleridnum','outboundDropCallsDayCallersExit','dropreason','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','push','paused','queueStatusComplete','[unlockQueueStatus][undefined]','idHopper','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','true','iftime\x20%s,%s','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','handlePower','power','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:dialPreviewRecallReminder','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','map','user:%s','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','NONE','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','variables','dialPrefix','trim','substring','dialCutDigit','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','[originate][error]','originate','Error','originate\x20action\x20Error','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countnoanswerretry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectRetryFrequency','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','run','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','[Originate][historyBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','not_inuse','reachable','[countReScheduled]\x20','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Ts\x20=\x20','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/setting','./history','./final','./agentComplete','./queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','queuecallerabandon','bind','syncOriginateResponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','previewRecallmeReminderInterval','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','stringify','milliseconds','diff','seconds','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\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','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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','endtime','starttime','clearZombieChannels','[uniqueid]','actions','undefined','sequence','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x7a1b,0x166));var _0xb7a1=function(_0xc90e97,_0x11af46){_0xc90e97=_0xc90e97-0x0;var _0x597e2b=_0x7a1b[_0xc90e97];return _0x597e2b;};'use strict';var util=require(_0xb7a1('0x0'));var _=require(_0xb7a1('0x1'));var uuid=require(_0xb7a1('0x2'));var moment=require(_0xb7a1('0x3'));var rr=require('rr');var md5=require(_0xb7a1('0x4'));var Redis=require(_0xb7a1('0x5'));var ut=require(_0xb7a1('0x6'));var config=require('../../../config/environment/');var logger=require(_0xb7a1('0x7'))(_0xb7a1('0x8'));var loggerBooked=require('../../../config/logger')(_0xb7a1('0x9'));var loggerPredictive=require(_0xb7a1('0x7'))(_0xb7a1('0xa'));var loggerPredictiveCalls=require(_0xb7a1('0x7'))(_0xb7a1('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xb7a1('0xc'));var ami=require(_0xb7a1('0xd'));config[_0xb7a1('0xe')]=_[_0xb7a1('0xf')](config[_0xb7a1('0xe')],{'host':_0xb7a1('0x10'),'port':0x18eb});var io=require(_0xb7a1('0x11'))(new Redis(config[_0xb7a1('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xb7a1('0x12'));var cmHopperAdditionalPhone=require(_0xb7a1('0x13'));var cmHopperBlack=require(_0xb7a1('0x14'));var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0xb7a1('0x15'));var Action=require('./action');var History=require(_0xb7a1('0x16'));var Final=require(_0xb7a1('0x17'));var AgentComplete=require(_0xb7a1('0x18'));var QueueCallerAbandon=require(_0xb7a1('0x19'));var Hangup=require('./hangup');var ipAgi=process[_0xb7a1('0x1a')][_0xb7a1('0x1b')]||_0xb7a1('0x1c');var strategy={'rrmemory':_0xb7a1('0x1d'),'roundrobin':_0xb7a1('0x1e')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xb7a1('0x1f')]['enqueue']=function(_0x3597ae){this[_0xb7a1('0x20')]=this[_0xb7a1('0x20')]?this[_0xb7a1('0x20')][_0xb7a1('0x21')](_0x3597ae):_0x3597ae();};function Dialer(_0x5ebc4c,_0x21a195){this['sequence']=new Sequence();this['preview']=_0x21a195;this[_0xb7a1('0x22')]=_0x5ebc4c[_0xb7a1('0x22')];this['campaigns']=_0x5ebc4c[_0xb7a1('0x23')];this['agents']=_0x5ebc4c[_0xb7a1('0x24')];this[_0xb7a1('0x25')]=_0x5ebc4c['trunks'];this[_0xb7a1('0x26')]=config[_0xb7a1('0x26')]||0x2;this[_0xb7a1('0x27')]={};this['actions']={};this[_0xb7a1('0x28')]={};this[_0xb7a1('0x29')]={};this[_0xb7a1('0x2a')]={};this[_0xb7a1('0x2b')]={};this[_0xb7a1('0x2c')]={};this[_0xb7a1('0x2d')]={};this[_0xb7a1('0x2e')]={};this['queueBookedRR']={};ami['on'](_0xb7a1('0x2f'),this[_0xb7a1('0x30')]['bind'](this));ami['on'](_0xb7a1('0x31'),this['syncQueueCallerAbandon'][_0xb7a1('0x32')](this));ami['on']('originateresponse',this[_0xb7a1('0x33')][_0xb7a1('0x32')](this));ami['on']('agentcomplete',this[_0xb7a1('0x34')]['bind'](this));ami['on'](_0xb7a1('0x35'),this[_0xb7a1('0xc')][_0xb7a1('0x32')](this));ami['on'](_0xb7a1('0x36'),this[_0xb7a1('0x37')][_0xb7a1('0x32')](this));ami['on']('hangup',this[_0xb7a1('0x38')][_0xb7a1('0x32')](this));ami['on'](_0xb7a1('0x39'),this[_0xb7a1('0x3a')][_0xb7a1('0x32')](this));ami['on'](_0xb7a1('0x3b'),this[_0xb7a1('0x3c')]['bind'](this));ami['on'](_0xb7a1('0x3d'),this[_0xb7a1('0x3e')][_0xb7a1('0x32')](this));ami['on'](_0xb7a1('0x3f'),this[_0xb7a1('0x40')][_0xb7a1('0x32')](this));this['loopCampaigns']();this[_0xb7a1('0x41')]();RpcSetting['getSettings']()['then'](function(_0x5349b9){previewRecallmeReminderInterval=_0x5349b9[_0xb7a1('0x42')];});}function isNotNull(_0x55eacf){return _0x55eacf!==null&&!_[_0xb7a1('0x43')](_0x55eacf);}function checkIsLoggedIn(_0x121be7,_0x45a867){return function(){if(_0x45a867<=0x0){_0x121be7[_0xb7a1('0x44')]='AGENTS_NOT_LOGGED';throw _0x121be7[_0xb7a1('0x45')]+_0xb7a1('0x46');}};}function isActive(_0x17add4){return _0x17add4;}function checkIsActive(_0x12c496,_0x869bee){return function(){if(!isActive(_0x869bee)){_0x12c496[_0xb7a1('0x44')]=_0xb7a1('0x47');throw _0x12c496[_0xb7a1('0x45')]+_0xb7a1('0x48');}};}function checkInterval(_0x5406ae){return function(){if(!isNotNull(_0x5406ae['Interval'])){_0x5406ae[_0xb7a1('0x44')]=_0xb7a1('0x49');throw _0x5406ae[_0xb7a1('0x45')]+_0xb7a1('0x4a');}if(!isNotNull(_0x5406ae[_0xb7a1('0x4b')][_0xb7a1('0x4c')])){_0x5406ae[_0xb7a1('0x44')]=_0xb7a1('0x49');throw _0x5406ae[_0xb7a1('0x45')]+_0xb7a1('0x4a');}if(!isNotNull(_['isEmpty'](_0x5406ae[_0xb7a1('0x4b')][_0xb7a1('0x4c')]))){_0x5406ae['message']=_0xb7a1('0x49');throw _0x5406ae[_0xb7a1('0x45')]+_0xb7a1('0x4a');}};}function msgResponse(_0xe2ead4,_0x4f313a,_0x24b7b7){return{'action':_0xe2ead4,'response':_0x4f313a,'message':_0x24b7b7,'stack':_0x24b7b7};}function myreject(_0x12dcd1){return function(_0x135238){return _0x12dcd1(msgResponse('[ifTime][Action]','Error',JSON[_0xb7a1('0x4d')](_0x135238)));};}function getSeconds(_0x5c6cca,_0x4e2baa){var _0x5959f8=moment(_0x5c6cca)[_0xb7a1('0x4e')](0x0);var _0x26f253=moment(_0x4e2baa)[_0xb7a1('0x4e')](0x0);return _0x5959f8[_0xb7a1('0x4f')](_0x26f253,_0xb7a1('0x50'));}function emit(_0x14d436,_0x152efd,_0x36ece3){io['to'](_0x14d436)['emit'](_0x152efd,_0x36ece3);}function emitVoiceQueueSummary(_0x14d5fb){if(_0x14d5fb['type']===_0xb7a1('0x51')){var _0x498c46={'id':_0x14d5fb['id'],'name':_0x14d5fb[_0xb7a1('0x45')],'strategy':_0x14d5fb[_0xb7a1('0x52')],'answered':_0x14d5fb[_0xb7a1('0x53')],'available':_0x14d5fb[_0xb7a1('0x54')],'loggedIn':_0x14d5fb[_0xb7a1('0x55')],'pTalking':_0x14d5fb[_0xb7a1('0x56')],'sumBillable':_0x14d5fb[_0xb7a1('0x57')],'sumDuration':_0x14d5fb[_0xb7a1('0x58')],'sumHoldTime':_0x14d5fb['sumHoldTime']||0x0,'talking':_0x14d5fb[_0xb7a1('0x59')],'total':_0x14d5fb[_0xb7a1('0x5a')],'type':_0x14d5fb[_0xb7a1('0x5b')],'unmanaged':_0x14d5fb[_0xb7a1('0x5c')],'abandoned':_0x14d5fb[_0xb7a1('0x5d')],'waiting':_0x14d5fb[_0xb7a1('0x5e')],'loggedInDb':_0x14d5fb[_0xb7a1('0x5f')],'dialActive':_0x14d5fb[_0xb7a1('0x60')],'dialMethod':_0x14d5fb[_0xb7a1('0x61')],'dialOriginateCallerIdName':_0x14d5fb[_0xb7a1('0x62')],'dialOriginateCallerIdNumber':_0x14d5fb[_0xb7a1('0x63')],'dialOriginateTimeout':_0x14d5fb[_0xb7a1('0x64')],'dialPrefix':_0x14d5fb['dialPrefix'],'outboundAnswerAgiCallsDay':_0x14d5fb[_0xb7a1('0x65')],'outboundAnswerCallsDay':_0x14d5fb[_0xb7a1('0x66')],'outboundBlacklistCallsDay':_0x14d5fb['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x14d5fb[_0xb7a1('0x67')],'outboundCongestionCallsDay':_0x14d5fb['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x14d5fb[_0xb7a1('0x68')],'outboundDropCallsDayCallersExit':_0x14d5fb['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x14d5fb['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x14d5fb[_0xb7a1('0x69')],'outboundNoSuchCallsDay':_0x14d5fb[_0xb7a1('0x6a')],'outboundOriginateFailureCallsDay':_0x14d5fb[_0xb7a1('0x6b')],'outboundReCallsDay':_0x14d5fb[_0xb7a1('0x6c')],'outboundRejectCallsDay':_0x14d5fb['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x14d5fb[_0xb7a1('0x6d')],'predictiveIntervalAnsweredCalls':_0x14d5fb[_0xb7a1('0x6e')],'predictiveIntervalAvgHoldtime':_0x14d5fb['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x14d5fb[_0xb7a1('0x6f')],'predictiveIntervalDroppedCallsCallersExit':_0x14d5fb['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x14d5fb['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x14d5fb['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x14d5fb[_0xb7a1('0x70')],'predictiveIntervalHitRate':_0x14d5fb[_0xb7a1('0x71')],'predictiveIntervalMultiplicativeFactor':_0x14d5fb[_0xb7a1('0x72')],'predictiveIntervalPauses':_0x14d5fb[_0xb7a1('0x73')],'predictiveIntervalAvailable':_0x14d5fb[_0xb7a1('0x74')],'predictiveIntervalTotalCalls':_0x14d5fb['predictiveIntervalTotalCalls'],'message':_0x14d5fb['message'],'originated':_0x14d5fb[_0xb7a1('0x75')],'erlangCalls':_0x14d5fb[_0xb7a1('0x76')],'erlangCallToSecond':_0x14d5fb['erlangCallToSecond'],'erlangAbandonmentRate':_0x14d5fb[_0xb7a1('0x77')],'erlangBusyFactor':_0x14d5fb[_0xb7a1('0x78')],'startPredictive':_0x14d5fb[_0xb7a1('0x2b')],'startProgressive':_0x14d5fb[_0xb7a1('0x2c')]};if(_0x14d5fb[_0xb7a1('0x79')]){_0x498c46[_0xb7a1('0x79')]={'id':_0x14d5fb['Trunk']['id'],'name':_0x14d5fb[_0xb7a1('0x79')][_0xb7a1('0x45')],'active':_0x14d5fb[_0xb7a1('0x79')][_0xb7a1('0x7a')],'callerid':_0x14d5fb[_0xb7a1('0x79')][_0xb7a1('0x7b')]};}if(_0x14d5fb[_0xb7a1('0x4b')]){_0x498c46['Interval']={'id':_0x14d5fb[_0xb7a1('0x4b')]['id'],'name':_0x14d5fb[_0xb7a1('0x4b')][_0xb7a1('0x45')]};}var _0xe0be85=md5(JSON[_0xb7a1('0x4d')](_0x498c46));if(_0x14d5fb[_0xb7a1('0x4')]!==_0xe0be85){_0x14d5fb['md5']=_0xe0be85;emit(util[_0xb7a1('0x7c')]('voice:queue:%s',_0x498c46['name']),_0xb7a1('0x7d'),_0x498c46);}}}function emitCampaignSummary(_0x3e5f9f){if(_0x3e5f9f[_0xb7a1('0x5b')]===_0xb7a1('0x7e')){emit(util['format'](_0xb7a1('0x7f'),_0x3e5f9f[_0xb7a1('0x45')]),_0xb7a1('0x80'),_0x3e5f9f);}}function checkGetDataPredictive(_0x246f54){if(isNotNull(_0x246f54)&&!_[_0xb7a1('0x81')](_0x246f54)){loggerPredictive['info'](_0xb7a1('0x82'));loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x84'),_0x246f54[_0xb7a1('0x85')]);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x246f54[_0xb7a1('0x6e')]);loggerPredictive[_0xb7a1('0x83')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x246f54[_0xb7a1('0x86')]);loggerPredictive['info'](_0xb7a1('0x87'),_0x246f54[_0xb7a1('0x88')]);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x89'),_0x246f54[_0xb7a1('0x8a')]);loggerPredictive['info'](_0xb7a1('0x8b'),_0x246f54[_0xb7a1('0x6f')]);loggerPredictive['info'](_0xb7a1('0x8c'));if(_0x246f54[_0xb7a1('0x85')]>0x0){if(!_[_0xb7a1('0x43')](_0x246f54['predictiveIntervalAvgTalktime'])&&_0x246f54['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive['info'](_0xb7a1('0x8d'));if(!_['isUndefined'](_0x246f54['predictiveIntervalAvgHoldtime'])&&_0x246f54['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x8e'));}}else{loggerPredictive[_0xb7a1('0x83')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2dabf8){return function(_0x37e2e3){loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x8f'));loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x90'),_0x37e2e3['erlangCalls']);loggerPredictive['info'](_0xb7a1('0x91'),_0x37e2e3['erlangCallToSecond']);loggerPredictive['info'](_0xb7a1('0x92'),_0x37e2e3[_0xb7a1('0x77')]);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x93'),_0x37e2e3[_0xb7a1('0x78')]);loggerPredictive['info'](_0xb7a1('0x92'),_0x37e2e3[_0xb7a1('0x77')]);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x8c'));_[_0xb7a1('0x94')](_0x2dabf8,_0x37e2e3);};}function getDiff(_0xd6989d){var _0x2f953e=moment()[_0xb7a1('0x4e')](0x0);var _0x276bf0=moment(_0xd6989d)[_0xb7a1('0x4e')](0x0);return _0x2f953e[_0xb7a1('0x4f')](_0x276bf0,'seconds');}function ifInterval(_0x3c8c56,_0x193d0d){if(_['isUndefined'](_0x193d0d)){return![];}return getDiff(_0x193d0d)<_0x3c8c56*0x3c;}function freeVariablesPredictive(_0x14ec69){if(isNotNull(_0x14ec69)){if(!_[_0xb7a1('0x43')](_0x14ec69[_0xb7a1('0x2c')])){_0x14ec69[_0xb7a1('0x2c')]=undefined;loggerPredictive[_0xb7a1('0x83')](_0x14ec69[_0xb7a1('0x45')],_0xb7a1('0x95'));}if(!_['isUndefined'](_0x14ec69[_0xb7a1('0x2b')])){_0x14ec69[_0xb7a1('0x2b')]=undefined;loggerPredictive[_0xb7a1('0x83')](_0x14ec69[_0xb7a1('0x45')],_0xb7a1('0x96'));}if(!_['isUndefined'](_0x14ec69[_0xb7a1('0x97')])){clearInterval(_0x14ec69[_0xb7a1('0x97')]);_0x14ec69[_0xb7a1('0x97')]=undefined;loggerPredictive['info'](_0x14ec69[_0xb7a1('0x45')],_0xb7a1('0x98'));}}}function erlangb(_0x2bc7f5,_0x3b1f86){if(_0x3b1f86===0x0){return 0x0;}var _0x598a3b=0x1;for(var _0x74ad46=0x1;_0x74ad46<=_0x3b1f86;_0x74ad46+=0x1){_0x598a3b=0x1+_0x598a3b*_0x74ad46/_0x2bc7f5;}return 0x1/_0x598a3b;}function isVoiceQueueOutbound(_0x2dadde){return _0x2dadde==='outbound';}function isNotPreview(_0x257edc){return _0x257edc!==_0xb7a1('0x99');}function isCampaignIvr(_0x5cc589){return _0x5cc589===_0xb7a1('0x7e');}function getCallerId(_0xe2a478,_0x234ddc,_0xf9e8e0){if(!_[_0xb7a1('0x43')](_0xf9e8e0)&&typeof _0xf9e8e0===_0xb7a1('0x9a')&&!_[_0xb7a1('0x81')](_0xf9e8e0)){if(!_[_0xb7a1('0x43')](_0x234ddc)&&typeof _0x234ddc===_0xb7a1('0x9a')&&!_[_0xb7a1('0x81')](_0x234ddc)){return util['format']('\x22%s\x22\x20<%s>',_0x234ddc,_0xf9e8e0);}return util['format'](_0xb7a1('0x9b'),_0xf9e8e0,_0xf9e8e0);}if(!_[_0xb7a1('0x43')](_0xe2a478)&&typeof _0xe2a478===_0xb7a1('0x9a')&&!_['isEmpty'](_0xe2a478)){return _0xe2a478;}return _0xb7a1('0x9c');}function loggerCatchQueueSummary(_0x14571d,_0x2dbb84){return function(_0x41597f){freeVariablesPredictive(_0x2dbb84);emitVoiceQueueSummary(_0x2dbb84);emitCampaignSummary(_0x2dbb84);loggerSyncQueueSummary[_0xb7a1('0x9d')](_0x14571d,util[_0xb7a1('0x9e')](_0x41597f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4dcea3,_0x54d55f){return function(_0x766226){loggerPredictive[_0xb7a1('0x9f')](_0x54d55f['name'],_0x4dcea3);loggerPredictive[_0xb7a1('0x9f')](_0x766226['stack']);freeVariablesPredictive(_0x54d55f);};}function loggerCatch(_0x164c23){return function(_0x5157eb){logger['error'](_0x164c23,util[_0xb7a1('0x9e')](_0x5157eb,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x26f78a){return _0x26f78a&&!_[_0xb7a1('0x43')](_0x26f78a)&&_0x26f78a[_0xb7a1('0xa0')]>0x0;}function decremetOriginate(_0x9cdd0d){if(!_['isUndefined'](_0x9cdd0d)&&_0x9cdd0d!==null){if(typeof _0x9cdd0d[_0xb7a1('0x75')]!=='undefined'){if(_0x9cdd0d[_0xb7a1('0x75')]>0x0){_0x9cdd0d[_0xb7a1('0x75')]-=0x1;}else{logger[_0xb7a1('0x9f')](_0xb7a1('0xa1'));}}}else{logger[_0xb7a1('0x9f')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x12df9a,_0x265261,_0x2deeeb){if(_0x265261>_0x2deeeb){for(var _0x2140fc=0x0;_0x2140fc<_0x265261-_0x2deeeb;_0x2140fc+=0x1){decremetOriginate(_0x12df9a);}}}function loggerGetContactDialer(_0x43de3e,_0x230d22,_0x3d9a3e){return function(_0x2842a5){checkContactLowerLimitOriginate(_0x230d22,_0x3d9a3e,0x0);logger[_0xb7a1('0x9f')](_0x43de3e,util[_0xb7a1('0x9e')](_0x2842a5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1690d9){return function(_0x32270d){if(isNotNull(_0x32270d)&&isNotNull(_0x32270d[0x0])){if(_0x32270d[0x0][_0xb7a1('0xa2')]>0x0){_0x1690d9[_0xb7a1('0x44')]=_0xb7a1('0xa3');logger[_0xb7a1('0x83')](_0xb7a1('0xa4')+_0x1690d9[_0xb7a1('0x45')],_0x32270d[0x0]['contactsRescheduled'],'contacts');}else{_0x1690d9[_0xb7a1('0x44')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xb7a1('0x83')](_0xb7a1('0xa5')+_0x1690d9[_0xb7a1('0x45')]);}}};}function notSendMessagesQueue(_0x55ec05){if(_0x55ec05[_0xb7a1('0xa6')]){freeVariablesPredictive(_0x55ec05);if(_0x55ec05[_0xb7a1('0x75')]===0x0&&_0x55ec05[_0xb7a1('0x59')]===0x0&&_0x55ec05['waiting']===0x0&&(_0x55ec05[_0xb7a1('0x56')]||0x0)===0x0){_0x55ec05[_0xb7a1('0xa6')]=![];_0x55ec05[_0xb7a1('0x54')]=0x0;_0x55ec05[_0xb7a1('0x44')]=_0xb7a1('0x47');loggerSyncQueueSummary[_0xb7a1('0x9d')](_0xb7a1('0xa7'),_0x55ec05[_0xb7a1('0x45')],_0xb7a1('0xa8'));}else{_0x55ec05[_0xb7a1('0x44')]=_0xb7a1('0xa9');loggerSyncQueueSummary[_0xb7a1('0x9d')](_0xb7a1('0xa7'),_0x55ec05[_0xb7a1('0x45')],_0xb7a1('0xaa'));}emitVoiceQueueSummary(_0x55ec05);}}function notSendMessagesCampaign(_0xb758d4){if(_0xb758d4['sendMessageOneNotActive']){if(_0xb758d4['originated']===0x0){_0xb758d4['sendMessageOneNotActive']=![];_0xb758d4[_0xb7a1('0x44')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xb7a1('0x9d')](_0xb7a1('0xab'),_0xb758d4[_0xb7a1('0x45')],_0xb7a1('0xa8'));}else{_0xb758d4[_0xb7a1('0x44')]=_0xb7a1('0xa9');loggerSyncQueueSummary['debug'](_0xb7a1('0xab'),_0xb758d4['name'],'is\x20disactive');}emitCampaignSummary(_0xb758d4);}}function createObjHistory(_0x3cedd1,_0x46404e,_0x5b9f3b,_0x2b79f7,_0x3160bd){_0x3cedd1['message']=_0x5b9f3b;var _0x5b6884=new Action(_0x3cedd1,_0x46404e);var _0x17db6e=new History(_0x5b6884);_0x17db6e['state']=_0x2b79f7;_0x17db6e['statedesc']=_0x3160bd;_0x17db6e[_0xb7a1('0xac')]=_0x5b6884[_0xb7a1('0xad')];return _0x17db6e;}Dialer[_0xb7a1('0x1f')][_0xb7a1('0x41')]=function(){var _0x30f93=this;setInterval(function(){_0x30f93[_0xb7a1('0xae')](_0x30f93[_0xb7a1('0x29')],_0xb7a1('0xaf'));_0x30f93[_0xb7a1('0xae')](_0x30f93[_0xb7a1('0xb0')],'[actions]');},0x32c8);};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xae')]=function(_0x4b2b8b,_0x1791ec){var _0x913fc=this;for(var _0xab7da5 in _0x4b2b8b){if(typeof _0x4b2b8b[_0xab7da5]!==_0xb7a1('0xb1')){this[_0xb7a1('0xb2')][_0xb7a1('0xb3')](function(){if(!_[_0xb7a1('0xb4')](_0x4b2b8b[_0xab7da5])){return ami[_0xb7a1('0xb5')]({'action':_0xb7a1('0xb6'),'channel':_0x4b2b8b[_0xab7da5][_0xb7a1('0xb7')]})[_0xb7a1('0xb8')](function(_0x1e8524){if(_0x1e8524['message']===_0xb7a1('0xb9')){setTimeout(function(){if(_0x4b2b8b[_0xab7da5]&&_0x4b2b8b[_0xab7da5][_0xb7a1('0x5b')]!=='ivr'){_0x913fc[_0xb7a1('0xba')](_0x913fc[_0xb7a1('0x22')][_0x4b2b8b[_0xab7da5][_0xb7a1('0xbb')]]);logger['error'](_0xb7a1('0xbc'),_0x1791ec,_0xab7da5,_0x4b2b8b[_0xab7da5][_0xb7a1('0xbb')]);delete _0x4b2b8b[_0xab7da5];}if(_0x4b2b8b[_0xab7da5]&&_0x4b2b8b[_0xab7da5]['type']==='ivr'){_0x913fc[_0xb7a1('0xba')](_0x913fc['campaigns'][_0x4b2b8b[_0xab7da5][_0xb7a1('0xbb')]]);logger[_0xb7a1('0x9f')]('[Dialer][checkChannel][ivr]',_0x1791ec,_0xab7da5,_0x4b2b8b[_0xab7da5][_0xb7a1('0xbb')]);delete _0x4b2b8b[_0xab7da5];}},0x2328);}});}});}}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xbd')]=function(_0x5b8d9b){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopper[_0xb7a1('0xbd')](_0x5b8d9b))[_0xb7a1('0xb8')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xc0')]=function(_0x332775){return Promise[_0xb7a1('0xbe')]()['then'](cmHopperBlack['checkIsBlackList'](_0x332775))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xc1')));};Dialer[_0xb7a1('0x1f')]['verifyAdditionalPhones']=function(_0x2f3b85,_0x1826ed,_0x288cb0){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopperAdditionalPhone[_0xb7a1('0xc2')](_0x2f3b85,_0x1826ed,_0x288cb0))['catch'](loggerCatch(_0xb7a1('0xc3')));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xc4')]=function(_0xb212dd,_0x604d56,_0x3067b4){return Promise[_0xb7a1('0xbe')]()['then'](cmHopperAdditionalPhone[_0xb7a1('0xc4')](_0xb212dd,_0x604d56,_0x3067b4))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xc5')));};Dialer['prototype'][_0xb7a1('0xc6')]=function(_0x115d5e){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopperBlack[_0xb7a1('0xc6')](_0x115d5e))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xc7')));};Dialer['prototype'][_0xb7a1('0xc8')]=function(_0x5c307e){return Promise['resolve']()['then'](cmHopperHistory[_0xb7a1('0xc9')](_0x5c307e))[_0xb7a1('0xb8')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xb7a1('0x1f')]['rescheduleContact']=function(_0xa644b2){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopper[_0xb7a1('0xca')](_0xa644b2))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xcb')));};Dialer['prototype'][_0xb7a1('0xcc')]=function(_0x27f306,_0x30703b,_0x28e18e){return Promise['resolve']()[_0xb7a1('0xbf')](cmHopper[_0xb7a1('0xcc')](_0x27f306,_0x30703b,_0x28e18e))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xcd')));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xce')]=function(_0x3c7621,_0x29d8cb,_0x3d9eb6,_0x47ed97,_0x50f312){return Promise[_0xb7a1('0xbe')]()['then'](cmHopper['getContactDialer'](_0x3c7621,_0x29d8cb,_0x3d9eb6,_0x47ed97))[_0xb7a1('0xb8')](function(_0x25a2bc){_0x50f312[_0xb7a1('0xcf')]-=_0x3d9eb6;_0x50f312[_0xb7a1('0xcf')]=_0x50f312[_0xb7a1('0xcf')]>0x0?_0x50f312[_0xb7a1('0xcf')]:0x0;loggerCatch(_0xb7a1('0xd0'))(_0x25a2bc);});};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xd1')]=function(_0x1ef592,_0x3181f8,_0x41097a,_0x290e91){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopper[_0xb7a1('0xd1')](_0x1ef592,_0x3181f8,_0x41097a))[_0xb7a1('0xb8')](function(_0x160714){_0x290e91['temp']-=_0x3181f8;_0x290e91[_0xb7a1('0xcf')]=_0x290e91[_0xb7a1('0xcf')]>0x0?_0x290e91[_0xb7a1('0xcf')]:0x0;loggerCatch(_0xb7a1('0xd2'))(_0x160714);});};Dialer[_0xb7a1('0x1f')]['getVoiceQueueRtPauses']=function(_0x5e49d4){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](voiceQueueRt[_0xb7a1('0xd3')](_0x5e49d4))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xd4')));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xd5')]=function(_0x34f741){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopper['moveContactManagedDialer'](_0x34f741))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0xd6')));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xd7')]=function(_0xa80f58){return Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](cmHopperHistory['createHistory'](_0xa80f58))['catch'](loggerCatch(_0xb7a1('0xd8')));};Dialer['prototype'][_0xb7a1('0xba')]=function(_0x1d6878){if(!_[_0xb7a1('0x43')](_0x1d6878)&&_0x1d6878!==null){if(typeof _0x1d6878[_0xb7a1('0x75')]!==_0xb7a1('0xb1')){if(_0x1d6878[_0xb7a1('0x75')]>0x0){_0x1d6878[_0xb7a1('0x75')]-=0x1;}else{logger[_0xb7a1('0x9f')](_0xb7a1('0xd9'));}}}else{logger[_0xb7a1('0x9f')](_0xb7a1('0xda'));}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xdb')]=function(_0xe873fd,_0x563b4b){var _0x394c61=this;return function(_0x55c4b4){_0x394c61[_0xb7a1('0xba')](_0x563b4b);logger[_0xb7a1('0x9f')](_0xe873fd,util[_0xb7a1('0x9e')](_0x55c4b4,{'showHidden':![],'depth':null}));};};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xdc')]=function(_0x43aa78,_0x1e67ed,_0xb107d4){var _0x507508={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x1e67ed);this['saveInDb'](_[_0xb7a1('0x94')](_0x507508,_[_0xb7a1('0xdd')](_0xb107d4,[_0xb7a1('0xde'),_0xb7a1('0xdf'),_0xb7a1('0xe0'),_0xb7a1('0xe1'),_0xb7a1('0xe2')])),_0xb7a1('0xe3'),'[emptyContact]');logger[_0xb7a1('0x9f')](_0x43aa78);};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xe4')]=function(_0x1202fc){return _0x1202fc===_0xb7a1('0xe5');};Dialer['prototype']['isTrunkReachable']=function(_0x17db16){return!_[_0xb7a1('0x43')](_0x17db16)&&_0x17db16&&!_[_0xb7a1('0x43')](_0x17db16[_0xb7a1('0x45')])&&!_['isUndefined'](_0x17db16[_0xb7a1('0x7a')])&&_0x17db16[_0xb7a1('0x7a')]&&(this[_0xb7a1('0x25')][util[_0xb7a1('0x7c')](_0xb7a1('0xe6'),_0x17db16[_0xb7a1('0x45')])]['status']==='reachable'||this[_0xb7a1('0x25')][util[_0xb7a1('0x7c')]('SIP/%s',_0x17db16['name'])][_0xb7a1('0xb6')]===_0xb7a1('0xe7'));};Dialer['prototype'][_0xb7a1('0xe8')]=function(_0x3a5d52,_0x518865,_0x919813){this[_0xb7a1('0xd7')](_0x3a5d52)['catch'](loggerCatch(_0x518865));this['moveContactManagedDialer'](_0x3a5d52)[_0xb7a1('0xb8')](loggerCatch(_0x919813));};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x3c')]=function(_0x5b97e2){var _0x281a96=this;var _0x12afb0=this[_0xb7a1('0x29')][_0x5b97e2[_0xb7a1('0xe9')]];var _0x45445d;if(!_[_0xb7a1('0xb4')](_0x5b97e2)&&!_[_0xb7a1('0xb4')](_0x5b97e2[_0xb7a1('0xea')])&&!_[_0xb7a1('0xb4')](_0x5b97e2[_0xb7a1('0xea')][_0xb7a1('0xeb')])&&_0x5b97e2[_0xb7a1('0xec')]===_0xb7a1('0xed')&&_0x12afb0){if(_0x12afb0[_0xb7a1('0x5b')]!=='ivr'&&this[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]]['dialAMDActive']&&_0x5b97e2[_0xb7a1('0xee')]===_0xb7a1('0xef')){delete this[_0xb7a1('0x29')][_0x5b97e2['uniqueid']];this[_0xb7a1('0xba')](this[_0xb7a1('0x22')][_0x12afb0['queue']]);this[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;this[_0xb7a1('0x22')][_0x12afb0['queue']][_0xb7a1('0x65')]+=0x1;_0x45445d=new Hangup(_0x12afb0,_0x5b97e2);_0x45445d[_0xb7a1('0xf0')]=0x12;_0x45445d[_0xb7a1('0xf1')]=_0xb7a1('0xf2');_0x45445d[_0xb7a1('0xf3')]='AMD';ami[_0xb7a1('0xf4')](_0xb7a1('0xf5'),ut[_0xb7a1('0xf6')](_0x45445d,'amd'));this[_0xb7a1('0xe8')](_0x45445d,_0xb7a1('0xf7'),_0xb7a1('0xf8'));}if(_0x12afb0[_0xb7a1('0x5b')]!=='ivr'&&this[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0xf9')]&&_0x5b97e2[_0xb7a1('0xee')]===_0xb7a1('0xfa')){return new Promise(function(_0x5c8eb0,_0x5aff83){delete _0x281a96[_0xb7a1('0x29')][_0x5b97e2[_0xb7a1('0xe9')]];_0x281a96[_0xb7a1('0xba')](_0x281a96[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]]);_0x281a96[_0xb7a1('0x22')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;_0x281a96[_0xb7a1('0x22')][_0x12afb0['queue']][_0xb7a1('0x65')]+=0x1;var _0x44ede4=_0x281a96['voiceQueues'][_0x12afb0['queue']];var _0x6356a8=new Hangup(_0x12afb0,_0x5b97e2);_0x6356a8['state']=0x13;_0x6356a8[_0xb7a1('0xf1')]=_0xb7a1('0xfb');_0x6356a8[_0xb7a1('0xf3')]=_0xb7a1('0xfc');_0x6356a8['countmachineretry']+=0x1;_0x6356a8[_0xb7a1('0xfd')]+=0x1;_0x6356a8[_0xb7a1('0xfe')]=!![];ami[_0xb7a1('0xf4')](_0xb7a1('0xf5'),ut[_0xb7a1('0xf6')](_0x6356a8,_0xb7a1('0xfe')));_0x281a96[_0xb7a1('0xd7')](_0x6356a8)[_0xb7a1('0xb8')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x6356a8[_0xb7a1('0xff')]+_0x6356a8['countcongestionretry']+_0x6356a8['countnoanswerretry']+_0x6356a8[_0xb7a1('0x100')]+_0x6356a8['countdropretry']+_0x6356a8[_0xb7a1('0x101')]+_0x6356a8['countmachineretry']+_0x6356a8[_0xb7a1('0x102')]>=_0x44ede4[_0xb7a1('0x103')]){_0x281a96[_0xb7a1('0x104')](_0x6356a8,_0x5c8eb0,_0x5aff83,'reason19\x20machine....');}else{if(_0x6356a8[_0xb7a1('0x105')]>=_0x44ede4[_0xb7a1('0x106')]){_0x281a96[_0xb7a1('0x107')](_0x6356a8,_0x5c8eb0,_0x5aff83,_0xb7a1('0x108'));}else{_0x281a96['rescheduleContact']({'active':![],'countmachineretry':_0x6356a8[_0xb7a1('0x105')],'scheduledat':moment()[_0xb7a1('0x109')](_0x44ede4[_0xb7a1('0x10a')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x6356a8[_0xb7a1('0xde')],'ListId':_0x6356a8[_0xb7a1('0xdf')],'VoiceQueueId':_0x6356a8[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x6356a8[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x10d')));_0x5c8eb0({'reschedule':0x1});}}});}if(_0x12afb0[_0xb7a1('0x5b')]===_0xb7a1('0x7e')&&this[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0xf9')]&&_0x5b97e2['value']===_0xb7a1('0xef')){delete this[_0xb7a1('0x29')][_0x5b97e2['uniqueid']];this[_0xb7a1('0xba')](this['campaigns'][_0x12afb0[_0xb7a1('0xbb')]]);_0x45445d=new Hangup(_0x12afb0,_0x5b97e2);_0x45445d[_0xb7a1('0xf0')]=0x12;_0x45445d['statedesc']='HangupInAMD';_0x45445d[_0xb7a1('0xf3')]=_0xb7a1('0xfc');ami[_0xb7a1('0xf4')]('custom:amd',ut[_0xb7a1('0xf6')](_0x45445d,'amd'));this[_0xb7a1('0xe8')](_0x45445d,_0xb7a1('0x10e'),'[syncHangupInAMDIvr]');}if(_0x12afb0[_0xb7a1('0x5b')]===_0xb7a1('0x7e')&&this[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]]['dialAMDActive']&&_0x5b97e2['value']==='MACHINE'){return new Promise(function(_0x1afadd,_0x4e8df1){delete _0x281a96['uniqueId'][_0x5b97e2[_0xb7a1('0xe9')]];_0x281a96['updateOriginated'](_0x281a96[_0xb7a1('0x23')][_0x12afb0['queue']]);_0x281a96[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;_0x281a96[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]][_0xb7a1('0x65')]+=0x1;var _0x5569be=_0x281a96[_0xb7a1('0x23')][_0x12afb0[_0xb7a1('0xbb')]];var _0x400ef8=new Hangup(_0x12afb0,_0x5b97e2);_0x400ef8[_0xb7a1('0xf0')]=0x13;_0x400ef8[_0xb7a1('0xf1')]=_0xb7a1('0xfb');_0x400ef8['membername']=_0xb7a1('0xfc');_0x400ef8[_0xb7a1('0x105')]+=0x1;_0x400ef8[_0xb7a1('0xfd')]+=0x1;_0x400ef8['amd']=!![];ami[_0xb7a1('0xf4')](_0xb7a1('0xf5'),ut[_0xb7a1('0xf6')](_0x400ef8,'amd'));_0x281a96[_0xb7a1('0xd7')](_0x400ef8)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x10f')));if(_0x400ef8[_0xb7a1('0xff')]+_0x400ef8[_0xb7a1('0x110')]+_0x400ef8['countnoanswerretry']+_0x400ef8['countnosuchnumberretry']+_0x400ef8[_0xb7a1('0x111')]+_0x400ef8['countabandonedretry']+_0x400ef8[_0xb7a1('0x105')]+_0x400ef8[_0xb7a1('0x102')]>=_0x5569be[_0xb7a1('0x103')]){_0x281a96['stateGlobal'](_0x400ef8,_0x1afadd,_0x4e8df1,_0xb7a1('0x112'));}else{if(_0x400ef8[_0xb7a1('0x105')]>=_0x5569be[_0xb7a1('0x106')]){_0x281a96[_0xb7a1('0x107')](_0x400ef8,_0x1afadd,_0x4e8df1,_0xb7a1('0x108'));}else{_0x281a96[_0xb7a1('0xca')]({'active':![],'countmachineretry':_0x400ef8[_0xb7a1('0x105')],'scheduledat':moment()[_0xb7a1('0x109')](_0x5569be[_0xb7a1('0x10a')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x400ef8[_0xb7a1('0xde')],'ListId':_0x400ef8['ListId'],'VoiceQueueId':_0x400ef8[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x400ef8[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x10d')));_0x1afadd({'reschedule':0x1});}}});}}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x38')]=function(_0x2138dc){var _0x22f11e=this['uniqueId'][_0x2138dc[_0xb7a1('0xe9')]];var _0x3df34f;if(_0x22f11e&&_0x22f11e[_0xb7a1('0x5b')]===_0xb7a1('0x7e')){delete this['uniqueId'][_0x2138dc[_0xb7a1('0xe9')]];this['updateOriginated'](this[_0xb7a1('0x23')][_0x22f11e[_0xb7a1('0xbb')]]);this[_0xb7a1('0x23')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x113')]+=0x1;_0x3df34f=new Hangup(_0x22f11e,_0x2138dc);this['createHistory'](_0x3df34f)['catch'](loggerCatch(_0xb7a1('0x114')));this[_0xb7a1('0xd5')](_0x3df34f)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x22f11e&&_0x22f11e[_0xb7a1('0x5b')]!==_0xb7a1('0x7e')&&isNotNull(this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x115')])){delete this[_0xb7a1('0x29')][_0x2138dc[_0xb7a1('0xe9')]];this['updateOriginated'](this['voiceQueues'][_0x22f11e[_0xb7a1('0xbb')]]);this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;this['voiceQueues'][_0x22f11e['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x3df34f=new Hangup(_0x22f11e,_0x2138dc);_0x3df34f[_0xb7a1('0xf0')]=0x10;_0x3df34f['statedesc']=_0xb7a1('0x116');_0x3df34f['membername']=_0xb7a1('0x117');this[_0xb7a1('0xd7')](_0x3df34f)['catch'](loggerCatch(_0xb7a1('0x114')));this['moveContactManagedDialer'](_0x3df34f)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x118')));}if(_0x22f11e&&_0x22f11e[_0xb7a1('0x5b')]!==_0xb7a1('0x7e')&&!isNotNull(this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x115')])){delete this[_0xb7a1('0x29')][_0x2138dc[_0xb7a1('0xe9')]];this[_0xb7a1('0xba')](this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]]);this[_0xb7a1('0x22')][_0x22f11e[_0xb7a1('0xbb')]][_0xb7a1('0x6d')]+=0x1;_0x3df34f=new Hangup(_0x22f11e,_0x2138dc);_0x3df34f['state']=0xc;_0x3df34f[_0xb7a1('0xf1')]=_0x2138dc[_0xb7a1('0x119')];_0x3df34f[_0xb7a1('0xf3')]=_0xb7a1('0x11a');this[_0xb7a1('0xd7')](_0x3df34f)[_0xb7a1('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x3df34f)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x118')));}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x34')]=function(_0x406e37){var _0x28f137=this[_0xb7a1('0x29')][_0x406e37[_0xb7a1('0xe9')]];if(this[_0xb7a1('0x22')][_0x406e37[_0xb7a1('0xbb')]]){if(_0x28f137&&_0x28f137[_0xb7a1('0x5b')]!==_0xb7a1('0x7e')){delete this[_0xb7a1('0x29')][_0x406e37[_0xb7a1('0xe9')]];this['voiceQueues'][_0x406e37[_0xb7a1('0xbb')]][_0xb7a1('0x66')]+=0x1;var _0x226282=new AgentComplete(_0x28f137,_0x406e37);if(_0x406e37[_0xb7a1('0x11b')]===_0xb7a1('0x11c')){_0x226282[_0xb7a1('0x11d')]=this['voiceQueues'][_0x406e37[_0xb7a1('0xbb')]][_0xb7a1('0x11e')]&&this[_0xb7a1('0x22')][_0x406e37['queue']][_0xb7a1('0x11f')]?moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c')):undefined;}this[_0xb7a1('0xd7')](_0x226282)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x120')));this[_0xb7a1('0xd5')](_0x226282)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x30')]=function(_0x2bce42){if(this[_0xb7a1('0x22')][_0x2bce42[_0xb7a1('0xbb')]]){if(this[_0xb7a1('0x29')][_0x2bce42[_0xb7a1('0xe9')]]&&this[_0xb7a1('0x29')][_0x2bce42['uniqueid']][_0xb7a1('0x5b')]!=='ivr'){this[_0xb7a1('0xba')](this[_0xb7a1('0x22')][_0x2bce42[_0xb7a1('0xbb')]]);this[_0xb7a1('0x29')][_0x2bce42['uniqueid']][_0xb7a1('0x121')]=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));}}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x122')]=function(_0x30b8b5,_0x1504a9){this[_0xb7a1('0xd7')](_0x30b8b5)['catch'](loggerCatch(_0xb7a1('0x120')));if(_0x1504a9==0x0){this[_0xb7a1('0xd5')](_0x30b8b5)[_0xb7a1('0xb8')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xb7a1('0x1f')]['syncQueueCallerAbandon']=function(_0x65189c){var _0xb7588f=this[_0xb7a1('0x29')][_0x65189c['uniqueid']];var _0x6cac1f=this;var _0x5d7dbe=![];var _0x14788d;var _0x4b1fb6;if(this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]]){if(_0xb7588f&&_0xb7588f[_0xb7a1('0x5b')]!=='ivr'){delete this['uniqueId'][_0x65189c[_0xb7a1('0xe9')]];this['updateOriginated'](this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]]);_0xb7588f['droptime']=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));var _0x1c2d11=new QueueCallerAbandon(_0xb7588f,_0x65189c);if(getSeconds(_0xb7588f[_0xb7a1('0x123')],_0xb7588f[_0xb7a1('0x124')])>=_0xb7588f[_0xb7a1('0x125')]){this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x86')]+=0x1;this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x126')]+=0x1;this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x70')]+=0x1;_0x1c2d11[_0xb7a1('0xf0')]=0xa;_0x1c2d11['statedesc']=_0xb7a1('0x127');_0x1c2d11['dropreason']=_0xb7a1('0x128');_0x1c2d11[_0xb7a1('0x11d')]=this[_0xb7a1('0x22')][_0x65189c['queue']][_0xb7a1('0x11e')]?moment()[_0xb7a1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x1c2d11[_0xb7a1('0x111')]+=0x1;_0x1c2d11[_0xb7a1('0xfd')]+=0x1;_0x14788d=this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x129')];_0x4b1fb6=this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x12a')];_0x6cac1f[_0xb7a1('0xc2')](_0x1c2d11,_0x1c2d11[_0xb7a1('0xf0')],_0xb7588f['voiceQueue'])[_0xb7a1('0xbf')](function(_0x50625c){_0x5d7dbe=_0x50625c['additional']==0x1;if(_0x1c2d11[_0xb7a1('0x111')]>=_0x6cac1f['voiceQueues'][_0x65189c[_0xb7a1('0xbb')]]['dialDropMaxRetry']){_0x6cac1f['queueCallerAbandonCreateState'](_0x1c2d11,_0x50625c[_0xb7a1('0x12b')]);}else{_0x6cac1f[_0xb7a1('0xca')]({'active':![],'countdropretry':_0x1c2d11['countdropretry'],'scheduledat':moment()[_0xb7a1('0x109')](_0x6cac1f['voiceQueues'][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x129')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0xb7588f['ContactId'],'ListId':_0xb7588f[_0xb7a1('0xdf')],'VoiceQueueId':_0xb7588f[_0xb7a1('0xe1')]||undefined,'CampaignId':_0xb7588f[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x12c')));var _0x2b79fd=new History(_0x1c2d11);_0x2b79fd[_0xb7a1('0xf0')]=0xa;_0x2b79fd[_0xb7a1('0xf1')]=_0xb7a1('0x127');_0x2b79fd[_0xb7a1('0xad')]=moment()[_0xb7a1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b79fd['endtime']=_0x2b79fd[_0xb7a1('0xad')];_0x2b79fd[_0xb7a1('0x12d')]=_0x1c2d11['calleridname'];_0x2b79fd[_0xb7a1('0x12e')]=_0x1c2d11[_0xb7a1('0x12e')];_0x6cac1f[_0xb7a1('0xd7')](_0x2b79fd)[_0xb7a1('0xb8')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})['then'](function(){if(_0x5d7dbe)_0x6cac1f[_0xb7a1('0xc4')](_0x1c2d11,_0x14788d,_0x4b1fb6)[_0xb7a1('0xbf')](function(){return 0x1;});});}else{this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x88')]+=0x1;this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x12f')]+=0x1;_0x1c2d11[_0xb7a1('0xf0')]=0xb;_0x1c2d11[_0xb7a1('0xf1')]='Abandoned';_0x1c2d11[_0xb7a1('0x130')]=_0xb7a1('0x131');_0x1c2d11['countabandonedretry']+=0x1;_0x1c2d11[_0xb7a1('0xfd')]+=0x1;_0x14788d=this[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]]['dialAbandonedRetryFrequency'];_0x4b1fb6=this[_0xb7a1('0x22')][_0x65189c['queue']][_0xb7a1('0x12a')];_0x6cac1f[_0xb7a1('0xc2')](_0x1c2d11,_0x1c2d11[_0xb7a1('0xf0')],_0xb7588f['voiceQueue'])[_0xb7a1('0xbf')](function(_0x5aa989){if(_0x1c2d11['countabandonedretry']>=_0x6cac1f[_0xb7a1('0x22')][_0x65189c['queue']][_0xb7a1('0x132')]){_0x6cac1f[_0xb7a1('0x122')](_0x1c2d11,_0x5aa989[_0xb7a1('0x12b')]);}else{_0x6cac1f[_0xb7a1('0xca')]({'active':![],'countabandonedretry':_0x1c2d11[_0xb7a1('0x101')],'scheduledat':moment()[_0xb7a1('0x109')](_0x6cac1f[_0xb7a1('0x22')][_0x65189c[_0xb7a1('0xbb')]][_0xb7a1('0x133')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0xb7588f[_0xb7a1('0xde')],'ListId':_0xb7588f[_0xb7a1('0xdf')],'VoiceQueueId':_0xb7588f[_0xb7a1('0xe1')]||undefined,'CampaignId':_0xb7588f[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x134')));var _0x594af6=new History(_0x1c2d11);_0x594af6['state']=0xb;_0x594af6[_0xb7a1('0xf1')]=_0xb7a1('0x135');_0x594af6[_0xb7a1('0xad')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x594af6[_0xb7a1('0xac')]=_0x594af6['starttime'];_0x594af6[_0xb7a1('0x12d')]=_0x1c2d11[_0xb7a1('0x12d')];_0x594af6[_0xb7a1('0x12e')]=_0x1c2d11[_0xb7a1('0x12e')];_0x6cac1f[_0xb7a1('0xd7')](_0x594af6)['catch'](loggerCatch(_0xb7a1('0x136')));}})[_0xb7a1('0xbf')](function(){if(_0x5d7dbe)_0x6cac1f[_0xb7a1('0xc4')](_0x1c2d11,_0x14788d,_0x4b1fb6)['then'](function(){return 0x1;});});}}}};Dialer[_0xb7a1('0x1f')]['syncNewExten']=function(_0x2ba43a){if(this['actions'][_0x2ba43a[_0xb7a1('0xe9')]]){this[_0xb7a1('0xb0')][_0x2ba43a[_0xb7a1('0xe9')]][_0xb7a1('0xb7')]=_0x2ba43a[_0xb7a1('0xb7')];}if(this[_0xb7a1('0x29')][_0x2ba43a['uniqueid']]){this['uniqueId'][_0x2ba43a[_0xb7a1('0xe9')]]['channel']=_0x2ba43a[_0xb7a1('0xb7')];}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x3e')]=function(_0x526201){if(strategy[this[_0xb7a1('0x22')][this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]][_0xb7a1('0xbb')]][_0xb7a1('0x52')]]===_0xb7a1('0x1e')){if(this[_0xb7a1('0xb0')][_0x526201['actionid']]&&_['isNil'](this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]][_0xb7a1('0x138')])&&_0x526201[_0xb7a1('0xb6')]==='1'&&_0x526201['paused']==='0'){if(this['agents'][_0x526201[_0xb7a1('0x139')]]){if(!this['agents'][_0x526201[_0xb7a1('0x139')]]['locked']){this[_0xb7a1('0x24')][_0x526201[_0xb7a1('0x139')]][_0xb7a1('0x138')]=!![];this[_0xb7a1('0xb0')][_0x526201['actionid']][_0xb7a1('0x138')]=!![];this['actions'][_0x526201[_0xb7a1('0x137')]]['stateinterface']=_0x526201['stateinterface'];}}}}else if((strategy[this[_0xb7a1('0x22')][this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]]['queue']][_0xb7a1('0x52')]]||_0xb7a1('0x1d'))===_0xb7a1('0x1d')){if(this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]]){if(this[_0xb7a1('0x24')][_0x526201[_0xb7a1('0x139')]]){this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]][_0xb7a1('0x139')]=_0x526201[_0xb7a1('0x139')];if(_[_0xb7a1('0xb4')](this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]]['queue']])){this['queueBooked'][this[_0xb7a1('0xb0')][_0x526201['actionid']][_0xb7a1('0xbb')]]=[];}this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x526201['actionid']][_0xb7a1('0xbb')]][_0xb7a1('0x13a')](_[_0xb7a1('0x94')](_['pick'](this[_0xb7a1('0xb0')][_0x526201[_0xb7a1('0x137')]],['idHopper','stateinterface']),{'status':_0x526201['status'],'paused':_0x526201[_0xb7a1('0x13b')]}));}}}};function unlockQueueStatus(_0x4f6ead,_0x45507a){setTimeout(function(){if(_[_0xb7a1('0x43')](_0x4f6ead[_0xb7a1('0x13c')])){loggerBooked[_0xb7a1('0x9f')](_0xb7a1('0x13d'),_0x45507a);}_0x4f6ead[_0xb7a1('0x13c')]=!![];loggerBooked[_0xb7a1('0x83')]('[booked][unlockQueueStatus]',_0x45507a,JSON[_0xb7a1('0x4d')](_['pick'](_0x4f6ead,['name',_0xb7a1('0x13c')])));},0x1f3);}Dialer[_0xb7a1('0x1f')]['syncQueueStatusComplete']=function(_0x4e4aad){var _0x2733fc=this;var _0x17b879=_0x2733fc[_0xb7a1('0x22')][_0x2733fc['actions'][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]];if(strategy[this['voiceQueues'][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]]['strategy']]==='roundrobin'){if(this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]]&&this['actions'][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0x139')]){this[_0xb7a1('0x99')]['run'](this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0x13e')],this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0x139')])[_0xb7a1('0xb8')](function(_0x4cae27){logger[_0xb7a1('0x9f')](_0xb7a1('0x13f'),util[_0xb7a1('0x9e')](_0x4cae27,{'showHidden':![],'depth':null}));})[_0xb7a1('0x21')](function(){_0x2733fc['updateOriginated'](_0x2733fc[_0xb7a1('0x22')][_0x2733fc[_0xb7a1('0xb0')][_0x4e4aad['actionid']]['queue']]);_0x2733fc[_0xb7a1('0x24')][_0x2733fc[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0x139')]][_0xb7a1('0x138')]=![];delete _0x2733fc[_0xb7a1('0xb0')][_0x4e4aad['actionid']];unlockQueueStatus(_0x17b879);});}else{this[_0xb7a1('0xba')](this[_0xb7a1('0x22')][this['actions'][_0x4e4aad['actionid']][_0xb7a1('0xbb')]]);this[_0xb7a1('0xca')]({'active':![],'ContactId':this[_0xb7a1('0xb0')][_0x4e4aad['actionid']][_0xb7a1('0xde')],'ListId':this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xdf')],'VoiceQueueId':this['actions'][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xe1')]||undefined,'CampaignId':this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x4e4aad['actionid']];unlockQueueStatus(_0x17b879);}}else if((strategy[this['voiceQueues'][this[_0xb7a1('0xb0')][_0x4e4aad['actionid']][_0xb7a1('0xbb')]][_0xb7a1('0x52')]]||_0xb7a1('0x1d'))===_0xb7a1('0x1d')){var _0x3c2988;if(this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]]&&!_[_0xb7a1('0x81')](this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]]['queue']])){if(this[_0xb7a1('0x140')][_0x2733fc[_0xb7a1('0xb0')][_0x4e4aad['actionid']][_0xb7a1('0xbb')]]){this['queueBookedRR'][_0x2733fc[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]]=this[_0xb7a1('0x140')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]]?this[_0xb7a1('0x140')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]]['queue']]:this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]]?this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]][_0xb7a1('0x141')]||0x0:0x0;}this[_0xb7a1('0x2e')][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]][_0xb7a1('0x141')]=this['queueBookedRR'][this[_0xb7a1('0xb0')][_0x4e4aad[_0xb7a1('0x137')]][_0xb7a1('0xbb')]];for(var _0xadb38a=0x0;_0xadb38a=0x0;})[_0xb7a1('0xb8')](myreject(_0x181fd)));}}else{_0x5b3628[_0xb7a1('0x13a')](ami[_0xb7a1('0xb5')]({'action':'command','command':util['format'](_0xb7a1('0x15f'),_0x4f720b,!_[_0xb7a1('0x43')](config[_0xb7a1('0x156')][_0x4096da])?_0x4096da:'')})[_0xb7a1('0xbf')](function(_0x51b6fd){return _0x51b6fd[_0xb7a1('0x15c')][_0xb7a1('0x15d')](_0xb7a1('0x15e'))>=0x0;})[_0xb7a1('0xb8')](myreject(_0x181fd)));}Promise['all'](_0x5b3628)[_0xb7a1('0xbf')](function(_0x162d84){var _0x15abcd=_['some'](_0x162d84);if(_0x15abcd){return _0x784e9b(_0x15abcd);}else{_0x3184a4[_0xb7a1('0x44')]=_0x17efd1?_0xb7a1('0x160'):'INTERVAL_IS_OVERTIME';return _0x181fd(msgResponse('[ifTime][promiseAll]',_0xb7a1('0x154'),_0xb7a1('0x161')+_0x17efd1+'\x20'+_0x25ee68+_0xb7a1('0x162')+util[_0xb7a1('0x9e')](_0x4f720b,{'showHidden':![],'depth':null})+_0xb7a1('0x163')+_0x4096da));}})[_0xb7a1('0xb8')](function(_0x5735eb){return _0x181fd(msgResponse(_0xb7a1('0x152'),'Failure',JSON['stringify'](_0x5735eb)));});});};Dialer[_0xb7a1('0x1f')]['checkDialMethod']=function(_0x4c7a76){var _0x110ba1=this;return function(){switch(_0x4c7a76['dialMethod']){case'progressive':freeVariablesPredictive(_0x4c7a76);_0x110ba1[_0xb7a1('0x164')](_0x4c7a76,0x1);break;case _0xb7a1('0x165'):freeVariablesPredictive(_0x4c7a76);_0x110ba1[_0xb7a1('0x164')](_0x4c7a76,_0x4c7a76['dialPowerLevel']);break;case _0xb7a1('0xa'):_0x110ba1['predictive'](_0x4c7a76);break;case _0xb7a1('0x9'):freeVariablesPredictive(_0x4c7a76);_0x110ba1[_0xb7a1('0x164')](_0x4c7a76,0x1);break;default:freeVariablesPredictive(_0x4c7a76);logger['error'](_0xb7a1('0x166'),_0x4c7a76['name'],'method\x20not\x20recognized');}};};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x167')]=function(_0x546fa2){return Promise[_0xb7a1('0xbe')]()['then'](cmHopper[_0xb7a1('0x168')](_0x546fa2['id'],previewRecallmeReminderInterval))['then'](function(_0x3fdda7){for(var _0xdc6908=0x0;_0xdc6908<_0x3fdda7[_0xb7a1('0xa0')];_0xdc6908++){var _0x5ade7b=_0x3fdda7[_0xdc6908][_0xb7a1('0x169')][_0xb7a1('0x45')];if(_0x5ade7b)io['to'](util[_0xb7a1('0x7c')]('user:%s',_0x5ade7b))[_0xb7a1('0xf4')](_0xb7a1('0x16a'),{'hopper':_0x3fdda7[_0xdc6908]});}})['catch'](function(){});};Dialer['prototype']['launchHandleIvr']=function(_0x463341){var _0x482e7d=this;return function(){_0x482e7d['handleIvr'](_0x463341);};};Dialer[_0xb7a1('0x1f')]['syncQueueSummary']=function(_0x3e2309){var _0x36fbb3=this;if(isNotPreview(_0x3e2309[_0xb7a1('0x61')])){if(isVoiceQueueOutbound(_0x3e2309[_0xb7a1('0x5b')])&&isActive(_0x3e2309['dialActive'])){_0x3e2309[_0xb7a1('0xa6')]=!![];Promise[_0xb7a1('0xbe')]()[_0xb7a1('0xbf')](checkIsLoggedIn(_0x3e2309,_0x3e2309['loggedIn']))[_0xb7a1('0xbf')](checkIsActive(_0x3e2309,_0x3e2309[_0xb7a1('0x60')]))['then'](checkInterval(_0x3e2309))[_0xb7a1('0xbf')](_0x36fbb3[_0xb7a1('0x16b')](_0x3e2309))[_0xb7a1('0xbf')](_0x36fbb3[_0xb7a1('0x151')](_0x3e2309[_0xb7a1('0x16c')],_0x3e2309[_0xb7a1('0x16d')],_0x3e2309[_0xb7a1('0x45')],_0x3e2309))[_0xb7a1('0xbf')](_0x36fbb3[_0xb7a1('0x153')](_0x3e2309[_0xb7a1('0x4b')],_0x3e2309[_0xb7a1('0x16d')],_0x3e2309['name'],_0x3e2309))[_0xb7a1('0xbf')](_0x36fbb3[_0xb7a1('0x16e')](_0x3e2309))[_0xb7a1('0xb8')](loggerCatchQueueSummary(_0xb7a1('0x16f'),_0x3e2309));}else{notSendMessagesQueue(_0x3e2309);}}else{freeVariablesPredictive(_0x3e2309);}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x37')]=_[_0xb7a1('0x170')](function(){var _0x349d60=_[_0xb7a1('0x171')](this['voiceQueues'],function(_0x114671){return _0x114671[_0xb7a1('0x172')];});var _0xaa6d27=_[_0xb7a1('0x171')](this[_0xb7a1('0x24')],function(_0x567944){return _0x567944['online']&&_0x567944[_0xb7a1('0xb6')]==='reachable';});if(_0x349d60[_0xb7a1('0xa0')]>0x0&&_0xaa6d27[_0xb7a1('0xa0')]>0x0){return Promise[_0xb7a1('0xbe')]()['then'](cmHopper[_0xb7a1('0x168')](_[_0xb7a1('0x173')](_0x349d60,'id'),previewRecallmeReminderInterval,_['map'](_0xaa6d27,'id')))['then'](function(_0x7c2d7c){for(var _0x285e81=0x0;_0x285e81<_0x7c2d7c[_0xb7a1('0xa0')];_0x285e81++){var _0x4e86b4=_0x7c2d7c[_0x285e81][_0xb7a1('0x169')][_0xb7a1('0x45')];if(_0x4e86b4)io['to'](util[_0xb7a1('0x7c')](_0xb7a1('0x174'),_0x4e86b4))['emit'](_0xb7a1('0x16a'),{'hopper':_0x7c2d7c[_0x285e81]});}})[_0xb7a1('0xb8')](function(_0x276898){logger[_0xb7a1('0x9f')]('checkPreviewRecallReminder',_0x276898);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xb7a1('0x1f')]['syncCampaigns']=function(){var _0x549bcb=this;var _0x3360e6;for(var _0xce845b in this[_0xb7a1('0x23')]){if(typeof this['campaigns'][_0xce845b]!==_0xb7a1('0xb1')){_0x3360e6=this['campaigns'][_0xce845b];if(isCampaignIvr(_0x3360e6[_0xb7a1('0x5b')])&&isActive(_0x3360e6[_0xb7a1('0x7a')])){_0x3360e6['sendMessageOneNotActive']=!![];Promise['resolve']()[_0xb7a1('0xbf')](checkIsActive(_0x3360e6,_0x3360e6['active']))[_0xb7a1('0xbf')](checkInterval(_0x3360e6))['then'](_0x549bcb['checkIsTrunkReachable'](_0x3360e6))[_0xb7a1('0xbf')](_0x549bcb[_0xb7a1('0x151')](_0x3360e6[_0xb7a1('0x16c')],_0x3360e6[_0xb7a1('0x16d')],_0x3360e6[_0xb7a1('0x45')],_0x3360e6))[_0xb7a1('0xbf')](_0x549bcb[_0xb7a1('0x153')](_0x3360e6[_0xb7a1('0x4b')],_0x3360e6[_0xb7a1('0x16d')],_0x3360e6[_0xb7a1('0x45')],_0x3360e6))['then'](_0x549bcb[_0xb7a1('0x175')](_0x3360e6))[_0xb7a1('0xb8')](loggerCatchQueueSummary(_0xb7a1('0x176'),_0x3360e6));}else{notSendMessagesCampaign(_0x3360e6);}}}};function getCallerIdRandom(_0x1f7f68,_0xeca4ee){var _0x27115e;var _0x219c7a;var _0x4b402b;if(_0xeca4ee<=0x0){_0xeca4ee=0x1;}_0x27115e=new RegExp(_0xb7a1('0x177')+_0xeca4ee+'}$');_0x219c7a=Math[_0xb7a1('0x178')](0xa,_0xeca4ee-0x1);_0x4b402b=Math[_0xb7a1('0x178')](0xa,_0xeca4ee)-0x1;return util[_0xb7a1('0x7c')]('%s',_[_0xb7a1('0x179')](_0x1f7f68,_0x27115e,_[_0xb7a1('0x17a')](_0x219c7a,_0x4b402b)));}function extractCalleridName(_0x1623f9){var _0x17ca43=_0x1623f9[_0xb7a1('0x17b')](/"(.*?)"/);return _0x17ca43?_0x17ca43[0x1]:_0x1623f9;}Dialer[_0xb7a1('0x1f')][_0xb7a1('0x17c')]=function(_0x210eff,_0x3b5ca0){var _0x33bf32=this;var _0x2c6545=uuid['v4']();this['actions'][_0x2c6545]=new Action(_0x210eff,_0x3b5ca0,_0x2c6545);return new Promise(function(_0x130cd0,_0x1d608a){if(_[_0xb7a1('0x43')](_0x210eff)&&typeof _0x210eff!==_0xb7a1('0x17d')){return _0x1d608a(msgResponse('originate',_0xb7a1('0x154'),_0xb7a1('0x17e')));}if(_[_0xb7a1('0x43')](_0x3b5ca0['phone'])||_0x3b5ca0[_0xb7a1('0x17f')]===null){return _0x1d608a(msgResponse('originate',_0xb7a1('0x154'),_0xb7a1('0x180')));}var _0x2dfc3d={'XMD-CALLERID':_0x33bf32[_0xb7a1('0xb0')][_0x2c6545][_0xb7a1('0x181')](),'XMD-AGI':_0x210eff[_0xb7a1('0x115')]?util[_0xb7a1('0x7c')](_0xb7a1('0x182'),ipAgi,_0x210eff[_0xb7a1('0x115')]):'NONE','XMD-AGIAFTER':_0x210eff['dialQueueProject2']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x210eff[_0xb7a1('0x11e')]):'NONE','XMD-QUEUE':_0x210eff['type']===_0xb7a1('0x51')?util[_0xb7a1('0x7c')](_0xb7a1('0x183'),_0x210eff['name'],_0x210eff['dialQueueOptions']||'',_0x210eff[_0xb7a1('0x11f')]?'c':'',_0x210eff[_0xb7a1('0x125')]||0x3):_0xb7a1('0x184'),'XMD-CONTACTID':_0x3b5ca0[_0xb7a1('0xde')],'XMD-CDRTYPE':_0xb7a1('0x8'),'CALLERID(all)':_0x33bf32['actions'][_0x2c6545][_0xb7a1('0x181')](),'XMD-AMD':_0x210eff[_0xb7a1('0xf9')]?_0xb7a1('0x185'):_0xb7a1('0x184'),'XMD-DESTINATION':_0xb7a1('0xed')};if(_0x210eff[_0xb7a1('0xf9')]){_0x2dfc3d[_0xb7a1('0x186')]=_0x210eff['dialAMDInitialSilence']||0x9c4;_0x2dfc3d['XMD-AMDGREETING']=_0x210eff[_0xb7a1('0x187')]||0x5dc;_0x2dfc3d[_0xb7a1('0x188')]=_0x210eff[_0xb7a1('0x189')]||0x320;_0x2dfc3d[_0xb7a1('0x18a')]=_0x210eff[_0xb7a1('0x18b')]||0x1388;_0x2dfc3d[_0xb7a1('0x18c')]=_0x210eff['dialAMDMinWordLength']||0x64;_0x2dfc3d[_0xb7a1('0x18d')]=_0x210eff[_0xb7a1('0x18e')]||0x32;_0x2dfc3d[_0xb7a1('0x18f')]=_0x210eff[_0xb7a1('0x190')]||0x3;_0x2dfc3d[_0xb7a1('0x191')]=_0x210eff[_0xb7a1('0x192')]||0x100;_0x2dfc3d['XMD-AMDMAXIMUMWORDLENGTH']=_0x210eff[_0xb7a1('0x193')]||0x1388;}if(_0x210eff[_0xb7a1('0x5b')]==='outbound'){_0x2dfc3d[_0xb7a1('0x194')]=_0x3b5ca0['VoiceQueueId'];}else{_0x2dfc3d[_0xb7a1('0x195')]=_0x3b5ca0['CampaignId'];}for(var _0x55b64e in _0x3b5ca0[_0xb7a1('0x196')]){if(typeof _0x3b5ca0[_0xb7a1('0x196')][_0x55b64e]!==_0xb7a1('0xb1')){if(isNotNull(_0x3b5ca0['Contact'][_0x55b64e])&&_0x55b64e!=='id'&&_0x55b64e!==_0xb7a1('0x197')&&_0x55b64e!==_0xb7a1('0x198')&&_0x55b64e!==_0xb7a1('0x199')){_0x2dfc3d[util['format'](_0xb7a1('0x19a'),_0xb7a1('0x19b'),_[_0xb7a1('0x19c')](_0x55b64e))]=_0x3b5ca0['Contact'][_0x55b64e];}}}var _0x1bf5eb=_0x33bf32['isTrunkReachable'](_0x210eff['Trunk'])?getCallerId(_0x210eff[_0xb7a1('0x79')]['callerid'],_0x210eff[_0xb7a1('0x62')],_0x210eff[_0xb7a1('0x19d')]>0x0?getCallerIdRandom(_0x210eff[_0xb7a1('0x63')],_0x210eff['dialRandomLastDigitCallerIdNumber']):_0x210eff[_0xb7a1('0x63')]):getCallerId(_[_0xb7a1('0xb4')](_0x210eff[_0xb7a1('0x14e')])?_0x210eff[_0xb7a1('0x79')]['callerid']:_0x210eff[_0xb7a1('0x14e')][_0xb7a1('0x7b')],_0x210eff[_0xb7a1('0x62')],_0x210eff[_0xb7a1('0x19d')]>0x0?getCallerIdRandom(_0x210eff['dialOriginateCallerIdNumber'],_0x210eff[_0xb7a1('0x19d')]):_0x210eff[_0xb7a1('0x63')]);if(_0x1bf5eb){_0x2dfc3d[_0xb7a1('0x19e')]=_0x33bf32[_0xb7a1('0xb0')][_0x2c6545]['originatecalleridname']=extractCalleridName(_0x1bf5eb);_0x2dfc3d[_0xb7a1('0x19f')]=_0x3b5ca0[_0xb7a1('0x17f')];}_0x210eff[_0xb7a1('0x1a0')]=_0x2dfc3d;return ami[_0xb7a1('0xb5')]({'actionid':_0x2c6545,'action':'originate','channel':_0x33bf32['isTrunkReachable'](_0x210eff[_0xb7a1('0x79')])?util[_0xb7a1('0x7c')]('SIP/%s/%s%s',_0x210eff[_0xb7a1('0x79')][_0xb7a1('0x45')],isNotNull(_0x210eff[_0xb7a1('0x1a1')])?_0x210eff[_0xb7a1('0x1a1')][_0xb7a1('0x1a2')]()||'':'',_0x210eff['dialCutDigit']>0x0?_0x3b5ca0[_0xb7a1('0x17f')][_0xb7a1('0x1a3')](_0x210eff[_0xb7a1('0x1a4')]):_0x3b5ca0['phone']):util[_0xb7a1('0x7c')](_0xb7a1('0x1a5'),_[_0xb7a1('0xb4')](_0x210eff[_0xb7a1('0x14e')])?_0x210eff['Trunk'][_0xb7a1('0x45')]:_0x210eff[_0xb7a1('0x14e')]['name'],isNotNull(_0x210eff['dialPrefix'])?_0x210eff[_0xb7a1('0x1a1')][_0xb7a1('0x1a2')]()||'':'',_0x210eff[_0xb7a1('0x1a4')]>0x0?_0x3b5ca0[_0xb7a1('0x17f')][_0xb7a1('0x1a3')](_0x210eff[_0xb7a1('0x1a4')]):_0x3b5ca0[_0xb7a1('0x17f')]),'callerid':_0x1bf5eb,'Exten':_0xb7a1('0xed'),'Context':_0xb7a1('0x1a6'),'Priority':'1','variable':_0x2dfc3d,'timeout':(_0x210eff[_0xb7a1('0x64')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c6545})[_0xb7a1('0xbf')](function(_0x255b91){return _0x130cd0(_0x255b91);})[_0xb7a1('0xb8')](function(_0x41e859){_0x210eff[_0xb7a1('0x6b')]+=0x1;var _0x8849a6=new History(_0x33bf32[_0xb7a1('0xb0')][_0x2c6545]);logger[_0xb7a1('0x9f')](util[_0xb7a1('0x7c')](_0xb7a1('0x1a7'),JSON[_0xb7a1('0x4d')](_0x41e859)));_0x8849a6[_0xb7a1('0xf0')]=0xe;_0x8849a6[_0xb7a1('0xf1')]='OriginateError';_0x8849a6[_0xb7a1('0xad')]=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));_0x8849a6[_0xb7a1('0xac')]=_0x8849a6[_0xb7a1('0xad')];_0x33bf32[_0xb7a1('0xd7')](_0x8849a6)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1a8')));_0x33bf32[_0xb7a1('0xd5')](_0x8849a6)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1a8')))[_0xb7a1('0x21')](function(){delete _0x33bf32['actions'][_0x2c6545];return _0x1d608a(msgResponse(_0xb7a1('0x1a9'),_0xb7a1('0x1aa'),_0xb7a1('0x1ab')));});});});};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x33')]=function(_0x3e65b2){var _0x355023=this[_0xb7a1('0xb0')][_0x3e65b2[_0xb7a1('0x137')]];if(_0x355023){delete this['actions'][_0x3e65b2[_0xb7a1('0x137')]];_0x355023[_0xb7a1('0x124')]=moment()['format'](_0xb7a1('0x10c'));var _0x54acf2=_0x355023[_0xb7a1('0x5b')]===_0xb7a1('0x7e')?this[_0xb7a1('0x23')][_0x355023['queue']]:this[_0xb7a1('0x22')][_0x355023[_0xb7a1('0x1ac')]()];if(!this[_0xb7a1('0xe4')](_0x3e65b2[_0xb7a1('0x1ad')])){this['updateOriginated'](_0x54acf2);return this['callProgressDetecting'](_0x355023,_0x54acf2,_0x3e65b2)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1ae')));}this[_0xb7a1('0x29')][_0x3e65b2[_0xb7a1('0xe9')]]=_0x355023;}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x1af')]=function(_0x1bc58b,_0x552f2e,_0x1cc41b){var _0x2afacf=new History(_0x552f2e);if(_0x2afacf['countbusyretry']+_0x2afacf['countcongestionretry']+_0x2afacf[_0xb7a1('0x1b0')]+_0x2afacf[_0xb7a1('0x100')]+_0x2afacf[_0xb7a1('0x111')]+_0x2afacf[_0xb7a1('0x101')]+_0x2afacf[_0xb7a1('0x105')]+_0x2afacf[_0xb7a1('0x102')]>=_0x1cc41b[_0xb7a1('0x103')]-0x1){return!![];}switch(_0x1bc58b){case 0x3:if(_0x2afacf[_0xb7a1('0x1b0')]>=_0x1cc41b['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x2afacf[_0xb7a1('0x1b0')]+=0x1,'scheduledat':moment()['add'](_0x1cc41b[_0xb7a1('0x1b1')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf['ListId'],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x2afacf[_0xb7a1('0xff')]>=_0x1cc41b[_0xb7a1('0x1b2')]-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countbusyretry':_0x2afacf['countbusyretry']+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x1b3')],_0xb7a1('0x10b'))['format'](_0xb7a1('0x10c')),'ContactId':_0x2afacf[_0xb7a1('0xde')],'ListId':_0x2afacf[_0xb7a1('0xdf')],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})['catch'](loggerCatch(_0xb7a1('0x1b4')));break;case 0x8:if(_0x2afacf['countcongestionretry']>=_0x1cc41b[_0xb7a1('0x1b5')]-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countcongestionretry':_0x2afacf[_0xb7a1('0x110')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x1b6')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf[_0xb7a1('0xdf')],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf['CampaignId']||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1b7')));break;case 0x0:if(_0x2afacf[_0xb7a1('0x100')]>=_0x1cc41b[_0xb7a1('0x1b8')]-0x1){return!![];}else{this[_0xb7a1('0xca')]({'active':![],'countnosuchnumberretry':_0x2afacf['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x1b9')],'minutes')['format'](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf['ListId'],'VoiceQueueId':_0x2afacf['VoiceQueueId']||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1ba')));}break;case 0xa:if(_0x2afacf['countdropretry']>=_0x1cc41b['dialDropMaxRetry']-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countdropretry':_0x2afacf[_0xb7a1('0x111')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x129')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf[_0xb7a1('0xdf')],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x12c')));break;case 0xb:if(_0x2afacf['countabandonedretry']>=_0x1cc41b[_0xb7a1('0x132')]-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countabandonedretry':_0x2afacf[_0xb7a1('0x101')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x133')],_0xb7a1('0x10b'))['format'](_0xb7a1('0x10c')),'ContactId':_0x2afacf[_0xb7a1('0xde')],'ListId':_0x2afacf['ListId'],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})['catch'](loggerCatch(_0xb7a1('0x134')));break;case 0x13:if(_0x2afacf[_0xb7a1('0x105')]>=_0x1cc41b[_0xb7a1('0x106')]-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countmachineretry':_0x2afacf[_0xb7a1('0x105')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x10a')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf['ContactId'],'ListId':_0x2afacf['ListId'],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})['catch'](loggerCatch(_0xb7a1('0x10d')));break;case 0x14:if(_0x2afacf[_0xb7a1('0x102')]>=_0x1cc41b['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xb7a1('0xca')]({'active':![],'countagentrejectretry':_0x2afacf[_0xb7a1('0x102')]+=0x1,'scheduledat':moment()[_0xb7a1('0x109')](_0x1cc41b[_0xb7a1('0x1bb')],_0xb7a1('0x10b'))[_0xb7a1('0x7c')](_0xb7a1('0x10c')),'ContactId':_0x2afacf[_0xb7a1('0xde')],'ListId':_0x2afacf[_0xb7a1('0xdf')],'VoiceQueueId':_0x2afacf[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2afacf[_0xb7a1('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x1bc')]=function(_0x353a51,_0x28bc7c,_0x5b3e53){var _0x253ef1=this;var _0x10af47=new History(_0x353a51);var _0x14bda9=![];var _0x42bd07;var _0x37bade;return new Promise(function(_0x5697de,_0x2a531f){if(_[_0xb7a1('0x43')](_0x28bc7c)&&typeof _0x28bc7c!==_0xb7a1('0x17d')){return _0x2a531f(msgResponse(_0xb7a1('0x1bd'),_0xb7a1('0x154'),_0xb7a1('0x1be')));}if(_['isUndefined'](_0x5b3e53)&&typeof _0x5b3e53!==_0xb7a1('0x17d')){return _0x2a531f(msgResponse(_0xb7a1('0x1bd'),_0xb7a1('0x154'),'evt\x20is\x20undefine'));}_0x253ef1[_0xb7a1('0xc2')](_0x10af47,_0x5b3e53[_0xb7a1('0x11b')],_0x28bc7c)['then'](function(_0x198104){if(_0x198104[_0xb7a1('0x12b')]==0x1)_0x14bda9=!![];switch(_0x5b3e53[_0xb7a1('0x11b')]){case'0':_0x28bc7c[_0xb7a1('0x6a')]+=0x1;_0x10af47[_0xb7a1('0xf0')]=0x0;_0x10af47[_0xb7a1('0xf1')]=_0xb7a1('0x1bf');_0x10af47['countnosuchnumberretry']+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;ami[_0xb7a1('0xf4')](_0xb7a1('0x1c0'),ut[_0xb7a1('0xf6')](_0x353a51,_0xb7a1('0x1c1')));_0x42bd07=_0x28bc7c[_0xb7a1('0x1b9')];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x10f')));if(_0x253ef1[_0xb7a1('0x1af')](0x0,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0x100')]>=_0x28bc7c[_0xb7a1('0x1b8')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,'reason\x200\x20no\x20such\x20number....');}else{_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1c2'));}}break;case'3':_0x28bc7c[_0xb7a1('0x69')]+=0x1;_0x10af47[_0xb7a1('0xf0')]=0x3;_0x10af47[_0xb7a1('0xf1')]=_0xb7a1('0x1c3');_0x10af47[_0xb7a1('0x1b0')]+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;var _0x22ed66=ut[_0xb7a1('0x1c4')](_0x353a51,_0x28bc7c);ami[_0xb7a1('0xf4')](_0xb7a1('0x1c5'),_0x22ed66);_0x42bd07=_0x28bc7c[_0xb7a1('0x1b1')];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];_0x253ef1['createHistory'](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1c6')));if(_0x253ef1[_0xb7a1('0x1af')](0x3,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0x1b0')]>=_0x28bc7c[_0xb7a1('0x1c7')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1c8'));}else{_0x253ef1['stateGlobal'](_0x10af47,_0x5697de,_0x2a531f,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x28bc7c['outboundBusyCallsDay']+=0x1;_0x10af47['state']=0x5;_0x10af47[_0xb7a1('0xf1')]=_0xb7a1('0x1c9');_0x10af47[_0xb7a1('0xff')]+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;ami[_0xb7a1('0xf4')]('custom:agentbusy',ut[_0xb7a1('0xf6')](_0x353a51,_0xb7a1('0x1ca')));_0x42bd07=_0x28bc7c[_0xb7a1('0x1b3')];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1cb')));if(_0x253ef1[_0xb7a1('0x1af')](0x5,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0xff')]>=_0x28bc7c[_0xb7a1('0x1b2')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1cc'));}else{_0x253ef1['stateGlobal'](_0x10af47,_0x5697de,_0x2a531f,'reason\x205\x20busy');}}break;case'8':_0x28bc7c[_0xb7a1('0x1cd')]+=0x1;_0x10af47[_0xb7a1('0xf0')]=0x8;_0x10af47[_0xb7a1('0xf1')]=_0xb7a1('0x1ce');_0x10af47['countcongestionretry']+=0x1;_0x10af47['countglobal']+=0x1;_0x42bd07=_0x28bc7c[_0xb7a1('0x1b6')];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];ami['emit']('custom:agentcongestion',ut[_0xb7a1('0xf6')](_0x353a51,_0xb7a1('0x1cf')));_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1d0')));if(_0x253ef1['checkRetriveMax'](0x8,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0x110')]>=_0x28bc7c[_0xb7a1('0x1b5')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,'reason\x208\x20congestion');}else{_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d1'));}}break;case'11':_0x28bc7c[_0xb7a1('0x1d2')]+=0x1;_0x10af47[_0xb7a1('0xf0')]=0xb;_0x10af47[_0xb7a1('0xf1')]='Abandoned';_0x10af47[_0xb7a1('0x101')]+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;_0x42bd07=_0x28bc7c[_0xb7a1('0x133')];_0x37bade=_0x28bc7c['callAdditionalPhoneAfterMin'];_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x253ef1[_0xb7a1('0x1af')](0xb,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47['countabandonedretry']>=_0x28bc7c[_0xb7a1('0x132')]){_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d3'));}else{_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d3'));}}break;case'20':_0x28bc7c['outboundRejectCallsDay']+=0x1;_0x10af47[_0xb7a1('0xf0')]=0x14;_0x10af47['statedesc']='AgentReject';_0x10af47['countagentrejectretry']+=0x1;_0x10af47[_0xb7a1('0xfd')]+=0x1;_0x42bd07=_0x28bc7c['dialAgentRejectRetryFrequency'];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];ami['emit'](_0xb7a1('0x1d4'),ut[_0xb7a1('0xf6')](_0x353a51,_0xb7a1('0x1d5')));_0x253ef1[_0xb7a1('0xd7')](_0x10af47)['catch'](loggerCatch(_0xb7a1('0x1d6')));if(_0x253ef1['checkRetriveMax'](0x14,_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47[_0xb7a1('0x102')]>=_0x28bc7c['dialAgentRejectMaxRetry']){_0x253ef1['createStateFinal'](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d7'));}else{_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0xb7a1('0x1d7'));}}break;default:_0x28bc7c['outboundUnknownCallsDay']+=0x1;_0x10af47[_0xb7a1('0xf0')]=0xc;_0x10af47['statedesc']=_0x5b3e53[_0xb7a1('0x11b')];_0x42bd07=_0x28bc7c['dialAgentRejectRetryFrequency'];_0x37bade=_0x28bc7c[_0xb7a1('0x12a')];_0x253ef1[_0xb7a1('0xd7')](_0x10af47)[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x1d8')));if(_0x253ef1[_0xb7a1('0x1af')](_0x5b3e53[_0xb7a1('0x11b')],_0x353a51,_0x28bc7c)&&!_0x14bda9){if(_0x10af47['countbusyretry']+_0x10af47['countcongestionretry']+_0x10af47[_0xb7a1('0x1b0')]+_0x10af47[_0xb7a1('0x100')]+_0x10af47[_0xb7a1('0x111')]+_0x10af47[_0xb7a1('0x101')]+_0x10af47[_0xb7a1('0x105')]+_0x10af47[_0xb7a1('0x102')]>=_0x28bc7c[_0xb7a1('0x103')]){_0x253ef1[_0xb7a1('0x104')](_0x10af47,_0x5697de,_0x2a531f,_0x5b3e53[_0xb7a1('0x11b')]);}else{_0x253ef1[_0xb7a1('0x107')](_0x10af47,_0x5697de,_0x2a531f,_0x5b3e53['reason']);}}}})[_0xb7a1('0xbf')](function(){if(_0x14bda9){_0x253ef1[_0xb7a1('0xc4')](_0x10af47,_0x42bd07,_0x37bade)[_0xb7a1('0xbf')](function(){return _0x5697de(0x1);});}});});};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x104')]=function(_0x21aa36,_0x28ec83,_0x3ad132,_0x5237db){var _0x255821=new Final(_0x21aa36);_0x255821[_0xb7a1('0xf0')]=0xf;_0x255821[_0xb7a1('0xf1')]=_0xb7a1('0x1d9');this['createStateFinal'](_0x255821,_0x28ec83,_0x3ad132,_0x5237db);};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x107')]=function(_0x52a01d,_0x47a339,_0xbf8428,_0x4b57bf){this['moveContactManagedDialer'](_0x52a01d)[_0xb7a1('0xbf')](function(){return _0x47a339(msgResponse('[callProgressDetecting]',_0xb7a1('0xe5'),_0x4b57bf));})[_0xb7a1('0xb8')](function(){return _0xbf8428(msgResponse(_0xb7a1('0x1da'),_0xb7a1('0x154'),_0xb7a1('0x1db')));});};Dialer[_0xb7a1('0x1f')][_0xb7a1('0xa')]=function(_0x21928f){var _0x1cde4c=_0x21928f[_0xb7a1('0x1dc')]/0x64;var _0xabb35b=_0x21928f['outboundDropCallsDayTimeout']/(_0x21928f[_0xb7a1('0x126')]+_0x21928f[_0xb7a1('0x66')]);var _0x235d95=Math['round'](_0x21928f[_0xb7a1('0x74')]*(_0x21928f[_0xb7a1('0x1dd')]/0x64));var _0x31f83d=Math[_0xb7a1('0x1de')](_0x21928f[_0xb7a1('0x74')]*(_0x21928f[_0xb7a1('0x1df')]/0x64));var _0x3769d7=_0x21928f[_0xb7a1('0x54')]+_0x21928f['talking'];var _0x4ebf46=Math[_0xb7a1('0x1e0')](_0x21928f[_0xb7a1('0x76')]*_0x21928f[_0xb7a1('0x77')]*_0x21928f[_0xb7a1('0x71')]*_0x21928f[_0xb7a1('0x72')]);if(_[_0xb7a1('0x43')](_0x21928f[_0xb7a1('0x2c')])){if(!_['isUndefined'](_0x21928f[_0xb7a1('0x2b')])){_0x21928f['startPredictive']=undefined;loggerPredictive[_0xb7a1('0x9f')](_0xb7a1('0x1e1'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x21928f[_0xb7a1('0x97')])){loggerPredictive[_0xb7a1('0x9f')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x21928f[_0xb7a1('0x97')]);_0x21928f[_0xb7a1('0x97')]=undefined;}_0x21928f[_0xb7a1('0x2c')]=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));loggerPredictive[_0xb7a1('0x83')](_0x21928f[_0xb7a1('0x45')],_0xb7a1('0x1e2'),_0x21928f[_0xb7a1('0x2c')]);this[_0xb7a1('0x164')](_0x21928f,0x1);}else if(ifInterval(_0x21928f['dialPredictiveInterval'],_0x21928f[_0xb7a1('0x2c')])){this[_0xb7a1('0x164')](_0x21928f,0x1);loggerPredictiveCalls[_0xb7a1('0x83')](_0xb7a1('0x1e3'),_0x21928f[_0xb7a1('0x2c')],_0x21928f[_0xb7a1('0x45')]);_0x21928f['erlangCalls']=0x0;_0x21928f[_0xb7a1('0x70')]=0x0;}else if(_0x1cde4c<_0xabb35b&&_0x21928f['dialPredictiveOptimization']===_0xb7a1('0x1e4')){freeVariablesPredictive(_0x21928f);loggerPredictive['info'](_0xb7a1('0x1e5'),_0xb7a1('0x1e6'),_0xabb35b,_0xb7a1('0x2c'),_0x21928f[_0xb7a1('0x45')]);}else if(_0x4ebf46<_0x21928f['predictiveIntervalErlangCallsDroppedCalls']&&_0x21928f[_0xb7a1('0x1e7')]===_0xb7a1('0x1e4')){freeVariablesPredictive(_0x21928f);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x1e8'),_0xb7a1('0x1e9'),_0x4ebf46,_0xb7a1('0x1ea'),_0x21928f['predictiveIntervalErlangCallsDroppedCalls'],_0xb7a1('0x2c'),_0x21928f[_0xb7a1('0x45')]);}else if(!ifInterval(_0x21928f['dialPredictiveInterval'],_0x21928f[_0xb7a1('0x2c')])&&_[_0xb7a1('0x43')](_0x21928f[_0xb7a1('0x2b')])&&!_['isUndefined'](_0x21928f[_0xb7a1('0x2c')])){_0x21928f[_0xb7a1('0x2b')]=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));loggerPredictive[_0xb7a1('0x83')](_0x21928f[_0xb7a1('0x45')],_0xb7a1('0x1eb'),_0x21928f[_0xb7a1('0x2b')]);this[_0xb7a1('0xc8')](_0x21928f[_0xb7a1('0x1ec')])[_0xb7a1('0xbf')](this[_0xb7a1('0x1ed')](_0x21928f))[_0xb7a1('0xbf')](mergeDataErlangB(_0x21928f))['then'](this[_0xb7a1('0x1ee')](_0x21928f))['catch'](loggerCatchPredictive(_0xb7a1('0x1ef'),_0x21928f));}else if(!ifInterval(_0x21928f['dialPredictiveInterval'],_0x21928f[_0xb7a1('0x2b')])){_0x21928f[_0xb7a1('0x70')]=0x0;_0x21928f['startPredictive']=moment()[_0xb7a1('0x7c')](_0xb7a1('0x10c'));loggerPredictive[_0xb7a1('0x83')](_0x21928f[_0xb7a1('0x45')],'recalculate\x20predictive\x20at',_0x21928f[_0xb7a1('0x2b')]);clearInterval(_0x21928f['handlePredictive']);_0x21928f[_0xb7a1('0x97')]=undefined;this[_0xb7a1('0xc8')](_0x21928f[_0xb7a1('0x1ec')])[_0xb7a1('0xbf')](this['getDataPredictive'](_0x21928f))[_0xb7a1('0xbf')](mergeDataErlangB(_0x21928f))[_0xb7a1('0xbf')](this[_0xb7a1('0x1ee')](_0x21928f))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x21928f));}else if(_0x21928f[_0xb7a1('0x74')]&&_0x3769d7<_0x21928f[_0xb7a1('0x74')]-_0x31f83d){freeVariablesPredictive(_0x21928f);loggerPredictive[_0xb7a1('0x83')](_0x21928f['name'],_0xb7a1('0x1f0'),_0x3769d7,_0xb7a1('0x1f1'),_0x21928f[_0xb7a1('0x74')],'-',_0x31f83d,'=',_0x21928f['predictiveIntervalAvailable']-_0x31f83d,')');}else if(_0x21928f['predictiveIntervalAvailable']&&_0x3769d7>_0x21928f[_0xb7a1('0x74')]+_0x235d95){freeVariablesPredictive(_0x21928f);loggerPredictive[_0xb7a1('0x83')](_0x21928f['name'],_0xb7a1('0x1f0'),_0x3769d7,_0xb7a1('0x1f2'),_0x21928f['predictiveIntervalAvailable'],'+',_0x235d95,'=',_0x21928f[_0xb7a1('0x74')]+_0x235d95,')');}};Dialer[_0xb7a1('0x1f')]['getDataPredictive']=function(_0x57d7dd){var _0xcc9d27=this;return function(_0x55b003){return new Promise(function(_0x46b842,_0x36c3e3){_[_0xb7a1('0x94')](_0x57d7dd,_0x55b003[0x0]);if(checkGetDataPredictive(_0x55b003[0x0])){var _0x1f2657=_0x57d7dd[_0xb7a1('0x74')]=_0x57d7dd[_0xb7a1('0x59')]+_0x57d7dd[_0xb7a1('0x54')];var _0x2472c6=_0x57d7dd[_0xb7a1('0x1ec')]*0x3c;var _0x53c412=_0x55b003[0x0]['predictiveIntervalAvgTalktime']+_0x55b003[0x0][_0xb7a1('0x8a')];var _0x16bdbf=(_0x55b003[0x0][_0xb7a1('0x6e')]+_0x55b003[0x0][_0xb7a1('0x86')]+_0x55b003[0x0][_0xb7a1('0x88')])/_0x55b003[0x0][_0xb7a1('0x85')];_0x57d7dd['predictiveIntervalHitRate']=_0x16bdbf>0x0?_0x16bdbf:0x1;switch(_0x57d7dd[_0xb7a1('0x1e7')]){case _0xb7a1('0x1e4'):var _0xca79e0=_0x57d7dd[_0xb7a1('0x1dc')]/0x64;return _0xcc9d27[_0xb7a1('0x1f3')](_0x1f2657,_0x2472c6,_0x53c412,_0x16bdbf,_0xca79e0)[_0xb7a1('0xbf')](function(_0x32950d){return _0x46b842(_0x32950d);});case _0xb7a1('0x1f4'):var _0x1312d1=_0x57d7dd['dialPredictiveOptimizationPercentage']/0x64;return _0xcc9d27[_0xb7a1('0x1f5')](_0x1f2657,_0x2472c6,_0x53c412,_0x16bdbf,_0x1312d1)[_0xb7a1('0xbf')](function(_0x2ff5fb){return _0x46b842(_0x2ff5fb);});default:return _0x36c3e3(msgResponse(_0xb7a1('0x1f6'),_0xb7a1('0x154'),'Unknown\x20Predictive'));}}else{return _0x36c3e3(msgResponse(_0xb7a1('0x1f6'),_0xb7a1('0x154'),_0xb7a1('0x1f7')));}});};};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x1f8')]=function(_0x212720){var _0x450a75=this;return function(_0x2db7dc){return new Promise(function(_0x477e71,_0x20b952){_[_0xb7a1('0x94')](_0x212720,_0x2db7dc[0x0]);if(checkGetDataPredictive(_0x2db7dc[0x0])){loggerPredictive[_0xb7a1('0x83')](JSON[_0xb7a1('0x4d')](_0x2db7dc[0x0]));if(_0x212720['dialPredictiveOptimization']==='dropRate'){return _0x450a75['getVoiceQueueRtPauses'](_0x212720['id'])[_0xb7a1('0xbf')](function(_0x1c5cc2){var _0x217d5b=_0x212720['loggedIn']-_0x1c5cc2[0x0][_0xb7a1('0x1f9')];var _0x24b547=_0x212720['dialPredictiveInterval']*0x3c;var _0x5aec4f=_0x2db7dc[0x0][_0xb7a1('0x6f')]+_0x2db7dc[0x0]['predictiveIntervalAvgHoldtime'];var _0x266ee3=(_0x2db7dc[0x0][_0xb7a1('0x6e')]+_0x2db7dc[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2db7dc[0x0][_0xb7a1('0x88')])/_0x2db7dc[0x0][_0xb7a1('0x85')];var _0x382dad=_0x212720[_0xb7a1('0x1dc')]/0x64;_0x212720[_0xb7a1('0x73')]=_0x1c5cc2[0x0][_0xb7a1('0x1f9')]||0x0;_0x212720[_0xb7a1('0x71')]=_0x266ee3>0x0?_0x266ee3:0x1;return _0x450a75[_0xb7a1('0x1f3')](_0x217d5b,_0x24b547,_0x5aec4f,_0x266ee3,_0x382dad);})[_0xb7a1('0xbf')](function(_0x2ccfc8){return _0x477e71(_0x2ccfc8);})[_0xb7a1('0xb8')](function(_0x2d4e29){return _0x20b952(msgResponse(_0xb7a1('0x1fa'),_0xb7a1('0x154'),JSON[_0xb7a1('0x4d')](_0x2d4e29)));});}if(_0x212720['dialPredictiveOptimization']===_0xb7a1('0x1f4')){return _0x450a75['getVoiceQueueRtPauses'](_0x212720['id'])[_0xb7a1('0xbf')](function(_0x226988){var _0x1523e8=_0x212720['loggedIn']-_0x226988[0x0]['outboundQueuePauses'];var _0x4ceb7e=_0x212720[_0xb7a1('0x1ec')]*0x3c;var _0x4a81b3=_0x2db7dc[0x0][_0xb7a1('0x6f')]+_0x2db7dc[0x0]['predictiveIntervalAvgHoldtime'];var _0x47edf0=(_0x2db7dc[0x0][_0xb7a1('0x6e')]+_0x2db7dc[0x0][_0xb7a1('0x86')]+_0x2db7dc[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2db7dc[0x0][_0xb7a1('0x85')];var _0x3c096d=_0x212720[_0xb7a1('0x1dc')]/0x64;_0x212720['predictiveIntervalPauses']=_0x226988[0x0][_0xb7a1('0x1f9')]||0x0;_0x212720[_0xb7a1('0x71')]=_0x47edf0>0x0?_0x47edf0:0x1;return _0x450a75[_0xb7a1('0x1f5')](_0x1523e8,_0x4ceb7e,_0x4a81b3,_0x47edf0,_0x3c096d);})[_0xb7a1('0xbf')](function(_0x15cf6e){return _0x477e71(_0x15cf6e);})[_0xb7a1('0xb8')](function(_0x3abbc2){return _0x20b952(msgResponse(_0xb7a1('0x1fa'),_0xb7a1('0x154'),JSON[_0xb7a1('0x4d')](_0x3abbc2)));});}}else{return _0x20b952(msgResponse(_0xb7a1('0x1f6'),_0xb7a1('0x154'),_0xb7a1('0x1f7')));}});};};Dialer[_0xb7a1('0x1f')]['startMethodPredictive']=function(_0xe5a97){var _0x374469=this;return function(){var _0x1007a4=0x0;var _0x1a5613=Math[_0xb7a1('0x1e0')](_0xe5a97[_0xb7a1('0x1fb')]*0x3e8);if(_0x1a5613>0x0){_0x1a5613=_0x1a5613<0x64?0x64:_0x1a5613;loggerPredictive['info'](_0xe5a97['name'],_0xb7a1('0x1fc'),_0x1a5613,_0xb7a1('0x4e'));_0xe5a97['handlePredictive']=setInterval(function(){_0x374469['handlePredictive'](_0xe5a97);loggerPredictiveCalls[_0xb7a1('0x83')](_0xb7a1('0x1fd'),_0x1007a4+=0x1);},_0x1a5613);}else{loggerPredictive[_0xb7a1('0x83')](_0xe5a97[_0xb7a1('0x45')],_0xb7a1('0x1fe'));}};};Dialer['prototype']['checkContactBlack']=function(_0x5894e2,_0x2ff417){var _0x2bcc28=this;return function(_0x2db6f3){if(_[_0xb7a1('0x81')](_0x2db6f3)){if(_[_0xb7a1('0xb4')](_0x2ff417[_0xb7a1('0xe0')])||!_0x2ff417['recallme']){if(_0x5894e2[_0xb7a1('0x61')]==='booked'){_0x5894e2[_0xb7a1('0x13c')]=_['isUndefined'](_0x5894e2[_0xb7a1('0x13c')])?!![]:_0x5894e2[_0xb7a1('0x13c')];var _0x512e54=uuid['v4']();_0x2bcc28[_0xb7a1('0xb0')][_0x512e54]=new Action(_0x5894e2,_0x2ff417,_0x512e54);loggerBooked[_0xb7a1('0x83')](_0xb7a1('0x1ff'),_0x512e54,_0xb7a1('0x200'),JSON[_0xb7a1('0x4d')](_0x5894e2['queueStatusComplete']),_0xb7a1('0x201'),_0x5894e2[_0xb7a1('0x45')]);if(_0x5894e2['queueStatusComplete']){_0x5894e2[_0xb7a1('0x13c')]=![];_0x2bcc28[_0xb7a1('0x2e')][_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xbb')]]=[];ami[_0xb7a1('0xb5')]({'actionid':_0x512e54,'action':_0xb7a1('0x202'),'queue':_0x5894e2[_0xb7a1('0x45')]})[_0xb7a1('0xb8')](function(){_0x2bcc28['updateOriginated'](_0x5894e2);_0x2bcc28[_0xb7a1('0xca')]({'active':![],'ContactId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54]['ContactId'],'ListId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54]['ListId'],'VoiceQueueId':_0x2bcc28['actions'][_0x512e54][_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x203')));delete _0x2bcc28['actions'][_0x512e54];});}else{loggerBooked[_0xb7a1('0x83')](_0xb7a1('0x204'),JSON['stringify'](_0x5894e2['queueStatusComplete']),_0xb7a1('0x201'),_0x5894e2[_0xb7a1('0x45')]);_0x2bcc28[_0xb7a1('0xba')](_0x5894e2);_0x2bcc28[_0xb7a1('0xca')]({'active':![],'ContactId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xde')],'ListId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xdf')],'VoiceQueueId':_0x2bcc28[_0xb7a1('0xb0')][_0x512e54][_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2bcc28['actions'][_0x512e54][_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2bcc28[_0xb7a1('0xb0')][_0x512e54];}}else{return _0x2bcc28[_0xb7a1('0x17c')](_0x5894e2,_0x2ff417);}}else{if(getDiff(_0x2ff417[_0xb7a1('0x205')])<_0x5894e2[_0xb7a1('0x206')]*0x3c){if(_0x2ff417[_0xb7a1('0x169')]&&!_0x2ff417['Agent']['voicePause']){_0x2bcc28['preview'][_0xb7a1('0x207')](_0x2ff417['id'])[_0xb7a1('0x21')](function(){_0x2bcc28[_0xb7a1('0xba')](_0x5894e2);});}else{_0x2bcc28[_0xb7a1('0xcc')]({'active':![]},_0x2ff417['id'],0x1)[_0xb7a1('0x21')](function(){_0x2bcc28['updateOriginated'](_0x5894e2);});}}else{_0x5894e2[_0xb7a1('0x6c')]+=0x1;_0x2bcc28[_0xb7a1('0xba')](_0x5894e2);if(_0x5894e2[_0xb7a1('0x208')]){_0x2bcc28[_0xb7a1('0xca')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2ff417[_0xb7a1('0xde')],'ListId':_0x2ff417['ListId'],'VoiceQueueId':_0x2ff417[_0xb7a1('0xe1')]||undefined,'CampaignId':_0x2ff417[_0xb7a1('0xe2')]||undefined})[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x209')));_0x2bcc28['createHistory'](createObjHistory(_0x5894e2,_0x2ff417,_0xb7a1('0x20a'),0x17,_0xb7a1('0x20b')))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x20c')));}else{_0x2bcc28[_0xb7a1('0xe8')](createObjHistory(_0x5894e2,_0x2ff417,_0xb7a1('0x20d'),0x16,_0xb7a1('0x20e')),_0xb7a1('0x20f'),_0xb7a1('0x210'));}}}}else{_0x5894e2[_0xb7a1('0x211')]+=0x1;_0x2bcc28[_0xb7a1('0xe8')](createObjHistory(_0x5894e2,_0x2ff417,'BLACKLIST',0xd,'Blacklist'),_0xb7a1('0x212'),'[Originate][MoveBlacklist]');throw _0xb7a1('0x213');}};};Dialer[_0xb7a1('0x1f')]['handleIvr']=function(_0x3db7d3){var _0x2b9a3c=this;var _0x1dbc97=_0x3db7d3[_0xb7a1('0x214')]-_0x3db7d3[_0xb7a1('0x75')]-_0x3db7d3[_0xb7a1('0xcf')];emitCampaignSummary(_0x3db7d3);if(_0x1dbc97>0x0){if(_0x1dbc97>this[_0xb7a1('0x26')]){_0x1dbc97=this[_0xb7a1('0x26')];}_0x3db7d3[_0xb7a1('0xcf')]+=_0x1dbc97;this['getContactDialerIvr'](_0x3db7d3['id'],_0x1dbc97,_0x3db7d3[_0xb7a1('0x215')],_0x3db7d3)[_0xb7a1('0xbf')](function(_0x58f272){_0x3db7d3[_0xb7a1('0xcf')]-=_0x1dbc97;_0x3db7d3[_0xb7a1('0xcf')]=_0x3db7d3[_0xb7a1('0xcf')]>0x0?_0x3db7d3['temp']:0x0;if(!checkContactEmpty(_0x58f272)){_0x3db7d3[_0xb7a1('0x44')]=_0xb7a1('0x216');logger[_0xb7a1('0x83')](_0xb7a1('0x217')+_0x3db7d3['name']);}else{_0x3db7d3[_0xb7a1('0x75')]+=_0x58f272[_0xb7a1('0xa0')];_0x3db7d3[_0xb7a1('0x44')]=_0xb7a1('0x218');for(var _0x552ce2=0x0;_0x552ce2<_0x58f272['length'];_0x552ce2+=0x1){_0x3db7d3['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x58f272[_0x552ce2])||_[_0xb7a1('0xb4')](_0x58f272[_0x552ce2][_0xb7a1('0x196')])||_[_0xb7a1('0xb4')](_0x58f272[_0x552ce2]['phone'])){_0x2b9a3c[_0xb7a1('0xdc')](_0xb7a1('0x219'),_0x3db7d3,_0x58f272[_0x552ce2]);}else{_0x2b9a3c[_0xb7a1('0xc6')](_[_0xb7a1('0xdd')](_0x58f272[_0x552ce2],[_0xb7a1('0xe2'),'phone']))[_0xb7a1('0xbf')](_0x2b9a3c[_0xb7a1('0x21a')](_0x3db7d3,_0x58f272[_0x552ce2]))['catch'](_0x2b9a3c[_0xb7a1('0xdb')](_0xb7a1('0x21b'),_0x3db7d3));}}}})[_0xb7a1('0xb8')](loggerGetContactDialer(_0xb7a1('0x21c'),_0x3db7d3,_0x1dbc97));}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x164')]=function(_0x1ca7a1,_0x458806){var _0x530058=this;var _0x26cadd=[];var _0x312086=_0x458806>=0x1?_0x458806:0x1;if(_0x1ca7a1[_0xb7a1('0x61')]===_0xb7a1('0x9')){_0x312086=0x1;}var _0x546424=Math[_0xb7a1('0x1e0')](_0x1ca7a1[_0xb7a1('0x54')]*_0x312086)-_0x1ca7a1[_0xb7a1('0x75')]-_0x1ca7a1[_0xb7a1('0xcf')];emitVoiceQueueSummary(_0x1ca7a1);if(_0x1ca7a1['dialLimitQueue']>0x0){var _0x2b9155=_0x1ca7a1['dialLimitQueue']-_0x1ca7a1[_0xb7a1('0x75')]-_0x1ca7a1[_0xb7a1('0x59')]-_0x1ca7a1[_0xb7a1('0xcf')]-_0x1ca7a1[_0xb7a1('0x56')];if(_0x546424>_0x2b9155){_0x546424=_0x2b9155;}}if(_0x546424>0x0){if(_0x1ca7a1[_0xb7a1('0x61')]===_0xb7a1('0x9')){_0x546424=0x1;}if(_0x546424>this[_0xb7a1('0x26')]){_0x546424=this[_0xb7a1('0x26')];}_0x1ca7a1[_0xb7a1('0xcf')]+=_0x546424;for(var _0x862cf3 in this[_0xb7a1('0x24')]){if(typeof this[_0xb7a1('0x24')][_0x862cf3]!==_0xb7a1('0xb1')){if(this['agents'][_0x862cf3]['state']===_0xb7a1('0x21d')&&this[_0xb7a1('0x24')][_0x862cf3][_0xb7a1('0xb6')]===_0xb7a1('0x21e')){_0x26cadd[_0xb7a1('0x13a')](this[_0xb7a1('0x24')][_0x862cf3]['id']);}}}this[_0xb7a1('0xce')](_0x1ca7a1['id'],_0x26cadd,_0x546424,_0x1ca7a1[_0xb7a1('0x215')],_0x1ca7a1)[_0xb7a1('0xbf')](function(_0x5443d7){_0x1ca7a1[_0xb7a1('0xcf')]-=_0x546424;_0x1ca7a1[_0xb7a1('0xcf')]=_0x1ca7a1['temp']>0x0?_0x1ca7a1[_0xb7a1('0xcf')]:0x0;if(!checkContactEmpty(_0x5443d7)){_0x530058[_0xb7a1('0xbd')](_0x1ca7a1)[_0xb7a1('0xbf')](sendMessageReschedule(_0x1ca7a1))[_0xb7a1('0xb8')](loggerCatch(_0xb7a1('0x21f')));}else{_0x1ca7a1[_0xb7a1('0x75')]+=_0x5443d7[_0xb7a1('0xa0')];_0x1ca7a1[_0xb7a1('0x44')]=_0x1ca7a1[_0xb7a1('0x61')]==='booked'?_0xb7a1('0x185'):_0xb7a1('0x218');for(var _0x413c6f=0x0;_0x413c6f<_0x5443d7[_0xb7a1('0xa0')];_0x413c6f+=0x1){if(_[_0xb7a1('0xb4')](_0x5443d7[_0x413c6f])||_[_0xb7a1('0xb4')](_0x5443d7[_0x413c6f][_0xb7a1('0x196')])||_[_0xb7a1('0xb4')](_0x5443d7[_0x413c6f]['phone'])){_0x530058[_0xb7a1('0xdc')](_0xb7a1('0x219'),_0x1ca7a1,_0x5443d7[_0x413c6f]);}else{_0x530058[_0xb7a1('0xc0')](_[_0xb7a1('0xdd')](_0x5443d7[_0x413c6f],[_0xb7a1('0xe1'),_0xb7a1('0x17f')]))[_0xb7a1('0xbf')](_0x530058['checkContactBlack'](_0x1ca7a1,_0x5443d7[_0x413c6f]))[_0xb7a1('0xb8')](_0x530058['loggerHandler'](_0xb7a1('0x219'),_0x1ca7a1));}}}})[_0xb7a1('0xb8')](loggerGetContactDialer('[getContactDialer2]',_0x1ca7a1,_0x546424));}};Dialer['prototype'][_0xb7a1('0x97')]=function(_0x139689){if(_0x139689[_0xb7a1('0x220')]>0x0){var _0x152cd3=_0x139689[_0xb7a1('0x220')]-_0x139689['originated']-_0x139689[_0xb7a1('0x59')];if(_0x152cd3>0x0){this[_0xb7a1('0x221')](_0x139689);}else{loggerPredictiveCalls[_0xb7a1('0x83')](_0xb7a1('0x222'));}}else{this[_0xb7a1('0x221')](_0x139689);}};Dialer[_0xb7a1('0x1f')][_0xb7a1('0x221')]=function(_0x2ef3ca){var _0x54cfcc=this;var _0x3818d6=[];_0x2ef3ca[_0xb7a1('0x75')]+=0x1;for(var _0x62ffa in this[_0xb7a1('0x24')]){if(typeof this[_0xb7a1('0x24')][_0x62ffa]!==_0xb7a1('0xb1')){if(this['agents'][_0x62ffa][_0xb7a1('0xf0')]===_0xb7a1('0x21d')&&this[_0xb7a1('0x24')][_0x62ffa][_0xb7a1('0xb6')]===_0xb7a1('0x21e')){_0x3818d6[_0xb7a1('0x13a')](this[_0xb7a1('0x24')][_0x62ffa]['id']);}}}this['getContactDialer'](_0x2ef3ca['id'],_0x3818d6,0x1,_0x2ef3ca[_0xb7a1('0x215')],_0x2ef3ca)[_0xb7a1('0xbf')](function(_0x20a7fc){if(!checkContactEmpty(_0x20a7fc)){checkContactLowerLimitOriginate(_0x2ef3ca,0x1,0x0);_0x54cfcc[_0xb7a1('0xbd')](_0x2ef3ca)[_0xb7a1('0xbf')](sendMessageReschedule(_0x2ef3ca))['catch'](loggerCatch(_0xb7a1('0x21f')));}else{_0x2ef3ca[_0xb7a1('0x44')]=_0xb7a1('0x218');if(_[_0xb7a1('0xb4')](_0x20a7fc[0x0])||_['isNil'](_0x20a7fc[0x0][_0xb7a1('0x196')])||_[_0xb7a1('0xb4')](_0x20a7fc[0x0][_0xb7a1('0x17f')])){_0x54cfcc[_0xb7a1('0xdc')](_0xb7a1('0x219'),_0x2ef3ca,_0x20a7fc[0x0]);}else{_0x54cfcc[_0xb7a1('0xc0')](_[_0xb7a1('0xdd')](_0x20a7fc[0x0],[_0xb7a1('0xe1'),'phone']))[_0xb7a1('0xbf')](_0x54cfcc[_0xb7a1('0x21a')](_0x2ef3ca,_0x20a7fc[0x0]))['catch'](_0x54cfcc[_0xb7a1('0xdb')]('[actionOriginatePredictive]\x20',_0x2ef3ca));}}})[_0xb7a1('0xb8')](loggerGetContactDialer(_0xb7a1('0x223'),_0x2ef3ca,0x1));emitVoiceQueueSummary(_0x2ef3ca);};Dialer['prototype'][_0xb7a1('0x1f3')]=function(_0x2c4121,_0x4b75ed,_0x306c51,_0x3ede03,_0x4eb1ae,_0x418968){loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x224'));loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x225'),_0x2c4121);loggerPredictive[_0xb7a1('0x83')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b75ed);loggerPredictive[_0xb7a1('0x83')]('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',_0x306c51);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x226'),_0x3ede03);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x227'),_0x4eb1ae);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x8c'));return new Promise(function(_0x2f2669,_0x3cf95a){if(_0x2c4121<=0x0||isNaN(_0x2c4121)){return _0x3cf95a(msgResponse(_0xb7a1('0x228'),_0xb7a1('0x1aa'),'m\x20=\x20'+_0x2c4121));}if(_0x306c51<=0x0||isNaN(_0x306c51)){return _0x3cf95a(msgResponse(_0xb7a1('0x228'),'Error','Ts\x20=\x20'+_0x306c51));}if(_0x3ede03<=0x0||isNaN(_0x3ede03)){return _0x3cf95a(msgResponse('[abandonmentRate]',_0xb7a1('0x1aa'),_0xb7a1('0x229')+_0x3ede03));}if(_0x4b75ed<=0x0||isNaN(_0x4b75ed)){return _0x3cf95a(msgResponse(_0xb7a1('0x228'),_0xb7a1('0x1aa'),_0xb7a1('0x22a')+_0x4b75ed));}if(_0x4eb1ae<=0x0||isNaN(_0x4eb1ae)){return _0x3cf95a(msgResponse(_0xb7a1('0x228'),_0xb7a1('0x1aa'),_0xb7a1('0x22b')+_0x4eb1ae));}_0x418968=_0x418968||0x0;var _0x54aedd=0x1/_0x306c51;var _0x32ed43=0x0;var _0x7ca0c4=0x0;var _0x380dd0=0x0;var _0x3798dd=0x0;for(var _0x4c709b=0x0;_0x380dd0<_0x4eb1ae;_0x4c709b+=0x1){_0x7ca0c4=_0x4c709b/_0x4b75ed;_0x32ed43=(_0x3ede03*_0x7ca0c4+_0x418968)/_0x54aedd;_0x380dd0=erlangb(_0x32ed43,_0x2c4121);_0x3798dd=_0x32ed43/_0x2c4121*(0x1-erlangb(_0x32ed43,_0x2c4121));}return _0x2f2669({'erlangCalls':_0x4c709b,'erlangCallToSecond':_0x4b75ed/_0x4c709b,'erlangAbandonmentRate':_0x380dd0,'erlangBusyFactor':_0x3798dd});});};Dialer['prototype'][_0xb7a1('0x1f5')]=function(_0x384573,_0x1ee848,_0x2ec20b,_0x4e2c12,_0xeb4a53,_0x6332fe){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0xb7a1('0x225'),_0x384573);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x22c'),_0x1ee848);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x22d'),_0x2ec20b);loggerPredictive[_0xb7a1('0x83')]('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',_0x4e2c12);loggerPredictive[_0xb7a1('0x83')](_0xb7a1('0x22e'),_0xeb4a53);loggerPredictive[_0xb7a1('0x83')]('---------------------------');return new Promise(function(_0x18424d,_0x55b03a){if(_0x384573<=0x0||isNaN(_0x384573)){return _0x55b03a(msgResponse(_0xb7a1('0x22f'),_0xb7a1('0x1aa'),_0xb7a1('0x230')+_0x384573));}if(_0x2ec20b<=0x0||isNaN(_0x2ec20b)){return _0x55b03a(msgResponse(_0xb7a1('0x22f'),'Error',_0xb7a1('0x231')+_0x2ec20b));}if(_0x4e2c12<=0x0||isNaN(_0x4e2c12)){return _0x55b03a(msgResponse(_0xb7a1('0x22f'),_0xb7a1('0x1aa'),_0xb7a1('0x229')+_0x4e2c12));}if(_0x1ee848<=0x0||isNaN(_0x1ee848)){return _0x55b03a(msgResponse(_0xb7a1('0x22f'),'Error',_0xb7a1('0x22a')+_0x1ee848));}if(_0xeb4a53<=0x0||isNaN(_0xeb4a53)){return _0x55b03a(msgResponse('[busyFactor]',_0xb7a1('0x1aa'),'Umin\x20=\x20'+_0xeb4a53));}_0x6332fe=_0x6332fe||0x0;var _0x4aedec=0x1/_0x2ec20b;var _0xa82270=0x0;var _0xf87a5b=0x0;var _0x2e6fae=0x0;var _0x1ff26b=0x0;for(var _0x5c6ead=0x0;_0x1ff26b<_0xeb4a53;_0x5c6ead+=0x1){_0xf87a5b=_0x5c6ead/_0x1ee848;_0xa82270=(_0x4e2c12*_0xf87a5b+_0x6332fe)/_0x4aedec;_0x2e6fae=erlangb(_0xa82270,_0x384573);_0x1ff26b=_0xa82270/_0x384573*(0x1-erlangb(_0xa82270,_0x384573));}return _0x18424d({'erlangCalls':_0x5c6ead,'erlangCallToSecond':_0x1ee848/_0x5c6ead,'erlangAbandonmentRate':_0x2e6fae,'erlangBusyFactor':_0x1ff26b});});};module[_0xb7a1('0x232')]=Dialer; \ No newline at end of file +var _0x02bc=['[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','HangupInAMD','membername','AMD','emit','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ListId','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','dialGlobalMaxRetry','reason19\x20machine....','[rescheduleContact][Machine]','syncHangup','[syncHangupIvr]','dialQueueProject','AGI','[syncHangupIvr][createHistory]','cause-txt','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','agiafterat','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dropreason','CALLEREXIT','countglobal','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','syncNewExten','actionid','locked','stateinterface','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','timezones','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','content','indexOf','true','push','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','progressive','handlePower','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','throttle','filter','dialPreviewRecallmeReminder','online','map','checkIfTime','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','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','dialAMDActive','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','trim','dialCutDigit','SIP/%s/%s%s','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','syncOriginateResponse','response','callProgressDetecting','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','handlePredictive','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','busyFactor','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queuestatus','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','dialRecallMeTimeout','voicePause','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','dialOrderByScheduledAt','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','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]','exports','util','lodash','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','queuecallerabandon','bind','agentcomplete','syncAgentComplete','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','newexten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\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','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','clearing\x20variable\x20start\x20predictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','debug','inspect','error','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','starttime','uniqueId','[uniqueid]','clearZombieChannels','undefined','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','swapAdditionalPhones','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer'];(function(_0x4ebb24,_0x1ddcc2){var _0x471a71=function(_0x5c84cc){while(--_0x5c84cc){_0x4ebb24['push'](_0x4ebb24['shift']());}};_0x471a71(++_0x1ddcc2);}(_0x02bc,0x15e));var _0xc02b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x02bc[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xc02b('0x0'));var _=require(_0xc02b('0x1'));var uuid=require(_0xc02b('0x2'));var moment=require(_0xc02b('0x3'));var rr=require('rr');var md5=require(_0xc02b('0x4'));var Redis=require(_0xc02b('0x5'));var ut=require(_0xc02b('0x6'));var config=require(_0xc02b('0x7'));var logger=require(_0xc02b('0x8'))('dialer');var loggerBooked=require('../../../config/logger')(_0xc02b('0x9'));var loggerPredictive=require(_0xc02b('0x8'))(_0xc02b('0xa'));var loggerPredictiveCalls=require(_0xc02b('0x8'))(_0xc02b('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0xc02b('0xc'));config[_0xc02b('0xd')]=_[_0xc02b('0xe')](config[_0xc02b('0xd')],{'host':_0xc02b('0xf'),'port':0x18eb});var io=require(_0xc02b('0x10'))(new Redis(config[_0xc02b('0xd')]));var cmHopper=require(_0xc02b('0x11'));var cmHopperHistory=require(_0xc02b('0x12'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xc02b('0x13'));var RpcSetting=require('../rpc/setting');var Action=require(_0xc02b('0x14'));var History=require(_0xc02b('0x15'));var Final=require(_0xc02b('0x16'));var AgentComplete=require(_0xc02b('0x17'));var QueueCallerAbandon=require(_0xc02b('0x18'));var Hangup=require('./hangup');var ipAgi=process['env']['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0xc02b('0x19'),'roundrobin':_0xc02b('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc02b('0x1b')][_0xc02b('0x1c')]=function(_0x4e74ec){this[_0xc02b('0x1d')]=this['tail']?this['tail'][_0xc02b('0x1e')](_0x4e74ec):_0x4e74ec();};function Dialer(_0x1620f7,_0x70c4f6){this[_0xc02b('0x1f')]=new Sequence();this[_0xc02b('0x20')]=_0x70c4f6;this[_0xc02b('0x21')]=_0x1620f7[_0xc02b('0x21')];this[_0xc02b('0x22')]=_0x1620f7[_0xc02b('0x22')];this[_0xc02b('0x23')]=_0x1620f7[_0xc02b('0x23')];this[_0xc02b('0x24')]=_0x1620f7['trunks'];this['maxNumberOriginate']=config[_0xc02b('0x25')]||0x2;this[_0xc02b('0x26')]={};this[_0xc02b('0x27')]={};this[_0xc02b('0x28')]={};this['uniqueId']={};this[_0xc02b('0x29')]={};this['startPredictive']={};this[_0xc02b('0x2a')]={};this[_0xc02b('0x2b')]={};this[_0xc02b('0x2c')]={};this['queueBookedRR']={};ami['on'](_0xc02b('0x2d'),this['syncAgentConnect']['bind'](this));ami['on'](_0xc02b('0x2e'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xc02b('0x2f')](this));ami['on'](_0xc02b('0x30'),this[_0xc02b('0x31')][_0xc02b('0x2f')](this));ami['on']('custom:queuesummary',this[_0xc02b('0x32')][_0xc02b('0x2f')](this));ami['on'](_0xc02b('0x33'),this[_0xc02b('0x34')]['bind'](this));ami['on'](_0xc02b('0x35'),this['syncHangup'][_0xc02b('0x2f')](this));ami['on'](_0xc02b('0x36'),this['syncNewExten'][_0xc02b('0x2f')](this));ami['on'](_0xc02b('0x37'),this[_0xc02b('0x38')][_0xc02b('0x2f')](this));ami['on']('queuemember',this[_0xc02b('0x39')][_0xc02b('0x2f')](this));ami['on'](_0xc02b('0x3a'),this[_0xc02b('0x3b')][_0xc02b('0x2f')](this));this[_0xc02b('0x3c')]();this[_0xc02b('0x3d')]();RpcSetting[_0xc02b('0x3e')]()[_0xc02b('0x3f')](function(_0x2e8f8a){previewRecallmeReminderInterval=_0x2e8f8a[_0xc02b('0x40')];});}function isNotNull(_0x3f8fe5){return _0x3f8fe5!==null&&!_[_0xc02b('0x41')](_0x3f8fe5);}function checkIsLoggedIn(_0x2cd48a,_0x41f6d8){return function(){if(_0x41f6d8<=0x0){_0x2cd48a[_0xc02b('0x42')]=_0xc02b('0x43');throw _0x2cd48a[_0xc02b('0x44')]+_0xc02b('0x45');}};}function isActive(_0x56ad0b){return _0x56ad0b;}function checkIsActive(_0xd8357a,_0x466a26){return function(){if(!isActive(_0x466a26)){_0xd8357a['message']=_0xc02b('0x46');throw _0xd8357a['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x122ced){return function(){if(!isNotNull(_0x122ced[_0xc02b('0x47')])){_0x122ced['message']=_0xc02b('0x48');throw _0x122ced[_0xc02b('0x44')]+_0xc02b('0x49');}if(!isNotNull(_0x122ced[_0xc02b('0x47')][_0xc02b('0x4a')])){_0x122ced[_0xc02b('0x42')]=_0xc02b('0x48');throw _0x122ced[_0xc02b('0x44')]+_0xc02b('0x49');}if(!isNotNull(_[_0xc02b('0x4b')](_0x122ced[_0xc02b('0x47')][_0xc02b('0x4a')]))){_0x122ced[_0xc02b('0x42')]=_0xc02b('0x48');throw _0x122ced[_0xc02b('0x44')]+_0xc02b('0x49');}};}function msgResponse(_0xc98f07,_0x29c00e,_0x93414f){return{'action':_0xc98f07,'response':_0x29c00e,'message':_0x93414f,'stack':_0x93414f};}function myreject(_0x1f0a8c){return function(_0x4329d9){return _0x1f0a8c(msgResponse(_0xc02b('0x4c'),_0xc02b('0x4d'),JSON[_0xc02b('0x4e')](_0x4329d9)));};}function getSeconds(_0x1a428f,_0x4550be){var _0x496c6f=moment(_0x1a428f)[_0xc02b('0x4f')](0x0);var _0x3e5cdf=moment(_0x4550be)[_0xc02b('0x4f')](0x0);return _0x496c6f[_0xc02b('0x50')](_0x3e5cdf,_0xc02b('0x51'));}function emit(_0x314454,_0x2c1e98,_0x2c6dc2){io['to'](_0x314454)['emit'](_0x2c1e98,_0x2c6dc2);}function emitVoiceQueueSummary(_0x71f99a){if(_0x71f99a[_0xc02b('0x52')]===_0xc02b('0x53')){var _0x16c5e0={'id':_0x71f99a['id'],'name':_0x71f99a[_0xc02b('0x44')],'strategy':_0x71f99a[_0xc02b('0x54')],'answered':_0x71f99a[_0xc02b('0x55')],'available':_0x71f99a[_0xc02b('0x56')],'loggedIn':_0x71f99a[_0xc02b('0x57')],'pTalking':_0x71f99a[_0xc02b('0x58')],'sumBillable':_0x71f99a[_0xc02b('0x59')],'sumDuration':_0x71f99a[_0xc02b('0x5a')],'sumHoldTime':_0x71f99a[_0xc02b('0x5b')]||0x0,'talking':_0x71f99a[_0xc02b('0x5c')],'total':_0x71f99a[_0xc02b('0x5d')],'type':_0x71f99a['type'],'unmanaged':_0x71f99a['unmanaged'],'abandoned':_0x71f99a[_0xc02b('0x5e')],'waiting':_0x71f99a['waiting'],'loggedInDb':_0x71f99a[_0xc02b('0x5f')],'dialActive':_0x71f99a[_0xc02b('0x60')],'dialMethod':_0x71f99a[_0xc02b('0x61')],'dialOriginateCallerIdName':_0x71f99a[_0xc02b('0x62')],'dialOriginateCallerIdNumber':_0x71f99a[_0xc02b('0x63')],'dialOriginateTimeout':_0x71f99a[_0xc02b('0x64')],'dialPrefix':_0x71f99a[_0xc02b('0x65')],'outboundAnswerAgiCallsDay':_0x71f99a[_0xc02b('0x66')],'outboundAnswerCallsDay':_0x71f99a[_0xc02b('0x67')],'outboundBlacklistCallsDay':_0x71f99a[_0xc02b('0x68')],'outboundBusyCallsDay':_0x71f99a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x71f99a[_0xc02b('0x69')],'outboundDropCallsDayACS':_0x71f99a[_0xc02b('0x6a')],'outboundDropCallsDayCallersExit':_0x71f99a[_0xc02b('0x6b')],'outboundDropCallsDayTimeout':_0x71f99a['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x71f99a['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x71f99a['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x71f99a['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x71f99a[_0xc02b('0x6c')],'outboundRejectCallsDay':_0x71f99a[_0xc02b('0x6d')],'outboundUnknownCallsDay':_0x71f99a[_0xc02b('0x6e')],'predictiveIntervalAnsweredCalls':_0x71f99a[_0xc02b('0x6f')],'predictiveIntervalAvgHoldtime':_0x71f99a[_0xc02b('0x70')],'predictiveIntervalAvgTalktime':_0x71f99a[_0xc02b('0x71')],'predictiveIntervalDroppedCallsCallersExit':_0x71f99a[_0xc02b('0x72')],'predictiveIntervalDroppedCallsTimeout':_0x71f99a[_0xc02b('0x73')],'predictiveIntervalErlangCalls':_0x71f99a[_0xc02b('0x74')],'predictiveIntervalErlangCallsDroppedCalls':_0x71f99a['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x71f99a['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x71f99a[_0xc02b('0x75')],'predictiveIntervalPauses':_0x71f99a[_0xc02b('0x76')],'predictiveIntervalAvailable':_0x71f99a['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x71f99a[_0xc02b('0x77')],'message':_0x71f99a['message'],'originated':_0x71f99a[_0xc02b('0x78')],'erlangCalls':_0x71f99a['erlangCalls'],'erlangCallToSecond':_0x71f99a[_0xc02b('0x79')],'erlangAbandonmentRate':_0x71f99a[_0xc02b('0x7a')],'erlangBusyFactor':_0x71f99a[_0xc02b('0x7b')],'startPredictive':_0x71f99a[_0xc02b('0x7c')],'startProgressive':_0x71f99a[_0xc02b('0x2a')]};if(_0x71f99a[_0xc02b('0x7d')]){_0x16c5e0[_0xc02b('0x7d')]={'id':_0x71f99a[_0xc02b('0x7d')]['id'],'name':_0x71f99a['Trunk']['name'],'active':_0x71f99a[_0xc02b('0x7d')][_0xc02b('0x7e')],'callerid':_0x71f99a[_0xc02b('0x7d')][_0xc02b('0x7f')]};}if(_0x71f99a[_0xc02b('0x47')]){_0x16c5e0['Interval']={'id':_0x71f99a[_0xc02b('0x47')]['id'],'name':_0x71f99a[_0xc02b('0x47')][_0xc02b('0x44')]};}var _0xae8d77=md5(JSON['stringify'](_0x16c5e0));if(_0x71f99a[_0xc02b('0x4')]!==_0xae8d77){_0x71f99a[_0xc02b('0x4')]=_0xae8d77;emit(util[_0xc02b('0x80')](_0xc02b('0x81'),_0x16c5e0[_0xc02b('0x44')]),_0xc02b('0x82'),_0x16c5e0);}}}function emitCampaignSummary(_0x1dbab6){if(_0x1dbab6[_0xc02b('0x52')]===_0xc02b('0x83')){emit(util[_0xc02b('0x80')](_0xc02b('0x84'),_0x1dbab6[_0xc02b('0x44')]),'campaign:save',_0x1dbab6);}}function checkGetDataPredictive(_0x121bca){if(isNotNull(_0x121bca)&&!_[_0xc02b('0x4b')](_0x121bca)){loggerPredictive['info'](_0xc02b('0x85'));loggerPredictive[_0xc02b('0x86')](_0xc02b('0x87'),_0x121bca[_0xc02b('0x77')]);loggerPredictive[_0xc02b('0x86')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x121bca['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xc02b('0x86')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x121bca[_0xc02b('0x73')]);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x88'),_0x121bca['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x89'),_0x121bca[_0xc02b('0x70')]);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x8a'),_0x121bca[_0xc02b('0x71')]);loggerPredictive[_0xc02b('0x86')]('---------------------------');if(_0x121bca[_0xc02b('0x77')]>0x0){if(!_['isUndefined'](_0x121bca[_0xc02b('0x71')])&&_0x121bca['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0xc02b('0x86')](_0xc02b('0x8b'));if(!_[_0xc02b('0x41')](_0x121bca[_0xc02b('0x70')])&&_0x121bca[_0xc02b('0x70')]>0x0){return!![];}loggerPredictive[_0xc02b('0x86')](_0xc02b('0x8c'));}else{loggerPredictive[_0xc02b('0x86')](_0xc02b('0x8d'));}}else{loggerPredictive[_0xc02b('0x86')](_0xc02b('0x8e'));}return![];}function mergeDataErlangB(_0x2ec170){return function(_0x3d75f3){loggerPredictive[_0xc02b('0x86')](_0xc02b('0x8f'));loggerPredictive['info'](_0xc02b('0x90'),_0x3d75f3[_0xc02b('0x91')]);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x92'),_0x3d75f3[_0xc02b('0x79')]);loggerPredictive['info'](_0xc02b('0x93'),_0x3d75f3[_0xc02b('0x7a')]);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x94'),_0x3d75f3[_0xc02b('0x7b')]);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x93'),_0x3d75f3['erlangAbandonmentRate']);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x95'));_[_0xc02b('0x96')](_0x2ec170,_0x3d75f3);};}function getDiff(_0x3086e0){var _0x3c427b=moment()['milliseconds'](0x0);var _0x1f033c=moment(_0x3086e0)[_0xc02b('0x4f')](0x0);return _0x3c427b['diff'](_0x1f033c,_0xc02b('0x51'));}function ifInterval(_0x5508ff,_0x5c129d){if(_[_0xc02b('0x41')](_0x5c129d)){return![];}return getDiff(_0x5c129d)<_0x5508ff*0x3c;}function freeVariablesPredictive(_0x47964b){if(isNotNull(_0x47964b)){if(!_[_0xc02b('0x41')](_0x47964b[_0xc02b('0x2a')])){_0x47964b['startProgressive']=undefined;loggerPredictive[_0xc02b('0x86')](_0x47964b[_0xc02b('0x44')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xc02b('0x41')](_0x47964b[_0xc02b('0x7c')])){_0x47964b[_0xc02b('0x7c')]=undefined;loggerPredictive['info'](_0x47964b[_0xc02b('0x44')],_0xc02b('0x97'));}if(!_[_0xc02b('0x41')](_0x47964b['handlePredictive'])){clearInterval(_0x47964b['handlePredictive']);_0x47964b['handlePredictive']=undefined;loggerPredictive[_0xc02b('0x86')](_0x47964b[_0xc02b('0x44')],_0xc02b('0x98'));}}}function erlangb(_0x51aa66,_0x17ace6){if(_0x17ace6===0x0){return 0x0;}var _0x4a5927=0x1;for(var _0x25e532=0x1;_0x25e532<=_0x17ace6;_0x25e532+=0x1){_0x4a5927=0x1+_0x4a5927*_0x25e532/_0x51aa66;}return 0x1/_0x4a5927;}function isVoiceQueueOutbound(_0xc8a041){return _0xc8a041==='outbound';}function isNotPreview(_0x560642){return _0x560642!==_0xc02b('0x20');}function isCampaignIvr(_0x1f3c25){return _0x1f3c25===_0xc02b('0x83');}function getCallerId(_0x39624c,_0x584008,_0x45e765){if(!_[_0xc02b('0x41')](_0x45e765)&&typeof _0x45e765===_0xc02b('0x99')&&!_[_0xc02b('0x4b')](_0x45e765)){if(!_['isUndefined'](_0x584008)&&typeof _0x584008===_0xc02b('0x99')&&!_[_0xc02b('0x4b')](_0x584008)){return util[_0xc02b('0x80')](_0xc02b('0x9a'),_0x584008,_0x45e765);}return util[_0xc02b('0x80')](_0xc02b('0x9a'),_0x45e765,_0x45e765);}if(!_[_0xc02b('0x41')](_0x39624c)&&typeof _0x39624c===_0xc02b('0x99')&&!_['isEmpty'](_0x39624c)){return _0x39624c;}return _0xc02b('0x9b');}function loggerCatchQueueSummary(_0x4a325c,_0x579ca4){return function(_0x46fe9c){freeVariablesPredictive(_0x579ca4);emitVoiceQueueSummary(_0x579ca4);emitCampaignSummary(_0x579ca4);loggerSyncQueueSummary[_0xc02b('0x9c')](_0x4a325c,util[_0xc02b('0x9d')](_0x46fe9c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x508712,_0x354bc1){return function(_0x1ef103){loggerPredictive['error'](_0x354bc1['name'],_0x508712);loggerPredictive[_0xc02b('0x9e')](_0x1ef103[_0xc02b('0x9f')]);freeVariablesPredictive(_0x354bc1);};}function loggerCatch(_0x679a43){return function(_0x4b3154){logger['error'](_0x679a43,util[_0xc02b('0x9d')](_0x4b3154,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x524e18){return _0x524e18&&!_['isUndefined'](_0x524e18)&&_0x524e18[_0xc02b('0xa0')]>0x0;}function decremetOriginate(_0x3f3c19){if(!_[_0xc02b('0x41')](_0x3f3c19)&&_0x3f3c19!==null){if(typeof _0x3f3c19[_0xc02b('0x78')]!=='undefined'){if(_0x3f3c19['originated']>0x0){_0x3f3c19[_0xc02b('0x78')]-=0x1;}else{logger[_0xc02b('0x9e')](_0xc02b('0xa1'));}}}else{logger[_0xc02b('0x9e')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x49586d,_0x2e6731,_0xefbc9b){if(_0x2e6731>_0xefbc9b){for(var _0x2ac6b9=0x0;_0x2ac6b9<_0x2e6731-_0xefbc9b;_0x2ac6b9+=0x1){decremetOriginate(_0x49586d);}}}function loggerGetContactDialer(_0xe484fe,_0x1c6f2c,_0x5677dc){return function(_0x45c389){checkContactLowerLimitOriginate(_0x1c6f2c,_0x5677dc,0x0);logger[_0xc02b('0x9e')](_0xe484fe,util[_0xc02b('0x9d')](_0x45c389,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x25e198){return function(_0x174526){if(isNotNull(_0x174526)&&isNotNull(_0x174526[0x0])){if(_0x174526[0x0][_0xc02b('0xa2')]>0x0){_0x25e198[_0xc02b('0x42')]=_0xc02b('0xa3');logger[_0xc02b('0x86')]('[getContactDialer2][ReScheduled]'+_0x25e198[_0xc02b('0x44')],_0x174526[0x0][_0xc02b('0xa2')],_0xc02b('0xa4'));}else{_0x25e198['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xc02b('0x86')](_0xc02b('0xa5')+_0x25e198['name']);}}};}function notSendMessagesQueue(_0x40b63c){if(_0x40b63c[_0xc02b('0xa6')]){freeVariablesPredictive(_0x40b63c);if(_0x40b63c['originated']===0x0&&_0x40b63c['talking']===0x0&&_0x40b63c[_0xc02b('0xa7')]===0x0&&(_0x40b63c['pTalking']||0x0)===0x0){_0x40b63c[_0xc02b('0xa6')]=![];_0x40b63c['available']=0x0;_0x40b63c['message']=_0xc02b('0x46');loggerSyncQueueSummary[_0xc02b('0x9c')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x40b63c['name'],'is\x20not\x20active');}else{_0x40b63c[_0xc02b('0x42')]=_0xc02b('0xa8');loggerSyncQueueSummary[_0xc02b('0x9c')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x40b63c[_0xc02b('0x44')],_0xc02b('0xa9'));}emitVoiceQueueSummary(_0x40b63c);}}function notSendMessagesCampaign(_0x2ac5dc){if(_0x2ac5dc['sendMessageOneNotActive']){if(_0x2ac5dc[_0xc02b('0x78')]===0x0){_0x2ac5dc[_0xc02b('0xa6')]=![];_0x2ac5dc[_0xc02b('0x42')]=_0xc02b('0x46');loggerSyncQueueSummary[_0xc02b('0x9c')](_0xc02b('0xaa'),_0x2ac5dc[_0xc02b('0x44')],_0xc02b('0xab'));}else{_0x2ac5dc[_0xc02b('0x42')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc02b('0x9c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2ac5dc['name'],_0xc02b('0xa9'));}emitCampaignSummary(_0x2ac5dc);}}function createObjHistory(_0x4f2f79,_0x1fa2f5,_0x27b414,_0x3e7ac7,_0x449b11){_0x4f2f79['message']=_0x27b414;var _0x39abf9=new Action(_0x4f2f79,_0x1fa2f5);var _0x4386ce=new History(_0x39abf9);_0x4386ce[_0xc02b('0xac')]=_0x3e7ac7;_0x4386ce[_0xc02b('0xad')]=_0x449b11;_0x4386ce[_0xc02b('0xae')]=_0x39abf9[_0xc02b('0xaf')];return _0x4386ce;}Dialer[_0xc02b('0x1b')][_0xc02b('0x3d')]=function(){var _0x43d635=this;setInterval(function(){_0x43d635['clearZombieChannels'](_0x43d635[_0xc02b('0xb0')],_0xc02b('0xb1'));_0x43d635[_0xc02b('0xb2')](_0x43d635[_0xc02b('0x27')],'[actions]');},0x32c8);};Dialer[_0xc02b('0x1b')][_0xc02b('0xb2')]=function(_0x339881,_0x5db0db){var _0x564403=this;for(var _0x5aac53 in _0x339881){if(typeof _0x339881[_0x5aac53]!==_0xc02b('0xb3')){this[_0xc02b('0x1f')][_0xc02b('0x1c')](function(){if(!_[_0xc02b('0xb4')](_0x339881[_0x5aac53])){return ami[_0xc02b('0xb5')]({'action':_0xc02b('0xb6'),'channel':_0x339881[_0x5aac53][_0xc02b('0xb7')]})[_0xc02b('0xb8')](function(_0x3b3a79){if(_0x3b3a79[_0xc02b('0x42')]===_0xc02b('0xb9')){setTimeout(function(){if(_0x339881[_0x5aac53]&&_0x339881[_0x5aac53][_0xc02b('0x52')]!=='ivr'){_0x564403[_0xc02b('0xba')](_0x564403['voiceQueues'][_0x339881[_0x5aac53][_0xc02b('0xbb')]]);logger[_0xc02b('0x9e')](_0xc02b('0xbc'),_0x5db0db,_0x5aac53,_0x339881[_0x5aac53][_0xc02b('0xbb')]);delete _0x339881[_0x5aac53];}if(_0x339881[_0x5aac53]&&_0x339881[_0x5aac53][_0xc02b('0x52')]===_0xc02b('0x83')){_0x564403[_0xc02b('0xba')](_0x564403['campaigns'][_0x339881[_0x5aac53]['queue']]);logger[_0xc02b('0x9e')]('[Dialer][checkChannel][ivr]',_0x5db0db,_0x5aac53,_0x339881[_0x5aac53][_0xc02b('0xbb')]);delete _0x339881[_0x5aac53];}},0x2328);}});}});}}};Dialer[_0xc02b('0x1b')][_0xc02b('0xbd')]=function(_0xbf5da9){return Promise['resolve']()['then'](cmHopper[_0xc02b('0xbd')](_0xbf5da9))[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xbe')));};Dialer[_0xc02b('0x1b')][_0xc02b('0xbf')]=function(_0x450c5b){return Promise['resolve']()[_0xc02b('0x3f')](cmHopperBlack['checkIsBlackList'](_0x450c5b))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xc02b('0x1b')]['verifyAdditionalPhones']=function(_0x4976cb,_0x34e835,_0x598894){return Promise[_0xc02b('0xc0')]()[_0xc02b('0x3f')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x4976cb,_0x34e835,_0x598894))[_0xc02b('0xb8')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0xc02b('0x1b')][_0xc02b('0xc1')]=function(_0x597ac8,_0x33dc2a,_0x5732f8){return Promise[_0xc02b('0xc0')]()[_0xc02b('0x3f')](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x597ac8,_0x33dc2a,_0x5732f8))[_0xc02b('0xb8')](loggerCatch('[swapAdditionalPhone]\x20'));};Dialer[_0xc02b('0x1b')]['checkIsBlackListIvr']=function(_0x2e7b54){return Promise[_0xc02b('0xc0')]()['then'](cmHopperBlack[_0xc02b('0xc2')](_0x2e7b54))['catch'](loggerCatch(_0xc02b('0xc3')));};Dialer['prototype'][_0xc02b('0xc4')]=function(_0x12bf5e){return Promise['resolve']()[_0xc02b('0x3f')](cmHopperHistory[_0xc02b('0xc5')](_0x12bf5e))[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xc6')));};Dialer[_0xc02b('0x1b')][_0xc02b('0xc7')]=function(_0x6c6ce6){return Promise['resolve']()[_0xc02b('0x3f')](cmHopper[_0xc02b('0xc7')](_0x6c6ce6))[_0xc02b('0xb8')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xc02b('0x1b')][_0xc02b('0xc8')]=function(_0x3450ce,_0x6bf432,_0x27aeb3){return Promise['resolve']()[_0xc02b('0x3f')](cmHopper[_0xc02b('0xc8')](_0x3450ce,_0x6bf432,_0x27aeb3))[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xc9')));};Dialer[_0xc02b('0x1b')][_0xc02b('0xca')]=function(_0x3298bf,_0x21766e,_0x1707d0,_0x475b5d,_0x595ce9){return Promise['resolve']()[_0xc02b('0x3f')](cmHopper['getContactDialer'](_0x3298bf,_0x21766e,_0x1707d0,_0x475b5d))[_0xc02b('0xb8')](function(_0x3d38ad){_0x595ce9[_0xc02b('0xcb')]-=_0x1707d0;_0x595ce9[_0xc02b('0xcb')]=_0x595ce9[_0xc02b('0xcb')]>0x0?_0x595ce9['temp']:0x0;loggerCatch(_0xc02b('0xcc'))(_0x3d38ad);});};Dialer[_0xc02b('0x1b')][_0xc02b('0xcd')]=function(_0x23ed4a,_0x4854b3,_0x53ae8e,_0x12ce6b){return Promise['resolve']()[_0xc02b('0x3f')](cmHopper[_0xc02b('0xcd')](_0x23ed4a,_0x4854b3,_0x53ae8e))[_0xc02b('0xb8')](function(_0x3b0892){_0x12ce6b[_0xc02b('0xcb')]-=_0x4854b3;_0x12ce6b['temp']=_0x12ce6b[_0xc02b('0xcb')]>0x0?_0x12ce6b['temp']:0x0;loggerCatch(_0xc02b('0xce'))(_0x3b0892);});};Dialer[_0xc02b('0x1b')][_0xc02b('0xcf')]=function(_0x505172){return Promise[_0xc02b('0xc0')]()[_0xc02b('0x3f')](voiceQueueRt[_0xc02b('0xcf')](_0x505172))[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xd0')));};Dialer[_0xc02b('0x1b')][_0xc02b('0xd1')]=function(_0x4584d0){return Promise[_0xc02b('0xc0')]()['then'](cmHopper[_0xc02b('0xd1')](_0x4584d0))[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xd2')));};Dialer[_0xc02b('0x1b')]['createHistory']=function(_0x5e5590){return Promise[_0xc02b('0xc0')]()[_0xc02b('0x3f')](cmHopperHistory[_0xc02b('0xd3')](_0x5e5590))[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xd4')));};Dialer['prototype'][_0xc02b('0xba')]=function(_0x548d89){if(!_[_0xc02b('0x41')](_0x548d89)&&_0x548d89!==null){if(typeof _0x548d89[_0xc02b('0x78')]!=='undefined'){if(_0x548d89[_0xc02b('0x78')]>0x0){_0x548d89[_0xc02b('0x78')]-=0x1;}else{logger['error'](_0xc02b('0xd5'));}}}else{logger[_0xc02b('0x9e')](_0xc02b('0xd6'));}};Dialer[_0xc02b('0x1b')][_0xc02b('0xd7')]=function(_0x17fcbe,_0xf31e78){var _0x392911=this;return function(_0x16d699){_0x392911[_0xc02b('0xba')](_0xf31e78);logger['error'](_0x17fcbe,util['inspect'](_0x16d699,{'showHidden':![],'depth':null}));};};Dialer[_0xc02b('0x1b')]['emptyContact']=function(_0xb4639c,_0x1bc677,_0x30b5c7){var _0x230d1a={'state':0x19,'statedesc':_0xc02b('0xd8')};this[_0xc02b('0xba')](_0x1bc677);this[_0xc02b('0xd9')](_[_0xc02b('0x96')](_0x230d1a,_[_0xc02b('0xda')](_0x30b5c7,[_0xc02b('0xdb'),'ListId',_0xc02b('0xdc'),_0xc02b('0xdd'),_0xc02b('0xde')])),_0xc02b('0xdf'),_0xc02b('0xe0'));logger[_0xc02b('0x9e')](_0xb4639c);};Dialer['prototype'][_0xc02b('0xe1')]=function(_0x3e800f){return _0x3e800f===_0xc02b('0xe2');};Dialer[_0xc02b('0x1b')][_0xc02b('0xe3')]=function(_0x4b4090){return!_['isUndefined'](_0x4b4090)&&_0x4b4090&&!_[_0xc02b('0x41')](_0x4b4090['name'])&&!_[_0xc02b('0x41')](_0x4b4090[_0xc02b('0x7e')])&&_0x4b4090['active']&&(this['trunks'][util[_0xc02b('0x80')](_0xc02b('0xe4'),_0x4b4090[_0xc02b('0x44')])][_0xc02b('0xb6')]===_0xc02b('0xe5')||this[_0xc02b('0x24')][util['format'](_0xc02b('0xe4'),_0x4b4090[_0xc02b('0x44')])][_0xc02b('0xb6')]===_0xc02b('0xe6'));};Dialer[_0xc02b('0x1b')]['saveInDb']=function(_0x517f5e,_0x13efa2,_0x665dbf){this['createHistory'](_0x517f5e)[_0xc02b('0xb8')](loggerCatch(_0x13efa2));this[_0xc02b('0xd1')](_0x517f5e)[_0xc02b('0xb8')](loggerCatch(_0x665dbf));};Dialer['prototype'][_0xc02b('0x38')]=function(_0x14e553){var _0x1cbf6b=this;var _0x223ce6=this[_0xc02b('0xb0')][_0x14e553[_0xc02b('0xe7')]];var _0x210dc0;if(!_[_0xc02b('0xb4')](_0x14e553)&&!_[_0xc02b('0xb4')](_0x14e553[_0xc02b('0xe8')])&&!_[_0xc02b('0xb4')](_0x14e553[_0xc02b('0xe8')][_0xc02b('0xe9')])&&_0x14e553[_0xc02b('0xea')]===_0xc02b('0xeb')&&_0x223ce6){if(_0x223ce6['type']!==_0xc02b('0x83')&&this['voiceQueues'][_0x223ce6[_0xc02b('0xbb')]]['dialAMDActive']&&_0x14e553[_0xc02b('0xec')]===_0xc02b('0xed')){delete this[_0xc02b('0xb0')][_0x14e553[_0xc02b('0xe7')]];this['updateOriginated'](this['voiceQueues'][_0x223ce6[_0xc02b('0xbb')]]);this[_0xc02b('0x21')][_0x223ce6[_0xc02b('0xbb')]][_0xc02b('0x67')]+=0x1;this[_0xc02b('0x21')][_0x223ce6[_0xc02b('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;_0x210dc0=new Hangup(_0x223ce6,_0x14e553);_0x210dc0[_0xc02b('0xac')]=0x12;_0x210dc0[_0xc02b('0xad')]=_0xc02b('0xee');_0x210dc0[_0xc02b('0xef')]=_0xc02b('0xf0');ami[_0xc02b('0xf1')](_0xc02b('0xf2'),ut['buildObj'](_0x210dc0,_0xc02b('0xf3')));this[_0xc02b('0xd9')](_0x210dc0,_0xc02b('0xf4'),_0xc02b('0xf5'));}if(_0x223ce6[_0xc02b('0x52')]!=='ivr'&&this[_0xc02b('0x21')][_0x223ce6[_0xc02b('0xbb')]]['dialAMDActive']&&_0x14e553[_0xc02b('0xec')]===_0xc02b('0xf6')){return new Promise(function(_0x424d7e,_0x322bd1){delete _0x1cbf6b['uniqueId'][_0x14e553[_0xc02b('0xe7')]];_0x1cbf6b[_0xc02b('0xba')](_0x1cbf6b['voiceQueues'][_0x223ce6['queue']]);_0x1cbf6b[_0xc02b('0x21')][_0x223ce6[_0xc02b('0xbb')]][_0xc02b('0x67')]+=0x1;_0x1cbf6b[_0xc02b('0x21')][_0x223ce6[_0xc02b('0xbb')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1b0d6c=_0x1cbf6b[_0xc02b('0x21')][_0x223ce6['queue']];var _0x5a911f=new Hangup(_0x223ce6,_0x14e553);_0x5a911f['state']=0x13;_0x5a911f[_0xc02b('0xad')]=_0xc02b('0xf7');_0x5a911f['membername']=_0xc02b('0xf0');_0x5a911f[_0xc02b('0xf8')]+=0x1;_0x5a911f['countglobal']+=0x1;_0x5a911f[_0xc02b('0xf3')]=!![];ami['emit'](_0xc02b('0xf2'),ut[_0xc02b('0xf9')](_0x5a911f,_0xc02b('0xf3')));_0x1cbf6b[_0xc02b('0xd3')](_0x5a911f)['catch'](loggerCatch(_0xc02b('0xfa')));if(_0x5a911f[_0xc02b('0xfb')]+_0x5a911f[_0xc02b('0xfc')]+_0x5a911f[_0xc02b('0xfd')]+_0x5a911f[_0xc02b('0xfe')]+_0x5a911f[_0xc02b('0xff')]+_0x5a911f[_0xc02b('0x100')]+_0x5a911f['countmachineretry']+_0x5a911f[_0xc02b('0x101')]>=_0x1b0d6c['dialGlobalMaxRetry']){_0x1cbf6b[_0xc02b('0x102')](_0x5a911f,_0x424d7e,_0x322bd1,'reason19\x20machine....');}else{if(_0x5a911f[_0xc02b('0xf8')]>=_0x1b0d6c[_0xc02b('0x103')]){_0x1cbf6b[_0xc02b('0x104')](_0x5a911f,_0x424d7e,_0x322bd1,_0xc02b('0x105'));}else{_0x1cbf6b[_0xc02b('0xc7')]({'active':![],'countmachineretry':_0x5a911f['countmachineretry'],'scheduledat':moment()[_0xc02b('0x106')](_0x1b0d6c[_0xc02b('0x107')],_0xc02b('0x108'))[_0xc02b('0x80')](_0xc02b('0x109')),'ContactId':_0x5a911f['ContactId'],'ListId':_0x5a911f[_0xc02b('0x10a')],'VoiceQueueId':_0x5a911f['VoiceQueueId']||undefined,'CampaignId':_0x5a911f['CampaignId']||undefined})[_0xc02b('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x424d7e({'reschedule':0x1});}}});}if(_0x223ce6[_0xc02b('0x52')]==='ivr'&&this[_0xc02b('0x22')][_0x223ce6[_0xc02b('0xbb')]]['dialAMDActive']&&_0x14e553[_0xc02b('0xec')]==='HANGUP'){delete this[_0xc02b('0xb0')][_0x14e553['uniqueid']];this[_0xc02b('0xba')](this['campaigns'][_0x223ce6[_0xc02b('0xbb')]]);_0x210dc0=new Hangup(_0x223ce6,_0x14e553);_0x210dc0['state']=0x12;_0x210dc0[_0xc02b('0xad')]='HangupInAMD';_0x210dc0['membername']='AMD';ami[_0xc02b('0xf1')]('custom:amd',ut[_0xc02b('0xf9')](_0x210dc0,'amd'));this[_0xc02b('0xd9')](_0x210dc0,_0xc02b('0x10b'),_0xc02b('0x10c'));}if(_0x223ce6[_0xc02b('0x52')]===_0xc02b('0x83')&&this[_0xc02b('0x22')][_0x223ce6[_0xc02b('0xbb')]]['dialAMDActive']&&_0x14e553[_0xc02b('0xec')]===_0xc02b('0xf6')){return new Promise(function(_0x4b22ff,_0x4e1097){delete _0x1cbf6b[_0xc02b('0xb0')][_0x14e553[_0xc02b('0xe7')]];_0x1cbf6b[_0xc02b('0xba')](_0x1cbf6b[_0xc02b('0x22')][_0x223ce6[_0xc02b('0xbb')]]);_0x1cbf6b['campaigns'][_0x223ce6[_0xc02b('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x1cbf6b[_0xc02b('0x22')][_0x223ce6[_0xc02b('0xbb')]][_0xc02b('0x66')]+=0x1;var _0x149b16=_0x1cbf6b[_0xc02b('0x22')][_0x223ce6[_0xc02b('0xbb')]];var _0x3e3e53=new Hangup(_0x223ce6,_0x14e553);_0x3e3e53[_0xc02b('0xac')]=0x13;_0x3e3e53[_0xc02b('0xad')]=_0xc02b('0xf7');_0x3e3e53[_0xc02b('0xef')]=_0xc02b('0xf0');_0x3e3e53[_0xc02b('0xf8')]+=0x1;_0x3e3e53['countglobal']+=0x1;_0x3e3e53[_0xc02b('0xf3')]=!![];ami['emit'](_0xc02b('0xf2'),ut[_0xc02b('0xf9')](_0x3e3e53,_0xc02b('0xf3')));_0x1cbf6b[_0xc02b('0xd3')](_0x3e3e53)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xfa')));if(_0x3e3e53[_0xc02b('0xfb')]+_0x3e3e53[_0xc02b('0xfc')]+_0x3e3e53[_0xc02b('0xfd')]+_0x3e3e53[_0xc02b('0xfe')]+_0x3e3e53['countdropretry']+_0x3e3e53[_0xc02b('0x100')]+_0x3e3e53[_0xc02b('0xf8')]+_0x3e3e53[_0xc02b('0x101')]>=_0x149b16[_0xc02b('0x10d')]){_0x1cbf6b[_0xc02b('0x102')](_0x3e3e53,_0x4b22ff,_0x4e1097,_0xc02b('0x10e'));}else{if(_0x3e3e53[_0xc02b('0xf8')]>=_0x149b16['dialMachineMaxRetry']){_0x1cbf6b['createStateFinal'](_0x3e3e53,_0x4b22ff,_0x4e1097,'reason\x2019\x20machine....');}else{_0x1cbf6b[_0xc02b('0xc7')]({'active':![],'countmachineretry':_0x3e3e53[_0xc02b('0xf8')],'scheduledat':moment()[_0xc02b('0x106')](_0x149b16[_0xc02b('0x107')],_0xc02b('0x108'))[_0xc02b('0x80')](_0xc02b('0x109')),'ContactId':_0x3e3e53[_0xc02b('0xdb')],'ListId':_0x3e3e53['ListId'],'VoiceQueueId':_0x3e3e53['VoiceQueueId']||undefined,'CampaignId':_0x3e3e53[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x10f')));_0x4b22ff({'reschedule':0x1});}}});}}};Dialer[_0xc02b('0x1b')][_0xc02b('0x110')]=function(_0xc305cf){var _0x133618=this['uniqueId'][_0xc305cf[_0xc02b('0xe7')]];var _0x56066c;if(_0x133618&&_0x133618[_0xc02b('0x52')]==='ivr'){delete this['uniqueId'][_0xc305cf[_0xc02b('0xe7')]];this['updateOriginated'](this[_0xc02b('0x22')][_0x133618[_0xc02b('0xbb')]]);this[_0xc02b('0x22')][_0x133618[_0xc02b('0xbb')]]['ivrAnswerCallsDay']+=0x1;_0x56066c=new Hangup(_0x133618,_0xc305cf);this['createHistory'](_0x56066c)[_0xc02b('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc02b('0xd1')](_0x56066c)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x111')));}if(_0x133618&&_0x133618['type']!==_0xc02b('0x83')&&isNotNull(this[_0xc02b('0x21')][_0x133618[_0xc02b('0xbb')]][_0xc02b('0x112')])){delete this[_0xc02b('0xb0')][_0xc305cf['uniqueid']];this[_0xc02b('0xba')](this[_0xc02b('0x21')][_0x133618[_0xc02b('0xbb')]]);this[_0xc02b('0x21')][_0x133618['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xc02b('0x21')][_0x133618[_0xc02b('0xbb')]][_0xc02b('0x66')]+=0x1;_0x56066c=new Hangup(_0x133618,_0xc305cf);_0x56066c[_0xc02b('0xac')]=0x10;_0x56066c[_0xc02b('0xad')]='AnswerAGI';_0x56066c[_0xc02b('0xef')]=_0xc02b('0x113');this[_0xc02b('0xd3')](_0x56066c)['catch'](loggerCatch(_0xc02b('0x114')));this[_0xc02b('0xd1')](_0x56066c)[_0xc02b('0xb8')](loggerCatch('[syncHangupIvr]'));}if(_0x133618&&_0x133618[_0xc02b('0x52')]!=='ivr'&&!isNotNull(this[_0xc02b('0x21')][_0x133618[_0xc02b('0xbb')]]['dialQueueProject'])){delete this[_0xc02b('0xb0')][_0xc305cf[_0xc02b('0xe7')]];this['updateOriginated'](this['voiceQueues'][_0x133618[_0xc02b('0xbb')]]);this[_0xc02b('0x21')][_0x133618['queue']][_0xc02b('0x6e')]+=0x1;_0x56066c=new Hangup(_0x133618,_0xc305cf);_0x56066c[_0xc02b('0xac')]=0xc;_0x56066c[_0xc02b('0xad')]=_0xc305cf[_0xc02b('0x115')];_0x56066c[_0xc02b('0xef')]='Unknow';this[_0xc02b('0xd3')](_0x56066c)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x114')));this['moveContactManagedDialer'](_0x56066c)[_0xc02b('0xb8')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc02b('0x1b')][_0xc02b('0x31')]=function(_0x2beddc){var _0x5b20c6=this[_0xc02b('0xb0')][_0x2beddc[_0xc02b('0xe7')]];if(this[_0xc02b('0x21')][_0x2beddc[_0xc02b('0xbb')]]){if(_0x5b20c6&&_0x5b20c6['type']!==_0xc02b('0x83')){delete this[_0xc02b('0xb0')][_0x2beddc[_0xc02b('0xe7')]];this[_0xc02b('0x21')][_0x2beddc[_0xc02b('0xbb')]][_0xc02b('0x67')]+=0x1;var _0x148179=new AgentComplete(_0x5b20c6,_0x2beddc);if(_0x2beddc[_0xc02b('0x116')]===_0xc02b('0x117')){_0x148179['agiafterat']=this['voiceQueues'][_0x2beddc['queue']][_0xc02b('0x118')]&&this[_0xc02b('0x21')][_0x2beddc[_0xc02b('0xbb')]][_0xc02b('0x119')]?moment()[_0xc02b('0x80')](_0xc02b('0x109')):undefined;}this['createHistory'](_0x148179)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x11a')));this[_0xc02b('0xd1')](_0x148179)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x11b')));}}};Dialer['prototype'][_0xc02b('0x11c')]=function(_0x380f34){if(this[_0xc02b('0x21')][_0x380f34[_0xc02b('0xbb')]]){if(this[_0xc02b('0xb0')][_0x380f34[_0xc02b('0xe7')]]&&this['uniqueId'][_0x380f34[_0xc02b('0xe7')]]['type']!==_0xc02b('0x83')){this['updateOriginated'](this[_0xc02b('0x21')][_0x380f34[_0xc02b('0xbb')]]);this[_0xc02b('0xb0')][_0x380f34[_0xc02b('0xe7')]][_0xc02b('0x11d')]=moment()[_0xc02b('0x80')](_0xc02b('0x109'));}}};Dialer[_0xc02b('0x1b')][_0xc02b('0x11e')]=function(_0x457878,_0x244c8d){this[_0xc02b('0xd3')](_0x457878)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x11a')));if(_0x244c8d==0x0){this[_0xc02b('0xd1')](_0x457878)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x11f')));}};Dialer[_0xc02b('0x1b')][_0xc02b('0x120')]=function(_0x77c29f){var _0x50e40d=this[_0xc02b('0xb0')][_0x77c29f[_0xc02b('0xe7')]];var _0x47e0f7=this;var _0x4348ad=![];var _0x373ac5;var _0x176dbd;if(this['voiceQueues'][_0x77c29f[_0xc02b('0xbb')]]){if(_0x50e40d&&_0x50e40d[_0xc02b('0x52')]!==_0xc02b('0x83')){delete this[_0xc02b('0xb0')][_0x77c29f[_0xc02b('0xe7')]];this[_0xc02b('0xba')](this[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]]);_0x50e40d[_0xc02b('0x121')]=moment()['format'](_0xc02b('0x109'));var _0x17d30e=new QueueCallerAbandon(_0x50e40d,_0x77c29f);if(getSeconds(_0x50e40d[_0xc02b('0x121')],_0x50e40d[_0xc02b('0x122')])>=_0x50e40d[_0xc02b('0x123')]){this[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x73')]+=0x1;this['voiceQueues'][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x124')]+=0x1;this['voiceQueues'][_0x77c29f['queue']][_0xc02b('0x125')]+=0x1;_0x17d30e[_0xc02b('0xac')]=0xa;_0x17d30e['statedesc']=_0xc02b('0x126');_0x17d30e['dropreason']=_0xc02b('0x127');_0x17d30e[_0xc02b('0x128')]=this[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x118')]?moment()['format'](_0xc02b('0x109')):undefined;_0x17d30e['countdropretry']+=0x1;_0x17d30e['countglobal']+=0x1;_0x373ac5=this[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x129')];_0x176dbd=this[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x12a')];_0x47e0f7[_0xc02b('0x12b')](_0x17d30e,_0x17d30e[_0xc02b('0xac')],_0x50e40d[_0xc02b('0x12c')])['then'](function(_0x457eda){_0x4348ad=_0x457eda[_0xc02b('0x12d')]==0x1;if(_0x17d30e[_0xc02b('0xff')]>=_0x47e0f7[_0xc02b('0x21')][_0x77c29f['queue']][_0xc02b('0x12e')]){_0x47e0f7['queueCallerAbandonCreateState'](_0x17d30e,_0x457eda[_0xc02b('0x12d')]);}else{_0x47e0f7[_0xc02b('0xc7')]({'active':![],'countdropretry':_0x17d30e[_0xc02b('0xff')],'scheduledat':moment()[_0xc02b('0x106')](_0x47e0f7[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x129')],'minutes')[_0xc02b('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50e40d['ContactId'],'ListId':_0x50e40d[_0xc02b('0x10a')],'VoiceQueueId':_0x50e40d[_0xc02b('0xdd')]||undefined,'CampaignId':_0x50e40d[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x12f')));var _0x21af2c=new History(_0x17d30e);_0x21af2c['state']=0xa;_0x21af2c[_0xc02b('0xad')]=_0xc02b('0x126');_0x21af2c[_0xc02b('0xaf')]=moment()['format'](_0xc02b('0x109'));_0x21af2c[_0xc02b('0xae')]=_0x21af2c['starttime'];_0x21af2c[_0xc02b('0x130')]=_0x17d30e['calleridname'];_0x21af2c[_0xc02b('0x131')]=_0x17d30e[_0xc02b('0x131')];_0x47e0f7[_0xc02b('0xd3')](_0x21af2c)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x132')));}})[_0xc02b('0x3f')](function(){if(_0x4348ad)_0x47e0f7['swapAdditionalPhones'](_0x17d30e,_0x373ac5,_0x176dbd)[_0xc02b('0x3f')](function(){return 0x1;});});}else{this[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x72')]+=0x1;this[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x6b')]+=0x1;_0x17d30e[_0xc02b('0xac')]=0xb;_0x17d30e[_0xc02b('0xad')]=_0xc02b('0x133');_0x17d30e[_0xc02b('0x134')]=_0xc02b('0x135');_0x17d30e[_0xc02b('0x100')]+=0x1;_0x17d30e[_0xc02b('0x136')]+=0x1;_0x373ac5=this['voiceQueues'][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x137')];_0x176dbd=this[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]]['callAdditionalPhoneAfterMin'];_0x47e0f7[_0xc02b('0x12b')](_0x17d30e,_0x17d30e[_0xc02b('0xac')],_0x50e40d[_0xc02b('0x12c')])['then'](function(_0x60ac8c){if(_0x17d30e[_0xc02b('0x100')]>=_0x47e0f7[_0xc02b('0x21')][_0x77c29f[_0xc02b('0xbb')]]['dialAbandonedMaxRetry']){_0x47e0f7[_0xc02b('0x11e')](_0x17d30e,_0x60ac8c[_0xc02b('0x12d')]);}else{_0x47e0f7[_0xc02b('0xc7')]({'active':![],'countabandonedretry':_0x17d30e[_0xc02b('0x100')],'scheduledat':moment()[_0xc02b('0x106')](_0x47e0f7['voiceQueues'][_0x77c29f[_0xc02b('0xbb')]][_0xc02b('0x137')],'minutes')['format'](_0xc02b('0x109')),'ContactId':_0x50e40d[_0xc02b('0xdb')],'ListId':_0x50e40d[_0xc02b('0x10a')],'VoiceQueueId':_0x50e40d[_0xc02b('0xdd')]||undefined,'CampaignId':_0x50e40d[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x138')));var _0x1d3a79=new History(_0x17d30e);_0x1d3a79[_0xc02b('0xac')]=0xb;_0x1d3a79[_0xc02b('0xad')]=_0xc02b('0x133');_0x1d3a79[_0xc02b('0xaf')]=moment()[_0xc02b('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d3a79['endtime']=_0x1d3a79['starttime'];_0x1d3a79[_0xc02b('0x130')]=_0x17d30e[_0xc02b('0x130')];_0x1d3a79[_0xc02b('0x131')]=_0x17d30e[_0xc02b('0x131')];_0x47e0f7[_0xc02b('0xd3')](_0x1d3a79)[_0xc02b('0xb8')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xc02b('0x3f')](function(){if(_0x4348ad)_0x47e0f7[_0xc02b('0xc1')](_0x17d30e,_0x373ac5,_0x176dbd)[_0xc02b('0x3f')](function(){return 0x1;});});}}}};Dialer[_0xc02b('0x1b')][_0xc02b('0x139')]=function(_0x31c887){if(this[_0xc02b('0x27')][_0x31c887['uniqueid']]){this[_0xc02b('0x27')][_0x31c887[_0xc02b('0xe7')]][_0xc02b('0xb7')]=_0x31c887['channel'];}if(this['uniqueId'][_0x31c887['uniqueid']]){this[_0xc02b('0xb0')][_0x31c887[_0xc02b('0xe7')]][_0xc02b('0xb7')]=_0x31c887[_0xc02b('0xb7')];}};Dialer[_0xc02b('0x1b')][_0xc02b('0x39')]=function(_0x12e286){if(strategy[this[_0xc02b('0x21')][this[_0xc02b('0x27')][_0x12e286['actionid']]['queue']][_0xc02b('0x54')]]===_0xc02b('0x1a')){if(this[_0xc02b('0x27')][_0x12e286[_0xc02b('0x13a')]]&&_[_0xc02b('0xb4')](this[_0xc02b('0x27')][_0x12e286['actionid']][_0xc02b('0x13b')])&&_0x12e286['status']==='1'&&_0x12e286['paused']==='0'){if(this[_0xc02b('0x23')][_0x12e286[_0xc02b('0x13c')]]){if(!this['agents'][_0x12e286['stateinterface']]['locked']){this[_0xc02b('0x23')][_0x12e286[_0xc02b('0x13c')]]['locked']=!![];this['actions'][_0x12e286[_0xc02b('0x13a')]][_0xc02b('0x13b')]=!![];this[_0xc02b('0x27')][_0x12e286['actionid']][_0xc02b('0x13c')]=_0x12e286[_0xc02b('0x13c')];}}}}else if((strategy[this[_0xc02b('0x21')][this[_0xc02b('0x27')][_0x12e286['actionid']][_0xc02b('0xbb')]][_0xc02b('0x54')]]||_0xc02b('0x19'))===_0xc02b('0x19')){if(this[_0xc02b('0x27')][_0x12e286[_0xc02b('0x13a')]]){if(this[_0xc02b('0x23')][_0x12e286[_0xc02b('0x13c')]]){this[_0xc02b('0x27')][_0x12e286['actionid']][_0xc02b('0x13c')]=_0x12e286[_0xc02b('0x13c')];if(_['isNil'](this[_0xc02b('0x2c')][this[_0xc02b('0x27')][_0x12e286[_0xc02b('0x13a')]][_0xc02b('0xbb')]])){this['queueBooked'][this['actions'][_0x12e286[_0xc02b('0x13a')]][_0xc02b('0xbb')]]=[];}this[_0xc02b('0x2c')][this[_0xc02b('0x27')][_0x12e286[_0xc02b('0x13a')]]['queue']]['push'](_['merge'](_[_0xc02b('0xda')](this[_0xc02b('0x27')][_0x12e286[_0xc02b('0x13a')]],['idHopper',_0xc02b('0x13c')]),{'status':_0x12e286[_0xc02b('0xb6')],'paused':_0x12e286[_0xc02b('0x13d')]}));}}}};function unlockQueueStatus(_0x442bea,_0x451e43){setTimeout(function(){if(_[_0xc02b('0x41')](_0x442bea[_0xc02b('0x13e')])){loggerBooked[_0xc02b('0x9e')](_0xc02b('0x13f'),_0x451e43);}_0x442bea[_0xc02b('0x13e')]=!![];loggerBooked['info'](_0xc02b('0x140'),_0x451e43,JSON['stringify'](_['pick'](_0x442bea,[_0xc02b('0x44'),_0xc02b('0x13e')])));},0x1f3);}Dialer[_0xc02b('0x1b')]['syncQueueStatusComplete']=function(_0x1d8f52){var _0x4ebc62=this;var _0x293a1a=_0x4ebc62[_0xc02b('0x21')][_0x4ebc62[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xbb')]];if(strategy[this[_0xc02b('0x21')][this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xbb')]][_0xc02b('0x54')]]===_0xc02b('0x1a')){if(this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]]&&this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0x13c')]){this[_0xc02b('0x20')][_0xc02b('0x141')](this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0x142')],this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0x13c')])[_0xc02b('0xb8')](function(_0xc250e2){logger[_0xc02b('0x9e')](_0xc02b('0x143'),util[_0xc02b('0x9d')](_0xc250e2,{'showHidden':![],'depth':null}));})['finally'](function(){_0x4ebc62[_0xc02b('0xba')](_0x4ebc62[_0xc02b('0x21')][_0x4ebc62[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xbb')]]);_0x4ebc62[_0xc02b('0x23')][_0x4ebc62[_0xc02b('0x27')][_0x1d8f52['actionid']]['stateinterface']][_0xc02b('0x13b')]=![];delete _0x4ebc62[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]];unlockQueueStatus(_0x293a1a);});}else{this[_0xc02b('0xba')](this[_0xc02b('0x21')][this['actions'][_0x1d8f52['actionid']]['queue']]);this[_0xc02b('0xc7')]({'active':![],'ContactId':this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xdb')],'ListId':this[_0xc02b('0x27')][_0x1d8f52['actionid']]['ListId'],'VoiceQueueId':this[_0xc02b('0x27')][_0x1d8f52['actionid']][_0xc02b('0xdd')]||undefined,'CampaignId':this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xde')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc02b('0x27')][_0x1d8f52['actionid']];unlockQueueStatus(_0x293a1a);}}else if((strategy[this['voiceQueues'][this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]]['queue']][_0xc02b('0x54')]]||_0xc02b('0x19'))===_0xc02b('0x19')){var _0x19fdd6;if(this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]]&&!_[_0xc02b('0x4b')](this[_0xc02b('0x2c')][this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xbb')]])){if(this['queueBookedRR'][_0x4ebc62[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xbb')]]){this[_0xc02b('0x144')][_0x4ebc62[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xbb')]]=this[_0xc02b('0x144')][this[_0xc02b('0x27')][_0x1d8f52['actionid']][_0xc02b('0xbb')]]?this['queueBookedRR'][this['actions'][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xbb')]]:this[_0xc02b('0x2c')][this['actions'][_0x1d8f52['actionid']][_0xc02b('0xbb')]]?this[_0xc02b('0x2c')][this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]]['queue']]['_rr']||0x0:0x0;}this[_0xc02b('0x2c')][this[_0xc02b('0x27')][_0x1d8f52[_0xc02b('0x13a')]][_0xc02b('0xbb')]][_0xc02b('0x145')]=this[_0xc02b('0x144')][this[_0xc02b('0x27')][_0x1d8f52['actionid']][_0xc02b('0xbb')]];for(var _0x48e57f=0x0;_0x48e57f=0x0;})['catch'](myreject(_0x4dd18e)));}}else{_0x26b451[_0xc02b('0x15d')](ami[_0xc02b('0xb5')]({'action':'command','command':util[_0xc02b('0x80')](_0xc02b('0x159'),_0x154647,!_['isUndefined'](config[_0xc02b('0x156')][_0x32df28])?_0x32df28:'')})[_0xc02b('0x3f')](function(_0x40ead6){return _0x40ead6[_0xc02b('0x15a')][_0xc02b('0x15b')](_0xc02b('0x15c'))>=0x0;})[_0xc02b('0xb8')](myreject(_0x4dd18e)));}Promise[_0xc02b('0x15e')](_0x26b451)[_0xc02b('0x3f')](function(_0x5a4017){var _0x3a09bd=_[_0xc02b('0x15f')](_0x5a4017);if(_0x3a09bd){return _0x4a4675(_0x3a09bd);}else{_0x30a035[_0xc02b('0x42')]=_0x4452cf?'GLOBAL_INTERVAL_IS_OVERTIME':_0xc02b('0x160');return _0x4dd18e(msgResponse(_0xc02b('0x161'),_0xc02b('0x155'),_0xc02b('0x162')+_0x4452cf+'\x20'+_0x2fb300+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x154647,{'showHidden':![],'depth':null})+_0xc02b('0x163')+_0x32df28));}})['catch'](function(_0x4b6bf0){return _0x4dd18e(msgResponse('ifTime',_0xc02b('0x155'),JSON[_0xc02b('0x4e')](_0x4b6bf0)));});});};Dialer[_0xc02b('0x1b')]['checkDialMethod']=function(_0x3f1f39){var _0x1236a0=this;return function(){switch(_0x3f1f39['dialMethod']){case _0xc02b('0x164'):freeVariablesPredictive(_0x3f1f39);_0x1236a0[_0xc02b('0x165')](_0x3f1f39,0x1);break;case'power':freeVariablesPredictive(_0x3f1f39);_0x1236a0[_0xc02b('0x165')](_0x3f1f39,_0x3f1f39['dialPowerLevel']);break;case _0xc02b('0xa'):_0x1236a0[_0xc02b('0xa')](_0x3f1f39);break;case _0xc02b('0x9'):freeVariablesPredictive(_0x3f1f39);_0x1236a0['handlePower'](_0x3f1f39,0x1);break;default:freeVariablesPredictive(_0x3f1f39);logger[_0xc02b('0x9e')](_0xc02b('0x166'),_0x3f1f39[_0xc02b('0x44')],_0xc02b('0x167'));}};};Dialer[_0xc02b('0x1b')][_0xc02b('0x168')]=function(_0x26df9){return Promise['resolve']()[_0xc02b('0x3f')](cmHopper[_0xc02b('0x169')](_0x26df9['id'],previewRecallmeReminderInterval))[_0xc02b('0x3f')](function(_0x329843){for(var _0x4f0381=0x0;_0x4f0381<_0x329843[_0xc02b('0xa0')];_0x4f0381++){var _0x2bad27=_0x329843[_0x4f0381][_0xc02b('0x16a')][_0xc02b('0x44')];if(_0x2bad27)io['to'](util[_0xc02b('0x80')](_0xc02b('0x16b'),_0x2bad27))[_0xc02b('0xf1')]('user:dialPreviewRecallReminder',{'hopper':_0x329843[_0x4f0381]});}})[_0xc02b('0xb8')](function(){});};Dialer[_0xc02b('0x1b')]['launchHandleIvr']=function(_0xc139a6){var _0x25833e=this;return function(){_0x25833e[_0xc02b('0x16c')](_0xc139a6);};};Dialer['prototype'][_0xc02b('0x32')]=function(_0x58082c){var _0x2f788f=this;if(isNotPreview(_0x58082c['dialMethod'])){if(isVoiceQueueOutbound(_0x58082c[_0xc02b('0x52')])&&isActive(_0x58082c['dialActive'])){_0x58082c['sendMessageOneNotActive']=!![];Promise['resolve']()[_0xc02b('0x3f')](checkIsLoggedIn(_0x58082c,_0x58082c[_0xc02b('0x57')]))[_0xc02b('0x3f')](checkIsActive(_0x58082c,_0x58082c[_0xc02b('0x60')]))[_0xc02b('0x3f')](checkInterval(_0x58082c))['then'](_0x2f788f[_0xc02b('0x16d')](_0x58082c))[_0xc02b('0x3f')](_0x2f788f['checkIfTime'](_0x58082c[_0xc02b('0x16e')],_0x58082c[_0xc02b('0x16f')],_0x58082c[_0xc02b('0x44')],_0x58082c))[_0xc02b('0x3f')](_0x2f788f[_0xc02b('0x170')](_0x58082c['Interval'],_0x58082c[_0xc02b('0x16f')],_0x58082c[_0xc02b('0x44')],_0x58082c))[_0xc02b('0x3f')](_0x2f788f['checkDialMethod'](_0x58082c))['catch'](loggerCatchQueueSummary(_0xc02b('0x171'),_0x58082c));}else{notSendMessagesQueue(_0x58082c);}}else{freeVariablesPredictive(_0x58082c);}};Dialer[_0xc02b('0x1b')][_0xc02b('0x34')]=_[_0xc02b('0x172')](function(){var _0xeabb16=_[_0xc02b('0x173')](this[_0xc02b('0x21')],function(_0x26ff74){return _0x26ff74[_0xc02b('0x174')];});var _0x359a49=_['filter'](this[_0xc02b('0x23')],function(_0x138395){return _0x138395[_0xc02b('0x175')]&&_0x138395[_0xc02b('0xb6')]==='reachable';});if(_0xeabb16[_0xc02b('0xa0')]>0x0&&_0x359a49['length']>0x0){return Promise[_0xc02b('0xc0')]()[_0xc02b('0x3f')](cmHopper[_0xc02b('0x169')](_[_0xc02b('0x176')](_0xeabb16,'id'),previewRecallmeReminderInterval,_['map'](_0x359a49,'id')))[_0xc02b('0x3f')](function(_0x19a849){for(var _0x2ff309=0x0;_0x2ff309<_0x19a849[_0xc02b('0xa0')];_0x2ff309++){var _0x2afe3f=_0x19a849[_0x2ff309][_0xc02b('0x16a')][_0xc02b('0x44')];if(_0x2afe3f)io['to'](util[_0xc02b('0x80')](_0xc02b('0x16b'),_0x2afe3f))['emit']('user:dialPreviewRecallReminder',{'hopper':_0x19a849[_0x2ff309]});}})['catch'](function(_0x35ec3b){logger['error'](_0xc02b('0x168'),_0x35ec3b);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xc02b('0x1b')]['syncCampaigns']=function(){var _0x303a09=this;var _0x3fbfec;for(var _0xc5c130 in this['campaigns']){if(typeof this['campaigns'][_0xc5c130]!=='undefined'){_0x3fbfec=this[_0xc02b('0x22')][_0xc5c130];if(isCampaignIvr(_0x3fbfec[_0xc02b('0x52')])&&isActive(_0x3fbfec['active'])){_0x3fbfec[_0xc02b('0xa6')]=!![];Promise[_0xc02b('0xc0')]()['then'](checkIsActive(_0x3fbfec,_0x3fbfec['active']))[_0xc02b('0x3f')](checkInterval(_0x3fbfec))[_0xc02b('0x3f')](_0x303a09[_0xc02b('0x16d')](_0x3fbfec))['then'](_0x303a09[_0xc02b('0x177')](_0x3fbfec[_0xc02b('0x16e')],_0x3fbfec[_0xc02b('0x16f')],_0x3fbfec[_0xc02b('0x44')],_0x3fbfec))[_0xc02b('0x3f')](_0x303a09[_0xc02b('0x170')](_0x3fbfec['Interval'],_0x3fbfec[_0xc02b('0x16f')],_0x3fbfec[_0xc02b('0x44')],_0x3fbfec))[_0xc02b('0x3f')](_0x303a09[_0xc02b('0x178')](_0x3fbfec))['catch'](loggerCatchQueueSummary(_0xc02b('0x179'),_0x3fbfec));}else{notSendMessagesCampaign(_0x3fbfec);}}}};function getCallerIdRandom(_0x3a4639,_0x1889c4){var _0x2594c1;var _0x5825f7;var _0x2b33c1;if(_0x1889c4<=0x0){_0x1889c4=0x1;}_0x2594c1=new RegExp(_0xc02b('0x17a')+_0x1889c4+'}$');_0x5825f7=Math[_0xc02b('0x17b')](0xa,_0x1889c4-0x1);_0x2b33c1=Math[_0xc02b('0x17b')](0xa,_0x1889c4)-0x1;return util[_0xc02b('0x80')]('%s',_[_0xc02b('0x17c')](_0x3a4639,_0x2594c1,_['random'](_0x5825f7,_0x2b33c1)));}function extractCalleridName(_0x243b92){var _0x1d10ba=_0x243b92[_0xc02b('0x17d')](/"(.*?)"/);return _0x1d10ba?_0x1d10ba[0x1]:_0x243b92;}Dialer['prototype'][_0xc02b('0x17e')]=function(_0x15c4ed,_0x57c8fb){var _0x366a25=this;var _0xfa0de5=uuid['v4']();this[_0xc02b('0x27')][_0xfa0de5]=new Action(_0x15c4ed,_0x57c8fb,_0xfa0de5);return new Promise(function(_0x28b4a8,_0x425367){if(_[_0xc02b('0x41')](_0x15c4ed)&&typeof _0x15c4ed!==_0xc02b('0x17f')){return _0x425367(msgResponse(_0xc02b('0x180'),_0xc02b('0x155'),_0xc02b('0x181')));}if(_[_0xc02b('0x41')](_0x57c8fb[_0xc02b('0x182')])||_0x57c8fb[_0xc02b('0x182')]===null){return _0x425367(msgResponse(_0xc02b('0x180'),_0xc02b('0x155'),_0xc02b('0x183')));}var _0x1e269a={'XMD-CALLERID':_0x366a25[_0xc02b('0x27')][_0xfa0de5][_0xc02b('0x184')](),'XMD-AGI':_0x15c4ed[_0xc02b('0x112')]?util[_0xc02b('0x80')](_0xc02b('0x185'),ipAgi,_0x15c4ed[_0xc02b('0x112')]):_0xc02b('0x186'),'XMD-AGIAFTER':_0x15c4ed['dialQueueProject2']?util[_0xc02b('0x80')](_0xc02b('0x185'),ipAgi,_0x15c4ed[_0xc02b('0x118')]):_0xc02b('0x186'),'XMD-QUEUE':_0x15c4ed['type']===_0xc02b('0x53')?util['format'](_0xc02b('0x187'),_0x15c4ed[_0xc02b('0x44')],_0x15c4ed[_0xc02b('0x188')]||'',_0x15c4ed['dialAgiAfterHangupAgent']?'c':'',_0x15c4ed[_0xc02b('0x123')]||0x3):'NONE','XMD-CONTACTID':_0x57c8fb['ContactId'],'XMD-CDRTYPE':_0xc02b('0x189'),'CALLERID(all)':_0x366a25[_0xc02b('0x27')][_0xfa0de5][_0xc02b('0x184')](),'XMD-AMD':_0x15c4ed[_0xc02b('0x18a')]?'ACTIVE':_0xc02b('0x186'),'XMD-DESTINATION':_0xc02b('0xeb')};if(_0x15c4ed['dialAMDActive']){_0x1e269a[_0xc02b('0x18b')]=_0x15c4ed[_0xc02b('0x18c')]||0x9c4;_0x1e269a[_0xc02b('0x18d')]=_0x15c4ed[_0xc02b('0x18e')]||0x5dc;_0x1e269a['XMD-AMDAFTERGREETINGSILENCE']=_0x15c4ed[_0xc02b('0x18f')]||0x320;_0x1e269a[_0xc02b('0x190')]=_0x15c4ed[_0xc02b('0x191')]||0x1388;_0x1e269a[_0xc02b('0x192')]=_0x15c4ed['dialAMDMinWordLength']||0x64;_0x1e269a[_0xc02b('0x193')]=_0x15c4ed['dialAMDBetweenWordsSilence']||0x32;_0x1e269a[_0xc02b('0x194')]=_0x15c4ed[_0xc02b('0x195')]||0x3;_0x1e269a[_0xc02b('0x196')]=_0x15c4ed[_0xc02b('0x197')]||0x100;_0x1e269a['XMD-AMDMAXIMUMWORDLENGTH']=_0x15c4ed[_0xc02b('0x198')]||0x1388;}if(_0x15c4ed[_0xc02b('0x52')]===_0xc02b('0x53')){_0x1e269a[_0xc02b('0x199')]=_0x57c8fb['VoiceQueueId'];}else{_0x1e269a[_0xc02b('0x19a')]=_0x57c8fb[_0xc02b('0xde')];}for(var _0x5da1b5 in _0x57c8fb['Contact']){if(typeof _0x57c8fb['Contact'][_0x5da1b5]!==_0xc02b('0xb3')){if(isNotNull(_0x57c8fb[_0xc02b('0x19b')][_0x5da1b5])&&_0x5da1b5!=='id'&&_0x5da1b5!==_0xc02b('0x19c')&&_0x5da1b5!==_0xc02b('0x19d')&&_0x5da1b5!==_0xc02b('0x19e')){_0x1e269a[util['format'](_0xc02b('0x19f'),_0xc02b('0x1a0'),_[_0xc02b('0x1a1')](_0x5da1b5))]=_0x57c8fb[_0xc02b('0x19b')][_0x5da1b5];}}}var _0x54cd86=_0x366a25[_0xc02b('0xe3')](_0x15c4ed[_0xc02b('0x7d')])?getCallerId(_0x15c4ed[_0xc02b('0x7d')][_0xc02b('0x7f')],_0x15c4ed[_0xc02b('0x62')],_0x15c4ed[_0xc02b('0x1a2')]>0x0?getCallerIdRandom(_0x15c4ed[_0xc02b('0x63')],_0x15c4ed['dialRandomLastDigitCallerIdNumber']):_0x15c4ed[_0xc02b('0x63')]):getCallerId(_[_0xc02b('0xb4')](_0x15c4ed[_0xc02b('0x1a3')])?_0x15c4ed[_0xc02b('0x7d')][_0xc02b('0x7f')]:_0x15c4ed[_0xc02b('0x1a3')]['callerid'],_0x15c4ed[_0xc02b('0x62')],_0x15c4ed['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x15c4ed[_0xc02b('0x63')],_0x15c4ed[_0xc02b('0x1a2')]):_0x15c4ed[_0xc02b('0x63')]);if(_0x54cd86){_0x1e269a[_0xc02b('0x1a4')]=_0x366a25['actions'][_0xfa0de5]['originatecalleridname']=extractCalleridName(_0x54cd86);_0x1e269a['XMD-ORIGINATECALLERIDNUM']=_0x57c8fb[_0xc02b('0x182')];}_0x15c4ed['variables']=_0x1e269a;return ami[_0xc02b('0xb5')]({'actionid':_0xfa0de5,'action':_0xc02b('0x180'),'channel':_0x366a25[_0xc02b('0xe3')](_0x15c4ed[_0xc02b('0x7d')])?util[_0xc02b('0x80')]('SIP/%s/%s%s',_0x15c4ed[_0xc02b('0x7d')][_0xc02b('0x44')],isNotNull(_0x15c4ed['dialPrefix'])?_0x15c4ed['dialPrefix'][_0xc02b('0x1a5')]()||'':'',_0x15c4ed[_0xc02b('0x1a6')]>0x0?_0x57c8fb[_0xc02b('0x182')]['substring'](_0x15c4ed[_0xc02b('0x1a6')]):_0x57c8fb[_0xc02b('0x182')]):util[_0xc02b('0x80')](_0xc02b('0x1a7'),_[_0xc02b('0xb4')](_0x15c4ed[_0xc02b('0x1a3')])?_0x15c4ed['Trunk'][_0xc02b('0x44')]:_0x15c4ed[_0xc02b('0x1a3')][_0xc02b('0x44')],isNotNull(_0x15c4ed[_0xc02b('0x65')])?_0x15c4ed[_0xc02b('0x65')][_0xc02b('0x1a5')]()||'':'',_0x15c4ed['dialCutDigit']>0x0?_0x57c8fb[_0xc02b('0x182')]['substring'](_0x15c4ed[_0xc02b('0x1a6')]):_0x57c8fb[_0xc02b('0x182')]),'callerid':_0x54cd86,'Exten':_0xc02b('0xeb'),'Context':'from-sip','Priority':'1','variable':_0x1e269a,'timeout':(_0x15c4ed[_0xc02b('0x64')]||0x1e)*0x3e8,'async':!![],'channelid':_0xfa0de5})[_0xc02b('0x3f')](function(_0x449068){return _0x28b4a8(_0x449068);})[_0xc02b('0xb8')](function(_0x26a445){_0x15c4ed[_0xc02b('0x1a8')]+=0x1;var _0x10f6c4=new History(_0x366a25[_0xc02b('0x27')][_0xfa0de5]);logger[_0xc02b('0x9e')](util[_0xc02b('0x80')]('[originateError]:\x20%s',JSON[_0xc02b('0x4e')](_0x26a445)));_0x10f6c4[_0xc02b('0xac')]=0xe;_0x10f6c4['statedesc']=_0xc02b('0x1a9');_0x10f6c4[_0xc02b('0xaf')]=moment()[_0xc02b('0x80')](_0xc02b('0x109'));_0x10f6c4[_0xc02b('0xae')]=_0x10f6c4[_0xc02b('0xaf')];_0x366a25[_0xc02b('0xd3')](_0x10f6c4)['catch'](loggerCatch(_0xc02b('0x1aa')));_0x366a25[_0xc02b('0xd1')](_0x10f6c4)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x1aa')))[_0xc02b('0x1e')](function(){delete _0x366a25['actions'][_0xfa0de5];return _0x425367(msgResponse(_0xc02b('0x180'),_0xc02b('0x4d'),'originate\x20action\x20Error'));});});});};Dialer[_0xc02b('0x1b')][_0xc02b('0x1ab')]=function(_0x4a0d6c){var _0x514790=this[_0xc02b('0x27')][_0x4a0d6c[_0xc02b('0x13a')]];if(_0x514790){delete this[_0xc02b('0x27')][_0x4a0d6c[_0xc02b('0x13a')]];_0x514790['responsetime']=moment()[_0xc02b('0x80')](_0xc02b('0x109'));var _0x311af1=_0x514790[_0xc02b('0x52')]===_0xc02b('0x83')?this[_0xc02b('0x22')][_0x514790[_0xc02b('0xbb')]]:this[_0xc02b('0x21')][_0x514790['getQueue']()];if(!this[_0xc02b('0xe1')](_0x4a0d6c[_0xc02b('0x1ac')])){this[_0xc02b('0xba')](_0x311af1);return this[_0xc02b('0x1ad')](_0x514790,_0x311af1,_0x4a0d6c)[_0xc02b('0xb8')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x4a0d6c[_0xc02b('0xe7')]]=_0x514790;}};Dialer[_0xc02b('0x1b')]['checkRetriveMax']=function(_0x220db9,_0x3add34,_0x3cbab3){var _0xcbb9b2=new History(_0x3add34);if(_0xcbb9b2[_0xc02b('0xfb')]+_0xcbb9b2['countcongestionretry']+_0xcbb9b2[_0xc02b('0xfd')]+_0xcbb9b2[_0xc02b('0xfe')]+_0xcbb9b2[_0xc02b('0xff')]+_0xcbb9b2[_0xc02b('0x100')]+_0xcbb9b2[_0xc02b('0xf8')]+_0xcbb9b2[_0xc02b('0x101')]>=_0x3cbab3[_0xc02b('0x10d')]-0x1){return!![];}switch(_0x220db9){case 0x3:if(_0xcbb9b2['countnoanswerretry']>=_0x3cbab3[_0xc02b('0x1ae')]-0x1){return!![];}this[_0xc02b('0xc7')]({'active':![],'countnoanswerretry':_0xcbb9b2[_0xc02b('0xfd')]+=0x1,'scheduledat':moment()[_0xc02b('0x106')](_0x3cbab3['dialNoAnswerRetryFrequency'],'minutes')[_0xc02b('0x80')](_0xc02b('0x109')),'ContactId':_0xcbb9b2[_0xc02b('0xdb')],'ListId':_0xcbb9b2['ListId'],'VoiceQueueId':_0xcbb9b2[_0xc02b('0xdd')]||undefined,'CampaignId':_0xcbb9b2['CampaignId']||undefined})['catch'](loggerCatch(_0xc02b('0x1af')));break;case 0x5:if(_0xcbb9b2[_0xc02b('0xfb')]>=_0x3cbab3[_0xc02b('0x1b0')]-0x1){return!![];}this[_0xc02b('0xc7')]({'active':![],'countbusyretry':_0xcbb9b2[_0xc02b('0xfb')]+=0x1,'scheduledat':moment()[_0xc02b('0x106')](_0x3cbab3[_0xc02b('0x1b1')],_0xc02b('0x108'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xcbb9b2[_0xc02b('0xdb')],'ListId':_0xcbb9b2[_0xc02b('0x10a')],'VoiceQueueId':_0xcbb9b2['VoiceQueueId']||undefined,'CampaignId':_0xcbb9b2[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x1b2')));break;case 0x8:if(_0xcbb9b2[_0xc02b('0xfc')]>=_0x3cbab3[_0xc02b('0x1b3')]-0x1){return!![];}this[_0xc02b('0xc7')]({'active':![],'countcongestionretry':_0xcbb9b2[_0xc02b('0xfc')]+=0x1,'scheduledat':moment()[_0xc02b('0x106')](_0x3cbab3[_0xc02b('0x1b4')],_0xc02b('0x108'))[_0xc02b('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xcbb9b2[_0xc02b('0xdb')],'ListId':_0xcbb9b2[_0xc02b('0x10a')],'VoiceQueueId':_0xcbb9b2[_0xc02b('0xdd')]||undefined,'CampaignId':_0xcbb9b2[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x1b5')));break;case 0x0:if(_0xcbb9b2[_0xc02b('0xfe')]>=_0x3cbab3[_0xc02b('0x1b6')]-0x1){return!![];}else{this[_0xc02b('0xc7')]({'active':![],'countnosuchnumberretry':_0xcbb9b2[_0xc02b('0xfe')]+=0x1,'scheduledat':moment()[_0xc02b('0x106')](_0x3cbab3[_0xc02b('0x1b7')],_0xc02b('0x108'))[_0xc02b('0x80')](_0xc02b('0x109')),'ContactId':_0xcbb9b2[_0xc02b('0xdb')],'ListId':_0xcbb9b2[_0xc02b('0x10a')],'VoiceQueueId':_0xcbb9b2[_0xc02b('0xdd')]||undefined,'CampaignId':_0xcbb9b2[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x1b8')));}break;case 0xa:if(_0xcbb9b2[_0xc02b('0xff')]>=_0x3cbab3[_0xc02b('0x12e')]-0x1){return!![];}this[_0xc02b('0xc7')]({'active':![],'countdropretry':_0xcbb9b2[_0xc02b('0xff')]+=0x1,'scheduledat':moment()['add'](_0x3cbab3[_0xc02b('0x129')],'minutes')[_0xc02b('0x80')](_0xc02b('0x109')),'ContactId':_0xcbb9b2[_0xc02b('0xdb')],'ListId':_0xcbb9b2['ListId'],'VoiceQueueId':_0xcbb9b2['VoiceQueueId']||undefined,'CampaignId':_0xcbb9b2['CampaignId']||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x12f')));break;case 0xb:if(_0xcbb9b2[_0xc02b('0x100')]>=_0x3cbab3[_0xc02b('0x1b9')]-0x1){return!![];}this[_0xc02b('0xc7')]({'active':![],'countabandonedretry':_0xcbb9b2['countabandonedretry']+=0x1,'scheduledat':moment()[_0xc02b('0x106')](_0x3cbab3[_0xc02b('0x137')],'minutes')[_0xc02b('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xcbb9b2['ContactId'],'ListId':_0xcbb9b2[_0xc02b('0x10a')],'VoiceQueueId':_0xcbb9b2[_0xc02b('0xdd')]||undefined,'CampaignId':_0xcbb9b2[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x138')));break;case 0x13:if(_0xcbb9b2[_0xc02b('0xf8')]>=_0x3cbab3['dialMachineMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0xcbb9b2[_0xc02b('0xf8')]+=0x1,'scheduledat':moment()[_0xc02b('0x106')](_0x3cbab3[_0xc02b('0x107')],_0xc02b('0x108'))[_0xc02b('0x80')](_0xc02b('0x109')),'ContactId':_0xcbb9b2[_0xc02b('0xdb')],'ListId':_0xcbb9b2[_0xc02b('0x10a')],'VoiceQueueId':_0xcbb9b2[_0xc02b('0xdd')]||undefined,'CampaignId':_0xcbb9b2[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x10f')));break;case 0x14:if(_0xcbb9b2[_0xc02b('0x101')]>=_0x3cbab3[_0xc02b('0x1ba')]-0x1){return!![];}this[_0xc02b('0xc7')]({'active':![],'countagentrejectretry':_0xcbb9b2[_0xc02b('0x101')]+=0x1,'scheduledat':moment()[_0xc02b('0x106')](_0x3cbab3['dialAgentRejectRetryFrequency'],'minutes')[_0xc02b('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xcbb9b2[_0xc02b('0xdb')],'ListId':_0xcbb9b2[_0xc02b('0x10a')],'VoiceQueueId':_0xcbb9b2['VoiceQueueId']||undefined,'CampaignId':_0xcbb9b2['CampaignId']||undefined})['catch'](loggerCatch(_0xc02b('0x1bb')));break;default:return!![];}};Dialer[_0xc02b('0x1b')]['callProgressDetecting']=function(_0x22dded,_0x12f7ed,_0x457fd6){var _0xd77b75=this;var _0x41adb3=new History(_0x22dded);var _0x535e46=![];var _0x5058c4;var _0x511bc8;return new Promise(function(_0x34c3b8,_0x4d0a93){if(_[_0xc02b('0x41')](_0x12f7ed)&&typeof _0x12f7ed!=='object'){return _0x4d0a93(msgResponse(_0xc02b('0x1bc'),_0xc02b('0x155'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x457fd6)&&typeof _0x457fd6!==_0xc02b('0x17f')){return _0x4d0a93(msgResponse(_0xc02b('0x1bc'),_0xc02b('0x155'),_0xc02b('0x1bd')));}_0xd77b75[_0xc02b('0x12b')](_0x41adb3,_0x457fd6[_0xc02b('0x116')],_0x12f7ed)['then'](function(_0x3dc632){if(_0x3dc632[_0xc02b('0x12d')]==0x1)_0x535e46=!![];switch(_0x457fd6[_0xc02b('0x116')]){case'0':_0x12f7ed['outboundNoSuchCallsDay']+=0x1;_0x41adb3[_0xc02b('0xac')]=0x0;_0x41adb3[_0xc02b('0xad')]=_0xc02b('0x1be');_0x41adb3[_0xc02b('0xfe')]+=0x1;_0x41adb3[_0xc02b('0x136')]+=0x1;ami[_0xc02b('0xf1')]('custom:agentnosuchnumber',ut[_0xc02b('0xf9')](_0x22dded,_0xc02b('0x1bf')));_0x5058c4=_0x12f7ed[_0xc02b('0x1b7')];_0x511bc8=_0x12f7ed[_0xc02b('0x12a')];_0xd77b75[_0xc02b('0xd3')](_0x41adb3)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xfa')));if(_0xd77b75[_0xc02b('0x1c0')](0x0,_0x22dded,_0x12f7ed)&&!_0x535e46){if(_0x41adb3[_0xc02b('0xfe')]>=_0x12f7ed[_0xc02b('0x1b6')]){_0xd77b75[_0xc02b('0x104')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1c1'));}else{_0xd77b75[_0xc02b('0x102')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1c1'));}}break;case'3':_0x12f7ed['outboundNoAnswerCallsDay']+=0x1;_0x41adb3[_0xc02b('0xac')]=0x3;_0x41adb3[_0xc02b('0xad')]=_0xc02b('0x1c2');_0x41adb3['countnoanswerretry']+=0x1;_0x41adb3[_0xc02b('0x136')]+=0x1;var _0x95465d=ut[_0xc02b('0x1c3')](_0x22dded,_0x12f7ed);ami[_0xc02b('0xf1')](_0xc02b('0x1c4'),_0x95465d);_0x5058c4=_0x12f7ed['dialNoAnswerRetryFrequency'];_0x511bc8=_0x12f7ed[_0xc02b('0x12a')];_0xd77b75[_0xc02b('0xd3')](_0x41adb3)['catch'](loggerCatch(_0xc02b('0x1c5')));if(_0xd77b75[_0xc02b('0x1c0')](0x3,_0x22dded,_0x12f7ed)&&!_0x535e46){if(_0x41adb3[_0xc02b('0xfd')]>=_0x12f7ed[_0xc02b('0x1ae')]){_0xd77b75[_0xc02b('0x104')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1c6'));}else{_0xd77b75[_0xc02b('0x102')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1c6'));}}break;case'5':_0x12f7ed[_0xc02b('0x1c7')]+=0x1;_0x41adb3['state']=0x5;_0x41adb3[_0xc02b('0xad')]=_0xc02b('0x1c8');_0x41adb3[_0xc02b('0xfb')]+=0x1;_0x41adb3[_0xc02b('0x136')]+=0x1;ami[_0xc02b('0xf1')](_0xc02b('0x1c9'),ut[_0xc02b('0xf9')](_0x22dded,'busy'));_0x5058c4=_0x12f7ed[_0xc02b('0x1b1')];_0x511bc8=_0x12f7ed[_0xc02b('0x12a')];_0xd77b75['createHistory'](_0x41adb3)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x1ca')));if(_0xd77b75[_0xc02b('0x1c0')](0x5,_0x22dded,_0x12f7ed)&&!_0x535e46){if(_0x41adb3[_0xc02b('0xfb')]>=_0x12f7ed[_0xc02b('0x1b0')]){_0xd77b75['createStateFinal'](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1cb'));}else{_0xd77b75['stateGlobal'](_0x41adb3,_0x34c3b8,_0x4d0a93,'reason\x205\x20busy');}}break;case'8':_0x12f7ed[_0xc02b('0x69')]+=0x1;_0x41adb3[_0xc02b('0xac')]=0x8;_0x41adb3[_0xc02b('0xad')]='Congestion';_0x41adb3[_0xc02b('0xfc')]+=0x1;_0x41adb3['countglobal']+=0x1;_0x5058c4=_0x12f7ed['dialCongestionRetryFrequency'];_0x511bc8=_0x12f7ed[_0xc02b('0x12a')];ami[_0xc02b('0xf1')]('custom:agentcongestion',ut[_0xc02b('0xf9')](_0x22dded,_0xc02b('0x1cc')));_0xd77b75[_0xc02b('0xd3')](_0x41adb3)['catch'](loggerCatch(_0xc02b('0x1cd')));if(_0xd77b75[_0xc02b('0x1c0')](0x8,_0x22dded,_0x12f7ed)&&!_0x535e46){if(_0x41adb3[_0xc02b('0xfc')]>=_0x12f7ed[_0xc02b('0x1b3')]){_0xd77b75[_0xc02b('0x104')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1ce'));}else{_0xd77b75[_0xc02b('0x102')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1ce'));}}break;case'11':_0x12f7ed[_0xc02b('0x1cf')]+=0x1;_0x41adb3[_0xc02b('0xac')]=0xb;_0x41adb3[_0xc02b('0xad')]=_0xc02b('0x133');_0x41adb3[_0xc02b('0x100')]+=0x1;_0x41adb3[_0xc02b('0x136')]+=0x1;_0x5058c4=_0x12f7ed[_0xc02b('0x137')];_0x511bc8=_0x12f7ed[_0xc02b('0x12a')];_0xd77b75['createHistory'](_0x41adb3)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x1d0')));if(_0xd77b75[_0xc02b('0x1c0')](0xb,_0x22dded,_0x12f7ed)&&!_0x535e46){if(_0x41adb3[_0xc02b('0x100')]>=_0x12f7ed[_0xc02b('0x1b9')]){_0xd77b75[_0xc02b('0x104')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1d1'));}else{_0xd77b75['stateGlobal'](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1d1'));}}break;case'20':_0x12f7ed[_0xc02b('0x6d')]+=0x1;_0x41adb3[_0xc02b('0xac')]=0x14;_0x41adb3[_0xc02b('0xad')]=_0xc02b('0x1d2');_0x41adb3[_0xc02b('0x101')]+=0x1;_0x41adb3['countglobal']+=0x1;_0x5058c4=_0x12f7ed[_0xc02b('0x1d3')];_0x511bc8=_0x12f7ed['callAdditionalPhoneAfterMin'];ami[_0xc02b('0xf1')](_0xc02b('0x1d4'),ut[_0xc02b('0xf9')](_0x22dded,'agentreject'));_0xd77b75['createHistory'](_0x41adb3)['catch'](loggerCatch(_0xc02b('0x1d5')));if(_0xd77b75['checkRetriveMax'](0x14,_0x22dded,_0x12f7ed)&&!_0x535e46){if(_0x41adb3[_0xc02b('0x101')]>=_0x12f7ed[_0xc02b('0x1ba')]){_0xd77b75[_0xc02b('0x104')](_0x41adb3,_0x34c3b8,_0x4d0a93,'reason\x2020\x20agentreject');}else{_0xd77b75[_0xc02b('0x102')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0xc02b('0x1d6'));}}break;default:_0x12f7ed[_0xc02b('0x6e')]+=0x1;_0x41adb3[_0xc02b('0xac')]=0xc;_0x41adb3[_0xc02b('0xad')]=_0x457fd6[_0xc02b('0x116')];_0x5058c4=_0x12f7ed[_0xc02b('0x1d3')];_0x511bc8=_0x12f7ed[_0xc02b('0x12a')];_0xd77b75[_0xc02b('0xd3')](_0x41adb3)[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x1d7')));if(_0xd77b75['checkRetriveMax'](_0x457fd6['reason'],_0x22dded,_0x12f7ed)&&!_0x535e46){if(_0x41adb3['countbusyretry']+_0x41adb3[_0xc02b('0xfc')]+_0x41adb3[_0xc02b('0xfd')]+_0x41adb3[_0xc02b('0xfe')]+_0x41adb3['countdropretry']+_0x41adb3[_0xc02b('0x100')]+_0x41adb3[_0xc02b('0xf8')]+_0x41adb3['countagentrejectretry']>=_0x12f7ed['dialGlobalMaxRetry']){_0xd77b75['stateGlobal'](_0x41adb3,_0x34c3b8,_0x4d0a93,_0x457fd6[_0xc02b('0x116')]);}else{_0xd77b75[_0xc02b('0x104')](_0x41adb3,_0x34c3b8,_0x4d0a93,_0x457fd6[_0xc02b('0x116')]);}}}})[_0xc02b('0x3f')](function(){if(_0x535e46){_0xd77b75[_0xc02b('0xc1')](_0x41adb3,_0x5058c4,_0x511bc8)[_0xc02b('0x3f')](function(){return _0x34c3b8(0x1);});}});});};Dialer[_0xc02b('0x1b')][_0xc02b('0x102')]=function(_0x31522a,_0x2d6ecb,_0x534be7,_0x53950d){var _0x2afd1d=new Final(_0x31522a);_0x2afd1d['state']=0xf;_0x2afd1d[_0xc02b('0xad')]=_0xc02b('0x1d8');this[_0xc02b('0x104')](_0x2afd1d,_0x2d6ecb,_0x534be7,_0x53950d);};Dialer[_0xc02b('0x1b')][_0xc02b('0x104')]=function(_0x4eb7f6,_0x3582b1,_0x296b8f,_0x41208a){this[_0xc02b('0xd1')](_0x4eb7f6)['then'](function(){return _0x3582b1(msgResponse(_0xc02b('0x1bc'),'Success',_0x41208a));})[_0xc02b('0xb8')](function(){return _0x296b8f(msgResponse(_0xc02b('0x1d9'),_0xc02b('0x155'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0xc02b('0xa')]=function(_0x40ae84){var _0x1e16f1=_0x40ae84[_0xc02b('0x1da')]/0x64;var _0x25651d=_0x40ae84[_0xc02b('0x124')]/(_0x40ae84['outboundDropCallsDayTimeout']+_0x40ae84['outboundAnswerCallsDay']);var _0x1e2e14=Math[_0xc02b('0x1db')](_0x40ae84[_0xc02b('0x1dc')]*(_0x40ae84['predictiveIntervalMaxThreshold']/0x64));var _0x27eb17=Math[_0xc02b('0x1db')](_0x40ae84[_0xc02b('0x1dc')]*(_0x40ae84[_0xc02b('0x1dd')]/0x64));var _0x526d46=_0x40ae84[_0xc02b('0x56')]+_0x40ae84[_0xc02b('0x5c')];var _0x28f75f=Math[_0xc02b('0x1de')](_0x40ae84['erlangCalls']*_0x40ae84[_0xc02b('0x7a')]*_0x40ae84[_0xc02b('0x1df')]*_0x40ae84[_0xc02b('0x75')]);if(_[_0xc02b('0x41')](_0x40ae84[_0xc02b('0x2a')])){if(!_[_0xc02b('0x41')](_0x40ae84[_0xc02b('0x7c')])){_0x40ae84[_0xc02b('0x7c')]=undefined;loggerPredictive[_0xc02b('0x9e')](_0xc02b('0x1e0'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xc02b('0x41')](_0x40ae84[_0xc02b('0x1e1')])){loggerPredictive[_0xc02b('0x9e')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x40ae84[_0xc02b('0x1e1')]);_0x40ae84['handlePredictive']=undefined;}_0x40ae84[_0xc02b('0x2a')]=moment()['format'](_0xc02b('0x109'));loggerPredictive['info'](_0x40ae84[_0xc02b('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x40ae84[_0xc02b('0x2a')]);this[_0xc02b('0x165')](_0x40ae84,0x1);}else if(ifInterval(_0x40ae84[_0xc02b('0x1e2')],_0x40ae84[_0xc02b('0x2a')])){this[_0xc02b('0x165')](_0x40ae84,0x1);loggerPredictiveCalls[_0xc02b('0x86')](_0xc02b('0x1e3'),_0x40ae84[_0xc02b('0x2a')],_0x40ae84['name']);_0x40ae84[_0xc02b('0x91')]=0x0;_0x40ae84[_0xc02b('0x125')]=0x0;}else if(_0x1e16f1<_0x25651d&&_0x40ae84[_0xc02b('0x1e4')]===_0xc02b('0x1e5')){freeVariablesPredictive(_0x40ae84);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x1e6'),'Dropped\x20calls\x20day',_0x25651d,_0xc02b('0x2a'),_0x40ae84[_0xc02b('0x44')]);}else if(_0x28f75f<_0x40ae84[_0xc02b('0x125')]&&_0x40ae84[_0xc02b('0x1e4')]==='dropRate'){freeVariablesPredictive(_0x40ae84);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x1e7'),_0xc02b('0x1e8'),_0x28f75f,_0xc02b('0x1e9'),_0x40ae84[_0xc02b('0x125')],_0xc02b('0x2a'),_0x40ae84[_0xc02b('0x44')]);}else if(!ifInterval(_0x40ae84[_0xc02b('0x1e2')],_0x40ae84[_0xc02b('0x2a')])&&_[_0xc02b('0x41')](_0x40ae84[_0xc02b('0x7c')])&&!_[_0xc02b('0x41')](_0x40ae84[_0xc02b('0x2a')])){_0x40ae84[_0xc02b('0x7c')]=moment()['format'](_0xc02b('0x109'));loggerPredictive[_0xc02b('0x86')](_0x40ae84['name'],'started\x20in\x20predictive\x20at',_0x40ae84[_0xc02b('0x7c')]);this['averageHandleTime'](_0x40ae84['dialPredictiveInterval'])[_0xc02b('0x3f')](this[_0xc02b('0x1ea')](_0x40ae84))[_0xc02b('0x3f')](mergeDataErlangB(_0x40ae84))[_0xc02b('0x3f')](this['startMethodPredictive'](_0x40ae84))['catch'](loggerCatchPredictive(_0xc02b('0x1eb'),_0x40ae84));}else if(!ifInterval(_0x40ae84[_0xc02b('0x1e2')],_0x40ae84[_0xc02b('0x7c')])){_0x40ae84[_0xc02b('0x125')]=0x0;_0x40ae84[_0xc02b('0x7c')]=moment()[_0xc02b('0x80')](_0xc02b('0x109'));loggerPredictive[_0xc02b('0x86')](_0x40ae84[_0xc02b('0x44')],_0xc02b('0x1ec'),_0x40ae84[_0xc02b('0x7c')]);clearInterval(_0x40ae84[_0xc02b('0x1e1')]);_0x40ae84[_0xc02b('0x1e1')]=undefined;this[_0xc02b('0xc4')](_0x40ae84[_0xc02b('0x1e2')])['then'](this[_0xc02b('0x1ea')](_0x40ae84))[_0xc02b('0x3f')](mergeDataErlangB(_0x40ae84))[_0xc02b('0x3f')](this[_0xc02b('0x1ed')](_0x40ae84))[_0xc02b('0xb8')](loggerCatchPredictive(_0xc02b('0x1ee'),_0x40ae84));}else if(_0x40ae84[_0xc02b('0x1dc')]&&_0x526d46<_0x40ae84[_0xc02b('0x1dc')]-_0x27eb17){freeVariablesPredictive(_0x40ae84);loggerPredictive[_0xc02b('0x86')](_0x40ae84['name'],_0xc02b('0x1ef'),_0x526d46,_0xc02b('0x1f0'),_0x40ae84[_0xc02b('0x1dc')],'-',_0x27eb17,'=',_0x40ae84[_0xc02b('0x1dc')]-_0x27eb17,')');}else if(_0x40ae84[_0xc02b('0x1dc')]&&_0x526d46>_0x40ae84['predictiveIntervalAvailable']+_0x1e2e14){freeVariablesPredictive(_0x40ae84);loggerPredictive[_0xc02b('0x86')](_0x40ae84[_0xc02b('0x44')],_0xc02b('0x1ef'),_0x526d46,_0xc02b('0x1f1'),_0x40ae84[_0xc02b('0x1dc')],'+',_0x1e2e14,'=',_0x40ae84['predictiveIntervalAvailable']+_0x1e2e14,')');}};Dialer[_0xc02b('0x1b')]['getDataPredictive']=function(_0x43fbeb){var _0x459169=this;return function(_0x9da848){return new Promise(function(_0x3bff54,_0x5d071e){_[_0xc02b('0x96')](_0x43fbeb,_0x9da848[0x0]);if(checkGetDataPredictive(_0x9da848[0x0])){var _0xd5b576=_0x43fbeb[_0xc02b('0x1dc')]=_0x43fbeb[_0xc02b('0x5c')]+_0x43fbeb['available'];var _0x499bd8=_0x43fbeb[_0xc02b('0x1e2')]*0x3c;var _0x4bbb81=_0x9da848[0x0][_0xc02b('0x71')]+_0x9da848[0x0]['predictiveIntervalAvgHoldtime'];var _0x432b36=(_0x9da848[0x0][_0xc02b('0x6f')]+_0x9da848[0x0][_0xc02b('0x73')]+_0x9da848[0x0][_0xc02b('0x72')])/_0x9da848[0x0][_0xc02b('0x77')];_0x43fbeb[_0xc02b('0x1df')]=_0x432b36>0x0?_0x432b36:0x1;switch(_0x43fbeb['dialPredictiveOptimization']){case _0xc02b('0x1e5'):var _0x2ae7c2=_0x43fbeb[_0xc02b('0x1da')]/0x64;return _0x459169[_0xc02b('0x1f2')](_0xd5b576,_0x499bd8,_0x4bbb81,_0x432b36,_0x2ae7c2)[_0xc02b('0x3f')](function(_0x20b0e6){return _0x3bff54(_0x20b0e6);});case _0xc02b('0x1f3'):var _0x47af19=_0x43fbeb['dialPredictiveOptimizationPercentage']/0x64;return _0x459169['busyFactor'](_0xd5b576,_0x499bd8,_0x4bbb81,_0x432b36,_0x47af19)['then'](function(_0x1faba1){return _0x3bff54(_0x1faba1);});default:return _0x5d071e(msgResponse(_0xc02b('0x1f4'),_0xc02b('0x155'),_0xc02b('0x1f5')));}}else{return _0x5d071e(msgResponse(_0xc02b('0x1f4'),'Failure','check\x20failure'));}});};};Dialer[_0xc02b('0x1b')][_0xc02b('0x1f6')]=function(_0x168356){var _0x3c206c=this;return function(_0x1ceb79){return new Promise(function(_0x531dc7,_0x1be15a){_['merge'](_0x168356,_0x1ceb79[0x0]);if(checkGetDataPredictive(_0x1ceb79[0x0])){loggerPredictive['info'](JSON['stringify'](_0x1ceb79[0x0]));if(_0x168356[_0xc02b('0x1e4')]===_0xc02b('0x1e5')){return _0x3c206c[_0xc02b('0xcf')](_0x168356['id'])['then'](function(_0x33c32d){var _0x42b796=_0x168356[_0xc02b('0x57')]-_0x33c32d[0x0][_0xc02b('0x1f7')];var _0x26e356=_0x168356[_0xc02b('0x1e2')]*0x3c;var _0x4f97cc=_0x1ceb79[0x0]['predictiveIntervalAvgTalktime']+_0x1ceb79[0x0][_0xc02b('0x70')];var _0x21b447=(_0x1ceb79[0x0]['predictiveIntervalAnsweredCalls']+_0x1ceb79[0x0][_0xc02b('0x73')]+_0x1ceb79[0x0][_0xc02b('0x72')])/_0x1ceb79[0x0][_0xc02b('0x77')];var _0x41c323=_0x168356[_0xc02b('0x1da')]/0x64;_0x168356[_0xc02b('0x76')]=_0x33c32d[0x0][_0xc02b('0x1f7')]||0x0;_0x168356[_0xc02b('0x1df')]=_0x21b447>0x0?_0x21b447:0x1;return _0x3c206c['abandonmentRate'](_0x42b796,_0x26e356,_0x4f97cc,_0x21b447,_0x41c323);})['then'](function(_0x346c97){return _0x531dc7(_0x346c97);})[_0xc02b('0xb8')](function(_0x5b3e57){return _0x1be15a(msgResponse('[CatchErlangB]',_0xc02b('0x155'),JSON[_0xc02b('0x4e')](_0x5b3e57)));});}if(_0x168356[_0xc02b('0x1e4')]===_0xc02b('0x1f3')){return _0x3c206c[_0xc02b('0xcf')](_0x168356['id'])[_0xc02b('0x3f')](function(_0x3069d6){var _0x5bdca5=_0x168356[_0xc02b('0x57')]-_0x3069d6[0x0][_0xc02b('0x1f7')];var _0x3bd033=_0x168356[_0xc02b('0x1e2')]*0x3c;var _0xd1d957=_0x1ceb79[0x0][_0xc02b('0x71')]+_0x1ceb79[0x0][_0xc02b('0x70')];var _0x5c7b1e=(_0x1ceb79[0x0][_0xc02b('0x6f')]+_0x1ceb79[0x0][_0xc02b('0x73')]+_0x1ceb79[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1ceb79[0x0][_0xc02b('0x77')];var _0x3af0dc=_0x168356[_0xc02b('0x1da')]/0x64;_0x168356[_0xc02b('0x76')]=_0x3069d6[0x0][_0xc02b('0x1f7')]||0x0;_0x168356[_0xc02b('0x1df')]=_0x5c7b1e>0x0?_0x5c7b1e:0x1;return _0x3c206c[_0xc02b('0x1f8')](_0x5bdca5,_0x3bd033,_0xd1d957,_0x5c7b1e,_0x3af0dc);})['then'](function(_0x12d11f){return _0x531dc7(_0x12d11f);})['catch'](function(_0x429930){return _0x1be15a(msgResponse(_0xc02b('0x1f9'),'Failure',JSON[_0xc02b('0x4e')](_0x429930)));});}}else{return _0x1be15a(msgResponse('[getDataPredictive]','Failure',_0xc02b('0x1fa')));}});};};Dialer[_0xc02b('0x1b')][_0xc02b('0x1ed')]=function(_0x705c20){var _0x33a010=this;return function(){var _0x40a9dd=0x0;var _0x896955=Math[_0xc02b('0x1de')](_0x705c20[_0xc02b('0x79')]*0x3e8);if(_0x896955>0x0){_0x896955=_0x896955<0x64?0x64:_0x896955;loggerPredictive[_0xc02b('0x86')](_0x705c20[_0xc02b('0x44')],_0xc02b('0x1fb'),_0x896955,_0xc02b('0x4f'));_0x705c20[_0xc02b('0x1e1')]=setInterval(function(){_0x33a010[_0xc02b('0x1e1')](_0x705c20);loggerPredictiveCalls[_0xc02b('0x86')](_0xc02b('0x1fc'),_0x40a9dd+=0x1);},_0x896955);}else{loggerPredictive[_0xc02b('0x86')](_0x705c20['name'],_0xc02b('0x1fd'));}};};Dialer['prototype'][_0xc02b('0x1fe')]=function(_0x84d0d7,_0x53c537){var _0x356861=this;return function(_0xd3e75e){if(_[_0xc02b('0x4b')](_0xd3e75e)){if(_['isNil'](_0x53c537[_0xc02b('0xdc')])||!_0x53c537[_0xc02b('0x1ff')]){if(_0x84d0d7[_0xc02b('0x61')]===_0xc02b('0x9')){_0x84d0d7[_0xc02b('0x13e')]=_[_0xc02b('0x41')](_0x84d0d7[_0xc02b('0x13e')])?!![]:_0x84d0d7[_0xc02b('0x13e')];var _0x404c71=uuid['v4']();_0x356861[_0xc02b('0x27')][_0x404c71]=new Action(_0x84d0d7,_0x53c537,_0x404c71);loggerBooked['info'](_0xc02b('0x200'),_0x404c71,'queueStatusComplete:\x20',JSON[_0xc02b('0x4e')](_0x84d0d7[_0xc02b('0x13e')]),'Queue:\x20',_0x84d0d7[_0xc02b('0x44')]);if(_0x84d0d7['queueStatusComplete']){_0x84d0d7[_0xc02b('0x13e')]=![];_0x356861['queueBooked'][_0x356861[_0xc02b('0x27')][_0x404c71][_0xc02b('0xbb')]]=[];ami[_0xc02b('0xb5')]({'actionid':_0x404c71,'action':_0xc02b('0x201'),'queue':_0x84d0d7[_0xc02b('0x44')]})[_0xc02b('0xb8')](function(){_0x356861[_0xc02b('0xba')](_0x84d0d7);_0x356861[_0xc02b('0xc7')]({'active':![],'ContactId':_0x356861[_0xc02b('0x27')][_0x404c71][_0xc02b('0xdb')],'ListId':_0x356861[_0xc02b('0x27')][_0x404c71][_0xc02b('0x10a')],'VoiceQueueId':_0x356861[_0xc02b('0x27')][_0x404c71][_0xc02b('0xdd')]||undefined,'CampaignId':_0x356861[_0xc02b('0x27')][_0x404c71][_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x356861['actions'][_0x404c71];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0xc02b('0x4e')](_0x84d0d7['queueStatusComplete']),_0xc02b('0x202'),_0x84d0d7[_0xc02b('0x44')]);_0x356861[_0xc02b('0xba')](_0x84d0d7);_0x356861['rescheduleContact']({'active':![],'ContactId':_0x356861[_0xc02b('0x27')][_0x404c71][_0xc02b('0xdb')],'ListId':_0x356861['actions'][_0x404c71]['ListId'],'VoiceQueueId':_0x356861[_0xc02b('0x27')][_0x404c71][_0xc02b('0xdd')]||undefined,'CampaignId':_0x356861[_0xc02b('0x27')][_0x404c71][_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x203')));delete _0x356861[_0xc02b('0x27')][_0x404c71];}}else{return _0x356861[_0xc02b('0x17e')](_0x84d0d7,_0x53c537);}}else{if(getDiff(_0x53c537['scheduledat'])<_0x84d0d7[_0xc02b('0x204')]*0x3c){if(_0x53c537['Agent']&&!_0x53c537[_0xc02b('0x16a')][_0xc02b('0x205')]){_0x356861[_0xc02b('0x20')]['run'](_0x53c537['id'])[_0xc02b('0x1e')](function(){_0x356861['updateOriginated'](_0x84d0d7);});}else{_0x356861[_0xc02b('0xc8')]({'active':![]},_0x53c537['id'],0x1)['finally'](function(){_0x356861[_0xc02b('0xba')](_0x84d0d7);});}}else{_0x84d0d7[_0xc02b('0x6c')]+=0x1;_0x356861[_0xc02b('0xba')](_0x84d0d7);if(_0x84d0d7['dialRecallInQueue']){_0x356861[_0xc02b('0xc7')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x53c537[_0xc02b('0xdb')],'ListId':_0x53c537[_0xc02b('0x10a')],'VoiceQueueId':_0x53c537[_0xc02b('0xdd')]||undefined,'CampaignId':_0x53c537[_0xc02b('0xde')]||undefined})[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x206')));_0x356861['createHistory'](createObjHistory(_0x84d0d7,_0x53c537,_0xc02b('0x207'),0x17,_0xc02b('0x208')))[_0xc02b('0xb8')](loggerCatch(_0xc02b('0x209')));}else{_0x356861[_0xc02b('0xd9')](createObjHistory(_0x84d0d7,_0x53c537,'RECALLFAILEDTIMEOUT',0x16,_0xc02b('0x20a')),_0xc02b('0x20b'),_0xc02b('0x20c'));}}}}else{_0x84d0d7[_0xc02b('0x68')]+=0x1;_0x356861[_0xc02b('0xd9')](createObjHistory(_0x84d0d7,_0x53c537,_0xc02b('0x20d'),0xd,_0xc02b('0x20e')),_0xc02b('0x20f'),'[Originate][MoveBlacklist]');throw _0xc02b('0x210');}};};Dialer[_0xc02b('0x1b')][_0xc02b('0x16c')]=function(_0x309a77){var _0x3c2b61=this;var _0x26a552=_0x309a77[_0xc02b('0x211')]-_0x309a77[_0xc02b('0x78')]-_0x309a77[_0xc02b('0xcb')];emitCampaignSummary(_0x309a77);if(_0x26a552>0x0){if(_0x26a552>this['maxNumberOriginate']){_0x26a552=this[_0xc02b('0x25')];}_0x309a77['temp']+=_0x26a552;this['getContactDialerIvr'](_0x309a77['id'],_0x26a552,_0x309a77['dialOrderByScheduledAt'],_0x309a77)[_0xc02b('0x3f')](function(_0x38a636){_0x309a77[_0xc02b('0xcb')]-=_0x26a552;_0x309a77[_0xc02b('0xcb')]=_0x309a77['temp']>0x0?_0x309a77[_0xc02b('0xcb')]:0x0;if(!checkContactEmpty(_0x38a636)){_0x309a77['message']=_0xc02b('0x212');logger['info'](_0xc02b('0x213')+_0x309a77[_0xc02b('0x44')]);}else{_0x309a77[_0xc02b('0x78')]+=_0x38a636['length'];_0x309a77[_0xc02b('0x42')]=_0xc02b('0x214');for(var _0x332b84=0x0;_0x332b84<_0x38a636[_0xc02b('0xa0')];_0x332b84+=0x1){_0x309a77[_0xc02b('0x215')]+=0x1;if(_[_0xc02b('0xb4')](_0x38a636[_0x332b84])||_[_0xc02b('0xb4')](_0x38a636[_0x332b84][_0xc02b('0x19b')])||_[_0xc02b('0xb4')](_0x38a636[_0x332b84][_0xc02b('0x182')])){_0x3c2b61[_0xc02b('0x216')](_0xc02b('0x217'),_0x309a77,_0x38a636[_0x332b84]);}else{_0x3c2b61[_0xc02b('0xc2')](_[_0xc02b('0xda')](_0x38a636[_0x332b84],['CampaignId',_0xc02b('0x182')]))[_0xc02b('0x3f')](_0x3c2b61[_0xc02b('0x1fe')](_0x309a77,_0x38a636[_0x332b84]))[_0xc02b('0xb8')](_0x3c2b61['loggerHandler'](_0xc02b('0x218'),_0x309a77));}}}})[_0xc02b('0xb8')](loggerGetContactDialer(_0xc02b('0x219'),_0x309a77,_0x26a552));}};Dialer[_0xc02b('0x1b')][_0xc02b('0x165')]=function(_0x40d627,_0x4f5b9f){var _0xf10a7e=this;var _0x5a8245=[];var _0x152d67=_0x4f5b9f>=0x1?_0x4f5b9f:0x1;if(_0x40d627['dialMethod']===_0xc02b('0x9')){_0x152d67=0x1;}var _0x35eedb=Math[_0xc02b('0x1de')](_0x40d627[_0xc02b('0x56')]*_0x152d67)-_0x40d627[_0xc02b('0x78')]-_0x40d627['temp'];emitVoiceQueueSummary(_0x40d627);if(_0x40d627[_0xc02b('0x21a')]>0x0){var _0x74e478=_0x40d627[_0xc02b('0x21a')]-_0x40d627['originated']-_0x40d627[_0xc02b('0x5c')]-_0x40d627[_0xc02b('0xcb')]-_0x40d627['pTalking'];if(_0x35eedb>_0x74e478){_0x35eedb=_0x74e478;}}if(_0x35eedb>0x0){if(_0x40d627[_0xc02b('0x61')]===_0xc02b('0x9')){_0x35eedb=0x1;}if(_0x35eedb>this[_0xc02b('0x25')]){_0x35eedb=this[_0xc02b('0x25')];}_0x40d627[_0xc02b('0xcb')]+=_0x35eedb;for(var _0x585e76 in this[_0xc02b('0x23')]){if(typeof this[_0xc02b('0x23')][_0x585e76]!=='undefined'){if(this[_0xc02b('0x23')][_0x585e76][_0xc02b('0xac')]===_0xc02b('0x21b')&&this['agents'][_0x585e76]['status']===_0xc02b('0xe5')){_0x5a8245[_0xc02b('0x15d')](this[_0xc02b('0x23')][_0x585e76]['id']);}}}this['getContactDialer'](_0x40d627['id'],_0x5a8245,_0x35eedb,_0x40d627[_0xc02b('0x21c')],_0x40d627)[_0xc02b('0x3f')](function(_0x55dbbb){_0x40d627[_0xc02b('0xcb')]-=_0x35eedb;_0x40d627[_0xc02b('0xcb')]=_0x40d627[_0xc02b('0xcb')]>0x0?_0x40d627[_0xc02b('0xcb')]:0x0;if(!checkContactEmpty(_0x55dbbb)){_0xf10a7e[_0xc02b('0xbd')](_0x40d627)[_0xc02b('0x3f')](sendMessageReschedule(_0x40d627))[_0xc02b('0xb8')](loggerCatch(_0xc02b('0xbe')));}else{_0x40d627[_0xc02b('0x78')]+=_0x55dbbb[_0xc02b('0xa0')];_0x40d627['message']=_0x40d627[_0xc02b('0x61')]===_0xc02b('0x9')?_0xc02b('0x21d'):_0xc02b('0x214');for(var _0x402c5f=0x0;_0x402c5f<_0x55dbbb[_0xc02b('0xa0')];_0x402c5f+=0x1){if(_[_0xc02b('0xb4')](_0x55dbbb[_0x402c5f])||_[_0xc02b('0xb4')](_0x55dbbb[_0x402c5f][_0xc02b('0x19b')])||_[_0xc02b('0xb4')](_0x55dbbb[_0x402c5f]['phone'])){_0xf10a7e['emptyContact'](_0xc02b('0x217'),_0x40d627,_0x55dbbb[_0x402c5f]);}else{_0xf10a7e['checkIsBlackList'](_[_0xc02b('0xda')](_0x55dbbb[_0x402c5f],[_0xc02b('0xdd'),_0xc02b('0x182')]))[_0xc02b('0x3f')](_0xf10a7e[_0xc02b('0x1fe')](_0x40d627,_0x55dbbb[_0x402c5f]))[_0xc02b('0xb8')](_0xf10a7e[_0xc02b('0xd7')](_0xc02b('0x217'),_0x40d627));}}}})[_0xc02b('0xb8')](loggerGetContactDialer(_0xc02b('0x21e'),_0x40d627,_0x35eedb));}};Dialer[_0xc02b('0x1b')][_0xc02b('0x1e1')]=function(_0x16c2cd){if(_0x16c2cd['dialLimitQueue']>0x0){var _0x502754=_0x16c2cd[_0xc02b('0x21a')]-_0x16c2cd[_0xc02b('0x78')]-_0x16c2cd[_0xc02b('0x5c')];if(_0x502754>0x0){this[_0xc02b('0x21f')](_0x16c2cd);}else{loggerPredictiveCalls['info'](_0xc02b('0x220'));}}else{this['tryOriginatePredictive'](_0x16c2cd);}};Dialer[_0xc02b('0x1b')][_0xc02b('0x21f')]=function(_0x361d3e){var _0x44a871=this;var _0x46e16f=[];_0x361d3e[_0xc02b('0x78')]+=0x1;for(var _0x3f675a in this['agents']){if(typeof this['agents'][_0x3f675a]!=='undefined'){if(this['agents'][_0x3f675a][_0xc02b('0xac')]===_0xc02b('0x21b')&&this[_0xc02b('0x23')][_0x3f675a][_0xc02b('0xb6')]===_0xc02b('0xe5')){_0x46e16f[_0xc02b('0x15d')](this['agents'][_0x3f675a]['id']);}}}this['getContactDialer'](_0x361d3e['id'],_0x46e16f,0x1,_0x361d3e[_0xc02b('0x21c')],_0x361d3e)[_0xc02b('0x3f')](function(_0x1fe9dc){if(!checkContactEmpty(_0x1fe9dc)){checkContactLowerLimitOriginate(_0x361d3e,0x1,0x0);_0x44a871[_0xc02b('0xbd')](_0x361d3e)[_0xc02b('0x3f')](sendMessageReschedule(_0x361d3e))['catch'](loggerCatch(_0xc02b('0xbe')));}else{_0x361d3e[_0xc02b('0x42')]=_0xc02b('0x214');if(_['isNil'](_0x1fe9dc[0x0])||_[_0xc02b('0xb4')](_0x1fe9dc[0x0][_0xc02b('0x19b')])||_[_0xc02b('0xb4')](_0x1fe9dc[0x0][_0xc02b('0x182')])){_0x44a871[_0xc02b('0x216')](_0xc02b('0x217'),_0x361d3e,_0x1fe9dc[0x0]);}else{_0x44a871[_0xc02b('0xbf')](_['pick'](_0x1fe9dc[0x0],[_0xc02b('0xdd'),_0xc02b('0x182')]))[_0xc02b('0x3f')](_0x44a871[_0xc02b('0x1fe')](_0x361d3e,_0x1fe9dc[0x0]))['catch'](_0x44a871[_0xc02b('0xd7')](_0xc02b('0x221'),_0x361d3e));}}})['catch'](loggerGetContactDialer(_0xc02b('0x222'),_0x361d3e,0x1));emitVoiceQueueSummary(_0x361d3e);};Dialer['prototype'][_0xc02b('0x1f2')]=function(_0xead687,_0x7f9b92,_0x51e380,_0x440705,_0x2fee28,_0x5d3680){loggerPredictive[_0xc02b('0x86')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xc02b('0x86')](_0xc02b('0x223'),_0xead687);loggerPredictive['info'](_0xc02b('0x224'),_0x7f9b92);loggerPredictive['info'](_0xc02b('0x225'),_0x51e380);loggerPredictive['info'](_0xc02b('0x226'),_0x440705);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x227'),_0x2fee28);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x95'));return new Promise(function(_0x5b6179,_0x5f0d0b){if(_0xead687<=0x0||isNaN(_0xead687)){return _0x5f0d0b(msgResponse(_0xc02b('0x228'),_0xc02b('0x4d'),_0xc02b('0x229')+_0xead687));}if(_0x51e380<=0x0||isNaN(_0x51e380)){return _0x5f0d0b(msgResponse(_0xc02b('0x228'),_0xc02b('0x4d'),_0xc02b('0x22a')+_0x51e380));}if(_0x440705<=0x0||isNaN(_0x440705)){return _0x5f0d0b(msgResponse('[abandonmentRate]',_0xc02b('0x4d'),_0xc02b('0x22b')+_0x440705));}if(_0x7f9b92<=0x0||isNaN(_0x7f9b92)){return _0x5f0d0b(msgResponse(_0xc02b('0x228'),_0xc02b('0x4d'),'interval\x20=\x20'+_0x7f9b92));}if(_0x2fee28<=0x0||isNaN(_0x2fee28)){return _0x5f0d0b(msgResponse(_0xc02b('0x228'),_0xc02b('0x4d'),_0xc02b('0x22c')+_0x2fee28));}_0x5d3680=_0x5d3680||0x0;var _0x8e688a=0x1/_0x51e380;var _0x1027ff=0x0;var _0x5e644c=0x0;var _0x1677b7=0x0;var _0xc494cc=0x0;for(var _0x10d846=0x0;_0x1677b7<_0x2fee28;_0x10d846+=0x1){_0x5e644c=_0x10d846/_0x7f9b92;_0x1027ff=(_0x440705*_0x5e644c+_0x5d3680)/_0x8e688a;_0x1677b7=erlangb(_0x1027ff,_0xead687);_0xc494cc=_0x1027ff/_0xead687*(0x1-erlangb(_0x1027ff,_0xead687));}return _0x5b6179({'erlangCalls':_0x10d846,'erlangCallToSecond':_0x7f9b92/_0x10d846,'erlangAbandonmentRate':_0x1677b7,'erlangBusyFactor':_0xc494cc});});};Dialer[_0xc02b('0x1b')][_0xc02b('0x1f8')]=function(_0x544920,_0x26a945,_0x11e087,_0x3ef033,_0x1eb66e,_0x19cf84){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xc02b('0x86')](_0xc02b('0x223'),_0x544920);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x224'),_0x26a945);loggerPredictive[_0xc02b('0x86')]('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',_0x11e087);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ef033);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x22d'),_0x1eb66e);loggerPredictive[_0xc02b('0x86')](_0xc02b('0x95'));return new Promise(function(_0x52cffb,_0x52b44f){if(_0x544920<=0x0||isNaN(_0x544920)){return _0x52b44f(msgResponse(_0xc02b('0x22e'),_0xc02b('0x4d'),_0xc02b('0x229')+_0x544920));}if(_0x11e087<=0x0||isNaN(_0x11e087)){return _0x52b44f(msgResponse(_0xc02b('0x22e'),_0xc02b('0x4d'),_0xc02b('0x22a')+_0x11e087));}if(_0x3ef033<=0x0||isNaN(_0x3ef033)){return _0x52b44f(msgResponse(_0xc02b('0x22e'),'Error',_0xc02b('0x22b')+_0x3ef033));}if(_0x26a945<=0x0||isNaN(_0x26a945)){return _0x52b44f(msgResponse(_0xc02b('0x22e'),_0xc02b('0x4d'),'interval\x20=\x20'+_0x26a945));}if(_0x1eb66e<=0x0||isNaN(_0x1eb66e)){return _0x52b44f(msgResponse(_0xc02b('0x22e'),'Error','Umin\x20=\x20'+_0x1eb66e));}_0x19cf84=_0x19cf84||0x0;var _0x3f8514=0x1/_0x11e087;var _0x3f84b4=0x0;var _0x28dee3=0x0;var _0x1a7335=0x0;var _0x4b0f20=0x0;for(var _0x6d588b=0x0;_0x4b0f20<_0x1eb66e;_0x6d588b+=0x1){_0x28dee3=_0x6d588b/_0x26a945;_0x3f84b4=(_0x3ef033*_0x28dee3+_0x19cf84)/_0x3f8514;_0x1a7335=erlangb(_0x3f84b4,_0x544920);_0x4b0f20=_0x3f84b4/_0x544920*(0x1-erlangb(_0x3f84b4,_0x544920));}return _0x52cffb({'erlangCalls':_0x6d588b,'erlangCallToSecond':_0x26a945/_0x6d588b,'erlangAbandonmentRate':_0x1a7335,'erlangBusyFactor':_0x4b0f20});});};module[_0xc02b('0x22f')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index b217e79..cccb657 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 _0x4475=['uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry'];(function(_0x3ae28c,_0x27078e){var _0x3b079c=function(_0x27a524){while(--_0x27a524){_0x3ae28c['push'](_0x3ae28c['shift']());}};_0x3b079c(++_0x27078e);}(_0x4475,0x6c));var _0x5447=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4475[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require(_0x5447('0x0'));var _=require(_0x5447('0x1'));var moment=require(_0x5447('0x2'));function getSeconds(_0x509c5c,_0x2ea145){var _0x514373=moment(_0x509c5c)[_0x5447('0x3')](0x0);var _0xba6367=moment(_0x2ea145)['milliseconds'](0x0);return _0x514373['diff'](_0xba6367,_0x5447('0x4'));}function QueueCallerAbandon(_0x4b7d8e,_0x12200d){this[_0x5447('0x5')]=_0x4b7d8e[_0x5447('0x5')];this[_0x5447('0x6')]=_0x4b7d8e[_0x5447('0x6')];this[_0x5447('0x7')]=_0x4b7d8e['type']===_0x5447('0x8')?_0x5447('0x9'):_0x4b7d8e[_0x5447('0x6')];this[_0x5447('0xa')]=_0x4b7d8e['countbusyretry'];this[_0x5447('0xb')]=_0x4b7d8e[_0x5447('0xb')];this[_0x5447('0xc')]=_0x4b7d8e[_0x5447('0xc')];this[_0x5447('0xd')]=_0x4b7d8e[_0x5447('0xa')]+_0x4b7d8e[_0x5447('0xb')]+_0x4b7d8e[_0x5447('0xc')]+_0x4b7d8e[_0x5447('0xe')]+_0x4b7d8e[_0x5447('0xf')]+_0x4b7d8e['countabandonedretry']+_0x4b7d8e[_0x5447('0x10')]+_0x4b7d8e['countagentrejectretry'];this['countnosuchnumberretry']=_0x4b7d8e['countnosuchnumberretry'];this[_0x5447('0xf')]=_0x4b7d8e[_0x5447('0xf')];this['countabandonedretry']=_0x4b7d8e[_0x5447('0x11')];this[_0x5447('0x10')]=_0x4b7d8e[_0x5447('0x10')];this['countagentrejectretry']=_0x4b7d8e['countagentrejectretry'];this[_0x5447('0x12')]=_0x12200d[_0x5447('0x12')];this[_0x5447('0x13')]=_0x4b7d8e[_0x5447('0x14')];this['calleridnum']=_0x4b7d8e[_0x5447('0x15')];this[_0x5447('0x16')]=_0x4b7d8e[_0x5447('0x16')];this[_0x5447('0x17')]=_0x4b7d8e[_0x5447('0x17')];this[_0x5447('0x18')]=_0x4b7d8e[_0x5447('0x18')];this[_0x5447('0x19')]=this[_0x5447('0x18')];this['ringtime']=getSeconds(_0x4b7d8e[_0x5447('0x17')],_0x4b7d8e['starttime']);this[_0x5447('0x1a')]=getSeconds(this[_0x5447('0x18')],_0x4b7d8e[_0x5447('0x17')]);this[_0x5447('0x1b')]=0x0;this[_0x5447('0x9')]=_0x12200d[_0x5447('0x9')];this[_0x5447('0x1c')]=_0x12200d[_0x5447('0x1d')];this[_0x5447('0x1e')]=_0x12200d[_0x5447('0x1e')];this[_0x5447('0x1f')]=_0x4b7d8e[_0x5447('0x1f')];this[_0x5447('0x20')]=_0x4b7d8e[_0x5447('0x20')];this['callbackat']=_0x4b7d8e[_0x5447('0x21')];this[_0x5447('0x22')]=_0x4b7d8e[_0x5447('0x22')];this[_0x5447('0x23')]=_0x4b7d8e[_0x5447('0x23')];this[_0x5447('0x24')]=_0x4b7d8e[_0x5447('0x24')];this[_0x5447('0x25')]=_0x4b7d8e[_0x5447('0x25')];this[_0x5447('0x26')]=_0x4b7d8e['VoiceQueueId'];this[_0x5447('0x27')]=_0x4b7d8e[_0x5447('0x27')];this['originatecalleridnum']=_0x4b7d8e[_0x5447('0x28')]||'';this['originatecalleridname']=_0x4b7d8e['originatecalleridname']||'';}module[_0x5447('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x3235=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','name','calleridnum','starttime','responsetime','droptime','endtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x3235,0x144));var _0x5323=function(_0x5beb22,_0x12bb02){_0x5beb22=_0x5beb22-0x0;var _0x57f9de=_0x3235[_0x5beb22];return _0x57f9de;};'use strict';var util=require(_0x5323('0x0'));var _=require(_0x5323('0x1'));var moment=require(_0x5323('0x2'));function getSeconds(_0xe84794,_0x5e7fb5){var _0x379c95=moment(_0xe84794)['milliseconds'](0x0);var _0x1ed510=moment(_0x5e7fb5)[_0x5323('0x3')](0x0);return _0x379c95[_0x5323('0x4')](_0x1ed510,'seconds');}function QueueCallerAbandon(_0x152a25,_0x1904df){this['scheduledat']=_0x152a25[_0x5323('0x5')];this[_0x5323('0x6')]=_0x152a25['type'];this['campaigntype']=_0x152a25[_0x5323('0x6')]===_0x5323('0x7')?'queue':_0x152a25[_0x5323('0x6')];this['countbusyretry']=_0x152a25[_0x5323('0x8')];this['countcongestionretry']=_0x152a25[_0x5323('0x9')];this['countnoanswerretry']=_0x152a25[_0x5323('0xa')];this[_0x5323('0xb')]=_0x152a25[_0x5323('0x8')]+_0x152a25[_0x5323('0x9')]+_0x152a25[_0x5323('0xa')]+_0x152a25[_0x5323('0xc')]+_0x152a25[_0x5323('0xd')]+_0x152a25['countabandonedretry']+_0x152a25[_0x5323('0xe')]+_0x152a25['countagentrejectretry'];this[_0x5323('0xc')]=_0x152a25['countnosuchnumberretry'];this['countdropretry']=_0x152a25[_0x5323('0xd')];this[_0x5323('0xf')]=_0x152a25['countabandonedretry'];this['countmachineretry']=_0x152a25[_0x5323('0xe')];this[_0x5323('0x10')]=_0x152a25[_0x5323('0x10')];this['uniqueid']=_0x1904df[_0x5323('0x11')];this['calleridname']=_0x152a25[_0x5323('0x12')];this[_0x5323('0x13')]=_0x152a25['number'];this[_0x5323('0x14')]=_0x152a25[_0x5323('0x14')];this[_0x5323('0x15')]=_0x152a25[_0x5323('0x15')];this[_0x5323('0x16')]=_0x152a25['droptime'];this[_0x5323('0x17')]=this['droptime'];this['ringtime']=getSeconds(_0x152a25[_0x5323('0x15')],_0x152a25['starttime']);this[_0x5323('0x18')]=getSeconds(this[_0x5323('0x16')],_0x152a25['responsetime']);this[_0x5323('0x19')]=0x0;this[_0x5323('0x1a')]=_0x1904df[_0x5323('0x1a')];this[_0x5323('0x1b')]=_0x1904df[_0x5323('0x1c')];this[_0x5323('0x1d')]=_0x1904df[_0x5323('0x1d')];this[_0x5323('0x1e')]=_0x152a25['callback'];this['callbackuniqueid']=_0x152a25['callbackuniqueid'];this[_0x5323('0x1f')]=_0x152a25[_0x5323('0x1f')];this[_0x5323('0x20')]=_0x152a25['recallme'];this[_0x5323('0x21')]=_0x152a25[_0x5323('0x21')];this['ListId']=_0x152a25[_0x5323('0x22')];this['UserId']=_0x152a25[_0x5323('0x23')];this[_0x5323('0x24')]=_0x152a25[_0x5323('0x24')];this[_0x5323('0x25')]=_0x152a25[_0x5323('0x25')];this[_0x5323('0x26')]=_0x152a25[_0x5323('0x26')]||'';this[_0x5323('0x27')]=_0x152a25[_0x5323('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 e7c404f..09e2485 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(_0x59a40b,_0x1fd7c0){var _0x593bc5=function(_0x34c8dd){while(--_0x34c8dd){_0x59a40b['push'](_0x59a40b['shift']());}};_0x593bc5(++_0x1fd7c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x214a8c,_0x49ab17){var _0x156a2c=function(_0x51265e){while(--_0x51265e){_0x214a8c['push'](_0x214a8c['shift']());}};_0x156a2c(++_0x49ab17);}(_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 1a67f4d..38535c2 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 _0x1d0d=['ext','isTrunkReachable','active','SIP/%s','isNil','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','moment','path','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','hangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','\x20syncNewchannel\x20','variable','channelstate','channelstatedesc','value','operation','status','localstationid','info','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','resolution','transferrate','filename','calleridnum','pagestransferred','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','application/pdf','then','notify','fax','.pdf','\x20notify\x20','catch','error','\x20receiveFax\x20','merge','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables'];(function(_0x5f1c8c,_0x4d66e9){var _0x499b8a=function(_0x1b8610){while(--_0x1b8610){_0x5f1c8c['push'](_0x5f1c8c['shift']());}};_0x499b8a(++_0x4d66e9);}(_0x1d0d,0x8e));var _0xd1d0=function(_0x24122c,_0x5a6b1e){_0x24122c=_0x24122c-0x0;var _0x3acdf7=_0x1d0d[_0x24122c];return _0x3acdf7;};'use strict';var util=require('util');var _=require(_0xd1d0('0x0'));var BPromise=require(_0xd1d0('0x1'));var uuid=require('uuid');var moment=require(_0xd1d0('0x2'));var path=require(_0xd1d0('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0xd1d0('0x4'))('fax');var ami=require(_0xd1d0('0x5'));var rpcDb=require('./rpcDb');var Channel=require(_0xd1d0('0x6'));var ut=require(_0xd1d0('0x7'));var Action=require(_0xd1d0('0x8'));var faxAccount=require(_0xd1d0('0x9'));var attachment=require(_0xd1d0('0xa'));var faxMessage=require(_0xd1d0('0xb'));function Fax(_0x2fa04f){this[_0xd1d0('0xc')]={};this['faxAccounts']=_0x2fa04f[_0xd1d0('0xd')];this[_0xd1d0('0xe')]=_0x2fa04f[_0xd1d0('0xe')];this[_0xd1d0('0xf')]={};ami['on'](_0xd1d0('0x10'),this[_0xd1d0('0x11')][_0xd1d0('0x12')](this));ami['on'](_0xd1d0('0x13'),this[_0xd1d0('0x14')]['bind'](this));ami['on']('newstate',this[_0xd1d0('0x15')]['bind'](this));ami['on'](_0xd1d0('0x16'),this[_0xd1d0('0x17')][_0xd1d0('0x12')](this));ami['on'](_0xd1d0('0x18'),this[_0xd1d0('0x19')][_0xd1d0('0x12')](this));ami['on'](_0xd1d0('0x1a'),this['syncReceiveFax'][_0xd1d0('0x12')](this));ami['on'](_0xd1d0('0x1b'),this['syncHangup'][_0xd1d0('0x12')](this));ami['on']('originateresponse',this[_0xd1d0('0x1c')]['bind'](this));}Fax[_0xd1d0('0x1d')][_0xd1d0('0x11')]=function(_0xd5f6a5){if(_0xd5f6a5[_0xd1d0('0x1e')]===_0xd1d0('0x1f')){for(var _0x502eed in this[_0xd1d0('0xd')]){if(this[_0xd1d0('0xd')][_0xd1d0('0x20')](_0x502eed)){if(_0xd5f6a5[_0xd1d0('0x21')]===this[_0xd1d0('0xd')][_0x502eed]['localstationid']){this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]]={};this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]][_0xd1d0('0x23')]=_0xd5f6a5[_0xd1d0('0x23')];this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]]['id']=this[_0xd1d0('0xd')][_0x502eed]['id'];this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]]['name']=this[_0xd1d0('0xd')][_0x502eed]['name'];logger['info'](_0xd5f6a5[_0xd1d0('0x22')],_0xd1d0('0x24'));}}}}if(this[_0xd1d0('0xf')][_0xd5f6a5[_0xd1d0('0x22')]]){this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]]={};this[_0xd1d0('0xc')][_0xd5f6a5[_0xd1d0('0x22')]][_0xd1d0('0x23')]=_0xd5f6a5[_0xd1d0('0x23')];logger['info'](_0xd5f6a5[_0xd1d0('0x22')],_0xd1d0('0x24'));}};Fax[_0xd1d0('0x1d')][_0xd1d0('0x14')]=function(_0x48401e){if(this[_0xd1d0('0xc')][_0x48401e[_0xd1d0('0x22')]]){for(var _0x4787f7 in _0x48401e[_0xd1d0('0x25')]){if(_0x48401e[_0xd1d0('0x25')][_0xd1d0('0x20')](_0x4787f7)){this['channels'][_0x48401e[_0xd1d0('0x22')]][_0x4787f7]=_0x48401e['value'];}}}};Fax['prototype'][_0xd1d0('0x15')]=function(_0x57703e){if(this[_0xd1d0('0xc')][_0x57703e['uniqueid']]){this[_0xd1d0('0xc')][_0x57703e['uniqueid']][_0xd1d0('0x26')]=_0x57703e[_0xd1d0('0x26')];this[_0xd1d0('0xc')][_0x57703e[_0xd1d0('0x22')]][_0xd1d0('0x27')]=_0x57703e['channelstatedesc'];}};Fax['prototype'][_0xd1d0('0x17')]=function(_0x1744c1){if(this[_0xd1d0('0xc')][_0x1744c1[_0xd1d0('0x22')]]){for(var _0x1f60d3 in _0x1744c1[_0xd1d0('0x25')]){if(_0x1744c1['variable'][_0xd1d0('0x20')](_0x1f60d3)){this[_0xd1d0('0xc')][_0x1744c1[_0xd1d0('0x22')]][_0x1f60d3]=_0x1744c1[_0xd1d0('0x28')];}}}};Fax[_0xd1d0('0x1d')][_0xd1d0('0x19')]=function(_0x543e9e){if(this[_0xd1d0('0xc')][_0x543e9e[_0xd1d0('0x22')]]){this['channels'][_0x543e9e[_0xd1d0('0x22')]][_0xd1d0('0x29')]=_0x543e9e['operation'];this[_0xd1d0('0xc')][_0x543e9e['uniqueid']][_0xd1d0('0x2a')]=_0x543e9e[_0xd1d0('0x2a')];this[_0xd1d0('0xc')][_0x543e9e[_0xd1d0('0x22')]][_0xd1d0('0x2b')]=_0x543e9e['localstationid'];this[_0xd1d0('0xc')][_0x543e9e[_0xd1d0('0x22')]]['filename']=_0x543e9e['filename'];logger[_0xd1d0('0x2c')](_0x543e9e['uniqueid'],_0xd1d0('0x2d'));}};Fax['prototype'][_0xd1d0('0x2e')]=function(_0x5d05aa){var _0x2bbcea=this;if(this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]){var _0x11f203=this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]['id'];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]][_0xd1d0('0x2f')]=_0x5d05aa[_0xd1d0('0x2f')];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]['pagestransferred']=_0x5d05aa['pagestransferred'];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]['localstationid']=_0x5d05aa[_0xd1d0('0x2b')];this['channels'][_0x5d05aa[_0xd1d0('0x22')]]['resolution']=_0x5d05aa[_0xd1d0('0x30')];this[_0xd1d0('0xc')][_0x5d05aa['uniqueid']][_0xd1d0('0x31')]=_0x5d05aa[_0xd1d0('0x31')];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]][_0xd1d0('0x32')]=_0x5d05aa[_0xd1d0('0x32')];this[_0xd1d0('0xc')][_0x5d05aa[_0xd1d0('0x22')]]['calleridnum']=_0x5d05aa[_0xd1d0('0x33')];if(this['channels'][_0x5d05aa['uniqueid']][_0xd1d0('0x34')]>0x0){tiff2pdf(_0x5d05aa[_0xd1d0('0x32')],_0xd1d0('0x35'),function(_0x4e5a97){logger[_0xd1d0('0x2c')](_0x5d05aa[_0xd1d0('0x22')],_0xd1d0('0x36'),_0x4e5a97[_0xd1d0('0x37')]);attachment[_0xd1d0('0x38')]({'name':path[_0xd1d0('0x39')](_0x5d05aa[_0xd1d0('0x32')])[_0xd1d0('0x3a')],'basename':path[_0xd1d0('0x39')](_0x5d05aa[_0xd1d0('0x32')])['name']+'.pdf','type':_0xd1d0('0x3b')})[_0xd1d0('0x3c')](function(_0x4dfdc5){faxAccount[_0xd1d0('0x3d')](_0x11f203,{'from':_0x5d05aa['calleridnum'],'mapKey':_0xd1d0('0x3e'),'body':path[_0xd1d0('0x39')](_0x5d05aa[_0xd1d0('0x32')])[_0xd1d0('0x3a')]+_0xd1d0('0x3f'),'AttachmentId':_0x4dfdc5['id']})['catch'](function(_0x128288){logger['error'](_0x5d05aa[_0xd1d0('0x22')],_0xd1d0('0x40'),JSON['stringify'](_0x128288));});})[_0xd1d0('0x41')](function(_0x3d6348){logger[_0xd1d0('0x42')](_0x5d05aa['uniqueid'],_0xd1d0('0x43'),JSON['stringify'](_0x3d6348));});});}logger[_0xd1d0('0x2c')](_0x5d05aa[_0xd1d0('0x22')],_0xd1d0('0x43'));}};Fax['prototype'][_0xd1d0('0x1c')]=function(_0x368e30){if(this[_0xd1d0('0xf')][_0x368e30[_0xd1d0('0x22')]]){_[_0xd1d0('0x44')](this[_0xd1d0('0xc')][_0x368e30[_0xd1d0('0x22')]],_[_0xd1d0('0x45')](_0x368e30,[_0xd1d0('0x46'),'reason']));}};function updateStatus(_0x36bafe){if(_0x36bafe[_0xd1d0('0x47')]){faxMessage[_0xd1d0('0x48')](_0x36bafe[_0xd1d0('0x47')],{'failMessage':_0xd1d0('0x49')})[_0xd1d0('0x3c')](function(_0x47c507){ut[_0xd1d0('0x4a')](_0xd1d0('0x4b'),_0x47c507);})[_0xd1d0('0x41')](function(_0x54b051){ut[_0xd1d0('0x4a')](_0xd1d0('0x4c'),_0x54b051);});}else{ut[_0xd1d0('0x4a')](_0xd1d0('0x4d'));}}Fax[_0xd1d0('0x1d')][_0xd1d0('0x4e')]=function(_0x4e466e,_0x3ce514,_0x48e682){var _0x53447f=this;var _0xfac809={};if(_0x3ce514){_0xfac809={'read':_0x3ce514};}else{_0xfac809={'failMessage':_0x48e682};}if(this[_0xd1d0('0xf')][_0x4e466e][_0xd1d0('0x47')]){faxMessage['update'](this['actions'][_0x4e466e][_0xd1d0('0x47')],_0xfac809)['then'](function(_0x21a5af){ut[_0xd1d0('0x4a')](_0xd1d0('0x4f'),_0x21a5af);})[_0xd1d0('0x41')](function(_0x50570e){ut['logger'](_0xd1d0('0x50'),_0x50570e);})[_0xd1d0('0x51')](function(){delete _0x53447f[_0xd1d0('0xc')][_0x4e466e];delete _0x53447f[_0xd1d0('0xf')][_0x4e466e];});}else{ut[_0xd1d0('0x4a')](_0xd1d0('0x52'));delete this['channels'][_0x4e466e];delete this[_0xd1d0('0xf')][_0x4e466e];}};Fax[_0xd1d0('0x1d')][_0xd1d0('0x53')]=function(_0xed88bb){var _0x2c2dd5=this;if(this['channels'][_0xed88bb['uniqueid']]){if(this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]){this[_0xd1d0('0xc')][_0xed88bb['uniqueid']]['id']=this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]['id'];this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]][_0xd1d0('0x3a')]=this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]['name'];}logger[_0xd1d0('0x2c')](_0xed88bb[_0xd1d0('0x22')],this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]?_0xd1d0('0x54'):_0xd1d0('0x55'),JSON[_0xd1d0('0x56')](this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]]));if(this[_0xd1d0('0xf')][_0xed88bb[_0xd1d0('0x22')]]){if(this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]][_0xd1d0('0x57')]>0x0&&this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]][_0xd1d0('0x18')]===_0xd1d0('0x58')){this[_0xd1d0('0x4e')](_0xed88bb[_0xd1d0('0x22')],!![]);}else{this[_0xd1d0('0x4e')](_0xed88bb[_0xd1d0('0x22')],![],this[_0xd1d0('0xc')][_0xed88bb['uniqueid']][_0xd1d0('0x59')]?_0xd1d0('0x5a')+this[_0xd1d0('0xc')][_0xed88bb[_0xd1d0('0x22')]][_0xd1d0('0x59')]:_0xd1d0('0x5b'));}}}};Fax[_0xd1d0('0x1d')][_0xd1d0('0x5c')]=function(_0x3bc488){var _0xcd26ac=this;return new BPromise(function(_0x328881,_0x54e62a){_0xcd26ac[_0xd1d0('0x5d')](_0x3bc488,_0xcd26ac[_0xd1d0('0xd')][_0x3bc488['FaxAccountId']])[_0xd1d0('0x3c')](function(_0x236396){ut[_0xd1d0('0x4a')](_0xd1d0('0x5e'),_0x236396);_0x328881(ut[_0xd1d0('0x37')](_0xd1d0('0x5f')));})[_0xd1d0('0x41')](function(_0x2ee0d6){ut[_0xd1d0('0x4a')](_0xd1d0('0x60'),_0x2ee0d6);updateStatus(_0x3bc488);_0x54e62a(ut[_0xd1d0('0x37')](_0xd1d0('0x61')));});});};Fax[_0xd1d0('0x1d')][_0xd1d0('0x62')]=function(_0xe202ff){var _0x32df24=this;return new BPromise(function(_0x147732,_0xebef88){var _0x3a958c=_0x32df24['checkTrunk'](_0x32df24[_0xd1d0('0xd')][_0xe202ff[_0xd1d0('0x63')]]['Trunk'],_0xe202ff);if(_0x3a958c['isValid']){_0x147732(ut['message'](_0xd1d0('0x64')));}else{_0xebef88(ut['message'](_0x3a958c[_0xd1d0('0x37')]));}});};function originate(_0x2d185f,_0x213b83,_0x36139b){return new BPromise(function(_0x29e301,_0x660c8f){if(_0x36139b){var _0xf0ffb3=util[_0xd1d0('0x65')]('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['parse'](_0x2d185f['path'])[_0xd1d0('0x3a')],_0x2d185f['path']);gs[_0xd1d0('0x66')](_0xf0ffb3)['then'](function(){_0x2d185f['path']=util['format'](_0xd1d0('0x67'),path[_0xd1d0('0x39')](_0x2d185f[_0xd1d0('0x3')])[_0xd1d0('0x68')],path[_0xd1d0('0x39')](_0x2d185f[_0xd1d0('0x3')])['name']);_0x213b83[_0xd1d0('0x69')]=_0x2d185f[_0xd1d0('0x3')];ut[_0xd1d0('0x4a')](_0xd1d0('0x6a'),'');ami[_0xd1d0('0x6b')](ut[_0xd1d0('0x6c')](_0x2d185f,_0x213b83))['then'](function(_0x5ec832){_0x29e301(_0x5ec832);})[_0xd1d0('0x41')](function(_0x1316e0){_0x660c8f(_0x1316e0);});})[_0xd1d0('0x41')](function(_0x4b97c8){_0x660c8f(_0x4b97c8);});}else{ami['Action'](ut['variablesAction'](_0x2d185f,_0x213b83))[_0xd1d0('0x3c')](function(_0x123424){_0x29e301(_0x123424);})[_0xd1d0('0x41')](function(_0x149e92){_0x660c8f(_0x149e92);});}});}Fax[_0xd1d0('0x1d')][_0xd1d0('0x5d')]=function(_0x547a2e,_0xb1a8d3){var _0xca8d60=this;return new BPromise(function(_0x413460,_0x1c78a1){var _0x540453=uuid['v4']();var _0x418a7e=ut[_0xd1d0('0x6d')](_0x547a2e,_0xb1a8d3);_0xca8d60[_0xd1d0('0xf')][_0x540453]=new Action(_0x540453,_0xb1a8d3,_0x547a2e);var _0x511eb9=_0xca8d60[_0xd1d0('0xf')][_0x540453];if(path[_0xd1d0('0x39')](_0x547a2e[_0xd1d0('0x3')])[_0xd1d0('0x6e')]===_0xd1d0('0x3f')){originate(_0x511eb9,_0x418a7e,!![])['then'](function(_0x1bb69e){_0x413460(_0x1bb69e);})['catch'](function(_0x5d6ddc){_0x1c78a1(_0x5d6ddc);});}else{originate(_0x511eb9,_0x418a7e,![])[_0xd1d0('0x3c')](function(_0x290b55){_0x413460(_0x290b55);})[_0xd1d0('0x41')](function(_0x4a80e9){_0x1c78a1(_0x4a80e9);});}});};Fax[_0xd1d0('0x1d')][_0xd1d0('0x6f')]=function(_0x16fb6f){return!_['isNil'](_0x16fb6f)&&!_['isNil'](_0x16fb6f[_0xd1d0('0x3a')])&&!_['isNil'](_0x16fb6f['active'])&&_0x16fb6f[_0xd1d0('0x70')]&&!_['isNil'](this[_0xd1d0('0xe')][util[_0xd1d0('0x65')](_0xd1d0('0x71'),_0x16fb6f[_0xd1d0('0x3a')])])&&!_[_0xd1d0('0x72')](this['trunks'][util[_0xd1d0('0x65')]('SIP/%s',_0x16fb6f[_0xd1d0('0x3a')])]['status'])&&(this[_0xd1d0('0xe')][util[_0xd1d0('0x65')](_0xd1d0('0x71'),_0x16fb6f[_0xd1d0('0x3a')])][_0xd1d0('0x2a')]===_0xd1d0('0x73')||this[_0xd1d0('0xe')][util[_0xd1d0('0x65')](_0xd1d0('0x71'),_0x16fb6f[_0xd1d0('0x3a')])][_0xd1d0('0x2a')]===_0xd1d0('0x74'));};Fax[_0xd1d0('0x1d')][_0xd1d0('0x75')]=function(_0x12e801,_0x2091c2){if(!this['isTrunkReachable'](_0x12e801)){ut[_0xd1d0('0x4a')](_0xd1d0('0x76'),_['isNil'](_0x12e801)?'':_0x12e801[_0xd1d0('0x3a')]+_0xd1d0('0x77'));return{'isValid':![],'message':_0xd1d0('0x78')};}if(_[_0xd1d0('0x72')](_0x2091c2[_0xd1d0('0x3e')])){ut['logger'](_0xd1d0('0x79'),JSON[_0xd1d0('0x56')](_0x2091c2));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xd1d0('0x72')](_0x2091c2['path'])){ut[_0xd1d0('0x4a')](_0xd1d0('0x7a'),JSON['stringify'](_0x2091c2));return{'isValid':![],'message':_0xd1d0('0x7b')};}return{'isValid':!![],'message':_0xd1d0('0x7c')};};module[_0xd1d0('0x7d')]=Fax; \ No newline at end of file +var _0xf1c5=['prototype','hasOwnProperty','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','calleridnum','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','.pdf','catch','error','stringify','\x20receiveFax\x20','actions','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','FaxAccountId','[Fax][execOriginate][success]','message','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','lodash','bluebird','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncHangup','syncOriginateResponse','from-voip-provider','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc'];(function(_0x476c51,_0x34bba5){var _0x402a45=function(_0x30b2ff){while(--_0x30b2ff){_0x476c51['push'](_0x476c51['shift']());}};_0x402a45(++_0x34bba5);}(_0xf1c5,0x1a4));var _0x5f1c=function(_0x583e65,_0x414aeb){_0x583e65=_0x583e65-0x0;var _0x5ab194=_0xf1c5[_0x583e65];return _0x5ab194;};'use strict';var util=require(_0x5f1c('0x0'));var _=require(_0x5f1c('0x1'));var BPromise=require(_0x5f1c('0x2'));var uuid=require(_0x5f1c('0x3'));var moment=require(_0x5f1c('0x4'));var path=require('path');var tiff2pdf=require(_0x5f1c('0x5'));var gs=require(_0x5f1c('0x6'));var logger=require(_0x5f1c('0x7'))(_0x5f1c('0x8'));var ami=require('../ami');var rpcDb=require(_0x5f1c('0x9'));var Channel=require(_0x5f1c('0xa'));var ut=require(_0x5f1c('0xb'));var Action=require('./action');var faxAccount=require(_0x5f1c('0xc'));var attachment=require(_0x5f1c('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x5499b0){this[_0x5f1c('0xe')]={};this[_0x5f1c('0xf')]=_0x5499b0[_0x5f1c('0xf')];this[_0x5f1c('0x10')]=_0x5499b0[_0x5f1c('0x10')];this['actions']={};ami['on']('newchannel',this[_0x5f1c('0x11')][_0x5f1c('0x12')](this));ami['on'](_0x5f1c('0x13'),this[_0x5f1c('0x14')][_0x5f1c('0x12')](this));ami['on'](_0x5f1c('0x15'),this[_0x5f1c('0x16')][_0x5f1c('0x12')](this));ami['on'](_0x5f1c('0x17'),this[_0x5f1c('0x18')][_0x5f1c('0x12')](this));ami['on'](_0x5f1c('0x19'),this[_0x5f1c('0x1a')][_0x5f1c('0x12')](this));ami['on']('receivefax',this['syncReceiveFax'][_0x5f1c('0x12')](this));ami['on']('hangup',this[_0x5f1c('0x1b')]['bind'](this));ami['on']('originateresponse',this[_0x5f1c('0x1c')][_0x5f1c('0x12')](this));}Fax['prototype'][_0x5f1c('0x11')]=function(_0x3dd0a2){if(_0x3dd0a2['context']===_0x5f1c('0x1d')){for(var _0x564367 in this[_0x5f1c('0xf')]){if(this[_0x5f1c('0xf')]['hasOwnProperty'](_0x564367)){if(_0x3dd0a2[_0x5f1c('0x1e')]===this['faxAccounts'][_0x564367]['localstationid']){this[_0x5f1c('0xe')][_0x3dd0a2[_0x5f1c('0x1f')]]={};this[_0x5f1c('0xe')][_0x3dd0a2['uniqueid']][_0x5f1c('0x20')]=_0x3dd0a2['channel'];this[_0x5f1c('0xe')][_0x3dd0a2[_0x5f1c('0x1f')]]['id']=this[_0x5f1c('0xf')][_0x564367]['id'];this[_0x5f1c('0xe')][_0x3dd0a2['uniqueid']][_0x5f1c('0x21')]=this[_0x5f1c('0xf')][_0x564367][_0x5f1c('0x21')];logger[_0x5f1c('0x22')](_0x3dd0a2[_0x5f1c('0x1f')],_0x5f1c('0x23'));}}}}if(this['actions'][_0x3dd0a2[_0x5f1c('0x1f')]]){this[_0x5f1c('0xe')][_0x3dd0a2[_0x5f1c('0x1f')]]={};this['channels'][_0x3dd0a2[_0x5f1c('0x1f')]][_0x5f1c('0x20')]=_0x3dd0a2[_0x5f1c('0x20')];logger['info'](_0x3dd0a2[_0x5f1c('0x1f')],_0x5f1c('0x23'));}};Fax['prototype'][_0x5f1c('0x14')]=function(_0x25c1e7){if(this[_0x5f1c('0xe')][_0x25c1e7[_0x5f1c('0x1f')]]){for(var _0x444ea0 in _0x25c1e7[_0x5f1c('0x24')]){if(_0x25c1e7[_0x5f1c('0x24')]['hasOwnProperty'](_0x444ea0)){this[_0x5f1c('0xe')][_0x25c1e7[_0x5f1c('0x1f')]][_0x444ea0]=_0x25c1e7[_0x5f1c('0x25')];}}}};Fax['prototype'][_0x5f1c('0x16')]=function(_0x28f8d1){if(this['channels'][_0x28f8d1[_0x5f1c('0x1f')]]){this['channels'][_0x28f8d1[_0x5f1c('0x1f')]][_0x5f1c('0x26')]=_0x28f8d1['channelstate'];this[_0x5f1c('0xe')][_0x28f8d1[_0x5f1c('0x1f')]][_0x5f1c('0x27')]=_0x28f8d1[_0x5f1c('0x27')];}};Fax[_0x5f1c('0x28')][_0x5f1c('0x18')]=function(_0x55fd82){if(this[_0x5f1c('0xe')][_0x55fd82['uniqueid']]){for(var _0x5aa980 in _0x55fd82['variable']){if(_0x55fd82[_0x5f1c('0x24')][_0x5f1c('0x29')](_0x5aa980)){this[_0x5f1c('0xe')][_0x55fd82[_0x5f1c('0x1f')]][_0x5aa980]=_0x55fd82[_0x5f1c('0x25')];}}}};Fax[_0x5f1c('0x28')][_0x5f1c('0x1a')]=function(_0x1dd8a5){if(this[_0x5f1c('0xe')][_0x1dd8a5['uniqueid']]){this[_0x5f1c('0xe')][_0x1dd8a5[_0x5f1c('0x1f')]][_0x5f1c('0x2a')]=_0x1dd8a5[_0x5f1c('0x2a')];this[_0x5f1c('0xe')][_0x1dd8a5[_0x5f1c('0x1f')]][_0x5f1c('0x2b')]=_0x1dd8a5['status'];this[_0x5f1c('0xe')][_0x1dd8a5['uniqueid']][_0x5f1c('0x2c')]=_0x1dd8a5[_0x5f1c('0x2c')];this[_0x5f1c('0xe')][_0x1dd8a5[_0x5f1c('0x1f')]]['filename']=_0x1dd8a5[_0x5f1c('0x2d')];logger[_0x5f1c('0x22')](_0x1dd8a5[_0x5f1c('0x1f')],_0x5f1c('0x2e'));}};Fax['prototype'][_0x5f1c('0x2f')]=function(_0x133068){var _0x3ecaba=this;if(this[_0x5f1c('0xe')][_0x133068[_0x5f1c('0x1f')]]){var _0xdbfad9=this[_0x5f1c('0xe')][_0x133068[_0x5f1c('0x1f')]]['id'];this[_0x5f1c('0xe')][_0x133068[_0x5f1c('0x1f')]]['remotestationid']=_0x133068[_0x5f1c('0x30')];this[_0x5f1c('0xe')][_0x133068[_0x5f1c('0x1f')]][_0x5f1c('0x31')]=_0x133068[_0x5f1c('0x31')];this[_0x5f1c('0xe')][_0x133068[_0x5f1c('0x1f')]][_0x5f1c('0x2c')]=_0x133068[_0x5f1c('0x2c')];this['channels'][_0x133068[_0x5f1c('0x1f')]][_0x5f1c('0x32')]=_0x133068[_0x5f1c('0x32')];this[_0x5f1c('0xe')][_0x133068[_0x5f1c('0x1f')]]['transferrate']=_0x133068['transferrate'];this[_0x5f1c('0xe')][_0x133068[_0x5f1c('0x1f')]]['filename']=_0x133068[_0x5f1c('0x2d')];this['channels'][_0x133068[_0x5f1c('0x1f')]][_0x5f1c('0x33')]=_0x133068[_0x5f1c('0x33')];if(this[_0x5f1c('0xe')][_0x133068[_0x5f1c('0x1f')]][_0x5f1c('0x31')]>0x0){tiff2pdf(_0x133068[_0x5f1c('0x2d')],'/var/opt/motion2/server/files/attachments/',function(_0x1a8c23){logger[_0x5f1c('0x22')](_0x133068[_0x5f1c('0x1f')],_0x5f1c('0x34'),_0x1a8c23['message']);attachment[_0x5f1c('0x35')]({'name':path[_0x5f1c('0x36')](_0x133068[_0x5f1c('0x2d')])['name'],'basename':path[_0x5f1c('0x36')](_0x133068[_0x5f1c('0x2d')])[_0x5f1c('0x21')]+'.pdf','type':_0x5f1c('0x37')})[_0x5f1c('0x38')](function(_0x1326e1){faxAccount[_0x5f1c('0x39')](_0xdbfad9,{'from':_0x133068[_0x5f1c('0x33')],'mapKey':_0x5f1c('0x8'),'body':path['parse'](_0x133068[_0x5f1c('0x2d')])[_0x5f1c('0x21')]+_0x5f1c('0x3a'),'AttachmentId':_0x1326e1['id']})[_0x5f1c('0x3b')](function(_0x54ad80){logger[_0x5f1c('0x3c')](_0x133068[_0x5f1c('0x1f')],'\x20notify\x20',JSON['stringify'](_0x54ad80));});})[_0x5f1c('0x3b')](function(_0x5dfa71){logger[_0x5f1c('0x3c')](_0x133068[_0x5f1c('0x1f')],'\x20receiveFax\x20',JSON[_0x5f1c('0x3d')](_0x5dfa71));});});}logger['info'](_0x133068[_0x5f1c('0x1f')],_0x5f1c('0x3e'));}};Fax[_0x5f1c('0x28')][_0x5f1c('0x1c')]=function(_0x4672d1){if(this[_0x5f1c('0x3f')][_0x4672d1[_0x5f1c('0x1f')]]){_['merge'](this[_0x5f1c('0xe')][_0x4672d1[_0x5f1c('0x1f')]],_[_0x5f1c('0x40')](_0x4672d1,['response',_0x5f1c('0x41')]));}};function updateStatus(_0x17ed4b){if(_0x17ed4b[_0x5f1c('0x42')]){faxMessage[_0x5f1c('0x43')](_0x17ed4b[_0x5f1c('0x42')],{'failMessage':_0x5f1c('0x44')})[_0x5f1c('0x38')](function(_0x5eea53){ut[_0x5f1c('0x45')](_0x5f1c('0x46'),_0x5eea53);})[_0x5f1c('0x3b')](function(_0x5e555c){ut[_0x5f1c('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x5e555c);});}else{ut[_0x5f1c('0x45')](_0x5f1c('0x47'));}}Fax[_0x5f1c('0x28')][_0x5f1c('0x48')]=function(_0x1a4fe7,_0x419b60,_0x186fb3){var _0x1408cd=this;var _0x4414a9={};if(_0x419b60){_0x4414a9={'read':_0x419b60};}else{_0x4414a9={'failMessage':_0x186fb3};}if(this[_0x5f1c('0x3f')][_0x1a4fe7][_0x5f1c('0x42')]){faxMessage[_0x5f1c('0x43')](this[_0x5f1c('0x3f')][_0x1a4fe7]['AttachmentId'],_0x4414a9)[_0x5f1c('0x38')](function(_0x4644ed){ut[_0x5f1c('0x45')](_0x5f1c('0x49'),_0x4644ed);})[_0x5f1c('0x3b')](function(_0x3c1305){ut['logger'](_0x5f1c('0x4a'),_0x3c1305);})[_0x5f1c('0x4b')](function(){delete _0x1408cd[_0x5f1c('0xe')][_0x1a4fe7];delete _0x1408cd['actions'][_0x1a4fe7];});}else{ut[_0x5f1c('0x45')](_0x5f1c('0x4c'));delete this[_0x5f1c('0xe')][_0x1a4fe7];delete this[_0x5f1c('0x3f')][_0x1a4fe7];}};Fax[_0x5f1c('0x28')][_0x5f1c('0x1b')]=function(_0x5e2460){var _0x41e057=this;if(this[_0x5f1c('0xe')][_0x5e2460['uniqueid']]){if(this[_0x5f1c('0x3f')][_0x5e2460['uniqueid']]){this[_0x5f1c('0xe')][_0x5e2460[_0x5f1c('0x1f')]]['id']=this[_0x5f1c('0x3f')][_0x5e2460[_0x5f1c('0x1f')]]['id'];this[_0x5f1c('0xe')][_0x5e2460[_0x5f1c('0x1f')]]['name']=this[_0x5f1c('0x3f')][_0x5e2460[_0x5f1c('0x1f')]][_0x5f1c('0x21')];}logger['info'](_0x5e2460[_0x5f1c('0x1f')],this['actions'][_0x5e2460[_0x5f1c('0x1f')]]?_0x5f1c('0x4d'):_0x5f1c('0x4e'),JSON[_0x5f1c('0x3d')](this['channels'][_0x5e2460[_0x5f1c('0x1f')]]));if(this['actions'][_0x5e2460[_0x5f1c('0x1f')]]){if(this[_0x5f1c('0xe')][_0x5e2460[_0x5f1c('0x1f')]]['faxpages']>0x0&&this['channels'][_0x5e2460[_0x5f1c('0x1f')]][_0x5f1c('0x19')]===_0x5f1c('0x4f')){this[_0x5f1c('0x48')](_0x5e2460[_0x5f1c('0x1f')],!![]);}else{this['updateStatus'](_0x5e2460[_0x5f1c('0x1f')],![],this[_0x5f1c('0xe')][_0x5e2460['uniqueid']]['faxstatusstring']?_0x5f1c('0x50')+this['channels'][_0x5e2460['uniqueid']][_0x5f1c('0x51')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x5f1c('0x52')]=function(_0x130e0d){var _0x237381=this;return new BPromise(function(_0x5ed79a,_0x1c75ef){_0x237381['execOriginate'](_0x130e0d,_0x237381[_0x5f1c('0xf')][_0x130e0d[_0x5f1c('0x53')]])[_0x5f1c('0x38')](function(_0x4955db){ut[_0x5f1c('0x45')](_0x5f1c('0x54'),_0x4955db);_0x5ed79a(ut[_0x5f1c('0x55')](_0x5f1c('0x56')));})[_0x5f1c('0x3b')](function(_0x21ac76){ut[_0x5f1c('0x45')](_0x5f1c('0x57'),_0x21ac76);updateStatus(_0x130e0d);_0x1c75ef(ut['message'](_0x5f1c('0x58')));});});};Fax[_0x5f1c('0x28')][_0x5f1c('0x59')]=function(_0x5446ad){var _0x24e3d6=this;return new BPromise(function(_0x4b3149,_0x59be14){var _0xbb5402=_0x24e3d6['checkTrunk'](_0x24e3d6[_0x5f1c('0xf')][_0x5446ad['FaxAccountId']][_0x5f1c('0x5a')],_0x5446ad);if(_0xbb5402[_0x5f1c('0x5b')]){_0x4b3149(ut['message'](_0x5f1c('0x5c')));}else{_0x59be14(ut['message'](_0xbb5402['message']));}});};function originate(_0x14eee1,_0x106ddd,_0x353af3){return new BPromise(function(_0x315379,_0x23ce84){if(_0x353af3){var _0xf926c0=util[_0x5f1c('0x5d')](_0x5f1c('0x5e'),path[_0x5f1c('0x36')](_0x14eee1[_0x5f1c('0x5f')])[_0x5f1c('0x21')],_0x14eee1[_0x5f1c('0x5f')]);gs[_0x5f1c('0x60')](_0xf926c0)[_0x5f1c('0x38')](function(){_0x14eee1[_0x5f1c('0x5f')]=util[_0x5f1c('0x5d')](_0x5f1c('0x61'),path[_0x5f1c('0x36')](_0x14eee1[_0x5f1c('0x5f')])[_0x5f1c('0x62')],path[_0x5f1c('0x36')](_0x14eee1[_0x5f1c('0x5f')])['name']);_0x106ddd['XMF-PATH']=_0x14eee1['path'];ut['logger']('Convert\x20pdf\x20to\x20tif','');ami[_0x5f1c('0x63')](ut[_0x5f1c('0x64')](_0x14eee1,_0x106ddd))[_0x5f1c('0x38')](function(_0x4765c3){_0x315379(_0x4765c3);})[_0x5f1c('0x3b')](function(_0x1ab134){_0x23ce84(_0x1ab134);});})[_0x5f1c('0x3b')](function(_0x4b53e6){_0x23ce84(_0x4b53e6);});}else{ami['Action'](ut[_0x5f1c('0x64')](_0x14eee1,_0x106ddd))[_0x5f1c('0x38')](function(_0x48104e){_0x315379(_0x48104e);})[_0x5f1c('0x3b')](function(_0x58176d){_0x23ce84(_0x58176d);});}});}Fax[_0x5f1c('0x28')][_0x5f1c('0x65')]=function(_0x4577a6,_0x41719c){var _0x4ab2b8=this;return new BPromise(function(_0xde0f6e,_0x1be9c6){var _0x570aa3=uuid['v4']();var _0x1d2538=ut[_0x5f1c('0x66')](_0x4577a6,_0x41719c);_0x4ab2b8[_0x5f1c('0x3f')][_0x570aa3]=new Action(_0x570aa3,_0x41719c,_0x4577a6);var _0xcecf5d=_0x4ab2b8[_0x5f1c('0x3f')][_0x570aa3];if(path[_0x5f1c('0x36')](_0x4577a6[_0x5f1c('0x5f')])[_0x5f1c('0x67')]==='.pdf'){originate(_0xcecf5d,_0x1d2538,!![])[_0x5f1c('0x38')](function(_0x51cd1a){_0xde0f6e(_0x51cd1a);})[_0x5f1c('0x3b')](function(_0x199a9e){_0x1be9c6(_0x199a9e);});}else{originate(_0xcecf5d,_0x1d2538,![])[_0x5f1c('0x38')](function(_0x4d6c27){_0xde0f6e(_0x4d6c27);})['catch'](function(_0x589624){_0x1be9c6(_0x589624);});}});};Fax[_0x5f1c('0x28')][_0x5f1c('0x68')]=function(_0x328b84){return!_[_0x5f1c('0x69')](_0x328b84)&&!_[_0x5f1c('0x69')](_0x328b84[_0x5f1c('0x21')])&&!_['isNil'](_0x328b84[_0x5f1c('0x6a')])&&_0x328b84[_0x5f1c('0x6a')]&&!_['isNil'](this[_0x5f1c('0x10')][util[_0x5f1c('0x5d')](_0x5f1c('0x6b'),_0x328b84[_0x5f1c('0x21')])])&&!_[_0x5f1c('0x69')](this['trunks'][util[_0x5f1c('0x5d')](_0x5f1c('0x6b'),_0x328b84[_0x5f1c('0x21')])][_0x5f1c('0x2b')])&&(this[_0x5f1c('0x10')][util[_0x5f1c('0x5d')](_0x5f1c('0x6b'),_0x328b84[_0x5f1c('0x21')])]['status']===_0x5f1c('0x6c')||this[_0x5f1c('0x10')][util[_0x5f1c('0x5d')](_0x5f1c('0x6b'),_0x328b84[_0x5f1c('0x21')])][_0x5f1c('0x2b')]===_0x5f1c('0x6d'));};Fax[_0x5f1c('0x28')][_0x5f1c('0x6e')]=function(_0x4cbcaf,_0x76867e){if(!this[_0x5f1c('0x68')](_0x4cbcaf)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x5f1c('0x69')](_0x4cbcaf)?'':_0x4cbcaf[_0x5f1c('0x21')]+_0x5f1c('0x6f'));return{'isValid':![],'message':_0x5f1c('0x70')};}if(_[_0x5f1c('0x69')](_0x76867e['fax'])){ut[_0x5f1c('0x45')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x5f1c('0x3d')](_0x76867e));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x5f1c('0x69')](_0x76867e[_0x5f1c('0x5f')])){ut[_0x5f1c('0x45')](_0x5f1c('0x71'),JSON[_0x5f1c('0x3d')](_0x76867e));return{'isValid':![],'message':_0x5f1c('0x72')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 36b0a91..2c61504 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 _0x9a9b=['preview','../rpc/faxAccount','error','inspect','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger'];(function(_0x27250c,_0x3e6637){var _0x7e3095=function(_0x1bbce7){while(--_0x1bbce7){_0x27250c['push'](_0x27250c['shift']());}};_0x7e3095(++_0x3e6637);}(_0x9a9b,0x184));var _0xb9a9=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x9a9b[_0x2ae2ad];return _0x26dbd7;};'use strict';var util=require('util');var BPromise=require(_0xb9a9('0x0'));var logger=require(_0xb9a9('0x1'))(_0xb9a9('0x2'));var _=require('lodash');var faxAccount=require(_0xb9a9('0x3'));function loggerCatch(_0x2a4b2c){return function(_0x4ab825){logger[_0xb9a9('0x4')](_0x2a4b2c,util[_0xb9a9('0x5')](_0x4ab825,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x20a232,_0x53a122){return BPromise[_0xb9a9('0x6')]()[_0xb9a9('0x7')](faxAccount['notify'](_0x20a232,_0x53a122))[_0xb9a9('0x8')](loggerCatch(_0xb9a9('0x9')));}; \ No newline at end of file +var _0xbcd8=['notify','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','error','inspect'];(function(_0x465759,_0x21dc69){var _0xf6a640=function(_0x83ef89){while(--_0x83ef89){_0x465759['push'](_0x465759['shift']());}};_0xf6a640(++_0x21dc69);}(_0xbcd8,0xca));var _0x8bcd=function(_0x57d36d,_0x54d07a){_0x57d36d=_0x57d36d-0x0;var _0x1eb59d=_0xbcd8[_0x57d36d];return _0x1eb59d;};'use strict';var util=require(_0x8bcd('0x0'));var BPromise=require(_0x8bcd('0x1'));var logger=require(_0x8bcd('0x2'))(_0x8bcd('0x3'));var _=require(_0x8bcd('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2ddf8f){return function(_0x85f775){logger[_0x8bcd('0x5')](_0x2ddf8f,util[_0x8bcd('0x6')](_0x85f775,{'showHidden':![],'depth':null}));};}exports[_0x8bcd('0x7')]=function(_0x65ab6,_0x23931c){return BPromise['resolve']()[_0x8bcd('0x8')](faxAccount[_0x8bcd('0x7')](_0x65ab6,_0x23931c))[_0x8bcd('0x9')](loggerCatch(_0x8bcd('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 53f7eba..b20ec6f 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 _0x3ef7=['info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x3ef7,0x159));var _0x73ef=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3ef7[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x73ef('0x0'));var logger=require(_0x73ef('0x1'))(_0x73ef('0x2'));var BPromise=require(_0x73ef('0x3'));var exec=require(_0x73ef('0x4'))[_0x73ef('0x5')];exports[_0x73ef('0x6')]=function(_0x28ab64){return new BPromise(function(_0x105e14,_0x457cf6){exec(_0x28ab64,function(_0x28aae0,_0x49403a,_0x17a8ae){logger[_0x73ef('0x7')](_0x73ef('0x8'),_0x49403a);if(_0x28aae0){logger[_0x73ef('0x7')](_0x73ef('0x8'),_0x73ef('0x9'),util[_0x73ef('0xa')](_0x28aae0,{'showHidden':![],'depth':null}),_0x49403a,_0x17a8ae);_0x457cf6(_0x28aae0);}_0x105e14(_0x49403a);});});}; \ No newline at end of file +var _0xb525=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','Exec\x20gs'];(function(_0x22ae67,_0x1d3acc){var _0x5c83b3=function(_0x105f14){while(--_0x105f14){_0x22ae67['push'](_0x22ae67['shift']());}};_0x5c83b3(++_0x1d3acc);}(_0xb525,0xda));var _0x5b52=function(_0x5a122d,_0x56581a){_0x5a122d=_0x5a122d-0x0;var _0x4eb609=_0xb525[_0x5a122d];return _0x4eb609;};'use strict';var util=require(_0x5b52('0x0'));var logger=require(_0x5b52('0x1'))(_0x5b52('0x2'));var BPromise=require(_0x5b52('0x3'));var exec=require(_0x5b52('0x4'))[_0x5b52('0x5')];exports['execute']=function(_0x53b0a3){return new BPromise(function(_0x3be345,_0x15337c){exec(_0x53b0a3,function(_0x3b57d5,_0x94c1a1,_0x2d286a){logger['info'](_0x5b52('0x6'),_0x94c1a1);if(_0x3b57d5){logger['info'](_0x5b52('0x6'),_0x5b52('0x7'),util[_0x5b52('0x8')](_0x3b57d5,{'showHidden':![],'depth':null}),_0x94c1a1,_0x2d286a);_0x15337c(_0x3b57d5);}_0x3be345(_0x94c1a1);});});}; \ 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 249d80f..ebc2c5f 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 _0x4957=['gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','headerinfo','lodash','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','minrate','\x22%s\x22'];(function(_0x13a4f4,_0x4237c8){var _0x50fd03=function(_0x2da982){while(--_0x2da982){_0x13a4f4['push'](_0x13a4f4['shift']());}};_0x50fd03(++_0x4237c8);}(_0x4957,0x95));var _0x7495=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x4957[_0x500419];return _0x241c1a;};'use strict';var util=require('util');var _=require(_0x7495('0x0'));var moment=require(_0x7495('0x1'));var logger=require(_0x7495('0x2'))('fax');exports[_0x7495('0x3')]=function(_0x3de5e5){return{'message':_0x3de5e5};};exports[_0x7495('0x4')]=function(_0x5baf3c,_0x1f95bf){logger[_0x7495('0x5')](_0x5baf3c,util[_0x7495('0x6')](_0x1f95bf,{'showHidden':![],'depth':null}));};exports[_0x7495('0x7')]=function(_0x449775,_0x1385c0){var _0x3f0be9={'XMF-ECM':_0x1385c0[_0x7495('0x8')],'XMF-HEADERINFO':_0x1385c0['headerinfo'],'XMF-MINRATE':_0x1385c0[_0x7495('0x9')],'XMF-MAXRATE':_0x1385c0['maxrate'],'XMF-MODEM':util['format'](_0x7495('0xa'),_0x1385c0['modem']),'XMF-GATEWAY':_0x1385c0[_0x7495('0xb')],'XMF-FAXDETECT':_0x1385c0['faxdetect'],'XMF-T38TIMEOUT':_0x1385c0[_0x7495('0xc')],'XMF-LOCALSTATIONID':_0x1385c0[_0x7495('0xd')],'XMF-PATH':_0x449775[_0x7495('0xe')]};return _0x3f0be9;};exports[_0x7495('0xf')]=function(_0x140324,_0x3671f5){return{'actionid':_0x140324[_0x7495('0x10')],'action':_0x7495('0x11'),'channel':_0x140324[_0x7495('0x12')],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x140324[_0x7495('0x13')]?_0x140324['headerinfo']:'',_0x140324[_0x7495('0xd')]),'variable':_0x3671f5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x140324[_0x7495('0x10')]};}; \ No newline at end of file +var _0x29a6=['headerinfo','minrate','maxrate','\x22%s\x22','modem','faxdetect','t38timeout','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','info','inspect','addVariables'];(function(_0x1d3fc9,_0x3752d6){var _0x4e7e33=function(_0x57fec7){while(--_0x57fec7){_0x1d3fc9['push'](_0x1d3fc9['shift']());}};_0x4e7e33(++_0x3752d6);}(_0x29a6,0xaf));var _0x629a=function(_0x248763,_0x285e28){_0x248763=_0x248763-0x0;var _0x476a07=_0x29a6[_0x248763];return _0x476a07;};'use strict';var util=require(_0x629a('0x0'));var _=require(_0x629a('0x1'));var moment=require(_0x629a('0x2'));var logger=require(_0x629a('0x3'))(_0x629a('0x4'));exports[_0x629a('0x5')]=function(_0xe4da17){return{'message':_0xe4da17};};exports['logger']=function(_0x3ab81b,_0x5b32d7){logger[_0x629a('0x6')](_0x3ab81b,util[_0x629a('0x7')](_0x5b32d7,{'showHidden':![],'depth':null}));};exports[_0x629a('0x8')]=function(_0x2c2d67,_0x2627e1){var _0xfcea11={'XMF-ECM':_0x2627e1['ecm'],'XMF-HEADERINFO':_0x2627e1[_0x629a('0x9')],'XMF-MINRATE':_0x2627e1[_0x629a('0xa')],'XMF-MAXRATE':_0x2627e1[_0x629a('0xb')],'XMF-MODEM':util['format'](_0x629a('0xc'),_0x2627e1[_0x629a('0xd')]),'XMF-GATEWAY':_0x2627e1['gateway'],'XMF-FAXDETECT':_0x2627e1[_0x629a('0xe')],'XMF-T38TIMEOUT':_0x2627e1[_0x629a('0xf')],'XMF-LOCALSTATIONID':_0x2627e1['localstationid'],'XMF-PATH':_0x2c2d67['path']};return _0xfcea11;};exports['variablesAction']=function(_0x4ab37c,_0x2028ad){return{'actionid':_0x4ab37c[_0x629a('0x10')],'action':_0x629a('0x11'),'channel':_0x4ab37c[_0x629a('0x12')],'Exten':_0x629a('0x13'),'Context':_0x629a('0x14'),'Priority':'1','callerid':util[_0x629a('0x15')](_0x629a('0x16'),_0x4ab37c[_0x629a('0x9')]?_0x4ab37c[_0x629a('0x9')]:'',_0x4ab37c['localstationid']),'variable':_0x2028ad,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4ab37c[_0x629a('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 51c83c8..112b540 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 _0x69d1=['resolve','then','getAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','error','[index.js][initParams]','catch','[index.js][main]','inspect','bluebird','moment','./realtime','./report','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69d1,0x1b5));var _0x169d=function(_0x34226f,_0x1cd113){_0x34226f=_0x34226f-0x0;var _0x1bf7dc=_0x69d1[_0x34226f];return _0x1bf7dc;};'use strict';var BPromise=require(_0x169d('0x0'));var util=require('util');var moment=require(_0x169d('0x1'));var server=require('./server');var Realtime=require(_0x169d('0x2'));var Report=require(_0x169d('0x3'));var Acw=require('./acw');var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x169d('0x4'));var Fax=require('./fax');var user=require(_0x169d('0x5'));var voiceQueue=require(_0x169d('0x6'));var voiceQueueReport=require(_0x169d('0x7'));var voiceCallReport=require(_0x169d('0x8'));var trunk=require(_0x169d('0x9'));var trigger=require(_0x169d('0xa'));var template=require(_0x169d('0xb'));var cmHopperHistory=require(_0x169d('0xc'));var campaign=require(_0x169d('0xd'));var voiceExtension=require(_0x169d('0xe'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x169d('0xf'));var salesforce=require(_0x169d('0x10'));var sugarcrm=require(_0x169d('0x11'));var freshdesk=require(_0x169d('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x169d('0x13'));var freshsales=require(_0x169d('0x14'));var servicenow=require(_0x169d('0x15'));var dynamics365=require(_0x169d('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x169d('0x17')](_0x169d('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x169d('0x17')](_0x169d('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x169d('0x19')]()[_0x169d('0x1a')](user[_0x169d('0x1b')]())[_0x169d('0x1a')](realtime['initAgents']())[_0x169d('0x1a')](user[_0x169d('0x1c')]())[_0x169d('0x1a')](realtime[_0x169d('0x1d')]())['then'](trunk[_0x169d('0x1e')]())[_0x169d('0x1a')](realtime['initTrunks']())[_0x169d('0x1a')](voiceQueue[_0x169d('0x1f')]())[_0x169d('0x1a')](realtime[_0x169d('0x20')]())[_0x169d('0x1a')](trigger[_0x169d('0x21')]())[_0x169d('0x1a')](realtime[_0x169d('0x22')]())[_0x169d('0x1a')](template['getTemplates']())[_0x169d('0x1a')](realtime[_0x169d('0x23')]())[_0x169d('0x1a')](zendesk[_0x169d('0x24')]())[_0x169d('0x1a')](realtime['initZendeskAccounts']())[_0x169d('0x1a')](salesforce[_0x169d('0x25')]())[_0x169d('0x1a')](realtime['initSalesforceAccounts']())[_0x169d('0x1a')](sugarcrm[_0x169d('0x26')]())[_0x169d('0x1a')](realtime['initSugarcrmAccounts']())['then'](freshdesk['getFreshdeskAccounts']())[_0x169d('0x1a')](realtime[_0x169d('0x27')]())[_0x169d('0x1a')](desk['getDeskAccounts']())[_0x169d('0x1a')](realtime[_0x169d('0x28')]())['then'](zoho[_0x169d('0x29')]())[_0x169d('0x1a')](realtime[_0x169d('0x2a')]())[_0x169d('0x1a')](vtiger[_0x169d('0x2b')]())[_0x169d('0x1a')](realtime[_0x169d('0x2c')]())[_0x169d('0x1a')](freshsales[_0x169d('0x2d')]())[_0x169d('0x1a')](realtime['initFreshsalesAccounts']())[_0x169d('0x1a')](servicenow[_0x169d('0x2e')]())['then'](realtime['initServicenowAccounts']())[_0x169d('0x1a')](dynamics365[_0x169d('0x2f')]())[_0x169d('0x1a')](realtime[_0x169d('0x30')]())[_0x169d('0x1a')](campaign[_0x169d('0x31')]())['then'](realtime[_0x169d('0x32')]())[_0x169d('0x1a')](voiceExtension[_0x169d('0x33')]())[_0x169d('0x1a')](realtime[_0x169d('0x34')]())['then'](faxAccount[_0x169d('0x35')]())[_0x169d('0x1a')](realtime[_0x169d('0x36')]())[_0x169d('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x169d('0x19')]()[_0x169d('0x1a')](voiceQueueReport[_0x169d('0x37')]())['then'](realtime[_0x169d('0x38')]())[_0x169d('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x169d('0x1a')](realtime[_0x169d('0x39')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x169d('0x1a')](realtime[_0x169d('0x3a')]())[_0x169d('0x1a')](voiceCallReport[_0x169d('0x3b')]())[_0x169d('0x1a')](realtime[_0x169d('0x3c')]())['catch'](function(_0x4a7968){logger[_0x169d('0x3d')](_0x169d('0x3e'),util['inspect'](_0x4a7968,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x169d('0x1a')](function(_0x444a18){return initRealtime();})['then'](function(){return initParams();})[_0x169d('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x169d('0x3f')](function(_0x149cef){logger[_0x169d('0x3d')](_0x169d('0x40'),util[_0x169d('0x41')](_0x149cef,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x4d5d=['initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','[index.js][main]','bluebird','util','moment','./server','./realtime','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory'];(function(_0x3ffe3f,_0x464d70){var _0x130c0b=function(_0x4d137e){while(--_0x4d137e){_0x3ffe3f['push'](_0x3ffe3f['shift']());}};_0x130c0b(++_0x464d70);}(_0x4d5d,0x111));var _0xd4d5=function(_0xea17a7,_0x3f7d93){_0xea17a7=_0xea17a7-0x0;var _0x247ed5=_0x4d5d[_0xea17a7];return _0x247ed5;};'use strict';var BPromise=require(_0xd4d5('0x0'));var util=require(_0xd4d5('0x1'));var moment=require(_0xd4d5('0x2'));var server=require(_0xd4d5('0x3'));var Realtime=require(_0xd4d5('0x4'));var Report=require('./report');var Acw=require(_0xd4d5('0x5'));var Trigger=require(_0xd4d5('0x6'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0xd4d5('0x7'));var user=require(_0xd4d5('0x8'));var voiceQueue=require(_0xd4d5('0x9'));var voiceQueueReport=require(_0xd4d5('0xa'));var voiceCallReport=require(_0xd4d5('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0xd4d5('0xc'));var cmHopperHistory=require(_0xd4d5('0xd'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xd4d5('0xe'));var faxAccount=require(_0xd4d5('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xd4d5('0x10'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xd4d5('0x11'));var zoho=require(_0xd4d5('0x12'));var vtiger=require(_0xd4d5('0x13'));var freshsales=require(_0xd4d5('0x14'));var servicenow=require(_0xd4d5('0x15'));var dynamics365=require(_0xd4d5('0x16'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0xd4d5('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xd4d5('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xd4d5('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xd4d5('0x19')]()[_0xd4d5('0x1a')](user[_0xd4d5('0x1b')]())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x1c')]())['then'](user[_0xd4d5('0x1d')]())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x1e')]())[_0xd4d5('0x1a')](trunk[_0xd4d5('0x1f')]())[_0xd4d5('0x1a')](realtime['initTrunks']())[_0xd4d5('0x1a')](voiceQueue[_0xd4d5('0x20')]())[_0xd4d5('0x1a')](realtime['initVoiceQueues']())[_0xd4d5('0x1a')](trigger['getTriggers']())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x21')]())[_0xd4d5('0x1a')](template[_0xd4d5('0x22')]())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x23')]())[_0xd4d5('0x1a')](zendesk['getZendeskAccounts']())['then'](realtime[_0xd4d5('0x24')]())[_0xd4d5('0x1a')](salesforce[_0xd4d5('0x25')]())[_0xd4d5('0x1a')](realtime['initSalesforceAccounts']())[_0xd4d5('0x1a')](sugarcrm[_0xd4d5('0x26')]())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x27')]())[_0xd4d5('0x1a')](freshdesk[_0xd4d5('0x28')]())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x29')]())[_0xd4d5('0x1a')](desk['getDeskAccounts']())['then'](realtime[_0xd4d5('0x2a')]())[_0xd4d5('0x1a')](zoho[_0xd4d5('0x2b')]())['then'](realtime[_0xd4d5('0x2c')]())[_0xd4d5('0x1a')](vtiger[_0xd4d5('0x2d')]())['then'](realtime[_0xd4d5('0x2e')]())[_0xd4d5('0x1a')](freshsales[_0xd4d5('0x2f')]())[_0xd4d5('0x1a')](realtime['initFreshsalesAccounts']())[_0xd4d5('0x1a')](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())[_0xd4d5('0x1a')](dynamics365[_0xd4d5('0x30')]())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x31')]())[_0xd4d5('0x1a')](campaign[_0xd4d5('0x32')]())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x33')]())[_0xd4d5('0x1a')](voiceExtension['getVoiceExtensions']())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x34')]())[_0xd4d5('0x1a')](faxAccount[_0xd4d5('0x35')]())['then'](realtime[_0xd4d5('0x36')]())[_0xd4d5('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0xd4d5('0x19')]()['then'](voiceQueueReport[_0xd4d5('0x37')]())[_0xd4d5('0x1a')](realtime['initVoiceQueueReports']())[_0xd4d5('0x1a')](cmHopperHistory[_0xd4d5('0x38')]())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x39')]())[_0xd4d5('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x3a')]())[_0xd4d5('0x1a')](voiceCallReport['getVoiceCallReports']())[_0xd4d5('0x1a')](realtime[_0xd4d5('0x3b')]())[_0xd4d5('0x3c')](function(_0x1077ac){logger[_0xd4d5('0x3d')](_0xd4d5('0x3e'),util[_0xd4d5('0x3f')](_0x1077ac,{'showHidden':![],'depth':null}));});}function main(){return server[_0xd4d5('0x40')](realtime,preview,fax)[_0xd4d5('0x1a')](function(_0x50782b){return initRealtime();})[_0xd4d5('0x1a')](function(){return initParams();})[_0xd4d5('0x1a')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x528731){logger[_0xd4d5('0x3d')](_0xd4d5('0x41'),util['inspect'](_0x528731,{'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 7719a7a..1c7082f 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 _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xedd9,0xfc));var _0x9edd=function(_0x61c029,_0x1d02eb){_0x61c029=_0x61c029-0x0;var _0x3f4074=_0xedd9[_0x61c029];return _0x3f4074;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index ec96fa6..9be9711 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 _0xd297=['dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x33ae52,_0x56b011){var _0x7fa8d5=function(_0x59f2d4){while(--_0x59f2d4){_0x33ae52['push'](_0x33ae52['shift']());}};_0x7fa8d5(++_0x56b011);}(_0xd297,0x166));var _0x7d29=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd297[_0x27af45];return _0x18df21;};'use strict';function Campaign(_0x547da4){this['id']=_0x547da4['id']||0x0;this[_0x7d29('0x0')]=_0x547da4[_0x7d29('0x0')]||'';this[_0x7d29('0x1')]=_0x547da4[_0x7d29('0x1')]||_0x7d29('0x2');this['originated']=0x0;this[_0x7d29('0x3')]=0x0;this[_0x7d29('0x4')]=0x0;this[_0x7d29('0x5')]=0x0;this[_0x7d29('0x6')]='';this[_0x7d29('0x7')]=!![];this[_0x7d29('0x8')]=_0x547da4['active'];this[_0x7d29('0x9')]=_0x547da4[_0x7d29('0x9')];this[_0x7d29('0xa')]=_0x547da4['dialTimezone']||null;this['dialGlobalInterval']=_0x547da4[_0x7d29('0xb')]?_0x547da4[_0x7d29('0xb')]:null;this['dialOriginateCallerIdName']=_0x547da4[_0x7d29('0xc')];this[_0x7d29('0xd')]=_0x547da4[_0x7d29('0xd')];this['dialOriginateTimeout']=_0x547da4[_0x7d29('0xe')]||0x1e;this[_0x7d29('0xf')]=_0x547da4[_0x7d29('0xf')];this[_0x7d29('0x10')]=_0x547da4[_0x7d29('0x10')];this[_0x7d29('0x11')]=_0x547da4[_0x7d29('0x11')];this[_0x7d29('0x12')]=_0x547da4[_0x7d29('0x12')];this[_0x7d29('0x13')]=_0x547da4[_0x7d29('0x13')];this[_0x7d29('0x14')]=_0x547da4[_0x7d29('0x14')];this['dialGlobalMaxRetry']=_0x547da4[_0x7d29('0x15')];this['dialNoSuchNumberMaxRetry']=_0x547da4[_0x7d29('0x16')]||0x3;this[_0x7d29('0x17')]=_0x547da4['dialNoSuchNumberRetryFrequency']||0x96;this[_0x7d29('0x18')]=_0x547da4[_0x7d29('0x18')]||0x3;this[_0x7d29('0x19')]=_0x547da4[_0x7d29('0x19')]||0x96;this[_0x7d29('0x1a')]=_0x547da4[_0x7d29('0x1a')]||0x3;this[_0x7d29('0x1b')]=_0x547da4[_0x7d29('0x1b')]||0x96;this[_0x7d29('0x1c')]=_0x547da4[_0x7d29('0x1c')]||0x3;this[_0x7d29('0x1d')]=_0x547da4[_0x7d29('0x1d')]||0x96;this[_0x7d29('0x1e')]=_0x547da4['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x547da4[_0x7d29('0x1f')]||0x96;this['dialOrderByScheduledAt']=_0x547da4['dialOrderByScheduledAt']||_0x7d29('0x20');this[_0x7d29('0x21')]=_0x547da4[_0x7d29('0x21')]||undefined;this[_0x7d29('0x22')]=_0x547da4[_0x7d29('0x22')]||undefined;this['dialCutDigit']=_0x547da4[_0x7d29('0x23')]||undefined;this[_0x7d29('0x24')]=_0x547da4[_0x7d29('0x24')]?_0x547da4[_0x7d29('0x24')]:undefined;this[_0x7d29('0x25')]=_0x547da4[_0x7d29('0x25')]?_0x547da4[_0x7d29('0x25')]:undefined;this['Interval']=_0x547da4[_0x7d29('0x26')]?_0x547da4['Interval']:undefined;this['SquareProject']=_0x547da4['SquareProject']?_0x547da4['SquareProject']:undefined;this['dialQueueProject']=_0x547da4[_0x7d29('0x27')]?_0x547da4[_0x7d29('0x27')][_0x7d29('0x0')]:undefined;this[_0x7d29('0x28')]=_0x547da4[_0x7d29('0x28')]||![];this[_0x7d29('0x29')]=_0x547da4[_0x7d29('0x29')];this[_0x7d29('0x2a')]=_0x547da4[_0x7d29('0x2a')];this['dialAMDAfterGreetingSilence']=_0x547da4['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x547da4[_0x7d29('0x2b')];this['dialAMDMinWordLength']=_0x547da4[_0x7d29('0x2c')];this['dialAMDBetweenWordsSilence']=_0x547da4[_0x7d29('0x2d')];this[_0x7d29('0x2e')]=_0x547da4[_0x7d29('0x2e')];this['dialAMDSilenceThreshold']=_0x547da4[_0x7d29('0x2f')];this[_0x7d29('0x30')]=_0x547da4[_0x7d29('0x30')];}module[_0x7d29('0x31')]=Campaign; \ No newline at end of file +var _0x1e40=['temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated'];(function(_0xeec6fd,_0x3011ec){var _0x347c16=function(_0x5cc534){while(--_0x5cc534){_0xeec6fd['push'](_0xeec6fd['shift']());}};_0x347c16(++_0x3011ec);}(_0x1e40,0xbd));var _0x01e4=function(_0x46f592,_0x2539cb){_0x46f592=_0x46f592-0x0;var _0x35f94c=_0x1e40[_0x46f592];return _0x35f94c;};'use strict';function Campaign(_0x29b64e){this['id']=_0x29b64e['id']||0x0;this['name']=_0x29b64e['name']||'';this[_0x01e4('0x0')]=_0x29b64e['type']||_0x01e4('0x1');this[_0x01e4('0x2')]=0x0;this[_0x01e4('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x01e4('0x4')]=0x0;this[_0x01e4('0x5')]='';this[_0x01e4('0x6')]=!![];this['active']=_0x29b64e[_0x01e4('0x7')];this['limitCalls']=_0x29b64e[_0x01e4('0x8')];this[_0x01e4('0x9')]=_0x29b64e['dialTimezone']||null;this[_0x01e4('0xa')]=_0x29b64e['dialGlobalInterval']?_0x29b64e['dialGlobalInterval']:null;this[_0x01e4('0xb')]=_0x29b64e[_0x01e4('0xb')];this[_0x01e4('0xc')]=_0x29b64e[_0x01e4('0xc')];this[_0x01e4('0xd')]=_0x29b64e[_0x01e4('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x29b64e[_0x01e4('0xe')];this[_0x01e4('0xf')]=_0x29b64e[_0x01e4('0xf')];this[_0x01e4('0x10')]=_0x29b64e[_0x01e4('0x10')];this[_0x01e4('0x11')]=_0x29b64e[_0x01e4('0x11')];this['dialNoAnswerMaxRetry']=_0x29b64e['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x29b64e[_0x01e4('0x12')];this[_0x01e4('0x13')]=_0x29b64e[_0x01e4('0x13')];this['dialNoSuchNumberMaxRetry']=_0x29b64e[_0x01e4('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x29b64e['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x29b64e['dialDropMaxRetry']||0x3;this[_0x01e4('0x15')]=_0x29b64e[_0x01e4('0x15')]||0x96;this['dialAbandonedMaxRetry']=_0x29b64e[_0x01e4('0x16')]||0x3;this[_0x01e4('0x17')]=_0x29b64e[_0x01e4('0x17')]||0x96;this['dialMachineMaxRetry']=_0x29b64e[_0x01e4('0x18')]||0x3;this['dialMachineRetryFrequency']=_0x29b64e[_0x01e4('0x19')]||0x96;this[_0x01e4('0x1a')]=_0x29b64e[_0x01e4('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x29b64e[_0x01e4('0x1b')]||0x96;this[_0x01e4('0x1c')]=_0x29b64e['dialOrderByScheduledAt']||'DESC';this[_0x01e4('0x1d')]=_0x29b64e[_0x01e4('0x1d')]||undefined;this[_0x01e4('0x1e')]=_0x29b64e[_0x01e4('0x1e')]||undefined;this[_0x01e4('0x1f')]=_0x29b64e['dialCutDigit']||undefined;this[_0x01e4('0x20')]=_0x29b64e[_0x01e4('0x20')]?_0x29b64e['TrunkBackup']:undefined;this[_0x01e4('0x21')]=_0x29b64e['Trunk']?_0x29b64e[_0x01e4('0x21')]:undefined;this[_0x01e4('0x22')]=_0x29b64e[_0x01e4('0x22')]?_0x29b64e['Interval']:undefined;this[_0x01e4('0x23')]=_0x29b64e[_0x01e4('0x23')]?_0x29b64e[_0x01e4('0x23')]:undefined;this[_0x01e4('0x24')]=_0x29b64e[_0x01e4('0x23')]?_0x29b64e[_0x01e4('0x23')]['name']:undefined;this[_0x01e4('0x25')]=_0x29b64e['dialAMDActive']||![];this[_0x01e4('0x26')]=_0x29b64e[_0x01e4('0x26')];this['dialAMDGreeting']=_0x29b64e[_0x01e4('0x27')];this[_0x01e4('0x28')]=_0x29b64e[_0x01e4('0x28')];this['dialAMDTotalAnalysisTime']=_0x29b64e[_0x01e4('0x29')];this[_0x01e4('0x2a')]=_0x29b64e['dialAMDMinWordLength'];this[_0x01e4('0x2b')]=_0x29b64e[_0x01e4('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x29b64e[_0x01e4('0x2c')];this[_0x01e4('0x2d')]=_0x29b64e[_0x01e4('0x2d')];this[_0x01e4('0x2e')]=_0x29b64e[_0x01e4('0x2e')];}module[_0x01e4('0x2f')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index a480eaf..8fc3c37 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 _0x36e0=['unmanaged','abandoned','duration','billableseconds','holdtime','type','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','starttime','channel','calleridnum','calleridname','connectedlinenum','accountcode','context','linkedid','exten','answered','answertime','endtime'];(function(_0x54a720,_0xd2abf8){var _0x219688=function(_0x2e8b8a){while(--_0x2e8b8a){_0x54a720['push'](_0x54a720['shift']());}};_0x219688(++_0xd2abf8);}(_0x36e0,0x15c));var _0x036e=function(_0xa36030,_0x1667ba){_0xa36030=_0xa36030-0x0;var _0x5154d2=_0x36e0[_0xa36030];return _0x5154d2;};'use strict';function Channel(){this[_0x036e('0x0')]=null;this[_0x036e('0x1')]='';this['destinationchannel']='';this[_0x036e('0x2')]=0x0;this[_0x036e('0x3')]='';this[_0x036e('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x036e('0x5')]=0x0;this[_0x036e('0x6')]='';this['uniqueid']=0x0;this[_0x036e('0x7')]=0x0;this[_0x036e('0x8')]=0x0;this[_0x036e('0x9')]=![];this[_0x036e('0xa')]=null;this[_0x036e('0xb')]=null;this[_0x036e('0xc')]=![];this[_0x036e('0xd')]=![];this['lastapplication']='';this['lastdata']='';this[_0x036e('0xe')]=0x0;this[_0x036e('0xf')]=0x0;this[_0x036e('0x10')]=0x0;this[_0x036e('0x11')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0x036e('0x12')]=null;this[_0x036e('0x13')]=null;this[_0x036e('0x14')]=[];this[_0x036e('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x036e('0x16')]=undefined;this[_0x036e('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xcbde=['answertime','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag','monitor','monitors','transferconnectedlinenum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','uniqueid','linkedid','answered'];(function(_0x4a0d15,_0x13f341){var _0x1a6a40=function(_0x20986d){while(--_0x20986d){_0x4a0d15['push'](_0x4a0d15['shift']());}};_0x1a6a40(++_0x13f341);}(_0xcbde,0x141));var _0xecbd=function(_0x547329,_0x91e36a){_0x547329=_0x547329-0x0;var _0x1b4501=_0xcbde[_0x547329];return _0x1b4501;};'use strict';function Channel(){this[_0xecbd('0x0')]=null;this['channel']='';this[_0xecbd('0x1')]='';this[_0xecbd('0x2')]=0x0;this[_0xecbd('0x3')]='';this[_0xecbd('0x4')]=undefined;this[_0xecbd('0x5')]=undefined;this['accountcode']=0x0;this['context']='';this[_0xecbd('0x6')]=0x0;this[_0xecbd('0x7')]=0x0;this['exten']=0x0;this[_0xecbd('0x8')]=![];this[_0xecbd('0x9')]=null;this['endtime']=null;this['unmanaged']=![];this[_0xecbd('0xa')]=![];this[_0xecbd('0xb')]='';this[_0xecbd('0xc')]='';this[_0xecbd('0xd')]=0x0;this[_0xecbd('0xe')]=0x0;this[_0xecbd('0xf')]=0x0;this['type']=null;this[_0xecbd('0x10')]=null;this['disposition']=null;this[_0xecbd('0x11')]=![];this['monitorFilename']=null;this['queue']=null;this[_0xecbd('0x12')]=[];this['transfercalleridnum']=undefined;this[_0xecbd('0x13')]=undefined;this[_0xecbd('0x14')]=undefined;this['mohtime']=0x0;}module[_0xecbd('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 1b1a048..3cf3060 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 _0xb5ef=['tokenSecret','type','serverUrl','Configurations','exports','username','remoteUri','authType','password','consumerSecret','token'];(function(_0x3b3336,_0x37a51b){var _0x7aad22=function(_0x19335e){while(--_0x19335e){_0x3b3336['push'](_0x3b3336['shift']());}};_0x7aad22(++_0x37a51b);}(_0xb5ef,0x1d3));var _0xfb5e=function(_0x159d0b,_0x15fd0a){_0x159d0b=_0x159d0b-0x0;var _0x10f29a=_0xb5ef[_0x159d0b];return _0x10f29a;};'use strict';function DeskAccount(_0x39bb14){this['id']=_0x39bb14['id']||0x0;this['name']=_0x39bb14['name']||'';this[_0xfb5e('0x0')]=_0x39bb14[_0xfb5e('0x0')]||'';this[_0xfb5e('0x1')]=_0x39bb14['remoteUri']||'';this[_0xfb5e('0x2')]=_0x39bb14[_0xfb5e('0x2')]||'';this[_0xfb5e('0x3')]=_0x39bb14[_0xfb5e('0x3')]||'';this['consumerKey']=_0x39bb14['consumerKey']||'';this[_0xfb5e('0x4')]=_0x39bb14['consumerSecret']||'';this[_0xfb5e('0x5')]=_0x39bb14[_0xfb5e('0x5')]||'';this['tokenSecret']=_0x39bb14[_0xfb5e('0x6')]||'';this[_0xfb5e('0x7')]=_0x39bb14[_0xfb5e('0x7')]||'';this[_0xfb5e('0x8')]=_0x39bb14[_0xfb5e('0x8')]||'';this[_0xfb5e('0x9')]=_0x39bb14['Configurations']||{};}module[_0xfb5e('0xa')]=DeskAccount; \ No newline at end of file +var _0xa2eb=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa2eb,0x1de));var _0xba2e=function(_0x1b4057,_0x58212a){_0x1b4057=_0x1b4057-0x0;var _0x1d749a=_0xa2eb[_0x1b4057];return _0x1d749a;};'use strict';function DeskAccount(_0x40134a){this['id']=_0x40134a['id']||0x0;this[_0xba2e('0x0')]=_0x40134a[_0xba2e('0x0')]||'';this['username']=_0x40134a[_0xba2e('0x1')]||'';this[_0xba2e('0x2')]=_0x40134a[_0xba2e('0x2')]||'';this[_0xba2e('0x3')]=_0x40134a[_0xba2e('0x3')]||'';this[_0xba2e('0x4')]=_0x40134a[_0xba2e('0x4')]||'';this[_0xba2e('0x5')]=_0x40134a[_0xba2e('0x5')]||'';this[_0xba2e('0x6')]=_0x40134a[_0xba2e('0x6')]||'';this[_0xba2e('0x7')]=_0x40134a[_0xba2e('0x7')]||'';this[_0xba2e('0x8')]=_0x40134a[_0xba2e('0x8')]||'';this[_0xba2e('0x9')]=_0x40134a[_0xba2e('0x9')]||'';this[_0xba2e('0xa')]=_0x40134a[_0xba2e('0xa')]||'';this[_0xba2e('0xb')]=_0x40134a[_0xba2e('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 e4699ec..f5b3970 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 _0x31df=['clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri','tenantId'];(function(_0x48c1a3,_0x2e4306){var _0x300b54=function(_0xc29931){while(--_0xc29931){_0x48c1a3['push'](_0x48c1a3['shift']());}};_0x300b54(++_0x2e4306);}(_0x31df,0x187));var _0xf31d=function(_0x4df2c4,_0x4ee5e8){_0x4df2c4=_0x4df2c4-0x0;var _0x4ddd49=_0x31df[_0x4df2c4];return _0x4ddd49;};'use strict';function Dynamics365Account(_0xf49ba9){this['id']=_0xf49ba9['id']||0x0;this['name']=_0xf49ba9[_0xf31d('0x0')]||'';this[_0xf31d('0x1')]=_0xf49ba9[_0xf31d('0x1')]||'';this['password']=_0xf49ba9[_0xf31d('0x2')]||'';this[_0xf31d('0x3')]=_0xf49ba9[_0xf31d('0x3')]||'';this[_0xf31d('0x4')]=_0xf49ba9[_0xf31d('0x4')]||'';this[_0xf31d('0x5')]=_0xf49ba9[_0xf31d('0x5')]||'';this[_0xf31d('0x6')]=_0xf49ba9[_0xf31d('0x6')]||{};this[_0xf31d('0x7')]=_0xf49ba9['serverUrl']||'';this['modernAuthentication']=_0xf49ba9[_0xf31d('0x8')]||![];this[_0xf31d('0x9')]=_0xf49ba9['Configurations']||{};this['CloudProvider']=_0xf49ba9[_0xf31d('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x25a6=['name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x5f364e,_0x31bc7e){var _0x5c6b2c=function(_0x1188e6){while(--_0x1188e6){_0x5f364e['push'](_0x5f364e['shift']());}};_0x5c6b2c(++_0x31bc7e);}(_0x25a6,0x1c3));var _0x625a=function(_0xbace18,_0x37e865){_0xbace18=_0xbace18-0x0;var _0x5dcc68=_0x25a6[_0xbace18];return _0x5dcc68;};'use strict';function Dynamics365Account(_0x2a60f9){this['id']=_0x2a60f9['id']||0x0;this[_0x625a('0x0')]=_0x2a60f9[_0x625a('0x0')]||'';this['username']=_0x2a60f9['username']||'';this[_0x625a('0x1')]=_0x2a60f9[_0x625a('0x1')]||'';this['remoteUri']=_0x2a60f9[_0x625a('0x2')]||'';this[_0x625a('0x3')]=_0x2a60f9[_0x625a('0x3')]||'';this['clientId']=_0x2a60f9[_0x625a('0x4')]||'';this[_0x625a('0x5')]=_0x2a60f9[_0x625a('0x5')]||{};this[_0x625a('0x6')]=_0x2a60f9['serverUrl']||'';this[_0x625a('0x7')]=_0x2a60f9[_0x625a('0x7')]||![];this['Configurations']=_0x2a60f9[_0x625a('0x8')]||{};this['CloudProvider']=_0x2a60f9[_0x625a('0x9')]||{};}module[_0x625a('0xa')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 2a91f4d..eb1dbba 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 _0xba91=['t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x73aef5,_0x5b2293){var _0x29be73=function(_0x1c9129){while(--_0x1c9129){_0x73aef5['push'](_0x73aef5['shift']());}};_0x29be73(++_0x5b2293);}(_0xba91,0xf4));var _0x1ba9=function(_0x38a621,_0x404690){_0x38a621=_0x38a621-0x0;var _0x571b6f=_0xba91[_0x38a621];return _0x571b6f;};'use strict';function FaxAccount(_0x49ec81){this['id']=_0x49ec81['id']||0x0;this[_0x1ba9('0x0')]=_0x49ec81[_0x1ba9('0x0')]||'';this[_0x1ba9('0x1')]=_0x49ec81['description'];this[_0x1ba9('0x2')]=_0x49ec81[_0x1ba9('0x2')];this[_0x1ba9('0x3')]=_0x49ec81[_0x1ba9('0x3')];this[_0x1ba9('0x4')]=_0x49ec81['localstationid'];this[_0x1ba9('0x5')]=_0x49ec81[_0x1ba9('0x5')]||0x960;this[_0x1ba9('0x6')]=_0x49ec81['maxrate']||0x3840;this['modem']=_0x49ec81[_0x1ba9('0x7')]||_0x1ba9('0x8');this['gateway']=_0x49ec81[_0x1ba9('0x9')]||'no';this['faxdetect']=_0x49ec81[_0x1ba9('0xa')]||'no';this[_0x1ba9('0xb')]=_0x49ec81[_0x1ba9('0xb')]||0x1388;this[_0x1ba9('0xc')]=_0x49ec81['tech']||'SIP';this[_0x1ba9('0xd')]=_0x49ec81['Trunk']?_0x49ec81['Trunk']:undefined;this['ListId']=_0x49ec81[_0x1ba9('0xe')];this[_0x1ba9('0xf')]=_0x49ec81[_0x1ba9('0xf')];}module[_0x1ba9('0x10')]=FaxAccount; \ No newline at end of file +var _0x1f3c=['SIP','Trunk','ListId','key','exports','name','description','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x2a95ac,_0x39462b){var _0x34595b=function(_0x270080){while(--_0x270080){_0x2a95ac['push'](_0x2a95ac['shift']());}};_0x34595b(++_0x39462b);}(_0x1f3c,0xd7));var _0xc1f3=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x1f3c[_0x376b45];return _0x2341b3;};'use strict';function FaxAccount(_0x5a574b){this['id']=_0x5a574b['id']||0x0;this[_0xc1f3('0x0')]=_0x5a574b[_0xc1f3('0x0')]||'';this[_0xc1f3('0x1')]=_0x5a574b[_0xc1f3('0x1')];this['ecm']=_0x5a574b['ecm'];this['headerinfo']=_0x5a574b['headerinfo'];this['localstationid']=_0x5a574b['localstationid'];this[_0xc1f3('0x2')]=_0x5a574b['minrate']||0x960;this[_0xc1f3('0x3')]=_0x5a574b[_0xc1f3('0x3')]||0x3840;this['modem']=_0x5a574b[_0xc1f3('0x4')]||_0xc1f3('0x5');this['gateway']=_0x5a574b[_0xc1f3('0x6')]||'no';this[_0xc1f3('0x7')]=_0x5a574b[_0xc1f3('0x7')]||'no';this[_0xc1f3('0x8')]=_0x5a574b[_0xc1f3('0x8')]||0x1388;this[_0xc1f3('0x9')]=_0x5a574b[_0xc1f3('0x9')]||_0xc1f3('0xa');this[_0xc1f3('0xb')]=_0x5a574b[_0xc1f3('0xb')]?_0x5a574b[_0xc1f3('0xb')]:undefined;this[_0xc1f3('0xc')]=_0x5a574b['ListId'];this[_0xc1f3('0xd')]=_0x5a574b['key'];}module[_0xc1f3('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 5d91e86..2955bac 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 _0xf2ad=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x1bbe2f,_0x69592c){var _0xeed326=function(_0x378ac3){while(--_0x378ac3){_0x1bbe2f['push'](_0x1bbe2f['shift']());}};_0xeed326(++_0x69592c);}(_0xf2ad,0x197));var _0xdf2a=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0xf2ad[_0x12ddb2];return _0x10b6dd;};'use strict';function FreshdeskAccount(_0x552b9c){this['id']=_0x552b9c['id']||0x0;this['name']=_0x552b9c[_0xdf2a('0x0')]||'';this[_0xdf2a('0x1')]=_0x552b9c[_0xdf2a('0x1')]||'';this[_0xdf2a('0x2')]=_0x552b9c['token']||'';this[_0xdf2a('0x3')]=_0x552b9c[_0xdf2a('0x3')]||'';this[_0xdf2a('0x4')]=_0x552b9c[_0xdf2a('0x4')]||'';this[_0xdf2a('0x5')]=_0x552b9c[_0xdf2a('0x5')]||{};}module[_0xdf2a('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xbb94=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x583b31,_0x3ee6da){var _0xc121a8=function(_0x99cab1){while(--_0x99cab1){_0x583b31['push'](_0x583b31['shift']());}};_0xc121a8(++_0x3ee6da);}(_0xbb94,0x1d1));var _0x4bb9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbb94[_0x3b380d];return _0x54502b;};'use strict';function FreshdeskAccount(_0x18f09c){this['id']=_0x18f09c['id']||0x0;this['name']=_0x18f09c[_0x4bb9('0x0')]||'';this[_0x4bb9('0x1')]=_0x18f09c['username']||'';this[_0x4bb9('0x2')]=_0x18f09c[_0x4bb9('0x3')]||'';this['remoteUri']=_0x18f09c[_0x4bb9('0x4')]||'';this['serverUrl']=_0x18f09c[_0x4bb9('0x5')]||'';this[_0x4bb9('0x6')]=_0x18f09c['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 8df2c89..8655e44 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 _0x2e65=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x2e65,0x193));var _0x52e6=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0x2e65[_0x2d364e];return _0x1b9312;};'use strict';function FreshsalesAccount(_0x5361f6){this['id']=_0x5361f6['id']||0x0;this[_0x52e6('0x0')]=_0x5361f6[_0x52e6('0x0')]||'';this[_0x52e6('0x1')]=_0x5361f6[_0x52e6('0x1')]||'';this[_0x52e6('0x2')]=_0x5361f6[_0x52e6('0x3')]||'';this[_0x52e6('0x4')]=_0x5361f6['remoteUri']||'';this[_0x52e6('0x5')]=_0x5361f6[_0x52e6('0x5')]||'';this[_0x52e6('0x6')]=_0x5361f6[_0x52e6('0x6')]||{};}module[_0x52e6('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x3d6d=['token','remoteUri','serverUrl','exports','name','username','apiKey'];(function(_0x4e7a80,_0x19c088){var _0x5e710b=function(_0x2a5b82){while(--_0x2a5b82){_0x4e7a80['push'](_0x4e7a80['shift']());}};_0x5e710b(++_0x19c088);}(_0x3d6d,0xb3));var _0xd3d6=function(_0x4ca3b4,_0x2450bc){_0x4ca3b4=_0x4ca3b4-0x0;var _0x51ea64=_0x3d6d[_0x4ca3b4];return _0x51ea64;};'use strict';function FreshsalesAccount(_0x249683){this['id']=_0x249683['id']||0x0;this[_0xd3d6('0x0')]=_0x249683[_0xd3d6('0x0')]||'';this[_0xd3d6('0x1')]=_0x249683[_0xd3d6('0x1')]||'';this[_0xd3d6('0x2')]=_0x249683[_0xd3d6('0x3')]||'';this[_0xd3d6('0x4')]=_0x249683[_0xd3d6('0x4')]||'';this[_0xd3d6('0x5')]=_0x249683[_0xd3d6('0x5')]||'';this['Configurations']=_0x249683['Configurations']||{};}module[_0xd3d6('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 61acc43..357d192 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 _0xce28=['holdtime','lastAssignedTo','motionChannel','voice','mohtime','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority'];(function(_0x2bbc07,_0x1e2168){var _0x6879e4=function(_0x290fa1){while(--_0x290fa1){_0x2bbc07['push'](_0x2bbc07['shift']());}};_0x6879e4(++_0x1e2168);}(_0xce28,0xc3));var _0x8ce2=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xce28[_0x1c8c28];return _0x1f59b4;};'use strict';function QueueReport(){this[_0x8ce2('0x0')]=_0x8ce2('0x1');this[_0x8ce2('0x2')]='';this[_0x8ce2('0x3')]='';this[_0x8ce2('0x4')]='';this[_0x8ce2('0x5')]='';this['queuecallerjoinAt']=null;this[_0x8ce2('0x6')]=null;this[_0x8ce2('0x7')]=0x1;this[_0x8ce2('0x8')]=0x1;this['queuecallerabandon']=![];this[_0x8ce2('0x9')]=null;this[_0x8ce2('0xa')]=![];this[_0x8ce2('0xb')]=null;this[_0x8ce2('0xc')]=![];this[_0x8ce2('0xd')]=null;this['originalposition']=0x1;this[_0x8ce2('0xe')]='';this[_0x8ce2('0xf')]='';this[_0x8ce2('0x10')]='';this[_0x8ce2('0x11')]='';this[_0x8ce2('0x12')]='';this[_0x8ce2('0x13')]='';this[_0x8ce2('0x14')]='';this[_0x8ce2('0x15')]=0x0;this['assigned']=![];this[_0x8ce2('0x16')]='';this[_0x8ce2('0x17')]=_0x8ce2('0x18');this[_0x8ce2('0x19')]=0x0;this['variables']={};}module[_0x8ce2('0x1a')]=QueueReport; \ No newline at end of file +var _0xbd0c=['exten','priority','holdtime','assigned','motionChannel','voice','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','accountcode'];(function(_0x507887,_0x1f857b){var _0x5785c9=function(_0x420137){while(--_0x420137){_0x507887['push'](_0x507887['shift']());}};_0x5785c9(++_0x1f857b);}(_0xbd0c,0xf7));var _0xcbd0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbd0c[_0x6c993a];return _0x27f547;};'use strict';function QueueReport(){this[_0xcbd0('0x0')]=_0xcbd0('0x1');this[_0xcbd0('0x2')]='';this[_0xcbd0('0x3')]='';this[_0xcbd0('0x4')]='';this[_0xcbd0('0x5')]='';this[_0xcbd0('0x6')]=null;this[_0xcbd0('0x7')]=null;this[_0xcbd0('0x8')]=0x1;this[_0xcbd0('0x9')]=0x1;this['queuecallerabandon']=![];this[_0xcbd0('0xa')]=null;this['queuecallercomplete']=![];this[_0xcbd0('0xb')]=null;this[_0xcbd0('0xc')]=![];this[_0xcbd0('0xd')]=null;this['originalposition']=0x1;this[_0xcbd0('0xe')]='';this[_0xcbd0('0xf')]='';this['connectedlinename']='';this[_0xcbd0('0x10')]='';this['context']='';this[_0xcbd0('0x11')]='';this[_0xcbd0('0x12')]='';this[_0xcbd0('0x13')]=0x0;this[_0xcbd0('0x14')]=![];this['lastAssignedTo']='';this[_0xcbd0('0x15')]=_0xcbd0('0x16');this['mohtime']=0x0;this[_0xcbd0('0x17')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index c891e7c..38241ce 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 _0xc8d7=['integrationTab','serverUrl','Configurations','exports','name','remoteUri','password','clientId','clientSecret','securityToken','type'];(function(_0x373aea,_0xc86cfa){var _0x63a133=function(_0x58a1d8){while(--_0x58a1d8){_0x373aea['push'](_0x373aea['shift']());}};_0x63a133(++_0xc86cfa);}(_0xc8d7,0x122));var _0x7c8d=function(_0x57c428,_0xcd46f3){_0x57c428=_0x57c428-0x0;var _0x5b8332=_0xc8d7[_0x57c428];return _0x5b8332;};'use strict';function SalesforceAccount(_0x2eec01){this['id']=_0x2eec01['id']||0x0;this['name']=_0x2eec01[_0x7c8d('0x0')]||'';this['username']=_0x2eec01['username']||'';this[_0x7c8d('0x1')]=_0x2eec01[_0x7c8d('0x1')]||'';this[_0x7c8d('0x2')]=_0x2eec01[_0x7c8d('0x2')]||'';this[_0x7c8d('0x3')]=_0x2eec01['clientId']||'';this[_0x7c8d('0x4')]=_0x2eec01[_0x7c8d('0x4')]||'';this[_0x7c8d('0x5')]=_0x2eec01[_0x7c8d('0x5')]||'';this[_0x7c8d('0x6')]=_0x2eec01['type']||_0x7c8d('0x7');this[_0x7c8d('0x8')]=_0x2eec01[_0x7c8d('0x8')]||'';this[_0x7c8d('0x9')]=_0x2eec01[_0x7c8d('0x9')]||{};}module[_0x7c8d('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xeae8=['securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xeae8,0x66));var _0x8eae=function(_0x4d8a97,_0x1551ae){_0x4d8a97=_0x4d8a97-0x0;var _0x5e07ee=_0xeae8[_0x4d8a97];return _0x5e07ee;};'use strict';function SalesforceAccount(_0x510ebf){this['id']=_0x510ebf['id']||0x0;this[_0x8eae('0x0')]=_0x510ebf[_0x8eae('0x0')]||'';this['username']=_0x510ebf[_0x8eae('0x1')]||'';this['remoteUri']=_0x510ebf[_0x8eae('0x2')]||'';this['password']=_0x510ebf[_0x8eae('0x3')]||'';this[_0x8eae('0x4')]=_0x510ebf[_0x8eae('0x4')]||'';this[_0x8eae('0x5')]=_0x510ebf[_0x8eae('0x5')]||'';this[_0x8eae('0x6')]=_0x510ebf[_0x8eae('0x6')]||'';this[_0x8eae('0x7')]=_0x510ebf[_0x8eae('0x7')]||_0x8eae('0x8');this[_0x8eae('0x9')]=_0x510ebf['serverUrl']||'';this['Configurations']=_0x510ebf[_0x8eae('0xa')]||{};}module[_0x8eae('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 aab9dde..2912604 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 _0xec05=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4a8604,_0x3c28b7){var _0x1944c1=function(_0x48d91c){while(--_0x48d91c){_0x4a8604['push'](_0x4a8604['shift']());}};_0x1944c1(++_0x3c28b7);}(_0xec05,0xee));var _0x5ec0=function(_0x263e30,_0x10213e){_0x263e30=_0x263e30-0x0;var _0x1390b1=_0xec05[_0x263e30];return _0x1390b1;};'use strict';function ServicenowAccount(_0x72437){this['id']=_0x72437['id']||0x0;this[_0x5ec0('0x0')]=_0x72437[_0x5ec0('0x0')]||'';this[_0x5ec0('0x1')]=_0x72437[_0x5ec0('0x1')]||'';this[_0x5ec0('0x2')]=_0x72437[_0x5ec0('0x2')]||'';this[_0x5ec0('0x3')]=_0x72437[_0x5ec0('0x3')]||'';this[_0x5ec0('0x4')]=_0x72437[_0x5ec0('0x4')]||'';this[_0x5ec0('0x5')]=_0x72437[_0x5ec0('0x5')]||{};}module[_0x5ec0('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x77ca=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x5848de,_0x480623){var _0xc88fdb=function(_0x5689c5){while(--_0x5689c5){_0x5848de['push'](_0x5848de['shift']());}};_0xc88fdb(++_0x480623);}(_0x77ca,0x174));var _0xa77c=function(_0x667119,_0x13a3d2){_0x667119=_0x667119-0x0;var _0x2274de=_0x77ca[_0x667119];return _0x2274de;};'use strict';function ServicenowAccount(_0x42fbc1){this['id']=_0x42fbc1['id']||0x0;this[_0xa77c('0x0')]=_0x42fbc1[_0xa77c('0x0')]||'';this[_0xa77c('0x1')]=_0x42fbc1[_0xa77c('0x1')]||'';this[_0xa77c('0x2')]=_0x42fbc1[_0xa77c('0x2')]||'';this[_0xa77c('0x3')]=_0x42fbc1[_0xa77c('0x3')]||'';this[_0xa77c('0x4')]=_0x42fbc1[_0xa77c('0x4')]||'';this[_0xa77c('0x5')]=_0x42fbc1['Configurations']||{};}module[_0xa77c('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index c3e32ed..bbe3d9a 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 _0x0276=['username','password','remoteUri','Configurations','exports','name'];(function(_0x4fd1c4,_0x3b18d1){var _0x1ce8e2=function(_0x141b74){while(--_0x141b74){_0x4fd1c4['push'](_0x4fd1c4['shift']());}};_0x1ce8e2(++_0x3b18d1);}(_0x0276,0x83));var _0x6027=function(_0x53e6a8,_0x5839ab){_0x53e6a8=_0x53e6a8-0x0;var _0x2b6dcc=_0x0276[_0x53e6a8];return _0x2b6dcc;};'use strict';function SugarcrmAccount(_0xff299f){this['id']=_0xff299f['id']||0x0;this[_0x6027('0x0')]=_0xff299f[_0x6027('0x0')]||'';this[_0x6027('0x1')]=_0xff299f[_0x6027('0x1')]||'';this[_0x6027('0x2')]=_0xff299f[_0x6027('0x2')]||'';this[_0x6027('0x3')]=_0xff299f[_0x6027('0x3')]||'';this['serverUrl']=_0xff299f['serverUrl']||'';this[_0x6027('0x4')]=_0xff299f[_0x6027('0x4')]||{};}module[_0x6027('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x2308=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x2308,0x108));var _0x8230=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2308[_0xb0f7c3];return _0x28ea68;};'use strict';function SugarcrmAccount(_0x389b4d){this['id']=_0x389b4d['id']||0x0;this['name']=_0x389b4d[_0x8230('0x0')]||'';this[_0x8230('0x1')]=_0x389b4d[_0x8230('0x1')]||'';this[_0x8230('0x2')]=_0x389b4d[_0x8230('0x2')]||'';this[_0x8230('0x3')]=_0x389b4d[_0x8230('0x3')]||'';this['serverUrl']=_0x389b4d[_0x8230('0x4')]||'';this['Configurations']=_0x389b4d[_0x8230('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 8ffe708..f368eab 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 _0xb1ba=['stateTime','address','name','accountcode','state','unknown'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0xb1ba,0x152));var _0xab1b=function(_0x383d66,_0x5a95ce){_0x383d66=_0x383d66-0x0;var _0x4a71d3=_0xb1ba[_0x383d66];return _0x4a71d3;};'use strict';function Telephone(_0x1c008b){this['id']=_0x1c008b['id']||0x0;this['name']=_0x1c008b[_0xab1b('0x0')]||'';this[_0xab1b('0x1')]=_0x1c008b[_0xab1b('0x1')]||'';this[_0xab1b('0x2')]=_0xab1b('0x3');this[_0xab1b('0x4')]=0x0;this['status']='unknown';this[_0xab1b('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xd64b=['status','name','accountcode','state','unknown','stateTime'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0xd64b,0xc1));var _0xbd64=function(_0x3612d5,_0xba7292){_0x3612d5=_0x3612d5-0x0;var _0x2febbf=_0xd64b[_0x3612d5];return _0x2febbf;};'use strict';function Telephone(_0x272488){this['id']=_0x272488['id']||0x0;this['name']=_0x272488[_0xbd64('0x0')]||'';this['accountcode']=_0x272488[_0xbd64('0x1')]||'';this[_0xbd64('0x2')]=_0xbd64('0x3');this[_0xbd64('0x4')]=0x0;this[_0xbd64('0x5')]='unknown';this['address']='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 799875a..5d39d84 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(_0x26d88d,_0x21d5c7){var _0x3cb6b0=function(_0x2cfabd){while(--_0x2cfabd){_0x26d88d['push'](_0x26d88d['shift']());}};_0x3cb6b0(++_0x21d5c7);}(_0xb10b,0x12a));var _0xbb10=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xb10b[_0x8af54b];return _0x27d8f0;};'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(_0x41b6c2,_0x2f494b){var _0x5d3cdd=function(_0x947533){while(--_0x947533){_0x41b6c2['push'](_0x41b6c2['shift']());}};_0x5d3cdd(++_0x2f494b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 2d4d3f1..7663d29 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 _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x5f66,0x1a0));var _0x65f6=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5f66[_0x173441];return _0x2423a8;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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 diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 6056c14..fbf4e0d 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 _0x1bb9=['exports','state','unknown','stateTime','status','registry','indexOf','split','host','domain','refresh','registrationtime','address','defaultuser'];(function(_0x48334d,_0x5d7303){var _0x2b5cce=function(_0x212a64){while(--_0x212a64){_0x48334d['push'](_0x48334d['shift']());}};_0x2b5cce(++_0x5d7303);}(_0x1bb9,0x119));var _0x91bb=function(_0x5d6e35,_0x4d1ac0){_0x5d6e35=_0x5d6e35-0x0;var _0x5d7ada=_0x1bb9[_0x5d6e35];return _0x5d7ada;};'use strict';function Trunk(_0x9c0051){this['id']=_0x9c0051['id']||0x0;this['active']=_0x9c0051['active']||![];this['name']=_0x9c0051['name']||'';this[_0x91bb('0x0')]=_0x91bb('0x1');this[_0x91bb('0x2')]=0x0;this[_0x91bb('0x3')]=_0x91bb('0x1');this['registry']=_0x9c0051[_0x91bb('0x4')]&&_0x9c0051['registry'][_0x91bb('0x5')](':')?_0x9c0051[_0x91bb('0x4')][_0x91bb('0x6')](':')[0x0]:'';this[_0x91bb('0x7')]='';this['port']='';this[_0x91bb('0x8')]='';this['domainport']='';this[_0x91bb('0x9')]='';this['stateRegistry']=_0x91bb('0x1');this[_0x91bb('0xa')]='';this[_0x91bb('0xb')]='';this['defaultuser']=_0x9c0051[_0x91bb('0xc')]||'';}module[_0x91bb('0xd')]=Trunk; \ No newline at end of file +var _0x742c=['registrationtime','defaultuser','active','name','state','status','registry','indexOf','split','port','domainport','refresh','stateRegistry','unknown'];(function(_0x1cb46b,_0x2021a8){var _0x56aac6=function(_0x44ca0d){while(--_0x44ca0d){_0x1cb46b['push'](_0x1cb46b['shift']());}};_0x56aac6(++_0x2021a8);}(_0x742c,0xb8));var _0xc742=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x742c[_0xac151d];return _0x111dba;};'use strict';function Trunk(_0x1d47c4){this['id']=_0x1d47c4['id']||0x0;this[_0xc742('0x0')]=_0x1d47c4[_0xc742('0x0')]||![];this[_0xc742('0x1')]=_0x1d47c4[_0xc742('0x1')]||'';this[_0xc742('0x2')]='unknown';this['stateTime']=0x0;this[_0xc742('0x3')]='unknown';this[_0xc742('0x4')]=_0x1d47c4[_0xc742('0x4')]&&_0x1d47c4[_0xc742('0x4')][_0xc742('0x5')](':')?_0x1d47c4['registry'][_0xc742('0x6')](':')[0x0]:'';this['host']='';this[_0xc742('0x7')]='';this['domain']='';this[_0xc742('0x8')]='';this[_0xc742('0x9')]='';this[_0xc742('0xa')]=_0xc742('0xb');this[_0xc742('0xc')]='';this['address']='';this['defaultuser']=_0x1d47c4[_0xc742('0xd')]||'';}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 7a7f1fc..4ad6a5d 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 _0x8f34=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0x8f34,0x1a9));var _0x48f3=function(_0x1844ae,_0x237c00){_0x1844ae=_0x1844ae-0x0;var _0x2f01f0=_0x8f34[_0x1844ae];return _0x2f01f0;};'use strict';function voiceExtension(_0x4e386a){this['id']=_0x4e386a['id']||0x0;this[_0x48f3('0x0')]=_0x4e386a['exten']||'';this[_0x48f3('0x1')]=_0x4e386a[_0x48f3('0x1')]||_0x48f3('0x2');this[_0x48f3('0x3')]=_0x4e386a[_0x48f3('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0xcd9b=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xcd9b,0x136));var _0xbcd9=function(_0x13789a,_0x3190d4){_0x13789a=_0x13789a-0x0;var _0x220c15=_0xcd9b[_0x13789a];return _0x220c15;};'use strict';function voiceExtension(_0x1ede57){this['id']=_0x1ede57['id']||0x0;this[_0xbcd9('0x0')]=_0x1ede57[_0xbcd9('0x0')]||'';this[_0xbcd9('0x1')]=_0x1ede57[_0xbcd9('0x1')]||_0xbcd9('0x2');this[_0xbcd9('0x3')]=_0x1ede57[_0xbcd9('0x3')]||![];}module[_0xbcd9('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 25bc96c..f12beea 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 _0x9ea5=['gsm','roundrobin','name','monitor_format','type','inbound','talking','answered','sumDuration','sumHoldTime','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49'];(function(_0x276167,_0x21086e){var _0x27a866=function(_0xa47f17){while(--_0xa47f17){_0x276167['push'](_0x276167['shift']());}};_0x27a866(++_0x21086e);}(_0x9ea5,0x156));var _0x59ea=function(_0x2817f5,_0x2528ee){_0x2817f5=_0x2817f5-0x0;var _0x5df3b4=_0x9ea5[_0x2817f5];return _0x5df3b4;};'use strict';var statusDesc=[_0x59ea('0x0'),_0x59ea('0x1'),'inuse','busy',_0x59ea('0x2'),_0x59ea('0x3'),_0x59ea('0x4'),_0x59ea('0x5'),_0x59ea('0x6')];var monitorFormat={'wav':_0x59ea('0x7'),'wav49':_0x59ea('0x8'),'gsm':_0x59ea('0x9')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x59ea('0xa')};function VoiceQueue(_0x2c6830){this['id']=_0x2c6830['id']||0x0;this[_0x59ea('0xb')]=_0x2c6830[_0x59ea('0xb')]||'';this[_0x59ea('0xc')]=_0x2c6830[_0x59ea('0xc')]||'';this[_0x59ea('0xd')]=_0x2c6830['type']||_0x59ea('0xe');this['waiting']=0x0;this[_0x59ea('0xf')]=0x0;this['total']=0x0;this[_0x59ea('0x10')]=0x0;this[_0x59ea('0x11')]=0x0;this[_0x59ea('0x12')]=0x0;this['sumBillable']=0x0;this[_0x59ea('0x13')]=0x0;this[_0x59ea('0x14')]=0x0;this[_0x59ea('0x15')]=0x0;this['available']=0x0;this['acw']=_0x2c6830[_0x59ea('0x16')]||![];this[_0x59ea('0x17')]=_0x2c6830[_0x59ea('0x17')]||0xa;this['autopause']=_0x2c6830[_0x59ea('0x18')]||'no';this[_0x59ea('0x19')]=!![];this['message']='';this[_0x59ea('0x1a')]=0x0;this[_0x59ea('0x1b')]=0x0;this[_0x59ea('0x1c')]=_0x2c6830[_0x59ea('0x1c')]||null;this['dialGlobalInterval']=_0x2c6830[_0x59ea('0x1d')]?_0x2c6830[_0x59ea('0x1d')]:null;this[_0x59ea('0x1e')]=_0x2c6830['dialActive'];this['dialMethod']=_0x2c6830[_0x59ea('0x1f')]||_0x59ea('0x20');this[_0x59ea('0x21')]=_0x2c6830[_0x59ea('0x21')]||0x0;this[_0x59ea('0x22')]=_0x2c6830['dialLimitQueue']||0x0;this[_0x59ea('0x23')]=_0x2c6830[_0x59ea('0x23')]||0x1;this[_0x59ea('0x24')]=_0x2c6830['dialPredictiveOptimization']||_0x59ea('0x25');this[_0x59ea('0x26')]=_0x2c6830[_0x59ea('0x26')]||0.03;this[_0x59ea('0x27')]=_0x2c6830[_0x59ea('0x27')]||0x258;this['dialOriginateCallerIdName']=_0x2c6830['dialOriginateCallerIdName']||'anonymous';this[_0x59ea('0x28')]=_0x2c6830[_0x59ea('0x28')]||_0x59ea('0x29');this[_0x59ea('0x2a')]=_0x2c6830[_0x59ea('0x2a')]||0x1e;this['dialQueueOptions']=_0x2c6830['dialQueueOptions']||'tTxX';this[_0x59ea('0x2b')]=_0x2c6830[_0x59ea('0x2b')]||0x3;this[_0x59ea('0x2c')]=_0x2c6830[_0x59ea('0x2c')]||undefined;this[_0x59ea('0x2d')]=_0x2c6830[_0x59ea('0x2d')]||0x3;this[_0x59ea('0x2e')]=_0x2c6830[_0x59ea('0x2e')]||0x96;this[_0x59ea('0x2f')]=_0x2c6830[_0x59ea('0x2f')]||0x3;this[_0x59ea('0x30')]=_0x2c6830[_0x59ea('0x30')]||0x96;this[_0x59ea('0x31')]=_0x2c6830['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x2c6830['dialNoAnswerRetryFrequency']||0x96;this[_0x59ea('0x32')]=_0x2c6830[_0x59ea('0x32')]||0x3;this[_0x59ea('0x33')]=_0x2c6830['dialNoSuchNumberRetryFrequency']||0x96;this[_0x59ea('0x34')]=_0x2c6830[_0x59ea('0x34')]||0x3;this[_0x59ea('0x35')]=_0x2c6830[_0x59ea('0x35')]||0x96;this['dialAbandonedMaxRetry']=_0x2c6830[_0x59ea('0x36')]||0x3;this['dialAbandonedRetryFrequency']=_0x2c6830[_0x59ea('0x37')]||0x96;this[_0x59ea('0x38')]=_0x2c6830['dialMachineMaxRetry']||0x3;this[_0x59ea('0x39')]=_0x2c6830[_0x59ea('0x39')]||0x96;this['dialAgentRejectMaxRetry']=_0x2c6830[_0x59ea('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2c6830[_0x59ea('0x3b')]||0x96;this['callAdditionalPhoneAfterMin']=_0x2c6830['callAdditionalPhoneAfterMin']||0x3;this[_0x59ea('0x3c')]=_0x2c6830[_0x59ea('0x3c')]||0x4;this[_0x59ea('0x3d')]=_0x2c6830[_0x59ea('0x3d')]?_0x2c6830[_0x59ea('0x3d')]:undefined;this[_0x59ea('0x3e')]=_0x2c6830[_0x59ea('0x3e')]?_0x2c6830[_0x59ea('0x3e')]:undefined;this[_0x59ea('0x3f')]=_0x2c6830[_0x59ea('0x3f')]||undefined;this[_0x59ea('0x40')]=_0x2c6830['Interval']?_0x2c6830['Interval']:undefined;this[_0x59ea('0x41')]=_0x2c6830[_0x59ea('0x41')]||'DESC';this[_0x59ea('0x42')]=_0x2c6830[_0x59ea('0x42')]||undefined;this['dialCutDigit']=_0x2c6830['dialCutDigit']||undefined;this[_0x59ea('0x43')]=strategy[_0x2c6830[_0x59ea('0x43')]]||_0x59ea('0x44');this[_0x59ea('0x45')]=!![];this[_0x59ea('0x46')]=_0x2c6830[_0x59ea('0x46')]||![];this['dialAMDInitialSilence']=_0x2c6830[_0x59ea('0x47')];this[_0x59ea('0x48')]=_0x2c6830[_0x59ea('0x48')];this[_0x59ea('0x49')]=_0x2c6830[_0x59ea('0x49')];this['dialAMDTotalAnalysisTime']=_0x2c6830['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x2c6830[_0x59ea('0x4a')];this[_0x59ea('0x4b')]=_0x2c6830['dialAMDBetweenWordsSilence'];this[_0x59ea('0x4c')]=_0x2c6830[_0x59ea('0x4c')];this[_0x59ea('0x4d')]=_0x2c6830['dialAMDSilenceThreshold'];this[_0x59ea('0x4e')]=_0x2c6830[_0x59ea('0x4e')];this[_0x59ea('0x4f')]=0x0;this[_0x59ea('0x50')]=0x0;this[_0x59ea('0x51')]=_0x2c6830[_0x59ea('0x51')];this[_0x59ea('0x52')]=0x0;this[_0x59ea('0x53')]=0x0;this[_0x59ea('0x54')]=0x0;this[_0x59ea('0x55')]=0x0;this[_0x59ea('0x56')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x59ea('0x57')]=0x0;this[_0x59ea('0x58')]=0x0;this[_0x59ea('0x59')]=0x0;this[_0x59ea('0x5a')]=0x0;this[_0x59ea('0x5b')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x59ea('0x5c')]=0x0;this[_0x59ea('0x5d')]=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x59ea('0x5e')]=1.05;this[_0x59ea('0x5f')]=0x0;this[_0x59ea('0x60')]=0x0;this[_0x59ea('0x61')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x59ea('0x62')]=0x0;this[_0x59ea('0x63')]=0x0;this[_0x59ea('0x64')]=0x0;this['predictiveIntervalMaxThreshold']=_0x2c6830[_0x59ea('0x65')]||0x14;this[_0x59ea('0x66')]=_0x2c6830[_0x59ea('0x65')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x59ea('0x67')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x59ea('0x68')]=0x0;this[_0x59ea('0x69')]=0x0;this[_0x59ea('0x6a')]=0x0;this[_0x59ea('0x6b')]=0x0;this['dialRecallMeTimeout']=_0x2c6830[_0x59ea('0x6c')]||0x1e;this[_0x59ea('0x6d')]=_0x2c6830[_0x59ea('0x6d')]||![];this['dialPreviewAutoRecallMe']=!!_0x2c6830[_0x59ea('0x6e')]||![];this[_0x59ea('0x6f')]=!!_0x2c6830['dialPreviewRecallmeReminder']||![];this[_0x59ea('0x70')]=_0x2c6830[_0x59ea('0x70')]||undefined;this[_0x59ea('0x71')]=_0x2c6830[_0x59ea('0x71')]||![];this[_0x59ea('0x72')]=_0x2c6830['dialAgiAfterHangupAgent']||![];this[_0x59ea('0xc')]=monitorFormat[_0x2c6830[_0x59ea('0xc')]]?monitorFormat[_0x2c6830[_0x59ea('0xc')]]:undefined;this['mandatoryDisposition']=_0x2c6830[_0x59ea('0x73')]||![];this[_0x59ea('0x74')]=_0x2c6830[_0x59ea('0x74')]?_0x2c6830[_0x59ea('0x74')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x8bec=['erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','erlangCalls'];(function(_0x53add6,_0x4c17a3){var _0x341aeb=function(_0x1cdaf7){while(--_0x1cdaf7){_0x53add6['push'](_0x53add6['shift']());}};_0x341aeb(++_0x4c17a3);}(_0x8bec,0x180));var _0xc8be=function(_0x158f43,_0x1dce4f){_0x158f43=_0x158f43-0x0;var _0x48c1b8=_0x8bec[_0x158f43];return _0x48c1b8;};'use strict';var statusDesc=[_0xc8be('0x0'),_0xc8be('0x1'),'inuse','busy',_0xc8be('0x2'),_0xc8be('0x3'),'ringing',_0xc8be('0x4'),_0xc8be('0x5')];var monitorFormat={'wav':_0xc8be('0x6'),'wav49':_0xc8be('0x7'),'gsm':_0xc8be('0x8')};var strategy={'rrmemory':_0xc8be('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x3d8cc2){this['id']=_0x3d8cc2['id']||0x0;this[_0xc8be('0xa')]=_0x3d8cc2[_0xc8be('0xa')]||'';this[_0xc8be('0xb')]=_0x3d8cc2[_0xc8be('0xb')]||'';this[_0xc8be('0xc')]=_0x3d8cc2[_0xc8be('0xc')]||_0xc8be('0xd');this[_0xc8be('0xe')]=0x0;this[_0xc8be('0xf')]=0x0;this[_0xc8be('0x10')]=0x0;this[_0xc8be('0x11')]=0x0;this[_0xc8be('0x12')]=0x0;this[_0xc8be('0x13')]=0x0;this[_0xc8be('0x14')]=0x0;this[_0xc8be('0x15')]=0x0;this[_0xc8be('0x16')]=0x0;this[_0xc8be('0x17')]=0x0;this[_0xc8be('0x18')]=0x0;this[_0xc8be('0x19')]=_0x3d8cc2[_0xc8be('0x19')]||![];this[_0xc8be('0x1a')]=_0x3d8cc2[_0xc8be('0x1a')]||0xa;this[_0xc8be('0x1b')]=_0x3d8cc2[_0xc8be('0x1b')]||'no';this[_0xc8be('0x1c')]=!![];this[_0xc8be('0x1d')]='';this['originated']=0x0;this[_0xc8be('0x1e')]=0x0;this['dialTimezone']=_0x3d8cc2[_0xc8be('0x1f')]||null;this[_0xc8be('0x20')]=_0x3d8cc2[_0xc8be('0x20')]?_0x3d8cc2['dialGlobalInterval']:null;this[_0xc8be('0x21')]=_0x3d8cc2[_0xc8be('0x21')];this['dialMethod']=_0x3d8cc2[_0xc8be('0x22')]||'progressive';this[_0xc8be('0x23')]=_0x3d8cc2[_0xc8be('0x23')]||0x0;this[_0xc8be('0x24')]=_0x3d8cc2[_0xc8be('0x24')]||0x0;this[_0xc8be('0x25')]=_0x3d8cc2[_0xc8be('0x25')]||0x1;this['dialPredictiveOptimization']=_0x3d8cc2[_0xc8be('0x26')]||_0xc8be('0x27');this[_0xc8be('0x28')]=_0x3d8cc2[_0xc8be('0x28')]||0.03;this['dialPredictiveInterval']=_0x3d8cc2['dialPredictiveInterval']||0x258;this[_0xc8be('0x29')]=_0x3d8cc2[_0xc8be('0x29')]||_0xc8be('0x2a');this[_0xc8be('0x2b')]=_0x3d8cc2['dialOriginateCallerIdNumber']||_0xc8be('0x2a');this[_0xc8be('0x2c')]=_0x3d8cc2['dialOriginateTimeout']||0x1e;this[_0xc8be('0x2d')]=_0x3d8cc2['dialQueueOptions']||_0xc8be('0x2e');this[_0xc8be('0x2f')]=_0x3d8cc2[_0xc8be('0x2f')]||0x3;this['dialQueueProject']=_0x3d8cc2[_0xc8be('0x30')]||undefined;this['dialCongestionMaxRetry']=_0x3d8cc2[_0xc8be('0x31')]||0x3;this[_0xc8be('0x32')]=_0x3d8cc2[_0xc8be('0x32')]||0x96;this[_0xc8be('0x33')]=_0x3d8cc2[_0xc8be('0x33')]||0x3;this[_0xc8be('0x34')]=_0x3d8cc2[_0xc8be('0x34')]||0x96;this['dialNoAnswerMaxRetry']=_0x3d8cc2[_0xc8be('0x35')]||0x3;this[_0xc8be('0x36')]=_0x3d8cc2[_0xc8be('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x3d8cc2['dialNoSuchNumberMaxRetry']||0x3;this[_0xc8be('0x37')]=_0x3d8cc2[_0xc8be('0x37')]||0x96;this[_0xc8be('0x38')]=_0x3d8cc2['dialDropMaxRetry']||0x3;this[_0xc8be('0x39')]=_0x3d8cc2['dialDropRetryFrequency']||0x96;this[_0xc8be('0x3a')]=_0x3d8cc2['dialAbandonedMaxRetry']||0x3;this[_0xc8be('0x3b')]=_0x3d8cc2[_0xc8be('0x3b')]||0x96;this[_0xc8be('0x3c')]=_0x3d8cc2[_0xc8be('0x3c')]||0x3;this[_0xc8be('0x3d')]=_0x3d8cc2[_0xc8be('0x3d')]||0x96;this[_0xc8be('0x3e')]=_0x3d8cc2[_0xc8be('0x3e')]||0x3;this[_0xc8be('0x3f')]=_0x3d8cc2[_0xc8be('0x3f')]||0x96;this['callAdditionalPhoneAfterMin']=_0x3d8cc2[_0xc8be('0x40')]||0x3;this[_0xc8be('0x41')]=_0x3d8cc2['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x3d8cc2[_0xc8be('0x42')]?_0x3d8cc2['Trunk']:undefined;this['TrunkBackup']=_0x3d8cc2[_0xc8be('0x43')]?_0x3d8cc2[_0xc8be('0x43')]:undefined;this[_0xc8be('0x44')]=_0x3d8cc2[_0xc8be('0x44')]||undefined;this[_0xc8be('0x45')]=_0x3d8cc2[_0xc8be('0x45')]?_0x3d8cc2['Interval']:undefined;this['dialOrderByScheduledAt']=_0x3d8cc2[_0xc8be('0x46')]||'DESC';this[_0xc8be('0x47')]=_0x3d8cc2[_0xc8be('0x47')]||undefined;this[_0xc8be('0x48')]=_0x3d8cc2['dialCutDigit']||undefined;this[_0xc8be('0x49')]=strategy[_0x3d8cc2[_0xc8be('0x49')]]||_0xc8be('0x9');this['queueStatusComplete']=!![];this[_0xc8be('0x4a')]=_0x3d8cc2[_0xc8be('0x4a')]||![];this[_0xc8be('0x4b')]=_0x3d8cc2[_0xc8be('0x4b')];this[_0xc8be('0x4c')]=_0x3d8cc2[_0xc8be('0x4c')];this[_0xc8be('0x4d')]=_0x3d8cc2['dialAMDAfterGreetingSilence'];this[_0xc8be('0x4e')]=_0x3d8cc2[_0xc8be('0x4e')];this[_0xc8be('0x4f')]=_0x3d8cc2[_0xc8be('0x4f')];this[_0xc8be('0x50')]=_0x3d8cc2[_0xc8be('0x50')];this[_0xc8be('0x51')]=_0x3d8cc2[_0xc8be('0x51')];this[_0xc8be('0x52')]=_0x3d8cc2[_0xc8be('0x52')];this[_0xc8be('0x53')]=_0x3d8cc2[_0xc8be('0x53')];this['outboundRejectCallsDay']=0x0;this[_0xc8be('0x54')]=0x0;this[_0xc8be('0x55')]=_0x3d8cc2[_0xc8be('0x55')];this[_0xc8be('0x56')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xc8be('0x57')]=0x0;this[_0xc8be('0x58')]=0x0;this[_0xc8be('0x59')]=0x0;this[_0xc8be('0x5a')]=0x0;this[_0xc8be('0x5b')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xc8be('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xc8be('0x5d')]=0x0;this[_0xc8be('0x5e')]=0x0;this[_0xc8be('0x5f')]=0x0;this['outboundAbandonedDay']=0x0;this[_0xc8be('0x60')]=undefined;this[_0xc8be('0x61')]=undefined;this[_0xc8be('0x62')]=undefined;this[_0xc8be('0x63')]=1.05;this[_0xc8be('0x64')]=0x0;this[_0xc8be('0x65')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xc8be('0x66')]=0x0;this[_0xc8be('0x67')]=0x0;this[_0xc8be('0x68')]=0x0;this[_0xc8be('0x69')]=0x0;this[_0xc8be('0x6a')]=0x0;this[_0xc8be('0x6b')]=_0x3d8cc2['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xc8be('0x6c')]=_0x3d8cc2[_0xc8be('0x6d')]||0xa;this[_0xc8be('0x6e')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xc8be('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0xc8be('0x70')]=0x0;this[_0xc8be('0x71')]=0x0;this[_0xc8be('0x72')]=_0x3d8cc2[_0xc8be('0x72')]||0x1e;this[_0xc8be('0x73')]=_0x3d8cc2['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x3d8cc2[_0xc8be('0x74')]||![];this[_0xc8be('0x75')]=!!_0x3d8cc2['dialPreviewRecallmeReminder']||![];this[_0xc8be('0x76')]=_0x3d8cc2['dialQueueProject2']||undefined;this[_0xc8be('0x77')]=_0x3d8cc2[_0xc8be('0x77')]||![];this['dialAgiAfterHangupAgent']=_0x3d8cc2[_0xc8be('0x78')]||![];this['monitor_format']=monitorFormat[_0x3d8cc2[_0xc8be('0xb')]]?monitorFormat[_0x3d8cc2[_0xc8be('0xb')]]:undefined;this['mandatoryDisposition']=_0x3d8cc2[_0xc8be('0x79')]||![];this['mandatoryDispositionPause']=_0x3d8cc2[_0xc8be('0x7a')]?_0x3d8cc2[_0xc8be('0x7a')]:undefined;}module[_0xc8be('0x7b')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 2b39eb0..7e7c4ae 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 _0xc8a2=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x4a05c7,_0x4b29e3){var _0x519fe9=function(_0x153374){while(--_0x153374){_0x4a05c7['push'](_0x4a05c7['shift']());}};_0x519fe9(++_0x4b29e3);}(_0xc8a2,0x103));var _0x2c8a=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xc8a2[_0xbd08b4];return _0x314f1e;};'use strict';function VtigerAccount(_0x4477f1){this['id']=_0x4477f1['id']||0x0;this[_0x2c8a('0x0')]=_0x4477f1[_0x2c8a('0x0')]||'';this[_0x2c8a('0x1')]=_0x4477f1[_0x2c8a('0x1')]||'';this[_0x2c8a('0x2')]=_0x4477f1[_0x2c8a('0x2')]||'';this[_0x2c8a('0x3')]=_0x4477f1['remoteUri']||'';this[_0x2c8a('0x4')]=_0x4477f1[_0x2c8a('0x4')]||'';this[_0x2c8a('0x5')]=_0x4477f1[_0x2c8a('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0xa5b8=['accessKey','remoteUri','serverUrl','Configurations','name','username'];(function(_0x21a7ca,_0xacd685){var _0x2a5508=function(_0x25ccde){while(--_0x25ccde){_0x21a7ca['push'](_0x21a7ca['shift']());}};_0x2a5508(++_0xacd685);}(_0xa5b8,0x148));var _0x8a5b=function(_0x1c12b1,_0x46eac2){_0x1c12b1=_0x1c12b1-0x0;var _0x588b51=_0xa5b8[_0x1c12b1];return _0x588b51;};'use strict';function VtigerAccount(_0x5a9dfe){this['id']=_0x5a9dfe['id']||0x0;this[_0x8a5b('0x0')]=_0x5a9dfe['name']||'';this[_0x8a5b('0x1')]=_0x5a9dfe[_0x8a5b('0x1')]||'';this[_0x8a5b('0x2')]=_0x5a9dfe['accessKey']||'';this[_0x8a5b('0x3')]=_0x5a9dfe[_0x8a5b('0x3')]||'';this[_0x8a5b('0x4')]=_0x5a9dfe[_0x8a5b('0x4')]||'';this[_0x8a5b('0x5')]=_0x5a9dfe['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index dc108a0..7e934d7 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 _0xa449=['serverUrl','Configurations','exports','name','username','password','token','remoteUri','integrationTab'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xa449,0x186));var _0x9a44=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa449[_0x42cae2];return _0x5f256f;};'use strict';function ZendeskAccount(_0x25b33b){this['id']=_0x25b33b['id']||0x0;this[_0x9a44('0x0')]=_0x25b33b['name']||'';this['username']=_0x25b33b[_0x9a44('0x1')]||'';this[_0x9a44('0x2')]=_0x25b33b['password']||'';this['token']=_0x25b33b[_0x9a44('0x3')]||'';this[_0x9a44('0x4')]=_0x25b33b[_0x9a44('0x4')]||'';this['authType']=_0x25b33b['authType']||'';this['type']=_0x25b33b['type']||_0x9a44('0x5');this[_0x9a44('0x6')]=_0x25b33b[_0x9a44('0x6')]||'';this['Configurations']=_0x25b33b[_0x9a44('0x7')]||{};}module[_0x9a44('0x8')]=ZendeskAccount; \ No newline at end of file +var _0x2dd7=['Configurations','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2dd7,0x10f));var _0x72dd=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x2dd7[_0x1793de];return _0x4f0309;};'use strict';function ZendeskAccount(_0x2db808){this['id']=_0x2db808['id']||0x0;this[_0x72dd('0x0')]=_0x2db808[_0x72dd('0x0')]||'';this[_0x72dd('0x1')]=_0x2db808['username']||'';this[_0x72dd('0x2')]=_0x2db808[_0x72dd('0x2')]||'';this[_0x72dd('0x3')]=_0x2db808['token']||'';this[_0x72dd('0x4')]=_0x2db808[_0x72dd('0x4')]||'';this[_0x72dd('0x5')]=_0x2db808[_0x72dd('0x5')]||'';this[_0x72dd('0x6')]=_0x2db808[_0x72dd('0x6')]||_0x72dd('0x7');this['serverUrl']=_0x2db808[_0x72dd('0x8')]||'';this[_0x72dd('0x9')]=_0x2db808['Configurations']||{};}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 bbc9de2..f33fd93 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 _0x945c=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x945c,0xc6));var _0xc945=function(_0x31e838,_0x2dd056){_0x31e838=_0x31e838-0x0;var _0x3c542b=_0x945c[_0x31e838];return _0x3c542b;};'use strict';function ZohoAccount(_0x2bdf3a){this['id']=_0x2bdf3a['id']||0x0;this[_0xc945('0x0')]=_0x2bdf3a[_0xc945('0x0')]||'';this[_0xc945('0x1')]=_0x2bdf3a['description']||'';this[_0xc945('0x2')]=_0x2bdf3a[_0xc945('0x2')]||'';this['zone']=_0x2bdf3a[_0xc945('0x3')]||'';this[_0xc945('0x4')]=_0x2bdf3a[_0xc945('0x4')]||'';this[_0xc945('0x5')]=_0x2bdf3a[_0xc945('0x5')]||'';this[_0xc945('0x6')]=_0x2bdf3a['serverUrl']||'';this[_0xc945('0x7')]=_0x2bdf3a['code']||'';this[_0xc945('0x8')]=_0x2bdf3a['refreshToken']||'';this[_0xc945('0x9')]=_0x2bdf3a[_0xc945('0x9')]||{};}module[_0xc945('0xa')]=ZohoAccount; \ No newline at end of file +var _0x8f44=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x4fc0d5,_0x3710e0){var _0x2a6212=function(_0x5a85b2){while(--_0x5a85b2){_0x4fc0d5['push'](_0x4fc0d5['shift']());}};_0x2a6212(++_0x3710e0);}(_0x8f44,0xab));var _0x48f4=function(_0x45d0c4,_0x4586f1){_0x45d0c4=_0x45d0c4-0x0;var _0x4909e2=_0x8f44[_0x45d0c4];return _0x4909e2;};'use strict';function ZohoAccount(_0x17b108){this['id']=_0x17b108['id']||0x0;this[_0x48f4('0x0')]=_0x17b108[_0x48f4('0x0')]||'';this['description']=_0x17b108[_0x48f4('0x1')]||'';this['host']=_0x17b108[_0x48f4('0x2')]||'';this[_0x48f4('0x3')]=_0x17b108[_0x48f4('0x3')]||'';this['clientId']=_0x17b108[_0x48f4('0x4')]||'';this['clientSecret']=_0x17b108[_0x48f4('0x5')]||'';this[_0x48f4('0x6')]=_0x17b108[_0x48f4('0x6')]||'';this[_0x48f4('0x7')]=_0x17b108['code']||'';this[_0x48f4('0x8')]=_0x17b108[_0x48f4('0x8')]||'';this['Configurations']=_0x17b108[_0x48f4('0x9')]||{};}module[_0x48f4('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index ec48192..d3c66b7 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 _0x4137=['string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','firstName','Contact','active','phone','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil'];(function(_0x5634f8,_0xc6600c){var _0x15dcc4=function(_0x4d7ee1){while(--_0x4d7ee1){_0x5634f8['push'](_0x5634f8['shift']());}};_0x15dcc4(++_0xc6600c);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var util=require(_0x7413('0x0'));var _=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));function checkNameSurname(_0x4f372c,_0x392ebc,_0x410971){var _0x2e6df7='';if(!_[_0x7413('0x3')](_0x392ebc)&&_0x7413('0x4')===typeof _0x392ebc){_0x2e6df7+=_0x392ebc;}if(!_[_0x7413('0x3')](_0x410971)&&_0x7413('0x4')===typeof _0x410971){_0x2e6df7+='\x20'+_0x410971;}if(_0x2e6df7!==''){return _0x2e6df7;}return _0x4f372c;}function Action(_0x3bb181,_0x4fbade,_0xc808cd,_0x188d89,_0x5b39ac){this[_0x7413('0x5')]=_0xc808cd||undefined;this['idContact']=_0x3bb181['id'];this[_0x7413('0x6')]=_0x4fbade[_0x7413('0x7')];this['type']=_0x4fbade[_0x7413('0x8')];this[_0x7413('0x9')]='queue';this[_0x7413('0xa')]=![];this[_0x7413('0xb')]=_[_0x7413('0x3')](_0x3bb181[_0x7413('0xc')])?undefined:_0x3bb181[_0x7413('0xc')]['name'];this[_0x7413('0xd')]=this[_0x7413('0xb')]?util['format'](_0x7413('0xe'),this[_0x7413('0xb')]):_0x188d89||undefined;this[_0x7413('0xf')]=checkNameSurname(_0x3bb181['Contact']['phone'],_0x3bb181['Contact'][_0x7413('0x10')],_0x3bb181[_0x7413('0x11')]['lastName']);this[_0x7413('0x12')]=_0x3bb181[_0x7413('0x12')]||![];this['calleridnum']=_0x3bb181[_0x7413('0x13')];this['scheduledat']=_0x3bb181['scheduledat'];this[_0x7413('0x14')]=_0x3bb181['countbusyretry']||0x0;this[_0x7413('0x15')]=_0x3bb181['countcongestionretry']||0x0;this[_0x7413('0x16')]=_0x3bb181[_0x7413('0x16')]||0x0;this[_0x7413('0x17')]=(_0x3bb181[_0x7413('0x14')]||0x0)+(_0x3bb181[_0x7413('0x15')]||0x0)+(_0x3bb181[_0x7413('0x16')]||0x0)+(_0x3bb181['countnosuchnumberretry']||0x0)+(_0x3bb181[_0x7413('0x18')]||0x0)+(_0x3bb181[_0x7413('0x19')]||0x0)+(_0x3bb181[_0x7413('0x1a')]||0x0)+(_0x3bb181[_0x7413('0x1b')]||0x0);this['countnosuchnumberretry']=_0x3bb181[_0x7413('0x1c')]||0x0;this[_0x7413('0x18')]=_0x3bb181[_0x7413('0x18')]||0x0;this[_0x7413('0x19')]=_0x3bb181[_0x7413('0x19')]||0x0;this[_0x7413('0x1a')]=_0x3bb181[_0x7413('0x1a')]||0x0;this[_0x7413('0x1b')]=_0x3bb181['countagentrejectretry']||0x0;this['callback']=_0x3bb181[_0x7413('0x1d')];this['callbackuniqueid']=_0x3bb181[_0x7413('0x1e')];this[_0x7413('0x1f')]=_0x3bb181[_0x7413('0x1f')];this[_0x7413('0x20')]=_0x3bb181[_0x7413('0x20')];this[_0x7413('0x21')]=_0x3bb181[_0x7413('0x21')];this[_0x7413('0x22')]=_0x3bb181[_0x7413('0x22')];this['UserId']=_['isNil'](_0x3bb181[_0x7413('0xc')])?_0x3bb181['UserId']:_0x3bb181[_0x7413('0xc')]['id'];this[_0x7413('0x23')]=_0x3bb181[_0x7413('0x23')];this['originatecalleridnum']='';this[_0x7413('0x24')]='';}Action[_0x7413('0x25')][_0x7413('0x26')]=function(){return util[_0x7413('0x27')](_0x7413('0x28'),this[_0x7413('0xf')],this['number']);};module[_0x7413('0x29')]=Action; \ No newline at end of file +var _0x8e3f=['prototype','getCaller','format','\x22%s\x22\x20<%s>','number','util','lodash','moment','string','isNil','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','firstName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0xf8e3('0x0'));var _=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));function checkNameSurname(_0x4d334a,_0x3f3440,_0x292de5){var _0x3b07a5='';if(!_['isNil'](_0x3f3440)&&_0xf8e3('0x3')===typeof _0x3f3440){_0x3b07a5+=_0x3f3440;}if(!_[_0xf8e3('0x4')](_0x292de5)&&'string'===typeof _0x292de5){_0x3b07a5+='\x20'+_0x292de5;}if(_0x3b07a5!==''){return _0x3b07a5;}return _0x4d334a;}function Action(_0x35e88f,_0xb21f8d,_0x2621c5,_0x1ee9f3,_0x4e9e57){this[_0xf8e3('0x5')]=_0x2621c5||undefined;this[_0xf8e3('0x6')]=_0x35e88f['id'];this[_0xf8e3('0x7')]=_0xb21f8d[_0xf8e3('0x8')];this[_0xf8e3('0x9')]=_0xb21f8d[_0xf8e3('0x9')];this[_0xf8e3('0xa')]=_0xf8e3('0x7');this[_0xf8e3('0xb')]=![];this[_0xf8e3('0xc')]=_[_0xf8e3('0x4')](_0x35e88f[_0xf8e3('0xd')])?undefined:_0x35e88f['Agent'][_0xf8e3('0x8')];this[_0xf8e3('0xe')]=this[_0xf8e3('0xc')]?util['format'](_0xf8e3('0xf'),this[_0xf8e3('0xc')]):_0x1ee9f3||undefined;this[_0xf8e3('0x10')]=checkNameSurname(_0x35e88f[_0xf8e3('0x11')]['phone'],_0x35e88f[_0xf8e3('0x11')][_0xf8e3('0x12')],_0x35e88f[_0xf8e3('0x11')]['lastName']);this[_0xf8e3('0x13')]=_0x35e88f['active']||![];this[_0xf8e3('0x14')]=_0x35e88f[_0xf8e3('0x15')];this[_0xf8e3('0x16')]=_0x35e88f['scheduledat'];this['countbusyretry']=_0x35e88f[_0xf8e3('0x17')]||0x0;this[_0xf8e3('0x18')]=_0x35e88f[_0xf8e3('0x18')]||0x0;this[_0xf8e3('0x19')]=_0x35e88f[_0xf8e3('0x19')]||0x0;this[_0xf8e3('0x1a')]=(_0x35e88f[_0xf8e3('0x17')]||0x0)+(_0x35e88f[_0xf8e3('0x18')]||0x0)+(_0x35e88f[_0xf8e3('0x19')]||0x0)+(_0x35e88f[_0xf8e3('0x1b')]||0x0)+(_0x35e88f['countdropretry']||0x0)+(_0x35e88f[_0xf8e3('0x1c')]||0x0)+(_0x35e88f[_0xf8e3('0x1d')]||0x0)+(_0x35e88f[_0xf8e3('0x1e')]||0x0);this[_0xf8e3('0x1b')]=_0x35e88f[_0xf8e3('0x1b')]||0x0;this[_0xf8e3('0x1f')]=_0x35e88f[_0xf8e3('0x1f')]||0x0;this[_0xf8e3('0x1c')]=_0x35e88f['countabandonedretry']||0x0;this[_0xf8e3('0x1d')]=_0x35e88f[_0xf8e3('0x1d')]||0x0;this[_0xf8e3('0x1e')]=_0x35e88f[_0xf8e3('0x1e')]||0x0;this['callback']=_0x35e88f[_0xf8e3('0x20')];this['callbackuniqueid']=_0x35e88f[_0xf8e3('0x21')];this[_0xf8e3('0x22')]=_0x35e88f[_0xf8e3('0x22')];this[_0xf8e3('0x23')]=_0x35e88f[_0xf8e3('0x23')];this[_0xf8e3('0x24')]=_0x35e88f['ContactId'];this[_0xf8e3('0x25')]=_0x35e88f[_0xf8e3('0x25')];this[_0xf8e3('0x26')]=_[_0xf8e3('0x4')](_0x35e88f[_0xf8e3('0xd')])?_0x35e88f[_0xf8e3('0x26')]:_0x35e88f[_0xf8e3('0xd')]['id'];this[_0xf8e3('0x27')]=_0x35e88f['VoiceQueueId'];this[_0xf8e3('0x28')]='';this[_0xf8e3('0x29')]='';}Action[_0xf8e3('0x2a')][_0xf8e3('0x2b')]=function(){return util[_0xf8e3('0x2c')](_0xf8e3('0x2d'),this[_0xf8e3('0x10')],this[_0xf8e3('0x2e')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 91b0978..8749424 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 _0x8e3f=['callProgressDetectingCustomer','countnosuchnumberretry','countglobal','emit','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','then','swapAdditionalPhones','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','countnoanswerretry','countcongestionretry','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','checkInBlack','Contact','phone','isNil','Contact\x20is\x20undefined','lookAgent','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','unmonitored','unlock','unlockContact','execRun','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','trim','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','merge','toLowerVariables','variables','[originated][increment]','OriginateError','channel','actionid','logLookAgent','clone','isFailure','response','callProgressDetectingAgent','starttime','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destlinkedid','destuniqueid','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','md5','ioredis','../../../config/environment','preview','../../../config/logger','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','hangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','startPredictive','startProgressive','Trunk','callerid','Interval','stringify','format','voice:queue:%s','name','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','logger','\x20is\x20not\x20active','DEACTIVATED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','setMessage','dialPreviewAutoRecallMe','recallMe','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','clearZombieChannels','info','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','[RecallMe]','logger2','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE'];(function(_0x5408ef,_0x5ce24a){var _0x20aa11=function(_0xe88445){while(--_0xe88445){_0x5408ef['push'](_0x5408ef['shift']());}};_0x20aa11(++_0x5ce24a);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8e3f[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0xf8e3('0x0'));var _=require(_0xf8e3('0x1'));var uuid=require(_0xf8e3('0x2'));var moment=require('moment');var md5=require(_0xf8e3('0x3'));var Redis=require(_0xf8e3('0x4'));var config=require(_0xf8e3('0x5'));var logger=require('../../../config/logger')(_0xf8e3('0x6'));var loggerAction=require(_0xf8e3('0x7'))('actionPreview');var ami=require(_0xf8e3('0x8'));var rpcDb=require(_0xf8e3('0x9'));var cmHopperAdditionalPhone=require(_0xf8e3('0xa'));var Action=require(_0xf8e3('0xb'));var ut=require('./util/util');config[_0xf8e3('0xc')]=_[_0xf8e3('0xd')](config[_0xf8e3('0xc')],{'host':_0xf8e3('0xe'),'port':0x18eb});var io=require(_0xf8e3('0xf'))(new Redis(config[_0xf8e3('0xc')]));var Sequence=function(){};Sequence[_0xf8e3('0x10')][_0xf8e3('0x11')]=function(_0x2d914d){this[_0xf8e3('0x12')]=this[_0xf8e3('0x12')]?this[_0xf8e3('0x12')]['finally'](_0x2d914d):_0x2d914d();};function Preview(_0xb7d14f){this[_0xf8e3('0x13')]=new Sequence();this[_0xf8e3('0x14')]=_0xb7d14f['voiceQueues'];this[_0xf8e3('0x15')]=_0xb7d14f[_0xf8e3('0x15')];this[_0xf8e3('0x16')]={};this[_0xf8e3('0x17')]=_0xb7d14f['agents'];this[_0xf8e3('0x18')]=0x0;ami['on'](_0xf8e3('0x19'),this[_0xf8e3('0x1a')]['bind'](this));ami['on'](_0xf8e3('0x1b'),this['syncHangup'][_0xf8e3('0x1c')](this));ami['on'](_0xf8e3('0x1d'),this[_0xf8e3('0x1e')]['bind'](this));ami['on']('dialend',this[_0xf8e3('0x1f')][_0xf8e3('0x1c')](this));ami['on'](_0xf8e3('0x20'),this[_0xf8e3('0x21')][_0xf8e3('0x1c')](this));ami['on'](_0xf8e3('0x22'),this[_0xf8e3('0x23')][_0xf8e3('0x1c')](this));ami['on'](_0xf8e3('0x24'),this[_0xf8e3('0x25')]['bind'](this));ami['on'](_0xf8e3('0x26'),this[_0xf8e3('0x27')][_0xf8e3('0x1c')](this));this[_0xf8e3('0x28')](this[_0xf8e3('0x14')]);}function emit(_0x11c58e,_0x1cae53,_0x3fff85){io['to'](_0x11c58e)['emit'](_0x1cae53,_0x3fff85);}function emitCampaignPreview(_0xe5102b){if(_0xe5102b[_0xf8e3('0x29')]===_0xf8e3('0x2a')){var _0xccbcc0={'id':_0xe5102b['id'],'name':_0xe5102b['name'],'strategy':_0xe5102b[_0xf8e3('0x2b')],'answered':_0xe5102b['answered'],'available':_0xe5102b[_0xf8e3('0x2c')],'loggedIn':_0xe5102b[_0xf8e3('0x2d')],'pTalking':_0xe5102b[_0xf8e3('0x2e')],'sumBillable':_0xe5102b[_0xf8e3('0x2f')],'sumDuration':_0xe5102b[_0xf8e3('0x30')],'sumHoldTime':_0xe5102b[_0xf8e3('0x31')]||0x0,'talking':_0xe5102b['talking'],'total':_0xe5102b[_0xf8e3('0x32')],'type':_0xe5102b[_0xf8e3('0x29')],'unmanaged':_0xe5102b[_0xf8e3('0x33')],'abandoned':_0xe5102b[_0xf8e3('0x34')],'waiting':_0xe5102b[_0xf8e3('0x35')],'loggedInDb':_0xe5102b[_0xf8e3('0x36')],'dialActive':_0xe5102b[_0xf8e3('0x37')],'dialMethod':_0xe5102b[_0xf8e3('0x38')],'dialOriginateCallerIdName':_0xe5102b['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xe5102b[_0xf8e3('0x39')],'dialOriginateTimeout':_0xe5102b[_0xf8e3('0x3a')],'dialPrefix':_0xe5102b[_0xf8e3('0x3b')],'outboundAnswerAgiCallsDay':_0xe5102b[_0xf8e3('0x3c')],'outboundAnswerCallsDay':_0xe5102b[_0xf8e3('0x3d')],'outboundBlacklistCallsDay':_0xe5102b[_0xf8e3('0x3e')],'outboundBusyCallsDay':_0xe5102b[_0xf8e3('0x3f')],'outboundCongestionCallsDay':_0xe5102b[_0xf8e3('0x40')],'outboundDropCallsDayACS':_0xe5102b['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0xe5102b[_0xf8e3('0x41')],'outboundDropCallsDayTimeout':_0xe5102b[_0xf8e3('0x42')],'outboundNoAnswerCallsDay':_0xe5102b[_0xf8e3('0x43')],'outboundNoSuchCallsDay':_0xe5102b[_0xf8e3('0x44')],'outboundOriginateFailureCallsDay':_0xe5102b['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xe5102b[_0xf8e3('0x45')],'outboundRejectCallsDay':_0xe5102b[_0xf8e3('0x46')],'outboundUnknownCallsDay':_0xe5102b[_0xf8e3('0x47')],'outboundAbandonedCallsDay':_0xe5102b[_0xf8e3('0x48')],'predictiveIntervalAnsweredCalls':_0xe5102b[_0xf8e3('0x49')],'predictiveIntervalAvgHoldtime':_0xe5102b[_0xf8e3('0x4a')],'predictiveIntervalAvgTalktime':_0xe5102b[_0xf8e3('0x4b')],'predictiveIntervalDroppedCallsCallersExit':_0xe5102b[_0xf8e3('0x4c')],'predictiveIntervalDroppedCallsTimeout':_0xe5102b['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0xe5102b[_0xf8e3('0x4d')],'predictiveIntervalErlangCallsDroppedCalls':_0xe5102b[_0xf8e3('0x4e')],'predictiveIntervalHitRate':_0xe5102b['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0xe5102b['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0xe5102b['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xe5102b[_0xf8e3('0x4f')],'predictiveIntervalTotalCalls':_0xe5102b['predictiveIntervalTotalCalls'],'message':_0xe5102b[_0xf8e3('0x50')],'originated':_0xe5102b[_0xf8e3('0x51')],'erlangCalls':_0xe5102b[_0xf8e3('0x52')],'erlangCallToSecond':_0xe5102b[_0xf8e3('0x53')],'erlangAbandonmentRate':_0xe5102b['erlangAbandonmentRate'],'erlangBusyFactor':_0xe5102b['erlangBusyFactor'],'startPredictive':_0xe5102b[_0xf8e3('0x54')],'startProgressive':_0xe5102b[_0xf8e3('0x55')]};if(_0xe5102b[_0xf8e3('0x56')]){_0xccbcc0[_0xf8e3('0x56')]={'id':_0xe5102b[_0xf8e3('0x56')]['id'],'name':_0xe5102b[_0xf8e3('0x56')]['name'],'active':_0xe5102b[_0xf8e3('0x56')]['active'],'callerid':_0xe5102b['Trunk'][_0xf8e3('0x57')]};}if(_0xe5102b[_0xf8e3('0x58')]){_0xccbcc0[_0xf8e3('0x58')]={'id':_0xe5102b[_0xf8e3('0x58')]['id'],'name':_0xe5102b['Interval']['name']};}var _0x41138f=md5(JSON[_0xf8e3('0x59')](_0xccbcc0));if(_0xe5102b['md5']!==_0x41138f){_0xe5102b[_0xf8e3('0x3')]=_0x41138f;emit(util[_0xf8e3('0x5a')](_0xf8e3('0x5b'),_0xccbcc0[_0xf8e3('0x5c')]),'voice_queue:save',_0xccbcc0);}}}function emitVoiceQueueChannelRemove(_0x53cfea){logger['info'](_0xf8e3('0x5d'),JSON[_0xf8e3('0x59')](_0x53cfea));emit(util[_0xf8e3('0x5a')](_0xf8e3('0x5b'),_0x53cfea['name']),_0xf8e3('0x5e'),_0x53cfea);io['emit'](_0xf8e3('0x5f'),_0x53cfea);}function notSendMessagesQueue(_0x336653){if(_0x336653[_0xf8e3('0x60')]){if(_0x336653[_0xf8e3('0x51')]===0x0&&_0x336653[_0xf8e3('0x2e')]===0x0){_0x336653[_0xf8e3('0x60')]=![];_0x336653[_0xf8e3('0x2c')]=0x0;_0x336653[_0xf8e3('0x61')]=0x0;_0x336653[_0xf8e3('0x50')]='NOT_ACTIVE';ut[_0xf8e3('0x62')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x336653[_0xf8e3('0x5c')]+_0xf8e3('0x63'));}else{_0x336653[_0xf8e3('0x50')]=_0xf8e3('0x64');ut[_0xf8e3('0x62')](_0xf8e3('0x65'),_0x336653[_0xf8e3('0x5c')]+_0xf8e3('0x66'));}emitCampaignPreview(_0x336653);}}Preview['prototype'][_0xf8e3('0x28')]=function(){var _0x108b81=this;setInterval(function(){_0x108b81[_0xf8e3('0x67')]();},0x7cf);};Preview[_0xf8e3('0x10')][_0xf8e3('0x67')]=function(){var _0xe7fcb9=this[_0xf8e3('0x14')];this[_0xf8e3('0x18')]+=0x1;for(var _0x5175c0 in _0xe7fcb9){if(_0xe7fcb9['hasOwnProperty'](_0x5175c0)&&(_0xe7fcb9[_0x5175c0]['dialMethod']===_0xf8e3('0x6')||_0xe7fcb9[_0x5175c0][_0xf8e3('0x38')]==='booked')&&_0xe7fcb9[_0x5175c0][_0xf8e3('0x29')]==='outbound'){if(this[_0xf8e3('0x18')]>0x7){this[_0xf8e3('0x18')]=0x0;this['clearZombieChannels']();}}if(_0xe7fcb9[_0xf8e3('0x68')](_0x5175c0)&&_0xe7fcb9[_0x5175c0]['dialMethod']===_0xf8e3('0x6')&&_0xe7fcb9[_0x5175c0][_0xf8e3('0x29')]==='outbound'){if(_0xe7fcb9[_0x5175c0][_0xf8e3('0x37')]){this[_0xf8e3('0x69')](_0xe7fcb9[_0x5175c0]);if(_0xe7fcb9[_0x5175c0][_0xf8e3('0x6a')])this[_0xf8e3('0x6b')](_0xe7fcb9[_0x5175c0]);}else{notSendMessagesQueue(_0xe7fcb9[_0x5175c0]);}}}};Preview['prototype']['clearZombieChannel']=function(_0x59d51e){var _0x299406=this;this[_0xf8e3('0x13')][_0xf8e3('0x11')](function(){if(!_['isNil'](_0x299406[_0xf8e3('0x16')][_0x59d51e])){loggerAction['info'](_0xf8e3('0x6c'),_0x59d51e,_0xf8e3('0x6d'),_0x299406['actions'][_0x59d51e]['queue'],_0xf8e3('0x6e'),JSON[_0xf8e3('0x59')](_0x299406[_0xf8e3('0x14')][_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]][_0xf8e3('0x51')]),_0xf8e3('0x70'),JSON[_0xf8e3('0x59')](_0x299406[_0xf8e3('0x14')][_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]]['pTalking']),JSON[_0xf8e3('0x59')](_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x71')]),JSON[_0xf8e3('0x59')](_[_0xf8e3('0x72')](_0x299406[_0xf8e3('0x16')][_0x59d51e],['contactId',_0xf8e3('0x73'),_0xf8e3('0x74'),_0xf8e3('0x75')])));return ami[_0xf8e3('0x76')]({'action':_0xf8e3('0x77'),'channel':_0x299406[_0xf8e3('0x16')][_0x59d51e]['channel']})[_0xf8e3('0x78')](function(_0x165426){if(_0x165426[_0xf8e3('0x50')]===_0xf8e3('0x79')){setTimeout(function(){if(_0x299406[_0xf8e3('0x16')][_0x59d51e]){ut[_0xf8e3('0x7a')](_0x299406['campaignsPreview'][_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]],_0xf8e3('0x7b'));if(_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x71')]===!![]){ut['decrementTalkink'](_0x299406[_0xf8e3('0x14')][_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]],'[clearZombieChannel]');ut['loggerError'](_0xf8e3('0x7c')+_0x59d51e,_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]);}ut[_0xf8e3('0x7d')]('[Dialer][checkChannel][Preview]'+_0x59d51e,_0x299406[_0xf8e3('0x16')][_0x59d51e][_0xf8e3('0x6f')]);delete _0x299406['actions'][_0x59d51e];}},0x2328);}});}});};Preview['prototype'][_0xf8e3('0x7e')]=function(){var _0x3067a2=this;loggerAction[_0xf8e3('0x7f')]('[action]',_['size'](this['actions']));for(var _0x182e9b in this[_0xf8e3('0x16')]){if(_0x3067a2['actions']['hasOwnProperty'](_0x182e9b)){_0x3067a2['clearZombieChannel'](_0x182e9b);}}};Preview[_0xf8e3('0x10')][_0xf8e3('0x6b')]=function(_0x5368a8){var _0x3c3775=this;rpcDb[_0xf8e3('0x80')](_0x5368a8['id'],ut[_0xf8e3('0x81')](this['agents']))['then'](function(_0x524fbc){if(!_['isNil'](_0x524fbc)){for(var _0x3390a1=0x0;_0x3390a1<_0x524fbc[_0xf8e3('0x82')];_0x3390a1+=0x1){if(ut[_0xf8e3('0x83')](_0x524fbc[_0x3390a1][_0xf8e3('0x84')])<_0x5368a8[_0xf8e3('0x85')]*0x3c){if(_0x524fbc[_0x3390a1][_0xf8e3('0x86')]&&!_0x524fbc[_0x3390a1][_0xf8e3('0x86')][_0xf8e3('0x87')]){_0x3c3775[_0xf8e3('0x88')](_0x524fbc[_0x3390a1]['id'])['then'](ut['logger2'](_0xf8e3('0x89')))[_0xf8e3('0x78')](ut[_0xf8e3('0x8a')]('[RecallMe]'));}else{rpcDb[_0xf8e3('0x8b')](_0x524fbc[_0x3390a1]['id']);}}else{var _0x131c0b=new Action(_0x524fbc[_0x3390a1],_0x5368a8);_0x131c0b['starttime']=moment()['format'](_0xf8e3('0x8c'));_0x5368a8[_0xf8e3('0x45')]+=0x1;ut[_0xf8e3('0x8d')](_0x131c0b,0x17,_0xf8e3('0x8e'));if(_0x5368a8['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xf8e3('0x8f')](_0x524fbc[_0x3390a1]));rpcDb[_0xf8e3('0x90')](_0x131c0b,_0xf8e3('0x91'));}else{ut[_0xf8e3('0x8d')](_0x131c0b,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x131c0b,_0xf8e3('0x92'));rpcDb[_0xf8e3('0x93')](_0x131c0b,'[HistoryRecallClose]');}}}}})[_0xf8e3('0x78')](ut[_0xf8e3('0x8a')](_0xf8e3('0x94')));};Preview[_0xf8e3('0x10')]['setMessage']=function(_0x11ebb2){_0x11ebb2['sendMessageOneNotActive']=!![];if(ut[_0xf8e3('0x95')](_0x11ebb2[_0xf8e3('0x2d')])){_0x11ebb2['message']=_0xf8e3('0x96');}else if(!ut[_0xf8e3('0x97')](_0x11ebb2['dialActive'])){_0x11ebb2[_0xf8e3('0x50')]=_0xf8e3('0x98');}else if(!this[_0xf8e3('0x99')](_0x11ebb2[_0xf8e3('0x56')])){if(!this['isTrunkReachable'](_0x11ebb2[_0xf8e3('0x9a')])){_0x11ebb2[_0xf8e3('0x50')]=_0xf8e3('0x9b');}else{_0x11ebb2[_0xf8e3('0x50')]=_0xf8e3('0x9c');}}else{_0x11ebb2[_0xf8e3('0x50')]=_0xf8e3('0x9c');}emitCampaignPreview(_0x11ebb2);};Preview[_0xf8e3('0x10')][_0xf8e3('0x9d')]=function(_0x29174f,_0x2f169e,_0x21d922){var _0x520ce0=this;var _0x52d91d=this[_0xf8e3('0x16')][_0x2f169e];var _0x32eaab=this['campaignsPreview'][_0x52d91d[_0xf8e3('0x6f')]];var _0x36cc90;var _0x31c16d=![];var _0x21deec=0x2;var _0x18a810=0x3;if(_0x32eaab){switch(_0x21d922){case'1':_0x32eaab['outboundNoSuchCallsDay']+=0x1;_0x52d91d[_0xf8e3('0x9e')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x0,'NoSuchNumber');ami[_0xf8e3('0xa0')]('custom:agentnosuchnumber',ut[_0xf8e3('0xa1')](_0x52d91d,_0xf8e3('0xa2')));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xa3'));_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'0',_0x32eaab)['then'](function(_0x1b03af){_0x31c16d=_0x1b03af[_0xf8e3('0xa5')]==0x1;_0x21deec=_0x32eaab[_0xf8e3('0xa6')];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xac'));}else{if(_0x52d91d[_0xf8e3('0x9e')]>=_0x32eaab[_0xf8e3('0xad')]){rpcDb['createCustomerFinal'](_0x52d91d,_0xf8e3('0xac'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,'countnosuchnumberretry',_0x32eaab[_0xf8e3('0xa6')]),_0x52d91d[_0xf8e3('0xb0')],_0x52d91d[_0xf8e3('0xb1')]);}}delete this[_0xf8e3('0x16')][_0x29174f[_0xf8e3('0xb2')]];}else{_0x52d91d[_0xf8e3('0x9e')]++;logger[_0xf8e3('0x7f')](_0xf8e3('0xb3'),_0x52d91d[_0xf8e3('0x9e')]);logger[_0xf8e3('0x7f')]('id',_0x52d91d[_0xf8e3('0xb4')]);_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d['idContact'],'field':{'countnosuchnumberretry':_0x52d91d[_0xf8e3('0x9e')]}})[_0xf8e3('0xb6')](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case'ANSWER':var _0x4c3316=moment()[_0xf8e3('0x5a')](_0xf8e3('0x8c'));_0x52d91d['responsetime']=_0x4c3316;_0x52d91d['answertime']=_0x4c3316;_0x52d91d[_0xf8e3('0x71')]=!![];_0x32eaab[_0xf8e3('0x2e')]+=0x1;logger['info'](_0xf8e3('0xb8'),_0x52d91d[_0xf8e3('0xb9')],_0xf8e3('0xba'),_0x32eaab[_0xf8e3('0x5c')],_0xf8e3('0x70'),_0x32eaab['pTalking']);ami[_0xf8e3('0xa0')](_0xf8e3('0xbb'),ut['buildObj'](_0x52d91d,'connect',this[_0xf8e3('0x14')][_0x52d91d[_0xf8e3('0x6f')]]));if(_0x32eaab[_0xf8e3('0xbc')]){ami[_0xf8e3('0xa0')](_0xf8e3('0xbd'),ut[_0xf8e3('0xbe')](_0x52d91d));}break;case'16':ami[_0xf8e3('0xa0')](_0xf8e3('0xbf'),ut['buildObj'](_0x52d91d,_0xf8e3('0xc0'),this[_0xf8e3('0x14')][_0x52d91d[_0xf8e3('0x6f')]]));emitVoiceQueueChannelRemove(ut[_0xf8e3('0xa1')](_0x52d91d,_0xf8e3('0xc0')));_0x32eaab[_0xf8e3('0x3d')]+=0x1;_0x32eaab['total']+=0x1;_0x32eaab[_0xf8e3('0xc1')]+=0x1;ut[_0xf8e3('0xc2')](_0x32eaab,_0xf8e3('0xc3'));_0x52d91d['countglobal']=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x4,_0xf8e3('0xc4'));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xc5'));rpcDb[_0xf8e3('0x93')](_0x52d91d,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xf8e3('0xc6')](_0x52d91d);_0x32eaab[_0xf8e3('0x30')]+=_0x52d91d[_0xf8e3('0xc7')];_0x32eaab[_0xf8e3('0x2f')]+=_0x52d91d[_0xf8e3('0xc7')];logger[_0xf8e3('0x7f')](_0xf8e3('0xc8'),_0x52d91d[_0xf8e3('0xb9')],_0xf8e3('0xba'),_0x32eaab['name'],_0xf8e3('0x70'),_0x32eaab[_0xf8e3('0x2e')]);delete this[_0xf8e3('0x16')][_0x29174f[_0xf8e3('0xb2')]];break;case _0xf8e3('0xc9'):_0x32eaab[_0xf8e3('0x3f')]+=0x1;_0x52d91d[_0xf8e3('0xca')]+=0x1;_0x52d91d['countglobal']=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x5,_0xf8e3('0xcb'));_0x21deec=_0x32eaab['dialBusyRetryFrequency'];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];ami[_0xf8e3('0xa0')](_0xf8e3('0xcc'),ut[_0xf8e3('0xa1')](_0x52d91d,_0xf8e3('0xcd')));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xce'));_0x520ce0['verifyAdditionalPhones'](_0x52d91d,'5',_0x32eaab)[_0xf8e3('0xb6')](function(_0x2121f3){_0x31c16d=_0x2121f3[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xcf'));}else{if(_0x52d91d[_0xf8e3('0xca')]>=_0x32eaab[_0xf8e3('0xd0')]){rpcDb['createCustomerFinal'](_0x52d91d,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xf8e3('0xae')](ut['scheduledAt'](_0x52d91d,_0xf8e3('0xca'),_0x32eaab['dialBusyRetryFrequency']),_0x52d91d[_0xf8e3('0xb0')],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d[_0xf8e3('0xca')]++;_0x520ce0['incrementPreviewCounters']({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countbusyretry':_0x52d91d[_0xf8e3('0xca')]}})[_0xf8e3('0xb6')](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case'NOANSWER':_0x32eaab[_0xf8e3('0x43')]+=0x1;_0x52d91d['countnoanswerretry']+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x3,_0xf8e3('0xd1'));_0x21deec=_0x32eaab[_0xf8e3('0xd2')];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];var _0x3afc68=ut['buildNoAnswerEventPayload'](_0x52d91d,_0x32eaab);ami[_0xf8e3('0xa0')](_0xf8e3('0xd3'),_0x3afc68);rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xd4'));_0x520ce0['verifyAdditionalPhones'](_0x52d91d,'3',_0x32eaab)[_0xf8e3('0xb6')](function(_0xb0f5df){_0x31c16d=_0xb0f5df[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x52d91d['countnoanswerretry']>=_0x32eaab[_0xf8e3('0xd5')]){rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xd4'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,_0xf8e3('0xd6'),_0x32eaab[_0xf8e3('0xd2')]),_0x52d91d['unlockAgent'],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d['countnoanswerretry']++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d[_0xf8e3('0xd6')]}})[_0xf8e3('0xb6')](function(){_0x520ce0['swapAdditionalPhones'](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case'CONGESTION':_0x32eaab['outboundCongestionCallsDay']+=0x1;_0x52d91d[_0xf8e3('0xd7')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x8,'Congestion');_0x21deec=_0x32eaab['dialCongestionRetryFrequency'];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];ami[_0xf8e3('0xa0')]('custom:agentcongestion',ut['buildObj'](_0x52d91d,_0xf8e3('0xd8')));rpcDb[_0xf8e3('0x90')](_0x52d91d,'[callProgressDetectingCustomer][logCongestion]');_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'8',_0x32eaab)[_0xf8e3('0xb6')](function(_0x401f10){_0x31c16d=_0x401f10[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,'Global');rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xd9'));}else{if(_0x52d91d['countcongestionretry']>=_0x32eaab[_0xf8e3('0xda')]){rpcDb['createCustomerFinal'](_0x52d91d,_0xf8e3('0xdb'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,'countcongestionretry',_0x32eaab[_0xf8e3('0xdc')]),_0x52d91d['unlockAgent'],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d[_0xf8e3('0xd7')]++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countcongestionretry':_0x52d91d['countcongestionretry']}})['then'](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case _0xf8e3('0xdd'):_0x32eaab[_0xf8e3('0x46')]+=0x1;_0x52d91d[_0xf8e3('0xde')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x14,_0xf8e3('0xdf'));_0x21deec=_0x32eaab[_0xf8e3('0xe0')];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];ami['emit'](_0xf8e3('0xe1'),ut['buildObj'](_0x52d91d,_0xf8e3('0xe2')));rpcDb[_0xf8e3('0x90')](_0x52d91d,'[syncHangupRequest][logAgentReject]');_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'20',_0x32eaab)['then'](function(_0x1ca413){_0x31c16d=_0x1ca413[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut['totalGlobal'](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0x14,'AgentReject');rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xe3'));}else{if(_0x52d91d[_0xf8e3('0xde')]>=_0x32eaab[_0xf8e3('0xe4')]){rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xe3'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,_0xf8e3('0xde'),_0x32eaab[_0xf8e3('0xe0')]),_0x52d91d[_0xf8e3('0xb0')],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d['countnoanswerretry']++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d[_0xf8e3('0xd6')]}})['then'](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case _0xf8e3('0xe5'):_0x32eaab[_0xf8e3('0x48')]+=0x1;_0x52d91d[_0xf8e3('0xe6')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut['logCustomer'](_0x52d91d,0xb,'Abandoned');rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xe7'));_0x520ce0['verifyAdditionalPhones'](_0x52d91d,'11',_0x32eaab)[_0xf8e3('0xb6')](function(_0x34da70){_0x31c16d=_0x34da70['additional']==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x52d91d[_0xf8e3('0xe8')]>=_0x32eaab[_0xf8e3('0xe9')]){rpcDb['createCustomerFinal'](_0x52d91d,_0xf8e3('0xe7'));}else{rpcDb[_0xf8e3('0xae')](ut[_0xf8e3('0xaf')](_0x52d91d,_0xf8e3('0xe6'),_0x32eaab[_0xf8e3('0xea')]),_0x52d91d[_0xf8e3('0xb0')],_0x52d91d[_0xf8e3('0xb1')]);}}}else{_0x52d91d['countnoanswerretry']++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d['countnoanswerretry']}})['then'](function(){_0x520ce0['swapAdditionalPhones'](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});break;case'18':_0x32eaab[_0xf8e3('0x47')]+=0x1;_0x52d91d[_0xf8e3('0xeb')]+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x12,_0x29174f[_0xf8e3('0xec')]||_0x29174f['dialstatus']);ami['emit'](_0xf8e3('0xed'),ut['buildObj'](_0x52d91d,'amd'));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xee'));_0x520ce0['verifyAdditionalPhones'](_0x52d91d,'18',_0x32eaab)[_0xf8e3('0xb6')](function(_0x3df75d){_0x31c16d=_0x3df75d[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0x12,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xee'));}else{rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xee'));}}else{_0x52d91d[_0xf8e3('0xd6')]++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d[_0xf8e3('0xd6')]}})['then'](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});delete this['actions'][_0x29174f[_0xf8e3('0xb2')]];break;case'19':_0x32eaab['outboundUnknownCallsDay']+=0x1;_0x52d91d['countglobal']=ut['totalGlobal'](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0x13,_0x29174f[_0xf8e3('0xec')]||_0x29174f['dialstatus']);ami[_0xf8e3('0xa0')](_0xf8e3('0xed'),ut[_0xf8e3('0xa1')](_0x52d91d,'amd'));rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xef'));_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'18',_0x32eaab)['then'](function(_0x3308d6){_0x31c16d=_0x3308d6[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab['dialGlobalMaxRetry']){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,_0xf8e3('0xab'));rpcDb[_0xf8e3('0x93')](_0x36cc90,_0xf8e3('0xef'));}else{rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xef'));}}else{_0x52d91d['countnoanswerretry']++;_0x520ce0[_0xf8e3('0xb5')]({'id':_0x52d91d[_0xf8e3('0xb4')],'field':{'countnoanswerretry':_0x52d91d['countnoanswerretry']}})[_0xf8e3('0xb6')](function(){_0x520ce0[_0xf8e3('0xb7')](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});});}});delete this[_0xf8e3('0x16')][_0x29174f['linkedid']];break;default:if(_0x52d91d[_0xf8e3('0x71')]){ut['decrementTalkink'](_0x32eaab,_0xf8e3('0xf0'));ut['loggerError'](_0xf8e3('0xf1')+_0x32eaab[_0xf8e3('0x5c')],_0x29174f);}_0x32eaab['outboundUnknownCallsDay']+=0x1;_0x52d91d[_0xf8e3('0x9f')]=ut[_0xf8e3('0xa8')](_0x52d91d);ut[_0xf8e3('0x8d')](_0x52d91d,0xc,_0x29174f[_0xf8e3('0xec')]||_0x29174f[_0xf8e3('0xf2')]);_0x21deec=_0x32eaab[_0xf8e3('0xe0')];_0x18a810=_0x32eaab[_0xf8e3('0xa7')];rpcDb[_0xf8e3('0x90')](_0x52d91d,_0xf8e3('0xf3'));_0x520ce0[_0xf8e3('0xa4')](_0x52d91d,'20',_0x32eaab)[_0xf8e3('0xb6')](function(_0xba6c1a){_0x31c16d=_0xba6c1a[_0xf8e3('0xa5')]==0x1;if(!_0x31c16d){if(ut[_0xf8e3('0xa8')](_0x52d91d)>=_0x32eaab[_0xf8e3('0xa9')]){_0x36cc90=ut[_0xf8e3('0xaa')](_0x52d91d,0xf,'Global');rpcDb[_0xf8e3('0x93')](_0x36cc90,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xf8e3('0x93')](_0x52d91d,_0xf8e3('0xf4'));}delete this['actions'][_0x29174f[_0xf8e3('0xb2')]];}else{_0x520ce0['swapAdditionalPhones'](_0x52d91d,_0x21deec,_0x18a810)[_0xf8e3('0xb6')](function(){});}});}if(!(_0x52d91d[_0xf8e3('0x71')]&&_0x21d922==='16')){ut[_0xf8e3('0x7a')](_0x32eaab,_0xf8e3('0xf5'));logger['info'](_0xf8e3('0xf6'),_0x52d91d[_0xf8e3('0xb9')],_0xf8e3('0xba'),_0x32eaab[_0xf8e3('0x5c')],_0xf8e3('0x6e'),_0x32eaab[_0xf8e3('0x51')]);}if(_0x21d922!=='ANSWER'){delete this[_0xf8e3('0x16')][_0x29174f['linkedid']];delete this['actions'][_0x29174f['destlinkedid']];}}};Preview[_0xf8e3('0x10')]['callProgressDetectingAgent']=function(_0x55b62f,_0x537cf0,_0x17234e){if(_[_0xf8e3('0xf7')](_0x537cf0)&&_0xf8e3('0xf8')!==typeof _0x537cf0){return;}if(_['isUndefined'](_0x17234e)&&_0xf8e3('0xf8')!==typeof _0x17234e){return;}switch(_0x17234e[_0xf8e3('0xf9')]){case'0':ut[_0xf8e3('0xfa')](_0x55b62f,0x0,_0xf8e3('0xfb'));rpcDb[_0xf8e3('0xfc')](_0x55b62f,_0xf8e3('0xfd'));break;case'3':ut[_0xf8e3('0xfa')](_0x55b62f,0x3,_0xf8e3('0xd1'));rpcDb[_0xf8e3('0xfc')](_0x55b62f,_0xf8e3('0xfe'));break;case'5':ut[_0xf8e3('0xfa')](_0x55b62f,0x5,_0xf8e3('0xcb'));rpcDb[_0xf8e3('0xfc')](_0x55b62f,_0xf8e3('0xff'));break;case'8':ut[_0xf8e3('0xfa')](_0x55b62f,0x8,'Congestion');rpcDb[_0xf8e3('0xfc')](_0x55b62f,_0xf8e3('0x100'));break;case'22':ut['logAgent'](_0x55b62f,0x16,_0xf8e3('0x101'));rpcDb['createAgentHistory'](_0x55b62f,_0xf8e3('0x102'));break;default:ut[_0xf8e3('0xfa')](_0x55b62f,0xc,_0x17234e['reason']);rpcDb[_0xf8e3('0xfc')](_0x55b62f,'[callProgressDetectingAgent][logCongestion]');}ut[_0xf8e3('0x7a')](_0x537cf0,_0xf8e3('0x103'));logger[_0xf8e3('0x7f')](_0xf8e3('0x104'),_0x55b62f[_0xf8e3('0xb9')],_0xf8e3('0xba'),_0x537cf0[_0xf8e3('0x5c')],_0xf8e3('0x6e'),_0x537cf0[_0xf8e3('0x51')]);delete this[_0xf8e3('0x16')][_0x55b62f[_0xf8e3('0xb9')]];};Preview[_0xf8e3('0x10')][_0xf8e3('0xa4')]=function(_0x3ac8da,_0x46a1fb,_0xcbbdc1){return Promise[_0xf8e3('0x105')]()['then'](cmHopperAdditionalPhone[_0xf8e3('0xa4')](_0x3ac8da,_0x46a1fb,_0xcbbdc1))[_0xf8e3('0x78')](logger[_0xf8e3('0x7f')](_0xf8e3('0x106')));};Preview[_0xf8e3('0x10')][_0xf8e3('0xb7')]=function(_0x288156,_0x6d719d,_0x167ae0){return Promise[_0xf8e3('0x105')]()[_0xf8e3('0xb6')](cmHopperAdditionalPhone[_0xf8e3('0xb7')](_0x288156,_0x6d719d,_0x167ae0))[_0xf8e3('0x78')](logger[_0xf8e3('0x7f')](_0xf8e3('0x107')));};Preview[_0xf8e3('0x10')]['incrementPreviewCounters']=function(_0x3f4924){return Promise[_0xf8e3('0x105')]()['then'](cmHopperAdditionalPhone[_0xf8e3('0xb5')](_0x3f4924))[_0xf8e3('0x78')](logger[_0xf8e3('0x7f')]('[incrementPreviewCounters]\x20'));};Preview['prototype'][_0xf8e3('0x108')]=function(_0x51f0a2,_0x445091,_0x4e9816,_0x5c146e,_0x31879c){var _0x4b21a6=this;return new Promise(function(_0x40d8aa,_0x39decc){if(_['isNil'](_0x445091)||_['isNil'](_0x445091[_0xf8e3('0x109')])||_['isNil'](_0x445091[_0xf8e3('0x10a')])||_[_0xf8e3('0x10b')](_0x445091[_0xf8e3('0x74')])){_0x39decc(ut['message'](_0xf8e3('0x10c'),_0x5c146e,_0x31879c));return;}var _0x2828d0=uuid['v4']();var _0x33cf45=_0x4b21a6[_0xf8e3('0x14')][_0x445091[_0xf8e3('0x6d')][_0xf8e3('0x5c')]];var _0xe0fb5d=_0x4e9816?_0x4b21a6[_0xf8e3('0x17')][_0x4e9816]['id']:undefined;_0x4b21a6[_0xf8e3('0x16')][_0x2828d0]=new Action(_0x445091,_0x33cf45,_0x2828d0,_0x4e9816,_0xe0fb5d);var _0xe70da7=_0x4b21a6[_0xf8e3('0x16')][_0x2828d0];_0xe70da7[_0xf8e3('0xb0')]=_0x5c146e;_0xe70da7[_0xf8e3('0xb1')]=_0x31879c;_0xe70da7[_0xf8e3('0x10d')]=_0x4e9816;if(_['isEmpty'](_0x51f0a2)){_0x4b21a6['execCall'](_0xe70da7,_0x33cf45,_0x445091,_0x4e9816)[_0xf8e3('0xb6')](function(_0x5aa33b){logger[_0xf8e3('0x7f')](_0xf8e3('0x10e'),'Queue:\x20'+_0xe70da7[_0xf8e3('0x6f')]+_0xf8e3('0x10f')+_0xe70da7[_0xf8e3('0xb4')],JSON[_0xf8e3('0x59')](_0x5aa33b));ami[_0xf8e3('0xa0')](_0xf8e3('0x110'),ut[_0xf8e3('0xa1')](_0xe70da7,_0xf8e3('0x111'),_0x4b21a6[_0xf8e3('0x14')][_0xe70da7['queue']]));_0x40d8aa(ut[_0xf8e3('0x50')](_0xf8e3('0x112')));})['catch'](function(_0x46b4a2){ut[_0xf8e3('0x62')](_0xf8e3('0x113'),_0x46b4a2);_0x39decc(ut['message'](_0xf8e3('0x114'),_0x5c146e,_0x31879c));});}else{_0x33cf45[_0xf8e3('0x3e')]+=0x1;ut[_0xf8e3('0x115')](_0xe70da7);rpcDb[_0xf8e3('0x116')](_0xe70da7,_0xf8e3('0x117'));delete _0x4b21a6['actions'][_0x2828d0];_0x39decc(ut['message'](_0xf8e3('0x118'),_0x5c146e,_0x31879c));}});};Preview['prototype'][_0xf8e3('0x99')]=function(_0x816bd7){return!_[_0xf8e3('0x10b')](_0x816bd7)&&!_['isNil'](_0x816bd7[_0xf8e3('0x5c')])&&!_[_0xf8e3('0x10b')](_0x816bd7[_0xf8e3('0x119')])&&_0x816bd7[_0xf8e3('0x119')]&&!_[_0xf8e3('0x10b')](this['trunks'][util['format'](_0xf8e3('0x11a'),_0x816bd7[_0xf8e3('0x5c')])])&&!_['isNil'](this[_0xf8e3('0x15')][util[_0xf8e3('0x5a')](_0xf8e3('0x11a'),_0x816bd7['name'])][_0xf8e3('0x77')])&&(this[_0xf8e3('0x15')][util[_0xf8e3('0x5a')]('SIP/%s',_0x816bd7['name'])][_0xf8e3('0x77')]==='reachable'||this[_0xf8e3('0x15')][util[_0xf8e3('0x5a')](_0xf8e3('0x11a'),_0x816bd7['name'])]['status']===_0xf8e3('0x11b'));};Preview[_0xf8e3('0x10')][_0xf8e3('0x88')]=function(_0x286e1b,_0x1f9cbf){return this['execRun'](_0x286e1b,_0x1f9cbf)['then'](function(_0x350490){return _[_0xf8e3('0x72')](_0x350490,[_0xf8e3('0x50')]);})['catch'](function(_0x3d76aa){if(_0x3d76aa[_0xf8e3('0x11c')]){rpcDb[_0xf8e3('0x11d')](_0x286e1b);}if(_0x3d76aa['active']){rpcDb[_0xf8e3('0x8b')](_0x286e1b);}throw _[_0xf8e3('0x72')](_0x3d76aa,[_0xf8e3('0x50')]);});};Preview[_0xf8e3('0x10')][_0xf8e3('0x11e')]=function(_0x24a039,_0x5719f5){var _0x4c4aed=this;var _0x5d9e9b,_0x2b9984;return rpcDb['getContactPreview'](_0x24a039)[_0xf8e3('0xb6')](function(_0xc46d04){if(!_[_0xf8e3('0x10b')](_0xc46d04[0x0])){_0x2b9984=_0xc46d04[0x0]['recallme']?![]:!![];_0x5d9e9b=_0xc46d04[0x0]['recallme']?!![]:![];_0x5d9e9b=_0x5719f5?!![]:_0x5d9e9b;}var _0x5c1b30=_0x4c4aed[_0xf8e3('0x11f')](_0xc46d04);if(_0x5c1b30[_0xf8e3('0x120')]){rpcDb[_0xf8e3('0x121')](_['pick'](_0xc46d04[0x0],[_0xf8e3('0x74'),_0xf8e3('0x10a')]))[_0xf8e3('0xb6')](function(_0x1ab9d6){_0x4c4aed[_0xf8e3('0x108')](_0x1ab9d6,_0xc46d04[0x0],_0x5719f5,_0x2b9984,_0x5d9e9b)['then'](function(_0x1d9227){return _0x1d9227;})[_0xf8e3('0x78')](function(_0x26d136){throw _0x26d136;});})[_0xf8e3('0x78')](function(_0x50173c){ut[_0xf8e3('0x62')](_0xf8e3('0x122'),_0x50173c);throw ut['message']('Call\x20unsuccessful',_0x2b9984,_0x5d9e9b);});}else{throw ut[_0xf8e3('0x50')](_0x5c1b30[_0xf8e3('0x50')],_0x2b9984,_0x5d9e9b);}})['catch'](function(_0x157b75){ut[_0xf8e3('0x62')](_0xf8e3('0x123'),_0x157b75);throw ut[_0xf8e3('0x50')]('Call\x20unsuccessful',![],!![]);});};Preview[_0xf8e3('0x10')][_0xf8e3('0x11f')]=function(_0x546ec0){if(_[_0xf8e3('0x10b')](_0x546ec0)||_[_0xf8e3('0x124')](_0x546ec0)||!_[_0xf8e3('0x10b')](_0x546ec0[0x0][_0xf8e3('0x86')])&&_[_0xf8e3('0x10b')](_0x546ec0[0x0][_0xf8e3('0x86')][_0xf8e3('0x5c')])){ut[_0xf8e3('0x62')](_0xf8e3('0x125'),_0x546ec0);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x56c21a=this[_0xf8e3('0x14')][_0x546ec0[0x0]['Queue'][_0xf8e3('0x5c')]];_0x56c21a[_0xf8e3('0x50')]=_0xf8e3('0x9c');if(_[_0xf8e3('0x10b')](_0x56c21a)){ut[_0xf8e3('0x62')](_0xf8e3('0x126'),_0x56c21a);return{'isValid':![],'message':_0xf8e3('0x127')};}if(!this[_0xf8e3('0x99')](_0x56c21a[_0xf8e3('0x56')])){ut[_0xf8e3('0x62')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0xf8e3('0x128')+_0x56c21a[_0xf8e3('0x5c')]+_0xf8e3('0x129'));if(!this[_0xf8e3('0x99')](_0x56c21a[_0xf8e3('0x9a')])){ut['logger'](_0xf8e3('0x12a'),_0x56c21a[_0xf8e3('0x5c')]+_0xf8e3('0x12b'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xf8e3('0x97')](_0x56c21a[_0xf8e3('0x37')])){ut['logger'](_0xf8e3('0x12c'),_0x56c21a['name']+_0xf8e3('0x12d'));return{'isValid':![],'message':_0xf8e3('0x128')+_0x56c21a['name']+_0xf8e3('0x12d')};}return{'isValid':!![],'message':_0xf8e3('0x12e')};};Preview[_0xf8e3('0x10')][_0xf8e3('0x12f')]=function(_0x381500,_0x72280a,_0x5578db,_0x289ae2){var _0x13d3bf=this;return new Promise(function(_0x4ca370,_0x5162db){var _0x4f4979=_0x381500['uniqueid'];var _0x3ea731=_0x13d3bf['isTrunkReachable'](_0x72280a[_0xf8e3('0x56')])?util[_0xf8e3('0x5a')]('SIP/%s/%s%s',_0x72280a[_0xf8e3('0x56')][_0xf8e3('0x5c')],_[_0xf8e3('0x10b')](_0x72280a[_0xf8e3('0x3b')])?'':_0x72280a[_0xf8e3('0x3b')][_0xf8e3('0x130')]()||'',_0x72280a[_0xf8e3('0x131')]>0x0?_0x5578db[_0xf8e3('0x10a')][_0xf8e3('0x132')](_0x72280a[_0xf8e3('0x131')]):_0x5578db[_0xf8e3('0x10a')]):util[_0xf8e3('0x5a')](_0xf8e3('0x133'),_[_0xf8e3('0x10b')](_0x72280a[_0xf8e3('0x9a')])?_0x72280a[_0xf8e3('0x56')][_0xf8e3('0x5c')]:_0x72280a['TrunkBackup']['name'],_[_0xf8e3('0x10b')](_0x72280a[_0xf8e3('0x3b')])?'':_0x72280a['dialPrefix'][_0xf8e3('0x130')]()||'',_0x72280a[_0xf8e3('0x131')]>0x0?_0x5578db[_0xf8e3('0x10a')]['substring'](_0x72280a[_0xf8e3('0x131')]):_0x5578db[_0xf8e3('0x10a')]);var _0x4242d9=_0x13d3bf[_0xf8e3('0x99')](_0x72280a['Trunk'])?ut[_0xf8e3('0x134')](_0x72280a[_0xf8e3('0x56')][_0xf8e3('0x57')],_0x72280a[_0xf8e3('0x135')],_0x72280a['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xf8e3('0x136')](_0x72280a[_0xf8e3('0x39')],_0x72280a[_0xf8e3('0x137')]):_0x72280a[_0xf8e3('0x39')]):ut[_0xf8e3('0x134')](_['isNil'](_0x72280a['TrunkBackup'])?_0x72280a['Trunk']['callerid']:_0x72280a[_0xf8e3('0x9a')]['callerid'],_0x72280a[_0xf8e3('0x135')],_0x72280a[_0xf8e3('0x137')]>0x0?ut['getCallerIdRandom'](_0x72280a[_0xf8e3('0x39')],_0x72280a['dialRandomLastDigitCallerIdNumber']):_0x72280a[_0xf8e3('0x39')]);if(_0x4242d9){_0x381500[_0xf8e3('0x138')]=ut[_0xf8e3('0x139')](_0x4242d9);_0x381500[_0xf8e3('0x13a')]=ut['extractCalleridNumber'](_0x4242d9);}var _0x35659e=ut['addVariables'](_0x72280a,_0x5578db,_0x3ea731,_0x4242d9,_0x4f4979,_0x381500);_[_0xf8e3('0x13b')](_0x381500,ut[_0xf8e3('0x13c')](_0x35659e));_0x381500['starttime']=moment()[_0xf8e3('0x5a')](_0xf8e3('0x8c'));_0x72280a[_0xf8e3('0x13d')]=_0x35659e;ami[_0xf8e3('0x76')](ut['variablesAction'](_0x381500,_0x72280a,_0x35659e,_0x381500[_0xf8e3('0xb1')],_0x289ae2))[_0xf8e3('0xb6')](function(_0x1ead32){_0x72280a[_0xf8e3('0x51')]+=0x1;logger[_0xf8e3('0x7f')](_0xf8e3('0x13e'),_0x4f4979,_0xf8e3('0xba'),_0x72280a['name'],_0xf8e3('0x6e'),_0x72280a['originated']);_0x4ca370(_0x1ead32);})[_0xf8e3('0x78')](function(_0x2fa429){ut[_0xf8e3('0xfa')](_0x381500,0xe,_0xf8e3('0x13f'));rpcDb[_0xf8e3('0xfc')](_0x381500,'[originateFailure][logOriginateFailure]');_0x5162db(_0x2fa429);});});};Preview[_0xf8e3('0x10')][_0xf8e3('0x21')]=function(_0x3eff9c){if(this['actions'][_0x3eff9c[_0xf8e3('0xb2')]]){this[_0xf8e3('0x16')][_0x3eff9c[_0xf8e3('0xb2')]][_0xf8e3('0x140')]=_0x3eff9c[_0xf8e3('0x140')];}};Preview[_0xf8e3('0x10')]['syncOriginateResponse']=function(_0x1fcb2b){var _0x58bc44=this;var _0x40c4f9=this['actions'][_0x1fcb2b[_0xf8e3('0x141')]];if(_0x40c4f9){if(_0x40c4f9[_0xf8e3('0x10d')]&&this['agents'][_0x40c4f9[_0xf8e3('0x10d')]]){ut[_0xf8e3('0x142')](_0x40c4f9,this[_0xf8e3('0x17')][_0x40c4f9['lookAgent']][_0xf8e3('0x5c')],this['agents'][_0x40c4f9['lookAgent']]['id']);}var _0x5cb60d=_[_0xf8e3('0x143')](_0x40c4f9);_0x5cb60d['responsetime']=moment()[_0xf8e3('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4a59a4=_0x58bc44['campaignsPreview'][_0x40c4f9['queue']];if(ut[_0xf8e3('0x144')](_0x1fcb2b[_0xf8e3('0x145')])){if(_0x40c4f9['unlockAgent']){rpcDb[_0xf8e3('0x11d')](_0x40c4f9['idContact']);}if(_0x40c4f9['activeContact']){rpcDb['disableContact'](_0x40c4f9[_0xf8e3('0xb4')]);}ami[_0xf8e3('0xa0')]('custom:agentringnoanswer',ut['buildObj'](_0x40c4f9,'rejected',this['campaignsPreview'][_0x40c4f9[_0xf8e3('0x6f')]]));this[_0xf8e3('0x146')](_0x5cb60d,_0x4a59a4,_0x1fcb2b);}else{_0x40c4f9[_0xf8e3('0x147')]=moment()[_0xf8e3('0x5a')](_0xf8e3('0x8c'));ut[_0xf8e3('0xfa')](_0x5cb60d,0x4,_0xf8e3('0xc4'));rpcDb['createAgentHistory'](_0x5cb60d,_0xf8e3('0x148'));}}};Preview['prototype'][_0xf8e3('0x149')]=function(_0x1b51f5){var _0x3f3b72=this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]];var _0x99b6ef;if(_0x3f3b72){_0x99b6ef=this[_0xf8e3('0x14')][_0x3f3b72[_0xf8e3('0x6f')]];logger[_0xf8e3('0x7f')](_0xf8e3('0x14a'),_0x1b51f5[_0xf8e3('0xb2')],_0xf8e3('0xba'),_0x99b6ef[_0xf8e3('0x5c')],_0xf8e3('0x70'),_0x99b6ef[_0xf8e3('0x2e')]);}if(this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]]&&_0x1b51f5[_0xf8e3('0xb2')]!==_0x1b51f5[_0xf8e3('0xb9')]){if(_0x1b51f5[_0xf8e3('0x14b')]==='16'&&this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]]['dialAnswer']){this[_0xf8e3('0x9d')](_0x1b51f5,_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5[_0xf8e3('0x14b')]);}else if(this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]][_0xf8e3('0x71')]){logger[_0xf8e3('0x7f')](_0xf8e3('0x14c'),_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5['cause'],_0xf8e3('0xba'),_0x99b6ef['name'],'pTalking:\x20',_0x99b6ef[_0xf8e3('0x2e')]);this[_0xf8e3('0x9d')](_0x1b51f5,_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5['cause']);}}else if(_0x3f3b72&&_[_0xf8e3('0x10b')](_0x3f3b72[_0xf8e3('0x14d')])&&_0x99b6ef[_0xf8e3('0x14e')]&&_0x1b51f5[_0xf8e3('0xb2')]===_0x1b51f5[_0xf8e3('0xb9')]&&_[_0xf8e3('0x10b')](_0x1b51f5['reason'])&&_0x1b51f5[_0xf8e3('0x14b')]==='16'&&_0x1b51f5[_0xf8e3('0x14f')]==='6'&&_[_0xf8e3('0xf7')](_0x3f3b72['transfer'])){if(_0x3f3b72[_0xf8e3('0xb0')]){rpcDb[_0xf8e3('0x11d')](_0x3f3b72[_0xf8e3('0xb4')]);}if(_0x3f3b72[_0xf8e3('0xb1')]){rpcDb[_0xf8e3('0x8b')](_0x3f3b72['idContact']);}_0x1b51f5['reason']='22';this[_0xf8e3('0x146')](_0x3f3b72,_0x99b6ef,_0x1b51f5);}else if(_0x3f3b72&&_0x3f3b72[_0xf8e3('0x150')]){if(_0x1b51f5[_0xf8e3('0x14b')]==='16'&&this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]][_0xf8e3('0x71')]){logger[_0xf8e3('0x7f')]('[syncHangup][talking][transfer]',_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5[_0xf8e3('0x14b')],_0xf8e3('0xba'),_0x99b6ef['name'],_0xf8e3('0x70'),_0x99b6ef[_0xf8e3('0x2e')]);this[_0xf8e3('0x9d')](_0x1b51f5,_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5[_0xf8e3('0x14b')]);}else if(this[_0xf8e3('0x16')][_0x1b51f5[_0xf8e3('0xb2')]]['dialAnswer']){logger[_0xf8e3('0x7f')](_0xf8e3('0x14c'),_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5[_0xf8e3('0x14b')],_0xf8e3('0xba'),_0x99b6ef[_0xf8e3('0x5c')],_0xf8e3('0x70'),_0x99b6ef[_0xf8e3('0x2e')]);this['callProgressDetectingCustomer'](_0x1b51f5,_0x1b51f5[_0xf8e3('0xb2')],_0x1b51f5['cause']);}}};Preview[_0xf8e3('0x10')][_0xf8e3('0x1f')]=function(_0x13ff28){if(this[_0xf8e3('0x16')][_0x13ff28[_0xf8e3('0x151')]]&&_0x13ff28[_0xf8e3('0x151')]!==_0x13ff28[_0xf8e3('0x152')]){this[_0xf8e3('0x9d')](_0x13ff28,_0x13ff28['destlinkedid'],_0x13ff28[_0xf8e3('0xf2')]);}};Preview['prototype'][_0xf8e3('0x1e')]=function(_0x130164){if(this[_0xf8e3('0x16')][_0x130164[_0xf8e3('0xb2')]]&&_0x130164[_0xf8e3('0xb2')]!==_0x130164[_0xf8e3('0xb9')]&&!this[_0xf8e3('0x16')][_0x130164[_0xf8e3('0xb2')]][_0xf8e3('0x71')]){if(_0x130164['cause']==='1'){this[_0xf8e3('0x9d')](_0x130164,_0x130164[_0xf8e3('0xb2')],_0x130164[_0xf8e3('0x14b')]);}}};Preview[_0xf8e3('0x10')]['addVariable']=function(_0xd9cdda,_0x5c7e32,_0x1cf9bb){if(this[_0xf8e3('0x16')][_0xd9cdda]){if(_[_0xf8e3('0x10b')](this[_0xf8e3('0x16')][_0xd9cdda]['variables'])){this[_0xf8e3('0x16')][_0xd9cdda][_0xf8e3('0x13d')]={};}this['actions'][_0xd9cdda][_0xf8e3('0x13d')][_0x5c7e32]=_0x1cf9bb;}};Preview[_0xf8e3('0x10')][_0xf8e3('0x23')]=function(_0x720431){try{if(!_[_0xf8e3('0x10b')](_0x720431)){if(ut[_0xf8e3('0x153')](_[_0xf8e3('0x154')](_0x720431[_0xf8e3('0x155')])[0x0])){this[_0xf8e3('0x156')](_0x720431['uniqueid'],_[_0xf8e3('0x154')](_0x720431['variable'])[0x0],_0x720431[_0xf8e3('0x157')]);}}}catch(_0x549b0a){logger[_0xf8e3('0x158')](_0xf8e3('0x159'),util[_0xf8e3('0x15a')](_0x549b0a,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xf8e3('0x25')]=function(_0x2891c3){if(_0x2891c3){if(this[_0xf8e3('0x16')][_0x2891c3[_0xf8e3('0x15b')]]){this[_0xf8e3('0x16')][_0x2891c3[_0xf8e3('0x15b')]][_0xf8e3('0x150')]=!![];}}};Preview[_0xf8e3('0x10')]['syncBlindTransfer']=function(_0x5387a0){if(_0x5387a0){if(this[_0xf8e3('0x16')][_0x5387a0['transfererlinkedid']]){this['actions'][_0x5387a0[_0xf8e3('0x15c')]][_0xf8e3('0x150')]=!![];}}};module[_0xf8e3('0x15d')]=Preview; \ No newline at end of file +var _0x6c65=['countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logAnswerAGI]','reason','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','VoiceQueueId','lookAgent','isEmpty','[Preview][execCall][success]','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','unmonitored','unlock','unlockContact','getContactPreview','recallme','isValid','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialCutDigit','substring','trim','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','toLowerVariables','starttime','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','hangup','hanguprequest','bind','syncDialEnd','newexten','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','type','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','waiting','loggedInDb','dialMethod','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','emit','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','prototype','syncCampaigns','hasOwnProperty','booked','dialActive','setMessage','dialPreviewAutoRecallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking','dialAnswer','pick','contactId','UserId','ListId','Action','status','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','responsetime','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','countbusyretry','dialBusyMaxRetry','activeContact','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialCongestionRetryFrequency','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','outboundRejectCallsDay','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x6c65,0x78));var _0x56c6=function(_0x132787,_0x49aebb){_0x132787=_0x132787-0x0;var _0x281428=_0x6c65[_0x132787];return _0x281428;};'use strict';var util=require(_0x56c6('0x0'));var _=require(_0x56c6('0x1'));var uuid=require(_0x56c6('0x2'));var moment=require(_0x56c6('0x3'));var md5=require(_0x56c6('0x4'));var Redis=require(_0x56c6('0x5'));var config=require('../../../config/environment');var logger=require(_0x56c6('0x6'))(_0x56c6('0x7'));var loggerAction=require(_0x56c6('0x6'))(_0x56c6('0x8'));var ami=require(_0x56c6('0x9'));var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require(_0x56c6('0xa'));var Action=require(_0x56c6('0xb'));var ut=require(_0x56c6('0xc'));config[_0x56c6('0xd')]=_[_0x56c6('0xe')](config['redis'],{'host':_0x56c6('0xf'),'port':0x18eb});var io=require(_0x56c6('0x10'))(new Redis(config[_0x56c6('0xd')]));var Sequence=function(){};Sequence['prototype'][_0x56c6('0x11')]=function(_0x30a2f2){this[_0x56c6('0x12')]=this[_0x56c6('0x12')]?this[_0x56c6('0x12')][_0x56c6('0x13')](_0x30a2f2):_0x30a2f2();};function Preview(_0x5dce6b){this[_0x56c6('0x14')]=new Sequence();this['campaignsPreview']=_0x5dce6b['voiceQueues'];this[_0x56c6('0x15')]=_0x5dce6b[_0x56c6('0x15')];this[_0x56c6('0x16')]={};this[_0x56c6('0x17')]=_0x5dce6b['agents'];this[_0x56c6('0x18')]=0x0;ami['on']('originateresponse',this[_0x56c6('0x19')]['bind'](this));ami['on'](_0x56c6('0x1a'),this['syncHangup']['bind'](this));ami['on'](_0x56c6('0x1b'),this['syncHangupRequest'][_0x56c6('0x1c')](this));ami['on']('dialend',this[_0x56c6('0x1d')]['bind'](this));ami['on'](_0x56c6('0x1e'),this['syncNewExten'][_0x56c6('0x1c')](this));ami['on']('varset',this[_0x56c6('0x1f')][_0x56c6('0x1c')](this));ami['on']('attendedtransfer',this[_0x56c6('0x20')][_0x56c6('0x1c')](this));ami['on'](_0x56c6('0x21'),this[_0x56c6('0x22')]['bind'](this));this[_0x56c6('0x23')](this[_0x56c6('0x24')]);}function emit(_0x413ca7,_0x137570,_0xf2c8d){io['to'](_0x413ca7)['emit'](_0x137570,_0xf2c8d);}function emitCampaignPreview(_0x1cd575){if(_0x1cd575[_0x56c6('0x25')]==='outbound'){var _0x40d7be={'id':_0x1cd575['id'],'name':_0x1cd575['name'],'strategy':_0x1cd575['strategy'],'answered':_0x1cd575[_0x56c6('0x26')],'available':_0x1cd575[_0x56c6('0x27')],'loggedIn':_0x1cd575[_0x56c6('0x28')],'pTalking':_0x1cd575['pTalking'],'sumBillable':_0x1cd575[_0x56c6('0x29')],'sumDuration':_0x1cd575[_0x56c6('0x2a')],'sumHoldTime':_0x1cd575[_0x56c6('0x2b')]||0x0,'talking':_0x1cd575[_0x56c6('0x2c')],'total':_0x1cd575[_0x56c6('0x2d')],'type':_0x1cd575[_0x56c6('0x25')],'unmanaged':_0x1cd575['unmanaged'],'abandoned':_0x1cd575['abandoned'],'waiting':_0x1cd575[_0x56c6('0x2e')],'loggedInDb':_0x1cd575[_0x56c6('0x2f')],'dialActive':_0x1cd575['dialActive'],'dialMethod':_0x1cd575[_0x56c6('0x30')],'dialOriginateCallerIdName':_0x1cd575['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1cd575[_0x56c6('0x31')],'dialOriginateTimeout':_0x1cd575['dialOriginateTimeout'],'dialPrefix':_0x1cd575[_0x56c6('0x32')],'outboundAnswerAgiCallsDay':_0x1cd575['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1cd575[_0x56c6('0x33')],'outboundBlacklistCallsDay':_0x1cd575[_0x56c6('0x34')],'outboundBusyCallsDay':_0x1cd575[_0x56c6('0x35')],'outboundCongestionCallsDay':_0x1cd575[_0x56c6('0x36')],'outboundDropCallsDayACS':_0x1cd575[_0x56c6('0x37')],'outboundDropCallsDayCallersExit':_0x1cd575[_0x56c6('0x38')],'outboundDropCallsDayTimeout':_0x1cd575[_0x56c6('0x39')],'outboundNoAnswerCallsDay':_0x1cd575[_0x56c6('0x3a')],'outboundNoSuchCallsDay':_0x1cd575[_0x56c6('0x3b')],'outboundOriginateFailureCallsDay':_0x1cd575[_0x56c6('0x3c')],'outboundReCallsDay':_0x1cd575[_0x56c6('0x3d')],'outboundRejectCallsDay':_0x1cd575['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1cd575[_0x56c6('0x3e')],'outboundAbandonedCallsDay':_0x1cd575[_0x56c6('0x3f')],'predictiveIntervalAnsweredCalls':_0x1cd575['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1cd575['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1cd575[_0x56c6('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x1cd575['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1cd575[_0x56c6('0x41')],'predictiveIntervalErlangCalls':_0x1cd575['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1cd575[_0x56c6('0x42')],'predictiveIntervalHitRate':_0x1cd575[_0x56c6('0x43')],'predictiveIntervalMultiplicativeFactor':_0x1cd575[_0x56c6('0x44')],'predictiveIntervalPauses':_0x1cd575['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1cd575[_0x56c6('0x45')],'predictiveIntervalTotalCalls':_0x1cd575[_0x56c6('0x46')],'message':_0x1cd575[_0x56c6('0x47')],'originated':_0x1cd575[_0x56c6('0x48')],'erlangCalls':_0x1cd575[_0x56c6('0x49')],'erlangCallToSecond':_0x1cd575[_0x56c6('0x4a')],'erlangAbandonmentRate':_0x1cd575[_0x56c6('0x4b')],'erlangBusyFactor':_0x1cd575[_0x56c6('0x4c')],'startPredictive':_0x1cd575[_0x56c6('0x4d')],'startProgressive':_0x1cd575[_0x56c6('0x4e')]};if(_0x1cd575['Trunk']){_0x40d7be[_0x56c6('0x4f')]={'id':_0x1cd575[_0x56c6('0x4f')]['id'],'name':_0x1cd575['Trunk'][_0x56c6('0x50')],'active':_0x1cd575[_0x56c6('0x4f')][_0x56c6('0x51')],'callerid':_0x1cd575[_0x56c6('0x4f')][_0x56c6('0x52')]};}if(_0x1cd575[_0x56c6('0x53')]){_0x40d7be[_0x56c6('0x53')]={'id':_0x1cd575['Interval']['id'],'name':_0x1cd575[_0x56c6('0x53')][_0x56c6('0x50')]};}var _0x3d6807=md5(JSON[_0x56c6('0x54')](_0x40d7be));if(_0x1cd575[_0x56c6('0x4')]!==_0x3d6807){_0x1cd575[_0x56c6('0x4')]=_0x3d6807;emit(util[_0x56c6('0x55')]('voice:queue:%s',_0x40d7be['name']),_0x56c6('0x56'),_0x40d7be);}}}function emitVoiceQueueChannelRemove(_0x13a927){logger[_0x56c6('0x57')](_0x56c6('0x58'),JSON[_0x56c6('0x54')](_0x13a927));emit(util[_0x56c6('0x55')](_0x56c6('0x59'),_0x13a927[_0x56c6('0x50')]),_0x56c6('0x5a'),_0x13a927);io[_0x56c6('0x5b')]('voice_queue_presence:remove',_0x13a927);}function notSendMessagesQueue(_0x25d0cf){if(_0x25d0cf[_0x56c6('0x5c')]){if(_0x25d0cf[_0x56c6('0x48')]===0x0&&_0x25d0cf['pTalking']===0x0){_0x25d0cf[_0x56c6('0x5c')]=![];_0x25d0cf[_0x56c6('0x27')]=0x0;_0x25d0cf[_0x56c6('0x5d')]=0x0;_0x25d0cf['message']='NOT_ACTIVE';ut[_0x56c6('0x5e')](_0x56c6('0x5f'),_0x25d0cf[_0x56c6('0x50')]+_0x56c6('0x60'));}else{_0x25d0cf[_0x56c6('0x47')]=_0x56c6('0x61');ut[_0x56c6('0x5e')](_0x56c6('0x5f'),_0x25d0cf[_0x56c6('0x50')]+_0x56c6('0x62'));}emitCampaignPreview(_0x25d0cf);}}Preview[_0x56c6('0x63')][_0x56c6('0x23')]=function(){var _0xd6f56d=this;setInterval(function(){_0xd6f56d['syncCampaigns']();},0x7cf);};Preview[_0x56c6('0x63')][_0x56c6('0x64')]=function(){var _0x1e6b10=this['campaignsPreview'];this[_0x56c6('0x18')]+=0x1;for(var _0x2b5232 in _0x1e6b10){if(_0x1e6b10[_0x56c6('0x65')](_0x2b5232)&&(_0x1e6b10[_0x2b5232][_0x56c6('0x30')]===_0x56c6('0x7')||_0x1e6b10[_0x2b5232][_0x56c6('0x30')]===_0x56c6('0x66'))&&_0x1e6b10[_0x2b5232][_0x56c6('0x25')]==='outbound'){if(this[_0x56c6('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x1e6b10[_0x56c6('0x65')](_0x2b5232)&&_0x1e6b10[_0x2b5232][_0x56c6('0x30')]===_0x56c6('0x7')&&_0x1e6b10[_0x2b5232][_0x56c6('0x25')]==='outbound'){if(_0x1e6b10[_0x2b5232][_0x56c6('0x67')]){this[_0x56c6('0x68')](_0x1e6b10[_0x2b5232]);if(_0x1e6b10[_0x2b5232][_0x56c6('0x69')])this['recallMe'](_0x1e6b10[_0x2b5232]);}else{notSendMessagesQueue(_0x1e6b10[_0x2b5232]);}}}};Preview[_0x56c6('0x63')][_0x56c6('0x6a')]=function(_0x2e13c3){var _0xa78010=this;this[_0x56c6('0x14')]['enqueue'](function(){if(!_[_0x56c6('0x6b')](_0xa78010[_0x56c6('0x16')][_0x2e13c3])){loggerAction[_0x56c6('0x57')](_0x56c6('0x6c'),_0x2e13c3,_0x56c6('0x6d'),_0xa78010[_0x56c6('0x16')][_0x2e13c3][_0x56c6('0x6e')],_0x56c6('0x6f'),JSON[_0x56c6('0x54')](_0xa78010[_0x56c6('0x24')][_0xa78010[_0x56c6('0x16')][_0x2e13c3]['queue']][_0x56c6('0x48')]),'pTalking:\x20',JSON[_0x56c6('0x54')](_0xa78010['campaignsPreview'][_0xa78010['actions'][_0x2e13c3][_0x56c6('0x6e')]][_0x56c6('0x70')]),JSON[_0x56c6('0x54')](_0xa78010[_0x56c6('0x16')][_0x2e13c3][_0x56c6('0x71')]),JSON[_0x56c6('0x54')](_[_0x56c6('0x72')](_0xa78010[_0x56c6('0x16')][_0x2e13c3],[_0x56c6('0x73'),_0x56c6('0x74'),'VoiceQueueId',_0x56c6('0x75')])));return ami[_0x56c6('0x76')]({'action':_0x56c6('0x77'),'channel':_0xa78010[_0x56c6('0x16')][_0x2e13c3]['channel']})[_0x56c6('0x78')](function(_0xfcac17){if(_0xfcac17[_0x56c6('0x47')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xa78010[_0x56c6('0x16')][_0x2e13c3]){ut[_0x56c6('0x79')](_0xa78010[_0x56c6('0x24')][_0xa78010[_0x56c6('0x16')][_0x2e13c3]['queue']],_0x56c6('0x7a'));if(_0xa78010[_0x56c6('0x16')][_0x2e13c3][_0x56c6('0x71')]===!![]){ut[_0x56c6('0x7b')](_0xa78010[_0x56c6('0x24')][_0xa78010['actions'][_0x2e13c3]['queue']],_0x56c6('0x7a'));ut[_0x56c6('0x7c')](_0x56c6('0x7d')+_0x2e13c3,_0xa78010[_0x56c6('0x16')][_0x2e13c3][_0x56c6('0x6e')]);}ut[_0x56c6('0x7c')](_0x56c6('0x7e')+_0x2e13c3,_0xa78010[_0x56c6('0x16')][_0x2e13c3]['queue']);delete _0xa78010[_0x56c6('0x16')][_0x2e13c3];}},0x2328);}});}});};Preview['prototype'][_0x56c6('0x7f')]=function(){var _0x5d2a21=this;loggerAction[_0x56c6('0x57')]('[action]',_[_0x56c6('0x80')](this[_0x56c6('0x16')]));for(var _0x6e77af in this[_0x56c6('0x16')]){if(_0x5d2a21[_0x56c6('0x16')][_0x56c6('0x65')](_0x6e77af)){_0x5d2a21['clearZombieChannel'](_0x6e77af);}}};Preview[_0x56c6('0x63')]['recallMe']=function(_0x21a3a9){var _0x498b96=this;rpcDb[_0x56c6('0x81')](_0x21a3a9['id'],ut[_0x56c6('0x82')](this['agents']))[_0x56c6('0x83')](function(_0x4ba03d){if(!_['isNil'](_0x4ba03d)){for(var _0x6ca474=0x0;_0x6ca474<_0x4ba03d[_0x56c6('0x84')];_0x6ca474+=0x1){if(ut[_0x56c6('0x85')](_0x4ba03d[_0x6ca474][_0x56c6('0x86')])<_0x21a3a9[_0x56c6('0x87')]*0x3c){if(_0x4ba03d[_0x6ca474][_0x56c6('0x88')]&&!_0x4ba03d[_0x6ca474]['Agent']['voicePause']){_0x498b96[_0x56c6('0x89')](_0x4ba03d[_0x6ca474]['id'])[_0x56c6('0x83')](ut[_0x56c6('0x8a')](_0x56c6('0x8b')))[_0x56c6('0x78')](ut['logger2'](_0x56c6('0x8b')));}else{rpcDb[_0x56c6('0x8c')](_0x4ba03d[_0x6ca474]['id']);}}else{var _0x393b6d=new Action(_0x4ba03d[_0x6ca474],_0x21a3a9);_0x393b6d['starttime']=moment()[_0x56c6('0x55')](_0x56c6('0x8d'));_0x21a3a9[_0x56c6('0x3d')]+=0x1;ut[_0x56c6('0x8e')](_0x393b6d,0x17,'RecallInQueue');if(_0x21a3a9['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x4ba03d[_0x6ca474]));rpcDb[_0x56c6('0x8f')](_0x393b6d,_0x56c6('0x90'));}else{ut[_0x56c6('0x8e')](_0x393b6d,0x16,_0x56c6('0x91'));rpcDb[_0x56c6('0x8f')](_0x393b6d,_0x56c6('0x92'));rpcDb[_0x56c6('0x93')](_0x393b6d,_0x56c6('0x92'));}}}}})[_0x56c6('0x78')](ut[_0x56c6('0x8a')]('[getContactRecallMe]'));};Preview[_0x56c6('0x63')][_0x56c6('0x68')]=function(_0x18b6ab){_0x18b6ab[_0x56c6('0x5c')]=!![];if(ut['IsNotLoggedIn'](_0x18b6ab[_0x56c6('0x28')])){_0x18b6ab['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x56c6('0x94')](_0x18b6ab[_0x56c6('0x67')])){_0x18b6ab['message']='NOT_ACTIVE';}else if(!this[_0x56c6('0x95')](_0x18b6ab[_0x56c6('0x4f')])){if(!this[_0x56c6('0x95')](_0x18b6ab[_0x56c6('0x96')])){_0x18b6ab['message']=_0x56c6('0x97');}else{_0x18b6ab[_0x56c6('0x47')]='ACTIVE';}}else{_0x18b6ab[_0x56c6('0x47')]=_0x56c6('0x98');}emitCampaignPreview(_0x18b6ab);};Preview['prototype'][_0x56c6('0x99')]=function(_0x1ac17f,_0x559e29,_0x502a42){var _0x51f3ff=this;var _0x2a14b2=this[_0x56c6('0x16')][_0x559e29];var _0xc475f=this[_0x56c6('0x24')][_0x2a14b2[_0x56c6('0x6e')]];var _0x19bd81;var _0xf828ff=![];var _0x244b34=0x2;var _0x42bce7=0x3;if(_0xc475f){switch(_0x502a42){case'1':_0xc475f[_0x56c6('0x3b')]+=0x1;_0x2a14b2['countnosuchnumberretry']+=0x1;_0x2a14b2[_0x56c6('0x9a')]=ut[_0x56c6('0x9b')](_0x2a14b2);ut[_0x56c6('0x8e')](_0x2a14b2,0x0,_0x56c6('0x9c'));ami[_0x56c6('0x5b')](_0x56c6('0x9d'),ut[_0x56c6('0x9e')](_0x2a14b2,_0x56c6('0x9f')));rpcDb[_0x56c6('0x8f')](_0x2a14b2,_0x56c6('0xa0'));_0x51f3ff[_0x56c6('0xa1')](_0x2a14b2,'0',_0xc475f)[_0x56c6('0x83')](function(_0x1f8fdb){_0xf828ff=_0x1f8fdb[_0x56c6('0xa2')]==0x1;_0x244b34=_0xc475f[_0x56c6('0xa3')];_0x42bce7=_0xc475f['callAdditionalPhoneAfterMin'];if(!_0xf828ff){if(ut['totalGlobal'](_0x2a14b2)>=_0xc475f[_0x56c6('0xa4')]){_0x19bd81=ut[_0x56c6('0xa5')](_0x2a14b2,0xf,'Global');rpcDb[_0x56c6('0x93')](_0x19bd81,_0x56c6('0xa6'));}else{if(_0x2a14b2[_0x56c6('0xa7')]>=_0xc475f[_0x56c6('0xa8')]){rpcDb[_0x56c6('0x93')](_0x2a14b2,_0x56c6('0xa6'));}else{rpcDb[_0x56c6('0xa9')](ut[_0x56c6('0xaa')](_0x2a14b2,'countnosuchnumberretry',_0xc475f['dialNoSuchNumberRetryFrequency']),_0x2a14b2[_0x56c6('0xab')],_0x2a14b2['activeContact']);}}delete this[_0x56c6('0x16')][_0x1ac17f['linkedid']];}else{_0x2a14b2[_0x56c6('0xa7')]++;logger[_0x56c6('0x57')](_0x56c6('0xac'),_0x2a14b2[_0x56c6('0xa7')]);logger[_0x56c6('0x57')]('id',_0x2a14b2[_0x56c6('0xad')]);_0x51f3ff[_0x56c6('0xae')]({'id':_0x2a14b2[_0x56c6('0xad')],'field':{'countnosuchnumberretry':_0x2a14b2[_0x56c6('0xa7')]}})[_0x56c6('0x83')](function(){_0x51f3ff[_0x56c6('0xaf')](_0x2a14b2,_0x244b34,_0x42bce7)[_0x56c6('0x83')](function(){});});}});break;case _0x56c6('0xb0'):var _0x3ad321=moment()[_0x56c6('0x55')](_0x56c6('0x8d'));_0x2a14b2[_0x56c6('0xb1')]=_0x3ad321;_0x2a14b2['answertime']=_0x3ad321;_0x2a14b2[_0x56c6('0x71')]=!![];_0xc475f[_0x56c6('0x70')]+=0x1;logger[_0x56c6('0x57')]('[syncHangup][talking][increment]',_0x2a14b2[_0x56c6('0xb2')],_0x56c6('0xb3'),_0xc475f['name'],_0x56c6('0xb4'),_0xc475f[_0x56c6('0x70')]);ami[_0x56c6('0x5b')](_0x56c6('0xb5'),ut[_0x56c6('0x9e')](_0x2a14b2,'connect',this[_0x56c6('0x24')][_0x2a14b2[_0x56c6('0x6e')]]));if(_0xc475f[_0x56c6('0xb6')]){ami[_0x56c6('0x5b')](_0x56c6('0xb7'),ut['buildAcw'](_0x2a14b2));}break;case'16':ami[_0x56c6('0x5b')](_0x56c6('0xb8'),ut[_0x56c6('0x9e')](_0x2a14b2,_0x56c6('0xb9'),this[_0x56c6('0x24')][_0x2a14b2[_0x56c6('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0x56c6('0x9e')](_0x2a14b2,_0x56c6('0xb9')));_0xc475f[_0x56c6('0x33')]+=0x1;_0xc475f[_0x56c6('0x2d')]+=0x1;_0xc475f[_0x56c6('0x26')]+=0x1;ut[_0x56c6('0x7b')](_0xc475f,'[16]');_0x2a14b2[_0x56c6('0x9a')]=ut[_0x56c6('0x9b')](_0x2a14b2);ut[_0x56c6('0x8e')](_0x2a14b2,0x4,_0x56c6('0xba'));rpcDb[_0x56c6('0x8f')](_0x2a14b2,_0x56c6('0xbb'));rpcDb[_0x56c6('0x93')](_0x2a14b2,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x56c6('0xbc')](_0x2a14b2);_0xc475f[_0x56c6('0x2a')]+=_0x2a14b2[_0x56c6('0xbd')];_0xc475f[_0x56c6('0x29')]+=_0x2a14b2['talktime'];logger[_0x56c6('0x57')](_0x56c6('0xbe'),_0x2a14b2[_0x56c6('0xb2')],_0x56c6('0xb3'),_0xc475f[_0x56c6('0x50')],_0x56c6('0xb4'),_0xc475f[_0x56c6('0x70')]);delete this['actions'][_0x1ac17f['linkedid']];break;case _0x56c6('0xbf'):_0xc475f[_0x56c6('0x35')]+=0x1;_0x2a14b2['countbusyretry']+=0x1;_0x2a14b2[_0x56c6('0x9a')]=ut['totalGlobal'](_0x2a14b2);ut['logCustomer'](_0x2a14b2,0x5,_0x56c6('0xc0'));_0x244b34=_0xc475f[_0x56c6('0xc1')];_0x42bce7=_0xc475f[_0x56c6('0xc2')];ami[_0x56c6('0x5b')](_0x56c6('0xc3'),ut['buildObj'](_0x2a14b2,_0x56c6('0xc4')));rpcDb['createCustomerHistory'](_0x2a14b2,_0x56c6('0xc5'));_0x51f3ff[_0x56c6('0xa1')](_0x2a14b2,'5',_0xc475f)[_0x56c6('0x83')](function(_0x234223){_0xf828ff=_0x234223[_0x56c6('0xa2')]==0x1;if(!_0xf828ff){if(ut[_0x56c6('0x9b')](_0x2a14b2)>=_0xc475f[_0x56c6('0xa4')]){_0x19bd81=ut[_0x56c6('0xa5')](_0x2a14b2,0xf,_0x56c6('0xc6'));rpcDb[_0x56c6('0x93')](_0x19bd81,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2a14b2[_0x56c6('0xc7')]>=_0xc475f[_0x56c6('0xc8')]){rpcDb['createCustomerFinal'](_0x2a14b2,_0x56c6('0xc5'));}else{rpcDb[_0x56c6('0xa9')](ut[_0x56c6('0xaa')](_0x2a14b2,_0x56c6('0xc7'),_0xc475f[_0x56c6('0xc1')]),_0x2a14b2[_0x56c6('0xab')],_0x2a14b2[_0x56c6('0xc9')]);}}}else{_0x2a14b2[_0x56c6('0xc7')]++;_0x51f3ff['incrementPreviewCounters']({'id':_0x2a14b2[_0x56c6('0xad')],'field':{'countbusyretry':_0x2a14b2[_0x56c6('0xc7')]}})['then'](function(){_0x51f3ff[_0x56c6('0xaf')](_0x2a14b2,_0x244b34,_0x42bce7)[_0x56c6('0x83')](function(){});});}});break;case _0x56c6('0xca'):_0xc475f[_0x56c6('0x3a')]+=0x1;_0x2a14b2[_0x56c6('0xcb')]+=0x1;_0x2a14b2[_0x56c6('0x9a')]=ut[_0x56c6('0x9b')](_0x2a14b2);ut[_0x56c6('0x8e')](_0x2a14b2,0x3,'NoAnswer');_0x244b34=_0xc475f[_0x56c6('0xcc')];_0x42bce7=_0xc475f[_0x56c6('0xc2')];var _0x4f0d1a=ut['buildNoAnswerEventPayload'](_0x2a14b2,_0xc475f);ami[_0x56c6('0x5b')](_0x56c6('0xcd'),_0x4f0d1a);rpcDb[_0x56c6('0x8f')](_0x2a14b2,_0x56c6('0xce'));_0x51f3ff[_0x56c6('0xa1')](_0x2a14b2,'3',_0xc475f)[_0x56c6('0x83')](function(_0x582ba2){_0xf828ff=_0x582ba2['additional']==0x1;if(!_0xf828ff){if(ut[_0x56c6('0x9b')](_0x2a14b2)>=_0xc475f['dialGlobalMaxRetry']){_0x19bd81=ut[_0x56c6('0xa5')](_0x2a14b2,0xf,_0x56c6('0xc6'));rpcDb[_0x56c6('0x93')](_0x19bd81,_0x56c6('0xcf'));}else{if(_0x2a14b2[_0x56c6('0xcb')]>=_0xc475f[_0x56c6('0xd0')]){rpcDb[_0x56c6('0x93')](_0x2a14b2,_0x56c6('0xce'));}else{rpcDb[_0x56c6('0xa9')](ut[_0x56c6('0xaa')](_0x2a14b2,_0x56c6('0xcb'),_0xc475f[_0x56c6('0xcc')]),_0x2a14b2[_0x56c6('0xab')],_0x2a14b2[_0x56c6('0xc9')]);}}}else{_0x2a14b2['countnoanswerretry']++;_0x51f3ff[_0x56c6('0xae')]({'id':_0x2a14b2['idContact'],'field':{'countnoanswerretry':_0x2a14b2[_0x56c6('0xcb')]}})[_0x56c6('0x83')](function(){_0x51f3ff[_0x56c6('0xaf')](_0x2a14b2,_0x244b34,_0x42bce7)[_0x56c6('0x83')](function(){});});}});break;case'CONGESTION':_0xc475f[_0x56c6('0x36')]+=0x1;_0x2a14b2['countcongestionretry']+=0x1;_0x2a14b2[_0x56c6('0x9a')]=ut[_0x56c6('0x9b')](_0x2a14b2);ut[_0x56c6('0x8e')](_0x2a14b2,0x8,'Congestion');_0x244b34=_0xc475f[_0x56c6('0xd1')];_0x42bce7=_0xc475f[_0x56c6('0xc2')];ami[_0x56c6('0x5b')]('custom:agentcongestion',ut['buildObj'](_0x2a14b2,'congestion'));rpcDb[_0x56c6('0x8f')](_0x2a14b2,_0x56c6('0xd2'));_0x51f3ff['verifyAdditionalPhones'](_0x2a14b2,'8',_0xc475f)['then'](function(_0xdf4168){_0xf828ff=_0xdf4168[_0x56c6('0xa2')]==0x1;if(!_0xf828ff){if(ut['totalGlobal'](_0x2a14b2)>=_0xc475f[_0x56c6('0xa4')]){_0x19bd81=ut[_0x56c6('0xa5')](_0x2a14b2,0xf,_0x56c6('0xc6'));rpcDb[_0x56c6('0x93')](_0x19bd81,_0x56c6('0xd3'));}else{if(_0x2a14b2[_0x56c6('0xd4')]>=_0xc475f[_0x56c6('0xd5')]){rpcDb[_0x56c6('0x93')](_0x2a14b2,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x56c6('0xaa')](_0x2a14b2,_0x56c6('0xd4'),_0xc475f['dialBusyRetryFrequency']),_0x2a14b2[_0x56c6('0xab')],_0x2a14b2['activeContact']);}}}else{_0x2a14b2[_0x56c6('0xd4')]++;_0x51f3ff[_0x56c6('0xae')]({'id':_0x2a14b2['idContact'],'field':{'countcongestionretry':_0x2a14b2[_0x56c6('0xd4')]}})['then'](function(){_0x51f3ff[_0x56c6('0xaf')](_0x2a14b2,_0x244b34,_0x42bce7)['then'](function(){});});}});break;case'CANCEL':_0xc475f[_0x56c6('0xd6')]+=0x1;_0x2a14b2[_0x56c6('0xd7')]+=0x1;_0x2a14b2[_0x56c6('0x9a')]=ut[_0x56c6('0x9b')](_0x2a14b2);ut[_0x56c6('0x8e')](_0x2a14b2,0x14,_0x56c6('0xd8'));_0x244b34=_0xc475f['dialAgentRejectRetryFrequency'];_0x42bce7=_0xc475f[_0x56c6('0xc2')];ami[_0x56c6('0x5b')]('custom:agentreject',ut[_0x56c6('0x9e')](_0x2a14b2,_0x56c6('0xd9')));rpcDb[_0x56c6('0x8f')](_0x2a14b2,_0x56c6('0xda'));_0x51f3ff[_0x56c6('0xa1')](_0x2a14b2,'20',_0xc475f)['then'](function(_0x1b41ea){_0xf828ff=_0x1b41ea[_0x56c6('0xa2')]==0x1;if(!_0xf828ff){if(ut[_0x56c6('0x9b')](_0x2a14b2)>=_0xc475f[_0x56c6('0xa4')]){_0x19bd81=ut[_0x56c6('0xa5')](_0x2a14b2,0x14,_0x56c6('0xd8'));rpcDb['createCustomerFinal'](_0x19bd81,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x2a14b2[_0x56c6('0xd7')]>=_0xc475f[_0x56c6('0xdb')]){rpcDb[_0x56c6('0x93')](_0x2a14b2,_0x56c6('0xdc'));}else{rpcDb['rescheduleContact'](ut[_0x56c6('0xaa')](_0x2a14b2,_0x56c6('0xd7'),_0xc475f[_0x56c6('0xdd')]),_0x2a14b2[_0x56c6('0xab')],_0x2a14b2[_0x56c6('0xc9')]);}}}else{_0x2a14b2[_0x56c6('0xcb')]++;_0x51f3ff[_0x56c6('0xae')]({'id':_0x2a14b2['idContact'],'field':{'countnoanswerretry':_0x2a14b2[_0x56c6('0xcb')]}})[_0x56c6('0x83')](function(){_0x51f3ff[_0x56c6('0xaf')](_0x2a14b2,_0x244b34,_0x42bce7)[_0x56c6('0x83')](function(){});});}});break;case'ABANDONED':_0xc475f[_0x56c6('0x3f')]+=0x1;_0x2a14b2[_0x56c6('0xde')]+=0x1;_0x2a14b2[_0x56c6('0x9a')]=ut[_0x56c6('0x9b')](_0x2a14b2);ut['logCustomer'](_0x2a14b2,0xb,_0x56c6('0xdf'));rpcDb[_0x56c6('0x8f')](_0x2a14b2,_0x56c6('0xe0'));_0x51f3ff['verifyAdditionalPhones'](_0x2a14b2,'11',_0xc475f)[_0x56c6('0x83')](function(_0x124b60){_0xf828ff=_0x124b60['additional']==0x1;if(!_0xf828ff){if(ut[_0x56c6('0x9b')](_0x2a14b2)>=_0xc475f[_0x56c6('0xa4')]){_0x19bd81=ut[_0x56c6('0xa5')](_0x2a14b2,0xf,_0x56c6('0xc6'));rpcDb[_0x56c6('0x93')](_0x19bd81,_0x56c6('0xe0'));}else{if(_0x2a14b2[_0x56c6('0xe1')]>=_0xc475f['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x2a14b2,_0x56c6('0xe0'));}else{rpcDb[_0x56c6('0xa9')](ut[_0x56c6('0xaa')](_0x2a14b2,_0x56c6('0xde'),_0xc475f[_0x56c6('0xe2')]),_0x2a14b2[_0x56c6('0xab')],_0x2a14b2[_0x56c6('0xc9')]);}}}else{_0x2a14b2['countnoanswerretry']++;_0x51f3ff[_0x56c6('0xae')]({'id':_0x2a14b2[_0x56c6('0xad')],'field':{'countnoanswerretry':_0x2a14b2[_0x56c6('0xcb')]}})[_0x56c6('0x83')](function(){_0x51f3ff[_0x56c6('0xaf')](_0x2a14b2,_0x244b34,_0x42bce7)['then'](function(){});});}});break;case'18':_0xc475f[_0x56c6('0x3e')]+=0x1;_0x2a14b2[_0x56c6('0xe3')]+=0x1;_0x2a14b2['countglobal']=ut[_0x56c6('0x9b')](_0x2a14b2);ut[_0x56c6('0x8e')](_0x2a14b2,0x12,_0x1ac17f[_0x56c6('0xe4')]||_0x1ac17f[_0x56c6('0xe5')]);ami[_0x56c6('0x5b')](_0x56c6('0xe6'),ut[_0x56c6('0x9e')](_0x2a14b2,_0x56c6('0xe7')));rpcDb['createCustomerHistory'](_0x2a14b2,_0x56c6('0xe8'));_0x51f3ff[_0x56c6('0xa1')](_0x2a14b2,'18',_0xc475f)['then'](function(_0x10c04e){_0xf828ff=_0x10c04e[_0x56c6('0xa2')]==0x1;if(!_0xf828ff){if(ut[_0x56c6('0x9b')](_0x2a14b2)>=_0xc475f[_0x56c6('0xa4')]){_0x19bd81=ut[_0x56c6('0xa5')](_0x2a14b2,0x12,_0x56c6('0xc6'));rpcDb[_0x56c6('0x93')](_0x19bd81,_0x56c6('0xe8'));}else{rpcDb[_0x56c6('0x93')](_0x2a14b2,_0x56c6('0xe8'));}}else{_0x2a14b2['countnoanswerretry']++;_0x51f3ff[_0x56c6('0xae')]({'id':_0x2a14b2[_0x56c6('0xad')],'field':{'countnoanswerretry':_0x2a14b2[_0x56c6('0xcb')]}})[_0x56c6('0x83')](function(){_0x51f3ff['swapAdditionalPhones'](_0x2a14b2,_0x244b34,_0x42bce7)['then'](function(){});});}});delete this['actions'][_0x1ac17f[_0x56c6('0xe9')]];break;case'19':_0xc475f[_0x56c6('0x3e')]+=0x1;_0x2a14b2[_0x56c6('0x9a')]=ut[_0x56c6('0x9b')](_0x2a14b2);ut[_0x56c6('0x8e')](_0x2a14b2,0x13,_0x1ac17f['cause-txt']||_0x1ac17f['dialstatus']);ami[_0x56c6('0x5b')](_0x56c6('0xe6'),ut[_0x56c6('0x9e')](_0x2a14b2,_0x56c6('0xe7')));rpcDb['createCustomerHistory'](_0x2a14b2,_0x56c6('0xea'));_0x51f3ff['verifyAdditionalPhones'](_0x2a14b2,'18',_0xc475f)[_0x56c6('0x83')](function(_0x4a8094){_0xf828ff=_0x4a8094[_0x56c6('0xa2')]==0x1;if(!_0xf828ff){if(ut[_0x56c6('0x9b')](_0x2a14b2)>=_0xc475f[_0x56c6('0xa4')]){_0x19bd81=ut['cloneAction'](_0x2a14b2,0xf,_0x56c6('0xc6'));rpcDb[_0x56c6('0x93')](_0x19bd81,_0x56c6('0xea'));}else{rpcDb[_0x56c6('0x93')](_0x2a14b2,_0x56c6('0xea'));}}else{_0x2a14b2['countnoanswerretry']++;_0x51f3ff[_0x56c6('0xae')]({'id':_0x2a14b2['idContact'],'field':{'countnoanswerretry':_0x2a14b2[_0x56c6('0xcb')]}})[_0x56c6('0x83')](function(){_0x51f3ff[_0x56c6('0xaf')](_0x2a14b2,_0x244b34,_0x42bce7)[_0x56c6('0x83')](function(){});});}});delete this[_0x56c6('0x16')][_0x1ac17f['linkedid']];break;default:if(_0x2a14b2['dialAnswer']){ut['decrementTalkink'](_0xc475f,'[default]');ut[_0x56c6('0x7c')](_0x56c6('0xeb')+_0xc475f[_0x56c6('0x50')],_0x1ac17f);}_0xc475f[_0x56c6('0x3e')]+=0x1;_0x2a14b2[_0x56c6('0x9a')]=ut[_0x56c6('0x9b')](_0x2a14b2);ut[_0x56c6('0x8e')](_0x2a14b2,0xc,_0x1ac17f[_0x56c6('0xe4')]||_0x1ac17f[_0x56c6('0xe5')]);_0x244b34=_0xc475f[_0x56c6('0xdd')];_0x42bce7=_0xc475f[_0x56c6('0xc2')];rpcDb[_0x56c6('0x8f')](_0x2a14b2,'[callProgressDetectingCustomer][logUnknown]');_0x51f3ff[_0x56c6('0xa1')](_0x2a14b2,'20',_0xc475f)[_0x56c6('0x83')](function(_0x1e64a0){_0xf828ff=_0x1e64a0['additional']==0x1;if(!_0xf828ff){if(ut[_0x56c6('0x9b')](_0x2a14b2)>=_0xc475f['dialGlobalMaxRetry']){_0x19bd81=ut[_0x56c6('0xa5')](_0x2a14b2,0xf,'Global');rpcDb['createCustomerFinal'](_0x19bd81,_0x56c6('0xec'));}else{rpcDb[_0x56c6('0x93')](_0x2a14b2,_0x56c6('0xec'));}delete this[_0x56c6('0x16')][_0x1ac17f['linkedid']];}else{_0x51f3ff['swapAdditionalPhones'](_0x2a14b2,_0x244b34,_0x42bce7)[_0x56c6('0x83')](function(){});}});}if(!(_0x2a14b2[_0x56c6('0x71')]&&_0x502a42==='16')){ut[_0x56c6('0x79')](_0xc475f,_0x56c6('0xed'));logger[_0x56c6('0x57')](_0x56c6('0xee'),_0x2a14b2[_0x56c6('0xb2')],'\x20Queue',_0xc475f['name'],'originated:\x20',_0xc475f[_0x56c6('0x48')]);}if(_0x502a42!==_0x56c6('0xb0')){delete this['actions'][_0x1ac17f['linkedid']];delete this[_0x56c6('0x16')][_0x1ac17f[_0x56c6('0xef')]];}}};Preview[_0x56c6('0x63')][_0x56c6('0xf0')]=function(_0x255ac2,_0x263f53,_0x50bb77){if(_[_0x56c6('0xf1')](_0x263f53)&&'object'!==typeof _0x263f53){return;}if(_['isUndefined'](_0x50bb77)&&_0x56c6('0xf2')!==typeof _0x50bb77){return;}switch(_0x50bb77['reason']){case'0':ut[_0x56c6('0xf3')](_0x255ac2,0x0,_0x56c6('0x9c'));rpcDb['createAgentHistory'](_0x255ac2,_0x56c6('0xf4'));break;case'3':ut[_0x56c6('0xf3')](_0x255ac2,0x3,_0x56c6('0xf5'));rpcDb['createAgentHistory'](_0x255ac2,_0x56c6('0xf6'));break;case'5':ut[_0x56c6('0xf3')](_0x255ac2,0x5,_0x56c6('0xc0'));rpcDb[_0x56c6('0xf7')](_0x255ac2,_0x56c6('0xf8'));break;case'8':ut[_0x56c6('0xf3')](_0x255ac2,0x8,_0x56c6('0xf9'));rpcDb['createAgentHistory'](_0x255ac2,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x56c6('0xf3')](_0x255ac2,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x255ac2,_0x56c6('0xfa'));break;default:ut[_0x56c6('0xf3')](_0x255ac2,0xc,_0x50bb77[_0x56c6('0xfb')]);rpcDb[_0x56c6('0xf7')](_0x255ac2,_0x56c6('0xfc'));}ut[_0x56c6('0x79')](_0x263f53,_0x56c6('0xfd'));logger[_0x56c6('0x57')](_0x56c6('0xfe'),_0x255ac2[_0x56c6('0xb2')],_0x56c6('0xb3'),_0x263f53[_0x56c6('0x50')],_0x56c6('0x6f'),_0x263f53[_0x56c6('0x48')]);delete this['actions'][_0x255ac2['uniqueid']];};Preview[_0x56c6('0x63')][_0x56c6('0xa1')]=function(_0x4742a1,_0x3bc657,_0x1bb54d){return Promise[_0x56c6('0xff')]()[_0x56c6('0x83')](cmHopperAdditionalPhone[_0x56c6('0xa1')](_0x4742a1,_0x3bc657,_0x1bb54d))['catch'](logger[_0x56c6('0x57')](_0x56c6('0x100')));};Preview[_0x56c6('0x63')]['swapAdditionalPhones']=function(_0x570f4b,_0x39769a,_0x201b64){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x56c6('0xaf')](_0x570f4b,_0x39769a,_0x201b64))[_0x56c6('0x78')](logger[_0x56c6('0x57')]('[swapAdditionalPhone]\x20'));};Preview[_0x56c6('0x63')]['incrementPreviewCounters']=function(_0x411b48){return Promise[_0x56c6('0xff')]()['then'](cmHopperAdditionalPhone[_0x56c6('0xae')](_0x411b48))[_0x56c6('0x78')](logger['info'](_0x56c6('0x101')));};Preview[_0x56c6('0x63')][_0x56c6('0x102')]=function(_0xa30677,_0x1eb174,_0x38518f,_0x224faa,_0x151cc1){var _0x1be9d8=this;return new Promise(function(_0x162a42,_0x54e025){if(_[_0x56c6('0x6b')](_0x1eb174)||_['isNil'](_0x1eb174[_0x56c6('0x103')])||_[_0x56c6('0x6b')](_0x1eb174['phone'])||_['isNil'](_0x1eb174[_0x56c6('0x104')])){_0x54e025(ut[_0x56c6('0x47')]('Contact\x20is\x20undefined',_0x224faa,_0x151cc1));return;}var _0x201499=uuid['v4']();var _0x37165e=_0x1be9d8[_0x56c6('0x24')][_0x1eb174['Queue'][_0x56c6('0x50')]];var _0xe0a64a=_0x38518f?_0x1be9d8['agents'][_0x38518f]['id']:undefined;_0x1be9d8[_0x56c6('0x16')][_0x201499]=new Action(_0x1eb174,_0x37165e,_0x201499,_0x38518f,_0xe0a64a);var _0x2c90d9=_0x1be9d8[_0x56c6('0x16')][_0x201499];_0x2c90d9[_0x56c6('0xab')]=_0x224faa;_0x2c90d9[_0x56c6('0xc9')]=_0x151cc1;_0x2c90d9[_0x56c6('0x105')]=_0x38518f;if(_[_0x56c6('0x106')](_0xa30677)){_0x1be9d8['execCall'](_0x2c90d9,_0x37165e,_0x1eb174,_0x38518f)[_0x56c6('0x83')](function(_0x4f3194){logger[_0x56c6('0x57')](_0x56c6('0x107'),'Queue:\x20'+_0x2c90d9[_0x56c6('0x6e')]+'\x20IdHopper:\x20'+_0x2c90d9[_0x56c6('0xad')],JSON[_0x56c6('0x54')](_0x4f3194));ami[_0x56c6('0x5b')]('custom:agentcalled',ut[_0x56c6('0x9e')](_0x2c90d9,_0x56c6('0x108'),_0x1be9d8[_0x56c6('0x24')][_0x2c90d9[_0x56c6('0x6e')]]));_0x162a42(ut[_0x56c6('0x47')](_0x56c6('0x109')));})['catch'](function(_0xb8cf40){ut['logger']('[Preview][execCall][failure]',_0xb8cf40);_0x54e025(ut['message'](_0x56c6('0x10a'),_0x224faa,_0x151cc1));});}else{_0x37165e[_0x56c6('0x34')]+=0x1;ut[_0x56c6('0x10b')](_0x2c90d9);rpcDb[_0x56c6('0x10c')](_0x2c90d9,_0x56c6('0x10d'));delete _0x1be9d8['actions'][_0x201499];_0x54e025(ut[_0x56c6('0x47')]('Contact\x20in\x20black\x20List',_0x224faa,_0x151cc1));}});};Preview[_0x56c6('0x63')][_0x56c6('0x95')]=function(_0x17e4ad){return!_[_0x56c6('0x6b')](_0x17e4ad)&&!_[_0x56c6('0x6b')](_0x17e4ad[_0x56c6('0x50')])&&!_[_0x56c6('0x6b')](_0x17e4ad[_0x56c6('0x51')])&&_0x17e4ad[_0x56c6('0x51')]&&!_[_0x56c6('0x6b')](this[_0x56c6('0x15')][util[_0x56c6('0x55')]('SIP/%s',_0x17e4ad[_0x56c6('0x50')])])&&!_[_0x56c6('0x6b')](this[_0x56c6('0x15')][util[_0x56c6('0x55')]('SIP/%s',_0x17e4ad[_0x56c6('0x50')])]['status'])&&(this[_0x56c6('0x15')][util[_0x56c6('0x55')](_0x56c6('0x10e'),_0x17e4ad[_0x56c6('0x50')])]['status']==='reachable'||this[_0x56c6('0x15')][util[_0x56c6('0x55')](_0x56c6('0x10e'),_0x17e4ad[_0x56c6('0x50')])]['status']===_0x56c6('0x10f'));};Preview['prototype'][_0x56c6('0x89')]=function(_0x31d180,_0xdb3661){return this['execRun'](_0x31d180,_0xdb3661)[_0x56c6('0x83')](function(_0x57006e){return _[_0x56c6('0x72')](_0x57006e,['message']);})[_0x56c6('0x78')](function(_0x407f42){if(_0x407f42[_0x56c6('0x110')]){rpcDb[_0x56c6('0x111')](_0x31d180);}if(_0x407f42['active']){rpcDb[_0x56c6('0x8c')](_0x31d180);}throw _['pick'](_0x407f42,[_0x56c6('0x47')]);});};Preview['prototype']['execRun']=function(_0x308862,_0x35bc86){var _0xc669b5=this;var _0x39445d,_0x234b66;return rpcDb[_0x56c6('0x112')](_0x308862)['then'](function(_0x366e8b){if(!_[_0x56c6('0x6b')](_0x366e8b[0x0])){_0x234b66=_0x366e8b[0x0]['recallme']?![]:!![];_0x39445d=_0x366e8b[0x0][_0x56c6('0x113')]?!![]:![];_0x39445d=_0x35bc86?!![]:_0x39445d;}var _0x513551=_0xc669b5['validateContact'](_0x366e8b);if(_0x513551[_0x56c6('0x114')]){rpcDb['checkIsBlackList'](_[_0x56c6('0x72')](_0x366e8b[0x0],[_0x56c6('0x104'),_0x56c6('0x115')]))[_0x56c6('0x83')](function(_0x9d578a){_0xc669b5[_0x56c6('0x102')](_0x9d578a,_0x366e8b[0x0],_0x35bc86,_0x234b66,_0x39445d)[_0x56c6('0x83')](function(_0x27497c){return _0x27497c;})[_0x56c6('0x78')](function(_0x4aeab8){throw _0x4aeab8;});})[_0x56c6('0x78')](function(_0x329cfc){ut[_0x56c6('0x5e')](_0x56c6('0x116'),_0x329cfc);throw ut[_0x56c6('0x47')](_0x56c6('0x117'),_0x234b66,_0x39445d);});}else{throw ut[_0x56c6('0x47')](_0x513551[_0x56c6('0x47')],_0x234b66,_0x39445d);}})[_0x56c6('0x78')](function(_0x441180){ut[_0x56c6('0x5e')](_0x56c6('0x118'),_0x441180);throw ut[_0x56c6('0x47')](_0x56c6('0x117'),![],!![]);});};Preview['prototype'][_0x56c6('0x119')]=function(_0x3d3d3a){if(_[_0x56c6('0x6b')](_0x3d3d3a)||_[_0x56c6('0x106')](_0x3d3d3a)||!_[_0x56c6('0x6b')](_0x3d3d3a[0x0]['Agent'])&&_[_0x56c6('0x6b')](_0x3d3d3a[0x0][_0x56c6('0x88')][_0x56c6('0x50')])){ut['logger'](_0x56c6('0x11a'),_0x3d3d3a);return{'isValid':![],'message':_0x56c6('0x11b')};}var _0x2dd9b4=this[_0x56c6('0x24')][_0x3d3d3a[0x0][_0x56c6('0x6d')]['name']];_0x2dd9b4['message']=_0x56c6('0x98');if(_[_0x56c6('0x6b')](_0x2dd9b4)){ut['logger'](_0x56c6('0x11c'),_0x2dd9b4);return{'isValid':![],'message':_0x56c6('0x11d')};}if(!this[_0x56c6('0x95')](_0x2dd9b4[_0x56c6('0x4f')])){ut['logger'](_0x56c6('0x11e'),_0x56c6('0x11f')+_0x2dd9b4[_0x56c6('0x50')]+_0x56c6('0x120'));if(!this[_0x56c6('0x95')](_0x2dd9b4[_0x56c6('0x96')])){ut['logger'](_0x56c6('0x11e'),_0x2dd9b4[_0x56c6('0x50')]+_0x56c6('0x121'));return{'isValid':![],'message':_0x56c6('0x122')};}}if(!ut['isActive'](_0x2dd9b4['dialActive'])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x2dd9b4['name']+_0x56c6('0x123'));return{'isValid':![],'message':_0x56c6('0x11f')+_0x2dd9b4['name']+_0x56c6('0x123')};}return{'isValid':!![],'message':_0x56c6('0x124')};};Preview[_0x56c6('0x63')][_0x56c6('0x125')]=function(_0x43bef8,_0x3c9a9f,_0x15b1af,_0x21969d){var _0x5b4bca=this;return new Promise(function(_0x145fff,_0x349b7e){var _0x24ddde=_0x43bef8[_0x56c6('0xb2')];var _0x1698f1=_0x5b4bca[_0x56c6('0x95')](_0x3c9a9f['Trunk'])?util[_0x56c6('0x55')](_0x56c6('0x126'),_0x3c9a9f[_0x56c6('0x4f')][_0x56c6('0x50')],_[_0x56c6('0x6b')](_0x3c9a9f[_0x56c6('0x32')])?'':_0x3c9a9f[_0x56c6('0x32')]['trim']()||'',_0x3c9a9f[_0x56c6('0x127')]>0x0?_0x15b1af[_0x56c6('0x115')][_0x56c6('0x128')](_0x3c9a9f[_0x56c6('0x127')]):_0x15b1af[_0x56c6('0x115')]):util[_0x56c6('0x55')](_0x56c6('0x126'),_[_0x56c6('0x6b')](_0x3c9a9f[_0x56c6('0x96')])?_0x3c9a9f[_0x56c6('0x4f')][_0x56c6('0x50')]:_0x3c9a9f[_0x56c6('0x96')][_0x56c6('0x50')],_[_0x56c6('0x6b')](_0x3c9a9f['dialPrefix'])?'':_0x3c9a9f[_0x56c6('0x32')][_0x56c6('0x129')]()||'',_0x3c9a9f[_0x56c6('0x127')]>0x0?_0x15b1af[_0x56c6('0x115')][_0x56c6('0x128')](_0x3c9a9f[_0x56c6('0x127')]):_0x15b1af['phone']);var _0x4c02b6=_0x5b4bca['isTrunkReachable'](_0x3c9a9f[_0x56c6('0x4f')])?ut[_0x56c6('0x12a')](_0x3c9a9f[_0x56c6('0x4f')][_0x56c6('0x52')],_0x3c9a9f[_0x56c6('0x12b')],_0x3c9a9f[_0x56c6('0x12c')]>0x0?ut[_0x56c6('0x12d')](_0x3c9a9f[_0x56c6('0x31')],_0x3c9a9f['dialRandomLastDigitCallerIdNumber']):_0x3c9a9f['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x56c6('0x6b')](_0x3c9a9f[_0x56c6('0x96')])?_0x3c9a9f[_0x56c6('0x4f')][_0x56c6('0x52')]:_0x3c9a9f[_0x56c6('0x96')][_0x56c6('0x52')],_0x3c9a9f[_0x56c6('0x12b')],_0x3c9a9f['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x56c6('0x12d')](_0x3c9a9f[_0x56c6('0x31')],_0x3c9a9f[_0x56c6('0x12c')]):_0x3c9a9f[_0x56c6('0x31')]);if(_0x4c02b6){_0x43bef8[_0x56c6('0x12e')]=ut[_0x56c6('0x12f')](_0x4c02b6);_0x43bef8[_0x56c6('0x130')]=ut['extractCalleridNumber'](_0x4c02b6);}var _0x56b20c=ut[_0x56c6('0x131')](_0x3c9a9f,_0x15b1af,_0x1698f1,_0x4c02b6,_0x24ddde,_0x43bef8);_['merge'](_0x43bef8,ut[_0x56c6('0x132')](_0x56b20c));_0x43bef8[_0x56c6('0x133')]=moment()[_0x56c6('0x55')](_0x56c6('0x8d'));_0x3c9a9f['variables']=_0x56b20c;ami['Action'](ut['variablesAction'](_0x43bef8,_0x3c9a9f,_0x56b20c,_0x43bef8[_0x56c6('0xc9')],_0x21969d))['then'](function(_0x284672){_0x3c9a9f[_0x56c6('0x48')]+=0x1;logger[_0x56c6('0x57')](_0x56c6('0x134'),_0x24ddde,_0x56c6('0xb3'),_0x3c9a9f[_0x56c6('0x50')],_0x56c6('0x6f'),_0x3c9a9f['originated']);_0x145fff(_0x284672);})[_0x56c6('0x78')](function(_0x4dac9c){ut['logAgent'](_0x43bef8,0xe,_0x56c6('0x135'));rpcDb[_0x56c6('0xf7')](_0x43bef8,_0x56c6('0x136'));_0x349b7e(_0x4dac9c);});});};Preview[_0x56c6('0x63')][_0x56c6('0x137')]=function(_0x2251a4){if(this[_0x56c6('0x16')][_0x2251a4[_0x56c6('0xe9')]]){this[_0x56c6('0x16')][_0x2251a4['linkedid']][_0x56c6('0x138')]=_0x2251a4[_0x56c6('0x138')];}};Preview[_0x56c6('0x63')][_0x56c6('0x19')]=function(_0x5c236f){var _0x4e4e3d=this;var _0x256553=this[_0x56c6('0x16')][_0x5c236f['actionid']];if(_0x256553){if(_0x256553[_0x56c6('0x105')]&&this['agents'][_0x256553[_0x56c6('0x105')]]){ut[_0x56c6('0x139')](_0x256553,this['agents'][_0x256553[_0x56c6('0x105')]][_0x56c6('0x50')],this[_0x56c6('0x17')][_0x256553[_0x56c6('0x105')]]['id']);}var _0x92faa9=_[_0x56c6('0x13a')](_0x256553);_0x92faa9[_0x56c6('0xb1')]=moment()['format'](_0x56c6('0x8d'));var _0x31b509=_0x4e4e3d['campaignsPreview'][_0x256553[_0x56c6('0x6e')]];if(ut[_0x56c6('0x13b')](_0x5c236f[_0x56c6('0x13c')])){if(_0x256553[_0x56c6('0xab')]){rpcDb['unlockContact'](_0x256553['idContact']);}if(_0x256553[_0x56c6('0xc9')]){rpcDb['disableContact'](_0x256553[_0x56c6('0xad')]);}ami[_0x56c6('0x5b')](_0x56c6('0x13d'),ut[_0x56c6('0x9e')](_0x256553,_0x56c6('0x13e'),this[_0x56c6('0x24')][_0x256553[_0x56c6('0x6e')]]));this['callProgressDetectingAgent'](_0x92faa9,_0x31b509,_0x5c236f);}else{_0x256553[_0x56c6('0x133')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut[_0x56c6('0xf3')](_0x92faa9,0x4,_0x56c6('0xba'));rpcDb['createAgentHistory'](_0x92faa9,_0x56c6('0x13f'));}}};Preview['prototype'][_0x56c6('0x140')]=function(_0x271832){var _0x1ce8b1=this[_0x56c6('0x16')][_0x271832['linkedid']];var _0x5977b1;if(_0x1ce8b1){_0x5977b1=this[_0x56c6('0x24')][_0x1ce8b1['queue']];logger[_0x56c6('0x57')](_0x56c6('0x141'),_0x271832[_0x56c6('0xe9')],_0x56c6('0xb3'),_0x5977b1[_0x56c6('0x50')],_0x56c6('0xb4'),_0x5977b1['pTalking']);}if(this['actions'][_0x271832['linkedid']]&&_0x271832[_0x56c6('0xe9')]!==_0x271832[_0x56c6('0xb2')]){if(_0x271832[_0x56c6('0x142')]==='16'&&this[_0x56c6('0x16')][_0x271832['linkedid']][_0x56c6('0x71')]){this[_0x56c6('0x99')](_0x271832,_0x271832[_0x56c6('0xe9')],_0x271832['cause']);}else if(this[_0x56c6('0x16')][_0x271832[_0x56c6('0xe9')]][_0x56c6('0x71')]){logger[_0x56c6('0x57')](_0x56c6('0x143'),_0x271832[_0x56c6('0xe9')],_0x271832[_0x56c6('0x142')],_0x56c6('0xb3'),_0x5977b1[_0x56c6('0x50')],'pTalking:\x20',_0x5977b1['pTalking']);this[_0x56c6('0x99')](_0x271832,_0x271832['linkedid'],_0x271832[_0x56c6('0x142')]);}}else if(_0x1ce8b1&&_[_0x56c6('0x6b')](_0x1ce8b1[_0x56c6('0x144')])&&_0x5977b1[_0x56c6('0x145')]&&_0x271832['linkedid']===_0x271832[_0x56c6('0xb2')]&&_[_0x56c6('0x6b')](_0x271832[_0x56c6('0xfb')])&&_0x271832[_0x56c6('0x142')]==='16'&&_0x271832[_0x56c6('0x146')]==='6'&&_[_0x56c6('0xf1')](_0x1ce8b1['transfer'])){if(_0x1ce8b1[_0x56c6('0xab')]){rpcDb['unlockContact'](_0x1ce8b1[_0x56c6('0xad')]);}if(_0x1ce8b1[_0x56c6('0xc9')]){rpcDb[_0x56c6('0x8c')](_0x1ce8b1[_0x56c6('0xad')]);}_0x271832['reason']='22';this['callProgressDetectingAgent'](_0x1ce8b1,_0x5977b1,_0x271832);}else if(_0x1ce8b1&&_0x1ce8b1['transfer']){if(_0x271832['cause']==='16'&&this['actions'][_0x271832[_0x56c6('0xe9')]]['dialAnswer']){logger['info']('[syncHangup][talking][transfer]',_0x271832['linkedid'],_0x271832[_0x56c6('0x142')],_0x56c6('0xb3'),_0x5977b1[_0x56c6('0x50')],_0x56c6('0xb4'),_0x5977b1[_0x56c6('0x70')]);this['callProgressDetectingCustomer'](_0x271832,_0x271832['linkedid'],_0x271832['cause']);}else if(this['actions'][_0x271832[_0x56c6('0xe9')]][_0x56c6('0x71')]){logger['info'](_0x56c6('0x143'),_0x271832[_0x56c6('0xe9')],_0x271832['cause'],'\x20Queue',_0x5977b1['name'],'pTalking:\x20',_0x5977b1['pTalking']);this[_0x56c6('0x99')](_0x271832,_0x271832[_0x56c6('0xe9')],_0x271832[_0x56c6('0x142')]);}}};Preview['prototype'][_0x56c6('0x1d')]=function(_0x2a5aa7){if(this[_0x56c6('0x16')][_0x2a5aa7['destlinkedid']]&&_0x2a5aa7[_0x56c6('0xef')]!==_0x2a5aa7[_0x56c6('0x147')]){this[_0x56c6('0x99')](_0x2a5aa7,_0x2a5aa7[_0x56c6('0xef')],_0x2a5aa7[_0x56c6('0xe5')]);}};Preview[_0x56c6('0x63')][_0x56c6('0x148')]=function(_0x2fce7c){if(this[_0x56c6('0x16')][_0x2fce7c['linkedid']]&&_0x2fce7c['linkedid']!==_0x2fce7c['uniqueid']&&!this['actions'][_0x2fce7c[_0x56c6('0xe9')]]['dialAnswer']){if(_0x2fce7c[_0x56c6('0x142')]==='1'){this[_0x56c6('0x99')](_0x2fce7c,_0x2fce7c['linkedid'],_0x2fce7c['cause']);}}};Preview[_0x56c6('0x63')][_0x56c6('0x149')]=function(_0x53d120,_0x2fe557,_0x53aaa2){if(this['actions'][_0x53d120]){if(_['isNil'](this['actions'][_0x53d120][_0x56c6('0x14a')])){this['actions'][_0x53d120][_0x56c6('0x14a')]={};}this[_0x56c6('0x16')][_0x53d120][_0x56c6('0x14a')][_0x2fe557]=_0x53aaa2;}};Preview[_0x56c6('0x63')]['syncVarSet']=function(_0x3f8e7e){try{if(!_[_0x56c6('0x6b')](_0x3f8e7e)){if(ut[_0x56c6('0x14b')](_[_0x56c6('0x14c')](_0x3f8e7e[_0x56c6('0x14d')])[0x0])){this[_0x56c6('0x149')](_0x3f8e7e[_0x56c6('0xb2')],_[_0x56c6('0x14c')](_0x3f8e7e[_0x56c6('0x14d')])[0x0],_0x3f8e7e[_0x56c6('0x14e')]);}}}catch(_0x553b75){logger[_0x56c6('0x14f')](_0x56c6('0x150'),util[_0x56c6('0x151')](_0x553b75,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x56c6('0x20')]=function(_0x594b3c){if(_0x594b3c){if(this['actions'][_0x594b3c[_0x56c6('0x152')]]){this[_0x56c6('0x16')][_0x594b3c[_0x56c6('0x152')]][_0x56c6('0x153')]=!![];}}};Preview[_0x56c6('0x63')]['syncBlindTransfer']=function(_0x19d980){if(_0x19d980){if(this[_0x56c6('0x16')][_0x19d980[_0x56c6('0x154')]]){this[_0x56c6('0x16')][_0x19d980[_0x56c6('0x154')]][_0x56c6('0x153')]=!![];}}};module[_0x56c6('0x155')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 60ffe8d..d79280c 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 _0x807b=['queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname'];(function(_0x2678d6,_0x4e2001){var _0x475503=function(_0x34b23d){while(--_0x34b23d){_0x2678d6['push'](_0x2678d6['shift']());}};_0x475503(++_0x4e2001);}(_0x807b,0x1ac));var _0xb807=function(_0x2f8dc3,_0x5b9109){_0x2f8dc3=_0x2f8dc3-0x0;var _0x531ef2=_0x807b[_0x2f8dc3];return _0x531ef2;};'use strict';var util=require(_0xb807('0x0'));var BPromise=require(_0xb807('0x1'));var logger=require(_0xb807('0x2'))(_0xb807('0x3'));var _=require('lodash');var cmHopper=require(_0xb807('0x4'));var cmHopperFinal=require(_0xb807('0x5'));var cmHopperHistory=require(_0xb807('0x6'));var cmHopperBlack=require(_0xb807('0x7'));var voiceQueueRt=require(_0xb807('0x8'));var agentReportPreview=require(_0xb807('0x9'));var voiceQueueReport=require(_0xb807('0xa'));function loggerCatch(_0x58ccc8){return function(_0x49ff7f){logger[_0xb807('0xb')](_0x58ccc8,util[_0xb807('0xc')](_0x49ff7f,{'showHidden':![],'depth':null}));};}function create(_0x54965d){return BPromise['resolve']()[_0xb807('0xd')](cmHopperHistory[_0xb807('0xe')](_0x54965d))[_0xb807('0xf')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x40ceba){return BPromise['resolve']()[_0xb807('0xd')](agentReportPreview[_0xb807('0xe')](_0x40ceba))[_0xb807('0xf')](loggerCatch(_0xb807('0x10')));}function moveContact(_0x184423){return BPromise[_0xb807('0x11')]()[_0xb807('0xd')](cmHopper[_0xb807('0x12')](_0x184423,!![]))['catch'](loggerCatch(_0xb807('0x13')));}exports[_0xb807('0x14')]=function(_0x1034b0){return BPromise[_0xb807('0x11')]()['then'](cmHopperBlack[_0xb807('0x14')](_0x1034b0))[_0xb807('0xf')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x1ad707){return BPromise[_0xb807('0x11')]()[_0xb807('0xd')](cmHopper[_0xb807('0x15')](_0x1ad707))[_0xb807('0xf')](loggerCatch(_0xb807('0x16')));};exports[_0xb807('0xe')]=function(_0x318965,_0x4f4cc9){create(_0x318965)[_0xb807('0xf')](loggerCatch(_0x4f4cc9));moveContact(_0x318965)[_0xb807('0xf')](loggerCatch(_0x4f4cc9));};exports['createAgentHistory']=function(_0x419005,_0x2ad31f){createAgent(_0x419005)[_0xb807('0xf')](loggerCatch(_0x2ad31f));};exports['createCustomerHistory']=function(_0x2cac44,_0x5026f6){create(_0x2cac44)['catch'](loggerCatch(_0x5026f6));};exports['createCustomerFinal']=function(_0x1ee621,_0x2a6e6a){moveContact(_0x1ee621)[_0xb807('0xf')](loggerCatch(_0x2a6e6a));};exports[_0xb807('0x17')]=function(_0x75dfeb,_0x59b3a9,_0x99fb51){if(_0x59b3a9){_0x75dfeb['UserId']=null;}if(_0x99fb51){_0x75dfeb[_0xb807('0x18')]=![];}return BPromise[_0xb807('0x11')]()['then'](cmHopper[_0xb807('0x17')](_0x75dfeb))[_0xb807('0xf')](loggerCatch(_0xb807('0x19')));};exports['countReScheduled']=function(_0x2ae18f){return BPromise['resolve']()[_0xb807('0xd')](cmHopper[_0xb807('0x1a')](_0x2ae18f))[_0xb807('0xf')](loggerCatch(_0xb807('0x1b')));};exports['unlockContact']=function(_0x29ac8b){return BPromise['resolve']()['then'](cmHopper[_0xb807('0x1c')]({'UserId':null},_0x29ac8b,0x1))[_0xb807('0xf')](loggerCatch('[unlockContact]\x20'));};exports[_0xb807('0x1d')]=function(_0xdaae80){return BPromise[_0xb807('0x11')]()['then'](cmHopper[_0xb807('0x1c')]({'active':![]},_0xdaae80,0x1))[_0xb807('0xf')](loggerCatch(_0xb807('0x1e')));};exports[_0xb807('0x1f')]=function(_0x145767){var _0x14891e={};_0x14891e[_0xb807('0x20')]=_0x145767[_0xb807('0x20')];_0x14891e[_0xb807('0x21')]=_0x145767['uniqueid'];_0x14891e[_0xb807('0x22')]=_0x145767[_0xb807('0x22')];_0x14891e[_0xb807('0x23')]=_0x145767[_0xb807('0x23')];_0x14891e[_0xb807('0x24')]=_0x145767[_0xb807('0x24')];_0x14891e[_0xb807('0x25')]=_0x145767[_0xb807('0x26')];_0x14891e[_0xb807('0x27')]=_0x145767[_0xb807('0x26')];_0x14891e[_0xb807('0x28')]=0x1;_0x14891e[_0xb807('0x29')]=_0x145767[_0xb807('0x2a')];_0x14891e[_0xb807('0x2b')]=_0x145767[_0xb807('0x2c')];_0x14891e[_0xb807('0x2d')]=_0xb807('0x2e');_0x14891e[_0xb807('0x2f')]=_0xb807('0x30');_0x14891e['holdtime']=0x0;_0x14891e[_0xb807('0x31')]=0x1;_0x14891e['lastAssignedTo']=_0x145767[_0xb807('0x2c')];_0x14891e[_0xb807('0x32')]=_0xb807('0x33');return BPromise['resolve']()[_0xb807('0xd')](voiceQueueReport[_0xb807('0x34')](_0x14891e))[_0xb807('0xf')](loggerCatch(_0xb807('0x35')));};exports[_0xb807('0x36')]=function(_0x4e7c2b,_0x385e3e){return BPromise[_0xb807('0x11')]()[_0xb807('0xd')](cmHopper['getContactRecallMe'](_0x4e7c2b,_0x385e3e))[_0xb807('0xf')](loggerCatch(_0xb807('0x37')));};exports[_0xb807('0x38')]=function(_0x2e4257){return BPromise['resolve']()[_0xb807('0xd')](cmHopper[_0xb807('0x17')](_0x2e4257,!![],!![]))['catch'](loggerCatch(_0xb807('0x39')));}; \ No newline at end of file +var _0xaa6e=['[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','catch','[createHistory]\x20','resolve','moveContactManagedDialer','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xaa6e,0x123));var _0xeaa6=function(_0x47dec1,_0x460fd3){_0x47dec1=_0x47dec1-0x0;var _0xbbbf3=_0xaa6e[_0x47dec1];return _0xbbbf3;};'use strict';var util=require(_0xeaa6('0x0'));var BPromise=require(_0xeaa6('0x1'));var logger=require(_0xeaa6('0x2'))('preview');var _=require(_0xeaa6('0x3'));var cmHopper=require(_0xeaa6('0x4'));var cmHopperFinal=require(_0xeaa6('0x5'));var cmHopperHistory=require(_0xeaa6('0x6'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xeaa6('0x7'));var agentReportPreview=require(_0xeaa6('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x4fb054){return function(_0x135a5d){logger[_0xeaa6('0x9')](_0x4fb054,util[_0xeaa6('0xa')](_0x135a5d,{'showHidden':![],'depth':null}));};}function create(_0x315322){return BPromise['resolve']()[_0xeaa6('0xb')](cmHopperHistory['createHistory'](_0x315322))[_0xeaa6('0xc')](loggerCatch(_0xeaa6('0xd')));}function createAgent(_0x544866){return BPromise[_0xeaa6('0xe')]()[_0xeaa6('0xb')](agentReportPreview['createHistory'](_0x544866))[_0xeaa6('0xc')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4f567c){return BPromise[_0xeaa6('0xe')]()[_0xeaa6('0xb')](cmHopper[_0xeaa6('0xf')](_0x4f567c,!![]))[_0xeaa6('0xc')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xeaa6('0x10')]=function(_0xcafd48){return BPromise[_0xeaa6('0xe')]()['then'](cmHopperBlack[_0xeaa6('0x10')](_0xcafd48))[_0xeaa6('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x29d4c6){return BPromise[_0xeaa6('0xe')]()['then'](cmHopper[_0xeaa6('0x11')](_0x29d4c6))[_0xeaa6('0xc')](loggerCatch(_0xeaa6('0x12')));};exports[_0xeaa6('0x13')]=function(_0x1294dd,_0x31b7e3){create(_0x1294dd)[_0xeaa6('0xc')](loggerCatch(_0x31b7e3));moveContact(_0x1294dd)[_0xeaa6('0xc')](loggerCatch(_0x31b7e3));};exports[_0xeaa6('0x14')]=function(_0x5d846f,_0xdc7e89){createAgent(_0x5d846f)[_0xeaa6('0xc')](loggerCatch(_0xdc7e89));};exports[_0xeaa6('0x15')]=function(_0x5a90d0,_0x175e3d){create(_0x5a90d0)[_0xeaa6('0xc')](loggerCatch(_0x175e3d));};exports[_0xeaa6('0x16')]=function(_0x8891b9,_0x192de6){moveContact(_0x8891b9)[_0xeaa6('0xc')](loggerCatch(_0x192de6));};exports[_0xeaa6('0x17')]=function(_0xecec35,_0x4e4f26,_0x458ebf){if(_0x4e4f26){_0xecec35['UserId']=null;}if(_0x458ebf){_0xecec35[_0xeaa6('0x18')]=![];}return BPromise[_0xeaa6('0xe')]()['then'](cmHopper[_0xeaa6('0x17')](_0xecec35))['catch'](loggerCatch(_0xeaa6('0x19')));};exports[_0xeaa6('0x1a')]=function(_0xb0e282){return BPromise[_0xeaa6('0xe')]()[_0xeaa6('0xb')](cmHopper[_0xeaa6('0x1a')](_0xb0e282))[_0xeaa6('0xc')](loggerCatch(_0xeaa6('0x1b')));};exports[_0xeaa6('0x1c')]=function(_0x36a02c){return BPromise[_0xeaa6('0xe')]()[_0xeaa6('0xb')](cmHopper[_0xeaa6('0x1c')]({'UserId':null},_0x36a02c,0x1))['catch'](loggerCatch('[unlockContact]\x20'));};exports[_0xeaa6('0x1d')]=function(_0xefff8f){return BPromise[_0xeaa6('0xe')]()['then'](cmHopper[_0xeaa6('0x1c')]({'active':![]},_0xefff8f,0x1))[_0xeaa6('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xeaa6('0x1e')]=function(_0xa5108b){var _0x4c1a9c={};_0x4c1a9c[_0xeaa6('0x1f')]=_0xa5108b[_0xeaa6('0x1f')];_0x4c1a9c['uniqueid']=_0xa5108b[_0xeaa6('0x20')];_0x4c1a9c[_0xeaa6('0x21')]=_0xa5108b[_0xeaa6('0x21')];_0x4c1a9c[_0xeaa6('0x22')]=_0xa5108b[_0xeaa6('0x22')];_0x4c1a9c[_0xeaa6('0x23')]=_0xa5108b[_0xeaa6('0x23')];_0x4c1a9c[_0xeaa6('0x24')]=_0xa5108b[_0xeaa6('0x25')];_0x4c1a9c[_0xeaa6('0x26')]=_0xa5108b[_0xeaa6('0x25')];_0x4c1a9c[_0xeaa6('0x27')]=0x1;_0x4c1a9c[_0xeaa6('0x28')]=_0xa5108b[_0xeaa6('0x29')];_0x4c1a9c[_0xeaa6('0x2a')]=_0xa5108b[_0xeaa6('0x2b')];_0x4c1a9c[_0xeaa6('0x2c')]=_0xeaa6('0x2d');_0x4c1a9c[_0xeaa6('0x2e')]=_0xeaa6('0x2f');_0x4c1a9c[_0xeaa6('0x30')]=0x0;_0x4c1a9c[_0xeaa6('0x31')]=0x1;_0x4c1a9c[_0xeaa6('0x32')]=_0xa5108b[_0xeaa6('0x2b')];_0x4c1a9c[_0xeaa6('0x33')]=_0xeaa6('0x34');return BPromise[_0xeaa6('0xe')]()[_0xeaa6('0xb')](voiceQueueReport[_0xeaa6('0x35')](_0x4c1a9c))[_0xeaa6('0xc')](loggerCatch(_0xeaa6('0x36')));};exports[_0xeaa6('0x37')]=function(_0x31e17a,_0x1ac335){return BPromise['resolve']()['then'](cmHopper[_0xeaa6('0x37')](_0x31e17a,_0x1ac335))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xeaa6('0x38')]=function(_0x1a3065){return BPromise[_0xeaa6('0xe')]()['then'](cmHopper[_0xeaa6('0x17')](_0x1a3065,!![],!![]))['catch'](loggerCatch(_0xeaa6('0x39')));}; \ 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 9f71022..9d26e74 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 _0x21d4=['type','campaigntype','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','inspect','logger','info','loggerError','logger2','getCallerId','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','Contact','createdAt','%s%s','toUpper','hasOwnProperty','toLower','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','YYYY-MM-DD\x20HH:mm:ss','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','add','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','name','queue','interface','motionChannel','mandatoryDisposition','buildObj','buildAcw','agentReadyId','status','reachable','getDiff','createBody','CampaignId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21d4,0x13b));var _0x421d=function(_0x3ed045,_0x59ed0b){_0x3ed045=_0x3ed045-0x0;var _0x27d89a=_0x21d4[_0x3ed045];return _0x27d89a;};'use strict';var util=require(_0x421d('0x0'));var _=require(_0x421d('0x1'));var moment=require('moment');var logger=require(_0x421d('0x2'))(_0x421d('0x3'));var ipAgi=process[_0x421d('0x4')][_0x421d('0x5')]||_0x421d('0x6');function getSeconds(_0xec58f8,_0x11a206){var _0x2310fe=moment(_0xec58f8)[_0x421d('0x7')](0x0);var _0x35d31d=moment(_0x11a206)[_0x421d('0x7')](0x0);return _0x2310fe[_0x421d('0x8')](_0x35d31d,_0x421d('0x9'));}exports['loggerCatch']=function(_0x402e44){return function(_0x1ae7ee){logger['error'](_0x402e44,util[_0x421d('0xa')](_0x1ae7ee,{'showHidden':![],'depth':null}));};};exports[_0x421d('0xb')]=function(_0xd1f029,_0x5a8a0b){logger[_0x421d('0xc')](_0xd1f029,util[_0x421d('0xa')](_0x5a8a0b,{'showHidden':![],'depth':null}));};exports[_0x421d('0xd')]=function(_0x2c073f,_0x3928d3){logger['error'](_0x2c073f,util[_0x421d('0xa')](_0x3928d3,{'showHidden':![],'depth':null}));};exports[_0x421d('0xe')]=function(_0x5bcc31){return function(_0x43f362){logger['info'](_0x5bcc31,util['inspect'](_0x43f362,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x267366,_0x2e7c2f,_0x9cc8be){return{'message':_0x267366,'unlock':_0x2e7c2f,'active':_0x9cc8be};};exports[_0x421d('0xf')]=function(_0x386fde,_0x26538b,_0x5e9120){if(!_['isUndefined'](_0x5e9120)&&'string'===typeof _0x5e9120&&!_['isEmpty'](_0x5e9120)){if(!_['isUndefined'](_0x26538b)&&'string'===typeof _0x26538b&&!_[_0x421d('0x10')](_0x26538b)){return util[_0x421d('0x11')](_0x421d('0x12'),_0x26538b,_0x5e9120);}return util[_0x421d('0x11')](_0x421d('0x12'),_0x5e9120,_0x5e9120);}if(!_['isUndefined'](_0x386fde)&&'string'===typeof _0x386fde&&!_[_0x421d('0x10')](_0x386fde)){return _0x386fde;}return _0x421d('0x13');};exports[_0x421d('0x14')]=function(_0x379191){if(_[_0x421d('0x15')](_0x379191)){return![];}return _0x379191;};exports[_0x421d('0x16')]=function(_0x5559ab,_0x161f1d,_0xff484e,_0x4d2dc6,_0x16b11a,_0x12353c){var _0x708aed={'XMD-QUEUE':_0x161f1d[_0x421d('0x17')]?_0x161f1d[_0x421d('0x17')]['name']:'','XMD-CALLERID':_0x4d2dc6,'XMD-CALLERID-PREVIEW':_0x12353c?util[_0x421d('0x11')](_0x421d('0x12'),_0x12353c[_0x421d('0x18')],_0x12353c['calleridnum']):_0x4d2dc6,'XMD-DIALID':_0x16b11a,'XMD-CONTACTID':_0x161f1d[_0x421d('0x19')],'XMD-CDRTYPE':_0x421d('0x1a'),'CALLERID(all)':_0x4d2dc6,'XMD-VOICEQUEUEID':_0x161f1d['VoiceQueueId'],'XMD-DIALCHANNEL':_0xff484e,'XMD-DIALTIMEOUT':_0x5559ab[_0x421d('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x421d('0x11')](_0x421d('0x1c'),_0x5559ab['dialQueueProject2']?'g':'',_[_0x421d('0x10')](_0x5559ab[_0x421d('0x1d')])?'':_0x421d('0x1e')),'XMD-DIALURL':_0x5559ab[_0x421d('0x1f')]||'','XMD-AGI':_0x5559ab[_0x421d('0x20')]?util['format'](_0x421d('0x21'),ipAgi,_0x5559ab[_0x421d('0x20')]):_0x421d('0x22'),'XMD-AGIAFTER':_0x5559ab['dialQueueProject2']?util['format'](_0x421d('0x21'),ipAgi,_0x5559ab['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x12353c?_0x12353c[_0x421d('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x12353c?_0x12353c[_0x421d('0x24')]:'','XMD-DESTINATION':_0x421d('0x25'),'SIPADDHEADER':_0x421d('0x26')};if(!_[_0x421d('0x10')](_0x5559ab[_0x421d('0x1d')])){_0x708aed[util[_0x421d('0x11')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5559ab[_0x421d('0x1d')];_0x708aed[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x16b11a;}if(_0x161f1d&&_0x161f1d['Contact']){for(var _0x58a529 in _0x161f1d['Contact']){if(_0x161f1d[_0x421d('0x27')]['hasOwnProperty'](_0x58a529)){if(!_['isNil'](_0x161f1d['Contact'][_0x58a529])&&_0x58a529!=='id'&&_0x58a529!=='tags'&&_0x58a529!==_0x421d('0x28')&&_0x58a529!=='updatedAt'){_0x708aed[util['format'](_0x421d('0x29'),'XMD-',_[_0x421d('0x2a')](_0x58a529))]=_0x161f1d[_0x421d('0x27')][_0x58a529];}}}}return _0x708aed;};exports['toLowerVariables']=function(_0x1770ce){var _0x5c5686={};for(var _0x436c1b in _0x1770ce){if(_0x1770ce[_0x421d('0x2b')](_0x436c1b)){_0x5c5686[util[_0x421d('0x11')]('%s',_[_0x421d('0x2c')](_0x436c1b))]=_0x1770ce[_0x436c1b];}}return{'variables':_0x5c5686};};exports['updateOriginated']=function(_0x5dd672,_0x463989){if(!_[_0x421d('0x15')](_0x5dd672)){if(_0x5dd672[_0x421d('0x2b')](_0x421d('0x2d'))){if(_0x5dd672[_0x421d('0x2d')]>0x0){_0x5dd672[_0x421d('0x2d')]-=0x1;}else{logger[_0x421d('0x2e')](_0x421d('0x2f'),_0x463989);}}}else{logger[_0x421d('0x2e')](_0x421d('0x30'),_0x463989);}};exports[_0x421d('0x31')]=function(_0x400437){var _0x48125c=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x400437[_0x421d('0x32')]=0xd;_0x400437[_0x421d('0x33')]=_0x421d('0x34');_0x400437['starttime']=_0x48125c;_0x400437[_0x421d('0x35')]=_0x48125c;_0x400437[_0x421d('0x36')]=_0x48125c;};exports[_0x421d('0x37')]=function(_0x112b44,_0x4db0e6,_0x49821e){var _0x33648f=moment()[_0x421d('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x112b44[_0x421d('0x32')]=_0x4db0e6;_0x112b44[_0x421d('0x33')]=_0x49821e;_0x112b44[_0x421d('0x35')]=_0x33648f;_0x112b44[_0x421d('0x38')]=getSeconds(_0x112b44[_0x421d('0x35')],_0x112b44[_0x421d('0x39')]);};exports[_0x421d('0x3a')]=function(_0x5a337a,_0x55a8f1,_0xfbdf06){_0x5a337a[_0x421d('0x3b')]=_0x55a8f1;_0x5a337a[_0x421d('0x3c')]=_0xfbdf06;};exports[_0x421d('0x3d')]=function(_0x3ebbdb,_0x3836d3,_0x257303){var _0x393ae2=moment()[_0x421d('0x11')](_0x421d('0x3e'));_0x3ebbdb[_0x421d('0x32')]=_0x3836d3;_0x3ebbdb[_0x421d('0x33')]=_0x257303;_0x3ebbdb[_0x421d('0x35')]=_0x3ebbdb['responsetime']?_0x3ebbdb[_0x421d('0x35')]:_0x393ae2;_0x3ebbdb['endtime']=_0x3ebbdb['endtime']?_0x3ebbdb[_0x421d('0x36')]:_0x393ae2;_0x3ebbdb[_0x421d('0x38')]=getSeconds(_0x3ebbdb[_0x421d('0x35')]||0x0,_0x3ebbdb[_0x421d('0x39')]||0x0);_0x3ebbdb[_0x421d('0x3f')]=_0x3ebbdb[_0x421d('0x40')]?getSeconds(_0x3ebbdb['endtime'],_0x3ebbdb[_0x421d('0x40')]):0x0;};exports[_0x421d('0x41')]=function(_0x2b812b){return _0x2b812b===_0x421d('0x42');};exports[_0x421d('0x43')]=function(_0x13cb41,_0x599ba6,_0x2b5360,_0x249a09,_0x368e36){var _0x475175=_0x249a09?_0x421d('0x44'):_0x13cb41[_0x421d('0x18')];_0x475175=_0x368e36?_0x421d('0x45'):_0x475175;return{'actionid':_0x13cb41[_0x421d('0x46')],'action':_0x421d('0x47'),'channel':_0x13cb41[_0x421d('0x48')],'callerid':util[_0x421d('0x11')](_0x421d('0x12'),_0x475175,_0x13cb41[_0x421d('0x49')]),'Exten':_0x421d('0x25'),'Context':_0x421d('0x4a'),'Priority':'1','variable':_0x2b5360,'timeout':(_0x599ba6[_0x421d('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x13cb41['uniqueid']};};exports[_0x421d('0x4c')]=function(_0x11244d){return _0x11244d[_0x421d('0x4d')]+_0x11244d[_0x421d('0x4e')]+_0x11244d[_0x421d('0x4f')]+_0x11244d[_0x421d('0x50')]+_0x11244d['countnosuchnumberretry'];};exports[_0x421d('0x51')]=function(_0x5f3ff2){var _0x17136c=_[_0x421d('0x52')](_0x5f3ff2);_0x17136c[_0x421d('0x32')]=0xf;_0x17136c['statedesc']='Global';return _0x17136c;};exports[_0x421d('0x53')]=function(_0x4007b8,_0x1da6e1,_0xad9d35){var _0x5b4abb={};_0x5b4abb[_0x1da6e1]=_0x4007b8[_0x1da6e1];_0x5b4abb[_0x421d('0x54')]=![];_0x5b4abb['scheduledat']=moment()[_0x421d('0x55')](_0xad9d35,'minutes')[_0x421d('0x11')](_0x421d('0x3e'));_0x5b4abb[_0x421d('0x19')]=_0x4007b8[_0x421d('0x19')];_0x5b4abb[_0x421d('0x56')]=_0x4007b8[_0x421d('0x56')];_0x5b4abb[_0x421d('0x57')]=_0x4007b8['VoiceQueueId']||undefined;return _0x5b4abb;};exports['decrementTalkink']=function(_0x4e42a9,_0x9bb291){if(!_[_0x421d('0x15')](_0x4e42a9)){if(_0x4e42a9['pTalking']>0x0){_0x4e42a9[_0x421d('0x58')]-=0x1;}else{logger[_0x421d('0x2e')](_0x9bb291,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x421d('0x2e')](_0x9bb291,_0x421d('0x59'));}};exports[_0x421d('0x5a')]=function(_0x35201f){if(_0x35201f<=0x0){return!![];}return![];};function buildObj(_0x53cbf8,_0x53c386,_0x3f44b6){_0x53cbf8[_0x421d('0x5b')]=_0x53c386;_0x53cbf8[_0x421d('0x5c')]=_0x53cbf8[_0x421d('0x5d')];_0x53cbf8[_0x421d('0x5e')]=_0x53cbf8[_0x421d('0x48')];_0x53cbf8[_0x421d('0x5f')]='voice';if(_0x3f44b6){_0x53cbf8[_0x421d('0x60')]=_0x3f44b6[_0x421d('0x60')];}return _0x53cbf8;}exports[_0x421d('0x61')]=buildObj;exports[_0x421d('0x62')]=function(_0x248b43){var _0x13218f={};_0x13218f[_0x421d('0x5d')]=_0x248b43[_0x421d('0x5d')];_0x13218f[_0x421d('0x5e')]=_0x248b43[_0x421d('0x48')];_0x13218f[_0x421d('0x46')]=_0x248b43['uniqueid'];return _0x13218f;};exports[_0x421d('0x63')]=function(_0x526119){var _0x2b3d97=[];for(var _0x192d18 in _0x526119){if(_0x526119[_0x421d('0x2b')](_0x192d18)){if(!_['isNil'](_0x526119[_0x192d18])&&_0x526119[_0x192d18]['state']==='not_inuse'&&_0x526119[_0x192d18][_0x421d('0x64')]===_0x421d('0x65')){_0x2b3d97['push'](_0x526119[_0x192d18]['id']);}}}return _0x2b3d97;};exports[_0x421d('0x66')]=function(_0x3198d0){var _0x16d3ab=moment()[_0x421d('0x7')](0x0);var _0x1875e8=moment(_0x3198d0)[_0x421d('0x7')](0x0);return _0x16d3ab['diff'](_0x1875e8,_0x421d('0x9'));};exports[_0x421d('0x67')]=function(_0x48076e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x48076e[_0x421d('0x19')],'ListId':_0x48076e[_0x421d('0x56')],'VoiceQueueId':_0x48076e[_0x421d('0x57')]||undefined,'CampaignId':_0x48076e[_0x421d('0x68')]||undefined};};exports['filterKey']=function(_0x2daf11){if(_0x2daf11==='uniqueid'||_0x2daf11==='idContact'||_0x2daf11==='queue'||_0x2daf11===_0x421d('0x69')||_0x2daf11===_0x421d('0x6a')||_0x2daf11==='dialAnswer'||_0x2daf11===_0x421d('0x3b')||_0x2daf11==='channelAgent'||_0x2daf11===_0x421d('0x18')||_0x2daf11===_0x421d('0x54')||_0x2daf11===_0x421d('0x49')||_0x2daf11==='scheduledat'||_0x2daf11===_0x421d('0x4d')||_0x2daf11===_0x421d('0x4e')||_0x2daf11===_0x421d('0x4f')||_0x2daf11==='countglobal'||_0x2daf11===_0x421d('0x6b')||_0x2daf11===_0x421d('0x6c')||_0x2daf11===_0x421d('0x6d')||_0x2daf11===_0x421d('0x6e')||_0x2daf11===_0x421d('0x19')||_0x2daf11===_0x421d('0x56')||_0x2daf11===_0x421d('0x3c')||_0x2daf11==='VoiceQueueId'||_0x2daf11==='sipcallid'||_0x2daf11===_0x421d('0x6f')||_0x2daf11===_0x421d('0x70')||_0x2daf11===_0x421d('0x71')||_0x2daf11==='xmd-listid'||_0x2daf11===_0x421d('0x72')||_0x2daf11==='xmd-dialtimeout'||_0x2daf11===_0x421d('0x73')||_0x2daf11===_0x421d('0x74')||_0x2daf11===_0x421d('0x75')||_0x2daf11===_0x421d('0x76')||_0x2daf11===_0x421d('0x77')||_0x2daf11==='xmd-callerid'||_0x2daf11==='xmd-agiafter'||_0x2daf11===_0x421d('0x78')||_0x2daf11===_0x421d('0x79')||_0x2daf11===_0x421d('0x7a')||_0x2daf11===_0x421d('0x7b')||_0x2daf11===_0x421d('0x7c')||_0x2daf11===_0x421d('0x7d')||_0x2daf11===_0x421d('0x7e')||_0x2daf11===_0x421d('0x7f')||_0x2daf11==='rtpaudioqosrttbridged'||_0x2daf11==='rtpaudioqos'||_0x2daf11==='rtpaudioqosbridged'||_0x2daf11===_0x421d('0x7b')||_0x2daf11==='rtpaudioqosjitterbridged'||_0x2daf11===_0x421d('0x7d')||_0x2daf11===_0x421d('0x7e')||_0x2daf11===_0x421d('0x7f')||_0x2daf11==='rtpaudioqosrttbridged'||_0x2daf11===_0x421d('0x80')||_0x2daf11===_0x421d('0x81')||_0x2daf11===_0x421d('0x32')||_0x2daf11===_0x421d('0x33')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2df677,_0x323bb1){var _0x5f10c1,_0x24c24d,_0x31ac73;if(_0x323bb1<=0x0){_0x323bb1=0x1;}_0x5f10c1=new RegExp(_0x421d('0x82')+_0x323bb1+'}$');_0x24c24d=Math['pow'](0xa,_0x323bb1-0x1);_0x31ac73=Math[_0x421d('0x83')](0xa,_0x323bb1)-0x1;return util['format']('%s',_[_0x421d('0x84')](_0x2df677,_0x5f10c1,_['random'](_0x24c24d,_0x31ac73)));};exports[_0x421d('0x85')]=function(_0x24b3e3){var _0x46e3e8=_0x24b3e3[_0x421d('0x86')](/"(.*?)"/);return _0x46e3e8?_0x46e3e8[0x1]:_0x24b3e3;};exports[_0x421d('0x87')]=function(_0x2a9e0e){var _0x5a5826=_0x2a9e0e['match'](/<(.*?)>/);return _0x5a5826?_0x5a5826[0x1]:_0x2a9e0e;};function buildNoAnswerEventPayload(_0x505e93,_0x511654){var _0x70b96c=buildObj(_0x505e93,_0x421d('0x88'));if(!_['isEmpty'](_0x511654['variables'])){Object['keys'](_0x511654['variables'])[_0x421d('0x89')](function(_0x149258){_0x70b96c[_0x149258[_0x421d('0x8a')]()]=_0x511654['variables'][_0x149258];});}return _0x70b96c;}exports[_0x421d('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x70de=['moment','preview','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','inspect','logger','loggerError','error','logger2','info','message','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isActive','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','Failure','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','active','scheduledat','add','minutes','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','name','queue','interface','motionChannel','mandatoryDisposition','buildAcw','not_inuse','reachable','push','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepvtcallid','pow','match','extractCalleridNumber','noanswer','variables','keys','forEach','buildNoAnswerEventPayload','util','lodash'];(function(_0x4e3a4c,_0x5c2ef2){var _0xc46f19=function(_0x48ba3f){while(--_0x48ba3f){_0x4e3a4c['push'](_0x4e3a4c['shift']());}};_0xc46f19(++_0x5c2ef2);}(_0x70de,0x112));var _0xe70d=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0x70de[_0xbec8e6];return _0x4aa6f2;};'use strict';var util=require(_0xe70d('0x0'));var _=require(_0xe70d('0x1'));var moment=require(_0xe70d('0x2'));var logger=require('../../../../config/logger')(_0xe70d('0x3'));var ipAgi=process['env'][_0xe70d('0x4')]||'127.0.0.1';function getSeconds(_0x2495aa,_0x5a5766){var _0x4e4693=moment(_0x2495aa)[_0xe70d('0x5')](0x0);var _0x796bb=moment(_0x5a5766)['milliseconds'](0x0);return _0x4e4693[_0xe70d('0x6')](_0x796bb,_0xe70d('0x7'));}exports[_0xe70d('0x8')]=function(_0x3c8188){return function(_0x2c4da0){logger['error'](_0x3c8188,util[_0xe70d('0x9')](_0x2c4da0,{'showHidden':![],'depth':null}));};};exports[_0xe70d('0xa')]=function(_0x3c38cd,_0x4154de){logger['info'](_0x3c38cd,util[_0xe70d('0x9')](_0x4154de,{'showHidden':![],'depth':null}));};exports[_0xe70d('0xb')]=function(_0x46f887,_0x154a9e){logger[_0xe70d('0xc')](_0x46f887,util[_0xe70d('0x9')](_0x154a9e,{'showHidden':![],'depth':null}));};exports[_0xe70d('0xd')]=function(_0x45cafa){return function(_0x5382c6){logger[_0xe70d('0xe')](_0x45cafa,util[_0xe70d('0x9')](_0x5382c6,{'showHidden':![],'depth':null}));};};exports[_0xe70d('0xf')]=function(_0x5b3b59,_0x514e98,_0x4f2305){return{'message':_0x5b3b59,'unlock':_0x514e98,'active':_0x4f2305};};exports['getCallerId']=function(_0x286003,_0x2400fc,_0x1f91dc){if(!_[_0xe70d('0x10')](_0x1f91dc)&&_0xe70d('0x11')===typeof _0x1f91dc&&!_[_0xe70d('0x12')](_0x1f91dc)){if(!_[_0xe70d('0x10')](_0x2400fc)&&'string'===typeof _0x2400fc&&!_[_0xe70d('0x12')](_0x2400fc)){return util['format'](_0xe70d('0x13'),_0x2400fc,_0x1f91dc);}return util[_0xe70d('0x14')](_0xe70d('0x13'),_0x1f91dc,_0x1f91dc);}if(!_['isUndefined'](_0x286003)&&'string'===typeof _0x286003&&!_[_0xe70d('0x12')](_0x286003)){return _0x286003;}return'\x22\x22\x20<>';};exports[_0xe70d('0x15')]=function(_0x1d7afb){if(_['isNil'](_0x1d7afb)){return![];}return _0x1d7afb;};exports['addVariables']=function(_0xe198c5,_0x480a20,_0x2ed983,_0x585872,_0x1439e9,_0x1a9a93){var _0x55c6c8={'XMD-QUEUE':_0x480a20[_0xe70d('0x16')]?_0x480a20[_0xe70d('0x16')]['name']:'','XMD-CALLERID':_0x585872,'XMD-CALLERID-PREVIEW':_0x1a9a93?util['format']('\x22%s\x22\x20<%s>',_0x1a9a93[_0xe70d('0x17')],_0x1a9a93[_0xe70d('0x18')]):_0x585872,'XMD-DIALID':_0x1439e9,'XMD-CONTACTID':_0x480a20[_0xe70d('0x19')],'XMD-CDRTYPE':_0xe70d('0x1a'),'CALLERID(all)':_0x585872,'XMD-VOICEQUEUEID':_0x480a20[_0xe70d('0x1b')],'XMD-DIALCHANNEL':_0x2ed983,'XMD-DIALTIMEOUT':_0xe198c5[_0xe70d('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xe70d('0x14')](_0xe70d('0x1d'),_0xe198c5[_0xe70d('0x1e')]?'g':'',_[_0xe70d('0x12')](_0xe198c5[_0xe70d('0x1f')])?'':_0xe70d('0x20')),'XMD-DIALURL':_0xe198c5[_0xe70d('0x21')]||'','XMD-AGI':_0xe198c5[_0xe70d('0x22')]?util[_0xe70d('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0xe198c5[_0xe70d('0x22')]):'NONE','XMD-AGIAFTER':_0xe198c5[_0xe70d('0x1e')]?util[_0xe70d('0x14')](_0xe70d('0x23'),ipAgi,_0xe198c5['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x1a9a93?_0x1a9a93[_0xe70d('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x1a9a93?_0x1a9a93[_0xe70d('0x25')]:'','XMD-DESTINATION':_0xe70d('0x26'),'SIPADDHEADER':_0xe70d('0x27')};if(!_['isEmpty'](_0xe198c5['monitor_format'])){_0x55c6c8[util[_0xe70d('0x14')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xe198c5['monitor_format'];_0x55c6c8[util[_0xe70d('0x14')]('%s',_0xe70d('0x28'))]=_0x1439e9;}if(_0x480a20&&_0x480a20[_0xe70d('0x29')]){for(var _0x3d80e4 in _0x480a20[_0xe70d('0x29')]){if(_0x480a20[_0xe70d('0x29')][_0xe70d('0x2a')](_0x3d80e4)){if(!_[_0xe70d('0x2b')](_0x480a20[_0xe70d('0x29')][_0x3d80e4])&&_0x3d80e4!=='id'&&_0x3d80e4!==_0xe70d('0x2c')&&_0x3d80e4!==_0xe70d('0x2d')&&_0x3d80e4!==_0xe70d('0x2e')){_0x55c6c8[util[_0xe70d('0x14')](_0xe70d('0x2f'),_0xe70d('0x30'),_[_0xe70d('0x31')](_0x3d80e4))]=_0x480a20['Contact'][_0x3d80e4];}}}}return _0x55c6c8;};exports[_0xe70d('0x32')]=function(_0x710a69){var _0x42c011={};for(var _0x49d07a in _0x710a69){if(_0x710a69[_0xe70d('0x2a')](_0x49d07a)){_0x42c011[util[_0xe70d('0x14')]('%s',_[_0xe70d('0x33')](_0x49d07a))]=_0x710a69[_0x49d07a];}}return{'variables':_0x42c011};};exports[_0xe70d('0x34')]=function(_0x388673,_0x1967a9){if(!_[_0xe70d('0x2b')](_0x388673)){if(_0x388673['hasOwnProperty'](_0xe70d('0x35'))){if(_0x388673[_0xe70d('0x35')]>0x0){_0x388673[_0xe70d('0x35')]-=0x1;}else{logger['error'](_0xe70d('0x36'),_0x1967a9);}}}else{logger[_0xe70d('0xc')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x1967a9);}};exports[_0xe70d('0x37')]=function(_0x40ee56){var _0x2d351f=moment()[_0xe70d('0x14')](_0xe70d('0x38'));_0x40ee56[_0xe70d('0x39')]=0xd;_0x40ee56[_0xe70d('0x3a')]='Blacklist';_0x40ee56['starttime']=_0x2d351f;_0x40ee56[_0xe70d('0x3b')]=_0x2d351f;_0x40ee56[_0xe70d('0x3c')]=_0x2d351f;};exports[_0xe70d('0x3d')]=function(_0x5221c2,_0x2cc859,_0x51b6dc){var _0x454d96=moment()[_0xe70d('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x5221c2['state']=_0x2cc859;_0x5221c2[_0xe70d('0x3a')]=_0x51b6dc;_0x5221c2[_0xe70d('0x3b')]=_0x454d96;_0x5221c2[_0xe70d('0x3e')]=getSeconds(_0x5221c2[_0xe70d('0x3b')],_0x5221c2[_0xe70d('0x3f')]);};exports[_0xe70d('0x40')]=function(_0x50256b,_0x381415,_0x14609f){_0x50256b[_0xe70d('0x41')]=_0x381415;_0x50256b[_0xe70d('0x42')]=_0x14609f;};exports[_0xe70d('0x43')]=function(_0x1ad8f3,_0xc22237,_0x5b3fad){var _0x55433e=moment()[_0xe70d('0x14')](_0xe70d('0x38'));_0x1ad8f3['state']=_0xc22237;_0x1ad8f3[_0xe70d('0x3a')]=_0x5b3fad;_0x1ad8f3[_0xe70d('0x3b')]=_0x1ad8f3[_0xe70d('0x3b')]?_0x1ad8f3[_0xe70d('0x3b')]:_0x55433e;_0x1ad8f3[_0xe70d('0x3c')]=_0x1ad8f3['endtime']?_0x1ad8f3[_0xe70d('0x3c')]:_0x55433e;_0x1ad8f3[_0xe70d('0x3e')]=getSeconds(_0x1ad8f3[_0xe70d('0x3b')]||0x0,_0x1ad8f3[_0xe70d('0x3f')]||0x0);_0x1ad8f3[_0xe70d('0x44')]=_0x1ad8f3[_0xe70d('0x45')]?getSeconds(_0x1ad8f3[_0xe70d('0x3c')],_0x1ad8f3[_0xe70d('0x45')]):0x0;};exports['isFailure']=function(_0xae7d78){return _0xae7d78===_0xe70d('0x46');};exports['variablesAction']=function(_0x167e82,_0x4fa512,_0x3aace9,_0x415e4b,_0x1893fe){var _0x542fbf=_0x415e4b?_0xe70d('0x47'):_0x167e82['calleridname'];_0x542fbf=_0x1893fe?'BOOKED':_0x542fbf;return{'actionid':_0x167e82[_0xe70d('0x48')],'action':_0xe70d('0x49'),'channel':_0x167e82[_0xe70d('0x4a')],'callerid':util['format'](_0xe70d('0x13'),_0x542fbf,_0x167e82[_0xe70d('0x18')]),'Exten':_0xe70d('0x26'),'Context':_0xe70d('0x4b'),'Priority':'1','variable':_0x3aace9,'timeout':(_0x4fa512[_0xe70d('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x167e82[_0xe70d('0x48')]};};exports['totalGlobal']=function(_0xd1ea56){return _0xd1ea56[_0xe70d('0x4d')]+_0xd1ea56[_0xe70d('0x4e')]+_0xd1ea56[_0xe70d('0x4f')]+_0xd1ea56[_0xe70d('0x50')]+_0xd1ea56['countnosuchnumberretry'];};exports[_0xe70d('0x51')]=function(_0x535f9b){var _0x516b40=_[_0xe70d('0x52')](_0x535f9b);_0x516b40[_0xe70d('0x39')]=0xf;_0x516b40[_0xe70d('0x3a')]=_0xe70d('0x53');return _0x516b40;};exports['scheduledAt']=function(_0x39a4d9,_0x4d9679,_0x59cc18){var _0x34a090={};_0x34a090[_0x4d9679]=_0x39a4d9[_0x4d9679];_0x34a090[_0xe70d('0x54')]=![];_0x34a090[_0xe70d('0x55')]=moment()[_0xe70d('0x56')](_0x59cc18,_0xe70d('0x57'))[_0xe70d('0x14')](_0xe70d('0x38'));_0x34a090['ContactId']=_0x39a4d9[_0xe70d('0x19')];_0x34a090['ListId']=_0x39a4d9[_0xe70d('0x58')];_0x34a090[_0xe70d('0x1b')]=_0x39a4d9[_0xe70d('0x1b')]||undefined;return _0x34a090;};exports[_0xe70d('0x59')]=function(_0x153a20,_0x3f2e24){if(!_[_0xe70d('0x2b')](_0x153a20)){if(_0x153a20['pTalking']>0x0){_0x153a20['pTalking']-=0x1;}else{logger[_0xe70d('0xc')](_0x3f2e24,_0xe70d('0x5a'));}}else{logger[_0xe70d('0xc')](_0x3f2e24,_0xe70d('0x5b'));}};exports['IsNotLoggedIn']=function(_0x15c3e9){if(_0x15c3e9<=0x0){return!![];}return![];};function buildObj(_0x3d94a7,_0x831903,_0x5b08db){_0x3d94a7[_0xe70d('0x5c')]=_0x831903;_0x3d94a7[_0xe70d('0x5d')]=_0x3d94a7[_0xe70d('0x5e')];_0x3d94a7[_0xe70d('0x5f')]=_0x3d94a7[_0xe70d('0x4a')];_0x3d94a7[_0xe70d('0x60')]='voice';if(_0x5b08db){_0x3d94a7[_0xe70d('0x61')]=_0x5b08db[_0xe70d('0x61')];}return _0x3d94a7;}exports['buildObj']=buildObj;exports[_0xe70d('0x62')]=function(_0x101884){var _0x4150f5={};_0x4150f5[_0xe70d('0x5e')]=_0x101884['queue'];_0x4150f5[_0xe70d('0x5f')]=_0x101884[_0xe70d('0x4a')];_0x4150f5[_0xe70d('0x48')]=_0x101884[_0xe70d('0x48')];return _0x4150f5;};exports['agentReadyId']=function(_0x30083b){var _0x4dc796=[];for(var _0x39fea0 in _0x30083b){if(_0x30083b[_0xe70d('0x2a')](_0x39fea0)){if(!_[_0xe70d('0x2b')](_0x30083b[_0x39fea0])&&_0x30083b[_0x39fea0][_0xe70d('0x39')]===_0xe70d('0x63')&&_0x30083b[_0x39fea0]['status']===_0xe70d('0x64')){_0x4dc796[_0xe70d('0x65')](_0x30083b[_0x39fea0]['id']);}}}return _0x4dc796;};exports['getDiff']=function(_0xa6107c){var _0x41d7eb=moment()[_0xe70d('0x5')](0x0);var _0x3891f5=moment(_0xa6107c)[_0xe70d('0x5')](0x0);return _0x41d7eb[_0xe70d('0x6')](_0x3891f5,_0xe70d('0x7'));};exports[_0xe70d('0x66')]=function(_0x3497c7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3497c7['ContactId'],'ListId':_0x3497c7['ListId'],'VoiceQueueId':_0x3497c7[_0xe70d('0x1b')]||undefined,'CampaignId':_0x3497c7[_0xe70d('0x67')]||undefined};};exports[_0xe70d('0x68')]=function(_0x26ee31){if(_0x26ee31===_0xe70d('0x48')||_0x26ee31==='idContact'||_0x26ee31==='queue'||_0x26ee31===_0xe70d('0x69')||_0x26ee31===_0xe70d('0x6a')||_0x26ee31===_0xe70d('0x6b')||_0x26ee31==='membername'||_0x26ee31===_0xe70d('0x4a')||_0x26ee31==='calleridname'||_0x26ee31===_0xe70d('0x54')||_0x26ee31===_0xe70d('0x18')||_0x26ee31===_0xe70d('0x55')||_0x26ee31===_0xe70d('0x4d')||_0x26ee31==='countcongestionretry'||_0x26ee31===_0xe70d('0x4f')||_0x26ee31==='countglobal'||_0x26ee31===_0xe70d('0x6c')||_0x26ee31===_0xe70d('0x6d')||_0x26ee31===_0xe70d('0x6e')||_0x26ee31===_0xe70d('0x6f')||_0x26ee31==='ContactId'||_0x26ee31===_0xe70d('0x58')||_0x26ee31===_0xe70d('0x42')||_0x26ee31===_0xe70d('0x1b')||_0x26ee31===_0xe70d('0x70')||_0x26ee31==='xmd-voicequeueid'||_0x26ee31===_0xe70d('0x71')||_0x26ee31===_0xe70d('0x72')||_0x26ee31===_0xe70d('0x73')||_0x26ee31===_0xe70d('0x74')||_0x26ee31===_0xe70d('0x75')||_0x26ee31===_0xe70d('0x76')||_0x26ee31===_0xe70d('0x77')||_0x26ee31===_0xe70d('0x78')||_0x26ee31==='xmd-contactid'||_0x26ee31===_0xe70d('0x79')||_0x26ee31==='xmd-callerid'||_0x26ee31==='xmd-agiafter'||_0x26ee31==='xmd-agi'||_0x26ee31===_0xe70d('0x7a')||_0x26ee31===_0xe70d('0x7b')||_0x26ee31==='rtpaudioqosjitter'||_0x26ee31===_0xe70d('0x7c')||_0x26ee31===_0xe70d('0x7d')||_0x26ee31==='rtpaudioqoslossbridged'||_0x26ee31===_0xe70d('0x7e')||_0x26ee31===_0xe70d('0x7f')||_0x26ee31===_0xe70d('0x7a')||_0x26ee31==='rtpaudioqosbridged'||_0x26ee31==='rtpaudioqosjitter'||_0x26ee31===_0xe70d('0x7c')||_0x26ee31===_0xe70d('0x7d')||_0x26ee31===_0xe70d('0x80')||_0x26ee31===_0xe70d('0x7e')||_0x26ee31===_0xe70d('0x7f')||_0x26ee31==='bridgepeer'||_0x26ee31===_0xe70d('0x81')||_0x26ee31===_0xe70d('0x39')||_0x26ee31===_0xe70d('0x3a')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x9157d6,_0x1ff252){var _0x1a3898,_0x2a04ce,_0x3c8c55;if(_0x1ff252<=0x0){_0x1ff252=0x1;}_0x1a3898=new RegExp('\x5cw{0,'+_0x1ff252+'}$');_0x2a04ce=Math[_0xe70d('0x82')](0xa,_0x1ff252-0x1);_0x3c8c55=Math[_0xe70d('0x82')](0xa,_0x1ff252)-0x1;return util[_0xe70d('0x14')]('%s',_['replace'](_0x9157d6,_0x1a3898,_['random'](_0x2a04ce,_0x3c8c55)));};exports['extractCalleridName']=function(_0x29f61e){var _0x2fe485=_0x29f61e[_0xe70d('0x83')](/"(.*?)"/);return _0x2fe485?_0x2fe485[0x1]:_0x29f61e;};exports[_0xe70d('0x84')]=function(_0x2db73c){var _0x48aba6=_0x2db73c[_0xe70d('0x83')](/<(.*?)>/);return _0x48aba6?_0x48aba6[0x1]:_0x2db73c;};function buildNoAnswerEventPayload(_0x5edaa8,_0x9ebe82){var _0xc59acd=buildObj(_0x5edaa8,_0xe70d('0x85'));if(!_['isEmpty'](_0x9ebe82[_0xe70d('0x86')])){Object[_0xe70d('0x87')](_0x9ebe82[_0xe70d('0x86')])[_0xe70d('0x88')](function(_0x50881d){_0xc59acd[_0x50881d['toLowerCase']()]=_0x9ebe82[_0xe70d('0x86')][_0x50881d];});}return _0xc59acd;}exports[_0xe70d('0x89')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index eae6797..93c4f0d 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 _0x0f73=['queueremove','reload','voicechannel','voicequeuechannelhangup','string','number','boolean'];(function(_0x52cbe2,_0x5afefb){var _0x277141=function(_0x271243){while(--_0x271243){_0x52cbe2['push'](_0x52cbe2['shift']());}};_0x277141(++_0x5afefb);}(_0x0f73,0x1bd));var _0x30f7=function(_0x5d18b1,_0x23c13a){_0x5d18b1=_0x5d18b1-0x0;var _0xcee517=_0x0f73[_0x5d18b1];return _0xcee517;};'use strict';exports['queueadd']={'queue':{'type':'string','required':!![]},'interface':{'type':_0x30f7('0x0'),'required':!![]},'membername':{'type':_0x30f7('0x0'),'required':!![]},'penalty':{'type':_0x30f7('0x1'),'required':![]},'paused':{'type':_0x30f7('0x2'),'required':![]}};exports[_0x30f7('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x30f7('0x0'),'required':!![]}};exports['queuepause']={'interface':{'type':'string','required':!![]},'paused':{'type':_0x30f7('0x2')},'reason':{'type':'string','required':![]}};exports[_0x30f7('0x4')]={'module':{'type':_0x30f7('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x30f7('0x0'),'required':!![]}};exports[_0x30f7('0x5')]={'uniqueid':{'type':_0x30f7('0x0'),'required':!![]},'filename':{'type':_0x30f7('0x0')},'format':{'type':_0x30f7('0x0')},'mixmonitorid':{'type':_0x30f7('0x0')}};exports[_0x30f7('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x30f7('0x0'),'required':!![]},'exten':{'type':_0x30f7('0x0'),'required':!![]},'context':{'type':_0x30f7('0x0')}}; \ No newline at end of file +var _0x0aa8=['boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x0aa8,0x1b8));var _0x80aa=function(_0x5751e6,_0x125e5e){_0x5751e6=_0x5751e6-0x0;var _0x4199e4=_0x0aa8[_0x5751e6];return _0x4199e4;};'use strict';exports['queueadd']={'queue':{'type':_0x80aa('0x0'),'required':!![]},'interface':{'type':_0x80aa('0x0'),'required':!![]},'membername':{'type':_0x80aa('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x80aa('0x1'),'required':![]}};exports[_0x80aa('0x2')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x80aa('0x0'),'required':!![]}};exports[_0x80aa('0x3')]={'interface':{'type':_0x80aa('0x0'),'required':!![]},'paused':{'type':_0x80aa('0x1')},'reason':{'type':_0x80aa('0x0'),'required':![]}};exports[_0x80aa('0x4')]={'module':{'type':_0x80aa('0x0'),'required':![]}};exports[_0x80aa('0x5')]={'uniqueid':{'type':_0x80aa('0x0'),'required':!![]}};exports[_0x80aa('0x6')]={'uniqueid':{'type':_0x80aa('0x0'),'required':!![]},'filename':{'type':_0x80aa('0x0')},'format':{'type':_0x80aa('0x0')},'mixmonitorid':{'type':_0x80aa('0x0')}};exports[_0x80aa('0x7')]={'uniqueid':{'type':_0x80aa('0x0'),'required':!![]}};exports[_0x80aa('0x8')]={'uniqueid':{'type':_0x80aa('0x0'),'required':!![]},'exten':{'type':_0x80aa('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 70f3b91..2b9cd31 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 _0x0ef4=['voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','SIP/%s','name','isNil','interface','format','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','isUndefined','initTelephones','length','initTrunks','trunks','mergeFromDatabase','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','initVoiceCallReports','outbound','disposition','ANSWERED','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','lodash','moment','../model/agent','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','voiceQueues','triggers','campaigns','templates'];(function(_0x31065e,_0x14ca0e){var _0x37a1da=function(_0x32e90c){while(--_0x32e90c){_0x31065e['push'](_0x31065e['shift']());}};_0x37a1da(++_0x14ca0e);}(_0x0ef4,0xc7));var _0x40ef=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0x0ef4[_0xb4cc12];return _0x8593b5;};'use strict';var util=require('util');var _=require(_0x40ef('0x0'));var moment=require(_0x40ef('0x1'));var Agent=require(_0x40ef('0x2'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0x40ef('0x3'));var Trigger=require(_0x40ef('0x4'));var Template=require(_0x40ef('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x40ef('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x40ef('0x7'));var SugarcrmAccount=require(_0x40ef('0x8'));var ZohoAccount=require(_0x40ef('0x9'));var DeskAccount=require(_0x40ef('0xa'));var VtigerAccount=require(_0x40ef('0xb'));var ServicenowAccount=require(_0x40ef('0xc'));var Dynamics365Account=require(_0x40ef('0xd'));var FreshsalesAccount=require(_0x40ef('0xe'));var FaxAccount=require(_0x40ef('0xf'));var Realtime=function(){this['agents']={};this[_0x40ef('0x10')]={};this['trunks']={};this[_0x40ef('0x11')]={};this[_0x40ef('0x12')]={};this[_0x40ef('0x13')]={};this[_0x40ef('0x14')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x40ef('0x15')]={};this[_0x40ef('0x16')]={};this[_0x40ef('0x17')]={};this[_0x40ef('0x18')]={};this[_0x40ef('0x19')]={};this[_0x40ef('0x1a')]={};this[_0x40ef('0x1b')]={};this[_0x40ef('0x1c')]={};this[_0x40ef('0x1d')]={};this[_0x40ef('0x1e')]={};this[_0x40ef('0x1f')]={};this[_0x40ef('0x20')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x40ef('0x21')]={};this['freshsalesAccounts']={};this[_0x40ef('0x22')]={};};function freeIsNotKey(_0xdb24fd,_0x50f637,_0x197eea){var _0xcc40df=_['mapKeys'](_0xdb24fd,function(_0x3ddcf0,_0x598145){return _0x3ddcf0[_0x197eea];});for(var _0x3a3ba2 in _0x50f637){if(_0x50f637[_0x40ef('0x23')](_0x3a3ba2)){if(!_0xcc40df[_0x3a3ba2]){delete _0x50f637[_0x3a3ba2];}}}}function freeIsNotKeySip(_0x3573bd,_0x56c84d){var _0x4e0257=_[_0x40ef('0x24')](_0x3573bd,function(_0x54c35d,_0x47213d){return util['format'](_0x40ef('0x25'),_0x54c35d[_0x40ef('0x26')]);});for(var _0x514263 in _0x56c84d){if(_0x56c84d[_0x40ef('0x23')](_0x514263)){if(!_0x4e0257[_0x514263]){delete _0x56c84d[_0x514263];}}}}function freeIsNotKeyAgent(_0x1ee7b5,_0xa60df3){var _0x4a2cc5=_[_0x40ef('0x24')](_0x1ee7b5,function(_0x4cef12,_0x3fb29c){var _0x5d2d53=_[_0x40ef('0x27')](_0x4cef12[_0x40ef('0x28')])?util[_0x40ef('0x29')](_0x40ef('0x25'),_0x4cef12[_0x40ef('0x26')]):_0x4cef12[_0x40ef('0x28')];return _0x5d2d53;});for(var _0x1809d6 in _0xa60df3){if(_0xa60df3[_0x40ef('0x23')](_0x1809d6)){if(!_0x4a2cc5[_0x1809d6]){delete _0xa60df3[_0x1809d6];}}}}function clearVoiceCallReports(_0xcb7712){_0xcb7712[_0x40ef('0x2a')]=0x0;_0xcb7712[_0x40ef('0x2b')]=0x0;_0xcb7712[_0x40ef('0x2c')]=0x0;_0xcb7712[_0x40ef('0x2d')]=0x0;_0xcb7712[_0x40ef('0x2e')]=0x0;}function clearCampaigns(_0x48cfb0){if(!_[_0x40ef('0x2f')](_0x48cfb0)){for(var _0x336c03 in _0x48cfb0){if(_0x48cfb0['hasOwnProperty'](_0x336c03)){_0x48cfb0[_0x336c03]['ivrTotalCallsDays']=0x0;_0x48cfb0[_0x336c03][_0x40ef('0x30')]=0x0;}}}}function clearVoiceQueues(_0x35c0f0){if(!_['isEmpty'](_0x35c0f0)){for(var _0x5753e6 in _0x35c0f0){if(_0x35c0f0['hasOwnProperty'](_0x5753e6)){_0x35c0f0[_0x5753e6][_0x40ef('0x2a')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x2b')]=0x0;_0x35c0f0[_0x5753e6]['unmanaged']=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x31')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x2c')]=0x0;_0x35c0f0[_0x5753e6]['sumDuration']=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x2e')]=0x0;_0x35c0f0[_0x5753e6]['outboundAnswerAgiCallsDay']=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x32')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x33')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x34')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x35')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x36')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x37')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x38')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x39')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x3a')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x3b')]=0x0;_0x35c0f0[_0x5753e6]['outboundReCallsDay']=0x0;_0x35c0f0[_0x5753e6]['outboundAnswerAgiCallsDay']=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x3c')]=0x0;_0x35c0f0[_0x5753e6][_0x40ef('0x3d')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x578524,_0x22e415){for(var _0x4a6dbb in _0x22e415){if(_0x578524['hasOwnProperty'](_0x4a6dbb)){_0x578524[_0x4a6dbb]=_0x22e415[_0x4a6dbb];}}};Realtime[_0x40ef('0x3e')][_0x40ef('0x3f')]=function(){var _0x43f343=this;return function(_0x48c327){if(_0x48c327){freeIsNotKeyAgent(_0x48c327,_0x43f343[_0x40ef('0x40')]);for(var _0x211e42=0x0,_0x4483b6={},_0x1e64f1={};_0x211e42<_0x48c327['length'];_0x211e42+=0x1){_0x4483b6=_0x48c327[_0x211e42];var _0x5a78f5=_[_0x40ef('0x27')](_0x4483b6['interface'])?util['format'](_0x40ef('0x25'),_0x4483b6[_0x40ef('0x26')]):_0x4483b6['interface'];if(_[_0x40ef('0x41')](_0x43f343['agents'][_0x5a78f5])){_0x43f343[_0x40ef('0x40')][_0x5a78f5]=new Agent(_0x4483b6);}else{_0x43f343['mergeFromDatabase'](_0x43f343[_0x40ef('0x40')][_0x5a78f5],_0x4483b6);}}}return _0x43f343[_0x40ef('0x40')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x42')]=function(){var _0x4d083f=this;return function(_0x17ee0f){if(_0x17ee0f){freeIsNotKeySip(_0x17ee0f,_0x4d083f['telephones']);for(var _0x1944fd=0x0,_0x56a7e5={},_0x4f7a3e={};_0x1944fd<_0x17ee0f[_0x40ef('0x43')];_0x1944fd+=0x1){_0x56a7e5=_0x17ee0f[_0x1944fd];if(_[_0x40ef('0x41')](_0x4d083f[_0x40ef('0x10')][util['format'](_0x40ef('0x25'),_0x56a7e5['name'])])){_0x4d083f[_0x40ef('0x10')][util[_0x40ef('0x29')]('SIP/%s',_0x56a7e5['name'])]=new Telephone(_0x56a7e5);}else{_0x4d083f['mergeFromDatabase'](_0x4d083f[_0x40ef('0x10')][util[_0x40ef('0x29')](_0x40ef('0x25'),_0x56a7e5[_0x40ef('0x26')])],_0x56a7e5);}}}return _0x4d083f[_0x40ef('0x10')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x44')]=function(){var _0x631122=this;return function(_0x1a15d1){if(_0x1a15d1){freeIsNotKeySip(_0x1a15d1,_0x631122[_0x40ef('0x45')]);for(var _0x13bf68=0x0,_0x22cbcd={},_0x17ac54={};_0x13bf68<_0x1a15d1['length'];_0x13bf68+=0x1){_0x22cbcd=_0x1a15d1[_0x13bf68];if(_['isUndefined'](_0x631122[_0x40ef('0x45')][util[_0x40ef('0x29')](_0x40ef('0x25'),_0x22cbcd[_0x40ef('0x26')])])){_0x631122[_0x40ef('0x45')][util['format'](_0x40ef('0x25'),_0x22cbcd[_0x40ef('0x26')])]=new Trunk(_0x22cbcd);}else{_0x631122[_0x40ef('0x46')](_0x631122[_0x40ef('0x45')][util[_0x40ef('0x29')]('SIP/%s',_0x22cbcd[_0x40ef('0x26')])],_0x22cbcd);}}}return _0x631122[_0x40ef('0x45')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x47')]=function(){var _0x14e04c=this;return function(_0x2e6a19){if(_0x2e6a19){freeIsNotKey(_0x2e6a19,_0x14e04c[_0x40ef('0x11')],_0x40ef('0x26'));for(var _0x4dbf11=0x0,_0x26e2e7={},_0xec326b={};_0x4dbf11<_0x2e6a19[_0x40ef('0x43')];_0x4dbf11+=0x1){_0x26e2e7=_0x2e6a19[_0x4dbf11];if(_['isUndefined'](_0x14e04c[_0x40ef('0x11')][_0x26e2e7[_0x40ef('0x26')]])){_0x14e04c[_0x40ef('0x11')][_0x26e2e7['name']]=new VoiceQueue(_0x26e2e7);}else{_0x14e04c[_0x40ef('0x46')](_0x14e04c[_0x40ef('0x11')][_0x26e2e7['name']],_0x26e2e7);}}}return _0x14e04c[_0x40ef('0x11')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x48')]=function(){var _0x1d34d3=this;return function(_0x4bdf0d){if(_0x4bdf0d){freeIsNotKey(_0x4bdf0d,_0x1d34d3[_0x40ef('0x12')],'id');for(var _0x5981fd=0x0,_0x377732={},_0x253c92={};_0x5981fd<_0x4bdf0d[_0x40ef('0x43')];_0x5981fd+=0x1){_0x377732=_0x4bdf0d[_0x5981fd];if(_[_0x40ef('0x41')](_0x1d34d3[_0x40ef('0x12')][_0x377732['id']])){_0x1d34d3['triggers'][_0x377732['id']]=new Trigger(_0x377732);}else{_0x1d34d3[_0x40ef('0x46')](_0x1d34d3[_0x40ef('0x12')][_0x377732['id']],_0x377732);}}}return _0x1d34d3[_0x40ef('0x12')];};};Realtime['prototype'][_0x40ef('0x49')]=function(){var _0x1e5190=this;return function(_0x40710d){if(_0x40710d){freeIsNotKey(_0x40710d,_0x1e5190[_0x40ef('0x14')],'id');for(var _0x1a4486=0x0,_0x4a7532={},_0x3aae7e={};_0x1a4486<_0x40710d[_0x40ef('0x43')];_0x1a4486+=0x1){_0x4a7532=_0x40710d[_0x1a4486];if(_[_0x40ef('0x41')](_0x1e5190[_0x40ef('0x14')][_0x4a7532['id']])){_0x1e5190[_0x40ef('0x14')][_0x4a7532['id']]=new Template(_0x4a7532);}else{_0x1e5190[_0x40ef('0x46')](_0x1e5190[_0x40ef('0x14')][_0x4a7532['id']],_0x4a7532);}}}return _0x1e5190[_0x40ef('0x14')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4a')]=function(){var _0x48254c=this;return function(_0x4647ce){if(_0x4647ce){freeIsNotKey(_0x4647ce,_0x48254c[_0x40ef('0x1b')],'id');for(var _0x8b6a04=0x0,_0x29a735={},_0x5a8efc={};_0x8b6a04<_0x4647ce[_0x40ef('0x43')];_0x8b6a04+=0x1){_0x29a735=_0x4647ce[_0x8b6a04];if(_[_0x40ef('0x41')](_0x48254c['zendeskAccounts'][_0x29a735['id']])){_0x48254c[_0x40ef('0x1b')][_0x29a735['id']]=new ZendeskAccount(_0x29a735);}else{_0x48254c['mergeFromDatabase'](_0x48254c[_0x40ef('0x1b')][_0x29a735['id']],_0x29a735);}}}return _0x48254c[_0x40ef('0x1b')];};};Realtime[_0x40ef('0x3e')]['initSalesforceAccounts']=function(){var _0x4a0902=this;return function(_0x2cc42b){if(_0x2cc42b){freeIsNotKey(_0x2cc42b,_0x4a0902[_0x40ef('0x1c')],'id');for(var _0x48f022=0x0,_0x5d68bc={},_0x4c7581={};_0x48f022<_0x2cc42b[_0x40ef('0x43')];_0x48f022+=0x1){_0x5d68bc=_0x2cc42b[_0x48f022];if(_['isUndefined'](_0x4a0902[_0x40ef('0x1c')][_0x5d68bc['id']])){_0x4a0902[_0x40ef('0x1c')][_0x5d68bc['id']]=new SalesforceAccount(_0x5d68bc);}else{_0x4a0902[_0x40ef('0x46')](_0x4a0902['salesforceAccounts'][_0x5d68bc['id']],_0x5d68bc);}}}return _0x4a0902[_0x40ef('0x1c')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4b')]=function(){var _0x5e017d=this;return function(_0x176c9f){if(_0x176c9f){freeIsNotKey(_0x176c9f,_0x5e017d[_0x40ef('0x1e')],'id');for(var _0x516417=0x0,_0x43acbd={},_0x3bd8d6={};_0x516417<_0x176c9f['length'];_0x516417+=0x1){_0x43acbd=_0x176c9f[_0x516417];if(_['isUndefined'](_0x5e017d[_0x40ef('0x1e')][_0x43acbd['id']])){_0x5e017d[_0x40ef('0x1e')][_0x43acbd['id']]=new FreshdeskAccount(_0x43acbd);}else{_0x5e017d[_0x40ef('0x46')](_0x5e017d[_0x40ef('0x1e')][_0x43acbd['id']],_0x43acbd);}}}return _0x5e017d[_0x40ef('0x1e')];};};Realtime['prototype'][_0x40ef('0x4c')]=function(){var _0x503a9e=this;return function(_0x466598){if(_0x466598){freeIsNotKey(_0x466598,_0x503a9e[_0x40ef('0x1f')],'id');for(var _0x1e3bd7=0x0,_0x239770={},_0x2d5daf={};_0x1e3bd7<_0x466598[_0x40ef('0x43')];_0x1e3bd7+=0x1){_0x239770=_0x466598[_0x1e3bd7];if(_[_0x40ef('0x41')](_0x503a9e[_0x40ef('0x1f')][_0x239770['id']])){_0x503a9e['zohoAccounts'][_0x239770['id']]=new ZohoAccount(_0x239770);}else{_0x503a9e[_0x40ef('0x46')](_0x503a9e[_0x40ef('0x1f')][_0x239770['id']],_0x239770);}}}return _0x503a9e[_0x40ef('0x1f')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4d')]=function(){var _0x423a55=this;return function(_0xa982fa){if(_0xa982fa){freeIsNotKey(_0xa982fa,_0x423a55[_0x40ef('0x20')],'id');for(var _0x51c1a9=0x0,_0x6e5b10={},_0x23541a={};_0x51c1a9<_0xa982fa[_0x40ef('0x43')];_0x51c1a9+=0x1){_0x6e5b10=_0xa982fa[_0x51c1a9];if(_[_0x40ef('0x41')](_0x423a55[_0x40ef('0x20')][_0x6e5b10['id']])){_0x423a55[_0x40ef('0x20')][_0x6e5b10['id']]=new DeskAccount(_0x6e5b10);}else{_0x423a55[_0x40ef('0x46')](_0x423a55['deskAccounts'][_0x6e5b10['id']],_0x6e5b10);}}}return _0x423a55[_0x40ef('0x20')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4e')]=function(){var _0x1bfce=this;return function(_0x483673){if(_0x483673){freeIsNotKey(_0x483673,_0x1bfce['sugarcrmAccounts'],'id');for(var _0x1d840c=0x0,_0x220b98={},_0x5909d5={};_0x1d840c<_0x483673[_0x40ef('0x43')];_0x1d840c+=0x1){_0x220b98=_0x483673[_0x1d840c];if(_[_0x40ef('0x41')](_0x1bfce[_0x40ef('0x1d')][_0x220b98['id']])){_0x1bfce['sugarcrmAccounts'][_0x220b98['id']]=new SugarcrmAccount(_0x220b98);}else{_0x1bfce[_0x40ef('0x46')](_0x1bfce[_0x40ef('0x1d')][_0x220b98['id']],_0x220b98);}}}return _0x1bfce['sugarcrmAccounts'];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x4f')]=function(){var _0x14ae5a=this;return function(_0x240665){if(_0x240665){freeIsNotKey(_0x240665,_0x14ae5a[_0x40ef('0x50')],'id');for(var _0x3e81a0=0x0,_0x4e5d23={},_0x1c7525={};_0x3e81a0<_0x240665[_0x40ef('0x43')];_0x3e81a0+=0x1){_0x4e5d23=_0x240665[_0x3e81a0];if(_[_0x40ef('0x41')](_0x14ae5a['vtigerAccounts'][_0x4e5d23['id']])){_0x14ae5a[_0x40ef('0x50')][_0x4e5d23['id']]=new VtigerAccount(_0x4e5d23);}else{_0x14ae5a['mergeFromDatabase'](_0x14ae5a[_0x40ef('0x50')][_0x4e5d23['id']],_0x4e5d23);}}}return _0x14ae5a[_0x40ef('0x50')];};};Realtime[_0x40ef('0x3e')]['initServicenowAccounts']=function(){var _0x41daac=this;return function(_0x1eae97){if(_0x1eae97){freeIsNotKey(_0x1eae97,_0x41daac['servicenowAccounts'],'id');for(var _0x245b91=0x0,_0x428777={},_0x1835b3={};_0x245b91<_0x1eae97['length'];_0x245b91+=0x1){_0x428777=_0x1eae97[_0x245b91];if(_[_0x40ef('0x41')](_0x41daac[_0x40ef('0x51')][_0x428777['id']])){_0x41daac[_0x40ef('0x51')][_0x428777['id']]=new ServicenowAccount(_0x428777);}else{_0x41daac[_0x40ef('0x46')](_0x41daac[_0x40ef('0x51')][_0x428777['id']],_0x428777);}}}return _0x41daac[_0x40ef('0x51')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x52')]=function(){var _0x1b7b3b=this;return function(_0x4ecd31){if(_0x4ecd31){freeIsNotKey(_0x4ecd31,_0x1b7b3b[_0x40ef('0x21')],'id');for(var _0x1825db=0x0,_0x382513={},_0x45754d={};_0x1825db<_0x4ecd31[_0x40ef('0x43')];_0x1825db+=0x1){_0x382513=_0x4ecd31[_0x1825db];if(_['isUndefined'](_0x1b7b3b[_0x40ef('0x21')][_0x382513['id']])){_0x1b7b3b[_0x40ef('0x21')][_0x382513['id']]=new Dynamics365Account(_0x382513);}else{_0x1b7b3b['mergeFromDatabase'](_0x1b7b3b[_0x40ef('0x21')][_0x382513['id']],_0x382513);}}}return _0x1b7b3b[_0x40ef('0x21')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x53')]=function(){var _0x1d4418=this;return function(_0x5c1f8f){if(_0x5c1f8f){freeIsNotKey(_0x5c1f8f,_0x1d4418[_0x40ef('0x54')],'id');for(var _0x4acff6=0x0,_0x181039={},_0x50ddb3={};_0x4acff6<_0x5c1f8f[_0x40ef('0x43')];_0x4acff6+=0x1){_0x181039=_0x5c1f8f[_0x4acff6];if(_[_0x40ef('0x41')](_0x1d4418[_0x40ef('0x54')][_0x181039['id']])){_0x1d4418['freshsalesAccounts'][_0x181039['id']]=new FreshsalesAccount(_0x181039);}else{_0x1d4418[_0x40ef('0x46')](_0x1d4418['freshsalesAccounts'][_0x181039['id']],_0x181039);}}}return _0x1d4418[_0x40ef('0x54')];};};Realtime['prototype'][_0x40ef('0x55')]=function(){var _0x279804=this;return function(_0x233dfd){for(var _0x349292=0x0;_0x349292<_0x233dfd[_0x40ef('0x43')];_0x349292+=0x1){_[_0x40ef('0x56')](_0x279804[_0x40ef('0x11')][_0x233dfd[_0x349292]['name']],_0x233dfd[_0x349292]);}return _0x279804[_0x40ef('0x11')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x57')]=function(){var _0x25276b=this;return function(_0x1ea879){clearVoiceQueues(_0x25276b['voiceQueues']);if(_0x1ea879){_0x1ea879=_[_0x40ef('0x58')](_0x1ea879,_0x40ef('0x59'));for(var _0x5c429a in _0x1ea879){if(_0x1ea879['hasOwnProperty'](_0x5c429a)){var _0x3d7e95={};for(var _0x3ebb10=0x0;_0x3ebb10<_0x1ea879[_0x5c429a][_0x40ef('0x43')];_0x3ebb10+=0x1){var _0x525865=_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5a')];if(_0x25276b[_0x40ef('0x11')][_0x525865]){if(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5b')]){_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x5c')]+=0x1;}if(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5d')]){_0x25276b[_0x40ef('0x11')][_0x525865]['abandoned']+=0x1;}_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2c')]+=moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5e')])[_0x40ef('0x5f')](moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x60')]),_0x40ef('0x61'))||0x0;if(_0x3ebb10===_0x1ea879[_0x5c429a]['length']-0x1){_0x25276b[_0x40ef('0x11')][_0x525865]['sumDuration']+=moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x62')]||_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x63')]||_0x1ea879[_0x5c429a][_0x3ebb10]['queuecallerexitAt'])[_0x40ef('0x5f')](moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x60')]),_0x40ef('0x61'))||0x0;_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2a')]+=0x1;if(_0x1ea879[_0x5c429a][_0x3ebb10]['queuecallercomplete']){_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2b')]+=0x1;_0x25276b['voiceQueues'][_0x525865][_0x40ef('0x2e')]+=moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x62')])['diff'](moment(_0x1ea879[_0x5c429a][_0x3ebb10][_0x40ef('0x5e')]),_0x40ef('0x61'))||0x0;}}else{_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2d')]+=_0x25276b[_0x40ef('0x11')][_0x525865][_0x40ef('0x2c')]||0x0;}}}}}}return _0x25276b[_0x40ef('0x11')];};};Realtime['prototype'][_0x40ef('0x64')]=function(){var _0xe5eb2c=this;return function(_0x14de22){clearVoiceCallReports(_0xe5eb2c[_0x40ef('0x65')]);if(_0x14de22){for(var _0xed2870=0x0;_0xed2870<_0x14de22[_0x40ef('0x43')];_0xed2870+=0x1){_0xe5eb2c['outbound']['total']+=0x1;_0xe5eb2c[_0x40ef('0x65')][_0x40ef('0x2d')]+=_0x14de22[_0xed2870]['duration'];if(_0x14de22[_0xed2870][_0x40ef('0x66')]===_0x40ef('0x67')){_0xe5eb2c[_0x40ef('0x65')][_0x40ef('0x2b')]+=0x1;_0xe5eb2c['outbound']['sumHoldTime']+=_0x14de22[_0xed2870][_0x40ef('0x68')]-_0x14de22[_0xed2870][_0x40ef('0x69')]||0x0;_0xe5eb2c['outbound'][_0x40ef('0x2e')]+=_0x14de22[_0xed2870]['billableseconds'];}}}return _0xe5eb2c[_0x40ef('0x65')];};};Realtime[_0x40ef('0x3e')][_0x40ef('0x6a')]=function(){var _0x1a6cea=this;return function(_0x19e355){if(_0x19e355){freeIsNotKey(_0x19e355,_0x1a6cea[_0x40ef('0x13')],_0x40ef('0x26'));for(var _0x55acbd=0x0,_0x50d069={};_0x55acbd<_0x19e355['length'];_0x55acbd+=0x1){_0x50d069=_0x19e355[_0x55acbd];if(_['isUndefined'](_0x1a6cea[_0x40ef('0x13')][_0x50d069[_0x40ef('0x26')]])){_0x1a6cea[_0x40ef('0x13')][_0x50d069[_0x40ef('0x26')]]=new Campaign(_0x50d069);}else{_0x1a6cea[_0x40ef('0x46')](_0x1a6cea['campaigns'][_0x50d069[_0x40ef('0x26')]],_0x50d069);_0x1a6cea[_0x40ef('0x13')][_0x50d069[_0x40ef('0x26')]][_0x40ef('0x6b')]=_0x50d069[_0x40ef('0x6c')]?_0x50d069[_0x40ef('0x6c')][_0x40ef('0x26')]:undefined;}}}return _0x1a6cea[_0x40ef('0x13')];};};Realtime['prototype'][_0x40ef('0x6d')]=function(){var _0x176377=this;return function(_0x391054){if(_0x391054){freeIsNotKey(_0x391054,_0x176377[_0x40ef('0x15')],'id');for(var _0x14d37f=0x0,_0x2553b2={};_0x14d37f<_0x391054[_0x40ef('0x43')];_0x14d37f+=0x1){_0x2553b2=_0x391054[_0x14d37f];if(_[_0x40ef('0x41')](_0x176377[_0x40ef('0x15')][_0x2553b2['id']])){_0x176377[_0x40ef('0x15')][_0x2553b2['id']]=new VoiceExtension(_0x2553b2);}else{_0x176377[_0x40ef('0x46')](_0x176377[_0x40ef('0x15')][_0x2553b2['id']],_0x2553b2);}}}return _0x176377[_0x40ef('0x15')];};};Realtime[_0x40ef('0x3e')]['initCampaignHopperHistory']=function(){var _0x4c7b1a=this;return function(_0x59b347){clearCampaigns(_0x4c7b1a[_0x40ef('0x13')]);for(var _0x43f8e9=0x0;_0x43f8e9<_0x59b347[_0x40ef('0x43')];_0x43f8e9+=0x1){_[_0x40ef('0x56')](_0x4c7b1a[_0x40ef('0x13')][_0x59b347[_0x43f8e9][_0x40ef('0x26')]],_0x59b347[_0x43f8e9]);}return _0x4c7b1a[_0x40ef('0x13')];};};Realtime[_0x40ef('0x3e')]['initFaxAccounts']=function(){var _0x22a17e=this;return function(_0x5261d5){if(_0x5261d5){freeIsNotKey(_0x5261d5,_0x22a17e[_0x40ef('0x22')],'id');for(var _0x2c14ad=0x0,_0x59e77e={},_0x406e27={};_0x2c14ad<_0x5261d5[_0x40ef('0x43')];_0x2c14ad+=0x1){_0x59e77e=_0x5261d5[_0x2c14ad];if(_[_0x40ef('0x41')](_0x22a17e[_0x40ef('0x22')][_0x59e77e['id']])){_0x22a17e[_0x40ef('0x22')][_0x59e77e['id']]=new FaxAccount(_0x59e77e);}else{_0x22a17e[_0x40ef('0x46')](_0x22a17e[_0x40ef('0x22')][_0x59e77e['id']],_0x59e77e);}}}return _0x22a17e['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0xef3f=['merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerleaveAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','util','lodash','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','agents','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','outboundChannels','timers','settings','salesforceAccounts','zohoAccounts','vtigerAccounts','freshsalesAccounts','mapKeys','format','name','isNil','SIP/%s','interface','hasOwnProperty','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isUndefined','telephones','initVoiceQueues','initTriggers','initTemplates','zendeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory'];(function(_0x35f901,_0x4dd58a){var _0x497a0a=function(_0xfdfa0b){while(--_0xfdfa0b){_0x35f901['push'](_0x35f901['shift']());}};_0x497a0a(++_0x4dd58a);}(_0xef3f,0xe2));var _0xfef3=function(_0x473837,_0x4e934c){_0x473837=_0x473837-0x0;var _0x29f745=_0xef3f[_0x473837];return _0x29f745;};'use strict';var util=require(_0xfef3('0x0'));var _=require(_0xfef3('0x1'));var moment=require('moment');var Agent=require(_0xfef3('0x2'));var Telephone=require(_0xfef3('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xfef3('0x4'));var Trigger=require(_0xfef3('0x5'));var Template=require(_0xfef3('0x6'));var Campaign=require(_0xfef3('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xfef3('0x8'));var SalesforceAccount=require(_0xfef3('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xfef3('0xa'));var ServicenowAccount=require(_0xfef3('0xb'));var Dynamics365Account=require(_0xfef3('0xc'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xfef3('0xd')]={};this['telephones']={};this[_0xfef3('0xe')]={};this[_0xfef3('0xf')]={};this[_0xfef3('0x10')]={};this[_0xfef3('0x11')]={};this[_0xfef3('0x12')]={};this[_0xfef3('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xfef3('0x14')]={};this['channels']={};this['queueChannels']={};this[_0xfef3('0x15')]={};this[_0xfef3('0x16')]={};this[_0xfef3('0x17')]={};this['zendeskAccounts']={};this[_0xfef3('0x18')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xfef3('0x19')]={};this['deskAccounts']={};this[_0xfef3('0x1a')]={};this['servicenowAccounts']={};this['dynamics365Accounts']={};this[_0xfef3('0x1b')]={};this['faxAccounts']={};};function freeIsNotKey(_0x4f157a,_0x466a83,_0x3bdfaa){var _0x4d0afc=_[_0xfef3('0x1c')](_0x4f157a,function(_0x371d31,_0x26e5e6){return _0x371d31[_0x3bdfaa];});for(var _0x227987 in _0x466a83){if(_0x466a83['hasOwnProperty'](_0x227987)){if(!_0x4d0afc[_0x227987]){delete _0x466a83[_0x227987];}}}}function freeIsNotKeySip(_0x21c564,_0x5d38b0){var _0x31dae7=_[_0xfef3('0x1c')](_0x21c564,function(_0x5d2fde,_0x46b052){return util[_0xfef3('0x1d')]('SIP/%s',_0x5d2fde[_0xfef3('0x1e')]);});for(var _0x48cf39 in _0x5d38b0){if(_0x5d38b0['hasOwnProperty'](_0x48cf39)){if(!_0x31dae7[_0x48cf39]){delete _0x5d38b0[_0x48cf39];}}}}function freeIsNotKeyAgent(_0x539f4e,_0x4c6979){var _0x107a71=_['mapKeys'](_0x539f4e,function(_0xa2e5d1,_0x4b11e1){var _0x256931=_[_0xfef3('0x1f')](_0xa2e5d1['interface'])?util['format'](_0xfef3('0x20'),_0xa2e5d1[_0xfef3('0x1e')]):_0xa2e5d1[_0xfef3('0x21')];return _0x256931;});for(var _0x153df9 in _0x4c6979){if(_0x4c6979[_0xfef3('0x22')](_0x153df9)){if(!_0x107a71[_0x153df9]){delete _0x4c6979[_0x153df9];}}}}function clearVoiceCallReports(_0x3f08a5){_0x3f08a5[_0xfef3('0x23')]=0x0;_0x3f08a5[_0xfef3('0x24')]=0x0;_0x3f08a5[_0xfef3('0x25')]=0x0;_0x3f08a5[_0xfef3('0x26')]=0x0;_0x3f08a5[_0xfef3('0x27')]=0x0;}function clearCampaigns(_0x3a8cba){if(!_[_0xfef3('0x28')](_0x3a8cba)){for(var _0x3a5ace in _0x3a8cba){if(_0x3a8cba['hasOwnProperty'](_0x3a5ace)){_0x3a8cba[_0x3a5ace][_0xfef3('0x29')]=0x0;_0x3a8cba[_0x3a5ace][_0xfef3('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x543c06){if(!_['isEmpty'](_0x543c06)){for(var _0x32812c in _0x543c06){if(_0x543c06[_0xfef3('0x22')](_0x32812c)){_0x543c06[_0x32812c][_0xfef3('0x23')]=0x0;_0x543c06[_0x32812c][_0xfef3('0x24')]=0x0;_0x543c06[_0x32812c]['unmanaged']=0x0;_0x543c06[_0x32812c]['abandoned']=0x0;_0x543c06[_0x32812c][_0xfef3('0x25')]=0x0;_0x543c06[_0x32812c][_0xfef3('0x26')]=0x0;_0x543c06[_0x32812c][_0xfef3('0x27')]=0x0;_0x543c06[_0x32812c][_0xfef3('0x2b')]=0x0;_0x543c06[_0x32812c][_0xfef3('0x2c')]=0x0;_0x543c06[_0x32812c][_0xfef3('0x2d')]=0x0;_0x543c06[_0x32812c]['outboundCongestionCallsDay']=0x0;_0x543c06[_0x32812c]['outboundNoSuchCallsDay']=0x0;_0x543c06[_0x32812c][_0xfef3('0x2e')]=0x0;_0x543c06[_0x32812c]['outboundDropCallsDayTimeout']=0x0;_0x543c06[_0x32812c][_0xfef3('0x2f')]=0x0;_0x543c06[_0x32812c]['outboundBlacklistCallsDay']=0x0;_0x543c06[_0x32812c][_0xfef3('0x30')]=0x0;_0x543c06[_0x32812c][_0xfef3('0x31')]=0x0;_0x543c06[_0x32812c]['outboundReCallsDay']=0x0;_0x543c06[_0x32812c]['outboundAnswerAgiCallsDay']=0x0;_0x543c06[_0x32812c][_0xfef3('0x32')]=0x0;_0x543c06[_0x32812c]['queueStatusComplete']=!![];}}}}Realtime[_0xfef3('0x33')][_0xfef3('0x34')]=function(_0x39efa0,_0x5caa78){for(var _0x4e3f70 in _0x5caa78){if(_0x39efa0[_0xfef3('0x22')](_0x4e3f70)){_0x39efa0[_0x4e3f70]=_0x5caa78[_0x4e3f70];}}};Realtime[_0xfef3('0x33')][_0xfef3('0x35')]=function(){var _0x566274=this;return function(_0x106c0d){if(_0x106c0d){freeIsNotKeyAgent(_0x106c0d,_0x566274[_0xfef3('0xd')]);for(var _0x4fb5e9=0x0,_0x1f859b={},_0x412173={};_0x4fb5e9<_0x106c0d[_0xfef3('0x36')];_0x4fb5e9+=0x1){_0x1f859b=_0x106c0d[_0x4fb5e9];var _0x1ca0c3=_['isNil'](_0x1f859b[_0xfef3('0x21')])?util['format']('SIP/%s',_0x1f859b[_0xfef3('0x1e')]):_0x1f859b[_0xfef3('0x21')];if(_[_0xfef3('0x37')](_0x566274[_0xfef3('0xd')][_0x1ca0c3])){_0x566274[_0xfef3('0xd')][_0x1ca0c3]=new Agent(_0x1f859b);}else{_0x566274['mergeFromDatabase'](_0x566274['agents'][_0x1ca0c3],_0x1f859b);}}}return _0x566274[_0xfef3('0xd')];};};Realtime[_0xfef3('0x33')]['initTelephones']=function(){var _0x301254=this;return function(_0x4d3868){if(_0x4d3868){freeIsNotKeySip(_0x4d3868,_0x301254[_0xfef3('0x38')]);for(var _0x36c919=0x0,_0x2f34db={},_0x2fd8c9={};_0x36c919<_0x4d3868['length'];_0x36c919+=0x1){_0x2f34db=_0x4d3868[_0x36c919];if(_[_0xfef3('0x37')](_0x301254[_0xfef3('0x38')][util[_0xfef3('0x1d')](_0xfef3('0x20'),_0x2f34db['name'])])){_0x301254['telephones'][util['format']('SIP/%s',_0x2f34db['name'])]=new Telephone(_0x2f34db);}else{_0x301254[_0xfef3('0x34')](_0x301254['telephones'][util['format']('SIP/%s',_0x2f34db[_0xfef3('0x1e')])],_0x2f34db);}}}return _0x301254[_0xfef3('0x38')];};};Realtime['prototype']['initTrunks']=function(){var _0x408238=this;return function(_0x3e30a4){if(_0x3e30a4){freeIsNotKeySip(_0x3e30a4,_0x408238[_0xfef3('0xe')]);for(var _0x197601=0x0,_0xc59136={},_0x12de2b={};_0x197601<_0x3e30a4[_0xfef3('0x36')];_0x197601+=0x1){_0xc59136=_0x3e30a4[_0x197601];if(_[_0xfef3('0x37')](_0x408238[_0xfef3('0xe')][util[_0xfef3('0x1d')](_0xfef3('0x20'),_0xc59136['name'])])){_0x408238[_0xfef3('0xe')][util[_0xfef3('0x1d')](_0xfef3('0x20'),_0xc59136['name'])]=new Trunk(_0xc59136);}else{_0x408238[_0xfef3('0x34')](_0x408238[_0xfef3('0xe')][util[_0xfef3('0x1d')](_0xfef3('0x20'),_0xc59136[_0xfef3('0x1e')])],_0xc59136);}}}return _0x408238[_0xfef3('0xe')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x39')]=function(){var _0x43d325=this;return function(_0x4ccc18){if(_0x4ccc18){freeIsNotKey(_0x4ccc18,_0x43d325[_0xfef3('0xf')],'name');for(var _0x3129a7=0x0,_0x61860e={},_0x42f22c={};_0x3129a7<_0x4ccc18[_0xfef3('0x36')];_0x3129a7+=0x1){_0x61860e=_0x4ccc18[_0x3129a7];if(_[_0xfef3('0x37')](_0x43d325['voiceQueues'][_0x61860e[_0xfef3('0x1e')]])){_0x43d325[_0xfef3('0xf')][_0x61860e['name']]=new VoiceQueue(_0x61860e);}else{_0x43d325[_0xfef3('0x34')](_0x43d325[_0xfef3('0xf')][_0x61860e[_0xfef3('0x1e')]],_0x61860e);}}}return _0x43d325[_0xfef3('0xf')];};};Realtime['prototype'][_0xfef3('0x3a')]=function(){var _0x5159fa=this;return function(_0x20e38d){if(_0x20e38d){freeIsNotKey(_0x20e38d,_0x5159fa['triggers'],'id');for(var _0x985bba=0x0,_0xd3c4c6={},_0x164c1a={};_0x985bba<_0x20e38d['length'];_0x985bba+=0x1){_0xd3c4c6=_0x20e38d[_0x985bba];if(_[_0xfef3('0x37')](_0x5159fa[_0xfef3('0x10')][_0xd3c4c6['id']])){_0x5159fa[_0xfef3('0x10')][_0xd3c4c6['id']]=new Trigger(_0xd3c4c6);}else{_0x5159fa[_0xfef3('0x34')](_0x5159fa[_0xfef3('0x10')][_0xd3c4c6['id']],_0xd3c4c6);}}}return _0x5159fa[_0xfef3('0x10')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x3b')]=function(){var _0x144333=this;return function(_0x361eaf){if(_0x361eaf){freeIsNotKey(_0x361eaf,_0x144333[_0xfef3('0x12')],'id');for(var _0x4a2f4e=0x0,_0x21d7fb={},_0x8c69dd={};_0x4a2f4e<_0x361eaf[_0xfef3('0x36')];_0x4a2f4e+=0x1){_0x21d7fb=_0x361eaf[_0x4a2f4e];if(_[_0xfef3('0x37')](_0x144333[_0xfef3('0x12')][_0x21d7fb['id']])){_0x144333[_0xfef3('0x12')][_0x21d7fb['id']]=new Template(_0x21d7fb);}else{_0x144333['mergeFromDatabase'](_0x144333[_0xfef3('0x12')][_0x21d7fb['id']],_0x21d7fb);}}}return _0x144333[_0xfef3('0x12')];};};Realtime[_0xfef3('0x33')]['initZendeskAccounts']=function(){var _0x4c1a1b=this;return function(_0x2e4257){if(_0x2e4257){freeIsNotKey(_0x2e4257,_0x4c1a1b[_0xfef3('0x3c')],'id');for(var _0x46c7f9=0x0,_0x444e8a={},_0x2c4efd={};_0x46c7f9<_0x2e4257[_0xfef3('0x36')];_0x46c7f9+=0x1){_0x444e8a=_0x2e4257[_0x46c7f9];if(_[_0xfef3('0x37')](_0x4c1a1b['zendeskAccounts'][_0x444e8a['id']])){_0x4c1a1b[_0xfef3('0x3c')][_0x444e8a['id']]=new ZendeskAccount(_0x444e8a);}else{_0x4c1a1b[_0xfef3('0x34')](_0x4c1a1b[_0xfef3('0x3c')][_0x444e8a['id']],_0x444e8a);}}}return _0x4c1a1b[_0xfef3('0x3c')];};};Realtime[_0xfef3('0x33')]['initSalesforceAccounts']=function(){var _0x3de1fe=this;return function(_0x5cc66b){if(_0x5cc66b){freeIsNotKey(_0x5cc66b,_0x3de1fe[_0xfef3('0x18')],'id');for(var _0x33f4a5=0x0,_0x28e180={},_0x42f123={};_0x33f4a5<_0x5cc66b[_0xfef3('0x36')];_0x33f4a5+=0x1){_0x28e180=_0x5cc66b[_0x33f4a5];if(_[_0xfef3('0x37')](_0x3de1fe['salesforceAccounts'][_0x28e180['id']])){_0x3de1fe['salesforceAccounts'][_0x28e180['id']]=new SalesforceAccount(_0x28e180);}else{_0x3de1fe[_0xfef3('0x34')](_0x3de1fe[_0xfef3('0x18')][_0x28e180['id']],_0x28e180);}}}return _0x3de1fe[_0xfef3('0x18')];};};Realtime[_0xfef3('0x33')]['initFreshdeskAccounts']=function(){var _0x16aff6=this;return function(_0x578159){if(_0x578159){freeIsNotKey(_0x578159,_0x16aff6['freshdeskAccounts'],'id');for(var _0x305599=0x0,_0x148dec={},_0x60ef60={};_0x305599<_0x578159[_0xfef3('0x36')];_0x305599+=0x1){_0x148dec=_0x578159[_0x305599];if(_[_0xfef3('0x37')](_0x16aff6['freshdeskAccounts'][_0x148dec['id']])){_0x16aff6[_0xfef3('0x3d')][_0x148dec['id']]=new FreshdeskAccount(_0x148dec);}else{_0x16aff6[_0xfef3('0x34')](_0x16aff6[_0xfef3('0x3d')][_0x148dec['id']],_0x148dec);}}}return _0x16aff6['freshdeskAccounts'];};};Realtime[_0xfef3('0x33')][_0xfef3('0x3e')]=function(){var _0x25c69e=this;return function(_0x5e7d58){if(_0x5e7d58){freeIsNotKey(_0x5e7d58,_0x25c69e[_0xfef3('0x19')],'id');for(var _0x3ed5ec=0x0,_0x441a09={},_0x1e9263={};_0x3ed5ec<_0x5e7d58[_0xfef3('0x36')];_0x3ed5ec+=0x1){_0x441a09=_0x5e7d58[_0x3ed5ec];if(_[_0xfef3('0x37')](_0x25c69e[_0xfef3('0x19')][_0x441a09['id']])){_0x25c69e['zohoAccounts'][_0x441a09['id']]=new ZohoAccount(_0x441a09);}else{_0x25c69e[_0xfef3('0x34')](_0x25c69e[_0xfef3('0x19')][_0x441a09['id']],_0x441a09);}}}return _0x25c69e[_0xfef3('0x19')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x3f')]=function(){var _0x302a7b=this;return function(_0x4ed080){if(_0x4ed080){freeIsNotKey(_0x4ed080,_0x302a7b[_0xfef3('0x40')],'id');for(var _0x29be01=0x0,_0x22ab88={},_0x728a28={};_0x29be01<_0x4ed080[_0xfef3('0x36')];_0x29be01+=0x1){_0x22ab88=_0x4ed080[_0x29be01];if(_[_0xfef3('0x37')](_0x302a7b['deskAccounts'][_0x22ab88['id']])){_0x302a7b[_0xfef3('0x40')][_0x22ab88['id']]=new DeskAccount(_0x22ab88);}else{_0x302a7b[_0xfef3('0x34')](_0x302a7b[_0xfef3('0x40')][_0x22ab88['id']],_0x22ab88);}}}return _0x302a7b['deskAccounts'];};};Realtime[_0xfef3('0x33')][_0xfef3('0x41')]=function(){var _0x5b3fbf=this;return function(_0x4f212d){if(_0x4f212d){freeIsNotKey(_0x4f212d,_0x5b3fbf[_0xfef3('0x42')],'id');for(var _0x50c10d=0x0,_0x17e623={},_0x313679={};_0x50c10d<_0x4f212d[_0xfef3('0x36')];_0x50c10d+=0x1){_0x17e623=_0x4f212d[_0x50c10d];if(_['isUndefined'](_0x5b3fbf[_0xfef3('0x42')][_0x17e623['id']])){_0x5b3fbf[_0xfef3('0x42')][_0x17e623['id']]=new SugarcrmAccount(_0x17e623);}else{_0x5b3fbf[_0xfef3('0x34')](_0x5b3fbf['sugarcrmAccounts'][_0x17e623['id']],_0x17e623);}}}return _0x5b3fbf[_0xfef3('0x42')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x43')]=function(){var _0x4fe9b8=this;return function(_0x1f986d){if(_0x1f986d){freeIsNotKey(_0x1f986d,_0x4fe9b8['vtigerAccounts'],'id');for(var _0x473581=0x0,_0x84cd63={},_0x473478={};_0x473581<_0x1f986d[_0xfef3('0x36')];_0x473581+=0x1){_0x84cd63=_0x1f986d[_0x473581];if(_[_0xfef3('0x37')](_0x4fe9b8[_0xfef3('0x1a')][_0x84cd63['id']])){_0x4fe9b8[_0xfef3('0x1a')][_0x84cd63['id']]=new VtigerAccount(_0x84cd63);}else{_0x4fe9b8['mergeFromDatabase'](_0x4fe9b8['vtigerAccounts'][_0x84cd63['id']],_0x84cd63);}}}return _0x4fe9b8[_0xfef3('0x1a')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x44')]=function(){var _0x4c119d=this;return function(_0x358aad){if(_0x358aad){freeIsNotKey(_0x358aad,_0x4c119d[_0xfef3('0x45')],'id');for(var _0x893550=0x0,_0x4f099e={},_0x33731d={};_0x893550<_0x358aad[_0xfef3('0x36')];_0x893550+=0x1){_0x4f099e=_0x358aad[_0x893550];if(_[_0xfef3('0x37')](_0x4c119d[_0xfef3('0x45')][_0x4f099e['id']])){_0x4c119d[_0xfef3('0x45')][_0x4f099e['id']]=new ServicenowAccount(_0x4f099e);}else{_0x4c119d[_0xfef3('0x34')](_0x4c119d[_0xfef3('0x45')][_0x4f099e['id']],_0x4f099e);}}}return _0x4c119d['servicenowAccounts'];};};Realtime['prototype'][_0xfef3('0x46')]=function(){var _0x2fcfb0=this;return function(_0x7f01de){if(_0x7f01de){freeIsNotKey(_0x7f01de,_0x2fcfb0['dynamics365Accounts'],'id');for(var _0x4d8ce7=0x0,_0x402fdb={},_0x5d3845={};_0x4d8ce7<_0x7f01de[_0xfef3('0x36')];_0x4d8ce7+=0x1){_0x402fdb=_0x7f01de[_0x4d8ce7];if(_[_0xfef3('0x37')](_0x2fcfb0[_0xfef3('0x47')][_0x402fdb['id']])){_0x2fcfb0[_0xfef3('0x47')][_0x402fdb['id']]=new Dynamics365Account(_0x402fdb);}else{_0x2fcfb0[_0xfef3('0x34')](_0x2fcfb0[_0xfef3('0x47')][_0x402fdb['id']],_0x402fdb);}}}return _0x2fcfb0[_0xfef3('0x47')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x48')]=function(){var _0xd04599=this;return function(_0x3071de){if(_0x3071de){freeIsNotKey(_0x3071de,_0xd04599[_0xfef3('0x1b')],'id');for(var _0x1f79ed=0x0,_0x52e97f={},_0x17e5ca={};_0x1f79ed<_0x3071de['length'];_0x1f79ed+=0x1){_0x52e97f=_0x3071de[_0x1f79ed];if(_[_0xfef3('0x37')](_0xd04599[_0xfef3('0x1b')][_0x52e97f['id']])){_0xd04599[_0xfef3('0x1b')][_0x52e97f['id']]=new FreshsalesAccount(_0x52e97f);}else{_0xd04599[_0xfef3('0x34')](_0xd04599[_0xfef3('0x1b')][_0x52e97f['id']],_0x52e97f);}}}return _0xd04599[_0xfef3('0x1b')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x49')]=function(){var _0x1cea9c=this;return function(_0x31a091){for(var _0x5f493d=0x0;_0x5f493d<_0x31a091['length'];_0x5f493d+=0x1){_[_0xfef3('0x4a')](_0x1cea9c[_0xfef3('0xf')][_0x31a091[_0x5f493d][_0xfef3('0x1e')]],_0x31a091[_0x5f493d]);}return _0x1cea9c[_0xfef3('0xf')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x4b')]=function(){var _0x59feef=this;return function(_0x1c629c){clearVoiceQueues(_0x59feef[_0xfef3('0xf')]);if(_0x1c629c){_0x1c629c=_[_0xfef3('0x4c')](_0x1c629c,_0xfef3('0x4d'));for(var _0x434ab8 in _0x1c629c){if(_0x1c629c[_0xfef3('0x22')](_0x434ab8)){var _0x5edf73={};for(var _0x4f2b17=0x0;_0x4f2b17<_0x1c629c[_0x434ab8][_0xfef3('0x36')];_0x4f2b17+=0x1){var _0x42524e=_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x4e')];if(_0x59feef['voiceQueues'][_0x42524e]){if(_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x4f')]){_0x59feef['voiceQueues'][_0x42524e][_0xfef3('0x50')]+=0x1;}if(_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x51')]){_0x59feef[_0xfef3('0xf')][_0x42524e][_0xfef3('0x52')]+=0x1;}_0x59feef[_0xfef3('0xf')][_0x42524e][_0xfef3('0x25')]+=moment(_0x1c629c[_0x434ab8][_0x4f2b17]['queuecallerleaveAt'])[_0xfef3('0x53')](moment(_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x54')]),_0xfef3('0x55'))||0x0;if(_0x4f2b17===_0x1c629c[_0x434ab8][_0xfef3('0x36')]-0x1){_0x59feef[_0xfef3('0xf')][_0x42524e][_0xfef3('0x26')]+=moment(_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x56')]||_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x57')]||_0x1c629c[_0x434ab8][_0x4f2b17]['queuecallerexitAt'])[_0xfef3('0x53')](moment(_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x54')]),'seconds')||0x0;_0x59feef['voiceQueues'][_0x42524e][_0xfef3('0x23')]+=0x1;if(_0x1c629c[_0x434ab8][_0x4f2b17]['queuecallercomplete']){_0x59feef['voiceQueues'][_0x42524e]['answered']+=0x1;_0x59feef[_0xfef3('0xf')][_0x42524e][_0xfef3('0x27')]+=moment(_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x56')])[_0xfef3('0x53')](moment(_0x1c629c[_0x434ab8][_0x4f2b17][_0xfef3('0x58')]),_0xfef3('0x55'))||0x0;}}else{_0x59feef[_0xfef3('0xf')][_0x42524e][_0xfef3('0x26')]+=_0x59feef[_0xfef3('0xf')][_0x42524e][_0xfef3('0x25')]||0x0;}}}}}}return _0x59feef[_0xfef3('0xf')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x59')]=function(){var _0x35ac77=this;return function(_0x437b37){clearVoiceCallReports(_0x35ac77[_0xfef3('0x13')]);if(_0x437b37){for(var _0x28f7d7=0x0;_0x28f7d7<_0x437b37['length'];_0x28f7d7+=0x1){_0x35ac77['outbound'][_0xfef3('0x23')]+=0x1;_0x35ac77[_0xfef3('0x13')][_0xfef3('0x26')]+=_0x437b37[_0x28f7d7][_0xfef3('0x5a')];if(_0x437b37[_0x28f7d7][_0xfef3('0x5b')]===_0xfef3('0x5c')){_0x35ac77[_0xfef3('0x13')][_0xfef3('0x24')]+=0x1;_0x35ac77[_0xfef3('0x13')][_0xfef3('0x25')]+=_0x437b37[_0x28f7d7][_0xfef3('0x5a')]-_0x437b37[_0x28f7d7][_0xfef3('0x5d')]||0x0;_0x35ac77[_0xfef3('0x13')]['sumBillable']+=_0x437b37[_0x28f7d7][_0xfef3('0x5d')];}}}return _0x35ac77[_0xfef3('0x13')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x5e')]=function(){var _0x514114=this;return function(_0x43032e){if(_0x43032e){freeIsNotKey(_0x43032e,_0x514114[_0xfef3('0x11')],'name');for(var _0x2d006e=0x0,_0x18d0df={};_0x2d006e<_0x43032e[_0xfef3('0x36')];_0x2d006e+=0x1){_0x18d0df=_0x43032e[_0x2d006e];if(_['isUndefined'](_0x514114[_0xfef3('0x11')][_0x18d0df[_0xfef3('0x1e')]])){_0x514114['campaigns'][_0x18d0df[_0xfef3('0x1e')]]=new Campaign(_0x18d0df);}else{_0x514114['mergeFromDatabase'](_0x514114[_0xfef3('0x11')][_0x18d0df[_0xfef3('0x1e')]],_0x18d0df);_0x514114[_0xfef3('0x11')][_0x18d0df[_0xfef3('0x1e')]]['dialQueueProject']=_0x18d0df['SquareProject']?_0x18d0df[_0xfef3('0x5f')][_0xfef3('0x1e')]:undefined;}}}return _0x514114['campaigns'];};};Realtime[_0xfef3('0x33')]['initVoiceExtensions']=function(){var _0x2eca29=this;return function(_0x507bab){if(_0x507bab){freeIsNotKey(_0x507bab,_0x2eca29[_0xfef3('0x14')],'id');for(var _0x1b8c89=0x0,_0x37fc10={};_0x1b8c89<_0x507bab[_0xfef3('0x36')];_0x1b8c89+=0x1){_0x37fc10=_0x507bab[_0x1b8c89];if(_['isUndefined'](_0x2eca29[_0xfef3('0x14')][_0x37fc10['id']])){_0x2eca29[_0xfef3('0x14')][_0x37fc10['id']]=new VoiceExtension(_0x37fc10);}else{_0x2eca29['mergeFromDatabase'](_0x2eca29['voiceExtensions'][_0x37fc10['id']],_0x37fc10);}}}return _0x2eca29[_0xfef3('0x14')];};};Realtime[_0xfef3('0x33')][_0xfef3('0x60')]=function(){var _0x266d7c=this;return function(_0x1c4b3d){clearCampaigns(_0x266d7c['campaigns']);for(var _0x1e4c8f=0x0;_0x1e4c8f<_0x1c4b3d[_0xfef3('0x36')];_0x1e4c8f+=0x1){_[_0xfef3('0x4a')](_0x266d7c[_0xfef3('0x11')][_0x1c4b3d[_0x1e4c8f][_0xfef3('0x1e')]],_0x1c4b3d[_0x1e4c8f]);}return _0x266d7c[_0xfef3('0x11')];};};Realtime['prototype'][_0xfef3('0x61')]=function(){var _0x23bf6b=this;return function(_0x286e31){if(_0x286e31){freeIsNotKey(_0x286e31,_0x23bf6b[_0xfef3('0x62')],'id');for(var _0x33237e=0x0,_0x180716={},_0x3bdc5e={};_0x33237e<_0x286e31[_0xfef3('0x36')];_0x33237e+=0x1){_0x180716=_0x286e31[_0x33237e];if(_[_0xfef3('0x37')](_0x23bf6b[_0xfef3('0x62')][_0x180716['id']])){_0x23bf6b['faxAccounts'][_0x180716['id']]=new FaxAccount(_0x180716);}else{_0x23bf6b[_0xfef3('0x34')](_0x23bf6b[_0xfef3('0x62')][_0x180716['id']],_0x180716);}}}return _0x23bf6b[_0xfef3('0x62')];};};module[_0xfef3('0x63')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 0479123..39f440c 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 _0xa491=['getCallType','channel','split','calleridnum','outbound','internal','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','originatecalleridnum','calleridpreview','disposition','ANSWERED','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','membername','monitor','monitors','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','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','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','agents','interface','format','SIP/%s','length','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys'];(function(_0x58d9c4,_0xa1dec3){var _0x41287=function(_0x1fd39b){while(--_0x1fd39b){_0x58d9c4['push'](_0x58d9c4['shift']());}};_0x41287(++_0xa1dec3);}(_0xa491,0x1c7));var _0x1a49=function(_0x688dcf,_0xbf0adb){_0x688dcf=_0x688dcf-0x0;var _0x34ef2b=_0xa491[_0x688dcf];return _0x34ef2b;};'use strict';var _=require(_0x1a49('0x0'));var moment=require(_0x1a49('0x1'));var util=require(_0x1a49('0x2'));var config=require(_0x1a49('0x3'));var ami=require(_0x1a49('0x4'));var RpcVoiceAgentReport=require(_0x1a49('0x5'));var RpcVoiceCallReport=require(_0x1a49('0x6'));var RpcVoiceDialReport=require(_0x1a49('0x7'));var RpcMemberReport=require(_0x1a49('0x8'));var RpcVoiceQueueReport=require(_0x1a49('0x9'));var RpcVoiceRecording=require(_0x1a49('0xa'));var RpcVoiceTransferReport=require(_0x1a49('0xb'));var VoiceQueueReport=require(_0x1a49('0xc'));var VoiceCallReport=require(_0x1a49('0xd'));var VoiceAgentReport=require(_0x1a49('0xe'));var VoiceDialReport=require(_0x1a49('0xf'));var UserReport=require(_0x1a49('0x10'));function Report(_0x535a20){this['realtime']=_0x535a20;this['agents']=_0x535a20['agents'];this[_0x1a49('0x11')]=_0x535a20['telephones'];}Report[_0x1a49('0x12')][_0x1a49('0x13')]=function(_0x324539){var _0x4f00ed=new VoiceQueueReport(this[_0x1a49('0x14')]);var _0x417026=new VoiceAgentReport(this['realtime']);var _0x19189c=new VoiceDialReport(this['realtime']);var _0x26beee=new VoiceCallReport(this[_0x1a49('0x14')]);var _0x530ce3=new UserReport(this[_0x1a49('0x14')]);if(config['xdr']&&config[_0x1a49('0x15')][_0x1a49('0x16')]){ami['on'](_0x1a49('0x17'),this[_0x1a49('0x18')][_0x1a49('0x19')](this));ami['on'](_0x1a49('0x1a'),this['voiceCallReport'][_0x1a49('0x19')](this));ami['on'](_0x1a49('0x1b'),this[_0x1a49('0x1c')]['bind'](this));ami['on'](_0x1a49('0x1d'),this['voiceDialReport'][_0x1a49('0x19')](this));ami['on'](_0x1a49('0x1e'),this[_0x1a49('0x1f')][_0x1a49('0x19')](this));ami['on'](_0x1a49('0x20'),this[_0x1a49('0x21')][_0x1a49('0x19')](this));}};Report[_0x1a49('0x12')][_0x1a49('0x22')]=function(_0xb64054){var _0x2e9335;_0x2e9335=_[_0x1a49('0x23')](this['agents'],function(_0x2f0dfc){return _0x2f0dfc[_0x1a49('0x24')]==_0xb64054||_0x2f0dfc[_0x1a49('0x25')]==_0xb64054;});if(_[_0x1a49('0x26')](_0x2e9335)){var _0x123c06=_['find'](this[_0x1a49('0x11')],function(_0x519958){return _0x519958[_0x1a49('0x24')]==_0xb64054||_0x519958[_0x1a49('0x25')]==_0xb64054;});if(_0x123c06){_0x2e9335=_[_0x1a49('0x23')](this[_0x1a49('0x27')],function(_0x58c520){return _0x58c520[_0x1a49('0x28')]==util[_0x1a49('0x29')](_0x1a49('0x2a'),_0x123c06[_0x1a49('0x25')]);});}}return _0x2e9335;};Report[_0x1a49('0x12')][_0x1a49('0x18')]=function(_0x4b890c){for(var _0x57479f=0x0;_0x57479f<_0x4b890c[_0x1a49('0x2b')];_0x57479f+=0x1){var _0x48438a=this[_0x1a49('0x22')](_0x4b890c[_0x57479f][_0x1a49('0x2c')]);if(_0x48438a){_0x4b890c[_0x57479f]['accountcode']=_0x48438a[_0x1a49('0x24')];_0x4b890c[_0x57479f]['assigned']=!![];_0x4b890c[_0x57479f][_0x1a49('0x2d')]=_0x48438a[_0x1a49('0x25')];_0x4b890c[_0x57479f][_0x1a49('0x28')]=_[_0x1a49('0x26')](_0x48438a[_0x1a49('0x28')])?util['format'](_0x1a49('0x2a'),_0x48438a['name']):_0x48438a[_0x1a49('0x28')];if(_0x4b890c[_0x57479f][_0x1a49('0x2e')]){_0x4b890c[_0x57479f][_0x1a49('0x2f')]=moment()[_0x1a49('0x29')](_0x1a49('0x30'));}if(_0x4b890c[_0x57479f][_0x1a49('0x31')]){_0x4b890c[_0x57479f][_0x1a49('0x32')]=moment()[_0x1a49('0x29')](_0x1a49('0x30'));}RpcMemberReport[_0x1a49('0x18')](_0x4b890c[_0x57479f]);}RpcVoiceQueueReport[_0x1a49('0x33')](_0x4b890c[_0x57479f]);}};function extractCalleridNumber(_0x46694d){var _0x42dfda=_0x46694d[_0x1a49('0x34')](/<(.*?)>/);return _0x42dfda?_0x42dfda[0x1]:_0x46694d;}Report[_0x1a49('0x12')][_0x1a49('0x35')]=function(_0x40712c){for(var _0x3c976a=0x0;_0x3c976a',_0x10550e[_0x1a49('0x4c')],_0x10550e['calleridnum']);}if(RpcVoiceTransferReport[_0x1a49('0x4d')][_0x10550e['linkedid']]){var _0x2a820e=RpcVoiceTransferReport['transfers'][_0x10550e[_0x1a49('0x4e')]];_0x2a820e[_0x1a49('0x4f')]=_0x10550e[_0x1a49('0x50')];RpcVoiceTransferReport['blindTransfer'](_0x2a820e);delete RpcVoiceTransferReport[_0x1a49('0x4d')][_0x10550e['linkedid']];}if(_[_0x1a49('0x26')](_0x10550e['type'])){_0x10550e[_0x1a49('0x3e')]=this[_0x1a49('0x37')](_0x10550e);}if(_[_0x1a49('0x26')](_0x10550e['UserId'])){var _0x13a291=_0x10550e[_0x1a49('0x38')][_0x1a49('0x39')]('-')[0x0];var _0x1b041e=this[_0x1a49('0x27')][_0x13a291];if(!_0x1b041e)_0x1b041e=this['getAgentByInternal'](_0x10550e[_0x1a49('0x24')]);if(_0x1b041e){_0x10550e[_0x1a49('0x51')]=_0x1b041e['id'];_0x10550e[_0x1a49('0x52')]=_0x1b041e[_0x1a49('0x25')];}}RpcVoiceCallReport[_0x1a49('0x33')](_0x10550e);if(_0x10550e[_0x1a49('0x53')]){for(var _0x2d487f=0x0;_0x2d487f<_0x10550e[_0x1a49('0x54')][_0x1a49('0x2b')];_0x2d487f+=0x1){_0x10550e[_0x1a49('0x55')]=_0x10550e[_0x1a49('0x54')][_0x2d487f][_0x1a49('0x56')];_0x10550e[_0x1a49('0x57')]=_0x10550e[_0x1a49('0x54')][_0x2d487f]['createdAt'];if(_0x10550e[_0x1a49('0x58')]=='xcally-motion-preview'){_0x10550e[_0x1a49('0x3a')]=_0x10550e[_0x1a49('0x2c')];_0x10550e[_0x1a49('0x4c')]=_0x10550e[_0x1a49('0x59')];_0x10550e[_0x1a49('0x2c')]=_0x10550e[_0x1a49('0x24')];_0x10550e[_0x1a49('0x59')]=_0x10550e['membername'];_0x10550e['exten']=_0x10550e['originatecalleridnum'];}else if(_0x10550e[_0x1a49('0x58')]==_0x1a49('0x5a')){_0x10550e[_0x1a49('0x3a')]=_0x10550e['destination'];_0x10550e[_0x1a49('0x58')]=_0x10550e['originatecalleridnum'];}RpcVoiceRecording[_0x1a49('0x33')](_0x10550e);}}};Report[_0x1a49('0x12')][_0x1a49('0x1c')]=function(_0x335f4d){if(_[_0x1a49('0x5b')](_0x335f4d)){_0x335f4d['forEach'](function(_0x3f5b02){RpcVoiceAgentReport[_0x1a49('0x33')](_0x3f5b02);});}else{RpcVoiceAgentReport[_0x1a49('0x33')](_0x335f4d);}};Report[_0x1a49('0x12')][_0x1a49('0x5c')]=function(_0x162fe6){RpcVoiceDialReport[_0x1a49('0x33')](_0x162fe6);var _0xffbf00;var _0x589045;var _0x3a64ee=_0x162fe6[_0x1a49('0x38')];if(_[_0x1a49('0x5d')](_0x3a64ee,_0x1a49('0x5e'))){_0x589045=_0x3a64ee[_0x1a49('0x5f')](_0x3a64ee[_0x1a49('0x60')]('/')+0x1,_0x3a64ee['indexOf']('@'));_0xffbf00=_[_0x1a49('0x23')](this[_0x1a49('0x27')],function(_0x1308d9){return _0x1308d9[_0x1a49('0x61')]==_0x589045||_0x1308d9[_0x1a49('0x62')]==_0x589045||_0x1308d9[_0x1a49('0x24')]==_0x589045;});}else{_0x589045=_0x3a64ee[_0x1a49('0x5f')](_0x3a64ee[_0x1a49('0x60')]('/')+0x1,_0x3a64ee[_0x1a49('0x63')]('-'));_0xffbf00=this[_0x1a49('0x22')](_0x589045);}if(_0xffbf00){_0x162fe6['interface']=_['isNil'](_0xffbf00[_0x1a49('0x28')])?util[_0x1a49('0x29')](_0x1a49('0x2a'),_0xffbf00[_0x1a49('0x25')]):_0xffbf00[_0x1a49('0x28')];_0x162fe6['membername']=_0xffbf00['name'];_0x162fe6[_0x1a49('0x24')]=_0xffbf00['accountcode'];RpcMemberReport[_0x1a49('0x5c')](_0x162fe6);}};Report[_0x1a49('0x12')]['blindTransfer']=function(_0x18a416){RpcVoiceTransferReport[_0x1a49('0x4d')][_0x18a416[_0x1a49('0x64')]]=_0x18a416;};Report['prototype']['attendedTransfer']=function(_0xb0a7a1){RpcVoiceTransferReport[_0x1a49('0x21')](_0xb0a7a1);};module[_0x1a49('0x65')]=Report; \ No newline at end of file +var _0x1d0b=['monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','prototype','sync','realtime','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','isNil','interface','format','SIP/%s','voiceQueueReport','length','connectedlinenum','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','getCallType','channel','split','outbound','internal','exten','type','dialer','lastapplication','lastdata','from-voip-provider','context','from-sip','destination','xcally-motion-preview','calleridnum','destinationchannel','callerid','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','membername','create'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1d0b,0x1f3));var _0xb1d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d0b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb1d0('0x0'));var moment=require(_0xb1d0('0x1'));var util=require(_0xb1d0('0x2'));var config=require(_0xb1d0('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xb1d0('0x4'));var RpcVoiceDialReport=require(_0xb1d0('0x5'));var RpcMemberReport=require(_0xb1d0('0x6'));var RpcVoiceQueueReport=require(_0xb1d0('0x7'));var RpcVoiceRecording=require(_0xb1d0('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xb1d0('0x9'));var VoiceCallReport=require(_0xb1d0('0xa'));var VoiceAgentReport=require(_0xb1d0('0xb'));var VoiceDialReport=require(_0xb1d0('0xc'));var UserReport=require('./userReport');function Report(_0x2c38c9){this['realtime']=_0x2c38c9;this[_0xb1d0('0xd')]=_0x2c38c9[_0xb1d0('0xd')];this[_0xb1d0('0xe')]=_0x2c38c9[_0xb1d0('0xe')];}Report[_0xb1d0('0xf')][_0xb1d0('0x10')]=function(_0x3aa47c){var _0x7dc431=new VoiceQueueReport(this[_0xb1d0('0x11')]);var _0xf9be64=new VoiceAgentReport(this['realtime']);var _0x427a1d=new VoiceDialReport(this[_0xb1d0('0x11')]);var _0x1bd5b9=new VoiceCallReport(this[_0xb1d0('0x11')]);var _0x4ea9be=new UserReport(this[_0xb1d0('0x11')]);if(config[_0xb1d0('0x12')]&&config[_0xb1d0('0x12')]['disabled']){ami['on'](_0xb1d0('0x13'),this['voiceQueueReport'][_0xb1d0('0x14')](this));ami['on'](_0xb1d0('0x15'),this[_0xb1d0('0x16')][_0xb1d0('0x14')](this));ami['on'](_0xb1d0('0x17'),this[_0xb1d0('0x18')]['bind'](this));ami['on'](_0xb1d0('0x19'),this[_0xb1d0('0x1a')]['bind'](this));ami['on'](_0xb1d0('0x1b'),this[_0xb1d0('0x1c')][_0xb1d0('0x14')](this));ami['on'](_0xb1d0('0x1d'),this['attendedTransfer'][_0xb1d0('0x14')](this));}};Report['prototype'][_0xb1d0('0x1e')]=function(_0x493f41){var _0x3e2696;_0x3e2696=_[_0xb1d0('0x1f')](this[_0xb1d0('0xd')],function(_0x1bf1e5){return _0x1bf1e5[_0xb1d0('0x20')]==_0x493f41||_0x1bf1e5[_0xb1d0('0x21')]==_0x493f41;});if(_[_0xb1d0('0x22')](_0x3e2696)){var _0x2bda82=_[_0xb1d0('0x1f')](this[_0xb1d0('0xe')],function(_0x4b684b){return _0x4b684b[_0xb1d0('0x20')]==_0x493f41||_0x4b684b[_0xb1d0('0x21')]==_0x493f41;});if(_0x2bda82){_0x3e2696=_[_0xb1d0('0x1f')](this[_0xb1d0('0xd')],function(_0xbbd0e7){return _0xbbd0e7[_0xb1d0('0x23')]==util[_0xb1d0('0x24')](_0xb1d0('0x25'),_0x2bda82[_0xb1d0('0x21')]);});}}return _0x3e2696;};Report[_0xb1d0('0xf')][_0xb1d0('0x26')]=function(_0x28ba14){for(var _0x4f2d2c=0x0;_0x4f2d2c<_0x28ba14[_0xb1d0('0x27')];_0x4f2d2c+=0x1){var _0x360ec0=this[_0xb1d0('0x1e')](_0x28ba14[_0x4f2d2c][_0xb1d0('0x28')]);if(_0x360ec0){_0x28ba14[_0x4f2d2c][_0xb1d0('0x20')]=_0x360ec0[_0xb1d0('0x20')];_0x28ba14[_0x4f2d2c]['assigned']=!![];_0x28ba14[_0x4f2d2c][_0xb1d0('0x29')]=_0x360ec0[_0xb1d0('0x21')];_0x28ba14[_0x4f2d2c][_0xb1d0('0x23')]=_[_0xb1d0('0x22')](_0x360ec0[_0xb1d0('0x23')])?util[_0xb1d0('0x24')](_0xb1d0('0x25'),_0x360ec0[_0xb1d0('0x21')]):_0x360ec0[_0xb1d0('0x23')];if(_0x28ba14[_0x4f2d2c]['queuecallercomplete']){_0x28ba14[_0x4f2d2c][_0xb1d0('0x2a')]=moment()[_0xb1d0('0x24')](_0xb1d0('0x2b'));}if(_0x28ba14[_0x4f2d2c][_0xb1d0('0x2c')]){_0x28ba14[_0x4f2d2c][_0xb1d0('0x2d')]=moment()['format'](_0xb1d0('0x2b'));}RpcMemberReport[_0xb1d0('0x26')](_0x28ba14[_0x4f2d2c]);}RpcVoiceQueueReport['create'](_0x28ba14[_0x4f2d2c]);}};function extractCalleridNumber(_0x9cf918){var _0x56da02=_0x9cf918[_0xb1d0('0x2e')](/<(.*?)>/);return _0x56da02?_0x56da02[0x1]:_0x9cf918;}Report[_0xb1d0('0xf')][_0xb1d0('0x2f')]=function(_0x2b8095){for(var _0x43c545=0x0;_0x43c5450x0?_0x1c7ccb:0x0;this[_0x9573('0x10')][_0x5c65a1['queue']]['talking']=this['voiceQueues'][_0x5c65a1[_0x9573('0x66')]]['talking']>_[_0x9573('0x6b')](_0x5c65a1['loggedin'])?_[_0x9573('0x6b')](_0x5c65a1[_0x9573('0x6c')]):this['voiceQueues'][_0x5c65a1[_0x9573('0x66')]][_0x9573('0x2b')];this['emitVoiceQueueSummary'](this[_0x9573('0x10')][_0x5c65a1[_0x9573('0x66')]],'queuesummary');}logger[_0x9573('0x41')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x9573('0x39')](this['voiceQueues'][_0x5c65a1[_0x9573('0x66')]],{'showHidden':![],'depth':null}));ami[_0x9573('0x3f')]('custom:queuesummary',this[_0x9573('0x10')][_0x5c65a1[_0x9573('0x66')]]);}}}catch(_0x1600fc){logger[_0x9573('0x37')](_0x9573('0x65'),util['inspect'](_0x1600fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x18')]=function(_0x3bd032){logger['debug'](_0x9573('0x6d'),util[_0x9573('0x39')](_0x3bd032,{'showHidden':![],'depth':null}));ami[_0x9573('0x3f')](_0x9573('0x6e'),{});this[_0x9573('0x11')]=!![];};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x6f')]=function(_0x5d6ae4){try{if(this[_0x9573('0x61')](_0x5d6ae4)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x5d6ae4[_0x9573('0x44')],util[_0x9573('0x39')](_0x5d6ae4,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x9573('0x3a')][_0x5d6ae4[_0x9573('0x44')]]))this[_0x9573('0x3a')][_0x5d6ae4[_0x9573('0x44')]]=[];if(_[_0x9573('0x62')](this[_0x9573('0x32')][_0x5d6ae4['uniqueid']]))this['channels'][_0x5d6ae4['uniqueid']]={};var _0x1290f7=new QueueReport();_0x1290f7[_0x9573('0x46')]=_0x5d6ae4[_0x9573('0x66')];_0x1290f7[_0x9573('0x4e')]=this['voiceQueues'][_0x1290f7[_0x9573('0x46')]]&&this['voiceQueues'][_0x1290f7['name']]['type']?this[_0x9573('0x10')][_0x1290f7[_0x9573('0x46')]][_0x9573('0x4e')]||_0x9573('0x4f'):_0x9573('0x4f');_0x1290f7[_0x9573('0x66')]=_0x5d6ae4[_0x9573('0x66')];_0x1290f7[_0x9573('0x70')]=moment()['format'](_0x9573('0x71'));_0x1290f7[_0x9573('0x72')]=_0x5d6ae4[_0x9573('0x72')];_0x1290f7['count']=_0x5d6ae4['count'];_0x1290f7['uniqueid']=_0x5d6ae4[_0x9573('0x44')];_0x1290f7[_0x9573('0x73')]=this[_0x9573('0x32')][_0x5d6ae4['uniqueid']][_0x9573('0x73')];logger[_0x9573('0x68')](_0x9573('0x74'),_0x1290f7['name'],_0x1290f7[_0x9573('0x4e')]);_['merge'](_0x1290f7,_[_0x9573('0x75')](_0x5d6ae4,_[_0x9573('0x76')](_0x1290f7)));this[_0x9573('0x3a')][_0x5d6ae4[_0x9573('0x44')]][_0x9573('0x77')](_0x1290f7);this[_0x9573('0x32')][_0x5d6ae4['uniqueid']]=_0x1290f7;this[_0x9573('0x40')](_0x1290f7,'queuecallerjoin');}}catch(_0xb39bfc){logger[_0x9573('0x37')](_0x9573('0x78'),_0x5d6ae4[_0x9573('0x44')],util['inspect'](_0xb39bfc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x1b')]=function(_0x434618){try{if(this[_0x9573('0x61')](_0x434618)){logger['debug'](_0x9573('0x79'),_0x434618[_0x9573('0x44')],util[_0x9573('0x39')](_0x434618,{'showHidden':![],'depth':null}));if(this[_0x9573('0x3a')][_0x434618['uniqueid']]){var _0x4fe47c=_[_0x9573('0x7a')](this[_0x9573('0x3a')][_0x434618[_0x9573('0x44')]]);_0x4fe47c[_0x9573('0x7b')]=![];_0x4fe47c[_0x9573('0x7c')]=null;_0x4fe47c[_0x9573('0x7d')]=_0x434618[_0x9573('0x7d')];_0x4fe47c[_0x9573('0x7e')]=_0x434618[_0x9573('0x7e')];_0x4fe47c[_0x9573('0x1a')]=!![];_0x4fe47c[_0x9573('0x7f')]=moment()['format'](_0x9573('0x71'));_0x4fe47c[_0x9573('0x49')]=_0x9573('0x80');_0x4fe47c[_0x9573('0x81')]=null;logger[_0x9573('0x68')](_0x9573('0x82'),_0x4fe47c['name'],_0x4fe47c[_0x9573('0x4e')]);this['channels'][_0x434618[_0x9573('0x44')]]=_0x4fe47c;this[_0x9573('0x83')](_0x4fe47c,_0x9573('0x1a'));}}}catch(_0x38bfcc){logger[_0x9573('0x37')](_0x9573('0x79'),_0x434618[_0x9573('0x44')],util['inspect'](_0x38bfcc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x84')]=function(_0x46b8fa){try{if(this[_0x9573('0x61')](_0x46b8fa)){logger[_0x9573('0x41')]('[%s][voiceQueueReport][queuecallerleave]',_0x46b8fa['uniqueid'],util['inspect'](_0x46b8fa,{'showHidden':![],'depth':null}));if(this[_0x9573('0x3a')][_0x46b8fa['uniqueid']]){var _0xf566d6=_[_0x9573('0x7a')](this[_0x9573('0x3a')][_0x46b8fa[_0x9573('0x44')]]);_0xf566d6[_0x9573('0x85')]=moment()['format'](_0x9573('0x71'));_0xf566d6[_0x9573('0x86')]=_0x46b8fa[_0x9573('0x86')];_0xf566d6['connectedlinename']=_0x46b8fa[_0x9573('0x87')];logger[_0x9573('0x68')](_0x9573('0x88'),_0xf566d6[_0x9573('0x46')],_0xf566d6[_0x9573('0x4e')],_0x46b8fa['connectedlinenum'],_0x46b8fa[_0x9573('0x87')]);this[_0x9573('0x32')][_0x46b8fa['uniqueid']]=_0xf566d6;this[_0x9573('0x40')](_0xf566d6,_0x9573('0x1c'));}}}catch(_0x23f0b2){logger[_0x9573('0x37')]('[%s][voiceQueueReport][queuecallerleave]',_0x46b8fa['uniqueid'],util[_0x9573('0x39')](_0x23f0b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0x20')]=function(_0x1e912c){try{if(this['isNotNull'](_0x1e912c)){logger[_0x9573('0x41')]('[%s][voiceQueueReport][agentconnect]',_0x1e912c[_0x9573('0x44')],util[_0x9573('0x39')](_0x1e912c,{'showHidden':![],'depth':null}));if(this[_0x9573('0x3a')][_0x1e912c['uniqueid']]){var _0xe5d263=_[_0x9573('0x7a')](this['queueReports'][_0x1e912c['uniqueid']]);_0xe5d263['queuecallercomplete']=!![];_0xe5d263[_0x9573('0x49')]=_0x9573('0x89');logger[_0x9573('0x68')](_0x9573('0x8a'),_0xe5d263[_0x9573('0x46')],_0xe5d263[_0x9573('0x4e')]);}}}catch(_0x2e7185){logger[_0x9573('0x37')](_0x9573('0x8b'),_0x1e912c['uniqueid'],util[_0x9573('0x39')](_0x2e7185,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9573('0x1e')]=function(_0x42646c){try{if(this[_0x9573('0x61')](_0x42646c)){logger[_0x9573('0x41')](_0x9573('0x8c'),_0x42646c['uniqueid'],util[_0x9573('0x39')](_0x42646c,{'showHidden':![],'depth':null}));if(this[_0x9573('0x3a')][_0x42646c[_0x9573('0x44')]]){var _0xabbf9=_[_0x9573('0x7a')](this[_0x9573('0x3a')][_0x42646c['uniqueid']]);_0xabbf9[_0x9573('0x1a')]=![];_0xabbf9[_0x9573('0x7f')]=null;_0xabbf9[_0x9573('0x8d')]=!![];_0xabbf9[_0x9573('0x81')]=_0x42646c[_0x9573('0x8e')];_0xabbf9['holdtime']=_0x42646c[_0x9573('0x7d')];_0xabbf9[_0x9573('0x7b')]=!![];_0xabbf9[_0x9573('0x8f')]=![];_0xabbf9[_0x9573('0x90')]=null;if(!_0xabbf9[_0x9573('0x91')]){if(_0x42646c['reason']==_0x9573('0x91')){_0xabbf9[_0x9573('0x49')]=_0x9573('0x92');logger[_0x9573('0x68')](_0x9573('0x93'),_0xabbf9[_0x9573('0x46')],_0xabbf9['type']);}else{if(_[_0x9573('0x94')](_0x42646c['channel'][_0x9573('0x95')](),_0x9573('0x96'))){if(this[_0x9573('0x3a')][_0x42646c[_0x9573('0x97')]]){var _0x393092=_[_0x9573('0x7a')](this[_0x9573('0x3a')][_0x42646c[_0x9573('0x97')]]);_0x393092[_0x9573('0x7b')]=![];_0x393092[_0x9573('0x8f')]=!![];_0x393092['queuecallerexitAt']=moment(_0xabbf9[_0x9573('0x70')])[_0x9573('0x98')](_0x42646c[_0x9573('0x7d')],_0x9573('0x99'))[_0x9573('0x4b')](_0x9573('0x71'));_0x393092[_0x9573('0x49')]=_0x9573('0x9a');_0x393092[_0x9573('0x91')]=!![];_0x393092['transfertype']='FORWARD';_0x393092[_0x9573('0x9b')]=_0x42646c[_0x9573('0x9c')];_0x393092['transferuniqueid']=_0x42646c[_0x9573('0x44')];logger[_0x9573('0x68')](_0x9573('0x9d'),_0x393092[_0x9573('0x46')],_0x393092[_0x9573('0x4e')]);var _0xf9f548=this['queueReports'][_0x42646c['linkedid']];this[_0x9573('0x3a')][_0x42646c['linkedid']]=this[_0x9573('0x3a')][_0x42646c[_0x9573('0x44')]];this['queueReports'][_0x42646c[_0x9573('0x44')]]=_0xf9f548;}}else{_0xabbf9[_0x9573('0x49')]='COMPLETEDBY'+_0x42646c['reason'][_0x9573('0x9e')]();logger[_0x9573('0x68')](_0x9573('0x9f'),_0xabbf9[_0x9573('0x46')],_0xabbf9[_0x9573('0x4e')],_0xabbf9[_0x9573('0x49')]);}}}this['channels'][_0x42646c[_0x9573('0x44')]]=_0xabbf9;this['emitVoiceQueueChannelRemove'](_0xabbf9,'agentcomplete');}}}catch(_0x57d9f2){logger['error'](_0x9573('0x8c'),_0x42646c['uniqueid'],util['inspect'](_0x57d9f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')]['syncVarSet']=function(_0x1dccfb){try{if(this[_0x9573('0x61')](_0x1dccfb)){logger['debug'](_0x9573('0xa0'),_0x1dccfb[_0x9573('0x44')],util[_0x9573('0x39')](_0x1dccfb,{'showHidden':![],'depth':null}));this[_0x9573('0xa1')](_0x1dccfb[_0x9573('0x44')],_['keys'](_0x1dccfb[_0x9573('0xa2')])[0x0],_0x1dccfb[_0x9573('0xa3')]);if(this[_0x9573('0x3a')][_0x1dccfb[_0x9573('0x44')]]){var _0x50115f=_[_0x9573('0x7a')](this['queueReports'][_0x1dccfb['uniqueid']]);if(_0x50115f){if(this[_0x9573('0x61')](_0x1dccfb[_0x9573('0xa2')])&&this[_0x9573('0x61')](_0x1dccfb['variable'][_0x9573('0xa4')])){switch(_0x1dccfb[_0x9573('0xa3')]){case _0x9573('0xa5'):_0x50115f[_0x9573('0x8f')]=![];_0x50115f[_0x9573('0x90')]=null;break;case _0x9573('0xa6'):_0x50115f['lastevent']='timeout';_0x50115f[_0x9573('0x8f')]=!![];_0x50115f[_0x9573('0x90')]=moment()['format'](_0x9573('0x71'));_0x50115f[_0x9573('0x85')]=moment()[_0x9573('0x4b')](_0x9573('0x71'));logger[_0x9573('0x41')](_0x9573('0xa7'),_0x1dccfb[_0x9573('0x44')],util[_0x9573('0x39')](_0x50115f,{'showHidden':![],'depth':null}));ami[_0x9573('0x3f')](_0x9573('0xa8'),_0x50115f);break;default:_0x50115f['queuecallerexit']=!![];_0x50115f[_0x9573('0x90')]=moment()[_0x9573('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x50115f[_0x9573('0x85')]=moment()[_0x9573('0x4b')](_0x9573('0x71'));}_0x50115f[_0x9573('0x1a')]=![];_0x50115f[_0x9573('0x7f')]=null;_0x50115f[_0x9573('0x49')]=_0x1dccfb[_0x9573('0xa3')];this[_0x9573('0x32')][_0x1dccfb[_0x9573('0x44')]]=_0x50115f;this['emitVoiceQueueChannelRemove'](_0x50115f,_0x9573('0xa9'));}else if(this[_0x9573('0x61')](_0x1dccfb['variable'])&&this[_0x9573('0x61')](_0x1dccfb['variable'][_0x9573('0xaa')])){if(!_0x50115f[_0x9573('0x1a')]){_0x50115f[_0x9573('0x8f')]=!![];_0x50115f['queuecallerexitAt']=moment()['format'](_0x9573('0x71'));_0x50115f[_0x9573('0x49')]=_0x9573('0xab');_0x50115f['queuecallerleaveAt']=moment()[_0x9573('0x4b')](_0x9573('0x71'));this[_0x9573('0x32')][_0x1dccfb[_0x9573('0x44')]]=_0x50115f;}}logger[_0x9573('0x68')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1dccfb['uniqueid'],_0x50115f['name'],_0x50115f[_0x9573('0x4e')],_[_0x9573('0x76')](_0x1dccfb['variable'])[0x0],_0x1dccfb['value']);_0x50115f['variables']=this[_0x9573('0x13')][_0x1dccfb[_0x9573('0x44')]];}}}}catch(_0x3ba9fa){logger[_0x9573('0x37')](_0x9573('0xa0'),_0x1dccfb[_0x9573('0x44')],util[_0x9573('0x39')](_0x3ba9fa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9573('0xb')][_0x9573('0xa1')]=function(_0xc8fe2d,_0x1f0b5b,_0x5ce31f){var _0x57b532=['rtpaudioqos','rtpaudioqosbridged',_0x9573('0xac'),_0x9573('0xad'),_0x9573('0xae'),_0x9573('0xaf'),_0x9573('0xb0'),_0x9573('0xb1'),_0x9573('0xb2'),_0x9573('0xb3'),_0x9573('0xb4'),_0x9573('0xb5'),_0x9573('0xb6'),_0x9573('0xb7'),_0x9573('0xb8'),_0x9573('0xb9'),_0x9573('0x8e'),_0x9573('0xba'),_0x9573('0xbb')];if(!_[_0x9573('0xbc')](_0x1f0b5b)&&!_[_0x9573('0xbd')](_0x57b532,_0x1f0b5b)){if(_[_0x9573('0x62')](this[_0x9573('0x13')][_0xc8fe2d])){this[_0x9573('0x13')][_0xc8fe2d]={};}this['variables'][_0xc8fe2d][_0x1f0b5b]=_0x5ce31f;}};VoiceQueueReport[_0x9573('0xb')]['handleHangup']=function(_0x400c,_0x6eb411,_0x5b3cf4){var _0x30933b={};for(var _0x30192f=0x0;_0x30192f0x0?_0x32777a:0x0;this['voiceQueues'][_0x2a8379[_0x0deb('0x66')]][_0x0deb('0x2c')]=this[_0x0deb('0x10')][_0x2a8379['queue']][_0x0deb('0x2c')]>_[_0x0deb('0x6c')](_0x2a8379[_0x0deb('0x6d')])?_[_0x0deb('0x6c')](_0x2a8379[_0x0deb('0x6d')]):this['voiceQueues'][_0x2a8379[_0x0deb('0x66')]][_0x0deb('0x2c')];this[_0x0deb('0x6f')](this[_0x0deb('0x10')][_0x2a8379[_0x0deb('0x66')]],_0x0deb('0x14'));}logger[_0x0deb('0x42')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this['voiceQueues'][_0x2a8379['queue']],{'showHidden':![],'depth':null}));ami[_0x0deb('0x40')](_0x0deb('0x70'),this[_0x0deb('0x10')][_0x2a8379[_0x0deb('0x66')]]);}}}catch(_0x26ac31){logger[_0x0deb('0x37')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x26ac31,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0deb('0x9')][_0x0deb('0x15')]=function(_0x511724){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x0deb('0x39')](_0x511724,{'showHidden':![],'depth':null}));ami['emit'](_0x0deb('0x71'),{});this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x0deb('0x18')]=function(_0x306688){try{if(this['isNotNull'](_0x306688)){logger[_0x0deb('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x306688['uniqueid'],util[_0x0deb('0x39')](_0x306688,{'showHidden':![],'depth':null}));if(_[_0x0deb('0x5d')](this['queueReports'][_0x306688[_0x0deb('0x44')]]))this['queueReports'][_0x306688['uniqueid']]=[];if(_['isUndefined'](this[_0x0deb('0xf')][_0x306688[_0x0deb('0x44')]]))this[_0x0deb('0xf')][_0x306688['uniqueid']]={};var _0x3f719d=new QueueReport();_0x3f719d[_0x0deb('0x47')]=_0x306688[_0x0deb('0x66')];_0x3f719d['type']=this[_0x0deb('0x10')][_0x3f719d[_0x0deb('0x47')]]&&this['voiceQueues'][_0x3f719d[_0x0deb('0x47')]][_0x0deb('0x4e')]?this[_0x0deb('0x10')][_0x3f719d[_0x0deb('0x47')]][_0x0deb('0x4e')]||_0x0deb('0x4f'):_0x0deb('0x4f');_0x3f719d[_0x0deb('0x66')]=_0x306688[_0x0deb('0x66')];_0x3f719d['queuecallerjoinAt']=moment()[_0x0deb('0x45')](_0x0deb('0x72'));_0x3f719d[_0x0deb('0x73')]=_0x306688['position'];_0x3f719d['count']=_0x306688[_0x0deb('0x74')];_0x3f719d[_0x0deb('0x44')]=_0x306688[_0x0deb('0x44')];_0x3f719d[_0x0deb('0x75')]=this['channels'][_0x306688[_0x0deb('0x44')]][_0x0deb('0x75')];logger[_0x0deb('0x68')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x3f719d[_0x0deb('0x47')],_0x3f719d[_0x0deb('0x4e')]);_['merge'](_0x3f719d,_[_0x0deb('0x76')](_0x306688,_[_0x0deb('0x77')](_0x3f719d)));this[_0x0deb('0xe')][_0x306688[_0x0deb('0x44')]][_0x0deb('0x78')](_0x3f719d);this[_0x0deb('0xf')][_0x306688[_0x0deb('0x44')]]=_0x3f719d;this[_0x0deb('0x41')](_0x3f719d,_0x0deb('0x17'));}}catch(_0xa1bdc0){logger[_0x0deb('0x37')](_0x0deb('0x79'),_0x306688[_0x0deb('0x44')],util[_0x0deb('0x39')](_0xa1bdc0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0deb('0x9')][_0x0deb('0x7a')]=function(_0x28ff01){try{if(this[_0x0deb('0x65')](_0x28ff01)){logger[_0x0deb('0x42')](_0x0deb('0x7b'),_0x28ff01['uniqueid'],util['inspect'](_0x28ff01,{'showHidden':![],'depth':null}));if(this[_0x0deb('0xe')][_0x28ff01[_0x0deb('0x44')]]){var _0x2c81c1=_[_0x0deb('0x7c')](this[_0x0deb('0xe')][_0x28ff01['uniqueid']]);_0x2c81c1[_0x0deb('0x7d')]=![];_0x2c81c1[_0x0deb('0x7e')]=null;_0x2c81c1[_0x0deb('0x7f')]=_0x28ff01[_0x0deb('0x7f')];_0x2c81c1[_0x0deb('0x80')]=_0x28ff01[_0x0deb('0x80')];_0x2c81c1['queuecallerabandon']=!![];_0x2c81c1['queuecallerabandonAt']=moment()[_0x0deb('0x45')](_0x0deb('0x72'));_0x2c81c1[_0x0deb('0x4b')]='ABANDONED';_0x2c81c1[_0x0deb('0x81')]=null;logger[_0x0deb('0x68')](_0x0deb('0x82'),_0x2c81c1[_0x0deb('0x47')],_0x2c81c1[_0x0deb('0x4e')]);this['channels'][_0x28ff01[_0x0deb('0x44')]]=_0x2c81c1;this['emitVoiceQueueChannelRemove'](_0x2c81c1,_0x0deb('0x19'));}}}catch(_0x51cf3c){logger[_0x0deb('0x37')](_0x0deb('0x7b'),_0x28ff01['uniqueid'],util[_0x0deb('0x39')](_0x51cf3c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0deb('0x9')][_0x0deb('0x1a')]=function(_0x6d5cf4){try{if(this[_0x0deb('0x65')](_0x6d5cf4)){logger['debug'](_0x0deb('0x83'),_0x6d5cf4[_0x0deb('0x44')],util[_0x0deb('0x39')](_0x6d5cf4,{'showHidden':![],'depth':null}));if(this[_0x0deb('0xe')][_0x6d5cf4[_0x0deb('0x44')]]){var _0x4eac56=_[_0x0deb('0x7c')](this[_0x0deb('0xe')][_0x6d5cf4['uniqueid']]);_0x4eac56['queuecallerleaveAt']=moment()[_0x0deb('0x45')](_0x0deb('0x72'));_0x4eac56[_0x0deb('0x84')]=_0x6d5cf4[_0x0deb('0x84')];_0x4eac56[_0x0deb('0x85')]=_0x6d5cf4[_0x0deb('0x85')];logger[_0x0deb('0x68')](_0x0deb('0x86'),_0x4eac56[_0x0deb('0x47')],_0x4eac56[_0x0deb('0x4e')],_0x6d5cf4[_0x0deb('0x84')],_0x6d5cf4[_0x0deb('0x85')]);this[_0x0deb('0xf')][_0x6d5cf4[_0x0deb('0x44')]]=_0x4eac56;this['emitVoiceQueueChannelSave'](_0x4eac56,_0x0deb('0x87'));}}}catch(_0x2e4632){logger[_0x0deb('0x37')](_0x0deb('0x83'),_0x6d5cf4['uniqueid'],util[_0x0deb('0x39')](_0x2e4632,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0deb('0x9')][_0x0deb('0x88')]=function(_0x4d2e5f){try{if(this['isNotNull'](_0x4d2e5f)){logger[_0x0deb('0x42')](_0x0deb('0x89'),_0x4d2e5f['uniqueid'],util['inspect'](_0x4d2e5f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4d2e5f[_0x0deb('0x44')]]){var _0x20439b=_[_0x0deb('0x7c')](this['queueReports'][_0x4d2e5f[_0x0deb('0x44')]]);_0x20439b[_0x0deb('0x7d')]=!![];_0x20439b[_0x0deb('0x4b')]=_0x0deb('0x8a');logger[_0x0deb('0x68')](_0x0deb('0x8b'),_0x20439b[_0x0deb('0x47')],_0x20439b[_0x0deb('0x4e')]);}}}catch(_0x50b83b){logger[_0x0deb('0x37')]('[%s][voiceQueueReport][agentconnect]',_0x4d2e5f[_0x0deb('0x44')],util[_0x0deb('0x39')](_0x50b83b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0deb('0x9')][_0x0deb('0x1b')]=function(_0x38ce6d){try{if(this['isNotNull'](_0x38ce6d)){logger[_0x0deb('0x42')](_0x0deb('0x8c'),_0x38ce6d[_0x0deb('0x44')],util[_0x0deb('0x39')](_0x38ce6d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x38ce6d[_0x0deb('0x44')]]){var _0x1e068a=_['last'](this[_0x0deb('0xe')][_0x38ce6d['uniqueid']]);_0x1e068a[_0x0deb('0x19')]=![];_0x1e068a[_0x0deb('0x8d')]=null;_0x1e068a[_0x0deb('0x8e')]=!![];_0x1e068a[_0x0deb('0x81')]=_0x38ce6d[_0x0deb('0x8f')];_0x1e068a[_0x0deb('0x7f')]=_0x38ce6d[_0x0deb('0x7f')];_0x1e068a[_0x0deb('0x7d')]=!![];_0x1e068a[_0x0deb('0x90')]=![];_0x1e068a[_0x0deb('0x91')]=null;if(!_0x1e068a[_0x0deb('0x92')]){if(_0x38ce6d['reason']==_0x0deb('0x92')){_0x1e068a[_0x0deb('0x4b')]=_0x0deb('0x93');logger['info'](_0x0deb('0x94'),_0x1e068a[_0x0deb('0x47')],_0x1e068a[_0x0deb('0x4e')]);}else{if(_['startsWith'](_0x38ce6d['channel'][_0x0deb('0x95')](),'local/')){if(this[_0x0deb('0xe')][_0x38ce6d['linkedid']]){var _0x53d1b1=_[_0x0deb('0x7c')](this[_0x0deb('0xe')][_0x38ce6d[_0x0deb('0x96')]]);_0x53d1b1[_0x0deb('0x7d')]=![];_0x53d1b1['queuecallerexit']=!![];_0x53d1b1['queuecallerexitAt']=moment(_0x1e068a[_0x0deb('0x97')])[_0x0deb('0x98')](_0x38ce6d[_0x0deb('0x7f')],_0x0deb('0x99'))[_0x0deb('0x45')](_0x0deb('0x72'));_0x53d1b1[_0x0deb('0x4b')]='FORWARDTRANSFER';_0x53d1b1[_0x0deb('0x92')]=!![];_0x53d1b1['transfertype']='FORWARD';_0x53d1b1['transferexten']=_0x38ce6d[_0x0deb('0x9a')];_0x53d1b1[_0x0deb('0x9b')]=_0x38ce6d[_0x0deb('0x44')];logger[_0x0deb('0x68')](_0x0deb('0x9c'),_0x53d1b1[_0x0deb('0x47')],_0x53d1b1[_0x0deb('0x4e')]);var _0x5ec965=this[_0x0deb('0xe')][_0x38ce6d[_0x0deb('0x96')]];this['queueReports'][_0x38ce6d['linkedid']]=this[_0x0deb('0xe')][_0x38ce6d[_0x0deb('0x44')]];this[_0x0deb('0xe')][_0x38ce6d[_0x0deb('0x44')]]=_0x5ec965;}}else{_0x1e068a[_0x0deb('0x4b')]=_0x0deb('0x9d')+_0x38ce6d[_0x0deb('0x9e')][_0x0deb('0x9f')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x1e068a['name'],_0x1e068a['type'],_0x1e068a[_0x0deb('0x4b')]);}}}this[_0x0deb('0xf')][_0x38ce6d[_0x0deb('0x44')]]=_0x1e068a;this[_0x0deb('0x3f')](_0x1e068a,_0x0deb('0xa0'));}}}catch(_0x2fdee6){logger['error'](_0x0deb('0x8c'),_0x38ce6d[_0x0deb('0x44')],util['inspect'](_0x2fdee6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0deb('0x1e')]=function(_0x38a9e5){try{if(this[_0x0deb('0x65')](_0x38a9e5)){logger[_0x0deb('0x42')](_0x0deb('0xa1'),_0x38a9e5[_0x0deb('0x44')],util['inspect'](_0x38a9e5,{'showHidden':![],'depth':null}));this[_0x0deb('0xa2')](_0x38a9e5[_0x0deb('0x44')],_['keys'](_0x38a9e5[_0x0deb('0xa3')])[0x0],_0x38a9e5[_0x0deb('0xa4')]);if(this[_0x0deb('0xe')][_0x38a9e5['uniqueid']]){var _0x5a993d=_[_0x0deb('0x7c')](this[_0x0deb('0xe')][_0x38a9e5['uniqueid']]);if(_0x5a993d){if(this[_0x0deb('0x65')](_0x38a9e5[_0x0deb('0xa3')])&&this['isNotNull'](_0x38a9e5[_0x0deb('0xa3')]['queuestatus'])){switch(_0x38a9e5[_0x0deb('0xa4')]){case'CONTINUE':_0x5a993d['queuecallerexit']=![];_0x5a993d[_0x0deb('0x91')]=null;break;case'TIMEOUT':_0x5a993d[_0x0deb('0xa5')]=_0x0deb('0xa6');_0x5a993d['queuecallerexit']=!![];_0x5a993d[_0x0deb('0x91')]=moment()[_0x0deb('0x45')](_0x0deb('0x72'));_0x5a993d['queuecallerleaveAt']=moment()[_0x0deb('0x45')](_0x0deb('0x72'));logger[_0x0deb('0x42')](_0x0deb('0xa7'),_0x38a9e5['uniqueid'],util[_0x0deb('0x39')](_0x5a993d,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x5a993d);break;default:_0x5a993d[_0x0deb('0x90')]=!![];_0x5a993d[_0x0deb('0x91')]=moment()[_0x0deb('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a993d[_0x0deb('0xa8')]=moment()[_0x0deb('0x45')](_0x0deb('0x72'));}_0x5a993d['queuecallerabandon']=![];_0x5a993d[_0x0deb('0x8d')]=null;_0x5a993d[_0x0deb('0x4b')]=_0x38a9e5[_0x0deb('0xa4')];this['channels'][_0x38a9e5[_0x0deb('0x44')]]=_0x5a993d;this[_0x0deb('0x3f')](_0x5a993d,'varset');}else if(this['isNotNull'](_0x38a9e5[_0x0deb('0xa3')])&&this[_0x0deb('0x65')](_0x38a9e5[_0x0deb('0xa3')][_0x0deb('0xa9')])){if(!_0x5a993d[_0x0deb('0x19')]){_0x5a993d[_0x0deb('0x90')]=!![];_0x5a993d['queuecallerexitAt']=moment()[_0x0deb('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a993d[_0x0deb('0x4b')]=_0x0deb('0xaa');_0x5a993d[_0x0deb('0xa8')]=moment()['format'](_0x0deb('0x72'));this['channels'][_0x38a9e5[_0x0deb('0x44')]]=_0x5a993d;}}logger[_0x0deb('0x68')](_0x0deb('0xab'),_0x38a9e5[_0x0deb('0x44')],_0x5a993d[_0x0deb('0x47')],_0x5a993d[_0x0deb('0x4e')],_[_0x0deb('0x77')](_0x38a9e5[_0x0deb('0xa3')])[0x0],_0x38a9e5[_0x0deb('0xa4')]);_0x5a993d[_0x0deb('0x13')]=this[_0x0deb('0x13')][_0x38a9e5[_0x0deb('0x44')]];}}}}catch(_0x349c1b){logger['error'](_0x0deb('0xa1'),_0x38a9e5['uniqueid'],util[_0x0deb('0x39')](_0x349c1b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0deb('0x9')]['addVariable']=function(_0x2139aa,_0x49c7a9,_0x4e7fea){var _0x55c61f=[_0x0deb('0xac'),'rtpaudioqosbridged',_0x0deb('0xad'),_0x0deb('0xae'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x0deb('0xaf'),_0x0deb('0xb0'),'sipcallid',_0x0deb('0xb1'),'bridgepeer',_0x0deb('0xb2'),_0x0deb('0xb3'),_0x0deb('0xb4'),_0x0deb('0xb5'),_0x0deb('0xb6'),_0x0deb('0x8f'),'memberpenalty',_0x0deb('0xb7')];if(!_[_0x0deb('0xb8')](_0x49c7a9)&&!_[_0x0deb('0xb9')](_0x55c61f,_0x49c7a9)){if(_[_0x0deb('0x5d')](this[_0x0deb('0x13')][_0x2139aa])){this[_0x0deb('0x13')][_0x2139aa]={};}this[_0x0deb('0x13')][_0x2139aa][_0x49c7a9]=_0x4e7fea;}};VoiceQueueReport[_0x0deb('0x9')][_0x0deb('0xba')]=function(_0x2ed11a,_0x422dba,_0xe8b183){var _0x33875a={};for(var _0x150800=0x0;_0x150800=0x0?moment(_0x542f1d['endtime'])['diff'](_0x542f1d[_0x1510('0x15')],_0x1510('0xa')):null,'data1':'outbound','data2':_0x542f1d[_0x1510('0xf')],'data3':_0x542f1d[_0x1510('0xc')],'data4':_0x542f1d[_0x1510('0x16')]||null,'role':_0x1510('0xe'),'internal':_0x542f1d['accountcode']?_[_0x1510('0x10')](_0x542f1d[_0x1510('0xf')]):undefined,'uniqueid':_0x542f1d[_0x1510('0x11')]},'log':_0x1510('0x3')});}; \ No newline at end of file +var _0xa96d=['voice','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','queue','agent','accountcode','uniqueid','CreateMemberReport','membername','starttime','endtime','outbound','toNumber','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0xa96d,0x8a));var _0xda96=function(_0x486d65,_0x3b7523){_0x486d65=_0x486d65-0x0;var _0x49bd9f=_0xa96d[_0x486d65];return _0x49bd9f;};'use strict';var moment=require(_0xda96('0x0'));var _=require(_0xda96('0x1'));var util=require(_0xda96('0x2'));var client=require(_0xda96('0x3'));exports['voiceQueueReport']=function(_0x49786a){var _0x927656=_0x49786a[_0xda96('0x4')]||_0x49786a[_0xda96('0x5')];return client[_0xda96('0x6')]('CreateMemberReport',{'body':{'channel':_0xda96('0x7'),'membername':_0x49786a[_0xda96('0x8')],'interface':_[_0xda96('0x9')](_0x49786a[_0xda96('0xa')])?util[_0xda96('0xb')](_0xda96('0xc'),_0x49786a['lastAssignedTo']):_0x49786a['interface'],'type':'TALKING','enterAt':_0x49786a[_0xda96('0xd')],'exitAt':_0x927656,'duration':moment(_0x927656)[_0xda96('0xe')](_0x49786a[_0xda96('0xd')],_0xda96('0xf')),'data1':_0xda96('0x10'),'data2':_0x49786a[_0xda96('0x11')],'data3':_0x49786a[_0xda96('0x12')],'data4':null,'data5':_0x49786a[_0xda96('0x13')],'role':_0xda96('0x14'),'internal':_0x49786a[_0xda96('0x15')]?_['toNumber'](_0x49786a['accountcode']):undefined,'uniqueid':_0x49786a[_0xda96('0x16')]},'log':_0xda96('0x17')});};exports['voiceDialReport']=function(_0xaef3f6){return client[_0xda96('0x6')](_0xda96('0x17'),{'body':{'channel':_0xda96('0x7'),'membername':_0xaef3f6[_0xda96('0x18')],'interface':_0xaef3f6[_0xda96('0xa')],'type':'TALKING','enterAt':_0xaef3f6[_0xda96('0x19')],'exitAt':_0xaef3f6[_0xda96('0x1a')],'duration':moment(_0xaef3f6[_0xda96('0x1a')])[_0xda96('0xe')](_0xaef3f6[_0xda96('0x19')],_0xda96('0xf'))>=0x0?moment(_0xaef3f6[_0xda96('0x1a')])[_0xda96('0xe')](_0xaef3f6['starttime'],'seconds'):null,'data1':_0xda96('0x1b'),'data2':_0xaef3f6[_0xda96('0x15')],'data3':_0xaef3f6[_0xda96('0x12')],'data4':_0xaef3f6['dialstring']||null,'role':_0xda96('0x14'),'internal':_0xaef3f6[_0xda96('0x15')]?_[_0xda96('0x1c')](_0xaef3f6['accountcode']):undefined,'uniqueid':_0xaef3f6[_0xda96('0x16')]},'log':_0xda96('0x17')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 9ae0b92..7d9933e 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 _0xb6fa=['../client','ShowSetting','GetSettings'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xb6fa,0x1c2));var _0xab6f=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xb6fa[_0x2261ce];return _0x524640;};'use strict';var client=require(_0xab6f('0x0'));exports['getSettings']=function(){return client['Request'](_0xab6f('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0xab6f('0x2')});}; \ No newline at end of file +var _0x91ab=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','getSettings','ShowSetting'];(function(_0x5eeb39,_0xc6475){var _0x13fc25=function(_0x550e74){while(--_0x550e74){_0x5eeb39['push'](_0x5eeb39['shift']());}};_0x13fc25(++_0xc6475);}(_0x91ab,0x7b));var _0xb91a=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x91ab[_0xc4001c];return _0x49f7bc;};'use strict';var client=require('../client');exports[_0xb91a('0x0')]=function(){return client['Request'](_0xb91a('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb91a('0x2'),_0xb91a('0x3')]},'log':_0xb91a('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 50031c8..82299f9 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 _0xc273=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x2f4de8,_0x313395){var _0x4569cb=function(_0x17572f){while(--_0x17572f){_0x2f4de8['push'](_0x2f4de8['shift']());}};_0x4569cb(++_0x313395);}(_0xc273,0x137));var _0x3c27=function(_0x2859f2,_0x1e3102){_0x2859f2=_0x2859f2-0x0;var _0x4974cd=_0xc273[_0x2859f2];return _0x4974cd;};'use strict';var client=require(_0x3c27('0x0'));exports[_0x3c27('0x1')]=function(_0x34ba53){return function(_0x36ab25){return client[_0x3c27('0x2')](_0x3c27('0x3'),{'options':{'raw':!![],'attributes':['id',_0x3c27('0x4'),_0x3c27('0x5')]},'log':_0x3c27('0x3')});};}; \ No newline at end of file +var _0x9071=['name','getTemplates','GetTemplate'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0x9071,0xe8));var _0x1907=function(_0x5528f3,_0x3d5525){_0x5528f3=_0x5528f3-0x0;var _0x47751e=_0x9071[_0x5528f3];return _0x47751e;};'use strict';var client=require('../client');exports[_0x1907('0x0')]=function(_0x396b35){return function(_0x1eca04){return client['Request'](_0x1907('0x1'),{'options':{'raw':!![],'attributes':['id',_0x1907('0x2'),'html']},'log':_0x1907('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index c873990..2b27315 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 _0x2c08=['data3','data4','data5','data6','GetTrigger','../client','getTriggers','name','Condition','AllConditions','field','operator','value','Action','action','data2'];(function(_0x51c31d,_0x4c885a){var _0x48e7e1=function(_0x16f7e0){while(--_0x16f7e0){_0x51c31d['push'](_0x51c31d['shift']());}};_0x48e7e1(++_0x4c885a);}(_0x2c08,0x105));var _0x82c0=function(_0x53ed3a,_0x1f4cd3){_0x53ed3a=_0x53ed3a-0x0;var _0x30014c=_0x2c08[_0x53ed3a];return _0x30014c;};'use strict';var client=require(_0x82c0('0x0'));exports[_0x82c0('0x1')]=function(_0x516c43){return function(_0x60f827){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x82c0('0x2'),'channel','status'],'include':[{'model':_0x82c0('0x3'),'as':_0x82c0('0x4'),'attributes':['id',_0x82c0('0x5'),_0x82c0('0x6'),'value']},{'model':_0x82c0('0x3'),'as':'AnyConditions','attributes':['id',_0x82c0('0x5'),_0x82c0('0x6'),_0x82c0('0x7')]},{'model':_0x82c0('0x8'),'as':'Actions','attributes':['id',_0x82c0('0x9'),'data1',_0x82c0('0xa'),_0x82c0('0xb'),_0x82c0('0xc'),_0x82c0('0xd'),_0x82c0('0xe'),'data7']}]},'log':_0x82c0('0xf')});};}; \ No newline at end of file +var _0xb4e7=['data7','GetTrigger','../client','getTriggers','Request','channel','status','Condition','operator','value','AnyConditions','field','Actions','action','data1','data2','data4','data5','data6'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xb4e7,0x16b));var _0x7b4e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xb4e7[_0x433a86];return _0x23000c;};'use strict';var client=require(_0x7b4e('0x0'));exports[_0x7b4e('0x1')]=function(_0x17e550){return function(_0x38c384){return client[_0x7b4e('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x7b4e('0x3'),_0x7b4e('0x4')],'include':[{'model':_0x7b4e('0x5'),'as':'AllConditions','attributes':['id','field',_0x7b4e('0x6'),_0x7b4e('0x7')]},{'model':_0x7b4e('0x5'),'as':_0x7b4e('0x8'),'attributes':['id',_0x7b4e('0x9'),'operator',_0x7b4e('0x7')]},{'model':'Action','as':_0x7b4e('0xa'),'attributes':['id',_0x7b4e('0xb'),_0x7b4e('0xc'),_0x7b4e('0xd'),'data3',_0x7b4e('0xe'),_0x7b4e('0xf'),_0x7b4e('0x10'),_0x7b4e('0x11')]}]},'log':_0x7b4e('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index ddc84ae..5bba33a 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 _0x1333=['defaultuser','GetTrunk','../client','getTrunks','Request','name','registry'];(function(_0x10459e,_0x6f5775){var _0x388db6=function(_0xe0b3f5){while(--_0xe0b3f5){_0x10459e['push'](_0x10459e['shift']());}};_0x388db6(++_0x6f5775);}(_0x1333,0x167));var _0x3133=function(_0x41c79a,_0x1e5c8a){_0x41c79a=_0x41c79a-0x0;var _0x4a3947=_0x1333[_0x41c79a];return _0x4a3947;};'use strict';var client=require(_0x3133('0x0'));exports[_0x3133('0x1')]=function(_0x2215c2){return function(_0x456264){return client[_0x3133('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3133('0x3'),_0x3133('0x4'),_0x3133('0x5')]},'log':_0x3133('0x6')});};}; \ No newline at end of file +var _0x018d=['registry','../client','Request','GetTrunk'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0x018d,0x79));var _0xd018=function(_0x499792,_0x20bf22){_0x499792=_0x499792-0x0;var _0x1ba806=_0x018d[_0x499792];return _0x1ba806;};'use strict';var client=require(_0xd018('0x0'));exports['getTrunks']=function(_0x32165f){return function(_0x1c30a1){return client[_0xd018('0x1')](_0xd018('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xd018('0x3'),'defaultuser']},'log':_0xd018('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index bc6cd81..a90437f 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x9d7970,_0x43db95){var _0x19992e=function(_0x22264d){while(--_0x22264d){_0x9d7970['push'](_0x9d7970['shift']());}};_0x19992e(++_0x43db95);}(_0x70e0,0x17b));var _0x070e=function(_0x577529,_0x2c7f85){_0x577529=_0x577529-0x0;var _0x16f47a=_0x70e0[_0x577529];return _0x16f47a;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file +var _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x348bc9,_0x18ab14){var _0xf41fdf=function(_0x1b4a2d){while(--_0x1b4a2d){_0x348bc9['push'](_0x348bc9['shift']());}};_0xf41fdf(++_0x18ab14);}(_0x70e0,0x17b));var _0x070e=function(_0x49d53a,_0x22a12f){_0x49d53a=_0x49d53a-0x0;var _0x4cda04=_0x70e0[_0x49d53a];return _0x4cda04;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5'),_0x070e('0x6'),'online',_0x070e('0x7'),'pauseType',_0x070e('0x8'),'voicePause','phone','mobile',_0x070e('0x9')]},'log':_0x070e('0x1')});};};exports[_0x070e('0xa')]=function(){return function(){return client[_0x070e('0x2')](_0x070e('0xb'),{'options':{'raw':!![],'where':{'role':_0x070e('0xc')},'attributes':['id',_0x070e('0x3'),'accountcode','internal']},'log':_0x070e('0xa')});};};exports[_0x070e('0xd')]=function(_0x12bb37,_0xb8d819,_0xa927a2){return client[_0x070e('0x2')](_0x070e('0xe'),{'body':{'type':_0xb8d819,'uniqueid':_0xa927a2},'options':{'where':{'id':_0x12bb37['id']}},'log':_0x070e('0xd')});};exports[_0x070e('0xf')]=function(_0x5bf079){return client[_0x070e('0x2')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5bf079['id']}},'log':'savePause'});};exports[_0x070e('0x10')]=function(_0x56c7ba){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x070e('0x11'),'id':_0x56c7ba},'attributes':['id',_0x070e('0x3'),'email','accountcode',_0x070e('0x6'),_0x070e('0x12'),_0x070e('0x7'),_0x070e('0x13'),'lastPauseAt','voicePause',_0x070e('0x9')]},'log':_0x070e('0x10')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 6596123..ce04765 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 _0xffeb=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x18abd2,_0x22d4b3){var _0x1dcad6=function(_0xcc08c4){while(--_0xcc08c4){_0x18abd2['push'](_0x18abd2['shift']());}};_0x1dcad6(++_0x22d4b3);}(_0xffeb,0x1e9));var _0xbffe=function(_0x211c7b,_0x1c03ee){_0x211c7b=_0x211c7b-0x0;var _0x57b12=_0xffeb[_0x211c7b];return _0x57b12;};'use strict';var client=require(_0xbffe('0x0'));exports['create']=function(_0x3bbf6f){return client[_0xbffe('0x1')](_0xbffe('0x2'),{'body':_0x3bbf6f,'log':_0xbffe('0x2')});};exports[_0xbffe('0x3')]=function(_0xaa2aca,_0x3dcbf0,_0x39d578){return client[_0xbffe('0x1')](_0xbffe('0x4'),{'body':_0xaa2aca,'options':{'where':{'uniqueid':_0x3dcbf0,'interface':_0x39d578,'agentcomplete':!![]}},'log':_0xbffe('0x4')});}; \ No newline at end of file +var _0x9598=['create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport','../client'];(function(_0x2eb4bf,_0x3792f7){var _0x2eefb4=function(_0x5ad0f3){while(--_0x5ad0f3){_0x2eb4bf['push'](_0x2eb4bf['shift']());}};_0x2eefb4(++_0x3792f7);}(_0x9598,0x6b));var _0x8959=function(_0x44f470,_0x74d1a8){_0x44f470=_0x44f470-0x0;var _0x54f0f5=_0x9598[_0x44f470];return _0x54f0f5;};'use strict';var client=require(_0x8959('0x0'));exports[_0x8959('0x1')]=function(_0x1705e5){return client['Request'](_0x8959('0x2'),{'body':_0x1705e5,'log':_0x8959('0x2')});};exports[_0x8959('0x3')]=function(_0x26e4e2,_0x334c2a,_0x238dc0){return client[_0x8959('0x4')](_0x8959('0x5'),{'body':_0x26e4e2,'options':{'where':{'uniqueid':_0x334c2a,'interface':_0x238dc0,'agentcomplete':!![]}},'log':_0x8959('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index b8a6de9..6121270 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 _0x99d8=['duration','billableseconds','GetVoiceCallReports','moment','util','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','Request','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition'];(function(_0x59fdf6,_0x3b45f5){var _0x4c8376=function(_0x3c8835){while(--_0x3c8835){_0x59fdf6['push'](_0x59fdf6['shift']());}};_0x4c8376(++_0x3b45f5);}(_0x99d8,0xa5));var _0x899d=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x99d8[_0x1d80be];return _0xf9a4f3;};'use strict';var moment=require(_0x899d('0x0'));var util=require(_0x899d('0x1'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x4d76f6){return client['Request'](_0x899d('0x2'),{'body':_[_0x899d('0x3')](_0x4d76f6,{'source':_0x4d76f6[_0x899d('0x4')],'destinationcontext':_0x4d76f6['context'],'callerid':_0x4d76f6[_0x899d('0x5')],'amaflags':_0x899d('0x6')}),'log':'CreateVoiceCallReport'});};exports[_0x899d('0x7')]=function(){return function(){return client[_0x899d('0x8')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x899d('0x9')],'createdAt':{'$between':[moment()['startOf'](_0x899d('0xa'))[_0x899d('0xb')](_0x899d('0xc')),moment()['endOf'](_0x899d('0xa'))[_0x899d('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x899d('0xd'),_0x899d('0xe'),_0x899d('0xf'),_0x899d('0x10')]},'log':_0x899d('0x11')});};}; \ No newline at end of file +var _0xd2d5=['duration','GetVoiceCallReports','moment','util','lodash','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition'];(function(_0x3af031,_0x2f1cc2){var _0xc9150f=function(_0x217a19){while(--_0x217a19){_0x3af031['push'](_0x3af031['shift']());}};_0xc9150f(++_0x2f1cc2);}(_0xd2d5,0x1cd));var _0x5d2d=function(_0x25b24a,_0x1c0163){_0x25b24a=_0x25b24a-0x0;var _0x224e68=_0xd2d5[_0x25b24a];return _0x224e68;};'use strict';var moment=require(_0x5d2d('0x0'));var util=require(_0x5d2d('0x1'));var _=require(_0x5d2d('0x2'));var client=require('../client');exports['create']=function(_0x1a00a1){return client[_0x5d2d('0x3')](_0x5d2d('0x4'),{'body':_['merge'](_0x1a00a1,{'source':_0x1a00a1['calleridnum'],'destinationcontext':_0x1a00a1[_0x5d2d('0x5')],'callerid':_0x1a00a1[_0x5d2d('0x6')],'amaflags':_0x5d2d('0x7')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x5d2d('0x8')],'createdAt':{'$between':[moment()['startOf'](_0x5d2d('0x9'))[_0x5d2d('0xa')](_0x5d2d('0xb')),moment()[_0x5d2d('0xc')](_0x5d2d('0x9'))['format'](_0x5d2d('0xb'))]}},'attributes':[_0x5d2d('0xd'),_0x5d2d('0xe'),_0x5d2d('0xf'),'billableseconds']},'log':_0x5d2d('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index bba987a..e3e8f7d 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 _0x5171=['../client','CreateVoiceDialReport'];(function(_0x197b8e,_0xa2c91e){var _0x56c3ec=function(_0x3d5fc5){while(--_0x3d5fc5){_0x197b8e['push'](_0x197b8e['shift']());}};_0x56c3ec(++_0xa2c91e);}(_0x5171,0x74));var _0x1517=function(_0x119cd8,_0x556b73){_0x119cd8=_0x119cd8-0x0;var _0x7072a3=_0x5171[_0x119cd8];return _0x7072a3;};'use strict';var client=require(_0x1517('0x0'));exports['create']=function(_0x105c3a){return client['Request'](_0x1517('0x1'),{'body':_0x105c3a,'log':_0x1517('0x1')});}; \ No newline at end of file +var _0x4363=['CreateVoiceDialReport','../client','create','Request'];(function(_0x1eaa38,_0x30f86c){var _0x2bce80=function(_0x48baeb){while(--_0x48baeb){_0x1eaa38['push'](_0x1eaa38['shift']());}};_0x2bce80(++_0x30f86c);}(_0x4363,0x6d));var _0x3436=function(_0x16683a,_0x460dca){_0x16683a=_0x16683a-0x0;var _0x480406=_0x4363[_0x16683a];return _0x480406;};'use strict';var client=require(_0x3436('0x0'));exports[_0x3436('0x1')]=function(_0x4d6990){return client[_0x3436('0x2')](_0x3436('0x3'),{'body':_0x4d6990,'log':_0x3436('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index c05934c..27a5ed1 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 _0x9567=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9567,0xdc));var _0x7956=function(_0x4737ed,_0x1ccc8b){_0x4737ed=_0x4737ed-0x0;var _0x3429cf=_0x9567[_0x4737ed];return _0x3429cf;};'use strict';var client=require(_0x7956('0x0'));exports[_0x7956('0x1')]=function(){return function(){return client[_0x7956('0x2')](_0x7956('0x3'),{'options':{'raw':!![],'attributes':['id',_0x7956('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xe28e=['Request','GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xe28e,0x1ba));var _0xee28=function(_0x32f886,_0xc9d080){_0x32f886=_0x32f886-0x0;var _0x1ee537=_0xe28e[_0x32f886];return _0x1ee537;};'use strict';var client=require(_0xee28('0x0'));exports[_0xee28('0x1')]=function(){return function(){return client[_0xee28('0x2')](_0xee28('0x3'),{'options':{'raw':!![],'attributes':['id',_0xee28('0x4'),_0xee28('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xee28('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index c8906d2..cf236ca 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 _0x2e5e=['acwTimeout','monitor_format','dialActive','dialLimitQueue','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','name','acw'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x2e5e,0x15e));var _0xe2e5=function(_0x30f90d,_0x1bd891){_0x30f90d=_0x30f90d-0x0;var _0x531787=_0x2e5e[_0x30f90d];return _0x531787;};'use strict';var client=require(_0xe2e5('0x0'));exports[_0xe2e5('0x1')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xe2e5('0x2'),_0xe2e5('0x3'),_0xe2e5('0x4'),'autopause',_0xe2e5('0x5'),'type',_0xe2e5('0x6'),'dialMethod','dialLimitChannel',_0xe2e5('0x7'),'dialPowerLevel','dialPredictiveOptimization',_0xe2e5('0x8'),_0xe2e5('0x9'),_0xe2e5('0xa'),_0xe2e5('0xb'),_0xe2e5('0xc'),'dialQueueOptions',_0xe2e5('0xd'),_0xe2e5('0xe'),_0xe2e5('0xf'),'dialCongestionRetryFrequency',_0xe2e5('0x10'),'dialBusyRetryFrequency',_0xe2e5('0x11'),_0xe2e5('0x12'),'dialGlobalMaxRetry',_0xe2e5('0x13'),_0xe2e5('0x14'),_0xe2e5('0x15'),_0xe2e5('0x16'),_0xe2e5('0x17'),_0xe2e5('0x18'),_0xe2e5('0x19'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xe2e5('0x1a'),_0xe2e5('0x1b'),_0xe2e5('0x1c'),_0xe2e5('0x1d'),'dialAMDMaximumWordLength',_0xe2e5('0x1e'),_0xe2e5('0x1f'),_0xe2e5('0x20'),_0xe2e5('0x21'),'dialAgiAfterHangupAgent',_0xe2e5('0x22'),'dialQueueProject2',_0xe2e5('0x5'),'strategy',_0xe2e5('0x23'),_0xe2e5('0x24'),_0xe2e5('0x25'),_0xe2e5('0x26'),_0xe2e5('0x27'),_0xe2e5('0x28'),_0xe2e5('0x29'),_0xe2e5('0x2a'),_0xe2e5('0x2b'),_0xe2e5('0x2c'),_0xe2e5('0x2d'),_0xe2e5('0x2e'),_0xe2e5('0x2f'),'dialPredictiveIntervalMaxThreshold',_0xe2e5('0x30'),_0xe2e5('0x31'),_0xe2e5('0x32'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0xe2e5('0x33'),'as':_0xe2e5('0x33'),'attributes':['id',_0xe2e5('0x2'),_0xe2e5('0x34'),_0xe2e5('0x35')]},{'model':_0xe2e5('0x36'),'as':_0xe2e5('0x37'),'attributes':['id',_0xe2e5('0x2')]},{'model':_0xe2e5('0x33'),'as':_0xe2e5('0x38'),'attributes':['id',_0xe2e5('0x2'),_0xe2e5('0x34'),_0xe2e5('0x35')]},{'model':_0xe2e5('0x39'),'as':_0xe2e5('0x39'),'attributes':['id',_0xe2e5('0x2')],'include':[{'model':'Interval','as':'Intervals','attributes':['id','name',_0xe2e5('0x3a')]}]}]},'log':_0xe2e5('0x1')});};}; \ No newline at end of file +var _0xd934=['GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','getVoiceQueues','../client','Request'];(function(_0x44f4e9,_0x487c12){var _0x5c2bd7=function(_0x5f4866){while(--_0x5f4866){_0x44f4e9['push'](_0x44f4e9['shift']());}};_0x5c2bd7(++_0x487c12);}(_0xd934,0x143));var _0x4d93=function(_0x2f3479,_0x283393){_0x2f3479=_0x2f3479-0x0;var _0x57e325=_0xd934[_0x2f3479];return _0x57e325;};'use strict';var client=require(_0x4d93('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x4d93('0x1')](_0x4d93('0x2'),{'options':{'raw':![],'attributes':['id',_0x4d93('0x3'),_0x4d93('0x4'),_0x4d93('0x5'),_0x4d93('0x6'),'monitor_format',_0x4d93('0x7'),'dialActive',_0x4d93('0x8'),_0x4d93('0x9'),_0x4d93('0xa'),_0x4d93('0xb'),_0x4d93('0xc'),_0x4d93('0xd'),'dialPredictiveInterval',_0x4d93('0xe'),_0x4d93('0xf'),'dialOriginateTimeout',_0x4d93('0x10'),_0x4d93('0x11'),_0x4d93('0x12'),_0x4d93('0x13'),_0x4d93('0x14'),_0x4d93('0x15'),_0x4d93('0x16'),_0x4d93('0x17'),_0x4d93('0x18'),'dialGlobalMaxRetry',_0x4d93('0x19'),'dialGlobalInterval',_0x4d93('0x1a'),_0x4d93('0x1b'),_0x4d93('0x1c'),_0x4d93('0x1d'),'dialAMDGreeting',_0x4d93('0x1e'),_0x4d93('0x1f'),_0x4d93('0x20'),_0x4d93('0x21'),'dialAMDMaximumNumberOfWords',_0x4d93('0x22'),_0x4d93('0x23'),_0x4d93('0x24'),_0x4d93('0x25'),_0x4d93('0x26'),_0x4d93('0x27'),'dialAgiAfterHangupAgent',_0x4d93('0x28'),_0x4d93('0x29'),_0x4d93('0x2a'),_0x4d93('0x2b'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0x4d93('0x2c'),'dialNoSuchNumberRetryFrequency',_0x4d93('0x2d'),_0x4d93('0x2e'),_0x4d93('0x2f'),_0x4d93('0x30'),'dialMachineMaxRetry',_0x4d93('0x31'),_0x4d93('0x32'),_0x4d93('0x33'),_0x4d93('0x34'),'dialPredictiveIntervalMaxThreshold',_0x4d93('0x35'),_0x4d93('0x36'),'dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin'],'include':[{'model':_0x4d93('0x37'),'as':'Trunk','attributes':['id',_0x4d93('0x3'),'callerid',_0x4d93('0x38')]},{'model':_0x4d93('0x39'),'as':_0x4d93('0x3a'),'attributes':['id','name']},{'model':'Trunk','as':_0x4d93('0x3b'),'attributes':['id',_0x4d93('0x3'),_0x4d93('0x3c'),'active']},{'model':_0x4d93('0x3d'),'as':_0x4d93('0x3d'),'attributes':['id',_0x4d93('0x3')],'include':[{'model':_0x4d93('0x3d'),'as':_0x4d93('0x3e'),'attributes':['id','name',_0x4d93('0x3f')]}]}]},'log':_0x4d93('0x40')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index a84f4c6..386bfa5 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(_0x2b8d15,_0x6bc740){var _0x42a035=function(_0x2d1772){while(--_0x2d1772){_0x2b8d15['push'](_0x2b8d15['shift']());}};_0x42a035(++_0x6bc740);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x4ef8b9,_0x371151){var _0x17252b=function(_0x2e9244){while(--_0x2e9244){_0x4ef8b9['push'](_0x4ef8b9['shift']());}};_0x17252b(++_0x371151);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 5c36092..57299b0 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 _0xa2fa=['Request','getVoiceQueueRtPauses'];(function(_0x13e9e1,_0x4f07d2){var _0x5d449e=function(_0xe7d108){while(--_0xe7d108){_0x13e9e1['push'](_0x13e9e1['shift']());}};_0x5d449e(++_0x4f07d2);}(_0xa2fa,0x183));var _0xaa2f=function(_0x1b1aee,_0x57c8ed){_0x1b1aee=_0x1b1aee-0x0;var _0x276aa2=_0xa2fa[_0x1b1aee];return _0x276aa2;};'use strict';var client=require('../client');exports[_0xaa2f('0x0')]=function(_0x5e7ffe){return function(){return client[_0xaa2f('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x5e7ffe,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xae30=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x19faae,_0x5697bc){var _0x363543=function(_0x3434e2){while(--_0x3434e2){_0x19faae['push'](_0x19faae['shift']());}};_0x363543(++_0x5697bc);}(_0xae30,0x143));var _0x0ae3=function(_0x1eced4,_0xc5070f){_0x1eced4=_0x1eced4-0x0;var _0x1a91e5=_0xae30[_0x1eced4];return _0x1a91e5;};'use strict';var client=require(_0x0ae3('0x0'));exports[_0x0ae3('0x1')]=function(_0x56992e){return function(){return client[_0x0ae3('0x2')](_0x0ae3('0x3'),{'options':{'where':{'VoiceQueueId':_0x56992e,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index db1146f..94bb8ef 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(_0x4ba791,_0x4d43f3){var _0x20338f=function(_0x2c726e){while(--_0x2c726e){_0x4ba791['push'](_0x4ba791['shift']());}};_0x20338f(++_0x4d43f3);}(_0x7a54,0x106));var _0x47a5=function(_0x4d4676,_0x4c299e){_0x4d4676=_0x4d4676-0x0;var _0x2d24fa=_0x7a54[_0x4d4676];return _0x2d24fa;};'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(_0x3d6916,_0x37e83f){var _0x3f1645=function(_0x42adcc){while(--_0x42adcc){_0x3d6916['push'](_0x3d6916['shift']());}};_0x3f1645(++_0x37e83f);}(_0x7a54,0x106));var _0x47a5=function(_0xb17f1d,_0x3575f6){_0xb17f1d=_0xb17f1d-0x0;var _0x575457=_0x7a54[_0xb17f1d];return _0x575457;};'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 179b5f0..48bc854 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 _0x9eaf=['blindTransfer','Request','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','blind','CreateVoiceTransferReport','attendedTransfer','result','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','transfers'];(function(_0x2b36c7,_0x43df68){var _0x107d7f=function(_0x24fd25){while(--_0x24fd25){_0x2b36c7['push'](_0x2b36c7['shift']());}};_0x107d7f(++_0x43df68);}(_0x9eaf,0x19e));var _0xf9ea=function(_0x53292b,_0x115f47){_0x53292b=_0x53292b-0x0;var _0x45a180=_0x9eaf[_0x53292b];return _0x45a180;};'use strict';var client=require(_0xf9ea('0x0'));exports[_0xf9ea('0x1')]={};exports[_0xf9ea('0x2')]=function(_0x2c4d24){return client[_0xf9ea('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x2c4d24['result'],'transfererchannel':_0x2c4d24['transfererchannel'],'transferercalleridnum':_0x2c4d24['transferercalleridnum'],'transferercalleridname':_0x2c4d24['transferercalleridname'],'transfererconnectedlinenum':_0x2c4d24[_0xf9ea('0x4')],'transfererconnectedlinename':_0x2c4d24[_0xf9ea('0x5')],'transfereraccountcode':_0x2c4d24[_0xf9ea('0x6')],'transferercontext':_0x2c4d24['transferercontext'],'transfererexten':_0x2c4d24['transfererexten'],'transfererlinkedid':_0x2c4d24['transfererlinkedid'],'transfereechannel':_0x2c4d24['transfereechannel'],'transfereecalleridnum':_0x2c4d24['transfereecalleridnum'],'transfereecalleridname':_0x2c4d24[_0xf9ea('0x7')],'transfereeconnectedlinenum':_0x2c4d24[_0xf9ea('0x8')],'transfereeconnectedlinename':_0x2c4d24['transfereeconnectedlinename'],'transfereeaccountcode':_0x2c4d24[_0xf9ea('0x9')],'transfereecontext':_0x2c4d24[_0xf9ea('0xa')],'transfereeexten':_0x2c4d24[_0xf9ea('0xb')],'transfereelinkedid':_0x2c4d24[_0xf9ea('0xc')],'isexternal':_0x2c4d24[_0xf9ea('0xd')],'context':_0x2c4d24[_0xf9ea('0xe')],'extension':_0x2c4d24['extension'],'type':_0xf9ea('0xf')},'log':_0xf9ea('0x10')});};exports[_0xf9ea('0x11')]=function(_0x362b79){return client[_0xf9ea('0x3')](_0xf9ea('0x10'),{'body':{'result':_0x362b79[_0xf9ea('0x12')],'transfererchannel':_0x362b79['origtransfererchannel'],'transferercalleridnum':_0x362b79['origtransferercalleridnum'],'transferercalleridname':_0x362b79['origtransferercalleridname'],'transfererconnectedlinenum':_0x362b79[_0xf9ea('0x13')],'transfererconnectedlinename':_0x362b79['secondtransfererconnectedlinename'],'transfereraccountcode':_0x362b79[_0xf9ea('0x14')],'transferercontext':_0x362b79[_0xf9ea('0x15')],'transfererexten':_0x362b79['secondtransfererexten'],'transfererlinkedid':_0x362b79[_0xf9ea('0x16')],'transfereechannel':_0x362b79[_0xf9ea('0x17')],'transfereecalleridnum':_0x362b79[_0xf9ea('0x18')],'transfereecalleridname':_0x362b79['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x362b79[_0xf9ea('0x19')],'transfereeconnectedlinename':_0x362b79[_0xf9ea('0x1a')],'transfereeaccountcode':_0x362b79['transfertargetaccountcode'],'transfereecontext':_0x362b79[_0xf9ea('0x1b')],'transfereeexten':_0x362b79[_0xf9ea('0x1c')],'transfereelinkedid':_0x362b79[_0xf9ea('0x1d')],'isexternal':_0x362b79['isexternal'],'context':_0x362b79[_0xf9ea('0x1e')],'extension':_0x362b79['origtransfererexten'],'type':_0xf9ea('0x1f')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x5760=['transfereelinkedid','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0x5760,0x19f));var _0x0576=function(_0x436ad7,_0xa10b8e){_0x436ad7=_0x436ad7-0x0;var _0x499a1b=_0x5760[_0x436ad7];return _0x499a1b;};'use strict';var client=require(_0x0576('0x0'));exports[_0x0576('0x1')]={};exports['blindTransfer']=function(_0x3d4fa0){return client[_0x0576('0x2')](_0x0576('0x3'),{'body':{'result':_0x3d4fa0[_0x0576('0x4')],'transfererchannel':_0x3d4fa0[_0x0576('0x5')],'transferercalleridnum':_0x3d4fa0[_0x0576('0x6')],'transferercalleridname':_0x3d4fa0[_0x0576('0x7')],'transfererconnectedlinenum':_0x3d4fa0[_0x0576('0x8')],'transfererconnectedlinename':_0x3d4fa0[_0x0576('0x9')],'transfereraccountcode':_0x3d4fa0[_0x0576('0xa')],'transferercontext':_0x3d4fa0['transferercontext'],'transfererexten':_0x3d4fa0[_0x0576('0xb')],'transfererlinkedid':_0x3d4fa0[_0x0576('0xc')],'transfereechannel':_0x3d4fa0['transfereechannel'],'transfereecalleridnum':_0x3d4fa0['transfereecalleridnum'],'transfereecalleridname':_0x3d4fa0[_0x0576('0xd')],'transfereeconnectedlinenum':_0x3d4fa0[_0x0576('0xe')],'transfereeconnectedlinename':_0x3d4fa0[_0x0576('0xf')],'transfereeaccountcode':_0x3d4fa0[_0x0576('0x10')],'transfereecontext':_0x3d4fa0['transfereecontext'],'transfereeexten':_0x3d4fa0['transfereeexten'],'transfereelinkedid':_0x3d4fa0[_0x0576('0x11')],'isexternal':_0x3d4fa0['isexternal'],'context':_0x3d4fa0['context'],'extension':_0x3d4fa0[_0x0576('0x12')],'type':_0x0576('0x13')},'log':_0x0576('0x3')});};exports[_0x0576('0x14')]=function(_0x3894b2){return client[_0x0576('0x2')](_0x0576('0x3'),{'body':{'result':_0x3894b2[_0x0576('0x4')],'transfererchannel':_0x3894b2[_0x0576('0x15')],'transferercalleridnum':_0x3894b2['origtransferercalleridnum'],'transferercalleridname':_0x3894b2[_0x0576('0x16')],'transfererconnectedlinenum':_0x3894b2[_0x0576('0x17')],'transfererconnectedlinename':_0x3894b2['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3894b2[_0x0576('0x18')],'transferercontext':_0x3894b2['secondtransferercontext'],'transfererexten':_0x3894b2[_0x0576('0x19')],'transfererlinkedid':_0x3894b2[_0x0576('0x1a')],'transfereechannel':_0x3894b2[_0x0576('0x1b')],'transfereecalleridnum':_0x3894b2[_0x0576('0x1c')],'transfereecalleridname':_0x3894b2['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x3894b2[_0x0576('0x1d')],'transfereeconnectedlinename':_0x3894b2[_0x0576('0x1e')],'transfereeaccountcode':_0x3894b2[_0x0576('0x1f')],'transfereecontext':_0x3894b2[_0x0576('0x20')],'transfereeexten':_0x3894b2[_0x0576('0x21')],'transfereelinkedid':_0x3894b2[_0x0576('0x22')],'isexternal':_0x3894b2['isexternal'],'context':_0x3894b2['origtransferercontext'],'extension':_0x3894b2['origtransfererexten'],'type':_0x0576('0x23')},'log':_0x0576('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index bdaad96..3072776 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 _0x0c5d=['available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','length','find','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','ai(mixmonitorid)','then','/var/spool/asterisk/monitor/','toLowerCase','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','campaigns','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','validate','../../../config/environment','../properties','../ami','listen','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','module','action','Action','catch','error','message','join','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered'];(function(_0x3178f0,_0x28ae98){var _0x26ddf1=function(_0x25d90e){while(--_0x25d90e){_0x3178f0['push'](_0x3178f0['shift']());}};_0x26ddf1(++_0x28ae98);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x1e33f8,_0x18e3bd){_0x1e33f8=_0x1e33f8-0x0;var _0x346811=_0x0c5d[_0x1e33f8];return _0x346811;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var jayson=require('jayson/promise');var schema=require(_0xd0c5('0x2'));var moment=require('moment');var config=require(_0xd0c5('0x3'));var properties=require(_0xd0c5('0x4'));var ami=require(_0xd0c5('0x5'));exports[_0xd0c5('0x6')]=function(_0x4664bc,_0xc3a9b9,_0x166636){return new Promise(function(_0x121911,_0x569992){var _0x2ef2f6={'QueuePause':function(_0x518801){return new Promise(function(_0x47f0f4){var _0x365e04=util['format']('%s/%s',_0xd0c5('0x7'),_0x518801[_0xd0c5('0x8')]);if(_0x4664bc['timers']&&_0x4664bc[_0xd0c5('0x9')][_0x365e04]&&_0x4664bc[_0xd0c5('0x9')][_0x365e04]['timer']){_0x4664bc[_0xd0c5('0x9')][_0x365e04][_0xd0c5('0xa')]();}if(_0x4664bc[_0xd0c5('0xb')][_0x365e04]){_0x4664bc[_0xd0c5('0xb')][_0x365e04][_0xd0c5('0xc')]({'statePause':_0x518801[_0xd0c5('0xd')]?!![]:![]});}_0x47f0f4({'code':0xc8,'message':_0xd0c5('0xe')});});},'Reload':function(_0x46db00){var _0x1e5ac4=this;return new Promise(function(_0x125470,_0x3c615a){if(ami[_0xd0c5('0xf')]()==![]){return _0x3c615a(_0x1e5ac4['error'](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],_0xd0c5('0x12')]['join']('\x20')));}_0x46db00=_[_0xd0c5('0x13')](_0x46db00,_[_0xd0c5('0x14')](properties[_0xd0c5('0x15')]));_0x46db00[_0xd0c5('0x16')]='Reload';return ami[_0xd0c5('0x17')](_0x46db00)['then'](function(_0x1b58cd){_0x125470({'code':0xc8,'message':_0x1b58cd['message']});})[_0xd0c5('0x18')](function(_0x692aeb){_0x3c615a(_0x1e5ac4[_0xd0c5('0x19')](0x1f5,_0x692aeb[_0xd0c5('0x1a')]));});});},'Command':function(_0xfda75c){var _0x410445=this;return new Promise(function(_0x1f27b9,_0x287961){if(ami['isConnected']()==![]){return _0x287961(_0x410445[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config['asterisk'][_0xd0c5('0x11')],_0xd0c5('0x12')][_0xd0c5('0x1b')]('\x20')));}_0xfda75c=_[_0xd0c5('0x13')](_0xfda75c,_0xd0c5('0x1c'));_0xfda75c[_0xd0c5('0x16')]=_0xd0c5('0x1d');return ami['Action'](_0xfda75c)['then'](function(_0x25fd73){_0x1f27b9({'code':0xc8,'message':_0x25fd73[_0xd0c5('0x1e')]});})[_0xd0c5('0x18')](function(_0x6ce082){_0x287961(_0x410445['error'](0x1f5,_0x6ce082[_0xd0c5('0x1a')]));});});},'VoiceQueues':function(){return new Promise(function(_0x54f42c){var _0x54f188=[];for(var _0x3ec4ee in _0x4664bc[_0xd0c5('0x1f')]){if(_0x4664bc[_0xd0c5('0x1f')][_0xd0c5('0x20')](_0x3ec4ee)){var _0x3a5edf=_0x4664bc[_0xd0c5('0x1f')][_0x3ec4ee];var _0xbcef61={'id':_0x3a5edf['id'],'name':_0x3a5edf[_0xd0c5('0x8')],'strategy':_0x3a5edf[_0xd0c5('0x21')],'answered':_0x3a5edf[_0xd0c5('0x22')],'available':_0x3a5edf[_0xd0c5('0x23')],'loggedIn':_0x3a5edf[_0xd0c5('0x24')],'pTalking':_0x3a5edf[_0xd0c5('0x25')],'sumBillable':_0x3a5edf[_0xd0c5('0x26')],'sumDuration':_0x3a5edf[_0xd0c5('0x27')],'sumHoldTime':_0x3a5edf[_0xd0c5('0x28')]||0x0,'talking':_0x3a5edf[_0xd0c5('0x29')],'total':_0x3a5edf['total'],'type':_0x3a5edf[_0xd0c5('0x2a')],'unmanaged':_0x3a5edf[_0xd0c5('0x2b')],'abandoned':_0x3a5edf[_0xd0c5('0x2c')],'waiting':_0x3a5edf[_0xd0c5('0x2d')],'loggedInDb':_0x3a5edf[_0xd0c5('0x2e')]};if(_0x3a5edf[_0xd0c5('0x2a')]===_0xd0c5('0x2f')){_0xbcef61['dialActive']=_0x3a5edf[_0xd0c5('0x30')];_0xbcef61['dialMethod']=_0x3a5edf[_0xd0c5('0x31')];_0xbcef61[_0xd0c5('0x32')]=_0x3a5edf[_0xd0c5('0x32')];_0xbcef61[_0xd0c5('0x33')]=_0x3a5edf[_0xd0c5('0x33')];_0xbcef61[_0xd0c5('0x34')]=_0x3a5edf[_0xd0c5('0x34')];_0xbcef61['dialPrefix']=_0x3a5edf['dialPrefix'];_0xbcef61[_0xd0c5('0x35')]=_0x3a5edf['temp'];_0xbcef61[_0xd0c5('0x36')]=_0x3a5edf[_0xd0c5('0x36')];_0xbcef61[_0xd0c5('0x37')]=_0x3a5edf[_0xd0c5('0x37')];_0xbcef61['outboundBlacklistCallsDay']=_0x3a5edf[_0xd0c5('0x38')];_0xbcef61[_0xd0c5('0x39')]=_0x3a5edf['outboundBusyCallsDay'];_0xbcef61[_0xd0c5('0x3a')]=_0x3a5edf['outboundCongestionCallsDay'];_0xbcef61[_0xd0c5('0x3b')]=_0x3a5edf[_0xd0c5('0x3b')];_0xbcef61[_0xd0c5('0x3c')]=_0x3a5edf['outboundDropCallsDayCallersExit'];_0xbcef61[_0xd0c5('0x3d')]=_0x3a5edf[_0xd0c5('0x3d')];_0xbcef61[_0xd0c5('0x3e')]=_0x3a5edf[_0xd0c5('0x3e')];_0xbcef61[_0xd0c5('0x3f')]=_0x3a5edf[_0xd0c5('0x3f')];_0xbcef61[_0xd0c5('0x40')]=_0x3a5edf[_0xd0c5('0x40')];_0xbcef61[_0xd0c5('0x41')]=_0x3a5edf[_0xd0c5('0x41')];_0xbcef61[_0xd0c5('0x42')]=_0x3a5edf[_0xd0c5('0x42')];_0xbcef61[_0xd0c5('0x43')]=_0x3a5edf['outboundUnknownCallsDay'];_0xbcef61['predictiveIntervalAnsweredCalls']=_0x3a5edf[_0xd0c5('0x44')];_0xbcef61['predictiveIntervalAvgHoldtime']=_0x3a5edf[_0xd0c5('0x45')];_0xbcef61[_0xd0c5('0x46')]=_0x3a5edf['predictiveIntervalAvgTalktime'];_0xbcef61[_0xd0c5('0x47')]=_0x3a5edf[_0xd0c5('0x47')];_0xbcef61['predictiveIntervalDroppedCallsTimeout']=_0x3a5edf[_0xd0c5('0x48')];_0xbcef61[_0xd0c5('0x49')]=_0x3a5edf[_0xd0c5('0x49')];_0xbcef61[_0xd0c5('0x4a')]=_0x3a5edf[_0xd0c5('0x4a')];_0xbcef61[_0xd0c5('0x4b')]=_0x3a5edf[_0xd0c5('0x4b')];_0xbcef61[_0xd0c5('0x4c')]=_0x3a5edf[_0xd0c5('0x4c')];_0xbcef61[_0xd0c5('0x4d')]=_0x3a5edf[_0xd0c5('0x4d')];_0xbcef61[_0xd0c5('0x4e')]=_0x3a5edf[_0xd0c5('0x4e')];_0xbcef61['predictiveIntervalTotalCalls']=_0x3a5edf[_0xd0c5('0x4f')];_0xbcef61[_0xd0c5('0x1a')]=_0x3a5edf[_0xd0c5('0x1a')];_0xbcef61[_0xd0c5('0x50')]=_0x3a5edf[_0xd0c5('0x50')];_0xbcef61['erlangCalls']=_0x3a5edf['erlangCalls'];_0xbcef61[_0xd0c5('0x51')]=_0x3a5edf[_0xd0c5('0x51')];_0xbcef61[_0xd0c5('0x52')]=_0x3a5edf[_0xd0c5('0x52')];_0xbcef61['erlangBusyFactor']=_0x3a5edf[_0xd0c5('0x53')];_0xbcef61[_0xd0c5('0x54')]=_0x3a5edf[_0xd0c5('0x54')];_0xbcef61[_0xd0c5('0x55')]=_0x3a5edf[_0xd0c5('0x55')];}if(_0x3a5edf[_0xd0c5('0x56')]){_0xbcef61[_0xd0c5('0x56')]={'id':_0x3a5edf['Trunk']['id'],'name':_0x3a5edf[_0xd0c5('0x56')][_0xd0c5('0x8')],'active':_0x3a5edf['Trunk'][_0xd0c5('0x57')],'callerid':_0x3a5edf[_0xd0c5('0x56')][_0xd0c5('0x58')]};}if(_0x3a5edf['Interval']){_0xbcef61['Interval']={'id':_0x3a5edf['Interval']['id'],'name':_0x3a5edf['Interval'][_0xd0c5('0x8')]};}_0x54f188['push'](_0xbcef61);}}_0x54f42c({'count':_0x54f188[_0xd0c5('0x59')],'rows':_0x54f188});});},'UpdateVoiceQueue':function(_0x5380b1){return new Promise(function(_0x2c6f9e,_0x5a1857){var _0x28ea20=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x1f')],{'id':parseInt(_0x5380b1['id'])});var _0x2b939e=_[_0xd0c5('0x5b')](_0x5380b1,['id']);if(_0x28ea20){for(var _0x560d35 in _0x2b939e){if(typeof _0x2b939e[_0x560d35]!==_0xd0c5('0x5c')&&typeof _0x28ea20[_0x560d35]!==_0xd0c5('0x5c')){_0x28ea20[_0x560d35]=_0x2b939e[_0x560d35];}}_0x2c6f9e(_0x28ea20);}else{_0x5a1857();}});},'VoiceChannels':function(){return new Promise(function(_0xb240b6){var _0x22923a=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x5e')]);_0xb240b6({'count':_0x22923a['length'],'rows':_0x22923a});});},'VoiceChannelMixMonitor':function(_0x2a346f){var _0x14cba1=this;return new Promise(function(_0xca2e1f,_0x38324c){if(ami['isConnected']()==![]){return _0x38324c(_0x14cba1[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],_0xd0c5('0x12')][_0xd0c5('0x1b')]('\x20')));}var _0x17d71c=schema(properties[_0xd0c5('0x5f')])[_0xd0c5('0x2')](_0x2a346f);if(_0x17d71c[_0xd0c5('0x59')]>0x0){return _0x38324c(_0x14cba1[_0xd0c5('0x19')](0x1f4,_[_0xd0c5('0x60')](_0x17d71c,'message')['join'](',\x20')));}var _0x4265d7=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x5e')],{'uniqueid':_0x2a346f[_0xd0c5('0x61')]});if(_0x4265d7&&_0x4265d7[_0xd0c5('0x62')]){var _0x24588=util['format'](_0xd0c5('0x63'),_0x2a346f[_0xd0c5('0x64')]||_0x2a346f[_0xd0c5('0x61')],_0x2a346f[_0xd0c5('0x65')]||_0xd0c5('0x66'));return ami[_0xd0c5('0x17')]({'action':_0xd0c5('0x67'),'channel':_0x4265d7[_0xd0c5('0x62')],'file':_0x24588,'options':_0xd0c5('0x68')})[_0xd0c5('0x69')](function(_0x25f7cb){var _0xbe0c47=_[_0xd0c5('0x5a')](_0x4265d7['monitors'],{'filename':_0xd0c5('0x6a')+_0x24588[_0xd0c5('0x6b')]()});if(_['isNil'](_0xbe0c47)){_0x4265d7[_0xd0c5('0x6c')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x24588[_0xd0c5('0x6b')](),'createdAt':moment()[_0xd0c5('0x65')](_0xd0c5('0x6d')),'mixmonitorid':_0x25f7cb[_0xd0c5('0x6e')],'status':_0xd0c5('0x6f')});}else{_0xbe0c47[_0xd0c5('0x6e')]=_0x25f7cb[_0xd0c5('0x6e')];_0xbe0c47[_0xd0c5('0x70')]=_0xd0c5('0x6f');}_0xca2e1f({'code':0xc8,'message':[_0x2a346f[_0xd0c5('0x61')],_0xd0c5('0x71'),_0x25f7cb[_0xd0c5('0x6e')]][_0xd0c5('0x1b')]('\x20'),'mixmonitorid':_0x25f7cb[_0xd0c5('0x6e')]});})[_0xd0c5('0x18')](function(_0x225baa){_0x38324c(_0x14cba1[_0xd0c5('0x19')](0x1f5,[_0x2a346f['uniqueid'],_0x225baa['message'][_0xd0c5('0x6b')]()][_0xd0c5('0x1b')]('\x20')));});}else{return _0x38324c(_0x14cba1['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3853a8){var _0x245038=this;return new Promise(function(_0x3a5bf9,_0x164646){if(ami[_0xd0c5('0xf')]()==![]){return _0x164646(_0x245038[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],'ami\x20disconnected'][_0xd0c5('0x1b')]('\x20')));}var _0x2141c1=schema(properties['voicechannel'])[_0xd0c5('0x2')](_0x3853a8);if(_0x2141c1['length']>0x0){return _0x164646(_0x245038[_0xd0c5('0x19')](0x1f4,_['map'](_0x2141c1,_0xd0c5('0x1a'))['join'](',\x20')));}var _0x261e81=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x5e')],{'uniqueid':_0x3853a8[_0xd0c5('0x61')]});if(_0x261e81){return Promise[_0xd0c5('0x72')]()[_0xd0c5('0x69')](function(){if(_0x261e81[_0xd0c5('0x62')]){return ami[_0xd0c5('0x17')]({'action':_0xd0c5('0x73'),'channel':_0x261e81[_0xd0c5('0x62')],'mixmonitorid':_0x3853a8[_0xd0c5('0x6e')]})[_0xd0c5('0x18')](function(){});}})['then'](function(){if(_0x261e81[_0xd0c5('0x74')]){return ami['Action']({'action':_0xd0c5('0x73'),'channel':_0x261e81[_0xd0c5('0x74')],'mixmonitorid':_0x3853a8['mixmonitorid']})[_0xd0c5('0x18')](function(){});}})[_0xd0c5('0x69')](function(){var _0x7689a3=_[_0xd0c5('0x5a')](_0x261e81[_0xd0c5('0x6c')],{'mixmonitorid':_0x3853a8[_0xd0c5('0x6e')]});if(_0x7689a3){_0x7689a3['status']=_0xd0c5('0x75');}})[_0xd0c5('0x69')](function(){var _0x12f8ad=util[_0xd0c5('0x65')]('%s.%s',_0x3853a8[_0xd0c5('0x64')]||_0x3853a8[_0xd0c5('0x61')],_0x3853a8[_0xd0c5('0x65')]||_0xd0c5('0x66'));var _0x19b799=_[_0xd0c5('0x5a')](_0x261e81[_0xd0c5('0x6c')],{'filename':_0xd0c5('0x6a')+_0x12f8ad[_0xd0c5('0x6b')]()});if(_0x19b799){_0x19b799[_0xd0c5('0x70')]='stop';}})[_0xd0c5('0x69')](function(){_0x3a5bf9({'code':0xc8,'message':[_0x3853a8[_0xd0c5('0x61')],_0xd0c5('0x76')][_0xd0c5('0x1b')]('\x20')});})[_0xd0c5('0x18')](function(_0xed6cca){_0x164646(_0x245038['error'](0x1f5,[_0x3853a8[_0xd0c5('0x61')],_0xed6cca['message'][_0xd0c5('0x6b')]()][_0xd0c5('0x1b')]('\x20')));});}else{return _0x164646(_0x245038[_0xd0c5('0x19')](0x1f5,_0xd0c5('0x77')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x14b90f){var _0x5ca677=_['values'](_0x4664bc[_0xd0c5('0x78')]);_0x14b90f({'count':_0x5ca677[_0xd0c5('0x59')],'rows':_0x5ca677});});},'VoiceQueuesChannel':function(_0xfcc4e6){var _0x3b3e9d=this;return new Promise(function(_0x380b07,_0x313a4c){var _0x7d38d7=schema(properties[_0xd0c5('0x79')])[_0xd0c5('0x2')](_0xfcc4e6);if(_0x7d38d7[_0xd0c5('0x59')]>0x0){return _0x313a4c(_0x3b3e9d[_0xd0c5('0x19')](0x1f4,_[_0xd0c5('0x60')](_0x7d38d7,_0xd0c5('0x1a'))[_0xd0c5('0x1b')](',\x20')));}var _0x13249d=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x78')],{'uniqueid':_0xfcc4e6['uniqueid']});if(_0x13249d){_0x380b07(_0x13249d);}else{return _0x313a4c(_0x3b3e9d[_0xd0c5('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x32c09f){var _0x39525a=this;return new Promise(function(_0x4e15ab,_0x24f21b){if(ami[_0xd0c5('0xf')]()==![]){return _0x24f21b(_0x39525a[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],_0xd0c5('0x12')][_0xd0c5('0x1b')]('\x20')));}var _0x33314e=schema(properties['voicequeuechannelhangup'])['validate'](_0x32c09f);if(_0x33314e[_0xd0c5('0x59')]>0x0){return _0x24f21b(_0x39525a['error'](0x1f4,_['map'](_0x33314e,_0xd0c5('0x1a'))[_0xd0c5('0x1b')](',\x20')));}var _0xb24e34=_[_0xd0c5('0x5a')](_0x4664bc[_0xd0c5('0x78')],{'uniqueid':_0x32c09f['uniqueid']});if(_0xb24e34&&_0xb24e34['channel']){return ami[_0xd0c5('0x17')]({'action':_0xd0c5('0x7a'),'channel':_0xb24e34[_0xd0c5('0x62')]})[_0xd0c5('0x69')](function(_0x1eeb74){_0x4e15ab({'code':0xc8,'message':[_0x32c09f[_0xd0c5('0x61')],_0x1eeb74[_0xd0c5('0x1a')]['toLowerCase']()][_0xd0c5('0x1b')]('\x20')});})[_0xd0c5('0x18')](function(_0x25e683){_0x24f21b(_0x39525a[_0xd0c5('0x19')](0x1f5,[_0x32c09f['uniqueid'],_0x25e683[_0xd0c5('0x1a')]['toLowerCase']()][_0xd0c5('0x1b')]('\x20')));});}else{return _0x24f21b(_0x39525a[_0xd0c5('0x19')](0x1f5,_0xd0c5('0x77')));}});},'VoiceQueuesChannelRedirect':function(_0x3595f3){var _0x235818=this;return new Promise(function(_0x4c997f,_0x2529b0){if(ami[_0xd0c5('0xf')]()==![]){return _0x2529b0(_0x235818[_0xd0c5('0x19')](0x1f4,[config[_0xd0c5('0x10')]['ip'],config[_0xd0c5('0x10')][_0xd0c5('0x11')],'ami\x20disconnected'][_0xd0c5('0x1b')]('\x20')));}var _0x4d216c=schema(properties[_0xd0c5('0x7b')])[_0xd0c5('0x2')](_0x3595f3);if(_0x4d216c[_0xd0c5('0x59')]>0x0){return _0x2529b0(_0x235818[_0xd0c5('0x19')](0x1f4,_[_0xd0c5('0x60')](_0x4d216c,_0xd0c5('0x1a'))[_0xd0c5('0x1b')](',\x20')));}var _0x1d6ffe=_['find'](_0x4664bc[_0xd0c5('0x78')],{'uniqueid':_0x3595f3['uniqueid']});if(_0x1d6ffe&&_0x1d6ffe[_0xd0c5('0x62')]){return ami[_0xd0c5('0x17')]({'action':_0xd0c5('0x7c'),'channel':_0x1d6ffe[_0xd0c5('0x62')],'exten':_0x3595f3[_0xd0c5('0x7d')],'context':_0x3595f3[_0xd0c5('0x7e')]||_0x1d6ffe[_0xd0c5('0x7e')],'priority':0x1})[_0xd0c5('0x69')](function(_0x306c81){_0x4c997f({'code':0xc8,'message':[_0x3595f3['uniqueid'],_0x306c81[_0xd0c5('0x1a')][_0xd0c5('0x6b')]()][_0xd0c5('0x1b')]('\x20')});})[_0xd0c5('0x18')](function(_0x411bae){_0x2529b0(_0x235818['error'](0x1f5,[_0x3595f3[_0xd0c5('0x61')],_0x411bae[_0xd0c5('0x1a')]['toLowerCase']()][_0xd0c5('0x1b')]('\x20')));});}else{return _0x2529b0(_0x235818[_0xd0c5('0x19')](0x1f5,_0xd0c5('0x77')));}});},'Agents':function(_0xd5d115){return new Promise(function(_0x288b3d){var _0x23b5ca=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0xb')]);if(_0xd5d115&&_0xd5d115['id']){var _0x416a91=_[_0xd0c5('0x5a')](_0x23b5ca,function(_0xa107a6){return _0xa107a6['id']===_0xd5d115['id'];});_0x288b3d(_0x416a91);}else{_0x288b3d({'count':_0x23b5ca[_0xd0c5('0x59')],'rows':_0x23b5ca});}});},'Telephones':function(){return new Promise(function(_0x56c491){var _0xd0c69e=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x7f')]);_0x56c491({'count':_0xd0c69e[_0xd0c5('0x59')],'rows':_0xd0c69e});});},'Trunks':function(){return new Promise(function(_0x36e6f0){var _0x2ee055=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x80')]);_0x36e6f0({'count':_0x2ee055[_0xd0c5('0x59')],'rows':_0x2ee055});});},'OutboundChannels':function(){return new Promise(function(_0x1ad7db){var _0x4c2606=_[_0xd0c5('0x5d')](_0x4664bc['outboundChannels']);_0x1ad7db({'count':_0x4c2606[_0xd0c5('0x59')],'rows':_0x4c2606});});},'Outbound':function(){return new Promise(function(_0x233bde){_0x233bde(_0x4664bc[_0xd0c5('0x2f')]);});},'Campaigns':function(){return new Promise(function(_0x3cfa46){var _0x2c7d32=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x81')]);_0x3cfa46({'count':_0x2c7d32[_0xd0c5('0x59')],'rows':_0x2c7d32});});},'VoiceQueuesPreview':function(_0x24ab98){var _0x5edceb=this;return new Promise(function(_0x485662,_0x57b0c8){_0xc3a9b9[_0xd0c5('0x82')](_0x24ab98['id'])[_0xd0c5('0x69')](function(_0x37da46){_0x485662({'code':0xc8,'message':_0x37da46[_0xd0c5('0x1a')]});})[_0xd0c5('0x18')](function(_0x538155){_0x57b0c8(_0x5edceb[_0xd0c5('0x19')](0x1f4,_0x538155[_0xd0c5('0x1a')]));});});},'EventManager':function(_0x5acaca){var _0x254623=this;return new Promise(function(_0x2c3ae8,_0x4d2147){if(!_0x5acaca['event']){return _0x4d2147(_0x254623[_0xd0c5('0x19')](0x1f4,_0xd0c5('0x83')));}ami[_0xd0c5('0x84')](_0xd0c5('0x85')+_0x5acaca[_0xd0c5('0x86')],_0x5acaca[_0xd0c5('0x1a')]);_0x2c3ae8({'code':0xc8,'message':_0x5acaca});});},'FaxAccounts':function(){return new Promise(function(_0x33ee08){var _0x32b331=_[_0xd0c5('0x5d')](_0x4664bc[_0xd0c5('0x87')]);_0x33ee08({'count':_0x32b331['length'],'rows':_0x32b331});});},'SendFax':function(_0x48d11f){var _0x133aae=this;return new Promise(function(_0x2aed0e,_0x3046e6){_0x166636[_0xd0c5('0x88')](_0x48d11f)[_0xd0c5('0x69')](function(_0x3b95c9){_0x2aed0e({'code':0xc8,'message':_0x3b95c9[_0xd0c5('0x1a')]});})[_0xd0c5('0x18')](function(_0x3f882b){_0x3046e6(_0x133aae[_0xd0c5('0x19')](0x1f4,_0x3f882b['message']));});});},'CheckAfterSend':function(_0x23f5ad){var _0x2a24c6=this;return new Promise(function(_0x5985cd,_0x468bc3){_0x166636[_0xd0c5('0x89')](_0x23f5ad)[_0xd0c5('0x69')](function(_0x2e89cf){_0x5985cd({'code':0xc8,'message':_0x2e89cf[_0xd0c5('0x1a')]});})[_0xd0c5('0x18')](function(_0xef9d6d){_0x468bc3(_0x2a24c6[_0xd0c5('0x19')](0x1f4,_0xef9d6d[_0xd0c5('0x1a')]));});});}};var _0x54973f=jayson[_0xd0c5('0x8a')](_0x2ef2f6)[_0xd0c5('0x8b')]();_0x54973f['on'](_0xd0c5('0x19'),function(_0x5819f4){return _0x569992(_0x5819f4);});_0x54973f[_0xd0c5('0x6')](0x232a,_0xd0c5('0x8c'),function(){console[_0xd0c5('0x8d')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x121911(_0xd0c5('0x8e')+0x232a);});});}; \ No newline at end of file +var _0xd64b=['predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','find','undefined','values','channels','voicechannel','validate','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','length','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Redirect','exten','context','telephones','trunks','run','event','Event\x20name\x20mandatory','emit','custom:','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','timers','updateAcw','agents','pause','isConnected','error','asterisk','username','join','pick','keys','module','action','Action','message','catch','ami\x20disconnected','command','then','content','voiceQueues','hasOwnProperty','name','strategy','loggedIn','sumDuration','talking','type','abandoned','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0xd64b,0xc1));var _0xbd64=function(_0x3b8774,_0x301a46){_0x3b8774=_0x3b8774-0x0;var _0x5bcfcc=_0xd64b[_0x3b8774];return _0x5bcfcc;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var jayson=require(_0xbd64('0x1'));var schema=require('validate');var moment=require(_0xbd64('0x2'));var config=require(_0xbd64('0x3'));var properties=require(_0xbd64('0x4'));var ami=require(_0xbd64('0x5'));exports[_0xbd64('0x6')]=function(_0x5458d8,_0x5446e4,_0x54f916){return new Promise(function(_0x51e87d,_0x58e9e7){var _0x32995f={'QueuePause':function(_0x3e700e){return new Promise(function(_0x38204e){var _0x3f1f17=util[_0xbd64('0x7')](_0xbd64('0x8'),'SIP',_0x3e700e['name']);if(_0x5458d8[_0xbd64('0x9')]&&_0x5458d8[_0xbd64('0x9')][_0x3f1f17]&&_0x5458d8[_0xbd64('0x9')][_0x3f1f17]['timer']){_0x5458d8[_0xbd64('0x9')][_0x3f1f17][_0xbd64('0xa')]();}if(_0x5458d8[_0xbd64('0xb')][_0x3f1f17]){_0x5458d8[_0xbd64('0xb')][_0x3f1f17]['updateStatusRealtime']({'statePause':_0x3e700e[_0xbd64('0xc')]?!![]:![]});}_0x38204e({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x136f60){var _0x2729d8=this;return new Promise(function(_0x3a941c,_0x2183e2){if(ami[_0xbd64('0xd')]()==![]){return _0x2183e2(_0x2729d8[_0xbd64('0xe')](0x1f4,[config[_0xbd64('0xf')]['ip'],config[_0xbd64('0xf')][_0xbd64('0x10')],'ami\x20disconnected'][_0xbd64('0x11')]('\x20')));}_0x136f60=_[_0xbd64('0x12')](_0x136f60,_[_0xbd64('0x13')](properties[_0xbd64('0x14')]));_0x136f60[_0xbd64('0x15')]='Reload';return ami[_0xbd64('0x16')](_0x136f60)['then'](function(_0xccb0d5){_0x3a941c({'code':0xc8,'message':_0xccb0d5[_0xbd64('0x17')]});})[_0xbd64('0x18')](function(_0x1d7a14){_0x2183e2(_0x2729d8[_0xbd64('0xe')](0x1f5,_0x1d7a14[_0xbd64('0x17')]));});});},'Command':function(_0xa5491d){var _0x32c4c7=this;return new Promise(function(_0x5d3b00,_0x305545){if(ami[_0xbd64('0xd')]()==![]){return _0x305545(_0x32c4c7['error'](0x1f4,[config['asterisk']['ip'],config[_0xbd64('0xf')][_0xbd64('0x10')],_0xbd64('0x19')][_0xbd64('0x11')]('\x20')));}_0xa5491d=_[_0xbd64('0x12')](_0xa5491d,_0xbd64('0x1a'));_0xa5491d['action']='Command';return ami[_0xbd64('0x16')](_0xa5491d)[_0xbd64('0x1b')](function(_0x12f67b){_0x5d3b00({'code':0xc8,'message':_0x12f67b[_0xbd64('0x1c')]});})['catch'](function(_0x51d118){_0x305545(_0x32c4c7[_0xbd64('0xe')](0x1f5,_0x51d118['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x46ab38){var _0x5b356b=[];for(var _0x33452d in _0x5458d8[_0xbd64('0x1d')]){if(_0x5458d8[_0xbd64('0x1d')][_0xbd64('0x1e')](_0x33452d)){var _0x5ae417=_0x5458d8[_0xbd64('0x1d')][_0x33452d];var _0x3bbfbe={'id':_0x5ae417['id'],'name':_0x5ae417[_0xbd64('0x1f')],'strategy':_0x5ae417[_0xbd64('0x20')],'answered':_0x5ae417['answered'],'available':_0x5ae417['available'],'loggedIn':_0x5ae417[_0xbd64('0x21')],'pTalking':_0x5ae417['pTalking'],'sumBillable':_0x5ae417['sumBillable'],'sumDuration':_0x5ae417[_0xbd64('0x22')],'sumHoldTime':_0x5ae417['sumHoldTime']||0x0,'talking':_0x5ae417[_0xbd64('0x23')],'total':_0x5ae417['total'],'type':_0x5ae417[_0xbd64('0x24')],'unmanaged':_0x5ae417['unmanaged'],'abandoned':_0x5ae417[_0xbd64('0x25')],'waiting':_0x5ae417[_0xbd64('0x26')],'loggedInDb':_0x5ae417[_0xbd64('0x27')]};if(_0x5ae417[_0xbd64('0x24')]===_0xbd64('0x28')){_0x3bbfbe[_0xbd64('0x29')]=_0x5ae417['dialActive'];_0x3bbfbe[_0xbd64('0x2a')]=_0x5ae417[_0xbd64('0x2a')];_0x3bbfbe[_0xbd64('0x2b')]=_0x5ae417[_0xbd64('0x2b')];_0x3bbfbe[_0xbd64('0x2c')]=_0x5ae417[_0xbd64('0x2c')];_0x3bbfbe['dialOriginateTimeout']=_0x5ae417['dialOriginateTimeout'];_0x3bbfbe[_0xbd64('0x2d')]=_0x5ae417['dialPrefix'];_0x3bbfbe[_0xbd64('0x2e')]=_0x5ae417[_0xbd64('0x2e')];_0x3bbfbe['outboundAnswerAgiCallsDay']=_0x5ae417['outboundAnswerAgiCallsDay'];_0x3bbfbe[_0xbd64('0x2f')]=_0x5ae417['outboundAnswerCallsDay'];_0x3bbfbe['outboundBlacklistCallsDay']=_0x5ae417[_0xbd64('0x30')];_0x3bbfbe[_0xbd64('0x31')]=_0x5ae417[_0xbd64('0x31')];_0x3bbfbe['outboundCongestionCallsDay']=_0x5ae417[_0xbd64('0x32')];_0x3bbfbe['outboundDropCallsDayACS']=_0x5ae417[_0xbd64('0x33')];_0x3bbfbe[_0xbd64('0x34')]=_0x5ae417[_0xbd64('0x34')];_0x3bbfbe[_0xbd64('0x35')]=_0x5ae417[_0xbd64('0x35')];_0x3bbfbe[_0xbd64('0x36')]=_0x5ae417['outboundNoAnswerCallsDay'];_0x3bbfbe['outboundNoSuchCallsDay']=_0x5ae417[_0xbd64('0x37')];_0x3bbfbe[_0xbd64('0x38')]=_0x5ae417[_0xbd64('0x38')];_0x3bbfbe[_0xbd64('0x39')]=_0x5ae417[_0xbd64('0x39')];_0x3bbfbe[_0xbd64('0x3a')]=_0x5ae417['outboundRejectCallsDay'];_0x3bbfbe['outboundUnknownCallsDay']=_0x5ae417[_0xbd64('0x3b')];_0x3bbfbe[_0xbd64('0x3c')]=_0x5ae417[_0xbd64('0x3c')];_0x3bbfbe['predictiveIntervalAvgHoldtime']=_0x5ae417['predictiveIntervalAvgHoldtime'];_0x3bbfbe[_0xbd64('0x3d')]=_0x5ae417['predictiveIntervalAvgTalktime'];_0x3bbfbe[_0xbd64('0x3e')]=_0x5ae417['predictiveIntervalDroppedCallsCallersExit'];_0x3bbfbe[_0xbd64('0x3f')]=_0x5ae417[_0xbd64('0x3f')];_0x3bbfbe['predictiveIntervalErlangCalls']=_0x5ae417[_0xbd64('0x40')];_0x3bbfbe['predictiveIntervalErlangCallsDroppedCalls']=_0x5ae417['predictiveIntervalErlangCallsDroppedCalls'];_0x3bbfbe[_0xbd64('0x41')]=_0x5ae417[_0xbd64('0x41')];_0x3bbfbe[_0xbd64('0x42')]=_0x5ae417['predictiveIntervalMultiplicativeFactor'];_0x3bbfbe['predictiveIntervalPauses']=_0x5ae417['predictiveIntervalPauses'];_0x3bbfbe[_0xbd64('0x43')]=_0x5ae417[_0xbd64('0x43')];_0x3bbfbe['predictiveIntervalTotalCalls']=_0x5ae417[_0xbd64('0x44')];_0x3bbfbe[_0xbd64('0x17')]=_0x5ae417[_0xbd64('0x17')];_0x3bbfbe[_0xbd64('0x45')]=_0x5ae417['originated'];_0x3bbfbe['erlangCalls']=_0x5ae417[_0xbd64('0x46')];_0x3bbfbe['erlangCallToSecond']=_0x5ae417['erlangCallToSecond'];_0x3bbfbe[_0xbd64('0x47')]=_0x5ae417[_0xbd64('0x47')];_0x3bbfbe[_0xbd64('0x48')]=_0x5ae417[_0xbd64('0x48')];_0x3bbfbe[_0xbd64('0x49')]=_0x5ae417[_0xbd64('0x49')];_0x3bbfbe[_0xbd64('0x4a')]=_0x5ae417[_0xbd64('0x4a')];}if(_0x5ae417['Trunk']){_0x3bbfbe[_0xbd64('0x4b')]={'id':_0x5ae417[_0xbd64('0x4b')]['id'],'name':_0x5ae417['Trunk'][_0xbd64('0x1f')],'active':_0x5ae417[_0xbd64('0x4b')][_0xbd64('0x4c')],'callerid':_0x5ae417[_0xbd64('0x4b')][_0xbd64('0x4d')]};}if(_0x5ae417[_0xbd64('0x4e')]){_0x3bbfbe[_0xbd64('0x4e')]={'id':_0x5ae417['Interval']['id'],'name':_0x5ae417[_0xbd64('0x4e')]['name']};}_0x5b356b[_0xbd64('0x4f')](_0x3bbfbe);}}_0x46ab38({'count':_0x5b356b['length'],'rows':_0x5b356b});});},'UpdateVoiceQueue':function(_0x468e0b){return new Promise(function(_0xe6f9f8,_0xbc2ae0){var _0x583860=_[_0xbd64('0x50')](_0x5458d8['voiceQueues'],{'id':parseInt(_0x468e0b['id'])});var _0x526705=_['omit'](_0x468e0b,['id']);if(_0x583860){for(var _0x3304b7 in _0x526705){if(typeof _0x526705[_0x3304b7]!==_0xbd64('0x51')&&typeof _0x583860[_0x3304b7]!==_0xbd64('0x51')){_0x583860[_0x3304b7]=_0x526705[_0x3304b7];}}_0xe6f9f8(_0x583860);}else{_0xbc2ae0();}});},'VoiceChannels':function(){return new Promise(function(_0x46c1d0){var _0x168409=_[_0xbd64('0x52')](_0x5458d8[_0xbd64('0x53')]);_0x46c1d0({'count':_0x168409['length'],'rows':_0x168409});});},'VoiceChannelMixMonitor':function(_0x59ac2d){var _0x184d30=this;return new Promise(function(_0x379491,_0x4e5efe){if(ami[_0xbd64('0xd')]()==![]){return _0x4e5efe(_0x184d30[_0xbd64('0xe')](0x1f4,[config[_0xbd64('0xf')]['ip'],config[_0xbd64('0xf')][_0xbd64('0x10')],'ami\x20disconnected'][_0xbd64('0x11')]('\x20')));}var _0x1a9ec8=schema(properties[_0xbd64('0x54')])[_0xbd64('0x55')](_0x59ac2d);if(_0x1a9ec8['length']>0x0){return _0x4e5efe(_0x184d30['error'](0x1f4,_[_0xbd64('0x56')](_0x1a9ec8,_0xbd64('0x17'))[_0xbd64('0x11')](',\x20')));}var _0x4700a7=_[_0xbd64('0x50')](_0x5458d8[_0xbd64('0x53')],{'uniqueid':_0x59ac2d[_0xbd64('0x57')]});if(_0x4700a7&&_0x4700a7[_0xbd64('0x58')]){var _0x460158=util[_0xbd64('0x7')](_0xbd64('0x59'),_0x59ac2d[_0xbd64('0x5a')]||_0x59ac2d[_0xbd64('0x57')],_0x59ac2d[_0xbd64('0x7')]||_0xbd64('0x5b'));return ami['Action']({'action':_0xbd64('0x5c'),'channel':_0x4700a7['channel'],'file':_0x460158,'options':'ai(mixmonitorid)'})['then'](function(_0x4aa662){var _0xced0ca=_[_0xbd64('0x50')](_0x4700a7['monitors'],{'filename':_0xbd64('0x5d')+_0x460158[_0xbd64('0x5e')]()});if(_[_0xbd64('0x5f')](_0xced0ca)){_0x4700a7['monitors'][_0xbd64('0x4f')]({'filename':_0xbd64('0x5d')+_0x460158[_0xbd64('0x5e')](),'createdAt':moment()[_0xbd64('0x7')](_0xbd64('0x60')),'mixmonitorid':_0x4aa662[_0xbd64('0x61')],'status':'rec'});}else{_0xced0ca['mixmonitorid']=_0x4aa662['mixmonitorid'];_0xced0ca[_0xbd64('0x62')]=_0xbd64('0x63');}_0x379491({'code':0xc8,'message':[_0x59ac2d[_0xbd64('0x57')],_0xbd64('0x64'),_0x4aa662['mixmonitorid']][_0xbd64('0x11')]('\x20'),'mixmonitorid':_0x4aa662[_0xbd64('0x61')]});})[_0xbd64('0x18')](function(_0x298349){_0x4e5efe(_0x184d30[_0xbd64('0xe')](0x1f5,[_0x59ac2d[_0xbd64('0x57')],_0x298349['message'][_0xbd64('0x5e')]()][_0xbd64('0x11')]('\x20')));});}else{return _0x4e5efe(_0x184d30[_0xbd64('0xe')](0x1f5,_0xbd64('0x65')));}});},'VoiceChannelStopMixMonitor':function(_0x465661){var _0x41fa48=this;return new Promise(function(_0xeab5c7,_0x3e0f82){if(ami[_0xbd64('0xd')]()==![]){return _0x3e0f82(_0x41fa48[_0xbd64('0xe')](0x1f4,[config[_0xbd64('0xf')]['ip'],config[_0xbd64('0xf')]['username'],'ami\x20disconnected'][_0xbd64('0x11')]('\x20')));}var _0x2bcf68=schema(properties['voicechannel'])['validate'](_0x465661);if(_0x2bcf68[_0xbd64('0x66')]>0x0){return _0x3e0f82(_0x41fa48[_0xbd64('0xe')](0x1f4,_['map'](_0x2bcf68,_0xbd64('0x17'))[_0xbd64('0x11')](',\x20')));}var _0x45573c=_[_0xbd64('0x50')](_0x5458d8[_0xbd64('0x53')],{'uniqueid':_0x465661[_0xbd64('0x57')]});if(_0x45573c){return Promise[_0xbd64('0x67')]()[_0xbd64('0x1b')](function(){if(_0x45573c[_0xbd64('0x58')]){return ami['Action']({'action':_0xbd64('0x68'),'channel':_0x45573c[_0xbd64('0x58')],'mixmonitorid':_0x465661[_0xbd64('0x61')]})['catch'](function(){});}})[_0xbd64('0x1b')](function(){if(_0x45573c[_0xbd64('0x69')]){return ami['Action']({'action':_0xbd64('0x68'),'channel':_0x45573c[_0xbd64('0x69')],'mixmonitorid':_0x465661[_0xbd64('0x61')]})[_0xbd64('0x18')](function(){});}})[_0xbd64('0x1b')](function(){var _0x1594e9=_['find'](_0x45573c[_0xbd64('0x6a')],{'mixmonitorid':_0x465661[_0xbd64('0x61')]});if(_0x1594e9){_0x1594e9[_0xbd64('0x62')]=_0xbd64('0x6b');}})['then'](function(){var _0xff862e=util[_0xbd64('0x7')]('%s.%s',_0x465661[_0xbd64('0x5a')]||_0x465661['uniqueid'],_0x465661[_0xbd64('0x7')]||_0xbd64('0x5b'));var _0x1c10df=_[_0xbd64('0x50')](_0x45573c['monitors'],{'filename':_0xbd64('0x5d')+_0xff862e[_0xbd64('0x5e')]()});if(_0x1c10df){_0x1c10df[_0xbd64('0x62')]=_0xbd64('0x6b');}})[_0xbd64('0x1b')](function(){_0xeab5c7({'code':0xc8,'message':[_0x465661[_0xbd64('0x57')],'StopMixMonitor\x20Success']['join']('\x20')});})['catch'](function(_0x36f3a8){_0x3e0f82(_0x41fa48[_0xbd64('0xe')](0x1f5,[_0x465661[_0xbd64('0x57')],_0x36f3a8[_0xbd64('0x17')][_0xbd64('0x5e')]()][_0xbd64('0x11')]('\x20')));});}else{return _0x3e0f82(_0x41fa48['error'](0x1f5,_0xbd64('0x65')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x4fc39){var _0x305ffc=_[_0xbd64('0x52')](_0x5458d8[_0xbd64('0x6c')]);_0x4fc39({'count':_0x305ffc[_0xbd64('0x66')],'rows':_0x305ffc});});},'VoiceQueuesChannel':function(_0x2f3516){var _0x3d7e47=this;return new Promise(function(_0x301f42,_0x18e724){var _0x32e611=schema(properties[_0xbd64('0x6d')])['validate'](_0x2f3516);if(_0x32e611['length']>0x0){return _0x18e724(_0x3d7e47[_0xbd64('0xe')](0x1f4,_[_0xbd64('0x56')](_0x32e611,_0xbd64('0x17'))['join'](',\x20')));}var _0x9b99b3=_['find'](_0x5458d8[_0xbd64('0x6c')],{'uniqueid':_0x2f3516[_0xbd64('0x57')]});if(_0x9b99b3){_0x301f42(_0x9b99b3);}else{return _0x18e724(_0x3d7e47[_0xbd64('0xe')](0x1f5,_0xbd64('0x65')));}});},'VoiceQueuesChannelHangup':function(_0x51c2d7){var _0x1f104b=this;return new Promise(function(_0x5714a6,_0x14f79e){if(ami[_0xbd64('0xd')]()==![]){return _0x14f79e(_0x1f104b[_0xbd64('0xe')](0x1f4,[config[_0xbd64('0xf')]['ip'],config[_0xbd64('0xf')]['username'],_0xbd64('0x19')][_0xbd64('0x11')]('\x20')));}var _0x4d100e=schema(properties[_0xbd64('0x6e')])[_0xbd64('0x55')](_0x51c2d7);if(_0x4d100e[_0xbd64('0x66')]>0x0){return _0x14f79e(_0x1f104b[_0xbd64('0xe')](0x1f4,_['map'](_0x4d100e,_0xbd64('0x17'))['join'](',\x20')));}var _0x437539=_[_0xbd64('0x50')](_0x5458d8[_0xbd64('0x6c')],{'uniqueid':_0x51c2d7['uniqueid']});if(_0x437539&&_0x437539['channel']){return ami['Action']({'action':'Hangup','channel':_0x437539[_0xbd64('0x58')]})[_0xbd64('0x1b')](function(_0xdcab62){_0x5714a6({'code':0xc8,'message':[_0x51c2d7[_0xbd64('0x57')],_0xdcab62[_0xbd64('0x17')]['toLowerCase']()][_0xbd64('0x11')]('\x20')});})[_0xbd64('0x18')](function(_0xac13e6){_0x14f79e(_0x1f104b[_0xbd64('0xe')](0x1f5,[_0x51c2d7[_0xbd64('0x57')],_0xac13e6['message'][_0xbd64('0x5e')]()][_0xbd64('0x11')]('\x20')));});}else{return _0x14f79e(_0x1f104b[_0xbd64('0xe')](0x1f5,_0xbd64('0x65')));}});},'VoiceQueuesChannelRedirect':function(_0x5875da){var _0x58957a=this;return new Promise(function(_0x73971b,_0xc2f92b){if(ami[_0xbd64('0xd')]()==![]){return _0xc2f92b(_0x58957a[_0xbd64('0xe')](0x1f4,[config[_0xbd64('0xf')]['ip'],config[_0xbd64('0xf')][_0xbd64('0x10')],_0xbd64('0x19')]['join']('\x20')));}var _0x34bdad=schema(properties['voicequeuechannelredirect'])[_0xbd64('0x55')](_0x5875da);if(_0x34bdad[_0xbd64('0x66')]>0x0){return _0xc2f92b(_0x58957a[_0xbd64('0xe')](0x1f4,_['map'](_0x34bdad,_0xbd64('0x17'))['join'](',\x20')));}var _0x5c3efa=_[_0xbd64('0x50')](_0x5458d8[_0xbd64('0x6c')],{'uniqueid':_0x5875da[_0xbd64('0x57')]});if(_0x5c3efa&&_0x5c3efa['channel']){return ami[_0xbd64('0x16')]({'action':_0xbd64('0x6f'),'channel':_0x5c3efa[_0xbd64('0x58')],'exten':_0x5875da[_0xbd64('0x70')],'context':_0x5875da['context']||_0x5c3efa[_0xbd64('0x71')],'priority':0x1})[_0xbd64('0x1b')](function(_0x355b87){_0x73971b({'code':0xc8,'message':[_0x5875da[_0xbd64('0x57')],_0x355b87[_0xbd64('0x17')][_0xbd64('0x5e')]()][_0xbd64('0x11')]('\x20')});})[_0xbd64('0x18')](function(_0x8a6280){_0xc2f92b(_0x58957a[_0xbd64('0xe')](0x1f5,[_0x5875da[_0xbd64('0x57')],_0x8a6280[_0xbd64('0x17')][_0xbd64('0x5e')]()][_0xbd64('0x11')]('\x20')));});}else{return _0xc2f92b(_0x58957a['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x11f9b2){return new Promise(function(_0x322093){var _0x155b41=_['values'](_0x5458d8[_0xbd64('0xb')]);if(_0x11f9b2&&_0x11f9b2['id']){var _0x581b9c=_[_0xbd64('0x50')](_0x155b41,function(_0x99ee7f){return _0x99ee7f['id']===_0x11f9b2['id'];});_0x322093(_0x581b9c);}else{_0x322093({'count':_0x155b41[_0xbd64('0x66')],'rows':_0x155b41});}});},'Telephones':function(){return new Promise(function(_0x1a1ac2){var _0x562932=_[_0xbd64('0x52')](_0x5458d8[_0xbd64('0x72')]);_0x1a1ac2({'count':_0x562932['length'],'rows':_0x562932});});},'Trunks':function(){return new Promise(function(_0x283704){var _0x58284d=_[_0xbd64('0x52')](_0x5458d8[_0xbd64('0x73')]);_0x283704({'count':_0x58284d[_0xbd64('0x66')],'rows':_0x58284d});});},'OutboundChannels':function(){return new Promise(function(_0x25b2b8){var _0x30b3a1=_[_0xbd64('0x52')](_0x5458d8['outboundChannels']);_0x25b2b8({'count':_0x30b3a1[_0xbd64('0x66')],'rows':_0x30b3a1});});},'Outbound':function(){return new Promise(function(_0x588452){_0x588452(_0x5458d8[_0xbd64('0x28')]);});},'Campaigns':function(){return new Promise(function(_0x1fa7ad){var _0x4df56f=_[_0xbd64('0x52')](_0x5458d8['campaigns']);_0x1fa7ad({'count':_0x4df56f[_0xbd64('0x66')],'rows':_0x4df56f});});},'VoiceQueuesPreview':function(_0x2ac722){var _0x3ba513=this;return new Promise(function(_0x4bf21a,_0x219f6a){_0x5446e4[_0xbd64('0x74')](_0x2ac722['id'])[_0xbd64('0x1b')](function(_0x221f2e){_0x4bf21a({'code':0xc8,'message':_0x221f2e[_0xbd64('0x17')]});})['catch'](function(_0x58efa2){_0x219f6a(_0x3ba513[_0xbd64('0xe')](0x1f4,_0x58efa2[_0xbd64('0x17')]));});});},'EventManager':function(_0xeb9c51){var _0x1f1170=this;return new Promise(function(_0x29d9f4,_0x25d96b){if(!_0xeb9c51[_0xbd64('0x75')]){return _0x25d96b(_0x1f1170[_0xbd64('0xe')](0x1f4,_0xbd64('0x76')));}ami[_0xbd64('0x77')](_0xbd64('0x78')+_0xeb9c51[_0xbd64('0x75')],_0xeb9c51[_0xbd64('0x17')]);_0x29d9f4({'code':0xc8,'message':_0xeb9c51});});},'FaxAccounts':function(){return new Promise(function(_0x4b1c1a){var _0x3220d9=_[_0xbd64('0x52')](_0x5458d8['faxAccounts']);_0x4b1c1a({'count':_0x3220d9[_0xbd64('0x66')],'rows':_0x3220d9});});},'SendFax':function(_0x1dcc5f){var _0x2e4f78=this;return new Promise(function(_0x3e837d,_0x4e948c){_0x54f916['send'](_0x1dcc5f)[_0xbd64('0x1b')](function(_0x923e5a){_0x3e837d({'code':0xc8,'message':_0x923e5a[_0xbd64('0x17')]});})[_0xbd64('0x18')](function(_0x46a391){_0x4e948c(_0x2e4f78[_0xbd64('0xe')](0x1f4,_0x46a391[_0xbd64('0x17')]));});});},'CheckAfterSend':function(_0x1150df){var _0x1cb98a=this;return new Promise(function(_0x4781d8,_0x1c5e0a){_0x54f916[_0xbd64('0x79')](_0x1150df)['then'](function(_0x314365){_0x4781d8({'code':0xc8,'message':_0x314365[_0xbd64('0x17')]});})[_0xbd64('0x18')](function(_0x48d55a){_0x1c5e0a(_0x1cb98a['error'](0x1f4,_0x48d55a[_0xbd64('0x17')]));});});}};var _0x2dbbd4=jayson['server'](_0x32995f)[_0xbd64('0x7a')]();_0x2dbbd4['on'](_0xbd64('0xe'),function(_0x1d5aac){return _0x58e9e7(_0x1d5aac);});_0x2dbbd4[_0xbd64('0x6')](0x232a,_0xbd64('0x7b'),function(){console[_0xbd64('0x7c')](_0xbd64('0x7d'),0x232a);return _0x51e87d(_0xbd64('0x7e')+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 287cb75..f57e069 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 _0x4153=['scheduledAt','updatedAt','union','resolve','then','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','createdAt'];(function(_0x5d0cc4,_0xcd0a56){var _0x1f5007=function(_0x7340d6){while(--_0x7340d6){_0x5d0cc4['push'](_0x5d0cc4['shift']());}};_0x1f5007(++_0xcd0a56);}(_0x4153,0x8a));var _0x3415=function(_0x154de5,_0x382afa){_0x154de5=_0x154de5-0x0;var _0x189850=_0x4153[_0x154de5];return _0x189850;};'use strict';var _=require(_0x3415('0x0'));var BPromise=require(_0x3415('0x1'));var Redis=require(_0x3415('0x2'));var util=require(_0x3415('0x3'));var config=require(_0x3415('0x4'));var logger=require(_0x3415('0x5'))(_0x3415('0x6'));var cmContactRpc=require(_0x3415('0x7'));config[_0x3415('0x8')]=_[_0x3415('0x9')](config[_0x3415('0x8')],{'host':_0x3415('0xa'),'port':0x18eb});var io=require(_0x3415('0xb'))(new Redis(config[_0x3415('0x8')]));function emit(_0x25b4c0,_0x5bd446,_0x3875c4,_0x35339c,_0x3cadac){logger[_0x3415('0xc')](_0x3415('0xd'),_0x25b4c0,_0x5bd446['id'],_0x3875c4,_0x35339c,JSON[_0x3415('0xe')](_0x3cadac));io['to'](_0x3875c4)[_0x3415('0xf')](_0x35339c,_0x3cadac);}exports[_0x3415('0x10')]=function(_0x1ea535,_0x39fd69,_0x56737c,_0xe8de40){var _0x3a404a,_0xb3f794;var _0x4a9264={};var _0x13a64d;var _0x312795=Number(_0x56737c[_0x3415('0x11')]);var _0x474ba4=_0x56737c[_0x3415('0x12')]?Boolean(Number(_0x56737c[_0x3415('0x12')])):![];var _0x510474;var _0x149ce0=![];if(!_[_0x3415('0x13')](_0x56737c[_0x3415('0x14')])){if(_0x56737c['data5']=='1')_0x149ce0=!![];}if(!_0x149ce0){if(_0xe8de40[_0x3415('0x15')]){_0x4a9264['id']=_0xe8de40[_0x3415('0x15')];}}if(!_0x4a9264['id']){_0x4a9264[_0x3415('0x16')]=_0x312795;_0x510474=_0x56737c[_0x3415('0x17')]&&_0x56737c[_0x3415('0x17')]!=='0'?_0x56737c[_0x3415('0x17')][_0x3415('0x18')](','):[_0x3415('0x19')];_0x4a9264[_0x3415('0x1a')]=_[_0x3415('0x1b')](_0x510474,function(_0x391dfd){var _0x467916={};_0x467916[_0x391dfd]=_0xe8de40[_0x3415('0x1c')]?_0xe8de40[_0x3415('0x1d')]:_0xe8de40[_0x3415('0x1e')];return _0x467916;});_0x13a64d=_0xe8de40[_0x3415('0x1c')]?_0xe8de40[_0x3415('0x1d')]:_0xe8de40['calleridnum'];}var _0x1bcb70=['id',_0x3415('0x1f'),_0x3415('0x20'),'phone',_0x3415('0x21'),_0x3415('0x22'),_0x3415('0x16'),_0x3415('0x23'),_0x3415('0x24'),_0x3415('0x25')];var _0x3bd5ed=_[_0x3415('0x26')](_0x1bcb70,_0x510474);BPromise[_0x3415('0x27')]()[_0x3415('0x28')](cmContactRpc['getContacts']({'attributes':_0x3bd5ed,'where':_0x4a9264,'phone':_0x13a64d}))[_0x3415('0x28')](function(_0x286ab4){_0xb3f794=_0x286ab4;if(!_['isEmpty'](_0xb3f794)){if(_0xb3f794[_0x3415('0x29')]===0x1){_0x3a404a=_0xb3f794[0x0];logger['info'](_0x3415('0x2a'),_0xe8de40[_0x3415('0x2b')],_0x39fd69['id'],_0x3a404a['id']);}else{logger[_0x3415('0xc')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0xe8de40[_0x3415('0x2b')],_0x39fd69['id'],_[_0x3415('0x1b')](_0xb3f794,'id')[_0x3415('0x2c')](','));}return;}else{logger[_0x3415('0xc')](_0x3415('0x2d'),_0xe8de40[_0x3415('0x2b')],_0x39fd69['id']);var _0xbf6edd={'ListId':_0x312795};var _0x419fb2=_0x56737c['data4']&&_0x56737c[_0x3415('0x2e')]!=='0'?_0x56737c[_0x3415('0x2e')]:_0x3415('0x19');if(_0x474ba4){logger[_0x3415('0xc')](_0x3415('0x2f'),_0xe8de40[_0x3415('0x2b')],_0x39fd69['id']);_0xbf6edd[_0x419fb2]=_[_0x3415('0x13')](_0xe8de40[_0x3415('0x1c')])?_0xe8de40['calleridnum']:_0xe8de40[_0x3415('0x1d')];if(_[_0x3415('0x13')](_0xe8de40['routeId'])){_0xbf6edd[_0x3415('0x1f')]=_0xe8de40[_0x3415('0x30')]&&_0xe8de40[_0x3415('0x30')]!==_0x3415('0x31')?_0xe8de40['calleridname']:_0x3415('0x32');}else{_0xbf6edd['firstName']=_0xe8de40[_0x3415('0x33')]&&_0xe8de40[_0x3415('0x33')]!==''?_0xe8de40['destcalleridname']:_0x3415('0x32');}return BPromise[_0x3415('0x27')]()[_0x3415('0x28')](cmContactRpc[_0x3415('0x34')](_0xbf6edd))['then'](function(_0x504373){_0x3a404a=_0x504373;_0xb3f794['push'](_0x504373);if(_0x3a404a){logger[_0x3415('0xc')]('[CM][%s][%s]\x20Contact\x20created:%s',_0xe8de40[_0x3415('0x2b')],_0x39fd69['id'],_0x3a404a['id']);}return;});}else{logger['info'](_0x3415('0x35'),_0xe8de40[_0x3415('0x2b')],_0x39fd69['id']);_0xbf6edd[_0x419fb2]=_['isNil'](_0xe8de40[_0x3415('0x1c')])?_0xe8de40[_0x3415('0x1e')]:_0xe8de40[_0x3415('0x1d')];if(_['isNil'](_0xe8de40[_0x3415('0x1c')])){_0xbf6edd[_0x3415('0x1f')]=_0xe8de40[_0x3415('0x30')]&&_0xe8de40['calleridname']!==_0x3415('0x31')?_0xe8de40[_0x3415('0x30')]:_0x3415('0x32');}else{_0xbf6edd[_0x3415('0x1f')]=_0xe8de40['destcalleridname']&&_0xe8de40[_0x3415('0x33')]!==_0x3415('0x31')?_0xe8de40['destcalleridname']:_0x3415('0x32');}_0x3a404a=_0xbf6edd;_0xb3f794['push'](_0xbf6edd);return;}}})['then'](function(){if(_0x1ea535){emit(_0xe8de40[_0x3415('0x2b')],_0x39fd69,util[_0x3415('0x36')](_0x3415('0x37'),_0x1ea535[_0x3415('0x38')]),util['format'](_0x3415('0x39'),_0x56737c['action']['toLowerCase']()),{'evt':_['merge'](_0xe8de40,{'autoCreate':_0x474ba4}),'contact':_0x3a404a===undefined?{}:_0x3a404a,'contacts':_0xb3f794[_0x3415('0x29')]===0x0?undefined:_0xb3f794});}});}; \ No newline at end of file +var _0x4147=['ListId','data3','split','phone','$or','routeId','destcalleridnum','calleridnum','firstName','fax','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','user:%s','name','format','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util','../../../../config/logger','../../rpc/cmContact','defaults','redis','socket.io-emitter','info','[CM][%s][%s]','stringify','data1','data2','isNil','data5','xmd-contactid'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4147,0x1a7));var _0x7414=function(_0x226a12,_0x1e974f){_0x226a12=_0x226a12-0x0;var _0x384a45=_0x4147[_0x226a12];return _0x384a45;};'use strict';var _=require(_0x7414('0x0'));var BPromise=require(_0x7414('0x1'));var Redis=require(_0x7414('0x2'));var util=require(_0x7414('0x3'));var config=require('../../../../config/environment');var logger=require(_0x7414('0x4'))('trigger');var cmContactRpc=require(_0x7414('0x5'));config['redis']=_[_0x7414('0x6')](config[_0x7414('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x7414('0x8'))(new Redis(config[_0x7414('0x7')]));function emit(_0x4a76ab,_0x2131f8,_0x3314b6,_0x3a3a23,_0x40bea1){logger[_0x7414('0x9')](_0x7414('0xa'),_0x4a76ab,_0x2131f8['id'],_0x3314b6,_0x3a3a23,JSON[_0x7414('0xb')](_0x40bea1));io['to'](_0x3314b6)['emit'](_0x3a3a23,_0x40bea1);}exports['exec']=function(_0x327540,_0x3fbcd0,_0x4f9582,_0x467f1e){var _0x59e72d,_0x46f80e;var _0x381f96={};var _0x71e8dc;var _0x5f0fb0=Number(_0x4f9582[_0x7414('0xc')]);var _0x43a4a0=_0x4f9582[_0x7414('0xd')]?Boolean(Number(_0x4f9582[_0x7414('0xd')])):![];var _0x72a2d6;var _0x2271c4=![];if(!_[_0x7414('0xe')](_0x4f9582[_0x7414('0xf')])){if(_0x4f9582['data5']=='1')_0x2271c4=!![];}if(!_0x2271c4){if(_0x467f1e[_0x7414('0x10')]){_0x381f96['id']=_0x467f1e[_0x7414('0x10')];}}if(!_0x381f96['id']){_0x381f96[_0x7414('0x11')]=_0x5f0fb0;_0x72a2d6=_0x4f9582[_0x7414('0x12')]&&_0x4f9582[_0x7414('0x12')]!=='0'?_0x4f9582[_0x7414('0x12')][_0x7414('0x13')](','):[_0x7414('0x14')];_0x381f96[_0x7414('0x15')]=_['map'](_0x72a2d6,function(_0x34d66f){var _0x184b26={};_0x184b26[_0x34d66f]=_0x467f1e[_0x7414('0x16')]?_0x467f1e[_0x7414('0x17')]:_0x467f1e[_0x7414('0x18')];return _0x184b26;});_0x71e8dc=_0x467f1e[_0x7414('0x16')]?_0x467f1e['destcalleridnum']:_0x467f1e[_0x7414('0x18')];}var _0x2fc0bc=['id',_0x7414('0x19'),'lastName',_0x7414('0x14'),'mobile',_0x7414('0x1a'),_0x7414('0x11'),'createdAt',_0x7414('0x1b'),_0x7414('0x1c')];var _0x4d5464=_[_0x7414('0x1d')](_0x2fc0bc,_0x72a2d6);BPromise['resolve']()[_0x7414('0x1e')](cmContactRpc[_0x7414('0x1f')]({'attributes':_0x4d5464,'where':_0x381f96,'phone':_0x71e8dc}))[_0x7414('0x1e')](function(_0x117524){_0x46f80e=_0x117524;if(!_[_0x7414('0x20')](_0x46f80e)){if(_0x46f80e[_0x7414('0x21')]===0x1){_0x59e72d=_0x46f80e[0x0];logger[_0x7414('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x467f1e[_0x7414('0x22')],_0x3fbcd0['id'],_0x59e72d['id']);}else{logger[_0x7414('0x9')](_0x7414('0x23'),_0x467f1e[_0x7414('0x22')],_0x3fbcd0['id'],_[_0x7414('0x24')](_0x46f80e,'id')[_0x7414('0x25')](','));}return;}else{logger[_0x7414('0x9')](_0x7414('0x26'),_0x467f1e[_0x7414('0x22')],_0x3fbcd0['id']);var _0x1185a3={'ListId':_0x5f0fb0};var _0x3e6581=_0x4f9582['data4']&&_0x4f9582[_0x7414('0x27')]!=='0'?_0x4f9582['data4']:_0x7414('0x14');if(_0x43a4a0){logger[_0x7414('0x9')](_0x7414('0x28'),_0x467f1e[_0x7414('0x22')],_0x3fbcd0['id']);_0x1185a3[_0x3e6581]=_['isNil'](_0x467f1e[_0x7414('0x16')])?_0x467f1e['calleridnum']:_0x467f1e[_0x7414('0x17')];if(_[_0x7414('0xe')](_0x467f1e[_0x7414('0x16')])){_0x1185a3[_0x7414('0x19')]=_0x467f1e[_0x7414('0x29')]&&_0x467f1e['calleridname']!==_0x7414('0x2a')?_0x467f1e[_0x7414('0x29')]:_0x7414('0x2b');}else{_0x1185a3[_0x7414('0x19')]=_0x467f1e[_0x7414('0x2c')]&&_0x467f1e['destcalleridname']!==_0x7414('0x2a')?_0x467f1e['destcalleridname']:_0x7414('0x2b');}return BPromise[_0x7414('0x2d')]()[_0x7414('0x1e')](cmContactRpc[_0x7414('0x2e')](_0x1185a3))[_0x7414('0x1e')](function(_0x2a6fdc){_0x59e72d=_0x2a6fdc;_0x46f80e[_0x7414('0x2f')](_0x2a6fdc);if(_0x59e72d){logger[_0x7414('0x9')](_0x7414('0x30'),_0x467f1e['uniqueid'],_0x3fbcd0['id'],_0x59e72d['id']);}return;});}else{logger[_0x7414('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x467f1e[_0x7414('0x22')],_0x3fbcd0['id']);_0x1185a3[_0x3e6581]=_['isNil'](_0x467f1e[_0x7414('0x16')])?_0x467f1e['calleridnum']:_0x467f1e[_0x7414('0x17')];if(_[_0x7414('0xe')](_0x467f1e[_0x7414('0x16')])){_0x1185a3[_0x7414('0x19')]=_0x467f1e[_0x7414('0x29')]&&_0x467f1e['calleridname']!==_0x7414('0x2a')?_0x467f1e[_0x7414('0x29')]:_0x7414('0x2b');}else{_0x1185a3['firstName']=_0x467f1e[_0x7414('0x2c')]&&_0x467f1e[_0x7414('0x2c')]!==_0x7414('0x2a')?_0x467f1e['destcalleridname']:_0x7414('0x2b');}_0x59e72d=_0x1185a3;_0x46f80e[_0x7414('0x2f')](_0x1185a3);return;}}})[_0x7414('0x1e')](function(){if(_0x327540){emit(_0x467f1e[_0x7414('0x22')],_0x3fbcd0,util['format'](_0x7414('0x31'),_0x327540[_0x7414('0x32')]),util[_0x7414('0x33')](_0x7414('0x34'),_0x4f9582[_0x7414('0x35')][_0x7414('0x36')]()),{'evt':_['merge'](_0x467f1e,{'autoCreate':_0x43a4a0}),'contact':_0x59e72d===undefined?{}:_0x59e72d,'contacts':_0x46f80e[_0x7414('0x21')]===0x0?undefined:_0x46f80e});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e9e1886..6b133b2 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 _0x6d5c=['null','substatus','created','equals','exports','util','lodash','url','mustache','./urlforward','./integration','./script','../../../config/environment','../../../config/logger','trigger','redis','defaults','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','custom:agentringnoanswer','bind','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:amd','custom:queuecallerabandon','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','stringify','clone','motionChannel','undefined','interface','checkTriggers','hasOwnProperty','checkTrigger','Actions','action','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','data3','isNil','location','windowWidth','data5','windowHeight','600','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','contactmanager','exec','queue','routeId','urlforward','buildUri','query','search','replace','channel','length','every','AllConditions','checkConditions','some','AnyConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus'];(function(_0x4997aa,_0x4a2386){var _0x1f2ff3=function(_0x28559e){while(--_0x28559e){_0x4997aa['push'](_0x4997aa['shift']());}};_0x1f2ff3(++_0x4a2386);}(_0x6d5c,0x179));var _0xc6d5=function(_0x34d2a9,_0xab8e7a){_0x34d2a9=_0x34d2a9-0x0;var _0x4af8bc=_0x6d5c[_0x34d2a9];return _0x4af8bc;};'use strict';var util=require(_0xc6d5('0x0'));var _=require(_0xc6d5('0x1'));var url=require(_0xc6d5('0x2'));var Mustache=require(_0xc6d5('0x3'));var Redis=require('ioredis');var urlforward=require(_0xc6d5('0x4'));var integration=require(_0xc6d5('0x5'));var cmContact=require('./cmContact');var script=require(_0xc6d5('0x6'));var config=require(_0xc6d5('0x7'));var logger=require(_0xc6d5('0x8'))(_0xc6d5('0x9'));var ami=require('../ami');config[_0xc6d5('0xa')]=_[_0xc6d5('0xb')](config[_0xc6d5('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc6d5('0xa')]));var operators={'equals':function(_0xe695de,_0x432e0e){return _0xe695de==_0x432e0e;},'not_equals':function(_0x2b27fa,_0x3f85b2){return _0x2b27fa!=_0x3f85b2;}};var barAndWebActions=[_0xc6d5('0xc'),_0xc6d5('0x2'),_0xc6d5('0xd')];function Trigger(_0x49a981){this[_0xc6d5('0xe')]=_0x49a981[_0xc6d5('0xe')];this['agents']=_0x49a981[_0xc6d5('0xf')];this[_0xc6d5('0x10')]=_0x49a981['voiceQueues'];this[_0xc6d5('0x11')]=_0x49a981[_0xc6d5('0x11')];this[_0xc6d5('0x12')]=_0x49a981[_0xc6d5('0x12')];this[_0xc6d5('0x13')]=_0x49a981['zendeskAccounts'];this[_0xc6d5('0x14')]=_0x49a981[_0xc6d5('0x14')];this[_0xc6d5('0x15')]=_0x49a981[_0xc6d5('0x15')];this[_0xc6d5('0x16')]=_0x49a981[_0xc6d5('0x16')];this[_0xc6d5('0x17')]=_0x49a981[_0xc6d5('0x17')];this[_0xc6d5('0x18')]=_0x49a981[_0xc6d5('0x18')];this[_0xc6d5('0x19')]=_0x49a981[_0xc6d5('0x19')];this[_0xc6d5('0x1a')]=_0x49a981['servicenowAccounts'];this['dynamics365Accounts']=_0x49a981[_0xc6d5('0x1b')];this[_0xc6d5('0x1c')]=_0x49a981[_0xc6d5('0x1c')];this[_0xc6d5('0x1d')]={'zendesk':this[_0xc6d5('0x13')],'salesforce':this[_0xc6d5('0x15')],'freshdesk':this[_0xc6d5('0x14')],'sugarcrm':this[_0xc6d5('0x16')],'zoho':this[_0xc6d5('0x17')],'desk':this[_0xc6d5('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xc6d5('0x1b')],'freshsales':this[_0xc6d5('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0xc6d5('0x1e'),this[_0xc6d5('0x1f')]['bind'](this));ami['on'](_0xc6d5('0x20'),this[_0xc6d5('0x1f')]['bind'](this));ami['on'](_0xc6d5('0x21'),this['syncCustomEvent'][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x23'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x24'),this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x25'),this['syncCustomEvent'][_0xc6d5('0x22')](this));ami['on']('custom:agentcongestion',this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x26'),this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0xc6d5('0x28'),this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on']('custom:timeout',this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on']('custom:dialbegin',this[_0xc6d5('0x29')][_0xc6d5('0x22')](this));ami['on']('custom:dialconnect',this[_0xc6d5('0x29')][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x2a'),this['syncAgentDial'][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x2b'),this[_0xc6d5('0x1f')]['bind'](this));ami['on'](_0xc6d5('0x2c'),this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x2d'),this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on']('custom:incomingmessage',this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x2e'),this[_0xc6d5('0x1f')]['bind'](this));ami['on'](_0xc6d5('0x2f'),this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));ami['on'](_0xc6d5('0x30'),this[_0xc6d5('0x1f')]['bind'](this));ami['on'](_0xc6d5('0x31'),this[_0xc6d5('0x1f')][_0xc6d5('0x22')](this));}Trigger[_0xc6d5('0x32')][_0xc6d5('0x33')]=function(_0x1a0af6,_0x31e6b4,_0x49dcf2){logger['info'](_0x1a0af6,_0x31e6b4,JSON[_0xc6d5('0x34')](_0x49dcf2));io['to'](_0x1a0af6)['emit'](_0x31e6b4,_0x49dcf2);};Trigger[_0xc6d5('0x32')][_0xc6d5('0x1f')]=function(_0x1f783c){var _0x4ee828=_[_0xc6d5('0x35')](_0x1f783c);if(typeof _0x4ee828[_0xc6d5('0x36')]===_0xc6d5('0x37')){_0x4ee828[_0xc6d5('0x36')]='voice';}this['checkTriggers'](_0x4ee828);};Trigger[_0xc6d5('0x32')][_0xc6d5('0x29')]=function(_0x212bb3){if(this['agents'][_0x212bb3[_0xc6d5('0x38')]]){this['syncCustomEvent'](_0x212bb3);}};Trigger[_0xc6d5('0x32')][_0xc6d5('0x39')]=function(_0x17bb9f){var _0x280e2f;for(var _0x295b7a in this[_0xc6d5('0xe')]){if(this[_0xc6d5('0xe')][_0xc6d5('0x3a')](_0x295b7a)){if(this[_0xc6d5('0xe')][_0x295b7a]['status']){_0x280e2f=this[_0xc6d5('0x3b')](this[_0xc6d5('0xe')][_0x295b7a],_0x17bb9f);if(_0x280e2f){_['merge'](_0x17bb9f,_0x17bb9f['variables']);for(var _0x1d274f=0x0,_0x151578,_0x5d6c6a,_0x145798;_0x1d274f0x0){_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 +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x527622,_0x3f3389){var _0x389749=function(_0x1dde80){while(--_0x1dde80){_0x527622['push'](_0x527622['shift']());}};_0x389749(++_0x3f3389);}(_0x814b,0x1a2));var _0xb814=function(_0x266ddc,_0x45aa52){_0x266ddc=_0x266ddc-0x0;var _0x39c1d7=_0x814b[_0x266ddc];return _0x39c1d7;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index ab12a50..1ebf783 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 _0xc094=['recordingURL','recordingFormat','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','remoteUri','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','GET','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','body','headers','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','customField','idField','substring','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','callDirection','queue','phonecalls','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','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x2b866a,_0x1c438){var _0xe61447=function(_0x347ce7){while(--_0x347ce7){_0x2b866a['push'](_0x2b866a['shift']());}};_0xe61447(++_0x1c438);}(_0xc094,0x80));var _0x4c09=function(_0x58a643,_0xcc629a){_0x58a643=_0x58a643-0x0;var _0x15cb46=_0xc094[_0x58a643];return _0x15cb46;};'use strict';var _=require(_0x4c09('0x0'));var rp=require(_0x4c09('0x1'));var util=require(_0x4c09('0x2'));var intUtil=require(_0x4c09('0x3'));var md5=require(_0x4c09('0x4'));var Redis=require(_0x4c09('0x5'));var logger=require(_0x4c09('0x6'))(_0x4c09('0x7'));var config=require(_0x4c09('0x8'));config[_0x4c09('0x9')]=_[_0x4c09('0xa')](config[_0x4c09('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x4c09('0xb'))(new Redis(config[_0x4c09('0x9')]));function getAuthToken(_0x5958c3,_0x1480c0,_0x668986){if(_0x5958c3['modernAuthentication']){_0x5958c3['remoteUri']=_0x5958c3[_0x4c09('0xc')][_0x4c09('0xd')];_0x5958c3[_0x4c09('0xe')]=_0x5958c3['CloudProvider'][_0x4c09('0xf')];return Promise[_0x4c09('0x10')](_0x5958c3[_0x4c09('0xc')][_0x4c09('0x11')]);}var _0x599c4d={'method':_0x4c09('0x12'),'uri':_0x1480c0,'form':{'client_id':_0x5958c3[_0x4c09('0x13')],'resource':_0x5958c3[_0x4c09('0x14')],'username':_0x5958c3['username'],'password':_0x5958c3[_0x4c09('0x15')],'grant_type':_0x4c09('0x15'),'client_secret':_0x5958c3[_0x4c09('0x16')]},'json':!![]};return rp(_0x599c4d)['then'](function(_0x425edf){return _0x425edf[_0x4c09('0x17')];})[_0x4c09('0x18')](function(_0x578a07){logger[_0x4c09('0x19')]('['+[_0x668986[_0x4c09('0x1a')]()]+_0x4c09('0x1b'));return _0x578a07[_0x4c09('0x1c')];});}function getUser(_0x5c715d,_0x53f8b4,_0x3a79f3,_0xb1ecc1,_0x3676b9,_0x52c084){return new Promise(function(_0x45a540,_0x1aef18){return getAuthToken(_0x53f8b4,_0xb1ecc1,_0x52c084)[_0x4c09('0x1d')](function(_0x5bada6){var _0x262cc2={'method':_0x4c09('0x1e'),'uri':_0x3676b9+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x4c09('0x1f')+_0x5bada6,'OData-Version':_0x4c09('0x20')},'json':!![]};return rp(_0x262cc2);})[_0x4c09('0x1d')](function(_0x33c3b4){var _0x2289c0=_0x33c3b4[_0x4c09('0x21')];var _0x2c70d4=![];var _0x234349=null;if(!_[_0x4c09('0x22')](_0x3a79f3)){if(intUtil[_0x4c09('0x23')](_0x3a79f3[_0x4c09('0x24')])){_0x5c715d['userEmail']=_0x3a79f3[_0x4c09('0x24')];for(_0x234349=0x0;_0x234349<_0x2289c0[_0x4c09('0x25')];_0x234349++){if(_0x2289c0[_0x234349][_0x4c09('0x26')]===_0x3a79f3[_0x4c09('0x24')]&&!_0x2289c0[_0x234349][_0x4c09('0x27')]){_0x2c70d4=!![];logger['info']('['+[_0x52c084[_0x4c09('0x1a')]()]+_0x4c09('0x28')+_0x2289c0[_0x234349][_0x4c09('0x29')]+'!');_0x5c715d['userId']=_0x2289c0[_0x234349][_0x4c09('0x29')];}}}}if(!_0x2c70d4){logger[_0x4c09('0x2a')]('['+[_0x52c084[_0x4c09('0x1a')]()]+_0x4c09('0x2b'));_0x5c715d[_0x4c09('0x2c')]=_0x53f8b4[_0x4c09('0x2d')];for(_0x234349=0x0;_0x234349<_0x2289c0[_0x4c09('0x25')];_0x234349++){if(_0x2289c0[_0x234349][_0x4c09('0x26')]===_0x53f8b4[_0x4c09('0x2d')]){_0x5c715d[_0x4c09('0x2e')]=_0x2289c0[_0x234349]['systemuserid'];}}}_0x45a540(_0x5c715d);})['catch'](function(_0x200942){_0x1aef18(_0x200942[_0x4c09('0x1c')]);});});}function createEndUser(_0x5c5d03,_0x6be54f,_0x3f301b,_0x28d8a1,_0x487787,_0x34bf5e,_0x3c9a68){return new Promise(function(_0x32460d,_0x26eb01){return getAuthToken(_0x6be54f,_0x3f301b,_0x34bf5e)[_0x4c09('0x1d')](function(_0x3ec048){var _0x3bfeba=_0x34bf5e[_0x4c09('0x2f')]()===_0x4c09('0x30')?_0x487787[_0x4c09('0x31')]:_0x487787[_0x4c09('0x32')];var _0x12b5db={'method':_0x4c09('0x12'),'uri':_0x28d8a1+_0x4c09('0x33'),'body':{'fullname':_0x3bfeba,'firstname':_0x3bfeba,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x5c5d03[_0x4c09('0x2e')]+')'},'headers':{'Authorization':_0x4c09('0x1f')+_0x3ec048,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x12b5db[_0x4c09('0x34')][_0x3c9a68]=_0x3bfeba;return rp(_0x12b5db);})[_0x4c09('0x1d')](function(_0x470337){var _0x3e068b=_0x470337[_0x4c09('0x35')]['odata-entityid'];var _0x1fada6=_0x3e068b['substring'](_0x3e068b[_0x4c09('0x36')]('(')+0x1,_0x3e068b['lastIndexOf'](')'));_0x5c5d03[_0x4c09('0x37')]=_0x1fada6;_0x32460d(_0x5c5d03);})[_0x4c09('0x18')](function(_0x3b687d){_0x26eb01(_0x3b687d[_0x4c09('0x1c')]);});});}function getEndUser(_0x1d61c8,_0x40febe,_0xa46c1a,_0xa63cca,_0x51d0f1,_0x738c03,_0x78d7f9,_0xa5ee93){var _0x2a1008=_0x738c03[_0x4c09('0x2f')]()===_0x4c09('0x30')?_0x51d0f1[_0x4c09('0x31')]:_0x51d0f1['calleridnum'];return getAuthToken(_0x40febe,_0xa46c1a,_0x738c03)[_0x4c09('0x1d')](function(_0x1521ad){_0xa5ee93=_0xa5ee93?_0xa5ee93:_0x4c09('0x38');var _0x545fc4={'method':_0x4c09('0x1e'),'uri':_0xa63cca+_0x4c09('0x39')+_0xa5ee93+_0x4c09('0x3a')+_0xa5ee93+'\x20eq\x20\x27'+_0x2a1008[_0x4c09('0x3b')]('+','%2b')+'\x27','headers':{'Authorization':_0x4c09('0x1f')+_0x1521ad,'If-None-Match':null,'OData-Version':_0x4c09('0x20')},'json':!![]};return rp(_0x545fc4);})['then'](function(_0x4bff2f){var _0x3fa5f7=![];if(!_0x4bff2f)return _0x3fa5f7;var _0x727203=_0x4bff2f[_0x4c09('0x21')];for(var _0x469453=0x0;_0x469453<_0x727203[_0x4c09('0x25')];_0x469453++){if(_0x727203[_0x469453][_0xa5ee93]===_0x2a1008){_0x3fa5f7=!![];_0x1d61c8[_0x4c09('0x37')]=_0x727203[_0x469453][_0x4c09('0x3c')];}}return _0x3fa5f7;})['then'](function(_0x15850e){if(_0x15850e)return _0x1d61c8;if(_0x78d7f9==='nothing'){logger[_0x4c09('0x2a')]('['+[_0x738c03['toUpperCase']()]+_0x4c09('0x3d'));return _0x1d61c8;}return createEndUser(_0x1d61c8,_0x40febe,_0xa46c1a,_0xa63cca,_0x51d0f1,_0x738c03,_0xa5ee93)['then'](function(_0x4d04fe){logger[_0x4c09('0x2a')]('['+[_0x738c03['toUpperCase']()]+_0x4c09('0x3e'),_0x4d04fe[_0x4c09('0x37')]);return _0x4d04fe;});});}function getCustomFields(_0x4e0168,_0x1e6b55,_0x235709){var _0x1d7bca={};if(_0x4e0168[_0x4c09('0x25')]>0x0){_[_0x4c09('0x3f')](_0x4e0168,function(_0x3a5dc1){if(_[_0x4c09('0x40')]([_0x4c09('0x41'),_0x4c09('0x42')],_0x3a5dc1[_0x4c09('0x43')])&&_0x3a5dc1['nameField']&&!_0x3a5dc1[_0x4c09('0x44')]){var _0x28b163=_0x3a5dc1[_0x4c09('0x45')][_0x4c09('0x2f')]();var _0xb577cc=_0x28b163[_0x4c09('0x46')](0x0,_0x28b163['indexOf']('_'));var _0x14b078=_0x28b163['substring'](_0x28b163[_0x4c09('0x47')]('_')+0x1);if(_0xb577cc===_0x235709){_0x1d7bca[_0x14b078]=_0x3a5dc1[_0x4c09('0x48')];}}});}return _0x1d7bca;}function getTicket(_0x4f1166,_0x4eae00,_0x216205,_0x5e21a2,_0x2484f1,_0x4bc052,_0x587ef8){return new Promise(function(_0x4ccbbd,_0x45f1a8){var _0x48d826;return getAuthToken(_0x4eae00,_0x216205,_0x587ef8)[_0x4c09('0x1d')](function(_0x5ba123){if(_0x4bc052[_0x4c09('0x49')]===_0x4c09('0x4a')){_0x48d826={'method':'POST','uri':_0x5e21a2+_0x4c09('0x4b'),'body':Object[_0x4c09('0x4c')]({},{'title':intUtil[_0x4c09('0x4d')](_0x4bc052[_0x4c09('0x4e')],_0x2484f1,'\x20'),'description':intUtil['getString'](_0x4bc052[_0x4c09('0x4f')],_0x2484f1,'\x0a'),'customerid_contact@odata.bind':_0x4f1166[_0x4c09('0x37')]?_0x4c09('0x50')+_0x4f1166[_0x4c09('0x37')]+')':undefined,'ownerid@odata.bind':_0x4c09('0x51')+_0x4f1166['userId']+')','caseorigincode':'1'},getCustomFields(_0x4bc052['Fields'],_0x2484f1,_0x4bc052['ticketType'])),'headers':{'Authorization':_0x4c09('0x1f')+_0x5ba123,'OData-Version':_0x4c09('0x20')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4bc052['ticketType']==='phonecall'){var _0x169c1a=_0x4f1166[_0x4c09('0x37')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x4f1166['userId']+')','participationtypemask':_0x4f1166[_0x4c09('0x52')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x4c09('0x50')+_0x4f1166[_0x4c09('0x37')]+')','participationtypemask':_0x4f1166[_0x4c09('0x52')]===_0x4c09('0x53')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x4c09('0x51')+_0x4f1166[_0x4c09('0x2e')]+')','participationtypemask':_0x4f1166[_0x4c09('0x52')]==='queue'?0x2:0x1}];_0x48d826={'method':_0x4c09('0x12'),'uri':_0x5e21a2+_0x4c09('0x54'),'body':Object[_0x4c09('0x4c')]({},{'subject':intUtil[_0x4c09('0x4d')](_0x4bc052['Subjects'],_0x2484f1,'\x20'),'phonenumber':String(_0x2484f1[_0x4c09('0x32')]),'description':intUtil[_0x4c09('0x4d')](_0x4bc052['Descriptions'],_0x2484f1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4f1166[_0x4c09('0x37')]?_0x4c09('0x50')+_0x4f1166[_0x4c09('0x37')]+')':undefined,'ownerid@odata.bind':_0x4c09('0x51')+_0x4f1166['userId']+')','directioncode':_0x4f1166[_0x4c09('0x52')]===_0x4c09('0x53')?![]:!![],'phonecall_activity_parties':_0x169c1a},getCustomFields(_0x4bc052[_0x4c09('0x55')],_0x2484f1,_0x4bc052[_0x4c09('0x49')])),'headers':{'Authorization':_0x4c09('0x1f')+_0x5ba123,'OData-Version':_0x4c09('0x20')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x48d826);})[_0x4c09('0x1d')](function(_0x542eb5){var _0xa36779=_0x542eb5[_0x4c09('0x35')]['odata-entityid'];var _0x3cab74=_0xa36779[_0x4c09('0x46')](_0xa36779[_0x4c09('0x36')]('(')+0x1,_0xa36779[_0x4c09('0x36')](')'));_0x4f1166[_0x4c09('0x56')]=_0x3cab74;_0x4ccbbd(_0x4f1166);})[_0x4c09('0x18')](function(_0x4d486b){_0x45f1a8(_0x4d486b[_0x4c09('0x1c')]);});});}function emit(_0x55dfb8,_0x32cd4d,_0x3659c5,_0x418aae){var _0x188c60={'uri':util[_0x4c09('0x57')](_0x4c09('0x58'),_0x55dfb8,_0x3659c5,_0x418aae)};io['to'](util['format'](_0x4c09('0x59'),_0x32cd4d))[_0x4c09('0x5a')](_0x4c09('0x5b'),_0x188c60);}exports['cs']=function(_0x40c4c8,_0x25d9a5,_0x49f256,_0x276029,_0x4e152f,_0x48b680,_0x4018a7,_0x7b9ff1){var _0x54d26f={};_0x48b680[_0x4c09('0x14')]=_0x48b680[_0x4c09('0x5c')]?intUtil[_0x4c09('0x5d')](_0x48b680['CloudProvider'][_0x4c09('0xd')]):intUtil[_0x4c09('0x5d')](_0x48b680[_0x4c09('0x14')]);_0x48b680['serverUrl']=intUtil[_0x4c09('0x5d')](_0x48b680[_0x4c09('0x5e')]);_0x54d26f[_0x4c09('0x52')]=_0x7b9ff1===_0x4c09('0x53')||_0x7b9ff1===_0x4c09('0x5f')?_0x4c09('0x53'):'outbound';var _0x12f5fb=_0x48b680[_0x4c09('0x5c')]?util['format'](_0x4c09('0x60'),_0x48b680[_0x4c09('0xc')][_0x4c09('0xd')]):util[_0x4c09('0x57')](_0x4c09('0x60'),_0x48b680[_0x4c09('0x14')]);var _0xb449c4=util[_0x4c09('0x57')](_0x4c09('0x61'),_0x48b680[_0x4c09('0xe')]);var _0xe774e6=util[_0x4c09('0x57')](_0x4c09('0x62'),_0x48b680[_0x4c09('0x5e')],_0x25d9a5[_0x4c09('0x63')],md5(_0x25d9a5[_0x4c09('0x63')]));if(_0x4e152f&&_0x4e152f['monitor_format']){logger[_0x4c09('0x2a')](_0x4c09('0x64'),_0x4c09('0x65'));_0x25d9a5[_0x4c09('0x66')]=_0xe774e6;}else if(_0x4018a7&&_0x4018a7[_0x4c09('0x67')]&&_0x4018a7[_0x4c09('0x67')]!=='none'){logger['info'](_0x4c09('0x68'),_0x4c09('0x65'));_0x25d9a5[_0x4c09('0x66')]=_0xe774e6;}else{_0x25d9a5[_0x4c09('0x66')]='';}return getUser(_0x54d26f,_0x48b680,_0x276029,_0xb449c4,_0x12f5fb,_0x7b9ff1)[_0x4c09('0x1d')](function(_0x19c4de){logger[_0x4c09('0x2a')]('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x69'),_0x19c4de[_0x4c09('0x2e')]);logger['info']('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x6a'),_0x19c4de['userEmail']);return getEndUser(_0x19c4de,_0x48b680,_0xb449c4,_0x12f5fb,_0x25d9a5,_0x7b9ff1,_0x49f256[_0x4c09('0x6b')],_0x49f256[_0x4c09('0x6c')]);})[_0x4c09('0x1d')](function(_0x62be3){logger['info']('['+_0x7b9ff1[_0x4c09('0x1a')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x62be3[_0x4c09('0x37')]);logger['info']('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x6d'),_0x25d9a5[_0x4c09('0x32')]);return getTicket(_0x62be3,_0x48b680,_0xb449c4,_0x12f5fb,_0x25d9a5,_0x49f256,_0x7b9ff1);})[_0x4c09('0x1d')](function(_0xa875c5){logger['info'](util[_0x4c09('0x57')]('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x6e'),_0x49f256[_0x4c09('0x49')],_0xa875c5[_0x4c09('0x56')]));logger[_0x4c09('0x2a')](util[_0x4c09('0x57')]('['+_0x7b9ff1['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x7b9ff1));if(_0x7b9ff1!==_0x4c09('0x5f')&&_0x49f256[_0x4c09('0x6f')]){logger['info']('['+_0x7b9ff1[_0x4c09('0x1a')]()+']',_0x4c09('0x70'));emit(_0x48b680['remoteUri'],_0x276029[_0x4c09('0x71')],_0x49f256[_0x4c09('0x49')],_0xa875c5[_0x4c09('0x56')]);}})[_0x4c09('0x18')](function(_0x23c197){logger[_0x4c09('0x19')]('['+_0x7b9ff1[_0x4c09('0x1a')]()+_0x4c09('0x72'),_0x23c197[_0x4c09('0x1c')]);console[_0x4c09('0x19')]('Error\x20running\x20Dynamics365\x20integration',_0x23c197);});}; \ No newline at end of file +var _0x43b8=['validateEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','assign','getString','Subjects','Descriptions','Fields','ticketType','phonecall','callDirection','/contacts(','queue','phonecalls','odata-entityid','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','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','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:','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...','name','error','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','data7','tenantId','CloudProvider','data2','data5','POST','clientId','username','password','clientSecret','then','access_token','catch',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil'];(function(_0x5a17a9,_0x1eea3d){var _0x4c09cb=function(_0x22765c){while(--_0x22765c){_0x5a17a9['push'](_0x5a17a9['shift']());}};_0x4c09cb(++_0x1eea3d);}(_0x43b8,0x13b));var _0x843b=function(_0x114413,_0x45c38b){_0x114413=_0x114413-0x0;var _0x84c997=_0x43b8[_0x114413];return _0x84c997;};'use strict';var _=require(_0x843b('0x0'));var rp=require(_0x843b('0x1'));var util=require(_0x843b('0x2'));var intUtil=require(_0x843b('0x3'));var md5=require('md5');var Redis=require(_0x843b('0x4'));var logger=require(_0x843b('0x5'))(_0x843b('0x6'));var config=require('../../../../config/environment');config[_0x843b('0x7')]=_['defaults'](config['redis'],{'host':_0x843b('0x8'),'port':0x18eb});var io=require(_0x843b('0x9'))(new Redis(config[_0x843b('0x7')]));function getAuthToken(_0x1e39e5,_0x215e7f,_0x55a813){if(_0x1e39e5[_0x843b('0xa')]){_0x1e39e5[_0x843b('0xb')]=_0x1e39e5['CloudProvider'][_0x843b('0xc')];_0x1e39e5[_0x843b('0xd')]=_0x1e39e5[_0x843b('0xe')][_0x843b('0xf')];return Promise['resolve'](_0x1e39e5[_0x843b('0xe')][_0x843b('0x10')]);}var _0x2b470a={'method':_0x843b('0x11'),'uri':_0x215e7f,'form':{'client_id':_0x1e39e5[_0x843b('0x12')],'resource':_0x1e39e5[_0x843b('0xb')],'username':_0x1e39e5[_0x843b('0x13')],'password':_0x1e39e5[_0x843b('0x14')],'grant_type':_0x843b('0x14'),'client_secret':_0x1e39e5[_0x843b('0x15')]},'json':!![]};return rp(_0x2b470a)[_0x843b('0x16')](function(_0x56ec55){return _0x56ec55[_0x843b('0x17')];})[_0x843b('0x18')](function(_0x495eef){logger['error']('['+[_0x55a813['toUpperCase']()]+_0x843b('0x19'));return _0x495eef[_0x843b('0x1a')];});}function getUser(_0x818a4f,_0x5da492,_0x57b18b,_0x2247b8,_0x529971,_0x35522f){return new Promise(function(_0x5acc1e,_0x21c7b8){return getAuthToken(_0x5da492,_0x2247b8,_0x35522f)[_0x843b('0x16')](function(_0x1bd159){var _0x20b74c={'method':_0x843b('0x1b'),'uri':_0x529971+_0x843b('0x1c'),'headers':{'Authorization':_0x843b('0x1d')+_0x1bd159,'OData-Version':_0x843b('0x1e')},'json':!![]};return rp(_0x20b74c);})[_0x843b('0x16')](function(_0x240ed0){var _0x54601c=_0x240ed0[_0x843b('0x1f')];var _0x5cdd9f=![];var _0x132bc1=null;if(!_[_0x843b('0x20')](_0x57b18b)){if(intUtil[_0x843b('0x21')](_0x57b18b[_0x843b('0x22')])){_0x818a4f['userEmail']=_0x57b18b[_0x843b('0x22')];for(_0x132bc1=0x0;_0x132bc1<_0x54601c[_0x843b('0x23')];_0x132bc1++){if(_0x54601c[_0x132bc1][_0x843b('0x24')]===_0x57b18b[_0x843b('0x22')]&&!_0x54601c[_0x132bc1][_0x843b('0x25')]){_0x5cdd9f=!![];logger[_0x843b('0x26')]('['+[_0x35522f[_0x843b('0x27')]()]+_0x843b('0x28')+_0x54601c[_0x132bc1][_0x843b('0x29')]+'!');_0x818a4f['userId']=_0x54601c[_0x132bc1][_0x843b('0x29')];}}}}if(!_0x5cdd9f){logger[_0x843b('0x26')]('['+[_0x35522f[_0x843b('0x27')]()]+_0x843b('0x2a'));_0x818a4f[_0x843b('0x2b')]=_0x5da492['username'];for(_0x132bc1=0x0;_0x132bc1<_0x54601c['length'];_0x132bc1++){if(_0x54601c[_0x132bc1][_0x843b('0x24')]===_0x5da492['username']){_0x818a4f[_0x843b('0x2c')]=_0x54601c[_0x132bc1]['systemuserid'];}}}_0x5acc1e(_0x818a4f);})[_0x843b('0x18')](function(_0x12af37){_0x21c7b8(_0x12af37[_0x843b('0x1a')]);});});}function createEndUser(_0x49db46,_0x277e7a,_0x44c5d8,_0x113fc7,_0x411db5,_0x3a6676,_0x5bfa05){return new Promise(function(_0x480bfb,_0x50bfd1){return getAuthToken(_0x277e7a,_0x44c5d8,_0x3a6676)[_0x843b('0x16')](function(_0x251090){var _0x3fb918=_0x3a6676[_0x843b('0x2d')]()===_0x843b('0x2e')?_0x411db5[_0x843b('0x2f')]:_0x411db5[_0x843b('0x30')];var _0x2a4bae={'method':_0x843b('0x11'),'uri':_0x113fc7+_0x843b('0x31'),'body':{'fullname':_0x3fb918,'firstname':_0x3fb918,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x843b('0x32')+_0x49db46[_0x843b('0x2c')]+')'},'headers':{'Authorization':_0x843b('0x1d')+_0x251090,'OData-Version':_0x843b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x2a4bae[_0x843b('0x33')][_0x5bfa05]=_0x3fb918;return rp(_0x2a4bae);})['then'](function(_0x974094){var _0x1996a5=_0x974094[_0x843b('0x34')]['odata-entityid'];var _0x1d1820=_0x1996a5[_0x843b('0x35')](_0x1996a5[_0x843b('0x36')]('(')+0x1,_0x1996a5[_0x843b('0x36')](')'));_0x49db46[_0x843b('0x37')]=_0x1d1820;_0x480bfb(_0x49db46);})[_0x843b('0x18')](function(_0x47a392){_0x50bfd1(_0x47a392[_0x843b('0x1a')]);});});}function getEndUser(_0xa6fefc,_0xd22908,_0x3601a2,_0x3ebe52,_0x4bbc19,_0x5cf66c,_0x5b3b18,_0x2c5441){var _0x18aef0=_0x5cf66c['toLowerCase']()===_0x843b('0x2e')?_0x4bbc19['destcalleridnum']:_0x4bbc19['calleridnum'];return getAuthToken(_0xd22908,_0x3601a2,_0x5cf66c)[_0x843b('0x16')](function(_0x590ddd){_0x2c5441=_0x2c5441?_0x2c5441:_0x843b('0x38');var _0x50824d={'method':_0x843b('0x1b'),'uri':_0x3ebe52+_0x843b('0x39')+_0x2c5441+_0x843b('0x3a')+_0x2c5441+'\x20eq\x20\x27'+_0x18aef0[_0x843b('0x3b')]('+',_0x843b('0x3c'))+'\x27','headers':{'Authorization':_0x843b('0x1d')+_0x590ddd,'If-None-Match':null,'OData-Version':_0x843b('0x1e')},'json':!![]};return rp(_0x50824d);})[_0x843b('0x16')](function(_0x1b6059){var _0x34aa39=![];if(!_0x1b6059)return _0x34aa39;var _0x9e94e3=_0x1b6059['value'];for(var _0x50d566=0x0;_0x50d566<_0x9e94e3[_0x843b('0x23')];_0x50d566++){if(_0x9e94e3[_0x50d566][_0x2c5441]===_0x18aef0){_0x34aa39=!![];_0xa6fefc['enduserId']=_0x9e94e3[_0x50d566][_0x843b('0x3d')];}}return _0x34aa39;})[_0x843b('0x16')](function(_0x418e5d){if(_0x418e5d)return _0xa6fefc;if(_0x5b3b18===_0x843b('0x3e')){logger[_0x843b('0x26')]('['+[_0x5cf66c['toUpperCase']()]+_0x843b('0x3f'));return _0xa6fefc;}return createEndUser(_0xa6fefc,_0xd22908,_0x3601a2,_0x3ebe52,_0x4bbc19,_0x5cf66c,_0x2c5441)[_0x843b('0x16')](function(_0xca386d){logger[_0x843b('0x26')]('['+[_0x5cf66c[_0x843b('0x27')]()]+_0x843b('0x40'),_0xca386d[_0x843b('0x37')]);return _0xca386d;});});}function getCustomFields(_0x21c89d,_0x585f0c,_0x348770){var _0x239848={};if(_0x21c89d[_0x843b('0x23')]>0x0){_[_0x843b('0x41')](_0x21c89d,function(_0x1148c1){if(_[_0x843b('0x42')]([_0x843b('0x43'),_0x843b('0x44')],_0x1148c1[_0x843b('0x45')])&&_0x1148c1[_0x843b('0x46')]&&!_0x1148c1[_0x843b('0x47')]){var _0x3bf7dc=_0x1148c1[_0x843b('0x48')][_0x843b('0x2d')]();var _0x2c6fb5=_0x3bf7dc[_0x843b('0x35')](0x0,_0x3bf7dc['indexOf']('_'));var _0x24fbbc=_0x3bf7dc['substring'](_0x3bf7dc[_0x843b('0x49')]('_')+0x1);if(_0x2c6fb5===_0x348770){_0x239848[_0x24fbbc]=_0x1148c1[_0x843b('0x4a')];}}});}return _0x239848;}function getTicket(_0x1f7cc2,_0x5943ea,_0x318159,_0x1f70ae,_0x2ff799,_0x413456,_0x401ee1){return new Promise(function(_0x90e616,_0x5cdfab){var _0x2ae66d;return getAuthToken(_0x5943ea,_0x318159,_0x401ee1)[_0x843b('0x16')](function(_0x2f4b6f){if(_0x413456['ticketType']==='incident'){_0x2ae66d={'method':_0x843b('0x11'),'uri':_0x1f70ae+'incidents','body':Object[_0x843b('0x4b')]({},{'title':intUtil[_0x843b('0x4c')](_0x413456[_0x843b('0x4d')],_0x2ff799,'\x20'),'description':intUtil[_0x843b('0x4c')](_0x413456[_0x843b('0x4e')],_0x2ff799,'\x0a'),'customerid_contact@odata.bind':_0x1f7cc2[_0x843b('0x37')]?'/contacts('+_0x1f7cc2[_0x843b('0x37')]+')':undefined,'ownerid@odata.bind':_0x843b('0x32')+_0x1f7cc2[_0x843b('0x2c')]+')','caseorigincode':'1'},getCustomFields(_0x413456[_0x843b('0x4f')],_0x2ff799,_0x413456[_0x843b('0x50')])),'headers':{'Authorization':_0x843b('0x1d')+_0x2f4b6f,'OData-Version':_0x843b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x413456[_0x843b('0x50')]===_0x843b('0x51')){var _0x3c90c0=_0x1f7cc2[_0x843b('0x37')]?[{'partyid_systemuser@odata.bind':_0x843b('0x32')+_0x1f7cc2['userId']+')','participationtypemask':_0x1f7cc2[_0x843b('0x52')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x843b('0x53')+_0x1f7cc2['enduserId']+')','participationtypemask':_0x1f7cc2['callDirection']===_0x843b('0x54')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x843b('0x32')+_0x1f7cc2[_0x843b('0x2c')]+')','participationtypemask':_0x1f7cc2[_0x843b('0x52')]===_0x843b('0x54')?0x2:0x1}];_0x2ae66d={'method':_0x843b('0x11'),'uri':_0x1f70ae+_0x843b('0x55'),'body':Object[_0x843b('0x4b')]({},{'subject':intUtil['getString'](_0x413456[_0x843b('0x4d')],_0x2ff799,'\x20'),'phonenumber':String(_0x2ff799[_0x843b('0x30')]),'description':intUtil[_0x843b('0x4c')](_0x413456['Descriptions'],_0x2ff799,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1f7cc2[_0x843b('0x37')]?_0x843b('0x53')+_0x1f7cc2[_0x843b('0x37')]+')':undefined,'ownerid@odata.bind':_0x843b('0x32')+_0x1f7cc2[_0x843b('0x2c')]+')','directioncode':_0x1f7cc2[_0x843b('0x52')]===_0x843b('0x54')?![]:!![],'phonecall_activity_parties':_0x3c90c0},getCustomFields(_0x413456[_0x843b('0x4f')],_0x2ff799,_0x413456['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x2f4b6f,'OData-Version':_0x843b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2ae66d);})[_0x843b('0x16')](function(_0x5688d3){var _0x5950c6=_0x5688d3[_0x843b('0x34')][_0x843b('0x56')];var _0x28ba89=_0x5950c6['substring'](_0x5950c6[_0x843b('0x36')]('(')+0x1,_0x5950c6['lastIndexOf'](')'));_0x1f7cc2[_0x843b('0x57')]=_0x28ba89;_0x90e616(_0x1f7cc2);})[_0x843b('0x18')](function(_0x143acc){_0x5cdfab(_0x143acc['message']);});});}function emit(_0x4ab782,_0x572c9a,_0x2ebb76,_0x6e674f){var _0x204b1a={'uri':util['format'](_0x843b('0x58'),_0x4ab782,_0x2ebb76,_0x6e674f)};io['to'](util[_0x843b('0x59')](_0x843b('0x5a'),_0x572c9a))[_0x843b('0x5b')](_0x843b('0x5c'),_0x204b1a);}exports['cs']=function(_0x716ffc,_0x3a07f0,_0x1b8368,_0x1eb626,_0x56dc20,_0x16e75c,_0x1c4ef8,_0x2764f6){var _0x2370b1={};_0x16e75c['remoteUri']=_0x16e75c['modernAuthentication']?intUtil[_0x843b('0x5d')](_0x16e75c[_0x843b('0xe')]['data7']):intUtil[_0x843b('0x5d')](_0x16e75c['remoteUri']);_0x16e75c[_0x843b('0x5e')]=intUtil[_0x843b('0x5d')](_0x16e75c[_0x843b('0x5e')]);_0x2370b1[_0x843b('0x52')]=_0x2764f6===_0x843b('0x54')||_0x2764f6===_0x843b('0x5f')?_0x843b('0x54'):_0x843b('0x2e');var _0x6a33aa=_0x16e75c[_0x843b('0xa')]?util[_0x843b('0x59')]('%s/api/data/v9.0/',_0x16e75c[_0x843b('0xe')][_0x843b('0xc')]):util[_0x843b('0x59')](_0x843b('0x60'),_0x16e75c[_0x843b('0xb')]);var _0x573483=util[_0x843b('0x59')](_0x843b('0x61'),_0x16e75c[_0x843b('0xd')]);var _0x2408c8=util['format'](_0x843b('0x62'),_0x16e75c['serverUrl'],_0x3a07f0[_0x843b('0x63')],md5(_0x3a07f0[_0x843b('0x63')]));if(_0x56dc20&&_0x56dc20['monitor_format']){logger[_0x843b('0x26')](_0x843b('0x64'),_0x843b('0x65'));_0x3a07f0[_0x843b('0x66')]=_0x2408c8;}else if(_0x1c4ef8&&_0x1c4ef8['recordingFormat']&&_0x1c4ef8[_0x843b('0x67')]!==_0x843b('0x68')){logger[_0x843b('0x26')](_0x843b('0x69'),_0x843b('0x65'));_0x3a07f0['recordingURL']=_0x2408c8;}else{_0x3a07f0[_0x843b('0x66')]='';}return getUser(_0x2370b1,_0x16e75c,_0x1eb626,_0x573483,_0x6a33aa,_0x2764f6)[_0x843b('0x16')](function(_0x10e7ab){logger[_0x843b('0x26')]('['+_0x2764f6[_0x843b('0x27')]()+_0x843b('0x6a'),_0x10e7ab[_0x843b('0x2c')]);logger[_0x843b('0x26')]('['+_0x2764f6[_0x843b('0x27')]()+']\x20The\x20User\x20email\x20is:',_0x10e7ab[_0x843b('0x2b')]);return getEndUser(_0x10e7ab,_0x16e75c,_0x573483,_0x6a33aa,_0x3a07f0,_0x2764f6,_0x1b8368['moduleCreate'],_0x1b8368[_0x843b('0x6b')]);})[_0x843b('0x16')](function(_0x871295){logger['info']('['+_0x2764f6[_0x843b('0x27')]()+_0x843b('0x6c'),_0x871295[_0x843b('0x37')]);logger[_0x843b('0x26')]('['+_0x2764f6[_0x843b('0x27')]()+_0x843b('0x6d'),_0x3a07f0[_0x843b('0x30')]);return getTicket(_0x871295,_0x16e75c,_0x573483,_0x6a33aa,_0x3a07f0,_0x1b8368,_0x2764f6);})[_0x843b('0x16')](function(_0x5accde){logger['info'](util[_0x843b('0x59')]('['+_0x2764f6[_0x843b('0x27')]()+_0x843b('0x6e'),_0x1b8368[_0x843b('0x50')],_0x5accde[_0x843b('0x57')]));logger[_0x843b('0x26')](util[_0x843b('0x59')]('['+_0x2764f6[_0x843b('0x27')]()+_0x843b('0x6f'),_0x2764f6));if(_0x2764f6!==_0x843b('0x5f')&&_0x1b8368['openNewTab']){logger['info']('['+_0x2764f6[_0x843b('0x27')]()+']',_0x843b('0x70'));emit(_0x16e75c[_0x843b('0xb')],_0x1eb626[_0x843b('0x71')],_0x1b8368[_0x843b('0x50')],_0x5accde[_0x843b('0x57')]);}})[_0x843b('0x18')](function(_0x3487fe){logger['error']('['+_0x2764f6[_0x843b('0x27')]()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x3487fe['message']);console[_0x843b('0x72')](_0x843b('0x73'),_0x3487fe);});}; \ 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 600e76d..91b0f79 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 _0x0d53=['Variable','name','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','destcalleridnum','unmanaged','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','map','string','picklist','nameField','customField','content','includes','idField','push','variable','variableName','customVariable'];(function(_0x26376c,_0x34b0aa){var _0x468bbf=function(_0x467113){while(--_0x467113){_0x26376c['push'](_0x26376c['shift']());}};_0x468bbf(++_0x34b0aa);}(_0x0d53,0xd4));var _0x30d5=function(_0xad23ac,_0x5df7e6){_0xad23ac=_0xad23ac-0x0;var _0x2f4fc2=_0x0d53[_0xad23ac];return _0x2f4fc2;};'use strict';var _=require(_0x30d5('0x0'));var rp=require('request-promise');var md5=require(_0x30d5('0x1'));var util=require('util');var Redis=require(_0x30d5('0x2'));var intUtil=require(_0x30d5('0x3'));var config=require(_0x30d5('0x4'));var logger=require('../../../../config/logger')(_0x30d5('0x5'));config[_0x30d5('0x6')]=_[_0x30d5('0x7')](config['redis'],{'host':_0x30d5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x30d5('0x9'),'Accept':_0x30d5('0x9')};function emit(_0x5205d4,_0x17691c,_0x5e1ab7){io['to'](_0x5205d4)[_0x30d5('0xa')](_0x17691c,_0x5e1ab7);}function getTicket(_0x1ad8a4,_0x4a730e,_0x33f979,_0x4c0695,_0x532c08){logger[_0x30d5('0xb')](_0x30d5('0xc'));var _0x324976=_[_0x30d5('0xd')]({'responder_id':_0x4a730e['id'],'requester_id':_0x33f979['id'],'name':util[_0x30d5('0xe')](_0x30d5('0xf'),_0x532c08[_0x30d5('0x10')]),'phone':_0x532c08[_0x30d5('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x30d5('0x12')](_0x4c0695[_0x30d5('0x13')],_0x532c08,'\x20'),'description':intUtil['getString'](_0x4c0695[_0x30d5('0x14')],_0x532c08,_0x30d5('0x15')),'tags':getTags(_0x4c0695['Tags'],'name')},getCustomFields(_0x4c0695[_0x30d5('0x16')],_0x532c08));_0x324976[_0x30d5('0x17')]=_[_0x30d5('0x18')](_[_0x30d5('0x19')](_0x324976['custom_fields'],'id'),_0x30d5('0x1a'));return request({'uri':util[_0x30d5('0xe')](_0x30d5('0x1b'),_0x1ad8a4[_0x30d5('0x1c')]),'method':_0x30d5('0x1d'),'body':_0x324976})[_0x30d5('0x1e')](function(_0x326dfb){logger[_0x30d5('0xb')](_0x30d5('0x1f'));return _0x326dfb;});}function getUser(_0x3a2093,_0x3f2909){if(intUtil[_0x30d5('0x20')](_0x3f2909)){return request({'uri':util[_0x30d5('0xe')]('%s/api/v2/agents',_0x3a2093[_0x30d5('0x1c')]),'qs':{'email':_0x3f2909}})['then'](function(_0x44a6e0){if(_0x44a6e0['length']){logger['info']('Agent\x20found!');return _[_0x30d5('0x21')](_0x44a6e0,function(_0x79ddef){return _0x79ddef[_0x30d5('0x22')][_0x30d5('0x23')]===_0x3f2909;});}else{logger[_0x30d5('0xb')](_0x30d5('0x24'));return request({'uri':util[_0x30d5('0xe')]('%s/api/v2/agents/me',_0x3a2093[_0x30d5('0x1c')])})[_0x30d5('0x1e')](function(_0x129490){logger[_0x30d5('0xb')](_0x30d5('0x25'));return _0x129490;});}});}else{logger['info'](_0x30d5('0x26'));return request({'uri':util[_0x30d5('0xe')]('%s/api/v2/agents/me',_0x3a2093[_0x30d5('0x1c')])})[_0x30d5('0x1e')](function(_0x3aa2a3){logger[_0x30d5('0xb')](_0x30d5('0x25'));return _0x3aa2a3;});}}function getEndUser(_0x6ad8c3,_0x5c343a,_0x5481a0){logger['info']('Searching\x20enduser\x20with\x20phone',_0x5481a0);return request({'uri':util['format']('%s/api/v2/contacts',_0x6ad8c3[_0x30d5('0x1c')]),'qs':{'phone':_0x5481a0}})[_0x30d5('0x1e')](function(_0x3bdf3d){if(_0x3bdf3d[_0x30d5('0x27')]){logger['info']('Enduser\x20found!');return _[_0x30d5('0x21')](_0x3bdf3d,{'phone':_0x5481a0});}else{logger[_0x30d5('0xb')](_0x30d5('0x28'));return request({'uri':util[_0x30d5('0xe')](_0x30d5('0x29'),_0x6ad8c3[_0x30d5('0x1c')]),'method':_0x30d5('0x1d'),'body':{'name':_0x5c343a,'phone':_0x5481a0}})[_0x30d5('0x1e')](function(_0x2a0786){logger[_0x30d5('0xb')](_0x30d5('0x2a'));return _0x2a0786;});}});}function getAuth(_0x296fc0){return util[_0x30d5('0xe')](_0x30d5('0x2b'),new Buffer(_0x296fc0[_0x30d5('0x2c')]+':X')[_0x30d5('0x2d')]('base64'));}function request(_0x41f8c2){logger[_0x30d5('0x2e')](_0x30d5('0x2f'),JSON[_0x30d5('0x30')](_0x41f8c2));return rp(_['defaults'](_0x41f8c2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x160322,_0x58248b){var _0x45e695=[];if(_0x160322&&_0x160322[_0x30d5('0x27')]>0x0){_0x45e695=_[_0x30d5('0x31')](_0x160322,_0x58248b);}return _0x45e695;}function getCustomFields(_0x9ebb6d,_0x6565e0){var _0x5f0323=[];var _0xb88eb4={'custom_fields':[]};if(_0x9ebb6d[_0x30d5('0x27')]>0x0){_['forEach'](_0x9ebb6d,function(_0x6a1689){if(_['includes']([_0x30d5('0x32'),_0x30d5('0x33')],_0x6a1689['type'])&&_0x6a1689[_0x30d5('0x34')]&&!_0x6a1689[_0x30d5('0x35')]){_0xb88eb4[_0x6a1689[_0x30d5('0x34')]['toLowerCase']()]=_0x6a1689[_0x30d5('0x36')][_0x30d5('0x2d')]();}else if(_[_0x30d5('0x37')]([_0x30d5('0x32'),'picklist'],_0x6a1689['type'])&&_0x6a1689[_0x30d5('0x38')]&&_0x6a1689[_0x30d5('0x35')]){_0xb88eb4[_0x30d5('0x17')][_0x30d5('0x39')]({'id':_0x6a1689[_0x30d5('0x38')],'value':_0x6a1689[_0x30d5('0x36')][_0x30d5('0x2d')]()});}else if(_0x6a1689['type']===_0x30d5('0x3a')&&_0x6a1689[_0x30d5('0x3b')]&&_0x6a1689[_0x30d5('0x38')]&&_0x6a1689[_0x30d5('0x35')]){_0x6565e0[_0x6a1689[_0x30d5('0x3b')]]&&_0xb88eb4[_0x30d5('0x17')][_0x30d5('0x39')]({'id':_0x6a1689[_0x30d5('0x38')],'value':_0x6565e0[_0x6a1689[_0x30d5('0x3b')]][_0x30d5('0x2d')]()});}else if(_0x6a1689['type']===_0x30d5('0x3c')&&_0x6a1689['Variable']&&_0x6a1689[_0x30d5('0x3d')][_0x30d5('0x3e')]&&_0x6a1689[_0x30d5('0x38')]&&_0x6a1689['customField']){_0x6565e0[_0x6a1689[_0x30d5('0x3d')][_0x30d5('0x3e')][_0x30d5('0x3f')]()]&&_0xb88eb4['custom_fields'][_0x30d5('0x39')]({'id':_0x6a1689[_0x30d5('0x38')],'value':_0x6565e0[_0x6a1689['Variable']['name'][_0x30d5('0x3f')]()][_0x30d5('0x2d')]()});}});}return _0xb88eb4;}exports[_0x30d5('0x40')]=function(_0x4e5b61,_0x54d61a,_0x5a7895,_0x1f04b5,_0xf0ae5c,_0x36d37d){var _0x2c0860,_0x398a62;_0x36d37d[_0x30d5('0x1c')]=intUtil[_0x30d5('0x41')](_0x36d37d['remoteUri']);_0x36d37d[_0x30d5('0x42')]=intUtil[_0x30d5('0x41')](_0x36d37d[_0x30d5('0x42')]);if(_0xf0ae5c&&_0xf0ae5c[_0x30d5('0x43')]){logger[_0x30d5('0xb')](_0x30d5('0x44'),_0x30d5('0x45'));_0x54d61a[_0x30d5('0x46')]=util[_0x30d5('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36d37d['serverUrl'],_0x54d61a[_0x30d5('0x47')],md5(_0x54d61a[_0x30d5('0x47')]));}else{_0x54d61a[_0x30d5('0x46')]='';}headers['Authorization']=getAuth(_0x36d37d);return getUser(_0x36d37d,_0x1f04b5['email'])[_0x30d5('0x1e')](function(_0x33fbad){_0x2c0860=_0x33fbad;logger[_0x30d5('0xb')](_0x30d5('0x48'),_0x2c0860['id']);return getEndUser(_0x36d37d,_0x54d61a[_0x30d5('0x10')],_0x54d61a['calleridnum']);})[_0x30d5('0x1e')](function(_0xa716dc){_0x398a62=_0xa716dc;logger[_0x30d5('0xb')](_0x30d5('0x49'),_0x398a62['id']);return getTicket(_0x36d37d,_0x2c0860,_0x398a62,_0x5a7895,_0x54d61a);})[_0x30d5('0x1e')](function(_0x5ed66a){if(_0x5ed66a&&_0x5ed66a['id']){logger[_0x30d5('0xb')](_0x30d5('0x1f'));logger[_0x30d5('0xb')](_0x30d5('0x4a'),_0x5ed66a['id']);logger[_0x30d5('0xb')](_0x30d5('0x44'),_0x30d5('0x4b'));emit(util['format'](_0x30d5('0x4c'),_0x1f04b5[_0x30d5('0x3e')]),_0x30d5('0x4d'),{'uri':util[_0x30d5('0xe')](_0x30d5('0x4e'),_0x36d37d[_0x30d5('0x1c')],_0x5ed66a['id'])});}})[_0x30d5('0x4f')](function(_0x2e367d){logger[_0x30d5('0x50')](_0x30d5('0x44'),JSON[_0x30d5('0x30')](_0x2e367d));});};exports['outbound']=function(_0x67ba29,_0x3ffa02,_0x4b1979,_0x5137d2,_0x421900,_0x3c55e1,_0x4ad952){var _0x2f44c8,_0x3ca674;_0x3c55e1['remoteUri']=intUtil[_0x30d5('0x41')](_0x3c55e1[_0x30d5('0x1c')]);_0x3c55e1[_0x30d5('0x42')]=intUtil[_0x30d5('0x41')](_0x3c55e1['serverUrl']);if(_0x4ad952&&_0x4ad952['recordingFormat']&&_0x4ad952[_0x30d5('0x51')]!==_0x30d5('0x52')){logger[_0x30d5('0xb')](_0x30d5('0x53'),'Recording\x20is\x20enabled!');_0x3ffa02[_0x30d5('0x46')]=util[_0x30d5('0xe')](_0x30d5('0x54'),_0x3c55e1[_0x30d5('0x42')],_0x3ffa02[_0x30d5('0x47')],md5(_0x3ffa02[_0x30d5('0x47')]));}headers[_0x30d5('0x55')]=getAuth(_0x3c55e1);return getUser(_0x3c55e1,_0x5137d2[_0x30d5('0x23')])[_0x30d5('0x1e')](function(_0x565709){_0x2f44c8=_0x565709;logger[_0x30d5('0xb')](_0x30d5('0x48'),_0x2f44c8['id']);return getEndUser(_0x3c55e1,_0x3ffa02[_0x30d5('0x56')],_0x3ffa02[_0x30d5('0x57')]);})[_0x30d5('0x1e')](function(_0x2c8a8d){_0x3ca674=_0x2c8a8d;logger[_0x30d5('0xb')](_0x30d5('0x49'),_0x3ca674['id']);return getTicket(_0x3c55e1,_0x2f44c8,_0x3ca674,_0x4b1979,_0x3ffa02);})[_0x30d5('0x1e')](function(_0x1b16ef){if(_0x1b16ef&&_0x1b16ef['id']){logger[_0x30d5('0xb')](_0x30d5('0x1f'));logger[_0x30d5('0xb')](_0x30d5('0x4a'),_0x1b16ef['id']);logger[_0x30d5('0xb')]('[OUTBOUND]',_0x30d5('0x4b'));emit(util[_0x30d5('0xe')](_0x30d5('0x4c'),_0x5137d2[_0x30d5('0x3e')]),_0x30d5('0x4d'),{'uri':util[_0x30d5('0xe')](_0x30d5('0x4e'),_0x3c55e1[_0x30d5('0x1c')],_0x1b16ef['id'])});}})[_0x30d5('0x4f')](function(_0x34dcbb){logger[_0x30d5('0x50')]('[OUTBOUND]',JSON['stringify'](_0x34dcbb));});};exports[_0x30d5('0x58')]=function(_0x251078,_0x513d52,_0x50891d,_0x49239b,_0x25b21d,_0x2b28af){var _0x507e2a,_0x5070c0;_0x2b28af['remoteUri']=intUtil['stripTrailingSlash'](_0x2b28af[_0x30d5('0x1c')]);_0x2b28af[_0x30d5('0x42')]=intUtil['stripTrailingSlash'](_0x2b28af['serverUrl']);if(_0x25b21d&&_0x25b21d[_0x30d5('0x43')]){logger[_0x30d5('0xb')]('['+_0x513d52[_0x30d5('0x59')][_0x30d5('0x5a')]()+']','Recording\x20is\x20enabled!');_0x513d52[_0x30d5('0x46')]=util['format'](_0x30d5('0x54'),_0x2b28af[_0x30d5('0x42')],_0x513d52['uniqueid'],md5(_0x513d52[_0x30d5('0x47')]));}else{_0x513d52[_0x30d5('0x46')]='';}headers['Authorization']=getAuth(_0x2b28af);return getUser(_0x2b28af,'')[_0x30d5('0x1e')](function(_0x3258db){_0x507e2a=_0x3258db;logger['info']('The\x20User\x20ID\x20is:',_0x507e2a['id']);return getEndUser(_0x2b28af,_0x513d52['calleridname'],_0x513d52[_0x30d5('0x11')]);})[_0x30d5('0x1e')](function(_0x48353b){_0x5070c0=_0x48353b;logger[_0x30d5('0xb')](_0x30d5('0x49'),_0x5070c0['id']);return getTicket(_0x2b28af,_0x507e2a,_0x5070c0,_0x50891d,_0x513d52);})[_0x30d5('0x1e')](function(_0x56b1aa){if(_0x56b1aa){logger[_0x30d5('0xb')]('Ticket\x20created!');logger['info'](_0x30d5('0x4a'),_0x56b1aa['id']);}})['catch'](function(_0x125acb){logger[_0x30d5('0x50')]('['+_0x513d52[_0x30d5('0x59')][_0x30d5('0x5a')]()+']',JSON['stringify'](_0x125acb));});}; \ No newline at end of file +var _0x90bc=['stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','trigger:browser:url','lastevent','toUpperCase','request-promise','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','Subjects','Tags','name','custom_fields','mapValues','value','remoteUri','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','toString','debug','[HTTP]','stringify','defaults','map','forEach','includes','string','picklist','type','nameField','content','idField','customField','push','variableName','customVariable','Variable','toLowerCase','queue'];(function(_0x236d35,_0x354aad){var _0x3ae6d5=function(_0x83d4c9){while(--_0x83d4c9){_0x236d35['push'](_0x236d35['shift']());}};_0x3ae6d5(++_0x354aad);}(_0x90bc,0x6e));var _0xc90b=function(_0xac575a,_0x6aa399){_0xac575a=_0xac575a-0x0;var _0x41dd64=_0x90bc[_0xac575a];return _0x41dd64;};'use strict';var _=require('lodash');var rp=require(_0xc90b('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xc90b('0x1'));var intUtil=require(_0xc90b('0x2'));var config=require(_0xc90b('0x3'));var logger=require(_0xc90b('0x4'))(_0xc90b('0x5'));config[_0xc90b('0x6')]=_['defaults'](config[_0xc90b('0x6')],{'host':_0xc90b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xc90b('0x8')};function emit(_0x58e667,_0x51acde,_0x389c62){io['to'](_0x58e667)[_0xc90b('0x9')](_0x51acde,_0x389c62);}function getTicket(_0x5c77db,_0x36a33a,_0x378a69,_0x36b674,_0x38301a){logger[_0xc90b('0xa')](_0xc90b('0xb'));var _0x18c6cf=_[_0xc90b('0xc')]({'responder_id':_0x36a33a['id'],'requester_id':_0x378a69['id'],'name':util[_0xc90b('0xd')]('Caller\x20-\x20%s',_0x38301a['calleridname']),'phone':_0x38301a[_0xc90b('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x36b674[_0xc90b('0xf')],_0x38301a,'\x20'),'description':intUtil['getString'](_0x36b674['Descriptions'],_0x38301a,'
'),'tags':getTags(_0x36b674[_0xc90b('0x10')],_0xc90b('0x11'))},getCustomFields(_0x36b674['Fields'],_0x38301a));_0x18c6cf[_0xc90b('0x12')]=_[_0xc90b('0x13')](_['keyBy'](_0x18c6cf[_0xc90b('0x12')],'id'),_0xc90b('0x14'));return request({'uri':util[_0xc90b('0xd')]('%s/api/v2/tickets',_0x5c77db[_0xc90b('0x15')]),'method':'POST','body':_0x18c6cf})['then'](function(_0xc4410c){logger[_0xc90b('0xa')](_0xc90b('0x16'));return _0xc4410c;});}function getUser(_0x5ad6fd,_0x585814){if(intUtil[_0xc90b('0x17')](_0x585814)){return request({'uri':util['format'](_0xc90b('0x18'),_0x5ad6fd['remoteUri']),'qs':{'email':_0x585814}})[_0xc90b('0x19')](function(_0x59d786){if(_0x59d786[_0xc90b('0x1a')]){logger[_0xc90b('0xa')](_0xc90b('0x1b'));return _['find'](_0x59d786,function(_0x5dcf01){return _0x5dcf01[_0xc90b('0x1c')][_0xc90b('0x1d')]===_0x585814;});}else{logger[_0xc90b('0xa')](_0xc90b('0x1e'));return request({'uri':util[_0xc90b('0xd')](_0xc90b('0x1f'),_0x5ad6fd[_0xc90b('0x15')])})['then'](function(_0x54715a){logger[_0xc90b('0xa')](_0xc90b('0x20'));return _0x54715a;});}});}else{logger[_0xc90b('0xa')](_0xc90b('0x21'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x5ad6fd[_0xc90b('0x15')])})[_0xc90b('0x19')](function(_0x465801){logger[_0xc90b('0xa')](_0xc90b('0x20'));return _0x465801;});}}function getEndUser(_0x30120e,_0x3a0c91,_0x33a5c9){logger['info'](_0xc90b('0x22'),_0x33a5c9);return request({'uri':util['format'](_0xc90b('0x23'),_0x30120e[_0xc90b('0x15')]),'qs':{'phone':_0x33a5c9}})[_0xc90b('0x19')](function(_0x41e2b9){if(_0x41e2b9['length']){logger[_0xc90b('0xa')](_0xc90b('0x24'));return _['find'](_0x41e2b9,{'phone':_0x33a5c9});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xc90b('0xd')](_0xc90b('0x23'),_0x30120e[_0xc90b('0x15')]),'method':'POST','body':{'name':_0x3a0c91,'phone':_0x33a5c9}})['then'](function(_0x354aa8){logger[_0xc90b('0xa')](_0xc90b('0x25'));return _0x354aa8;});}});}function getAuth(_0x2c6a9){return util[_0xc90b('0xd')](_0xc90b('0x26'),new Buffer(_0x2c6a9['apiKey']+':X')[_0xc90b('0x27')]('base64'));}function request(_0xab692c){logger[_0xc90b('0x28')](_0xc90b('0x29'),JSON[_0xc90b('0x2a')](_0xab692c));return rp(_[_0xc90b('0x2b')](_0xab692c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3837ae,_0x748173){var _0x22663c=[];if(_0x3837ae&&_0x3837ae['length']>0x0){_0x22663c=_[_0xc90b('0x2c')](_0x3837ae,_0x748173);}return _0x22663c;}function getCustomFields(_0x260dea,_0x15e495){var _0x50bd51=[];var _0x54c1f5={'custom_fields':[]};if(_0x260dea['length']>0x0){_[_0xc90b('0x2d')](_0x260dea,function(_0x2d2def){if(_[_0xc90b('0x2e')]([_0xc90b('0x2f'),_0xc90b('0x30')],_0x2d2def[_0xc90b('0x31')])&&_0x2d2def[_0xc90b('0x32')]&&!_0x2d2def['customField']){_0x54c1f5[_0x2d2def[_0xc90b('0x32')]['toLowerCase']()]=_0x2d2def[_0xc90b('0x33')][_0xc90b('0x27')]();}else if(_[_0xc90b('0x2e')](['string','picklist'],_0x2d2def['type'])&&_0x2d2def[_0xc90b('0x34')]&&_0x2d2def[_0xc90b('0x35')]){_0x54c1f5['custom_fields'][_0xc90b('0x36')]({'id':_0x2d2def[_0xc90b('0x34')],'value':_0x2d2def['content'][_0xc90b('0x27')]()});}else if(_0x2d2def[_0xc90b('0x31')]==='variable'&&_0x2d2def[_0xc90b('0x37')]&&_0x2d2def[_0xc90b('0x34')]&&_0x2d2def[_0xc90b('0x35')]){_0x15e495[_0x2d2def['variableName']]&&_0x54c1f5[_0xc90b('0x12')][_0xc90b('0x36')]({'id':_0x2d2def[_0xc90b('0x34')],'value':_0x15e495[_0x2d2def[_0xc90b('0x37')]][_0xc90b('0x27')]()});}else if(_0x2d2def[_0xc90b('0x31')]===_0xc90b('0x38')&&_0x2d2def['Variable']&&_0x2d2def[_0xc90b('0x39')][_0xc90b('0x11')]&&_0x2d2def[_0xc90b('0x34')]&&_0x2d2def[_0xc90b('0x35')]){_0x15e495[_0x2d2def[_0xc90b('0x39')][_0xc90b('0x11')][_0xc90b('0x3a')]()]&&_0x54c1f5[_0xc90b('0x12')][_0xc90b('0x36')]({'id':_0x2d2def['idField'],'value':_0x15e495[_0x2d2def[_0xc90b('0x39')]['name'][_0xc90b('0x3a')]()][_0xc90b('0x27')]()});}});}return _0x54c1f5;}exports[_0xc90b('0x3b')]=function(_0x170eaf,_0x58b46f,_0x556a7f,_0x43074c,_0x33f28a,_0x2c81ca){var _0x6cfc9b,_0x42f0bb;_0x2c81ca[_0xc90b('0x15')]=intUtil[_0xc90b('0x3c')](_0x2c81ca['remoteUri']);_0x2c81ca[_0xc90b('0x3d')]=intUtil['stripTrailingSlash'](_0x2c81ca[_0xc90b('0x3d')]);if(_0x33f28a&&_0x33f28a[_0xc90b('0x3e')]){logger[_0xc90b('0xa')](_0xc90b('0x3f'),_0xc90b('0x40'));_0x58b46f[_0xc90b('0x41')]=util['format'](_0xc90b('0x42'),_0x2c81ca[_0xc90b('0x3d')],_0x58b46f[_0xc90b('0x43')],md5(_0x58b46f['uniqueid']));}else{_0x58b46f['recordingURL']='';}headers[_0xc90b('0x44')]=getAuth(_0x2c81ca);return getUser(_0x2c81ca,_0x43074c[_0xc90b('0x1d')])['then'](function(_0x513904){_0x6cfc9b=_0x513904;logger[_0xc90b('0xa')]('The\x20User\x20ID\x20is:',_0x6cfc9b['id']);return getEndUser(_0x2c81ca,_0x58b46f[_0xc90b('0x45')],_0x58b46f['calleridnum']);})[_0xc90b('0x19')](function(_0x16d3f8){_0x42f0bb=_0x16d3f8;logger[_0xc90b('0xa')](_0xc90b('0x46'),_0x42f0bb['id']);return getTicket(_0x2c81ca,_0x6cfc9b,_0x42f0bb,_0x556a7f,_0x58b46f);})[_0xc90b('0x19')](function(_0x1d39ab){if(_0x1d39ab&&_0x1d39ab['id']){logger[_0xc90b('0xa')](_0xc90b('0x16'));logger[_0xc90b('0xa')](_0xc90b('0x47'),_0x1d39ab['id']);logger[_0xc90b('0xa')](_0xc90b('0x3f'),_0xc90b('0x48'));emit(util[_0xc90b('0xd')](_0xc90b('0x49'),_0x43074c['name']),'trigger:browser:url',{'uri':util[_0xc90b('0xd')](_0xc90b('0x4a'),_0x2c81ca[_0xc90b('0x15')],_0x1d39ab['id'])});}})[_0xc90b('0x4b')](function(_0x1628ab){logger[_0xc90b('0x4c')]('[QUEUE]',JSON['stringify'](_0x1628ab));});};exports[_0xc90b('0x4d')]=function(_0x56f882,_0x191e06,_0x52ac05,_0xa94e31,_0x42e0c7,_0x238764,_0x6a2bc){var _0x194243,_0x8d34f7;_0x238764['remoteUri']=intUtil[_0xc90b('0x3c')](_0x238764[_0xc90b('0x15')]);_0x238764[_0xc90b('0x3d')]=intUtil['stripTrailingSlash'](_0x238764['serverUrl']);if(_0x6a2bc&&_0x6a2bc[_0xc90b('0x4e')]&&_0x6a2bc[_0xc90b('0x4e')]!==_0xc90b('0x4f')){logger[_0xc90b('0xa')](_0xc90b('0x50'),_0xc90b('0x40'));_0x191e06[_0xc90b('0x41')]=util[_0xc90b('0xd')](_0xc90b('0x42'),_0x238764['serverUrl'],_0x191e06['uniqueid'],md5(_0x191e06[_0xc90b('0x43')]));}headers['Authorization']=getAuth(_0x238764);return getUser(_0x238764,_0xa94e31[_0xc90b('0x1d')])[_0xc90b('0x19')](function(_0x250e26){_0x194243=_0x250e26;logger['info'](_0xc90b('0x51'),_0x194243['id']);return getEndUser(_0x238764,_0x191e06['destcalleridname'],_0x191e06['destcalleridnum']);})[_0xc90b('0x19')](function(_0x3b1ac0){_0x8d34f7=_0x3b1ac0;logger[_0xc90b('0xa')](_0xc90b('0x46'),_0x8d34f7['id']);return getTicket(_0x238764,_0x194243,_0x8d34f7,_0x52ac05,_0x191e06);})[_0xc90b('0x19')](function(_0x41914d){if(_0x41914d&&_0x41914d['id']){logger[_0xc90b('0xa')](_0xc90b('0x16'));logger[_0xc90b('0xa')](_0xc90b('0x47'),_0x41914d['id']);logger[_0xc90b('0xa')](_0xc90b('0x50'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0xa94e31['name']),_0xc90b('0x52'),{'uri':util[_0xc90b('0xd')](_0xc90b('0x4a'),_0x238764[_0xc90b('0x15')],_0x41914d['id'])});}})['catch'](function(_0x4de7e7){logger['error']('[OUTBOUND]',JSON[_0xc90b('0x2a')](_0x4de7e7));});};exports['unmanaged']=function(_0x2c230c,_0x49d51c,_0x36ebc5,_0x19d76d,_0x3bfa46,_0x43d94e){var _0x11dd88,_0x54acc6;_0x43d94e['remoteUri']=intUtil['stripTrailingSlash'](_0x43d94e['remoteUri']);_0x43d94e[_0xc90b('0x3d')]=intUtil[_0xc90b('0x3c')](_0x43d94e[_0xc90b('0x3d')]);if(_0x3bfa46&&_0x3bfa46[_0xc90b('0x3e')]){logger[_0xc90b('0xa')]('['+_0x49d51c[_0xc90b('0x53')][_0xc90b('0x54')]()+']',_0xc90b('0x40'));_0x49d51c[_0xc90b('0x41')]=util[_0xc90b('0xd')](_0xc90b('0x42'),_0x43d94e['serverUrl'],_0x49d51c['uniqueid'],md5(_0x49d51c['uniqueid']));}else{_0x49d51c[_0xc90b('0x41')]='';}headers[_0xc90b('0x44')]=getAuth(_0x43d94e);return getUser(_0x43d94e,'')['then'](function(_0x436b83){_0x11dd88=_0x436b83;logger['info'](_0xc90b('0x51'),_0x11dd88['id']);return getEndUser(_0x43d94e,_0x49d51c[_0xc90b('0x45')],_0x49d51c['calleridnum']);})[_0xc90b('0x19')](function(_0x1c58b5){_0x54acc6=_0x1c58b5;logger[_0xc90b('0xa')](_0xc90b('0x46'),_0x54acc6['id']);return getTicket(_0x43d94e,_0x11dd88,_0x54acc6,_0x36ebc5,_0x49d51c);})['then'](function(_0x16c9e2){if(_0x16c9e2){logger[_0xc90b('0xa')]('Ticket\x20created!');logger[_0xc90b('0xa')](_0xc90b('0x47'),_0x16c9e2['id']);}})[_0xc90b('0x4b')](function(_0x4e2cfa){logger[_0xc90b('0x4c')]('['+_0x49d51c['lastevent'][_0xc90b('0x54')]()+']',JSON[_0xc90b('0x2a')](_0x4e2cfa));});}; \ 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 d261a00..c200d42 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 _0xaf7d=['Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','agentEmail','info','Getting\x20user\x20with\x20email','length','userId','User\x20found:','Admin\x20selected','userEmail','message','/api/lookup?q=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','POST','/api/tasks','getString','Subjects','Descriptions','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','remoteUri','serverUrl','username','toLowerCase','outbound','destcalleridnum','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]'];(function(_0x395cf4,_0x5c2e80){var _0x33ae78=function(_0x2bc346){while(--_0x2bc346){_0x395cf4['push'](_0x395cf4['shift']());}};_0x33ae78(++_0x5c2e80);}(_0xaf7d,0x1a7));var _0xdaf7=function(_0x45589c,_0x18f1ca){_0x45589c=_0x45589c-0x0;var _0x5745a0=_0xaf7d[_0x45589c];return _0x5745a0;};'use strict';var _=require(_0xdaf7('0x0'));var rp=require(_0xdaf7('0x1'));var md5=require(_0xdaf7('0x2'));var util=require(_0xdaf7('0x3'));var moment=require('moment');var Promise=require(_0xdaf7('0x4'));var Redis=require(_0xdaf7('0x5'));var intUtil=require(_0xdaf7('0x6'));var config=require(_0xdaf7('0x7'));var logger=require(_0xdaf7('0x8'))(_0xdaf7('0x9'));config[_0xdaf7('0xa')]=_[_0xdaf7('0xb')](config['redis'],{'host':_0xdaf7('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x1a7bba,_0x4fd6fd,_0x5e30f1,_0x448cf7){return new Promise(function(_0x4da195,_0x27b13b){var _0x4f6a8f=![];var _0x2d575c={'method':_0xdaf7('0xd'),'uri':_0x448cf7+_0xdaf7('0xe'),'json':!![]};_0x2d575c[_0xdaf7('0xf')]=_0x5e30f1;logger['info']('Getting\x20admin\x20information');return rp(_0x2d575c)[_0xdaf7('0x10')](function(_0x2c8ab8){if(_0x2c8ab8){var _0x34fb7f=_0x2c8ab8[_0xdaf7('0x11')];var _0x1f262e=null;for(_0x1f262e=0x0;_0x1f262e<_0x34fb7f['length'];_0x1f262e++){if(_0x34fb7f[_0x1f262e][_0xdaf7('0x12')]===_0x1a7bba[_0xdaf7('0x13')]){_0x1a7bba[_0xdaf7('0x14')]=_0x34fb7f[_0x1f262e]['id'];_0x4f6a8f=!![];}}if(_0x4f6a8f){logger['info'](_0xdaf7('0x15'),_0x1a7bba[_0xdaf7('0x14')]);_0x4da195(_0x1a7bba);}else{_0x27b13b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x27b13b({'statusCode':0x194,'message':_0xdaf7('0x16')});}})[_0xdaf7('0x17')](function(_0x2b385e){logger[_0xdaf7('0x18')]('['+[_0x4fd6fd[_0xdaf7('0x19')]()]+']',_0x2b385e['message']);_0x27b13b(_0x2b385e);});});}function getUser(_0x41e48f,_0x284fd7,_0x48ea5e){return function(_0x52987c){return new Promise(function(_0x356245,_0x12672c){var _0x4bc13e={'method':'GET','uri':_0x48ea5e+'/api/selector/owners','json':!![]};_0x4bc13e['headers']=_0x284fd7;logger['info']('Getting\x20user\x20list');return rp(_0x4bc13e)[_0xdaf7('0x10')](function(_0x35c8e4){if(_0x35c8e4){var _0x499dc9=_0x35c8e4['users'];var _0x58f902=![];var _0x3a30fb=null;if(_0x52987c[_0xdaf7('0x1a')]!==null){logger[_0xdaf7('0x1b')](_0xdaf7('0x1c'),_0x52987c[_0xdaf7('0x1a')]);_0x52987c['userEmail']=_0x52987c[_0xdaf7('0x1a')];for(_0x3a30fb=0x0;_0x3a30fb<_0x499dc9[_0xdaf7('0x1d')];_0x3a30fb++){if(_0x499dc9[_0x3a30fb][_0xdaf7('0x12')]===_0x52987c[_0xdaf7('0x1a')]){_0x58f902=!![];_0x52987c[_0xdaf7('0x1e')]=_0x499dc9[_0x3a30fb]['id'];logger[_0xdaf7('0x1b')](_0xdaf7('0x1f'),_0x52987c['userId']);}}}if(!_0x58f902){logger[_0xdaf7('0x1b')](_0xdaf7('0x20'));_0x52987c[_0xdaf7('0x21')]=_0x52987c[_0xdaf7('0x13')];_0x52987c[_0xdaf7('0x1e')]=_0x52987c[_0xdaf7('0x14')];_0x58f902=!![];}if(_0x58f902){_0x356245(_0x52987c);}else{_0x12672c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x12672c({'statusCode':0x194,'message':_0xdaf7('0x16')});}})['catch'](function(_0x4ae136){logger['error']('['+[_0x41e48f['toUpperCase']()]+']',_0x4ae136[_0xdaf7('0x22')]);_0x12672c(_0x4ae136);});});};}function searchContact(_0xb41c9f,_0x31871d,_0x2f72f4,_0x1115f0){return new Promise(function(_0x10debb,_0x54021e){var _0x1bffec={'method':_0xdaf7('0xd'),'headers':_0x31871d,'uri':_0xb41c9f+_0xdaf7('0x23')+_0x1115f0+'&f='+_0x2f72f4+'&entities=contact','json':!![]};rp(_0x1bffec)[_0xdaf7('0x10')](function(_0x512ec6){var _0x1a1ea0=_['find'](_0x512ec6[_0xdaf7('0x24')][_0xdaf7('0x24')],[_0x2f72f4,_0x1115f0]);_0x10debb(_0x1a1ea0);})['catch'](function(_0x1caaf9){_0x54021e(_0x1caaf9);});});}function getEndUser(_0x6eb42f,_0x36a41e,_0x89fcd2){return function(_0xc130bf){return new Promise(function(_0x14c26c,_0xcad84a){logger[_0xdaf7('0x1b')](util[_0xdaf7('0x25')](_0xdaf7('0x26'),_0xc130bf[_0xdaf7('0x27')]));searchContact(_0x89fcd2,_0x36a41e,_0xdaf7('0x28'),_0xc130bf[_0xdaf7('0x27')])[_0xdaf7('0x10')](function(_0x2ade91){if(_0x2ade91){_0xc130bf[_0xdaf7('0x29')]=_0x2ade91['id'];logger['info'](_0xdaf7('0x2a'),_0xc130bf[_0xdaf7('0x29')]);return _0x14c26c(_0xc130bf);}searchContact(_0x89fcd2,_0x36a41e,_0xdaf7('0x2b'),_0xc130bf[_0xdaf7('0x27')])['then'](function(_0x133a34){if(_0x133a34){_0xc130bf[_0xdaf7('0x29')]=_0x133a34['id'];logger[_0xdaf7('0x1b')](_0xdaf7('0x2c'),_0xc130bf[_0xdaf7('0x29')]);return _0x14c26c(_0xc130bf);}createEndUser(_0xc130bf,_0x6eb42f,_0x36a41e,_0x89fcd2)[_0xdaf7('0x10')](function(_0x1f8bc1){logger['info'](_0xdaf7('0x2d'),_0x1f8bc1['endUserId']);return _0x14c26c(_0x1f8bc1);});});})[_0xdaf7('0x17')](function(_0x2939a3){_0xcad84a(_0x2939a3);});});};}function createEndUser(_0x3562f0,_0x51ee4d,_0x423a56,_0x567328){return new Promise(function(_0x42c895,_0x3c8727){var _0x2516c3=moment();var _0x243268={'method':'POST','uri':_0x567328+_0xdaf7('0x2e'),'body':{'contact':{'last_name':_0x3562f0[_0xdaf7('0x27')],'work_number':_0x3562f0[_0xdaf7('0x27')],'mobile_number':_0x3562f0[_0xdaf7('0x27')],'owner_id':_0x3562f0['userId'],'created_at':_0x2516c3[_0xdaf7('0x25')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x243268['headers']=_0x423a56;logger[_0xdaf7('0x1b')](_0xdaf7('0x2f'));return rp(_0x243268)[_0xdaf7('0x10')](function(_0x2a1ae9){_0x3562f0['endUserId']=_0x2a1ae9[_0xdaf7('0x30')]['id'];_0x42c895(_0x3562f0);})[_0xdaf7('0x17')](function(_0x9dc283){logger['error']('['+[_0x51ee4d[_0xdaf7('0x19')]()]+']',_0x9dc283[_0xdaf7('0x22')]);_0x3c8727(_0x9dc283[_0xdaf7('0x22')]);});});}function getTicket(_0x28216a,_0x3c7356,_0x1b39d1,_0xf6965e,_0x567df5){return function(_0x2baccf){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x39fc34,_0x485acd){var _0x39e772=moment();var _0x1abdef={'method':_0xdaf7('0x31'),'uri':_0x1b39d1+_0xdaf7('0x32'),'body':{'title':intUtil[_0xdaf7('0x33')](_0xf6965e[_0xdaf7('0x34')],_0x567df5,'\x20'),'description':intUtil[_0xdaf7('0x33')](_0xf6965e[_0xdaf7('0x35')],_0x567df5,'\x0a'),'owner_id':_0x2baccf[_0xdaf7('0x1e')],'creater_id':_0x2baccf[_0xdaf7('0x14')],'targetable_id':_0x2baccf[_0xdaf7('0x29')],'targetable_type':'Contact','created_at':_0x39e772[_0xdaf7('0x25')](_0xdaf7('0x36')),'due_date':_0x39e772[_0xdaf7('0x37')](0x1e,'m')[_0xdaf7('0x25')](_0xdaf7('0x36'))},'json':!![]};_0x1abdef[_0xdaf7('0xf')]=_0x3c7356;return rp(_0x1abdef)['then'](function(_0x2e4e73){_0x2baccf[_0xdaf7('0x38')]=_0x2e4e73[_0xdaf7('0x39')]['id'];logger[_0xdaf7('0x1b')](_0xdaf7('0x3a'),_0x2baccf[_0xdaf7('0x38')]);_0x39fc34(_0x2baccf);})[_0xdaf7('0x17')](function(_0x3877f5){logger[_0xdaf7('0x18')]('['+[_0x28216a[_0xdaf7('0x19')]()]+']',_0x3877f5['message']);_0x485acd(_0x3877f5[_0xdaf7('0x22')]);});});};}function emit(_0x114bf3,_0x5e0f45,_0x523208){var _0x3e935a={'uri':_0x114bf3+_0xdaf7('0x3b')+_0x523208};io['to'](util['format'](_0xdaf7('0x3c'),_0x5e0f45))[_0xdaf7('0x3d')]('trigger:browser:url',_0x3e935a);}exports['cs']=function(_0x3a36ef,_0x307dc0,_0x282cfe,_0x23f733,_0x50f1d3,_0x40c1fe,_0x5667bd,_0xd38bb5){var _0x4497cd={};var _0x2d2b94={'Authorization':_0xdaf7('0x3e')+_0x40c1fe['apiKey']};_0x40c1fe['remoteUri']=intUtil['stripTrailingSlash'](_0x40c1fe[_0xdaf7('0x3f')]);_0x40c1fe[_0xdaf7('0x40')]=intUtil['stripTrailingSlash'](_0x40c1fe[_0xdaf7('0x40')]);var _0xdad4c=_0x40c1fe[_0xdaf7('0x3f')];_0x4497cd[_0xdaf7('0x13')]=_0x40c1fe[_0xdaf7('0x41')];_0x4497cd[_0xdaf7('0x27')]=_0xd38bb5[_0xdaf7('0x42')]()===_0xdaf7('0x43')?_0x307dc0[_0xdaf7('0x44')]:_0x307dc0['calleridnum'];_0x4497cd['callDirection']=_0xd38bb5===_0xdaf7('0x45')||_0xd38bb5===_0xdaf7('0x46')?_0xdaf7('0x45'):'outbound';if(_0x23f733){_0x4497cd[_0xdaf7('0x1a')]=_0x23f733[_0xdaf7('0x12')];}var _0x422204=util['format'](_0xdaf7('0x47'),_0x40c1fe['serverUrl'],_0x307dc0[_0xdaf7('0x48')],md5(_0x307dc0[_0xdaf7('0x48')]));if(_0x50f1d3&&_0x50f1d3[_0xdaf7('0x49')]){logger[_0xdaf7('0x1b')](_0xdaf7('0x4a'),_0xdaf7('0x4b'));_0x307dc0[_0xdaf7('0x4c')]=_0x422204;}else if(_0x5667bd&&_0x5667bd[_0xdaf7('0x4d')]&&_0x5667bd[_0xdaf7('0x4d')]!=='none'){logger[_0xdaf7('0x1b')](_0xdaf7('0x4e'),'Recording\x20is\x20enabled!');_0x307dc0[_0xdaf7('0x4c')]=_0x422204;}else{_0x307dc0[_0xdaf7('0x4c')]='';}return getAdminId(_0x4497cd,_0xd38bb5,_0x2d2b94,_0xdad4c)['then'](getUser(_0xd38bb5,_0x2d2b94,_0xdad4c))[_0xdaf7('0x10')](getEndUser(_0xd38bb5,_0x2d2b94,_0xdad4c))[_0xdaf7('0x10')](getTicket(_0xd38bb5,_0x2d2b94,_0xdad4c,_0x282cfe,_0x307dc0))[_0xdaf7('0x10')](function(_0xc80958){logger[_0xdaf7('0x1b')](util[_0xdaf7('0x25')]('The\x20ticket\x20ID\x20is:\x20%s',_0xc80958[_0xdaf7('0x38')]));if(_0xd38bb5!==_0xdaf7('0x46')){logger[_0xdaf7('0x1b')]('['+[_0xd38bb5['toUpperCase']()]+']',_0xdaf7('0x4f'));emit(_0xdad4c,_0x23f733[_0xdaf7('0x50')],_0xc80958[_0xdaf7('0x29')]);}})[_0xdaf7('0x17')](function(_0x191508){logger[_0xdaf7('0x18')]('['+[_0xd38bb5[_0xdaf7('0x19')]()]+_0xdaf7('0x51'),util[_0xdaf7('0x52')](_0x191508,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0a09=['Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','headers','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','YYYY-MM-DDTHH:mm:ss','ticketId','task','/contacts/','trigger:browser:url','apiKey','stripTrailingSlash','remoteUri','serverUrl','username','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','/api/selector/owners','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','GET','Getting\x20user\x20list','agentEmail','userId','User\x20found:','message','&f=','find','contacts','format'];(function(_0x389088,_0x30b5cb){var _0x5aa817=function(_0x2d3b18){while(--_0x2d3b18){_0x389088['push'](_0x389088['shift']());}};_0x5aa817(++_0x30b5cb);}(_0x0a09,0x109));var _0x90a0=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0x0a09[_0x10d34b];return _0x92b0bf;};'use strict';var _=require(_0x90a0('0x0'));var rp=require(_0x90a0('0x1'));var md5=require(_0x90a0('0x2'));var util=require('util');var moment=require(_0x90a0('0x3'));var Promise=require(_0x90a0('0x4'));var Redis=require(_0x90a0('0x5'));var intUtil=require(_0x90a0('0x6'));var config=require('../../../../config/environment');var logger=require(_0x90a0('0x7'))(_0x90a0('0x8'));config[_0x90a0('0x9')]=_[_0x90a0('0xa')](config[_0x90a0('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x90a0('0x9')]));function getAdminId(_0x97de4b,_0x36ecf4,_0x4e7256,_0x3e4dd3){return new Promise(function(_0x487aa6,_0x29f30c){var _0x3d8391=![];var _0x40cfd7={'method':'GET','uri':_0x3e4dd3+_0x90a0('0xb'),'json':!![]};_0x40cfd7['headers']=_0x4e7256;logger[_0x90a0('0xc')](_0x90a0('0xd'));return rp(_0x40cfd7)[_0x90a0('0xe')](function(_0x462517){if(_0x462517){var _0x201f53=_0x462517[_0x90a0('0xf')];var _0x212ad6=null;for(_0x212ad6=0x0;_0x212ad6<_0x201f53[_0x90a0('0x10')];_0x212ad6++){if(_0x201f53[_0x212ad6][_0x90a0('0x11')]===_0x97de4b[_0x90a0('0x12')]){_0x97de4b[_0x90a0('0x13')]=_0x201f53[_0x212ad6]['id'];_0x3d8391=!![];}}if(_0x3d8391){logger['info'](_0x90a0('0x14'),_0x97de4b[_0x90a0('0x13')]);_0x487aa6(_0x97de4b);}else{_0x29f30c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x29f30c({'statusCode':0x194,'message':_0x90a0('0x15')});}})[_0x90a0('0x16')](function(_0x3512c1){logger[_0x90a0('0x17')]('['+[_0x36ecf4[_0x90a0('0x18')]()]+']',_0x3512c1['message']);_0x29f30c(_0x3512c1);});});}function getUser(_0x5eca06,_0x4fc1df,_0x208e20){return function(_0x966b5b){return new Promise(function(_0x143677,_0x2bfb70){var _0x256440={'method':_0x90a0('0x19'),'uri':_0x208e20+_0x90a0('0xb'),'json':!![]};_0x256440['headers']=_0x4fc1df;logger[_0x90a0('0xc')](_0x90a0('0x1a'));return rp(_0x256440)[_0x90a0('0xe')](function(_0x41df1b){if(_0x41df1b){var _0xffc3f4=_0x41df1b[_0x90a0('0xf')];var _0x23f627=![];var _0x223146=null;if(_0x966b5b[_0x90a0('0x1b')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x966b5b['agentEmail']);_0x966b5b['userEmail']=_0x966b5b[_0x90a0('0x1b')];for(_0x223146=0x0;_0x223146<_0xffc3f4[_0x90a0('0x10')];_0x223146++){if(_0xffc3f4[_0x223146][_0x90a0('0x11')]===_0x966b5b[_0x90a0('0x1b')]){_0x23f627=!![];_0x966b5b[_0x90a0('0x1c')]=_0xffc3f4[_0x223146]['id'];logger['info'](_0x90a0('0x1d'),_0x966b5b[_0x90a0('0x1c')]);}}}if(!_0x23f627){logger['info']('Admin\x20selected');_0x966b5b['userEmail']=_0x966b5b[_0x90a0('0x12')];_0x966b5b[_0x90a0('0x1c')]=_0x966b5b[_0x90a0('0x13')];_0x23f627=!![];}if(_0x23f627){_0x143677(_0x966b5b);}else{_0x2bfb70({'statusCode':0x194,'message':_0x90a0('0x15')});}}else{_0x2bfb70({'statusCode':0x194,'message':_0x90a0('0x15')});}})[_0x90a0('0x16')](function(_0x151f4b){logger[_0x90a0('0x17')]('['+[_0x5eca06[_0x90a0('0x18')]()]+']',_0x151f4b[_0x90a0('0x1e')]);_0x2bfb70(_0x151f4b);});});};}function searchContact(_0x4f2f89,_0x225bb6,_0x1a0d5b,_0x17714e){return new Promise(function(_0x5b24b7,_0x5bfdca){var _0x7aad01={'method':_0x90a0('0x19'),'headers':_0x225bb6,'uri':_0x4f2f89+'/api/lookup?q='+_0x17714e+_0x90a0('0x1f')+_0x1a0d5b+'&entities=contact','json':!![]};rp(_0x7aad01)[_0x90a0('0xe')](function(_0x2a4339){var _0x24cf8f=_[_0x90a0('0x20')](_0x2a4339[_0x90a0('0x21')][_0x90a0('0x21')],[_0x1a0d5b,_0x17714e]);_0x5b24b7(_0x24cf8f);})[_0x90a0('0x16')](function(_0x82e9ad){_0x5bfdca(_0x82e9ad);});});}function getEndUser(_0x897d1b,_0x35faad,_0x191785){return function(_0x5dad1d){return new Promise(function(_0x5463c0,_0x153f41){logger[_0x90a0('0xc')](util[_0x90a0('0x22')](_0x90a0('0x23'),_0x5dad1d['contactNumber']));searchContact(_0x191785,_0x35faad,_0x90a0('0x24'),_0x5dad1d[_0x90a0('0x25')])['then'](function(_0x1cfee9){if(_0x1cfee9){_0x5dad1d[_0x90a0('0x26')]=_0x1cfee9['id'];logger[_0x90a0('0xc')](_0x90a0('0x27'),_0x5dad1d[_0x90a0('0x26')]);return _0x5463c0(_0x5dad1d);}searchContact(_0x191785,_0x35faad,_0x90a0('0x28'),_0x5dad1d[_0x90a0('0x25')])['then'](function(_0x2f5ffd){if(_0x2f5ffd){_0x5dad1d['endUserId']=_0x2f5ffd['id'];logger[_0x90a0('0xc')](_0x90a0('0x29'),_0x5dad1d[_0x90a0('0x26')]);return _0x5463c0(_0x5dad1d);}createEndUser(_0x5dad1d,_0x897d1b,_0x35faad,_0x191785)[_0x90a0('0xe')](function(_0x1bd929){logger[_0x90a0('0xc')](_0x90a0('0x2a'),_0x1bd929[_0x90a0('0x26')]);return _0x5463c0(_0x1bd929);});});})['catch'](function(_0x2ff938){_0x153f41(_0x2ff938);});});};}function createEndUser(_0x1e0033,_0x4fc2b0,_0xc9b90b,_0x506b45){return new Promise(function(_0xc058c3,_0x1ae333){var _0x100a45=moment();var _0x3e296e={'method':_0x90a0('0x2b'),'uri':_0x506b45+'/api/contacts','body':{'contact':{'last_name':_0x1e0033[_0x90a0('0x25')],'work_number':_0x1e0033[_0x90a0('0x25')],'mobile_number':_0x1e0033[_0x90a0('0x25')],'owner_id':_0x1e0033['userId'],'created_at':_0x100a45['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x3e296e[_0x90a0('0x2c')]=_0xc9b90b;logger[_0x90a0('0xc')](_0x90a0('0x2d'));return rp(_0x3e296e)[_0x90a0('0xe')](function(_0x259944){_0x1e0033[_0x90a0('0x26')]=_0x259944[_0x90a0('0x2e')]['id'];_0xc058c3(_0x1e0033);})[_0x90a0('0x16')](function(_0x24967a){logger[_0x90a0('0x17')]('['+[_0x4fc2b0[_0x90a0('0x18')]()]+']',_0x24967a[_0x90a0('0x1e')]);_0x1ae333(_0x24967a[_0x90a0('0x1e')]);});});}function getTicket(_0xc1ed38,_0x457bf3,_0x56bdf6,_0x2f75dd,_0x52b996){return function(_0x5bb9ca){logger[_0x90a0('0xc')](_0x90a0('0x2f'));return new Promise(function(_0x405c99,_0x556143){var _0x3938d5=moment();var _0x220346={'method':_0x90a0('0x2b'),'uri':_0x56bdf6+_0x90a0('0x30'),'body':{'title':intUtil['getString'](_0x2f75dd[_0x90a0('0x31')],_0x52b996,'\x20'),'description':intUtil['getString'](_0x2f75dd['Descriptions'],_0x52b996,'\x0a'),'owner_id':_0x5bb9ca['userId'],'creater_id':_0x5bb9ca[_0x90a0('0x13')],'targetable_id':_0x5bb9ca[_0x90a0('0x26')],'targetable_type':'Contact','created_at':_0x3938d5[_0x90a0('0x22')](_0x90a0('0x32')),'due_date':_0x3938d5['add'](0x1e,'m')['format'](_0x90a0('0x32'))},'json':!![]};_0x220346[_0x90a0('0x2c')]=_0x457bf3;return rp(_0x220346)['then'](function(_0x3d96ce){_0x5bb9ca[_0x90a0('0x33')]=_0x3d96ce[_0x90a0('0x34')]['id'];logger[_0x90a0('0xc')]('Task\x20created:',_0x5bb9ca['ticketId']);_0x405c99(_0x5bb9ca);})[_0x90a0('0x16')](function(_0x6f8037){logger[_0x90a0('0x17')]('['+[_0xc1ed38[_0x90a0('0x18')]()]+']',_0x6f8037[_0x90a0('0x1e')]);_0x556143(_0x6f8037[_0x90a0('0x1e')]);});});};}function emit(_0x4662a7,_0x45d201,_0x1d40d1){var _0x3ae42b={'uri':_0x4662a7+_0x90a0('0x35')+_0x1d40d1};io['to'](util[_0x90a0('0x22')]('user:%s',_0x45d201))['emit'](_0x90a0('0x36'),_0x3ae42b);}exports['cs']=function(_0x49f4e3,_0x329e3a,_0x485ac4,_0x29691c,_0x3e6918,_0x27ef8f,_0x1df22b,_0x4a1389){var _0x2ca5d2={};var _0xe1f6d7={'Authorization':'Token\x20token='+_0x27ef8f[_0x90a0('0x37')]};_0x27ef8f['remoteUri']=intUtil[_0x90a0('0x38')](_0x27ef8f[_0x90a0('0x39')]);_0x27ef8f[_0x90a0('0x3a')]=intUtil['stripTrailingSlash'](_0x27ef8f[_0x90a0('0x3a')]);var _0x1c596f=_0x27ef8f[_0x90a0('0x39')];_0x2ca5d2[_0x90a0('0x12')]=_0x27ef8f[_0x90a0('0x3b')];_0x2ca5d2['contactNumber']=_0x4a1389['toLowerCase']()===_0x90a0('0x3c')?_0x329e3a[_0x90a0('0x3d')]:_0x329e3a[_0x90a0('0x3e')];_0x2ca5d2['callDirection']=_0x4a1389===_0x90a0('0x3f')||_0x4a1389==='unmanaged'?_0x90a0('0x3f'):_0x90a0('0x3c');if(_0x29691c){_0x2ca5d2['agentEmail']=_0x29691c['email'];}var _0x3bff17=util[_0x90a0('0x22')](_0x90a0('0x40'),_0x27ef8f[_0x90a0('0x3a')],_0x329e3a[_0x90a0('0x41')],md5(_0x329e3a[_0x90a0('0x41')]));if(_0x3e6918&&_0x3e6918[_0x90a0('0x42')]){logger[_0x90a0('0xc')]('[QUEUE]',_0x90a0('0x43'));_0x329e3a[_0x90a0('0x44')]=_0x3bff17;}else if(_0x1df22b&&_0x1df22b['recordingFormat']&&_0x1df22b['recordingFormat']!==_0x90a0('0x45')){logger[_0x90a0('0xc')](_0x90a0('0x46'),_0x90a0('0x43'));_0x329e3a[_0x90a0('0x44')]=_0x3bff17;}else{_0x329e3a[_0x90a0('0x44')]='';}return getAdminId(_0x2ca5d2,_0x4a1389,_0xe1f6d7,_0x1c596f)[_0x90a0('0xe')](getUser(_0x4a1389,_0xe1f6d7,_0x1c596f))[_0x90a0('0xe')](getEndUser(_0x4a1389,_0xe1f6d7,_0x1c596f))[_0x90a0('0xe')](getTicket(_0x4a1389,_0xe1f6d7,_0x1c596f,_0x485ac4,_0x329e3a))['then'](function(_0x104a87){logger[_0x90a0('0xc')](util['format'](_0x90a0('0x47'),_0x104a87['ticketId']));if(_0x4a1389!=='unmanaged'){logger[_0x90a0('0xc')]('['+[_0x4a1389[_0x90a0('0x18')]()]+']',_0x90a0('0x48'));emit(_0x1c596f,_0x29691c['name'],_0x104a87[_0x90a0('0x26')]);}})[_0x90a0('0x16')](function(_0x41bfaf){logger[_0x90a0('0x17')]('['+[_0x4a1389[_0x90a0('0x18')]()]+_0x90a0('0x49'),util[_0x90a0('0x4a')](_0x41bfaf,{'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 8508cd5..498a6fb 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 _0x169c=['[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','zoho','desk','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','log','EVENT\x20UNKNOWN','unmanaged','freshdesk','vtiger','unknown\x20integration','../../../../config/logger','error'];(function(_0x5091e6,_0x375dd4){var _0x101c24=function(_0x3d83f7){while(--_0x3d83f7){_0x5091e6['push'](_0x5091e6['shift']());}};_0x101c24(++_0x375dd4);}(_0x169c,0xe3));var _0xc169=function(_0x11500e,_0x457be0){_0x11500e=_0x11500e-0x0;var _0x135e1a=_0x169c[_0x11500e];return _0x135e1a;};'use strict';var _=require(_0xc169('0x0'));var util=require(_0xc169('0x1'));var zendesk=require(_0xc169('0x2'));var salesforce=require(_0xc169('0x3'));var sugarcrm=require(_0xc169('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0xc169('0x5'));var desk=require('./desk');var vtiger=require(_0xc169('0x6'));var servicenow=require(_0xc169('0x7'));var dynamics365=require(_0xc169('0x8'));var freshsales=require('./freshsales');var integrations=[_0xc169('0x9'),_0xc169('0xa'),_0xc169('0xb'),'freshdesk',_0xc169('0xc'),_0xc169('0xd'),'vtiger',_0xc169('0xe'),_0xc169('0xf'),_0xc169('0x10')];exports[_0xc169('0x11')]=function(_0x59718a,_0x36d327,_0xbe503d,_0x2e10e1,_0x3034d8,_0x5d006b){if(_0xbe503d){if(_[_0xc169('0x12')](integrations,_0x59718a[_0xc169('0x13')][_0xc169('0x14')]())){try{var _0x267fdb=null;var _0x502a80='';var _0x59f46d=_0xbe503d[_0x59718a[_0xc169('0x13')][_0xc169('0x14')]()];if(_0x59f46d){var _0x1da616=_0x59f46d[_0x59718a['data2']];if(_0x1da616){var _0x2ec13d=_[_0xc169('0x15')](_0x1da616[_0xc169('0x16')],{'id':parseInt(_0x59718a[_0xc169('0x17')],0xa)});if(_0x2ec13d){if(_0x2e10e1){if(_0x3034d8&&_0x36d327['queue']){_0x502a80='queue';}else if(_0x36d327['routeId']){_0x502a80='outbound';}else{console[_0xc169('0x18')](_0xc169('0x19'),_0x36d327);}}else{_0x502a80=_0xc169('0x1a');}switch(_0x59718a[_0xc169('0x13')]['toLowerCase']()){case _0xc169('0x9'):zendesk[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case _0xc169('0xa'):salesforce[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case'sugarcrm':sugarcrm[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case _0xc169('0x1b'):freshdesk[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case'zoho':zoho[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case'desk':desk[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case _0xc169('0x1c'):vtiger[_0x502a80](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b);break;case _0xc169('0xf'):freshsales['cs'](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b,_0x502a80);break;case _0xc169('0x10'):servicenow['cs'](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b,_0x502a80);break;case _0xc169('0xe'):dynamics365['cs'](_0x59718a,_0x36d327,_0x2ec13d,_0x2e10e1,_0x3034d8,_0x1da616,_0x5d006b,_0x502a80);break;default:console[_0xc169('0x18')](_0xc169('0x1d'));}}else{_0x267fdb=require(_0xc169('0x1e'))(_0x59718a[_0xc169('0x13')][_0xc169('0x14')]());_0x267fdb[_0xc169('0x1f')](_0xc169('0x20'),util[_0xc169('0x21')](_0xc169('0x22'),_0x59718a[_0xc169('0x13')][_0xc169('0x14')](),_0x59718a[_0xc169('0x17')]));}}else{_0x267fdb=require(_0xc169('0x1e'))(_0x59718a[_0xc169('0x13')][_0xc169('0x14')]());_0x267fdb[_0xc169('0x1f')]('[EXEC]',util[_0xc169('0x21')](_0xc169('0x23'),_0x59718a[_0xc169('0x13')][_0xc169('0x14')](),_0x59718a[_0xc169('0x24')]));}}else{}}catch(_0x2fcdaf){console[_0xc169('0x1f')](_0x2fcdaf);}}}}; \ No newline at end of file +var _0xae87=['./zoho','./desk','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk'];(function(_0x5382fc,_0x4f4955){var _0x3d2daf=function(_0x3d0081){while(--_0x3d0081){_0x5382fc['push'](_0x5382fc['shift']());}};_0x3d2daf(++_0x4f4955);}(_0xae87,0xd3));var _0x7ae8=function(_0xb24fad,_0xd58756){_0xb24fad=_0xb24fad-0x0;var _0x173226=_0xae87[_0xb24fad];return _0x173226;};'use strict';var _=require(_0x7ae8('0x0'));var util=require(_0x7ae8('0x1'));var zendesk=require(_0x7ae8('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x7ae8('0x3'));var freshdesk=require(_0x7ae8('0x4'));var zoho=require(_0x7ae8('0x5'));var desk=require(_0x7ae8('0x6'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x7ae8('0x7'));var freshsales=require('./freshsales');var integrations=[_0x7ae8('0x8'),_0x7ae8('0x9'),_0x7ae8('0xa'),_0x7ae8('0xb'),_0x7ae8('0xc'),_0x7ae8('0xd'),_0x7ae8('0xe'),_0x7ae8('0xf'),'freshsales',_0x7ae8('0x10')];exports['exec']=function(_0x15fd8a,_0x4b9bf7,_0x74b85c,_0x4a19d1,_0x3a9164,_0x54e8ed){if(_0x74b85c){if(_[_0x7ae8('0x11')](integrations,_0x15fd8a[_0x7ae8('0x12')]['toLowerCase']())){try{var _0x4a1651=null;var _0x516e8b='';var _0x103ab4=_0x74b85c[_0x15fd8a['data1'][_0x7ae8('0x13')]()];if(_0x103ab4){var _0x4cbcd4=_0x103ab4[_0x15fd8a[_0x7ae8('0x14')]];if(_0x4cbcd4){var _0x5bd93a=_[_0x7ae8('0x15')](_0x4cbcd4[_0x7ae8('0x16')],{'id':parseInt(_0x15fd8a[_0x7ae8('0x17')],0xa)});if(_0x5bd93a){if(_0x4a19d1){if(_0x3a9164&&_0x4b9bf7['queue']){_0x516e8b=_0x7ae8('0x18');}else if(_0x4b9bf7['routeId']){_0x516e8b=_0x7ae8('0x19');}else{console[_0x7ae8('0x1a')](_0x7ae8('0x1b'),_0x4b9bf7);}}else{_0x516e8b=_0x7ae8('0x1c');}switch(_0x15fd8a[_0x7ae8('0x12')]['toLowerCase']()){case _0x7ae8('0x8'):zendesk[_0x516e8b](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed);break;case _0x7ae8('0x9'):salesforce[_0x516e8b](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed);break;case _0x7ae8('0xa'):sugarcrm[_0x516e8b](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed);break;case _0x7ae8('0xb'):freshdesk[_0x516e8b](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed);break;case _0x7ae8('0xc'):zoho[_0x516e8b](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed);break;case _0x7ae8('0xd'):desk[_0x516e8b](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed);break;case _0x7ae8('0xe'):vtiger[_0x516e8b](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed);break;case'freshsales':freshsales['cs'](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed,_0x516e8b);break;case _0x7ae8('0x10'):servicenow['cs'](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed,_0x516e8b);break;case'dynamics365':dynamics365['cs'](_0x15fd8a,_0x4b9bf7,_0x5bd93a,_0x4a19d1,_0x3a9164,_0x4cbcd4,_0x54e8ed,_0x516e8b);break;default:console['log'](_0x7ae8('0x1d'));}}else{_0x4a1651=require(_0x7ae8('0x1e'))(_0x15fd8a['data1'][_0x7ae8('0x13')]());_0x4a1651[_0x7ae8('0x1f')](_0x7ae8('0x20'),util[_0x7ae8('0x21')](_0x7ae8('0x22'),_0x15fd8a[_0x7ae8('0x12')][_0x7ae8('0x13')](),_0x15fd8a['data3']));}}else{_0x4a1651=require('../../../../config/logger')(_0x15fd8a[_0x7ae8('0x12')][_0x7ae8('0x13')]());_0x4a1651[_0x7ae8('0x1f')](_0x7ae8('0x20'),util[_0x7ae8('0x21')](_0x7ae8('0x23'),_0x15fd8a['data1'][_0x7ae8('0x13')](),_0x15fd8a[_0x7ae8('0x14')]));}}else{}}catch(_0x4fa143){console[_0x7ae8('0x1f')](_0x4fa143);}}}}; \ 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 bbea429..0a6c3bb 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 _0xd3c9=['Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','isNil','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','assign','Subjects','getString','ticketType','Task','ActivityDate','IsReminderSet','contact','endUserType','lead','WhoId','WhatId','account','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','User','find','execute','then','length','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','Contact','additionalSearchLead','$or','Lead','account_contact_lead','additionalSearchAccount','Account','first','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','format','Caller\x20-\x20%s','LastName','Company','No\x20Company','forEach','string','picklist','idField','content','variableName','toString','customVariable','Variable','name','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xd3c9,0x192));var _0x9d3c=function(_0x4beadb,_0x142d5d){_0x4beadb=_0x4beadb-0x0;var _0x10b3dd=_0xd3c9[_0x4beadb];return _0x10b3dd;};'use strict';var _=require('lodash');var rp=require(_0x9d3c('0x0'));var moment=require(_0x9d3c('0x1'));var BPromise=require(_0x9d3c('0x2'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x9d3c('0x3'));var Redis=require(_0x9d3c('0x4'));var intUtil=require(_0x9d3c('0x5'));var config=require(_0x9d3c('0x6'));var logger=require(_0x9d3c('0x7'))('salesforce');config[_0x9d3c('0x8')]=_[_0x9d3c('0x9')](config[_0x9d3c('0x8')],{'host':_0x9d3c('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9d3c('0x8')]));function emit(_0x4fed7f,_0x5d644d,_0x47df9b){io['to'](_0x4fed7f)[_0x9d3c('0xb')](_0x5d644d,_0x47df9b);}function getTicket(_0x41d8b9,_0x264d9a,_0x44c1f8,_0x2a8d14,_0x5d5a95,_0x24a9af,_0x272e3e,_0x5b63ba){var _0x3b9f73=Object[_0x9d3c('0xc')]({},{'OwnerId':_0x264d9a['id'],'Subject':intUtil['getString'](_0x2a8d14[_0x9d3c('0xd')],_0x5d5a95,'\x20'),'Description':intUtil[_0x9d3c('0xe')](_0x2a8d14['Descriptions'],_0x5d5a95,'\x0a')},getCustomFields(_0x24a9af,_0x5d5a95));if(_0x44c1f8){if(_0x2a8d14[_0x9d3c('0xf')]===_0x9d3c('0x10')){_0x3b9f73[_0x9d3c('0x11')]=moment['utc']();_0x3b9f73[_0x9d3c('0x12')]=![];_0x3b9f73['IsRecurrence']=![];if(_0x44c1f8['endUserType']===_0x9d3c('0x13')||_0x44c1f8[_0x9d3c('0x14')]===_0x9d3c('0x15')){_0x3b9f73[_0x9d3c('0x16')]=_0x44c1f8['id'];}else if(_0x44c1f8[_0x9d3c('0x14')]==='account'){_0x3b9f73[_0x9d3c('0x17')]=_0x44c1f8['id'];}}else if(_0x2a8d14['ticketType']==='Case'){if(_0x44c1f8[_0x9d3c('0x14')]==='contact'){_0x3b9f73['ContactId']=_0x44c1f8['id'];}else if(_0x44c1f8[_0x9d3c('0x14')]===_0x9d3c('0x18')){_0x3b9f73[_0x9d3c('0x19')]=_0x44c1f8['id'];}else if(_0x44c1f8[_0x9d3c('0x14')]==='lead'&&_0x2a8d14[_0x9d3c('0x1a')]){_0x3b9f73[_0x2a8d14[_0x9d3c('0x1a')]]=_0x44c1f8['id'];}else{logger[_0x9d3c('0x1b')](_0x9d3c('0x1c'));}}}return _0x272e3e[_0x9d3c('0x1d')](_0x2a8d14[_0x9d3c('0xf')])[_0x9d3c('0x1e')](_0x3b9f73);}function getUser(_0x4b7a65,_0x31b40a,_0x1237f4){if(!_['isNil'](_0x31b40a)&&intUtil['validateEmail'](_0x31b40a)){var _0x197dae={'Email':_0x31b40a};var _0x564773={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1237f4[_0x9d3c('0x1d')](_0x9d3c('0x1f'))[_0x9d3c('0x20')](_0x197dae,_0x564773)[_0x9d3c('0x21')]()[_0x9d3c('0x22')](function(_0x2c2a9d){if(_0x2c2a9d[_0x9d3c('0x23')]){var _0x994041=_[_0x9d3c('0x20')](_0x2c2a9d,function(_0x18f2ed){return _0x18f2ed['Email']===_0x31b40a;});if(_0x994041){logger[_0x9d3c('0x1b')](_0x9d3c('0x24'),_0x31b40a);return BPromise[_0x9d3c('0x25')]({'id':_0x994041['Id'],'name':_0x994041[_0x9d3c('0x26')]});}}else{logger['info'](_0x9d3c('0x27'),_0x31b40a);return _0x1237f4[_0x9d3c('0x28')]()['then'](function(_0x5dcee7){return BPromise['resolve']({'id':_0x5dcee7[_0x9d3c('0x29')],'name':_0x5dcee7[_0x9d3c('0x2a')]});});}});}else{logger[_0x9d3c('0x1b')](_0x9d3c('0x27'),_0x31b40a);return _0x1237f4[_0x9d3c('0x28')]()[_0x9d3c('0x22')](function(_0x2d7f47){return BPromise[_0x9d3c('0x25')]({'id':_0x2d7f47[_0x9d3c('0x29')],'name':_0x2d7f47['display_name']});});}}function getEndUser(_0x18274a,_0x1aa208,_0x4c372d,_0x420098,_0x3602a1){var _0x89d4fc={'$or':{'Phone':_0x420098}};var _0x3e6f0a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9d3c('0x25')]()[_0x9d3c('0x22')](function(){logger['info'](_0x9d3c('0x2b'),_0x420098,_0x1aa208[_0x9d3c('0x2c')]);switch(_0x1aa208[_0x9d3c('0x2c')]){case _0x9d3c('0x2d'):var _0x7507ba=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208['additionalSearchContact']){var _0x2251dc={};_0x2251dc[_0x1aa208[_0x9d3c('0x2f')]]=_0x420098;_[_0x9d3c('0x30')](_0x7507ba['$or'],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x31'))[_0x9d3c('0x20')](_0x7507ba,_0x3e6f0a)[_0x9d3c('0x21')]()[_0x9d3c('0x22')](function(_0x24af1a){if(_0x24af1a&&_0x24af1a[_0x9d3c('0x23')]){return _0x24af1a;}else{var _0x2b9734=_['cloneDeep'](_0x89d4fc);if(_0x1aa208[_0x9d3c('0x32')]){var _0x1d75b2={};_0x1d75b2[_0x1aa208[_0x9d3c('0x32')]]=_0x420098;_['merge'](_0x2b9734[_0x9d3c('0x33')],_0x1d75b2);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x34'))[_0x9d3c('0x20')](_0x2b9734,_0x3e6f0a);}});case _0x9d3c('0x35'):var _0x1ac20d=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208[_0x9d3c('0x36')]){var _0x2251dc={};_0x2251dc[_0x1aa208[_0x9d3c('0x36')]]=_0x420098;_[_0x9d3c('0x30')](_0x1ac20d['$or'],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x37'))[_0x9d3c('0x20')](_0x1ac20d,_0x3e6f0a)[_0x9d3c('0x21')]()[_0x9d3c('0x22')](function(_0x273c82){if(_0x273c82&&_0x273c82[_0x9d3c('0x23')]){return _0x273c82;}else{var _0x158399=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208['additionalSearchContact']){var _0x41f736={};_0x41f736[_0x1aa208[_0x9d3c('0x2f')]]=_0x420098;_['merge'](_0x158399[_0x9d3c('0x33')],_0x41f736);}return _0x3602a1[_0x9d3c('0x1d')]('Contact')[_0x9d3c('0x20')](_0x158399,_0x3e6f0a)[_0x9d3c('0x22')](function(_0x54bf01){if(_0x54bf01&&_0x54bf01['length']){return _0x54bf01;}else{var _0xb146ee=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208[_0x9d3c('0x32')]){var _0x13e25b={};_0x13e25b[_0x1aa208[_0x9d3c('0x32')]]=_0x420098;_[_0x9d3c('0x30')](_0xb146ee[_0x9d3c('0x33')],_0x13e25b);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x34'))['find'](_0xb146ee,_0x3e6f0a);}});}});case'contact':var _0x7507ba=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208[_0x9d3c('0x2f')]){var _0x2251dc={};_0x2251dc[_0x1aa208['additionalSearchContact']]=_0x420098;_[_0x9d3c('0x30')](_0x7507ba['$or'],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x31'))[_0x9d3c('0x20')](_0x7507ba,_0x3e6f0a)[_0x9d3c('0x21')]();case _0x9d3c('0x15'):var _0xe3ce82=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208['additionalSearchLead']){var _0x2251dc={};_0x2251dc[_0x1aa208[_0x9d3c('0x32')]]=_0x420098;_[_0x9d3c('0x30')](_0xe3ce82[_0x9d3c('0x33')],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')](_0x9d3c('0x34'))[_0x9d3c('0x20')](_0xe3ce82,_0x3e6f0a);case'account':var _0x1ac20d=_[_0x9d3c('0x2e')](_0x89d4fc);if(_0x1aa208['additionalSearchAccount']){var _0x2251dc={};_0x2251dc[_0x1aa208[_0x9d3c('0x36')]]=_0x420098;_[_0x9d3c('0x30')](_0x1ac20d[_0x9d3c('0x33')],_0x2251dc);}return _0x3602a1[_0x9d3c('0x1d')]('Account')['find'](_0x1ac20d,_0x3e6f0a);default:return null;}})[_0x9d3c('0x22')](function(_0x437fd5){if(_0x437fd5&&_0x437fd5[_0x9d3c('0x23')]){var _0x58d31e=_[_0x9d3c('0x38')](_0x437fd5);if(_0x58d31e){return BPromise['resolve']({'id':_0x58d31e['Id'],'name':_0x58d31e[_0x9d3c('0x26')],'phone':_0x58d31e['Phone'],'endUserType':_0x58d31e[_0x9d3c('0x39')][_0x9d3c('0x3a')][_0x9d3c('0x3b')]()});}}})[_0x9d3c('0x22')](function(_0x433863){if(_0x433863){logger[_0x9d3c('0x1b')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x433863[_0x9d3c('0x14')],_0x420098);return BPromise[_0x9d3c('0x25')](_0x433863);}else{logger[_0x9d3c('0x1b')](_0x9d3c('0x3c'),_0x420098);var _0xa03392={'Phone':_0x420098};if(_0x1aa208['moduleCreate']){if(_0x1aa208[_0x9d3c('0x3d')]===_0x9d3c('0x13')){logger[_0x9d3c('0x1b')](_0x9d3c('0x3e'),_0x420098,_0x1aa208[_0x9d3c('0x3d')]);_0xa03392['LastName']=_0x4c372d!==_0x9d3c('0x3f')?_0x4c372d:util[_0x9d3c('0x40')](_0x9d3c('0x41'),_0x420098);}else if(_0x1aa208['moduleCreate']==='lead'){logger[_0x9d3c('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x420098,_0x1aa208[_0x9d3c('0x3d')]);_0xa03392[_0x9d3c('0x42')]=_0x4c372d!==''?_0x4c372d:util[_0x9d3c('0x40')](_0x9d3c('0x41'),_0x420098);_0xa03392[_0x9d3c('0x43')]=_0x9d3c('0x44');}else if(_0x1aa208[_0x9d3c('0x3d')]===_0x9d3c('0x18')){logger[_0x9d3c('0x1b')](_0x9d3c('0x3e'),_0x420098,_0x1aa208[_0x9d3c('0x3d')]);_0xa03392[_0x9d3c('0x26')]=_0x4c372d!==_0x9d3c('0x3f')?_0x4c372d:util[_0x9d3c('0x40')](_0x9d3c('0x41'),_0x420098);}else{return null;}}return _0x3602a1[_0x9d3c('0x1d')](_['upperFirst'](_0x1aa208[_0x9d3c('0x3d')]))[_0x9d3c('0x1e')](_0xa03392)[_0x9d3c('0x22')](function(_0x3f8d46){return BPromise['resolve']({'id':_0x3f8d46['id'],'endUserType':_0x1aa208[_0x9d3c('0x3d')]});});}});}function getCustomFields(_0x55d80e,_0x3e9075){var _0x45e408={};if(_0x55d80e[_0x9d3c('0x23')]>0x0){_[_0x9d3c('0x45')](_0x55d80e,function(_0x5df3c6){if(_['includes']([_0x9d3c('0x46'),_0x9d3c('0x47')],_0x5df3c6['type'])&&_0x5df3c6[_0x9d3c('0x48')]){_0x45e408[_0x5df3c6['idField']]=_0x5df3c6[_0x9d3c('0x49')]['toString']();}else if(_0x5df3c6[_0x9d3c('0x3a')]==='variable'&&_0x5df3c6[_0x9d3c('0x4a')]&&_0x5df3c6[_0x9d3c('0x48')]){_0x3e9075[_0x5df3c6[_0x9d3c('0x4a')]]&&(_0x45e408[_0x5df3c6['idField']]=_0x3e9075[_0x5df3c6['variableName']][_0x9d3c('0x4b')]());}else if(_0x5df3c6['type']===_0x9d3c('0x4c')&&_0x5df3c6['Variable']&&_0x5df3c6[_0x9d3c('0x4d')][_0x9d3c('0x4e')]&&_0x5df3c6['idField']){_0x3e9075[_0x5df3c6[_0x9d3c('0x4d')][_0x9d3c('0x4e')][_0x9d3c('0x3b')]()]&&(_0x45e408[_0x5df3c6[_0x9d3c('0x48')]]=_0x3e9075[_0x5df3c6[_0x9d3c('0x4d')]['name'][_0x9d3c('0x3b')]()][_0x9d3c('0x4b')]());}});}return _0x45e408;}function getConnection(_0x563cf4){var _0x2e9816=_0x563cf4['password'][_0x9d3c('0x4f')](_0x563cf4[_0x9d3c('0x50')]);var _0x8addf1=new jsforce[(_0x9d3c('0x51'))]({'oauth2':{'loginUrl':_0x563cf4[_0x9d3c('0x52')]||_0x9d3c('0x53'),'clientId':_0x563cf4[_0x9d3c('0x54')],'clientSecret':_0x563cf4[_0x9d3c('0x55')]}});return _0x8addf1[_0x9d3c('0x56')](_0x563cf4[_0x9d3c('0x57')],_0x2e9816)[_0x9d3c('0x22')](function(){logger[_0x9d3c('0x1b')](_0x9d3c('0x58'));return _0x8addf1;});}exports[_0x9d3c('0x59')]=function(_0x49fd94,_0x65910d,_0x4a43a5,_0x52f01c,_0x357965,_0x39705f){var _0x2511f1,_0x26502b,_0x21eacb,_0xbec065;_0x39705f[_0x9d3c('0x5a')]=intUtil[_0x9d3c('0x5b')](_0x39705f[_0x9d3c('0x5a')]);_0x39705f[_0x9d3c('0x52')]=intUtil[_0x9d3c('0x5b')](_0x39705f['remoteUri']);if(_0x357965&&_0x357965[_0x9d3c('0x5c')]){logger[_0x9d3c('0x1b')](_0x9d3c('0x5d'),_0x9d3c('0x5e'));_0x65910d[_0x9d3c('0x5f')]=util['format'](_0x9d3c('0x60'),_0x39705f[_0x9d3c('0x5a')],_0x65910d[_0x9d3c('0x61')],md5(_0x65910d[_0x9d3c('0x61')]));}else{_0x65910d[_0x9d3c('0x5f')]='';}return getConnection(_0x39705f)[_0x9d3c('0x22')](function(_0x366cbe){_0xbec065=_0x366cbe;return getUser(_0x39705f,_0x52f01c[_0x9d3c('0x62')],_0xbec065);})[_0x9d3c('0x22')](function(_0x8ad520){_0x2511f1=_0x8ad520;return getEndUser(_0x39705f,_0x4a43a5,_0x65910d['calleridname'],_0x65910d[_0x9d3c('0x63')],_0xbec065);})['then'](function(_0x5c8a45){_0x26502b=_0x5c8a45;return getTicket(_0x39705f,_0x2511f1,_0x26502b,_0x4a43a5,_0x65910d,_0x4a43a5[_0x9d3c('0x64')],_0xbec065,'queue');})[_0x9d3c('0x22')](function(_0x5269af){_0x21eacb=_0x5269af;logger[_0x9d3c('0x1b')](_0x9d3c('0x65'),_0x21eacb['id']);logger['info'](_0x9d3c('0x66'),_0x21eacb['id'],_0x52f01c['name'],_0x39705f[_0x9d3c('0x3a')]);switch(_0x39705f[_0x9d3c('0x3a')]){case'integrationTab':emit(util['format'](_0x9d3c('0x67'),_0x52f01c[_0x9d3c('0x4e')]),'trigger:salesforce:display',{'recordId':_0x21eacb['id']});break;case _0x9d3c('0x68'):emit(util['format'](_0x9d3c('0x67'),_0x52f01c[_0x9d3c('0x4e')]),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0xbec065[_0x9d3c('0x69')],_0x21eacb['id'])});break;default:logger['error'](_0x9d3c('0x6a'));}})[_0x9d3c('0x6b')](function(_0x27ccdd){logger[_0x9d3c('0x6c')](_0x9d3c('0x5d'),_0x27ccdd);});};exports['outbound']=function(_0x17dfff,_0x1fc63d,_0x25020c,_0x2197bc,_0x38c3ce,_0x5ddbfc,_0x228b6c){var _0x5ca79a,_0x401a51,_0x1a51c0,_0x321f50;_0x5ddbfc['serverUrl']=intUtil[_0x9d3c('0x5b')](_0x5ddbfc['serverUrl']);_0x5ddbfc[_0x9d3c('0x52')]=intUtil['stripTrailingSlash'](_0x5ddbfc[_0x9d3c('0x52')]);if(_0x228b6c&&_0x228b6c['recordingFormat']&&_0x228b6c[_0x9d3c('0x6d')]!==_0x9d3c('0x6e')){logger['info'](_0x9d3c('0x6f'),_0x9d3c('0x5e'));_0x1fc63d['recordingURL']=util[_0x9d3c('0x40')](_0x9d3c('0x60'),_0x5ddbfc['serverUrl'],_0x1fc63d[_0x9d3c('0x61')],md5(_0x1fc63d[_0x9d3c('0x61')]));}return getConnection(_0x5ddbfc)[_0x9d3c('0x22')](function(_0x5b9140){_0x321f50=_0x5b9140;return getUser(_0x5ddbfc,_0x2197bc[_0x9d3c('0x62')],_0x321f50);})['then'](function(_0x2d339a){_0x5ca79a=_0x2d339a;return getEndUser(_0x5ddbfc,_0x25020c,_0x1fc63d[_0x9d3c('0x70')],_0x1fc63d[_0x9d3c('0x71')],_0x321f50);})['then'](function(_0xbf790f){_0x401a51=_0xbf790f;return getTicket(_0x5ddbfc,_0x5ca79a,_0x401a51,_0x25020c,_0x1fc63d,_0x25020c[_0x9d3c('0x64')],_0x321f50,_0x9d3c('0x72'));})[_0x9d3c('0x22')](function(_0x5e6fb4){_0x1a51c0=_0x5e6fb4;logger[_0x9d3c('0x1b')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x1a51c0['id']);logger[_0x9d3c('0x1b')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x1a51c0['id'],_0x2197bc[_0x9d3c('0x4e')],_0x5ddbfc[_0x9d3c('0x3a')]);switch(_0x5ddbfc['type']){case _0x9d3c('0x73'):emit(util[_0x9d3c('0x40')]('user:%s',_0x2197bc[_0x9d3c('0x4e')]),'trigger:salesforce:display',{'recordId':_0x1a51c0['id']});break;case'newTab':emit(util['format'](_0x9d3c('0x67'),_0x2197bc['name']),'trigger:browser:url',{'uri':util['format']('%s/%s/e',_0x321f50[_0x9d3c('0x69')],_0x1a51c0['id'])});break;default:logger[_0x9d3c('0x6c')](_0x9d3c('0x6f'),_0x9d3c('0x74'));}})[_0x9d3c('0x6b')](function(_0x121b6d){logger[_0x9d3c('0x6c')](_0x9d3c('0x6f'),_0x121b6d);});};exports[_0x9d3c('0x75')]=function(_0x286efc,_0x2d919f,_0x2b59f4,_0x2d3743,_0x2cc665,_0x3c7387){var _0x225588,_0x33b1d0,_0x4315e4,_0x29a200;_0x3c7387['serverUrl']=intUtil[_0x9d3c('0x5b')](_0x3c7387[_0x9d3c('0x5a')]);_0x3c7387['remoteUri']=intUtil[_0x9d3c('0x5b')](_0x3c7387[_0x9d3c('0x52')]);if(_0x2cc665&&_0x2cc665['monitor_format']){logger[_0x9d3c('0x1b')]('['+_0x2d919f[_0x9d3c('0x76')][_0x9d3c('0x77')]()+']','Recording\x20is\x20enabled!');_0x2d919f['recordingURL']=util[_0x9d3c('0x40')](_0x9d3c('0x60'),_0x3c7387[_0x9d3c('0x5a')],_0x2d919f[_0x9d3c('0x61')],md5(_0x2d919f[_0x9d3c('0x61')]));}else{_0x2d919f[_0x9d3c('0x5f')]='';}return getConnection(_0x3c7387)[_0x9d3c('0x22')](function(_0x43edbf){_0x29a200=_0x43edbf;if(!_[_0x9d3c('0x78')](_0x2d3743)){return getUser(_0x3c7387,_0x2d3743[_0x9d3c('0x4e')],_0x29a200);}else{return getUser(_0x3c7387,null,_0x29a200);}})[_0x9d3c('0x22')](function(_0x2bc85d){_0x225588=_0x2bc85d;return getEndUser(_0x3c7387,_0x2b59f4,_0x2d919f[_0x9d3c('0x79')],_0x2d919f[_0x9d3c('0x63')],_0x29a200);})[_0x9d3c('0x22')](function(_0x3d56e2){_0x33b1d0=_0x3d56e2;return getTicket(_0x3c7387,_0x225588,_0x33b1d0,_0x2b59f4,_0x2d919f,_0x2b59f4['Fields'],_0x29a200);})['then'](function(_0x156ed2){_0x4315e4=_0x156ed2;logger[_0x9d3c('0x1b')]('['+_0x2d919f[_0x9d3c('0x76')][_0x9d3c('0x77')]()+_0x9d3c('0x7a'),_0x4315e4['id']);logger[_0x9d3c('0x1b')]('['+_0x2d919f[_0x9d3c('0x76')]['toUpperCase']()+_0x9d3c('0x7b'),_0x3c7387[_0x9d3c('0x3a')]);})['catch'](function(_0xbf7350){logger[_0x9d3c('0x6c')]('['+_0x2d919f[_0x9d3c('0x76')][_0x9d3c('0x77')]()+']',_0xbf7350);});}; \ No newline at end of file +var _0xc605=['clientId','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','trigger:salesforce:display','user:%s','%s/%s/e','instanceUrl','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','error','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','ioredis','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','assign','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','execute','then','find','Email','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','additionalSearchContact','merge','$or','length','cloneDeep','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Contact','Lead','first','attributes','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Caller\x20-\x20%s','LastName','format','Company','No\x20Company','upperFirst','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com'];(function(_0x217c17,_0x7f93e3){var _0x2c1f1d=function(_0x5d76e5){while(--_0x5d76e5){_0x217c17['push'](_0x217c17['shift']());}};_0x2c1f1d(++_0x7f93e3);}(_0xc605,0x1a6));var _0x5c60=function(_0x3f59c6,_0x335cb1){_0x3f59c6=_0x3f59c6-0x0;var _0x7f9a55=_0xc605[_0x3f59c6];return _0x7f9a55;};'use strict';var _=require(_0x5c60('0x0'));var rp=require(_0x5c60('0x1'));var moment=require(_0x5c60('0x2'));var BPromise=require(_0x5c60('0x3'));var md5=require(_0x5c60('0x4'));var jsforce=require(_0x5c60('0x5'));var util=require('util');var Redis=require(_0x5c60('0x6'));var intUtil=require('./util');var config=require(_0x5c60('0x7'));var logger=require('../../../../config/logger')('salesforce');config['redis']=_[_0x5c60('0x8')](config[_0x5c60('0x9')],{'host':_0x5c60('0xa'),'port':0x18eb});var io=require(_0x5c60('0xb'))(new Redis(config[_0x5c60('0x9')]));function emit(_0x1a0ac9,_0x23ef58,_0x1459b8){io['to'](_0x1a0ac9)['emit'](_0x23ef58,_0x1459b8);}function getTicket(_0x5a9ba2,_0x1e24b8,_0x285df9,_0x21a54e,_0x5e4721,_0x535a33,_0x7a0bd5,_0x394c19){var _0x3285a3=Object[_0x5c60('0xc')]({},{'OwnerId':_0x1e24b8['id'],'Subject':intUtil['getString'](_0x21a54e[_0x5c60('0xd')],_0x5e4721,'\x20'),'Description':intUtil[_0x5c60('0xe')](_0x21a54e[_0x5c60('0xf')],_0x5e4721,'\x0a')},getCustomFields(_0x535a33,_0x5e4721));if(_0x285df9){if(_0x21a54e[_0x5c60('0x10')]===_0x5c60('0x11')){_0x3285a3[_0x5c60('0x12')]=moment[_0x5c60('0x13')]();_0x3285a3[_0x5c60('0x14')]=![];_0x3285a3[_0x5c60('0x15')]=![];if(_0x285df9[_0x5c60('0x16')]===_0x5c60('0x17')||_0x285df9[_0x5c60('0x16')]===_0x5c60('0x18')){_0x3285a3[_0x5c60('0x19')]=_0x285df9['id'];}else if(_0x285df9[_0x5c60('0x16')]===_0x5c60('0x1a')){_0x3285a3[_0x5c60('0x1b')]=_0x285df9['id'];}}else if(_0x21a54e[_0x5c60('0x10')]===_0x5c60('0x1c')){if(_0x285df9[_0x5c60('0x16')]===_0x5c60('0x17')){_0x3285a3[_0x5c60('0x1d')]=_0x285df9['id'];}else if(_0x285df9['endUserType']==='account'){_0x3285a3['AccountId']=_0x285df9['id'];}else if(_0x285df9['endUserType']==='lead'&&_0x21a54e[_0x5c60('0x1e')]){_0x3285a3[_0x21a54e[_0x5c60('0x1e')]]=_0x285df9['id'];}else{logger[_0x5c60('0x1f')](_0x5c60('0x20'));}}}return _0x7a0bd5[_0x5c60('0x21')](_0x21a54e[_0x5c60('0x10')])[_0x5c60('0x22')](_0x3285a3);}function getUser(_0x24a9f5,_0x5bb5c5,_0x3a292f){if(!_[_0x5c60('0x23')](_0x5bb5c5)&&intUtil[_0x5c60('0x24')](_0x5bb5c5)){var _0x3b383f={'Email':_0x5bb5c5};var _0x36c426={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x3a292f['sobject'](_0x5c60('0x25'))['find'](_0x3b383f,_0x36c426)[_0x5c60('0x26')]()[_0x5c60('0x27')](function(_0x3b3e55){if(_0x3b3e55['length']){var _0x107265=_[_0x5c60('0x28')](_0x3b3e55,function(_0xeaaa3e){return _0xeaaa3e[_0x5c60('0x29')]===_0x5bb5c5;});if(_0x107265){logger[_0x5c60('0x1f')](_0x5c60('0x2a'),_0x5bb5c5);return BPromise[_0x5c60('0x2b')]({'id':_0x107265['Id'],'name':_0x107265[_0x5c60('0x2c')]});}}else{logger['info'](_0x5c60('0x2d'),_0x5bb5c5);return _0x3a292f[_0x5c60('0x2e')]()['then'](function(_0x576be4){return BPromise['resolve']({'id':_0x576be4[_0x5c60('0x2f')],'name':_0x576be4[_0x5c60('0x30')]});});}});}else{logger[_0x5c60('0x1f')](_0x5c60('0x2d'),_0x5bb5c5);return _0x3a292f[_0x5c60('0x2e')]()[_0x5c60('0x27')](function(_0x5e5747){return BPromise[_0x5c60('0x2b')]({'id':_0x5e5747[_0x5c60('0x2f')],'name':_0x5e5747[_0x5c60('0x30')]});});}}function getEndUser(_0x53fdba,_0x2df4cb,_0x582824,_0x17c5f3,_0x2e8dbf){var _0x4ff2cc={'$or':{'Phone':_0x17c5f3}};var _0xae94a2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x5c60('0x2b')]()[_0x5c60('0x27')](function(){logger[_0x5c60('0x1f')](_0x5c60('0x31'),_0x17c5f3,_0x2df4cb[_0x5c60('0x32')]);switch(_0x2df4cb[_0x5c60('0x32')]){case'contact_lead':var _0x33efa1=_['cloneDeep'](_0x4ff2cc);if(_0x2df4cb[_0x5c60('0x33')]){var _0x379d35={};_0x379d35[_0x2df4cb['additionalSearchContact']]=_0x17c5f3;_[_0x5c60('0x34')](_0x33efa1[_0x5c60('0x35')],_0x379d35);}return _0x2e8dbf[_0x5c60('0x21')]('Contact')[_0x5c60('0x28')](_0x33efa1,_0xae94a2)[_0x5c60('0x26')]()[_0x5c60('0x27')](function(_0x193567){if(_0x193567&&_0x193567[_0x5c60('0x36')]){return _0x193567;}else{var _0x39bd10=_[_0x5c60('0x37')](_0x4ff2cc);if(_0x2df4cb['additionalSearchLead']){var _0x534323={};_0x534323[_0x2df4cb[_0x5c60('0x38')]]=_0x17c5f3;_[_0x5c60('0x34')](_0x39bd10[_0x5c60('0x35')],_0x534323);}return _0x2e8dbf['sobject']('Lead')[_0x5c60('0x28')](_0x39bd10,_0xae94a2);}});case _0x5c60('0x39'):var _0x147e33=_[_0x5c60('0x37')](_0x4ff2cc);if(_0x2df4cb[_0x5c60('0x3a')]){var _0x379d35={};_0x379d35[_0x2df4cb[_0x5c60('0x3a')]]=_0x17c5f3;_[_0x5c60('0x34')](_0x147e33[_0x5c60('0x35')],_0x379d35);}return _0x2e8dbf[_0x5c60('0x21')](_0x5c60('0x3b'))[_0x5c60('0x28')](_0x147e33,_0xae94a2)['execute']()['then'](function(_0x476dcc){if(_0x476dcc&&_0x476dcc['length']){return _0x476dcc;}else{var _0x58ff29=_[_0x5c60('0x37')](_0x4ff2cc);if(_0x2df4cb['additionalSearchContact']){var _0x56c691={};_0x56c691[_0x2df4cb['additionalSearchContact']]=_0x17c5f3;_[_0x5c60('0x34')](_0x58ff29[_0x5c60('0x35')],_0x56c691);}return _0x2e8dbf['sobject']('Contact')[_0x5c60('0x28')](_0x58ff29,_0xae94a2)[_0x5c60('0x27')](function(_0x212ff3){if(_0x212ff3&&_0x212ff3['length']){return _0x212ff3;}else{var _0x1334e4=_['cloneDeep'](_0x4ff2cc);if(_0x2df4cb[_0x5c60('0x38')]){var _0x139dac={};_0x139dac[_0x2df4cb['additionalSearchLead']]=_0x17c5f3;_[_0x5c60('0x34')](_0x1334e4['$or'],_0x139dac);}return _0x2e8dbf[_0x5c60('0x21')]('Lead')['find'](_0x1334e4,_0xae94a2);}});}});case _0x5c60('0x17'):var _0x33efa1=_[_0x5c60('0x37')](_0x4ff2cc);if(_0x2df4cb['additionalSearchContact']){var _0x379d35={};_0x379d35[_0x2df4cb[_0x5c60('0x33')]]=_0x17c5f3;_[_0x5c60('0x34')](_0x33efa1['$or'],_0x379d35);}return _0x2e8dbf[_0x5c60('0x21')](_0x5c60('0x3c'))[_0x5c60('0x28')](_0x33efa1,_0xae94a2)[_0x5c60('0x26')]();case'lead':var _0x59debb=_[_0x5c60('0x37')](_0x4ff2cc);if(_0x2df4cb[_0x5c60('0x38')]){var _0x379d35={};_0x379d35[_0x2df4cb[_0x5c60('0x38')]]=_0x17c5f3;_[_0x5c60('0x34')](_0x59debb['$or'],_0x379d35);}return _0x2e8dbf[_0x5c60('0x21')](_0x5c60('0x3d'))[_0x5c60('0x28')](_0x59debb,_0xae94a2);case'account':var _0x147e33=_[_0x5c60('0x37')](_0x4ff2cc);if(_0x2df4cb[_0x5c60('0x3a')]){var _0x379d35={};_0x379d35[_0x2df4cb[_0x5c60('0x3a')]]=_0x17c5f3;_[_0x5c60('0x34')](_0x147e33[_0x5c60('0x35')],_0x379d35);}return _0x2e8dbf[_0x5c60('0x21')]('Account')[_0x5c60('0x28')](_0x147e33,_0xae94a2);default:return null;}})['then'](function(_0x347dff){if(_0x347dff&&_0x347dff[_0x5c60('0x36')]){var _0x93d56e=_[_0x5c60('0x3e')](_0x347dff);if(_0x93d56e){return BPromise[_0x5c60('0x2b')]({'id':_0x93d56e['Id'],'name':_0x93d56e[_0x5c60('0x2c')],'phone':_0x93d56e['Phone'],'endUserType':_0x93d56e[_0x5c60('0x3f')]['type']['toLowerCase']()});}}})['then'](function(_0x1b8ed8){if(_0x1b8ed8){logger['info'](_0x5c60('0x40'),_0x1b8ed8['endUserType'],_0x17c5f3);return BPromise[_0x5c60('0x2b')](_0x1b8ed8);}else{logger[_0x5c60('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x17c5f3);var _0x415630={'Phone':_0x17c5f3};if(_0x2df4cb[_0x5c60('0x41')]){if(_0x2df4cb[_0x5c60('0x41')]===_0x5c60('0x17')){logger[_0x5c60('0x1f')](_0x5c60('0x42'),_0x17c5f3,_0x2df4cb[_0x5c60('0x41')]);_0x415630['LastName']=_0x582824!==_0x5c60('0x43')?_0x582824:util['format'](_0x5c60('0x44'),_0x17c5f3);}else if(_0x2df4cb[_0x5c60('0x41')]===_0x5c60('0x18')){logger[_0x5c60('0x1f')](_0x5c60('0x42'),_0x17c5f3,_0x2df4cb[_0x5c60('0x41')]);_0x415630[_0x5c60('0x45')]=_0x582824!==_0x5c60('0x43')?_0x582824:util[_0x5c60('0x46')](_0x5c60('0x44'),_0x17c5f3);_0x415630[_0x5c60('0x47')]=_0x5c60('0x48');}else if(_0x2df4cb['moduleCreate']==='account'){logger[_0x5c60('0x1f')](_0x5c60('0x42'),_0x17c5f3,_0x2df4cb['moduleCreate']);_0x415630[_0x5c60('0x2c')]=_0x582824!==_0x5c60('0x43')?_0x582824:util[_0x5c60('0x46')]('Caller\x20-\x20%s',_0x17c5f3);}else{return null;}}return _0x2e8dbf[_0x5c60('0x21')](_[_0x5c60('0x49')](_0x2df4cb[_0x5c60('0x41')]))['create'](_0x415630)['then'](function(_0x2581ad){return BPromise[_0x5c60('0x2b')]({'id':_0x2581ad['id'],'endUserType':_0x2df4cb[_0x5c60('0x41')]});});}});}function getCustomFields(_0xdf7d44,_0x4b3714){var _0x3c306a={};if(_0xdf7d44[_0x5c60('0x36')]>0x0){_[_0x5c60('0x4a')](_0xdf7d44,function(_0x2a2812){if(_[_0x5c60('0x4b')]([_0x5c60('0x4c'),'picklist'],_0x2a2812[_0x5c60('0x4d')])&&_0x2a2812[_0x5c60('0x4e')]){_0x3c306a[_0x2a2812[_0x5c60('0x4e')]]=_0x2a2812[_0x5c60('0x4f')][_0x5c60('0x50')]();}else if(_0x2a2812['type']===_0x5c60('0x51')&&_0x2a2812[_0x5c60('0x52')]&&_0x2a2812[_0x5c60('0x4e')]){_0x4b3714[_0x2a2812[_0x5c60('0x52')]]&&(_0x3c306a[_0x2a2812[_0x5c60('0x4e')]]=_0x4b3714[_0x2a2812[_0x5c60('0x52')]][_0x5c60('0x50')]());}else if(_0x2a2812['type']===_0x5c60('0x53')&&_0x2a2812[_0x5c60('0x54')]&&_0x2a2812['Variable'][_0x5c60('0x55')]&&_0x2a2812['idField']){_0x4b3714[_0x2a2812[_0x5c60('0x54')][_0x5c60('0x55')][_0x5c60('0x56')]()]&&(_0x3c306a[_0x2a2812['idField']]=_0x4b3714[_0x2a2812[_0x5c60('0x54')][_0x5c60('0x55')][_0x5c60('0x56')]()]['toString']());}});}return _0x3c306a;}function getConnection(_0x4321c7){var _0x18f583=_0x4321c7[_0x5c60('0x57')]['concat'](_0x4321c7[_0x5c60('0x58')]);var _0x40c9d2=new jsforce['Connection']({'oauth2':{'loginUrl':_0x4321c7['remoteUri']||_0x5c60('0x59'),'clientId':_0x4321c7[_0x5c60('0x5a')],'clientSecret':_0x4321c7['clientSecret']}});return _0x40c9d2[_0x5c60('0x5b')](_0x4321c7[_0x5c60('0x5c')],_0x18f583)[_0x5c60('0x27')](function(){logger[_0x5c60('0x1f')](_0x5c60('0x5d'));return _0x40c9d2;});}exports[_0x5c60('0x5e')]=function(_0x4698df,_0x2e435e,_0x526c68,_0x1db959,_0x44f3cb,_0x3c74c7){var _0x4a0408,_0x5d5ce5,_0x28bf55,_0xd6fa30;_0x3c74c7[_0x5c60('0x5f')]=intUtil['stripTrailingSlash'](_0x3c74c7[_0x5c60('0x5f')]);_0x3c74c7['remoteUri']=intUtil[_0x5c60('0x60')](_0x3c74c7[_0x5c60('0x61')]);if(_0x44f3cb&&_0x44f3cb[_0x5c60('0x62')]){logger[_0x5c60('0x1f')](_0x5c60('0x63'),_0x5c60('0x64'));_0x2e435e[_0x5c60('0x65')]=util[_0x5c60('0x46')](_0x5c60('0x66'),_0x3c74c7[_0x5c60('0x5f')],_0x2e435e['uniqueid'],md5(_0x2e435e[_0x5c60('0x67')]));}else{_0x2e435e[_0x5c60('0x65')]='';}return getConnection(_0x3c74c7)['then'](function(_0x5c7e0f){_0xd6fa30=_0x5c7e0f;return getUser(_0x3c74c7,_0x1db959[_0x5c60('0x68')],_0xd6fa30);})['then'](function(_0x40e62c){_0x4a0408=_0x40e62c;return getEndUser(_0x3c74c7,_0x526c68,_0x2e435e[_0x5c60('0x69')],_0x2e435e[_0x5c60('0x6a')],_0xd6fa30);})[_0x5c60('0x27')](function(_0x30627e){_0x5d5ce5=_0x30627e;return getTicket(_0x3c74c7,_0x4a0408,_0x5d5ce5,_0x526c68,_0x2e435e,_0x526c68[_0x5c60('0x6b')],_0xd6fa30,_0x5c60('0x5e'));})['then'](function(_0x3030d6){_0x28bf55=_0x3030d6;logger[_0x5c60('0x1f')](_0x5c60('0x6c'),_0x28bf55['id']);logger[_0x5c60('0x1f')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x28bf55['id'],_0x1db959['name'],_0x3c74c7[_0x5c60('0x4d')]);switch(_0x3c74c7[_0x5c60('0x4d')]){case'integrationTab':emit(util[_0x5c60('0x46')]('user:%s',_0x1db959['name']),_0x5c60('0x6d'),{'recordId':_0x28bf55['id']});break;case'newTab':emit(util['format'](_0x5c60('0x6e'),_0x1db959['name']),'trigger:browser:url',{'uri':util[_0x5c60('0x46')](_0x5c60('0x6f'),_0xd6fa30[_0x5c60('0x70')],_0x28bf55['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x5c60('0x71')](function(_0x74d010){logger['error']('[QUEUE]',_0x74d010);});};exports[_0x5c60('0x72')]=function(_0x4fe8e1,_0x31b53d,_0x4e6172,_0x2c9254,_0x56dd8f,_0x1bbc02,_0xd2d6a9){var _0x16e4f2,_0x4f4a40,_0xc6a27f,_0x7f42a1;_0x1bbc02[_0x5c60('0x5f')]=intUtil[_0x5c60('0x60')](_0x1bbc02[_0x5c60('0x5f')]);_0x1bbc02['remoteUri']=intUtil[_0x5c60('0x60')](_0x1bbc02[_0x5c60('0x61')]);if(_0xd2d6a9&&_0xd2d6a9[_0x5c60('0x73')]&&_0xd2d6a9['recordingFormat']!=='none'){logger[_0x5c60('0x1f')](_0x5c60('0x74'),'Recording\x20is\x20enabled!');_0x31b53d[_0x5c60('0x65')]=util[_0x5c60('0x46')](_0x5c60('0x66'),_0x1bbc02['serverUrl'],_0x31b53d[_0x5c60('0x67')],md5(_0x31b53d['uniqueid']));}return getConnection(_0x1bbc02)[_0x5c60('0x27')](function(_0x59d524){_0x7f42a1=_0x59d524;return getUser(_0x1bbc02,_0x2c9254[_0x5c60('0x68')],_0x7f42a1);})[_0x5c60('0x27')](function(_0x4f2b16){_0x16e4f2=_0x4f2b16;return getEndUser(_0x1bbc02,_0x4e6172,_0x31b53d[_0x5c60('0x75')],_0x31b53d['destcalleridnum'],_0x7f42a1);})['then'](function(_0x3774a3){_0x4f4a40=_0x3774a3;return getTicket(_0x1bbc02,_0x16e4f2,_0x4f4a40,_0x4e6172,_0x31b53d,_0x4e6172['Fields'],_0x7f42a1,_0x5c60('0x72'));})[_0x5c60('0x27')](function(_0x1f60e7){_0xc6a27f=_0x1f60e7;logger[_0x5c60('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0xc6a27f['id']);logger[_0x5c60('0x1f')](_0x5c60('0x76'),_0xc6a27f['id'],_0x2c9254[_0x5c60('0x55')],_0x1bbc02['type']);switch(_0x1bbc02['type']){case _0x5c60('0x77'):emit(util[_0x5c60('0x46')](_0x5c60('0x6e'),_0x2c9254[_0x5c60('0x55')]),'trigger:salesforce:display',{'recordId':_0xc6a27f['id']});break;case _0x5c60('0x78'):emit(util['format'](_0x5c60('0x6e'),_0x2c9254[_0x5c60('0x55')]),_0x5c60('0x79'),{'uri':util[_0x5c60('0x46')](_0x5c60('0x6f'),_0x7f42a1[_0x5c60('0x70')],_0xc6a27f['id'])});break;default:logger['error'](_0x5c60('0x74'),_0x5c60('0x7a'));}})[_0x5c60('0x71')](function(_0x2ca890){logger[_0x5c60('0x7b')](_0x5c60('0x74'),_0x2ca890);});};exports['unmanaged']=function(_0x58ba75,_0x40c6e2,_0x7a9a15,_0x50c765,_0x5b7454,_0x38194f){var _0xc4cc2f,_0x3258dc,_0x70d2e5,_0x456f1a;_0x38194f[_0x5c60('0x5f')]=intUtil[_0x5c60('0x60')](_0x38194f[_0x5c60('0x5f')]);_0x38194f[_0x5c60('0x61')]=intUtil[_0x5c60('0x60')](_0x38194f[_0x5c60('0x61')]);if(_0x5b7454&&_0x5b7454[_0x5c60('0x62')]){logger[_0x5c60('0x1f')]('['+_0x40c6e2[_0x5c60('0x7c')][_0x5c60('0x7d')]()+']',_0x5c60('0x64'));_0x40c6e2[_0x5c60('0x65')]=util['format'](_0x5c60('0x66'),_0x38194f[_0x5c60('0x5f')],_0x40c6e2[_0x5c60('0x67')],md5(_0x40c6e2[_0x5c60('0x67')]));}else{_0x40c6e2['recordingURL']='';}return getConnection(_0x38194f)['then'](function(_0x19ef78){_0x456f1a=_0x19ef78;if(!_[_0x5c60('0x23')](_0x50c765)){return getUser(_0x38194f,_0x50c765['name'],_0x456f1a);}else{return getUser(_0x38194f,null,_0x456f1a);}})['then'](function(_0x260135){_0xc4cc2f=_0x260135;return getEndUser(_0x38194f,_0x7a9a15,_0x40c6e2[_0x5c60('0x69')],_0x40c6e2['calleridnum'],_0x456f1a);})[_0x5c60('0x27')](function(_0x57251d){_0x3258dc=_0x57251d;return getTicket(_0x38194f,_0xc4cc2f,_0x3258dc,_0x7a9a15,_0x40c6e2,_0x7a9a15['Fields'],_0x456f1a);})['then'](function(_0xa86438){_0x70d2e5=_0xa86438;logger['info']('['+_0x40c6e2[_0x5c60('0x7c')][_0x5c60('0x7d')]()+_0x5c60('0x7e'),_0x70d2e5['id']);logger[_0x5c60('0x1f')]('['+_0x40c6e2['lastevent'][_0x5c60('0x7d')]()+_0x5c60('0x7f'),_0x38194f[_0x5c60('0x4d')]);})[_0x5c60('0x71')](function(_0x2fd67e){logger[_0x5c60('0x7b')]('['+_0x40c6e2['lastevent'][_0x5c60('0x7d')]()+']',_0x2fd67e);});}; \ 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 d5f36a2..76024b3 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 _0x662e=['nameField','toLowerCase','content','toString','picklist','type','idField','customField','variable','variableName','customVariable','name','Variable',']\x20getTicket\x20input\x20crm','outbound','POST','incident','userId','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','all','push','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','isNil','email','adminEmail','destcalleridnum','calleridnum','queue','format','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','call\x20direction:\x20%s','unmanaged',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','adminId','],\x20createEndUser\x20input\x20crm','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string'];(function(_0x59fba7,_0x2c340c){var _0x40d69e=function(_0x1a5507){while(--_0x1a5507){_0x59fba7['push'](_0x59fba7['shift']());}};_0x40d69e(++_0x2c340c);}(_0x662e,0x1f2));var _0xe662=function(_0x1b4c66,_0xfdb5d7){_0x1b4c66=_0x1b4c66-0x0;var _0x2883d5=_0x662e[_0x1b4c66];return _0x2883d5;};'use strict';var _=require('lodash');var Promise=require(_0xe662('0x0'));var rp=require(_0xe662('0x1'));var util=require('util');var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0xe662('0x2'));var config=require(_0xe662('0x3'));var logger=require(_0xe662('0x4'))(_0xe662('0x5'));config['redis']=_['defaults'](config[_0xe662('0x6')],{'host':_0xe662('0x7'),'port':0x18eb});var io=require(_0xe662('0x8'))(new Redis(config[_0xe662('0x6')]));function getAdminUser(_0x4e3416,_0x520221,_0x47345a,_0x361e15,_0x51d4eb,_0x502617){return new Promise(function(_0x24d14c,_0x4ef245){var _0x2882b9={'method':_0xe662('0x9'),'uri':_0x361e15+_0xe662('0xa')+'&'+_0x51d4eb+'&'+_0x502617,'auth':_0x520221,'json':!![]};return rp(_0x2882b9)[_0xe662('0xb')](function(_0xc6926d){if(_0xc6926d[_0xe662('0xc')]['length']>0x0){_0x47345a['adminId']=_0xc6926d[_0xe662('0xc')][0x0][_0xe662('0xd')];}logger[_0xe662('0xe')]('['+[_0x4e3416['toUpperCase']()]+_0xe662('0xf'),_0x47345a);_0x24d14c(_0x47345a);})[_0xe662('0x10')](function(_0x45198b){logger[_0xe662('0x11')]('['+[_0x4e3416[_0xe662('0x12')]()]+']',_0x45198b[_0xe662('0x13')]);_0x4ef245(_0x45198b[_0xe662('0x13')]);});});}function getUser(_0x4835d6,_0x2a8570,_0x13de32,_0x1f9926,_0x206dbf){return function(_0x1ac67a){logger['info']('['+[_0x4835d6['toUpperCase']()]+_0xe662('0x14'),_0x1ac67a);return new Promise(function(_0x56c866,_0x49312d){if(intUtil[_0xe662('0x15')](_0x1ac67a[_0xe662('0x16')])){var _0x3716c1={'method':'GET','uri':_0x13de32+_0xe662('0x17')+_0x1ac67a[_0xe662('0x16')]+'&'+_0x1f9926+'&'+_0x206dbf,'auth':_0x2a8570,'json':!![]};logger['info']('['+[_0x4835d6[_0xe662('0x12')]()]+_0xe662('0x18'),_0x3716c1);return rp(_0x3716c1)[_0xe662('0xb')](function(_0x51a265){logger[_0xe662('0xe')]('['+[_0x4835d6['toUpperCase']()]+_0xe662('0x19'),_0x51a265);if(_0x51a265['result'][_0xe662('0x1a')]>0x0&&String(_0x51a265[_0xe662('0xc')][0x0][_0xe662('0x1b')])==='true'){_0x1ac67a['userId']=_0x51a265[_0xe662('0xc')][0x0][_0xe662('0xd')];}else{_0x1ac67a['userId']=_0x1ac67a['adminId'];_0x1ac67a['userEmail']=_0x1ac67a['adminEmail'];}logger['info']('['+[_0x4835d6[_0xe662('0x12')]()]+'],\x20getUser\x20crm',_0x1ac67a);_0x56c866(_0x1ac67a);})[_0xe662('0x10')](function(_0x339161){logger['error']('['+[_0x4835d6[_0xe662('0x12')]()]+']',_0x339161[_0xe662('0x13')]);_0x49312d(_0x339161[_0xe662('0x13')]);});}else{logger[_0xe662('0xe')]('['+[_0x4835d6[_0xe662('0x12')]()]+']\x20using\x20admin\x20profile');_0x1ac67a['userId']=_0x1ac67a[_0xe662('0x1c')];_0x1ac67a[_0xe662('0x16')]=_0x1ac67a['adminEmail'];_0x56c866(_0x1ac67a);}});};}function createEndUser(_0x1f240f,_0x262c26,_0x32ffeb,_0xd21b94,_0x5b747c){logger['info']('['+[_0x1f240f[_0xe662('0x12')]()]+_0xe662('0x1d'),_0x32ffeb);return new Promise(function(_0x2e1b22,_0x1c1757){var _0x143bed={'method':'POST','uri':_0xd21b94+'sys_user?'+_0x5b747c,'body':{'user_name':_0x32ffeb[_0xe662('0x1e')],'roles':_0xe662('0x1f'),'first_name':_0x32ffeb[_0xe662('0x1e')],'active':_0xe662('0x20'),'date_format':_0xe662('0x21'),'phone':_0x32ffeb[_0xe662('0x1e')]},'auth':_0x262c26,'json':!![]};return rp(_0x143bed)[_0xe662('0xb')](function(_0x1665df){logger[_0xe662('0xe')]('['+[_0x1f240f['toUpperCase']()]+_0xe662('0x22'),_0x1665df[_0xe662('0xc')]);_0x32ffeb[_0xe662('0x23')]=_0x1665df[_0xe662('0xc')][_0xe662('0xd')];_0x2e1b22(_0x32ffeb);})[_0xe662('0x10')](function(_0x369057){logger[_0xe662('0x11')]('['+[_0x1f240f['toUpperCase']()]+']',_0x369057[_0xe662('0x13')]);_0x1c1757(_0x369057[_0xe662('0x13')]);});});}function getEndUser(_0x234c53,_0x25683f,_0x430834,_0x4256b4,_0x1e4bb7){return function(_0x105c15){logger['info']('['+[_0x234c53['toUpperCase']()]+_0xe662('0x24'),_0x105c15);return new Promise(function(_0x3a86f5,_0x4d3a5b){var _0x57588a={'method':_0xe662('0x9'),'uri':_0x430834+_0xe662('0x25')+_0x105c15[_0xe662('0x1e')]+'&'+_0x4256b4+'&'+_0x1e4bb7,'auth':_0x25683f,'json':!![]};return rp(_0x57588a)['then'](function(_0x13434d){if(_0x13434d['result'][_0xe662('0x1a')]>0x0){_0x105c15[_0xe662('0x23')]=_0x13434d['result'][0x0][_0xe662('0xd')];logger[_0xe662('0xe')]('['+[_0x234c53[_0xe662('0x12')]()]+'],\x20getEndUser\x20crm',_0x105c15);_0x3a86f5(_0x105c15);}else{return createEndUser(_0x234c53,_0x25683f,_0x105c15,_0x430834,_0x4256b4)[_0xe662('0xb')](function(_0x3280fd){logger[_0xe662('0xe')]('['+[_0x234c53[_0xe662('0x12')]()]+_0xe662('0x26'),_0x3280fd);_0x3a86f5(_0x3280fd);});}})[_0xe662('0x10')](function(_0x319b9c){logger[_0xe662('0x11')]('['+[_0x234c53[_0xe662('0x12')]()]+']',_0x319b9c[_0xe662('0x13')]);_0x4d3a5b(_0x319b9c[_0xe662('0x13')]);});});};}function getCustomFields(_0x5aad6f,_0x1bd66c){var _0x53c4b4={};if(_0x5aad6f['length']>0x0){_[_0xe662('0x27')](_0x5aad6f,function(_0x4cb554){if(_[_0xe662('0x28')]([_0xe662('0x29'),'picklist'],_0x4cb554['type'])&&_0x4cb554['nameField']&&!_0x4cb554['customField']){_0x53c4b4[_0x4cb554[_0xe662('0x2a')][_0xe662('0x2b')]()]=_0x4cb554[_0xe662('0x2c')][_0xe662('0x2d')]();}else if(_[_0xe662('0x28')]([_0xe662('0x29'),_0xe662('0x2e')],_0x4cb554[_0xe662('0x2f')])&&_0x4cb554[_0xe662('0x30')]&&_0x4cb554[_0xe662('0x31')]){_0x53c4b4[_0x4cb554['idField'][_0xe662('0x2b')]()]=_0x4cb554['content']['toString']();}else if(_0x4cb554['type']===_0xe662('0x32')&&_0x4cb554[_0xe662('0x33')]&&_0x4cb554['idField']&&_0x4cb554['customField']){_0x53c4b4[_0x4cb554['idField'][_0xe662('0x2b')]()]=_0x1bd66c[_0x4cb554['variableName']][_0xe662('0x2d')]();}else if(_0x4cb554[_0xe662('0x2f')]===_0xe662('0x34')&&_0x4cb554['Variable']&&_0x4cb554['Variable'][_0xe662('0x35')]&&_0x4cb554[_0xe662('0x30')]&&_0x4cb554['customField']){_0x53c4b4[_0x4cb554[_0xe662('0x30')][_0xe662('0x2b')]()]=_0x1bd66c[_0x4cb554[_0xe662('0x36')][_0xe662('0x35')]['toLowerCase']()][_0xe662('0x2d')]();}});}return _0x53c4b4;}function getTicket(_0x219598,_0x403bdc,_0xee5d7e,_0x30fa68,_0x5d73f6,_0x1b67ee){return function(_0x408c27){logger['info']('['+[_0x219598['toUpperCase']()]+_0xe662('0x37'),_0x408c27);return new Promise(function(_0x1c253e,_0x5ece69){var _0x2081a9=_0x219598[_0xe662('0x2b')]()===_0xe662('0x38')?_0x408c27['userId']:_0x408c27[_0xe662('0x23')];var _0x15ae79={'method':_0xe662('0x39'),'uri':_0xee5d7e+_0xe662('0x3a')+'?'+_0x1b67ee,'body':Object['assign']({},{'active':'true','caller_id':_0x2081a9,'assigned_to':_0x408c27[_0xe662('0x3b')],'short_description':intUtil[_0xe662('0x3c')](_0x30fa68['Subjects'],_0x5d73f6,'\x20'),'description':intUtil['getString'](_0x30fa68[_0xe662('0x3d')],_0x5d73f6,'\x0a')},getCustomFields(_0x30fa68[_0xe662('0x3e')],_0x5d73f6)),'auth':_0x403bdc,'json':!![]};return rp(_0x15ae79)[_0xe662('0xb')](function(_0x53ef59){logger[_0xe662('0xe')]('['+[_0x219598[_0xe662('0x12')]()]+_0xe662('0x3f'),_0x53ef59[_0xe662('0xc')]);_0x408c27[_0xe662('0x40')]=_0x53ef59[_0xe662('0xc')][_0xe662('0xd')];_0x408c27[_0xe662('0x41')]=_0x53ef59[_0xe662('0xc')][_0xe662('0x42')];logger[_0xe662('0xe')]('['+[_0x219598[_0xe662('0x12')]()]+']\x20getTicket\x20crm',_0x408c27);_0x1c253e(_0x408c27);})['catch'](function(_0xa12959){logger[_0xe662('0x11')]('['+[_0x219598[_0xe662('0x12')]()]+']',_0xa12959[_0xe662('0x13')]);_0x5ece69(_0xa12959[_0xe662('0x13')]);});});};}function createRemoteTag(_0x23f300,_0x1342a6,_0x540823,_0x52b6fd){return new Promise(function(_0x2f4bf4,_0x2d64db){var _0x3808ae={'method':_0xe662('0x39'),'uri':_0x540823+_0xe662('0x43')+'?'+_0x52b6fd,'body':{'short_description':_0x23f300,'global':!![],'active':!![],'name':_0x23f300},'auth':_0x1342a6,'json':!![]};return rp(_0x3808ae)[_0xe662('0xb')](function(_0x40c148){var _0x1cb4e8=_0x40c148['result'][_0xe662('0xd')];_0x2f4bf4(_0x1cb4e8);});});}function getRemoteTag(_0x3565c8,_0xa71210,_0x5bfafc,_0x1946f7,_0x5cf498){return new Promise(function(_0x4adb03,_0x3647c5){var _0x27c611={'method':_0xe662('0x9'),'uri':_0x5bfafc+_0xe662('0x43')+_0xe662('0x44')+_0x3565c8+'&'+_0x1946f7,'auth':_0xa71210,'json':!![]};return rp(_0x27c611)[_0xe662('0xb')](function(_0x3adb64){if(_0x3adb64['result'][_0xe662('0x1a')]>0x0){var _0x50fdc1=_0x3adb64[_0xe662('0xc')][0x0][_0xe662('0xd')];_0x4adb03(_0x50fdc1);}else{return createRemoteTag(_0x3565c8,_0xa71210,_0x5bfafc,_0x1946f7)[_0xe662('0xb')](function(_0x494b39){_0x4adb03(_0x494b39);});}});});}function assignTagToIncident(_0x38064f,_0x59ca12,_0x71d57d,_0x1086d2,_0x30eab6){return new Promise(function(_0x42fd2d,_0x2c5dbe){var _0x329f10={'method':_0xe662('0x39'),'uri':_0x71d57d+_0xe662('0x45')+'?'+_0x30eab6,'body':{'label':_0x38064f,'table':'incident','id_type':_0xe662('0x46'),'table_key':_0x1086d2[_0xe662('0x40')],'title':_0xe662('0x47')+_0x1086d2['ticketNumber'],'id_display':_0x1086d2[_0xe662('0x41')]},'auth':_0x59ca12,'json':!![]};return rp(_0x329f10)[_0xe662('0xb')](function(_0x4218bc){_0x42fd2d();})['catch'](function(){_0x42fd2d();});});}function manageTags(_0x4b98c8,_0x4a65ba,_0x50205d,_0x4008ad,_0x35d6bf,_0x263c86,_0x52d2b0){return new Promise(function(_0x310458,_0x2c7a50){var _0x1972cf=[];_0x4a65ba[_0xe662('0x27')](function(_0x22eec4){_0x1972cf['push'](getRemoteTag(_0x22eec4,_0x50205d,_0x4008ad,_0x263c86,_0x52d2b0));});return Promise[_0xe662('0x48')](_0x1972cf)['then'](function(_0xbc2a1c){if(_0xbc2a1c[_0xe662('0x1a')]){logger[_0xe662('0xe')]('['+[_0x4b98c8[_0xe662('0x12')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0xbc2a1c);var _0x5a3a95=[];_0xbc2a1c[_0xe662('0x27')](function(_0x3937f2){_0x5a3a95[_0xe662('0x49')](assignTagToIncident(_0x3937f2,_0x50205d,_0x4008ad,_0x35d6bf,_0x263c86));});return Promise[_0xe662('0x48')](_0x5a3a95)[_0xe662('0xb')](function(){_0x310458();})[_0xe662('0x10')](function(){_0x310458();});}else{_0x310458();}});});}function getTags(_0x3b84f9,_0x1b0ebd,_0x3b5a62,_0x424dfa,_0x126237,_0x113618){return function(_0x3262db){return new Promise(function(_0x21987a,_0x278a16){var _0x1e8b2c=[];var _0x5a784d=_0x424dfa['Tags'];if(_0x5a784d&&_0x5a784d[_0xe662('0x1a')]>0x0){_0x1e8b2c=_[_0xe662('0x4a')](_0x5a784d,_0xe662('0x35'));}if(_0x1e8b2c[_0xe662('0x1a')]>0x0){return manageTags(_0x3b84f9,_0x1e8b2c,_0x1b0ebd,_0x3b5a62,_0x3262db,_0x126237,_0x113618)[_0xe662('0xb')](function(){_0x21987a(_0x3262db);});}else{_0x21987a(_0x3262db);}});};}function emit(_0x3a205c,_0x29c34e,_0x30ef8d){var _0x9fa6c9=_0xe662('0x4b')+_0xe662('0x4c')+_0xe662('0x4d')+'%255EORDERBYDESCnumber';var _0x1b4785={'uri':_0x3a205c+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x30ef8d+_0x9fa6c9};io['to'](util['format'](_0xe662('0x4e'),_0x29c34e))[_0xe662('0x4f')](_0xe662('0x50'),_0x1b4785);}exports['cs']=function(_0x499719,_0x10313f,_0x5a7ab9,_0x161a62,_0x23da2a,_0x3803bb,_0x81410e,_0x2328d2){var _0x2ca598={};var _0x294f59={'user':_0x3803bb[_0xe662('0x51')],'pass':_0x3803bb[_0xe662('0x52')]};var _0x49547c=_0xe662('0x53');var _0x194f4d=_0xe662('0x54');_0x3803bb['remoteUri']=intUtil[_0xe662('0x55')](_0x3803bb[_0xe662('0x56')]);_0x3803bb[_0xe662('0x57')]=intUtil[_0xe662('0x55')](_0x3803bb['serverUrl']);var _0x3d0f45=util['format'](_0xe662('0x58'),_0x3803bb[_0xe662('0x56')]);_0x2ca598['userEmail']=!_[_0xe662('0x59')](_0x161a62)?_0x161a62[_0xe662('0x5a')]:null;_0x2ca598[_0xe662('0x5b')]=_0x3803bb['email'];_0x2ca598[_0xe662('0x1e')]=_0x2328d2[_0xe662('0x2b')]()==='outbound'?_0x10313f[_0xe662('0x5c')]:_0x10313f[_0xe662('0x5d')];_0x2ca598['callDirection']=_0x2328d2===_0xe662('0x5e')||_0x2328d2==='unmanaged'?_0xe662('0x5e'):_0xe662('0x38');var _0x53c91b=util[_0xe662('0x5f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3803bb['serverUrl'],_0x10313f[_0xe662('0x60')],md5(_0x10313f[_0xe662('0x60')]));if(_0x23da2a&&_0x23da2a[_0xe662('0x61')]){logger[_0xe662('0xe')](_0xe662('0x62'),'Recording\x20is\x20enabled!');_0x10313f[_0xe662('0x63')]=_0x53c91b;}else if(_0x81410e&&_0x81410e['recordingFormat']&&_0x81410e[_0xe662('0x64')]!==_0xe662('0x65')){logger['info'](_0xe662('0x66'),_0xe662('0x67'));_0x10313f[_0xe662('0x63')]=_0x53c91b;}else{_0x10313f[_0xe662('0x63')]='';}return getAdminUser(_0x2328d2,_0x294f59,_0x2ca598,_0x3d0f45,_0x194f4d,_0x49547c)[_0xe662('0xb')](getUser(_0x2328d2,_0x294f59,_0x3d0f45,_0x194f4d,_0x49547c))[_0xe662('0xb')](getEndUser(_0x2328d2,_0x294f59,_0x3d0f45,_0x194f4d,_0x49547c))['then'](getTicket(_0x2328d2,_0x294f59,_0x3d0f45,_0x5a7ab9,_0x10313f,_0x194f4d))['then'](function(_0x1d9626){logger['info'](util[_0xe662('0x5f')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1d9626[_0xe662('0x40')]));logger[_0xe662('0xe')](util[_0xe662('0x5f')](_0xe662('0x68'),_0x2328d2));if(_0x2328d2!==_0xe662('0x69')){logger[_0xe662('0xe')]('['+[_0x2328d2[_0xe662('0x12')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3803bb['remoteUri'],_0x161a62[_0xe662('0x35')],_0x1d9626[_0xe662('0x40')]);}})[_0xe662('0x10')](function(_0x4466f6){logger[_0xe662('0x11')]('['+[_0x2328d2[_0xe662('0x12')]()]+_0xe662('0x6a'),util[_0xe662('0x6b')](_0x4466f6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x61a1=['],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist','type','nameField','content','toString','idField','toLowerCase','variable','variableName','customField','customVariable','Variable','name','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','ticketNumber','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','adminEmail','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','result','length','active','true','userId','sys_id','adminId','],\x20getUser\x20crm','message','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','endUserId'];(function(_0x430efc,_0x1b3fe8){var _0xe32703=function(_0xceaea1){while(--_0xceaea1){_0x430efc['push'](_0x430efc['shift']());}};_0xe32703(++_0x1b3fe8);}(_0x61a1,0x127));var _0x161a=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0x61a1[_0x9a3e0f];return _0x3d2a9a;};'use strict';var _=require(_0x161a('0x0'));var Promise=require(_0x161a('0x1'));var rp=require(_0x161a('0x2'));var util=require(_0x161a('0x3'));var md5=require(_0x161a('0x4'));var Redis=require('ioredis');var intUtil=require(_0x161a('0x5'));var config=require(_0x161a('0x6'));var logger=require('../../../../config/logger')(_0x161a('0x7'));config[_0x161a('0x8')]=_[_0x161a('0x9')](config[_0x161a('0x8')],{'host':_0x161a('0xa'),'port':0x18eb});var io=require(_0x161a('0xb'))(new Redis(config[_0x161a('0x8')]));function getAdminUser(_0x182e6c,_0x3e07e5,_0x15cde9,_0x1bb849,_0x229381,_0x405108){return new Promise(function(_0x2e7b19,_0x46ee90){var _0x2077b6={'method':_0x161a('0xc'),'uri':_0x1bb849+_0x161a('0xd')+'&'+_0x229381+'&'+_0x405108,'auth':_0x3e07e5,'json':!![]};return rp(_0x2077b6)[_0x161a('0xe')](function(_0x1c6814){if(_0x1c6814['result']['length']>0x0){_0x15cde9['adminId']=_0x1c6814['result'][0x0]['sys_id'];}logger[_0x161a('0xf')]('['+[_0x182e6c[_0x161a('0x10')]()]+_0x161a('0x11'),_0x15cde9);_0x2e7b19(_0x15cde9);})[_0x161a('0x12')](function(_0x46fcf7){logger[_0x161a('0x13')]('['+[_0x182e6c[_0x161a('0x10')]()]+']',_0x46fcf7['message']);_0x46ee90(_0x46fcf7['message']);});});}function getUser(_0x559ec5,_0x2b2a3e,_0x42eebf,_0x4cbdb3,_0x359ccd){return function(_0x32b1a3){logger['info']('['+[_0x559ec5[_0x161a('0x10')]()]+_0x161a('0x14'),_0x32b1a3);return new Promise(function(_0x1dd836,_0x126b72){if(intUtil[_0x161a('0x15')](_0x32b1a3[_0x161a('0x16')])){var _0x25a286={'method':_0x161a('0xc'),'uri':_0x42eebf+_0x161a('0x17')+_0x32b1a3[_0x161a('0x16')]+'&'+_0x4cbdb3+'&'+_0x359ccd,'auth':_0x2b2a3e,'json':!![]};logger[_0x161a('0xf')]('['+[_0x559ec5[_0x161a('0x10')]()]+_0x161a('0x18'),_0x25a286);return rp(_0x25a286)['then'](function(_0x25b8ae){logger[_0x161a('0xf')]('['+[_0x559ec5[_0x161a('0x10')]()]+_0x161a('0x19'),_0x25b8ae);if(_0x25b8ae[_0x161a('0x1a')][_0x161a('0x1b')]>0x0&&String(_0x25b8ae[_0x161a('0x1a')][0x0][_0x161a('0x1c')])===_0x161a('0x1d')){_0x32b1a3[_0x161a('0x1e')]=_0x25b8ae['result'][0x0][_0x161a('0x1f')];}else{_0x32b1a3['userId']=_0x32b1a3[_0x161a('0x20')];_0x32b1a3[_0x161a('0x16')]=_0x32b1a3['adminEmail'];}logger[_0x161a('0xf')]('['+[_0x559ec5[_0x161a('0x10')]()]+_0x161a('0x21'),_0x32b1a3);_0x1dd836(_0x32b1a3);})[_0x161a('0x12')](function(_0x1541c6){logger[_0x161a('0x13')]('['+[_0x559ec5[_0x161a('0x10')]()]+']',_0x1541c6[_0x161a('0x22')]);_0x126b72(_0x1541c6['message']);});}else{logger[_0x161a('0xf')]('['+[_0x559ec5[_0x161a('0x10')]()]+']\x20using\x20admin\x20profile');_0x32b1a3['userId']=_0x32b1a3[_0x161a('0x20')];_0x32b1a3[_0x161a('0x16')]=_0x32b1a3['adminEmail'];_0x1dd836(_0x32b1a3);}});};}function createEndUser(_0x1472c7,_0x4a3eb6,_0x5def9c,_0x17cca5,_0xdc57e){logger[_0x161a('0xf')]('['+[_0x1472c7[_0x161a('0x10')]()]+_0x161a('0x23'),_0x5def9c);return new Promise(function(_0x33d3ec,_0x42d781){var _0x4ecf5d={'method':_0x161a('0x24'),'uri':_0x17cca5+_0x161a('0x25')+_0xdc57e,'body':{'user_name':_0x5def9c[_0x161a('0x26')],'roles':_0x161a('0x27'),'first_name':_0x5def9c['endUserNumber'],'active':'true','date_format':_0x161a('0x28'),'phone':_0x5def9c[_0x161a('0x26')]},'auth':_0x4a3eb6,'json':!![]};return rp(_0x4ecf5d)[_0x161a('0xe')](function(_0x234ccd){logger[_0x161a('0xf')]('['+[_0x1472c7[_0x161a('0x10')]()]+_0x161a('0x29'),_0x234ccd[_0x161a('0x1a')]);_0x5def9c['endUserId']=_0x234ccd[_0x161a('0x1a')][_0x161a('0x1f')];_0x33d3ec(_0x5def9c);})[_0x161a('0x12')](function(_0x437727){logger['error']('['+[_0x1472c7[_0x161a('0x10')]()]+']',_0x437727[_0x161a('0x22')]);_0x42d781(_0x437727[_0x161a('0x22')]);});});}function getEndUser(_0x14d033,_0x189962,_0x1102df,_0x3e6648,_0x17dede){return function(_0x4a1a75){logger[_0x161a('0xf')]('['+[_0x14d033[_0x161a('0x10')]()]+_0x161a('0x2a'),_0x4a1a75);return new Promise(function(_0x6fbae0,_0x484763){var _0x391288={'method':_0x161a('0xc'),'uri':_0x1102df+'sys_user?sysparm_query=phone%3D'+_0x4a1a75[_0x161a('0x26')]+'&'+_0x3e6648+'&'+_0x17dede,'auth':_0x189962,'json':!![]};return rp(_0x391288)[_0x161a('0xe')](function(_0x4a0b41){if(_0x4a0b41[_0x161a('0x1a')][_0x161a('0x1b')]>0x0){_0x4a1a75[_0x161a('0x2b')]=_0x4a0b41[_0x161a('0x1a')][0x0][_0x161a('0x1f')];logger[_0x161a('0xf')]('['+[_0x14d033[_0x161a('0x10')]()]+_0x161a('0x2c'),_0x4a1a75);_0x6fbae0(_0x4a1a75);}else{return createEndUser(_0x14d033,_0x189962,_0x4a1a75,_0x1102df,_0x3e6648)[_0x161a('0xe')](function(_0xe56231){logger[_0x161a('0xf')]('['+[_0x14d033[_0x161a('0x10')]()]+_0x161a('0x2d'),_0xe56231);_0x6fbae0(_0xe56231);});}})[_0x161a('0x12')](function(_0x36deef){logger[_0x161a('0x13')]('['+[_0x14d033[_0x161a('0x10')]()]+']',_0x36deef[_0x161a('0x22')]);_0x484763(_0x36deef[_0x161a('0x22')]);});});};}function getCustomFields(_0x2b8b37,_0x4708fb){var _0x50085c={};if(_0x2b8b37[_0x161a('0x1b')]>0x0){_[_0x161a('0x2e')](_0x2b8b37,function(_0x36a1b8){if(_[_0x161a('0x2f')](['string',_0x161a('0x30')],_0x36a1b8[_0x161a('0x31')])&&_0x36a1b8[_0x161a('0x32')]&&!_0x36a1b8['customField']){_0x50085c[_0x36a1b8['nameField']['toLowerCase']()]=_0x36a1b8[_0x161a('0x33')][_0x161a('0x34')]();}else if(_[_0x161a('0x2f')](['string',_0x161a('0x30')],_0x36a1b8['type'])&&_0x36a1b8['idField']&&_0x36a1b8['customField']){_0x50085c[_0x36a1b8[_0x161a('0x35')][_0x161a('0x36')]()]=_0x36a1b8['content'][_0x161a('0x34')]();}else if(_0x36a1b8[_0x161a('0x31')]===_0x161a('0x37')&&_0x36a1b8[_0x161a('0x38')]&&_0x36a1b8['idField']&&_0x36a1b8[_0x161a('0x39')]){_0x50085c[_0x36a1b8[_0x161a('0x35')][_0x161a('0x36')]()]=_0x4708fb[_0x36a1b8['variableName']][_0x161a('0x34')]();}else if(_0x36a1b8['type']===_0x161a('0x3a')&&_0x36a1b8[_0x161a('0x3b')]&&_0x36a1b8[_0x161a('0x3b')][_0x161a('0x3c')]&&_0x36a1b8[_0x161a('0x35')]&&_0x36a1b8[_0x161a('0x39')]){_0x50085c[_0x36a1b8[_0x161a('0x35')][_0x161a('0x36')]()]=_0x4708fb[_0x36a1b8['Variable'][_0x161a('0x3c')][_0x161a('0x36')]()][_0x161a('0x34')]();}});}return _0x50085c;}function getTicket(_0x5f2f9e,_0x4949f6,_0x302af9,_0x39d3b0,_0x29429e,_0xf0b61b){return function(_0x3e9067){logger['info']('['+[_0x5f2f9e[_0x161a('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x3e9067);return new Promise(function(_0xcc75e4,_0x4185b2){var _0xe83c49=_0x5f2f9e[_0x161a('0x36')]()===_0x161a('0x3d')?_0x3e9067['userId']:_0x3e9067['endUserId'];var _0x1b744a={'method':_0x161a('0x24'),'uri':_0x302af9+'incident'+'?'+_0xf0b61b,'body':Object[_0x161a('0x3e')]({},{'active':_0x161a('0x1d'),'caller_id':_0xe83c49,'assigned_to':_0x3e9067['userId'],'short_description':intUtil[_0x161a('0x3f')](_0x39d3b0[_0x161a('0x40')],_0x29429e,'\x20'),'description':intUtil[_0x161a('0x3f')](_0x39d3b0[_0x161a('0x41')],_0x29429e,'\x0a')},getCustomFields(_0x39d3b0[_0x161a('0x42')],_0x29429e)),'auth':_0x4949f6,'json':!![]};return rp(_0x1b744a)['then'](function(_0x5bbd22){logger[_0x161a('0xf')]('['+[_0x5f2f9e['toUpperCase']()]+_0x161a('0x43'),_0x5bbd22['result']);_0x3e9067[_0x161a('0x44')]=_0x5bbd22[_0x161a('0x1a')][_0x161a('0x1f')];_0x3e9067['ticketNumber']=_0x5bbd22[_0x161a('0x1a')][_0x161a('0x45')];logger['info']('['+[_0x5f2f9e[_0x161a('0x10')]()]+_0x161a('0x46'),_0x3e9067);_0xcc75e4(_0x3e9067);})[_0x161a('0x12')](function(_0x7d6414){logger[_0x161a('0x13')]('['+[_0x5f2f9e[_0x161a('0x10')]()]+']',_0x7d6414[_0x161a('0x22')]);_0x4185b2(_0x7d6414['message']);});});};}function createRemoteTag(_0x2d4f0f,_0x3cc5c5,_0xbfba53,_0x4d1454){return new Promise(function(_0x274959,_0x4cd6a2){var _0x25e1ac={'method':_0x161a('0x24'),'uri':_0xbfba53+'label'+'?'+_0x4d1454,'body':{'short_description':_0x2d4f0f,'global':!![],'active':!![],'name':_0x2d4f0f},'auth':_0x3cc5c5,'json':!![]};return rp(_0x25e1ac)['then'](function(_0x5abcb4){var _0x18ef26=_0x5abcb4[_0x161a('0x1a')][_0x161a('0x1f')];_0x274959(_0x18ef26);});});}function getRemoteTag(_0x337e51,_0x5e07ab,_0x358be6,_0x57cf35,_0x585d2f){return new Promise(function(_0x3e729b,_0x3408e4){var _0x31c8eb={'method':_0x161a('0xc'),'uri':_0x358be6+_0x161a('0x47')+_0x161a('0x48')+_0x337e51+'&'+_0x57cf35,'auth':_0x5e07ab,'json':!![]};return rp(_0x31c8eb)[_0x161a('0xe')](function(_0x197be0){if(_0x197be0['result'][_0x161a('0x1b')]>0x0){var _0x4ef96e=_0x197be0[_0x161a('0x1a')][0x0][_0x161a('0x1f')];_0x3e729b(_0x4ef96e);}else{return createRemoteTag(_0x337e51,_0x5e07ab,_0x358be6,_0x57cf35)[_0x161a('0xe')](function(_0x2ab982){_0x3e729b(_0x2ab982);});}});});}function assignTagToIncident(_0x5b80cc,_0x225c24,_0x54c48a,_0x192a80,_0xf7934e){return new Promise(function(_0x51d372,_0x2d5a3b){var _0x3dc073={'method':'POST','uri':_0x54c48a+_0x161a('0x49')+'?'+_0xf7934e,'body':{'label':_0x5b80cc,'table':'incident','id_type':_0x161a('0x4a'),'table_key':_0x192a80[_0x161a('0x44')],'title':'Incident\x20-\x20'+_0x192a80[_0x161a('0x4b')],'id_display':_0x192a80[_0x161a('0x4b')]},'auth':_0x225c24,'json':!![]};return rp(_0x3dc073)[_0x161a('0xe')](function(_0x1f9130){_0x51d372();})['catch'](function(){_0x51d372();});});}function manageTags(_0x456759,_0x2e14d0,_0xb98573,_0x447a38,_0x36c4c5,_0x138785,_0xeb6381){return new Promise(function(_0xc82f02,_0x50afeb){var _0x5beebe=[];_0x2e14d0[_0x161a('0x2e')](function(_0x273a47){_0x5beebe['push'](getRemoteTag(_0x273a47,_0xb98573,_0x447a38,_0x138785,_0xeb6381));});return Promise[_0x161a('0x4c')](_0x5beebe)['then'](function(_0x500d6d){if(_0x500d6d[_0x161a('0x1b')]){logger[_0x161a('0xf')]('['+[_0x456759[_0x161a('0x10')]()]+_0x161a('0x4d'),_0x500d6d);var _0x5bfa30=[];_0x500d6d[_0x161a('0x2e')](function(_0x12c892){_0x5bfa30[_0x161a('0x4e')](assignTagToIncident(_0x12c892,_0xb98573,_0x447a38,_0x36c4c5,_0x138785));});return Promise['all'](_0x5bfa30)['then'](function(){_0xc82f02();})[_0x161a('0x12')](function(){_0xc82f02();});}else{_0xc82f02();}});});}function getTags(_0x405d5a,_0x567d9f,_0x56156f,_0x1ec939,_0x49a411,_0x536221){return function(_0x20d54f){return new Promise(function(_0x3d0887,_0x429dd8){var _0xbb3d16=[];var _0x26d842=_0x1ec939[_0x161a('0x4f')];if(_0x26d842&&_0x26d842['length']>0x0){_0xbb3d16=_[_0x161a('0x50')](_0x26d842,_0x161a('0x3c'));}if(_0xbb3d16[_0x161a('0x1b')]>0x0){return manageTags(_0x405d5a,_0xbb3d16,_0x567d9f,_0x56156f,_0x20d54f,_0x49a411,_0x536221)[_0x161a('0xe')](function(){_0x3d0887(_0x20d54f);});}else{_0x3d0887(_0x20d54f);}});};}function emit(_0x2ca121,_0x1a775b,_0x4f17fe){var _0xa20e1b='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x161a('0x51')+_0x161a('0x52');var _0x362a2a={'uri':_0x2ca121+_0x161a('0x53')+_0x4f17fe+_0xa20e1b};io['to'](util[_0x161a('0x54')]('user:%s',_0x1a775b))[_0x161a('0x55')](_0x161a('0x56'),_0x362a2a);}exports['cs']=function(_0xd552ab,_0xfe99a,_0x1b1909,_0x21172e,_0x182d6c,_0xe06f3e,_0x26b90f,_0x3be05b){var _0x5bface={};var _0x220700={'user':_0xe06f3e[_0x161a('0x57')],'pass':_0xe06f3e['password']};var _0x369227='sysparm_limit=1';var _0x2920d0=_0x161a('0x58');_0xe06f3e[_0x161a('0x59')]=intUtil[_0x161a('0x5a')](_0xe06f3e[_0x161a('0x59')]);_0xe06f3e[_0x161a('0x5b')]=intUtil[_0x161a('0x5a')](_0xe06f3e[_0x161a('0x5b')]);var _0xc2ca50=util['format'](_0x161a('0x5c'),_0xe06f3e[_0x161a('0x59')]);_0x5bface[_0x161a('0x16')]=!_[_0x161a('0x5d')](_0x21172e)?_0x21172e[_0x161a('0x5e')]:null;_0x5bface[_0x161a('0x5f')]=_0xe06f3e[_0x161a('0x5e')];_0x5bface[_0x161a('0x26')]=_0x3be05b['toLowerCase']()==='outbound'?_0xfe99a[_0x161a('0x60')]:_0xfe99a[_0x161a('0x61')];_0x5bface[_0x161a('0x62')]=_0x3be05b===_0x161a('0x63')||_0x3be05b==='unmanaged'?'queue':_0x161a('0x3d');var _0x3dc676=util[_0x161a('0x54')](_0x161a('0x64'),_0xe06f3e[_0x161a('0x5b')],_0xfe99a[_0x161a('0x65')],md5(_0xfe99a[_0x161a('0x65')]));if(_0x182d6c&&_0x182d6c[_0x161a('0x66')]){logger[_0x161a('0xf')](_0x161a('0x67'),'Recording\x20is\x20enabled!');_0xfe99a[_0x161a('0x68')]=_0x3dc676;}else if(_0x26b90f&&_0x26b90f[_0x161a('0x69')]&&_0x26b90f['recordingFormat']!==_0x161a('0x6a')){logger['info']('[OUTBOUND]',_0x161a('0x6b'));_0xfe99a[_0x161a('0x68')]=_0x3dc676;}else{_0xfe99a[_0x161a('0x68')]='';}return getAdminUser(_0x3be05b,_0x220700,_0x5bface,_0xc2ca50,_0x2920d0,_0x369227)[_0x161a('0xe')](getUser(_0x3be05b,_0x220700,_0xc2ca50,_0x2920d0,_0x369227))[_0x161a('0xe')](getEndUser(_0x3be05b,_0x220700,_0xc2ca50,_0x2920d0,_0x369227))[_0x161a('0xe')](getTicket(_0x3be05b,_0x220700,_0xc2ca50,_0x1b1909,_0xfe99a,_0x2920d0))['then'](function(_0x50d6c5){logger['info'](util[_0x161a('0x54')]('The\x20ticket\x20ID\x20is:\x20%s',_0x50d6c5[_0x161a('0x44')]));logger['info'](util['format'](_0x161a('0x6c'),_0x3be05b));if(_0x3be05b!==_0x161a('0x6d')){logger[_0x161a('0xf')]('['+[_0x3be05b[_0x161a('0x10')]()]+']',_0x161a('0x6e'));emit(_0xe06f3e[_0x161a('0x59')],_0x21172e[_0x161a('0x3c')],_0x50d6c5[_0x161a('0x44')]);}})['catch'](function(_0x527efd){logger[_0x161a('0x13')]('['+[_0x3be05b[_0x161a('0x10')]()]+_0x161a('0x6f'),util[_0x161a('0x70')](_0x527efd,{'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 2c4aa7d..ee34e6c 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 _0x3c23=['get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','Calls','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','user:%s','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','monitor_format','toUpperCase','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_name','direction','length','forEach','variableName','push','idField','JSON','stringify','format','Basic\x20%s','apiKey','toString'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x3c23,0xd2));var _0x33c2=function(_0x222cff,_0x493c92){_0x222cff=_0x222cff-0x0;var _0x5c931b=_0x3c23[_0x222cff];return _0x5c931b;};'use strict';var _=require(_0x33c2('0x0'));var rp=require(_0x33c2('0x1'));var BPromise=require(_0x33c2('0x2'));var md5=require(_0x33c2('0x3'));var util=require(_0x33c2('0x4'));var Redis=require(_0x33c2('0x5'));var intUtil=require(_0x33c2('0x6'));var config=require(_0x33c2('0x7'));var logger=require(_0x33c2('0x8'))(_0x33c2('0x9'));config['redis']=_['defaults'](config[_0x33c2('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x33c2('0xb'))(new Redis(config[_0x33c2('0xa')]));var def={'method':_0x33c2('0xc'),'json':!![]};function emit(_0x264ac7,_0x32df62,_0x1870a5){io['to'](_0x264ac7)[_0x33c2('0xd')](_0x32df62,_0x1870a5);}function getTicket(_0x3aa743,_0x4e60f0,_0x5a3fc9,_0xaf12e3,_0x570fd7,_0x582c62,_0x3f481e,_0x3986f1){logger[_0x33c2('0xe')](_0x33c2('0xf'));var _0x5de381=new Date();var _0x2fb2af=[{'name':_0x33c2('0x10'),'value':intUtil[_0x33c2('0x11')](_0xaf12e3[_0x33c2('0x12')],_0x570fd7,'\x20')},{'name':_0x33c2('0x13'),'value':_0x4e60f0['id']},{'name':_0x33c2('0x14'),'value':_0x4e60f0['id']},{'name':_0x33c2('0x15'),'value':intUtil['getString'](_0xaf12e3[_0x33c2('0x16')],_0x570fd7,'\x0a')},{'name':_0x33c2('0x17'),'value':_0x5de381[_0x33c2('0x18')]()[_0x33c2('0x19')](0x0,0x13)[_0x33c2('0x1a')]('T','\x20')},{'name':_0x33c2('0x1b'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x33c2('0x1c'),'value':_0x5a3fc9['id']},{'name':'parent_type','value':'Contacts'},{'name':_0x33c2('0x1d'),'value':_0x5a3fc9[_0x33c2('0x10')]},{'name':_0x33c2('0x1e'),'value':_0x3986f1}];if(_0x582c62[_0x33c2('0x1f')]){_[_0x33c2('0x20')](_0x582c62,function(_0x8a1e90){if(_0x570fd7[_0x8a1e90[_0x33c2('0x21')]]){_0x2fb2af[_0x33c2('0x22')]({'name':_0x8a1e90[_0x33c2('0x23')],'value':_0x570fd7[_0x8a1e90[_0x33c2('0x21')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x33c2('0x24'),'response_type':_0x33c2('0x24'),'rest_data':JSON[_0x33c2('0x25')]({'session':_0x3f481e['id'],'module_name':'Calls','name_value_list':_0x2fb2af})}});}function getAuth(_0xbc043a){return util[_0x33c2('0x26')](_0x33c2('0x27'),new Buffer(_0xbc043a[_0x33c2('0x28')]+':X')[_0x33c2('0x29')]('base64'));}function getServerInfo(_0x595b6b){return request({'form':{'method':_0x33c2('0x2a'),'input_type':_0x33c2('0x24'),'response_type':_0x33c2('0x24'),'rest_data':JSON['stringify']({'session':_0x595b6b['id']})}});}function getUser(_0x1e33dc,_0x161c1f,_0x59ba32){if(!_[_0x33c2('0x2b')](_0x161c1f)){logger['info'](_0x33c2('0x2c'),_0x161c1f);return request({'form':{'method':_0x33c2('0x2d'),'input_type':_0x33c2('0x24'),'response_type':'JSON','rest_data':JSON[_0x33c2('0x25')]({'session':_0x59ba32['id'],'module_name':_0x33c2('0x2e'),'query':util[_0x33c2('0x26')](_0x33c2('0x2f'),_0x161c1f),'order_by':'','offset':'0','select_fields':['id',_0x33c2('0x10'),_0x33c2('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x33c2('0x31')](function(_0x2e5402){if(_0x2e5402[_0x33c2('0x32')][_0x33c2('0x1f')]){var _0x27983f=_[_0x33c2('0x33')](_0x2e5402[_0x33c2('0x32')],function(_0x23e0f3){return _0x23e0f3[_0x33c2('0x34')][_0x33c2('0x30')]['value']===_0x161c1f;});if(_0x27983f){logger[_0x33c2('0xe')]('Agent\x20found!');return BPromise[_0x33c2('0x35')]({'id':_0x27983f[_0x33c2('0x34')]['id'][_0x33c2('0x36')],'name':_0x27983f[_0x33c2('0x34')]['name'][_0x33c2('0x36')]});}}logger[_0x33c2('0xe')](_0x33c2('0x37'));return BPromise[_0x33c2('0x35')]({'id':_0x59ba32[_0x33c2('0x34')]['user_id'][_0x33c2('0x36')],'name':_0x59ba32[_0x33c2('0x34')][_0x33c2('0x30')][_0x33c2('0x36')]});});}else{logger[_0x33c2('0xe')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x59ba32[_0x33c2('0x34')]['user_id']['value'],'name':_0x59ba32[_0x33c2('0x34')][_0x33c2('0x30')][_0x33c2('0x36')]});}}function getEndUser(_0x4d8161,_0x43a9c5,_0x3ca1ab,_0x28ea58){logger[_0x33c2('0xe')](_0x33c2('0x38'),_0x3ca1ab);return request({'form':{'method':_0x33c2('0x2d'),'input_type':_0x33c2('0x24'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x28ea58['id'],'module_name':_0x33c2('0x39'),'query':util['format'](_0x33c2('0x3a'),_0x3ca1ab),'order_by':'','offset':'0','select_fields':['id',_0x33c2('0x10'),_0x33c2('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x169566){if(_0x169566[_0x33c2('0x32')][_0x33c2('0x1f')]){var _0xdb62fc=_[_0x33c2('0x33')](_0x169566[_0x33c2('0x32')],function(_0xc6a102){return _0xc6a102[_0x33c2('0x34')]['phone_home'][_0x33c2('0x36')]===_0x3ca1ab;});if(_0xdb62fc){logger[_0x33c2('0xe')](_0x33c2('0x3c'));return BPromise[_0x33c2('0x35')]({'id':_0xdb62fc[_0x33c2('0x34')]['id'][_0x33c2('0x36')],'name':_0xdb62fc[_0x33c2('0x34')][_0x33c2('0x10')][_0x33c2('0x36')],'phone':_0xdb62fc['name_value_list'][_0x33c2('0x3b')][_0x33c2('0x36')]});}}else{logger[_0x33c2('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x33c2('0x3d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x28ea58['id'],'module_name':_0x33c2('0x39'),'name_value_list':[{'name':_0x33c2('0x3e'),'value':_0x43a9c5!==_0x33c2('0x3f')?_0x43a9c5:util['format'](_0x33c2('0x40'),_0x3ca1ab)},{'name':_0x33c2('0x3b'),'value':_0x3ca1ab}]})}})['then'](function(_0x4e19fc){logger[_0x33c2('0xe')](_0x33c2('0x41'));return BPromise[_0x33c2('0x35')]({'id':_0x4e19fc['id'],'name':_0x4e19fc['entry_list'][_0x33c2('0x3e')][_0x33c2('0x36')],'phone':_0x4e19fc['entry_list'][_0x33c2('0x3b')][_0x33c2('0x36')]});});}});}function request(_0x34a0ab){logger[_0x33c2('0x42')]('[HTTP]',JSON[_0x33c2('0x25')](_0x34a0ab));return rp(_[_0x33c2('0x43')](def,_0x34a0ab));}function getTags(_0x268b91,_0x495084){var _0x4b7e3a=[];if(_0x268b91&&_0x268b91[_0x33c2('0x1f')]>0x0){_0x4b7e3a=_[_0x33c2('0x44')](_0x268b91,_0x495084);}return _0x4b7e3a;}function getCustomFields(_0x2f9caa,_0x3555e7){var _0xfad62d=[];var _0x27a11a={'custom_fields':[]};if(_0x2f9caa[_0x33c2('0x1f')]>0x0){_['forEach'](_0x2f9caa,function(_0x1bf245){if(_0x1bf245[_0x33c2('0x45')]===_0x33c2('0x46')&&_0x1bf245[_0x33c2('0x47')]&&!_0x1bf245[_0x33c2('0x48')]){_0x27a11a[_0x1bf245[_0x33c2('0x47')][_0x33c2('0x49')]()]=_0x1bf245[_0x33c2('0x4a')][_0x33c2('0x29')]();}else if(_0x1bf245[_0x33c2('0x45')]==='string'&&_0x1bf245[_0x33c2('0x23')]&&_0x1bf245[_0x33c2('0x48')]){_0x27a11a[_0x33c2('0x4b')]['push']({'id':_0x1bf245[_0x33c2('0x23')],'value':_0x1bf245[_0x33c2('0x4a')][_0x33c2('0x29')]()});}else if(_0x1bf245['type']===_0x33c2('0x4c')&&_0x1bf245[_0x33c2('0x21')]&&_0x1bf245[_0x33c2('0x23')]&&_0x1bf245[_0x33c2('0x48')]){_0x3555e7[_0x1bf245[_0x33c2('0x21')]]&&_0x27a11a[_0x33c2('0x4b')][_0x33c2('0x22')]({'id':_0x1bf245[_0x33c2('0x23')],'value':_0x3555e7[_0x1bf245[_0x33c2('0x21')]][_0x33c2('0x29')]()});}else if(_0x1bf245['type']===_0x33c2('0x4d')&&_0x1bf245[_0x33c2('0x4e')]&&_0x1bf245[_0x33c2('0x4e')][_0x33c2('0x10')]&&_0x1bf245[_0x33c2('0x23')]&&_0x1bf245[_0x33c2('0x48')]){_0x3555e7[_0x1bf245['Variable'][_0x33c2('0x10')][_0x33c2('0x49')]()]&&_0x27a11a[_0x33c2('0x4b')][_0x33c2('0x22')]({'id':_0x1bf245[_0x33c2('0x23')],'value':_0x3555e7[_0x1bf245[_0x33c2('0x4e')][_0x33c2('0x10')][_0x33c2('0x49')]()][_0x33c2('0x29')]()});}});}return _0x27a11a;}function getConnection(_0x1b8c6b){return request({'method':'POST','form':{'method':'login','input_type':_0x33c2('0x24'),'response_type':_0x33c2('0x24'),'rest_data':JSON[_0x33c2('0x25')]({'user_auth':{'user_name':_0x1b8c6b[_0x33c2('0x4f')],'password':_0x1b8c6b[_0x33c2('0x50')],'encryption':_0x33c2('0x51')},'application':_0x33c2('0x52')})}})['then'](function(_0xf9af7e){var _0x5a8e92=_0xf9af7e;if(_0x5a8e92['id']){def[_0x33c2('0x53')]=_0x5a8e92['id'];return BPromise['resolve'](_0x5a8e92);}else{throw new Error(util[_0x33c2('0x26')](_0x33c2('0x54'),_0x1b8c6b['id']));}});}function setRelationship(_0xbc2eae,_0x503399,_0x5579b7,_0x174f15){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':_0x33c2('0x24'),'rest_data':JSON['stringify']({'session':_0xbc2eae['id'],'module_name':_0x33c2('0x55'),'module_id':_0x5579b7['id'],'link_field_name':_0x174f15,'related_ids':[_0x503399['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x33c2('0x56')]=function(_0x974219,_0x234f14,_0x2324b8,_0xdf5559,_0x2b1579,_0x43086a){var _0x59e94b,_0x148852,_0x1a0d36,_0x5eca47;_0x43086a[_0x33c2('0x57')]=intUtil['stripTrailingSlash'](_0x43086a['remoteUri']);_0x43086a[_0x33c2('0x58')]=intUtil[_0x33c2('0x59')](_0x43086a['serverUrl']);def[_0x33c2('0x5a')]=util[_0x33c2('0x26')](_0x33c2('0x5b'),_0x43086a[_0x33c2('0x57')]);if(_0x2b1579&&_0x2b1579['monitor_format']){logger[_0x33c2('0xe')]('[QUEUE]',_0x33c2('0x5c'));_0x234f14[_0x33c2('0x5d')]=util['format'](_0x33c2('0x5e'),_0x43086a['serverUrl'],_0x234f14[_0x33c2('0x5f')],md5(_0x234f14['uniqueid']));}else{_0x234f14[_0x33c2('0x5d')]='';}return getConnection(_0x43086a)['then'](function(_0x39307f){_0x5eca47=_0x39307f;return getUser(_0x43086a,_0xdf5559[_0x33c2('0x10')],_0x5eca47);})[_0x33c2('0x31')](function(_0x49a2fc){_0x59e94b=_0x49a2fc;logger[_0x33c2('0xe')](_0x33c2('0x60'),_0x59e94b['id']);return getEndUser(_0x43086a,_0x234f14[_0x33c2('0x61')],_0x234f14[_0x33c2('0x62')],_0x5eca47);})[_0x33c2('0x31')](function(_0x5443db){_0x148852=_0x5443db;logger[_0x33c2('0xe')](_0x33c2('0x63'),_0x148852['id']);return getTicket(_0x43086a,_0x59e94b,_0x148852,_0x2324b8,_0x234f14,_0x2324b8[_0x33c2('0x64')],_0x5eca47,_0x33c2('0x65'));})[_0x33c2('0x31')](function(_0x3a7cf2){_0x1a0d36=_0x3a7cf2;logger[_0x33c2('0xe')](_0x33c2('0x66'));logger[_0x33c2('0xe')](_0x33c2('0x67'),_0x1a0d36['id']);return setRelationship(_0x5eca47,_0x59e94b,_0x1a0d36,_0x33c2('0x68'));})[_0x33c2('0x31')](function(){return setRelationship(_0x5eca47,_0x148852,_0x1a0d36,'contacts');})[_0x33c2('0x31')](function(){return getServerInfo(_0x5eca47);})[_0x33c2('0x31')](function(_0x4ab69b){var _0x50700f=parseInt(_0x4ab69b[_0x33c2('0x69')][_0x33c2('0x6a')](0x0));var _0x3422bb=util[_0x33c2('0x26')](_0x33c2('0x6b'),_0x43086a[_0x33c2('0x57')],_0x1a0d36['id']);if(_0x50700f>0x6){_0x3422bb=util[_0x33c2('0x26')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x43086a[_0x33c2('0x57')],_0x1a0d36['id']);}logger[_0x33c2('0xe')](_0x33c2('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x33c2('0x26')](_0x33c2('0x6d'),_0xdf5559['name']),_0x33c2('0x6e'),{'uri':_0x3422bb});})[_0x33c2('0x6f')](function(_0x500229){logger[_0x33c2('0x70')](_0x33c2('0x6c'),JSON[_0x33c2('0x25')](_0x500229));});};exports['outbound']=function(_0x34a2ec,_0x1e673f,_0x20b25e,_0x4f45a6,_0x40db11,_0x4c374d,_0x7b46c8){var _0x39e71a,_0x39f54d,_0xd2b2c5,_0x2f37e7;_0x4c374d[_0x33c2('0x57')]=intUtil[_0x33c2('0x59')](_0x4c374d['remoteUri']);_0x4c374d[_0x33c2('0x58')]=intUtil[_0x33c2('0x59')](_0x4c374d['serverUrl']);def[_0x33c2('0x5a')]=util[_0x33c2('0x26')]('%s/service/v4_1/rest.php',_0x4c374d['remoteUri']);if(_0x7b46c8&&_0x7b46c8[_0x33c2('0x71')]&&_0x7b46c8['recordingFormat']!==_0x33c2('0x72')){logger[_0x33c2('0xe')](_0x33c2('0x73'),'Recording\x20is\x20enabled!');_0x1e673f[_0x33c2('0x5d')]=util['format'](_0x33c2('0x5e'),_0x4c374d['serverUrl'],_0x1e673f[_0x33c2('0x5f')],md5(_0x1e673f[_0x33c2('0x5f')]));}return getConnection(_0x4c374d)['then'](function(_0x27344a){_0x2f37e7=_0x27344a;return getUser(_0x4c374d,_0x4f45a6['name'],_0x2f37e7);})[_0x33c2('0x31')](function(_0x14128c){_0x39e71a=_0x14128c;logger[_0x33c2('0xe')](_0x33c2('0x60'),_0x39e71a['id']);return getEndUser(_0x4c374d,_0x1e673f[_0x33c2('0x74')],_0x1e673f[_0x33c2('0x75')],_0x2f37e7);})[_0x33c2('0x31')](function(_0x39039f){_0x39f54d=_0x39039f;logger[_0x33c2('0xe')]('The\x20Enduser\x20ID\x20is:',_0x39f54d['id']);return getTicket(_0x4c374d,_0x39e71a,_0x39f54d,_0x20b25e,_0x1e673f,_0x20b25e[_0x33c2('0x64')],_0x2f37e7,_0x33c2('0x76'));})[_0x33c2('0x31')](function(_0x316722){_0xd2b2c5=_0x316722;logger[_0x33c2('0xe')](_0x33c2('0x66'));logger[_0x33c2('0xe')](_0x33c2('0x67'),_0xd2b2c5['id']);return setRelationship(_0x2f37e7,_0x39e71a,_0xd2b2c5,_0x33c2('0x68'));})[_0x33c2('0x31')](function(){return setRelationship(_0x2f37e7,_0x39f54d,_0xd2b2c5,_0x33c2('0x77'));})[_0x33c2('0x31')](function(){return getServerInfo(_0x2f37e7);})[_0x33c2('0x31')](function(_0x5e434d){var _0x5cb9d4=parseInt(_0x5e434d[_0x33c2('0x69')][_0x33c2('0x6a')](0x0));var _0x54f943=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4c374d[_0x33c2('0x57')],_0xd2b2c5['id']);if(_0x5cb9d4>0x6){_0x54f943=util[_0x33c2('0x26')](_0x33c2('0x78'),_0x4c374d[_0x33c2('0x57')],_0xd2b2c5['id']);}logger[_0x33c2('0xe')]('[OUTBOUND]',_0x33c2('0x79'));emit(util['format'](_0x33c2('0x6d'),_0x4f45a6[_0x33c2('0x10')]),_0x33c2('0x6e'),{'uri':_0x54f943});})[_0x33c2('0x6f')](function(_0x399597){logger[_0x33c2('0x70')](_0x33c2('0x73'),JSON[_0x33c2('0x25')](_0x399597));});};exports[_0x33c2('0x7a')]=function(_0x2f4b94,_0x3baaa9,_0x3bc5ed,_0x1411e6,_0x25ab5b,_0x26fd01){var _0x2719d0,_0x2d7503,_0x73b13e,_0x51ab64;_0x26fd01[_0x33c2('0x57')]=intUtil[_0x33c2('0x59')](_0x26fd01[_0x33c2('0x57')]);_0x26fd01[_0x33c2('0x58')]=intUtil['stripTrailingSlash'](_0x26fd01['serverUrl']);def[_0x33c2('0x5a')]=util[_0x33c2('0x26')](_0x33c2('0x5b'),_0x26fd01[_0x33c2('0x57')]);if(_0x25ab5b&&_0x25ab5b[_0x33c2('0x7b')]){logger[_0x33c2('0xe')]('['+_0x3baaa9['lastevent'][_0x33c2('0x7c')]()+']','Recording\x20is\x20enabled!');_0x3baaa9[_0x33c2('0x5d')]=util[_0x33c2('0x26')](_0x33c2('0x5e'),_0x26fd01['serverUrl'],_0x3baaa9[_0x33c2('0x5f')],md5(_0x3baaa9['uniqueid']));}else{_0x3baaa9[_0x33c2('0x5d')]='';}return getConnection(_0x26fd01)['then'](function(_0x82a9d0){_0x51ab64=_0x82a9d0;if(!_[_0x33c2('0x2b')](_0x1411e6)){return getUser(_0x26fd01,_0x1411e6[_0x33c2('0x10')],_0x51ab64);}else{return getUser(_0x26fd01,null,_0x51ab64);}})[_0x33c2('0x31')](function(_0x39bb32){_0x2719d0=_0x39bb32;logger['info'](_0x33c2('0x60'),_0x2719d0['id']);return getEndUser(_0x26fd01,_0x3baaa9[_0x33c2('0x61')],_0x3baaa9['calleridnum'],_0x51ab64);})['then'](function(_0x2ad906){_0x2d7503=_0x2ad906;logger[_0x33c2('0xe')](_0x33c2('0x63'),_0x2d7503['id']);return getTicket(_0x26fd01,_0x2719d0,_0x2d7503,_0x3bc5ed,_0x3baaa9,_0x3bc5ed[_0x33c2('0x64')],_0x51ab64,_0x33c2('0x65'));})[_0x33c2('0x31')](function(_0x343a18){_0x73b13e=_0x343a18;logger[_0x33c2('0xe')](_0x33c2('0x66'));logger[_0x33c2('0xe')](_0x33c2('0x67'),_0x73b13e['id']);return setRelationship(_0x51ab64,_0x2719d0,_0x73b13e,_0x33c2('0x68'));})[_0x33c2('0x31')](function(){return setRelationship(_0x51ab64,_0x2d7503,_0x73b13e,_0x33c2('0x77'));})[_0x33c2('0x31')](function(){return getServerInfo(_0x51ab64);})[_0x33c2('0x6f')](function(_0x1a862c){logger[_0x33c2('0x70')]('['+_0x3baaa9[_0x33c2('0x7d')][_0x33c2('0x7c')]()+']',JSON[_0x33c2('0x25')](_0x1a862c));});}; \ No newline at end of file +var _0xae52=['The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Fields','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','trigger:browser:url','unmanaged','uri','toUpperCase','Recording\x20is\x20enabled!','isNil','lastevent','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','localhost','POST','emit','info','name','getString','created_by','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','length','variableName','push','idField','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','first_name','','Caller\x20-\x20%s','then','[HTTP]','merge','map','forEach','type','string','nameField','toLowerCase','content','customField','custom_fields','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname'];(function(_0x547021,_0x5d5654){var _0x440194=function(_0x4d89fb){while(--_0x4d89fb){_0x547021['push'](_0x547021['shift']());}};_0x440194(++_0x5d5654);}(_0xae52,0x111));var _0x2ae5=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0xae52[_0x277107];return _0x1da046;};'use strict';var _=require(_0x2ae5('0x0'));var rp=require(_0x2ae5('0x1'));var BPromise=require(_0x2ae5('0x2'));var md5=require('md5');var util=require(_0x2ae5('0x3'));var Redis=require(_0x2ae5('0x4'));var intUtil=require(_0x2ae5('0x5'));var config=require('../../../../config/environment');var logger=require(_0x2ae5('0x6'))(_0x2ae5('0x7'));config['redis']=_['defaults'](config[_0x2ae5('0x8')],{'host':_0x2ae5('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2ae5('0x8')]));var def={'method':_0x2ae5('0xa'),'json':!![]};function emit(_0x882e03,_0xd1114c,_0x4c02fe){io['to'](_0x882e03)[_0x2ae5('0xb')](_0xd1114c,_0x4c02fe);}function getTicket(_0x107e0f,_0x332647,_0x40750a,_0x5d3b3d,_0x29570c,_0x3813fd,_0x4f8539,_0x5c4b59){logger[_0x2ae5('0xc')]('Creating\x20new\x20ticket...');var _0x342d58=new Date();var _0x3f415a=[{'name':_0x2ae5('0xd'),'value':intUtil[_0x2ae5('0xe')](_0x5d3b3d['Subjects'],_0x29570c,'\x20')},{'name':'assigned_user_id','value':_0x332647['id']},{'name':_0x2ae5('0xf'),'value':_0x332647['id']},{'name':'description','value':intUtil[_0x2ae5('0xe')](_0x5d3b3d['Descriptions'],_0x29570c,'\x0a')},{'name':_0x2ae5('0x10'),'value':_0x342d58[_0x2ae5('0x11')]()['slice'](0x0,0x13)[_0x2ae5('0x12')]('T','\x20')},{'name':_0x2ae5('0x13'),'value':'0'},{'name':_0x2ae5('0x14'),'value':'15'},{'name':_0x2ae5('0x15'),'value':_0x40750a['id']},{'name':_0x2ae5('0x16'),'value':'Contacts'},{'name':_0x2ae5('0x17'),'value':_0x40750a[_0x2ae5('0xd')]},{'name':_0x2ae5('0x18'),'value':_0x5c4b59}];if(_0x3813fd[_0x2ae5('0x19')]){_['forEach'](_0x3813fd,function(_0x3ea0c4){if(_0x29570c[_0x3ea0c4[_0x2ae5('0x1a')]]){_0x3f415a[_0x2ae5('0x1b')]({'name':_0x3ea0c4[_0x2ae5('0x1c')],'value':_0x29570c[_0x3ea0c4[_0x2ae5('0x1a')]]});}});}return request({'form':{'method':_0x2ae5('0x1d'),'input_type':_0x2ae5('0x1e'),'response_type':'JSON','rest_data':JSON[_0x2ae5('0x1f')]({'session':_0x4f8539['id'],'module_name':_0x2ae5('0x20'),'name_value_list':_0x3f415a})}});}function getAuth(_0x275c54){return util[_0x2ae5('0x21')]('Basic\x20%s',new Buffer(_0x275c54[_0x2ae5('0x22')]+':X')[_0x2ae5('0x23')](_0x2ae5('0x24')));}function getServerInfo(_0xc6f2c){return request({'form':{'method':_0x2ae5('0x25'),'input_type':_0x2ae5('0x1e'),'response_type':_0x2ae5('0x1e'),'rest_data':JSON['stringify']({'session':_0xc6f2c['id']})}});}function getUser(_0x4b97da,_0x1c0c51,_0x4a64cc){if(!_['isNil'](_0x1c0c51)){logger['info'](_0x2ae5('0x26'),_0x1c0c51);return request({'form':{'method':_0x2ae5('0x27'),'input_type':'JSON','response_type':_0x2ae5('0x1e'),'rest_data':JSON[_0x2ae5('0x1f')]({'session':_0x4a64cc['id'],'module_name':_0x2ae5('0x28'),'query':util[_0x2ae5('0x21')](_0x2ae5('0x29'),_0x1c0c51),'order_by':'','offset':'0','select_fields':['id','name',_0x2ae5('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x2fdc9e){if(_0x2fdc9e[_0x2ae5('0x2b')][_0x2ae5('0x19')]){var _0x16eaaa=_[_0x2ae5('0x2c')](_0x2fdc9e[_0x2ae5('0x2b')],function(_0xd1b7e7){return _0xd1b7e7[_0x2ae5('0x2d')][_0x2ae5('0x2a')][_0x2ae5('0x2e')]===_0x1c0c51;});if(_0x16eaaa){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x16eaaa[_0x2ae5('0x2d')]['id']['value'],'name':_0x16eaaa[_0x2ae5('0x2d')][_0x2ae5('0xd')]['value']});}}logger[_0x2ae5('0xc')](_0x2ae5('0x2f'));return BPromise[_0x2ae5('0x30')]({'id':_0x4a64cc[_0x2ae5('0x2d')][_0x2ae5('0x31')]['value'],'name':_0x4a64cc[_0x2ae5('0x2d')][_0x2ae5('0x2a')][_0x2ae5('0x2e')]});});}else{logger[_0x2ae5('0xc')](_0x2ae5('0x32'));return BPromise['resolve']({'id':_0x4a64cc[_0x2ae5('0x2d')][_0x2ae5('0x31')]['value'],'name':_0x4a64cc['name_value_list'][_0x2ae5('0x2a')]['value']});}}function getEndUser(_0x2325ff,_0xe2a004,_0x31aeea,_0x3ef6d9){logger['info'](_0x2ae5('0x33'),_0x31aeea);return request({'form':{'method':'get_entry_list','input_type':_0x2ae5('0x1e'),'response_type':_0x2ae5('0x1e'),'rest_data':JSON[_0x2ae5('0x1f')]({'session':_0x3ef6d9['id'],'module_name':'Contacts','query':util['format'](_0x2ae5('0x34'),_0x31aeea),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x205b72){if(_0x205b72[_0x2ae5('0x2b')][_0x2ae5('0x19')]){var _0xab9126=_[_0x2ae5('0x2c')](_0x205b72[_0x2ae5('0x2b')],function(_0x44f471){return _0x44f471[_0x2ae5('0x2d')][_0x2ae5('0x35')][_0x2ae5('0x2e')]===_0x31aeea;});if(_0xab9126){logger[_0x2ae5('0xc')]('Enduser\x20found!');return BPromise[_0x2ae5('0x30')]({'id':_0xab9126[_0x2ae5('0x2d')]['id'][_0x2ae5('0x2e')],'name':_0xab9126[_0x2ae5('0x2d')][_0x2ae5('0xd')]['value'],'phone':_0xab9126[_0x2ae5('0x2d')]['phone_home'][_0x2ae5('0x2e')]});}}else{logger[_0x2ae5('0xc')](_0x2ae5('0x36'));return request({'form':{'method':_0x2ae5('0x1d'),'input_type':_0x2ae5('0x1e'),'response_type':_0x2ae5('0x1e'),'rest_data':JSON[_0x2ae5('0x1f')]({'session':_0x3ef6d9['id'],'module_name':_0x2ae5('0x37'),'name_value_list':[{'name':_0x2ae5('0x38'),'value':_0xe2a004!==_0x2ae5('0x39')?_0xe2a004:util['format'](_0x2ae5('0x3a'),_0x31aeea)},{'name':'phone_home','value':_0x31aeea}]})}})[_0x2ae5('0x3b')](function(_0x4650a5){logger[_0x2ae5('0xc')]('Enduser\x20created.');return BPromise[_0x2ae5('0x30')]({'id':_0x4650a5['id'],'name':_0x4650a5[_0x2ae5('0x2b')][_0x2ae5('0x38')][_0x2ae5('0x2e')],'phone':_0x4650a5['entry_list']['phone_home']['value']});});}});}function request(_0x434bd7){logger['debug'](_0x2ae5('0x3c'),JSON['stringify'](_0x434bd7));return rp(_[_0x2ae5('0x3d')](def,_0x434bd7));}function getTags(_0x421857,_0x4fc458){var _0x55e8bc=[];if(_0x421857&&_0x421857['length']>0x0){_0x55e8bc=_[_0x2ae5('0x3e')](_0x421857,_0x4fc458);}return _0x55e8bc;}function getCustomFields(_0x137d0b,_0x136890){var _0x49ffc7=[];var _0x21182a={'custom_fields':[]};if(_0x137d0b[_0x2ae5('0x19')]>0x0){_[_0x2ae5('0x3f')](_0x137d0b,function(_0x13d251){if(_0x13d251[_0x2ae5('0x40')]===_0x2ae5('0x41')&&_0x13d251[_0x2ae5('0x42')]&&!_0x13d251['customField']){_0x21182a[_0x13d251[_0x2ae5('0x42')][_0x2ae5('0x43')]()]=_0x13d251[_0x2ae5('0x44')][_0x2ae5('0x23')]();}else if(_0x13d251[_0x2ae5('0x40')]===_0x2ae5('0x41')&&_0x13d251[_0x2ae5('0x1c')]&&_0x13d251[_0x2ae5('0x45')]){_0x21182a[_0x2ae5('0x46')]['push']({'id':_0x13d251[_0x2ae5('0x1c')],'value':_0x13d251[_0x2ae5('0x44')][_0x2ae5('0x23')]()});}else if(_0x13d251[_0x2ae5('0x40')]==='variable'&&_0x13d251[_0x2ae5('0x1a')]&&_0x13d251['idField']&&_0x13d251[_0x2ae5('0x45')]){_0x136890[_0x13d251[_0x2ae5('0x1a')]]&&_0x21182a['custom_fields']['push']({'id':_0x13d251['idField'],'value':_0x136890[_0x13d251['variableName']][_0x2ae5('0x23')]()});}else if(_0x13d251[_0x2ae5('0x40')]===_0x2ae5('0x47')&&_0x13d251[_0x2ae5('0x48')]&&_0x13d251[_0x2ae5('0x48')][_0x2ae5('0xd')]&&_0x13d251[_0x2ae5('0x1c')]&&_0x13d251[_0x2ae5('0x45')]){_0x136890[_0x13d251['Variable'][_0x2ae5('0xd')][_0x2ae5('0x43')]()]&&_0x21182a[_0x2ae5('0x46')][_0x2ae5('0x1b')]({'id':_0x13d251[_0x2ae5('0x1c')],'value':_0x136890[_0x13d251[_0x2ae5('0x48')][_0x2ae5('0xd')]['toLowerCase']()][_0x2ae5('0x23')]()});}});}return _0x21182a;}function getConnection(_0x30ff0e){return request({'method':'POST','form':{'method':_0x2ae5('0x49'),'input_type':_0x2ae5('0x1e'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x30ff0e[_0x2ae5('0x4a')],'password':_0x30ff0e['password'],'encryption':_0x2ae5('0x4b')},'application':_0x2ae5('0x4c')})}})[_0x2ae5('0x3b')](function(_0x11612a){var _0x3e8fa1=_0x11612a;if(_0x3e8fa1['id']){def[_0x2ae5('0x4d')]=_0x3e8fa1['id'];return BPromise['resolve'](_0x3e8fa1);}else{throw new Error(util['format'](_0x2ae5('0x4e'),_0x30ff0e['id']));}});}function setRelationship(_0x4cc96c,_0x2bd8d8,_0x242413,_0x27a303){return request({'form':{'method':_0x2ae5('0x4f'),'input_type':_0x2ae5('0x1e'),'response_type':_0x2ae5('0x1e'),'rest_data':JSON[_0x2ae5('0x1f')]({'session':_0x4cc96c['id'],'module_name':_0x2ae5('0x20'),'module_id':_0x242413['id'],'link_field_name':_0x27a303,'related_ids':[_0x2bd8d8['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x2ae5('0x50')]=function(_0x572737,_0x515c1c,_0x406782,_0x3bf3aa,_0x2f5fe6,_0x161ad4){var _0x3628b4,_0x36a2a4,_0x4e0b3b,_0x4c85b9;_0x161ad4[_0x2ae5('0x51')]=intUtil['stripTrailingSlash'](_0x161ad4[_0x2ae5('0x51')]);_0x161ad4[_0x2ae5('0x52')]=intUtil[_0x2ae5('0x53')](_0x161ad4['serverUrl']);def['uri']=util[_0x2ae5('0x21')]('%s/service/v4_1/rest.php',_0x161ad4[_0x2ae5('0x51')]);if(_0x2f5fe6&&_0x2f5fe6[_0x2ae5('0x54')]){logger[_0x2ae5('0xc')](_0x2ae5('0x55'),'Recording\x20is\x20enabled!');_0x515c1c['recordingURL']=util[_0x2ae5('0x21')](_0x2ae5('0x56'),_0x161ad4[_0x2ae5('0x52')],_0x515c1c[_0x2ae5('0x57')],md5(_0x515c1c[_0x2ae5('0x57')]));}else{_0x515c1c['recordingURL']='';}return getConnection(_0x161ad4)['then'](function(_0x2868a2){_0x4c85b9=_0x2868a2;return getUser(_0x161ad4,_0x3bf3aa[_0x2ae5('0xd')],_0x4c85b9);})[_0x2ae5('0x3b')](function(_0x1dcb8d){_0x3628b4=_0x1dcb8d;logger[_0x2ae5('0xc')](_0x2ae5('0x58'),_0x3628b4['id']);return getEndUser(_0x161ad4,_0x515c1c[_0x2ae5('0x59')],_0x515c1c['calleridnum'],_0x4c85b9);})[_0x2ae5('0x3b')](function(_0x4fc062){_0x36a2a4=_0x4fc062;logger[_0x2ae5('0xc')](_0x2ae5('0x5a'),_0x36a2a4['id']);return getTicket(_0x161ad4,_0x3628b4,_0x36a2a4,_0x406782,_0x515c1c,_0x406782['Fields'],_0x4c85b9,_0x2ae5('0x5b'));})[_0x2ae5('0x3b')](function(_0x11edcf){_0x4e0b3b=_0x11edcf;logger[_0x2ae5('0xc')](_0x2ae5('0x5c'));logger[_0x2ae5('0xc')](_0x2ae5('0x5d'),_0x4e0b3b['id']);return setRelationship(_0x4c85b9,_0x3628b4,_0x4e0b3b,_0x2ae5('0x5e'));})['then'](function(){return setRelationship(_0x4c85b9,_0x36a2a4,_0x4e0b3b,_0x2ae5('0x5f'));})['then'](function(){return getServerInfo(_0x4c85b9);})[_0x2ae5('0x3b')](function(_0x540a66){var _0x1e4571=parseInt(_0x540a66[_0x2ae5('0x60')][_0x2ae5('0x61')](0x0));var _0x14edc3=util[_0x2ae5('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x161ad4[_0x2ae5('0x51')],_0x4e0b3b['id']);if(_0x1e4571>0x6){_0x14edc3=util[_0x2ae5('0x21')](_0x2ae5('0x62'),_0x161ad4[_0x2ae5('0x51')],_0x4e0b3b['id']);}logger[_0x2ae5('0xc')](_0x2ae5('0x55'),_0x2ae5('0x63'));emit(util['format'](_0x2ae5('0x64'),_0x3bf3aa[_0x2ae5('0xd')]),'trigger:browser:url',{'uri':_0x14edc3});})[_0x2ae5('0x65')](function(_0x2f52ff){logger[_0x2ae5('0x66')](_0x2ae5('0x55'),JSON[_0x2ae5('0x1f')](_0x2f52ff));});};exports[_0x2ae5('0x67')]=function(_0x10219f,_0x237e5b,_0x5c5f24,_0x514e84,_0x1d336a,_0x2bce4f,_0x592b81){var _0xd6b44b,_0x4fa25a,_0x33a29a,_0x1ce157;_0x2bce4f[_0x2ae5('0x51')]=intUtil[_0x2ae5('0x53')](_0x2bce4f[_0x2ae5('0x51')]);_0x2bce4f['serverUrl']=intUtil['stripTrailingSlash'](_0x2bce4f[_0x2ae5('0x52')]);def['uri']=util[_0x2ae5('0x21')](_0x2ae5('0x68'),_0x2bce4f[_0x2ae5('0x51')]);if(_0x592b81&&_0x592b81[_0x2ae5('0x69')]&&_0x592b81[_0x2ae5('0x69')]!==_0x2ae5('0x6a')){logger[_0x2ae5('0xc')](_0x2ae5('0x6b'),'Recording\x20is\x20enabled!');_0x237e5b[_0x2ae5('0x6c')]=util['format'](_0x2ae5('0x56'),_0x2bce4f['serverUrl'],_0x237e5b[_0x2ae5('0x57')],md5(_0x237e5b['uniqueid']));}return getConnection(_0x2bce4f)[_0x2ae5('0x3b')](function(_0x5cd03b){_0x1ce157=_0x5cd03b;return getUser(_0x2bce4f,_0x514e84[_0x2ae5('0xd')],_0x1ce157);})['then'](function(_0x1558a7){_0xd6b44b=_0x1558a7;logger[_0x2ae5('0xc')](_0x2ae5('0x58'),_0xd6b44b['id']);return getEndUser(_0x2bce4f,_0x237e5b[_0x2ae5('0x6d')],_0x237e5b[_0x2ae5('0x6e')],_0x1ce157);})[_0x2ae5('0x3b')](function(_0x574be9){_0x4fa25a=_0x574be9;logger[_0x2ae5('0xc')](_0x2ae5('0x5a'),_0x4fa25a['id']);return getTicket(_0x2bce4f,_0xd6b44b,_0x4fa25a,_0x5c5f24,_0x237e5b,_0x5c5f24[_0x2ae5('0x6f')],_0x1ce157,_0x2ae5('0x70'));})[_0x2ae5('0x3b')](function(_0x4f1c35){_0x33a29a=_0x4f1c35;logger['info'](_0x2ae5('0x5c'));logger['info'](_0x2ae5('0x5d'),_0x33a29a['id']);return setRelationship(_0x1ce157,_0xd6b44b,_0x33a29a,_0x2ae5('0x5e'));})[_0x2ae5('0x3b')](function(){return setRelationship(_0x1ce157,_0x4fa25a,_0x33a29a,_0x2ae5('0x5f'));})[_0x2ae5('0x3b')](function(){return getServerInfo(_0x1ce157);})[_0x2ae5('0x3b')](function(_0x23423e){var _0x968a6f=parseInt(_0x23423e[_0x2ae5('0x60')]['charAt'](0x0));var _0x59c0a8=util[_0x2ae5('0x21')](_0x2ae5('0x71'),_0x2bce4f[_0x2ae5('0x51')],_0x33a29a['id']);if(_0x968a6f>0x6){_0x59c0a8=util[_0x2ae5('0x21')](_0x2ae5('0x62'),_0x2bce4f['remoteUri'],_0x33a29a['id']);}logger[_0x2ae5('0xc')](_0x2ae5('0x6b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2ae5('0x21')](_0x2ae5('0x64'),_0x514e84[_0x2ae5('0xd')]),_0x2ae5('0x72'),{'uri':_0x59c0a8});})['catch'](function(_0x482ace){logger[_0x2ae5('0x66')](_0x2ae5('0x6b'),JSON[_0x2ae5('0x1f')](_0x482ace));});};exports[_0x2ae5('0x73')]=function(_0x36c2f2,_0x4e44f7,_0x5e4196,_0xfb468a,_0x9e6cb4,_0x57d6d8){var _0x435e49,_0x46f0c3,_0x19422e,_0x199a0a;_0x57d6d8[_0x2ae5('0x51')]=intUtil[_0x2ae5('0x53')](_0x57d6d8[_0x2ae5('0x51')]);_0x57d6d8[_0x2ae5('0x52')]=intUtil[_0x2ae5('0x53')](_0x57d6d8[_0x2ae5('0x52')]);def[_0x2ae5('0x74')]=util[_0x2ae5('0x21')]('%s/service/v4_1/rest.php',_0x57d6d8[_0x2ae5('0x51')]);if(_0x9e6cb4&&_0x9e6cb4[_0x2ae5('0x54')]){logger[_0x2ae5('0xc')]('['+_0x4e44f7['lastevent'][_0x2ae5('0x75')]()+']',_0x2ae5('0x76'));_0x4e44f7[_0x2ae5('0x6c')]=util['format'](_0x2ae5('0x56'),_0x57d6d8['serverUrl'],_0x4e44f7[_0x2ae5('0x57')],md5(_0x4e44f7[_0x2ae5('0x57')]));}else{_0x4e44f7[_0x2ae5('0x6c')]='';}return getConnection(_0x57d6d8)[_0x2ae5('0x3b')](function(_0x39b27b){_0x199a0a=_0x39b27b;if(!_[_0x2ae5('0x77')](_0xfb468a)){return getUser(_0x57d6d8,_0xfb468a['name'],_0x199a0a);}else{return getUser(_0x57d6d8,null,_0x199a0a);}})[_0x2ae5('0x3b')](function(_0x2cffb0){_0x435e49=_0x2cffb0;logger[_0x2ae5('0xc')](_0x2ae5('0x58'),_0x435e49['id']);return getEndUser(_0x57d6d8,_0x4e44f7[_0x2ae5('0x59')],_0x4e44f7['calleridnum'],_0x199a0a);})[_0x2ae5('0x3b')](function(_0x2b8113){_0x46f0c3=_0x2b8113;logger[_0x2ae5('0xc')](_0x2ae5('0x5a'),_0x46f0c3['id']);return getTicket(_0x57d6d8,_0x435e49,_0x46f0c3,_0x5e4196,_0x4e44f7,_0x5e4196['Fields'],_0x199a0a,_0x2ae5('0x5b'));})[_0x2ae5('0x3b')](function(_0x20dbbf){_0x19422e=_0x20dbbf;logger[_0x2ae5('0xc')](_0x2ae5('0x5c'));logger[_0x2ae5('0xc')](_0x2ae5('0x5d'),_0x19422e['id']);return setRelationship(_0x199a0a,_0x435e49,_0x19422e,_0x2ae5('0x5e'));})[_0x2ae5('0x3b')](function(){return setRelationship(_0x199a0a,_0x46f0c3,_0x19422e,'contacts');})[_0x2ae5('0x3b')](function(){return getServerInfo(_0x199a0a);})[_0x2ae5('0x65')](function(_0x481216){logger[_0x2ae5('0x66')]('['+_0x4e44f7[_0x2ae5('0x78')][_0x2ae5('0x75')]()+']',JSON[_0x2ae5('0x1f')](_0x481216));});}; \ 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 f43a114..7a88062 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 _0x764e=['key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyType'];(function(_0x58d5d9,_0x5d104e){var _0x23d483=function(_0x3f627e){while(--_0x3f627e){_0x58d5d9['push'](_0x58d5d9['shift']());}};_0x23d483(++_0x5d104e);}(_0x764e,0xb3));var _0xe764=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x764e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe764('0x0'));var util=require(_0xe764('0x1'));exports[_0xe764('0x2')]=function(_0x38a112,_0x506719,_0x157192){var _0x1c09e0=[];if(_0x38a112[_0xe764('0x3')]>0x0){var _0x35734d=_[_0xe764('0x4')](_0x38a112,['id']);for(var _0x43e655=0x0;_0x43e655<_0x35734d[_0xe764('0x3')];_0x43e655++){var _0x449ff8=_0x35734d[_0x43e655];if(_0x449ff8[_0xe764('0x5')]===_0xe764('0x6')){_0x1c09e0[_0xe764('0x7')](_0x449ff8[_0xe764('0x8')]);}else if(_0x449ff8[_0xe764('0x5')]===_0xe764('0x9')&&_0x449ff8['variableName']){_0x506719[_0x449ff8[_0xe764('0xa')]]&&_0x1c09e0['push'](_0x506719[_0x449ff8[_0xe764('0xa')]][_0xe764('0xb')]());}else if(_0x449ff8['type']===_0xe764('0xc')&&_0x449ff8[_0xe764('0xd')]&&_0x449ff8[_0xe764('0xd')][_0xe764('0xe')]){_0x506719[_0x449ff8[_0xe764('0xd')]['name'][_0xe764('0xf')]()]&&_0x1c09e0[_0xe764('0x7')](_0x506719[_0x449ff8[_0xe764('0xd')][_0xe764('0xe')][_0xe764('0xf')]()][_0xe764('0xb')]());}else if(_0x449ff8[_0xe764('0x5')]==='keyValue'){if(_0x449ff8[_0xe764('0x10')]===_0xe764('0x6')&&_0x449ff8[_0xe764('0x11')]){_0x1c09e0[_0xe764('0x7')](util[_0xe764('0x12')](_0xe764('0x13'),_0x449ff8['key'],_0x449ff8['keyContent']));}else if(_0x449ff8[_0xe764('0x10')]===_0xe764('0x9')&&_0x449ff8[_0xe764('0xa')]&&_0x449ff8['key']){_0x506719[_0x449ff8[_0xe764('0xa')]]&&_0x1c09e0[_0xe764('0x7')](util[_0xe764('0x12')](_0xe764('0x13'),_0x449ff8[_0xe764('0x11')],_0x506719[_0x449ff8[_0xe764('0xa')]]));}else if(_0x449ff8['keyType']===_0xe764('0xc')&&_0x449ff8[_0xe764('0xd')]&&_0x449ff8[_0xe764('0xd')][_0xe764('0xe')]&&_0x449ff8[_0xe764('0x11')]){_0x506719[_0x449ff8['Variable'][_0xe764('0xe')][_0xe764('0xf')]()]&&_0x1c09e0[_0xe764('0x7')](util['format'](_0xe764('0x13'),_0x449ff8['key'],_0x506719[_0x449ff8[_0xe764('0xd')]['name'][_0xe764('0xf')]()]));}}}}return _0x1c09e0[_0xe764('0x14')](_0x157192);};exports[_0xe764('0x15')]=function(_0x253a2f){var _0x265ea5=_0x253a2f[_0xe764('0x16')](-0x1);if(_0x265ea5==='/'){_0x253a2f=_0x253a2f[_0xe764('0x17')](0x0,_0x253a2f[_0xe764('0x18')](_0x265ea5));}return _0x253a2f;};exports[_0xe764('0x19')]=function(_0x135f5f){if(!_[_0xe764('0x1a')](_0x135f5f)&&_0x135f5f!==''){var _0x5ddde7=/^(([^<>()\[\]\\.,;:\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 _0x5ddde7[_0xe764('0x1b')](String(_0x135f5f)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0x2170=['name','toLowerCase','keyValue','format','%s:\x20%s','key','keyContent','keyType','stripTrailingSlash','lastIndexOf','validateEmail','test','lodash','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable'];(function(_0x4cbce7,_0x139ba2){var _0x127bf5=function(_0x50eaf7){while(--_0x50eaf7){_0x4cbce7['push'](_0x4cbce7['shift']());}};_0x127bf5(++_0x139ba2);}(_0x2170,0x12c));var _0x0217=function(_0x420204,_0xaae94d){_0x420204=_0x420204-0x0;var _0x93aaad=_0x2170[_0x420204];return _0x93aaad;};'use strict';var _=require(_0x0217('0x0'));var util=require('util');exports['getString']=function(_0x35a49b,_0x542a63,_0x3660ce){var _0x20ff7d=[];if(_0x35a49b[_0x0217('0x1')]>0x0){var _0x4697ad=_[_0x0217('0x2')](_0x35a49b,['id']);for(var _0xe70193=0x0;_0xe70193<_0x4697ad[_0x0217('0x1')];_0xe70193++){var _0x3f3174=_0x4697ad[_0xe70193];if(_0x3f3174[_0x0217('0x3')]===_0x0217('0x4')){_0x20ff7d[_0x0217('0x5')](_0x3f3174[_0x0217('0x6')]);}else if(_0x3f3174['type']===_0x0217('0x7')&&_0x3f3174[_0x0217('0x8')]){_0x542a63[_0x3f3174[_0x0217('0x8')]]&&_0x20ff7d[_0x0217('0x5')](_0x542a63[_0x3f3174['variableName']][_0x0217('0x9')]());}else if(_0x3f3174[_0x0217('0x3')]===_0x0217('0xa')&&_0x3f3174[_0x0217('0xb')]&&_0x3f3174[_0x0217('0xb')][_0x0217('0xc')]){_0x542a63[_0x3f3174['Variable'][_0x0217('0xc')]['toLowerCase']()]&&_0x20ff7d[_0x0217('0x5')](_0x542a63[_0x3f3174[_0x0217('0xb')][_0x0217('0xc')][_0x0217('0xd')]()][_0x0217('0x9')]());}else if(_0x3f3174[_0x0217('0x3')]===_0x0217('0xe')){if(_0x3f3174['keyType']===_0x0217('0x4')&&_0x3f3174['key']){_0x20ff7d[_0x0217('0x5')](util[_0x0217('0xf')](_0x0217('0x10'),_0x3f3174[_0x0217('0x11')],_0x3f3174[_0x0217('0x12')]));}else if(_0x3f3174['keyType']===_0x0217('0x7')&&_0x3f3174['variableName']&&_0x3f3174[_0x0217('0x11')]){_0x542a63[_0x3f3174[_0x0217('0x8')]]&&_0x20ff7d[_0x0217('0x5')](util['format'](_0x0217('0x10'),_0x3f3174['key'],_0x542a63[_0x3f3174[_0x0217('0x8')]]));}else if(_0x3f3174[_0x0217('0x13')]===_0x0217('0xa')&&_0x3f3174[_0x0217('0xb')]&&_0x3f3174[_0x0217('0xb')][_0x0217('0xc')]&&_0x3f3174['key']){_0x542a63[_0x3f3174['Variable'][_0x0217('0xc')]['toLowerCase']()]&&_0x20ff7d[_0x0217('0x5')](util['format'](_0x0217('0x10'),_0x3f3174[_0x0217('0x11')],_0x542a63[_0x3f3174[_0x0217('0xb')][_0x0217('0xc')][_0x0217('0xd')]()]));}}}}return _0x20ff7d['join'](_0x3660ce);};exports[_0x0217('0x14')]=function(_0x5552bf){var _0x39bf37=_0x5552bf['slice'](-0x1);if(_0x39bf37==='/'){_0x5552bf=_0x5552bf['substring'](0x0,_0x5552bf[_0x0217('0x15')](_0x39bf37));}return _0x5552bf;};exports[_0x0217('0x16')]=function(_0x701e43){if(!_['isNil'](_0x701e43)&&_0x701e43!==''){var _0x540b1b=/^(([^<>()\[\]\\.,;:\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 _0x540b1b[_0x0217('0x17')](String(_0x701e43)['toLowerCase']());}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 aa6da6c..858fee0 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 _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ 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(_0x3d8f02,_0x145784){var _0x157f5c=function(_0x1ba222){while(--_0x1ba222){_0x3d8f02['push'](_0x3d8f02['shift']());}};_0x157f5c(++_0x145784);}(_0x34e8,0x12c));var _0x834e=function(_0x14718e,_0x2c1245){_0x14718e=_0x14718e-0x0;var _0x1835d4=_0x34e8[_0x14718e];return _0x1835d4;};'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 dc58f8d..767474d 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 _0xee7d=['email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','/api/v2','error','inspect','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','trigger:browser:url','replace','Zendesk\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','count','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','GET','map','forEach','picklist','type','customField','nameField','toLowerCase','content','toString','includes','string','custom_fields','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization'];(function(_0x44ede2,_0x44e614){var _0x4e5164=function(_0x392532){while(--_0x392532){_0x44ede2['push'](_0x44ede2['shift']());}};_0x4e5164(++_0x44e614);}(_0xee7d,0x16b));var _0xdee7=function(_0x5d64f3,_0x9f069c){_0x5d64f3=_0x5d64f3-0x0;var _0x26ca1d=_0xee7d[_0x5d64f3];return _0x26ca1d;};'use strict';var _=require(_0xdee7('0x0'));var rp=require(_0xdee7('0x1'));var md5=require('md5');var util=require(_0xdee7('0x2'));var Redis=require('ioredis');var intUtil=require(_0xdee7('0x3'));var config=require(_0xdee7('0x4'));var logger=require(_0xdee7('0x5'))(_0xdee7('0x6'));config[_0xdee7('0x7')]=_[_0xdee7('0x8')](config[_0xdee7('0x7')],{'host':_0xdee7('0x9'),'port':0x18eb});var io=require(_0xdee7('0xa'))(new Redis(config[_0xdee7('0x7')]));function emit(_0x5768c4,_0x31876d,_0x5ccd9a){io['to'](_0x5768c4)[_0xdee7('0xb')](_0x31876d,_0x5ccd9a);}var headers={'Content-Type':_0xdee7('0xc'),'Accept':_0xdee7('0xc')};function getTicket(_0x13f9d4,_0x30f8e2,_0x1ac4ee,_0x32c402,_0x2ced78){logger[_0xdee7('0xd')](_0xdee7('0xe'));return request({'uri':util[_0xdee7('0xf')]('%s/tickets.json',_0x13f9d4[_0xdee7('0x10')]),'method':_0xdee7('0x11'),'body':{'ticket':_[_0xdee7('0x12')]({'requester_id':_0x1ac4ee['id'],'submitter_id':_0x30f8e2?_0x30f8e2['id']:undefined,'assignee_id':_0x30f8e2?_0x30f8e2['id']:undefined,'tags':getTags(_0x32c402['Tags'],_0xdee7('0x13')),'subject':intUtil[_0xdee7('0x14')](_0x32c402[_0xdee7('0x15')],_0x2ced78,'\x20'),'description':intUtil[_0xdee7('0x14')](_0x32c402['Descriptions'],_0x2ced78,'\x0a'),'comment':{'public':![],'body':intUtil[_0xdee7('0x14')](_0x32c402[_0xdee7('0x16')],_0x2ced78,'\x0a')}},getCustomFields(_0x32c402[_0xdee7('0x17')],_0x2ced78))}})[_0xdee7('0x18')](function(_0xfb0890){logger[_0xdee7('0xd')](_0xdee7('0x19'));return _0xfb0890[_0xdee7('0x1a')];});}function getUser(_0x17be24,_0x1580d4){if(intUtil['validateEmail'](_0x1580d4)){logger['info'](_0xdee7('0x1b'),_0x1580d4);return request({'uri':util[_0xdee7('0xf')]('%s/search.json',_0x17be24[_0xdee7('0x10')]),'qs':{'query':util[_0xdee7('0xf')]('type:user\x20role:agent\x20email:%s',_0x1580d4)}})['then'](function(_0x4e756a){if(_0x4e756a[_0xdee7('0x1c')]){logger[_0xdee7('0xd')]('Agent\x20found!');return _[_0xdee7('0x1d')](_0x4e756a['results'],{'email':_0x1580d4,'role':'agent'});}else{logger[_0xdee7('0xd')](_0xdee7('0x1e'));return request({'uri':util['format']('%s/users/me.json',_0x17be24[_0xdee7('0x10')])})[_0xdee7('0x18')](function(_0x4902dc){logger[_0xdee7('0xd')](_0xdee7('0x1f'));return _0x4902dc[_0xdee7('0x20')];});}});}else{logger[_0xdee7('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdee7('0xf')](_0xdee7('0x21'),_0x17be24[_0xdee7('0x10')])})[_0xdee7('0x18')](function(_0x5222d6){logger['info']('Admin\x20account\x20selected.');return _0x5222d6[_0xdee7('0x20')];});}}function getEndUser(_0x1697b3,_0x2aebef,_0xa58e8){logger[_0xdee7('0xd')]('Searching\x20enduser\x20with\x20phone',_0xa58e8);return request({'uri':util['format'](_0xdee7('0x22'),_0x1697b3[_0xdee7('0x10')]),'qs':{'query':util[_0xdee7('0xf')](_0xdee7('0x23'),_0xa58e8)}})['then'](function(_0x574120){var _0x4f9512;if(_0x574120[_0xdee7('0x24')]['length']){_0x574120['results']=_['filter'](_0x574120[_0xdee7('0x24')],{'suspended':![],'role':_0xdee7('0x25')});if(_0x574120[_0xdee7('0x24')][_0xdee7('0x26')]){_0x4f9512=_[_0xdee7('0x27')](_0x574120[_0xdee7('0x24')]);}}if(_0x4f9512){logger[_0xdee7('0xd')](_0xdee7('0x28'));return _0x4f9512;}else{logger[_0xdee7('0xd')](_0xdee7('0x29'));return request({'uri':util[_0xdee7('0xf')](_0xdee7('0x2a'),_0x1697b3[_0xdee7('0x10')]),'method':_0xdee7('0x11'),'body':{'user':{'role':_0xdee7('0x25'),'name':util[_0xdee7('0xf')](_0xdee7('0x2b'),_0x2aebef||_0xa58e8),'phone':_0xa58e8}}})['then'](function(_0x2116ff){logger[_0xdee7('0xd')](_0xdee7('0x2c'));return _0x2116ff['user'];});}});}function getAuth(_0x5b2dd3){var _0x2bb8ce;if(_0x5b2dd3[_0xdee7('0x2d')]==='password'){_0x2bb8ce=util[_0xdee7('0xf')](_0xdee7('0x2e'),_0x5b2dd3[_0xdee7('0x2f')],_0x5b2dd3['password']);}else if(_0x5b2dd3[_0xdee7('0x2d')]==='token'){_0x2bb8ce=util[_0xdee7('0xf')]('%s/token:%s',_0x5b2dd3[_0xdee7('0x2f')],_0x5b2dd3[_0xdee7('0x30')]);}return util[_0xdee7('0xf')](_0xdee7('0x31'),new Buffer(_0x2bb8ce)['toString'](_0xdee7('0x32')));}function request(_0x25b0bd){logger[_0xdee7('0x33')](_0xdee7('0x34'),JSON['stringify'](_0x25b0bd));return rp(_['defaults'](_0x25b0bd,{'method':_0xdee7('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x47c086,_0x6c1510){var _0x505e09=[];if(_0x47c086&&_0x47c086[_0xdee7('0x26')]>0x0){_0x505e09=_[_0xdee7('0x36')](_0x47c086,_0x6c1510);}return _0x505e09;}function getCustomFields(_0x342a68,_0x1c77d0){var _0x21a9af=[];var _0xb1119a={'custom_fields':[]};if(_0x342a68[_0xdee7('0x26')]>0x0){_[_0xdee7('0x37')](_0x342a68,function(_0x41d646){if(_['includes'](['string',_0xdee7('0x38')],_0x41d646[_0xdee7('0x39')])&&_0x41d646['nameField']&&!_0x41d646[_0xdee7('0x3a')]){_0xb1119a[_0x41d646[_0xdee7('0x3b')][_0xdee7('0x3c')]()]=_0x41d646[_0xdee7('0x3d')][_0xdee7('0x3e')]();}else if(_[_0xdee7('0x3f')]([_0xdee7('0x40'),_0xdee7('0x38')],_0x41d646[_0xdee7('0x39')])&&_0x41d646['idField']&&_0x41d646[_0xdee7('0x3a')]){_0xb1119a[_0xdee7('0x41')][_0xdee7('0x42')]({'id':_0x41d646[_0xdee7('0x43')],'value':_0x41d646['content'][_0xdee7('0x3e')]()});}else if(_0x41d646[_0xdee7('0x39')]===_0xdee7('0x44')&&_0x41d646[_0xdee7('0x45')]&&_0x41d646[_0xdee7('0x43')]&&_0x41d646[_0xdee7('0x3a')]){_0x1c77d0[_0x41d646[_0xdee7('0x45')]]&&_0xb1119a[_0xdee7('0x41')][_0xdee7('0x42')]({'id':_0x41d646['idField'],'value':_0x1c77d0[_0x41d646['variableName']][_0xdee7('0x3e')]()});}else if(_0x41d646[_0xdee7('0x39')]===_0xdee7('0x46')&&_0x41d646[_0xdee7('0x47')]&&_0x41d646[_0xdee7('0x47')][_0xdee7('0x13')]&&_0x41d646[_0xdee7('0x43')]&&_0x41d646[_0xdee7('0x3a')]){_0x1c77d0[_0x41d646[_0xdee7('0x47')][_0xdee7('0x13')][_0xdee7('0x3c')]()]&&_0xb1119a[_0xdee7('0x41')][_0xdee7('0x42')]({'id':_0x41d646[_0xdee7('0x43')],'value':_0x1c77d0[_0x41d646[_0xdee7('0x47')][_0xdee7('0x13')][_0xdee7('0x3c')]()][_0xdee7('0x3e')]()});}});}return _0xb1119a;}exports[_0xdee7('0x48')]=function(_0x25635c,_0x563540,_0x4e2e7b,_0x222867,_0x2aacfb,_0xe430b7){var _0x5952c6,_0x473807;_0xe430b7['remoteUri']=intUtil[_0xdee7('0x49')](_0xe430b7['remoteUri']);_0xe430b7[_0xdee7('0x4a')]=intUtil[_0xdee7('0x49')](_0xe430b7[_0xdee7('0x4a')]);if(_0x2aacfb&&_0x2aacfb[_0xdee7('0x4b')]){logger['info'](_0xdee7('0x4c'),_0xdee7('0x4d'));_0x563540[_0xdee7('0x4e')]=util[_0xdee7('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe430b7[_0xdee7('0x4a')],_0x563540[_0xdee7('0x4f')],md5(_0x563540[_0xdee7('0x4f')]));}else{_0x563540[_0xdee7('0x4e')]='';}headers[_0xdee7('0x50')]=getAuth(_0xe430b7);return getUser(_0xe430b7,_0x222867[_0xdee7('0x51')])[_0xdee7('0x18')](function(_0x1dad5c){_0x5952c6=_0x1dad5c;logger[_0xdee7('0xd')](_0xdee7('0x52'),_0x5952c6['id']);return getEndUser(_0xe430b7,_0x563540[_0xdee7('0x53')],_0x563540[_0xdee7('0x54')]);})[_0xdee7('0x18')](function(_0x801edb){_0x473807=_0x801edb;logger[_0xdee7('0xd')](_0xdee7('0x55'),_0x473807['id']);return getTicket(_0xe430b7,_0x5952c6,_0x473807,_0x4e2e7b,_0x563540);})['then'](function(_0x1afa9a){if(_0x1afa9a){logger[_0xdee7('0xd')](_0xdee7('0x56'),_0x1afa9a['id']);switch(_0xe430b7[_0xdee7('0x39')]){case _0xdee7('0x57'):logger['info'](_0xdee7('0x4c'),_0xdee7('0x58'));return request({'uri':util[_0xdee7('0xf')](_0xdee7('0x59'),_0xe430b7[_0xdee7('0x10')],_0x5952c6['id'],_0x1afa9a['id']),'method':_0xdee7('0x11')});case _0xdee7('0x5a'):logger[_0xdee7('0xd')](_0xdee7('0x4c'),_0xdee7('0x5b'));emit(util['format'](_0xdee7('0x5c'),_0x222867[_0xdee7('0x13')]),'trigger:browser:url',{'uri':util[_0xdee7('0xf')](_0xdee7('0x5d'),_0xe430b7[_0xdee7('0x10')]['replace'](_0xdee7('0x5e'),''),_0x1afa9a['id'])});break;default:logger['error'](_0xdee7('0x4c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x11e22c){logger[_0xdee7('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xdee7('0x60')](_0x11e22c,{'showHidden':!![],'depth':null}));});};exports[_0xdee7('0x61')]=function(_0x4aa983,_0x4ae3f8,_0x274a51,_0x41e904,_0x32f438,_0xc48710,_0x3b013e){var _0x3f7ef2,_0x188864;_0xc48710[_0xdee7('0x10')]=intUtil[_0xdee7('0x49')](_0xc48710[_0xdee7('0x10')]);_0xc48710[_0xdee7('0x4a')]=intUtil['stripTrailingSlash'](_0xc48710[_0xdee7('0x4a')]);if(_0x3b013e&&_0x3b013e[_0xdee7('0x62')]&&_0x3b013e[_0xdee7('0x62')]!=='none'){logger[_0xdee7('0xd')](_0xdee7('0x63'),'Recording\x20is\x20enabled!');_0x4ae3f8[_0xdee7('0x4e')]=util[_0xdee7('0xf')](_0xdee7('0x64'),_0xc48710[_0xdee7('0x4a')],_0x4ae3f8['uniqueid'],md5(_0x4ae3f8[_0xdee7('0x4f')]));}headers[_0xdee7('0x50')]=getAuth(_0xc48710);return getUser(_0xc48710,_0x41e904['email'])[_0xdee7('0x18')](function(_0x5e5d42){_0x3f7ef2=_0x5e5d42;logger[_0xdee7('0xd')](_0xdee7('0x52'),_0x3f7ef2['id']);return getEndUser(_0xc48710,_0x4ae3f8[_0xdee7('0x65')],_0x4ae3f8[_0xdee7('0x66')]);})[_0xdee7('0x18')](function(_0x575e3a){_0x188864=_0x575e3a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x188864['id']);return getTicket(_0xc48710,_0x3f7ef2,_0x188864,_0x274a51,_0x4ae3f8);})[_0xdee7('0x18')](function(_0x56c29a){if(_0x56c29a){logger['info']('The\x20Ticket\x20ID\x20is:',_0x56c29a['id']);switch(_0xc48710[_0xdee7('0x39')]){case'integrationTab':logger[_0xdee7('0xd')](_0xdee7('0x63'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xdee7('0xf')](_0xdee7('0x59'),_0xc48710[_0xdee7('0x10')],_0x3f7ef2['id'],_0x56c29a['id']),'method':_0xdee7('0x11')});case _0xdee7('0x5a'):logger[_0xdee7('0xd')](_0xdee7('0x63'),_0xdee7('0x5b'));emit(util['format'](_0xdee7('0x5c'),_0x41e904['name']),_0xdee7('0x67'),{'uri':util[_0xdee7('0xf')](_0xdee7('0x5d'),_0xc48710['remoteUri'][_0xdee7('0x68')]('/api/v2',''),_0x56c29a['id'])});break;default:logger['error']('[OUTBOUND]',_0xdee7('0x69'));}}})[_0xdee7('0x6a')](function(_0x202902){logger[_0xdee7('0x5f')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x202902,{'showHidden':!![],'depth':null}));});};exports[_0xdee7('0x6b')]=function(_0x4e0647,_0x4e6aab,_0x18784d,_0x302299,_0x38e495,_0x56a67f){var _0x48c359,_0x5340f1;_0x56a67f['remoteUri']=intUtil[_0xdee7('0x49')](_0x56a67f[_0xdee7('0x10')]);_0x56a67f[_0xdee7('0x4a')]=intUtil[_0xdee7('0x49')](_0x56a67f[_0xdee7('0x4a')]);if(_0x38e495&&_0x38e495[_0xdee7('0x4b')]){logger[_0xdee7('0xd')]('['+_0x4e6aab[_0xdee7('0x6c')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x4e6aab['recordingURL']=util[_0xdee7('0xf')](_0xdee7('0x64'),_0x56a67f[_0xdee7('0x4a')],_0x4e6aab[_0xdee7('0x4f')],md5(_0x4e6aab[_0xdee7('0x4f')]));}else{_0x4e6aab[_0xdee7('0x4e')]='';}headers[_0xdee7('0x50')]=getAuth(_0x56a67f);return getUser(_0x56a67f)[_0xdee7('0x18')](function(_0x5534cf){_0x48c359=_0x5534cf;logger[_0xdee7('0xd')](_0xdee7('0x52'),_0x48c359['id']);return getEndUser(_0x56a67f,_0x4e6aab[_0xdee7('0x53')],_0x4e6aab[_0xdee7('0x54')]);})['then'](function(_0x41eb0d){_0x5340f1=_0x41eb0d;logger[_0xdee7('0xd')]('The\x20Enduser\x20ID\x20is:',_0x5340f1['id']);return getTicket(_0x56a67f,_0x48c359,_0x5340f1,_0x18784d,_0x4e6aab);})[_0xdee7('0x18')](function(_0x175fff){if(_0x175fff){logger[_0xdee7('0xd')]('The\x20Ticket\x20ID\x20is:',_0x175fff['id']);}})[_0xdee7('0x6a')](function(_0x5ba0e1){logger['error']('['+_0x4e6aab[_0xdee7('0x6c')][_0xdee7('0x6d')]()+']'+_0xdee7('0x6e'),util['inspect'](_0x5ba0e1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe4ba=['map','forEach','string','type','nameField','toLowerCase','content','idField','customField','custom_fields','variable','variableName','push','name','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','Subjects','getString','Descriptions','Fields','then','info','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Enduser\x20created.','password','%s:%s','username','authType','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify'];(function(_0x477bd1,_0x43589b){var _0x1186c2=function(_0x364b56){while(--_0x364b56){_0x477bd1['push'](_0x477bd1['shift']());}};_0x1186c2(++_0x43589b);}(_0xe4ba,0x113));var _0xae4b=function(_0xd53787,_0x486710){_0xd53787=_0xd53787-0x0;var _0x5c45a5=_0xe4ba[_0xd53787];return _0x5c45a5;};'use strict';var _=require(_0xae4b('0x0'));var rp=require(_0xae4b('0x1'));var md5=require('md5');var util=require(_0xae4b('0x2'));var Redis=require(_0xae4b('0x3'));var intUtil=require(_0xae4b('0x4'));var config=require(_0xae4b('0x5'));var logger=require(_0xae4b('0x6'))(_0xae4b('0x7'));config[_0xae4b('0x8')]=_[_0xae4b('0x9')](config[_0xae4b('0x8')],{'host':_0xae4b('0xa'),'port':0x18eb});var io=require(_0xae4b('0xb'))(new Redis(config[_0xae4b('0x8')]));function emit(_0x94731f,_0xd945fa,_0xf8af2e){io['to'](_0x94731f)['emit'](_0xd945fa,_0xf8af2e);}var headers={'Content-Type':_0xae4b('0xc'),'Accept':'application/json'};function getTicket(_0x5c63ca,_0x168eca,_0x4ff34a,_0x2498b2,_0x1d8985){logger['info'](_0xae4b('0xd'));return request({'uri':util[_0xae4b('0xe')](_0xae4b('0xf'),_0x5c63ca[_0xae4b('0x10')]),'method':_0xae4b('0x11'),'body':{'ticket':_['merge']({'requester_id':_0x4ff34a['id'],'submitter_id':_0x168eca?_0x168eca['id']:undefined,'assignee_id':_0x168eca?_0x168eca['id']:undefined,'tags':getTags(_0x2498b2[_0xae4b('0x12')],'name'),'subject':intUtil['getString'](_0x2498b2[_0xae4b('0x13')],_0x1d8985,'\x20'),'description':intUtil[_0xae4b('0x14')](_0x2498b2[_0xae4b('0x15')],_0x1d8985,'\x0a'),'comment':{'public':![],'body':intUtil[_0xae4b('0x14')](_0x2498b2['Descriptions'],_0x1d8985,'\x0a')}},getCustomFields(_0x2498b2[_0xae4b('0x16')],_0x1d8985))}})[_0xae4b('0x17')](function(_0x446ccf){logger['info']('Ticket\x20created!');return _0x446ccf['ticket'];});}function getUser(_0x12c51a,_0x51a5d0){if(intUtil['validateEmail'](_0x51a5d0)){logger[_0xae4b('0x18')](_0xae4b('0x19'),_0x51a5d0);return request({'uri':util[_0xae4b('0xe')](_0xae4b('0x1a'),_0x12c51a['remoteUri']),'qs':{'query':util['format'](_0xae4b('0x1b'),_0x51a5d0)}})[_0xae4b('0x17')](function(_0x37ef17){if(_0x37ef17[_0xae4b('0x1c')]){logger['info']('Agent\x20found!');return _[_0xae4b('0x1d')](_0x37ef17['results'],{'email':_0x51a5d0,'role':_0xae4b('0x1e')});}else{logger[_0xae4b('0x18')](_0xae4b('0x1f'));return request({'uri':util['format']('%s/users/me.json',_0x12c51a[_0xae4b('0x10')])})['then'](function(_0x4ef506){logger[_0xae4b('0x18')](_0xae4b('0x20'));return _0x4ef506[_0xae4b('0x21')];});}});}else{logger[_0xae4b('0x18')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xae4b('0xe')]('%s/users/me.json',_0x12c51a[_0xae4b('0x10')])})[_0xae4b('0x17')](function(_0x3233ae){logger[_0xae4b('0x18')](_0xae4b('0x20'));return _0x3233ae['user'];});}}function getEndUser(_0x34d8ba,_0x20f5de,_0x55d335){logger[_0xae4b('0x18')](_0xae4b('0x22'),_0x55d335);return request({'uri':util[_0xae4b('0xe')](_0xae4b('0x1a'),_0x34d8ba['remoteUri']),'qs':{'query':util[_0xae4b('0xe')](_0xae4b('0x23'),_0x55d335)}})[_0xae4b('0x17')](function(_0x2b73fc){var _0x5a2965;if(_0x2b73fc['results']['length']){_0x2b73fc[_0xae4b('0x24')]=_['filter'](_0x2b73fc[_0xae4b('0x24')],{'suspended':![],'role':'end-user'});if(_0x2b73fc[_0xae4b('0x24')][_0xae4b('0x25')]){_0x5a2965=_[_0xae4b('0x26')](_0x2b73fc['results']);}}if(_0x5a2965){logger[_0xae4b('0x18')](_0xae4b('0x27'));return _0x5a2965;}else{logger[_0xae4b('0x18')](_0xae4b('0x28'));return request({'uri':util['format'](_0xae4b('0x29'),_0x34d8ba[_0xae4b('0x10')]),'method':_0xae4b('0x11'),'body':{'user':{'role':_0xae4b('0x2a'),'name':util['format']('Caller\x20-\x20%s',_0x20f5de||_0x55d335),'phone':_0x55d335}}})['then'](function(_0x2ca2e4){logger['info'](_0xae4b('0x2b'));return _0x2ca2e4[_0xae4b('0x21')];});}});}function getAuth(_0x340ef3){var _0x51f0a9;if(_0x340ef3['authType']===_0xae4b('0x2c')){_0x51f0a9=util[_0xae4b('0xe')](_0xae4b('0x2d'),_0x340ef3[_0xae4b('0x2e')],_0x340ef3[_0xae4b('0x2c')]);}else if(_0x340ef3[_0xae4b('0x2f')]===_0xae4b('0x30')){_0x51f0a9=util[_0xae4b('0xe')]('%s/token:%s',_0x340ef3[_0xae4b('0x2e')],_0x340ef3[_0xae4b('0x30')]);}return util[_0xae4b('0xe')](_0xae4b('0x31'),new Buffer(_0x51f0a9)[_0xae4b('0x32')](_0xae4b('0x33')));}function request(_0x3ab234){logger[_0xae4b('0x34')](_0xae4b('0x35'),JSON[_0xae4b('0x36')](_0x3ab234));return rp(_[_0xae4b('0x9')](_0x3ab234,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x54fd7a,_0x455dd9){var _0x74f5cf=[];if(_0x54fd7a&&_0x54fd7a['length']>0x0){_0x74f5cf=_[_0xae4b('0x37')](_0x54fd7a,_0x455dd9);}return _0x74f5cf;}function getCustomFields(_0x24623f,_0x2e8a37){var _0x3a4198=[];var _0xa35d1b={'custom_fields':[]};if(_0x24623f[_0xae4b('0x25')]>0x0){_[_0xae4b('0x38')](_0x24623f,function(_0x3e77a2){if(_['includes']([_0xae4b('0x39'),'picklist'],_0x3e77a2[_0xae4b('0x3a')])&&_0x3e77a2[_0xae4b('0x3b')]&&!_0x3e77a2['customField']){_0xa35d1b[_0x3e77a2[_0xae4b('0x3b')][_0xae4b('0x3c')]()]=_0x3e77a2[_0xae4b('0x3d')]['toString']();}else if(_['includes']([_0xae4b('0x39'),'picklist'],_0x3e77a2['type'])&&_0x3e77a2[_0xae4b('0x3e')]&&_0x3e77a2[_0xae4b('0x3f')]){_0xa35d1b[_0xae4b('0x40')]['push']({'id':_0x3e77a2[_0xae4b('0x3e')],'value':_0x3e77a2[_0xae4b('0x3d')][_0xae4b('0x32')]()});}else if(_0x3e77a2['type']===_0xae4b('0x41')&&_0x3e77a2[_0xae4b('0x42')]&&_0x3e77a2['idField']&&_0x3e77a2[_0xae4b('0x3f')]){_0x2e8a37[_0x3e77a2[_0xae4b('0x42')]]&&_0xa35d1b[_0xae4b('0x40')][_0xae4b('0x43')]({'id':_0x3e77a2[_0xae4b('0x3e')],'value':_0x2e8a37[_0x3e77a2[_0xae4b('0x42')]]['toString']()});}else if(_0x3e77a2[_0xae4b('0x3a')]==='customVariable'&&_0x3e77a2['Variable']&&_0x3e77a2['Variable'][_0xae4b('0x44')]&&_0x3e77a2[_0xae4b('0x3e')]&&_0x3e77a2['customField']){_0x2e8a37[_0x3e77a2[_0xae4b('0x45')]['name'][_0xae4b('0x3c')]()]&&_0xa35d1b[_0xae4b('0x40')][_0xae4b('0x43')]({'id':_0x3e77a2[_0xae4b('0x3e')],'value':_0x2e8a37[_0x3e77a2[_0xae4b('0x45')]['name'][_0xae4b('0x3c')]()]['toString']()});}});}return _0xa35d1b;}exports[_0xae4b('0x46')]=function(_0x62ecb3,_0x24b699,_0x12952f,_0x1d5b45,_0x3c770d,_0x4c0da3){var _0x513312,_0x1158f6;_0x4c0da3[_0xae4b('0x10')]=intUtil[_0xae4b('0x47')](_0x4c0da3[_0xae4b('0x10')]);_0x4c0da3[_0xae4b('0x48')]=intUtil[_0xae4b('0x47')](_0x4c0da3[_0xae4b('0x48')]);if(_0x3c770d&&_0x3c770d[_0xae4b('0x49')]){logger[_0xae4b('0x18')](_0xae4b('0x4a'),_0xae4b('0x4b'));_0x24b699[_0xae4b('0x4c')]=util[_0xae4b('0xe')](_0xae4b('0x4d'),_0x4c0da3[_0xae4b('0x48')],_0x24b699[_0xae4b('0x4e')],md5(_0x24b699[_0xae4b('0x4e')]));}else{_0x24b699[_0xae4b('0x4c')]='';}headers['Authorization']=getAuth(_0x4c0da3);return getUser(_0x4c0da3,_0x1d5b45[_0xae4b('0x4f')])[_0xae4b('0x17')](function(_0x4c42db){_0x513312=_0x4c42db;logger[_0xae4b('0x18')](_0xae4b('0x50'),_0x513312['id']);return getEndUser(_0x4c0da3,_0x24b699[_0xae4b('0x51')],_0x24b699[_0xae4b('0x52')]);})[_0xae4b('0x17')](function(_0x5b0674){_0x1158f6=_0x5b0674;logger[_0xae4b('0x18')]('The\x20Enduser\x20ID\x20is:',_0x1158f6['id']);return getTicket(_0x4c0da3,_0x513312,_0x1158f6,_0x12952f,_0x24b699);})[_0xae4b('0x17')](function(_0x52f2c6){if(_0x52f2c6){logger[_0xae4b('0x18')](_0xae4b('0x53'),_0x52f2c6['id']);switch(_0x4c0da3['type']){case _0xae4b('0x54'):logger[_0xae4b('0x18')]('[QUEUE]',_0xae4b('0x55'));return request({'uri':util['format'](_0xae4b('0x56'),_0x4c0da3[_0xae4b('0x10')],_0x513312['id'],_0x52f2c6['id']),'method':_0xae4b('0x11')});case _0xae4b('0x57'):logger[_0xae4b('0x18')](_0xae4b('0x4a'),_0xae4b('0x58'));emit(util[_0xae4b('0xe')]('user:%s',_0x1d5b45[_0xae4b('0x44')]),_0xae4b('0x59'),{'uri':util[_0xae4b('0xe')](_0xae4b('0x5a'),_0x4c0da3[_0xae4b('0x10')][_0xae4b('0x5b')](_0xae4b('0x5c'),''),_0x52f2c6['id'])});break;default:logger[_0xae4b('0x5d')](_0xae4b('0x4a'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xae4b('0x5e')](function(_0x5b0687){logger['error'](_0xae4b('0x5f'),util[_0xae4b('0x60')](_0x5b0687,{'showHidden':!![],'depth':null}));});};exports[_0xae4b('0x61')]=function(_0x56cfa1,_0x339839,_0x2a3069,_0x248590,_0x354c0d,_0x2e212e,_0x4cda76){var _0x10058e,_0x3900da;_0x2e212e[_0xae4b('0x10')]=intUtil[_0xae4b('0x47')](_0x2e212e[_0xae4b('0x10')]);_0x2e212e[_0xae4b('0x48')]=intUtil[_0xae4b('0x47')](_0x2e212e[_0xae4b('0x48')]);if(_0x4cda76&&_0x4cda76[_0xae4b('0x62')]&&_0x4cda76[_0xae4b('0x62')]!==_0xae4b('0x63')){logger[_0xae4b('0x18')](_0xae4b('0x64'),_0xae4b('0x4b'));_0x339839[_0xae4b('0x4c')]=util[_0xae4b('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e212e['serverUrl'],_0x339839['uniqueid'],md5(_0x339839[_0xae4b('0x4e')]));}headers[_0xae4b('0x65')]=getAuth(_0x2e212e);return getUser(_0x2e212e,_0x248590['email'])[_0xae4b('0x17')](function(_0x3d0ae){_0x10058e=_0x3d0ae;logger[_0xae4b('0x18')](_0xae4b('0x50'),_0x10058e['id']);return getEndUser(_0x2e212e,_0x339839[_0xae4b('0x66')],_0x339839[_0xae4b('0x67')]);})[_0xae4b('0x17')](function(_0x13589c){_0x3900da=_0x13589c;logger[_0xae4b('0x18')]('The\x20Enduser\x20ID\x20is:',_0x3900da['id']);return getTicket(_0x2e212e,_0x10058e,_0x3900da,_0x2a3069,_0x339839);})['then'](function(_0x1ddf64){if(_0x1ddf64){logger[_0xae4b('0x18')](_0xae4b('0x53'),_0x1ddf64['id']);switch(_0x2e212e[_0xae4b('0x3a')]){case _0xae4b('0x54'):logger[_0xae4b('0x18')]('[OUTBOUND]',_0xae4b('0x55'));return request({'uri':util[_0xae4b('0xe')](_0xae4b('0x56'),_0x2e212e['remoteUri'],_0x10058e['id'],_0x1ddf64['id']),'method':'POST'});case'newTab':logger[_0xae4b('0x18')]('[OUTBOUND]',_0xae4b('0x58'));emit(util['format']('user:%s',_0x248590[_0xae4b('0x44')]),'trigger:browser:url',{'uri':util[_0xae4b('0xe')](_0xae4b('0x5a'),_0x2e212e[_0xae4b('0x10')][_0xae4b('0x5b')](_0xae4b('0x5c'),''),_0x1ddf64['id'])});break;default:logger[_0xae4b('0x5d')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xae4b('0x5e')](function(_0x500c47){logger[_0xae4b('0x5d')](_0xae4b('0x68'),util[_0xae4b('0x60')](_0x500c47,{'showHidden':!![],'depth':null}));});};exports[_0xae4b('0x69')]=function(_0x5e83c1,_0x25a795,_0x409d90,_0x16163a,_0x5acb38,_0x4be1a1){var _0x2426b2,_0x4f49f9;_0x4be1a1[_0xae4b('0x10')]=intUtil['stripTrailingSlash'](_0x4be1a1['remoteUri']);_0x4be1a1[_0xae4b('0x48')]=intUtil[_0xae4b('0x47')](_0x4be1a1[_0xae4b('0x48')]);if(_0x5acb38&&_0x5acb38[_0xae4b('0x49')]){logger[_0xae4b('0x18')]('['+_0x25a795[_0xae4b('0x6a')][_0xae4b('0x6b')]()+']',_0xae4b('0x4b'));_0x25a795[_0xae4b('0x4c')]=util[_0xae4b('0xe')](_0xae4b('0x4d'),_0x4be1a1['serverUrl'],_0x25a795[_0xae4b('0x4e')],md5(_0x25a795[_0xae4b('0x4e')]));}else{_0x25a795[_0xae4b('0x4c')]='';}headers[_0xae4b('0x65')]=getAuth(_0x4be1a1);return getUser(_0x4be1a1)[_0xae4b('0x17')](function(_0x502d31){_0x2426b2=_0x502d31;logger[_0xae4b('0x18')](_0xae4b('0x50'),_0x2426b2['id']);return getEndUser(_0x4be1a1,_0x25a795[_0xae4b('0x51')],_0x25a795[_0xae4b('0x52')]);})[_0xae4b('0x17')](function(_0x26f5a3){_0x4f49f9=_0x26f5a3;logger[_0xae4b('0x18')](_0xae4b('0x6c'),_0x4f49f9['id']);return getTicket(_0x4be1a1,_0x2426b2,_0x4f49f9,_0x409d90,_0x25a795);})[_0xae4b('0x17')](function(_0x530d8f){if(_0x530d8f){logger['info'](_0xae4b('0x53'),_0x530d8f['id']);}})[_0xae4b('0x5e')](function(_0x591e3b){logger[_0xae4b('0x5d')]('['+_0x25a795[_0xae4b('0x6a')][_0xae4b('0x6b')]()+']'+_0xae4b('0x6d'),util[_0xae4b('0x60')](_0x591e3b,{'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 0231ed9..2ecd4e3 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 _0xed0b=['redis','defaults','localhost','socket.io-emitter','debug','stringify','includes','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','isBefore','expires_in','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','clientSecret','refresh_token','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','ActiveUsers','then','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','Zoho-oauthtoken\x20','code','SUCCESS','enduserType','Error:\x20','catch','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','profile','administrator','Subject','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','format','mm:ss','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','toUpperCase','calleridnum','lodash','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho'];(function(_0x65c50e,_0x1aa926){var _0x4573e7=function(_0x5bc049){while(--_0x5bc049){_0x65c50e['push'](_0x65c50e['shift']());}};_0x4573e7(++_0x1aa926);}(_0xed0b,0x1c8));var _0xbed0=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xed0b[_0x4c4037];return _0x357862;};'use strict';var _=require(_0xbed0('0x0'));var rp=require('request-promise');var md5=require(_0xbed0('0x1'));var util=require('util');var intUtil=require(_0xbed0('0x2'));var moment=require(_0xbed0('0x3'));var Redis=require(_0xbed0('0x4'));var BPromise=require(_0xbed0('0x5'));var config=require(_0xbed0('0x6'));var logger=require(_0xbed0('0x7'))(_0xbed0('0x8'));config[_0xbed0('0x9')]=_[_0xbed0('0xa')](config[_0xbed0('0x9')],{'host':_0xbed0('0xb'),'port':0x18eb});var io=require(_0xbed0('0xc'))(new Redis(config['redis']));function emit(_0x5f3cbe,_0x18dd6c,_0x29f3b8){io['to'](_0x5f3cbe)['emit'](_0x18dd6c,_0x29f3b8);}function request(_0x53c460){logger[_0xbed0('0xd')]('[HTTP]',JSON[_0xbed0('0xe')](_0x53c460));return rp(_0x53c460);}function getCustomFields(_0x331b52,_0x42b63f){var _0x13dad9={};if(_0x331b52['length']>0x0){_['forEach'](_0x331b52,function(_0x3664fc){if(_[_0xbed0('0xf')]([_0xbed0('0x10'),_0xbed0('0x11')],_0x3664fc['type'])&&_0x3664fc[_0xbed0('0x12')]){_0x13dad9[_0x3664fc['idField']]=_0x3664fc[_0xbed0('0x13')][_0xbed0('0x14')]();}else if(_0x3664fc[_0xbed0('0x15')]===_0xbed0('0x16')&&_0x3664fc[_0xbed0('0x17')]&&_0x3664fc[_0xbed0('0x12')]&&_0x42b63f[_0x3664fc[_0xbed0('0x17')]]){_0x13dad9[_0x3664fc[_0xbed0('0x12')]]=_0x42b63f[_0x3664fc[_0xbed0('0x17')]][_0xbed0('0x14')]();}else if(_0x3664fc['type']===_0xbed0('0x18')&&_0x3664fc[_0xbed0('0x19')]&&_0x3664fc[_0xbed0('0x19')]['name']&&_0x3664fc[_0xbed0('0x12')]&&_0x42b63f[_0x3664fc[_0xbed0('0x19')][_0xbed0('0x1a')]['toLowerCase']()]){_0x13dad9[_0x3664fc[_0xbed0('0x12')]]=_0x42b63f[_0x3664fc['Variable'][_0xbed0('0x1a')][_0xbed0('0x1b')]()][_0xbed0('0x14')]();}});}return _0x13dad9;}function getName(_0x44fd1e){if(_0x44fd1e[_0xbed0('0x1c')]('\x20')>0x0){var _0x4638a6=_0x44fd1e['split'](/ (.+)/);if(_0x4638a6[0x1]){return _0x4638a6;}}return[_0x44fd1e,_0x44fd1e];}var accountsTokens={};function getAccessToken(_0x57f3d0){return new Promise(function(_0x503b01,_0x481936){if(!_['isNil'](accountsTokens[_0x57f3d0['id']])&&!_[_0xbed0('0x1d')](accountsTokens[_0x57f3d0['id']][_0xbed0('0x1e')])){if(moment()[_0xbed0('0x1f')](accountsTokens[_0x57f3d0['id']][_0xbed0('0x20')])){_0x503b01(accountsTokens[_0x57f3d0['id']][_0xbed0('0x1e')]);}}var _0x90791;switch(_0x57f3d0['zone']){case'US':_0x90791=_0xbed0('0x21');break;case'AU':_0x90791=_0xbed0('0x22');break;case'EU':_0x90791='https://accounts.zoho.eu';break;case'IN':_0x90791=_0xbed0('0x23');break;case'CN':_0x90791=_0xbed0('0x24');break;default:_0x90791=_0xbed0('0x25');break;}var _0x55b276={'method':_0xbed0('0x26'),'uri':_0x90791+_0xbed0('0x27'),'qs':{'refresh_token':_0x57f3d0[_0xbed0('0x28')],'client_id':_0x57f3d0['clientId'],'client_secret':_0x57f3d0[_0xbed0('0x29')],'grant_type':_0xbed0('0x2a')},'json':!![]};return rp(_0x55b276)['then'](function(_0x1e46ab){accountsTokens[_0x57f3d0['id']]={'access_token':_0x1e46ab['access_token'],'expires_in':moment()[_0xbed0('0x2b')](_0x1e46ab[_0xbed0('0x20')],_0xbed0('0x2c'))};_0x503b01(_0x1e46ab[_0xbed0('0x1e')]);})['catch'](function(_0x3176df){logger[_0xbed0('0x2d')](_0xbed0('0x2e'),_0x3176df[_0xbed0('0x2f')]);_0x481936(_0x3176df);});});}function getUser(_0x2ad42f,_0x1df843,_0x1d5e92,_0x574705){logger[_0xbed0('0x30')](_0xbed0('0x31'));return request({'method':_0xbed0('0x32'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x1df843),'qs':{'type':_0xbed0('0x33')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2ad42f},'json':!![]})[_0xbed0('0x34')](function(_0x3e11c0){if(_0x3e11c0[_0xbed0('0x35')]){var _0x433b81=-0x1;if(_[_0xbed0('0x36')](_0x3e11c0[_0xbed0('0x35')])){if(!_['isNil'](_0x574705)){_0x433b81=_['findIndex'](_0x3e11c0['users'],function(_0x22393e){return _0x22393e[_0xbed0('0x37')]===_0x574705;});}if(_0x433b81>=0x0){logger['info'](_0xbed0('0x38'));}else{logger[_0xbed0('0x30')](_0xbed0('0x39'));_0x433b81=_[_0xbed0('0x3a')](_0x3e11c0['users'],function(_0x1b95be){return _0x1b95be['profile'][_0xbed0('0x1a')]===_0xbed0('0x3b');});}return _0x3e11c0[_0xbed0('0x35')][_0x433b81];}else{if(_0x3e11c0[_0xbed0('0x3c')]['profile'][_0xbed0('0x1a')]==='Administrator'){logger[_0xbed0('0x30')](_0xbed0('0x39'));user=_0x3e11c0['user'];return user;}else{logger[_0xbed0('0x2d')](_0xbed0('0x3d'),JSON['stringify'](_0x3e11c0));throw new Error(_0xbed0('0x3e')+JSON[_0xbed0('0xe')](_0x3e11c0));}}}else{logger[_0xbed0('0x2d')](_0xbed0('0x3d'),JSON['stringify'](_0x3e11c0));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x3e11c0));}})['catch'](function(_0x1d66be){console['error'](_0x1d66be);});}function getZohoUser(_0x2b8e0d,_0x3623f2){return new BPromise(function(_0x4e4ea4,_0x2697a1){request(_0x2b8e0d)[_0xbed0('0x34')](function(_0x59bf75){var _0x420f8=null;if(_0x59bf75){_0x420f8=_0x59bf75[_0xbed0('0x3f')][0x0];_0x420f8['enduserType']=_0x3623f2;}_0x4e4ea4(_0x420f8);})['catch'](function(_0x2089d4){_0x2697a1(_0x2089d4);});});}function createEndUser(_0x311b7c,_0x26a301,_0x1f6473,_0x429fc5,_0x462cb,_0x190627){var _0x1f6473=getName(_0x1f6473);return request({'method':_0xbed0('0x26'),'uri':'https://www.zohoapis.'+_0x26a301+_0xbed0('0x40')+_[_0xbed0('0x41')](_0x190627[_0xbed0('0x42')])+'s','body':{'data':[{'Last_Name':_0x1f6473[0x1],'First_Name':_0x1f6473[0x0],'Phone':_0x429fc5,'Owner':{'name':!_[_0xbed0('0x1d')](_0x462cb['role'][_0xbed0('0x1a')])?_0x462cb[_0xbed0('0x43')][_0xbed0('0x1a')]:!_[_0xbed0('0x1d')](_0x462cb[_0xbed0('0x44')])?_0x462cb[_0xbed0('0x44')]+'\x20'+_0x462cb['last_name']:_0x462cb[_0xbed0('0x45')],'id':_0x462cb['id']}}]},'headers':{'Authorization':_0xbed0('0x46')+_0x311b7c},'json':!![]})[_0xbed0('0x34')](function(_0x3616ec){if(_0x3616ec&&_0x3616ec[_0xbed0('0x3f')][0x0][_0xbed0('0x47')]===_0xbed0('0x48')){var _0x57ee9f=_0x3616ec[_0xbed0('0x3f')][0x0]['details'];_0x57ee9f[_0xbed0('0x49')]=_[_0xbed0('0x41')](_0x190627[_0xbed0('0x42')])+'s';return _0x57ee9f;}logger[_0xbed0('0x2d')](_0xbed0('0x3d'),JSON[_0xbed0('0xe')](data));throw new Error(_0xbed0('0x4a')+JSON[_0xbed0('0xe')](data));})[_0xbed0('0x4b')](function(_0x2e9148){console[_0xbed0('0x4c')](_0xbed0('0x4d'),_0x2e9148);});}function getEndUser(_0x49ee9e,_0x3adea4,_0x299a60,_0x2644a1,_0x41f3ee,_0x138c9c,_0x5f20f8){var _0x1a3e09={'method':_0xbed0('0x32'),'uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x49ee9e},'json':!![]};switch(_0x5f20f8[_0xbed0('0x4e')]){case _0xbed0('0x4f'):_0x1a3e09[_0xbed0('0x50')]=_0xbed0('0x51')+_0x3adea4+_0xbed0('0x52')+_0x41f3ee+'))';return getZohoUser(_0x1a3e09,_0xbed0('0x53'))[_0xbed0('0x34')](function(_0x2328b6){if(_0x2328b6)return _0x2328b6;_0x1a3e09[_0xbed0('0x50')]='https://www.zohoapis.'+_0x3adea4+_0xbed0('0x54')+_0x41f3ee+'))';return getZohoUser(_0x1a3e09,_0xbed0('0x55'))[_0xbed0('0x34')](function(_0x4b7b10){if(_0x4b7b10)return _0x4b7b10;if(_0x5f20f8[_0xbed0('0x42')]!=_0xbed0('0x56')){return createEndUser(_0x49ee9e,_0x3adea4,_0x2644a1,_0x41f3ee,_0x138c9c,_0x5f20f8);}else{return{};}});});break;case'contact':_0x1a3e09[_0xbed0('0x50')]=_0xbed0('0x51')+_0x3adea4+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x41f3ee+'))';return getZohoUser(_0x1a3e09,'Contacts')[_0xbed0('0x34')](function(_0x3a6030){if(_0x3a6030)return _0x3a6030;if(_0x5f20f8[_0xbed0('0x42')]!=_0xbed0('0x56')){return createEndUser(_0x49ee9e,_0x3adea4,_0x2644a1,_0x41f3ee,_0x138c9c,_0x5f20f8);}else{return{};}});break;case _0xbed0('0x57'):_0x1a3e09[_0xbed0('0x50')]='https://www.zohoapis.'+_0x3adea4+_0xbed0('0x54')+_0x41f3ee+'))';return getZohoUser(_0x1a3e09,_0xbed0('0x55'))[_0xbed0('0x34')](function(_0x1a5d5e){if(_0x1a5d5e)return _0x1a5d5e;if(_0x5f20f8[_0xbed0('0x42')]!=_0xbed0('0x56')){return createEndUser(_0x49ee9e,_0x3adea4,_0x2644a1,_0x41f3ee,_0x138c9c,_0x5f20f8);}else{return{};}});break;}}function getCall(_0x4cffda,_0x92e82e,_0x327cf9,_0x362e31,_0x5ef8c3,_0x3dbc2b,_0x52b582,_0x4a20b9){logger['info'](_0xbed0('0x58'));var _0x45c4d1={};_0x45c4d1[_0xbed0('0x59')]={'name':!_['isNil'](_0x362e31['role'][_0xbed0('0x1a')])&&!_[_0xbed0('0x1d')](_0x362e31['profile'][_0xbed0('0x1a')])&&_0x362e31[_0xbed0('0x5a')][_0xbed0('0x1a')]===_0xbed0('0x5b')?_0x362e31['role'][_0xbed0('0x1a')]:!_[_0xbed0('0x1d')](_0x362e31[_0xbed0('0x44')])?_0x362e31['first_name']+'\x20'+_0x362e31[_0xbed0('0x45')]:_0x362e31[_0xbed0('0x45')],'id':_0x362e31['id']};_0x45c4d1[_0xbed0('0x5c')]=intUtil['getString'](_0x3dbc2b[_0xbed0('0x5d')],_0x52b582,'\x20');_0x45c4d1[_0xbed0('0x5e')]=intUtil['getString'](_0x3dbc2b[_0xbed0('0x5f')],_0x52b582,'\x0a');if(_0x5ef8c3[_0xbed0('0x49')]==='Contacts'){_0x45c4d1['Who_Id']={'name':!_['isNil'](_0x5ef8c3['Full_Name'])?_0x5ef8c3[_0xbed0('0x60')]:!_['isNil'](_0x5ef8c3[_0xbed0('0x61')])?_0x5ef8c3['First_Name']+'\x20'+_0x5ef8c3['Last_Name']:_0x5ef8c3[_0xbed0('0x62')],'id':_0x5ef8c3['id']};}if(_0x5ef8c3['enduserType']===_0xbed0('0x55')){_0x45c4d1[_0xbed0('0x63')]={'name':!_[_0xbed0('0x1d')](_0x5ef8c3[_0xbed0('0x60')])?_0x5ef8c3['Full_Name']:!_['isNil'](_0x5ef8c3['First_Name'])?_0x5ef8c3['First_Name']+'\x20'+_0x5ef8c3[_0xbed0('0x62')]:_0x5ef8c3[_0xbed0('0x62')],'id':_0x5ef8c3['id']};_0x45c4d1[_0xbed0('0x64')]=_[_0xbed0('0x41')](_0x5ef8c3[_0xbed0('0x49')]);}if(_0x52b582[_0xbed0('0x65')]){_0x45c4d1[_0xbed0('0x66')]=moment[_0xbed0('0x67')](parseInt(_0x52b582[_0xbed0('0x65')])*0x3e8)[_0xbed0('0x68')](_0xbed0('0x69'));}else if(_0x52b582['answertime']&&_0x52b582[_0xbed0('0x6a')]){_0x45c4d1[_0xbed0('0x66')]=moment[_0xbed0('0x67')](moment(_0x52b582['endtime'],_0xbed0('0x6b'))[_0xbed0('0x6c')](moment(_0x52b582[_0xbed0('0x6d')],_0xbed0('0x6b'))))[_0xbed0('0x68')](_0xbed0('0x69'));}switch(_0x52b582['lastevent']){case'called':_0x45c4d1[_0xbed0('0x6e')]=_0xbed0('0x6f');break;case _0xbed0('0x70'):case'connect':_0x45c4d1[_0xbed0('0x6e')]=_0xbed0('0x71');break;case _0xbed0('0x72'):_0x45c4d1[_0xbed0('0x6e')]=_0xbed0('0x73');break;case _0xbed0('0x74'):_0x45c4d1[_0xbed0('0x6e')]='Abandoned';break;case'timeout':_0x45c4d1[_0xbed0('0x6e')]='Timeout';default:}_0x45c4d1[_0xbed0('0x75')]=(_0x4a20b9===_0xbed0('0x76')?moment(_0x52b582['starttime'])[_0xbed0('0x68')](_0xbed0('0x6b')):moment(_0x52b582[_0xbed0('0x77')])[_0xbed0('0x68')](_0xbed0('0x6b')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x45c4d1[_0xbed0('0x78')]=_0x4a20b9||_0xbed0('0x79');_0x45c4d1=_['merge'](_0x45c4d1,getCustomFields(_0x3dbc2b[_0xbed0('0x7a')],_0x52b582));return request({'method':'POST','uri':_0xbed0('0x51')+_0x92e82e+_0xbed0('0x7b'),'headers':{'Authorization':_0xbed0('0x46')+_0x4cffda},'body':{'data':[_0x45c4d1]},'json':!![]})[_0xbed0('0x34')](function(_0x871233){if(_0x871233&&_0x871233[_0xbed0('0x3f')][0x0][_0xbed0('0x47')]==='SUCCESS'){logger[_0xbed0('0x30')]('Call\x20created!');return{'id':_0x871233['data'][0x0][_0xbed0('0x7c')]['id']};}})['catch'](function(_0x1eb5fd){logger[_0xbed0('0x30')]('err',_0x1eb5fd[_0xbed0('0x2f')]);console[_0xbed0('0x4c')](_0xbed0('0x7d'),_0x1eb5fd);});}exports[_0xbed0('0x7e')]=function(_0x22215d,_0x23a2a1,_0x6b3bfc,_0xa97396,_0x183feb,_0x5ca2b0){var _0xe2d530,_0x3e36d0,_0x2249de;_0x5ca2b0[_0xbed0('0x7f')]=intUtil['stripTrailingSlash'](_0x5ca2b0[_0xbed0('0x7f')]);_0x5ca2b0['serverUrl']=intUtil[_0xbed0('0x80')](_0x5ca2b0[_0xbed0('0x81')]);if(_0x183feb&&_0x183feb[_0xbed0('0x82')]){logger['info'](_0xbed0('0x83'),_0xbed0('0x84'));_0x23a2a1['recordingURL']=_0x5ca2b0[_0xbed0('0x81')]+_0xbed0('0x85')+_0x23a2a1[_0xbed0('0x86')]+_0xbed0('0x87')+md5(_0x23a2a1['uniqueid']);}else{_0x23a2a1[_0xbed0('0x88')]='';}var _0x542271=_0x5ca2b0[_0xbed0('0x7f')]===_0xbed0('0x89')?'eu':_0xbed0('0x8a');return getAccessToken(_0x5ca2b0)['then'](function(_0x34142a){_0x2249de=_0x34142a;return getUser(_0x2249de,_0x542271,_0x5ca2b0,_0xa97396[_0xbed0('0x37')]);})['then'](function(_0x392d3a){_0xe2d530=_0x392d3a;logger[_0xbed0('0x30')](_0xbed0('0x8b'),_0xe2d530['id']);return getEndUser(_0x2249de,_0x542271,_0x5ca2b0,_0x23a2a1[_0xbed0('0x8c')],_0x23a2a1['calleridnum'],_0xe2d530,_0x6b3bfc);})[_0xbed0('0x34')](function(_0x551ea5){_0x3e36d0=_0x551ea5;return getCall(_0x2249de,_0x542271,_0x5ca2b0,_0xe2d530,_0x3e36d0,_0x6b3bfc,_0x23a2a1,_0xbed0('0x79'));})['then'](function(_0x66f71f){if(_0x66f71f){logger[_0xbed0('0x30')](_0xbed0('0x8d'),_0x66f71f['id']);logger[_0xbed0('0x30')](_0xbed0('0x83'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbed0('0x68')](_0xbed0('0x8e'),_0xa97396[_0xbed0('0x1a')]),'trigger:browser:url',{'uri':_0xbed0('0x8f')+_0x5ca2b0['host']+_0xbed0('0x90')+_0x66f71f['id']});}})[_0xbed0('0x4b')](function(_0x2517c3){logger[_0xbed0('0x2d')](_0xbed0('0x83'),JSON[_0xbed0('0xe')](_0x2517c3));});};exports[_0xbed0('0x76')]=function(_0x4cc884,_0x3b5062,_0x464870,_0x5b50bb,_0x28b4d5,_0x16de8d,_0x4afde4){var _0x5dc935,_0x3ba27a,_0x12df93;_0x16de8d[_0xbed0('0x7f')]=intUtil['stripTrailingSlash'](_0x16de8d[_0xbed0('0x7f')]);_0x16de8d[_0xbed0('0x81')]=intUtil[_0xbed0('0x80')](_0x16de8d['serverUrl']);if(_0x4afde4&&_0x4afde4['recordingFormat']&&_0x4afde4[_0xbed0('0x91')]!==_0xbed0('0x92')){logger['info'](_0xbed0('0x93'),_0xbed0('0x84'));_0x3b5062[_0xbed0('0x88')]=_0x16de8d[_0xbed0('0x81')]+_0xbed0('0x85')+_0x3b5062[_0xbed0('0x86')]+_0xbed0('0x87')+md5(_0x3b5062['uniqueid']);}var _0x25ebfe=_0x16de8d[_0xbed0('0x7f')]===_0xbed0('0x89')?'eu':_0xbed0('0x8a');return getAccessToken(_0x16de8d)[_0xbed0('0x34')](function(_0x24d6e7){_0x12df93=_0x24d6e7;return getUser(_0x12df93,_0x25ebfe,_0x16de8d,_0x5b50bb[_0xbed0('0x37')]);})['then'](function(_0x509b1b){_0x5dc935=_0x509b1b;logger[_0xbed0('0x30')]('The\x20User\x20ID\x20is:',_0x5dc935['id']);return getEndUser(_0x12df93,_0x25ebfe,_0x16de8d,_0x3b5062[_0xbed0('0x94')],_0x3b5062[_0xbed0('0x95')],_0x5dc935,_0x464870);})[_0xbed0('0x34')](function(_0x109bed){_0x3ba27a=_0x109bed;return getCall(_0x12df93,_0x25ebfe,_0x16de8d,_0x5dc935,_0x3ba27a,_0x464870,_0x3b5062,_0xbed0('0x96'));})[_0xbed0('0x34')](function(_0x10cc89){if(_0x10cc89){logger[_0xbed0('0x30')]('The\x20Call\x20ID\x20is:',_0x10cc89['id']);logger[_0xbed0('0x30')](_0xbed0('0x93'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xbed0('0x68')]('user:%s',_0x5b50bb['name']),_0xbed0('0x97'),{'uri':_0xbed0('0x8f')+_0x16de8d['host']+_0xbed0('0x90')+_0x10cc89['id']});}})[_0xbed0('0x4b')](function(_0x22532b){logger[_0xbed0('0x2d')](_0xbed0('0x93'),JSON[_0xbed0('0xe')](_0x22532b));});};exports[_0xbed0('0x98')]=function(_0x3842ad,_0x139c2e,_0x5d66a5,_0x2204c0,_0x392471,_0x23eb85){var _0xe453a6,_0x1e2135,_0x43fbd7;_0x23eb85[_0xbed0('0x7f')]=intUtil[_0xbed0('0x80')](_0x23eb85['host']);_0x23eb85[_0xbed0('0x81')]=intUtil[_0xbed0('0x80')](_0x23eb85[_0xbed0('0x81')]);if(_0x392471&&_0x392471['monitor_format']){logger['info']('['+_0x139c2e['lastevent'][_0xbed0('0x99')]()+']',_0xbed0('0x84'));_0x139c2e['recordingURL']=_0x23eb85[_0xbed0('0x81')]+_0xbed0('0x85')+_0x139c2e['uniqueid']+_0xbed0('0x87')+md5(_0x139c2e['uniqueid']);}else{_0x139c2e[_0xbed0('0x88')]='';}var _0x1493b0=_0x23eb85[_0xbed0('0x7f')]===_0xbed0('0x89')?'eu':'com';return getAccessToken(_0x23eb85)['then'](function(_0x4d8c5b){_0x43fbd7=_0x4d8c5b;return getUser(_0x43fbd7,_0x1493b0,_0x23eb85);})[_0xbed0('0x34')](function(_0x2ec08c){_0xe453a6=_0x2ec08c;logger[_0xbed0('0x30')](_0xbed0('0x8b'),_0xe453a6['id']);return getEndUser(_0x43fbd7,_0x1493b0,_0x23eb85,_0x139c2e['calleridname'],_0x139c2e[_0xbed0('0x9a')],_0xe453a6,_0x5d66a5);})[_0xbed0('0x34')](function(_0x31d155){_0x1e2135=_0x31d155;return getCall(_0x43fbd7,_0x1493b0,_0x23eb85,_0xe453a6,_0x1e2135,_0x5d66a5,_0x139c2e,_0xbed0('0x79'));})[_0xbed0('0x34')](function(_0x43ca20){if(_0x43ca20){logger[_0xbed0('0x30')]('The\x20Call\x20ID\x20is:',_0x43ca20['id']);}})['catch'](function(_0x434548){logger[_0xbed0('0x2d')]('['+_0x139c2e['lastevent'][_0xbed0('0x99')]()+']',JSON[_0xbed0('0xe')](_0x434548));});}; \ No newline at end of file +var _0x009f=['Using\x20the\x20admin\x20account!','Administrator','user','profile','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','catch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','err','stack','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','user:%s','calleridname','toUpperCase','lodash','request-promise','md5','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','[HTTP]','stringify','length','forEach','picklist','idField','content','toString','type','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','add','expires_in','seconds','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!'];(function(_0x4fa559,_0x5e7a03){var _0x59a8ed=function(_0x29a158){while(--_0x29a158){_0x4fa559['push'](_0x4fa559['shift']());}};_0x59a8ed(++_0x5e7a03);}(_0x009f,0x194));var _0xf009=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x009f[_0x10291b];return _0x1d5fbe;};'use strict';var _=require(_0xf009('0x0'));var rp=require(_0xf009('0x1'));var md5=require(_0xf009('0x2'));var util=require('util');var intUtil=require(_0xf009('0x3'));var moment=require('moment');var Redis=require(_0xf009('0x4'));var BPromise=require(_0xf009('0x5'));var config=require(_0xf009('0x6'));var logger=require(_0xf009('0x7'))('zoho');config[_0xf009('0x8')]=_[_0xf009('0x9')](config[_0xf009('0x8')],{'host':_0xf009('0xa'),'port':0x18eb});var io=require(_0xf009('0xb'))(new Redis(config[_0xf009('0x8')]));function emit(_0x25e5f6,_0x2d1c8a,_0x616011){io['to'](_0x25e5f6)['emit'](_0x2d1c8a,_0x616011);}function request(_0xeb7077){logger['debug'](_0xf009('0xc'),JSON[_0xf009('0xd')](_0xeb7077));return rp(_0xeb7077);}function getCustomFields(_0x1798cf,_0x163f6f){var _0x48ac76={};if(_0x1798cf[_0xf009('0xe')]>0x0){_[_0xf009('0xf')](_0x1798cf,function(_0x50ef5c){if(_['includes'](['string',_0xf009('0x10')],_0x50ef5c['type'])&&_0x50ef5c[_0xf009('0x11')]){_0x48ac76[_0x50ef5c['idField']]=_0x50ef5c[_0xf009('0x12')][_0xf009('0x13')]();}else if(_0x50ef5c[_0xf009('0x14')]==='variable'&&_0x50ef5c['variableName']&&_0x50ef5c[_0xf009('0x11')]&&_0x163f6f[_0x50ef5c[_0xf009('0x15')]]){_0x48ac76[_0x50ef5c[_0xf009('0x11')]]=_0x163f6f[_0x50ef5c[_0xf009('0x15')]][_0xf009('0x13')]();}else if(_0x50ef5c[_0xf009('0x14')]===_0xf009('0x16')&&_0x50ef5c[_0xf009('0x17')]&&_0x50ef5c['Variable'][_0xf009('0x18')]&&_0x50ef5c[_0xf009('0x11')]&&_0x163f6f[_0x50ef5c[_0xf009('0x17')][_0xf009('0x18')][_0xf009('0x19')]()]){_0x48ac76[_0x50ef5c[_0xf009('0x11')]]=_0x163f6f[_0x50ef5c['Variable']['name'][_0xf009('0x19')]()][_0xf009('0x13')]();}});}return _0x48ac76;}function getName(_0x567a65){if(_0x567a65[_0xf009('0x1a')]('\x20')>0x0){var _0x3d4d80=_0x567a65[_0xf009('0x1b')](/ (.+)/);if(_0x3d4d80[0x1]){return _0x3d4d80;}}return[_0x567a65,_0x567a65];}var accountsTokens={};function getAccessToken(_0x2829b2){return new Promise(function(_0x26a767,_0x21887f){if(!_['isNil'](accountsTokens[_0x2829b2['id']])&&!_[_0xf009('0x1c')](accountsTokens[_0x2829b2['id']][_0xf009('0x1d')])){if(moment()[_0xf009('0x1e')](accountsTokens[_0x2829b2['id']]['expires_in'])){_0x26a767(accountsTokens[_0x2829b2['id']][_0xf009('0x1d')]);}}var _0x2b6a22;switch(_0x2829b2[_0xf009('0x1f')]){case'US':_0x2b6a22=_0xf009('0x20');break;case'AU':_0x2b6a22=_0xf009('0x21');break;case'EU':_0x2b6a22=_0xf009('0x22');break;case'IN':_0x2b6a22=_0xf009('0x23');break;case'CN':_0x2b6a22='https://accounts.zoho.com.cn';break;default:_0x2b6a22='https://accounts.zoho.eu';break;}var _0x4a3967={'method':_0xf009('0x24'),'uri':_0x2b6a22+_0xf009('0x25'),'qs':{'refresh_token':_0x2829b2[_0xf009('0x26')],'client_id':_0x2829b2[_0xf009('0x27')],'client_secret':_0x2829b2[_0xf009('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4a3967)['then'](function(_0x305c16){accountsTokens[_0x2829b2['id']]={'access_token':_0x305c16[_0xf009('0x1d')],'expires_in':moment()[_0xf009('0x29')](_0x305c16[_0xf009('0x2a')],_0xf009('0x2b'))};_0x26a767(_0x305c16[_0xf009('0x1d')]);})['catch'](function(_0x61f9e4){logger[_0xf009('0x2c')](_0xf009('0x2d'),_0x61f9e4['stack']);_0x21887f(_0x61f9e4);});});}function getUser(_0x52bcf7,_0x285c93,_0xf0ee21,_0x375c25){logger[_0xf009('0x2e')](_0xf009('0x2f'));return request({'method':'GET','uri':util[_0xf009('0x30')](_0xf009('0x31'),_0x285c93),'qs':{'type':_0xf009('0x32')},'headers':{'Authorization':_0xf009('0x33')+_0x52bcf7},'json':!![]})[_0xf009('0x34')](function(_0x4016d8){if(_0x4016d8[_0xf009('0x35')]){var _0x69cdfa=-0x1;if(_[_0xf009('0x36')](_0x4016d8[_0xf009('0x35')])){if(!_[_0xf009('0x1c')](_0x375c25)){_0x69cdfa=_[_0xf009('0x37')](_0x4016d8['users'],function(_0x3d4928){return _0x3d4928[_0xf009('0x38')]===_0x375c25;});}if(_0x69cdfa>=0x0){logger[_0xf009('0x2e')](_0xf009('0x39'));}else{logger[_0xf009('0x2e')](_0xf009('0x3a'));_0x69cdfa=_[_0xf009('0x37')](_0x4016d8['users'],function(_0x426165){return _0x426165['profile']['name']===_0xf009('0x3b');});}return _0x4016d8[_0xf009('0x35')][_0x69cdfa];}else{if(_0x4016d8[_0xf009('0x3c')][_0xf009('0x3d')]['name']===_0xf009('0x3b')){logger[_0xf009('0x2e')](_0xf009('0x3a'));user=_0x4016d8['user'];return user;}else{logger[_0xf009('0x2c')]('The\x20failing\x20result\x20is',JSON[_0xf009('0xd')](_0x4016d8));throw new Error(_0xf009('0x3e')+JSON['stringify'](_0x4016d8));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x4016d8));throw new Error(_0xf009('0x3e')+JSON[_0xf009('0xd')](_0x4016d8));}})['catch'](function(_0x556a11){console['error'](_0x556a11);});}function getZohoUser(_0x3e94f8,_0x216585){return new BPromise(function(_0x2dc422,_0x31ab78){request(_0x3e94f8)[_0xf009('0x34')](function(_0x3ef979){var _0xf9f2e6=null;if(_0x3ef979){_0xf9f2e6=_0x3ef979[_0xf009('0x3f')][0x0];_0xf9f2e6[_0xf009('0x40')]=_0x216585;}_0x2dc422(_0xf9f2e6);})['catch'](function(_0x5ad298){_0x31ab78(_0x5ad298);});});}function createEndUser(_0x5adaf5,_0x575e1b,_0x202fd8,_0x3e0fcc,_0x4ffff2,_0x1b1fdc){var _0x202fd8=getName(_0x202fd8);return request({'method':_0xf009('0x24'),'uri':_0xf009('0x41')+_0x575e1b+'/crm/v2/'+_['startCase'](_0x1b1fdc[_0xf009('0x42')])+'s','body':{'data':[{'Last_Name':_0x202fd8[0x1],'First_Name':_0x202fd8[0x0],'Phone':_0x3e0fcc,'Owner':{'name':!_[_0xf009('0x1c')](_0x4ffff2[_0xf009('0x43')][_0xf009('0x18')])?_0x4ffff2[_0xf009('0x43')][_0xf009('0x18')]:!_[_0xf009('0x1c')](_0x4ffff2[_0xf009('0x44')])?_0x4ffff2[_0xf009('0x44')]+'\x20'+_0x4ffff2[_0xf009('0x45')]:_0x4ffff2['last_name'],'id':_0x4ffff2['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x5adaf5},'json':!![]})['then'](function(_0x521582){if(_0x521582&&_0x521582[_0xf009('0x3f')][0x0][_0xf009('0x46')]===_0xf009('0x47')){var _0x1fca77=_0x521582[_0xf009('0x3f')][0x0][_0xf009('0x48')];_0x1fca77[_0xf009('0x40')]=_[_0xf009('0x49')](_0x1b1fdc['moduleCreate'])+'s';return _0x1fca77;}logger['error']('The\x20failing\x20result\x20is',JSON[_0xf009('0xd')](data));throw new Error(_0xf009('0x4a')+JSON['stringify'](data));})[_0xf009('0x4b')](function(_0x2c5b58){console['log']('CREATE\x20ERROR',_0x2c5b58);});}function getEndUser(_0x2f622e,_0x29ae9f,_0xf381c5,_0xff8321,_0xb69254,_0x28048a,_0x4478e3){var _0xdddd36={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2f622e},'json':!![]};switch(_0x4478e3['moduleSearch']){case _0xf009('0x4c'):_0xdddd36['uri']=_0xf009('0x41')+_0x29ae9f+_0xf009('0x4d')+_0xb69254+'))';return getZohoUser(_0xdddd36,_0xf009('0x4e'))['then'](function(_0x4fa35f){if(_0x4fa35f)return _0x4fa35f;_0xdddd36[_0xf009('0x4f')]=_0xf009('0x41')+_0x29ae9f+_0xf009('0x50')+_0xb69254+'))';return getZohoUser(_0xdddd36,'Leads')['then'](function(_0x1f4c80){if(_0x1f4c80)return _0x1f4c80;if(_0x4478e3[_0xf009('0x42')]!=_0xf009('0x51')){return createEndUser(_0x2f622e,_0x29ae9f,_0xff8321,_0xb69254,_0x28048a,_0x4478e3);}else{return{};}});});break;case _0xf009('0x52'):_0xdddd36[_0xf009('0x4f')]=_0xf009('0x41')+_0x29ae9f+_0xf009('0x4d')+_0xb69254+'))';return getZohoUser(_0xdddd36,_0xf009('0x4e'))[_0xf009('0x34')](function(_0x24341a){if(_0x24341a)return _0x24341a;if(_0x4478e3[_0xf009('0x42')]!='nothing'){return createEndUser(_0x2f622e,_0x29ae9f,_0xff8321,_0xb69254,_0x28048a,_0x4478e3);}else{return{};}});break;case _0xf009('0x53'):_0xdddd36[_0xf009('0x4f')]='https://www.zohoapis.'+_0x29ae9f+_0xf009('0x50')+_0xb69254+'))';return getZohoUser(_0xdddd36,_0xf009('0x54'))[_0xf009('0x34')](function(_0x55c039){if(_0x55c039)return _0x55c039;if(_0x4478e3[_0xf009('0x42')]!=_0xf009('0x51')){return createEndUser(_0x2f622e,_0x29ae9f,_0xff8321,_0xb69254,_0x28048a,_0x4478e3);}else{return{};}});break;}}function getCall(_0x11c840,_0x11d694,_0x414f44,_0x290336,_0x203892,_0x448e73,_0x4315c6,_0x1f73be){logger[_0xf009('0x2e')]('Creating\x20new\x20call...');var _0x9191b3={};_0x9191b3[_0xf009('0x55')]={'name':!_['isNil'](_0x290336[_0xf009('0x43')][_0xf009('0x18')])&&!_['isNil'](_0x290336[_0xf009('0x3d')]['name'])&&_0x290336[_0xf009('0x3d')][_0xf009('0x18')]===_0xf009('0x56')?_0x290336['role'][_0xf009('0x18')]:!_[_0xf009('0x1c')](_0x290336[_0xf009('0x44')])?_0x290336['first_name']+'\x20'+_0x290336[_0xf009('0x45')]:_0x290336[_0xf009('0x45')],'id':_0x290336['id']};_0x9191b3[_0xf009('0x57')]=intUtil[_0xf009('0x58')](_0x448e73[_0xf009('0x59')],_0x4315c6,'\x20');_0x9191b3[_0xf009('0x5a')]=intUtil[_0xf009('0x58')](_0x448e73[_0xf009('0x5b')],_0x4315c6,'\x0a');if(_0x203892['enduserType']==='Contacts'){_0x9191b3[_0xf009('0x5c')]={'name':!_[_0xf009('0x1c')](_0x203892[_0xf009('0x5d')])?_0x203892[_0xf009('0x5d')]:!_['isNil'](_0x203892[_0xf009('0x5e')])?_0x203892[_0xf009('0x5e')]+'\x20'+_0x203892['Last_Name']:_0x203892[_0xf009('0x5f')],'id':_0x203892['id']};}if(_0x203892[_0xf009('0x40')]==='Leads'){_0x9191b3[_0xf009('0x60')]={'name':!_[_0xf009('0x1c')](_0x203892['Full_Name'])?_0x203892[_0xf009('0x5d')]:!_[_0xf009('0x1c')](_0x203892['First_Name'])?_0x203892[_0xf009('0x5e')]+'\x20'+_0x203892[_0xf009('0x5f')]:_0x203892[_0xf009('0x5f')],'id':_0x203892['id']};_0x9191b3[_0xf009('0x61')]=_[_0xf009('0x49')](_0x203892[_0xf009('0x40')]);}if(_0x4315c6[_0xf009('0x62')]){_0x9191b3['Call_Duration']=moment[_0xf009('0x63')](parseInt(_0x4315c6[_0xf009('0x62')])*0x3e8)[_0xf009('0x30')](_0xf009('0x64'));}else if(_0x4315c6['answertime']&&_0x4315c6[_0xf009('0x65')]){_0x9191b3[_0xf009('0x66')]=moment[_0xf009('0x63')](moment(_0x4315c6[_0xf009('0x65')],_0xf009('0x67'))['diff'](moment(_0x4315c6['starttime'],_0xf009('0x67'))))[_0xf009('0x30')]('mm:ss');}switch(_0x4315c6[_0xf009('0x68')]){case _0xf009('0x69'):_0x9191b3[_0xf009('0x6a')]=_0xf009('0x6b');break;case _0xf009('0x6c'):case _0xf009('0x6d'):_0x9191b3['Call_Result']=_0xf009('0x6e');break;case'rejected':_0x9191b3[_0xf009('0x6a')]='Rejected';break;case _0xf009('0x6f'):_0x9191b3['Call_Result']=_0xf009('0x70');break;case _0xf009('0x71'):_0x9191b3[_0xf009('0x6a')]=_0xf009('0x72');default:}_0x9191b3[_0xf009('0x73')]=(_0x1f73be==='outbound'?moment(_0x4315c6[_0xf009('0x74')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x4315c6[_0xf009('0x75')])[_0xf009('0x30')](_0xf009('0x67')))||moment()[_0xf009('0x30')](_0xf009('0x67'));_0x9191b3[_0xf009('0x76')]=_0x1f73be||_0xf009('0x77');_0x9191b3=_[_0xf009('0x78')](_0x9191b3,getCustomFields(_0x448e73[_0xf009('0x79')],_0x4315c6));return request({'method':_0xf009('0x24'),'uri':_0xf009('0x41')+_0x11d694+'/crm/v2/Calls','headers':{'Authorization':_0xf009('0x33')+_0x11c840},'body':{'data':[_0x9191b3]},'json':!![]})[_0xf009('0x34')](function(_0x18c382){if(_0x18c382&&_0x18c382[_0xf009('0x3f')][0x0][_0xf009('0x46')]===_0xf009('0x47')){logger['info']('Call\x20created!');return{'id':_0x18c382[_0xf009('0x3f')][0x0][_0xf009('0x48')]['id']};}})[_0xf009('0x4b')](function(_0x389301){logger['info'](_0xf009('0x7a'),_0x389301[_0xf009('0x7b')]);console[_0xf009('0x7c')]('err',_0x389301);});}exports[_0xf009('0x7d')]=function(_0x2d652a,_0x25f68b,_0x5b4299,_0x3e2c86,_0x535f4e,_0x230b2c){var _0x1cb1f9,_0x5c7425,_0x28c86e;_0x230b2c[_0xf009('0x7e')]=intUtil[_0xf009('0x7f')](_0x230b2c[_0xf009('0x7e')]);_0x230b2c['serverUrl']=intUtil[_0xf009('0x7f')](_0x230b2c[_0xf009('0x80')]);if(_0x535f4e&&_0x535f4e[_0xf009('0x81')]){logger[_0xf009('0x2e')]('[QUEUE]',_0xf009('0x82'));_0x25f68b[_0xf009('0x83')]=_0x230b2c[_0xf009('0x80')]+_0xf009('0x84')+_0x25f68b[_0xf009('0x85')]+_0xf009('0x86')+md5(_0x25f68b[_0xf009('0x85')]);}else{_0x25f68b[_0xf009('0x83')]='';}var _0x757c05=_0x230b2c['host']===_0xf009('0x87')?'eu':_0xf009('0x88');return getAccessToken(_0x230b2c)[_0xf009('0x34')](function(_0x97f8ba){_0x28c86e=_0x97f8ba;return getUser(_0x28c86e,_0x757c05,_0x230b2c,_0x3e2c86[_0xf009('0x38')]);})[_0xf009('0x34')](function(_0x292b56){_0x1cb1f9=_0x292b56;logger[_0xf009('0x2e')]('The\x20User\x20ID\x20is:',_0x1cb1f9['id']);return getEndUser(_0x28c86e,_0x757c05,_0x230b2c,_0x25f68b['calleridname'],_0x25f68b[_0xf009('0x89')],_0x1cb1f9,_0x5b4299);})['then'](function(_0x5a4023){_0x5c7425=_0x5a4023;return getCall(_0x28c86e,_0x757c05,_0x230b2c,_0x1cb1f9,_0x5c7425,_0x5b4299,_0x25f68b,_0xf009('0x77'));})[_0xf009('0x34')](function(_0x4b8c73){if(_0x4b8c73){logger[_0xf009('0x2e')](_0xf009('0x8a'),_0x4b8c73['id']);logger[_0xf009('0x2e')](_0xf009('0x8b'),_0xf009('0x8c'));emit(util[_0xf009('0x30')]('user:%s',_0x3e2c86[_0xf009('0x18')]),_0xf009('0x8d'),{'uri':_0xf009('0x8e')+_0x230b2c[_0xf009('0x7e')]+_0xf009('0x8f')+_0x4b8c73['id']});}})[_0xf009('0x4b')](function(_0x1e9e0b){logger[_0xf009('0x2c')](_0xf009('0x8b'),JSON['stringify'](_0x1e9e0b));});};exports[_0xf009('0x90')]=function(_0x24eeeb,_0x453400,_0x47cf10,_0xe3c22a,_0x391f6b,_0x2d238a,_0x4ed280){var _0x5bd4c0,_0x2b2928,_0x16fdbd;_0x2d238a[_0xf009('0x7e')]=intUtil['stripTrailingSlash'](_0x2d238a[_0xf009('0x7e')]);_0x2d238a['serverUrl']=intUtil[_0xf009('0x7f')](_0x2d238a['serverUrl']);if(_0x4ed280&&_0x4ed280[_0xf009('0x91')]&&_0x4ed280[_0xf009('0x91')]!==_0xf009('0x92')){logger[_0xf009('0x2e')](_0xf009('0x93'),_0xf009('0x82'));_0x453400[_0xf009('0x83')]=_0x2d238a[_0xf009('0x80')]+_0xf009('0x84')+_0x453400['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x453400[_0xf009('0x85')]);}var _0x22c945=_0x2d238a[_0xf009('0x7e')]==='zoho.eu'?'eu':_0xf009('0x88');return getAccessToken(_0x2d238a)[_0xf009('0x34')](function(_0x18afea){_0x16fdbd=_0x18afea;return getUser(_0x16fdbd,_0x22c945,_0x2d238a,_0xe3c22a['email']);})['then'](function(_0x2e8ba6){_0x5bd4c0=_0x2e8ba6;logger[_0xf009('0x2e')](_0xf009('0x94'),_0x5bd4c0['id']);return getEndUser(_0x16fdbd,_0x22c945,_0x2d238a,_0x453400['destcalleridname'],_0x453400[_0xf009('0x95')],_0x5bd4c0,_0x47cf10);})[_0xf009('0x34')](function(_0x27c307){_0x2b2928=_0x27c307;return getCall(_0x16fdbd,_0x22c945,_0x2d238a,_0x5bd4c0,_0x2b2928,_0x47cf10,_0x453400,_0xf009('0x96'));})[_0xf009('0x34')](function(_0x4565db){if(_0x4565db){logger[_0xf009('0x2e')](_0xf009('0x8a'),_0x4565db['id']);logger[_0xf009('0x2e')](_0xf009('0x93'),_0xf009('0x8c'));emit(util[_0xf009('0x30')](_0xf009('0x97'),_0xe3c22a[_0xf009('0x18')]),'trigger:browser:url',{'uri':_0xf009('0x8e')+_0x2d238a[_0xf009('0x7e')]+_0xf009('0x8f')+_0x4565db['id']});}})[_0xf009('0x4b')](function(_0x299b33){logger[_0xf009('0x2c')](_0xf009('0x93'),JSON[_0xf009('0xd')](_0x299b33));});};exports['unmanaged']=function(_0x46d08d,_0x43a708,_0x326c09,_0x2ff987,_0x9b9302,_0x9919fe){var _0x15bb45,_0x4bf502,_0x27201f;_0x9919fe['host']=intUtil[_0xf009('0x7f')](_0x9919fe[_0xf009('0x7e')]);_0x9919fe[_0xf009('0x80')]=intUtil['stripTrailingSlash'](_0x9919fe['serverUrl']);if(_0x9b9302&&_0x9b9302[_0xf009('0x81')]){logger[_0xf009('0x2e')]('['+_0x43a708[_0xf009('0x68')]['toUpperCase']()+']',_0xf009('0x82'));_0x43a708[_0xf009('0x83')]=_0x9919fe[_0xf009('0x80')]+_0xf009('0x84')+_0x43a708[_0xf009('0x85')]+_0xf009('0x86')+md5(_0x43a708['uniqueid']);}else{_0x43a708[_0xf009('0x83')]='';}var _0x164853=_0x9919fe[_0xf009('0x7e')]===_0xf009('0x87')?'eu':_0xf009('0x88');return getAccessToken(_0x9919fe)[_0xf009('0x34')](function(_0x478223){_0x27201f=_0x478223;return getUser(_0x27201f,_0x164853,_0x9919fe);})[_0xf009('0x34')](function(_0x320d85){_0x15bb45=_0x320d85;logger[_0xf009('0x2e')](_0xf009('0x94'),_0x15bb45['id']);return getEndUser(_0x27201f,_0x164853,_0x9919fe,_0x43a708[_0xf009('0x98')],_0x43a708[_0xf009('0x89')],_0x15bb45,_0x326c09);})[_0xf009('0x34')](function(_0x2d578e){_0x4bf502=_0x2d578e;return getCall(_0x27201f,_0x164853,_0x9919fe,_0x15bb45,_0x4bf502,_0x326c09,_0x43a708,_0xf009('0x77'));})[_0xf009('0x34')](function(_0x1ffbd1){if(_0x1ffbd1){logger[_0xf009('0x2e')](_0xf009('0x8a'),_0x1ffbd1['id']);}})[_0xf009('0x4b')](function(_0x20b1e0){logger['error']('['+_0x43a708['lastevent'][_0xf009('0x99')]()+']',JSON[_0xf009('0xd')](_0x20b1e0));});}; \ 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 05a1939..729bd2b 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 _0x3691=['exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','../../../../config/logger','trigger'];(function(_0x3a642f,_0x3ae0d8){var _0x2163a2=function(_0xbda17d){while(--_0xbda17d){_0x3a642f['push'](_0x3a642f['shift']());}};_0x2163a2(++_0x3ae0d8);}(_0x3691,0x128));var _0x1369=function(_0x1f85e8,_0x5d20b1){_0x1f85e8=_0x1f85e8-0x0;var _0x55201a=_0x3691[_0x1f85e8];return _0x55201a;};'use strict';var util=require(_0x1369('0x0'));var sh=require('shelljs');var Mustache=require('mustache');var logger=require(_0x1369('0x1'))(_0x1369('0x2'));exports[_0x1369('0x3')]=function(_0x9977e0,_0x25e6ea){var _0x210571=_0x9977e0['data2']?_0x9977e0[_0x1369('0x4')]:_0x1369('0x5');var _0x158bbc=_0x9977e0[_0x1369('0x6')]?Mustache[_0x1369('0x7')](_0x9977e0[_0x1369('0x6')],_0x25e6ea):_0x25e6ea;sh[_0x1369('0x3')](_0x158bbc,function(_0x1241eb,_0x42b5a6,_0x1073e7){if(_0x1241eb!==0x0){logger[_0x1369('0x8')](util[_0x1369('0x9')](_0x1369('0xa'),_0x210571,_0x158bbc,_0x1241eb,_0x1073e7));}else{logger[_0x1369('0xb')](util[_0x1369('0x9')](_0x1369('0xc'),_0x210571,_0x158bbc,_0x42b5a6));}});}; \ No newline at end of file +var _0xbac0=['mustache','../../../../config/logger','trigger','data2','Script','data3','render','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util'];(function(_0x18dead,_0x4fc133){var _0x2ceda9=function(_0x1ef4b5){while(--_0x1ef4b5){_0x18dead['push'](_0x18dead['shift']());}};_0x2ceda9(++_0x4fc133);}(_0xbac0,0x117));var _0x0bac=function(_0x512f81,_0x4a7986){_0x512f81=_0x512f81-0x0;var _0xa15099=_0xbac0[_0x512f81];return _0xa15099;};'use strict';var util=require(_0x0bac('0x0'));var sh=require('shelljs');var Mustache=require(_0x0bac('0x1'));var logger=require(_0x0bac('0x2'))(_0x0bac('0x3'));exports['exec']=function(_0x1b5217,_0xd886f8){var _0x35aa1c=_0x1b5217[_0x0bac('0x4')]?_0x1b5217[_0x0bac('0x4')]:_0x0bac('0x5');var _0x251b9c=_0x1b5217[_0x0bac('0x6')]?Mustache[_0x0bac('0x7')](_0x1b5217[_0x0bac('0x6')],_0xd886f8):_0xd886f8;sh[_0x0bac('0x8')](_0x251b9c,function(_0x23cf9e,_0x4e35fb,_0x571001){if(_0x23cf9e!==0x0){logger[_0x0bac('0x9')](util[_0x0bac('0xa')](_0x0bac('0xb'),_0x35aa1c,_0x251b9c,_0x23cf9e,_0x571001));}else{logger[_0x0bac('0xc')](util[_0x0bac('0xa')](_0x0bac('0xd'),_0x35aa1c,_0x251b9c,_0x4e35fb));}});}; \ 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 be5d6ef..46ae3ed 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 _0x001a=['message','request-promise','mustache','exec','data1','toUpperCase','data2','data5','number','headers','data6','parse','render','error','stack','GET','DELETE','POST','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name'];(function(_0x54be74,_0x37c908){var _0x47da47=function(_0x233b4b){while(--_0x233b4b){_0x54be74['push'](_0x54be74['shift']());}};_0x47da47(++_0x37c908);}(_0x001a,0x101));var _0xa001=function(_0x3fe6df,_0x5a04d4){_0x3fe6df=_0x3fe6df-0x0;var _0x372a0e=_0x001a[_0x3fe6df];return _0x372a0e;};'use strict';var rp=require(_0xa001('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0xa001('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0xa001('0x2')]=function(_0x6146c,_0xe94910){var _0x427506,_0x48c2ed;var _0x354815={'method':_0x6146c[_0xa001('0x3')][_0xa001('0x4')](),'uri':Mustache['render'](_0x6146c[_0xa001('0x5')],_0xe94910),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x6146c[_0xa001('0x6')])===_0xa001('0x7')&&parseInt(_0x6146c[_0xa001('0x6')])>=0x1&&parseInt(_0x6146c['data5'])<=0xa?parseInt(_0x6146c[_0xa001('0x6')])*0x3e8:0x5*0x3e8};try{_0x354815[_0xa001('0x8')]=_0x6146c[_0xa001('0x9')]?JSON[_0xa001('0xa')](Mustache[_0xa001('0xb')](_0x6146c[_0xa001('0x9')],_0xe94910)):{};}catch(_0x22436d){logger[_0xa001('0xc')](_0x22436d[_0xa001('0xd')]);}switch(_0x6146c[_0xa001('0x3')][_0xa001('0x4')]()){case _0xa001('0xe'):case _0xa001('0xf'):_0x427506=null;_0x354815['qs']=_0xe94910;break;case _0xa001('0x10'):case'PUT':if(_0x6146c['data7']){try{_0x427506=JSON[_0xa001('0xa')](Mustache['render'](_0x6146c['data7'],_0xe94910));_0x354815[_0xa001('0x11')]=_0x427506;}catch(_0x15b4f0){logger[_0xa001('0xc')](_0x15b4f0['stack']);logger[_0xa001('0xc')](_0xa001('0x12'));}}else{_0x427506=_0xe94910;_0x354815[_0xa001('0x11')]=_0x427506;}break;}logger[_0xa001('0x13')](util[_0xa001('0x14')](_0xa001('0x15'),_0x6146c['data1'],_0x6146c[_0xa001('0x5')],JSON[_0xa001('0x16')](_0x354815)));rp(_0x354815)['then'](function(_0x534908){_0x427506=!_[_0xa001('0x17')](_0x427506)?_0xa001('0x18')+_0x427506:'';_0x48c2ed=typeof _0x534908[_0xa001('0x11')]===_0xa001('0x19')?JSON['stringify'](_0x534908['body']):_0x534908['body'];logger[_0xa001('0x13')](util[_0xa001('0x14')](_0xa001('0x1a'),_0x6146c['data1'],_0x6146c['data2'],_0x534908[_0xa001('0x1b')],_0x48c2ed));})[_0xa001('0x1c')](function(_0xf52f6c){logger[_0xa001('0xc')](util[_0xa001('0x14')](_0xa001('0x1d'),_0x6146c[_0xa001('0x3')],_0x6146c[_0xa001('0x5')],_0xf52f6c[_0xa001('0x1b')],_0xf52f6c[_0xa001('0x1e')],_0xf52f6c[_0xa001('0x1f')]));});}; \ No newline at end of file +var _0xd83f=['DELETE','PUT','data7','render','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','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','message','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data2','data5','number','headers','data6','parse','stack'];(function(_0x1ea374,_0x19637b){var _0x50e524=function(_0x5f181a){while(--_0x5f181a){_0x1ea374['push'](_0x1ea374['shift']());}};_0x50e524(++_0x19637b);}(_0xd83f,0x18a));var _0xfd83=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd83f[_0x2f5ac5];return _0x37c9a8;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0xfd83('0x0'));var Mustache=require(_0xfd83('0x1'));var logger=require(_0xfd83('0x2'))(_0xfd83('0x3'));exports[_0xfd83('0x4')]=function(_0xc567bb,_0x17e60d){var _0x67249,_0x35991a;var _0x50e417={'method':_0xc567bb[_0xfd83('0x5')][_0xfd83('0x6')](),'uri':Mustache['render'](_0xc567bb[_0xfd83('0x7')],_0x17e60d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xc567bb[_0xfd83('0x8')])===_0xfd83('0x9')&&parseInt(_0xc567bb[_0xfd83('0x8')])>=0x1&&parseInt(_0xc567bb[_0xfd83('0x8')])<=0xa?parseInt(_0xc567bb[_0xfd83('0x8')])*0x3e8:0x5*0x3e8};try{_0x50e417[_0xfd83('0xa')]=_0xc567bb[_0xfd83('0xb')]?JSON[_0xfd83('0xc')](Mustache['render'](_0xc567bb[_0xfd83('0xb')],_0x17e60d)):{};}catch(_0x49cefb){logger['error'](_0x49cefb[_0xfd83('0xd')]);}switch(_0xc567bb[_0xfd83('0x5')][_0xfd83('0x6')]()){case'GET':case _0xfd83('0xe'):_0x67249=null;_0x50e417['qs']=_0x17e60d;break;case'POST':case _0xfd83('0xf'):if(_0xc567bb[_0xfd83('0x10')]){try{_0x67249=JSON[_0xfd83('0xc')](Mustache[_0xfd83('0x11')](_0xc567bb[_0xfd83('0x10')],_0x17e60d));_0x50e417[_0xfd83('0x12')]=_0x67249;}catch(_0x1c2d34){logger[_0xfd83('0x13')](_0x1c2d34[_0xfd83('0xd')]);logger[_0xfd83('0x13')](_0xfd83('0x14'));}}else{_0x67249=_0x17e60d;_0x50e417['body']=_0x67249;}break;}logger[_0xfd83('0x15')](util[_0xfd83('0x16')](_0xfd83('0x17'),_0xc567bb[_0xfd83('0x5')],_0xc567bb[_0xfd83('0x7')],JSON[_0xfd83('0x18')](_0x50e417)));rp(_0x50e417)[_0xfd83('0x19')](function(_0x461864){_0x67249=!_[_0xfd83('0x1a')](_0x67249)?_0xfd83('0x1b')+_0x67249:'';_0x35991a=typeof _0x461864[_0xfd83('0x12')]===_0xfd83('0x1c')?JSON[_0xfd83('0x18')](_0x461864[_0xfd83('0x12')]):_0x461864[_0xfd83('0x12')];logger[_0xfd83('0x15')](util[_0xfd83('0x16')](_0xfd83('0x1d'),_0xc567bb[_0xfd83('0x5')],_0xc567bb['data2'],_0x461864[_0xfd83('0x1e')],_0x35991a));})[_0xfd83('0x1f')](function(_0x469d8a){logger['error'](util['format'](_0xfd83('0x20'),_0xc567bb[_0xfd83('0x5')],_0xc567bb[_0xfd83('0x7')],_0x469d8a[_0xfd83('0x1e')],_0x469d8a['name'],_0x469d8a[_0xfd83('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 81fdb02..c1ac19a 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 _0x13f3=['routing','client','request','debug','rpc','error','message','result','exports','jayson/promise','bluebird'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0x13f3,0x111));var _0x313f=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x13f3[_0x1ebc6c];return _0x3a826d;};'use strict';var jayson=require(_0x313f('0x0'));var BPromise=require(_0x313f('0x1'));var logger=require('../../config/logger')(_0x313f('0x2'));var client=jayson[_0x313f('0x3')]['http']({'port':0x2329});client['Request']=function(_0x11b81d,_0xc8503e){return new BPromise(function(_0x3c64b5,_0x2bb34a){return client[_0x313f('0x4')](_0x11b81d,_0xc8503e)['then'](function(_0x48af0d){logger[_0x313f('0x5')](_0x313f('0x6'),'routing',_0x11b81d,_0xc8503e,_0x48af0d);if(_0x48af0d[_0x313f('0x7')]){logger[_0x313f('0x7')]('rpc',_0x313f('0x2'),_0x11b81d,_0x48af0d[_0x313f('0x7')]['message'],_0xc8503e);return _0x2bb34a(_0x48af0d[_0x313f('0x7')][_0x313f('0x8')]);}else{return _0x3c64b5(_0x48af0d[_0x313f('0x9')]);}})['catch'](function(_0x31a8cc){logger[_0x313f('0x7')](_0x313f('0x6'),_0x313f('0x2'),_0x11b81d,_0x31a8cc,_0xc8503e);return _0x2bb34a(_0x31a8cc);});});};module[_0x313f('0xa')]=client; \ No newline at end of file +var _0xd8c9=['bluebird','../../config/logger','routing','client','http','then','debug','rpc','error','message','result','catch','exports','jayson/promise'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd8c9,0xd1));var _0x9d8c=function(_0x37093a,_0x349583){_0x37093a=_0x37093a-0x0;var _0x222392=_0xd8c9[_0x37093a];return _0x222392;};'use strict';var jayson=require(_0x9d8c('0x0'));var BPromise=require(_0x9d8c('0x1'));var logger=require(_0x9d8c('0x2'))(_0x9d8c('0x3'));var client=jayson[_0x9d8c('0x4')][_0x9d8c('0x5')]({'port':0x2329});client['Request']=function(_0x233f9e,_0x212916){return new BPromise(function(_0x4f831f,_0x2bbf4a){return client['request'](_0x233f9e,_0x212916)[_0x9d8c('0x6')](function(_0x5e6552){logger[_0x9d8c('0x7')](_0x9d8c('0x8'),_0x9d8c('0x3'),_0x233f9e,_0x212916,_0x5e6552);if(_0x5e6552[_0x9d8c('0x9')]){logger[_0x9d8c('0x9')](_0x9d8c('0x8'),_0x9d8c('0x3'),_0x233f9e,_0x5e6552[_0x9d8c('0x9')][_0x9d8c('0xa')],_0x212916);return _0x2bbf4a(_0x5e6552[_0x9d8c('0x9')]['message']);}else{return _0x4f831f(_0x5e6552[_0x9d8c('0xb')]);}})[_0x9d8c('0xc')](function(_0x1e1123){logger[_0x9d8c('0x9')](_0x9d8c('0x8'),_0x9d8c('0x3'),_0x233f9e,_0x1e1123,_0x212916);return _0x2bbf4a(_0x1e1123);});});};module[_0x9d8c('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 56965ac..d671040 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 _0xdb42=['./server','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','getMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','error'];(function(_0x4c0bfb,_0x34f5fa){var _0x2a8a18=function(_0x5dd0ce){while(--_0x5dd0ce){_0x4c0bfb['push'](_0x4c0bfb['shift']());}};_0x2a8a18(++_0x34f5fa);}(_0xdb42,0x195));var _0x2db4=function(_0xff32a0,_0x5c2abd){_0xff32a0=_0xff32a0-0x0;var _0x28e253=_0xdb42[_0xff32a0];return _0x28e253;};'use strict';var server=require(_0x2db4('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x2db4('0x1'));var mailAccount=require(_0x2db4('0x2'));var setting=require(_0x2db4('0x3'));var logger=require(_0x2db4('0x4'))(_0x2db4('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x2db4('0x6')](mailAccount[_0x2db4('0x7')]())['then'](realtime['initMailAccounts']())[_0x2db4('0x6')](function(){email[_0x2db4('0x8')](realtime[_0x2db4('0x9')]);return realtime;});}function main(){return server[_0x2db4('0xa')](realtime,email)[_0x2db4('0x6')](function(){return initRealtime();})[_0x2db4('0x6')](function(){return setting[_0x2db4('0xb')]();})[_0x2db4('0x6')](function(_0x276e2f){return setInterval(initRealtime,_0x276e2f[_0x2db4('0xc')]*0x3e8);})[_0x2db4('0xd')](function(_0x45eb50){logger[_0x2db4('0xe')]('Email\x20service\x20initialization',_0x45eb50);});}main(); \ No newline at end of file +var _0xd69d=['./server','./realtime','./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','catch'];(function(_0x3780bd,_0x81b109){var _0x2a7b7f=function(_0x5a221f){while(--_0x5a221f){_0x3780bd['push'](_0x3780bd['shift']());}};_0x2a7b7f(++_0x81b109);}(_0xd69d,0x138));var _0xdd69=function(_0x3e2795,_0x44b785){_0x3e2795=_0x3e2795-0x0;var _0x186533=_0xd69d[_0x3e2795];return _0x186533;};'use strict';var server=require(_0xdd69('0x0'));var Realtime=require(_0xdd69('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var setting=require(_0xdd69('0x2'));var logger=require(_0xdd69('0x3'))(_0xdd69('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0xdd69('0x5')](mailAccount[_0xdd69('0x6')]())[_0xdd69('0x5')](realtime[_0xdd69('0x7')]())[_0xdd69('0x5')](function(){email[_0xdd69('0x8')](realtime[_0xdd69('0x9')]);return realtime;});}function main(){return server[_0xdd69('0xa')](realtime,email)['then'](function(){return initRealtime();})[_0xdd69('0x5')](function(){return setting['getSettings']();})['then'](function(_0xd9bdee){return setInterval(initRealtime,_0xd9bdee['loginMailFrequency']*0x3e8);})[_0xdd69('0xb')](function(_0x2b5fdb){logger['error']('Email\x20service\x20initialization',_0x2b5fdb);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index e136aaa..aa418bb 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 _0x6ca0=['moment','bluebird','ioredis','../../../config/logger','email','defaults','redis','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','emit','active','Imap','status','total','isNil','md5','mailAccount:update','prototype','refresh','service','provider','imapAccounts','box','bind','handleImapEmail','handleImapError','disabled','handleImapBox','name','messages','lastName','from','notify','then','info','Mail\x20accepted\x20from\x20routing','error','handleImapEnd','messageStatus','send','Smtp','lastSync','verify','verified','catch','exports','lodash'];(function(_0x3a5595,_0x267381){var _0x3cac19=function(_0x50953f){while(--_0x50953f){_0x3a5595['push'](_0x3a5595['shift']());}};_0x3cac19(++_0x267381);}(_0x6ca0,0x67));var _0x06ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x06ca('0x0'));var moment=require(_0x06ca('0x1'));var BPromise=require(_0x06ca('0x2'));var md5=require('md5');var Redis=require(_0x06ca('0x3'));var config=require('../../../config/environment');var logger=require(_0x06ca('0x4'))(_0x06ca('0x5'));config['redis']=_[_0x06ca('0x6')](config[_0x06ca('0x7')],{'host':_0x06ca('0x8'),'port':0x18eb});var io=require(_0x06ca('0x9'))(new Redis(config[_0x06ca('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x06ca('0xa'));var mailAccount=require(_0x06ca('0xb'));var md5Accounts={};function EmailChannel(_0x5034c0){logger['info'](_0x06ca('0xc'));this[_0x06ca('0xd')]=_0x5034c0[_0x06ca('0xd')];this['imapAccounts']={};this[_0x06ca('0xe')]=new EmailSmtp();}EmailChannel['prototype'][_0x06ca('0xf')]=function(_0x5d1354){var _0x5ce498=this[_0x06ca('0xd')][_0x5d1354];var _0x5c7f83={'id':_0x5ce498['id'],'name':_0x5ce498['name'],'key':_0x5ce498['key'],'active':_0x5ce498[_0x06ca('0x10')],'Imap':{'status':_0x5ce498[_0x06ca('0x11')][_0x06ca('0x12')],'messageStatus':_0x5ce498[_0x06ca('0x11')]['messageStatus'],'total':_0x5ce498[_0x06ca('0x11')][_0x06ca('0x13')]}};if(_[_0x06ca('0x14')](md5Accounts[_0x5d1354])){md5Accounts[_0x5d1354]={};}var _0x265691=md5(JSON['stringify'](_0x5c7f83));if(md5Accounts[_0x5d1354][_0x06ca('0x15')]!==_0x265691){md5Accounts[_0x5d1354]['md5']=_0x265691;io[_0x06ca('0xf')](_0x06ca('0x16'),_0x5c7f83);}};EmailChannel[_0x06ca('0x17')][_0x06ca('0x18')]=function(_0x3401d5){for(var _0xb75a7c in _0x3401d5){if(_0x3401d5['hasOwnProperty'](_0xb75a7c)){if(_0x3401d5[_0xb75a7c]['Imap']&&_0x3401d5[_0xb75a7c][_0x06ca('0x10')]){var _0x3571c8=_0x3401d5[_0xb75a7c][_0x06ca('0x11')];if(!_0x3571c8[_0x06ca('0x19')]&&_0x3401d5[_0xb75a7c]['provider']!=='custom')_0x3571c8[_0x06ca('0x19')]=_0x3401d5[_0xb75a7c][_0x06ca('0x1a')];if(!this[_0x06ca('0x1b')]['hasOwnProperty'](_0x3571c8['id'])){this[_0x06ca('0x1b')][_0x3571c8['id']]=new EmailImap(_0x3571c8,_0x3401d5[_0xb75a7c][_0x06ca('0x5')]);this[_0x06ca('0x1b')][_0x3571c8['id']]['on'](_0x06ca('0x1c'),this['handleImapBox'][_0x06ca('0x1d')](this,_0xb75a7c));this[_0x06ca('0x1b')][_0x3571c8['id']]['on'](_0x06ca('0x5'),this[_0x06ca('0x1e')][_0x06ca('0x1d')](this,_0xb75a7c));this[_0x06ca('0x1b')][_0x3571c8['id']]['on']('end',this['handleImapEnd'][_0x06ca('0x1d')](this,_0xb75a7c));this[_0x06ca('0x1b')][_0x3571c8['id']]['on']('error',this[_0x06ca('0x1f')][_0x06ca('0x1d')](this,_0xb75a7c));}}else{if(_['isNil'](this['mailAccounts'][_0xb75a7c][_0x06ca('0x11')])){this[_0x06ca('0xd')][_0xb75a7c][_0x06ca('0x11')]={};}this[_0x06ca('0xd')][_0xb75a7c][_0x06ca('0x11')][_0x06ca('0x12')]=_0x06ca('0x20');this[_0x06ca('0xd')][_0xb75a7c][_0x06ca('0x11')]['messageStatus']='';this['emit'](_0xb75a7c);}}}};EmailChannel[_0x06ca('0x17')][_0x06ca('0x21')]=function(_0x500193,_0x237583){if(this[_0x06ca('0xd')][_0x500193]){this[_0x06ca('0xd')][_0x500193][_0x06ca('0x11')][_0x06ca('0x12')]='connected';this[_0x06ca('0xd')][_0x500193]['Imap']['messageStatus']=_0x237583[_0x06ca('0x22')];if(_0x237583[_0x06ca('0x23')]){this[_0x06ca('0xd')][_0x500193][_0x06ca('0x11')][_0x06ca('0x13')]=_0x237583['messages'][_0x06ca('0x13')];}return this[_0x06ca('0xf')](_0x500193);}};EmailChannel[_0x06ca('0x17')]['handleImapEmail']=function(_0x436d19,_0x3b09fc){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x3b09fc['firstName'],_0x3b09fc[_0x06ca('0x24')],_0x3b09fc[_0x06ca('0x25')],_0x436d19);if(this[_0x06ca('0xd')][_0x436d19]){return mailAccount[_0x06ca('0x26')](_0x436d19,_0x3b09fc)[_0x06ca('0x27')](function(_0x32b56c){if(_0x32b56c){logger[_0x06ca('0x28')](_0x06ca('0x29'));}})['catch'](function(_0x45e01e){logger[_0x06ca('0x2a')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x45e01e));});}};EmailChannel[_0x06ca('0x17')][_0x06ca('0x2b')]=function(_0x55885e){if(this[_0x06ca('0xd')][_0x55885e]&&this[_0x06ca('0xd')][_0x55885e][_0x06ca('0x11')]){if(this[_0x06ca('0x1b')][this[_0x06ca('0xd')][_0x55885e][_0x06ca('0x11')]['id']]){delete this[_0x06ca('0x1b')][this[_0x06ca('0xd')][_0x55885e][_0x06ca('0x11')]['id']];}this[_0x06ca('0xd')][_0x55885e]['Imap']['lastSync']=moment();this[_0x06ca('0xf')](_0x55885e);}};EmailChannel[_0x06ca('0x17')][_0x06ca('0x1f')]=function(_0x585858,_0x2fc20e){if(this[_0x06ca('0xd')][_0x585858]){this[_0x06ca('0xd')][_0x585858][_0x06ca('0x11')][_0x06ca('0x12')]='error';this[_0x06ca('0xd')][_0x585858][_0x06ca('0x11')][_0x06ca('0x2c')]=_0x2fc20e;return this['emit'](_0x585858);}};EmailChannel[_0x06ca('0x17')]['sendMail']=function(_0x12f5a5,_0x186e04){return this[_0x06ca('0xe')][_0x06ca('0x2d')](_0x12f5a5,_0x186e04);};EmailChannel['prototype']['verifySmtp']=function(_0xe4d359){var _0x455735=this;if(this[_0x06ca('0xd')][_0xe4d359['id']]){if(_[_0x06ca('0x14')](this[_0x06ca('0xd')][_0xe4d359['id']][_0x06ca('0x2e')])){this[_0x06ca('0xd')][_0xe4d359['id']]['Smtp']={};}this['mailAccounts'][_0xe4d359['id']]['Smtp'][_0x06ca('0x2f')]=moment();return new BPromise(function(_0x4795fd,_0x280f70){return _0x455735[_0x06ca('0xe')][_0x06ca('0x30')](_0xe4d359)[_0x06ca('0x27')](function(_0x57125b){_0x455735[_0x06ca('0xd')][_0xe4d359['id']][_0x06ca('0x2e')][_0x06ca('0x12')]=_0x06ca('0x31');_0x455735['mailAccounts'][_0xe4d359['id']][_0x06ca('0x2e')][_0x06ca('0x2c')]='';_0x455735[_0x06ca('0xf')](_0xe4d359['id']);_0x4795fd(_0x57125b);})[_0x06ca('0x32')](function(_0x267a15){_0x455735[_0x06ca('0xd')][_0xe4d359['id']][_0x06ca('0x2e')][_0x06ca('0x12')]=_0x06ca('0x2a');_0x455735['mailAccounts'][_0xe4d359['id']]['Smtp'][_0x06ca('0x2c')]=_0x267a15;_0x455735[_0x06ca('0xf')](_0xe4d359['id']);_0x280f70(_0x267a15);});});}return this[_0x06ca('0xe')][_0x06ca('0x30')](_0xe4d359);};module[_0x06ca('0x33')]=EmailChannel; \ No newline at end of file +var _0x58a1=['imapAccounts','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','sendMail','send','verifySmtp','Smtp','lastSync','smtp','verified','verify','exports','lodash','moment','md5','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','emit','key','active','Imap','status','messageStatus','total','isNil','mailAccount:update','prototype','hasOwnProperty','service','custom','provider'];(function(_0x1a5912,_0x51416f){var _0x18b978=function(_0xfad6d9){while(--_0xfad6d9){_0x1a5912['push'](_0x1a5912['shift']());}};_0x18b978(++_0x51416f);}(_0x58a1,0x1bb));var _0x158a=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x58a1[_0x48326a];return _0x466709;};'use strict';var _=require(_0x158a('0x0'));var moment=require(_0x158a('0x1'));var BPromise=require('bluebird');var md5=require(_0x158a('0x2'));var Redis=require(_0x158a('0x3'));var config=require('../../../config/environment');var logger=require(_0x158a('0x4'))(_0x158a('0x5'));config[_0x158a('0x6')]=_[_0x158a('0x7')](config[_0x158a('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x158a('0x8'))(new Redis(config[_0x158a('0x6')]));var EmailImap=require(_0x158a('0x9'));var EmailSmtp=require(_0x158a('0xa'));var mailAccount=require(_0x158a('0xb'));var md5Accounts={};function EmailChannel(_0x14b8f7){logger[_0x158a('0xc')](_0x158a('0xd'));this['mailAccounts']=_0x14b8f7[_0x158a('0xe')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x158a('0xf')]=function(_0x5c1551){var _0x28383c=this[_0x158a('0xe')][_0x5c1551];var _0x331f91={'id':_0x28383c['id'],'name':_0x28383c['name'],'key':_0x28383c[_0x158a('0x10')],'active':_0x28383c[_0x158a('0x11')],'Imap':{'status':_0x28383c[_0x158a('0x12')][_0x158a('0x13')],'messageStatus':_0x28383c[_0x158a('0x12')][_0x158a('0x14')],'total':_0x28383c[_0x158a('0x12')][_0x158a('0x15')]}};if(_[_0x158a('0x16')](md5Accounts[_0x5c1551])){md5Accounts[_0x5c1551]={};}var _0x449ca3=md5(JSON['stringify'](_0x331f91));if(md5Accounts[_0x5c1551][_0x158a('0x2')]!==_0x449ca3){md5Accounts[_0x5c1551][_0x158a('0x2')]=_0x449ca3;io[_0x158a('0xf')](_0x158a('0x17'),_0x331f91);}};EmailChannel[_0x158a('0x18')]['refresh']=function(_0x2ca8e2){for(var _0x31ee99 in _0x2ca8e2){if(_0x2ca8e2[_0x158a('0x19')](_0x31ee99)){if(_0x2ca8e2[_0x31ee99][_0x158a('0x12')]&&_0x2ca8e2[_0x31ee99][_0x158a('0x11')]){var _0x423da0=_0x2ca8e2[_0x31ee99][_0x158a('0x12')];if(!_0x423da0[_0x158a('0x1a')]&&_0x2ca8e2[_0x31ee99]['provider']!==_0x158a('0x1b'))_0x423da0[_0x158a('0x1a')]=_0x2ca8e2[_0x31ee99][_0x158a('0x1c')];if(!this['imapAccounts'][_0x158a('0x19')](_0x423da0['id'])){this[_0x158a('0x1d')][_0x423da0['id']]=new EmailImap(_0x423da0,_0x2ca8e2[_0x31ee99]['email']);this[_0x158a('0x1d')][_0x423da0['id']]['on'](_0x158a('0x1e'),this[_0x158a('0x1f')][_0x158a('0x20')](this,_0x31ee99));this[_0x158a('0x1d')][_0x423da0['id']]['on']('email',this[_0x158a('0x21')][_0x158a('0x20')](this,_0x31ee99));this[_0x158a('0x1d')][_0x423da0['id']]['on']('end',this[_0x158a('0x22')][_0x158a('0x20')](this,_0x31ee99));this[_0x158a('0x1d')][_0x423da0['id']]['on'](_0x158a('0x23'),this[_0x158a('0x24')][_0x158a('0x20')](this,_0x31ee99));}}else{if(_[_0x158a('0x16')](this['mailAccounts'][_0x31ee99][_0x158a('0x12')])){this[_0x158a('0xe')][_0x31ee99][_0x158a('0x12')]={};}this['mailAccounts'][_0x31ee99][_0x158a('0x12')][_0x158a('0x13')]=_0x158a('0x25');this[_0x158a('0xe')][_0x31ee99][_0x158a('0x12')][_0x158a('0x14')]='';this[_0x158a('0xf')](_0x31ee99);}}}};EmailChannel['prototype'][_0x158a('0x1f')]=function(_0x569f0d,_0x44cce1){if(this[_0x158a('0xe')][_0x569f0d]){this['mailAccounts'][_0x569f0d][_0x158a('0x12')]['status']=_0x158a('0x26');this[_0x158a('0xe')][_0x569f0d][_0x158a('0x12')]['messageStatus']=_0x44cce1[_0x158a('0x27')];if(_0x44cce1[_0x158a('0x28')]){this[_0x158a('0xe')][_0x569f0d][_0x158a('0x12')][_0x158a('0x15')]=_0x44cce1[_0x158a('0x28')]['total'];}return this[_0x158a('0xf')](_0x569f0d);}};EmailChannel[_0x158a('0x18')][_0x158a('0x21')]=function(_0x3cb742,_0x3cd137){logger['info'](_0x158a('0x29'),_0x3cd137[_0x158a('0x2a')],_0x3cd137[_0x158a('0x2b')],_0x3cd137[_0x158a('0x2c')],_0x3cb742);if(this['mailAccounts'][_0x3cb742]){return mailAccount['notify'](_0x3cb742,_0x3cd137)[_0x158a('0x2d')](function(_0x20d9f7){if(_0x20d9f7){logger[_0x158a('0xc')](_0x158a('0x2e'));}})[_0x158a('0x2f')](function(_0x48eecc){logger[_0x158a('0x23')](_0x158a('0x30'),JSON[_0x158a('0x31')](_0x48eecc));});}};EmailChannel['prototype']['handleImapEnd']=function(_0xb0674b){if(this[_0x158a('0xe')][_0xb0674b]&&this[_0x158a('0xe')][_0xb0674b][_0x158a('0x12')]){if(this[_0x158a('0x1d')][this[_0x158a('0xe')][_0xb0674b]['Imap']['id']]){delete this[_0x158a('0x1d')][this['mailAccounts'][_0xb0674b]['Imap']['id']];}this[_0x158a('0xe')][_0xb0674b][_0x158a('0x12')]['lastSync']=moment();this[_0x158a('0xf')](_0xb0674b);}};EmailChannel[_0x158a('0x18')]['handleImapError']=function(_0x513169,_0x592ded){if(this[_0x158a('0xe')][_0x513169]){this[_0x158a('0xe')][_0x513169]['Imap'][_0x158a('0x13')]='error';this[_0x158a('0xe')][_0x513169][_0x158a('0x12')]['messageStatus']=_0x592ded;return this['emit'](_0x513169);}};EmailChannel[_0x158a('0x18')][_0x158a('0x32')]=function(_0x458e37,_0x574dca){return this['smtp'][_0x158a('0x33')](_0x458e37,_0x574dca);};EmailChannel['prototype'][_0x158a('0x34')]=function(_0x42f6a6){var _0x1f69b2=this;if(this[_0x158a('0xe')][_0x42f6a6['id']]){if(_['isNil'](this['mailAccounts'][_0x42f6a6['id']][_0x158a('0x35')])){this[_0x158a('0xe')][_0x42f6a6['id']][_0x158a('0x35')]={};}this['mailAccounts'][_0x42f6a6['id']]['Smtp'][_0x158a('0x36')]=moment();return new BPromise(function(_0x30dbed,_0x3aef1e){return _0x1f69b2[_0x158a('0x37')]['verify'](_0x42f6a6)[_0x158a('0x2d')](function(_0x1221ca){_0x1f69b2[_0x158a('0xe')][_0x42f6a6['id']][_0x158a('0x35')][_0x158a('0x13')]=_0x158a('0x38');_0x1f69b2[_0x158a('0xe')][_0x42f6a6['id']][_0x158a('0x35')][_0x158a('0x14')]='';_0x1f69b2['emit'](_0x42f6a6['id']);_0x30dbed(_0x1221ca);})[_0x158a('0x2f')](function(_0x46c09f){_0x1f69b2['mailAccounts'][_0x42f6a6['id']]['Smtp']['status']=_0x158a('0x23');_0x1f69b2[_0x158a('0xe')][_0x42f6a6['id']][_0x158a('0x35')][_0x158a('0x14')]=_0x46c09f;_0x1f69b2[_0x158a('0xf')](_0x42f6a6['id']);_0x3aef1e(_0x46c09f);});});}return this['smtp'][_0x158a('0x39')](_0x42f6a6);};module[_0x158a('0x3a')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 2a65862..babf896 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 _0x4881=['mailbox','handleOpenBox','emit','box','readUnseen','end','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchError','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchEnd','handleCloseBox','handleEnd','stringify','textCode','upperFirst','lodash','imap','simpleParser','iconv','EventEmitter','./utils','../../../config/logger','email','account','once','ready','handleReady','bind','handleError','inherits','prototype','connTimeout','authTimeout','user','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','required'];(function(_0x43032e,_0x191fc6){var _0xc77d4b=function(_0x43e299){while(--_0x43e299){_0x43032e['push'](_0x43032e['shift']());}};_0xc77d4b(++_0x191fc6);}(_0x4881,0x8d));var _0x1488=function(_0x4327fe,_0x4bf743){_0x4327fe=_0x4327fe-0x0;var _0x4aa013=_0x4881[_0x4327fe];return _0x4aa013;};'use strict';var _=require(_0x1488('0x0'));var util=require('util');var Imap=require(_0x1488('0x1'));var simpleParser=require('mailparser')[_0x1488('0x2')];var Iconv=require(_0x1488('0x3'))['Iconv'];var EventEmitter=require('events')[_0x1488('0x4')];var utils=require(_0x1488('0x5'));var logger=require(_0x1488('0x6'))(_0x1488('0x7'));function EmailImap(_0xb09120,_0x1e4142){this['mailbox']=_0xb09120['mailbox'];this[_0x1488('0x8')]=this['getAccount'](_0xb09120,_0x1e4142);this[_0x1488('0x1')]=new Imap(this[_0x1488('0x8')]);this[_0x1488('0x1')][_0x1488('0x9')](_0x1488('0xa'),this[_0x1488('0xb')][_0x1488('0xc')](this));this['imap'][_0x1488('0x9')]('end',this['handleEnd'][_0x1488('0xc')](this));this[_0x1488('0x1')]['on']('error',this[_0x1488('0xd')][_0x1488('0xc')](this));this[_0x1488('0x1')]['connect']();}util[_0x1488('0xe')](EmailImap,EventEmitter);EmailImap[_0x1488('0xf')]['getAccount']=function(_0x51e675,_0xa17fe2){var _0x19a3a7={'connTimeout':_0x51e675[_0x1488('0x10')]?_0x51e675[_0x1488('0x10')]*0x3e8:0x2710,'authTimeout':_0x51e675[_0x1488('0x11')]?_0x51e675['authTimeout']*0x3e8:0x1388};if(_0x51e675['service']){_0x19a3a7[_0x1488('0x12')]=_0x51e675['user'];if(_0x51e675['modernAuthentication']){_0x19a3a7[_0x1488('0x13')]=utils[_0x1488('0x14')](_0x51e675[_0x1488('0x15')][_0x1488('0x16')],_0x51e675[_0x1488('0x12')]);}else{_0x19a3a7[_0x1488('0x17')]=_0x51e675[_0x1488('0x17')];}}else{if(_0x51e675[_0x1488('0x18')]){_0x19a3a7['user']=_0x51e675['user'];_0x19a3a7['password']=_0x51e675['password'];}}_0x19a3a7[_0x1488('0x7')]=_0xa17fe2||_0x51e675[_0x1488('0x12')]||_0x1488('0x19');_0x19a3a7[_0x1488('0x1a')]=_0x51e675[_0x1488('0x1a')];_0x19a3a7['port']=_0x51e675[_0x1488('0x1b')]||0x3e1;if(_0x51e675[_0x1488('0x1c')]){_0x19a3a7[_0x1488('0x1c')]=!![];}else{_0x19a3a7[_0x1488('0x1c')]=![];_0x19a3a7['autotls']=_0x1488('0x1d');}return _0x19a3a7;};EmailImap['prototype'][_0x1488('0xb')]=function(){this['imap']['openBox'](this[_0x1488('0x1e')],![],this[_0x1488('0x1f')][_0x1488('0xc')](this));};EmailImap[_0x1488('0xf')][_0x1488('0x1f')]=function(_0x12a24e,_0x493a01){if(_0x12a24e){this[_0x1488('0xd')](_0x12a24e,!![]);}else{this[_0x1488('0x20')](_0x1488('0x21'),_0x493a01);this[_0x1488('0x22')]();}};EmailImap[_0x1488('0xf')]['handleCloseBox']=function(_0x25e14d){if(_0x25e14d){this['handleError'](_0x25e14d,!![]);}else{this[_0x1488('0x1')][_0x1488('0x23')]();}};EmailImap[_0x1488('0xf')][_0x1488('0x22')]=function(){this[_0x1488('0x1')]['search']([_0x1488('0x24')],this[_0x1488('0x25')][_0x1488('0xc')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x2de2a8,_0x59fb4e){if(_0x2de2a8){this[_0x1488('0xd')](_0x2de2a8,!![]);}else{if(_0x59fb4e['length']){try{var _0xa62e36=this[_0x1488('0x1')][_0x1488('0x26')](_0x59fb4e,{'bodies':'','markSeen':!![]});_0xa62e36['on'](_0x1488('0x27'),this[_0x1488('0x28')]['bind'](this));_0xa62e36[_0x1488('0x9')](_0x1488('0x29'),this[_0x1488('0x2a')][_0x1488('0xc')](this));_0xa62e36[_0x1488('0x9')]('end',this['handleFetchEnd'][_0x1488('0xc')](this));}catch(_0x5856d8){logger[_0x1488('0x29')](_0x5856d8);}}else{this['imap'][_0x1488('0x2b')](!![],this['handleCloseBox'][_0x1488('0xc')](this));}}};EmailImap['prototype'][_0x1488('0x28')]=function(_0x3efd44){_0x3efd44['on'](_0x1488('0x2c'),this[_0x1488('0x2d')][_0x1488('0xc')](this));_0x3efd44[_0x1488('0x9')](_0x1488('0x2e'),this[_0x1488('0x2f')]['bind'](this));_0x3efd44['once'](_0x1488('0x23'),this[_0x1488('0x30')][_0x1488('0xc')](this));};EmailImap[_0x1488('0xf')][_0x1488('0x2d')]=function(_0x5e820f){simpleParser(_0x5e820f,{'Iconv':Iconv},this[_0x1488('0x31')][_0x1488('0xc')](this));};EmailImap[_0x1488('0xf')][_0x1488('0x2f')]=function(){};EmailImap[_0x1488('0xf')][_0x1488('0x30')]=function(){};EmailImap[_0x1488('0xf')]['handleSimpleParser']=function(_0x4058d0,_0x4da760){if(_0x4058d0){logger[_0x1488('0x29')](_0x4058d0);}else{var _0x86f4a8=this;utils[_0x1488('0x32')](this[_0x1488('0x8')],_0x4da760,function(_0x17f318){_0x86f4a8[_0x1488('0x20')](_0x1488('0x7'),_0x17f318);});}};EmailImap[_0x1488('0xf')][_0x1488('0x33')]=function(){this[_0x1488('0x1')][_0x1488('0x2b')](!![],this[_0x1488('0x34')][_0x1488('0xc')](this));};EmailImap[_0x1488('0xf')][_0x1488('0x2a')]=function(_0x4225df){this['handleError'](_0x4225df);this[_0x1488('0x1')][_0x1488('0x2b')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x1488('0xf')][_0x1488('0x35')]=function(){this[_0x1488('0x20')](_0x1488('0x23'));};EmailImap[_0x1488('0xf')][_0x1488('0xd')]=function(_0x4855cf,_0x96ca1f){logger['error'](_0x1488('0xd'),this[_0x1488('0x8')]['email'],JSON[_0x1488('0x36')](_0x4855cf));var _0x3f835f='';if(_0x4855cf){if(_0x4855cf['textCode']){_0x3f835f=_0x4855cf[_0x1488('0x37')];}else{for(var _0xf469d5 in _0x4855cf){if(_0x4855cf['hasOwnProperty'](_0xf469d5)){_0x3f835f+=_[_0x1488('0x38')](_0xf469d5)+':\x20'+_0x4855cf[_0xf469d5]+'\x0a';}}}}if(_0x96ca1f){this[_0x1488('0x1')]['end']();}else{this[_0x1488('0x20')](_0x1488('0x29'),_0x3f835f);this['emit'](_0x1488('0x23'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x90d1=['bind','end','handleEnd','connect','inherits','prototype','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5','password','host','tls','autotls','required','handleOpenBox','emit','readUnseen','UNSEEN','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','handleCloseBox','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','closeBox','handleError','stringify','textCode','hasOwnProperty','exports','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','getAccount','once','ready','handleReady'];(function(_0x4f106d,_0x5715c1){var _0x35aa9c=function(_0x286fa3){while(--_0x286fa3){_0x4f106d['push'](_0x4f106d['shift']());}};_0x35aa9c(++_0x5715c1);}(_0x90d1,0x158));var _0x190d=function(_0x4e43d4,_0xd760d0){_0x4e43d4=_0x4e43d4-0x0;var _0x4db61c=_0x90d1[_0x4e43d4];return _0x4db61c;};'use strict';var _=require('lodash');var util=require(_0x190d('0x0'));var Imap=require(_0x190d('0x1'));var simpleParser=require(_0x190d('0x2'))[_0x190d('0x3')];var Iconv=require(_0x190d('0x4'))[_0x190d('0x5')];var EventEmitter=require(_0x190d('0x6'))[_0x190d('0x7')];var utils=require(_0x190d('0x8'));var logger=require(_0x190d('0x9'))(_0x190d('0xa'));function EmailImap(_0x38b295,_0x5b05f7){this[_0x190d('0xb')]=_0x38b295[_0x190d('0xb')];this['account']=this[_0x190d('0xc')](_0x38b295,_0x5b05f7);this[_0x190d('0x1')]=new Imap(this['account']);this[_0x190d('0x1')][_0x190d('0xd')](_0x190d('0xe'),this[_0x190d('0xf')][_0x190d('0x10')](this));this[_0x190d('0x1')][_0x190d('0xd')](_0x190d('0x11'),this[_0x190d('0x12')][_0x190d('0x10')](this));this[_0x190d('0x1')]['on']('error',this['handleError'][_0x190d('0x10')](this));this[_0x190d('0x1')][_0x190d('0x13')]();}util[_0x190d('0x14')](EmailImap,EventEmitter);EmailImap[_0x190d('0x15')][_0x190d('0xc')]=function(_0x673f1b,_0x216369){var _0x413900={'connTimeout':_0x673f1b['connTimeout']?_0x673f1b[_0x190d('0x16')]*0x3e8:0x2710,'authTimeout':_0x673f1b[_0x190d('0x17')]?_0x673f1b[_0x190d('0x17')]*0x3e8:0x1388};if(_0x673f1b[_0x190d('0x18')]){_0x413900[_0x190d('0x19')]=_0x673f1b[_0x190d('0x19')];if(_0x673f1b[_0x190d('0x1a')]){_0x413900[_0x190d('0x1b')]=utils[_0x190d('0x1c')](_0x673f1b['CloudProvider'][_0x190d('0x1d')],_0x673f1b[_0x190d('0x19')]);}else{_0x413900[_0x190d('0x1e')]=_0x673f1b[_0x190d('0x1e')];}}else{if(_0x673f1b['authentication']){_0x413900[_0x190d('0x19')]=_0x673f1b[_0x190d('0x19')];_0x413900[_0x190d('0x1e')]=_0x673f1b['password'];}}_0x413900[_0x190d('0xa')]=_0x216369||_0x673f1b[_0x190d('0x19')]||'anonymous@xcally.com';_0x413900['host']=_0x673f1b[_0x190d('0x1f')];_0x413900['port']=_0x673f1b['port']||0x3e1;if(_0x673f1b[_0x190d('0x20')]){_0x413900['tls']=!![];}else{_0x413900[_0x190d('0x20')]=![];_0x413900[_0x190d('0x21')]=_0x190d('0x22');}return _0x413900;};EmailImap[_0x190d('0x15')][_0x190d('0xf')]=function(){this[_0x190d('0x1')]['openBox'](this[_0x190d('0xb')],![],this[_0x190d('0x23')]['bind'](this));};EmailImap[_0x190d('0x15')][_0x190d('0x23')]=function(_0x2632c4,_0x252184){if(_0x2632c4){this['handleError'](_0x2632c4,!![]);}else{this[_0x190d('0x24')]('box',_0x252184);this[_0x190d('0x25')]();}};EmailImap[_0x190d('0x15')]['handleCloseBox']=function(_0x1dd3fe){if(_0x1dd3fe){this['handleError'](_0x1dd3fe,!![]);}else{this[_0x190d('0x1')][_0x190d('0x11')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x190d('0x1')]['search']([_0x190d('0x26')],this['handleReadUnseen'][_0x190d('0x10')](this));};EmailImap[_0x190d('0x15')]['handleReadUnseen']=function(_0x540c9b,_0x6b9fd3){if(_0x540c9b){this['handleError'](_0x540c9b,!![]);}else{if(_0x6b9fd3[_0x190d('0x27')]){try{var _0x4a251c=this['imap'][_0x190d('0x28')](_0x6b9fd3,{'bodies':'','markSeen':!![]});_0x4a251c['on'](_0x190d('0x29'),this[_0x190d('0x2a')][_0x190d('0x10')](this));_0x4a251c[_0x190d('0xd')](_0x190d('0x2b'),this[_0x190d('0x2c')][_0x190d('0x10')](this));_0x4a251c[_0x190d('0xd')](_0x190d('0x11'),this[_0x190d('0x2d')][_0x190d('0x10')](this));}catch(_0x1e1f46){logger[_0x190d('0x2b')](_0x1e1f46);}}else{this[_0x190d('0x1')]['closeBox'](!![],this[_0x190d('0x2e')]['bind'](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x1ab232){_0x1ab232['on'](_0x190d('0x2f'),this[_0x190d('0x30')]['bind'](this));_0x1ab232['once']('attributes',this[_0x190d('0x31')][_0x190d('0x10')](this));_0x1ab232[_0x190d('0xd')](_0x190d('0x11'),this['handleMessageEnd'][_0x190d('0x10')](this));};EmailImap[_0x190d('0x15')][_0x190d('0x30')]=function(_0x3261ca){simpleParser(_0x3261ca,{'Iconv':Iconv},this['handleSimpleParser'][_0x190d('0x10')](this));};EmailImap[_0x190d('0x15')][_0x190d('0x31')]=function(){};EmailImap[_0x190d('0x15')][_0x190d('0x32')]=function(){};EmailImap[_0x190d('0x15')][_0x190d('0x33')]=function(_0x2e8993,_0x73f054){if(_0x2e8993){logger[_0x190d('0x2b')](_0x2e8993);}else{var _0x11907a=this;utils[_0x190d('0x34')](this[_0x190d('0x35')],_0x73f054,function(_0x887389){_0x11907a[_0x190d('0x24')](_0x190d('0xa'),_0x887389);});}};EmailImap[_0x190d('0x15')][_0x190d('0x2d')]=function(){this['imap'][_0x190d('0x36')](!![],this[_0x190d('0x2e')][_0x190d('0x10')](this));};EmailImap[_0x190d('0x15')]['handleFetchError']=function(_0xe20fa6){this[_0x190d('0x37')](_0xe20fa6);this[_0x190d('0x1')]['closeBox'](!![],this[_0x190d('0x2e')][_0x190d('0x10')](this));};EmailImap[_0x190d('0x15')][_0x190d('0x12')]=function(){this[_0x190d('0x24')](_0x190d('0x11'));};EmailImap[_0x190d('0x15')][_0x190d('0x37')]=function(_0x35f875,_0x4ffa47){logger[_0x190d('0x2b')]('handleError',this['account'][_0x190d('0xa')],JSON[_0x190d('0x38')](_0x35f875));var _0xb52524='';if(_0x35f875){if(_0x35f875['textCode']){_0xb52524=_0x35f875[_0x190d('0x39')];}else{for(var _0x2cfd7f in _0x35f875){if(_0x35f875[_0x190d('0x3a')](_0x2cfd7f)){_0xb52524+=_['upperFirst'](_0x2cfd7f)+':\x20'+_0x35f875[_0x2cfd7f]+'\x0a';}}}}if(_0x4ffa47){this[_0x190d('0x1')][_0x190d('0x11')]();}else{this[_0x190d('0x24')](_0x190d('0x2b'),_0xb52524);this[_0x190d('0x24')](_0x190d('0x11'));}};module[_0x190d('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 313fbb7..1f61d95 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 _0x755b=['createTransport','use','compile','sendMail','toString','prototype','verify','exports','nodemailer-plugin-inline-base64','send'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x755b,0xd0));var _0xb755=function(_0x26b2a9,_0x34bf0d){_0x26b2a9=_0x26b2a9-0x0;var _0x54479b=_0x755b[_0x26b2a9];return _0x54479b;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xb755('0x0'));function EmailSmtp(){}EmailSmtp['prototype'][_0xb755('0x1')]=function(_0x3d3a28,_0x12507a){return new Promise(function(_0x1c9f19,_0x58a622){var _0xb24e6a=nodemailer[_0xb755('0x2')](_0x3d3a28);_0xb24e6a[_0xb755('0x3')](_0xb755('0x4'),inlineBase64());_0xb24e6a[_0xb755('0x5')](_0x12507a,function(_0x50af25,_0x304702){if(_0x50af25){_0x58a622(_0x50af25[_0xb755('0x6')]());}else{_0x1c9f19(_0x304702);}});});};EmailSmtp[_0xb755('0x7')]['verify']=function(_0x19fb70){return new Promise(function(_0x1988d1,_0xb62cd7){var _0x226ee8=nodemailer['createTransport'](_0x19fb70);_0x226ee8[_0xb755('0x8')](function(_0x3ce8c7,_0x1589e0){if(_0x3ce8c7){_0xb62cd7(_0x3ce8c7[_0xb755('0x6')]());}else{if(_0x1589e0){_0x1988d1(_0x1589e0);}else{_0xb62cd7('Not\x20verifired');}}});});};module[_0xb755('0x9')]=EmailSmtp; \ No newline at end of file +var _0xdf6d=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x4e8bd3,_0x223177){var _0x1cf256=function(_0x3d98c0){while(--_0x3d98c0){_0x4e8bd3['push'](_0x4e8bd3['shift']());}};_0x1cf256(++_0x223177);}(_0xdf6d,0x85));var _0xddf6=function(_0x3fe213,_0x365536){_0x3fe213=_0x3fe213-0x0;var _0x5a39f3=_0xdf6d[_0x3fe213];return _0x5a39f3;};'use strict';var nodemailer=require(_0xddf6('0x0'));var inlineBase64=require(_0xddf6('0x1'));function EmailSmtp(){}EmailSmtp[_0xddf6('0x2')][_0xddf6('0x3')]=function(_0xc70406,_0x26aa22){return new Promise(function(_0x441d38,_0x7ca2b6){var _0x127caa=nodemailer[_0xddf6('0x4')](_0xc70406);_0x127caa[_0xddf6('0x5')](_0xddf6('0x6'),inlineBase64());_0x127caa[_0xddf6('0x7')](_0x26aa22,function(_0x2ddada,_0x20d536){if(_0x2ddada){_0x7ca2b6(_0x2ddada[_0xddf6('0x8')]());}else{_0x441d38(_0x20d536);}});});};EmailSmtp['prototype']['verify']=function(_0x16ad14){return new Promise(function(_0x1366fc,_0x58e1b2){var _0x13f44c=nodemailer[_0xddf6('0x4')](_0x16ad14);_0x13f44c[_0xddf6('0x9')](function(_0xf07b44,_0x5d2d7d){if(_0xf07b44){_0x58e1b2(_0xf07b44['toString']());}else{if(_0x5d2d7d){_0x1366fc(_0x5d2d7d);}else{_0x58e1b2(_0xddf6('0xa'));}}});});};module[_0xddf6('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index bad3934..4fac6f7 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 _0x6932=['application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','Attachments','Title','generateXOAuth2Token','auth=Bearer\x20','toString','base64','lodash','util','../../../config/logger','../../../config/environment','value','address','anonymous','generate','head','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','@xcally.com','html','test','includes','attachments','forEach','push','replace','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0xd5b04c[_0x2693('0xe')](0x0,-0x1)[_0x2693('0xf')]('\x20'):_0x153dcb[_0x2693('0x9')];}return _0x2693('0x10');}function getLastName(_0x4bb41c){var _0x5bd5df=_['head'](_0x4bb41c[_0x2693('0x4')]);if(_0x5bd5df&&_0x5bd5df[_0x2693('0x9')]){var _0x500ea9=_0x5bd5df[_0x2693('0x9')][_0x2693('0xc')](/\s+/);return _0x500ea9[_0x2693('0xd')]>0x1?_0x500ea9[_0x2693('0x11')]():'';}return'';}function getMails(_0x51370b,_0xde5e6a){var _0x484fd6='';for(var _0x45fd73=0x0;_0x45fd73<_0xde5e6a[_0x2693('0x4')]['length'];_0x45fd73+=0x1){if(_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x5')]!==_0x51370b){if(!_[_0x2693('0x12')](_0x484fd6)){_0x484fd6+=',';}_0x484fd6+=_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x9')]||_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x5')]||'';_0x484fd6+='\x20<';_0x484fd6+=_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x5')]?_0xde5e6a[_0x2693('0x4')][_0x45fd73][_0x2693('0x5')]:_0x2693('0x6')+random['generate'](0x6)+_0x2693('0x13');_0x484fd6+='>';}}return _0x484fd6;}function parseEmail(_0x10e12a,_0x11312c,_0xc2b759){if(_0x11312c[_0x2693('0x14')]){var _0x4bd2b2=/)<[^<]*)*<\/script>/gi;while(_0x4bd2b2[_0x2693('0x15')](_0x11312c[_0x2693('0x14')])){_0x11312c[_0x2693('0x14')]=_0x11312c[_0x2693('0x14')]['replace'](_0x4bd2b2,'');}if(_0x11312c[_0x2693('0x14')][_0x2693('0x16')]('{_0x44d5c7[_0x2693('0x19')](_0x406657['filename']);});var _0x2da08a=/]+>/g;var _0x40ea0e=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1e366d=_0x11312c[_0x2693('0x14')][_0x2693('0x1a')](_0x40ea0e,_0x2693('0x1b'));var _0x2ea3f8=_0x1e366d[_0x2693('0x1a')](_0x2da08a,_0x2693('0x1c'));for(let _0x3ca708=0x0;_0x3ca708<_0x44d5c7[_0x2693('0xd')];_0x3ca708++){var _0x36b87c=_0x2ea3f8[_0x2693('0x1a')]('_IMG',_0x2693('0x1d')+_0x44d5c7[_0x3ca708]+_0x2693('0x1e'));_0x2ea3f8=_0x36b87c;}_0x11312c[_0x2693('0x14')]=_0x2ea3f8;}_0xc2b759[_0x2693('0x1f')]=_0x11312c[_0x2693('0x14')];}else{_0xc2b759['body']=_0x11312c[_0x2693('0x20')];}if(_0xc2b759[_0x2693('0x1f')]){_0xc2b759[_0x2693('0x1f')]=_0xc2b759['body'][_0x2693('0x1a')](/0x0){var _0xea0f47=['Auto-Submitted:\x20auto-replied',_0x2693('0x35'),_0x2693('0x36')];for(var _0x136968=0x0;_0x136968<_0x11312c[_0x2693('0x34')][_0x2693('0xd')];_0x136968++){var _0x4470db=_['indexOf'](_0xea0f47,_0x11312c['headerLines'][_0x136968][_0x2693('0x37')]);if(_0x4470db>=0x0){_0xc2b759[_0x2693('0x38')]=!![];}}}return _0xc2b759;}exports['parser']=function(_0x1c5921,_0x1d5b68,_0x2f3633){var _0x3ed7b6={'from':getAddress(_0x1d5b68[_0x2693('0x39')]),'firstName':getFirstName(_0x1d5b68[_0x2693('0x39')]),'lastName':getLastName(_0x1d5b68[_0x2693('0x39')]),'mapKey':_0x2693('0x24'),'message':{'from':getMails(_0x1c5921['email'],_0x1d5b68['from']),'to':_0x1c5921[_0x2693('0x24')],'cc':'','subject':_0x1d5b68[_0x2693('0x3a')]||'','messageId':_0x1d5b68[_0x2693('0x3b')],'inReplyTo':_0x1d5b68[_0x2693('0x3c')],'sentAt':moment(_0x1d5b68[_0x2693('0x3d')])[_0x2693('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x1d5b68[_0x2693('0x14')]&&!_0x1d5b68[_0x2693('0x20')]){var _0x44790c=_[_0x2693('0x3e')](_0x1d5b68[_0x2693('0x17')],{'contentType':_0x2693('0x3f')});if(_0x44790c[_0x2693('0xd')]){logger[_0x2693('0x40')](util[_0x2693('0x2c')](_0x2693('0x41'),_0x1d5b68[_0x2693('0x3b')]));tnef[_0x2693('0x42')](_['first'](_0x44790c)[_0x2693('0x32')],function(_0x528c78,_0x34da71){if(_0x34da71){_0x1d5b68['html']=_0x34da71['BodyHTML']||'

Empty\x20message

';if(_0x34da71[_0x2693('0x43')]){for(var _0x57d84f=0x0;_0x57d84f<_0x34da71[_0x2693('0x43')]['length'];_0x57d84f++){var _0x2c4c72=_0x34da71['Attachments'][_0x57d84f];_0x3ed7b6['message'][_0x2693('0x17')][_0x2693('0x19')]({'filename':_0x2c4c72[_0x2693('0x44')],'content':Buffer[_0x2693('0x39')](_0x2c4c72['Data'])});}}}_0x2f3633(parseEmail(_0x1c5921,_0x1d5b68,_0x3ed7b6));});}else{_0x1d5b68[_0x2693('0x14')]='

Empty\x20message

';_0x2f3633(parseEmail(_0x1c5921,_0x1d5b68,_0x3ed7b6));}}else{_0x2f3633(parseEmail(_0x1c5921,_0x1d5b68,_0x3ed7b6));}};exports[_0x2693('0x45')]=function(_0x25181d,_0x1a148a){var _0x1cf887=['user='+(_0x1a148a||''),_0x2693('0x46')+_0x25181d,'',''];return Buffer[_0x2693('0x39')](_0x1cf887[_0x2693('0xf')](''),'utf-8')[_0x2693('0x47')](_0x2693('0x48'));}; \ No newline at end of file +var _0x6377=['value','isEmpty','html','includes','attachments','push','_SRC','_IMG','replace','\x20[Attachment:\x20','\x20]','body','message','originTo','originCc','bcc','attach','type','attachment','filename','attachment-','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Precedence:\x20auto_reply','line','isAutoreply','from','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','format','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','generateXOAuth2Token','auth=Bearer\x20','toString','base64','moment','randomstring','path','util','node-tnef','email','../../../config/environment','address','anonymous','generate','@xcally.com','head','name','indexOf','length','slice','join','Anonymous','split','pop'];(function(_0x1788ed,_0xacf360){var _0x1c5c8b=function(_0x5134f6){while(--_0x5134f6){_0x1788ed['push'](_0x1788ed['shift']());}};_0x1c5c8b(++_0xacf360);}(_0x6377,0x1c1));var _0x7637=function(_0x51fd41,_0x2afa87){_0x51fd41=_0x51fd41-0x0;var _0x219f17=_0x6377[_0x51fd41];return _0x219f17;};'use strict';var _=require('lodash');var moment=require(_0x7637('0x0'));var random=require(_0x7637('0x1'));var fs=require('fs');var path=require(_0x7637('0x2'));var util=require(_0x7637('0x3'));var tnef=require(_0x7637('0x4'));var logger=require('../../../config/logger')(_0x7637('0x5'));var config=require(_0x7637('0x6'));function getAddress(_0x3a414c){var _0x2e608b=_['head'](_0x3a414c['value']);return _0x2e608b&&_0x2e608b[_0x7637('0x7')]?_0x2e608b[_0x7637('0x7')]:_0x7637('0x8')+random[_0x7637('0x9')](0x6)+_0x7637('0xa');}function getFirstName(_0x3e1a68){var _0x50d62a=_[_0x7637('0xb')](_0x3e1a68['value']);if(_0x50d62a&&_0x50d62a[_0x7637('0xc')]){if(_0x50d62a[_0x7637('0xc')]==_0x50d62a[_0x7637('0x7')]){return _0x50d62a[_0x7637('0xc')]['substring'](0x0,_0x50d62a[_0x7637('0xc')][_0x7637('0xd')]('@'));}var _0x10b1c2=_0x50d62a['name']['split'](/\s+/);return _0x10b1c2[_0x7637('0xe')]>0x1?_0x10b1c2[_0x7637('0xf')](0x0,-0x1)[_0x7637('0x10')]('\x20'):_0x50d62a[_0x7637('0xc')];}return _0x7637('0x11');}function getLastName(_0x48f4d2){var _0x451fb8=_[_0x7637('0xb')](_0x48f4d2['value']);if(_0x451fb8&&_0x451fb8['name']){var _0x55ea95=_0x451fb8[_0x7637('0xc')][_0x7637('0x12')](/\s+/);return _0x55ea95['length']>0x1?_0x55ea95[_0x7637('0x13')]():'';}return'';}function getMails(_0x39679c,_0x16aeb6){var _0x4898fb='';for(var _0x223695=0x0;_0x223695<_0x16aeb6['value'][_0x7637('0xe')];_0x223695+=0x1){if(_0x16aeb6[_0x7637('0x14')][_0x223695][_0x7637('0x7')]!==_0x39679c){if(!_[_0x7637('0x15')](_0x4898fb)){_0x4898fb+=',';}_0x4898fb+=_0x16aeb6[_0x7637('0x14')][_0x223695][_0x7637('0xc')]||_0x16aeb6[_0x7637('0x14')][_0x223695][_0x7637('0x7')]||'';_0x4898fb+='\x20<';_0x4898fb+=_0x16aeb6[_0x7637('0x14')][_0x223695][_0x7637('0x7')]?_0x16aeb6[_0x7637('0x14')][_0x223695]['address']:_0x7637('0x8')+random[_0x7637('0x9')](0x6)+_0x7637('0xa');_0x4898fb+='>';}}return _0x4898fb;}function parseEmail(_0x1dd393,_0x5567e0,_0x2ba04e){if(_0x5567e0[_0x7637('0x16')]){var _0x3dbb7d=/)<[^<]*)*<\/script>/gi;while(_0x3dbb7d['test'](_0x5567e0[_0x7637('0x16')])){_0x5567e0[_0x7637('0x16')]=_0x5567e0['html']['replace'](_0x3dbb7d,'');}if(_0x5567e0['html'][_0x7637('0x17')]('{_0x594665[_0x7637('0x19')](_0x50b446['filename']);});var _0xaa92a4=/]+>/g;var _0x54117c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x333559=_0x5567e0['html']['replace'](_0x54117c,_0x7637('0x1a'));var _0x303156=_0x333559['replace'](_0xaa92a4,_0x7637('0x1b'));for(let _0x5774fc=0x0;_0x5774fc<_0x594665[_0x7637('0xe')];_0x5774fc++){var _0x23df54=_0x303156[_0x7637('0x1c')]('_IMG',_0x7637('0x1d')+_0x594665[_0x5774fc]+_0x7637('0x1e'));_0x303156=_0x23df54;}_0x5567e0[_0x7637('0x16')]=_0x303156;}_0x2ba04e['body']=_0x5567e0[_0x7637('0x16')];}else{_0x2ba04e[_0x7637('0x1f')]=_0x5567e0['textAsHtml'];}if(_0x2ba04e[_0x7637('0x1f')]){_0x2ba04e[_0x7637('0x1f')]=_0x2ba04e['body'][_0x7637('0x1c')](/0x0){var _0x14679c=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All',_0x7637('0x30')];for(var _0x295672=0x0;_0x295672<_0x5567e0[_0x7637('0x2f')]['length'];_0x295672++){var _0x58bea1=_[_0x7637('0xd')](_0x14679c,_0x5567e0[_0x7637('0x2f')][_0x295672][_0x7637('0x31')]);if(_0x58bea1>=0x0){_0x2ba04e[_0x7637('0x32')]=!![];}}}return _0x2ba04e;}exports['parser']=function(_0x1b02cf,_0x592515,_0x107b9c){var _0x213e81={'from':getAddress(_0x592515[_0x7637('0x33')]),'firstName':getFirstName(_0x592515[_0x7637('0x33')]),'lastName':getLastName(_0x592515[_0x7637('0x33')]),'mapKey':_0x7637('0x5'),'message':{'from':getMails(_0x1b02cf[_0x7637('0x5')],_0x592515['from']),'to':_0x1b02cf['email'],'cc':'','subject':_0x592515['subject']||'','messageId':_0x592515['messageId'],'inReplyTo':_0x592515[_0x7637('0x34')],'sentAt':moment(_0x592515[_0x7637('0x35')])['format'](_0x7637('0x36')),'attach':![],'attachments':[]}};if(!_0x592515['html']&&!_0x592515[_0x7637('0x37')]){var _0x5e674b=_['filter'](_0x592515[_0x7637('0x18')],{'contentType':'application/ms-tnef'});if(_0x5e674b[_0x7637('0xe')]){logger['info'](util[_0x7637('0x38')](_0x7637('0x39'),_0x592515['messageId']));tnef[_0x7637('0x3a')](_[_0x7637('0x3b')](_0x5e674b)[_0x7637('0x2d')],function(_0x36b4df,_0x960c87){if(_0x960c87){_0x592515[_0x7637('0x16')]=_0x960c87[_0x7637('0x3c')]||_0x7637('0x3d');if(_0x960c87[_0x7637('0x3e')]){for(var _0x19ec80=0x0;_0x19ec80<_0x960c87['Attachments'][_0x7637('0xe')];_0x19ec80++){var _0x1f58fd=_0x960c87[_0x7637('0x3e')][_0x19ec80];_0x213e81[_0x7637('0x20')][_0x7637('0x18')]['push']({'filename':_0x1f58fd['Title'],'content':Buffer[_0x7637('0x33')](_0x1f58fd['Data'])});}}}_0x107b9c(parseEmail(_0x1b02cf,_0x592515,_0x213e81));});}else{_0x592515['html']=_0x7637('0x3d');_0x107b9c(parseEmail(_0x1b02cf,_0x592515,_0x213e81));}}else{_0x107b9c(parseEmail(_0x1b02cf,_0x592515,_0x213e81));}};exports[_0x7637('0x3f')]=function(_0x2e0a66,_0x328a7a){var _0x5da691=['user='+(_0x328a7a||''),_0x7637('0x40')+_0x2e0a66,'',''];return Buffer[_0x7637('0x33')](_0x5da691[_0x7637('0x10')](''),'utf-8')[_0x7637('0x41')](_0x7637('0x42'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 2e6b0b3..ab96cf6 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 _0x234b=['Imap','Smtp','exports','name','Service','key','active'];(function(_0x4b6a9b,_0x3fa1f3){var _0x5dc9a8=function(_0x554248){while(--_0x554248){_0x4b6a9b['push'](_0x4b6a9b['shift']());}};_0x5dc9a8(++_0x3fa1f3);}(_0x234b,0xb2));var _0xb234=function(_0x5f2c16,_0x2e2ee0){_0x5f2c16=_0x5f2c16-0x0;var _0x58524b=_0x234b[_0x5f2c16];return _0x58524b;};'use strict';var _=require('lodash');function MailAccount(_0x1d04f1){this['id']=_0x1d04f1['id']||0x0;this[_0xb234('0x0')]=_0x1d04f1[_0xb234('0x0')]||_0xb234('0x1');this[_0xb234('0x2')]=_0x1d04f1[_0xb234('0x2')]||'SERV';this[_0xb234('0x3')]=_0x1d04f1[_0xb234('0x3')]||![];this['Imap']=_0x1d04f1[_0xb234('0x4')]||[];this[_0xb234('0x5')]=_0x1d04f1[_0xb234('0x5')]||[];}module[_0xb234('0x6')]=MailAccount; \ No newline at end of file +var _0x97e9=['Smtp','exports','lodash','name','Service','SERV','Imap'];(function(_0x51a344,_0x30773d){var _0x2bf23e=function(_0x4177cb){while(--_0x4177cb){_0x51a344['push'](_0x51a344['shift']());}};_0x2bf23e(++_0x30773d);}(_0x97e9,0xe2));var _0x997e=function(_0x4b6b42,_0x1bf65d){_0x4b6b42=_0x4b6b42-0x0;var _0x3b5f1d=_0x97e9[_0x4b6b42];return _0x3b5f1d;};'use strict';var _=require(_0x997e('0x0'));function MailAccount(_0x56dade){this['id']=_0x56dade['id']||0x0;this[_0x997e('0x1')]=_0x56dade[_0x997e('0x1')]||_0x997e('0x2');this['key']=_0x56dade['key']||_0x997e('0x3');this['active']=_0x56dade['active']||![];this['Imap']=_0x56dade[_0x997e('0x4')]||[];this[_0x997e('0x5')]=_0x56dade[_0x997e('0x5')]||[];}module[_0x997e('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 4bcd0b7..9d81638 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 _0xe3f2=['exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined','merge'];(function(_0x5d9ffc,_0x383475){var _0x4a1ea1=function(_0x15324b){while(--_0x15324b){_0x5d9ffc['push'](_0x5d9ffc['shift']());}};_0x4a1ea1(++_0x383475);}(_0xe3f2,0x1e5));var _0x2e3f=function(_0x3cd12e,_0x151296){_0x3cd12e=_0x3cd12e-0x0;var _0x1257c2=_0xe3f2[_0x3cd12e];return _0x1257c2;};'use strict';var _=require(_0x2e3f('0x0'));var MailAccount=require(_0x2e3f('0x1'));var Realtime=function(){this[_0x2e3f('0x2')]={};};function freeIsNotKey(_0x452bda,_0x5dfaf7,_0x64e2f){var _0x9a39fa=_[_0x2e3f('0x3')](_0x452bda,function(_0xcc855,_0x3309ef){return _0xcc855[_0x64e2f];});for(var _0x2a5077 in _0x5dfaf7){if(_0x5dfaf7[_0x2e3f('0x4')](_0x2a5077)){if(!_0x9a39fa[_0x2a5077]){delete _0x5dfaf7[_0x2a5077];}}}}Realtime[_0x2e3f('0x5')][_0x2e3f('0x6')]=function(_0x4f8c50,_0x5d877c){for(var _0x42b59e in _0x5d877c){if(_0x4f8c50[_0x2e3f('0x4')](_0x42b59e)){_0x4f8c50[_0x42b59e]=_0x5d877c[_0x42b59e];}}};Realtime['prototype']['initMailAccounts']=function(){var _0xfddd56=this;return function(_0x3eef4e){if(_0x3eef4e){freeIsNotKey(_0x3eef4e,_0xfddd56[_0x2e3f('0x2')],'id');for(var _0x1dfc71=0x0,_0x53e4bd={},_0x384b2b={};_0x1dfc71<_0x3eef4e[_0x2e3f('0x7')];_0x1dfc71+=0x1){_0x53e4bd=_0x3eef4e[_0x1dfc71];if(_[_0x2e3f('0x8')](_0xfddd56[_0x2e3f('0x2')][_0x53e4bd['id']])){_0xfddd56[_0x2e3f('0x2')][_0x53e4bd['id']]=new MailAccount(_0x53e4bd);}else{_[_0x2e3f('0x9')](_0xfddd56['mailAccounts'][_0x53e4bd['id']],_0x53e4bd);}}}return _0xfddd56[_0x2e3f('0x2')];};};module[_0x2e3f('0xa')]=Realtime; \ No newline at end of file +var _0x6220=['length','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts'];(function(_0x4ba935,_0x46f0bb){var _0x3dd154=function(_0x325e73){while(--_0x325e73){_0x4ba935['push'](_0x4ba935['shift']());}};_0x3dd154(++_0x46f0bb);}(_0x6220,0x189));var _0x0622=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x6220[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x0622('0x0'));var MailAccount=require(_0x0622('0x1'));var Realtime=function(){this[_0x0622('0x2')]={};};function freeIsNotKey(_0x44a1f2,_0x5e90e6,_0x22186a){var _0x5c3a26=_[_0x0622('0x3')](_0x44a1f2,function(_0x208b48,_0x557e7e){return _0x208b48[_0x22186a];});for(var _0x29efde in _0x5e90e6){if(_0x5e90e6[_0x0622('0x4')](_0x29efde)){if(!_0x5c3a26[_0x29efde]){delete _0x5e90e6[_0x29efde];}}}}Realtime[_0x0622('0x5')]['mergeFromDatabase']=function(_0x313bcf,_0x8ac847){for(var _0x31ee03 in _0x8ac847){if(_0x313bcf[_0x0622('0x4')](_0x31ee03)){_0x313bcf[_0x31ee03]=_0x8ac847[_0x31ee03];}}};Realtime[_0x0622('0x5')][_0x0622('0x6')]=function(){var _0x33c75e=this;return function(_0x1924ef){if(_0x1924ef){freeIsNotKey(_0x1924ef,_0x33c75e[_0x0622('0x2')],'id');for(var _0x133f36=0x0,_0x1ab6f3={},_0x36815e={};_0x133f36<_0x1924ef[_0x0622('0x7')];_0x133f36+=0x1){_0x1ab6f3=_0x1924ef[_0x133f36];if(_['isUndefined'](_0x33c75e['mailAccounts'][_0x1ab6f3['id']])){_0x33c75e[_0x0622('0x2')][_0x1ab6f3['id']]=new MailAccount(_0x1ab6f3);}else{_[_0x0622('0x8')](_0x33c75e[_0x0622('0x2')][_0x1ab6f3['id']],_0x1ab6f3);}}}return _0x33c75e[_0x0622('0x2')];};};module[_0x0622('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 46f0f23..b6743db 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 _0x9a3d=['active','key','ListId','TemplateId','Imap','CloudProvider','type','data5','MailServerOut','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','provider','service'];(function(_0x1ad099,_0x46dd5c){var _0x5bc322=function(_0x64167f){while(--_0x64167f){_0x1ad099['push'](_0x1ad099['shift']());}};_0x5bc322(++_0x46dd5c);}(_0x9a3d,0x14e));var _0xd9a3=function(_0x2d70b4,_0x446ce7){_0x2d70b4=_0x2d70b4-0x0;var _0x3eb109=_0x9a3d[_0x2d70b4];return _0x3eb109;};'use strict';var client=require('../client');exports[_0xd9a3('0x0')]=function(){return function(){return client[_0xd9a3('0x1')](_0xd9a3('0x2'),{'options':{'attributes':['id',_0xd9a3('0x3'),_0xd9a3('0x4'),_0xd9a3('0x5'),'email',_0xd9a3('0x6'),_0xd9a3('0x7'),_0xd9a3('0x8'),_0xd9a3('0x9')],'raw':![],'include':[{'model':'MailServerIn','as':_0xd9a3('0xa'),'include':[{'model':_0xd9a3('0xb'),'attributes':['id',_0xd9a3('0x3'),_0xd9a3('0x5'),_0xd9a3('0xc'),_0xd9a3('0xd')],'as':_0xd9a3('0xb')}]},{'model':_0xd9a3('0xe'),'as':'Smtp','include':[{'model':_0xd9a3('0xb'),'attributes':['id',_0xd9a3('0x3'),_0xd9a3('0x5'),'type',_0xd9a3('0xd')],'as':_0xd9a3('0xb')}]}]},'log':'getMailAccount'});};};exports[_0xd9a3('0xf')]=function(_0x45d07b,_0x250e84){return client[_0xd9a3('0x1')](_0xd9a3('0x10'),{'account':{'id':_0x45d07b},'body':_0x250e84,'log':_0xd9a3('0x10')});}; \ No newline at end of file +var _0xb2b4=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','data5','Smtp','getMailAccount','notify'];(function(_0x46eb0e,_0x296d16){var _0x523297=function(_0x1e0dbb){while(--_0x1e0dbb){_0x46eb0e['push'](_0x46eb0e['shift']());}};_0x523297(++_0x296d16);}(_0xb2b4,0x141));var _0x4b2b=function(_0x10acb2,_0x3ca870){_0x10acb2=_0x10acb2-0x0;var _0x186379=_0xb2b4[_0x10acb2];return _0x186379;};'use strict';var client=require(_0x4b2b('0x0'));exports[_0x4b2b('0x1')]=function(){return function(){return client[_0x4b2b('0x2')](_0x4b2b('0x3'),{'options':{'attributes':['id',_0x4b2b('0x4'),'provider',_0x4b2b('0x5'),_0x4b2b('0x6'),_0x4b2b('0x7'),_0x4b2b('0x8'),_0x4b2b('0x9'),_0x4b2b('0xa')],'raw':![],'include':[{'model':_0x4b2b('0xb'),'as':_0x4b2b('0xc'),'include':[{'model':_0x4b2b('0xd'),'attributes':['id',_0x4b2b('0x4'),'service',_0x4b2b('0xe'),_0x4b2b('0xf')],'as':_0x4b2b('0xd')}]},{'model':'MailServerOut','as':_0x4b2b('0x10'),'include':[{'model':_0x4b2b('0xd'),'attributes':['id',_0x4b2b('0x4'),_0x4b2b('0x5'),_0x4b2b('0xe'),_0x4b2b('0xf')],'as':'CloudProvider'}]}]},'log':_0x4b2b('0x11')});};};exports[_0x4b2b('0x12')]=function(_0x1cea35,_0xa517f2){return client['Request'](_0x4b2b('0x13'),{'account':{'id':_0x1cea35},'body':_0xa517f2,'log':_0x4b2b('0x13')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index a187a61..c7b2826 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 _0xacf0=['loginMailFrequency','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x1189c9,_0x4632c3){var _0x5cee44=function(_0x1bd69f){while(--_0x1bd69f){_0x1189c9['push'](_0x1189c9['shift']());}};_0x5cee44(++_0x4632c3);}(_0xacf0,0x10a));var _0x0acf=function(_0x38d45b,_0x54c034){_0x38d45b=_0x38d45b-0x0;var _0x112c3d=_0xacf0[_0x38d45b];return _0x112c3d;};'use strict';var client=require(_0x0acf('0x0'));exports[_0x0acf('0x1')]=function(){return client[_0x0acf('0x2')](_0x0acf('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x0acf('0x4')]},'log':_0x0acf('0x5')});}; \ No newline at end of file +var _0x2a3d=['GetSettings','../client','ShowSetting'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2a3d,0x199));var _0xd2a3=function(_0xaf5b36,_0x2c656e){_0xaf5b36=_0xaf5b36-0x0;var _0x35ce92=_0x2a3d[_0xaf5b36];return _0x35ce92;};'use strict';var client=require(_0xd2a3('0x0'));exports['getSettings']=function(){return client['Request'](_0xd2a3('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xd2a3('0x2')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 916617c..3b12e6a 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'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 418d8e9..058706c 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 _0xaa2b=['redis','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','../../config/environment','createServer','timeout','listen','port','socket.io','polling'];(function(_0x1f8223,_0x2e2b29){var _0x4aa535=function(_0x338b17){while(--_0x338b17){_0x1f8223['push'](_0x1f8223['shift']());}};_0x4aa535(++_0x2e2b29);}(_0xaa2b,0x16c));var _0xbaa2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xaa2b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xbaa2('0x0'));var http=require(_0xbaa2('0x1'));var express=require(_0xbaa2('0x2'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0xbaa2('0x3'));var app=express();var server=http[_0xbaa2('0x4')](app);server[_0xbaa2('0x5')]=0xdbba0;if(sticky[_0xbaa2('0x6')](server,config[_0xbaa2('0x7')])){var socketio=require(_0xbaa2('0x8'))(server,{'transports':['websocket',_0xbaa2('0x9')]});config['redis']=_['defaults'](config[_0xbaa2('0xa')],{'host':'localhost','port':0x18eb});socketio[_0xbaa2('0xb')](require(_0xbaa2('0xc'))({'pubClient':new Redis(config[_0xbaa2('0xa')]),'subClient':new Redis(config['redis'])}));require(_0xbaa2('0xd'))[_0xbaa2('0xe')]();require(_0xbaa2('0xf'))[_0xbaa2('0xe')](socketio);require(_0xbaa2('0x10'))[_0xbaa2('0xe')](app);require('../../routes')[_0xbaa2('0xe')](app);}else{server[_0xbaa2('0x11')](_0xbaa2('0x12'),function(){console[_0xbaa2('0x13')](_0xbaa2('0x14'),config['port']);});}exports=module[_0xbaa2('0x15')]=app; \ No newline at end of file +var _0xe682=['socket.io','polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','../../config/environment','createServer','timeout','port'];(function(_0x4fd9b9,_0x4baad2){var _0x41907a=function(_0x9d862a){while(--_0x9d862a){_0x4fd9b9['push'](_0x4fd9b9['shift']());}};_0x41907a(++_0x4baad2);}(_0xe682,0x68));var _0x2e68=function(_0x1477d1,_0x3f558e){_0x1477d1=_0x1477d1-0x0;var _0x5f291a=_0xe682[_0x1477d1];return _0x5f291a;};'use strict';var _=require(_0x2e68('0x0'));var http=require('http');var express=require(_0x2e68('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require(_0x2e68('0x2'));var app=express();var server=http[_0x2e68('0x3')](app);server[_0x2e68('0x4')]=0xdbba0;if(sticky['listen'](server,config[_0x2e68('0x5')])){var socketio=require(_0x2e68('0x6'))(server,{'transports':['websocket',_0x2e68('0x7')]});config[_0x2e68('0x8')]=_[_0x2e68('0x9')](config[_0x2e68('0x8')],{'host':_0x2e68('0xa'),'port':0x18eb});socketio[_0x2e68('0xb')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x2e68('0x8')])}));require(_0x2e68('0xc'))[_0x2e68('0xd')]();require(_0x2e68('0xe'))['default'](socketio);require(_0x2e68('0xf'))[_0x2e68('0xd')](app);require(_0x2e68('0x10'))[_0x2e68('0xd')](app);}else{server[_0x2e68('0x11')](_0x2e68('0x12'),function(){console[_0x2e68('0x13')](_0x2e68('0x14'),config['port']);});}exports=module[_0x2e68('0x15')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 7a9a8c9..9ea7fdb 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 _0xd3a1=['routing','client','Request','request','then','debug','rpc','error','message','result','catch','jayson/promise','bluebird'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xd3a1,0x177));var _0x1d3a=function(_0x2927d3,_0xbe5e9d){_0x2927d3=_0x2927d3-0x0;var _0x1d2f8f=_0xd3a1[_0x2927d3];return _0x1d2f8f;};'use strict';var jayson=require(_0x1d3a('0x0'));var BPromise=require(_0x1d3a('0x1'));var logger=require('../../config/logger')(_0x1d3a('0x2'));var client=jayson[_0x1d3a('0x3')]['http']({'port':0x2329});client[_0x1d3a('0x4')]=function(_0x5ce955,_0x11868e){return new BPromise(function(_0x51bab0,_0x190c99){return client[_0x1d3a('0x5')](_0x5ce955,_0x11868e)[_0x1d3a('0x6')](function(_0x5814bf){logger[_0x1d3a('0x7')](_0x1d3a('0x8'),_0x1d3a('0x2'),_0x5ce955,_0x11868e,_0x5814bf);if(_0x5814bf[_0x1d3a('0x9')]){logger[_0x1d3a('0x9')](_0x1d3a('0x8'),_0x1d3a('0x2'),_0x5ce955,_0x5814bf[_0x1d3a('0x9')]['message'],_0x11868e);return _0x190c99(_0x5814bf[_0x1d3a('0x9')][_0x1d3a('0xa')]);}else{return _0x51bab0(_0x5814bf[_0x1d3a('0xb')]);}})[_0x1d3a('0xc')](function(_0xbba814){logger['error'](_0x1d3a('0x8'),_0x1d3a('0x2'),_0x5ce955,_0xbba814,_0x11868e);return _0x190c99(_0xbba814);});});};module['exports']=client; \ No newline at end of file +var _0x5879=['jayson/promise','bluebird','../../config/logger','routing','http','Request','then','debug','rpc','error','message','exports'];(function(_0x12feee,_0x30f943){var _0x31cbaf=function(_0x5cc21b){while(--_0x5cc21b){_0x12feee['push'](_0x12feee['shift']());}};_0x31cbaf(++_0x30f943);}(_0x5879,0x174));var _0x9587=function(_0x503a0f,_0x302fe2){_0x503a0f=_0x503a0f-0x0;var _0x2e9754=_0x5879[_0x503a0f];return _0x2e9754;};'use strict';var jayson=require(_0x9587('0x0'));var BPromise=require(_0x9587('0x1'));var logger=require(_0x9587('0x2'))(_0x9587('0x3'));var client=jayson['client'][_0x9587('0x4')]({'port':0x2329});client[_0x9587('0x5')]=function(_0xe54be8,_0x4c0fa9){return new BPromise(function(_0x53df77,_0x1bb3b4){return client['request'](_0xe54be8,_0x4c0fa9)[_0x9587('0x6')](function(_0x29abfb){logger[_0x9587('0x7')](_0x9587('0x8'),_0x9587('0x3'),_0xe54be8,_0x4c0fa9,_0x29abfb);if(_0x29abfb[_0x9587('0x9')]){logger[_0x9587('0x9')]('rpc',_0x9587('0x3'),_0xe54be8,_0x29abfb[_0x9587('0x9')][_0x9587('0xa')],_0x4c0fa9);return _0x1bb3b4(_0x29abfb['error']['message']);}else{return _0x53df77(_0x29abfb['result']);}})['catch'](function(_0x41e401){logger[_0x9587('0x9')](_0x9587('0x8'),_0x9587('0x3'),_0xe54be8,_0x41e401,_0x4c0fa9);return _0x1bb3b4(_0x41e401);});});};module[_0x9587('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index c216471..55aa763 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 _0x80e1=['getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','getFaxQueues','initFaxQueues'];(function(_0x5c45de,_0x5f4219){var _0x3952fb=function(_0x3f4d31){while(--_0x3f4d31){_0x5c45de['push'](_0x5c45de['shift']());}};_0x3952fb(++_0x5f4219);}(_0x80e1,0x14a));var _0x180e=function(_0x11f2f6,_0x2ff996){_0x11f2f6=_0x11f2f6-0x0;var _0x116d22=_0x80e1[_0x11f2f6];return _0x116d22;};'use strict';var BPromise=require('bluebird');var server=require(_0x180e('0x0'));var Realtime=require(_0x180e('0x1'));var user=require(_0x180e('0x2'));var interval=require(_0x180e('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x180e('0x4'));var smsQueue=require(_0x180e('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x180e('0x6'));var whatsappQueue=require(_0x180e('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x180e('0x8')](user[_0x180e('0x9')]())[_0x180e('0x8')](realtime[_0x180e('0xa')]())[_0x180e('0x8')](interval[_0x180e('0xb')]())['then'](realtime[_0x180e('0xc')]())[_0x180e('0x8')](openchannelQueue[_0x180e('0xd')]())[_0x180e('0x8')](realtime['initOpenchannelQueues']())[_0x180e('0x8')](chatQueue[_0x180e('0xe')]())['then'](realtime[_0x180e('0xf')]())['then'](smsQueue[_0x180e('0x10')]())[_0x180e('0x8')](realtime['initSmsQueues']())['then'](mailQueue[_0x180e('0x11')]())[_0x180e('0x8')](realtime['initMailQueues']())['then'](faxQueue[_0x180e('0x12')]())[_0x180e('0x8')](realtime[_0x180e('0x13')]())['then'](whatsappQueue[_0x180e('0x14')]())[_0x180e('0x8')](realtime[_0x180e('0x15')]())[_0x180e('0x8')](function(){return realtime;});}function main(){return server[_0x180e('0x16')](realtime)[_0x180e('0x8')](function(_0x47953d){return initRealtime();})[_0x180e('0x8')](function(_0xdfc151){return setInterval(initRealtime,0x1388);})[_0x180e('0x17')](function(_0x46e20e){console[_0x180e('0x18')](_0x46e20e);});}main(); \ No newline at end of file +var _0xcb59=['./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue'];(function(_0x304d63,_0x381351){var _0x514349=function(_0x4994bd){while(--_0x4994bd){_0x304d63['push'](_0x304d63['shift']());}};_0x514349(++_0x381351);}(_0xcb59,0x191));var _0x9cb5=function(_0x271fff,_0x2c99a7){_0x271fff=_0x271fff-0x0;var _0x3a8cc1=_0xcb59[_0x271fff];return _0x3a8cc1;};'use strict';var BPromise=require('bluebird');var server=require(_0x9cb5('0x0'));var Realtime=require(_0x9cb5('0x1'));var user=require(_0x9cb5('0x2'));var interval=require(_0x9cb5('0x3'));var openchannelQueue=require(_0x9cb5('0x4'));var chatQueue=require(_0x9cb5('0x5'));var smsQueue=require(_0x9cb5('0x6'));var mailQueue=require(_0x9cb5('0x7'));var faxQueue=require(_0x9cb5('0x8'));var whatsappQueue=require(_0x9cb5('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9cb5('0xa')]()[_0x9cb5('0xb')](user[_0x9cb5('0xc')]())[_0x9cb5('0xb')](realtime[_0x9cb5('0xd')]())[_0x9cb5('0xb')](interval[_0x9cb5('0xe')]())[_0x9cb5('0xb')](realtime[_0x9cb5('0xf')]())[_0x9cb5('0xb')](openchannelQueue[_0x9cb5('0x10')]())[_0x9cb5('0xb')](realtime[_0x9cb5('0x11')]())[_0x9cb5('0xb')](chatQueue['getChatQueues']())['then'](realtime[_0x9cb5('0x12')]())['then'](smsQueue['getSmsQueues']())[_0x9cb5('0xb')](realtime[_0x9cb5('0x13')]())[_0x9cb5('0xb')](mailQueue[_0x9cb5('0x14')]())[_0x9cb5('0xb')](realtime[_0x9cb5('0x15')]())[_0x9cb5('0xb')](faxQueue[_0x9cb5('0x16')]())[_0x9cb5('0xb')](realtime[_0x9cb5('0x17')]())[_0x9cb5('0xb')](whatsappQueue[_0x9cb5('0x18')]())[_0x9cb5('0xb')](realtime[_0x9cb5('0x19')]())[_0x9cb5('0xb')](function(){return realtime;});}function main(){return server[_0x9cb5('0x1a')](realtime)[_0x9cb5('0xb')](function(_0x5a09d9){return initRealtime();})['then'](function(_0x283a99){return setInterval(initRealtime,0x1388);})[_0x9cb5('0x1b')](function(_0x3c7809){console[_0x9cb5('0x1c')](_0x3c7809);});}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 537461e..2f58232 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x1fa6ff,_0xf15124){var _0x1d7b95=function(_0x134e1d){while(--_0x134e1d){_0x1fa6ff['push'](_0x1fa6ff['shift']());}};_0x1d7b95(++_0xf15124);}(_0xe14b,0x93));var _0xbe14=function(_0x6e7432,_0x358bd0){_0x6e7432=_0x6e7432-0x0;var _0x361528=_0xe14b[_0x6e7432];return _0x361528;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x1261[_0x3305de];return _0x3b5a84;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 2b1bd7d..1ffa3bb 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 _0x4fcf=['catch','sendMailMessage','bluebird','jayson/promise','client','http','request','then','error','result'];(function(_0x4f5de4,_0x286cb4){var _0x57b780=function(_0x489554){while(--_0x489554){_0x4f5de4['push'](_0x4f5de4['shift']());}};_0x57b780(++_0x286cb4);}(_0x4fcf,0x70));var _0xf4fc=function(_0x5a84c1,_0x50f737){_0x5a84c1=_0x5a84c1-0x0;var _0x4bf171=_0x4fcf[_0x5a84c1];return _0x4bf171;};'use strict';var BPromise=require(_0xf4fc('0x0'));var jayson=require(_0xf4fc('0x1'));var client=jayson[_0xf4fc('0x2')][_0xf4fc('0x3')]({'port':0x232b});function request(_0x370f61,_0x3b319b){return new BPromise(function(_0x163465,_0x9fcd1a){return client[_0xf4fc('0x4')](_0x370f61,_0x3b319b)[_0xf4fc('0x5')](function(_0x1de570){if(_0x1de570[_0xf4fc('0x6')]){return _0x9fcd1a(_0x1de570['error']['message']);}else{return _0x163465(_0x1de570[_0xf4fc('0x7')]);}})[_0xf4fc('0x8')](function(_0x2e9896){return _0x9fcd1a(_0x2e9896);});});}exports[_0xf4fc('0x9')]=function(_0x10c3c7,_0x5c3ae9){return request('SendMail',{'account':_0x10c3c7,'message':_0x5c3ae9});}; \ No newline at end of file +var _0x96b9=['request','error','message','result','SendMail','bluebird','jayson/promise','http'];(function(_0x3e66b8,_0x5be705){var _0x12acc8=function(_0x40ca15){while(--_0x40ca15){_0x3e66b8['push'](_0x3e66b8['shift']());}};_0x12acc8(++_0x5be705);}(_0x96b9,0x85));var _0x996b=function(_0x181b80,_0x4c1697){_0x181b80=_0x181b80-0x0;var _0x3978b5=_0x96b9[_0x181b80];return _0x3978b5;};'use strict';var BPromise=require(_0x996b('0x0'));var jayson=require(_0x996b('0x1'));var client=jayson['client'][_0x996b('0x2')]({'port':0x232b});function request(_0x3fca7a,_0x4e5ad4){return new BPromise(function(_0x478dee,_0x4d4898){return client[_0x996b('0x3')](_0x3fca7a,_0x4e5ad4)['then'](function(_0x3ead73){if(_0x3ead73['error']){return _0x4d4898(_0x3ead73[_0x996b('0x4')][_0x996b('0x5')]);}else{return _0x478dee(_0x3ead73[_0x996b('0x6')]);}})['catch'](function(_0x1c9d5a){return _0x4d4898(_0x1c9d5a);});});}exports['sendMailMessage']=function(_0xf401ac,_0x4a3511){return request(_0x996b('0x7'),{'account':_0xf401ac,'message':_0x4a3511});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index f83cae6..867136b 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 _0x3e03=['localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','md5','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','openchannel','sms','whatsapp','length','Status','StatusTime','format','chatStatusTime','mailStatus','faxCapacity','whatsappCurrentCapacity','busy','chatWaitingInteractions','stringify','user:save','exports','lodash','moment','../../../config/environment','defaults','redis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e03,0xf7));var _0x33e0=function(_0x414f67,_0x861aed){_0x414f67=_0x414f67-0x0;var _0x338537=_0x3e03[_0x414f67];return _0x338537;};'use strict';var _=require(_0x33e0('0x0'));var moment=require(_0x33e0('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x33e0('0x2'));config['redis']=_[_0x33e0('0x3')](config[_0x33e0('0x4')],{'host':_0x33e0('0x5'),'port':0x18eb});var io=require(_0x33e0('0x6'))(new Redis(config[_0x33e0('0x4')]));function Agent(_0x16c535){this['id']=_0x16c535['id']||0x0;this[_0x33e0('0x7')]=_0x16c535[_0x33e0('0x7')]||'';this[_0x33e0('0x8')]=_0x16c535['online']||!![];this[_0x33e0('0x9')]=_0x16c535['voicePause']||![];this[_0x33e0('0xa')]=_0x16c535['chatPause']||![];this[_0x33e0('0xb')]=_0x16c535[_0x33e0('0xb')]||![];this[_0x33e0('0xc')]=_0x16c535[_0x33e0('0xc')]||![];this[_0x33e0('0xd')]=_0x16c535[_0x33e0('0xd')]||![];this[_0x33e0('0xe')]=_0x16c535[_0x33e0('0xe')]||![];this[_0x33e0('0xf')]=_0x33e0('0x10');this['chatStatusTime']=0x0;this[_0x33e0('0x11')]=_0x16c535[_0x33e0('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']='unknown';this[_0x33e0('0x12')]=0x0;this[_0x33e0('0x13')]=_0x16c535['mailCapacity']||0x0;this[_0x33e0('0x14')]=0x0;this['faxStatus']=_0x33e0('0x10');this[_0x33e0('0x15')]=0x0;this['faxCapacity']=_0x16c535['faxCapacity']||0x0;this[_0x33e0('0x16')]=0x0;this[_0x33e0('0x17')]=_0x33e0('0x10');this[_0x33e0('0x18')]=0x0;this[_0x33e0('0x19')]=_0x16c535[_0x33e0('0x19')]||0x0;this[_0x33e0('0x1a')]=0x0;this['whatsappStatus']='unknown';this[_0x33e0('0x1b')]=0x0;this['whatsappCapacity']=_0x16c535[_0x33e0('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x33e0('0x1d')]=_0x33e0('0x10');this[_0x33e0('0x1e')]=0x0;this[_0x33e0('0x1f')]=_0x16c535[_0x33e0('0x1f')]||0x0;this[_0x33e0('0x20')]=0x0;this['busy']=![];this[_0x33e0('0x21')]=undefined;this[_0x33e0('0x22')]='';this['chatWaitingInteractions']={};this[_0x33e0('0x23')]={};this[_0x33e0('0x24')]={};this[_0x33e0('0x25')]={};this[_0x33e0('0x26')]={};this[_0x33e0('0x27')]={};this[_0x33e0('0x28')]();}Agent[_0x33e0('0x29')][_0x33e0('0x2a')]=function(_0x8a3e0d){if(this[_0x8a3e0d+_0x33e0('0x2b')]>0x0){if(this[_0x8a3e0d+_0x33e0('0x2c')]>0x0&&this[_0x8a3e0d+_0x33e0('0x2b')]>=this[_0x8a3e0d+_0x33e0('0x2c')]){return _0x33e0('0x2d');}else{return'working';}}else{return _0x33e0('0x2e');}};Agent[_0x33e0('0x29')][_0x33e0('0x28')]=function(){var _0x3abea2=['mail','chat',_0x33e0('0x2f'),'fax',_0x33e0('0x30'),_0x33e0('0x31')];for(var _0x38fa51=0x0;_0x38fa51<_0x3abea2[_0x33e0('0x32')];_0x38fa51+=0x1){var _0xab7110=this[_0x33e0('0x2a')](_0x3abea2[_0x38fa51]);if(this[_0x3abea2[_0x38fa51]+_0x33e0('0x33')]!==_0xab7110){this[_0x3abea2[_0x38fa51]+_0x33e0('0x34')]=_['toNumber'](moment()[_0x33e0('0x35')]('x'));}this[_0x3abea2[_0x38fa51]+_0x33e0('0x33')]=_0xab7110;}var _0x6ba08={'id':this['id'],'name':this[_0x33e0('0x7')],'online':this['online'],'voicePause':this[_0x33e0('0x9')],'chatPause':this[_0x33e0('0xa')],'mailPause':this[_0x33e0('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x33e0('0xc')],'openchannelPause':this[_0x33e0('0xe')],'chatStatus':this[_0x33e0('0xf')],'chatStatusTime':this[_0x33e0('0x36')],'chatCapacity':this[_0x33e0('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x33e0('0x37')],'mailStatusTime':this[_0x33e0('0x12')],'mailCapacity':this[_0x33e0('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x33e0('0x38')],'faxCurrentCapacity':this[_0x33e0('0x16')],'smsStatus':this[_0x33e0('0x17')],'smsStatusTime':this[_0x33e0('0x18')],'smsCapacity':this[_0x33e0('0x19')],'smsCurrentCapacity':this[_0x33e0('0x1a')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x33e0('0x1b')],'whatsappCapacity':this[_0x33e0('0x1c')],'whatsappCurrentCapacity':this[_0x33e0('0x39')],'openchannelStatus':this[_0x33e0('0x1d')],'openchannelStatusTime':this[_0x33e0('0x1e')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x33e0('0x3a')],'busyQueue':this[_0x33e0('0x21')],'chatWaitingInteractions':this[_0x33e0('0x3b')],'faxWaitingInteractions':this[_0x33e0('0x23')],'mailWaitingInteractions':this[_0x33e0('0x24')],'openchannelWaitingInteractions':this[_0x33e0('0x25')],'smsWaitingInteractions':this[_0x33e0('0x26')],'whatsappWaitingInteractions':this[_0x33e0('0x27')]};var _0x20e1f9=md5(JSON[_0x33e0('0x3c')](_0x6ba08));if(this['md5']!==_0x20e1f9){this['md5']=_0x20e1f9;io['emit'](_0x33e0('0x3d'),_0x6ba08);}};module[_0x33e0('0x3e')]=Agent; \ No newline at end of file +var _0x9312=['whatsappStatus','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','CurrentCapacity','Capacity','maxcapacity','working','idle','prototype','chat','fax','whatsapp','length','Status','toNumber','format','mailCapacity','mailCurrentCapacity','faxCurrentCapacity','smsStatus','whatsappStatusTime','whatsappCurrentCapacity','faxWaitingInteractions','stringify','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','faxStatus','faxStatusTime','faxCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity'];(function(_0x3c2947,_0x473f08){var _0x360ab3=function(_0x59c37f){while(--_0x59c37f){_0x3c2947['push'](_0x3c2947['shift']());}};_0x360ab3(++_0x473f08);}(_0x9312,0x65));var _0x2931=function(_0x2c96f6,_0x877207){_0x2c96f6=_0x2c96f6-0x0;var _0x6d4808=_0x9312[_0x2c96f6];return _0x6d4808;};'use strict';var _=require(_0x2931('0x0'));var moment=require(_0x2931('0x1'));var md5=require(_0x2931('0x2'));var Redis=require(_0x2931('0x3'));var config=require(_0x2931('0x4'));config[_0x2931('0x5')]=_[_0x2931('0x6')](config[_0x2931('0x5')],{'host':_0x2931('0x7'),'port':0x18eb});var io=require(_0x2931('0x8'))(new Redis(config['redis']));function Agent(_0x57f9cb){this['id']=_0x57f9cb['id']||0x0;this[_0x2931('0x9')]=_0x57f9cb[_0x2931('0x9')]||'';this[_0x2931('0xa')]=_0x57f9cb[_0x2931('0xa')]||!![];this['voicePause']=_0x57f9cb[_0x2931('0xb')]||![];this[_0x2931('0xc')]=_0x57f9cb[_0x2931('0xc')]||![];this[_0x2931('0xd')]=_0x57f9cb[_0x2931('0xd')]||![];this[_0x2931('0xe')]=_0x57f9cb['faxPause']||![];this[_0x2931('0xf')]=_0x57f9cb[_0x2931('0xf')]||![];this['openchannelPause']=_0x57f9cb[_0x2931('0x10')]||![];this[_0x2931('0x11')]=_0x2931('0x12');this[_0x2931('0x13')]=0x0;this[_0x2931('0x14')]=_0x57f9cb[_0x2931('0x14')]||0x0;this[_0x2931('0x15')]=0x0;this['mailStatus']=_0x2931('0x12');this[_0x2931('0x16')]=0x0;this['mailCapacity']=_0x57f9cb['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x2931('0x17')]=_0x2931('0x12');this[_0x2931('0x18')]=0x0;this['faxCapacity']=_0x57f9cb[_0x2931('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0x2931('0x12');this[_0x2931('0x1a')]=0x0;this[_0x2931('0x1b')]=_0x57f9cb[_0x2931('0x1b')]||0x0;this[_0x2931('0x1c')]=0x0;this[_0x2931('0x1d')]=_0x2931('0x12');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x57f9cb[_0x2931('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x2931('0x1f')]=_0x2931('0x12');this[_0x2931('0x20')]=0x0;this[_0x2931('0x21')]=_0x57f9cb[_0x2931('0x21')]||0x0;this[_0x2931('0x22')]=0x0;this[_0x2931('0x23')]=![];this[_0x2931('0x24')]=undefined;this[_0x2931('0x2')]='';this[_0x2931('0x25')]={};this['faxWaitingInteractions']={};this[_0x2931('0x26')]={};this[_0x2931('0x27')]={};this[_0x2931('0x28')]={};this[_0x2931('0x29')]={};this['updateRealtime']();}Agent['prototype']['getChannelStatus']=function(_0x372aa2){if(this[_0x372aa2+_0x2931('0x2a')]>0x0){if(this[_0x372aa2+_0x2931('0x2b')]>0x0&&this[_0x372aa2+_0x2931('0x2a')]>=this[_0x372aa2+_0x2931('0x2b')]){return _0x2931('0x2c');}else{return _0x2931('0x2d');}}else{return _0x2931('0x2e');}};Agent[_0x2931('0x2f')]['updateRealtime']=function(){var _0x52ad39=['mail',_0x2931('0x30'),'openchannel',_0x2931('0x31'),'sms',_0x2931('0x32')];for(var _0x40c217=0x0;_0x40c217<_0x52ad39[_0x2931('0x33')];_0x40c217+=0x1){var _0x2d595a=this['getChannelStatus'](_0x52ad39[_0x40c217]);if(this[_0x52ad39[_0x40c217]+_0x2931('0x34')]!==_0x2d595a){this[_0x52ad39[_0x40c217]+'StatusTime']=_[_0x2931('0x35')](moment()[_0x2931('0x36')]('x'));}this[_0x52ad39[_0x40c217]+_0x2931('0x34')]=_0x2d595a;}var _0x93c8f0={'id':this['id'],'name':this[_0x2931('0x9')],'online':this[_0x2931('0xa')],'voicePause':this[_0x2931('0xb')],'chatPause':this[_0x2931('0xc')],'mailPause':this[_0x2931('0xd')],'smsPause':this[_0x2931('0xf')],'faxPause':this['faxPause'],'openchannelPause':this[_0x2931('0x10')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x2931('0x13')],'chatCapacity':this[_0x2931('0x14')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x2931('0x16')],'mailCapacity':this[_0x2931('0x37')],'mailCurrentCapacity':this[_0x2931('0x38')],'faxStatus':this[_0x2931('0x17')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x2931('0x19')],'faxCurrentCapacity':this[_0x2931('0x39')],'smsStatus':this[_0x2931('0x3a')],'smsStatusTime':this[_0x2931('0x1a')],'smsCapacity':this[_0x2931('0x1b')],'smsCurrentCapacity':this[_0x2931('0x1c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x2931('0x3b')],'whatsappCapacity':this[_0x2931('0x1e')],'whatsappCurrentCapacity':this[_0x2931('0x3c')],'openchannelStatus':this[_0x2931('0x1f')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x2931('0x21')],'openchannelCurrentCapacity':this[_0x2931('0x22')],'busy':this[_0x2931('0x23')],'busyQueue':this[_0x2931('0x24')],'chatWaitingInteractions':this[_0x2931('0x25')],'faxWaitingInteractions':this[_0x2931('0x3d')],'mailWaitingInteractions':this[_0x2931('0x26')],'openchannelWaitingInteractions':this[_0x2931('0x27')],'smsWaitingInteractions':this[_0x2931('0x28')],'whatsappWaitingInteractions':this[_0x2931('0x29')]};var _0x336ea0=md5(JSON[_0x2931('0x3e')](_0x93c8f0));if(this[_0x2931('0x2')]!==_0x336ea0){this[_0x2931('0x2')]=_0x336ea0;io['emit'](_0x2931('0x3f'),_0x93c8f0);}};module[_0x2931('0x40')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index bca4178..1f88e19 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 _0x58b7=['md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','chatPause','paused','available','stringify','format','chat:queue:%s','chat_queue:save','exports','lodash'];(function(_0x4fee31,_0x6905e3){var _0x27d650=function(_0x583e4e){while(--_0x583e4e){_0x4fee31['push'](_0x4fee31['shift']());}};_0x27d650(++_0x6905e3);}(_0x58b7,0x178));var _0x758b=function(_0x1a2e2e,_0x369a71){_0x1a2e2e=_0x1a2e2e-0x0;var _0x3c38b7=_0x58b7[_0x1a2e2e];return _0x3c38b7;};'use strict';var _=require(_0x758b('0x0'));var md5=require(_0x758b('0x1'));var util=require('util');var Redis=require(_0x758b('0x2'));var config=require(_0x758b('0x3'));config[_0x758b('0x4')]=_[_0x758b('0x5')](config[_0x758b('0x4')],{'host':_0x758b('0x6'),'port':0x18eb});var io=require(_0x758b('0x7'))(new Redis(config[_0x758b('0x4')]));function ChatQueue(_0xf53595){this['id']=_0xf53595['id']||0x0;this['name']=_0xf53595[_0x758b('0x8')]||'';this[_0x758b('0x9')]=_0xf53595[_0x758b('0x9')]||0xa;this[_0x758b('0xa')]=_0xf53595['strategy']||'beepall';this[_0x758b('0xb')]=_0xf53595['Agents'];this[_0x758b('0xc')]={};this[_0x758b('0xd')]=0x0;this[_0x758b('0x1')]='';this[_0x758b('0xe')]();this[_0x758b('0xf')]();}ChatQueue[_0x758b('0x10')][_0x758b('0xe')]=function(){var _0x5b4ffb=this[_0x758b('0xc')][_0x758b('0x11')];this['mapAgentsId']=_[_0x758b('0x12')](this[_0x758b('0xb')],'id');this[_0x758b('0xc')][_0x758b('0x11')]=_0x5b4ffb;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x758b('0x13')]=0x0;this['paused']=0x0;for(var _0xebb875=0x0;_0xebb875=0x0?this[_0x758b('0x17')]:0x0;var _0x20662b={'id':this['id'],'available':this[_0x758b('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x758b('0x8')],'paused':this[_0x758b('0x16')],'waiting':this[_0x758b('0xd')]};var _0x3edede=md5(JSON[_0x758b('0x18')](_0x20662b));if(this[_0x758b('0x1')]!==_0x3edede){this[_0x758b('0x1')]=_0x3edede;io['to'](util[_0x758b('0x19')](_0x758b('0x1a'),_0x20662b[_0x758b('0x8')]))['emit'](_0x758b('0x1b'),_0x20662b);}};module[_0x758b('0x1c')]=ChatQueue; \ No newline at end of file +var _0x8f35=['ioredis','redis','defaults','localhost','socket.io-emitter','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','chatPause','available','name','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util'];(function(_0x483163,_0x31f8d2){var _0x4b7b6d=function(_0x2b6233){while(--_0x2b6233){_0x483163['push'](_0x483163['shift']());}};_0x4b7b6d(++_0x31f8d2);}(_0x8f35,0x1b0));var _0x58f3=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x8f35[_0x32b542];return _0x554d54;};'use strict';var _=require(_0x58f3('0x0'));var md5=require(_0x58f3('0x1'));var util=require(_0x58f3('0x2'));var Redis=require(_0x58f3('0x3'));var config=require('../../../config/environment');config[_0x58f3('0x4')]=_[_0x58f3('0x5')](config[_0x58f3('0x4')],{'host':_0x58f3('0x6'),'port':0x18eb});var io=require(_0x58f3('0x7'))(new Redis(config[_0x58f3('0x4')]));function ChatQueue(_0x31a953){this['id']=_0x31a953['id']||0x0;this['name']=_0x31a953['name']||'';this['timeout']=_0x31a953[_0x58f3('0x8')]||0xa;this[_0x58f3('0x9')]=_0x31a953[_0x58f3('0x9')]||'beepall';this[_0x58f3('0xa')]=_0x31a953[_0x58f3('0xa')];this[_0x58f3('0xb')]={};this[_0x58f3('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0x58f3('0xd')]();}ChatQueue[_0x58f3('0xe')]['updateRouting']=function(){var _0x59ed89=this[_0x58f3('0xb')][_0x58f3('0xf')];this[_0x58f3('0xb')]=_[_0x58f3('0x10')](this[_0x58f3('0xa')],'id');this[_0x58f3('0xb')][_0x58f3('0xf')]=_0x59ed89;};ChatQueue[_0x58f3('0xe')]['updateRealtime']=function(){this[_0x58f3('0x11')]=0x0;this[_0x58f3('0x12')]=0x0;for(var _0x2599fd=0x0;_0x2599fd=0x0?this[_0x58f3('0x16')]:0x0;var _0x29ec8f={'id':this['id'],'available':this[_0x58f3('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x58f3('0x17')],'paused':this[_0x58f3('0x12')],'waiting':this[_0x58f3('0xc')]};var _0x8968cc=md5(JSON['stringify'](_0x29ec8f));if(this[_0x58f3('0x1')]!==_0x8968cc){this['md5']=_0x8968cc;io['to'](util[_0x58f3('0x18')](_0x58f3('0x19'),_0x29ec8f[_0x58f3('0x17')]))[_0x58f3('0x1a')](_0x58f3('0x1b'),_0x29ec8f);}};module[_0x58f3('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 024df1b..fdf7092 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 _0x3fb5=['md5','util','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','_rr','mapAgentsId','map','prototype','loggedIn','paused','online','faxPause','available','fax:queue:%s','emit','fax_queue:save','lodash'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x3fb5,0x81));var _0x53fb=function(_0x3c7be2,_0xf34efd){_0x3c7be2=_0x3c7be2-0x0;var _0x2a1968=_0x3fb5[_0x3c7be2];return _0x2a1968;};'use strict';var _=require(_0x53fb('0x0'));var md5=require(_0x53fb('0x1'));var util=require(_0x53fb('0x2'));var Redis=require('ioredis');var config=require(_0x53fb('0x3'));config['redis']=_[_0x53fb('0x4')](config[_0x53fb('0x5')],{'host':_0x53fb('0x6'),'port':0x18eb});var io=require(_0x53fb('0x7'))(new Redis(config['redis']));function FaxQueue(_0x305f67){this['id']=_0x305f67['id']||0x0;this[_0x53fb('0x8')]=_0x305f67[_0x53fb('0x8')]||'';this['timeout']=_0x305f67['timeout']||0xa;this[_0x53fb('0x9')]=_0x305f67[_0x53fb('0x9')]||_0x53fb('0xa');this[_0x53fb('0xb')]=_0x305f67[_0x53fb('0xb')];this['mapAgentsId']={};this[_0x53fb('0xc')]=0x0;this[_0x53fb('0x1')]='';this[_0x53fb('0xd')]();this['updateRealtime']();}FaxQueue['prototype']['updateRouting']=function(){var _0x3cf926=this['mapAgentsId'][_0x53fb('0xe')];this[_0x53fb('0xf')]=_[_0x53fb('0x10')](this[_0x53fb('0xb')],'id');this[_0x53fb('0xf')][_0x53fb('0xe')]=_0x3cf926;};FaxQueue[_0x53fb('0x11')]['updateRealtime']=function(){this[_0x53fb('0x12')]=0x0;this[_0x53fb('0x13')]=0x0;for(var _0x1637e5=0x0;_0x1637e5=0x0?this[_0x53fb('0x16')]:0x0;var _0x522102={'id':this['id'],'available':this[_0x53fb('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x53fb('0x8')],'paused':this[_0x53fb('0x13')],'waiting':this[_0x53fb('0xc')]};var _0x22635a=md5(JSON['stringify'](_0x522102));if(this[_0x53fb('0x1')]!==_0x22635a){this[_0x53fb('0x1')]=_0x22635a;io['to'](util['format'](_0x53fb('0x17'),_0x522102[_0x53fb('0x8')]))[_0x53fb('0x18')](_0x53fb('0x19'),_0x522102);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x3b24=['beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','faxPause','available','format','fax:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x460c41,_0x10df8e){var _0x19b931=function(_0x3c7c1f){while(--_0x3c7c1f){_0x460c41['push'](_0x460c41['shift']());}};_0x19b931(++_0x10df8e);}(_0x3b24,0x198));var _0x43b2=function(_0x121b02,_0x562855){_0x121b02=_0x121b02-0x0;var _0x2e1494=_0x3b24[_0x121b02];return _0x2e1494;};'use strict';var _=require(_0x43b2('0x0'));var md5=require(_0x43b2('0x1'));var util=require(_0x43b2('0x2'));var Redis=require(_0x43b2('0x3'));var config=require(_0x43b2('0x4'));config[_0x43b2('0x5')]=_[_0x43b2('0x6')](config[_0x43b2('0x5')],{'host':_0x43b2('0x7'),'port':0x18eb});var io=require(_0x43b2('0x8'))(new Redis(config[_0x43b2('0x5')]));function FaxQueue(_0x12a940){this['id']=_0x12a940['id']||0x0;this[_0x43b2('0x9')]=_0x12a940[_0x43b2('0x9')]||'';this[_0x43b2('0xa')]=_0x12a940[_0x43b2('0xa')]||0xa;this[_0x43b2('0xb')]=_0x12a940['strategy']||_0x43b2('0xc');this[_0x43b2('0xd')]=_0x12a940['Agents'];this[_0x43b2('0xe')]={};this[_0x43b2('0xf')]=0x0;this['md5']='';this['updateRouting']();this[_0x43b2('0x10')]();}FaxQueue[_0x43b2('0x11')][_0x43b2('0x12')]=function(){var _0x932a56=this['mapAgentsId'][_0x43b2('0x13')];this[_0x43b2('0xe')]=_[_0x43b2('0x14')](this[_0x43b2('0xd')],'id');this['mapAgentsId']['_rr']=_0x932a56;};FaxQueue['prototype'][_0x43b2('0x10')]=function(){this[_0x43b2('0x15')]=0x0;this[_0x43b2('0x16')]=0x0;for(var _0x41cef2=0x0;_0x41cef2=0x0?this[_0x43b2('0x1a')]:0x0;var _0x34776f={'id':this['id'],'available':this[_0x43b2('0x1a')],'loggedIn':this[_0x43b2('0x15')],'name':this[_0x43b2('0x9')],'paused':this[_0x43b2('0x16')],'waiting':this['waiting']};var _0x3c13c2=md5(JSON['stringify'](_0x34776f));if(this[_0x43b2('0x1')]!==_0x3c13c2){this[_0x43b2('0x1')]=_0x3c13c2;io['to'](util[_0x43b2('0x1b')](_0x43b2('0x1c'),_0x34776f[_0x43b2('0x9')]))[_0x43b2('0x1d')]('fax_queue:save',_0x34776f);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index b2ba9ed..4faec7f 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 _0x3e91=['exports','name','Intervals'];(function(_0x1aa2a3,_0x54ffda){var _0x5c43d0=function(_0x5def83){while(--_0x5def83){_0x1aa2a3['push'](_0x1aa2a3['shift']());}};_0x5c43d0(++_0x54ffda);}(_0x3e91,0x1db));var _0x13e9=function(_0x3a235a,_0x1e593f){_0x3a235a=_0x3a235a-0x0;var _0x1a6e21=_0x3e91[_0x3a235a];return _0x1a6e21;};'use strict';function Interval(_0x4cbcea){this['id']=_0x4cbcea['id']||0x0;this['name']=_0x4cbcea[_0x13e9('0x0')]||'';this['Intervals']=_0x4cbcea[_0x13e9('0x1')]||{};}module[_0x13e9('0x2')]=Interval; \ No newline at end of file +var _0x9d32=['exports','name','Intervals'];(function(_0x2e4059,_0x320e40){var _0x550713=function(_0x40b1a3){while(--_0x40b1a3){_0x2e4059['push'](_0x2e4059['shift']());}};_0x550713(++_0x320e40);}(_0x9d32,0xeb));var _0x29d3=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x9d32[_0x4350c2];return _0x8b6406;};'use strict';function Interval(_0x548543){this['id']=_0x548543['id']||0x0;this[_0x29d3('0x0')]=_0x548543['name']||'';this[_0x29d3('0x1')]=_0x548543[_0x29d3('0x1')]||{};}module[_0x29d3('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 900cda8..58fa197 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 _0xa9fe=['online','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length'];(function(_0x23e129,_0x48d1cc){var _0xab1ebe=function(_0x431ed1){while(--_0x431ed1){_0x23e129['push'](_0x23e129['shift']());}};_0xab1ebe(++_0x48d1cc);}(_0xa9fe,0x1c9));var _0xea9f=function(_0x385650,_0x19ea51){_0x385650=_0x385650-0x0;var _0x129a00=_0xa9fe[_0x385650];return _0x129a00;};'use strict';var _=require(_0xea9f('0x0'));var md5=require(_0xea9f('0x1'));var util=require(_0xea9f('0x2'));var Redis=require(_0xea9f('0x3'));var config=require(_0xea9f('0x4'));config['redis']=_[_0xea9f('0x5')](config['redis'],{'host':_0xea9f('0x6'),'port':0x18eb});var io=require(_0xea9f('0x7'))(new Redis(config[_0xea9f('0x8')]));function MailQueue(_0x38e841){this['id']=_0x38e841['id']||0x0;this['name']=_0x38e841[_0xea9f('0x9')]||'';this[_0xea9f('0xa')]=_0x38e841['timeout']||0xa;this[_0xea9f('0xb')]=_0x38e841['strategy']||_0xea9f('0xc');this[_0xea9f('0xd')]=_0x38e841[_0xea9f('0xd')];this[_0xea9f('0xe')]={};this['waiting']=0x0;this[_0xea9f('0x1')]='';this[_0xea9f('0xf')]();this[_0xea9f('0x10')]();}MailQueue['prototype']['updateRouting']=function(){var _0x5cea5b=this['mapAgentsId'][_0xea9f('0x11')];this[_0xea9f('0xe')]=_[_0xea9f('0x12')](this[_0xea9f('0xd')],'id');this['mapAgentsId'][_0xea9f('0x11')]=_0x5cea5b;};MailQueue[_0xea9f('0x13')]['updateRealtime']=function(){this[_0xea9f('0x14')]=0x0;this[_0xea9f('0x15')]=0x0;for(var _0x329bd5=0x0;_0x329bd5=0x0?this[_0xea9f('0x18')]:0x0;var _0x4a063b={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xea9f('0x9')],'paused':this[_0xea9f('0x15')],'waiting':this[_0xea9f('0x19')]};var _0x202ea5=md5(JSON[_0xea9f('0x1a')](_0x4a063b));if(this[_0xea9f('0x1')]!==_0x202ea5){this[_0xea9f('0x1')]=_0x202ea5;io['to'](util[_0xea9f('0x1b')](_0xea9f('0x1c'),_0x4a063b['name']))[_0xea9f('0x1d')](_0xea9f('0x1e'),_0x4a063b);}};module[_0xea9f('0x1f')]=MailQueue; \ No newline at end of file +var _0x47d0=['defaults','localhost','name','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','loggedIn','paused','online','mailPause','available','stringify','format','emit','mail_queue:save','lodash','md5','../../../config/environment','redis'];(function(_0x438572,_0x51854b){var _0xa3edea=function(_0x57850b){while(--_0x57850b){_0x438572['push'](_0x438572['shift']());}};_0xa3edea(++_0x51854b);}(_0x47d0,0x1f4));var _0x047d=function(_0x52ceb7,_0x1f8e6d){_0x52ceb7=_0x52ceb7-0x0;var _0x173388=_0x47d0[_0x52ceb7];return _0x173388;};'use strict';var _=require(_0x047d('0x0'));var md5=require(_0x047d('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x047d('0x2'));config[_0x047d('0x3')]=_[_0x047d('0x4')](config[_0x047d('0x3')],{'host':_0x047d('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x047d('0x3')]));function MailQueue(_0x4d2ec0){this['id']=_0x4d2ec0['id']||0x0;this['name']=_0x4d2ec0[_0x047d('0x6')]||'';this['timeout']=_0x4d2ec0['timeout']||0xa;this['strategy']=_0x4d2ec0['strategy']||_0x047d('0x7');this[_0x047d('0x8')]=_0x4d2ec0[_0x047d('0x8')];this['mapAgentsId']={};this[_0x047d('0x9')]=0x0;this[_0x047d('0x1')]='';this[_0x047d('0xa')]();this[_0x047d('0xb')]();}MailQueue[_0x047d('0xc')][_0x047d('0xa')]=function(){var _0x56c4ef=this[_0x047d('0xd')][_0x047d('0xe')];this[_0x047d('0xd')]=_['map'](this[_0x047d('0x8')],'id');this[_0x047d('0xd')][_0x047d('0xe')]=_0x56c4ef;};MailQueue[_0x047d('0xc')]['updateRealtime']=function(){this[_0x047d('0xf')]=0x0;this[_0x047d('0x10')]=0x0;for(var _0x1f50ba=0x0;_0x1f50ba=0x0?this[_0x047d('0x13')]:0x0;var _0x34aef9={'id':this['id'],'available':this[_0x047d('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x047d('0x6')],'paused':this[_0x047d('0x10')],'waiting':this['waiting']};var _0x515fea=md5(JSON[_0x047d('0x14')](_0x34aef9));if(this[_0x047d('0x1')]!==_0x515fea){this[_0x047d('0x1')]=_0x515fea;io['to'](util[_0x047d('0x15')]('mail:queue:%s',_0x34aef9[_0x047d('0x6')]))[_0x047d('0x16')](_0x047d('0x17'),_0x34aef9);}};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 52ad506..063a57c 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(_0x472ec2,_0x283a46){var _0x2b6118=function(_0x8f7318){while(--_0x8f7318){_0x472ec2['push'](_0x472ec2['shift']());}};_0x2b6118(++_0x283a46);}(_0x814b,0x1a2));var _0xb814=function(_0x17ebb6,_0x465af7){_0x17ebb6=_0x17ebb6-0x0;var _0x32ec22=_0x814b[_0x17ebb6];return _0x32ec22;};'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 _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x5a3249,_0x47dece){var _0x4e1d83=function(_0x359dc3){while(--_0x359dc3){_0x5a3249['push'](_0x5a3249['shift']());}};_0x4e1d83(++_0x47dece);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1d3577,_0x17a32e){_0x1d3577=_0x1d3577-0x0;var _0x277d9a=_0x5fc3[_0x1d3577];return _0x277d9a;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 973c47d..c8012f9 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 _0x24cd=['beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','online','smsPause','available','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy'];(function(_0x21e434,_0x553872){var _0x5a5f43=function(_0x2ab1a9){while(--_0x2ab1a9){_0x21e434['push'](_0x21e434['shift']());}};_0x5a5f43(++_0x553872);}(_0x24cd,0x83));var _0xd24c=function(_0x46e849,_0x35d765){_0x46e849=_0x46e849-0x0;var _0x29bea7=_0x24cd[_0x46e849];return _0x29bea7;};'use strict';var _=require(_0xd24c('0x0'));var md5=require(_0xd24c('0x1'));var util=require('util');var Redis=require(_0xd24c('0x2'));var config=require('../../../config/environment');config[_0xd24c('0x3')]=_[_0xd24c('0x4')](config[_0xd24c('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xd24c('0x5'))(new Redis(config[_0xd24c('0x3')]));function SmsQueue(_0x47c9ea){this['id']=_0x47c9ea['id']||0x0;this[_0xd24c('0x6')]=_0x47c9ea[_0xd24c('0x6')]||'';this[_0xd24c('0x7')]=_0x47c9ea[_0xd24c('0x7')]||0xa;this[_0xd24c('0x8')]=_0x47c9ea[_0xd24c('0x8')]||_0xd24c('0x9');this[_0xd24c('0xa')]=_0x47c9ea['Agents'];this['mapAgentsId']={};this[_0xd24c('0xb')]=0x0;this[_0xd24c('0x1')]='';this[_0xd24c('0xc')]();this[_0xd24c('0xd')]();}SmsQueue[_0xd24c('0xe')][_0xd24c('0xc')]=function(){var _0x1060a3=this[_0xd24c('0xf')]['_rr'];this[_0xd24c('0xf')]=_[_0xd24c('0x10')](this['Agents'],'id');this[_0xd24c('0xf')][_0xd24c('0x11')]=_0x1060a3;};SmsQueue[_0xd24c('0xe')][_0xd24c('0xd')]=function(){this[_0xd24c('0x12')]=0x0;this[_0xd24c('0x13')]=0x0;for(var _0x2c29c6=0x0;_0x2c29c6=0x0?this[_0xd24c('0x16')]:0x0;var _0x524158={'id':this['id'],'available':this[_0xd24c('0x16')],'loggedIn':this[_0xd24c('0x12')],'name':this[_0xd24c('0x6')],'paused':this[_0xd24c('0x13')],'waiting':this['waiting']};var _0x35de97=md5(JSON['stringify'](_0x524158));if(this[_0xd24c('0x1')]!==_0x35de97){this[_0xd24c('0x1')]=_0x35de97;io['to'](util[_0xd24c('0x17')](_0xd24c('0x18'),_0x524158[_0xd24c('0x6')]))[_0xd24c('0x19')](_0xd24c('0x1a'),_0x524158);}};module[_0xd24c('0x1b')]=SmsQueue; \ No newline at end of file +var _0xc831=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','length','online','smsPause','paused','available','stringify','format','emit','md5','util'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0xc831,0x103));var _0x1c83=function(_0x361076,_0x41100a){_0x361076=_0x361076-0x0;var _0x3ebf94=_0xc831[_0x361076];return _0x3ebf94;};'use strict';var _=require('lodash');var md5=require(_0x1c83('0x0'));var util=require(_0x1c83('0x1'));var Redis=require(_0x1c83('0x2'));var config=require(_0x1c83('0x3'));config[_0x1c83('0x4')]=_[_0x1c83('0x5')](config[_0x1c83('0x4')],{'host':_0x1c83('0x6'),'port':0x18eb});var io=require(_0x1c83('0x7'))(new Redis(config[_0x1c83('0x4')]));function SmsQueue(_0x4fb4c3){this['id']=_0x4fb4c3['id']||0x0;this['name']=_0x4fb4c3[_0x1c83('0x8')]||'';this['timeout']=_0x4fb4c3[_0x1c83('0x9')]||0xa;this[_0x1c83('0xa')]=_0x4fb4c3[_0x1c83('0xa')]||_0x1c83('0xb');this[_0x1c83('0xc')]=_0x4fb4c3['Agents'];this[_0x1c83('0xd')]={};this[_0x1c83('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0x1c83('0xf')]();}SmsQueue[_0x1c83('0x10')][_0x1c83('0x11')]=function(){var _0x5db682=this[_0x1c83('0xd')]['_rr'];this['mapAgentsId']=_[_0x1c83('0x12')](this[_0x1c83('0xc')],'id');this[_0x1c83('0xd')][_0x1c83('0x13')]=_0x5db682;};SmsQueue[_0x1c83('0x10')][_0x1c83('0xf')]=function(){this[_0x1c83('0x14')]=0x0;this['paused']=0x0;for(var _0x43f74e=0x0;_0x43f74e=0x0?this[_0x1c83('0x19')]:0x0;var _0x1d6027={'id':this['id'],'available':this[_0x1c83('0x19')],'loggedIn':this[_0x1c83('0x14')],'name':this['name'],'paused':this[_0x1c83('0x18')],'waiting':this['waiting']};var _0x2d387d=md5(JSON[_0x1c83('0x1a')](_0x1d6027));if(this['md5']!==_0x2d387d){this[_0x1c83('0x0')]=_0x2d387d;io['to'](util[_0x1c83('0x1b')]('sms:queue:%s',_0x1d6027['name']))[_0x1c83('0x1c')]('sms_queue:save',_0x1d6027);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 87061ea..717d70f 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 _0x0b15=['available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length'];(function(_0x6bd228,_0x1b13d8){var _0xb0d3c9=function(_0x132b93){while(--_0x132b93){_0x6bd228['push'](_0x6bd228['shift']());}};_0xb0d3c9(++_0x1b13d8);}(_0x0b15,0xca));var _0x50b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b15[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x50b1('0x0'));var md5=require(_0x50b1('0x1'));var util=require(_0x50b1('0x2'));var Redis=require(_0x50b1('0x3'));var config=require(_0x50b1('0x4'));config[_0x50b1('0x5')]=_[_0x50b1('0x6')](config[_0x50b1('0x5')],{'host':_0x50b1('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x50b1('0x5')]));function WhatsappQueue(_0x517e09){this['id']=_0x517e09['id']||0x0;this[_0x50b1('0x8')]=_0x517e09[_0x50b1('0x8')]||'';this[_0x50b1('0x9')]=_0x517e09[_0x50b1('0x9')]||0xa;this[_0x50b1('0xa')]=_0x517e09['strategy']||_0x50b1('0xb');this[_0x50b1('0xc')]=_0x517e09[_0x50b1('0xc')];this[_0x50b1('0xd')]={};this[_0x50b1('0xe')]=0x0;this[_0x50b1('0x1')]='';this[_0x50b1('0xf')]();this[_0x50b1('0x10')]();}WhatsappQueue[_0x50b1('0x11')]['updateRouting']=function(){var _0x5d98e8=this[_0x50b1('0xd')][_0x50b1('0x12')];this[_0x50b1('0xd')]=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x5d98e8;};WhatsappQueue[_0x50b1('0x11')][_0x50b1('0x10')]=function(){this[_0x50b1('0x13')]=0x0;this[_0x50b1('0x14')]=0x0;for(var _0x305b53=0x0;_0x305b53=0x0?this[_0x50b1('0x16')]:0x0;var _0x4dbfd8={'id':this['id'],'available':this[_0x50b1('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x50b1('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x410dc5=md5(JSON['stringify'](_0x4dbfd8));if(this[_0x50b1('0x1')]!==_0x410dc5){this['md5']=_0x410dc5;io['to'](util[_0x50b1('0x17')](_0x50b1('0x18'),_0x4dbfd8[_0x50b1('0x8')]))[_0x50b1('0x19')](_0x50b1('0x1a'),_0x4dbfd8);}};module[_0x50b1('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x9121=['stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','paused','whatsappPause','available'];(function(_0x2d3206,_0x434cf5){var _0x18702d=function(_0x4e0735){while(--_0x4e0735){_0x2d3206['push'](_0x2d3206['shift']());}};_0x18702d(++_0x434cf5);}(_0x9121,0x1a9));var _0x1912=function(_0x183261,_0xaad4a4){_0x183261=_0x183261-0x0;var _0x336016=_0x9121[_0x183261];return _0x336016;};'use strict';var _=require(_0x1912('0x0'));var md5=require(_0x1912('0x1'));var util=require(_0x1912('0x2'));var Redis=require(_0x1912('0x3'));var config=require(_0x1912('0x4'));config['redis']=_[_0x1912('0x5')](config[_0x1912('0x6')],{'host':_0x1912('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1912('0x6')]));function WhatsappQueue(_0x10c621){this['id']=_0x10c621['id']||0x0;this[_0x1912('0x8')]=_0x10c621[_0x1912('0x8')]||'';this['timeout']=_0x10c621[_0x1912('0x9')]||0xa;this['strategy']=_0x10c621[_0x1912('0xa')]||_0x1912('0xb');this[_0x1912('0xc')]=_0x10c621[_0x1912('0xc')];this[_0x1912('0xd')]={};this[_0x1912('0xe')]=0x0;this[_0x1912('0x1')]='';this['updateRouting']();this[_0x1912('0xf')]();}WhatsappQueue[_0x1912('0x10')]['updateRouting']=function(){var _0x4cbd5f=this[_0x1912('0xd')][_0x1912('0x11')];this[_0x1912('0xd')]=_[_0x1912('0x12')](this[_0x1912('0xc')],'id');this[_0x1912('0xd')][_0x1912('0x11')]=_0x4cbd5f;};WhatsappQueue['prototype'][_0x1912('0xf')]=function(){this[_0x1912('0x13')]=0x0;this[_0x1912('0x14')]=0x0;for(var _0xcf905e=0x0;_0xcf905e=0x0?this[_0x1912('0x16')]:0x0;var _0xbe3b7={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x1912('0x8')],'paused':this[_0x1912('0x14')],'waiting':this['waiting']};var _0x4deb87=md5(JSON[_0x1912('0x17')](_0xbe3b7));if(this[_0x1912('0x1')]!==_0x4deb87){this[_0x1912('0x1')]=_0x4deb87;io['to'](util['format'](_0x1912('0x18'),_0xbe3b7[_0x1912('0x8')]))[_0x1912('0x19')](_0x1912('0x1a'),_0xbe3b7);}};module[_0x1912('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index ca998ea..478d34a 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(_0x6f8046,_0x226dbc){var _0x42511d=function(_0x49340a){while(--_0x49340a){_0x6f8046['push'](_0x6f8046['shift']());}};_0x42511d(++_0x226dbc);}(_0xb10b,0x12a));var _0xbb10=function(_0x353cd6,_0xc795f6){_0x353cd6=_0x353cd6-0x0;var _0x55712a=_0xb10b[_0x353cd6];return _0x55712a;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 a5e891f..94d9a20 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 _0xe5bf=['update','updateChatInteraction','addTags','Request','AddTagsToChatInteraction','../client'];(function(_0x166294,_0x175bc9){var _0x304968=function(_0x119ed1){while(--_0x119ed1){_0x166294['push'](_0x166294['shift']());}};_0x304968(++_0x175bc9);}(_0xe5bf,0x8f));var _0xfe5b=function(_0x2590d9,_0x1c9510){_0x2590d9=_0x2590d9-0x0;var _0x2fe909=_0xe5bf[_0x2590d9];return _0x2fe909;};'use strict';var client=require(_0xfe5b('0x0'));exports[_0xfe5b('0x1')]=function(_0x3b79a4,_0x47381d){return client['Request']('UpdateChatInteraction',{'body':_0x47381d,'options':{'where':{'id':_0x3b79a4}},'log':_0xfe5b('0x2')});};exports[_0xfe5b('0x3')]=function(_0x425f0d,_0x2e5758){return client[_0xfe5b('0x4')](_0xfe5b('0x5'),{'body':_0x2e5758,'options':{'where':{'id':_0x425f0d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x2c0d=['Request','UpdateChatInteraction','addTags','../client','update'];(function(_0x101750,_0x470859){var _0x25bd39=function(_0x240c72){while(--_0x240c72){_0x101750['push'](_0x101750['shift']());}};_0x25bd39(++_0x470859);}(_0x2c0d,0x80));var _0xd2c0=function(_0x5f5474,_0x5aa3c1){_0x5f5474=_0x5f5474-0x0;var _0x588fc1=_0x2c0d[_0x5f5474];return _0x588fc1;};'use strict';var client=require(_0xd2c0('0x0'));exports[_0xd2c0('0x1')]=function(_0x525ba5,_0x15249a){return client[_0xd2c0('0x2')](_0xd2c0('0x3'),{'body':_0x15249a,'options':{'where':{'id':_0x525ba5}},'log':'updateChatInteraction'});};exports[_0xd2c0('0x4')]=function(_0xdc2659,_0x50ab7a){return client['Request']('AddTagsToChatInteraction',{'body':_0x50ab7a,'options':{'where':{'id':_0xdc2659}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index b6bac27..c9d9c14 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 _0x36e8=['../client','create','Request','createChatMessage'];(function(_0x34f449,_0x296e64){var _0x3dc2a8=function(_0x165037){while(--_0x165037){_0x34f449['push'](_0x34f449['shift']());}};_0x3dc2a8(++_0x296e64);}(_0x36e8,0x174));var _0x836e=function(_0xaee28d,_0x37a9ff){_0xaee28d=_0xaee28d-0x0;var _0x3d6450=_0x36e8[_0xaee28d];return _0x3d6450;};'use strict';var client=require(_0x836e('0x0'));exports[_0x836e('0x1')]=function(_0x13b40c){return client[_0x836e('0x2')]('CreateChatMessage',{'body':_0x13b40c,'log':_0x836e('0x3')});}; \ No newline at end of file +var _0x5ece=['Request','createChatMessage','../client','create'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x5ece,0x146));var _0xe5ec=function(_0x1de06c,_0x30369f){_0x1de06c=_0x1de06c-0x0;var _0x62a916=_0x5ece[_0x1de06c];return _0x62a916;};'use strict';var client=require(_0xe5ec('0x0'));exports[_0xe5ec('0x1')]=function(_0x4d9369){return client[_0xe5ec('0x2')]('CreateChatMessage',{'body':_0x4d9369,'log':_0xe5ec('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 63f0d36..edd4ff2 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 _0xbd50=['Request','name','timeout','strategy','User','Agents','../client','getChatQueues'];(function(_0x3bc44d,_0x47f40a){var _0x5e9b5b=function(_0x46492d){while(--_0x46492d){_0x3bc44d['push'](_0x3bc44d['shift']());}};_0x5e9b5b(++_0x47f40a);}(_0xbd50,0x196));var _0x0bd5=function(_0x16c696,_0x2a7b16){_0x16c696=_0x16c696-0x0;var _0x559265=_0xbd50[_0x16c696];return _0x559265;};'use strict';var client=require(_0x0bd5('0x0'));exports[_0x0bd5('0x1')]=function(){return function(){return client[_0x0bd5('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x0bd5('0x3'),_0x0bd5('0x4'),_0x0bd5('0x5')],'include':[{'model':_0x0bd5('0x6'),'as':_0x0bd5('0x7'),'attributes':['id','name','online','chatPause']}]},'log':_0x0bd5('0x1')});};}; \ No newline at end of file +var _0xa4dc=['online','chatPause','../client','getChatQueues','name','timeout','strategy','User','Agents'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa4dc,0x16a));var _0xca4d=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xa4dc[_0x346737];return _0x1ade2e;};'use strict';var client=require(_0xca4d('0x0'));exports[_0xca4d('0x1')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xca4d('0x2'),_0xca4d('0x3'),_0xca4d('0x4')],'include':[{'model':_0xca4d('0x5'),'as':_0xca4d('0x6'),'attributes':['id','name',_0xca4d('0x7'),_0xca4d('0x8')]}]},'log':_0xca4d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index d4efa8e..ee94f61 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 _0xf3dc=['Request','../client','create','CreateChatQueueReport','update'];(function(_0x217542,_0x15cc22){var _0x4bb071=function(_0x5f471b){while(--_0x5f471b){_0x217542['push'](_0x217542['shift']());}};_0x4bb071(++_0x15cc22);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xf3dc[_0x39c734];return _0xb2a2f9;};'use strict';var client=require(_0xcf3d('0x0'));exports[_0xcf3d('0x1')]=function(_0x3a135c){return client['Request'](_0xcf3d('0x2'),{'body':_0x3a135c,'log':_0xcf3d('0x2')});};exports[_0xcf3d('0x3')]=function(_0x226c79,_0x17b83e){return client[_0xcf3d('0x4')]('UpdateChatQueueReport',{'body':_0x17b83e,'options':{'where':{'uniqueid':_0x226c79},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xa0bc=['create','CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC'];(function(_0x102e8e,_0xc5472e){var _0x27d3f1=function(_0x57e05a){while(--_0x57e05a){_0x102e8e['push'](_0x102e8e['shift']());}};_0x27d3f1(++_0xc5472e);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xca0b('0x0')]=function(_0x19838b){return client['Request'](_0xca0b('0x1'),{'body':_0x19838b,'log':_0xca0b('0x1')});};exports[_0xca0b('0x2')]=function(_0x68ff4,_0x2f7b56){return client[_0xca0b('0x3')](_0xca0b('0x4'),{'body':_0x2f7b56,'options':{'where':{'uniqueid':_0x68ff4},'order':[['id',_0xca0b('0x5')]],'limit':0x1},'log':_0xca0b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 1aee8a9..241531b 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(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x7a54,0x106));var _0x47a5=function(_0x120bf6,_0x2c3b69){_0x120bf6=_0x120bf6-0x0;var _0x16aef1=_0x7a54[_0x120bf6];return _0x16aef1;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x2ca90c,_0x3ae6ff){var _0x59fda3=function(_0x2c634d){while(--_0x2c634d){_0x2ca90c['push'](_0x2ca90c['shift']());}};_0x59fda3(++_0x3ae6ff);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 81142cb..f6b7198 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 _0xc661=['createFaxMessage','../client','CreateFaxMessage'];(function(_0x424f02,_0x399b71){var _0x11d7f4=function(_0x3ad34d){while(--_0x3ad34d){_0x424f02['push'](_0x424f02['shift']());}};_0x11d7f4(++_0x399b71);}(_0xc661,0xa0));var _0x1c66=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xc661[_0x5834bc];return _0x3e183a;};'use strict';var client=require(_0x1c66('0x0'));exports['create']=function(_0x4e8ef5){return client['Request'](_0x1c66('0x1'),{'body':_0x4e8ef5,'log':_0x1c66('0x2')});}; \ No newline at end of file +var _0x0179=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0179,0x102));var _0x9017=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x0179[_0x38ced4];return _0x547c07;};'use strict';var client=require(_0x9017('0x0'));exports[_0x9017('0x1')]=function(_0xcb909b){return client[_0x9017('0x2')](_0x9017('0x3'),{'body':_0xcb909b,'log':_0x9017('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 46387c8..08353be 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 _0x280a=['User','online','faxPause','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy'];(function(_0x4f66c2,_0x47d4ed){var _0x447633=function(_0x3205d4){while(--_0x3205d4){_0x4f66c2['push'](_0x4f66c2['shift']());}};_0x447633(++_0x47d4ed);}(_0x280a,0x1c5));var _0xa280=function(_0x21771e,_0x5c1be2){_0x21771e=_0x21771e-0x0;var _0x48f8fb=_0x280a[_0x21771e];return _0x48f8fb;};'use strict';var client=require('../client');exports[_0xa280('0x0')]=function(){return function(){return client[_0xa280('0x1')](_0xa280('0x2'),{'options':{'raw':![],'attributes':['id',_0xa280('0x3'),_0xa280('0x4'),_0xa280('0x5')],'include':[{'model':_0xa280('0x6'),'as':'Agents','attributes':['id','name',_0xa280('0x7'),_0xa280('0x8')]}]},'log':_0xa280('0x0')});};}; \ No newline at end of file +var _0xd38b=['timeout','strategy','Agents','online','faxPause','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xd38b,0x140));var _0xbd38=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0xd38b[_0x4ac424];return _0xe1b890;};'use strict';var client=require('../client');exports[_0xbd38('0x0')]=function(){return function(){return client[_0xbd38('0x1')](_0xbd38('0x2'),{'options':{'raw':![],'attributes':['id',_0xbd38('0x3'),_0xbd38('0x4'),_0xbd38('0x5')],'include':[{'model':'User','as':_0xbd38('0x6'),'attributes':['id',_0xbd38('0x3'),_0xbd38('0x7'),_0xbd38('0x8')]}]},'log':_0xbd38('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index dbb3d24..723f45b 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 _0xe2ca=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe2ca,0x10e));var _0xae2c=function(_0x3b4a0f,_0x28e9cd){_0x3b4a0f=_0x3b4a0f-0x0;var _0x537e6e=_0xe2ca[_0x3b4a0f];return _0x537e6e;};'use strict';var client=require(_0xae2c('0x0'));exports[_0xae2c('0x1')]=function(_0x4e35eb){return client[_0xae2c('0x2')](_0xae2c('0x3'),{'body':_0x4e35eb,'log':_0xae2c('0x3')});};exports['update']=function(_0x32e081,_0x192cfd){return client[_0xae2c('0x2')](_0xae2c('0x4'),{'body':_0x192cfd,'options':{'where':{'uniqueid':_0x32e081},'order':[['id','DESC']],'limit':0x1},'log':_0xae2c('0x4')});}; \ No newline at end of file +var _0x5315=['DESC','../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport'];(function(_0x1c42de,_0x196793){var _0x44e1e2=function(_0x2bcbb2){while(--_0x2bcbb2){_0x1c42de['push'](_0x1c42de['shift']());}};_0x44e1e2(++_0x196793);}(_0x5315,0x1a5));var _0x5531=function(_0x48571b,_0x2d489a){_0x48571b=_0x48571b-0x0;var _0x1e0314=_0x5315[_0x48571b];return _0x1e0314;};'use strict';var client=require(_0x5531('0x0'));exports[_0x5531('0x1')]=function(_0x369b78){return client[_0x5531('0x2')](_0x5531('0x3'),{'body':_0x369b78,'log':_0x5531('0x3')});};exports['update']=function(_0x47117a,_0xba08d7){return client[_0x5531('0x2')](_0x5531('0x4'),{'body':_0xba08d7,'options':{'where':{'uniqueid':_0x47117a},'order':[['id',_0x5531('0x5')]],'limit':0x1},'log':_0x5531('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index dc059f2..52f6dce 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 _0x64e9=['interval','../client','getIntervals','Request','GetInterval','Interval','Intervals','name'];(function(_0x5da96a,_0x1e8099){var _0x42ea71=function(_0x8b6547){while(--_0x8b6547){_0x5da96a['push'](_0x5da96a['shift']());}};_0x42ea71(++_0x1e8099);}(_0x64e9,0xf9));var _0x964e=function(_0x5307ad,_0x4bd48c){_0x5307ad=_0x5307ad-0x0;var _0x20c01d=_0x64e9[_0x5307ad];return _0x20c01d;};'use strict';var client=require(_0x964e('0x0'));exports[_0x964e('0x1')]=function(){return function(){return client[_0x964e('0x2')](_0x964e('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x964e('0x4'),'as':_0x964e('0x5'),'attributes':['id',_0x964e('0x6'),_0x964e('0x7')]}]},'log':_0x964e('0x1')});};}; \ No newline at end of file +var _0x937a=['Interval','Intervals','name','interval','../client','getIntervals'];(function(_0x159372,_0xd95a8a){var _0x493d16=function(_0x59c8a0){while(--_0x59c8a0){_0x159372['push'](_0x159372['shift']());}};_0x493d16(++_0xd95a8a);}(_0x937a,0x118));var _0xa937=function(_0x4aefb9,_0x55959c){_0x4aefb9=_0x4aefb9-0x0;var _0x3152dc=_0x937a[_0x4aefb9];return _0x3152dc;};'use strict';var client=require(_0xa937('0x0'));exports[_0xa937('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xa937('0x2'),'as':_0xa937('0x3'),'attributes':['id',_0xa937('0x4'),_0xa937('0x5')]}]},'log':_0xa937('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index e504fb8..9fb0e84 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 _0x955f=['update','Request','updateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x57dd90,_0x58ddc4){var _0x34abca=function(_0x166d60){while(--_0x166d60){_0x57dd90['push'](_0x57dd90['shift']());}};_0x34abca(++_0x58ddc4);}(_0x955f,0x1eb));var _0xf955=function(_0x41517b,_0x15a217){_0x41517b=_0x41517b-0x0;var _0x13c599=_0x955f[_0x41517b];return _0x13c599;};'use strict';var client=require(_0xf955('0x0'));exports[_0xf955('0x1')]=function(_0x438668,_0x382225){return client[_0xf955('0x2')]('UpdateMailInteraction',{'body':_0x382225,'options':{'where':{'id':_0x438668}},'log':_0xf955('0x3')});};exports['addTags']=function(_0x5d0c95,_0x1db0dd){return client['Request'](_0xf955('0x4'),{'body':_0x1db0dd,'options':{'where':{'id':_0x5d0c95}},'log':_0xf955('0x5')});}; \ No newline at end of file +var _0xa456=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction','addTags','Request'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0xa456,0x142));var _0x6a45=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0xa456[_0x725b8e];return _0x43ac45;};'use strict';var client=require(_0x6a45('0x0'));exports[_0x6a45('0x1')]=function(_0x56dfe8,_0xd5464e){return client['Request'](_0x6a45('0x2'),{'body':_0xd5464e,'options':{'where':{'id':_0x56dfe8}},'log':_0x6a45('0x3')});};exports[_0x6a45('0x4')]=function(_0x500c72,_0x1f0701){return client[_0x6a45('0x5')](_0x6a45('0x6'),{'body':_0x1f0701,'options':{'where':{'id':_0x500c72}},'log':_0x6a45('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 457ec5e..e135bb9 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 _0xa0de=['../client','create'];(function(_0x40e7c3,_0x56be7a){var _0x539304=function(_0x46011a){while(--_0x46011a){_0x40e7c3['push'](_0x40e7c3['shift']());}};_0x539304(++_0x56be7a);}(_0xa0de,0x9e));var _0xea0d=function(_0x4d4895,_0x42ba2b){_0x4d4895=_0x4d4895-0x0;var _0x18b8f4=_0xa0de[_0x4d4895];return _0x18b8f4;};'use strict';var client=require(_0xea0d('0x0'));exports[_0xea0d('0x1')]=function(_0xdab04){return client['Request']('CreateMailMessage',{'body':_0xdab04,'log':'createMailMessage'});}; \ No newline at end of file +var _0x97b3=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x33fcf7,_0x5aefaf){var _0x156556=function(_0xbacebe){while(--_0xbacebe){_0x33fcf7['push'](_0x33fcf7['shift']());}};_0x156556(++_0x5aefaf);}(_0x97b3,0x109));var _0x397b=function(_0x50eee7,_0x4ea8d6){_0x50eee7=_0x50eee7-0x0;var _0x1abe20=_0x97b3[_0x50eee7];return _0x1abe20;};'use strict';var client=require(_0x397b('0x0'));exports[_0x397b('0x1')]=function(_0x28c2df){return client[_0x397b('0x2')](_0x397b('0x3'),{'body':_0x28c2df,'log':_0x397b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 7a94887..b7b585b 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 _0xb89d=['strategy','User','online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout'];(function(_0x5193f4,_0x330463){var _0x408fd0=function(_0x3a9fd7){while(--_0x3a9fd7){_0x5193f4['push'](_0x5193f4['shift']());}};_0x408fd0(++_0x330463);}(_0xb89d,0x1c6));var _0xdb89=function(_0x342edd,_0x4dba57){_0x342edd=_0x342edd-0x0;var _0xf75dbe=_0xb89d[_0x342edd];return _0xf75dbe;};'use strict';var client=require(_0xdb89('0x0'));exports[_0xdb89('0x1')]=function(){return function(){return client['Request'](_0xdb89('0x2'),{'options':{'raw':![],'attributes':['id',_0xdb89('0x3'),_0xdb89('0x4'),_0xdb89('0x5')],'include':[{'model':_0xdb89('0x6'),'as':'Agents','attributes':['id','name',_0xdb89('0x7'),_0xdb89('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xeca9=['Agents','online','getMailQueues','GetMailQueue','name','timeout','strategy','User'];(function(_0x4c8121,_0x7baf4d){var _0x3384d7=function(_0x131b0f){while(--_0x131b0f){_0x4c8121['push'](_0x4c8121['shift']());}};_0x3384d7(++_0x7baf4d);}(_0xeca9,0x1da));var _0x9eca=function(_0x2ca35c,_0x998866){_0x2ca35c=_0x2ca35c-0x0;var _0x40f845=_0xeca9[_0x2ca35c];return _0x40f845;};'use strict';var client=require('../client');exports[_0x9eca('0x0')]=function(){return function(){return client['Request'](_0x9eca('0x1'),{'options':{'raw':![],'attributes':['id',_0x9eca('0x2'),_0x9eca('0x3'),_0x9eca('0x4')],'include':[{'model':_0x9eca('0x5'),'as':_0x9eca('0x6'),'attributes':['id',_0x9eca('0x2'),_0x9eca('0x7'),'mailPause']}]},'log':_0x9eca('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 3e8c225..5a0da75 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 _0x7b24=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x1faf34,_0x5a96e7){var _0x294624=function(_0x9679ec){while(--_0x9679ec){_0x1faf34['push'](_0x1faf34['shift']());}};_0x294624(++_0x5a96e7);}(_0x7b24,0x101));var _0x47b2=function(_0x167094,_0x3d4acf){_0x167094=_0x167094-0x0;var _0xe65e33=_0x7b24[_0x167094];return _0xe65e33;};'use strict';var client=require(_0x47b2('0x0'));exports[_0x47b2('0x1')]=function(_0x4dcdd1){return client[_0x47b2('0x2')](_0x47b2('0x3'),{'body':_0x4dcdd1,'log':_0x47b2('0x3')});};exports[_0x47b2('0x4')]=function(_0x105bc7,_0x201957){return client[_0x47b2('0x2')](_0x47b2('0x5'),{'body':_0x201957,'options':{'where':{'uniqueid':_0x105bc7},'order':[['id',_0x47b2('0x6')]],'limit':0x1},'log':_0x47b2('0x5')});}; \ No newline at end of file +var _0x4061=['../client','create','CreateMailQueueReport','Request','UpdateMailQueueReport','DESC'];(function(_0x4aea73,_0x58e303){var _0x8197b7=function(_0x3ec23f){while(--_0x3ec23f){_0x4aea73['push'](_0x4aea73['shift']());}};_0x8197b7(++_0x58e303);}(_0x4061,0x150));var _0x1406=function(_0x4416fe,_0x2e91c9){_0x4416fe=_0x4416fe-0x0;var _0x2ff098=_0x4061[_0x4416fe];return _0x2ff098;};'use strict';var client=require(_0x1406('0x0'));exports[_0x1406('0x1')]=function(_0x4aea1f){return client['Request'](_0x1406('0x2'),{'body':_0x4aea1f,'log':_0x1406('0x2')});};exports['update']=function(_0x457e24,_0x5cba61){return client[_0x1406('0x3')](_0x1406('0x4'),{'body':_0x5cba61,'options':{'where':{'uniqueid':_0x457e24},'order':[['id',_0x1406('0x5')]],'limit':0x1},'log':_0x1406('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 8e7b15f..bfd94d2 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 _0x1065=['Request','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x2929ea,_0x92555c){var _0x44454c=function(_0x18f727){while(--_0x18f727){_0x2929ea['push'](_0x2929ea['shift']());}};_0x44454c(++_0x92555c);}(_0x1065,0x17b));var _0x5106=function(_0x52c27d,_0xda4996){_0x52c27d=_0x52c27d-0x0;var _0x3e712a=_0x1065[_0x52c27d];return _0x3e712a;};'use strict';var client=require('../client');exports[_0x5106('0x0')]=function(_0x5676a7,_0x468d1f){return client[_0x5106('0x1')](_0x5106('0x2'),{'body':_0x468d1f,'options':{'where':{'id':_0x5676a7}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x243eb7,_0x1f457f){return client[_0x5106('0x1')](_0x5106('0x3'),{'body':_0x1f457f,'options':{'where':{'id':_0x243eb7}},'log':_0x5106('0x4')});}; \ No newline at end of file +var _0x7670=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x35986e,_0x596def){var _0x149a8a=function(_0xf9dd05){while(--_0xf9dd05){_0x35986e['push'](_0x35986e['shift']());}};_0x149a8a(++_0x596def);}(_0x7670,0xda));var _0x0767=function(_0x5b14c5,_0xe0f313){_0x5b14c5=_0x5b14c5-0x0;var _0x5c00c1=_0x7670[_0x5b14c5];return _0x5c00c1;};'use strict';var client=require('../client');exports[_0x0767('0x0')]=function(_0x5009dd,_0x10cd0f){return client[_0x0767('0x1')](_0x0767('0x2'),{'body':_0x10cd0f,'options':{'where':{'id':_0x5009dd}},'log':_0x0767('0x3')});};exports[_0x0767('0x4')]=function(_0x30807d,_0x528b4d){return client[_0x0767('0x1')](_0x0767('0x5'),{'body':_0x528b4d,'options':{'where':{'id':_0x30807d}},'log':_0x0767('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 0e423ec..44c575c 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 _0x213b=['CreateOpenchannelMessage','../client','create','Request'];(function(_0x9d639c,_0x524dbe){var _0x1671de=function(_0x27888e){while(--_0x27888e){_0x9d639c['push'](_0x9d639c['shift']());}};_0x1671de(++_0x524dbe);}(_0x213b,0x11d));var _0xb213=function(_0x41d1e8,_0x112fa0){_0x41d1e8=_0x41d1e8-0x0;var _0x33c7bb=_0x213b[_0x41d1e8];return _0x33c7bb;};'use strict';var client=require(_0xb213('0x0'));exports[_0xb213('0x1')]=function(_0x56f9c2){return client[_0xb213('0x2')](_0xb213('0x3'),{'body':_0x56f9c2,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x72c3=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x4bc4c8,_0x3139d3){var _0x3bb121=function(_0x95ad12){while(--_0x95ad12){_0x4bc4c8['push'](_0x4bc4c8['shift']());}};_0x3bb121(++_0x3139d3);}(_0x72c3,0x140));var _0x372c=function(_0x28e7e6,_0x20b6ee){_0x28e7e6=_0x28e7e6-0x0;var _0x10e84a=_0x72c3[_0x28e7e6];return _0x10e84a;};'use strict';var client=require(_0x372c('0x0'));exports[_0x372c('0x1')]=function(_0x44f1d6){return client[_0x372c('0x2')](_0x372c('0x3'),{'body':_0x44f1d6,'log':_0x372c('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index a8ec755..ccb7795 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 _0xb98e=['getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','online'];(function(_0x1e0203,_0x568b28){var _0x25ff8c=function(_0x3e338c){while(--_0x3e338c){_0x1e0203['push'](_0x1e0203['shift']());}};_0x25ff8c(++_0x568b28);}(_0xb98e,0x155));var _0xeb98=function(_0x71f90,_0xd82feb){_0x71f90=_0x71f90-0x0;var _0x45da99=_0xb98e[_0x71f90];return _0x45da99;};'use strict';var client=require(_0xeb98('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xeb98('0x1')](_0xeb98('0x2'),{'options':{'raw':![],'attributes':['id',_0xeb98('0x3'),_0xeb98('0x4'),_0xeb98('0x5')],'include':[{'model':_0xeb98('0x6'),'as':_0xeb98('0x7'),'attributes':['id',_0xeb98('0x3'),_0xeb98('0x8'),'openchannelPause']}]},'log':_0xeb98('0x9')});};}; \ No newline at end of file +var _0x32ea=['strategy','User','Agents','openchannelPause','getOpenchannelQueues','../client','Request','name'];(function(_0x383545,_0x4790bd){var _0x5ba15=function(_0x2d8ed2){while(--_0x2d8ed2){_0x383545['push'](_0x383545['shift']());}};_0x5ba15(++_0x4790bd);}(_0x32ea,0x185));var _0xa32e=function(_0x4d674b,_0x176474){_0x4d674b=_0x4d674b-0x0;var _0x535a1f=_0x32ea[_0x4d674b];return _0x535a1f;};'use strict';var client=require(_0xa32e('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xa32e('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0xa32e('0x2'),'timeout',_0xa32e('0x3')],'include':[{'model':_0xa32e('0x4'),'as':_0xa32e('0x5'),'attributes':['id','name','online',_0xa32e('0x6')]}]},'log':_0xa32e('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b69db19..dfeed38 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 _0x6027=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x6027,0xc5));var _0x7602=function(_0x53e3de,_0x13da7b){_0x53e3de=_0x53e3de-0x0;var _0x7b905b=_0x6027[_0x53e3de];return _0x7b905b;};'use strict';var client=require(_0x7602('0x0'));exports[_0x7602('0x1')]=function(_0x3f3c84){return client[_0x7602('0x2')](_0x7602('0x3'),{'body':_0x3f3c84,'log':_0x7602('0x3')});};exports['update']=function(_0x484ac7,_0xc3bcb8){return client['Request'](_0x7602('0x4'),{'body':_0xc3bcb8,'options':{'where':{'uniqueid':_0x484ac7},'order':[['id','DESC']],'limit':0x1},'log':_0x7602('0x4')});}; \ No newline at end of file +var _0x9053=['DESC','create','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport'];(function(_0x477661,_0x5403f2){var _0x521e62=function(_0x5af532){while(--_0x5af532){_0x477661['push'](_0x477661['shift']());}};_0x521e62(++_0x5403f2);}(_0x9053,0x161));var _0x3905=function(_0x487ee4,_0x3d3e66){_0x487ee4=_0x487ee4-0x0;var _0x3b0877=_0x9053[_0x487ee4];return _0x3b0877;};'use strict';var client=require('../client');exports[_0x3905('0x0')]=function(_0x4dd6f9){return client['Request'](_0x3905('0x1'),{'body':_0x4dd6f9,'log':_0x3905('0x1')});};exports['update']=function(_0x300f7a,_0x56fc79){return client['Request'](_0x3905('0x2'),{'body':_0x56fc79,'options':{'where':{'uniqueid':_0x300f7a},'order':[['id',_0x3905('0x3')]],'limit':0x1},'log':_0x3905('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index c551946..1b2d453 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 _0xc23a=['update','UpdateSmsInteraction','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xc23a,0xd2));var _0xac23=function(_0x271060,_0x3f86b1){_0x271060=_0x271060-0x0;var _0x40540b=_0xc23a[_0x271060];return _0x40540b;};'use strict';var client=require('../client');exports[_0xac23('0x0')]=function(_0xc17fba,_0xf70a16){return client['Request'](_0xac23('0x1'),{'body':_0xf70a16,'options':{'where':{'id':_0xc17fba}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x35c541,_0x4f104c){return client[_0xac23('0x2')](_0xac23('0x3'),{'body':_0x4f104c,'options':{'where':{'id':_0x35c541}},'log':_0xac23('0x4')});}; \ No newline at end of file +var _0x269f=['Request','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update'];(function(_0x3beb05,_0x4bb1cd){var _0x576032=function(_0x300b28){while(--_0x300b28){_0x3beb05['push'](_0x3beb05['shift']());}};_0x576032(++_0x4bb1cd);}(_0x269f,0xee));var _0xf269=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x269f[_0xbd08b4];return _0x314f1e;};'use strict';var client=require(_0xf269('0x0'));exports[_0xf269('0x1')]=function(_0x31447d,_0x501fb4){return client[_0xf269('0x2')]('UpdateSmsInteraction',{'body':_0x501fb4,'options':{'where':{'id':_0x31447d}},'log':_0xf269('0x3')});};exports[_0xf269('0x4')]=function(_0x230d12,_0x22032a){return client[_0xf269('0x2')]('AddTagsToSmsInteraction',{'body':_0x22032a,'options':{'where':{'id':_0x230d12}},'log':_0xf269('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 56c95cc..cda71a9 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 _0x8def=['Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x4d5cee,_0x19efe8){var _0x26d55c=function(_0x309734){while(--_0x309734){_0x4d5cee['push'](_0x4d5cee['shift']());}};_0x26d55c(++_0x19efe8);}(_0x8def,0x10b));var _0xf8de=function(_0x1cfbfa,_0x1b88d1){_0x1cfbfa=_0x1cfbfa-0x0;var _0x5e56b2=_0x8def[_0x1cfbfa];return _0x5e56b2;};'use strict';var client=require(_0xf8de('0x0'));exports['create']=function(_0x28b6bb){return client[_0xf8de('0x1')](_0xf8de('0x2'),{'body':_0x28b6bb,'log':_0xf8de('0x3')});}; \ No newline at end of file +var _0xd866=['Request','CreateSmsMessage','../client','create'];(function(_0x4fb40c,_0x31d78c){var _0x2ec089=function(_0x50677f){while(--_0x50677f){_0x4fb40c['push'](_0x4fb40c['shift']());}};_0x2ec089(++_0x31d78c);}(_0xd866,0x9a));var _0x6d86=function(_0x59d2d8,_0x5df195){_0x59d2d8=_0x59d2d8-0x0;var _0x14cc62=_0xd866[_0x59d2d8];return _0x14cc62;};'use strict';var client=require(_0x6d86('0x0'));exports[_0x6d86('0x1')]=function(_0xb613fe){return client[_0x6d86('0x2')](_0x6d86('0x3'),{'body':_0xb613fe,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 6580b02..8797d98 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x115f3b,_0x14a0c6){var _0x457156=function(_0x568d68){while(--_0x568d68){_0x115f3b['push'](_0x115f3b['shift']());}};_0x457156(++_0x14a0c6);}(_0xe706,0xa3));var _0x6e70=function(_0x19b56f,_0x4cbbd9){_0x19b56f=_0x19b56f-0x0;var _0x1e69f9=_0xe706[_0x19b56f];return _0x1e69f9;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x5a5f4f,_0x218711){var _0x559e2c=function(_0x3e60af){while(--_0x3e60af){_0x5a5f4f['push'](_0x5a5f4f['shift']());}};_0x559e2c(++_0x218711);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 3d32729..8bf4d04 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(_0x4b098d,_0x3ba2ee){var _0x273f87=function(_0x25874c){while(--_0x25874c){_0x4b098d['push'](_0x4b098d['shift']());}};_0x273f87(++_0x3ba2ee);}(_0x34e8,0x12c));var _0x834e=function(_0x85c10b,_0x29343f){_0x85c10b=_0x85c10b-0x0;var _0x5100c8=_0x34e8[_0x85c10b];return _0x5100c8;};'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 _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x519c0c,_0x440d5f){var _0x57725d=function(_0x44942e){while(--_0x44942e){_0x519c0c['push'](_0x519c0c['shift']());}};_0x57725d(++_0x440d5f);}(_0x34e8,0x12c));var _0x834e=function(_0x2b7f9a,_0x501307){_0x2b7f9a=_0x2b7f9a-0x0;var _0x19521f=_0x34e8[_0x2b7f9a];return _0x19521f;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 3d735d6..48365a5 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(_0x18ab91,_0x5d114a){var _0x224557=function(_0x3a9488){while(--_0x3a9488){_0x18ab91['push'](_0x18ab91['shift']());}};_0x224557(++_0x5d114a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x1cc41e,_0x364811){var _0xb6a6b7=function(_0x36b7ea){while(--_0x36b7ea){_0x1cc41e['push'](_0x1cc41e['shift']());}};_0xb6a6b7(++_0x364811);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 5c07d09..6ce21aa 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 _0x4d68=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x4d68,0x1c3));var _0x84d6=function(_0x9d14e3,_0x5a6072){_0x9d14e3=_0x9d14e3-0x0;var _0x19bf32=_0x4d68[_0x9d14e3];return _0x19bf32;};'use strict';var client=require(_0x84d6('0x0'));exports[_0x84d6('0x1')]=function(_0x2e2636,_0xc5c972){return client[_0x84d6('0x2')](_0x84d6('0x3'),{'body':_0xc5c972,'options':{'where':{'id':_0x2e2636}},'log':'updateWhatsappInteraction'});};exports[_0x84d6('0x4')]=function(_0x5ee114,_0x3a2f0b){return client['Request'](_0x84d6('0x5'),{'body':_0x3a2f0b,'options':{'where':{'id':_0x5ee114}},'log':_0x84d6('0x6')});}; \ No newline at end of file +var _0x565e=['AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request','addTags'];(function(_0x38b108,_0x5363ba){var _0x1e5dc0=function(_0x33068d){while(--_0x33068d){_0x38b108['push'](_0x38b108['shift']());}};_0x1e5dc0(++_0x5363ba);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe565('0x0'));exports['update']=function(_0x19090f,_0x1a2449){return client[_0xe565('0x1')]('UpdateWhatsappInteraction',{'body':_0x1a2449,'options':{'where':{'id':_0x19090f}},'log':'updateWhatsappInteraction'});};exports[_0xe565('0x2')]=function(_0x33fd83,_0x14f472){return client[_0xe565('0x1')](_0xe565('0x3'),{'body':_0x14f472,'options':{'where':{'id':_0x33fd83}},'log':_0xe565('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 5646d9b..e74943e 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 _0xb0c2=['create','Request','CreateWhatsappMessage'];(function(_0x354083,_0x1a40bb){var _0x37e5a2=function(_0x42505e){while(--_0x42505e){_0x354083['push'](_0x354083['shift']());}};_0x37e5a2(++_0x1a40bb);}(_0xb0c2,0xf3));var _0x2b0c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0c2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x2b0c('0x0')]=function(_0x4a81a0){return client[_0x2b0c('0x1')](_0x2b0c('0x2'),{'body':_0x4a81a0,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0xb1f9=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x58db4e,_0x439d8d){var _0x40139a=function(_0x34cae4){while(--_0x34cae4){_0x58db4e['push'](_0x58db4e['shift']());}};_0x40139a(++_0x439d8d);}(_0xb1f9,0x14b));var _0x9b1f=function(_0x3cd6ef,_0x38feee){_0x3cd6ef=_0x3cd6ef-0x0;var _0x22ecbc=_0xb1f9[_0x3cd6ef];return _0x22ecbc;};'use strict';var client=require(_0x9b1f('0x0'));exports[_0x9b1f('0x1')]=function(_0x2ba522){return client[_0x9b1f('0x2')](_0x9b1f('0x3'),{'body':_0x2ba522,'log':_0x9b1f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 65433b0..6371116 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 _0x7df4=['online','whatsappPause','getWhatsappQueues','../client','GetWhatsappQueue','name','timeout','strategy','User'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7df4,0x9c));var _0x47df=function(_0x472f75,_0x98f0e0){_0x472f75=_0x472f75-0x0;var _0x477345=_0x7df4[_0x472f75];return _0x477345;};'use strict';var client=require(_0x47df('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x47df('0x1'),{'options':{'raw':![],'attributes':['id',_0x47df('0x2'),_0x47df('0x3'),_0x47df('0x4')],'include':[{'model':_0x47df('0x5'),'as':'Agents','attributes':['id','name',_0x47df('0x6'),_0x47df('0x7')]}]},'log':_0x47df('0x8')});};}; \ No newline at end of file +var _0xb5e4=['getWhatsappQueues','../client','name','timeout','strategy','User','Agents','online','whatsappPause'];(function(_0x387d83,_0x40ed0d){var _0x4ee28e=function(_0x1d932c){while(--_0x1d932c){_0x387d83['push'](_0x387d83['shift']());}};_0x4ee28e(++_0x40ed0d);}(_0xb5e4,0x145));var _0x4b5e=function(_0xc926b7,_0xa6e261){_0xc926b7=_0xc926b7-0x0;var _0x30aff8=_0xb5e4[_0xc926b7];return _0x30aff8;};'use strict';var client=require(_0x4b5e('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0x4b5e('0x1'),_0x4b5e('0x2'),_0x4b5e('0x3')],'include':[{'model':_0x4b5e('0x4'),'as':_0x4b5e('0x5'),'attributes':['id',_0x4b5e('0x1'),_0x4b5e('0x6'),_0x4b5e('0x7')]}]},'log':_0x4b5e('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 4a81ad2..f4c72e3 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 _0xb1b0=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x3da832,_0x2133f1){var _0xe602f2=function(_0xb7b2f){while(--_0xb7b2f){_0x3da832['push'](_0x3da832['shift']());}};_0xe602f2(++_0x2133f1);}(_0xb1b0,0xf7));var _0x0b1b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xb1b0[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x0b1b('0x0'));exports[_0x0b1b('0x1')]=function(_0x56143a){return client[_0x0b1b('0x2')]('CreateWhatsappQueueReport',{'body':_0x56143a,'log':_0x0b1b('0x3')});};exports[_0x0b1b('0x4')]=function(_0x208f25,_0x4f8410){return client[_0x0b1b('0x2')](_0x0b1b('0x5'),{'body':_0x4f8410,'options':{'where':{'uniqueid':_0x208f25},'order':[['id',_0x0b1b('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x51e1=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x5dd943,_0x49084c){var _0x28bcdc=function(_0x404cf9){while(--_0x404cf9){_0x5dd943['push'](_0x5dd943['shift']());}};_0x28bcdc(++_0x49084c);}(_0x51e1,0xa5));var _0x151e=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0x51e1[_0x31b9cf];return _0x357b8a;};'use strict';var client=require(_0x151e('0x0'));exports[_0x151e('0x1')]=function(_0x49150f){return client[_0x151e('0x2')](_0x151e('0x3'),{'body':_0x49150f,'log':_0x151e('0x3')});};exports[_0x151e('0x4')]=function(_0x2de210,_0x3b8b55){return client[_0x151e('0x2')](_0x151e('0x5'),{'body':_0x3b8b55,'options':{'where':{'uniqueid':_0x2de210},'order':[['id','DESC']],'limit':0x1},'log':_0x151e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 5041c3b..807cff8 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 _0x3495=['channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','name','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','timeout','createQueue','atimeout'];(function(_0x94ad81,_0x1d6749){var _0x2c89d0=function(_0x1bde7c){while(--_0x1bde7c){_0x94ad81['push'](_0x94ad81['shift']());}};_0x2c89d0(++_0x1d6749);}(_0x3495,0xa2));var _0x5349=function(_0x1ec0bd,_0x12d761){_0x1ec0bd=_0x1ec0bd-0x0;var _0x33fccd=_0x3495[_0x1ec0bd];return _0x33fccd;};'use strict';var schema=require(_0x5349('0x0'));var _=require(_0x5349('0x1'));var util=require(_0x5349('0x2'));var seqqueue=require(_0x5349('0x3'));var logger=require('../../../../config/logger')(_0x5349('0x4'));var strategy=require(_0x5349('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x5349('0x6')},'timeout':{'type':_0x5349('0x7'),'message':_0x5349('0x8')}});function writeLog(_0x201cb2,_0x2f6e99,_0x60a169){return logger[_0x5349('0x9')](util[_0x5349('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x201cb2,_0x2f6e99['name'],_0x60a169));}function handleFindAgent(_0xe54a47){return function(_0x11747c){return _0x11747c['name'][_0x5349('0xb')]()===_0xe54a47[_0x5349('0xb')]();};}exports[_0x5349('0xc')]=function(_0x190949,_0xc6624c,_0x875e23,_0x285ef5){return function(_0x5e0226){try{var _0x45d544={'name':_0xc6624c[0x0],'timeout':_0xc6624c[0x1]};var _0x35360a=queue[_0x5349('0x0')](_0x45d544,{'typecast':!![]});if(_0x35360a['length']){logger[_0x5349('0xd')](_0x5349('0xe'),_0x190949,_[_0x5349('0xf')](_0x35360a,_0x5349('0x10'))['join'](',\x20'));_0x5e0226[_0x5349('0x11')]();}else{var _0xd187a0=_[_0x5349('0x12')](_0x875e23[_0x5349('0x13')],handleFindAgent(_0x45d544['name']));if(_0xd187a0){var _0x525ee1=(_0x45d544[_0x5349('0x14')]||0xa)*0x3e8;var _0x5f2034,_0x2d4866;var _0x1ad606=seqqueue[_0x5349('0x15')](_0x525ee1);_0x1ad606['id']=_0x190949;_0x1ad606[_0x5349('0x16')]=_0x525ee1;_0x1ad606['channel']=_0x285ef5[_0x5349('0x17')];writeLog(_0x190949,_0xd187a0,util[_0x5349('0xa')](_0x5349('0x18'),_0x525ee1));_0x875e23[_0x5349('0x19')][_0x190949]['on'](_0x5349('0x1a'),function(){logger['info'](_0x5349('0x1b'),_0x190949);clearTimeout(_0x2d4866);_0x2d4866=undefined;_0x1ad606[_0x5349('0x1c')]();if(_0x875e23[_0x5349('0x19')][_0x190949]){delete _0x875e23[_0x5349('0x19')][_0x190949];}_0x5e0226[_0x5349('0x11')]();});_0x875e23[_0x5349('0x19')][_0x190949]['on'](_0x5349('0x1d'),function(){if(_0x875e23[_0x5349('0x19')][_0x190949]){delete _0x875e23[_0x5349('0x19')][_0x190949];}});_0x2d4866=setTimeout(function(){logger[_0x5349('0x9')](_0x5349('0x1e'),_0x190949);clearTimeout(_0x2d4866);_0x1ad606[_0x5349('0x1c')]();_0x5e0226['next']();},_0x525ee1);strategy[_0x5349('0x1f')](_0x1ad606,_0xd187a0,_0x875e23,_0x285ef5);}else{logger[_0x5349('0xd')](_0x5349('0x20'),_0x190949,_0x45d544[_0x5349('0x21')]);_0x5e0226['stop']();}}}catch(_0x12fc5b){console[_0x5349('0x22')](_0x12fc5b);logger['error'](_0x5349('0x23'),_0x190949,_0x12fc5b[_0x5349('0x24')]);_0x5e0226[_0x5349('0x11')]();}};}; \ No newline at end of file +var _0xe35d=['[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log'];(function(_0x5be1d6,_0x52ab2a){var _0x5d9bd4=function(_0x4f05ba){while(--_0x4f05ba){_0x5be1d6['push'](_0x5be1d6['shift']());}};_0x5d9bd4(++_0x52ab2a);}(_0xe35d,0x1e2));var _0xde35=function(_0x58f679,_0x11e21e){_0x58f679=_0x58f679-0x0;var _0x578cf7=_0xe35d[_0x58f679];return _0x578cf7;};'use strict';var schema=require(_0xde35('0x0'));var _=require(_0xde35('0x1'));var util=require(_0xde35('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xde35('0x3'))('routing');var strategy=require(_0xde35('0x4'));var queue=schema({'name':{'type':_0xde35('0x5'),'required':!![],'message':_0xde35('0x6')},'timeout':{'type':_0xde35('0x7'),'message':_0xde35('0x8')}});function writeLog(_0x3851a4,_0x1993e2,_0xe63671){return logger[_0xde35('0x9')](util[_0xde35('0xa')](_0xde35('0xb'),_0x3851a4,_0x1993e2[_0xde35('0xc')],_0xe63671));}function handleFindAgent(_0x4c9c37){return function(_0x1f7372){return _0x1f7372[_0xde35('0xc')][_0xde35('0xd')]()===_0x4c9c37[_0xde35('0xd')]();};}exports[_0xde35('0xe')]=function(_0xc3aead,_0x26c6f4,_0x44f214,_0x4ba1b5){return function(_0x54b656){try{var _0x5624eb={'name':_0x26c6f4[0x0],'timeout':_0x26c6f4[0x1]};var _0x5d7636=queue[_0xde35('0x0')](_0x5624eb,{'typecast':!![]});if(_0x5d7636['length']){logger[_0xde35('0xf')](_0xde35('0x10'),_0xc3aead,_[_0xde35('0x11')](_0x5d7636,_0xde35('0x12'))[_0xde35('0x13')](',\x20'));_0x54b656[_0xde35('0x14')]();}else{var _0x113500=_[_0xde35('0x15')](_0x44f214[_0xde35('0x16')],handleFindAgent(_0x5624eb[_0xde35('0xc')]));if(_0x113500){var _0x49ec82=(_0x5624eb[_0xde35('0x17')]||0xa)*0x3e8;var _0x8045c6,_0x284997;var _0x22580a=seqqueue[_0xde35('0x18')](_0x49ec82);_0x22580a['id']=_0xc3aead;_0x22580a[_0xde35('0x19')]=_0x49ec82;_0x22580a[_0xde35('0x1a')]=_0x4ba1b5[_0xde35('0x1a')];writeLog(_0xc3aead,_0x113500,util[_0xde35('0xa')](_0xde35('0x1b'),_0x49ec82));_0x44f214[_0xde35('0x1c')][_0xc3aead]['on'](_0xde35('0x1d'),function(){logger[_0xde35('0x9')](_0xde35('0x1e'),_0xc3aead);clearTimeout(_0x284997);_0x284997=undefined;_0x22580a[_0xde35('0x1f')]();if(_0x44f214[_0xde35('0x1c')][_0xc3aead]){delete _0x44f214[_0xde35('0x1c')][_0xc3aead];}_0x54b656[_0xde35('0x14')]();});_0x44f214['rules'][_0xc3aead]['on'](_0xde35('0x20'),function(){if(_0x44f214[_0xde35('0x1c')][_0xc3aead]){delete _0x44f214['rules'][_0xc3aead];}});_0x284997=setTimeout(function(){logger[_0xde35('0x9')](_0xde35('0x21'),_0xc3aead);clearTimeout(_0x284997);_0x22580a[_0xde35('0x1f')]();_0x54b656[_0xde35('0x22')]();},_0x49ec82);strategy[_0xde35('0x23')](_0x22580a,_0x113500,_0x44f214,_0x4ba1b5);}else{logger['error'](_0xde35('0x24'),_0xc3aead,_0x5624eb[_0xde35('0xc')]);_0x54b656['stop']();}}}catch(_0x50aced){console[_0xde35('0x25')](_0x50aced);logger[_0xde35('0xf')](_0xde35('0x26'),_0xc3aead,_0x50aced[_0xde35('0x27')]);_0x54b656[_0xde35('0x14')]();}};}; \ 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 ecf1d5a..26a4151 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 _0x5157=['channel','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','amazonlex','create','info','dialogState','Failed','lodash','moment','aws-sdk','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x38e325,_0xf8f2e3){var _0x268273=function(_0x13e487){while(--_0x13e487){_0x38e325['push'](_0x38e325['shift']());}};_0x268273(++_0xf8f2e3);}(_0x5157,0xa1));var _0x7515=function(_0x6fc8a6,_0x502594){_0x6fc8a6=_0x6fc8a6-0x0;var _0x339604=_0x5157[_0x6fc8a6];return _0x339604;};'use strict';var _=require(_0x7515('0x0'));var moment=require(_0x7515('0x1'));var AWS=require(_0x7515('0x2'));var utils=require(_0x7515('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x7515('0x4')),'openchannelMessage':require(_0x7515('0x5')),'mailMessage':require(_0x7515('0x6')),'smsMessage':require(_0x7515('0x7')),'faxMessage':require(_0x7515('0x8')),'whatsappMessage':require(_0x7515('0x9'))};exports[_0x7515('0xa')]=function(_0x34bfe4,_0x1e1082){return function(_0x177b40){try{if(!_['isNil'](this[_0x7515('0xb')][_0x7515('0xc')])){logger['info'](_0x7515('0xd'),_0x34bfe4,_0x7515('0xe'));return _0x177b40[_0x7515('0xf')]();}var _0x258f37={'ContactId':this[_0x7515('0x10')]['id'],'sentAt':moment()[_0x7515('0x11')](_0x7515('0x12')),'direction':'out'};if(this[_0x7515('0x13')]==='sms'||this[_0x7515('0x13')]==='whatsapp'){_0x258f37['phone']=this[_0x7515('0xb')][_0x7515('0x14')];}var _0x4fe51c=this[_0x7515('0x13')];if(_0x4fe51c==='chat'){_0x258f37['ChatWebsiteId']=this[_0x7515('0x15')]['id'];}else{_0x258f37[_[_0x7515('0x16')](_0x4fe51c)+_0x7515('0x17')]=this['account']['id'];}_0x258f37[_[_0x7515('0x16')](_0x4fe51c)+_0x7515('0x18')]=this[_0x7515('0xb')]['id'];if(this[_0x7515('0xb')][_0x7515('0x19')]){var _0x12815d=_0x1e1082[0x4];if(!_[_0x7515('0x1a')](_0x12815d)){_0x258f37[_0x7515('0x1b')]=utils[_0x7515('0x1c')](_0x12815d,this);return rpc[_0x4fe51c+_0x7515('0x1d')]['create'](_0x258f37)[_0x7515('0x1e')](function(_0x22904e){logger['info']('[%s][AMAZONLEX]\x20%s',_0x34bfe4,_0x258f37['body']);})['catch'](function(_0x30c12e){logger[_0x7515('0x1f')](_0x7515('0xd'),_0x34bfe4,JSON[_0x7515('0x20')](_0x30c12e));})[_0x7515('0x21')](function(){logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x34bfe4);_0x177b40[_0x7515('0x22')]();});}else{logger['info'](_0x7515('0x23'),_0x34bfe4);_0x177b40[_0x7515('0x22')]();}}else{var _0x270776=this;var _0x2c3226=new AWS[(_0x7515('0x24'))]({'accessKeyId':_0x1e1082[0x0],'secretAccessKey':_0x1e1082[0x1],'region':_0x1e1082[0x2]});var _0x261aec={'botAlias':_0x7515('0x25'),'botName':_0x1e1082[0x3],'inputText':this[_0x7515('0x26')]['body'],'userId':this['channel']+':'+this[_0x7515('0xb')]['id']['toString']()};_0x2c3226[_0x7515('0x27')](_0x261aec,function(_0x247d93,_0x1a8796){if(_0x247d93){logger[_0x7515('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x34bfe4,_0x247d93[_0x7515('0x26')]);_0x177b40[_0x7515('0xf')]();}else if(_0x1a8796&&_0x1a8796[_0x7515('0x26')]){_0x270776[_0x7515('0x1b')][_0x7515('0x28')]=_0x1a8796;_0x258f37[_0x7515('0x1b')]=_0x1a8796['message'];_0x258f37['providerName']=_0x7515('0x28');_0x258f37['providerResponse']=JSON['stringify'](_0x1a8796);return rpc[_0x4fe51c+_0x7515('0x1d')][_0x7515('0x29')](_0x258f37)['then'](function(_0x4090f1){logger[_0x7515('0x2a')](_0x7515('0xd'),_0x34bfe4,_0x258f37['body']);if(_0x1a8796[_0x7515('0x2b')]==_0x7515('0x2c')){_0x177b40[_0x7515('0xf')]();}else{_0x177b40[_0x7515('0x22')]();}})['catch'](function(_0x2f808d){logger['error'](_0x7515('0xd'),_0x34bfe4,JSON[_0x7515('0x20')](_0x2f808d));_0x177b40[_0x7515('0xf')]();});}else{_0x177b40['next']();}});}}catch(_0x448678){logger[_0x7515('0x1f')](_0x7515('0xd'),_0x34bfe4,JSON[_0x7515('0x20')](_0x448678));_0x177b40[_0x7515('0x22')]();}};}; \ No newline at end of file +var _0x634b=['interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','$LATEST','postText','message','amazonlex','providerName','providerResponse','dialogState','Failed','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil'];(function(_0xa8b49,_0x3b2e1b){var _0x473313=function(_0x3872b1){while(--_0x3872b1){_0xa8b49['push'](_0xa8b49['shift']());}};_0x473313(++_0x3b2e1b);}(_0x634b,0x19f));var _0xb634=function(_0x3d37f0,_0x4daf6c){_0x3d37f0=_0x3d37f0-0x0;var _0x599ff8=_0x634b[_0x3d37f0];return _0x599ff8;};'use strict';var _=require('lodash');var moment=require(_0xb634('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0xb634('0x1'))(_0xb634('0x2'));var rpc={'chatMessage':require(_0xb634('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb634('0x4')),'smsMessage':require(_0xb634('0x5')),'faxMessage':require(_0xb634('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x35361a,_0x1d31b3){return function(_0x3cca37){try{if(!_[_0xb634('0x7')](this[_0xb634('0x8')][_0xb634('0x9')])){logger[_0xb634('0xa')](_0xb634('0xb'),_0x35361a,_0xb634('0xc'));return _0x3cca37[_0xb634('0xd')]();}var _0x50fae4={'ContactId':this[_0xb634('0xe')]['id'],'sentAt':moment()[_0xb634('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xb634('0x10')};if(this[_0xb634('0x11')]===_0xb634('0x12')||this[_0xb634('0x11')]===_0xb634('0x13')){_0x50fae4[_0xb634('0x14')]=this[_0xb634('0x8')]['phone'];}var _0x53018a=this['channel'];if(_0x53018a===_0xb634('0x15')){_0x50fae4[_0xb634('0x16')]=this[_0xb634('0x17')]['id'];}else{_0x50fae4[_[_0xb634('0x18')](_0x53018a)+_0xb634('0x19')]=this[_0xb634('0x17')]['id'];}_0x50fae4[_[_0xb634('0x18')](_0x53018a)+'InteractionId']=this[_0xb634('0x8')]['id'];if(this['interaction'][_0xb634('0x1a')]){var _0x43b26d=_0x1d31b3[0x4];if(!_[_0xb634('0x1b')](_0x43b26d)){_0x50fae4['body']=utils[_0xb634('0x1c')](_0x43b26d,this);return rpc[_0x53018a+_0xb634('0x1d')][_0xb634('0x1e')](_0x50fae4)[_0xb634('0x1f')](function(_0x129069){logger[_0xb634('0xa')]('[%s][AMAZONLEX]\x20%s',_0x35361a,_0x50fae4[_0xb634('0x20')]);})[_0xb634('0x21')](function(_0x101281){logger[_0xb634('0x22')](_0xb634('0xb'),_0x35361a,JSON[_0xb634('0x23')](_0x101281));})[_0xb634('0x24')](function(){logger[_0xb634('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x35361a);_0x3cca37['stop']();});}else{logger[_0xb634('0xa')](_0xb634('0x25'),_0x35361a);_0x3cca37[_0xb634('0x26')]();}}else{var _0x484ef7=this;var _0x5f4d7a=new AWS['LexRuntime']({'accessKeyId':_0x1d31b3[0x0],'secretAccessKey':_0x1d31b3[0x1],'region':_0x1d31b3[0x2]});var _0x3b19cf={'botAlias':_0xb634('0x27'),'botName':_0x1d31b3[0x3],'inputText':this['message']['body'],'userId':this[_0xb634('0x11')]+':'+this[_0xb634('0x8')]['id']['toString']()};_0x5f4d7a[_0xb634('0x28')](_0x3b19cf,function(_0x5d247,_0x5d572a){if(_0x5d247){logger[_0xb634('0x22')](_0xb634('0xb'),_0x35361a,_0x5d247[_0xb634('0x29')]);_0x3cca37['next']();}else if(_0x5d572a&&_0x5d572a['message']){_0x484ef7[_0xb634('0x20')][_0xb634('0x2a')]=_0x5d572a;_0x50fae4[_0xb634('0x20')]=_0x5d572a['message'];_0x50fae4[_0xb634('0x2b')]=_0xb634('0x2a');_0x50fae4[_0xb634('0x2c')]=JSON[_0xb634('0x23')](_0x5d572a);return rpc[_0x53018a+_0xb634('0x1d')]['create'](_0x50fae4)[_0xb634('0x1f')](function(_0x8cdd81){logger['info'](_0xb634('0xb'),_0x35361a,_0x50fae4[_0xb634('0x20')]);if(_0x5d572a[_0xb634('0x2d')]==_0xb634('0x2e')){_0x3cca37['next']();}else{_0x3cca37['stop']();}})['catch'](function(_0x44e4ca){logger[_0xb634('0x22')](_0xb634('0xb'),_0x35361a,JSON[_0xb634('0x23')](_0x44e4ca));_0x3cca37['next']();});}else{_0x3cca37[_0xb634('0xd')]();}});}}catch(_0x57f179){logger['error']('[%s][AMAZONLEX]\x20%s',_0x35361a,JSON[_0xb634('0x23')](_0x57f179));_0x3cca37['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index e5b527e..4cc4fae 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 _0x4418=['error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','channel','body','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','html','','replace','';_0xd7da8c[_0x8441('0x31')]={'Auto-Submitted':_0x8441('0x32'),'X-Auto-Response-Suppress':'All','Precedence':_0x8441('0x33')};return mailRpc[_0x8441('0x34')](this[_0x8441('0x25')][_0x8441('0x35')],_0xd7da8c)[_0x8441('0x36')](function(_0x40b787){logger['info'](_0x8441('0x37'),_0x3841c8);_0xd7da8c[_0x8441('0x2b')]=_0x40b787['message']['messageId'];return rpc[_0x390b1c+'Message'][_0x8441('0x38')](_0xd7da8c);})[_0x8441('0x36')](function(_0x45b145){logger[_0x8441('0xc')]('[%s][AUTOREPLY]\x20%s',_0x3841c8,JSON[_0x8441('0x39')](_0x45b145));})[_0x8441('0x3a')](function(_0x19796e){logger[_0x8441('0x3b')](_0x8441('0x3c'),_0x3841c8,JSON[_0x8441('0x39')](_0x19796e));})['finally'](function(){Promise[_0x8441('0x3d')]()[_0x8441('0x36')](function(){if(_0x488e05[0x0]!=='2'||_0x7422c[_0x8441('0x14')])return;return rpc[_0x390b1c+_0x8441('0x3e')][_0x8441('0x3f')](_0x7422c['id'],{'autoreplyExecuted':!![]})[_0x8441('0x36')](function(_0x3d4a85){logger[_0x8441('0xc')](_0x8441('0x15'),_0x3841c8,JSON[_0x8441('0x39')](_0x3d4a85));})['catch'](function(_0x1c7f76){logger['error'](_0x8441('0x40'),_0x3841c8,JSON[_0x8441('0x39')](_0x1c7f76));});})['then'](function(){_0x5ca8b1[_0x8441('0xe')]();});});}else{return rpc[this[_0x8441('0xa')]+'Message'][_0x8441('0x38')](_0xd7da8c)[_0x8441('0x36')](function(){logger[_0x8441('0xc')](_0x8441('0x12'),_0x3841c8,_0xd7da8c[_0x8441('0xb')]);})['catch'](function(_0x1a7c55){logger[_0x8441('0x3b')](_0x8441('0x12'),_0x3841c8,JSON['stringify'](_0x1a7c55));})['finally'](function(){Promise['resolve']()[_0x8441('0x36')](function(){if(_0x488e05[0x0]!=='2'||_0x7422c[_0x8441('0x14')])return;return rpc[_0x390b1c+_0x8441('0x3e')]['update'](_0x7422c['id'],{'autoreplyExecuted':!![]})[_0x8441('0x36')](function(_0x545acf){logger[_0x8441('0xc')](_0x8441('0x15'),_0x3841c8,JSON[_0x8441('0x39')](_0x545acf));})[_0x8441('0x3a')](function(_0x21c1a1){logger[_0x8441('0x3b')](_0x8441('0x40'),_0x3841c8,JSON[_0x8441('0x39')](_0x21c1a1));});})[_0x8441('0x36')](function(){_0x5ca8b1[_0x8441('0xe')]();});});}}}catch(_0x2f49b1){logger[_0x8441('0x3b')](_0x8441('0x12'),_0x3841c8,JSON[_0x8441('0x39')](_0x2f49b1));_0x5ca8b1['stop']();}};}; \ No newline at end of file +var _0x861d=['All','sendMailMessage','smtpOptions','then','messageId','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','finally','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','body','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','mail','subject','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','','replace','','headers'];(function(_0x1ee611,_0x377a3a){var _0x3bce0a=function(_0x5357c6){while(--_0x5357c6){_0x1ee611['push'](_0x1ee611['shift']());}};_0x3bce0a(++_0x377a3a);}(_0x861d,0x150));var _0xd861=function(_0x2937ed,_0xe4ce3f){_0x2937ed=_0x2937ed-0x0;var _0x4cc289=_0x861d[_0x2937ed];return _0x4cc289;};'use strict';var _=require('lodash');var moment=require(_0xd861('0x0'));var utils=require(_0xd861('0x1'));var logger=require(_0xd861('0x2'))('routing');var rpc={'chatMessage':require(_0xd861('0x3')),'openchannelMessage':require(_0xd861('0x4')),'mailMessage':require(_0xd861('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd861('0x6')),'chatInteraction':require(_0xd861('0x7')),'openchannelInteraction':require(_0xd861('0x8')),'mailInteraction':require(_0xd861('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xd861('0xa')),'whatsappInteraction':require(_0xd861('0xb'))};var mailRpc=require('../../mailRpc');exports[_0xd861('0xc')]=function(_0x1ffa1e,_0x320c35,_0x2bd4cf,_0x3edfae){return function(_0x14429a){try{var _0x519665=this[_0xd861('0xd')];if(_0x519665==='mail'&&_0x3edfae[_0xd861('0xe')]['isAutoreply']){logger[_0xd861('0xf')](_0xd861('0x10'),_0x1ffa1e,_0xd861('0x11'));return _0x14429a[_0xd861('0x12')]();}if(_0x320c35[0x0]==='1'&&(_['isNil'](this[_0xd861('0x13')][_0xd861('0x14')])||!this['interaction'][_0xd861('0x14')])){logger[_0xd861('0xf')]('[%s][AUTOREPLY]\x20%s',_0x1ffa1e,_0xd861('0x15'));return _0x14429a[_0xd861('0x12')]();}if(_0x320c35[0x0]==='2'&&this[_0xd861('0x13')][_0xd861('0x16')]){logger[_0xd861('0xf')](_0xd861('0x17'),_0x1ffa1e,_0xd861('0x18'));return _0x14429a[_0xd861('0x12')]();}var _0x1fff58={'ContactId':this[_0xd861('0x19')]['id'],'sentAt':moment()[_0xd861('0x1a')](_0xd861('0x1b')),'direction':_0xd861('0x1c')};if(this[_0xd861('0xd')]==='mail'){_0x1fff58[_0xd861('0xe')]=utils[_0xd861('0x1d')](_0x320c35[0x2],this);}else{_0x1fff58[_0xd861('0xe')]=utils[_0xd861('0x1d')](_0x320c35[0x1],this);}if(this['message']){_0x1fff58['to']=this[_0xd861('0x1e')][_0xd861('0x1f')]||'';if(this[_0xd861('0xd')]===_0xd861('0x20')&&_0x320c35[0x1]==='1'){_0x1fff58['cc']=this[_0xd861('0x1e')]['cc']||'';}_0x1fff58[_0xd861('0x1f')]=this['message']['to']||'';_0x1fff58['phone']=this['message']['phone']||'';_0x1fff58['read']=!![];if(this['message']['subject']){_0x1fff58[_0xd861('0x21')]='';_0x1fff58['subject']+=_['startsWith'](this[_0xd861('0x1e')]['subject'],_0xd861('0x22'))?'':_0xd861('0x23');_0x1fff58[_0xd861('0x21')]+=this[_0xd861('0x1e')][_0xd861('0x21')];}}if(this[_0xd861('0xd')]==='chat'){_0x1fff58[_0xd861('0x24')]=this[_0xd861('0x25')]['id'];}else{_0x1fff58[_[_0xd861('0x26')](this[_0xd861('0xd')])+_0xd861('0x27')]=this[_0xd861('0x25')]['id'];}_0x1fff58[_[_0xd861('0x26')](this[_0xd861('0xd')])+_0xd861('0x28')]=this[_0xd861('0x13')]['id'];var _0x4de030=this[_0xd861('0x13')];if(rpc[this[_0xd861('0xd')]+_0xd861('0x29')]){if(this['channel']===_0xd861('0x20')){_0x1fff58[_0xd861('0x2a')]=this[_0xd861('0x1e')]['messageId'];_0x1fff58['html']=_0xd861('0x2b')+_[_0xd861('0x2c')](_0x1fff58[_0xd861('0xe')],_0xd861('0x2d'),']+(>|$)/g,''),'priorityTrue':_0x3ec9c7[0x1],'priorityFalse':_0x3ec9c7[0x2]};var _0x4dab79=gotoif[_0xcf1d('0xb')](_0x47ab29,{'typecast':!![]});if(_0x4dab79[_0xcf1d('0xc')]){logger[_0xcf1d('0xd')](_0xcf1d('0xe'),_0x26f33c,_[_0xcf1d('0xf')](_0x4dab79,'message')[_0xcf1d('0x10')](',\x20'));_0x4f48f1['stop']();}else{try{var _0x11be80=eval('('+_0x47ab29[_0xcf1d('0x11')]+')');var _0xe6f90e=_0x11be80?_0x47ab29[_0xcf1d('0x12')]:_0x47ab29[_0xcf1d('0x13')];logger[_0xcf1d('0x14')](_0xcf1d('0x15'),_0x26f33c,_0x47ab29['condition'],_0x11be80,_0xe6f90e||_0xcf1d('0x16'));if(_0xe6f90e){var _0x5a4c75=_[_0xcf1d('0x17')](_0x4f48f1['rules'](),{'p':_0xe6f90e});if(_0x5a4c75>=0x0){logger[_0xcf1d('0x14')](_0xcf1d('0x18'),_0x26f33c,_0xe6f90e||_0xcf1d('0x16'),_0x5a4c75);_0x4f48f1['next'](_0x5a4c75);}else{logger[_0xcf1d('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x26f33c,_0xe6f90e||_0xcf1d('0x16'));_0x4f48f1[_0xcf1d('0x19')]();}}else{_0x4f48f1[_0xcf1d('0x16')]();}}catch(_0x470fb0){logger['error'](_0xcf1d('0x1a'),_0x26f33c,_0x470fb0[_0xcf1d('0x1b')]);_0x4f48f1['stop']();}}}catch(_0x31abca){logger[_0xcf1d('0xd')](_0xcf1d('0xe'),_0x26f33c,JSON['stringify'](_0x31abca));_0x4f48f1['stop']();}};}; \ No newline at end of file +var _0x7f05=['./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate'];(function(_0x26d26f,_0x302cce){var _0x5c8c0e=function(_0x519b9d){while(--_0x519b9d){_0x26d26f['push'](_0x26d26f['shift']());}};_0x5c8c0e(++_0x302cce);}(_0x7f05,0x1bf));var _0x57f0=function(_0x4f13e0,_0x2dee33){_0x4f13e0=_0x4f13e0-0x0;var _0x86c50c=_0x7f05[_0x4f13e0];return _0x86c50c;};'use strict';var schema=require(_0x57f0('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0x57f0('0x1'));var logger=require(_0x57f0('0x2'))(_0x57f0('0x3'));var gotoif=schema({'condition':{'type':_0x57f0('0x4'),'required':!![],'message':_0x57f0('0x5')},'priorityTrue':{'type':_0x57f0('0x6'),'message':_0x57f0('0x7')},'priorityFalse':{'type':'number','message':_0x57f0('0x8')}});exports[_0x57f0('0x9')]=function(_0x209f40,_0x4bca09){return function(_0x5236d4){try{var _0x4bd8f4={'condition':htmlToText['fromString'](utils[_0x57f0('0xa')](_0x4bca09[0x0],this),{'wordwrap':![]})[_0x57f0('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4bca09[0x1],'priorityFalse':_0x4bca09[0x2]};var _0x1c9722=gotoif[_0x57f0('0x0')](_0x4bd8f4,{'typecast':!![]});if(_0x1c9722[_0x57f0('0xc')]){logger[_0x57f0('0xd')](_0x57f0('0xe'),_0x209f40,_[_0x57f0('0xf')](_0x1c9722,'message')[_0x57f0('0x10')](',\x20'));_0x5236d4[_0x57f0('0x11')]();}else{try{var _0x56be3d=eval('('+_0x4bd8f4['condition']+')');var _0x4d4850=_0x56be3d?_0x4bd8f4[_0x57f0('0x12')]:_0x4bd8f4[_0x57f0('0x13')];logger[_0x57f0('0x14')](_0x57f0('0x15'),_0x209f40,_0x4bd8f4['condition'],_0x56be3d,_0x4d4850||_0x57f0('0x16'));if(_0x4d4850){var _0x87e391=_['findIndex'](_0x5236d4[_0x57f0('0x17')](),{'p':_0x4d4850});if(_0x87e391>=0x0){logger[_0x57f0('0x14')](_0x57f0('0x18'),_0x209f40,_0x4d4850||_0x57f0('0x16'),_0x87e391);_0x5236d4[_0x57f0('0x16')](_0x87e391);}else{logger[_0x57f0('0x14')](_0x57f0('0x19'),_0x209f40,_0x4d4850||_0x57f0('0x16'));_0x5236d4[_0x57f0('0x11')]();}}else{_0x5236d4[_0x57f0('0x16')]();}}catch(_0x2ea53e){logger[_0x57f0('0xd')](_0x57f0('0x1a'),_0x209f40,_0x2ea53e['message']);_0x5236d4['stop']();}}}catch(_0x420ace){logger['error'](_0x57f0('0xe'),_0x209f40,JSON[_0x57f0('0x1b')](_0x420ace));_0x5236d4[_0x57f0('0x11')]();}};}; \ 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 b349063..a822598 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 _0x8fe9=['stop','stringify','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0x8fe9,0x156));var _0x98fe=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x8fe9[_0x534c8f];return _0x5a57f5;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require('../../../../config/logger')(_0x98fe('0x0'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x98fe('0x1')}});exports[_0x98fe('0x2')]=function(_0x52d637,_0x33b3bd){return function(_0x1e0ea1){try{var _0x36fc3b={'priority':_0x33b3bd[0x0]};var _0x38dac4=gotop['validate'](_0x36fc3b,{'typecast':!![]});if(_0x38dac4[_0x98fe('0x3')]){logger[_0x98fe('0x4')](_0x98fe('0x5'),_0x52d637,_[_0x98fe('0x6')](_0x38dac4,_0x98fe('0x7'))['join'](',\x20'));_0x1e0ea1['stop']();}else{logger['info'](_0x98fe('0x8'),_0x52d637,_0x36fc3b[_0x98fe('0x9')]);if(_0x36fc3b[_0x98fe('0x9')]){var _0x4e0601=_[_0x98fe('0xa')](_0x1e0ea1[_0x98fe('0xb')](),{'p':_0x36fc3b[_0x98fe('0x9')]});if(_0x4e0601>=0x0){logger['info'](_0x98fe('0xc'),_0x52d637,_0x36fc3b[_0x98fe('0x9')]||'next',_0x4e0601);_0x1e0ea1[_0x98fe('0xd')](_0x4e0601);}else{logger['info'](_0x98fe('0xe'),_0x52d637,_0x36fc3b[_0x98fe('0x9')]||_0x98fe('0xd'));_0x1e0ea1[_0x98fe('0xf')]();}}else{_0x1e0ea1['next']();}}}catch(_0x4886e5){logger['error'](_0x98fe('0x5'),_0x52d637,JSON[_0x98fe('0x10')](_0x4886e5));_0x1e0ea1[_0x98fe('0xf')]();}};}; \ No newline at end of file +var _0xb009=['[%s][GOTOP]\x20%s','message','join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error'];(function(_0x15ea09,_0x2f30ab){var _0x3e9c78=function(_0x15f8ba){while(--_0x15f8ba){_0x15ea09['push'](_0x15ea09['shift']());}};_0x3e9c78(++_0x2f30ab);}(_0xb009,0xb2));var _0x9b00=function(_0x2bc295,_0x34d992){_0x2bc295=_0x2bc295-0x0;var _0x5d4c21=_0xb009[_0x2bc295];return _0x5d4c21;};'use strict';var schema=require(_0x9b00('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x9b00('0x1')}});exports[_0x9b00('0x2')]=function(_0x1129a4,_0x2a4827){return function(_0x4b8bf8){try{var _0x189d53={'priority':_0x2a4827[0x0]};var _0x2d81f6=gotop[_0x9b00('0x0')](_0x189d53,{'typecast':!![]});if(_0x2d81f6['length']){logger[_0x9b00('0x3')](_0x9b00('0x4'),_0x1129a4,_['map'](_0x2d81f6,_0x9b00('0x5'))[_0x9b00('0x6')](',\x20'));_0x4b8bf8[_0x9b00('0x7')]();}else{logger[_0x9b00('0x8')]('[%s][GOTOP]\x20priority\x20%s',_0x1129a4,_0x189d53[_0x9b00('0x9')]);if(_0x189d53[_0x9b00('0x9')]){var _0xef1c6f=_[_0x9b00('0xa')](_0x4b8bf8[_0x9b00('0xb')](),{'p':_0x189d53[_0x9b00('0x9')]});if(_0xef1c6f>=0x0){logger[_0x9b00('0x8')](_0x9b00('0xc'),_0x1129a4,_0x189d53[_0x9b00('0x9')]||'next',_0xef1c6f);_0x4b8bf8['next'](_0xef1c6f);}else{logger[_0x9b00('0x8')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1129a4,_0x189d53['priority']||_0x9b00('0xd'));_0x4b8bf8[_0x9b00('0x7')]();}}else{_0x4b8bf8[_0x9b00('0xd')]();}}}catch(_0xd93895){logger[_0x9b00('0x3')](_0x9b00('0x4'),_0x1129a4,JSON['stringify'](_0xd93895));_0x4b8bf8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index f6c1a86..c48f715 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 _0x48cb=['error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x48cb,0x16f));var _0xb48c=function(_0x3cdebc,_0x45fb74){_0x3cdebc=_0x3cdebc-0x0;var _0x4d7726=_0x48cb[_0x3cdebc];return _0x4d7726;};'use strict';var _=require(_0xb48c('0x0'));var utils=require(_0xb48c('0x1'));var logger=require(_0xb48c('0x2'))(_0xb48c('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb48c('0x4')),'mailMessage':require(_0xb48c('0x5')),'smsMessage':require(_0xb48c('0x6')),'faxMessage':require(_0xb48c('0x7')),'whatsappMessage':require(_0xb48c('0x8'))};exports[_0xb48c('0x9')]=function(_0x2b4bf1,_0x46ed6b){return function(_0x512041){try{var _0x51cec9={'body':utils[_0xb48c('0xa')](_0x46ed6b[0x0],this),'ContactId':this[_0xb48c('0xb')]['id']};if(this[_0xb48c('0xc')]==='chat'){_0x51cec9[_0xb48c('0xd')]=this[_0xb48c('0xe')]['id'];}else{_0x51cec9[_[_0xb48c('0xf')](this['channel'])+_0xb48c('0x10')]=this['account']['id'];}_0x51cec9[_[_0xb48c('0xf')](this[_0xb48c('0xc')])+'InteractionId']=this[_0xb48c('0x11')]['id'];if(rpc[this['channel']+_0xb48c('0x12')]){return rpc[this['channel']+'Message'][_0xb48c('0x13')](_0x51cec9)[_0xb48c('0x14')](function(_0x1be1db){logger[_0xb48c('0x15')](_0xb48c('0x16'),_0x2b4bf1,_0x51cec9[_0xb48c('0x17')]);_0x512041[_0xb48c('0x18')]();})['catch'](function(_0x41aa95){logger[_0xb48c('0x19')](_0xb48c('0x16'),_0x2b4bf1,JSON[_0xb48c('0x1a')](_0x41aa95));_0x512041[_0xb48c('0x1b')]();});}}catch(_0x531269){logger[_0xb48c('0x19')](_0xb48c('0x16'),_0x2b4bf1,JSON[_0xb48c('0x1a')](_0x531269));_0x512041[_0xb48c('0x1b')]();}};}; \ No newline at end of file +var _0x726f=['account','upperFirst','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','stringify','stop','error','lodash','./utils','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId'];(function(_0x35bbdf,_0x1ac88d){var _0x27ef28=function(_0x1fd0b7){while(--_0x1fd0b7){_0x35bbdf['push'](_0x35bbdf['shift']());}};_0x27ef28(++_0x1ac88d);}(_0x726f,0xa2));var _0xf726=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x726f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xf726('0x0'));var utils=require(_0xf726('0x1'));var logger=require('../../../../config/logger')(_0xf726('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf726('0x3')),'smsMessage':require(_0xf726('0x4')),'faxMessage':require(_0xf726('0x5')),'whatsappMessage':require(_0xf726('0x6'))};exports[_0xf726('0x7')]=function(_0x328eae,_0x26ba00){return function(_0x1cae3f){try{var _0x2dd6b8={'body':utils[_0xf726('0x8')](_0x26ba00[0x0],this),'ContactId':this[_0xf726('0x9')]['id']};if(this[_0xf726('0xa')]===_0xf726('0xb')){_0x2dd6b8[_0xf726('0xc')]=this[_0xf726('0xd')]['id'];}else{_0x2dd6b8[_[_0xf726('0xe')](this[_0xf726('0xa')])+'AccountId']=this['account']['id'];}_0x2dd6b8[_['upperFirst'](this[_0xf726('0xa')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0xf726('0xa')]+_0xf726('0xf')]){return rpc[this['channel']+_0xf726('0xf')][_0xf726('0x10')](_0x2dd6b8)[_0xf726('0x11')](function(_0x1def78){logger[_0xf726('0x12')](_0xf726('0x13'),_0x328eae,_0x2dd6b8[_0xf726('0x14')]);_0x1cae3f[_0xf726('0x15')]();})['catch'](function(_0x3c6256){logger['error']('[%s][MESSAGE]\x20%s',_0x328eae,JSON[_0xf726('0x16')](_0x3c6256));_0x1cae3f[_0xf726('0x17')]();});}}catch(_0x5dee54){logger[_0xf726('0x18')](_0xf726('0x13'),_0x328eae,JSON[_0xf726('0x16')](_0x5dee54));_0x1cae3f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 279d2de..715788c 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 _0x472b=['stringify','stop','./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x3d24b1,_0xc79289){var _0x47b56e=function(_0x382ad2){while(--_0x382ad2){_0x3d24b1['push'](_0x3d24b1['shift']());}};_0x47b56e(++_0xc79289);}(_0x472b,0xfc));var _0xb472=function(_0xbad79b,_0x2dbe6a){_0xbad79b=_0xbad79b-0x0;var _0x42eaa6=_0x472b[_0xbad79b];return _0x42eaa6;};'use strict';var utils=require(_0xb472('0x0'));var logger=require('../../../../config/logger')(_0xb472('0x1'));exports[_0xb472('0x2')]=function(_0x44ac47,_0x180770){return function(_0x5e7d17){try{logger[_0xb472('0x3')](_0xb472('0x4'),_0x44ac47,utils[_0xb472('0x5')](_0x180770[0x0],this));_0x5e7d17[_0xb472('0x6')]();}catch(_0xa5c67f){logger[_0xb472('0x7')](_0xb472('0x4'),_0x44ac47,JSON[_0xb472('0x8')](_0xa5c67f));_0x5e7d17[_0xb472('0x9')]();}};}; \ No newline at end of file +var _0xef6d=['error','[%s][NOOP]\x20%s','stop','routing','consequence','info','getMustacheRender'];(function(_0x43e97d,_0x56a06b){var _0x424cd9=function(_0x4f574b){while(--_0x4f574b){_0x43e97d['push'](_0x43e97d['shift']());}};_0x424cd9(++_0x56a06b);}(_0xef6d,0xf8));var _0xdef6=function(_0x26aa6a,_0x31649d){_0x26aa6a=_0x26aa6a-0x0;var _0x58b0ef=_0xef6d[_0x26aa6a];return _0x58b0ef;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0xdef6('0x0'));exports[_0xdef6('0x1')]=function(_0x3af021,_0x11defd){return function(_0x9cc35){try{logger[_0xdef6('0x2')]('[%s][NOOP]\x20%s',_0x3af021,utils[_0xdef6('0x3')](_0x11defd[0x0],this));_0x9cc35['next']();}catch(_0x490f6c){logger[_0xdef6('0x4')](_0xdef6('0x5'),_0x3af021,JSON['stringify'](_0x490f6c));_0x9cc35[_0xdef6('0x6')]();}};}; \ 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 8927dd2..252780d 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 _0xb7b7=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','update','catch','update\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','timeout','toLowerCase','map','join','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stop','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','emit','clone','capitalize','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s'];(function(_0x3658ce,_0x9fc347){var _0x3afdaf=function(_0x24587c){while(--_0x24587c){_0x3658ce['push'](_0x3658ce['shift']());}};_0x3afdaf(++_0x9fc347);}(_0xb7b7,0xce));var _0x7b7b=function(_0x22dcfe,_0x429156){_0x22dcfe=_0x22dcfe-0x0;var _0x39a0ab=_0xb7b7[_0x22dcfe];return _0x39a0ab;};'use strict';var schema=require(_0x7b7b('0x0'));var _=require(_0x7b7b('0x1'));var util=require(_0x7b7b('0x2'));var seqqueue=require(_0x7b7b('0x3'));var moment=require(_0x7b7b('0x4'));var Redis=require('ioredis');var config=require(_0x7b7b('0x5'));var logger=require(_0x7b7b('0x6'))(_0x7b7b('0x7'));var strategy=require(_0x7b7b('0x8'));config[_0x7b7b('0x9')]=_[_0x7b7b('0xa')](config[_0x7b7b('0x9')],{'host':_0x7b7b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7b7b('0x9')]));var attributes=['id',_0x7b7b('0xc'),_0x7b7b('0xd'),_0x7b7b('0xe'),_0x7b7b('0xf'),_0x7b7b('0x10')];function emit(_0x231bde,_0x463f0b,_0x1c1ee2){io['to'](_0x231bde)[_0x7b7b('0x11')](_0x463f0b,_0x1c1ee2);}function emitChannelQueueInteraction(_0x30727a,_0x4f4e93,_0x490bea,_0x49b887,_0x2b567d,_0x2a6d64,_0x256c5f,_0x3b1365){var _0x258a17=_[_0x7b7b('0x12')](_0x490bea);_0x258a17[_0x7b7b('0xc')]=_0x3b1365;_0x258a17[_0x7b7b('0xe')]=_0x4f4e93;_0x258a17[_0x7b7b('0xd')]=_0x49b887;_0x258a17['id']=_0x2b567d;if(_0x2a6d64){attributes['push'](_[_0x7b7b('0x13')](_0x30727a)+'InteractionId');_0x256c5f[util[_0x7b7b('0x14')](_0x7b7b('0x15'),_0x30727a)][_0x2b567d]=_[_0x7b7b('0x16')](_0x258a17,attributes);}else{delete _0x256c5f[util[_0x7b7b('0x14')](_0x7b7b('0x15'),_0x30727a)][_0x2b567d];}emit(util[_0x7b7b('0x14')](_0x7b7b('0x17'),_0x30727a,_0x4f4e93),util[_0x7b7b('0x14')](_0x7b7b('0x18'),_0x30727a,_0x2a6d64?'save':'remove'),_[_0x7b7b('0x16')](_0x258a17,attributes));}var rpc={'openchannelQueueReport':require(_0x7b7b('0x19')),'mailQueueReport':require(_0x7b7b('0x1a')),'chatQueueReport':require(_0x7b7b('0x1b')),'smsQueueReport':require(_0x7b7b('0x1c')),'faxQueueReport':require(_0x7b7b('0x1d')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x7b7b('0x1e')}});function startRouting(_0x36a848,_0x394e5c,_0x56e1a9,_0x7a1f03){if(_0x36a848&&_0x394e5c&&_0x56e1a9){_0x394e5c[_0x7b7b('0x1f')]+=0x1;var _0x5d4e64={'uniqueid':_0x36a848,'from':_0x56e1a9[_0x7b7b('0x20')]?_0x56e1a9[_0x7b7b('0x20')][_0x7b7b('0xf')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x56e1a9['contact']?_0x56e1a9[_0x7b7b('0x21')]['id']:null,'ListId':_0x56e1a9[_0x7b7b('0x22')]?_0x56e1a9[_0x7b7b('0x22')]['id']:null};_0x5d4e64[_[_0x7b7b('0x23')](_0x56e1a9[_0x7b7b('0x24')])+_0x7b7b('0x25')]=_0x394e5c['id']||null;_0x5d4e64[_[_0x7b7b('0x23')](_0x56e1a9['channel'])+_0x7b7b('0x26')]=_0x56e1a9[_0x7b7b('0x27')]?_0x56e1a9[_0x7b7b('0x27')]['id']:null;_0x5d4e64[_[_0x7b7b('0x23')](_0x56e1a9[_0x7b7b('0x24')])+'MessageId']=_0x56e1a9[_0x7b7b('0x28')]?_0x56e1a9['message']['id']:null;_0x5d4e64[_[_0x7b7b('0x23')](_0x56e1a9[_0x7b7b('0x24')])+(_0x56e1a9['channel']!==_0x7b7b('0x29')?_0x7b7b('0x2a'):_0x7b7b('0x2b'))]=_0x56e1a9[_0x7b7b('0xd')]?_0x56e1a9[_0x7b7b('0xd')]['id']:null;logger[_0x7b7b('0x2c')](util[_0x7b7b('0x14')](_0x7b7b('0x2d'),_0x36a848,_0x394e5c[_0x7b7b('0x2e')]));emitChannelQueueInteraction(_0x56e1a9['channel'],_0x394e5c[_0x7b7b('0x2e')],_0x5d4e64,_0x56e1a9[_0x7b7b('0xd')][_0x7b7b('0x2e')],_0x56e1a9[_0x7b7b('0x28')]['id'],!![],_0x7a1f03,_0x394e5c['id']);if(rpc[_0x56e1a9[_0x7b7b('0x24')]+_0x7b7b('0x2f')]){return rpc[_0x56e1a9[_0x7b7b('0x24')]+_0x7b7b('0x2f')][_0x7b7b('0x30')](_0x5d4e64)['catch'](function(_0x40e7fe){logger[_0x7b7b('0x31')](_0x7b7b('0x32'));});}}}function stopRouting(_0x36cea4,_0x4a1a86,_0x38d1a9,_0x3d4c28){if(_0x36cea4&&_0x4a1a86){_0x4a1a86['waiting']-=0x1;var _0x3b6b44={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x7b7b('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7b7b('0x33')};logger[_0x7b7b('0x2c')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x36cea4,_0x4a1a86['name']));emitChannelQueueInteraction(_0x38d1a9['channel'],_0x4a1a86[_0x7b7b('0x2e')],_0x38d1a9[_0x7b7b('0x20')],_0x38d1a9[_0x7b7b('0xd')][_0x7b7b('0x2e')],_0x38d1a9['message']['id'],![],_0x3d4c28,_0x4a1a86['id']);if(rpc[_0x38d1a9[_0x7b7b('0x24')]+_0x7b7b('0x2f')]){return rpc[_0x38d1a9[_0x7b7b('0x24')]+_0x7b7b('0x2f')][_0x7b7b('0x34')](_0x36cea4,_0x3b6b44)[_0x7b7b('0x35')](function(_0x5bec76){logger[_0x7b7b('0x31')](_0x7b7b('0x36'));});}}}function endRouting(_0x172f3f,_0x427a10,_0x1f9016,_0x582f11){if(_0x172f3f&&_0x427a10){_0x427a10[_0x7b7b('0x1f')]-=0x1;var _0x248f17={'leaveAt':moment()[_0x7b7b('0x14')](_0x7b7b('0x37')),'exitAt':moment()['format'](_0x7b7b('0x37')),'reason':_0x7b7b('0x38')};logger[_0x7b7b('0x2c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x172f3f,_0x427a10[_0x7b7b('0x2e')]));emitChannelQueueInteraction(_0x1f9016[_0x7b7b('0x24')],_0x427a10['name'],_0x1f9016[_0x7b7b('0x20')],_0x1f9016[_0x7b7b('0xd')][_0x7b7b('0x2e')],_0x1f9016[_0x7b7b('0x28')]['id'],![],_0x582f11);if(rpc[_0x1f9016[_0x7b7b('0x24')]+_0x7b7b('0x2f')]){return rpc[_0x1f9016[_0x7b7b('0x24')]+_0x7b7b('0x2f')][_0x7b7b('0x34')](_0x172f3f,_0x248f17)[_0x7b7b('0x35')](function(_0x3424da){logger[_0x7b7b('0x31')](_0x7b7b('0x36'));});}}}function handleFindQueue(_0x353120){return function(_0xedd57a){return _0xedd57a[_0x7b7b('0x2e')][_0x7b7b('0x39')]()===_0x353120[_0x7b7b('0x39')]();};}exports['consequence']=function(_0xd89f28,_0x406c70,_0xfb68bb,_0x452eb7){return function(_0x48d147){try{var _0x1b9e8f={'name':_0x406c70[0x0],'timeout':_0x406c70[0x1]};var _0x37c6d6=queue[_0x7b7b('0x0')](_0x1b9e8f,{'typecast':!![]});if(_0x37c6d6['length']){logger[_0x7b7b('0x31')]('[%s][QUEUE]\x20%s',_0xd89f28,_[_0x7b7b('0x3a')](_0x37c6d6,_0x7b7b('0x28'))[_0x7b7b('0x3b')](',\x20'));_0x48d147['stop']();}else{var _0x3d6f6e=_['find'](_0xfb68bb[_0x452eb7[_0x7b7b('0x24')]+_0x7b7b('0x3c')],handleFindQueue(_0x1b9e8f['name']));if(_0x3d6f6e){startRouting(_0xd89f28,_0x3d6f6e,_0x452eb7,_0xfb68bb);var _0x56b7c5=(_0x3d6f6e[_0x7b7b('0x38')]||0xa)*0x3e8;var _0x4112ef=(_0x1b9e8f[_0x7b7b('0x38')]||0x14)*0x3e8;var _0x53a427;if(_0x56b7c5>_0x4112ef){_0x4112ef=_0x56b7c5;}var _0x393c05=seqqueue[_0x7b7b('0x3d')](_0x56b7c5);_0x393c05['id']=_0xd89f28;_0x393c05[_0x7b7b('0x3e')]=_0x56b7c5;_0x393c05[_0x7b7b('0x3f')]=_0x4112ef;_0x393c05[_0x7b7b('0x24')]=_0x452eb7[_0x7b7b('0x24')];_0xfb68bb[_0x7b7b('0x40')][_0xd89f28]['on'](_0x7b7b('0x41'),function(){logger[_0x7b7b('0x2c')](_0x7b7b('0x42'),_0xd89f28);stopRouting(_0xd89f28,_0x3d6f6e,_0x452eb7,_0xfb68bb);clearTimeout(_0x53a427);_0x53a427=undefined;_0x393c05[_0x7b7b('0x43')](!![]);if(_0xfb68bb[_0x7b7b('0x40')][_0xd89f28]){delete _0xfb68bb[_0x7b7b('0x40')][_0xd89f28];}_0x48d147['stop']();});_0xfb68bb[_0x7b7b('0x40')][_0xd89f28]['on']('complete',function(){if(_0xfb68bb[_0x7b7b('0x40')][_0xd89f28]){delete _0xfb68bb[_0x7b7b('0x40')][_0xd89f28];}});_0x53a427=setTimeout(function(){logger[_0x7b7b('0x2c')](_0x7b7b('0x44'),_0xd89f28);endRouting(_0xd89f28,_0x3d6f6e,_0x452eb7,_0xfb68bb);clearTimeout(_0x53a427);_0x393c05[_0x7b7b('0x43')](!![]);_0x48d147[_0x7b7b('0x45')]();},_0x4112ef);switch(_0x3d6f6e[_0x7b7b('0x46')]){case _0x7b7b('0x47'):strategy[_0x7b7b('0x47')](_0x393c05,_0x3d6f6e,_0xfb68bb,_0x452eb7);break;default:strategy[_0x7b7b('0x48')](_0x393c05,_0x3d6f6e,_0xfb68bb,_0x452eb7);}}else{logger['error'](_0x7b7b('0x49'),_0xd89f28,_0x1b9e8f['name']);_0x48d147[_0x7b7b('0x4a')]();}}}catch(_0x5124ce){console['log'](_0x5124ce);logger['error'](_0x7b7b('0x4b'),_0xd89f28,_0x5124ce[_0x7b7b('0x4c')]);_0x48d147['stop']();}};}; \ No newline at end of file +var _0x656b=['%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','QueueId','interaction','channel','MessageId','message','chat','AccountId','info','name','QueueReport','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','[%s][QUEUE]\x20%s','join','stop','Queues','atimeout','qtimeout','rules','end','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','moment','ioredis','../../../../config/environment','routing','./strategy','defaults','redis','localhost','account','queue','emit','queue_id','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions'];(function(_0x549b95,_0x2084ec){var _0x790cb2=function(_0x4b1169){while(--_0x4b1169){_0x549b95['push'](_0x549b95['shift']());}};_0x790cb2(++_0x2084ec);}(_0x656b,0xcb));var _0xb656=function(_0x288b01,_0x1328cb){_0x288b01=_0x288b01-0x0;var _0x3e1409=_0x656b[_0x288b01];return _0x3e1409;};'use strict';var schema=require(_0xb656('0x0'));var _=require(_0xb656('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require(_0xb656('0x2'));var Redis=require(_0xb656('0x3'));var config=require(_0xb656('0x4'));var logger=require('../../../../config/logger')(_0xb656('0x5'));var strategy=require(_0xb656('0x6'));config['redis']=_[_0xb656('0x7')](config[_0xb656('0x8')],{'host':_0xb656('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb656('0x8')]));var attributes=['id','queue_id',_0xb656('0xa'),_0xb656('0xb'),'from','joinAt'];function emit(_0x42ce15,_0xd80240,_0x4a3b5d){io['to'](_0x42ce15)[_0xb656('0xc')](_0xd80240,_0x4a3b5d);}function emitChannelQueueInteraction(_0x2df9ea,_0x23fffc,_0x414d6e,_0x641bba,_0xdeba27,_0x2537b3,_0x353f7e,_0x4784d8){var _0x6dac01=_['clone'](_0x414d6e);_0x6dac01[_0xb656('0xd')]=_0x4784d8;_0x6dac01[_0xb656('0xb')]=_0x23fffc;_0x6dac01[_0xb656('0xa')]=_0x641bba;_0x6dac01['id']=_0xdeba27;if(_0x2537b3){attributes[_0xb656('0xe')](_[_0xb656('0xf')](_0x2df9ea)+_0xb656('0x10'));_0x353f7e[util[_0xb656('0x11')](_0xb656('0x12'),_0x2df9ea)][_0xdeba27]=_['pick'](_0x6dac01,attributes);}else{delete _0x353f7e[util[_0xb656('0x11')](_0xb656('0x12'),_0x2df9ea)][_0xdeba27];}emit(util[_0xb656('0x11')](_0xb656('0x13'),_0x2df9ea,_0x23fffc),util[_0xb656('0x11')](_0xb656('0x14'),_0x2df9ea,_0x2537b3?_0xb656('0x15'):_0xb656('0x16')),_['pick'](_0x6dac01,attributes));}var rpc={'openchannelQueueReport':require(_0xb656('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xb656('0x18')),'faxQueueReport':require(_0xb656('0x19')),'whatsappQueueReport':require(_0xb656('0x1a'))};var queue=schema({'name':{'type':_0xb656('0x1b'),'required':!![],'message':_0xb656('0x1c')},'timeout':{'type':'number','message':_0xb656('0x1d')}});function startRouting(_0x494488,_0x1282cc,_0x179c41,_0x5618e5){if(_0x494488&&_0x1282cc&&_0x179c41){_0x1282cc[_0xb656('0x1e')]+=0x1;var _0x3e7975={'uniqueid':_0x494488,'from':_0x179c41['body']?_0x179c41[_0xb656('0x1f')][_0xb656('0x20')]:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x179c41[_0xb656('0x21')]?_0x179c41['contact']['id']:null,'ListId':_0x179c41[_0xb656('0x22')]?_0x179c41[_0xb656('0x22')]['id']:null};_0x3e7975[_[_0xb656('0x23')](_0x179c41['channel'])+_0xb656('0x24')]=_0x1282cc['id']||null;_0x3e7975[_[_0xb656('0x23')](_0x179c41['channel'])+_0xb656('0x10')]=_0x179c41['interaction']?_0x179c41[_0xb656('0x25')]['id']:null;_0x3e7975[_['upperFirst'](_0x179c41[_0xb656('0x26')])+_0xb656('0x27')]=_0x179c41['message']?_0x179c41[_0xb656('0x28')]['id']:null;_0x3e7975[_[_0xb656('0x23')](_0x179c41[_0xb656('0x26')])+(_0x179c41[_0xb656('0x26')]!==_0xb656('0x29')?_0xb656('0x2a'):'WebsiteId')]=_0x179c41[_0xb656('0xa')]?_0x179c41[_0xb656('0xa')]['id']:null;logger[_0xb656('0x2b')](util[_0xb656('0x11')]('[%s][START:QUEUE][NAME:%s]',_0x494488,_0x1282cc['name']));emitChannelQueueInteraction(_0x179c41['channel'],_0x1282cc[_0xb656('0x2c')],_0x3e7975,_0x179c41[_0xb656('0xa')][_0xb656('0x2c')],_0x179c41[_0xb656('0x28')]['id'],!![],_0x5618e5,_0x1282cc['id']);if(rpc[_0x179c41[_0xb656('0x26')]+_0xb656('0x2d')]){return rpc[_0x179c41[_0xb656('0x26')]+_0xb656('0x2d')]['create'](_0x3e7975)['catch'](function(_0x57cfee){logger[_0xb656('0x2e')](_0xb656('0x2f'));});}}}function stopRouting(_0x418ad8,_0x589cbf,_0x1dea6b,_0x247aa7){if(_0x418ad8&&_0x589cbf){_0x589cbf[_0xb656('0x1e')]-=0x1;var _0x1a96cf={'leaveAt':moment()['format'](_0xb656('0x30')),'acceptAt':moment()[_0xb656('0x11')](_0xb656('0x30')),'reason':'accepted'};logger['info'](util[_0xb656('0x11')](_0xb656('0x31'),_0x418ad8,_0x589cbf['name']));emitChannelQueueInteraction(_0x1dea6b[_0xb656('0x26')],_0x589cbf[_0xb656('0x2c')],_0x1dea6b[_0xb656('0x1f')],_0x1dea6b[_0xb656('0xa')][_0xb656('0x2c')],_0x1dea6b[_0xb656('0x28')]['id'],![],_0x247aa7,_0x589cbf['id']);if(rpc[_0x1dea6b[_0xb656('0x26')]+_0xb656('0x2d')]){return rpc[_0x1dea6b[_0xb656('0x26')]+'QueueReport']['update'](_0x418ad8,_0x1a96cf)[_0xb656('0x32')](function(_0x2658d6){logger[_0xb656('0x2e')](_0xb656('0x33'));});}}}function endRouting(_0x4257aa,_0x252876,_0x31fc4f,_0x70bcbf){if(_0x4257aa&&_0x252876){_0x252876[_0xb656('0x1e')]-=0x1;var _0x1d6c9a={'leaveAt':moment()[_0xb656('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xb656('0x11')](_0xb656('0x30')),'reason':_0xb656('0x34')};logger[_0xb656('0x2b')](util[_0xb656('0x11')](_0xb656('0x35'),_0x4257aa,_0x252876[_0xb656('0x2c')]));emitChannelQueueInteraction(_0x31fc4f[_0xb656('0x26')],_0x252876[_0xb656('0x2c')],_0x31fc4f['body'],_0x31fc4f[_0xb656('0xa')][_0xb656('0x2c')],_0x31fc4f[_0xb656('0x28')]['id'],![],_0x70bcbf);if(rpc[_0x31fc4f['channel']+_0xb656('0x2d')]){return rpc[_0x31fc4f[_0xb656('0x26')]+_0xb656('0x2d')][_0xb656('0x36')](_0x4257aa,_0x1d6c9a)[_0xb656('0x32')](function(_0x1af4a8){logger[_0xb656('0x2e')](_0xb656('0x33'));});}}}function handleFindQueue(_0x58e092){return function(_0x3187e7){return _0x3187e7[_0xb656('0x2c')]['toLowerCase']()===_0x58e092[_0xb656('0x37')]();};}exports[_0xb656('0x38')]=function(_0x433130,_0x5314a4,_0x2b6cf5,_0x1f2e5b){return function(_0x4002f7){try{var _0x249e68={'name':_0x5314a4[0x0],'timeout':_0x5314a4[0x1]};var _0x2ce197=queue[_0xb656('0x0')](_0x249e68,{'typecast':!![]});if(_0x2ce197['length']){logger[_0xb656('0x2e')](_0xb656('0x39'),_0x433130,_['map'](_0x2ce197,_0xb656('0x28'))[_0xb656('0x3a')](',\x20'));_0x4002f7[_0xb656('0x3b')]();}else{var _0x159454=_['find'](_0x2b6cf5[_0x1f2e5b[_0xb656('0x26')]+_0xb656('0x3c')],handleFindQueue(_0x249e68[_0xb656('0x2c')]));if(_0x159454){startRouting(_0x433130,_0x159454,_0x1f2e5b,_0x2b6cf5);var _0x5a457d=(_0x159454[_0xb656('0x34')]||0xa)*0x3e8;var _0x20719b=(_0x249e68[_0xb656('0x34')]||0x14)*0x3e8;var _0x12779;if(_0x5a457d>_0x20719b){_0x20719b=_0x5a457d;}var _0x2a9ef0=seqqueue['createQueue'](_0x5a457d);_0x2a9ef0['id']=_0x433130;_0x2a9ef0[_0xb656('0x3d')]=_0x5a457d;_0x2a9ef0[_0xb656('0x3e')]=_0x20719b;_0x2a9ef0[_0xb656('0x26')]=_0x1f2e5b[_0xb656('0x26')];_0x2b6cf5[_0xb656('0x3f')][_0x433130]['on'](_0xb656('0x40'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x433130);stopRouting(_0x433130,_0x159454,_0x1f2e5b,_0x2b6cf5);clearTimeout(_0x12779);_0x12779=undefined;_0x2a9ef0['close'](!![]);if(_0x2b6cf5[_0xb656('0x3f')][_0x433130]){delete _0x2b6cf5['rules'][_0x433130];}_0x4002f7[_0xb656('0x3b')]();});_0x2b6cf5['rules'][_0x433130]['on'](_0xb656('0x41'),function(){if(_0x2b6cf5[_0xb656('0x3f')][_0x433130]){delete _0x2b6cf5[_0xb656('0x3f')][_0x433130];}});_0x12779=setTimeout(function(){logger[_0xb656('0x2b')](_0xb656('0x42'),_0x433130);endRouting(_0x433130,_0x159454,_0x1f2e5b,_0x2b6cf5);clearTimeout(_0x12779);_0x2a9ef0[_0xb656('0x43')](!![]);_0x4002f7[_0xb656('0x44')]();},_0x20719b);switch(_0x159454['strategy']){case'rrmemory':strategy[_0xb656('0x45')](_0x2a9ef0,_0x159454,_0x2b6cf5,_0x1f2e5b);break;default:strategy[_0xb656('0x46')](_0x2a9ef0,_0x159454,_0x2b6cf5,_0x1f2e5b);}}else{logger[_0xb656('0x2e')](_0xb656('0x47'),_0x433130,_0x249e68[_0xb656('0x2c')]);_0x4002f7[_0xb656('0x3b')]();}}}catch(_0x48165f){console[_0xb656('0x48')](_0x48165f);logger[_0xb656('0x2e')]('[%s][QUEUE]\x20%s',_0x433130,_0x48165f[_0xb656('0x49')]);_0x4002f7['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 7b7339b..cc53d26 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 _0xd0bb=['RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','push','bind','handleTimeout','timeout','drained','prototype','handleRun','handleDrained','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','isAgentAvailable','channel','busy','saveWaitingNotification','showNotification','writeLog'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x3a4b2a,_0x1d17d2){_0x3a4b2a=_0x3a4b2a-0x0;var _0xe2640e=_0xd0bb[_0x3a4b2a];return _0xe2640e;};'use strict';var _=require(_0xbd0b('0x0'));var uuid=require(_0xbd0b('0x1'));var util=require(_0xbd0b('0x2'));var logger=require('../../../../../config/logger')(_0xbd0b('0x3'));var Agent=function(_0x4ab08f,_0x39b03a,_0x1f6ec3,_0x53e6ce){this[_0xbd0b('0x4')]=uuid['v4']();this['squeue']=_0x4ab08f;this[_0xbd0b('0x5')]=_0x39b03a;this[_0xbd0b('0x6')]=_0x1f6ec3;this[_0xbd0b('0x3')]=_0x53e6ce;this[_0xbd0b('0x7')][_0xbd0b('0x8')](this['handleRun'][_0xbd0b('0x9')](this),this[_0xbd0b('0xa')][_0xbd0b('0x9')](this));this[_0xbd0b('0x7')]['on'](_0xbd0b('0xb'),this['handleTimeout']['bind'](this));this[_0xbd0b('0x7')]['on'](_0xbd0b('0xc'),this['handleDrained'][_0xbd0b('0x9')](this));};Agent[_0xbd0b('0xd')]['push']=function(){this[_0xbd0b('0x7')][_0xbd0b('0x8')](this[_0xbd0b('0xe')][_0xbd0b('0x9')](this),this[_0xbd0b('0xa')][_0xbd0b('0x9')](this));};Agent[_0xbd0b('0xd')][_0xbd0b('0xf')]=function(){this[_0xbd0b('0xa')](!![]);};Agent[_0xbd0b('0xd')][_0xbd0b('0xe')]=function(){logger['debug'](_0xbd0b('0x10'),this['squeue']['id'],this['agent']['id']);if(_[_0xbd0b('0x11')](this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']])){logger[_0xbd0b('0x13')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0xbd0b('0x5')]['id']);setTimeout(this[_0xbd0b('0x8')][_0xbd0b('0x9')](this),0x3e8);}else{if(this[_0xbd0b('0x3')][_0xbd0b('0x14')]||util[_0xbd0b('0x15')](this['squeue']['id'],this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']],this[_0xbd0b('0x7')][_0xbd0b('0x16')],![])){this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x17')]=!![];this[_0xbd0b('0x6')]['agents'][this[_0xbd0b('0x5')]['id']]['busyQueue']=undefined;util[_0xbd0b('0x18')](this[_0xbd0b('0x6')],this[_0xbd0b('0x3')],this[_0xbd0b('0x5')],this[_0xbd0b('0x7')]['channel']);util[_0xbd0b('0x19')](this['notificationId'],this[_0xbd0b('0x7')]['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],null,this[_0xbd0b('0x3')]);util[_0xbd0b('0x1a')](this['squeue']['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],_0xbd0b('0x1b')+(this[_0xbd0b('0x3')][_0xbd0b('0x14')]?':FORCED':''));}else{logger[_0xbd0b('0x13')](_0xbd0b('0x1c'),this[_0xbd0b('0x7')]['id'],this['agent']['id']);setTimeout(this['push'][_0xbd0b('0x9')](this),0x3e8);}}};Agent[_0xbd0b('0xd')][_0xbd0b('0xa')]=function(_0xf4ba04){if(_[_0xbd0b('0x11')](this[_0xbd0b('0x6')][_0xbd0b('0x12')][this['agent']['id']])){return logger[_0xbd0b('0x13')](_0xbd0b('0x1d'),this['squeue']['id'],this['agent']['id']);}else{logger[_0xbd0b('0x13')](_0xbd0b('0x1e'),this['squeue']['id'],this[_0xbd0b('0x5')]['id']);util[_0xbd0b('0x1f')](this[_0xbd0b('0x4')],this[_0xbd0b('0x7')]['id'],this[_0xbd0b('0x6')][_0xbd0b('0x12')][this['agent']['id']],null,this[_0xbd0b('0x3')]);this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x17')]=![];this[_0xbd0b('0x6')][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']][_0xbd0b('0x20')]=undefined;util[_0xbd0b('0x21')](this[_0xbd0b('0x6')],this[_0xbd0b('0x3')],this[_0xbd0b('0x5')],this[_0xbd0b('0x7')]['channel']);util[_0xbd0b('0x1a')](this[_0xbd0b('0x7')]['id'],this['realtime'][_0xbd0b('0x12')][this[_0xbd0b('0x5')]['id']],_0xf4ba04?_0xbd0b('0x22'):_0xbd0b('0x23'));}if(!_0xf4ba04){setTimeout(this[_0xbd0b('0x8')][_0xbd0b('0x9')](this),0x3e8);}};function agent(_0x4c8ff5,_0x327425,_0x11cf5a,_0x3b5098){return new Agent(_0x4c8ff5,_0x327425,_0x11cf5a,_0x3b5098);}module[_0xbd0b('0x24')]=agent; \ No newline at end of file +var _0x0fda=['lodash','./util','../../../../../config/logger','routing','agent','squeue','push','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','realtime','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busyQueue','saveWaitingNotification','showNotification','notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','busy','STOP','exports'];(function(_0xb37b5a,_0x4a0086){var _0x24ca6e=function(_0x5cbfa4){while(--_0x5cbfa4){_0xb37b5a['push'](_0xb37b5a['shift']());}};_0x24ca6e(++_0x4a0086);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x5b38e3,_0x140cf8){_0x5b38e3=_0x5b38e3-0x0;var _0x5ae70f=_0x0fda[_0x5b38e3];return _0x5ae70f;};'use strict';var _=require(_0xa0fd('0x0'));var uuid=require('uuid');var util=require(_0xa0fd('0x1'));var logger=require(_0xa0fd('0x2'))(_0xa0fd('0x3'));var Agent=function(_0x2f71f3,_0x426242,_0xd8e73a,_0x13c734){this['notificationId']=uuid['v4']();this['squeue']=_0x2f71f3;this[_0xa0fd('0x4')]=_0x426242;this['realtime']=_0xd8e73a;this['routing']=_0x13c734;this[_0xa0fd('0x5')][_0xa0fd('0x6')](this[_0xa0fd('0x7')][_0xa0fd('0x8')](this),this['handleTimeout'][_0xa0fd('0x8')](this));this[_0xa0fd('0x5')]['on'](_0xa0fd('0x9'),this[_0xa0fd('0xa')]['bind'](this));this[_0xa0fd('0x5')]['on'](_0xa0fd('0xb'),this[_0xa0fd('0xc')]['bind'](this));};Agent[_0xa0fd('0xd')][_0xa0fd('0x6')]=function(){this[_0xa0fd('0x5')][_0xa0fd('0x6')](this[_0xa0fd('0x7')]['bind'](this),this['handleTimeout'][_0xa0fd('0x8')](this));};Agent[_0xa0fd('0xd')]['handleDrained']=function(){this[_0xa0fd('0xa')](!![]);};Agent[_0xa0fd('0xd')][_0xa0fd('0x7')]=function(){logger[_0xa0fd('0xe')](_0xa0fd('0xf'),this[_0xa0fd('0x5')]['id'],this[_0xa0fd('0x4')]['id']);if(_['isNil'](this[_0xa0fd('0x10')][_0xa0fd('0x11')][this['agent']['id']])){logger['debug'](_0xa0fd('0x12'),this[_0xa0fd('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xa0fd('0x6')][_0xa0fd('0x8')](this),0x3e8);}else{if(this[_0xa0fd('0x3')]['forcedOwnership']||util['isAgentAvailable'](this[_0xa0fd('0x5')]['id'],this['realtime'][_0xa0fd('0x11')][this[_0xa0fd('0x4')]['id']],this[_0xa0fd('0x5')][_0xa0fd('0x13')],![])){this[_0xa0fd('0x10')][_0xa0fd('0x11')][this[_0xa0fd('0x4')]['id']]['busy']=!![];this[_0xa0fd('0x10')][_0xa0fd('0x11')][this[_0xa0fd('0x4')]['id']][_0xa0fd('0x14')]=undefined;util[_0xa0fd('0x15')](this[_0xa0fd('0x10')],this[_0xa0fd('0x3')],this[_0xa0fd('0x4')],this[_0xa0fd('0x5')][_0xa0fd('0x13')]);util[_0xa0fd('0x16')](this[_0xa0fd('0x17')],this[_0xa0fd('0x5')]['id'],this['realtime'][_0xa0fd('0x11')][this[_0xa0fd('0x4')]['id']],null,this['routing']);util[_0xa0fd('0x18')](this[_0xa0fd('0x5')]['id'],this['realtime']['agents'][this[_0xa0fd('0x4')]['id']],_0xa0fd('0x19')+(this['routing']['forcedOwnership']?':FORCED':''));}else{logger['debug'](_0xa0fd('0x1a'),this['squeue']['id'],this[_0xa0fd('0x4')]['id']);setTimeout(this[_0xa0fd('0x6')][_0xa0fd('0x8')](this),0x3e8);}}};Agent['prototype'][_0xa0fd('0xa')]=function(_0x19c352){if(_[_0xa0fd('0x1b')](this[_0xa0fd('0x10')][_0xa0fd('0x11')][this['agent']['id']])){return logger[_0xa0fd('0xe')](_0xa0fd('0x12'),this[_0xa0fd('0x5')]['id'],this[_0xa0fd('0x4')]['id']);}else{logger['debug'](_0xa0fd('0x1c'),this[_0xa0fd('0x5')]['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this[_0xa0fd('0x5')]['id'],this['realtime']['agents'][this[_0xa0fd('0x4')]['id']],null,this['routing']);this[_0xa0fd('0x10')][_0xa0fd('0x11')][this[_0xa0fd('0x4')]['id']][_0xa0fd('0x1d')]=![];this[_0xa0fd('0x10')][_0xa0fd('0x11')][this[_0xa0fd('0x4')]['id']][_0xa0fd('0x14')]=undefined;util['removeWaitingNotification'](this[_0xa0fd('0x10')],this['routing'],this[_0xa0fd('0x4')],this['squeue']['channel']);util[_0xa0fd('0x18')](this['squeue']['id'],this[_0xa0fd('0x10')][_0xa0fd('0x11')][this[_0xa0fd('0x4')]['id']],_0x19c352?_0xa0fd('0x1e'):'TIMEOUT');}if(!_0x19c352){setTimeout(this[_0xa0fd('0x6')][_0xa0fd('0x8')](this),0x3e8);}};function agent(_0x3b06ef,_0x3f6146,_0x2e3cfa,_0x31f1e2){return new Agent(_0x3b06ef,_0x3f6146,_0x2e3cfa,_0x31f1e2);}module[_0xa0fd('0x1f')]=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 b6103b4..229193c 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 _0xb46c=['realtime','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','TIMEOUT','removeWaitingNotification','lodash','uuid','routing','notificationId','queue','squeue','bind','timeout','handleTimeout','drained','handleDrained','prototype','push','handleRun','isNil','Agents','length'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0xb46c,0x170));var _0xcb46=function(_0x24da95,_0x4e8e1a){_0x24da95=_0x24da95-0x0;var _0x593878=_0xb46c[_0x24da95];return _0x593878;};'use strict';var _=require(_0xcb46('0x0'));var uuid=require(_0xcb46('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0xcb46('0x2'));var Beepall=function(_0x5971d8,_0x599bcc,_0x13737c,_0x386368){this[_0xcb46('0x3')]=uuid['v4']();this['squeue']=_0x5971d8;this[_0xcb46('0x4')]=_0x599bcc;this['realtime']=_0x13737c;this[_0xcb46('0x2')]=_0x386368;this[_0xcb46('0x5')]['push'](this['handleRun'][_0xcb46('0x6')](this),this['handleTimeout'][_0xcb46('0x6')](this));this[_0xcb46('0x5')]['on'](_0xcb46('0x7'),this[_0xcb46('0x8')][_0xcb46('0x6')](this));this[_0xcb46('0x5')]['on'](_0xcb46('0x9'),this[_0xcb46('0xa')][_0xcb46('0x6')](this));};Beepall[_0xcb46('0xb')]['push']=function(){this[_0xcb46('0x5')][_0xcb46('0xc')](this[_0xcb46('0xd')]['bind'](this),this[_0xcb46('0x8')]['bind'](this));};Beepall['prototype']['handleDrained']=function(){this[_0xcb46('0x8')](!![]);};Beepall[_0xcb46('0xb')][_0xcb46('0xd')]=function(){var _0xbbfc9b=!![];if(!_[_0xcb46('0xe')](this[_0xcb46('0x4')])&&!_['isNil'](this[_0xcb46('0x4')][_0xcb46('0xf')])&&this[_0xcb46('0x4')][_0xcb46('0xf')]['length']>0x0){for(var _0x50821f=0x0,_0x3709e5;_0x50821f0x0){for(var _0x6aa166=0x0,_0x168fd7;_0x6aa1660x0&&_0x351c7a[_0x34aef2+_0x9b49('0x21')]>=_0x351c7a[_0x34aef2+_0x9b49('0x22')]){writeLog(_0x54a01d,_0x351c7a,_0x34aef2[_0x9b49('0x23')]()+_0x9b49('0x24'));return![];}}return!![];};exports['showNotification']=function(_0x296b4d,_0x4d3eaa,_0x5c2289,_0x42d5c0,_0x2c3ece){return sendNotification(!![],_0x296b4d,_0x4d3eaa,_0x5c2289,_0x42d5c0,_0x2c3ece);};exports['hideNotification']=function(_0x45ba98,_0x924b9f,_0x53362d,_0x18a827,_0x1617a9){return sendNotification(![],_0x45ba98,_0x924b9f,_0x53362d,_0x18a827,_0x1617a9);};exports[_0x9b49('0x25')]=function(_0x23606d,_0x4b4d71,_0x2d7c1a){var _0xbfc0bc=_0x4b4d71[_0x9b49('0x26')]['UserId'];if(!_0xbfc0bc&&_0x2d7c1a){_0xbfc0bc=_0x2d7c1a['id'];}var _0x2109b9=_[_0x9b49('0x27')](_0x23606d[_0x4b4d71[_0x9b49('0x28')]+_0x9b49('0x29')],function(_0x39e7bd){var _0x61fca3=_[_0x9b49('0x2a')](_0x4b4d71[_0x9b49('0x28')])+_0x9b49('0x2b');return _0x39e7bd[_0x61fca3]===_0x4b4d71[_0x9b49('0x26')]['id'];});if(!_0x2109b9&&_0xbfc0bc){_0x2109b9=_[_0x9b49('0x27')](_0x23606d[_0x9b49('0x2c')][_0xbfc0bc][_0x4b4d71[_0x9b49('0x28')]+_0x9b49('0x2d')],function(_0x4f098f){return _0x4f098f['id']===_0x4b4d71['interaction']['id'];});}return _0x2109b9;};exports[_0x9b49('0x2e')]=function(_0x17ce9a,_0xc960cf,_0x504bb1,_0x401c72){_0x17ce9a[_0x9b49('0x2c')][_0x504bb1['id']][_0x401c72+'WaitingInteractions'][_0xc960cf[_0x9b49('0x2f')]['id']]={'id':_0xc960cf[_0x9b49('0x26')]['id']};};exports['removeWaitingNotification']=function(_0x234660,_0x5313d9,_0x49188e,_0x3ba7d2){delete _0x234660[_0x9b49('0x2c')][_0x49188e['id']][_0x3ba7d2+'WaitingInteractions'][_0x5313d9['message']['id']];};exports[_0x9b49('0x30')]=writeLog; \ No newline at end of file +var _0x4ca2=['redis','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','channel','QueuesWaitingInteractions','capitalize','InteractionId','some','agents','WaitingInteractions','saveWaitingNotification','writeLog','util','../utils','../../../../../config/environment','routing'];(function(_0xf4050f,_0xefc6bb){var _0x42baab=function(_0x571abb){while(--_0x571abb){_0xf4050f['push'](_0xf4050f['shift']());}};_0x42baab(++_0xefc6bb);}(_0x4ca2,0x19c));var _0x24ca=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0x4ca2[_0x56f7e2];return _0x36240b;};'use strict';var _=require('lodash');var util=require(_0x24ca('0x0'));var utils=require(_0x24ca('0x1'));var Redis=require('ioredis');var config=require(_0x24ca('0x2'));var logger=require('../../../../../config/logger')(_0x24ca('0x3'));config[_0x24ca('0x4')]=_['defaults'](config[_0x24ca('0x4')],{'host':_0x24ca('0x5'),'port':0x18eb});var io=require(_0x24ca('0x6'))(new Redis(config[_0x24ca('0x4')]));function sendNotification(_0x48f72b,_0x3af7c1,_0x38ca56,_0x47b549,_0x57e585,_0x469cb0){io['to'](util[_0x24ca('0x7')](_0x24ca('0x8'),_0x47b549[_0x24ca('0x9')]))[_0x24ca('0xa')](_0x24ca('0xb'),_0x47b549);var _0x17294=_0x469cb0||{};var _0x49e29e=_0x38ca56[_0x24ca('0xc')]('.');var _0x1cd936={'uniqueid':_0x3af7c1,'channel':_0x49e29e[0x0],'id':_0x49e29e[0x1],'title':_0x49e29e[0x0]+_0x24ca('0xd'),'interactionId':_0x49e29e[0x2],'queue':_0x57e585?_0x57e585[_0x24ca('0x9')]:null,'sound':_0x17294[_0x24ca('0xe')][_0x24ca('0xf')],'shake':_0x17294[_0x24ca('0xe')]['notificationShake']};try{if(!_0x17294['body']){_0x17294[_0x24ca('0x10')]={};}if(_0x57e585){_0x17294[_0x24ca('0x10')][_0x24ca('0x11')]=_0x57e585;}else if(_0x17294['body']['queue']){delete _0x17294[_0x24ca('0x10')][_0x24ca('0x11')];}_0x1cd936[_0x24ca('0x12')]=utils[_0x24ca('0x13')](_0x17294[_0x24ca('0xe')][_0x24ca('0x14')],_0x17294);}catch(_0x5d398b){_0x1cd936[_0x24ca('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x24ca('0x15')](util[_0x24ca('0x7')](_0x24ca('0x16'),_0x3af7c1,_0x5d398b[_0x24ca('0x17')]));}io['to'](util[_0x24ca('0x7')](_0x24ca('0x8'),_0x47b549[_0x24ca('0x9')]))['emit'](util['format'](_0x24ca('0x18'),_0x48f72b?_0x24ca('0x19'):_0x24ca('0x1a')),_0x1cd936);}function writeLog(_0x59909e,_0x49502b,_0x1018fc){return logger[_0x24ca('0x1b')](util[_0x24ca('0x7')](_0x24ca('0x1c'),_0x59909e,_0x49502b['name'],_0x1018fc));}exports[_0x24ca('0x1d')]=function(_0x55de7e,_0x1aad22,_0x501eb9,_0xa4ed8e){if(_0x1aad22[_0x24ca('0x1e')]){writeLog(_0x55de7e,_0x1aad22,_0x24ca('0x1f'));return![];}if(!_0x1aad22[_0x24ca('0x20')]){writeLog(_0x55de7e,_0x1aad22,'OFFLINE');return![];}if(_0x1aad22[_0x501eb9+_0x24ca('0x21')]){writeLog(_0x55de7e,_0x1aad22,_0x24ca('0x22'));return![];}if(_0xa4ed8e&&_0x1aad22[_0x24ca('0x23')](_0x501eb9+_0x24ca('0x24'))&&_0x1aad22[_0x24ca('0x23')](_0x501eb9+_0x24ca('0x25'))){if(_0x1aad22[_0x501eb9+_0x24ca('0x24')]>0x0&&_0x1aad22[_0x501eb9+_0x24ca('0x25')]>=_0x1aad22[_0x501eb9+'Capacity']){writeLog(_0x55de7e,_0x1aad22,_0x501eb9['toUpperCase']()+_0x24ca('0x26'));return![];}}return!![];};exports[_0x24ca('0x27')]=function(_0x5e3880,_0x1b671f,_0x1011a8,_0x3f2eb2,_0x42fee7){return sendNotification(!![],_0x5e3880,_0x1b671f,_0x1011a8,_0x3f2eb2,_0x42fee7);};exports[_0x24ca('0x28')]=function(_0x1cb842,_0xf01e93,_0x4efbd6,_0x21f9e6,_0x17fe18){return sendNotification(![],_0x1cb842,_0xf01e93,_0x4efbd6,_0x21f9e6,_0x17fe18);};exports[_0x24ca('0x29')]=function(_0x281bfc,_0x33bcc8,_0x3d28d0){var _0x348786=_0x33bcc8[_0x24ca('0x2a')]['UserId'];if(!_0x348786&&_0x3d28d0){_0x348786=_0x3d28d0['id'];}var _0x58ed04=_['some'](_0x281bfc[_0x33bcc8[_0x24ca('0x2b')]+_0x24ca('0x2c')],function(_0xe9077a){var _0x4bed8c=_[_0x24ca('0x2d')](_0x33bcc8[_0x24ca('0x2b')])+_0x24ca('0x2e');return _0xe9077a[_0x4bed8c]===_0x33bcc8[_0x24ca('0x2a')]['id'];});if(!_0x58ed04&&_0x348786){_0x58ed04=_[_0x24ca('0x2f')](_0x281bfc[_0x24ca('0x30')][_0x348786][_0x33bcc8[_0x24ca('0x2b')]+_0x24ca('0x31')],function(_0x1e9332){return _0x1e9332['id']===_0x33bcc8[_0x24ca('0x2a')]['id'];});}return _0x58ed04;};exports[_0x24ca('0x32')]=function(_0x4697f9,_0x40fcc2,_0x7b0dda,_0x1e230b){_0x4697f9[_0x24ca('0x30')][_0x7b0dda['id']][_0x1e230b+_0x24ca('0x31')][_0x40fcc2[_0x24ca('0x17')]['id']]={'id':_0x40fcc2[_0x24ca('0x2a')]['id']};};exports['removeWaitingNotification']=function(_0x30d655,_0x4b1392,_0x51e58b,_0x5e9ffa){delete _0x30d655['agents'][_0x51e58b['id']][_0x5e9ffa+_0x24ca('0x31')][_0x4b1392[_0x24ca('0x17')]['id']];};exports[_0x24ca('0x33')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 90fb528..be93ee3 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 _0xa78e=['lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','[%s][SYSTEM]\x20%s','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','validate','shelljs'];(function(_0x2095e3,_0x3d165d){var _0x96988c=function(_0x5d172d){while(--_0x5d172d){_0x2095e3['push'](_0x2095e3['shift']());}};_0x96988c(++_0x3d165d);}(_0xa78e,0x1e1));var _0xea78=function(_0x4b31b8,_0x5f3b0b){_0x4b31b8=_0x4b31b8-0x0;var _0x37ce7b=_0xa78e[_0x4b31b8];return _0x37ce7b;};'use strict';var schema=require(_0xea78('0x0'));var sh=require(_0xea78('0x1'));var _=require(_0xea78('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xea78('0x3'));var system=schema({'command':{'type':_0xea78('0x4'),'required':!![],'message':_0xea78('0x5')}});exports['consequence']=function(_0x2dfb13,_0x2dd48e){return function(_0x7672ec){try{var _0x3cb08c={'command':_0x2dd48e[0x0]};var _0x1c5825=system['validate'](_0x3cb08c,{'typecast':!![]});if(_0x1c5825[_0xea78('0x6')]){logger['error'](_0xea78('0x7'),_0x2dfb13,_['map'](_0x1c5825,'message')[_0xea78('0x8')](',\x20'));logger[_0xea78('0x9')](_0xea78('0xa'),_0x2dfb13);_0x7672ec[_0xea78('0xb')]();}else{var _0x1da7d4=this;var _0x2acd33=utils['getMustacheRender'](_0x2dd48e[0x0],this);logger[_0xea78('0x9')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x2dfb13,_0x2acd33);sh[_0xea78('0xc')](_[_0xea78('0xd')](_0x2acd33),function(_0x353c67,_0x3bae8c){logger[_0xea78('0x9')](_0xea78('0xe'),_0x2dfb13,_0x353c67);if(_0x353c67==0x0){var _0x41598f=_0x3bae8c['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xea78('0xf')](_0x2dd48e[0x1])||_[_0xea78('0x10')](_0x2dd48e[0x1])){logger[_0xea78('0x9')](_0xea78('0x11'),_0x2dfb13);_0x1da7d4[_0xea78('0x12')][_0x2dd48e[0x1]]=_0x41598f;}else{logger[_0xea78('0x9')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x2dfb13,_0x2dd48e[0x1],_0x41598f);_0x1da7d4[_0xea78('0x12')][_0x2dd48e[0x1]]=_0x41598f;}}_0x7672ec[_0xea78('0xb')]();});}}catch(_0x457835){logger[_0xea78('0x13')]('[%s][SYSTEM]\x20%s',_0x2dfb13,_[_0xea78('0x14')](_0x457835)?JSON['stringify'](_0x457835):_0x457835);logger['info'](_0xea78('0xa'),_0x2dfb13);_0x7672ec[_0xea78('0xb')]();}};}; \ No newline at end of file +var _0x09b2=['join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','[%s][SYSTEM]\x20%s','stringify','validate','shelljs','lodash','./utils','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x09b2,0x150));var _0x209b=function(_0x291d80,_0x574ab4){_0x291d80=_0x291d80-0x0;var _0x35e2c6=_0x09b2[_0x291d80];return _0x35e2c6;};'use strict';var schema=require(_0x209b('0x0'));var sh=require(_0x209b('0x1'));var _=require(_0x209b('0x2'));var utils=require(_0x209b('0x3'));var logger=require('../../../../config/logger')(_0x209b('0x4'));var system=schema({'command':{'type':_0x209b('0x5'),'required':!![],'message':_0x209b('0x6')}});exports[_0x209b('0x7')]=function(_0x3f3ffa,_0x13b187){return function(_0x2fe60c){try{var _0x3a8835={'command':_0x13b187[0x0]};var _0x48d409=system[_0x209b('0x0')](_0x3a8835,{'typecast':!![]});if(_0x48d409[_0x209b('0x8')]){logger[_0x209b('0x9')]('[%s][SYSTEM]\x20%s',_0x3f3ffa,_[_0x209b('0xa')](_0x48d409,_0x209b('0xb'))[_0x209b('0xc')](',\x20'));logger[_0x209b('0xd')](_0x209b('0xe'),_0x3f3ffa);_0x2fe60c[_0x209b('0xf')]();}else{var _0x2eeb70=this;var _0x360a46=utils[_0x209b('0x10')](_0x13b187[0x0],this);logger[_0x209b('0xd')](_0x209b('0x11'),_0x3f3ffa,_0x360a46);sh[_0x209b('0x12')](_[_0x209b('0x13')](_0x360a46),function(_0x1dec20,_0x430e39){logger[_0x209b('0xd')](_0x209b('0x14'),_0x3f3ffa,_0x1dec20);if(_0x1dec20==0x0){var _0x397216=_0x430e39[_0x209b('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0x209b('0x16')](_0x13b187[0x1])||_[_0x209b('0x17')](_0x13b187[0x1])){logger[_0x209b('0xd')](_0x209b('0x18'),_0x3f3ffa);_0x2eeb70['body'][_0x13b187[0x1]]=_0x397216;}else{logger[_0x209b('0xd')](_0x209b('0x19'),_0x3f3ffa,_0x13b187[0x1],_0x397216);_0x2eeb70[_0x209b('0x1a')][_0x13b187[0x1]]=_0x397216;}}_0x2fe60c['next']();});}}catch(_0x194073){logger[_0x209b('0x9')](_0x209b('0x1b'),_0x3f3ffa,_['isObject'](_0x194073)?JSON[_0x209b('0x1c')](_0x194073):_0x194073);logger[_0x209b('0xd')](_0x209b('0xe'),_0x3f3ffa);_0x2fe60c['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index e1df27c..b7a4d4b 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 _0xaf83=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','Interaction','channel','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xaf83,0xd3));var _0x3af8=function(_0x17fef8,_0x334993){_0x17fef8=_0x17fef8-0x0;var _0x457f53=_0xaf83[_0x17fef8];return _0x457f53;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0x3af8('0x0')),'openchannelInteraction':require(_0x3af8('0x1')),'smsInteraction':require(_0x3af8('0x2')),'mailInteraction':require(_0x3af8('0x3')),'faxInteraction':require(_0x3af8('0x4')),'whatsappInteraction':require(_0x3af8('0x5'))};var logger=require(_0x3af8('0x6'))(_0x3af8('0x7'));var tag=schema({'tag':{'type':_0x3af8('0x8'),'required':!![],'message':_0x3af8('0x9')}});exports[_0x3af8('0xa')]=function(_0x5698d6,_0x15ea75,_0x544215,_0x45aa08){return function(_0xe0fdb){try{var _0x2d2e0d={'tag':_0x15ea75[0x0]};var _0x4a671c=tag['validate'](_0x2d2e0d,{'typecast':!![]});if(_0x4a671c[_0x3af8('0xb')]){logger[_0x3af8('0xc')](_0x3af8('0xd'),_0x5698d6,_[_0x3af8('0xe')](_0x4a671c,_0x3af8('0xf'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5698d6);_0xe0fdb['next']();}else{var _0x3d250d={'ids':[_0x15ea75[0x0]]};if(rpc[_0x45aa08['channel']+_0x3af8('0x10')]){rpc[_0x45aa08[_0x3af8('0x11')]+_0x3af8('0x10')]['addTags'](_0x45aa08[_0x3af8('0x12')]['id'],_0x3d250d)[_0x3af8('0x13')](function(_0x390bcd){logger[_0x3af8('0x14')](_0x3af8('0x15'),_0x5698d6,_0x15ea75[0x1],_0x45aa08[_0x3af8('0x11')],_0x45aa08['interaction']['id']);})['catch'](function(_0x2cdd32){logger[_0x3af8('0xc')](_0x3af8('0xd'),_0x5698d6,JSON[_0x3af8('0x16')](_0x2cdd32));logger[_0x3af8('0x14')](_0x3af8('0x17'),_0x5698d6);})[_0x3af8('0x18')](function(){_0xe0fdb[_0x3af8('0x19')]();});}}}catch(_0x1df920){logger[_0x3af8('0xc')]('[%s][TAG]\x20%s',_0x5698d6,_[_0x3af8('0x1a')](_0x1df920)?JSON['stringify'](_0x1df920):_0x1df920);logger[_0x3af8('0x14')](_0x3af8('0x17'),_0x5698d6);_0xe0fdb[_0x3af8('0x19')]();}};}; \ No newline at end of file +var _0x257a=['error','[%s][TAG]\x20%s','map','message','info','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','stringify','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','consequence','length'];(function(_0x3078c2,_0x53c7d0){var _0x435be6=function(_0x201bb0){while(--_0x201bb0){_0x3078c2['push'](_0x3078c2['shift']());}};_0x435be6(++_0x53c7d0);}(_0x257a,0x160));var _0xa257=function(_0x485694,_0x4b5db8){_0x485694=_0x485694-0x0;var _0x29cf67=_0x257a[_0x485694];return _0x29cf67;};'use strict';var schema=require('validate');var _=require(_0xa257('0x0'));var rpc={'chatInteraction':require(_0xa257('0x1')),'openchannelInteraction':require(_0xa257('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xa257('0x3')),'whatsappInteraction':require(_0xa257('0x4'))};var logger=require('../../../../config/logger')(_0xa257('0x5'));var tag=schema({'tag':{'type':'number','required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xa257('0x6')]=function(_0xae875f,_0xd0d9d8,_0x554fd2,_0x1583a2){return function(_0x189f2f){try{var _0x2cf15a={'tag':_0xd0d9d8[0x0]};var _0x11546d=tag['validate'](_0x2cf15a,{'typecast':!![]});if(_0x11546d[_0xa257('0x7')]){logger[_0xa257('0x8')](_0xa257('0x9'),_0xae875f,_[_0xa257('0xa')](_0x11546d,_0xa257('0xb'))['join'](',\x20'));logger[_0xa257('0xc')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0xae875f);_0x189f2f[_0xa257('0xd')]();}else{var _0x49c820={'ids':[_0xd0d9d8[0x0]]};if(rpc[_0x1583a2[_0xa257('0xe')]+_0xa257('0xf')]){rpc[_0x1583a2['channel']+_0xa257('0xf')][_0xa257('0x10')](_0x1583a2[_0xa257('0x11')]['id'],_0x49c820)['then'](function(_0xa8671d){logger['info'](_0xa257('0x12'),_0xae875f,_0xd0d9d8[0x1],_0x1583a2[_0xa257('0xe')],_0x1583a2['interaction']['id']);})[_0xa257('0x13')](function(_0x4f2f19){logger[_0xa257('0x8')]('[%s][TAG]\x20%s',_0xae875f,JSON['stringify'](_0x4f2f19));logger[_0xa257('0xc')](_0xa257('0x14'),_0xae875f);})[_0xa257('0x15')](function(){_0x189f2f[_0xa257('0xd')]();});}}}catch(_0x284fb9){logger[_0xa257('0x8')](_0xa257('0x9'),_0xae875f,_[_0xa257('0x16')](_0x284fb9)?JSON[_0xa257('0x17')](_0x284fb9):_0x284fb9);logger['info'](_0xa257('0x14'),_0xae875f);_0x189f2f[_0xa257('0xd')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index fddc7a7..b9efbb3 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 _0x043c=['POST','parse','result','logged','channelId=','&sessionId=','&data=','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params','stringify','utf8'];(function(_0x36e0a8,_0x4ed0af){var _0x17649d=function(_0x39ac09){while(--_0x39ac09){_0x36e0a8['push'](_0x36e0a8['shift']());}};_0x17649d(++_0x4ed0af);}(_0x043c,0xd4));var _0xc043=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x043c[_0x412342];return _0x3e62cb;};'use strict';var rp=require(_0xc043('0x0'));var logger=require(_0xc043('0x1'))(_0xc043('0x2'));var _=require(_0xc043('0x3'));var arr=[];exports[_0xc043('0x4')]=function(_0x33a3ae,_0x37995f){return function(_0x5c9247){var _0x83e07e=_0x37995f[0xa];var _0x8230ed=_0x37995f[0xb];var _0x2d881b=_0x37995f[0xc];var _0x139fcc=_0x37995f[0xd];var _0x2e052e=_0x37995f[0xe];var _0xb33d39=_0x37995f[0xf][_0xc043('0x5')](/\n/g,_0xc043('0x6'));var _0x49b4e2=_0x37995f[0x10][_0xc043('0x5')](/\n/g,'\x20');if(!arr[_0xc043('0x7')](_0x8230ed)){arr['push'](_0x8230ed);var _0x3e7aab=_0x37995f[0x3];var _0x57c9bc=_0x37995f[0x4];var _0x777eac=_0x37995f[0x1];var _0x299ded=_0x37995f[0x0];var _0x14dd5d={};_0x14dd5d['urlOnAnswer']=_0x37995f[0x8]+_0xc043('0x8')+_0x2d881b+'|'+_0x83e07e+'|'+_0x139fcc+'|'+_0x8230ed+'|'+_0x2e052e;_0x14dd5d[_0xc043('0x9')]=_0x37995f[0x7]+_0xc043('0x8')+_0x2d881b+'|'+_0x83e07e+'|'+_0x139fcc+'|'+_0x8230ed+'|'+_0x2e052e+'|'+_0xb33d39+'|'+_0x49b4e2;_0x14dd5d[_0xc043('0xa')]=_0x37995f[0x9];var _0x22f676={};_0x22f676[_0xc043('0xb')]=_0xc043('0xc');_0x22f676[_0xc043('0xd')]=_0xc043('0xe');var _0xa44ed9=[];_0xa44ed9[_0xc043('0xf')](_0x37995f[0x2]);_0xa44ed9[_0xc043('0xf')](_0x37995f[0x5]);_0xa44ed9[_0xc043('0xf')](_0x37995f[0x6]);_0x22f676[_0xc043('0x10')]=_0xa44ed9;_0x22f676['id']=0x1;var _0x5b82ad=JSON[_0xc043('0x11')](_0x22f676);var _0x491d27={'encoding':_0xc043('0x12'),'method':_0xc043('0x13'),'timeout':0x2710,'url':_0x3e7aab,'headers':{'Content-Type':'application/json-rpc'},'body':_0x5b82ad};return rp(_0x491d27)['then'](function(_0x2775c6){const _0x4ea2ed=JSON[_0xc043('0x14')](_0x2775c6);if(!_0x4ea2ed[_0xc043('0x15')][_0xc043('0x16')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x3d5a6c=_0x8230ed;var _0x104d44=_0xc043('0x17')+_0x777eac+'&serviceId='+_0x299ded+_0xc043('0x18')+_0x3d5a6c+_0xc043('0x19')+JSON[_0xc043('0x11')](_0x14dd5d);var _0x128afd=_0x57c9bc+'?'+_0x104d44;return rp(_0x128afd);})['then'](function(_0x482f36){logger[_0xc043('0x1a')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x33a3ae,_0x482f36);_0x5c9247[_0xc043('0x1b')]();})[_0xc043('0x1c')](function(_0x3bc57d){logger[_0xc043('0x1d')](_0xc043('0x1e'),_0x33a3ae,_[_0xc043('0x1f')](_0x3bc57d)?JSON[_0xc043('0x11')](_0x3bc57d):_0x3bc57d);_0x5c9247[_0xc043('0x1b')]();});}else{logger[_0xc043('0x1a')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x33a3ae);_0x5c9247[_0xc043('0x20')]();}};}; \ No newline at end of file +var _0x5d75=['[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','catch','error','[%s][TVOX]\x20%s','isObject','stop','next','request-promise','routing','lodash','consequence','replace','includes','push','urlOnAnswer','?params=','title','jsonrpc','2.0','method','login','params','stringify','application/json-rpc','then','parse','result','logged','channelId=','&serviceId=','&sessionId=','&data='];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5d75,0x1e7));var _0x55d7=function(_0x1880bd,_0x2f6107){_0x1880bd=_0x1880bd-0x0;var _0x403732=_0x5d75[_0x1880bd];return _0x403732;};'use strict';var rp=require(_0x55d7('0x0'));var logger=require('../../../../config/logger')(_0x55d7('0x1'));var _=require(_0x55d7('0x2'));var arr=[];exports[_0x55d7('0x3')]=function(_0x591432,_0x51a04d){return function(_0x436e92){var _0x88d817=_0x51a04d[0xa];var _0x1be157=_0x51a04d[0xb];var _0x53092e=_0x51a04d[0xc];var _0x262a95=_0x51a04d[0xd];var _0x21611a=_0x51a04d[0xe];var _0x2d0b5e=_0x51a04d[0xf][_0x55d7('0x4')](/\n/g,'\x20-\x20');var _0x1deada=_0x51a04d[0x10][_0x55d7('0x4')](/\n/g,'\x20');if(!arr[_0x55d7('0x5')](_0x1be157)){arr[_0x55d7('0x6')](_0x1be157);var _0x1a5e36=_0x51a04d[0x3];var _0x218fb2=_0x51a04d[0x4];var _0xb687e7=_0x51a04d[0x1];var _0x2420e3=_0x51a04d[0x0];var _0x177b37={};_0x177b37[_0x55d7('0x7')]=_0x51a04d[0x8]+_0x55d7('0x8')+_0x53092e+'|'+_0x88d817+'|'+_0x262a95+'|'+_0x1be157+'|'+_0x21611a;_0x177b37['urlOnRing']=_0x51a04d[0x7]+'?params='+_0x53092e+'|'+_0x88d817+'|'+_0x262a95+'|'+_0x1be157+'|'+_0x21611a+'|'+_0x2d0b5e+'|'+_0x1deada;_0x177b37[_0x55d7('0x9')]=_0x51a04d[0x9];var _0x43e6be={};_0x43e6be[_0x55d7('0xa')]=_0x55d7('0xb');_0x43e6be[_0x55d7('0xc')]=_0x55d7('0xd');var _0x45ce06=[];_0x45ce06[_0x55d7('0x6')](_0x51a04d[0x2]);_0x45ce06[_0x55d7('0x6')](_0x51a04d[0x5]);_0x45ce06['push'](_0x51a04d[0x6]);_0x43e6be[_0x55d7('0xe')]=_0x45ce06;_0x43e6be['id']=0x1;var _0x37ca35=JSON[_0x55d7('0xf')](_0x43e6be);var _0x32b801={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x1a5e36,'headers':{'Content-Type':_0x55d7('0x10')},'body':_0x37ca35};return rp(_0x32b801)[_0x55d7('0x11')](function(_0x128501){const _0x26a2dd=JSON[_0x55d7('0x12')](_0x128501);if(!_0x26a2dd[_0x55d7('0x13')][_0x55d7('0x14')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x156599=_0x1be157;var _0x176e97=_0x55d7('0x15')+_0xb687e7+_0x55d7('0x16')+_0x2420e3+_0x55d7('0x17')+_0x156599+_0x55d7('0x18')+JSON[_0x55d7('0xf')](_0x177b37);var _0x5df20e=_0x218fb2+'?'+_0x176e97;return rp(_0x5df20e);})[_0x55d7('0x11')](function(_0x3b6dc3){logger['info'](_0x55d7('0x19'),_0x591432,_0x3b6dc3);_0x436e92['stop']();})[_0x55d7('0x1a')](function(_0x10881c){logger[_0x55d7('0x1b')](_0x55d7('0x1c'),_0x591432,_[_0x55d7('0x1d')](_0x10881c)?JSON['stringify'](_0x10881c):_0x10881c);_0x436e92[_0x55d7('0x1e')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x591432);_0x436e92[_0x55d7('0x1f')]();}};}; \ 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 f77b642..27ff6b1 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 _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x57202a,_0x20025e){var _0x1333ab=function(_0x3242eb){while(--_0x3242eb){_0x57202a['push'](_0x57202a['shift']());}};_0x1333ab(++_0x20025e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x2e9b2f,_0x168690){var _0x33c5bf=function(_0x1619ed){while(--_0x1619ed){_0x2e9b2f['push'](_0x2e9b2f['shift']());}};_0x33c5bf(++_0x168690);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 3b51dd8..6bbe83d 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 _0xdaa1=['RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','rules','channel','message','interaction','checkWaitingNotifications','applications','length','existsSync','toLowerCase','appdata','split','mail','push','join','dialogflow','slice','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','app','./interval','condition','intervals','./applications/','consequence','priority','info','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','complete','format','Skipped\x20routing\x20for\x20%s','error','stack','agent','agents','busy','busyQueue','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!'];(function(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xdaa1,0x191));var _0x1daa=function(_0x40c8ec,_0x3d90f9){_0x40c8ec=_0x40c8ec-0x0;var _0x4027a4=_0xdaa1[_0x40c8ec];return _0x4027a4;};'use strict';var _=require(_0x1daa('0x0'));var util=require(_0x1daa('0x1'));var path=require(_0x1daa('0x2'));var fs=require('fs');var jayson=require(_0x1daa('0x3'));var BPromise=require(_0x1daa('0x4'));var utils=require('./applications/utils');var sUtils=require(_0x1daa('0x5'));var logger=require('../../../config/logger')(_0x1daa('0x6'));var rpc={'openchannelQueueReport':require(_0x1daa('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x1daa('0x8')),'whatsappQueueReport':require(_0x1daa('0x9'))};var RuleEngine=require(_0x1daa('0xa'));function getId(_0x517d34,_0x5ad301,_0x74c798){return util['format'](_0x1daa('0xb'),_0x517d34,_0x5ad301||0x0,_0x74c798||0x0);}function getIntervals(_0x4effef,_0xd9464d){var _0x46f621=[];if(!_[_0x1daa('0xc')](_0xd9464d[_0x1daa('0xd')])&&!_[_0x1daa('0xc')](_0x4effef[_0xd9464d[_0x1daa('0xd')]])&&!_[_0x1daa('0xc')](_0x4effef[_0xd9464d['IntervalId']]['Intervals'])){_0x46f621=_[_0x1daa('0xe')](_0x4effef[_0xd9464d['IntervalId']][_0x1daa('0xf')],_0x1daa('0x10'));}else if(!_[_0x1daa('0xc')](_0xd9464d['interval'])){_0x46f621=[_0xd9464d[_0x1daa('0x10')]];}return _0x46f621;}exports['listen']=function(_0x27706f){_0x27706f[_0x1daa('0x11')]={};return new BPromise(function(_0x4e58ff,_0x3261e9){var _0x45fd48={'Start':function(_0x34e293){var _0x5e68c1=this;return new Promise(function(_0x5c9736,_0x91b7f6){if(_0x34e293){try{var _0x5b622a=[];var _0x590590=getId(_0x34e293[_0x1daa('0x12')],_0x34e293[_0x1daa('0x13')]?_0x34e293[_0x1daa('0x13')]['id']:0x0,_0x34e293[_0x1daa('0x14')]?_0x34e293[_0x1daa('0x14')]['id']:0x0);var _0x1b3d3b=sUtils[_0x1daa('0x15')](_0x27706f,_0x34e293);if(!_0x1b3d3b&&_0x34e293[_0x1daa('0x16')]&&_['isArray'](_0x34e293[_0x1daa('0x16')])&&_0x34e293[_0x1daa('0x16')][_0x1daa('0x17')]){for(var _0xe232da=0x0;_0xe232da<_0x34e293[_0x1daa('0x16')][_0x1daa('0x17')];_0xe232da+=0x1){var _0x128c4d=_0x34e293['applications'][_0xe232da];if(fs[_0x1daa('0x18')](path['join'](__dirname,_0x1daa('0x16'),_0x128c4d['app']+'.js'))){var _0x28488e=[];switch(_0x128c4d['app'][_0x1daa('0x19')]()){case'autoreply':var _0x4ba9e5=_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');if(_0x34e293['channel']===_0x1daa('0x1c')){_0x28488e[_0x1daa('0x1d')](_0x4ba9e5[0x0]);_0x28488e['push'](_0x4ba9e5[0x1]);_0x28488e[_0x1daa('0x1d')](_0x4ba9e5['slice'](0x2,_0x4ba9e5[_0x1daa('0x17')])['join'](','));}else{_0x28488e[_0x1daa('0x1d')](_0x4ba9e5[0x0]);_0x28488e[_0x1daa('0x1d')](_0x4ba9e5['slice'](0x1,_0x4ba9e5[_0x1daa('0x17')])[_0x1daa('0x1e')](','));}break;case _0x1daa('0x1f'):var _0x11efe3=_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');_0x28488e[_0x1daa('0x1d')](_0x11efe3[0x0]);_0x28488e['push'](_0x11efe3[0x1]);_0x28488e[_0x1daa('0x1d')](_0x11efe3[_0x1daa('0x20')](0x2,_0x11efe3['length'])[_0x1daa('0x1e')](','));break;case _0x1daa('0x21'):var _0x1ea585=_0x128c4d['appdata']['split'](',');_0x28488e[_0x1daa('0x1d')](_0x1ea585[0x0]);_0x28488e['push'](_0x1ea585[0x1]);_0x28488e[_0x1daa('0x1d')](_0x1ea585[0x2]);_0x28488e[_0x1daa('0x1d')](_0x1ea585[0x3]);_0x28488e['push'](_0x1ea585[_0x1daa('0x20')](0x4,_0x1ea585['length'])[_0x1daa('0x1e')](','));break;case _0x1daa('0x22'):var _0x4bce41=_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');_0x28488e[_0x1daa('0x1d')](_0x4bce41[0x0]);_0x28488e[_0x1daa('0x1d')](_0x4bce41[0x1]);_0x28488e[_0x1daa('0x1d')](_0x4bce41[0x2]);_0x28488e['push'](_0x4bce41[0x3]);_0x28488e['push'](_0x4bce41['slice'](0x4,_0x4bce41[_0x1daa('0x17')])[_0x1daa('0x1e')](','));break;case _0x1daa('0x13'):_0x28488e[_0x1daa('0x1d')](_0x128c4d[_0x1daa('0x1a')]);break;case _0x1daa('0x23'):_0x28488e[_0x1daa('0x1d')](_0x128c4d[_0x1daa('0x24')]);_0x28488e[_0x1daa('0x1d')](_0x128c4d[_0x1daa('0x1a')]);break;case _0x1daa('0x25'):var _0x3572c1=utils[_0x1daa('0x26')](_0x34e293[_0x1daa('0x27')]['notificationTemplate'],_0x34e293);var _0x4314c5=_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');_0x28488e['push'](_0x4314c5[0x0]);_0x28488e['push'](_0x4314c5[0x1]);_0x28488e['push'](_0x4314c5[0x2]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x3]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x4]);_0x28488e['push'](_0x4314c5[0x5]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x6]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x7]);_0x28488e['push'](_0x4314c5[0x8]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0x9]);_0x28488e[_0x1daa('0x1d')](_0x4314c5[0xa]);_0x28488e[_0x1daa('0x1d')](_0x34e293[_0x1daa('0x14')]['id']);_0x28488e[_0x1daa('0x1d')](_0x34e293[_0x1daa('0x13')]['id']);_0x28488e['push'](_0x128c4d[_0x1daa('0x28')]);_0x28488e[_0x1daa('0x1d')](_0x34e293[_0x1daa('0x14')][_0x1daa('0x29')]);_0x28488e[_0x1daa('0x1d')](_0x34e293['body'][_0x1daa('0x2a')]);_0x28488e[_0x1daa('0x1d')](_0x3572c1);break;default:_0x28488e=_[_0x1daa('0xc')](_0x128c4d[_0x1daa('0x1a')])?[]:_0x128c4d[_0x1daa('0x1a')][_0x1daa('0x1b')](',');}var _0x598916={'id':util['format'](_0x1daa('0x2b'),_0x590590,_0x128c4d['id'],_0x128c4d[_0x1daa('0x2c')]),'condition':require(_0x1daa('0x2d'))[_0x1daa('0x2e')](_0x590590,getIntervals(_0x27706f[_0x1daa('0x2f')],_0x128c4d),_0x27706f),'consequence':require(_0x1daa('0x30')+_0x128c4d['app'])[_0x1daa('0x31')](_0x590590,_0x28488e,_0x27706f,_0x34e293),'p':_0x128c4d[_0x1daa('0x32')]||0x0};logger[_0x1daa('0x33')]('Push\x20new\x20rule',_0x598916['id'],'on\x20interval',getIntervals(_0x27706f[_0x1daa('0x2f')],_0x128c4d)[_0x1daa('0x1e')](_0x1daa('0x34')));_0x5b622a[_0x1daa('0x1d')](_0x598916);}else{logger['error'](_0x1daa('0x35'),path[_0x1daa('0x1e')](__dirname,'applications',_0x128c4d[_0x1daa('0x2c')]+'.js'));}}_0x27706f[_0x1daa('0x11')][_0x590590]=new RuleEngine(_0x5b622a);_0x27706f[_0x1daa('0x11')][_0x590590][_0x1daa('0x36')](_0x34e293,function(_0x545b75){logger['info'](_0x1daa('0x37'),JSON[_0x1daa('0x38')](_0x545b75['matchPath']));if(_0x27706f['rules'][_0x590590]){_0x27706f[_0x1daa('0x11')][_0x590590]['emit'](_0x1daa('0x39'));}});return _0x5c9736({'code':0xc8,'message':_0x34e293});}else{if(_0x1b3d3b){logger[_0x1daa('0x33')](util[_0x1daa('0x3a')](_0x1daa('0x3b'),_0x590590));}else{logger[_0x1daa('0x33')]('No\x20applications\x20to\x20execute');}return _0x5c9736({'code':0xc8,'message':_0x34e293});}}catch(_0x1a8384){logger[_0x1daa('0x3c')](_0x1a8384[_0x1daa('0x3d')]);return _0x91b7f6(_0x5e68c1['error'](0x1f4,_0x1a8384));}}return _0x91b7f6('routing\x20is\x20empty');});},'AcceptMessage':function(_0x16c6f5){var _0x38cbdb=this;return new Promise(function(_0x9211f9,_0x5c68c4){if(_0x16c6f5[_0x1daa('0x3e')]&&_0x16c6f5[_0x1daa('0x3e')]['id']){if(_0x27706f['agents'][_0x16c6f5['agent']['id']]){_0x27706f[_0x1daa('0x3f')][_0x16c6f5['agent']['id']][_0x1daa('0x40')]=![];_0x27706f['agents'][_0x16c6f5[_0x1daa('0x3e')]['id']][_0x1daa('0x41')]=undefined;}}if(_0x16c6f5[_0x1daa('0x13')]&&_0x16c6f5[_0x1daa('0x13')]['id']){try{var _0x17e660=getId(_0x16c6f5[_0x1daa('0x12')],_0x16c6f5[_0x1daa('0x13')]?_0x16c6f5['message']['id']:0x0,_0x16c6f5[_0x1daa('0x14')]?_0x16c6f5['interaction']['id']:0x0);if(_0x27706f[_0x1daa('0x11')][_0x17e660]){_0x27706f[_0x1daa('0x11')][_0x17e660][_0x1daa('0x42')](_0x1daa('0x43'));if(rpc[_0x16c6f5[_0x1daa('0x12')]+_0x1daa('0x44')]){rpc[_0x16c6f5[_0x1daa('0x12')]+_0x1daa('0x44')][_0x1daa('0x45')](_0x17e660,{'UserId':_0x16c6f5['message'][_0x1daa('0x46')]})[_0x1daa('0x47')](function(){logger[_0x1daa('0x3c')](_0x1daa('0x48'));});}}return _0x9211f9({'code':0xc8,'message':_0x16c6f5});}catch(_0x4d67ed){logger['error'](_0x4d67ed[_0x1daa('0x3d')]);return _0x5c68c4(_0x38cbdb[_0x1daa('0x3c')](0x1f4,_0x4d67ed));}}logger['error'](_0x1daa('0x49'));return _0x5c68c4(_0x38cbdb['error'](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x55cb07){var _0x43eaba=this;return new Promise(function(_0x10bb4d,_0x19180a){if(_0x55cb07['agent']&&_0x55cb07[_0x1daa('0x3e')]['id']){try{if(_0x27706f[_0x1daa('0x3f')][_0x55cb07[_0x1daa('0x3e')]['id']]){_0x27706f['agents'][_0x55cb07[_0x1daa('0x3e')]['id']][_0x1daa('0x40')]=![];_0x27706f[_0x1daa('0x3f')][_0x55cb07[_0x1daa('0x3e')]['id']][_0x1daa('0x41')]=undefined;}return _0x10bb4d({'code':0xc8,'message':_0x55cb07});}catch(_0x432162){logger[_0x1daa('0x3c')](_0x432162[_0x1daa('0x3d')]);return _0x19180a(_0x43eaba[_0x1daa('0x3c')](0x1f4,_0x432162));}}logger[_0x1daa('0x3c')](_0x1daa('0x49'));return _0x19180a(_0x43eaba[_0x1daa('0x3c')](0x1f4,_0x1daa('0x49')));});},'AbandonInteraction':function(_0x5ce8ed){var _0x285341=this;return new Promise(function(_0x2b9a71,_0x215dcd){if(_0x5ce8ed[_0x1daa('0x12')]&&_0x5ce8ed[_0x1daa('0x14')]&&_0x5ce8ed[_0x1daa('0x14')]['id']){try{var _0x2b35c8=getId(_0x5ce8ed[_0x1daa('0x12')],_0x5ce8ed[_0x1daa('0x13')]?_0x5ce8ed['message']['id']:0x0,_0x5ce8ed[_0x1daa('0x14')]?_0x5ce8ed[_0x1daa('0x14')]['id']:0x0);if(_0x27706f[_0x1daa('0x11')][_0x2b35c8]){_0x27706f[_0x1daa('0x11')][_0x2b35c8][_0x1daa('0x42')]('end');}return _0x2b9a71({'code':0xc8,'message':_0x5ce8ed});}catch(_0x32c251){logger[_0x1daa('0x3c')](_0x32c251[_0x1daa('0x3d')]);return _0x215dcd(_0x285341[_0x1daa('0x3c')](0x1f4,_0x32c251));}}logger[_0x1daa('0x3c')](_0x1daa('0x49'));return _0x215dcd(_0x285341[_0x1daa('0x3c')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x5bed7e){var _0x463aa9=this;return new Promise(function(_0x403604,_0x2e1067){if(_0x27706f[_0x1daa('0x3f')][_0x1daa('0x4a')](_0x5bed7e['id'])){for(var _0x517b7f in _0x5bed7e[_0x1daa('0x4b')]){if(_0x5bed7e[_0x1daa('0x4b')][_0x1daa('0x4a')](_0x517b7f)){if(_0x27706f['agents'][_0x5bed7e['id']]['hasOwnProperty'](_0x517b7f+_0x1daa('0x4c'))){_0x27706f[_0x1daa('0x3f')][_0x5bed7e['id']][_0x517b7f+_0x1daa('0x4c')]=parseInt(_0x5bed7e['capacity'][_0x517b7f],0xa);}}}_0x27706f[_0x1daa('0x3f')][_0x5bed7e['id']][_0x1daa('0x4d')]();return _0x403604({'code':0xc8,'message':_0x27706f[_0x1daa('0x3f')][_0x5bed7e['id']]});}else{return _0x2e1067(_0x463aa9[_0x1daa('0x3c')](0x1f4,_0x1daa('0x4e')));}});},'Agents':function(_0x4b71f6){return new Promise(function(_0x1b7049){var _0x367626=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x3f')]);if(_0x4b71f6&&_0x4b71f6['id']){var _0x7f3e1f=_[_0x1daa('0x50')](_0x367626,function(_0x5f291c){return _0x5f291c['id']===_0x4b71f6['id'];});_0x1b7049(_0x7f3e1f);}else{_0x1b7049({'count':_0x367626[_0x1daa('0x17')],'rows':_0x367626});}});},'ChatQueues':function(){return new Promise(function(_0x3f7973){var _0x4521ac=[];for(var _0x5768d2 in _0x27706f[_0x1daa('0x51')]){if(_0x27706f[_0x1daa('0x51')][_0x1daa('0x4a')](_0x5768d2)){var _0x6622d=_0x27706f[_0x1daa('0x51')][_0x5768d2];var _0x2f12d9={'id':_0x6622d['id'],'available':_0x6622d[_0x1daa('0x52')],'loggedIn':_0x6622d[_0x1daa('0x53')],'name':_0x6622d[_0x1daa('0x54')],'paused':_0x6622d[_0x1daa('0x55')],'waiting':_0x6622d[_0x1daa('0x56')]};_0x4521ac['push'](_0x2f12d9);}}_0x3f7973({'count':_0x4521ac[_0x1daa('0x17')],'rows':_0x4521ac});});},'MailQueues':function(){return new Promise(function(_0x36596a){var _0x1181c4=[];for(var _0x1ba14b in _0x27706f[_0x1daa('0x57')]){if(_0x27706f['mailQueues'][_0x1daa('0x4a')](_0x1ba14b)){var _0x448819=_0x27706f[_0x1daa('0x57')][_0x1ba14b];var _0x132dbb={'id':_0x448819['id'],'available':_0x448819[_0x1daa('0x52')],'loggedIn':_0x448819[_0x1daa('0x53')],'name':_0x448819[_0x1daa('0x54')],'paused':_0x448819[_0x1daa('0x55')],'waiting':_0x448819[_0x1daa('0x56')]};_0x1181c4[_0x1daa('0x1d')](_0x132dbb);}}_0x36596a({'count':_0x1181c4[_0x1daa('0x17')],'rows':_0x1181c4});});},'OpenchannelQueues':function(){return new Promise(function(_0x5d7e9e){var _0x58c341=[];for(var _0xb3f118 in _0x27706f[_0x1daa('0x58')]){if(_0x27706f[_0x1daa('0x58')][_0x1daa('0x4a')](_0xb3f118)){var _0x2a3fff=_0x27706f[_0x1daa('0x58')][_0xb3f118];var _0xf1696d={'id':_0x2a3fff['id'],'available':_0x2a3fff[_0x1daa('0x52')],'loggedIn':_0x2a3fff['loggedIn'],'name':_0x2a3fff[_0x1daa('0x54')],'paused':_0x2a3fff[_0x1daa('0x55')],'waiting':_0x2a3fff['waiting']};_0x58c341[_0x1daa('0x1d')](_0xf1696d);}}_0x5d7e9e({'count':_0x58c341[_0x1daa('0x17')],'rows':_0x58c341});});},'SmsQueues':function(){return new Promise(function(_0x5f214){var _0x1c9620=[];for(var _0x23c724 in _0x27706f[_0x1daa('0x59')]){if(_0x27706f['smsQueues']['hasOwnProperty'](_0x23c724)){var _0x373567=_0x27706f['smsQueues'][_0x23c724];var _0x5be592={'id':_0x373567['id'],'available':_0x373567[_0x1daa('0x52')],'loggedIn':_0x373567['loggedIn'],'name':_0x373567[_0x1daa('0x54')],'paused':_0x373567[_0x1daa('0x55')],'waiting':_0x373567[_0x1daa('0x56')]};_0x1c9620[_0x1daa('0x1d')](_0x5be592);}}_0x5f214({'count':_0x1c9620[_0x1daa('0x17')],'rows':_0x1c9620});});},'FaxQueues':function(){return new Promise(function(_0x3992d8){var _0x436562=[];for(var _0x1746ff in _0x27706f[_0x1daa('0x5a')]){if(_0x27706f[_0x1daa('0x5a')][_0x1daa('0x4a')](_0x1746ff)){var _0x516dc2=_0x27706f[_0x1daa('0x5a')][_0x1746ff];var _0x654cb1={'id':_0x516dc2['id'],'available':_0x516dc2[_0x1daa('0x52')],'loggedIn':_0x516dc2[_0x1daa('0x53')],'name':_0x516dc2[_0x1daa('0x54')],'paused':_0x516dc2[_0x1daa('0x55')],'waiting':_0x516dc2['waiting']};_0x436562[_0x1daa('0x1d')](_0x654cb1);}}_0x3992d8({'count':_0x436562[_0x1daa('0x17')],'rows':_0x436562});});},'WhatsappQueues':function(){return new Promise(function(_0x244c9e){var _0x43b715=[];for(var _0x43519e in _0x27706f['whatsappQueues']){if(_0x27706f['whatsappQueues']['hasOwnProperty'](_0x43519e)){var _0x1a35dc=_0x27706f[_0x1daa('0x5b')][_0x43519e];var _0x289b56={'id':_0x1a35dc['id'],'available':_0x1a35dc[_0x1daa('0x52')],'loggedIn':_0x1a35dc[_0x1daa('0x53')],'name':_0x1a35dc[_0x1daa('0x54')],'paused':_0x1a35dc['paused'],'waiting':_0x1a35dc[_0x1daa('0x56')]};_0x43b715['push'](_0x289b56);}}_0x244c9e({'count':_0x43b715[_0x1daa('0x17')],'rows':_0x43b715});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x308e38){var _0x3348d7=_[_0x1daa('0x4f')](_0x27706f['chatQueuesWaitingInteractions']);_0x308e38({'count':_0x3348d7[_0x1daa('0x17')],'rows':_0x3348d7});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x3a613d){var _0x29cf1f=_[_0x1daa('0x4f')](_0x27706f['mailQueuesWaitingInteractions']);_0x3a613d({'count':_0x29cf1f[_0x1daa('0x17')],'rows':_0x29cf1f});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3fcfb5){var _0x420ef8=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x5c')]);_0x3fcfb5({'count':_0x420ef8[_0x1daa('0x17')],'rows':_0x420ef8});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x47573f){var _0x154b02=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x5d')]);_0x47573f({'count':_0x154b02[_0x1daa('0x17')],'rows':_0x154b02});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1c7a7e){var _0x259234=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x5e')]);_0x1c7a7e({'count':_0x259234[_0x1daa('0x17')],'rows':_0x259234});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x44cf24){var _0x179409=_[_0x1daa('0x4f')](_0x27706f[_0x1daa('0x5f')]);_0x44cf24({'count':_0x179409[_0x1daa('0x17')],'rows':_0x179409});});}};var _0x3b226c=jayson['server'](_0x45fd48)[_0x1daa('0x60')]();_0x3b226c['on']('error',function(_0x3d4d98){logger[_0x1daa('0x3c')](JSON[_0x1daa('0x38')](_0x3d4d98));return _0x3261e9(_0x3d4d98);});_0x3b226c[_0x1daa('0x61')](0x232c,'127.0.0.1',function(){console['log'](_0x1daa('0x62'),0x232c);return _0x4e58ff(_0x1daa('0x63')+0x232c);});});}; \ No newline at end of file +var _0x19f1=['isNil','IntervalId','Intervals','map','interval','rules','channel','message','interaction','checkWaitingNotifications','applications','length','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','tag','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','./interval','condition','intervals','./applications/','consequence','priority','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','find','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','log','lodash','path','jayson/promise','bluebird','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format'];(function(_0x5cadd0,_0x3ffb68){var _0x535df4=function(_0x35ff62){while(--_0x35ff62){_0x5cadd0['push'](_0x5cadd0['shift']());}};_0x535df4(++_0x3ffb68);}(_0x19f1,0x1e3));var _0x119f=function(_0x43bf4b,_0x55ace8){_0x43bf4b=_0x43bf4b-0x0;var _0x5be85a=_0x19f1[_0x43bf4b];return _0x5be85a;};'use strict';var _=require(_0x119f('0x0'));var util=require('util');var path=require(_0x119f('0x1'));var fs=require('fs');var jayson=require(_0x119f('0x2'));var BPromise=require(_0x119f('0x3'));var utils=require('./applications/utils');var sUtils=require(_0x119f('0x4'));var logger=require('../../../config/logger')(_0x119f('0x5'));var rpc={'openchannelQueueReport':require(_0x119f('0x6')),'mailQueueReport':require(_0x119f('0x7')),'chatQueueReport':require(_0x119f('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x119f('0x9'))};var RuleEngine=require(_0x119f('0xa'));function getId(_0x275c93,_0x3d7a74,_0x4f1e0d){return util[_0x119f('0xb')]('%s.%s.%s',_0x275c93,_0x3d7a74||0x0,_0x4f1e0d||0x0);}function getIntervals(_0x44a5e9,_0x11d3a6){var _0x36bb8f=[];if(!_[_0x119f('0xc')](_0x11d3a6[_0x119f('0xd')])&&!_[_0x119f('0xc')](_0x44a5e9[_0x11d3a6[_0x119f('0xd')]])&&!_[_0x119f('0xc')](_0x44a5e9[_0x11d3a6[_0x119f('0xd')]][_0x119f('0xe')])){_0x36bb8f=_[_0x119f('0xf')](_0x44a5e9[_0x11d3a6[_0x119f('0xd')]][_0x119f('0xe')],_0x119f('0x10'));}else if(!_[_0x119f('0xc')](_0x11d3a6['interval'])){_0x36bb8f=[_0x11d3a6[_0x119f('0x10')]];}return _0x36bb8f;}exports['listen']=function(_0x1ad681){_0x1ad681[_0x119f('0x11')]={};return new BPromise(function(_0x242305,_0x565934){var _0x3f8045={'Start':function(_0x4e0d4a){var _0x2f02a0=this;return new Promise(function(_0x249782,_0x111ff3){if(_0x4e0d4a){try{var _0x380c3b=[];var _0x1d336a=getId(_0x4e0d4a[_0x119f('0x12')],_0x4e0d4a['message']?_0x4e0d4a[_0x119f('0x13')]['id']:0x0,_0x4e0d4a[_0x119f('0x14')]?_0x4e0d4a[_0x119f('0x14')]['id']:0x0);var _0x52a48b=sUtils[_0x119f('0x15')](_0x1ad681,_0x4e0d4a);if(!_0x52a48b&&_0x4e0d4a[_0x119f('0x16')]&&_['isArray'](_0x4e0d4a[_0x119f('0x16')])&&_0x4e0d4a[_0x119f('0x16')][_0x119f('0x17')]){for(var _0x69d6b8=0x0;_0x69d6b8<_0x4e0d4a['applications'][_0x119f('0x17')];_0x69d6b8+=0x1){var _0x2870c6=_0x4e0d4a['applications'][_0x69d6b8];if(fs['existsSync'](path['join'](__dirname,'applications',_0x2870c6[_0x119f('0x18')]+_0x119f('0x19')))){var _0x19e2b2=[];switch(_0x2870c6[_0x119f('0x18')][_0x119f('0x1a')]()){case _0x119f('0x1b'):var _0x566b92=_0x2870c6[_0x119f('0x1c')][_0x119f('0x1d')](',');if(_0x4e0d4a['channel']===_0x119f('0x1e')){_0x19e2b2['push'](_0x566b92[0x0]);_0x19e2b2[_0x119f('0x1f')](_0x566b92[0x1]);_0x19e2b2[_0x119f('0x1f')](_0x566b92[_0x119f('0x20')](0x2,_0x566b92['length'])[_0x119f('0x21')](','));}else{_0x19e2b2[_0x119f('0x1f')](_0x566b92[0x0]);_0x19e2b2['push'](_0x566b92[_0x119f('0x20')](0x1,_0x566b92[_0x119f('0x17')])['join'](','));}break;case _0x119f('0x22'):var _0x29261f=_0x2870c6[_0x119f('0x1c')][_0x119f('0x1d')](',');_0x19e2b2[_0x119f('0x1f')](_0x29261f[0x0]);_0x19e2b2['push'](_0x29261f[0x1]);_0x19e2b2['push'](_0x29261f[_0x119f('0x20')](0x2,_0x29261f[_0x119f('0x17')])[_0x119f('0x21')](','));break;case _0x119f('0x23'):var _0x19892f=_0x2870c6['appdata'][_0x119f('0x1d')](',');_0x19e2b2[_0x119f('0x1f')](_0x19892f[0x0]);_0x19e2b2[_0x119f('0x1f')](_0x19892f[0x1]);_0x19e2b2[_0x119f('0x1f')](_0x19892f[0x2]);_0x19e2b2['push'](_0x19892f[0x3]);_0x19e2b2[_0x119f('0x1f')](_0x19892f[_0x119f('0x20')](0x4,_0x19892f['length'])[_0x119f('0x21')](','));break;case'amazonlex':var _0x1241c7=_0x2870c6[_0x119f('0x1c')][_0x119f('0x1d')](',');_0x19e2b2[_0x119f('0x1f')](_0x1241c7[0x0]);_0x19e2b2[_0x119f('0x1f')](_0x1241c7[0x1]);_0x19e2b2[_0x119f('0x1f')](_0x1241c7[0x2]);_0x19e2b2[_0x119f('0x1f')](_0x1241c7[0x3]);_0x19e2b2[_0x119f('0x1f')](_0x1241c7[_0x119f('0x20')](0x4,_0x1241c7['length'])[_0x119f('0x21')](','));break;case _0x119f('0x13'):_0x19e2b2[_0x119f('0x1f')](_0x2870c6[_0x119f('0x1c')]);break;case _0x119f('0x24'):_0x19e2b2[_0x119f('0x1f')](_0x2870c6['TagId']);_0x19e2b2['push'](_0x2870c6[_0x119f('0x1c')]);break;case _0x119f('0x25'):var _0xc4c693=utils['getMustacheRender'](_0x4e0d4a[_0x119f('0x26')][_0x119f('0x27')],_0x4e0d4a);var _0x2202ac=_0x2870c6[_0x119f('0x1c')]['split'](',');_0x19e2b2[_0x119f('0x1f')](_0x2202ac[0x0]);_0x19e2b2[_0x119f('0x1f')](_0x2202ac[0x1]);_0x19e2b2['push'](_0x2202ac[0x2]);_0x19e2b2['push'](_0x2202ac[0x3]);_0x19e2b2[_0x119f('0x1f')](_0x2202ac[0x4]);_0x19e2b2[_0x119f('0x1f')](_0x2202ac[0x5]);_0x19e2b2[_0x119f('0x1f')](_0x2202ac[0x6]);_0x19e2b2[_0x119f('0x1f')](_0x2202ac[0x7]);_0x19e2b2[_0x119f('0x1f')](_0x2202ac[0x8]);_0x19e2b2['push'](_0x2202ac[0x9]);_0x19e2b2[_0x119f('0x1f')](_0x2202ac[0xa]);_0x19e2b2[_0x119f('0x1f')](_0x4e0d4a[_0x119f('0x14')]['id']);_0x19e2b2[_0x119f('0x1f')](_0x4e0d4a[_0x119f('0x13')]['id']);_0x19e2b2[_0x119f('0x1f')](_0x2870c6[_0x119f('0x28')]);_0x19e2b2[_0x119f('0x1f')](_0x4e0d4a[_0x119f('0x14')][_0x119f('0x29')]);_0x19e2b2[_0x119f('0x1f')](_0x4e0d4a[_0x119f('0x2a')][_0x119f('0x2a')]);_0x19e2b2[_0x119f('0x1f')](_0xc4c693);break;default:_0x19e2b2=_[_0x119f('0xc')](_0x2870c6[_0x119f('0x1c')])?[]:_0x2870c6[_0x119f('0x1c')][_0x119f('0x1d')](',');}var _0x3af616={'id':util[_0x119f('0xb')]('%s:%s:%s',_0x1d336a,_0x2870c6['id'],_0x2870c6['app']),'condition':require(_0x119f('0x2b'))[_0x119f('0x2c')](_0x1d336a,getIntervals(_0x1ad681[_0x119f('0x2d')],_0x2870c6),_0x1ad681),'consequence':require(_0x119f('0x2e')+_0x2870c6['app'])[_0x119f('0x2f')](_0x1d336a,_0x19e2b2,_0x1ad681,_0x4e0d4a),'p':_0x2870c6[_0x119f('0x30')]||0x0};logger['info']('Push\x20new\x20rule',_0x3af616['id'],_0x119f('0x31'),getIntervals(_0x1ad681[_0x119f('0x2d')],_0x2870c6)[_0x119f('0x21')](_0x119f('0x32')));_0x380c3b[_0x119f('0x1f')](_0x3af616);}else{logger[_0x119f('0x33')](_0x119f('0x34'),path[_0x119f('0x21')](__dirname,_0x119f('0x16'),_0x2870c6['app']+_0x119f('0x19')));}}_0x1ad681[_0x119f('0x11')][_0x1d336a]=new RuleEngine(_0x380c3b);_0x1ad681['rules'][_0x1d336a][_0x119f('0x35')](_0x4e0d4a,function(_0x1725d7){logger[_0x119f('0x36')](_0x119f('0x37'),JSON['stringify'](_0x1725d7[_0x119f('0x38')]));if(_0x1ad681[_0x119f('0x11')][_0x1d336a]){_0x1ad681[_0x119f('0x11')][_0x1d336a][_0x119f('0x39')](_0x119f('0x3a'));}});return _0x249782({'code':0xc8,'message':_0x4e0d4a});}else{if(_0x52a48b){logger['info'](util[_0x119f('0xb')](_0x119f('0x3b'),_0x1d336a));}else{logger[_0x119f('0x36')]('No\x20applications\x20to\x20execute');}return _0x249782({'code':0xc8,'message':_0x4e0d4a});}}catch(_0x51a8b3){logger[_0x119f('0x33')](_0x51a8b3['stack']);return _0x111ff3(_0x2f02a0[_0x119f('0x33')](0x1f4,_0x51a8b3));}}return _0x111ff3(_0x119f('0x3c'));});},'AcceptMessage':function(_0x25f795){var _0x5b8063=this;return new Promise(function(_0x141617,_0x451561){if(_0x25f795[_0x119f('0x3d')]&&_0x25f795[_0x119f('0x3d')]['id']){if(_0x1ad681[_0x119f('0x3e')][_0x25f795[_0x119f('0x3d')]['id']]){_0x1ad681['agents'][_0x25f795['agent']['id']][_0x119f('0x3f')]=![];_0x1ad681[_0x119f('0x3e')][_0x25f795[_0x119f('0x3d')]['id']][_0x119f('0x40')]=undefined;}}if(_0x25f795['message']&&_0x25f795[_0x119f('0x13')]['id']){try{var _0x2bbe91=getId(_0x25f795[_0x119f('0x12')],_0x25f795['message']?_0x25f795[_0x119f('0x13')]['id']:0x0,_0x25f795[_0x119f('0x14')]?_0x25f795[_0x119f('0x14')]['id']:0x0);if(_0x1ad681[_0x119f('0x11')][_0x2bbe91]){_0x1ad681[_0x119f('0x11')][_0x2bbe91][_0x119f('0x39')](_0x119f('0x41'));if(rpc[_0x25f795[_0x119f('0x12')]+_0x119f('0x42')]){rpc[_0x25f795['channel']+_0x119f('0x42')][_0x119f('0x43')](_0x2bbe91,{'UserId':_0x25f795[_0x119f('0x13')][_0x119f('0x44')]})[_0x119f('0x45')](function(){logger[_0x119f('0x33')](_0x119f('0x46'));});}}return _0x141617({'code':0xc8,'message':_0x25f795});}catch(_0xd5226){logger['error'](_0xd5226[_0x119f('0x47')]);return _0x451561(_0x5b8063['error'](0x1f4,_0xd5226));}}logger[_0x119f('0x33')]('message\x20is\x20empty');return _0x451561(_0x5b8063[_0x119f('0x33')](0x1f4,_0x119f('0x48')));});},'RejectMessage':function(_0x467a87){var _0x93769c=this;return new Promise(function(_0x4be55b,_0x23f2cf){if(_0x467a87[_0x119f('0x3d')]&&_0x467a87['agent']['id']){try{if(_0x1ad681[_0x119f('0x3e')][_0x467a87['agent']['id']]){_0x1ad681[_0x119f('0x3e')][_0x467a87['agent']['id']][_0x119f('0x3f')]=![];_0x1ad681['agents'][_0x467a87[_0x119f('0x3d')]['id']][_0x119f('0x40')]=undefined;}return _0x4be55b({'code':0xc8,'message':_0x467a87});}catch(_0x49bf23){logger[_0x119f('0x33')](_0x49bf23[_0x119f('0x47')]);return _0x23f2cf(_0x93769c[_0x119f('0x33')](0x1f4,_0x49bf23));}}logger[_0x119f('0x33')]('message\x20is\x20empty');return _0x23f2cf(_0x93769c['error'](0x1f4,_0x119f('0x48')));});},'AbandonInteraction':function(_0x257d10){var _0x4d9a3a=this;return new Promise(function(_0x33960f,_0x33abab){if(_0x257d10['channel']&&_0x257d10[_0x119f('0x14')]&&_0x257d10['interaction']['id']){try{var _0x42466c=getId(_0x257d10[_0x119f('0x12')],_0x257d10[_0x119f('0x13')]?_0x257d10[_0x119f('0x13')]['id']:0x0,_0x257d10['interaction']?_0x257d10[_0x119f('0x14')]['id']:0x0);if(_0x1ad681['rules'][_0x42466c]){_0x1ad681[_0x119f('0x11')][_0x42466c][_0x119f('0x39')](_0x119f('0x41'));}return _0x33960f({'code':0xc8,'message':_0x257d10});}catch(_0x1f9340){logger[_0x119f('0x33')](_0x1f9340[_0x119f('0x47')]);return _0x33abab(_0x4d9a3a['error'](0x1f4,_0x1f9340));}}logger['error'](_0x119f('0x48'));return _0x33abab(_0x4d9a3a[_0x119f('0x33')](0x1f4,_0x119f('0x48')));});},'AgentCapacity':function(_0x3b9378){var _0x494208=this;return new Promise(function(_0x170013,_0x5cb749){if(_0x1ad681[_0x119f('0x3e')][_0x119f('0x49')](_0x3b9378['id'])){for(var _0x16b593 in _0x3b9378[_0x119f('0x4a')]){if(_0x3b9378['capacity'][_0x119f('0x49')](_0x16b593)){if(_0x1ad681['agents'][_0x3b9378['id']][_0x119f('0x49')](_0x16b593+_0x119f('0x4b'))){_0x1ad681[_0x119f('0x3e')][_0x3b9378['id']][_0x16b593+'CurrentCapacity']=parseInt(_0x3b9378[_0x119f('0x4a')][_0x16b593],0xa);}}}_0x1ad681[_0x119f('0x3e')][_0x3b9378['id']][_0x119f('0x4c')]();return _0x170013({'code':0xc8,'message':_0x1ad681[_0x119f('0x3e')][_0x3b9378['id']]});}else{return _0x5cb749(_0x494208[_0x119f('0x33')](0x1f4,_0x119f('0x4d')));}});},'Agents':function(_0x12f9f8){return new Promise(function(_0x2c817d){var _0x55d061=_['values'](_0x1ad681[_0x119f('0x3e')]);if(_0x12f9f8&&_0x12f9f8['id']){var _0x1f13c4=_[_0x119f('0x4e')](_0x55d061,function(_0x17477f){return _0x17477f['id']===_0x12f9f8['id'];});_0x2c817d(_0x1f13c4);}else{_0x2c817d({'count':_0x55d061[_0x119f('0x17')],'rows':_0x55d061});}});},'ChatQueues':function(){return new Promise(function(_0x412750){var _0x5850e3=[];for(var _0x4b915d in _0x1ad681['chatQueues']){if(_0x1ad681[_0x119f('0x4f')]['hasOwnProperty'](_0x4b915d)){var _0x573e6c=_0x1ad681[_0x119f('0x4f')][_0x4b915d];var _0x4b0562={'id':_0x573e6c['id'],'available':_0x573e6c['available'],'loggedIn':_0x573e6c[_0x119f('0x50')],'name':_0x573e6c[_0x119f('0x51')],'paused':_0x573e6c[_0x119f('0x52')],'waiting':_0x573e6c[_0x119f('0x53')]};_0x5850e3['push'](_0x4b0562);}}_0x412750({'count':_0x5850e3[_0x119f('0x17')],'rows':_0x5850e3});});},'MailQueues':function(){return new Promise(function(_0x95ec61){var _0x2d50bb=[];for(var _0xca7b54 in _0x1ad681[_0x119f('0x54')]){if(_0x1ad681['mailQueues'][_0x119f('0x49')](_0xca7b54)){var _0x58cefd=_0x1ad681[_0x119f('0x54')][_0xca7b54];var _0x2e4986={'id':_0x58cefd['id'],'available':_0x58cefd[_0x119f('0x55')],'loggedIn':_0x58cefd[_0x119f('0x50')],'name':_0x58cefd['name'],'paused':_0x58cefd[_0x119f('0x52')],'waiting':_0x58cefd[_0x119f('0x53')]};_0x2d50bb[_0x119f('0x1f')](_0x2e4986);}}_0x95ec61({'count':_0x2d50bb[_0x119f('0x17')],'rows':_0x2d50bb});});},'OpenchannelQueues':function(){return new Promise(function(_0x4714d9){var _0x3ad041=[];for(var _0x461b72 in _0x1ad681[_0x119f('0x56')]){if(_0x1ad681[_0x119f('0x56')]['hasOwnProperty'](_0x461b72)){var _0x446ce0=_0x1ad681['openchannelQueues'][_0x461b72];var _0x369b23={'id':_0x446ce0['id'],'available':_0x446ce0[_0x119f('0x55')],'loggedIn':_0x446ce0['loggedIn'],'name':_0x446ce0[_0x119f('0x51')],'paused':_0x446ce0[_0x119f('0x52')],'waiting':_0x446ce0['waiting']};_0x3ad041[_0x119f('0x1f')](_0x369b23);}}_0x4714d9({'count':_0x3ad041[_0x119f('0x17')],'rows':_0x3ad041});});},'SmsQueues':function(){return new Promise(function(_0x3b0743){var _0x3bb65b=[];for(var _0x507393 in _0x1ad681[_0x119f('0x57')]){if(_0x1ad681[_0x119f('0x57')][_0x119f('0x49')](_0x507393)){var _0x390124=_0x1ad681['smsQueues'][_0x507393];var _0x1911d6={'id':_0x390124['id'],'available':_0x390124[_0x119f('0x55')],'loggedIn':_0x390124['loggedIn'],'name':_0x390124['name'],'paused':_0x390124[_0x119f('0x52')],'waiting':_0x390124[_0x119f('0x53')]};_0x3bb65b[_0x119f('0x1f')](_0x1911d6);}}_0x3b0743({'count':_0x3bb65b['length'],'rows':_0x3bb65b});});},'FaxQueues':function(){return new Promise(function(_0x13b476){var _0x3b98db=[];for(var _0x2d0f4c in _0x1ad681[_0x119f('0x58')]){if(_0x1ad681[_0x119f('0x58')]['hasOwnProperty'](_0x2d0f4c)){var _0x325497=_0x1ad681[_0x119f('0x58')][_0x2d0f4c];var _0x1d77ac={'id':_0x325497['id'],'available':_0x325497[_0x119f('0x55')],'loggedIn':_0x325497[_0x119f('0x50')],'name':_0x325497[_0x119f('0x51')],'paused':_0x325497[_0x119f('0x52')],'waiting':_0x325497[_0x119f('0x53')]};_0x3b98db['push'](_0x1d77ac);}}_0x13b476({'count':_0x3b98db[_0x119f('0x17')],'rows':_0x3b98db});});},'WhatsappQueues':function(){return new Promise(function(_0x176cb2){var _0x10fb1b=[];for(var _0x1e0bb2 in _0x1ad681[_0x119f('0x59')]){if(_0x1ad681[_0x119f('0x59')][_0x119f('0x49')](_0x1e0bb2)){var _0x1723ad=_0x1ad681[_0x119f('0x59')][_0x1e0bb2];var _0xe87169={'id':_0x1723ad['id'],'available':_0x1723ad[_0x119f('0x55')],'loggedIn':_0x1723ad[_0x119f('0x50')],'name':_0x1723ad[_0x119f('0x51')],'paused':_0x1723ad['paused'],'waiting':_0x1723ad[_0x119f('0x53')]};_0x10fb1b[_0x119f('0x1f')](_0xe87169);}}_0x176cb2({'count':_0x10fb1b[_0x119f('0x17')],'rows':_0x10fb1b});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x1676b2){var _0x934226=_[_0x119f('0x5a')](_0x1ad681['chatQueuesWaitingInteractions']);_0x1676b2({'count':_0x934226['length'],'rows':_0x934226});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x21a114){var _0x4ae314=_['values'](_0x1ad681[_0x119f('0x5b')]);_0x21a114({'count':_0x4ae314[_0x119f('0x17')],'rows':_0x4ae314});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1dc916){var _0x224a07=_[_0x119f('0x5a')](_0x1ad681[_0x119f('0x5c')]);_0x1dc916({'count':_0x224a07[_0x119f('0x17')],'rows':_0x224a07});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1fcf44){var _0x3f3c7e=_['values'](_0x1ad681[_0x119f('0x5d')]);_0x1fcf44({'count':_0x3f3c7e['length'],'rows':_0x3f3c7e});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5cd374){var _0x34d4d1=_[_0x119f('0x5a')](_0x1ad681[_0x119f('0x5e')]);_0x5cd374({'count':_0x34d4d1[_0x119f('0x17')],'rows':_0x34d4d1});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x247fa0){var _0x1ba41d=_['values'](_0x1ad681['whatsappQueuesWaitingInteractions']);_0x247fa0({'count':_0x1ba41d[_0x119f('0x17')],'rows':_0x1ba41d});});}};var _0x203e17=jayson['server'](_0x3f8045)[_0x119f('0x5f')]();_0x203e17['on']('error',function(_0x2f825f){logger['error'](JSON[_0x119f('0x60')](_0x2f825f));return _0x565934(_0x2f825f);});_0x203e17['listen'](0x232c,_0x119f('0x61'),function(){console[_0x119f('0x62')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x242305('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 0d41d41..f8dad06 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 _0x0ffa=['[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','stack','stop','util','bluebird','jayson/promise','../../../config/logger','routing','client','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','iftime\x20%s','then','indexOf','true','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0ffa,0x182));var _0xa0ff=function(_0x10e05a,_0x26374f){_0x10e05a=_0x10e05a-0x0;var _0x1d5361=_0x0ffa[_0x10e05a];return _0x1d5361;};'use strict';var util=require(_0xa0ff('0x0'));var BPromise=require(_0xa0ff('0x1'));var jayson=require(_0xa0ff('0x2'));var _=require('lodash');var logger=require(_0xa0ff('0x3'))(_0xa0ff('0x4'));var client=jayson[_0xa0ff('0x5')]['http']({'port':0x232a});function request(_0x7222ad,_0x36a0f3){return new BPromise(function(_0x253e7c,_0x3bfa41){return client['request'](_0x7222ad,_0x36a0f3)['then'](function(_0x1d3bed){if(_0x1d3bed['error']){return _0x3bfa41(_0x1d3bed['error'][_0xa0ff('0x6')]);}else{return _0x253e7c(_0x1d3bed['result']);}})['catch'](function(_0x128edc){return _0x3bfa41(_0x128edc);});});}exports[_0xa0ff('0x7')]=function(_0x21f06e,_0x56699b,_0x5082ba){return function(_0x1c8d3a){if(_0x5082ba['rules']&&!_0x5082ba[_0xa0ff('0x8')][_0x21f06e]){logger[_0xa0ff('0x9')](_0xa0ff('0xa'),_0x21f06e);return _0x1c8d3a['stop']();}var _0x499976=[];for(var _0x3131e6=0x0;_0x3131e6<_0x56699b['length'];_0x3131e6+=0x1){_0x499976[_0xa0ff('0xb')](request(_0xa0ff('0xc'),{'command':util[_0xa0ff('0xd')](_0xa0ff('0xe'),_0x56699b[_0x3131e6])})[_0xa0ff('0xf')](function(_0x572061){return _0x572061&&_0x572061[_0xa0ff('0x6')]&&_0x572061[_0xa0ff('0x6')][_0xa0ff('0x10')](_0xa0ff('0x11'))>=0x0?!![]:![];})[_0xa0ff('0x12')](function(_0x952c66){logger['error'](_0xa0ff('0x13'),_0x21f06e,_0x56699b[_0x3131e6]);}));}BPromise['all'](_0x499976)[_0xa0ff('0xf')](function(_0x10a644){var _0x2c849c=_[_0xa0ff('0x14')](_0x10a644);logger[_0xa0ff('0x9')](_0xa0ff('0x15'),_0x21f06e,_0x56699b[_0xa0ff('0x16')]('\x20|\x20'),_0x2c849c);_0x1c8d3a[_0xa0ff('0x17')](_0x2c849c);})['catch'](function(_0x41f7f7){console[_0xa0ff('0x18')](_0x41f7f7);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x21f06e,_0x56699b[_0xa0ff('0x16')]('\x20|\x20'),_0x41f7f7[_0xa0ff('0x19')]);_0x1c8d3a[_0xa0ff('0x1a')]();});};}; \ No newline at end of file +var _0x743d=['condition','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','iftime\x20%s','indexOf','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch'];(function(_0x27ccb6,_0x103913){var _0x412043=function(_0x3c1624){while(--_0x3c1624){_0x27ccb6['push'](_0x27ccb6['shift']());}};_0x412043(++_0x103913);}(_0x743d,0x10a));var _0xd743=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x743d[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xd743('0x0'));var BPromise=require(_0xd743('0x1'));var jayson=require(_0xd743('0x2'));var _=require(_0xd743('0x3'));var logger=require(_0xd743('0x4'))(_0xd743('0x5'));var client=jayson[_0xd743('0x6')][_0xd743('0x7')]({'port':0x232a});function request(_0x3fd156,_0x277a51){return new BPromise(function(_0x976e4d,_0x49a68a){return client[_0xd743('0x8')](_0x3fd156,_0x277a51)[_0xd743('0x9')](function(_0x30d2f3){if(_0x30d2f3[_0xd743('0xa')]){return _0x49a68a(_0x30d2f3[_0xd743('0xa')][_0xd743('0xb')]);}else{return _0x976e4d(_0x30d2f3[_0xd743('0xc')]);}})[_0xd743('0xd')](function(_0x5865c0){return _0x49a68a(_0x5865c0);});});}exports[_0xd743('0xe')]=function(_0x1c79fd,_0x281daa,_0x211301){return function(_0x66375c){if(_0x211301['rules']&&!_0x211301['rules'][_0x1c79fd]){logger['info'](_0xd743('0xf'),_0x1c79fd);return _0x66375c[_0xd743('0x10')]();}var _0x5b1e9b=[];for(var _0xdcaea8=0x0;_0xdcaea8<_0x281daa[_0xd743('0x11')];_0xdcaea8+=0x1){_0x5b1e9b['push'](request(_0xd743('0x12'),{'command':util[_0xd743('0x13')](_0xd743('0x14'),_0x281daa[_0xdcaea8])})[_0xd743('0x9')](function(_0x48f28b){return _0x48f28b&&_0x48f28b[_0xd743('0xb')]&&_0x48f28b[_0xd743('0xb')][_0xd743('0x15')]('true')>=0x0?!![]:![];})[_0xd743('0xd')](function(_0x64b6e2){logger[_0xd743('0xa')]('[%s][INTERVAL]\x20%s',_0x1c79fd,_0x281daa[_0xdcaea8]);}));}BPromise[_0xd743('0x16')](_0x5b1e9b)[_0xd743('0x9')](function(_0x5232f1){var _0x5bfe99=_[_0xd743('0x17')](_0x5232f1);logger['info'](_0xd743('0x18'),_0x1c79fd,_0x281daa[_0xd743('0x19')]('\x20|\x20'),_0x5bfe99);_0x66375c['when'](_0x5bfe99);})[_0xd743('0xd')](function(_0x51d2c9){console['log'](_0x51d2c9);logger[_0xd743('0xa')]('[%s][INTERVAL]\x20%s\x20%s',_0x1c79fd,_0x281daa[_0xd743('0x19')](_0xd743('0x1a')),_0x51d2c9[_0xd743('0x1b')]);_0x66375c[_0xd743('0x10')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index d89f7df..8135346 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 _0x1339=['talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','error','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertargetuniqueid','clone','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinenum','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','isNil','agentringnoanswer','agentringnoanswerAt','timeout','reason','holdtime'];(function(_0x3a93b7,_0x658183){var _0x2ed891=function(_0x1a60de){while(--_0x1a60de){_0x3a93b7['push'](_0x3a93b7['shift']());}};_0x2ed891(++_0x658183);}(_0x1339,0x1ed));var _0x9133=function(_0x1a7093,_0x217c0e){_0x1a7093=_0x1a7093-0x0;var _0x22f28a=_0x1339[_0x1a7093];return _0x22f28a;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9133('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2a91b2,_0x4611be){utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x3'),_0x2a91b2[_0x9133('0x4')],_0x2a91b2[_0x9133('0x5')],_0x2a91b2['queue'],_0x2a91b2[_0x9133('0x6')],_0x2a91b2[_0x9133('0x7')],_0x2a91b2[_0x9133('0x8')],_0x2a91b2['connectedlinenum'],_0x2a91b2[_0x9133('0x9')]));if(_0x2a91b2[_0x9133('0xa')]){utils[_0x9133('0xb')](_0x2a91b2[_0x9133('0xa')])[_0x9133('0xc')](function(_0x3a7a80){if(_0x3a7a80){_0x2a91b2[_0x9133('0xd')]=_0x3a7a80[_0x9133('0xd')];_0x2a91b2[_0x9133('0xe')]=_0x2a91b2[_0x9133('0xf')]?_0x3a7a80['acw']:![];_0x2a91b2[_0x9133('0x10')]=_0x2a91b2[_0x9133('0xe')]?_0x3a7a80[_0x9133('0x11')]:0x0;}utils[_0x9133('0x12')](_0x9133('0x13'),_0x2a91b2);});}else{utils[_0x9133('0x12')]('CreateVoiceAgentReport',_0x2a91b2);}if(_0x4611be){delete transfers[_0x2a91b2[_0x9133('0x4')]];}else{delete agents[_0x2a91b2[_0x9133('0x14')]];}}exports['agentcalled']=function(_0x5283a3){try{utils[_0x9133('0x15')](util['format'](_0x9133('0x16'),_0x5283a3[_0x9133('0x4')]),_0x5283a3);agents[_0x5283a3[_0x9133('0x14')]]=_0x5283a3;agents[_0x5283a3[_0x9133('0x14')]][_0x9133('0x17')]=utils[_0x9133('0x18')]();agents[_0x5283a3['destuniqueid']][_0x9133('0x9')]=_0x9133('0x19');agents[_0x5283a3['destuniqueid']][_0x9133('0x1a')]=null;agents[_0x5283a3[_0x9133('0x14')]][_0x9133('0x1b')]=null;utils[_0x9133('0x1')](util['format'](_0x9133('0x1c'),_0x5283a3['uniqueid'],agents[_0x5283a3[_0x9133('0x14')]]['membername'],_0x5283a3[_0x9133('0x14')]));}catch(_0x1d6d0b){utils['error'](util[_0x9133('0x2')]('[%s][agents][agentcalled]',_0x5283a3[_0x9133('0x4')]),_0x1d6d0b);}};exports['agentringnoanswer']=function(_0x5e4f0c){try{if(!_[_0x9133('0x1d')](agents[_0x5e4f0c['destuniqueid']])){utils[_0x9133('0x15')](util['format']('[%s][agents][agentringnoanswer]',_0x5e4f0c['uniqueid']),_0x5e4f0c);utils[_0x9133('0x1')](util[_0x9133('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x5e4f0c[_0x9133('0x4')],agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x6')],_0x5e4f0c[_0x9133('0x14')]));agents[_0x5e4f0c['destuniqueid']][_0x9133('0x1e')]=!![];agents[_0x5e4f0c['destuniqueid']][_0x9133('0x1f')]=utils[_0x9133('0x18')]();agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x9')]=_0x9133('0x20');agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x21')]=_0x9133('0x20');agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x22')]=_0x5e4f0c['ringtime']?parseInt(_0x5e4f0c['ringtime'])/0x3e8:0x0;agents[_0x5e4f0c[_0x9133('0x14')]][_0x9133('0x23')]=0x0;unanswered[_0x9133('0x24')](_0x5e4f0c[_0x9133('0x14')]);}}catch(_0x4de894){utils['error'](util[_0x9133('0x2')](_0x9133('0x25'),_0x5e4f0c[_0x9133('0x4')]),_0x4de894);}};exports[_0x9133('0x26')]=function(_0x390f50){try{_[_0x9133('0x27')](agents,function(_0x48c713,_0x58afe0){if(_0x48c713['uniqueid']==_0x390f50[_0x9133('0x4')]&&!_['includes'](unanswered,_0x48c713[_0x9133('0x14')])){utils[_0x9133('0x15')](util['format'](_0x9133('0x28'),_0x390f50['uniqueid']),_0x390f50);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x29'),_0x390f50['uniqueid'],_0x48c713[_0x9133('0x6')],_0x48c713[_0x9133('0x14')]));_0x48c713[_0x9133('0x1e')]=!![];_0x48c713['agentringnoanswerAt']=utils[_0x9133('0x18')]();_0x48c713[_0x9133('0x9')]=_0x9133('0x2a');_0x48c713['reason']=_0x9133('0x2a');_0x48c713[_0x9133('0x22')]=_0x390f50[_0x9133('0x22')];_0x48c713[_0x9133('0x23')]=0x0;writeDB(_0x48c713);}});}catch(_0x5e4d5e){utils[_0x9133('0x2b')](util[_0x9133('0x2')]('[%s][agents][queuecallerabandon]',_0x390f50[_0x9133('0x4')]),_0x5e4d5e);}};exports[_0x9133('0x2c')]=function(_0x593fbe){try{if(agents[_0x593fbe[_0x9133('0x14')]]){utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x2d'),_0x593fbe[_0x9133('0x4')]),_0x593fbe);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x2e'),_0x593fbe['uniqueid'],agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x6')],_0x593fbe['destuniqueid']));agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x2f')]=utils[_0x9133('0x18')]();agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x1a')]=_0x593fbe[_0x9133('0x1a')];agents[_0x593fbe['destuniqueid']]['connectedlinename']=_0x593fbe[_0x9133('0x1b')];agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x22')]=_0x593fbe[_0x9133('0x30')];agents[_0x593fbe[_0x9133('0x14')]][_0x9133('0x9')]=_0x9133('0x31');_[_0x9133('0x27')](agents,function(_0x720048,_0x5a3f73){if(_0x720048[_0x9133('0x14')]!=_0x593fbe[_0x9133('0x14')]&&_0x720048[_0x9133('0x4')]==_0x593fbe[_0x9133('0x4')]){_0x720048[_0x9133('0x23')]=0x0;_0x720048['holdtime']=_0x593fbe[_0x9133('0x30')];_0x720048[_0x9133('0x1e')]=!![];_0x720048[_0x9133('0x1f')]=utils[_0x9133('0x18')]();_0x720048['lastevent']=_0x9133('0x32');_0x720048[_0x9133('0x21')]=_0x9133('0x32');_0x720048[_0x9133('0x33')]=_0x593fbe[_0x9133('0x14')];_0x720048[_0x9133('0x34')]=_0x593fbe[_0x9133('0x6')];writeDB(_0x720048);}});}}catch(_0x4ca1a3){utils[_0x9133('0x2b')](util['format']('[%s][agents][agentconnect]',_0x593fbe[_0x9133('0x4')]),_0x4ca1a3);}};exports[_0x9133('0xf')]=function(_0x46156d){try{if(!_[_0x9133('0x1d')](agents[_0x46156d[_0x9133('0x14')]])){utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x35'),_0x46156d[_0x9133('0x4')]),_0x46156d);utils['info'](util[_0x9133('0x2')](_0x9133('0x36'),_0x46156d[_0x9133('0x4')],agents[_0x46156d['destuniqueid']]['membername'],_0x46156d[_0x9133('0x14')]));agents[_0x46156d[_0x9133('0x14')]]['agentcomplete']=!![];agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x37')]=utils[_0x9133('0x18')]();agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x23')]=utils['diffTime'](agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x37')],agents[_0x46156d[_0x9133('0x14')]]['agentconnectAt']);agents[_0x46156d[_0x9133('0x14')]][_0x9133('0x21')]=_0x46156d['reason'];agents[_0x46156d['destuniqueid']][_0x9133('0x9')]=_0x9133('0x38');writeDB(agents[_0x46156d[_0x9133('0x14')]]);}}catch(_0x41fea9){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x35'),_0x46156d[_0x9133('0x4')]),_0x41fea9);}};exports[_0x9133('0x39')]=function(_0xf07fbb){try{if(!_[_0x9133('0x1d')](agents[_0xf07fbb[_0x9133('0x3a')]])){utils['debug'](util['format'](_0x9133('0x3b'),_0xf07fbb['uniqueid']),_0xf07fbb);utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x3c'),_0xf07fbb[_0x9133('0x4')],agents[_0xf07fbb['transfereruniqueid']][_0x9133('0x6')],agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x4')]));agents[_0xf07fbb['transfereruniqueid']][_0x9133('0x3d')]=!![];agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x3e')]='blind';agents[_0xf07fbb[_0x9133('0x3a')]]['transferexten']=_0xf07fbb[_0x9133('0x3f')];agents[_0xf07fbb[_0x9133('0x3a')]][_0x9133('0x40')]=agents[_0xf07fbb[_0x9133('0x3a')]]['uniqueid'];}}catch(_0x4a346c){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x3b'),_0xf07fbb[_0x9133('0x4')]),_0x4a346c);}};exports[_0x9133('0x41')]=function(_0x565920){try{utils['debug'](util[_0x9133('0x2')](_0x9133('0x42'),_0x565920['origtransfereruniqueid']),_0x565920);if(_0x565920[_0x9133('0x43')]==_0x565920[_0x9133('0x44')]){if(!_['isNil'](agents[_0x565920['secondtransfereruniqueid']])){utils['info'](util[_0x9133('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x565920[_0x9133('0x43')],agents[_0x565920[_0x9133('0x45')]][_0x9133('0x6')]));agents[_0x565920[_0x9133('0x45')]]['transfer']=!![];agents[_0x565920[_0x9133('0x45')]]['transfertype']=_0x9133('0x46');agents[_0x565920[_0x9133('0x45')]][_0x9133('0x47')]=_0x565920[_0x9133('0x48')];agents[_0x565920[_0x9133('0x45')]][_0x9133('0x40')]=_0x565920['origtransfereruniqueid'];}if(_0x565920['transfereeuniqueid']&&agents[_0x565920['transfereeuniqueid']]){agents[_0x565920[_0x9133('0x49')]][_0x9133('0x4a')]=0x1;transfers[_0x565920[_0x9133('0x49')]]=_['clone'](agents[_0x565920[_0x9133('0x49')]]);transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x8')]=agents[_0x565920[_0x9133('0x45')]][_0x9133('0x8')];transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x4b')]=agents[_0x565920[_0x9133('0x45')]]['calleridname'];transfers[_0x565920[_0x9133('0x49')]]['agentcalledAt']=utils[_0x9133('0x18')]();transfers[_0x565920['transfereeuniqueid']][_0x9133('0x2f')]=utils[_0x9133('0x18')]();transfers[_0x565920['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x565920[_0x9133('0x49')]][_0x9133('0x4a')]=0x2;}}else if(_0x565920[_0x9133('0x45')]==_0x565920[_0x9133('0x4c')]){if(!_[_0x9133('0x1d')](agents[_0x565920[_0x9133('0x43')]])){utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x4d'),_0x565920[_0x9133('0x43')],agents[_0x565920[_0x9133('0x43')]]['membername']));agents[_0x565920[_0x9133('0x43')]]['transfer']=!![];agents[_0x565920[_0x9133('0x43')]][_0x9133('0x3e')]=_0x9133('0x46');agents[_0x565920[_0x9133('0x43')]][_0x9133('0x47')]=_0x565920['secondtransfererexten'];agents[_0x565920[_0x9133('0x43')]][_0x9133('0x40')]=_0x565920[_0x9133('0x45')];}if(_0x565920[_0x9133('0x4e')]&&agents[_0x565920['transfertargetuniqueid']]){agents[_0x565920[_0x9133('0x4e')]][_0x9133('0x4a')]=0x1;transfers[_0x565920[_0x9133('0x4e')]]=_[_0x9133('0x4f')](agents[_0x565920['transfertargetuniqueid']]);transfers[_0x565920['transfertargetuniqueid']][_0x9133('0x8')]=agents[_0x565920[_0x9133('0x43')]][_0x9133('0x8')];transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x4b')]=agents[_0x565920[_0x9133('0x43')]]['calleridname'];transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x17')]=utils[_0x9133('0x18')]();transfers[_0x565920[_0x9133('0x4e')]]['agentconnectAt']=utils[_0x9133('0x18')]();transfers[_0x565920['transfertargetuniqueid']][_0x9133('0x22')]=0x0;transfers[_0x565920[_0x9133('0x4e')]][_0x9133('0x4a')]=0x2;}}}catch(_0x39b46d){utils[_0x9133('0x2b')](util[_0x9133('0x2')](_0x9133('0x42'),_0x565920[_0x9133('0x43')]),_0x39b46d);}};exports['hangup']=function(_0x23bd83){try{utils[_0x9133('0x15')](util[_0x9133('0x2')](_0x9133('0x50'),_0x23bd83[_0x9133('0x4')]),_0x23bd83);if(agents[_0x23bd83['uniqueid']]&&agents[_0x23bd83['uniqueid']]['reason']===_0x9133('0x20')){if(_0x23bd83[_0x9133('0x51')]==='21'){agents[_0x23bd83[_0x9133('0x4')]]['reason']=_0x9133('0x52');agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x9')]=_0x9133('0x52');}utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x53'),_0x23bd83[_0x9133('0x4')],agents[_0x23bd83['uniqueid']][_0x9133('0x6')],agents[_0x23bd83[_0x9133('0x4')]]['reason'],agents[_0x23bd83[_0x9133('0x4')]]['lastevent']));writeDB(agents[_0x23bd83[_0x9133('0x4')]]);var _0x439352=unanswered[_0x9133('0x54')](_0x23bd83[_0x9133('0x4')]);if(_0x439352>-0x1){unanswered[_0x9133('0x55')](_0x439352,0x1);}}if(transfers[_0x23bd83['uniqueid']]){transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0xf')]=!![];transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x37')]=utils['now']();transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x23')]=utils[_0x9133('0x56')](transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x37')],transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x2f')]);transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')]=_0x9133('0x57');transfers[_0x23bd83[_0x9133('0x4')]]['lastevent']=_0x9133('0x38');utils[_0x9133('0x1')](util[_0x9133('0x2')](_0x9133('0x53'),_0x23bd83['uniqueid'],transfers[_0x23bd83[_0x9133('0x4')]]['membername'],transfers[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')],transfers[_0x23bd83[_0x9133('0x4')]]['lastevent']));writeDB(transfers[_0x23bd83[_0x9133('0x4')]],!![]);}if(agents[_0x23bd83[_0x9133('0x4')]]&&agents[_0x23bd83[_0x9133('0x4')]]['agentconnectAt']){agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0xf')]=!![];agents[_0x23bd83['uniqueid']][_0x9133('0x37')]=utils[_0x9133('0x18')]();agents[_0x23bd83[_0x9133('0x4')]]['talktime']=utils[_0x9133('0x56')](agents[_0x23bd83['uniqueid']][_0x9133('0x37')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x2f')]);agents[_0x23bd83['uniqueid']][_0x9133('0x21')]=agents[_0x23bd83['uniqueid']][_0x9133('0x3d')]?_0x9133('0x3d'):_0x9133('0x57');agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x9')]=_0x9133('0x38');utils[_0x9133('0x1')](util[_0x9133('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x23bd83[_0x9133('0x4')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x6')],agents[_0x23bd83[_0x9133('0x4')]][_0x9133('0x21')],agents[_0x23bd83['uniqueid']][_0x9133('0x9')]));writeDB(agents[_0x23bd83[_0x9133('0x4')]]);}}catch(_0x1b66d0){utils[_0x9133('0x2b')](util['format'](_0x9133('0x50'),_0x23bd83['uniqueid']),_0x1b66d0);}}; \ No newline at end of file +var _0x6cb4=['[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentcomplete','acw','agentacw','acwTimeout','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]','agentcompleteAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','transfer','blind','transferexten','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','transfertype','secondtransfererexten','transfertargetuniqueid','hangup','cause'];(function(_0xd7802a,_0x5bc757){var _0x3cb1c8=function(_0x212480){while(--_0x212480){_0xd7802a['push'](_0xd7802a['shift']());}};_0x3cb1c8(++_0x5bc757);}(_0x6cb4,0xff));var _0x46cb=function(_0x3374e1,_0x56a8d6){_0x3374e1=_0x3374e1-0x0;var _0x25c93e=_0x6cb4[_0x3374e1];return _0x25c93e;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var utils=require(_0x46cb('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x3403fc,_0x375bef){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x5'),_0x3403fc[_0x46cb('0x6')],_0x3403fc['channel'],_0x3403fc[_0x46cb('0x7')],_0x3403fc['membername'],_0x3403fc[_0x46cb('0x8')],_0x3403fc['calleridnum'],_0x3403fc[_0x46cb('0x9')],_0x3403fc[_0x46cb('0xa')]));if(_0x3403fc[_0x46cb('0x7')]){utils[_0x46cb('0xb')](_0x3403fc[_0x46cb('0x7')])[_0x46cb('0xc')](function(_0x56258a){if(_0x56258a){_0x3403fc[_0x46cb('0xd')]=_0x56258a[_0x46cb('0xd')];_0x3403fc['agentacw']=_0x3403fc[_0x46cb('0xe')]?_0x56258a[_0x46cb('0xf')]:![];_0x3403fc['acwtime']=_0x3403fc[_0x46cb('0x10')]?_0x56258a[_0x46cb('0x11')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x3403fc);});}else{utils['request'](_0x46cb('0x12'),_0x3403fc);}if(_0x375bef){delete transfers[_0x3403fc[_0x46cb('0x6')]];}else{delete agents[_0x3403fc[_0x46cb('0x13')]];}}exports[_0x46cb('0x14')]=function(_0x553440){try{utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x16'),_0x553440[_0x46cb('0x6')]),_0x553440);agents[_0x553440[_0x46cb('0x13')]]=_0x553440;agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0x17')]=utils[_0x46cb('0x18')]();agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0xa')]=_0x46cb('0x19');agents[_0x553440['destuniqueid']][_0x46cb('0x9')]=null;agents[_0x553440['destuniqueid']][_0x46cb('0x1a')]=null;utils['info'](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x553440[_0x46cb('0x6')],agents[_0x553440[_0x46cb('0x13')]][_0x46cb('0x1b')],_0x553440[_0x46cb('0x13')]));}catch(_0xbd488f){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x16'),_0x553440[_0x46cb('0x6')]),_0xbd488f);}};exports[_0x46cb('0x1d')]=function(_0x149483){try{if(!_[_0x46cb('0x1e')](agents[_0x149483[_0x46cb('0x13')]])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x1f'),_0x149483[_0x46cb('0x6')]),_0x149483);utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x20'),_0x149483[_0x46cb('0x6')],agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0x1b')],_0x149483[_0x46cb('0x13')]));agents[_0x149483[_0x46cb('0x13')]]['agentringnoanswer']=!![];agents[_0x149483['destuniqueid']][_0x46cb('0x21')]=utils[_0x46cb('0x18')]();agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0xa')]=_0x46cb('0x22');agents[_0x149483['destuniqueid']][_0x46cb('0x23')]='timeout';agents[_0x149483['destuniqueid']]['holdtime']=_0x149483[_0x46cb('0x24')]?parseInt(_0x149483[_0x46cb('0x24')])/0x3e8:0x0;agents[_0x149483[_0x46cb('0x13')]][_0x46cb('0x25')]=0x0;unanswered[_0x46cb('0x26')](_0x149483[_0x46cb('0x13')]);}}catch(_0x378dc7){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x1f'),_0x149483[_0x46cb('0x6')]),_0x378dc7);}};exports['queuecallerabandon']=function(_0x1ce88f){try{_[_0x46cb('0x27')](agents,function(_0x4c73bd,_0x49e0bc){if(_0x4c73bd[_0x46cb('0x6')]==_0x1ce88f['uniqueid']&&!_[_0x46cb('0x28')](unanswered,_0x4c73bd[_0x46cb('0x13')])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x29'),_0x1ce88f[_0x46cb('0x6')]),_0x1ce88f);utils['info'](util[_0x46cb('0x4')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x1ce88f[_0x46cb('0x6')],_0x4c73bd[_0x46cb('0x1b')],_0x4c73bd['destuniqueid']));_0x4c73bd[_0x46cb('0x1d')]=!![];_0x4c73bd[_0x46cb('0x21')]=utils[_0x46cb('0x18')]();_0x4c73bd[_0x46cb('0xa')]=_0x46cb('0x2a');_0x4c73bd['reason']=_0x46cb('0x2a');_0x4c73bd['holdtime']=_0x1ce88f[_0x46cb('0x2b')];_0x4c73bd[_0x46cb('0x25')]=0x0;writeDB(_0x4c73bd);}});}catch(_0x2630e0){utils['error'](util[_0x46cb('0x4')](_0x46cb('0x29'),_0x1ce88f['uniqueid']),_0x2630e0);}};exports[_0x46cb('0x2c')]=function(_0xf8be9){try{if(agents[_0xf8be9[_0x46cb('0x13')]]){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x2d'),_0xf8be9[_0x46cb('0x6')]),_0xf8be9);utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x2e'),_0xf8be9[_0x46cb('0x6')],agents[_0xf8be9['destuniqueid']]['membername'],_0xf8be9['destuniqueid']));agents[_0xf8be9[_0x46cb('0x13')]][_0x46cb('0x2f')]=utils[_0x46cb('0x18')]();agents[_0xf8be9[_0x46cb('0x13')]][_0x46cb('0x9')]=_0xf8be9[_0x46cb('0x9')];agents[_0xf8be9['destuniqueid']][_0x46cb('0x1a')]=_0xf8be9['connectedlinename'];agents[_0xf8be9['destuniqueid']][_0x46cb('0x2b')]=_0xf8be9['ringtime'];agents[_0xf8be9['destuniqueid']][_0x46cb('0xa')]='connect';_['forIn'](agents,function(_0x67bd14,_0x10017d){if(_0x67bd14[_0x46cb('0x13')]!=_0xf8be9[_0x46cb('0x13')]&&_0x67bd14[_0x46cb('0x6')]==_0xf8be9[_0x46cb('0x6')]){_0x67bd14[_0x46cb('0x25')]=0x0;_0x67bd14['holdtime']=_0xf8be9[_0x46cb('0x24')];_0x67bd14['agentringnoanswer']=!![];_0x67bd14[_0x46cb('0x21')]=utils['now']();_0x67bd14[_0x46cb('0xa')]=_0x46cb('0x30');_0x67bd14[_0x46cb('0x23')]='answered_elsewhere';_0x67bd14[_0x46cb('0x31')]=_0xf8be9[_0x46cb('0x13')];_0x67bd14['answeredelsewheremembername']=_0xf8be9[_0x46cb('0x1b')];writeDB(_0x67bd14);}});}}catch(_0x3d0b83){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x2d'),_0xf8be9['uniqueid']),_0x3d0b83);}};exports['agentcomplete']=function(_0x10bada){try{if(!_['isNil'](agents[_0x10bada[_0x46cb('0x13')]])){utils[_0x46cb('0x15')](util['format'](_0x46cb('0x32'),_0x10bada[_0x46cb('0x6')]),_0x10bada);utils[_0x46cb('0x3')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x10bada['uniqueid'],agents[_0x10bada['destuniqueid']][_0x46cb('0x1b')],_0x10bada[_0x46cb('0x13')]));agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0xe')]=!![];agents[_0x10bada[_0x46cb('0x13')]]['agentcompleteAt']=utils['now']();agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x25')]=utils['diffTime'](agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x33')],agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x2f')]);agents[_0x10bada[_0x46cb('0x13')]][_0x46cb('0x23')]=_0x10bada[_0x46cb('0x23')];agents[_0x10bada['destuniqueid']]['lastevent']=_0x46cb('0x34');writeDB(agents[_0x10bada['destuniqueid']]);}}catch(_0x2c4ecb){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')]('[%s][agents][agentcomplete]',_0x10bada[_0x46cb('0x6')]),_0x2c4ecb);}};exports['blindtransfer']=function(_0x5c02c9){try{if(!_[_0x46cb('0x1e')](agents[_0x5c02c9[_0x46cb('0x35')]])){utils[_0x46cb('0x15')](util[_0x46cb('0x4')](_0x46cb('0x36'),_0x5c02c9[_0x46cb('0x6')]),_0x5c02c9);utils[_0x46cb('0x3')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5c02c9[_0x46cb('0x6')],agents[_0x5c02c9[_0x46cb('0x35')]]['membername'],agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x6')]));agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x37')]=!![];agents[_0x5c02c9[_0x46cb('0x35')]]['transfertype']=_0x46cb('0x38');agents[_0x5c02c9[_0x46cb('0x35')]][_0x46cb('0x39')]=_0x5c02c9['extension'];agents[_0x5c02c9[_0x46cb('0x35')]]['transferuniqueid']=agents[_0x5c02c9['transfereruniqueid']][_0x46cb('0x6')];}}catch(_0x2cfe6f){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x36'),_0x5c02c9['uniqueid']),_0x2cfe6f);}};exports[_0x46cb('0x3a')]=function(_0xd51a75){try{utils['debug'](util['format'](_0x46cb('0x3b'),_0xd51a75[_0x46cb('0x3c')]),_0xd51a75);if(_0xd51a75[_0x46cb('0x3c')]==_0xd51a75['origtransfererlinkedid']){if(!_[_0x46cb('0x1e')](agents[_0xd51a75[_0x46cb('0x3d')]])){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x3e'),_0xd51a75[_0x46cb('0x3c')],agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x1b')]));agents[_0xd51a75[_0x46cb('0x3d')]]['transfer']=!![];agents[_0xd51a75[_0x46cb('0x3d')]]['transfertype']=_0x46cb('0x3f');agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x39')]=_0xd51a75[_0x46cb('0x40')];agents[_0xd51a75['secondtransfereruniqueid']][_0x46cb('0x41')]=_0xd51a75[_0x46cb('0x3c')];}if(_0xd51a75[_0x46cb('0x42')]&&agents[_0xd51a75[_0x46cb('0x42')]]){agents[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x43')]=0x1;transfers[_0xd51a75[_0x46cb('0x42')]]=_[_0x46cb('0x44')](agents[_0xd51a75['transfereeuniqueid']]);transfers[_0xd51a75['transfereeuniqueid']]['calleridnum']=agents[_0xd51a75['secondtransfereruniqueid']][_0x46cb('0x45')];transfers[_0xd51a75[_0x46cb('0x42')]]['calleridname']=agents[_0xd51a75[_0x46cb('0x3d')]][_0x46cb('0x46')];transfers[_0xd51a75[_0x46cb('0x42')]]['agentcalledAt']=utils['now']();transfers[_0xd51a75[_0x46cb('0x42')]]['agentconnectAt']=utils[_0x46cb('0x18')]();transfers[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x2b')]=0x0;transfers[_0xd51a75[_0x46cb('0x42')]][_0x46cb('0x43')]=0x2;}}else if(_0xd51a75[_0x46cb('0x3d')]==_0xd51a75[_0x46cb('0x47')]){if(!_[_0x46cb('0x1e')](agents[_0xd51a75[_0x46cb('0x3c')]])){utils[_0x46cb('0x3')](util[_0x46cb('0x4')](_0x46cb('0x3e'),_0xd51a75[_0x46cb('0x3c')],agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x1b')]));agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x37')]=!![];agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x48')]=_0x46cb('0x3f');agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x39')]=_0xd51a75[_0x46cb('0x49')];agents[_0xd51a75['origtransfereruniqueid']][_0x46cb('0x41')]=_0xd51a75[_0x46cb('0x3d')];}if(_0xd51a75[_0x46cb('0x4a')]&&agents[_0xd51a75[_0x46cb('0x4a')]]){agents[_0xd51a75['transfertargetuniqueid']][_0x46cb('0x43')]=0x1;transfers[_0xd51a75[_0x46cb('0x4a')]]=_[_0x46cb('0x44')](agents[_0xd51a75[_0x46cb('0x4a')]]);transfers[_0xd51a75[_0x46cb('0x4a')]]['calleridnum']=agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x45')];transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x46')]=agents[_0xd51a75[_0x46cb('0x3c')]][_0x46cb('0x46')];transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x17')]=utils['now']();transfers[_0xd51a75['transfertargetuniqueid']]['agentconnectAt']=utils[_0x46cb('0x18')]();transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x2b')]=0x0;transfers[_0xd51a75[_0x46cb('0x4a')]][_0x46cb('0x43')]=0x2;}}}catch(_0x1e3dca){utils[_0x46cb('0x1c')](util[_0x46cb('0x4')](_0x46cb('0x3b'),_0xd51a75[_0x46cb('0x3c')]),_0x1e3dca);}};exports[_0x46cb('0x4b')]=function(_0x199dc0){try{utils[_0x46cb('0x15')](util[_0x46cb('0x4')]('[%s][agents][hangup]',_0x199dc0[_0x46cb('0x6')]),_0x199dc0);if(agents[_0x199dc0['uniqueid']]&&agents[_0x199dc0[_0x46cb('0x6')]]['reason']===_0x46cb('0x22')){if(_0x199dc0[_0x46cb('0x4c')]==='21'){agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')]='rejected';agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]='rejected';}utils['info'](util[_0x46cb('0x4')](_0x46cb('0x4d'),_0x199dc0[_0x46cb('0x6')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x1b')],agents[_0x199dc0['uniqueid']]['reason'],agents[_0x199dc0['uniqueid']][_0x46cb('0xa')]));writeDB(agents[_0x199dc0[_0x46cb('0x6')]]);var _0x30b303=unanswered[_0x46cb('0x4e')](_0x199dc0[_0x46cb('0x6')]);if(_0x30b303>-0x1){unanswered[_0x46cb('0x4f')](_0x30b303,0x1);}}if(transfers[_0x199dc0[_0x46cb('0x6')]]){transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xe')]=!![];transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x33')]=utils['now']();transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x25')]=utils[_0x46cb('0x50')](transfers[_0x199dc0[_0x46cb('0x6')]]['agentcompleteAt'],transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x2f')]);transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')]='agent';transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]=_0x46cb('0x34');utils[_0x46cb('0x3')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x199dc0['uniqueid'],transfers[_0x199dc0[_0x46cb('0x6')]]['membername'],transfers[_0x199dc0[_0x46cb('0x6')]]['reason'],transfers[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]));writeDB(transfers[_0x199dc0[_0x46cb('0x6')]],!![]);}if(agents[_0x199dc0[_0x46cb('0x6')]]&&agents[_0x199dc0['uniqueid']][_0x46cb('0x2f')]){agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xe')]=!![];agents[_0x199dc0[_0x46cb('0x6')]]['agentcompleteAt']=utils['now']();agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x25')]=utils[_0x46cb('0x50')](agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x33')],agents[_0x199dc0[_0x46cb('0x6')]]['agentconnectAt']);agents[_0x199dc0['uniqueid']][_0x46cb('0x23')]=agents[_0x199dc0[_0x46cb('0x6')]]['transfer']?_0x46cb('0x37'):_0x46cb('0x51');agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]=_0x46cb('0x34');utils[_0x46cb('0x3')](util[_0x46cb('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x199dc0[_0x46cb('0x6')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x1b')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0x23')],agents[_0x199dc0[_0x46cb('0x6')]][_0x46cb('0xa')]));writeDB(agents[_0x199dc0[_0x46cb('0x6')]]);}}catch(_0x5567cc){utils['error'](util[_0x46cb('0x4')](_0x46cb('0x52'),_0x199dc0[_0x46cb('0x6')]),_0x5567cc);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 34654db..0c43a60 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 _0x855f=['toLowerCase','set','startsWith','cdr','split','lastIndexOf','includes','noop','gotoif','lastdata','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','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','newchannel','debug','[%s][calls][newchannel]','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','calleridnum','now','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','destinationchannel','answertime','disposition','toNumber','ANSWERED','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','type','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x855f,0x145));var _0xf855=function(_0x15aae7,_0x5e2e30){_0x15aae7=_0x15aae7-0x0;var _0x2a6b76=_0x855f[_0x15aae7];return _0x2a6b76;};'use strict';var _=require(_0xf855('0x0'));var util=require('util');var utils=require(_0xf855('0x1'));var transfers=require(_0xf855('0x2'));var dispositions=[_0xf855('0x3'),_0xf855('0x4'),_0xf855('0x4'),'NO\x20ANSWER',_0xf855('0x3'),_0xf855('0x3'),'ANSWERED','BUSY',_0xf855('0x4'),_0xf855('0x4'),_0xf855('0x4')];var channels={};function writeDB(_0x35cc05){var _0xe6470d;if(transfers[_0xf855('0x5')][_0x35cc05[_0xf855('0x6')]]){_0xe6470d=_0x35cc05['uniqueid'];_0x35cc05[_0xf855('0x6')]=transfers[_0xf855('0x5')][_0x35cc05[_0xf855('0x6')]][_0xf855('0x7')];}utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0xa'),_0x35cc05[_0xf855('0x6')],_0x35cc05['channel'],_0x35cc05[_0xf855('0xb')],_0x35cc05[_0xf855('0xc')],_0x35cc05[_0xf855('0xd')],_0x35cc05['calleridnum'],_0x35cc05[_0xf855('0xe')],_0x35cc05[_0xf855('0xf')]));if(_0x35cc05[_0xf855('0x10')]){utils[_0xf855('0x11')](_0x35cc05[_0xf855('0x10')])[_0xf855('0x12')](function(_0x5877b){if(_0x5877b){_0x35cc05['UserId']=_0x5877b['id'];}utils[_0xf855('0x13')](_0xf855('0x14'),_0x35cc05);});}else{utils[_0xf855('0x13')](_0xf855('0x14'),_0x35cc05);}if(channels[_0x35cc05[_0xf855('0x6')]]){delete channels[_0x35cc05[_0xf855('0x6')]];}else if(_0xe6470d&&channels[_0xe6470d]){if(!transfers[_0xf855('0x5')][_0xe6470d]['recording'])delete transfers['blinds'][_0xe6470d];delete channels[_0xe6470d];}}exports[_0xf855('0x15')]=function(_0xcd9d5f){try{utils[_0xf855('0x16')](util['format'](_0xf855('0x17'),_0xcd9d5f[_0xf855('0x6')]),_0xcd9d5f);if(_0xcd9d5f['uniqueid']==_0xcd9d5f['linkedid']&&_0xcd9d5f[_0xf855('0x18')]!=_0xf855('0x19')){utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x1a'),_0xcd9d5f[_0xf855('0x6')],_0xcd9d5f[_0xf855('0x1b')],_0xcd9d5f[_0xf855('0x1c')]));channels[_0xcd9d5f[_0xf855('0x6')]]={'uniqueid':_0xcd9d5f[_0xf855('0x6')],'accountcode':_0xcd9d5f[_0xf855('0x10')],'source':_0xcd9d5f[_0xf855('0x1d')],'destination':_0xcd9d5f[_0xf855('0x1c')],'destinationcontext':_0xcd9d5f['context'],'channel':_0xcd9d5f[_0xf855('0x18')],'starttime':utils[_0xf855('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf855('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x3b0973){utils['error'](util[_0xf855('0x9')](_0xf855('0x17'),_0xcd9d5f[_0xf855('0x6')]),_0x3b0973);}};exports['newstate']=function(_0x100d1e){try{utils[_0xf855('0x16')](util['format'](_0xf855('0x1f'),_0x100d1e[_0xf855('0x6')]),_0x100d1e);if(!_[_0xf855('0x20')](channels[_0x100d1e[_0xf855('0x6')]])&&_0x100d1e[_0xf855('0x21')]==0x6){utils['info'](util['format'](_0xf855('0x22'),_0x100d1e[_0xf855('0x6')],_0x100d1e['context'],_0x100d1e[_0xf855('0x18')]));if(_[_0xf855('0x20')](channels[_0x100d1e[_0xf855('0x6')]][_0xf855('0x23')])){channels[_0x100d1e[_0xf855('0x6')]][_0xf855('0x23')]=utils[_0xf855('0x1e')]();}}else if(!_[_0xf855('0x20')](channels[_0x100d1e[_0xf855('0x24')]])&&_0x100d1e[_0xf855('0x21')]==0x6&&_0x100d1e[_0xf855('0x1b')]!='transfer'){utils[_0xf855('0x8')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x100d1e['uniqueid'],_0x100d1e[_0xf855('0x24')],_0x100d1e[_0xf855('0x1b')],_0x100d1e[_0xf855('0x18')]));channels[_0x100d1e[_0xf855('0x24')]]['accountcode']=_0x100d1e[_0xf855('0x10')];channels[_0x100d1e[_0xf855('0x24')]][_0xf855('0x25')]=_0x100d1e[_0xf855('0x18')];if(_['isNil'](channels[_0x100d1e[_0xf855('0x24')]][_0xf855('0x26')])){channels[_0x100d1e[_0xf855('0x24')]][_0xf855('0x26')]=utils['now']();}channels[_0x100d1e['linkedid']][_0xf855('0x27')]=dispositions[_[_0xf855('0x28')](_0x100d1e['channelstate'])]||_0xf855('0x29');}}catch(_0x5ab5d6){utils[_0xf855('0x2a')](util[_0xf855('0x9')](_0xf855('0x1f'),_0x100d1e[_0xf855('0x6')]),_0x5ab5d6);}};exports[_0xf855('0x2b')]=function(_0x3f1afe){try{if(!_[_0xf855('0x20')](channels[_0x3f1afe[_0xf855('0x6')]])){utils[_0xf855('0x16')](util[_0xf855('0x9')](_0xf855('0x2c'),_0x3f1afe[_0xf855('0x6')]),_0x3f1afe);if(_[_0xf855('0x20')](channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x2d')])){channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x2d')]=_0x3f1afe[_0xf855('0x2e')]+'\x20<'+_0x3f1afe['calleridnum']+'>';}utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x2f'),_0x3f1afe['uniqueid'],channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x2d')],_0x3f1afe[_0xf855('0x30')]));channels[_0x3f1afe['uniqueid']][_0xf855('0x31')]=utils[_0xf855('0x1e')]();channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x32')]=utils[_0xf855('0x33')](channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x31')],channels[_0x3f1afe['uniqueid']][_0xf855('0x34')]);channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x35')]=channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x26')]?utils[_0xf855('0x33')](channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x31')],channels[_0x3f1afe[_0xf855('0x6')]][_0xf855('0x26')]):0x0;writeDB(channels[_0x3f1afe['uniqueid']]);}}catch(_0x402436){utils[_0xf855('0x2a')](util[_0xf855('0x9')](_0xf855('0x2c'),_0x3f1afe[_0xf855('0x6')]),_0x402436);}};exports[_0xf855('0x36')]=function(_0x13946c){try{if(!_['isNil'](channels[_0x13946c[_0xf855('0x37')]])){utils[_0xf855('0x16')](util[_0xf855('0x9')](_0xf855('0x38'),_0x13946c[_0xf855('0x39')]),_0x13946c);if(channels[_0x13946c['localtwolinkedid']][_0xf855('0x18')]==_0x13946c['transfereechannel']){utils['info'](util[_0xf855('0x9')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x13946c[_0xf855('0x39')],_0x13946c['localtwolinkedid'],_0x13946c[_0xf855('0x3a')]));channels[_0x13946c[_0xf855('0x37')]]['destinationchannel']=_0x13946c[_0xf855('0x3a')];channels[_0x13946c[_0xf855('0x37')]][_0xf855('0x3b')]=_0xf855('0x3c');}else if(channels[_0x13946c[_0xf855('0x37')]][_0xf855('0x18')]=_0x13946c[_0xf855('0x3d')]){utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x3e'),_0x13946c[_0xf855('0x39')],_0x13946c['localtwolinkedid'],_0x13946c[_0xf855('0x3f')]));channels[_0x13946c[_0xf855('0x37')]][_0xf855('0x25')]=_0x13946c[_0xf855('0x3f')];channels[_0x13946c[_0xf855('0x37')]]['userfield']=_0xf855('0x3c');}}}catch(_0x50ae67){utils[_0xf855('0x2a')](util[_0xf855('0x9')](_0xf855('0x38'),_0x13946c[_0xf855('0x39')]),_0x50ae67);}};exports[_0xf855('0x40')]=function(_0xa5d06b){try{if(!_[_0xf855('0x20')](channels[_0xa5d06b[_0xf855('0x6')]])){utils[_0xf855('0x16')](util[_0xf855('0x9')](_0xf855('0x41'),_0xa5d06b[_0xf855('0x6')]),_0xa5d06b);channels[_0xa5d06b[_0xf855('0x6')]]['musiconholdstartAt']=utils[_0xf855('0x1e')]();utils[_0xf855('0x8')](util['format'](_0xf855('0x42'),_0xa5d06b['uniqueid'],channels[_0xa5d06b[_0xf855('0x6')]]['musiconholdstartAt']));}}catch(_0x342377){utils[_0xf855('0x2a')](util[_0xf855('0x9')]('[%s][calls][musiconholdstart]',_0xa5d06b[_0xf855('0x6')]),_0x342377);}};exports['musiconholdstop']=function(_0x542a68){try{if(!_[_0xf855('0x20')](channels[_0x542a68[_0xf855('0x6')]])){utils['debug'](util[_0xf855('0x9')]('[%s][calls][musiconholdstop]',_0x542a68['uniqueid']),_0x542a68);if(!_[_0xf855('0x20')](channels[_0x542a68[_0xf855('0x6')]][_0xf855('0x43')])){channels[_0x542a68[_0xf855('0x6')]][_0xf855('0x44')]+=utils[_0xf855('0x33')](utils[_0xf855('0x1e')](),channels[_0x542a68[_0xf855('0x6')]][_0xf855('0x43')]);utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x45'),_0x542a68[_0xf855('0x6')],channels[_0x542a68['uniqueid']]['mohtime']));delete channels[_0x542a68[_0xf855('0x6')]][_0xf855('0x43')];}}}catch(_0x375c3f){utils[_0xf855('0x2a')](util[_0xf855('0x9')]('[%s][calls][musiconholdstop]',_0x542a68[_0xf855('0x6')]),_0x375c3f);}};exports[_0xf855('0x46')]=function(_0x5cf401){try{if(!_[_0xf855('0x20')](channels[_0x5cf401[_0xf855('0x6')]])){utils[_0xf855('0x16')](util[_0xf855('0x9')]('[%s][calls][varset]',_0x5cf401[_0xf855('0x6')]),_0x5cf401);if(!_[_0xf855('0x20')](_0x5cf401['variable'][_0xf855('0x47')])){utils[_0xf855('0x8')](util[_0xf855('0x9')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x49')]=_0x5cf401['value'];}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x4b')])){utils['info'](util[_0xf855('0x9')](_0xf855('0x4c'),_0x5cf401['uniqueid'],_0x5cf401['value']));channels[_0x5cf401['uniqueid']][_0xf855('0x4d')]=_0x5cf401[_0xf855('0x48')];channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x2d')]='\x22'+_0x5cf401[_0xf855('0x48')]+'\x22\x20<'+_0x5cf401[_0xf855('0x48')]+'>';}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x4e')])||!_['isNil'](_0x5cf401[_0xf855('0x4a')][_0xf855('0x4f')])){utils[_0xf855('0x8')](util[_0xf855('0x9')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x5cf401[_0xf855('0x6')],!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x4e')])?'xmd-callerid-preview':'xmd-callerid',_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x2d')]=_0x5cf401[_0xf855('0x48')];}if(!_[_0xf855('0x20')](_0x5cf401['variable']['xmd-queue'])||!_[_0xf855('0x20')](_0x5cf401['variable'][_0xf855('0x50')])){utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x51'),_0x5cf401[_0xf855('0x6')],!_['isNil'](_0x5cf401[_0xf855('0x4a')]['xmd-queue'])?_0xf855('0x52'):_0xf855('0x50'),_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x53')]=_0xf855('0x54');channels[_0x5cf401[_0xf855('0x6')]]['lastdata']=_0x5cf401[_0xf855('0x48')];channels[_0x5cf401['uniqueid']][_0xf855('0xb')]=!![];}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x55')])){utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x56'),_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401['uniqueid']]['ContactId']=_0x5cf401['value'];}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')]['xmd-cdrtype'])){utils[_0xf855('0x8')](util[_0xf855('0x9')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]][_0xf855('0x57')]=_0x5cf401[_0xf855('0x48')];}if(!_['isNil'](_0x5cf401[_0xf855('0x4a')]['outboundrouteid'])){utils[_0xf855('0x8')](util[_0xf855('0x9')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401['uniqueid']][_0xf855('0x58')]=_0x5cf401[_0xf855('0x48')];}if(!_[_0xf855('0x20')](_0x5cf401[_0xf855('0x4a')][_0xf855('0x59')])){utils[_0xf855('0x8')](util['format'](_0xf855('0x5a'),_0x5cf401[_0xf855('0x6')],_0x5cf401[_0xf855('0x48')]));channels[_0x5cf401[_0xf855('0x6')]]['sipcallid']=_0x5cf401[_0xf855('0x48')];}}}catch(_0x2c99a8){utils[_0xf855('0x2a')](util[_0xf855('0x9')](_0xf855('0x5b'),_0x5cf401['uniqueid']),_0x2c99a8);}};exports['newexten']=function(_0x1492d6){try{if(!_[_0xf855('0x20')](channels[_0x1492d6[_0xf855('0x6')]])){utils['debug'](util['format']('[%s][calls][newexten]',_0x1492d6[_0xf855('0x6')]),_0x1492d6);utils[_0xf855('0x8')](util[_0xf855('0x9')](_0xf855('0x5c'),_0x1492d6[_0xf855('0x6')],_0x1492d6[_0xf855('0x5d')],_0x1492d6[_0xf855('0x5e')]));if(_0x1492d6['application'][_0xf855('0x5f')]()==_0xf855('0x60')&&_[_0xf855('0x61')](_0x1492d6[_0xf855('0x5e')][_0xf855('0x5f')](),_0xf855('0x62'))){var _0x39b928=_0x1492d6['appdata'][_0xf855('0x63')]('=');var _0x24a6b6=_0x39b928[0x0]['substring'](_0x39b928[0x0][_0xf855('0x64')]('(')+0x1,_0x39b928[0x0][_0xf855('0x64')](')'));var _0xd18241=_0x39b928[0x1];channels[_0x1492d6[_0xf855('0x6')]][_0x24a6b6]=_0xd18241;}if(!_[_0xf855('0x65')]([_0xf855('0x2b'),_0xf855('0x66'),'execif',_0xf855('0x60'),_0xf855('0x67')],_0x1492d6[_0xf855('0x5d')][_0xf855('0x5f')]())){channels[_0x1492d6[_0xf855('0x6')]][_0xf855('0x53')]=_0x1492d6[_0xf855('0x5d')];channels[_0x1492d6[_0xf855('0x6')]][_0xf855('0x68')]=_0x1492d6[_0xf855('0x5e')];}}}catch(_0x311986){utils[_0xf855('0x2a')](util[_0xf855('0x9')]('[%s][calls][newexten]',_0x1492d6[_0xf855('0x6')]),_0x311986);}}; \ No newline at end of file +var _0x68fd=['[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','newexten','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','[%s][calls][newexten]','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','accountcode','then','UserId','request','CreateVoiceCallReport','recording','debug','format','[%s][calls][newchannel]','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','now','duration','diffTime','starttime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime'];(function(_0x21d2c6,_0x29b4f0){var _0xabb83e=function(_0x35f8b0){while(--_0x35f8b0){_0x21d2c6['push'](_0x21d2c6['shift']());}};_0xabb83e(++_0x29b4f0);}(_0x68fd,0x1e9));var _0xd68f=function(_0x113955,_0x5069c7){_0x113955=_0x113955-0x0;var _0x17c934=_0x68fd[_0x113955];return _0x17c934;};'use strict';var _=require(_0xd68f('0x0'));var util=require('util');var utils=require(_0xd68f('0x1'));var transfers=require(_0xd68f('0x2'));var dispositions=['NO\x20ANSWER',_0xd68f('0x3'),_0xd68f('0x3'),_0xd68f('0x4'),_0xd68f('0x4'),_0xd68f('0x4'),_0xd68f('0x5'),_0xd68f('0x6'),_0xd68f('0x3'),_0xd68f('0x3'),'FAILED'];var channels={};function writeDB(_0xb3cb35){var _0x182353;if(transfers[_0xd68f('0x7')][_0xb3cb35[_0xd68f('0x8')]]){_0x182353=_0xb3cb35[_0xd68f('0x8')];_0xb3cb35[_0xd68f('0x8')]=transfers[_0xd68f('0x7')][_0xb3cb35['uniqueid']]['transfereeuniqueid'];}utils[_0xd68f('0x9')](util['format'](_0xd68f('0xa'),_0xb3cb35[_0xd68f('0x8')],_0xb3cb35[_0xd68f('0xb')],_0xb3cb35[_0xd68f('0xc')],_0xb3cb35[_0xd68f('0xd')],_0xb3cb35[_0xd68f('0xe')],_0xb3cb35[_0xd68f('0xf')],_0xb3cb35['connectedlinenum'],_0xb3cb35['lastevent']));if(_0xb3cb35['accountcode']){utils['getUserByInternal'](_0xb3cb35[_0xd68f('0x10')])[_0xd68f('0x11')](function(_0x48f357){if(_0x48f357){_0xb3cb35[_0xd68f('0x12')]=_0x48f357['id'];}utils[_0xd68f('0x13')](_0xd68f('0x14'),_0xb3cb35);});}else{utils[_0xd68f('0x13')](_0xd68f('0x14'),_0xb3cb35);}if(channels[_0xb3cb35[_0xd68f('0x8')]]){delete channels[_0xb3cb35[_0xd68f('0x8')]];}else if(_0x182353&&channels[_0x182353]){if(!transfers['blinds'][_0x182353][_0xd68f('0x15')])delete transfers['blinds'][_0x182353];delete channels[_0x182353];}}exports['newchannel']=function(_0x8078d4){try{utils[_0xd68f('0x16')](util[_0xd68f('0x17')](_0xd68f('0x18'),_0x8078d4[_0xd68f('0x8')]),_0x8078d4);if(_0x8078d4[_0xd68f('0x8')]==_0x8078d4[_0xd68f('0x19')]&&_0x8078d4['channel']!='OutgoingSpoolFailed'){utils[_0xd68f('0x9')](util[_0xd68f('0x17')](_0xd68f('0x1a'),_0x8078d4[_0xd68f('0x8')],_0x8078d4[_0xd68f('0x1b')],_0x8078d4['exten']));channels[_0x8078d4[_0xd68f('0x8')]]={'uniqueid':_0x8078d4[_0xd68f('0x8')],'accountcode':_0x8078d4[_0xd68f('0x10')],'source':_0x8078d4['calleridnum'],'destination':_0x8078d4[_0xd68f('0x1c')],'destinationcontext':_0x8078d4[_0xd68f('0x1b')],'channel':_0x8078d4[_0xd68f('0xb')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xd68f('0x1d')};}}catch(_0x5a3683){utils['error'](util[_0xd68f('0x17')](_0xd68f('0x18'),_0x8078d4[_0xd68f('0x8')]),_0x5a3683);}};exports[_0xd68f('0x1e')]=function(_0x4595bf){try{utils[_0xd68f('0x16')](util[_0xd68f('0x17')](_0xd68f('0x1f'),_0x4595bf[_0xd68f('0x8')]),_0x4595bf);if(!_[_0xd68f('0x20')](channels[_0x4595bf[_0xd68f('0x8')]])&&_0x4595bf[_0xd68f('0x21')]==0x6){utils[_0xd68f('0x9')](util['format'](_0xd68f('0x22'),_0x4595bf[_0xd68f('0x8')],_0x4595bf['context'],_0x4595bf[_0xd68f('0xb')]));if(_['isNil'](channels[_0x4595bf['uniqueid']][_0xd68f('0x23')])){channels[_0x4595bf[_0xd68f('0x8')]][_0xd68f('0x23')]=utils['now']();}}else if(!_[_0xd68f('0x20')](channels[_0x4595bf['linkedid']])&&_0x4595bf[_0xd68f('0x21')]==0x6&&_0x4595bf['context']!=_0xd68f('0x24')){utils[_0xd68f('0x9')](util[_0xd68f('0x17')](_0xd68f('0x25'),_0x4595bf[_0xd68f('0x8')],_0x4595bf['linkedid'],_0x4595bf[_0xd68f('0x1b')],_0x4595bf['channel']));channels[_0x4595bf[_0xd68f('0x19')]]['accountcode']=_0x4595bf[_0xd68f('0x10')];channels[_0x4595bf[_0xd68f('0x19')]][_0xd68f('0x26')]=_0x4595bf[_0xd68f('0xb')];if(_['isNil'](channels[_0x4595bf[_0xd68f('0x19')]][_0xd68f('0x27')])){channels[_0x4595bf[_0xd68f('0x19')]][_0xd68f('0x27')]=utils['now']();}channels[_0x4595bf[_0xd68f('0x19')]][_0xd68f('0x28')]=dispositions[_[_0xd68f('0x29')](_0x4595bf[_0xd68f('0x21')])]||_0xd68f('0x5');}}catch(_0x2ac01b){utils[_0xd68f('0x2a')](util[_0xd68f('0x17')]('[%s][calls][newstate]',_0x4595bf[_0xd68f('0x8')]),_0x2ac01b);}};exports[_0xd68f('0x2b')]=function(_0x43e7e4){try{if(!_[_0xd68f('0x20')](channels[_0x43e7e4[_0xd68f('0x8')]])){utils[_0xd68f('0x16')](util[_0xd68f('0x17')](_0xd68f('0x2c'),_0x43e7e4['uniqueid']),_0x43e7e4);if(_[_0xd68f('0x20')](channels[_0x43e7e4[_0xd68f('0x8')]][_0xd68f('0x2d')])){channels[_0x43e7e4[_0xd68f('0x8')]][_0xd68f('0x2d')]=_0x43e7e4['calleridname']+'\x20<'+_0x43e7e4[_0xd68f('0xf')]+'>';}utils[_0xd68f('0x9')](util[_0xd68f('0x17')](_0xd68f('0x2e'),_0x43e7e4[_0xd68f('0x8')],channels[_0x43e7e4[_0xd68f('0x8')]][_0xd68f('0x2d')],_0x43e7e4[_0xd68f('0x2f')]));channels[_0x43e7e4['uniqueid']][_0xd68f('0x30')]=utils[_0xd68f('0x31')]();channels[_0x43e7e4[_0xd68f('0x8')]][_0xd68f('0x32')]=utils[_0xd68f('0x33')](channels[_0x43e7e4[_0xd68f('0x8')]]['endtime'],channels[_0x43e7e4[_0xd68f('0x8')]][_0xd68f('0x34')]);channels[_0x43e7e4[_0xd68f('0x8')]][_0xd68f('0x35')]=channels[_0x43e7e4[_0xd68f('0x8')]][_0xd68f('0x27')]?utils['diffTime'](channels[_0x43e7e4[_0xd68f('0x8')]][_0xd68f('0x30')],channels[_0x43e7e4['uniqueid']][_0xd68f('0x27')]):0x0;writeDB(channels[_0x43e7e4['uniqueid']]);}}catch(_0x5255f7){utils[_0xd68f('0x2a')](util[_0xd68f('0x17')]('[%s][calls][hangup]',_0x43e7e4[_0xd68f('0x8')]),_0x5255f7);}};exports[_0xd68f('0x36')]=function(_0x49a024){try{if(!_[_0xd68f('0x20')](channels[_0x49a024[_0xd68f('0x37')]])){utils[_0xd68f('0x16')](util[_0xd68f('0x17')]('[%s][calls][attendedtransfer]',_0x49a024['origtransfereruniqueid']),_0x49a024);if(channels[_0x49a024['localtwolinkedid']][_0xd68f('0xb')]==_0x49a024[_0xd68f('0x38')]){utils[_0xd68f('0x9')](util[_0xd68f('0x17')](_0xd68f('0x39'),_0x49a024[_0xd68f('0x3a')],_0x49a024[_0xd68f('0x37')],_0x49a024[_0xd68f('0x3b')]));channels[_0x49a024[_0xd68f('0x37')]][_0xd68f('0x26')]=_0x49a024[_0xd68f('0x3b')];channels[_0x49a024['localtwolinkedid']]['userfield']=_0xd68f('0x3c');}else if(channels[_0x49a024[_0xd68f('0x37')]][_0xd68f('0xb')]=_0x49a024[_0xd68f('0x3d')]){utils[_0xd68f('0x9')](util[_0xd68f('0x17')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x49a024[_0xd68f('0x3a')],_0x49a024[_0xd68f('0x37')],_0x49a024[_0xd68f('0x3e')]));channels[_0x49a024[_0xd68f('0x37')]][_0xd68f('0x26')]=_0x49a024[_0xd68f('0x3e')];channels[_0x49a024['localtwolinkedid']][_0xd68f('0x3f')]=_0xd68f('0x3c');}}}catch(_0x18d097){utils[_0xd68f('0x2a')](util[_0xd68f('0x17')](_0xd68f('0x40'),_0x49a024[_0xd68f('0x3a')]),_0x18d097);}};exports[_0xd68f('0x41')]=function(_0x3e98f7){try{if(!_['isNil'](channels[_0x3e98f7[_0xd68f('0x8')]])){utils[_0xd68f('0x16')](util[_0xd68f('0x17')]('[%s][calls][musiconholdstart]',_0x3e98f7[_0xd68f('0x8')]),_0x3e98f7);channels[_0x3e98f7[_0xd68f('0x8')]][_0xd68f('0x42')]=utils[_0xd68f('0x31')]();utils[_0xd68f('0x9')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3e98f7['uniqueid'],channels[_0x3e98f7[_0xd68f('0x8')]][_0xd68f('0x42')]));}}catch(_0x4e4cee){utils[_0xd68f('0x2a')](util[_0xd68f('0x17')](_0xd68f('0x43'),_0x3e98f7[_0xd68f('0x8')]),_0x4e4cee);}};exports[_0xd68f('0x44')]=function(_0x377a8e){try{if(!_[_0xd68f('0x20')](channels[_0x377a8e[_0xd68f('0x8')]])){utils[_0xd68f('0x16')](util['format'](_0xd68f('0x45'),_0x377a8e[_0xd68f('0x8')]),_0x377a8e);if(!_[_0xd68f('0x20')](channels[_0x377a8e[_0xd68f('0x8')]][_0xd68f('0x42')])){channels[_0x377a8e[_0xd68f('0x8')]][_0xd68f('0x46')]+=utils[_0xd68f('0x33')](utils[_0xd68f('0x31')](),channels[_0x377a8e[_0xd68f('0x8')]][_0xd68f('0x42')]);utils['info'](util['format'](_0xd68f('0x47'),_0x377a8e[_0xd68f('0x8')],channels[_0x377a8e[_0xd68f('0x8')]]['mohtime']));delete channels[_0x377a8e[_0xd68f('0x8')]]['musiconholdstartAt'];}}}catch(_0x2fc840){utils[_0xd68f('0x2a')](util[_0xd68f('0x17')](_0xd68f('0x45'),_0x377a8e[_0xd68f('0x8')]),_0x2fc840);}};exports[_0xd68f('0x48')]=function(_0x30dace){try{if(!_[_0xd68f('0x20')](channels[_0x30dace['uniqueid']])){utils[_0xd68f('0x16')](util[_0xd68f('0x17')](_0xd68f('0x49'),_0x30dace[_0xd68f('0x8')]),_0x30dace);if(!_[_0xd68f('0x20')](_0x30dace[_0xd68f('0x4a')][_0xd68f('0x4b')])){utils[_0xd68f('0x9')](util[_0xd68f('0x17')](_0xd68f('0x4c'),_0x30dace[_0xd68f('0x8')],_0x30dace[_0xd68f('0x4d')]));channels[_0x30dace['uniqueid']]['source']=_0x30dace['value'];}if(!_[_0xd68f('0x20')](_0x30dace['variable'][_0xd68f('0x4e')])){utils[_0xd68f('0x9')](util['format'](_0xd68f('0x4f'),_0x30dace['uniqueid'],_0x30dace[_0xd68f('0x4d')]));channels[_0x30dace[_0xd68f('0x8')]][_0xd68f('0x50')]=_0x30dace['value'];channels[_0x30dace[_0xd68f('0x8')]][_0xd68f('0x2d')]='\x22'+_0x30dace['value']+'\x22\x20<'+_0x30dace['value']+'>';}if(!_[_0xd68f('0x20')](_0x30dace['variable']['xmd-callerid-preview'])||!_[_0xd68f('0x20')](_0x30dace[_0xd68f('0x4a')][_0xd68f('0x51')])){utils[_0xd68f('0x9')](util[_0xd68f('0x17')](_0xd68f('0x52'),_0x30dace[_0xd68f('0x8')],!_[_0xd68f('0x20')](_0x30dace[_0xd68f('0x4a')]['xmd-callerid-preview'])?_0xd68f('0x53'):_0xd68f('0x51'),_0x30dace[_0xd68f('0x4d')]));channels[_0x30dace[_0xd68f('0x8')]][_0xd68f('0x2d')]=_0x30dace[_0xd68f('0x4d')];}if(!_[_0xd68f('0x20')](_0x30dace['variable'][_0xd68f('0x54')])||!_[_0xd68f('0x20')](_0x30dace[_0xd68f('0x4a')]['xmcs-queue'])){utils[_0xd68f('0x9')](util[_0xd68f('0x17')](_0xd68f('0x52'),_0x30dace[_0xd68f('0x8')],!_[_0xd68f('0x20')](_0x30dace[_0xd68f('0x4a')][_0xd68f('0x54')])?'xmd-queue':_0xd68f('0x55'),_0x30dace[_0xd68f('0x4d')]));channels[_0x30dace['uniqueid']][_0xd68f('0x56')]=_0xd68f('0x57');channels[_0x30dace[_0xd68f('0x8')]][_0xd68f('0x58')]=_0x30dace[_0xd68f('0x4d')];channels[_0x30dace[_0xd68f('0x8')]]['queue']=!![];}if(!_[_0xd68f('0x20')](_0x30dace[_0xd68f('0x4a')][_0xd68f('0x59')])){utils[_0xd68f('0x9')](util[_0xd68f('0x17')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x30dace['uniqueid'],_0x30dace[_0xd68f('0x4d')]));channels[_0x30dace[_0xd68f('0x8')]][_0xd68f('0x5a')]=_0x30dace[_0xd68f('0x4d')];}if(!_[_0xd68f('0x20')](_0x30dace[_0xd68f('0x4a')][_0xd68f('0x5b')])){utils[_0xd68f('0x9')](util['format'](_0xd68f('0x5c'),_0x30dace['uniqueid'],_0x30dace['value']));channels[_0x30dace[_0xd68f('0x8')]]['type']=_0x30dace[_0xd68f('0x4d')];}if(!_['isNil'](_0x30dace[_0xd68f('0x4a')][_0xd68f('0x5d')])){utils[_0xd68f('0x9')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x30dace[_0xd68f('0x8')],_0x30dace[_0xd68f('0x4d')]));channels[_0x30dace[_0xd68f('0x8')]][_0xd68f('0x5e')]=_0x30dace['value'];}if(!_[_0xd68f('0x20')](_0x30dace['variable']['sipcallid'])){utils['info'](util[_0xd68f('0x17')](_0xd68f('0x5f'),_0x30dace[_0xd68f('0x8')],_0x30dace['value']));channels[_0x30dace[_0xd68f('0x8')]][_0xd68f('0x60')]=_0x30dace[_0xd68f('0x4d')];}}}catch(_0x2ae162){utils[_0xd68f('0x2a')](util['format']('[%s][calls][varset]',_0x30dace['uniqueid']),_0x2ae162);}};exports[_0xd68f('0x61')]=function(_0x3500e0){try{if(!_[_0xd68f('0x20')](channels[_0x3500e0[_0xd68f('0x8')]])){utils[_0xd68f('0x16')](util[_0xd68f('0x17')]('[%s][calls][newexten]',_0x3500e0['uniqueid']),_0x3500e0);utils[_0xd68f('0x9')](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3500e0[_0xd68f('0x8')],_0x3500e0[_0xd68f('0x62')],_0x3500e0[_0xd68f('0x63')]));if(_0x3500e0[_0xd68f('0x62')][_0xd68f('0x64')]()=='set'&&_[_0xd68f('0x65')](_0x3500e0[_0xd68f('0x63')][_0xd68f('0x64')](),_0xd68f('0x66'))){var _0x3cda96=_0x3500e0[_0xd68f('0x63')][_0xd68f('0x67')]('=');var _0x27c9c0=_0x3cda96[0x0][_0xd68f('0x68')](_0x3cda96[0x0][_0xd68f('0x69')]('(')+0x1,_0x3cda96[0x0][_0xd68f('0x69')](')'));var _0x28ea32=_0x3cda96[0x1];channels[_0x3500e0[_0xd68f('0x8')]][_0x27c9c0]=_0x28ea32;}if(!_[_0xd68f('0x6a')]([_0xd68f('0x2b'),_0xd68f('0x6b'),_0xd68f('0x6c'),_0xd68f('0x6d'),_0xd68f('0x6e')],_0x3500e0[_0xd68f('0x62')]['toLowerCase']())){channels[_0x3500e0['uniqueid']][_0xd68f('0x56')]=_0x3500e0[_0xd68f('0x62')];channels[_0x3500e0[_0xd68f('0x8')]]['lastdata']=_0x3500e0[_0xd68f('0x63')];}}}catch(_0x5ca86b){utils['error'](util[_0xd68f('0x17')](_0xd68f('0x6f'),_0x3500e0[_0xd68f('0x8')]),_0x5ca86b);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e4eed8f..13c568e 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 _0xf2dd=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','connect','info','[core]\x20connected','fullybooted'];(function(_0x3fa04a,_0x1b5d83){var _0x3008bc=function(_0x36686b){while(--_0x36686b){_0x3fa04a['push'](_0x3fa04a['shift']());}};_0x3008bc(++_0x1b5d83);}(_0xf2dd,0x1aa));var _0xdf2d=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0xf2dd[_0x594e11];return _0x5418ad;};'use strict';var utils=require('./utils');exports[_0xdf2d('0x0')]=function(){utils[_0xdf2d('0x1')](_0xdf2d('0x2'));};exports['shutdown']=function(){utils[_0xdf2d('0x1')]('[core]\x20shutdown');};exports[_0xdf2d('0x3')]=function(){utils[_0xdf2d('0x1')](_0xdf2d('0x4'));};exports['error']=function(_0x171149){utils[_0xdf2d('0x5')](_0xdf2d('0x6'),_0x171149);};exports[_0xdf2d('0x7')]=function(){utils[_0xdf2d('0x1')](_0xdf2d('0x8'));};exports[_0xdf2d('0x9')]=function(_0x5b612d){}; \ No newline at end of file +var _0x24e0=['[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','close','[core]\x20close','managerevent','./utils','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x24e0,0xe8));var _0x024e=function(_0x559f97,_0x3d9d5d){_0x559f97=_0x559f97-0x0;var _0x5a7eb6=_0x24e0[_0x559f97];return _0x5a7eb6;};'use strict';var utils=require(_0x024e('0x0'));exports['connect']=function(){utils[_0x024e('0x1')](_0x024e('0x2'));};exports[_0x024e('0x3')]=function(){utils[_0x024e('0x1')](_0x024e('0x4'));};exports['fullybooted']=function(){utils[_0x024e('0x1')](_0x024e('0x5'));};exports['error']=function(_0x134563){utils['error']('[core]\x20error',_0x134563);};exports[_0x024e('0x6')]=function(){utils['info'](_0x024e('0x7'));};exports[_0x024e('0x8')]=function(_0x14d54a){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 47ff17f..2fae783 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 _0x2ee7=['[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','calleridname','cause-txt','duration','diffTime','endtime','starttime','holdtime','billableseconds','lodash','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport','debug','format','[%s][dials][newexten]','uniqueid','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','split','error','varset','[%s][dials][varset]','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','isNil','[%s][dials][dialbegin]','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','now'];(function(_0x1672fb,_0x2ec0db){var _0x31a6e6=function(_0x53585a){while(--_0x53585a){_0x1672fb['push'](_0x1672fb['shift']());}};_0x31a6e6(++_0x2ec0db);}(_0x2ee7,0x10c));var _0x72ee=function(_0x4e1280,_0x3b8e04){_0x4e1280=_0x4e1280-0x0;var _0x59c5f=_0x2ee7[_0x4e1280];return _0x59c5f;};'use strict';var _=require(_0x72ee('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x3aeeab){utils['info'](util['format'](_0x72ee('0x1'),_0x3aeeab['uniqueid'],_0x3aeeab[_0x72ee('0x2')],_0x3aeeab[_0x72ee('0x3')],_0x3aeeab[_0x72ee('0x4')],_0x3aeeab['connectedlinenum'],_0x3aeeab[_0x72ee('0x5')]));utils[_0x72ee('0x6')](_0x72ee('0x7'),_0x3aeeab);delete dials[_0x3aeeab['uniqueid']];}exports['newexten']=function(_0x588e0b){try{utils[_0x72ee('0x8')](util[_0x72ee('0x9')](_0x72ee('0xa'),_0x588e0b[_0x72ee('0xb')]),_0x588e0b);utils[_0x72ee('0xc')](util[_0x72ee('0x9')](_0x72ee('0xd'),_0x588e0b[_0x72ee('0xb')],_0x588e0b[_0x72ee('0xe')],_0x588e0b[_0x72ee('0xf')]));if(_0x588e0b[_0x72ee('0xe')]['toLowerCase']()=='set'&&_[_0x72ee('0x10')](_0x588e0b[_0x72ee('0xf')][_0x72ee('0x11')](),'cdr(routeid)')){var _0x5af812=_0x588e0b[_0x72ee('0xf')][_0x72ee('0x12')]('=');dials[_0x588e0b[_0x72ee('0xb')]]={'routeId':_0x5af812[0x1]};}}catch(_0x34a673){utils[_0x72ee('0x13')](util[_0x72ee('0x9')](_0x72ee('0xa'),_0x588e0b['uniqueid']),_0x34a673);}};exports[_0x72ee('0x14')]=function(_0x3c3142){try{utils[_0x72ee('0x8')](util[_0x72ee('0x9')](_0x72ee('0x15'),_0x3c3142['uniqueid']),_0x3c3142);if(!_['isNil'](_0x3c3142['variable']['outboundrouteid'])){utils[_0x72ee('0xc')](util[_0x72ee('0x9')](_0x72ee('0x16'),_0x3c3142[_0x72ee('0xb')],_0x3c3142['value']));dials[_0x3c3142[_0x72ee('0xb')]]={'routeId':_0x3c3142['value']};}}catch(_0x45fb8f){utils[_0x72ee('0x13')](util[_0x72ee('0x9')]('[%s][dials][varset]',_0x3c3142['uniqueid']),_0x45fb8f);}};exports['dialbegin']=function(_0x14d721){try{if(!_[_0x72ee('0x17')](dials[_0x14d721['uniqueid']])){utils['debug'](util[_0x72ee('0x9')](_0x72ee('0x18'),_0x14d721[_0x72ee('0xb')]),_0x14d721);dials[_0x14d721[_0x72ee('0xb')]]=_['assign'](dials[_0x14d721[_0x72ee('0xb')]],_0x14d721);dials[_0x14d721[_0x72ee('0xb')]]['starttime']=utils['now']();dials[_0x14d721[_0x72ee('0xb')]][_0x72ee('0x19')]='called';utils[_0x72ee('0xc')](util[_0x72ee('0x9')](_0x72ee('0x1a'),_0x14d721[_0x72ee('0xb')],dials[_0x14d721['uniqueid']]['starttime']));}}catch(_0x52246d){utils[_0x72ee('0x13')](util[_0x72ee('0x9')](_0x72ee('0x18'),_0x14d721[_0x72ee('0xb')]),_0x52246d);}};exports[_0x72ee('0x1b')]=function(_0x31666a){try{if(!_[_0x72ee('0x17')](dials[_0x31666a[_0x72ee('0xb')]])){utils[_0x72ee('0x8')](util[_0x72ee('0x9')](_0x72ee('0x1c'),_0x31666a[_0x72ee('0xb')]),_0x31666a);dials[_0x31666a[_0x72ee('0xb')]]['dialstatus']=_0x31666a[_0x72ee('0x5')];if(_0x31666a[_0x72ee('0x5')]==_0x72ee('0x1d')){dials[_0x31666a[_0x72ee('0xb')]]=_[_0x72ee('0x1e')](dials[_0x31666a[_0x72ee('0xb')]],_0x31666a);dials[_0x31666a['uniqueid']][_0x72ee('0x1f')]=utils[_0x72ee('0x20')]();dials[_0x31666a[_0x72ee('0xb')]][_0x72ee('0x19')]='connect';utils['info'](util['format']('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x31666a[_0x72ee('0xb')],_0x31666a[_0x72ee('0x5')],dials[_0x31666a[_0x72ee('0xb')]][_0x72ee('0x1f')]));}else{utils['info'](util[_0x72ee('0x9')](_0x72ee('0x21'),_0x31666a[_0x72ee('0xb')],_0x31666a[_0x72ee('0x5')]));}}}catch(_0x12c3bd){utils[_0x72ee('0x13')](util[_0x72ee('0x9')]('[%s][dials][dialend]',_0x31666a[_0x72ee('0xb')]),_0x12c3bd);}};exports['hangup']=function(_0x79848f){try{if(!_[_0x72ee('0x17')](dials[_0x79848f[_0x72ee('0xb')]])){utils[_0x72ee('0x8')](util[_0x72ee('0x9')](_0x72ee('0x22'),_0x79848f['uniqueid']),_0x79848f);utils[_0x72ee('0xc')](util[_0x72ee('0x9')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x79848f['uniqueid'],_0x79848f[_0x72ee('0x4')],_0x79848f[_0x72ee('0x23')],_0x79848f[_0x72ee('0x24')]));dials[_0x79848f[_0x72ee('0xb')]]=_[_0x72ee('0x1e')](dials[_0x79848f['uniqueid']],{'endtime':utils[_0x72ee('0x20')](),'lastevent':'complete'});dials[_0x79848f[_0x72ee('0xb')]][_0x72ee('0x25')]=utils[_0x72ee('0x26')](dials[_0x79848f[_0x72ee('0xb')]][_0x72ee('0x27')],dials[_0x79848f['uniqueid']][_0x72ee('0x28')]);dials[_0x79848f[_0x72ee('0xb')]][_0x72ee('0x29')]=utils['diffTime'](dials[_0x79848f['uniqueid']][_0x72ee('0x1f')]||dials[_0x79848f['uniqueid']][_0x72ee('0x27')],dials[_0x79848f['uniqueid']][_0x72ee('0x28')]);dials[_0x79848f[_0x72ee('0xb')]][_0x72ee('0x2a')]=dials[_0x79848f[_0x72ee('0xb')]]['answertime']?utils['diffTime'](dials[_0x79848f['uniqueid']][_0x72ee('0x27')],dials[_0x79848f[_0x72ee('0xb')]]['answertime']):0x0;writeDB(dials[_0x79848f[_0x72ee('0xb')]]);}}catch(_0x36afd3){utils[_0x72ee('0x13')](util[_0x72ee('0x9')]('[%s][dials][hangup]',_0x79848f[_0x72ee('0xb')]),_0x36afd3);}}; \ No newline at end of file +var _0xa3d5=['starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','isNil','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]','cause-txt','now','complete','duration','holdtime','diffTime','endtime','billableseconds','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','application','appdata','toLowerCase','cdr(routeid)','split','format','varset','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','[%s][dials][dialbegin]','assign'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa3d5,0x19b));var _0x5a3d=function(_0x1a3e23,_0xce45e){_0x1a3e23=_0x1a3e23-0x0;var _0x5ee0d8=_0xa3d5[_0x1a3e23];return _0x5ee0d8;};'use strict';var _=require(_0x5a3d('0x0'));var util=require(_0x5a3d('0x1'));var utils=require(_0x5a3d('0x2'));var dials={};function writeDB(_0x2732b9){utils[_0x5a3d('0x3')](util['format'](_0x5a3d('0x4'),_0x2732b9[_0x5a3d('0x5')],_0x2732b9[_0x5a3d('0x6')],_0x2732b9[_0x5a3d('0x7')],_0x2732b9[_0x5a3d('0x8')],_0x2732b9[_0x5a3d('0x9')],_0x2732b9[_0x5a3d('0xa')]));utils[_0x5a3d('0xb')](_0x5a3d('0xc'),_0x2732b9);delete dials[_0x2732b9['uniqueid']];}exports['newexten']=function(_0x45bc03){try{utils[_0x5a3d('0xd')](util['format'](_0x5a3d('0xe'),_0x45bc03[_0x5a3d('0x5')]),_0x45bc03);utils[_0x5a3d('0x3')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x45bc03['uniqueid'],_0x45bc03[_0x5a3d('0xf')],_0x45bc03[_0x5a3d('0x10')]));if(_0x45bc03['application'][_0x5a3d('0x11')]()=='set'&&_['startsWith'](_0x45bc03['appdata'][_0x5a3d('0x11')](),_0x5a3d('0x12'))){var _0x5ce7e8=_0x45bc03[_0x5a3d('0x10')][_0x5a3d('0x13')]('=');dials[_0x45bc03['uniqueid']]={'routeId':_0x5ce7e8[0x1]};}}catch(_0x1a8da3){utils['error'](util[_0x5a3d('0x14')](_0x5a3d('0xe'),_0x45bc03[_0x5a3d('0x5')]),_0x1a8da3);}};exports[_0x5a3d('0x15')]=function(_0x20557a){try{utils[_0x5a3d('0xd')](util[_0x5a3d('0x14')]('[%s][dials][varset]',_0x20557a[_0x5a3d('0x5')]),_0x20557a);if(!_['isNil'](_0x20557a[_0x5a3d('0x16')][_0x5a3d('0x17')])){utils[_0x5a3d('0x3')](util[_0x5a3d('0x14')](_0x5a3d('0x18'),_0x20557a[_0x5a3d('0x5')],_0x20557a[_0x5a3d('0x19')]));dials[_0x20557a[_0x5a3d('0x5')]]={'routeId':_0x20557a[_0x5a3d('0x19')]};}}catch(_0x1b3ed8){utils[_0x5a3d('0x1a')](util[_0x5a3d('0x14')](_0x5a3d('0x1b'),_0x20557a[_0x5a3d('0x5')]),_0x1b3ed8);}};exports['dialbegin']=function(_0x2f813d){try{if(!_['isNil'](dials[_0x2f813d[_0x5a3d('0x5')]])){utils[_0x5a3d('0xd')](util[_0x5a3d('0x14')](_0x5a3d('0x1c'),_0x2f813d[_0x5a3d('0x5')]),_0x2f813d);dials[_0x2f813d[_0x5a3d('0x5')]]=_[_0x5a3d('0x1d')](dials[_0x2f813d[_0x5a3d('0x5')]],_0x2f813d);dials[_0x2f813d[_0x5a3d('0x5')]][_0x5a3d('0x1e')]=utils['now']();dials[_0x2f813d[_0x5a3d('0x5')]][_0x5a3d('0x1f')]=_0x5a3d('0x20');utils['info'](util[_0x5a3d('0x14')](_0x5a3d('0x21'),_0x2f813d['uniqueid'],dials[_0x2f813d[_0x5a3d('0x5')]][_0x5a3d('0x1e')]));}}catch(_0x47b7d7){utils[_0x5a3d('0x1a')](util[_0x5a3d('0x14')](_0x5a3d('0x1c'),_0x2f813d['uniqueid']),_0x47b7d7);}};exports[_0x5a3d('0x22')]=function(_0x2cb330){try{if(!_[_0x5a3d('0x23')](dials[_0x2cb330[_0x5a3d('0x5')]])){utils['debug'](util[_0x5a3d('0x14')]('[%s][dials][dialend]',_0x2cb330[_0x5a3d('0x5')]),_0x2cb330);dials[_0x2cb330[_0x5a3d('0x5')]][_0x5a3d('0xa')]=_0x2cb330[_0x5a3d('0xa')];if(_0x2cb330[_0x5a3d('0xa')]=='ANSWER'){dials[_0x2cb330['uniqueid']]=_[_0x5a3d('0x1d')](dials[_0x2cb330['uniqueid']],_0x2cb330);dials[_0x2cb330[_0x5a3d('0x5')]]['answertime']=utils['now']();dials[_0x2cb330['uniqueid']][_0x5a3d('0x1f')]=_0x5a3d('0x24');utils['info'](util[_0x5a3d('0x14')](_0x5a3d('0x25'),_0x2cb330[_0x5a3d('0x5')],_0x2cb330[_0x5a3d('0xa')],dials[_0x2cb330[_0x5a3d('0x5')]][_0x5a3d('0x26')]));}else{utils['info'](util[_0x5a3d('0x14')](_0x5a3d('0x27'),_0x2cb330[_0x5a3d('0x5')],_0x2cb330[_0x5a3d('0xa')]));}}}catch(_0x3acc7c){utils[_0x5a3d('0x1a')](util[_0x5a3d('0x14')](_0x5a3d('0x28'),_0x2cb330[_0x5a3d('0x5')]),_0x3acc7c);}};exports['hangup']=function(_0x323609){try{if(!_['isNil'](dials[_0x323609[_0x5a3d('0x5')]])){utils[_0x5a3d('0xd')](util[_0x5a3d('0x14')]('[%s][dials][hangup]',_0x323609[_0x5a3d('0x5')]),_0x323609);utils[_0x5a3d('0x3')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x323609[_0x5a3d('0x5')],_0x323609['calleridnum'],_0x323609['calleridname'],_0x323609[_0x5a3d('0x29')]));dials[_0x323609[_0x5a3d('0x5')]]=_[_0x5a3d('0x1d')](dials[_0x323609[_0x5a3d('0x5')]],{'endtime':utils[_0x5a3d('0x2a')](),'lastevent':_0x5a3d('0x2b')});dials[_0x323609[_0x5a3d('0x5')]][_0x5a3d('0x2c')]=utils['diffTime'](dials[_0x323609[_0x5a3d('0x5')]]['endtime'],dials[_0x323609[_0x5a3d('0x5')]][_0x5a3d('0x1e')]);dials[_0x323609['uniqueid']][_0x5a3d('0x2d')]=utils[_0x5a3d('0x2e')](dials[_0x323609['uniqueid']][_0x5a3d('0x26')]||dials[_0x323609[_0x5a3d('0x5')]][_0x5a3d('0x2f')],dials[_0x323609[_0x5a3d('0x5')]]['starttime']);dials[_0x323609[_0x5a3d('0x5')]][_0x5a3d('0x30')]=dials[_0x323609['uniqueid']][_0x5a3d('0x26')]?utils['diffTime'](dials[_0x323609['uniqueid']][_0x5a3d('0x2f')],dials[_0x323609[_0x5a3d('0x5')]][_0x5a3d('0x26')]):0x0;writeDB(dials[_0x323609['uniqueid']]);}}catch(_0x79fe4b){utils[_0x5a3d('0x1a')](util['format']('[%s][dials][hangup]',_0x323609[_0x5a3d('0x5')]),_0x79fe4b);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0ce2d6b..26ee3f4 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 _0xcbd9=['connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','disabled','env','production','xdr','local','asterisk','port','info','XDR\x20DISABLED','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller'];(function(_0x47f979,_0x4945fc){var _0x4d09d6=function(_0x323161){while(--_0x323161){_0x47f979['push'](_0x47f979['shift']());}};_0x4d09d6(++_0x4945fc);}(_0xcbd9,0x13a));var _0x9cbd=function(_0x5abd08,_0x198424){_0x5abd08=_0x5abd08-0x0;var _0x3c1dcd=_0xcbd9[_0x5abd08];return _0x3c1dcd;};var AsteriskManager=require(_0x9cbd('0x0'));var config=require('../../config/environment');var utils=require(_0x9cbd('0x1'));var util=require('util');var isXDREnabled=config['xdr']&&config['xdr'][_0x9cbd('0x2')]?!config['xdr']['disabled']:!![];var isProduction=config[_0x9cbd('0x3')]===_0x9cbd('0x4')||![];var isLocalAsterisk=config['xdr']&&config[_0x9cbd('0x5')][_0x9cbd('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x9cbd('0x7')][_0x9cbd('0x8')],config[_0x9cbd('0x7')]['ip'],config[_0x9cbd('0x7')]['username'],config[_0x9cbd('0x7')]['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x9cbd('0x9')](_0x9cbd('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x9cbd('0x9')]('Asterisk\x20disabled\x20on\x20localhost');}else{var agents=require('./agents.controller');var calls=require(_0x9cbd('0xb'));var queues=require('./queues.controller');var recordings=require(_0x9cbd('0xc'));var members=require(_0x9cbd('0xd'));var dials=require(_0x9cbd('0xe'));var transfers=require(_0x9cbd('0xf'));var core=require('./core.controller');ami['on']('connect',core[_0x9cbd('0x10')]);ami['on'](_0x9cbd('0x11'),core[_0x9cbd('0x11')]);ami['on'](_0x9cbd('0x12'),core[_0x9cbd('0x12')]);ami['on'](_0x9cbd('0x13'),core[_0x9cbd('0x13')]);ami['on']('close',core[_0x9cbd('0x14')]);ami['on'](_0x9cbd('0x15'),core[_0x9cbd('0x15')]);ami['on'](_0x9cbd('0x16'),function(_0x905f2f){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x19'),_0x905f2f['device']),_0x905f2f);members[_0x9cbd('0x16')](_0x905f2f);}catch(_0x20ffcb){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x19'),_0x905f2f[_0x9cbd('0x1a')]),_0x20ffcb);}});ami['on'](_0x9cbd('0x1b'),function(_0x306c50){try{utils['debug'](util[_0x9cbd('0x18')]('[%s][index][agentcalled]',_0x306c50[_0x9cbd('0x1c')]),_0x306c50);agents[_0x9cbd('0x1b')](_0x306c50);}catch(_0xfc4ae1){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')]('[%s][index][agentcalled]',_0x306c50[_0x9cbd('0x1c')]),_0xfc4ae1);}});ami['on'](_0x9cbd('0x1d'),function(_0x3d88da){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x1e'),_0x3d88da[_0x9cbd('0x1c')]),_0x3d88da);agents[_0x9cbd('0x1d')](_0x3d88da);}catch(_0x5bf116){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')]('[%s][index][agentringnoanswer]',_0x3d88da[_0x9cbd('0x1c')]),_0x5bf116);}});ami['on'](_0x9cbd('0x1f'),function(_0x1aec3b){try{utils[_0x9cbd('0x17')](util['format'](_0x9cbd('0x20'),_0x1aec3b[_0x9cbd('0x1c')]),_0x1aec3b);agents[_0x9cbd('0x1f')](_0x1aec3b);queues['agentconnect'](_0x1aec3b);}catch(_0x4c2259){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x20'),_0x1aec3b[_0x9cbd('0x1c')]),_0x4c2259);}});ami['on'](_0x9cbd('0x21'),function(_0x18f984){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x22'),_0x18f984[_0x9cbd('0x1c')]),_0x18f984);agents[_0x9cbd('0x21')](_0x18f984);queues[_0x9cbd('0x21')](_0x18f984);members[_0x9cbd('0x21')](_0x18f984);}catch(_0x1a48ae){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')]('[%s][index][agentcomplete]',_0x18f984[_0x9cbd('0x1c')]),_0x1a48ae);}});ami['on'](_0x9cbd('0x23'),function(_0x2b753d){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x24'),_0x2b753d[_0x9cbd('0x1c')]),_0x2b753d);agents[_0x9cbd('0x23')](_0x2b753d);queues[_0x9cbd('0x23')](_0x2b753d);}catch(_0xeb10af){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x24'),_0x2b753d['uniqueid']),_0xeb10af);}});ami['on']('queuecallerjoin',function(_0x1f25eb){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x25'),_0x1f25eb[_0x9cbd('0x1c')]),_0x1f25eb);queues[_0x9cbd('0x26')](_0x1f25eb);recordings['queuecallerjoin'](_0x1f25eb);}catch(_0x496109){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x25'),_0x1f25eb[_0x9cbd('0x1c')]),_0x496109);}});ami['on'](_0x9cbd('0x27'),function(_0x541f65){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')]('[%s][index][queuecallerleave]',_0x541f65['uniqueid']),_0x541f65);queues[_0x9cbd('0x27')](_0x541f65);}catch(_0x13aae0){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x28'),_0x541f65[_0x9cbd('0x1c')]),_0x13aae0);}});ami['on'](_0x9cbd('0x29'),function(_0x4ca122){try{utils['debug'](util[_0x9cbd('0x18')]('[%s][index][musiconholdstart]',_0x4ca122[_0x9cbd('0x1c')]),_0x4ca122);queues[_0x9cbd('0x29')](_0x4ca122);calls[_0x9cbd('0x29')](_0x4ca122);}catch(_0x464bdd){utils[_0x9cbd('0x13')](util['format']('[%s][index][musiconholdstart]',_0x4ca122['uniqueid']),_0x464bdd);}});ami['on']('musiconholdstop',function(_0x59ace8){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x2a'),_0x59ace8[_0x9cbd('0x1c')]),_0x59ace8);queues[_0x9cbd('0x2b')](_0x59ace8);calls[_0x9cbd('0x2b')](_0x59ace8);}catch(_0x2e26e6){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x2a'),_0x59ace8['uniqueid']),_0x2e26e6);}});ami['on'](_0x9cbd('0x2c'),function(_0x4ce739){try{utils['debug'](util[_0x9cbd('0x18')](_0x9cbd('0x2d'),_0x4ce739[_0x9cbd('0x1c')]),_0x4ce739);calls['newstate'](_0x4ce739);recordings['newstate'](_0x4ce739);}catch(_0x5476b6){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x2d'),_0x4ce739[_0x9cbd('0x1c')]),_0x5476b6);}});ami['on']('hangup',function(_0x227f93){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')]('[%s][index][hangup]',_0x227f93[_0x9cbd('0x1c')]),_0x227f93);calls['hangup'](_0x227f93);recordings[_0x9cbd('0x2e')](_0x227f93);dials['hangup'](_0x227f93);agents[_0x9cbd('0x2e')](_0x227f93);queues['hangup'](_0x227f93);}catch(_0x1a550b){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x2f'),_0x227f93['uniqueid']),_0x1a550b);}});ami['on'](_0x9cbd('0x30'),function(_0x1da2ee){try{utils['debug'](util['format'](_0x9cbd('0x31'),_0x1da2ee[_0x9cbd('0x1c')]),_0x1da2ee);members['cdr'](_0x1da2ee);}catch(_0x41abdd){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x31'),_0x1da2ee[_0x9cbd('0x1c')]),_0x41abdd);}});ami['on'](_0x9cbd('0x32'),function(_0x35f31a){try{utils['debug'](util[_0x9cbd('0x18')]('[%s][index][blindtransfer]',_0x35f31a[_0x9cbd('0x1c')]),_0x35f31a);queues[_0x9cbd('0x32')](_0x35f31a);agents[_0x9cbd('0x32')](_0x35f31a);transfers[_0x9cbd('0x32')](_0x35f31a);recordings['blindtransfer'](_0x35f31a);}catch(_0x96389e){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x33'),_0x35f31a[_0x9cbd('0x1c')]),_0x96389e);}});ami['on'](_0x9cbd('0x34'),function(_0x97dfe9){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x35'),_0x97dfe9[_0x9cbd('0x36')]),_0x97dfe9);queues[_0x9cbd('0x34')](_0x97dfe9);transfers[_0x9cbd('0x34')](_0x97dfe9);agents[_0x9cbd('0x34')](_0x97dfe9);calls['attendedtransfer'](_0x97dfe9);}catch(_0x18f368){utils['error'](util[_0x9cbd('0x18')](_0x9cbd('0x35'),_0x97dfe9[_0x9cbd('0x36')]),_0x18f368);}});ami['on'](_0x9cbd('0x37'),function(_0x502650){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x38'),_0x502650[_0x9cbd('0x1c')]),_0x502650);queues[_0x9cbd('0x37')](_0x502650);recordings['varset'](_0x502650);calls[_0x9cbd('0x37')](_0x502650);dials[_0x9cbd('0x37')](_0x502650);}catch(_0x6970e2){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x38'),_0x502650[_0x9cbd('0x1c')]),_0x6970e2);}});ami['on'](_0x9cbd('0x39'),function(_0x219e83){try{utils[_0x9cbd('0x17')](util['format'](_0x9cbd('0x3a'),_0x219e83[_0x9cbd('0x1c')]),_0x219e83);calls[_0x9cbd('0x39')](_0x219e83);recordings[_0x9cbd('0x39')](_0x219e83);dials[_0x9cbd('0x39')](_0x219e83);}catch(_0x3c6def){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x3a'),_0x219e83[_0x9cbd('0x1c')]),_0x3c6def);}});ami['on'](_0x9cbd('0x3b'),function(_0x2a4c83){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x3c'),_0x2a4c83[_0x9cbd('0x1c')]),_0x2a4c83);calls[_0x9cbd('0x3b')](_0x2a4c83);recordings['newchannel'](_0x2a4c83);}catch(_0x595be6){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')]('[%s][index][newchannel]',_0x2a4c83[_0x9cbd('0x1c')]),_0x595be6);}});ami['on'](_0x9cbd('0x3d'),function(_0xb28067){try{utils[_0x9cbd('0x17')](util[_0x9cbd('0x18')](_0x9cbd('0x3e'),_0xb28067[_0x9cbd('0x1c')]),_0xb28067);dials['dialbegin'](_0xb28067);}catch(_0x25cfcb){utils[_0x9cbd('0x13')](util[_0x9cbd('0x18')](_0x9cbd('0x3f'),_0xb28067[_0x9cbd('0x1c')]),_0x25cfcb);}});ami['on'](_0x9cbd('0x40'),function(_0x4f3e78){try{utils[_0x9cbd('0x17')](util['format'](_0x9cbd('0x41'),_0x4f3e78[_0x9cbd('0x1c')]),_0x4f3e78);dials[_0x9cbd('0x40')](_0x4f3e78);}catch(_0x525392){utils['error'](util['format'](_0x9cbd('0x41'),_0x4f3e78[_0x9cbd('0x1c')]),_0x525392);}});} \ No newline at end of file +var _0x98ed=['uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','xdr','disabled','env','production','local','asterisk','port','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]'];(function(_0x57da63,_0x2d900f){var _0x360ecf=function(_0x3de9c8){while(--_0x3de9c8){_0x57da63['push'](_0x57da63['shift']());}};_0x360ecf(++_0x2d900f);}(_0x98ed,0x185));var _0xd98e=function(_0xb1b481,_0x337b26){_0xb1b481=_0xb1b481-0x0;var _0x2433d2=_0x98ed[_0xb1b481];return _0x2433d2;};var AsteriskManager=require(_0xd98e('0x0'));var config=require(_0xd98e('0x1'));var utils=require('./utils');var util=require('util');var isXDREnabled=config[_0xd98e('0x2')]&&config[_0xd98e('0x2')]['disabled']?!config[_0xd98e('0x2')][_0xd98e('0x3')]:!![];var isProduction=config[_0xd98e('0x4')]===_0xd98e('0x5')||![];var isLocalAsterisk=config['xdr']&&config['xdr'][_0xd98e('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xd98e('0x7')][_0xd98e('0x8')],config[_0xd98e('0x7')]['ip'],config[_0xd98e('0x7')]['username'],config['asterisk']['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xd98e('0x9')](_0xd98e('0xa'));}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xd98e('0xb'));}else{var agents=require(_0xd98e('0xc'));var calls=require(_0xd98e('0xd'));var queues=require(_0xd98e('0xe'));var recordings=require('./recordings.controller');var members=require(_0xd98e('0xf'));var dials=require(_0xd98e('0x10'));var transfers=require(_0xd98e('0x11'));var core=require(_0xd98e('0x12'));ami['on'](_0xd98e('0x13'),core[_0xd98e('0x13')]);ami['on'](_0xd98e('0x14'),core[_0xd98e('0x14')]);ami['on'](_0xd98e('0x15'),core['fullybooted']);ami['on'](_0xd98e('0x16'),core['error']);ami['on'](_0xd98e('0x17'),core[_0xd98e('0x17')]);ami['on']('managerevent',core[_0xd98e('0x18')]);ami['on'](_0xd98e('0x19'),function(_0x4a91bf){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')](_0xd98e('0x1c'),_0x4a91bf['device']),_0x4a91bf);members[_0xd98e('0x19')](_0x4a91bf);}catch(_0x581ff0){utils[_0xd98e('0x16')](util[_0xd98e('0x1b')](_0xd98e('0x1c'),_0x4a91bf[_0xd98e('0x1d')]),_0x581ff0);}});ami['on']('agentcalled',function(_0x53d2dc){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')](_0xd98e('0x1e'),_0x53d2dc[_0xd98e('0x1f')]),_0x53d2dc);agents[_0xd98e('0x20')](_0x53d2dc);}catch(_0x2aa38e){utils['error'](util[_0xd98e('0x1b')](_0xd98e('0x1e'),_0x53d2dc[_0xd98e('0x1f')]),_0x2aa38e);}});ami['on'](_0xd98e('0x21'),function(_0x5b16a4){try{utils['debug'](util[_0xd98e('0x1b')](_0xd98e('0x22'),_0x5b16a4[_0xd98e('0x1f')]),_0x5b16a4);agents[_0xd98e('0x21')](_0x5b16a4);}catch(_0xb9b689){utils[_0xd98e('0x16')](util['format'](_0xd98e('0x22'),_0x5b16a4['uniqueid']),_0xb9b689);}});ami['on'](_0xd98e('0x23'),function(_0x45bb13){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')](_0xd98e('0x24'),_0x45bb13[_0xd98e('0x1f')]),_0x45bb13);agents[_0xd98e('0x23')](_0x45bb13);queues[_0xd98e('0x23')](_0x45bb13);}catch(_0x494e91){utils[_0xd98e('0x16')](util['format']('[%s][index][agentconnect]',_0x45bb13[_0xd98e('0x1f')]),_0x494e91);}});ami['on'](_0xd98e('0x25'),function(_0x2aa177){try{utils['debug'](util['format']('[%s][index][agentcomplete]',_0x2aa177[_0xd98e('0x1f')]),_0x2aa177);agents[_0xd98e('0x25')](_0x2aa177);queues['agentcomplete'](_0x2aa177);members['agentcomplete'](_0x2aa177);}catch(_0x58a0e0){utils['error'](util[_0xd98e('0x1b')](_0xd98e('0x26'),_0x2aa177[_0xd98e('0x1f')]),_0x58a0e0);}});ami['on']('queuecallerabandon',function(_0x5abfc0){try{utils[_0xd98e('0x1a')](util['format'](_0xd98e('0x27'),_0x5abfc0[_0xd98e('0x1f')]),_0x5abfc0);agents[_0xd98e('0x28')](_0x5abfc0);queues[_0xd98e('0x28')](_0x5abfc0);}catch(_0x424f4b){utils['error'](util['format'](_0xd98e('0x27'),_0x5abfc0[_0xd98e('0x1f')]),_0x424f4b);}});ami['on'](_0xd98e('0x29'),function(_0x48e53b){try{utils['debug'](util['format'](_0xd98e('0x2a'),_0x48e53b[_0xd98e('0x1f')]),_0x48e53b);queues[_0xd98e('0x29')](_0x48e53b);recordings[_0xd98e('0x29')](_0x48e53b);}catch(_0x1b218b){utils[_0xd98e('0x16')](util[_0xd98e('0x1b')](_0xd98e('0x2a'),_0x48e53b[_0xd98e('0x1f')]),_0x1b218b);}});ami['on'](_0xd98e('0x2b'),function(_0x58d60b){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')]('[%s][index][queuecallerleave]',_0x58d60b[_0xd98e('0x1f')]),_0x58d60b);queues[_0xd98e('0x2b')](_0x58d60b);}catch(_0xaee454){utils[_0xd98e('0x16')](util['format']('[%s][index][queuecallerleave]',_0x58d60b[_0xd98e('0x1f')]),_0xaee454);}});ami['on'](_0xd98e('0x2c'),function(_0xe985d6){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')]('[%s][index][musiconholdstart]',_0xe985d6['uniqueid']),_0xe985d6);queues['musiconholdstart'](_0xe985d6);calls[_0xd98e('0x2c')](_0xe985d6);}catch(_0x4ff375){utils[_0xd98e('0x16')](util['format'](_0xd98e('0x2d'),_0xe985d6['uniqueid']),_0x4ff375);}});ami['on'](_0xd98e('0x2e'),function(_0x5de6bd){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')](_0xd98e('0x2f'),_0x5de6bd[_0xd98e('0x1f')]),_0x5de6bd);queues['musiconholdstop'](_0x5de6bd);calls[_0xd98e('0x2e')](_0x5de6bd);}catch(_0x36f628){utils['error'](util[_0xd98e('0x1b')]('[%s][index][musiconholdstop]',_0x5de6bd[_0xd98e('0x1f')]),_0x36f628);}});ami['on'](_0xd98e('0x30'),function(_0x3b933a){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')](_0xd98e('0x31'),_0x3b933a[_0xd98e('0x1f')]),_0x3b933a);calls['newstate'](_0x3b933a);recordings['newstate'](_0x3b933a);}catch(_0x373c84){utils['error'](util[_0xd98e('0x1b')](_0xd98e('0x31'),_0x3b933a['uniqueid']),_0x373c84);}});ami['on'](_0xd98e('0x32'),function(_0x4f2d52){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')]('[%s][index][hangup]',_0x4f2d52[_0xd98e('0x1f')]),_0x4f2d52);calls[_0xd98e('0x32')](_0x4f2d52);recordings[_0xd98e('0x32')](_0x4f2d52);dials[_0xd98e('0x32')](_0x4f2d52);agents[_0xd98e('0x32')](_0x4f2d52);queues[_0xd98e('0x32')](_0x4f2d52);}catch(_0x3d8340){utils[_0xd98e('0x16')](util['format'](_0xd98e('0x33'),_0x4f2d52['uniqueid']),_0x3d8340);}});ami['on'](_0xd98e('0x34'),function(_0x740d5a){try{utils['debug'](util[_0xd98e('0x1b')]('[%s][index][cdr]',_0x740d5a[_0xd98e('0x1f')]),_0x740d5a);members[_0xd98e('0x34')](_0x740d5a);}catch(_0x6fb6fa){utils['error'](util[_0xd98e('0x1b')](_0xd98e('0x35'),_0x740d5a[_0xd98e('0x1f')]),_0x6fb6fa);}});ami['on']('blindtransfer',function(_0x678b26){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')](_0xd98e('0x36'),_0x678b26['uniqueid']),_0x678b26);queues[_0xd98e('0x37')](_0x678b26);agents[_0xd98e('0x37')](_0x678b26);transfers['blindtransfer'](_0x678b26);recordings[_0xd98e('0x37')](_0x678b26);}catch(_0x377161){utils[_0xd98e('0x16')](util['format']('[%s][index][blindtransfer]',_0x678b26[_0xd98e('0x1f')]),_0x377161);}});ami['on'](_0xd98e('0x38'),function(_0x249134){try{utils[_0xd98e('0x1a')](util['format'](_0xd98e('0x39'),_0x249134[_0xd98e('0x3a')]),_0x249134);queues[_0xd98e('0x38')](_0x249134);transfers[_0xd98e('0x38')](_0x249134);agents['attendedtransfer'](_0x249134);calls[_0xd98e('0x38')](_0x249134);}catch(_0x201aff){utils[_0xd98e('0x16')](util[_0xd98e('0x1b')](_0xd98e('0x39'),_0x249134[_0xd98e('0x3a')]),_0x201aff);}});ami['on']('varset',function(_0x53f84a){try{utils[_0xd98e('0x1a')](util['format'](_0xd98e('0x3b'),_0x53f84a[_0xd98e('0x1f')]),_0x53f84a);queues['varset'](_0x53f84a);recordings[_0xd98e('0x3c')](_0x53f84a);calls[_0xd98e('0x3c')](_0x53f84a);dials[_0xd98e('0x3c')](_0x53f84a);}catch(_0x12155c){utils['error'](util[_0xd98e('0x1b')](_0xd98e('0x3b'),_0x53f84a[_0xd98e('0x1f')]),_0x12155c);}});ami['on'](_0xd98e('0x3d'),function(_0xcaa745){try{utils['debug'](util['format'](_0xd98e('0x3e'),_0xcaa745[_0xd98e('0x1f')]),_0xcaa745);calls['newexten'](_0xcaa745);recordings[_0xd98e('0x3d')](_0xcaa745);dials[_0xd98e('0x3d')](_0xcaa745);}catch(_0xd8aba5){utils['error'](util['format'](_0xd98e('0x3e'),_0xcaa745[_0xd98e('0x1f')]),_0xd8aba5);}});ami['on']('newchannel',function(_0x17b65c){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')]('[%s][index][newchannel]',_0x17b65c[_0xd98e('0x1f')]),_0x17b65c);calls[_0xd98e('0x3f')](_0x17b65c);recordings[_0xd98e('0x3f')](_0x17b65c);}catch(_0x24d25a){utils['error'](util[_0xd98e('0x1b')](_0xd98e('0x40'),_0x17b65c[_0xd98e('0x1f')]),_0x24d25a);}});ami['on'](_0xd98e('0x41'),function(_0x5da01f){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')](_0xd98e('0x42'),_0x5da01f[_0xd98e('0x1f')]),_0x5da01f);dials[_0xd98e('0x41')](_0x5da01f);}catch(_0x206659){utils['error'](util['format'](_0xd98e('0x43'),_0x5da01f[_0xd98e('0x1f')]),_0x206659);}});ami['on'](_0xd98e('0x44'),function(_0x19e7f5){try{utils[_0xd98e('0x1a')](util[_0xd98e('0x1b')](_0xd98e('0x45'),_0x19e7f5[_0xd98e('0x1f')]),_0x19e7f5);dials['dialend'](_0x19e7f5);}catch(_0xfc5ec1){utils[_0xd98e('0x16')](util['format'](_0xd98e('0x45'),_0x19e7f5[_0xd98e('0x1f')]),_0xfc5ec1);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 1230260..5c9faaf 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 _0x3452=['some','devicestatechange','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','now','NOT_INUSE','isNil','exitAt','duration','diffTime','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','split','data1','type','data2','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','membername','getUserByInterface','then','name','request','internal','CreateMemberReport','catch','error','[%s][members][writeDB]','uniqueid'];(function(_0x2f9dd9,_0x5f4051){var _0x51e4c8=function(_0x53176e){while(--_0x53176e){_0x2f9dd9['push'](_0x2f9dd9['shift']());}};_0x51e4c8(++_0x5f4051);}(_0x3452,0x183));var _0x2345=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x3452[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x2345('0x0'));var util=require(_0x2345('0x1'));var utils=require(_0x2345('0x2'));var members={};var exclude=[_0x2345('0x3'),_0x2345('0x4')];function writeDB(_0x35f24f){utils[_0x2345('0x5')](util[_0x2345('0x6')](_0x2345('0x7'),_0x35f24f['uniqueid'],_0x35f24f[_0x2345('0x8')],_0x35f24f[_0x2345('0x9')],_0x35f24f['data2'],_0x35f24f[_0x2345('0xa')],_0x35f24f['type']));if(_0x35f24f['interface']){utils[_0x2345('0xb')](_0x35f24f[_0x2345('0x8')])[_0x2345('0xc')](function(_0x5709c5){if(_0x5709c5){_0x35f24f[_0x2345('0xa')]=_0x5709c5[_0x2345('0xd')];_0x35f24f['internal']=_0x5709c5['internal'];utils[_0x2345('0xe')]('CreateMemberReport',_0x35f24f);}else{utils['getUserByName'](_0x35f24f['interface']['split']('/')[0x1])[_0x2345('0xc')](function(_0x60a065){if(_0x60a065){_0x35f24f[_0x2345('0xa')]=_0x60a065['name'];_0x35f24f['internal']=_0x60a065[_0x2345('0xf')];utils['request'](_0x2345('0x10'),_0x35f24f);}});}})[_0x2345('0x11')](function(_0x41245d){utils[_0x2345('0x12')](util[_0x2345('0x6')](_0x2345('0x13'),_0x35f24f[_0x2345('0x14')]),_0x41245d);});}delete members[_0x35f24f[_0x2345('0x8')]];}function startsWith(_0x530856,_0x18415b){return _[_0x2345('0x15')](_0x530856,function(_0x2b194a){return _['startsWith'](_0x18415b,_0x2b194a);});}exports[_0x2345('0x16')]=function(_0x532b33){try{utils['debug'](util[_0x2345('0x6')](_0x2345('0x17'),members[_0x532b33[_0x2345('0x18')]]?members[_0x532b33[_0x2345('0x18')]]['uniqueid']:_0x532b33[_0x2345('0x18')]),_0x532b33);utils['info'](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x532b33[_0x2345('0x18')]]?members[_0x532b33[_0x2345('0x18')]][_0x2345('0x14')]:_0x532b33['device'],_0x532b33[_0x2345('0x19')],_0x532b33[_0x2345('0x18')]));switch(_0x532b33[_0x2345('0x19')]){case _0x2345('0x1a'):case _0x2345('0x1b'):if(!startsWith(exclude,_0x532b33[_0x2345('0x18')])){members[_0x532b33[_0x2345('0x18')]]={'channel':_0x2345('0x1c'),'interface':_0x532b33[_0x2345('0x18')],'type':'TALKING','enterAt':utils[_0x2345('0x1d')](),'role':'agent'};}break;case _0x2345('0x1e'):if(!_[_0x2345('0x1f')](members[_0x532b33[_0x2345('0x18')]])){members[_0x532b33[_0x2345('0x18')]][_0x2345('0x20')]=utils[_0x2345('0x1d')]();members[_0x532b33[_0x2345('0x18')]][_0x2345('0x21')]=utils[_0x2345('0x22')](members[_0x532b33[_0x2345('0x18')]]['exitAt'],members[_0x532b33['device']]['enterAt']);if(members[_0x532b33[_0x2345('0x18')]][_0x2345('0x14')]){writeDB(members[_0x532b33['device']]);}}break;default:break;}}catch(_0x2b1338){utils[_0x2345('0x12')](util[_0x2345('0x6')](_0x2345('0x17'),members[_0x532b33[_0x2345('0x18')]]?members[_0x532b33['device']][_0x2345('0x14')]:_0x532b33[_0x2345('0x18')]),_0x2b1338);}};exports[_0x2345('0x23')]=function(_0x1ac0b6){try{if(!_[_0x2345('0x1f')](members[_0x1ac0b6[_0x2345('0x8')]])){utils[_0x2345('0x24')](util[_0x2345('0x6')](_0x2345('0x25'),_0x1ac0b6[_0x2345('0x14')]),_0x1ac0b6);utils['info'](util[_0x2345('0x6')](_0x2345('0x26'),_0x1ac0b6['uniqueid'],_0x1ac0b6['interface'],_0x1ac0b6['queue']));members[_0x1ac0b6[_0x2345('0x8')]]=_[_0x2345('0x27')](members[_0x1ac0b6[_0x2345('0x8')]],{'data4':_0x1ac0b6[_0x2345('0x28')],'uniqueid':_0x1ac0b6[_0x2345('0x14')]});}}catch(_0x139802){utils[_0x2345('0x12')](util['format'](_0x2345('0x25'),_0x1ac0b6[_0x2345('0x14')]),_0x139802);}};exports[_0x2345('0x29')]=function(_0x1b90bd){try{utils['debug'](util[_0x2345('0x6')](_0x2345('0x2a'),_0x1b90bd[_0x2345('0x14')]),_0x1b90bd);if(_0x1b90bd['channel']){var _0x5189aa=_0x1b90bd['channel'][_0x2345('0x2b')]('-')[0x0];if(!_['isNil'](members[_0x5189aa])){members[_0x5189aa]=_[_0x2345('0x27')](members[_0x5189aa],{'data1':members[_0x5189aa][_0x2345('0x2c')]||_0x1b90bd[_0x2345('0x2d')],'data2':members[_0x5189aa][_0x2345('0x2e')]||_0x1b90bd[_0x2345('0x2f')],'data3':members[_0x5189aa][_0x2345('0x30')]||_0x1b90bd[_0x2345('0x31')],'uniqueid':members[_0x5189aa][_0x2345('0x14')]||_0x1b90bd['uniqueid']});utils[_0x2345('0x5')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1b90bd[_0x2345('0x14')],members[_0x5189aa][_0x2345('0x2c')],members[_0x5189aa][_0x2345('0x2e')],members[_0x5189aa]['data3']));if(members[_0x5189aa][_0x2345('0x20')]){writeDB(members[_0x5189aa]);}}}if(_0x1b90bd[_0x2345('0x32')]){var _0x57f72a=_0x1b90bd[_0x2345('0x32')][_0x2345('0x2b')]('-')[0x0];if(!_[_0x2345('0x1f')](members[_0x57f72a])){members[_0x57f72a]=_[_0x2345('0x27')](members[_0x57f72a],{'data1':members[_0x57f72a][_0x2345('0x2c')]||_0x1b90bd[_0x2345('0x2d')],'data2':members[_0x57f72a][_0x2345('0x2e')]||_0x1b90bd[_0x2345('0x2f')],'data3':members[_0x57f72a][_0x2345('0x30')]||_0x1b90bd[_0x2345('0x31')],'uniqueid':members[_0x57f72a][_0x2345('0x14')]||_0x1b90bd[_0x2345('0x14')]});utils['info'](util[_0x2345('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x1b90bd[_0x2345('0x14')],members[_0x57f72a][_0x2345('0x2c')],members[_0x57f72a][_0x2345('0x2e')],members[_0x57f72a][_0x2345('0x30')]));if(members[_0x57f72a][_0x2345('0x20')]){writeDB(members[_0x57f72a]);}}}}catch(_0x59f2e5){utils[_0x2345('0x12')](util[_0x2345('0x6')]('[%s][members][cdr]',_0x1b90bd['uniqueid']),_0x59f2e5);}}; \ No newline at end of file +var _0xa459=['info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','data2','type','interface','getUserByInterface','then','name','CreateMemberReport','getUserByName','membername','internal','request','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','device','uniqueid','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][cdr]','channel','split','assign','data1','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:'];(function(_0x108ae2,_0x15cddd){var _0x1dc124=function(_0x4ded72){while(--_0x4ded72){_0x108ae2['push'](_0x108ae2['shift']());}};_0x1dc124(++_0x15cddd);}(_0xa459,0x1d8));var _0x9a45=function(_0xf427da,_0x2ed980){_0xf427da=_0xf427da-0x0;var _0x2408e9=_0xa459[_0xf427da];return _0x2408e9;};'use strict';var _=require(_0x9a45('0x0'));var util=require(_0x9a45('0x1'));var utils=require(_0x9a45('0x2'));var members={};var exclude=[_0x9a45('0x3'),_0x9a45('0x4')];function writeDB(_0x2a5c68){utils[_0x9a45('0x5')](util[_0x9a45('0x6')](_0x9a45('0x7'),_0x2a5c68['uniqueid'],_0x2a5c68['interface'],_0x2a5c68['channel'],_0x2a5c68[_0x9a45('0x8')],_0x2a5c68['membername'],_0x2a5c68[_0x9a45('0x9')]));if(_0x2a5c68[_0x9a45('0xa')]){utils[_0x9a45('0xb')](_0x2a5c68[_0x9a45('0xa')])[_0x9a45('0xc')](function(_0x40c296){if(_0x40c296){_0x2a5c68['membername']=_0x40c296[_0x9a45('0xd')];_0x2a5c68['internal']=_0x40c296['internal'];utils['request'](_0x9a45('0xe'),_0x2a5c68);}else{utils[_0x9a45('0xf')](_0x2a5c68[_0x9a45('0xa')]['split']('/')[0x1])[_0x9a45('0xc')](function(_0x704753){if(_0x704753){_0x2a5c68[_0x9a45('0x10')]=_0x704753[_0x9a45('0xd')];_0x2a5c68[_0x9a45('0x11')]=_0x704753[_0x9a45('0x11')];utils[_0x9a45('0x12')](_0x9a45('0xe'),_0x2a5c68);}});}})[_0x9a45('0x13')](function(_0x557e7b){utils[_0x9a45('0x14')](util[_0x9a45('0x6')](_0x9a45('0x15'),_0x2a5c68['uniqueid']),_0x557e7b);});}delete members[_0x2a5c68[_0x9a45('0xa')]];}function startsWith(_0x59f693,_0x38e771){return _['some'](_0x59f693,function(_0x18b793){return _[_0x9a45('0x16')](_0x38e771,_0x18b793);});}exports[_0x9a45('0x17')]=function(_0x1ab361){try{utils[_0x9a45('0x18')](util[_0x9a45('0x6')]('[%s][members][devicestatechange]',members[_0x1ab361[_0x9a45('0x19')]]?members[_0x1ab361[_0x9a45('0x19')]][_0x9a45('0x1a')]:_0x1ab361[_0x9a45('0x19')]),_0x1ab361);utils[_0x9a45('0x5')](util['format'](_0x9a45('0x1b'),members[_0x1ab361[_0x9a45('0x19')]]?members[_0x1ab361['device']]['uniqueid']:_0x1ab361['device'],_0x1ab361[_0x9a45('0x1c')],_0x1ab361['device']));switch(_0x1ab361[_0x9a45('0x1c')]){case _0x9a45('0x1d'):case _0x9a45('0x1e'):if(!startsWith(exclude,_0x1ab361[_0x9a45('0x19')])){members[_0x1ab361['device']]={'channel':'voice','interface':_0x1ab361['device'],'type':'TALKING','enterAt':utils[_0x9a45('0x1f')](),'role':_0x9a45('0x20')};}break;case _0x9a45('0x21'):if(!_[_0x9a45('0x22')](members[_0x1ab361[_0x9a45('0x19')]])){members[_0x1ab361[_0x9a45('0x19')]][_0x9a45('0x23')]=utils[_0x9a45('0x1f')]();members[_0x1ab361[_0x9a45('0x19')]][_0x9a45('0x24')]=utils[_0x9a45('0x25')](members[_0x1ab361[_0x9a45('0x19')]]['exitAt'],members[_0x1ab361[_0x9a45('0x19')]][_0x9a45('0x26')]);if(members[_0x1ab361['device']][_0x9a45('0x1a')]){writeDB(members[_0x1ab361[_0x9a45('0x19')]]);}}break;default:break;}}catch(_0x583d4c){utils[_0x9a45('0x14')](util['format'](_0x9a45('0x27'),members[_0x1ab361[_0x9a45('0x19')]]?members[_0x1ab361[_0x9a45('0x19')]][_0x9a45('0x1a')]:_0x1ab361[_0x9a45('0x19')]),_0x583d4c);}};exports[_0x9a45('0x28')]=function(_0x636b3a){try{if(!_['isNil'](members[_0x636b3a[_0x9a45('0xa')]])){utils['debug'](util[_0x9a45('0x6')](_0x9a45('0x29'),_0x636b3a[_0x9a45('0x1a')]),_0x636b3a);utils[_0x9a45('0x5')](util[_0x9a45('0x6')](_0x9a45('0x2a'),_0x636b3a['uniqueid'],_0x636b3a[_0x9a45('0xa')],_0x636b3a['queue']));members[_0x636b3a[_0x9a45('0xa')]]=_['assign'](members[_0x636b3a[_0x9a45('0xa')]],{'data4':_0x636b3a[_0x9a45('0x2b')],'uniqueid':_0x636b3a[_0x9a45('0x1a')]});}}catch(_0x5b5eba){utils[_0x9a45('0x14')](util['format'](_0x9a45('0x29'),_0x636b3a[_0x9a45('0x1a')]),_0x5b5eba);}};exports['cdr']=function(_0x5bd2ae){try{utils[_0x9a45('0x18')](util[_0x9a45('0x6')](_0x9a45('0x2c'),_0x5bd2ae[_0x9a45('0x1a')]),_0x5bd2ae);if(_0x5bd2ae[_0x9a45('0x2d')]){var _0x199e18=_0x5bd2ae['channel'][_0x9a45('0x2e')]('-')[0x0];if(!_[_0x9a45('0x22')](members[_0x199e18])){members[_0x199e18]=_[_0x9a45('0x2f')](members[_0x199e18],{'data1':members[_0x199e18][_0x9a45('0x30')]||_0x5bd2ae['type'],'data2':members[_0x199e18][_0x9a45('0x8')]||_0x5bd2ae[_0x9a45('0x31')],'data3':members[_0x199e18][_0x9a45('0x32')]||_0x5bd2ae[_0x9a45('0x33')],'uniqueid':members[_0x199e18][_0x9a45('0x1a')]||_0x5bd2ae[_0x9a45('0x1a')]});utils['info'](util[_0x9a45('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5bd2ae['uniqueid'],members[_0x199e18][_0x9a45('0x30')],members[_0x199e18][_0x9a45('0x8')],members[_0x199e18]['data3']));if(members[_0x199e18][_0x9a45('0x23')]){writeDB(members[_0x199e18]);}}}if(_0x5bd2ae[_0x9a45('0x34')]){var _0x5914fd=_0x5bd2ae[_0x9a45('0x34')][_0x9a45('0x2e')]('-')[0x0];if(!_[_0x9a45('0x22')](members[_0x5914fd])){members[_0x5914fd]=_['assign'](members[_0x5914fd],{'data1':members[_0x5914fd][_0x9a45('0x30')]||_0x5bd2ae[_0x9a45('0x9')],'data2':members[_0x5914fd][_0x9a45('0x8')]||_0x5bd2ae['source'],'data3':members[_0x5914fd][_0x9a45('0x32')]||_0x5bd2ae[_0x9a45('0x33')],'uniqueid':members[_0x5914fd][_0x9a45('0x1a')]||_0x5bd2ae[_0x9a45('0x1a')]});utils['info'](util[_0x9a45('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5bd2ae['uniqueid'],members[_0x5914fd][_0x9a45('0x30')],members[_0x5914fd][_0x9a45('0x8')],members[_0x5914fd]['data3']));if(members[_0x5914fd][_0x9a45('0x23')]){writeDB(members[_0x5914fd]);}}}}catch(_0x42b8e2){utils[_0x9a45('0x14')](util[_0x9a45('0x6')](_0x9a45('0x2c'),_0x5bd2ae['uniqueid']),_0x42b8e2);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index e0b4415..5e4aa60 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 _0x9745=['queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','ABANDONED','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','assigned','destaccountcode','membername','[%s][queues][agentconnect]','agentcomplete','queuecallercomplete','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexit'];(function(_0x22653d,_0x2369b9){var _0x3cf4ba=function(_0x2cf12e){while(--_0x2cf12e){_0x22653d['push'](_0x22653d['shift']());}};_0x3cf4ba(++_0x2369b9);}(_0x9745,0x1e3));var _0x5974=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0x9745[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x5974('0x0'));var util=require(_0x5974('0x1'));var utils=require(_0x5974('0x2'));var queues={};function writeDB(_0x568553){utils['info'](util[_0x5974('0x3')](_0x5974('0x4'),_0x568553[_0x5974('0x5')],_0x568553['channel'],_0x568553[_0x5974('0x6')],_0x568553[_0x5974('0x7')],_0x568553[_0x5974('0x8')],_0x568553['accountcode'],_0x568553[_0x5974('0x9')]));if(_0x568553['queue']){utils[_0x5974('0xa')](_0x568553['queue'])[_0x5974('0xb')](function(_0x24d029){if(_0x24d029){_0x568553['type']=_0x24d029[_0x5974('0xc')];}utils['request'](_0x5974('0xd'),_0x568553);});}else{utils[_0x5974('0xe')](_0x5974('0xd'),_0x568553);}if(_0x568553[_0x5974('0xf')]){delete queues[_0x568553[_0x5974('0xf')]];}else{delete queues[_0x568553[_0x5974('0x5')]];}}exports[_0x5974('0x10')]=function(_0x5028c0){try{utils[_0x5974('0x11')](util['format'](_0x5974('0x12'),_0x5028c0[_0x5974('0x5')]),_0x5028c0);utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x14'),_0x5028c0['uniqueid'],_0x5028c0[_0x5974('0x6')],_0x5028c0[_0x5974('0x15')]));queues[_0x5028c0[_0x5974('0x5')]]=_[_0x5974('0x16')](_0x5028c0,{'originalposition':_0x5028c0['position'],'queuecallerjoinAt':utils[_0x5974('0x17')](),'mohtime':0x0});}catch(_0x132357){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x12'),_0x5028c0[_0x5974('0x5')]),_0x132357);}};exports[_0x5974('0x19')]=function(_0x294b8e){try{if(!_[_0x5974('0x1a')](queues[_0x294b8e['uniqueid']])){utils[_0x5974('0x11')](util[_0x5974('0x3')](_0x5974('0x1b'),_0x294b8e[_0x5974('0x5')]),_0x294b8e);if(queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x1c')]){if(!queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x1d')]&&!queues[_0x294b8e[_0x5974('0x5')]]['queuecallerexit']){queues[_0x294b8e[_0x5974('0x5')]]['queuecallercomplete']=!![];queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x1e')]=utils[_0x5974('0x17')]();queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x9')]=_0x5974('0x1f');}utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x20'),_0x294b8e[_0x5974('0x5')],queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x21')],queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x9')]));writeDB(queues[_0x294b8e[_0x5974('0x5')]]);}else if(queues[_0x294b8e['uniqueid']][_0x5974('0xf')]){utils[_0x5974('0x13')](util[_0x5974('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x294b8e['uniqueid'],queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0x21')],queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0xf')]));queues[queues[_0x294b8e[_0x5974('0x5')]]['transfereduniqueid']]=queues[_0x294b8e[_0x5974('0x5')]];queues[queues[_0x294b8e[_0x5974('0x5')]][_0x5974('0xf')]][_0x5974('0x22')]=0x2;delete queues[_0x294b8e[_0x5974('0x5')]];}}}catch(_0x7c2ada){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x1b'),_0x294b8e[_0x5974('0x5')]),_0x7c2ada);}};exports[_0x5974('0x23')]=function(_0x52d1e2){try{utils[_0x5974('0x11')](util[_0x5974('0x3')]('[%s][queues][varset]',_0x52d1e2[_0x5974('0x5')]),_0x52d1e2);if(!_['isNil'](_0x52d1e2[_0x5974('0x24')][_0x5974('0x25')])&&_0x52d1e2[_0x5974('0x26')][_0x5974('0x27')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x52d1e2['uniqueid']])){queues[_0x52d1e2['uniqueid']][_0x5974('0x1d')]=![];queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x28')]=null;queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x29')]=!![];queues[_0x52d1e2['uniqueid']][_0x5974('0x2a')]=utils[_0x5974('0x17')]();queues[_0x52d1e2['uniqueid']]['queuecallerexitreason']=_0x52d1e2[_0x5974('0x26')][_0x5974('0x27')]();utils['info'](util[_0x5974('0x3')](_0x5974('0x2b'),_0x52d1e2[_0x5974('0x5')],queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x21')],_0x52d1e2[_0x5974('0x26')],queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x9')]));writeDB(queues[_0x52d1e2['uniqueid']]);}}else if(!_[_0x5974('0x1a')](_0x52d1e2[_0x5974('0x24')][_0x5974('0x2c')])){if(!_[_0x5974('0x1a')](queues[_0x52d1e2[_0x5974('0x5')]])&&!queues[_0x52d1e2['uniqueid']][_0x5974('0x1d')]){queues[_0x52d1e2['uniqueid']][_0x5974('0x1d')]=![];queues[_0x52d1e2[_0x5974('0x5')]]['queuecallerabandonAt']=null;queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x29')]=!![];queues[_0x52d1e2['uniqueid']][_0x5974('0x2a')]=utils['now']();queues[_0x52d1e2['uniqueid']][_0x5974('0x9')]='EXITWITHKEY';utils[_0x5974('0x13')](util['format'](_0x5974('0x2d'),_0x52d1e2['uniqueid'],queues[_0x52d1e2['uniqueid']][_0x5974('0x21')],_0x52d1e2['value'],queues[_0x52d1e2[_0x5974('0x5')]][_0x5974('0x9')]));}}}catch(_0x1b33ff){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x2e'),_0x52d1e2[_0x5974('0x5')]),_0x1b33ff);}};exports[_0x5974('0x1d')]=function(_0xd46540){try{if(!_[_0x5974('0x1a')](queues[_0xd46540[_0x5974('0x5')]])){utils[_0x5974('0x11')](util[_0x5974('0x3')]('[%s][queues][queuecallerabandon]',_0xd46540['uniqueid']),_0xd46540);queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x29')]=![];queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x2a')]=null;queues[_0xd46540['uniqueid']][_0x5974('0x1d')]=!![];queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x28')]=utils[_0x5974('0x17')]();queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x9')]=_0x5974('0x2f');utils[_0x5974('0x13')](util[_0x5974('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0xd46540[_0x5974('0x5')],queues[_0xd46540['uniqueid']][_0x5974('0x21')],queues[_0xd46540[_0x5974('0x5')]][_0x5974('0x9')]));}}catch(_0xf2b7f){utils['error'](util[_0x5974('0x3')](_0x5974('0x30'),_0xd46540[_0x5974('0x5')]),_0xf2b7f);}};exports['queuecallerleave']=function(_0x48f32f){try{if(!_['isNil'](queues[_0x48f32f[_0x5974('0x5')]])){utils[_0x5974('0x11')](util['format'](_0x5974('0x31'),_0x48f32f[_0x5974('0x5')]),_0x48f32f);utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x32'),_0x48f32f[_0x5974('0x5')],queues[_0x48f32f['uniqueid']][_0x5974('0x21')],_0x48f32f[_0x5974('0x33')],_0x48f32f[_0x5974('0x34')]));queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x35')]=!![];queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x1c')]=utils[_0x5974('0x17')]();queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x36')]=utils[_0x5974('0x37')](queues[_0x48f32f[_0x5974('0x5')]]['queuecallerleaveAt'],queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x38')]);queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x15')]=_0x48f32f[_0x5974('0x15')];queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x39')]=_0x48f32f['count'];queues[_0x48f32f[_0x5974('0x5')]][_0x5974('0x33')]=_0x48f32f[_0x5974('0x33')];queues[_0x48f32f['uniqueid']][_0x5974('0x34')]=_0x48f32f[_0x5974('0x34')];}}catch(_0xaee27a){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x31'),_0x48f32f['uniqueid']),_0xaee27a);}};exports[_0x5974('0x3a')]=function(_0x1c29fe){try{if(!_[_0x5974('0x1a')](queues[_0x1c29fe[_0x5974('0x5')]])){utils[_0x5974('0x11')](util[_0x5974('0x3')]('[%s][queues][agentconnect]',_0x1c29fe['uniqueid']),_0x1c29fe);utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x3b'),_0x1c29fe[_0x5974('0x5')],queues[_0x1c29fe[_0x5974('0x5')]]['name'],_0x1c29fe['membername'],_0x1c29fe['destaccountcode']));queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x1d')]=![];queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x1d')]=![];queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x28')]=null;queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x29')]=![];queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x9')]=null;queues[_0x1c29fe['uniqueid']][_0x5974('0x2a')]=null;queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x3c')]=!![];queues[_0x1c29fe[_0x5974('0x5')]]['accountcode']=_0x1c29fe[_0x5974('0x3d')];queues[_0x1c29fe[_0x5974('0x5')]][_0x5974('0x7')]=_0x1c29fe[_0x5974('0x3e')];}}catch(_0x469ef6){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x3f'),_0x1c29fe['uniqueid']),_0x469ef6);}};exports[_0x5974('0x40')]=function(_0x2c9210){try{if(!_[_0x5974('0x1a')](queues[_0x2c9210[_0x5974('0x5')]])){if(queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x1c')]){utils['debug'](util[_0x5974('0x3')]('[%s][queues][agentcomplete]',_0x2c9210[_0x5974('0x5')]),_0x2c9210);queues[_0x2c9210[_0x5974('0x5')]]['queuecallerabandon']=![];queues[_0x2c9210['uniqueid']][_0x5974('0x1d')]=![];queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x28')]=null;queues[_0x2c9210[_0x5974('0x5')]]['queuecallerexit']=![];queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x2a')]=null;queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x3c')]=!![];queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x7')]=_0x2c9210[_0x5974('0x3e')];queues[_0x2c9210['uniqueid']][_0x5974('0x41')]=!![];queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x1e')]=utils[_0x5974('0x17')]();if(_0x2c9210['reason']==_0x5974('0x42')){if(!queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x42')]){queues[_0x2c9210['uniqueid']][_0x5974('0x9')]=_0x5974('0x43');}}else{queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x9')]=_0x5974('0x44')+_0x2c9210['reason'][_0x5974('0x27')]();}utils[_0x5974('0x13')](util['format'](_0x5974('0x45'),_0x2c9210[_0x5974('0x5')],queues[_0x2c9210['uniqueid']]['name'],_0x2c9210['membername'],queues[_0x2c9210[_0x5974('0x5')]][_0x5974('0x9')]));writeDB(queues[_0x2c9210[_0x5974('0x5')]]);}}}catch(_0xbd4f94){utils['error'](util[_0x5974('0x3')](_0x5974('0x46'),_0x2c9210['uniqueid']),_0xbd4f94);}};exports[_0x5974('0x47')]=function(_0x65a5a5){try{if(!_[_0x5974('0x1a')](queues[_0x65a5a5[_0x5974('0x48')]])){utils['debug'](util[_0x5974('0x3')](_0x5974('0x49'),_0x65a5a5[_0x5974('0x5')]),_0x65a5a5);queues[_0x65a5a5[_0x5974('0x48')]]['transfer']=!![];queues[_0x65a5a5[_0x5974('0x48')]][_0x5974('0x4a')]=_0x5974('0x4b');queues[_0x65a5a5[_0x5974('0x48')]][_0x5974('0x4c')]=_0x65a5a5[_0x5974('0x4d')];queues[_0x65a5a5[_0x5974('0x48')]][_0x5974('0x4e')]=_0x65a5a5[_0x5974('0x48')];queues[_0x65a5a5[_0x5974('0x48')]][_0x5974('0x9')]=_0x5974('0x4f');utils[_0x5974('0x13')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x65a5a5['uniqueid'],queues[_0x65a5a5['transfereeuniqueid']][_0x5974('0x21')],_0x65a5a5[_0x5974('0x48')],_0x65a5a5[_0x5974('0x4d')]));}}catch(_0xb483ae){utils[_0x5974('0x18')](util[_0x5974('0x3')](_0x5974('0x49'),_0x65a5a5['uniqueid']),_0xb483ae);}};exports[_0x5974('0x50')]=function(_0x402544){try{utils[_0x5974('0x11')](util['format']('[%s][queues][attendedtransfer]',_0x402544[_0x5974('0x51')]),_0x402544);if(_0x402544[_0x5974('0x51')]==_0x402544[_0x5974('0x52')]){if(!_[_0x5974('0x1a')](queues[_0x402544['secondtransfererlinkedid']])){utils['info'](util[_0x5974('0x3')](_0x5974('0x53'),_0x402544['origtransfereruniqueid'],queues[_0x402544[_0x5974('0x54')]][_0x5974('0x21')],_0x402544[_0x5974('0x55')]));queues[_0x402544[_0x5974('0x54')]]['transfer']=!![];queues[_0x402544['secondtransfererlinkedid']][_0x5974('0x4a')]=_0x5974('0x56');queues[_0x402544[_0x5974('0x54')]]['transferexten']=_0x402544[_0x5974('0x55')];queues[_0x402544[_0x5974('0x54')]][_0x5974('0x4e')]=_0x402544[_0x5974('0x51')];queues[_0x402544[_0x5974('0x54')]][_0x5974('0x9')]=_0x5974('0x57');}if(!_[_0x5974('0x1a')](queues[_0x402544['origtransfererlinkedid']])){if(_0x402544[_0x5974('0x58')]&&queues[_0x402544[_0x5974('0x58')]]){queues[_0x402544[_0x5974('0x58')]][_0x5974('0x22')]=0x1;queues[_0x402544['transfereeuniqueid']]=_[_0x5974('0x59')](queues[_0x402544[_0x5974('0x58')]]);queues[_0x402544[_0x5974('0x48')]]['transfereduniqueid']=_0x402544[_0x5974('0x5a')];queues[_0x402544[_0x5974('0x48')]][_0x5974('0x22')]=0x2;queues[_0x402544[_0x5974('0x48')]][_0x5974('0x8')]=queues[_0x402544[_0x5974('0x54')]]['calleridnum'];queues[_0x402544[_0x5974('0x48')]][_0x5974('0x5b')]=queues[_0x402544[_0x5974('0x54')]]['calleridname'];queues[_0x402544[_0x5974('0x48')]]['queuecallerjoinAt']=utils[_0x5974('0x17')]();queues[_0x402544[_0x5974('0x48')]]['queuecallerleaveAt']=utils[_0x5974('0x17')]();queues[_0x402544[_0x5974('0x48')]][_0x5974('0x36')]=0x0;queues[_0x402544[_0x5974('0x48')]][_0x5974('0x5c')]=0x0;utils[_0x5974('0x13')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x402544[_0x5974('0x51')],queues[_0x402544[_0x5974('0x48')]]['name'],queues[_0x402544['transfereeuniqueid']][_0x5974('0x8')],queues[_0x402544[_0x5974('0x48')]][_0x5974('0x5b')]));}else{utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x5d'),_0x402544[_0x5974('0x51')],queues[_0x402544[_0x5974('0x52')]][_0x5974('0x21')],_0x402544[_0x5974('0x54')]));queues[_0x402544['origtransfererlinkedid']][_0x5974('0xf')]=_0x402544[_0x5974('0x54')];}}}else if(_0x402544[_0x5974('0x5e')]==_0x402544['secondtransfererlinkedid']){if(!_[_0x5974('0x1a')](queues[_0x402544[_0x5974('0x52')]])){utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x5f'),_0x402544[_0x5974('0x51')],queues[_0x402544[_0x5974('0x52')]][_0x5974('0x21')],_0x402544[_0x5974('0x5e')],_0x402544[_0x5974('0x60')]));queues[_0x402544[_0x5974('0x52')]][_0x5974('0x42')]=!![];queues[_0x402544[_0x5974('0x52')]]['transfertype']=_0x5974('0x56');queues[_0x402544['origtransfererlinkedid']][_0x5974('0x4c')]=_0x402544[_0x5974('0x60')];queues[_0x402544['origtransfererlinkedid']][_0x5974('0x4e')]=_0x402544[_0x5974('0x5e')];queues[_0x402544[_0x5974('0x52')]][_0x5974('0x9')]=_0x5974('0x57');}if(!_['isNil'](queues[_0x402544[_0x5974('0x54')]])){if(_0x402544[_0x5974('0x61')]&&queues[_0x402544[_0x5974('0x61')]]){queues[_0x402544[_0x5974('0x61')]][_0x5974('0x22')]=0x1;queues[_0x402544[_0x5974('0x5a')]]=_[_0x5974('0x59')](queues[_0x402544['transfertargetlinkedid']]);queues[_0x402544[_0x5974('0x5a')]][_0x5974('0xf')]=_0x402544[_0x5974('0x5a')];queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x22')]=0x2;queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x8')]=queues[_0x402544[_0x5974('0x52')]][_0x5974('0x8')];queues[_0x402544[_0x5974('0x5a')]]['calleridname']=queues[_0x402544[_0x5974('0x52')]][_0x5974('0x5b')];queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x38')]=utils['now']();queues[_0x402544[_0x5974('0x5a')]]['queuecallerleaveAt']=utils[_0x5974('0x17')]();queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x36')]=0x0;queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x5c')]=0x0;utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x62'),_0x402544['origtransfereruniqueid'],queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x21')],queues[_0x402544['transfertargetuniqueid']][_0x5974('0xf')],queues[_0x402544[_0x5974('0x5a')]]['calleridnum'],queues[_0x402544[_0x5974('0x5a')]][_0x5974('0x5b')]));}else{utils['info'](util[_0x5974('0x3')](_0x5974('0x5d'),_0x402544[_0x5974('0x51')],queues[_0x402544[_0x5974('0x54')]][_0x5974('0x21')],_0x402544[_0x5974('0x52')]));queues[_0x402544[_0x5974('0x54')]]['transfereduniqueid']=_0x402544[_0x5974('0x52')];}}}}catch(_0x31449a){utils[_0x5974('0x18')](util[_0x5974('0x3')]('[%s][queues][attendedtransfer]',_0x402544['origtransfereruniqueid']),_0x31449a);}};exports[_0x5974('0x63')]=function(_0x5a702a){try{if(!_['isNil'](queues[_0x5a702a[_0x5974('0x5')]])){utils['debug'](util['format'](_0x5974('0x64'),_0x5a702a[_0x5974('0x5')]),_0x5a702a);queues[_0x5a702a['uniqueid']][_0x5974('0x65')]=utils['now']();utils[_0x5974('0x13')](util[_0x5974('0x3')](_0x5974('0x66'),_0x5a702a[_0x5974('0x5')],queues[_0x5a702a[_0x5974('0x5')]][_0x5974('0x21')],queues[_0x5a702a[_0x5974('0x5')]]['musiconholdstartAt']));}}catch(_0x1f6647){utils['error'](util['format']('[%s][queues][musiconholdstart]',_0x5a702a[_0x5974('0x5')]),_0x1f6647);}};exports[_0x5974('0x67')]=function(_0x8bc0d8){try{if(!_['isNil'](queues[_0x8bc0d8[_0x5974('0x5')]])){if(!_[_0x5974('0x1a')](queues[_0x8bc0d8[_0x5974('0x5')]][_0x5974('0x65')])){utils[_0x5974('0x11')](util['format'](_0x5974('0x68'),_0x8bc0d8['uniqueid']),_0x8bc0d8);queues[_0x8bc0d8[_0x5974('0x5')]]['mohtime']+=utils[_0x5974('0x37')](utils[_0x5974('0x17')](),queues[_0x8bc0d8['uniqueid']][_0x5974('0x65')]);utils['info'](util[_0x5974('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x8bc0d8[_0x5974('0x5')],queues[_0x8bc0d8['uniqueid']][_0x5974('0x21')],queues[_0x8bc0d8[_0x5974('0x5')]]['mohtime']));delete queues[_0x8bc0d8[_0x5974('0x5')]][_0x5974('0x65')];}}}catch(_0x2ff261){utils[_0x5974('0x18')](util['format'](_0x5974('0x68'),_0x8bc0d8[_0x5974('0x5')]),_0x2ff261);}}; \ No newline at end of file +var _0x835a=['queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','util','./utils','info','format','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandon','queuecallerabandonAt','[%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','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleaveAt','holdtime','diffTime'];(function(_0x196f89,_0xbec963){var _0x48cc99=function(_0x1e8e23){while(--_0x1e8e23){_0x196f89['push'](_0x196f89['shift']());}};_0x48cc99(++_0xbec963);}(_0x835a,0x99));var _0xa835=function(_0x1201e6,_0x11cc43){_0x1201e6=_0x1201e6-0x0;var _0x1fa676=_0x835a[_0x1201e6];return _0x1fa676;};'use strict';var _=require('lodash');var util=require(_0xa835('0x0'));var utils=require(_0xa835('0x1'));var queues={};function writeDB(_0x3fb733){utils[_0xa835('0x2')](util[_0xa835('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x3fb733[_0xa835('0x4')],_0x3fb733[_0xa835('0x5')],_0x3fb733[_0xa835('0x6')],_0x3fb733[_0xa835('0x7')],_0x3fb733[_0xa835('0x8')],_0x3fb733[_0xa835('0x9')],_0x3fb733[_0xa835('0xa')]));if(_0x3fb733['queue']){utils[_0xa835('0xb')](_0x3fb733['queue'])[_0xa835('0xc')](function(_0x179bf7){if(_0x179bf7){_0x3fb733[_0xa835('0xd')]=_0x179bf7[_0xa835('0xd')];}utils[_0xa835('0xe')](_0xa835('0xf'),_0x3fb733);});}else{utils['request'](_0xa835('0xf'),_0x3fb733);}if(_0x3fb733['transfereduniqueid']){delete queues[_0x3fb733[_0xa835('0x10')]];}else{delete queues[_0x3fb733[_0xa835('0x4')]];}}exports['queuecallerjoin']=function(_0x388496){try{utils[_0xa835('0x11')](util['format'](_0xa835('0x12'),_0x388496[_0xa835('0x4')]),_0x388496);utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x13'),_0x388496[_0xa835('0x4')],_0x388496[_0xa835('0x6')],_0x388496[_0xa835('0x14')]));queues[_0x388496['uniqueid']]=_[_0xa835('0x15')](_0x388496,{'originalposition':_0x388496[_0xa835('0x14')],'queuecallerjoinAt':utils[_0xa835('0x16')](),'mohtime':0x0});}catch(_0x392098){utils[_0xa835('0x17')](util['format'](_0xa835('0x12'),_0x388496[_0xa835('0x4')]),_0x392098);}};exports[_0xa835('0x18')]=function(_0x53ab54){try{if(!_[_0xa835('0x19')](queues[_0x53ab54['uniqueid']])){utils[_0xa835('0x11')](util[_0xa835('0x3')](_0xa835('0x1a'),_0x53ab54[_0xa835('0x4')]),_0x53ab54);if(queues[_0x53ab54['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x53ab54[_0xa835('0x4')]]['queuecallerabandon']&&!queues[_0x53ab54[_0xa835('0x4')]][_0xa835('0x1b')]){queues[_0x53ab54[_0xa835('0x4')]]['queuecallercomplete']=!![];queues[_0x53ab54[_0xa835('0x4')]][_0xa835('0x1c')]=utils[_0xa835('0x16')]();queues[_0x53ab54[_0xa835('0x4')]][_0xa835('0xa')]=_0xa835('0x1d');}utils['info'](util[_0xa835('0x3')](_0xa835('0x1e'),_0x53ab54[_0xa835('0x4')],queues[_0x53ab54[_0xa835('0x4')]]['name'],queues[_0x53ab54['uniqueid']][_0xa835('0xa')]));writeDB(queues[_0x53ab54[_0xa835('0x4')]]);}else if(queues[_0x53ab54[_0xa835('0x4')]][_0xa835('0x10')]){utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x1f'),_0x53ab54[_0xa835('0x4')],queues[_0x53ab54[_0xa835('0x4')]][_0xa835('0x20')],queues[_0x53ab54['uniqueid']]['transfereduniqueid']));queues[queues[_0x53ab54[_0xa835('0x4')]]['transfereduniqueid']]=queues[_0x53ab54[_0xa835('0x4')]];queues[queues[_0x53ab54[_0xa835('0x4')]][_0xa835('0x10')]][_0xa835('0x21')]=0x2;delete queues[_0x53ab54[_0xa835('0x4')]];}}}catch(_0x302640){utils[_0xa835('0x17')](util[_0xa835('0x3')]('[%s][queues][hangup]',_0x53ab54['uniqueid']),_0x302640);}};exports[_0xa835('0x22')]=function(_0x7a277b){try{utils[_0xa835('0x11')](util[_0xa835('0x3')](_0xa835('0x23'),_0x7a277b[_0xa835('0x4')]),_0x7a277b);if(!_['isNil'](_0x7a277b[_0xa835('0x24')]['queuestatus'])&&_0x7a277b[_0xa835('0x25')][_0xa835('0x26')]()!==_0xa835('0x27')){if(!_[_0xa835('0x19')](queues[_0x7a277b['uniqueid']])){queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0x28')]=![];queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0x29')]=null;queues[_0x7a277b[_0xa835('0x4')]]['queuecallerexit']=!![];queues[_0x7a277b[_0xa835('0x4')]]['queuecallerexitAt']=utils[_0xa835('0x16')]();queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0xa')]=_0x7a277b[_0xa835('0x25')][_0xa835('0x26')]();utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x2a'),_0x7a277b[_0xa835('0x4')],queues[_0x7a277b['uniqueid']][_0xa835('0x20')],_0x7a277b[_0xa835('0x25')],queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0xa')]));writeDB(queues[_0x7a277b[_0xa835('0x4')]]);}}else if(!_['isNil'](_0x7a277b[_0xa835('0x24')][_0xa835('0x2b')])){if(!_[_0xa835('0x19')](queues[_0x7a277b['uniqueid']])&&!queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0x28')]){queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0x28')]=![];queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0x29')]=null;queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0x1b')]=!![];queues[_0x7a277b[_0xa835('0x4')]][_0xa835('0x2c')]=utils['now']();queues[_0x7a277b[_0xa835('0x4')]]['queuecallerexitreason']=_0xa835('0x2d');utils['info'](util[_0xa835('0x3')](_0xa835('0x2e'),_0x7a277b[_0xa835('0x4')],queues[_0x7a277b['uniqueid']][_0xa835('0x20')],_0x7a277b[_0xa835('0x25')],queues[_0x7a277b[_0xa835('0x4')]]['queuecallerexitreason']));}}}catch(_0x206b02){utils[_0xa835('0x17')](util[_0xa835('0x3')]('[%s][queues][varset]',_0x7a277b['uniqueid']),_0x206b02);}};exports[_0xa835('0x28')]=function(_0x2a4466){try{if(!_[_0xa835('0x19')](queues[_0x2a4466[_0xa835('0x4')]])){utils[_0xa835('0x11')](util[_0xa835('0x3')](_0xa835('0x2f'),_0x2a4466[_0xa835('0x4')]),_0x2a4466);queues[_0x2a4466['uniqueid']][_0xa835('0x1b')]=![];queues[_0x2a4466[_0xa835('0x4')]][_0xa835('0x2c')]=null;queues[_0x2a4466[_0xa835('0x4')]]['queuecallerabandon']=!![];queues[_0x2a4466['uniqueid']][_0xa835('0x29')]=utils[_0xa835('0x16')]();queues[_0x2a4466['uniqueid']][_0xa835('0xa')]='ABANDONED';utils['info'](util[_0xa835('0x3')](_0xa835('0x30'),_0x2a4466['uniqueid'],queues[_0x2a4466['uniqueid']]['name'],queues[_0x2a4466[_0xa835('0x4')]][_0xa835('0xa')]));}}catch(_0x15dba3){utils[_0xa835('0x17')](util['format'](_0xa835('0x2f'),_0x2a4466[_0xa835('0x4')]),_0x15dba3);}};exports[_0xa835('0x31')]=function(_0x14e121){try{if(!_[_0xa835('0x19')](queues[_0x14e121['uniqueid']])){utils[_0xa835('0x11')](util[_0xa835('0x3')](_0xa835('0x32'),_0x14e121[_0xa835('0x4')]),_0x14e121);utils[_0xa835('0x2')](util['format'](_0xa835('0x33'),_0x14e121[_0xa835('0x4')],queues[_0x14e121[_0xa835('0x4')]][_0xa835('0x20')],_0x14e121['connectedlinenum'],_0x14e121['connectedlinename']));queues[_0x14e121[_0xa835('0x4')]]['queuecallerleave']=!![];queues[_0x14e121[_0xa835('0x4')]][_0xa835('0x34')]=utils['now']();queues[_0x14e121['uniqueid']][_0xa835('0x35')]=utils[_0xa835('0x36')](queues[_0x14e121[_0xa835('0x4')]][_0xa835('0x34')],queues[_0x14e121[_0xa835('0x4')]][_0xa835('0x37')]);queues[_0x14e121['uniqueid']][_0xa835('0x14')]=_0x14e121[_0xa835('0x14')];queues[_0x14e121[_0xa835('0x4')]][_0xa835('0x38')]=_0x14e121['count'];queues[_0x14e121[_0xa835('0x4')]]['connectedlinenum']=_0x14e121[_0xa835('0x39')];queues[_0x14e121['uniqueid']]['connectedlinename']=_0x14e121[_0xa835('0x3a')];}}catch(_0x508cae){utils[_0xa835('0x17')](util[_0xa835('0x3')](_0xa835('0x32'),_0x14e121[_0xa835('0x4')]),_0x508cae);}};exports[_0xa835('0x3b')]=function(_0x11284c){try{if(!_['isNil'](queues[_0x11284c[_0xa835('0x4')]])){utils['debug'](util[_0xa835('0x3')](_0xa835('0x3c'),_0x11284c[_0xa835('0x4')]),_0x11284c);utils[_0xa835('0x2')](util[_0xa835('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x11284c[_0xa835('0x4')],queues[_0x11284c[_0xa835('0x4')]][_0xa835('0x20')],_0x11284c[_0xa835('0x3d')],_0x11284c[_0xa835('0x3e')]));queues[_0x11284c['uniqueid']][_0xa835('0x28')]=![];queues[_0x11284c['uniqueid']]['queuecallerabandon']=![];queues[_0x11284c[_0xa835('0x4')]]['queuecallerabandonAt']=null;queues[_0x11284c['uniqueid']][_0xa835('0x1b')]=![];queues[_0x11284c[_0xa835('0x4')]][_0xa835('0xa')]=null;queues[_0x11284c[_0xa835('0x4')]][_0xa835('0x2c')]=null;queues[_0x11284c[_0xa835('0x4')]][_0xa835('0x3f')]=!![];queues[_0x11284c[_0xa835('0x4')]]['accountcode']=_0x11284c[_0xa835('0x3e')];queues[_0x11284c[_0xa835('0x4')]][_0xa835('0x7')]=_0x11284c['membername'];}}catch(_0x452b50){utils[_0xa835('0x17')](util[_0xa835('0x3')]('[%s][queues][agentconnect]',_0x11284c['uniqueid']),_0x452b50);}};exports[_0xa835('0x40')]=function(_0x574833){try{if(!_[_0xa835('0x19')](queues[_0x574833[_0xa835('0x4')]])){if(queues[_0x574833[_0xa835('0x4')]][_0xa835('0x34')]){utils['debug'](util[_0xa835('0x3')](_0xa835('0x41'),_0x574833[_0xa835('0x4')]),_0x574833);queues[_0x574833[_0xa835('0x4')]]['queuecallerabandon']=![];queues[_0x574833[_0xa835('0x4')]]['queuecallerabandon']=![];queues[_0x574833[_0xa835('0x4')]][_0xa835('0x29')]=null;queues[_0x574833[_0xa835('0x4')]][_0xa835('0x1b')]=![];queues[_0x574833[_0xa835('0x4')]][_0xa835('0x2c')]=null;queues[_0x574833[_0xa835('0x4')]][_0xa835('0x3f')]=!![];queues[_0x574833[_0xa835('0x4')]]['lastAssignedTo']=_0x574833[_0xa835('0x3d')];queues[_0x574833[_0xa835('0x4')]]['queuecallercomplete']=!![];queues[_0x574833[_0xa835('0x4')]][_0xa835('0x1c')]=utils['now']();if(_0x574833[_0xa835('0x42')]=='transfer'){if(!queues[_0x574833['uniqueid']][_0xa835('0x43')]){queues[_0x574833[_0xa835('0x4')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x574833[_0xa835('0x4')]][_0xa835('0xa')]=_0xa835('0x44')+_0x574833[_0xa835('0x42')]['toUpperCase']();}utils[_0xa835('0x2')](util['format'](_0xa835('0x45'),_0x574833[_0xa835('0x4')],queues[_0x574833[_0xa835('0x4')]]['name'],_0x574833[_0xa835('0x3d')],queues[_0x574833[_0xa835('0x4')]]['queuecallerexitreason']));writeDB(queues[_0x574833[_0xa835('0x4')]]);}}}catch(_0x2e50be){utils[_0xa835('0x17')](util[_0xa835('0x3')](_0xa835('0x41'),_0x574833[_0xa835('0x4')]),_0x2e50be);}};exports['blindtransfer']=function(_0x3bf112){try{if(!_[_0xa835('0x19')](queues[_0x3bf112[_0xa835('0x46')]])){utils[_0xa835('0x11')](util[_0xa835('0x3')]('[%s][queues][blindtransfer]',_0x3bf112['uniqueid']),_0x3bf112);queues[_0x3bf112[_0xa835('0x46')]]['transfer']=!![];queues[_0x3bf112[_0xa835('0x46')]]['transfertype']=_0xa835('0x47');queues[_0x3bf112[_0xa835('0x46')]][_0xa835('0x48')]=_0x3bf112[_0xa835('0x49')];queues[_0x3bf112[_0xa835('0x46')]][_0xa835('0x4a')]=_0x3bf112[_0xa835('0x46')];queues[_0x3bf112[_0xa835('0x46')]][_0xa835('0xa')]=_0xa835('0x4b');utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x4c'),_0x3bf112[_0xa835('0x4')],queues[_0x3bf112['transfereeuniqueid']]['name'],_0x3bf112['transfereeuniqueid'],_0x3bf112[_0xa835('0x49')]));}}catch(_0x4ed3f8){utils[_0xa835('0x17')](util[_0xa835('0x3')]('[%s][queues][blindtransfer]',_0x3bf112[_0xa835('0x4')]),_0x4ed3f8);}};exports[_0xa835('0x4d')]=function(_0x4902a1){try{utils[_0xa835('0x11')](util[_0xa835('0x3')](_0xa835('0x4e'),_0x4902a1[_0xa835('0x4f')]),_0x4902a1);if(_0x4902a1[_0xa835('0x4f')]==_0x4902a1[_0xa835('0x50')]){if(!_[_0xa835('0x19')](queues[_0x4902a1[_0xa835('0x51')]])){utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x52'),_0x4902a1[_0xa835('0x4f')],queues[_0x4902a1[_0xa835('0x51')]]['name'],_0x4902a1[_0xa835('0x53')]));queues[_0x4902a1[_0xa835('0x51')]][_0xa835('0x43')]=!![];queues[_0x4902a1['secondtransfererlinkedid']][_0xa835('0x54')]=_0xa835('0x55');queues[_0x4902a1['secondtransfererlinkedid']][_0xa835('0x48')]=_0x4902a1[_0xa835('0x53')];queues[_0x4902a1['secondtransfererlinkedid']][_0xa835('0x4a')]=_0x4902a1[_0xa835('0x4f')];queues[_0x4902a1[_0xa835('0x51')]][_0xa835('0xa')]='ATTENDEDTRANSFER';}if(!_[_0xa835('0x19')](queues[_0x4902a1['origtransfererlinkedid']])){if(_0x4902a1[_0xa835('0x56')]&&queues[_0x4902a1[_0xa835('0x56')]]){queues[_0x4902a1[_0xa835('0x56')]][_0xa835('0x21')]=0x1;queues[_0x4902a1['transfereeuniqueid']]=_[_0xa835('0x57')](queues[_0x4902a1[_0xa835('0x56')]]);queues[_0x4902a1['transfereeuniqueid']][_0xa835('0x10')]=_0x4902a1[_0xa835('0x58')];queues[_0x4902a1['transfereeuniqueid']][_0xa835('0x21')]=0x2;queues[_0x4902a1['transfereeuniqueid']][_0xa835('0x8')]=queues[_0x4902a1['secondtransfererlinkedid']][_0xa835('0x8')];queues[_0x4902a1[_0xa835('0x46')]][_0xa835('0x59')]=queues[_0x4902a1[_0xa835('0x51')]][_0xa835('0x59')];queues[_0x4902a1['transfereeuniqueid']][_0xa835('0x37')]=utils[_0xa835('0x16')]();queues[_0x4902a1[_0xa835('0x46')]][_0xa835('0x34')]=utils[_0xa835('0x16')]();queues[_0x4902a1['transfereeuniqueid']][_0xa835('0x35')]=0x0;queues[_0x4902a1['transfereeuniqueid']][_0xa835('0x5a')]=0x0;utils[_0xa835('0x2')](util[_0xa835('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x4902a1[_0xa835('0x4f')],queues[_0x4902a1[_0xa835('0x46')]][_0xa835('0x20')],queues[_0x4902a1[_0xa835('0x46')]][_0xa835('0x8')],queues[_0x4902a1[_0xa835('0x46')]]['calleridname']));}else{utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x5b'),_0x4902a1[_0xa835('0x4f')],queues[_0x4902a1[_0xa835('0x50')]][_0xa835('0x20')],_0x4902a1[_0xa835('0x51')]));queues[_0x4902a1[_0xa835('0x50')]]['transfereduniqueid']=_0x4902a1['secondtransfererlinkedid'];}}}else if(_0x4902a1['secondtransfereruniqueid']==_0x4902a1['secondtransfererlinkedid']){if(!_[_0xa835('0x19')](queues[_0x4902a1['origtransfererlinkedid']])){utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x5c'),_0x4902a1[_0xa835('0x4f')],queues[_0x4902a1[_0xa835('0x50')]][_0xa835('0x20')],_0x4902a1[_0xa835('0x5d')],_0x4902a1[_0xa835('0x5e')]));queues[_0x4902a1[_0xa835('0x50')]][_0xa835('0x43')]=!![];queues[_0x4902a1[_0xa835('0x50')]][_0xa835('0x54')]=_0xa835('0x55');queues[_0x4902a1['origtransfererlinkedid']][_0xa835('0x48')]=_0x4902a1[_0xa835('0x5e')];queues[_0x4902a1['origtransfererlinkedid']][_0xa835('0x4a')]=_0x4902a1[_0xa835('0x5d')];queues[_0x4902a1[_0xa835('0x50')]][_0xa835('0xa')]=_0xa835('0x5f');}if(!_[_0xa835('0x19')](queues[_0x4902a1[_0xa835('0x51')]])){if(_0x4902a1[_0xa835('0x60')]&&queues[_0x4902a1['transfertargetlinkedid']]){queues[_0x4902a1['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x4902a1[_0xa835('0x58')]]=_['clone'](queues[_0x4902a1['transfertargetlinkedid']]);queues[_0x4902a1[_0xa835('0x58')]][_0xa835('0x10')]=_0x4902a1['transfertargetuniqueid'];queues[_0x4902a1[_0xa835('0x58')]][_0xa835('0x21')]=0x2;queues[_0x4902a1[_0xa835('0x58')]][_0xa835('0x8')]=queues[_0x4902a1[_0xa835('0x50')]][_0xa835('0x8')];queues[_0x4902a1[_0xa835('0x58')]]['calleridname']=queues[_0x4902a1[_0xa835('0x50')]][_0xa835('0x59')];queues[_0x4902a1['transfertargetuniqueid']]['queuecallerjoinAt']=utils['now']();queues[_0x4902a1['transfertargetuniqueid']][_0xa835('0x34')]=utils[_0xa835('0x16')]();queues[_0x4902a1[_0xa835('0x58')]][_0xa835('0x35')]=0x0;queues[_0x4902a1['transfertargetuniqueid']][_0xa835('0x5a')]=0x0;utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x61'),_0x4902a1[_0xa835('0x4f')],queues[_0x4902a1[_0xa835('0x58')]]['name'],queues[_0x4902a1[_0xa835('0x58')]]['transfereduniqueid'],queues[_0x4902a1[_0xa835('0x58')]][_0xa835('0x8')],queues[_0x4902a1[_0xa835('0x58')]]['calleridname']));}else{utils[_0xa835('0x2')](util[_0xa835('0x3')](_0xa835('0x5b'),_0x4902a1[_0xa835('0x4f')],queues[_0x4902a1[_0xa835('0x51')]]['name'],_0x4902a1[_0xa835('0x50')]));queues[_0x4902a1['secondtransfererlinkedid']]['transfereduniqueid']=_0x4902a1[_0xa835('0x50')];}}}}catch(_0x4ca169){utils['error'](util[_0xa835('0x3')](_0xa835('0x4e'),_0x4902a1[_0xa835('0x4f')]),_0x4ca169);}};exports[_0xa835('0x62')]=function(_0x4f9ace){try{if(!_[_0xa835('0x19')](queues[_0x4f9ace[_0xa835('0x4')]])){utils['debug'](util[_0xa835('0x3')](_0xa835('0x63'),_0x4f9ace['uniqueid']),_0x4f9ace);queues[_0x4f9ace[_0xa835('0x4')]][_0xa835('0x64')]=utils[_0xa835('0x16')]();utils[_0xa835('0x2')](util[_0xa835('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x4f9ace[_0xa835('0x4')],queues[_0x4f9ace[_0xa835('0x4')]]['name'],queues[_0x4f9ace['uniqueid']]['musiconholdstartAt']));}}catch(_0x590198){utils[_0xa835('0x17')](util['format'](_0xa835('0x63'),_0x4f9ace[_0xa835('0x4')]),_0x590198);}};exports[_0xa835('0x65')]=function(_0xfe2db1){try{if(!_[_0xa835('0x19')](queues[_0xfe2db1[_0xa835('0x4')]])){if(!_['isNil'](queues[_0xfe2db1[_0xa835('0x4')]][_0xa835('0x64')])){utils['debug'](util[_0xa835('0x3')]('[%s][queues][musiconholdstop]',_0xfe2db1['uniqueid']),_0xfe2db1);queues[_0xfe2db1[_0xa835('0x4')]][_0xa835('0x5a')]+=utils[_0xa835('0x36')](utils[_0xa835('0x16')](),queues[_0xfe2db1[_0xa835('0x4')]][_0xa835('0x64')]);utils['info'](util['format'](_0xa835('0x66'),_0xfe2db1['uniqueid'],queues[_0xfe2db1['uniqueid']][_0xa835('0x20')],queues[_0xfe2db1[_0xa835('0x4')]]['mohtime']));delete queues[_0xfe2db1[_0xa835('0x4')]]['musiconholdstartAt'];}}}catch(_0x3faba2){utils[_0xa835('0x17')](util[_0xa835('0x3')](_0xa835('0x67'),_0xfe2db1[_0xa835('0x4')]),_0x3faba2);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 8b8c6d5..59bf3d1 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 _0x0ca8=['push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','context','exten','channel','error','[%s][recordings][newchannel]','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','varset','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','.WAV','find','monitors'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x0ca8,0x16e));var _0x80ca=function(_0x2111b5,_0x4f8465){_0x2111b5=_0x2111b5-0x0;var _0x12fa88=_0x0ca8[_0x2111b5];return _0x12fa88;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x80ca('0x0'));var transfers=require(_0x80ca('0x1'));var recordings={};function writeDB(_0x18d11f){var _0x1fa536;utils[_0x80ca('0x2')](util[_0x80ca('0x3')](_0x80ca('0x4'),_0x18d11f[_0x80ca('0x5')]));if(transfers[_0x80ca('0x6')][_0x18d11f[_0x80ca('0x5')]]){_0x1fa536=_0x18d11f[_0x80ca('0x5')];_0x18d11f[_0x80ca('0x5')]=transfers[_0x80ca('0x6')][_0x18d11f[_0x80ca('0x5')]][_0x80ca('0x7')];}if(_0x18d11f[_0x80ca('0x8')]){utils['getUserByInternal'](_0x18d11f['accountcode'])['then'](function(_0x432edd){if(_0x432edd){_0x18d11f[_0x80ca('0x9')]=_0x432edd[_0x80ca('0xa')];_0x18d11f[_0x80ca('0xb')]=_0x432edd['id'];}utils[_0x80ca('0xc')](_0x80ca('0xd'),_0x18d11f);});}else{utils[_0x80ca('0xc')](_0x80ca('0xd'),_0x18d11f);}if(_0x1fa536)delete transfers['blinds'][_0x1fa536];}exports[_0x80ca('0xe')]=function(_0x4f4e06){try{utils[_0x80ca('0xf')](util[_0x80ca('0x3')]('[%s][recordings][newchannel]',_0x4f4e06[_0x80ca('0x5')]),_0x4f4e06);if(_0x4f4e06['uniqueid']==_0x4f4e06['linkedid']){utils['info'](util[_0x80ca('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x4f4e06[_0x80ca('0x5')],_0x4f4e06[_0x80ca('0x10')],_0x4f4e06[_0x80ca('0x11')]));recordings[_0x4f4e06['uniqueid']]={'uniqueid':_0x4f4e06[_0x80ca('0x5')],'accountcode':_0x4f4e06['accountcode'],'exten':_0x4f4e06['exten'],'context':_0x4f4e06[_0x80ca('0x10')],'channel':_0x4f4e06[_0x80ca('0x12')],'monitors':[]};}}catch(_0x80da9b){utils[_0x80ca('0x13')](util[_0x80ca('0x3')](_0x80ca('0x14'),_0x4f4e06[_0x80ca('0x5')]),_0x80da9b);}};exports['newstate']=function(_0x5928c8){try{utils['debug'](util['format'](_0x80ca('0x15'),_0x5928c8['uniqueid']),_0x5928c8);if(!_[_0x80ca('0x16')](recordings[_0x5928c8[_0x80ca('0x5')]])&&_0x5928c8[_0x80ca('0x17')]==0x6){utils[_0x80ca('0x2')](util[_0x80ca('0x3')](_0x80ca('0x18'),_0x5928c8[_0x80ca('0x5')],_0x5928c8[_0x80ca('0x10')],_0x5928c8[_0x80ca('0x12')]));}else if(!_['isNil'](recordings[_0x5928c8[_0x80ca('0x19')]])&&_0x5928c8[_0x80ca('0x17')]==0x6&&_0x5928c8[_0x80ca('0x10')]!='transfer'){utils[_0x80ca('0x2')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5928c8[_0x80ca('0x5')],_0x5928c8[_0x80ca('0x19')],_0x5928c8[_0x80ca('0x10')],_0x5928c8['channel']));recordings[_0x5928c8[_0x80ca('0x19')]][_0x80ca('0x8')]=_0x5928c8[_0x80ca('0x8')];}}catch(_0x18b0b7){utils[_0x80ca('0x13')](util['format'](_0x80ca('0x15'),_0x5928c8[_0x80ca('0x5')]),_0x18b0b7);}};exports[_0x80ca('0x1a')]=function(_0x553fa4){try{if(!_[_0x80ca('0x16')](_0x553fa4[_0x80ca('0x1b')])&&!_[_0x80ca('0x16')](_0x553fa4[_0x80ca('0x1b')][_0x80ca('0x1c')])){utils[_0x80ca('0xf')](util[_0x80ca('0x3')](_0x80ca('0x1d'),_0x553fa4[_0x80ca('0x5')]),_0x553fa4);utils[_0x80ca('0x2')](util[_0x80ca('0x3')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x553fa4[_0x80ca('0x5')],_0x553fa4[_0x80ca('0x1b')],_0x553fa4[_0x80ca('0x1e')]));if(_[_0x80ca('0x1f')](_0x553fa4[_0x80ca('0x1e')],_0x80ca('0x20'))){_0x553fa4[_0x80ca('0x1e')]=_0x553fa4[_0x80ca('0x1e')]['replace'](_0x80ca('0x20'),_0x80ca('0x21'));}if(recordings[_0x553fa4['linkedid']]){var _0x5220bd=_[_0x80ca('0x22')](recordings[_0x553fa4[_0x80ca('0x19')]][_0x80ca('0x23')],{'value':_0x553fa4[_0x80ca('0x1e')]});if(_[_0x80ca('0x16')](_0x5220bd)){recordings[_0x553fa4['linkedid']][_0x80ca('0x23')][_0x80ca('0x24')]({'value':_0x553fa4[_0x80ca('0x1e')]});}}}}catch(_0xb681fe){utils[_0x80ca('0x13')](util[_0x80ca('0x3')](_0x80ca('0x1d'),_0x553fa4[_0x80ca('0x5')]),_0xb681fe);}};exports[_0x80ca('0x25')]=function(_0x39765b){try{if(!_[_0x80ca('0x16')](recordings[_0x39765b[_0x80ca('0x5')]])){utils[_0x80ca('0xf')](util[_0x80ca('0x3')](_0x80ca('0x26'),_0x39765b[_0x80ca('0x5')]),_0x39765b);utils[_0x80ca('0x2')](util[_0x80ca('0x3')](_0x80ca('0x27'),_0x39765b['uniqueid'],_0x39765b['calleridnum'],_0x39765b[_0x80ca('0x28')],_0x39765b[_0x80ca('0x29')]));recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x2a')]=_0x39765b[_0x80ca('0x2a')];recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x28')]=_0x39765b[_0x80ca('0x28')];recordings[_0x39765b['uniqueid']][_0x80ca('0x2b')]=_0x39765b[_0x80ca('0x2b')];recordings[_0x39765b['uniqueid']][_0x80ca('0x2c')]=_0x39765b['connectedlinename'];if(recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x2d')]==_0x80ca('0x2e')&&recordings[_0x39765b[_0x80ca('0x5')]]['accountcode']){recordings[_0x39765b['uniqueid']]['connectedlinenum']=recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x8')];recordings[_0x39765b[_0x80ca('0x5')]]['connectedlinename']='';}recordings[_0x39765b[_0x80ca('0x5')]][_0x80ca('0x23')]['forEach'](function(_0x46da01){var _0x1df277=_['clone'](recordings[_0x39765b['uniqueid']]);_0x1df277['value']=_0x46da01['value'];writeDB(_0x1df277);});delete recordings[_0x39765b[_0x80ca('0x5')]];}}catch(_0x1c70fc){utils[_0x80ca('0x13')](util[_0x80ca('0x3')](_0x80ca('0x26'),_0x39765b[_0x80ca('0x5')]),_0x1c70fc);}};exports[_0x80ca('0x2f')]=function(_0x32fdec){try{if(!_['isNil'](recordings[_0x32fdec['uniqueid']])){utils['debug'](util[_0x80ca('0x3')]('[%s][recordings][newexten]',_0x32fdec[_0x80ca('0x5')]),_0x32fdec);utils[_0x80ca('0x2')](util['format'](_0x80ca('0x30'),_0x32fdec[_0x80ca('0x5')],_0x32fdec[_0x80ca('0x31')],_0x32fdec[_0x80ca('0x32')]));if(_0x32fdec['application'][_0x80ca('0x33')]()==_0x80ca('0x34')&&_[_0x80ca('0x35')](_0x32fdec[_0x80ca('0x32')]['toLowerCase'](),_0x80ca('0x36'))){var _0x51a438=_0x32fdec[_0x80ca('0x32')][_0x80ca('0x37')]('=');var _0x3fad18=_0x51a438[0x0][_0x80ca('0x38')](_0x51a438[0x0]['lastIndexOf']('(')+0x1,_0x51a438[0x0]['lastIndexOf'](')'));var _0x392322=_0x51a438[0x1];recordings[_0x32fdec[_0x80ca('0x5')]][_0x3fad18]=_0x392322;}}}catch(_0xb20fbe){utils[_0x80ca('0x13')](util['format']('[%s][recordings][newexten]',_0x32fdec[_0x80ca('0x5')]),_0xb20fbe);}};exports[_0x80ca('0x39')]=function(_0x22bbbc){try{if(!_[_0x80ca('0x16')](recordings[_0x22bbbc[_0x80ca('0x5')]])){utils[_0x80ca('0xf')](util[_0x80ca('0x3')](_0x80ca('0x3a'),_0x22bbbc[_0x80ca('0x5')]),_0x22bbbc);utils[_0x80ca('0x2')](util[_0x80ca('0x3')](_0x80ca('0x3b'),_0x22bbbc[_0x80ca('0x5')],_0x22bbbc[_0x80ca('0x3c')]));recordings[_0x22bbbc[_0x80ca('0x5')]][_0x80ca('0x3c')]=_0x22bbbc['queue'];}}catch(_0x38600e){utils[_0x80ca('0x13')](util['format'](_0x80ca('0x3a'),_0x22bbbc[_0x80ca('0x5')]),_0x38600e);}};exports['blindtransfer']=function(_0x486220){try{utils['debug'](util[_0x80ca('0x3')](_0x80ca('0x3d'),_0x486220[_0x80ca('0x5')]),_0x486220);utils[_0x80ca('0x2')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x486220[_0x80ca('0x5')],_0x486220['transferercalleridnum'],_0x486220[_0x80ca('0x3e')],_0x486220[_0x80ca('0x3f')],_0x486220[_0x80ca('0x40')]));if(recordings[_0x486220[_0x80ca('0x41')]]&&transfers['blinds'][_0x486220[_0x80ca('0x41')]]){transfers[_0x80ca('0x6')][_0x486220[_0x80ca('0x41')]][_0x80ca('0x42')]=!![];}}catch(_0xa1a17d){utils['error'](util['format'](_0x80ca('0x3d'),_0x486220[_0x80ca('0x5')]),_0xa1a17d);}}; \ No newline at end of file +var _0xdfc6=['name','UserId','CreateVoiceRecording','request','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername'];(function(_0x54c65a,_0xa415d8){var _0x3a39ec=function(_0x35c0cf){while(--_0x35c0cf){_0x54c65a['push'](_0x54c65a['shift']());}};_0x3a39ec(++_0xa415d8);}(_0xdfc6,0x117));var _0x6dfc=function(_0x59cf63,_0x1094e7){_0x59cf63=_0x59cf63-0x0;var _0x3ad016=_0xdfc6[_0x59cf63];return _0x3ad016;};'use strict';var _=require(_0x6dfc('0x0'));var util=require('util');var utils=require(_0x6dfc('0x1'));var transfers=require(_0x6dfc('0x2'));var recordings={};function writeDB(_0x39c1cc){var _0x49f1a3;utils[_0x6dfc('0x3')](util[_0x6dfc('0x4')](_0x6dfc('0x5'),_0x39c1cc[_0x6dfc('0x6')]));if(transfers['blinds'][_0x39c1cc['uniqueid']]){_0x49f1a3=_0x39c1cc['uniqueid'];_0x39c1cc[_0x6dfc('0x6')]=transfers[_0x6dfc('0x7')][_0x39c1cc[_0x6dfc('0x6')]][_0x6dfc('0x8')];}if(_0x39c1cc[_0x6dfc('0x9')]){utils[_0x6dfc('0xa')](_0x39c1cc[_0x6dfc('0x9')])[_0x6dfc('0xb')](function(_0x4468b0){if(_0x4468b0){_0x39c1cc[_0x6dfc('0xc')]=_0x4468b0[_0x6dfc('0xd')];_0x39c1cc[_0x6dfc('0xe')]=_0x4468b0['id'];}utils['request'](_0x6dfc('0xf'),_0x39c1cc);});}else{utils[_0x6dfc('0x10')]('CreateVoiceRecording',_0x39c1cc);}if(_0x49f1a3)delete transfers[_0x6dfc('0x7')][_0x49f1a3];}exports[_0x6dfc('0x11')]=function(_0x3269c5){try{utils['debug'](util[_0x6dfc('0x4')](_0x6dfc('0x12'),_0x3269c5[_0x6dfc('0x6')]),_0x3269c5);if(_0x3269c5[_0x6dfc('0x6')]==_0x3269c5[_0x6dfc('0x13')]){utils[_0x6dfc('0x3')](util[_0x6dfc('0x4')](_0x6dfc('0x14'),_0x3269c5['uniqueid'],_0x3269c5[_0x6dfc('0x15')],_0x3269c5[_0x6dfc('0x16')]));recordings[_0x3269c5['uniqueid']]={'uniqueid':_0x3269c5[_0x6dfc('0x6')],'accountcode':_0x3269c5['accountcode'],'exten':_0x3269c5['exten'],'context':_0x3269c5['context'],'channel':_0x3269c5[_0x6dfc('0x17')],'monitors':[]};}}catch(_0x3195c5){utils[_0x6dfc('0x18')](util[_0x6dfc('0x4')]('[%s][recordings][newchannel]',_0x3269c5[_0x6dfc('0x6')]),_0x3195c5);}};exports[_0x6dfc('0x19')]=function(_0x5be1a0){try{utils[_0x6dfc('0x1a')](util['format'](_0x6dfc('0x1b'),_0x5be1a0[_0x6dfc('0x6')]),_0x5be1a0);if(!_[_0x6dfc('0x1c')](recordings[_0x5be1a0[_0x6dfc('0x6')]])&&_0x5be1a0[_0x6dfc('0x1d')]==0x6){utils['info'](util[_0x6dfc('0x4')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x5be1a0[_0x6dfc('0x6')],_0x5be1a0['context'],_0x5be1a0[_0x6dfc('0x17')]));}else if(!_[_0x6dfc('0x1c')](recordings[_0x5be1a0[_0x6dfc('0x13')]])&&_0x5be1a0['channelstate']==0x6&&_0x5be1a0['context']!=_0x6dfc('0x1e')){utils[_0x6dfc('0x3')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5be1a0[_0x6dfc('0x6')],_0x5be1a0[_0x6dfc('0x13')],_0x5be1a0[_0x6dfc('0x15')],_0x5be1a0['channel']));recordings[_0x5be1a0[_0x6dfc('0x13')]][_0x6dfc('0x9')]=_0x5be1a0[_0x6dfc('0x9')];}}catch(_0x2e4c26){utils['error'](util['format']('[%s][recordings][newstate]',_0x5be1a0[_0x6dfc('0x6')]),_0x2e4c26);}};exports[_0x6dfc('0x1f')]=function(_0x5af176){try{if(!_[_0x6dfc('0x1c')](_0x5af176[_0x6dfc('0x20')])&&!_[_0x6dfc('0x1c')](_0x5af176['variable'][_0x6dfc('0x21')])){utils['debug'](util[_0x6dfc('0x4')](_0x6dfc('0x22'),_0x5af176[_0x6dfc('0x6')]),_0x5af176);utils[_0x6dfc('0x3')](util[_0x6dfc('0x4')](_0x6dfc('0x23'),_0x5af176[_0x6dfc('0x6')],_0x5af176[_0x6dfc('0x20')],_0x5af176[_0x6dfc('0x24')]));if(_[_0x6dfc('0x25')](_0x5af176[_0x6dfc('0x24')],_0x6dfc('0x26'))){_0x5af176[_0x6dfc('0x24')]=_0x5af176[_0x6dfc('0x24')][_0x6dfc('0x27')]('.wav49',_0x6dfc('0x28'));}if(recordings[_0x5af176['linkedid']]){var _0x4b1405=_[_0x6dfc('0x29')](recordings[_0x5af176['linkedid']][_0x6dfc('0x2a')],{'value':_0x5af176[_0x6dfc('0x24')]});if(_['isNil'](_0x4b1405)){recordings[_0x5af176['linkedid']]['monitors'][_0x6dfc('0x2b')]({'value':_0x5af176['value']});}}}}catch(_0x205e8f){utils[_0x6dfc('0x18')](util['format'](_0x6dfc('0x22'),_0x5af176['uniqueid']),_0x205e8f);}};exports[_0x6dfc('0x2c')]=function(_0x12e30b){try{if(!_[_0x6dfc('0x1c')](recordings[_0x12e30b[_0x6dfc('0x6')]])){utils[_0x6dfc('0x1a')](util[_0x6dfc('0x4')](_0x6dfc('0x2d'),_0x12e30b[_0x6dfc('0x6')]),_0x12e30b);utils[_0x6dfc('0x3')](util['format'](_0x6dfc('0x2e'),_0x12e30b[_0x6dfc('0x6')],_0x12e30b[_0x6dfc('0x2f')],_0x12e30b['calleridname'],_0x12e30b[_0x6dfc('0x30')]));recordings[_0x12e30b['uniqueid']][_0x6dfc('0x2f')]=_0x12e30b[_0x6dfc('0x2f')];recordings[_0x12e30b['uniqueid']][_0x6dfc('0x31')]=_0x12e30b[_0x6dfc('0x31')];recordings[_0x12e30b[_0x6dfc('0x6')]]['connectedlinenum']=_0x12e30b[_0x6dfc('0x32')];recordings[_0x12e30b[_0x6dfc('0x6')]][_0x6dfc('0x33')]=_0x12e30b[_0x6dfc('0x33')];if(recordings[_0x12e30b[_0x6dfc('0x6')]]['type']==_0x6dfc('0x34')&&recordings[_0x12e30b[_0x6dfc('0x6')]][_0x6dfc('0x9')]){recordings[_0x12e30b['uniqueid']][_0x6dfc('0x32')]=recordings[_0x12e30b[_0x6dfc('0x6')]]['accountcode'];recordings[_0x12e30b['uniqueid']][_0x6dfc('0x33')]='';}recordings[_0x12e30b[_0x6dfc('0x6')]][_0x6dfc('0x2a')][_0x6dfc('0x35')](function(_0x567946){var _0x4b116a=_[_0x6dfc('0x36')](recordings[_0x12e30b['uniqueid']]);_0x4b116a[_0x6dfc('0x24')]=_0x567946[_0x6dfc('0x24')];writeDB(_0x4b116a);});delete recordings[_0x12e30b[_0x6dfc('0x6')]];}}catch(_0x1a59f1){utils[_0x6dfc('0x18')](util['format']('[%s][recordings][hangup]',_0x12e30b[_0x6dfc('0x6')]),_0x1a59f1);}};exports[_0x6dfc('0x37')]=function(_0x5c057a){try{if(!_['isNil'](recordings[_0x5c057a[_0x6dfc('0x6')]])){utils['debug'](util[_0x6dfc('0x4')]('[%s][recordings][newexten]',_0x5c057a[_0x6dfc('0x6')]),_0x5c057a);utils[_0x6dfc('0x3')](util[_0x6dfc('0x4')](_0x6dfc('0x38'),_0x5c057a[_0x6dfc('0x6')],_0x5c057a['application'],_0x5c057a[_0x6dfc('0x39')]));if(_0x5c057a['application'][_0x6dfc('0x3a')]()=='set'&&_['startsWith'](_0x5c057a[_0x6dfc('0x39')][_0x6dfc('0x3a')](),_0x6dfc('0x3b'))){var _0x3a22e8=_0x5c057a['appdata']['split']('=');var _0x15bcd7=_0x3a22e8[0x0][_0x6dfc('0x3c')](_0x3a22e8[0x0]['lastIndexOf']('(')+0x1,_0x3a22e8[0x0][_0x6dfc('0x3d')](')'));var _0x2791e7=_0x3a22e8[0x1];recordings[_0x5c057a[_0x6dfc('0x6')]][_0x15bcd7]=_0x2791e7;}}}catch(_0x27c115){utils[_0x6dfc('0x18')](util[_0x6dfc('0x4')]('[%s][recordings][newexten]',_0x5c057a[_0x6dfc('0x6')]),_0x27c115);}};exports[_0x6dfc('0x3e')]=function(_0x4c1bd7){try{if(!_[_0x6dfc('0x1c')](recordings[_0x4c1bd7[_0x6dfc('0x6')]])){utils[_0x6dfc('0x1a')](util[_0x6dfc('0x4')](_0x6dfc('0x3f'),_0x4c1bd7[_0x6dfc('0x6')]),_0x4c1bd7);utils['info'](util[_0x6dfc('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4c1bd7['uniqueid'],_0x4c1bd7['queue']));recordings[_0x4c1bd7[_0x6dfc('0x6')]][_0x6dfc('0x40')]=_0x4c1bd7['queue'];}}catch(_0x44a638){utils['error'](util[_0x6dfc('0x4')](_0x6dfc('0x3f'),_0x4c1bd7['uniqueid']),_0x44a638);}};exports[_0x6dfc('0x41')]=function(_0x5d220a){try{utils['debug'](util[_0x6dfc('0x4')](_0x6dfc('0x42'),_0x5d220a[_0x6dfc('0x6')]),_0x5d220a);utils[_0x6dfc('0x3')](util[_0x6dfc('0x4')](_0x6dfc('0x43'),_0x5d220a[_0x6dfc('0x6')],_0x5d220a['transferercalleridnum'],_0x5d220a[_0x6dfc('0x44')],_0x5d220a[_0x6dfc('0x45')],_0x5d220a[_0x6dfc('0x46')]));if(recordings[_0x5d220a[_0x6dfc('0x47')]]&&transfers['blinds'][_0x5d220a[_0x6dfc('0x47')]]){transfers[_0x6dfc('0x7')][_0x5d220a[_0x6dfc('0x47')]][_0x6dfc('0x48')]=!![];}}catch(_0x458b65){utils[_0x6dfc('0x18')](util['format'](_0x6dfc('0x42'),_0x5d220a[_0x6dfc('0x6')]),_0x458b65);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 479d8dc..62819ad 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 _0x62d7=['origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransfererexten','attended','transfereechannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type'];(function(_0x1d4c1c,_0x120105){var _0x2e3058=function(_0x3ffe73){while(--_0x3ffe73){_0x1d4c1c['push'](_0x1d4c1c['shift']());}};_0x2e3058(++_0x120105);}(_0x62d7,0x112));var _0x762d=function(_0x1e2143,_0x39294f){_0x1e2143=_0x1e2143-0x0;var _0x35b68c=_0x62d7[_0x1e2143];return _0x35b68c;};'use strict';var _=require(_0x762d('0x0'));var util=require('util');var utils=require(_0x762d('0x1'));function writeDB(_0x16e5a0){utils[_0x762d('0x2')](util[_0x762d('0x3')](_0x762d('0x4'),_0x16e5a0[_0x762d('0x5')]==='attended'?_0x16e5a0[_0x762d('0x6')]:_0x16e5a0[_0x762d('0x7')],_0x16e5a0[_0x762d('0x5')]));utils[_0x762d('0x8')](_0x762d('0x9'),_0x16e5a0);}exports[_0x762d('0xa')]={};exports[_0x762d('0xb')]=function(_0x25a727){try{utils[_0x762d('0xc')](util[_0x762d('0x3')]('[%s][transfers][blindtransfer]',_0x25a727[_0x762d('0x7')]),_0x25a727);utils[_0x762d('0x2')](util[_0x762d('0x3')](_0x762d('0xd'),_0x25a727[_0x762d('0x7')],_0x25a727['transferercalleridnum'],_0x25a727[_0x762d('0xe')],_0x25a727[_0x762d('0xf')],_0x25a727['transfereecalleridname']));_0x25a727[_0x762d('0x5')]=_0x762d('0x10');exports[_0x762d('0xa')][_0x25a727['transfereruniqueid']]=_0x25a727;writeDB(_0x25a727);}catch(_0x55801d){utils[_0x762d('0x11')](util[_0x762d('0x3')](_0x762d('0x12'),_0x25a727[_0x762d('0x7')]),_0x55801d);}};exports[_0x762d('0x13')]=function(_0xf2c205){try{utils[_0x762d('0xc')](util[_0x762d('0x3')](_0x762d('0x14'),_0xf2c205['origtransfereruniqueid']),_0xf2c205);utils['info'](util[_0x762d('0x3')](_0x762d('0x15'),_0xf2c205['origtransfereruniqueid'],_0xf2c205[_0x762d('0x16')],_0xf2c205[_0x762d('0x17')],_0xf2c205[_0x762d('0x18')],_0xf2c205[_0x762d('0x19')]));_0xf2c205=_[_0x762d('0x1a')](_0xf2c205,{'transfererchannel':_0xf2c205[_0x762d('0x1b')],'transferercalleridnum':_0xf2c205[_0x762d('0x16')],'transferercalleridname':_0xf2c205[_0x762d('0x17')],'transfererconnectedlinenum':_0xf2c205['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0xf2c205['secondtransfererconnectedlinename'],'transfereraccountcode':_0xf2c205[_0x762d('0x1c')],'transferercontext':_0xf2c205[_0x762d('0x1d')],'transfererexten':_0xf2c205['secondtransfererexten'],'transfererlinkedid':_0xf2c205[_0x762d('0x1e')],'context':_0xf2c205['origtransferercontext'],'extension':_0xf2c205[_0x762d('0x1f')],'type':_0x762d('0x20')});if(_['isNil'](_0xf2c205[_0x762d('0x21')])){_0xf2c205=_['assign'](_0xf2c205,{'transfereechannel':_0xf2c205['transfertargetchannel'],'transfereecalleridnum':_0xf2c205[_0x762d('0x18')],'transfereecalleridname':_0xf2c205[_0x762d('0x19')],'transfereeconnectedlinenum':_0xf2c205[_0x762d('0x22')],'transfereeconnectedlinename':_0xf2c205[_0x762d('0x23')],'transfereeaccountcode':_0xf2c205[_0x762d('0x24')],'transfereecontext':_0xf2c205[_0x762d('0x25')],'transfereeexten':_0xf2c205[_0x762d('0x26')],'transfereelinkedid':_0xf2c205[_0x762d('0x27')]});}writeDB(_0xf2c205);}catch(_0x55ce12){utils['error'](util[_0x762d('0x3')](_0x762d('0x14'),_0xf2c205[_0x762d('0x6')]),_0x55ce12);}}; \ No newline at end of file +var _0x2e6b=['secondtransferercontext','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','lodash','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','blindtransfer','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0x2e6b,0xe9));var _0xb2e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2e6b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb2e6('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x566494){utils[_0xb2e6('0x1')](util[_0xb2e6('0x2')](_0xb2e6('0x3'),_0x566494[_0xb2e6('0x4')]===_0xb2e6('0x5')?_0x566494[_0xb2e6('0x6')]:_0x566494[_0xb2e6('0x7')],_0x566494[_0xb2e6('0x4')]));utils['request']('CreateVoiceTransferReport',_0x566494);}exports['blinds']={};exports[_0xb2e6('0x8')]=function(_0x12c9ae){try{utils['debug'](util['format']('[%s][transfers][blindtransfer]',_0x12c9ae[_0xb2e6('0x7')]),_0x12c9ae);utils[_0xb2e6('0x1')](util[_0xb2e6('0x2')](_0xb2e6('0x9'),_0x12c9ae[_0xb2e6('0x7')],_0x12c9ae[_0xb2e6('0xa')],_0x12c9ae[_0xb2e6('0xb')],_0x12c9ae[_0xb2e6('0xc')],_0x12c9ae['transfereecalleridname']));_0x12c9ae[_0xb2e6('0x4')]=_0xb2e6('0xd');exports['blinds'][_0x12c9ae[_0xb2e6('0xe')]]=_0x12c9ae;writeDB(_0x12c9ae);}catch(_0x355c3b){utils[_0xb2e6('0xf')](util[_0xb2e6('0x2')]('[%s][transfers][blindtransfer]',_0x12c9ae[_0xb2e6('0x7')]),_0x355c3b);}};exports['attendedtransfer']=function(_0x7c6d03){try{utils[_0xb2e6('0x10')](util[_0xb2e6('0x2')]('[%s][transfers][attendedtransfer]',_0x7c6d03[_0xb2e6('0x6')]),_0x7c6d03);utils[_0xb2e6('0x1')](util[_0xb2e6('0x2')](_0xb2e6('0x11'),_0x7c6d03[_0xb2e6('0x6')],_0x7c6d03[_0xb2e6('0x12')],_0x7c6d03['origtransferercalleridname'],_0x7c6d03['transfertargetcalleridnum'],_0x7c6d03[_0xb2e6('0x13')]));_0x7c6d03=_[_0xb2e6('0x14')](_0x7c6d03,{'transfererchannel':_0x7c6d03[_0xb2e6('0x15')],'transferercalleridnum':_0x7c6d03['origtransferercalleridnum'],'transferercalleridname':_0x7c6d03[_0xb2e6('0x16')],'transfererconnectedlinenum':_0x7c6d03[_0xb2e6('0x17')],'transfererconnectedlinename':_0x7c6d03[_0xb2e6('0x18')],'transfereraccountcode':_0x7c6d03[_0xb2e6('0x19')],'transferercontext':_0x7c6d03[_0xb2e6('0x1a')],'transfererexten':_0x7c6d03['secondtransfererexten'],'transfererlinkedid':_0x7c6d03[_0xb2e6('0x1b')],'context':_0x7c6d03['origtransferercontext'],'extension':_0x7c6d03[_0xb2e6('0x1c')],'type':'attended'});if(_[_0xb2e6('0x1d')](_0x7c6d03[_0xb2e6('0x1e')])){_0x7c6d03=_[_0xb2e6('0x14')](_0x7c6d03,{'transfereechannel':_0x7c6d03[_0xb2e6('0x1f')],'transfereecalleridnum':_0x7c6d03['transfertargetcalleridnum'],'transfereecalleridname':_0x7c6d03[_0xb2e6('0x13')],'transfereeconnectedlinenum':_0x7c6d03[_0xb2e6('0x20')],'transfereeconnectedlinename':_0x7c6d03[_0xb2e6('0x21')],'transfereeaccountcode':_0x7c6d03[_0xb2e6('0x22')],'transfereecontext':_0x7c6d03['transfertargetcontext'],'transfereeexten':_0x7c6d03[_0xb2e6('0x23')],'transfereelinkedid':_0x7c6d03[_0xb2e6('0x24')]});}writeDB(_0x7c6d03);}catch(_0x51d8c7){utils[_0xb2e6('0xf')](util['format']('[%s][transfers][attendedtransfer]',_0x7c6d03[_0xb2e6('0x6')]),_0x51d8c7);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 450c7b0..fdbb99d 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 _0x3d30=['getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diff','sumTime','now','isAfter','isBefore','moment','client','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','getUserByName','[utils][getUserByName]\x20name:%s\x20%s'];(function(_0x5ad0d7,_0x2645f8){var _0xd83bd=function(_0x33d3bd){while(--_0x33d3bd){_0x5ad0d7['push'](_0x5ad0d7['shift']());}};_0xd83bd(++_0x2645f8);}(_0x3d30,0x6a));var _0x03d3=function(_0x179754,_0x3e39d6){_0x179754=_0x179754-0x0;var _0xc2df79=_0x3d30[_0x179754];return _0xc2df79;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0x03d3('0x0'));var util=require('util');var client=jayson[_0x03d3('0x1')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0x03d3('0x2'));exports['info']=function(_0xa97495,_0x1c79d0){logger[_0x03d3('0x3')](_0xa97495,_0x1c79d0?util[_0x03d3('0x4')](_0x1c79d0,{'showHidden':![],'depth':null}):'');};exports[_0x03d3('0x5')]=function(_0x306f6d,_0x52cec0){logger[_0x03d3('0x5')](_0x306f6d,_0x52cec0?util[_0x03d3('0x4')](_0x52cec0,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x23b0c1,_0xfbee39){logger[_0x03d3('0x6')](_0x23b0c1,_0xfbee39?util[_0x03d3('0x4')](_0xfbee39,{'showHidden':![],'depth':null}):'');};exports[_0x03d3('0x7')]=function(_0x11f4a3,_0x3679a5){return client[_0x03d3('0x7')](_0x11f4a3,{'body':_0x3679a5})[_0x03d3('0x8')](function(_0x5d62bc){logger['debug']('[utils][request]\x20name:%s',_0x11f4a3,_0x5d62bc?util[_0x03d3('0x4')](_0x5d62bc,{'showHidden':![],'depth':null}):'');})[_0x03d3('0x9')](function(_0x373a23){logger[_0x03d3('0x6')](_0x03d3('0xa'),_0x11f4a3,_0x373a23?util[_0x03d3('0x4')](_0x373a23,{'showHidden':![],'depth':null}):'');});};function getUser(_0x546d20){return client[_0x03d3('0x7')](_0x03d3('0xb'),{'options':{'raw':!![],'attributes':['id',_0x03d3('0xc'),_0x03d3('0xd'),'interface'],'where':_0x546d20,'limit':0x1}})[_0x03d3('0x8')](function(_0x239ff6){logger['debug'](_0x03d3('0xe'),JSON[_0x03d3('0xf')](_0x546d20),_0x239ff6?util[_0x03d3('0x4')](_0x239ff6,{'showHidden':![],'depth':null}):'');return _0x239ff6[_0x03d3('0x10')]['length']?_0x239ff6[_0x03d3('0x10')][0x0]:null;});}exports[_0x03d3('0x11')]=function(_0x43407d){return new BPromise(function(_0x8abc14,_0x4c72fe){if(_0x43407d){return getUser({'internal':_0x43407d})[_0x03d3('0x8')](function(_0x997721){logger['info'](_0x03d3('0x12'),_0x43407d,_0x997721?_0x03d3('0x13'):'notfound');return _0x8abc14(_0x997721);})['catch'](function(_0x313b5c){logger[_0x03d3('0x6')](_0x03d3('0x14'),_0x313b5c?util[_0x03d3('0x4')](_0x313b5c,{'showHidden':![],'depth':null}):'');return _0x8abc14(null);});}return _0x8abc14(null);});};exports[_0x03d3('0x15')]=function(_0x533d74){return new BPromise(function(_0x422070,_0xc20afa){if(_0x533d74){return getUser({'interface':_0x533d74})[_0x03d3('0x8')](function(_0x10060b){logger[_0x03d3('0x3')](_0x03d3('0x16'),_0x533d74,_0x10060b?_0x03d3('0x13'):_0x03d3('0x17'));return _0x422070(_0x10060b);})[_0x03d3('0x9')](function(_0x19446f){logger[_0x03d3('0x6')]('[utils][getUserByInterface]',_0x19446f?util[_0x03d3('0x4')](_0x19446f,{'showHidden':![],'depth':null}):'');return _0x422070(null);});}return _0x422070(null);});};exports[_0x03d3('0x18')]=function(_0xbaefc2){return new BPromise(function(_0x2370ee,_0x2108b4){if(_0xbaefc2){return getUser({'name':_0xbaefc2})[_0x03d3('0x8')](function(_0x439455){logger[_0x03d3('0x3')](_0x03d3('0x19'),_0xbaefc2,_0x439455?_0x03d3('0x13'):_0x03d3('0x17'));return _0x2370ee(_0x439455);})[_0x03d3('0x9')](function(_0x1f768e){logger[_0x03d3('0x6')]('[utils][getUserByName]',_0x1f768e?util[_0x03d3('0x4')](_0x1f768e,{'showHidden':![],'depth':null}):'');return _0x2370ee(null);});}return _0x2370ee(null);});};exports[_0x03d3('0x1a')]=function(_0x380c95){return new BPromise(function(_0x185711,_0x4d1e3f){if(_0x380c95){return client[_0x03d3('0x7')](_0x03d3('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x03d3('0xd'),_0x03d3('0x1c'),_0x03d3('0x1d'),_0x03d3('0x1e')],'where':{'name':_0x380c95},'limit':0x1}})[_0x03d3('0x8')](function(_0x1f71ce){logger[_0x03d3('0x5')]('[utils][getVoiceQueueByName]\x20name:%s',_0x380c95,_0x1f71ce?util[_0x03d3('0x4')](_0x1f71ce,{'showHidden':![],'depth':null}):'');logger[_0x03d3('0x3')](_0x03d3('0x1f'),_0x380c95,_0x1f71ce?_0x03d3('0x13'):_0x03d3('0x17'));return _0x185711(_0x1f71ce[_0x03d3('0x10')][_0x03d3('0x20')]?_0x1f71ce['result'][0x0]:null);})['catch'](function(_0x9f7a44){logger['error'](_0x03d3('0x21'),_0x9f7a44?util[_0x03d3('0x4')](_0x9f7a44,{'showHidden':![],'depth':null}):'');return _0x185711(null);});}return _0x185711(null);});};exports['addTime']=function(_0x17c94c,_0x2c18d6){return moment(_0x17c94c)[_0x03d3('0x22')](_0x2c18d6,_0x03d3('0x23'))[_0x03d3('0x24')](_0x03d3('0x25'));};exports[_0x03d3('0x26')]=function(_0x1d2982,_0x3bb4df){return moment(_0x1d2982)['subtract'](_0x3bb4df,_0x03d3('0x23'))[_0x03d3('0x24')](_0x03d3('0x25'));};exports['diffTime']=function(_0x131284,_0x23fe08){return moment(_0x131284)[_0x03d3('0x27')](moment(_0x23fe08),_0x03d3('0x23'));};exports[_0x03d3('0x28')]=function(_0x3c216c,_0x4b7d95){return parseInt(_0x3c216c,0xa)+parseInt(_0x4b7d95,0xa);};exports[_0x03d3('0x29')]=function(){return moment()[_0x03d3('0x24')](_0x03d3('0x25'));};exports[_0x03d3('0x2a')]=function(_0x85d749,_0x13e657){if(_0x13e657){return moment(_0x85d749)[_0x03d3('0x2a')](_0x13e657);}return!![];};exports[_0x03d3('0x2b')]=function(_0x32c9fd,_0x36bd9a){if(_0x36bd9a){return moment(_0x32c9fd)[_0x03d3('0x2b')](_0x36bd9a);}else if(_0x32c9fd){return!![];}return![];}; \ No newline at end of file +var _0x2e6d=['jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','catch','GetUser','internal','name','interface','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','notfound','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird'];(function(_0xdb00bb,_0xcdcec4){var _0x247c9d=function(_0x328fd5){while(--_0x328fd5){_0xdb00bb['push'](_0xdb00bb['shift']());}};_0x247c9d(++_0xcdcec4);}(_0x2e6d,0x12b));var _0xd2e6=function(_0x4da096,_0x437cfc){_0x4da096=_0x4da096-0x0;var _0x56ef86=_0x2e6d[_0x4da096];return _0x56ef86;};'use strict';var BPromise=require(_0xd2e6('0x0'));var jayson=require(_0xd2e6('0x1'));var moment=require(_0xd2e6('0x2'));var util=require(_0xd2e6('0x3'));var client=jayson[_0xd2e6('0x4')][_0xd2e6('0x5')]({'port':0x2329});var logger=require(_0xd2e6('0x6'))(_0xd2e6('0x7'));exports[_0xd2e6('0x8')]=function(_0x260359,_0x16be85){logger[_0xd2e6('0x8')](_0x260359,_0x16be85?util[_0xd2e6('0x9')](_0x16be85,{'showHidden':![],'depth':null}):'');};exports[_0xd2e6('0xa')]=function(_0x1bc1e4,_0x4f8e40){logger[_0xd2e6('0xa')](_0x1bc1e4,_0x4f8e40?util[_0xd2e6('0x9')](_0x4f8e40,{'showHidden':![],'depth':null}):'');};exports[_0xd2e6('0xb')]=function(_0xc5cc38,_0x2dc82c){logger['error'](_0xc5cc38,_0x2dc82c?util[_0xd2e6('0x9')](_0x2dc82c,{'showHidden':![],'depth':null}):'');};exports[_0xd2e6('0xc')]=function(_0x346c01,_0x131eff){return client[_0xd2e6('0xc')](_0x346c01,{'body':_0x131eff})[_0xd2e6('0xd')](function(_0x3d6a96){logger[_0xd2e6('0xa')]('[utils][request]\x20name:%s',_0x346c01,_0x3d6a96?util[_0xd2e6('0x9')](_0x3d6a96,{'showHidden':![],'depth':null}):'');})[_0xd2e6('0xe')](function(_0x57772d){logger[_0xd2e6('0xb')]('[utils][request]\x20name:%s',_0x346c01,_0x57772d?util[_0xd2e6('0x9')](_0x57772d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x498ae8){return client[_0xd2e6('0xc')](_0xd2e6('0xf'),{'options':{'raw':!![],'attributes':['id',_0xd2e6('0x10'),_0xd2e6('0x11'),_0xd2e6('0x12')],'where':_0x498ae8,'limit':0x1}})[_0xd2e6('0xd')](function(_0x28d30){logger[_0xd2e6('0xa')]('[utils][getUser]\x20where:%s',JSON[_0xd2e6('0x13')](_0x498ae8),_0x28d30?util[_0xd2e6('0x9')](_0x28d30,{'showHidden':![],'depth':null}):'');return _0x28d30[_0xd2e6('0x14')][_0xd2e6('0x15')]?_0x28d30[_0xd2e6('0x14')][0x0]:null;});}exports[_0xd2e6('0x16')]=function(_0x3b1b52){return new BPromise(function(_0x468da5,_0x5087b2){if(_0x3b1b52){return getUser({'internal':_0x3b1b52})['then'](function(_0x368756){logger[_0xd2e6('0x8')](_0xd2e6('0x17'),_0x3b1b52,_0x368756?'found':'notfound');return _0x468da5(_0x368756);})[_0xd2e6('0xe')](function(_0x3b851b){logger[_0xd2e6('0xb')](_0xd2e6('0x18'),_0x3b851b?util[_0xd2e6('0x9')](_0x3b851b,{'showHidden':![],'depth':null}):'');return _0x468da5(null);});}return _0x468da5(null);});};exports[_0xd2e6('0x19')]=function(_0x30b52f){return new BPromise(function(_0x1254f6,_0x1e965e){if(_0x30b52f){return getUser({'interface':_0x30b52f})[_0xd2e6('0xd')](function(_0x2fc657){logger['info'](_0xd2e6('0x1a'),_0x30b52f,_0x2fc657?_0xd2e6('0x1b'):_0xd2e6('0x1c'));return _0x1254f6(_0x2fc657);})[_0xd2e6('0xe')](function(_0x377f1d){logger[_0xd2e6('0xb')](_0xd2e6('0x1d'),_0x377f1d?util[_0xd2e6('0x9')](_0x377f1d,{'showHidden':![],'depth':null}):'');return _0x1254f6(null);});}return _0x1254f6(null);});};exports['getUserByName']=function(_0x380a4a){return new BPromise(function(_0x383ad6,_0x22bb3c){if(_0x380a4a){return getUser({'name':_0x380a4a})['then'](function(_0x3130fd){logger['info'](_0xd2e6('0x1e'),_0x380a4a,_0x3130fd?_0xd2e6('0x1b'):_0xd2e6('0x1c'));return _0x383ad6(_0x3130fd);})[_0xd2e6('0xe')](function(_0x3c04ea){logger[_0xd2e6('0xb')](_0xd2e6('0x1f'),_0x3c04ea?util[_0xd2e6('0x9')](_0x3c04ea,{'showHidden':![],'depth':null}):'');return _0x383ad6(null);});}return _0x383ad6(null);});};exports[_0xd2e6('0x20')]=function(_0x28da9f){return new BPromise(function(_0x428fef,_0x18e3ef){if(_0x28da9f){return client['request'](_0xd2e6('0x21'),{'options':{'raw':!![],'attributes':['id','name',_0xd2e6('0x22'),_0xd2e6('0x23'),_0xd2e6('0x24')],'where':{'name':_0x28da9f},'limit':0x1}})['then'](function(_0x43064b){logger[_0xd2e6('0xa')](_0xd2e6('0x25'),_0x28da9f,_0x43064b?util[_0xd2e6('0x9')](_0x43064b,{'showHidden':![],'depth':null}):'');logger['info']('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x28da9f,_0x43064b?_0xd2e6('0x1b'):_0xd2e6('0x1c'));return _0x428fef(_0x43064b[_0xd2e6('0x14')]['length']?_0x43064b['result'][0x0]:null);})[_0xd2e6('0xe')](function(_0x3771f0){logger[_0xd2e6('0xb')]('[utils][getVoiceQueueByName]',_0x3771f0?util[_0xd2e6('0x9')](_0x3771f0,{'showHidden':![],'depth':null}):'');return _0x428fef(null);});}return _0x428fef(null);});};exports['addTime']=function(_0x23498f,_0x6322c1){return moment(_0x23498f)[_0xd2e6('0x26')](_0x6322c1,_0xd2e6('0x27'))[_0xd2e6('0x28')](_0xd2e6('0x29'));};exports[_0xd2e6('0x2a')]=function(_0xd6f41d,_0x1b13b7){return moment(_0xd6f41d)[_0xd2e6('0x2b')](_0x1b13b7,_0xd2e6('0x27'))[_0xd2e6('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xd2e6('0x2c')]=function(_0x452a51,_0x151cd6){return moment(_0x452a51)[_0xd2e6('0x2d')](moment(_0x151cd6),'seconds');};exports[_0xd2e6('0x2e')]=function(_0x16bcfc,_0x1a8903){return parseInt(_0x16bcfc,0xa)+parseInt(_0x1a8903,0xa);};exports[_0xd2e6('0x2f')]=function(){return moment()[_0xd2e6('0x28')](_0xd2e6('0x29'));};exports[_0xd2e6('0x30')]=function(_0x357376,_0x2d8a46){if(_0x2d8a46){return moment(_0x357376)[_0xd2e6('0x30')](_0x2d8a46);}return!![];};exports[_0xd2e6('0x31')]=function(_0x293d41,_0x31ff28){if(_0x31ff28){return moment(_0x293d41)[_0xd2e6('0x31')](_0x31ff28);}else if(_0x293d41){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 848dac4..88e5b76 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 _0x9807=['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)','url','statusCode','responseTime','other','agent_name','test','setupLoggers','fs-extra','lodash','util','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','client','name','ensureDir','then','catch','user','data','timestamp','api','auth','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s'];(function(_0x161da0,_0x58f82a){var _0x50080f=function(_0xa21049){while(--_0xa21049){_0x161da0['push'](_0x161da0['shift']());}};_0x50080f(++_0x58f82a);}(_0x9807,0x19f));var _0x7980=function(_0x65c597,_0x39e7e0){_0x65c597=_0x65c597-0x0;var _0x1ec368=_0x9807[_0x65c597];return _0x1ec368;};var fs=require(_0x7980('0x0'));var _=require(_0x7980('0x1'));var ewinston=require('express-winston');var path=require('path');var util=require(_0x7980('0x2'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0x7980('0x3'))[_0x7980('0x4')];var maskSensitiveData=require(_0x7980('0x5'))['maskSensitiveData'];function ClientSideLogger(){function _0x4636a5(_0x347cbe){var _0x4aa054=path[_0x7980('0x6')](_0x7980('0x7'),_0x7980('0x8'),_0x7980('0x9'));var _0x20ff64=path[_0x7980('0x6')](_0x7980('0xa'),_0x347cbe['role']+'-'+_0x347cbe[_0x7980('0xb')]);return fs[_0x7980('0xc')](path[_0x7980('0x6')](_0x4aa054,_0x20ff64))[_0x7980('0xd')](function(){var _0x3a698a=fileLogger(_0x7980('0xa'),path[_0x7980('0x6')](_0x4aa054,_0x20ff64));return _0x3a698a;})[_0x7980('0xe')](function(_0x2420b0){throw _0x2420b0;});}this['log']=function(_0x5ea385,_0x2a92a1,_0x1f3a6c,_0x1000d4){return _0x4636a5(_0x5ea385[_0x7980('0xf')])[_0x7980('0xd')](function(_0x2151d7){var _0xff6df3=_0x2151d7[_0x2a92a1];return _0xff6df3;})[_0x7980('0xd')](function(_0x58295b){var _0x17e6f0=_0x5ea385[_0x7980('0xf')]?_0x5ea385[_0x7980('0xf')]['id']:'no-user';var _0xbe14bb=_0x1000d4[_0x7980('0x10')];var _0x1874b6=_0x1000d4[_0x7980('0x11')];var _0x93b6de=new Date(Number(_0x1874b6));return _0x58295b(_0x17e6f0,_0x93b6de,_0x1f3a6c,_0xbe14bb);})[_0x7980('0xe')](function(_0x54715a){fileLogger(_0x7980('0xa'))['error'](_0x54715a);});};}function setupLoggers(_0x42c594){return new Promise(function(_0x4209eb){var _0x1cd749=new ClientSideLogger();var _0x1e5ad4=fileLogger(_0x7980('0x12'));var _0x96023d=fileLogger(_0x7980('0x13'));_0x42c594[_0x7980('0x14')]('client-side-logger',_0x1cd749);_0x42c594[_0x7980('0x15')](ewinston[_0x7980('0x16')]({'winstonInstance':_0x1e5ad4,'meta':![],'statusLevels':!![],'msg':function(_0x138b68,_0x12fd6b){var _0x4a0a37=_0x7980('0x17');if(!_['isEmpty'](_0x138b68[_0x7980('0x18')])){_0x4a0a37+=_0x7980('0x19');var _0x238df6=_0x138b68[_0x7980('0x18')];maskSensitiveData(_0x238df6);}return safeTemplate(util[_0x7980('0x1a')](_0x4a0a37,_0x138b68[_0x7980('0x1b')],_0x138b68['headers']['x-forwarded-for']?_0x138b68[_0x7980('0x1c')][_0x7980('0x1d')]:_0x138b68[_0x7980('0x1e')][_0x7980('0x1f')]||_0x138b68['ip'],_0x138b68['url'],_0x12fd6b['statusCode'],_0x12fd6b['responseTime'],_0x138b68[_0x7980('0xf')]?_0x138b68[_0x7980('0xf')]['id']:null,_0x138b68[_0x7980('0xf')]?_0x138b68['user'][_0x7980('0xb')]:null,_0x138b68['user']?_0x138b68['user'][_0x7980('0x20')]:null,_0x238df6?util[_0x7980('0x21')](_0x238df6,![],null):''));}}));_0x42c594[_0x7980('0x15')](ewinston[_0x7980('0x16')]({'winstonInstance':_0x96023d,'meta':![],'statusLevels':!![],'msg':function(_0x1b8872,_0x343031){var _0x4a6cb2=_0x7980('0x22');if(_0x1b8872[_0x7980('0x18')]&&_0x1b8872['body'][_0x7980('0x23')]&&_0x1b8872[_0x7980('0x18')][_0x7980('0x24')]){_0x4a6cb2=_0x7980('0x25');}return util[_0x7980('0x1a')](_0x4a6cb2,_0x1b8872[_0x7980('0x1b')],_0x1b8872[_0x7980('0x1c')]['x-forwarded-for']?_0x1b8872[_0x7980('0x1c')]['x-forwarded-for']:_0x1b8872[_0x7980('0x1e')][_0x7980('0x1f')]||_0x1b8872['ip'],_0x1b8872[_0x7980('0x26')],_0x343031[_0x7980('0x27')],_0x343031[_0x7980('0x28')],_0x1b8872[_0x7980('0xf')]?_0x1b8872['user']['id']:null,_0x1b8872[_0x7980('0xf')]?_0x1b8872['user'][_0x7980('0xb')]:null,_0x1b8872[_0x7980('0xf')]?_0x1b8872[_0x7980('0xf')]['role']:null,_0x1b8872[_0x7980('0x18')]&&_0x1b8872[_0x7980('0x18')][_0x7980('0x23')]?_0x1b8872['body'][_0x7980('0x23')]:_0x7980('0x29'),_0x1b8872[_0x7980('0x18')]&&_0x1b8872[_0x7980('0x18')][_0x7980('0x24')]?_0x1b8872['body'][_0x7980('0x24')]:'',_0x1b8872['body']&&_0x1b8872[_0x7980('0x18')][_0x7980('0x2a')]?_0x1b8872[_0x7980('0x18')][_0x7980('0x2a')]:'');},'ignoreRoute':function(_0x185386){var _0x971aa1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x971aa1[_0x7980('0x2b')](_0x185386[_0x7980('0x26')]);}}));return _0x4209eb();});}exports[_0x7980('0x2c')]=setupLoggers; \ No newline at end of file +var _0xb27c=['url','agent_id','agent_name','setupLoggers','fs-extra','lodash','express-winston','util','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','xcally','join','client','role','name','ensureDir','then','catch','log','user','timestamp','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','connection','remoteAddress','statusCode','responseTime','inspect','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method'];(function(_0xac7e76,_0x1fa476){var _0x51bf57=function(_0x324ff6){while(--_0x324ff6){_0xac7e76['push'](_0xac7e76['shift']());}};_0x51bf57(++_0x1fa476);}(_0xb27c,0x8b));var _0xcb27=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xb27c[_0x454018];return _0x24697d;};var fs=require(_0xcb27('0x0'));var _=require(_0xcb27('0x1'));var ewinston=require(_0xcb27('0x2'));var path=require('path');var util=require(_0xcb27('0x3'));var fileLogger=require('./loggers')['fileLogger'];var safeTemplate=require(_0xcb27('0x4'))[_0xcb27('0x5')];var maskSensitiveData=require(_0xcb27('0x6'))[_0xcb27('0x7')];function ClientSideLogger(){function _0x1e45c3(_0x24a02e){var _0x424084=path['join'](_0xcb27('0x8'),'log',_0xcb27('0x9'));var _0x48ca60=path[_0xcb27('0xa')](_0xcb27('0xb'),_0x24a02e[_0xcb27('0xc')]+'-'+_0x24a02e[_0xcb27('0xd')]);return fs[_0xcb27('0xe')](path[_0xcb27('0xa')](_0x424084,_0x48ca60))[_0xcb27('0xf')](function(){var _0x59630f=fileLogger(_0xcb27('0xb'),path['join'](_0x424084,_0x48ca60));return _0x59630f;})[_0xcb27('0x10')](function(_0x43f005){throw _0x43f005;});}this[_0xcb27('0x11')]=function(_0x13b0be,_0x374f34,_0x532594,_0x52ebb5){return _0x1e45c3(_0x13b0be[_0xcb27('0x12')])[_0xcb27('0xf')](function(_0x35c286){var _0x567f24=_0x35c286[_0x374f34];return _0x567f24;})[_0xcb27('0xf')](function(_0x39d18c){var _0x2c6453=_0x13b0be[_0xcb27('0x12')]?_0x13b0be[_0xcb27('0x12')]['id']:'no-user';var _0x586df0=_0x52ebb5['data'];var _0x424554=_0x52ebb5[_0xcb27('0x13')];var _0x470946=new Date(Number(_0x424554));return _0x39d18c(_0x2c6453,_0x470946,_0x532594,_0x586df0);})[_0xcb27('0x10')](function(_0x2044c4){fileLogger(_0xcb27('0xb'))[_0xcb27('0x14')](_0x2044c4);});};}function setupLoggers(_0x52c3bf){return new Promise(function(_0x3f05f2){var _0x3fbcd7=new ClientSideLogger();var _0x26f75d=fileLogger(_0xcb27('0x15'));var _0x2b1c2c=fileLogger(_0xcb27('0x16'));_0x52c3bf[_0xcb27('0x17')](_0xcb27('0x18'),_0x3fbcd7);_0x52c3bf[_0xcb27('0x19')](ewinston[_0xcb27('0x1a')]({'winstonInstance':_0x26f75d,'meta':![],'statusLevels':!![],'msg':function(_0x453278,_0x5d2835){var _0x3e5276=_0xcb27('0x1b');if(!_['isEmpty'](_0x453278[_0xcb27('0x1c')])){_0x3e5276+=_0xcb27('0x1d');var _0x164fbc=_0x453278[_0xcb27('0x1c')];maskSensitiveData(_0x164fbc);}return safeTemplate(util[_0xcb27('0x1e')](_0x3e5276,_0x453278['method'],_0x453278[_0xcb27('0x1f')][_0xcb27('0x20')]?_0x453278[_0xcb27('0x1f')]['x-forwarded-for']:_0x453278[_0xcb27('0x21')][_0xcb27('0x22')]||_0x453278['ip'],_0x453278['url'],_0x5d2835[_0xcb27('0x23')],_0x5d2835[_0xcb27('0x24')],_0x453278['user']?_0x453278['user']['id']:null,_0x453278[_0xcb27('0x12')]?_0x453278['user'][_0xcb27('0xd')]:null,_0x453278['user']?_0x453278[_0xcb27('0x12')][_0xcb27('0xc')]:null,_0x164fbc?util[_0xcb27('0x25')](_0x164fbc,![],null):''));}}));_0x52c3bf[_0xcb27('0x19')](ewinston[_0xcb27('0x1a')]({'winstonInstance':_0x2b1c2c,'meta':![],'statusLevels':!![],'msg':function(_0xad5526,_0xac6383){var _0x47540b='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0xad5526[_0xcb27('0x1c')]&&_0xad5526['body'][_0xcb27('0x26')]&&_0xad5526[_0xcb27('0x1c')]['agent_id']){_0x47540b=_0xcb27('0x27');}return util[_0xcb27('0x1e')](_0x47540b,_0xad5526[_0xcb27('0x28')],_0xad5526['headers']['x-forwarded-for']?_0xad5526[_0xcb27('0x1f')][_0xcb27('0x20')]:_0xad5526[_0xcb27('0x21')][_0xcb27('0x22')]||_0xad5526['ip'],_0xad5526[_0xcb27('0x29')],_0xac6383['statusCode'],_0xac6383[_0xcb27('0x24')],_0xad5526[_0xcb27('0x12')]?_0xad5526['user']['id']:null,_0xad5526[_0xcb27('0x12')]?_0xad5526[_0xcb27('0x12')][_0xcb27('0xd')]:null,_0xad5526[_0xcb27('0x12')]?_0xad5526[_0xcb27('0x12')][_0xcb27('0xc')]:null,_0xad5526[_0xcb27('0x1c')]&&_0xad5526[_0xcb27('0x1c')][_0xcb27('0x26')]?_0xad5526[_0xcb27('0x1c')][_0xcb27('0x26')]:'other',_0xad5526[_0xcb27('0x1c')]&&_0xad5526[_0xcb27('0x1c')][_0xcb27('0x2a')]?_0xad5526[_0xcb27('0x1c')][_0xcb27('0x2a')]:'',_0xad5526['body']&&_0xad5526[_0xcb27('0x1c')][_0xcb27('0x2b')]?_0xad5526[_0xcb27('0x1c')][_0xcb27('0x2b')]:'');},'ignoreRoute':function(_0x5dd580){var _0x3eccec=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3eccec['test'](_0x5dd580[_0xcb27('0x29')]);}}));return _0x3f05f2();});}exports[_0xcb27('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 713a9ce..bd07a16 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8963=['transports','Console','%s-%s','error','warn','consoleLogger','fileLogger','path','util','moment','../config/environment','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','/var/log/xcally','join','%s-%s.log','message','replace','{{{','}}}','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','keys','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger'];(function(_0x11a962,_0x3cc338){var _0x55d423=function(_0xf4b236){while(--_0xf4b236){_0x11a962['push'](_0x11a962['shift']());}};_0x55d423(++_0x3cc338);}(_0x8963,0x79));var _0x3896=function(_0x1738ac,_0x2f527a){_0x1738ac=_0x1738ac-0x0;var _0x429055=_0x8963[_0x1738ac];return _0x429055;};'use strict';var path=require(_0x3896('0x0'));var util=require(_0x3896('0x1'));var moment=require(_0x3896('0x2'));var winston=require('winston');var config=require(_0x3896('0x3'));var debugLevel=config['debugLevel']?config['debugLevel'][_0x3896('0x4')]():_0x3896('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':_0x3896('0x6'),'error':_0x3896('0x7'),'warn':_0x3896('0x8'),'info':'white','print':_0x3896('0x9'),'success':_0x3896('0xa'),'http':_0x3896('0xb'),'verbose':_0x3896('0xc'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x1b0451,_0x3a6e9e,_0x3da1dd){var _0x12a248=_0x1b0451||_0x3896('0xd');return path[_0x3896('0xe')](_0x12a248,util['format'](_0x3896('0xf'),_0x3a6e9e,_0x3da1dd));}function formatter(_0x1c1cb6,_0x3479fe){_0x3479fe['message']=_0x3479fe[_0x3896('0x10')][_0x3896('0x11')](/@@{/g,_0x3896('0x12'))['replace'](/}@@/g,_0x3896('0x13'))[_0x3896('0x11')](/@{/g,'{{')[_0x3896('0x11')](/}@/g,'}}');return util[_0x3896('0x14')](_0x3896('0x15'),moment()[_0x3896('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),_0x3479fe[_0x3896('0x16')][_0x3896('0x17')](),_0x1c1cb6,_0x3479fe[_0x3896('0x10')]);}function fileFormat(_0x2f3caa,_0x8114eb){_0x8114eb[_0x3896('0x10')]=_0x8114eb['message']['replace'](/@@{/g,_0x3896('0x12'))[_0x3896('0x11')](/}@@/g,_0x3896('0x13'))[_0x3896('0x11')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x8d918b=_0x8114eb['meta']&&Object[_0x3896('0x18')](_0x8114eb[_0x3896('0x19')])[_0x3896('0x1a')]?'\x0a\x09'+JSON[_0x3896('0x1b')](_0x8114eb[_0x3896('0x19')]):'';return util['format'](_0x3896('0x1c'),moment()[_0x3896('0x14')](_0x3896('0x1d')),_0x8114eb[_0x3896('0x16')][_0x3896('0x17')](),_0x2f3caa,_0x8114eb[_0x3896('0x10')],_0x8d918b);}function consoleLogger(){var _0x57b042=new winston[(_0x3896('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3896('0x1f'))][(_0x3896('0x20'))]({'level':'warn','json':![],'formatter':function(_0x2d3c8d){return formatter('',_0x2d3c8d);}})]});return _0x57b042;}function fileLogger(_0x436dc7,_0x5effe7){var _0x33ba7c=new winston[(_0x3896('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x3896('0x1f'))]['File']({'name':util[_0x3896('0x14')](_0x3896('0x21'),_0x436dc7,_0x3896('0x22')),'filename':getLogFileName(_0x5effe7,_0x436dc7,_0x3896('0x22')),'level':_0x3896('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x474d16){return fileFormat(_0x436dc7,_0x474d16);}}),new winston['transports']['File']({'name':util[_0x3896('0x14')]('%s-%s',_0x436dc7,debugLevel),'filename':getLogFileName(_0x5effe7,_0x436dc7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4dda96){return fileFormat(_0x436dc7,_0x4dda96);}}),new winston['transports'][(_0x3896('0x20'))]({'level':_0x3896('0x23'),'json':![],'formatter':function(_0x27b6c0){return fileFormat(_0x436dc7,_0x27b6c0);}})]});return _0x33ba7c;}exports[_0x3896('0x24')]=consoleLogger;exports[_0x3896('0x25')]=fileLogger; \ No newline at end of file +var _0x214c=['{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','warn','File','%s-%s','error','Console','consoleLogger','fileLogger','path','moment','winston','../config/environment','debugLevel','toLowerCase','bold\x20white','gray','bold\x20magenta','bold\x20cyan','format','%s-%s.log','message','replace'];(function(_0x1a0c09,_0x3e64bd){var _0x471871=function(_0x5c2255){while(--_0x5c2255){_0x1a0c09['push'](_0x1a0c09['shift']());}};_0x471871(++_0x3e64bd);}(_0x214c,0x172));var _0xc214=function(_0x4a8e82,_0x4c53c1){_0x4a8e82=_0x4a8e82-0x0;var _0x3ba3e6=_0x214c[_0x4a8e82];return _0x3ba3e6;};'use strict';var path=require(_0xc214('0x0'));var util=require('util');var moment=require(_0xc214('0x1'));var winston=require(_0xc214('0x2'));var config=require(_0xc214('0x3'));var debugLevel=config[_0xc214('0x4')]?config[_0xc214('0x4')][_0xc214('0x5')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':'bold\x20yellow','info':'white','print':_0xc214('0x6'),'success':'bold\x20green','http':_0xc214('0x7'),'verbose':_0xc214('0x8'),'debug':'bold\x20blue','silly':_0xc214('0x9')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x3fa38e,_0x1d5155,_0x540944){var _0x1bcaea=_0x3fa38e||'/var/log/xcally';return path['join'](_0x1bcaea,util[_0xc214('0xa')](_0xc214('0xb'),_0x1d5155,_0x540944));}function formatter(_0x2c580d,_0x4e5bc4){_0x4e5bc4[_0xc214('0xc')]=_0x4e5bc4[_0xc214('0xc')][_0xc214('0xd')](/@@{/g,_0xc214('0xe'))[_0xc214('0xd')](/}@@/g,_0xc214('0xf'))[_0xc214('0xd')](/@{/g,'{{')[_0xc214('0xd')](/}@/g,'}}');return util['format'](_0xc214('0x10'),moment()[_0xc214('0xa')](_0xc214('0x11')),_0x4e5bc4[_0xc214('0x12')][_0xc214('0x13')](),_0x2c580d,_0x4e5bc4[_0xc214('0xc')]);}function fileFormat(_0x51d11a,_0x3c7961){_0x3c7961[_0xc214('0xc')]=_0x3c7961[_0xc214('0xc')][_0xc214('0xd')](/@@{/g,_0xc214('0xe'))['replace'](/}@@/g,_0xc214('0xf'))[_0xc214('0xd')](/@{/g,'{{')[_0xc214('0xd')](/}@/g,'}}');var _0x2b4978=_0x3c7961[_0xc214('0x14')]&&Object[_0xc214('0x15')](_0x3c7961[_0xc214('0x14')])['length']?'\x0a\x09'+JSON['stringify'](_0x3c7961[_0xc214('0x14')]):'';return util['format'](_0xc214('0x16'),moment()[_0xc214('0xa')](_0xc214('0x11')),_0x3c7961['level']['toUpperCase'](),_0x51d11a,_0x3c7961[_0xc214('0xc')],_0x2b4978);}function consoleLogger(){var _0x17ac59=new winston[(_0xc214('0x17'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc214('0x18'))]['Console']({'level':_0xc214('0x19'),'json':![],'formatter':function(_0x483580){return formatter('',_0x483580);}})]});return _0x17ac59;}function fileLogger(_0x4722ec,_0xa4aaae){var _0x59aa1b=new winston[(_0xc214('0x17'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xc214('0x18'))][(_0xc214('0x1a'))]({'name':util[_0xc214('0xa')](_0xc214('0x1b'),_0x4722ec,_0xc214('0x1c')),'filename':getLogFileName(_0xa4aaae,_0x4722ec,_0xc214('0x1c')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x46e369){return fileFormat(_0x4722ec,_0x46e369);}}),new winston[(_0xc214('0x18'))][(_0xc214('0x1a'))]({'name':util[_0xc214('0xa')](_0xc214('0x1b'),_0x4722ec,debugLevel),'filename':getLogFileName(_0xa4aaae,_0x4722ec,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3f690e){return fileFormat(_0x4722ec,_0x3f690e);}}),new winston[(_0xc214('0x18'))][(_0xc214('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x5cca19){return fileFormat(_0x4722ec,_0x5cca19);}})]});return _0x59aa1b;}exports[_0xc214('0x1e')]=consoleLogger;exports[_0xc214('0x1f')]=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 8a2ccab..1f0ce06 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 _0x1967=['secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x1967,0x173));var _0x7196=function(_0x52fe2e,_0x418070){_0x52fe2e=_0x52fe2e-0x0;var _0x19deec=_0x1967[_0x52fe2e];return _0x19deec;};var _=require('lodash');var sensitiveFields=[_0x7196('0x0'),_0x7196('0x1'),_0x7196('0x2'),_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),_0x7196('0x9'),'email',_0x7196('0xa'),_0x7196('0xb'),_0x7196('0xc'),_0x7196('0xd'),_0x7196('0xe'),_0x7196('0xf'),'token',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0x14'),'consumerSecret','membername',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0x18'),_0x7196('0x19'),_0x7196('0x1a'),_0x7196('0x1b'),_0x7196('0x1c'),_0x7196('0x1d'),_0x7196('0x1e'),_0x7196('0x1f'),'accountSid',_0x7196('0x20'),_0x7196('0x21'),_0x7196('0x22'),_0x7196('0x23'),'oldPassword'];function maskSensitiveData(_0x31c778){const _0x539414=/(?!^)[\s\S](?!$)/g;if(_[_0x7196('0x24')](_0x31c778)){for(const _0x2590a6 in _0x31c778){if(_[_0x7196('0x25')](_0x31c778[_0x2590a6])){for(let _0x3ed1ad=0x0;_0x3ed1ad<_0x31c778[_0x2590a6][_0x7196('0x26')];_0x3ed1ad++){maskSensitiveData(_0x31c778[_0x2590a6][_0x3ed1ad]);}}else if(_[_0x7196('0x24')](_0x31c778[_0x2590a6])){maskSensitiveData(_0x31c778[_0x2590a6]);}else if(_[_0x7196('0x27')](_0x31c778[_0x2590a6])){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](/{{{/g,_0x7196('0x29'))[_0x7196('0x28')](/}}}/g,_0x7196('0x2a'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x7196('0x2b')](sensitiveFields,_0x2590a6)){_0x31c778[_0x2590a6]=_0x31c778[_0x2590a6][_0x7196('0x28')](_0x539414,'*');}}}}}module[_0x7196('0x2c')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x38616d,_0x22fbe5){var _0x505626=function(_0x5b3a5a){while(--_0x5b3a5a){_0x38616d['push'](_0x38616d['shift']());}};_0x505626(++_0x22fbe5);}(_0x2ef3,0xba));var _0x32ef=function(_0x3448ad,_0x28a083){_0x3448ad=_0x3448ad-0x0;var _0xbb9d0c=_0x2ef3[_0x3448ad];return _0xbb9d0c;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 7fe2235..86d71b1 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xea28=['isPlainObject','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0x2807ce,_0x5473c7){var _0x29a3f1=function(_0x2fb400){while(--_0x2fb400){_0x2807ce['push'](_0x2807ce['shift']());}};_0x29a3f1(++_0x5473c7);}(_0xea28,0x13a));var _0x8ea2=function(_0x2ccc38,_0x12733a){_0x2ccc38=_0x2ccc38-0x0;var _0x1ac591=_0xea28[_0x2ccc38];return _0x1ac591;};var _=require(_0x8ea2('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2e031a){return _0x2e031a==='{{'?_0x8ea2('0x1'):_0x8ea2('0x2');}function safeTemplate(_0x459c4e){var _0x25e47e=_0x459c4e;if(typeof _0x459c4e===_0x8ea2('0x3')){_0x25e47e=_0x459c4e[_0x8ea2('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x459c4e)){_0x25e47e=_0x459c4e[_0x8ea2('0x5')](function(_0x23aaf1){return safeTemplate(_0x23aaf1);});}else if(_[_0x8ea2('0x6')](_0x459c4e)){_0x25e47e=Object['keys'](_0x459c4e)[_0x8ea2('0x7')](function(_0x435d78,_0xb7f278){_0x435d78[_0xb7f278]=safeTemplate(_0x459c4e[_0xb7f278]);return _0x435d78;},{});}return _0x25e47e;}module[_0x8ea2('0x8')][_0x8ea2('0x9')]=safeTemplate; \ No newline at end of file +var _0x8603=['{\x20{\x20','\x20}\x20}','string','replace','isArray','keys','reduce','exports'];(function(_0xcabc99,_0x579f01){var _0x187efe=function(_0x409395){while(--_0x409395){_0xcabc99['push'](_0xcabc99['shift']());}};_0x187efe(++_0x579f01);}(_0x8603,0x190));var _0x3860=function(_0x42a8fc,_0x455dab){_0x42a8fc=_0x42a8fc-0x0;var _0x5aad21=_0x8603[_0x42a8fc];return _0x5aad21;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x2f848f){return _0x2f848f==='{{'?_0x3860('0x0'):_0x3860('0x1');}function safeTemplate(_0x51bfda){var _0x4961d6=_0x51bfda;if(typeof _0x51bfda===_0x3860('0x2')){_0x4961d6=_0x51bfda[_0x3860('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x3860('0x4')](_0x51bfda)){_0x4961d6=_0x51bfda['map'](function(_0x2fc97a){return safeTemplate(_0x2fc97a);});}else if(_['isPlainObject'](_0x51bfda)){_0x4961d6=Object[_0x3860('0x5')](_0x51bfda)[_0x3860('0x6')](function(_0x1eca44,_0xd3ce26){_0x1eca44[_0xd3ce26]=safeTemplate(_0x51bfda[_0xd3ce26]);return _0x1eca44;},{});}return _0x4961d6;}module[_0x3860('0x7')]['safeTemplate']=safeTemplate; \ No newline at end of file -- 1.7.1